From 5454a76752ba6f9042e6f60706753ce6c3aebe34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 20 Oct 2021 09:59:55 +0000 Subject: [PATCH 001/890] 8275273: Add missing HtmlStyle documentation Reviewed-by: jjg --- .../formats/html/markup/HtmlStyle.java | 163 ++++++++++++++---- .../doclets/toolkit/resources/stylesheet.css | 2 +- 2 files changed, 135 insertions(+), 30 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java index 5af001978ab..13d04522ed9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java @@ -51,34 +51,6 @@ import java.util.regex.Pattern; * @see WhatWG: {@code class} attribute */ public enum HtmlStyle { - block, - blockList, - circle, - classUses, - externalLink, - hierarchy, - horizontal, - implementationLabel, - index, - inheritance, - inheritedList, - legalCopy, - memberNameLabel, - memberNameLink, - nameValue, - packages, - packageHierarchyLabel, - packageUses, - serializedPackageContainer, - sourceContainer, - sourceLineNo, - typeNameLabel, - typeNameLink, - - /** - * The class of the {@code pre} element presenting a snippet. - */ - snippet, // // @@ -604,6 +576,12 @@ public enum HtmlStyle { */ packageSignature, + /** + * The class of a {@code span} element containing the type name in a + * type signature. + */ + typeNameLabel, + /** * The class of an element containing a type signature. */ @@ -852,7 +830,134 @@ public enum HtmlStyle { /** * The class of the second-level lists in the table of contents for the page. */ - helpSubTOC("help-subtoc"); + helpSubTOC("help-subtoc"), + + // + + // + // + // The following constants are used in various places across a variety of pages. + + /** + * The class of a {@code div} element containing part of a documentation comment. + */ + block, + + /** + * The class of a {@code ul} element containing parts of documentation comments. + */ + blockList, + + /** + * The class of a {@code ul} element in the hierarchical tree view. + */ + circle, + + /** + * The class of a {@code ul} element listing classes in the uses page. + */ + classUses, + + /** + * The class of an {@code a} element for a link with an external target. + */ + externalLink, + + /** + * The class of a {@code section} element containing a hierarchical + * tree view. + */ + hierarchy, + + /** + * The class of a {@code ul} element with horizontal (inline) display style. + */ + horizontal, + + /** + * The class of a {@code span} element containing implementation details of + * a "provides" entry in a module page. + */ + implementationLabel, + + /** + * The class of a {@code dl} element in the body of index pages. + */ + index, + + /** + * The class of a {@code div} element containing the inheritance tree of + * a class page. + */ + inheritance, + + /** + * The class of a {@code div} element containing a summary of inherited + * members in the class page. + */ + inheritedList, + + /** + * The class of a {@code p} element containing legal copy in the page footer. + */ + legalCopy, + + /** + * The class of an {@code a} element for a link in member summary lists. + */ + memberNameLink, + + /** + * The class for a {@code dl} element containing serial UID information in + * the serialized form page. + */ + nameValue, + + /** + * The class of a {@code section} element containing the packages section + * in the constant field values page. + */ + packages, + + /** + * The class of a {@code span} element containing the package hierarchy + * label in the tree page. + */ + packageHierarchyLabel, + + /** + * The class of a {@code li} element containing a content section of + * the package uses page. + */ + packageUses, + + /** + * The class of a {@code section} element for a package in the serialized + * form page. + */ + serializedPackageContainer, + + /** + * The class of a {@code div} element containing source code in the + * source page. + */ + sourceContainer, + + /** + * The class of a {@code span} element containing a line number in the + * source page. + */ + sourceLineNo, + + /** + * The class of the {@code pre} element presenting a snippet. + */ + snippet, + + /** + * The class of an {@code a} element for a link to a class or interface. + */ + typeNameLink; // diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index 3a986db7e68..bb7934c12c0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -522,7 +522,7 @@ div.block { margin:0 10px 5px 0; color:#474747; } -.deprecated-label, .description-from-type-label, .implementation-label, .member-name-label, .member-name-link, +.deprecated-label, .description-from-type-label, .implementation-label, .member-name-link, .module-label-in-package, .module-label-in-type, .package-label-in-type, .package-hierarchy-label, .type-name-label, .type-name-link, .search-tag-link, .preview-label { font-weight:bold; -- GitLab From 50a57238a8e34a976354b1de91c14cddacb3d88f Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 20 Oct 2021 11:42:58 +0000 Subject: [PATCH 002/890] 8274910: Compile in G1 evacuation failure injection code based on define Reviewed-by: sjohanss, ayang --- .../share/gc/g1/g1ParScanThreadState.cpp | 4 +- .../share/gc/g1/g1ParScanThreadState.hpp | 9 +- .../gc/g1/g1YoungGCEvacFailureInjector.cpp | 4 +- .../gc/g1/g1YoungGCEvacFailureInjector.hpp | 23 +++-- .../g1YoungGCEvacFailureInjector.inline.hpp | 4 +- src/hotspot/share/gc/g1/g1_globals.hpp | 94 +++++++++++++------ 6 files changed, 93 insertions(+), 45 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp index 92772cc2db7..bba90e6a742 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp @@ -85,7 +85,7 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, _num_optional_regions(optional_cset_length), _numa(g1h->numa()), _obj_alloc_stat(NULL), - NOT_PRODUCT(_evac_failure_inject_counter(0) COMMA) + EVAC_FAILURE_INJECTOR_ONLY(_evac_failure_inject_counter(0) COMMA) _preserved_marks(preserved_marks), _evacuation_failed_info(), _evac_failure_regions(evac_failure_regions) @@ -420,7 +420,7 @@ HeapWord* G1ParScanThreadState::allocate_copy_slow(G1HeapRegionAttr* dest_attr, return obj_ptr; } -#ifndef PRODUCT +#if EVAC_FAILURE_INJECTOR bool G1ParScanThreadState::inject_evacuation_failure() { return _g1h->evac_failure_injector()->evacuation_should_fail(_evac_failure_inject_counter); } diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp index 0ecc11f50a5..478b8745731 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp @@ -28,6 +28,8 @@ #include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1RedirtyCardsQueue.hpp" #include "gc/g1/g1OopClosures.hpp" +#include "gc/g1/g1YoungGCEvacFailureInjector.hpp" +#include "gc/g1/g1_globals.hpp" #include "gc/shared/ageTable.hpp" #include "gc/shared/copyFailedInfo.hpp" #include "gc/shared/partialArrayTaskStepper.hpp" @@ -99,14 +101,13 @@ class G1ParScanThreadState : public CHeapObj { size_t* _obj_alloc_stat; // Per-thread evacuation failure data structures. -#ifndef PRODUCT - size_t _evac_failure_inject_counter; -#endif + EVAC_FAILURE_INJECTOR_ONLY(size_t _evac_failure_inject_counter;) + PreservedMarks* _preserved_marks; EvacuationFailedInfo _evacuation_failed_info; G1EvacFailureRegions* _evac_failure_regions; - bool inject_evacuation_failure() PRODUCT_RETURN_( return false; ); + bool inject_evacuation_failure() EVAC_FAILURE_INJECTOR_RETURN_( return false; ); public: G1ParScanThreadState(G1CollectedHeap* g1h, diff --git a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp index cedaba765ea..67b44263004 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp @@ -28,7 +28,7 @@ #include "gc/g1/g1YoungGCEvacFailureInjector.inline.hpp" #include "gc/g1/g1_globals.hpp" -#ifndef PRODUCT +#if EVAC_FAILURE_INJECTOR bool G1YoungGCEvacFailureInjector::arm_if_needed_for_gc_type(bool for_young_gc, bool during_concurrent_start, @@ -76,4 +76,4 @@ void G1YoungGCEvacFailureInjector::reset() { _inject_evacuation_failure_for_current_gc = false; } -#endif // #ifndef PRODUCT +#endif // #if EVAC_FAILURE_INJECTOR diff --git a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp index 64d3f28b1ff..eb0d4598c14 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp +++ b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp @@ -25,9 +25,20 @@ #ifndef SHARE_GC_G1_G1YOUNGGCEVACUATIONFAILUREINJECTOR_HPP #define SHARE_GC_G1_G1YOUNGGCEVACUATIONFAILUREINJECTOR_HPP +#include "gc/g1/g1_globals.hpp" #include "memory/allStatic.hpp" #include "utilities/globalDefinitions.hpp" +#if EVAC_FAILURE_INJECTOR +#define EVAC_FAILURE_INJECTOR_RETURN +#define EVAC_FAILURE_INJECTOR_RETURN_(code) +#define EVAC_FAILURE_INJECTOR_ONLY(code) code +#else +#define EVAC_FAILURE_INJECTOR_RETURN { return; } +#define EVAC_FAILURE_INJECTOR_RETURN_(code) { code } +#define EVAC_FAILURE_INJECTOR_ONLY(code) +#endif // EVAC_FAILURE_INJECTOR + // Support for injecting evacuation failures based on the G1EvacuationFailureALot* // flags. Analogous to PromotionFailureALot for the other collectors. // @@ -35,9 +46,9 @@ // inbetween we "arm" the injector to induce evacuation failures after // G1EvacuationFailureALotCount successful evacuations. // -// Available only in non-product builds. +// Available only when EVAC_FAILURE_INJECTOR is defined. class G1YoungGCEvacFailureInjector { -#ifndef PRODUCT +#if EVAC_FAILURE_INJECTOR // Should we inject evacuation failures in the current GC. bool _inject_evacuation_failure_for_current_gc; @@ -49,20 +60,20 @@ class G1YoungGCEvacFailureInjector { bool arm_if_needed_for_gc_type(bool for_young_gc, bool during_concurrent_start, - bool mark_or_rebuild_in_progress) PRODUCT_RETURN_( return false; ); + bool mark_or_rebuild_in_progress) EVAC_FAILURE_INJECTOR_RETURN_( return false; ); public: // Arm the evacuation failure injector if needed for the current // GC (based upon the type of GC and which command line flags are set); - void arm_if_needed() PRODUCT_RETURN; + void arm_if_needed() EVAC_FAILURE_INJECTOR_RETURN; // Return true if it's time to cause an evacuation failure; the caller // provides the (preferably thread-local) counter to minimize performance impact. - bool evacuation_should_fail(size_t& counter) PRODUCT_RETURN_( return false; ); + bool evacuation_should_fail(size_t& counter) EVAC_FAILURE_INJECTOR_RETURN_( return false; ); // Reset the evacuation failure injection counters. Should be called at // the end of an evacuation pause in which an evacuation failure occurred. - void reset() PRODUCT_RETURN; + void reset() EVAC_FAILURE_INJECTOR_RETURN; }; #endif /* SHARE_GC_G1_G1YOUNGGCEVACUATIONFAILUREINJECTOR_HPP */ diff --git a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp index 19499c266c2..e259fc61376 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp +++ b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp @@ -30,7 +30,7 @@ #include "gc/g1/g1_globals.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" -#ifndef PRODUCT +#if EVAC_FAILURE_INJECTOR inline bool G1YoungGCEvacFailureInjector::evacuation_should_fail(size_t& counter) { if (!_inject_evacuation_failure_for_current_gc) { @@ -43,7 +43,7 @@ inline bool G1YoungGCEvacFailureInjector::evacuation_should_fail(size_t& counter return true; } -#endif // #ifndef PRODUCT +#endif // #if EVAC_FAILURE_INJECTOR #endif /* SHARE_GC_G1_G1YOUNGGCEVACUATIONFAILUREINJECTOR_INLINE_HPP */ diff --git a/src/hotspot/share/gc/g1/g1_globals.hpp b/src/hotspot/share/gc/g1/g1_globals.hpp index 8b87c373d5e..34dbabe4fec 100644 --- a/src/hotspot/share/gc/g1/g1_globals.hpp +++ b/src/hotspot/share/gc/g1/g1_globals.hpp @@ -27,6 +27,62 @@ #include "runtime/globals_shared.hpp" +// Enable evacuation failure injector by default in non-product builds. + +#ifdef EVAC_FAILURE_INJECTOR +#error "EVAC_FAILURE_INJECTOR already defined" +#endif +#ifndef PRODUCT +#define EVAC_FAILURE_INJECTOR 1 +#else +#define EVAC_FAILURE_INJECTOR 0 +#endif + +#if EVAC_FAILURE_INJECTOR +#define GC_G1_EVACUATION_FAILURE_FLAGS(develop, \ + develop_pd, \ + product, \ + product_pd, \ + notproduct, \ + range, \ + constraint) \ + \ + product(bool, G1EvacuationFailureALot, false, \ + "Force use of evacuation failure handling during certain " \ + "evacuation pauses") \ + \ + product(uintx, G1EvacuationFailureALotCount, 1000, \ + "Number of successful evacuations between evacuation failures " \ + "occurring at object copying per thread") \ + \ + product(uintx, G1EvacuationFailureALotInterval, 5, \ + "Total collections between forced triggering of evacuation " \ + "failures") \ + \ + product(bool, G1EvacuationFailureALotDuringConcMark, true, \ + "Force use of evacuation failure handling during evacuation " \ + "pauses when marking is in progress") \ + \ + product(bool, G1EvacuationFailureALotDuringConcurrentStart, true, \ + "Force use of evacuation failure handling during concurrent " \ + "start evacuation pauses") \ + \ + product(bool, G1EvacuationFailureALotDuringYoungGC, true, \ + "Force use of evacuation failure handling during young " \ + "evacuation pauses") \ + \ + product(bool, G1EvacuationFailureALotDuringMixedGC, true, \ + "Force use of evacuation failure handling during mixed " \ + "evacuation pauses") +#else +#define GC_G1_EVACUATION_FAILURE_FLAGS(develop, \ + develop_pd, \ + product, \ + product_pd, \ + notproduct, \ + range, \ + constraint) +#endif // // Defines all globals flags used by the garbage-first compiler. // @@ -269,34 +325,6 @@ "as a percentage of the heap size.") \ range(0, 100) \ \ - notproduct(bool, G1EvacuationFailureALot, false, \ - "Force use of evacuation failure handling during certain " \ - "evacuation pauses") \ - \ - develop(uintx, G1EvacuationFailureALotCount, 1000, \ - "Number of successful evacuations between evacuation failures " \ - "occurring at object copying per thread") \ - \ - develop(uintx, G1EvacuationFailureALotInterval, 5, \ - "Total collections between forced triggering of evacuation " \ - "failures") \ - \ - develop(bool, G1EvacuationFailureALotDuringConcMark, true, \ - "Force use of evacuation failure handling during evacuation " \ - "pauses when marking is in progress") \ - \ - develop(bool, G1EvacuationFailureALotDuringConcurrentStart, true, \ - "Force use of evacuation failure handling during concurrent " \ - "start evacuation pauses") \ - \ - develop(bool, G1EvacuationFailureALotDuringYoungGC, true, \ - "Force use of evacuation failure handling during young " \ - "evacuation pauses") \ - \ - develop(bool, G1EvacuationFailureALotDuringMixedGC, true, \ - "Force use of evacuation failure handling during mixed " \ - "evacuation pauses") \ - \ product(bool, G1VerifyRSetsDuringFullGC, false, DIAGNOSTIC, \ "If true, perform verification of each heap region's " \ "remembered set when verifying the heap during a full GC.") \ @@ -343,7 +371,15 @@ product(bool, G1UsePreventiveGC, true, DIAGNOSTIC, \ "Allows collections to be triggered proactively based on the \ number of free regions and the expected survival rates in each \ - section of the heap.") + section of the heap.") \ + \ + GC_G1_EVACUATION_FAILURE_FLAGS(develop, \ + develop_pd, \ + product, \ + product_pd, \ + notproduct, \ + range, \ + constraint) // end of GC_G1_FLAGS -- GitLab From 135cf3c94d4bce1b23c4dd7697030f558a5f682b Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Wed, 20 Oct 2021 11:46:13 +0000 Subject: [PATCH 003/890] 8275439: Remove PrintVtableStats Reviewed-by: coleenp, dholmes --- src/hotspot/share/oops/arrayKlass.cpp | 18 ------ src/hotspot/share/oops/arrayKlass.hpp | 4 -- src/hotspot/share/oops/instanceKlass.cpp | 10 ---- src/hotspot/share/oops/instanceKlass.hpp | 2 - src/hotspot/share/oops/klass.hpp | 2 - src/hotspot/share/oops/klassVtable.cpp | 74 ------------------------ src/hotspot/share/oops/klassVtable.hpp | 8 --- src/hotspot/share/runtime/globals.hpp | 3 - src/hotspot/share/runtime/java.cpp | 4 -- 9 files changed, 125 deletions(-) diff --git a/src/hotspot/share/oops/arrayKlass.cpp b/src/hotspot/share/oops/arrayKlass.cpp index b1ad66db041..1c753defca5 100644 --- a/src/hotspot/share/oops/arrayKlass.cpp +++ b/src/hotspot/share/oops/arrayKlass.cpp @@ -135,24 +135,6 @@ objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) { return o; } -void ArrayKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) { - Klass* k = this; - // Iterate over this array klass and all higher dimensions - while (k != NULL) { - f(k, CHECK); - k = ArrayKlass::cast(k)->higher_dimension(); - } -} - -void ArrayKlass::array_klasses_do(void f(Klass* k)) { - Klass* k = this; - // Iterate over this array klass and all higher dimensions - while (k != NULL) { - f(k); - k = ArrayKlass::cast(k)->higher_dimension(); - } -} - jint ArrayKlass::compute_modifier_flags() const { return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC; } diff --git a/src/hotspot/share/oops/arrayKlass.hpp b/src/hotspot/share/oops/arrayKlass.hpp index a56343886b3..bed87db0d2a 100644 --- a/src/hotspot/share/oops/arrayKlass.hpp +++ b/src/hotspot/share/oops/arrayKlass.hpp @@ -104,10 +104,6 @@ class ArrayKlass: public Klass { virtual void metaspace_pointers_do(MetaspaceClosure* iter); - // Iterators - void array_klasses_do(void f(Klass* k)); - void array_klasses_do(void f(Klass* k, TRAPS), TRAPS); - // Return a handle. static void complete_create_array_klass(ArrayKlass* k, Klass* super_klass, ModuleEntry* module, TRAPS); diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index ebf5f3c98a9..d65d1eb661e 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1721,16 +1721,6 @@ void InstanceKlass::print_nonstatic_fields(FieldClosure* cl) { } } -void InstanceKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) { - if (array_klasses() != NULL) - array_klasses()->array_klasses_do(f, THREAD); -} - -void InstanceKlass::array_klasses_do(void f(Klass* k)) { - if (array_klasses() != NULL) - array_klasses()->array_klasses_do(f); -} - #ifdef ASSERT static int linear_search(const Array* methods, const Symbol* name, diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index 61eae5cb5de..a7be3ba1852 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -1005,8 +1005,6 @@ public: void print_nonstatic_fields(FieldClosure* cl); // including inherited and injected fields void methods_do(void f(Method* method)); - void array_klasses_do(void f(Klass* k)); - void array_klasses_do(void f(Klass* k, TRAPS), TRAPS); static InstanceKlass* cast(Klass* k) { return const_cast(cast(const_cast(k))); diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp index 6fb94c3c8c7..b34b4fd8255 100644 --- a/src/hotspot/share/oops/klass.hpp +++ b/src/hotspot/share/oops/klass.hpp @@ -653,8 +653,6 @@ protected: clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false); } - virtual void array_klasses_do(void f(Klass* k)) {} - // Return self, except for abstract classes with exactly 1 // implementor. Then return the 1 concrete implementation. Klass *up_cast_abstract(); diff --git a/src/hotspot/share/oops/klassVtable.cpp b/src/hotspot/share/oops/klassVtable.cpp index 99974dce03b..b107f5d70b2 100644 --- a/src/hotspot/share/oops/klassVtable.cpp +++ b/src/hotspot/share/oops/klassVtable.cpp @@ -1511,9 +1511,6 @@ int klassItable::compute_itable_size(Array* transitive_interface // There's alway an extra itable entry so we can null-terminate it. int itable_size = calc_itable_size(cic.nof_interfaces() + 1, cic.nof_methods()); - // Statistics - update_stats(itable_size * wordSize); - return itable_size; } @@ -1628,75 +1625,4 @@ void vtableEntry::print() { tty->print("m " PTR_FORMAT " ", p2i(method())); } } - -class VtableStats : AllStatic { - public: - static int no_klasses; // # classes with vtables - static int no_array_klasses; // # array classes - static int no_instance_klasses; // # instanceKlasses - static int sum_of_vtable_len; // total # of vtable entries - static int sum_of_array_vtable_len; // total # of vtable entries in array klasses only - static int fixed; // total fixed overhead in bytes - static int filler; // overhead caused by filler bytes - static int entries; // total bytes consumed by vtable entries - static int array_entries; // total bytes consumed by array vtable entries - - static void do_class(Klass* k) { - Klass* kl = k; - klassVtable vt = kl->vtable(); - no_klasses++; - if (kl->is_instance_klass()) { - no_instance_klasses++; - kl->array_klasses_do(do_class); - } - if (kl->is_array_klass()) { - no_array_klasses++; - sum_of_array_vtable_len += vt.length(); - } - sum_of_vtable_len += vt.length(); - } - - static void compute() { - LockedClassesDo locked_do_class(&do_class); - ClassLoaderDataGraph::classes_do(&locked_do_class); - fixed = no_klasses * oopSize; // vtable length - // filler size is a conservative approximation - filler = oopSize * (no_klasses - no_instance_klasses) * (sizeof(InstanceKlass) - sizeof(ArrayKlass) - 1); - entries = sizeof(vtableEntry) * sum_of_vtable_len; - array_entries = sizeof(vtableEntry) * sum_of_array_vtable_len; - } -}; - -int VtableStats::no_klasses = 0; -int VtableStats::no_array_klasses = 0; -int VtableStats::no_instance_klasses = 0; -int VtableStats::sum_of_vtable_len = 0; -int VtableStats::sum_of_array_vtable_len = 0; -int VtableStats::fixed = 0; -int VtableStats::filler = 0; -int VtableStats::entries = 0; -int VtableStats::array_entries = 0; - -void klassVtable::print_statistics() { - ResourceMark rm; - VtableStats::compute(); - tty->print_cr("vtable statistics:"); - tty->print_cr("%6d classes (%d instance, %d array)", VtableStats::no_klasses, VtableStats::no_instance_klasses, VtableStats::no_array_klasses); - int total = VtableStats::fixed + VtableStats::filler + VtableStats::entries; - tty->print_cr("%6d bytes fixed overhead (refs + vtable object header)", VtableStats::fixed); - tty->print_cr("%6d bytes filler overhead", VtableStats::filler); - tty->print_cr("%6d bytes for vtable entries (%d for arrays)", VtableStats::entries, VtableStats::array_entries); - tty->print_cr("%6d bytes total", total); -} - -int klassItable::_total_classes; // Total no. of classes with itables -size_t klassItable::_total_size; // Total no. of bytes used for itables - -void klassItable::print_statistics() { - tty->print_cr("itable statistics:"); - tty->print_cr("%6d classes with itables", _total_classes); - tty->print_cr(SIZE_FORMAT_W(6) " K uses for itables (average by class: " SIZE_FORMAT " bytes)", - _total_size / K, _total_size / _total_classes); -} - #endif // PRODUCT diff --git a/src/hotspot/share/oops/klassVtable.hpp b/src/hotspot/share/oops/klassVtable.hpp index bf26dea7bd5..d00972f4c78 100644 --- a/src/hotspot/share/oops/klassVtable.hpp +++ b/src/hotspot/share/oops/klassVtable.hpp @@ -97,7 +97,6 @@ class klassVtable { // Debugging code void print() PRODUCT_RETURN; void verify(outputStream* st, bool force = false); - static void print_statistics() PRODUCT_RETURN; protected: friend class vtableEntry; @@ -319,8 +318,6 @@ class klassItable { static int compute_itable_size(Array* transitive_interfaces); static void setup_itable_offset_table(InstanceKlass* klass); - // Debugging/Statistics - static void print_statistics() PRODUCT_RETURN; private: intptr_t* vtable_start() const { return ((intptr_t*)_klass) + _table_offset; } intptr_t* method_start() const { return vtable_start() + _size_offset_table * itableOffsetEntry::size(); } @@ -328,11 +325,6 @@ class klassItable { // Helper methods static int calc_itable_size(int num_interfaces, int num_methods) { return (num_interfaces * itableOffsetEntry::size()) + (num_methods * itableMethodEntry::size()); } - // Statistics - NOT_PRODUCT(static int _total_classes;) // Total no. of classes with itables - NOT_PRODUCT(static size_t _total_size;) // Total no. of bytes used for itables - - static void update_stats(int size) PRODUCT_RETURN NOT_PRODUCT({ _total_classes++; _total_size += size; }) }; #endif // SHARE_OOPS_KLASSVTABLE_HPP diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 299613611c0..e705e40d93f 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1091,9 +1091,6 @@ const intx ObjectAlignmentInBytes = 8; develop(bool, DebugVtables, false, \ "add debugging code to vtable dispatch") \ \ - notproduct(bool, PrintVtableStats, false, \ - "print vtables stats at end of run") \ - \ develop(bool, TraceCreateZombies, false, \ "trace creation of zombie nmethods") \ \ diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index f1c591659a5..59510eec897 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -306,10 +306,6 @@ void print_statistics() { CodeCache::print_internals(); } - if (PrintVtableStats) { - klassVtable::print_statistics(); - klassItable::print_statistics(); - } if (VerifyOops && Verbose) { tty->print_cr("+VerifyOops count: %d", StubRoutines::verify_oop_count()); } -- GitLab From 1271fbf3d45ee654faf6e30ffff03c7fb2e5c4a0 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 20 Oct 2021 12:15:40 +0000 Subject: [PATCH 004/890] 8248584: Enable CHECK_UNHANDLED_OOPS for Windows fastdebug builds Reviewed-by: dholmes, erikj --- make/hotspot/lib/JvmFlags.gmk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/hotspot/lib/JvmFlags.gmk b/make/hotspot/lib/JvmFlags.gmk index 0c292ad866c..1588c19fac3 100644 --- a/make/hotspot/lib/JvmFlags.gmk +++ b/make/hotspot/lib/JvmFlags.gmk @@ -74,8 +74,8 @@ ifeq ($(DEBUG_LEVEL), release) endif else ifeq ($(DEBUG_LEVEL), fastdebug) JVM_CFLAGS_DEBUGLEVEL := -DASSERT - ifeq ($(call isTargetOs, windows aix), false) - # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on Windows and AIX. + ifeq ($(call isTargetOs, aix), false) + # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on AIX. JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS endif else ifeq ($(DEBUG_LEVEL), slowdebug) -- GitLab From a91a0a523a8d781d35950941cd87cdc430d32a71 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 20 Oct 2021 12:20:50 +0000 Subject: [PATCH 005/890] 8233724: Remove -Wc++14-compat warning suppression in operator_new.cpp Reviewed-by: coleenp --- src/hotspot/share/memory/operator_new.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/hotspot/share/memory/operator_new.cpp b/src/hotspot/share/memory/operator_new.cpp index 84a4152b7c3..357e26f9c88 100644 --- a/src/hotspot/share/memory/operator_new.cpp +++ b/src/hotspot/share/memory/operator_new.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -89,12 +89,6 @@ void operator delete [](void* p) throw() { fatal("Should not call global delete []"); } -#ifdef __GNUG__ -// Warning disabled for gcc 5.4 -PRAGMA_DIAG_PUSH -PRAGMA_DISABLE_GCC_WARNING("-Wc++14-compat") -#endif // __GNUG__ - void operator delete(void* p, size_t size) throw() { fatal("Should not call global sized delete"); } @@ -103,8 +97,4 @@ void operator delete [](void* p, size_t size) throw() { fatal("Should not call global sized delete []"); } -#ifdef __GNUG__ -PRAGMA_DIAG_POP -#endif // __GNUG__ - #endif // Non-product -- GitLab From 043cde22d4d6bd975e75daa9ad52770cf79df934 Mon Sep 17 00:00:00 2001 From: Daniel Jelinski Date: Wed, 20 Oct 2021 14:06:08 +0000 Subject: [PATCH 006/890] 8275319: java.net.NetworkInterface throws java.lang.Error instead of SocketException Reviewed-by: alanb, dfuchs --- .../windows/native/libnet/NetworkInterface.c | 41 ++++++--- .../native/libnet/NetworkInterface_winXP.c | 84 ++++++++++--------- 2 files changed, 74 insertions(+), 51 deletions(-) diff --git a/src/java.base/windows/native/libnet/NetworkInterface.c b/src/java.base/windows/native/libnet/NetworkInterface.c index aa59b565ae0..c2f604b24de 100644 --- a/src/java.base/windows/native/libnet/NetworkInterface.c +++ b/src/java.base/windows/native/libnet/NetworkInterface.c @@ -112,7 +112,7 @@ MIB_IFROW *getIF(jint index) { return NULL; count = GetIfTable(tableP, &size, TRUE); - if (count == ERROR_INSUFFICIENT_BUFFER || count == ERROR_BUFFER_OVERFLOW) { + if (count == ERROR_INSUFFICIENT_BUFFER) { MIB_IFTABLE* newTableP = (MIB_IFTABLE *)realloc(tableP, size); if (newTableP == NULL) { free(tableP); @@ -187,7 +187,7 @@ int enumInterfaces(JNIEnv *env, netif **netifPP) } ret = GetIfTable(tableP, &size, TRUE); - if (ret == ERROR_INSUFFICIENT_BUFFER || ret == ERROR_BUFFER_OVERFLOW) { + if (ret == ERROR_INSUFFICIENT_BUFFER) { MIB_IFTABLE * newTableP = (MIB_IFTABLE *)realloc(tableP, size); if (newTableP == NULL) { free(tableP); @@ -200,9 +200,19 @@ int enumInterfaces(JNIEnv *env, netif **netifPP) if (ret != NO_ERROR) { free(tableP); - - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetIfTable function failed"); + switch (ret) { + case ERROR_INVALID_PARAMETER: + JNU_ThrowInternalError(env, + "IP Helper Library GetIfTable function failed: " + "invalid parameter"); + break; + default: + SetLastError(ret); + JNU_ThrowByNameWithMessageAndLastError(env, + JNU_JAVANETPKG "SocketException", + "IP Helper Library GetIfTable function failed"); + break; + } // this different error code is to handle the case when we call // GetIpAddrTable in pure IPv6 environment return -2; @@ -308,8 +318,8 @@ int enumInterfaces(JNIEnv *env, netif **netifPP) // it should not fail, because we have called it once before if (MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr, ifrowP->dwDescrLen, curr->displayName, wlen) == 0) { - JNU_ThrowByName(env, "java/lang/Error", - "Cannot get multibyte char for interface display name"); + JNU_ThrowInternalError(env, + "Cannot get multibyte char for interface display name"); free_netif(netifP); free(tableP); free(curr->name); @@ -374,7 +384,7 @@ int lookupIPAddrTable(JNIEnv *env, MIB_IPADDRTABLE **tablePP) } ret = GetIpAddrTable(tableP, &size, FALSE); - if (ret == ERROR_INSUFFICIENT_BUFFER || ret == ERROR_BUFFER_OVERFLOW) { + if (ret == ERROR_INSUFFICIENT_BUFFER) { MIB_IPADDRTABLE * newTableP = (MIB_IPADDRTABLE *)realloc(tableP, size); if (newTableP == NULL) { free(tableP); @@ -389,8 +399,19 @@ int lookupIPAddrTable(JNIEnv *env, MIB_IPADDRTABLE **tablePP) if (tableP != NULL) { free(tableP); } - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetIpAddrTable function failed"); + switch (ret) { + case ERROR_INVALID_PARAMETER: + JNU_ThrowInternalError(env, + "IP Helper Library GetIpAddrTable function failed: " + "invalid parameter"); + break; + default: + SetLastError(ret); + JNU_ThrowByNameWithMessageAndLastError(env, + JNU_JAVANETPKG "SocketException", + "IP Helper Library GetIpAddrTable function failed"); + break; + } // this different error code is to handle the case when we call // GetIpAddrTable in pure IPv6 environment return -2; diff --git a/src/java.base/windows/native/libnet/NetworkInterface_winXP.c b/src/java.base/windows/native/libnet/NetworkInterface_winXP.c index 92b015e8bb7..6483cd9eb80 100644 --- a/src/java.base/windows/native/libnet/NetworkInterface_winXP.c +++ b/src/java.base/windows/native/libnet/NetworkInterface_winXP.c @@ -110,27 +110,29 @@ int getAdapters (JNIEnv *env, int flags, IP_ADAPTER_ADDRESSES **adapters) { if (ret != ERROR_SUCCESS) { free (adapterInfo); - if (ret == ERROR_INSUFFICIENT_BUFFER) { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failed " - "with ERROR_INSUFFICIENT_BUFFER"); - } else if (ret == ERROR_ADDRESS_NOT_ASSOCIATED ) { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failed " - "with ERROR_ADDRESS_NOT_ASSOCIATED"); - } else { - char error_msg_buf[100]; - int _sr; - _sr = _snprintf_s(error_msg_buf, sizeof(error_msg_buf), - _TRUNCATE, "IP Helper Library GetAdaptersAddresses " - "function failed with error == %d", ret); - if (_sr != -1) { - JNU_ThrowByName(env, "java/lang/Error", error_msg_buf); - } else { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failure"); - } + switch (ret) { + case ERROR_INVALID_PARAMETER: + JNU_ThrowInternalError(env, + "IP Helper Library GetAdaptersAddresses function failed: " + "invalid parameter"); + break; + case ERROR_NOT_ENOUGH_MEMORY: + JNU_ThrowOutOfMemoryError(env, + "IP Helper Library GetAdaptersAddresses function failed: " + "not enough memory"); + break; + case ERROR_NO_DATA: + // not an error + *adapters = NULL; + return ERROR_SUCCESS; + default: + SetLastError(ret); + JNU_ThrowByNameWithMessageAndLastError(env, + JNU_JAVANETPKG "SocketException", + "IP Helper Library GetAdaptersAddresses function failed"); + break; } + return -1; } *adapters = adapterInfo; @@ -179,26 +181,26 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) { if (val != ERROR_SUCCESS) { free (adapterInfo); - if (val == ERROR_INSUFFICIENT_BUFFER) { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failed " - "with ERROR_INSUFFICIENT_BUFFER"); - } else if (val == ERROR_ADDRESS_NOT_ASSOCIATED ) { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failed " - "with ERROR_ADDRESS_NOT_ASSOCIATED"); - } else { - char error_msg_buf[100]; - int _sr; - _sr = _snprintf_s(error_msg_buf, sizeof(error_msg_buf), - _TRUNCATE, "IP Helper Library GetAdaptersAddresses function failed " - "with error == %d", val); - if (_sr != -1) { - JNU_ThrowByName(env, "java/lang/Error", error_msg_buf); - } else { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failure"); - } + switch (val) { + case ERROR_INVALID_PARAMETER: + JNU_ThrowInternalError(env, + "IP Helper Library GetAdaptersAddresses function failed: " + "invalid parameter"); + break; + case ERROR_NOT_ENOUGH_MEMORY: + JNU_ThrowOutOfMemoryError(env, + "IP Helper Library GetAdaptersAddresses function failed: " + "not enough memory"); + break; + case ERROR_NO_DATA: + // not an error + break; + default: + SetLastError(val); + JNU_ThrowByNameWithMessageAndLastError(env, + JNU_JAVANETPKG "SocketException", + "IP Helper Library GetAdaptersAddresses function failed"); + break; } return NULL; } @@ -237,7 +239,7 @@ static int ipinflen = 2048; */ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP) { - DWORD ret, flags; + int ret, flags; MIB_IPADDRTABLE *tableP; IP_ADAPTER_ADDRESSES *ptr, *adapters=NULL; ULONG len=ipinflen, count=0; -- GitLab From 35e5bb5f59c01a1b07893780fa73f93c2abab653 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Wed, 20 Oct 2021 15:10:28 +0000 Subject: [PATCH 007/890] 8269336: Malformed jdk.serialFilter incorrectly handled Reviewed-by: rriggs --- .../classes/java/io/ObjectInputFilter.java | 4 +- .../serialFilter/InvalidGlobalFilterTest.java | 87 +++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 test/jdk/java/io/Serializable/serialFilter/InvalidGlobalFilterTest.java diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index 50a3e76d5b0..f339411593d 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -636,7 +636,9 @@ public interface ObjectInputFilter { filter = createFilter(filterString); } catch (RuntimeException re) { configLog.log(ERROR, - "Error configuring filter: {0}", re); + "Error configuring filter: {0}", (Object) re); + // Do not continue if configuration not initialized + throw re; } } serialFilter = filter; diff --git a/test/jdk/java/io/Serializable/serialFilter/InvalidGlobalFilterTest.java b/test/jdk/java/io/Serializable/serialFilter/InvalidGlobalFilterTest.java new file mode 100644 index 00000000000..a00f42f6565 --- /dev/null +++ b/test/jdk/java/io/Serializable/serialFilter/InvalidGlobalFilterTest.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021, 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.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +import java.io.File; +import java.io.ObjectInputFilter; + +/* + * @test + * @bug 8269336 + * @summary Test that an invalid pattern value for the jdk.serialFilter system property causes an + * exception to be thrown in the class initialization of java.io.ObjectInputFilter.Config class + * @library /test/lib + * @run driver InvalidGlobalFilterTest + */ +public class InvalidGlobalFilterTest { + private static final String serialPropName = "jdk.serialFilter"; + + /** + * Launches multiple instances of a Java program by passing each instance an invalid value + * for the {@code jdk.serialFilter} system property. The launched program then triggers the + * class initialization of {@code ObjectInputFilter.Config} class to have it parse the (invalid) + * value of the system property. The launched program is expected to propagate the exception + * raised by the {@code ObjectInputFilter.Config} initialization and the test asserts that the + * launched program did indeed fail with this expected exception. + */ + public static void main(final String[] args) throws Exception { + final String[] invalidPatterns = {".*", ".**", "!", "/java.util.Hashtable", "java.base/", "/"}; + for (final String invalidPattern : invalidPatterns) { + final ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder( + "-D" + serialPropName + "=" + invalidPattern, + "-Djava.util.logging.config.file=" + System.getProperty("test.src") + + File.separator + "logging.properties", + ObjectInputFilterConfigLoader.class.getName()); + // launch a process by passing it an invalid value for -Djdk.serialFilter + final OutputAnalyzer outputAnalyzer = ProcessTools.executeProcess(processBuilder); + try { + // we expect the JVM launch to fail + outputAnalyzer.shouldNotHaveExitValue(0); + // do an additional check to be sure it failed for the right reason + outputAnalyzer.stderrShouldContain("java.lang.ExceptionInInitializerError"); + } finally { + // fail or pass, we print out the generated output from the launched program + // for any debugging + System.err.println("Diagnostics from process " + outputAnalyzer.pid() + ":"); + // print out any stdout/err that was generated in the launched program + outputAnalyzer.reportDiagnosticSummary(); + } + } + } + + // A main() class which just triggers the class initialization of ObjectInputFilter.Config + private static final class ObjectInputFilterConfigLoader { + + public static void main(final String[] args) throws Exception { + System.out.println("JVM was launched with " + serialPropName + + " system property set to " + System.getProperty(serialPropName)); + // this call is expected to fail and we aren't interested in the result. + // we just let the exception propagate out of this call and fail the + // launched program. The test which launched this main, then asserts + // that the exception was indeed thrown. + ObjectInputFilter.Config.getSerialFilter(); + } + } +} -- GitLab From 7e28bdd1eb8276a5f78802febc9bd6f1cf597f55 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 20 Oct 2021 15:33:50 +0000 Subject: [PATCH 008/890] 8275055: Improve HeapRegionRemSet::split_card() Reviewed-by: sjohanss, ayang --- .../share/gc/g1/g1CardSetContainers.cpp | 31 +++++++++++++++++++ .../share/gc/g1/g1CardSetContainers.hpp | 3 ++ .../gc/g1/g1CardSetContainers.inline.hpp | 1 + src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 ++ src/hotspot/share/gc/g1/heapRegionRemSet.cpp | 31 +++++++++++++++++++ src/hotspot/share/gc/g1/heapRegionRemSet.hpp | 13 ++++++++ .../share/gc/g1/heapRegionRemSet.inline.hpp | 7 +++-- 7 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 src/hotspot/share/gc/g1/g1CardSetContainers.cpp diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.cpp b/src/hotspot/share/gc/g1/g1CardSetContainers.cpp new file mode 100644 index 00000000000..adee0a8e5a9 --- /dev/null +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021, 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/g1CardSetContainers.hpp" +#include "utilities/globalDefinitions.hpp" + +// The only limitation is from the G1CardSetArray. +uint G1CardSetContainer::LogCardsPerRegionLimit = sizeof(G1CardSetArray::EntryDataType) * BitsPerByte; diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp index 267af7d3695..cd6868c8c17 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp @@ -177,6 +177,9 @@ public: void set_next(G1CardSetContainer* next) { _next = next; } + + // Log of largest card index that can be stored in any G1CardSetContainer + static uint LogCardsPerRegionLimit; }; class G1CardSetArray : public G1CardSetContainer { diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index 7562f5b18a0..645f4a9ea3e 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -27,6 +27,7 @@ #include "gc/g1/g1CardSetContainers.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" +#include "utilities/globalDefinitions.hpp" inline G1CardSetInlinePtr::CardSetPtr G1CardSetInlinePtr::merge(CardSetPtr orig_value, uint card_in_region, uint idx, uint bits_per_card) { assert((idx & (SizeFieldMask >> SizeFieldPos)) == idx, "Index %u too large to fit into size field", idx); diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 816d7016f8a..0f48780483c 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1671,6 +1671,8 @@ jint G1CollectedHeap::initialize() { guarantee(HeapRegion::CardsPerRegion < max_cards_per_region, "too many cards per region"); + HeapRegionRemSet::initialize(_reserved); + FreeRegionList::set_unrealistically_long_length(max_regions() + 1); _bot = new G1BlockOffsetTable(reserved(), bot_storage); diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.cpp b/src/hotspot/share/gc/g1/heapRegionRemSet.cpp index b0ccf00f1db..c7633e77235 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.cpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.cpp @@ -35,6 +35,7 @@ #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/globals_extension.hpp" +#include "runtime/java.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/debug.hpp" #include "utilities/formatBuffer.hpp" @@ -42,9 +43,39 @@ #include "utilities/growableArray.hpp" #include "utilities/powerOfTwo.hpp" +uint HeapRegionRemSet::_split_card_shift = 0; +size_t HeapRegionRemSet::_split_card_mask = 0; +HeapWord* HeapRegionRemSet::_heap_base_address = nullptr; + const char* HeapRegionRemSet::_state_strings[] = {"Untracked", "Updating", "Complete"}; const char* HeapRegionRemSet::_short_state_strings[] = {"UNTRA", "UPDAT", "CMPLT"}; +void HeapRegionRemSet::initialize(MemRegion reserved) { + const uint BitsInUint = sizeof(uint) * BitsPerByte; + const uint CardBitsWithinCardRegion = MIN2((uint)HeapRegion::LogCardsPerRegion, G1CardSetContainer::LogCardsPerRegionLimit); + + // Check if the number of cards within a region fits an uint. + if (CardBitsWithinCardRegion > BitsInUint) { + vm_exit_during_initialization("Can not represent all cards in a card region within uint."); + } + + _split_card_shift = CardBitsWithinCardRegion + CardTable::card_shift; + _split_card_mask = ((size_t)1 << _split_card_shift) - 1; + + // Check if the card region/region within cards combination can cover the heap. + const uint HeapSizeBits = log2i_exact(round_up_power_of_2(reserved.byte_size())); + if (HeapSizeBits > (BitsInUint + _split_card_shift)) { + FormatBuffer<> fmt("Can not represent all cards in the heap with card region/card within region. " + "Heap %zuB (%u bits) Remembered set covers %u bits.", + reserved.byte_size(), + HeapSizeBits, + BitsInUint + _split_card_shift); + vm_exit_during_initialization(fmt, "Decrease heap size."); + } + + _heap_base_address = reserved.start(); +} + HeapRegionRemSet::HeapRegionRemSet(HeapRegion* hr, G1CardSetConfiguration* config) : _m(Mutex::service - 1, FormatBuffer<128>("HeapRegionRemSet#%u_lock", hr->hrm_index())), diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.hpp index 6bfe10df908..958d6fceaf1 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.hpp @@ -50,6 +50,17 @@ class HeapRegionRemSet : public CHeapObj { HeapRegion* _hr; + // When splitting addresses into region and card within that region, the logical + // shift value to get the region. + static uint _split_card_shift; + // When splitting addresses into region and card within that region, the mask + // to get the offset within the region. + static size_t _split_card_mask; + // Cached value of heap base address. + static HeapWord* _heap_base_address; + + // Split the given address into region of that card and the card within that + // region. inline void split_card(OopOrNarrowOopStar from, uint& card_region, uint& card_within_region) const; void clear_fcc(); @@ -78,6 +89,8 @@ public: return _card_set.occupied(); } + static void initialize(MemRegion reserved); + // Coarsening statistics since VM start. static G1CardSetCoarsenStats coarsen_stats() { return G1CardSet::coarsen_stats(); } diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp index 51a01e78253..b6c4ee9c1bb 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp @@ -62,9 +62,10 @@ inline void HeapRegionRemSet::iterate_for_merge(CardOrRangeVisitor& cl) { } void HeapRegionRemSet::split_card(OopOrNarrowOopStar from, uint& card_region, uint& card_within_region) const { - HeapRegion* hr = G1CollectedHeap::heap()->heap_region_containing(from); - card_region = hr->hrm_index(); - card_within_region = (uint)(pointer_delta((HeapWord*)from, hr->bottom()) >> (CardTable::card_shift - LogHeapWordSize)); + size_t offset = pointer_delta(from, _heap_base_address, 1); + card_region = (uint)(offset >> _split_card_shift); + card_within_region = (uint)((offset & _split_card_mask) >> CardTable::card_shift); + assert(card_within_region < ((uint)1 << G1CardSetContainer::LogCardsPerRegionLimit), "must be"); } void HeapRegionRemSet::add_reference(OopOrNarrowOopStar from, uint tid) { -- GitLab From bbc606117fcd8b48fc8f830c50cf7eb573da1c4c Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 20 Oct 2021 15:48:43 +0000 Subject: [PATCH 009/890] 8272614: Unused parameters in MethodHandleNatives linking methods Reviewed-by: dholmes, lfoltan --- src/hotspot/share/classfile/systemDictionary.cpp | 5 ++--- src/hotspot/share/classfile/vmSymbols.hpp | 4 ++-- .../share/classes/java/lang/invoke/MethodHandleNatives.java | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index af49f29dcd1..31814259452 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -2352,11 +2352,10 @@ void SystemDictionary::invoke_bootstrap_method(BootstrapInfo& bootstrap_specifie assert(appendix_box->obj_at(0) == NULL, ""); } - // call condy: java.lang.invoke.MethodHandleNatives::linkDynamicConstant(caller, condy_index, bsm, type, info) - // indy: java.lang.invoke.MethodHandleNatives::linkCallSite(caller, indy_index, bsm, name, mtype, info, &appendix) + // call condy: java.lang.invoke.MethodHandleNatives::linkDynamicConstant(caller, bsm, type, info) + // indy: java.lang.invoke.MethodHandleNatives::linkCallSite(caller, bsm, name, mtype, info, &appendix) JavaCallArguments args; args.push_oop(Handle(THREAD, bootstrap_specifier.caller_mirror())); - args.push_int(bootstrap_specifier.bss_index()); args.push_oop(bootstrap_specifier.bsm()); args.push_oop(bootstrap_specifier.name_arg()); args.push_oop(bootstrap_specifier.type_arg()); diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp index 618b97472dc..6357019adb7 100644 --- a/src/hotspot/share/classfile/vmSymbols.hpp +++ b/src/hotspot/share/classfile/vmSymbols.hpp @@ -339,9 +339,9 @@ template(linkMethod_name, "linkMethod") \ template(linkMethod_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \ template(linkDynamicConstant_name, "linkDynamicConstant") \ - template(linkDynamicConstant_signature, "(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \ + template(linkDynamicConstant_signature, "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \ template(linkCallSite_name, "linkCallSite") \ - template(linkCallSite_signature, "(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \ + template(linkCallSite_signature, "(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \ template(setTargetNormal_name, "setTargetNormal") \ template(setTargetVolatile_name, "setTargetVolatile") \ template(setTarget_signature, "(Ljava/lang/invoke/MethodHandle;)V") \ diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index dd0a2417e19..81491819d7e 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -258,7 +258,6 @@ class MethodHandleNatives { * The JVM is linking an invokedynamic instruction. Create a reified call site for it. */ static MemberName linkCallSite(Object callerObj, - int indexInCP, Object bootstrapMethodObj, Object nameObj, Object typeObj, Object staticArguments, @@ -317,7 +316,6 @@ class MethodHandleNatives { // this implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant: static Object linkDynamicConstant(Object callerObj, - int indexInCP, Object bootstrapMethodObj, Object nameObj, Object typeObj, Object staticArguments) { -- GitLab From 46b5bfbc38f14607f0db686a42f1fa96d2f61891 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Wed, 20 Oct 2021 16:44:47 +0000 Subject: [PATCH 010/890] 8233648: [TESTBUG] DefaultMenuBarTest.java failing on macos Reviewed-by: pbansal, serb, psadhukhan, prr --- test/jdk/ProblemList.txt | 1 - .../DefaultMenuBar/DefaultMenuBarTest.java | 38 ++++++++----------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 80997067a48..5eb1e43c61d 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -511,7 +511,6 @@ java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java 8233568 macosx-all java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java 8233568 macosx-all java/awt/event/KeyEvent/DeadKey/deadKeyMacOSX.java 8233568 macosx-all -com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java 8233648 macosx-all java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java 7185258 macosx-all java/awt/TrayIcon/RightClickWhenBalloonDisplayed/RightClickWhenBalloonDisplayed.java 8238720 windows-all java/awt/PopupMenu/PopupMenuLocation.java 8238720 windows-all diff --git a/test/jdk/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java b/test/jdk/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java index 9f87d7c5572..76656fb7a7f 100644 --- a/test/jdk/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java +++ b/test/jdk/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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,18 +24,21 @@ /** * @test * @key headful - * @bug 8007267 + * @bug 8007267 8233648 * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working * @requires (os.family == "mac") - * @author leonid.romanov@oracle.com - * @modules java.desktop/sun.awt - * java.desktop/com.apple.eawt - * @run main DefaultMenuBarTest + * @modules java.desktop/com.apple.eawt + * @run main/othervm DefaultMenuBarTest */ -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.Robot; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; import java.lang.reflect.Method; @@ -50,14 +53,11 @@ public class DefaultMenuBarTest { } System.setProperty("apple.laf.useScreenMenuBar", "true"); - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - createAndShowGUI(); - } - }); + SwingUtilities.invokeAndWait(DefaultMenuBarTest::createAndShowGUI); Robot robot = new Robot(); robot.setAutoDelay(100); + robot.waitForIdle(); robot.keyPress(KeyEvent.VK_META); robot.keyPress(ks.getKeyCode()); @@ -76,13 +76,7 @@ public class DefaultMenuBarTest { JMenuItem newItem = new JMenuItem("Open"); newItem.setAccelerator(ks); - newItem.addActionListener( - new ActionListener(){ - public void actionPerformed(ActionEvent e) { - listenerCallCounter++; - } - } - ); + newItem.addActionListener(e -> listenerCallCounter++); menu.add(newItem); JMenuBar defaultMenu = new JMenuBar(); @@ -104,7 +98,7 @@ public class DefaultMenuBarTest { } } } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } } } -- GitLab From 0021a2f462eab38b1a4c5c38736dfc7735f3c00a Mon Sep 17 00:00:00 2001 From: Mikhailo Seledtsov Date: Wed, 20 Oct 2021 18:16:58 +0000 Subject: [PATCH 011/890] 8275449: Add linux-aarch64-zero build profile Reviewed-by: erikj --- make/autoconf/lib-ffi.m4 | 2 +- make/conf/jib-profiles.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/make/autoconf/lib-ffi.m4 b/make/autoconf/lib-ffi.m4 index 6aec7bc3bd2..0905c3cd225 100644 --- a/make/autoconf/lib-ffi.m4 +++ b/make/autoconf/lib-ffi.m4 @@ -149,7 +149,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI], else AC_MSG_ERROR([Could not locate libffi.so.? for bundling]) fi - elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64"; then + elif test "x${OPENJDK_TARGET_CPU}" = "xx86_64" || test "x${OPENJDK_TARGET_CPU}" = "xaarch64"; then if test -e ${SYSROOT}/usr/lib64/libffi.so.? ; then LIBFFI_LIB_FILE="${SYSROOT}/usr/lib64/libffi.so.?" elif test -e ${SYSROOT}/usr/lib/x86_64-linux-gnu/libffi.so.? ; then diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 20fd9a92eff..af65ba7a756 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -588,6 +588,17 @@ var getJibProfilesProfiles = function (input, common, data) { ]) }, + "linux-aarch64-zero": { + target_os: "linux", + target_cpu: "aarch64", + dependencies: ["devkit", "gtest"], + configure_args: concat(common.configure_args_64bit, [ + "--with-zlib=system", + "--with-jvm-variants=zero", + "--enable-libffi-bundling" + ]) + }, + "linux-x86-zero": { target_os: "linux", target_cpu: "x86", -- GitLab From 913f9281ada7ebb670ed93a088d28afeaa635eb7 Mon Sep 17 00:00:00 2001 From: Markus Karg Date: Wed, 20 Oct 2021 18:30:52 +0000 Subject: [PATCH 012/890] 8273507: Convert test/jdk/java/nio/channels/Channels/TransferTo.java to TestNG test Reviewed-by: shade, bpb --- .../nio/channels/Channels/TransferTo.java | 134 ++++++++++-------- 1 file changed, 74 insertions(+), 60 deletions(-) diff --git a/test/jdk/java/nio/channels/Channels/TransferTo.java b/test/jdk/java/nio/channels/Channels/TransferTo.java index 22073224e21..b345770777e 100644 --- a/test/jdk/java/nio/channels/Channels/TransferTo.java +++ b/test/jdk/java/nio/channels/Channels/TransferTo.java @@ -21,8 +21,6 @@ * questions. */ -import static java.lang.String.format; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -39,13 +37,22 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Supplier; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + import jdk.test.lib.RandomFactory; +import static java.lang.String.format; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertThrows; +import static org.testng.Assert.assertTrue; + /* * @test * @library /test/lib * @build jdk.test.lib.RandomFactory - * @run main TransferTo + * @run testng TransferTo * @bug 8265891 * @summary tests whether sun.nio.ChannelInputStream.transferTo conforms to the * InputStream.transferTo contract defined in the javadoc @@ -59,40 +66,52 @@ public class TransferTo { private static final Random RND = RandomFactory.getRandom(); - public static void main(String[] args) throws Exception { - test(fileChannelInput(), fileChannelOutput()); - test(readableByteChannelInput(), defaultOutput()); - } - - private static void test(InputStreamProvider inputStreamProvider, OutputStreamProvider outputStreamProvider) - throws Exception { - testNullPointerException(inputStreamProvider); - testStreamContents(inputStreamProvider, outputStreamProvider); + /* + * Provides test scenarios, i. e. combinations of input and output streams to be tested. + */ + @DataProvider + public static Object[][] streamCombinations() throws Exception { + return new Object[][] { + // tests FileChannel.transferTo(FileChannel) optimized case + { fileChannelInput(), fileChannelOutput() }, + + // tests InputStream.transferTo(OutputStream) default case + { readableByteChannelInput(), defaultOutput() } + }; } - private static void testNullPointerException(InputStreamProvider inputStreamProvider) throws Exception { - try (InputStream in = inputStreamProvider.input()) { - assertThrowsNPE(() -> in.transferTo(null), "out"); - } + /* + * Testing API compliance: Input stream must throw NullPointerException when parameter "out" is null. + */ + @Test(dataProvider = "streamCombinations") + public void testNullPointerException(InputStreamProvider inputStreamProvider, + OutputStreamProvider outputStreamProvider) throws Exception { + // tests empty input stream + assertThrows(NullPointerException.class, () -> inputStreamProvider.input().transferTo(null)); - try (InputStream in = inputStreamProvider.input((byte) 1)) { - assertThrowsNPE(() -> in.transferTo(null), "out"); - } + // tests single-byte input stream + assertThrows(NullPointerException.class, () -> inputStreamProvider.input((byte) 1).transferTo(null)); - try (InputStream in = inputStreamProvider.input((byte) 1, (byte) 2)) { - assertThrowsNPE(() -> in.transferTo(null), "out"); - } + // tests dual-byte input stream + assertThrows(NullPointerException.class, () -> inputStreamProvider.input((byte) 1, (byte) 2).transferTo(null)); } - private static void testStreamContents(InputStreamProvider inputStreamProvider, + /* + * Testing API compliance: Complete content of input stream must be transferred to output stream. + */ + @Test(dataProvider = "streamCombinations") + public void testStreamContents(InputStreamProvider inputStreamProvider, OutputStreamProvider outputStreamProvider) throws Exception { + // tests empty input stream checkTransferredContents(inputStreamProvider, outputStreamProvider, new byte[0]); + + // tests input stream with a length between 1k and 4k checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(1024, 4096)); - // to span through several batches + // tests input stream with several data chunks, as 16k is more than a single chunk can hold checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(16384, 16384)); - // randomly chosen starting positions within source and target + // tests randomly chosen starting positions within source and target stream for (int i = 0; i < ITERATIONS; i++) { byte[] inBytes = createRandomBytes(MIN_SIZE, MAX_SIZE_INCR); int posIn = RND.nextInt(inBytes.length); @@ -100,18 +119,28 @@ public class TransferTo { checkTransferredContents(inputStreamProvider, outputStreamProvider, inBytes, posIn, posOut); } - // beyond source EOF + // tests reading beyond source EOF (must not transfer any bytes) checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(4096, 0), 4096, 0); - // beyond target EOF + // tests writing beyond target EOF (must extend output stream) checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(4096, 0), 0, 4096); } + /* + * Asserts that the transferred content is correct, i. e. compares the actually transferred bytes + * to the expected assumption. The position of the input and output stream before the transfer is + * the start of stream (BOF). + */ private static void checkTransferredContents(InputStreamProvider inputStreamProvider, OutputStreamProvider outputStreamProvider, byte[] inBytes) throws Exception { checkTransferredContents(inputStreamProvider, outputStreamProvider, inBytes, 0, 0); } + /* + * Asserts that the transferred content is correct, i. e. compares the actually transferred bytes + * to the expected assumption. The position of the input and output stream before the transfer is + * provided by the caller. + */ private static void checkTransferredContents(InputStreamProvider inputStreamProvider, OutputStreamProvider outputStreamProvider, byte[] inBytes, int posIn, int posOut) throws Exception { AtomicReference> recorder = new AtomicReference<>(); @@ -124,17 +153,17 @@ public class TransferTo { long reported = in.transferTo(out); int count = inBytes.length - posIn; - if (reported != count) - throw new AssertionError( - format("reported %d bytes but should report %d", reported, count)); + assertEquals(reported, count, format("reported %d bytes but should report %d", reported, count)); byte[] outBytes = recorder.get().get(); - if (!Arrays.equals(inBytes, posIn, posIn + count, outBytes, posOut, posOut + count)) - throw new AssertionError( - format("inBytes.length=%d, outBytes.length=%d", count, outBytes.length)); + assertTrue(Arrays.equals(inBytes, posIn, posIn + count, outBytes, posOut, posOut + count), + format("inBytes.length=%d, outBytes.length=%d", count, outBytes.length)); } } + /* + * Creates an array of random size (between min and min + maxRandomAdditive) filled with random bytes + */ private static byte[] createRandomBytes(int min, int maxRandomAdditive) { byte[] bytes = new byte[min + (maxRandomAdditive == 0 ? 0 : RND.nextInt(maxRandomAdditive))]; RND.nextBytes(bytes); @@ -149,6 +178,9 @@ public class TransferTo { OutputStream output(Consumer> spy) throws Exception; } + /* + * Creates a provider for an output stream which does not wrap a channel + */ private static OutputStreamProvider defaultOutput() { return new OutputStreamProvider() { @Override @@ -160,6 +192,9 @@ public class TransferTo { }; } + /* + * Creates a provider for an input stream which wraps a file channel + */ private static InputStreamProvider fileChannelInput() { return new InputStreamProvider() { @Override @@ -172,6 +207,9 @@ public class TransferTo { }; } + /* + * Creates a provider for an input stream which wraps a readable byte channel but is not a file channel + */ private static InputStreamProvider readableByteChannelInput() { return new InputStreamProvider() { @Override @@ -181,6 +219,9 @@ public class TransferTo { }; } + /* + * Creates a provider for an output stream which wraps a file channel + */ private static OutputStreamProvider fileChannelOutput() { return new OutputStreamProvider() { public OutputStream output(Consumer> spy) throws Exception { @@ -198,31 +239,4 @@ public class TransferTo { }; } - public interface Thrower { - public void run() throws Throwable; - } - - public static void assertThrowsNPE(Thrower thrower, String message) { - assertThrows(thrower, NullPointerException.class, message); - } - - public static void assertThrows(Thrower thrower, Class throwable, String message) { - Throwable thrown; - try { - thrower.run(); - thrown = null; - } catch (Throwable caught) { - thrown = caught; - } - - if (!throwable.isInstance(thrown)) { - String caught = thrown == null ? "nothing" : thrown.getClass().getCanonicalName(); - throw new AssertionError(format("Expected to catch %s, but caught %s", throwable, caught), thrown); - } - - if (thrown != null && !message.equals(thrown.getMessage())) { - throw new AssertionError( - format("Expected exception message to be '%s', but it's '%s'", message, thrown.getMessage())); - } - } } -- GitLab From d1e3ca4ee35bf4c2ce9b6dae2518f533f36a98dd Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Wed, 20 Oct 2021 18:51:00 +0000 Subject: [PATCH 013/890] 8233558: [TESTBUG] WindowOwnedByEmbeddedFrameTest.java fails on macos Reviewed-by: serb, kizune, prr --- test/jdk/ProblemList.txt | 1 - .../WindowOwnedByEmbeddedFrameTest.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 5eb1e43c61d..9b9162356cf 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -503,7 +503,6 @@ java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8 java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223,8274106 macosx-aarch64,linux-all,windows-all java/awt/Window/WindowResizing/DoubleClickTitleBarTest.java 8233557 macosx-all -java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java 8233558 macosx-all java/awt/keyboard/AllKeyCode/AllKeyCode.java 8242930 macosx-all java/awt/FullScreen/8013581/bug8013581.java 8169471 macosx-all java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 8233568 macosx-all diff --git a/test/jdk/java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java b/test/jdk/java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java index b53d356f6d0..8f954b2c1ca 100644 --- a/test/jdk/java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java +++ b/test/jdk/java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java @@ -26,7 +26,7 @@ * @bug 8130655 * @summary Tests that window owned by EmbeddedFrame can receive keyboard input * @requires (os.family == "mac") - * @modules java.desktop/sun.awt + * @modules java.desktop/sun.awt java.desktop/sun.lwawt.macosx:open * @library ../../regtesthelpers * @build Util * @run main WindowOwnedByEmbeddedFrameTest -- GitLab From cea3f010460c4b45e76bfac8a5b193c49fdd274a Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 20 Oct 2021 19:24:46 +0000 Subject: [PATCH 014/890] 8275666: serviceability/jvmti/GetObjectSizeClass.java shouldn't have vm.flagless Reviewed-by: lmesnik --- test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java b/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java index cdf3a543090..126f3333cae 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java +++ b/test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java @@ -31,7 +31,6 @@ import jdk.test.lib.process.ProcessTools; * @bug 8075030 * @summary JvmtiEnv::GetObjectSize reports incorrect java.lang.Class instance size * @requires vm.jvmti - * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.compiler -- GitLab From af7c56b85bb2828a9d68f9e1c753a4adfa7ebb4f Mon Sep 17 00:00:00 2001 From: vamsi-parasa Date: Wed, 20 Oct 2021 22:40:51 +0000 Subject: [PATCH 015/890] 8275167: x86 intrinsic for unsignedMultiplyHigh Reviewed-by: kvn, sviswanathan --- src/hotspot/cpu/x86/x86_64.ad | 13 +++++++++++++ src/hotspot/share/classfile/vmIntrinsics.hpp | 2 ++ src/hotspot/share/opto/c2compiler.cpp | 3 +++ src/hotspot/share/opto/classes.hpp | 1 + src/hotspot/share/opto/library_call.cpp | 6 ++++++ src/hotspot/share/opto/library_call.hpp | 1 + src/hotspot/share/opto/mulnode.cpp | 16 ++++++++++++++-- src/hotspot/share/opto/mulnode.hpp | 14 ++++++++++++++ src/hotspot/share/runtime/vmStructs.cpp | 1 + src/java.base/share/classes/java/lang/Math.java | 1 + .../org/openjdk/bench/java/lang/MathBench.java | 5 +++++ 11 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index 14671c39640..e637f143659 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -8527,6 +8527,19 @@ instruct mulHiL_rReg(rdx_RegL dst, no_rax_RegL src, rax_RegL rax, rFlagsReg cr) ins_pipe(ialu_reg_reg_alu0); %} +instruct umulHiL_rReg(rdx_RegL dst, no_rax_RegL src, rax_RegL rax, rFlagsReg cr) +%{ + match(Set dst (UMulHiL src rax)); + effect(USE_KILL rax, KILL cr); + + ins_cost(300); + format %{ "mulq RDX:RAX, RAX, $src\t# umulhi" %} + ins_encode %{ + __ mulq($src$$Register); + %} + ins_pipe(ialu_reg_reg_alu0); +%} + instruct divI_rReg(rax_RegI rax, rdx_RegI rdx, no_rax_rdx_RegI div, rFlagsReg cr) %{ diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index 31f0b1fb13c..fbe9c140b77 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -140,6 +140,7 @@ class methodHandle; do_name(incrementExact_name,"incrementExact") \ do_name(multiplyExact_name,"multiplyExact") \ do_name(multiplyHigh_name,"multiplyHigh") \ + do_name(unsignedMultiplyHigh_name,"unsignedMultiplyHigh") \ do_name(negateExact_name,"negateExact") \ do_name(subtractExact_name,"subtractExact") \ do_name(fma_name, "fma") \ @@ -173,6 +174,7 @@ class methodHandle; do_intrinsic(_multiplyExactI, java_lang_Math, multiplyExact_name, int2_int_signature, F_S) \ do_intrinsic(_multiplyExactL, java_lang_Math, multiplyExact_name, long2_long_signature, F_S) \ do_intrinsic(_multiplyHigh, java_lang_Math, multiplyHigh_name, long2_long_signature, F_S) \ + do_intrinsic(_unsignedMultiplyHigh, java_lang_Math, unsignedMultiplyHigh_name, long2_long_signature, F_S) \ do_intrinsic(_negateExactI, java_lang_Math, negateExact_name, int_int_signature, F_S) \ do_intrinsic(_negateExactL, java_lang_Math, negateExact_name, long_long_signature, F_S) \ do_intrinsic(_subtractExactI, java_lang_Math, subtractExact_name, int2_int_signature, F_S) \ diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index c5949ed57f4..ad463fbbc28 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -426,6 +426,9 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_multiplyHigh: if (!Matcher::match_rule_supported(Op_MulHiL)) return false; break; + case vmIntrinsics::_unsignedMultiplyHigh: + if (!Matcher::match_rule_supported(Op_UMulHiL)) return false; + break; case vmIntrinsics::_getCallerClass: if (vmClasses::reflect_CallerSensitive_klass() == NULL) return false; break; diff --git a/src/hotspot/share/opto/classes.hpp b/src/hotspot/share/opto/classes.hpp index 582ec51fbde..6c896c4609a 100644 --- a/src/hotspot/share/opto/classes.hpp +++ b/src/hotspot/share/opto/classes.hpp @@ -238,6 +238,7 @@ macro(MoveD2L) macro(MulD) macro(MulF) macro(MulHiL) +macro(UMulHiL) macro(MulI) macro(MulL) macro(Multi) diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index c22ae2e91df..edd051c5300 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -286,6 +286,7 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_multiplyExactI: return inline_math_multiplyExactI(); case vmIntrinsics::_multiplyExactL: return inline_math_multiplyExactL(); case vmIntrinsics::_multiplyHigh: return inline_math_multiplyHigh(); + case vmIntrinsics::_unsignedMultiplyHigh: return inline_math_unsignedMultiplyHigh(); case vmIntrinsics::_negateExactI: return inline_math_negateExactI(); case vmIntrinsics::_negateExactL: return inline_math_negateExactL(); case vmIntrinsics::_subtractExactI: return inline_math_subtractExactI(false /* subtract */); @@ -1867,6 +1868,11 @@ bool LibraryCallKit::inline_math_multiplyHigh() { return true; } +bool LibraryCallKit::inline_math_unsignedMultiplyHigh() { + set_result(_gvn.transform(new UMulHiLNode(argument(0), argument(2)))); + return true; +} + Node* LibraryCallKit::generate_min_max(vmIntrinsics::ID id, Node* x0, Node* y0) { // These are the candidate return value: diff --git a/src/hotspot/share/opto/library_call.hpp b/src/hotspot/share/opto/library_call.hpp index b3010f1cb5b..dfbad65a7b2 100644 --- a/src/hotspot/share/opto/library_call.hpp +++ b/src/hotspot/share/opto/library_call.hpp @@ -210,6 +210,7 @@ class LibraryCallKit : public GraphKit { bool inline_math_multiplyExactI(); bool inline_math_multiplyExactL(); bool inline_math_multiplyHigh(); + bool inline_math_unsignedMultiplyHigh(); bool inline_math_negateExactI(); bool inline_math_negateExactL(); bool inline_math_subtractExactI(bool is_decrement); diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp index 5d6cebb7d56..4c999ea5524 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp @@ -432,14 +432,26 @@ const Type *MulDNode::mul_ring(const Type *t0, const Type *t1) const { //============================================================================= //------------------------------Value------------------------------------------ const Type* MulHiLNode::Value(PhaseGVN* phase) const { - // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); + const Type *bot = bottom_type(); + return MulHiValue(t1, t2, bot); +} + +const Type* UMulHiLNode::Value(PhaseGVN* phase) const { + const Type *t1 = phase->type( in(1) ); + const Type *t2 = phase->type( in(2) ); + const Type *bot = bottom_type(); + return MulHiValue(t1, t2, bot); +} + +// A common routine used by UMulHiLNode and MulHiLNode +const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot) { + // Either input is TOP ==> the result is TOP if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP; // Either input is BOTTOM ==> the result is the local BOTTOM - const Type *bot = bottom_type(); if( (t1 == bot) || (t2 == bot) || (t1 == Type::BOTTOM) || (t2 == Type::BOTTOM) ) return bot; diff --git a/src/hotspot/share/opto/mulnode.hpp b/src/hotspot/share/opto/mulnode.hpp index d399af5a990..b26c4dd46e1 100644 --- a/src/hotspot/share/opto/mulnode.hpp +++ b/src/hotspot/share/opto/mulnode.hpp @@ -154,6 +154,8 @@ public: }; //-------------------------------MulHiLNode------------------------------------ +const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot); + // Upper 64 bits of a 64 bit by 64 bit multiply class MulHiLNode : public Node { public: @@ -162,6 +164,18 @@ public: virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } + friend const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot); +}; + +// Upper 64 bits of a 64 bit by 64 bit unsigned multiply +class UMulHiLNode : public Node { +public: + UMulHiLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} + virtual int Opcode() const; + virtual const Type* Value(PhaseGVN* phase) const; + const Type *bottom_type() const { return TypeLong::LONG; } + virtual uint ideal_reg() const { return Op_RegL; } + friend const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot); }; //------------------------------AndINode--------------------------------------- diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 370b88165b4..7c337f3c65f 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -1670,6 +1670,7 @@ declare_c2_type(MulFNode, MulNode) \ declare_c2_type(MulDNode, MulNode) \ declare_c2_type(MulHiLNode, Node) \ + declare_c2_type(UMulHiLNode, Node) \ declare_c2_type(AndINode, MulINode) \ declare_c2_type(AndLNode, MulLNode) \ declare_c2_type(LShiftINode, Node) \ diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java index 8eb030482a0..7341aa56a6a 100644 --- a/src/java.base/share/classes/java/lang/Math.java +++ b/src/java.base/share/classes/java/lang/Math.java @@ -1390,6 +1390,7 @@ public final class Math { * @see #multiplyHigh * @since 18 */ + @IntrinsicCandidate public static long unsignedMultiplyHigh(long x, long y) { // Compute via multiplyHigh() to leverage the intrinsic long result = Math.multiplyHigh(x, y); diff --git a/test/micro/org/openjdk/bench/java/lang/MathBench.java b/test/micro/org/openjdk/bench/java/lang/MathBench.java index 27d8033b8b7..6cd1353907e 100644 --- a/test/micro/org/openjdk/bench/java/lang/MathBench.java +++ b/test/micro/org/openjdk/bench/java/lang/MathBench.java @@ -540,4 +540,9 @@ public class MathBench { return Math.ulp(float7); } + @Benchmark + public long unsignedMultiplyHighLongLong() { + return Math.unsignedMultiplyHigh(long747, long13); + } + } -- GitLab From c7a80e60e2e201b573d4653fa978df527addc8a6 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Thu, 21 Oct 2021 01:16:10 +0000 Subject: [PATCH 016/890] 8275607: G1: G1CardSetAllocator::drop_all needs to call G1SegmentedArray::drop_all Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index 72ab11c518a..fe5beceef14 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -114,6 +114,7 @@ void G1CardSetAllocator::drop_all() { _pending_nodes_list.pop_all(); _num_pending_nodes = 0; _num_free_nodes = 0; + _segmented_array.drop_all(); } template -- GitLab From a120937e8194a897ed4af9e7a2e33beb857987e5 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Thu, 21 Oct 2021 01:17:52 +0000 Subject: [PATCH 017/890] 8274988: G1: refine G1SegmentedArrayAllocOptions and G1CardSetAllocOptions Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1CardSetMemory.hpp | 3 +++ src/hotspot/share/gc/g1/g1SegmentedArray.hpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp index c9f29bb674c..df64c4af2b8 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp @@ -39,6 +39,9 @@ class outputStream; // Collects G1CardSetAllocator options/heuristics. Called by G1CardSetAllocator // to determine the next size of the allocated G1CardSetBuffer. class G1CardSetAllocOptions : public G1SegmentedArrayAllocOptions { + static const uint MinimumBufferSize = 8; + static const uint MaximumBufferSize = UINT_MAX / 2; + uint exponential_expand(uint prev_num_elems) const { return clamp(prev_num_elems * 2, _initial_num_elems, _max_num_elems); } diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp index 62bdd802a12..fce3d9187b4 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp @@ -115,15 +115,11 @@ public: class G1SegmentedArrayAllocOptions { protected: - uint _elem_size; - uint _initial_num_elems; + const uint _elem_size; + const uint _initial_num_elems; // Defines a limit to the number of elements in the buffer - uint _max_num_elems; - uint _alignment; - - static const uint BufferAlignment = 4; - static const uint MinimumBufferSize = 8; - static const uint MaximumBufferSize = UINT_MAX / 2; + const uint _max_num_elems; + const uint _alignment; public: G1SegmentedArrayAllocOptions(uint elem_size, uint initial_num_elems, uint max_num_elems, uint alignment) : @@ -131,6 +127,10 @@ public: _initial_num_elems(initial_num_elems), _max_num_elems(max_num_elems), _alignment(alignment) { + assert(_elem_size > 0, "Must be"); + assert(_initial_num_elems > 0, "Must be"); + assert(_max_num_elems > 0, "Must be"); + assert(_alignment > 0, "Must be"); } virtual uint next_num_elems(uint prev_num_elems) const { -- GitLab From 09f5235c65de546640d5f923fa9369e28643c6ed Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Thu, 21 Oct 2021 07:47:10 +0000 Subject: [PATCH 018/890] 8275405: Linking error for classes with lambda template parameters and virtual functions Reviewed-by: ihse, pliden --- make/hotspot/lib/JvmMapfile.gmk | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/make/hotspot/lib/JvmMapfile.gmk b/make/hotspot/lib/JvmMapfile.gmk index 5cba93178c7..1c343d2b503 100644 --- a/make/hotspot/lib/JvmMapfile.gmk +++ b/make/hotspot/lib/JvmMapfile.gmk @@ -99,9 +99,26 @@ else ifeq ($(call isTargetOs, aix), true) else ifeq ($(call isTargetOs, windows), true) DUMP_SYMBOLS_CMD := $(DUMPBIN) -symbols *.obj + + # The following lines create a list of vftable symbols to be filtered out of + # the mapfile. Removing this line causes the linker to complain about too many + # (> 64K) symbols, so the _guess_ is that this line is here to keep down the + # number of exported symbols below that limit. + # + # Some usages of C++ lambdas require the vftable symbol of classes that use + # the lambda type as a template parameter. The usage of those classes won't + # link if their vftable symbols are removed. That's why there's an exception + # for vftable symbols containing the string 'lambda'. + # + # A very simple example of a lambda usage that fails if the lambda vftable + # symbols are missing in the mapfile: + # + # #include + # std::function f = [](){} + FILTER_SYMBOLS_AWK_SCRIPT := \ '{ \ - if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/) print $$7; \ + if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \ }' else -- GitLab From 0c3eaea11c83b3ee63d80de85d58a1cb6f870fd3 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Thu, 21 Oct 2021 09:51:18 +0000 Subject: [PATCH 019/890] 8168388: GetMousePositionTest fails with the message "Mouse position should not be null" Reviewed-by: psadhukhan, serb --- test/jdk/ProblemList.txt | 1 - .../GetMousePositionWithOverlay.java | 44 +++++++++---------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 9b9162356cf..f0c86a57d7e 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -183,7 +183,6 @@ java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java 8158801 wind java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java 8158801 windows-all java/awt/Mixing/MixingOnDialog.java 8225777 linux-all java/awt/Mixing/NonOpaqueInternalFrame.java 7124549 macosx-all -java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388 linux-all java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all diff --git a/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java b/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java index 560db023be6..b380af149f6 100644 --- a/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java +++ b/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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,6 +25,7 @@ import java.awt.Frame; import java.awt.Point; import java.awt.Robot; import java.awt.Rectangle; +import javax.swing.SwingUtilities; /* * @test @@ -42,23 +43,21 @@ public class GetMousePositionWithOverlay { public static void main(String[] args) throws Throwable { robot = new Robot(); + robot.setAutoDelay(100); - try{ - constructTestUI(); - } catch (Exception e) { + try { + SwingUtilities.invokeAndWait(GetMousePositionWithOverlay::constructTestUI); + doTest(); + } finally { dispose(); - throw new RuntimeException("Unexpected Exception!"); } robot.waitForIdle(); - doTest(); - dispose(); } - private static void doTest() { - - frontFrame.toFront(); + private static void doTest() throws Exception { + SwingUtilities.invokeAndWait(() -> frontFrame.toFront()); robot.waitForIdle(); Rectangle bounds = new Rectangle(frontFrame.getLocationOnScreen(), frontFrame.getSize()); @@ -67,45 +66,44 @@ public class GetMousePositionWithOverlay { Point pos = backFrame.getMousePosition(); if (pos != null) { - dispose(); throw new RuntimeException("Test failed. Mouse position should be null but was " + pos); } pos = frontFrame.getMousePosition(); if (pos == null) { - dispose(); throw new RuntimeException("Test failed. Mouse position should not be null"); } - robot.mouseMove(189, 189); + robot.mouseMove(bounds.x + bounds.width + 5, bounds.y + bounds.height + 5); robot.waitForIdle(); pos = backFrame.getMousePosition(); if (pos == null) { - dispose(); throw new RuntimeException("Test failed. Mouse position should not be null"); } - } - private static void dispose() { - - if (backFrame != null) { - backFrame.dispose(); - } + private static void dispose() throws Exception { + SwingUtilities.invokeAndWait(() -> { + if (backFrame != null) { + backFrame.dispose(); + } - if (frontFrame != null) { - frontFrame.dispose(); - } + if (frontFrame != null) { + frontFrame.dispose(); + } + }); } private static void constructTestUI() { backFrame = new Frame(); + backFrame.setUndecorated(true); backFrame.setBounds(100, 100, 100, 100); backFrame.setResizable(false); backFrame.setVisible(true); frontFrame = new Frame(); + frontFrame.setUndecorated(true); frontFrame.setBounds(120, 120, 60, 60); frontFrame.setResizable(false); frontFrame.setVisible(true); -- GitLab From c41ce6d159e59a8c05dbeacde2d2612b58733d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Thu, 21 Oct 2021 10:12:19 +0000 Subject: [PATCH 020/890] 8275415: Prepare Leak Profiler for Lilliput Reviewed-by: rkennke --- .../jfr/leakprofiler/chains/edgeStore.cpp | 88 +++++++++++++++---- .../jfr/leakprofiler/chains/edgeStore.hpp | 5 +- .../leakprofiler/checkpoint/eventEmitter.cpp | 19 ++-- 3 files changed, 82 insertions(+), 30 deletions(-) diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp index 011dce70da4..8ba9409df56 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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,8 +25,10 @@ #include "precompiled.hpp" #include "jfr/leakprofiler/chains/edgeStore.hpp" #include "jfr/leakprofiler/chains/edgeUtils.hpp" +#include "jfr/leakprofiler/sampling/objectSample.hpp" #include "jfr/leakprofiler/utilities/unifiedOopRef.inline.hpp" #include "oops/oop.inline.hpp" +#include "runtime/safepoint.hpp" StoredEdge::StoredEdge(const Edge* parent, UnifiedOopRef reference) : Edge(parent, reference), _gc_root_id(0), _skip_length(0) {} @@ -36,15 +38,6 @@ StoredEdge::StoredEdge(const StoredEdge& edge) : Edge(edge), _gc_root_id(edge._g traceid EdgeStore::_edge_id_counter = 0; -EdgeStore::EdgeStore() : _edges(NULL) { - _edges = new EdgeHashTable(this); -} - -EdgeStore::~EdgeStore() { - assert(_edges != NULL, "invariant"); - delete _edges; -} - bool EdgeStore::is_empty() const { return !_edges->has_entries(); } @@ -224,15 +217,80 @@ bool EdgeStore::put_edges(StoredEdge** previous, const Edge** current, size_t li return NULL == *current; } -// Install the immediate edge into the mark word of the leak candidate object +static GrowableArray* _leak_context_edges = nullptr; + +EdgeStore::EdgeStore() : _edges(new EdgeHashTable(this)) {} + +EdgeStore::~EdgeStore() { + assert(_edges != NULL, "invariant"); + delete _edges; + delete _leak_context_edges; + _leak_context_edges = nullptr; +} + +static int leak_context_edge_idx(const ObjectSample* sample) { + assert(sample != nullptr, "invariant"); + return static_cast(sample->object()->mark().value()) >> markWord::lock_bits; +} + +bool EdgeStore::has_leak_context(const ObjectSample* sample) const { + return leak_context_edge_idx(sample) != 0; +} + +const StoredEdge* EdgeStore::get(const ObjectSample* sample) const { + assert(sample != nullptr, "invariant"); + if (_leak_context_edges != nullptr) { + assert(SafepointSynchronize::is_at_safepoint(), "invariant"); + const int idx = leak_context_edge_idx(sample); + if (idx > 0) { + return _leak_context_edges->at(idx); + } + } + return get(UnifiedOopRef::encode_in_native(sample->object_addr())); +} + +#ifdef ASSERT +// max_idx to ensure idx fit in lower 32-bits of markword together with lock bits. +static constexpr const int max_idx = right_n_bits(32 - markWord::lock_bits); + +static void store_idx_precondition(oop sample_object, int idx) { + assert(sample_object != NULL, "invariant"); + assert(sample_object->mark().is_marked(), "invariant"); + assert(idx > 0, "invariant"); + assert(idx <= max_idx, "invariant"); +} +#endif + +static void store_idx_in_markword(oop sample_object, int idx) { + DEBUG_ONLY(store_idx_precondition(sample_object, idx);) + const markWord idx_mark_word(sample_object->mark().value() | idx << markWord::lock_bits); + sample_object->set_mark(idx_mark_word); + assert(sample_object->mark().is_marked(), "must still be marked"); +} + +static const int initial_size = 64; + +static int save(const StoredEdge* edge) { + assert(edge != nullptr, "invariant"); + if (_leak_context_edges == nullptr) { + _leak_context_edges = new (ResourceObj::C_HEAP, mtTracing)GrowableArray(initial_size, mtTracing); + _leak_context_edges->append(nullptr); // next idx now at 1, for disambiguation in markword. + } + return _leak_context_edges->append(edge); +} + +// We associate the leak context edge with the leak candidate object by saving the +// edge in an array and storing the array idx (shifted) into the markword of the candidate object. +static void associate_with_candidate(const StoredEdge* leak_context_edge) { + assert(leak_context_edge != nullptr, "invariant"); + store_idx_in_markword(leak_context_edge->pointee(), save(leak_context_edge)); +} + StoredEdge* EdgeStore::associate_leak_context_with_candidate(const Edge* edge) { assert(edge != NULL, "invariant"); assert(!contains(edge->reference()), "invariant"); StoredEdge* const leak_context_edge = put(edge->reference()); - oop sample_object = edge->pointee(); - assert(sample_object != NULL, "invariant"); - assert(sample_object->mark().is_marked(), "invariant"); - sample_object->set_mark(markWord::from_pointer(leak_context_edge)); + associate_with_candidate(leak_context_edge); return leak_context_edge; } diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp index f948525a5b9..e920fd64ea9 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -31,6 +31,7 @@ #include "memory/allocation.hpp" typedef u8 traceid; +class ObjectSample; class StoredEdge : public Edge { private: @@ -79,6 +80,7 @@ class EdgeStore : public CHeapObj { void on_unlink(EdgeEntry* entry); StoredEdge* get(UnifiedOopRef reference) const; + const StoredEdge* get(const ObjectSample* sample) const; StoredEdge* put(UnifiedOopRef reference); traceid gc_root_id(const Edge* edge) const; @@ -90,6 +92,7 @@ class EdgeStore : public CHeapObj { void store_gc_root_id_in_leak_context_edge(StoredEdge* leak_context_edge, const Edge* root) const; StoredEdge* link_new_edge(StoredEdge** previous, const Edge** current); void link_with_existing_chain(const StoredEdge* current_stored, StoredEdge** previous, size_t previous_length); + bool has_leak_context(const ObjectSample* sample) const; template void iterate(T& functor) const { _edges->iterate_value(functor); } diff --git a/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp b/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp index b2f9d36e159..5ba92d7f641 100644 --- a/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp +++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/eventEmitter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Datadog, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -121,7 +121,7 @@ void EventEmitter::link_sample_with_edge(const ObjectSample* sample, EdgeStore* assert(!sample->is_dead(), "invariant"); assert(edge_store != NULL, "invariant"); if (SafepointSynchronize::is_at_safepoint()) { - if (!sample->object()->mark().is_marked()) { + if (edge_store->has_leak_context(sample)) { // Associated with an edge (chain) already during heap traversal. return; } @@ -138,21 +138,12 @@ void EventEmitter::write_event(const ObjectSample* sample, EdgeStore* edge_store assert(edge_store != NULL, "invariant"); assert(_jfr_thread_local != NULL, "invariant"); - traceid gc_root_id = 0; - const Edge* edge = NULL; - if (SafepointSynchronize::is_at_safepoint()) { - if (!sample->object()->mark().is_marked()) { - edge = (const Edge*)(sample->object())->mark().to_pointer(); - } - } - if (edge == NULL) { - edge = edge_store->get(UnifiedOopRef::encode_in_native(sample->object_addr())); - } else { - gc_root_id = edge_store->gc_root_id(edge); - } + const StoredEdge* const edge = edge_store->get(sample); assert(edge != NULL, "invariant"); + assert(edge->pointee() == sample->object(), "invariant"); const traceid object_id = edge_store->get_id(edge); assert(object_id != 0, "invariant"); + const traceid gc_root_id = edge->gc_root_id(); Tickspan object_age = Ticks(_start_time.value()) - sample->allocation_time(); -- GitLab From 819d2df8b01e04bcc89a0a995e21b68799f890be Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 21 Oct 2021 11:28:22 +0000 Subject: [PATCH 021/890] 8274794: Print all owned locks in hs_err file Reviewed-by: stuefe, dholmes --- src/hotspot/share/runtime/mutex.cpp | 83 +++++++++++++++---- src/hotspot/share/runtime/mutex.hpp | 25 +++--- src/hotspot/share/runtime/mutexLocker.cpp | 33 -------- src/hotspot/share/runtime/mutexLocker.hpp | 6 -- src/hotspot/share/utilities/vmError.cpp | 8 +- .../ErrorHandling/ErrorFileOverwriteTest.java | 50 ++--------- .../ErrorHandling/ErrorFileScanner.java | 75 +++++++++++++++++ .../ErrorHandling/TestErrorFileMutex.java | 72 ++++++++++++++++ 8 files changed, 242 insertions(+), 110 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java create mode 100644 test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java diff --git a/src/hotspot/share/runtime/mutex.cpp b/src/hotspot/share/runtime/mutex.cpp index caf14ce1164..5f2d2988a97 100644 --- a/src/hotspot/share/runtime/mutex.cpp +++ b/src/hotspot/share/runtime/mutex.cpp @@ -31,6 +31,7 @@ #include "runtime/osThread.hpp" #include "runtime/safepointMechanism.inline.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/threadCritical.hpp" #include "utilities/events.hpp" #include "utilities/macros.hpp" @@ -267,7 +268,36 @@ bool Monitor::wait(int64_t timeout) { return wait_status != 0; // return true IFF timeout } +// Array used to print owned locks on error. +static Mutex* _mutex_array = NULL; + +void Mutex::add_to_global_list() { + // Add mutex to print_owned_locks_on_error array + ThreadCritical tc; + Mutex* next = _mutex_array; + _next_mutex = next; + _prev_mutex = nullptr; + _mutex_array = this; + if (next != nullptr) { + next->_prev_mutex = this; + } +} + +void Mutex::remove_from_global_list() { + // Remove mutex from print_owned_locks_on_error array + ThreadCritical tc; + Mutex* old_next = _next_mutex; + assert(old_next != nullptr, "this list can never be empty"); + old_next->_prev_mutex = _prev_mutex; + if (_prev_mutex == nullptr) { + _mutex_array = old_next; + } else { + _prev_mutex->_next_mutex = old_next; + } +} + Mutex::~Mutex() { + remove_from_global_list(); assert_owner(NULL); os::free(const_cast(_name)); } @@ -280,6 +310,8 @@ Mutex::Mutex(Rank rank, const char * name, bool allow_vm_block) : _owner(NULL) { _allow_vm_block = allow_vm_block; _rank = rank; _skip_rank_check = false; + _next = nullptr; + _last_owner = nullptr; assert(_rank >= static_cast(0) && _rank <= safepoint, "Bad lock rank %s: %s", rank_name(), name); @@ -288,16 +320,51 @@ Mutex::Mutex(Rank rank, const char * name, bool allow_vm_block) : _owner(NULL) { assert(_rank > nosafepoint || _allow_vm_block, "Locks that don't check for safepoint should always allow the vm to block: %s", name); #endif + add_to_global_list(); } bool Mutex::owned_by_self() const { return owner() == Thread::current(); } -void Mutex::print_on_error(outputStream* st) const { +void Mutex::print_on(outputStream* st) const { st->print("[" PTR_FORMAT, p2i(this)); st->print("] %s", _name); st->print(" - owner thread: " PTR_FORMAT, p2i(owner())); +#ifdef ASSERT + if (_allow_vm_block) { + st->print_raw(" allow_vm_block"); + } + st->print(" %s", rank_name()); +#endif + st->cr(); +} + +// Print all mutexes/monitors that are currently owned by a thread; called +// by fatal error handler. +// This function doesn't take the ThreadCritical lock to avoid potential +// deadlock during error reporting. +void Mutex::print_owned_locks_on_error(outputStream* st) { + assert(VMError::is_error_reported(), "should only be called during error reporting"); + ResourceMark rm; + st->print("VM Mutexes/Monitors currently owned by a thread: "); + bool none = true; + Mutex *m = _mutex_array; + int array_count = 0; + while (m != nullptr) { + array_count++; + // see if it has an owner + if (m->owner() != NULL) { + if (none) { + st->cr(); + none = false; + } + m->print_on(st); + } + m = m->_next_mutex; + } + if (none) st->print_cr("None"); + st->print_cr("Total Mutex count %d", array_count); } // ---------------------------------------------------------------------------------- @@ -343,21 +410,7 @@ void Mutex::assert_no_overlap(Rank orig, Rank adjusted, int adjust) { rank_name_internal(orig), adjust, rank_name_internal(adjusted)); } } -#endif // ASSERT - -#ifndef PRODUCT -void Mutex::print_on(outputStream* st) const { - st->print("Mutex: [" PTR_FORMAT "] %s - owner: " PTR_FORMAT, - p2i(this), _name, p2i(owner())); - if (_allow_vm_block) { - st->print("%s", " allow_vm_block"); - } - DEBUG_ONLY(st->print(" %s", rank_name())); - st->cr(); -} -#endif // PRODUCT -#ifdef ASSERT void Mutex::assert_owner(Thread * expected) { const char* msg = "invalid owner"; if (expected == NULL) { diff --git a/src/hotspot/share/runtime/mutex.hpp b/src/hotspot/share/runtime/mutex.hpp index 586b69f1082..70b17a7d552 100644 --- a/src/hotspot/share/runtime/mutex.hpp +++ b/src/hotspot/share/runtime/mutex.hpp @@ -88,19 +88,24 @@ class Mutex : public CHeapObj { Thread* volatile _owner; void raw_set_owner(Thread* new_owner) { Atomic::store(&_owner, new_owner); } + // Embed pointers for mutex array for error reporting. + Mutex* _next_mutex; + Mutex* _prev_mutex; + + void add_to_global_list(); + void remove_from_global_list(); + protected: // Monitor-Mutex metadata os::PlatformMonitor _lock; // Native monitor implementation const char* _name; // Name of mutex/monitor - // Debugging fields for naming, deadlock detection, etc. (some only used in debug mode) -#ifndef PRODUCT - bool _allow_vm_block; -#endif + // Debugging fields for naming, deadlock detection, etc. #ifdef ASSERT Rank _rank; // rank (to avoid/detect potential deadlocks) Mutex* _next; // Used by a Thread to link up owned locks Thread* _last_owner; // the last thread to own the lock - bool _skip_rank_check; // read only by owner when doing rank checks + bool _skip_rank_check; // read only by owner when doing rank checks + bool _allow_vm_block; static bool contains(Mutex* locks, Mutex* lock); static Mutex* get_least_ranked_lock(Mutex* locks); @@ -189,11 +194,11 @@ class Mutex : public CHeapObj { const char *name() const { return _name; } - void print_on_error(outputStream* st) const; - #ifndef PRODUCT - void print_on(outputStream* st) const; - void print() const { print_on(::tty); } - #endif + // Print all mutexes/monitors that are currently owned by a thread; called + // by fatal error handler. + static void print_owned_locks_on_error(outputStream* st); + void print_on(outputStream* st) const; + void print() const { print_on(::tty); } }; class Monitor : public Mutex { diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index 35900865d37..227ad386817 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -157,11 +157,6 @@ Mutex* Bootclasspath_lock = NULL; Monitor* JVMCI_lock = NULL; #endif - -#define MAX_NUM_MUTEX 128 -static Mutex* _mutex_array[MAX_NUM_MUTEX]; -static int _num_mutex; - #ifdef ASSERT void assert_locked_or_safepoint(const Mutex* lock) { // check if this thread owns the lock (common case) @@ -194,26 +189,18 @@ void assert_locked_or_safepoint_or_handshake(const Mutex* lock, const JavaThread } #endif -static void add_mutex(Mutex* var) { - assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX"); - _mutex_array[_num_mutex++] = var; -} - #define def(var, type, pri, vm_block) { \ var = new type(Mutex::pri, #var, vm_block); \ - add_mutex(var); \ } // Specify relative ranked lock #ifdef ASSERT #define defl(var, type, held_lock, vm_block) { \ var = new type(held_lock->rank()-1, #var, vm_block); \ - add_mutex(var); \ } #else #define defl(var, type, held_lock, vm_block) { \ var = new type(Mutex::safepoint, #var, vm_block); \ - add_mutex(var); \ } #endif @@ -377,23 +364,3 @@ GCMutexLocker::GCMutexLocker(Mutex* mutex) { _mutex->lock(); } } - -// Print all mutexes/monitors that are currently owned by a thread; called -// by fatal error handler. -void print_owned_locks_on_error(outputStream* st) { - st->print("VM Mutex/Monitor currently owned by a thread: "); - bool none = true; - for (int i = 0; i < _num_mutex; i++) { - // see if it has an owner - if (_mutex_array[i]->owner() != NULL) { - if (none) { - // print format used by Mutex::print_on_error() - st->print_cr(" ([mutex/lock_event])"); - none = false; - } - _mutex_array[i]->print_on_error(st); - st->cr(); - } - } - if (none) st->print_cr("None"); -} diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp index c4c72150060..fa6671bb0e1 100644 --- a/src/hotspot/share/runtime/mutexLocker.hpp +++ b/src/hotspot/share/runtime/mutexLocker.hpp @@ -169,12 +169,6 @@ extern Mutex* tty_lock; // lock to synchronize output. // order. If their implementations change such that these assumptions // are violated, a whole lot of code will break. -// Print all mutexes/monitors that are currently owned by a thread; called -// by fatal error handler. -void print_owned_locks_on_error(outputStream* st); - -char *lock_name(Mutex *mutex); - // for debugging: check that we're already owning this lock (or are at a safepoint / handshake) #ifdef ASSERT void assert_locked_or_safepoint(const Mutex* lock); diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index d6152164dbb..44c7376dc1e 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1015,7 +1015,7 @@ void VMError::report(outputStream* st, bool _verbose) { // mutexes/monitors that currently have an owner if (_verbose) { - print_owned_locks_on_error(st); + Mutex::print_owned_locks_on_error(st); st->cr(); } @@ -1913,6 +1913,12 @@ void VMError::controlled_crash(int how) { switch (how) { case 1: assert(how == 0, "test assert"); break; case 2: guarantee(how == 0, "test guarantee"); break; + case 3: { + Mutex* ErrorTest_lock = new Mutex(Mutex::nosafepoint, "ErrorTest_lock"); + MutexLocker ml(ErrorTest_lock, Mutex::_no_safepoint_check_flag); + assert(how == 0, "test assert with lock"); + break; + } // The other cases are unused. case 14: crash_with_segfault(); break; diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java index c9b9e433e18..9108213722c 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, SAP. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -42,46 +42,6 @@ import java.util.regex.Pattern; public class ErrorFileOverwriteTest { - private static File findHsErrorFileInOutput(OutputAnalyzer output) { - - String hs_err_file = output.firstMatch("# *(\\S*hs_err_pid.*\\.log)", 1); - if(hs_err_file ==null) { - throw new RuntimeException("Did not find hs-err file in output.\n"); - } - - File f = new File(hs_err_file); - if (!f.exists()) { - throw new RuntimeException("hs-err file missing at " - + f.getAbsolutePath() + ".\n"); - } - - return f; - - } - - private static void scanHsErrorFileForContent(File f, Pattern[] pattern) throws IOException { - FileInputStream fis = new FileInputStream(f); - BufferedReader br = new BufferedReader(new InputStreamReader(fis)); - String line = null; - - int currentPattern = 0; - - String lastLine = null; - while ((line = br.readLine()) != null && currentPattern < pattern.length) { - if (pattern[currentPattern].matcher(line).matches()) { - System.out.println("Found: " + line + "."); - currentPattern++; - } - lastLine = line; - } - br.close(); - - if (currentPattern < pattern.length) { - throw new RuntimeException("hs-err file incomplete (first missing pattern: " + pattern[currentPattern] + ")"); - } - - } - public static void do_test(boolean with_percent_p) throws Exception { // Crash twice. @@ -110,10 +70,10 @@ public class ErrorFileOverwriteTest { output_detail.shouldMatch("# " + errorFileStem + ".*"); System.out.println("First crash: Found expected output on tty. Ok."); - File f = findHsErrorFileInOutput(output_detail); + File f = ErrorFileScanner.findHsErrorFileInOutput(output_detail); System.out.println("First crash: Found hs error file at " + f.getAbsolutePath()); - scanHsErrorFileForContent(f, new Pattern[] { + ErrorFileScanner.scanHsErrorFileForContent(f, new Pattern[] { Pattern.compile("# *Internal Error.*"), Pattern.compile("Command Line:.*-XX:ErrorHandlerTest=1.*-XX:ErrorFile=" + errorFileStem + ".*") }); @@ -136,7 +96,7 @@ public class ErrorFileOverwriteTest { output_detail.shouldMatch("# " + errorFileStem + ".*"); System.out.println("Second crash: Found expected output on tty. Ok."); - File f2 = findHsErrorFileInOutput(output_detail); + File f2 = ErrorFileScanner.findHsErrorFileInOutput(output_detail); System.out.println("Second crash: Found hs error file at " + f2.getAbsolutePath()); if (with_percent_p) { @@ -145,7 +105,7 @@ public class ErrorFileOverwriteTest { } } - scanHsErrorFileForContent(f2, new Pattern[] { + ErrorFileScanner.scanHsErrorFileForContent(f2, new Pattern[] { Pattern.compile("# *Internal Error.*"), Pattern.compile("Command Line:.*-XX:ErrorHandlerTest=2.*-XX:ErrorFile=" + errorFileStem + ".*") }); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java new file mode 100644 index 00000000000..5e36a8b8698 --- /dev/null +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021, 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.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.io.IOException; + +import java.util.regex.Pattern; + +import jdk.test.lib.process.OutputAnalyzer; + +public class ErrorFileScanner { + + public static File findHsErrorFileInOutput(OutputAnalyzer output) { + + String hs_err_file = output.firstMatch("# *(\\S*hs_err_pid.*\\.log)", 1); + if(hs_err_file ==null) { + throw new RuntimeException("Did not find hs-err file in output.\n"); + } + + File f = new File(hs_err_file); + if (!f.exists()) { + throw new RuntimeException("hs-err file missing at " + + f.getAbsolutePath() + ".\n"); + } + + return f; + + } + + public static void scanHsErrorFileForContent(File f, Pattern[] pattern) throws IOException { + FileInputStream fis = new FileInputStream(f); + BufferedReader br = new BufferedReader(new InputStreamReader(fis)); + String line = null; + + int currentPattern = 0; + + String lastLine = null; + while ((line = br.readLine()) != null && currentPattern < pattern.length) { + if (pattern[currentPattern].matcher(line).matches()) { + System.out.println("Found: " + line + "."); + currentPattern++; + } + lastLine = line; + } + br.close(); + + if (currentPattern < pattern.length) { + throw new RuntimeException("hs-err file incomplete (first missing pattern: " + pattern[currentPattern] + ")"); + } + + } +} diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java new file mode 100644 index 00000000000..97ddb48c06d --- /dev/null +++ b/test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021, 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 8274794 + * @summary Test that locks are printed in the Error file. + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @requires (vm.debug == true) + * @run driver TestErrorFileMutex + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +import java.io.*; +import java.util.regex.Pattern; + +public class TestErrorFileMutex { + + public static void do_test() throws Exception { + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xmx64M", + "-XX:-CreateCoredumpOnCrash", + "-XX:ErrorHandlerTest=3", + "-version"); + + OutputAnalyzer output_detail = new OutputAnalyzer(pb.start()); + output_detail.shouldMatch("# A fatal error has been detected by the Java Runtime Environment:.*"); + + File f = ErrorFileScanner.findHsErrorFileInOutput(output_detail); + System.out.println("Found hs error file at " + f.getAbsolutePath()); + + ErrorFileScanner.scanHsErrorFileForContent(f, new Pattern[] { + Pattern.compile("# *Internal Error.*"), + Pattern.compile(".*VM Mutexes/Monitors currently owned by a thread:.*"), + Pattern.compile(".*ErrorTest_lock - owner thread:.*"), + Pattern.compile(".*Threads_lock - owner thread:.*") + }); + } + + public static void main(String[] args) throws Exception { + do_test(); + } + +} + + + -- GitLab From cd07b3cab00e6656e73a29f82210e2dedf26df8c Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 21 Oct 2021 11:46:24 +0000 Subject: [PATCH 022/890] 8257534: misc tests failed with "NoClassDefFoundError: Could not initialize class java.util.concurrent.ThreadLocalRandom" Reviewed-by: hseigel --- .../vmTestbase/nsk/share/gc/gp/GarbageUtils.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java index cccf382ca98..87dff30f26b 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -203,12 +203,7 @@ public final class GarbageUtils { * * It is Important that the impl is not inlined. */ - - public static int eatMemory(ExecutionController stresser, GarbageProducer gp, long initialFactor, long minMemoryChunk, long factor, OOM_TYPE type) { - try { - // Using a methodhandle invoke of eatMemoryImpl to prevent inlining of it - MethodHandles.Lookup lookup = MethodHandles.lookup(); - MethodType mt = MethodType.methodType( + private static MethodType mt = MethodType.methodType( int.class, ExecutionController.class, GarbageProducer.class, @@ -216,6 +211,11 @@ public final class GarbageUtils { long.class, long.class, OOM_TYPE.class); + + public static int eatMemory(ExecutionController stresser, GarbageProducer gp, long initialFactor, long minMemoryChunk, long factor, OOM_TYPE type) { + try { + // Using a methodhandle invoke of eatMemoryImpl to prevent inlining of it + MethodHandles.Lookup lookup = MethodHandles.lookup(); MethodHandle eat = lookup.findStatic(GarbageUtils.class, "eatMemoryImpl", mt); return (int) eat.invoke(stresser, gp, initialFactor, minMemoryChunk, factor, type); } catch (OutOfMemoryError e) { -- GitLab From 60cb27dcda475a66e329359ac1ee3ffcde95c657 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Thu, 21 Oct 2021 13:28:25 +0000 Subject: [PATCH 023/890] 8275426: PretouchTask num_chunks calculation can overflow Reviewed-by: ayang, tschatzl --- src/hotspot/share/gc/shared/pretouchTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/pretouchTask.cpp b/src/hotspot/share/gc/shared/pretouchTask.cpp index 13200756574..c345a12806b 100644 --- a/src/hotspot/share/gc/shared/pretouchTask.cpp +++ b/src/hotspot/share/gc/shared/pretouchTask.cpp @@ -81,7 +81,7 @@ void PretouchTask::pretouch(const char* task_name, char* start_address, char* en } if (pretouch_workers != NULL) { - size_t num_chunks = (total_bytes + chunk_size - 1) / chunk_size; + size_t num_chunks = ((total_bytes - 1) / chunk_size) + 1; uint num_workers = (uint)MIN2(num_chunks, (size_t)pretouch_workers->max_workers()); log_debug(gc, heap)("Running %s with %u workers for " SIZE_FORMAT " work units pre-touching " SIZE_FORMAT "B.", -- GitLab From 45ce06c9f3e9bee7d4bda313c38f0f0e8786a4db Mon Sep 17 00:00:00 2001 From: Evan Whelan Date: Thu, 21 Oct 2021 13:33:21 +0000 Subject: [PATCH 024/890] 8274779: HttpURLConnection: HttpClient and HttpsClient incorrectly check request method when set to POST Reviewed-by: dfuchs, coffeys, vtewari, michaelm --- .../classes/sun/net/www/http/HttpClient.java | 2 +- .../net/www/protocol/https/HttpsClient.java | 2 +- .../RequestMethodEquality.java | 140 ++++++++++++++++++ .../sun/net/www/http/HttpClientAccess.java | 35 +++++ 4 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 test/jdk/sun/net/www/http/RequestMethodCheck/RequestMethodEquality.java create mode 100644 test/jdk/sun/net/www/http/RequestMethodCheck/java.base/sun/net/www/http/HttpClientAccess.java diff --git a/src/java.base/share/classes/sun/net/www/http/HttpClient.java b/src/java.base/share/classes/sun/net/www/http/HttpClient.java index 906f4626cf0..4b3c40b4fc0 100644 --- a/src/java.base/share/classes/sun/net/www/http/HttpClient.java +++ b/src/java.base/share/classes/sun/net/www/http/HttpClient.java @@ -307,7 +307,7 @@ public class HttpClient extends NetworkClient { ret = kac.get(url, null); if (ret != null && httpuc != null && httpuc.streaming() && - httpuc.getRequestMethod() == "POST") { + "POST".equals(httpuc.getRequestMethod())) { if (!ret.available()) { ret.inCache = false; ret.closeServer(); diff --git a/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java b/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java index 7861e2602ae..2f718e5bcc9 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java +++ b/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java @@ -329,7 +329,7 @@ final class HttpsClient extends HttpClient ret = (HttpsClient) kac.get(url, sf); if (ret != null && httpuc != null && httpuc.streaming() && - httpuc.getRequestMethod() == "POST") { + "POST".equals(httpuc.getRequestMethod())) { if (!ret.available()) ret = null; } diff --git a/test/jdk/sun/net/www/http/RequestMethodCheck/RequestMethodEquality.java b/test/jdk/sun/net/www/http/RequestMethodCheck/RequestMethodEquality.java new file mode 100644 index 00000000000..290248989d8 --- /dev/null +++ b/test/jdk/sun/net/www/http/RequestMethodCheck/RequestMethodEquality.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2021, 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 + * @summary This test checks that a broken HttpClient is not returned from the KeepAliveCache + * when the intial HttpURLConnection.setRequest method is passed a 'new String("POST")' + * rather than the "POST" String literal + * @bug 8274779 + * @library /test/lib + * @modules java.base/sun.net.www.http + * java.base/sun.net.www.protocol.http + * @build java.base/sun.net.www.http.HttpClientAccess + * @run testng/othervm RequestMethodEquality + */ + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import jdk.test.lib.net.URIBuilder; +import org.testng.Assert; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; +import sun.net.www.http.HttpClient; +import sun.net.www.http.HttpClientAccess; +import sun.net.www.http.KeepAliveCache; +import sun.net.www.protocol.http.HttpURLConnection; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.URL; + +public class RequestMethodEquality { + private static final String TEST_CONTEXT = "/reqmethodtest"; + private HttpServer server; + private CustomHandler handler; + private HttpClientAccess httpClientAccess; + + @BeforeTest + public void setup() throws Exception { + handler = new CustomHandler(); + server = createServer(handler); + httpClientAccess = new HttpClientAccess(); + } + + @AfterTest + public void tearDown() throws Exception { + if (server != null) { + server.stop(0); + } + } + + @Test + public void testHttpClient() throws Exception { + HttpURLConnection conn = null; + try { + URL url = URIBuilder.newBuilder() + .scheme("http") + .host(server.getAddress().getAddress()) + .port(server.getAddress().getPort()) + .path(TEST_CONTEXT) + .toURL(); + + conn = (HttpURLConnection) url.openConnection(); + conn.setChunkedStreamingMode(8); // ensures the call to HttpURLConnection.streaming() passes + + int firstConnectTimeout = 1234; + HttpClient freshClient = HttpClient.New(url, Proxy.NO_PROXY, firstConnectTimeout, true, conn); + freshClient.closeServer(); // ensures that the call to HttpClient.available() fails + + httpClientAccess.setInCache(freshClient, true); // allows the assertion in HttpClient.New to pass + + // Injecting a mock KeepAliveCache that the HttpClient can use + KeepAliveCache kac = httpClientAccess.getKeepAliveCache(); + kac.put(url, null, freshClient); + + // The 'new' keyword is important here as the original code + // used '==' rather than String.equals to compare request methods + conn.setRequestMethod(new String("POST")); + + // Before the fix, the value returned to 'cachedClient' would have been the (broken) cached + // 'freshClient' as HttpClient.available() could never be checked + int secondConnectTimeout = 4321; + HttpClient cachedClient = HttpClient.New(url, Proxy.NO_PROXY, secondConnectTimeout, true, conn); + cachedClient.closeServer(); + + int originalConnectTimeout = freshClient.getConnectTimeout(); + int cachedConnectTimeout = cachedClient.getConnectTimeout(); + + // If both connectTimeout values are equal, it means the test retrieved the same broken + // HttpClient from the cache and is trying to re-use it. + Assert.assertNotEquals(originalConnectTimeout, cachedConnectTimeout, "Both connectTimeout values are equal.\nThis means the test is reusing a broken HttpClient rather than creating a new one."); + } finally { + if (conn != null) { + conn.disconnect(); + } + } + } + + private static HttpServer createServer(final HttpHandler handler) throws IOException { + final InetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); + final int backlog = -1; + final HttpServer server = HttpServer.create(serverAddress, backlog); + server.createContext(TEST_CONTEXT, handler); + server.start(); + System.out.println("Server started on " + server.getAddress()); + return server; + } + + private static class CustomHandler implements HttpHandler { + @Override + public void handle(HttpExchange exchange) throws IOException { + // We'll always send 200 OK - We don't care about the server logic + exchange.sendResponseHeaders(200, 1); + exchange.close(); + } + } +} diff --git a/test/jdk/sun/net/www/http/RequestMethodCheck/java.base/sun/net/www/http/HttpClientAccess.java b/test/jdk/sun/net/www/http/RequestMethodCheck/java.base/sun/net/www/http/HttpClientAccess.java new file mode 100644 index 00000000000..78bf1cdee40 --- /dev/null +++ b/test/jdk/sun/net/www/http/RequestMethodCheck/java.base/sun/net/www/http/HttpClientAccess.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, 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.net.www.http; +// We can use this injected accessor class to get the KeepAliveCache from our HttpClient +public class HttpClientAccess { + public KeepAliveCache getKeepAliveCache () { + // kac is a protected static field in HttpClient + return HttpClient.kac; + } + + public void setInCache(HttpClient client, boolean inCache) { + client.inCache = inCache; + } +} -- GitLab From e39bdc9ddb7ba50160d07a27e6038cdea6a594a8 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Thu, 21 Oct 2021 13:50:32 +0000 Subject: [PATCH 025/890] 8274714: Incorrect verifier protected access error message Reviewed-by: dholmes, coleenp --- src/hotspot/share/classfile/verifier.cpp | 5 +- .../verifier/PutfieldProtectedTest.java | 45 +++++++++++++++ .../runtime/verifier/putfieldProtected.jasm | 56 +++++++++++++++++++ 3 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/verifier/PutfieldProtectedTest.java create mode 100644 test/hotspot/jtreg/runtime/verifier/putfieldProtected.jasm diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp index 9bebe3a5faf..80825f0339f 100644 --- a/src/hotspot/share/classfile/verifier.cpp +++ b/src/hotspot/share/classfile/verifier.cpp @@ -1805,7 +1805,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) { no_control_flow = true; break; default: // We only need to check the valid bytecodes in class file. - // And jsr and ret are not in the new class file format in JDK1.5. + // And jsr and ret are not in the new class file format in JDK1.6. verify_error(ErrorContext::bad_code(bci), "Bad instruction: %02x", opcode); no_control_flow = false; @@ -2424,7 +2424,8 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs, verify_error(ErrorContext::bad_type(bci, current_frame->stack_top_ctx(), TypeOrigin::implicit(current_type())), - "Bad access to protected data in getfield"); + "Bad access to protected data in %s", + is_getfield ? "getfield" : "putfield"); return; } } diff --git a/test/hotspot/jtreg/runtime/verifier/PutfieldProtectedTest.java b/test/hotspot/jtreg/runtime/verifier/PutfieldProtectedTest.java new file mode 100644 index 00000000000..dc6722e419a --- /dev/null +++ b/test/hotspot/jtreg/runtime/verifier/PutfieldProtectedTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021, 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 8274714 + * @summary Make sure error message for protected putfield error is correct. + * @compile putfieldProtected.jasm + * @run main/othervm -Xverify:remote PutfieldProtectedTest + */ + +// Test that an int[] is not assignable to byte[]. +public class PutfieldProtectedTest { + + public static void main(String args[]) throws Throwable { + try { + Class newClass = Class.forName("other.putfieldProtected"); + throw new RuntimeException("Expected VerifyError exception not thrown"); + } catch (java.lang.VerifyError e) { + if (!e.getMessage().contains("Bad access to protected data in putfield")) { + throw new RuntimeException("wrong exception: " + e.getMessage()); + } + } + } +} diff --git a/test/hotspot/jtreg/runtime/verifier/putfieldProtected.jasm b/test/hotspot/jtreg/runtime/verifier/putfieldProtected.jasm new file mode 100644 index 00000000000..6e45ce36f8c --- /dev/null +++ b/test/hotspot/jtreg/runtime/verifier/putfieldProtected.jasm @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021, 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 .jasm file is needed for this test to ensure that the illegal protected +// access is done at runtime. Otherwise, javac would detect and complain about +// the illegal access +super public class another/SuperC version 51:0 { + protected Field f:I; + + public Method "":"()V" stack 1 locals 1 { + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; + } +} // end Class another/SuperC + + +super public class other/putfieldProtected extends another/SuperC version 51:0 { + + public Method "":"()V" stack 1 locals 1 { + aload_0; + invokespecial Method another/SuperC."":"()V"; + return; + } + + public static Method run:"()Z" stack 2 locals 2 { + new class another/SuperC; + dup; + invokespecial Method another/SuperC."":"()V"; + iconst_1; + putfield Field another/SuperC.f:"I"; + iconst_1; + ireturn; + } + +} // end Class other/putfieldProtected -- GitLab From d589b664cc809aea39ec094e99b1898df1bf3c19 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Thu, 21 Oct 2021 14:04:48 +0000 Subject: [PATCH 026/890] 8270380: Change the default value of the java.security.manager system property to disallow Reviewed-by: lancea, mullan, rriggs --- .../classes/java/lang/SecurityManager.java | 25 ++++++++----------- .../share/classes/java/lang/System.java | 8 +++--- .../lang/System/AllowSecurityManager.java | 4 +-- .../lang/System/SecurityManagerWarnings.java | 6 ++--- .../sun/security/pkcs11/KeyStore/Basic.java | 2 +- .../pkcs11/Provider/MultipleLogins.sh | 2 +- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/java.base/share/classes/java/lang/SecurityManager.java b/src/java.base/share/classes/java/lang/SecurityManager.java index 2facf5ff9e6..7414e1c4a96 100644 --- a/src/java.base/share/classes/java/lang/SecurityManager.java +++ b/src/java.base/share/classes/java/lang/SecurityManager.java @@ -28,7 +28,6 @@ package java.lang; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Exports; import java.lang.module.ModuleDescriptor.Opens; -import java.lang.reflect.Member; import java.io.FileDescriptor; import java.io.File; import java.io.FilePermission; @@ -48,7 +47,6 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import jdk.internal.module.ModuleLoaderMap; -import jdk.internal.reflect.CallerSensitive; import sun.security.util.SecurityConstants; /** @@ -77,7 +75,7 @@ import sun.security.util.SecurityConstants; * manager routine simply returns if the operation is permitted, but * throws a {@code SecurityException} if the operation is not * permitted. - *

+ *

Setting a Security Manager

* Environments using a security manager will typically set the security * manager at startup. In the JDK implementation, this is done by setting the * system property {@systemProperty java.security.manager} on the command line @@ -96,13 +94,13 @@ import sun.security.util.SecurityConstants; * {@link System#setSecurityManager(SecurityManager) setSecurityManager} method. * In the JDK implementation, if the Java virtual machine is started with * the {@code java.security.manager} system property set to the special token - * "{@code disallow}" then a security manager will not be set at startup and - * cannot be set dynamically (the + * "{@code allow}", then a security manager will not be set at startup but can + * be set dynamically. If the Java virtual machine is started with the + * {@code java.security.manager} system property not set or set to the special + * token "{@code disallow}", then a security manager will not be set at startup + * and cannot be set dynamically (the * {@link System#setSecurityManager(SecurityManager) setSecurityManager} - * method will throw an {@code UnsupportedOperationException}). If the - * {@code java.security.manager} system property is not set or is set to the - * special token "{@code allow}", then a security manager will not be set at - * startup but can be set dynamically. Finally, if the + * method will throw an {@code UnsupportedOperationException}). Finally, if the * {@code java.security.manager} system property is set to the class name of * the security manager, or to the empty String ("") or the special token * "{@code default}", then a security manager is set at startup (as described @@ -127,8 +125,7 @@ import sun.security.util.SecurityConstants; * * null * None - * Success or throws {@code SecurityException} if not permitted by - * the currently installed security manager + * Throws {@code UnsupportedOperationException} * * * @@ -148,7 +145,7 @@ import sun.security.util.SecurityConstants; * * "disallow" * None - * Always throws {@code UnsupportedOperationException} + * Throws {@code UnsupportedOperationException} * * * @@ -167,12 +164,10 @@ import sun.security.util.SecurityConstants; * * * - *

A future release of the JDK may change the default value of the - * {@code java.security.manager} system property to "{@code disallow}". *

* The current security manager is returned by the * {@link System#getSecurityManager() getSecurityManager} method. - *

+ *

Checking Permissions

* The special method * {@link SecurityManager#checkPermission(java.security.Permission)} * determines whether an access request indicated by a specified diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index c843858712f..fac67162435 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -361,9 +361,11 @@ public final class System { * the method simply returns. * * @implNote In the JDK implementation, if the Java virtual machine is - * started with the system property {@code java.security.manager} set to + * started with the system property {@code java.security.manager} not set or set to * the special token "{@code disallow}" then the {@code setSecurityManager} - * method cannot be used to set a security manager. + * method cannot be used to set a security manager. See the following + * section of the + * {@code SecurityManager} class specification for more details. * * @param sm the security manager or {@code null} * @throws SecurityException @@ -2237,7 +2239,7 @@ public final class System { allowSecurityManager = MAYBE; } } else { - allowSecurityManager = MAYBE; + allowSecurityManager = NEVER; } if (needWarning) { diff --git a/test/jdk/java/lang/System/AllowSecurityManager.java b/test/jdk/java/lang/System/AllowSecurityManager.java index 7d46664e625..78f46fb7760 100644 --- a/test/jdk/java/lang/System/AllowSecurityManager.java +++ b/test/jdk/java/lang/System/AllowSecurityManager.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8191053 + * @bug 8191053 8270380 * @summary Test that the allow/disallow options of the java.security.manager * system property work correctly * @run main/othervm AllowSecurityManager @@ -35,7 +35,7 @@ public class AllowSecurityManager { public static void main(String args[]) throws Exception { String prop = System.getProperty("java.security.manager"); - boolean disallow = "disallow".equals(prop); + boolean disallow = !"allow".equals(prop); try { System.setSecurityManager(new SecurityManager()); if (disallow) { diff --git a/test/jdk/java/lang/System/SecurityManagerWarnings.java b/test/jdk/java/lang/System/SecurityManagerWarnings.java index 4ff65fd22cf..c3e3e9a8517 100644 --- a/test/jdk/java/lang/System/SecurityManagerWarnings.java +++ b/test/jdk/java/lang/System/SecurityManagerWarnings.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8266459 8268349 8269543 + * @bug 8266459 8268349 8269543 8270380 * @summary check various warnings * @library /test/lib */ @@ -53,7 +53,7 @@ public class SecurityManagerWarnings { String testClasses = System.getProperty("test.classes"); - allowTest(null, testClasses); + disallowTest(null, testClasses); allowTest("allow", testClasses); disallowTest("disallow", testClasses); enableTest("", testClasses); @@ -66,7 +66,7 @@ public class SecurityManagerWarnings { Path.of("A.class"), Path.of("B.class")); - allowTest(null, "a.jar"); + disallowTest(null, "a.jar"); } else { System.out.println("SM is enabled: " + (System.getSecurityManager() != null)); PrintStream oldErr = System.err; diff --git a/test/jdk/sun/security/pkcs11/KeyStore/Basic.java b/test/jdk/sun/security/pkcs11/KeyStore/Basic.java index 21a081e573b..115ebaca1c9 100644 --- a/test/jdk/sun/security/pkcs11/KeyStore/Basic.java +++ b/test/jdk/sun/security/pkcs11/KeyStore/Basic.java @@ -33,7 +33,7 @@ * . 'list' lists the token aliases * . 'basic' does not run with activcard, * @library /test/lib .. - * @run testng/othervm Basic + * @run testng/othervm -Djava.security.manager=allow Basic */ import java.io.*; diff --git a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh index 1e40fcfe981..938ad8de940 100644 --- a/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh +++ b/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh @@ -129,7 +129,7 @@ TEST_ARGS="${TESTVMOPTS} -classpath ${TESTCLASSPATH} \ ${TESTJAVA}${FS}bin${FS}java ${TEST_ARGS} MultipleLogins || exit 10 # run test with security manager -${TESTJAVA}${FS}bin${FS}java ${TEST_ARGS} MultipleLogins useSimplePolicy || exit 11 +${TESTJAVA}${FS}bin${FS}java ${TEST_ARGS} -Djava.security.manager=allow MultipleLogins useSimplePolicy || exit 11 echo Done exit 0 -- GitLab From 3b0ce23bcd827d0998fe9b43e5b0220c915dab21 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Thu, 21 Oct 2021 14:05:45 +0000 Subject: [PATCH 027/890] 8274888: Dump "-DReproduce=true" to the test VM command line output Reviewed-by: thartmann, kvn --- .../jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java index d5aa12976ba..168dc54707c 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java @@ -153,6 +153,8 @@ public class TestVMProcess { } catch (Exception e) { throw new TestFrameworkException("Error while executing Test VM", e); } + + process.command().add(1, "-DReproduce=true"); // Add after "/path/to/bin/java" in order to rerun the test VM directly commandLine = "Command Line:" + System.lineSeparator() + String.join(" ", process.command()) + System.lineSeparator(); hotspotPidFileName = String.format("hotspot_pid%d.log", oa.pid()); -- GitLab From 3cb241a91fd2cc6b0b3b333288028694e60f723f Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 21 Oct 2021 15:25:10 +0000 Subject: [PATCH 028/890] 8275686: Suppress warnings on non-serializable non-transient instance fields in java.rmi Reviewed-by: bpb, iris, rriggs --- src/java.rmi/share/classes/sun/rmi/server/UnicastRef.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java.rmi/share/classes/sun/rmi/server/UnicastRef.java b/src/java.rmi/share/classes/sun/rmi/server/UnicastRef.java index caa727e9db1..326edf2590c 100644 --- a/src/java.rmi/share/classes/sun/rmi/server/UnicastRef.java +++ b/src/java.rmi/share/classes/sun/rmi/server/UnicastRef.java @@ -71,6 +71,7 @@ public class UnicastRef implements RemoteRef { Boolean.getBoolean("sun.rmi.client.logCalls"))); private static final long serialVersionUID = 8258372400816541186L; + @SuppressWarnings("serial") // Type of field is not Serializable protected LiveRef ref; /** -- GitLab From 0761a4b915217abb08ef9b5c1a60878aedf5572c Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 21 Oct 2021 15:26:07 +0000 Subject: [PATCH 029/890] 8275688: Suppress warnings on non-serializable non-transient instance fields in DualPivotQuicksort Reviewed-by: rriggs --- .../share/classes/java/util/DualPivotQuicksort.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/DualPivotQuicksort.java b/src/java.base/share/classes/java/util/DualPivotQuicksort.java index ac96b34c5fb..3dcc7fee1f5 100644 --- a/src/java.base/share/classes/java/util/DualPivotQuicksort.java +++ b/src/java.base/share/classes/java/util/DualPivotQuicksort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -3997,6 +3997,7 @@ final class DualPivotQuicksort { */ private static final class Sorter extends CountedCompleter { private static final long serialVersionUID = 20180818L; + @SuppressWarnings("serial") private final Object a, b; private final int low, size, offset, depth; @@ -4066,6 +4067,7 @@ final class DualPivotQuicksort { */ private static final class Merger extends CountedCompleter { private static final long serialVersionUID = 20180818L; + @SuppressWarnings("serial") private final Object dst, a1, a2; private final int k, lo1, hi1, lo2, hi2; @@ -4115,6 +4117,7 @@ final class DualPivotQuicksort { */ private static final class RunMerger extends RecursiveTask { private static final long serialVersionUID = 20180818L; + @SuppressWarnings("serial") private final Object a, b; private final int[] run; private final int offset, aim, lo, hi; -- GitLab From af14650127de47058b958be411503584c0ba6323 Mon Sep 17 00:00:00 2001 From: Mikhailo Seledtsov Date: Thu, 21 Oct 2021 15:31:03 +0000 Subject: [PATCH 030/890] 8275569: Add linux-aarch64 to test-make profiles Reviewed-by: ihse --- make/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index af65ba7a756..5fc212aa452 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -559,7 +559,7 @@ var getJibProfilesProfiles = function (input, common, data) { "ANT_HOME": input.get("ant", "home_path") } }; - [ "linux-x64", "macosx-x64", "windows-x64"] + [ "linux-x64", "macosx-x64", "windows-x64", "linux-aarch64"] .forEach(function (name) { var maketestName = name + "-testmake"; profiles[maketestName] = concatObjects(profiles[name], testmakeBase); -- GitLab From bef8cf1ba14d3846977942844f341f5c5a1f44c4 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 21 Oct 2021 15:49:21 +0000 Subject: [PATCH 031/890] 8275714: G1: remove unused variable in G1Policy::transfer_survivors_to_cset Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/g1Policy.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1Policy.cpp b/src/hotspot/share/gc/g1/g1Policy.cpp index ef704c2240d..dc47bebd7e4 100644 --- a/src/hotspot/share/gc/g1/g1Policy.cpp +++ b/src/hotspot/share/gc/g1/g1Policy.cpp @@ -1501,7 +1501,6 @@ void G1Policy::update_survival_estimates_for_next_collection() { void G1Policy::transfer_survivors_to_cset(const G1SurvivorRegions* survivors) { start_adding_survivor_regions(); - HeapRegion* last = NULL; for (GrowableArrayIterator it = survivors->regions()->begin(); it != survivors->regions()->end(); ++it) { @@ -1512,8 +1511,6 @@ void G1Policy::transfer_survivors_to_cset(const G1SurvivorRegions* survivors) { // the incremental collection set for the next evacuation // pause. _collection_set->add_survivor_regions(curr); - - last = curr; } stop_adding_survivor_regions(); -- GitLab From 49f9d8031e9c678e20dcfc1ba06758b511a26b07 Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Thu, 21 Oct 2021 17:28:40 +0000 Subject: [PATCH 032/890] 8243585: AlgorithmChecker::check throws confusing exception when it rejects the signer key Reviewed-by: ascarpino --- .../provider/certpath/AlgorithmChecker.java | 269 +++++++++--------- .../CertPathConstraintsParameters.java | 8 +- .../certpath/PKIXCertPathValidator.java | 4 +- .../security/util/AlgorithmDecomposer.java | 109 ++++--- .../util/DisabledAlgorithmConstraints.java | 13 +- .../ssl/SSLContextImpl/TrustTrustedCert.java | 4 +- .../tools/jarsigner/CheckSignerCertChain.java | 4 +- .../sun/security/tools/jarsigner/Warning.java | 18 +- 8 files changed, 205 insertions(+), 224 deletions(-) diff --git a/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java b/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java index 3ed82afaab8..4a79c3a3f51 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java @@ -74,10 +74,10 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { private static final Debug debug = Debug.getInstance("certpath"); private final AlgorithmConstraints constraints; - private final PublicKey trustedPubKey; private final Date date; - private PublicKey prevPubKey; private final String variant; + private PublicKey trustedPubKey; + private PublicKey prevPubKey; private TrustAnchor anchor; private static final Set SIGNATURE_PRIMITIVE_SET = @@ -90,10 +90,6 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { CryptoPrimitive.PUBLIC_KEY_ENCRYPTION, CryptoPrimitive.KEY_AGREEMENT)); - private static final DisabledAlgorithmConstraints - certPathDefaultConstraints = - DisabledAlgorithmConstraints.certPathConstraints(); - /** * Create a new {@code AlgorithmChecker} with the given * {@code TrustAnchor} and {@code String} variant. @@ -104,7 +100,7 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { * passed will set it to Validator.GENERIC. */ public AlgorithmChecker(TrustAnchor anchor, String variant) { - this(anchor, certPathDefaultConstraints, null, variant); + this(anchor, null, null, variant); } /** @@ -141,19 +137,11 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { AlgorithmConstraints constraints, Date date, String variant) { if (anchor != null) { - if (anchor.getTrustedCert() != null) { - this.trustedPubKey = anchor.getTrustedCert().getPublicKey(); - } else { - this.trustedPubKey = anchor.getCAPublicKey(); - } - this.anchor = anchor; - } else { - this.trustedPubKey = null; + setTrustAnchorAndKeys(anchor); } - this.prevPubKey = this.trustedPubKey; - this.constraints = (constraints == null ? certPathDefaultConstraints : - constraints); + this.constraints = constraints == null ? + DisabledAlgorithmConstraints.certPathConstraints() : constraints; this.date = date; this.variant = (variant == null ? Validator.VAR_GENERIC : variant); } @@ -172,18 +160,14 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { * passed will set it to Validator.GENERIC. */ public AlgorithmChecker(TrustAnchor anchor, Date date, String variant) { - this(anchor, certPathDefaultConstraints, date, variant); + this(anchor, null, date, variant); } @Override public void init(boolean forward) throws CertPathValidatorException { // Note that this class does not support forward mode. if (!forward) { - if (trustedPubKey != null) { - prevPubKey = trustedPubKey; - } else { - prevPubKey = null; - } + prevPubKey = trustedPubKey; } else { throw new CertPathValidatorException("forward checking not supported"); @@ -207,8 +191,8 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { Collection unresolvedCritExts) throws CertPathValidatorException { - if (!(cert instanceof X509Certificate) || constraints == null) { - // ignore the check for non-x.509 certificate or null constraints + if (!(cert instanceof X509Certificate)) { + // ignore the check for non-x.509 certificate return; } @@ -233,115 +217,114 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { PublicKey currPubKey = cert.getPublicKey(); String currSigAlg = x509Cert.getSigAlgName(); - // Check the signature algorithm and parameters against constraints. - if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, currSigAlg, - currSigAlgParams)) { - throw new CertPathValidatorException( - "Algorithm constraints check failed on signature " + - "algorithm: " + currSigAlg, null, null, -1, - BasicReason.ALGORITHM_CONSTRAINED); - } - - // Assume all key usage bits are set if key usage is not present - Set primitives = KU_PRIMITIVE_SET; - - if (keyUsage != null) { - primitives = EnumSet.noneOf(CryptoPrimitive.class); - - if (keyUsage[0] || keyUsage[1] || keyUsage[5] || keyUsage[6]) { - // keyUsage[0]: KeyUsage.digitalSignature - // keyUsage[1]: KeyUsage.nonRepudiation - // keyUsage[5]: KeyUsage.keyCertSign - // keyUsage[6]: KeyUsage.cRLSign - primitives.add(CryptoPrimitive.SIGNATURE); - } - - if (keyUsage[2]) { // KeyUsage.keyEncipherment - primitives.add(CryptoPrimitive.KEY_ENCAPSULATION); - } - - if (keyUsage[3]) { // KeyUsage.dataEncipherment - primitives.add(CryptoPrimitive.PUBLIC_KEY_ENCRYPTION); - } - - if (keyUsage[4]) { // KeyUsage.keyAgreement - primitives.add(CryptoPrimitive.KEY_AGREEMENT); - } - - // KeyUsage.encipherOnly and KeyUsage.decipherOnly are - // undefined in the absence of the keyAgreement bit. - - if (primitives.isEmpty()) { - throw new CertPathValidatorException( - "incorrect KeyUsage extension bits", - null, null, -1, PKIXReason.INVALID_KEY_USAGE); + if (constraints instanceof DisabledAlgorithmConstraints) { + DisabledAlgorithmConstraints dac = + (DisabledAlgorithmConstraints)constraints; + if (prevPubKey != null && prevPubKey == trustedPubKey) { + // check constraints of trusted public key (make sure + // algorithm and size is not restricted) + CertPathConstraintsParameters cp = + new CertPathConstraintsParameters(trustedPubKey, variant, + anchor, date); + dac.permits(trustedPubKey.getAlgorithm(), cp); } - } - - ConstraintsParameters cp = - new CertPathConstraintsParameters(x509Cert, variant, + // Check the signature algorithm and parameters against constraints + CertPathConstraintsParameters cp = + new CertPathConstraintsParameters(x509Cert, variant, anchor, date); - - // Check against local constraints if it is DisabledAlgorithmConstraints - if (constraints instanceof DisabledAlgorithmConstraints) { - ((DisabledAlgorithmConstraints)constraints).permits(currSigAlg, - currSigAlgParams, cp); - // DisabledAlgorithmsConstraints does not check primitives, so key - // additional key check. - + dac.permits(currSigAlg, currSigAlgParams, cp); } else { - // Perform the default constraints checking anyway. - certPathDefaultConstraints.permits(currSigAlg, currSigAlgParams, cp); - // Call locally set constraints to check key with primitives. - if (!constraints.permits(primitives, currPubKey)) { - throw new CertPathValidatorException( - "Algorithm constraints check failed on key " + - currPubKey.getAlgorithm() + " with size of " + - sun.security.util.KeyUtil.getKeySize(currPubKey) + - "bits", + if (prevPubKey != null) { + if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, + currSigAlg, prevPubKey, currSigAlgParams)) { + throw new CertPathValidatorException( + "Algorithm constraints check failed on " + + currSigAlg + "signature and " + + currPubKey.getAlgorithm() + " key with size of " + + sun.security.util.KeyUtil.getKeySize(currPubKey) + + "bits", + null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); + } + } else { + if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, + currSigAlg, currSigAlgParams)) { + throw new CertPathValidatorException( + "Algorithm constraints check failed on " + + "signature algorithm: " + currSigAlg, null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); + } } - } - - // If there is no previous key, set one and exit - if (prevPubKey == null) { - prevPubKey = currPubKey; - return; - } + // Assume all key usage bits are set if key usage is not present + Set primitives = KU_PRIMITIVE_SET; - // Check with previous cert for signature algorithm and public key - if (!constraints.permits( - SIGNATURE_PRIMITIVE_SET, - currSigAlg, prevPubKey, currSigAlgParams)) { - throw new CertPathValidatorException( - "Algorithm constraints check failed on " + - "signature algorithm: " + currSigAlg, - null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); - } + if (keyUsage != null) { + primitives = EnumSet.noneOf(CryptoPrimitive.class); - // Inherit key parameters from previous key - if (PKIX.isDSAPublicKeyWithoutParams(currPubKey)) { - // Inherit DSA parameters from previous key - if (!(prevPubKey instanceof DSAPublicKey)) { - throw new CertPathValidatorException("Input key is not " + - "of a appropriate type for inheriting parameters"); + if (keyUsage[0] || keyUsage[1] || keyUsage[5] || keyUsage[6]) { + // keyUsage[0]: KeyUsage.digitalSignature + // keyUsage[1]: KeyUsage.nonRepudiation + // keyUsage[5]: KeyUsage.keyCertSign + // keyUsage[6]: KeyUsage.cRLSign + primitives.add(CryptoPrimitive.SIGNATURE); + } + + if (keyUsage[2]) { // KeyUsage.keyEncipherment + primitives.add(CryptoPrimitive.KEY_ENCAPSULATION); + } + + if (keyUsage[3]) { // KeyUsage.dataEncipherment + primitives.add(CryptoPrimitive.PUBLIC_KEY_ENCRYPTION); + } + + if (keyUsage[4]) { // KeyUsage.keyAgreement + primitives.add(CryptoPrimitive.KEY_AGREEMENT); + } + + // KeyUsage.encipherOnly and KeyUsage.decipherOnly are + // undefined in the absence of the keyAgreement bit. + + if (primitives.isEmpty()) { + throw new CertPathValidatorException( + "incorrect KeyUsage extension bits", + null, null, -1, PKIXReason.INVALID_KEY_USAGE); + } } - - DSAParams params = ((DSAPublicKey)prevPubKey).getParams(); - if (params == null) { + if (!constraints.permits(primitives, currPubKey)) { throw new CertPathValidatorException( - "Key parameters missing from public key."); + "Algorithm constraints check failed on " + + currPubKey.getAlgorithm() + " key with size of " + + sun.security.util.KeyUtil.getKeySize(currPubKey) + + "bits", + null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); } + } - try { - BigInteger y = ((DSAPublicKey)currPubKey).getY(); - KeyFactory kf = KeyFactory.getInstance("DSA"); - DSAPublicKeySpec ks = new DSAPublicKeySpec(y, params.getP(), - params.getQ(), params.getG()); - currPubKey = kf.generatePublic(ks); - } catch (GeneralSecurityException e) { - throw new CertPathValidatorException("Unable to generate " + - "key with inherited parameters: " + e.getMessage(), e); + if (prevPubKey != null) { + // Inherit key parameters from previous key + if (PKIX.isDSAPublicKeyWithoutParams(currPubKey)) { + // Inherit DSA parameters from previous key + if (!(prevPubKey instanceof DSAPublicKey)) { + throw new CertPathValidatorException("Input key is not " + + "of a appropriate type for inheriting parameters"); + } + + DSAParams params = ((DSAPublicKey)prevPubKey).getParams(); + if (params == null) { + throw new CertPathValidatorException( + "Key parameters missing from public key."); + } + + try { + BigInteger y = ((DSAPublicKey)currPubKey).getY(); + KeyFactory kf = KeyFactory.getInstance("DSA"); + DSAPublicKeySpec ks = new DSAPublicKeySpec(y, params.getP(), + params.getQ(), params.getG()); + currPubKey = kf.generatePublic(ks); + } catch (GeneralSecurityException e) { + throw new CertPathValidatorException("Unable to generate " + + "key with inherited parameters: " + + e.getMessage(), e); + } } } @@ -349,6 +332,20 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { prevPubKey = currPubKey; } + /** + * Sets the anchor, trustedPubKey and prevPubKey fields based on the + * specified trust anchor. + */ + private void setTrustAnchorAndKeys(TrustAnchor anchor) { + if (anchor.getTrustedCert() != null) { + this.trustedPubKey = anchor.getTrustedCert().getPublicKey(); + } else { + this.trustedPubKey = anchor.getCAPublicKey(); + } + this.anchor = anchor; + this.prevPubKey = this.trustedPubKey; + } + /** * Try to set the trust anchor of the checker. *

@@ -359,21 +356,9 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { * certificate */ void trySetTrustAnchor(TrustAnchor anchor) { - // Don't bother if the check has started or trust anchor has already - // specified. - if (prevPubKey == null) { - if (anchor == null) { - throw new IllegalArgumentException( - "The trust anchor cannot be null"); - } - - // Don't bother to change the trustedPubKey. - if (anchor.getTrustedCert() != null) { - prevPubKey = anchor.getTrustedCert().getPublicKey(); - } else { - prevPubKey = anchor.getCAPublicKey(); - } - this.anchor = anchor; + // Only set if trust anchor has not already been set. + if (this.trustedPubKey == null) { + setTrustAnchorAndKeys(anchor); } } @@ -412,9 +397,9 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { static void check(PublicKey key, AlgorithmId algorithmId, String variant, TrustAnchor anchor) throws CertPathValidatorException { - certPathDefaultConstraints.permits(algorithmId.getName(), - algorithmId.getParameters(), - new CertPathConstraintsParameters(key, variant, anchor)); + DisabledAlgorithmConstraints.certPathConstraints().permits( + algorithmId.getName(), algorithmId.getParameters(), + new CertPathConstraintsParameters(key, variant, anchor, null)); } } diff --git a/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java b/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java index dacbd12737a..679e8657451 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/CertPathConstraintsParameters.java @@ -50,8 +50,8 @@ public class CertPathConstraintsParameters implements ConstraintsParameters { private final Date date; // The variant or usage of this certificate private final String variant; - // The certificate being checked (may be null if a CRL or OCSPResponse is - // being checked) + // The certificate being checked (may be null if a raw public key, a CRL + // or an OCSPResponse is being checked) private final X509Certificate cert; public CertPathConstraintsParameters(X509Certificate cert, @@ -60,8 +60,8 @@ public class CertPathConstraintsParameters implements ConstraintsParameters { } public CertPathConstraintsParameters(Key key, String variant, - TrustAnchor anchor) { - this(key, variant, anchor, null, null); + TrustAnchor anchor, Date date) { + this(key, variant, anchor, date, null); } private CertPathConstraintsParameters(Key key, String variant, diff --git a/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java b/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java index de3923bb3bc..0454d84ac46 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java @@ -176,8 +176,8 @@ public final class PKIXCertPathValidator extends CertPathValidatorSpi { List certPathCheckers = new ArrayList<>(); // add standard checkers that we will be using certPathCheckers.add(untrustedChecker); - certPathCheckers.add(new AlgorithmChecker(anchor, null, - params.timestamp(), params.variant())); + certPathCheckers.add(new AlgorithmChecker(anchor, params.timestamp(), + params.variant())); certPathCheckers.add(new KeyChecker(certPathLen, params.targetCertConstraints())); certPathCheckers.add(new ConstraintsChecker(certPathLen)); diff --git a/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java b/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java index ee97d461ac1..69eaa22aafb 100644 --- a/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java +++ b/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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,6 +26,8 @@ package sun.security.util; import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.Arrays; import java.util.Collection; @@ -40,6 +42,14 @@ public class AlgorithmDecomposer { private static final Pattern PATTERN = Pattern.compile("with|and|(? DECOMPOSED_DIGEST_NAMES = + Map.of("SHA-1", "SHA1", "SHA-224", "SHA224", "SHA-256", "SHA256", + "SHA-384", "SHA384", "SHA-512", "SHA512", "SHA-512/224", + "SHA512/224", "SHA-512/256", "SHA512/256"); + private static Set decomposeImpl(String algorithm) { Set elements = new HashSet<>(); @@ -93,44 +103,19 @@ public class AlgorithmDecomposer { // signature algorithm "SHA256withRSA". So we need to check both // "SHA-256" and "SHA256" to make the right constraint checking. - // handle special name: SHA-1 and SHA1 - if (elements.contains("SHA1") && !elements.contains("SHA-1")) { - elements.add("SHA-1"); - } - if (elements.contains("SHA-1") && !elements.contains("SHA1")) { - elements.add("SHA1"); + // no need to check further if algorithm doesn't contain "SHA" + if (!algorithm.contains("SHA")) { + return elements; } - // handle special name: SHA-224 and SHA224 - if (elements.contains("SHA224") && !elements.contains("SHA-224")) { - elements.add("SHA-224"); - } - if (elements.contains("SHA-224") && !elements.contains("SHA224")) { - elements.add("SHA224"); - } - - // handle special name: SHA-256 and SHA256 - if (elements.contains("SHA256") && !elements.contains("SHA-256")) { - elements.add("SHA-256"); - } - if (elements.contains("SHA-256") && !elements.contains("SHA256")) { - elements.add("SHA256"); - } - - // handle special name: SHA-384 and SHA384 - if (elements.contains("SHA384") && !elements.contains("SHA-384")) { - elements.add("SHA-384"); - } - if (elements.contains("SHA-384") && !elements.contains("SHA384")) { - elements.add("SHA384"); - } - - // handle special name: SHA-512 and SHA512 - if (elements.contains("SHA512") && !elements.contains("SHA-512")) { - elements.add("SHA-512"); - } - if (elements.contains("SHA-512") && !elements.contains("SHA512")) { - elements.add("SHA512"); + for (Map.Entry e : DECOMPOSED_DIGEST_NAMES.entrySet()) { + if (elements.contains(e.getValue()) && + !elements.contains(e.getKey())) { + elements.add(e.getKey()); + } else if (elements.contains(e.getKey()) && + !elements.contains(e.getValue())) { + elements.add(e.getValue()); + } } return elements; @@ -153,40 +138,44 @@ public class AlgorithmDecomposer { return Arrays.asList(aliases); } - private static void hasLoop(Set elements, String find, String replace) { - if (elements.contains(find)) { - if (!elements.contains(replace)) { - elements.add(replace); - } - elements.remove(find); - } - } - - /* - * This decomposes a standard name into sub-elements with a consistent - * message digest algorithm name to avoid overly complicated checking. + /** + * Decomposes a standard algorithm name into sub-elements and uses a + * consistent message digest algorithm name to avoid overly complicated + * checking. */ - public static Set decomposeOneHash(String algorithm) { + static Set decomposeName(String algorithm) { if (algorithm == null || algorithm.isEmpty()) { return new HashSet<>(); } Set elements = decomposeImpl(algorithm); - hasLoop(elements, "SHA-1", "SHA1"); - hasLoop(elements, "SHA-224", "SHA224"); - hasLoop(elements, "SHA-256", "SHA256"); - hasLoop(elements, "SHA-384", "SHA384"); - hasLoop(elements, "SHA-512", "SHA512"); + // no need to check further if algorithm doesn't contain "SHA" + if (!algorithm.contains("SHA")) { + return elements; + } + + for (Map.Entry e : DECOMPOSED_DIGEST_NAMES.entrySet()) { + if (elements.contains(e.getKey())) { + if (!elements.contains(e.getValue())) { + elements.add(e.getValue()); + } + elements.remove(e.getKey()); + } + } return elements; } - /* - * The provided message digest algorithm name will return a consistent - * naming scheme. + /** + * Decomposes a standard message digest algorithm name into a consistent + * name for matching purposes. + * + * @param algorithm the name to be decomposed + * @return the decomposed name, or the passed in algorithm name if + * it is not a digest algorithm or does not need to be decomposed */ - public static String hashName(String algorithm) { - return algorithm.replace("-", ""); + static String decomposeDigestName(String algorithm) { + return DECOMPOSED_DIGEST_NAMES.getOrDefault(algorithm, algorithm); } } diff --git a/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java index c56f9b60b75..2bf39bfae6f 100644 --- a/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java +++ b/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java @@ -304,10 +304,6 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { /** * Key and Certificate Constraints * - * The complete disabling of an algorithm is not handled by Constraints or - * Constraint classes. That is addressed with - * permit(Set, String, AlgorithmParameters) - * * When passing a Key to permit(), the boolean return values follow the * same as the interface class AlgorithmConstraints.permit(). This is to * maintain compatibility: @@ -318,7 +314,6 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { * will be thrown on a failure to better identify why the operation was * disallowed. */ - private static class Constraints { private Map> constraintsMap = new HashMap<>(); @@ -341,9 +336,9 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { // Check if constraint is a complete disabling of an // algorithm or has conditions. int space = constraintEntry.indexOf(' '); - String algorithm = AlgorithmDecomposer.hashName( - ((space > 0 ? constraintEntry.substring(0, space) : - constraintEntry))); + String algorithm = AlgorithmDecomposer.decomposeDigestName( + space > 0 ? constraintEntry.substring(0, space) : + constraintEntry); List constraintList = constraintsMap.getOrDefault( algorithm.toUpperCase(Locale.ENGLISH), @@ -497,7 +492,7 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { // Get all signature algorithms to check for constraints Set algorithms = new HashSet<>(); if (algorithm != null) { - algorithms.addAll(AlgorithmDecomposer.decomposeOneHash(algorithm)); + algorithms.addAll(AlgorithmDecomposer.decomposeName(algorithm)); algorithms.add(algorithm); } diff --git a/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java b/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java index 6d705000e86..463dd287883 100644 --- a/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java +++ b/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java @@ -159,9 +159,9 @@ public class TrustTrustedCert extends SSLSocketTemplate { if (expectFail) { // focus on the CertPathValidatorException Throwable t = e.getCause().getCause(); - if (t == null || !t.toString().contains("MD5withRSA")) { + if (t == null || !t.toString().contains("MD5")) { throw new RuntimeException( - "Expected to see MD5withRSA in exception output", t); + "Expected to see MD5 in exception output", t); } } else { throw e; diff --git a/test/jdk/sun/security/tools/jarsigner/CheckSignerCertChain.java b/test/jdk/sun/security/tools/jarsigner/CheckSignerCertChain.java index 65c3ee6f2ad..8465f36261b 100644 --- a/test/jdk/sun/security/tools/jarsigner/CheckSignerCertChain.java +++ b/test/jdk/sun/security/tools/jarsigner/CheckSignerCertChain.java @@ -129,7 +129,7 @@ public class CheckSignerCertChain { " a.jar ee") .shouldContain("Signature algorithm: MD5withRSA (disabled), 2048-bit key") .shouldContain("Signature algorithm: SHA256withRSA, 2048-bit key") - .shouldContain("Invalid certificate chain: Algorithm constraints check failed on signature algorithm: MD5withRSA") + .shouldContain("Invalid certificate chain: Algorithm constraints check failed on disabled algorithm: MD5 used with certificate: CN=EE") .shouldHaveExitValue(0); kt("-exportcert -alias cacert -rfc -file cacert", "ks"); @@ -139,7 +139,7 @@ public class CheckSignerCertChain { "-keystore caks1 -storepass changeit -verbose -debug") .shouldContain("Signature algorithm: MD5withRSA (disabled), 2048-bit key") .shouldContain("Signature algorithm: SHA256withRSA, 2048-bit key") - .shouldContain("Invalid certificate chain: Algorithm constraints check failed on signature algorithm: MD5withRSA") + .shouldContain("Invalid certificate chain: Algorithm constraints check failed on disabled algorithm: MD5 used with certificate: CN=EE") .shouldHaveExitValue(0); } } diff --git a/test/jdk/sun/security/tools/jarsigner/Warning.java b/test/jdk/sun/security/tools/jarsigner/Warning.java index 47e36999077..e7ed287e6ec 100644 --- a/test/jdk/sun/security/tools/jarsigner/Warning.java +++ b/test/jdk/sun/security/tools/jarsigner/Warning.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -32,7 +32,7 @@ import java.util.Arrays; /** * @test - * @bug 8024302 8026037 8130132 + * @bug 8024302 8026037 8130132 8243585 * @summary warnings, errors and -strict * @library /lib/testlibrary /test/lib * @build jdk.test.lib.util.JarUtils @@ -83,7 +83,7 @@ public class Warning { issueCert("b", "-sigalg MD5withRSA"); run("jarsigner", "a.jar b") - .shouldMatch("chain is invalid. Reason:.*MD5withRSA"); + .shouldMatch("chain is invalid. Reason:.*MD5.*"); recreateJar(); @@ -175,6 +175,18 @@ public class Warning { .shouldHaveExitValue(4) .shouldContain("with signer errors") .shouldMatch("(?s).*Error:.*has expired.*Warning:.*"); + + // Sign jar with Trust Anchor that has a 512 bit key. Make sure + // the error message indicates the key size is restricted. + recreateJar(); + run("keytool", "-delete -alias ca"); + newCert("ca", "-keysize 512", "-validity 365000", "-ext bc:c"); + newCert("d"); + issueCert("d"); + run("jarsigner", "a.jar d") + .shouldContain("chain is invalid. " + + "Reason: Algorithm constraints check failed on " + + "keysize limits: RSA 512 bit key."); } // Creates a new jar without signature -- GitLab From 7dd823740f7bfc55f456a5c8c199475cc85dfea3 Mon Sep 17 00:00:00 2001 From: Yumin Qi Date: Thu, 21 Oct 2021 18:30:21 +0000 Subject: [PATCH 033/890] 8275084: CDS warning when building with LOG=debug Reviewed-by: dholmes, iklam --- src/hotspot/share/cds/classListWriter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/share/cds/classListWriter.cpp b/src/hotspot/share/cds/classListWriter.cpp index 45421457a63..6750a5d4cac 100644 --- a/src/hotspot/share/cds/classListWriter.cpp +++ b/src/hotspot/share/cds/classListWriter.cpp @@ -59,6 +59,11 @@ void ClassListWriter::write(const InstanceKlass* k, const ClassFileStream* cfs) return; } + // filter out java/lang/invoke/BoundMethodHandle$Species.... + if (cfs != NULL && strcmp(cfs->source(), "_ClassSpecializer_generateConcreteSpeciesCode") == 0) { + return; + } + ClassListWriter w; write_to_stream(k, w.stream(), cfs); } -- GitLab From 0961de47de1bf4379089e010978bcb4708fde767 Mon Sep 17 00:00:00 2001 From: Dean Long Date: Thu, 21 Oct 2021 19:02:38 +0000 Subject: [PATCH 034/890] 8275347: ciReplay: staticfield lines not properly terminated Reviewed-by: neliasso, chagedorn --- src/hotspot/share/ci/ciInstanceKlass.cpp | 2 +- src/hotspot/share/ci/ciReplay.cpp | 41 ++++++++++++------- .../jtreg/compiler/ciReplay/CiReplayBase.java | 6 +++ 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp index 8557410f956..b637bec1d53 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.cpp +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp @@ -707,7 +707,7 @@ class StaticFinalFieldPrinter : public FieldClosure { assert(fd->field_type() == T_OBJECT, ""); if (value->is_a(vmClasses::String_klass())) { const char* ascii_value = java_lang_String::as_quoted_ascii(value); - _out->print("\"%s\"", (ascii_value != NULL) ? ascii_value : ""); + _out->print_cr("\"%s\"", (ascii_value != NULL) ? ascii_value : ""); } else { const char* klass_name = value->klass()->name()->as_quoted_ascii(); _out->print_cr("%s", klass_name); diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index a5f69bec4ea..90db561dece 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -128,7 +128,6 @@ class CompileReplay : public StackObj { char* _bufptr; char* _buffer; int _buffer_length; - int _buffer_pos; // "compile" data ciKlass* _iklass; @@ -153,7 +152,6 @@ class CompileReplay : public StackObj { _buffer_length = 32; _buffer = NEW_RESOURCE_ARRAY(char, _buffer_length); _bufptr = _buffer; - _buffer_pos = 0; _imethod = NULL; _iklass = NULL; @@ -189,10 +187,6 @@ class CompileReplay : public StackObj { void report_error(const char* msg) { _error_message = msg; - // Restore the _buffer contents for error reporting - for (int i = 0; i < _buffer_pos; i++) { - if (_buffer[i] == '\0') _buffer[i] = ' '; - } } int parse_int(const char* label) { @@ -232,6 +226,10 @@ class CompileReplay : public StackObj { } } + // Ignore the rest of the line + void skip_remaining() { + _bufptr = &_bufptr[strlen(_bufptr)]; // skip ahead to terminator + } char* scan_and_terminate(char delim) { char* str = _bufptr; @@ -581,8 +579,9 @@ class CompileReplay : public StackObj { } int get_line(int c) { + int buffer_pos = 0; while(c != EOF) { - if (_buffer_pos + 1 >= _buffer_length) { + if (buffer_pos + 1 >= _buffer_length) { int new_length = _buffer_length * 2; // Next call will throw error in case of OOM. _buffer = REALLOC_RESOURCE_ARRAY(char, _buffer, _buffer_length, new_length); @@ -594,13 +593,12 @@ class CompileReplay : public StackObj { } else if (c == '\r') { // skip LF } else { - _buffer[_buffer_pos++] = c; + _buffer[buffer_pos++] = c; } c = getc(_stream); } // null terminate it, reset the pointer - _buffer[_buffer_pos] = '\0'; // NL or EOF - _buffer_pos = 0; + _buffer[buffer_pos] = '\0'; // NL or EOF _bufptr = _buffer; return c; } @@ -614,7 +612,8 @@ class CompileReplay : public StackObj { c = get_line(c); process_command(THREAD); if (had_error()) { - tty->print_cr("Error while parsing line %d: %s\n", line_no, _error_message); + int pos = _bufptr - _buffer + 1; + tty->print_cr("Error while parsing line %d at position %d: %s\n", line_no, pos, _error_message); if (ReplayIgnoreInitErrors) { CLEAR_PENDING_EXCEPTION; _error_message = NULL; @@ -632,7 +631,11 @@ class CompileReplay : public StackObj { return; } if (strcmp("#", cmd) == 0) { - // ignore + // comment line, print or ignore + if (Verbose) { + tty->print_cr("# %s", _bufptr); + } + skip_remaining(); } else if (strcmp("compile", cmd) == 0) { process_compile(CHECK); } else if (strcmp("ciMethod", cmd) == 0) { @@ -652,6 +655,9 @@ class CompileReplay : public StackObj { } else { report_error("unknown command"); } + if (!had_error() && *_bufptr != '\0') { + report_error("line not properly terminated"); + } } // validation of comp_level @@ -877,9 +883,13 @@ class CompileReplay : public StackObj { report_error("hidden class with comment expected"); return; } - if (is_comment && Verbose) { - const char* hidden = parse_string(); - tty->print_cr("Found %s for %s", k->name()->as_quoted_ascii(), hidden); + // comment, print or ignore + if (is_comment) { + if (Verbose) { + const char* hidden = parse_string(); + tty->print_cr("Found %s for %s", k->name()->as_quoted_ascii(), hidden); + } + skip_remaining(); } } @@ -990,6 +1000,7 @@ class CompileReplay : public StackObj { if (k == NULL || ReplaySuppressInitializers == 0 || (ReplaySuppressInitializers == 2 && k->class_loader() == NULL)) { + skip_remaining(); return; } diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index e401cbdd49c..7ef7d66c2ff 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -81,6 +81,12 @@ public abstract class CiReplayBase { } public static class TestMain { + private static final String emptyString; + + static { + emptyString = ""; + } + public static void main(String[] args) { // explicitly trigger native compilation Lambda start = () -> 0; -- GitLab From 4e9dd4bddb888717d774147d4ba1acecc750629c Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 21 Oct 2021 20:52:31 +0000 Subject: [PATCH 035/890] 8275384: Change nested classes in jdk.jconsole to static nested classes Reviewed-by: alanb, sspitsyn, mchung --- .../sun/tools/jconsole/MaximizableInternalFrame.java | 4 ++-- .../share/classes/sun/tools/jconsole/MemoryTab.java | 4 ++-- .../share/classes/sun/tools/jconsole/ThreadTab.java | 4 ++-- .../sun/tools/jconsole/inspector/XMBeanAttributes.java | 6 +++--- .../sun/tools/jconsole/inspector/XMBeanNotifications.java | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java b/src/jdk.jconsole/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java index 9bd4ee4fd88..cf411b1c7ab 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/MaximizableInternalFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2021, 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 @@ -189,7 +189,7 @@ public class MaximizableInternalFrame extends JInternalFrame { } - private class FixedMenuBarLayout extends BoxLayout { + private static class FixedMenuBarLayout extends BoxLayout { public FixedMenuBarLayout(Container target, int axis) { super(target, axis); } diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/MemoryTab.java b/src/jdk.jconsole/share/classes/sun/tools/jconsole/MemoryTab.java index c4a5970b366..bd6cfbaeff7 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/MemoryTab.java +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/MemoryTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -438,7 +438,7 @@ class MemoryTab extends Tab implements ActionListener, ItemListener { } } - private class PoolPlotter extends Plotter { + private static class PoolPlotter extends Plotter { ObjectName objectName; String name; boolean isHeap; diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/ThreadTab.java b/src/jdk.jconsole/share/classes/sun/tools/jconsole/ThreadTab.java index 116d21b9aef..09a2c62f128 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/ThreadTab.java +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/ThreadTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -619,7 +619,7 @@ class ThreadTab extends Tab implements ActionListener, DocumentListener, ListSel } } - private class PromptingTextField extends JTextField implements FocusListener { + private static class PromptingTextField extends JTextField implements FocusListener { private String prompt; boolean promptRemoved = false; Color fg; diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java b/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java index afed4414ca1..e7e0ae72830 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -865,7 +865,7 @@ public class XMBeanAttributes extends XTable { } } - class MaximizedCellRenderer extends DefaultTableCellRenderer { + static class MaximizedCellRenderer extends DefaultTableCellRenderer { Component comp; MaximizedCellRenderer(Component comp) { this.comp = comp; @@ -888,7 +888,7 @@ public class XMBeanAttributes extends XTable { } } - class ZoomedCell { + static class ZoomedCell { TableCellRenderer minRenderer; MaximizedCellRenderer maxRenderer; int minHeight; diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java b/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java index 2ebbc40de09..f51ec3e6313 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/inspector/XMBeanNotifications.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -416,7 +416,7 @@ public class XMBeanNotifications extends JTable implements NotificationListener } } - class UserDataCellRenderer extends DefaultTableCellRenderer { + static class UserDataCellRenderer extends DefaultTableCellRenderer { Component comp; @@ -444,7 +444,7 @@ public class XMBeanNotifications extends JTable implements NotificationListener } } - class UserDataCell { + static class UserDataCell { TableCellRenderer minRenderer; UserDataCellRenderer maxRenderer; -- GitLab From 6a466fe7ae281967d1cc4c8029b306f2d66567c9 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 21 Oct 2021 21:11:01 +0000 Subject: [PATCH 036/890] 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields 8160675: Issue lint warning for non-serializable non-transient instance fields in serializable type Reviewed-by: erikj, sspitsyn, jlahoda, vromero, rriggs, smarks --- .../com/sun/tools/javac/code/Symtab.java | 15 + .../com/sun/tools/javac/comp/Attr.java | 69 +- .../com/sun/tools/javac/comp/Check.java | 697 ++++++++++++++++++ .../com/sun/tools/javac/comp/Resolve.java | 11 + .../tools/javac/resources/compiler.properties | 90 +++ .../tools/javac/resources/javac.properties | 4 +- .../internal/joptsimple/OptionException.java | 3 +- .../com/sun/tools/classfile/ConstantPool.java | 3 +- .../com/sun/tools/javap/InternalError.java | 3 +- .../com/sun/tools/javap/JavapTask.java | 3 +- .../com/sun/tools/jdeps/JdepsTask.java | 3 +- .../tools/jdeps/MultiReleaseException.java | 3 +- .../javac/diags/examples/ImproperSPF.java | 38 + .../javac/diags/examples/ImproperSVUID.java | 5 +- .../diags/examples/IneffectualSerialEnum.java | 43 ++ .../examples/IneffectualSerialExtern.java | 55 ++ .../examples/IneffectualSerialRecord.java | 42 ++ .../SerialInterfaceMethodsAndFields.java | 42 ++ .../examples/SerialMissingNoArgCtor.java | 56 ++ .../examples/SerialNonPrivateMethod.java | 71 ++ .../javac/warnings/Serial/CtorAccess.java | 37 + .../javac/warnings/Serial/CtorAccess.out | 3 + .../Serial/DeepNestingSuppression.java | 33 + .../Serial/DeepNestingSuppression.out | 2 + .../javac/warnings/Serial/EnumSerial.java | 38 + .../javac/warnings/Serial/EnumSerial.out | 8 + .../tools/javac/warnings/Serial/Extern.java | 51 ++ .../tools/javac/warnings/Serial/Extern.out | 6 + .../warnings/Serial/ImproperReturnTypes.java | 46 ++ .../warnings/Serial/ImproperReturnTypes.out | 6 + .../warnings/Serial/ImproperSerialPF.java | 37 + .../warnings/Serial/ImproperSerialPF.out | 4 + .../javac/warnings/Serial/InstanceField.java | 40 + .../javac/warnings/Serial/InstanceField.out | 4 + .../warnings/Serial/InterfaceFields.java | 14 + .../javac/warnings/Serial/InterfaceFields.out | 3 + .../Serial/InterfaceNonPrivateMethods.java | 43 ++ .../Serial/InterfaceNonPrivateMethods.out | 9 + .../javac/warnings/Serial/RecordSerial.java | 44 ++ .../javac/warnings/Serial/RecordSerial.out | 5 + .../warnings/Serial/SerialMethodArity.java | 40 + .../warnings/Serial/SerialMethodArity.out | 6 + .../warnings/Serial/SerialMethodMods.java | 33 + .../warnings/Serial/SerialMethodMods.out | 6 + .../warnings/Serial/SerialMethodThrows.java | 218 ++++++ .../warnings/Serial/SerialMethodThrows.out | 6 + 46 files changed, 1928 insertions(+), 70 deletions(-) create mode 100644 test/langtools/tools/javac/diags/examples/ImproperSPF.java create mode 100644 test/langtools/tools/javac/diags/examples/IneffectualSerialEnum.java create mode 100644 test/langtools/tools/javac/diags/examples/IneffectualSerialExtern.java create mode 100644 test/langtools/tools/javac/diags/examples/IneffectualSerialRecord.java create mode 100644 test/langtools/tools/javac/diags/examples/SerialInterfaceMethodsAndFields.java create mode 100644 test/langtools/tools/javac/diags/examples/SerialMissingNoArgCtor.java create mode 100644 test/langtools/tools/javac/diags/examples/SerialNonPrivateMethod.java create mode 100644 test/langtools/tools/javac/warnings/Serial/CtorAccess.java create mode 100644 test/langtools/tools/javac/warnings/Serial/CtorAccess.out create mode 100644 test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.java create mode 100644 test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.out create mode 100644 test/langtools/tools/javac/warnings/Serial/EnumSerial.java create mode 100644 test/langtools/tools/javac/warnings/Serial/EnumSerial.out create mode 100644 test/langtools/tools/javac/warnings/Serial/Extern.java create mode 100644 test/langtools/tools/javac/warnings/Serial/Extern.out create mode 100644 test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.java create mode 100644 test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.out create mode 100644 test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.java create mode 100644 test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.out create mode 100644 test/langtools/tools/javac/warnings/Serial/InstanceField.java create mode 100644 test/langtools/tools/javac/warnings/Serial/InstanceField.out create mode 100644 test/langtools/tools/javac/warnings/Serial/InterfaceFields.java create mode 100644 test/langtools/tools/javac/warnings/Serial/InterfaceFields.out create mode 100644 test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.java create mode 100644 test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.out create mode 100644 test/langtools/tools/javac/warnings/Serial/RecordSerial.java create mode 100644 test/langtools/tools/javac/warnings/Serial/RecordSerial.out create mode 100644 test/langtools/tools/javac/warnings/Serial/SerialMethodArity.java create mode 100644 test/langtools/tools/javac/warnings/Serial/SerialMethodArity.out create mode 100644 test/langtools/tools/javac/warnings/Serial/SerialMethodMods.java create mode 100644 test/langtools/tools/javac/warnings/Serial/SerialMethodMods.out create mode 100644 test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.java create mode 100644 test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.out diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java index e7008a2bfdd..97240a45d6f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java @@ -224,6 +224,14 @@ public class Symtab { public final Type valueBasedType; public final Type valueBasedInternalType; + // For serialization lint checking + public final Type objectStreamFieldType; + public final Type objectInputStreamType; + public final Type objectOutputStreamType; + public final Type ioExceptionType; + public final Type objectStreamExceptionType; + public final Type externalizableType; + /** The symbol representing the length field of an array. */ public final VarSymbol lengthVar; @@ -590,6 +598,13 @@ public class Symtab { switchBootstrapsType = enterClass("java.lang.runtime.SwitchBootstraps"); valueBasedType = enterClass("jdk.internal.ValueBased"); valueBasedInternalType = enterSyntheticAnnotation("jdk.internal.ValueBased+Annotation"); + // For serialization lint checking + objectStreamFieldType = enterClass("java.io.ObjectStreamField"); + objectInputStreamType = enterClass("java.io.ObjectInputStream"); + objectOutputStreamType = enterClass("java.io.ObjectOutputStream"); + ioExceptionType = enterClass("java.io.IOException"); + objectStreamExceptionType = enterClass("java.io.ObjectStreamException"); + externalizableType = enterClass("java.io.Externalizable"); synthesizeEmptyInterfaceIfMissing(autoCloseableType); synthesizeEmptyInterfaceIfMissing(cloneableType); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index df50d2486a1..ddf7e7d63b1 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -2955,7 +2955,7 @@ public class Attr extends JCTree.Visitor { } if (resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK && - isSerializable(clazztype)) { + rs.isSerializable(clazztype)) { localEnv.info.isSerializable = true; } @@ -3080,7 +3080,7 @@ public class Attr extends JCTree.Visitor { boolean needsRecovery = resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK; try { - if (needsRecovery && isSerializable(pt())) { + if (needsRecovery && rs.isSerializable(pt())) { localEnv.info.isSerializable = true; localEnv.info.isSerializableLambda = true; } @@ -3581,7 +3581,7 @@ public class Attr extends JCTree.Visitor { boolean isTargetSerializable = resultInfo.checkContext.deferredAttrContext().mode == DeferredAttr.AttrMode.CHECK && - isSerializable(pt()); + rs.isSerializable(pt()); TargetInfo targetInfo = getTargetInfo(that, resultInfo, null); Type currentTarget = targetInfo.target; Type desc = targetInfo.descriptor; @@ -5366,7 +5366,7 @@ public class Attr extends JCTree.Visitor { log.error(env.tree.pos(), Errors.EnumTypesNotExtensible); } - if (isSerializable(c.type)) { + if (rs.isSerializable(c.type)) { env.info.isSerializable = true; } @@ -5501,12 +5501,12 @@ public class Attr extends JCTree.Visitor { // Check for cycles among annotation elements. chk.checkNonCyclicElements(tree); - // Check for proper use of serialVersionUID + // Check for proper use of serialVersionUID and other + // serialization-related fields and methods if (env.info.lint.isEnabled(LintCategory.SERIAL) - && isSerializable(c.type) - && (c.flags() & (Flags.ENUM | Flags.INTERFACE)) == 0 + && rs.isSerializable(c.type) && !c.isAnonymous()) { - checkSerialVersionUID(tree, c, env); + chk.checkSerialStructure(tree, c); } if (allowTypeAnnos) { // Correctly organize the positions of the type annotations @@ -5527,59 +5527,6 @@ public class Attr extends JCTree.Visitor { return null; } - /** check if a type is a subtype of Serializable, if that is available. */ - boolean isSerializable(Type t) { - try { - syms.serializableType.complete(); - } - catch (CompletionFailure e) { - return false; - } - return types.isSubtype(t, syms.serializableType); - } - - /** Check that an appropriate serialVersionUID member is defined. */ - private void checkSerialVersionUID(JCClassDecl tree, ClassSymbol c, Env env) { - - // check for presence of serialVersionUID - VarSymbol svuid = null; - for (Symbol sym : c.members().getSymbolsByName(names.serialVersionUID)) { - if (sym.kind == VAR) { - svuid = (VarSymbol)sym; - break; - } - } - - if (svuid == null) { - if (!c.isRecord()) - log.warning(LintCategory.SERIAL, tree.pos(), Warnings.MissingSVUID(c)); - return; - } - - // Check if @SuppressWarnings("serial") is an annotation of serialVersionUID. - // See JDK-8231622 for more information. - Lint lint = env.info.lint.augment(svuid); - if (lint.isSuppressed(LintCategory.SERIAL)) { - return; - } - - // check that it is static final - if ((svuid.flags() & (STATIC | FINAL)) != - (STATIC | FINAL)) - log.warning(LintCategory.SERIAL, - TreeInfo.diagnosticPositionFor(svuid, tree), Warnings.ImproperSVUID(c)); - - // check that it is long - else if (!svuid.type.hasTag(LONG)) - log.warning(LintCategory.SERIAL, - TreeInfo.diagnosticPositionFor(svuid, tree), Warnings.LongSVUID(c)); - - // check constant - else if (svuid.getConstValue() == null) - log.warning(LintCategory.SERIAL, - TreeInfo.diagnosticPositionFor(svuid, tree), Warnings.ConstantSVUID(c)); - } - private Type capture(Type type) { return types.capture(type); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java index 55fe5101f61..55f71a2b871 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java @@ -26,6 +26,7 @@ package com.sun.tools.javac.comp; import java.util.*; +import java.util.function.BiConsumer; import java.util.function.Predicate; import java.util.function.Supplier; @@ -71,6 +72,13 @@ import static com.sun.tools.javac.code.TypeTag.*; import static com.sun.tools.javac.code.TypeTag.WILDCARD; import static com.sun.tools.javac.tree.JCTree.Tag.*; +import javax.lang.model.element.Element; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.ElementFilter; +import javax.lang.model.util.ElementKindVisitor14; /** Type checking helper class for the attribution phase. * @@ -4342,4 +4350,693 @@ public class Check { wasNonEmptyFallThrough = c.stats.nonEmpty() && completesNormally; } } + + /** check if a type is a subtype of Externalizable, if that is available. */ + boolean isExternalizable(Type t) { + try { + syms.externalizableType.complete(); + } + catch (CompletionFailure e) { + return false; + } + return types.isSubtype(t, syms.externalizableType); + } + + /** + * Check structure of serialization declarations. + */ + public void checkSerialStructure(JCClassDecl tree, ClassSymbol c) { + (new SerialTypeVisitor()).visit(c, tree); + } + + /** + * This visitor will warn if a serialization-related field or + * method is declared in a suspicious or incorrect way. In + * particular, it will warn for cases where the runtime + * serialization mechanism will silently ignore a mis-declared + * entity. + * + * Distinguished serialization-related fields and methods: + * + * Methods: + * + * private void writeObject(ObjectOutputStream stream) throws IOException + * ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException + * + * private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException + * private void readObjectNoData() throws ObjectStreamException + * ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException + * + * Fields: + * + * private static final long serialVersionUID + * private static final ObjectStreamField[] serialPersistentFields + * + * Externalizable: methods defined on the interface + * public void writeExternal(ObjectOutput) throws IOException + * public void readExternal(ObjectInput) throws IOException + */ + private class SerialTypeVisitor extends ElementKindVisitor14 { + SerialTypeVisitor() { + this.lint = Check.this.lint; + } + + private static final Set serialMethodNames = + Set.of("writeObject", "writeReplace", + "readObject", "readObjectNoData", + "readResolve"); + + private static final Set serialFieldNames = + Set.of("serialVersionUID", "serialPersistentFields"); + + // Type of serialPersistentFields + private final Type OSF_TYPE = new Type.ArrayType(syms.objectStreamFieldType, syms.arrayClass); + + Lint lint; + + @Override + public Void defaultAction(Element e, JCClassDecl p) { + throw new IllegalArgumentException(Objects.requireNonNullElse(e.toString(), "")); + } + + @Override + public Void visitType(TypeElement e, JCClassDecl p) { + runUnderLint(e, p, (symbol, param) -> super.visitType(symbol, param)); + return null; + } + + @Override + public Void visitTypeAsClass(TypeElement e, + JCClassDecl p) { + // Anonymous classes filtered out by caller. + + ClassSymbol c = (ClassSymbol)e; + + checkCtorAccess(p, c); + + // Check for missing serialVersionUID; check *not* done + // for enums or records. + VarSymbol svuidSym = null; + for (Symbol sym : c.members().getSymbolsByName(names.serialVersionUID)) { + if (sym.kind == VAR) { + svuidSym = (VarSymbol)sym; + break; + } + } + + if (svuidSym == null) { + log.warning(LintCategory.SERIAL, p.pos(), Warnings.MissingSVUID(c)); + } + + // Check for serialPersistentFields to gate checks for + // non-serializable non-transient instance fields + boolean serialPersistentFieldsPresent = + c.members() + .getSymbolsByName(names.serialPersistentFields, sym -> sym.kind == VAR) + .iterator() + .hasNext(); + + // Check declarations of serialization-related methods and + // fields + for(Symbol el : c.getEnclosedElements()) { + runUnderLint(el, p, (enclosed, tree) -> { + String name = null; + switch(enclosed.getKind()) { + case FIELD -> { + if (!serialPersistentFieldsPresent) { + var flags = enclosed.flags(); + if ( ((flags & TRANSIENT) == 0) && + ((flags & STATIC) == 0)) { + Type varType = enclosed.asType(); + if (!canBeSerialized(varType)) { + // Note per JLS arrays are + // serializable even if the + // component type is not. + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(enclosed, tree), + Warnings.NonSerializableInstanceField); + } else if (varType.hasTag(ARRAY)) { + ArrayType arrayType = (ArrayType)varType; + Type elementType = arrayType.elemtype; + while (elementType.hasTag(ARRAY)) { + arrayType = (ArrayType)elementType; + elementType = arrayType.elemtype; + } + if (!canBeSerialized(elementType)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(enclosed, tree), + Warnings.NonSerializableInstanceFieldArray(elementType)); + } + } + } + } + + name = enclosed.getSimpleName().toString(); + if (serialFieldNames.contains(name)) { + VarSymbol field = (VarSymbol)enclosed; + switch (name) { + case "serialVersionUID" -> checkSerialVersionUID(tree, e, field); + case "serialPersistentFields" -> checkSerialPersistentFields(tree, e, field); + default -> throw new AssertionError(); + } + } + } + + // Correctly checking the serialization-related + // methods is subtle. For the methods declared to be + // private or directly declared in the class, the + // enclosed elements of the class can be checked in + // turn. However, writeReplace and readResolve can be + // declared in a superclass and inherited. Note that + // the runtime lookup walks the superclass chain + // looking for writeReplace/readResolve via + // Class.getDeclaredMethod. This differs from calling + // Elements.getAllMembers(TypeElement) as the latter + // will also pull in default methods from + // superinterfaces. In other words, the runtime checks + // (which long predate default methods on interfaces) + // do not admit the possibility of inheriting methods + // this way, a difference from general inheritance. + + // The current implementation just checks the enclosed + // elements and does not directly check the inherited + // methods. If all the types are being checked this is + // less of a concern; however, there are cases that + // could be missed. In particular, readResolve and + // writeReplace could, in principle, by inherited from + // a non-serializable superclass and thus not checked + // even if compiled with a serializable child class. + case METHOD -> { + var method = (MethodSymbol)enclosed; + name = method.getSimpleName().toString(); + if (serialMethodNames.contains(name)) { + switch (name) { + case "writeObject" -> checkWriteObject(tree, e, method); + case "writeReplace" -> checkWriteReplace(tree,e, method); + case "readObject" -> checkReadObject(tree,e, method); + case "readObjectNoData" -> checkReadObjectNoData(tree, e, method); + case "readResolve" -> checkReadResolve(tree, e, method); + default -> throw new AssertionError(); + } + } + } + } + }); + } + + return null; + } + + boolean canBeSerialized(Type type) { + return type.isPrimitive() || rs.isSerializable(type); + } + + /** + * Check that Externalizable class needs a public no-arg + * constructor. + * + * Check that a Serializable class has access to the no-arg + * constructor of its first nonserializable superclass. + */ + private void checkCtorAccess(JCClassDecl tree, ClassSymbol c) { + if (isExternalizable(c.type)) { + for(var sym : c.getEnclosedElements()) { + if (sym.isConstructor() && + ((sym.flags() & PUBLIC) == PUBLIC)) { + if (((MethodSymbol)sym).getParameters().isEmpty()) { + return; + } + } + } + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.ExternalizableMissingPublicNoArgCtor); + } else { + // Approximate access to the no-arg constructor up in + // the superclass chain by checking that the + // constructor is not private. This may not handle + // some cross-package situations correctly. + Type superClass = c.getSuperclass(); + // java.lang.Object is *not* Serializable so this loop + // should terminate. + while (rs.isSerializable(superClass) ) { + try { + superClass = (Type)((TypeElement)(((DeclaredType)superClass)).asElement()).getSuperclass(); + } catch(ClassCastException cce) { + return ; // Don't try to recover + } + } + // Non-Serializable super class + try { + ClassSymbol supertype = ((ClassSymbol)(((DeclaredType)superClass).asElement())); + for(var sym : supertype.getEnclosedElements()) { + if (sym.isConstructor()) { + MethodSymbol ctor = (MethodSymbol)sym; + if (ctor.getParameters().isEmpty()) { + if (((ctor.flags() & PRIVATE) == PRIVATE) || + // Handle nested classes and implicit this$0 + (supertype.getNestingKind() == NestingKind.MEMBER && + ((supertype.flags() & STATIC) == 0))) + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.SerializableMissingAccessNoArgCtor(supertype.getQualifiedName())); + } + } + } + } catch (ClassCastException cce) { + return ; // Don't try to recover + } + return; + } + } + + private void checkSerialVersionUID(JCClassDecl tree, Element e, VarSymbol svuid) { + // To be effective, serialVersionUID must be marked static + // and final, but private is recommended. But alas, in + // practice there are many non-private serialVersionUID + // fields. + if ((svuid.flags() & (STATIC | FINAL)) != + (STATIC | FINAL)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(svuid, tree), + Warnings.ImproperSVUID((Symbol)e)); + } + + // check svuid has type long + if (!svuid.type.hasTag(LONG)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(svuid, tree), + Warnings.LongSVUID((Symbol)e)); + } + + if (svuid.getConstValue() == null) + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(svuid, tree), + Warnings.ConstantSVUID((Symbol)e)); + } + + private void checkSerialPersistentFields(JCClassDecl tree, Element e, VarSymbol spf) { + // To be effective, serialPersisentFields must be private, static, and final. + if ((spf.flags() & (PRIVATE | STATIC | FINAL)) != + (PRIVATE | STATIC | FINAL)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(spf, tree), Warnings.ImproperSPF); + } + + if (!types.isSameType(spf.type, OSF_TYPE)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(spf, tree), Warnings.OSFArraySPF); + } + + if (isExternalizable((Type)(e.asType()))) { + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.IneffectualSerialFieldExternalizable); + } + + // Warn if serialPersistentFields is initialized to a + // literal null. + JCTree spfDecl = TreeInfo.declarationFor(spf, tree); + if (spfDecl != null && spfDecl.getTag() == VARDEF) { + JCVariableDecl variableDef = (JCVariableDecl) spfDecl; + JCExpression initExpr = variableDef.init; + if (initExpr != null && TreeInfo.isNull(initExpr)) { + log.warning(LintCategory.SERIAL, initExpr.pos(), + Warnings.SPFNullInit); + } + } + } + + private void checkWriteObject(JCClassDecl tree, Element e, MethodSymbol method) { + // The "synchronized" modifier is seen in the wild on + // readObject and writeObject methods and is generally + // innocuous. + + // private void writeObject(ObjectOutputStream stream) throws IOException + checkPrivateNonStaticMethod(tree, method); + checkReturnType(tree, e, method, syms.voidType); + checkOneArg(tree, e, method, syms.objectOutputStreamType); + checkExceptions(tree, e, method, syms.ioExceptionType); + checkExternalizable(tree, e, method); + } + + private void checkWriteReplace(JCClassDecl tree, Element e, MethodSymbol method) { + // ANY-ACCESS-MODIFIER Object writeReplace() throws + // ObjectStreamException + + // Excluding abstract, could have a more complicated + // rule based on abstract-ness of the class + checkConcreteInstanceMethod(tree, e, method); + checkReturnType(tree, e, method, syms.objectType); + checkNoArgs(tree, e, method); + checkExceptions(tree, e, method, syms.objectStreamExceptionType); + } + + private void checkReadObject(JCClassDecl tree, Element e, MethodSymbol method) { + // The "synchronized" modifier is seen in the wild on + // readObject and writeObject methods and is generally + // innocuous. + + // private void readObject(ObjectInputStream stream) + // throws IOException, ClassNotFoundException + checkPrivateNonStaticMethod(tree, method); + checkReturnType(tree, e, method, syms.voidType); + checkOneArg(tree, e, method, syms.objectInputStreamType); + checkExceptions(tree, e, method, syms.ioExceptionType, syms.classNotFoundExceptionType); + checkExternalizable(tree, e, method); + } + + private void checkReadObjectNoData(JCClassDecl tree, Element e, MethodSymbol method) { + // private void readObjectNoData() throws ObjectStreamException + checkPrivateNonStaticMethod(tree, method); + checkReturnType(tree, e, method, syms.voidType); + checkNoArgs(tree, e, method); + checkExceptions(tree, e, method, syms.objectStreamExceptionType); + checkExternalizable(tree, e, method); + } + + private void checkReadResolve(JCClassDecl tree, Element e, MethodSymbol method) { + // ANY-ACCESS-MODIFIER Object readResolve() + // throws ObjectStreamException + + // Excluding abstract, could have a more complicated + // rule based on abstract-ness of the class + checkConcreteInstanceMethod(tree, e, method); + checkReturnType(tree,e, method, syms.objectType); + checkNoArgs(tree, e, method); + checkExceptions(tree, e, method, syms.objectStreamExceptionType); + } + + void checkPrivateNonStaticMethod(JCClassDecl tree, MethodSymbol method) { + var flags = method.flags(); + if ((flags & PRIVATE) == 0) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialMethodNotPrivate(method.getSimpleName())); + } + + if ((flags & STATIC) != 0) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialMethodStatic(method.getSimpleName())); + } + } + + /** + * Per section 1.12 "Serialization of Enum Constants" of + * the serialization specification, due to the special + * serialization handling of enums, any writeObject, + * readObject, writeReplace, and readResolve methods are + * ignored as are serialPersistentFields and + * serialVersionUID fields. + */ + @Override + public Void visitTypeAsEnum(TypeElement e, + JCClassDecl p) { + for(Element el : e.getEnclosedElements()) { + runUnderLint(el, p, (enclosed, tree) -> { + String name = enclosed.getSimpleName().toString(); + switch(enclosed.getKind()) { + case FIELD -> { + if (serialFieldNames.contains(name)) { + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.IneffectualSerialFieldEnum(name)); + } + } + + case METHOD -> { + if (serialMethodNames.contains(name)) { + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.IneffectualSerialMethodEnum(name)); + } + } + } + }); + } + return null; + } + + /** + * Most serialization-related fields and methods on interfaces + * are ineffectual or problematic. + */ + @Override + public Void visitTypeAsInterface(TypeElement e, + JCClassDecl p) { + for(Element el : e.getEnclosedElements()) { + runUnderLint(el, p, (enclosed, tree) -> { + String name = null; + switch(enclosed.getKind()) { + case FIELD -> { + var field = (VarSymbol)enclosed; + name = field.getSimpleName().toString(); + switch(name) { + case "serialPersistentFields" -> { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(field, tree), + Warnings.IneffectualSerialFieldInterface); + } + + case "serialVersionUID" -> { + checkSerialVersionUID(tree, e, field); + } + } + } + + case METHOD -> { + var method = (MethodSymbol)enclosed; + name = enclosed.getSimpleName().toString(); + if (serialMethodNames.contains(name)) { + switch (name) { + case + "readObject", + "readObjectNoData", + "writeObject" -> checkPrivateMethod(tree, e, method); + + case + "writeReplace", + "readResolve" -> checkDefaultIneffective(tree, e, method); + + default -> throw new AssertionError(); + } + + } + } + } + }); + } + + return null; + } + + private void checkPrivateMethod(JCClassDecl tree, + Element e, + MethodSymbol method) { + if ((method.flags() & PRIVATE) == 0) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.NonPrivateMethodWeakerAccess); + } + } + + private void checkDefaultIneffective(JCClassDecl tree, + Element e, + MethodSymbol method) { + if ((method.flags() & DEFAULT) == DEFAULT) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.DefaultIneffective); + + } + } + + @Override + public Void visitTypeAsAnnotationType(TypeElement e, + JCClassDecl p) { + // Per the JLS, annotation types are not serializeable + return null; + } + + /** + * From the Java Object Serialization Specification, 1.13 + * Serialization of Records: + * + * "The process by which record objects are serialized or + * externalized cannot be customized; any class-specific + * writeObject, readObject, readObjectNoData, writeExternal, + * and readExternal methods defined by record classes are + * ignored during serialization and deserialization. However, + * a substitute object to be serialized or a designate + * replacement may be specified, by the writeReplace and + * readResolve methods, respectively. Any + * serialPersistentFields field declaration is + * ignored. Documenting serializable fields and data for + * record classes is unnecessary, since there is no variation + * in the serial form, other than whether a substitute or + * replacement object is used. The serialVersionUID of a + * record class is 0L unless explicitly declared. The + * requirement for matching serialVersionUID values is waived + * for record classes." + */ + @Override + public Void visitTypeAsRecord(TypeElement e, + JCClassDecl p) { + for(Element el : e.getEnclosedElements()) { + runUnderLint(el, p, (enclosed, tree) -> { + String name = enclosed.getSimpleName().toString(); + switch(enclosed.getKind()) { + case FIELD -> { + switch(name) { + case "serialPersistentFields" -> { + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.IneffectualSerialFieldRecord); + } + + case "serialVersionUID" -> { + // Could generate additional warning that + // svuid value is not checked to match for + // records. + checkSerialVersionUID(tree, e, (VarSymbol)enclosed); + } + + } + } + + case METHOD -> { + var method = (MethodSymbol)enclosed; + switch(name) { + case "writeReplace" -> checkWriteReplace(tree, e, method); + case "readResolve" -> checkReadResolve(tree, e, method); + default -> { + if (serialMethodNames.contains(name)) { + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.IneffectualSerialMethodRecord(name)); + } + } + } + + } + } + }); + } + return null; + } + + void checkConcreteInstanceMethod(JCClassDecl tree, + Element enclosing, + MethodSymbol method) { + if ((method.flags() & (STATIC | ABSTRACT)) != 0) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialConcreteInstanceMethod(method.getSimpleName())); + } + } + + private void checkReturnType(JCClassDecl tree, + Element enclosing, + MethodSymbol method, + Type expectedReturnType) { + // Note: there may be complications checking writeReplace + // and readResolve since they return Object and could, in + // principle, have covariant overrides and any synthetic + // bridge method would not be represented here for + // checking. + Type rtype = method.getReturnType(); + if (!types.isSameType(expectedReturnType, rtype)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialMethodUnexpectedReturnType(method.getSimpleName(), + rtype, expectedReturnType)); + } + } + + private void checkOneArg(JCClassDecl tree, + Element enclosing, + MethodSymbol method, + Type expectedType) { + String name = method.getSimpleName().toString(); + + var parameters= method.getParameters(); + + if (parameters.size() != 1) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialMethodOneArg(method.getSimpleName(), parameters.size())); + return; + } + + Type parameterType = parameters.get(0).asType(); + if (!types.isSameType(parameterType, expectedType)) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialMethodParameterType(method.getSimpleName(), + expectedType, + parameterType)); + } + } + + private void checkNoArgs(JCClassDecl tree, Element enclosing, MethodSymbol method) { + var parameters = method.getParameters(); + if (!parameters.isEmpty()) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(parameters.get(0), tree), + Warnings.SerialMethodNoArgs(method.getSimpleName())); + } + } + + private void checkExternalizable(JCClassDecl tree, Element enclosing, MethodSymbol method) { + // If the enclosing class is externalizable, warn for the method + if (isExternalizable((Type)enclosing.asType())) { + log.warning(LintCategory.SERIAL, tree.pos(), + Warnings.IneffectualSerialMethodExternalizable(method.getSimpleName())); + } + return; + } + + private void checkExceptions(JCClassDecl tree, + Element enclosing, + MethodSymbol method, + Type... declaredExceptions) { + for (Type thrownType: method.getThrownTypes()) { + // For each exception in the throws clause of the + // method, if not an Error and not a RuntimeException, + // check if the exception is a subtype of a declared + // exception from the throws clause of the + // serialization method in question. + if (types.isSubtype(thrownType, syms.runtimeExceptionType) || + types.isSubtype(thrownType, syms.errorType) ) { + continue; + } else { + boolean declared = false; + for (Type declaredException : declaredExceptions) { + if (types.isSubtype(thrownType, declaredException)) { + declared = true; + continue; + } + } + if (!declared) { + log.warning(LintCategory.SERIAL, + TreeInfo.diagnosticPositionFor(method, tree), + Warnings.SerialMethodUnexpectedException(method.getSimpleName(), + thrownType)); + } + } + } + return; + } + + private Void runUnderLint(E symbol, JCClassDecl p, BiConsumer task) { + Lint prevLint = lint; + try { + lint = lint.augment((Symbol) symbol); + + if (lint.isEnabled(LintCategory.SERIAL)) { + task.accept(symbol, p); + } + + return null; + } finally { + lint = prevLint; + } + } + + } + } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java index a9d47bf7ca7..1ba0ace43b4 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java @@ -3908,6 +3908,17 @@ public class Resolve { } } + /** check if a type is a subtype of Serializable, if that is available.*/ + boolean isSerializable(Type t) { + try { + syms.serializableType.complete(); + } + catch (CompletionFailure e) { + return false; + } + return types.isSubtype(t, syms.serializableType); + } + /** * Root class for resolution errors. Subclass of ResolveError * represent a different kinds of resolution error - as such they must diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index 2d61c4305d0..65ba0e6aed7 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -1846,6 +1846,14 @@ compiler.warn.illegal.char.for.encoding=\ compiler.warn.improper.SVUID=\ serialVersionUID must be declared static final in class {0} +compiler.warn.improper.SPF=\ + serialPersistentFields must be declared private static final to be effective + +compiler.warn.SPF.null.init=\ + serialPersistentFields ineffective if initialized to null.\n\ + Initialize to an empty array to indicate no fields + + # 0: type, 1: type compiler.warn.inexact.non-varargs.call=\ non-varargs call of varargs method with inexact argument type for last parameter;\n\ @@ -1866,10 +1874,92 @@ compiler.warn.unreachable.catch.1=\ compiler.warn.long.SVUID=\ serialVersionUID must be of type long in class {0} +compiler.warn.OSF.array.SPF=\ + serialPersistentFields must be of type java.io.ObjectStreamField[] to be effective + # 0: symbol compiler.warn.missing.SVUID=\ serializable class {0} has no definition of serialVersionUID +# 0: name +compiler.warn.serializable.missing.access.no.arg.ctor=\ + cannot access a no-arg constructor in first non-serializable superclass {0} + +# 0: name +compiler.warn.serial.method.not.private=\ + serialization-related method {0} not declared private + +# 0: name +compiler.warn.serial.concrete.instance.method=\ + serialization-related method {0} must be a concrete instance method to be effective, neither abstract nor static + +# 0: name +compiler.warn.serial.method.static=\ + serialization-related method {0} declared static; must instead be an instance method to be effective + +# 0: name +compiler.warn.serial.method.no.args=\ + to be effective serialization-related method {0} must have no parameters + +# 0: name, 1: number +compiler.warn.serial.method.one.arg=\ + to be effective serialization-related method {0} must have exactly one parameter rather than {1} parameters + +# 0: name, 1: type, 2: type +compiler.warn.serial.method.parameter.type=\ + sole parameter of serialization-related method {0} must have type {1} to be effective rather than type {2} + +# 0: name, 1: type, 2: type +compiler.warn.serial.method.unexpected.return.type=\ + serialization-related method {0} declared with a return type of {1} rather than expected type {2}.\n\ + As declared, the method will be ineffective for serialization + +# 0: name, 1: type +compiler.warn.serial.method.unexpected.exception=\ + serialization-related method {0} declared to throw an unexpected type {1} + +compiler.warn.ineffectual.serial.field.interface=\ + serialPersistentFields is not effective in an interface + +# 0: string +compiler.warn.ineffectual.serial.field.enum=\ + serialization-related field {0} is not effective in an enum class + +# 0: string +compiler.warn.ineffectual.serial.method.enum=\ + serialization-related method {0} is not effective in an enum class + +compiler.warn.ineffectual.serial.field.record=\ + serialPersistentFields is not effective in a record class + +# 0: string +compiler.warn.ineffectual.serial.method.record=\ + serialization-related method {0} is not effective in a record class + +# 0: name +compiler.warn.ineffectual.serial.method.externalizable=\ + serialization-related method {0} is not effective in an Externalizable class + +compiler.warn.ineffectual.serial.field.externalizable=\ + serialPersistentFields is not effective in an Externalizable class + +compiler.warn.externalizable.missing.public.no.arg.ctor=\ + an Externalizable class needs a public no-arg constructor + +compiler.warn.non.serializable.instance.field=\ + non-transient instance field of a serializable class declared with a non-serializable type + +# 0: type +compiler.warn.non.serializable.instance.field.array=\ + non-transient instance field of a serializable class declared with an array having a non-serializable base component type {0} + +compiler.warn.non.private.method.weaker.access=\ + serialization-related method declared non-private in an interface will prevent\n\ + classes implementing the interface from declaring the method as private + +compiler.warn.default.ineffective=\ + serialization-related default method from an interface will not be run by serialization for an implementing class + # 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.warn.potentially.ambiguous.overload=\ {0} in {1} is potentially ambiguous with {2} in {3} diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties index 3768f6f0482..c2ef4941ccd 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties @@ -240,8 +240,8 @@ javac.opt.Xlint.desc.requires-transitive-automatic=\ Warn about automatic modules in requires transitive. javac.opt.Xlint.desc.serial=\ - Warn about Serializable classes that do not provide a serial version ID. \n\ -\ Also warn about access to non-public members from a serializable element. + Warn about Serializable classes that do not have a serialVersionUID field. \n\ +\ Also warn about other suspect declarations in Serializable and Externalizable classes and interfaces. javac.opt.Xlint.desc.static=\ Warn about accessing a static member using an instance. diff --git a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionException.java b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionException.java index 96cc928ad6b..9c0af16a1ac 100644 --- a/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionException.java +++ b/src/jdk.internal.opt/share/classes/jdk/internal/joptsimple/OptionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -76,6 +76,7 @@ import static jdk.internal.joptsimple.internal.Messages.*; public abstract class OptionException extends RuntimeException { private static final long serialVersionUID = -1L; + @SuppressWarnings("serial") // Type of field is not Serializable private final List options = new ArrayList<>(); protected OptionException( List options ) { diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java index 634ec515301..6403c954856 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -100,6 +100,7 @@ public class ConstantPool { return "value not found: " + value; } + @SuppressWarnings("serial") // Type of field is not Serializable public final Object value; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/InternalError.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/InternalError.java index 4bc02e881bb..cd399dfca31 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/InternalError.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/InternalError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -43,5 +43,6 @@ public class InternalError extends Error { this.args = args; } + @SuppressWarnings("serial") // Array component type is not Serializable public final Object[] args; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java index a759bac49a9..8cd6ef6e299 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -93,6 +93,7 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { } final String key; + @SuppressWarnings("serial") // Array component type is not Serializable final Object[] args; boolean showUsage; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java index cd2dc1e3ca2..3effa227e35 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -63,6 +63,7 @@ class JdepsTask { return this; } final String key; + @SuppressWarnings("serial") // Array component type is not Serializable final Object[] args; boolean showUsage; diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java index 65fce011a58..0341923f926 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -34,6 +34,7 @@ package com.sun.tools.jdeps; class MultiReleaseException extends RuntimeException { private static final long serialVersionUID = 4474870142461654108L; private final String key; + @SuppressWarnings("serial") // Array component type is not Serializable private final Object[] params; /** diff --git a/test/langtools/tools/javac/diags/examples/ImproperSPF.java b/test/langtools/tools/javac/diags/examples/ImproperSPF.java new file mode 100644 index 00000000000..6cb2f7c5b7c --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/ImproperSPF.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.improper.SPF +// key: compiler.warn.OSF.array.SPF +// key: compiler.warn.SPF.null.init + +// options: -Xlint:serial + +import java.io.Serializable; + +class ImproperSPF implements Serializable { + // Proper declaration of serialPersistentFields is: + // private static final ObjectStreamField[] serialPersistentFields = ... + public /*instance*/ Object serialPersistentFields = null; + + private static final long serialVersionUID = 42; +} diff --git a/test/langtools/tools/javac/diags/examples/ImproperSVUID.java b/test/langtools/tools/javac/diags/examples/ImproperSVUID.java index 9b56061930c..409d8f70c22 100644 --- a/test/langtools/tools/javac/diags/examples/ImproperSVUID.java +++ b/test/langtools/tools/javac/diags/examples/ImproperSVUID.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, 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 @@ -22,6 +22,9 @@ */ // key: compiler.warn.improper.SVUID +// key: compiler.warn.constant.SVUID +// key: compiler.warn.long.SVUID + // options: -Xlint:serial import java.io.Serializable; diff --git a/test/langtools/tools/javac/diags/examples/IneffectualSerialEnum.java b/test/langtools/tools/javac/diags/examples/IneffectualSerialEnum.java new file mode 100644 index 00000000000..0a29dee0099 --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/IneffectualSerialEnum.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.ineffectual.serial.field.enum +// key: compiler.warn.ineffectual.serial.method.enum + +// options: -Xlint:serial + +import java.io.*; + +enum IneffectualSerialEnum implements Serializable { + INSTANCE; + + // The serialVersionUID field is ineffectual for enum classes. + private static final long serialVersionUID = 42; + + // The readObject method is ineffectual for enum classes. + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + return; + } +} diff --git a/test/langtools/tools/javac/diags/examples/IneffectualSerialExtern.java b/test/langtools/tools/javac/diags/examples/IneffectualSerialExtern.java new file mode 100644 index 00000000000..ff51cdf602d --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/IneffectualSerialExtern.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.ineffectual.serial.method.externalizable +// key: compiler.warn.ineffectual.serial.field.externalizable +// key: compiler.warn.externalizable.missing.public.no.arg.ctor + +// options: -Xlint:serial + +import java.io.*; + +class IneffectualSerialExtern implements Externalizable { + private static final long serialVersionUID = 42; + + // Must have a public no-arg constructor + public IneffectualSerialExtern(int foo) {} + + public void writeExternal(ObjectOutput out) throws IOException { + return; + } + + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + return; + } + + // ineffectual + private static final ObjectStreamField[] serialPersistentFields = {}; + + // The readObject method is ineffectual for Externalizable classes. + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + return; + } +} diff --git a/test/langtools/tools/javac/diags/examples/IneffectualSerialRecord.java b/test/langtools/tools/javac/diags/examples/IneffectualSerialRecord.java new file mode 100644 index 00000000000..8586c5cac3c --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/IneffectualSerialRecord.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.ineffectual.serial.field.record +// key: compiler.warn.ineffectual.serial.method.record + +// options: -Xlint:serial + +import java.io.*; + +record IneffectualSerialRecord(int foo) implements Serializable { + + // A serialPersistentFields is ineffectual for enum classes. + private static final ObjectStreamField[] serialPersistentFields = {}; + + // The readObject method is ineffectual for record classes. + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + return; + } +} diff --git a/test/langtools/tools/javac/diags/examples/SerialInterfaceMethodsAndFields.java b/test/langtools/tools/javac/diags/examples/SerialInterfaceMethodsAndFields.java new file mode 100644 index 00000000000..23d235a41ec --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/SerialInterfaceMethodsAndFields.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.non.private.method.weaker.access +// key: compiler.warn.default.ineffective +// key: compiler.warn.ineffectual.serial.field.interface + +// options: -Xlint:serial + +import java.io.*; + +interface SerialInterfaceMethodsAndFields extends Serializable { + public static final ObjectStreamField[] serialPersistentFields = {}; + public void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException; + public void readObjectNoData() throws ObjectStreamException; + public void writeObject(ObjectOutputStream stream) throws IOException; + + default public Object readResolve() throws ObjectStreamException { + return null; + } +} diff --git a/test/langtools/tools/javac/diags/examples/SerialMissingNoArgCtor.java b/test/langtools/tools/javac/diags/examples/SerialMissingNoArgCtor.java new file mode 100644 index 00000000000..0bb028a69a6 --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/SerialMissingNoArgCtor.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.serializable.missing.access.no.arg.ctor +// key: compiler.warn.non.serializable.instance.field +// key: compiler.warn.non.serializable.instance.field.array + +// options: -Xlint:serial + +import java.io.*; + +class SerialMissingNoArgCtor { + public SerialMissingNoArgCtor(int foo) { + } + + // Not accessible to SerialSubclass + private SerialMissingNoArgCtor() {} + + // SerialSubclass does not have access to a non-arg ctor in the + // first non-serializable superclass in its superclass chain. + static class SerialSubclass extends SerialMissingNoArgCtor + implements Serializable { + + private static final long serialVersionUID = 42; + + // non-serializable non-transient instance field + private Object datum = null; + + // base component type of array is non-serializable + private Object[] data = null; + + public SerialSubclass() { + super(1); + } + } +} diff --git a/test/langtools/tools/javac/diags/examples/SerialNonPrivateMethod.java b/test/langtools/tools/javac/diags/examples/SerialNonPrivateMethod.java new file mode 100644 index 00000000000..45f3273117b --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/SerialNonPrivateMethod.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021, 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. + */ + +// key: compiler.warn.serial.method.not.private +// key: compiler.warn.serial.method.static +// key: compiler.warn.serial.method.unexpected.return.type +// key: compiler.warn.serial.concrete.instance.method +// key: compiler.warn.serial.method.one.arg +// key: compiler.warn.serial.method.parameter.type +// key: compiler.warn.serial.method.no.args +// key: compiler.warn.serial.method.unexpected.exception + +// options: -Xlint:serial + +import java.io.*; + + +abstract class SerialNonPrivateMethod implements Serializable { + private static final long serialVersionUID = 42; + + private static class CustomObjectOutputStream extends ObjectOutputStream { + public CustomObjectOutputStream() throws IOException, + SecurityException {} + } + + // Should be private and have a single argument of type + // ObjectOutputStream + void writeObject(CustomObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + // Should be private non-static and have one argument + private static void readObject(ObjectInputStream stream, int retries) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + // Should return void + private int readObjectNoData() throws ObjectStreamException { + return 42; + } + + // Should be concrete instance method + public abstract Object writeReplace() throws ObjectStreamException; + + // Should have no arguments and throw ObjectStreamException + /*package*/ Object readResolve(int foo) + throws ReflectiveOperationException { // Checked exception + return null; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/CtorAccess.java b/test/langtools/tools/javac/warnings/Serial/CtorAccess.java new file mode 100644 index 00000000000..34de2ffad2f --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/CtorAccess.java @@ -0,0 +1,37 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=CtorAccess.out -XDrawDiagnostics -Xlint:serial CtorAccess.java + */ + +import java.io.*; + +class CtorAccess { + public CtorAccess(int i) {} + + // Cannot by accessed by SerialSubclass + private CtorAccess(){} + + static class SerialSubclass + extends CtorAccess + implements Serializable { + private static final long serialVersionUID = 42; + SerialSubclass() { + super(42); + } + } + + // *not* static + class MemberSuper { + // Implicit this$0 argument + public MemberSuper() {} + } + + class SerialMemberSub + extends MemberSuper + implements Serializable { + + SerialMemberSub(){super();} + private static final long serialVersionUID = 42; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/CtorAccess.out b/test/langtools/tools/javac/warnings/Serial/CtorAccess.out new file mode 100644 index 00000000000..55eca8bd2df --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/CtorAccess.out @@ -0,0 +1,3 @@ +CtorAccess.java:15:12: compiler.warn.serializable.missing.access.no.arg.ctor: CtorAccess +CtorAccess.java:30:5: compiler.warn.serializable.missing.access.no.arg.ctor: CtorAccess.MemberSuper +2 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.java b/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.java new file mode 100644 index 00000000000..78b41e1caee --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.java @@ -0,0 +1,33 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=DeepNestingSuppression.out -XDrawDiagnostics -Xlint:serial DeepNestingSuppression.java + */ + +import java.io.Serializable; + +/* + * Verify suppressing serial warnings works through several levels of + * nested types. + */ +class DeepNestingSuppression { + + @SuppressWarnings("serial") + static class SuppressedOuter { + static class Intermediate { + static class Inner implements Serializable { + // warning for int rather than long svuid + private static final int serialVersionUID = 42; + } + } + } + + static class Outer { + static class Intermediate { + static class Inner implements Serializable { + // warning for int rather than long svuid + private static final int serialVersionUID = 42; + } + } + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.out b/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.out new file mode 100644 index 00000000000..98b76fc4177 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/DeepNestingSuppression.out @@ -0,0 +1,2 @@ +DeepNestingSuppression.java:29:42: compiler.warn.long.SVUID: DeepNestingSuppression.Outer.Intermediate.Inner +1 warning diff --git a/test/langtools/tools/javac/warnings/Serial/EnumSerial.java b/test/langtools/tools/javac/warnings/Serial/EnumSerial.java new file mode 100644 index 00000000000..1455b4adea0 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/EnumSerial.java @@ -0,0 +1,38 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=EnumSerial.out -XDrawDiagnostics -Xlint:serial EnumSerial.java + */ + +import java.io.*; + +enum EnumSerial implements Serializable { + INSTANCE; + + // Verify a warning is generated in an enum class for each of the + // distinguished serial fields and methods. + + private static final long serialVersionUID = 42; + private static final ObjectStreamField[] serialPersistentFields = {}; + + private void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + private Object writeReplace() throws ObjectStreamException { + return null; + } + + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + private void readObjectNoData() throws ObjectStreamException { + return; + } + + private Object readResolve() throws ObjectStreamException { + return null; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/EnumSerial.out b/test/langtools/tools/javac/warnings/Serial/EnumSerial.out new file mode 100644 index 00000000000..4e52d9fa227 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/EnumSerial.out @@ -0,0 +1,8 @@ +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.field.enum: serialVersionUID +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.field.enum: serialPersistentFields +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.method.enum: writeObject +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.method.enum: writeReplace +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.method.enum: readObject +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.method.enum: readObjectNoData +EnumSerial.java:9:1: compiler.warn.ineffectual.serial.method.enum: readResolve +7 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/Extern.java b/test/langtools/tools/javac/warnings/Serial/Extern.java new file mode 100644 index 00000000000..db2bd386e4c --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/Extern.java @@ -0,0 +1,51 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=Extern.out -XDrawDiagnostics -Xlint:serial Extern.java + */ + +import java.io.*; + +class Extern implements Externalizable { + private static final long serialVersionUID = 42; + + // No-arg constructor on an Externalizable class must be public + protected Extern() {} + + // ineffectual + private static final ObjectStreamField[] serialPersistentFields = {}; + + public void writeExternal(ObjectOutput out) throws IOException { + return; + } + + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + return; + } + + // ineffectual + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + // ineffectual + private void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + // ineffectual + private void readObjectNoData() throws ObjectStreamException { + return; + } + + // (possibly) effective + private Object writeReplace() throws ObjectStreamException { + return null; + } + + // (possibly) effective + private Object readResolve() throws ObjectStreamException { + return null; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/Extern.out b/test/langtools/tools/javac/warnings/Serial/Extern.out new file mode 100644 index 00000000000..b810f4b8a48 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/Extern.out @@ -0,0 +1,6 @@ +Extern.java:9:1: compiler.warn.externalizable.missing.public.no.arg.ctor +Extern.java:9:1: compiler.warn.ineffectual.serial.field.externalizable +Extern.java:9:1: compiler.warn.ineffectual.serial.method.externalizable: readObject +Extern.java:9:1: compiler.warn.ineffectual.serial.method.externalizable: writeObject +Extern.java:9:1: compiler.warn.ineffectual.serial.method.externalizable: readObjectNoData +5 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.java b/test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.java new file mode 100644 index 00000000000..94a45388381 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.java @@ -0,0 +1,46 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=ImproperReturnTypes.out -XDrawDiagnostics -Xlint:serial ImproperReturnTypes.java + */ + +import java.io.*; + +class ImproperReturnTypes implements Serializable { + private static final long serialVersionUID = 42; + + /* + * Serialization-related methods return either void or Object: + * + * private void writeObject(ObjectOutputStream stream) throws IOException + * ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException + * + * private void readObject(ObjectInputStream stream) + * throws IOException, ClassNotFoundException + * private void readObjectNoData() throws ObjectStreamException + * ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException + */ + + private int writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + return 0; + } + + private int writeReplace() throws ObjectStreamException { + return 1; + } + + private int readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + return 2; + } + + private int readObjectNoData() throws ObjectStreamException { + return 3; + } + + private int readResolve() throws ObjectStreamException { + return 4; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.out b/test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.out new file mode 100644 index 00000000000..df5c0456d47 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/ImproperReturnTypes.out @@ -0,0 +1,6 @@ +ImproperReturnTypes.java:24:17: compiler.warn.serial.method.unexpected.return.type: writeObject, int, void +ImproperReturnTypes.java:29:17: compiler.warn.serial.method.unexpected.return.type: writeReplace, int, java.lang.Object +ImproperReturnTypes.java:33:17: compiler.warn.serial.method.unexpected.return.type: readObject, int, void +ImproperReturnTypes.java:39:17: compiler.warn.serial.method.unexpected.return.type: readObjectNoData, int, void +ImproperReturnTypes.java:43:17: compiler.warn.serial.method.unexpected.return.type: readResolve, int, java.lang.Object +5 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.java b/test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.java new file mode 100644 index 00000000000..2665ac4fd76 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.java @@ -0,0 +1,37 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=ImproperSerialPF.out -XDrawDiagnostics -Xlint:serial ImproperSerialPF.java + */ + +import java.io.*; + +class ImproperSerialPF implements Serializable { + // Proper declaration of serialPersistentFields is: + // private static final ObjectStreamField[] serialPersistentFields = ... + public /*instance*/ Object serialPersistentFields = Boolean.TRUE; + + private static final long serialVersionUID = 42; + + static class LiteralNullSPF implements Serializable { + private static final ObjectStreamField[] serialPersistentFields = null; + + private static final long serialVersionUID = 42; + } + + // Casting obscures the simple syntactic null-check + static class CastedNullSPF implements Serializable { + private static final ObjectStreamField[] serialPersistentFields = + (ObjectStreamField[])null; + + private static final long serialVersionUID = 42; + } + + // Conditional obscures the simple syntactic null-check too + static class ConditionalNullSPF implements Serializable { + private static final ObjectStreamField[] serialPersistentFields = + (true ? null : null); + + private static final long serialVersionUID = 42; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.out b/test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.out new file mode 100644 index 00000000000..8340471b6b0 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/ImproperSerialPF.out @@ -0,0 +1,4 @@ +ImproperSerialPF.java:17:75: compiler.warn.SPF.null.init +ImproperSerialPF.java:12:32: compiler.warn.improper.SPF +ImproperSerialPF.java:12:32: compiler.warn.OSF.array.SPF +3 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/InstanceField.java b/test/langtools/tools/javac/warnings/Serial/InstanceField.java new file mode 100644 index 00000000000..f1d03aad061 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/InstanceField.java @@ -0,0 +1,40 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=InstanceField.out -XDrawDiagnostics -Xlint:serial InstanceField.java + */ + +import java.io.*; + +class IntanceField implements Serializable { + private static final long serialVersionUID = 42; + + // Non-transient instance fields in a serializable class w/o + // serialPersistentFields defined should get warnings if the type + // of the field cannot be serialized. + + private Object foo; + + private Object[] foos; + + private Thread[][] ArrayOfArrayOfThreads; + + // No warnings + + private static Object bar; + + private static Object[] bars; + + private int baz; + + private double[] quux; + + static class NestedInstance implements Serializable { + private static final long serialVersionUID = 24; + + // Should disable instance field warnings + private static final ObjectStreamField[] serialPersistentFields = {}; + + private Object foo; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/InstanceField.out b/test/langtools/tools/javac/warnings/Serial/InstanceField.out new file mode 100644 index 00000000000..ea829609938 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/InstanceField.out @@ -0,0 +1,4 @@ +InstanceField.java:16:20: compiler.warn.non.serializable.instance.field +InstanceField.java:18:22: compiler.warn.non.serializable.instance.field.array: java.lang.Object +InstanceField.java:20:24: compiler.warn.non.serializable.instance.field.array: java.lang.Thread +3 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/InterfaceFields.java b/test/langtools/tools/javac/warnings/Serial/InterfaceFields.java new file mode 100644 index 00000000000..90892be5da7 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/InterfaceFields.java @@ -0,0 +1,14 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=InterfaceFields.out -XDrawDiagnostics -Xlint:serial InterfaceFields.java + */ + +import java.io.*; + +interface InterfaceFields extends Serializable { + public static final int serialVersionUID = 12345; + + public static final ObjectStreamField[] serialPersistentFields = {}; +} + diff --git a/test/langtools/tools/javac/warnings/Serial/InterfaceFields.out b/test/langtools/tools/javac/warnings/Serial/InterfaceFields.out new file mode 100644 index 00000000000..f359ac34f21 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/InterfaceFields.out @@ -0,0 +1,3 @@ +InterfaceFields.java:10:29: compiler.warn.long.SVUID: InterfaceFields +InterfaceFields.java:12:45: compiler.warn.ineffectual.serial.field.interface +2 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.java b/test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.java new file mode 100644 index 00000000000..30b6c6e8d15 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.java @@ -0,0 +1,43 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=InterfaceNonPrivateMethods.out -XDrawDiagnostics -Xlint:serial InterfaceNonPrivateMethods.java + */ + +import java.io.*; + +// Holder class +class InterfaceNonPrivateMethods { + + interface NonPrivateMethods extends Serializable { + public void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException; + public void readObjectNoData() throws ObjectStreamException; + public void writeObject(ObjectOutputStream stream) throws IOException; + + // Ineffective default methods; serialization only looks up + // superclass chain + public default Object writeReplace() throws ObjectStreamException { + return null; + } + public default Object readResolve() throws ObjectStreamException { + return null; + } + } + + interface NonPrivateMethodsDefaults extends Serializable { + default public void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + return; + } + default public void readObjectNoData() + throws ObjectStreamException { + return; + } + default public void writeObject(ObjectOutputStream stream) + throws IOException { + return; + } + } +} + diff --git a/test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.out b/test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.out new file mode 100644 index 00000000000..53dcbeae22a --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/InterfaceNonPrivateMethods.out @@ -0,0 +1,9 @@ +InterfaceNonPrivateMethods.java:13:21: compiler.warn.non.private.method.weaker.access +InterfaceNonPrivateMethods.java:15:21: compiler.warn.non.private.method.weaker.access +InterfaceNonPrivateMethods.java:16:21: compiler.warn.non.private.method.weaker.access +InterfaceNonPrivateMethods.java:20:31: compiler.warn.default.ineffective +InterfaceNonPrivateMethods.java:23:31: compiler.warn.default.ineffective +InterfaceNonPrivateMethods.java:29:29: compiler.warn.non.private.method.weaker.access +InterfaceNonPrivateMethods.java:33:29: compiler.warn.non.private.method.weaker.access +InterfaceNonPrivateMethods.java:37:29: compiler.warn.non.private.method.weaker.access +8 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/RecordSerial.java b/test/langtools/tools/javac/warnings/Serial/RecordSerial.java new file mode 100644 index 00000000000..4aadc047adb --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/RecordSerial.java @@ -0,0 +1,44 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=RecordSerial.out -XDrawDiagnostics -Xlint:serial RecordSerial.java + */ + +import java.io.*; + +record RecordSerial(int foo) implements Serializable { + // Verify a warning is generated in a record class for each of the + // ineffectual serial fields and methods. + + // partially effective + private static final long serialVersionUID = 42; + + // ineffectual + private static final ObjectStreamField[] serialPersistentFields = {}; + + // ineffectual + private void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + // (possibly) effective + private Object writeReplace() throws ObjectStreamException { + return null; + } + + // ineffectual + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + // ineffectual + private void readObjectNoData() throws ObjectStreamException { + return; + } + + // (possibly) effective + private Object readResolve() throws ObjectStreamException { + return null; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/RecordSerial.out b/test/langtools/tools/javac/warnings/Serial/RecordSerial.out new file mode 100644 index 00000000000..6b4aad06e7c --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/RecordSerial.out @@ -0,0 +1,5 @@ +RecordSerial.java:9:1: compiler.warn.ineffectual.serial.field.record +RecordSerial.java:9:1: compiler.warn.ineffectual.serial.method.record: writeObject +RecordSerial.java:9:1: compiler.warn.ineffectual.serial.method.record: readObject +RecordSerial.java:9:1: compiler.warn.ineffectual.serial.method.record: readObjectNoData +4 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/SerialMethodArity.java b/test/langtools/tools/javac/warnings/Serial/SerialMethodArity.java new file mode 100644 index 00000000000..9acbda3cfcd --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/SerialMethodArity.java @@ -0,0 +1,40 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=SerialMethodArity.out -XDrawDiagnostics -Xlint:serial SerialMethodArity.java + */ + +import java.io.*; + +class SerialMethodMods implements Serializable { + private static final long serialVersionUID = 42; + + private static class CustomObjectOutputStream extends ObjectOutputStream { + public CustomObjectOutputStream() throws IOException, + SecurityException {} + } + + // Should have a single parameter of exact type ObjectOutputStream + private void writeObject(CustomObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + // Should have a single parameter of exact type ObjectInputStream + private void readObject(ObjectInputStream stream, int retries) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + // Should have no arguments + private void readObjectNoData(int retries) throws ObjectStreamException {} + + // Should have no arguments + public Object writeReplace(int arg0, int arg1) throws ObjectStreamException { + return null; + } + + // Should have no arguments + public Object readResolve(double foo, float bar) throws ObjectStreamException { + return null; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/SerialMethodArity.out b/test/langtools/tools/javac/warnings/Serial/SerialMethodArity.out new file mode 100644 index 00000000000..66f1c65305f --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/SerialMethodArity.out @@ -0,0 +1,6 @@ +SerialMethodArity.java:18:18: compiler.warn.serial.method.parameter.type: writeObject, java.io.ObjectOutputStream, SerialMethodMods.CustomObjectOutputStream +SerialMethodArity.java:23:18: compiler.warn.serial.method.one.arg: readObject, 2 +SerialMethodArity.java:29:39: compiler.warn.serial.method.no.args: readObjectNoData +SerialMethodArity.java:32:36: compiler.warn.serial.method.no.args: writeReplace +SerialMethodArity.java:37:38: compiler.warn.serial.method.no.args: readResolve +5 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/SerialMethodMods.java b/test/langtools/tools/javac/warnings/Serial/SerialMethodMods.java new file mode 100644 index 00000000000..03a741e9793 --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/SerialMethodMods.java @@ -0,0 +1,33 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=SerialMethodMods.out -XDrawDiagnostics -Xlint:serial SerialMethodMods.java + */ + +import java.io.*; + +abstract class SerialMethodMods implements Serializable { + private static final long serialVersionUID = 42; + + // Should be private + void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + } + + // Should be private + public void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + // Should be concrete instance method + private static void readObjectNoData() throws ObjectStreamException {} + + // Should be concrete instance method + public abstract Object writeReplace() throws ObjectStreamException; + + // Should be concrete instance method + public static Object readResolve() throws ObjectStreamException { + return null; + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/SerialMethodMods.out b/test/langtools/tools/javac/warnings/Serial/SerialMethodMods.out new file mode 100644 index 00000000000..0f84b4cdf6e --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/SerialMethodMods.out @@ -0,0 +1,6 @@ +SerialMethodMods.java:13:10: compiler.warn.serial.method.not.private: writeObject +SerialMethodMods.java:18:17: compiler.warn.serial.method.not.private: readObject +SerialMethodMods.java:24:25: compiler.warn.serial.method.static: readObjectNoData +SerialMethodMods.java:27:28: compiler.warn.serial.concrete.instance.method: writeReplace +SerialMethodMods.java:30:26: compiler.warn.serial.concrete.instance.method: readResolve +5 warnings diff --git a/test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.java b/test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.java new file mode 100644 index 00000000000..72b9db2148a --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.java @@ -0,0 +1,218 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8202056 + * @compile/ref=SerialMethodThrows.out -XDrawDiagnostics -Xlint:serial SerialMethodThrows.java + */ + +import java.io.*; + +/* + * Container class for various serializable classes with different + * kinds of throws clauses. Canonical serialization method signatures: + * + * private void writeObject(ObjectOutputStream stream) + * throws IOException + * + * ANY-ACCESS-MODIFIER Object writeReplace() + * throws ObjectStreamException + * + * private void readObject(ObjectInputStream stream) + * throws IOException, ClassNotFoundException + * + * private void readObjectNoData() + * throws ObjectStreamException + * + * ANY-ACCESS-MODIFIER Object readResolve() + * throws ObjectStreamException + */ +class SerialMethodThrows { + + // Being declared to throw no exceptions is fine and should not + // generate any warnings. + static class NoThrows implements Serializable { + private static final long serialVersionUID = 42; + + private void writeObject(ObjectOutputStream stream) { + try { + stream.defaultWriteObject(); + } catch (IOException e) { + ; + } + } + + private Object writeReplace() { + return null; + } + + private void readObject(ObjectInputStream stream) { + try { + stream.defaultReadObject(); + } catch (IOException | ClassNotFoundException e) { + ; + } + } + + private void readObjectNoData() {} + + private Object readResolve() { + return null; + } + } + + // Being declared to throw the canonical exceptions is fine and + // should not generate any warnings. + static class ErrorThrows implements Serializable { + private static final long serialVersionUID = 42; + + private void writeObject(ObjectOutputStream stream) + throws Error { + try { + stream.defaultWriteObject(); + } catch (IOException e) { + ; + } + } + + private Object writeReplace() + throws Error { + return null; + } + + private void readObject(ObjectInputStream stream) + throws Error { + try { + stream.defaultReadObject(); + } catch (IOException | ClassNotFoundException e) { + ; + } + } + + private void readObjectNoData() + throws Error {} + + private Object readResolve() + throws Error { + return null; + } + } + + // Being declared to throw the canonical exceptions is fine and + // should not generate any warnings. + static class ExactThrows implements Serializable { + private static final long serialVersionUID = 42; + + private void writeObject(ObjectOutputStream stream) + throws IOException { + stream.defaultWriteObject(); + } + + private Object writeReplace() + throws ObjectStreamException { + return null; + } + + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + } + + private void readObjectNoData() + throws ObjectStreamException {} + + private Object readResolve() + throws ObjectStreamException { + return null; + } + } + + // Being declared to throw subclasses of the canonical exceptions + // is fine and should not generate any warnings. + static class SubclassThrows implements Serializable { + private static final long serialVersionUID = 42; + + private void writeObject(ObjectOutputStream stream) + throws CustomIOException { + try { + stream.defaultWriteObject(); + } catch (IOException e) { + ; + } + } + + private Object writeReplace() + throws CustomObjectStreamException { + return null; + } + + private void readObject(ObjectInputStream stream) + throws CustomIOException, CustomClassNotFoundException { + try { + stream.defaultReadObject(); + } catch (IOException | ClassNotFoundException e) { + ; + } + } + + private void readObjectNoData() + throws CustomObjectStreamException {} + + private Object readResolve() + throws CustomObjectStreamException { + return null; + } + } + + private static class CustomIOException extends IOException{ + private static final long serialVersionUID = 1; + } + + private static class CustomObjectStreamException extends ObjectStreamException { + private static final long serialVersionUID = 2; + } + + private static class CustomClassNotFoundException extends ClassNotFoundException { + private static final long serialVersionUID = 3; + } + + // Use to trigger warnings + private static class CustomException extends Exception { + private static final long serialVersionUID = 3; + } + + // Being declared to throw subclasses of the canonical exceptions + // is fine and should not generate any warnings. + static class CustomThrows implements Serializable { + private static final long serialVersionUID = 42; + + private void writeObject(ObjectOutputStream stream) + throws CustomException { + try { + stream.defaultWriteObject(); + } catch (IOException e) { + ; + } + } + + private Object writeReplace() + throws CustomException { + return null; + } + + private void readObject(ObjectInputStream stream) + throws CustomException { + try { + stream.defaultReadObject(); + } catch (IOException | ClassNotFoundException e) { + ; + } + } + + private void readObjectNoData() + throws CustomException {} + + private Object readResolve() + throws CustomException { + return null; + } + } +} diff --git a/test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.out b/test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.out new file mode 100644 index 00000000000..fdb6765999b --- /dev/null +++ b/test/langtools/tools/javac/warnings/Serial/SerialMethodThrows.out @@ -0,0 +1,6 @@ +SerialMethodThrows.java:187:22: compiler.warn.serial.method.unexpected.exception: writeObject, SerialMethodThrows.CustomException +SerialMethodThrows.java:196:24: compiler.warn.serial.method.unexpected.exception: writeReplace, SerialMethodThrows.CustomException +SerialMethodThrows.java:201:22: compiler.warn.serial.method.unexpected.exception: readObject, SerialMethodThrows.CustomException +SerialMethodThrows.java:210:22: compiler.warn.serial.method.unexpected.exception: readObjectNoData, SerialMethodThrows.CustomException +SerialMethodThrows.java:213:24: compiler.warn.serial.method.unexpected.exception: readResolve, SerialMethodThrows.CustomException +5 warnings -- GitLab From c978ca87de2d9152345dfd85983278c42bb28cd3 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 22 Oct 2021 03:05:16 +0000 Subject: [PATCH 037/890] 8275344: -Xcheck:jni produces some warnings in the LCMS.c Reviewed-by: azvegint, prr, kizune --- src/java.desktop/share/native/liblcms/LCMS.c | 69 ++++++++++++++----- .../MTTransformReplacedProfile.java | 17 ++++- 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/src/java.desktop/share/native/liblcms/LCMS.c b/src/java.desktop/share/native/liblcms/LCMS.c index e4aaeb72891..4bbd6e100c3 100644 --- a/src/java.desktop/share/native/liblcms/LCMS.c +++ b/src/java.desktop/share/native/liblcms/LCMS.c @@ -85,7 +85,9 @@ void errorHandler(cmsContext ContextID, cmsUInt32Number errorCode, errMsg[count] = 0; (*javaVM)->AttachCurrentThread(javaVM, (void**)&env, NULL); - JNU_ThrowByName(env, "java/awt/color/CMMException", errMsg); + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it before + JNU_ThrowByName(env, "java/awt/color/CMMException", errMsg); + } } JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *jvm, void *reserved) { @@ -113,6 +115,26 @@ void LCMS_freeTransform(JNIEnv *env, jlong ID) cmsDeleteTransform(sTrans); } +/* + * Throw an IllegalArgumentException and init the cause. + */ +static void ThrowIllegalArgumentException(JNIEnv *env, const char *msg) { + jthrowable cause = (*env)->ExceptionOccurred(env); + if (cause != NULL) { + (*env)->ExceptionClear(env); + } + jstring str = JNU_NewStringPlatform(env, msg); + if (str != NULL) { + jobject iae = JNU_NewObjectByName(env, + "java/lang/IllegalArgumentException", + "(Ljava/lang/String;Ljava/lang/Throwable;)V", + str, cause); + if (iae != NULL) { + (*env)->Throw(env, iae); + } + } +} + /* * Class: sun_java2d_cmm_lcms_LCMS * Method: createNativeTransform @@ -185,7 +207,7 @@ JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_createNativeTransform if (sTrans == NULL) { J2dRlsTraceLn(J2D_TRACE_ERROR, "LCMS_createNativeTransform: " "sTrans == NULL"); - if ((*env)->ExceptionOccurred(env) == NULL) { + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it JNU_ThrowByName(env, "java/awt/color/CMMException", "Cannot get color transform"); } @@ -214,7 +236,7 @@ JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_loadProfileNative cmsHPROFILE pf; if (JNU_IsNull(env, data)) { - JNU_ThrowIllegalArgumentException(env, "Invalid profile data"); + ThrowIllegalArgumentException(env, "Invalid profile data"); return 0L; } @@ -232,7 +254,7 @@ JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_loadProfileNative (*env)->ReleaseByteArrayElements (env, data, dataArray, 0); if (pf == NULL) { - JNU_ThrowIllegalArgumentException(env, "Invalid profile data"); + ThrowIllegalArgumentException(env, "Invalid profile data"); } else { /* Sanity check: try to save the profile in order * to force basic validation. @@ -241,8 +263,7 @@ JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_loadProfileNative if (!cmsSaveProfileToMem(pf, NULL, &pfSize) || pfSize < sizeof(cmsICCHeader)) { - JNU_ThrowIllegalArgumentException(env, "Invalid profile data"); - + ThrowIllegalArgumentException(env, "Invalid profile data"); cmsCloseProfile(pf); pf = NULL; } @@ -276,8 +297,10 @@ JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileDataNative // determine actual profile size if (!cmsSaveProfileToMem(sProf->pf, NULL, &pfSize)) { - JNU_ThrowByName(env, "java/awt/color/CMMException", - "Can not access specified profile."); + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it + JNU_ThrowByName(env, "java/awt/color/CMMException", + "Can not access specified profile."); + } return NULL; } @@ -298,8 +321,10 @@ JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileDataNative (*env)->ReleaseByteArrayElements(env, data, dataArray, 0); if (!status) { - JNU_ThrowByName(env, "java/awt/color/CMMException", - "Can not access specified profile."); + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it + JNU_ThrowByName(env, "java/awt/color/CMMException", + "Can not access specified profile."); + } return NULL; } return data; @@ -354,8 +379,10 @@ JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagNative (*env)->ReleaseByteArrayElements (env, data, dataArray, 0); if (!status) { - JNU_ThrowByName(env, "java/awt/color/CMMException", - "ICC Profile header not found"); + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it + JNU_ThrowByName(env, "java/awt/color/CMMException", + "ICC Profile header not found"); + } return NULL; } @@ -365,8 +392,10 @@ JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagNative if (cmsIsTag(sProf->pf, sig.cms)) { tagSize = cmsReadRawTag(sProf->pf, sig.cms, NULL, 0); } else { - JNU_ThrowByName(env, "java/awt/color/CMMException", - "ICC profile tag not found"); + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it + JNU_ThrowByName(env, "java/awt/color/CMMException", + "ICC profile tag not found"); + } return NULL; } @@ -389,8 +418,10 @@ JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagNative (*env)->ReleaseByteArrayElements (env, data, dataArray, 0); if (bufSize != tagSize) { - JNU_ThrowByName(env, "java/awt/color/CMMException", - "Can not get tag data."); + if (!(*env)->ExceptionCheck(env)) { // errorHandler may throw it + JNU_ThrowByName(env, "java/awt/color/CMMException", + "Can not get tag data."); + } return NULL; } return data; @@ -415,7 +446,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagDataNative sig.j = tagSig; if (JNU_IsNull(env, data)) { - JNU_ThrowIllegalArgumentException(env, "Can not write tag data."); + ThrowIllegalArgumentException(env, "Can not write tag data."); return; } @@ -443,7 +474,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagDataNative (*env)->ReleaseByteArrayElements(env, data, dataArray, 0); if (!status) { - JNU_ThrowIllegalArgumentException(env, "Can not write tag data."); + ThrowIllegalArgumentException(env, "Can not write tag data."); } else if (pfReplace != NULL) { cmsCloseProfile(sProf->pf); sProf->pf = pfReplace; @@ -554,7 +585,7 @@ JNIEXPORT jobject JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileID return NULL; } jobject cmmProfile = (*env)->CallObjectMethod(env, pf, mid); - if ((*env)->ExceptionOccurred(env)) { + if ((*env)->ExceptionCheck(env)) { return NULL; } jclass lcmsPCls = (*env)->FindClass(env, "sun/java2d/cmm/lcms/LCMSProfile"); diff --git a/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java b/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java index d9e10785cff..9694554ed4f 100644 --- a/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java +++ b/test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java @@ -32,16 +32,31 @@ import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + /** * @test - * @bug 8271718 8273135 + * @bug 8271718 8273135 8275344 * @summary Verifies MT safety of color transformation while profile is changed + * @library /test/lib + * @run main/othervm MTTransformReplacedProfile + * @run main/othervm MTTransformReplacedProfile checkJNI */ public final class MTTransformReplacedProfile { private static volatile long endtime; public static void main(String[] args) throws Exception { + if (args.length > 0 && args[0].equals("checkJNI")) { + ProcessBuilder pb = ProcessTools.createTestJvm( + "-Xcheck:jni", MTTransformReplacedProfile.class.getName()); + OutputAnalyzer oa = ProcessTools.executeProcess(pb); + oa.stderrShouldBeEmpty(); + oa.stdoutShouldBeEmpty(); + oa.shouldHaveExitValue(0); + return; + } ICC_Profile[] profiles = { ICC_Profile.getInstance(ColorSpace.CS_sRGB), ICC_Profile.getInstance(ColorSpace.CS_LINEAR_RGB), -- GitLab From fab3d6c6122b2ce23dfa12db489923d8261f8f35 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Fri, 22 Oct 2021 04:47:53 +0000 Subject: [PATCH 038/890] 8275761: Backout: JDK-8274794 Print all owned locks in hs_err file Reviewed-by: mikael --- src/hotspot/share/runtime/mutex.cpp | 83 ++++--------------- src/hotspot/share/runtime/mutex.hpp | 25 +++--- src/hotspot/share/runtime/mutexLocker.cpp | 33 ++++++++ src/hotspot/share/runtime/mutexLocker.hpp | 6 ++ src/hotspot/share/utilities/vmError.cpp | 8 +- .../ErrorHandling/ErrorFileOverwriteTest.java | 50 +++++++++-- .../ErrorHandling/ErrorFileScanner.java | 75 ----------------- .../ErrorHandling/TestErrorFileMutex.java | 72 ---------------- 8 files changed, 110 insertions(+), 242 deletions(-) delete mode 100644 test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java delete mode 100644 test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java diff --git a/src/hotspot/share/runtime/mutex.cpp b/src/hotspot/share/runtime/mutex.cpp index 5f2d2988a97..caf14ce1164 100644 --- a/src/hotspot/share/runtime/mutex.cpp +++ b/src/hotspot/share/runtime/mutex.cpp @@ -31,7 +31,6 @@ #include "runtime/osThread.hpp" #include "runtime/safepointMechanism.inline.hpp" #include "runtime/thread.inline.hpp" -#include "runtime/threadCritical.hpp" #include "utilities/events.hpp" #include "utilities/macros.hpp" @@ -268,36 +267,7 @@ bool Monitor::wait(int64_t timeout) { return wait_status != 0; // return true IFF timeout } -// Array used to print owned locks on error. -static Mutex* _mutex_array = NULL; - -void Mutex::add_to_global_list() { - // Add mutex to print_owned_locks_on_error array - ThreadCritical tc; - Mutex* next = _mutex_array; - _next_mutex = next; - _prev_mutex = nullptr; - _mutex_array = this; - if (next != nullptr) { - next->_prev_mutex = this; - } -} - -void Mutex::remove_from_global_list() { - // Remove mutex from print_owned_locks_on_error array - ThreadCritical tc; - Mutex* old_next = _next_mutex; - assert(old_next != nullptr, "this list can never be empty"); - old_next->_prev_mutex = _prev_mutex; - if (_prev_mutex == nullptr) { - _mutex_array = old_next; - } else { - _prev_mutex->_next_mutex = old_next; - } -} - Mutex::~Mutex() { - remove_from_global_list(); assert_owner(NULL); os::free(const_cast(_name)); } @@ -310,8 +280,6 @@ Mutex::Mutex(Rank rank, const char * name, bool allow_vm_block) : _owner(NULL) { _allow_vm_block = allow_vm_block; _rank = rank; _skip_rank_check = false; - _next = nullptr; - _last_owner = nullptr; assert(_rank >= static_cast(0) && _rank <= safepoint, "Bad lock rank %s: %s", rank_name(), name); @@ -320,51 +288,16 @@ Mutex::Mutex(Rank rank, const char * name, bool allow_vm_block) : _owner(NULL) { assert(_rank > nosafepoint || _allow_vm_block, "Locks that don't check for safepoint should always allow the vm to block: %s", name); #endif - add_to_global_list(); } bool Mutex::owned_by_self() const { return owner() == Thread::current(); } -void Mutex::print_on(outputStream* st) const { +void Mutex::print_on_error(outputStream* st) const { st->print("[" PTR_FORMAT, p2i(this)); st->print("] %s", _name); st->print(" - owner thread: " PTR_FORMAT, p2i(owner())); -#ifdef ASSERT - if (_allow_vm_block) { - st->print_raw(" allow_vm_block"); - } - st->print(" %s", rank_name()); -#endif - st->cr(); -} - -// Print all mutexes/monitors that are currently owned by a thread; called -// by fatal error handler. -// This function doesn't take the ThreadCritical lock to avoid potential -// deadlock during error reporting. -void Mutex::print_owned_locks_on_error(outputStream* st) { - assert(VMError::is_error_reported(), "should only be called during error reporting"); - ResourceMark rm; - st->print("VM Mutexes/Monitors currently owned by a thread: "); - bool none = true; - Mutex *m = _mutex_array; - int array_count = 0; - while (m != nullptr) { - array_count++; - // see if it has an owner - if (m->owner() != NULL) { - if (none) { - st->cr(); - none = false; - } - m->print_on(st); - } - m = m->_next_mutex; - } - if (none) st->print_cr("None"); - st->print_cr("Total Mutex count %d", array_count); } // ---------------------------------------------------------------------------------- @@ -410,7 +343,21 @@ void Mutex::assert_no_overlap(Rank orig, Rank adjusted, int adjust) { rank_name_internal(orig), adjust, rank_name_internal(adjusted)); } } +#endif // ASSERT + +#ifndef PRODUCT +void Mutex::print_on(outputStream* st) const { + st->print("Mutex: [" PTR_FORMAT "] %s - owner: " PTR_FORMAT, + p2i(this), _name, p2i(owner())); + if (_allow_vm_block) { + st->print("%s", " allow_vm_block"); + } + DEBUG_ONLY(st->print(" %s", rank_name())); + st->cr(); +} +#endif // PRODUCT +#ifdef ASSERT void Mutex::assert_owner(Thread * expected) { const char* msg = "invalid owner"; if (expected == NULL) { diff --git a/src/hotspot/share/runtime/mutex.hpp b/src/hotspot/share/runtime/mutex.hpp index 70b17a7d552..586b69f1082 100644 --- a/src/hotspot/share/runtime/mutex.hpp +++ b/src/hotspot/share/runtime/mutex.hpp @@ -88,24 +88,19 @@ class Mutex : public CHeapObj { Thread* volatile _owner; void raw_set_owner(Thread* new_owner) { Atomic::store(&_owner, new_owner); } - // Embed pointers for mutex array for error reporting. - Mutex* _next_mutex; - Mutex* _prev_mutex; - - void add_to_global_list(); - void remove_from_global_list(); - protected: // Monitor-Mutex metadata os::PlatformMonitor _lock; // Native monitor implementation const char* _name; // Name of mutex/monitor - // Debugging fields for naming, deadlock detection, etc. + // Debugging fields for naming, deadlock detection, etc. (some only used in debug mode) +#ifndef PRODUCT + bool _allow_vm_block; +#endif #ifdef ASSERT Rank _rank; // rank (to avoid/detect potential deadlocks) Mutex* _next; // Used by a Thread to link up owned locks Thread* _last_owner; // the last thread to own the lock - bool _skip_rank_check; // read only by owner when doing rank checks - bool _allow_vm_block; + bool _skip_rank_check; // read only by owner when doing rank checks static bool contains(Mutex* locks, Mutex* lock); static Mutex* get_least_ranked_lock(Mutex* locks); @@ -194,11 +189,11 @@ class Mutex : public CHeapObj { const char *name() const { return _name; } - // Print all mutexes/monitors that are currently owned by a thread; called - // by fatal error handler. - static void print_owned_locks_on_error(outputStream* st); - void print_on(outputStream* st) const; - void print() const { print_on(::tty); } + void print_on_error(outputStream* st) const; + #ifndef PRODUCT + void print_on(outputStream* st) const; + void print() const { print_on(::tty); } + #endif }; class Monitor : public Mutex { diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index 227ad386817..35900865d37 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -157,6 +157,11 @@ Mutex* Bootclasspath_lock = NULL; Monitor* JVMCI_lock = NULL; #endif + +#define MAX_NUM_MUTEX 128 +static Mutex* _mutex_array[MAX_NUM_MUTEX]; +static int _num_mutex; + #ifdef ASSERT void assert_locked_or_safepoint(const Mutex* lock) { // check if this thread owns the lock (common case) @@ -189,18 +194,26 @@ void assert_locked_or_safepoint_or_handshake(const Mutex* lock, const JavaThread } #endif +static void add_mutex(Mutex* var) { + assert(_num_mutex < MAX_NUM_MUTEX, "increase MAX_NUM_MUTEX"); + _mutex_array[_num_mutex++] = var; +} + #define def(var, type, pri, vm_block) { \ var = new type(Mutex::pri, #var, vm_block); \ + add_mutex(var); \ } // Specify relative ranked lock #ifdef ASSERT #define defl(var, type, held_lock, vm_block) { \ var = new type(held_lock->rank()-1, #var, vm_block); \ + add_mutex(var); \ } #else #define defl(var, type, held_lock, vm_block) { \ var = new type(Mutex::safepoint, #var, vm_block); \ + add_mutex(var); \ } #endif @@ -364,3 +377,23 @@ GCMutexLocker::GCMutexLocker(Mutex* mutex) { _mutex->lock(); } } + +// Print all mutexes/monitors that are currently owned by a thread; called +// by fatal error handler. +void print_owned_locks_on_error(outputStream* st) { + st->print("VM Mutex/Monitor currently owned by a thread: "); + bool none = true; + for (int i = 0; i < _num_mutex; i++) { + // see if it has an owner + if (_mutex_array[i]->owner() != NULL) { + if (none) { + // print format used by Mutex::print_on_error() + st->print_cr(" ([mutex/lock_event])"); + none = false; + } + _mutex_array[i]->print_on_error(st); + st->cr(); + } + } + if (none) st->print_cr("None"); +} diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp index fa6671bb0e1..c4c72150060 100644 --- a/src/hotspot/share/runtime/mutexLocker.hpp +++ b/src/hotspot/share/runtime/mutexLocker.hpp @@ -169,6 +169,12 @@ extern Mutex* tty_lock; // lock to synchronize output. // order. If their implementations change such that these assumptions // are violated, a whole lot of code will break. +// Print all mutexes/monitors that are currently owned by a thread; called +// by fatal error handler. +void print_owned_locks_on_error(outputStream* st); + +char *lock_name(Mutex *mutex); + // for debugging: check that we're already owning this lock (or are at a safepoint / handshake) #ifdef ASSERT void assert_locked_or_safepoint(const Mutex* lock); diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 44c7376dc1e..d6152164dbb 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1015,7 +1015,7 @@ void VMError::report(outputStream* st, bool _verbose) { // mutexes/monitors that currently have an owner if (_verbose) { - Mutex::print_owned_locks_on_error(st); + print_owned_locks_on_error(st); st->cr(); } @@ -1913,12 +1913,6 @@ void VMError::controlled_crash(int how) { switch (how) { case 1: assert(how == 0, "test assert"); break; case 2: guarantee(how == 0, "test guarantee"); break; - case 3: { - Mutex* ErrorTest_lock = new Mutex(Mutex::nosafepoint, "ErrorTest_lock"); - MutexLocker ml(ErrorTest_lock, Mutex::_no_safepoint_check_flag); - assert(how == 0, "test assert with lock"); - break; - } // The other cases are unused. case 14: crash_with_segfault(); break; diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java index 9108213722c..c9b9e433e18 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileOverwriteTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, SAP. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -42,6 +42,46 @@ import java.util.regex.Pattern; public class ErrorFileOverwriteTest { + private static File findHsErrorFileInOutput(OutputAnalyzer output) { + + String hs_err_file = output.firstMatch("# *(\\S*hs_err_pid.*\\.log)", 1); + if(hs_err_file ==null) { + throw new RuntimeException("Did not find hs-err file in output.\n"); + } + + File f = new File(hs_err_file); + if (!f.exists()) { + throw new RuntimeException("hs-err file missing at " + + f.getAbsolutePath() + ".\n"); + } + + return f; + + } + + private static void scanHsErrorFileForContent(File f, Pattern[] pattern) throws IOException { + FileInputStream fis = new FileInputStream(f); + BufferedReader br = new BufferedReader(new InputStreamReader(fis)); + String line = null; + + int currentPattern = 0; + + String lastLine = null; + while ((line = br.readLine()) != null && currentPattern < pattern.length) { + if (pattern[currentPattern].matcher(line).matches()) { + System.out.println("Found: " + line + "."); + currentPattern++; + } + lastLine = line; + } + br.close(); + + if (currentPattern < pattern.length) { + throw new RuntimeException("hs-err file incomplete (first missing pattern: " + pattern[currentPattern] + ")"); + } + + } + public static void do_test(boolean with_percent_p) throws Exception { // Crash twice. @@ -70,10 +110,10 @@ public class ErrorFileOverwriteTest { output_detail.shouldMatch("# " + errorFileStem + ".*"); System.out.println("First crash: Found expected output on tty. Ok."); - File f = ErrorFileScanner.findHsErrorFileInOutput(output_detail); + File f = findHsErrorFileInOutput(output_detail); System.out.println("First crash: Found hs error file at " + f.getAbsolutePath()); - ErrorFileScanner.scanHsErrorFileForContent(f, new Pattern[] { + scanHsErrorFileForContent(f, new Pattern[] { Pattern.compile("# *Internal Error.*"), Pattern.compile("Command Line:.*-XX:ErrorHandlerTest=1.*-XX:ErrorFile=" + errorFileStem + ".*") }); @@ -96,7 +136,7 @@ public class ErrorFileOverwriteTest { output_detail.shouldMatch("# " + errorFileStem + ".*"); System.out.println("Second crash: Found expected output on tty. Ok."); - File f2 = ErrorFileScanner.findHsErrorFileInOutput(output_detail); + File f2 = findHsErrorFileInOutput(output_detail); System.out.println("Second crash: Found hs error file at " + f2.getAbsolutePath()); if (with_percent_p) { @@ -105,7 +145,7 @@ public class ErrorFileOverwriteTest { } } - ErrorFileScanner.scanHsErrorFileForContent(f2, new Pattern[] { + scanHsErrorFileForContent(f2, new Pattern[] { Pattern.compile("# *Internal Error.*"), Pattern.compile("Command Line:.*-XX:ErrorHandlerTest=2.*-XX:ErrorFile=" + errorFileStem + ".*") }); diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java b/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java deleted file mode 100644 index 5e36a8b8698..00000000000 --- a/test/hotspot/jtreg/runtime/ErrorHandling/ErrorFileScanner.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021, 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.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStreamReader; -import java.io.IOException; - -import java.util.regex.Pattern; - -import jdk.test.lib.process.OutputAnalyzer; - -public class ErrorFileScanner { - - public static File findHsErrorFileInOutput(OutputAnalyzer output) { - - String hs_err_file = output.firstMatch("# *(\\S*hs_err_pid.*\\.log)", 1); - if(hs_err_file ==null) { - throw new RuntimeException("Did not find hs-err file in output.\n"); - } - - File f = new File(hs_err_file); - if (!f.exists()) { - throw new RuntimeException("hs-err file missing at " - + f.getAbsolutePath() + ".\n"); - } - - return f; - - } - - public static void scanHsErrorFileForContent(File f, Pattern[] pattern) throws IOException { - FileInputStream fis = new FileInputStream(f); - BufferedReader br = new BufferedReader(new InputStreamReader(fis)); - String line = null; - - int currentPattern = 0; - - String lastLine = null; - while ((line = br.readLine()) != null && currentPattern < pattern.length) { - if (pattern[currentPattern].matcher(line).matches()) { - System.out.println("Found: " + line + "."); - currentPattern++; - } - lastLine = line; - } - br.close(); - - if (currentPattern < pattern.length) { - throw new RuntimeException("hs-err file incomplete (first missing pattern: " + pattern[currentPattern] + ")"); - } - - } -} diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java b/test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java deleted file mode 100644 index 97ddb48c06d..00000000000 --- a/test/hotspot/jtreg/runtime/ErrorHandling/TestErrorFileMutex.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2021, 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 8274794 - * @summary Test that locks are printed in the Error file. - * @library /test/lib - * @modules java.base/jdk.internal.misc - * @requires (vm.debug == true) - * @run driver TestErrorFileMutex - */ - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - -import java.io.*; -import java.util.regex.Pattern; - -public class TestErrorFileMutex { - - public static void do_test() throws Exception { - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xmx64M", - "-XX:-CreateCoredumpOnCrash", - "-XX:ErrorHandlerTest=3", - "-version"); - - OutputAnalyzer output_detail = new OutputAnalyzer(pb.start()); - output_detail.shouldMatch("# A fatal error has been detected by the Java Runtime Environment:.*"); - - File f = ErrorFileScanner.findHsErrorFileInOutput(output_detail); - System.out.println("Found hs error file at " + f.getAbsolutePath()); - - ErrorFileScanner.scanHsErrorFileForContent(f, new Pattern[] { - Pattern.compile("# *Internal Error.*"), - Pattern.compile(".*VM Mutexes/Monitors currently owned by a thread:.*"), - Pattern.compile(".*ErrorTest_lock - owner thread:.*"), - Pattern.compile(".*Threads_lock - owner thread:.*") - }); - } - - public static void main(String[] args) throws Exception { - do_test(); - } - -} - - - -- GitLab From 1efe946db77e38507511a9c898b8b59fe9ba1aeb Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Fri, 22 Oct 2021 08:20:43 +0000 Subject: [PATCH 039/890] 8275712: Hashtable literal_size functions are broken Reviewed-by: coleenp, zgu --- src/hotspot/share/classfile/stringTable.cpp | 19 +++++++++--------- src/hotspot/share/utilities/hashtable.cpp | 22 ++++++++++++--------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/hotspot/share/classfile/stringTable.cpp b/src/hotspot/share/classfile/stringTable.cpp index 71514647038..c43f940b790 100644 --- a/src/hotspot/share/classfile/stringTable.cpp +++ b/src/hotspot/share/classfile/stringTable.cpp @@ -538,18 +538,19 @@ void StringTable::rehash_table() { } // Statistics -static int literal_size(oop obj) { - // NOTE: this would over-count if (pre-JDK8) - // java_lang_Class::has_offset_field() is true and the String.value array is - // shared by several Strings. However, starting from JDK8, the String.value - // array is not shared anymore. +static size_t literal_size(oop obj) { if (obj == NULL) { return 0; - } else if (obj->klass() == vmClasses::String_klass()) { - return (obj->size() + java_lang_String::value(obj)->size()) * HeapWordSize; - } else { - return obj->size(); } + + size_t word_size = obj->size(); + + if (obj->klass() == vmClasses::String_klass()) { + // This may overcount if String.value arrays are shared. + word_size += java_lang_String::value(obj)->size(); + } + + return word_size * HeapWordSize; } struct SizeFunc : StackObj { diff --git a/src/hotspot/share/utilities/hashtable.cpp b/src/hotspot/share/utilities/hashtable.cpp index 5b99bba8bec..5e8cd7dfde1 100644 --- a/src/hotspot/share/utilities/hashtable.cpp +++ b/src/hotspot/share/utilities/hashtable.cpp @@ -75,24 +75,28 @@ template void BasicHashtable::free_buckets() { } // Default overload, for types that are uninteresting. -template static int literal_size(T) { return 0; } +template static size_t literal_size(T) { return 0; } -static int literal_size(Symbol *symbol) { +static size_t literal_size(Symbol *symbol) { return symbol->size() * HeapWordSize; } -static int literal_size(oop obj) { +static size_t literal_size(oop obj) { if (obj == NULL) { return 0; - } else if (obj->klass() == vmClasses::String_klass()) { + } + + size_t word_size = obj->size(); + + if (obj->klass() == vmClasses::String_klass()) { // This may overcount if String.value arrays are shared. - return (obj->size() + java_lang_String::value(obj)->size()) * HeapWordSize; - } else { - return obj->size(); + word_size += java_lang_String::value(obj)->size(); } + + return word_size * HeapWordSize; } -static int literal_size(WeakHandle v) { +static size_t literal_size(WeakHandle v) { return literal_size(v.peek()); } @@ -175,7 +179,7 @@ template bool BasicHashtable::maybe_grow(int max_size, int load_ template TableStatistics Hashtable::statistics_calculate(T (*literal_load_barrier)(HashtableEntry*)) { NumberSeq summary; - int literal_bytes = 0; + size_t literal_bytes = 0; for (int i = 0; i < this->table_size(); ++i) { int count = 0; for (HashtableEntry* e = this->bucket(i); -- GitLab From b2128a96670daeca93aca84ee7613b2b337ddfa4 Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Fri, 22 Oct 2021 12:17:45 +0000 Subject: [PATCH 040/890] 8263155: Allow additional contents for DMG Reviewed-by: asemenyuk, almatvee --- .../jdk/jpackage/internal/MacDmgBundler.java | 24 ++-- .../jpackage/internal/resources/DMGsetup.scpt | 9 +- .../jdk/jpackage/internal/Arguments.java | 10 ++ .../jdk/jpackage/internal/DeployParams.java | 7 +- .../internal/StandardBundlerParam.java | 10 +- .../jdk/jpackage/internal/ValidOptions.java | 1 + .../helpers/jdk/jpackage/test/MacHelper.java | 15 ++- .../tools/jpackage/macosx/DmgContentTest.java | 111 ++++++++++++++++++ 8 files changed, 170 insertions(+), 17 deletions(-) create mode 100644 test/jdk/tools/jpackage/macosx/DmgContentTest.java diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java index 709f1f96bf7..289a48c35d0 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java @@ -34,6 +34,7 @@ import java.nio.file.Path; import java.text.MessageFormat; import java.util.Base64; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.ResourceBundle; @@ -46,6 +47,7 @@ import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; import static jdk.jpackage.internal.StandardBundlerParam.LICENSE_FILE; import static jdk.jpackage.internal.StandardBundlerParam.TEMP_ROOT; import static jdk.jpackage.internal.StandardBundlerParam.VERBOSE; +import static jdk.jpackage.internal.StandardBundlerParam.DMG_CONTENT; public class MacDmgBundler extends MacBaseInstallerBundler { @@ -79,7 +81,7 @@ public class MacDmgBundler extends MacBaseInstallerBundler { try { Path appLocation = prepareAppBundle(params); - if (appLocation != null && prepareConfigFiles(params)) { + if (appLocation != null && prepareConfigFiles(appLocation,params)) { Path configScript = getConfig_Script(params); if (IOUtils.exists(configScript)) { IOUtils.run("bash", configScript); @@ -96,8 +98,8 @@ public class MacDmgBundler extends MacBaseInstallerBundler { private static final String hdiutil = "/usr/bin/hdiutil"; - private void prepareDMGSetupScript(Map params) - throws IOException { + private void prepareDMGSetupScript(Path appLocation, + Map params) throws IOException { Path dmgSetup = getConfig_VolumeScript(params); Log.verbose(MessageFormat.format( I18N.getString("message.preparing-dmg-setup"), @@ -125,7 +127,9 @@ public class MacDmgBundler extends MacBaseInstallerBundler { data.put("DEPLOY_BG_FILE", bgFile.toString()); data.put("DEPLOY_VOLUME_PATH", volumePath.toString()); data.put("DEPLOY_APPLICATION_NAME", APP_NAME.fetchFrom(params)); - + String targetItem = (StandardBundlerParam.isRuntimeInstaller(params)) ? + APP_NAME.fetchFrom(params) : appLocation.getFileName().toString(); + data.put("DEPLOY_TARGET", targetItem); data.put("DEPLOY_INSTALL_LOCATION", getInstallDir(params, true)); createResource(DEFAULT_DMG_SETUP_SCRIPT, params) @@ -181,8 +185,8 @@ public class MacDmgBundler extends MacBaseInstallerBundler { } } - private boolean prepareConfigFiles(Map params) - throws IOException { + private boolean prepareConfigFiles(Path appLocation, + Map params) throws IOException { createResource(DEFAULT_BACKGROUND_IMAGE, params) .setCategory(I18N.getString("resource.dmg-background")) @@ -199,7 +203,7 @@ public class MacDmgBundler extends MacBaseInstallerBundler { prepareLicense(params); - prepareDMGSetupScript(params); + prepareDMGSetupScript(appLocation, params); return true; } @@ -313,7 +317,11 @@ public class MacDmgBundler extends MacBaseInstallerBundler { String hdiUtilVerbosityFlag = VERBOSE.fetchFrom(params) ? "-verbose" : "-quiet"; - + List dmgContent = DMG_CONTENT.fetchFrom(params); + for (String content : dmgContent) { + Path path = Path.of(content); + IOUtils.copyRecursive(path, srcFolder.resolve(path.getFileName())); + } // create temp image ProcessBuilder pb = new ProcessBuilder( hdiutil, diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/DMGsetup.scpt b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/DMGsetup.scpt index 37ddb68918c..967dffd5d24 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/DMGsetup.scpt +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/DMGsetup.scpt @@ -20,17 +20,24 @@ tell application "Finder" make new alias file at POSIX file "DEPLOY_VOLUME_PATH" to POSIX file "DEPLOY_INSTALL_LOCATION" with properties {name:"DEPLOY_INSTALL_LOCATION"} set allTheFiles to the name of every item of theWindow + set xpos to 120 repeat with theFile in allTheFiles set theFilePath to POSIX path of theFile + set appFilePath to POSIX path of "/DEPLOY_TARGET" if theFilePath is "DEPLOY_INSTALL_LOCATION" then -- Position install location set position of item theFile of theWindow to {390, 130} - else + else if theFilePath ends with appFilePath then -- Position application or runtime set position of item theFile of theWindow to {120, 130} + else + -- Position all other items in a second row. + set position of item theFile of theWindow to {xpos, 290} + set xpos to xpos + 150 end if end repeat + update theDisk without registering applications delay 5 close (get window of theDisk) diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java index cf1e1f5ce2c..dcc1911b0b2 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java @@ -179,6 +179,11 @@ public class Arguments { setOptionValue("resource-dir", resourceDir); }), + DMG_CONTENT ("mac-dmg-content", OptionCategories.PROPERTY, () -> { + List content = getArgumentList(popArg()); + content.forEach(a -> setOptionValue("mac-dmg-content", a)); + }), + ARGUMENTS ("arguments", OptionCategories.PROPERTY, () -> { List arguments = getArgumentList(popArg()); setOptionValue("arguments", arguments); @@ -625,6 +630,11 @@ public class Arguments { CLIOptions.JLINK_OPTIONS.getIdWithPrefix()); } } + if (allOptions.contains(CLIOptions.DMG_CONTENT) + && !("dmg".equals(type))) { + throw new PackagerException("ERR_InvalidTypeOption", + CLIOptions.DMG_CONTENT.getIdWithPrefix(), ptype); + } if (hasMainJar && hasMainModule) { throw new PackagerException("ERR_BothMainJarAndModule"); } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java index 68685af5c32..774c65e883e 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java @@ -294,6 +294,7 @@ public class DeployParams { StandardBundlerParam.ADD_MODULES.getID(), StandardBundlerParam.LIMIT_MODULES.getID(), StandardBundlerParam.FILE_ASSOCIATIONS.getID(), + StandardBundlerParam.DMG_CONTENT.getID(), StandardBundlerParam.APP_CONTENT.getID(), StandardBundlerParam.JLINK_OPTIONS.getID() )); @@ -307,8 +308,10 @@ public class DeployParams { String delim = "\n\n"; if (key.equals(StandardBundlerParam.MODULE_PATH.getID())) { delim = File.pathSeparator; - } else if (key.equals(StandardBundlerParam.ADD_MODULES.getID()) || - key.equals(StandardBundlerParam.APP_CONTENT.getID())) { + } else if ( + key.equals(StandardBundlerParam.DMG_CONTENT.getID()) || + key.equals(StandardBundlerParam.APP_CONTENT.getID()) || + key.equals(StandardBundlerParam.ADD_MODULES.getID())) { delim = ","; } bundlerArguments.put(key, existingValue + delim + value); diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java index ee0a92e710c..a8bcfb554b4 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java @@ -404,6 +404,15 @@ class StandardBundlerParam extends BundlerParamInfo { (s, p) -> Path.of(s) ); + @SuppressWarnings("unchecked") + static final BundlerParamInfo> DMG_CONTENT = + new StandardBundlerParam<>( + Arguments.CLIOptions.DMG_CONTENT.getId(), + (Class>) (Object)List.class, + p -> Collections.emptyList(), + (s, p) -> Arrays.asList(s.split(",")) + ); + @SuppressWarnings("unchecked") static final StandardBundlerParam> APP_CONTENT = new StandardBundlerParam<>( @@ -411,7 +420,6 @@ class StandardBundlerParam extends BundlerParamInfo { (Class>) (Object)List.class, p->Collections.emptyList(), (s, p) -> Arrays.asList(s.split(",")) - ); @SuppressWarnings("unchecked") diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java index d9198588841..6c0ebee16b1 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java @@ -119,6 +119,7 @@ class ValidOptions { options.put(CLIOptions.MAC_APP_STORE.getId(), USE.ALL); options.put(CLIOptions.MAC_CATEGORY.getId(), USE.ALL); options.put(CLIOptions.MAC_ENTITLEMENTS.getId(), USE.ALL); + options.put(CLIOptions.DMG_CONTENT.getId(), USE.INSTALL); } if (Platform.getPlatform() == Platform.LINUX) { diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java index 682b99886c5..9b6457ccc58 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/MacHelper.java @@ -62,11 +62,16 @@ public class MacHelper { final Path mountPoint = Path.of(plist.queryValue("mount-point")); try { - Path dmgImage = mountPoint.resolve(cmd.name() + - (cmd.isRuntime() ? "" : ".app")); - TKit.trace(String.format("Exploded [%s] in [%s] directory", - cmd.outputBundle(), dmgImage)); - ThrowingConsumer.toConsumer(consumer).accept(dmgImage); + // code here used to copy just or .app + // We now have option to include arbitrary content, so we copy + // everything in the mounted image. + String[] children = mountPoint.toFile().list(); + for (String child : children) { + Path childPath = mountPoint.resolve(child); + TKit.trace(String.format("Exploded [%s] in [%s] directory", + cmd.outputBundle(), childPath)); + ThrowingConsumer.toConsumer(consumer).accept(childPath); + } } finally { String cmdline[] = { "/usr/bin/hdiutil", diff --git a/test/jdk/tools/jpackage/macosx/DmgContentTest.java b/test/jdk/tools/jpackage/macosx/DmgContentTest.java new file mode 100644 index 00000000000..fcedc3c3bdc --- /dev/null +++ b/test/jdk/tools/jpackage/macosx/DmgContentTest.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2019, 2021, 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.nio.file.Path; +import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.PackageTest; +import jdk.jpackage.test.PackageType; +import jdk.jpackage.test.MacHelper; +import jdk.jpackage.test.TKit; + +import jdk.jpackage.test.Annotations.Parameter; +import jdk.jpackage.test.Annotations.Parameters; +import jdk.jpackage.test.Annotations.Test; + +import java.util.Collection; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; + +/* + * @test + * @summary jpackage with --type dmg --mac-dmg-content + * @library ../helpers + * @library /test/lib + * @library base + * @key jpackagePlatformPackage + * @build jdk.jpackage.test.* + * @build DmgContentTest + * @modules jdk.jpackage/jdk.jpackage.internal + * @requires (os.family == "mac") + * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * --jpt-run=DmgContentTest + */ +public class DmgContentTest { + + private static final String TEST_JAVA = TKit.TEST_SRC_ROOT.resolve( + "apps/PrintEnv.java").toString(); + private static final String TEST_DUKE = TKit.TEST_SRC_ROOT.resolve( + "apps/dukeplug.png").toString(); + private static final String TEST_DIR = TKit.TEST_SRC_ROOT.resolve( + "apps").toString(); + private static final String TEST_BAD = TKit.TEST_SRC_ROOT.resolve( + "non-existant").toString(); + + @Parameters + public static Collection input() { + List data = new ArrayList<>(); + data.addAll(List.of(new Object[][] { + {"0", PackageType.MAC_DMG, new String[] {TEST_JAVA, TEST_DUKE}}, + {"1", PackageType.MAC_PKG, new String[] {TEST_JAVA, TEST_DUKE}}, + {"1", PackageType.MAC_DMG, new String[] {TEST_JAVA, TEST_BAD}}, + {"0", PackageType.MAC_DMG, + new String[] {TEST_JAVA + "," + TEST_DUKE, TEST_DIR}}})); + return data; + } + + public DmgContentTest(String expected, PackageType type, String[] content) { + this.expected = Integer.parseInt(expected); + this.type = type; + this.content = content; + } + + @Test + public void test() { + new PackageTest() + .forTypes(type) + .configureHelloApp() + .addInitializer(cmd -> { + for (String arg : content) { + cmd.addArguments("--mac-dmg-content", arg); + } + }) + .addInstallVerifier(DmgContentTest::verifyDMG) + .setExpectedExitCode(expected) + .run(PackageTest.Action.CREATE_AND_UNPACK); + } + + private static void verifyDMG(JPackageCommand cmd) { + if (cmd.isPackageUnpacked()) { + Path installDir = cmd.appInstallationDirectory(); + Path dmgRoot = cmd.pathToUnpackedPackageFile(installDir) + .toAbsolutePath().getParent(); + TKit.assertFileExists(dmgRoot.resolve("PrintEnv.java")); + } + } + + private final int expected; + private final PackageType type; + private final String[] content; + +} -- GitLab From dd622e55c01966f8b2deddaba09164a0a302df2e Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 22 Oct 2021 12:47:35 +0000 Subject: [PATCH 041/890] 8275783: G1: fix incorrect region type documentation in HeapRegionType Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/heapRegionType.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/g1/heapRegionType.hpp b/src/hotspot/share/gc/g1/heapRegionType.hpp index 9f0f58f340b..74807c37746 100644 --- a/src/hotspot/share/gc/g1/heapRegionType.hpp +++ b/src/hotspot/share/gc/g1/heapRegionType.hpp @@ -58,8 +58,8 @@ private: // 01000 0 [16] Old Mask // // 10000 0 [32] Archive Mask - // 11100 0 [56] Open Archive - // 11100 1 [57] Closed Archive + // 10100 0 [40] Open Archive + // 10100 1 [41] Closed Archive // typedef enum { FreeTag = 0, -- GitLab From 4e647aa584cf12dae76e81e203ad4f1ebc08c1a2 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 22 Oct 2021 13:01:24 +0000 Subject: [PATCH 042/890] 8275416: G1: remove unnecessary make_referent_alive in precleaning phase Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 4 --- .../share/gc/shared/referenceProcessor.cpp | 28 ++++--------------- .../share/gc/shared/referenceProcessor.hpp | 24 ++++++++-------- 3 files changed, 16 insertions(+), 40 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index 0acfd809ff2..a768fce2292 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -1692,9 +1692,7 @@ void G1ConcurrentMark::preclean() { SuspendibleThreadSetJoiner joiner; - G1CMKeepAliveAndDrainClosure keep_alive(this, task(0), true /* is_serial */); BarrierEnqueueDiscoveredFieldClosure enqueue; - G1CMDrainMarkingStackClosure drain_mark_stack(this, task(0), true /* is_serial */); set_concurrency_and_phase(1, true); @@ -1704,9 +1702,7 @@ void G1ConcurrentMark::preclean() { // Precleaning is single threaded. Temporarily disable MT discovery. ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(rp, false); rp->preclean_discovered_references(rp->is_alive_non_header(), - &keep_alive, &enqueue, - &drain_mark_stack, &yield_cl, _gc_timer_cm); } diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index c8f7b8a68fc..b1b411e4119 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -1065,9 +1065,7 @@ bool ReferenceProcessor::has_discovered_references() { } void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_alive, - OopClosure* keep_alive, EnqueueDiscoveredFieldClosure* enqueue, - VoidClosure* complete_gc, YieldClosure* yield, GCTimer* gc_timer) { // These lists can be handled here in any order and, indeed, concurrently. @@ -1081,7 +1079,7 @@ void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_al return; } if (preclean_discovered_reflist(_discoveredSoftRefs[i], is_alive, - keep_alive, enqueue, complete_gc, yield)) { + enqueue, yield)) { log_reflist("SoftRef abort: ", _discoveredSoftRefs, _max_num_queues); return; } @@ -1098,7 +1096,7 @@ void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_al return; } if (preclean_discovered_reflist(_discoveredWeakRefs[i], is_alive, - keep_alive, enqueue, complete_gc, yield)) { + enqueue, yield)) { log_reflist("WeakRef abort: ", _discoveredWeakRefs, _max_num_queues); return; } @@ -1115,7 +1113,7 @@ void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_al return; } if (preclean_discovered_reflist(_discoveredFinalRefs[i], is_alive, - keep_alive, enqueue, complete_gc, yield)) { + enqueue, yield)) { log_reflist("FinalRef abort: ", _discoveredFinalRefs, _max_num_queues); return; } @@ -1132,7 +1130,7 @@ void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_al return; } if (preclean_discovered_reflist(_discoveredPhantomRefs[i], is_alive, - keep_alive, enqueue, complete_gc, yield)) { + enqueue, yield)) { log_reflist("PhantomRef abort: ", _discoveredPhantomRefs, _max_num_queues); return; } @@ -1141,22 +1139,11 @@ void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_al } } -// Walk the given discovered ref list, and remove all reference objects whose -// referents are still alive or NULL. NOTE: When we are precleaning the -// ref lists, we do not disable refs discovery to honor the correct semantics of -// java.lang.Reference. Therefore, as we iterate over the discovered list (DL) -// and drop elements from it, newly discovered refs can be discovered and added -// to the DL. Because precleaning is implemented single-threaded today, for -// each per-thread DL, the insertion of refs (calling `complete_gc`) happens -// after the iteration. The clear separation means no special synchronization -// is needed. bool ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, BoolObjectClosure* is_alive, - OopClosure* keep_alive, EnqueueDiscoveredFieldClosure* enqueue, - VoidClosure* complete_gc, YieldClosure* yield) { - DiscoveredListIterator iter(refs_list, keep_alive, is_alive, enqueue); + DiscoveredListIterator iter(refs_list, nullptr /* keep_alive */, is_alive, enqueue); while (iter.has_next()) { if (yield->should_return_fine_grain()) { return true; @@ -1168,17 +1155,12 @@ bool ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_lis iter.move_to_next(); } else if (iter.is_referent_alive()) { log_preclean_ref(iter, "reachable"); - // Remove Reference object from list iter.remove(); - // Keep alive its cohort. - iter.make_referent_alive(); iter.move_to_next(); } else { iter.next(); } } - // Close the reachable set - complete_gc->do_void(); if (iter.processed() > 0) { log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, diff --git a/src/hotspot/share/gc/shared/referenceProcessor.hpp b/src/hotspot/share/gc/shared/referenceProcessor.hpp index 4591352cee0..2ab68ab29fe 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp @@ -304,19 +304,19 @@ public: setup_policy(always_clear); } - // "Preclean" all the discovered reference lists by removing references that - // are active (e.g. due to the mutator calling enqueue()) or with NULL or - // strongly reachable referents. - // The first argument is a predicate on an oop that indicates - // its (strong) reachability and the fourth is a closure that - // may be used to incrementalize or abort the precleaning process. - // The caller is responsible for taking care of potential - // interference with concurrent operations on these lists - // (or predicates involved) by other threads. + // "Preclean" all the discovered reference lists by removing references whose + // referents are NULL or strongly reachable (`is_alive` returns true). + // Note: when a referent is strongly reachable, we assume it's already marked + // through, so this method doesn't perform (and doesn't need to) any marking + // work at all. Currently, this assumption holds because G1 uses SATB and the + // marking status of an object is *not* updated when `Reference.get()` is + // called. + // `yield` is a closure that may be used to incrementalize or abort the + // precleaning process. The caller is responsible for taking care of + // potential interference with concurrent operations on these lists (or + // predicates involved) by other threads. void preclean_discovered_references(BoolObjectClosure* is_alive, - OopClosure* keep_alive, EnqueueDiscoveredFieldClosure* enqueue, - VoidClosure* complete_gc, YieldClosure* yield, GCTimer* gc_timer); @@ -331,9 +331,7 @@ private: // Returns whether the operation should be aborted. bool preclean_discovered_reflist(DiscoveredList& refs_list, BoolObjectClosure* is_alive, - OopClosure* keep_alive, EnqueueDiscoveredFieldClosure* enqueue, - VoidClosure* complete_gc, YieldClosure* yield); // round-robin mod _num_queues (not: _not_ mod _max_num_queues) -- GitLab From 4dec8fc4cc2b1762fba554d0401da8be0d6d1166 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Fri, 22 Oct 2021 16:20:31 +0000 Subject: [PATCH 043/890] 8275645: [JVMCI] avoid unaligned volatile reads on AArch64 Reviewed-by: kvn, never --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 45 ++++++++++++++----- .../src/jdk/vm/ci/hotspot/CompilerToVM.java | 4 +- .../HotSpotConstantReflectionProvider.java | 4 +- .../HotSpotMemoryAccessProviderImpl.java | 8 ++-- .../ci/hotspot/HotSpotObjectConstantImpl.java | 8 ++-- .../test/MemoryAccessProviderData.java | 15 +++++++ 6 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 45d2ad1d2e4..8a89e5c182f 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -1891,7 +1891,20 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredMethods, (JNIEnv* env, jobject, jobjec return JVMCIENV->get_jobjectArray(methods); C2V_END -C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, jobject expected_type, long displacement, jboolean is_volatile, jobject kind_object)) +// Enforces volatile semantics for a non-volatile read. +class VolatileRead : public StackObj { + public: + VolatileRead() { + // Ensures a possibly volatile read is not reordered with a prior + // volatile write. + OrderAccess::storeload(); + } + ~VolatileRead() { + OrderAccess::acquire(); + } +}; + +C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, jobject expected_type, long displacement, jobject kind_object)) if (object == NULL || kind_object == NULL) { JVMCI_THROW_0(NullPointerException); } @@ -1975,15 +1988,25 @@ C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, } jlong value = 0; + + // Treat all reads as volatile for simplicity as this function can be used + // both for reading Java fields declared as volatile as well as for constant + // folding Unsafe.get* methods with volatile semantics. This is done by + // performing the volatile barrier operations around a call to an + // oopDesc::_field method. The oopDesc::_field_acquire method + // cannot be used since it does not support unaligned reads on all platforms + // (e.g., an unaligned ldar on AArch64 causes a SIGBUS). + + switch (basic_type) { - case T_BOOLEAN: value = is_volatile ? obj->bool_field_acquire(displacement) : obj->bool_field(displacement); break; - case T_BYTE: value = is_volatile ? obj->byte_field_acquire(displacement) : obj->byte_field(displacement); break; - case T_SHORT: value = is_volatile ? obj->short_field_acquire(displacement) : obj->short_field(displacement); break; - case T_CHAR: value = is_volatile ? obj->char_field_acquire(displacement) : obj->char_field(displacement); break; + case T_BOOLEAN: { VolatileRead vr; value = obj->bool_field(displacement); } break; + case T_BYTE: { VolatileRead vr; value = obj->byte_field(displacement); } break; + case T_SHORT: { VolatileRead vr; value = obj->short_field(displacement);} break; + case T_CHAR: { VolatileRead vr; value = obj->char_field(displacement); } break; case T_FLOAT: - case T_INT: value = is_volatile ? obj->int_field_acquire(displacement) : obj->int_field(displacement); break; + case T_INT: { VolatileRead vr; value = obj->int_field(displacement); } break; case T_DOUBLE: - case T_LONG: value = is_volatile ? obj->long_field_acquire(displacement) : obj->long_field(displacement); break; + case T_LONG: { VolatileRead vr; value = obj->long_field(displacement); } break; case T_OBJECT: { if (displacement == java_lang_Class::component_mirror_offset() && java_lang_Class::is_instance(obj()) && @@ -1993,7 +2016,9 @@ C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, return JVMCIENV->get_jobject(JVMCIENV->get_JavaConstant_NULL_POINTER()); } - oop value = is_volatile ? obj->obj_field_acquire(displacement) : obj->obj_field(displacement); + oop value; + { VolatileRead vr; value = obj->obj_field(displacement); } + if (value == NULL) { return JVMCIENV->get_jobject(JVMCIENV->get_JavaConstant_NULL_POINTER()); } else { @@ -2782,8 +2807,8 @@ JNINativeMethod CompilerToVM::methods[] = { {CC "boxPrimitive", CC "(" OBJECT ")" OBJECTCONSTANT, FN_PTR(boxPrimitive)}, {CC "getDeclaredConstructors", CC "(" HS_RESOLVED_KLASS ")[" RESOLVED_METHOD, FN_PTR(getDeclaredConstructors)}, {CC "getDeclaredMethods", CC "(" HS_RESOLVED_KLASS ")[" RESOLVED_METHOD, FN_PTR(getDeclaredMethods)}, - {CC "readFieldValue", CC "(" HS_RESOLVED_KLASS HS_RESOLVED_KLASS "JZLjdk/vm/ci/meta/JavaKind;)" JAVACONSTANT, FN_PTR(readFieldValue)}, - {CC "readFieldValue", CC "(" OBJECTCONSTANT HS_RESOLVED_KLASS "JZLjdk/vm/ci/meta/JavaKind;)" JAVACONSTANT, FN_PTR(readFieldValue)}, + {CC "readFieldValue", CC "(" HS_RESOLVED_KLASS HS_RESOLVED_KLASS "JLjdk/vm/ci/meta/JavaKind;)" JAVACONSTANT, FN_PTR(readFieldValue)}, + {CC "readFieldValue", CC "(" OBJECTCONSTANT HS_RESOLVED_KLASS "JLjdk/vm/ci/meta/JavaKind;)" JAVACONSTANT, FN_PTR(readFieldValue)}, {CC "isInstance", CC "(" HS_RESOLVED_KLASS OBJECTCONSTANT ")Z", FN_PTR(isInstance)}, {CC "isAssignableFrom", CC "(" HS_RESOLVED_KLASS HS_RESOLVED_KLASS ")Z", FN_PTR(isAssignableFrom)}, {CC "isTrustedForIntrinsics", CC "(" HS_RESOLVED_KLASS ")Z", FN_PTR(isTrustedForIntrinsics)}, diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index 06fc14d252b..032d21ca235 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -786,14 +786,14 @@ final class CompilerToVM { * object is exptected to be a subtype of {@code expectedType} and extra sanity checking is * performed on the offset and kind of the read being performed. */ - native JavaConstant readFieldValue(HotSpotResolvedObjectTypeImpl object, HotSpotResolvedObjectTypeImpl expectedType, long offset, boolean isVolatile, JavaKind kind); + native JavaConstant readFieldValue(HotSpotResolvedObjectTypeImpl object, HotSpotResolvedObjectTypeImpl expectedType, long offset, JavaKind kind); /** * Reads the current value of an instance field. If {@code expectedType} is non-null, then the * object is exptected to be a subtype of {@code expectedType} and extra sanity checking is * performed on the offset and kind of the read being performed. */ - native JavaConstant readFieldValue(HotSpotObjectConstantImpl object, HotSpotResolvedObjectTypeImpl expectedType, long offset, boolean isVolatile, JavaKind kind); + native JavaConstant readFieldValue(HotSpotObjectConstantImpl object, HotSpotResolvedObjectTypeImpl expectedType, long offset, JavaKind kind); /** * @see ResolvedJavaType#isInstance(JavaConstant) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index fa1b7d5b5be..7f7e7b7472e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -166,11 +166,11 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv if (hotspotField.isStatic()) { HotSpotResolvedObjectTypeImpl holder = (HotSpotResolvedObjectTypeImpl) hotspotField.getDeclaringClass(); if (holder.isInitialized()) { - return runtime().compilerToVm.readFieldValue(holder, (HotSpotResolvedObjectTypeImpl) hotspotField.getDeclaringClass(), hotspotField.getOffset(), field.isVolatile(), + return runtime().compilerToVm.readFieldValue(holder, (HotSpotResolvedObjectTypeImpl) hotspotField.getDeclaringClass(), hotspotField.getOffset(), hotspotField.getType().getJavaKind()); } } else if (receiver instanceof HotSpotObjectConstantImpl) { - return ((HotSpotObjectConstantImpl) receiver).readFieldValue(hotspotField, field.isVolatile()); + return ((HotSpotObjectConstantImpl) receiver).readFieldValue(hotspotField); } else if (receiver == null) { throw new NullPointerException("receiver is null"); } diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java index 50a71b54f91..95fd8c5b813 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java @@ -77,7 +77,8 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { throw new IllegalArgumentException(String.valueOf(bits)); } } - JavaConstant result = runtime().compilerToVm.readFieldValue((HotSpotObjectConstantImpl) baseConstant, null, initialDisplacement, true, readKind); + HotSpotObjectConstantImpl baseObject = (HotSpotObjectConstantImpl) baseConstant; + JavaConstant result = runtime().compilerToVm.readFieldValue(baseObject, null, initialDisplacement, readKind); if (result != null && kind != readKind) { return JavaConstant.forPrimitive(kind, result.asLong()); } @@ -108,7 +109,7 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { @Override public JavaConstant readObjectConstant(Constant base, long displacement) { if (base instanceof HotSpotObjectConstantImpl) { - return runtime.getCompilerToVM().readFieldValue((HotSpotObjectConstantImpl) base, null, displacement, true, JavaKind.Object); + return runtime.getCompilerToVM().readFieldValue((HotSpotObjectConstantImpl) base, null, displacement, JavaKind.Object); } if (base instanceof HotSpotMetaspaceConstant) { MetaspaceObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base); @@ -130,7 +131,7 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { public JavaConstant readNarrowOopConstant(Constant base, long displacement) { if (base instanceof HotSpotObjectConstantImpl) { assert runtime.getConfig().useCompressedOops; - JavaConstant res = runtime.getCompilerToVM().readFieldValue((HotSpotObjectConstantImpl) base, null, displacement, true, JavaKind.Object); + JavaConstant res = runtime.getCompilerToVM().readFieldValue((HotSpotObjectConstantImpl) base, null, displacement, JavaKind.Object); if (res != null) { return JavaConstant.NULL_POINTER.equals(res) ? HotSpotCompressedNullConstant.COMPRESSED_NULL : ((HotSpotObjectConstant) res).compress(); } @@ -147,7 +148,6 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { } } - @Override public Constant readKlassPointerConstant(Constant base, long displacement) { HotSpotResolvedObjectTypeImpl klass = readKlass(base, displacement, false); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java index 1bb41ef8f0b..695fe35afd2 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java @@ -72,7 +72,7 @@ abstract class HotSpotObjectConstantImpl implements HotSpotObjectConstant { } // read ConstantCallSite.isFrozen as a volatile field HotSpotResolvedJavaField field = HotSpotMethodHandleAccessProvider.Internals.instance().constantCallSiteFrozenField; - boolean isFrozen = readFieldValue(field, true /* volatile */).asBoolean(); + boolean isFrozen = readFieldValue(field).asBoolean(); // isFrozen true implies fully-initialized return isFrozen; } @@ -80,7 +80,7 @@ abstract class HotSpotObjectConstantImpl implements HotSpotObjectConstant { private HotSpotObjectConstantImpl readTarget() { // read CallSite.target as a volatile field HotSpotResolvedJavaField field = HotSpotMethodHandleAccessProvider.Internals.instance().callSiteTargetField; - return (HotSpotObjectConstantImpl) readFieldValue(field, true /* volatile */); + return (HotSpotObjectConstantImpl) readFieldValue(field); } @Override @@ -184,7 +184,7 @@ abstract class HotSpotObjectConstantImpl implements HotSpotObjectConstant { return (compressed ? "NarrowOop" : getJavaKind().getJavaName()) + "[" + runtime().reflection.formatString(this) + "]"; } - public JavaConstant readFieldValue(HotSpotResolvedJavaField field, boolean isVolatile) { + public JavaConstant readFieldValue(HotSpotResolvedJavaField field) { if (IS_IN_NATIVE_IMAGE && this instanceof DirectHotSpotObjectConstantImpl) { // cannot read fields from objects due to lack of // general reflection support in native image @@ -193,7 +193,7 @@ abstract class HotSpotObjectConstantImpl implements HotSpotObjectConstant { if (field.isStatic()) { return null; } - return runtime().compilerToVm.readFieldValue(this, (HotSpotResolvedObjectTypeImpl) field.getDeclaringClass(), field.getOffset(), isVolatile, field.getType().getJavaKind()); + return runtime().compilerToVm.readFieldValue(this, (HotSpotResolvedObjectTypeImpl) field.getDeclaringClass(), field.getOffset(), field.getType().getJavaKind()); } public ResolvedJavaType asJavaType() { diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java index b24f17d19f4..86994171407 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java @@ -77,6 +77,9 @@ public class MemoryAccessProviderData { for (KindData k : PRIMITIVE_KIND_DATA) { result.add(new Object[] {k.kind, TEST_CONSTANT, k.instanceFieldOffset, k.instanceFieldValue, Math.max(8, k.kind.getBitCount())}); result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, k.staticFieldOffset, k.staticFieldValue, Math.max(8, k.kind.getBitCount())}); + if (k.unalignedInstanceFieldValue != null) { + result.add(new Object[] {k.kind, TEST_CONSTANT, k.instanceFieldOffset - 1, k.unalignedInstanceFieldValue, Math.max(8, k.kind.getBitCount())}); + } } return result.toArray(new Object[result.size()][]); } @@ -170,6 +173,7 @@ public class MemoryAccessProviderData { final long staticFieldOffset; final JavaConstant instanceFieldValue; final JavaConstant staticFieldValue; + final JavaConstant unalignedInstanceFieldValue; KindData(JavaKind kind, Object testObject) { this.kind = kind; try { @@ -182,6 +186,17 @@ public class MemoryAccessProviderData { staticFieldOffset = UNSAFE.staticFieldOffset(staticField); instanceFieldValue = JavaConstant.forBoxedPrimitive(instanceField.get(testObject)); staticFieldValue = JavaConstant.forBoxedPrimitive(staticField.get(null)); + if (kind == JavaKind.Long) { + unalignedInstanceFieldValue = JavaConstant.forLong(UNSAFE.getLongUnaligned(testObject, instanceFieldOffset - 1)); + } else if (kind == JavaKind.Int) { + unalignedInstanceFieldValue = JavaConstant.forInt(UNSAFE.getIntUnaligned(testObject, instanceFieldOffset - 1)); + } else if (kind == JavaKind.Char) { + unalignedInstanceFieldValue = JavaConstant.forChar(UNSAFE.getCharUnaligned(testObject, instanceFieldOffset - 1)); + } else if (kind == JavaKind.Short) { + unalignedInstanceFieldValue = JavaConstant.forShort(UNSAFE.getShortUnaligned(testObject, instanceFieldOffset - 1)); + } else { + unalignedInstanceFieldValue = null; + } } catch (Exception e) { throw new Error("TESTBUG for kind " + kind, e); } -- GitLab From 88bbf3c2e6ac9f6d88cbb361cfbb4c16bb8eafc1 Mon Sep 17 00:00:00 2001 From: Wu Yan Date: Fri, 22 Oct 2021 16:23:25 +0000 Subject: [PATCH 044/890] 8273111: Default timezone should return zone ID if /etc/localtime is valid but not canonicalization on linux Co-authored-by: Sun Jianye Reviewed-by: naoto, mli --- .../unix/native/libjava/TimeZone_md.c | 32 +++- .../unix/native/libjava/canonicalize_md.c | 146 +-------------- src/java.base/unix/native/libjava/path_util.c | 169 ++++++++++++++++++ src/java.base/unix/native/libjava/path_util.h | 31 ++++ 4 files changed, 233 insertions(+), 145 deletions(-) create mode 100644 src/java.base/unix/native/libjava/path_util.c create mode 100644 src/java.base/unix/native/libjava/path_util.h diff --git a/src/java.base/unix/native/libjava/TimeZone_md.c b/src/java.base/unix/native/libjava/TimeZone_md.c index 94dfc207f96..2c82a2d6786 100644 --- a/src/java.base/unix/native/libjava/TimeZone_md.c +++ b/src/java.base/unix/native/libjava/TimeZone_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -38,6 +38,7 @@ #include "jvm.h" #include "TimeZone_md.h" +#include "path_util.h" static char *isFileIdentical(char* buf, size_t size, char *pathname); @@ -77,6 +78,33 @@ static const char *ETC_ENVIRONMENT_FILE = "/etc/environment"; #if defined(__linux__) || defined(MACOSX) +/* + * remove repeated path separators ('/') in the given 'path'. + */ +static void +removeDuplicateSlashes(char *path) +{ + char *left = path; + char *right = path; + char *end = path + strlen(path); + + for (; right < end; right++) { + // Skip sequence of multiple path-separators. + while (*right == '/' && *(right + 1) == '/') { + right++; + } + + while (*right != '\0' && !(*right == '/' && *(right + 1) == '/')) { + *left++ = *right++; + } + + if (*right == '\0') { + *left = '\0'; + break; + } + } +} + /* * Returns a pointer to the zone ID portion of the given zoneinfo file * name, or NULL if the given string doesn't contain "zoneinfo/". @@ -296,6 +324,8 @@ getPlatformTimeZoneID() return NULL; } linkbuf[len] = '\0'; + removeDuplicateSlashes(linkbuf); + collapse(linkbuf); tz = getZoneName(linkbuf); if (tz != NULL) { tz = strdup(tz); diff --git a/src/java.base/unix/native/libjava/canonicalize_md.c b/src/java.base/unix/native/libjava/canonicalize_md.c index 2bb896bf32d..0585aa3bbdf 100644 --- a/src/java.base/unix/native/libjava/canonicalize_md.c +++ b/src/java.base/unix/native/libjava/canonicalize_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2021, 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 @@ -33,155 +33,13 @@ #include #include #include -#if !defined(_ALLBSD_SOURCE) -#include -#endif #include "jdk_util.h" +#include "path_util.h" /* Note: The comments in this file use the terminology defined in the java.io.File class */ - -/* Check the given name sequence to see if it can be further collapsed. - Return zero if not, otherwise return the number of names in the sequence. */ - -static int -collapsible(char *names) -{ - char *p = names; - int dots = 0, n = 0; - - while (*p) { - if ((p[0] == '.') && ((p[1] == '\0') - || (p[1] == '/') - || ((p[1] == '.') && ((p[2] == '\0') - || (p[2] == '/'))))) { - dots = 1; - } - n++; - while (*p) { - if (*p == '/') { - p++; - break; - } - p++; - } - } - return (dots ? n : 0); -} - - -/* Split the names in the given name sequence, - replacing slashes with nulls and filling in the given index array */ - -static void -splitNames(char *names, char **ix) -{ - char *p = names; - int i = 0; - - while (*p) { - ix[i++] = p++; - while (*p) { - if (*p == '/') { - *p++ = '\0'; - break; - } - p++; - } - } -} - - -/* Join the names in the given name sequence, ignoring names whose index - entries have been cleared and replacing nulls with slashes as needed */ - -static void -joinNames(char *names, int nc, char **ix) -{ - int i; - char *p; - - for (i = 0, p = names; i < nc; i++) { - if (!ix[i]) continue; - if (i > 0) { - p[-1] = '/'; - } - if (p == ix[i]) { - p += strlen(p) + 1; - } else { - char *q = ix[i]; - while ((*p++ = *q++)); - } - } - *p = '\0'; -} - - -/* Collapse "." and ".." names in the given path wherever possible. - A "." name may always be eliminated; a ".." name may be eliminated if it - follows a name that is neither "." nor "..". This is a syntactic operation - that performs no filesystem queries, so it should only be used to cleanup - after invoking the realpath() procedure. */ - -static void -collapse(char *path) -{ - char *names = (path[0] == '/') ? path + 1 : path; /* Preserve first '/' */ - int nc; - char **ix; - int i, j; - char *p, *q; - - nc = collapsible(names); - if (nc < 2) return; /* Nothing to do */ - ix = (char **)alloca(nc * sizeof(char *)); - splitNames(names, ix); - - for (i = 0; i < nc; i++) { - int dots = 0; - - /* Find next occurrence of "." or ".." */ - do { - char *p = ix[i]; - if (p[0] == '.') { - if (p[1] == '\0') { - dots = 1; - break; - } - if ((p[1] == '.') && (p[2] == '\0')) { - dots = 2; - break; - } - } - i++; - } while (i < nc); - if (i >= nc) break; - - /* At this point i is the index of either a "." or a "..", so take the - appropriate action and then continue the outer loop */ - if (dots == 1) { - /* Remove this instance of "." */ - ix[i] = 0; - } - else { - /* If there is a preceding name, remove both that name and this - instance of ".."; otherwise, leave the ".." as is */ - for (j = i - 1; j >= 0; j--) { - if (ix[j]) break; - } - if (j < 0) continue; - ix[j] = 0; - ix[i] = 0; - } - /* i will be incremented at the top of the loop */ - } - - joinNames(names, nc, ix); -} - - /* Convert a pathname to canonical form. The input path is assumed to contain no duplicate slashes. On Solaris we can use realpath() to do most of the work, though once that's done we still must collapse any remaining "." and diff --git a/src/java.base/unix/native/libjava/path_util.c b/src/java.base/unix/native/libjava/path_util.c new file mode 100644 index 00000000000..0a47f11666b --- /dev/null +++ b/src/java.base/unix/native/libjava/path_util.c @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 +#if !defined(_ALLBSD_SOURCE) +#include +#endif + +#include "path_util.h" + +/* Check the given name sequence to see if it can be further collapsed. + Return zero if not, otherwise return the number of names in the sequence. */ + +static int +collapsible(char *names) +{ + char *p = names; + int dots = 0, n = 0; + + while (*p) { + if ((p[0] == '.') && ((p[1] == '\0') + || (p[1] == '/') + || ((p[1] == '.') && ((p[2] == '\0') + || (p[2] == '/'))))) { + dots = 1; + } + n++; + while (*p) { + if (*p == '/') { + p++; + break; + } + p++; + } + } + return (dots ? n : 0); +} + + +/* Split the names in the given name sequence, + replacing slashes with nulls and filling in the given index array */ + +static void +splitNames(char *names, char **ix) +{ + char *p = names; + int i = 0; + + while (*p) { + ix[i++] = p++; + while (*p) { + if (*p == '/') { + *p++ = '\0'; + break; + } + p++; + } + } +} + + +/* Join the names in the given name sequence, ignoring names whose index + entries have been cleared and replacing nulls with slashes as needed */ + +static void +joinNames(char *names, int nc, char **ix) +{ + int i; + char *p; + + for (i = 0, p = names; i < nc; i++) { + if (!ix[i]) continue; + if (i > 0) { + p[-1] = '/'; + } + if (p == ix[i]) { + p += strlen(p) + 1; + } else { + char *q = ix[i]; + while ((*p++ = *q++)); + } + } + *p = '\0'; +} + +/* Collapse "." and ".." names in the given path wherever possible. + A "." name may always be eliminated; a ".." name may be eliminated if it + follows a name that is neither "." nor "..". This is a syntactic operation + that performs no filesystem queries, so it should only be used to cleanup + after invoking the realpath() procedure. */ + +void +collapse(char *path) +{ + char *names = (path[0] == '/') ? path + 1 : path; /* Preserve first '/' */ + int nc; + char **ix; + int i, j; + char *p, *q; + + nc = collapsible(names); + if (nc < 2) return; /* Nothing to do */ + ix = (char **)alloca(nc * sizeof(char *)); + splitNames(names, ix); + + for (i = 0; i < nc; i++) { + int dots = 0; + + /* Find next occurrence of "." or ".." */ + do { + char *p = ix[i]; + if (p[0] == '.') { + if (p[1] == '\0') { + dots = 1; + break; + } + if ((p[1] == '.') && (p[2] == '\0')) { + dots = 2; + break; + } + } + i++; + } while (i < nc); + if (i >= nc) break; + + /* At this point i is the index of either a "." or a "..", so take the + appropriate action and then continue the outer loop */ + if (dots == 1) { + /* Remove this instance of "." */ + ix[i] = 0; + } + else { + /* If there is a preceding name, remove both that name and this + instance of ".."; otherwise, leave the ".." as is */ + for (j = i - 1; j >= 0; j--) { + if (ix[j]) break; + } + if (j < 0) continue; + ix[j] = 0; + ix[i] = 0; + } + /* i will be incremented at the top of the loop */ + } + + joinNames(names, nc, ix); +} diff --git a/src/java.base/unix/native/libjava/path_util.h b/src/java.base/unix/native/libjava/path_util.h new file mode 100644 index 00000000000..7b0fd5eb145 --- /dev/null +++ b/src/java.base/unix/native/libjava/path_util.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 PATH_UTIL_H +#define PATH_UTIL_H + +void collapse(char *path); + +#endif -- GitLab From 6523c558d92dedf350576126960dee6cff8f6067 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Fri, 22 Oct 2021 17:22:12 +0000 Subject: [PATCH 045/890] 8198336: java/awt/FontMetrics/FontCrash.java fails in headless mode Reviewed-by: serb --- .../share/classes/java/awt/Component.java | 11 ----- .../classes/sun/font/SunFontManager.java | 31 -------------- .../classes/sun/awt/windows/WToolkit.java | 13 ------ test/jdk/ProblemList.txt | 1 - test/jdk/java/awt/FontMetrics/FontCrash.java | 42 ------------------- 5 files changed, 98 deletions(-) delete mode 100644 test/jdk/java/awt/FontMetrics/FontCrash.java diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index d7c2340c564..ff522f5141a 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -3177,17 +3177,6 @@ public abstract class Component implements ImageObserver, MenuContainer, * @since 1.0 */ public FontMetrics getFontMetrics(Font font) { - // This is an unsupported hack, but left in for a customer. - // Do not remove. - FontManager fm = FontManagerFactory.getInstance(); - if (fm instanceof SunFontManager - && ((SunFontManager) fm).usePlatformFontMetrics()) { - - if (peer != null && - !(peer instanceof LightweightPeer)) { - return peer.getFontMetrics(font); - } - } return sun.font.FontDesignMetrics.getMetrics(font); } diff --git a/src/java.desktop/share/classes/sun/font/SunFontManager.java b/src/java.desktop/share/classes/sun/font/SunFontManager.java index 1942aacd997..4f36498f6e2 100644 --- a/src/java.desktop/share/classes/sun/font/SunFontManager.java +++ b/src/java.desktop/share/classes/sun/font/SunFontManager.java @@ -230,12 +230,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { /* Used to indicate required return type from toArray(..); */ private static String[] STR_ARRAY = new String[0]; - /** - * Deprecated, unsupported hack - actually invokes a bug! - * Left in for a customer, don't remove. - */ - private boolean usePlatformFontMetrics = false; - /** * Returns the global SunFontManager instance. This is similar to * {@link FontManagerFactory#getInstance()} but it returns a @@ -454,22 +448,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { } }); - boolean platformFont = AccessController.doPrivileged( - new PrivilegedAction() { - public Boolean run() { - String prop = System.getProperty("java2d.font.usePlatformFont"); - String env = System.getenv("JAVA2D_USEPLATFORMFONT"); - return "true".equals(prop) || env != null; - } - }); - - if (platformFont) { - usePlatformFontMetrics = true; - System.out.println("Enabling platform font metrics for win32. This is an unsupported option."); - System.out.println("This yields incorrect composite font metrics as reported by 1.1.x releases."); - System.out.println("It is appropriate only for use by applications which do not use any Java 2"); - System.out.println("functionality. This property will be removed in a later release."); - } } public Font2DHandle getNewComposite(String family, int style, @@ -2188,15 +2166,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { } } - /* - * Workaround for apps which are dependent on a font metrics bug - * in JDK 1.1. This is an unsupported win32 private setting. - * Left in for a customer - do not remove. - */ - public boolean usePlatformFontMetrics() { - return usePlatformFontMetrics; - } - public int getNumFonts() { return physicalFonts.size()+maxCompFont; } diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java index 745c2d6d8c0..f01ae946020 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java @@ -684,19 +684,6 @@ public final class WToolkit extends SunToolkit implements Runnable { private native Insets getScreenInsets(int screen); - - @Override - public FontMetrics getFontMetrics(Font font) { - // This is an unsupported hack, but left in for a customer. - // Do not remove. - FontManager fm = FontManagerFactory.getInstance(); - if (fm instanceof SunFontManager - && ((SunFontManager) fm).usePlatformFontMetrics()) { - return WFontMetrics.getFontMetrics(font); - } - return super.getFontMetrics(font); - } - @Override public FontPeer getFontPeer(String name, int style) { FontPeer retval = null; diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index f0c86a57d7e..4ff821ac3ba 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -237,7 +237,6 @@ java/awt/Window/AlwaysOnTop/AutoTestOnTop.java 6847593 linux-all java/awt/Window/GrabSequence/GrabSequence.java 6848409 macosx-all,linux-all java/awt/Window/LocationAtScreenCorner/LocationAtScreenCorner.java 8203371 linux-all java/awt/font/TextLayout/TextLayoutBounds.java 8169188 generic-all -java/awt/FontMetrics/FontCrash.java 8198336 windows-all java/awt/image/BufferedImage/ICMColorDataTest/ICMColorDataTest.java 8233028 generic-all java/awt/image/DrawImage/IncorrectAlphaSurface2SW.java 8056077 linux-all java/awt/image/multiresolution/MultiresolutionIconTest.java 8169187,8252812 macosx-all,windows-all,linux-x64 diff --git a/test/jdk/java/awt/FontMetrics/FontCrash.java b/test/jdk/java/awt/FontMetrics/FontCrash.java deleted file mode 100644 index f4359637f95..00000000000 --- a/test/jdk/java/awt/FontMetrics/FontCrash.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2017, 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 8172999 - * @summary Verify no crash loading font metrics instance. - * @run main/othervm FontCrash - */ -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Toolkit; - -public class FontCrash { - - public static void main(String[] args) { - System.setProperty("java2d.font.usePlatformFont", "true"); - Font f = new Font(Font.DIALOG,Font.PLAIN,12); - Toolkit tk = Toolkit.getDefaultToolkit(); - tk.getFontMetrics(f); - } -} -- GitLab From fec470f262d1df581f2a5fc2f0bdfea66757a8ad Mon Sep 17 00:00:00 2001 From: Hai-May Chao Date: Fri, 22 Oct 2021 20:53:38 +0000 Subject: [PATCH 046/890] 8272163: Add -version option to keytool and jarsigner Reviewed-by: weijun --- .../sun/security/tools/keytool/Main.java | 9 +- .../sun/security/tools/keytool/Resources.java | 1 + .../sun/security/tools/jarsigner/Main.java | 21 ++++ .../security/tools/jarsigner/Resources.java | 4 + .../security/tools/jarsigner/VersionTest.java | 107 ++++++++++++++++++ .../security/tools/keytool/VersionTest.java | 72 ++++++++++++ 6 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 test/jdk/sun/security/tools/jarsigner/VersionTest.java create mode 100644 test/jdk/sun/security/tools/keytool/VersionTest.java diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/src/java.base/share/classes/sun/security/tools/keytool/Main.java index 57078637a94..2db773ed61d 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -262,6 +262,7 @@ public final class Main { ADDPROVIDER, PROVIDERCLASS, PROVIDERPATH, V), SHOWINFO("showinfo.command.help", TLS, V), + VERSION("Prints.the.program.version"), // Undocumented start here, KEYCLONE is used a marker in -help; @@ -717,7 +718,7 @@ public final class Main { } boolean isKeyStoreRelated(Command cmd) { - return cmd != PRINTCERTREQ && cmd != SHOWINFO; + return cmd != PRINTCERTREQ && cmd != SHOWINFO && cmd != VERSION; } /** @@ -1337,6 +1338,8 @@ public final class Main { doPrintCRL(filename, out); } else if (command == SHOWINFO) { doShowInfo(); + } else if (command == VERSION) { + doPrintVersion(); } // If we need to save the keystore, do so. @@ -2794,6 +2797,10 @@ public final class Main { } } + private void doPrintVersion() { + System.out.println("keytool " + System.getProperty("java.version")); + } + private Collection generateCertificates(InputStream in) throws CertificateException, IOException { byte[] data = in.readAllBytes(); diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java index 30294ad4e08..2733e45aeea 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java @@ -97,6 +97,7 @@ public class Resources extends java.util.ListResourceBundle { {"Changes.the.store.password.of.a.keystore", "Changes the store password of a keystore"}, //-storepasswd {"showinfo.command.help", "Displays security-related information"}, + {"Prints.the.program.version", "Prints the program version"}, // keytool: help: options {"alias.name.of.the.entry.to.process", diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java index 139243a61ad..83383823303 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java @@ -163,6 +163,7 @@ public class Main { String tSAPolicyID; String tSADigestAlg; boolean verify = false; // verify the jar + boolean version = false; // print the program version String verbose = null; // verbose output when signing/verifying boolean showcerts = false; // show certs when verifying boolean debug = false; // debug @@ -479,6 +480,8 @@ public class Main { externalSF = false; } else if (collator.compare(flags, "-verify") ==0) { verify = true; + } else if (collator.compare(flags, "-version") ==0) { + version = true; } else if (collator.compare(flags, "-verbose") ==0) { verbose = (modifier != null) ? modifier : "all"; } else if (collator.compare(flags, "-sigalg") ==0) { @@ -506,6 +509,14 @@ public class Main { } } + /* + * When `-version` is specified but `-help` is not specified, jarsigner + * will only print the program version and ignore other options if any. + */ + if (version) { + doPrintVersion(); + } + // -certs must always be specified with -verbose if (verbose == null) showcerts = false; @@ -597,11 +608,18 @@ public class Main { System.exit(1); } + static void doPrintVersion() { + System.out.println("jarsigner " + System.getProperty("java.version")); + System.exit(0); + } + static void fullusage() { System.out.println(rb.getString ("Usage.jarsigner.options.jar.file.alias")); System.out.println(rb.getString (".jarsigner.verify.options.jar.file.alias.")); + System.out.println(rb.getString + (".jarsigner.version")); System.out.println(); System.out.println(rb.getString (".keystore.url.keystore.location")); @@ -633,6 +651,9 @@ public class Main { System.out.println(rb.getString (".verify.verify.a.signed.JAR.file")); System.out.println(); + System.out.println(rb.getString + (".version.print.the.program.version")); + System.out.println(); System.out.println(rb.getString (".verbose.suboptions.verbose.output.when.signing.verifying.")); System.out.println(rb.getString diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java index 2b74856b7ce..45e56f4d049 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java @@ -57,6 +57,8 @@ public class Resources extends java.util.ListResourceBundle { "Usage: jarsigner [options] jar-file alias"}, {".jarsigner.verify.options.jar.file.alias.", " jarsigner -verify [options] jar-file [alias...]"}, + {".jarsigner.version", + " jarsigner -version"}, {".keystore.url.keystore.location", "[-keystore ] keystore location"}, {".storepass.password.password.for.keystore.integrity", @@ -77,6 +79,8 @@ public class Resources extends java.util.ListResourceBundle { "[-sigalg ] name of signature algorithm"}, {".verify.verify.a.signed.JAR.file", "[-verify] verify a signed JAR file"}, + {".version.print.the.program.version", + "[-version] print the program version"}, {".verbose.suboptions.verbose.output.when.signing.verifying.", "[-verbose[:suboptions]] verbose output when signing/verifying."}, {".suboptions.can.be.all.grouped.or.summary", diff --git a/test/jdk/sun/security/tools/jarsigner/VersionTest.java b/test/jdk/sun/security/tools/jarsigner/VersionTest.java new file mode 100644 index 00000000000..588a22d17de --- /dev/null +++ b/test/jdk/sun/security/tools/jarsigner/VersionTest.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021, 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 8272163 + * @summary jarsigner -version test + * @library /test/lib + */ + +import jdk.test.lib.SecurityTools; +import jdk.test.lib.util.JarUtils; +import java.nio.file.Path; + +public class VersionTest { + + public static void main(String[] args) throws Exception { + SecurityTools.jarsigner("-version") + .shouldContain("jarsigner") + .shouldHaveExitValue(0); + + SecurityTools.jarsigner("-version -erropt") + .shouldContain("Illegal option: -erropt") + .shouldContain("Please type jarsigner --help for usage") + .shouldHaveExitValue(1); + + SecurityTools.jarsigner("-verify -erropt") + .shouldContain("Illegal option: -erropt") + .shouldContain("Please type jarsigner --help for usage") + .shouldHaveExitValue(1); + + SecurityTools.jarsigner("-version --help") + .shouldContain("Usage: jarsigner [options] jar-file alias") + .shouldContain("[-verify] verify a signed JAR file") + .shouldContain("[-version] print the program version") + .shouldHaveExitValue(0); + + SecurityTools.jarsigner("--help -version") + .shouldContain("Usage: jarsigner [options] jar-file alias") + .shouldContain("[-verify] verify a signed JAR file") + .shouldContain("[-version] print the program version") + .shouldHaveExitValue(0); + + SecurityTools.jarsigner("-verify --help") + .shouldContain("Usage: jarsigner [options] jar-file alias") + .shouldContain("[-verify] verify a signed JAR file") + .shouldContain("[-version] print the program version") + .shouldHaveExitValue(0); + + SecurityTools.jarsigner("--help") + .shouldContain("Usage: jarsigner [options] jar-file alias") + .shouldContain("[-verify] verify a signed JAR file") + .shouldContain("[-version] print the program version") + .shouldHaveExitValue(0); + + SecurityTools.jarsigner() + .shouldContain("Usage: jarsigner [options] jar-file alias") + .shouldContain("[-verify] verify a signed JAR file") + .shouldContain("[-version] print the program version") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-genkeypair -keystore ks -storepass changeit" + + " -keyalg rsa -dname CN=ee -alias ee") + .shouldHaveExitValue(0); + + JarUtils.createJarFile(Path.of("a.jar"), Path.of("."), Path.of(".")); + + /* + * -version is specified but -help is not specified, jarsigner + * will only print the program version and ignore other options. + */ + SecurityTools.jarsigner("-keystore ks -storepass changeit" + + " -signedjar signeda.jar a.jar ee -version") + .shouldNotContain("jar signed.") + .shouldContain("jarsigner ") + .shouldHaveExitValue(0); + + /* + * -version is specified but -help is not specified, jarsigner + * will only print the program version and ignore other options. + */ + SecurityTools.jarsigner("-version -verify a.jar") + .shouldNotContain("jar is unsigned.") + .shouldContain("jarsigner ") + .shouldHaveExitValue(0); + } +} diff --git a/test/jdk/sun/security/tools/keytool/VersionTest.java b/test/jdk/sun/security/tools/keytool/VersionTest.java new file mode 100644 index 00000000000..a6406f0d46d --- /dev/null +++ b/test/jdk/sun/security/tools/keytool/VersionTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021, 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 8272163 + * @summary keytool -version test + * @library /test/lib + */ + +import jdk.test.lib.SecurityTools; + +public class VersionTest { + + public static void main(String[] args) throws Exception { + SecurityTools.keytool("-version") + .shouldContain("keytool") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-version -erropt") + .shouldContain("Illegal option: -erropt") + .shouldContain("Prints the program version") + .shouldContain("Use \"keytool -?, -h, or --help\" for this help message") + .shouldHaveExitValue(1); + + SecurityTools.keytool("-genkeypair -erropt") + .shouldContain("Illegal option: -erropt") + .shouldContain("Generates a key pair") + .shouldContain("Use \"keytool -?, -h, or --help\" for this help message") + .shouldHaveExitValue(1); + + SecurityTools.keytool("-version --help") + .shouldContain("Prints the program version") + .shouldContain("Use \"keytool -?, -h, or --help\" for this help message") + .shouldHaveExitValue(0); + + SecurityTools.keytool("--help -version") + .shouldContain("Prints the program version") + .shouldContain("Use \"keytool -?, -h, or --help\" for this help message") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-genkeypair --help") + .shouldContain("Generates a key pair") + .shouldContain("Use \"keytool -?, -h, or --help\" for this help message") + .shouldHaveExitValue(0); + + SecurityTools.keytool("--help") + .shouldContain("-genkeypair Generates a key pair") + .shouldContain("-version Prints the program version") + .shouldHaveExitValue(0); + } +} -- GitLab From c94dc2ab60f0548afa868e41a0b87a68030e0cac Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Sat, 23 Oct 2021 03:59:55 +0000 Subject: [PATCH 047/890] 8272854: split runtime/CommandLine/PrintTouchedMethods.java test Reviewed-by: iklam --- .../CommandLine/PrintTouchedMethods.java | 24 +++------ .../CommandLine/PrintTouchedMethodsJcmd.java | 50 +++++++++++++++++++ 2 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java diff --git a/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java b/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java index e3c675eedc5..a5900132b75 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java +++ b/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethods.java @@ -28,8 +28,7 @@ * @modules java.base/jdk.internal.misc * java.management * @library /test/lib - * @compile TestLogTouchedMethods.java PrintTouchedMethods.java - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+LogTouchedMethods PrintTouchedMethods + * @run driver PrintTouchedMethods */ import java.io.File; @@ -45,7 +44,7 @@ public class PrintTouchedMethods { "-XX:-UnlockDiagnosticVMOptions", "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", - "TestLogTouchedMethods"); + TestLogTouchedMethods.class.getName()); // UnlockDiagnostic turned off, should fail OutputAnalyzer output = new OutputAnalyzer(pb.start()); @@ -57,7 +56,7 @@ public class PrintTouchedMethods { "-XX:+UnlockDiagnosticVMOptions", "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", - "TestLogTouchedMethods"); + TestLogTouchedMethods.class.getName()); output = new OutputAnalyzer(pb.start()); // check order: // 1 "# Method::print_touched_methods version 1" is the first in first line @@ -84,7 +83,7 @@ public class PrintTouchedMethods { "-Xint", "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", - "TestLogTouchedMethods"); + TestLogTouchedMethods.class.getName()); output = new OutputAnalyzer(pb.start()); lines = output.asLines(); @@ -107,7 +106,7 @@ public class PrintTouchedMethods { "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", "-XX:-TieredCompilation", - "TestLogTouchedMethods"); + TestLogTouchedMethods.class.getName()); output = new OutputAnalyzer(pb.start()); lines = output.asLines(); @@ -123,16 +122,5 @@ public class PrintTouchedMethods { output.shouldContain("TestLogTouchedMethods.methodA:()V"); output.shouldNotContain("TestLogTouchedMethods.methodB:()V"); output.shouldHaveExitValue(0); - - // Test jcmd PrintTouchedMethods VM.print_touched_methods - String pid = Long.toString(ProcessTools.getProcessId()); - pb = new ProcessBuilder(); - pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.print_touched_methods"}); - output = new OutputAnalyzer(pb.start()); - try { - output.shouldContain("PrintTouchedMethods.main:([Ljava/lang/String;)V"); - } catch (RuntimeException e) { - output.shouldContain("Unknown diagnostic command"); - } - } + } } diff --git a/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java b/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java new file mode 100644 index 00000000000..f3188007941 --- /dev/null +++ b/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2015, 2021, 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 8025692 + * @summary Test jcmd PrintTouchedMethods VM.print_touched_methods + * @modules java.base/jdk.internal.misc + * java.management + * @library /test/lib + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+LogTouchedMethods PrintTouchedMethodsJcmd + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.JDKToolFinder; + +public class PrintTouchedMethodsJcmd { + + public static void main(String args[]) throws Exception { + var pid = Long.toString(ProcessHandle.current().pid()); + var pb = new ProcessBuilder(); + pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.print_touched_methods"}); + var output = new OutputAnalyzer(pb.start()); + try { + output.shouldContain("PrintTouchedMethodsJcmd.main:([Ljava/lang/String;)V"); + } catch (RuntimeException e) { + output.shouldContain("Unknown diagnostic command"); + } + } +} -- GitLab From 5bbe4cae8746765d2ce965b06fd1e5cf512326ae Mon Sep 17 00:00:00 2001 From: Sergey Tsypanov Date: Sat, 23 Oct 2021 21:07:58 +0000 Subject: [PATCH 048/890] 8275293: A change done with JDK-8268764 mismatches the java.rmi.server.ObjID.hashCode spec Reviewed-by: rriggs, smarks --- src/java.rmi/share/classes/java/rmi/server/ObjID.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.rmi/share/classes/java/rmi/server/ObjID.java b/src/java.rmi/share/classes/java/rmi/server/ObjID.java index 335123b8e95..ae3a61277ec 100644 --- a/src/java.rmi/share/classes/java/rmi/server/ObjID.java +++ b/src/java.rmi/share/classes/java/rmi/server/ObjID.java @@ -201,7 +201,7 @@ public final class ObjID implements Serializable { */ @Override public int hashCode() { - return Long.hashCode(objNum); + return (int) objNum; } /** -- GitLab From 5dab76b939e381312ce5c89b9aebca628238a387 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Mon, 25 Oct 2021 01:03:51 +0000 Subject: [PATCH 049/890] 8275381: G1: refactor 2 constructors of G1CardSetConfiguration Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1CardSet.cpp | 72 ++++++++++----------- src/hotspot/share/gc/g1/g1CardSet.hpp | 18 ++++-- test/hotspot/gtest/gc/g1/test_g1CardSet.cpp | 12 +++- 3 files changed, 56 insertions(+), 46 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index 8c40a361dab..4b91dc54092 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -45,51 +45,47 @@ G1CardSet::CardSetPtr G1CardSet::FullCardSet = (G1CardSet::CardSetPtr)-1; G1CardSetConfiguration::G1CardSetConfiguration() : - _inline_ptr_bits_per_card(HeapRegion::LogCardsPerRegion) { - - // Array of Cards card set container size calculation - _num_cards_in_array = G1RemSetArrayOfCardsEntries; - - // Full card set container size calculation - _max_cards_in_card_set = (uint)HeapRegion::CardsPerRegion; - assert(is_power_of_2(_max_cards_in_card_set), - "max_cards_in_card_set must be a power of 2: %u", _max_cards_in_card_set); - _cards_in_howl_threshold = _max_cards_in_card_set * (double)G1RemSetCoarsenHowlToFullPercent / 100; - - // Howl card set container size calculation. - _num_buckets_in_howl = G1RemSetHowlNumBuckets; - - // Howl Bitmap card set container size calculation. - _num_cards_in_howl_bitmap = G1CardSetHowl::bitmap_size(_max_cards_in_card_set, _num_buckets_in_howl); - _log2_num_cards_in_howl_bitmap = log2i_exact(_num_cards_in_howl_bitmap); - _cards_in_howl_bitmap_threshold = _num_cards_in_howl_bitmap * (double)G1RemSetCoarsenHowlBitmapToHowlFullPercent / 100; - _bitmap_hash_mask = ~(~(0) << _log2_num_cards_in_howl_bitmap); - - init_card_set_alloc_options(); - - log_configuration(); -} + G1CardSetConfiguration(HeapRegion::LogCardsPerRegion, /* inline_ptr_bits_per_card */ + G1RemSetArrayOfCardsEntries, /* num_cards_in_array */ + (double)G1RemSetCoarsenHowlBitmapToHowlFullPercent / 100, /* cards_in_bitmap_threshold_percent */ + G1RemSetHowlNumBuckets, /* num_buckets_in_howl */ + (double)G1RemSetCoarsenHowlToFullPercent / 100, /* cards_in_howl_threshold_percent */ + (uint)HeapRegion::CardsPerRegion) /* max_cards_in_cardset */ + { } + +G1CardSetConfiguration::G1CardSetConfiguration(uint num_cards_in_array, + double cards_in_bitmap_threshold_percent, + uint max_buckets_in_howl, + double cards_in_howl_threshold_percent, + uint max_cards_in_card_set) : + G1CardSetConfiguration(log2i_exact(max_cards_in_card_set), /* inline_ptr_bits_per_card */ + num_cards_in_array, /* num_cards_in_array */ + cards_in_bitmap_threshold_percent, /* cards_in_bitmap_threshold_percent */ + G1CardSetHowl::num_buckets(max_cards_in_card_set, /* num_buckets_in_howl */ + num_cards_in_array, + max_buckets_in_howl), + cards_in_howl_threshold_percent, /* cards_in_howl_threshold_percent */ + max_cards_in_card_set) /* max_cards_in_cardset */ + { } G1CardSetConfiguration::G1CardSetConfiguration(uint inline_ptr_bits_per_card, uint num_cards_in_array, - double cards_in_bitmap_threshold, - uint max_buckets_in_howl, - double cards_in_howl_threshold, - uint max_cards_in_cardset) : + double cards_in_bitmap_threshold_percent, + uint num_buckets_in_howl, + double cards_in_howl_threshold_percent, + uint max_cards_in_card_set) : _inline_ptr_bits_per_card(inline_ptr_bits_per_card), _num_cards_in_array(num_cards_in_array), - _max_cards_in_card_set(max_cards_in_cardset), - _cards_in_howl_threshold(max_cards_in_cardset * cards_in_howl_threshold) { + _num_buckets_in_howl(num_buckets_in_howl), + _max_cards_in_card_set(max_cards_in_card_set), + _cards_in_howl_threshold(max_cards_in_card_set * cards_in_howl_threshold_percent), + _num_cards_in_howl_bitmap(G1CardSetHowl::bitmap_size(_max_cards_in_card_set, _num_buckets_in_howl)), + _cards_in_howl_bitmap_threshold(_num_cards_in_howl_bitmap * cards_in_bitmap_threshold_percent), + _log2_num_cards_in_howl_bitmap(log2i_exact(_num_cards_in_howl_bitmap)), + _bitmap_hash_mask(~(~(0) << _log2_num_cards_in_howl_bitmap)) { assert(is_power_of_2(_max_cards_in_card_set), - "max_cards_in_card_set must be a power of 2: %u", _max_cards_in_card_set); - - _num_buckets_in_howl = G1CardSetHowl::num_buckets(_max_cards_in_card_set, _num_cards_in_array, max_buckets_in_howl); - - _num_cards_in_howl_bitmap = G1CardSetHowl::bitmap_size(_max_cards_in_card_set, _num_buckets_in_howl); - _cards_in_howl_bitmap_threshold = _num_cards_in_howl_bitmap * cards_in_bitmap_threshold; - _log2_num_cards_in_howl_bitmap = log2i_exact(_num_cards_in_howl_bitmap); - _bitmap_hash_mask = ~(~(0) << _log2_num_cards_in_howl_bitmap); + "max_cards_in_card_set must be a power of 2: %u", _max_cards_in_card_set); init_card_set_alloc_options(); diff --git a/src/hotspot/share/gc/g1/g1CardSet.hpp b/src/hotspot/share/gc/g1/g1CardSet.hpp index c2a533d42a0..3589ef4988e 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.hpp @@ -51,16 +51,22 @@ class G1CardSetConfiguration { uint _inline_ptr_bits_per_card; uint _num_cards_in_array; - uint _num_cards_in_howl_bitmap; uint _num_buckets_in_howl; uint _max_cards_in_card_set; uint _cards_in_howl_threshold; + uint _num_cards_in_howl_bitmap; uint _cards_in_howl_bitmap_threshold; uint _log2_num_cards_in_howl_bitmap; size_t _bitmap_hash_mask; G1CardSetAllocOptions* _card_set_alloc_options; + G1CardSetConfiguration(uint inline_ptr_bits_per_card, + uint num_cards_in_array, + double cards_in_bitmap_threshold_percent, + uint num_buckets_in_howl, + double cards_in_howl_threshold_percent, + uint max_cards_in_card_set); void init_card_set_alloc_options(); void log_configuration(); @@ -69,12 +75,12 @@ public: // Initialize card set configuration from globals. G1CardSetConfiguration(); // Initialize card set configuration from parameters. - G1CardSetConfiguration(uint inline_ptr_bits_per_card, - uint num_cards_in_array, - double cards_in_bitmap_threshold, + // Only for test + G1CardSetConfiguration(uint num_cards_in_array, + double cards_in_bitmap_threshold_percent, uint max_buckets_in_howl, - double cards_in_howl_threshold, - uint max_cards_in_cardset); + double cards_in_howl_threshold_percent, + uint max_cards_in_card_set); ~G1CardSetConfiguration(); diff --git a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp index cbfb5d58aed..d535248c39d 100644 --- a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp +++ b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp @@ -206,7 +206,11 @@ void G1CardSetTest::cardset_basic_test() { const double FullCardSetThreshold = 0.8; const double BitmapCoarsenThreshold = 0.9; - G1CardSetConfiguration config(log2i_exact(CardsPerRegion), 28, BitmapCoarsenThreshold, 8, FullCardSetThreshold, CardsPerRegion); + G1CardSetConfiguration config(28, + BitmapCoarsenThreshold, + 8, + FullCardSetThreshold, + CardsPerRegion); G1CardSetFreePool free_pool(config.num_mem_object_types()); G1CardSetMemoryManager mm(&config, &free_pool); @@ -420,7 +424,11 @@ void G1CardSetTest::cardset_mt_test() { const double FullCardSetThreshold = 1.0; const uint BitmapCoarsenThreshold = 1.0; - G1CardSetConfiguration config(log2i_exact(CardsPerRegion), 120, BitmapCoarsenThreshold, 8, FullCardSetThreshold, CardsPerRegion); + G1CardSetConfiguration config(120, + BitmapCoarsenThreshold, + 8, + FullCardSetThreshold, + CardsPerRegion); G1CardSetFreePool free_pool(config.num_mem_object_types()); G1CardSetMemoryManager mm(&config, &free_pool); -- GitLab From 1da5e6b0e2c284c5dd295a0d48cc1c6c2fecf5b5 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 25 Oct 2021 07:25:19 +0000 Subject: [PATCH 050/890] 8275104: IR framework does not handle client VM builds correctly Reviewed-by: kvn, thartmann --- .../lib/ir_framework/flag/FlagVM.java | 3 +- .../lib/ir_framework/test/TestVM.java | 21 +++++-- .../ir_framework/examples/IRExample.java | 4 +- .../ir_framework/tests/TestCompLevels.java | 15 +++-- .../tests/TestDIgnoreCompilerControls.java | 57 ++++++++----------- .../ir_framework/tests/TestIRMatching.java | 2 +- .../ir_framework/tests/TestSanity.java | 6 +- .../tests/TestWithHelperClasses.java | 2 +- 8 files changed, 61 insertions(+), 49 deletions(-) diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/flag/FlagVM.java b/test/hotspot/jtreg/compiler/lib/ir_framework/flag/FlagVM.java index 52e3b93fbcb..8ab39c02867 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/flag/FlagVM.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/flag/FlagVM.java @@ -27,6 +27,7 @@ import compiler.lib.ir_framework.CompLevel; import compiler.lib.ir_framework.TestFramework; import compiler.lib.ir_framework.shared.TestFrameworkException; import compiler.lib.ir_framework.shared.TestRunException; +import jdk.test.lib.Platform; import jdk.test.lib.process.ProcessTools; import sun.hotspot.WhiteBox; @@ -72,7 +73,7 @@ public class FlagVM { private static final boolean EXCLUDE_RANDOM = Boolean.getBoolean("ExcludeRandom"); private static final boolean FLIP_C1_C2 = Boolean.getBoolean("FlipC1C2"); private static final boolean REQUESTED_VERIFY_IR = Boolean.parseBoolean(System.getProperty("VerifyIR", "true")); - private static final boolean VERIFY_IR = REQUESTED_VERIFY_IR && USE_COMPILER && !EXCLUDE_RANDOM && !FLIP_C1_C2 && !TEST_C1; + private static final boolean VERIFY_IR = REQUESTED_VERIFY_IR && USE_COMPILER && !EXCLUDE_RANDOM && !FLIP_C1_C2 && !TEST_C1 && Platform.isServer(); private static String[] getPrintFlags() { return new String[] {"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions"}; diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java index 51d6c7add41..0ed89a1f633 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java @@ -74,8 +74,18 @@ public class TestVM { public static final int WARMUP_ITERATIONS = Integer.parseInt(System.getProperty("Warmup", "2000")); private static final boolean TIERED_COMPILATION = (Boolean)WHITE_BOX.getVMFlag("TieredCompilation"); - private static final CompLevel TIERED_COMPILATION_STOP_AT_LEVEL = CompLevel.forValue(((Long)WHITE_BOX.getVMFlag("TieredStopAtLevel")).intValue()); - public static final boolean TEST_C1 = TIERED_COMPILATION && TIERED_COMPILATION_STOP_AT_LEVEL.getValue() < CompLevel.C2.getValue(); + private static final CompLevel TIERED_COMPILATION_STOP_AT_LEVEL; + private static final boolean CLIENT_VM = Platform.isClient(); + + static { + CompLevel level = CompLevel.forValue(((Long)WHITE_BOX.getVMFlag("TieredStopAtLevel")).intValue()); + if (CLIENT_VM && level == CompLevel.C2) { + // No C2 available, use C1 level without profiling. + level = CompLevel.C1_SIMPLE; + } + TIERED_COMPILATION_STOP_AT_LEVEL = level; + } + public static final boolean TEST_C1 = (TIERED_COMPILATION && TIERED_COMPILATION_STOP_AT_LEVEL.getValue() < CompLevel.C2.getValue()) || CLIENT_VM; static final boolean XCOMP = Platform.isComp(); static final boolean VERBOSE = Boolean.getBoolean("Verbose"); @@ -562,10 +572,13 @@ public class TestVM { // Use highest available compilation level by default (usually C2). compLevel = TIERED_COMPILATION_STOP_AT_LEVEL; } - if (!TIERED_COMPILATION && compLevel.getValue() < CompLevel.C2.getValue()) { + if (TEST_C1 && compLevel == CompLevel.C2) { + return CompLevel.SKIP; + } + if ((!TIERED_COMPILATION && !CLIENT_VM) && compLevel.getValue() < CompLevel.C2.getValue()) { return CompLevel.SKIP; } - if (TIERED_COMPILATION && compLevel.getValue() > TIERED_COMPILATION_STOP_AT_LEVEL.getValue()) { + if ((TIERED_COMPILATION || CLIENT_VM) && compLevel.getValue() > TIERED_COMPILATION_STOP_AT_LEVEL.getValue()) { return CompLevel.SKIP; } return compLevel; diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java index 8d8e5b31bc1..950cca3844f 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/IRExample.java @@ -95,8 +95,8 @@ public class IRExample { // Only apply this rule if the VM flag UseZGC is true @IR(applyIf = {"UseZGC", "true"}, failOn = IRNode.LOAD) // We can also use comparators (<, <=, >, >=, !=, =) to restrict the rules. - // This rule is only applied if the loop unroll limit is 10 or greater. - @IR(applyIf = {"LoopUnrollLimit", ">= 10"}, failOn = IRNode.LOAD) + // This rule is only applied if TypeProfileLevel is 100 or greater. + @IR(applyIf = {"TypeProfileLevel", ">= 100"}, failOn = IRNode.LOAD) public void goodFailOn() { iFld = 42; // No load, no loop, no store to iFld2, no store to class Foo } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompLevels.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompLevels.java index b6007af7872..ac754b70fe1 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompLevels.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompLevels.java @@ -25,6 +25,7 @@ package ir_framework.tests; import compiler.lib.ir_framework.*; import compiler.lib.ir_framework.test.TestVM; +import jdk.test.lib.Platform; import java.lang.reflect.Method; @@ -57,10 +58,12 @@ public class TestCompLevels { } } TestFramework framework = new TestFramework(TestNoTiered.class); - framework.setDefaultWarmup(10).addFlags("-XX:-TieredCompilation").start(); - framework = new TestFramework(TestNoTiered.class); - framework.setDefaultWarmup(10).addScenarios(new Scenario(0, "-XX:-TieredCompilation")).start(); - framework = new TestFramework(TestStopAtLevel1.class); + if (!Platform.isClient()) { + framework.setDefaultWarmup(10).addFlags("-XX:-TieredCompilation").start(); + framework = new TestFramework(TestNoTiered.class); + framework.setDefaultWarmup(10).addScenarios(new Scenario(0, "-XX:-TieredCompilation")).start(); + framework = new TestFramework(TestStopAtLevel1.class); + } framework.setDefaultWarmup(10).addFlags("-XX:TieredStopAtLevel=1").start(); framework = new TestFramework(TestStopAtLevel1.class); framework.setDefaultWarmup(10).addScenarios(new Scenario(0, "-XX:TieredStopAtLevel=1")).start(); @@ -119,7 +122,9 @@ class TestNoTiered { @Check(test = "level1") public void check1(TestInfo info) { - TestFramework.assertNotCompiled(info.getTest()); // Never compiled without C1 + if (!Platform.isClient()) { + TestFramework.assertNotCompiled(info.getTest()); // Never compiled without C1 + } } @Test(compLevel = CompLevel.C1_LIMITED_PROFILE) diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDIgnoreCompilerControls.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDIgnoreCompilerControls.java index 47a6ae6e310..4c99e96b944 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDIgnoreCompilerControls.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestDIgnoreCompilerControls.java @@ -24,6 +24,7 @@ package ir_framework.tests; import compiler.lib.ir_framework.*; +import compiler.lib.ir_framework.driver.TestVMException; import jdk.test.lib.Asserts; import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; @@ -39,51 +40,43 @@ import sun.hotspot.WhiteBox; */ public class TestDIgnoreCompilerControls { - public static void main(String[] args) throws Exception { - if (args.length != 0) { - TestFramework.run(); - } else { - OutputAnalyzer oa = run("true"); - oa.shouldHaveExitValue(0); - oa = run("false"); - oa.shouldNotHaveExitValue(0); - Asserts.assertTrue(oa.getOutput().contains("fail run"), "did not find run: " + oa.getOutput()); - Asserts.assertTrue(oa.getOutput().contains("fail check"), "did not find check" + oa.getOutput()); + public static void main(String[] args) { + // Ignore Compiler Control + TestFramework.runWithFlags("-XX:CompileCommand=option,ir_framework.tests.TestDIgnoreCompilerControls::test2,bool,PrintInlining,true", + "-DIgnoreCompilerControls=true"); + Asserts.assertFalse(TestFramework.getLastTestVMOutput().contains("don't inline by annotation"), "should have inlined: " + + TestFramework.getLastTestVMOutput()); + // Don't ignore compiler control, sanity check + try { + TestFramework.runWithFlags("-XX:CompileCommand=option,ir_framework.tests.TestDIgnoreCompilerControls::test2,bool,PrintInlining,true", + "-DIgnoreCompilerControls=false"); + throw new RuntimeException("should throw exception"); + } catch (TestVMException e) { + Asserts.assertTrue(e.getExceptionInfo().contains("fail run"), "did not find exception with msg \"fail run\""); + Asserts.assertTrue(TestFramework.getLastTestVMOutput().contains("don't inline by annotation"), "should not have inlined: " + TestFramework.getLastTestVMOutput()); } } - private static OutputAnalyzer run(String flagValue) throws Exception { - OutputAnalyzer oa; - ProcessBuilder process = ProcessTools.createJavaProcessBuilder( - "-Dtest.class.path=" + Utils.TEST_CLASS_PATH, "-Dtest.jdk=" + Utils.TEST_JDK, - "-Dtest.vm.opts=-DIgnoreCompilerControls=" + flagValue, - "ir_framework.tests.TestDIgnoreCompilerControls", flagValue); - oa = ProcessTools.executeProcess(process); - return oa; - } - @Test - public void test() { } + public void test() {} + + @ForceCompile + public void ignoredForceCompile() {} @Run(test = "test") @Warmup(10000) public void run(RunInfo info) throws NoSuchMethodException { if (!info.isWarmUp()) { - // Should be compiled with -DIgnoreCompilerControls=true - Asserts.assertTrue(WhiteBox.getWhiteBox().isMethodCompiled(getClass().getDeclaredMethod("run", RunInfo.class)), "fail run"); + Asserts.assertFalse(WhiteBox.getWhiteBox().isMethodCompiled(getClass().getDeclaredMethod("ignoredForceCompile")), "fail run"); } } + @DontInline + public void ignoreDontInline() {} + @Test @Warmup(10000) - public void test2() {} - - - @Check(test = "test2") - public void check(TestInfo info) throws NoSuchMethodException { - if (!info.isWarmUp()) { - // Should be compiled with -DIgnoreCompilerControls=true - Asserts.assertTrue(WhiteBox.getWhiteBox().isMethodCompiled(getClass().getDeclaredMethod("check", TestInfo.class)), "fail check"); - } + public void test2() { + ignoreDontInline(); // Is inlined and therefore not compiled separately. } } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java index 892f44bccd0..f4ce560d2f4 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestIRMatching.java @@ -37,7 +37,7 @@ import java.util.regex.Pattern; /* * @test - * @requires vm.debug == true & vm.compMode != "Xint" & vm.compiler2.enabled & vm.flagless + * @requires vm.debug == true & vm.compMode != "Xint" & vm.compiler1.enabled & vm.compiler2.enabled & vm.flagless * @summary Test IR matcher with different default IR node regexes. Use -DPrintIREncoding. * Normally, the framework should be called with driver. * @library /test/lib /testlibrary_tests / diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSanity.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSanity.java index 77f8a157363..eada87241f9 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSanity.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSanity.java @@ -67,12 +67,12 @@ public class TestSanity { testFramework = new TestFramework(); testFramework.addScenarios(sDefault).addScenarios(s1, s2).start(); testFramework = new TestFramework(); - testFramework.addHelperClasses(HelperA.class).addScenarios(sDefault).addFlags("-XX:+UseSuperWord").start(); + testFramework.addHelperClasses(HelperA.class).addScenarios(sDefault).addFlags("-XX:+UseTLAB").start(); testFramework = new TestFramework(); - testFramework.addHelperClasses(HelperA.class).addFlags("-XX:+UseSuperWord", "-XX:+UseCompiler").addScenarios(sDefault) + testFramework.addHelperClasses(HelperA.class).addFlags("-XX:+UseTLAB", "-XX:+UseCompiler").addScenarios(sDefault) .addHelperClasses(HelperB.class, HelperC.class).addScenarios(s1, s2).addFlags("-XX:+TieredCompilation").start(); testFramework = new TestFramework(); - testFramework.addHelperClasses(HelperA.class).addFlags("-XX:+UseSuperWord", "-XX:+UseCompiler").addScenarios(sDefault) + testFramework.addHelperClasses(HelperA.class).addFlags("-XX:+UseTLAB", "-XX:+UseCompiler").addScenarios(sDefault) .addHelperClasses(HelperB.class, HelperC.class).addScenarios(s1, s2).setDefaultWarmup(200) .addFlags("-XX:+TieredCompilation").start(); } diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestWithHelperClasses.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestWithHelperClasses.java index f2359bf5900..391b681bd36 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestWithHelperClasses.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestWithHelperClasses.java @@ -30,7 +30,7 @@ import jdk.test.lib.Asserts; /* * @test - * @requires vm.flagless + * @requires vm.flagless & vm.compiler1.enabled & vm.compiler2.enabled * @summary Test the framework with helper classes. * @library /test/lib / * @run driver ir_framework.tests.TestWithHelperClasses -- GitLab From f6232982b91cb2314e96ddbde3984836a810a556 Mon Sep 17 00:00:00 2001 From: Alexey Bakhtin Date: Mon, 25 Oct 2021 08:00:40 +0000 Subject: [PATCH 051/890] 8271199: Mutual TLS handshake fails signing client certificate with custom sensitive PKCS11 key Reviewed-by: xuelei, valeriep --- .../sun/security/rsa/RSAPSSSignature.java | 72 +++++++++++++++---- .../security/rsa/RSAPrivateCrtKeyImpl.java | 23 +++--- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java b/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java index be275733b9b..994d9f14cce 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java @@ -123,12 +123,14 @@ public class RSAPSSSignature extends SignatureSpi { @Override protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException { - if (!(publicKey instanceof RSAPublicKey)) { + if (publicKey instanceof RSAPublicKey rsaPubKey) { + isPublicKeyValid(rsaPubKey); + this.pubKey = rsaPubKey; + this.privKey = null; + resetDigest(); + } else { throw new InvalidKeyException("key must be RSAPublicKey"); } - this.pubKey = (RSAPublicKey) isValid((RSAKey)publicKey); - this.privKey = null; - resetDigest(); } // initialize for signing. See JCA doc @@ -142,14 +144,16 @@ public class RSAPSSSignature extends SignatureSpi { @Override protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { - if (!(privateKey instanceof RSAPrivateKey)) { + if (privateKey instanceof RSAPrivateKey rsaPrivateKey) { + isPrivateKeyValid(rsaPrivateKey); + this.privKey = rsaPrivateKey; + this.pubKey = null; + this.random = + (random == null ? JCAUtil.getSecureRandom() : random); + resetDigest(); + } else { throw new InvalidKeyException("key must be RSAPrivateKey"); } - this.privKey = (RSAPrivateKey) isValid((RSAKey)privateKey); - this.pubKey = null; - this.random = - (random == null? JCAUtil.getSecureRandom() : random); - resetDigest(); } /** @@ -201,11 +205,56 @@ public class RSAPSSSignature extends SignatureSpi { } } + /** + * Validate the specified RSAPrivateKey + */ + private void isPrivateKeyValid(RSAPrivateKey prKey) throws InvalidKeyException { + try { + if (prKey instanceof RSAPrivateCrtKey crtKey) { + if (RSAPrivateCrtKeyImpl.checkComponents(crtKey)) { + RSAKeyFactory.checkRSAProviderKeyLengths( + crtKey.getModulus().bitLength(), + crtKey.getPublicExponent()); + } else { + throw new InvalidKeyException( + "Some of the CRT-specific components are not available"); + } + } else { + RSAKeyFactory.checkRSAProviderKeyLengths( + prKey.getModulus().bitLength(), + null); + } + } catch (InvalidKeyException ikEx) { + throw ikEx; + } catch (Exception e) { + throw new InvalidKeyException( + "Can not access private key components", e); + } + isValid(prKey); + } + + /** + * Validate the specified RSAPublicKey + */ + private void isPublicKeyValid(RSAPublicKey pKey) throws InvalidKeyException { + try { + RSAKeyFactory.checkRSAProviderKeyLengths( + pKey.getModulus().bitLength(), + pKey.getPublicExponent()); + } catch (InvalidKeyException ikEx) { + throw ikEx; + } catch (Exception e) { + throw new InvalidKeyException( + "Can not access public key components", e); + } + isValid(pKey); + } + /** * Validate the specified RSAKey and its associated parameters against * internal signature parameters. */ - private RSAKey isValid(RSAKey rsaKey) throws InvalidKeyException { + private void isValid(RSAKey rsaKey) throws InvalidKeyException { AlgorithmParameterSpec keyParams = rsaKey.getParams(); // validate key parameters if (!isCompatible(rsaKey.getParams(), this.sigParams)) { @@ -232,7 +281,6 @@ public class RSAPSSSignature extends SignatureSpi { ("Unrecognized digest algo: " + digestAlgo); } } - return rsaKey; } /** diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java index 640b221bdfe..fbc9fda05fa 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java @@ -91,16 +91,11 @@ public final class RSAPrivateCrtKeyImpl RSAKeyFactory.checkKeyAlgo(key, type.keyAlgo); // check all CRT-specific components are available, if any one // missing, return a non-CRT key instead - if ((key.getPublicExponent().signum() == 0) || - (key.getPrimeExponentP().signum() == 0) || - (key.getPrimeExponentQ().signum() == 0) || - (key.getPrimeP().signum() == 0) || - (key.getPrimeQ().signum() == 0) || - (key.getCrtCoefficient().signum() == 0)) { + if (checkComponents(key)) { + return key; + } else { return new RSAPrivateKeyImpl(key.type, key.keyParams, key.getModulus(), key.getPrivateExponent()); - } else { - return key; } case "PKCS#1": try { @@ -124,6 +119,18 @@ public final class RSAPrivateCrtKeyImpl } } + /** + * Validate if all CRT-specific components are available. + */ + static boolean checkComponents(RSAPrivateCrtKey key) { + return !((key.getPublicExponent().signum() == 0) || + (key.getPrimeExponentP().signum() == 0) || + (key.getPrimeExponentQ().signum() == 0) || + (key.getPrimeP().signum() == 0) || + (key.getPrimeQ().signum() == 0) || + (key.getCrtCoefficient().signum() == 0)); + } + /** * Generate a new key from the specified type and components. * Returns a CRT key if possible and a non-CRT key otherwise. -- GitLab From 0bcc1749eaea20cb983a983073ad33d305681879 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 25 Oct 2021 09:07:51 +0000 Subject: [PATCH 052/890] 8275717: Reimplement STATIC_ASSERT to use static_assert Reviewed-by: stuefe, eosterlund, kbarrett --- src/hotspot/share/utilities/debug.hpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/hotspot/share/utilities/debug.hpp b/src/hotspot/share/utilities/debug.hpp index 11b79f3cb6c..7e3f71a9dff 100644 --- a/src/hotspot/share/utilities/debug.hpp +++ b/src/hotspot/share/utilities/debug.hpp @@ -174,22 +174,7 @@ void report_untested(const char* file, int line, const char* message); void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2); -// Compile-time asserts. Cond must be a compile-time constant expression that -// is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration -// may appear. -// -// Implementation Note: STATIC_ASSERT_FAILURE provides a value member -// rather than type member that could be used directly in the typedef, because -// a type member would require conditional use of "typename", depending on -// whether Cond is dependent or not. The use of a value member leads to the -// use of an array type. - -template struct STATIC_ASSERT_FAILURE; -template<> struct STATIC_ASSERT_FAILURE { enum { value = 1 }; }; - -#define STATIC_ASSERT(Cond) \ - typedef char PASTE_TOKENS(STATIC_ASSERT_DUMMY_TYPE_, __LINE__)[ \ - STATIC_ASSERT_FAILURE< (Cond) >::value ] +#define STATIC_ASSERT(Cond) static_assert((Cond), #Cond) // out of memory reporting void report_java_out_of_memory(const char* message); -- GitLab From 7f94302ceca001ded89ba9a653bf176ef90b16cd Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 25 Oct 2021 13:18:20 +0000 Subject: [PATCH 053/890] 8275511: G1: Rename needs_remset_update to remset_is_tracked in G1HeapRegionAttr Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 8 ++--- src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 2 +- .../share/gc/g1/g1CollectedHeap.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectionSet.cpp | 4 +-- src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp | 30 +++++++++---------- .../gc/g1/g1ParScanThreadState.inline.hpp | 6 ++-- src/hotspot/share/gc/g1/g1RemSet.cpp | 2 +- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 0f48780483c..ee47e55f9d2 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -2693,15 +2693,15 @@ bool G1CollectedHeap::is_potential_eager_reclaim_candidate(HeapRegion* r) const } #ifndef PRODUCT -void G1CollectedHeap::verify_region_attr_remset_update() { +void G1CollectedHeap::verify_region_attr_remset_is_tracked() { class VerifyRegionAttrRemSet : public HeapRegionClosure { public: virtual bool do_heap_region(HeapRegion* r) { G1CollectedHeap* g1h = G1CollectedHeap::heap(); - bool const needs_remset_update = g1h->region_attr(r->bottom()).needs_remset_update(); - assert(r->rem_set()->is_tracked() == needs_remset_update, + bool const remset_is_tracked = g1h->region_attr(r->bottom()).remset_is_tracked(); + assert(r->rem_set()->is_tracked() == remset_is_tracked, "Region %u remset tracking status (%s) different to region attribute (%s)", - r->hrm_index(), BOOL_TO_STR(r->rem_set()->is_tracked()), BOOL_TO_STR(needs_remset_update)); + r->hrm_index(), BOOL_TO_STR(r->rem_set()->is_tracked()), BOOL_TO_STR(remset_is_tracked)); return false; } } cl; diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index fe3a0fe4dae..80cc82c4af8 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -620,7 +620,7 @@ public: // Verify that the G1RegionAttr remset tracking corresponds to actual remset tracking // for all regions. - void verify_region_attr_remset_update() PRODUCT_RETURN; + void verify_region_attr_remset_is_tracked() PRODUCT_RETURN; bool is_user_requested_concurrent_full_gc(GCCause::Cause cause); diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp index 0fef0a94449..2e0f6028a5d 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp @@ -189,7 +189,7 @@ void G1CollectedHeap::register_new_survivor_region_with_region_attr(HeapRegion* } void G1CollectedHeap::register_region_with_region_attr(HeapRegion* r) { - _region_attr.set_has_remset(r->hrm_index(), r->rem_set()->is_tracked()); + _region_attr.set_remset_is_tracked(r->hrm_index(), r->rem_set()->is_tracked()); } void G1CollectedHeap::register_old_region_with_region_attr(HeapRegion* r) { diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.cpp b/src/hotspot/share/gc/g1/g1CollectionSet.cpp index 9c385a0de44..f44679f8aae 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp +++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp @@ -513,7 +513,7 @@ bool G1CollectionSet::finalize_optional_for_evacuation(double remaining_pause_ti stop_incremental_building(); - _g1h->verify_region_attr_remset_update(); + _g1h->verify_region_attr_remset_is_tracked(); return num_selected_regions > 0; } @@ -530,7 +530,7 @@ void G1CollectionSet::abandon_optional_collection_set(G1ParScanThreadStateSet* p } free_optional_regions(); - _g1h->verify_region_attr_remset_update(); + _g1h->verify_region_attr_remset_is_tracked(); } #ifdef ASSERT diff --git a/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp b/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp index 3bb7c02b88d..2b8fb3532ee 100644 --- a/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp +++ b/src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp @@ -39,12 +39,12 @@ public: #else typedef int8_t region_type_t; #endif - // _needs_remset_update_t is essentially bool, but we need precise control + // remset_is_tracked_t is essentially bool, but we need precise control // on the size, and sizeof(bool) is implementation specific. - typedef uint8_t needs_remset_update_t; + typedef uint8_t remset_is_tracked_t; private: - needs_remset_update_t _needs_remset_update; + remset_is_tracked_t _remset_is_tracked; region_type_t _type; public: @@ -65,8 +65,8 @@ public: static const region_type_t Old = 1; // The region is in the collection set and an old region. static const region_type_t Num = 2; - G1HeapRegionAttr(region_type_t type = NotInCSet, bool needs_remset_update = false) : - _needs_remset_update(needs_remset_update), _type(type) { + G1HeapRegionAttr(region_type_t type = NotInCSet, bool remset_is_tracked = false) : + _remset_is_tracked(remset_is_tracked), _type(type) { assert(is_valid(), "Invalid type %d", _type); } @@ -85,7 +85,7 @@ public: } } - bool needs_remset_update() const { return _needs_remset_update != 0; } + bool remset_is_tracked() const { return _remset_is_tracked != 0; } void set_new_survivor() { _type = NewSurvivor; } void set_old() { _type = Old; } @@ -93,7 +93,7 @@ public: assert(is_humongous() || !is_in_cset(), "must be"); _type = NotInCSet; } - void set_has_remset(bool value) { _needs_remset_update = value ? 1 : 0; } + void set_remset_is_tracked(bool value) { _remset_is_tracked = value ? 1 : 0; } bool is_in_cset_or_humongous() const { return is_in_cset() || is_humongous(); } bool is_in_cset() const { return type() >= Young; } @@ -126,10 +126,10 @@ class G1HeapRegionAttrBiasedMappedArray : public G1BiasedMappedArrayset_new_survivor(); } - void set_humongous(uintptr_t index, bool needs_remset_update) { + void set_humongous(uintptr_t index, bool remset_is_tracked) { assert(get_by_index(index).is_default(), "Region attributes at index " INTPTR_FORMAT " should be default but is %s", index, get_by_index(index).get_type_str()); - set_by_index(index, G1HeapRegionAttr(G1HeapRegionAttr::Humongous, needs_remset_update)); + set_by_index(index, G1HeapRegionAttr(G1HeapRegionAttr::Humongous, remset_is_tracked)); } void clear_humongous(uintptr_t index) { get_ref_by_index(index)->clear_humongous(); } - void set_has_remset(uintptr_t index, bool needs_remset_update) { - get_ref_by_index(index)->set_has_remset(needs_remset_update); + void set_remset_is_tracked(uintptr_t index, bool remset_is_tracked) { + get_ref_by_index(index)->set_remset_is_tracked(remset_is_tracked); } void set_in_young(uintptr_t index) { @@ -158,10 +158,10 @@ class G1HeapRegionAttrBiasedMappedArray : public G1BiasedMappedArray void G1ParScanThreadState::enqueue_card_if_tracked(G1HeapRegi #ifdef ASSERT HeapRegion* const hr_obj = _g1h->heap_region_containing(o); - assert(region_attr.needs_remset_update() == hr_obj->rem_set()->is_tracked(), + assert(region_attr.remset_is_tracked() == hr_obj->rem_set()->is_tracked(), "State flag indicating remset tracking disagrees (%s) with actual remembered set (%s) for region %u", - BOOL_TO_STR(region_attr.needs_remset_update()), + BOOL_TO_STR(region_attr.remset_is_tracked()), BOOL_TO_STR(hr_obj->rem_set()->is_tracked()), hr_obj->hrm_index()); #endif - if (!region_attr.needs_remset_update()) { + if (!region_attr.remset_is_tracked()) { return; } size_t card_index = ct()->index_for(p); diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index 30eabfa957a..b64a6dcd254 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -1289,7 +1289,7 @@ class G1MergeHeapRootsTask : public WorkerTask { r->rem_set()->set_state_complete(); #ifdef ASSERT G1HeapRegionAttr region_attr = g1h->region_attr(r->hrm_index()); - assert(region_attr.needs_remset_update(), "must be"); + assert(region_attr.remset_is_tracked(), "must be"); #endif assert(r->rem_set()->is_empty(), "At this point any humongous candidate remembered set must be empty."); -- GitLab From f143d2a88e1972cdce9eb6f61c2eb9754cb89251 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Mon, 25 Oct 2021 14:24:05 +0000 Subject: [PATCH 054/890] 8268595: java/io/Serializable/serialFilter/GlobalFilterTest.java#id1 failed in timeout Reviewed-by: chegar, rriggs --- .../Serializable/serialFilter/GlobalFilterTest.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/test/jdk/java/io/Serializable/serialFilter/GlobalFilterTest.java b/test/jdk/java/io/Serializable/serialFilter/GlobalFilterTest.java index 8e011088b78..0852cf96cbb 100644 --- a/test/jdk/java/io/Serializable/serialFilter/GlobalFilterTest.java +++ b/test/jdk/java/io/Serializable/serialFilter/GlobalFilterTest.java @@ -53,18 +53,6 @@ import org.testng.annotations.DataProvider; * * @summary Test Global Filters */ - -/* @test - * @bug 8261160 - * @summary Add a deserialization JFR event - * @build GlobalFilterTest SerialFilterTest - * @requires vm.hasJFR - * @run testng/othervm/policy=security.policy - * -XX:StartFlightRecording:name=DeserializationEvent,dumponexit=true - * -Djava.security.properties=${test.src}/java.security-extra1 - * -Djava.security.debug=properties GlobalFilterTest - */ - @Test public class GlobalFilterTest { private static final String serialPropName = "jdk.serialFilter"; -- GitLab From f610ef0dbc17cd3066da799a02f7f5e977261d44 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Mon, 25 Oct 2021 14:27:17 +0000 Subject: [PATCH 055/890] 8196440: Regression automated Test 'java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java' fails Reviewed-by: serb, psadhukhan --- test/jdk/ProblemList.txt | 1 - .../awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 4ff821ac3ba..cfb2f4b56bc 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -221,7 +221,6 @@ java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java 8150540 windows-all java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 8150540 windows-all java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8150540 windows-all,macosx-all java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 8150540 windows-all -java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java 8196440 linux-all java/awt/Window/ShapedAndTranslucentWindows/SetShapeAndClick.java 8197936 macosx-all java/awt/Window/ShapedAndTranslucentWindows/SetShapeDynamicallyAndClick.java 8013450 macosx-all diff --git a/test/jdk/java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java b/test/jdk/java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java index 909d9e79528..8f31652c4c1 100644 --- a/test/jdk/java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java +++ b/test/jdk/java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -54,6 +54,10 @@ public class PopupMenuLeakTest { static final AtomicReference> popupWeakReference = new AtomicReference<>(); static ExtendedRobot robot; public static void main(String[] args) throws Exception { + if (!SystemTray.isSupported()) { + System.out.println("SystemTray not supported. Skipping the test."); + return; + } robot = new ExtendedRobot(); SwingUtilities.invokeAndWait(PopupMenuLeakTest::createSystemTrayIcon); sleep(); -- GitLab From 7cf68b1901cc6f8ab30f8f8496de10f4017bfc58 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Mon, 25 Oct 2021 14:34:36 +0000 Subject: [PATCH 056/890] 8202932: java/awt/Component/NativeInLightShow/NativeInLightShow.java fails Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../NativeInLightShow/NativeInLightShow.java | 70 +++++++++---------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index cfb2f4b56bc..0e074a7934e 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -481,7 +481,6 @@ java/awt/dnd/MissingDragExitEventTest/MissingDragExitEventTest.java 8030121 maco java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931 macosx-all,linux-all java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 7124275 macosx-all java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java 6848810 macosx-all,linux-all -java/awt/Component/NativeInLightShow/NativeInLightShow.java 8202932 linux-all java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java 8194751 linux-all java/awt/image/VolatileImage/BitmaskVolatileImage.java 8133102 linux-all java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.java 8203004 linux-all diff --git a/test/jdk/java/awt/Component/NativeInLightShow/NativeInLightShow.java b/test/jdk/java/awt/Component/NativeInLightShow/NativeInLightShow.java index 1e3e19cd940..d83029b1b78 100644 --- a/test/jdk/java/awt/Component/NativeInLightShow/NativeInLightShow.java +++ b/test/jdk/java/awt/Component/NativeInLightShow/NativeInLightShow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,68 +26,68 @@ @key headful @bug 4140484 @summary Heavyweight components inside invisible lightweight containers still show - @author Your Name: art@sparc.spb.su @run main NativeInLightShow */ -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Container; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; // The test verifies that the mixing code correctly handles COMPONENT_SHOWN events // while the top-level container is invisible. -public class NativeInLightShow -{ +public class NativeInLightShow { //Declare things used in the test, like buttons and labels here - static boolean buttonPressed = false; - public static void main(String args[]) throws Exception { - Frame f = new Frame("Test"); - - Robot robot = null; - robot = new Robot(); - robot.setAutoDelay(50); - - Container c = new Container(); - c.setLayout(new BorderLayout()); - Button b = new Button("I'm should be visible!"); - b.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) { - System.out.println("Test PASSED"); - buttonPressed = true; - } - }); - c.add(b); + static volatile boolean buttonPressed = false; + + public static void main(String[] args) throws Exception { + Frame frame = new Frame("Test"); - f.add(c); + Robot robot = new Robot(); - f.pack(); + Container container = new Container(); + container.setLayout(new BorderLayout()); + Button button = new Button("I'm should be visible!"); + button.addActionListener(e -> { + System.out.println("Test PASSED"); + buttonPressed = true; + }); - c.setVisible(false); - c.setVisible(true); + container.add(button); + frame.add(container); + frame.pack(); + + container.setVisible(false); + container.setVisible(true); // Wait for a while for COMPONENT_SHOW event to be dispatched robot.waitForIdle(); - f.setVisible(true); + frame.setLocationRelativeTo(null); + frame.setVisible(true); robot.waitForIdle(); + robot.delay(1000); - Point buttonLocation = b.getLocationOnScreen(); + Point buttonLocation = button.getLocationOnScreen(); robot.mouseMove(buttonLocation.x + 5, buttonLocation.y + 5); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); // Wait for a while for ACTION event to be dispatched robot.waitForIdle(); - robot.delay(100); + robot.delay(500); + frame.dispose(); if (!buttonPressed) { System.out.println("Test FAILED"); throw new RuntimeException("Button was not pressed"); } } - } -- GitLab From 3221a14f9eaf002d91597d84efdb125704710a4c Mon Sep 17 00:00:00 2001 From: Artem Semenov Date: Mon, 25 Oct 2021 16:26:43 +0000 Subject: [PATCH 057/890] 8273678: TableAccessibility and TableRowAccessibility miss autorelease Reviewed-by: ant, kizune, pbansal --- .../classes/sun/lwawt/macosx/CAccessible.java | 8 ++ .../awt/a11y/ColumnAccessibility.m | 55 --------- .../awt/a11y/TableAccessibility.h | 3 + .../awt/a11y/TableAccessibility.m | 76 +++++++------ .../java/awt/a11y/AccessibleJTableTest.java | 106 +++++++++++++++++- 5 files changed, 153 insertions(+), 95 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java index 097f662b87c..b59c8cfe574 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java @@ -74,6 +74,7 @@ class CAccessible extends CFRetainedResource implements Accessible { private static native void treeNodeExpanded(long ptr); private static native void treeNodeCollapsed(long ptr); private static native void selectedCellsChanged(long ptr); + private static native void tableContentCacheClear(long ptr); private Accessible accessible; @@ -124,6 +125,13 @@ class CAccessible extends CFRetainedResource implements Accessible { selectionChanged(ptr); } else if (name.equals(ACCESSIBLE_TABLE_MODEL_CHANGED)) { valueChanged(ptr); + if (CAccessible.getSwingAccessible(CAccessible.this) != null) { + Accessible a = CAccessible.getSwingAccessible(CAccessible.this); + AccessibleContext ac = a.getAccessibleContext(); + if ((ac != null) && (ac.getAccessibleRole() == AccessibleRole.TABLE)) { + tableContentCacheClear(ptr); + } + } } else if (name.equals(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY)) { if (newValue instanceof AccessibleContext) { activeDescendant = (AccessibleContext)newValue; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ColumnAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ColumnAccessibility.m index 9d4582445a4..238b82f609e 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ColumnAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ColumnAccessibility.m @@ -49,61 +49,6 @@ static jmethodID jm_getChildrenAndRoles = NULL; return NSAccessibilityColumnRole; } -- (NSArray *)accessibilityChildren -{ - NSArray *children = [super accessibilityChildren]; - if (children == NULL) { - JNIEnv *env = [ThreadUtilities getJNIEnv]; - CommonComponentAccessibility *parent = [self accessibilityParent]; - if (parent->fAccessible == NULL) return nil; - GET_CHILDRENANDROLES_METHOD_RETURN(nil); - jobjectArray jchildrenAndRoles = (jobjectArray)(*env)->CallStaticObjectMethod(env, sjc_CAccessibility, jm_getChildrenAndRoles, - parent->fAccessible, parent->fComponent, sun_lwawt_macosx_CAccessibility_JAVA_AX_ALL_CHILDREN, NO); - CHECK_EXCEPTION(); - if (jchildrenAndRoles == NULL) return nil; - - jsize arrayLen = (*env)->GetArrayLength(env, jchildrenAndRoles); - NSMutableArray *childrenCells = [NSMutableArray arrayWithCapacity:arrayLen/2]; - - NSUInteger childIndex = fIndex; - - int inc = [(TableAccessibility *)[self accessibilityParent] accessibilityRowCount] * 2; - NSInteger i = childIndex * 2; - for(i; i < arrayLen; i += inc) - { - jobject /* Accessible */ jchild = (*env)->GetObjectArrayElement(env, jchildrenAndRoles, i); - jobject /* String */ jchildJavaRole = (*env)->GetObjectArrayElement(env, jchildrenAndRoles, i+1); - - NSString *childJavaRole = nil; - if (jchildJavaRole != NULL) { - DECLARE_CLASS_RETURN(sjc_AccessibleRole, "javax/accessibility/AccessibleRole", nil); - DECLARE_FIELD_RETURN(sjf_key, sjc_AccessibleRole, "key", "Ljava/lang/String;", nil); - jobject jkey = (*env)->GetObjectField(env, jchildJavaRole, sjf_key); - CHECK_EXCEPTION(); - childJavaRole = JavaStringToNSString(env, jkey); - (*env)->DeleteLocalRef(env, jkey); - } - - CellAccessibility *child = [[CellAccessibility alloc] initWithParent:self - withEnv:env - withAccessible:jchild - withIndex:childIndex - withView:self->fView - withJavaRole:childJavaRole]; - [childrenCells addObject:[[child retain] autorelease]]; - - (*env)->DeleteLocalRef(env, jchild); - (*env)->DeleteLocalRef(env, jchildJavaRole); - - childIndex += (inc / 2); - } - (*env)->DeleteLocalRef(env, jchildrenAndRoles); - return childrenCells; - } else { - return children; - } -} - - (NSInteger)accessibilityIndex { return fIndex; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.h index 4f746706f5c..5fe04aa257f 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.h @@ -25,6 +25,9 @@ #import "CommonComponentAccessibility.h" @interface TableAccessibility : CommonComponentAccessibility +{ + NSMutableDictionary *rowCache; +} - (BOOL)isAccessibleChildSelectedFromIndex:(int)index; - (int) accessibleRowAtIndex:(int)index; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m index b3c73a38c95..d6382822e1e 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableAccessibility.m @@ -33,6 +33,7 @@ #import "JNIUtilities.h" #import "CellAccessibility.h" #import "sun_lwawt_macosx_CAccessibility.h" +#import "sun_lwawt_macosx_CAccessible.h" static jclass sjc_CAccessibility = NULL; @@ -124,22 +125,23 @@ static jmethodID sjm_getAccessibleName = NULL; - (TableRowAccessibility *)createRowWithIndex:(NSUInteger)index { - return [[TableRowAccessibility alloc] initWithParent:self - withEnv:[ThreadUtilities getJNIEnv] - withAccessible:NULL - withIndex:index - withView:[self view] - withJavaRole:JavaAccessibilityIgnore]; -} + if (rowCache == nil) { + int rowCount = [self accessibilityRowCount]; + rowCache = [[NSMutableDictionary dictionaryWithCapacity:rowCount] retain]; + } -- (ColumnAccessibility *)createColumnWithIndex:(NSUInteger)index -{ - return [[ColumnAccessibility alloc] initWithParent:self - withEnv:[ThreadUtilities getJNIEnv] - withAccessible:NULL - withIndex:index - withView:self->fView - withJavaRole:JavaAccessibilityIgnore]; + id row = [rowCache objectForKey:[NSNumber numberWithUnsignedInteger:index]]; + if (row == nil) { + row = [[TableRowAccessibility alloc] initWithParent:self + withEnv:[ThreadUtilities getJNIEnv] + withAccessible:NULL + withIndex:index + withView:[self view] + withJavaRole:JavaAccessibilityIgnore]; + [rowCache setObject:row forKey:[NSNumber numberWithUnsignedInteger:index]]; + } + + return row; } // NSAccessibilityElement protocol methods @@ -189,26 +191,6 @@ static jmethodID sjm_getAccessibleName = NULL; return [super accessibilityParent]; } -- (nullable NSArray *)accessibilityColumns -{ - int colCount = [self accessibilityColumnCount]; - NSMutableArray *columns = [NSMutableArray arrayWithCapacity:colCount]; - for (int i = 0; i < colCount; i++) { - [columns addObject:[self createColumnWithIndex:i]]; - } - return [NSArray arrayWithArray:columns]; -} - -- (nullable NSArray *)accessibilitySelectedColumns -{ - NSArray *indexes = [self getTableSelectedInfo:sun_lwawt_macosx_CAccessibility_JAVA_AX_COLS]; - NSMutableArray *columns = [NSMutableArray arrayWithCapacity:[indexes count]]; - for (NSNumber *i in indexes) { - [columns addObject:[self createColumnWithIndex:i.unsignedIntValue]]; - } - return [NSArray arrayWithArray:columns]; -} - - (NSInteger)accessibilityRowCount { return [[self getTableInfo:sun_lwawt_macosx_CAccessibility_JAVA_AX_ROWS] integerValue]; @@ -238,4 +220,28 @@ static jmethodID sjm_getAccessibleName = NULL; return [NSArray arrayWithArray:selectedCells]; } +- (void)clearCache { + for (NSNumber *key in [rowCache allKeys]) { + [[rowCache objectForKey:key] release]; + } + [rowCache release]; + rowCache = nil; +} + @end + +/* + * Class: sun_lwawt_macosx_CAccessible + * Method: tableContentIndexDestroy + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_tableContentCacheClear + (JNIEnv *env, jclass class, jlong element) +{ + JNI_COCOA_ENTER(env); + [ThreadUtilities performOnMainThread:@selector(clearCache) + on:(CommonComponentAccessibility *)jlong_to_ptr(element) + withObject:nil + waitUntilDone:NO]; + JNI_COCOA_EXIT(env); +} diff --git a/test/jdk/java/awt/a11y/AccessibleJTableTest.java b/test/jdk/java/awt/a11y/AccessibleJTableTest.java index 209b81a5886..21f5fa3bd55 100644 --- a/test/jdk/java/awt/a11y/AccessibleJTableTest.java +++ b/test/jdk/java/awt/a11y/AccessibleJTableTest.java @@ -31,12 +31,15 @@ * @requires (os.family == "windows" | os.family == "mac") */ -import javax.swing.JTable; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; +import javax.swing.*; +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableModel; -import java.awt.FlowLayout; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -94,6 +97,65 @@ public class AccessibleJTableTest extends AccessibleComponentTest { super.createUI(panel, "AccessibleJTableTest"); } + public void createUIWithChangingContent() { + INSTRUCTIONS = "INSTRUCTIONS:\n" + + "Check a11y of dynamic JTable.\n\n" + + "Turn screen reader on, and Tab to the table.\n" + + "Add and remove rows and columns using the appropriate buttons and try to move around the table\n\n" + + "If you hear changes in the table - ctrl+tab further and press PASS, otherwise press FAIL.\n"; + + JTable table = new JTable(new TestTableModel(3, 3)); + + JPanel panel = new JPanel(); + panel.setLayout(new FlowLayout()); + JScrollPane scrollPane = new JScrollPane(table); + panel.add(scrollPane); + + JPanel buttonPanel = new JPanel(new GridLayout()); + JButton addRow = new JButton("Add row"); + addRow.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + table.setModel(new TestTableModel(table.getModel().getRowCount() + 1, table.getModel().getColumnCount())); + } + }); + + JButton addColumn = new JButton("Add column"); + addColumn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + table.setModel(new TestTableModel(table.getModel().getRowCount(), table.getModel().getColumnCount() + 1)); + } + }); + + JButton removeRow = new JButton("Remove row"); + removeRow.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + table.setModel(new TestTableModel(table.getModel().getRowCount() - 1, table.getModel().getColumnCount())); + } + }); + + JButton removeColumn = new JButton("Remove column"); + removeColumn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + table.setModel(new TestTableModel(table.getModel().getRowCount(), table.getModel().getColumnCount() - 1)); + } + }); + + buttonPanel.add(addRow); + buttonPanel.add(addColumn); + buttonPanel.add(removeRow); + buttonPanel.add(removeColumn); + + panel.add(buttonPanel); + + panel.setFocusable(false); + exceptionString = "AccessibleJTable test failed!"; + super.createUI(panel, "AccessibleJTableTest"); + } + public static void main(String[] args) throws Exception { AccessibleJTableTest test = new AccessibleJTableTest(); @@ -110,5 +172,39 @@ public class AccessibleJTableTest extends AccessibleComponentTest { if (!testResult) { throw new RuntimeException(exceptionString); } + + countDownLatch = test.createCountDownLatch(); + SwingUtilities.invokeAndWait(test::createUIWithChangingContent); + countDownLatch.await(15, TimeUnit.MINUTES); + if (!testResult) { + throw new RuntimeException(exceptionString); + } + + } + + private static class TestTableModel extends AbstractTableModel { + private final int rows; + private final int cols; + + TestTableModel(final int r, final int c) { + super(); + rows = r; + cols = c; + } + + @Override + public int getRowCount() { + return rows >= 0 ? rows : 0; + } + + @Override + public int getColumnCount() { + return cols >= 0 ? cols : 0; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + return String.valueOf((rowIndex + 1) * (columnIndex + 1)); + } } } -- GitLab From 89671aa164ea500954b0d5caa5ce6190dfbc0d4e Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Mon, 25 Oct 2021 17:03:57 +0000 Subject: [PATCH 058/890] 8273712: C2: Add mechanism for rejecting inlining of low frequency call sites and deprecate MinInliningThreshold. Reviewed-by: kvn, rbackman --- .../share/compiler/compilationPolicy.hpp | 1 + src/hotspot/share/opto/bytecodeInfo.cpp | 39 +++++++++++-------- src/hotspot/share/opto/parse.hpp | 3 +- src/hotspot/share/runtime/arguments.cpp | 1 + src/hotspot/share/runtime/globals.hpp | 10 +++-- .../string/TestStringIntrinsics2.java | 2 +- 6 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/hotspot/share/compiler/compilationPolicy.hpp b/src/hotspot/share/compiler/compilationPolicy.hpp index 2ecb066ba85..721efa3688e 100644 --- a/src/hotspot/share/compiler/compilationPolicy.hpp +++ b/src/hotspot/share/compiler/compilationPolicy.hpp @@ -237,6 +237,7 @@ class CompilationPolicy : AllStatic { // m must be compiled before executing it static bool must_be_compiled(const methodHandle& m, int comp_level = CompLevel_any); public: + static int min_invocations() { return Tier4MinInvocationThreshold; } static int c1_count() { return _c1_count; } static int c2_count() { return _c2_count; } static int compiler_count(CompLevel comp_level); diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index 0ce5143b59a..c6bc8f8eb94 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "ci/ciReplay.hpp" #include "classfile/vmSymbols.hpp" +#include "compiler/compilationPolicy.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compilerEvent.hpp" #include "compiler/compileLog.hpp" @@ -152,8 +153,8 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, int inline_small_code_size = InlineSmallCode / 4; int max_inline_size = default_max_inline_size; - int call_site_count = method()->scale_count(profile.count()); - int invoke_count = method()->interpreter_invocation_count(); + int call_site_count = caller_method->scale_count(profile.count()); + int invoke_count = caller_method->interpreter_invocation_count(); assert(invoke_count != 0, "require invocation count greater than zero"); double freq = (double)call_site_count / (double)invoke_count; @@ -192,10 +193,8 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, // negative filter: should callee NOT be inlined? -bool InlineTree::should_not_inline(ciMethod *callee_method, - ciMethod* caller_method, - JVMState* jvms) { - +bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_method, + int caller_bci, ciCallProfile& profile) { const char* fail_msg = NULL; // First check all inlining restrictions which are required for correctness @@ -233,7 +232,6 @@ bool InlineTree::should_not_inline(ciMethod *callee_method, } #ifndef PRODUCT - int caller_bci = jvms->bci(); int inline_depth = inline_level()+1; if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { set_msg("force inline by ciReplay"); @@ -289,7 +287,6 @@ bool InlineTree::should_not_inline(ciMethod *callee_method, // don't use counts with -Xcomp if (UseInterpreter) { - if (!callee_method->has_compiled_code() && !callee_method->was_executed_more_than(0)) { set_msg("never executed"); @@ -299,15 +296,23 @@ bool InlineTree::should_not_inline(ciMethod *callee_method, if (is_init_with_ea(callee_method, caller_method, C)) { // Escape Analysis: inline all executed constructors return false; - } else { - intx counter_high_value; - // Tiered compilation uses a different "high value" than non-tiered compilation. - // Determine the right value to use. - if (TieredCompilation) { - counter_high_value = InvocationCounter::count_limit / 2; - } else { - counter_high_value = CompileThreshold / 2; + } + + if (MinInlineFrequencyRatio > 0) { + int call_site_count = caller_method->scale_count(profile.count()); + int invoke_count = caller_method->interpreter_invocation_count(); + assert(invoke_count != 0, "require invocation count greater than zero"); + double freq = (double)call_site_count / (double)invoke_count; + double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / CompilationPolicy::min_invocations()); + + if (freq < min_freq) { + set_msg("low call site frequency"); + return true; } + } + + if (MinInliningThreshold > 0) { // Deprecated heuristic + intx counter_high_value = TieredCompilation ? InvocationCounter::count_limit / 2 : CompileThreshold / 2; if (!callee_method->was_executed_more_than(MIN2(MinInliningThreshold, counter_high_value))) { set_msg("executed < MinInliningThreshold times"); return true; @@ -367,7 +372,7 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, if (!should_inline(callee_method, caller_method, caller_bci, profile)) { return false; } - if (should_not_inline(callee_method, caller_method, jvms)) { + if (should_not_inline(callee_method, caller_method, caller_bci, profile)) { return false; } diff --git a/src/hotspot/share/opto/parse.hpp b/src/hotspot/share/opto/parse.hpp index fbe42cbaae0..efed355787b 100644 --- a/src/hotspot/share/opto/parse.hpp +++ b/src/hotspot/share/opto/parse.hpp @@ -78,7 +78,8 @@ protected: ciCallProfile& profile); bool should_not_inline(ciMethod* callee_method, ciMethod* caller_method, - JVMState* jvms); + int caller_bci, + ciCallProfile& profile); bool is_not_reached(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 4996f545775..7e154bdd3e7 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -527,6 +527,7 @@ static SpecialFlag const special_jvm_flags[] = { { "AllowRedefinitionToAddDeleteMethods", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "FlightRecorder", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "FilterSpuriousWakeups", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::jdk(20) }, + { "MinInliningThreshold", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::jdk(20) }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index e705e40d93f..619ec338626 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1348,9 +1348,9 @@ const intx ObjectAlignmentInBytes = 8; "(using CompileCommand or marked w/ @ForceInline)") \ range(0, max_jint) \ \ - product(intx, MinInliningThreshold, 250, \ - "The minimum invocation count a method needs to have to be " \ - "inlined") \ + product(intx, MinInliningThreshold, 0, \ + "(Deprecated) The minimum invocation count a method needs to" \ + "have to be inlined") \ range(0, max_jint) \ \ develop(intx, MethodHistogramCutoff, 100, \ @@ -1404,6 +1404,10 @@ const intx ObjectAlignmentInBytes = 8; product(double, InlineFrequencyRatio, 0.25, DIAGNOSTIC, \ "Ratio of call site execution to caller method invocation") \ \ + product(double, MinInlineFrequencyRatio, 0.0085, DIAGNOSTIC, \ + "Minimum ratio of call site execution to caller method" \ + "invocation to be considered for inlining") \ + \ develop(intx, InlineThrowCount, 50, \ "Force inlining of interpreted methods that throw this often") \ range(0, max_jint) \ diff --git a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java index e6b3f89155a..e966acbaf3f 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java +++ b/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -39,7 +39,7 @@ * -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions * -XX:MaxInlineSize=70 - * -XX:MinInliningThreshold=0 + * -XX:MinInlineFrequencyRatio=0 * compiler.intrinsics.string.TestStringIntrinsics2 */ -- GitLab From 97d3280eb4735f5b84cd4a9a1286e35c1c48113a Mon Sep 17 00:00:00 2001 From: Clive Verghese Date: Mon, 25 Oct 2021 18:33:57 +0000 Subject: [PATCH 059/890] 8275536: Add test to check that File::lastModified returns same time stamp as Files.getLastModifiedTime Reviewed-by: alanb, bpb --- test/jdk/java/io/File/LastModifiedTest.java | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 test/jdk/java/io/File/LastModifiedTest.java diff --git a/test/jdk/java/io/File/LastModifiedTest.java b/test/jdk/java/io/File/LastModifiedTest.java new file mode 100644 index 00000000000..62e88baa6ea --- /dev/null +++ b/test/jdk/java/io/File/LastModifiedTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021, Amazon 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 org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.time.Instant; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotEquals; + +/** + * @test + * @library .. + * @run testng LastModifiedTest + * @summary Test to validate that java.nio.Files returns the same value + * as java.io.File + */ +public class LastModifiedTest { + + private static final Instant MILLISECOND_PRECISION = Instant.ofEpochMilli(1999L); + + @Test + public void verifyLastModifiedTime() throws IOException { + File tempFile = Files.createTempFile("MillisecondPrecisionTest", "txt").toFile(); + try { + tempFile.setLastModified(MILLISECOND_PRECISION.toEpochMilli()); + + long ioTimestamp = tempFile.lastModified(); + long nioTimestamp = Files.getLastModifiedTime(tempFile.toPath()).toMillis(); + + assertEquals(ioTimestamp, nioTimestamp); + } finally { + tempFile.delete(); + } + + } +} -- GitLab From 337a9b73a75981d14eb4125e4354edda8d541361 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Mon, 25 Oct 2021 19:44:25 +0000 Subject: [PATCH 060/890] 8269853: Prefetch::read should accept pointer to const Reviewed-by: coleenp --- src/hotspot/os_cpu/aix_ppc/prefetch_aix_ppc.inline.hpp | 4 ++-- .../os_cpu/bsd_aarch64/prefetch_bsd_aarch64.inline.hpp | 2 +- src/hotspot/os_cpu/bsd_x86/prefetch_bsd_x86.inline.hpp | 4 ++-- src/hotspot/os_cpu/bsd_zero/prefetch_bsd_zero.inline.hpp | 4 ++-- .../os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp | 4 ++-- src/hotspot/os_cpu/linux_arm/prefetch_linux_arm.inline.hpp | 4 ++-- src/hotspot/os_cpu/linux_ppc/prefetch_linux_ppc.inline.hpp | 4 ++-- src/hotspot/os_cpu/linux_s390/prefetch_linux_s390.inline.hpp | 4 ++-- src/hotspot/os_cpu/linux_x86/prefetch_linux_x86.inline.hpp | 4 ++-- src/hotspot/os_cpu/linux_zero/prefetch_linux_zero.inline.hpp | 4 ++-- .../windows_aarch64/prefetch_windows_aarch64.inline.hpp | 2 +- .../os_cpu/windows_x86/prefetch_windows_x86.inline.hpp | 4 ++-- src/hotspot/share/runtime/prefetch.hpp | 4 ++-- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/hotspot/os_cpu/aix_ppc/prefetch_aix_ppc.inline.hpp b/src/hotspot/os_cpu/aix_ppc/prefetch_aix_ppc.inline.hpp index 73799524140..1f9917acae7 100644 --- a/src/hotspot/os_cpu/aix_ppc/prefetch_aix_ppc.inline.hpp +++ b/src/hotspot/os_cpu/aix_ppc/prefetch_aix_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2013 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,7 +29,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read(void *loc, intx interval) { +inline void Prefetch::read(const void *loc, intx interval) { #if !defined(USE_XLC_BUILTINS) __asm__ __volatile__ ( " dcbt 0, %0 \n" diff --git a/src/hotspot/os_cpu/bsd_aarch64/prefetch_bsd_aarch64.inline.hpp b/src/hotspot/os_cpu/bsd_aarch64/prefetch_bsd_aarch64.inline.hpp index e24d0328e6d..1bcbdcaf90d 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/prefetch_bsd_aarch64.inline.hpp +++ b/src/hotspot/os_cpu/bsd_aarch64/prefetch_bsd_aarch64.inline.hpp @@ -30,7 +30,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) { +inline void Prefetch::read (const void *loc, intx interval) { if (interval >= 0) asm("prfm PLDL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval)); } diff --git a/src/hotspot/os_cpu/bsd_x86/prefetch_bsd_x86.inline.hpp b/src/hotspot/os_cpu/bsd_x86/prefetch_bsd_x86.inline.hpp index 35bf6bbc4fd..cb0db2f360c 100644 --- a/src/hotspot/os_cpu/bsd_x86/prefetch_bsd_x86.inline.hpp +++ b/src/hotspot/os_cpu/bsd_x86/prefetch_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -28,7 +28,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) { +inline void Prefetch::read (const void *loc, intx interval) { #ifdef AMD64 __asm__ ("prefetcht0 (%0,%1,1)" : : "r" (loc), "r" (interval)); #endif // AMD64 diff --git a/src/hotspot/os_cpu/bsd_zero/prefetch_bsd_zero.inline.hpp b/src/hotspot/os_cpu/bsd_zero/prefetch_bsd_zero.inline.hpp index 794f26e8a84..220d6a08f68 100644 --- a/src/hotspot/os_cpu/bsd_zero/prefetch_bsd_zero.inline.hpp +++ b/src/hotspot/os_cpu/bsd_zero/prefetch_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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. * @@ -28,7 +28,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read(void* loc, intx interval) { +inline void Prefetch::read(const void* loc, intx interval) { } inline void Prefetch::write(void* loc, intx interval) { diff --git a/src/hotspot/os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp b/src/hotspot/os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp index e11579de290..168a680a404 100644 --- a/src/hotspot/os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp +++ b/src/hotspot/os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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. * @@ -29,7 +29,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) { +inline void Prefetch::read (const void *loc, intx interval) { if (interval >= 0) asm("prfm PLDL1KEEP, [%0, %1]" : : "r"(loc), "r"(interval)); } diff --git a/src/hotspot/os_cpu/linux_arm/prefetch_linux_arm.inline.hpp b/src/hotspot/os_cpu/linux_arm/prefetch_linux_arm.inline.hpp index e75a8c5c90d..dfbab55d9b9 100644 --- a/src/hotspot/os_cpu/linux_arm/prefetch_linux_arm.inline.hpp +++ b/src/hotspot/os_cpu/linux_arm/prefetch_linux_arm.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -27,7 +27,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) { +inline void Prefetch::read (const void *loc, intx interval) { #if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_5TE__) __asm__ volatile ("pld [%0]" : : "r" (loc)); #endif diff --git a/src/hotspot/os_cpu/linux_ppc/prefetch_linux_ppc.inline.hpp b/src/hotspot/os_cpu/linux_ppc/prefetch_linux_ppc.inline.hpp index d795d0c91bb..12c65e6bf00 100644 --- a/src/hotspot/os_cpu/linux_ppc/prefetch_linux_ppc.inline.hpp +++ b/src/hotspot/os_cpu/linux_ppc/prefetch_linux_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2013 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,7 +29,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read(void *loc, intx interval) { +inline void Prefetch::read(const void *loc, intx interval) { __asm__ __volatile__ ( " dcbt 0, %0 \n" : diff --git a/src/hotspot/os_cpu/linux_s390/prefetch_linux_s390.inline.hpp b/src/hotspot/os_cpu/linux_s390/prefetch_linux_s390.inline.hpp index e922b6dc853..ee55d01886f 100644 --- a/src/hotspot/os_cpu/linux_s390/prefetch_linux_s390.inline.hpp +++ b/src/hotspot/os_cpu/linux_s390/prefetch_linux_s390.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read(void* loc, intx interval) { +inline void Prefetch::read(const void* loc, intx interval) { // No prefetch instructions on z/Architecture -> implement trivially. } diff --git a/src/hotspot/os_cpu/linux_x86/prefetch_linux_x86.inline.hpp b/src/hotspot/os_cpu/linux_x86/prefetch_linux_x86.inline.hpp index c15cc75b31e..cf60c2cbd6b 100644 --- a/src/hotspot/os_cpu/linux_x86/prefetch_linux_x86.inline.hpp +++ b/src/hotspot/os_cpu/linux_x86/prefetch_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -28,7 +28,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) { +inline void Prefetch::read (const void *loc, intx interval) { #ifdef AMD64 __asm__ ("prefetcht0 (%0,%1,1)" : : "r" (loc), "r" (interval)); #endif // AMD64 diff --git a/src/hotspot/os_cpu/linux_zero/prefetch_linux_zero.inline.hpp b/src/hotspot/os_cpu/linux_zero/prefetch_linux_zero.inline.hpp index 85cf90b42d3..a510fa87834 100644 --- a/src/hotspot/os_cpu/linux_zero/prefetch_linux_zero.inline.hpp +++ b/src/hotspot/os_cpu/linux_zero/prefetch_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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. * @@ -28,7 +28,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read(void* loc, intx interval) { +inline void Prefetch::read(const void* loc, intx interval) { } inline void Prefetch::write(void* loc, intx interval) { diff --git a/src/hotspot/os_cpu/windows_aarch64/prefetch_windows_aarch64.inline.hpp b/src/hotspot/os_cpu/windows_aarch64/prefetch_windows_aarch64.inline.hpp index d2bd8f14119..df301ade92d 100644 --- a/src/hotspot/os_cpu/windows_aarch64/prefetch_windows_aarch64.inline.hpp +++ b/src/hotspot/os_cpu/windows_aarch64/prefetch_windows_aarch64.inline.hpp @@ -28,7 +28,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) { +inline void Prefetch::read (const void *loc, intx interval) { } inline void Prefetch::write(void *loc, intx interval) { diff --git a/src/hotspot/os_cpu/windows_x86/prefetch_windows_x86.inline.hpp b/src/hotspot/os_cpu/windows_x86/prefetch_windows_x86.inline.hpp index d4a5fd32eab..996625cb0ad 100644 --- a/src/hotspot/os_cpu/windows_x86/prefetch_windows_x86.inline.hpp +++ b/src/hotspot/os_cpu/windows_x86/prefetch_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -27,7 +27,7 @@ #include "runtime/prefetch.hpp" -inline void Prefetch::read (void *loc, intx interval) {} +inline void Prefetch::read (const void *loc, intx interval) {} inline void Prefetch::write(void *loc, intx interval) {} #endif // OS_CPU_WINDOWS_X86_PREFETCH_WINDOWS_X86_INLINE_HPP diff --git a/src/hotspot/share/runtime/prefetch.hpp b/src/hotspot/share/runtime/prefetch.hpp index 0cea7db1cd5..dac34f6cd26 100644 --- a/src/hotspot/share/runtime/prefetch.hpp +++ b/src/hotspot/share/runtime/prefetch.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,7 +42,7 @@ class Prefetch : AllStatic { }; // Prefetch anticipating read; must not fault, semantically a no-op - static void read(void* loc, intx interval); + static void read(const void* loc, intx interval); // Prefetch anticipating write; must not fault, semantically a no-op static void write(void* loc, intx interval); -- GitLab From 43619458d183bbbaec745887314ddcf7a8aa4136 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 26 Oct 2021 02:39:05 +0000 Subject: [PATCH 061/890] 8185844: MSCAPI doesn't list aliases correctly Reviewed-by: valeriep --- .../sun/security/mscapi/CKeyStore.java | 93 ++++++++---------- .../sun/security/mscapi/SetDupNameEntry.java | 98 +++++++++++++++++++ 2 files changed, 140 insertions(+), 51 deletions(-) create mode 100644 test/jdk/sun/security/mscapi/SetDupNameEntry.java diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java index 68151f2376f..38d2135e891 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java @@ -165,6 +165,25 @@ abstract class CKeyStore extends KeyStoreSpi { } certChain = chain; } + + public void delete() throws KeyStoreException { + // Get end-entity certificate and remove from system cert store + X509Certificate[] certChain = getCertificateChain(); + if (certChain != null && certChain.length > 0) { + try { + byte[] encoding = certChain[0].getEncoded(); + removeCertificate(getName(), getAlias(), encoding, + encoding.length); + } catch (CertificateException e) { + throw new KeyStoreException("Cannot remove entry: ", e); + } + } + CKey privateKey = getPrivateKey(); + if (privateKey != null) { + destroyKeyContainer( + CKey.getContainerName(privateKey.getHCryptProvider())); + } + } } /* @@ -368,8 +387,6 @@ abstract class CKeyStore extends KeyStoreSpi { if (key instanceof RSAPrivateCrtKey) { - KeyEntry entry = entries.get(alias); - X509Certificate[] xchain; if (chain != null) { if (chain instanceof X509Certificate[]) { @@ -382,26 +399,20 @@ abstract class CKeyStore extends KeyStoreSpi { xchain = null; } - if (entry == null) { - entry = - //TODO new KeyEntry(alias, key, (X509Certificate[]) chain); - new KeyEntry(alias, null, xchain); - storeWithUniqueAlias(alias, entry); - } - - entry.setAlias(alias); + KeyEntry oldEntry = entries.get(alias); try { - entry.setRSAPrivateKey(key); - entry.setCertificateChain(xchain); - - } catch (CertificateException ce) { - throw new KeyStoreException(ce); - - } catch (InvalidKeyException ike) { - throw new KeyStoreException(ike); + KeyEntry newEntry = new KeyEntry(alias, null, xchain); + newEntry.setRSAPrivateKey(key); + newEntry.setCertificateChain(xchain); + entries.put(alias, newEntry); + } catch (CertificateException | InvalidKeyException e) { + throw new KeyStoreException(e); } + if (oldEntry != null) { + oldEntry.delete(); + } } else { throw new UnsupportedOperationException( "Cannot assign the key to the given alias."); @@ -463,25 +474,23 @@ abstract class CKeyStore extends KeyStoreSpi { // TODO - build CryptoAPI chain? X509Certificate[] chain = new X509Certificate[]{ (X509Certificate) cert }; - KeyEntry entry = entries.get(alias); - if (entry == null) { - entry = - new KeyEntry(alias, null, chain); - storeWithUniqueAlias(alias, entry); + KeyEntry oldEntry = entries.get(alias); + if (oldEntry != null && oldEntry.privateKey != null) { + throw new KeyStoreException("Cannot overwrite key entry"); } - if (entry.getPrivateKey() == null) { // trusted-cert entry - entry.setAlias(alias); - - try { - entry.setCertificateChain(chain); - - } catch (CertificateException ce) { - throw new KeyStoreException(ce); - } + try { + KeyEntry newEntry = new KeyEntry(alias, null, chain); + newEntry.setCertificateChain(chain); + entries.put(alias, newEntry); + } catch (CertificateException ce) { + throw new KeyStoreException(ce); } + if (oldEntry != null) { + oldEntry.delete(); + } } else { throw new UnsupportedOperationException( "Cannot assign the certificate to the given alias."); @@ -502,25 +511,7 @@ abstract class CKeyStore extends KeyStoreSpi { KeyEntry entry = entries.remove(alias); if (entry != null) { - // Get end-entity certificate and remove from system cert store - X509Certificate[] certChain = entry.getCertificateChain(); - if (certChain != null && certChain.length > 0) { - - try { - - byte[] encoding = certChain[0].getEncoded(); - removeCertificate(getName(), entry.getAlias(), encoding, - encoding.length); - - } catch (CertificateException e) { - throw new KeyStoreException("Cannot remove entry: ", e); - } - } - CKey privateKey = entry.getPrivateKey(); - if (privateKey != null) { - destroyKeyContainer( - CKey.getContainerName(privateKey.getHCryptProvider())); - } + entry.delete(); } } diff --git a/test/jdk/sun/security/mscapi/SetDupNameEntry.java b/test/jdk/sun/security/mscapi/SetDupNameEntry.java new file mode 100644 index 00000000000..801d0e589a1 --- /dev/null +++ b/test/jdk/sun/security/mscapi/SetDupNameEntry.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2021, 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.security.KeyStore; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.util.Collections; + +import jdk.test.lib.Asserts; +import sun.security.tools.keytool.CertAndKeyGen; +import sun.security.x509.X500Name; + +/* + * @test + * @bug 8185844 + * @summary ensure setEntry overwrite old entry + * @library /test/lib + * @requires os.family == "windows" + * @modules java.base/sun.security.tools.keytool + * java.base/sun.security.x509 + */ +public class SetDupNameEntry { + + final KeyStore keyStore; + final CertAndKeyGen ckg; + + static final String PREFIX = "8185844"; + + public static void main(String[] args) throws Exception { + SetDupNameEntry test = new SetDupNameEntry(); + test.cleanup(); + try { + test.test(true); // test key entry + test.test(false); // test cert entry + } finally { + test.cleanup(); + } + } + + SetDupNameEntry() throws Exception { + keyStore = KeyStore.getInstance("Windows-MY"); + ckg = new CertAndKeyGen("RSA", "SHA1withRSA"); + } + + void test(boolean testKey) throws Exception { + keyStore.load(null, null); + int size = keyStore.size(); + + String alias = PREFIX + (testKey ? "k" : "c"); + for (int i = 0; i < 2; i++) { + ckg.generate(1024); + X509Certificate cert = ckg + .getSelfCertificate(new X500Name("CN=TEST"), 1000); + if (testKey) { + keyStore.setKeyEntry( + alias, + ckg.getPrivateKey(), + null, + new Certificate[] { cert }); + } else { + keyStore.setCertificateEntry(alias, cert); + } + } + Asserts.assertEQ(keyStore.size(), size + 1); + + keyStore.load(null, null); + Asserts.assertEQ(keyStore.size(), size + 1); + } + + void cleanup() throws Exception { + keyStore.load(null, null); + for (String alias : Collections.list(keyStore.aliases())) { + if (alias.startsWith(PREFIX)) { + keyStore.deleteEntry(alias); + } + } + } +} -- GitLab From 10e1610f7b99f42f834478528df7ecfb4320aec1 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 26 Oct 2021 02:45:23 +0000 Subject: [PATCH 062/890] 8251134: Unwrapping a key with a Private Key generated by Microsoft CNG fails Reviewed-by: valeriep --- .../sun/security/mscapi/CKeyStore.java | 15 ++- .../sun/security/mscapi/CRSACipher.java | 24 ++-- .../windows/native/libsunmscapi/security.cpp | 73 ++++++++++++ test/jdk/sun/security/mscapi/CngCipher.java | 107 ++++++++++++++++++ 4 files changed, 210 insertions(+), 9 deletions(-) create mode 100644 test/jdk/sun/security/mscapi/CngCipher.java diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java index 38d2135e891..bc37d469fc1 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyStore.java @@ -180,8 +180,12 @@ abstract class CKeyStore extends KeyStoreSpi { } CKey privateKey = getPrivateKey(); if (privateKey != null) { - destroyKeyContainer( - CKey.getContainerName(privateKey.getHCryptProvider())); + if (privateKey.getHCryptKey() != 0) { + destroyKeyContainer( + CKey.getContainerName(privateKey.getHCryptProvider())); + } else { + removeCngKey(privateKey.getHCryptProvider()); + } } } } @@ -868,6 +872,13 @@ abstract class CKeyStore extends KeyStoreSpi { private native void destroyKeyContainer(String keyContainerName) throws KeyStoreException; + /** + * Removes a CNG key. + * + * @param k the handle of the key + */ + private native void removeCngKey(long k) throws KeyStoreException; + /** * Generates a private-key BLOB from a key's components. */ diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java index 133ceff4f32..7739bcf9790 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java @@ -290,19 +290,19 @@ public final class CRSACipher extends CipherSpi { switch (mode) { case MODE_SIGN: return encryptDecrypt(data, bufOfs, - privateKey.getHCryptKey(), true); + privateKey, true); case MODE_VERIFY: return encryptDecrypt(data, bufOfs, - publicKey.getHCryptKey(), false); + publicKey, false); case MODE_ENCRYPT: return encryptDecrypt(data, bufOfs, - publicKey.getHCryptKey(), true); + publicKey, true); case MODE_DECRYPT: return encryptDecrypt(data, bufOfs, - privateKey.getHCryptKey(), false); + privateKey, false); default: throw new AssertionError("Internal error"); @@ -493,10 +493,20 @@ public final class CRSACipher extends CipherSpi { } /* - * Encrypt/decrypt a data buffer using Microsoft Crypto API with HCRYPTKEY. + * Encrypt/decrypt a data buffer using Microsoft Crypto API or CNG. * It expects and returns ciphertext data in big-endian form. */ - private native static byte[] encryptDecrypt(byte[] data, int dataSize, - long hCryptKey, boolean doEncrypt) throws KeyException; + private static byte[] encryptDecrypt(byte[] data, int dataSize, + CKey key, boolean doEncrypt) throws KeyException { + if (key.getHCryptKey() != 0) { + return encryptDecrypt(data, dataSize, key.getHCryptKey(), doEncrypt); + } else { + return cngEncryptDecrypt(data, dataSize, key.getHCryptProvider(), doEncrypt); + } + } + private native static byte[] encryptDecrypt(byte[] data, int dataSize, + long key, boolean doEncrypt) throws KeyException; + private native static byte[] cngEncryptDecrypt(byte[] data, int dataSize, + long key, boolean doEncrypt) throws KeyException; } diff --git a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp index 29aad4e6e33..588b0be071f 100644 --- a/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp +++ b/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp @@ -1799,6 +1799,16 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_removeCertificate } } +JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_removeCngKey + (JNIEnv *env, jobject clazz, jlong k) +{ + SECURITY_STATUS ss; + ss = ::NCryptDeleteKey((NCRYPT_KEY_HANDLE)k, 0); + if (ss != ERROR_SUCCESS) { + ThrowException(env, KEY_EXCEPTION, ss); + } +} + /* * Class: sun_security_mscapi_CKeyStore * Method: destroyKeyContainer @@ -1923,6 +1933,69 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt return result; } +/* + * Class: sun_security_mscapi_CRSACipher + * Method: cngEncryptDecrypt + * Signature: ([BIJZ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_cngEncryptDecrypt + (JNIEnv *env, jclass clazz, jbyteArray jData, jint jDataSize, jlong hKey, + jboolean doEncrypt) +{ + SECURITY_STATUS ss; + jbyteArray result = NULL; + jbyte* pData = NULL; + DWORD dwDataLen = jDataSize; + DWORD dwBufLen = env->GetArrayLength(jData); + __try + { + // Copy data from Java buffer to native buffer + pData = new (env) jbyte[dwBufLen]; + if (pData == NULL) { + __leave; + } + env->GetByteArrayRegion(jData, 0, dwBufLen, pData); + + if (doEncrypt == JNI_TRUE) { + // encrypt + ss = ::NCryptEncrypt((NCRYPT_KEY_HANDLE) hKey, + (PBYTE)pData, dwDataLen, + 0, + (PBYTE)pData, dwBufLen, + &dwBufLen, NCRYPT_PAD_PKCS1_FLAG); + if (ss != ERROR_SUCCESS) { + ThrowException(env, KEY_EXCEPTION, ss); + __leave; + } + } else { + // decrypt + ss = ::NCryptDecrypt((NCRYPT_KEY_HANDLE) hKey, + (PBYTE)pData, dwDataLen, + 0, + (PBYTE)pData, dwBufLen, + &dwBufLen, NCRYPT_PAD_PKCS1_FLAG); + if (ss != ERROR_SUCCESS) { + ThrowException(env, KEY_EXCEPTION, ss); + __leave; + } + } + // Create new byte array + if ((result = env->NewByteArray(dwBufLen)) == NULL) { + __leave; + } + + // Copy data from native buffer to Java buffer + env->SetByteArrayRegion(result, 0, dwBufLen, (jbyte*) pData); + } + __finally { + if (pData) { + delete [] pData; + } + } + + return result; +} + /* * Class: sun_security_mscapi_CPublicKey * Method: getPublicKeyBlob diff --git a/test/jdk/sun/security/mscapi/CngCipher.java b/test/jdk/sun/security/mscapi/CngCipher.java new file mode 100644 index 00000000000..b867641e8a5 --- /dev/null +++ b/test/jdk/sun/security/mscapi/CngCipher.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021, 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.Asserts; +import jdk.test.lib.SecurityTools; + +import java.util.Arrays; +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import java.security.KeyStore; + +/** + * @test + * @bug 8251134 + * @requires os.family == "windows" + * @summary Cipher operations on CNG keys + * @library /test/lib + */ + +public class CngCipher { + + final static String PREFIX = "8251134"; + + public static void main(String[] args) throws Exception { + cleanup(); + prepare(); + try { + test(PREFIX + "m"); + test(PREFIX + "c"); + } finally { + cleanup(); + } + } + + static void prepare() throws Exception { + // This will generate a MSCAPI key + SecurityTools.keytool("-storetype Windows-MY -genkeypair -alias " + + PREFIX + "m -keyalg RSA -dname CN=" + PREFIX + "m"); + // This will generate a CNG key + ProcessBuilder pb = new ProcessBuilder("powershell", "-Command", + "New-SelfSignedCertificate", "-DnsName", PREFIX + "c", + // -KeyAlgorithm not supported on Windows Server 2012 + //"-KeyAlgorithm", "RSA", + "-CertStoreLocation", "Cert:\\CurrentUser\\My"); + pb.inheritIO(); + pb.start().waitFor(); + } + + static void cleanup() throws Exception { + KeyStore ks = KeyStore.getInstance("Windows-MY"); + ks.load(null, null); + ks.deleteEntry(PREFIX +"c"); + ks.deleteEntry(PREFIX +"m"); + ks.store(null, null); + } + + static void test(String alias) throws Exception { + KeyStore ks = KeyStore.getInstance("Windows-MY"); + ks.load(null, null); + var alg = "RSA/ECB/PKCS1Padding"; + + var k1 = ks.getKey(alias, "changeit".toCharArray()); + var k2 = ks.getCertificate(alias).getPublicKey(); + + Cipher c; + + var k = KeyGenerator.getInstance("AES").generateKey(); + c = Cipher.getInstance(alg, "SunMSCAPI"); + c.init(Cipher.WRAP_MODE, k2); + var enc = c.wrap(k); + c = Cipher.getInstance(alg, "SunMSCAPI"); + c.init(Cipher.UNWRAP_MODE, k1); + var dec = c.unwrap(enc, "AES", Cipher.SECRET_KEY); + Asserts.assertTrue(Arrays.equals(k.getEncoded(), dec.getEncoded())); + + c = Cipher.getInstance(alg, "SunMSCAPI"); + c.init(Cipher.ENCRYPT_MODE, k2); + byte[] msg = "hello you fool".getBytes(java.nio.charset.StandardCharsets.UTF_8); + c.update(msg); + var enc2 = c.doFinal(); + c = Cipher.getInstance(alg, "SunMSCAPI"); + c.init(Cipher.DECRYPT_MODE, k1); + c.update(enc2); + var dec2 = c.doFinal(); + Asserts.assertTrue(Arrays.equals(msg, dec2)); + } +} -- GitLab From 3ff085e2967508ad312c9d32fa908807aefe69ee Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 26 Oct 2021 04:52:01 +0000 Subject: [PATCH 063/890] 8275582: Don't purge metaspace mapping lists Reviewed-by: coleenp, lkorinth --- .../share/memory/metaspace/chunkManager.cpp | 24 +++-------- .../share/memory/metaspace/internalStats.hpp | 3 -- .../share/memory/metaspace/rootChunkArea.cpp | 10 ----- .../share/memory/metaspace/rootChunkArea.hpp | 12 ------ .../memory/metaspace/virtualSpaceList.cpp | 37 ---------------- .../memory/metaspace/virtualSpaceList.hpp | 9 ---- .../memory/metaspace/virtualSpaceNode.cpp | 42 ------------------- .../memory/metaspace/virtualSpaceNode.hpp | 9 ---- .../elastic/MetaspaceTestWithThreads.java | 35 +++++++--------- 9 files changed, 19 insertions(+), 162 deletions(-) diff --git a/src/hotspot/share/memory/metaspace/chunkManager.cpp b/src/hotspot/share/memory/metaspace/chunkManager.cpp index 1c175f0cec6..c0c163d7b65 100644 --- a/src/hotspot/share/memory/metaspace/chunkManager.cpp +++ b/src/hotspot/share/memory/metaspace/chunkManager.cpp @@ -316,24 +316,11 @@ void ChunkManager::purge() { const size_t reserved_before = _vslist->reserved_words(); const size_t committed_before = _vslist->committed_words(); - int num_nodes_purged = 0; - - // We purge to return unused memory to the Operating System. We do this in - // two independent steps. - - // 1) We purge the virtual space list: any memory mappings which are - // completely deserted can be potentially unmapped. We iterate over the list - // of mappings (VirtualSpaceList::purge) and delete every node whose memory - // only contains free chunks. Deleting that node includes unmapping its memory, - // so all chunk vanish automatically. - // Of course we need to remove the chunk headers of those vanished chunks from - // the ChunkManager freelist. - num_nodes_purged = _vslist->purge(&_chunks); - InternalStats::inc_num_purges(); - - // 2) Since (1) is rather ineffective - it is rare that a whole node only contains - // free chunks - we now iterate over all remaining free chunks and - // and uncommit those which can be uncommitted (>= commit granule size). + + // We return unused memory to the Operating System: we iterate over all + // free chunks and uncommit the backing memory of those large enough to + // contain one or multiple commit granules (chunks larger than a granule + // always cover a whole number of granules and start at a granule boundary). if (Settings::uncommit_free_chunks()) { const chunklevel_t max_level = chunklevel::level_fitting_word_size(Settings::commit_granule_words()); @@ -365,7 +352,6 @@ void ChunkManager::purge() { ls.print("committed: "); print_word_size_delta(&ls, committed_before, committed_after); ls.cr(); - ls.print_cr("full nodes purged: %d", num_nodes_purged); } } DEBUG_ONLY(_vslist->verify_locked()); diff --git a/src/hotspot/share/memory/metaspace/internalStats.hpp b/src/hotspot/share/memory/metaspace/internalStats.hpp index 00d3e8f154c..dff2534e303 100644 --- a/src/hotspot/share/memory/metaspace/internalStats.hpp +++ b/src/hotspot/share/memory/metaspace/internalStats.hpp @@ -92,9 +92,6 @@ class InternalStats : public AllStatic { /* Number of chunk in place enlargements */ \ x(num_chunks_enlarged) \ \ - /* Number of times we did a purge */ \ - x(num_purges) \ - \ /* Number of times we read inconsistent stats. */ \ x(num_inconsistent_stats) \ diff --git a/src/hotspot/share/memory/metaspace/rootChunkArea.cpp b/src/hotspot/share/memory/metaspace/rootChunkArea.cpp index a3a03e5ba85..0df97ef87ff 100644 --- a/src/hotspot/share/memory/metaspace/rootChunkArea.cpp +++ b/src/hotspot/share/memory/metaspace/rootChunkArea.cpp @@ -481,16 +481,6 @@ RootChunkAreaLUT::~RootChunkAreaLUT() { FREE_C_HEAP_ARRAY(RootChunkArea, _arr); } -// Returns true if all areas in this area table are free (only contain free chunks). -bool RootChunkAreaLUT::is_free() const { - for (int i = 0; i < _num; i++) { - if (!_arr[i].is_free()) { - return false; - } - } - return true; -} - #ifdef ASSERT void RootChunkAreaLUT::verify() const { diff --git a/src/hotspot/share/memory/metaspace/rootChunkArea.hpp b/src/hotspot/share/memory/metaspace/rootChunkArea.hpp index 9ba6d736018..ce13f282a18 100644 --- a/src/hotspot/share/memory/metaspace/rootChunkArea.hpp +++ b/src/hotspot/share/memory/metaspace/rootChunkArea.hpp @@ -107,10 +107,6 @@ public: size_t word_size() const { return chunklevel::MAX_CHUNK_WORD_SIZE; } const MetaWord* end() const { return _base + word_size(); } - // Direct access to the first chunk (use with care) - Metachunk* first_chunk() { return _first_chunk; } - const Metachunk* first_chunk() const { return _first_chunk; } - // Returns true if this root chunk area is completely free: // In that case, it should only contain one chunk (maximally merged, so a root chunk) // and it should be free. @@ -182,20 +178,12 @@ public: return _arr + idx; } - // Access area by its index - int number_of_areas() const { return _num; } - RootChunkArea* get_area_by_index(int index) { assert(index >= 0 && index < _num, "oob"); return _arr + index; } - const RootChunkArea* get_area_by_index(int index) const { assert(index >= 0 && index < _num, "oob"); return _arr + index; } - /// range /// const MetaWord* base() const { return _base; } size_t word_size() const { return _num * chunklevel::MAX_CHUNK_WORD_SIZE; } const MetaWord* end() const { return _base + word_size(); } - // Returns true if all areas in this area table are free (only contain free chunks). - bool is_free() const; - DEBUG_ONLY(void verify() const;) void print_on(outputStream* st) const; diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp index 0383b2eff97..f9d66b81e0c 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp @@ -134,43 +134,6 @@ Metachunk* VirtualSpaceList::allocate_root_chunk() { return c; } -// Attempts to purge nodes. This will remove and delete nodes which only contain free chunks. -// The free chunks are removed from the freelists before the nodes are deleted. -// Return number of purged nodes. -int VirtualSpaceList::purge(FreeChunkListVector* freelists) { - assert_lock_strong(Metaspace_lock); - UL(debug, "purging."); - - VirtualSpaceNode* vsn = _first_node; - VirtualSpaceNode* prev_vsn = NULL; - int num = 0, num_purged = 0; - while (vsn != NULL) { - VirtualSpaceNode* next_vsn = vsn->next(); - bool purged = vsn->attempt_purge(freelists); - if (purged) { - // Note: from now on do not dereference vsn! - UL2(debug, "purged node @" PTR_FORMAT ".", p2i(vsn)); - if (_first_node == vsn) { - _first_node = next_vsn; - } - DEBUG_ONLY(vsn = (VirtualSpaceNode*)((uintptr_t)(0xdeadbeef));) - if (prev_vsn != NULL) { - prev_vsn->set_next(next_vsn); - } - num_purged++; - _nodes_counter.decrement(); - } else { - prev_vsn = vsn; - } - vsn = next_vsn; - num ++; - } - - UL2(debug, "purged %d nodes (before: %d, now: %d)", - num_purged, num, num_nodes()); - return num_purged; -} - // Print all nodes in this space list. void VirtualSpaceList::print_on(outputStream* st) const { MutexLocker fcl(Metaspace_lock, Mutex::_no_safepoint_check_flag); diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp index f105da7426e..2f2dd2988c2 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp @@ -48,10 +48,6 @@ class FreeChunkListVector; // managing a single contiguous memory region. The first node of // this list is the current node and used for allocation of new // root chunks. -// -// Beyond access to those nodes and the ability to grow new nodes -// (if expandable) it allows for purging: purging this list means -// removing and unmapping all memory regions which are unused. class VirtualSpaceList : public CHeapObj { @@ -101,11 +97,6 @@ public: // the list cannot be expanded (in practice this means we reached CompressedClassSpaceSize). Metachunk* allocate_root_chunk(); - // Attempts to purge nodes. This will remove and delete nodes which only contain free chunks. - // The free chunks are removed from the freelists before the nodes are deleted. - // Return number of purged nodes. - int purge(FreeChunkListVector* freelists); - //// Statistics //// // Return sum of reserved words in all nodes. diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp index a0e280b55a9..87fc5acde25 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp @@ -369,48 +369,6 @@ bool VirtualSpaceNode::attempt_enlarge_chunk(Metachunk* c, FreeChunkListVector* return rc; } -// Attempts to purge the node: -// -// If all chunks living in this node are free, they will all be removed from -// the freelist they currently reside in. Then, the node will be deleted. -// -// Returns true if the node has been deleted, false if not. -// !! If this returns true, do not access the node from this point on. !! -bool VirtualSpaceNode::attempt_purge(FreeChunkListVector* freelists) { - assert_lock_strong(Metaspace_lock); - - if (!_owns_rs) { - // We do not allow purging of nodes if we do not own the - // underlying ReservedSpace (CompressClassSpace case). - return false; - } - - // First find out if all areas are empty. Since empty chunks collapse to root chunk - // size, if all chunks in this node are free root chunks we are good to go. - if (!_root_chunk_area_lut.is_free()) { - return false; - } - - UL(debug, ": purging."); - - // Okay, we can purge. Before we can do this, we need to remove all chunks from the freelist. - for (int narea = 0; narea < _root_chunk_area_lut.number_of_areas(); narea++) { - RootChunkArea* ra = _root_chunk_area_lut.get_area_by_index(narea); - Metachunk* c = ra->first_chunk(); - if (c != NULL) { - UL2(trace, "removing chunk from to-be-purged node: " - METACHUNK_FULL_FORMAT ".", METACHUNK_FULL_FORMAT_ARGS(c)); - assert(c->is_free() && c->is_root_chunk(), "Sanity"); - freelists->remove(c); - } - } - - // Now, delete the node, then right away return since this object is invalid. - delete this; - - return true; -} - void VirtualSpaceNode::print_on(outputStream* st) const { size_t scale = K; diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp b/src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp index f3391cddc1a..0a1726601ab 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp @@ -208,15 +208,6 @@ public: // On success, true is returned, false otherwise. bool attempt_enlarge_chunk(Metachunk* c, FreeChunkListVector* freelists); - // Attempts to purge the node: - // - // If all chunks living in this node are free, they will all be removed from - // the freelist they currently reside in. Then, the node will be deleted. - // - // Returns true if the node has been deleted, false if not. - // !! If this returns true, do not access the node from this point on. !! - bool attempt_purge(FreeChunkListVector* freelists); - // Attempts to uncommit free areas according to the rules set in settings. // Returns number of words uncommitted. size_t uncommit_free_areas(); diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java index a5a20aaa356..d9bcfc2458d 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java @@ -59,40 +59,33 @@ public class MetaspaceTestWithThreads { void destroyArenasAndPurgeSpace() { + // This deletes the arenas, which will cause them to return all their accumulated + // metaspace chunks into the context' chunk manager (freelist) before vanishing. + // It then purges the context. + // We may return memory to the operating system: + // - with -XX:MetaspaceReclaimPolicy=balanced|aggressive (balanced is the default), + // we will scourge the freelist for chunks larger than a commit granule, and uncommit + // their backing memory. Note that since we deleted all arenas, all their chunks are + // in the freelist, should have been maximally folded by the buddy allocator, and + // therefore should all be eligible for uncommitting. Meaning the context should + // retain no memory at all, its committed counter should be zero. + // - with -XX:MetaspaceReclaimPolicy=none, we omit the purging and retain memory in the + // metaspace allocator, so the context should retain its memory. + for (RandomAllocatorThread t: threads) { if (t.allocator.arena.isLive()) { context.destroyArena(t.allocator.arena); } } - - context.checkStatistics(); - - // After deleting all arenas, we should have no committed space left: all arena chunks have been returned to - // the freelist amd should have been maximally merged to a bunch of root chunks, which should be uncommitted - // in one go. - // Exception: if reclamation policy is none. - if (Settings.settings().doesReclaim()) { - if (context.committedWords() > 0) { - throw new RuntimeException("Expected no committed words after purging empty metaspace context (was: " + context.committedWords() + ")"); - } - } - context.purge(); context.checkStatistics(); - // After purging - if all arenas had been deleted before - we should have no committed space left even in - // recmalation=none mode: - // purging deletes all nodes with only free chunks, and in this case no node should still house in-use chunks, - // so all nodes would have been unmapped. - // This is independent on reclamation policy. Only one exception: if the area was created with a reserve limit - // (mimicking compressed class space), the underlying virtual space list cannot be purged. - if (context.reserveLimit == 0) { + if (Settings.settings().doesReclaim()) { if (context.committedWords() > 0) { throw new RuntimeException("Expected no committed words after purging empty metaspace context (was: " + context.committedWords() + ")"); } } - } @Override -- GitLab From 174f553f7e3dbc91662ba51bc3813a4be0ee97c4 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Tue, 26 Oct 2021 12:05:09 +0000 Subject: [PATCH 064/890] 8275869: Problem list applications/jcstress/copy.java on Linux-aarch64 Reviewed-by: lfoltan, dholmes --- test/hotspot/jtreg/ProblemList.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index ae0e0e4b5a9..2d7230da25f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -100,7 +100,7 @@ runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 -applications/jcstress/copy.java 8229852 linux-x64 +applications/jcstress/copy.java 8229852 linux-all ############################################################################# -- GitLab From 4961373a676126cd557f92a2e7bbc8c66b2976b1 Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Tue, 26 Oct 2021 12:17:47 +0000 Subject: [PATCH 065/890] 8275137: jdk.unsupported/sun.reflect.ReflectionFactory.readObjectNoDataForSerialization uses wrong signature Reviewed-by: dfuchs --- .../internal/reflect/ReflectionFactory.java | 5 +-- .../sun/reflect/ReflectionFactory.java | 6 ++-- .../ReflectionFactoryTest.java | 35 +++++++++---------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java b/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java index 17f0c7d95f2..5f1106db472 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java +++ b/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java @@ -478,7 +478,7 @@ public class ReflectionFactory { } public final MethodHandle readObjectNoDataForSerialization(Class cl) { - return findReadWriteObjectForSerialization(cl, "readObjectNoData", ObjectInputStream.class); + return findReadWriteObjectForSerialization(cl, "readObjectNoData", null); } public final MethodHandle writeObjectForSerialization(Class cl) { @@ -493,7 +493,8 @@ public class ReflectionFactory { } try { - Method meth = cl.getDeclaredMethod(methodName, streamClass); + Method meth = streamClass == null ? cl.getDeclaredMethod(methodName) + : cl.getDeclaredMethod(methodName, streamClass); int mods = meth.getModifiers(); if (meth.getReturnType() != Void.TYPE || Modifier.isStatic(mods) || diff --git a/src/jdk.unsupported/share/classes/sun/reflect/ReflectionFactory.java b/src/jdk.unsupported/share/classes/sun/reflect/ReflectionFactory.java index 66c1a072020..f6f9b3976fc 100644 --- a/src/jdk.unsupported/share/classes/sun/reflect/ReflectionFactory.java +++ b/src/jdk.unsupported/share/classes/sun/reflect/ReflectionFactory.java @@ -144,9 +144,9 @@ public class ReflectionFactory { /** * Returns a direct MethodHandle for the {@code readObjectNoData} method on * a Serializable class. - * The first argument of {@link MethodHandle#invoke} is the serializable - * object and the second argument is the {@code ObjectInputStream} passed to - * {@code readObjectNoData}. + * The only argument of {@link MethodHandle#invoke} is the serializable + * object, which {@code readObjectNoData} is called on. No arguments are + * passed to the {@code readObjectNoData} method. * * @param cl a Serializable class * @return a direct MethodHandle for the {@code readObjectNoData} method diff --git a/test/jdk/sun/reflect/ReflectionFactory/ReflectionFactoryTest.java b/test/jdk/sun/reflect/ReflectionFactory/ReflectionFactoryTest.java index 3fac89f81a6..853b5f394ff 100644 --- a/test/jdk/sun/reflect/ReflectionFactory/ReflectionFactoryTest.java +++ b/test/jdk/sun/reflect/ReflectionFactory/ReflectionFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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,6 +29,7 @@ import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; +import java.io.ObjectStreamException; import java.io.OptionalDataException; import java.io.Serializable; import java.lang.invoke.MethodHandle; @@ -45,11 +46,11 @@ import org.testng.TestNG; /* * @test - * @bug 8137058 8164908 8168980 - * @run testng ReflectionFactoryTest - * @run testng/othervm/policy=security.policy ReflectionFactoryTest + * @bug 8137058 8164908 8168980 8275137 * @summary Basic test for the unsupported ReflectionFactory * @modules jdk.unsupported + * @run testng ReflectionFactoryTest + * @run testng/othervm/policy=security.policy ReflectionFactoryTest */ public class ReflectionFactoryTest { @@ -81,8 +82,7 @@ public class ReflectionFactoryTest { */ @Test(dataProvider="ClassConstructors") static void testConstructor(Class type) - throws NoSuchMethodException, InstantiationException, - IllegalAccessException, InvocationTargetException + throws InstantiationException, IllegalAccessException, InvocationTargetException { @SuppressWarnings("unchecked") Constructor c = factory.newConstructorForSerialization(type); @@ -131,8 +131,8 @@ public class ReflectionFactoryTest { } Assert.assertEquals(((Foo)o).foo(), expectedFoo); - if (o instanceof Baz) { - Assert.assertEquals(((Baz)o).baz(), expectedBaz); + if (o instanceof Baz b) { + Assert.assertEquals(b.baz(), expectedBaz); } } @@ -178,7 +178,7 @@ public class ReflectionFactoryTest { } /** - * Test newConstructorForExternalization returns the constructor and it can be called. + * Tests that newConstructorForExternalization returns the constructor and it can be called. * @throws NoSuchMethodException - error * @throws InstantiationException - error * @throws IllegalAccessException - error @@ -186,8 +186,7 @@ public class ReflectionFactoryTest { */ @Test static void newConstructorForExternalization() - throws NoSuchMethodException, InstantiationException, - IllegalAccessException, InvocationTargetException { + throws InstantiationException, IllegalAccessException, InvocationTargetException { Constructor cons = factory.newConstructorForExternalization(Ext.class); Ext ext = (Ext)cons.newInstance(); Assert.assertEquals(ext.ext, 1, "Constructor not run"); @@ -251,7 +250,7 @@ public class ReflectionFactoryTest { Assert.assertFalse(ser2.readObjectNoDataCalled, "readObjectNoData should not be called"); Assert.assertFalse(ser2.readResolveCalled, "readResolve should not be called"); - readObjectNoDataMethod.invoke(ser2, ois); + readObjectNoDataMethod.invoke(ser2); Assert.assertTrue(ser2.readObjectCalled, "readObject should have been called"); Assert.assertTrue(ser2.readObjectNoDataCalled, "readObjectNoData not called"); Assert.assertFalse(ser2.readResolveCalled, "readResolve should not be called"); @@ -283,12 +282,12 @@ public class ReflectionFactoryTest { public Ser() {} - private void readObject(ObjectInputStream ois) throws IOException { + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { Assert.assertFalse(writeObjectCalled, "readObject called too many times"); readObjectCalled = ois.readBoolean(); } - private void readObjectNoData(ObjectInputStream ois) throws IOException { + private void readObjectNoData() throws ObjectStreamException { Assert.assertFalse(readObjectNoDataCalled, "readObjectNoData called too many times"); readObjectNoDataCalled = true; } @@ -299,13 +298,13 @@ public class ReflectionFactoryTest { oos.writeBoolean(writeObjectCalled); } - private Object writeReplace() { + private Object writeReplace() throws ObjectStreamException { Assert.assertFalse(writeReplaceCalled, "writeReplace called too many times"); writeReplaceCalled = true; return this; } - private Object readResolve() { + private Object readResolve() throws ObjectStreamException { Assert.assertFalse(readResolveCalled, "readResolve called too many times"); readResolveCalled = true; return this; @@ -313,7 +312,7 @@ public class ReflectionFactoryTest { } /** - * Test the constructor of OptionalDataExceptions. + * Tests the constructor of OptionalDataExceptions. */ @Test static void newOptionalDataException() { @@ -324,8 +323,6 @@ public class ReflectionFactoryTest { } - - // Main can be used to run the tests from the command line with only testng.jar. @SuppressWarnings("raw_types") @Test(enabled = false) -- GitLab From 63e0f344e9a2da135c76caff11e437dfc40408a6 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Tue, 26 Oct 2021 12:32:49 +0000 Subject: [PATCH 066/890] 8275767: JDK source code contains redundant boolean operations in jdk.charsets Reviewed-by: lancea, rriggs, iris --- .../share/classes/sun/nio/cs/ext/IBM964.java.template | 2 +- .../share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM964.java.template b/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM964.java.template index 63615c2bd55..6e44dd6fce8 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM964.java.template +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM964.java.template @@ -203,7 +203,7 @@ public class IBM964 } protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) { - if (true && src.hasArray() && dst.hasArray()) + if (src.hasArray() && dst.hasArray()) return decodeArrayLoop(src, dst); else return decodeBufferLoop(src, dst); diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java.template b/src/jdk.charsets/share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java.template index 0811087cd21..235bba0bb98 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java.template +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/SimpleEUCEncoder.java.template @@ -260,7 +260,7 @@ public abstract class SimpleEUCEncoder } protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { - if (true && src.hasArray() && dst.hasArray()) + if (src.hasArray() && dst.hasArray()) return encodeArrayLoop(src, dst); else return encodeBufferLoop(src, dst); -- GitLab From 4be88d5482d45e22eb756a6e2ad19ebd7110639a Mon Sep 17 00:00:00 2001 From: Jatin Bhateja Date: Tue, 26 Oct 2021 12:34:56 +0000 Subject: [PATCH 067/890] 8275047: Optimize existing fill stubs for AVX-512 target Reviewed-by: kvn, redestad --- src/hotspot/cpu/x86/macroAssembler_x86.cpp | 260 ++++++++++++++++-- src/hotspot/cpu/x86/macroAssembler_x86.hpp | 16 +- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 5 +- src/hotspot/cpu/x86/stubRoutines_x86.hpp | 2 +- src/hotspot/cpu/x86/vm_version_x86.cpp | 14 +- .../openjdk/bench/java/util/ArraysFill.java | 8 +- 6 files changed, 262 insertions(+), 43 deletions(-) diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 072e7962b8b..30056be9a65 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -5026,7 +5026,7 @@ void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, X BIND(L_loop); if (MaxVectorSize >= 32) { - fill64_avx(base, 0, xtmp, use64byteVector); + fill64(base, 0, xtmp, use64byteVector); } else { movdqu(Address(base, 0), xtmp); movdqu(Address(base, 16), xtmp); @@ -5043,7 +5043,7 @@ void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, X if (use64byteVector) { addptr(cnt, 8); jccb(Assembler::equal, L_end); - fill64_masked_avx(3, base, 0, xtmp, mask, cnt, rtmp, true); + fill64_masked(3, base, 0, xtmp, mask, cnt, rtmp, true); jmp(L_end); } else { addptr(cnt, 4); @@ -5062,7 +5062,7 @@ void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, X addptr(cnt, 4); jccb(Assembler::lessEqual, L_end); if (UseAVX > 2 && MaxVectorSize >= 32 && VM_Version::supports_avx512vl()) { - fill32_masked_avx(3, base, 0, xtmp, mask, cnt, rtmp); + fill32_masked(3, base, 0, xtmp, mask, cnt, rtmp); } else { decrement(cnt); @@ -5086,7 +5086,7 @@ void MacroAssembler::clear_mem(Register base, int cnt, Register rtmp, XMMRegiste // 64 byte initialization loop. vpxor(xtmp, xtmp, xtmp, use64byteVector ? AVX_512bit : AVX_256bit); for (int i = 0; i < vector64_count; i++) { - fill64_avx(base, i * 64, xtmp, use64byteVector); + fill64(base, i * 64, xtmp, use64byteVector); } // Clear remaining 64 byte tail. @@ -5207,6 +5207,15 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned, Label L_exit; Label L_fill_2_bytes, L_fill_4_bytes; +#if defined(COMPILER2) && defined(_LP64) + if(MaxVectorSize >=32 && + VM_Version::supports_avx512vlbw() && + VM_Version::supports_bmi2()) { + generate_fill_avx3(t, to, value, count, rtmp, xtmp); + return; + } +#endif + int shift = -1; switch (t) { case T_BYTE: @@ -5427,6 +5436,30 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned, BIND(L_exit); } +void MacroAssembler::evpbroadcast(BasicType type, XMMRegister dst, Register src, int vector_len) { + switch(type) { + case T_BYTE: + case T_BOOLEAN: + evpbroadcastb(dst, src, vector_len); + break; + case T_SHORT: + case T_CHAR: + evpbroadcastw(dst, src, vector_len); + break; + case T_INT: + case T_FLOAT: + evpbroadcastd(dst, src, vector_len); + break; + case T_LONG: + case T_DOUBLE: + evpbroadcastq(dst, src, vector_len); + break; + default: + fatal("Unhandled type : %s", type2name(type)); + break; + } +} + // encode char[] to byte[] in ISO_8859_1 or ASCII //@IntrinsicCandidate //private static int implEncodeISOArray(byte[] sa, int sp, @@ -8236,59 +8269,234 @@ void MacroAssembler::evmovdqu(BasicType type, KRegister kmask, Address dst, XMMR #if COMPILER2_OR_JVMCI +void MacroAssembler::fill_masked(BasicType bt, Address dst, XMMRegister xmm, KRegister mask, + Register length, Register temp, int vec_enc) { + // Computing mask for predicated vector store. + movptr(temp, -1); + bzhiq(temp, temp, length); + kmov(mask, temp); + evmovdqu(bt, mask, dst, xmm, vec_enc); +} // Set memory operation for length "less than" 64 bytes. -void MacroAssembler::fill64_masked_avx(uint shift, Register dst, int disp, +void MacroAssembler::fill64_masked(uint shift, Register dst, int disp, XMMRegister xmm, KRegister mask, Register length, Register temp, bool use64byteVector) { assert(MaxVectorSize >= 32, "vector length should be >= 32"); - assert(shift != 0, "shift value should be 1 (short),2(int) or 3(long)"); - BasicType type[] = { T_BYTE, T_SHORT, T_INT, T_LONG}; + BasicType type[] = { T_BYTE, T_SHORT, T_INT, T_LONG}; if (!use64byteVector) { - fill32_avx(dst, disp, xmm); + fill32(dst, disp, xmm); subptr(length, 32 >> shift); - fill32_masked_avx(shift, dst, disp + 32, xmm, mask, length, temp); + fill32_masked(shift, dst, disp + 32, xmm, mask, length, temp); } else { assert(MaxVectorSize == 64, "vector length != 64"); - movl(temp, 1); - shlxl(temp, temp, length); - subptr(temp, 1); - kmovwl(mask, temp); - evmovdqu(type[shift], mask, Address(dst, disp), xmm, Assembler::AVX_512bit); + fill_masked(type[shift], Address(dst, disp), xmm, mask, length, temp, Assembler::AVX_512bit); } } -void MacroAssembler::fill32_masked_avx(uint shift, Register dst, int disp, +void MacroAssembler::fill32_masked(uint shift, Register dst, int disp, XMMRegister xmm, KRegister mask, Register length, Register temp) { assert(MaxVectorSize >= 32, "vector length should be >= 32"); - assert(shift != 0, "shift value should be 1 (short), 2(int) or 3(long)"); - BasicType type[] = { T_BYTE, T_SHORT, T_INT, T_LONG}; - movl(temp, 1); - shlxl(temp, temp, length); - subptr(temp, 1); - kmovwl(mask, temp); - evmovdqu(type[shift], mask, Address(dst, disp), xmm, Assembler::AVX_256bit); + BasicType type[] = { T_BYTE, T_SHORT, T_INT, T_LONG}; + fill_masked(type[shift], Address(dst, disp), xmm, mask, length, temp, Assembler::AVX_256bit); } -void MacroAssembler::fill32_avx(Register dst, int disp, XMMRegister xmm) { +void MacroAssembler::fill32(Register dst, int disp, XMMRegister xmm) { assert(MaxVectorSize >= 32, "vector length should be >= 32"); vmovdqu(Address(dst, disp), xmm); } -void MacroAssembler::fill64_avx(Register dst, int disp, XMMRegister xmm, bool use64byteVector) { +void MacroAssembler::fill64(Register dst, int disp, XMMRegister xmm, bool use64byteVector) { assert(MaxVectorSize >= 32, "vector length should be >= 32"); BasicType type[] = {T_BYTE, T_SHORT, T_INT, T_LONG}; if (!use64byteVector) { - fill32_avx(dst, disp, xmm); - fill32_avx(dst, disp + 32, xmm); + fill32(dst, disp, xmm); + fill32(dst, disp + 32, xmm); } else { evmovdquq(Address(dst, disp), xmm, Assembler::AVX_512bit); } } +#ifdef _LP64 +void MacroAssembler::generate_fill_avx3(BasicType type, Register to, Register value, + Register count, Register rtmp, XMMRegister xtmp) { + Label L_exit; + Label L_fill_start; + Label L_fill_64_bytes; + Label L_fill_96_bytes; + Label L_fill_128_bytes; + Label L_fill_128_bytes_loop; + Label L_fill_128_loop_header; + Label L_fill_128_bytes_loop_header; + Label L_fill_128_bytes_loop_pre_header; + Label L_fill_zmm_sequence; + + int shift = -1; + switch(type) { + case T_BYTE: shift = 0; + break; + case T_SHORT: shift = 1; + break; + case T_INT: shift = 2; + break; + /* Uncomment when LONG fill stubs are supported. + case T_LONG: shift = 3; + break; + */ + default: + fatal("Unhandled type: %s\n", type2name(type)); + } + + if (AVX3Threshold != 0 || MaxVectorSize == 32) { + + if (MaxVectorSize == 64) { + cmpq(count, AVX3Threshold >> shift); + jcc(Assembler::greater, L_fill_zmm_sequence); + } + + evpbroadcast(type, xtmp, value, Assembler::AVX_256bit); + + bind(L_fill_start); + + cmpq(count, 32 >> shift); + jccb(Assembler::greater, L_fill_64_bytes); + fill32_masked(shift, to, 0, xtmp, k2, count, rtmp); + jmp(L_exit); + + bind(L_fill_64_bytes); + cmpq(count, 64 >> shift); + jccb(Assembler::greater, L_fill_96_bytes); + fill64_masked(shift, to, 0, xtmp, k2, count, rtmp); + jmp(L_exit); + + bind(L_fill_96_bytes); + cmpq(count, 96 >> shift); + jccb(Assembler::greater, L_fill_128_bytes); + fill64(to, 0, xtmp); + subq(count, 64 >> shift); + fill32_masked(shift, to, 64, xtmp, k2, count, rtmp); + jmp(L_exit); + + bind(L_fill_128_bytes); + cmpq(count, 128 >> shift); + jccb(Assembler::greater, L_fill_128_bytes_loop_pre_header); + fill64(to, 0, xtmp); + fill32(to, 64, xtmp); + subq(count, 96 >> shift); + fill32_masked(shift, to, 96, xtmp, k2, count, rtmp); + jmp(L_exit); + + bind(L_fill_128_bytes_loop_pre_header); + { + mov(rtmp, to); + andq(rtmp, 31); + jccb(Assembler::zero, L_fill_128_bytes_loop_header); + negq(rtmp); + addq(rtmp, 32); + mov64(r8, -1L); + bzhiq(r8, r8, rtmp); + kmovql(k2, r8); + evmovdqu(T_BYTE, k2, Address(to, 0), xtmp, Assembler::AVX_256bit); + addq(to, rtmp); + shrq(rtmp, shift); + subq(count, rtmp); + } + + cmpq(count, 128 >> shift); + jcc(Assembler::less, L_fill_start); + + bind(L_fill_128_bytes_loop_header); + subq(count, 128 >> shift); + + align32(); + bind(L_fill_128_bytes_loop); + fill64(to, 0, xtmp); + fill64(to, 64, xtmp); + addq(to, 128); + subq(count, 128 >> shift); + jccb(Assembler::greaterEqual, L_fill_128_bytes_loop); + + addq(count, 128 >> shift); + jcc(Assembler::zero, L_exit); + jmp(L_fill_start); + } + + if (MaxVectorSize == 64) { + // Sequence using 64 byte ZMM register. + Label L_fill_128_bytes_zmm; + Label L_fill_192_bytes_zmm; + Label L_fill_192_bytes_loop_zmm; + Label L_fill_192_bytes_loop_header_zmm; + Label L_fill_192_bytes_loop_pre_header_zmm; + Label L_fill_start_zmm_sequence; + + bind(L_fill_zmm_sequence); + evpbroadcast(type, xtmp, value, Assembler::AVX_512bit); + + bind(L_fill_start_zmm_sequence); + cmpq(count, 64 >> shift); + jccb(Assembler::greater, L_fill_128_bytes_zmm); + fill64_masked(shift, to, 0, xtmp, k2, count, rtmp, true); + jmp(L_exit); + + bind(L_fill_128_bytes_zmm); + cmpq(count, 128 >> shift); + jccb(Assembler::greater, L_fill_192_bytes_zmm); + fill64(to, 0, xtmp, true); + subq(count, 64 >> shift); + fill64_masked(shift, to, 64, xtmp, k2, count, rtmp, true); + jmp(L_exit); + + bind(L_fill_192_bytes_zmm); + cmpq(count, 192 >> shift); + jccb(Assembler::greater, L_fill_192_bytes_loop_pre_header_zmm); + fill64(to, 0, xtmp, true); + fill64(to, 64, xtmp, true); + subq(count, 128 >> shift); + fill64_masked(shift, to, 128, xtmp, k2, count, rtmp, true); + jmp(L_exit); + + bind(L_fill_192_bytes_loop_pre_header_zmm); + { + movq(rtmp, to); + andq(rtmp, 63); + jccb(Assembler::zero, L_fill_192_bytes_loop_header_zmm); + negq(rtmp); + addq(rtmp, 64); + mov64(r8, -1L); + bzhiq(r8, r8, rtmp); + kmovql(k2, r8); + evmovdqu(T_BYTE, k2, Address(to, 0), xtmp, Assembler::AVX_512bit); + addq(to, rtmp); + shrq(rtmp, shift); + subq(count, rtmp); + } + + cmpq(count, 192 >> shift); + jcc(Assembler::less, L_fill_start_zmm_sequence); + + bind(L_fill_192_bytes_loop_header_zmm); + subq(count, 192 >> shift); + + align32(); + bind(L_fill_192_bytes_loop_zmm); + fill64(to, 0, xtmp, true); + fill64(to, 64, xtmp, true); + fill64(to, 128, xtmp, true); + addq(to, 192); + subq(count, 192 >> shift); + jccb(Assembler::greaterEqual, L_fill_192_bytes_loop_zmm); + + addq(count, 192 >> shift); + jcc(Assembler::zero, L_exit); + jmp(L_fill_start_zmm_sequence); + } + bind(L_exit); +} +#endif #endif //COMPILER2_OR_JVMCI diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 9b9e85643b8..415223253c7 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -1305,6 +1305,7 @@ public: void evpcmpw(KRegister kdst, KRegister mask, XMMRegister nds, AddressLiteral src, int comparison, bool is_signed, int vector_len, Register scratch_reg); + void evpbroadcast(BasicType type, XMMRegister dst, Register src, int vector_len); // Emit comparison instruction for the specified comparison predicate. void vpcmpCCW(XMMRegister dst, XMMRegister nds, XMMRegister src, ComparisonPredicate cond, Width width, int vector_len, Register scratch_reg); @@ -1838,17 +1839,20 @@ public: void byte_array_inflate(Register src, Register dst, Register len, XMMRegister tmp1, Register tmp2, KRegister mask = knoreg); - void fill64_masked_avx(uint shift, Register dst, int disp, + void fill_masked(BasicType bt, Address dst, XMMRegister xmm, KRegister mask, + Register length, Register temp, int vec_enc); + + void fill64_masked(uint shift, Register dst, int disp, XMMRegister xmm, KRegister mask, Register length, Register temp, bool use64byteVector = false); - void fill32_masked_avx(uint shift, Register dst, int disp, + void fill32_masked(uint shift, Register dst, int disp, XMMRegister xmm, KRegister mask, Register length, Register temp); - void fill32_avx(Register dst, int disp, XMMRegister xmm); + void fill32(Register dst, int disp, XMMRegister xmm); - void fill64_avx(Register dst, int dis, XMMRegister xmm, bool use64byteVector = false); + void fill64(Register dst, int dis, XMMRegister xmm, bool use64byteVector = false); #ifdef _LP64 void convert_f2i(Register dst, XMMRegister src); @@ -1885,6 +1889,10 @@ public: void copy64_avx(Register dst, Register src, Register index, XMMRegister xmm, bool conjoint, int shift = Address::times_1, int offset = 0, bool use64byteVector = false); + + void generate_fill_avx3(BasicType type, Register to, Register value, + Register count, Register rtmp, XMMRegister xtmp); + #endif // COMPILER2_OR_JVMCI #endif // _LP64 diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 70fd2e67da1..c23b5edc3fb 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -2113,13 +2113,14 @@ class StubGenerator: public StubCodeGenerator { BLOCK_COMMENT("Entry:"); - const Register to = c_rarg0; // source array address + const Register to = c_rarg0; // destination array address const Register value = c_rarg1; // value const Register count = c_rarg2; // elements count + __ mov(r11, count); __ enter(); // required for proper stackwalking of RuntimeStub frame - __ generate_fill(t, aligned, to, value, count, rax, xmm0); + __ generate_fill(t, aligned, to, value, r11, rax, xmm0); __ vzeroupper(); __ leave(); // required for proper stackwalking of RuntimeStub frame diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.hpp b/src/hotspot/cpu/x86/stubRoutines_x86.hpp index b93e50b6d51..4134990dcbb 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp @@ -33,7 +33,7 @@ static bool returns_to_call_stub(address return_pc) { return return_pc == _call_ enum platform_dependent_constants { code_size1 = 20000 LP64_ONLY(+10000), // simply increase if too small (assembler will crash if too small) - code_size2 = 35300 LP64_ONLY(+32000) // simply increase if too small (assembler will crash if too small) + code_size2 = 35300 LP64_ONLY(+35000) // simply increase if too small (assembler will crash if too small) }; class x86 { diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index eb60216d595..605faf89f19 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1469,6 +1469,14 @@ void VM_Version::get_processor_features() { #endif } +#ifdef COMPILER2 + if (FLAG_IS_DEFAULT(OptimizeFill)) { + if (MaxVectorSize < 32 || !VM_Version::supports_avx512vlbw()) { + OptimizeFill = false; + } + } +#endif + #ifdef _LP64 if (UseSSE42Intrinsics) { if (FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) { @@ -1585,12 +1593,6 @@ void VM_Version::get_processor_features() { // Modern processors allow misaligned memory operations for vectors. AlignVector = !UseUnalignedLoadStores; } - if (FLAG_IS_DEFAULT(OptimizeFill)) { - // 8247307: On x86, the auto-vectorized loop array fill code shows - // better performance than the array fill stubs. We should reenable - // this after the x86 stubs get improved. - OptimizeFill = false; - } #endif // COMPILER2 if (FLAG_IS_DEFAULT(AllocatePrefetchInstr)) { diff --git a/test/micro/org/openjdk/bench/java/util/ArraysFill.java b/test/micro/org/openjdk/bench/java/util/ArraysFill.java index 26f8b83af42..e9b6a45a43f 100644 --- a/test/micro/org/openjdk/bench/java/util/ArraysFill.java +++ b/test/micro/org/openjdk/bench/java/util/ArraysFill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -36,12 +36,12 @@ import org.openjdk.jmh.annotations.Warmup; import java.util.Arrays; import java.util.concurrent.TimeUnit; -@BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(TimeUnit.NANOSECONDS) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) @State(Scope.Thread) public class ArraysFill { - @Param({"10", "266", "2048"}) + @Param({"10", "16", "31", "59", "89", "126", "250", "266", "511", "1021", "2047", "2048", "4095", "8195"}) public int size; public byte[] testByteArray; -- GitLab From 7ca053de218bf76ea06bbeed860d142db381ca53 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Tue, 26 Oct 2021 12:37:54 +0000 Subject: [PATCH 068/890] 8251904: vmTestbase/nsk/sysdict/vm/stress/btree/btree010/btree010.java fails with ClassNotFoundException: nsk.sysdict.share.BTree0LLRLRLRRLR Reviewed-by: dholmes, lmesnik --- .../jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java | 4 ++-- .../vmTestbase/nsk/sysdict/share/SysDictTest.java | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java index d14f3091495..e041f90b71d 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/BTreeTest.java @@ -59,7 +59,7 @@ public class BTreeTest extends SysDictTest { } try { // Load FatsInfo with URLClassLoader btree.jar & fats.jar should not - // present in classpath + // be present in classpath Class info; if (useFats) { info = createJarLoader().loadClass(PACKAGE_PREFIX + "FatsInfo"); @@ -76,7 +76,7 @@ public class BTreeTest extends SysDictTest { } if (level >= height) { - throw new Failure("Icorrect level : " + level + " .Should be less then " + height); + throw new Failure("Incorrect level : " + level + " should be less than " + height); } // generate names for all nodes at the given level: diff --git a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java index f7ce05fc918..043cbf8b80e 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, 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 @@ -62,7 +62,7 @@ public abstract class SysDictTest extends ThreadedGCTest { if (args[i].equals("-useSingleLoader")) { this.useSingleLoader = false; } - // jar path is in useal classpath format + // jar path is in usual classpath format if (args[i].equals("-jarpath")) { String[] files = args[i + 1].split(File.pathSeparator); jars = new URL[files.length]; @@ -148,11 +148,8 @@ public abstract class SysDictTest extends ThreadedGCTest { // set name into public variable just to be sure // that class is loaded tmp = clz.getName(); - } catch (ClassNotFoundException cnfe) { - throw new TestFailure(cnfe); - } catch (OutOfMemoryError oome) { + } catch (OutOfMemoryError | ClassNotFoundException e) { // just ignore - // we do not check memory leaks in PermGen in this tests } catch (StackOverflowError soe) { // just ignore, chains could be too large // StackOverflowError could be in some sparcs @@ -164,6 +161,7 @@ public abstract class SysDictTest extends ThreadedGCTest { } } + @Override protected Runnable createRunnable(int i) { currentClassLoaders = createClassLoadersInternal(); -- GitLab From 71d593ede6e1d0a50798d4ba6bfbd78aa65ae7d8 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 26 Oct 2021 14:33:22 +0000 Subject: [PATCH 069/890] 8275162: Use varargs in 'def' macros in mutexLocker.cpp Reviewed-by: dholmes, pchilanomate --- src/hotspot/share/runtime/mutexLocker.cpp | 158 +++++++++++----------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index 35900865d37..34b19eb51ac 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -199,161 +199,161 @@ static void add_mutex(Mutex* var) { _mutex_array[_num_mutex++] = var; } -#define def(var, type, pri, vm_block) { \ - var = new type(Mutex::pri, #var, vm_block); \ +#define def(var, type, pri, ...) { \ + var = new type(Mutex::pri, #var, ##__VA_ARGS__); \ add_mutex(var); \ } // Specify relative ranked lock #ifdef ASSERT -#define defl(var, type, held_lock, vm_block) { \ - var = new type(held_lock->rank()-1, #var, vm_block); \ +#define defl(var, type, held_lock, ...) { \ + var = new type(held_lock->rank()-1, #var, ##__VA_ARGS__); \ add_mutex(var); \ } #else -#define defl(var, type, held_lock, vm_block) { \ - var = new type(Mutex::safepoint, #var, vm_block); \ +#define defl(var, type, held_lock, ...) { \ + var = new type(Mutex::safepoint, #var, ##__VA_ARGS__); \ add_mutex(var); \ } #endif // Using Padded subclasses to prevent false sharing of these global monitors and mutexes. void mutex_init() { - def(tty_lock , PaddedMutex , tty, true); // allow to lock in VM + def(tty_lock , PaddedMutex , tty); // allow to lock in VM - def(STS_lock , PaddedMonitor, nosafepoint, true); + def(STS_lock , PaddedMonitor, nosafepoint); if (UseG1GC) { - def(CGC_lock , PaddedMonitor, nosafepoint, true); + def(CGC_lock , PaddedMonitor, nosafepoint); - def(G1DetachedRefinementStats_lock, PaddedMutex, nosafepoint-2, true); + def(G1DetachedRefinementStats_lock, PaddedMutex, nosafepoint-2); - def(FreeList_lock , PaddedMutex , service-1, true); - def(OldSets_lock , PaddedMutex , nosafepoint, true); - def(Uncommit_lock , PaddedMutex , service-2, true); - def(RootRegionScan_lock , PaddedMonitor, nosafepoint-1, true); + def(FreeList_lock , PaddedMutex , service-1); + def(OldSets_lock , PaddedMutex , nosafepoint); + def(Uncommit_lock , PaddedMutex , service-2); + def(RootRegionScan_lock , PaddedMonitor, nosafepoint-1); - def(MarkStackFreeList_lock , PaddedMutex , nosafepoint, true); - def(MarkStackChunkList_lock , PaddedMutex , nosafepoint, true); + def(MarkStackFreeList_lock , PaddedMutex , nosafepoint); + def(MarkStackChunkList_lock , PaddedMutex , nosafepoint); - def(MonitoringSupport_lock , PaddedMutex , service-1, true); // used for serviceability monitoring support + def(MonitoringSupport_lock , PaddedMutex , service-1); // used for serviceability monitoring support } - def(StringDedup_lock , PaddedMonitor, nosafepoint, true); - def(StringDedupIntern_lock , PaddedMutex , nosafepoint, true); - def(ParGCRareEvent_lock , PaddedMutex , safepoint, true); - def(RawMonitor_lock , PaddedMutex , nosafepoint-1, true); + def(StringDedup_lock , PaddedMonitor, nosafepoint); + def(StringDedupIntern_lock , PaddedMutex , nosafepoint); + def(ParGCRareEvent_lock , PaddedMutex , safepoint, true); + def(RawMonitor_lock , PaddedMutex , nosafepoint-1); - def(Metaspace_lock , PaddedMutex , nosafepoint-3, true); + def(Metaspace_lock , PaddedMutex , nosafepoint-3); - def(Patching_lock , PaddedMutex , nosafepoint, true); // used for safepointing and code patching. - def(MonitorDeflation_lock , PaddedMonitor, nosafepoint, true); // used for monitor deflation thread operations - def(Service_lock , PaddedMonitor, service, true); // used for service thread operations + def(Patching_lock , PaddedMutex , nosafepoint); // used for safepointing and code patching. + def(MonitorDeflation_lock , PaddedMonitor, nosafepoint); // used for monitor deflation thread operations + def(Service_lock , PaddedMonitor, service); // used for service thread operations if (UseNotificationThread) { - def(Notification_lock , PaddedMonitor, service, true); // used for notification thread operations + def(Notification_lock , PaddedMonitor, service); // used for notification thread operations } else { Notification_lock = Service_lock; } - def(JmethodIdCreation_lock , PaddedMutex , nosafepoint-2, true); // used for creating jmethodIDs. + def(JmethodIdCreation_lock , PaddedMutex , nosafepoint-2); // used for creating jmethodIDs. def(SharedDictionary_lock , PaddedMutex , safepoint, true); - def(VMStatistic_lock , PaddedMutex , safepoint, false); - def(JNIHandleBlockFreeList_lock , PaddedMutex , nosafepoint-1, true); // handles are used by VM thread - def(SignatureHandlerLibrary_lock , PaddedMutex , safepoint, false); - def(SymbolArena_lock , PaddedMutex , nosafepoint, true); - def(ExceptionCache_lock , PaddedMutex , safepoint, false); + def(VMStatistic_lock , PaddedMutex , safepoint); + def(JNIHandleBlockFreeList_lock , PaddedMutex , nosafepoint-1); // handles are used by VM thread + def(SignatureHandlerLibrary_lock , PaddedMutex , safepoint); + def(SymbolArena_lock , PaddedMutex , nosafepoint); + def(ExceptionCache_lock , PaddedMutex , safepoint); #ifndef PRODUCT - def(FullGCALot_lock , PaddedMutex , safepoint, false); // a lock to make FullGCALot MT safe + def(FullGCALot_lock , PaddedMutex , safepoint); // a lock to make FullGCALot MT safe #endif def(BeforeExit_lock , PaddedMonitor, safepoint, true); - def(NonJavaThreadsList_lock , PaddedMutex, nosafepoint-1, true); - def(NonJavaThreadsListSync_lock , PaddedMutex, nosafepoint, true); + def(NonJavaThreadsList_lock , PaddedMutex, nosafepoint-1); + def(NonJavaThreadsListSync_lock , PaddedMutex, nosafepoint); - def(RetData_lock , PaddedMutex , safepoint, false); + def(RetData_lock , PaddedMutex , safepoint); def(Terminator_lock , PaddedMonitor, safepoint, true); - def(InitCompleted_lock , PaddedMonitor, nosafepoint, true); + def(InitCompleted_lock , PaddedMonitor, nosafepoint); def(Notify_lock , PaddedMonitor, safepoint, true); def(AdapterHandlerLibrary_lock , PaddedMutex , safepoint, true); - def(Heap_lock , PaddedMonitor, safepoint, false); // Doesn't safepoint check during termination. + def(Heap_lock , PaddedMonitor, safepoint); // Doesn't safepoint check during termination. def(JfieldIdCreation_lock , PaddedMutex , safepoint, true); // jfieldID, Used in VM_Operation - def(CompiledIC_lock , PaddedMutex , nosafepoint, true); // locks VtableStubs_lock, InlineCacheBuffer_lock - def(MethodCompileQueue_lock , PaddedMonitor, safepoint, false); - def(CompileStatistics_lock , PaddedMutex , safepoint, false); - def(DirectivesStack_lock , PaddedMutex , nosafepoint, true); - def(MultiArray_lock , PaddedMutex , safepoint, false); + def(CompiledIC_lock , PaddedMutex , nosafepoint); // locks VtableStubs_lock, InlineCacheBuffer_lock + def(MethodCompileQueue_lock , PaddedMonitor, safepoint); + def(CompileStatistics_lock , PaddedMutex , safepoint); + def(DirectivesStack_lock , PaddedMutex , nosafepoint); + def(MultiArray_lock , PaddedMutex , safepoint); - def(JvmtiThreadState_lock , PaddedMutex , safepoint, false); // Used by JvmtiThreadState/JvmtiEventController - def(EscapeBarrier_lock , PaddedMonitor, nosafepoint, true); // Used to synchronize object reallocation/relocking triggered by JVMTI - def(Management_lock , PaddedMutex , safepoint, false); // used for JVM management + def(JvmtiThreadState_lock , PaddedMutex , safepoint); // Used by JvmtiThreadState/JvmtiEventController + def(EscapeBarrier_lock , PaddedMonitor, nosafepoint); // Used to synchronize object reallocation/relocking triggered by JVMTI + def(Management_lock , PaddedMutex , safepoint); // used for JVM management def(ConcurrentGCBreakpoints_lock , PaddedMonitor, safepoint, true); - def(MethodData_lock , PaddedMutex , safepoint, false); - def(TouchedMethodLog_lock , PaddedMutex , safepoint, false); + def(MethodData_lock , PaddedMutex , safepoint); + def(TouchedMethodLog_lock , PaddedMutex , safepoint); - def(CompileThread_lock , PaddedMonitor, safepoint, false); + def(CompileThread_lock , PaddedMonitor, safepoint); def(PeriodicTask_lock , PaddedMonitor, safepoint, true); def(RedefineClasses_lock , PaddedMonitor, safepoint, true); def(Verify_lock , PaddedMutex, safepoint, true); if (WhiteBoxAPI) { - def(Compilation_lock , PaddedMonitor, nosafepoint, true); + def(Compilation_lock , PaddedMonitor, nosafepoint); } #if INCLUDE_JFR - def(JfrBuffer_lock , PaddedMutex , nosafepoint, true); - def(JfrMsg_lock , PaddedMonitor, nosafepoint-3, true); - def(JfrStacktrace_lock , PaddedMutex , stackwatermark-1, true); - def(JfrThreadSampler_lock , PaddedMonitor, nosafepoint, true); + def(JfrBuffer_lock , PaddedMutex , nosafepoint); + def(JfrMsg_lock , PaddedMonitor, nosafepoint-3); + def(JfrStacktrace_lock , PaddedMutex , stackwatermark-1); + def(JfrThreadSampler_lock , PaddedMonitor, nosafepoint); #endif #ifndef SUPPORTS_NATIVE_CX8 - def(UnsafeJlong_lock , PaddedMutex , nosafepoint, true); + def(UnsafeJlong_lock , PaddedMutex , nosafepoint); #endif - def(CodeHeapStateAnalytics_lock , PaddedMutex , safepoint, false); - def(NMethodSweeperStats_lock , PaddedMutex , nosafepoint, true); - def(ThreadsSMRDelete_lock , PaddedMonitor, nosafepoint-3, true); // Holds ConcurrentHashTableResize_lock - def(ThreadIdTableCreate_lock , PaddedMutex , safepoint, false); - def(SharedDecoder_lock , PaddedMutex , tty-1, true); - def(DCmdFactory_lock , PaddedMutex , nosafepoint, true); + def(CodeHeapStateAnalytics_lock , PaddedMutex , safepoint); + def(NMethodSweeperStats_lock , PaddedMutex , nosafepoint); + def(ThreadsSMRDelete_lock , PaddedMonitor, nosafepoint-3); // Holds ConcurrentHashTableResize_lock + def(ThreadIdTableCreate_lock , PaddedMutex , safepoint); + def(SharedDecoder_lock , PaddedMutex , tty-1); + def(DCmdFactory_lock , PaddedMutex , nosafepoint); #if INCLUDE_NMT - def(NMTQuery_lock , PaddedMutex , safepoint, false); + def(NMTQuery_lock , PaddedMutex , safepoint); #endif #if INCLUDE_CDS #if INCLUDE_JVMTI - def(CDSClassFileStream_lock , PaddedMutex , safepoint, false); + def(CDSClassFileStream_lock , PaddedMutex , safepoint); #endif - def(DumpTimeTable_lock , PaddedMutex , nosafepoint, true); - def(CDSLambda_lock , PaddedMutex , nosafepoint, true); - def(DumpRegion_lock , PaddedMutex , nosafepoint, true); - def(ClassListFile_lock , PaddedMutex , nosafepoint, true); - def(LambdaFormInvokers_lock , PaddedMutex , safepoint, false); + def(DumpTimeTable_lock , PaddedMutex , nosafepoint); + def(CDSLambda_lock , PaddedMutex , nosafepoint); + def(DumpRegion_lock , PaddedMutex , nosafepoint); + def(ClassListFile_lock , PaddedMutex , nosafepoint); + def(LambdaFormInvokers_lock , PaddedMutex , safepoint); #endif // INCLUDE_CDS - def(Bootclasspath_lock , PaddedMutex , nosafepoint, true); - def(Zip_lock , PaddedMonitor, nosafepoint-1, true); // Holds DumpTimeTable_lock + def(Bootclasspath_lock , PaddedMutex , nosafepoint); + def(Zip_lock , PaddedMonitor, nosafepoint-1); // Holds DumpTimeTable_lock #if INCLUDE_JVMCI def(JVMCI_lock , PaddedMonitor, safepoint, true); #endif // These locks have relative rankings, and inherit safepoint checking attributes from that rank. - defl(InlineCacheBuffer_lock , PaddedMutex , CompiledIC_lock, true); - defl(VtableStubs_lock , PaddedMutex , CompiledIC_lock, true); // Also holds DumpTimeTable_lock - defl(CodeCache_lock , PaddedMonitor, VtableStubs_lock, true); - defl(CompiledMethod_lock , PaddedMutex , CodeCache_lock, true); - defl(CodeSweeper_lock , PaddedMonitor, CompiledMethod_lock, true); + defl(InlineCacheBuffer_lock , PaddedMutex , CompiledIC_lock); + defl(VtableStubs_lock , PaddedMutex , CompiledIC_lock); // Also holds DumpTimeTable_lock + defl(CodeCache_lock , PaddedMonitor, VtableStubs_lock); + defl(CompiledMethod_lock , PaddedMutex , CodeCache_lock); + defl(CodeSweeper_lock , PaddedMonitor, CompiledMethod_lock); defl(Threads_lock , PaddedMonitor, CompileThread_lock, true); - defl(Heap_lock , PaddedMonitor, MultiArray_lock, false); - defl(Compile_lock , PaddedMutex , MethodCompileQueue_lock, false); + defl(Heap_lock , PaddedMonitor, MultiArray_lock); + defl(Compile_lock , PaddedMutex , MethodCompileQueue_lock); defl(PerfDataMemAlloc_lock , PaddedMutex , Heap_lock, true); defl(PerfDataManager_lock , PaddedMutex , Heap_lock, true); - defl(ClassLoaderDataGraph_lock , PaddedMutex , MultiArray_lock, false); + defl(ClassLoaderDataGraph_lock , PaddedMutex , MultiArray_lock); defl(VMOperation_lock , PaddedMonitor, Compile_lock, true); defl(ClassInitError_lock , PaddedMonitor, Threads_lock, true); @@ -363,7 +363,7 @@ void mutex_init() { defl(CompileTaskAlloc_lock , PaddedMutex , MethodCompileQueue_lock, true); defl(ExpandHeap_lock , PaddedMutex , Heap_lock, true); defl(OopMapCacheAlloc_lock , PaddedMutex , Threads_lock, true); - defl(Module_lock , PaddedMutex , ClassLoaderDataGraph_lock, false); + defl(Module_lock , PaddedMutex , ClassLoaderDataGraph_lock); defl(SystemDictionary_lock , PaddedMonitor, Module_lock, true); defl(JNICritical_lock , PaddedMonitor, MultiArray_lock, true); // used for JNI critical regions } -- GitLab From b98ed55060b5f3b7832ec28064b04577e3725cc2 Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Tue, 26 Oct 2021 15:23:43 +0000 Subject: [PATCH 070/890] 8275819: [TableRowAccessibility accessibilityChildren] method is ineffective Reviewed-by: pbansal, kizune --- .../sun/lwawt/macosx/CAccessibility.java | 79 ++++++++++++++++--- .../awt/a11y/TableRowAccessibility.m | 39 +++++---- 2 files changed, 88 insertions(+), 30 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java index c4311bf0f52..2f23d8d0fdf 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java @@ -41,6 +41,7 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.Callable; import java.util.Arrays; +import java.util.function.Function; import javax.accessibility.Accessible; import javax.accessibility.AccessibleAction; @@ -662,21 +663,29 @@ class CAccessibility implements PropertyChangeListener { @Native static final int JAVA_AX_SELECTED_CHILDREN = -2; @Native static final int JAVA_AX_VISIBLE_CHILDREN = -3; + private static Object[] getTableRowChildrenAndRoles(Accessible a, Component c, int whichChildren, boolean allowIgnored, int tableRowIndex) { + return invokeGetChildrenAndRoles(a, c, whichChildren, allowIgnored, ChildrenOperations.createForTableRow(tableRowIndex)); + } + // Each child takes up two entries in the array: one for itself and one for its role - public static Object[] getChildrenAndRoles(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) { + private static Object[] getChildrenAndRoles(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) { + return invokeGetChildrenAndRoles(a, c, whichChildren, allowIgnored, ChildrenOperations.COMMON); + } + + private static Object[] invokeGetChildrenAndRoles(Accessible a, Component c, int whichChildren, boolean allowIgnored, ChildrenOperations ops) { if (a == null) return null; return invokeAndWait(new Callable() { public Object[] call() throws Exception { - return getChildrenAndRolesImpl(a, c, whichChildren, allowIgnored); + return getChildrenAndRolesImpl(a, c, whichChildren, allowIgnored, ops); } }, c); } - private static Object[] getChildrenAndRolesImpl(final Accessible a, final Component c, final int whichChildren, final boolean allowIgnored) { + private static Object[] getChildrenAndRolesImpl(Accessible a, Component c, int whichChildren, boolean allowIgnored, ChildrenOperations ops) { if (a == null) return null; ArrayList childrenAndRoles = new ArrayList(); - _addChildren(a, whichChildren, allowIgnored, childrenAndRoles); + _addChildren(a, whichChildren, allowIgnored, childrenAndRoles, ops); /* In case of fetching a selection, we need to check if * the active descendant is at the beginning of the list, or @@ -747,7 +756,7 @@ class CAccessibility implements PropertyChangeListener { while (!parentStack.isEmpty()) { Accessible p = parentStack.get(parentStack.size() - 1); - currentLevelChildren.addAll(Arrays.asList(getChildrenAndRolesImpl(p, c, JAVA_AX_ALL_CHILDREN, allowIgnored))); + currentLevelChildren.addAll(Arrays.asList(getChildrenAndRolesImpl(p, c, JAVA_AX_ALL_CHILDREN, allowIgnored, ChildrenOperations.COMMON))); if ((currentLevelChildren.size() == 0) || (index >= currentLevelChildren.size())) { if (!parentStack.isEmpty()) parentStack.remove(parentStack.size() - 1); if (!indexses.isEmpty()) index = indexses.remove(indexses.size() - 1); @@ -859,20 +868,70 @@ class CAccessibility implements PropertyChangeListener { return role; } + private interface ChildrenOperations { + boolean isContextValid(AccessibleContext accessibleContext); + int getChildrenCount(AccessibleContext accessibleContext); + Accessible getAccessibleChild(AccessibleContext accessibleContext, int childIndex); + + static ChildrenOperations COMMON = createForCommon(); + + static ChildrenOperations createForCommon() { + return new ChildrenOperations() { + @Override + public boolean isContextValid(AccessibleContext accessibleContext) { + return accessibleContext != null; + } + + @Override + public int getChildrenCount(AccessibleContext accessibleContext) { + assert isContextValid(accessibleContext); + return accessibleContext.getAccessibleChildrenCount(); + } + + @Override + public Accessible getAccessibleChild(AccessibleContext accessibleContext, int childIndex) { + assert isContextValid(accessibleContext); + return accessibleContext.getAccessibleChild(childIndex); + } + }; + } + + static ChildrenOperations createForTableRow(int tableRowIndex) { + return new ChildrenOperations() { + @Override + public boolean isContextValid(AccessibleContext accessibleContext) { + return accessibleContext instanceof AccessibleTable; + } + + @Override + public int getChildrenCount(AccessibleContext accessibleContext) { + assert isContextValid(accessibleContext); + return ((AccessibleTable)accessibleContext).getAccessibleColumnCount(); + } + + @Override + public Accessible getAccessibleChild(AccessibleContext accessibleContext, int childIndex) { + assert isContextValid(accessibleContext); + return ((AccessibleTable)accessibleContext).getAccessibleAt(tableRowIndex, childIndex); + } + }; + } + } + // Either gets the immediate children of a, or recursively gets all unignored children of a - private static void _addChildren(final Accessible a, final int whichChildren, final boolean allowIgnored, final ArrayList childrenAndRoles) { + private static void _addChildren(Accessible a, int whichChildren, boolean allowIgnored, ArrayList childrenAndRoles, ChildrenOperations ops) { if (a == null) return; final AccessibleContext ac = a.getAccessibleContext(); - if (ac == null) return; + if (!ops.isContextValid(ac)) return; - final int numChildren = ac.getAccessibleChildrenCount(); + final int numChildren = ops.getChildrenCount(ac); // each child takes up two entries in the array: itself, and its role // so the array holds alternating Accessible and AccessibleRole objects for (int i = 0; i < numChildren; i++) { - final Accessible child = ac.getAccessibleChild(i); + final Accessible child = ops.getAccessibleChild(ac, i); if (child == null) continue; final AccessibleContext context = child.getAccessibleContext(); @@ -894,7 +953,7 @@ class CAccessibility implements PropertyChangeListener { final AccessibleRole role = context.getAccessibleRole(); if (role != null && ignoredRoles != null && ignoredRoles.contains(roleKey(role))) { // Get the child's unignored children. - _addChildren(child, whichChildren, false, childrenAndRoles); + _addChildren(child, whichChildren, false, childrenAndRoles, ChildrenOperations.COMMON); } else { childrenAndRoles.add(child); childrenAndRoles.add(getAccessibleRole(child)); diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m index 4327d05ffad..a27feceec31 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m @@ -33,12 +33,6 @@ static jclass sjc_CAccessibility = NULL; -static jmethodID jm_getChildrenAndRoles = NULL; -#define GET_CHILDRENANDROLES_METHOD_RETURN(ret) \ - GET_CACCESSIBILITY_CLASS_RETURN(ret); \ - GET_STATIC_METHOD_RETURN(jm_getChildrenAndRoles, sjc_CAccessibility, "getChildrenAndRoles",\ - "(Ljavax/accessibility/Accessible;Ljava/awt/Component;IZ)[Ljava/lang/Object;", ret); - @implementation TableRowAccessibility // NSAccessibilityElement protocol methods @@ -55,25 +49,28 @@ static jmethodID jm_getChildrenAndRoles = NULL; - (NSArray *)accessibilityChildren { - NSArray *children = [super accessibilityChildren]; + NSMutableArray *children = [super accessibilityChildren]; if (children == nil) { JNIEnv *env = [ThreadUtilities getJNIEnv]; CommonComponentAccessibility *parent = [self accessibilityParent]; if (parent->fAccessible == NULL) return nil; - GET_CHILDRENANDROLES_METHOD_RETURN(nil); - jobjectArray jchildrenAndRoles = (jobjectArray)(*env)->CallStaticObjectMethod(env, sjc_CAccessibility, jm_getChildrenAndRoles, - parent->fAccessible, parent->fComponent, sun_lwawt_macosx_CAccessibility_JAVA_AX_ALL_CHILDREN, NO); + + GET_CACCESSIBILITY_CLASS_RETURN(nil); + DECLARE_STATIC_METHOD_RETURN(jm_getTableRowChildrenAndRoles, sjc_CAccessibility, "getTableRowChildrenAndRoles",\ + "(Ljavax/accessibility/Accessible;Ljava/awt/Component;IZI)[Ljava/lang/Object;", nil); + + jobjectArray jchildrenAndRoles = (jobjectArray)(*env)->CallStaticObjectMethod( + env, sjc_CAccessibility, jm_getTableRowChildrenAndRoles, parent->fAccessible, parent->fComponent, + sun_lwawt_macosx_CAccessibility_JAVA_AX_ALL_CHILDREN, NO, [self rowNumberInTable]); CHECK_EXCEPTION(); + if (jchildrenAndRoles == NULL) return nil; jsize arrayLen = (*env)->GetArrayLength(env, jchildrenAndRoles); - NSMutableArray *childrenCells = [NSMutableArray arrayWithCapacity:arrayLen/2]; + children = [NSMutableArray arrayWithCapacity:arrayLen / 2]; + int childIndex = [self rowNumberInTable] * [(TableAccessibility *)parent accessibilityColumnCount]; - NSUInteger childIndex = fIndex * [(TableAccessibility *)parent accessibilityColumnCount]; - NSInteger i = childIndex * 2; - NSInteger n = (fIndex + 1) * [(TableAccessibility *)parent accessibilityColumnCount] * 2; - for(i; i < n; i+=2) - { + for (NSInteger i = 0; i < arrayLen; i += 2) { jobject /* Accessible */ jchild = (*env)->GetObjectArrayElement(env, jchildrenAndRoles, i); jobject /* String */ jchildJavaRole = (*env)->GetObjectArrayElement(env, jchildrenAndRoles, i+1); @@ -93,7 +90,7 @@ static jmethodID jm_getChildrenAndRoles = NULL; withIndex:childIndex withView:self->fView withJavaRole:childJavaRole]; - [childrenCells addObject:[[child retain] autorelease]]; + [children addObject:[[child retain] autorelease]]; (*env)->DeleteLocalRef(env, jchild); (*env)->DeleteLocalRef(env, jchildJavaRole); @@ -101,10 +98,12 @@ static jmethodID jm_getChildrenAndRoles = NULL; childIndex++; } (*env)->DeleteLocalRef(env, jchildrenAndRoles); - return childrenCells; - } else { - return children; } + return children; +} + +- (NSUInteger)rowNumberInTable { + return self->fIndex; } - (NSInteger)accessibilityIndex -- GitLab From c9dec2f9849f98048f32ccef4e5573ce21204fbb Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 26 Oct 2021 15:25:23 +0000 Subject: [PATCH 071/890] 8273299: Unnecessary Vector usage in java.security.jgss Reviewed-by: weijun --- .../sun/security/jgss/GSSCredentialImpl.java | 6 +-- .../sun/security/krb5/PrincipalName.java | 20 ++++---- .../security/krb5/internal/Authenticator.java | 25 +++++----- .../krb5/internal/AuthorizationData.java | 9 ++-- .../security/krb5/internal/EncAPRepPart.java | 15 +++--- .../security/krb5/internal/HostAddresses.java | 9 ++-- .../security/krb5/internal/KDCReqBody.java | 46 +++++++++---------- .../sun/security/krb5/internal/KRBCred.java | 9 ++-- .../security/krb5/internal/KrbCredInfo.java | 29 ++++++------ .../sun/security/krb5/internal/LastReq.java | 9 ++-- .../sun/security/krb5/internal/PAData.java | 11 ++--- .../internal/ccache/FileCredentialsCache.java | 7 ++- 12 files changed, 91 insertions(+), 104 deletions(-) diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/GSSCredentialImpl.java b/src/java.security.jgss/share/classes/sun/security/jgss/GSSCredentialImpl.java index 6d0d711325e..18c2604c9c7 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/GSSCredentialImpl.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/GSSCredentialImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -405,12 +405,12 @@ public class GSSCredentialImpl implements GSSCredential { throw new IllegalStateException("This credential is " + "no longer valid"); } - Vector result = new Vector(hashtable.size()); + ArrayList result = new ArrayList(hashtable.size()); for (Enumeration e = hashtable.keys(); e.hasMoreElements(); ) { SearchKey tempKey = e.nextElement(); - result.addElement(tempKey.getMech()); + result.add(tempKey.getMech()); } return result.toArray(new Oid[0]); } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java b/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java index 41d27b05570..8edf42deddd 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java @@ -34,7 +34,7 @@ package sun.security.krb5; import sun.security.krb5.internal.*; import sun.security.util.*; import java.net.*; -import java.util.Vector; +import java.util.ArrayList; import java.util.Locale; import java.io.IOException; import java.math.BigInteger; @@ -270,15 +270,14 @@ public class PrincipalName implements Cloneable { if (subDer.getTag() != DerValue.tag_SequenceOf) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); DerValue subSubDer; while(subDer.getData().available() > 0) { subSubDer = subDer.getData().getDerValue(); String namePart = new KerberosString(subSubDer).toString(); - v.addElement(namePart); + v.add(namePart); } - nameStrings = new String[v.size()]; - v.copyInto(nameStrings); + nameStrings = v.toArray(new String[0]); validateNameStrings(nameStrings); } else { throw new Asn1Exception(Krb5.ASN1_BAD_ID); @@ -326,7 +325,7 @@ public class PrincipalName implements Cloneable { // Code repetition, realm parsed again by class Realm private static String[] parseName(String name) { - Vector tempStrings = new Vector<>(); + ArrayList tempStrings = new ArrayList<>(); String temp = name; int i = 0; int componentStart = 0; @@ -346,7 +345,7 @@ public class PrincipalName implements Cloneable { else { if (componentStart <= i) { component = temp.substring(componentStart, i); - tempStrings.addElement(component); + tempStrings.add(component); } componentStart = i + 1; } @@ -363,7 +362,7 @@ public class PrincipalName implements Cloneable { } else { if (componentStart < i) { component = temp.substring(componentStart, i); - tempStrings.addElement(component); + tempStrings.add(component); } componentStart = i + 1; break; @@ -375,11 +374,10 @@ public class PrincipalName implements Cloneable { if (i == temp.length()) { component = temp.substring(componentStart, i); - tempStrings.addElement(component); + tempStrings.add(component); } - String[] result = new String[tempStrings.size()]; - tempStrings.copyInto(result); + String[] result = tempStrings.toArray(new String[0]); return result; } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Authenticator.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Authenticator.java index abbac5f95c8..a1f9a6ac3cc 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Authenticator.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Authenticator.java @@ -31,7 +31,7 @@ package sun.security.krb5.internal; import sun.security.krb5.*; import sun.security.util.*; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; import java.math.BigInteger; @@ -173,33 +173,32 @@ public class Authenticator { * @exception IOException if an I/O error occurs while reading encoded data. */ public byte[] asn1Encode() throws Asn1Exception, IOException { - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); DerOutputStream temp = new DerOutputStream(); temp.putInteger(BigInteger.valueOf(authenticator_vno)); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x00), temp.toByteArray())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x01), cname.getRealm().asn1Encode())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x02), cname.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x00), temp.toByteArray())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x01), cname.getRealm().asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x02), cname.asn1Encode())); if (cksum != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x03), cksum.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x03), cksum.asn1Encode())); } temp = new DerOutputStream(); temp.putInteger(BigInteger.valueOf(cusec)); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x04), temp.toByteArray())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x05), ctime.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x04), temp.toByteArray())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x05), ctime.asn1Encode())); if (subKey != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x06), subKey.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x06), subKey.asn1Encode())); } if (seqNumber != null) { temp = new DerOutputStream(); // encode as an unsigned integer (UInt32) temp.putInteger(BigInteger.valueOf(seqNumber.longValue())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x07), temp.toByteArray())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x07), temp.toByteArray())); } if (authorizationData != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x08), authorizationData.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x08), authorizationData.asn1Encode())); } - DerValue[] der = new DerValue[v.size()]; - v.copyInto(der); + DerValue[] der = v.toArray(new DerValue[0]); temp = new DerOutputStream(); temp.putSequence(der); DerOutputStream out = new DerOutputStream(); diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/AuthorizationData.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/AuthorizationData.java index 204c8b8e354..5325d54bc5c 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/AuthorizationData.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/AuthorizationData.java @@ -32,7 +32,7 @@ package sun.security.krb5.internal; import sun.security.util.*; import sun.security.krb5.Asn1Exception; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; import sun.security.krb5.internal.ccache.CCacheOutputStream; @@ -99,16 +99,15 @@ public class AuthorizationData implements Cloneable { * @exception IOException if an I/O error occurs while reading encoded data. */ public AuthorizationData(DerValue der) throws Asn1Exception, IOException { - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); if (der.getTag() != DerValue.tag_Sequence) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } while (der.getData().available() > 0) { - v.addElement(new AuthorizationDataEntry(der.getData().getDerValue())); + v.add(new AuthorizationDataEntry(der.getData().getDerValue())); } if (v.size() > 0) { - entry = new AuthorizationDataEntry[v.size()]; - v.copyInto(entry); + entry = v.toArray(new AuthorizationDataEntry[0]); } } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/EncAPRepPart.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/EncAPRepPart.java index ec9d3a24ed1..0ca67450d42 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/EncAPRepPart.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/EncAPRepPart.java @@ -32,7 +32,7 @@ package sun.security.krb5.internal; import sun.security.krb5.*; import sun.security.util.*; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; import java.math.BigInteger; @@ -133,26 +133,25 @@ public class EncAPRepPart { * @exception IOException if an I/O error occurs while reading encoded data. */ public byte[] asn1Encode() throws Asn1Exception, IOException { - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); DerOutputStream temp = new DerOutputStream(); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x00), ctime.asn1Encode())); temp.putInteger(BigInteger.valueOf(cusec)); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x01), temp.toByteArray())); if (subKey != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x02), subKey.asn1Encode())); } if (seqNumber != null) { temp = new DerOutputStream(); // encode as an unsigned integer (UInt32) temp.putInteger(BigInteger.valueOf(seqNumber.longValue())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x03), temp.toByteArray())); } - DerValue[] der = new DerValue[v.size()]; - v.copyInto(der); + DerValue[] der = v.toArray(new DerValue[0]); temp = new DerOutputStream(); temp.putSequence(der); DerOutputStream out = new DerOutputStream(); diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddresses.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddresses.java index 5f533c1cc7b..070ad970bdb 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddresses.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/HostAddresses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -178,15 +178,14 @@ public class HostAddresses implements Cloneable { */ public HostAddresses(DerValue encoding) throws Asn1Exception, IOException { - Vector tempAddresses = new Vector<>(); + ArrayList tempAddresses = new ArrayList<>(); DerValue der = null; while (encoding.getData().available() > 0) { der = encoding.getData().getDerValue(); - tempAddresses.addElement(new HostAddress(der)); + tempAddresses.add(new HostAddress(der)); } if (tempAddresses.size() > 0) { - addresses = new HostAddress[tempAddresses.size()]; - tempAddresses.copyInto(addresses); + addresses = tempAddresses.toArray(new HostAddress[0]); } } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReqBody.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReqBody.java index 8c1b246d061..8579dfdac41 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReqBody.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReqBody.java @@ -32,7 +32,7 @@ package sun.security.krb5.internal; import sun.security.krb5.*; import sun.security.util.*; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; import java.math.BigInteger; @@ -165,17 +165,17 @@ public class KDCReqBody { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } der = encoding.getData().getDerValue(); - Vector v = new Vector<>(); if ((der.getTag() & (byte)0x1F) == (byte)0x08) { subDer = der.getData().getDerValue(); if (subDer.getTag() == DerValue.tag_SequenceOf) { + ArrayList v = new ArrayList<>(); while(subDer.getData().available() > 0) { - v.addElement(subDer.getData().getBigInteger().intValue()); + v.add(subDer.getData().getBigInteger().intValue()); } eType = new int[v.size()]; for (int i = 0; i < v.size(); i++) { - eType[i] = v.elementAt(i); + eType[i] = v.get(i); } } else { throw new Asn1Exception(Krb5.ASN1_BAD_ID); @@ -190,20 +190,19 @@ public class KDCReqBody { encAuthorizationData = EncryptedData.parse(encoding.getData(), (byte)0x0A, true); } if (encoding.getData().available() > 0) { - Vector tempTickets = new Vector<>(); der = encoding.getData().getDerValue(); if ((der.getTag() & (byte)0x1F) == (byte)0x0B) { + ArrayList tempTickets = new ArrayList<>(); subDer = der.getData().getDerValue(); if (subDer.getTag() == DerValue.tag_SequenceOf) { while (subDer.getData().available() > 0) { - tempTickets.addElement(new Ticket(subDer.getData().getDerValue())); + tempTickets.add(new Ticket(subDer.getData().getDerValue())); } } else { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } if (tempTickets.size() > 0) { - additionalTickets = new Ticket[tempTickets.size()]; - tempTickets.copyInto(additionalTickets); + additionalTickets = tempTickets.toArray(new Ticket[0]); } } else { throw new Asn1Exception(Krb5.ASN1_BAD_ID); @@ -223,29 +222,29 @@ public class KDCReqBody { * */ public byte[] asn1Encode(int msgType) throws Asn1Exception, IOException { - Vector v = new Vector<>(); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), kdcOptions.asn1Encode())); + ArrayList v = new ArrayList<>(); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), kdcOptions.asn1Encode())); if (msgType == Krb5.KRB_AS_REQ) { if (cname != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), cname.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), cname.asn1Encode())); } } if (sname != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), sname.getRealm().asn1Encode())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x03), sname.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), sname.getRealm().asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x03), sname.asn1Encode())); } else if (cname != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), cname.getRealm().asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), cname.getRealm().asn1Encode())); } if (from != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x04), from.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x04), from.asn1Encode())); } - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x05), till.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x05), till.asn1Encode())); if (rtime != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x06), rtime.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x06), rtime.asn1Encode())); } DerOutputStream temp = new DerOutputStream(); temp.putInteger(BigInteger.valueOf(nonce)); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x07), temp.toByteArray())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x07), temp.toByteArray())); //revisit, if empty eType sequences are allowed temp = new DerOutputStream(); for (int i = 0; i < eType.length; i++) { @@ -253,12 +252,12 @@ public class KDCReqBody { } DerOutputStream eTypetemp = new DerOutputStream(); eTypetemp.write(DerValue.tag_SequenceOf, temp); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x08), eTypetemp.toByteArray())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x08), eTypetemp.toByteArray())); if (addresses != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x09), addresses.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x09), addresses.asn1Encode())); } if (encAuthorizationData != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0A), encAuthorizationData.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0A), encAuthorizationData.asn1Encode())); } if (additionalTickets != null && additionalTickets.length > 0) { temp = new DerOutputStream(); @@ -267,10 +266,9 @@ public class KDCReqBody { } DerOutputStream ticketsTemp = new DerOutputStream(); ticketsTemp.write(DerValue.tag_SequenceOf, temp); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0B), ticketsTemp.toByteArray())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0B), ticketsTemp.toByteArray())); } - DerValue[] der = new DerValue[v.size()]; - v.copyInto(der); + DerValue[] der = v.toArray(new DerValue[0]); temp = new DerOutputStream(); temp.putSequence(der); return temp.toByteArray(); diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBCred.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBCred.java index 5ebe985bbed..1b05c0969b7 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBCred.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KRBCred.java @@ -34,7 +34,7 @@ import sun.security.krb5.EncryptedData; import sun.security.krb5.Asn1Exception; import sun.security.krb5.RealmException; import sun.security.util.*; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; import java.math.BigInteger; @@ -134,13 +134,12 @@ public class KRBCred { if (subsubDer.getTag() != DerValue.tag_SequenceOf) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); while (subsubDer.getData().available() > 0) { - v.addElement(new Ticket(subsubDer.getData().getDerValue())); + v.add(new Ticket(subsubDer.getData().getDerValue())); } if (v.size() > 0) { - tickets = new Ticket[v.size()]; - v.copyInto(tickets); + tickets = v.toArray(new Ticket[0]); } } else { throw new Asn1Exception(Krb5.ASN1_BAD_ID); diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KrbCredInfo.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KrbCredInfo.java index 952506c5b74..d4aecbeda26 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KrbCredInfo.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KrbCredInfo.java @@ -32,7 +32,7 @@ package sun.security.krb5.internal; import sun.security.krb5.*; import sun.security.util.*; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; /** @@ -150,30 +150,29 @@ public class KrbCredInfo { * @exception IOException if an I/O error occurs while reading encoded data. */ public byte[] asn1Encode() throws Asn1Exception, IOException { - Vector v = new Vector<>(); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), key.asn1Encode())); + ArrayList v = new ArrayList<>(); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), key.asn1Encode())); if (pname != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), pname.getRealm().asn1Encode())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), pname.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), pname.getRealm().asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), pname.asn1Encode())); } if (flags != null) - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x03), flags.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x03), flags.asn1Encode())); if (authtime != null) - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x04), authtime.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x04), authtime.asn1Encode())); if (starttime != null) - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x05), starttime.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x05), starttime.asn1Encode())); if (endtime != null) - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x06), endtime.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x06), endtime.asn1Encode())); if (renewTill != null) - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x07), renewTill.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x07), renewTill.asn1Encode())); if (sname != null) { - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x08), sname.getRealm().asn1Encode())); - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x09), sname.asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x08), sname.getRealm().asn1Encode())); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x09), sname.asn1Encode())); } if (caddr != null) - v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0A), caddr.asn1Encode())); - DerValue[] der = new DerValue[v.size()]; - v.copyInto(der); + v.add(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0A), caddr.asn1Encode())); + DerValue[] der = v.toArray(new DerValue[0]); DerOutputStream out = new DerOutputStream(); out.putSequence(der); return out.toByteArray(); diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/LastReq.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/LastReq.java index 9e160b0cf28..58148d98856 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/LastReq.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/LastReq.java @@ -32,7 +32,7 @@ package sun.security.krb5.internal; import sun.security.util.*; import sun.security.krb5.Asn1Exception; -import java.util.Vector; +import java.util.ArrayList; import java.io.IOException; /** @@ -77,16 +77,15 @@ public class LastReq { */ public LastReq(DerValue encoding) throws Asn1Exception, IOException { - Vector v= new Vector<>(); + ArrayList v = new ArrayList<>(); if (encoding.getTag() != DerValue.tag_Sequence) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } while (encoding.getData().available() > 0) { - v.addElement(new LastReqEntry(encoding.getData().getDerValue())); + v.add(new LastReqEntry(encoding.getData().getDerValue())); } if (v.size() > 0) { - entry = new LastReqEntry[v.size()]; - v.copyInto(entry); + entry = v.toArray(new LastReqEntry[0]); } } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/PAData.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/PAData.java index 602ddf91fb1..bcbae770505 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/PAData.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/PAData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -32,7 +32,7 @@ package sun.security.krb5.internal; import java.io.IOException; -import java.util.Vector; +import java.util.ArrayList; import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; @@ -167,13 +167,12 @@ public class PAData { if (subsubDer.getTag() != DerValue.tag_SequenceOf) { throw new Asn1Exception(Krb5.ASN1_BAD_ID); } - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); while (subsubDer.getData().available() > 0) { - v.addElement(new PAData(subsubDer.getData().getDerValue())); + v.add(new PAData(subsubDer.getData().getDerValue())); } if (v.size() > 0) { - PAData[] pas = new PAData[v.size()]; - v.copyInto(pas); + PAData[] pas = v.toArray(new PAData[0]); return pas; } return null; diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java index f0379c04e91..88c755cb430 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java @@ -567,12 +567,11 @@ public class FileCredentialsCache extends CredentialsCache private static String exec(String c) { StringTokenizer st = new StringTokenizer(c); - Vector v = new Vector<>(); + ArrayList v = new ArrayList<>(); while (st.hasMoreTokens()) { - v.addElement(st.nextToken()); + v.add(st.nextToken()); } - final String[] command = new String[v.size()]; - v.copyInto(command); + final String[] command = v.toArray(new String[0]); try { @SuppressWarnings("removal") -- GitLab From 7c88a59b7bca50061f120a1cf2c1d4457a1d741b Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Tue, 26 Oct 2021 15:26:45 +0000 Subject: [PATCH 072/890] 8275809: crash in [CommonComponentAccessibility getCAccessible:withEnv:] Reviewed-by: kizune, pbansal --- .../awt/a11y/CommonComponentAccessibility.m | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m index d5680e3d05a..7289e94c2dc 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m @@ -419,13 +419,20 @@ static jobject sAccessibilityClass = NULL; GET_CACCESSIBLE_CLASS_RETURN(NULL); DECLARE_STATIC_METHOD_RETURN(sjm_getCAccessible, sjc_CAccessible, "getCAccessible", "(Ljavax/accessibility/Accessible;)Lsun/lwawt/macosx/CAccessible;", NULL); - if ((*env)->IsInstanceOf(env, jaccessible, sjc_CAccessible)) { - return jaccessible; - } else if ((*env)->IsInstanceOf(env, jaccessible, sjc_Accessible)) { - jobject o = (*env)->CallStaticObjectMethod(env, sjc_CAccessible, sjm_getCAccessible, jaccessible); + + // jaccessible is a weak ref, check it's still alive + jobject jaccessibleLocal = (*env)->NewLocalRef(env, jaccessible); + if ((*env)->IsSameObject(env, jaccessibleLocal, NULL)) return NULL; + + if ((*env)->IsInstanceOf(env, jaccessibleLocal, sjc_CAccessible)) { + return jaccessibleLocal; // delete in the caller + } else if ((*env)->IsInstanceOf(env, jaccessibleLocal, sjc_Accessible)) { + jobject jCAX = (*env)->CallStaticObjectMethod(env, sjc_CAccessible, sjm_getCAccessible, jaccessibleLocal); CHECK_EXCEPTION(); - return o; + (*env)->DeleteLocalRef(env, jaccessibleLocal); + return jCAX; // delete in the caller } + (*env)->DeleteLocalRef(env, jaccessibleLocal); return NULL; } @@ -535,12 +542,10 @@ static jobject sAccessibilityClass = NULL; // try to fetch the jCAX from Java, and return autoreleased jobject jCAX = [CommonComponentAccessibility getCAccessible:jaccessible withEnv:env]; if (jCAX == NULL) return nil; - if (!wrapped) { // If wrapped is true, then you don't need to get an existing instance, you need to create a new one - CommonComponentAccessibility *value = (CommonComponentAccessibility *) jlong_to_ptr((*env)->GetLongField(env, jCAX, jf_ptr)); - if (value != nil) { - (*env)->DeleteLocalRef(env, jCAX); - return [[value retain] autorelease]; - } + CommonComponentAccessibility *value = (CommonComponentAccessibility *) jlong_to_ptr((*env)->GetLongField(env, jCAX, jf_ptr)); + if (value != nil) { + (*env)->DeleteLocalRef(env, jCAX); + return [[value retain] autorelease]; } // otherwise, create a new instance @@ -561,10 +566,7 @@ static jobject sAccessibilityClass = NULL; [newChild retain]; (*env)->SetLongField(env, jCAX, jf_ptr, ptr_to_jlong(newChild)); - // the link is removed in the wrapper - if (!wrapped) { - (*env)->DeleteLocalRef(env, jCAX); - } + (*env)->DeleteLocalRef(env, jCAX); // return autoreleased instance return [newChild autorelease]; -- GitLab From 574f8903ee1f74bdf7154d670d96c36d94b38b4d Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Tue, 26 Oct 2021 15:47:17 +0000 Subject: [PATCH 073/890] 8275720: CommonComponentAccessibility.createWithParent isWrapped causes mem leak Reviewed-by: kizune, pbansal --- .../libawt_lwawt/awt/a11y/CellAccessibility.h | 4 +- .../libawt_lwawt/awt/a11y/CellAccessibility.m | 18 ------ .../awt/a11y/CommonComponentAccessibility.h | 10 +--- .../awt/a11y/CommonComponentAccessibility.m | 26 ++++----- .../awt/a11y/ComponentWrapperAccessibility.h | 48 ++++++++++++++++ .../awt/a11y/ComponentWrapperAccessibility.m | 57 +++++++++++++++++++ .../awt/a11y/ListRowAccessibility.h | 4 +- .../awt/a11y/ListRowAccessibility.m | 19 ------- .../awt/a11y/OutlineRowAccessibility.m | 9 +-- .../awt/a11y/TableRowAccessibility.m | 16 +++--- 10 files changed, 134 insertions(+), 77 deletions(-) create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.h create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.m diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.h index bcaa0269576..ef67c92a06d 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.h @@ -22,7 +22,7 @@ * questions. */ -#import "CommonComponentAccessibility.h" +#import "ComponentWrapperAccessibility.h" -@interface CellAccessibility : CommonComponentAccessibility +@interface CellAccessibility : ComponentWrapperAccessibility @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.m index 05ac73bc4f2..c44309a1e3c 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CellAccessibility.m @@ -35,24 +35,6 @@ return NSAccessibilityCellRole;; } -- (NSArray *)accessibilityChildren -{ - NSArray *children = [super accessibilityChildren]; - if (children == NULL) { - NSString *javaRole = [self javaRole]; - CommonComponentAccessibility *newChild = [CommonComponentAccessibility createWithParent:self - accessible:self->fAccessible - role:javaRole - index:self->fIndex - withEnv:[ThreadUtilities getJNIEnv] - withView:self->fView - isWrapped:NO]; - return [NSArray arrayWithObject:newChild]; - } else { - return children; - } -} - - (NSInteger)accessibilityIndex { return self->fIndex; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h index fc81a1e8e09..33ab5c5fd2e 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h @@ -65,20 +65,16 @@ + (void) initializeRolesMap; -+ (CommonComponentAccessibility* _Nullable) getComponentAccessibility:(NSString* _Nonnull)role; -+ (CommonComponentAccessibility * _Nullable) getComponentAccessibility:(NSString * _Nonnull)role andParent:(CommonComponentAccessibility * _Nonnull)parent; ++ (Class _Nonnull) getComponentAccessibilityClass:(NSString* _Nonnull)role; ++ (Class _Nonnull) getComponentAccessibilityClass:(NSString * _Nonnull)role andParent:(CommonComponentAccessibility * _Nonnull)parent; + (NSArray* _Nullable)childrenOfParent:(CommonComponentAccessibility* _Nonnull)parent withEnv:(JNIEnv _Nonnull * _Nonnull)env withChildrenCode:(NSInteger)whichChildren allowIgnored:(BOOL)allowIgnored; + (NSArray* _Nullable)childrenOfParent:(CommonComponentAccessibility* _Nonnull)parent withEnv:(JNIEnv _Nonnull * _Nonnull)env withChildrenCode:(NSInteger)whichChildren allowIgnored:(BOOL)allowIgnored recursive:(BOOL)recursive; + (CommonComponentAccessibility* _Nullable) createWithParent:(CommonComponentAccessibility* _Nullable)parent accessible:(jobject _Nonnull)jaccessible role:(NSString* _Nonnull)javaRole index:(jint)index withEnv:(JNIEnv _Nonnull * _Nonnull)env withView:(NSView* _Nonnull)view; ++ (CommonComponentAccessibility* _Nullable) createWithParent:(CommonComponentAccessibility* _Nullable)parent withClass:(Class _Nonnull)classType accessible:(jobject _Nonnull)jaccessible role:(NSString* _Nonnull)javaRole index:(jint)index withEnv:(JNIEnv _Nonnull * _Nonnull)env withView:(NSView* _Nonnull)view; + (CommonComponentAccessibility* _Nullable) createWithAccessible:(jobject _Nonnull)jaccessible role:(NSString* _Nonnull)role index:(jint)index withEnv:(JNIEnv _Nonnull * _Nonnull)env withView:(NSView* _Nonnull)view; + (CommonComponentAccessibility* _Nullable) createWithAccessible:(jobject _Nonnull)jaccessible withEnv:(JNIEnv _Nonnull * _Nonnull)env withView:(NSView* _Nonnull)view; -// If the isWraped parameter is true, then the object passed as a parent was created based on the same java component, -// but performs a different NSAccessibilityRole of a table cell, or a list row, or tree row, -// and we need to create an element whose role corresponds to the role in Java. -+ (CommonComponentAccessibility* _Nullable) createWithParent:(CommonComponentAccessibility* _Nullable)parent accessible:(jobject _Nonnull)jaccessible role:(NSString* _Nonnull)javaRole index:(jint)index withEnv:(JNIEnv _Nonnull * _Nonnull)env withView:(NSView* _Nonnull)view isWrapped:(BOOL)wrapped; - // The current parameter is used to bypass the check for an item's index on the parent so that the item is created. This is necessary, // for example, for AccessibleJTreeNode, whose currentComponent has index -1 + (CommonComponentAccessibility* _Nullable) createWithAccessible:(jobject _Nonnull)jaccessible withEnv:(JNIEnv _Nonnull * _Nonnull)env withView:(NSView* _Nonnull)view isCurrent:(BOOL)current; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m index 7289e94c2dc..aa706818039 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m @@ -218,9 +218,9 @@ static jobject sAccessibilityClass = NULL; /* * If new implementation of the accessible component peer for the given role exists - * return the allocated class otherwise return nil to let old implementation being initialized + * return the component's class otherwise return CommonComponentAccessibility */ -+ (CommonComponentAccessibility *) getComponentAccessibility:(NSString *)role ++ (Class) getComponentAccessibilityClass:(NSString *)role { AWT_ASSERT_APPKIT_THREAD; if (rolesMap == nil) { @@ -229,12 +229,12 @@ static jobject sAccessibilityClass = NULL; NSString *className = [rolesMap objectForKey:role]; if (className != nil) { - return [NSClassFromString(className) alloc]; + return NSClassFromString(className); } - return [CommonComponentAccessibility alloc]; + return [CommonComponentAccessibility class]; } -+ (CommonComponentAccessibility *) getComponentAccessibility:(NSString *)role andParent:(CommonComponentAccessibility *)parent ++ (Class) getComponentAccessibilityClass:(NSString *)role andParent:(CommonComponentAccessibility *)parent { AWT_ASSERT_APPKIT_THREAD; if (rolesMap == nil) { @@ -242,9 +242,9 @@ static jobject sAccessibilityClass = NULL; } NSString *className = [rowRolesMapForParent objectForKey:[[parent class] className]]; if (className == nil) { - return [CommonComponentAccessibility getComponentAccessibility:role]; + return [CommonComponentAccessibility getComponentAccessibilityClass:role]; } - return [NSClassFromString(className) alloc]; + return NSClassFromString(className); } - (id)initWithParent:(NSObject *)parent withEnv:(JNIEnv *)env withAccessible:(jobject)accessible withIndex:(jint)index withView:(NSView *)view withJavaRole:(NSString *)javaRole @@ -532,10 +532,11 @@ static jobject sAccessibilityClass = NULL; + (CommonComponentAccessibility *) createWithParent:(CommonComponentAccessibility *)parent accessible:(jobject)jaccessible role:(NSString *)javaRole index:(jint)index withEnv:(JNIEnv *)env withView:(NSView *)view { - return [CommonComponentAccessibility createWithParent:parent accessible:jaccessible role:javaRole index:index withEnv:env withView:view isWrapped:NO]; + Class classType = [self getComponentAccessibilityClass:javaRole andParent:parent]; + return [CommonComponentAccessibility createWithParent:parent withClass:classType accessible:jaccessible role:javaRole index:index withEnv:env withView:view]; } -+ (CommonComponentAccessibility *) createWithParent:(CommonComponentAccessibility *)parent accessible:(jobject)jaccessible role:(NSString *)javaRole index:(jint)index withEnv:(JNIEnv *)env withView:(NSView *)view isWrapped:(BOOL)wrapped ++ (CommonComponentAccessibility *) createWithParent:(CommonComponentAccessibility *)parent withClass:(Class)classType accessible:(jobject)jaccessible role:(NSString *)javaRole index:(jint)index withEnv:(JNIEnv *)env withView:(NSView *)view { GET_CACCESSIBLE_CLASS_RETURN(NULL); DECLARE_FIELD_RETURN(jf_ptr, sjc_CAccessible, "ptr", "J", NULL); @@ -548,11 +549,8 @@ static jobject sAccessibilityClass = NULL; return [[value retain] autorelease]; } - // otherwise, create a new instance - CommonComponentAccessibility *newChild = [CommonComponentAccessibility getComponentAccessibility:javaRole andParent:parent]; - - // must init freshly -alloc'd object - [newChild initWithParent:parent withEnv:env withAccessible:jCAX withIndex:index withView:view withJavaRole:javaRole]; // must init new instance + CommonComponentAccessibility *newChild = + [[classType alloc] initWithParent:parent withEnv:env withAccessible:jCAX withIndex:index withView:view withJavaRole:javaRole]; // If creating a JPopupMenu (not a combobox popup list) need to fire menuOpened. // This is the only way to know if the menu is opening; visible state change diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.h new file mode 100644 index 00000000000..fd1e774c274 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. + * 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 "CommonComponentAccessibility.h" + +/** + * Some native a11y elements do not have direct peers in Java, like list rows and cells. + * However, these elements are required by Cocoa in order for a11y to work properly. + * The ComponentWrapperAccessibility interface provides a concept of wrapping an element + * originated from java (like a list item, or a table element) with a component + * which has a11y role required Cocoa (like NSAccessibilityRowRole, or NSAccessibilityCellRole) + * but does not have peer in java. + * + * The wrapping component becomes a parent of the wrapped child in the a11y hierarchy. + * The child component is created automatically on demand with the same set of arguments, + * except that it has a11y role of its java peer. + * + * It is important that only the wrapping component is linked with sun.lwawt.macosx.CAccessible + * and thus its lifecycle depends on the java accessible. So when the same java accessible is passed + * to create a native peer, the wrapping component is retrieved in case it has already been + * created (see [CommonComponentAccessibility createWithParent]). When the wrapping component is + * deallocated (as triggered from the java side) it releases the wrapped child. + */ +@interface ComponentWrapperAccessibility : CommonComponentAccessibility + +@property (nonatomic, retain) CommonComponentAccessibility *wrappedChild; + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.m new file mode 100644 index 00000000000..2101d7042fe --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ComponentWrapperAccessibility.m @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. + * 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 "ComponentWrapperAccessibility.h" +#import "ThreadUtilities.h" + +@implementation ComponentWrapperAccessibility + +@synthesize wrappedChild; + +- (NSAccessibilityRole)accessibilityRole { + @throw [NSException exceptionWithName:NSInternalInconsistencyException + reason:[NSString stringWithFormat:@"You must override -(NSAccessibilityRole)accessibilityRole in a subclass"] + userInfo:nil]; +} + +- (NSArray *)accessibilityChildren { + if (!wrappedChild) { + wrappedChild = + [[CommonComponentAccessibility alloc] initWithParent:self + withEnv:[ThreadUtilities getJNIEnv] + withAccessible:fAccessible + withIndex:0 + withView:fView + withJavaRole:fJavaRole]; + } + return [NSArray arrayWithObject:wrappedChild]; +} + +- (void)dealloc { + if (wrappedChild) { + [wrappedChild release]; + } + [super dealloc]; +} + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.h index 2453f92e58f..130d12721e6 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.h @@ -22,7 +22,7 @@ * questions. */ -#import "CommonComponentAccessibility.h" +#import "ComponentWrapperAccessibility.h" -@interface ListRowAccessibility : CommonComponentAccessibility +@interface ListRowAccessibility : ComponentWrapperAccessibility @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.m index 2c4d51e10ff..8b30080c85b 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ListRowAccessibility.m @@ -38,25 +38,6 @@ return NSAccessibilityRowRole; } -- (NSArray *)accessibilityChildren -{ - NSArray *children = [super accessibilityChildren]; - if (children == NULL) { - - // Since the row element has already been created, we should no create it again, but just retrieve it by a pointer, that's why isWrapped is set to YES. - CommonComponentAccessibility *newChild = [CommonComponentAccessibility createWithParent:self - accessible:self->fAccessible - role:self->fJavaRole - index:self->fIndex - withEnv:[ThreadUtilities getJNIEnv] - withView:self->fView - isWrapped:YES]; - return [NSArray arrayWithObject:newChild]; - } else { - return children; - } -} - - (NSInteger)accessibilityIndex { return [[self accessibilityParent] accessibilityIndexOfChild:self]; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineRowAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineRowAccessibility.m index a2bce0bf701..e4d7e66027d 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineRowAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineRowAccessibility.m @@ -72,14 +72,7 @@ static jclass sjc_CAccessible = NULL; return children; } } - - return [NSArray arrayWithObject:[CommonComponentAccessibility createWithParent:self - accessible:self->fAccessible - role:self->fJavaRole - index:self->fIndex - withEnv:env - withView:self->fView - isWrapped:YES]]; + return [super accessibilityChildren]; } - (NSInteger)accessibilityDisclosureLevel diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m index a27feceec31..31636dd99bb 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/TableRowAccessibility.m @@ -84,13 +84,15 @@ static jclass sjc_CAccessibility = NULL; (*env)->DeleteLocalRef(env, jkey); } - CellAccessibility *child = [[CellAccessibility alloc] initWithParent:self - withEnv:env - withAccessible:jchild - withIndex:childIndex - withView:self->fView - withJavaRole:childJavaRole]; - [children addObject:[[child retain] autorelease]]; + CellAccessibility *child = (CellAccessibility *) + [CommonComponentAccessibility createWithParent:self + withClass:[CellAccessibility class] + accessible:jchild + role:childJavaRole + index:childIndex + withEnv:env + withView:self->fView]; + [children addObject:child]; (*env)->DeleteLocalRef(env, jchild); (*env)->DeleteLocalRef(env, jchildJavaRole); -- GitLab From 82f4aacb42e60e9cd00e199703a869e7ad4465ff Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Tue, 26 Oct 2021 15:53:37 +0000 Subject: [PATCH 074/890] 8259609: C2: optimize long range checks in long counted loops Co-authored-by: John R Rose Reviewed-by: thartmann, jrose --- src/hotspot/share/opto/addnode.cpp | 83 ++--- src/hotspot/share/opto/loopPredicate.cpp | 71 ++-- src/hotspot/share/opto/loopTransform.cpp | 123 ++++--- src/hotspot/share/opto/loopnode.cpp | 285 ++++++++++++++-- src/hotspot/share/opto/loopnode.hpp | 31 +- src/hotspot/share/opto/loopopts.cpp | 2 +- src/hotspot/share/opto/mulnode.hpp | 42 ++- src/hotspot/share/opto/node.hpp | 3 + src/hotspot/share/opto/phaseX.cpp | 4 +- src/hotspot/share/opto/subnode.hpp | 12 + .../c2/irTests/TestLongRangeChecks.java | 63 ++++ .../rangechecks/TestLongRangeCheck.java | 304 ++++++++++++++++++ .../compiler/rangechecks/TestRCMinInt.java | 60 ++++ 13 files changed, 908 insertions(+), 175 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java create mode 100644 test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java create mode 100644 test/hotspot/jtreg/compiler/rangechecks/TestRCMinInt.java diff --git a/src/hotspot/share/opto/addnode.cpp b/src/hotspot/share/opto/addnode.cpp index a88513b7bd8..598deb08ffa 100644 --- a/src/hotspot/share/opto/addnode.cpp +++ b/src/hotspot/share/opto/addnode.cpp @@ -1107,6 +1107,7 @@ Node* MaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned, co bool is_int = gvn.type(a)->isa_int(); assert(is_int || gvn.type(a)->isa_long(), "int or long inputs"); assert(is_int == (gvn.type(b)->isa_int() != NULL), "inconsistent inputs"); + BasicType bt = is_int ? T_INT: T_LONG; Node* hook = NULL; if (gvn.is_IterGVN()) { // Make sure a and b are not destroyed @@ -1115,48 +1116,23 @@ Node* MaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned, co hook->init_req(1, b); } Node* res = NULL; - if (!is_unsigned) { + if (is_int && !is_unsigned) { if (is_max) { - if (is_int) { - res = gvn.transform(new MaxINode(a, b)); - assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match"); - } else { - Node* cmp = gvn.transform(new CmpLNode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); - } + res = gvn.transform(new MaxINode(a, b)); + assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match"); } else { - if (is_int) { - Node* res = gvn.transform(new MinINode(a, b)); - assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match"); - } else { - Node* cmp = gvn.transform(new CmpLNode(b, a)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); - } + Node* res = gvn.transform(new MinINode(a, b)); + assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match"); } } else { + Node* cmp = NULL; if (is_max) { - if (is_int) { - Node* cmp = gvn.transform(new CmpUNode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveINode(bol, a, b, t->is_int())); - } else { - Node* cmp = gvn.transform(new CmpULNode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); - } + cmp = gvn.transform(CmpNode::make(a, b, bt, is_unsigned)); } else { - if (is_int) { - Node* cmp = gvn.transform(new CmpUNode(b, a)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveINode(bol, a, b, t->is_int())); - } else { - Node* cmp = gvn.transform(new CmpULNode(b, a)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveLNode(bol, a, b, t->is_long())); - } + cmp = gvn.transform(CmpNode::make(b, a, bt, is_unsigned)); } + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + res = gvn.transform(CMoveNode::make(NULL, bol, a, b, t)); } if (hook != NULL) { hook->destruct(&gvn); @@ -1168,12 +1144,8 @@ Node* MaxNode::build_min_max_diff_with_zero(Node* a, Node* b, bool is_max, const bool is_int = gvn.type(a)->isa_int(); assert(is_int || gvn.type(a)->isa_long(), "int or long inputs"); assert(is_int == (gvn.type(b)->isa_int() != NULL), "inconsistent inputs"); - Node* zero = NULL; - if (is_int) { - zero = gvn.intcon(0); - } else { - zero = gvn.longcon(0); - } + BasicType bt = is_int ? T_INT: T_LONG; + Node* zero = gvn.integercon(0, bt); Node* hook = NULL; if (gvn.is_IterGVN()) { // Make sure a and b are not destroyed @@ -1181,32 +1153,15 @@ Node* MaxNode::build_min_max_diff_with_zero(Node* a, Node* b, bool is_max, const hook->init_req(0, a); hook->init_req(1, b); } - Node* res = NULL; + Node* cmp = NULL; if (is_max) { - if (is_int) { - Node* cmp = gvn.transform(new CmpINode(a, b)); - Node* sub = gvn.transform(new SubINode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveINode(bol, sub, zero, t->is_int())); - } else { - Node* cmp = gvn.transform(new CmpLNode(a, b)); - Node* sub = gvn.transform(new SubLNode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveLNode(bol, sub, zero, t->is_long())); - } + cmp = gvn.transform(CmpNode::make(a, b, bt, false)); } else { - if (is_int) { - Node* cmp = gvn.transform(new CmpINode(b, a)); - Node* sub = gvn.transform(new SubINode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveINode(bol, sub, zero, t->is_int())); - } else { - Node* cmp = gvn.transform(new CmpLNode(b, a)); - Node* sub = gvn.transform(new SubLNode(a, b)); - Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); - res = gvn.transform(new CMoveLNode(bol, sub, zero, t->is_long())); - } + cmp = gvn.transform(CmpNode::make(b, a, bt, false)); } + Node* sub = gvn.transform(SubNode::make(a, b, bt)); + Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::lt)); + Node* res = gvn.transform(CMoveNode::make(NULL, bol, sub, zero, t)); if (hook != NULL) { hook->destruct(&gvn); } diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 60581759c45..ad79fbf3b5b 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -712,7 +712,8 @@ class Invariance : public StackObj { // Returns true if the predicate of iff is in "scale*iv + offset u< load_range(ptr)" format // Note: this function is particularly designed for loop predication. We require load_range // and offset to be loop invariant computed on the fly by "invar" -bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar DEBUG_ONLY(COMMA ProjNode *predicate_proj)) const { +bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, BasicType bt, Node *iv, Node *&range, + Node *&offset, jlong &scale) const { if (!is_loop_exit(iff)) { return false; } @@ -727,48 +728,60 @@ bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invari return false; } const CmpNode *cmp = bol->in(1)->as_Cmp(); - if (cmp->Opcode() != Op_CmpU) { + if (!(cmp->is_Cmp() && cmp->operates_on(bt, false))) { return false; } - Node* range = cmp->in(2); - if (range->Opcode() != Op_LoadRange && !iff->is_RangeCheck()) { - const TypeInt* tint = phase->_igvn.type(range)->isa_int(); - if (tint == NULL || tint->empty() || tint->_lo < 0) { + range = cmp->in(2); + if (range->Opcode() != Op_LoadRange) { + const TypeInteger* tinteger = phase->_igvn.type(range)->isa_integer(bt); + if (tinteger == NULL || tinteger->empty() || tinteger->lo_as_long() < 0) { // Allow predication on positive values that aren't LoadRanges. // This allows optimization of loops where the length of the // array is a known value and doesn't need to be loaded back // from the array. return false; } + } else { + assert(bt == T_INT, "no LoadRange for longs"); } - if (!invar.is_invariant(range)) { - return false; - } - Node *iv = _head->as_CountedLoop()->phi(); - int scale = 0; - Node *offset = NULL; - if (!phase->is_scaled_iv_plus_offset(cmp->in(1), iv, &scale, &offset)) { - return false; - } - if (offset && !invar.is_invariant(offset)) { // offset must be invariant + scale = 0; + offset = NULL; + if (!phase->is_scaled_iv_plus_offset(cmp->in(1), iv, &scale, &offset, bt)) { return false; } + return true; +} + +bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar DEBUG_ONLY(COMMA ProjNode *predicate_proj)) const { + Node* range = NULL; + Node* offset = NULL; + jlong scale = 0; + Node* iv = _head->as_BaseCountedLoop()->phi(); + if (is_range_check_if(iff, phase, T_INT, iv, range, offset, scale)) { + if (!invar.is_invariant(range)) { + return false; + } + if (offset && !invar.is_invariant(offset)) { // offset must be invariant + return false; + } #ifdef ASSERT - if (offset && phase->has_ctrl(offset)) { - Node* offset_ctrl = phase->get_ctrl(offset); - if (phase->get_loop(predicate_proj) == phase->get_loop(offset_ctrl) && - phase->is_dominator(predicate_proj, offset_ctrl)) { - // If the control of offset is loop predication promoted by previous pass, - // then it will lead to cyclic dependency. - // Previously promoted loop predication is in the same loop of predication - // point. - // This situation can occur when pinning nodes too conservatively - can we do better? - assert(false, "cyclic dependency prevents range check elimination, idx: offset %d, offset_ctrl %d, predicate_proj %d", - offset->_idx, offset_ctrl->_idx, predicate_proj->_idx); + if (offset && phase->has_ctrl(offset)) { + Node* offset_ctrl = phase->get_ctrl(offset); + if (phase->get_loop(predicate_proj) == phase->get_loop(offset_ctrl) && + phase->is_dominator(predicate_proj, offset_ctrl)) { + // If the control of offset is loop predication promoted by previous pass, + // then it will lead to cyclic dependency. + // Previously promoted loop predication is in the same loop of predication + // point. + // This situation can occur when pinning nodes too conservatively - can we do better? + assert(false, "cyclic dependency prevents range check elimination, idx: offset %d, offset_ctrl %d, predicate_proj %d", + offset->_idx, offset_ctrl->_idx, predicate_proj->_idx); + } } - } #endif - return true; + return true; + } + return false; } //------------------------------rc_predicate----------------------------------- diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 3ad5480cd66..fa97be59d7e 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -1059,27 +1059,35 @@ void IdealLoopTree::policy_unroll_slp_analysis(CountedLoopNode *cl, PhaseIdealLo } } + //------------------------------policy_range_check----------------------------- // Return TRUE or FALSE if the loop should be range-check-eliminated or not. // When TRUE, the estimated node budget is also requested. // // We will actually perform iteration-splitting, a more powerful form of RCE. -bool IdealLoopTree::policy_range_check(PhaseIdealLoop *phase) const { - if (!RangeCheckElimination) return false; +bool IdealLoopTree::policy_range_check(PhaseIdealLoop* phase, bool provisional) const { + if (!provisional && !RangeCheckElimination) return false; // If nodes are depleted, some transform has miscalculated its needs. - assert(!phase->exceeding_node_budget(), "sanity"); + assert(provisional || !phase->exceeding_node_budget(), "sanity"); - CountedLoopNode *cl = _head->as_CountedLoop(); - // If we unrolled with no intention of doing RCE and we later changed our - // minds, we got no pre-loop. Either we need to make a new pre-loop, or we - // have to disallow RCE. - if (cl->is_main_no_pre_loop()) return false; // Disallowed for now. - Node *trip_counter = cl->phi(); + if (_head->is_CountedLoop()) { + CountedLoopNode *cl = _head->as_CountedLoop(); + // If we unrolled with no intention of doing RCE and we later changed our + // minds, we got no pre-loop. Either we need to make a new pre-loop, or we + // have to disallow RCE. + if (cl->is_main_no_pre_loop()) return false; // Disallowed for now. + + // check for vectorized loops, some opts are no longer needed + // RCE needs pre/main/post loops. Don't apply it on a single iteration loop. + if (cl->is_unroll_only() || (cl->is_normal_loop() && cl->trip_count() == 1)) return false; + } else { + assert(provisional, "no long counted loop expected"); + } - // check for vectorized loops, some opts are no longer needed - // RCE needs pre/main/post loops. Don't apply it on a single iteration loop. - if (cl->is_unroll_only() || (cl->is_normal_loop() && cl->trip_count() == 1)) return false; + BaseCountedLoopNode* cl = _head->as_BaseCountedLoop(); + Node *trip_counter = cl->phi(); + BasicType bt = cl->bt(); // Check loop body for tests of trip-counter plus loop-invariant vs // loop-invariant. @@ -1104,22 +1112,32 @@ bool IdealLoopTree::policy_range_check(PhaseIdealLoop *phase) const { Node *rc_exp = cmp->in(1); Node *limit = cmp->in(2); - Node *limit_c = phase->get_ctrl(limit); - if (limit_c == phase->C->top()) { - return false; // Found dead test on live IF? No RCE! - } - if (is_member(phase->get_loop(limit_c))) { - // Compare might have operands swapped; commute them - rc_exp = cmp->in(2); - limit = cmp->in(1); - limit_c = phase->get_ctrl(limit); + if (provisional) { + // Try to pattern match with either cmp inputs, do not check + // whether one of the inputs is loop independent as it may not + // have had a chance to be hoisted yet. + if (!phase->is_scaled_iv_plus_offset(cmp->in(1), trip_counter, NULL, NULL, bt) && + !phase->is_scaled_iv_plus_offset(cmp->in(2), trip_counter, NULL, NULL, bt)) { + continue; + } + } else { + Node *limit_c = phase->get_ctrl(limit); + if (limit_c == phase->C->top()) { + return false; // Found dead test on live IF? No RCE! + } if (is_member(phase->get_loop(limit_c))) { - continue; // Both inputs are loop varying; cannot RCE + // Compare might have operands swapped; commute them + rc_exp = cmp->in(2); + limit = cmp->in(1); + limit_c = phase->get_ctrl(limit); + if (is_member(phase->get_loop(limit_c))) { + continue; // Both inputs are loop varying; cannot RCE + } } - } - if (!phase->is_scaled_iv_plus_offset(rc_exp, trip_counter, NULL, NULL)) { - continue; + if (!phase->is_scaled_iv_plus_offset(rc_exp, trip_counter, NULL, NULL)) { + continue; + } } // Found a test like 'trip+off vs limit'. Test is an IfNode, has two (2) // projections. If BOTH are in the loop we need loop unswitching instead @@ -1127,7 +1145,7 @@ bool IdealLoopTree::policy_range_check(PhaseIdealLoop *phase) const { if (is_loop_exit(iff)) { // Found valid reason to split iterations (if there is room). // NOTE: Usually a gross overestimate. - return phase->may_require_nodes(est_loop_clone_sz(2)); + return provisional || phase->may_require_nodes(est_loop_clone_sz(2)); } } // End of is IF } @@ -2458,8 +2476,9 @@ void PhaseIdealLoop::add_constraint(jlong stride_con, jlong scale_con, Node* off //------------------------------is_scaled_iv--------------------------------- // Return true if exp is a constant times an induction var -bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, int* p_scale) { +bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType bt) { exp = exp->uncast(); + assert(bt == T_INT || bt == T_LONG, "unexpected int type"); if (exp == iv) { if (p_scale != NULL) { *p_scale = 1; @@ -2467,23 +2486,29 @@ bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, int* p_scale) { return true; } int opc = exp->Opcode(); - if (opc == Op_MulI) { + // Can't use is_Mul() here as it's true for AndI and AndL + if ((opc == Op_MulI || opc == Op_MulL) && exp->operates_on(bt, true)) { if (exp->in(1)->uncast() == iv && exp->in(2)->is_Con()) { if (p_scale != NULL) { - *p_scale = exp->in(2)->get_int(); + *p_scale = exp->in(2)->get_integer_as_long(bt); } return true; } if (exp->in(2)->uncast() == iv && exp->in(1)->is_Con()) { if (p_scale != NULL) { - *p_scale = exp->in(1)->get_int(); + *p_scale = exp->in(1)->get_integer_as_long(bt); } return true; } - } else if (opc == Op_LShiftI) { + } else if (exp->is_LShift() && exp->operates_on(bt, true)) { if (exp->in(1)->uncast() == iv && exp->in(2)->is_Con()) { if (p_scale != NULL) { - *p_scale = 1 << exp->in(2)->get_int(); + jint shift_amount = exp->in(2)->get_int(); + if (bt == T_INT) { + *p_scale = java_shift_left((jint)1, (juint)shift_amount); + } else if (bt == T_LONG) { + *p_scale = java_shift_left((jlong)1, (julong)shift_amount); + } } return true; } @@ -2493,25 +2518,25 @@ bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, int* p_scale) { //-----------------------------is_scaled_iv_plus_offset------------------------------ // Return true if exp is a simple induction variable expression: k1*iv + (invar + k2) -bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset, int depth) { - if (is_scaled_iv(exp, iv, p_scale)) { +bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scale, Node** p_offset, BasicType bt, int depth) { + assert(bt == T_INT || bt == T_LONG, "unexpected int type"); + if (is_scaled_iv(exp, iv, p_scale, bt)) { if (p_offset != NULL) { - Node *zero = _igvn.intcon(0); + Node *zero = _igvn.integercon(0, bt); set_ctrl(zero, C->root()); *p_offset = zero; } return true; } exp = exp->uncast(); - int opc = exp->Opcode(); - if (opc == Op_AddI) { - if (is_scaled_iv(exp->in(1), iv, p_scale)) { + if (exp->is_Add() && exp->operates_on(bt, true)) { + if (is_scaled_iv(exp->in(1), iv, p_scale, bt)) { if (p_offset != NULL) { *p_offset = exp->in(2); } return true; } - if (is_scaled_iv(exp->in(2), iv, p_scale)) { + if (is_scaled_iv(exp->in(2), iv, p_scale, bt)) { if (p_offset != NULL) { *p_offset = exp->in(1); } @@ -2521,30 +2546,34 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node* offset2 = NULL; if (depth < 2 && is_scaled_iv_plus_offset(exp->in(1), iv, p_scale, - p_offset != NULL ? &offset2 : NULL, depth+1)) { + p_offset != NULL ? &offset2 : NULL, bt, depth+1)) { if (p_offset != NULL) { Node *ctrl_off2 = get_ctrl(offset2); - Node* offset = new AddINode(offset2, exp->in(2)); + Node* offset = AddNode::make(offset2, exp->in(2), bt); register_new_node(offset, ctrl_off2); *p_offset = offset; } return true; } } - } else if (opc == Op_SubI) { - if (is_scaled_iv(exp->in(1), iv, p_scale)) { + } else if (exp->is_Sub() && exp->operates_on(bt, true)) { + if (is_scaled_iv(exp->in(1), iv, p_scale, bt)) { if (p_offset != NULL) { - Node *zero = _igvn.intcon(0); + Node *zero = _igvn.integercon(0, bt); set_ctrl(zero, C->root()); Node *ctrl_off = get_ctrl(exp->in(2)); - Node* offset = new SubINode(zero, exp->in(2)); + Node* offset = SubNode::make(zero, exp->in(2), bt); register_new_node(offset, ctrl_off); *p_offset = offset; } return true; } - if (is_scaled_iv(exp->in(2), iv, p_scale)) { + if (is_scaled_iv(exp->in(2), iv, p_scale, bt)) { if (p_offset != NULL) { + // We can't handle a scale of min_jint (or min_jlong) here as -1 * min_jint = min_jint + if (*p_scale == min_signed_integer(bt)) { + return false; + } *p_scale *= -1; *p_offset = exp->in(1); } @@ -3411,7 +3440,7 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n // unrolling), plus any needed for RCE purposes. bool should_unroll = policy_unroll(phase); - bool should_rce = policy_range_check(phase); + bool should_rce = policy_range_check(phase, false); // If not RCE'ing (iteration splitting), then we do not need a pre-loop. // We may still need to peel an initial iteration but we will not diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index 6f7e34d3d76..d147264a96c 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -525,7 +525,7 @@ static bool condition_stride_ok(BoolTest::mask bt, jlong stride_con) { return true; } -void PhaseIdealLoop::long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head) { +Node* PhaseIdealLoop::long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head) { Node* iv_as_long = new ConvI2LNode(inner_iv, TypeLong::INT); register_new_node(iv_as_long, inner_head); Node* iv_replacement = new AddLNode(outer_phi, iv_as_long); @@ -546,6 +546,7 @@ void PhaseIdealLoop::long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_ int nb = u->replace_edge(iv_to_replace, iv_replacement, &_igvn); i -= nb; } + return iv_replacement; } void PhaseIdealLoop::add_empty_predicate(Deoptimization::DeoptReason reason, Node* inner_head, IdealLoopTree* loop, SafePointNode* sfpt) { @@ -828,6 +829,9 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List Node* entry_control = x->in(LoopNode::EntryControl); Node* cmp = exit_test->cmp_node(); + Node_List range_checks; + iters_limit = extract_long_range_checks(loop, stride_con, iters_limit, phi, range_checks); + // Clone the control flow of the loop to build an outer loop Node* outer_back_branch = back_control->clone(); Node* outer_exit_test = new IfNode(exit_test->in(0), exit_test->in(1), exit_test->_prob, exit_test->_fcnt); @@ -877,22 +881,22 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List Node* inner_iters_actual_int = new ConvL2INode(inner_iters_actual); _igvn.register_new_node_with_optimizer(inner_iters_actual_int); - Node* zero = _igvn.intcon(0); - set_ctrl(zero, C->root()); + Node* int_zero = _igvn.intcon(0); + set_ctrl(int_zero, C->root()); if (stride_con < 0) { - inner_iters_actual_int = new SubINode(zero, inner_iters_actual_int); + inner_iters_actual_int = new SubINode(int_zero, inner_iters_actual_int); _igvn.register_new_node_with_optimizer(inner_iters_actual_int); } // Clone the iv data nodes as an integer iv - Node* int_stride = _igvn.intcon((int)stride_con); + Node* int_stride = _igvn.intcon(checked_cast(stride_con)); set_ctrl(int_stride, C->root()); Node* inner_phi = new PhiNode(x->in(0), TypeInt::INT); Node* inner_incr = new AddINode(inner_phi, int_stride); Node* inner_cmp = NULL; inner_cmp = new CmpINode(inner_incr, inner_iters_actual_int); Node* inner_bol = new BoolNode(inner_cmp, exit_test->in(1)->as_Bool()->_test._test); - inner_phi->set_req(LoopNode::EntryControl, zero); + inner_phi->set_req(LoopNode::EntryControl, int_zero); inner_phi->set_req(LoopNode::LoopBackControl, inner_incr); register_new_node(inner_phi, x); register_new_node(inner_incr, x); @@ -915,7 +919,7 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List // Replace inner loop long iv phi as inner loop int iv phi + outer // loop iv phi - long_loop_replace_long_iv(phi, inner_phi, outer_phi, head); + Node* iv_add = long_loop_replace_long_iv(phi, inner_phi, outer_phi, head); // Replace inner loop long iv incr with inner loop int incr + outer // loop iv phi @@ -979,6 +983,8 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List // exit_branch: break; //in(0) := outer_exit_test // } + transform_long_range_checks(checked_cast(stride_con), range_checks, outer_phi, inner_iters_actual_int, + inner_phi, iv_add, inner_head); // Peel one iteration of the loop and use the safepoint at the end // of the peeled iteration to insert empty predicates. If no well // positioned safepoint peel to guarantee a safepoint in the outer @@ -1012,6 +1018,239 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List return true; } +int PhaseIdealLoop::extract_long_range_checks(const IdealLoopTree* loop, jlong stride_con, int iters_limit, PhiNode* phi, + Node_List& range_checks) { + if (stride_con < 0) { // only for stride_con > 0 && scale > 0 for now + return iters_limit; + } + const jlong min_iters = 2; + jlong reduced_iters_limit = iters_limit; + jlong original_iters_limit = iters_limit; + for (uint i = 0; i < loop->_body.size(); i++) { + Node* c = loop->_body.at(i); + if (c->is_IfProj() && c->in(0)->is_RangeCheck()) { + CallStaticJavaNode* call = c->as_IfProj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none); + if (call != NULL) { + Node* range = NULL; + Node* offset = NULL; + jlong scale = 0; + RangeCheckNode* rc = c->in(0)->as_RangeCheck(); + if (loop->is_range_check_if(rc, this, T_LONG, phi, range, offset, scale) && + loop->is_invariant(range) && loop->is_invariant(offset) && + scale > 0 && // only for stride_con > 0 && scale > 0 for now + original_iters_limit / ABS(scale * stride_con) >= min_iters) { + reduced_iters_limit = MIN2(reduced_iters_limit, original_iters_limit/ABS(scale)); + range_checks.push(c); + } + } + } + } + + return checked_cast(reduced_iters_limit); +} + +// One execution of the inner loop covers a sub-range of the entire iteration range of the loop: [A,Z), aka [A=init, +// Z=limit). If the loop has at least one trip (which is the case here), the iteration variable i always takes A as its +// first value, followed by A+S (S is the stride), next A+2S, etc. The limit is exclusive, so that the final value B of +// i is never Z. It will be B=Z-1 if S=1, or B=Z+1 if S=-1. If |S|>1 the formula for the last value requires a floor +// operation, specifically B=floor((Z-sgn(S)-A)/S)*S+A. Thus i ranges as i:[A,B] or i:[A,Z) or i:[A,Z-U) for some U 0) to simplify the logic for clamping 32-bit bounds (L_2, R_2). +// For restrictions on S and K, see the guards in extract_long_range_checks. + +// Within the loop there may be many range checks. Each such range check (R.C.) is of the form 0 <= i*K+L < R, where K +// is a scale factor applied to the loop iteration variable i, and L is some offset; K, L, and R are loop-invariant. +// Because R is never negative, this check can always be simplified to an unsigned check i*K+L 0, +// the first C must be A itself, and the next C value is the previous C+Z_2. In each sub-loop, j counts up from zero +// and exits just before i=C+Z_2. + +// (N.B. If S<0 the formulas are different, because all the loops count downward.) + +// Returning to range checks, we see that each i*K+L =s64 0, then use this test: +// j*K + 0 =s64 0 but Q_max H, it returns L not H. +// +// Tests above can be merged into a single one: +// L_clamp = Q_min < 0 ? 0 : Q_min +// H_clamp = Q_max < Q_min ? R : Q_max +// j*K + Q_min - L_clamp root()); + + for (uint i = 0; i < range_checks.size(); i++) { + ProjNode* proj = range_checks.at(i)->as_Proj(); + ProjNode* unc_proj = proj->other_if_proj(); + RangeCheckNode* rc = proj->in(0)->as_RangeCheck(); + jlong scale = 0; + Node* offset = NULL; + Node* rc_bol = rc->in(1); + Node* rc_cmp = rc_bol->in(1); + if (rc_cmp->Opcode() == Op_CmpU) { + // could be shared and have already been taken care of + continue; + } + bool ok = is_scaled_iv_plus_offset(rc_cmp->in(1), iv_add, &scale, &offset, T_LONG); + assert(ok, "inconsistent: was tested before"); + Node* range = rc_cmp->in(2); + Node* c = rc->in(0); + Node* entry_control = inner_head->in(LoopNode::EntryControl); + + Node* R = range; + Node* K = _igvn.longcon(scale); + set_ctrl(K, this->C->root()); + Node* L = offset; + Node* C = outer_phi; + Node* Z_2 = new ConvI2LNode(inner_iters_actual_int, TypeLong::LONG); + register_new_node(Z_2, entry_control); + + // Start with 64-bit values: + // i*K + L 0 + Node* R_2 = clamp(R, L_clamp, H_clamp); + R_2 = new SubLNode(R_2, L_clamp); + register_new_node(R_2, entry_control); + R_2 = new ConvL2INode(R_2, TypeInt::POS); + register_new_node(R_2, entry_control); + + // Q = Q_min - L_clamp + // that is: Q = Q_min - 0 if Q_min < 0 + // or: Q = Q_min - Q_min = 0 if Q_min > 0 + Node* Q = new SubLNode(Q_min, L_clamp); + register_new_node(Q, entry_control); + Q = new ConvL2INode(Q, TypeInt::INT); + register_new_node(Q, entry_control); + + // Transform the range check + K = _igvn.intcon(checked_cast(scale)); + set_ctrl(K, this->C->root()); + Node* scaled_iv = new MulINode(inner_phi, K); + register_new_node(scaled_iv, c); + Node* scaled_iv_plus_offset = scaled_iv_plus_offset = new AddINode(scaled_iv, Q); + register_new_node(scaled_iv_plus_offset, c); + + Node* new_rc_cmp = new CmpUNode(scaled_iv_plus_offset, R_2); + register_new_node(new_rc_cmp, c); + + _igvn.replace_input_of(rc_bol, 1, new_rc_cmp); + } +} + +Node* PhaseIdealLoop::clamp(Node* R, Node* L, Node* H) { + Node* min = MaxNode::signed_min(R, H, TypeLong::LONG, _igvn); + set_subtree_ctrl(min, true); + Node* max = MaxNode::signed_max(L, min, TypeLong::LONG, _igvn); + set_subtree_ctrl(max, true); + return max; +} + LoopNode* PhaseIdealLoop::create_inner_head(IdealLoopTree* loop, LongCountedLoopNode* head, LongCountedLoopEndNode* exit_test) { LoopNode* new_inner_head = new LoopNode(head->in(1), head->in(2)); @@ -1417,10 +1656,10 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ Node* bol; if (stride_con > 0) { - cmp_limit = CmpNode::make(limit, _igvn.integercon(max_jint - stride_m, iv_bt), iv_bt); + cmp_limit = CmpNode::make(limit, _igvn.integercon(max_signed_integer(iv_bt) - stride_m, iv_bt), iv_bt); bol = new BoolNode(cmp_limit, BoolTest::le); } else { - cmp_limit = CmpNode::make(limit, _igvn.integercon(min_jint - stride_m, iv_bt), iv_bt); + cmp_limit = CmpNode::make(limit, _igvn.integercon(min_signed_integer(iv_bt) - stride_m, iv_bt), iv_bt); bol = new BoolNode(cmp_limit, BoolTest::ge); } @@ -1873,7 +2112,7 @@ const Type* LoopLimitNode::Value(PhaseGVN* phase) const { int stride_con = stride_t->is_int()->get_con(); if (stride_con == 1) - return NULL; // Identity + return bottom_type(); // Identity if (init_t->is_int()->is_con() && limit_t->is_int()->is_con()) { // Use jlongs to avoid integer overflow. @@ -3955,24 +4194,26 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) { // Reassociate invariants and prep for split_thru_phi for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) { IdealLoopTree* lpt = iter.current(); - bool is_counted = lpt->is_counted(); - if (!is_counted || !lpt->is_innermost()) continue; + if (!lpt->is_loop()) { + continue; + } + Node* head = lpt->_head; + if (!head->is_BaseCountedLoop() || !lpt->is_innermost()) continue; // check for vectorized loops, any reassociation of invariants was already done - if (is_counted && lpt->_head->as_CountedLoop()->is_unroll_only()) { - continue; - } else { - AutoNodeBudget node_budget(this); - lpt->reassociate_invariants(this); + if (head->is_CountedLoop()) { + if (head->as_CountedLoop()->is_unroll_only()) { + continue; + } else { + AutoNodeBudget node_budget(this); + lpt->reassociate_invariants(this); + } } // Because RCE opportunities can be masked by split_thru_phi, // look for RCE candidates and inhibit split_thru_phi // on just their loop-phi's for this pass of loop opts - if (SplitIfBlocks && do_split_ifs) { - AutoNodeBudget node_budget(this, AutoNodeBudget::NO_BUDGET_CHECK); - if (lpt->policy_range_check(this)) { - lpt->_rce_candidate = 1; // = true - } + if (SplitIfBlocks && do_split_ifs && lpt->policy_range_check(this, true)) { + lpt->_rce_candidate = 1; // = true } } } diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 15a55408314..c851d1d9f47 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -734,10 +734,12 @@ public: // Return TRUE or FALSE if the loop should be range-check-eliminated. // Gather a list of IF tests that are dominated by iteration splitting; // also gather the end of the first split and the start of the 2nd split. - bool policy_range_check( PhaseIdealLoop *phase ) const; + bool policy_range_check(PhaseIdealLoop* phase, bool provisional) const; // Return TRUE if "iff" is a range check. bool is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar DEBUG_ONLY(COMMA ProjNode *predicate_proj)) const; + bool is_range_check_if(IfNode* iff, PhaseIdealLoop* phase, BasicType bt, Node* iv, Node*& range, Node*& offset, + jlong& scale) const; // Estimate the number of nodes required when cloning a loop (body). uint est_loop_clone_sz(uint factor) const; @@ -1168,7 +1170,7 @@ public: bool is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_bt); - void long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head); + Node* long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head); bool transform_long_counted_loop(IdealLoopTree* loop, Node_List &old_new); #ifdef ASSERT bool convert_to_long_loop(Node* cmp, Node* phi, IdealLoopTree* loop); @@ -1270,10 +1272,21 @@ public: void mark_reductions( IdealLoopTree *loop ); // Return true if exp is a constant times an induction var - bool is_scaled_iv(Node* exp, Node* iv, int* p_scale); + bool is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType bt); // Return true if exp is a scaled induction var plus (or minus) constant - bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset, int depth = 0); + bool is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scale, Node** p_offset, BasicType bt, int depth = 0); + bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset) { + jlong long_scale; + if (is_scaled_iv_plus_offset(exp, iv, &long_scale, p_offset, T_INT)) { + int int_scale = checked_cast(long_scale); + if (p_scale != NULL) { + *p_scale = int_scale; + } + return true; + } + return false; + } // Enum to determine the action to be performed in create_new_if_for_predicate() when processing phis of UCT regions. enum class UnswitchingAction { @@ -1623,6 +1636,14 @@ public: LoopNode* create_inner_head(IdealLoopTree* loop, LongCountedLoopNode* head, LongCountedLoopEndNode* exit_test); + + int extract_long_range_checks(const IdealLoopTree* loop, jlong stride_con, int iters_limit, PhiNode* phi, + Node_List &range_checks); + + void transform_long_range_checks(int stride_con, const Node_List &range_checks, Node* outer_phi, + Node* inner_iters_actual_int, Node* inner_phi, + Node* iv_add, LoopNode* inner_head); + Node* get_late_ctrl_with_anti_dep(LoadNode* n, Node* early, Node* LCA); bool ctrl_of_use_out_of_loop(const Node* n, Node* n_ctrl, IdealLoopTree* n_loop, Node* ctrl); @@ -1633,6 +1654,8 @@ public: void try_sink_out_of_loop(Node* n); + Node* clamp(Node* R, Node* L, Node* H); + bool safe_for_if_replacement(const Node* dom) const; }; diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 2e8c7c20ef4..8dff310c569 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -1074,7 +1074,7 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) { // If the loop is a candidate for range check elimination, // delay splitting through it's phi until a later loop optimization - if (n_blk->is_CountedLoop()) { + if (n_blk->is_BaseCountedLoop()) { IdealLoopTree *lp = get_loop(n_blk); if (lp && lp->_rce_candidate) { return n; diff --git a/src/hotspot/share/opto/mulnode.hpp b/src/hotspot/share/opto/mulnode.hpp index b26c4dd46e1..25bd6ebf150 100644 --- a/src/hotspot/share/opto/mulnode.hpp +++ b/src/hotspot/share/opto/mulnode.hpp @@ -41,7 +41,7 @@ class PhaseTransform; class MulNode : public Node { virtual uint hash() const; public: - MulNode( Node *in1, Node *in2 ): Node(0,in1,in2) { + MulNode(Node *in1, Node *in2): Node(NULL,in1,in2) { init_class_id(Class_Mul); } @@ -75,6 +75,11 @@ public: // Supplied function to return the multiplicative opcode virtual int mul_opcode() const = 0; + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return false; + } + // Supplied function to return the additive opcode virtual int max_opcode() const = 0; @@ -98,6 +103,10 @@ public: int min_opcode() const { return Op_MinI; } const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return bt == T_INT; + } }; //------------------------------MulLNode--------------------------------------- @@ -116,6 +125,10 @@ public: int min_opcode() const { return Op_MinL; } const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return bt == T_LONG; + } }; @@ -216,30 +229,49 @@ public: virtual uint ideal_reg() const { return Op_RegL; } }; +class LShiftNode : public Node { +public: + LShiftNode(Node *in1, Node *in2) : Node(NULL,in1,in2) { + init_class_id(Class_LShift); + } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return false; + } +}; + //------------------------------LShiftINode------------------------------------ // Logical shift left -class LShiftINode : public Node { +class LShiftINode : public LShiftNode { public: - LShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} + LShiftINode(Node *in1, Node *in2) : LShiftNode(in1,in2) {} virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return bt == T_INT; + } }; //------------------------------LShiftLNode------------------------------------ // Logical shift left -class LShiftLNode : public Node { +class LShiftLNode : public LShiftNode { public: - LShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} + LShiftLNode(Node *in1, Node *in2) : LShiftNode(in1,in2) {} virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return bt == T_LONG; + } }; diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 5406428cbb4..078cbd03423 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -98,6 +98,7 @@ class LockNode; class LongCountedLoopNode; class LongCountedLoopEndNode; class LoopNode; +class LShiftNode; class MachBranchNode; class MachCallDynamicJavaNode; class MachCallJavaNode; @@ -754,6 +755,7 @@ public: DEFINE_CLASS_ID(Halt, Node, 15) DEFINE_CLASS_ID(Opaque1, Node, 16) DEFINE_CLASS_ID(Move, Node, 17) + DEFINE_CLASS_ID(LShift, Node, 18) _max_classes = ClassMask_Move }; @@ -883,6 +885,7 @@ public: DEFINE_CLASS_QUERY(LoadStoreConditional) DEFINE_CLASS_QUERY(Lock) DEFINE_CLASS_QUERY(Loop) + DEFINE_CLASS_QUERY(LShift) DEFINE_CLASS_QUERY(Mach) DEFINE_CLASS_QUERY(MachBranch) DEFINE_CLASS_QUERY(MachCall) diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index cc2a3fcae84..29444fffac2 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -792,9 +792,7 @@ ConLNode* PhaseTransform::longcon(jlong l) { } ConNode* PhaseTransform::integercon(jlong l, BasicType bt) { if (bt == T_INT) { - jint int_con = (jint)l; - assert(((long)int_con) == l, "not an int"); - return intcon(int_con); + return intcon(checked_cast(l)); } assert(bt == T_LONG, "not an integer"); return longcon(l); diff --git a/src/hotspot/share/opto/subnode.hpp b/src/hotspot/share/opto/subnode.hpp index 4560c109a1e..281b28237c8 100644 --- a/src/hotspot/share/opto/subnode.hpp +++ b/src/hotspot/share/opto/subnode.hpp @@ -62,6 +62,10 @@ public: virtual const Type *add_id() const = 0; static SubNode* make(Node* in1, Node* in2, BasicType bt); + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return false; + } }; @@ -77,6 +81,10 @@ public: const Type *add_id() const { return TypeInt::ZERO; } const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return bt == T_INT; + } }; //------------------------------SubLNode--------------------------------------- @@ -90,6 +98,10 @@ public: const Type *add_id() const { return TypeLong::ZERO; } const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } + virtual bool operates_on(BasicType bt, bool signed_int) const { + assert(bt == T_INT || bt == T_LONG, "unsupported"); + return bt == T_LONG; + } }; // NOTE: SubFPNode should be taken away and replaced by add and negate diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java b/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java new file mode 100644 index 00000000000..298f0094201 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021, 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. + */ + +package compiler.c2.irTests; + +import compiler.lib.ir_framework.*; +import java.util.Objects; + +/* + * @test + * @bug 8259609 + * @summary C2: optimize long range checks in long counted loops + * @library /test/lib / + * @run driver compiler.c2.irTests.TestLongRangeChecks + */ + +public class TestLongRangeChecks { + public static void main(String[] args) { + TestFramework.run(); + } + + + @Test + @IR(counts = { IRNode.LOOP, "1"}) + @IR(failOn = { IRNode.COUNTEDLOOP}) + public static void testStridePosScalePos(long start, long stop, long length, long offset) { + final long scale = 1; + final long stride = 1; + + // Loop is first transformed into a loop nest, long range + // check into an int range check, the range check is hoisted + // and the inner counted loop becomes empty so is optimized + // out. + for (long i = start; i < stop; i += stride) { + Objects.checkIndex(scale * i + offset, length); + } + } + + @Run(test = "testStridePosScalePos") + private void testStridePosScalePos_runner() { + testStridePosScalePos(0, 100, 100, 0); + } +} diff --git a/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java b/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java new file mode 100644 index 00000000000..63a649b886b --- /dev/null +++ b/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2021, 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. + */ + +/** + * @test + * @bug 8259609 + * @summary C2: optimize long range checks in long counted loops + * @requires vm.compiler2.enabled + * @requires vm.compMode != "Xcomp" + * @library /test/lib / + * @modules java.base/jdk.internal.util + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * + * @run main/othervm -ea -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation TestLongRangeCheck + * + */ + +import jdk.internal.util.Preconditions; +import sun.hotspot.WhiteBox; +import java.lang.reflect.Method; +import compiler.whitebox.CompilerWhiteBoxTest; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Paths; +import java.lang.reflect.InvocationTargetException; + +public class TestLongRangeCheck { + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + private static void assertIsCompiled(Method m) { + if (!WHITE_BOX.isMethodCompiled(m) || WHITE_BOX.getMethodCompilationLevel(m) != CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) { + throw new RuntimeException("should still be compiled"); + } + } + + private static void assertIsNotCompiled(Method m) { + if (WHITE_BOX.isMethodCompiled(m) && WHITE_BOX.getMethodCompilationLevel(m) == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) { + throw new RuntimeException("should have been deoptimized"); + } + } + + private static void compile(Method m) { + WHITE_BOX.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + assertIsCompiled(m); + } + + public static ClassLoader newClassLoader() { + try { + return new URLClassLoader(new URL[] { + Paths.get(System.getProperty("test.classes",".")).toUri().toURL(), + }, null); + } catch (MalformedURLException e){ + throw new RuntimeException("Unexpected URL conversion failure", e); + } + } + + private static void test(String method, long start, long stop, long length, long offset) throws Exception { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod(method, long.class, long.class, long.class, long.class); + m.invoke(null, start, stop, length, offset); // run once so all classes are loaded + compile(m); + + m.invoke(null, start, stop, length, offset); + assertIsCompiled(m); + try { + m.invoke(null, start-1, stop, length, offset); + throw new RuntimeException("should have thrown"); + } catch(InvocationTargetException e) { + if (!(e.getCause() instanceof IndexOutOfBoundsException)) { + throw new RuntimeException("unexpected exception"); + } + } + assertIsNotCompiled(m); + + m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod(method, long.class, long.class, long.class, long.class); + m.invoke(null, start, stop, length, offset); // run once so all classes are loaded + compile(m); + assertIsCompiled(m); + + m.invoke(null, start, stop, length, offset); + assertIsCompiled(m); + try { + m.invoke(null, stop, stop + 100, length, offset); + throw new RuntimeException("should have thrown"); + } catch(InvocationTargetException e) { + if (!(e.getCause() instanceof IndexOutOfBoundsException)) { + throw new RuntimeException("unexpected exception"); + } + } + assertIsNotCompiled(m); + + m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod(method, long.class, long.class, long.class, long.class); + m.invoke(null, start, stop, length, offset); // run once so all classes are loaded + compile(m); + + m.invoke(null, start, stop, length, offset); + assertIsCompiled(m); + try { + m.invoke(null, start, stop+1, length, offset); + throw new RuntimeException("should have thrown"); + } catch(InvocationTargetException e) { + if (!(e.getCause() instanceof IndexOutOfBoundsException)) { + throw new RuntimeException("unexpected exception"); + } + } + assertIsNotCompiled(m); + } + + + public static void main(String[] args) throws Exception { + + test("testStridePosScalePos", 0, 100, 100, 0); + + test("testStrideNegScaleNeg", 0, 100, 100, 100); + + test("testStrideNegScalePos", 0, 100, 100, 0); + + test("testStridePosScaleNeg", 0, 100, 100, 99); + + test("testStridePosScalePosNotOne", 0, 100, 1090, 0); + + test("testStrideNegScaleNegNotOne", 0, 100, 1090, 1100); + + test("testStrideNegScalePosNotOne", 0, 100, 1090, 0); + + test("testStridePosScaleNegNotOne", 0, 100, 1090, 1089); + + long v = ((long)Integer.MAX_VALUE / 10000) * 250000; + + test("testStridePosNotOneScalePos", -v, v, v * 2, v); + + test("testStrideNegNotOneScaleNeg", -v, v, v * 2, v); + + test("testStrideNegNotOneScalePos", -v, v, v * 2, v); + + test("testStridePosNotOneScaleNeg", -v, v, v * 2, v-1); + + // offset causes overflow + + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePos", long.class, long.class, long.class, long.class); + m.invoke(null, 0, 100, 100, 0); + compile(m); + + m.invoke(null, 0, 100, 100, 0); + assertIsCompiled(m); + try { + m.invoke(null, 0, 100, 100, Long.MAX_VALUE - 50); + throw new RuntimeException("should have thrown"); + } catch(InvocationTargetException e) { + if (!(e.getCause() instanceof IndexOutOfBoundsException)) { + throw new RuntimeException("unexpected exception"); + } + } + assertIsNotCompiled(m); + } + + // no spurious deopt if the range check doesn't fail because not executed + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosConditional", long.class, long.class, long.class, long.class, long.class, long.class); + m.invoke(null, 0, 100, 100, 0, 0, 100); + compile(m); + + m.invoke(null, 0, 100, 100, -50, 50, 100); + assertIsCompiled(m); + } + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosConditional", long.class, long.class, long.class, long.class, long.class, long.class); + m.invoke(null, 0, 100, 100, 0, 0, 100); + compile(m); + + m.invoke(null, 0, 100, Long.MAX_VALUE, Long.MAX_VALUE - 50, 0, 50); + assertIsCompiled(m); + } + } + + public static void testStridePosScalePos(long start, long stop, long length, long offset) { + final long scale = 1; + final long stride = 1; + for (long i = start; i < stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScaleNeg(long start, long stop, long length, long offset) { + final long scale = -1; + final long stride = 1; + for (long i = stop; i > start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScalePos(long start, long stop, long length, long offset) { + final long scale = 1; + final long stride = 1; + for (long i = stop-1; i >= start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScaleNeg(long start, long stop, long length, long offset) { + final long scale = -1; + final long stride = 1; + for (long i = start; i < stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScalePosNotOne(long start, long stop, long length, long offset) { + final long scale = 11; + final long stride = 1; + for (long i = start; i < stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScaleNegNotOne(long start, long stop, long length, long offset) { + final long scale = -11; + final long stride = 1; + for (long i = stop; i > start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScalePosNotOne(long start, long stop, long length, long offset) { + final long scale = 11; + final long stride = 1; + for (long i = stop-1; i >= start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScaleNegNotOne(long start, long stop, long length, long offset) { + final long scale = -11; + final long stride = 1; + for (long i = start; i < stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosNotOneScalePos(long start, long stop, long length, long offset) { + final long scale = 1; + final long stride = Integer.MAX_VALUE / 10000; + for (long i = start; i < stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegNotOneScaleNeg(long start, long stop, long length, long offset) { + final long scale = -1; + final long stride = Integer.MAX_VALUE / 10000; + for (long i = stop; i > start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegNotOneScalePos(long start, long stop, long length, long offset) { + final long scale = 1; + final long stride = Integer.MAX_VALUE / 10000; + for (long i = stop-1; i >= start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosNotOneScaleNeg(long start, long stop, long length, long offset) { + final long scale = -1; + final long stride = Integer.MAX_VALUE / 10000; + for (long i = start; i < stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScalePosConditional(long start, long stop, long length, long offset, long start2, long stop2) { + Preconditions.checkIndex(0, length, null); + final long scale = 1; + final long stride = 1; + for (long i = start; i < stop; i += stride) { + if (i >= start2 && i < stop2) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/rangechecks/TestRCMinInt.java b/test/hotspot/jtreg/compiler/rangechecks/TestRCMinInt.java new file mode 100644 index 00000000000..6f8e80aff50 --- /dev/null +++ b/test/hotspot/jtreg/compiler/rangechecks/TestRCMinInt.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021, 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. + */ + +/** + * @test + * @bug 8259609 + * @summary range checks with min int scale value + * + * @run main/othervm -XX:-BackgroundCompilation TestRCMinInt + * + */ + +import java.util.Objects; + +public class TestRCMinInt { + public static void main(String[] args) { + for (int i = 0; i < 20_000; i++) { + test1(0, 10, 10); + test2(0, 10, 10); + } + } + + private static float test1(int start, int stop, int offset) { + float v = 1; + for (int i = start; i < stop; i+=2) { + final int index = offset + Integer.MIN_VALUE * i; + Objects.checkIndex(index, 100); + } + return v; + } + + private static float test2(int start, int stop, int offset) { + float v = 1; + for (int i = start; i < stop; i+=2) { + final int index = offset - Integer.MIN_VALUE * i; + Objects.checkIndex(index, 100); + } + return v; + } +} -- GitLab From e5cd2692da6327c6fde954f86595a08fe5edf43f Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Tue, 26 Oct 2021 16:26:57 +0000 Subject: [PATCH 075/890] 8274944: AppCDS dump causes SEGV in VM thread while adjusting lambda proxy class info Reviewed-by: minqi, dholmes --- src/hotspot/share/cds/dynamicArchive.cpp | 1 + src/hotspot/share/cds/metaspaceShared.cpp | 1 + .../classfile/systemDictionaryShared.cpp | 22 +++++ .../classfile/systemDictionaryShared.hpp | 1 + test/hotspot/jtreg/TEST.groups | 1 + .../cds/appcds/LambdaContainsOldInf.java | 78 ++++++++++++++++++ .../dynamicArchive/LambdaContainsOldInf.java | 81 +++++++++++++++++++ .../test-classes/LambdaContainsOldInfApp.java | 34 ++++++++ .../cds/appcds/test-classes/OldProvider.jasm | 29 +++++++ 9 files changed, 248 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/OldProvider.jasm diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index b3c18e318a8..33da23e10fe 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -112,6 +112,7 @@ public: // Block concurrent class unloading from changing the _dumptime_table MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag); SystemDictionaryShared::check_excluded_classes(); + SystemDictionaryShared::cleanup_lambda_proxy_class_dictionary(); // save dumptime tables SystemDictionaryShared::clone_dumptime_tables(); diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index 17e27a5372f..5dd296410c7 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -521,6 +521,7 @@ void VM_PopulateDumpSharedSpace::doit() { // Block concurrent class unloading from changing the _dumptime_table MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag); SystemDictionaryShared::check_excluded_classes(); + SystemDictionaryShared::cleanup_lambda_proxy_class_dictionary(); StaticArchiveBuilder builder; builder.gather_source_objs(); diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index 809deb8617f..48f8147b6ee 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -1598,6 +1598,28 @@ void SystemDictionaryShared::restore_dumptime_tables() { _cloned_dumptime_lambda_proxy_class_dictionary = NULL; } +class CleanupDumpTimeLambdaProxyClassTable: StackObj { + public: + bool do_entry(LambdaProxyClassKey& key, DumpTimeLambdaProxyClassInfo& info) { + assert_lock_strong(DumpTimeTable_lock); + for (int i = 0; i < info._proxy_klasses->length(); i++) { + InstanceKlass* ik = info._proxy_klasses->at(i); + if (!ik->can_be_verified_at_dumptime()) { + info._proxy_klasses->remove_at(i); + } + } + return info._proxy_klasses->length() == 0 ? true /* delete the node*/ : false; + } +}; + +void SystemDictionaryShared::cleanup_lambda_proxy_class_dictionary() { + assert_lock_strong(DumpTimeTable_lock); + if (_dumptime_lambda_proxy_class_dictionary != NULL) { + CleanupDumpTimeLambdaProxyClassTable cleanup_proxy_classes; + _dumptime_lambda_proxy_class_dictionary->unlink(&cleanup_proxy_classes); + } +} + #if INCLUDE_CDS_JAVA_HEAP class ArchivedMirrorPatcher { diff --git a/src/hotspot/share/classfile/systemDictionaryShared.hpp b/src/hotspot/share/classfile/systemDictionaryShared.hpp index e876c00dda6..039b9d01e9a 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.hpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp @@ -288,6 +288,7 @@ public: static size_t estimate_size_for_archive(); static void write_to_archive(bool is_static_archive = true); static void adjust_lambda_proxy_class_dictionary(); + static void cleanup_lambda_proxy_class_dictionary(); static void serialize_dictionary_headers(class SerializeClosure* soc, bool is_static_archive = true); static void serialize_vm_classes(class SerializeClosure* soc); diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index d0b34218f6b..35100f530ce 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -355,6 +355,7 @@ hotspot_appcds_dynamic = \ -runtime/cds/appcds/DumpClassList.java \ -runtime/cds/appcds/DumpClassListWithLF.java \ -runtime/cds/appcds/ExtraSymbols.java \ + -runtime/cds/appcds/LambdaContainsOldInf.java \ -runtime/cds/appcds/LambdaEagerInit.java \ -runtime/cds/appcds/LambdaProxyClasslist.java \ -runtime/cds/appcds/LambdaVerificationFailedDuringDump.java \ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java b/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java new file mode 100644 index 00000000000..a2c85542244 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021, 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 8274944 + * @summary VM should not crash during CDS dump when a lambda proxy class + * contains an old version of interface. + * @requires vm.cds + * @library /test/lib + * @compile test-classes/OldProvider.jasm + * @compile test-classes/LambdaContainsOldInfApp.java + * @run driver LambdaContainsOldInf + */ + +import jdk.test.lib.cds.CDSOptions; +import jdk.test.lib.cds.CDSTestUtils; +import jdk.test.lib.process.OutputAnalyzer; + +public class LambdaContainsOldInf { + + public static void main(String[] args) throws Exception { + String mainClass = "LambdaContainsOldInfApp"; + String namePrefix = "lambdacontainsoldinf"; + JarBuilder.build(namePrefix, mainClass, "OldProvider"); + + String appJar = TestCommon.getTestJar(namePrefix + ".jar"); + String classList = namePrefix + ".list"; + String archiveName = namePrefix + ".jsa"; + + // dump class list + CDSTestUtils.dumpClassList(classList, "-cp", appJar, mainClass); + + // create archive with the class list + CDSOptions opts = (new CDSOptions()) + .addPrefix("-XX:ExtraSharedClassListFile=" + classList, + "-cp", appJar, + "-Xlog:class+load,cds") + .setArchiveName(archiveName); + OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts); + TestCommon.checkExecReturn(output, 0, true, + "Skipping OldProvider: Old class has been linked"); + output.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked"); + + // run with archive + CDSOptions runOpts = (new CDSOptions()) + .addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug") + .setArchiveName(archiveName) + .setUseVersion(false) + .addSuffix(mainClass); + output = CDSTestUtils.runWithArchive(runOpts); + TestCommon.checkExecReturn(output, 0, true, + "[class,load] LambdaContainsOldInfApp source: shared objects file"); + output.shouldMatch(".class.load. OldProvider.source:.*lambdacontainsoldinf.jar") + .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf"); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java new file mode 100644 index 00000000000..6c3fd9b73f1 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021, 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 8274944 + * @summary VM should not crash during CDS dump when a lambda proxy class + * contains an old version of interface. + * @requires vm.cds + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * /test/hotspot/jtreg/runtime/cds/appcds/test-classes + * /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes + * @build LambdaContainsOldInfApp sun.hotspot.WhiteBox OldProvider LambdaVerification + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar lambda_contains_old_inf.jar LambdaVerification + * LambdaContainsOldInfApp OldProvider + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LambdaContainsOldInf + */ + +import jdk.test.lib.helpers.ClassFileInstaller; + +public class LambdaContainsOldInf extends DynamicArchiveTestBase { + public static void main(String[] args) throws Exception { + runTest(LambdaContainsOldInf::test); + } + + static void test() throws Exception { + String topArchiveName = getNewArchiveName(); + String appJar = ClassFileInstaller.getJarPath("lambda_contains_old_inf.jar"); + String mainClass = "LambdaContainsOldInfApp"; + String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar"); + String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar; + + dump(topArchiveName, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "-Xlog:class+load=debug,cds=debug,cds+dynamic=info", + use_whitebox_jar, + "-cp", appJar, mainClass) + .assertNormalExit(output -> { + output.shouldContain("Skipping OldProvider: Old class has been linked") + .shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked") + .shouldHaveExitValue(0); + }); + + run(topArchiveName, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + use_whitebox_jar, + "-Xlog:class+load=debug", + "-cp", appJar, mainClass) + .assertNormalExit(output -> { + output.shouldContain("[class,load] LambdaContainsOldInfApp source: shared objects file (top)") + .shouldMatch(".class.load. OldProvider.source:.*lambda_contains_old_inf.jar") + .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf") + .shouldHaveExitValue(0); + }); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java new file mode 100644 index 00000000000..81b9cdba49b --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021, 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. + * + */ +public class LambdaContainsOldInfApp { + public static void main(final String... args) { + getProvider(); + } + + public static OldProvider getProvider() { + return () -> { + return null; + }; + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/OldProvider.jasm b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/OldProvider.jasm new file mode 100644 index 00000000000..3d03a2cbc2e --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/OldProvider.jasm @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021, 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. + * + */ +public interface OldProvider + version 49:0 +{ + public abstract Method get:"()Ljava/lang/Object;"; + +} // end Class OldProvider -- GitLab From 19f76c215dbe9528dde10acd744be54618ea5e4c Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 26 Oct 2021 16:40:55 +0000 Subject: [PATCH 076/890] 8275079: Remove unnecessary conversion to String in java.net.http Reviewed-by: dfuchs --- .../jdk/internal/net/http/AuthenticationFilter.java | 4 ++-- .../jdk/internal/net/http/Http1AsyncReceiver.java | 12 +++++------- .../classes/jdk/internal/net/http/Http1Request.java | 4 ++-- .../classes/jdk/internal/net/http/Http1Response.java | 6 +++--- .../jdk/internal/net/http/Http2Connection.java | 2 +- .../jdk/internal/net/http/HttpRequestImpl.java | 3 +-- .../classes/jdk/internal/net/http/common/Demand.java | 4 ++-- .../internal/net/http/common/SSLFlowDelegate.java | 4 ++-- .../internal/net/http/common/SubscriberWrapper.java | 12 ++++++------ .../classes/jdk/internal/net/http/common/Utils.java | 2 +- .../jdk/internal/net/http/frame/ErrorFrame.java | 4 ++-- .../jdk/internal/net/http/frame/Http2Frame.java | 4 ++-- .../jdk/internal/net/http/frame/SettingsFrame.java | 4 ++-- 13 files changed, 31 insertions(+), 34 deletions(-) diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/AuthenticationFilter.java b/src/java.net.http/share/classes/jdk/internal/net/http/AuthenticationFilter.java index 6b112a65cbb..2561afd645d 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/AuthenticationFilter.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/AuthenticationFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -323,7 +323,7 @@ class AuthenticationFilter implements HeaderFilter { return req; } else if (au.retries > retry_limit) { throw new IOException("too many authentication attempts. Limit: " + - Integer.toString(retry_limit)); + retry_limit); } else { // we sent credentials, but they were rejected if (au.fromcache) { diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java index 115077da0d2..75cf84c53cd 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java @@ -116,7 +116,7 @@ class Http1AsyncReceiver { public AbstractSubscription subscription(); /** - * Called to make sure resources are released when the + * Called to make sure resources are released * when the Http1AsyncReceiver is stopped. * @param error The Http1AsyncReceiver pending error ref, * if any. @@ -478,7 +478,7 @@ class Http1AsyncReceiver { // the pool. if (retry && (ex instanceof IOException)) { // could be either EOFException, or - // IOException("connection reset by peer), or + // IOException("connection reset by peer"), or // SSLHandshakeException resulting from the server having // closed the SSL session. if (received.get() == 0) { @@ -709,7 +709,7 @@ class Http1AsyncReceiver { for (ByteBuffer b : lbb) { if (!sbb.remove(b)) { msg.append(sep) - .append(String.valueOf(b)) + .append(b) .append("[remaining=") .append(b.remaining()) .append(", position=") @@ -727,14 +727,12 @@ class Http1AsyncReceiver { String dbgString() { String tag = dbgTag; if (tag == null) { - String flowTag = null; Http1Exchange exchg = owner; Object flow = (exchg != null) ? exchg.connection().getConnectionFlow() : null; - flowTag = tag = flow == null ? null: (String.valueOf(flow)); - if (flowTag != null) { - dbgTag = tag = "Http1AsyncReceiver("+ flowTag + ")"; + if (flow != null) { + dbgTag = tag = "Http1AsyncReceiver(" + flow + ")"; } else { tag = "Http1AsyncReceiver(?)"; } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java index 5d657ec291e..c55a3790a11 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -236,7 +236,7 @@ class Http1Request { if (defaultPort) { return host; } else { - return host + ":" + Integer.toString(port); + return host + ":" + port; } } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java index 8090568c4e4..d5bd85a13a6 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -114,7 +114,7 @@ class Http1Response { } // The ClientRefCountTracker is used to track the state - // of a pending operation. Altough there usually is a single + // of a pending operation. Although there usually is a single // point where the operation starts, it may terminate at // different places. private final class ClientRefCountTracker { @@ -828,7 +828,7 @@ class Http1Response { @Override public String toString() { - return super.toString() + "/parser=" + String.valueOf(parser); + return super.toString() + "/parser=" + parser; } } } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java index 59c88e9f099..7bcf9d8b067 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java @@ -1008,7 +1008,7 @@ class Http2Connection { throws IOException { shutdown(new IOException( - String.valueOf(connection.channel().getLocalAddress()) + connection.channel().getLocalAddress() +": GOAWAY received")); } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestImpl.java b/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestImpl.java index d2b908dffa5..a04ded70480 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestImpl.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestImpl.java @@ -44,7 +44,6 @@ import java.net.http.HttpRequest; import jdk.internal.net.http.common.HttpHeadersBuilder; import jdk.internal.net.http.common.Utils; -import jdk.internal.net.http.websocket.OpeningHandshake; import jdk.internal.net.http.websocket.WebSocketRequest; import static jdk.internal.net.http.common.Utils.ALLOWED_HEADERS; @@ -216,7 +215,7 @@ public class HttpRequestImpl extends HttpRequest implements WebSocketRequest { this.systemHeadersBuilder.map().putAll(headers.systemHeaders().map()); this.userHeaders = headers.userHeaders(); this.uri = URI.create("socket://" + authority.getHostString() + ":" - + Integer.toString(authority.getPort()) + "/"); + + authority.getPort() + "/"); this.proxy = null; this.requestPublisher = null; this.authority = authority; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/Demand.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/Demand.java index 842b57588e7..2e9575d2885 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/Demand.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/Demand.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -47,7 +47,7 @@ public final class Demand { */ public boolean increase(long n) { if (n <= 0) { - throw new IllegalArgumentException("non-positive subscription request: " + String.valueOf(n)); + throw new IllegalArgumentException("non-positive subscription request: " + n); } long prev = val.getAndAccumulate(n, (p, i) -> p + i < 0 ? Long.MAX_VALUE : p + i); return prev == 0; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java index 3f3e4ff339a..cd248b46fb7 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java @@ -938,7 +938,7 @@ public class SSLFlowDelegate { @Override public String toString() { return "WRITER: " + super.toString() - + ", writeList size: " + Integer.toString(writeList.size()) + + ", writeList size: " + writeList.size() + ", scheduler: " + (scheduler.isStopped() ? "stopped" : "running") + ", status: " + lastWrappedStatus; //" writeList: " + writeList.toString(); @@ -1113,7 +1113,7 @@ public class SSLFlowDelegate { exec.execute(() -> { try { List nextTasks = tasks; - if (debug.on()) debug.log("#tasks to execute: " + Integer.toString(nextTasks.size())); + if (debug.on()) debug.log("#tasks to execute: " + nextTasks.size()); do { nextTasks.forEach(Runnable::run); if (engine.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java index 7c7772cc085..1dec768d004 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java @@ -490,13 +490,13 @@ public abstract class SubscriberWrapper public String toString() { StringBuilder sb = new StringBuilder(); sb.append("SubscriberWrapper:") - .append(" upstreamCompleted: ").append(Boolean.toString(upstreamCompleted)) - .append(" upstreamWindow: ").append(upstreamWindow.toString()) - .append(" downstreamCompleted: ").append(Boolean.toString(downstreamCompleted)) - .append(" completionAcknowledged: ").append(Boolean.toString(completionAcknowledged)) - .append(" outputQ size: ").append(Integer.toString(outputQ.size())) + .append(" upstreamCompleted: ").append(upstreamCompleted) + .append(" upstreamWindow: ").append(upstreamWindow) + .append(" downstreamCompleted: ").append(downstreamCompleted) + .append(" completionAcknowledged: ").append(completionAcknowledged) + .append(" outputQ size: ").append(outputQ.size()) //.append(" outputQ: ").append(outputQ.toString()) - .append(" cf: ").append(cf.toString()) + .append(" cf: ").append(cf) .append(" downstreamSubscription: ").append(downstreamSubscription) .append(" downstreamSubscriber: ").append(downstreamSubscriber); diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java index 7597647684f..cdeca6d0ad9 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java @@ -873,7 +873,7 @@ public final class Utils { if (defaultPort) { return host; } else { - return host + ":" + Integer.toString(port); + return host + ":" + port; } } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/frame/ErrorFrame.java b/src/java.net.http/share/classes/jdk/internal/net/http/frame/ErrorFrame.java index 2d25193c118..bf281368a98 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/frame/ErrorFrame.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/frame/ErrorFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -67,7 +67,7 @@ public abstract class ErrorFrame extends Http2Frame { } if (code > LAST_ERROR) { - return "Error: " + Integer.toString(code); + return "Error: " + code; } else { return errorStrings[code]; } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/frame/Http2Frame.java b/src/java.net.http/share/classes/jdk/internal/net/http/frame/Http2Frame.java index 36fc0c8dffd..f837645696f 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/frame/Http2Frame.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/frame/Http2Frame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -101,7 +101,7 @@ public abstract class Http2Frame { StringBuilder sb = new StringBuilder(); sb.append(typeAsString()) .append(": length=") - .append(Integer.toString(length())) + .append(length()) .append(", streamid=") .append(streamid) .append(", flags="); diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java b/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java index ca68eae8cf6..8a011959417 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -55,7 +55,7 @@ public class SettingsFrame extends Http2Frame { if (parameters[i] != -1) { sb.append(name(i)) .append("=") - .append(Integer.toString(parameters[i])) + .append(parameters[i]) .append(' '); } } -- GitLab From f1f5e2690cb93c07eb8be96a4cbfbf140e8a15e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Van=C4=9Bk?= Date: Tue, 26 Oct 2021 16:54:55 +0000 Subject: [PATCH 077/890] 8275872: Sync J2DBench run and analyze Makefile targets with build.xml Reviewed-by: ihse, andrew --- src/demo/share/java2d/J2DBench/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/demo/share/java2d/J2DBench/Makefile b/src/demo/share/java2d/J2DBench/Makefile index 16cbe5cd86e..04b0818a2c3 100644 --- a/src/demo/share/java2d/J2DBench/Makefile +++ b/src/demo/share/java2d/J2DBench/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -80,10 +80,10 @@ SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files all: mkdirs J2DBench.jar J2DAnalyzer.jar run: mkdirs J2DBench.jar - java -jar J2DBench.jar + java -jar $(DIST)/J2DBench.jar analyze: mkdirs J2DAnalyzer.jar - java -jar J2DAnalyzer.jar + java -jar $(DIST)/J2DAnalyzer.jar J2DBench.jar: \ $(J2DBENCH_CLASSES) $(J2DBENCH_RESOURCES) \ -- GitLab From 2448b3f5f96ec4d9ea8fe9dae32a0aab725fb4ad Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Tue, 26 Oct 2021 18:50:21 +0000 Subject: [PATCH 078/890] 8275874: [JVMCI] only support aligned reads in c2v_readFieldValue Reviewed-by: never, shade --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 42 +++++++------------ .../src/jdk/vm/ci/hotspot/CompilerToVM.java | 8 +++- .../jdk/vm/ci/meta/MemoryAccessProvider.java | 2 +- .../test/MemoryAccessProviderData.java | 7 ++++ .../test/MemoryAccessProviderTest.java | 5 +++ 5 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 8a89e5c182f..435d456e261 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -1891,19 +1891,6 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredMethods, (JNIEnv* env, jobject, jobjec return JVMCIENV->get_jobjectArray(methods); C2V_END -// Enforces volatile semantics for a non-volatile read. -class VolatileRead : public StackObj { - public: - VolatileRead() { - // Ensures a possibly volatile read is not reordered with a prior - // volatile write. - OrderAccess::storeload(); - } - ~VolatileRead() { - OrderAccess::acquire(); - } -}; - C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, jobject expected_type, long displacement, jobject kind_object)) if (object == NULL || kind_object == NULL) { JVMCI_THROW_0(NullPointerException); @@ -1944,13 +1931,18 @@ C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, ShouldNotReachHere(); } - if (displacement < 0 || ((long) displacement + type2aelembytes(basic_type) > HeapWordSize * obj->size())) { + int basic_type_elemsize = type2aelembytes(basic_type); + if (displacement < 0 || ((long) displacement + basic_type_elemsize > HeapWordSize * obj->size())) { // Reading outside of the object bounds JVMCI_THROW_MSG_NULL(IllegalArgumentException, "reading outside object bounds"); } // Perform basic sanity checks on the read. Primitive reads are permitted to read outside the // bounds of their fields but object reads must map exactly onto the underlying oop slot. + bool aligned = (displacement % basic_type_elemsize) == 0; + if (!aligned) { + JVMCI_THROW_MSG_NULL(IllegalArgumentException, "read is unaligned"); + } if (basic_type == T_OBJECT) { if (obj->is_objArray()) { if (displacement < arrayOopDesc::base_offset_in_bytes(T_OBJECT)) { @@ -1991,22 +1983,17 @@ C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, // Treat all reads as volatile for simplicity as this function can be used // both for reading Java fields declared as volatile as well as for constant - // folding Unsafe.get* methods with volatile semantics. This is done by - // performing the volatile barrier operations around a call to an - // oopDesc::_field method. The oopDesc::_field_acquire method - // cannot be used since it does not support unaligned reads on all platforms - // (e.g., an unaligned ldar on AArch64 causes a SIGBUS). - + // folding Unsafe.get* methods with volatile semantics. switch (basic_type) { - case T_BOOLEAN: { VolatileRead vr; value = obj->bool_field(displacement); } break; - case T_BYTE: { VolatileRead vr; value = obj->byte_field(displacement); } break; - case T_SHORT: { VolatileRead vr; value = obj->short_field(displacement);} break; - case T_CHAR: { VolatileRead vr; value = obj->char_field(displacement); } break; + case T_BOOLEAN: value = obj->bool_field_acquire(displacement); break; + case T_BYTE: value = obj->byte_field_acquire(displacement); break; + case T_SHORT: value = obj->short_field_acquire(displacement); break; + case T_CHAR: value = obj->char_field_acquire(displacement); break; case T_FLOAT: - case T_INT: { VolatileRead vr; value = obj->int_field(displacement); } break; + case T_INT: value = obj->int_field_acquire(displacement); break; case T_DOUBLE: - case T_LONG: { VolatileRead vr; value = obj->long_field(displacement); } break; + case T_LONG: value = obj->long_field_acquire(displacement); break; case T_OBJECT: { if (displacement == java_lang_Class::component_mirror_offset() && java_lang_Class::is_instance(obj()) && @@ -2016,8 +2003,7 @@ C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, return JVMCIENV->get_jobject(JVMCIENV->get_JavaConstant_NULL_POINTER()); } - oop value; - { VolatileRead vr; value = obj->obj_field(displacement); } + oop value = obj->obj_field_acquire(displacement); if (value == NULL) { return JVMCIENV->get_jobject(JVMCIENV->get_JavaConstant_NULL_POINTER()); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index 032d21ca235..50f35021ac8 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -783,15 +783,19 @@ final class CompilerToVM { /** * Reads the current value of a static field. If {@code expectedType} is non-null, then the - * object is exptected to be a subtype of {@code expectedType} and extra sanity checking is + * object is expected to be a subtype of {@code expectedType} and extra sanity checking is * performed on the offset and kind of the read being performed. + * + * @throws IllegalArgumentException if any of the sanity checks fail */ native JavaConstant readFieldValue(HotSpotResolvedObjectTypeImpl object, HotSpotResolvedObjectTypeImpl expectedType, long offset, JavaKind kind); /** * Reads the current value of an instance field. If {@code expectedType} is non-null, then the - * object is exptected to be a subtype of {@code expectedType} and extra sanity checking is + * object is expected to be a subtype of {@code expectedType} and extra sanity checking is * performed on the offset and kind of the read being performed. + * + * @throws IllegalArgumentException if any of the sanity checks fail */ native JavaConstant readFieldValue(HotSpotObjectConstantImpl object, HotSpotResolvedObjectTypeImpl expectedType, long offset, JavaKind kind); diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java index 9eba9d0f8ac..30c4273a97e 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java @@ -37,7 +37,7 @@ public interface MemoryAccessProvider { * @return the read value encapsulated in a {@link JavaConstant} object of {@link JavaKind} kind * @throws IllegalArgumentException if the read is out of bounds of the object or {@code kind} * is {@link JavaKind#Void} or not {@linkplain JavaKind#isPrimitive() primitive} - * kind or {@code bits} is not 8, 16, 32 or 64 + * kind or {@code bits} is not 8, 16, 32 or 64, or the read is unaligned */ JavaConstant readPrimitiveConstant(JavaKind kind, Constant base, long displacement, int bits) throws IllegalArgumentException; diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java index 86994171407..2f01ed8646e 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java @@ -77,6 +77,13 @@ public class MemoryAccessProviderData { for (KindData k : PRIMITIVE_KIND_DATA) { result.add(new Object[] {k.kind, TEST_CONSTANT, k.instanceFieldOffset, k.instanceFieldValue, Math.max(8, k.kind.getBitCount())}); result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, k.staticFieldOffset, k.staticFieldValue, Math.max(8, k.kind.getBitCount())}); + } + return result.toArray(new Object[result.size()][]); + } + @DataProvider(name = "unalignedPrimitive") + public static Object[][] getUnalignedPrimitiveJavaKinds() { + List result = new ArrayList<>(); + for (KindData k : PRIMITIVE_KIND_DATA) { if (k.unalignedInstanceFieldValue != null) { result.add(new Object[] {k.kind, TEST_CONSTANT, k.instanceFieldOffset - 1, k.unalignedInstanceFieldValue, Math.max(8, k.kind.getBitCount())}); } diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java index 07001534bf7..64cf8e41127 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java @@ -64,6 +64,11 @@ public class MemoryAccessProviderTest { Assert.assertNull(PROVIDER.readPrimitiveConstant(kind, null, offset, bitsCount), "Unexpected value for null base"); } + @Test(dataProvider = "unalignedPrimitive", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class}) + public void testReadUnalignedConstantConstant(JavaKind kind, Constant base, Long offset, Object expected, int bitsCount) { + PROVIDER.readPrimitiveConstant(kind, null, offset, bitsCount); + } + @Test(dataProvider = "negative", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class}) public void testNegativeReadPrimitiveConstant(JavaKind kind, Constant base) { PROVIDER.readPrimitiveConstant(kind, base, 0L, kind == null ? 0 : kind.getByteCount() / 8); -- GitLab From 7addcd7cfb73652841c65c54e84b6ebffcbd664e Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 26 Oct 2021 22:03:18 +0000 Subject: [PATCH 079/890] 8276034: ProblemList gtest dll_address_to_function_and_library_name on macosx-x64 Reviewed-by: prr --- test/hotspot/gtest/runtime/test_os.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index 3cf5d1c374b..146c8d3daa0 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -709,7 +709,11 @@ TEST_VM(os, pagesizes_test_print) { ASSERT_EQ(strcmp(expected, buffer), 0); } -TEST_VM(os, dll_address_to_function_and_library_name) { +#if defined(__APPLE__) && !defined(AARCH64) // See JDK-8273967. + TEST_VM(os, DISABLED_dll_address_to_function_and_library_name) { +#else + TEST_VM(os, dll_address_to_function_and_library_name) { +#endif char tmp[1024]; char output[1024]; stringStream st(output, sizeof(output)); -- GitLab From b0d1e4ff4d3806851fe998717822e8e52987357c Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Wed, 27 Oct 2021 01:21:12 +0000 Subject: [PATCH 080/890] 8273585: String.charAt performance degrades due to JDK-8268698 Reviewed-by: roland, kvn --- src/hotspot/share/opto/loopnode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index d147264a96c..f77ddeea4ba 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -3416,7 +3416,7 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) { // Look for induction variables of the form: X += constant if (phi2->region() != loop->_head || incr2->req() != 3 || - incr2->in(1) != phi2 || + incr2->in(1)->uncast() != phi2 || incr2 == incr || incr2->Opcode() != Op_AddI || !incr2->in(2)->is_Con()) -- GitLab From d98b7c25910d38ac644838f59cb41ecd131c87a9 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Wed, 27 Oct 2021 01:58:11 +0000 Subject: [PATCH 081/890] 8202926: Test java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.html fails Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 0e074a7934e..60a86a819b4 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -473,7 +473,6 @@ java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all java/awt/JAWT/JAWT.sh 8197798 windows-all,linux-all java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all java/awt/Robot/RobotWheelTest/RobotWheelTest.java 8129827 generic-all -java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8202926 linux-all java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java 8202882 linux-all -- GitLab From 9f75d5ce500886b32175cc541939b7f0eee190ca Mon Sep 17 00:00:00 2001 From: Wang Huang Date: Wed, 27 Oct 2021 05:32:50 +0000 Subject: [PATCH 082/890] 8259948: Aarch64: Add cast nodes for Aarch64 Neon backend Co-authored-by: Wang Huang Co-authored-by: Wu Yan Co-authored-by: Miao Zhuojun Reviewed-by: aph, eliu, njian --- src/hotspot/cpu/aarch64/aarch64.ad | 20 -- src/hotspot/cpu/aarch64/aarch64_neon.ad | 286 +++++++++++++----- src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 | 222 +++++++++----- src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 11 + test/hotspot/gtest/aarch64/aarch64-asmtest.py | 5 +- test/hotspot/gtest/aarch64/asmtest.out.h | 190 ++++++------ 6 files changed, 471 insertions(+), 263 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 52d624a2de6..8e155b926af 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2401,9 +2401,6 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType // Special cases switch (opcode) { case Op_VectorMaskCmp: - // We don't have VectorReinterpret with bit_size less than 64 support for - // now, even for byte type. To be refined with fully VectorCast support. - case Op_VectorReinterpret: if (vlen < 2 || bit_size < 64) { return false; } @@ -2421,23 +2418,6 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return false; } break; - // Some types of VectorCast are not implemented for now. - case Op_VectorCastI2X: - if (bt == T_BYTE) { - return false; - } - break; - case Op_VectorCastS2X: - if (vlen < 4 || bit_size < 64) { - return false; - } - break; - case Op_VectorCastF2X: - case Op_VectorCastD2X: - if (bt == T_INT || bt == T_SHORT || bt == T_BYTE || bt == T_LONG) { - return false; - } - break; case Op_LoadVectorGather: case Op_StoreVectorScatter: return false; diff --git a/src/hotspot/cpu/aarch64/aarch64_neon.ad b/src/hotspot/cpu/aarch64/aarch64_neon.ad index bb617aeb379..0b59686238a 100644 --- a/src/hotspot/cpu/aarch64/aarch64_neon.ad +++ b/src/hotspot/cpu/aarch64/aarch64_neon.ad @@ -150,16 +150,12 @@ instruct reinterpretD2X(vecX dst, vecD src) n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 8); match(Set dst (VectorReinterpret src)); ins_cost(INSN_COST); - format %{ " # reinterpret $dst,$src\t# D2X" %} + format %{ " # reinterpret $dst,$src\t# D to X" %} ins_encode %{ - // If registers are the same, no register move is required - the - // upper 64 bits of 'src' are expected to have been initialized - // to zero. - if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { - __ orr(as_FloatRegister($dst$$reg), __ T8B, - as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); - } + // The higher 64-bits of the "dst" register must be cleared to zero. + __ orr(as_FloatRegister($dst$$reg), __ T8B, + as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); %} ins_pipe(vlogical64); %} @@ -170,10 +166,9 @@ instruct reinterpretX2D(vecD dst, vecX src) n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 16); match(Set dst (VectorReinterpret src)); ins_cost(INSN_COST); - format %{ " # reinterpret $dst,$src\t# X2D" %} + format %{ " # reinterpret $dst,$src\t# X to D" %} ins_encode %{ - // Resize the vector from 128-bits to 64-bits. The higher 64-bits of - // the "dst" register must be cleared to zero. + // The higher 64-bits of the "dst" register must be cleared to zero. __ orr(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); @@ -181,19 +176,64 @@ instruct reinterpretX2D(vecD dst, vecX src) ins_pipe(vlogical64); %} -// ------------------------------ Vector cast ------------------------------- +instruct reinterpretS2X(vecX dst, vecD src) +%{ + predicate(n->bottom_type()->is_vect()->length_in_bytes() == 16 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 4); + match(Set dst (VectorReinterpret src)); + ins_cost(INSN_COST); + format %{ " # reinterpret $dst,$src\t# S to X" %} + ins_encode %{ + // The higher bits of the "dst" register must be cleared to zero. + __ dup(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_slow); +%} -instruct vcvt4Bto4S(vecD dst, vecD src) +instruct reinterpretX2S(vecD dst, vecX src) %{ - predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorCastB2X src)); - format %{ "sxtl $dst, T8H, $src, T8B\t# convert 4B to 4S vector" %} + predicate(n->bottom_type()->is_vect()->length_in_bytes() == 4 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 16); + match(Set dst (VectorReinterpret src)); + ins_cost(INSN_COST); + format %{ " # reinterpret $dst,$src\t# X to S" %} ins_encode %{ - __ sxtl(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), __ T8B); + // The higher bits of the "dst" register must be cleared to zero. + __ dup(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(pipe_slow); +%} + +instruct reinterpretS2D(vecD dst, vecD src) +%{ + predicate(n->bottom_type()->is_vect()->length_in_bytes() == 8 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 4); + match(Set dst (VectorReinterpret src)); + ins_cost(INSN_COST); + format %{ " # reinterpret $dst,$src\t# S to D" %} + ins_encode %{ + // The higher bits of the "dst" register must be cleared to zero. + __ dup(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reinterpretD2S(vecD dst, vecD src) +%{ + predicate(n->bottom_type()->is_vect()->length_in_bytes() == 4 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 8); + match(Set dst (VectorReinterpret src)); + ins_cost(INSN_COST); + format %{ " # reinterpret $dst,$src\t# D to S" %} + ins_encode %{ + // The higher bits of the "dst" register must be cleared to zero. + __ dup(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_slow); %} +// ------------------------------ Vector cast ------------------------------- + instruct vcvt8Bto8S(vecX dst, vecD src) %{ predicate(n->as_Vector()->length() == 8 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); @@ -205,13 +245,13 @@ instruct vcvt8Bto8S(vecX dst, vecD src) ins_pipe(pipe_class_default); %} -instruct vcvt4Sto4B(vecD dst, vecD src) +instruct vcvt4Bto4S(vecD dst, vecD src) %{ - predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); - match(Set dst (VectorCastS2X src)); - format %{ "xtn $dst, T8B, $src, T8H\t# convert 4S to 4B vector" %} + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + match(Set dst (VectorCastB2X src)); + format %{ "sxtl $dst, T8H, $src, T8B\t# convert 4B to 4S vector" %} ins_encode %{ - __ xtn(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), __ T8H); + __ sxtl(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), __ T8B); %} ins_pipe(pipe_class_default); %} @@ -227,6 +267,17 @@ instruct vcvt8Sto8B(vecD dst, vecX src) ins_pipe(pipe_class_default); %} +instruct vcvt4Sto4B(vecD dst, vecD src) +%{ + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + match(Set dst (VectorCastS2X src)); + format %{ "xtn $dst, T8B, $src, T8H\t# convert 4S to 4B vector" %} + ins_encode %{ + __ xtn(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), __ T8H); + %} + ins_pipe(pipe_class_default); +%} + instruct vcvt4Sto4I(vecX dst, vecD src) %{ predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); @@ -271,6 +322,20 @@ instruct vcvt2Lto2I(vecD dst, vecX src) ins_pipe(pipe_class_default); %} +instruct vcvt4Ito4B(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + match(Set dst (VectorCastI2X src)); + format %{ "xtn $dst, T4H, $src, T4S\n\t" + "xtn $dst, T8B, $dst, T8H\t# convert 4I to 4B vector" + %} + ins_encode %{ + __ xtn(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($src$$reg), __ T4S); + __ xtn(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($dst$$reg), __ T8H); + %} + ins_pipe(pipe_class_default); +%} + instruct vcvt4Bto4I(vecX dst, vecD src) %{ predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); @@ -282,37 +347,54 @@ instruct vcvt4Bto4I(vecX dst, vecD src) __ sxtl(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), __ T8B); __ sxtl(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($dst$$reg), __ T4H); %} - ins_pipe(pipe_slow); + ins_pipe(pipe_class_default); %} -instruct vcvt4Ito4B(vecD dst, vecX src) +instruct vcvt2Lto2F(vecD dst, vecX src) %{ - predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); - match(Set dst (VectorCastI2X src)); - format %{ "xtn $dst, T4H, $src, T4S\n\t" - "xtn $dst, T8B, $dst, T8H\t# convert 4I to 4B vector" + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + match(Set dst (VectorCastL2X src)); + format %{ "scvtfv T2D, $dst, $src\n\t" + "fcvtn $dst, T2S, $dst, T2D\t# convert 2L to 2F vector" %} ins_encode %{ - __ xtn(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($src$$reg), __ T4S); - __ xtn(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($dst$$reg), __ T8H); + __ scvtfv(__ T2D, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + __ fcvtn(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($dst$$reg), __ T2D); %} ins_pipe(pipe_slow); %} -instruct vcvt4Bto4F(vecX dst, vecD src) +instruct vcvt2Ito2F(vecD dst, vecD src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + match(Set dst (VectorCastI2X src)); + format %{ "scvtfv T2S, $dst, $src\t# convert 2I to 2F vector" %} + ins_encode %{ + __ scvtfv(__ T2S, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vcvt4Ito4F(vecX dst, vecX src) %{ predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); - match(Set dst (VectorCastB2X src)); - format %{ "sxtl $dst, T8H, $src, T8B\n\t" - "sxtl $dst, T4S, $dst, T4H\n\t" - "scvtfv T4S, $dst, $dst\t# convert 4B to 4F vector" + match(Set dst (VectorCastI2X src)); + format %{ "scvtfv T4S, $dst, $src\t# convert 4I to 4F vector" %} + ins_encode %{ + __ scvtfv(__ T4S, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); %} + ins_pipe(pipe_class_default); +%} + +instruct vcvt2Lto2D(vecX dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); + match(Set dst (VectorCastL2X src)); + format %{ "scvtfv T2D, $dst, $src\t# convert 2L to 2D vector" %} ins_encode %{ - __ sxtl(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), __ T8B); - __ sxtl(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($dst$$reg), __ T4H); - __ scvtfv(__ T4S, as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg)); + __ scvtfv(__ T2D, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_slow); + ins_pipe(pipe_class_default); %} instruct vcvt4Sto4F(vecX dst, vecD src) @@ -343,39 +425,113 @@ instruct vcvt2Ito2D(vecX dst, vecD src) ins_pipe(pipe_slow); %} -instruct vcvt2Ito2F(vecD dst, vecD src) +instruct vcvt4Bto4F(vecX dst, vecD src) %{ - predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); - match(Set dst (VectorCastI2X src)); - format %{ "scvtfv T2S, $dst, $src\t# convert 2I to 2F vector" %} + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + match(Set dst (VectorCastB2X src)); + format %{ "sxtl $dst, T8H, $src, T8B\n\t" + "sxtl $dst, T4S, $dst, T4H\n\t" + "scvtfv T4S, $dst, $dst\t# convert 4B to 4F vector" + %} ins_encode %{ - __ scvtfv(__ T2S, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + __ sxtl(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), __ T8B); + __ sxtl(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($dst$$reg), __ T4H); + __ scvtfv(__ T4S, as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vcvt2Fto2L(vecX dst, vecD src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtl $dst, T2D, $src, T2S\n\t" + "fcvtzs $dst, T2D, $dst\t# convert 2F to 2L vector" + %} + ins_encode %{ + __ fcvtl(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg), __ T2S); + __ fcvtzs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($dst$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vcvt2Fto2I(vecD dst, vecD src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtzs $dst, T2S, $src\t# convert 2F to 2I vector" %} + ins_encode %{ + __ fcvtzs(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} ins_pipe(pipe_class_default); %} -instruct vcvt4Ito4F(vecX dst, vecX src) +instruct vcvt4Fto4I(vecX dst, vecX src) %{ - predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); - match(Set dst (VectorCastI2X src)); - format %{ "scvtfv T4S, $dst, $src\t# convert 4I to 4F vector" %} + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtzs $dst, T4S, $src\t# convert 4F to 4I vector" %} ins_encode %{ - __ scvtfv(__ T4S, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + __ fcvtzs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} ins_pipe(pipe_class_default); %} -instruct vcvt2Lto2D(vecX dst, vecX src) +instruct vcvt2Dto2L(vecX dst, vecX src) %{ - predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); - match(Set dst (VectorCastL2X src)); - format %{ "scvtfv T2D, $dst, $src\t# convert 2L to 2D vector" %} + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (VectorCastD2X src)); + format %{ "fcvtzs $dst, T2D, $src\t# convert 2D to 2L vector" %} ins_encode %{ - __ scvtfv(__ T2D, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + __ fcvtzs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} ins_pipe(pipe_class_default); %} +instruct vcvt4Fto4S(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtzs $dst, T4S, $src\n\t" + "xtn $dst, T4H, $dst, T4S\t# convert 4F to 4S vector" + %} + ins_encode %{ + __ fcvtzs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); + __ xtn(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($dst$$reg), __ T4S); + %} + ins_pipe(pipe_slow); +%} + +instruct vcvt2Dto2I(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); + match(Set dst (VectorCastD2X src)); + format %{ "fcvtzs $dst, T2D, $src\n\t" + "xtn $dst, T2S, $dst, T2D\t# convert 2D to 2I vector" + %} + ins_encode %{ + __ fcvtzs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); + __ xtn(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($dst$$reg), __ T2D); + %} + ins_pipe(pipe_slow); +%} + +instruct vcvt4Fto4B(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtzs $dst, T4S, $src\n\t" + "xtn $dst, T4H, $dst, T4S\n\t" + "xtn $dst, T8B, $dst, T8H\t# convert 4F to 4B vector" + %} + ins_encode %{ + __ fcvtzs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); + __ xtn(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($dst$$reg), __ T4S); + __ xtn(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($dst$$reg), __ T8H); + %} + ins_pipe(pipe_slow); +%} + instruct vcvt2Fto2D(vecX dst, vecD src) %{ predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); @@ -398,20 +554,6 @@ instruct vcvt2Dto2F(vecD dst, vecX src) ins_pipe(pipe_class_default); %} -instruct vcvt2Lto2F(vecD dst, vecX src) -%{ - predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); - match(Set dst (VectorCastL2X src)); - format %{ "scvtfv T2D, $dst, $src\n\t" - "fcvtn $dst, T2S, $dst, T2D\t# convert 2L to 2F vector" - %} - ins_encode %{ - __ scvtfv(__ T2D, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); - __ fcvtn(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($dst$$reg), __ T2D); - %} - ins_pipe(pipe_slow); -%} - // ------------------------------ Reduction ------------------------------- instruct reduce_add8B(iRegINoSp dst, iRegIorL2I isrc, vecD vsrc, vecD tmp) @@ -1887,7 +2029,7 @@ instruct vmul2L(vecX dst, vecX src1, vecX src2, iRegLNoSp tmp1, iRegLNoSp tmp2) "umov $tmp1, $src1, D, 1\n\t" "umov $tmp2, $src2, D, 1\n\t" "mul $tmp2, $tmp2, $tmp1\n\t" - "mov $dst, T2D, 1, $tmp2\t# insert into vector(2L)\n\t" + "mov $dst, T2D, 1, $tmp2\t# insert into vector(2L)" %} ins_encode %{ __ umov($tmp1$$Register, as_FloatRegister($src1$$reg), __ D, 0); @@ -4019,7 +4161,7 @@ instruct vmuladdS2I(vecX dst, vecX src1, vecX src2, vecX tmp) %{ effect(TEMP_DEF dst, TEMP tmp); format %{ "smullv $tmp, $src1, $src2\t# vector (4H)\n\t" "smullv $dst, $src1, $src2\t# vector (8H)\n\t" - "addpv $dst, $tmp, $dst\t# vector (4S)\n\t" %} + "addpv $dst, $tmp, $dst\t# vector (4S)" %} ins_encode %{ __ smullv(as_FloatRegister($tmp$$reg), __ T4H, as_FloatRegister($src1$$reg), diff --git a/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 index a0f980e44cb..4d947b8141c 100644 --- a/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 @@ -95,43 +95,46 @@ dnl $1 $2 REINTERPRET(D, 8) REINTERPRET(X, 16) dnl - -instruct reinterpretD2X(vecX dst, vecD src) +define(`REINTERPRET_DX', ` +instruct reinterpret$1`'2$2`'(vec$2 dst, vec$1 src) %{ - predicate(n->bottom_type()->is_vect()->length_in_bytes() == 16 && - n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 8); + predicate(n->bottom_type()->is_vect()->length_in_bytes() == $3 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == $4); match(Set dst (VectorReinterpret src)); ins_cost(INSN_COST); - format %{ " # reinterpret $dst,$src\t# D2X" %} + format %{ " # reinterpret $dst,$src\t# $1 to $2" %} ins_encode %{ - // If registers are the same, no register move is required - the - // upper 64 bits of 'src' are expected to have been initialized - // to zero. - if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { - __ orr(as_FloatRegister($dst$$reg), __ T8B, - as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); - } + // The higher 64-bits of the "dst" register must be cleared to zero. + __ orr(as_FloatRegister($dst$$reg), __ T8B, + as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); %} ins_pipe(vlogical64); -%} - -instruct reinterpretX2D(vecD dst, vecX src) +%}')dnl +dnl $1 $2 $3 $4 +REINTERPRET_DX(D, X, 16, 8) +REINTERPRET_DX(X, D, 8, 16) +dnl +define(`REINTERPRET_SX', ` +instruct reinterpret$1`'2$2`'(vec$3 dst, vec$4 src) %{ - predicate(n->bottom_type()->is_vect()->length_in_bytes() == 8 && - n->in(1)->bottom_type()->is_vect()->length_in_bytes() == 16); + predicate(n->bottom_type()->is_vect()->length_in_bytes() == $5 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == $6); match(Set dst (VectorReinterpret src)); ins_cost(INSN_COST); - format %{ " # reinterpret $dst,$src\t# X2D" %} + format %{ " # reinterpret $dst,$src\t# $1 to $2" %} ins_encode %{ - // Resize the vector from 128-bits to 64-bits. The higher 64-bits of - // the "dst" register must be cleared to zero. - __ orr(as_FloatRegister($dst$$reg), __ T8B, - as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); + // The higher bits of the "dst" register must be cleared to zero. + __ dup(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); %} - ins_pipe(vlogical64); -%} + ins_pipe(pipe_slow); +%}')dnl +dnl $1 $2 $3 $4 $5 $6 +REINTERPRET_SX(S, X, X, D, 16, 4) +REINTERPRET_SX(X, S, D, X, 4, 16) +REINTERPRET_SX(S, D, D, D, 8, 4) +REINTERPRET_SX(D, S, D, D, 4, 8) +dnl // ------------------------------ Vector cast ------------------------------- dnl @@ -147,39 +150,89 @@ instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$5 src) ins_pipe(pipe_class_default); %}')dnl dnl $1 $2 $3 $4 $5 $6 $7 $8 -VECTOR_CAST_I2I(4, B, S, D, D, sxtl, 8B, 8H) VECTOR_CAST_I2I(8, B, S, X, D, sxtl, 8B, 8H) -VECTOR_CAST_I2I(4, S, B, D, D, xtn, 8H, 8B) +VECTOR_CAST_I2I(4, B, S, D, D, sxtl, 8B, 8H) VECTOR_CAST_I2I(8, S, B, D, X, xtn, 8H, 8B) +VECTOR_CAST_I2I(4, S, B, D, D, xtn, 8H, 8B) VECTOR_CAST_I2I(4, S, I, X, D, sxtl, 4H, 4S) VECTOR_CAST_I2I(4, I, S, D, X, xtn, 4S, 4H) VECTOR_CAST_I2I(2, I, L, X, D, sxtl, 2S, 2D) VECTOR_CAST_I2I(2, L, I, D, X, xtn, 2D, 2S) dnl -define(`VECTOR_CAST_B2I', ` -instruct vcvt4$1to4$2`'(vec$3 dst, vec$4 src) +define(`VECTOR_CAST_I2I_L', ` +instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$5 src) %{ - predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - format %{ "$5 $dst, T$7, $src, T$6\n\t" - "$5 $dst, T$9, $dst, T$8\t# convert 4$1 to 4$2 vector" + predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); + match(Set dst (VectorCast$2`'2X src)); + format %{ "$6 $dst, T$8, $src, T$7\n\t" + "$6 $dst, T$10, $dst, T$9\t# convert $1$2 to $1$3 vector" %} ins_encode %{ - __ $5(as_FloatRegister($dst$$reg), __ T$7, as_FloatRegister($src$$reg), __ T$6); - __ $5(as_FloatRegister($dst$$reg), __ T$9, as_FloatRegister($dst$$reg), __ T$8); + __ $6(as_FloatRegister($dst$$reg), __ T$8, as_FloatRegister($src$$reg), __ T$7); + __ $6(as_FloatRegister($dst$$reg), __ T$10, as_FloatRegister($dst$$reg), __ T$9); + %} + ins_pipe(pipe_class_default); +%}')dnl +dnl $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 +VECTOR_CAST_I2I_L(4, I, B, D, X, xtn, 4S, 4H, 8H, 8B) +VECTOR_CAST_I2I_L(4, B, I, X, D, sxtl, 8B, 8H, 4H, 4S) +dnl + +instruct vcvt2Lto2F(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + match(Set dst (VectorCastL2X src)); + format %{ "scvtfv T2D, $dst, $src\n\t" + "fcvtn $dst, T2S, $dst, T2D\t# convert 2L to 2F vector" + %} + ins_encode %{ + __ scvtfv(__ T2D, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + __ fcvtn(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($dst$$reg), __ T2D); %} ins_pipe(pipe_slow); +%} +dnl +define(`VECTOR_CAST_I2F', ` +instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$4 src) +%{ + predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); + match(Set dst (VectorCast$2`'2X src)); + format %{ "scvtfv T$5, $dst, $src\t# convert $1$2 to $1$3 vector" %} + ins_encode %{ + __ scvtfv(__ T$5, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_class_default); %}')dnl -dnl $1 $2 $3 $4 $5 $6 $7 $8 $9 -VECTOR_CAST_B2I(B, I, X, D, sxtl, 8B, 8H, 4H, 4S) -VECTOR_CAST_B2I(I, B, D, X, xtn, 4S, 4H, 8H, 8B) +dnl $1 $2 $3 $4 $5 +VECTOR_CAST_I2F(2, I, F, D, 2S) +VECTOR_CAST_I2F(4, I, F, X, 4S) +VECTOR_CAST_I2F(2, L, D, X, 2D) +dnl +define(`VECTOR_CAST_I2F_L', ` +instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$5 src) +%{ + predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); + match(Set dst (VectorCast$2`'2X src)); + format %{ "sxtl $dst, T$7, $src, T$6\n\t" + "scvtfv T$7, $dst, $dst\t# convert $1$2 to $1$3 vector" + %} + ins_encode %{ + __ sxtl(as_FloatRegister($dst$$reg), __ T$7, as_FloatRegister($src$$reg), __ T$6); + __ scvtfv(__ T$7, as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl $1 $2 $3 $4 $5 $6 $7 +VECTOR_CAST_I2F_L(4, S, F, X, D, 4H, 4S) +VECTOR_CAST_I2F_L(2, I, D, X, D, 2S, 2D) +dnl instruct vcvt4Bto4F(vecX dst, vecD src) %{ predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); match(Set dst (VectorCastB2X src)); - format %{ "sxtl $dst, T8H, $src, T8B\n\t" - "sxtl $dst, T4S, $dst, T4H\n\t" + format %{ "sxtl $dst, T8H, $src, T8B\n\t" + "sxtl $dst, T4S, $dst, T4H\n\t" "scvtfv T4S, $dst, $dst\t# convert 4B to 4F vector" %} ins_encode %{ @@ -189,40 +242,71 @@ instruct vcvt4Bto4F(vecX dst, vecD src) %} ins_pipe(pipe_slow); %} -dnl -define(`VECTOR_CAST_I2F_L', ` -instruct vcvt$1$2to$1$3`'(vecX dst, vecD src) + +instruct vcvt2Fto2L(vecX dst, vecD src) %{ - predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); - match(Set dst (VectorCast$2`'2X src)); - format %{ "sxtl $dst, T$5, $src, T$4\n\t" - "scvtfv T$5, $dst, $dst\t# convert $1$2 to $1$3 vector" + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtl $dst, T2D, $src, T2S\n\t" + "fcvtzs $dst, T2D, $dst\t# convert 2F to 2L vector" %} ins_encode %{ - __ sxtl(as_FloatRegister($dst$$reg), __ T$5, as_FloatRegister($src$$reg), __ T$4); - __ scvtfv(__ T$5, as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg)); + __ fcvtl(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg), __ T2S); + __ fcvtzs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($dst$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl $1 $2 $3 $4 $5 -VECTOR_CAST_I2F_L(4, S, F, 4H, 4S) -VECTOR_CAST_I2F_L(2, I, D, 2S, 2D) +%} dnl -define(`VECTOR_CAST_I2F', ` +define(`VECTOR_CAST_F2I', ` instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$4 src) %{ predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); match(Set dst (VectorCast$2`'2X src)); - format %{ "scvtfv T$5, $dst, $src\t# convert $1$2 to $1$3 vector" %} + format %{ "fcvtzs $dst, T$5, $src\t# convert $1$2 to $1$3 vector" %} ins_encode %{ - __ scvtfv(__ T$5, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); + __ fcvtzs(as_FloatRegister($dst$$reg), __ T$5, as_FloatRegister($src$$reg)); %} ins_pipe(pipe_class_default); %}')dnl dnl $1 $2 $3 $4 $5 -VECTOR_CAST_I2F(2, I, F, D, 2S) -VECTOR_CAST_I2F(4, I, F, X, 4S) -VECTOR_CAST_I2F(2, L, D, X, 2D) +VECTOR_CAST_F2I(2, F, I, D, 2S) +VECTOR_CAST_F2I(4, F, I, X, 4S) +VECTOR_CAST_F2I(2, D, L, X, 2D) +dnl +define(`VECTOR_CAST_F2I_L', ` +instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$5 src) +%{ + predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); + match(Set dst (VectorCast$2`'2X src)); + format %{ "fcvtzs $dst, T$6, $src\n\t" + "xtn $dst, T$7, $dst, T$6\t# convert $1$2 to $1$3 vector" + %} + ins_encode %{ + __ fcvtzs(as_FloatRegister($dst$$reg), __ T$6, as_FloatRegister($src$$reg)); + __ xtn(as_FloatRegister($dst$$reg), __ T$7, as_FloatRegister($dst$$reg), __ T$6); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl $1 $2 $3 $4 $5 $6 $7 +VECTOR_CAST_F2I_L(4, F, S, D, X, 4S, 4H) +VECTOR_CAST_F2I_L(2, D, I, D, X, 2D, 2S) +dnl + +instruct vcvt4Fto4B(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtzs $dst, T4S, $src\n\t" + "xtn $dst, T4H, $dst, T4S\n\t" + "xtn $dst, T8B, $dst, T8H\t# convert 4F to 4B vector" + %} + ins_encode %{ + __ fcvtzs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); + __ xtn(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($dst$$reg), __ T4S); + __ xtn(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($dst$$reg), __ T8H); + %} + ins_pipe(pipe_slow); +%} dnl define(`VECTOR_CAST_F2F', ` instruct vcvt2$1to2$2`'(vec$3 dst, vec$4 src) @@ -240,20 +324,6 @@ VECTOR_CAST_F2F(F, D, X, D, fcvtl, 2S, 2D) VECTOR_CAST_F2F(D, F, D, X, fcvtn, 2D, 2S) dnl -instruct vcvt2Lto2F(vecD dst, vecX src) -%{ - predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); - match(Set dst (VectorCastL2X src)); - format %{ "scvtfv T2D, $dst, $src\n\t" - "fcvtn $dst, T2S, $dst, T2D\t# convert 2L to 2F vector" - %} - ins_encode %{ - __ scvtfv(__ T2D, as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); - __ fcvtn(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($dst$$reg), __ T2D); - %} - ins_pipe(pipe_slow); -%} - // ------------------------------ Reduction ------------------------------- dnl define(`REDUCE_ADD_BORS', ` @@ -909,7 +979,7 @@ instruct vmul2L(vecX dst, vecX src1, vecX src2, iRegLNoSp tmp1, iRegLNoSp tmp2) "umov $tmp1, $src1, D, 1\n\t" "umov $tmp2, $src2, D, 1\n\t" "mul $tmp2, $tmp2, $tmp1\n\t" - "mov $dst, T2D, 1, $tmp2\t# insert into vector(2L)\n\t" + "mov $dst, T2D, 1, $tmp2\t# insert into vector(2L)" %} ins_encode %{ __ umov($tmp1$$Register, as_FloatRegister($src1$$reg), __ D, 0); @@ -1782,7 +1852,7 @@ instruct vmuladdS2I(vecX dst, vecX src1, vecX src2, vecX tmp) %{ effect(TEMP_DEF dst, TEMP tmp); format %{ "smullv $tmp, $src1, $src2\t# vector (4H)\n\t" "smullv $dst, $src1, $src2\t# vector (8H)\n\t" - "addpv $dst, $tmp, $dst\t# vector (4S)\n\t" %} + "addpv $dst, $tmp, $dst\t# vector (4S)" %} ins_encode %{ __ smullv(as_FloatRegister($tmp$$reg), __ T4H, as_FloatRegister($src1$$reg), diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index abdc424062d..c5f65f2bc5a 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -2823,6 +2823,16 @@ public: f(0b000001, 15, 10), rf(Vn, 5), rf(Vd, 0); } + // Advanced SIMD scalar copy + void dup(FloatRegister Vd, SIMD_RegVariant T, FloatRegister Vn, int index = 0) + { + starti; + assert(T != Q, "invalid size"); + f(0b01011110000, 31, 21); + f((1 << T) | (index << (T + 1)), 20, 16); + f(0b000001, 15, 10), rf(Vn, 5), rf(Vd, 0); + } + // AdvSIMD ZIP/UZP/TRN #define INSN(NAME, opcode) \ void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm) { \ @@ -2901,6 +2911,7 @@ public: INSN(frintn, 0, 0b00, 0b01, 0b11000); INSN(frintm, 0, 0b00, 0b01, 0b11001); INSN(frintp, 0, 0b10, 0b01, 0b11000); + INSN(fcvtzs, 0, 0b10, 0b01, 0b11011); #undef ASSERTION #define ASSERTION (T == T8B || T == T16B || T == T4H || T == T8H || T == T2S || T == T4S) diff --git a/test/hotspot/gtest/aarch64/aarch64-asmtest.py b/test/hotspot/gtest/aarch64/aarch64-asmtest.py index f77560ca7eb..daaa33d454f 100644 --- a/test/hotspot/gtest/aarch64/aarch64-asmtest.py +++ b/test/hotspot/gtest/aarch64/aarch64-asmtest.py @@ -1522,6 +1522,7 @@ generate(SpecialCases, [["ccmn", "__ ccmn(zr, zr, 3u, Assembler::LE);", ["stxp", "__ stxp(r4, zr, zr, r5);", "stxp\tw4, xzr, xzr, [x5]"], ["stxpw", "__ stxpw(r6, zr, zr, sp);", "stxp\tw6, wzr, wzr, [sp]"], ["dup", "__ dup(v0, __ T16B, zr);", "dup\tv0.16b, wzr"], + ["dup", "__ dup(v0, __ S, v1);", "dup\ts0, v1.s[0]"], ["mov", "__ mov(v1, __ T1D, 0, zr);", "mov\tv1.d[0], xzr"], ["mov", "__ mov(v1, __ T2S, 1, zr);", "mov\tv1.s[1], wzr"], ["mov", "__ mov(v1, __ T4H, 2, zr);", "mov\tv1.h[2], wzr"], @@ -1535,6 +1536,7 @@ generate(SpecialCases, [["ccmn", "__ ccmn(zr, zr, 3u, Assembler::LE);", ["umov", "__ umov(r0, v1, __ B, 3);", "umov\tw0, v1.b[3]"], ["fmov", "__ fmovhid(r0, v1);", "fmov\tx0, v1.d[1]"], ["ld1", "__ ld1(v31, v0, __ T2D, Address(__ post(r1, r0)));", "ld1\t{v31.2d, v0.2d}, [x1], x0"], + ["fcvtzs", "__ fcvtzs(v0, __ T4S, v1);", "fcvtzs\tv0.4s, v1.4s"], # SVE instructions ["cpy", "__ sve_cpy(z0, __ S, p0, v1);", "mov\tz0.s, p0/m, s1"], ["cpy", "__ sve_cpy(z0, __ B, p0, 127, true);", "mov\tz0.b, p0/m, 127"], @@ -1750,7 +1752,8 @@ while i < len(bytes): i += 4 if i%16 == 0: print -print "\n };" +print +print " };" print "// END Generated code -- do not edit" infile.close() diff --git a/test/hotspot/gtest/aarch64/asmtest.out.h b/test/hotspot/gtest/aarch64/asmtest.out.h index 661471e67e0..2ddb3da5edc 100644 --- a/test/hotspot/gtest/aarch64/asmtest.out.h +++ b/test/hotspot/gtest/aarch64/asmtest.out.h @@ -712,6 +712,7 @@ __ stxp(r4, zr, zr, r5); // stxp w4, xzr, xzr, [x5] __ stxpw(r6, zr, zr, sp); // stxp w6, wzr, wzr, [sp] __ dup(v0, __ T16B, zr); // dup v0.16b, wzr + __ dup(v0, __ S, v1); // dup s0, v1.s[0] __ mov(v1, __ T1D, 0, zr); // mov v1.d[0], xzr __ mov(v1, __ T2S, 1, zr); // mov v1.s[1], wzr __ mov(v1, __ T4H, 2, zr); // mov v1.h[2], wzr @@ -725,6 +726,7 @@ __ umov(r0, v1, __ B, 3); // umov w0, v1.b[3] __ fmovhid(r0, v1); // fmov x0, v1.d[1] __ ld1(v31, v0, __ T2D, Address(__ post(r1, r0))); // ld1 {v31.2d, v0.2d}, [x1], x0 + __ fcvtzs(v0, __ T4S, v1); // fcvtzs v0.4s, v1.4s __ sve_cpy(z0, __ S, p0, v1); // mov z0.s, p0/m, s1 __ sve_cpy(z0, __ B, p0, 127, true); // mov z0.b, p0/m, 127 __ sve_cpy(z1, __ H, p0, -128, true); // mov z1.h, p0/m, -128 @@ -1042,30 +1044,30 @@ 0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061, 0x120cb166, 0x321764bc, 0x52174681, 0x720c0227, 0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01, - 0x14000000, 0x17ffffd7, 0x1400034c, 0x94000000, - 0x97ffffd4, 0x94000349, 0x3400000a, 0x34fffa2a, - 0x340068ca, 0x35000008, 0x35fff9c8, 0x35006868, - 0xb400000b, 0xb4fff96b, 0xb400680b, 0xb500001d, - 0xb5fff91d, 0xb50067bd, 0x10000013, 0x10fff8b3, - 0x10006753, 0x90000013, 0x36300016, 0x3637f836, - 0x363066d6, 0x3758000c, 0x375ff7cc, 0x3758666c, + 0x14000000, 0x17ffffd7, 0x1400034e, 0x94000000, + 0x97ffffd4, 0x9400034b, 0x3400000a, 0x34fffa2a, + 0x3400690a, 0x35000008, 0x35fff9c8, 0x350068a8, + 0xb400000b, 0xb4fff96b, 0xb400684b, 0xb500001d, + 0xb5fff91d, 0xb50067fd, 0x10000013, 0x10fff8b3, + 0x10006793, 0x90000013, 0x36300016, 0x3637f836, + 0x36306716, 0x3758000c, 0x375ff7cc, 0x375866ac, 0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc, 0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f, 0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016, 0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0, - 0x54006440, 0x54000001, 0x54fff541, 0x540063e1, - 0x54000002, 0x54fff4e2, 0x54006382, 0x54000002, - 0x54fff482, 0x54006322, 0x54000003, 0x54fff423, - 0x540062c3, 0x54000003, 0x54fff3c3, 0x54006263, - 0x54000004, 0x54fff364, 0x54006204, 0x54000005, - 0x54fff305, 0x540061a5, 0x54000006, 0x54fff2a6, - 0x54006146, 0x54000007, 0x54fff247, 0x540060e7, - 0x54000008, 0x54fff1e8, 0x54006088, 0x54000009, - 0x54fff189, 0x54006029, 0x5400000a, 0x54fff12a, - 0x54005fca, 0x5400000b, 0x54fff0cb, 0x54005f6b, - 0x5400000c, 0x54fff06c, 0x54005f0c, 0x5400000d, - 0x54fff00d, 0x54005ead, 0x5400000e, 0x54ffefae, - 0x54005e4e, 0x5400000f, 0x54ffef4f, 0x54005def, + 0x54006480, 0x54000001, 0x54fff541, 0x54006421, + 0x54000002, 0x54fff4e2, 0x540063c2, 0x54000002, + 0x54fff482, 0x54006362, 0x54000003, 0x54fff423, + 0x54006303, 0x54000003, 0x54fff3c3, 0x540062a3, + 0x54000004, 0x54fff364, 0x54006244, 0x54000005, + 0x54fff305, 0x540061e5, 0x54000006, 0x54fff2a6, + 0x54006186, 0x54000007, 0x54fff247, 0x54006127, + 0x54000008, 0x54fff1e8, 0x540060c8, 0x54000009, + 0x54fff189, 0x54006069, 0x5400000a, 0x54fff12a, + 0x5400600a, 0x5400000b, 0x54fff0cb, 0x54005fab, + 0x5400000c, 0x54fff06c, 0x54005f4c, 0x5400000d, + 0x54fff00d, 0x54005eed, 0x5400000e, 0x54ffefae, + 0x54005e8e, 0x5400000f, 0x54ffef4f, 0x54005e2f, 0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60, 0xd44cad80, 0xd503201f, 0xd69f03e0, 0xd6bf03e0, 0xd5033fdf, 0xd5033e9f, 0xd50332bf, 0xd61f0200, @@ -1097,7 +1099,7 @@ 0x791f226d, 0xf95aa2f3, 0xb9587bb7, 0x395f7176, 0x795d9143, 0x399e7e08, 0x799a2697, 0x79df3422, 0xb99c2624, 0xfd5c2374, 0xbd5fa1d9, 0xfd1d595a, - 0xbd1b1869, 0x58004e3b, 0x1800000b, 0xf8945060, + 0xbd1b1869, 0x58004e7b, 0x1800000b, 0xf8945060, 0xd8000000, 0xf8ae6ba0, 0xf99a0080, 0x1a070035, 0x3a0700a8, 0x5a0e0367, 0x7a11009b, 0x9a000380, 0xba1e030c, 0xda0f0320, 0xfa030301, 0x0b340b11, @@ -1182,78 +1184,78 @@ 0x6e2ee5ac, 0x6e7ee7bc, 0xba5fd3e3, 0x3a5f03e5, 0xfa411be4, 0x7a42cbe2, 0x93df03ff, 0xc820ffff, 0x8822fc7f, 0xc8247cbf, 0x88267fff, 0x4e010fe0, - 0x4e081fe1, 0x4e0c1fe1, 0x4e0a1fe1, 0x4e071fe1, - 0x4e042c20, 0x4e062c20, 0x4e052c20, 0x4e083c20, - 0x0e0c3c20, 0x0e0a3c20, 0x0e073c20, 0x9eae0020, - 0x4cc0ac3f, 0x05a08020, 0x05104fe0, 0x05505001, - 0x05906fe2, 0x05d03005, 0x05101fea, 0x05901feb, - 0x04b0e3e0, 0x0470e7e1, 0x042f9c20, 0x043f9c35, - 0x047f9c20, 0x04ff9c20, 0x04299420, 0x04319160, - 0x0461943e, 0x04a19020, 0x042053ff, 0x047f5401, - 0x25208028, 0x2538cfe0, 0x2578d001, 0x25b8efe2, - 0x25f8f007, 0x2538dfea, 0x25b8dfeb, 0xa400a3e0, - 0xa420a7e0, 0xa4484be0, 0xa467afe0, 0xa4a8a7ea, - 0xa547a814, 0xa4084ffe, 0xa55c53e0, 0xa5e1540b, - 0xe400fbf6, 0xe408ffff, 0xe420e7e0, 0xe4484be0, - 0xe460efe0, 0xe547e400, 0xe4014be0, 0xe4a84fe0, - 0xe5f15000, 0x858043e0, 0x85a043ff, 0xe59f5d08, - 0x0420e3e9, 0x0460e3ea, 0x04a0e3eb, 0x04e0e3ec, - 0x25104042, 0x25104871, 0x25904861, 0x25904c92, - 0x05344020, 0x05744041, 0x05b44062, 0x05f44083, - 0x252c8840, 0x253c1420, 0x25681572, 0x25a21ce3, - 0x25ea1e34, 0x0522c020, 0x05e6c0a4, 0x2401a001, - 0x2443a051, 0x24858881, 0x24c78cd1, 0x24850891, - 0x24c70cc1, 0x250f9001, 0x25508051, 0x25802491, - 0x25df28c1, 0x25850c81, 0x251e10d1, 0x65816001, - 0x65c36051, 0x65854891, 0x65c74cc1, 0x05733820, - 0x05b238a4, 0x05f138e6, 0x0570396a, 0x65d0a001, - 0x65d6a443, 0x65d4a826, 0x6594ac26, 0x6554ac26, - 0x6556ac26, 0x6552ac26, 0x65cbac85, 0x65caac01, - 0x65dea833, 0x659ca509, 0x65d8a801, 0x65dcac01, - 0x655cb241, 0x0520a1e0, 0x0521a601, 0x052281e0, - 0x05238601, 0x04a14026, 0x0568aca7, 0x05b23230, - 0x853040af, 0xc5b040af, 0xe57080af, 0xe5b080af, - 0x1e601000, 0x1e603000, 0x1e621000, 0x1e623000, - 0x1e641000, 0x1e643000, 0x1e661000, 0x1e663000, - 0x1e681000, 0x1e683000, 0x1e6a1000, 0x1e6a3000, - 0x1e6c1000, 0x1e6c3000, 0x1e6e1000, 0x1e6e3000, - 0x1e701000, 0x1e703000, 0x1e721000, 0x1e723000, - 0x1e741000, 0x1e743000, 0x1e761000, 0x1e763000, - 0x1e781000, 0x1e783000, 0x1e7a1000, 0x1e7a3000, - 0x1e7c1000, 0x1e7c3000, 0x1e7e1000, 0x1e7e3000, - 0xf8208193, 0xf83101b6, 0xf83c13fe, 0xf821239a, - 0xf824309e, 0xf826535e, 0xf8304109, 0xf82c7280, - 0xf8216058, 0xf8a08309, 0xf8ba03d0, 0xf8a312ea, - 0xf8aa21e4, 0xf8a2310b, 0xf8aa522f, 0xf8a2418a, - 0xf8ac71af, 0xf8a26287, 0xf8fa8090, 0xf8e20184, - 0xf8f01215, 0xf8f022ab, 0xf8f7334c, 0xf8f751dc, - 0xf8eb4038, 0xf8ec715f, 0xf8f06047, 0xf863826d, - 0xf8710070, 0xf86113cb, 0xf86521e8, 0xf87d301e, - 0xf8745287, 0xf87742bc, 0xf87b70b9, 0xf8616217, - 0xb83f8185, 0xb82901fc, 0xb83d13f6, 0xb83320bf, - 0xb82e33f0, 0xb830529b, 0xb830416c, 0xb82973c6, - 0xb831639b, 0xb8be8147, 0xb8b4008a, 0xb8b81231, - 0xb8b623a3, 0xb8af3276, 0xb8b35056, 0xb8af4186, - 0xb8b071ab, 0xb8b763c1, 0xb8f38225, 0xb8e202d0, - 0xb8ed12aa, 0xb8fd219b, 0xb8fb3023, 0xb8ff5278, - 0xb8f14389, 0xb8fb70ef, 0xb8f563f7, 0xb87983e2, - 0xb87b0150, 0xb8771073, 0xb8702320, 0xb87a3057, - 0xb870508c, 0xb87c43be, 0xb87070db, 0xb86961fd, - 0xce273c87, 0xce080ac9, 0xce7e8e9b, 0xce808b45, - 0xce79806e, 0xce758768, 0xcec0835a, 0xce608ad8, - 0x043100c4, 0x046105e3, 0x65c900a6, 0x65d60a87, - 0x65c80545, 0x0416a63e, 0x04001f8b, 0x0450979a, - 0x04dabe0d, 0x045381a5, 0x04918b4f, 0x049006cb, - 0x0497a264, 0x045eadd1, 0x04881062, 0x040a04d7, - 0x04810f71, 0x04dca450, 0x65c084c3, 0x65cd8d93, - 0x65c69a68, 0x65878ae0, 0x65c29db3, 0x049da0e6, - 0x6582b911, 0x65c0b6d6, 0x65c1a1e2, 0x65cda494, - 0x65c18107, 0x65af1493, 0x65e52b36, 0x65ab4ed0, - 0x65f06a8d, 0x0451448f, 0x049c7c86, 0x0429335d, - 0x04bc3162, 0x047a3027, 0x04e831d1, 0x05a56b15, - 0x05b66e35, 0x041a367d, 0x041832e4, 0x04d926f3, - 0x04482113, 0x04ca3a2e, 0x658727d5, 0x6586358a, - 0x65d82709, 0x044138c4, + 0x5e040420, 0x4e081fe1, 0x4e0c1fe1, 0x4e0a1fe1, + 0x4e071fe1, 0x4e042c20, 0x4e062c20, 0x4e052c20, + 0x4e083c20, 0x0e0c3c20, 0x0e0a3c20, 0x0e073c20, + 0x9eae0020, 0x4cc0ac3f, 0x4ea1b820, 0x05a08020, + 0x05104fe0, 0x05505001, 0x05906fe2, 0x05d03005, + 0x05101fea, 0x05901feb, 0x04b0e3e0, 0x0470e7e1, + 0x042f9c20, 0x043f9c35, 0x047f9c20, 0x04ff9c20, + 0x04299420, 0x04319160, 0x0461943e, 0x04a19020, + 0x042053ff, 0x047f5401, 0x25208028, 0x2538cfe0, + 0x2578d001, 0x25b8efe2, 0x25f8f007, 0x2538dfea, + 0x25b8dfeb, 0xa400a3e0, 0xa420a7e0, 0xa4484be0, + 0xa467afe0, 0xa4a8a7ea, 0xa547a814, 0xa4084ffe, + 0xa55c53e0, 0xa5e1540b, 0xe400fbf6, 0xe408ffff, + 0xe420e7e0, 0xe4484be0, 0xe460efe0, 0xe547e400, + 0xe4014be0, 0xe4a84fe0, 0xe5f15000, 0x858043e0, + 0x85a043ff, 0xe59f5d08, 0x0420e3e9, 0x0460e3ea, + 0x04a0e3eb, 0x04e0e3ec, 0x25104042, 0x25104871, + 0x25904861, 0x25904c92, 0x05344020, 0x05744041, + 0x05b44062, 0x05f44083, 0x252c8840, 0x253c1420, + 0x25681572, 0x25a21ce3, 0x25ea1e34, 0x0522c020, + 0x05e6c0a4, 0x2401a001, 0x2443a051, 0x24858881, + 0x24c78cd1, 0x24850891, 0x24c70cc1, 0x250f9001, + 0x25508051, 0x25802491, 0x25df28c1, 0x25850c81, + 0x251e10d1, 0x65816001, 0x65c36051, 0x65854891, + 0x65c74cc1, 0x05733820, 0x05b238a4, 0x05f138e6, + 0x0570396a, 0x65d0a001, 0x65d6a443, 0x65d4a826, + 0x6594ac26, 0x6554ac26, 0x6556ac26, 0x6552ac26, + 0x65cbac85, 0x65caac01, 0x65dea833, 0x659ca509, + 0x65d8a801, 0x65dcac01, 0x655cb241, 0x0520a1e0, + 0x0521a601, 0x052281e0, 0x05238601, 0x04a14026, + 0x0568aca7, 0x05b23230, 0x853040af, 0xc5b040af, + 0xe57080af, 0xe5b080af, 0x1e601000, 0x1e603000, + 0x1e621000, 0x1e623000, 0x1e641000, 0x1e643000, + 0x1e661000, 0x1e663000, 0x1e681000, 0x1e683000, + 0x1e6a1000, 0x1e6a3000, 0x1e6c1000, 0x1e6c3000, + 0x1e6e1000, 0x1e6e3000, 0x1e701000, 0x1e703000, + 0x1e721000, 0x1e723000, 0x1e741000, 0x1e743000, + 0x1e761000, 0x1e763000, 0x1e781000, 0x1e783000, + 0x1e7a1000, 0x1e7a3000, 0x1e7c1000, 0x1e7c3000, + 0x1e7e1000, 0x1e7e3000, 0xf8208193, 0xf83101b6, + 0xf83c13fe, 0xf821239a, 0xf824309e, 0xf826535e, + 0xf8304109, 0xf82c7280, 0xf8216058, 0xf8a08309, + 0xf8ba03d0, 0xf8a312ea, 0xf8aa21e4, 0xf8a2310b, + 0xf8aa522f, 0xf8a2418a, 0xf8ac71af, 0xf8a26287, + 0xf8fa8090, 0xf8e20184, 0xf8f01215, 0xf8f022ab, + 0xf8f7334c, 0xf8f751dc, 0xf8eb4038, 0xf8ec715f, + 0xf8f06047, 0xf863826d, 0xf8710070, 0xf86113cb, + 0xf86521e8, 0xf87d301e, 0xf8745287, 0xf87742bc, + 0xf87b70b9, 0xf8616217, 0xb83f8185, 0xb82901fc, + 0xb83d13f6, 0xb83320bf, 0xb82e33f0, 0xb830529b, + 0xb830416c, 0xb82973c6, 0xb831639b, 0xb8be8147, + 0xb8b4008a, 0xb8b81231, 0xb8b623a3, 0xb8af3276, + 0xb8b35056, 0xb8af4186, 0xb8b071ab, 0xb8b763c1, + 0xb8f38225, 0xb8e202d0, 0xb8ed12aa, 0xb8fd219b, + 0xb8fb3023, 0xb8ff5278, 0xb8f14389, 0xb8fb70ef, + 0xb8f563f7, 0xb87983e2, 0xb87b0150, 0xb8771073, + 0xb8702320, 0xb87a3057, 0xb870508c, 0xb87c43be, + 0xb87070db, 0xb86961fd, 0xce273c87, 0xce080ac9, + 0xce7e8e9b, 0xce808b45, 0xce79806e, 0xce758768, + 0xcec0835a, 0xce608ad8, 0x043100c4, 0x046105e3, + 0x65c900a6, 0x65d60a87, 0x65c80545, 0x0416a63e, + 0x04001f8b, 0x0450979a, 0x04dabe0d, 0x045381a5, + 0x04918b4f, 0x049006cb, 0x0497a264, 0x045eadd1, + 0x04881062, 0x040a04d7, 0x04810f71, 0x04dca450, + 0x65c084c3, 0x65cd8d93, 0x65c69a68, 0x65878ae0, + 0x65c29db3, 0x049da0e6, 0x6582b911, 0x65c0b6d6, + 0x65c1a1e2, 0x65cda494, 0x65c18107, 0x65af1493, + 0x65e52b36, 0x65ab4ed0, 0x65f06a8d, 0x0451448f, + 0x049c7c86, 0x0429335d, 0x04bc3162, 0x047a3027, + 0x04e831d1, 0x05a56b15, 0x05b66e35, 0x041a367d, + 0x041832e4, 0x04d926f3, 0x04482113, 0x04ca3a2e, + 0x658727d5, 0x6586358a, 0x65d82709, 0x044138c4, + }; // END Generated code -- do not edit - -- GitLab From 9e831bccd2fc90681b32d1504eca753462afc6f6 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Wed, 27 Oct 2021 08:24:44 +0000 Subject: [PATCH 083/890] 8275886: G1: remove obsolete comment in HeapRegion::setup_heap_region_size Reviewed-by: mli, tschatzl --- src/hotspot/share/gc/g1/heapRegion.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp index 71abe4a2d45..3e10be4741a 100644 --- a/src/hotspot/share/gc/g1/heapRegion.cpp +++ b/src/hotspot/share/gc/g1/heapRegion.cpp @@ -84,8 +84,6 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) { LogOfHRGrainBytes = region_size_log; guarantee(GrainBytes == 0, "we should only set it once"); - // The cast to int is safe, given that we've bounded region_size by - // MIN_REGION_SIZE and MAX_REGION_SIZE. GrainBytes = region_size; guarantee(GrainWords == 0, "we should only set it once"); -- GitLab From 2f979ecb5b642d04ad280687de76a6ee46818b35 Mon Sep 17 00:00:00 2001 From: Jayathirth D V Date: Wed, 27 Oct 2021 09:29:37 +0000 Subject: [PATCH 084/890] 8213120: java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java fails on mac10.13 Reviewed-by: psadhukhan --- test/jdk/ProblemList.txt | 1 - .../AutoScrollOnSelectAndAppend.java | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 60a86a819b4..f83e87c1e97 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -494,7 +494,6 @@ java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 816 java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java 8169468 macosx-all -java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8213120 macosx-all java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223,8274106 macosx-aarch64,linux-all,windows-all java/awt/Window/WindowResizing/DoubleClickTitleBarTest.java 8233557 macosx-all diff --git a/test/jdk/java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java b/test/jdk/java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java index 970db5f1ff1..3993c87792d 100644 --- a/test/jdk/java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java +++ b/test/jdk/java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java @@ -101,12 +101,14 @@ public class AutoScrollOnSelectAndAppend { public AutoScrollOnSelectAndAppend() { try { robot = new Robot(); + robot.setAutoDelay(100); } catch (Exception ex) { throw new RuntimeException("Robot Creation Failed."); } frame = new Frame(); frame.setSize(200, 200); frame.setLayout(new FlowLayout()); + frame.setLocationRelativeTo(null); textArea = new TextArea(5, 20); composeTextArea(); @@ -128,11 +130,11 @@ public class AutoScrollOnSelectAndAppend { // Delay to make sure auto scroll is finished. robot.waitForIdle(); robot.delay(500); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.delay(100); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); } -- GitLab From 6c05cc9d15fb6014b8293a66ef132f3461badca1 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Wed, 27 Oct 2021 10:07:46 +0000 Subject: [PATCH 085/890] 8275863: Use encodeASCII for ASCII-compatible DoubleByte encodings Reviewed-by: naoto, rriggs, alanb --- src/java.base/share/classes/module-info.java | 1 + .../share/classes/sun/nio/cs/DoubleByte.java | 15 ++++++++++++--- src/java.base/share/classes/sun/nio/cs/HKSCS.java | 14 ++++++-------- src/java.base/share/lib/security/default.policy | 2 ++ .../classes/sun/nio/cs/ext/EUC_JP.java.template | 10 ++++++++++ 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index 19e8bcfd255..9faee9cae36 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -151,6 +151,7 @@ module java.base { java.management, java.naming, java.rmi, + jdk.charsets, jdk.jartool, jdk.jlink, jdk.net, diff --git a/src/java.base/share/classes/sun/nio/cs/DoubleByte.java b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java index 7a9a3d40bfa..0fb8a82f74f 100644 --- a/src/java.base/share/classes/sun/nio/cs/DoubleByte.java +++ b/src/java.base/share/classes/sun/nio/cs/DoubleByte.java @@ -111,11 +111,11 @@ public class DoubleByte { Arrays.fill(B2C_UNMAPPABLE, UNMAPPABLE_DECODING); } + private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); + public static class Decoder extends CharsetDecoder implements DelegatableDecoder, ArrayDecoder { - private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); - final char[][] b2c; final char[] b2cSB; final int b2Min; @@ -601,6 +601,11 @@ public class DoubleByte { int dl = dst.arrayOffset() + dst.limit(); try { + if (isASCIICompatible) { + int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(dl - dp, sl - sp)); + sp += n; + dp += n; + } while (sp < sl) { char c = sa[sp]; int bb = encodeChar(c); @@ -681,7 +686,11 @@ public class DoubleByte { public int encode(char[] src, int sp, int len, byte[] dst) { int dp = 0; int sl = sp + len; - int dl = dst.length; + if (isASCIICompatible) { + int n = JLA.encodeASCII(src, sp, dst, dp, len); + sp += n; + dp += n; + } while (sp < sl) { char c = src[sp++]; int bb = encodeChar(c); diff --git a/src/java.base/share/classes/sun/nio/cs/HKSCS.java b/src/java.base/share/classes/sun/nio/cs/HKSCS.java index 1b166447b78..f812041a295 100644 --- a/src/java.base/share/classes/sun/nio/cs/HKSCS.java +++ b/src/java.base/share/classes/sun/nio/cs/HKSCS.java @@ -42,9 +42,9 @@ public class HKSCS { static int b2Min = 0x40; static int b2Max = 0xfe; - private char[][] b2cBmp; - private char[][] b2cSupp; - private DoubleByte.Decoder big5Dec; + private final char[][] b2cBmp; + private final char[][] b2cSupp; + private final DoubleByte.Decoder big5Dec; protected Decoder(Charset cs, DoubleByte.Decoder big5Dec, @@ -94,7 +94,6 @@ public class HKSCS { int b1 = sa[sp] & 0xff; char c = decodeSingle(b1); int inSize = 1, outSize = 1; - char[] cc = null; if (c == UNMAPPABLE_DECODING) { if (sl - sp < 2) return CoderResult.UNDERFLOW; @@ -137,7 +136,6 @@ public class HKSCS { int mark = src.position(); try { while (src.hasRemaining()) { - char[] cc = null; int b1 = src.get() & 0xff; int inSize = 1, outSize = 1; char c = decodeSingle(b1); @@ -230,9 +228,9 @@ public class HKSCS { } public static class Encoder extends DoubleByte.Encoder { - private DoubleByte.Encoder big5Enc; - private char[][] c2bBmp; - private char[][] c2bSupp; + private final DoubleByte.Encoder big5Enc; + private final char[][] c2bBmp; + private final char[][] c2bSupp; protected Encoder(Charset cs, DoubleByte.Encoder big5Enc, diff --git a/src/java.base/share/lib/security/default.policy b/src/java.base/share/lib/security/default.policy index 8356e56367b..b22f26947af 100644 --- a/src/java.base/share/lib/security/default.policy +++ b/src/java.base/share/lib/security/default.policy @@ -111,6 +111,8 @@ grant codeBase "jrt:/jdk.accessibility" { grant codeBase "jrt:/jdk.charsets" { permission java.util.PropertyPermission "os.name", "read"; permission java.lang.RuntimePermission "charsetProvider"; + permission java.lang.RuntimePermission + "accessClassInPackage.jdk.internal.access"; permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc"; permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.cs"; diff --git a/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template b/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template index 96e9067cbfd..0ade0e9459d 100644 --- a/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template +++ b/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template @@ -25,6 +25,9 @@ package $PACKAGE$; +import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.SharedSecrets; + import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -43,6 +46,8 @@ public class EUC_JP extends Charset implements HistoricallyNamedCharset { + private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); + public EUC_JP() { super("EUC-JP", $ALIASES$); } @@ -303,6 +308,11 @@ public class EUC_JP byte[] tmpBuf = new byte[3]; try { + if (enc0201.isASCIICompatible()) { + int n = JLA.encodeASCII(sa, sp, da, dp, Math.min(dl - dp, sl - sp)); + sp += n; + dp += n; + } while (sp < sl) { outputByte = tmpBuf; char c = sa[sp]; -- GitLab From b3f45f868d9c91d630a118e43cef54cdb3216fd0 Mon Sep 17 00:00:00 2001 From: Jayathirth D V Date: Wed, 27 Oct 2021 10:21:28 +0000 Subject: [PATCH 086/890] 8275689: [TESTBUG] Use color tolerance only for XRender in BlitRotateClippedArea test Reviewed-by: serb --- .../DrawImage/BlitRotateClippedArea.java | 48 ++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/test/jdk/java/awt/image/DrawImage/BlitRotateClippedArea.java b/test/jdk/java/awt/image/DrawImage/BlitRotateClippedArea.java index a622c01377b..4b3bcb4061c 100644 --- a/test/jdk/java/awt/image/DrawImage/BlitRotateClippedArea.java +++ b/test/jdk/java/awt/image/DrawImage/BlitRotateClippedArea.java @@ -56,6 +56,7 @@ public class BlitRotateClippedArea { System.setProperty("sun.java2d.uiScale", "1"); var ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); var gc = ge.getDefaultScreenDevice().getDefaultConfiguration(); + var className = gc.getClass().getSimpleName(); var gold = gc.createCompatibleImage(1000, 1000, TRANSLUCENT); var dstVI2BI = gc.createCompatibleImage(1000, 1000, TRANSLUCENT); @@ -94,24 +95,38 @@ public class BlitRotateClippedArea { } while (dstVI2VI.contentsLost() || dstBI2VI.contentsLost() || srcVI.contentsLost()); - validate(gold, snapshotVI2VI); - validate(gold, snapshotBI2VI); - validate(gold, dstVI2BI); + validate(gold, snapshotVI2VI, className); + validate(gold, snapshotBI2VI, className); + validate(gold, dstVI2BI, className); } - private static void validate(BufferedImage gold, BufferedImage img) - throws IOException { - for (int x = 0; x < gold.getWidth(); ++x) { - for (int y = 0; y < gold.getHeight(); ++y) { - Color goldColor = new Color(gold.getRGB(x, y)); - Color actualColor = new Color(img.getRGB(x, y)); - if ((Math.abs(goldColor.getRed() - actualColor.getRed()) > 1) || - (Math.abs(goldColor.getGreen() - actualColor.getGreen()) > 1) || - (Math.abs(goldColor.getBlue() - actualColor.getBlue()) > 1)) { - ImageIO.write(gold, "png", new File("gold.png")); - ImageIO.write(img, "png", new File("snapshot.png")); - throw new RuntimeException("Test failed for pixel :" - + x + "/" + y); + private static void validate(BufferedImage gold, BufferedImage img, + String className) throws IOException { + if (!(className.equals("XRGraphicsConfig"))) { + for (int x = 0; x < gold.getWidth(); ++x) { + for (int y = 0; y < gold.getHeight(); ++y) { + if (gold.getRGB(x, y) != img.getRGB(x, y)) { + ImageIO.write(gold, "png", new File("gold.png")); + ImageIO.write(img, "png", new File("snapshot.png")); + throw new RuntimeException("Test failed."); + } + } + } + } else { + // In Linux where we use XRender pipeline there is + // little deviation because of less arithmetic precision + for (int x = 0; x < gold.getWidth(); ++x) { + for (int y = 0; y < gold.getHeight(); ++y) { + Color goldColor = new Color(gold.getRGB(x, y)); + Color actualColor = new Color(img.getRGB(x, y)); + if ((Math.abs(goldColor.getRed() - actualColor.getRed()) > 1) || + (Math.abs(goldColor.getGreen() - actualColor.getGreen()) > 1) || + (Math.abs(goldColor.getBlue() - actualColor.getBlue()) > 1)) { + ImageIO.write(gold, "png", new File("gold.png")); + ImageIO.write(img, "png", new File("snapshot.png")); + throw new RuntimeException("Test failed for pixel :" + + x + "/" + y); + } } } } @@ -144,4 +159,3 @@ public class BlitRotateClippedArea { graphics.dispose(); } } - -- GitLab From 485d65865ea8af3f7275e9aa8b75057326486a4d Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Wed, 27 Oct 2021 10:24:21 +0000 Subject: [PATCH 087/890] 8275851: Deproblemlist open/test/jdk/javax/swing/JComponent/6683775/bug6683775.java Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../swing/JComponent/6683775/bug6683775.java | 68 +++++++++++-------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index f83e87c1e97..97ae0014dc1 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -705,7 +705,6 @@ javax/sound/midi/Sequencer/Looping.java 8136897 generic-all javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,windows-all javax/swing/border/TestTitledBorderLeak.java 8213531 linux-all -javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582 linux-all javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582 linux-all javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128 macosx-all diff --git a/test/jdk/javax/swing/JComponent/6683775/bug6683775.java b/test/jdk/javax/swing/JComponent/6683775/bug6683775.java index c5572e83919..5c8445dc479 100644 --- a/test/jdk/javax/swing/JComponent/6683775/bug6683775.java +++ b/test/jdk/javax/swing/JComponent/6683775/bug6683775.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -46,6 +46,10 @@ public class bug6683775 { static final int LOC = 100, SIZE = 200; + static JFrame testFrame; + static JFrame backgroundFrame; + static BufferedImage capture; + public static void main(String[] args) throws Exception { GraphicsConfiguration gc = getGC(); if (gc == null || !gc.getDevice().isWindowTranslucencySupported( @@ -53,35 +57,39 @@ public class bug6683775 { return; } Robot robot = new Robot(); - final JFrame testFrame = new JFrame(gc); - - SwingUtilities.invokeAndWait(() -> { - JFrame backgroundFrame = new JFrame("Background frame"); - backgroundFrame.setUndecorated(true); - JPanel panel = new JPanel(); - panel.setBackground(Color.RED); - backgroundFrame.add(panel); - backgroundFrame.setBounds(LOC, LOC, SIZE, SIZE); - backgroundFrame.setVisible(true); - - testFrame.setUndecorated(true); - JPanel p = new JPanel(); - p.setOpaque(false); - testFrame.add(p); - setOpaque(testFrame, false); - testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - testFrame.setBounds(LOC, LOC, SIZE, SIZE); - testFrame.setVisible(true); - }); - - robot.waitForIdle(); - Thread.sleep(1500); - - //robot.getPixelColor() didn't work right for some reason - BufferedImage capture = - robot.createScreenCapture(new Rectangle(LOC, LOC, SIZE, SIZE)); - - SwingUtilities.invokeAndWait(testFrame::dispose); + + try { + SwingUtilities.invokeAndWait(() -> { + testFrame = new JFrame(gc); + backgroundFrame = new JFrame("Background frame"); + backgroundFrame.setUndecorated(true); + JPanel panel = new JPanel(); + panel.setBackground(Color.RED); + backgroundFrame.add(panel); + backgroundFrame.setBounds(LOC, LOC, SIZE, SIZE); + backgroundFrame.setVisible(true); + + testFrame.setUndecorated(true); + JPanel p = new JPanel(); + p.setOpaque(false); + testFrame.add(p); + setOpaque(testFrame, false); + testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + testFrame.setBounds(LOC, LOC, SIZE, SIZE); + testFrame.setVisible(true); + }); + + robot.waitForIdle(); + robot.delay(1000); + + //robot.getPixelColor() didn't work right for some reason + capture = + robot.createScreenCapture(new Rectangle(LOC, LOC, SIZE, SIZE)); + + } finally { + SwingUtilities.invokeAndWait(testFrame::dispose); + SwingUtilities.invokeAndWait(backgroundFrame::dispose); + } int redRGB = Color.RED.getRGB(); if (redRGB != capture.getRGB(SIZE/2, SIZE/2)) { -- GitLab From 40606021ee6b7d18674e36b3f6249f1ca8a7647e Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 27 Oct 2021 12:09:46 +0000 Subject: [PATCH 088/890] 8275800: Redefinition leaks MethodData::_extra_data_lock Reviewed-by: sspitsyn, dholmes --- src/hotspot/share/oops/instanceKlass.cpp | 31 ++++++++----------- src/hotspot/share/oops/instanceKlass.hpp | 5 +-- src/hotspot/share/oops/klass.cpp | 2 +- src/hotspot/share/oops/klass.hpp | 2 +- .../share/prims/jvmtiRedefineClasses.cpp | 3 ++ 5 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index d65d1eb661e..389f0f4f27a 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -583,7 +583,10 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { // Release C heap allocated data that this points to, which includes // reference counting symbol names. - release_C_heap_structures_internal(); + // Can't release the constant pool here because the constant pool can be + // deallocated separately from the InstanceKlass for default methods and + // redefine classes. + release_C_heap_structures(/* release_constant_pool */ false); deallocate_methods(loader_data, methods()); set_methods(NULL); @@ -1638,7 +1641,8 @@ bool InstanceKlass::find_field_from_offset(int offset, bool is_static, fieldDesc void InstanceKlass::methods_do(void f(Method* method)) { // Methods aren't stable until they are loaded. This can be read outside // a lock through the ClassLoaderData for profiling - if (!is_loaded()) { + // Redefined scratch classes are on the list and need to be cleaned + if (!is_loaded() && !is_scratch_class()) { return; } @@ -2681,22 +2685,13 @@ static void method_release_C_heap_structures(Method* m) { m->release_C_heap_structures(); } -void InstanceKlass::release_C_heap_structures() { - +// Called also by InstanceKlass::deallocate_contents, with false for release_constant_pool. +void InstanceKlass::release_C_heap_structures(bool release_constant_pool) { // Clean up C heap - release_C_heap_structures_internal(); - constants()->release_C_heap_structures(); + Klass::release_C_heap_structures(); // Deallocate and call destructors for MDO mutexes methods_do(method_release_C_heap_structures); -} - -void InstanceKlass::release_C_heap_structures_internal() { - Klass::release_C_heap_structures(); - - // Can't release the constant pool here because the constant pool can be - // deallocated separately from the InstanceKlass for default methods and - // redefine classes. // Deallocate oop map cache if (_oop_map_cache != NULL) { @@ -2732,6 +2727,10 @@ void InstanceKlass::release_C_heap_structures_internal() { #endif FREE_C_HEAP_ARRAY(char, _source_debug_extension); + + if (release_constant_pool) { + constants()->release_C_heap_structures(); + } } void InstanceKlass::set_source_debug_extension(const char* array, int length) { @@ -3988,8 +3987,6 @@ void InstanceKlass::purge_previous_version_list() { // so will be deallocated during the next phase of class unloading. log_trace(redefine, class, iklass, purge) ("previous version " INTPTR_FORMAT " is dead.", p2i(pv_node)); - // For debugging purposes. - pv_node->set_is_scratch_class(); // Unlink from previous version list. assert(pv_node->class_loader_data() == loader_data, "wrong loader_data"); InstanceKlass* next = pv_node->previous_versions(); @@ -4104,8 +4101,6 @@ void InstanceKlass::add_previous_version(InstanceKlass* scratch_class, ConstantPool* cp_ref = scratch_class->constants(); if (!cp_ref->on_stack()) { log_trace(redefine, class, iklass, add)("scratch class not added; no methods are running"); - // For debugging purposes. - scratch_class->set_is_scratch_class(); scratch_class->class_loader_data()->add_to_deallocate_list(scratch_class); return; } diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index a7be3ba1852..dd5da29edf2 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -1101,7 +1101,7 @@ public: // callbacks for actions during class unloading static void unload_class(InstanceKlass* ik); - virtual void release_C_heap_structures(); + virtual void release_C_heap_structures(bool release_constant_pool = true); // Naming const char* signature_name() const; @@ -1218,9 +1218,6 @@ private: StaticLookupMode static_mode, PrivateLookupMode private_mode); - // Free CHeap allocated fields. - void release_C_heap_structures_internal(); - #if INCLUDE_JVMTI // RedefineClasses support void link_previous_versions(InstanceKlass* pv) { _previous_versions = pv; } diff --git a/src/hotspot/share/oops/klass.cpp b/src/hotspot/share/oops/klass.cpp index cfb46816709..f431c2425d8 100644 --- a/src/hotspot/share/oops/klass.cpp +++ b/src/hotspot/share/oops/klass.cpp @@ -105,7 +105,7 @@ bool Klass::is_subclass_of(const Klass* k) const { return false; } -void Klass::release_C_heap_structures() { +void Klass::release_C_heap_structures(bool release_constant_pool) { if (_name != NULL) _name->decrement_refcount(); } diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp index b34b4fd8255..94f65053dad 100644 --- a/src/hotspot/share/oops/klass.hpp +++ b/src/hotspot/share/oops/klass.hpp @@ -661,7 +661,7 @@ protected: Symbol* name() const { return _name; } void set_name(Symbol* n); - virtual void release_C_heap_structures(); + virtual void release_C_heap_structures(bool release_constant_pool = true); public: virtual jint compute_modifier_flags() const = 0; diff --git a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp index 62fdd2160f5..89e41730ed9 100644 --- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp +++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp @@ -4404,6 +4404,9 @@ void VM_RedefineClasses::redefine_single_class(Thread* current, jclass the_jclas the_class->set_has_been_redefined(); + // Scratch class is unloaded but still needs cleaning, and skipping for CDS. + scratch_class->set_is_scratch_class(); + // keep track of previous versions of this class the_class->add_previous_version(scratch_class, emcp_method_count); -- GitLab From a29273336bae75e8d185fa7f7c789acbec50a619 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Wed, 27 Oct 2021 12:27:43 +0000 Subject: [PATCH 089/890] 8275975: Remove dead code in ciInstanceKlass Reviewed-by: chagedorn, kvn --- src/hotspot/share/ci/ciArrayKlass.hpp | 1 - src/hotspot/share/ci/ciInstanceKlass.cpp | 5 ----- src/hotspot/share/ci/ciInstanceKlass.hpp | 9 --------- 3 files changed, 15 deletions(-) diff --git a/src/hotspot/share/ci/ciArrayKlass.hpp b/src/hotspot/share/ci/ciArrayKlass.hpp index f801c4399e9..a64d80b20f3 100644 --- a/src/hotspot/share/ci/ciArrayKlass.hpp +++ b/src/hotspot/share/ci/ciArrayKlass.hpp @@ -54,7 +54,6 @@ public: // What kind of vmObject is this? bool is_array_klass() const { return true; } - bool is_java_klass() const { return true; } static ciArrayKlass* make(ciType* element_type); }; diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp index b637bec1d53..cc361744149 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.cpp +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp @@ -63,7 +63,6 @@ ciInstanceKlass::ciInstanceKlass(Klass* k) : _has_finalizer = access_flags.has_finalizer(); _has_subklass = flags().is_final() ? subklass_false : subklass_unknown; _init_state = ik->init_state(); - _nonstatic_field_size = ik->nonstatic_field_size(); _has_nonstatic_fields = ik->has_nonstatic_fields(); _has_nonstatic_concrete_methods = ik->has_nonstatic_concrete_methods(); _is_hidden = ik->is_hidden(); @@ -123,7 +122,6 @@ ciInstanceKlass::ciInstanceKlass(ciSymbol* name, { assert(name->char_at(0) != JVM_SIGNATURE_ARRAY, "not an instance klass"); _init_state = (InstanceKlass::ClassState)0; - _nonstatic_field_size = -1; _has_nonstatic_fields = false; _nonstatic_fields = NULL; _has_injected_fields = -1; @@ -496,9 +494,6 @@ int ciInstanceKlass::compute_nonstatic_fields() { } assert(!is_java_lang_Object(), "bootstrap OK"); - // Size in bytes of my fields, including inherited fields. - int fsize = nonstatic_field_size() * heapOopSize; - ciInstanceKlass* super = this->super(); GrowableArray* super_fields = NULL; if (super != NULL && super->has_nonstatic_fields()) { diff --git a/src/hotspot/share/ci/ciInstanceKlass.hpp b/src/hotspot/share/ci/ciInstanceKlass.hpp index d77d9c4c277..3e79198eddb 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.hpp +++ b/src/hotspot/share/ci/ciInstanceKlass.hpp @@ -61,8 +61,6 @@ private: bool _is_record; ciFlags _flags; - jint _nonstatic_field_size; - jint _nonstatic_oop_map_size; // Lazy fields get filled in only upon request. ciInstanceKlass* _super; @@ -173,15 +171,9 @@ public: return (Klass::layout_helper_size_in_bytes(layout_helper()) >> LogHeapWordSize); } - jint nonstatic_field_size() { - assert(is_loaded(), "must be loaded"); - return _nonstatic_field_size; } jint has_nonstatic_fields() { assert(is_loaded(), "must be loaded"); return _has_nonstatic_fields; } - jint nonstatic_oop_map_size() { - assert(is_loaded(), "must be loaded"); - return _nonstatic_oop_map_size; } ciInstanceKlass* super(); jint nof_implementors() { ciInstanceKlass* impl; @@ -283,7 +275,6 @@ public: // What kind of ciObject is this? bool is_instance_klass() const { return true; } - bool is_java_klass() const { return true; } virtual ciKlass* exact_klass() { if (is_loaded() && is_final() && !is_interface()) { -- GitLab From 168081efc8af1f5d1d7524246eb4a0675bd49ae0 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 27 Oct 2021 12:39:46 +0000 Subject: [PATCH 090/890] 8270490: Charset.forName() taking fallback default value Reviewed-by: joehw, rriggs, serb, dfuchs --- .../share/classes/java/io/Console.java | 11 +-- .../classes/java/nio/charset/Charset.java | 33 +++++++++ .../jdk/java/nio/charset/Charset/ForName.java | 73 +++++++++++++++++++ 3 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 test/jdk/java/nio/charset/Charset/ForName.java diff --git a/src/java.base/share/classes/java/io/Console.java b/src/java.base/share/classes/java/io/Console.java index 683d836f85f..c355710da79 100644 --- a/src/java.base/share/classes/java/io/Console.java +++ b/src/java.base/share/classes/java/io/Console.java @@ -582,17 +582,12 @@ public final class Console implements Flushable csname = GetPropertyAction.privilegedGetProperty("sun.stdout.encoding"); } if (csname != null) { - try { - cs = Charset.forName(csname); - } catch (Exception ignored) { } + cs = Charset.forName(csname, null); } } if (cs == null) { - try { - cs = Charset.forName(StaticProperty.nativeEncoding()); - } catch (Exception ignored) { - cs = Charset.defaultCharset(); - } + cs = Charset.forName(StaticProperty.nativeEncoding(), + Charset.defaultCharset()); } CHARSET = cs; diff --git a/src/java.base/share/classes/java/nio/charset/Charset.java b/src/java.base/share/classes/java/nio/charset/Charset.java index f44ae78bae5..e2afa2bd62e 100644 --- a/src/java.base/share/classes/java/nio/charset/Charset.java +++ b/src/java.base/share/classes/java/nio/charset/Charset.java @@ -527,6 +527,39 @@ public abstract class Charset throw new UnsupportedCharsetException(charsetName); } + /** + * Returns a charset object for the named charset. If the charset object + * for the named charset is not available or {@code charsetName} is not a + * legal charset name, then {@code fallback} is returned. + * + * @param charsetName + * The name of the requested charset; may be either + * a canonical name or an alias + * + * @param fallback + * fallback charset in case the charset object for the named + * charset is not available or {@code charsetName} is not a legal + * charset name. May be {@code null} + * + * @return A charset object for the named charset, or {@code fallback} + * in case the charset object for the named charset is not + * available or {@code charsetName} is not a legal charset name + * + * @throws IllegalArgumentException + * If the given {@code charsetName} is {@code null} + * + * @since 18 + */ + public static Charset forName(String charsetName, + Charset fallback) { + try { + Charset cs = lookup(charsetName); + return cs != null ? cs : fallback; + } catch (IllegalCharsetNameException icne) { + return fallback; + } + } + // Fold charsets from the given iterator into the given map, ignoring // charsets whose names already have entries in the map. // diff --git a/test/jdk/java/nio/charset/Charset/ForName.java b/test/jdk/java/nio/charset/Charset/ForName.java new file mode 100644 index 00000000000..d8a1e2f72d3 --- /dev/null +++ b/test/jdk/java/nio/charset/Charset/ForName.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021, 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 + * @summary Unit test for forName(String, Charset) + * @bug 8270490 + * @modules jdk.charsets + * @run testng ForName + */ + +import java.nio.charset.Charset; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.StandardCharsets; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +@Test +public class ForName { + + @DataProvider + Object[][] params() { + return new Object[][] { + {"UTF-8", null, StandardCharsets.UTF_8}, + {"UTF-8", StandardCharsets.US_ASCII, StandardCharsets.UTF_8}, + {"windows-31j", StandardCharsets.US_ASCII, Charset.forName("windows-31j")}, + {"foo", StandardCharsets.US_ASCII, StandardCharsets.US_ASCII}, + {"foo", null, null}, + {"\u3042", null, null}, + {"\u3042", StandardCharsets.UTF_8, StandardCharsets.UTF_8}, + }; + } + + @DataProvider + Object[][] paramsIAE() { + return new Object[][] { + {null, null}, + {null, StandardCharsets.UTF_8}, + }; + } + + @Test(dataProvider="params") + public void testForName_2arg(String name, Charset fallback, Charset expected) throws Exception { + var cs = Charset.forName(name, fallback); + assertEquals(cs, expected); + } + + @Test(dataProvider="paramsIAE", expectedExceptions=IllegalArgumentException.class) + public void testForName_2arg_IAE(String name, Charset fallback) throws Exception { + Charset.forName(name, fallback); + } +} -- GitLab From 93be099ccb73c88532866ae6d0c288c12a592cc4 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Wed, 27 Oct 2021 13:23:24 +0000 Subject: [PATCH 091/890] 4718400: Many quantities are held as signed that should be unsigned Reviewed-by: coleenp, rbackman, dholmes --- src/hotspot/share/cds/heapShared.cpp | 8 ++++---- src/hotspot/share/classfile/javaClasses.cpp | 7 ++++--- src/hotspot/share/classfile/javaClasses.hpp | 4 ++-- .../share/classfile/javaClasses.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 2 +- .../gc/g1/g1ConcurrentMarkBitMap.inline.hpp | 2 +- .../g1/g1ConcurrentMarkObjArrayProcessor.cpp | 4 ++-- ...ConcurrentMarkObjArrayProcessor.inline.hpp | 2 +- .../share/gc/g1/g1RegionMarkStatsCache.cpp | 2 +- src/hotspot/share/gc/g1/g1YoungCollector.cpp | 2 +- .../gc/g1/g1YoungGCPostEvacuateTasks.cpp | 2 +- src/hotspot/share/gc/g1/heapRegion.inline.hpp | 2 +- .../share/gc/parallel/parMarkBitMap.hpp | 2 +- .../gc/parallel/parMarkBitMap.inline.hpp | 4 ++-- .../share/gc/parallel/psClosure.inline.hpp | 2 +- .../gc/parallel/psParallelCompact.inline.hpp | 2 +- .../share/gc/serial/defNewGeneration.cpp | 2 +- src/hotspot/share/gc/serial/markSweep.hpp | 2 +- .../share/gc/serial/markSweep.inline.hpp | 2 +- .../share/gc/shared/cardTableBarrierSet.cpp | 2 +- src/hotspot/share/gc/shared/collectedHeap.hpp | 6 +++--- .../share/gc/shared/collectedHeap.inline.hpp | 6 +++--- .../share/gc/shared/genCollectedHeap.cpp | 2 +- src/hotspot/share/gc/shared/generation.cpp | 2 +- src/hotspot/share/gc/shared/memAllocator.cpp | 2 +- src/hotspot/share/gc/shared/space.cpp | 2 +- src/hotspot/share/gc/shared/space.inline.hpp | 2 +- .../share/gc/shenandoah/shenandoahFullGC.cpp | 2 +- .../gc/shenandoah/shenandoahHeap.inline.hpp | 2 +- src/hotspot/share/gc/z/zCollectedHeap.cpp | 2 +- src/hotspot/share/gc/z/zCollectedHeap.hpp | 2 +- .../jfr/leakprofiler/chains/edgeUtils.cpp | 5 +++-- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 7 ++++--- src/hotspot/share/memory/heapInspection.hpp | 16 --------------- src/hotspot/share/oops/arrayKlass.cpp | 2 +- src/hotspot/share/oops/instanceKlass.cpp | 8 ++++---- src/hotspot/share/oops/instanceKlass.hpp | 2 +- .../share/oops/instanceMirrorKlass.cpp | 8 ++++---- .../share/oops/instanceMirrorKlass.hpp | 4 ++-- src/hotspot/share/oops/klass.hpp | 4 ++-- src/hotspot/share/oops/objArrayKlass.cpp | 6 ++---- src/hotspot/share/oops/objArrayKlass.hpp | 2 +- src/hotspot/share/oops/objArrayOop.hpp | 6 +++--- src/hotspot/share/oops/oop.hpp | 8 ++++---- src/hotspot/share/oops/oop.inline.hpp | 20 +++++++++---------- src/hotspot/share/oops/typeArrayKlass.cpp | 4 ++-- src/hotspot/share/oops/typeArrayKlass.hpp | 2 +- src/hotspot/share/oops/typeArrayOop.hpp | 6 +++--- .../share/oops/typeArrayOop.inline.hpp | 2 +- src/hotspot/share/opto/runtime.cpp | 2 +- src/hotspot/share/prims/jvm.cpp | 2 +- src/hotspot/share/runtime/deoptimization.cpp | 2 +- 52 files changed, 95 insertions(+), 110 deletions(-) diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index 7d88f802f90..aa4694168c1 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -429,7 +429,7 @@ void HeapShared::copy_open_objects(GrowableArray* open_regions) { // Copy _pending_archive_roots into an objArray void HeapShared::copy_roots() { int length = _pending_roots != NULL ? _pending_roots->length() : 0; - int size = objArrayOopDesc::object_size(length); + size_t size = objArrayOopDesc::object_size(length); Klass* k = Universe::objectArrayKlassObj(); // already relocated to point to archived klass HeapWord* mem = G1CollectedHeap::heap()->archive_mem_allocate(size); @@ -448,7 +448,7 @@ void HeapShared::copy_roots() { for (int i = 0; i < length; i++) { roots()->obj_at_put(i, _pending_roots->at(i)); } - log_info(cds)("archived obj roots[%d] = %d words, klass = %p, obj = %p", length, size, k, mem); + log_info(cds)("archived obj roots[%d] = " SIZE_FORMAT " words, klass = %p, obj = %p", length, size, k, mem); } void HeapShared::init_narrow_oop_decoding(address base, int shift) { @@ -912,7 +912,7 @@ class WalkOopAndArchiveClosure: public BasicOopIterateClosure { if (!_record_klasses_only && log_is_enabled(Debug, cds, heap)) { ResourceMark rm; - log_debug(cds, heap)("(%d) %s[" SIZE_FORMAT "] ==> " PTR_FORMAT " size %d %s", _level, + log_debug(cds, heap)("(%d) %s[" SIZE_FORMAT "] ==> " PTR_FORMAT " size " SIZE_FORMAT " %s", _level, _orig_referencing_obj->klass()->external_name(), field_delta, p2i(obj), obj->size() * HeapWordSize, obj->klass()->external_name()); LogTarget(Trace, cds, heap) log; @@ -1023,7 +1023,7 @@ oop HeapShared::archive_reachable_objects_from(int level, ResourceMark rm; log_error(cds, heap)( "Cannot archive the sub-graph referenced from %s object (" - PTR_FORMAT ") size %d, skipped.", + PTR_FORMAT ") size " SIZE_FORMAT ", skipped.", orig_obj->klass()->external_name(), p2i(orig_obj), orig_obj->size() * HeapWordSize); if (level == 1) { // Don't archive a subgraph root that's too big. For archives static fields, that's OK diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index ef0b5ad429a..63d1eeb7986 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -1377,10 +1377,11 @@ void java_lang_Class::fixup_module_field(Klass* k, Handle module) { java_lang_Class::set_module(k->java_mirror(), module()); } -void java_lang_Class::set_oop_size(HeapWord* java_class, int size) { +void java_lang_Class::set_oop_size(HeapWord* java_class, size_t size) { assert(_oop_size_offset != 0, "must be set"); - assert(size > 0, "Oop size must be greater than zero, not %d", size); - *(int*)(((char*)java_class) + _oop_size_offset) = size; + assert(size > 0, "Oop size must be greater than zero, not " SIZE_FORMAT, size); + assert(size <= INT_MAX, "Lossy conversion: " SIZE_FORMAT, size); + *(int*)(((char*)java_class) + _oop_size_offset) = (int)size; } int java_lang_Class::static_oop_field_count(oop java_class) { diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp index 62481fbcc1a..8a2d5fdf24c 100644 --- a/src/hotspot/share/classfile/javaClasses.hpp +++ b/src/hotspot/share/classfile/javaClasses.hpp @@ -365,8 +365,8 @@ class java_lang_Class : AllStatic { static oop source_file(oop java_class); static void set_source_file(oop java_class, oop source_file); - static int oop_size(oop java_class); - static void set_oop_size(HeapWord* java_class, int size); + static size_t oop_size(oop java_class); + static void set_oop_size(HeapWord* java_class, size_t size); static int static_oop_field_count(oop java_class); static void set_static_oop_field_count(oop java_class, int size); diff --git a/src/hotspot/share/classfile/javaClasses.inline.hpp b/src/hotspot/share/classfile/javaClasses.inline.hpp index ef21f56d9a4..f3f2b2a7e27 100644 --- a/src/hotspot/share/classfile/javaClasses.inline.hpp +++ b/src/hotspot/share/classfile/javaClasses.inline.hpp @@ -261,7 +261,7 @@ inline bool java_lang_Class::is_primitive(oop java_class) { return is_primitive; } -inline int java_lang_Class::oop_size(oop java_class) { +inline size_t java_lang_Class::oop_size(oop java_class) { assert(_oop_size_offset != 0, "must be set"); int size = java_class->int_field(_oop_size_offset); assert(size > 0, "Oop size must be greater than zero, not %d", size); diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index a768fce2292..9d533cb89cb 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -965,7 +965,7 @@ void G1ConcurrentMark::scan_root_region(const MemRegion* region, uint worker_id) while (curr < end) { Prefetch::read(curr, interval); oop obj = cast_to_oop(curr); - int size = obj->oop_iterate_size(&cl); + size_t size = obj->oop_iterate_size(&cl); assert(size == obj->size(), "sanity"); curr += size; } diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp index ea542bec7a8..a6b9cdc7d7c 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp @@ -46,7 +46,7 @@ inline bool G1CMBitMap::iterate(G1CMBitMapClosure* cl, MemRegion mr) { if (!cl->do_addr(addr)) { return false; } - size_t const obj_size = (size_t)cast_to_oop(addr)->size(); + size_t const obj_size = cast_to_oop(addr)->size(); offset = _bm.get_next_one_offset(offset + (obj_size >> _shifter), end_offset); } return true; diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp index 81f377d2b68..2cac3c4b61b 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp @@ -43,9 +43,9 @@ size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* sta } size_t G1CMObjArrayProcessor::process_obj(oop obj) { - assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), (size_t)obj->size()); + assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), obj->size()); - return process_array_slice(objArrayOop(obj), cast_from_oop(obj), (size_t)objArrayOop(obj)->size()); + return process_array_slice(objArrayOop(obj), cast_from_oop(obj), objArrayOop(obj)->size()); } size_t G1CMObjArrayProcessor::process_slice(HeapWord* slice) { diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp index d72711c73f7..3b9944f5815 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp @@ -32,7 +32,7 @@ #include "runtime/globals.hpp" inline bool G1CMObjArrayProcessor::should_be_sliced(oop obj) { - return obj->is_objArray() && ((size_t)((objArrayOop)obj)->size()) >= 2 * ObjArrayMarkingStride; + return obj->is_objArray() && ((objArrayOop)obj)->size() >= 2 * ObjArrayMarkingStride; } #endif // SHARE_GC_G1_G1CONCURRENTMARKOBJARRAYPROCESSOR_INLINE_HPP diff --git a/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp b/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp index db9f91641ba..f8ce06237c1 100644 --- a/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp +++ b/src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp @@ -47,7 +47,7 @@ G1RegionMarkStatsCache::~G1RegionMarkStatsCache() { void G1RegionMarkStatsCache::add_live_words(oop obj) { uint region_index = G1CollectedHeap::heap()->addr_to_region(cast_from_oop(obj)); - add_live_words(region_index, (size_t) obj->size()); + add_live_words(region_index, obj->size()); } // Evict all remaining statistics, returning cache hits and misses. diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.cpp b/src/hotspot/share/gc/g1/g1YoungCollector.cpp index dafa9b1a587..c900c1ce248 100644 --- a/src/hotspot/share/gc/g1/g1YoungCollector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungCollector.cpp @@ -433,7 +433,7 @@ class G1PrepareEvacuationTask : public WorkerTask { } log_debug(gc, humongous)("Humongous region %u (object size " SIZE_FORMAT " @ " PTR_FORMAT ") remset " SIZE_FORMAT " code roots " SIZE_FORMAT " marked %d reclaim candidate %d type array %d", index, - (size_t)cast_to_oop(hr->bottom())->size() * HeapWordSize, + cast_to_oop(hr->bottom())->size() * HeapWordSize, p2i(hr->bottom()), hr->rem_set()->occupied(), hr->rem_set()->strong_code_roots_list_length(), diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp index bfe47d1c7ea..2529d5322ef 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp @@ -204,7 +204,7 @@ public: log_debug(gc, humongous)("Reclaimed humongous region %u (object size " SIZE_FORMAT " @ " PTR_FORMAT ")", region_idx, - (size_t)obj->size() * HeapWordSize, + obj->size() * HeapWordSize, p2i(r->bottom()) ); diff --git a/src/hotspot/share/gc/g1/heapRegion.inline.hpp b/src/hotspot/share/gc/g1/heapRegion.inline.hpp index 88404901c3a..91ade8a5029 100644 --- a/src/hotspot/share/gc/g1/heapRegion.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.inline.hpp @@ -327,7 +327,7 @@ HeapWord* HeapRegion::do_oops_on_memregion_in_humongous(MemRegion mr, // If obj is not an objArray and mr contains the start of the // obj, then this could be an imprecise mark, and we need to // process the entire object. - int size = obj->oop_iterate_size(cl); + size_t size = obj->oop_iterate_size(cl); // We have scanned to the end of the object, but since there can be no objects // after this humongous object in the region, we can return the end of the // region if it is greater. diff --git a/src/hotspot/share/gc/parallel/parMarkBitMap.hpp b/src/hotspot/share/gc/parallel/parMarkBitMap.hpp index ed08fed4eb7..7713af6e7a6 100644 --- a/src/hotspot/share/gc/parallel/parMarkBitMap.hpp +++ b/src/hotspot/share/gc/parallel/parMarkBitMap.hpp @@ -46,7 +46,7 @@ public: // Atomically mark an object as live. bool mark_obj(HeapWord* addr, size_t size); - inline bool mark_obj(oop obj, int size); + inline bool mark_obj(oop obj, size_t size); // Return whether the specified begin or end bit is set. inline bool is_obj_beg(idx_t bit) const; diff --git a/src/hotspot/share/gc/parallel/parMarkBitMap.inline.hpp b/src/hotspot/share/gc/parallel/parMarkBitMap.inline.hpp index 6b939abd594..600209a961e 100644 --- a/src/hotspot/share/gc/parallel/parMarkBitMap.inline.hpp +++ b/src/hotspot/share/gc/parallel/parMarkBitMap.inline.hpp @@ -144,8 +144,8 @@ inline ParMarkBitMap::IterationStatus ParMarkBitMap::iterate(ParMarkBitMapClosur addr_to_bit(dead_range_end)); } -inline bool ParMarkBitMap::mark_obj(oop obj, int size) { - return mark_obj(cast_from_oop(obj), (size_t)size); +inline bool ParMarkBitMap::mark_obj(oop obj, size_t size) { + return mark_obj(cast_from_oop(obj), size); } inline ParMarkBitMap::idx_t ParMarkBitMap::addr_to_bit(HeapWord* addr) const { diff --git a/src/hotspot/share/gc/parallel/psClosure.inline.hpp b/src/hotspot/share/gc/parallel/psClosure.inline.hpp index 1495f8edac5..cd78583bb80 100644 --- a/src/hotspot/share/gc/parallel/psClosure.inline.hpp +++ b/src/hotspot/share/gc/parallel/psClosure.inline.hpp @@ -45,7 +45,7 @@ public: oop new_obj = o->forwardee(); if (log_develop_is_enabled(Trace, gc, scavenge)) { ResourceMark rm; // required by internal_name() - log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (" SIZE_FORMAT ")}", "forwarding", new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); } diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp b/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp index f353b44d627..001f55c076a 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp @@ -97,7 +97,7 @@ inline void PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* #endif // ASSERT inline bool PSParallelCompact::mark_obj(oop obj) { - const int obj_size = obj->size(); + const size_t obj_size = obj->size(); if (mark_bitmap()->mark_obj(obj, obj_size)) { _summary_data.add_obj(obj, obj_size); return true; diff --git a/src/hotspot/share/gc/serial/defNewGeneration.cpp b/src/hotspot/share/gc/serial/defNewGeneration.cpp index 63d33a14ac5..cd5e679cd07 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.cpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp @@ -680,7 +680,7 @@ void DefNewGeneration::restore_preserved_marks() { } void DefNewGeneration::handle_promotion_failure(oop old) { - log_debug(gc, promotion)("Promotion failure size = %d) ", old->size()); + log_debug(gc, promotion)("Promotion failure size = " SIZE_FORMAT ") ", old->size()); _promotion_failed = true; _promotion_failed_info.register_copy_failure(old->size()); diff --git a/src/hotspot/share/gc/serial/markSweep.hpp b/src/hotspot/share/gc/serial/markSweep.hpp index f3e818f3e4c..03d9add1045 100644 --- a/src/hotspot/share/gc/serial/markSweep.hpp +++ b/src/hotspot/share/gc/serial/markSweep.hpp @@ -144,7 +144,7 @@ class MarkSweep : AllStatic { static void adjust_marks(); // Adjust the pointers in the preserved marks table static void restore_marks(); // Restore the marks that we saved in preserve_mark - static int adjust_pointers(oop obj); + static size_t adjust_pointers(oop obj); static void follow_stack(); // Empty marking stack. diff --git a/src/hotspot/share/gc/serial/markSweep.inline.hpp b/src/hotspot/share/gc/serial/markSweep.inline.hpp index 6af4ffe3e3c..ee0ef1e0b1b 100644 --- a/src/hotspot/share/gc/serial/markSweep.inline.hpp +++ b/src/hotspot/share/gc/serial/markSweep.inline.hpp @@ -107,7 +107,7 @@ inline void AdjustPointerClosure::do_oop(oop* p) { do_oop_work(p); } inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); } -inline int MarkSweep::adjust_pointers(oop obj) { +inline size_t MarkSweep::adjust_pointers(oop obj) { return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure); } diff --git a/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp b/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp index b34d0ab5744..d32a414e033 100644 --- a/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp +++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp @@ -168,7 +168,7 @@ void CardTableBarrierSet::flush_deferred_card_mark_barrier(JavaThread* thread) { assert(!_card_table->is_in_young(old_obj), "Else should have been filtered in on_slowpath_allocation_exit()"); assert(oopDesc::is_oop(old_obj, true), "Not an oop"); - assert(deferred.word_size() == (size_t)(old_obj->size()), + assert(deferred.word_size() == old_obj->size(), "Mismatch: multiple objects?"); } write_region(deferred); diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp index 8db274070e4..efac5e76c86 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.hpp +++ b/src/hotspot/share/gc/shared/collectedHeap.hpp @@ -249,9 +249,9 @@ class CollectedHeap : public CHeapObj { void set_gc_cause(GCCause::Cause v); GCCause::Cause gc_cause() { return _gc_cause; } - oop obj_allocate(Klass* klass, int size, TRAPS); - virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS); - oop class_allocate(Klass* klass, int size, TRAPS); + oop obj_allocate(Klass* klass, size_t size, TRAPS); + virtual oop array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS); + oop class_allocate(Klass* klass, size_t size, TRAPS); // Utilities for turning raw memory into filler objects. // diff --git a/src/hotspot/share/gc/shared/collectedHeap.inline.hpp b/src/hotspot/share/gc/shared/collectedHeap.inline.hpp index 89aa64f132d..cd8a2b89d32 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.inline.hpp +++ b/src/hotspot/share/gc/shared/collectedHeap.inline.hpp @@ -31,17 +31,17 @@ #include "oops/oop.inline.hpp" #include "utilities/align.hpp" -inline oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { +inline oop CollectedHeap::obj_allocate(Klass* klass, size_t size, TRAPS) { ObjAllocator allocator(klass, size, THREAD); return allocator.allocate(); } -inline oop CollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) { +inline oop CollectedHeap::array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS) { ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD); return allocator.allocate(); } -inline oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { +inline oop CollectedHeap::class_allocate(Klass* klass, size_t size, TRAPS) { ClassAllocator allocator(klass, size, THREAD); return allocator.allocate(); } diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.cpp b/src/hotspot/share/gc/shared/genCollectedHeap.cpp index 662dbdd9c5f..473e5abc1df 100644 --- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp +++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp @@ -1237,7 +1237,7 @@ oop GenCollectedHeap::handle_failed_promotion(Generation* old_gen, oop obj, size_t obj_size) { guarantee(old_gen == _old_gen, "We only get here with an old generation"); - assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); + assert(obj_size == obj->size(), "bad obj_size passed in"); HeapWord* result = NULL; result = old_gen->expand_and_allocate(obj_size, false); diff --git a/src/hotspot/share/gc/shared/generation.cpp b/src/hotspot/share/gc/shared/generation.cpp index 4c4e7a24e6e..a0a57dea115 100644 --- a/src/hotspot/share/gc/shared/generation.cpp +++ b/src/hotspot/share/gc/shared/generation.cpp @@ -156,7 +156,7 @@ bool Generation::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const // Ignores "ref" and calls allocate(). oop Generation::promote(oop obj, size_t obj_size) { - assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); + assert(obj_size == obj->size(), "bad obj_size passed in"); #ifndef PRODUCT if (GenCollectedHeap::heap()->promotion_should_fail()) { diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp index 50170714819..7a314807af6 100644 --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -423,6 +423,6 @@ oop ClassAllocator::initialize(HeapWord* mem) const { // concurrent GC. assert(_word_size > 0, "oop_size must be positive."); mem_clear(mem); - java_lang_Class::set_oop_size(mem, (int)_word_size); + java_lang_Class::set_oop_size(mem, _word_size); return finish(mem); } diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index a9435ab9163..1638d994e40 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -178,7 +178,7 @@ HeapWord* ContiguousSpaceDCTOC::get_actual_top(HeapWord* top, // Otherwise, it is possible that the object starting on the dirty // card spans the entire card, and that the store happened on a // later card. Figure out where the object ends. - assert(_sp->block_size(top_obj) == (size_t) cast_to_oop(top_obj)->size(), + assert(_sp->block_size(top_obj) == cast_to_oop(top_obj)->size(), "Block size and object size mismatch"); top = top_obj + cast_to_oop(top_obj)->size(); } diff --git a/src/hotspot/share/gc/shared/space.inline.hpp b/src/hotspot/share/gc/shared/space.inline.hpp index 953e8aa9a2f..4a1226b95af 100644 --- a/src/hotspot/share/gc/shared/space.inline.hpp +++ b/src/hotspot/share/gc/shared/space.inline.hpp @@ -116,7 +116,7 @@ public: oop obj = cast_to_oop(dead_start); obj->set_mark(obj->mark().set_marked()); - assert(dead_length == (size_t)obj->size(), "bad filler object size"); + assert(dead_length == obj->size(), "bad filler object size"); log_develop_trace(gc, compaction)("Inserting object to dead space: " PTR_FORMAT ", " PTR_FORMAT ", " SIZE_FORMAT "b", p2i(dead_start), p2i(dead_end), dead_length * HeapWordSize); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp index dfa696e6a5b..893e8238aaa 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp @@ -834,7 +834,7 @@ public: void do_object(oop p) { assert(_heap->complete_marking_context()->is_marked(p), "must be marked"); - size_t size = (size_t)p->size(); + size_t size = p->size(); if (p->is_forwarded()) { HeapWord* compact_from = cast_from_oop(p); HeapWord* compact_to = cast_from_oop(p->forwardee()); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp index 59f5af45b93..1e5cddd49d8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp @@ -513,7 +513,7 @@ inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, oop obj = cast_to_oop(cs); assert(oopDesc::is_oop(obj), "sanity"); assert(ctx->is_marked(obj), "object expected to be marked"); - int size = obj->size(); + size_t size = obj->size(); cl->do_object(obj); cs += size; } diff --git a/src/hotspot/share/gc/z/zCollectedHeap.cpp b/src/hotspot/share/gc/z/zCollectedHeap.cpp index af546dd35e9..e07ec3e80c7 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.cpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp @@ -136,7 +136,7 @@ HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_si return (HeapWord*)addr; } -oop ZCollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) { +oop ZCollectedHeap::array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS) { if (!do_zero) { return CollectedHeap::array_allocate(klass, size, length, false /* do_zero */, THREAD); } diff --git a/src/hotspot/share/gc/z/zCollectedHeap.hpp b/src/hotspot/share/gc/z/zCollectedHeap.hpp index ff6c09a9384..236609361d0 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.hpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp @@ -75,7 +75,7 @@ public: virtual uint32_t hash_oop(oop obj) const; - virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS); + virtual oop array_allocate(Klass* klass, size_t size, int length, bool do_zero, TRAPS); virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded); virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data, size_t size, diff --git a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp index 31d7c4afaf2..ad716905351 100644 --- a/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp +++ b/src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp @@ -48,9 +48,10 @@ static int field_offset(const Edge& edge, const oop ref_owner) { assert(ref_owner->is_instance(), "invariant"); UnifiedOopRef reference = edge.reference(); assert(!reference.is_null(), "invariant"); - const int offset = (int)(reference.addr() - cast_from_oop(ref_owner)); + const size_t offset = (reference.addr() - cast_from_oop(ref_owner)); assert(offset < ref_owner->size() * HeapWordSize, "invariant"); - return offset; + assert(offset <= size_t(INT_MAX), "invariant"); + return (int)offset; } const Symbol* EdgeUtils::field_name(const Edge& edge, jshort* modifiers) { diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 435d456e261..e4e1197d357 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -1045,9 +1045,10 @@ C2V_VMENTRY_NULL(jlongArray, getLineNumberTable, (JNIEnv* env, jobject, jobject int i = 0; jlong value; while (stream.read_pair()) { - value = ((long) stream.bci()); + // FIXME: Why was this long before? + value = ((jlong) stream.bci()); JVMCIENV->put_long_at(result, i, value); - value = ((long) stream.line()); + value = ((jlong) stream.line()); JVMCIENV->put_long_at(result, i + 1, value); i += 2; } @@ -1932,7 +1933,7 @@ C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, } int basic_type_elemsize = type2aelembytes(basic_type); - if (displacement < 0 || ((long) displacement + basic_type_elemsize > HeapWordSize * obj->size())) { + if (displacement < 0 || ((size_t) displacement + basic_type_elemsize > HeapWordSize * obj->size())) { // Reading outside of the object bounds JVMCI_THROW_MSG_NULL(IllegalArgumentException, "reading outside object bounds"); } diff --git a/src/hotspot/share/memory/heapInspection.hpp b/src/hotspot/share/memory/heapInspection.hpp index f8d16225681..1e07a361d54 100644 --- a/src/hotspot/share/memory/heapInspection.hpp +++ b/src/hotspot/share/memory/heapInspection.hpp @@ -153,22 +153,6 @@ class KlassInfoHisto : public StackObj { void print_elements(outputStream* st) const; bool is_selected(const char *col_name); - template static int count_bytes(T* x) { - return (HeapWordSize * ((x) ? (x)->size() : 0)); - } - - template static int count_bytes_array(T* x) { - if (x == NULL) { - return 0; - } - if (x->length() == 0) { - // This is a shared array, e.g., Universe::the_empty_int_array(). Don't - // count it to avoid double-counting. - return 0; - } - return HeapWordSize * x->size(); - } - static void print_julong(outputStream* st, int width, julong n) { int num_spaces = width - julong_width(n); if (num_spaces > 0) { diff --git a/src/hotspot/share/oops/arrayKlass.cpp b/src/hotspot/share/oops/arrayKlass.cpp index 1c753defca5..c28ce0323b7 100644 --- a/src/hotspot/share/oops/arrayKlass.cpp +++ b/src/hotspot/share/oops/arrayKlass.cpp @@ -126,7 +126,7 @@ GrowableArray* ArrayKlass::compute_secondary_supers(int num_extra_slots, objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) { check_array_allocation_length(length, arrayOopDesc::max_array_length(T_ARRAY), CHECK_NULL); - int size = objArrayOopDesc::object_size(length); + size_t size = objArrayOopDesc::object_size(length); Klass* k = array_klass(n+dimension(), CHECK_NULL); ArrayKlass* ak = ArrayKlass::cast(k); objArrayOop o = (objArrayOop)Universe::heap()->array_allocate(ak, size, length, diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 389f0f4f27a..2f385e53672 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1391,7 +1391,7 @@ bool InstanceKlass::is_same_or_direct_interface(Klass *k) const { objArrayOop InstanceKlass::allocate_objArray(int n, int length, TRAPS) { check_array_allocation_length(length, arrayOopDesc::max_array_length(T_OBJECT), CHECK_NULL); - int size = objArrayOopDesc::object_size(length); + size_t size = objArrayOopDesc::object_size(length); Klass* ak = array_klass(n, CHECK_NULL); objArrayOop o = (objArrayOop)Universe::heap()->array_allocate(ak, size, length, /* do_zero */ true, CHECK_NULL); @@ -1416,7 +1416,7 @@ instanceOop InstanceKlass::register_finalizer(instanceOop i, TRAPS) { instanceOop InstanceKlass::allocate_instance(TRAPS) { bool has_finalizer_flag = has_finalizer(); // Query before possible GC - int size = size_helper(); // Query before forming handle. + size_t size = size_helper(); // Query before forming handle. instanceOop i; @@ -3545,7 +3545,7 @@ void InstanceKlass::oop_print_on(oop obj, outputStream* st) { } } - st->print_cr(BULLET"---- fields (total size %d words):", oop_size(obj)); + st->print_cr(BULLET"---- fields (total size " SIZE_FORMAT " words):", oop_size(obj)); FieldPrinter print_field(st, obj); print_nonstatic_fields(&print_field); @@ -3555,7 +3555,7 @@ void InstanceKlass::oop_print_on(oop obj, outputStream* st) { st->cr(); Klass* real_klass = java_lang_Class::as_Klass(obj); if (real_klass != NULL && real_klass->is_instance_klass()) { - st->print_cr(BULLET"---- static fields (%d words):", java_lang_Class::static_oop_field_count(obj)); + st->print_cr(BULLET"---- static fields (%d):", java_lang_Class::static_oop_field_count(obj)); InstanceKlass::cast(real_klass)->do_local_static_fields(&print_field); } } else if (this == vmClasses::MethodType_klass()) { diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index dd5da29edf2..a3e8da4c8a4 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -993,7 +993,7 @@ public: GrowableArray* compute_secondary_supers(int num_extra_slots, Array* transitive_interfaces); bool can_be_primary_super_slow() const; - int oop_size(oop obj) const { return size_helper(); } + size_t oop_size(oop obj) const { return size_helper(); } // slow because it's a virtual call and used for verifying the layout_helper. // Using the layout_helper bits, we can call is_instance_klass without a virtual call. DEBUG_ONLY(bool is_instance_klass_slow() const { return true; }) diff --git a/src/hotspot/share/oops/instanceMirrorKlass.cpp b/src/hotspot/share/oops/instanceMirrorKlass.cpp index e405b104826..058e28b469a 100644 --- a/src/hotspot/share/oops/instanceMirrorKlass.cpp +++ b/src/hotspot/share/oops/instanceMirrorKlass.cpp @@ -38,7 +38,7 @@ int InstanceMirrorKlass::_offset_of_static_fields = 0; -int InstanceMirrorKlass::instance_size(Klass* k) { +size_t InstanceMirrorKlass::instance_size(Klass* k) { if (k != NULL && k->is_instance_klass()) { return align_object_size(size_helper() + InstanceKlass::cast(k)->static_field_size()); } @@ -47,15 +47,15 @@ int InstanceMirrorKlass::instance_size(Klass* k) { instanceOop InstanceMirrorKlass::allocate_instance(Klass* k, TRAPS) { // Query before forming handle. - int size = instance_size(k); - assert(size > 0, "total object size must be positive: %d", size); + size_t size = instance_size(k); + assert(size > 0, "total object size must be non-zero: " SIZE_FORMAT, size); // Since mirrors can be variable sized because of the static fields, store // the size in the mirror itself. return (instanceOop)Universe::heap()->class_allocate(this, size, THREAD); } -int InstanceMirrorKlass::oop_size(oop obj) const { +size_t InstanceMirrorKlass::oop_size(oop obj) const { return java_lang_Class::oop_size(obj); } diff --git a/src/hotspot/share/oops/instanceMirrorKlass.hpp b/src/hotspot/share/oops/instanceMirrorKlass.hpp index d5a7be454a1..154151932f7 100644 --- a/src/hotspot/share/oops/instanceMirrorKlass.hpp +++ b/src/hotspot/share/oops/instanceMirrorKlass.hpp @@ -65,7 +65,7 @@ class InstanceMirrorKlass: public InstanceKlass { } // Returns the size of the instance including the extra static fields. - virtual int oop_size(oop obj) const; + virtual size_t oop_size(oop obj) const; // Static field offset is an offset into the Heap, should be converted by // based on UseCompressedOop for traversal @@ -86,7 +86,7 @@ class InstanceMirrorKlass: public InstanceKlass { int compute_static_oop_field_count(oop obj); // Given a Klass return the size of the instance - int instance_size(Klass* k); + size_t instance_size(Klass* k); // allocation instanceOop allocate_instance(Klass* k, TRAPS); diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp index 94f65053dad..d72d1c71103 100644 --- a/src/hotspot/share/oops/klass.hpp +++ b/src/hotspot/share/oops/klass.hpp @@ -549,8 +549,8 @@ protected: // ALL FUNCTIONS BELOW THIS POINT ARE DISPATCHED FROM AN OOP // These functions describe behavior for the oop not the KLASS. - // actual oop size of obj in memory - virtual int oop_size(oop obj) const = 0; + // actual oop size of obj in memory in word size. + virtual size_t oop_size(oop obj) const = 0; // Size of klass in word size. virtual int size() const = 0; diff --git a/src/hotspot/share/oops/objArrayKlass.cpp b/src/hotspot/share/oops/objArrayKlass.cpp index da75ec35ecb..fab9bd35487 100644 --- a/src/hotspot/share/oops/objArrayKlass.cpp +++ b/src/hotspot/share/oops/objArrayKlass.cpp @@ -155,20 +155,18 @@ ObjArrayKlass::ObjArrayKlass(int n, Klass* element_klass, Symbol* name) : ArrayK assert(is_objArray_klass(), "sanity"); } -int ObjArrayKlass::oop_size(oop obj) const { +size_t ObjArrayKlass::oop_size(oop obj) const { assert(obj->is_objArray(), "must be object array"); return objArrayOop(obj)->object_size(); } objArrayOop ObjArrayKlass::allocate(int length, TRAPS) { check_array_allocation_length(length, arrayOopDesc::max_array_length(T_OBJECT), CHECK_NULL); - int size = objArrayOopDesc::object_size(length); + size_t size = objArrayOopDesc::object_size(length); return (objArrayOop)Universe::heap()->array_allocate(this, size, length, /* do_zero */ true, THREAD); } -static int multi_alloc_counter = 0; - oop ObjArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) { int length = *sizes; // Call to lower_dimension uses this pointer, so most be called before a diff --git a/src/hotspot/share/oops/objArrayKlass.hpp b/src/hotspot/share/oops/objArrayKlass.hpp index 6b33e9f2da4..e4bd54b9ed1 100644 --- a/src/hotspot/share/oops/objArrayKlass.hpp +++ b/src/hotspot/share/oops/objArrayKlass.hpp @@ -72,7 +72,7 @@ class ObjArrayKlass : public ArrayKlass { GrowableArray* compute_secondary_supers(int num_extra_slots, Array* transitive_interfaces); DEBUG_ONLY(bool is_objArray_klass_slow() const { return true; }) - int oop_size(oop obj) const; + size_t oop_size(oop obj) const; // Allocation static ObjArrayKlass* allocate_objArray_klass(ClassLoaderData* loader_data, diff --git a/src/hotspot/share/oops/objArrayOop.hpp b/src/hotspot/share/oops/objArrayOop.hpp index 3ebf1736455..e1a6226f88a 100644 --- a/src/hotspot/share/oops/objArrayOop.hpp +++ b/src/hotspot/share/oops/objArrayOop.hpp @@ -91,15 +91,15 @@ private: // Sizing static int header_size() { return arrayOopDesc::header_size(T_OBJECT); } - int object_size() { return object_size(length()); } + size_t object_size() { return object_size(length()); } - static int object_size(int length) { + static size_t object_size(int length) { // This returns the object size in HeapWords. uint asz = array_size(length); uint osz = align_object_size(header_size() + asz); assert(osz >= asz, "no overflow"); assert((int)osz > 0, "no overflow"); - return (int)osz; + return (size_t)osz; } Klass* element_klass(); diff --git a/src/hotspot/share/oops/oop.hpp b/src/hotspot/share/oops/oop.hpp index 3232496bef4..82335faea05 100644 --- a/src/hotspot/share/oops/oop.hpp +++ b/src/hotspot/share/oops/oop.hpp @@ -102,11 +102,11 @@ class oopDesc { inline bool is_a(Klass* k) const; // Returns the actual oop size of the object - inline int size(); + inline size_t size(); // Sometimes (for complicated concurrency-related reasons), it is useful // to be able to figure out the size of an object knowing its klass. - inline int size_given_klass(Klass* klass); + inline size_t size_given_klass(Klass* klass); // type test operations (inlined in oop.inline.hpp) inline bool is_instance() const; @@ -272,10 +272,10 @@ class oopDesc { inline void oop_iterate(OopClosureType* cl, MemRegion mr); template - inline int oop_iterate_size(OopClosureType* cl); + inline size_t oop_iterate_size(OopClosureType* cl); template - inline int oop_iterate_size(OopClosureType* cl, MemRegion mr); + inline size_t oop_iterate_size(OopClosureType* cl, MemRegion mr); template inline void oop_iterate_backwards(OopClosureType* cl); diff --git a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp index ff1c6c56afa..c161e479deb 100644 --- a/src/hotspot/share/oops/oop.inline.hpp +++ b/src/hotspot/share/oops/oop.inline.hpp @@ -143,13 +143,13 @@ bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); } -int oopDesc::size() { +size_t oopDesc::size() { return size_given_klass(klass()); } -int oopDesc::size_given_klass(Klass* klass) { +size_t oopDesc::size_given_klass(Klass* klass) { int lh = klass->layout_helper(); - int s; + size_t s; // lh is now a value computed at class initialization that may hint // at the size. For instances, this is positive and equal to the @@ -182,7 +182,7 @@ int oopDesc::size_given_klass(Klass* klass) { // This code could be simplified, but by keeping array_header_in_bytes // in units of bytes and doing it this way we can round up just once, // skipping the intermediate round to HeapWordSize. - s = (int)(align_up(size_in_bytes, MinObjAlignmentInBytes) / HeapWordSize); + s = align_up(size_in_bytes, MinObjAlignmentInBytes) / HeapWordSize; // UseParallelGC and UseG1GC can change the length field // of an "old copy" of an object array in the young gen so it indicates @@ -198,8 +198,8 @@ int oopDesc::size_given_klass(Klass* klass) { } } - assert(s > 0, "Oop size must be greater than zero, not %d", s); - assert(is_object_aligned(s), "Oop size is not properly aligned: %d", s); + assert(s > 0, "Oop size must be greater than zero, not " SIZE_FORMAT, s); + assert(is_object_aligned(s), "Oop size is not properly aligned: " SIZE_FORMAT, s); return s; } @@ -322,17 +322,17 @@ void oopDesc::oop_iterate(OopClosureType* cl, MemRegion mr) { } template -int oopDesc::oop_iterate_size(OopClosureType* cl) { +size_t oopDesc::oop_iterate_size(OopClosureType* cl) { Klass* k = klass(); - int size = size_given_klass(k); + size_t size = size_given_klass(k); OopIteratorClosureDispatch::oop_oop_iterate(cl, this, k); return size; } template -int oopDesc::oop_iterate_size(OopClosureType* cl, MemRegion mr) { +size_t oopDesc::oop_iterate_size(OopClosureType* cl, MemRegion mr) { Klass* k = klass(); - int size = size_given_klass(k); + size_t size = size_given_klass(k); OopIteratorClosureDispatch::oop_oop_iterate(cl, this, k, mr); return size; } diff --git a/src/hotspot/share/oops/typeArrayKlass.cpp b/src/hotspot/share/oops/typeArrayKlass.cpp index d15afe8537d..c79cc61e39a 100644 --- a/src/hotspot/share/oops/typeArrayKlass.cpp +++ b/src/hotspot/share/oops/typeArrayKlass.cpp @@ -90,7 +90,7 @@ typeArrayOop TypeArrayKlass::allocate_common(int length, bool do_zero, TRAPS) { assert(log2_element_size() >= 0, "bad scale"); check_array_allocation_length(length, max_length(), CHECK_NULL); size_t size = typeArrayOopDesc::object_size(layout_helper(), length); - return (typeArrayOop)Universe::heap()->array_allocate(this, (int)size, length, + return (typeArrayOop)Universe::heap()->array_allocate(this, size, length, do_zero, CHECK_NULL); } @@ -227,7 +227,7 @@ Klass* TypeArrayKlass::array_klass_or_null() { return array_klass_or_null(dimension() + 1); } -int TypeArrayKlass::oop_size(oop obj) const { +size_t TypeArrayKlass::oop_size(oop obj) const { assert(obj->is_typeArray(),"must be a type array"); typeArrayOop t = typeArrayOop(obj); return t->object_size(this); diff --git a/src/hotspot/share/oops/typeArrayKlass.hpp b/src/hotspot/share/oops/typeArrayKlass.hpp index 1d6ed457c41..1ba4613adff 100644 --- a/src/hotspot/share/oops/typeArrayKlass.hpp +++ b/src/hotspot/share/oops/typeArrayKlass.hpp @@ -61,7 +61,7 @@ class TypeArrayKlass : public ArrayKlass { return create_klass(type, external_name(type), THREAD); } - int oop_size(oop obj) const; + size_t oop_size(oop obj) const; // Allocation typeArrayOop allocate_common(int length, bool do_zero, TRAPS); diff --git a/src/hotspot/share/oops/typeArrayOop.hpp b/src/hotspot/share/oops/typeArrayOop.hpp index 83f385fe5ac..0ca63622d1d 100644 --- a/src/hotspot/share/oops/typeArrayOop.hpp +++ b/src/hotspot/share/oops/typeArrayOop.hpp @@ -116,7 +116,7 @@ private: // Returns the number of words necessary to hold an array of "len" // elements each of the given "byte_size". private: - static int object_size(int lh, int length) { + static size_t object_size(int lh, int length) { int instance_header_size = Klass::layout_helper_header_size(lh); int element_shift = Klass::layout_helper_log2_element_size(lh); DEBUG_ONLY(BasicType etype = Klass::layout_helper_element_type(lh)); @@ -128,11 +128,11 @@ private: julong size_in_words = ((size_in_bytes + (HeapWordSize-1)) >> LogHeapWordSize); assert(size_in_words <= (julong)max_jint, "no overflow"); - return align_object_size((intptr_t)size_in_words); + return align_object_size((size_t)size_in_words); } public: - inline int object_size(const TypeArrayKlass* tk) const; + inline size_t object_size(const TypeArrayKlass* tk) const; }; // See similar requirement for oopDesc. diff --git a/src/hotspot/share/oops/typeArrayOop.inline.hpp b/src/hotspot/share/oops/typeArrayOop.inline.hpp index 5a23cd6eb28..43fb6a06b39 100644 --- a/src/hotspot/share/oops/typeArrayOop.inline.hpp +++ b/src/hotspot/share/oops/typeArrayOop.inline.hpp @@ -31,7 +31,7 @@ #include "oops/oop.inline.hpp" #include "oops/arrayOop.hpp" -int typeArrayOopDesc::object_size(const TypeArrayKlass* tk) const { +size_t typeArrayOopDesc::object_size(const TypeArrayKlass* tk) const { return object_size(tk->layout_helper(), length()); } diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index e3e7e690a50..7e87da8a46f 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -302,7 +302,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_nozero_C(Klass* array_type, int len if ((len > 0) && (result != NULL) && is_deoptimized_caller_frame(current)) { // Zero array here if the caller is deoptimized. - int size = TypeArrayKlass::cast(array_type)->oop_size(result); + const size_t size = TypeArrayKlass::cast(array_type)->oop_size(result); BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type(); const size_t hs = arrayOopDesc::header_size(elem_type); // Align to next 8 bytes to avoid trashing arrays's length. diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index b7139423e4c..9638c828143 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -660,7 +660,7 @@ JVM_ENTRY(jobject, JVM_Clone(JNIEnv* env, jobject handle)) } // Make shallow object copy - const int size = obj->size(); + const size_t size = obj->size(); oop new_obj_oop = NULL; if (obj->is_array()) { const int length = ((arrayOop)obj())->length(); diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index 8a1c0a3f055..d5449203251 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -201,7 +201,7 @@ static void print_objects(JavaThread* deoptee_thread, if (obj.is_null()) { st.print(" allocation failed"); } else { - st.print(" allocated (%d bytes)", obj->size() * HeapWordSize); + st.print(" allocated (" SIZE_FORMAT " bytes)", obj->size() * HeapWordSize); } st.cr(); -- GitLab From 809488bf38c250db3c263f200e5eb1a269059c3d Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 27 Oct 2021 13:40:51 +0000 Subject: [PATCH 092/890] 8276046: codestrings.validate_vm gtest fails on ppc64, s390 Reviewed-by: shade, mdoerr --- test/hotspot/gtest/code/test_codestrings.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/hotspot/gtest/code/test_codestrings.cpp b/test/hotspot/gtest/code/test_codestrings.cpp index 550c3cc07c8..37376cfcf3d 100644 --- a/test/hotspot/gtest/code/test_codestrings.cpp +++ b/test/hotspot/gtest/code/test_codestrings.cpp @@ -25,6 +25,8 @@ #ifndef PRODUCT #ifndef ZERO +// Neither ppc nor s390 compilers use code strings. +#if !defined(PPC) && !defined(S390) #include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" @@ -262,5 +264,6 @@ TEST_VM(codestrings, validate) buffer_blob_test(); } +#endif // not S390 not PPC #endif // not ZERO #endif // not PRODUCT -- GitLab From e6fa5fa37e73cd952fb93cc57091775b748ace9a Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 27 Oct 2021 14:24:02 +0000 Subject: [PATCH 093/890] 8276063: ProblemList gtest dll_address_to_function_and_library_name on macosx-generic Reviewed-by: tschatzl --- test/hotspot/gtest/runtime/test_os.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/gtest/runtime/test_os.cpp b/test/hotspot/gtest/runtime/test_os.cpp index 146c8d3daa0..ddebd53751e 100644 --- a/test/hotspot/gtest/runtime/test_os.cpp +++ b/test/hotspot/gtest/runtime/test_os.cpp @@ -709,7 +709,7 @@ TEST_VM(os, pagesizes_test_print) { ASSERT_EQ(strcmp(expected, buffer), 0); } -#if defined(__APPLE__) && !defined(AARCH64) // See JDK-8273967. +#if defined(__APPLE__) // See JDK-8273967. TEST_VM(os, DISABLED_dll_address_to_function_and_library_name) { #else TEST_VM(os, dll_address_to_function_and_library_name) { -- GitLab From 9a3e9542997860de79d07a4411b1007e9cd5c348 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 27 Oct 2021 16:18:12 +0000 Subject: [PATCH 094/890] 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes Reviewed-by: naoto --- .../share/classes/java/io/FilePermission.java | 2 +- .../classes/java/net/SocketPermission.java | 2 +- src/java.base/share/classes/java/net/URL.java | 2 +- .../classes/java/text/AttributedString.java | 6 ++--- .../share/classes/java/text/ChoiceFormat.java | 6 ++--- .../java/text/CompactNumberFormat.java | 6 ++--- .../classes/java/text/DecimalFormat.java | 24 +++++++++---------- .../classes/java/text/RBTableBuilder.java | 2 +- .../classes/sun/security/util/Debug.java | 8 +++---- .../sun/util/calendar/JulianCalendar.java | 2 +- .../util/calendar/LocalGregorianCalendar.java | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/java.base/share/classes/java/io/FilePermission.java b/src/java.base/share/classes/java/io/FilePermission.java index 83a1e98dc55..0371ef7e32a 100644 --- a/src/java.base/share/classes/java/io/FilePermission.java +++ b/src/java.base/share/classes/java/io/FilePermission.java @@ -179,7 +179,7 @@ public final class FilePermission extends Permission implements Serializable { private static final char WILD_CHAR = '*'; // public String toString() { -// StringBuffer sb = new StringBuffer(); +// StringBuilder sb = new StringBuilder(); // sb.append("*** FilePermission on " + getName() + " ***"); // for (Field f : FilePermission.class.getDeclaredFields()) { // if (!Modifier.isStatic(f.getModifiers())) { diff --git a/src/java.base/share/classes/java/net/SocketPermission.java b/src/java.base/share/classes/java/net/SocketPermission.java index b28969d144d..a3101c50ca3 100644 --- a/src/java.base/share/classes/java/net/SocketPermission.java +++ b/src/java.base/share/classes/java/net/SocketPermission.java @@ -1297,7 +1297,7 @@ public final class SocketPermission extends Permission /* public String toString() { - StringBuffer s = new StringBuffer(super.toString() + "\n" + + StringBuilder s = new StringBuilder(super.toString() + "\n" + "cname = " + cname + "\n" + "wildcard = " + wildcard + "\n" + "invalid = " + invalid + "\n" + diff --git a/src/java.base/share/classes/java/net/URL.java b/src/java.base/share/classes/java/net/URL.java index 35d9503df19..4ab1f5740a3 100644 --- a/src/java.base/share/classes/java/net/URL.java +++ b/src/java.base/share/classes/java/net/URL.java @@ -1762,7 +1762,7 @@ final class UrlDeserializedState { String reconstituteUrlString() { - // pre-compute length of StringBuffer + // pre-compute length of StringBuilder int len = protocol.length() + 1; if (authority != null && !authority.isEmpty()) len += 2 + authority.length(); diff --git a/src/java.base/share/classes/java/text/AttributedString.java b/src/java.base/share/classes/java/text/AttributedString.java index 087753429c0..48044b0ea5d 100644 --- a/src/java.base/share/classes/java/text/AttributedString.java +++ b/src/java.base/share/classes/java/text/AttributedString.java @@ -78,7 +78,7 @@ public class AttributedString { } else { // Build the String contents - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int counter = 0; counter < iterators.length; counter++) { appendContents(buffer, iterators[counter]); } @@ -668,9 +668,9 @@ public class AttributedString { /** * Appends the contents of the CharacterIterator iterator into the - * StringBuffer buf. + * StringBuilder buf. */ - private final void appendContents(StringBuffer buf, + private final void appendContents(StringBuilder buf, CharacterIterator iterator) { int index = iterator.getBeginIndex(); int end = iterator.getEndIndex(); diff --git a/src/java.base/share/classes/java/text/ChoiceFormat.java b/src/java.base/share/classes/java/text/ChoiceFormat.java index dc1037e231b..40fd2ad7800 100644 --- a/src/java.base/share/classes/java/text/ChoiceFormat.java +++ b/src/java.base/share/classes/java/text/ChoiceFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -178,9 +178,9 @@ public class ChoiceFormat extends NumberFormat { * is {@code null} */ public void applyPattern(String newPattern) { - StringBuffer[] segments = new StringBuffer[2]; + StringBuilder[] segments = new StringBuilder[2]; for (int i = 0; i < segments.length; ++i) { - segments[i] = new StringBuffer(); + segments[i] = new StringBuilder(); } double[] newChoiceLimits = new double[30]; String[] newChoiceFormats = new String[30]; diff --git a/src/java.base/share/classes/java/text/CompactNumberFormat.java b/src/java.base/share/classes/java/text/CompactNumberFormat.java index cb94ecb8090..0449133d5b8 100644 --- a/src/java.base/share/classes/java/text/CompactNumberFormat.java +++ b/src/java.base/share/classes/java/text/CompactNumberFormat.java @@ -1264,8 +1264,8 @@ public final class CompactNumberFormat extends NumberFormat { String zeros = ""; for (int j = 1; j >= 0 && start < pattern.length(); --j) { - StringBuffer prefix = new StringBuffer(); - StringBuffer suffix = new StringBuffer(); + StringBuilder prefix = new StringBuilder(); + StringBuilder suffix = new StringBuilder(); boolean inQuote = false; // The phase ranges from 0 to 2. Phase 0 is the prefix. Phase 1 is // the section of the pattern with digits. Phase 2 is the suffix. @@ -1275,7 +1275,7 @@ public final class CompactNumberFormat extends NumberFormat { int phase = 0; // The affix is either the prefix or the suffix. - StringBuffer affix = prefix; + StringBuilder affix = prefix; for (int pos = start; pos < pattern.length(); ++pos) { char ch = pattern.charAt(pos); diff --git a/src/java.base/share/classes/java/text/DecimalFormat.java b/src/java.base/share/classes/java/text/DecimalFormat.java index ec6d1b84d48..ea125b7d14b 100644 --- a/src/java.base/share/classes/java/text/DecimalFormat.java +++ b/src/java.base/share/classes/java/text/DecimalFormat.java @@ -2961,8 +2961,8 @@ public class DecimalFormat extends NumberFormat { * the expanded affix strings up to date. */ private void expandAffixes() { - // Reuse one StringBuffer for better performance - StringBuffer buffer = new StringBuffer(); + // Reuse one StringBuilder for better performance + StringBuilder buffer = new StringBuilder(); if (posPrefixPattern != null) { positivePrefix = expandAffix(posPrefixPattern, buffer); positivePrefixFieldPositions = null; @@ -2992,10 +2992,10 @@ public class DecimalFormat extends NumberFormat { * itself at the end of the pattern. * * @param pattern the non-null, possibly empty pattern - * @param buffer a scratch StringBuffer; its contents will be lost + * @param buffer a scratch StringBuilder; its contents will be lost * @return the expanded equivalent of pattern */ - private String expandAffix(String pattern, StringBuffer buffer) { + private String expandAffix(String pattern, StringBuilder buffer) { buffer.setLength(0); for (int i=0; i= 0 @@ -3198,7 +3198,7 @@ public class DecimalFormat extends NumberFormat { /** * Does the real work of generating a pattern. */ private String toPattern(boolean localized) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for (int j = 1; j >= 0; --j) { if (j == 1) appendAffix(result, posPrefixPattern, positivePrefix, localized); @@ -3341,8 +3341,8 @@ public class DecimalFormat extends NumberFormat { int start = 0; for (int j = 1; j >= 0 && start < pattern.length(); --j) { boolean inQuote = false; - StringBuffer prefix = new StringBuffer(); - StringBuffer suffix = new StringBuffer(); + StringBuilder prefix = new StringBuilder(); + StringBuilder suffix = new StringBuilder(); int decimalPos = -1; int multiplier = 1; int digitLeftCount = 0, zeroDigitCount = 0, digitRightCount = 0; @@ -3358,7 +3358,7 @@ public class DecimalFormat extends NumberFormat { int phase = 0; // The affix is either the prefix or the suffix. - StringBuffer affix = prefix; + StringBuilder affix = prefix; for (int pos = start; pos < pattern.length(); ++pos) { char ch = pattern.charAt(pos); diff --git a/src/java.base/share/classes/java/text/RBTableBuilder.java b/src/java.base/share/classes/java/text/RBTableBuilder.java index d8072d56da7..4aea5e781c6 100644 --- a/src/java.base/share/classes/java/text/RBTableBuilder.java +++ b/src/java.base/share/classes/java/text/RBTableBuilder.java @@ -401,7 +401,7 @@ final class RBTableBuilder { // can work right if (fwd && groupChars.length() > 1) { addContractFlags(groupChars); - addContractOrder(new StringBuffer(groupChars).reverse().toString(), + addContractOrder(new StringBuilder(groupChars).reverse().toString(), anOrder, false); } } diff --git a/src/java.base/share/classes/sun/security/util/Debug.java b/src/java.base/share/classes/sun/security/util/Debug.java index aca672bdb31..31c650e521d 100644 --- a/src/java.base/share/classes/sun/security/util/Debug.java +++ b/src/java.base/share/classes/sun/security/util/Debug.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -262,7 +262,7 @@ public class Debug { private static String marshal(String args) { if (args != null) { StringBuilder target = new StringBuilder(); - StringBuffer source = new StringBuffer(args); + StringBuilder source = new StringBuilder(args); // obtain the "permission=" options // the syntax of classname: IDENTIFIER.IDENTIFIER @@ -274,7 +274,7 @@ public class Debug { "[a-zA-Z_$][a-zA-Z0-9_$]*([.][a-zA-Z_$][a-zA-Z0-9_$]*)*"; Pattern pattern = Pattern.compile(reg); Matcher matcher = pattern.matcher(source); - StringBuffer left = new StringBuffer(); + StringBuilder left = new StringBuilder(); while (matcher.find()) { String matched = matcher.group(); target.append(matched.replaceFirst(keyReg, keyStr)); @@ -298,7 +298,7 @@ public class Debug { reg = keyReg + "[^, ;]*"; pattern = Pattern.compile(reg); matcher = pattern.matcher(source); - left = new StringBuffer(); + left = new StringBuilder(); while (matcher.find()) { String matched = matcher.group(); target.append(matched.replaceFirst(keyReg, keyStr)); diff --git a/src/java.base/share/classes/sun/util/calendar/JulianCalendar.java b/src/java.base/share/classes/sun/util/calendar/JulianCalendar.java index 99759c83760..8129090d295 100644 --- a/src/java.base/share/classes/sun/util/calendar/JulianCalendar.java +++ b/src/java.base/share/classes/sun/util/calendar/JulianCalendar.java @@ -94,7 +94,7 @@ public class JulianCalendar extends BaseCalendar { public String toString() { String time = super.toString(); time = time.substring(time.indexOf('T')); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); Era era = getEra(); if (era != null) { String n = era.getAbbreviation(); diff --git a/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java b/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java index c26b700c817..8fd582938dd 100644 --- a/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java +++ b/src/java.base/share/classes/sun/util/calendar/LocalGregorianCalendar.java @@ -123,7 +123,7 @@ public class LocalGregorianCalendar extends BaseCalendar { public String toString() { String time = super.toString(); time = time.substring(time.indexOf('T')); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); Era era = getEra(); if (era != null) { String abbr = era.getAbbreviation(); -- GitLab From d9b0138d7d02ceddc5d9c73908177f0b0d2e7c54 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Thu, 28 Oct 2021 05:29:58 +0000 Subject: [PATCH 095/890] 8275704: Metaspace::contains() should be threadsafe Reviewed-by: coleenp, dholmes --- .../memory/metaspace/virtualSpaceList.cpp | 12 ++++++++---- .../memory/metaspace/virtualSpaceList.hpp | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp index f9d66b81e0c..d3c5ec1cef5 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp @@ -34,6 +34,7 @@ #include "memory/metaspace/metaspaceCommon.hpp" #include "memory/metaspace/virtualSpaceList.hpp" #include "memory/metaspace/virtualSpaceNode.hpp" +#include "runtime/atomic.hpp" #include "runtime/mutexLocker.hpp" namespace metaspace { @@ -74,8 +75,10 @@ VirtualSpaceList::VirtualSpaceList(const char* name, ReservedSpace rs, CommitLim VirtualSpaceList::~VirtualSpaceList() { assert_lock_strong(Metaspace_lock); - // Note: normally, there is no reason ever to delete a vslist since they are - // global objects, but for gtests it makes sense to allow this. + // Delete every single mapping in this list. + // Please note that this only gets executed during gtests under controlled + // circumstances, so we do not have any concurrency issues here. The "real" + // lists in metaspace are immortal. VirtualSpaceNode* vsn = _first_node; VirtualSpaceNode* vsn2 = vsn; while (vsn != NULL) { @@ -96,7 +99,7 @@ void VirtualSpaceList::create_new_node() { _commit_limiter, &_reserved_words_counter, &_committed_words_counter); vsn->set_next(_first_node); - _first_node = vsn; + Atomic::release_store(&_first_node, vsn); _nodes_counter.increment(); } @@ -186,7 +189,8 @@ void VirtualSpaceList::verify() const { // Returns true if this pointer is contained in one of our nodes. bool VirtualSpaceList::contains(const MetaWord* p) const { - const VirtualSpaceNode* vsn = _first_node; + // Note: needs to work without locks. + const VirtualSpaceNode* vsn = Atomic::load_acquire(&_first_node); while (vsn != NULL) { if (vsn->contains(p)) { return true; diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp index 2f2dd2988c2..a173e71c63e 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp @@ -40,22 +40,32 @@ namespace metaspace { class Metachunk; class FreeChunkListVector; -// VirtualSpaceList manages a single (if its non-expandable) or -// a series of (if its expandable) virtual memory regions used +// VirtualSpaceList manages a series of virtual memory regions used // for metaspace. // // Internally it holds a list of nodes (VirtualSpaceNode) each // managing a single contiguous memory region. The first node of // this list is the current node and used for allocation of new // root chunks. +// +// The list will only ever grow, never shrink. It will be immortal, +// never to be destroyed. +// +// The list will only be modified under lock protection, but may be +// read concurrently without lock. +// +// The list may be prevented from expanding beyond a single node - +// in that case it degenerates to a one-node-list (used for +// class space). +// class VirtualSpaceList : public CHeapObj { // Name const char* const _name; - // Head of the list. - VirtualSpaceNode* _first_node; + // Head of the list (last added). + VirtualSpaceNode* volatile _first_node; // Number of nodes (kept for statistics only). IntCounter _nodes_counter; -- GitLab From 1750a6e2c06960b734f646018fc99b336bd966a5 Mon Sep 17 00:00:00 2001 From: Per Liden Date: Thu, 28 Oct 2021 05:44:32 +0000 Subject: [PATCH 096/890] 8276055: ZGC: Defragment address space Reviewed-by: eosterlund, stefank --- src/hotspot/share/gc/z/zMemory.cpp | 20 +++++++-- src/hotspot/share/gc/z/zMemory.hpp | 11 ++--- src/hotspot/share/gc/z/zPageAllocator.cpp | 42 ++++++++++++++++--- src/hotspot/share/gc/z/zPageAllocator.hpp | 2 + src/hotspot/share/gc/z/zPhysicalMemory.cpp | 2 +- src/hotspot/share/gc/z/zVirtualMemory.cpp | 8 +++- src/hotspot/share/gc/z/zVirtualMemory.hpp | 4 ++ .../share/gc/z/zVirtualMemory.inline.hpp | 8 ++++ 8 files changed, 80 insertions(+), 17 deletions(-) diff --git a/src/hotspot/share/gc/z/zMemory.cpp b/src/hotspot/share/gc/z/zMemory.cpp index e4c826b9b1a..1eb3629f8a7 100644 --- a/src/hotspot/share/gc/z/zMemory.cpp +++ b/src/hotspot/share/gc/z/zMemory.cpp @@ -85,7 +85,19 @@ void ZMemoryManager::register_callbacks(const Callbacks& callbacks) { _callbacks = callbacks; } -uintptr_t ZMemoryManager::alloc_from_front(size_t size) { +uintptr_t ZMemoryManager::peek_low_address() const { + ZLocker locker(&_lock); + + const ZMemory* const area = _freelist.first(); + if (area != NULL) { + return area->start(); + } + + // Out of memory + return UINTPTR_MAX; +} + +uintptr_t ZMemoryManager::alloc_low_address(size_t size) { ZLocker locker(&_lock); ZListIterator iter(&_freelist); @@ -110,7 +122,7 @@ uintptr_t ZMemoryManager::alloc_from_front(size_t size) { return UINTPTR_MAX; } -uintptr_t ZMemoryManager::alloc_from_front_at_most(size_t size, size_t* allocated) { +uintptr_t ZMemoryManager::alloc_low_address_at_most(size_t size, size_t* allocated) { ZLocker locker(&_lock); ZMemory* area = _freelist.first(); @@ -136,7 +148,7 @@ uintptr_t ZMemoryManager::alloc_from_front_at_most(size_t size, size_t* allocate return UINTPTR_MAX; } -uintptr_t ZMemoryManager::alloc_from_back(size_t size) { +uintptr_t ZMemoryManager::alloc_high_address(size_t size) { ZLocker locker(&_lock); ZListReverseIterator iter(&_freelist); @@ -160,7 +172,7 @@ uintptr_t ZMemoryManager::alloc_from_back(size_t size) { return UINTPTR_MAX; } -uintptr_t ZMemoryManager::alloc_from_back_at_most(size_t size, size_t* allocated) { +uintptr_t ZMemoryManager::alloc_high_address_at_most(size_t size, size_t* allocated) { ZLocker locker(&_lock); ZMemory* area = _freelist.last(); diff --git a/src/hotspot/share/gc/z/zMemory.hpp b/src/hotspot/share/gc/z/zMemory.hpp index c20815035ed..ad2ca05c696 100644 --- a/src/hotspot/share/gc/z/zMemory.hpp +++ b/src/hotspot/share/gc/z/zMemory.hpp @@ -66,7 +66,7 @@ public: }; private: - ZLock _lock; + mutable ZLock _lock; ZList _freelist; Callbacks _callbacks; @@ -82,10 +82,11 @@ public: void register_callbacks(const Callbacks& callbacks); - uintptr_t alloc_from_front(size_t size); - uintptr_t alloc_from_front_at_most(size_t size, size_t* allocated); - uintptr_t alloc_from_back(size_t size); - uintptr_t alloc_from_back_at_most(size_t size, size_t* allocated); + uintptr_t peek_low_address() const; + uintptr_t alloc_low_address(size_t size); + uintptr_t alloc_low_address_at_most(size_t size, size_t* allocated); + uintptr_t alloc_high_address(size_t size); + uintptr_t alloc_high_address_at_most(size_t size, size_t* allocated); void free(uintptr_t start, size_t size); }; diff --git a/src/hotspot/share/gc/z/zPageAllocator.cpp b/src/hotspot/share/gc/z/zPageAllocator.cpp index 6463643fd24..e964aec5454 100644 --- a/src/hotspot/share/gc/z/zPageAllocator.cpp +++ b/src/hotspot/share/gc/z/zPageAllocator.cpp @@ -48,6 +48,7 @@ static const ZStatCounter ZCounterAllocationRate("Memory", "Allocation Rate", ZStatUnitBytesPerSecond); static const ZStatCounter ZCounterPageCacheFlush("Memory", "Page Cache Flush", ZStatUnitBytesPerSecond); +static const ZStatCounter ZCounterDefragment("Memory", "Defragment", ZStatUnitOpsPerSecond); static const ZStatCriticalPhase ZCriticalPhaseAllocationStall("Allocation Stall"); enum ZPageAllocationStall { @@ -559,12 +560,43 @@ ZPage* ZPageAllocator::alloc_page_create(ZPageAllocation* allocation) { return new ZPage(allocation->type(), vmem, pmem); } -static bool is_alloc_satisfied(ZPageAllocation* allocation) { +bool ZPageAllocator::should_defragment(const ZPage* page) const { + // A small page can end up at a high address (second half of the address space) + // if we've split a larger page or we have a constrained address space. To help + // fight address space fragmentation we remap such pages to a lower address, if + // a lower address is available. + return page->type() == ZPageTypeSmall && + page->start() >= _virtual.reserved() / 2 && + page->start() > _virtual.lowest_available_address(); +} + +bool ZPageAllocator::is_alloc_satisfied(ZPageAllocation* allocation) const { // The allocation is immediately satisfied if the list of pages contains - // exactly one page, with the type and size that was requested. - return allocation->pages()->size() == 1 && - allocation->pages()->first()->type() == allocation->type() && - allocation->pages()->first()->size() == allocation->size(); + // exactly one page, with the type and size that was requested. However, + // even if the allocation is immediately satisfied we might still want to + // return false here to force the page to be remapped to fight address + // space fragmentation. + + if (allocation->pages()->size() != 1) { + // Not a single page + return false; + } + + const ZPage* const page = allocation->pages()->first(); + if (page->type() != allocation->type() || + page->size() != allocation->size()) { + // Wrong type or size + return false; + } + + if (should_defragment(page)) { + // Defragment address space + ZStatInc(ZCounterDefragment); + return false; + } + + // Allocation immediately satisfied + return true; } ZPage* ZPageAllocator::alloc_page_finalize(ZPageAllocation* allocation) { diff --git a/src/hotspot/share/gc/z/zPageAllocator.hpp b/src/hotspot/share/gc/z/zPageAllocator.hpp index 352e445691d..963259977af 100644 --- a/src/hotspot/share/gc/z/zPageAllocator.hpp +++ b/src/hotspot/share/gc/z/zPageAllocator.hpp @@ -89,6 +89,8 @@ private: bool alloc_page_common(ZPageAllocation* allocation); bool alloc_page_stall(ZPageAllocation* allocation); bool alloc_page_or_stall(ZPageAllocation* allocation); + bool should_defragment(const ZPage* page) const; + bool is_alloc_satisfied(ZPageAllocation* allocation) const; ZPage* alloc_page_create(ZPageAllocation* allocation); ZPage* alloc_page_finalize(ZPageAllocation* allocation); void alloc_page_failed(ZPageAllocation* allocation); diff --git a/src/hotspot/share/gc/z/zPhysicalMemory.cpp b/src/hotspot/share/gc/z/zPhysicalMemory.cpp index f2b80b02ecd..abdf7df69b0 100644 --- a/src/hotspot/share/gc/z/zPhysicalMemory.cpp +++ b/src/hotspot/share/gc/z/zPhysicalMemory.cpp @@ -295,7 +295,7 @@ void ZPhysicalMemoryManager::alloc(ZPhysicalMemory& pmem, size_t size) { // Allocate segments while (size > 0) { size_t allocated = 0; - const uintptr_t start = _manager.alloc_from_front_at_most(size, &allocated); + const uintptr_t start = _manager.alloc_low_address_at_most(size, &allocated); assert(start != UINTPTR_MAX, "Allocation should never fail"); pmem.add_segment(ZPhysicalMemorySegment(start, allocated, false /* committed */)); size -= allocated; diff --git a/src/hotspot/share/gc/z/zVirtualMemory.cpp b/src/hotspot/share/gc/z/zVirtualMemory.cpp index 4f9c9bd4b40..9366412cea2 100644 --- a/src/hotspot/share/gc/z/zVirtualMemory.cpp +++ b/src/hotspot/share/gc/z/zVirtualMemory.cpp @@ -33,6 +33,7 @@ ZVirtualMemoryManager::ZVirtualMemoryManager(size_t max_capacity) : _manager(), + _reserved(0), _initialized(false) { // Check max supported heap size @@ -173,6 +174,9 @@ bool ZVirtualMemoryManager::reserve(size_t max_capacity) { log_info_p(gc, init)("Address Space Size: " SIZE_FORMAT "M x " SIZE_FORMAT " = " SIZE_FORMAT "M", reserved / M, ZHeapViews, (reserved * ZHeapViews) / M); + // Record reserved + _reserved = reserved; + return reserved >= max_capacity; } @@ -191,9 +195,9 @@ ZVirtualMemory ZVirtualMemoryManager::alloc(size_t size, bool force_low_address) // Small pages are allocated at low addresses, while medium/large pages // are allocated at high addresses (unless forced to be at a low address). if (force_low_address || size <= ZPageSizeSmall) { - start = _manager.alloc_from_front(size); + start = _manager.alloc_low_address(size); } else { - start = _manager.alloc_from_back(size); + start = _manager.alloc_high_address(size); } return ZVirtualMemory(start, size); diff --git a/src/hotspot/share/gc/z/zVirtualMemory.hpp b/src/hotspot/share/gc/z/zVirtualMemory.hpp index 4533da28853..a7cde86b0d1 100644 --- a/src/hotspot/share/gc/z/zVirtualMemory.hpp +++ b/src/hotspot/share/gc/z/zVirtualMemory.hpp @@ -48,6 +48,7 @@ public: class ZVirtualMemoryManager { private: ZMemoryManager _manager; + uintptr_t _reserved; bool _initialized; // Platform specific implementation @@ -69,6 +70,9 @@ public: bool is_initialized() const; + size_t reserved() const; + uintptr_t lowest_available_address() const; + ZVirtualMemory alloc(size_t size, bool force_low_address); void free(const ZVirtualMemory& vmem); }; diff --git a/src/hotspot/share/gc/z/zVirtualMemory.inline.hpp b/src/hotspot/share/gc/z/zVirtualMemory.inline.hpp index 2a8c776587f..20071fa4490 100644 --- a/src/hotspot/share/gc/z/zVirtualMemory.inline.hpp +++ b/src/hotspot/share/gc/z/zVirtualMemory.inline.hpp @@ -57,4 +57,12 @@ inline ZVirtualMemory ZVirtualMemory::split(size_t size) { return ZVirtualMemory(_start - size, size); } +inline size_t ZVirtualMemoryManager::reserved() const { + return _reserved; +} + +inline uintptr_t ZVirtualMemoryManager::lowest_available_address() const { + return _manager.peek_low_address(); +} + #endif // SHARE_GC_Z_ZVIRTUALMEMORY_INLINE_HPP -- GitLab From a2f2d8fcf511de2754a76a5d9f9acdfef462919b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 28 Oct 2021 08:27:44 +0000 Subject: [PATCH 097/890] 8276057: Update JMH devkit to 1.33 Reviewed-by: aph, redestad, erikj --- make/devkit/createJMHBundle.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/devkit/createJMHBundle.sh b/make/devkit/createJMHBundle.sh index 848e8e1e432..d34c9939ff0 100644 --- a/make/devkit/createJMHBundle.sh +++ b/make/devkit/createJMHBundle.sh @@ -26,7 +26,7 @@ # Create a bundle in the build directory, containing what's needed to # build and run JMH microbenchmarks from the OpenJDK build. -JMH_VERSION=1.32 +JMH_VERSION=1.33 COMMONS_MATH3_VERSION=3.2 JOPT_SIMPLE_VERSION=4.6 -- GitLab From 593401fe8b38bbb8d331a862818fe077af157fcb Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 28 Oct 2021 08:42:10 +0000 Subject: [PATCH 098/890] 8276042: Remove unused local variables in java.naming Reviewed-by: aefimov, dfuchs, vtewari --- .../share/classes/com/sun/jndi/ldap/Filter.java | 1 - .../share/classes/com/sun/jndi/ldap/LdapCtx.java | 1 - .../classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java | 4 ++-- .../classes/com/sun/jndi/toolkit/ctx/Continuation.java | 6 ++---- .../com/sun/jndi/toolkit/ctx/PartialCompositeContext.java | 7 +++---- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Filter.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Filter.java index ab43fa7aa9c..5b172c44a81 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/Filter.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Filter.java @@ -307,7 +307,6 @@ final class Filter { dbgIndent++; } - String type, value; int valueStart, valueEnd, typeStart, typeEnd; int eq; diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java index 332e7dbea2b..8bd07c08cb5 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -2603,7 +2603,6 @@ public final class LdapCtx extends ComponentDirContext Vector> referrals = new Vector<>(urlCount); int iURL; - int i = 0; separator = refString.indexOf('\n'); iURL = separator + 1; diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java index e8e73c7b825..30d64fc8611 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/SaslOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -73,7 +73,7 @@ class SaslOutputStream extends FilterOutputStream { */ public void write(byte[] buffer, int offset, int total) throws IOException { int count; - byte[] wrappedToken, saslBuffer; + byte[] wrappedToken; // "Packetize" buffer to be within rawSendSize if (debug) { diff --git a/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java b/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java index a2a971826eb..1a6d930460e 100644 --- a/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java +++ b/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -134,7 +134,7 @@ public class Continuation extends ResolveResult { /** * Fills in an exception's fields using data from this Continuation. * The resolved name is set by subtracting remainingName from starter. - * %%% This might not not always produce the correct answer wrt trailing "/". + * %%% This might not always produce the correct answer wrt trailing "/". * If the exception is a CannotProceedException, its environment, * altName, and altNameCtx fields are set using this continuation's * environment, relativeResolvedName, and resolvedContext. @@ -296,8 +296,6 @@ public class Continuation extends ResolveResult { * @param currCtx The non-null context from which relResName is to be resolved. */ public void setContinueNNS(Object resObj, Name relResName, Context currCtx) { - CompositeName rname = new CompositeName(); - setContinue(resObj, relResName, currCtx, PartialCompositeContext._NNS_NAME); } diff --git a/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java b/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java index 19b8eb21588..2359292e422 100644 --- a/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java +++ b/src/java.naming/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -510,12 +510,11 @@ public abstract class PartialCompositeContext implements Context, Resolver { throws NamingException { Object obj = cont.getResolvedObj(); - PartialCompositeContext pctx = null; - if (obj instanceof PartialCompositeContext) { + if (obj instanceof PartialCompositeContext partialCtx) { // Just cast if octx already is PartialCompositeContext // %%% ignoring environment for now - return (PartialCompositeContext)obj; + return partialCtx; } else { throw cont.fillInException(new CannotProceedException()); } -- GitLab From d88b89f89643dd97092b1debf98e871f873e8f9c Mon Sep 17 00:00:00 2001 From: Per Liden Date: Thu, 28 Oct 2021 10:10:05 +0000 Subject: [PATCH 099/890] 8276067: ZGC: Remove unused function alloc_high_address_at_most() Reviewed-by: eosterlund, stefank --- src/hotspot/share/gc/z/zMemory.cpp | 25 ------------------------- src/hotspot/share/gc/z/zMemory.hpp | 1 - 2 files changed, 26 deletions(-) diff --git a/src/hotspot/share/gc/z/zMemory.cpp b/src/hotspot/share/gc/z/zMemory.cpp index 1eb3629f8a7..7b1c0749f75 100644 --- a/src/hotspot/share/gc/z/zMemory.cpp +++ b/src/hotspot/share/gc/z/zMemory.cpp @@ -172,31 +172,6 @@ uintptr_t ZMemoryManager::alloc_high_address(size_t size) { return UINTPTR_MAX; } -uintptr_t ZMemoryManager::alloc_high_address_at_most(size_t size, size_t* allocated) { - ZLocker locker(&_lock); - - ZMemory* area = _freelist.last(); - if (area != NULL) { - if (area->size() <= size) { - // Smaller than or equal to requested, remove area - const uintptr_t start = area->start(); - *allocated = area->size(); - _freelist.remove(area); - destroy(area); - return start; - } else { - // Larger than requested, shrink area - shrink_from_back(area, size); - *allocated = size; - return area->end(); - } - } - - // Out of memory - *allocated = 0; - return UINTPTR_MAX; -} - void ZMemoryManager::free(uintptr_t start, size_t size) { assert(start != UINTPTR_MAX, "Invalid address"); const uintptr_t end = start + size; diff --git a/src/hotspot/share/gc/z/zMemory.hpp b/src/hotspot/share/gc/z/zMemory.hpp index ad2ca05c696..85c4f5d232d 100644 --- a/src/hotspot/share/gc/z/zMemory.hpp +++ b/src/hotspot/share/gc/z/zMemory.hpp @@ -86,7 +86,6 @@ public: uintptr_t alloc_low_address(size_t size); uintptr_t alloc_low_address_at_most(size_t size, size_t* allocated); uintptr_t alloc_high_address(size_t size); - uintptr_t alloc_high_address_at_most(size_t size, size_t* allocated); void free(uintptr_t start, size_t size); }; -- GitLab From 7c996d572cc10045b7f6bc301916dcbd349b6ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 28 Oct 2021 10:41:49 +0000 Subject: [PATCH 100/890] 8269401: Merge "Exceptions" and "Errors" into "Exception Classes" Reviewed-by: jjg --- .../formats/html/AllClassesIndexWriter.java | 3 +- .../doclets/formats/html/Contents.java | 12 +- .../doclets/formats/html/HelpWriter.java | 3 +- .../doclets/formats/html/HtmlIds.java | 3 +- .../formats/html/PackageWriterImpl.java | 3 +- .../formats/html/SummaryListWriter.java | 6 +- .../toolkit/resources/doclets.properties | 9 +- .../toolkit/resources/doclets_ja.properties | 6 - .../resources/doclets_zh_CN.properties | 6 - .../toolkit/util/SummaryAPIListBuilder.java | 9 +- .../toolkit/util/TypeElementCatalog.java | 133 +----------------- .../internal/doclets/toolkit/util/Utils.java | 53 +------ .../TestDeprecatedDocs.java | 15 +- .../testHtmlTableTags/TestHtmlTableTags.java | 12 +- .../doclet/testModules/TestModules.java | 4 +- .../doclet/testNewApiList/TestNewApiList.java | 57 ++++---- .../javadoc/doclet/testSearch/TestSearch.java | 8 +- .../TestSystemPropertyTaglet.java | 24 ++-- .../jdk/javadoc/tool/CheckResourceKeys.java | 2 +- 19 files changed, 80 insertions(+), 288 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java index 0b7490f4c74..a2d4f51e45e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java @@ -120,8 +120,7 @@ public class AllClassesIndexWriter extends HtmlDocletWriter { .addTab(contents.classes, e -> utils.isOrdinaryClass((TypeElement)e)) .addTab(contents.enums, utils::isEnum) .addTab(contents.records, e -> utils.isRecord((TypeElement)e)) - .addTab(contents.exceptions, e -> utils.isException((TypeElement)e)) - .addTab(contents.errors, e -> utils.isError((TypeElement)e)) + .addTab(contents.exceptionClasses, e -> utils.isThrowable((TypeElement)e)) .addTab(contents.annotationTypes, utils::isAnnotationType); for (Character unicode : indexBuilder.getFirstCharacters()) { for (IndexItem indexItem : indexBuilder.getItems(unicode)) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java index a78cd2ff5ea..1b18aa4293c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java @@ -92,10 +92,8 @@ public class Contents { public final Content enumConstantSummary; public final Content enum_; public final Content enums; - public final Content error; - public final Content errors; - public final Content exception; - public final Content exceptions; + public final Content exceptionClass; + public final Content exceptionClasses; public final Content exportedTo; public final Content fieldLabel; public final Content fieldDetailsLabel; @@ -238,10 +236,8 @@ public class Contents { enumConstantSummary = getContent("doclet.Enum_Constant_Summary"); enum_ = getContent("doclet.Enum"); enums = getContent("doclet.Enums"); - error = getContent("doclet.Error"); - errors = getContent("doclet.Errors"); - exception = getContent("doclet.Exception"); - exceptions = getContent("doclet.Exceptions"); + exceptionClass = getContent("doclet.ExceptionClass"); + exceptionClasses = getContent("doclet.ExceptionClasses"); exportedTo = getContent("doclet.ExportedTo"); fieldDetailsLabel = getContent("doclet.Field_Detail"); fieldSummaryLabel = getContent("doclet.Field_Summary"); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java index 1f6bffee7b4..167b24b622b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java @@ -274,8 +274,7 @@ public class HelpWriter extends HtmlDocletWriter { contents.interfaces, contents.classes, contents.enums, - contents.exceptions, - contents.errors, + contents.exceptionClasses, contents.annotationTypes)); pageKindsSection.add(section); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java index 2441f19f44c..29831d836b7 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java @@ -417,8 +417,7 @@ public class HtmlIds { case INTERFACE -> "interface"; case CLASS -> "class"; case ENUM -> "enum-class"; - case EXCEPTION -> "exception"; - case ERROR -> "error"; + case EXCEPTION_CLASS -> "exception-class"; case ANNOTATION_TYPE -> "annotation-interface"; case FIELD -> "field"; case METHOD -> "method"; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java index 53818595fd9..a89b3ff68bd 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java @@ -257,8 +257,7 @@ public class PackageWriterImpl extends HtmlDocletWriter .addTab(contents.classes, e -> utils.isOrdinaryClass((TypeElement)e)) .addTab(contents.enums, utils::isEnum) .addTab(contents.records, e -> utils.isRecord((TypeElement)e)) - .addTab(contents.exceptions, e -> utils.isException((TypeElement)e)) - .addTab(contents.errors, e -> utils.isError((TypeElement)e)) + .addTab(contents.exceptionClasses, e -> utils.isThrowable((TypeElement)e)) .addTab(contents.annotationTypes, utils::isAnnotationType); for (TypeElement typeElement : allClasses) { if (typeElement != null && utils.isCoreClass(typeElement)) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java index 6c0a03f2d52..1b0eea44f1c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java @@ -62,8 +62,7 @@ public class SummaryListWriter extends SubWrite case INTERFACE -> "doclet.Interfaces"; case CLASS -> "doclet.Classes"; case ENUM -> "doclet.Enums"; - case EXCEPTION -> "doclet.Exceptions"; - case ERROR -> "doclet.Errors"; + case EXCEPTION_CLASS -> "doclet.ExceptionClasses"; case ANNOTATION_TYPE -> "doclet.Annotation_Types"; case FIELD -> "doclet.Fields"; case METHOD -> "doclet.Methods"; @@ -81,8 +80,7 @@ public class SummaryListWriter extends SubWrite case INTERFACE -> "doclet.Interface"; case CLASS -> "doclet.Class"; case ENUM -> "doclet.Enum"; - case EXCEPTION -> "doclet.Exceptions"; - case ERROR -> "doclet.Errors"; + case EXCEPTION_CLASS -> "doclet.ExceptionClass"; case ANNOTATION_TYPE -> "doclet.AnnotationType"; case FIELD -> "doclet.Field"; case METHOD -> "doclet.Method"; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties index 3dc2ca72861..cf2f8c53f9f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties @@ -140,8 +140,7 @@ doclet.RecordClasses=Record Classes doclet.Related_Packages=Related Packages doclet.AnnotationTypes=Annotation Types doclet.AnnotationInterfaces=Annotation Interfaces -doclet.Exceptions=Exceptions -doclet.Errors=Errors +doclet.ExceptionClasses=Exception Classes doclet.Classes=Classes doclet.All_Classes_And_Interfaces=All Classes and Interfaces doclet.All_Superinterfaces=All Superinterfaces: @@ -164,10 +163,8 @@ doclet.interface=interface doclet.class=class doclet.RecordClass=Record Class doclet.recordclass=record class -doclet.Error=Error -doclet.error=error -doclet.Exception=Exception -doclet.exception=exception +doclet.ExceptionClass=Exception Class +doclet.exceptionclass=exception class doclet.ExportedTo=Exported To Modules doclet.OpenedTo=Opened To Modules doclet.Package_private=(package private) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties index b0a5097bf8d..05c406d4421 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_ja.properties @@ -156,12 +156,6 @@ doclet.class=\u30AF\u30E9\u30B9 doclet.classes=\u30AF\u30E9\u30B9 doclet.Record=\u30EC\u30B3\u30FC\u30C9 doclet.record=\u30EC\u30B3\u30FC\u30C9 -doclet.Error=\u30A8\u30E9\u30FC -doclet.error=\u30A8\u30E9\u30FC -doclet.errors=\u30A8\u30E9\u30FC -doclet.Exception=\u4F8B\u5916 -doclet.exception=\u4F8B\u5916 -doclet.exceptions=\u4F8B\u5916 doclet.ExportedTo=\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8 doclet.OpenedTo=\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\u30AA\u30FC\u30D7\u30F3 doclet.Package_private=(package private) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties index 707c2f14eb9..2a0f2b1c714 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets_zh_CN.properties @@ -156,12 +156,6 @@ doclet.class=\u7C7B doclet.classes=\u7C7B doclet.Record=\u8BB0\u5F55 doclet.record=\u8BB0\u5F55 -doclet.Error=\u9519\u8BEF -doclet.error=\u9519\u8BEF -doclet.errors=\u9519\u8BEF -doclet.Exception=\u5F02\u5E38\u9519\u8BEF -doclet.exception=\u5F02\u5E38\u9519\u8BEF -doclet.exceptions=\u5F02\u5E38\u9519\u8BEF doclet.ExportedTo=\u5DF2\u5BFC\u51FA\u5230\u6A21\u5757 doclet.OpenedTo=\u5DF2\u6253\u5F00\u5230\u6A21\u5757 doclet.Package_private=(\u4E13\u7528\u7A0B\u5E8F\u5305) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SummaryAPIListBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SummaryAPIListBuilder.java index ae37bf93e70..7350c33ebf9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SummaryAPIListBuilder.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/SummaryAPIListBuilder.java @@ -59,8 +59,7 @@ public class SummaryAPIListBuilder { INTERFACE, CLASS, ENUM, - EXCEPTION, // no ElementKind mapping - ERROR, // no ElementKind mapping + EXCEPTION_CLASS, // no ElementKind mapping RECORD_CLASS, ANNOTATION_TYPE, FIELD, @@ -121,10 +120,8 @@ public class SummaryAPIListBuilder { eset.add(te); } case CLASS -> { - if (utils.isError(te)) { - eset = summaryMap.get(SummaryElementKind.ERROR); - } else if (utils.isException(te)) { - eset = summaryMap.get(SummaryElementKind.EXCEPTION); + if (utils.isThrowable(te)) { + eset = summaryMap.get(SummaryElementKind.EXCEPTION_CLASS); } else { eset = summaryMap.get(SummaryElementKind.CLASS); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java index 90bd1c8b2a6..23791578a07 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/TypeElementCatalog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -56,41 +56,6 @@ public class TypeElementCatalog { */ private final Map> allClasses; - /** - * Stores ordinary classes (excluding Exceptions and Errors) for each package - */ - private final Map> ordinaryClasses; - - /** - * Stores exceptions for each package - */ - private final Map> exceptions; - - /** - * Stores enums for each package. - */ - private final Map> enums; - - /** - * Stores records for each package. - */ - private final Map> records; - - /** - * Stores annotation types for each package. - */ - private final Map> annotationTypes; - - /** - * Stores errors for each package - */ - private final Map> errors; - - /** - * Stores interfaces for each package - */ - private final Map> interfaces; - private final BaseConfiguration configuration; private final Utils utils; private final Comparator comparator; @@ -116,13 +81,6 @@ public class TypeElementCatalog { this.utils = config.utils; comparator = utils.comparators.makeGeneralPurposeComparator(); allClasses = new HashMap<>(); - ordinaryClasses = new HashMap<>(); - exceptions = new HashMap<>(); - enums = new HashMap<>(); - records = new HashMap<>(); - annotationTypes = new HashMap<>(); - errors = new HashMap<>(); - interfaces = new HashMap<>(); packageSet = new TreeSet<>(comparator); } @@ -136,21 +94,6 @@ public class TypeElementCatalog { return; } addTypeElement(typeElement, allClasses); - if (utils.isOrdinaryClass(typeElement)) { - addTypeElement(typeElement, ordinaryClasses); - } else if (utils.isException(typeElement)) { - addTypeElement(typeElement, exceptions); - } else if (utils.isEnum(typeElement)) { - addTypeElement(typeElement, enums); - } else if (utils.isRecord(typeElement)) { - addTypeElement(typeElement, records); - } else if (utils.isAnnotationType(typeElement)) { - addTypeElement(typeElement, annotationTypes); - } else if (utils.isError(typeElement)) { - addTypeElement(typeElement, errors); - } else if (utils.isInterface(typeElement)) { - addTypeElement(typeElement, interfaces); - } } /** @@ -178,13 +121,6 @@ public class TypeElementCatalog { } - private SortedSet getSet(Map> m, PackageElement key) { - SortedSet s = m.get(key); - if (s != null) { - return s; - } - return new TreeSet<>(comparator); - } /** * Return all of the classes specified on the command-line that belong to the given package. * @@ -193,7 +129,7 @@ public class TypeElementCatalog { public SortedSet allClasses(PackageElement packageElement) { return utils.isSpecified(packageElement) ? utils.getTypeElementsAsSortedSet(utils.getEnclosedTypeElements(packageElement)) - : getSet(allClasses, packageElement); + : allClasses.getOrDefault(packageElement, Collections.emptySortedSet()); } /** @@ -214,69 +150,4 @@ public class TypeElementCatalog { public SortedSet packages() { return packageSet; } - - /** - * Return all of the errors specified on the command-line that belong to the given package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet errors(PackageElement pkg) { - return getSet(errors, pkg); - } - - /** - * Return all of the exceptions specified on the command-line that belong to the given package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet exceptions(PackageElement pkg) { - return getSet(exceptions, pkg); - } - - /** - * Return all of the enums specified on the command-line that belong to the given package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet enums(PackageElement pkg) { - return getSet(enums, pkg); - } - - /** - * Return all of the records specified on the command-line that belong to the given package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet records(PackageElement pkg) { - return getSet(records, pkg); - } - - /** - * Return all of the annotation types specified on the command-line that belong to the given - * package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet annotationTypes(PackageElement pkg) { - return getSet(annotationTypes, pkg); - } - - /** - * Return all of the interfaces specified on the command-line that belong to the given package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet interfaces(PackageElement pkg) { - return getSet(interfaces, pkg); - } - - /** - * Return all of the ordinary classes specified on the command-line that belong to the given - * package. - * - * @param pkg the name of the package specified on the command-line. - */ - public SortedSet ordinaryClasses(PackageElement pkg) { - return getSet(ordinaryClasses, pkg); - } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java index 652f61caaa7..4d289797bcf 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java @@ -107,7 +107,6 @@ import com.sun.source.doctree.SerialTree; import com.sun.source.doctree.StartElementTree; import com.sun.source.doctree.TextTree; import com.sun.source.doctree.ThrowsTree; -import com.sun.source.doctree.UnknownBlockTagTree; import com.sun.source.doctree.UsesTree; import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.LineMap; @@ -180,13 +179,7 @@ public class Utils { return getSymbol("java.lang.Object"); } - public TypeMirror getExceptionType() { - return getSymbol("java.lang.Exception"); - } - - public TypeMirror getErrorType() { - return getSymbol("java.lang.Error"); - } + public TypeMirror getThrowableType() { return getSymbol("java.lang.Throwable"); } public TypeMirror getSerializableType() { return getSymbol("java.io.Serializable"); @@ -502,10 +495,7 @@ public class Utils { if (isEnum(te) || isInterface(te) || isAnnotationType(te) || isRecord(te)) { return false; } - if (isError(te) || isException(te)) { - return false; - } - return true; + return !isThrowable(te); } public boolean isUndocumentedEnclosure(TypeElement enclosingTypeElement) { @@ -514,18 +504,11 @@ public class Utils { && !isLinkable(enclosingTypeElement); } - public boolean isError(TypeElement te) { - if (isEnum(te) || isInterface(te) || isAnnotationType(te)) { - return false; - } - return typeUtils.isSubtype(te.asType(), getErrorType()); - } - - public boolean isException(TypeElement te) { + public boolean isThrowable(TypeElement te) { if (isEnum(te) || isInterface(te) || isAnnotationType(te)) { return false; } - return typeUtils.isSubtype(te.asType(), getExceptionType()); + return typeUtils.isSubtype(te.asType(), getThrowableType()); } public boolean isPrimitive(TypeMirror t) { @@ -1275,8 +1258,7 @@ public class Utils { case RECORD -> "doclet.RecordClass"; case CLASS -> - isException(te) ? "doclet.Exception" - : isError(te) ? "doclet.Error" + isThrowable(te) ? "doclet.ExceptionClass" : "doclet.Class"; default -> throw new IllegalArgumentException(te.getKind().toString()); @@ -1993,31 +1975,6 @@ public class Utils { }); } - /** - * Returns a list of classes that are not errors or exceptions - * @param e Element - * @return List - */ - public List getOrdinaryClasses(Element e) { - return getClasses(e).stream() - .filter(te -> (!isException(te) && !isError(te))) - .toList(); - } - - public List getErrors(Element e) { - return getClasses(e) - .stream() - .filter(this::isError) - .toList(); - } - - public List getExceptions(Element e) { - return getClasses(e) - .stream() - .filter(this::isException) - .toList(); - } - /** * Returns a list of documented elements of a given type with a given kind. * If the root of the search is a package, the search is recursive. diff --git a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java index 4f8d61b767b..2703c87a069 100644 --- a/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java +++ b/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java @@ -270,8 +270,7 @@ public class TestDeprecatedDocs extends JavadocTester {
  • Terminally Deprecated
  • Classes
  • Enum Classes
  • -
  • Exceptions
  • -
  • Errors
  • +
  • Exception Classes
  • Annotation Interfaces
  • Fields
  • Methods
  • @@ -296,13 +295,17 @@ public class TestDeprecatedDocs extends JavadocTester {
    enum_test1 passes.
    """, """ -
    -
    Deprecated Exceptions
    +
    +
    Deprecated Exception Classes
    -
    Exceptions
    +
    Exception Class
    Description
    - +
    +
    error_test1 passes.
    +
    + +
    exception_test1 passes.
    """, """ diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java index 0187764a134..87f1c5cebc2 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlTableTags/TestHtmlTableTags.java @@ -330,9 +330,9 @@ public class TestHtmlTableTags extends JavadocTester { class-summary.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show\ ('class-summary', 'class-summary-tab3', 2)" class="table-tab">Enum Classes\ -
    """); // Class documentation @@ -592,9 +592,9 @@ public class TestHtmlTableTags extends JavadocTester {
    A sample enum.
    """, """ -
    C3
    -
    +
    Test Annotation class.
    """); @@ -754,9 +754,9 @@ public class TestHtmlTableTags extends JavadocTester { e
    """, """ -
    C3
    -
    """); +
    """); // Class documentation checkOutput("pkg1/C1.html", true, diff --git a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java index cb21c17c7a7..3649d1e43a4 100644 --- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java +++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java @@ -1405,9 +1405,9 @@ public class TestModules extends JavadocTester { ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\ ck="show('all-classes-table', 'all-classes-table-tab2', 2)" class="table-tab">Cl\ asses\ -
    """, """ diff --git a/test/langtools/jdk/javadoc/doclet/testNewApiList/TestNewApiList.java b/test/langtools/jdk/javadoc/doclet/testNewApiList/TestNewApiList.java index d079715addb..1609dc11f9b 100644 --- a/test/langtools/jdk/javadoc/doclet/testNewApiList/TestNewApiList.java +++ b/test/langtools/jdk/javadoc/doclet/testNewApiList/TestNewApiList.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8263468 + * @bug 8263468 8269401 * @summary New page for "recent" new API * @library ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -109,8 +109,7 @@ public class TestNewApiList extends JavadocTester {
  • Interfaces
  • Classes
  • Enum Classes
  • -
  • Exceptions
  • -
  • Errors
  • +
  • Exception Classes
  • Record Classes
  • Annotation Interfaces
  • Fields
  • @@ -215,39 +214,31 @@ public class TestNewApiList extends JavadocTester {
    Test enum class.
    """, """ -
    +
    -
    -
    -
    Exceptions
    + eption-class-tab0" role="tab" aria-selected="true" aria-controls="exception-class.ta\ + bpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('exception-class', '\ + exception-class', 2)" class="active-table-tab">New Exception ClassesAdded in 2.0bAdded in 0.9
    +
    +
    +
    Exception Class
    Description
    - -
    -
    Test exception class.
    -
    """, - """ -
    -
    -
    -
    -
    Errors
    -
    Description
    - -
    + +
    Test error class.
    +
    +
    pkg.TestException +
    +
    Test exception class.
    """, """
    diff --git a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java index 4b613263d21..d25dba1df22 100644 --- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java +++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java @@ -818,14 +818,10 @@ public class TestSearch extends JavadocTester { \ + ception Classes\ \ - \
    diff --git a/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java b/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java index e368c2ad8db..d109294b170 100644 --- a/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java +++ b/test/langtools/jdk/javadoc/doclet/testSystemPropertyTaglet/TestSystemPropertyTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -179,12 +179,13 @@ public class TestSystemPropertyTaglet extends JavadocTester {
    System Property
    """, """
    test.property - Search tag in error mypackage.MyError
    + property" class="search-tag-link">test.property - Search tag in exception class mypackage.MyE\ + rror
    System Property
    """, """
    test.property - Search tag in exception mypackage.MyExc\ - eption
    + est.property" class="search-tag-link">test.property - Search tag in exception class mypackage\ + .MyException
    System Property
    """, """
    Date: Thu, 28 Oct 2021 11:57:21 +0000 Subject: [PATCH 101/890] 8275917: Some locks shouldn't allow_vm_block Reviewed-by: dholmes, pchilanomate --- .../share/classfile/systemDictionary.cpp | 1 + src/hotspot/share/oops/instanceKlass.cpp | 2 +- src/hotspot/share/runtime/mutexLocker.cpp | 42 +++++++++---------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index 31814259452..38e07f12be2 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1625,6 +1625,7 @@ bool SystemDictionary::do_unloading(GCTimer* gc_timer) { assert(_pd_cache_table->number_of_entries() == 0, "should be empty"); } + MutexLocker ml(is_concurrent ? ClassInitError_lock : NULL); InstanceKlass::clean_initialization_error_table(); } diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 2f385e53672..6af522daf58 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1061,7 +1061,7 @@ void InstanceKlass::clean_initialization_error_table() { } }; - MutexLocker ml(ClassInitError_lock); + assert_locked_or_safepoint(ClassInitError_lock); InitErrorTableCleaner cleaner; _initialization_error_table.unlink(&cleaner); } diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index 34b19eb51ac..5f03979314e 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -257,7 +257,7 @@ void mutex_init() { def(JmethodIdCreation_lock , PaddedMutex , nosafepoint-2); // used for creating jmethodIDs. - def(SharedDictionary_lock , PaddedMutex , safepoint, true); + def(SharedDictionary_lock , PaddedMutex , safepoint); def(VMStatistic_lock , PaddedMutex , safepoint); def(JNIHandleBlockFreeList_lock , PaddedMutex , nosafepoint-1); // handles are used by VM thread def(SignatureHandlerLibrary_lock , PaddedMutex , safepoint); @@ -266,19 +266,19 @@ void mutex_init() { #ifndef PRODUCT def(FullGCALot_lock , PaddedMutex , safepoint); // a lock to make FullGCALot MT safe #endif - def(BeforeExit_lock , PaddedMonitor, safepoint, true); + def(BeforeExit_lock , PaddedMonitor, safepoint); def(NonJavaThreadsList_lock , PaddedMutex, nosafepoint-1); def(NonJavaThreadsListSync_lock , PaddedMutex, nosafepoint); def(RetData_lock , PaddedMutex , safepoint); - def(Terminator_lock , PaddedMonitor, safepoint, true); + def(Terminator_lock , PaddedMonitor, safepoint, true); def(InitCompleted_lock , PaddedMonitor, nosafepoint); - def(Notify_lock , PaddedMonitor, safepoint, true); - def(AdapterHandlerLibrary_lock , PaddedMutex , safepoint, true); + def(Notify_lock , PaddedMonitor, safepoint, true); + def(AdapterHandlerLibrary_lock , PaddedMutex , safepoint); def(Heap_lock , PaddedMonitor, safepoint); // Doesn't safepoint check during termination. - def(JfieldIdCreation_lock , PaddedMutex , safepoint, true); // jfieldID, Used in VM_Operation + def(JfieldIdCreation_lock , PaddedMutex , safepoint); def(CompiledIC_lock , PaddedMutex , nosafepoint); // locks VtableStubs_lock, InlineCacheBuffer_lock def(MethodCompileQueue_lock , PaddedMonitor, safepoint); @@ -290,14 +290,14 @@ void mutex_init() { def(EscapeBarrier_lock , PaddedMonitor, nosafepoint); // Used to synchronize object reallocation/relocking triggered by JVMTI def(Management_lock , PaddedMutex , safepoint); // used for JVM management - def(ConcurrentGCBreakpoints_lock , PaddedMonitor, safepoint, true); + def(ConcurrentGCBreakpoints_lock , PaddedMonitor, safepoint, true); def(MethodData_lock , PaddedMutex , safepoint); def(TouchedMethodLog_lock , PaddedMutex , safepoint); def(CompileThread_lock , PaddedMonitor, safepoint); - def(PeriodicTask_lock , PaddedMonitor, safepoint, true); - def(RedefineClasses_lock , PaddedMonitor, safepoint, true); - def(Verify_lock , PaddedMutex, safepoint, true); + def(PeriodicTask_lock , PaddedMonitor, safepoint, true); + def(RedefineClasses_lock , PaddedMonitor, safepoint); + def(Verify_lock , PaddedMutex, safepoint); if (WhiteBoxAPI) { def(Compilation_lock , PaddedMonitor, nosafepoint); @@ -337,7 +337,7 @@ void mutex_init() { def(Zip_lock , PaddedMonitor, nosafepoint-1); // Holds DumpTimeTable_lock #if INCLUDE_JVMCI - def(JVMCI_lock , PaddedMonitor, safepoint, true); + def(JVMCI_lock , PaddedMonitor, safepoint, true); #endif // These locks have relative rankings, and inherit safepoint checking attributes from that rank. @@ -351,21 +351,21 @@ void mutex_init() { defl(Heap_lock , PaddedMonitor, MultiArray_lock); defl(Compile_lock , PaddedMutex , MethodCompileQueue_lock); - defl(PerfDataMemAlloc_lock , PaddedMutex , Heap_lock, true); - defl(PerfDataManager_lock , PaddedMutex , Heap_lock, true); + defl(PerfDataMemAlloc_lock , PaddedMutex , Heap_lock); + defl(PerfDataManager_lock , PaddedMutex , Heap_lock); defl(ClassLoaderDataGraph_lock , PaddedMutex , MultiArray_lock); - defl(VMOperation_lock , PaddedMonitor, Compile_lock, true); - defl(ClassInitError_lock , PaddedMonitor, Threads_lock, true); + defl(VMOperation_lock , PaddedMonitor, Compile_lock, true); + defl(ClassInitError_lock , PaddedMonitor, Threads_lock); if (UseG1GC) { - defl(G1OldGCCount_lock , PaddedMonitor, Threads_lock, true); + defl(G1OldGCCount_lock , PaddedMonitor, Threads_lock, true); } - defl(CompileTaskAlloc_lock , PaddedMutex , MethodCompileQueue_lock, true); - defl(ExpandHeap_lock , PaddedMutex , Heap_lock, true); - defl(OopMapCacheAlloc_lock , PaddedMutex , Threads_lock, true); + defl(CompileTaskAlloc_lock , PaddedMutex , MethodCompileQueue_lock); + defl(ExpandHeap_lock , PaddedMutex , Heap_lock, true); + defl(OopMapCacheAlloc_lock , PaddedMutex , Threads_lock, true); defl(Module_lock , PaddedMutex , ClassLoaderDataGraph_lock); - defl(SystemDictionary_lock , PaddedMonitor, Module_lock, true); - defl(JNICritical_lock , PaddedMonitor, MultiArray_lock, true); // used for JNI critical regions + defl(SystemDictionary_lock , PaddedMonitor, Module_lock); + defl(JNICritical_lock , PaddedMonitor, MultiArray_lock); // used for JNI critical regions } GCMutexLocker::GCMutexLocker(Mutex* mutex) { -- GitLab From a343fa8766bb12188881319f06b1d93161cf1619 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Thu, 28 Oct 2021 12:40:30 +0000 Subject: [PATCH 102/890] 8275865: Print deoptimization statistics in product builds Reviewed-by: thartmann, kvn --- src/hotspot/share/runtime/java.cpp | 11 ++- .../jtreg/runtime/logging/DeoptStats.java | 75 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/logging/DeoptStats.java diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index 59510eec897..bb5b46af6c5 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -230,7 +230,6 @@ void print_statistics() { if ((PrintC1Statistics || LogVMOutput || LogCompilation) && UseCompiler) { FlagSetting fs(DisplayVMOutput, DisplayVMOutput && PrintC1Statistics); Runtime1::print_statistics(); - Deoptimization::print_statistics(); SharedRuntime::print_statistics(); } #endif /* COMPILER1 */ @@ -239,8 +238,8 @@ void print_statistics() { if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && UseCompiler) { FlagSetting fs(DisplayVMOutput, DisplayVMOutput && PrintOptoStatistics); Compile::print_statistics(); -#ifndef COMPILER1 Deoptimization::print_statistics(); +#ifndef COMPILER1 SharedRuntime::print_statistics(); #endif //COMPILER1 os::print_statistics(); @@ -352,6 +351,14 @@ void print_statistics() { CompileBroker::print_times(); } +#ifdef COMPILER2_OR_JVMCI + if ((LogVMOutput || LogCompilation) && UseCompiler) { + // Only print the statistics to the log file + FlagSetting fs(DisplayVMOutput, false); + Deoptimization::print_statistics(); + } +#endif /* COMPILER2 || INCLUDE_JVMCI */ + if (PrintCodeCache) { MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); CodeCache::print(); diff --git a/test/hotspot/jtreg/runtime/logging/DeoptStats.java b/test/hotspot/jtreg/runtime/logging/DeoptStats.java new file mode 100644 index 00000000000..b5d3584e160 --- /dev/null +++ b/test/hotspot/jtreg/runtime/logging/DeoptStats.java @@ -0,0 +1,75 @@ +/* + * Copyright Amazon.com Inc. 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 8275865 + * @requires vm.compiler2.enabled + * @summary Verify that the Deoptimization statistics are printed to the VM/Compiler log file + * @library /test/lib + * @run main/othervm -Xbatch -XX:-UseOnStackReplacement -XX:-OmitStackTraceInFastThrow + * -XX:-OmitStackTraceInFastThrow + * -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation + * -XX:-LogVMOutput -XX:LogFile=compilation.log DeoptStats + * @run main/othervm -Xbatch -XX:-UseOnStackReplacement -XX:-OmitStackTraceInFastThrow + * -XX:-OmitStackTraceInFastThrow + * -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation + * -XX:+LogVMOutput -XX:LogFile=vmOutput.log DeoptStats + * @run main/othervm DeoptStats compilation.log vmOutput.log + */ + +import java.nio.file.Paths; +import jdk.test.lib.process.OutputAnalyzer; + +public class DeoptStats { + + static class Value { + int i; + } + + static int f(Value v) { + return v.i; + } + + public static void verify(String[] logFiles) throws Exception { + for (String logFile : logFiles) { + OutputAnalyzer oa = new OutputAnalyzer(Paths.get(logFile)); + oa.shouldMatchByLine("", // Start from this line + "", // Match until this line + "(Deoptimization traps recorded:)|( .+)"); + } + } + + public static void main(String[] args) throws Exception { + if (args.length > 0) { + verify(args); + } else { + for (int i = 0; i < 20_000; i++) { + try { + f(null); + } + catch (NullPointerException npe) { } + } + } + } +} -- GitLab From 85d8cd85665d92d67bbc88399baaa8fe7eba14a6 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Thu, 28 Oct 2021 12:58:03 +0000 Subject: [PATCH 103/890] 8276100: Remove G1SegmentedArray constructor name parameter Reviewed-by: ayang --- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 2 +- src/hotspot/share/gc/g1/g1SegmentedArray.hpp | 3 +-- src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index fe5beceef14..ad21bd548a0 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -35,7 +35,7 @@ template G1CardSetAllocator::G1CardSetAllocator(const char* name, const G1CardSetAllocOptions* buffer_options, G1CardSetBufferList* free_buffer_list) : - _segmented_array(name, buffer_options, free_buffer_list), + _segmented_array(buffer_options, free_buffer_list), _transfer_lock(false), _free_nodes_list(), _pending_nodes_list(), diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp index fce3d9187b4..b3f6680b02a 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp @@ -198,8 +198,7 @@ public: inline uint elem_size() const; - G1SegmentedArray(const char* name, - const G1SegmentedArrayAllocOptions* buffer_options, + G1SegmentedArray(const G1SegmentedArrayAllocOptions* buffer_options, G1SegmentedArrayBufferList* free_buffer_list); ~G1SegmentedArray() { drop_all(); diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp index e5b96aeb146..741229bd104 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp @@ -154,8 +154,7 @@ uint G1SegmentedArray::elem_size() const { } template -G1SegmentedArray::G1SegmentedArray(const char* name, - const G1SegmentedArrayAllocOptions* buffer_options, +G1SegmentedArray::G1SegmentedArray(const G1SegmentedArrayAllocOptions* buffer_options, G1SegmentedArrayBufferList* free_buffer_list) : _alloc_options(buffer_options), _first(nullptr), -- GitLab From abe52aea23d6025737666dfc2b265fdf1aae14bb Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Thu, 28 Oct 2021 14:40:53 +0000 Subject: [PATCH 104/890] 8275518: accessibility issue in Inet6Address docs Reviewed-by: ihse, jjg --- .../share/classes/java/net/Inet6Address.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/java/net/Inet6Address.java b/src/java.base/share/classes/java/net/Inet6Address.java index bbb31b45241..751623536e7 100644 --- a/src/java.base/share/classes/java/net/Inet6Address.java +++ b/src/java.base/share/classes/java/net/Inet6Address.java @@ -119,10 +119,9 @@ import java.util.Arrays; *

    Special IPv6 address

    * *
    - * - * - * - * - *
    Description of IPv4-mapped address
    IPv4-mapped addressOf the form ::ffff:w.x.y.z, this IPv6 address is used to + *
    + *
    IPv4-mapped address
    + *
    Of the form ::ffff:w.x.y.z, this IPv6 address is used to * represent an IPv4 address. It allows the native program to * use the same address data structure and also the same * socket when communicating with both IPv4 and IPv6 nodes. @@ -132,12 +131,13 @@ import java.util.Arrays; * return an IPv4-mapped address. These classes can take an * IPv4-mapped address as input, both in byte array and text * representation. However, it will be converted into an IPv4 - * address.
    + * address. + * + * * *

    Textual representation of IPv6 scoped addresses

    * - *

    The textual representation of IPv6 addresses as described above can be + *

    The textual representation of IPv6 addresses as described above can be * extended to specify IPv6 scoped addresses. This extension to the basic * addressing architecture is described in [draft-ietf-ipngwg-scoping-arch-04.txt]. * -- GitLab From 309acbf0e86a0d248294503fccc7a936fa0a846e Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Thu, 28 Oct 2021 15:27:26 +0000 Subject: [PATCH 105/890] 8275703: System.loadLibrary fails on Big Sur for libraries hidden from filesystem Reviewed-by: dholmes, alanb, mcimadamore --- make/test/JtregNativeJdk.gmk | 3 +- src/hotspot/share/include/jvm.h | 2 +- src/hotspot/share/prims/jvm.cpp | 31 +++++---- .../internal/loader/ClassLoaderHelper.java | 28 +++++++- .../jdk/internal/loader/NativeLibraries.java | 29 +++++---- .../share/native/libjava/NativeLibraries.c | 7 +- .../internal/loader/ClassLoaderHelper.java | 10 ++- .../internal/loader/ClassLoaderHelper.java | 10 ++- .../exeLibraryCache/LibraryFromCache.java | 64 +++++++++++++++++++ .../exeLibraryCache/exeLibraryCache.c | 49 ++++++++++++++ 10 files changed, 200 insertions(+), 33 deletions(-) create mode 100644 test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/LibraryFromCache.java create mode 100644 test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/exeLibraryCache.c diff --git a/make/test/JtregNativeJdk.gmk b/make/test/JtregNativeJdk.gmk index 8ed5cbd2a58..270ff93d147 100644 --- a/make/test/JtregNativeJdk.gmk +++ b/make/test/JtregNativeJdk.gmk @@ -87,8 +87,9 @@ ifeq ($(call isTargetOs, macosx), true) -framework Cocoa -framework SystemConfiguration else BUILD_JDK_JTREG_EXCLUDE += libTestMainKeyWindow.m - BUILD_JDK_JTREG_EXCLUDE += exeJniInvocationTest.c BUILD_JDK_JTREG_EXCLUDE += libTestDynamicStore.m + BUILD_JDK_JTREG_EXCLUDE += exeJniInvocationTest.c + BUILD_JDK_JTREG_EXCLUDE += exeLibraryCache.c endif ifeq ($(call isTargetOs, linux), true) diff --git a/src/hotspot/share/include/jvm.h b/src/hotspot/share/include/jvm.h index 00035a68072..7783b00841d 100644 --- a/src/hotspot/share/include/jvm.h +++ b/src/hotspot/share/include/jvm.h @@ -151,7 +151,7 @@ JNIEXPORT jboolean JNICALL JVM_IsUseContainerSupport(void); JNIEXPORT void * JNICALL -JVM_LoadLibrary(const char *name); +JVM_LoadLibrary(const char *name, jboolean throwException); JNIEXPORT void JNICALL JVM_UnloadLibrary(void * handle); diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index 9638c828143..f44b34bf4e5 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -3369,7 +3369,7 @@ JVM_END // Library support /////////////////////////////////////////////////////////////////////////// -JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name)) +JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name, jboolean throwException)) //%note jvm_ct char ebuf[1024]; void *load_result; @@ -3378,18 +3378,23 @@ JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name)) load_result = os::dll_load(name, ebuf, sizeof ebuf); } if (load_result == NULL) { - char msg[1024]; - jio_snprintf(msg, sizeof msg, "%s: %s", name, ebuf); - // Since 'ebuf' may contain a string encoded using - // platform encoding scheme, we need to pass - // Exceptions::unsafe_to_utf8 to the new_exception method - // as the last argument. See bug 6367357. - Handle h_exception = - Exceptions::new_exception(thread, - vmSymbols::java_lang_UnsatisfiedLinkError(), - msg, Exceptions::unsafe_to_utf8); - - THROW_HANDLE_0(h_exception); + if (throwException) { + char msg[1024]; + jio_snprintf(msg, sizeof msg, "%s: %s", name, ebuf); + // Since 'ebuf' may contain a string encoded using + // platform encoding scheme, we need to pass + // Exceptions::unsafe_to_utf8 to the new_exception method + // as the last argument. See bug 6367357. + Handle h_exception = + Exceptions::new_exception(thread, + vmSymbols::java_lang_UnsatisfiedLinkError(), + msg, Exceptions::unsafe_to_utf8); + + THROW_HANDLE_0(h_exception); + } else { + log_info(library)("Failed to load library %s", name); + return load_result; + } } log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, name, p2i(load_result)); return load_result; diff --git a/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java b/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java index ac8deb2b22f..8f6cfc4da6b 100644 --- a/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java +++ b/src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -27,11 +27,37 @@ package jdk.internal.loader; import java.io.File; import java.util.ArrayList; +import sun.security.action.GetPropertyAction; class ClassLoaderHelper { + private static final boolean hasDynamicLoaderCache; + static { + String osVersion = GetPropertyAction.privilegedGetProperty("os.version"); + // dynamic linker cache support on os.version >= 11.x + int major = 11; + int i = osVersion.indexOf('.'); + try { + major = Integer.parseInt(i < 0 ? osVersion : osVersion.substring(0, i)); + } catch (NumberFormatException e) {} + hasDynamicLoaderCache = major >= 11; + } private ClassLoaderHelper() {} + /** + * Returns true if loading a native library only if + * it's present on the file system. + * + * @implNote + * On macOS 11.x or later which supports dynamic linker cache, + * the dynamic library is not present on the filesystem. The + * library cannot determine if a dynamic library exists on a + * given path or not and so this method returns false. + */ + static boolean loadLibraryOnlyIfPresent() { + return !hasDynamicLoaderCache; + } + /** * Returns an alternate path name for the given file * such that if the original pathname did not exist, then the diff --git a/src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java b/src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java index 4814633d038..11df544fd7c 100644 --- a/src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java +++ b/src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java @@ -36,7 +36,6 @@ import java.util.ArrayDeque; import java.util.Deque; import java.util.function.BiFunction; import java.util.function.Function; -import java.util.HashSet; import java.util.Objects; import java.util.Map; import java.util.Set; @@ -56,7 +55,7 @@ import java.util.concurrent.locks.ReentrantLock; * will fail. */ public final class NativeLibraries { - + private static final boolean loadLibraryOnlyIfPresent = ClassLoaderHelper.loadLibraryOnlyIfPresent(); private final Map libraries = new ConcurrentHashMap<>(); private final ClassLoader loader; // caller, if non-null, is the fromClass parameter for NativeLibraries::loadLibrary @@ -145,7 +144,8 @@ public final class NativeLibraries { } /* - * Load a native library from the given file. Returns null if file does not exist. + * Load a native library from the given file. Returns null if the given + * library is determined to be non-loadable, which is system-dependent. * * @param fromClass the caller class calling System::loadLibrary * @param file the path of the native library @@ -158,14 +158,17 @@ public final class NativeLibraries { boolean isBuiltin = (name != null); if (!isBuiltin) { name = AccessController.doPrivileged(new PrivilegedAction<>() { - public String run() { - try { - return file.exists() ? file.getCanonicalPath() : null; - } catch (IOException e) { - return null; + public String run() { + try { + if (loadLibraryOnlyIfPresent && !file.exists()) { + return null; + } + return file.getCanonicalPath(); + } catch (IOException e) { + return null; + } } - } - }); + }); if (name == null) { return null; } @@ -389,7 +392,7 @@ public final class NativeLibraries { throw new InternalError("Native library " + name + " has been loaded"); } - return load(this, name, isBuiltin, isJNI); + return load(this, name, isBuiltin, isJNI, loadLibraryOnlyIfPresent); } } @@ -575,7 +578,9 @@ public final class NativeLibraries { // JNI FindClass expects the caller class if invoked from JNI_OnLoad // and JNI_OnUnload is NativeLibrary class - private static native boolean load(NativeLibraryImpl impl, String name, boolean isBuiltin, boolean isJNI); + private static native boolean load(NativeLibraryImpl impl, String name, + boolean isBuiltin, boolean isJNI, + boolean throwExceptionIfFail); private static native void unload(String name, boolean isBuiltin, boolean isJNI, long handle); private static native String findBuiltinLib(String name); private static native long findEntry0(NativeLibraryImpl lib, String name); diff --git a/src/java.base/share/native/libjava/NativeLibraries.c b/src/java.base/share/native/libjava/NativeLibraries.c index 1d973c93a24..71b8b8cac72 100644 --- a/src/java.base/share/native/libjava/NativeLibraries.c +++ b/src/java.base/share/native/libjava/NativeLibraries.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -113,7 +113,8 @@ static void *findJniFunction(JNIEnv *env, void *handle, */ JNIEXPORT jboolean JNICALL Java_jdk_internal_loader_NativeLibraries_load - (JNIEnv *env, jobject this, jobject lib, jstring name, jboolean isBuiltin, jboolean isJNI) + (JNIEnv *env, jobject this, jobject lib, jstring name, + jboolean isBuiltin, jboolean isJNI, jboolean throwExceptionIfFail) { const char *cname; jint jniVersion; @@ -127,7 +128,7 @@ Java_jdk_internal_loader_NativeLibraries_load cname = JNU_GetStringPlatformChars(env, name, 0); if (cname == 0) return JNI_FALSE; - handle = isBuiltin ? procHandle : JVM_LoadLibrary(cname); + handle = isBuiltin ? procHandle : JVM_LoadLibrary(cname, throwExceptionIfFail); if (isJNI) { if (handle) { JNI_OnLoad_t JNI_OnLoad; diff --git a/src/java.base/unix/classes/jdk/internal/loader/ClassLoaderHelper.java b/src/java.base/unix/classes/jdk/internal/loader/ClassLoaderHelper.java index fb4a5043134..2151ad07b01 100644 --- a/src/java.base/unix/classes/jdk/internal/loader/ClassLoaderHelper.java +++ b/src/java.base/unix/classes/jdk/internal/loader/ClassLoaderHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -32,6 +32,14 @@ class ClassLoaderHelper { private ClassLoaderHelper() {} + /** + * Returns true if loading a native library only if + * it's present on the file system. + */ + static boolean loadLibraryOnlyIfPresent() { + return true; + } + /** * Returns an alternate path name for the given file * such that if the original pathname did not exist, then the diff --git a/src/java.base/windows/classes/jdk/internal/loader/ClassLoaderHelper.java b/src/java.base/windows/classes/jdk/internal/loader/ClassLoaderHelper.java index e386585fb4f..423805f0842 100644 --- a/src/java.base/windows/classes/jdk/internal/loader/ClassLoaderHelper.java +++ b/src/java.base/windows/classes/jdk/internal/loader/ClassLoaderHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -31,6 +31,14 @@ class ClassLoaderHelper { private ClassLoaderHelper() {} + /** + * Returns true if loading a native library only if + * it's present on the file system. + */ + static boolean loadLibraryOnlyIfPresent() { + return true; + } + /** * Returns an alternate path name for the given file * such that if the original pathname did not exist, then the diff --git a/test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/LibraryFromCache.java b/test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/LibraryFromCache.java new file mode 100644 index 00000000000..e11746a48f9 --- /dev/null +++ b/test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/LibraryFromCache.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021, 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 8275703 + * @library /test/lib + * @requires os.family == "mac" + * @run main/native/othervm -Djava.library.path=/usr/lib LibraryFromCache blas + * @run main/native/othervm -Djava.library.path=/usr/lib LibraryFromCache BLAS + * @summary Test System::loadLibrary to be able to load a library even + * if it's not present on the filesystem on macOS which supports + * dynamic library cache + */ + +import jdk.test.lib.process.OutputAnalyzer; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class LibraryFromCache { + public static void main(String[] args) throws IOException { + String libname = args[0]; + if (!systemHasLibrary(libname)) { + System.out.println("Test skipped. Library " + libname + " not found"); + return; + } + + System.loadLibrary(libname); + } + + /* + * Returns true if dlopen successfully loads the specified library + */ + private static boolean systemHasLibrary(String libname) throws IOException { + Path launcher = Paths.get(System.getProperty("test.nativepath"), "LibraryCache"); + ProcessBuilder pb = new ProcessBuilder(launcher.toString(), "lib" + libname + ".dylib"); + OutputAnalyzer outputAnalyzer = new OutputAnalyzer(pb.start()); + System.out.println(outputAnalyzer.getOutput()); + return outputAnalyzer.getExitValue() == 0; + } +} diff --git a/test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/exeLibraryCache.c b/test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/exeLibraryCache.c new file mode 100644 index 00000000000..846e04e71ef --- /dev/null +++ b/test/jdk/java/lang/RuntimeTests/loadLibrary/exeLibraryCache/exeLibraryCache.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021, 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 +#include + +int main(int argc, char** argv) +{ + void *handle; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + return EXIT_FAILURE; + } + + printf("Attempting to load library '%s'...\n", argv[1]); + + handle = dlopen(argv[1], RTLD_LAZY); + + if (handle == NULL) { + fprintf(stderr, "Unable to load library!\n"); + return EXIT_FAILURE; + } + + printf("Library successfully loaded!\n"); + + return dlclose(handle); +} -- GitLab From c92f23055724d2df462f64fc51e57f5a13f679bb Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Thu, 28 Oct 2021 15:37:15 +0000 Subject: [PATCH 106/890] 8276110: Problemlist javax/swing/JMenu/4515762/bug4515762.java for macos12 Reviewed-by: azvegint --- test/jdk/ProblemList.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 97ae0014dc1..939af59ed4b 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -741,6 +741,8 @@ javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.ja java/awt/Window/8159168/SetShapeTest.java 8274106 macosx-aarch64 java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java 8274106 macosx-aarch64 javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8274106 macosx-aarch64 +# macos12 failure +javax/swing/JMenu/4515762/bug4515762.java 8276074 macosx-all sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all sanity/client/SwingSet/src/ScrollPaneDemoTest.java 8225013 linux-all -- GitLab From cb989cf3a182ee07fe127b4536e7ff4213f31eaf Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Thu, 28 Oct 2021 15:51:29 +0000 Subject: [PATCH 107/890] 8275052: AArch64: Severe AES/GCM slowdown on MacOS for short blocks Reviewed-by: ngasson, adinn --- src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 14 +++++++------- .../os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index 0388bb73b91..fff6cd8cf99 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -7375,12 +7375,6 @@ class StubGenerator: public StubCodeGenerator { } #endif // COMPILER2 - // generate GHASH intrinsics code - if (UseGHASHIntrinsics) { - // StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks(); - StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks_wide(); - } - if (UseBASE64Intrinsics) { StubRoutines::_base64_encodeBlock = generate_base64_encodeBlock(); StubRoutines::_base64_decodeBlock = generate_base64_decodeBlock(); @@ -7395,9 +7389,15 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt(); - StubRoutines::_galoisCounterMode_AESCrypt = generate_galoisCounterMode_AESCrypt(); StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt(); } + if (UseGHASHIntrinsics) { + // StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks(); + StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks_wide(); + } + if (UseAESIntrinsics && UseGHASHIntrinsics) { + StubRoutines::_galoisCounterMode_AESCrypt = generate_galoisCounterMode_AESCrypt(); + } if (UseSHA1Intrinsics) { StubRoutines::_sha1_implCompress = generate_sha1_implCompress(false, "sha1_implCompress"); diff --git a/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp index 13f4b8afbc4..0a5a2a99992 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp +++ b/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp @@ -60,8 +60,8 @@ void VM_Version::get_os_cpu_info() { assert(cpu_has("hw.optional.neon"), "should be"); _features = CPU_FP | CPU_ASIMD; - // All Apple-darwin Arm processors have AES. - _features |= CPU_AES; + // All Apple-darwin Arm processors have AES and PMULL. + _features |= CPU_AES | CPU_PMULL; // Only few features are available via sysctl, see line 614 // https://opensource.apple.com/source/xnu/xnu-6153.141.1/bsd/kern/kern_mib.c.auto.html -- GitLab From 63b9f8c0da2ed3634002f0f67b18555826aeddc4 Mon Sep 17 00:00:00 2001 From: Mitsuru Kariya Date: Thu, 28 Oct 2021 15:56:17 +0000 Subject: [PATCH 108/890] 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. Reviewed-by: lancea --- .../javax/sql/rowset/serial/SerialBlob.java | 93 ++++++++++--------- .../javax/sql/rowset/serial/SerialClob.java | 93 ++++++++++--------- .../test/rowset/serial/SerialBlobTests.java | 76 ++++++++++++++- .../test/rowset/serial/SerialClobTests.java | 85 +++++++++++++++-- 4 files changed, 253 insertions(+), 94 deletions(-) diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java index ff64e6ccc86..34474deb593 100644 --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -298,22 +298,21 @@ public class SerialBlob implements Blob, Serializable, Cloneable { } /** - * Writes the given array of bytes to the BLOB value that - * this Blob object represents, starting at position - * pos, and returns the number of bytes written. + * Writes the given array of bytes to the {@code BLOB} value that + * this {@code Blob} object represents, starting at position + * {@code pos}, and returns the number of bytes written. * - * @param pos the position in the SQL BLOB value at which - * to start writing. The first position is 1; - * must not be less than 1 nor greater than - * the length of this SerialBlob object. - * @param bytes the array of bytes to be written to the BLOB - * value that this Blob object represents + * @param pos the position in the SQL {@code BLOB} value at which + * to start writing. The first position is {@code 1}; + * must not be less than {@code 1} nor greater than + * the length+1 of this {@code SerialBlob} object. + * @param bytes the array of bytes to be written to the {@code BLOB} + * value that this {@code Blob} object represents * @return the number of bytes written * @throws SerialException if there is an error accessing the - * BLOB value; or if an invalid position is set; if an - * invalid offset value is set; + * {@code BLOB} value; or if an invalid position is set; * if {@code free} had previously been called on this object - * @throws SQLException if there is an error accessing the BLOB + * @throws SQLException if there is an error accessing the {@code BLOB} * value from the database * @see #getBytes */ @@ -323,33 +322,33 @@ public class SerialBlob implements Blob, Serializable, Cloneable { } /** - * Writes all or part of the given byte array to the - * BLOB value that this Blob object represents + * Writes all or part of the given {@code byte} array to the + * {@code BLOB} value that this {@code Blob} object represents * and returns the number of bytes written. - * Writing starts at position pos in the BLOB - * value; len bytes from the given byte array are written. + * Writing starts at position {@code pos} in the {@code BLOB} + * value; {@code length} bytes from the given byte array are written. * - * @param pos the position in the BLOB object at which - * to start writing. The first position is 1; - * must not be less than 1 nor greater than - * the length of this SerialBlob object. - * @param bytes the array of bytes to be written to the BLOB + * @param pos the position in the {@code BLOB} object at which + * to start writing. The first position is {@code 1}; + * must not be less than {@code 1} nor greater than + * the length+1 of this {@code SerialBlob} object. + * @param bytes the array of bytes to be written to the {@code BLOB} * value - * @param offset the offset in the byte array at which - * to start reading the bytes. The first offset position is - * 0; must not be less than 0 nor greater - * than the length of the byte array + * @param offset the offset into the array {@code byte}s at which + * to start reading the bytes to be set. The first offset position is + * {@code 0}; must not be less than {@code 0} nor greater + * than the length of the array {@code byte}s * @param length the number of bytes to be written to the - * BLOB value from the array of bytes bytes. + * {@code BLOB} value from the array of bytes {@code byte}s * * @return the number of bytes written * @throws SerialException if there is an error accessing the - * BLOB value; if an invalid position is set; if an - * invalid offset value is set; if number of bytes to be written - * is greater than the SerialBlob length; or the combined - * values of the length and offset is greater than the Blob buffer; + * {@code BLOB} value; if an invalid position is set; if an + * invalid offset value is set; or the combined values of the + * {@code length} and {@code offset} is greater than the length of + * {@code byte}s; * if {@code free} had previously been called on this object - * @throws SQLException if there is an error accessing the BLOB + * @throws SQLException if there is an error accessing the {@code BLOB} * value from the database. * @see #getBytes */ @@ -361,26 +360,34 @@ public class SerialBlob implements Blob, Serializable, Cloneable { throw new SerialException("Invalid offset in byte array set"); } - if (pos < 1 || pos > this.length()) { - throw new SerialException("Invalid position in BLOB object set"); + if (length < 0) { + throw new SerialException("Invalid arguments: length cannot be " + + "negative"); } - if ((long)(length) > origLen) { - throw new SerialException("Buffer is not sufficient to hold the value"); + if (pos < 1 || pos > len + 1) { + throw new SerialException("Invalid position in BLOB object set"); } - if ((length + offset) > bytes.length) { + if (length > bytes.length - offset) { throw new SerialException("Invalid OffSet. Cannot have combined offset " + - "and length that is greater that the Blob buffer"); + "and length that is greater than the length of bytes"); + } + + if (pos - 1 + length > Integer.MAX_VALUE) { + throw new SerialException("Invalid length. Cannot have combined pos " + + "and length that is greater than Integer.MAX_VALUE"); } - int i = 0; pos--; // correct to array indexing - while ( i < length || (offset + i +1) < (bytes.length-offset) ) { - this.buf[(int)pos + i] = bytes[offset + i ]; - i++; + if (pos + length > len) { + len = pos + length; + byte[] newbuf = new byte[(int)len]; + System.arraycopy(buf, 0, newbuf, 0, (int)pos); + buf = newbuf; } - return i; + System.arraycopy(bytes, offset, buf, (int)pos, length); + return length; } /** diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialClob.java b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialClob.java index 48ee5ea878f..e548ba217f7 100644 --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialClob.java +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialClob.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -361,22 +361,19 @@ public class SerialClob implements Clob, Serializable, Cloneable { } /** - * Writes the given Java String to the CLOB - * value that this SerialClob object represents, at the position - * pos. + * Writes the given Java {@code String} to the {@code CLOB} + * value that this {@code SerialClob} object represents, at the position + * {@code pos}. * - * @param pos the position at which to start writing to the CLOB - * value that this SerialClob object represents; the first - * position is 1; must not be less than 1 nor - * greater than the length of this SerialClob object - * @param str the string to be written to the CLOB - * value that this SerialClob object represents + * @param pos the position at which to start writing to the {@code CLOB} + * value that this {@code SerialClob} object represents; the first + * position is {@code 1}; must not be less than {@code 1} nor + * greater than the length+1 of this {@code SerialClob} object + * @param str the string to be written to the {@code CLOB} + * value that this {@code SerialClob} object represents * @return the number of characters written * @throws SerialException if there is an error accessing the - * CLOB value; if an invalid position is set; if an - * invalid offset value is set; if number of bytes to be written - * is greater than the SerialClob length; or the combined - * values of the length and offset is greater than the Clob buffer; + * {@code CLOB} value; if an invalid position is set; * if the {@code free} method had been previously called on this object */ public int setString(long pos, String str) throws SerialException { @@ -384,58 +381,66 @@ public class SerialClob implements Clob, Serializable, Cloneable { } /** - * Writes len characters of str, starting - * at character offset, to the CLOB value - * that this Clob represents. + * Writes {@code len} characters of {@code str}, starting + * at character {@code offset}, to the {@code CLOB} value + * that this {@code Clob} represents. * - * @param pos the position at which to start writing to the CLOB - * value that this SerialClob object represents; the first - * position is 1; must not be less than 1 nor - * greater than the length of this SerialClob object - * @param str the string to be written to the CLOB - * value that this Clob object represents - * @param offset the offset into str to start reading + * @param pos the position at which to start writing to the {@code CLOB} + * value that this {@code SerialClob} object represents; the first + * position is {@code 1}; must not be less than {@code 1} nor + * greater than the length+1 of this {@code SerialClob} object + * @param str the string to be written to the {@code CLOB} + * value that this {@code Clob} object represents + * @param offset the offset into {@code str} to start reading * the characters to be written * @param length the number of characters to be written * @return the number of characters written * @throws SerialException if there is an error accessing the - * CLOB value; if an invalid position is set; if an - * invalid offset value is set; if number of bytes to be written - * is greater than the SerialClob length; or the combined - * values of the length and offset is greater than the Clob buffer; + * {@code CLOB} value; if an invalid position is set; if an + * invalid offset value is set; or the combined values of the + * {@code length} and {@code offset} is greater than the length of + * {@code str}; * if the {@code free} method had been previously called on this object */ public int setString(long pos, String str, int offset, int length) throws SerialException { isValid(); - String temp = str.substring(offset); - char cPattern[] = temp.toCharArray(); - if (offset < 0 || offset > str.length()) { - throw new SerialException("Invalid offset in byte array set"); + throw new SerialException("Invalid offset in String object set"); } - if (pos < 1 || pos > this.length()) { - throw new SerialException("Invalid position in Clob object set"); + if (length < 0) { + throw new SerialException("Invalid arguments: length cannot be " + + "negative"); } - if ((long)(length) > origLen) { - throw new SerialException("Buffer is not sufficient to hold the value"); + if (pos < 1 || pos > len + 1) { + throw new SerialException("Invalid position in Clob object set"); } - if ((length + offset) > str.length()) { - // need check to ensure length + offset !> bytes.length + if (length > str.length() - offset) { + // need check to ensure length + offset !> str.length throw new SerialException("Invalid OffSet. Cannot have combined offset " + - " and length that is greater that the Blob buffer"); + " and length that is greater than the length of str"); + } + + if (pos - 1 + length > Integer.MAX_VALUE) { + throw new SerialException("Invalid length. Cannot have combined pos " + + "and length that is greater than Integer.MAX_VALUE"); } - int i = 0; pos--; //values in the array are at position one less - while ( i < length || (offset + i +1) < (str.length() - offset ) ) { - this.buf[(int)pos + i ] = cPattern[offset + i ]; - i++; + if (pos + length > len) { + len = pos + length; + char[] newbuf = new char[(int)len]; + System.arraycopy(buf, 0, newbuf, 0, (int)pos); + buf = newbuf; } - return i; + + String temp = str.substring(offset, offset + length); + char cPattern[] = temp.toCharArray(); + System.arraycopy(cPattern, 0, buf, (int)pos, length); + return length; } /** diff --git a/test/jdk/javax/sql/testng/test/rowset/serial/SerialBlobTests.java b/test/jdk/javax/sql/testng/test/rowset/serial/SerialBlobTests.java index e080b1ca1b9..f3f6c327683 100644 --- a/test/jdk/javax/sql/testng/test/rowset/serial/SerialBlobTests.java +++ b/test/jdk/javax/sql/testng/test/rowset/serial/SerialBlobTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -396,4 +396,78 @@ public class SerialBlobTests extends BaseTest { long pos = sb.position(pattern, 2); assertEquals(pos, expectedPos); } + + /* + * Validate that setBytes will properly write a set of bytes to the + * specified location in the SerialBlob and the correct count is returned + * for bytes written (writePos - 1 + diff.length > sb.length() && + * writePos - 1 + bytesToWrite <= sb.length()) + */ + @Test + public void test31() throws Exception { + int writePos = 5; + int bytesToWrite = 1; + byte[] diff = new byte[]{7, 8, 9}; + byte[] expected = new byte[]{1, 2, 3, 4, 7}; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(writePos, diff, 0, bytesToWrite); + assertEquals(written, bytesToWrite); + assertEquals(sb.getBytes(1, (int) sb.length()), expected); + } + + /* + * Validate that setBytes will properly write a set of bytes to the + * specified location in the SerialBlob and the correct count is returned + * for bytes written (writePos - 1 + bytesToWrite > sb.length()) + */ + @Test + public void test32() throws Exception { + int writePos = 5; + int bytesToWrite = 2; + byte[] diff = new byte[]{7, 8, 9, 0}; + byte[] expected = new byte[]{1, 2, 3, 4, 8, 9}; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(writePos, diff, 1, bytesToWrite); + assertEquals(written, bytesToWrite); + assertEquals(sb.getBytes(1, (int) sb.length()), expected); + } + + /* + * Validate that setBytes will properly write a set of bytes to the + * specified location in the SerialBlob and the correct count is returned + * for bytes written (writePos == sb.length() + 1) + */ + @Test + public void test33() throws Exception { + int writePos = 6; + int bytesToWrite = 3; + byte[] diff = new byte[]{7, 8, 9, 0}; + byte[] expected = new byte[]{1, 2, 3, 4, 5, 8, 9, 0}; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(writePos, diff, 1, bytesToWrite); + assertEquals(written, bytesToWrite); + assertEquals(sb.getBytes(1, (int) sb.length()), expected); + } + + /* + * Validate a SerialException is thrown if length < 0 for setBytes + */ + @Test(expectedExceptions = SerialException.class) + public void test34() throws Exception { + int length = -1; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(1, new byte[]{1}, 1, length); + } + + /* + * Validate a SerialException is thrown if length + offset > + * Integer.MAX_VALUE for setBytes + */ + @Test(expectedExceptions = SerialException.class) + public void test35() throws Exception { + int offset = 1; + int length = Integer.MAX_VALUE; + SerialBlob sb = new SerialBlob(bytes); + int written = sb.setBytes(1, new byte[]{1, 2, 3}, offset, length); + } } diff --git a/test/jdk/javax/sql/testng/test/rowset/serial/SerialClobTests.java b/test/jdk/javax/sql/testng/test/rowset/serial/SerialClobTests.java index 72f42674de0..8f07ed6f218 100644 --- a/test/jdk/javax/sql/testng/test/rowset/serial/SerialClobTests.java +++ b/test/jdk/javax/sql/testng/test/rowset/serial/SerialClobTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -407,18 +407,21 @@ public class SerialClobTests extends BaseTest { /* * Check that setString() updates the appropriate characters in the - * SerialClob + * SerialClob (writePos - 1 + val1.length() - offset > sc.length() && + * writePos - 1 + expectedWritten <= sc.length()) */ - @Test(enabled = false) + @Test public void test32() throws Exception { + int writePos = 10; + int offset = 7; int expectedWritten = 9; String val = "Hi, I am Catwoman!!!!!!"; String val1 = "Hahaha the Joker, who are you?!"; - String expected = "Hi, I am the Joker!"; + String expected = "Hi, I am the Joker!!!!!"; SerialClob sc = new SerialClob(val.toCharArray()); - int written = sc.setString(10, val1, 8, expectedWritten+1); + int written = sc.setString(writePos, val1, offset, expectedWritten); assertEquals(written, expectedWritten); - + assertEquals(sc.getSubString(1, (int) sc.length()), expected); } /* @@ -496,4 +499,74 @@ public class SerialClobTests extends BaseTest { SerialClob sc2 = serializeDeserializeObject(sc); assertTrue(sc.equals(sc2), "SerialClobs not equal"); } + + /* + * Check calling setString() with offset > val1.length() throws a + * SerialException + */ + @Test(expectedExceptions = SerialException.class) + public void test39() throws Exception { + String val1 = "hello"; + int offset = val1.length() + 1; + SerialClob sc = new SerialClob(chars); + sc.setString(1, val1, offset, 0); + } + + /* + * Check that setString() updates the appropriate characters in the + * SerialClob (writePos - 1 + expectedWritten > sc.length()) + */ + @Test + public void test40() throws Exception { + int writePos = 13; + int offset = 7; + int expectedWritten = 24; + String val = "Hello, I am Bruce Wayne"; + String val1 = "Hahaha the Joker, who are you?!"; + String expected = "Hello, I am the Joker, who are you?!"; + SerialClob sc = new SerialClob(val.toCharArray()); + int written = sc.setString(writePos, val1, offset, expectedWritten); + assertEquals(written, expectedWritten); + assertEquals(sc.getSubString(1, (int) sc.length()), expected); + } + + /* + * Check that setString() updates the appropriate characters in the + * SerialClob (writePos == sc.length() + 1) + */ + @Test + public void test41() throws Exception { + int writePos = 10; + int offset = 7; + int expectedWritten = 10; + String val = "Hi, I am "; + String val1 = "Hahaha the Joker!"; + String expected = "Hi, I am the Joker!"; + SerialClob sc = new SerialClob(val.toCharArray()); + int written = sc.setString(writePos, val1, offset, expectedWritten); + assertEquals(written, expectedWritten); + assertEquals(sc.getSubString(1, (int) sc.length()), expected); + } + + /* + * Validate a SerialException is thrown if length < 0 for setString + */ + @Test(expectedExceptions = SerialException.class) + public void test42() throws Exception { + int length = -1; + SerialClob sc = new SerialClob(chars); + int written = sc.setString(1, "hello", 1, length); + } + + /* + * Validate a SerialException is thrown if length + offset > + * Integer.MAX_VALUE for setString + */ + @Test(expectedExceptions = SerialException.class) + public void test43() throws Exception { + int offset = 1; + int length = Integer.MAX_VALUE; + SerialClob sc = new SerialClob(chars); + int written = sc.setString(1, "hello", offset, length); + } } -- GitLab From 6d8fa8f6632a78dc79786cb102ba20f6834ad3f4 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 28 Oct 2021 17:13:08 +0000 Subject: [PATCH 109/890] 8255286: Implement ParametersTypeData::print_data_on fully Reviewed-by: dholmes --- src/hotspot/share/oops/methodData.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/oops/methodData.cpp b/src/hotspot/share/oops/methodData.cpp index 89d232ca094..4146f4a8200 100644 --- a/src/hotspot/share/oops/methodData.cpp +++ b/src/hotspot/share/oops/methodData.cpp @@ -637,8 +637,10 @@ bool ParametersTypeData::profiling_enabled() { } void ParametersTypeData::print_data_on(outputStream* st, const char* extra) const { - st->print("parameter types"); // FIXME extra ignored? + print_shared(st, "ParametersTypeData", extra); + tab(st); _parameters.print_data_on(st); + st->cr(); } void SpeculativeTrapData::print_data_on(outputStream* st, const char* extra) const { -- GitLab From 5a768f75c9cb013edbf6c61e79820bd180cad4ba Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 28 Oct 2021 17:32:39 +0000 Subject: [PATCH 110/890] 8276054: JMH benchmarks for Fences Reviewed-by: redestad --- .../org/openjdk/bench/vm/fences/Multiple.java | 85 ++++++++++++++ .../bench/vm/fences/MultipleWithLoads.java | 111 ++++++++++++++++++ .../bench/vm/fences/MultipleWithStores.java | 105 +++++++++++++++++ .../bench/vm/fences/SafePublishing.java | 80 +++++++++++++ .../org/openjdk/bench/vm/fences/Single.java | 70 +++++++++++ 5 files changed, 451 insertions(+) create mode 100644 test/micro/org/openjdk/bench/vm/fences/Multiple.java create mode 100644 test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java create mode 100644 test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java create mode 100644 test/micro/org/openjdk/bench/vm/fences/SafePublishing.java create mode 100644 test/micro/org/openjdk/bench/vm/fences/Single.java diff --git a/test/micro/org/openjdk/bench/vm/fences/Multiple.java b/test/micro/org/openjdk/bench/vm/fences/Multiple.java new file mode 100644 index 00000000000..fd6c80431d0 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/fences/Multiple.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +public class Multiple { + + @Benchmark + public void plain() { + // Do nothing + } + + @Benchmark + public void loadLoad() { + VarHandle.loadLoadFence(); + VarHandle.loadLoadFence(); + VarHandle.loadLoadFence(); + VarHandle.loadLoadFence(); + } + + @Benchmark + public void storeStore() { + VarHandle.storeStoreFence(); + VarHandle.storeStoreFence(); + VarHandle.storeStoreFence(); + VarHandle.storeStoreFence(); + } + + @Benchmark + public void acquire() { + VarHandle.acquireFence(); + VarHandle.acquireFence(); + VarHandle.acquireFence(); + VarHandle.acquireFence(); + } + + @Benchmark + public void release() { + VarHandle.releaseFence(); + VarHandle.releaseFence(); + VarHandle.releaseFence(); + VarHandle.releaseFence(); + } + + @Benchmark + public void full() { + VarHandle.fullFence(); + VarHandle.fullFence(); + VarHandle.fullFence(); + VarHandle.fullFence(); + } + +} diff --git a/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java b/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java new file mode 100644 index 00000000000..b4cf6975c0a --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class MultipleWithLoads { + + int x, y, z; + + @Benchmark + public int plain() { + int t1 = x + y + z; + int t2 = x + y + z; + int t3 = x + y + z; + return t1 + t2 + t3; + } + + @Benchmark + public int loadLoad() { + VarHandle.loadLoadFence(); + int t1 = x + y + z; + VarHandle.loadLoadFence(); + int t2 = x + y + z; + VarHandle.loadLoadFence(); + int t3 = x + y + z; + VarHandle.loadLoadFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int storeStore() { + VarHandle.storeStoreFence(); + int t1 = x + y + z; + VarHandle.storeStoreFence(); + int t2 = x + y + z; + VarHandle.storeStoreFence(); + int t3 = x + y + z; + VarHandle.storeStoreFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int acquire() { + VarHandle.acquireFence(); + int t1 = x + y + z; + VarHandle.acquireFence(); + int t2 = x + y + z; + VarHandle.acquireFence(); + int t3 = x + y + z; + VarHandle.acquireFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int release() { + VarHandle.releaseFence(); + int t1 = x + y + z; + VarHandle.releaseFence(); + int t2 = x + y + z; + VarHandle.releaseFence(); + int t3 = x + y + z; + VarHandle.releaseFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int full() { + VarHandle.fullFence(); + int t1 = x + y + z; + VarHandle.fullFence(); + int t2 = x + y + z; + VarHandle.fullFence(); + int t3 = x + y + z; + VarHandle.fullFence(); + return t1 + t2 + t3; + } + +} diff --git a/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java b/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java new file mode 100644 index 00000000000..c405b93b178 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class MultipleWithStores { + + int x, y, z; + + @Benchmark + public void plain() { + x = 1; + y = 1; + z = 1; + } + + @Benchmark + public void loadLoad() { + VarHandle.loadLoadFence(); + x = 1; + VarHandle.loadLoadFence(); + y = 1; + VarHandle.loadLoadFence(); + z = 1; + VarHandle.loadLoadFence(); + } + + @Benchmark + public void storeStore() { + VarHandle.storeStoreFence(); + x = 1; + VarHandle.storeStoreFence(); + y = 1; + VarHandle.storeStoreFence(); + z = 1; + VarHandle.storeStoreFence(); + } + + @Benchmark + public void acquire() { + VarHandle.releaseFence(); + x = 1; + VarHandle.releaseFence(); + y = 1; + VarHandle.releaseFence(); + z = 1; + VarHandle.releaseFence(); + } + + @Benchmark + public void release() { + VarHandle.releaseFence(); + x = 1; + VarHandle.releaseFence(); + y = 1; + VarHandle.releaseFence(); + z = 1; + VarHandle.releaseFence(); + } + + @Benchmark + public void full() { + VarHandle.fullFence(); + x = 1; + VarHandle.fullFence(); + y = 1; + VarHandle.fullFence(); + z = 1; + VarHandle.fullFence(); + } + +} diff --git a/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java b/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java new file mode 100644 index 00000000000..d337c6dd7c9 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(value = 3, jvmArgsAppend = {"-XX:+UseParallelGC", "-Xmx128m"}) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class SafePublishing { + + @Benchmark + public Object plain() { + return new Plain(); + } + + @Benchmark + public Object release() { + return new Release(); + } + + @Benchmark + public Object storeStore() { + return new StoreStore(); + } + + static class Plain { + int x; + public Plain() { + x = 1; + VarHandle.releaseFence(); + } + } + + static class Release { + int x; + public Release() { + x = 1; + VarHandle.releaseFence(); + } + } + + static class StoreStore { + int x; + public StoreStore() { + x = 1; + VarHandle.storeStoreFence(); + } + } + +} diff --git a/test/micro/org/openjdk/bench/vm/fences/Single.java b/test/micro/org/openjdk/bench/vm/fences/Single.java new file mode 100644 index 00000000000..ff74339cc62 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/fences/Single.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +public class Single { + + @Benchmark + public void plain() { + // Do nothing + } + + @Benchmark + public void loadLoad() { + VarHandle.loadLoadFence(); + } + + @Benchmark + public void storeStore() { + VarHandle.storeStoreFence(); + } + + @Benchmark + public void acquire() { + VarHandle.acquireFence(); + } + + @Benchmark + public void release() { + VarHandle.releaseFence(); + } + + @Benchmark + public void full() { + VarHandle.fullFence(); + } + +} -- GitLab From c6339cb8a255d387bb182ad20dd69f3d460cf1ed Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Thu, 28 Oct 2021 18:32:50 +0000 Subject: [PATCH 111/890] 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle 8013527: calling MethodHandles.lookup on itself leads to errors Co-authored-by: Peter Levart Co-authored-by: Claes Redestad Co-authored-by: Mandy Chung Reviewed-by: mcimadamore, plevart, egahlin, redestad, cjplummer, alanb --- .../build/tools/classlist/HelloClasslist.java | 12 + src/hotspot/share/ci/ciField.cpp | 1 + .../share/classes/java/lang/Class.java | 38 +- .../share/classes/java/lang/ClassLoader.java | 11 +- .../invoke/InnerClassLambdaMetafactory.java | 61 +- .../lang/invoke/InvokerBytecodeGenerator.java | 5 +- .../java/lang/invoke/MethodHandleImpl.java | 216 +++++- .../java/lang/invoke/MethodHandleNatives.java | 20 +- .../java/lang/invoke/MethodHandles.java | 38 +- .../java/lang/reflect/Constructor.java | 31 +- .../classes/java/lang/reflect/Field.java | 20 +- .../classes/java/lang/reflect/Method.java | 86 ++- .../internal/access/JavaLangInvokeAccess.java | 42 ++ .../jdk/internal/access/SharedSecrets.java | 1 - .../share/classes/jdk/internal/misc/VM.java | 17 +- .../jdk/internal/reflect/AccessorUtils.java | 109 +++ .../reflect/CallerSensitiveAdapter.java | 112 +++ .../reflect/CsMethodAccessorAdapter.java | 72 ++ .../DelegatingConstructorAccessorImpl.java | 3 +- .../reflect/DelegatingMethodAccessorImpl.java | 14 +- .../DirectConstructorHandleAccessor.java | 115 ++++ .../reflect/DirectMethodHandleAccessor.java | 361 ++++++++++ .../internal/reflect/FieldAccessorImpl.java | 169 ++++- .../jdk/internal/reflect/MethodAccessor.java | 3 + .../reflect/MethodAccessorGenerator.java | 4 +- .../internal/reflect/MethodAccessorImpl.java | 5 + .../reflect/MethodHandleAccessorFactory.java | 366 ++++++++++ .../MethodHandleBooleanFieldAccessorImpl.java | 185 +++++ .../MethodHandleByteFieldAccessorImpl.java | 184 +++++ ...ethodHandleCharacterFieldAccessorImpl.java | 184 +++++ .../MethodHandleDoubleFieldAccessorImpl.java | 203 ++++++ .../MethodHandleFieldAccessorImpl.java | 84 +++ .../MethodHandleFloatFieldAccessorImpl.java | 200 ++++++ .../MethodHandleIntegerFieldAccessorImpl.java | 194 ++++++ .../MethodHandleLongFieldAccessorImpl.java | 197 ++++++ .../MethodHandleObjectFieldAccessorImpl.java | 167 +++++ .../MethodHandleShortFieldAccessorImpl.java | 188 ++++++ .../NativeConstructorAccessorImpl.java | 2 +- .../reflect/NativeMethodAccessorImpl.java | 2 +- .../internal/reflect/ReflectionFactory.java | 139 ++-- .../reflect/UnsafeFieldAccessorImpl.java | 161 +---- .../UnsafeStaticFieldAccessorImpl.java | 8 +- .../share/native/libjava/NativeAccessors.c | 13 + .../classes/java/util/logging/Logger.java | 3 + .../share/classes/java/sql/DriverManager.java | 2 + test/hotspot/jtreg/ProblemList.txt | 6 + .../dcmd/vm/ShowReflectionTargetTest.java | 2 +- test/jdk/com/sun/jdi/EATests.java | 4 +- .../java/lang/StackWalker/DumpStackTest.java | 20 +- .../java/lang/StackWalker/NativeMethod.java | 24 +- .../lang/StackWalker/VerifyStackTrace.java | 49 +- .../java/lang/StackWalker/libnativeMethod.c | 59 ++ .../invoke/CallerSensitiveMethodHandle.java | 60 ++ .../lang/invoke/MethodHandleInvokeUOE.java | 74 ++ .../CallerSensitiveAccess.java | 36 +- .../lang/invoke/callerSensitive/Main.java | 36 + .../csm/jdk/test/MethodInvokeTest.java | 216 ++++++ .../callerSensitive/csm/module-info.java | 26 + .../src/java.base/java/util/CSM.java | 87 +++ .../lang/invoke/lookup/ChainedLookupTest.java | 137 ++++ .../invoke/lookup/ReflectiveLookupTest.java | 4 +- .../java.base/java/lang/LookupTest.java | 2 +- .../java/lang/reflect/ChainedReflection.java | 120 ++++ .../Field/TestFieldReflectValueOf.java | 16 +- .../lang/reflect/Method/MethodArityLimit.java | 106 +++ .../reflect/MethodHandleAccessorsTest.java | 639 ++++++++++++++++++ .../reflect/callerCache/CustomLoaderTest.java | 115 ++++ .../lang/reflect/callerCache/ReflectTest.java | 35 + .../ExceptionInClassInitialization.java | 76 +++ .../classInitialization/Initializer.java | 34 + .../reflect/classInitialization/Test.java | 45 ++ .../reflect/CallerSensitive/CheckCSMs.java | 119 +++- .../reflect/Reflection/GetCallerClass.java | 68 +- .../Reflection/GetCallerClassTest.java | 245 +++++-- .../jfr/api/consumer/TestHiddenMethod.java | 4 +- test/langtools/jdk/jshell/ExceptionsTest.java | 1 + .../reflect/ReflectionColdstartBenchmark.java | 21 +- .../reflect/ReflectionSpeedBenchmark.java | 130 +++- 78 files changed, 6119 insertions(+), 545 deletions(-) create mode 100644 src/java.base/share/classes/jdk/internal/reflect/AccessorUtils.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/CallerSensitiveAdapter.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/CsMethodAccessorAdapter.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/DirectConstructorHandleAccessor.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleAccessorFactory.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java create mode 100644 src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java create mode 100644 test/jdk/java/lang/StackWalker/libnativeMethod.c create mode 100644 test/jdk/java/lang/invoke/CallerSensitiveMethodHandle.java create mode 100644 test/jdk/java/lang/invoke/MethodHandleInvokeUOE.java rename test/jdk/java/lang/invoke/{ => callerSensitive}/CallerSensitiveAccess.java (91%) create mode 100644 test/jdk/java/lang/invoke/callerSensitive/Main.java create mode 100644 test/jdk/java/lang/invoke/callerSensitive/csm/jdk/test/MethodInvokeTest.java create mode 100644 test/jdk/java/lang/invoke/callerSensitive/csm/module-info.java create mode 100644 test/jdk/java/lang/invoke/callerSensitive/src/java.base/java/util/CSM.java create mode 100644 test/jdk/java/lang/invoke/lookup/ChainedLookupTest.java create mode 100644 test/jdk/java/lang/reflect/ChainedReflection.java create mode 100644 test/jdk/java/lang/reflect/Method/MethodArityLimit.java create mode 100644 test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java create mode 100644 test/jdk/java/lang/reflect/callerCache/CustomLoaderTest.java create mode 100644 test/jdk/java/lang/reflect/callerCache/ReflectTest.java create mode 100644 test/jdk/java/lang/reflect/classInitialization/ExceptionInClassInitialization.java create mode 100644 test/jdk/java/lang/reflect/classInitialization/Initializer.java create mode 100644 test/jdk/java/lang/reflect/classInitialization/Test.java diff --git a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java index e5a1d044676..0c5bea001ec 100644 --- a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java +++ b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java @@ -116,6 +116,12 @@ public class HelloClasslist { DateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ROOT) .format(new Date())); + // A selection of trivial and common reflection operations + var instance = HelloClasslist.class.getConstructor().newInstance(); + HelloClasslist.class.getMethod("staticMethod_V").invoke(null); + var obj = HelloClasslist.class.getMethod("staticMethod_L_L", Object.class).invoke(null, instance); + HelloClasslist.class.getField("field").get(instance); + // A selection of trivial and relatively common MH operations invoke(MethodHandles.identity(double.class), 1.0); invoke(MethodHandles.identity(int.class), 1); @@ -126,8 +132,14 @@ public class HelloClasslist { LOGGER.log(Level.FINE, "New Date: " + newDate + " - old: " + oldDate); } + public HelloClasslist() {} + + public String field = "someValue"; + public static void staticMethod_V() {} + public static Object staticMethod_L_L(Object o) { return o; } + private static MethodHandle handle(String name, MethodType type) throws Throwable { return MethodHandles.lookup().findStatic(HelloClasslist.class, name, type); } diff --git a/src/hotspot/share/ci/ciField.cpp b/src/hotspot/share/ci/ciField.cpp index f783c76f282..36055a70c38 100644 --- a/src/hotspot/share/ci/ciField.cpp +++ b/src/hotspot/share/ci/ciField.cpp @@ -224,6 +224,7 @@ static bool trust_final_non_static_fields(ciInstanceKlass* holder) { return false; // Even if general trusting is disabled, trust system-built closures in these packages. if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke") || + holder->is_in_package("java/lang/reflect") || holder->is_in_package("jdk/internal/reflect") || holder->is_in_package("jdk/internal/foreign") || holder->is_in_package("jdk/incubator/foreign") || holder->is_in_package("jdk/internal/vm/vector") || holder->is_in_package("jdk/incubator/vector") || holder->is_in_package("java/lang")) diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java index 406f2ba6e2c..7eb5256e5e8 100644 --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -73,6 +73,7 @@ import jdk.internal.loader.BuiltinClassLoader; import jdk.internal.misc.Unsafe; import jdk.internal.module.Resources; import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; import jdk.internal.reflect.ConstantPool; import jdk.internal.reflect.Reflection; import jdk.internal.reflect.ReflectionFactory; @@ -372,9 +373,15 @@ public final class Class implements java.io.Serializable, public static Class forName(String className) throws ClassNotFoundException { Class caller = Reflection.getCallerClass(); - return forName0(className, true, ClassLoader.getClassLoader(caller), caller); + return forName(className, caller); } + // Caller-sensitive adapter method for reflective invocation + @CallerSensitiveAdapter + private static Class forName(String className, Class caller) + throws ClassNotFoundException { + return forName0(className, true, ClassLoader.getClassLoader(caller), caller); + } /** * Returns the {@code Class} object associated with the class or @@ -456,11 +463,25 @@ public final class Class implements java.io.Serializable, // Reflective call to get caller class is only needed if a security manager // is present. Avoid the overhead of making this call otherwise. caller = Reflection.getCallerClass(); + } + return forName(name, initialize, loader, caller); + } + + // Caller-sensitive adapter method for reflective invocation + @CallerSensitiveAdapter + private static Class forName(String name, boolean initialize, ClassLoader loader, Class caller) + throws ClassNotFoundException + { + @SuppressWarnings("removal") + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + // Reflective call to get caller class is only needed if a security manager + // is present. Avoid the overhead of making this call otherwise. if (loader == null) { ClassLoader ccl = ClassLoader.getClassLoader(caller); if (ccl != null) { sm.checkPermission( - SecurityConstants.GET_CLASSLOADER_PERMISSION); + SecurityConstants.GET_CLASSLOADER_PERMISSION); } } } @@ -523,13 +544,24 @@ public final class Class implements java.io.Serializable, @SuppressWarnings("removal") @CallerSensitive public static Class forName(Module module, String name) { + Class caller = null; + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + caller = Reflection.getCallerClass(); + } + return forName(module, name, caller); + } + + // Caller-sensitive adapter method for reflective invocation + @SuppressWarnings("removal") + @CallerSensitiveAdapter + private static Class forName(Module module, String name, Class caller) { Objects.requireNonNull(module); Objects.requireNonNull(name); ClassLoader cl; SecurityManager sm = System.getSecurityManager(); if (sm != null) { - Class caller = Reflection.getCallerClass(); if (caller != null && caller.getModule() != module) { // if caller is null, Class.forName is the last java frame on the stack. // java.base has all permissions diff --git a/src/java.base/share/classes/java/lang/ClassLoader.java b/src/java.base/share/classes/java/lang/ClassLoader.java index e1ad30f5b11..dffd56948f3 100644 --- a/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/src/java.base/share/classes/java/lang/ClassLoader.java @@ -64,6 +64,7 @@ import jdk.internal.perf.PerfCounter; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; import jdk.internal.reflect.Reflection; import jdk.internal.util.StaticProperty; import sun.reflect.misc.ReflectUtil; @@ -1615,9 +1616,13 @@ public abstract class ClassLoader { */ @CallerSensitive protected static boolean registerAsParallelCapable() { - Class callerClass = - Reflection.getCallerClass().asSubclass(ClassLoader.class); - return ParallelLoaders.register(callerClass); + return registerAsParallelCapable(Reflection.getCallerClass()); + } + + // Caller-sensitive adapter method for reflective invocation + @CallerSensitiveAdapter + private static boolean registerAsParallelCapable(Class caller) { + return ParallelLoaders.register(caller.asSubclass(ClassLoader.class)); } /** diff --git a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index 6b50cf2a2aa..30014e1799a 100644 --- a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -26,7 +26,6 @@ package java.lang.invoke; import jdk.internal.misc.CDS; -import jdk.internal.misc.VM; import jdk.internal.org.objectweb.asm.*; import sun.invoke.util.BytecodeDescriptor; import sun.invoke.util.VerifyAccess; @@ -37,7 +36,6 @@ import java.io.FilePermission; import java.io.Serializable; import java.lang.constant.ConstantDescs; import java.lang.invoke.MethodHandles.Lookup; -import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; @@ -46,8 +44,10 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.PropertyPermission; import java.util.Set; +import static java.lang.invoke.MethodHandleStatics.CLASSFILE_VERSION; import static java.lang.invoke.MethodHandles.Lookup.ClassOption.NESTMATE; import static java.lang.invoke.MethodHandles.Lookup.ClassOption.STRONG; +import static java.lang.invoke.MethodType.methodType; import static jdk.internal.org.objectweb.asm.Opcodes.*; /** @@ -57,7 +57,6 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; * @see LambdaMetafactory */ /* package */ final class InnerClassLambdaMetafactory extends AbstractValidatingLambdaMetafactory { - private static final int CLASSFILE_VERSION = VM.classFileVersion(); private static final String METHOD_DESCRIPTOR_VOID = Type.getMethodDescriptor(Type.VOID_TYPE); private static final String JAVA_LANG_OBJECT = "java/lang/Object"; private static final String NAME_CTOR = ""; @@ -106,7 +105,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; disableEagerInitialization = GetBooleanAction.privilegedGetProperty(disableEagerInitializationKey); // condy to load implMethod from class data - MethodType classDataMType = MethodType.methodType(Object.class, MethodHandles.Lookup.class, String.class, Class.class); + MethodType classDataMType = methodType(Object.class, MethodHandles.Lookup.class, String.class, Class.class); Handle classDataBsm = new Handle(H_INVOKESTATIC, Type.getInternalName(MethodHandles.class), "classData", classDataMType.descriptorString(), false); implMethodCondy = new ConstantDynamic(ConstantDescs.DEFAULT_NAME, MethodHandle.class.descriptorString(), classDataBsm); @@ -227,50 +226,28 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; @Override CallSite buildCallSite() throws LambdaConversionException { final Class innerClass = spinInnerClass(); - if (factoryType.parameterCount() == 0) { - // In the case of a non-capturing lambda, we optimize linkage by pre-computing a single instance, - // unless we've suppressed eager initialization - if (disableEagerInitialization) { - try { - return new ConstantCallSite(caller.findStaticGetter(innerClass, LAMBDA_INSTANCE_FIELD, - factoryType.returnType())); - } catch (ReflectiveOperationException e) { - throw new LambdaConversionException( - "Exception finding " + LAMBDA_INSTANCE_FIELD + " static field", e); - } - } else { - @SuppressWarnings("removal") - final Constructor[] ctrs = AccessController.doPrivileged( - new PrivilegedAction<>() { - @Override - public Constructor[] run() { - Constructor[] ctrs = innerClass.getDeclaredConstructors(); - if (ctrs.length == 1) { - // The lambda implementing inner class constructor is private, set - // it accessible (by us) before creating the constant sole instance - ctrs[0].setAccessible(true); - } - return ctrs; - } - }); - if (ctrs.length != 1) { - throw new LambdaConversionException("Expected one lambda constructor for " - + innerClass.getCanonicalName() + ", got " + ctrs.length); - } - - try { - Object inst = ctrs[0].newInstance(); - return new ConstantCallSite(MethodHandles.constant(interfaceClass, inst)); - } catch (ReflectiveOperationException e) { - throw new LambdaConversionException("Exception instantiating lambda object", e); - } + if (factoryType.parameterCount() == 0 && disableEagerInitialization) { + try { + return new ConstantCallSite(caller.findStaticGetter(innerClass, LAMBDA_INSTANCE_FIELD, + factoryType.returnType())); + } catch (ReflectiveOperationException e) { + throw new LambdaConversionException( + "Exception finding " + LAMBDA_INSTANCE_FIELD + " static field", e); } } else { try { MethodHandle mh = caller.findConstructor(innerClass, constructorType); - return new ConstantCallSite(mh.asType(factoryType)); + if (factoryType.parameterCount() == 0) { + // In the case of a non-capturing lambda, we optimize linkage by pre-computing a single instance + Object inst = mh.asType(methodType(Object.class)).invokeExact(); + return new ConstantCallSite(MethodHandles.constant(interfaceClass, inst)); + } else { + return new ConstantCallSite(mh.asType(factoryType)); + } } catch (ReflectiveOperationException e) { throw new LambdaConversionException("Exception finding constructor", e); + } catch (Throwable e) { + throw new LambdaConversionException("Exception instantiating lambda object", e); } } } diff --git a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index 243571593dd..c687916dde4 100644 --- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -44,6 +44,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; +import java.util.Set; import java.util.stream.Stream; import static java.lang.invoke.LambdaForm.BasicType; @@ -316,7 +317,7 @@ class InvokerBytecodeGenerator { * Extract the MemberName of a newly-defined method. */ private MemberName loadMethod(byte[] classFile) { - Class invokerClass = LOOKUP.makeHiddenClassDefiner(className, classFile) + Class invokerClass = LOOKUP.makeHiddenClassDefiner(className, classFile, Set.of()) .defineClass(true, classDataValues()); return resolveInvokerMember(invokerClass, invokerName, invokerType); } @@ -376,7 +377,7 @@ class InvokerBytecodeGenerator { MethodVisitor mv = cw.visitMethod(Opcodes.ACC_STATIC, "", "()V", null, null); mv.visitCode(); mv.visitLdcInsn(Type.getType("L" + className + ";")); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/invoke/MethodHandleNatives", + mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/invoke/MethodHandles", "classData", "(Ljava/lang/Class;)Ljava/lang/Object;", false); // we should optimize one single element case that does not need to create a List mv.visitTypeInsn(Opcodes.CHECKCAST, "java/util/List"); diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index 70aee0a2778..a428380443e 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -42,6 +42,8 @@ import sun.invoke.util.Wrapper; import java.lang.invoke.MethodHandles.Lookup; import java.lang.reflect.Array; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; import java.nio.ByteOrder; import java.util.Arrays; import java.util.Collections; @@ -50,6 +52,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; import java.util.stream.Stream; @@ -57,6 +60,7 @@ import java.util.stream.Stream; import static java.lang.invoke.LambdaForm.*; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; +import static java.lang.invoke.MethodHandles.Lookup.ClassOption.NESTMATE; import static jdk.internal.org.objectweb.asm.Opcodes.*; /** @@ -1030,6 +1034,7 @@ abstract class MethodHandleImpl { // That way we can lazily load the code and set up the constants. private static class BindCaller { private static MethodType INVOKER_MT = MethodType.methodType(Object.class, MethodHandle.class, Object[].class); + private static MethodType REFLECT_INVOKER_MT = MethodType.methodType(Object.class, MethodHandle.class, Object.class, Object[].class); static MethodHandle bindCaller(MethodHandle mh, Class hostClass) { // Code in the boot layer should now be careful while creating method handles or @@ -1042,15 +1047,48 @@ abstract class MethodHandleImpl { hostClass.getName().startsWith("java.lang.invoke."))) { throw new InternalError(); // does not happen, and should not anyway } + + MemberName member = mh.internalMemberName(); + if (member != null) { + // Look up the CSM adapter method with the same method name + // but with an additional caller class parameter. If present, + // bind the adapter's method handle with the lookup class as + // the caller class argument + MemberName csmAdapter = IMPL_LOOKUP.resolveOrNull(member.getReferenceKind(), + new MemberName(member.getDeclaringClass(), + member.getName(), + member.getMethodType().appendParameterTypes(Class.class), + member.getReferenceKind())); + if (csmAdapter != null) { + assert !csmAdapter.isCallerSensitive(); + MethodHandle dmh = DirectMethodHandle.make(csmAdapter); + dmh = MethodHandles.insertArguments(dmh, dmh.type().parameterCount() - 1, hostClass); + dmh = new WrappedMember(dmh, mh.type(), member, mh.isInvokeSpecial(), hostClass); + return dmh; + } + } + + // If no adapter method for CSM with an additional Class parameter + // is present, then inject an invoker class that is the caller + // invoking the method handle of the CSM + try { + return bindCallerWithInjectedInvoker(mh, hostClass); + } catch (ReflectiveOperationException ex) { + throw uncaughtException(ex); + } + } + + private static MethodHandle bindCallerWithInjectedInvoker(MethodHandle mh, Class hostClass) + throws ReflectiveOperationException + { // For simplicity, convert mh to a varargs-like method. MethodHandle vamh = prepareForInvoker(mh); // Cache the result of makeInjectedInvoker once per argument class. - MethodHandle bccInvoker = CV_makeInjectedInvoker.get(hostClass); + MethodHandle bccInvoker = CV_makeInjectedInvoker.get(hostClass).invoker(); return restoreToType(bccInvoker.bindTo(vamh), mh, hostClass); } - private static MethodHandle makeInjectedInvoker(Class targetClass) { - try { + private static Class makeInjectedInvoker(Class targetClass) { /* * The invoker class defined to the same class loader as the lookup class * but in an unnamed package so that the class bytes can be cached and @@ -1064,21 +1102,80 @@ abstract class MethodHandleImpl { name = name.replace('/', '_'); } Class invokerClass = new Lookup(targetClass) - .makeHiddenClassDefiner(name, INJECTED_INVOKER_TEMPLATE) - .defineClass(true); + .makeHiddenClassDefiner(name, INJECTED_INVOKER_TEMPLATE, Set.of(NESTMATE)) + .defineClass(true, targetClass); assert checkInjectedInvoker(targetClass, invokerClass); - return IMPL_LOOKUP.findStatic(invokerClass, "invoke_V", INVOKER_MT); - } catch (ReflectiveOperationException ex) { - throw uncaughtException(ex); - } + return invokerClass; } - private static ClassValue CV_makeInjectedInvoker = new ClassValue() { - @Override protected MethodHandle computeValue(Class hostClass) { - return makeInjectedInvoker(hostClass); + private static ClassValue CV_makeInjectedInvoker = new ClassValue<>() { + @Override + protected InjectedInvokerHolder computeValue(Class hostClass) { + return new InjectedInvokerHolder(makeInjectedInvoker(hostClass)); } }; + /* + * Returns a method handle of an invoker class injected for reflection + * implementation use with the following signature: + * reflect_invoke_V(MethodHandle mh, Object target, Object[] args) + * + * Method::invoke on a caller-sensitive method will call + * MethodAccessorImpl::invoke(Object, Object[]) through reflect_invoke_V + * target.csm(args) + * NativeMethodAccesssorImpl::invoke(target, args) + * MethodAccessImpl::invoke(target, args) + * InjectedInvoker::reflect_invoke_V(vamh, target, args); + * method::invoke(target, args) + * p.Foo::m + * + * An injected invoker class is a hidden class which has the same + * defining class loader, runtime package, and protection domain + * as the given caller class. + */ + static MethodHandle reflectiveInvoker(Class caller) { + return BindCaller.CV_makeInjectedInvoker.get(caller).reflectInvoker(); + } + + private static final class InjectedInvokerHolder { + private final Class invokerClass; + // lazily resolved and cached DMH(s) of invoke_V methods + private MethodHandle invoker; + private MethodHandle reflectInvoker; + + private InjectedInvokerHolder(Class invokerClass) { + this.invokerClass = invokerClass; + } + + private MethodHandle invoker() { + var mh = invoker; + if (mh == null) { + try { + invoker = mh = IMPL_LOOKUP.findStatic(invokerClass, "invoke_V", INVOKER_MT); + } catch (Error | RuntimeException ex) { + throw ex; + } catch (Throwable ex) { + throw new InternalError(ex); + } + } + return mh; + } + + private MethodHandle reflectInvoker() { + var mh = reflectInvoker; + if (mh == null) { + try { + reflectInvoker = mh = IMPL_LOOKUP.findStatic(invokerClass, "reflect_invoke_V", REFLECT_INVOKER_MT); + } catch (Error | RuntimeException ex) { + throw ex; + } catch (Throwable ex) { + throw new InternalError(ex); + } + } + return mh; + } + } + // Adapt mh so that it can be called directly from an injected invoker: private static MethodHandle prepareForInvoker(MethodHandle mh) { mh = mh.asFixedArity(); @@ -1115,6 +1212,8 @@ abstract class MethodHandleImpl { MethodHandle invoker = IMPL_LOOKUP.findStatic(invokerClass, "invoke_V", INVOKER_MT); MethodHandle vamh = prepareForInvoker(MH_checkCallerClass); return (boolean)invoker.invoke(vamh, new Object[]{ invokerClass }); + } catch (Error|RuntimeException ex) { + throw ex; } catch (Throwable ex) { throw new InternalError(ex); } @@ -1151,27 +1250,50 @@ abstract class MethodHandleImpl { ClassWriter cw = new ClassWriter(0); // private static class InjectedInvoker { + // /* this is used to wrap DMH(s) of caller-sensitive methods */ // @Hidden // static Object invoke_V(MethodHandle vamh, Object[] args) throws Throwable { // return vamh.invokeExact(args); // } + // /* this is used in caller-sensitive reflective method accessor */ + // @Hidden + // static Object reflect_invoke_V(MethodHandle vamh, Object target, Object[] args) throws Throwable { + // return vamh.invokeExact(target, args); + // } + // } // } cw.visit(CLASSFILE_VERSION, ACC_PRIVATE | ACC_SUPER, "InjectedInvoker", null, "java/lang/Object", null); + { + var mv = cw.visitMethod(ACC_STATIC, "invoke_V", + "(Ljava/lang/invoke/MethodHandle;[Ljava/lang/Object;)Ljava/lang/Object;", + null, null); + + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitVarInsn(ALOAD, 1); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invokeExact", + "([Ljava/lang/Object;)Ljava/lang/Object;", false); + mv.visitInsn(ARETURN); + mv.visitMaxs(2, 2); + mv.visitEnd(); + + cw.visitEnd(); + } - MethodVisitor mv = cw.visitMethod(ACC_STATIC, "invoke_V", - "(Ljava/lang/invoke/MethodHandle;[Ljava/lang/Object;)Ljava/lang/Object;", - null, null); - - mv.visitCode(); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invokeExact", - "([Ljava/lang/Object;)Ljava/lang/Object;", false); - mv.visitInsn(ARETURN); - mv.visitMaxs(2, 2); - mv.visitEnd(); - - cw.visitEnd(); + { + var mv = cw.visitMethod(ACC_STATIC, "reflect_invoke_V", + "(Ljava/lang/invoke/MethodHandle;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", + null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitVarInsn(ALOAD, 1); + mv.visitVarInsn(ALOAD, 2); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invokeExact", + "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", false); + mv.visitInsn(ARETURN); + mv.visitMaxs(3, 3); + mv.visitEnd(); + } return cw.toByteArray(); } } @@ -1503,6 +1625,48 @@ abstract class MethodHandleImpl { public VarHandle insertCoordinates(VarHandle target, int pos, Object... values) { return VarHandles.insertCoordinates(target, pos, values); } + + + @Override + public MethodHandle unreflectConstructor(Constructor ctor) throws IllegalAccessException { + return IMPL_LOOKUP.unreflectConstructor(ctor); + } + + @Override + public MethodHandle unreflectField(Field field, boolean isSetter) throws IllegalAccessException { + return isSetter ? IMPL_LOOKUP.unreflectSetter(field) : IMPL_LOOKUP.unreflectGetter(field); + } + + @Override + public MethodHandle findVirtual(Class defc, String name, MethodType type) throws IllegalAccessException { + try { + return IMPL_LOOKUP.findVirtual(defc, name, type); + } catch (NoSuchMethodException e) { + return null; + } + } + + @Override + public MethodHandle findStatic(Class defc, String name, MethodType type) throws IllegalAccessException { + try { + return IMPL_LOOKUP.findStatic(defc, name, type); + } catch (NoSuchMethodException e) { + return null; + } + } + + @Override + public MethodHandle reflectiveInvoker(Class caller) { + Objects.requireNonNull(caller); + return BindCaller.reflectiveInvoker(caller); + } + + @Override + public Lookup defineHiddenClassWithClassData(Lookup caller, String name, byte[] bytes, Object classData, boolean initialize) { + // skip name and access flags validation + return caller.makeHiddenClassDefiner(name, bytes, Set.of()).defineClassAsLookup(initialize, classData); + } + }); } diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index 81491819d7e..8a949a77e8e 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -25,8 +25,7 @@ package java.lang.invoke; -import jdk.internal.access.JavaLangAccess; -import jdk.internal.access.SharedSecrets; +import jdk.internal.misc.VM; import jdk.internal.ref.CleanerFactory; import sun.invoke.util.Wrapper; @@ -35,7 +34,6 @@ import java.lang.reflect.Field; import static java.lang.invoke.MethodHandleNatives.Constants.*; import static java.lang.invoke.MethodHandleStatics.TRACE_METHOD_LINKAGE; -import static java.lang.invoke.MethodHandleStatics.UNSAFE; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; /** @@ -248,6 +246,7 @@ class MethodHandleNatives { return true; } static { + VM.setJavaLangInvokeInited(); assert(verifyConstants()); } @@ -665,8 +664,7 @@ class MethodHandleNatives { static boolean canBeCalledVirtual(MemberName mem) { assert(mem.isInvocable()); - return mem.getName().equals("getContextClassLoader") && - canBeCalledVirtual(mem, java.lang.Thread.class); + return mem.getName().equals("getContextClassLoader") && canBeCalledVirtual(mem, java.lang.Thread.class); } static boolean canBeCalledVirtual(MemberName symbolicRef, Class definingClass) { @@ -676,16 +674,4 @@ class MethodHandleNatives { return (definingClass.isAssignableFrom(symbolicRefClass) || // Msym overrides Mdef symbolicRefClass.isInterface()); // Mdef implements Msym } - - private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); - /* - * Returns the class data set by the VM in the Class::classData field. - * - * This is also invoked by LambdaForms as it cannot use condy via - * MethodHandles.classData due to bootstrapping issue. - */ - static Object classData(Class c) { - UNSAFE.ensureClassInitialized(c); - return JLA.classData(c); - } } diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 9e25dd5bfc2..8d3bc8f4781 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -32,6 +32,7 @@ import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.org.objectweb.asm.Type; import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; import jdk.internal.reflect.Reflection; import jdk.internal.vm.annotation.ForceInline; import sun.invoke.util.ValueConversions; @@ -63,7 +64,9 @@ import java.util.stream.Stream; import static java.lang.invoke.LambdaForm.BasicType.V_TYPE; import static java.lang.invoke.MethodHandleImpl.Intrinsic; import static java.lang.invoke.MethodHandleNatives.Constants.*; +import static java.lang.invoke.MethodHandleStatics.UNSAFE; import static java.lang.invoke.MethodHandleStatics.newIllegalArgumentException; +import static java.lang.invoke.MethodHandleStatics.newInternalError; import static java.lang.invoke.MethodType.methodType; /** @@ -117,14 +120,15 @@ public class MethodHandles { } /** - * This reflected$lookup method is the alternate implementation of - * the lookup method when being invoked by reflection. + * This lookup method is the alternate implementation of + * the lookup method with a leading caller class argument which is + * non-caller-sensitive. This method is only invoked by reflection + * and method handle. */ - @CallerSensitive - private static Lookup reflected$lookup() { - Class caller = Reflection.getCallerClass(); + @CallerSensitiveAdapter + private static Lookup lookup(Class caller) { if (caller.getClassLoader() == null) { - throw newIllegalArgumentException("illegal lookupClass: "+caller); + throw newInternalError("calling lookup() reflectively is not supported: "+caller); } return new Lookup(caller); } @@ -329,7 +333,7 @@ public class MethodHandles { throw new IllegalAccessException(caller + " does not have ORIGINAL access"); } - Object classdata = MethodHandleNatives.classData(caller.lookupClass()); + Object classdata = classData(caller.lookupClass()); if (classdata == null) return null; try { @@ -341,6 +345,17 @@ public class MethodHandles { } } + /* + * Returns the class data set by the VM in the Class::classData field. + * + * This is also invoked by LambdaForms as it cannot use condy via + * MethodHandles::classData due to bootstrapping issue. + */ + static Object classData(Class c) { + UNSAFE.ensureClassInitialized(c); + return SharedSecrets.getJavaLangAccess().classData(c); + } + /** * Returns the element at the specified index in the * {@linkplain #classData(Lookup, String, Class) class data}, @@ -2359,15 +2374,16 @@ public class MethodHandles { /** * Returns a ClassDefiner that creates a {@code Class} object of a hidden class - * from the given bytes. No package name check on the given name. + * from the given bytes and the given options. No package name check on the given name. * * @param name fully-qualified name that specifies the prefix of the hidden class * @param bytes class bytes - * @return ClassDefiner that defines a hidden class of the given bytes. + * @param options class options + * @return ClassDefiner that defines a hidden class of the given bytes and options. */ - ClassDefiner makeHiddenClassDefiner(String name, byte[] bytes) { + ClassDefiner makeHiddenClassDefiner(String name, byte[] bytes, Set options) { // skip name and access flags validation - return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), Set.of(), false); + return makeHiddenClassDefiner(ClassFile.newInstanceNoCheck(name, bytes), options, false); } /** diff --git a/src/java.base/share/classes/java/lang/reflect/Constructor.java b/src/java.base/share/classes/java/lang/reflect/Constructor.java index 400a8990f8d..73ad66d5d5d 100644 --- a/src/java.base/share/classes/java/lang/reflect/Constructor.java +++ b/src/java.base/share/classes/java/lang/reflect/Constructor.java @@ -26,6 +26,7 @@ package java.lang.reflect; import jdk.internal.access.SharedSecrets; +import jdk.internal.misc.VM; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.ConstructorAccessor; import jdk.internal.reflect.Reflection; @@ -63,19 +64,17 @@ import java.util.StringJoiner; * @since 1.1 */ public final class Constructor extends Executable { - @Stable - private Class clazz; - private int slot; - private Class[] parameterTypes; - private Class[] exceptionTypes; - @Stable - private int modifiers; + private final Class clazz; + private final int slot; + private final Class[] parameterTypes; + private final Class[] exceptionTypes; + private final int modifiers; // Generics and annotations support - private transient String signature; + private final transient String signature; // generic info repository; lazily initialized private transient ConstructorRepository genericInfo; - private byte[] annotations; - private byte[] parameterAnnotations; + private final byte[] annotations; + private final byte[] parameterAnnotations; // Generics infrastructure // Accessor for factory @@ -492,9 +491,6 @@ public final class Constructor extends Executable { if (checkAccess) checkAccess(caller, clazz, clazz, modifiers); - if ((clazz.getModifiers() & Modifier.ENUM) != 0) - throw new IllegalArgumentException("Cannot reflectively create enum objects"); - ConstructorAccessor ca = constructorAccessor; // read @Stable if (ca == null) { ca = acquireConstructorAccessor(); @@ -534,6 +530,7 @@ public final class Constructor extends Executable { // synchronization will probably make the implementation more // scalable. private ConstructorAccessor acquireConstructorAccessor() { + // First check to see if one has been created yet, and take it // if so. Constructor root = this.root; @@ -542,8 +539,14 @@ public final class Constructor extends Executable { constructorAccessor = tmp; } else { // Otherwise fabricate one and propagate it up to the root + // Ensure the declaring class is not an Enum class. + if ((clazz.getModifiers() & Modifier.ENUM) != 0) + throw new IllegalArgumentException("Cannot reflectively create enum objects"); + tmp = reflectionFactory.newConstructorAccessor(this); - setConstructorAccessor(tmp); + // set the constructor accessor only if it's not using native implementation + if (VM.isJavaLangInvokeInited()) + setConstructorAccessor(tmp); } return tmp; diff --git a/src/java.base/share/classes/java/lang/reflect/Field.java b/src/java.base/share/classes/java/lang/reflect/Field.java index e8d0e68671b..eb4677f01ef 100644 --- a/src/java.base/share/classes/java/lang/reflect/Field.java +++ b/src/java.base/share/classes/java/lang/reflect/Field.java @@ -65,23 +65,19 @@ import sun.reflect.annotation.TypeAnnotationParser; */ public final class Field extends AccessibleObject implements Member { - - @Stable - private Class clazz; - private int slot; + private final Class clazz; + private final int slot; // This is guaranteed to be interned by the VM in the 1.4 // reflection implementation - private String name; - @Stable - private Class type; - @Stable - private int modifiers; - private boolean trustedFinal; + private final String name; + private final Class type; + private final int modifiers; + private final boolean trustedFinal; // Generics and annotations support - private transient String signature; + private final transient String signature; // generic info repository; lazily initialized private transient FieldRepository genericInfo; - private byte[] annotations; + private final byte[] annotations; // Cached field accessor created without override @Stable private FieldAccessor fieldAccessor; diff --git a/src/java.base/share/classes/java/lang/reflect/Method.java b/src/java.base/share/classes/java/lang/reflect/Method.java index 037c4c7008a..5d8fe026b40 100644 --- a/src/java.base/share/classes/java/lang/reflect/Method.java +++ b/src/java.base/share/classes/java/lang/reflect/Method.java @@ -26,7 +26,9 @@ package java.lang.reflect; import jdk.internal.access.SharedSecrets; +import jdk.internal.misc.VM; import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; import jdk.internal.reflect.MethodAccessor; import jdk.internal.reflect.Reflection; import jdk.internal.vm.annotation.ForceInline; @@ -67,24 +69,22 @@ import java.util.StringJoiner; * @since 1.1 */ public final class Method extends Executable { - @Stable - private Class clazz; - private int slot; + private final Class clazz; + private final int slot; // This is guaranteed to be interned by the VM in the 1.4 // reflection implementation - private String name; - private Class returnType; - private Class[] parameterTypes; - private Class[] exceptionTypes; - @Stable - private int modifiers; + private final String name; + private final Class returnType; + private final Class[] parameterTypes; + private final Class[] exceptionTypes; + private final int modifiers; // Generics and annotations support - private transient String signature; + private final transient String signature; // generic info repository; lazily initialized private transient MethodRepository genericInfo; - private byte[] annotations; - private byte[] parameterAnnotations; - private byte[] annotationDefault; + private final byte[] annotations; + private final byte[] parameterAnnotations; + private final byte[] annotationDefault; @Stable private MethodAccessor methodAccessor; // For sharing of MethodAccessors. This branching structure is @@ -553,20 +553,64 @@ public final class Method extends Executable { @ForceInline // to ensure Reflection.getCallerClass optimization @IntrinsicCandidate public Object invoke(Object obj, Object... args) - throws IllegalAccessException, IllegalArgumentException, - InvocationTargetException + throws IllegalAccessException, InvocationTargetException { + boolean callerSensitive = isCallerSensitive(); + Class caller = null; + if (!override || callerSensitive) { + caller = Reflection.getCallerClass(); + } + + // Reflection::getCallerClass filters all subclasses of + // jdk.internal.reflect.MethodAccessorImpl and Method::invoke(Object, Object[]) + // Should not call Method::invoke(Object, Object[], Class) here + if (!override) { + checkAccess(caller, clazz, + Modifier.isStatic(modifiers) ? null : obj.getClass(), + modifiers); + } + MethodAccessor ma = methodAccessor; // read @Stable + if (ma == null) { + ma = acquireMethodAccessor(); + } + + return callerSensitive ? ma.invoke(obj, args, caller) : ma.invoke(obj, args); + } + + /** + * This is to support MethodHandle calling caller-sensitive Method::invoke + * that may invoke a caller-sensitive method in order to get the original caller + * class (not the injected invoker). + * + * If this adapter is not presented, MethodHandle invoking Method::invoke + * will get an invoker class, a hidden nestmate of the original caller class, + * that becomes the caller class invoking Method::invoke. + */ + @CallerSensitiveAdapter + private Object invoke(Object obj, Object[] args, Class caller) + throws IllegalAccessException, InvocationTargetException + { + boolean callerSensitive = isCallerSensitive(); if (!override) { - Class caller = Reflection.getCallerClass(); checkAccess(caller, clazz, Modifier.isStatic(modifiers) ? null : obj.getClass(), modifiers); } - MethodAccessor ma = methodAccessor; // read volatile + MethodAccessor ma = methodAccessor; // read @Stable if (ma == null) { ma = acquireMethodAccessor(); } - return ma.invoke(obj, args); + + return callerSensitive ? ma.invoke(obj, args, caller) : ma.invoke(obj, args); + } + + @Stable private Boolean callerSensitive; // lazily initialize + private boolean isCallerSensitive() { + Boolean cs = callerSensitive; + if (cs == null) { + callerSensitive = cs = Reflection.isCallerSensitive(this); + } + return cs; } /** @@ -672,8 +716,10 @@ public final class Method extends Executable { methodAccessor = tmp; } else { // Otherwise fabricate one and propagate it up to the root - tmp = reflectionFactory.newMethodAccessor(this); - setMethodAccessor(tmp); + tmp = reflectionFactory.newMethodAccessor(this, isCallerSensitive()); + // set the method accessor only if it's not using native implementation + if (VM.isJavaLangInvokeInited()) + setMethodAccessor(tmp); } return tmp; diff --git a/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java b/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java index 02feb046286..ee655188c9d 100644 --- a/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java +++ b/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java @@ -28,8 +28,11 @@ package jdk.internal.access; import jdk.internal.invoke.NativeEntryPoint; import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles.Lookup; import java.lang.invoke.MethodType; import java.lang.invoke.VarHandle; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; import java.nio.ByteOrder; import java.util.List; import java.util.Map; @@ -139,4 +142,43 @@ public interface JavaLangInvokeAccess { * @param mh the method handle */ void ensureCustomized(MethodHandle mh); + + /** + * Produces a method handle unreflecting from a {@code Constructor} with + * the trusted lookup + */ + MethodHandle unreflectConstructor(Constructor ctor) throws IllegalAccessException; + + /** + * Produces a method handle unreflecting from a {@code Field} with + * the trusted lookup + */ + MethodHandle unreflectField(Field field, boolean isSetter) throws IllegalAccessException; + + /** + * Produces a method handle of a virtual method with the trusted lookup. + */ + MethodHandle findVirtual(Class defc, String name, MethodType type) throws IllegalAccessException; + + /** + * Produces a method handle of a static method with the trusted lookup. + */ + MethodHandle findStatic(Class defc, String name, MethodType type) throws IllegalAccessException; + + /** + * Returns a method handle of an invoker class injected for core reflection + * implementation with the following signature: + * reflect_invoke_V(MethodHandle mh, Object target, Object[] args) + * + * The invoker class is a hidden class which has the same + * defining class loader, runtime package, and protection domain + * as the given caller class. + */ + MethodHandle reflectiveInvoker(Class caller); + + /** + * Defines a hidden class of the given name and bytes with class data. + * The given bytes is trusted. + */ + Lookup defineHiddenClassWithClassData(Lookup caller, String name, byte[] bytes, Object classData, boolean initialize); } diff --git a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java index f6d3638c3dd..1e98e727b79 100644 --- a/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java +++ b/src/java.base/share/classes/jdk/internal/access/SharedSecrets.java @@ -51,7 +51,6 @@ import java.security.Signature; for this purpose, namely the loss of compile-time checking. */ public class SharedSecrets { - private static final MethodHandles.Lookup lookup = MethodHandles.lookup(); private static JavaAWTAccess javaAWTAccess; private static JavaAWTFontAccess javaAWTFontAccess; private static JavaBeansAccess javaBeansAccess; diff --git a/src/java.base/share/classes/jdk/internal/misc/VM.java b/src/java.base/share/classes/jdk/internal/misc/VM.java index 5ad27d8e7ee..e8603ed46cf 100644 --- a/src/java.base/share/classes/jdk/internal/misc/VM.java +++ b/src/java.base/share/classes/jdk/internal/misc/VM.java @@ -27,14 +27,13 @@ package jdk.internal.misc; import static java.lang.Thread.State.*; -import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import jdk.internal.access.SharedSecrets; - +import jdk.internal.vm.annotation.Stable; import sun.nio.ch.FileChannelImpl; public class VM { @@ -91,7 +90,19 @@ public class VM { * @see java.lang.System#initPhase2 */ public static boolean isModuleSystemInited() { - return VM.initLevel() >= MODULE_SYSTEM_INITED; + return initLevel >= MODULE_SYSTEM_INITED; + } + + private static @Stable boolean javaLangInvokeInited; + public static void setJavaLangInvokeInited() { + if (javaLangInvokeInited) { + throw new InternalError("java.lang.invoke already inited"); + } + javaLangInvokeInited = true; + } + + public static boolean isJavaLangInvokeInited() { + return javaLangInvokeInited; } /** diff --git a/src/java.base/share/classes/jdk/internal/reflect/AccessorUtils.java b/src/java.base/share/classes/jdk/internal/reflect/AccessorUtils.java new file mode 100644 index 00000000000..64b928e05e0 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/AccessorUtils.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.WrongMethodTypeException; +import java.util.Set; + +/** + * Utility methods used by DirectMethodHandleAccessor and DirectConstructorHandleAccessor + */ +public class AccessorUtils { + /** + * Determines if the given exception thrown by MethodHandle::invokeExact + * is caused by an illegal argument passed to Method::invoke or + * Constructor::newInstance. This method inspects the stack trace of + * the exception to detect if it is thrown by the method handle core + * implementation or the implementation of the reflected method or constructor. + * + * MethodHandle::invoke throws ClassCastException if the receiver object + * is not an instance of the declaring class of the method if the method + * is an instance method, or if a parameter value cannot be converted + * to the corresponding formal parameter type. It throws + * NullPointerException if the receiver object is null if the method + * is an instance method, or if unboxing operation of a parameter fails + * because the parameter value is null. It throws WrongMethodTypeException + * if the method type mismatches. + * + * @param accessorType the accessor class that does the method handle invocation + * @param e ClassCastException, NullPointerException or WrongMethodTypeException + */ + static boolean isIllegalArgument(Class accessorType, RuntimeException e) { + assert(e instanceof ClassCastException || e instanceof NullPointerException || + e instanceof WrongMethodTypeException); + + StackTraceElement[] stackTrace = e.getStackTrace(); + if (stackTrace.length == 0) { + return false; // would this happen? + } + + int i = 0; + StackTraceElement frame = stackTrace[0]; + // Class::cast and Objects::requiresNonNull may be thrown by the implementation + // of the reflected method/constructor. Skip them and continue. + if ((frame.getClassName().equals("java.lang.Class") && frame.getMethodName().equals("cast")) + || (frame.getClassName().equals("java.util.Objects") && frame.getMethodName().equals("requiresNonNull"))) { + i++; + } + for (; i < stackTrace.length; i++) { + frame = stackTrace[i]; + String cname = frame.getClassName(); + // it's illegal argument if this exception is thrown from accessorType + if (cname.equals(accessorType.getName())) { + return true; + } + // if this exception is thrown from an unnamed module or not from java.base + // then i.e. not from method handle core implementation + if (frame.getModuleName() == null || !frame.getModuleName().equals("java.base")) { + return false; + } + int index = cname.lastIndexOf("."); + String pn = index > 0 ? cname.substring(0, index) : ""; + // exception thrown from java.base but not from core reflection/method handle internals + if (!IMPL_PACKAGES.contains(pn)) { + return false; + } + // If Constructor::newInstance is invoked by Method::invoke or vice versa, + // so the exception is thrown from the implementation body of the reflected + // method or constructor + if ((accessorType == DirectMethodHandleAccessor.class + && cname.startsWith(DirectConstructorHandleAccessor.class.getName())) + || (accessorType == DirectConstructorHandleAccessor.class + && cname.startsWith(DirectMethodHandleAccessor.class.getName()))) { + // thrown from another reflection accessor impl class + return false; + } + } + return false; + } + + private static final Set IMPL_PACKAGES = Set.of( + "java.lang.reflect", + "java.lang.invoke", + "jdk.internal.reflect", + "sun.invoke.util" + ); +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/CallerSensitiveAdapter.java b/src/java.base/share/classes/jdk/internal/reflect/CallerSensitiveAdapter.java new file mode 100644 index 00000000000..2d7fced04d2 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/CallerSensitiveAdapter.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.METHOD; + +/** + * A method annotated @CallerSensitiveAdapter is an adapter method corresponding + * to a caller-sensitive method, which is annotated with @CallerSensitive. + * + * A caller-sensitive adapter is private and has the same name as its + * corresponding caller-sensitive method with a trailing caller class parameter. + * + * When a caller-sensitive method is invoked via Method::invoke or MethodHandle + * the core reflection and method handle implementation will find if + * an @CallerSensitiveAdapter method for that CSM is present. If present, + * the runtime will invoke the adapter method with the caller class + * argument instead. This special calling sequence ensures that the same caller + * class is passed to a caller-sensitive method via Method::invoke, + * MethodHandle::invokeExact, or a mix of these methods. + * + * For example, CSM::returnCallerClass is a caller-sensitive method + * with an adapter method: + * {@code + * class CSM { + * @CallerSensitive + * static Class returnCallerClass() { + * return returnCallerClass(Reflection.getCallerClass()); + * } + * @CallerSensitiveAdapter + * private static Class returnCallerClass(Class caller) { + * return caller; + * } + * } + * + * class Test { + * void test() throws Throwable { + * // calling CSM::returnCallerClass via reflection + * var csm = CSM.class.getMethod("returnCallerClass"); + * // expect Foo to be the caller class + * var caller = csm.invoke(null); + * assert(caller == Test.class); + * } + * void test2() throws Throwable { + * // method handle for Method::invoke + * MethodHandle mh = MethodHandles.lookup().findVirtual(Method.class, "invoke", + * methodType(Object.class, Object.class, Object[].class)); + * var csm = CSM.class.getMethod("returnCallerClass"); + * // invoke Method::invoke via method handle and the target method + * // being invoked reflectively is CSM::returnCallerClass + * var caller = mh.invoke(csm, null, null); + * assert(caller == Test.class); + * } + * } + * } + * + * + * Both CSM::returnCallerClass and Method::invoke can have an adapter method + * with a caller-class parameter defined. Test::test calls CSM::returnCallerClass + * via Method::invoke which does the stack walking to find the caller's class. + * It will pass the caller's class directly to the adapter method for + * CSM::returnCallerClass. + * + * Similarly, Test::test2 invokes the method handle of Method::invoke to + * call CSM::returnCallerClass reflectively. In that case, MethodHandle::invokeExact + * uses the lookup class of the Lookup object producing the method handle + * as the caller's class, so no stack walking involved. The lookup class is Test. + * It will invoke the adapter method of Method::invoke with Test as the caller's + * class, which in turn invokes the adapter method of CSM::returnCallerClass + * with Test as the caller. The calling sequence eliminates the need for + * multiple stack walks when a caller-sensitive method is invoked reflectively. + * + * For caller-sensitive methods that require an exact caller class, the adapter + * method must be defined for correctness. {@link java.lang.invoke.MethodHandles#lookup()} + * and {@link ClassLoader#registerAsParallelCapable()} are the only two methods + * in the JDK that need the exact caller class. + * + * On the other hand, for caller-sensitive methods that use the caller's class + * for access checks or security permission checks, i.e., based on its runtime + * package, defining loader, or protection domain, the adapter method is optional. + */ +@Retention(RetentionPolicy.CLASS) +@Target({METHOD}) +public @interface CallerSensitiveAdapter { +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/CsMethodAccessorAdapter.java b/src/java.base/share/classes/jdk/internal/reflect/CsMethodAccessorAdapter.java new file mode 100644 index 00000000000..a2cfae6e975 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/CsMethodAccessorAdapter.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.Hidden; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/** + * MethodAccessor adapter for caller-sensitive methods which have + * an alternate non-CSM method with the same method name but an additional + * caller class argument. + * + * When a caller-sensitive method is called, + * Method::invoke(Object target, Object[] args, Class caller) will + * be invoked with the caller class. If an adapter is present, + * the adapter method with the caller class parameter will be called + * instead. + */ +class CsMethodAccessorAdapter extends MethodAccessorImpl { + private final Method csmAdapter; + private final MethodAccessor accessor; + + CsMethodAccessorAdapter(Method method, Method csmAdapter, MethodAccessor accessor) { + assert Reflection.isCallerSensitive(method) && !Reflection.isCallerSensitive(csmAdapter); + this.csmAdapter = csmAdapter; + this.accessor = accessor; + } + + @Override + public Object invoke(Object obj, Object[] args) + throws IllegalArgumentException, InvocationTargetException { + throw new InternalError("caller-sensitive method invoked without explicit caller: " + csmAdapter); + } + + @Override + @ForceInline + @Hidden + public Object invoke(Object obj, Object[] args, Class caller) + throws IllegalArgumentException, InvocationTargetException { + Object[] newArgs = new Object[args == null ? 1 : args.length + 1]; + newArgs[0] = caller; + if (args != null) { + System.arraycopy(args, 0, newArgs, 1, args.length); + } + return accessor.invoke(obj, newArgs); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/DelegatingConstructorAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/DelegatingConstructorAccessorImpl.java index eaa9a786392..d8c525b8958 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/DelegatingConstructorAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/DelegatingConstructorAccessorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -35,7 +35,6 @@ import java.util.Objects; class DelegatingConstructorAccessorImpl extends ConstructorAccessorImpl { // initial non-null delegate - @Stable private final ConstructorAccessorImpl initialDelegate; // alternative delegate: starts as null; // only single change from null -> non-null is guaranteed diff --git a/src/java.base/share/classes/jdk/internal/reflect/DelegatingMethodAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/DelegatingMethodAccessorImpl.java index 09cb4159174..d10cceccf7a 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/DelegatingMethodAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/DelegatingMethodAccessorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -35,10 +35,11 @@ import java.util.Objects; class DelegatingMethodAccessorImpl extends MethodAccessorImpl { // initial non-null delegate - @Stable private final MethodAccessorImpl initialDelegate; + private final MethodAccessorImpl initialDelegate; // alternative delegate: starts as null; // only single change from null -> non-null is guaranteed - @Stable private MethodAccessorImpl altDelegate; + @Stable + private MethodAccessorImpl altDelegate; DelegatingMethodAccessorImpl(MethodAccessorImpl delegate) { initialDelegate = Objects.requireNonNull(delegate); @@ -51,6 +52,13 @@ class DelegatingMethodAccessorImpl extends MethodAccessorImpl { return delegate().invoke(obj, args); } + @Override + public Object invoke(Object obj, Object[] args, Class caller) + throws IllegalArgumentException, InvocationTargetException + { + return delegate().invoke(obj, args, caller); + } + private MethodAccessorImpl delegate() { var d = altDelegate; return d != null ? d : initialDelegate; diff --git a/src/java.base/share/classes/jdk/internal/reflect/DirectConstructorHandleAccessor.java b/src/java.base/share/classes/jdk/internal/reflect/DirectConstructorHandleAccessor.java new file mode 100644 index 00000000000..4c0f7bdabb0 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/DirectConstructorHandleAccessor.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.Hidden; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.WrongMethodTypeException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +import static jdk.internal.reflect.MethodHandleAccessorFactory.SPECIALIZED_PARAM_COUNT; + +class DirectConstructorHandleAccessor extends ConstructorAccessorImpl { + static ConstructorAccessorImpl constructorAccessor(Constructor ctor, MethodHandle target) { + return new DirectConstructorHandleAccessor(ctor, target); + } + + static ConstructorAccessorImpl nativeAccessor(Constructor ctor) { + return new NativeAccessor(ctor); + } + + private static final int PARAM_COUNT_MASK = 0x00FF; + private static final int NONZERO_BIT = 0x8000_0000; + + private final int paramFlags; + private final MethodHandle target; + + DirectConstructorHandleAccessor(Constructor ctor, MethodHandle target) { + this.paramFlags = (ctor.getParameterCount() & PARAM_COUNT_MASK) | NONZERO_BIT; + this.target = target; + } + + @Override + public Object newInstance(Object[] args) throws InstantiationException, InvocationTargetException { + int argc = args != null ? args.length : 0; + // only check argument count for specialized forms + int paramCount = paramFlags & PARAM_COUNT_MASK; + if (paramCount <= SPECIALIZED_PARAM_COUNT && argc != paramCount) { + throw new IllegalArgumentException("wrong number of arguments: " + argc + " expected: " + paramCount); + } + try { + return invokeImpl(args); + } catch (ClassCastException|WrongMethodTypeException e) { + if (isIllegalArgument(e)) + throw new IllegalArgumentException("argument type mismatch", e); + else + throw new InvocationTargetException(e); + } catch (NullPointerException e) { + if (isIllegalArgument(e)) + throw new IllegalArgumentException(e); + else + throw new InvocationTargetException(e); + } catch (Throwable e) { + throw new InvocationTargetException(e); + } + } + + private boolean isIllegalArgument(RuntimeException ex) { + return AccessorUtils.isIllegalArgument(DirectConstructorHandleAccessor.class, ex); + } + + @Hidden + @ForceInline + Object invokeImpl(Object[] args) throws Throwable { + return switch (paramFlags & PARAM_COUNT_MASK) { + case 0 -> target.invokeExact(); + case 1 -> target.invokeExact(args[0]); + case 2 -> target.invokeExact(args[0], args[1]); + case 3 -> target.invokeExact(args[0], args[1], args[2]); + default -> target.invokeExact(args); + }; + } + + /** + * Invoke the constructor via native VM reflection + */ + static class NativeAccessor extends ConstructorAccessorImpl { + private final Constructor ctor; + NativeAccessor(Constructor ctor) { + this.ctor = ctor; + } + + @Override + public Object newInstance(Object[] args) throws InstantiationException, InvocationTargetException { + return newInstance0(ctor, args); + } + private static native Object newInstance0(Constructor c, Object[] args) + throws InstantiationException, InvocationTargetException; + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java b/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java new file mode 100644 index 00000000000..86609cc2727 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/DirectMethodHandleAccessor.java @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import jdk.internal.access.JavaLangInvokeAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.misc.VM; +import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.Hidden; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.WrongMethodTypeException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import static java.lang.invoke.MethodType.genericMethodType; +import static jdk.internal.reflect.MethodHandleAccessorFactory.SPECIALIZED_PARAM_COUNT; +import static jdk.internal.reflect.MethodHandleAccessorFactory.LazyStaticHolder.JLIA; + +class DirectMethodHandleAccessor extends MethodAccessorImpl { + /** + * Creates a MethodAccessorImpl for a non-native method. + */ + static MethodAccessorImpl methodAccessor(Method method, MethodHandle target) { + assert !Modifier.isNative(method.getModifiers()); + + return new DirectMethodHandleAccessor(method, target, false); + } + + /** + * Creates MethodAccessorImpl for the adapter method for a caller-sensitive method. + * The given target method handle is the adapter method with the additional caller class + * parameter. + */ + static MethodAccessorImpl callerSensitiveAdapter(Method original, MethodHandle target) { + assert Reflection.isCallerSensitive(original); + + // for CSM adapter method with the additional caller class parameter + // creates the adaptive method accessor only. + return new DirectMethodHandleAccessor(original, target, true); + } + + /** + * Creates MethodAccessorImpl that invokes the given method via VM native reflection + * support. This is used for native methods. It can be used for java methods + * during early VM startup. + */ + static MethodAccessorImpl nativeAccessor(Method method, boolean callerSensitive) { + return callerSensitive ? new NativeAccessor(method, findCSMethodAdapter(method)) + : new NativeAccessor(method); + } + + private static final int PARAM_COUNT_MASK = 0x00FF; + private static final int HAS_CALLER_PARAM_BIT = 0x0100; + private static final int IS_STATIC_BIT = 0x0200; + private static final int NONZERO_BIT = 0x8000_0000; + + private final Class declaringClass; + private final int paramCount; + private final int flags; + private final MethodHandle target; + + DirectMethodHandleAccessor(Method method, MethodHandle target, boolean hasCallerParameter) { + this.declaringClass = method.getDeclaringClass(); + this.paramCount = method.getParameterCount(); + this.flags = (hasCallerParameter ? HAS_CALLER_PARAM_BIT : 0) | + (Modifier.isStatic(method.getModifiers()) ? IS_STATIC_BIT : 0); + this.target = target; + } + + @Override + @ForceInline + public Object invoke(Object obj, Object[] args) throws InvocationTargetException { + if (!isStatic()) { + checkReceiver(obj); + } + checkArgumentCount(paramCount, args); + try { + return invokeImpl(obj, args); + } catch (ClassCastException | WrongMethodTypeException e) { + if (isIllegalArgument(e)) { + // No cause in IAE to be consistent with the old behavior + throw new IllegalArgumentException("argument type mismatch"); + } else { + throw new InvocationTargetException(e); + } + } catch (NullPointerException e) { + if (isIllegalArgument(e)) { + throw new IllegalArgumentException(e); + } else { + throw new InvocationTargetException(e); + } + } catch (Throwable e) { + throw new InvocationTargetException(e); + } + } + + @Override + @ForceInline + public Object invoke(Object obj, Object[] args, Class caller) throws InvocationTargetException { + if (!isStatic()) { + checkReceiver(obj); + } + checkArgumentCount(paramCount, args); + try { + return invokeImpl(obj, args, caller); + } catch (ClassCastException | WrongMethodTypeException e) { + if (isIllegalArgument(e)) { + // No cause in IAE to be consistent with the old behavior + throw new IllegalArgumentException("argument type mismatch"); + } else { + throw new InvocationTargetException(e); + } + } catch (NullPointerException e) { + if (isIllegalArgument(e)) { + throw new IllegalArgumentException(e); + } else { + throw new InvocationTargetException(e); + } + } catch (Throwable e) { + throw new InvocationTargetException(e); + } + } + + @Hidden + @ForceInline + private Object invokeImpl(Object obj, Object[] args) throws Throwable { + return switch (paramCount) { + case 0 -> target.invokeExact(obj); + case 1 -> target.invokeExact(obj, args[0]); + case 2 -> target.invokeExact(obj, args[0], args[1]); + case 3 -> target.invokeExact(obj, args[0], args[1], args[2]); + default -> target.invokeExact(obj, args); + }; + } + + @Hidden + @ForceInline + private Object invokeImpl(Object obj, Object[] args, Class caller) throws Throwable { + if (hasCallerParameter()) { + // caller-sensitive method is invoked through method with caller parameter + return switch (paramCount) { + case 0 -> target.invokeExact(obj, caller); + case 1 -> target.invokeExact(obj, args[0], caller); + case 2 -> target.invokeExact(obj, args[0], args[1], caller); + case 3 -> target.invokeExact(obj, args[0], args[1], args[2], caller); + default -> target.invokeExact(obj, args, caller); + }; + } else { + // caller-sensitive method is invoked through a per-caller invoker while + // the target MH is always spreading the args + var invoker = JLIA.reflectiveInvoker(caller); + try { + // invoke the target method handle via an invoker + return invoker.invokeExact(target, obj, args); + } catch (IllegalArgumentException e) { + throw new InvocationTargetException(e); + } + } + } + + private boolean isStatic() { + return (flags & IS_STATIC_BIT) == IS_STATIC_BIT; + } + + private boolean hasCallerParameter() { + return (flags & HAS_CALLER_PARAM_BIT) == HAS_CALLER_PARAM_BIT; + } + + private boolean isIllegalArgument(RuntimeException ex) { + return AccessorUtils.isIllegalArgument(DirectMethodHandleAccessor.class, ex); + } + + private void checkReceiver(Object o) { + // NOTE: will throw NullPointerException, as specified, if o is null + if (!declaringClass.isAssignableFrom(o.getClass())) { + throw new IllegalArgumentException("object is not an instance of declaring class"); + } + } + + /** + * Invoke the method via native VM reflection + */ + static class NativeAccessor extends MethodAccessorImpl { + private final Method method; + private final Method csmAdapter; + private final boolean callerSensitive; + NativeAccessor(Method method) { + assert !Reflection.isCallerSensitive(method); + this.method = method; + this.csmAdapter = null; + this.callerSensitive = false; + } + + NativeAccessor(Method method, Method csmAdapter) { + assert Reflection.isCallerSensitive(method); + this.method = method; + this.csmAdapter = csmAdapter; + this.callerSensitive = true; + } + + @Override + public Object invoke(Object obj, Object[] args) throws InvocationTargetException { + assert csmAdapter == null; + return invoke0(method, obj, args); + } + + @Override + public Object invoke(Object obj, Object[] args, Class caller) throws InvocationTargetException { + assert callerSensitive; + + if (csmAdapter != null) { + Object[] newArgs = new Object[csmAdapter.getParameterCount()]; + newArgs[0] = caller; + if (args != null) { + System.arraycopy(args, 0, newArgs, 1, args.length); + } + return invoke0(csmAdapter, obj, newArgs); + } else { + assert VM.isJavaLangInvokeInited(); + try { + return ReflectiveInvoker.invoke(methodAccessorInvoker(), caller, obj, args); + } catch (InvocationTargetException|RuntimeException|Error e) { + throw e; + } catch (Throwable e) { + throw new InternalError(e); + } + } + } + + public Object invokeViaReflectiveInvoker(Object obj, Object[] args) throws InvocationTargetException { + return invoke0(method, obj, args); + } + + /* + * A method handle to invoke Reflective::Invoker + */ + private MethodHandle maInvoker; + private MethodHandle methodAccessorInvoker() { + MethodHandle invoker = maInvoker; + if (invoker == null) { + maInvoker = invoker = ReflectiveInvoker.bindTo(this); + } + return invoker; + } + + private static native Object invoke0(Method m, Object obj, Object[] args); + + static class ReflectiveInvoker { + /** + * Return a method handle for NativeAccessor::invoke bound to the given accessor object + */ + static MethodHandle bindTo(NativeAccessor accessor) { + return NATIVE_ACCESSOR_INVOKE.bindTo(accessor); + } + + /* + * When Method::invoke on a caller-sensitive method is to be invoked + * and no adapter method with an additional caller class argument is defined, + * the caller-sensitive method must be invoked via an invoker injected + * which has the following signature: + * reflect_invoke_V(MethodHandle mh, Object target, Object[] args) + * + * The stack frames calling the method `csm` through reflection will + * look like this: + * obj.csm(args) + * NativeAccessor::invoke(obj, args) + * InjectedInvoker::reflect_invoke_V(vamh, obj, args); + * method::invoke(obj, args) + * p.Foo::m + * + * An injected invoker class is a hidden class which has the same + * defining class loader, runtime package, and protection domain + * as the given caller class. + * + * The caller-sensitive method will call Reflection::getCallerClass + * to get the caller class. + */ + static Object invoke(MethodHandle target, Class caller, Object obj, Object[] args) + throws InvocationTargetException + { + var reflectInvoker = JLIA.reflectiveInvoker(caller); + try { + return reflectInvoker.invokeExact(target, obj, args); + } catch (InvocationTargetException | RuntimeException | Error e) { + throw e; + } catch (Throwable e) { + throw new InternalError(e); + } + } + + static final JavaLangInvokeAccess JLIA; + static final MethodHandle NATIVE_ACCESSOR_INVOKE; + static { + try { + JLIA = SharedSecrets.getJavaLangInvokeAccess(); + NATIVE_ACCESSOR_INVOKE = MethodHandles.lookup().findVirtual(NativeAccessor.class, "invoke", + genericMethodType(1, true)); + } catch (NoSuchMethodException|IllegalAccessException e) { + throw new InternalError(e); + } + } + } + } + + private static void checkArgumentCount(int paramCount, Object[] args) { + // only check argument count for specialized forms + if (paramCount > SPECIALIZED_PARAM_COUNT) return; + + int argc = args != null ? args.length : 0; + if (argc != paramCount) { + throw new IllegalArgumentException("wrong number of arguments: " + argc + " expected: " + paramCount); + } + } + + /** + * Returns an adapter for caller-sensitive method if present. + * Otherwise, null. + * + * A trusted method can define an adapter method for a caller-sensitive method `foo` + * with an additional caller class argument that will be invoked reflectively. + */ + private static Method findCSMethodAdapter(Method method) { + if (!Reflection.isCallerSensitive(method)) return null; + + int paramCount = method.getParameterCount(); + Class[] ptypes = new Class[paramCount+1]; + ptypes[paramCount] = Class.class; + System.arraycopy(method.getParameterTypes(), 0, ptypes, 0, paramCount); + try { + return method.getDeclaringClass().getDeclaredMethod(method.getName(), ptypes); + } catch (NoSuchMethodException ex) { + return null; + } + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java index b703d082534..cba836c5edd 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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,9 +25,8 @@ package jdk.internal.reflect; -import jdk.internal.vm.annotation.Stable; - import java.lang.reflect.Field; +import java.lang.reflect.Modifier; /** Package-private implementation of the FieldAccessor interface which has access to all classes and all fields, regardless of @@ -35,7 +34,6 @@ import java.lang.reflect.Field; abstract class FieldAccessorImpl extends MagicAccessorImpl implements FieldAccessor { - @Stable protected final Field field; FieldAccessorImpl(Field field) { @@ -113,4 +111,167 @@ abstract class FieldAccessorImpl extends MagicAccessorImpl /** Matches specification in {@link java.lang.reflect.Field} */ public abstract void setDouble(Object obj, double d) throws IllegalArgumentException, IllegalAccessException; + + + protected void ensureObj(Object o) { + // NOTE: will throw NullPointerException, as specified, if o is null + if (!field.getDeclaringClass().isAssignableFrom(o.getClass())) { + throwSetIllegalArgumentException(o); + } + } + + private String getQualifiedFieldName() { + return field.getDeclaringClass().getName() + "." +field.getName(); + } + + protected IllegalArgumentException newGetIllegalArgumentException(String type) { + return new IllegalArgumentException( + "Attempt to get "+field.getType().getName()+" field \"" + + getQualifiedFieldName() + "\" with illegal data type conversion to "+type + ); + } + + protected void throwFinalFieldIllegalAccessException(String attemptedType, + String attemptedValue) + throws IllegalAccessException { + throw new IllegalAccessException(getSetMessage(attemptedType, attemptedValue)); + } + + protected void throwFinalFieldIllegalAccessException(Object o) throws IllegalAccessException { + throwFinalFieldIllegalAccessException(o != null ? o.getClass().getName() : "", ""); + } + + protected void throwFinalFieldIllegalAccessException(boolean z) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("boolean", Boolean.toString(z)); + } + + protected void throwFinalFieldIllegalAccessException(char b) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("char", Character.toString(b)); + } + + protected void throwFinalFieldIllegalAccessException(byte b) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("byte", Byte.toString(b)); + } + + protected void throwFinalFieldIllegalAccessException(short b) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("short", Short.toString(b)); + } + + protected void throwFinalFieldIllegalAccessException(int i) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("int", Integer.toString(i)); + } + + protected void throwFinalFieldIllegalAccessException(long i) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("long", Long.toString(i)); + } + + protected void throwFinalFieldIllegalAccessException(float f) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("float", Float.toString(f)); + } + + protected void throwFinalFieldIllegalAccessException(double f) throws IllegalAccessException { + throwFinalFieldIllegalAccessException("double", Double.toString(f)); + } + + protected IllegalArgumentException newGetBooleanIllegalArgumentException() { + return newGetIllegalArgumentException("boolean"); + } + + protected IllegalArgumentException newGetByteIllegalArgumentException() { + return newGetIllegalArgumentException("byte"); + } + + protected IllegalArgumentException newGetCharIllegalArgumentException() { + return newGetIllegalArgumentException("char"); + } + + protected IllegalArgumentException newGetShortIllegalArgumentException() { + return newGetIllegalArgumentException("short"); + } + + protected IllegalArgumentException newGetIntIllegalArgumentException() { + return newGetIllegalArgumentException("int"); + } + + protected IllegalArgumentException newGetLongIllegalArgumentException() { + return newGetIllegalArgumentException("long"); + } + + protected IllegalArgumentException newGetFloatIllegalArgumentException() { + return newGetIllegalArgumentException("float"); + } + + protected IllegalArgumentException newGetDoubleIllegalArgumentException() { + return newGetIllegalArgumentException("double"); + } + + protected String getSetMessage(String attemptedType, String attemptedValue) { + String err = "Can not set"; + if (Modifier.isStatic(field.getModifiers())) + err += " static"; + if (Modifier.isFinal(field.getModifiers())) + err += " final"; + err += " " + field.getType().getName() + " field " + getQualifiedFieldName() + " to "; + if (!attemptedValue.isEmpty()) { + err += "(" + attemptedType + ")" + attemptedValue; + } else { + if (!attemptedType.isEmpty()) + err += attemptedType; + else + err += "null value"; + } + return err; + } + + protected String getMessage(boolean getter, String attemptedType) { + String err = "Can not " + (getter ? "get" : "set"); + if (Modifier.isStatic(field.getModifiers())) + err += " static"; + if (Modifier.isFinal(field.getModifiers())) + err += " final"; + err += " " + field.getType().getName() + " field " + getQualifiedFieldName() + " on " + attemptedType; + return err; + } + + protected void throwSetIllegalArgumentException(String attemptedType, + String attemptedValue) { + throw new IllegalArgumentException(getSetMessage(attemptedType,attemptedValue)); + } + + protected void throwSetIllegalArgumentException(Object o) { + throwSetIllegalArgumentException(o != null ? o.getClass().getName() : "", ""); + } + + protected void throwSetIllegalArgumentException(boolean b) { + throwSetIllegalArgumentException("boolean", Boolean.toString(b)); + } + + protected void throwSetIllegalArgumentException(byte b) { + throwSetIllegalArgumentException("byte", Byte.toString(b)); + } + + protected void throwSetIllegalArgumentException(char c) { + throwSetIllegalArgumentException("char", Character.toString(c)); + } + + protected void throwSetIllegalArgumentException(short s) { + throwSetIllegalArgumentException("short", Short.toString(s)); + } + + protected void throwSetIllegalArgumentException(int i) { + throwSetIllegalArgumentException("int", Integer.toString(i)); + } + + protected void throwSetIllegalArgumentException(long l) { + throwSetIllegalArgumentException("long", Long.toString(l)); + } + + protected void throwSetIllegalArgumentException(float f) { + throwSetIllegalArgumentException("float", Float.toString(f)); + } + + protected void throwSetIllegalArgumentException(double d) { + throwSetIllegalArgumentException("double", Double.toString(d)); + } + } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodAccessor.java b/src/java.base/share/classes/jdk/internal/reflect/MethodAccessor.java index 8ffc0233a96..27dfe4452e4 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodAccessor.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodAccessor.java @@ -37,4 +37,7 @@ public interface MethodAccessor { /** Matches specification in {@link java.lang.reflect.Method} */ public Object invoke(Object obj, Object[] args) throws IllegalArgumentException, InvocationTargetException; + + public Object invoke(Object obj, Object[] args, Class caller) + throws IllegalArgumentException, InvocationTargetException; } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java b/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java index 72bc6eb6e63..8b75661d89d 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java @@ -28,8 +28,8 @@ package jdk.internal.reflect; import java.security.AccessController; import java.security.PrivilegedAction; -/** Generator for sun.reflect.MethodAccessor and - sun.reflect.ConstructorAccessor objects using bytecodes to +/** Generator for jdk.internal.reflect.MethodAccessor and + jdk.internal.reflect.ConstructorAccessor objects using bytecodes to implement reflection. A java.lang.reflect.Method or java.lang.reflect.Constructor object can delegate its invoke or newInstance method to an accessor using native code or to one diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorImpl.java index 91a02645f4e..1ef40d207f0 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorImpl.java @@ -45,4 +45,9 @@ abstract class MethodAccessorImpl extends MagicAccessorImpl /** Matches specification in {@link java.lang.reflect.Method} */ public abstract Object invoke(Object obj, Object[] args) throws IllegalArgumentException, InvocationTargetException; + + public Object invoke(Object obj, Object[] args, Class caller) + throws IllegalArgumentException, InvocationTargetException { + return invoke(obj, args); + } } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleAccessorFactory.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleAccessorFactory.java new file mode 100644 index 00000000000..20ddd16d35a --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleAccessorFactory.java @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.reflect.Constructor; +import java.lang.reflect.Executable; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import jdk.internal.access.JavaLangInvokeAccess; +import jdk.internal.access.SharedSecrets; +import jdk.internal.misc.Unsafe; +import jdk.internal.misc.VM; + +import static java.lang.invoke.MethodType.genericMethodType; +import static java.lang.invoke.MethodType.methodType; +import static jdk.internal.reflect.MethodHandleAccessorFactory.LazyStaticHolder.*; + +final class MethodHandleAccessorFactory { + /** + * Creates a MethodAccessor for the given reflected method. + * + * If the given method is called before the java.lang.invoke initialization + * or the given method is a native method, it will use the native VM reflection + * support. + * + * If the given method is a caller-sensitive method and the corresponding + * caller-sensitive adapter with the caller class parameter is present, + * it will use the method handle of the caller-sensitive adapter. + * + * Otherwise, it will use the direct method handle of the given method. + * + * @see CallerSensitive + * @see CallerSensitiveAdapter + */ + static MethodAccessorImpl newMethodAccessor(Method method, boolean callerSensitive) { + if (useNativeAccessor(method)) { + return DirectMethodHandleAccessor.nativeAccessor(method, callerSensitive); + } + + // ExceptionInInitializerError may be thrown during class initialization + // Ensure class initialized outside the invocation of method handle + // so that EIIE is propagated (not wrapped with ITE) + ensureClassInitialized(method.getDeclaringClass()); + + try { + if (callerSensitive) { + var dmh = findCallerSensitiveAdapter(method); + if (dmh != null) { + return DirectMethodHandleAccessor.callerSensitiveAdapter(method, dmh); + } + } + var dmh = getDirectMethod(method, callerSensitive); + return DirectMethodHandleAccessor.methodAccessor(method, dmh); + } catch (IllegalAccessException e) { + throw new InternalError(e); + } + } + + /** + * Creates a ConstructorAccessor for the given reflected constructor. + * + * If a given constructor is called before the java.lang.invoke initialization, + * it will use the native VM reflection support. + * + * Otherwise, it will use the direct method handle of the given constructor. + */ + static ConstructorAccessorImpl newConstructorAccessor(Constructor ctor) { + if (useNativeAccessor(ctor)) { + return DirectConstructorHandleAccessor.nativeAccessor(ctor); + } + + // ExceptionInInitializerError may be thrown during class initialization + // Ensure class initialized outside the invocation of method handle + // so that EIIE is propagated (not wrapped with ITE) + ensureClassInitialized(ctor.getDeclaringClass()); + + try { + MethodHandle mh = JLIA.unreflectConstructor(ctor); + int paramCount = mh.type().parameterCount(); + MethodHandle target = mh.asFixedArity(); + MethodType mtype = specializedMethodTypeForConstructor(paramCount); + if (paramCount > SPECIALIZED_PARAM_COUNT) { + // spread the parameters only for the non-specialized case + target = target.asSpreader(Object[].class, paramCount); + } + target = target.asType(mtype); + return DirectConstructorHandleAccessor.constructorAccessor(ctor, target); + } catch (IllegalAccessException e) { + throw new InternalError(e); + } + } + + /** + * Creates a FieldAccessor for the given reflected field. + * + * Limitation: Field access via core reflection is only supported after + * java.lang.invoke completes initialization. + * java.lang.invoke initialization starts soon after System::initPhase1 + * and method handles are ready for use when initPhase2 begins. + * During early VM startup (initPhase1), fields can be accessed directly + * from the VM or through JNI. + */ + static FieldAccessorImpl newFieldAccessor(Field field, boolean isReadOnly) { + if (!VM.isJavaLangInvokeInited()) { + throw new InternalError(field.getDeclaringClass().getName() + "::" + field.getName() + + " cannot be accessed reflectively before java.lang.invoke is initialized"); + } + + // ExceptionInInitializerError may be thrown during class initialization + // Ensure class initialized outside the invocation of method handle + // so that EIIE is propagated (not wrapped with ITE) + ensureClassInitialized(field.getDeclaringClass()); + + try { + // the declaring class of the field has been initialized + var getter = JLIA.unreflectField(field, false); + var setter = isReadOnly ? null : JLIA.unreflectField(field, true); + Class type = field.getType(); + if (type == Boolean.TYPE) { + return MethodHandleBooleanFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Byte.TYPE) { + return MethodHandleByteFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Short.TYPE) { + return MethodHandleShortFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Character.TYPE) { + return MethodHandleCharacterFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Integer.TYPE) { + return MethodHandleIntegerFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Long.TYPE) { + return MethodHandleLongFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Float.TYPE) { + return MethodHandleFloatFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else if (type == Double.TYPE) { + return MethodHandleDoubleFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } else { + return MethodHandleObjectFieldAccessorImpl.fieldAccessor(field, getter, setter, isReadOnly); + } + } catch (IllegalAccessException e) { + throw new InternalError(e); + } + } + + private static MethodHandle getDirectMethod(Method method, boolean callerSensitive) throws IllegalAccessException { + var mtype = methodType(method.getReturnType(), method.getParameterTypes()); + var isStatic = Modifier.isStatic(method.getModifiers()); + var dmh = isStatic ? JLIA.findStatic(method.getDeclaringClass(), method.getName(), mtype) + : JLIA.findVirtual(method.getDeclaringClass(), method.getName(), mtype); + if (callerSensitive) { + // the reflectiveInvoker for caller-sensitive method expects the same signature + // as Method::invoke i.e. (Object, Object[])Object + return makeTarget(dmh, isStatic, false); + } + return makeSpecializedTarget(dmh, isStatic, false); + } + + /** + * Finds the method handle of a caller-sensitive adapter for the given + * caller-sensitive method. It has the same name as the given method + * with a trailing caller class parameter. + * + * @see CallerSensitiveAdapter + */ + private static MethodHandle findCallerSensitiveAdapter(Method method) throws IllegalAccessException { + String name = method.getName(); + // append a Class parameter + MethodType mtype = methodType(method.getReturnType(), method.getParameterTypes()) + .appendParameterTypes(Class.class); + boolean isStatic = Modifier.isStatic(method.getModifiers()); + + MethodHandle dmh = isStatic ? JLIA.findStatic(method.getDeclaringClass(), name, mtype) + : JLIA.findVirtual(method.getDeclaringClass(), name, mtype); + return dmh != null ? makeSpecializedTarget(dmh, isStatic, true) : null; + } + + /** + * Transform the given dmh to a specialized target method handle. + * + * If {@code hasCallerParameter} parameter is true, transform the method handle + * of this method type: {@code (Object, Object[], Class)Object} for the default + * case. + * + * If {@code hasCallerParameter} parameter is false, transform the method handle + * of this method type: {@code (Object, Object[])Object} for the default case. + * + * If the number of formal arguments is small, use a method type specialized + * the number of formal arguments is 0, 1, and 2, for example, the method type + * of a static method with one argument can be: {@code (Object)Object} + * + * If it's a static method, there is no leading Object parameter. + * + * @apiNote + * This implementation avoids using MethodHandles::catchException to help + * cold startup performance since this combination is very costly to setup. + * + * @param dmh DirectMethodHandle + * @param isStatic whether given dmh represents static method or not + * @param hasCallerParameter whether given dmh represents a method with an + * additional caller Class parameter + * @return transformed dmh to be used as a target in direct method accessors + */ + static MethodHandle makeSpecializedTarget(MethodHandle dmh, boolean isStatic, boolean hasCallerParameter) { + MethodHandle target = dmh.asFixedArity(); + + // number of formal arguments to the original method (not the adapter) + // If it is a non-static method, it has a leading `this` argument. + // Also do not count the caller class argument + int paramCount = dmh.type().parameterCount() - (isStatic ? 0 : 1) - (hasCallerParameter ? 1 : 0); + MethodType mtype = specializedMethodType(isStatic, hasCallerParameter, paramCount); + if (paramCount > SPECIALIZED_PARAM_COUNT) { + int spreadArgPos = isStatic ? 0 : 1; + target = target.asSpreader(spreadArgPos, Object[].class, paramCount); + } + if (isStatic) { + // add leading 'this' parameter to static method which is then ignored + target = MethodHandles.dropArguments(target, 0, Object.class); + } + return target.asType(mtype); + } + + // specialize for number of formal arguments <= 3 to avoid spreader + static final int SPECIALIZED_PARAM_COUNT = 3; + static MethodType specializedMethodType(boolean isStatic, boolean hasCallerParameter, int paramCount) { + return switch (paramCount) { + case 0 -> hasCallerParameter ? methodType(Object.class, Object.class, Class.class) + : genericMethodType(1); + case 1 -> hasCallerParameter ? methodType(Object.class, Object.class, Object.class, Class.class) + : genericMethodType(2); + case 2 -> hasCallerParameter ? methodType(Object.class, Object.class, Object.class, Object.class, Class.class) + : genericMethodType(3); + case 3 -> hasCallerParameter ? methodType(Object.class, Object.class, Object.class, Object.class, Object.class, Class.class) + : genericMethodType(4); + default -> hasCallerParameter ? methodType(Object.class, Object.class, Object[].class, Class.class) + : genericMethodType(1, true); + }; + } + + static MethodType specializedMethodTypeForConstructor(int paramCount) { + return switch (paramCount) { + case 0 -> genericMethodType(0); + case 1 -> genericMethodType(1); + case 2 -> genericMethodType(2); + case 3 -> genericMethodType(3); + default -> genericMethodType(0, true); + }; + } + + /** + * Transforms the given dmh into a target method handle with the method type + * {@code (Object, Object[])Object} or {@code (Object, Class, Object[])Object} + */ + static MethodHandle makeTarget(MethodHandle dmh, boolean isStatic, boolean hasCallerParameter) { + MethodType mtype = hasCallerParameter + ? methodType(Object.class, Object.class, Object[].class, Class.class) + : genericMethodType(1, true); + // number of formal arguments + int paramCount = dmh.type().parameterCount() - (isStatic ? 0 : 1) - (hasCallerParameter ? 1 : 0); + int spreadArgPos = isStatic ? 0 : 1; + MethodHandle target = dmh.asFixedArity().asSpreader(spreadArgPos, Object[].class, paramCount); + if (isStatic) { + // add leading 'this' parameter to static method which is then ignored + target = MethodHandles.dropArguments(target, 0, Object.class); + } + return target.asType(mtype); + } + + /** + * Ensures the given class is initialized. If this is called from , + * this method returns but defc's class initialization is not completed. + */ + static void ensureClassInitialized(Class defc) { + if (UNSAFE.shouldBeInitialized(defc)) { + UNSAFE.ensureClassInitialized(defc); + } + } + + /* + * Returns true if NativeAccessor should be used. + */ + private static boolean useNativeAccessor(Executable member) { + if (!VM.isJavaLangInvokeInited()) + return true; + + if (Modifier.isNative(member.getModifiers())) + return true; + + if (ReflectionFactory.useNativeAccessorOnly()) // for testing only + return true; + + // MethodHandle::withVarargs on a member with varargs modifier bit set + // verifies that the last parameter of the member must be an array type. + // The JVMS does not require the last parameter descriptor of the method descriptor + // is an array type if the ACC_VARARGS flag is set in the access_flags item. + // Hence the reflection implementation does not check the last parameter type + // if ACC_VARARGS flag is set. Workaround this by invoking through + // the native accessor. + int paramCount = member.getParameterCount(); + if (member.isVarArgs() && + (paramCount == 0 || !(member.getParameterTypes()[paramCount-1].isArray()))) { + return true; + } + // A method handle cannot be created if its type has an arity >= 255 + // as the method handle's invoke method consumes an extra argument + // of the method handle itself. Fall back to use the native implementation. + if (slotCount(member) >= MAX_JVM_ARITY) { + return true; + } + return false; + } + + private static final int MAX_JVM_ARITY = 255; // this is mandated by the JVM spec. + /* + * Return number of slots of the given member. + * - long/double args counts for two argument slots + * - A non-static method consumes an extra argument for the object on which + * the method is called. + * - A constructor consumes an extra argument for the object which is being constructed. + */ + private static int slotCount(Executable member) { + int slots = 0; + Class[] ptypes = member.getParameterTypes(); + for (Class ptype : ptypes) { + if (ptype == double.class || ptype == long.class) { + slots++; + } + } + return ptypes.length + slots + + (Modifier.isStatic(member.getModifiers()) ? 0 : 1); + } + + /* + * Delay initializing these static fields until java.lang.invoke is fully initialized. + */ + static class LazyStaticHolder { + static final JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess(); + } + + private static final Unsafe UNSAFE = Unsafe.getUnsafe(); +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java new file mode 100644 index 00000000000..10ec2f0e909 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleBooleanFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(boolean.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, boolean.class)); + } + } else { + getter = getter.asType(MethodType.methodType(boolean.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, boolean.class)); + } + } + return new MethodHandleBooleanFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleBooleanFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Boolean.valueOf(getBoolean(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + ensureObj(obj); + try { + if (isStatic()) { + return (boolean) getter.invokeExact(); + } else { + return (boolean) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + throw newGetIntIllegalArgumentException(); + } + + public long getLong(Object obj) throws IllegalArgumentException { + throw newGetLongIllegalArgumentException(); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + throw newGetFloatIllegalArgumentException(); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + throw newGetDoubleIllegalArgumentException(); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + ensureObj(obj); + if (isReadOnly()) { + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Boolean b) { + setBoolean(obj, b.booleanValue()); + } else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + ensureObj(obj); + if (isReadOnly()) { + throwFinalFieldIllegalAccessException(z); + } + try { + if (isStatic()) { + setter.invokeExact(z); + } else { + setter.invokeExact(obj, z); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java new file mode 100644 index 00000000000..7e88e080854 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleByteFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(byte.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, byte.class)); + } + } else { + getter = getter.asType(MethodType.methodType(byte.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, byte.class)); + } + } + return new MethodHandleByteFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleByteFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Byte.valueOf(getByte(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (byte) getter.invokeExact(); + } else { + return (byte) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + return getByte(obj); + } + + public int getInt(Object obj) throws IllegalArgumentException { + return getByte(obj); + } + + public long getLong(Object obj) throws IllegalArgumentException { + return getByte(obj); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + return getByte(obj); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + return getByte(obj); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + ensureObj(obj); + if (isReadOnly()) { + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Byte b) { + setByte(obj, b.byteValue()); + } else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + ensureObj(obj); + if (isReadOnly()) { + throwFinalFieldIllegalAccessException(b); + } + try { + if (isStatic()) { + setter.invokeExact(b); + } else { + setter.invokeExact(obj, b); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java new file mode 100644 index 00000000000..1e8b4e25525 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleCharacterFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(char.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, char.class)); + } + } else { + getter = getter.asType(MethodType.methodType(char.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, char.class)); + } + } + return new MethodHandleCharacterFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleCharacterFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Character.valueOf(getChar(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (char) getter.invokeExact(); + } else { + return (char) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + return getChar(obj); + } + + public long getLong(Object obj) throws IllegalArgumentException { + return getChar(obj); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + return getChar(obj); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + return getChar(obj); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Character c) { + setChar(obj, c.charValue()); + } else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(c); + } + try { + if (isStatic()) { + setter.invokeExact(c); + } else { + setter.invokeExact(obj, c); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java new file mode 100644 index 00000000000..2d370c331be --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleDoubleFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(double.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, double.class)); + } + } else { + getter = getter.asType(MethodType.methodType(double.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, double.class)); + } + } + return new MethodHandleDoubleFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleDoubleFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Double.valueOf(getDouble(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + throw newGetIntIllegalArgumentException(); + } + + public long getLong(Object obj) throws IllegalArgumentException { + throw newGetLongIllegalArgumentException(); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + throw newGetFloatIllegalArgumentException(); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (double) getter.invokeExact(); + } else { + return (double) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Byte b) { + setDouble(obj, b.byteValue()); + } + else if (value instanceof Short s) { + setDouble(obj, s.shortValue()); + } + else if (value instanceof Character c) { + setDouble(obj, c.charValue()); + } + else if (value instanceof Integer i) { + setDouble(obj, i.intValue()); + } + else if (value instanceof Long l) { + setDouble(obj, l.longValue()); + } + else if (value instanceof Float f) { + setDouble(obj, f.floatValue()); + } + else if (value instanceof Double d) { + setDouble(obj, d.doubleValue()); + } + else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + setDouble(obj, b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + setDouble(obj, c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + setDouble(obj, s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + setDouble(obj, i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + setDouble(obj, l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + setDouble(obj, f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(d); + } + try { + if (isStatic()) { + setter.invokeExact(d); + } else { + setter.invokeExact(obj, d); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java new file mode 100644 index 00000000000..ab59b61d1a2 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.reflect.Field; + +abstract class MethodHandleFieldAccessorImpl extends FieldAccessorImpl { + private static final int IS_READ_ONLY_BIT = 0x0001; + private static final int IS_STATIC_BIT = 0x0002; + private static final int NONZERO_BIT = 0x8000; + + private final int fieldFlags; + protected final MethodHandle getter; + protected final MethodHandle setter; + + protected MethodHandleFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field); + this.fieldFlags = (isReadOnly ? IS_READ_ONLY_BIT : 0) | + (isStatic ? IS_STATIC_BIT : 0) | + NONZERO_BIT; + this.getter = getter; + this.setter = setter; + } + + protected final boolean isReadOnly() { + return (fieldFlags & IS_READ_ONLY_BIT) == IS_READ_ONLY_BIT; + } + + protected final boolean isStatic() { + return (fieldFlags & IS_STATIC_BIT) == IS_STATIC_BIT; + } + + protected final void ensureObj(Object o) { + if (!isStatic()) { + // for compatibility, check the receiver object first + // throw NullPointerException if o is null + if (!field.getDeclaringClass().isAssignableFrom(o.getClass())) { + throwSetIllegalArgumentException(o); + } + } + } + + /** + * IllegalArgumentException because Field::get on the specified object, which + * is not an instance of the class or interface declaring the underlying method + */ + protected IllegalArgumentException newGetIllegalArgumentException(Class type) { + return new IllegalArgumentException(getMessage(true, type.getName())); + } + + /** + * IllegalArgumentException because Field::set on the specified object, which + * is not an instance of the class or interface declaring the underlying method + */ + protected IllegalArgumentException newSetIllegalArgumentException(Class type) { + return new IllegalArgumentException(getMessage(false, type.getName())); + } + + +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java new file mode 100644 index 00000000000..ee1850f33a8 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleFloatFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(float.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, float.class)); + } + } else { + getter = getter.asType(MethodType.methodType(float.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, float.class)); + } + } + return new MethodHandleFloatFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleFloatFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Float.valueOf(getFloat(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + throw newGetIntIllegalArgumentException(); + } + + public long getLong(Object obj) throws IllegalArgumentException { + throw newGetLongIllegalArgumentException(); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (float) getter.invokeExact(); + } else { + return (float) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public double getDouble(Object obj) throws IllegalArgumentException { + return getFloat(obj); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Byte b) { + setFloat(obj, b.byteValue()); + } + else if (value instanceof Short s) { + setFloat(obj, s.shortValue()); + } + else if (value instanceof Character c) { + setFloat(obj, c.charValue()); + } + else if (value instanceof Integer i) { + setFloat(obj, i.intValue()); + } + else if (value instanceof Long l) { + setFloat(obj, l.longValue()); + } + else if (value instanceof Float f) { + setFloat(obj, f.floatValue()); + } + else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + setFloat(obj, b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + setFloat(obj, c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + setFloat(obj, s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + setFloat(obj, i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + setFloat(obj, l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(f); + } + try { + if (isStatic()) { + setter.invokeExact(f); + } else { + setter.invokeExact(obj, f); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java new file mode 100644 index 00000000000..19a17cc1ca3 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleIntegerFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(int.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, int.class)); + } + } else { + getter = getter.asType(MethodType.methodType(int.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, int.class)); + } + } + return new MethodHandleIntegerFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleIntegerFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Integer.valueOf(getInt(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (int) getter.invokeExact(); + } else { + return (int) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public long getLong(Object obj) throws IllegalArgumentException { + return getInt(obj); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + return getInt(obj); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + return getInt(obj); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Byte b) { + setInt(obj, b.byteValue()); + } + else if (value instanceof Short s) { + setInt(obj, s.shortValue()); + } + else if (value instanceof Character c) { + setInt(obj, c.charValue()); + } + else if (value instanceof Integer i) { + setInt(obj, i.intValue()); + } + else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + setInt(obj, b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + setInt(obj, c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + setInt(obj, s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(i); + } + try { + if (isStatic()) { + setter.invokeExact(i); + } else { + setter.invokeExact(obj, i); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java new file mode 100644 index 00000000000..42ef4c75c05 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleLongFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(long.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, long.class)); + } + } else { + getter = getter.asType(MethodType.methodType(long.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, long.class)); + } + } + return new MethodHandleLongFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleLongFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Long.valueOf(getLong(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + throw newGetIntIllegalArgumentException(); + } + + public long getLong(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (long) getter.invokeExact(); + } else { + return (long) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public float getFloat(Object obj) throws IllegalArgumentException { + return getLong(obj); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + return getLong(obj); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Byte b) { + setLong(obj, b.byteValue()); + } + else if (value instanceof Short s) { + setLong(obj, s.shortValue()); + } + else if (value instanceof Character c) { + setLong(obj, c.charValue()); + } + else if (value instanceof Integer i) { + setLong(obj, i.intValue()); + } + else if (value instanceof Long l) { + setLong(obj, l.longValue()); + } + else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + setLong(obj, b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + setLong(obj, c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + setLong(obj, s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + setLong(obj, i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(l); + } + try { + if (isStatic()) { + setter.invokeExact(l); + } else { + setter.invokeExact(obj, l); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java new file mode 100644 index 00000000000..57da6081c84 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleObjectFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class)); + } + } else { + getter = getter.asType(MethodType.methodType(Object.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, Object.class)); + } + } + return new MethodHandleObjectFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleObjectFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + @Override + public Object get(Object obj) throws IllegalArgumentException { + try { + return isStatic() ? getter.invokeExact() : getter.invokeExact(obj); + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + throw newGetShortIllegalArgumentException(); + } + + public int getInt(Object obj) throws IllegalArgumentException { + throw newGetIntIllegalArgumentException(); + } + + public long getLong(Object obj) throws IllegalArgumentException { + throw newGetLongIllegalArgumentException(); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + throw newGetFloatIllegalArgumentException(); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + throw newGetDoubleIllegalArgumentException(); + } + + @Override + public void set(Object obj, Object value) throws IllegalAccessException { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + try { + if (isStatic()) { + setter.invokeExact(value); + } else { + setter.invokeExact(obj, value); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(s); + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java new file mode 100644 index 00000000000..d9ac93d7276 --- /dev/null +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.reflect; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +class MethodHandleShortFieldAccessorImpl extends MethodHandleFieldAccessorImpl { + static FieldAccessorImpl fieldAccessor(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly) { + boolean isStatic = Modifier.isStatic(field.getModifiers()); + if (isStatic) { + getter = getter.asType(MethodType.methodType(short.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, short.class)); + } + } else { + getter = getter.asType(MethodType.methodType(short.class, Object.class)); + if (setter != null) { + setter = setter.asType(MethodType.methodType(void.class, Object.class, short.class)); + } + } + return new MethodHandleShortFieldAccessorImpl(field, getter, setter, isReadOnly, isStatic); + } + + MethodHandleShortFieldAccessorImpl(Field field, MethodHandle getter, MethodHandle setter, boolean isReadOnly, boolean isStatic) { + super(field, getter, setter, isReadOnly, isStatic); + } + + public Object get(Object obj) throws IllegalArgumentException { + return Short.valueOf(getShort(obj)); + } + + public boolean getBoolean(Object obj) throws IllegalArgumentException { + throw newGetBooleanIllegalArgumentException(); + } + + public byte getByte(Object obj) throws IllegalArgumentException { + throw newGetByteIllegalArgumentException(); + } + + public char getChar(Object obj) throws IllegalArgumentException { + throw newGetCharIllegalArgumentException(); + } + + public short getShort(Object obj) throws IllegalArgumentException { + try { + if (isStatic()) { + return (short) getter.invokeExact(); + } else { + return (short) getter.invokeExact(obj); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newGetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public int getInt(Object obj) throws IllegalArgumentException { + return getShort(obj); + } + + public long getLong(Object obj) throws IllegalArgumentException { + return getShort(obj); + } + + public float getFloat(Object obj) throws IllegalArgumentException { + return getShort(obj); + } + + public double getDouble(Object obj) throws IllegalArgumentException { + return getShort(obj); + } + + public void set(Object obj, Object value) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(value); + } + + if (value == null) { + throwSetIllegalArgumentException(value); + } + + if (value instanceof Byte b) { + setShort(obj, b.byteValue()); + } + else if (value instanceof Short s) { + setShort(obj, s.shortValue()); + } + else { + throwSetIllegalArgumentException(value); + } + } + + public void setBoolean(Object obj, boolean z) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(z); + } + + public void setByte(Object obj, byte b) + throws IllegalArgumentException, IllegalAccessException + { + setShort(obj, b); + } + + public void setChar(Object obj, char c) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(c); + } + + public void setShort(Object obj, short s) + throws IllegalArgumentException, IllegalAccessException + { + if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field + throwFinalFieldIllegalAccessException(s); + } + try { + if (isStatic()) { + setter.invokeExact(s); + } else { + setter.invokeExact(obj, s); + } + } catch (IllegalArgumentException|NullPointerException e) { + throw e; + } catch (ClassCastException e) { + throw newSetIllegalArgumentException(obj.getClass()); + } catch (Throwable e) { + throw new InternalError(e); + } + } + + public void setInt(Object obj, int i) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(i); + } + + public void setLong(Object obj, long l) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(l); + } + + public void setFloat(Object obj, float f) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(f); + } + + public void setDouble(Object obj, double d) + throws IllegalArgumentException, IllegalAccessException + { + throwSetIllegalArgumentException(d); + } +} diff --git a/src/java.base/share/classes/jdk/internal/reflect/NativeConstructorAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/NativeConstructorAccessorImpl.java index 6cd7d7d0f01..c2a80c92296 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/NativeConstructorAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/NativeConstructorAccessorImpl.java @@ -51,7 +51,7 @@ class NativeConstructorAccessorImpl extends ConstructorAccessorImpl { IllegalArgumentException, InvocationTargetException { - // We can't inflate a constructor belonging to a vm-anonymous class + // We can't inflate a constructor belonging to a hidden class // because that kind of class can't be referred to by name, hence can't // be found from the generated bytecode. if (++numInvocations > ReflectionFactory.inflationThreshold() diff --git a/src/java.base/share/classes/jdk/internal/reflect/NativeMethodAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/NativeMethodAccessorImpl.java index 7f57035a0dd..756927be3ce 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/NativeMethodAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/NativeMethodAccessorImpl.java @@ -49,7 +49,7 @@ class NativeMethodAccessorImpl extends MethodAccessorImpl { public Object invoke(Object obj, Object[] args) throws IllegalArgumentException, InvocationTargetException { - // We can't inflate methods belonging to vm-anonymous classes because + // We can't inflate methods belonging to hidden classes because // that kind of class can't be referred to by name, hence can't be // found from the generated bytecode. if (++numInvocations > ReflectionFactory.inflationThreshold() diff --git a/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java b/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java index 5f1106db472..ee264330d2b 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java +++ b/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java @@ -85,6 +85,15 @@ public class ReflectionFactory { private static boolean noInflation = false; private static int inflationThreshold = 15; + // + // New implementation uses direct invocation of method handles + private static final int METHOD_MH_ACCESSOR = 0x1; + private static final int FIELD_MH_ACCESSOR = 0x2; + private static final int ALL_MH_ACCESSORS = METHOD_MH_ACCESSOR|FIELD_MH_ACCESSOR; + + private static int useDirectMethodHandle = ALL_MH_ACCESSORS; + private static boolean useNativeAccessorOnly = false; // for testing only + // true if deserialization constructor checking is disabled private static boolean disableSerialConstructorChecks = false; @@ -137,24 +146,6 @@ public class ReflectionFactory { return soleInstance; } - /** - * Returns an alternate reflective Method instance for the given method - * intended for reflection to invoke, if present. - * - * A trusted method can define an alternate implementation for a method `foo` - * by defining a method named "reflected$foo" that will be invoked - * reflectively. - */ - private static Method findMethodForReflection(Method method) { - String altName = "reflected$" + method.getName(); - try { - return method.getDeclaringClass() - .getDeclaredMethod(altName, method.getParameterTypes()); - } catch (NoSuchMethodException ex) { - return null; - } - } - //-------------------------------------------------------------------------- // // Routines used by java.lang.reflect @@ -181,39 +172,48 @@ public class ReflectionFactory { } boolean isFinal = Modifier.isFinal(field.getModifiers()); boolean isReadOnly = isFinal && (!override || langReflectAccess.isTrustedFinalField(field)); - return UnsafeFieldAccessorFactory.newFieldAccessor(field, isReadOnly); + if (useFieldHandleAccessor()) { + return MethodHandleAccessorFactory.newFieldAccessor(field, isReadOnly); + } else { + return UnsafeFieldAccessorFactory.newFieldAccessor(field, isReadOnly); + } } - public MethodAccessor newMethodAccessor(Method method) { + public MethodAccessor newMethodAccessor(Method method, boolean callerSensitive) { checkInitted(); - if (Reflection.isCallerSensitive(method)) { - Method altMethod = findMethodForReflection(method); - if (altMethod != null) { - method = altMethod; - } - } - // use the root Method that will not cache caller class Method root = langReflectAccess.getRoot(method); if (root != null) { method = root; } - if (noInflation && !method.getDeclaringClass().isHidden()) { - return new MethodAccessorGenerator(). - generateMethod(method.getDeclaringClass(), - method.getName(), - method.getParameterTypes(), - method.getReturnType(), - method.getExceptionTypes(), - method.getModifiers()); + if (useMethodHandleAccessor()) { + return MethodHandleAccessorFactory.newMethodAccessor(method, callerSensitive); } else { - NativeMethodAccessorImpl acc = new NativeMethodAccessorImpl(method); - return acc.getParent(); + if (noInflation && !method.getDeclaringClass().isHidden()) { + return generateMethodAccessor(method); + } else { + NativeMethodAccessorImpl acc = new NativeMethodAccessorImpl(method); + return acc.getParent(); + } } } + /** + * Generate the MethodAccessor that invokes the given method with + * bytecode invocation. + */ + static MethodAccessorImpl generateMethodAccessor(Method method) { + return (MethodAccessorImpl)new MethodAccessorGenerator() + .generateMethod(method.getDeclaringClass(), + method.getName(), + method.getParameterTypes(), + method.getReturnType(), + method.getExceptionTypes(), + method.getModifiers()); + } + public ConstructorAccessor newConstructorAccessor(Constructor c) { checkInitted(); @@ -232,23 +232,26 @@ public class ReflectionFactory { c = root; } - // Bootstrapping issue: since we use Class.newInstance() in - // the ConstructorAccessor generation process, we have to - // break the cycle here. - if (Reflection.isSubclassOf(declaringClass, - ConstructorAccessorImpl.class)) { - return new BootstrapConstructorAccessorImpl(c); - } - - if (noInflation && !c.getDeclaringClass().isHidden()) { - return new MethodAccessorGenerator(). - generateConstructor(c.getDeclaringClass(), - c.getParameterTypes(), - c.getExceptionTypes(), - c.getModifiers()); + if (useMethodHandleAccessor()) { + return MethodHandleAccessorFactory.newConstructorAccessor(c); } else { - NativeConstructorAccessorImpl acc = new NativeConstructorAccessorImpl(c); - return acc.getParent(); + // Bootstrapping issue: since we use Class.newInstance() in + // the ConstructorAccessor generation process, we have to + // break the cycle here. + if (Reflection.isSubclassOf(declaringClass, ConstructorAccessorImpl.class)) { + return new BootstrapConstructorAccessorImpl(c); + } + + if (noInflation && !c.getDeclaringClass().isHidden()) { + return new MethodAccessorGenerator(). + generateConstructor(c.getDeclaringClass(), + c.getParameterTypes(), + c.getExceptionTypes(), + c.getModifiers()); + } else { + NativeConstructorAccessorImpl acc = new NativeConstructorAccessorImpl(c); + return acc.getParent(); + } } } @@ -624,6 +627,22 @@ public class ReflectionFactory { return inflationThreshold; } + static boolean noInflation() { + return noInflation; + } + + static boolean useMethodHandleAccessor() { + return (useDirectMethodHandle & METHOD_MH_ACCESSOR) == METHOD_MH_ACCESSOR; + } + + static boolean useFieldHandleAccessor() { + return (useDirectMethodHandle & FIELD_MH_ACCESSOR) == FIELD_MH_ACCESSOR; + } + + static boolean useNativeAccessorOnly() { + return useNativeAccessorOnly; + } + /** We have to defer full initialization of this class until after the static initializer is run since java.lang.reflect.Method's static initializer (more properly, that for @@ -653,6 +672,20 @@ public class ReflectionFactory { throw new RuntimeException("Unable to parse property sun.reflect.inflationThreshold", e); } } + val = props.getProperty("jdk.reflect.useDirectMethodHandle"); + if (val != null) { + if (val.equals("false")) { + useDirectMethodHandle = 0; + } else if (val.equals("methods")) { + useDirectMethodHandle = METHOD_MH_ACCESSOR; + } else if (val.equals("fields")) { + useDirectMethodHandle = FIELD_MH_ACCESSOR; + } + } + val = props.getProperty("jdk.reflect.useNativeAccessorOnly"); + if (val != null && val.equals("true")) { + useNativeAccessorOnly = true; + } disableSerialConstructorChecks = "true".equals(props.getProperty("jdk.disableSerialConstructorChecks")); diff --git a/src/java.base/share/classes/jdk/internal/reflect/UnsafeFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/UnsafeFieldAccessorImpl.java index 9f43263bf3e..683ecf2b5f0 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/UnsafeFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/UnsafeFieldAccessorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -28,7 +28,6 @@ package jdk.internal.reflect; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import jdk.internal.misc.Unsafe; -import jdk.internal.vm.annotation.Stable; /** Base class for jdk.internal.misc.Unsafe-based FieldAccessors. The observation is that there are only nine types of fields from the @@ -40,168 +39,16 @@ import jdk.internal.vm.annotation.Stable; abstract class UnsafeFieldAccessorImpl extends FieldAccessorImpl { static final Unsafe unsafe = Unsafe.getUnsafe(); - @Stable protected final long fieldOffset; protected final boolean isFinal; UnsafeFieldAccessorImpl(Field field) { super(field); - if (Modifier.isStatic(field.getModifiers())) + int mods = field.getModifiers(); + this.isFinal = Modifier.isFinal(mods); + if (Modifier.isStatic(mods)) fieldOffset = unsafe.staticFieldOffset(field); else fieldOffset = unsafe.objectFieldOffset(field); - isFinal = Modifier.isFinal(field.getModifiers()); } - - protected void ensureObj(Object o) { - // NOTE: will throw NullPointerException, as specified, if o is null - if (!field.getDeclaringClass().isAssignableFrom(o.getClass())) { - throwSetIllegalArgumentException(o); - } - } - - private String getQualifiedFieldName() { - return field.getDeclaringClass().getName() + "." +field.getName(); - } - - protected IllegalArgumentException newGetIllegalArgumentException(String type) { - return new IllegalArgumentException( - "Attempt to get "+field.getType().getName()+" field \"" + - getQualifiedFieldName() + "\" with illegal data type conversion to "+type - ); - } - - protected void throwFinalFieldIllegalAccessException(String attemptedType, - String attemptedValue) - throws IllegalAccessException { - throw new IllegalAccessException(getSetMessage(attemptedType, attemptedValue)); - - } - protected void throwFinalFieldIllegalAccessException(Object o) throws IllegalAccessException { - throwFinalFieldIllegalAccessException(o != null ? o.getClass().getName() : "", ""); - } - - protected void throwFinalFieldIllegalAccessException(boolean z) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("boolean", Boolean.toString(z)); - } - - protected void throwFinalFieldIllegalAccessException(char b) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("char", Character.toString(b)); - } - - protected void throwFinalFieldIllegalAccessException(byte b) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("byte", Byte.toString(b)); - } - - protected void throwFinalFieldIllegalAccessException(short b) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("short", Short.toString(b)); - } - - protected void throwFinalFieldIllegalAccessException(int i) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("int", Integer.toString(i)); - } - - protected void throwFinalFieldIllegalAccessException(long i) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("long", Long.toString(i)); - } - - protected void throwFinalFieldIllegalAccessException(float f) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("float", Float.toString(f)); - } - - protected void throwFinalFieldIllegalAccessException(double f) throws IllegalAccessException { - throwFinalFieldIllegalAccessException("double", Double.toString(f)); - } - - protected IllegalArgumentException newGetBooleanIllegalArgumentException() { - return newGetIllegalArgumentException("boolean"); - } - - protected IllegalArgumentException newGetByteIllegalArgumentException() { - return newGetIllegalArgumentException("byte"); - } - - protected IllegalArgumentException newGetCharIllegalArgumentException() { - return newGetIllegalArgumentException("char"); - } - - protected IllegalArgumentException newGetShortIllegalArgumentException() { - return newGetIllegalArgumentException("short"); - } - - protected IllegalArgumentException newGetIntIllegalArgumentException() { - return newGetIllegalArgumentException("int"); - } - - protected IllegalArgumentException newGetLongIllegalArgumentException() { - return newGetIllegalArgumentException("long"); - } - - protected IllegalArgumentException newGetFloatIllegalArgumentException() { - return newGetIllegalArgumentException("float"); - } - - protected IllegalArgumentException newGetDoubleIllegalArgumentException() { - return newGetIllegalArgumentException("double"); - } - - protected String getSetMessage(String attemptedType, String attemptedValue) { - String err = "Can not set"; - if (Modifier.isStatic(field.getModifiers())) - err += " static"; - if (isFinal) - err += " final"; - err += " " + field.getType().getName() + " field " + getQualifiedFieldName() + " to "; - if (!attemptedValue.isEmpty()) { - err += "(" + attemptedType + ")" + attemptedValue; - } else { - if (!attemptedType.isEmpty()) - err += attemptedType; - else - err += "null value"; - } - return err; - } - - protected void throwSetIllegalArgumentException(String attemptedType, - String attemptedValue) { - throw new IllegalArgumentException(getSetMessage(attemptedType,attemptedValue)); - } - - protected void throwSetIllegalArgumentException(Object o) { - throwSetIllegalArgumentException(o != null ? o.getClass().getName() : "", ""); - } - - protected void throwSetIllegalArgumentException(boolean b) { - throwSetIllegalArgumentException("boolean", Boolean.toString(b)); - } - - protected void throwSetIllegalArgumentException(byte b) { - throwSetIllegalArgumentException("byte", Byte.toString(b)); - } - - protected void throwSetIllegalArgumentException(char c) { - throwSetIllegalArgumentException("char", Character.toString(c)); - } - - protected void throwSetIllegalArgumentException(short s) { - throwSetIllegalArgumentException("short", Short.toString(s)); - } - - protected void throwSetIllegalArgumentException(int i) { - throwSetIllegalArgumentException("int", Integer.toString(i)); - } - - protected void throwSetIllegalArgumentException(long l) { - throwSetIllegalArgumentException("long", Long.toString(l)); - } - - protected void throwSetIllegalArgumentException(float f) { - throwSetIllegalArgumentException("float", Float.toString(f)); - } - - protected void throwSetIllegalArgumentException(double d) { - throwSetIllegalArgumentException("double", Double.toString(d)); - } - } diff --git a/src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticFieldAccessorImpl.java index e75fffb1328..a52eae4edae 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticFieldAccessorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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,13 +26,8 @@ package jdk.internal.reflect; import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.security.AccessController; import java.util.Set; -import jdk.internal.misc.Unsafe; -import jdk.internal.vm.annotation.Stable; - /** Base class for jdk.internal.misc.Unsafe-based FieldAccessors for static fields. The observation is that there are only nine types of fields from the standpoint of reflection code: the eight primitive @@ -46,7 +41,6 @@ abstract class UnsafeStaticFieldAccessorImpl extends UnsafeFieldAccessorImpl { Set.of("base")); } - @Stable protected final Object base; // base UnsafeStaticFieldAccessorImpl(Field field) { diff --git a/src/java.base/share/native/libjava/NativeAccessors.c b/src/java.base/share/native/libjava/NativeAccessors.c index 53714124502..a0266f147b2 100644 --- a/src/java.base/share/native/libjava/NativeAccessors.c +++ b/src/java.base/share/native/libjava/NativeAccessors.c @@ -26,6 +26,8 @@ #include "jvm.h" #include "jdk_internal_reflect_NativeConstructorAccessorImpl.h" #include "jdk_internal_reflect_NativeMethodAccessorImpl.h" +#include "jdk_internal_reflect_DirectMethodHandleAccessor_NativeAccessor.h" +#include "jdk_internal_reflect_DirectConstructorHandleAccessor_NativeAccessor.h" JNIEXPORT jobject JNICALL Java_jdk_internal_reflect_NativeMethodAccessorImpl_invoke0 (JNIEnv *env, jclass unused, jobject m, jobject obj, jobjectArray args) @@ -38,3 +40,14 @@ JNIEXPORT jobject JNICALL Java_jdk_internal_reflect_NativeConstructorAccessorImp { return JVM_NewInstanceFromConstructor(env, c, args); } + +JNIEXPORT jobject JNICALL Java_jdk_internal_reflect_DirectMethodHandleAccessor_00024NativeAccessor_invoke0 +(JNIEnv *env, jclass unused, jobject m, jobject obj, jobjectArray args) +{ + return JVM_InvokeMethod(env, m, obj, args); +} +JNIEXPORT jobject JNICALL Java_jdk_internal_reflect_DirectConstructorHandleAccessor_00024NativeAccessor_newInstance0 +(JNIEnv *env, jclass unused, jobject c, jobjectArray args) +{ + return JVM_NewInstanceFromConstructor(env, c, args); +} diff --git a/src/java.logging/share/classes/java/util/logging/Logger.java b/src/java.logging/share/classes/java/util/logging/Logger.java index 51ebfb58aea..0dc602c2c24 100644 --- a/src/java.logging/share/classes/java/util/logging/Logger.java +++ b/src/java.logging/share/classes/java/util/logging/Logger.java @@ -40,6 +40,7 @@ import java.util.function.Supplier; import jdk.internal.access.JavaUtilResourceBundleAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; import jdk.internal.reflect.Reflection; import static jdk.internal.logger.DefaultLoggerFinder.isSystem; @@ -714,6 +715,7 @@ public class Logger { * #getLogger(java.lang.String)}. * @return a suitable Logger for {@code callerClass}. */ + @CallerSensitiveAdapter private static Logger getLogger(String name, Class callerClass) { return demandLogger(name, null, callerClass); } @@ -788,6 +790,7 @@ public class Logger { * not {@code null}. * @return a suitable Logger for {@code callerClass}. */ + @CallerSensitiveAdapter private static Logger getLogger(String name, String resourceBundleName, Class callerClass) { Logger result = demandLogger(name, resourceBundleName, callerClass); diff --git a/src/java.sql/share/classes/java/sql/DriverManager.java b/src/java.sql/share/classes/java/sql/DriverManager.java index 9116e78efaf..f7733cfb62e 100644 --- a/src/java.sql/share/classes/java/sql/DriverManager.java +++ b/src/java.sql/share/classes/java/sql/DriverManager.java @@ -37,6 +37,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Stream; import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; import jdk.internal.reflect.Reflection; @@ -647,6 +648,7 @@ public class DriverManager { // Worker method called by the public getConnection() methods. + @CallerSensitiveAdapter private static Connection getConnection( String url, java.util.Properties info, Class caller) throws SQLException { /* diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 2d7230da25f..b4bb635d7c9 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -38,6 +38,12 @@ # ############################################################################# +vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java 8265795 generic-all +vmTestbase/nsk/jvmti/AttachOnDemand/attach022/TestDescription.java 8265795 generic-all +vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java 8265796 generic-all + +############################################################################# + # :hotspot_compiler compiler/ciReplay/TestSAServer.java 8029528 generic-all diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java index 53848e90009..a6e3fce1d24 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java @@ -37,7 +37,7 @@ import jdk.test.lib.process.OutputAnalyzer; * @summary Test that various diagnostic commands which can show core reflection * invocation targets do so correctly (See: JDK-8203343). * @library /test/lib - * @run testng/othervm -Dsun.reflect.noInflation=true ShowReflectionTargetTest + * @run testng/othervm -Dsun.reflect.noInflation=true -Djdk.reflect.useDirectMethodHandle=false ShowReflectionTargetTest * @author stuefe */ diff --git a/test/jdk/com/sun/jdi/EATests.java b/test/jdk/com/sun/jdi/EATests.java index 9b53d16925d..74ee07657d4 100644 --- a/test/jdk/com/sun/jdi/EATests.java +++ b/test/jdk/com/sun/jdi/EATests.java @@ -2198,7 +2198,9 @@ class EADeoptFrameAfterReadLocalObject_02CTarget extends EATestCaseBaseTarget { @Override public void setUp() { super.setUp(); - testMethodDepth = 8; + // the method depth in debuggee is 11 as it includes all hidden frames + // the expected method depth is 6 excluding 5 hidden frames + testMethodDepth = 11-5; } @Override diff --git a/test/jdk/java/lang/StackWalker/DumpStackTest.java b/test/jdk/java/lang/StackWalker/DumpStackTest.java index c0ff99f9f68..c196b1c4ad3 100644 --- a/test/jdk/java/lang/StackWalker/DumpStackTest.java +++ b/test/jdk/java/lang/StackWalker/DumpStackTest.java @@ -82,9 +82,7 @@ public class DumpStackTest { new CallFrame(DumpStackTest.class, "test"), new CallFrame(DumpStackTest.class, "main"), // if invoked from jtreg - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke0"), // non-public class - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke"), - new CallFrame("jdk.internal.reflect.DelegatingMethodAccessorImpl", "invoke"), + new CallFrame("jdk.internal.reflect.DirectMethodHandleAccessor", "invoke"), // non-public class new CallFrame(Method.class, "invoke"), new CallFrame(Thread.class, "run"), }; @@ -138,9 +136,7 @@ public class DumpStackTest { new CallFrame(DumpStackTest.class, "testLambda"), new CallFrame(DumpStackTest.class, "main"), // if invoked from jtreg - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke0"), - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke"), - new CallFrame("jdk.internal.reflect.DelegatingMethodAccessorImpl", "invoke"), + new CallFrame("jdk.internal.reflect.DirectMethodHandleAccessor", "invoke"), new CallFrame(Method.class, "invoke"), new CallFrame(Thread.class, "run") }; @@ -161,16 +157,12 @@ public class DumpStackTest { CallFrame[] callStack = new CallFrame[] { new CallFrame(Thread.class, "getStackTrace"), new CallFrame(DumpStackTest.class, "methodInvoke"), - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke0"), - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke"), - new CallFrame("jdk.internal.reflect.DelegatingMethodAccessorImpl", "invoke"), + new CallFrame("jdk.internal.reflect.DirectMethodHandleAccessor", "invoke"), new CallFrame(Method.class, "invoke"), new CallFrame(DumpStackTest.class, "testMethodInvoke"), new CallFrame(DumpStackTest.class, "main"), // if invoked from jtreg - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke0"), - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke"), - new CallFrame("jdk.internal.reflect.DelegatingMethodAccessorImpl", "invoke"), + new CallFrame("jdk.internal.reflect.DirectMethodHandleAccessor", "invoke"), new CallFrame(Method.class, "invoke"), new CallFrame(Thread.class, "run") }; @@ -196,9 +188,7 @@ public class DumpStackTest { new CallFrame(DumpStackTest.class, "testMethodHandle"), new CallFrame(DumpStackTest.class, "main"), // if invoked from jtreg - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke0"), - new CallFrame("jdk.internal.reflect.NativeMethodAccessorImpl", "invoke"), - new CallFrame("jdk.internal.reflect.DelegatingMethodAccessorImpl", "invoke"), + new CallFrame("jdk.internal.reflect.DirectMethodHandleAccessor", "invoke"), new CallFrame(Method.class, "invoke"), new CallFrame(Thread.class, "run") }; diff --git a/test/jdk/java/lang/StackWalker/NativeMethod.java b/test/jdk/java/lang/StackWalker/NativeMethod.java index d6849649254..b1716a6b5ab 100644 --- a/test/jdk/java/lang/StackWalker/NativeMethod.java +++ b/test/jdk/java/lang/StackWalker/NativeMethod.java @@ -25,12 +25,11 @@ * @test * @bug 8157892 8157977 * @summary Verify file name, line number and bci of native methods - * @run main NativeMethod + * @run main/othervm/native -Xcheck:jni NativeMethod */ import java.lang.StackWalker.Option; import java.lang.StackWalker.StackFrame; -import java.lang.reflect.Method; import java.util.List; import java.util.stream.Collectors; @@ -44,29 +43,36 @@ public class NativeMethod { this.walker = StackWalker.getInstance(Option.SHOW_REFLECT_FRAMES); } - void test() throws Exception { - // invoke via reflection that includes native methods - Method m = NativeMethod.class.getDeclaredMethod("walk"); - m.invoke(this); - } + // this native method will invoke NativeMethod::walk method + public native void test(); - void walk() { + public void walk() { List nativeFrames = walker.walk(s -> s.filter(StackFrame::isNativeMethod) .collect(Collectors.toList()) ); assertTrue(nativeFrames.size() > 0, "native frame not found"); + // find NativeMethod::test native frame + nativeFrames.stream().filter(f -> f.isNativeMethod() + && f.getClassName().equals("NativeMethod") + && f.getMethodName().equals("test")) + .findFirst() + .orElseThrow(() -> new RuntimeException("NativeMethod::test native method not found")); + for (StackFrame f : nativeFrames) { assertTrue(f.getFileName() != null, "source file expected to be found"); assertTrue(f.getLineNumber() < 0, "line number expected to be unavailable"); assertTrue(f.getByteCodeIndex() < 0, "bci expected to be unavailable"); } - } private static void assertTrue(boolean value, String msg) { if (value != true) throw new AssertionError(msg); } + + static { + System.loadLibrary("nativeMethod"); + } } diff --git a/test/jdk/java/lang/StackWalker/VerifyStackTrace.java b/test/jdk/java/lang/StackWalker/VerifyStackTrace.java index 1cc6f349d8b..cf1c1ccb80a 100644 --- a/test/jdk/java/lang/StackWalker/VerifyStackTrace.java +++ b/test/jdk/java/lang/StackWalker/VerifyStackTrace.java @@ -100,15 +100,12 @@ public class VerifyStackTrace { "2: VerifyStackTrace$Handle.execute(VerifyStackTrace.java:147)\n" + "3: VerifyStackTrace$Handle.run(VerifyStackTrace.java:160)\n" + "4: VerifyStackTrace.invoke(VerifyStackTrace.java:190)\n" + - "5: java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + - "6: java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" + - "7: java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + - "8: java.base/java.lang.reflect.Method.invoke(Method.java:520)\n" + - "9: VerifyStackTrace$1.run(VerifyStackTrace.java:220)\n" + - "10: java.base/java.security.AccessController.doPrivileged(AccessController.java:310)\n" + - "11: VerifyStackTrace.test(VerifyStackTrace.java:229)\n" + - "12: VerifyStackTrace.main(VerifyStackTrace.java:185)\n"; - + "5: java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:94)\n" + + "6: java.base/java.lang.reflect.Method.invoke(Method.java:520)\n" + + "7: VerifyStackTrace$1.run(VerifyStackTrace.java:220)\n" + + "8: java.base/java.security.AccessController.doPrivileged(AccessController.java:310)\n" + + "9: VerifyStackTrace.test(VerifyStackTrace.java:229)\n" + + "10: VerifyStackTrace.main(VerifyStackTrace.java:185)\n"; @Override public StackWalker walker() { return walker;} @Override public String description() { return description;} @Override public String expected() { return expected;} @@ -130,22 +127,24 @@ public class VerifyStackTrace { // then you can cut & paste the <-- actual --> stack printed in the // test output in here (don't forget the final \n): private final String expected = - "1: VerifyStackTrace.lambda$test$1(VerifyStackTrace.java:213)\n" + - "2: VerifyStackTrace$$Lambda$1/0x00000007c0089430.run(Unknown Source)\n" + - "3: VerifyStackTrace$Handle.execute(VerifyStackTrace.java:149)\n" + - "4: java.base/java.lang.invoke.LambdaForm$DMH/0x00000007c008a830.invokeVirtual_LL_V(LambdaForm$DMH)\n" + - "5: java.base/java.lang.invoke.LambdaForm$MH/0x00000007c008a830.invoke_MT(LambdaForm$MH)\n" + - "6: VerifyStackTrace$Handle.run(VerifyStackTrace.java:162)\n" + - "7: VerifyStackTrace.invoke(VerifyStackTrace.java:192)\n" + - "8: java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + - "9: java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" + - "10: java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + - "11: java.base/java.lang.reflect.Method.invoke(Method.java:520)\n" + - "12: VerifyStackTrace$1.run(VerifyStackTrace.java:222)\n" + - "13: java.base/java.security.AccessController.executePrivileged(AccessController.java:759)\n" + - "14: java.base/java.security.AccessController.doPrivileged(AccessController.java:310)\n" + - "15: VerifyStackTrace.test(VerifyStackTrace.java:231)\n" + - "16: VerifyStackTrace.main(VerifyStackTrace.java:188)\n"; + "1: VerifyStackTrace.lambda$test$1(VerifyStackTrace.java:280)\n" + + "2: VerifyStackTrace$$Lambda$1/0x0000000801001848.run(Unknown Source)\n" + + "3: VerifyStackTrace$Handle.execute(VerifyStackTrace.java:206)\n" + + "4: java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(DirectMethodHandle$Holder)\n" + + "5: java.base/java.lang.invoke.LambdaForm$MH/0x0000000801004800.invoke_MT(LambdaForm$MH)\n" + + "6: VerifyStackTrace$Handle.run(VerifyStackTrace.java:219)\n" + + "7: VerifyStackTrace.invoke(VerifyStackTrace.java:259)\n" + + "8: java.base/java.lang.invoke.LambdaForm$DMH/0x0000000801002000.invokeStatic(LambdaForm$DMH)\n" + + "9: java.base/java.lang.invoke.LambdaForm$MH/0x0000000801003000.invoke(LambdaForm$MH)\n" + + "10: java.base/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)\n" + + "11: java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:211)\n" + + "12: java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:122)\n" + + "13: java.base/java.lang.reflect.Method.invoke(Method.java:573)\n" + + "14: VerifyStackTrace$1.run(VerifyStackTrace.java:292)\n" + + "15: java.base/java.security.AccessController.executePrivileged(AccessController.java:753)\n" + + "16: java.base/java.security.AccessController.doPrivileged(AccessController.java:312)\n" + + "17: VerifyStackTrace.test(VerifyStackTrace.java:301)\n" + + "18: VerifyStackTrace.main(VerifyStackTrace.java:254)\n"; @Override public StackWalker walker() { return walker;} @Override public String description() { return description;} diff --git a/test/jdk/java/lang/StackWalker/libnativeMethod.c b/test/jdk/java/lang/StackWalker/libnativeMethod.c new file mode 100644 index 00000000000..aa2c3668fa6 --- /dev/null +++ b/test/jdk/java/lang/StackWalker/libnativeMethod.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021, 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 + +#include "jni.h" + +static jclass test_class; +static jmethodID mid; +static jint current_jni_version = JNI_VERSION_10; + +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved) { + JNIEnv *env; + jclass cl; + + (*vm)->GetEnv(vm, (void **) &env, current_jni_version); + + cl = (*env)->FindClass(env, "NativeMethod"); + test_class = (*env)->NewGlobalRef(env, cl); + mid = (*env)->GetMethodID(env, test_class, "walk", "()V"); + + return current_jni_version; +} + +/* + * Class: NativeMethod + * Method: test + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_NativeMethod_test(JNIEnv *env, jobject obj) { + (*env)->CallVoidMethod(env, obj, mid); + + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "Exception thrown"); + } +} diff --git a/test/jdk/java/lang/invoke/CallerSensitiveMethodHandle.java b/test/jdk/java/lang/invoke/CallerSensitiveMethodHandle.java new file mode 100644 index 00000000000..369c2c2bea1 --- /dev/null +++ b/test/jdk/java/lang/invoke/CallerSensitiveMethodHandle.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021, 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 + * @run testng/othervm CallerSensitiveMethodHandle + * @summary Check Lookup findVirtual, findStatic and unreflect behavior with + * caller sensitive methods with focus on AccessibleObject.setAccessible + */ + +import org.testng.annotations.Test; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodHandles.Lookup; +import java.lang.reflect.Field; + +import static java.lang.invoke.MethodType.*; +import static org.testng.Assert.*; + +public class CallerSensitiveMethodHandle { + private static int field = 0; + @Test + public void privateField() throws Throwable { + Lookup l = MethodHandles.lookup(); + Field f = CallerSensitiveMethodHandle.class.getDeclaredField("field"); + MethodHandle mh = l.findVirtual(Field.class, "setInt", methodType(void.class, Object.class, int.class)); + int newValue = 5; + mh.invokeExact(f, (Object) null, newValue); + assertTrue(field == newValue); + } + + @Test + public void lookupItself() throws Throwable { + Lookup lookup = MethodHandles.lookup(); + MethodHandle MH_lookup2 = lookup.findStatic(MethodHandles.class, "lookup", methodType(Lookup.class)); + Lookup lookup2 = (Lookup) MH_lookup2.invokeExact(); + System.out.println(lookup2 + " original lookup class " + lookup.lookupClass()); + assertTrue(lookup2.lookupClass() == lookup.lookupClass()); + } +} diff --git a/test/jdk/java/lang/invoke/MethodHandleInvokeUOE.java b/test/jdk/java/lang/invoke/MethodHandleInvokeUOE.java new file mode 100644 index 00000000000..e728516fe03 --- /dev/null +++ b/test/jdk/java/lang/invoke/MethodHandleInvokeUOE.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021, 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 + * @summary Test MethodHandle::invokeExact and MethodHandle::invoke throws + * UnsupportedOperationException when called via Method::invoke + * @run testng test.java.lang.invoke.MethodHandleInvokeUOE + */ + +package test.java.lang.invoke; + +import org.testng.*; +import org.testng.annotations.*; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import static java.lang.invoke.MethodType.*; + +public class MethodHandleInvokeUOE { + @Test + public void testInvokeExact() throws Throwable { + Class clz = MethodHandle.class; + String mname = "invokeExact"; + Method m = clz.getDeclaredMethod(mname, Object[].class); + MethodHandle mh = MethodHandles.lookup().findVirtual(clz, mname, methodType(Object.class, Object[].class)); + try { + m.invoke(mh, new Object[1]); + } catch (InvocationTargetException e) { + if (!(e.getCause() instanceof UnsupportedOperationException)) { + throw new RuntimeException("expected UnsupportedOperationException but got: " + + e.getCause().getClass().getName(), e); + } + } + } + + @Test + public void testInvoke() throws Throwable { + Class clz = MethodHandle.class; + String mname = "invoke"; + Method m = clz.getDeclaredMethod(mname, Object[].class); + MethodHandle mh = MethodHandles.lookup().findVirtual(clz, mname, methodType(Object.class, Object[].class)); + try { + m.invoke(mh, new Object[1]); + } catch (InvocationTargetException e) { + if (!(e.getCause() instanceof UnsupportedOperationException)) { + throw new RuntimeException("expected UnsupportedOperationException but got: " + + e.getCause().getClass().getName(), e); + } + } + } +} diff --git a/test/jdk/java/lang/invoke/CallerSensitiveAccess.java b/test/jdk/java/lang/invoke/callerSensitive/CallerSensitiveAccess.java similarity index 91% rename from test/jdk/java/lang/invoke/CallerSensitiveAccess.java rename to test/jdk/java/lang/invoke/callerSensitive/CallerSensitiveAccess.java index 2e904879a82..420cb37abde 100644 --- a/test/jdk/java/lang/invoke/CallerSensitiveAccess.java +++ b/test/jdk/java/lang/invoke/callerSensitive/CallerSensitiveAccess.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 8196830 8235351 + * @bug 8196830 8235351 8257874 * @modules java.base/jdk.internal.reflect * @run testng/othervm CallerSensitiveAccess * @summary Check Lookup findVirtual, findStatic and unreflect behavior with @@ -355,6 +355,40 @@ public class CallerSensitiveAccess { mh.invoke(inaccessibleField(), true); // should throw ClassCastException } + /** + * Field::getInt and Field::setInt are caller-sensitive methods. + * Test access to private field. + */ + private static int privateField = 0; + @Test + public void testPrivateField() throws Throwable { + Field f = CallerSensitiveAccess.class.getDeclaredField("privateField"); + // Field::setInt + MethodType mtype = MethodType.methodType(void.class, Object.class, int.class); + MethodHandle mh = MethodHandles.lookup().findVirtual(Field.class, "setInt", mtype); + mh.invokeExact(f, (Object)null, 5); + // Field::getInt + mh = MethodHandles.lookup().findVirtual(Field.class, "getInt", MethodType.methodType(int.class, Object.class)); + int value = (int)mh.invokeExact(f, (Object)null); + assertTrue(value == 5); + } + + private static class Inner { + private static boolean privateField = false; + } + + @Test + public void testInnerPrivateField() throws Throwable { + Field f = Inner.class.getDeclaredField("privateField"); + // Field::setInt + MethodType mtype = MethodType.methodType(void.class, Object.class, boolean.class); + MethodHandle mh = MethodHandles.lookup().findVirtual(Field.class, "setBoolean", mtype); + mh.invokeExact(f, (Object)null, true); + // Field::getInt + mh = MethodHandles.lookup().findVirtual(Field.class, "getBoolean", MethodType.methodType(boolean.class, Object.class)); + boolean value = (boolean)mh.invokeExact(f, (Object)null); + assertTrue(value); + } // -- supporting methods -- diff --git a/test/jdk/java/lang/invoke/callerSensitive/Main.java b/test/jdk/java/lang/invoke/callerSensitive/Main.java new file mode 100644 index 00000000000..437b26896b3 --- /dev/null +++ b/test/jdk/java/lang/invoke/callerSensitive/Main.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021, 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 8013527 + * @library src + * @modules java.base/jdk.internal.reflect + * @build java.base/java.util.CSM csm/* + * @run main/othervm -Djava.security.manager=allow csm/jdk.test.MethodInvokeTest + * @run main/othervm -Djava.security.manager=allow csm/jdk.test.MethodInvokeTest sm + * @summary Test proper caller class is bound to method handle for caller-sensitive method + */ +public class Main { +} + diff --git a/test/jdk/java/lang/invoke/callerSensitive/csm/jdk/test/MethodInvokeTest.java b/test/jdk/java/lang/invoke/callerSensitive/csm/jdk/test/MethodInvokeTest.java new file mode 100644 index 00000000000..732690044cd --- /dev/null +++ b/test/jdk/java/lang/invoke/callerSensitive/csm/jdk/test/MethodInvokeTest.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2021, 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.test; + +import java.lang.StackWalker.StackFrame; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.reflect.Method; +import java.util.CSM; +import java.security.Permission; +import java.security.PermissionCollection; +import java.security.Permissions; +import java.security.Policy; +import java.security.ProtectionDomain; +import java.util.function.Supplier; + +/** + * This test invokes caller-sensitive methods via static reference, + * reflection, MethodHandle, lambda. If there is no alternate implementation + * of a CSM with a trailing caller class parameter, when a CSM is invoked + * via method handle, an invoker class is injected as the caller class + * which is defined by the same defining class loader, in the same runtime + * package, and protection domain as the lookup class. + */ +public class MethodInvokeTest { + static final Policy DEFAULT_POLICY = Policy.getPolicy(); + private static final String CALLER_METHOD = "caller"; + private static final String CALLER_NO_ALT_METHOD = "callerNoAlternateImpl"; + + public static void main(String... args) throws Throwable { + boolean sm = args.length > 0 && args[0].equals("sm"); + System.err.format("Test %s security manager.%n", + sm ? "with" : "without"); + if (sm) { + setupSecurityManager(); + } + + MethodInvokeTest test = new MethodInvokeTest(); + // test static call to java.util.CSM::caller + test.staticMethodCall(); + // test java.lang.reflect.Method call + test.reflectMethodCall(); + // test java.lang.invoke.MethodHandle + test.invokeMethodHandle(); + // test method ref + test.lambda(); + } + + static void setupSecurityManager() { + PermissionCollection perms = new Permissions(); + perms.add(new RuntimePermission("getStackWalkerWithClassReference")); + Policy.setPolicy(new Policy() { + @Override + public boolean implies(ProtectionDomain domain, Permission p) { + return perms.implies(p) || DEFAULT_POLICY.implies(domain, p); + } + }); + System.setSecurityManager(new SecurityManager()); + } + + void staticMethodCall() { + checkCaller(java.util.CSM.caller(), MethodInvokeTest.class, true); + checkCaller(java.util.CSM.callerNoAlternateImpl(), MethodInvokeTest.class, false); + } + + void reflectMethodCall() throws Throwable { + // zero-arg caller method + checkCaller(Caller1.invoke(CSM.class.getMethod(CALLER_METHOD)), Caller1.class, true); + checkCaller(Caller2.invoke(CSM.class.getMethod(CALLER_METHOD)), Caller2.class, true); + // 4-arg caller method + checkCaller(Caller1.invoke(CSM.class.getMethod(CALLER_METHOD, Object.class, Object.class, Object.class, Object.class), + new Object[] { null, null, null, null}), Caller1.class, true); + checkCaller(Caller2.invoke(CSM.class.getMethod(CALLER_METHOD, Object.class, Object.class, Object.class, Object.class), + new Object[] { null, null, null, null}), Caller2.class, true); + + // Reflection::getCallerClass will return the injected invoker class as the caller + checkInjectedInvoker(Caller1.invoke(CSM.class.getMethod(CALLER_NO_ALT_METHOD)), Caller1.class); + checkInjectedInvoker(Caller2.invoke(CSM.class.getMethod(CALLER_NO_ALT_METHOD)), Caller2.class); + } + + void invokeMethodHandle() throws Throwable { + checkCaller(Caller1.invokeExact(CALLER_METHOD), Caller1.class, true); + checkCaller(Caller2.invokeExact(CALLER_METHOD), Caller2.class, true); + + checkInjectedInvoker(Caller1.invokeExact(CALLER_NO_ALT_METHOD), Caller1.class); + checkInjectedInvoker(Caller2.invokeExact(CALLER_NO_ALT_METHOD), Caller2.class); + } + + void lambda() { + CSM caller = LambdaTest.caller.get(); + LambdaTest.checkLambdaProxyClass(caller); + + caller = LambdaTest.caller(); + LambdaTest.checkLambdaProxyClass(caller); + } + + static class Caller1 { + static CSM invoke(Method csm) throws ReflectiveOperationException { + return (CSM)csm.invoke(null); + } + static CSM invoke(Method csm, Object[] args) throws ReflectiveOperationException { + return (CSM)csm.invoke(null, args); + } + static CSM invokeExact(String methodName) throws Throwable { + MethodHandle mh = MethodHandles.lookup().findStatic(java.util.CSM.class, + methodName, MethodType.methodType(CSM.class)); + return (CSM)mh.invokeExact(); + } + } + + static class Caller2 { + static CSM invoke(Method csm) throws ReflectiveOperationException { + return (CSM)csm.invoke(null); + } + static CSM invoke(Method csm, Object[] args) throws ReflectiveOperationException { + return (CSM)csm.invoke(null, args); + } + static CSM invokeExact(String methodName) throws Throwable { + MethodHandle mh = MethodHandles.lookup().findStatic(java.util.CSM.class, + methodName, MethodType.methodType(CSM.class)); + return (CSM)mh.invokeExact(); + } + } + + static class LambdaTest { + static Supplier caller = java.util.CSM::caller; + + static CSM caller() { + return caller.get(); + } + + /* + * The class calling the caller-sensitive method is the lambda proxy class + * generated for LambdaTest. + */ + static void checkLambdaProxyClass(CSM csm) { + Class caller = csm.caller; + assertTrue(caller.isHidden(), caller + " should be a hidden class"); + assertEquals(caller.getModule(), LambdaTest.class.getModule()); + + int index = caller.getName().indexOf('/'); + String cn = caller.getName().substring(0, index); + assertTrue(cn.startsWith(LambdaTest.class.getName() + "$$Lambda$"), caller + " should be a lambda proxy class"); + } + } + static void checkCaller(CSM csm, Class expected, boolean adapter) { + assertEquals(csm.caller, expected); + assertEquals(csm.adapter, adapter); + // verify no invoker class injected + for (StackFrame frame : csm.stackFrames) { + Class c = frame.getDeclaringClass(); + if (c == expected) break; + + if (c.getName().startsWith(expected.getName() + "$$InjectedInvoker")) + throw new RuntimeException("should not have any invoker class injected"); + } + } + + /* + * The class calling the direct method handle of the caller-sensitive class + * is the InjectedInvoker class generated for the given caller. + */ + static void checkInjectedInvoker(CSM csm, Class expected) { + Class invoker = csm.caller; + assertTrue(invoker.isHidden(), invoker + " should be a hidden class"); + assertEquals(invoker.getModule(), expected.getModule()); + assertEquals(csm.adapter, false); + + int index = invoker.getName().indexOf('/'); + String cn = invoker.getName().substring(0, index); + assertEquals(cn, expected.getName() + "$$InjectedInvoker"); + + // check the invoker class on the stack + for (StackFrame frame : csm.stackFrames) { + Class c = frame.getDeclaringClass(); + if (c.getName().startsWith(expected.getName() + "$$InjectedInvoker")) + break; + + if (c == expected) + throw new RuntimeException("no invoker class found before the expected caller class"); + } + } + + static void assertTrue(boolean value, String msg) { + if (!value) { + throw new RuntimeException(msg); + } + } + static void assertEquals(Object o1, Object o2) { + if (!o1.equals(o2)) { + throw new RuntimeException(o1 + " != " + o2); + } + } +} diff --git a/test/jdk/java/lang/invoke/callerSensitive/csm/module-info.java b/test/jdk/java/lang/invoke/callerSensitive/csm/module-info.java new file mode 100644 index 00000000000..5e7ed5b704f --- /dev/null +++ b/test/jdk/java/lang/invoke/callerSensitive/csm/module-info.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021, 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. + */ + +module csm { + exports jdk.test; +} diff --git a/test/jdk/java/lang/invoke/callerSensitive/src/java.base/java/util/CSM.java b/test/jdk/java/lang/invoke/callerSensitive/src/java.base/java/util/CSM.java new file mode 100644 index 00000000000..8f0dde04f6f --- /dev/null +++ b/test/jdk/java/lang/invoke/callerSensitive/src/java.base/java/util/CSM.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021, 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.util; + +import java.lang.StackWalker.StackFrame; +import java.util.stream.Stream; + +import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.CallerSensitiveAdapter; +import jdk.internal.reflect.Reflection; + +import static java.lang.StackWalker.Option.*; + +public class CSM { + public final Class caller; + public final List stackFrames; + public final boolean adapter; + CSM(Class caller, boolean adapter) { + this.caller = caller; + StackWalker sw = StackWalker.getInstance(Set.of(RETAIN_CLASS_REFERENCE, SHOW_HIDDEN_FRAMES)); + this.stackFrames = sw.walk(Stream::toList); + this.adapter = adapter; + } + + /** + * Returns the caller of this caller-sensitive method returned by + * by Reflection::getCallerClass except if this method is called + * via method handle. + */ + @CallerSensitive + public static CSM caller() { + return caller(Reflection.getCallerClass()); + } + + /** + * If caller() is invoked via method handle, this alternate method is + * called instead. The caller class would be the lookup class. + */ + @CallerSensitiveAdapter + private static CSM caller(Class caller) { + return new CSM(caller, true); + } + + /** + * Returns the caller of this caller-sensitive method returned by + * by Reflection::getCallerClass. + */ + @CallerSensitive + public static CSM callerNoAlternateImpl() { + return new CSM(Reflection.getCallerClass(), false); + } + + @CallerSensitive + public static CSM caller(Object o1, Object o2, Object o3, Object o4) { + return caller(o1, o2, o3, o4, Reflection.getCallerClass()); + } + + /** + * If caller() is invoked via method handle, this alternate method is + * called instead. The caller class would be the lookup class. + */ + @CallerSensitiveAdapter + private static CSM caller(Object o1, Object o2, Object o3, Object o4, Class caller) { + return new CSM(caller, true); + } +} \ No newline at end of file diff --git a/test/jdk/java/lang/invoke/lookup/ChainedLookupTest.java b/test/jdk/java/lang/invoke/lookup/ChainedLookupTest.java new file mode 100644 index 00000000000..2aaa48af17b --- /dev/null +++ b/test/jdk/java/lang/invoke/lookup/ChainedLookupTest.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 8013527 + * @run testng/othervm ChainedLookupTest + * @summary Test MethodHandles.lookup method to produce the Lookup object with + * proper lookup class if invoked through reflection and method handle. + */ + +import java.lang.invoke.*; +import java.lang.invoke.MethodHandles.Lookup; +import java.lang.reflect.Method; + +import org.testng.annotations.Test; + +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; +import static org.testng.Assert.*; + +public class ChainedLookupTest { + /** + * Direct call to MethodHandles::lookup + */ + @Test + public void staticLookup() throws Throwable { + Lookup lookup = lookup(); + test(lookup, "Lookup produced via direct call to MethodHandles.lookup()"); + } + + /** + * Reflective Method::invoke on MethodHandles::lookup + */ + @Test + public void methodInvoke() throws Throwable { + Method m = MethodHandles.class.getMethod("lookup"); + Lookup lookup = (Lookup) m.invoke(null); + test(lookup, "Lookup produced via reflective call"); + } + + /** + * Invoke Method::invoke on MethodHandles::lookup via MethodHandle + */ + @Test + public void methodInvokeViaMethodHandle() throws Throwable { + Method m = MethodHandles.class.getMethod("lookup"); + + MethodHandle mh = lookup().findVirtual(Method.class, "invoke", + methodType(Object.class, Object.class, Object[].class)); + Lookup lookup = (Lookup)mh.invoke(m, (Object)null, (Object[])null); + test(lookup, "Lookup produced via Method::invoke via MethodHandle"); + } + + /** + * Invoke MethodHandle on MethodHandles::lookup via Method::invoke + */ + // @Test + public void methodHandleViaReflection() throws Throwable { + MethodHandle MH_lookup = lookup().findStatic(MethodHandles.class, "lookup", methodType(Lookup.class)); + Lookup lookup = (Lookup) MH_lookup.invokeExact(); + + Method m = MethodHandle.class.getMethod("invoke", Object[].class); + + // should this throw UnsupportedOperationException per MethodHandle::invoke spec? + lookup = (Lookup)m.invoke(MH_lookup); + test(lookup, "Lookup produced via MethodHandle::invoke via Method::invoke"); + } + + /** + * MethodHandle::invokeExact on MethodHandles::lookup + */ + @Test + public void methodHandle() throws Throwable { + MethodHandle MH_lookup = lookup().findStatic(MethodHandles.class, "lookup", methodType(Lookup.class)); + Lookup lookup = (Lookup) MH_lookup.invokeExact(); + test(lookup, "Lookup produced via MethodHandle"); + } + + /** + * MethodHandles::unreflect the reflective Method representing MethodHandles::lookup + */ + @Test + public void unreflect() throws Throwable { + MethodHandle MH_lookup = lookup().unreflect(MethodHandles.class.getMethod("lookup")); + Lookup lookup = (Lookup) MH_lookup.invokeExact(); + test(lookup, "Lookup produced via unreflect MethodHandle"); + } + + /** + * Use the Lookup object returned from MethodHandle::invokeExact on MethodHandles::lookup + * to look up MethodHandle representing MethodHandles::lookup and then invoking it. + */ + @Test + public void chainedMethodHandle() throws Throwable { + MethodHandle MH_lookup = lookup().findStatic(MethodHandles.class, "lookup", methodType(Lookup.class)); + Lookup lookup = (Lookup) MH_lookup.invokeExact(); + MethodHandle MH_lookup2 = lookup.unreflect(MethodHandles.class.getMethod("lookup")); + Lookup lookup2 = (Lookup) MH_lookup2.invokeExact(); + test(lookup2, "Lookup produced via a chained call to MethodHandle"); + } + + void test(Lookup lookup, String msg) throws Throwable { + assertTrue(lookup.lookupClass() == ChainedLookupTest.class); + assertTrue(lookup.hasFullPrivilegeAccess()); + + MethodHandle mh = lookup.findStatic(lookup.lookupClass(), "say", methodType(void.class, String.class)); + mh.invokeExact(msg); + } + + private static void say(String msg) { + System.out.println(msg); + } +} + diff --git a/test/jdk/java/lang/invoke/lookup/ReflectiveLookupTest.java b/test/jdk/java/lang/invoke/lookup/ReflectiveLookupTest.java index 9d8eec4abd0..14178b7fa8f 100644 --- a/test/jdk/java/lang/invoke/lookup/ReflectiveLookupTest.java +++ b/test/jdk/java/lang/invoke/lookup/ReflectiveLookupTest.java @@ -52,9 +52,7 @@ public class ReflectiveLookupTest { Method lookupMethod = MethodHandles.class.getMethod("lookup"); System.out.println("reflection method: " + lookupMethod); - if (!lookupMethod.getName().equals("lookup")) { - throw new RuntimeException("Unexpected name: " + lookupMethod.getName()); - } + assertEquals(lookupMethod.getName(), "lookup"); // Get a full power Lookup reflectively. Lookup lookup2 = (Lookup) lookupMethod.invoke(null); diff --git a/test/jdk/java/lang/invoke/lookup/java.base/java/lang/LookupTest.java b/test/jdk/java/lang/invoke/lookup/java.base/java/lang/LookupTest.java index 3e5341baff3..3d633dc2082 100644 --- a/test/jdk/java/lang/invoke/lookup/java.base/java/lang/LookupTest.java +++ b/test/jdk/java/lang/invoke/lookup/java.base/java/lang/LookupTest.java @@ -56,7 +56,7 @@ public class LookupTest { try { MethodHandles.class.getMethod("lookup").invoke(null); } catch (InvocationTargetException e) { - if (!(e.getCause() instanceof IllegalArgumentException)) { + if (!(e.getCause() instanceof InternalError)) { throw e.getCause(); } } diff --git a/test/jdk/java/lang/reflect/ChainedReflection.java b/test/jdk/java/lang/reflect/ChainedReflection.java new file mode 100644 index 00000000000..212a70345cd --- /dev/null +++ b/test/jdk/java/lang/reflect/ChainedReflection.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2021, 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 + * @run testng/othervm ChainedReflection + * @summary Test Method::invoke and Constructor::newInstance chained calls that + * should wrap NPE in InvocationTargetException properly + */ + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; +import java.util.Optional; + +import org.testng.annotations.Test; + +public class ChainedReflection { + public ChainedReflection() {} + + ChainedReflection(Void dummy) throws ReflectiveOperationException { + Method m = ChainedReflection.class.getMethod("throwNPE"); + try { + m.invoke(null); + } catch (InvocationTargetException e) { + Throwable t = e.getTargetException(); + if (t instanceof NullPointerException npe) { + throw npe; + } else { + throw new RuntimeException("Test failed (InvocationTargetException didn't wrap NullPointerException)"); + } + } catch (Throwable t) { + throw new RuntimeException("Test failed (Unexpected exception)", t); + } + } + + public static void throwNPE() { + throw new NullPointerException(); + } + + /* + * Wrap a NullPointerException with a new NullPointerException + */ + public static void npe() throws ReflectiveOperationException { + NullPointerException cause; + try { + Optional.of(null); + throw new RuntimeException("NPE not thrown"); + } catch (NullPointerException e) { + cause = e; + } + Class c = NullPointerException.class; + Constructor ctor = c.getConstructor(); + NullPointerException npe = (NullPointerException) ctor.newInstance(); + npe.initCause(cause); + throw npe; + } + + /** + * Tests the target method being invoked via core reflection that + * throws NullPointerException allocated via Constructor::newInstance. + * The newly allocated NPE thrown by the target method should be + * wrapped by InvocationTargetException. + */ + @Test + public void methodCallNewInstance() throws ReflectiveOperationException { + Method m = ChainedReflection.class.getMethod("npe"); + try { + m.invoke(null); + } catch (InvocationTargetException e) { + Throwable t = e.getTargetException(); + if (!(t instanceof NullPointerException)) { + throw new RuntimeException("Test failed (InvocationTargetException didn't wrap NullPointerException)"); + } + } catch (Throwable t) { + throw new RuntimeException("Test failed (Unexpected exception)", t); + } + } + + /** + * Tests a constructor C calling the method "throwNPE" that throws + * a new instance of NullPointerException. + * C::newInstance should wrap NullPointerException thrown by + * Method::invoke on "throwNPE" by InvocationTargetException. + */ + @Test + public void ctorCallMethodInvoke() throws ReflectiveOperationException { + Constructor ctor = ChainedReflection.class.getDeclaredConstructor(Void.class); + try { + ctor.newInstance((Void)null); + } catch (InvocationTargetException e) { + Throwable t = e.getTargetException(); + if (!(t instanceof NullPointerException)) { + throw new RuntimeException("Test failed (InvocationTargetException didn't wrap NullPointerException)"); + } + } catch (Throwable t) { + throw new RuntimeException("Test failed (Unexpected exception)", t); + } + } +} diff --git a/test/jdk/java/lang/reflect/Field/TestFieldReflectValueOf.java b/test/jdk/java/lang/reflect/Field/TestFieldReflectValueOf.java index bc80c49f03a..e6ffa4a661b 100644 --- a/test/jdk/java/lang/reflect/Field/TestFieldReflectValueOf.java +++ b/test/jdk/java/lang/reflect/Field/TestFieldReflectValueOf.java @@ -87,25 +87,25 @@ public class TestFieldReflectValueOf { private volatile short shortVolatileField; public static void main(String[] args) { - testUnsafeStaticFieldAccessors(); - testUnsafeQualifiedStaticFieldAccessors(); - testUnsafeFieldAccessors(); - testUnsafeQualifiedFieldAccessors(); + testStaticFieldAccessors(); + testStaticVolatileFieldAccessors(); + testFieldAccessors(); + testVolatileFieldAccessors(); } - private static void testUnsafeStaticFieldAccessors() { + private static void testStaticFieldAccessors() { testFieldAccessors(true, false); } - private static void testUnsafeQualifiedStaticFieldAccessors() { + private static void testStaticVolatileFieldAccessors() { testFieldAccessors(true, true); } - private static void testUnsafeFieldAccessors() { + private static void testFieldAccessors() { testFieldAccessors(false, false); } - private static void testUnsafeQualifiedFieldAccessors() { + private static void testVolatileFieldAccessors() { testFieldAccessors(false, true); } diff --git a/test/jdk/java/lang/reflect/Method/MethodArityLimit.java b/test/jdk/java/lang/reflect/Method/MethodArityLimit.java new file mode 100644 index 00000000000..536b3a5e317 --- /dev/null +++ b/test/jdk/java/lang/reflect/Method/MethodArityLimit.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021, 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 8271820 + * @run testng/othervm MethodArityLimit + * @summary Method exceeds the method handle arity limit (255). + */ + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Method; + +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; + +public class MethodArityLimit { + @Test + public void testArityLimit() throws Throwable { + Method m = this.getClass().getMethod("f", long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, long.class, + long.class, long.class, long.class, long.class, long.class, int.class); + + long resultViaMethod = (long) m.invoke(null, 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, + 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, + 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, + 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, + 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, + 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L, 75L, 76L, 77L, 78L, + 79L, 80L, 81L, 82L, 83L, 84L, 85L, 86L, 87L, 88L, 89L, 90L, 91L, 92L, + 93L, 94L, 95L, 96L, 97L, 98L, 99L, 100L, 101L, 102L, 103L, 104L, 105L, + 106L, 107L, 108L, 109L, 110L, 111L, 112L, 113L, 114L, 115L, 116L, 117L, + 118L, 119L, 120L, 121L, 122L, 123L, 124L, 125L, 126L, 127); + + assertEquals(resultViaMethod, 127); + + try { + MethodHandle mh = MethodHandles.lookup().unreflect(m); + fail("should fail in creating the method handle"); + } catch (IllegalArgumentException e) {} + } + + public static long f(long a0, long a1, long a2, long a3, long a4, long a5, + long a6, long a7, long a8, long a9, long a10, long a11, long a12, + long a13, long a14, long a15, long a16, long a17, long a18, long a19, + long a20, long a21, long a22, long a23, long a24, long a25, long a26, + long a27, long a28, long a29, long a30, long a31, long a32, long a33, + long a34, long a35, long a36, long a37, long a38, long a39, long a40, + long a41, long a42, long a43, long a44, long a45, long a46, long a47, + long a48, long a49, long a50, long a51, long a52, long a53, long a54, + long a55, long a56, long a57, long a58, long a59, long a60, long a61, + long a62, long a63, long a64, long a65, long a66, long a67, long a68, + long a69, long a70, long a71, long a72, long a73, long a74, long a75, + long a76, long a77, long a78, long a79, long a80, long a81, long a82, + long a83, long a84, long a85, long a86, long a87, long a88, long a89, + long a90, long a91, long a92, long a93, long a94, long a95, long a96, + long a97, long a98, long a99, long a100, long a101, long a102, long a103, + long a104, long a105, long a106, long a107, long a108, long a109, + long a110, long a111, long a112, long a113, long a114, long a115, + long a116, long a117, long a118, long a119, long a120, long a121, + long a122, long a123, long a124, long a125, long a126, int a127) { + return a127; + } +} diff --git a/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java b/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java new file mode 100644 index 00000000000..3b702edc5f3 --- /dev/null +++ b/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java @@ -0,0 +1,639 @@ +/* + * Copyright (c) 2021, 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 8271820 + * @modules java.base/jdk.internal.reflect + * @summary Test compliance of ConstructorAccessor, FieldAccessor, MethodAccessor implementations + * @run testng/othervm --add-exports java.base/jdk.internal.reflect=ALL-UNNAMED -Djdk.reflect.useDirectMethodHandle=true -XX:-ShowCodeDetailsInExceptionMessages MethodHandleAccessorsTest + */ + +/* + * @test + * @modules java.base/jdk.internal.reflect + * @run testng/othervm --add-exports java.base/jdk.internal.reflect=ALL-UNNAMED -Djdk.reflect.useDirectMethodHandle=false -XX:-ShowCodeDetailsInExceptionMessages MethodHandleAccessorsTest + */ + + +import jdk.internal.reflect.ConstructorAccessor; +import jdk.internal.reflect.FieldAccessor; +import jdk.internal.reflect.MethodAccessor; +import jdk.internal.reflect.Reflection; +import jdk.internal.reflect.ReflectionFactory; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Objects; +import java.util.function.IntUnaryOperator; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class MethodHandleAccessorsTest { + + public static void public_static_V() {} + + public static int public_static_I() { return 42; } + + public void public_V() {} + + public int public_I() { return 42; } + + public static void public_static_I_V(int i) {} + + public static int public_static_I_I(int i) { return i; } + + public void public_I_V(int i) {} + + public int public_I_I(int i) { return i; } + + private static void private_static_V() {} + + private static int private_static_I() { return 42; } + + private void private_V() {} + + private int private_I() { return 42; } + + private static void private_static_I_V(int i) {} + + private static int private_static_I_I(int i) { return i; } + + private void private_I_V(int i) {} + + private int private_I_I(int i) { return i; } + + public static int varargs(int... values) { + int sum = 0; + for (int i : values) sum += i; + return sum; + + } + public static int varargs_primitive(int first, int... rest) { + int sum = first; + if (rest != null) { + sum *= 100; + for (int i : rest) sum += i; + } + return sum; + } + + public static String varargs_object(String first, String... rest) { + StringBuilder sb = new StringBuilder(first); + if (rest != null) { + sb.append(Stream.of(rest).collect(Collectors.joining(",", "[", "]"))); + } + return sb.toString(); + } + + public static final class Public { + public static final int STATIC_FINAL = 1; + private final int i; + private final String s; + + public Public() { + this.i = 0; + this.s = null; + } + + public Public(int i) { + this.i = i; + this.s = null; + } + + public Public(String s) { + this.i = 0; + this.s = s; + } + + public Public(int first, int... rest) { + this(varargs_primitive(first, rest)); + } + + public Public(String first, String... rest) { + this(varargs_object(first, rest)); + } + + public Public(RuntimeException exc) { + throw exc; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Public other = (Public) o; + return i == other.i && + Objects.equals(s, other.s); + } + + @Override + public int hashCode() { + return Objects.hash(i, s); + } + + @Override + public String toString() { + return "Public{" + + "i=" + i + + ", s='" + s + '\'' + + '}'; + } + } + + static final class Private { + private final int i; + + private Private() { + this.i = 0; + } + + private Private(int i) { + this.i = i; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Private other = (Private) o; + return i == other.i; + } + + @Override + public int hashCode() { + return Objects.hash(i); + } + + @Override + public String toString() { + return "Private{" + + "i=" + i + + '}'; + } + } + + static final class Thrower { + public Thrower(RuntimeException exc) { + throw exc; + } + public static void throws_exception(RuntimeException exc) { + throw exc; + } + } + + public static abstract class Abstract { + public Abstract() { + } + } + + /** + * Tests if MethodAccessor::invoke implementation returns the expected + * result or exceptions. + */ + static void doTestAccessor(Method m, MethodAccessor ma, Object target, Object[] args, + Object expectedReturn, Throwable... expectedExceptions) { + Object ret; + Throwable exc; + try { + ret = ma.invoke(target, args); + exc = null; + } catch (Throwable e) { + ret = null; + exc = e; + } + System.out.println("\n" + m + ", invoked with target: " + target + ", args: " + Arrays.toString(args)); + + chechResult(ret, expectedReturn, exc, expectedExceptions); + } + + /** + * Tests if ConstructorAccessor::newInstance implementation returns the + * expected result or exceptions. + */ + static void doTestAccessor(Constructor c, ConstructorAccessor ca, Object[] args, + Object expectedReturn, Throwable... expectedExceptions) { + Object ret; + Throwable exc; + try { + ret = ca.newInstance(args); + exc = null; + } catch (Throwable e) { + ret = null; + exc = e; + } + System.out.println("\n" + c + ", invoked with args: " + Arrays.toString(args)); + chechResult(ret, expectedReturn, exc, expectedExceptions); + } + + /** + * Tests if FieldAccessor::get implementation returns the + * expected result or exceptions. + */ + static void doTestAccessor(Field f, FieldAccessor fa, Object target, + Object expectedValue, Throwable... expectedExceptions) { + Object ret; + Throwable exc; + try { + ret = fa.get(target); + exc = null; + } catch (Throwable e) { + ret = null; + exc = e; + } + System.out.println("\n" + f + ", invoked with target: " + target + ", value: " + ret); + chechResult(ret, expectedValue, exc, expectedExceptions); + + } + + /** + * Tests if FieldAccessor::set implementation returns the + * expected result or exceptions. + */ + static void doTestAccessor(Field f, FieldAccessor fa, Object target, Object oldValue, + Object newValue, Throwable... expectedExceptions) { + Object ret; + Throwable exc; + try { + fa.set(target, newValue); + exc = null; + ret = fa.get(target); + } catch (Throwable e) { + ret = null; + exc = e; + } + System.out.println("\n" + f + ", invoked with target: " + target + ", value: " + ret); + chechResult(ret, newValue, exc, expectedExceptions); + } + + static void chechResult(Object ret, Object expectedReturn, Throwable exc, Throwable... expectedExceptions) { + if (exc != null) { + checkException(exc, expectedExceptions); + } else if (expectedExceptions.length > 0) { + fail(exc, expectedExceptions); + } else if (!Objects.equals(ret, expectedReturn)) { + throw new AssertionError("Expected return:\n " + expectedReturn + "\ngot:\n " + ret); + } else { + System.out.println(" Got expected return: " + ret); + } + } + + static void checkException(Throwable exc, Throwable... expectedExceptions) { + boolean match = false; + for (Throwable expected : expectedExceptions) { + if (exceptionMatches(exc, expected)) { + match = true; + break; + } + } + if (match) { + System.out.println(" Got expected exception: " + exc); + if (exc.getCause() != null) { + System.out.println(" with cause: " + exc.getCause()); + } + } else { + fail(exc, expectedExceptions); + } + } + + static boolean exceptionMatches(Throwable exc, Throwable expected) { + return expected.getClass().isInstance(exc) && + (Objects.equals(expected.getMessage(), exc.getMessage()) || + (exc.getMessage() != null && expected.getMessage() != null && + exc.getMessage().startsWith(expected.getMessage()))) && + (expected.getCause() == null || exceptionMatches(exc.getCause(), expected.getCause())); + } + + static void fail(Throwable thrownException, Throwable... expectedExceptions) { + String msg; + if (thrownException == null) { + msg = "No exception thrown but there were expected exceptions (see suppressed)"; + } else if (expectedExceptions.length == 0) { + msg = "Exception thrown (see cause) but there were no expected exceptions"; + } else { + msg = "Exception thrown (see cause) but expected exceptions were different (see suppressed)"; + } + AssertionError error = new AssertionError(msg, thrownException); + Stream.of(expectedExceptions).forEach(error::addSuppressed); + throw error; + } + + static void doTest(Method m, Object target, Object[] args, Object expectedReturn, Throwable... expectedException) { + MethodAccessor ma = ReflectionFactory.getReflectionFactory().newMethodAccessor(m, Reflection.isCallerSensitive(m)); + try { + doTestAccessor(m, ma, target, args, expectedReturn, expectedException); + } catch (Throwable e) { + throw new RuntimeException(ma.getClass().getName() + " for method: " + m + " test failure", e); + } + } + + static void doTest(Constructor c, Object[] args, Object expectedReturn, Throwable... expectedExceptions) { + ConstructorAccessor ca = ReflectionFactory.getReflectionFactory().newConstructorAccessor(c); + try { + doTestAccessor(c, ca, args, expectedReturn, expectedExceptions); + } catch (Throwable e) { + throw new RuntimeException(ca.getClass().getName() + " for constructor: " + c + " test failure", e); + } + } + static void doTest(Field f, Object target, Object expectedValue, Throwable... expectedExceptions) { + FieldAccessor fa = ReflectionFactory.getReflectionFactory().newFieldAccessor(f, false); + try { + doTestAccessor(f, fa, target, expectedValue, expectedExceptions); + } catch (Throwable e) { + throw new RuntimeException(fa.getClass().getName() + " for field: " + f + " test failure", e); + } + } + static void doTest(Field f, Object target, Object oldValue, Object newValue, Throwable... expectedExceptions) { + FieldAccessor fa = ReflectionFactory.getReflectionFactory().newFieldAccessor(f, true); + try { + doTestAccessor(f, fa, target, oldValue, newValue, expectedExceptions); + } catch (Throwable e) { + throw new RuntimeException(fa.getClass().getName() + " for field: " + f + " test failure", e); + } + } + + private static final Throwable[] noException = new Throwable[0]; + private static final Throwable[] mismatched_argument_type = new Throwable[] { + new IllegalArgumentException("argument type mismatch") + }; + private static final Throwable[] mismatched_target_type = new Throwable[] { + new IllegalArgumentException("argument type mismatch"), + new IllegalArgumentException("object is not an instance of declaring class"), + }; + private static final Throwable[] cannot_get_final_field = new Throwable[] { + new IllegalArgumentException("Can not get final") + }; + private static final Throwable[] cannot_set_final_field = new Throwable[] { + new IllegalArgumentException("Can not set final") + }; + private static final Throwable[] wrong_argument_count_no_details = new Throwable[] { + new IllegalArgumentException("wrong number of arguments") + }; + private static final Throwable[] wrong_argument_count = new Throwable[] { + new IllegalArgumentException("wrong number of arguments"), + new IllegalArgumentException("array is not of length 1") + }; + private static final Throwable[] null_argument = new Throwable[] { + new IllegalArgumentException("wrong number of arguments"), + new IllegalArgumentException("null array reference") + }; + private static final Throwable[] null_argument_value = new Throwable[] { + new IllegalArgumentException() + }; + private static final Throwable[] null_argument_value_npe = new Throwable[] { + new IllegalArgumentException("java.lang.NullPointerException"), + new NullPointerException() + }; + private static final Throwable[] null_target = new Throwable[] { + new NullPointerException() + }; + private static final Throwable[] wrapped_npe_no_msg = new Throwable[]{ + new InvocationTargetException(new NullPointerException()) + }; + private static final Throwable[] wrapped_npe = new Throwable[]{ + new InvocationTargetException(new NullPointerException("NPE")) + }; + private static final Throwable[] wrapped_cce = new Throwable[]{ + new InvocationTargetException(new ClassCastException("CCE")) + }; + private static final Throwable[] wrapped_iae = new Throwable[]{ + new InvocationTargetException(new IllegalArgumentException("IAE")) + }; + + + @DataProvider(name = "testNoArgMethods") + private Object[][] testNoArgMethods() { + MethodHandleAccessorsTest inst = new MethodHandleAccessorsTest(); + Object[] emptyArgs = new Object[]{}; + return new Object[][] { + new Object[] {"public_static_V", null, emptyArgs, null, noException}, + new Object[] {"public_static_V", null, null, null, noException}, + new Object[] {"public_static_I", null, emptyArgs, 42, noException}, + new Object[] {"public_static_I", null, null, 42, noException}, + new Object[] {"public_V", inst, emptyArgs, null, noException}, + new Object[] {"public_V", inst, null, null, noException}, + new Object[] {"public_I", inst, emptyArgs, 42, noException}, + new Object[] {"public_I", inst, null, 42, noException}, + new Object[] {"private_static_V", null, emptyArgs, null, noException}, + new Object[] {"private_static_I", null, emptyArgs, 42, noException}, + new Object[] {"private_V", inst, emptyArgs, null, noException}, + new Object[] {"private_I", inst, emptyArgs, 42, noException}, + new Object[] {"public_V", null, null, null, null_target}, + }; + } + + @DataProvider(name = "testOneArgMethods") + private Object[][] testOneArgMethods() { + MethodHandleAccessorsTest inst = new MethodHandleAccessorsTest(); + Object wrongInst = new Object(); + boolean newImpl = Boolean.getBoolean("jdk.reflect.useDirectMethodHandle"); + return new Object[][]{ + new Object[] {"public_static_I_V", int.class, null, new Object[]{12}, null, noException}, + new Object[] {"public_static_I_I", int.class, null, new Object[]{12}, 12, noException}, + new Object[] {"public_I_V", int.class, inst, new Object[]{12}, null, noException}, + new Object[] {"public_I_I", int.class, inst, new Object[]{12}, 12, noException}, + new Object[] {"private_static_I_V", int.class, null, new Object[]{12}, null, noException}, + new Object[] {"private_static_I_I", int.class, null, new Object[]{12}, 12, noException}, + new Object[] {"private_I_V", int.class, inst, new Object[]{12}, null, noException}, + new Object[] {"private_I_I", int.class, inst, new Object[]{12}, 12, noException}, + + new Object[] {"public_static_I_I", int.class, null, new Object[]{"a"}, null, mismatched_argument_type}, + new Object[] {"public_I_I", int.class, inst, new Object[]{"a"}, null, mismatched_argument_type}, + new Object[] {"public_static_I_I", int.class, null, new Object[]{12, 13}, null, + newImpl ? wrong_argument_count_no_details : wrong_argument_count}, + new Object[] {"public_I_I", int.class, inst, new Object[]{12, 13}, null, + newImpl ? wrong_argument_count_no_details : wrong_argument_count}, + new Object[] {"public_I_I", int.class, wrongInst, new Object[]{12}, 12, mismatched_target_type}, + new Object[] {"public_I_I", int.class, null, new Object[]{12}, 12, null_target}, + + new Object[] {"public_static_I_V", int.class, null, null, null, + newImpl ? wrong_argument_count_no_details : null_argument}, + new Object[] {"public_static_I_V", int.class, null, new Object[]{null}, null, + newImpl ? null_argument_value_npe : null_argument_value}, + new Object[] {"public_I_I", int.class, inst, null, null, null_argument}, + + new Object[] {"public_I_I", int.class, inst, new Object[]{null}, null, + newImpl ? null_argument_value_npe : null_argument_value}, + }; + } + + @DataProvider(name = "testMethodsWithVarargs") + private Object[][] testMethodsWithVarargs() { + Class[] paramTypes = new Class[] { int[].class }; + Class[] I_paramTypes = new Class[] { int.class, int[].class }; + Class[] L_paramTypes = new Class[] { String.class, String[].class }; + return new Object[][]{ + new Object[] {"varargs", paramTypes, null, new Object[]{new int[]{1, 2, 3}}, 6, noException}, + new Object[] {"varargs", paramTypes, null, new Object[]{new int[]{}}, 0, noException}, + new Object[] {"varargs", paramTypes, null, new Object[]{null}, 0, wrapped_npe_no_msg}, + new Object[] {"varargs_primitive", I_paramTypes, null, new Object[]{1, new int[]{2, 3}}, 105, noException}, + new Object[] {"varargs_primitive", I_paramTypes, null, new Object[]{1, new int[]{}}, 100, noException}, + new Object[] {"varargs_primitive", I_paramTypes, null, new Object[]{1, null}, 1, noException}, + new Object[] {"varargs_object", L_paramTypes, null, new Object[]{"a", new String[]{"b", "c"}}, "a[b,c]", noException}, + new Object[] {"varargs_object", L_paramTypes, null, new Object[]{"a", new String[]{}}, "a[]", noException}, + new Object[] {"varargs_object", L_paramTypes, null, new Object[]{"a", null}, "a", noException}, + }; + } + + @Test(dataProvider = "testNoArgMethods") + public void testNoArgMethod(String methodname, Object target, Object[] args, + Object expectedReturn, Throwable[] expectedExpections) throws Exception { + doTest(MethodHandleAccessorsTest.class.getDeclaredMethod(methodname), target, args, expectedReturn, expectedExpections); + } + + @Test(dataProvider = "testOneArgMethods") + public void testOneArgMethod(String methodname, Class paramType, Object target, Object[] args, + Object expectedReturn, Throwable[] expectedExpections) throws Exception { + doTest(MethodHandleAccessorsTest.class.getDeclaredMethod(methodname, paramType), target, args, expectedReturn, expectedExpections); + } + + @Test(dataProvider = "testMethodsWithVarargs") + public void testMethodsWithVarargs(String methodname, Class[] paramTypes, Object target, Object[] args, + Object expectedReturn, Throwable[] expectedExpections) throws Exception { + doTest(MethodHandleAccessorsTest.class.getDeclaredMethod(methodname, paramTypes), target, args, expectedReturn, expectedExpections); + } + + @DataProvider(name = "testConstructors") + private Object[][] testConstructors() { + return new Object[][]{ + new Object[]{null, new Object[]{}, new Public(), noException}, + new Object[]{null, null, new Public(), noException}, + new Object[]{new Class[]{int.class}, new Object[]{12}, new Public(12), noException}, + new Object[]{new Class[]{String.class}, new Object[]{"a"}, new Public("a"), noException}, + + + new Object[]{new Class[]{int.class, int[].class}, new Object[]{1, new int[]{2, 3}}, new Public(105), noException}, + new Object[]{new Class[]{int.class, int[].class}, new Object[]{1, new int[]{}}, new Public(100), noException}, + new Object[]{new Class[]{int.class, int[].class}, new Object[]{1, null}, new Public(1), noException}, + + new Object[]{new Class[]{String.class, String[].class}, new Object[]{"a", new String[]{"b", "c"}}, new Public("a[b,c]"), noException}, + new Object[]{new Class[]{String.class, String[].class}, new Object[]{"a", new String[]{}}, new Public("a[]"), noException}, + new Object[]{new Class[]{String.class, String[].class}, new Object[]{"a", null}, new Public("a"), noException}, + + // test ConstructorAccessor exceptions thrown + new Object[]{new Class[]{int.class}, new Object[]{"a"}, null, mismatched_argument_type}, + new Object[]{new Class[]{int.class}, new Object[]{12, 13}, null, wrong_argument_count}, + new Object[]{new Class[]{int.class}, null, null, null_argument}, + new Object[]{new Class[]{RuntimeException.class}, new Object[]{new NullPointerException("NPE")}, null, wrapped_npe}, + new Object[]{new Class[]{RuntimeException.class}, new Object[]{new IllegalArgumentException("IAE")}, null, wrapped_iae}, + new Object[]{new Class[]{RuntimeException.class}, new Object[]{new ClassCastException("CCE")}, null, wrapped_cce}, + }; + } + + @Test(dataProvider = "testConstructors") + public void testPublicConstructors(Class[] paramTypes, Object[] args, Object expectedReturn, Throwable[] expectedExpections) throws Exception { + doTest(Public.class.getDeclaredConstructor(paramTypes), args, expectedReturn, expectedExpections); + } + + @Test + public void testOtherConstructors() throws Exception { + doTest(Private.class.getDeclaredConstructor(), new Object[]{}, new Private()); + doTest(Private.class.getDeclaredConstructor(), null, new Private()); + doTest(Private.class.getDeclaredConstructor(int.class), new Object[]{12}, new Private(12)); + + doTest(Abstract.class.getDeclaredConstructor(), null, null, new InstantiationException()); + } + + @DataProvider(name = "throwException") + private Object[][] throwException() { + return new Object[][]{ + new Object[] {new NullPointerException("NPE"), wrapped_npe}, + new Object[] {new IllegalArgumentException("IAE"), wrapped_iae}, + new Object[] {new ClassCastException("CCE"), wrapped_cce}, + }; + } + + /* + * Test Method::invoke and Constructor::newInstance to wrap NPE/CCE/IAE + * thrown by the member + */ + @Test(dataProvider = "throwException") + public void testInvocationTargetException(Throwable ex, Throwable[] expectedExpections) throws Exception { + Object[] args = new Object[] { ex }; + // test static method + doTest(Thrower.class.getDeclaredMethod("throws_exception", RuntimeException.class), null, args, null, expectedExpections); + // test constructor + doTest(Thrower.class.getDeclaredConstructor(RuntimeException.class), args, null, expectedExpections); + } + + @Test + public void testLambdaProxyClass() throws Exception { + // test MethodAccessor on methods declared by hidden classes + IntUnaryOperator intUnaryOp = i -> i; + Method applyAsIntMethod = intUnaryOp.getClass().getDeclaredMethod("applyAsInt", int.class); + doTest(applyAsIntMethod, intUnaryOp, new Object[]{12}, 12); + } + + @DataProvider(name = "readAccess") + private Object[][] readAccess() { + boolean newImpl = Boolean.getBoolean("jdk.reflect.useDirectMethodHandle"); + return new Object[][]{ + new Object[]{"i", new Public(100), 100, noException}, + new Object[]{"s", new Public("test"), "test", noException}, + new Object[]{"s", new Object(), "test", + newImpl ? cannot_get_final_field : cannot_set_final_field}, + new Object[]{"s", null, "test", null_target}, + }; + } + @DataProvider(name = "writeAccess") + private Object[][] writeAccess() { + return new Object[][]{ + new Object[]{"i", new Public(100), 100, 200, noException}, + new Object[]{"s", new Public("test"), "test", "newValue", noException}, + // ## no exception thrown + // new Object[]{"i", new Public(100), 100, new Object(), cannot_set_final_field}, + new Object[]{"s", new Object(), "test", "dummy", cannot_set_final_field}, + new Object[]{"s", null, "test", "dummy", null_target}, + }; + } + + @Test(dataProvider = "readAccess") + public void testFieldReadAccess(String name, Object target, Object expectedValue, Throwable[] expectedExpections) throws Exception { + Field f = Public.class.getDeclaredField(name); + f.setAccessible(true); + doTest(f, target, expectedValue, expectedExpections); + } + + @Test(dataProvider = "writeAccess") + public void testFieldWriteAccess(String name, Object target, Object oldValue, Object newValue, Throwable[] expectedExpections) throws Exception { + Field f = Public.class.getDeclaredField(name); + f.setAccessible(true); + doTest(f, target, oldValue, newValue, expectedExpections); + } + + // test static final field with read-only access + @Test + public void testStaticFinalFields() throws Exception { + Field f = Public.class.getDeclaredField("STATIC_FINAL"); + doTest(f, new Public(), 1, noException); + + try { + f.setInt(null, 100); + } catch (IllegalAccessException e) { } + } +} diff --git a/test/jdk/java/lang/reflect/callerCache/CustomLoaderTest.java b/test/jdk/java/lang/reflect/callerCache/CustomLoaderTest.java new file mode 100644 index 00000000000..27710b5909f --- /dev/null +++ b/test/jdk/java/lang/reflect/callerCache/CustomLoaderTest.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021, 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 8271820 + * @library /test/lib/ + * @modules jdk.compiler + * @build CustomLoaderTest jdk.test.lib.compiler.CompilerUtils + * @run testng/othervm CustomLoaderTest + * @run testng/othervm -Dsun.reflect.noInflation=true CustomLoaderTest + * + * @summary Test method whose parameter types and return type are not visible to the caller. + */ + +import java.io.IOException; +import java.lang.reflect.*; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.atomic.AtomicInteger; + +import jdk.test.lib.compiler.CompilerUtils; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +public class CustomLoaderTest { + private static final Path CLASSES = Paths.get("classes"); + + @BeforeTest + public void setup() throws IOException { + String src = System.getProperty("test.src", "."); + String classpath = System.getProperty("test.classes", "."); + boolean rc = CompilerUtils.compile(Paths.get(src, "ReflectTest.java"), CLASSES, "-cp", classpath); + if (!rc) { + throw new RuntimeException("fail compilation"); + } + try { + Class p = Class.forName("ReflectTest$P"); + fail("should not be visible to this loader"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + + @Test + public void test() throws Exception { + TestLoader loader1 = new TestLoader(); + TestLoader loader2 = new TestLoader(); + Method m1 = loader1.findMethod(); + Method m2 = loader2.findMethod(); + + assertTrue(m1.getDeclaringClass() != m2.getDeclaringClass()); + + assertTrue(m1.getDeclaringClass() == loader1.c); + assertTrue(m2.getDeclaringClass() == loader2.c); + + Object o1 = m1.invoke(loader1.c.newInstance(), loader1.p.newInstance(), loader1.q.newInstance()); + Object o2 = m2.invoke(loader2.c.newInstance(), loader2.p.newInstance(), loader2.q.newInstance()); + + assertTrue(o1.getClass() != o2.getClass()); + assertTrue(o1.getClass() == loader1.r); + assertTrue(o2.getClass() == loader2.r); + } + + static class TestLoader extends URLClassLoader { + static URL[] toURLs() { + try { + return new URL[]{ CLASSES.toUri().toURL() }; + } catch (MalformedURLException e) { + throw new Error(e); + } + } + static AtomicInteger counter = new AtomicInteger(0); + + final Class c; + final Class p; + final Class q; + final Class r; + TestLoader() throws ClassNotFoundException { + super("testloader-" + counter.getAndIncrement(), toURLs(), ClassLoader.getPlatformClassLoader()); + this.c = Class.forName("ReflectTest", true, this); + this.p = Class.forName("ReflectTest$P", true, this); + this.q = Class.forName("ReflectTest$Q", true, this); + this.r = Class.forName("ReflectTest$R", true, this); + } + + Method findMethod() throws ReflectiveOperationException { + return c.getMethod("m", p, q); + } + } +} diff --git a/test/jdk/java/lang/reflect/callerCache/ReflectTest.java b/test/jdk/java/lang/reflect/callerCache/ReflectTest.java new file mode 100644 index 00000000000..91e882112cc --- /dev/null +++ b/test/jdk/java/lang/reflect/callerCache/ReflectTest.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, 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. + */ + +public class ReflectTest { + public static class P { + } + public static class Q { + } + public static class R { + } + + public R m(P p, Q q) { + return new R(); + } +} diff --git a/test/jdk/java/lang/reflect/classInitialization/ExceptionInClassInitialization.java b/test/jdk/java/lang/reflect/classInitialization/ExceptionInClassInitialization.java new file mode 100644 index 00000000000..64f3fa17f63 --- /dev/null +++ b/test/jdk/java/lang/reflect/classInitialization/ExceptionInClassInitialization.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021, 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 + * @build Initializer Test ExceptionInClassInitialization + * @run main ExceptionInClassInitialization + * @summary ensure InvocationTargetException thrown due to the initialization of + * the declaring class wrapping with the proper cause + */ + +import java.lang.reflect.InvocationTargetException; + +public class ExceptionInClassInitialization { + public static void main(String... argv) throws ReflectiveOperationException { + Class c = Class.forName("Initializer"); + testExecMethod(c); + testFieldAccess(c); + } + + static void testExecMethod(Class cls) throws ReflectiveOperationException { + try { + cls.getDeclaredMethod("execMethod").invoke(null); + throw new RuntimeException("InvocationTargetException not thrown"); + } catch (InvocationTargetException e) { + // InvocationTargetException wraps the exception that was thrown while reflection. + Throwable t = e.getCause(); + if (t instanceof ExceptionInInitializerError eiie) { + if (eiie.getCause() instanceof MyException) { + return; + } + throw new RuntimeException("ExceptionInInitializerError due to other exception than MyException!", eiie); + } + throw new RuntimeException("InvocationTargetException was thrown not due to error while initialization!", e); + } + } + + static void testFieldAccess(Class cls) throws ReflectiveOperationException { + try { + cls.getDeclaredMethod("fieldAccess").invoke(null); + throw new RuntimeException("InvocationTargetException not thrown"); + } catch (InvocationTargetException e) { + // the class initialization was run and failed. NoClassDefFoundError + // should be thrown in this second attempt. + Throwable t = e.getCause(); + if (t instanceof NoClassDefFoundError ncdfe) { + t = t.getCause(); + if (t instanceof ExceptionInInitializerError eiie) { + return; + } + } + throw new RuntimeException("InvocationTargetException was thrown not due to error while initialization!", e); + } + } + +} diff --git a/test/jdk/java/lang/reflect/classInitialization/Initializer.java b/test/jdk/java/lang/reflect/classInitialization/Initializer.java new file mode 100644 index 00000000000..072d14d509e --- /dev/null +++ b/test/jdk/java/lang/reflect/classInitialization/Initializer.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021, 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. + */ + +class Initializer { + static void fieldAccess() throws Throwable { + Class testedClass = Class.forName("Test", false, Initializer.class.getClassLoader()); + testedClass.getDeclaredField("field").set(testedClass, 1); + } + + static void execMethod() throws Throwable { + Class testedClass = Class.forName("Test", false, Initializer.class.getClassLoader()); + testedClass.getDeclaredMethod("method").invoke(null); + } +} diff --git a/test/jdk/java/lang/reflect/classInitialization/Test.java b/test/jdk/java/lang/reflect/classInitialization/Test.java new file mode 100644 index 00000000000..1d5e4e52630 --- /dev/null +++ b/test/jdk/java/lang/reflect/classInitialization/Test.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021, 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. + */ + +class MyException extends RuntimeException {} + +class SuperTest { + static { + if (true) { + throw new MyException(); + } + } +} + +class Test extends SuperTest { + + static int field = 0; + + static void method() {}; + + static { + if (true) { + throw new OutOfMemoryError(); + } + } +} diff --git a/test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java b/test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java index cae2f84be61..35dfb8d19c3 100644 --- a/test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java +++ b/test/jdk/jdk/internal/reflect/CallerSensitive/CheckCSMs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -22,6 +22,8 @@ */ import com.sun.tools.classfile.*; + +import static com.sun.tools.classfile.AccessFlags.ACC_PRIVATE; import static com.sun.tools.classfile.ConstantPool.*; import java.io.File; import java.io.IOException; @@ -33,10 +35,13 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -62,13 +67,21 @@ public class CheckCSMs { // The goal is to remove this list of Non-final instance @CS methods // over time. Do not add any new one to this list. private static Set KNOWN_NON_FINAL_CSMS = - Set.of("java/io/ObjectStreamField#getType ()Ljava/lang/Class;", - "java/io/ObjectStreamClass#forClass ()Ljava/lang/Class;", - "java/lang/Runtime#load (Ljava/lang/String;)V", - "java/lang/Runtime#loadLibrary (Ljava/lang/String;)V", - "java/lang/Thread#getContextClassLoader ()Ljava/lang/ClassLoader;", - "javax/sql/rowset/serial/SerialJavaObject#getFields ()[Ljava/lang/reflect/Field;" - ); + Set.of("java/io/ObjectStreamField#getType ()Ljava/lang/Class;", + "java/io/ObjectStreamClass#forClass ()Ljava/lang/Class;", + "java/lang/Runtime#load (Ljava/lang/String;)V", + "java/lang/Runtime#loadLibrary (Ljava/lang/String;)V", + "java/lang/Thread#getContextClassLoader ()Ljava/lang/ClassLoader;", + "javax/sql/rowset/serial/SerialJavaObject#getFields ()[Ljava/lang/reflect/Field;" + ); + + // These non-static non-final methods must not have @CallerSensitiveAdapter + // methods that takes an additional caller class parameter. + private static Set UNSUPPORTED_VIRTUAL_METHODS = + Set.of("java/io/ObjectStreamField#getType (Ljava/lang/Class;)Ljava/lang/Class;", + "java/lang/Thread#getContextClassLoader (Ljava/lang/Class;)Ljava/lang/ClassLoader;", + "javax/sql/rowset/serial/SerialJavaObject#getFields (Ljava/lang/Class;)[Ljava/lang/reflect/Field;" + ); public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals("--list")) { @@ -84,9 +97,19 @@ public class CheckCSMs { result.stream().sorted() .collect(Collectors.joining("\n", "\n", ""))); } + + // check if all csm methods with a trailing Class parameter are supported + checkCSMs.csmWithCallerParameter.values().stream() + .flatMap(Set::stream) + .forEach(m -> { + if (UNSUPPORTED_VIRTUAL_METHODS.contains(m)) + throw new RuntimeException("Unsupported alternate csm adapter: " + m); + }); } private final Set nonFinalCSMs = new ConcurrentSkipListSet<>(); + private final Map> csmWithCallerParameter = new ConcurrentHashMap<>(); + private final ReferenceFinder finder; public CheckCSMs() { this.finder = new ReferenceFinder(getFilter(), getVisitor()); @@ -129,9 +152,7 @@ public class CheckCSMs { m.getName(cf.constant_pool).equals("getCallerClass")) return; - String name = String.format("%s#%s %s", cf.getName(), - m.getName(cf.constant_pool), - m.descriptor.getValue(cf.constant_pool)); + String name = methodSignature(cf, m); if (!CheckCSMs.isStaticOrFinal(cf, m, cf.constant_pool)) { System.err.println("Unsupported @CallerSensitive: " + name); nonFinalCSMs.add(name); @@ -140,6 +161,15 @@ public class CheckCSMs { System.out.format("@CS %s%n", name); } } + + // find the adapter implementation for CSM with the caller parameter + if (!csmWithCallerParameter.containsKey(cf.getName())) { + Set methods = Arrays.stream(cf.methods) + .filter(m0 -> csmWithCallerParameter(cf, m, m0)) + .map(m0 -> methodSignature(cf, m0)) + .collect(Collectors.toSet()); + csmWithCallerParameter.put(cf.getName(), methods); + } } catch (ConstantPoolException ex) { throw new RuntimeException(ex); } @@ -147,8 +177,58 @@ public class CheckCSMs { }; } + private static String methodSignature(ClassFile cf, Method m) { + try { + return String.format("%s#%s %s", cf.getName(), + m.getName(cf.constant_pool), + m.descriptor.getValue(cf.constant_pool)); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + private static boolean csmWithCallerParameter(ClassFile cf, Method csm, Method m) { + ConstantPool cp = cf.constant_pool; + try { + int csmParamCount = csm.descriptor.getParameterCount(cp); + int paramCount = m.descriptor.getParameterCount(cp); + // an adapter method must have the same name and return type and a trailing Class parameter + if (!(csm.getName(cp).equals(m.getName(cp)) && + paramCount == (csmParamCount+1) && + m.descriptor.getReturnType(cp).equals(csm.descriptor.getReturnType(cp)))) { + return false; + } + // the descriptor of the adapter method must have the parameters + // of the caller-sensitive method and an additional Class parameter + String csmDesc = csm.descriptor.getParameterTypes(cp); + String desc = m.descriptor.getParameterTypes(cp); + int index = desc.indexOf(", java.lang.Class)"); + if (index == -1) { + index = desc.indexOf("java.lang.Class)"); + if (index == -1) return false; + } + String s = desc.substring(0, index) + ")"; + if (s.equals(csmDesc)) { + if (!m.access_flags.is(ACC_PRIVATE)) { + throw new RuntimeException(methodSignature(cf, m) + " adapter method for " + + methodSignature(cf, csm) + " must be private"); + } + if (!isCallerSensitiveAdapter(m, cp)) { + throw new RuntimeException(methodSignature(cf, m) + " adapter method for " + + methodSignature(cf, csm) + " must be annotated with @CallerSensitiveAdapter"); + } + return true; + } + } catch (ConstantPoolException|Descriptor.InvalidDescriptor e) { + throw new RuntimeException(e); + } + return false; + } + private static final String CALLER_SENSITIVE_ANNOTATION = "Ljdk/internal/reflect/CallerSensitive;"; + private static final String CALLER_SENSITIVE_ADAPTER_ANNOTATION + = "Ljdk/internal/reflect/CallerSensitiveAdapter;"; private static boolean isCallerSensitive(Method m, ConstantPool cp) throws ConstantPoolException @@ -167,6 +247,23 @@ public class CheckCSMs { return false; } + private static boolean isCallerSensitiveAdapter(Method m, ConstantPool cp) + throws ConstantPoolException + { + RuntimeAnnotations_attribute attr = + (RuntimeAnnotations_attribute)m.attributes.get(Attribute.RuntimeInvisibleAnnotations); + if (attr != null) { + for (int i = 0; i < attr.annotations.length; i++) { + Annotation ann = attr.annotations[i]; + String annType = cp.getUTF8Value(ann.type_index); + if (CALLER_SENSITIVE_ADAPTER_ANNOTATION.equals(annType)) { + return true; + } + } + } + return false; + } + private static boolean isStaticOrFinal(ClassFile cf, Method m, ConstantPool cp) throws ConstantPoolException { diff --git a/test/jdk/jdk/internal/reflect/Reflection/GetCallerClass.java b/test/jdk/jdk/internal/reflect/Reflection/GetCallerClass.java index 163a80ad088..697523c9b89 100644 --- a/test/jdk/jdk/internal/reflect/Reflection/GetCallerClass.java +++ b/test/jdk/jdk/internal/reflect/Reflection/GetCallerClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -23,15 +23,69 @@ package boot; +import static java.lang.System.out; + +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public class GetCallerClass { + + public Class missingCallerSensitiveAnnotation() { + return jdk.internal.reflect.Reflection.getCallerClass(); + } + + @jdk.internal.reflect.CallerSensitive + public Class getCallerClass() { + var caller = jdk.internal.reflect.Reflection.getCallerClass(); + out.println("caller: " + caller); + out.println(StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(toStackTrace())); + return caller; + } + + private Class getCallerClass(Class caller) { + out.println("caller: " + caller); + out.println(StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(toStackTrace())); + return caller; + } + @jdk.internal.reflect.CallerSensitive - public ClassLoader getCallerLoader() { - Class c = jdk.internal.reflect.Reflection.getCallerClass(); - return c.getClassLoader(); + public static Class getCallerClassStatic() { + var caller = jdk.internal.reflect.Reflection.getCallerClass(); + out.println("caller: " + caller); + out.println(StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(toStackTrace())); + return caller; } - public ClassLoader missingCallerSensitiveAnnotation() { - Class c = jdk.internal.reflect.Reflection.getCallerClass(); - return c.getClassLoader(); + private static Class getCallerClassStatic(Class caller) { + out.println("caller: " + caller); + out.println(StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(toStackTrace())); + return caller; + } + + @jdk.internal.reflect.CallerSensitive + public Class getCallerClassNoAlt() { + var caller = jdk.internal.reflect.Reflection.getCallerClass(); + out.println("caller: " + caller); + out.println(StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(toStackTrace())); + return caller; + } + + @jdk.internal.reflect.CallerSensitive + public static Class getCallerClassStaticNoAlt() { + var caller = jdk.internal.reflect.Reflection.getCallerClass(); + out.println("caller: " + caller); + out.println(StackWalker.getInstance(StackWalker.Option.SHOW_HIDDEN_FRAMES).walk(toStackTrace())); + return caller; + } + + private static Function, String> toStackTrace() { + return frames -> frames + .takeWhile( + frame -> !frame.getClassName().equals("GetCallerClassTest") || + !frame.getMethodName().equals("main")) + .map(Object::toString) + .collect(Collectors.joining("\n ", " ", "\n")); } } + diff --git a/test/jdk/jdk/internal/reflect/Reflection/GetCallerClassTest.java b/test/jdk/jdk/internal/reflect/Reflection/GetCallerClassTest.java index 2ba38c4b4bf..e3da595c782 100644 --- a/test/jdk/jdk/internal/reflect/Reflection/GetCallerClassTest.java +++ b/test/jdk/jdk/internal/reflect/Reflection/GetCallerClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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,33 +25,78 @@ * @test * @bug 8010117 * @summary Test if the VM enforces Reflection.getCallerClass - * be called by methods annotated with CallerSensitive + * be called by system methods annotated with CallerSensitive plus + * test reflective and method handle based invocation of caller-sensitive + * methods with or without the CSM adapter method * @modules java.base/jdk.internal.reflect * @build SetupGetCallerClass boot.GetCallerClass * @run driver SetupGetCallerClass - * @run main/othervm -Xbootclasspath/a:bcp GetCallerClassTest + * @run main/othervm -Xbootclasspath/a:bcp -Djdk.reflect.useDirectMethodHandle=true GetCallerClassTest + */ + +/* + * @test + * @summary Verify the new NativeAccessor + * @modules java.base/jdk.internal.reflect + * @build SetupGetCallerClass boot.GetCallerClass + * @run driver SetupGetCallerClass + * @run main/othervm -Xbootclasspath/a:bcp -Djdk.reflect.useDirectMethodHandle=true -Djdk.reflect.useNativeAccessorOnly=true GetCallerClassTest + */ + +/* + * @test + * @summary Verify NativeMethodAccessorImpl + * @modules java.base/jdk.internal.reflect + * @build SetupGetCallerClass boot.GetCallerClass + * @run driver SetupGetCallerClass + * @run main/othervm -Xbootclasspath/a:bcp -Djdk.reflect.useDirectMethodHandle=false -Dsun.reflect.noInflation=false GetCallerClassTest + */ + +/* + * @test + * @summary Verify the old generated MethodAccessor + * @modules java.base/jdk.internal.reflect + * @build SetupGetCallerClass boot.GetCallerClass + * @run driver SetupGetCallerClass + * @run main/othervm -Xbootclasspath/a:bcp -Djdk.reflect.useDirectMethodHandle=false -Dsun.reflect.noInflation=true GetCallerClassTest */ import boot.GetCallerClass; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; import java.lang.reflect.*; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; public class GetCallerClassTest { - private final GetCallerClass gcc; // boot.GetCallerClass is in bootclasspath - GetCallerClassTest() { - this.gcc = new GetCallerClass(); - } + // boot.GetCallerClass is in bootclasspath + private static final Class gccCl = GetCallerClass.class; + private final GetCallerClass gcc = new GetCallerClass(); public static void main(String[] args) throws Exception { GetCallerClassTest gcct = new GetCallerClassTest(); - // ensure methods are annotated with @CallerSensitive - ensureAnnotationPresent(boot.GetCallerClass.class, "getCallerLoader", true); + // ensure methods are annotated with @CallerSensitive and verify Reflection.isCallerSensitive() ensureAnnotationPresent(GetCallerClassTest.class, "testNonSystemMethod", false); - // call Reflection.getCallerClass from bootclasspath with and without @CS - gcct.testCallerSensitiveMethods(); + + ensureAnnotationPresent(gccCl, "getCallerClass", true); + ensureAnnotationPresent(gccCl, "getCallerClassStatic", true); + ensureAnnotationPresent(gccCl, "getCallerClassNoAlt", true); + ensureAnnotationPresent(gccCl, "getCallerClassStaticNoAlt", true); + + // call Reflection.getCallerClass from bootclasspath without @CS + gcct.testMissingCallerSensitiveAnnotation(); // call Reflection.getCallerClass from classpath with @CS gcct.testNonSystemMethod(); + // call Reflection.getCallerClass from bootclasspath with @CS + gcct.testCallerSensitiveMethods(); + // call @CS methods using reflection + gcct.testCallerSensitiveMethodsUsingReflection(); + // call @CS methods using method handles + gcct.testCallerSensitiveMethodsUsingMethodHandles(); + // call @CS methods using reflection but call Method.invoke with a method handle + gcct.testCallerSensitiveMethodsUsingMethodHandlesAndReflection(); } private static void ensureAnnotationPresent(Class c, String name, boolean cs) @@ -67,58 +112,170 @@ public class GetCallerClassTest { } } - private void testCallerSensitiveMethods() { + private void testMissingCallerSensitiveAnnotation() { + System.out.println("\ntestMissingCallerSensitiveAnnotation..."); try { - ClassLoader cl = gcc.getCallerLoader(); - if (cl != GetCallerClassTest.class.getClassLoader()) { - throw new RuntimeException("mismatched class loader"); - } gcc.missingCallerSensitiveAnnotation(); - throw new RuntimeException("getCallerLoader not marked with @CallerSensitive"); + throw new RuntimeException("shouldn't have succeeded"); } catch (InternalError e) { - StackTraceElement[] stackTrace = e.getStackTrace(); - checkStackTrace(stackTrace, e); - if (!stackTrace[1].getClassName().equals(GetCallerClass.class.getName()) || - !stackTrace[1].getMethodName().equals("missingCallerSensitiveAnnotation")) { - throw new RuntimeException("Unexpected error: " + e.getMessage(), e); - } - if (!stackTrace[2].getClassName().equals(GetCallerClassTest.class.getName()) || - !stackTrace[2].getMethodName().equals("testCallerSensitiveMethods")) { - throw new RuntimeException("Unexpected error: " + e.getMessage(), e); + if (e.getMessage().startsWith("CallerSensitive annotation expected")) { + System.out.println("Expected error: " + e.getMessage()); + } else { + throw e; } - System.out.println("Expected error: " + e.getMessage()); } } @CallerSensitive private void testNonSystemMethod() { + System.out.println("\ntestNonSystemMethod..."); try { Class c = Reflection.getCallerClass(); - throw new RuntimeException("@CallerSensitive testNonSystemMethods not supported"); + throw new RuntimeException("shouldn't have succeeded"); } catch (InternalError e) { - StackTraceElement[] stackTrace = e.getStackTrace(); - checkStackTrace(stackTrace, e); - if (!stackTrace[1].getClassName().equals(GetCallerClassTest.class.getName()) || - !stackTrace[1].getMethodName().equals("testNonSystemMethod")) { - throw new RuntimeException("Unexpected error: " + e.getMessage(), e); - } - if (!stackTrace[2].getClassName().equals(GetCallerClassTest.class.getName()) || - !stackTrace[2].getMethodName().equals("main")) { - throw new RuntimeException("Unexpected error: " + e.getMessage(), e); + if (e.getMessage().startsWith("CallerSensitive annotation expected")) { + System.out.println("Expected error: " + e.getMessage()); + } else { + throw e; } - System.out.println("Expected error: " + e.getMessage()); } } - private void checkStackTrace(StackTraceElement[] stackTrace, Error e) { - if (stackTrace.length < 3) { - throw new RuntimeException("Unexpected error: " + e.getMessage(), e); + private void testCallerSensitiveMethods() { + System.out.println(); + Class caller; + + caller = gcc.getCallerClass(); + if (caller != GetCallerClassTest.class) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = GetCallerClass.getCallerClassStatic(); + if (caller != GetCallerClassTest.class) { + throw new RuntimeException("mismatched caller: " + caller); + } + } + + private void testCallerSensitiveMethodsUsingReflection() { + System.out.println(); + + try { + Class caller; + + caller = (Class) gccCl.getDeclaredMethod("getCallerClass").invoke(gcc); + if (caller != GetCallerClassTest.class) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) gccCl.getDeclaredMethod("getCallerClassStatic").invoke(null); + if (caller != GetCallerClassTest.class) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) gccCl.getDeclaredMethod("getCallerClassNoAlt").invoke(gcc); + if (!caller.isNestmateOf(GetCallerClassTest.class)) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) gccCl.getDeclaredMethod("getCallerClassStaticNoAlt").invoke(null); + if (!caller.isNestmateOf(GetCallerClassTest.class)) { + throw new RuntimeException("mismatched caller: " + caller); + } + } catch (ReflectiveOperationException|SecurityException e) { + throw new RuntimeException(e); } + } + + private void testCallerSensitiveMethodsUsingMethodHandles() { + System.out.println(); + + try { + MethodHandles.Lookup lookup = MethodHandles.lookup(); + MethodType mt = MethodType.methodType(Class.class); + Class caller; + + caller = (Class) lookup.findVirtual(gccCl, "getCallerClass", mt).invokeExact(gcc); + if (caller != GetCallerClassTest.class) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) lookup.findStatic(gccCl, "getCallerClassStatic", mt).invokeExact(); + if (caller != GetCallerClassTest.class) { + throw new RuntimeException("mismatched caller: " + caller); + } - if (!stackTrace[0].getClassName().equals("jdk.internal.reflect.Reflection") || - !stackTrace[0].getMethodName().equals("getCallerClass")) { - throw new RuntimeException("Unexpected error: " + e.getMessage(), e); + caller = (Class) lookup.findVirtual(gccCl, "getCallerClassNoAlt", mt).invokeExact(gcc); + if (!caller.isNestmateOf(GetCallerClassTest.class)) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) lookup.findStatic(gccCl, "getCallerClassStaticNoAlt", mt).invokeExact(); + if (!caller.isNestmateOf(GetCallerClassTest.class)) { + throw new RuntimeException("mismatched caller: " + caller); + } + } catch (RuntimeException | Error e) { + throw e; + } catch (Throwable e) { + throw new RuntimeException(e); } + } + + private static final Object[] EMPTY_ARRAY = new Object[0]; + + private void testCallerSensitiveMethodsUsingMethodHandlesAndReflection() { + // In the old implementation, the caller returned is java.lang.invoke.Method + // since it looks up the caller through stack walking. + // The new implementation uses the special calling sequence and Method::invoke + // defines an adapter method such that the stack walking is done only once + // using the same caller class. + String s = System.getProperty("jdk.reflect.useDirectMethodHandle", "true"); + boolean newImpl = Boolean.valueOf(s); + Class expectedCaller = newImpl ? GetCallerClassTest.class : Method.class; + + System.out.println(); + try { + MethodHandle methodInvokeMh = MethodHandles + .lookup() + .findVirtual(Method.class, "invoke", MethodType.methodType(Object.class, Object.class, Object[].class)); + + Class caller; + caller = (Class) methodInvokeMh.invoke(gccCl.getDeclaredMethod("getCallerClass"), gcc, EMPTY_ARRAY); + if (caller != expectedCaller) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) methodInvokeMh.invoke(gccCl.getDeclaredMethod("getCallerClassStatic"), null, EMPTY_ARRAY); + if (caller != expectedCaller) { + throw new RuntimeException("mismatched caller: " + caller); + } + + caller = (Class) methodInvokeMh.invoke(gccCl.getDeclaredMethod("getCallerClassNoAlt"), gcc, EMPTY_ARRAY); + if (newImpl) { + if (!caller.isNestmateOf(GetCallerClassTest.class)) { + throw new RuntimeException("mismatched caller: " + caller); + } + } else { + if (caller != expectedCaller) { + throw new RuntimeException("mismatched caller: " + caller); + } + } + + caller = (Class) methodInvokeMh.invoke(gccCl.getDeclaredMethod("getCallerClassStaticNoAlt"), null, EMPTY_ARRAY); + if (newImpl) { + if (!caller.isNestmateOf(GetCallerClassTest.class)) { + throw new RuntimeException("mismatched caller: " + caller); + } + } else { + if (caller != expectedCaller) { + throw new RuntimeException("mismatched caller: " + caller); + } + } + } catch (RuntimeException | Error e) { + throw e; + } catch (Throwable e) { + throw new RuntimeException(e); + } } } + diff --git a/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java b/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java index 08a9a68f3ac..7a5bf1e42c4 100644 --- a/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java +++ b/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java @@ -78,7 +78,9 @@ public final class TestHiddenMethod { System.out.println("visibleEvent:" + visibleEvent); assertTrue(hasHiddenStackFrame(hiddenEvent), "No hidden frame in hidden event: " + hiddenEvent); - assertFalse(hasHiddenStackFrame(visibleEvent), "Hidden frame in visible event: " + visibleEvent); + + // Temporary disable this test until JDK-8272064 is resolved. + // assertFalse(hasHiddenStackFrame(visibleEvent), "Hidden frame in visible event: " + visibleEvent); } } diff --git a/test/langtools/jdk/jshell/ExceptionsTest.java b/test/langtools/jdk/jshell/ExceptionsTest.java index ed4a5ed44bd..765c3696f07 100644 --- a/test/langtools/jdk/jshell/ExceptionsTest.java +++ b/test/langtools/jdk/jshell/ExceptionsTest.java @@ -245,6 +245,7 @@ public class ExceptionsTest extends KullaTesting { new ExceptionInfo(ExceptionInInitializerError.class, null, new StackTraceElement("java.lang.Class", "forName0", "Class.java", -2), new StackTraceElement("java.lang.Class", "forName", "Class.java", -2), + new StackTraceElement("java.lang.Class", "forName", "Class.java", -2), newStackTraceElement("", "", se.snippet(), 1))); } diff --git a/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionColdstartBenchmark.java b/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionColdstartBenchmark.java index 743e8842dbb..ff3259547ff 100644 --- a/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionColdstartBenchmark.java +++ b/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionColdstartBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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,7 +42,7 @@ import java.util.concurrent.TimeUnit; @BenchmarkMode(Mode.SingleShotTime) @OutputTimeUnit(TimeUnit.MICROSECONDS) @State(Scope.Benchmark) -@Fork(value = 30, warmups = 10) +@Fork(value = 10, warmups = 0) public class ReflectionColdstartBenchmark { static class Nested { @@ -121,9 +121,22 @@ public class ReflectionColdstartBenchmark { } @Benchmark - public void invokeMethods(Blackhole bh) throws ReflectiveOperationException { + public void invokeMethods() throws ReflectiveOperationException { + // As this is testing warmup, JITs are unlikely to progress to the + // point where the lack of a blackhole might lead to DCE. Omitting it + // makes it easier to test this code minimal use of JMH code for (Method m : methods) { - bh.consume(m.invoke(null, arg)); + m.invoke(null, arg); } } + + /** + * Runs invokeMethods once without any JMH interaction, acting as an + * independent startup benchmark. + */ + public static void main(String ... args) throws Exception { + var coldstart = new ReflectionColdstartBenchmark(); + coldstart.setup(); + coldstart.invokeMethods(); + } } diff --git a/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionSpeedBenchmark.java b/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionSpeedBenchmark.java index c2cdbb4cc21..575f234b509 100644 --- a/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionSpeedBenchmark.java +++ b/test/micro/org/openjdk/bench/java/lang/reflect/ReflectionSpeedBenchmark.java @@ -24,11 +24,13 @@ package org.openjdk.bench.java.lang.reflect; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.CompilerControl; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; @@ -43,9 +45,9 @@ import java.util.concurrent.TimeUnit; /** * Benchmark measuring field access and method invocation using different conditions: *

      - *
    • Const - Method/Field is constant-foldable
    • - *
    • Var - Method/Field is single-instance but not constant-foldable
    • - *
    • Poly - multiple Method/Field instances used at single call-site
    • + *
    • Const - Constructor/Method/Field is constant-foldable
    • + *
    • Var - Constructor/Method/Field is single-instance but not constant-foldable
    • + *
    • Poly - multiple Constructor/Method/Field instances used at single call-site
    • *
    */ @BenchmarkMode(Mode.AverageTime) @@ -78,8 +80,8 @@ public class ReflectionSpeedBenchmark { static { try { - staticMethodConst = staticMethodVar = ReflectionSpeedBenchmark.class.getDeclaredMethod("sumStatic", int.class, int.class); - instanceMethodConst = instanceMethodVar = ReflectionSpeedBenchmark.class.getDeclaredMethod("sumInstance", int.class, int.class); + staticMethodConst = staticMethodVar = ReflectionSpeedBenchmark.class.getDeclaredMethod("sumStatic", Integer.class, Integer.class); + instanceMethodConst = instanceMethodVar = ReflectionSpeedBenchmark.class.getDeclaredMethod("sumInstance", Integer.class, Integer.class); staticFieldConst = staticFieldVar = ReflectionSpeedBenchmark.class.getDeclaredField("staticField"); instanceFieldConst = instanceFieldVar = ReflectionSpeedBenchmark.class.getDeclaredField("instanceField"); @@ -268,7 +270,7 @@ public class ReflectionSpeedBenchmark { } private int rnd = 0; - private int a, b; + private Integer a, b; private Object o; private NestedInstance instance; @@ -276,58 +278,126 @@ public class ReflectionSpeedBenchmark { return rnd += 7; } + // @Param({"true", "false"}) + private boolean polluteProfile = true; + @Setup(Level.Iteration) public void setup() { a = nextRnd(); b = nextRnd(); o = new Object(); instance = new NestedInstance(); + + if (polluteProfile) { + try { + Constructor ctor = ReflectionSpeedBenchmark.class.getDeclaredConstructor(Integer.class); + Method test1 = ReflectionSpeedBenchmark.class.getDeclaredMethod("test1", Object.class); + Method test2 = ReflectionSpeedBenchmark.class.getDeclaredMethod("test2", Object.class, Object.class); + Field f = ReflectionSpeedBenchmark.class.getDeclaredField("testField"); + for (int i = 0; i < 20_000; i++) { + invokeHelper2(staticMethodVar, null, a, b); + invokeHelper2(instanceMethodVar, this, a, b); + invokeHelper2(test2, null, a, b); + invokeHelper1(staticMethodsPoly[i & (staticMethodsPoly.length - 1)], instance, o); + invokeHelper1(instanceMethodsPoly[i & (instanceMethodsPoly.length - 1)], instance, o); + invokeHelper1(test1, null, a); + + newInstanceHelper(constructorVar, constructorArgs); + int index = i & (constructorsPoly.length - 1); + newInstanceHelper(constructorsPoly[index], constructorsArgsPoly[index]); + newInstanceHelper(ctor, new Object[]{a}); + + getIntHelper(staticFieldVar, null); + getIntHelper(instanceFieldVar, this); + getDoubleHelper(f, null); + getHelper(staticFieldsPoly[i & (staticFieldsPoly.length - 1)], null); + getHelper(instanceFieldsPoly[i & (instanceFieldsPoly.length - 1)], instance); + } + } catch (ReflectiveOperationException e) { + throw new InternalError(e); + } + } } - public static int sumStatic(int a, int b) { - return a + b; + public static Integer sumStatic(Integer a, Integer b) { + return a; // a + b; } - public int sumInstance(int a, int b) { - return a + b; + public Integer sumInstance(Integer a, Integer b) { + return a; // a + b; } public static int staticField; public int instanceField; + public ReflectionSpeedBenchmark() {} + + // used for polluting the profile + private ReflectionSpeedBenchmark(Integer a) {} + static void test1(Object a) {} + static void test2(Object a, Object b) {} + static double testField; // methods + @CompilerControl(CompilerControl.Mode.INLINE) + static Object invokeHelper1(Method m, Object recv, Object arg1) throws InvocationTargetException, IllegalAccessException { + return m.invoke(recv, arg1); + } + + @CompilerControl(CompilerControl.Mode.INLINE) + static Object invokeHelper2(Method m, Object recv, Object arg1, Object arg2) throws InvocationTargetException, IllegalAccessException { + return m.invoke(recv, arg1, arg2); + } + + @CompilerControl(CompilerControl.Mode.INLINE) + static Object newInstanceHelper(Constructor ctor, Object[] args) throws InvocationTargetException, IllegalAccessException, InstantiationException { + return ctor.newInstance(args); + } + + @CompilerControl(CompilerControl.Mode.INLINE) + static int getIntHelper(Field f, Object recv) throws IllegalAccessException { + return f.getInt(recv); + } + @CompilerControl(CompilerControl.Mode.INLINE) + static double getDoubleHelper(Field f, Object recv) throws IllegalAccessException { + return f.getDouble(recv); + } + + @CompilerControl(CompilerControl.Mode.INLINE) + static Object getHelper(Field f, Object recv) throws IllegalAccessException { + return f.get(recv); + } @Benchmark - public int staticMethodConst() { + public Object staticMethodConst() { try { - return (Integer) staticMethodConst.invoke(null, a, b); + return invokeHelper2(staticMethodConst, null, a, b); } catch (IllegalAccessException | InvocationTargetException e) { throw new AssertionError(e); } } @Benchmark - public int instanceMethodConst() { + public Object instanceMethodConst() { try { - return (Integer) instanceMethodConst.invoke(this, a, b); + return invokeHelper2(instanceMethodConst, this, a, b); } catch (IllegalAccessException | InvocationTargetException e) { throw new AssertionError(e); } } @Benchmark - public int staticMethodVar() { + public Object staticMethodVar() { try { - return (Integer) staticMethodVar.invoke(null, a, b); + return invokeHelper2(staticMethodVar, null, a, b); } catch (IllegalAccessException | InvocationTargetException e) { throw new AssertionError(e); } } @Benchmark - public int instanceMethodVar() { + public Object instanceMethodVar() { try { - return (Integer) instanceMethodVar.invoke(this, a, b); + return invokeHelper2(instanceMethodVar, this, a, b); } catch (IllegalAccessException | InvocationTargetException e) { throw new AssertionError(e); } @@ -336,7 +406,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public Object staticMethodPoly() { try { - return staticMethodsPoly[nextRnd() & (staticMethodsPoly.length - 1)].invoke(null, o); + return invokeHelper1(staticMethodsPoly[nextRnd() & (staticMethodsPoly.length - 1)], null, o); } catch (IllegalAccessException | InvocationTargetException e) { throw new AssertionError(e); } @@ -345,7 +415,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public Object instanceMethodPoly() { try { - return instanceMethodsPoly[nextRnd() & (instanceMethodsPoly.length - 1)].invoke(instance, o); + return invokeHelper1(instanceMethodsPoly[nextRnd() & (instanceMethodsPoly.length - 1)], instance, o); } catch (IllegalAccessException | InvocationTargetException e) { throw new AssertionError(e); } @@ -356,7 +426,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public int staticFieldConst() { try { - return staticFieldConst.getInt(null); + return getIntHelper(staticFieldConst, null); } catch (IllegalAccessException e) { throw new AssertionError(e); } @@ -365,7 +435,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public int instanceFieldConst() { try { - return instanceFieldConst.getInt(this); + return getIntHelper(instanceFieldConst, this); } catch (IllegalAccessException e) { throw new AssertionError(e); } @@ -374,7 +444,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public int staticFieldVar() { try { - return staticFieldVar.getInt(null); + return getIntHelper(staticFieldVar, null); } catch (IllegalAccessException e) { throw new AssertionError(e); } @@ -383,7 +453,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public int instanceFieldVar() { try { - return instanceFieldVar.getInt(this); + return getIntHelper(instanceFieldVar, this); } catch (IllegalAccessException e) { throw new AssertionError(e); } @@ -392,7 +462,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public Object staticFieldPoly() { try { - return staticFieldsPoly[nextRnd() & (staticFieldsPoly.length - 1)].get(null); + return getHelper(staticFieldsPoly[nextRnd() & (staticFieldsPoly.length - 1)], null); } catch (IllegalAccessException e) { throw new AssertionError(e); } @@ -401,7 +471,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public Object instanceFieldPoly() { try { - return instanceFieldsPoly[nextRnd() & (instanceFieldsPoly.length - 1)].get(instance); + return getHelper(instanceFieldsPoly[nextRnd() & (instanceFieldsPoly.length - 1)], instance); } catch (IllegalAccessException e) { throw new AssertionError(e); } @@ -412,7 +482,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public Object constructorConst() { try { - return constructorConst.newInstance(constructorArgs); + return newInstanceHelper(constructorConst, constructorArgs); } catch (ReflectiveOperationException e) { throw new AssertionError(e); } @@ -421,7 +491,7 @@ public class ReflectionSpeedBenchmark { @Benchmark public Object constructorVar() { try { - return constructorVar.newInstance(constructorArgs); + return newInstanceHelper(constructorVar, constructorArgs); } catch (ReflectiveOperationException e) { throw new AssertionError(e); } @@ -431,9 +501,9 @@ public class ReflectionSpeedBenchmark { public Object constructorPoly() { try { int i = nextRnd() & (constructorsPoly.length - 1); - return constructorsPoly[i].newInstance(constructorsArgsPoly[i]); + return newInstanceHelper(constructorsPoly[i], constructorsArgsPoly[i]); } catch (ReflectiveOperationException e) { throw new AssertionError(e); } } -} \ No newline at end of file +} -- GitLab From 48f3fcab518ccea4dbbc856132f82407f7974028 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 28 Oct 2021 22:11:03 +0000 Subject: [PATCH 112/890] 8275308: Add valueOf(Runtime.Version) factory to SourceVersion Reviewed-by: jjg --- .../javax/lang/model/SourceVersion.java | 54 ++++++++++++++++ .../processing/model/TestSourceVersion.java | 63 ++++++++++++++++++- 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index 410d9c6c572..c1914b21782 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -492,4 +492,58 @@ public enum SourceVersion { return false; } } + + /** + * {@return the latest source version that is usable under the + * runtime version argument} If the runtime version's {@linkplain + * Runtime.Version#feature() feature} is greater than the feature + * of the {@linkplain #runtimeVersion() runtime version} of the + * {@linkplain #latest() latest source version}, an {@code + * IllegalArgumentException} is thrown. + * + *

    Because the source versions of the Java programming language + * have so far followed a linear progression, only the feature + * component of a runtime version is queried to determine the + * mapping to a source version. If that linearity changes in the + * future, other components of the runtime version may influence + * the result. + * + * @apiNote + * An expression to convert from a string value, for example + * {@code "17"}, to the corresponding source version, {@code + * RELEASE_17}, is: + * + *

    {@code SourceVersion.valueOf(Runtime.Version.parse("17"))}
    + * + * @param rv runtime version to map to a source version + * @throws IllegalArgumentException if the feature of version + * argument is greater than the feature of the platform version. + * @since 18 + */ + public static SourceVersion valueOf(Runtime.Version rv) { + // Could also implement this as a switch where a case was + // added with each new release. + return valueOf("RELEASE_" + rv.feature()); + } + + /** + * {@return the least runtime version that supports this source + * version; otherwise {@code null}} The returned runtime version + * has a {@linkplain Runtime.Version#feature() feature} large + * enough to support this source version and has no other elements + * set. + * + * Source versions greater than or equal to {@link RELEASE_6} + * have non-{@code null} results. + * @since 18 + */ + public Runtime.Version runtimeVersion() { + // The javax.lang.model API was added in JDK 6; for now, + // limiting supported range to 6 and up. + if (this.compareTo(RELEASE_6) >= 0) { + return Runtime.Version.parse(Integer.toString(ordinal())); + } else { + return null; + } + } } diff --git a/test/langtools/tools/javac/processing/model/TestSourceVersion.java b/test/langtools/tools/javac/processing/model/TestSourceVersion.java index 30d6af180b6..3a56bf76007 100644 --- a/test/langtools/tools/javac/processing/model/TestSourceVersion.java +++ b/test/langtools/tools/javac/processing/model/TestSourceVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 7025809 8028543 6415644 8028544 8029942 8187951 8193291 8196551 8233096 + * @bug 7025809 8028543 6415644 8028544 8029942 8187951 8193291 8196551 8233096 8275308 * @summary Test latest, latestSupported, underscore as keyword, etc. * @author Joseph D. Darcy * @modules java.compiler @@ -45,6 +45,8 @@ public class TestSourceVersion { testRestrictedKeywords(); testVar(); testYield(); + testValueOfRV(); + testRuntimeVersion(); } private static void testLatestSupported() { @@ -147,4 +149,61 @@ public class TestSourceVersion { " on " + version); } } + + /** + * Test that SourceVersion.valueOf() maps a Runtime.Version to a + * SourceVersion properly. The SourceVersion result is only a + * function of the feature() component of a Runtime.Version. + */ + private static void testValueOfRV() { + for (SourceVersion sv : SourceVersion.values()) { + if (sv == RELEASE_0) { + continue; + } else { + // Plain mapping; e.g. "17" -> RELEASE_17 + String featureBase = Integer.toString(sv.ordinal()); + checkValueOfResult(sv, featureBase); + + // More populated runtime version, N.N + checkValueOfResult(sv, featureBase + "." + featureBase); + } + } + + // Out of range test + try { + int latestFeature = SourceVersion.latest().runtimeVersion().feature(); + SourceVersion.valueOf(Runtime.Version.parse(Integer.toString(latestFeature +1))); + throw new RuntimeException("Should not reach"); + } catch (IllegalArgumentException iae) { + ; // Expected + } + } + + private static void checkValueOfResult(SourceVersion expected, String versionString) { + Runtime.Version rv = Runtime.Version.parse(versionString); + SourceVersion result = SourceVersion.valueOf(rv); + if (result != expected) { + throw new RuntimeException("Unexpected result " + result + + " of mapping Runtime.Version " + versionString + + " intead of " + expected); + } + } + + private static void testRuntimeVersion() { + for (SourceVersion sv : SourceVersion.values()) { + Runtime.Version result = sv.runtimeVersion(); + if (sv.compareTo(RELEASE_6) < 0) { + if (result != null) { + throw new RuntimeException("Unexpected result non-null " + result + + " as runtime version of " + sv); + } + } else { + Runtime.Version expected = Runtime.Version.parse(Integer.toString(sv.ordinal())); + if (!result.equals(expected)) { + throw new RuntimeException("Unexpected result " + result + + " as runtime version of " + sv); + } + } + } + } } -- GitLab From 21da2183875feca3dbf4f1bd875b268a7fc8d560 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Thu, 28 Oct 2021 22:24:56 +0000 Subject: [PATCH 113/890] 8274848: LambdaMetaFactory::metafactory on REF_invokeSpecial impl method has incorrect behavior Reviewed-by: psandoz, dlsmith --- .../AbstractValidatingLambdaMetafactory.java | 4 +- .../InvokeSpecialMethodTest.java | 133 ++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 test/jdk/java/lang/invoke/lambda/invokeSpecial/InvokeSpecialMethodTest.java diff --git a/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java b/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java index b1282970ccf..a9bfff152e6 100644 --- a/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java +++ b/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java @@ -26,6 +26,8 @@ package java.lang.invoke; import sun.invoke.util.Wrapper; +import java.lang.reflect.Modifier; + import static java.lang.invoke.MethodHandleInfo.*; import static sun.invoke.util.Wrapper.forPrimitiveType; import static sun.invoke.util.Wrapper.forWrapperType; @@ -157,7 +159,7 @@ import static sun.invoke.util.Wrapper.isWrapperType; // Classes compiled prior to dynamic nestmate support invoke a private instance // method with REF_invokeSpecial. Newer classes use REF_invokeVirtual or // REF_invokeInterface, and we can use that instruction in the lambda class. - if (targetClass == implClass) { + if (targetClass == implClass && Modifier.isPrivate(implInfo.getModifiers())) { this.implKind = implClass.isInterface() ? REF_invokeInterface : REF_invokeVirtual; } else { this.implKind = REF_invokeSpecial; diff --git a/test/jdk/java/lang/invoke/lambda/invokeSpecial/InvokeSpecialMethodTest.java b/test/jdk/java/lang/invoke/lambda/invokeSpecial/InvokeSpecialMethodTest.java new file mode 100644 index 00000000000..bf1db0f822e --- /dev/null +++ b/test/jdk/java/lang/invoke/lambda/invokeSpecial/InvokeSpecialMethodTest.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021, 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 8274848 + * @run testng InvokeSpecialMethodTest + * @summary ensure REF_invokeSpecial on a non-private implementation method + * behaves as if `super::m` is invoked regardless of its access flag + */ + +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.lang.invoke.CallSite; +import java.lang.invoke.LambdaMetafactory; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodHandles.Lookup; + +import static java.lang.invoke.MethodType.methodType; + +public class InvokeSpecialMethodTest { + static class MethodTest { + static final Lookup LOOKUP = MethodHandles.lookup(); + + public String m_public() { + return "test_public"; + } + + protected String m_protected() { + return "test_protected"; + } + + private String m_private() { + return "test_private"; + } + + public static class SubClass extends MethodTest { + @Override + public String m_public() { + return "subclass_public"; + } + + @Override + public String m_protected() { + return "subclass_protected"; + } + + public String m_private() { + return "subclass_private"; + } + } + + /* + * findSpecial with Test class as the special caller matching + * the factory type `StringFactory(Test)` + */ + static MethodHandle mh(String name) { + try { + return LOOKUP.findSpecial(MethodTest.class, name, methodType(String.class), MethodTest.class); + } catch (NoSuchMethodException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + static final MethodHandle M_PUBLIC = mh("m_public"); + static final MethodHandle M_PROTECTED = mh("m_protected"); + static final MethodHandle M_PRIVATE = mh("m_private"); + } + + @FunctionalInterface + interface StringFactory { + String get(); + } + + @DataProvider + public Object[][] methodProvider() { + return new Object[][]{ + {MethodTest.M_PUBLIC, "test_public"}, + {MethodTest.M_PROTECTED, "test_protected"}, + {MethodTest.M_PRIVATE, "test_private"} + }; + } + + @Test(dataProvider = "methodProvider") + void test(MethodHandle implMethod, String expected) throws Throwable { + testMetafactory(implMethod, expected); + testAltMetafactory(implMethod, expected); + } + + static void testMetafactory(MethodHandle implMethod, String expected) throws Throwable { + CallSite cs = LambdaMetafactory.metafactory(MethodTest.LOOKUP, "get", + methodType(StringFactory.class, MethodTest.class), + methodType(String.class), implMethod, methodType(String.class)); + MethodTest o = new MethodTest.SubClass(); + StringFactory factory = (StringFactory) cs.dynamicInvoker().invokeExact(o); + String actual = factory.get(); + Assert.assertEquals(actual, expected); + } + + static void testAltMetafactory(MethodHandle implMethod, String expected) throws Throwable { + CallSite cs = LambdaMetafactory.altMetafactory(MethodTest.LOOKUP, "get", + methodType(StringFactory.class, MethodTest.class), + methodType(String.class), implMethod, methodType(String.class), + LambdaMetafactory.FLAG_SERIALIZABLE); + MethodTest o = new MethodTest.SubClass(); + StringFactory factory = (StringFactory) cs.dynamicInvoker().invokeExact(o); + String actual = factory.get(); + Assert.assertEquals(actual, expected); + } +} -- GitLab From de93b1d0e83a9428dae4a9609996fe7b7e9b4932 Mon Sep 17 00:00:00 2001 From: Hai-May Chao Date: Thu, 28 Oct 2021 23:04:34 +0000 Subject: [PATCH 114/890] 8257722: Improve "keytool -printcert -jarfile" output Reviewed-by: weijun --- .../sun/security/tools/keytool/Main.java | 106 +++++++++++------- .../sun/security/tools/keytool/Resources.java | 5 +- .../tools/jarsigner/TimestampCheck.java | 45 -------- .../sun/security/tools/keytool/ReadJar.java | 100 ++++++++++++++++- 4 files changed, 169 insertions(+), 87 deletions(-) diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/src/java.base/share/classes/sun/security/tools/keytool/Main.java index 2db773ed61d..4d0b92fff00 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -2847,6 +2847,23 @@ public final class Main { } } + private static String oneInManys(String label, int certNo, int certCnt, int signerNo, + int signerCnt) { + if (certCnt == 1 && signerCnt == 1) { + return label; + } + if (certCnt > 1 && signerCnt == 1) { + return String.format(rb.getString("one.in.many1"), label, certNo); + } + if (certCnt == 1 && signerCnt > 1) { + return String.format(rb.getString("one.in.many2"), label, signerNo); + } + if (certCnt > 1 && signerCnt > 1) { + return String.format(rb.getString("one.in.many3"), label, certNo, signerNo); + } + return label; + } + private void doPrintCert(final PrintStream out) throws Exception { if (jarfile != null) { // reset "jdk.certpath.disabledAlgorithms" security property @@ -2855,7 +2872,7 @@ public final class Main { JarFile jf = new JarFile(jarfile, true); Enumeration entries = jf.entries(); - Set ss = new HashSet<>(); + LinkedHashSet ss = new LinkedHashSet<>(); byte[] buffer = new byte[8192]; int pos = 0; while (entries.hasMoreElements()) { @@ -2872,48 +2889,59 @@ public final class Main { for (CodeSigner signer: signers) { if (!ss.contains(signer)) { ss.add(signer); - out.printf(rb.getString("Signer.d."), ++pos); - out.println(); - out.println(); - out.println(rb.getString("Signature.")); - out.println(); - - List certs - = signer.getSignerCertPath().getCertificates(); - int cc = 0; - for (Certificate cert: certs) { - X509Certificate x = (X509Certificate)cert; - if (rfc) { - out.println(rb.getString("Certificate.owner.") + x.getSubjectX500Principal() + "\n"); - dumpCert(x, out); - } else { - printX509Cert(x, out); - } - out.println(); - checkWeak(oneInMany(rb.getString("the.certificate"), cc++, certs.size()), x); - } - Timestamp ts = signer.getTimestamp(); - if (ts != null) { - out.println(rb.getString("Timestamp.")); - out.println(); - certs = ts.getSignerCertPath().getCertificates(); - cc = 0; - for (Certificate cert: certs) { - X509Certificate x = (X509Certificate)cert; - if (rfc) { - out.println(rb.getString("Certificate.owner.") + x.getSubjectX500Principal() + "\n"); - dumpCert(x, out); - } else { - printX509Cert(x, out); - } - out.println(); - checkWeak(oneInMany(rb.getString("the.tsa.certificate"), cc++, certs.size()), x); - } - } } } } } + + for (CodeSigner signer: ss) { + out.printf(rb.getString("Signer.d."), ++pos); + out.println(); + out.println(); + + List certs + = signer.getSignerCertPath().getCertificates(); + int cc = 0; + for (Certificate cert: certs) { + out.printf(rb.getString("Certificate.d."), ++cc); + out.println(); + X509Certificate x = (X509Certificate)cert; + if (rfc) { + out.println(rb.getString("Certificate.owner.") + x.getSubjectX500Principal() + "\n"); + dumpCert(x, out); + } else { + printX509Cert(x, out); + } + out.println(); + checkWeak(oneInManys(rb.getString( + "the.certificate"), cc, + certs.size(), pos, + ss.size()), x); + } + Timestamp ts = signer.getTimestamp(); + if (ts != null) { + out.println(rb.getString("Timestamp.")); + out.println(); + certs = ts.getSignerCertPath().getCertificates(); + cc = 0; + for (Certificate cert: certs) { + out.printf(rb.getString("Certificate.d."), ++cc); + out.println(); + X509Certificate x = (X509Certificate)cert; + if (rfc) { + out.println(rb.getString("Certificate.owner.") + x.getSubjectX500Principal() + "\n"); + dumpCert(x, out); + } else { + printX509Cert(x, out); + } + out.println(); + checkWeak(oneInManys(rb.getString( + "the.tsa.certificate"), cc, + certs.size(), pos, + ss.size()), x); + } + } + } jf.close(); if (ss.isEmpty()) { out.println(rb.getString("Not.a.signed.jar.file")); diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java index 2733e45aeea..df0147e529d 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Resources.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Resources.java @@ -397,8 +397,8 @@ public class Resources extends java.util.ListResourceBundle { {".WARNING.WARNING.WARNING.", "***************** WARNING WARNING WARNING *****************"}, {"Signer.d.", "Signer #%d:"}, + {"Certificate.d.", "Certificate #%d:"}, {"Timestamp.", "Timestamp:"}, - {"Signature.", "Signature:"}, {"Certificate.owner.", "Certificate owner: "}, {"Not.a.signed.jar.file", "Not a signed jar file"}, {"No.certificate.from.the.SSL.server", @@ -465,6 +465,9 @@ public class Resources extends java.util.ListResourceBundle { {"the.input", "The input"}, {"reply", "Reply"}, {"one.in.many", "%1$s #%2$d of %3$d"}, + {"one.in.many1", "%1$s #%2$d"}, + {"one.in.many2", "%1$s of signer #%2$d"}, + {"one.in.many3", "%1$s #%2$d of signer #%3$d"}, {"alias.in.cacerts", "Issuer <%s> in cacerts"}, {"alias.in.keystore", "Issuer <%s>"}, {"with.weak", "%s (weak)"}, diff --git a/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java b/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java index 01bcc0bb09b..9599e6ac066 100644 --- a/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java +++ b/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java @@ -722,51 +722,6 @@ public class TimestampCheck { .shouldMatch("Signature algorithm: .*key.*(disabled)"); } - static void checkWeak(String file) throws Exception { - verify(file) - .shouldHaveExitValue(0) - .shouldNotContain("treated as unsigned"); - verify(file, "-verbose") - .shouldHaveExitValue(0) - .shouldNotContain("treated as unsigned") - .shouldMatch("Digest algorithm: .*(weak)") - .shouldMatch("Signature algorithm: .*(weak)") - .shouldMatch("Timestamp digest algorithm: .*(weak)") - .shouldNotMatch("Timestamp signature algorithm: .*(weak).*(weak)") - .shouldMatch("Timestamp signature algorithm: .*key.*(weak)"); - verify(file, "-J-Djava.security.debug=jar") - .shouldHaveExitValue(0) - .shouldNotMatch("SignatureException:.*disabled"); - - // keytool should print out warnings when reading or - // generating cert/cert req using legacy algorithms. - String sout = SecurityTools.keytool("-printcert -jarfile " + file) - .stderrShouldContain("The TSA certificate uses a 1024-bit RSA key" + - " which is considered a security risk." + - " This key size will be disabled in a future update.") - .getStdout(); - if (sout.indexOf("weak", sout.indexOf("Timestamp:")) < 0) { - throw new RuntimeException("timestamp not weak: " + sout); - } - } - - static void checkHalfWeak(String file) throws Exception { - verify(file) - .shouldHaveExitValue(0) - .shouldNotContain("treated as unsigned"); - verify(file, "-verbose") - .shouldHaveExitValue(0) - .shouldNotContain("treated as unsigned") - .shouldMatch("Digest algorithm: .*(weak)") - .shouldNotMatch("Signature algorithm: .*(weak)") - .shouldNotMatch("Signature algorithm: .*(disabled)") - .shouldNotMatch("Timestamp digest algorithm: .*(weak)") - .shouldNotMatch("Timestamp signature algorithm: .*(weak).*(weak)") - .shouldNotMatch("Timestamp signature algorithm: .*(disabled).*(disabled)") - .shouldNotMatch("Timestamp signature algorithm: .*key.*(weak)") - .shouldNotMatch("Timestamp signature algorithm: .*key.*(disabled)"); - } - static void checkMultipleWeak(String file) throws Exception { verify(file) .shouldHaveExitValue(0) diff --git a/test/jdk/sun/security/tools/keytool/ReadJar.java b/test/jdk/sun/security/tools/keytool/ReadJar.java index 464936cfc07..6b7ef56eaf5 100644 --- a/test/jdk/sun/security/tools/keytool/ReadJar.java +++ b/test/jdk/sun/security/tools/keytool/ReadJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -23,7 +23,7 @@ /** * @test - * @bug 6890872 8168882 + * @bug 6890872 8168882 8257722 * @summary keytool -printcert to recognize signed jar files * @library /test/lib * @build jdk.test.lib.SecurityTools @@ -42,11 +42,24 @@ import java.nio.file.Paths; import jdk.test.lib.SecurityTools; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.util.JarUtils; +import java.nio.file.Path; public class ReadJar { + static OutputAnalyzer kt(String cmd, String ks) throws Exception { + return SecurityTools.keytool("-storepass changeit " + cmd + + " -keystore " + ks); + } + + static void gencert(String owner, String cmd) throws Exception { + kt("-certreq -alias " + owner + " -file tmp.req", "ks"); + kt("-gencert -infile tmp.req -outfile tmp.cert " + cmd, "ks"); + kt("-importcert -alias " + owner + " -file tmp.cert", "ks"); + } + public static void main(String[] args) throws Throwable { testWithMD5(); + testCertOutput(); } // make sure that -printcert option works @@ -91,4 +104,87 @@ public class ReadJar { out.shouldHaveExitValue(0); out.shouldNotContain("Not a signed jar file"); } + + private static void testCertOutput() throws Throwable { + kt("-genkeypair -keyalg rsa -alias e0 -dname CN=E0 " + + "-keysize 512", "ks"); + JarUtils.createJarFile(Path.of("a0.jar"), Path.of("."), Path.of("ks")); + // sign a0.jar file + SecurityTools.jarsigner("-keystore ks -storepass changeit " + + " a0.jar e0") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-printcert -jarfile a0.jar") + .shouldNotContain("Signature:") + .shouldContain("Signer #1:") + .shouldContain("Certificate #1:") + .shouldNotContain("Certificate #2:") + .shouldNotContain("Signer #2:") + .shouldMatch("The certificate uses a 512-bit RSA key.*is disabled") + .shouldHaveExitValue(0); + + kt("-genkeypair -keyalg rsa -alias ca1 -dname CN=CA1 -ext bc:c " + + "-keysize 512", "ks"); + kt("-genkeypair -keyalg rsa -alias e1 -dname CN=E1", "ks"); + gencert("e1", "-alias ca1 -ext san=dns:e1"); + + JarUtils.createJarFile(Path.of("a1.jar"), Path.of("."), Path.of("ks")); + // sign a1.jar file + SecurityTools.jarsigner("-keystore ks -storepass changeit " + + " a1.jar e1") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-printcert -jarfile a1.jar") + .shouldNotContain("Signature:") + .shouldContain("Signer #1:") + .shouldContain("Certificate #1:") + .shouldContain("Certificate #2:") + .shouldNotContain("Signer #2:") + .shouldMatch("The certificate #2 uses a 512-bit RSA key.*is disabled") + .shouldHaveExitValue(0); + + kt("-genkeypair -keyalg rsa -alias ca2 -dname CN=CA2 -ext bc:c " + + "-sigalg SHA1withRSA", "ks"); + kt("-genkeypair -keyalg rsa -alias e2 -dname CN=E2", "ks"); + gencert("e2", "-alias ca2 -ext san=dns:e2"); + + // sign a1.jar file again with different signer + SecurityTools.jarsigner("-keystore ks -storepass changeit " + + " a1.jar e2") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-printcert -jarfile a1.jar") + .shouldNotContain("Signature:") + .shouldContain("Signer #1:") + .shouldContain("Certificate #1:") + .shouldContain("Certificate #2:") + .shouldContain("Signer #2:") + .shouldMatch("The certificate #.* of signer #.*" + "uses the SHA1withRSA.*will be disabled") + .shouldMatch("The certificate #.* of signer #.*" + "uses a 512-bit RSA key.*is disabled") + .shouldHaveExitValue(0); + + kt("-genkeypair -keyalg rsa -alias e3 -dname CN=E3", + "ks"); + JarUtils.createJarFile(Path.of("a2.jar"), Path.of("."), Path.of("ks")); + // sign a2.jar file + SecurityTools.jarsigner("-keystore ks -storepass changeit " + + " a2.jar e3") + .shouldHaveExitValue(0); + + kt("-genkeypair -keyalg rsa -alias e4 -dname CN=E4 " + + "-keysize 1024", "ks"); + // sign a2.jar file again with different signer + SecurityTools.jarsigner("-keystore ks -storepass changeit " + + " a2.jar e4") + .shouldHaveExitValue(0); + + SecurityTools.keytool("-printcert -jarfile a2.jar") + .shouldNotContain("Signature:") + .shouldContain("Signer #1:") + .shouldContain("Certificate #1:") + .shouldNotContain("Certificate #2:") + .shouldContain("Signer #2:") + .shouldMatch("The certificate of signer #.*" + "uses a 1024-bit RSA key.*will be disabled") + .shouldHaveExitValue(0); + } } -- GitLab From c9e65f8ef926c3796867558afa536770eed71cd6 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 29 Oct 2021 03:48:45 +0000 Subject: [PATCH 115/890] 8275440: Remove VirtualSpaceList::is_full() Reviewed-by: coleenp --- src/hotspot/share/memory/metaspace/virtualSpaceList.cpp | 9 --------- src/hotspot/share/memory/metaspace/virtualSpaceList.hpp | 4 ---- .../hotspot/gtest/metaspace/test_chunkManager_stress.cpp | 4 ++-- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp index d3c5ec1cef5..d796b97c9eb 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp @@ -200,15 +200,6 @@ bool VirtualSpaceList::contains(const MetaWord* p) const { return false; } -// Returns true if the vslist is not expandable and no more root chunks -// can be allocated. -bool VirtualSpaceList::is_full() const { - if (!_can_expand && _first_node != NULL && _first_node->free_words() == 0) { - return true; - } - return false; -} - // Convenience methods to return the global class-space chunkmanager // and non-class chunkmanager, respectively. VirtualSpaceList* VirtualSpaceList::vslist_class() { diff --git a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp index a173e71c63e..b69e041ad54 100644 --- a/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp +++ b/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp @@ -128,10 +128,6 @@ public: // Returns true if this pointer is contained in one of our nodes. bool contains(const MetaWord* p) const; - // Returns true if the list is not expandable and no more root chunks - // can be allocated. - bool is_full() const; - // Convenience methods to return the global class-space vslist // and non-class vslist, respectively. static VirtualSpaceList* vslist_class(); diff --git a/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp b/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp index d6477a936a5..1ba522c1169 100644 --- a/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp +++ b/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp @@ -61,9 +61,9 @@ class ChunkManagerRandomChunkAllocTest { return max_chunks; } - // Return true if, after an allocation error happened, a reserve error seems likely. + // Return true if, after an allocation error happened, a reserve error seems possible. bool could_be_reserve_error() { - return _context.vslist().is_full(); + return _context.reserve_limit() < max_uintx; } // Return true if, after an allocation error happened, a commit error seems likely. -- GitLab From 157e1d5073e221dab084422389f68eea53974f4c Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 29 Oct 2021 04:26:56 +0000 Subject: [PATCH 116/890] 8275856: Remove MetaspaceHandleDeallocations debug switch Reviewed-by: coleenp, iklam --- .../share/memory/metaspace/metaspaceArena.cpp | 11 +--- .../memory/metaspace/metaspaceSettings.cpp | 12 +---- .../memory/metaspace/metaspaceSettings.hpp | 9 ---- src/hotspot/share/runtime/globals.hpp | 3 -- .../gtest/metaspace/test_metaspacearena.cpp | 54 +++++++++---------- 5 files changed, 29 insertions(+), 60 deletions(-) diff --git a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp index 7d9441956d7..85080b5d4c2 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp @@ -58,10 +58,6 @@ chunklevel_t MetaspaceArena::next_chunk_level() const { // Given a chunk, add its remaining free committed space to the free block list. void MetaspaceArena::salvage_chunk(Metachunk* c) { - if (Settings::handle_deallocations() == false) { - return; - } - assert_lock_strong(lock()); size_t remaining_words = c->free_below_committed_words(); if (remaining_words > FreeBlocks::MinWordSize) { @@ -105,7 +101,6 @@ Metachunk* MetaspaceArena::allocate_new_chunk(size_t requested_word_size) { } void MetaspaceArena::add_allocation_to_fbl(MetaWord* p, size_t word_size) { - assert(Settings::handle_deallocations(), "Sanity"); if (_fbl == NULL) { _fbl = new FreeBlocks(); // Create only on demand } @@ -232,7 +227,7 @@ MetaWord* MetaspaceArena::allocate(size_t requested_word_size) { const size_t raw_word_size = get_raw_word_size_for_requested_word_size(requested_word_size); // Before bothering the arena proper, attempt to re-use a block from the free blocks list - if (Settings::handle_deallocations() && _fbl != NULL && !_fbl->is_empty()) { + if (_fbl != NULL && !_fbl->is_empty()) { p = _fbl->remove_block(raw_word_size); if (p != NULL) { DEBUG_ONLY(InternalStats::inc_num_allocs_from_deallocated_blocks();) @@ -363,10 +358,6 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { // Prematurely returns a metaspace allocation to the _block_freelists // because it is not needed anymore (requires CLD lock to be active). void MetaspaceArena::deallocate_locked(MetaWord* p, size_t word_size) { - if (Settings::handle_deallocations() == false) { - return; - } - assert_lock_strong(lock()); // At this point a current chunk must exist since we only deallocate if we did allocate before. assert(current_chunk() != NULL, "stray deallocation?"); diff --git a/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp b/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp index c8b80b78ac0..6be39326d07 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceSettings.cpp @@ -43,7 +43,6 @@ bool Settings::_new_chunks_are_fully_committed = false; bool Settings::_uncommit_free_chunks = false; DEBUG_ONLY(bool Settings::_use_allocation_guard = false;) -DEBUG_ONLY(bool Settings::_handle_deallocations = true;) void Settings::ergo_initialize() { if (strcmp(MetaspaceReclaimPolicy, "none") == 0) { @@ -76,15 +75,9 @@ void Settings::ergo_initialize() { assert(commit_granule_words() <= chunklevel::MAX_CHUNK_WORD_SIZE, "Too large granule size"); assert(is_power_of_2(commit_granule_words()), "granule size must be a power of 2"); -#ifdef ASSERT - // Off for release builds, and by default for debug builds, but can be switched on manually to aid - // error analysis. - _use_allocation_guard = MetaspaceGuardAllocations; + // Off for release builds, off by default - but switchable - for debug builds. + DEBUG_ONLY(_use_allocation_guard = MetaspaceGuardAllocations;) - // Deallocations can be manually switched off to aid error analysis, since this removes one layer of complexity - // from allocation. - _handle_deallocations = MetaspaceHandleDeallocations; -#endif LogStream ls(Log(metaspace)::info()); Settings::print_on(&ls); } @@ -97,7 +90,6 @@ void Settings::print_on(outputStream* st) { st->print_cr(" - new_chunks_are_fully_committed: %d.", (int)new_chunks_are_fully_committed()); st->print_cr(" - uncommit_free_chunks: %d.", (int)uncommit_free_chunks()); st->print_cr(" - use_allocation_guard: %d.", (int)use_allocation_guard()); - st->print_cr(" - handle_deallocations: %d.", (int)handle_deallocations()); } } // namespace metaspace diff --git a/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp b/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp index 47792fda422..db6d63a4e4e 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp +++ b/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp @@ -69,14 +69,6 @@ class Settings : public AllStatic { // If true, metablock allocations are guarded and periodically checked. DEBUG_ONLY(static bool _use_allocation_guard;) - // This enables or disables premature deallocation of metaspace allocated blocks. Using - // Metaspace::deallocate(), blocks can be returned prematurely (before the associated - // Arena dies, e.g. after class unloading) and can be reused by the arena. - // If disabled, those blocks will not be reused until the Arena dies. - // Note that premature deallocation is rare under normal circumstances. - // By default deallocation handling is enabled. - DEBUG_ONLY(static bool _handle_deallocations;) - public: static size_t commit_granule_bytes() { return _commit_granule_bytes; } @@ -87,7 +79,6 @@ public: static bool enlarge_chunks_in_place() { return _enlarge_chunks_in_place; } static bool uncommit_free_chunks() { return _uncommit_free_chunks; } static bool use_allocation_guard() { return DEBUG_ONLY(_use_allocation_guard) NOT_DEBUG(false); } - static bool handle_deallocations() { return DEBUG_ONLY(_handle_deallocations) NOT_DEBUG(true); } static void ergo_initialize(); diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 619ec338626..99d27f55e5b 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1443,9 +1443,6 @@ const intx ObjectAlignmentInBytes = 8; develop(bool, MetaspaceGuardAllocations, false, \ "Metapace allocations are guarded.") \ \ - develop(bool, MetaspaceHandleDeallocations, true, \ - "Switch off Metapace deallocation handling.") \ - \ product(uintx, MinHeapFreeRatio, 40, MANAGEABLE, \ "The minimum percentage of heap free after GC to avoid expansion."\ " For most GCs this applies to the old generation. In G1 and" \ diff --git a/test/hotspot/gtest/metaspace/test_metaspacearena.cpp b/test/hotspot/gtest/metaspace/test_metaspacearena.cpp index 3b4d0863805..4fec8f6a525 100644 --- a/test/hotspot/gtest/metaspace/test_metaspacearena.cpp +++ b/test/hotspot/gtest/metaspace/test_metaspacearena.cpp @@ -744,38 +744,36 @@ TEST_VM(metaspace, MetaspaceArena_growth_boot_nc_not_inplace) { // do not increase metaspace usage after the initial allocation (the deallocated // block should be reused by the next allocation). static void test_repeatedly_allocate_and_deallocate(bool is_topmost) { - if (Settings::handle_deallocations()) { - // Test various sizes, including (important) the max. possible block size = 1 root chunk - for (size_t blocksize = Metaspace::max_allocation_word_size(); blocksize >= 1; blocksize /= 2) { - size_t used1 = 0, used2 = 0, committed1 = 0, committed2 = 0; - MetaWord* p = NULL, *p2 = NULL; - - MetaspaceGtestContext context; - MetaspaceArenaTestHelper helper(context, Metaspace::StandardMetaspaceType, false); - - // First allocation - helper.allocate_from_arena_with_tests_expect_success(&p, blocksize); - if (!is_topmost) { - // another one on top, size does not matter. - helper.allocate_from_arena_with_tests_expect_success(0x10); - } + // Test various sizes, including (important) the max. possible block size = 1 root chunk + for (size_t blocksize = Metaspace::max_allocation_word_size(); blocksize >= 1; blocksize /= 2) { + size_t used1 = 0, used2 = 0, committed1 = 0, committed2 = 0; + MetaWord* p = NULL, *p2 = NULL; - // Measure - helper.usage_numbers_with_test(&used1, &committed1, NULL); + MetaspaceGtestContext context; + MetaspaceArenaTestHelper helper(context, Metaspace::StandardMetaspaceType, false); - // Dealloc, alloc several times with the same size. - for (int i = 0; i < 5; i ++) { - helper.deallocate_with_tests(p, blocksize); - helper.allocate_from_arena_with_tests_expect_success(&p2, blocksize); - // We should get the same pointer back. - EXPECT_EQ(p2, p); - } + // First allocation + helper.allocate_from_arena_with_tests_expect_success(&p, blocksize); + if (!is_topmost) { + // another one on top, size does not matter. + helper.allocate_from_arena_with_tests_expect_success(0x10); + } + + // Measure + helper.usage_numbers_with_test(&used1, &committed1, NULL); - // Measure again - helper.usage_numbers_with_test(&used2, &committed2, NULL); - EXPECT_EQ(used2, used1); - EXPECT_EQ(committed1, committed2); + // Dealloc, alloc several times with the same size. + for (int i = 0; i < 5; i ++) { + helper.deallocate_with_tests(p, blocksize); + helper.allocate_from_arena_with_tests_expect_success(&p2, blocksize); + // We should get the same pointer back. + EXPECT_EQ(p2, p); } + + // Measure again + helper.usage_numbers_with_test(&used2, &committed2, NULL); + EXPECT_EQ(used2, used1); + EXPECT_EQ(committed1, committed2); } } -- GitLab From e922023ec9a74e694a8180e678be19bc2720c346 Mon Sep 17 00:00:00 2001 From: Tobias Holenstein Date: Fri, 29 Oct 2021 06:16:38 +0000 Subject: [PATCH 117/890] 8275909: [JVMCI] c2v_readFieldValue use long instead of jlong for the offset parameter Reviewed-by: chagedorn, dnsimon, shade --- src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index e4e1197d357..4a5e726ffe3 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -1892,7 +1892,7 @@ C2V_VMENTRY_NULL(jobjectArray, getDeclaredMethods, (JNIEnv* env, jobject, jobjec return JVMCIENV->get_jobjectArray(methods); C2V_END -C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, jobject expected_type, long displacement, jobject kind_object)) +C2V_VMENTRY_NULL(jobject, readFieldValue, (JNIEnv* env, jobject, jobject object, jobject expected_type, jlong displacement, jobject kind_object)) if (object == NULL || kind_object == NULL) { JVMCI_THROW_0(NullPointerException); } -- GitLab From 24cf48000ac154eac67b617e2a63557f21032907 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 29 Oct 2021 09:06:36 +0000 Subject: [PATCH 118/890] 8276047: G1: refactor G1CardSetArrayLocker Reviewed-by: tschatzl, sjohanss --- .../share/gc/g1/g1CardSetContainers.hpp | 16 ++++++++-------- .../gc/g1/g1CardSetContainers.inline.hpp | 19 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp index cd6868c8c17..c273695aa63 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp @@ -196,19 +196,19 @@ private: static const EntryCountType EntryMask = LockBitMask - 1; class G1CardSetArrayLocker : public StackObj { - EntryCountType volatile* _value; - EntryCountType volatile _original_value; - bool _success; + EntryCountType volatile* _num_entries_addr; + EntryCountType _local_num_entries; public: G1CardSetArrayLocker(EntryCountType volatile* value); - EntryCountType num_entries() const { return _original_value; } - void inc_num_entries() { _success = true; } + EntryCountType num_entries() const { return _local_num_entries; } + void inc_num_entries() { + assert(((_local_num_entries + 1) & EntryMask) == (EntryCountType)(_local_num_entries + 1), "no overflow" ); + _local_num_entries++; + } ~G1CardSetArrayLocker() { - assert(((_original_value + _success) & EntryMask) == (EntryCountType)(_original_value + _success), "precondition!" ); - - Atomic::release_store(_value, (EntryCountType)(_original_value + _success)); + Atomic::release_store(_num_entries_addr, _local_num_entries); } }; diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index 645f4a9ea3e..f5dd4ed60a7 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -145,22 +145,21 @@ inline G1CardSetArray::G1CardSetArray(uint card_in_region, EntryCountType num_el _data[0] = card_in_region; } -inline G1CardSetArray::G1CardSetArrayLocker::G1CardSetArrayLocker(EntryCountType volatile* value) : - _value(value), - _success(false) { +inline G1CardSetArray::G1CardSetArrayLocker::G1CardSetArrayLocker(EntryCountType volatile* num_entries_addr) : + _num_entries_addr(num_entries_addr) { SpinYield s; - EntryCountType original_value = (*_value) & EntryMask; + EntryCountType num_entries = Atomic::load(_num_entries_addr) & EntryMask; while (true) { - EntryCountType old_value = Atomic::cmpxchg(_value, - original_value, - (EntryCountType)(original_value | LockBitMask)); - if (old_value == original_value) { + EntryCountType old_value = Atomic::cmpxchg(_num_entries_addr, + num_entries, + (EntryCountType)(num_entries | LockBitMask)); + if (old_value == num_entries) { // Succeeded locking the array. - _original_value = original_value; + _local_num_entries = num_entries; break; } // Failed. Retry (with the lock bit stripped again). - original_value = old_value & EntryMask; + num_entries = old_value & EntryMask; s.wait(); } } -- GitLab From e89b2c040c68aebf6a099602bc0e04f963e89c84 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 29 Oct 2021 09:44:48 +0000 Subject: [PATCH 119/890] 8276086: Increase size of metaspace mappings Reviewed-by: goetz, mdoerr --- .../share/memory/metaspace/metaspaceSettings.hpp | 13 ++++++------- .../hotspot/gtest/metaspace/test_metaspace_misc.cpp | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp b/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp index db6d63a4e4e..e6d47fec3f4 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp +++ b/src/hotspot/share/memory/metaspace/metaspaceSettings.hpp @@ -42,13 +42,12 @@ class Settings : public AllStatic { // The default size of a VirtualSpaceNode, unless created with an explicitly specified size. // Must be a multiple of the root chunk size. - // Increasing this value decreases the number of mappings used for metadata, - // at the cost of increased virtual size used for Metaspace (or, at least, - // coarser growth steps). Matters mostly for 32bit platforms due to limited - // address space. - // The default of two root chunks has been chosen on a whim but seems to work out okay - // (coming to a mapping size of 8m per node). - static const size_t _virtual_space_node_default_word_size = chunklevel::MAX_CHUNK_WORD_SIZE * 2; + // This value only affects the process virtual size, and there only the granularity with which it + // increases. Matters mostly for 32bit platforms due to limited address space. + // Note that this only affects the non-class metaspace. Class space ignores this size (it is one + // single large mapping). + static const size_t _virtual_space_node_default_word_size = + chunklevel::MAX_CHUNK_WORD_SIZE * NOT_LP64(2) LP64_ONLY(16); // 8MB (32-bit) / 64MB (64-bit) // Alignment of the base address of a virtual space node static const size_t _virtual_space_node_reserve_alignment_words = chunklevel::MAX_CHUNK_WORD_SIZE; diff --git a/test/hotspot/gtest/metaspace/test_metaspace_misc.cpp b/test/hotspot/gtest/metaspace/test_metaspace_misc.cpp index dba19bd60ab..144a3d73b82 100644 --- a/test/hotspot/gtest/metaspace/test_metaspace_misc.cpp +++ b/test/hotspot/gtest/metaspace/test_metaspace_misc.cpp @@ -47,7 +47,7 @@ TEST_VM(metaspace, misc_sizes) { ASSERT_TRUE(is_aligned(Settings::virtual_space_node_default_word_size(), metaspace::chunklevel::MAX_CHUNK_WORD_SIZE)); ASSERT_EQ(Settings::virtual_space_node_default_word_size(), - metaspace::chunklevel::MAX_CHUNK_WORD_SIZE * 2); + metaspace::chunklevel::MAX_CHUNK_WORD_SIZE * NOT_LP64(2) LP64_ONLY(16)); ASSERT_EQ(Settings::virtual_space_node_reserve_alignment_words(), Metaspace::reserve_alignment_words()); -- GitLab From 15fd8a300b503fada7611004b5cb1bda6ecc292e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 29 Oct 2021 10:26:06 +0000 Subject: [PATCH 120/890] 8276102: JDK-8245095 integration reverted JDK-8247980 Reviewed-by: dfuchs, redestad --- test/jdk/TEST.ROOT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/TEST.ROOT b/test/jdk/TEST.ROOT index 0e18bcc949a..03552d41c15 100644 --- a/test/jdk/TEST.ROOT +++ b/test/jdk/TEST.ROOT @@ -27,7 +27,7 @@ exclusiveAccess.dirs=java/math/BigInteger/largeMemory \ java/rmi/Naming java/util/prefs sun/management/jmxremote \ sun/tools/jstatd sun/tools/jcmd \ sun/tools/jinfo sun/tools/jmap sun/tools/jps sun/tools/jstack sun/tools/jstat \ -com/sun/tools/attach sun/security/mscapi java/util/stream java/util/Arrays/largeMemory \ +com/sun/tools/attach sun/security/mscapi java/util/Arrays/largeMemory \ java/util/BitSet/stream javax/rmi java/net/httpclient/websocket \ com/sun/net/httpserver/simpleserver -- GitLab From c0cda1db4fe74b86faa12136336bdf98c96758d2 Mon Sep 17 00:00:00 2001 From: Ilarion Nakonechnyy Date: Fri, 29 Oct 2021 11:37:45 +0000 Subject: [PATCH 121/890] 8273026: Slow LoginContext.login() on multi threading application Reviewed-by: weijun --- .../security/auth/login/LoginContext.java | 39 ++++++++++++++----- test/jdk/javax/security/auth/spi/Loader.java | 19 +++------ .../security/auth/spi/SecondLoginModule.java | 5 --- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/java.base/share/classes/javax/security/auth/login/LoginContext.java b/src/java.base/share/classes/javax/security/auth/login/LoginContext.java index c4dd95b9d3f..9829001133f 100644 --- a/src/java.base/share/classes/javax/security/auth/login/LoginContext.java +++ b/src/java.base/share/classes/javax/security/auth/login/LoginContext.java @@ -40,6 +40,10 @@ import java.util.ServiceLoader; import sun.security.util.PendingException; import sun.security.util.ResourcesMgr; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.stream.*; +import java.util.ServiceLoader.Provider; /** *

    The {@code LoginContext} class describes the basic methods used * to authenticate Subjects and provides a way to develop an @@ -222,6 +226,8 @@ public class LoginContext { private static final sun.security.util.Debug debug = sun.security.util.Debug.getInstance("logincontext", "\t[LoginContext]"); + private static final WeakHashMap>> providersCache = + new WeakHashMap<>(); @SuppressWarnings("removal") private void init(String name) throws LoginException { @@ -288,6 +294,7 @@ public class LoginContext { return loader; } }); + } @SuppressWarnings("removal") @@ -691,21 +698,35 @@ public class LoginContext { // locate and instantiate the LoginModule // String name = moduleStack[i].entry.getLoginModuleName(); - @SuppressWarnings("removal") - ServiceLoader sc = AccessController.doPrivileged( - (PrivilegedAction>) - () -> ServiceLoader.load( - LoginModule.class, contextClassLoader)); - for (LoginModule m: sc) { - if (m.getClass().getName().equals(name)) { - moduleStack[i].module = m; + Set> lmProviders; + synchronized(providersCache){ + lmProviders = providersCache.get(contextClassLoader); + if (lmProviders == null){ + if (debug != null){ + debug.println("Build ServiceProviders cache for ClassLoader: " + contextClassLoader.getName()); + } + @SuppressWarnings("removal") + ServiceLoader sc = AccessController.doPrivileged( + (PrivilegedAction>) + () -> java.util.ServiceLoader.load( + LoginModule.class, contextClassLoader)); + lmProviders = sc.stream().collect(Collectors.toSet()); + if (debug != null){ + debug.println("Discovered ServiceProviders for ClassLoader: " + contextClassLoader.getName()); + lmProviders.forEach(System.err::println); + } + providersCache.put(contextClassLoader,lmProviders); + } + } + for (Provider lm: lmProviders){ + if (lm.type().getName().equals(name)){ + moduleStack[i].module = lm.get(); if (debug != null) { debug.println(name + " loaded as a service"); } break; } } - if (moduleStack[i].module == null) { try { @SuppressWarnings("deprecation") diff --git a/test/jdk/javax/security/auth/spi/Loader.java b/test/jdk/javax/security/auth/spi/Loader.java index e2bac97de09..ca071411b8d 100644 --- a/test/jdk/javax/security/auth/spi/Loader.java +++ b/test/jdk/javax/security/auth/spi/Loader.java @@ -26,9 +26,13 @@ import java.io.File; /* * @test - * @bug 8047789 + * @bug 8047789 8273026 * @summary auth.login.LoginContext needs to be updated to work with modules - * @build FirstLoginModule SecondLoginModule + * @comment shows that the SecondLoginModule is still needed even if it's not in the JAAS login config file + * @build FirstLoginModule + * @clean SecondLoginModule + * @run main/othervm/fail Loader + * @build SecondLoginModule * @run main/othervm Loader */ public class Loader { @@ -39,18 +43,7 @@ public class Loader { new File(System.getProperty("test.src"), "sl.conf").toString()); LoginContext lc = new LoginContext("me"); - if (SecondLoginModule.isLoaded) { - throw new Exception(); - } - lc.login(); - // Although only FirstLoginModule is specified in the JAAS login - // config file, LoginContext will first create all LoginModule - // implementations that are registered as services, which include - // SecondLoginModule. - if (!SecondLoginModule.isLoaded) { - throw new Exception(); - } } } diff --git a/test/jdk/javax/security/auth/spi/SecondLoginModule.java b/test/jdk/javax/security/auth/spi/SecondLoginModule.java index c6c85872fa5..a42230a3630 100644 --- a/test/jdk/javax/security/auth/spi/SecondLoginModule.java +++ b/test/jdk/javax/security/auth/spi/SecondLoginModule.java @@ -29,11 +29,6 @@ import java.util.Map; public class SecondLoginModule implements LoginModule { - public static boolean isLoaded; - - public SecondLoginModule() { - isLoaded = true; - } @Override public void initialize(Subject subject, CallbackHandler callbackHandler, -- GitLab From 4c3491bfa5f296b80c56a37cb4fffd6497323ac2 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Fri, 29 Oct 2021 11:44:12 +0000 Subject: [PATCH 122/890] 8017175: [TESTBUG] javax/swing/JPopupMenu/4634626/bug4634626.java sometimes failed on mac Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../swing/JPopupMenu/4634626/bug4634626.java | 160 +++++++++++------- 2 files changed, 100 insertions(+), 61 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 939af59ed4b..484a3fb3eed 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -733,7 +733,6 @@ javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765 macosx-all,linux-al javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all -javax/swing/JPopupMenu/4634626/bug4634626.java 8017175 macosx-all javax/swing/JButton/8151303/PressedIconTest.java 8266246 macosx-aarch64 javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java 8273573 macosx-all diff --git a/test/jdk/javax/swing/JPopupMenu/4634626/bug4634626.java b/test/jdk/javax/swing/JPopupMenu/4634626/bug4634626.java index a66ba0053b2..84abe007ca7 100644 --- a/test/jdk/javax/swing/JPopupMenu/4634626/bug4634626.java +++ b/test/jdk/javax/swing/JPopupMenu/4634626/bug4634626.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -31,24 +31,35 @@ * @run main bug4634626 */ -import javax.swing.*; -import java.awt.event.*; -import java.awt.*; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.concurrent.atomic.AtomicBoolean; public class bug4634626 { - public boolean passed = true; - public boolean done = false; + public volatile boolean passed = true; + public volatile boolean done = false; - public static JFrame mainFrame = new JFrame("Bug4634626"); - public JRootPane rootPane = mainFrame.getRootPane(); - public JPanel contentPane = new JPanel(); - public JButton nopButton = new JButton("No popup button"); - public JTextArea someText = new JTextArea("Some text here", 20, 10); - public JButton popButton = new JButton("Button with the popup"); + public static JFrame mainFrame; + public JPanel contentPane; + public JButton nopButton; + public JTextArea someText; + public JButton popButton; - public JPopupMenu btnPopup = new JPopupMenu(); - public JPopupMenu commonPopup = new JPopupMenu(); + public JPopupMenu btnPopup; + public JPopupMenu commonPopup; static public Error toBeThrown = null; static int popTrig = MouseEvent.BUTTON3_MASK; static boolean popt = false; @@ -61,10 +72,11 @@ public class bug4634626 { e.isPopupTrigger() && ((JComponent)e.getComponent()).getComponentPopupMenu() != null) { toBeThrown = - new Error("The event got thru the component with popup: " + new Error("The event got through the component with popup: " + e); } } + public void mouseReleased(MouseEvent e) { if(e.isPopupTrigger()) popt = true; if(e.getComponent() != null && @@ -72,7 +84,7 @@ public class bug4634626 { e.isPopupTrigger() && ((JComponent)e.getComponent()).getComponentPopupMenu() != null) { toBeThrown = - new Error("The event got thru the component with popup: " + new Error("The event got through the component with popup: " + e); } if(toBeThrown != null) { @@ -93,49 +105,57 @@ public class bug4634626 { } } - public void init() { + public void init() throws Exception { + SwingUtilities.invokeLater(() -> { + mainFrame = new JFrame("Bug4634626"); + contentPane = new JPanel(); + nopButton = new JButton("No popup button"); + someText = new JTextArea("Some text here", 20, 10); + popButton = new JButton("Button with the popup"); - try { - popButton.setComponentPopupMenu(null); - popButton.setComponentPopupMenu(null); + btnPopup = new JPopupMenu(); + commonPopup = new JPopupMenu(); + + try { + popButton.setComponentPopupMenu(null); + popButton.setComponentPopupMenu(null); + popButton.setComponentPopupMenu(btnPopup); + popButton.setComponentPopupMenu(null); + } catch (Exception ex) { + System.err.println("Unexpected exception was thrown by " + + "setComponentPopupMenu() method: " + ex); + } + btnPopup.add("Button 1"); + btnPopup.add("Button 2"); + btnPopup.add("Button 3"); popButton.setComponentPopupMenu(btnPopup); - popButton.setComponentPopupMenu(null); - } catch(Exception ex) { - System.err.println("Unexpected exception was thrown by " + - "setComponentPopupMenu() method: " + ex); - } - btnPopup.add("Button 1"); - btnPopup.add("Button 2"); - btnPopup.add("Button 3"); - popButton.setComponentPopupMenu(btnPopup); - popButton.addMouseListener(mouser); - commonPopup.add("One"); - commonPopup.add("Two"); - commonPopup.add("Three"); - - contentPane.setLayout(new BorderLayout()); - contentPane.setComponentPopupMenu(commonPopup); - contentPane.addMouseListener(mouser); - contentPane.add(nopButton, BorderLayout.NORTH); - nopButton.addMouseListener(mouser); - contentPane.add(popButton, BorderLayout.SOUTH); - someText.addMouseListener(mouser); - contentPane.add(someText, BorderLayout.CENTER); - mainFrame.setContentPane(contentPane); - - mainFrame.pack(); - mainFrame.setLocation(50, 50); - - mainFrame.addWindowListener(new TestStateListener()); - mainFrame.setLocationRelativeTo(null); - mainFrame.setVisible(true); + popButton.addMouseListener(mouser); + commonPopup.add("One"); + commonPopup.add("Two"); + commonPopup.add("Three"); + + contentPane.setLayout(new BorderLayout()); + contentPane.setComponentPopupMenu(commonPopup); + contentPane.addMouseListener(mouser); + contentPane.add(nopButton, BorderLayout.NORTH); + nopButton.addMouseListener(mouser); + contentPane.add(popButton, BorderLayout.SOUTH); + someText.addMouseListener(mouser); + contentPane.add(someText, BorderLayout.CENTER); + mainFrame.setContentPane(contentPane); + + mainFrame.pack(); + mainFrame.setLocation(50, 50); + mainFrame.addWindowListener(new TestStateListener()); + mainFrame.setLocationRelativeTo(null); + mainFrame.setVisible(true); + }); while(!done) Thread.yield(); if(!passed) { throw new RuntimeException("Test failed"); } - } public class TestStateListener extends WindowAdapter { @@ -165,31 +185,52 @@ public class bug4634626 { // Determine working popup trigger event clickMouseOn(robo, nopButton, popTrig); robo.waitForIdle(); - robo.delay(500); + robo.delay(1000); if(!popt) popTrig = MouseEvent.BUTTON2_MASK; // Inheritance is OFF by default. Popup should not appear. clickMouseOn(robo, someText, popTrig); // Set inheritance ON watch for popup. - someText.setInheritsPopupMenu(true); + try { + SwingUtilities.invokeAndWait(() -> someText.setInheritsPopupMenu(true)); + } catch (Exception ex) { + throw new RuntimeException("Can not assign popup to button", ex); + } clickMouseOn(robo, someText, popTrig); robo.waitForIdle(); - robo.delay(500); - if(!commonPopup.isVisible()) { + robo.delay(1000); + AtomicBoolean popupVisible = new AtomicBoolean(false); + try { + SwingUtilities.invokeAndWait(() -> + popupVisible.set(commonPopup.isVisible())); + } catch (Exception ex) { + throw new RuntimeException("Can not get commonPopup status"); + } + if(!popupVisible.get()) { toBeThrown = new Error("Popup should be visible"); passed = false; } // Dispose popup. robo.type(KeyEvent.VK_ESCAPE); robo.waitForIdle(); - someText.setInheritsPopupMenu(false); + try { + SwingUtilities.invokeAndWait(() -> someText.setInheritsPopupMenu(false)); + } catch (Exception ex) { + throw new RuntimeException("Can not unassign popup on button", ex); + } // Button with popup assigned. Wathch for popup. clickMouseOn(robo, popButton, popTrig); robo.waitForIdle(); - robo.delay(500); - if(!btnPopup.isVisible()) { + robo.delay(1000); + try { + SwingUtilities.invokeAndWait(() -> + popupVisible.set(btnPopup.isVisible())); + } catch (Exception ex) { + throw new RuntimeException("Can not get btnPopup status"); + } + if(!popupVisible.get()) { toBeThrown = new Error("Popup should be visible"); passed = false; } @@ -200,13 +241,12 @@ public class bug4634626 { } } - - public void destroy() { if(!passed) { throw(toBeThrown); } } + private void clickMouseOn(ExtendedRobot robot, Component c, int button) { java.awt.Point p = c.getLocationOnScreen(); java.awt.Dimension size = c.getSize(); -- GitLab From 8cc59509fe7c01c9032275798ccd1531eb8f2e9f Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Fri, 29 Oct 2021 12:42:33 +0000 Subject: [PATCH 123/890] 8251468: X509Certificate.get{Subject,Issuer}AlternativeNames and getExtendedKeyUsage do not throw CertificateParsingException if extension is unparseable Reviewed-by: weijun --- .../security/x509/CertificateExtensions.java | 43 ++-------- .../security/x509/UnparseableExtension.java | 68 +++++++++++++++ .../sun/security/x509/X509CertImpl.java | 53 +++++++++--- .../GetUnparseableExtensions.java | 86 +++++++++++++++++++ 4 files changed, 198 insertions(+), 52 deletions(-) create mode 100644 src/java.base/share/classes/sun/security/x509/UnparseableExtension.java create mode 100644 test/jdk/java/security/cert/X509Certificate/GetUnparseableExtensions.java diff --git a/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java b/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java index 4f8022b4067..8c56729dcf7 100644 --- a/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java +++ b/src/java.base/share/classes/sun/security/x509/CertificateExtensions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -28,13 +28,10 @@ package sun.security.x509; import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Constructor; -import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.security.cert.CertificateException; import java.util.*; -import sun.security.util.HexDumpEncoder; - import sun.security.util.*; /** @@ -109,11 +106,10 @@ public class CertificateExtensions implements CertAttrSet { Object[] passed = new Object[] {Boolean.valueOf(ext.isCritical()), ext.getExtensionValue()}; - CertAttrSet certExt = (CertAttrSet) - cons.newInstance(passed); - if (map.put(certExt.getName(), (Extension)certExt) != null) { - throw new IOException("Duplicate extensions not allowed"); - } + CertAttrSet certExt = (CertAttrSet) cons.newInstance(passed); + if (map.put(certExt.getName(), (Extension)certExt) != null) { + throw new IOException("Duplicate extensions not allowed"); + } } catch (InvocationTargetException invk) { Throwable e = invk.getCause(); if (ext.isCritical() == false) { @@ -352,32 +348,3 @@ public class CertificateExtensions implements CertAttrSet { } } - -class UnparseableExtension extends Extension { - private String name; - private String exceptionDescription; - - public UnparseableExtension(Extension ext, Throwable why) { - super(ext); - - name = ""; - try { - Class extClass = OIDMap.getClass(ext.getExtensionId()); - if (extClass != null) { - Field field = extClass.getDeclaredField("NAME"); - name = (String)(field.get(null)) + " "; - } - } catch (Exception e) { - // If we cannot find the name, just ignore it - } - - this.exceptionDescription = why.toString(); - } - - @Override public String toString() { - return super.toString() + - "Unparseable " + name + "extension due to\n" + - exceptionDescription + "\n\n" + - new HexDumpEncoder().encodeBuffer(getExtensionValue()); - } -} diff --git a/src/java.base/share/classes/sun/security/x509/UnparseableExtension.java b/src/java.base/share/classes/sun/security/x509/UnparseableExtension.java new file mode 100644 index 00000000000..904d7db8f43 --- /dev/null +++ b/src/java.base/share/classes/sun/security/x509/UnparseableExtension.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.security.x509; + +import java.lang.reflect.Field; +import sun.security.util.HexDumpEncoder; + +/** + * An extension that cannot be parsed due to decoding errors or invalid + * content. + */ +class UnparseableExtension extends Extension { + private String name; + private String exceptionDescription; + private String exceptionMessage; + + UnparseableExtension(Extension ext, Throwable why) { + super(ext); + + name = ""; + try { + Class extClass = OIDMap.getClass(ext.getExtensionId()); + if (extClass != null) { + Field field = extClass.getDeclaredField("NAME"); + name = (String)(field.get(null)) + " "; + } + } catch (Exception e) { + // If we cannot find the name, just ignore it + } + + this.exceptionDescription = why.toString(); + this.exceptionMessage = why.getMessage(); + } + + String exceptionMessage() { + return exceptionMessage; + } + + @Override public String toString() { + return super.toString() + + "Unparseable " + name + "extension due to\n" + + exceptionDescription + "\n\n" + + new HexDumpEncoder().encodeBuffer(getExtensionValue()); + } +} diff --git a/src/java.base/share/classes/sun/security/x509/X509CertImpl.java b/src/java.base/share/classes/sun/security/x509/X509CertImpl.java index b658a94b8d6..3a1817327f9 100644 --- a/src/java.base/share/classes/sun/security/x509/X509CertImpl.java +++ b/src/java.base/share/classes/sun/security/x509/X509CertImpl.java @@ -1439,24 +1439,45 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { } /** - * This method are the overridden implementation of + * This method is the overridden implementation of the * getExtendedKeyUsage method in X509Certificate in the Sun * provider. It is better performance-wise since it returns cached * values. */ + @Override public synchronized List getExtendedKeyUsage() throws CertificateParsingException { if (readOnly && extKeyUsage != null) { return extKeyUsage; - } else { - ExtendedKeyUsageExtension ext = getExtendedKeyUsageExtension(); - if (ext == null) { - return null; + } + ExtendedKeyUsageExtension ext = (ExtendedKeyUsageExtension) + getExtensionIfParseable(PKIXExtensions.ExtendedKeyUsage_Id); + if (ext == null) { + return null; + } + extKeyUsage = Collections.unmodifiableList(ext.getExtendedKeyUsage()); + return extKeyUsage; + } + + /** + * Returns the extension identified by OID or null if it doesn't exist + * and is not unparseable. + * + * @throws CertificateParsingException if extension is unparseable + */ + private Extension getExtensionIfParseable(ObjectIdentifier oid) + throws CertificateParsingException { + Extension ext = getExtension(oid); + if (ext == null) { + // check if unparseable + UnparseableExtension unparseableExt = + (UnparseableExtension)getUnparseableExtension(oid); + if (unparseableExt != null) { + throw new CertificateParsingException( + unparseableExt.exceptionMessage()); } - extKeyUsage = - Collections.unmodifiableList(ext.getExtendedKeyUsage()); - return extKeyUsage; } + return ext; } /** @@ -1602,11 +1623,12 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { } /** - * This method are the overridden implementation of + * This method is the overridden implementation of the * getSubjectAlternativeNames method in X509Certificate in the Sun * provider. It is better performance-wise since it returns cached * values. */ + @Override public synchronized Collection> getSubjectAlternativeNames() throws CertificateParsingException { // return cached value if we can @@ -1614,7 +1636,8 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { return cloneAltNames(subjectAlternativeNames); } SubjectAlternativeNameExtension subjectAltNameExt = - getSubjectAlternativeNameExtension(); + (SubjectAlternativeNameExtension)getExtensionIfParseable( + PKIXExtensions.SubjectAlternativeName_Id); if (subjectAltNameExt == null) { return null; } @@ -1632,7 +1655,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { /** * This static method is the default implementation of the - * getSubjectAlternaitveNames method in X509Certificate. A + * getSubjectAlternativeNames method in X509Certificate. A * X509Certificate provider generally should overwrite this to * provide among other things caching for better performance. */ @@ -1666,11 +1689,12 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { } /** - * This method are the overridden implementation of + * This method is the overridden implementation of the * getIssuerAlternativeNames method in X509Certificate in the Sun * provider. It is better performance-wise since it returns cached * values. */ + @Override public synchronized Collection> getIssuerAlternativeNames() throws CertificateParsingException { // return cached value if we can @@ -1678,7 +1702,8 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { return cloneAltNames(issuerAlternativeNames); } IssuerAlternativeNameExtension issuerAltNameExt = - getIssuerAlternativeNameExtension(); + (IssuerAlternativeNameExtension)getExtensionIfParseable( + PKIXExtensions.IssuerAlternativeName_Id); if (issuerAltNameExt == null) { return null; } @@ -1696,7 +1721,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { /** * This static method is the default implementation of the - * getIssuerAlternaitveNames method in X509Certificate. A + * getIssuerAlternativeNames method in X509Certificate. A * X509Certificate provider generally should overwrite this to * provide among other things caching for better performance. */ diff --git a/test/jdk/java/security/cert/X509Certificate/GetUnparseableExtensions.java b/test/jdk/java/security/cert/X509Certificate/GetUnparseableExtensions.java new file mode 100644 index 00000000000..396e9a00a3d --- /dev/null +++ b/test/jdk/java/security/cert/X509Certificate/GetUnparseableExtensions.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2021, 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.security.cert.CertificateParsingException; +import java.security.cert.X509Certificate; +import jdk.test.lib.security.CertUtils; + +/* + * @test + * @bug 8251468 + * @library /test/lib + * @summary Check that X509Certificate.getSubjectAlternativeNames, + * getIssuerAlternativeNames and getExtendedKeyUsage throw + * CertificateParsingException if extension is unparseable/invalid. + */ +public class GetUnparseableExtensions { + + // Cert has 3 badly encoded extensions: + // 1. SubjectAlternativeNameExtension with a null RFC822Name + // 2. IssuerAlternativeNameExtension with a null RFC822Name + // 3. ExtendedKeyUsageExtension encoded as a Set instead of a Sequence + private final static String CERT_WITH_UNPARSEABLE_EXTS = """ + -----BEGIN CERTIFICATE----- + MIIDDTCCAfWgAwIBAgIIc/2fukmBqZgwDQYJKoZIhvcNAQELBQAwDTELMAkGA1UE + AxMCQ0EwHhcNMjExMDI2MTgxNzU4WhcNMjIwMTI0MTgxNzU4WjANMQswCQYDVQQD + EwJFMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKIIIsP6ghZ94hIl + U3G+D11vASSP7JMmX6G6opGKel60dZ5So3Tdj0E6VHehwcxEdh94LEIxvOkS3Cdh + hd1iiB4/q2InvLuGzSVvWAwYNkB7GbR31pIst0GAFdH+z/tVjjHcacBGwmysk8DN + Rmxm66AyJxHA1U/v64vx5kSGNoUAEcWm+OslxfdJ7nygnU+S6a/06sRvifVn7q7c + Kg4AIFE1+vWrcgYbApkPNjLiRGAr33TAb1y+nN1zW/luEMEQIJBd+YJW9OrPGMUr + SDSXfB06HscH1bTUfN2ngsxT2hy9eiCiDtagPIwYA0sVNjyUtfPsjAH1oxDPXzC5 + quJB5/sCAwEAAaNxMG8wHQYDVR0OBBYEFCqWMQBki21cSqKIHp4rFitf6pQ2MAsG + A1UdEQQEMAKBADALBgNVHRIEBDACgQAwHwYDVR0jBBgwFoAUJbvRN17hEohYsg1M + icq1mMpIwoAwEwYDVR0lBAwxCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEB + ABBqJ/yYXD1xueB63GRY4ZotO6ukEkJiPZIwrr2vZW+GMws2b9gqNoD+dL9AeYCA + Zb6RYbaNDY5OoJmEty9KbtON7Rt1LtCFuZbYKxrhW0dJgXLyNOgXr+x0g2btbvWV + r8U1icwHapZM5IqDKLivzZNzwv52mrJDuzWqmlhAIlPLIU1QfNQ1oC8HpFkL71Bb + sB/4OIxxjRzf0AGmb7aeQNfxag2oKlOwqzum1FLt8BaVjylc0aUATPtkgothK8nK + m5jXJmA4zA11ck0uJW39gDRuR0D1k4qm/s/5Iuhd6MRVDXEhVbJXuH2yzHcmbgRs + paD/he6C1JszWf7YrTsX3Fc= + -----END CERTIFICATE----- + """; + + @FunctionalInterface + public interface TestCase { + T test() throws Exception; + } + + public static void main(String[] args) throws Exception { + + X509Certificate cert = + CertUtils.getCertFromString(CERT_WITH_UNPARSEABLE_EXTS); + getExtension(() -> cert.getSubjectAlternativeNames()); + getExtension(() -> cert.getIssuerAlternativeNames()); + getExtension(() -> cert.getExtendedKeyUsage()); + } + + private static void getExtension(TestCase t) throws Exception { + try { + t.test(); + throw new Exception("Test FAILED"); + } catch (CertificateParsingException cpe) { + System.out.println(cpe.getMessage()); + } + } +} -- GitLab From a1ec4f961841fe0b580c32b37c77e3906ba66966 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Fri, 29 Oct 2021 13:05:22 +0000 Subject: [PATCH 124/890] 6854300: [TEST_BUG] java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java fails in jdk6u14 & jdk7 Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../SpuriousExitEnter_3.java | 129 +++++++++++------- 2 files changed, 83 insertions(+), 47 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 484a3fb3eed..2243e98e378 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -197,7 +197,6 @@ java/awt/Focus/6981400/Test1.java 8029675 windows-all,macosx-all java/awt/Focus/6981400/Test3.java 8173264 generic-all java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all,macosx-all java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 macosx-all,windows-all -java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java 6854300 generic-all java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java 8129778 generic-all java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java 8129778 generic-all java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java 8252713 linux-all diff --git a/test/jdk/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java b/test/jdk/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java index d942395bc8a..12c939fdba2 100644 --- a/test/jdk/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java +++ b/test/jdk/java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter_3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -49,44 +49,70 @@ " move the pointer between B to C.", */ -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Component; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Window; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.lang.reflect.InvocationTargetException; + import test.java.awt.regtesthelpers.Util; -import javax.swing.*; + +import javax.swing.JButton; +import javax.swing.JFrame; public class SpuriousExitEnter_3 { - static JFrame frame = new JFrame("SpuriousExitEnter_3_LW"); - static JButton jbutton = new JButton("jbutton"); - static Frame frame1 = new Frame("SpuriousExitEnter_3_HW"); - static Button button1 = new Button("button"); - - static EnterExitAdapter frameAdapter; - static EnterExitAdapter buttonAdapter; - static Robot r = Util.createRobot(); - - public static void testCase(Window w, Component comp) { - frameAdapter = new EnterExitAdapter(w); - buttonAdapter = new EnterExitAdapter(comp); - - w.addMouseListener(frameAdapter); - comp.addMouseListener(buttonAdapter); - - w.setSize(200, 200); - w.add(comp, BorderLayout.NORTH); - w.setLocationRelativeTo(null); - w.setVisible(true); - - Point centerA = new Point(comp.getLocationOnScreen().x + comp.getWidth() / 2, - comp.getLocationOnScreen().y + comp.getHeight() / 2); - Point centerB = new Point(w.getLocationOnScreen().x + w.getWidth() / 2, - w.getLocationOnScreen().y + w.getHeight() / 2); - //for moving from A outside: don't cross the A area. Move straight to the right. - Point centerC_1 = new Point(w.getLocationOnScreen().x + w.getWidth() + 20, //go right off the border - comp.getLocationOnScreen().y + comp.getHeight() / 2); //don't cross the A area! - - //for moving from B outside: don't cross the B area. Move straight to the bottom. - Point centerC_2 = new Point(w.getLocationOnScreen().x + w.getWidth() / 2, - w.getLocationOnScreen().y + w.getHeight() + 20); //go below the bottom border + static JFrame frame; + static JButton jbutton; + + static Frame frame1; + static Button button1; + + static final Robot r = Util.createRobot(); + + static volatile EnterExitAdapter frameAdapter; + static volatile EnterExitAdapter buttonAdapter; + static volatile Point centerA; + static volatile Point centerB; + static volatile Point centerC_1 ; + static volatile Point centerC_2; + + public static void testCase(Window w, Component comp) throws InterruptedException, InvocationTargetException { + EventQueue.invokeAndWait(()-> { + frameAdapter = new EnterExitAdapter(w); + buttonAdapter = new EnterExitAdapter(comp); + + w.addMouseListener(frameAdapter); + comp.addMouseListener(buttonAdapter); + + w.setSize(200, 200); + w.add(comp, BorderLayout.NORTH); + w.setLocationRelativeTo(null); + w.setVisible(true); + }); + + r.waitForIdle(); + r.delay(1000); + + EventQueue.invokeAndWait(()-> { + centerA = new Point(comp.getLocationOnScreen().x + comp.getWidth() / 2, + comp.getLocationOnScreen().y + comp.getHeight() / 2); + centerB = new Point(w.getLocationOnScreen().x + w.getWidth() / 2, + w.getLocationOnScreen().y + w.getHeight() / 2); + //for moving from A outside: don't cross the A area. Move straight to the right. + centerC_1 = new Point(w.getLocationOnScreen().x + w.getWidth() + 20, //go right off the border + comp.getLocationOnScreen().y + comp.getHeight() / 2); //don't cross the A area! + + //for moving from B outside: don't cross the B area. Move straight to the bottom. + centerC_2 = new Point(w.getLocationOnScreen().x + w.getWidth() / 2, + w.getLocationOnScreen().y + w.getHeight() + 20); //go below the bottom border + }); + //A and B areas Util.pointOnComp(comp, r); Util.waitForIdle(r); @@ -118,12 +144,23 @@ public class SpuriousExitEnter_3 { Util.waitForIdle(r); } - public static void main(String []s) - { - //LW case: - testCase(frame, jbutton); - //HW case - testCase(frame1, button1); + + public static void main(String []s) throws InterruptedException, InvocationTargetException { + EventQueue.invokeAndWait(() -> { + frame = new JFrame("SpuriousExitEnter_3_LW"); + jbutton = new JButton("jbutton"); + + frame1 = new Frame("SpuriousExitEnter_3_HW"); + button1 = new Button("button"); + }); + + try { + testCase(frame, jbutton); //LW case + testCase(frame1, button1); //HW case + } finally { + EventQueue.invokeLater(frame::dispose); + EventQueue.invokeLater(frame1::dispose); + } } private static void moveBetween(Robot r, Point first, Point second) { @@ -150,9 +187,9 @@ public class SpuriousExitEnter_3 { class EnterExitAdapter extends MouseAdapter { - private Component target; - private int enteredEventCount = 0; - private int exitedEventCount = 0; + private final Component target; + private volatile int enteredEventCount = 0; + private volatile int exitedEventCount = 0; public EnterExitAdapter(Component target) { this.target = target; @@ -170,7 +207,7 @@ class EnterExitAdapter extends MouseAdapter { } public void zeroCounters(){ - System.out.println("Zeroeing on " +target.getClass().getName()); + System.out.println("Zeroing on " +target.getClass().getName()); enteredEventCount = 0; exitedEventCount = 0; } -- GitLab From d6d82f52d4a4fac037ee9424503f8b7f11a61c40 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 29 Oct 2021 13:54:27 +0000 Subject: [PATCH 125/890] 8275608: runtime/Metaspace/elastic/TestMetaspaceAllocationMT2 too slow Reviewed-by: mbaesken, shade --- .../Metaspace/elastic/MetaspaceTestArena.java | 4 +-- .../MetaspaceTestManyArenasManyThreads.java | 6 ++-- .../elastic/MetaspaceTestWithThreads.java | 8 ++--- .../Metaspace/elastic/RandomAllocator.java | 34 ++++++++++++------- .../elastic/RandomAllocatorThread.java | 9 ++--- 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestArena.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestArena.java index 2da81adb288..5b6b03c7752 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestArena.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestArena.java @@ -25,8 +25,6 @@ import sun.hotspot.WhiteBox; -import java.util.concurrent.atomic.AtomicLong; - public class MetaspaceTestArena { long arena; @@ -38,7 +36,7 @@ public class MetaspaceTestArena { long numAllocated = 0; long deallocatedWords = 0; long numDeallocated = 0; - long numAllocationFailures = 0; + volatile long numAllocationFailures = 0; private synchronized boolean reachedCeiling() { return (allocatedWords - deallocatedWords) > allocationCeiling; diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java index 508e0aff732..3614fde13d3 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2021 SAP SE. All rights reserved. + * Copyright (c) 2021, 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 @@ -63,7 +63,7 @@ public class MetaspaceTestManyArenasManyThreads extends MetaspaceTestWithThreads Thread.sleep(200); for (RandomAllocatorThread t: threads) { - if (t.allocator.arena.numAllocationFailures > 0) { + if (t.allocator.arena.numAllocationFailures > 1000) { t.interrupt(); t.join(); context.destroyArena(t.allocator.arena); diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java index d9bcfc2458d..29582bcf7e3 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestWithThreads.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2021 SAP SE. All rights reserved. + * Copyright (c) 2021, 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 @@ -23,8 +23,6 @@ * */ -import java.util.Set; - public class MetaspaceTestWithThreads { // The context to use. @@ -53,6 +51,8 @@ public class MetaspaceTestWithThreads { // Stop all threads. for (Thread t: threads) { t.interrupt(); + } + for (Thread t: threads) { t.join(); } } diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocator.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocator.java index 23c2ebbeec8..9e2de9896dd 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocator.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocator.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2021 SAP SE. All rights reserved. + * Copyright (c) 2021, 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 @@ -46,7 +46,11 @@ public class RandomAllocator { ArrayList to_dealloc = new ArrayList<>(); long ticks = 0; - boolean allocationError = false; + + // Allocate (breathe in) until arena is full, then - to test the arena deallocator - deallocate some allocations + // and breathe in again until full. + boolean breatheIn = true; + int breatheOutTicks = 0; Random localRandom; @@ -57,7 +61,6 @@ public class RandomAllocator { // Allocate a random amount from the arena. If dice hits right, add this to the deallocation list. void allocateRandomly() { - allocationError = false; long word_size = profile.randomAllocationSize(); Allocation a = arena.allocate(word_size); if (a != null) { @@ -65,7 +68,9 @@ public class RandomAllocator { to_dealloc.add(a); } } else { - allocationError = true; + // On allocation error, breathe out a bit + breatheIn = false; + breatheOutTicks = 0; } } @@ -80,19 +85,20 @@ public class RandomAllocator { } public void tick() { - - if (!allocationError) { + if (breatheIn) { + // allocate until we hit the ceiling allocateRandomly(); - if(rollDice(profile.randomDeallocProbability)) { + if (rollDice(profile.randomDeallocProbability)) { deallocateRandomly(); } } else { - deallocateRandomly(); - allocationError = false; + if (++breatheOutTicks < 100) { + deallocateRandomly(); + } else { + breatheIn = true; + } } - ticks ++; - } public RandomAllocator(MetaspaceTestArena arena) { @@ -102,6 +108,10 @@ public class RandomAllocator { this.localRandom = new Random(RandomHelper.random().nextInt()); } + long numAllocationFailures() { + return arena.numAllocationFailures; + } + @Override public String toString() { return arena.toString() + ", ticks=" + ticks; diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocatorThread.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocatorThread.java index 73df203b610..ed507e9cfef 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocatorThread.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/RandomAllocatorThread.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2021 SAP SE. All rights reserved. + * Copyright (c) 2021, 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 @@ -23,7 +23,6 @@ * */ -import java.util.Random; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; @@ -55,9 +54,7 @@ public class RandomAllocatorThread extends Thread { } while (!Thread.interrupted()) { - for (int i = 0; i < 1000; i++) { - allocator.tick(); - } + allocator.tick(); } // System.out.println("+ [" + id + "] " + allocator); -- GitLab From 5facaa243aef6ad00cf71a047d0325710ce1f0a8 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 29 Oct 2021 16:12:19 +0000 Subject: [PATCH 126/890] 8276128: (bf) Remove unused constant ARRAY_BASE_OFFSET from Direct-X-Buffer Reviewed-by: lancea, iris, alanb --- .../share/classes/java/nio/Direct-X-Buffer.java.template | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template index 4c540d324a0..c227cec8e15 100644 --- a/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template +++ b/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template @@ -48,9 +48,6 @@ class Direct$Type$Buffer$RW$$BO$ #if[rw] - // Cached array base offset - private static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset($type$[].class); - // Cached unaligned-access capability protected static final boolean UNALIGNED = Bits.unaligned(); -- GitLab From 13265f9901ab8334bbe1e7a571a9c5f386275dbf Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 29 Oct 2021 16:13:23 +0000 Subject: [PATCH 127/890] 8274750: java/io/File/GetXSpace.java failed: '/dev': 191488 != 190976 Reviewed-by: rriggs, naoto --- test/jdk/java/io/File/GetXSpace.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/jdk/java/io/File/GetXSpace.java b/test/jdk/java/io/File/GetXSpace.java index 44a32aeb1f6..eacc7565227 100644 --- a/test/jdk/java/io/File/GetXSpace.java +++ b/test/jdk/java/io/File/GetXSpace.java @@ -51,6 +51,7 @@ import jdk.test.lib.Platform; import static java.lang.System.err; import static java.lang.System.out; +@SuppressWarnings("removal") public class GetXSpace { private static SecurityManager [] sma = { null, new Allow(), new DenyFSA(), @@ -213,8 +214,9 @@ public class GetXSpace { out.format(fmt, "df", s.total(), 0, s.free()); out.format(fmt, "getX", ts, fs, us); - // if the file system can dynamically change size, this check will fail - if (ts != s.total()) { + // If the file system can dynamically change size, this check will fail. + // This can happen on macOS for the /dev files system. + if (ts != s.total() && (!Platform.isOSX() || !s.name().equals("/dev"))) { long blockSize = 1; long numBlocks = 0; try { @@ -231,7 +233,6 @@ public class GetXSpace { throw new RuntimeException(e); } - // On macOS, the number of 1024 byte blocks might be incorrectly // calculated by 'df' using integer division by 2 of the number of // 512 byte blocks, resulting in a size smaller than the actual -- GitLab From cef9db9a69061d51630e40b94ceba4b4bf03a0ce Mon Sep 17 00:00:00 2001 From: Yumin Qi Date: Fri, 29 Oct 2021 16:15:35 +0000 Subject: [PATCH 128/890] 8276039: Remove unnecessary qualifications of java_lang_Class:: Reviewed-by: mikael, iklam --- src/hotspot/share/classfile/javaClasses.cpp | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/hotspot/share/classfile/javaClasses.cpp b/src/hotspot/share/classfile/javaClasses.cpp index 63d1eeb7986..9c92c767fd8 100644 --- a/src/hotspot/share/classfile/javaClasses.cpp +++ b/src/hotspot/share/classfile/javaClasses.cpp @@ -1004,12 +1004,12 @@ void java_lang_Class::create_mirror(Klass* k, Handle class_loader, Handle comp_mirror; // Setup indirection from mirror->klass - java_lang_Class::set_klass(mirror(), k); + set_klass(mirror(), k); InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(mirror->klass()); assert(oop_size(mirror()) == mk->instance_size(k), "should have been set"); - java_lang_Class::set_static_oop_field_count(mirror(), mk->compute_static_oop_field_count(mirror())); + set_static_oop_field_count(mirror(), mk->compute_static_oop_field_count(mirror())); // It might also have a component mirror. This mirror must already exist. if (k->is_array_klass()) { @@ -1038,7 +1038,7 @@ void java_lang_Class::create_mirror(Klass* k, Handle class_loader, // from the mirror so GC doesn't follow it after the klass has been deallocated. // This mirror looks like a primitive type, which logically it is because it // it represents no class. - java_lang_Class::set_klass(mirror(), NULL); + set_klass(mirror(), NULL); return; } } @@ -1242,7 +1242,7 @@ oop java_lang_Class::process_archived_mirror(Klass* k, oop mirror, oop archived_comp_mirror; if (k->is_typeArray_klass()) { // The primitive type mirrors are already archived. Get the archived mirror. - oop comp_mirror = java_lang_Class::component_mirror(mirror); + oop comp_mirror = component_mirror(mirror); archived_comp_mirror = HeapShared::find_archived_heap_object(comp_mirror); assert(archived_comp_mirror != NULL, "Must be"); } else { @@ -1254,14 +1254,14 @@ oop java_lang_Class::process_archived_mirror(Klass* k, oop mirror, return NULL; } } - java_lang_Class::set_component_mirror(archived_mirror, archived_comp_mirror); + set_component_mirror(archived_mirror, archived_comp_mirror); } else { assert(k->is_instance_klass(), "Must be"); // Reset local static fields in the mirror InstanceKlass::cast(k)->do_local_static_fields(&reset); - java_lang_Class:set_init_lock(archived_mirror, NULL); + set_init_lock(archived_mirror, NULL); set_protection_domain(archived_mirror, NULL); set_signers(archived_mirror, NULL); @@ -1374,7 +1374,7 @@ bool java_lang_Class::restore_archived_mirror(Klass *k, void java_lang_Class::fixup_module_field(Klass* k, Handle module) { assert(_module_offset != 0, "must have been computed already"); - java_lang_Class::set_module(k->java_mirror(), module()); + set_module(k->java_mirror(), module()); } void java_lang_Class::set_oop_size(HeapWord* java_class, size_t size) { @@ -1463,7 +1463,7 @@ oop java_lang_Class::name(Handle java_class, TRAPS) { assert(_name_offset != 0, "must be set"); oop o = java_class->obj_field(_name_offset); if (o == NULL) { - o = StringTable::intern(java_lang_Class::as_external_name(java_class()), THREAD); + o = StringTable::intern(as_external_name(java_class()), THREAD); java_class->obj_field_put(_name_offset, o); } return o; @@ -1490,19 +1490,19 @@ oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, Basic } #ifdef ASSERT InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(vmClasses::Class_klass()); - assert(java_lang_Class::static_oop_field_count(java_class) == 0, "should have been zeroed by allocation"); + assert(static_oop_field_count(java_class) == 0, "should have been zeroed by allocation"); #endif return java_class; } void java_lang_Class::set_klass(oop java_class, Klass* klass) { - assert(java_lang_Class::is_instance(java_class), "must be a Class object"); + assert(is_instance(java_class), "must be a Class object"); java_class->metadata_field_put(_klass_offset, klass); } void java_lang_Class::print_signature(oop java_class, outputStream* st) { - assert(java_lang_Class::is_instance(java_class), "must be a Class object"); + assert(is_instance(java_class), "must be a Class object"); Symbol* name = NULL; bool is_instance = false; if (is_primitive(java_class)) { @@ -1522,7 +1522,7 @@ void java_lang_Class::print_signature(oop java_class, outputStream* st) { } Symbol* java_lang_Class::as_signature(oop java_class, bool intern_if_not_found) { - assert(java_lang_Class::is_instance(java_class), "must be a Class object"); + assert(is_instance(java_class), "must be a Class object"); Symbol* name; if (is_primitive(java_class)) { name = vmSymbols::type_signature(primitive_type(java_class)); @@ -1553,7 +1553,7 @@ Symbol* java_lang_Class::as_signature(oop java_class, bool intern_if_not_found) // See Klass::external_name(). // For primitive type Java mirrors, its type name is returned. const char* java_lang_Class::as_external_name(oop java_class) { - assert(java_lang_Class::is_instance(java_class), "must be a Class object"); + assert(is_instance(java_class), "must be a Class object"); const char* name = NULL; if (is_primitive(java_class)) { name = type2name(primitive_type(java_class)); @@ -1580,7 +1580,7 @@ void java_lang_Class::release_set_array_klass(oop java_class, Klass* klass) { BasicType java_lang_Class::primitive_type(oop java_class) { - assert(java_lang_Class::is_primitive(java_class), "just checking"); + assert(is_primitive(java_class), "just checking"); Klass* ak = ((Klass*)java_class->metadata_field(_array_klass_offset)); BasicType type = T_VOID; if (ak != NULL) { @@ -1594,7 +1594,7 @@ BasicType java_lang_Class::primitive_type(oop java_class) { } BasicType java_lang_Class::as_BasicType(oop java_class, Klass** reference_klass) { - assert(java_lang_Class::is_instance(java_class), "must be a Class object"); + assert(is_instance(java_class), "must be a Class object"); if (is_primitive(java_class)) { if (reference_klass != NULL) (*reference_klass) = NULL; @@ -1610,7 +1610,7 @@ BasicType java_lang_Class::as_BasicType(oop java_class, Klass** reference_klass) oop java_lang_Class::primitive_mirror(BasicType t) { oop mirror = Universe::java_mirror(t); assert(mirror != NULL && mirror->is_a(vmClasses::Class_klass()), "must be a Class"); - assert(java_lang_Class::is_primitive(mirror), "must be primitive"); + assert(is_primitive(mirror), "must be primitive"); return mirror; } -- GitLab From fe6a2020873fe1eb8d4236dc1db3008f485f3195 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Fri, 29 Oct 2021 17:50:19 +0000 Subject: [PATCH 129/890] 8271356: Modify jdb to treat an empty command as a repeat of the previous command Reviewed-by: cjplummer, iklam --- .../sun/tools/example/debug/tty/Commands.java | 84 ++++++--- .../com/sun/tools/example/debug/tty/TTY.java | 76 ++++++-- .../tools/example/debug/tty/TTYResources.java | 8 +- .../example/debug/tty/TTYResources_ja.java | 6 +- .../example/debug/tty/TTYResources_zh_CN.java | 6 +- .../nsk/jdb/list/list003/list003.java | 172 ++++++++++++++++++ .../nsk/jdb/list/list003/list003a.java | 47 +++++ .../nsk/jdb/repeat/repeat001/repeat001.java | 148 +++++++++++++++ .../nsk/jdb/repeat/repeat001/repeat001a.java | 47 +++++ .../vmTestbase/nsk/share/jdb/JdbCommand.java | 3 + 10 files changed, 554 insertions(+), 43 deletions(-) create mode 100644 test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java create mode 100644 test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003a.java create mode 100644 test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java create mode 100644 test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001a.java diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Commands.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Commands.java index 0d96e9b1dbd..66533d1b933 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Commands.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Commands.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -45,6 +45,10 @@ import java.util.*; import java.io.*; class Commands { + /** + * Number of lines to show before the target line during {@code list}. + */ + protected static final int LIST_LINE_LOOKBEHIND = 4; abstract class AsyncExecution { abstract void action(); @@ -1472,29 +1476,33 @@ class Commands { } } - void commandList(StringTokenizer t) { + /** + * @param lineHint source line number to target by default, or {@code null} to use the execution point + * @return line hint to be used in a subsequent {@code list} command, if any + */ + Integer commandList(StringTokenizer t, Integer lineHint) { StackFrame frame = null; ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo(); if (threadInfo == null) { MessageOutput.println("No thread specified."); - return; + return null; } try { frame = threadInfo.getCurrentFrame(); } catch (IncompatibleThreadStateException e) { MessageOutput.println("Current thread isnt suspended."); - return; + return null; } if (frame == null) { MessageOutput.println("No frames on the current call stack"); - return; + return null; } Location loc = frame.location(); if (loc.method().isNative()) { MessageOutput.println("Current method is native"); - return; + return null; } String sourceFileName = null; @@ -1502,9 +1510,12 @@ class Commands { sourceFileName = loc.sourceName(); ReferenceType refType = loc.declaringType(); - int lineno = loc.lineNumber(); - if (t.hasMoreTokens()) { + int lineno; + var useDefault = !t.hasMoreTokens(); + if (useDefault) { + lineno = lineHint == null ? loc.lineNumber() : lineHint; + } else { String id = t.nextToken(); // See if token is a line number. @@ -1515,35 +1526,48 @@ class Commands { lineno = n.intValue(); } catch (java.text.ParseException jtpe) { // It isn't -- see if it's a method name. - List meths = refType.methodsByName(id); - if (meths == null || meths.size() == 0) { - MessageOutput.println("is not a valid line number or method name for", - new Object [] {id, refType.name()}); - return; - } else if (meths.size() > 1) { - MessageOutput.println("is an ambiguous method name in", - new Object [] {id, refType.name()}); - return; - } - loc = meths.get(0).location(); - lineno = loc.lineNumber(); + List meths = refType.methodsByName(id); + if (meths == null || meths.size() == 0) { + MessageOutput.println("is not a valid line number or method name for", + new Object [] {id, refType.name()}); + return null; + } else if (meths.size() > 1) { + MessageOutput.println("is an ambiguous method name in", + new Object [] {id, refType.name()}); + return null; + } + loc = meths.get(0).location(); + lineno = loc.lineNumber(); } } - int startLine = Math.max(lineno - 4, 1); - int endLine = startLine + 9; + int startLine = Math.max(lineno - LIST_LINE_LOOKBEHIND, 1); + int endLine = startLine + 10; if (lineno < 0) { MessageOutput.println("Line number information not available for"); - } else if (Env.sourceLine(loc, lineno) == null) { - MessageOutput.println("is an invalid line number for", - new Object [] {Integer.valueOf(lineno), - refType.name()}); + } else if (useDefault && Env.sourceLine(loc, startLine) == null) { + /* + * If we're out of range with a default line number then we've hit EOF on auto-advance. Stay at this + * position until a different source location is requested, as in GDB. + */ + MessageOutput.println("EOF"); + return lineno; + } else if (!useDefault && Env.sourceLine(loc, lineno) == null) { + MessageOutput.println( + "is an invalid line number for", + new Object[] { + Integer.valueOf(lineno), + refType.name() + } + ); + return null; } else { - for (int i = startLine; i <= endLine; i++) { + for (int i = startLine; i < endLine; i++) { String sourceLine = Env.sourceLine(loc, i); if (sourceLine == null) { - break; + // Next listing will start just out of range, triggering an EOF message. + return i + LIST_LINE_LOOKBEHIND; } - if (i == lineno) { + if (i == loc.lineNumber()) { MessageOutput.println("source line number current line and line", new Object [] {Integer.valueOf(i), sourceLine}); @@ -1553,6 +1577,7 @@ class Commands { sourceLine}); } } + return endLine + LIST_LINE_LOOKBEHIND; // start next listing with `endLine' } } catch (AbsentInformationException e) { MessageOutput.println("No source information available for:", loc.toString()); @@ -1561,6 +1586,7 @@ class Commands { } catch(IOException exc) { MessageOutput.println("I/O exception occurred:", exc.toString()); } + return null; } void commandLines(StringTokenizer t) { // Undocumented command: useful for testing diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java index f6bd858d9be..6e1ddcb1b84 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -44,6 +44,21 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.io.*; public class TTY implements EventNotifier { + /** + * Commands that are repeatable on empty input. + */ + protected static final Set REPEATABLE = Set.of( + "up", "down", "step", "stepi", "next", "cont", "list", "pop", "reenter" + ); + + /** + * Commands that reset the default source line to be displayed by {@code list}. + */ + protected static final Set LIST_RESET = Set.of( + "run", "suspend", "resume", "up", "down", "kill", "interrupt", "threadgroup", "step", "stepi", "next", "cont", + "pop", "reenter" + ); + EventHandler handler = null; /** @@ -59,6 +74,16 @@ public class TTY implements EventNotifier { private volatile boolean shuttingDown = false; + /** + * The number of the next source line to target for {@code list}, if any. + */ + protected Integer nextListTarget = null; + + /** + * Whether to repeat when the user enters an empty command. + */ + protected boolean repeat = false; + public void setShuttingDown(boolean s) { shuttingDown = s; } @@ -335,6 +360,7 @@ public class TTY implements EventNotifier { {"read", "y", "y"}, {"redefine", "n", "n"}, {"reenter", "n", "n"}, + {"repeat", "y", "y"}, {"resume", "n", "n"}, {"run", "y", "n"}, {"save", "n", "n"}, @@ -408,12 +434,15 @@ public class TTY implements EventNotifier { }; - void executeCommand(StringTokenizer t) { + /** + * @return the name (first token) of the command processed + */ + String executeCommand(StringTokenizer t) { String cmd = t.nextToken().toLowerCase(); + // Normally, prompt for the next command after this one is done boolean showPrompt = true; - /* * Anything starting with # is discarded as a no-op or 'comment'. */ @@ -426,8 +455,8 @@ public class TTY implements EventNotifier { try { int repeat = Integer.parseInt(cmd); String subcom = t.nextToken(""); - while (repeat-- > 0) { - executeCommand(new StringTokenizer(subcom)); + for (int r = 0; r < repeat; r += 1) { + cmd = executeCommand(new StringTokenizer(subcom)); showPrompt = false; // Bypass the printPrompt() below. } } catch (NumberFormatException exc) { @@ -435,6 +464,7 @@ public class TTY implements EventNotifier { } } else { int commandNumber = isCommand(cmd); + /* * Check for an unknown command */ @@ -448,7 +478,6 @@ public class TTY implements EventNotifier { MessageOutput.println("Command is not supported on a read-only VM connection", cmd); } else { - Commands evaluator = new Commands(); try { if (cmd.equals("print")) { @@ -550,7 +579,7 @@ public class TTY implements EventNotifier { } else if (cmd.equals("unwatch")) { evaluator.commandUnwatch(t); } else if (cmd.equals("list")) { - evaluator.commandList(t); + nextListTarget = evaluator.commandList(t, repeat ? nextListTarget : null); } else if (cmd.equals("lines")) { // Undocumented command: useful for testing. evaluator.commandLines(t); } else if (cmd.equals("classpath")) { @@ -596,6 +625,8 @@ public class TTY implements EventNotifier { } else if (cmd.equals("version")) { evaluator.commandVersion(progname, Bootstrap.virtualMachineManager()); + } else if (cmd.equals("repeat")) { + doRepeat(t); } else if (cmd.equals("quit") || cmd.equals("exit")) { if (handler != null) { handler.shutdown(); @@ -620,6 +651,12 @@ public class TTY implements EventNotifier { if (showPrompt) { MessageOutput.printPrompt(); } + + if (LIST_RESET.contains(cmd)) { + nextListTarget = null; + } + + return cmd; } /* @@ -661,7 +698,6 @@ public class TTY implements EventNotifier { } } - void readCommand(StringTokenizer t) { if (t.hasMoreTokens()) { String cmdfname = t.nextToken(); @@ -673,6 +709,19 @@ public class TTY implements EventNotifier { } } + protected void doRepeat(StringTokenizer t) { + if (t.hasMoreTokens()) { + var choice = t.nextToken().toLowerCase(); + if ((choice.equals("on") || choice.equals("off")) && !t.hasMoreTokens()) { + repeat = choice.equals("on"); + } else { + MessageOutput.println("repeat usage"); + } + } else { + MessageOutput.println(repeat ? "repeat is on" : "repeat is off"); + } + } + /** * Read and execute a command file. Return true if the file was read * else false; @@ -749,8 +798,6 @@ public class TTY implements EventNotifier { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - String lastLine = null; - Thread.currentThread().setPriority(Thread.NORM_PRIORITY); /* @@ -788,6 +835,9 @@ public class TTY implements EventNotifier { // Process interactive commands. MessageOutput.printPrompt(); + + String lastLine = null; + String lastCommandName = null; while (true) { String ln = in.readLine(); if (ln == null) { @@ -809,7 +859,11 @@ public class TTY implements EventNotifier { StringTokenizer t = new StringTokenizer(ln); if (t.hasMoreTokens()) { lastLine = ln; - executeCommand(t); + lastCommandName = executeCommand(t); + } else if (repeat && lastLine != null && REPEATABLE.contains(lastCommandName)) { + // We want list auto-advance even if the user started with a listing target. + String newCommand = lastCommandName.equals("list") && nextListTarget != null ? "list" : lastLine; + executeCommand(new StringTokenizer(newCommand)); } else { MessageOutput.printPrompt(); } diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java index 5f773288e5e..8ba3c42c83a 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -110,6 +110,7 @@ public class TTYResources extends java.util.ListResourceBundle { {"dbgtrace command value must be an integer:", "dbgtrace command value must be an integer: {0}"}, {"Deferring.", "Deferring {0}.\nIt will be set after the class is loaded."}, {"End of stack.", "End of stack."}, + {"EOF", "EOF"}, {"Error popping frame", "Error popping frame - {0}"}, {"Error reading file", "Error reading ''{0}'' - {1}"}, {"Error redefining class to file", "Error redefining {0} to {1} - {2}"}, @@ -260,6 +261,9 @@ public class TTYResources extends java.util.ListResourceBundle { " .[(argument_type,...)]" }, {"Removed:", "Removed: {0}"}, + {"repeat is on", "Repeat is on"}, + {"repeat is off", "Repeat is off"}, + {"repeat usage", "Usage: repeat "}, {"Requested stack frame is no longer active:", "Requested stack frame is no longer active: {0,number,integer}"}, {"run command is valid only with launched VMs", "'run ' command is valid only with launched VMs"}, {"run", "run {0}"}, @@ -436,6 +440,8 @@ public class TTYResources extends java.util.ListResourceBundle { "\n" + "!! -- repeat last command\n" + " -- repeat command n times\n" + + "repeat -- show whether GDB-style empty command repetition is enabled\n" + + "repeat -- enable/disable GDB-style repetition\n" + "# -- discard (no-op)\n" + "help (or ?) -- list commands\n" + "dbgtrace [flag] -- same as dbgtrace command line option\n" + diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java index af4a782e85a..1f0dd4a3e22 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -110,6 +110,7 @@ public class TTYResources_ja extends java.util.ListResourceBundle { {"dbgtrace command value must be an integer:", "dbgtrace\u30B3\u30DE\u30F3\u30C9\u5024\u306F\u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"}, {"Deferring.", "\u9045\u5EF6\u3057\u305F{0}\u3002\n\u30AF\u30E9\u30B9\u304C\u30ED\u30FC\u30C9\u3055\u308C\u305F\u5F8C\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002"}, {"End of stack.", "\u30B9\u30BF\u30C3\u30AF\u306E\u7D42\u308F\u308A\u3002"}, + {"EOF", "EOF"}, {"Error popping frame", "\u30D5\u30EC\u30FC\u30E0\u306E\u30DD\u30C3\u30D7\u4E2D\u306E\u30A8\u30E9\u30FC - {0}"}, {"Error reading file", "''{0}''\u306E\u8AAD\u53D6\u308A\u30A8\u30E9\u30FC - {1}"}, {"Error redefining class to file", "{0}\u3092{1}\u306B\u518D\u5B9A\u7FA9\u4E2D\u306E\u30A8\u30E9\u30FC - {2}"}, @@ -252,6 +253,9 @@ public class TTYResources_ja extends java.util.ListResourceBundle { "\u4F7F\u7528\u65B9\u6CD5: stop [go|thread] [] \n \"go\"\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\u505C\u6B62\u5F8C\u3059\u3050\u306B\u518D\u958B\u3057\u307E\u3059\n \"thread\"\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\u505C\u6B62\u3057\u305F\u30B9\u30EC\u30C3\u30C9\u306E\u307F\u4E2D\u65AD\u3057\u307E\u3059\n \"go\"\u3082\"thread\"\u3082\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u306F\u3001\u3059\u3079\u3066\u306E\u30B9\u30EC\u30C3\u30C9\u3092\u4E2D\u65AD\u3057\u307E\u3059\n \u6574\u6570\u306E\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306F\u3001\u6307\u5B9A\u3055\u308C\u305F\u30B9\u30EC\u30C3\u30C9\u3067\u306E\u307F\u505C\u6B62\u3057\u307E\u3059\n \"at\"\u3068\"in\"\u306F\u540C\u3058\u610F\u5473\u3092\u6301\u3061\u307E\u3059\n \u306F\u884C\u756A\u53F7\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u306B\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059:\n :\n .[(argument_type,...)]" }, {"Removed:", "{0}\u306F\u524A\u9664\u3055\u308C\u307E\u3057\u305F"}, + {"repeat is on", "Repeat is on"}, + {"repeat is off", "Repeat is off"}, + {"repeat usage", "Usage: repeat "}, {"Requested stack frame is no longer active:", "\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u305F\u30B9\u30BF\u30C3\u30AF\u30FB\u30D5\u30EC\u30FC\u30E0\u306F\u73FE\u5728\u30A2\u30AF\u30C6\u30A3\u30D6\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0,number,integer}"}, {"run command is valid only with launched VMs", "'run '\u30B3\u30DE\u30F3\u30C9\u306F\u8D77\u52D5\u6E08\u306EVM\u3067\u306E\u307F\u6709\u52B9\u3067\u3059"}, {"run", "{0}\u306E\u5B9F\u884C"}, diff --git a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java index 2215941048a..88c1cd3e878 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -110,6 +110,7 @@ public class TTYResources_zh_CN extends java.util.ListResourceBundle { {"dbgtrace command value must be an integer:", "dbgtrace \u547D\u4EE4\u503C\u5FC5\u987B\u4E3A\u6574\u6570\uFF1A{0}"}, {"Deferring.", "\u6B63\u5728\u5EF6\u8FDF{0}\u3002\n\u5C06\u5728\u52A0\u8F7D\u7C7B\u540E\u8BBE\u7F6E\u3002"}, {"End of stack.", "\u5806\u6808\u7ED3\u675F\u3002"}, + {"EOF", "EOF"}, {"Error popping frame", "\u4F7F\u5E27\u51FA\u6808\u65F6\u51FA\u9519 - {0}"}, {"Error reading file", "\u8BFB\u53D6 ''{0}'' \u65F6\u51FA\u9519 - {1}"}, {"Error redefining class to file", "\u5C06{0}\u91CD\u65B0\u5B9A\u4E49\u4E3A{1}\u65F6\u51FA\u9519 - {2}"}, @@ -252,6 +253,9 @@ public class TTYResources_zh_CN extends java.util.ListResourceBundle { "\u7528\u6CD5\uFF1Astop [go|thread] [] \n \u5982\u679C\u6307\u5B9A \"go\"\uFF0C\u5219\u5728\u505C\u6B62\u540E\u7ACB\u5373\u6062\u590D\n \u5982\u679C\u6307\u5B9A \"thread\"\uFF0C\u5219\u4EC5\u6302\u8D77\u5728\u5176\u4E2D\u505C\u6B62\u7684\u7EBF\u7A0B\n \u5982\u679C\u65E2\u672A\u6307\u5B9A \"go\" \u4E5F\u672A\u6307\u5B9A \"thread\"\uFF0C\u5219\u6302\u8D77\u6240\u6709\u7EBF\u7A0B\n \u5982\u679C\u6307\u5B9A\u4EE5\u6574\u6570\u8868\u793A\u7684 \uFF0C\u5219\u4EC5\u5728\u6307\u5B9A\u7684\u7EBF\u7A0B\u4E2D\u505C\u6B62\n \"at\" \u548C \"in\" \u7684\u542B\u4E49\u76F8\u540C\n \u53EF\u4EE5\u662F\u884C\u53F7\u6216\u65B9\u6CD5\uFF1A\n :\n .[(argument_type,...)]" }, {"Removed:", "\u5DF2\u5220\u9664: {0}"}, + {"repeat is on", "Repeat is on"}, + {"repeat is off", "Repeat is off"}, + {"repeat usage", "Usage: repeat "}, {"Requested stack frame is no longer active:", "\u8BF7\u6C42\u7684\u5806\u6808\u5E27\u4E0D\u518D\u6709\u6548: {0,number,integer}"}, {"run command is valid only with launched VMs", "'run ' \u547D\u4EE4\u4EC5\u5BF9\u542F\u52A8\u7684 VM \u6709\u6548"}, {"run", "\u8FD0\u884C{0}"}, diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java new file mode 100644 index 00000000000..0858e93adb0 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2021, 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 + * + * @summary + * VM Testbase keywords: [jpda, jdb] + * VM Testbase readme: + * DECSRIPTION + * This tests the GDB-style auto-advance feature of `list', which is enabled and disabled through the `repeat' command. + * The test consists of two program: + * list003.java - launches jdb and debuggee and executes test cases + * list003a.java - the debugged application + * COMMENTS + * + * @library /vmTestbase + * /test/lib + * @build nsk.jdb.list.list003.list003a + * @run main/othervm + * nsk.jdb.list.list003.list003 + * -arch=${os.family}-${os.simpleArch} + * -waittime=5 + * -debugee.vmkind=java + * -transport.address=dynamic + * -jdb=${test.jdk}/bin/jdb + * -jdb.option="-J-Duser.language=en -J-Duser.country=US" + * -java.options="${test.vm.opts} ${test.java.opts}" + * -workdir=. + * -debugee.vmkeys="${test.vm.opts} ${test.java.opts}" + */ + +package nsk.jdb.list.list003; + +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import static java.util.stream.Collectors.toList; + +import nsk.share.jdb.JdbTest; +import nsk.share.jdb.JdbCommand; + + +public class list003 extends JdbTest { + static final String PACKAGE_NAME = "nsk.jdb.list.list003"; + static final String TEST_CLASS = PACKAGE_NAME + ".list003"; + static final String DEBUGGEE_CLASS = TEST_CLASS + "a"; + static final String FIRST_BREAK = DEBUGGEE_CLASS + ".main"; + + /** + * Represents a line output by the {@code list} command. + */ + protected static record ListLine(int number, boolean active) { + public static ListLine parse(String line) { + String[] tokens = line.split("\\s+"); + return new ListLine( + Integer.parseInt(tokens[0]), + tokens.length >= 2 && tokens[1].equals("=>") + ); + } + } + + protected static boolean isPrompt(String line) { + return line.trim().equals("main[1]"); + } + + protected static List parseListOutput(String[] lines) { + List lineList = new ArrayList<>(Arrays.asList(lines)); + if (!isPrompt(lineList.remove(lineList.size() - 1))) { + throw new AssertionError("Expected trailing prompt"); + } else if (lineList.size() == 1 && lineList.get(0).equals("EOF")) { + return new ArrayList<>(); + } else { + return lineList.stream().map(ListLine::parse).collect(toList()); + } + } + + public static void main(String[] args) { + System.exit(run(args, System.out) + JCK_STATUS_BASE); + } + + public static int run(String[] args, PrintStream out) { + debuggeeClass = DEBUGGEE_CLASS; + firstBreak = FIRST_BREAK; + return new list003().runTest(args, out); + } + + @Override + protected void runCases() { + try { + runCasesNoCleanup(); + } finally { + jdb.contToExit(1); + } + } + + protected void runCasesNoCleanup() { + if (jdb.receiveReplyFor(JdbCommand.repeat + "on").length != 1) { + throw new AssertionError("Missing or unexpected output"); + } + + List autoList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list)); + int lineNo = autoList.stream().filter(ListLine::active).findFirst().get().number(); + List manualList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list + (lineNo - 1))); + if (manualList.stream().filter(ListLine::active).findFirst().get().number() != lineNo) { + throw new AssertionError("Manual listing didn't mark the active source line"); + } + + // Verify that we can correctly list by auto-advance all the way to EOF + List prevList = manualList; + int reps; + for (reps = 0; !prevList.isEmpty(); reps += 1) { + // Exercise both explicit `list' and auto-repeat + var command = reps % 2 == 0 ? JdbCommand.list : ""; + + List currList = parseListOutput(jdb.receiveReplyFor(command)); + if (currList.equals(prevList)) { + // This guards against infinite looping + throw new AssertionError("Consecutive listings were identical"); + } + int prevEnd = prevList.get(prevList.size() - 1).number(); + if (!currList.isEmpty() && currList.get(0).number() != prevEnd + 1) { + throw new AssertionError("Consecutive listings weren't for consecutive source chunks"); + } + prevList = currList; + } + if (reps < 2) { + throw new AssertionError("Didn't get enough consecutive list reps"); + } + + String[] lines = jdb.receiveReplyFor(JdbCommand.up); + if (!lines[0].equals("End of stack.") || !isPrompt(lines[1])) { + throw new AssertionError("Unexpected output from `up'"); + } + List resetList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list)); + if (!resetList.stream().anyMatch(ListLine::active)) { + throw new AssertionError("List target didn't reset to active line"); + } + + List listing = parseListOutput(jdb.receiveReplyFor(JdbCommand.list + "1")); + if (!listing.stream().anyMatch(l -> l.number() == 1)) { + throw new AssertionError("Manual listing displayed the wrong lines"); + } + + List targetedList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list + "1")); + autoList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list)); + if (autoList.get(0).number() != targetedList.get(targetedList.size() - 1).number() + 1) { + throw new AssertionError("Auto-advance didn't work after targeted list"); + } + } +} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003a.java new file mode 100644 index 00000000000..29a715d706c --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003a.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021, 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 nsk.jdb.list.list003; + +import nsk.share.Log; +import nsk.share.jdb.JdbArgumentHandler; + +import java.io.PrintStream; + + +/* This is debuggee application */ +public class list003a { + static list003a _list003a = new list003a(); + + public static void main(String[] args) { + System.exit(list003.JCK_STATUS_BASE + _list003a.runIt(args, System.out)); + } + + public int runIt(String[] args, PrintStream out) { + JdbArgumentHandler argumentHandler = new JdbArgumentHandler(args); + Log log = new Log(out, argumentHandler); + + log.display("Debuggee PASSED"); + return list003.PASSED; + } +} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java new file mode 100644 index 00000000000..f6e45c1d2d6 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021, 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 + * + * @summary + * VM Testbase keywords: [jpda, jdb] + * VM Testbase readme: + * DECSRIPTION + * Tests the operation of the `repeat' commands, which print and change the status of GDB-style command repetition and + * list auto-advance. The particular behavior of `list' when repitition is on is tested in the `list' tests. + * The test consists of two program: + * repeat001.java - launches jdb and debuggee and executes test cases + * repeat001a.java - the debugged application + * COMMENTS + * + * @library /vmTestbase + * /test/lib + * @build nsk.jdb.repeat.repeat001.repeat001a + * @run main/othervm + * nsk.jdb.repeat.repeat001.repeat001 + * -arch=${os.family}-${os.simpleArch} + * -waittime=5 + * -debugee.vmkind=java + * -transport.address=dynamic + * -jdb=${test.jdk}/bin/jdb + * -jdb.option="-J-Duser.language=en -J-Duser.country=US" + * -java.options="${test.vm.opts} ${test.java.opts}" + * -workdir=. + * -debugee.vmkeys="${test.vm.opts} ${test.java.opts}" + */ + +package nsk.jdb.repeat.repeat001; + +import java.io.PrintStream; +import java.util.Arrays; + +import nsk.share.jdb.JdbTest; +import nsk.share.jdb.JdbCommand; +import jdk.test.lib.Utils; + + +public class repeat001 extends JdbTest { + static final String PACKAGE_NAME = "nsk.jdb.repeat.repeat001"; + static final String TEST_CLASS = PACKAGE_NAME + ".repeat001"; + static final String DEBUGGEE_CLASS = TEST_CLASS + "a"; + static final String FIRST_BREAK = DEBUGGEE_CLASS + ".main"; + + public static void main(String[] args) { + System.exit(run(args, System.out) + JCK_STATUS_BASE); + } + + public static int run(String[] args, PrintStream out) { + debuggeeClass = DEBUGGEE_CLASS; + firstBreak = FIRST_BREAK; + return new repeat001().runTest(args, out); + } + + protected static boolean isPrompt(String line) { + return line.trim().equals("main[1]"); + } + + @Override + protected void runCases() { + try { + runCasesNoCleanup(); + } finally { + jdb.contToExit(1); + } + } + + protected void runCasesNoCleanup() { + // Verify that repeat is off initially + String[] reply = jdb.receiveReplyFor(JdbCommand.repeat); + if (reply.length != 2 || !isPrompt(reply[1])) { + throw new AssertionError("Unexpected output"); + } + if (!reply[0].equals("Repeat is off")) { + throw new AssertionError("Incorrect initial repeat setting"); + } + + // Verify that list auto-advance is disabled + String[] firstList = jdb.receiveReplyFor(JdbCommand.list); + String[] secondList = jdb.receiveReplyFor(JdbCommand.list); + if (!Arrays.equals(firstList, secondList)) { + throw new AssertionError("Listing inconsistent with repeat off"); + } + + // Verify that command repetition doesn't happen when disabled + reply = jdb.receiveReplyFor(""); + if (reply.length != 1 || !isPrompt(reply[0])) { + throw new AssertionError("Unexpected output"); + } + + reply = jdb.receiveReplyFor(JdbCommand.repeat + "on"); + if (reply.length != 1 || !isPrompt(reply[0])) { + throw new AssertionError("Unexpected output"); + } + + // Verify that repeat is reported on + reply = jdb.receiveReplyFor(JdbCommand.repeat); + if (reply.length != 2 || !isPrompt(reply[1])) { + throw new AssertionError("Unexpected output"); + } + if (!reply[0].equals("Repeat is on")) { + throw new AssertionError("Incorrect repeat status reported"); + } + + // Verify that non-repeatable commands still don't repeat + if (jdb.receiveReplyFor(JdbCommand.print + "0").length != 2) { + throw new AssertionError("Unexpected output"); + } + if (jdb.receiveReplyFor("").length != 1) { + throw new AssertionError("Unexpected output"); + } + + // Verify that repeated commands are repeatable + // (`up' just prints `End of stack.' since we're stopped in `main') + reply = jdb.receiveReplyFor("2 2 " + JdbCommand.up); + if (reply.length != 5 || !isPrompt(reply[4])) { + throw new AssertionError("Unexpected output"); + } + if (!Arrays.equals(reply, jdb.receiveReplyFor(""))) { + throw new AssertionError("Repeated command didn't repeat correctly"); + } + } +} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001a.java new file mode 100644 index 00000000000..00c47706429 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001a.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021, 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 nsk.jdb.repeat.repeat001; + +import nsk.share.Log; +import nsk.share.jdb.JdbArgumentHandler; + +import java.io.PrintStream; + + +/* This is debuggee application */ +public class repeat001a { + static repeat001a _repeat001a = new repeat001a(); + + public static void main(String[] args) { + System.exit(repeat001.JCK_STATUS_BASE + _repeat001a.runIt(args, System.out)); + } + + public int runIt(String[] args, PrintStream out) { + JdbArgumentHandler argumentHandler = new JdbArgumentHandler(args); + Log log = new Log(out, argumentHandler); + + log.display("Debuggee PASSED"); + return repeat001.PASSED; + } +} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/JdbCommand.java b/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/JdbCommand.java index a3ba7af957a..4b3c87474a5 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/JdbCommand.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/JdbCommand.java @@ -99,6 +99,8 @@ package nsk.share.jdb; * * !! -- repeat last command * -- repeat command n times + * repeat -- show whether GDB-style empty command repetition is enabled + * repeat -- enable/disable GDB-style repetition * help (or ?) -- list commands * version -- print version information * exit (or quit) -- exit debugger @@ -145,6 +147,7 @@ public class JdbCommand { public static final String read = "read "; public static final String redefine = "redefine "; public static final String reenter = "reenter" + ls; + public static final String repeat = "repeat "; public static final String resume = "resume "; public static final String run = "run "; public static final String set = "set "; -- GitLab From 5021a12ceada3192e81e2c06b556e7c80cd6cf31 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Fri, 29 Oct 2021 18:03:10 +0000 Subject: [PATCH 130/890] 8274855: vectorapi tests failing with assert(!vbox->is_Phi()) failed Reviewed-by: kvn --- src/hotspot/share/opto/vector.cpp | 15 +++++++++++++++ test/hotspot/jtreg/ProblemList-Xcomp.txt | 3 --- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/opto/vector.cpp b/src/hotspot/share/opto/vector.cpp index b6b157e328f..65f32178865 100644 --- a/src/hotspot/share/opto/vector.cpp +++ b/src/hotspot/share/opto/vector.cpp @@ -315,6 +315,21 @@ Node* PhaseVector::expand_vbox_node_helper(Node* vbox, } new_phi = C->initial_gvn()->transform(new_phi); return new_phi; + } else if (vbox->is_Phi() && (vect->is_Vector() || vect->is_LoadVector())) { + // Handle the case when the allocation input to VectorBoxNode is a phi + // but the vector input is not, which can definitely be the case if the + // vector input has been value-numbered. It seems to be safe to do by + // construction because VectorBoxNode and VectorBoxAllocate come in a + // specific order as a result of expanding an intrinsic call. After that, if + // any of the inputs to VectorBoxNode are value-numbered they can only + // move up and are guaranteed to dominate. + Node* new_phi = new PhiNode(vbox->as_Phi()->region(), box_type); + for (uint i = 1; i < vbox->req(); i++) { + Node* new_box = expand_vbox_node_helper(vbox->in(i), vect, box_type, vect_type); + new_phi->set_req(i, new_box); + } + new_phi = C->initial_gvn()->transform(new_phi); + return new_phi; } else if (vbox->is_Proj() && vbox->in(0)->Opcode() == Op_VectorBoxAllocate) { VectorBoxAllocateNode* vbox_alloc = static_cast(vbox->in(0)); return expand_vbox_alloc_node(vbox_alloc, vect, box_type, vect_type); diff --git a/test/hotspot/jtreg/ProblemList-Xcomp.txt b/test/hotspot/jtreg/ProblemList-Xcomp.txt index b3196f6a601..9647d4d2cf8 100644 --- a/test/hotspot/jtreg/ProblemList-Xcomp.txt +++ b/test/hotspot/jtreg/ProblemList-Xcomp.txt @@ -39,7 +39,4 @@ vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java 8273095 generic-all serviceability/sa/TestJhsdbJstackMixed.java 8248675 linux-aarch64 -compiler/vectorapi/VectorCastShape64Test.java 8274855 generic-x64 -compiler/vectorapi/VectorCastShape128Test.java 8274855 generic-x64 - compiler/codegen/aes/TestAESMain.java 8274323 linux-x64,windows-x64 -- GitLab From 5bbc8d3cb2ce487b367ee1a621d78699c9b30100 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Fri, 29 Oct 2021 21:38:24 +0000 Subject: [PATCH 131/890] 8274621: NullPointerException because listenAddress[0] is null Reviewed-by: sspitsyn, lmesnik, cjplummer --- .../jdk/test/lib/process/ProcessTools.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/lib/jdk/test/lib/process/ProcessTools.java b/test/lib/jdk/test/lib/process/ProcessTools.java index 2cb5db3f6c4..7998bbbbe82 100644 --- a/test/lib/jdk/test/lib/process/ProcessTools.java +++ b/test/lib/jdk/test/lib/process/ProcessTools.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -116,12 +116,12 @@ public final class ProcessTools { * The default redirects of STDOUT and STDERR are started *

    * It is possible to wait for the process to get to a warmed-up state - * via {@linkplain Predicate} condition on the STDOUT + * via {@linkplain Predicate} condition on the STDOUT/STDERR *

    * * @param name The process name * @param processBuilder The process builder - * @param linePredicate The {@linkplain Predicate} to use on the STDOUT + * @param linePredicate The {@linkplain Predicate} to use on the STDOUT and STDERR. * Used to determine the moment the target app is * properly warmed-up. * It can be null - in that case the warmup is skipped. @@ -146,14 +146,14 @@ public final class ProcessTools { * The default redirects of STDOUT and STDERR are started *

    * It is possible to wait for the process to get to a warmed-up state - * via {@linkplain Predicate} condition on the STDOUT and monitor the + * via {@linkplain Predicate} condition on the STDOUT/STDERR and monitor the * in-streams via the provided {@linkplain Consumer} *

    * * @param name The process name * @param processBuilder The process builder * @param lineConsumer The {@linkplain Consumer} the lines will be forwarded to - * @param linePredicate The {@linkplain Predicate} to use on the STDOUT + * @param linePredicate The {@linkplain Predicate} to use on the STDOUT and STDERR. * Used to determine the moment the target app is * properly warmed-up. * It can be null - in that case the warmup is skipped. @@ -193,10 +193,14 @@ public final class ProcessTools { CountDownLatch latch = new CountDownLatch(1); if (linePredicate != null) { StreamPumper.LinePump pump = new StreamPumper.LinePump() { + // synchronization between stdout and stderr pumps + private final Object sync = new Object(); @Override protected void processLine(String line) { - if (latch.getCount() > 0 && linePredicate.test(line)) { - latch.countDown(); + synchronized (sync) { + if (latch.getCount() > 0 && linePredicate.test(line)) { + latch.countDown(); + } } } }; @@ -241,13 +245,13 @@ public final class ProcessTools { * The default redirects of STDOUT and STDERR are started *

    * It is possible to wait for the process to get to a warmed-up state - * via {@linkplain Predicate} condition on the STDOUT. The warm-up will - * wait indefinitely. + * via {@linkplain Predicate} condition on the STDOUT/STDERR. + * The warm-up will wait indefinitely. *

    * * @param name The process name * @param processBuilder The process builder - * @param linePredicate The {@linkplain Predicate} to use on the STDOUT + * @param linePredicate The {@linkplain Predicate} to use on the STDOUT and STDERR. * Used to determine the moment the target app is * properly warmed-up. * It can be null - in that case the warmup is skipped. -- GitLab From 687567822a5380fb7d8c5b54ae548b2a5c848187 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sat, 30 Oct 2021 09:03:27 +0000 Subject: [PATCH 132/890] 8273831: PrintServiceLookup spawns 2 threads in the current classloader, getting orphaned Reviewed-by: aivanov --- .../sun/print/PrintServiceLookupProvider.java | 20 +++-- .../sun/print/PrintServiceLookupProvider.java | 29 +++++-- .../FlushCustomClassLoader.java | 84 +++++++++++++++++++ 3 files changed, 117 insertions(+), 16 deletions(-) create mode 100644 test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java diff --git a/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java b/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java index 268fc9b69af..7fa1b201340 100644 --- a/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java +++ b/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java @@ -26,10 +26,8 @@ package sun.print; import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; import java.io.IOException; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Vector; import java.security.AccessController; @@ -54,6 +52,8 @@ import java.io.FileReader; import java.net.URL; import java.nio.file.Files; +import sun.awt.util.ThreadGroupUtils; + /* * Remind: This class uses solaris commands. We also need a linux * version @@ -204,14 +204,18 @@ public class PrintServiceLookupProvider extends PrintServiceLookup return BSD_LPD; } - + @SuppressWarnings("removal") public PrintServiceLookupProvider() { // start the printer listener thread if (pollServices) { - Thread thr = new Thread(null, new PrinterChangeListener(), - "PrinterListener", 0, false); - thr.setDaemon(true); - thr.start(); + AccessController.doPrivileged((PrivilegedAction) () -> { + Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(), + new PrinterChangeListener(), + "PrinterListener", 0, false); + thr.setContextClassLoader(null); + thr.setDaemon(true); + return thr; + }).start(); IPPPrintService.debug_println(debugPrefix+"polling turned on"); } } diff --git a/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java b/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java index 1d76ebae479..28055c1afec 100644 --- a/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java +++ b/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java @@ -25,6 +25,8 @@ package sun.print; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import javax.print.DocFlavor; @@ -41,6 +43,8 @@ import javax.print.attribute.PrintServiceAttribute; import javax.print.attribute.PrintServiceAttributeSet; import javax.print.attribute.standard.PrinterName; +import sun.awt.util.ThreadGroupUtils; + public class PrintServiceLookupProvider extends PrintServiceLookup { private PrintService defaultPrintService; @@ -81,22 +85,31 @@ public class PrintServiceLookupProvider extends PrintServiceLookup { return win32PrintLUS; } + @SuppressWarnings("removal") public PrintServiceLookupProvider() { if (win32PrintLUS == null) { win32PrintLUS = this; // start the local printer listener thread - Thread thr = new Thread(null, new PrinterChangeListener(), - "PrinterListener", 0, false); - thr.setDaemon(true); - thr.start(); + AccessController.doPrivileged((PrivilegedAction) () -> { + Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(), + new PrinterChangeListener(), + "PrinterListener", 0, false); + thr.setContextClassLoader(null); + thr.setDaemon(true); + return thr; + }).start(); // start the remote printer listener thread - Thread remThr = new Thread(null, new RemotePrinterChangeListener(), - "RemotePrinterListener", 0, false); - remThr.setDaemon(true); - remThr.start(); + AccessController.doPrivileged((PrivilegedAction) () -> { + Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(), + new RemotePrinterChangeListener(), + "RemotePrinterListener", 0, false); + thr.setContextClassLoader(null); + thr.setDaemon(true); + return thr; + }).start(); } /* else condition ought to never happen! */ } diff --git a/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java b/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java new file mode 100644 index 00000000000..6e0a25a69d0 --- /dev/null +++ b/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java @@ -0,0 +1,84 @@ +/* + * Copyright Amazon.com Inc. 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.awt.EventQueue; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.net.URL; +import java.net.URLClassLoader; + +import javax.print.DocFlavor; +import javax.print.PrintServiceLookup; + +/** + * @test + * @bug 8273831 + * @summary Tests custom class loader cleanup + */ +public final class FlushCustomClassLoader { + + public static void main(String[] args) throws Exception { + Reference loader = getLoader("testMethod"); + + int attempt = 0; + while (loader.get() != null) { + if (++attempt > 10) { + throw new RuntimeException("Too many attempts: " + attempt); + } + System.gc(); + Thread.sleep(1000); + System.out.println("Not freed, attempt: " + attempt); + } + } + + public static void testMethod() { + DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; + PrintServiceLookup.lookupPrintServices(flavor, null); + } + + private static Reference getLoader(String m) throws Exception { + /* + * The print services are stored per the AppContext, and each AppContext + * caches the "current" class loader during creation. + * see javax.print.PrintServiceLookup. + * + * To prevent AppContext from cache our test loader we force AppContext + * creation early by the invokeAndWait. + * The "EventQueue.invokeAndWait(() -> {});" can be removed when the + * AppContext usage will be deleted in the PrintServiceLookup + */ + EventQueue.invokeAndWait(() -> {}); + + URL url = FlushCustomClassLoader.class.getProtectionDomain() + .getCodeSource().getLocation(); + URLClassLoader loader = new URLClassLoader(new URL[]{url}, null); + + Thread ct = Thread.currentThread(); + ct.setContextClassLoader(loader); + Class cls = Class.forName("FlushCustomClassLoader", true, loader); + cls.getDeclaredMethod(m).invoke(null); + ct.setContextClassLoader(null); + loader.close(); + return new WeakReference<>(loader); + } +} -- GitLab From b7104ba9a9006ab65e08ea9d7db22e72611ed07c Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Sat, 30 Oct 2021 10:01:05 +0000 Subject: [PATCH 133/890] 8196017: java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java fails Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../GetMousePositionWithPopup.java | 32 +++++++++++-------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 2243e98e378..b7e772135dc 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -205,7 +205,6 @@ java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTes java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java 8000171 windows-all -java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8196017 windows-all java/awt/Scrollbar/ScrollbarMouseWheelTest/ScrollbarMouseWheelTest.java 8196018 windows-all,linux-all java/awt/TrayIcon/ActionCommand/ActionCommand.java 8150540 windows-all java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8150540 windows-all diff --git a/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java b/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java index 28f1faa82ee..fd779d721f3 100644 --- a/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java +++ b/test/jdk/java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -23,8 +23,10 @@ import test.java.awt.regtesthelpers.Util; -import javax.swing.*; -import java.awt.*; +import javax.swing.SwingUtilities; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; @@ -33,11 +35,10 @@ import java.awt.event.MouseMotionAdapter; * @key headful * @bug 8012026 8027154 * @summary Component.getMousePosition() does not work in an applet on MacOS - * @author Petr Pchelko * @library ../../regtesthelpers * @build Util * @compile GetMousePositionWithPopup.java - * @run main/othervm GetMousePositionWithPopup + * @run main GetMousePositionWithPopup */ public class GetMousePositionWithPopup { @@ -48,6 +49,7 @@ public class GetMousePositionWithPopup { public static void main(String[] args) throws Exception { try { Robot r = Util.createRobot(); + r.setAutoDelay(100); r.mouseMove(0, 0); Util.waitForIdle(null); @@ -61,7 +63,7 @@ public class GetMousePositionWithPopup { Util.waitForIdle(null); r.mouseMove(149, 149); Util.waitForIdle(null); - r.mouseMove(150, 150); + r.mouseMove(170, 170); Util.waitForIdle(null); } finally { @@ -78,20 +80,25 @@ public class GetMousePositionWithPopup { private static void constructTestUI() { frame1 = new Frame(); frame1.setBounds(100, 100, 100, 100); + frame1.setVisible(true); frame1.addMouseMotionListener(new MouseMotionAdapter() { - @Override public void mouseMoved(MouseEvent e) { + if (frame2 != null) { + return; + } frame2 = new Frame(); frame2.setBounds(120, 120, 120, 120); - + frame2.setVisible(true); frame2.addMouseMotionListener(new MouseMotionAdapter() { @Override public void mouseMoved(MouseEvent e) { Point positionInFrame2 = frame2.getMousePosition(); - if (positionInFrame2.x != 30 || positionInFrame2.y != 30) { - throw new RuntimeException("Wrong position reported. Should be [30, 30] but was [" + + int deltaX = Math.abs(50 - positionInFrame2.x); + int deltaY = Math.abs(50 - positionInFrame2.y); + if (deltaX > 2 || deltaY > 2) { + throw new RuntimeException("Wrong position reported. Should be [50, 50] but was [" + positionInFrame2.x + ", " + positionInFrame2.y + "]"); } @@ -101,10 +108,7 @@ public class GetMousePositionWithPopup { } } }); - - frame2.setVisible(true); } }); - frame1.setVisible(true); } -} \ No newline at end of file +} -- GitLab From bf2e9ee9d321ed289466b2410f12ad10504d01a2 Mon Sep 17 00:00:00 2001 From: Man Cao Date: Sun, 31 Oct 2021 04:58:16 +0000 Subject: [PATCH 134/890] 8275080: G1CollectedHeap::expand() returns the wrong value Co-authored-by: Jonathan Joo Reviewed-by: tschatzl, kbarrett --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index ee47e55f9d2..ccb0869d6f2 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1310,7 +1310,7 @@ bool G1CollectedHeap::expand(size_t expand_bytes, WorkerThreads* pretouch_worker vm_exit_out_of_memory(aligned_expand_bytes, OOM_MMAP_ERROR, "G1 heap expansion"); } } - return regions_to_expand > 0; + return expanded_by > 0; } bool G1CollectedHeap::expand_single_region(uint node_index) { -- GitLab From 158831e4c3fa637905fda6f28e9adf8e957b9e55 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Mon, 1 Nov 2021 05:13:55 +0000 Subject: [PATCH 135/890] 8274320: os::fork_and_exec() should be using posix_spawn Reviewed-by: mdoerr, dholmes --- src/hotspot/os/posix/os_posix.cpp | 45 +++++++------------------ src/hotspot/os/windows/os_windows.cpp | 2 +- src/hotspot/share/runtime/os.hpp | 5 +-- src/hotspot/share/utilities/vmError.cpp | 2 +- 4 files changed, 15 insertions(+), 39 deletions(-) diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 60820b31f92..8ec5b152d34 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -1955,40 +1956,16 @@ char** os::get_environ() { return environ; } // doesn't block SIGINT et al. // -this function is unsafe to use in non-error situations, mainly // because the child process will inherit all parent descriptors. -int os::fork_and_exec(const char* cmd, bool prefer_vfork) { - const char * argv[4] = {"sh", "-c", cmd, NULL}; - - pid_t pid ; - +int os::fork_and_exec(const char* cmd) { + const char* argv[4] = {"sh", "-c", cmd, NULL}; + pid_t pid = -1; char** env = os::get_environ(); - - // Use always vfork on AIX, since its safe and helps with analyzing OOM situations. - // Otherwise leave it up to the caller. - AIX_ONLY(prefer_vfork = true;) - #ifdef __APPLE__ - pid = ::fork(); - #else - pid = prefer_vfork ? ::vfork() : ::fork(); - #endif - - if (pid < 0) { - // fork failed - return -1; - - } else if (pid == 0) { - // child process - - ::execve("/bin/sh", (char* const*)argv, env); - - // execve failed - ::_exit(-1); - - } else { - // copied from J2SE ..._waitForProcessExit() in UNIXProcess_md.c; we don't - // care about the actual exit code, for now. - + // Note: cast is needed because posix_spawn() requires - for compatibility with ancient + // C-code - a non-const argv/envp pointer array. But it is fine to hand in literal + // strings and just cast the constness away. See also ProcessImpl_md.c. + int rc = ::posix_spawn(&pid, "/bin/sh", NULL, NULL, (char**) argv, env); + if (rc == 0) { int status; - // Wait for the child process to exit. This returns immediately if // the child has already exited. */ while (::waitpid(pid, &status, 0) < 0) { @@ -1998,7 +1975,6 @@ int os::fork_and_exec(const char* cmd, bool prefer_vfork) { default: return -1; } } - if (WIFEXITED(status)) { // The child exited normally; get its exit code. return WEXITSTATUS(status); @@ -2013,6 +1989,9 @@ int os::fork_and_exec(const char* cmd, bool prefer_vfork) { // Unknown exit code; pass it through return status; } + } else { + // Don't log, we are inside error handling + return -1; } } diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 6d0610ccd75..6f8c88d764d 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -5624,7 +5624,7 @@ int os::PlatformMonitor::wait(jlong millis) { // Run the specified command in a separate process. Return its exit value, // or -1 on failure (e.g. can't create a new process). -int os::fork_and_exec(const char* cmd, bool dummy /* ignored */) { +int os::fork_and_exec(const char* cmd) { STARTUPINFO si; PROCESS_INFORMATION pi; DWORD exit_code; diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index c70a6b39821..45ed150ec7a 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -515,10 +515,7 @@ class os: AllStatic { // run cmd in a separate process and return its exit code; or -1 on failures. // Note: only safe to use in fatal error situations. - // The "prefer_vfork" argument is only used on POSIX platforms to - // indicate whether vfork should be used instead of fork to spawn the - // child process (ignored on AIX, which always uses vfork). - static int fork_and_exec(const char *cmd, bool prefer_vfork = false); + static int fork_and_exec(const char *cmd); // Call ::exit() on all platforms static void exit(int num); diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index d6152164dbb..4ae43cedf52 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1788,7 +1788,7 @@ void VM_ReportJavaOutOfMemory::doit() { #endif tty->print_cr("\"%s\"...", cmd); - if (os::fork_and_exec(cmd, true) < 0) { + if (os::fork_and_exec(cmd) < 0) { tty->print_cr("os::fork_and_exec failed: %s (%s=%d)", os::strerror(errno), os::errno_name(errno), errno); } -- GitLab From 5bb1992b8408a0d196b1afa308bc00d007458dbd Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 1 Nov 2021 08:22:59 +0000 Subject: [PATCH 136/890] 8275868: ciReplay: Inlining fails with "unloaded signature classes" due to wrong protection domains Reviewed-by: kvn, dlong, thartmann --- src/hotspot/share/ci/ciEnv.cpp | 3 + src/hotspot/share/ci/ciReplay.cpp | 6 + .../jtreg/compiler/ciReplay/CiReplayBase.java | 17 +- .../compiler/ciReplay/DumpReplayBase.java | 112 +++++++ .../TestInliningProtectionDomain.java | 304 ++++++++++++++++++ 5 files changed, 438 insertions(+), 4 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java create mode 100644 test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 1d58cdb9525..57ccaa2234a 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1646,6 +1646,9 @@ void ciEnv::dump_replay_data_helper(outputStream* out) { GrowableArray* objects = _factory->get_ci_metadata(); out->print_cr("# %d ciObject found", objects->length()); + // The very first entry is the InstanceKlass of the root method of the current compilation in order to get the right + // protection domain to load subsequent classes during replay compilation. + out->print_cr("instanceKlass %s", CURRENT_ENV->replay_name(task()->method()->method_holder())); for (int i = 0; i < objects->length(); i++) { objects->at(i)->dump_replay_data(out); } diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index 90db561dece..903c42ecea7 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -874,6 +874,12 @@ class CompileReplay : public StackObj { void process_instanceKlass(TRAPS) { // just load the referenced class Klass* k = parse_klass(CHECK); + if (_protection_domain() == NULL) { + // The first entry is the holder class of the method for which a replay compilation is requested. + // Use the same protection domain to load all subsequent classes in order to resolve all classes + // in signatures of inlinees. This ensures that inlining can be done as stated in the replay file. + _protection_domain = Handle(_thread, k->protection_domain()); + } if (k == NULL) { return; } diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index 7ef7d66c2ff..6af306f8b08 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -72,7 +72,7 @@ public abstract class CiReplayBase { REPLAY_FILE_OPTION}; private static final String[] REPLAY_OPTIONS = new String[]{DISABLE_COREDUMP_ON_CRASH, "-XX:+IgnoreUnrecognizedVMOptions", "-XX:TypeProfileLevel=222", - "-XX:+ReplayCompiles", REPLAY_FILE_OPTION}; + "-XX:+ReplayCompiles"}; protected final Optional runServer; private static int dummy; @@ -152,7 +152,7 @@ public abstract class CiReplayBase { .forEach(File::delete); } - public static void cleanup() { + public void cleanup() { removeFromCurrentDirectoryStartingWith("core"); removeFromCurrentDirectoryStartingWith("replay"); removeFromCurrentDirectoryStartingWith(HS_ERR_NAME); @@ -160,6 +160,10 @@ public abstract class CiReplayBase { remove(REPLAY_FILE_NAME); } + public String getReplayFileName() { + return REPLAY_FILE_NAME; + } + public boolean generateReplay(boolean needCoreDump, String... vmopts) { OutputAnalyzer crashOut; String crashOutputString; @@ -170,13 +174,13 @@ public abstract class CiReplayBase { options.add(needCoreDump ? ENABLE_COREDUMP_ON_CRASH : DISABLE_COREDUMP_ON_CRASH); if (needCoreDump) { // CiReplayBase$TestMain needs to be quoted because of shell eval - options.add("-XX:CompileOnly='" + getTestClass() + "::test'"); + options.add("-XX:CompileOnly='" + getTestClass() + "::" + getTestMethod() + "'"); options.add("'" + getTestClass() + "'"); crashOut = ProcessTools.executeProcess( CoreUtils.addCoreUlimitCommand( ProcessTools.createTestJvm(options.toArray(new String[0])))); } else { - options.add("-XX:CompileOnly=" + getTestClass() + "::test"); + options.add("-XX:CompileOnly=" + getTestClass() + "::" + getTestMethod()); options.add(getTestClass()); crashOut = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); } @@ -204,6 +208,10 @@ public abstract class CiReplayBase { return TestMain.class.getName(); } + public String getTestMethod() { + return "test"; + } + public void commonTests() { positiveTest(); if (Platform.isTieredSupported()) { @@ -215,6 +223,7 @@ public abstract class CiReplayBase { try { List allAdditionalOpts = new ArrayList<>(); allAdditionalOpts.addAll(Arrays.asList(REPLAY_OPTIONS)); + allAdditionalOpts.add("-XX:ReplayDataFile=" + getReplayFileName()); allAdditionalOpts.addAll(Arrays.asList(additionalVmOpts)); OutputAnalyzer oa = ProcessTools.executeProcess(getTestJvmCommandlineWithPrefix( RUN_SHELL_ZERO_LIMIT, allAdditionalOpts.toArray(new String[0]))); diff --git a/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java new file mode 100644 index 00000000000..4d783993578 --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021, 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.ciReplay; + +import jdk.test.lib.Asserts; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +public abstract class DumpReplayBase extends CiReplayBase { + + private static final String DUMP_REPLAY_PATTERN = "replay_pid"; + private List replayFiles; + private String replayFileName; + + @Override + public void runTest(boolean needCoreDump, String... args) { + throw new RuntimeException("use runTests(String...)"); + } + + public void runTest(String... args) { + if (generateReplay(args)) { + testAction(); + cleanup(); + } else { + throw new Error("Host is not configured to generate cores"); + } + } + + @Override + public void cleanup() { + replayFiles.forEach(f -> remove(f.getName())); + } + + @Override + public String getReplayFileName() { + Asserts.assertEQ(replayFiles.size(), 1, "Test should only dump 1 replay file when trying to replay compile"); + return replayFileName; + } + + public boolean generateReplay(String... vmopts) { + OutputAnalyzer oa; + try { + List options = new ArrayList<>(Arrays.asList(vmopts)); + options.add("-XX:CompileCommand=option," + getTestClass() + "::" + getTestMethod() + ",bool,DumpReplay,true"); + options.add("-XX:+IgnoreUnrecognizedVMOptions"); + options.add("-XX:TypeProfileLevel=222"); + options.add("-XX:CompileCommand=compileonly," + getTestClass() + "::" + getTestMethod()); + options.add("-Xbatch"); + options.add(getTestClass()); + oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); + Asserts.assertEquals(oa.getExitValue(), 0, "Crash JVM exits gracefully"); + replayFiles = Files.list(Paths.get(".")) + .map(Path::toFile) + .filter(f -> f.getName().startsWith(DUMP_REPLAY_PATTERN)).collect(Collectors.toList()); + Asserts.assertFalse(replayFiles.isEmpty(), "Did not find a replay file starting with " + DUMP_REPLAY_PATTERN); + replayFileName = replayFiles.get(0).getName(); + } catch (Throwable t) { + throw new Error("Can't create replay: " + t, t); + } + return true; + } + + public int getCompileIdFromFile(String replayFileName) { + Pattern p = Pattern.compile("replay_pid.*_compid([0-9]+)\\.log"); + Matcher matcher = p.matcher(replayFileName); + if (matcher.find()) { + try { + return Integer.parseInt(matcher.group(1)); + } catch (NumberFormatException e) { + throw new RuntimeException("Could not parse compile id from filename \"" + replayFileName + "\""); + } + } else { + throw new RuntimeException("Could not find compile id in filename \"" + replayFileName + "\""); + } + } + + public List getReplayFiles() { + return replayFiles; + } +} diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java b/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java new file mode 100644 index 00000000000..6693295a5d5 --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2021, 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 8275868 + * @library / /test/lib + * @summary Testing that ciReplay inlining does not fail with unresolved signature classes. + * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.debug == true & vm.compiler2.enabled + * @modules java.base/jdk.internal.misc + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.ciReplay.TestInliningProtectionDomain + */ + +package compiler.ciReplay; + +import jdk.test.lib.Asserts; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TestInliningProtectionDomain extends DumpReplayBase { + public static final String LOG_FILE_NORMAL = "hotspot_normal.log"; + public static final String LOG_FILE_REPLAY = "hotspot_replay.log"; + private final String[] commandLineReplay; + + private final String className; + + public static void main(String[] args) { + new TestInliningProtectionDomain("ProtectionDomainTestCompiledBefore", true); + new TestInliningProtectionDomain("ProtectionDomainTestNoOtherCompilationPublic", false); + new TestInliningProtectionDomain("ProtectionDomainTestNoOtherCompilationPrivate", false); + new TestInliningProtectionDomain("ProtectionDomainTestNoOtherCompilationPrivateString", false); + } + + public TestInliningProtectionDomain(String className, boolean compileBar) { + this.className = className; + List commandLineNormal = new ArrayList<>(List.of("-XX:LogFile=" + LOG_FILE_NORMAL + "", "-XX:+LogCompilation", "-XX:-TieredCompilation", + "-XX:CompileCommand=exclude," + getTestClass() + "::main", + "-XX:CompileCommand=option," + getTestClass() + "::test,bool,PrintInlining,true")); + if (compileBar) { + commandLineNormal.add("-XX:CompileCommand=compileonly," + getTestClass() + "::bar"); + } + commandLineReplay = new String[] + {"-XX:LogFile=" + LOG_FILE_REPLAY + "", "-XX:+LogCompilation", + "-XX:CompileCommand=option," + getTestClass() + "::test,bool,PrintInlining,true"}; + runTest(commandLineNormal.toArray(new String[0])); + } + + @Override + public void testAction() { + positiveTest(commandLineReplay); + String klass = "compiler.ciReplay." + className; + String entryString = klass + " " + "test"; + boolean inlineFails = className.equals("ProtectionDomainTestNoOtherCompilationPrivate"); + int inlineeCount = inlineFails ? 1 : 5; + + List inlineesNormal = parseLogFile(LOG_FILE_NORMAL, entryString, "compile_id='" + getCompileIdFromFile(getReplayFileName()), inlineeCount); + List inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount); + verifyLists(inlineesNormal, inlineesReplay, inlineeCount); + + if (inlineFails) { + Asserts.assertTrue(compare(inlineesNormal.get(0), "compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", + "bar", inlineesNormal.get(0).isUnloadedSignatureClasses())); + Asserts.assertTrue(compare(inlineesReplay.get(0), "compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", + "bar", inlineesReplay.get(0).isDisallowedByReplay())); + } else { + Asserts.assertTrue(compare(inlineesNormal.get(4), "compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline())); + Asserts.assertTrue(compare(inlineesReplay.get(4), "compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay())); + } + remove(LOG_FILE_NORMAL); + remove(LOG_FILE_REPLAY); + } + + private void verifyLists(List inlineesNormal, List inlineesReplay, int expectedSize) { + if (!inlineesNormal.equals(inlineesReplay)) { + System.err.println("Normal entries:"); + inlineesNormal.forEach(System.err::println); + System.err.println("Replay entries:"); + inlineesReplay.forEach(System.err::println); + Asserts.fail("different inlining decision in normal run vs. replay run"); + } + Asserts.assertEQ(expectedSize, inlineesNormal.size(), "unexpected number of inlinees found"); + } + + public static boolean compare(Entry e, String klass, String method, boolean kind) { + return e.klass.equals(klass) && e.method.equals(method) && kind; + } + + public static List parseLogFile(String logFile, String rootMethod, String nmethodMatch, int inlineeCount) { + String nmethodStart = " inlinees = new ArrayList<>(); + int foundLines = 0; + try (var br = Files.newBufferedReader(Paths.get(logFile))) { + String line; + boolean nmethodLine = false; + boolean inlinineLine = false; + while ((line = br.readLine()) != null) { + if (nmethodLine) { + // Ignore other entries which could be in between nmethod entry and inlining statements + if (line.startsWith(" ")) { + inlinineLine = true; + Pattern p = Pattern.compile("(\\S+)::(\\S+).*bytes\\)\s+(.*)"); + Matcher matcher = p.matcher(line); + Asserts.assertTrue(matcher.find(), "must find inlinee method"); + inlinees.add(new Entry(matcher.group(1), matcher.group(2), matcher.group(3).trim())); + foundLines++; + } else if (inlinineLine) { + Asserts.assertEQ(foundLines, inlineeCount, "did not find all inlinees"); + return inlinees; + } + } else { + nmethodLine = line.startsWith(nmethodStart) && line.contains(nmethodMatch); + if (nmethodLine) { + Asserts.assertTrue(line.contains(rootMethod), "should only dump inline information for " + rootMethod); + } + } + } + } catch (IOException e) { + throw new Error("Failed to read " + logFile + " data: " + e, e); + } + Asserts.fail("Should have found inlinees"); + return inlinees; + } + + + @Override + public String getTestClass() { + return "compiler.ciReplay." + className; + } + + static class Entry { + String klass; + String method; + String reason; + + public Entry(String klass, String method, String reason) { + this.klass = klass; + this.method = method; + this.reason = reason; + } + + public boolean isNormalInline() { + return reason.equals("inline (hot)"); + } + + public boolean isForcedByReplay() { + return reason.equals("force inline by ciReplay"); + } + + public boolean isDisallowedByReplay() { + return reason.equals("disallowed by ciReplay"); + } + + public boolean isUnloadedSignatureClasses() { + return reason.equals("unloaded signature classes"); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + if (!(other instanceof Entry)) { + return false; + } + + Entry e = (Entry)other; + return klass.equals(e.klass) && method.equals(e.method); + } + } +} + +class ProtectionDomainTestCompiledBefore { + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + bar(); // Ensure that bar() was compiled + } + for (int i = 0; i < 10000; i++) { + test(); + } + } + + public static void test() { + bar(); + } + + // Integer should be resolved for the protection domain of this class because the separate compilation of bar() in + // the normal run will resolve all classes in the signature. Inlining succeeds. + private static Integer bar() { + InliningFoo.foo(); + return null; + } +} + +class ProtectionDomainTestNoOtherCompilationPublic { + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + test(); + } + } + + public static void test() { + bar(); // Not compiled before separately + } + + // Integer should be resolved for the protection domain of this class because getDeclaredMethods is called in normal run + // when validating main() method. In this process, all public methods of this class are visited and its signature classes + // are resolved. Inlining of bar() succeeds. + public static Integer bar() { + InliningFoo.foo(); + return null; + } +} + +class ProtectionDomainTestNoOtherCompilationPrivate { + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + test(); + } + } + + public static void test() { + bar(); // Not compiled before separately + } + + // Integer should be unresolved for the protection domain of this class even though getDeclaredMethods is called in normal + // run when validating main() method. In this process, only public methods of this class are visited and its signature + // classes are resolved. Since this method is private, the signature classes are not resolved for this protection domain. + // Inlining of bar() should fail in normal run with "unresolved signature classes". Therefore, replay compilation should + // also not inline bar(). + private static Integer bar() { + InliningFoo.foo(); + return null; + } +} + +class ProtectionDomainTestNoOtherCompilationPrivateString { + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + test(); + } + } + + public static void test() { + bar(); // Not compiled before separately + } + + // Integer should be resovled for the protection domain of this class because getDeclaredMethods is called in normal run + // when validating main() method. In this process, public methods of this class are visited and its signature classes + // are resolved. bar() is private and not visited in this process (i.e. no resolution of String). But since main() + // has String[] as parameter, the String class will be resolved for this protection domain. Inlining of bar() succeeds. + private static String bar() { + InliningFoo.foo(); + return null; + } +} + +class InliningFoo { + public static void foo() { + foo2(); + } + + private static void foo2() { + InliningBar.bar(); + } +} + + +class InliningBar { + public static void bar() { + bar2(); + } + + private static void bar2() {} +} -- GitLab From dbf5100dd705fbe4a3aeae49405ca541d581f106 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Mon, 1 Nov 2021 12:17:16 +0000 Subject: [PATCH 137/890] 8276201: Shenandoah: Race results degenerated GC to enter wrong entry point Reviewed-by: shade --- src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp index 6e209d993d2..0fbffc5feec 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp @@ -113,8 +113,10 @@ void ShenandoahDegenGC::op_degenerated() { op_mark(); case _degenerated_mark: - // No fallthrough. Continue mark, handed over from concurrent mark - if (_degen_point == ShenandoahDegenPoint::_degenerated_mark) { + // No fallthrough. Continue mark, handed over from concurrent mark if + // concurrent mark has yet completed + if (_degen_point == ShenandoahDegenPoint::_degenerated_mark && + heap->is_concurrent_mark_in_progress()) { op_finish_mark(); } assert(!heap->cancelled_gc(), "STW mark can not OOM"); -- GitLab From 89ade1d7e88ee005c3fd2136d84e298d94f9a67c Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 1 Nov 2021 12:30:43 +0000 Subject: [PATCH 138/890] 8273416: C2: assert(false) failed: bad AD file after JDK-8252372 with UseSSE={0,1} Reviewed-by: kvn, roland --- src/hotspot/cpu/x86/x86_32.ad | 20 ++++++++++++++++++++ src/hotspot/share/opto/castnode.hpp | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index 18d213cc31a..a8cdd981b76 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -7203,6 +7203,7 @@ instruct castLL( eRegL dst ) %{ %} instruct castFF( regF dst ) %{ + predicate(UseSSE >= 2); match(Set dst (CastFF dst)); format %{ "#castFF of $dst" %} ins_encode( /*empty encoding*/ ); @@ -7211,6 +7212,25 @@ instruct castFF( regF dst ) %{ %} instruct castDD( regD dst ) %{ + predicate(UseSSE >= 2); + match(Set dst (CastDD dst)); + format %{ "#castDD of $dst" %} + ins_encode( /*empty encoding*/ ); + ins_cost(0); + ins_pipe( empty ); +%} + +instruct castFF_PR( regFPR dst ) %{ + predicate(UseSSE < 2); + match(Set dst (CastFF dst)); + format %{ "#castFF of $dst" %} + ins_encode( /*empty encoding*/ ); + ins_cost(0); + ins_pipe( empty ); +%} + +instruct castDD_PR( regDPR dst ) %{ + predicate(UseSSE < 2); match(Set dst (CastDD dst)); format %{ "#castDD of $dst" %} ins_encode( /*empty encoding*/ ); diff --git a/src/hotspot/share/opto/castnode.hpp b/src/hotspot/share/opto/castnode.hpp index 95574e60457..2aa318c0e24 100644 --- a/src/hotspot/share/opto/castnode.hpp +++ b/src/hotspot/share/opto/castnode.hpp @@ -140,7 +140,7 @@ public: init_class_id(Class_CastFF); } virtual int Opcode() const; - virtual uint ideal_reg() const { return Op_RegF; } + virtual uint ideal_reg() const { return in(1)->ideal_reg(); } }; class CastDDNode: public ConstraintCastNode { @@ -150,7 +150,7 @@ public: init_class_id(Class_CastDD); } virtual int Opcode() const; - virtual uint ideal_reg() const { return Op_RegD; } + virtual uint ideal_reg() const { return in(1)->ideal_reg(); } }; class CastVVNode: public ConstraintCastNode { -- GitLab From 4ac8403f9a4cedcb5d56bcd34a6bbfa51d67ca18 Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Mon, 1 Nov 2021 12:33:10 +0000 Subject: [PATCH 139/890] 8276218: JFR: Clean up jdk.jfr.dcmd Reviewed-by: mgronlun --- .../share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java | 1 - src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java index de668a56f8d..a6130b2ece7 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java @@ -75,7 +75,6 @@ abstract class AbstractDCmd { try { boolean log = Logger.shouldLog(LogTag.JFR_DCMD, LogLevel.DEBUG); if (log) { - System.out.println(arg); Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing " + this.getClass().getSimpleName() + ": " + arg); } ArgumentParser parser = new ArgumentParser(getArgumentInfos(), arg, delimiter); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java index 6a08a651338..77b8cccd77a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java @@ -58,8 +58,6 @@ import jdk.jfr.internal.jfc.model.XmlInput; //Instantiated by native final class DCmdStart extends AbstractDCmd { - private Object source; - @Override public void execute(ArgumentParser parser) throws DCmdException { String name = parser.getOption("name"); -- GitLab From f55e68c92924bb70471a4851f616d4c3065ffa92 Mon Sep 17 00:00:00 2001 From: Patricio Chilano Mateo Date: Mon, 1 Nov 2021 15:27:39 +0000 Subject: [PATCH 140/890] 8275950: Use only _thread_in_vm in ~ThreadBlockInVMPreprocess() Reviewed-by: dholmes, dcubed --- src/hotspot/share/runtime/interfaceSupport.inline.hpp | 6 ++---- src/hotspot/share/runtime/safepoint.cpp | 1 - src/hotspot/share/runtime/safepoint.hpp | 9 +-------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/runtime/interfaceSupport.inline.hpp b/src/hotspot/share/runtime/interfaceSupport.inline.hpp index 82cd2c180a1..efa794c481b 100644 --- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp +++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp @@ -228,15 +228,13 @@ class ThreadBlockInVMPreprocess : public ThreadStateTransition { } ~ThreadBlockInVMPreprocess() { assert(_thread->thread_state() == _thread_blocked, "coming from wrong thread state"); - // Change to transition state and ensure it is seen by the VM thread. - _thread->set_thread_state_fence(_thread_blocked_trans); + // Change back to _thread_in_vm and ensure it is seen by the VM thread. + _thread->set_thread_state_fence(_thread_in_vm); if (SafepointMechanism::should_process(_thread, _allow_suspend)) { _pr(_thread); SafepointMechanism::process_if_requested(_thread, _allow_suspend); } - - _thread->set_thread_state(_thread_in_vm); } static void emptyOp(JavaThread* current) {} diff --git a/src/hotspot/share/runtime/safepoint.cpp b/src/hotspot/share/runtime/safepoint.cpp index be371446242..039f8b495b0 100644 --- a/src/hotspot/share/runtime/safepoint.cpp +++ b/src/hotspot/share/runtime/safepoint.cpp @@ -706,7 +706,6 @@ void SafepointSynchronize::block(JavaThread *thread) { } JavaThreadState state = thread->thread_state(); - assert(is_a_block_safe_state(state), "Illegal threadstate encountered: %d", state); thread->frame_anchor()->make_walkable(thread); uint64_t safepoint_id = SafepointSynchronize::safepoint_counter(); diff --git a/src/hotspot/share/runtime/safepoint.hpp b/src/hotspot/share/runtime/safepoint.hpp index a2aaf381e8d..268a315dd7b 100644 --- a/src/hotspot/share/runtime/safepoint.hpp +++ b/src/hotspot/share/runtime/safepoint.hpp @@ -128,14 +128,7 @@ class SafepointSynchronize : AllStatic { static bool is_a_block_safe_state(JavaThreadState state) { // Check that we have a valid thread_state before blocking for safepoints - switch(state) { - case _thread_in_vm: - case _thread_in_Java: // From compiled code - case _thread_blocked_trans: - return true; - default: - return false; - } + return state == _thread_in_vm || state == _thread_in_Java; } // Called when a thread voluntarily blocks static void block(JavaThread *thread); -- GitLab From c8abe354c1ddc988ff54b9a96a4a825e2aa70f4b Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Mon, 1 Nov 2021 15:37:00 +0000 Subject: [PATCH 141/890] 8276121: G1: Remove unused and uninitialized _g1h in g1SATBMarkQueueSet.hpp Reviewed-by: ayang, tschatzl --- src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp b/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp index f7d690bf778..5533d6cdfed 100644 --- a/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp +++ b/src/hotspot/share/gc/g1/g1SATBMarkQueueSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -27,13 +27,10 @@ #include "gc/shared/satbMarkQueue.hpp" -class G1CollectedHeap; class Monitor; class Thread; class G1SATBMarkQueueSet : public SATBMarkQueueSet { - G1CollectedHeap* _g1h; - public: G1SATBMarkQueueSet(BufferNode::Allocator* allocator); -- GitLab From e265f83858b84451258677f130f98be5375a417a Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 1 Nov 2021 16:48:13 +0000 Subject: [PATCH 142/890] 8276107: Preventive collections trigger before maxing out heap Reviewed-by: sjohanss, ayang --- src/hotspot/share/gc/g1/g1Policy.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1Policy.cpp b/src/hotspot/share/gc/g1/g1Policy.cpp index dc47bebd7e4..d41ffcbee7b 100644 --- a/src/hotspot/share/gc/g1/g1Policy.cpp +++ b/src/hotspot/share/gc/g1/g1Policy.cpp @@ -1445,17 +1445,19 @@ bool G1Policy::preventive_collection_required(uint alloc_region_count) { uint required_regions = (uint)(get_num_regions_adjust_for_plab_waste(total_young_predicted_surviving_bytes) + get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_old)); - if (required_regions > _g1h->num_free_regions() - alloc_region_count) { - log_debug(gc, ergo, cset)("Preventive GC, insufficient free regions. Predicted need %u. Curr Eden %u (Pred %u). Curr Survivor %u (Pred %u). Curr Old %u (Pred %u) Free %u Alloc %u", - required_regions, - eden_count, - (uint)get_num_regions_adjust_for_plab_waste(eden_surv_bytes_pred), - _g1h->survivor_regions_count(), - (uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_survivor), - _g1h->old_regions_count(), - (uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_old), - _g1h->num_free_regions(), - alloc_region_count); + if (required_regions > _g1h->num_free_or_available_regions() - alloc_region_count) { + log_debug(gc, ergo, cset)("Preventive GC, insufficient free or available regions. " + "Predicted need %u. Curr Eden %u (Pred %u). Curr Survivor %u (Pred %u). Curr Old %u (Pred %u) Free or Avail %u (Free %u) Alloc %u", + required_regions, + eden_count, + (uint)get_num_regions_adjust_for_plab_waste(eden_surv_bytes_pred), + _g1h->survivor_regions_count(), + (uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_survivor), + _g1h->old_regions_count(), + (uint)get_num_regions_adjust_for_plab_waste(_predicted_surviving_bytes_from_old), + _g1h->num_free_or_available_regions(), + _g1h->num_free_regions(), + alloc_region_count); return true; } -- GitLab From 977154400be786c500f36ba14188bff79db57075 Mon Sep 17 00:00:00 2001 From: Patrick Concannon Date: Mon, 1 Nov 2021 17:11:20 +0000 Subject: [PATCH 143/890] 8260428: Drop support for pre JDK 1.4 DatagramSocketImpl implementations Reviewed-by: alanb, dfuchs, vtewari --- .../classes/java/net/DatagramSocketImpl.java | 16 +- .../classes/java/net/NetMulticastSocket.java | 111 ++--------- .../OldDatagramSocketImplTest.java | 178 ++++++++++++++++++ 3 files changed, 212 insertions(+), 93 deletions(-) create mode 100644 test/jdk/java/net/DatagramSocket/OldDatagramSocketImplTest.java diff --git a/src/java.base/share/classes/java/net/DatagramSocketImpl.java b/src/java.base/share/classes/java/net/DatagramSocketImpl.java index 0b77a7dd33b..c0b282bab56 100644 --- a/src/java.base/share/classes/java/net/DatagramSocketImpl.java +++ b/src/java.base/share/classes/java/net/DatagramSocketImpl.java @@ -27,6 +27,7 @@ package java.net; import java.io.FileDescriptor; import java.io.IOException; +import java.io.UncheckedIOException; import java.util.Objects; import java.util.Set; @@ -99,19 +100,30 @@ public abstract class DatagramSocketImpl implements SocketOptions { * packet has been received for that address, then a subsequent call to * send or receive may throw a PortUnreachableException. * Note, there is no guarantee that the exception will be thrown. + * + * @implSpec The default implementation of this method throws {@code SocketException}. + * * @param address the remote InetAddress to connect to * @param port the remote port number * @throws SocketException may be thrown if the socket cannot be * connected to the remote destination * @since 1.4 */ - protected void connect(InetAddress address, int port) throws SocketException {} + protected void connect(InetAddress address, int port) throws SocketException { + throw new SocketException("connect not implemented"); + } /** * Disconnects a datagram socket from its remote destination. + * + * @implSpec The default implementation of this method throws {@code UncheckedIOException}. + * + * @throws UncheckedIOException if disconnect fails or no implementation is provided * @since 1.4 */ - protected void disconnect() {} + protected void disconnect() { + throw new UncheckedIOException(new SocketException("disconnect not implemented")); + } /** * Peek at the packet to see who it is from. Updates the specified {@code InetAddress} diff --git a/src/java.base/share/classes/java/net/NetMulticastSocket.java b/src/java.base/share/classes/java/net/NetMulticastSocket.java index 79959e3ef6c..4160156997a 100644 --- a/src/java.base/share/classes/java/net/NetMulticastSocket.java +++ b/src/java.base/share/classes/java/net/NetMulticastSocket.java @@ -56,11 +56,6 @@ final class NetMulticastSocket extends MulticastSocket { */ private final DatagramSocketImpl impl; - /** - * Are we using an older DatagramSocketImpl? - */ - private final boolean oldImpl; - /** * Set when a socket is ST_CONNECTED until we are certain * that any packets which might have been received prior @@ -76,11 +71,9 @@ final class NetMulticastSocket extends MulticastSocket { * Connection state: * ST_NOT_CONNECTED = socket not connected * ST_CONNECTED = socket connected - * ST_CONNECTED_NO_IMPL = socket connected but not at impl level */ static final int ST_NOT_CONNECTED = 0; static final int ST_CONNECTED = 1; - static final int ST_CONNECTED_NO_IMPL = 2; int connectState = ST_NOT_CONNECTED; @@ -97,7 +90,6 @@ final class NetMulticastSocket extends MulticastSocket { NetMulticastSocket(DatagramSocketImpl impl) { super((MulticastSocket) null); this.impl = Objects.requireNonNull(impl); - this.oldImpl = checkOldImpl(impl); } /** @@ -135,59 +127,24 @@ final class NetMulticastSocket extends MulticastSocket { if (!isBound()) bind(new InetSocketAddress(0)); - // old impls do not support connect/disconnect - if (oldImpl) { - connectState = ST_CONNECTED_NO_IMPL; - } else { - try { - getImpl().connect(address, port); - - // socket is now connected by the impl - connectState = ST_CONNECTED; - // Do we need to filter some packets? - int avail = getImpl().dataAvailable(); - if (avail == -1) { - throw new SocketException(); - } - explicitFilter = avail > 0; - if (explicitFilter) { - bytesLeftToFilter = getReceiveBufferSize(); - } - } catch (SocketException se) { + getImpl().connect(address, port); - // connection will be emulated by DatagramSocket - connectState = ST_CONNECTED_NO_IMPL; - } + // socket is now connected by the impl + connectState = ST_CONNECTED; + // Do we need to filter some packets? + int avail = getImpl().dataAvailable(); + if (avail == -1) { + throw new SocketException(); + } + explicitFilter = avail > 0; + if (explicitFilter) { + bytesLeftToFilter = getReceiveBufferSize(); } connectedAddress = address; connectedPort = port; } - /** - * Return true if the given DatagramSocketImpl is an "old" impl. An old impl - * is one that doesn't implement the abstract methods added in Java SE 1.4. - */ - @SuppressWarnings("removal") - private static boolean checkOldImpl(DatagramSocketImpl impl) { - // DatagramSocketImpl.peekData() is a protected method, therefore we need to use - // getDeclaredMethod, therefore we need permission to access the member - try { - AccessController.doPrivileged( - new PrivilegedExceptionAction<>() { - public Void run() throws NoSuchMethodException { - Class[] cl = new Class[1]; - cl[0] = DatagramPacket.class; - impl.getClass().getDeclaredMethod("peekData", cl); - return null; - } - }); - return false; - } catch (java.security.PrivilegedActionException e) { - return true; - } - } - /** * Return the {@code DatagramSocketImpl} attached to this socket, * creating the socket if not already created. @@ -382,19 +339,11 @@ final class NetMulticastSocket extends MulticastSocket { SecurityManager security = System.getSecurityManager(); if (security != null) { while (true) { - String peekAd = null; int peekPort = 0; // peek at the packet to see who it is from. - if (!oldImpl) { - // We can use the new peekData() API - DatagramPacket peekPacket = new DatagramPacket(new byte[1], 1); - peekPort = getImpl().peekData(peekPacket); - peekAd = peekPacket.getAddress().getHostAddress(); - } else { - InetAddress adr = new InetAddress(); - peekPort = getImpl().peek(adr); - peekAd = adr.getHostAddress(); - } + DatagramPacket peekPacket = new DatagramPacket(new byte[1], 1); + peekPort = getImpl().peekData(peekPacket); + String peekAd = peekPacket.getAddress().getHostAddress(); try { security.checkAccept(peekAd, peekPort); // security check succeeded - so now break @@ -418,7 +367,7 @@ final class NetMulticastSocket extends MulticastSocket { } } DatagramPacket tmp = null; - if ((connectState == ST_CONNECTED_NO_IMPL) || explicitFilter) { + if (explicitFilter) { // We have to do the filtering the old fashioned way since // the native impl doesn't support connect or the connect // via the impl failed, or .. "explicitFilter" may be set when @@ -426,21 +375,11 @@ final class NetMulticastSocket extends MulticastSocket { // when packets from other sources might be queued on socket. boolean stop = false; while (!stop) { - InetAddress peekAddress = null; - int peekPort = -1; // peek at the packet to see who it is from. - if (!oldImpl) { - // We can use the new peekData() API - DatagramPacket peekPacket = new DatagramPacket(new byte[1], 1); - peekPort = getImpl().peekData(peekPacket); - peekAddress = peekPacket.getAddress(); - } else { - // this api only works for IPv4 - peekAddress = new InetAddress(); - peekPort = getImpl().peek(peekAddress); - } - if ((!connectedAddress.equals(peekAddress)) || - (connectedPort != peekPort)) { + DatagramPacket peekPacket = new DatagramPacket(new byte[1], 1); + int peekPort = getImpl().peekData(peekPacket); + InetAddress peekAddress = peekPacket.getAddress(); + if ((!connectedAddress.equals(peekAddress)) || (connectedPort != peekPort)) { // throw the packet away and silently continue tmp = new DatagramPacket( new byte[1024], 1024); @@ -578,11 +517,7 @@ final class NetMulticastSocket extends MulticastSocket { public synchronized void setReuseAddress(boolean on) throws SocketException { if (isClosed()) throw new SocketException("Socket is closed"); - // Integer instead of Boolean for compatibility with older DatagramSocketImpl - if (oldImpl) - getImpl().setOption(SocketOptions.SO_REUSEADDR, on ? -1 : 0); - else - getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); + getImpl().setOption(SocketOptions.SO_REUSEADDR, Boolean.valueOf(on)); } @Override @@ -809,9 +744,6 @@ final class NetMulticastSocket extends MulticastSocket { if (!(mcastaddr instanceof InetSocketAddress addr)) throw new IllegalArgumentException("Unsupported address type"); - if (oldImpl) - throw new UnsupportedOperationException(); - checkAddress(addr.getAddress(), "joinGroup"); @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); @@ -835,9 +767,6 @@ final class NetMulticastSocket extends MulticastSocket { if (!(mcastaddr instanceof InetSocketAddress addr)) throw new IllegalArgumentException("Unsupported address type"); - if (oldImpl) - throw new UnsupportedOperationException(); - checkAddress(addr.getAddress(), "leaveGroup"); @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); diff --git a/test/jdk/java/net/DatagramSocket/OldDatagramSocketImplTest.java b/test/jdk/java/net/DatagramSocket/OldDatagramSocketImplTest.java new file mode 100644 index 00000000000..c1a110c6619 --- /dev/null +++ b/test/jdk/java/net/DatagramSocket/OldDatagramSocketImplTest.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2021, 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 8260428 + * @summary Drop support for pre JDK 1.4 DatagramSocketImpl implementations + * @run testng/othervm OldDatagramSocketImplTest + */ + +import org.testng.annotations.Test; + +import java.net.*; +import java.io.*; + +import static org.testng.Assert.assertEquals; + +public class OldDatagramSocketImplTest { + InetAddress LOOPBACK = InetAddress.getLoopbackAddress(); + + @Test + public void testOldImplConnect() { + try (var ds = new DatagramSocket(new OldDatagramSocketImpl()) {}) { + ds.connect(new InetSocketAddress(LOOPBACK, 6667)); + throw new RuntimeException("ERROR: test failed"); + } catch (SocketException ex) { + assertEquals(ex.getMessage(), "connect not implemented"); + System.out.println("PASSED: default implementation of connect has thrown as expected"); + } + } + + @Test + public void testOldImplConnectTwoArgs() { + try (var ds = new DatagramSocket(new OldDatagramSocketImpl()) {}) { + ds.connect(LOOPBACK, 6667); + throw new RuntimeException("ERROR: test failed"); + } catch (UncheckedIOException ex) { + assertEquals(ex.getMessage(), "connect failed"); + System.out.println("PASSED: default implementation of connect has thrown as expected"); + } + } + + @Test + public void testOldImplDisconnect() { + try (var ds = new DatagramSocket(new OldDatagramSocketImplWithValidConnect()) { }){ + ds.connect(LOOPBACK, 6667); + ds.disconnect(); + throw new RuntimeException("ERROR: test failed"); + } catch (UncheckedIOException ex) { + var innerException = ex.getCause(); + assertEquals(innerException.getClass(), SocketException.class); + assertEquals(innerException.getMessage(), "disconnect not implemented"); + System.out.println("PASSED: default implementation of disconnect has thrown as expected"); + } + } + + @Test + public void testOldImplPublic() { + try (var ds = new PublicOldDatagramSocketImpl()) { + ds.connect(LOOPBACK, 0); + throw new RuntimeException("ERROR: test failed"); + } catch (SocketException ex) { + assertEquals(ex.getMessage(), "connect not implemented"); + System.out.println("PASSED: default implementation of disconnect has thrown as expected"); + } + } + @Test + public void testOldImplPublicDisconnect() { + try (var ds = new PublicOldDatagramSocketImplWithValidConnect()) { + ds.disconnect(); + throw new RuntimeException("ERROR: test failed"); + } catch (UncheckedIOException ex) { + var innerException = ex.getCause(); + assertEquals(innerException.getClass(), SocketException.class); + assertEquals(innerException.getMessage(), "disconnect not implemented"); + System.out.println("PASSED: default implementation of disconnect has thrown as expected"); + } + } + + private class OldDatagramSocketImpl extends DatagramSocketImpl implements AutoCloseable { + + @Override + protected void create() throws SocketException { } + + @Override + protected void bind(int lport, InetAddress laddr) throws SocketException { } + + @Override + protected void send(DatagramPacket p) throws IOException { } + + @Override + protected int peek(InetAddress i) throws IOException { + return 0; + } + + @Override + protected int peekData(DatagramPacket p) throws IOException { + return 0; + } + + @Override + protected void receive(DatagramPacket p) throws IOException { } + + @Override + protected void setTTL(byte ttl) throws IOException { } + + @Override + protected byte getTTL() throws IOException { + return 0; + } + + @Override + protected void setTimeToLive(int ttl) throws IOException { } + + @Override + protected int getTimeToLive() throws IOException { + return 0; + } + + @Override + protected void join(InetAddress inetaddr) throws IOException { } + + @Override + protected void leave(InetAddress inetaddr) throws IOException { } + + @Override + protected void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException { } + + @Override + protected void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException { } + + @Override + public void close() { } + + @Override + public void setOption(int optID, Object value) throws SocketException { } + + @Override + public Object getOption(int optID) throws SocketException { + return null; + } + } + + private class OldDatagramSocketImplWithValidConnect extends OldDatagramSocketImpl implements AutoCloseable { + @Override + protected void connect(InetAddress address, int port) throws SocketException { } + } + // Overriding connect() to make it public so that it can be called + // directly from the test code + private class PublicOldDatagramSocketImpl extends OldDatagramSocketImpl { + public void connect(InetAddress addr, int port) throws SocketException { super.connect(addr, port); } + } + // Overriding disconnect() to make it public so that it can be called + // directly from the test code + private class PublicOldDatagramSocketImplWithValidConnect extends OldDatagramSocketImplWithValidConnect { + public void disconnect() { super.disconnect(); } + } +} -- GitLab From 99b7b95e014da6e491ba7adfd21de53d6ae166fe Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Mon, 1 Nov 2021 19:38:49 +0000 Subject: [PATCH 144/890] 8276205: Shenandoah: CodeCache_lock should always be held for initializing code cache iteration Reviewed-by: shade --- src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp | 3 +++ src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp index e5282dc9c53..197eeec5856 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp @@ -355,12 +355,15 @@ ShenandoahCodeRootsIterator::ShenandoahCodeRootsIterator() : _par_iterator(CodeCache::heaps()), _table_snapshot(NULL) { assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint"); + MutexLocker locker(CodeCache_lock, Mutex::_no_safepoint_check_flag); _table_snapshot = ShenandoahCodeRoots::table()->snapshot_for_iteration(); } ShenandoahCodeRootsIterator::~ShenandoahCodeRootsIterator() { + MonitorLocker locker(CodeCache_lock, Mutex::_no_safepoint_check_flag); ShenandoahCodeRoots::table()->finish_iteration(_table_snapshot); _table_snapshot = NULL; + locker.notify_all(); } void ShenandoahCodeRootsIterator::possibly_parallel_blobs_do(CodeBlobClosure *f) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp index d38b2e8d4ad..a87918ce8a1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp @@ -158,7 +158,7 @@ ShenandoahConcurrentRootScanner::ShenandoahConcurrentRootScanner(uint n_workers, _codecache_snapshot(NULL), _phase(phase) { if (!ShenandoahHeap::heap()->unload_classes()) { - CodeCache_lock->lock_without_safepoint_check(); + MutexLocker locker(CodeCache_lock, Mutex::_no_safepoint_check_flag); _codecache_snapshot = ShenandoahCodeRoots::table()->snapshot_for_iteration(); } update_tlab_stats(); @@ -167,8 +167,9 @@ ShenandoahConcurrentRootScanner::ShenandoahConcurrentRootScanner(uint n_workers, ShenandoahConcurrentRootScanner::~ShenandoahConcurrentRootScanner() { if (!ShenandoahHeap::heap()->unload_classes()) { + MonitorLocker locker(CodeCache_lock, Mutex::_no_safepoint_check_flag); ShenandoahCodeRoots::table()->finish_iteration(_codecache_snapshot); - CodeCache_lock->unlock(); + locker.notify_all(); } } -- GitLab From 47e7a42594f1c36f71cdf4d383080bf8d616b7e7 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Mon, 1 Nov 2021 22:29:40 +0000 Subject: [PATCH 145/890] 8262945: [macos] Regression Manual Test for Key Events Fails Reviewed-by: prr, kizune --- .../macosx/native/libawt_lwawt/awt/AWTEvent.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m index 8333ff48972..5f1a6f4e3c1 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m @@ -465,14 +465,23 @@ NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar, lower = tolower(ch); offset = lower - 'a'; if (offset >= 0 && offset <= 25) { - // some chars in letter set are NOT actually A-Z characters?! - // skip them... + // checking for A-Z characters *postsTyped = YES; // do quick conversion *keyCode = java_awt_event_KeyEvent_VK_A + offset; *keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD; return; - } + } else { + // checking for non-english characters + // this value comes from ExtendedKeyCodes.java + offset += 0x01000000; + *postsTyped = YES; + // do quick conversion + // the keyCode is off by 32, so adding it here + *keyCode = java_awt_event_KeyEvent_VK_A + offset + 32; + *keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD; +return; + } } if ([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:ch]) { -- GitLab From 2eafa036c03d3e8f3dba8f67dd37b484874dc3d3 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Mon, 1 Nov 2021 22:50:43 +0000 Subject: [PATCH 146/890] 8276234: Trivially clean up locale-related code Reviewed-by: redestad, naoto, iris --- .../java/time/chrono/JapaneseChronology.java | 4 ++-- .../classes/sun/util/locale/BaseLocale.java | 4 ++-- .../classes/sun/util/resources/LocaleData.java | 17 ++++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java b/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java index 878eb99d46a..d1320834f80 100644 --- a/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java +++ b/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -124,7 +124,7 @@ public final class JapaneseChronology extends AbstractChronology implements Seri static final LocalGregorianCalendar JCAL = (LocalGregorianCalendar) CalendarSystem.forName("japanese"); - // Locale for creating a JapaneseImpericalCalendar. + // Locale for creating a JapaneseImperialCalendar. static final Locale LOCALE = Locale.forLanguageTag("ja-JP-u-ca-japanese"); /** diff --git a/src/java.base/share/classes/sun/util/locale/BaseLocale.java b/src/java.base/share/classes/sun/util/locale/BaseLocale.java index e5bef6dceea..d3814713b01 100644 --- a/src/java.base/share/classes/sun/util/locale/BaseLocale.java +++ b/src/java.base/share/classes/sun/util/locale/BaseLocale.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, 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 @@ -139,7 +139,7 @@ public final class BaseLocale { region = ""; } if (language == null) { - language = null; + language = ""; } if (variant == null) { variant = ""; diff --git a/src/java.base/share/classes/sun/util/resources/LocaleData.java b/src/java.base/share/classes/sun/util/resources/LocaleData.java index 20334d437a4..4240352e831 100644 --- a/src/java.base/share/classes/sun/util/resources/LocaleData.java +++ b/src/java.base/share/classes/sun/util/resources/LocaleData.java @@ -42,7 +42,6 @@ package sun.util.resources; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -205,7 +204,7 @@ public class LocaleData { }); } - private static abstract class LocaleDataResourceBundleProvider + private abstract static class LocaleDataResourceBundleProvider implements ResourceBundleProvider { /** * Changes baseName to its module dependent package name and @@ -231,14 +230,14 @@ public class LocaleData { * A ResourceBundleProvider implementation for loading locale data * resource bundles except for the java.time supplementary data. */ - public static abstract class CommonResourceBundleProvider extends LocaleDataResourceBundleProvider { + public abstract static class CommonResourceBundleProvider extends LocaleDataResourceBundleProvider { } /** * A ResourceBundleProvider implementation for loading supplementary * resource bundles for java.time. */ - public static abstract class SupplementaryResourceBundleProvider extends LocaleDataResourceBundleProvider { + public abstract static class SupplementaryResourceBundleProvider extends LocaleDataResourceBundleProvider { } // Bundles.Strategy implementations @@ -246,7 +245,7 @@ public class LocaleData { private static class LocaleDataStrategy implements Bundles.Strategy { private static final LocaleDataStrategy INSTANCE = new LocaleDataStrategy(); // TODO: avoid hard-coded Locales - private static Set JAVA_BASE_LOCALES + private static final Set JAVA_BASE_LOCALES = Set.of(Locale.ROOT, Locale.ENGLISH, Locale.US, new Locale("en", "US", "POSIX")); private LocaleDataStrategy() { @@ -254,7 +253,7 @@ public class LocaleData { /* * This method overrides the default implementation to search - * from a prebaked locale string list to determin the candidate + * from a prebaked locale string list to determine the candidate * locale list. * * @param baseName the resource bundle base name. @@ -325,7 +324,7 @@ public class LocaleData { private static final SupplementaryStrategy INSTANCE = new SupplementaryStrategy(); // TODO: avoid hard-coded Locales - private static Set JAVA_BASE_LOCALES + private static final Set JAVA_BASE_LOCALES = Set.of(Locale.ROOT, Locale.ENGLISH, Locale.US); private SupplementaryStrategy() { @@ -333,8 +332,8 @@ public class LocaleData { @Override public List getCandidateLocales(String baseName, Locale locale) { - // Specifiy only the given locale - return Arrays.asList(locale); + // Specify only the given locale + return List.of(locale); } @Override -- GitLab From acceffcbf73aa4416c487f890f3ca65e55e47164 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Tue, 2 Nov 2021 02:49:56 +0000 Subject: [PATCH 147/890] 8273704: DrawStringWithInfiniteXform.java failed : drawString with InfiniteXform transform takes long time Reviewed-by: serb, psadhukhan --- .../awt/FontClass/DrawStringWithInfiniteXform.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java b/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java index bd23226cb54..829eb31ce37 100644 --- a/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java +++ b/test/jdk/java/awt/FontClass/DrawStringWithInfiniteXform.java @@ -35,11 +35,12 @@ import java.util.Timer; import java.util.TimerTask; public class DrawStringWithInfiniteXform { - Timer timer; - boolean done; + + volatile Timer timer; + volatile boolean done; + class ScheduleTask extends TimerTask { public void run() { - timer.cancel(); if (!done) { throw new RuntimeException("drawString with InfiniteXform transform takes long time"); @@ -48,7 +49,7 @@ public class DrawStringWithInfiniteXform { } public DrawStringWithInfiniteXform() { timer = new Timer(); - timer.schedule(new ScheduleTask(), 10000); + timer.schedule(new ScheduleTask(), 20000); } public static void main(String [] args) { @@ -73,6 +74,7 @@ public class DrawStringWithInfiniteXform { g2d.drawString("abc", 20, 20); } done = true; + timer.cancel(); System.out.println("Test passed"); } } -- GitLab From 0488ebdf14dacfa79d98de16ed949c813dd88701 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 2 Nov 2021 06:38:26 +0000 Subject: [PATCH 148/890] 8276105: C2: Conv(D|F)2(I|L)Nodes::Ideal should handle rounding correctly Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/convertnode.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/opto/convertnode.cpp b/src/hotspot/share/opto/convertnode.cpp index 259c58aeaf5..501cb08c452 100644 --- a/src/hotspot/share/opto/convertnode.cpp +++ b/src/hotspot/share/opto/convertnode.cpp @@ -108,8 +108,10 @@ const Type* ConvD2INode::Value(PhaseGVN* phase) const { //------------------------------Ideal------------------------------------------ // If converting to an int type, skip any rounding nodes Node *ConvD2INode::Ideal(PhaseGVN *phase, bool can_reshape) { - if( in(1)->Opcode() == Op_RoundDouble ) - set_req(1,in(1)->in(1)); + if (in(1)->Opcode() == Op_RoundDouble) { + set_req(1, in(1)->in(1)); + return this; + } return NULL; } @@ -142,8 +144,10 @@ Node* ConvD2LNode::Identity(PhaseGVN* phase) { //------------------------------Ideal------------------------------------------ // If converting to an int type, skip any rounding nodes Node *ConvD2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { - if( in(1)->Opcode() == Op_RoundDouble ) - set_req(1,in(1)->in(1)); + if (in(1)->Opcode() == Op_RoundDouble) { + set_req(1, in(1)->in(1)); + return this; + } return NULL; } @@ -179,8 +183,10 @@ Node* ConvF2INode::Identity(PhaseGVN* phase) { //------------------------------Ideal------------------------------------------ // If converting to an int type, skip any rounding nodes Node *ConvF2INode::Ideal(PhaseGVN *phase, bool can_reshape) { - if( in(1)->Opcode() == Op_RoundFloat ) - set_req(1,in(1)->in(1)); + if (in(1)->Opcode() == Op_RoundFloat) { + set_req(1, in(1)->in(1)); + return this; + } return NULL; } @@ -206,8 +212,10 @@ Node* ConvF2LNode::Identity(PhaseGVN* phase) { //------------------------------Ideal------------------------------------------ // If converting to an int type, skip any rounding nodes Node *ConvF2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { - if( in(1)->Opcode() == Op_RoundFloat ) - set_req(1,in(1)->in(1)); + if (in(1)->Opcode() == Op_RoundFloat) { + set_req(1, in(1)->in(1)); + return this; + } return NULL; } -- GitLab From 9bf31652cbe8eb2699babe5e52e62ea1f1578588 Mon Sep 17 00:00:00 2001 From: Masanori Yano Date: Tue, 2 Nov 2021 06:44:48 +0000 Subject: [PATCH 149/890] 8276164: RandomAccessFile#write method could throw IndexOutOfBoundsException that is not described in javadoc Reviewed-by: alanb --- src/java.base/share/classes/java/io/DataOutput.java | 5 ++++- src/java.base/share/classes/java/io/RandomAccessFile.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/io/DataOutput.java b/src/java.base/share/classes/java/io/DataOutput.java index 2706e2692c2..2a9088ef153 100644 --- a/src/java.base/share/classes/java/io/DataOutput.java +++ b/src/java.base/share/classes/java/io/DataOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2021, 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 @@ -92,6 +92,9 @@ public interface DataOutput { * @param off the start offset in the data. * @param len the number of bytes to write. * @throws IOException if an I/O error occurs. + * @throws IndexOutOfBoundsException If {@code off} is negative, + * {@code len} is negative, or {@code len} is greater than + * {@code b.length - off} */ void write(byte[] b, int off, int len) throws IOException; diff --git a/src/java.base/share/classes/java/io/RandomAccessFile.java b/src/java.base/share/classes/java/io/RandomAccessFile.java index c1d3ce37370..4eb01b9c897 100644 --- a/src/java.base/share/classes/java/io/RandomAccessFile.java +++ b/src/java.base/share/classes/java/io/RandomAccessFile.java @@ -553,6 +553,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * @param off the start offset in the data. * @param len the number of bytes to write. * @throws IOException if an I/O error occurs. + * @throws IndexOutOfBoundsException {@inheritDoc} */ public void write(byte[] b, int off, int len) throws IOException { writeBytes(b, off, len); -- GitLab From 92be9d8c535274eea4edd06273e6d7811f6bb113 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Tue, 2 Nov 2021 09:46:37 +0000 Subject: [PATCH 150/890] 8276236: Table headers missing in Formatter api docs Reviewed-by: coffeys, iris --- .../share/classes/java/util/Formatter.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/java.base/share/classes/java/util/Formatter.java b/src/java.base/share/classes/java/util/Formatter.java index fd8920ff003..d3f2ecd977b 100644 --- a/src/java.base/share/classes/java/util/Formatter.java +++ b/src/java.base/share/classes/java/util/Formatter.java @@ -388,6 +388,10 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * *
    time
    Conversion + * Description + *
    {@code 'H'} * Hour of the day for the 24-hour clock, formatted as two digits with @@ -459,6 +463,10 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    date
    Conversion + * Description + *
    {@code 'B'} @@ -519,6 +527,10 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    composites
    Conversion + * Description + *
    {@code 'R'} @@ -738,6 +750,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    dgConv
    Conversion + * Unicode + * Description + *
    {@code 'b'} @@ -796,6 +813,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    dFlags
    Flag + * Unicode + * Description + *
    {@code '-'} @@ -840,6 +862,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    charConv
    Conversion + * Unicode + * Description + *
    {@code 'c'} @@ -944,6 +971,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    IntConv
    Conversion + * Unicode + * Description + *
    {@code 'd'} @@ -1027,6 +1059,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    intFlags
    Conversion + * Unicode + * Description + *
    {@code '+'} @@ -1108,6 +1145,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    bIntConv
    Conversion + * Unicode + * Description + *
    {@code 'd'} @@ -1205,6 +1247,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    floatConv
    Conversion + * Unicode + * Description + *
    {@code 'e'} @@ -1442,6 +1489,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    floatConv
    Conversion + * Unicode + * Description + *
    {@code 'e'} @@ -1569,6 +1621,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    DTConv
    Conversion + * Unicode + * Description + *
    {@code 't'} @@ -1592,6 +1649,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    time
    Conversion + * Unicode + * Description + *
    {@code 'H'} @@ -1687,6 +1749,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    date
    Conversion + * Unicode + * Description + *
    {@code 'B'} @@ -1763,6 +1830,11 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    composites
    Conversion + * Unicode + * Description + *
    {@code 'R'} @@ -1817,6 +1889,10 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * *
    DTConv
    Conversion + * Description + *
    {@code '%'} @@ -1845,6 +1921,10 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * * * + * + * * * * * * - * + * * * * @@ -964,7 +964,7 @@ public class MethodHandles { * * * - * + * * * * @@ -973,7 +973,7 @@ public class MethodHandles { * * * - * + * * * * @@ -982,7 +982,7 @@ public class MethodHandles { * * * - * + * * * * @@ -991,7 +991,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1000,7 +1000,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1009,7 +1009,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1018,7 +1018,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1027,7 +1027,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1036,7 +1036,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1045,7 +1045,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1053,7 +1053,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1062,7 +1062,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1071,7 +1071,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1080,7 +1080,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1089,7 +1089,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1098,7 +1098,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1107,7 +1107,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1116,7 +1116,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1125,7 +1125,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1134,7 +1134,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1143,7 +1143,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1152,7 +1152,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1161,7 +1161,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1170,7 +1170,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1179,7 +1179,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1188,7 +1188,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1197,7 +1197,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1206,7 +1206,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1215,7 +1215,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1224,7 +1224,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1233,7 +1233,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1242,7 +1242,7 @@ public class MethodHandles { * * * - * + * * * * @@ -1251,7 +1251,7 @@ public class MethodHandles { * * * - * + * * * * -- GitLab From 8ec80c4bc1c3169963137b5a16a1b787540a3589 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Thu, 4 Nov 2021 21:06:03 +0000 Subject: [PATCH 204/890] 8276653: Missing row headers in j.l.Character docs Reviewed-by: naoto --- .../share/classes/java/lang/Character.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Character.java b/src/java.base/share/classes/java/lang/Character.java index 211dc631953..4a5d9afb585 100644 --- a/src/java.base/share/classes/java/lang/Character.java +++ b/src/java.base/share/classes/java/lang/Character.java @@ -75,27 +75,27 @@ import static java.lang.constant.ConstantDescs.DEFAULT_NAME; * * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * - * + * * * *
    DTConv
    Conversion + * Description + *
    {@code 'n'} -- GitLab From b7a06be98d3057dac4adbb7f4071ac62cf88fe52 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 2 Nov 2021 10:26:21 +0000 Subject: [PATCH 151/890] 8252990: Intrinsify Unsafe.storeStoreFence Reviewed-by: dholmes, thartmann, whuang --- src/hotspot/cpu/aarch64/aarch64.ad | 1 + src/hotspot/cpu/arm/arm.ad | 1 + src/hotspot/cpu/ppc/ppc.ad | 1 + src/hotspot/cpu/s390/s390.ad | 1 + src/hotspot/cpu/x86/x86_32.ad | 1 + src/hotspot/cpu/x86/x86_64.ad | 1 + src/hotspot/share/adlc/formssel.cpp | 1 + src/hotspot/share/c1/c1_Compiler.cpp | 1 + src/hotspot/share/c1/c1_LIRGenerator.cpp | 3 +++ src/hotspot/share/classfile/vmIntrinsics.hpp | 3 +++ src/hotspot/share/opto/c2compiler.cpp | 1 + src/hotspot/share/opto/classes.hpp | 1 + src/hotspot/share/opto/library_call.cpp | 4 ++++ src/hotspot/share/opto/memnode.cpp | 6 ++++-- src/hotspot/share/opto/memnode.hpp | 7 +++++++ src/java.base/share/classes/jdk/internal/misc/Unsafe.java | 6 ++---- 16 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 8e155b926af..108194c4f9c 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -8547,6 +8547,7 @@ instruct membar_release() %{ instruct membar_storestore() %{ match(MemBarStoreStore); + match(StoreStoreFence); ins_cost(VOLATILE_REF_COST); format %{ "MEMBAR-store-store" %} diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad index 1eb14630e7a..e9fc3d75bf9 100644 --- a/src/hotspot/cpu/arm/arm.ad +++ b/src/hotspot/cpu/arm/arm.ad @@ -4517,6 +4517,7 @@ instruct storeF( memoryF mem, regF src) %{ // pattern-match out unnecessary membars instruct membar_storestore() %{ match(MemBarStoreStore); + match(StoreStoreFence); ins_cost(4*MEMORY_REF_COST); size(4); diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 4a43aa2f12a..f9aa60ca15a 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -7153,6 +7153,7 @@ instruct membar_release() %{ instruct membar_storestore() %{ match(MemBarStoreStore); + match(StoreStoreFence); ins_cost(4*MEMORY_REF_COST); format %{ "MEMBAR-store-store" %} diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 63004f8e263..8a2dde76202 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -5055,6 +5055,7 @@ instruct membar_CPUOrder() %{ instruct membar_storestore() %{ match(MemBarStoreStore); + match(StoreStoreFence); ins_cost(0); size(0); format %{ "MEMBAR-storestore (empty)" %} diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index a8cdd981b76..e4738af4321 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -6659,6 +6659,7 @@ instruct unnecessary_membar_volatile() %{ instruct membar_storestore() %{ match(MemBarStoreStore); + match(StoreStoreFence); ins_cost(0); size(0); diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index e637f143659..6a764fd62a1 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -6787,6 +6787,7 @@ instruct unnecessary_membar_volatile() instruct membar_storestore() %{ match(MemBarStoreStore); + match(StoreStoreFence); ins_cost(0); size(0); diff --git a/src/hotspot/share/adlc/formssel.cpp b/src/hotspot/share/adlc/formssel.cpp index 3b244ceda1f..10886e233a2 100644 --- a/src/hotspot/share/adlc/formssel.cpp +++ b/src/hotspot/share/adlc/formssel.cpp @@ -4117,6 +4117,7 @@ bool MatchRule::is_ideal_membar() const { !strcmp(_opType,"MemBarReleaseLock") || !strcmp(_opType,"LoadFence" ) || !strcmp(_opType,"StoreFence") || + !strcmp(_opType,"StoreStoreFence") || !strcmp(_opType,"MemBarVolatile") || !strcmp(_opType,"MemBarCPUOrder") || !strcmp(_opType,"MemBarStoreStore") || diff --git a/src/hotspot/share/c1/c1_Compiler.cpp b/src/hotspot/share/c1/c1_Compiler.cpp index 58a76b5a114..f60db13e7bf 100644 --- a/src/hotspot/share/c1/c1_Compiler.cpp +++ b/src/hotspot/share/c1/c1_Compiler.cpp @@ -142,6 +142,7 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) { // since GC can change its value. case vmIntrinsics::_loadFence: case vmIntrinsics::_storeFence: + case vmIntrinsics::_storeStoreFence: case vmIntrinsics::_fullFence: case vmIntrinsics::_floatToRawIntBits: case vmIntrinsics::_intBitsToFloat: diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index c8f2eb3d835..0465a5e3cde 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -2984,6 +2984,9 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { case vmIntrinsics::_storeFence: __ membar_release(); break; + case vmIntrinsics::_storeStoreFence: + __ membar_storestore(); + break; case vmIntrinsics::_fullFence : __ membar(); break; diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index fbe9c140b77..632a6344138 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -523,6 +523,9 @@ class methodHandle; do_intrinsic(_storeFence, jdk_internal_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \ do_name( storeFence_name, "storeFence") \ do_alias( storeFence_signature, void_method_signature) \ + do_intrinsic(_storeStoreFence, jdk_internal_misc_Unsafe, storeStoreFence_name, storeStoreFence_signature, F_R) \ + do_name( storeStoreFence_name, "storeStoreFence") \ + do_alias( storeStoreFence_signature, void_method_signature) \ do_intrinsic(_fullFence, jdk_internal_misc_Unsafe, fullFence_name, fullFence_signature, F_RN) \ do_name( fullFence_name, "fullFence") \ do_alias( fullFence_signature, void_method_signature) \ diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index ad463fbbc28..83b9766afd6 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -604,6 +604,7 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_putLongUnaligned: case vmIntrinsics::_loadFence: case vmIntrinsics::_storeFence: + case vmIntrinsics::_storeStoreFence: case vmIntrinsics::_fullFence: case vmIntrinsics::_currentThread: #ifdef JFR_HAVE_INTRINSICS diff --git a/src/hotspot/share/opto/classes.hpp b/src/hotspot/share/opto/classes.hpp index 6c896c4609a..3b9697ecb4b 100644 --- a/src/hotspot/share/opto/classes.hpp +++ b/src/hotspot/share/opto/classes.hpp @@ -219,6 +219,7 @@ macro(MemBarAcquireLock) macro(MemBarCPUOrder) macro(MemBarRelease) macro(StoreFence) +macro(StoreStoreFence) macro(MemBarReleaseLock) macro(MemBarVolatile) macro(MemBarStoreStore) diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index edd051c5300..157d72af6d3 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -467,6 +467,7 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_loadFence: case vmIntrinsics::_storeFence: + case vmIntrinsics::_storeStoreFence: case vmIntrinsics::_fullFence: return inline_unsafe_fence(intrinsic_id()); case vmIntrinsics::_onSpinWait: return inline_onspinwait(); @@ -2695,6 +2696,9 @@ bool LibraryCallKit::inline_unsafe_fence(vmIntrinsics::ID id) { case vmIntrinsics::_storeFence: insert_mem_bar(Op_StoreFence); return true; + case vmIntrinsics::_storeStoreFence: + insert_mem_bar(Op_StoreStoreFence); + return true; case vmIntrinsics::_fullFence: insert_mem_bar(Op_MemBarVolatile); return true; diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index dca0a9fc974..f0f78bd9946 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -1080,7 +1080,8 @@ Node* MemNode::can_see_stored_value(Node* st, PhaseTransform* phase) const { opc == Op_MemBarRelease || opc == Op_StoreFence || opc == Op_MemBarReleaseLock || - opc == Op_MemBarStoreStore) { + opc == Op_MemBarStoreStore || + opc == Op_StoreStoreFence) { Node* mem = current->in(0)->in(TypeFunc::Memory); if (mem->is_MergeMem()) { MergeMemNode* merge = mem->as_MergeMem(); @@ -3300,13 +3301,14 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { case Op_LoadFence: return new LoadFenceNode(C, atp, pn); case Op_MemBarRelease: return new MemBarReleaseNode(C, atp, pn); case Op_StoreFence: return new StoreFenceNode(C, atp, pn); + case Op_MemBarStoreStore: return new MemBarStoreStoreNode(C, atp, pn); + case Op_StoreStoreFence: return new StoreStoreFenceNode(C, atp, pn); case Op_MemBarAcquireLock: return new MemBarAcquireLockNode(C, atp, pn); case Op_MemBarReleaseLock: return new MemBarReleaseLockNode(C, atp, pn); case Op_MemBarVolatile: return new MemBarVolatileNode(C, atp, pn); case Op_MemBarCPUOrder: return new MemBarCPUOrderNode(C, atp, pn); case Op_OnSpinWait: return new OnSpinWaitNode(C, atp, pn); case Op_Initialize: return new InitializeNode(C, atp, pn); - case Op_MemBarStoreStore: return new MemBarStoreStoreNode(C, atp, pn); case Op_Blackhole: return new BlackholeNode(C, atp, pn); default: ShouldNotReachHere(); return NULL; } diff --git a/src/hotspot/share/opto/memnode.hpp b/src/hotspot/share/opto/memnode.hpp index 06fa7d0724e..7c02a1b0861 100644 --- a/src/hotspot/share/opto/memnode.hpp +++ b/src/hotspot/share/opto/memnode.hpp @@ -1309,6 +1309,13 @@ public: virtual int Opcode() const; }; +class StoreStoreFenceNode: public MemBarNode { +public: + StoreStoreFenceNode(Compile* C, int alias_idx, Node* precedent) + : MemBarNode(C, alias_idx, precedent) {} + virtual int Opcode() const; +}; + // Ordering between a volatile store and a following volatile load. // Requires multi-CPU visibility? class MemBarVolatileNode: public MemBarNode { diff --git a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java index 44d94a959f1..284ebc0d36e 100644 --- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java +++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java @@ -3441,16 +3441,14 @@ public final class Unsafe { * Ensures that stores before the fence will not be reordered with * stores after the fence. * - * @implNote - * This method is operationally equivalent to {@link #storeFence()}. - * * @since 9 */ + @IntrinsicCandidate public final void storeStoreFence() { + // If storeStoreFence intrinsic is not available, fall back to storeFence. storeFence(); } - /** * Throws IllegalAccessError; for use by the VM for access control * error support. -- GitLab From 9971a2cab3892a17f3fd39243df5ecfff5b9f108 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Tue, 2 Nov 2021 10:39:41 +0000 Subject: [PATCH 152/890] 8275735: [linux] Remove deprecated Metrics api (kernel memory limit) Reviewed-by: hseigel, mchung --- .../internal/platform/CgroupV1Metrics.java | 20 ----------- .../platform/CgroupV1MetricsImpl.java | 10 ------ .../platform/cgroupv1/CgroupV1Subsystem.java | 8 ----- .../platform/docker/MetricsMemoryTester.java | 20 ----------- .../docker/TestDockerMemoryMetrics.java | 36 +++---------------- .../cgroup/MetricsTesterCgroupV1.java | 14 -------- 6 files changed, 4 insertions(+), 104 deletions(-) diff --git a/src/java.base/linux/classes/jdk/internal/platform/CgroupV1Metrics.java b/src/java.base/linux/classes/jdk/internal/platform/CgroupV1Metrics.java index cf8230b0bfc..c7e83faa59d 100644 --- a/src/java.base/linux/classes/jdk/internal/platform/CgroupV1Metrics.java +++ b/src/java.base/linux/classes/jdk/internal/platform/CgroupV1Metrics.java @@ -53,16 +53,6 @@ public interface CgroupV1Metrics extends Metrics { */ public long getKernelMemoryFailCount(); - /** - * Returns the maximum amount of kernel physical memory, in bytes, that - * can be allocated in the Isolation Group. - * - * @return The maximum amount of memory in bytes or -1 if - * there is no limit set. - * - */ - public long getKernelMemoryLimit(); - /** * Returns the largest amount of kernel physical memory, in bytes, that * have been allocated in the Isolation Group. @@ -93,16 +83,6 @@ public interface CgroupV1Metrics extends Metrics { */ public long getTcpMemoryFailCount(); - /** - * Returns the maximum amount of networking physical memory, in bytes, - * that can be allocated in the Isolation Group. - * - * @return The maximum amount of memory in bytes or -1 if - * there is no limit. - * - */ - public long getTcpMemoryLimit(); - /** * Returns the largest amount of networking physical memory, in bytes, * that have been allocated in the Isolation Group. diff --git a/src/java.base/linux/classes/jdk/internal/platform/CgroupV1MetricsImpl.java b/src/java.base/linux/classes/jdk/internal/platform/CgroupV1MetricsImpl.java index 443b58f1f9d..ce9b0c2cc20 100644 --- a/src/java.base/linux/classes/jdk/internal/platform/CgroupV1MetricsImpl.java +++ b/src/java.base/linux/classes/jdk/internal/platform/CgroupV1MetricsImpl.java @@ -48,11 +48,6 @@ public class CgroupV1MetricsImpl extends CgroupMetrics implements CgroupV1Metric return metrics.getKernelMemoryFailCount(); } - @Override - public long getKernelMemoryLimit() { - return metrics.getKernelMemoryLimit(); - } - @Override public long getKernelMemoryMaxUsage() { return metrics.getKernelMemoryMaxUsage(); @@ -68,11 +63,6 @@ public class CgroupV1MetricsImpl extends CgroupMetrics implements CgroupV1Metric return metrics.getTcpMemoryFailCount(); } - @Override - public long getTcpMemoryLimit() { - return metrics.getTcpMemoryLimit(); - } - @Override public long getTcpMemoryMaxUsage() { return metrics.getTcpMemoryMaxUsage(); diff --git a/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java b/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java index b928e83093e..5a49aa7833e 100644 --- a/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java +++ b/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/CgroupV1Subsystem.java @@ -332,10 +332,6 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics { return getLongValue(memory, "memory.kmem.failcnt"); } - public long getKernelMemoryLimit() { - return CgroupV1SubsystemController.longValOrUnlimited(getLongValue(memory, "memory.kmem.limit_in_bytes")); - } - public long getKernelMemoryMaxUsage() { return getLongValue(memory, "memory.kmem.max_usage_in_bytes"); } @@ -348,10 +344,6 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics { return getLongValue(memory, "memory.kmem.tcp.failcnt"); } - public long getTcpMemoryLimit() { - return CgroupV1SubsystemController.longValOrUnlimited(getLongValue(memory, "memory.kmem.tcp.limit_in_bytes")); - } - public long getTcpMemoryMaxUsage() { return getLongValue(memory, "memory.kmem.tcp.max_usage_in_bytes"); } diff --git a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java index f170458893c..08773b3e8b5 100644 --- a/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java +++ b/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java @@ -39,9 +39,6 @@ public class MetricsMemoryTester { case "memoryswap": testMemoryAndSwapLimit(args[1], args[2]); break; - case "kernelmem": - testKernelMemoryLimit(args[1]); - break; case "oomkill": testOomKillFlag(Boolean.parseBoolean(args[2])); break; @@ -119,23 +116,6 @@ public class MetricsMemoryTester { System.out.println("TEST PASSED!!!"); } - private static void testKernelMemoryLimit(String value) { - Metrics m = Metrics.systemMetrics(); - if (m instanceof CgroupV1Metrics) { - CgroupV1Metrics mCgroupV1 = (CgroupV1Metrics)m; - System.out.println("TEST PASSED!!!"); - long limit = getMemoryValue(value); - long kmemlimit = mCgroupV1.getKernelMemoryLimit(); - if (kmemlimit != UNLIMITED && limit != kmemlimit) { - throw new RuntimeException("Kernel Memory limit not equal, expected : [" - + limit + "]" + ", got : [" - + kmemlimit + "]"); - } - } else { - throw new RuntimeException("kernel memory limit test not supported for cgroups v2"); - } - } - private static void testMemoryAndSwapLimit(String memory, String memAndSwap) { long expectedMem = getMemoryValue(memory); long expectedMemAndSwap = getMemoryValue(memAndSwap); diff --git a/test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java b/test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java index ca75aa745e0..4ec77d08d04 100644 --- a/test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java +++ b/test/jdk/jdk/internal/platform/docker/TestDockerMemoryMetrics.java @@ -61,18 +61,14 @@ public class TestDockerMemoryMetrics { testMemoryAndSwapLimit("100m", "200m"); Metrics m = Metrics.systemMetrics(); - // kernel memory, '--kernel-memory' switch, and OOM killer, - // '--oom-kill-disable' switch, tests not supported by cgroupv2 - // runtimes + // OOM killer disable, '--oom-kill-disable' switch, test not supported + // by cgroupv2 if (m != null) { if ("cgroupv1".equals(m.getProvider())) { - testKernelMemoryLimit("100m"); - testKernelMemoryLimit("1g"); - testOomKillFlag("100m", false); } else { - System.out.println("kernel memory tests and OOM Kill flag tests not " + - "possible with cgroupv2."); + System.out.println("OOM kill disable test not " + + "supported with cgroupv2."); } } testOomKillFlag("100m", true); @@ -149,30 +145,6 @@ public class TestDockerMemoryMetrics { DockerTestUtils.dockerRunJava(opts).shouldHaveExitValue(0).shouldContain("TEST PASSED!!!"); } - private static void testKernelMemoryLimit(String value) throws Exception { - Common.logNewTestCase("testKernelMemoryLimit, value = " + value); - DockerRunOptions opts = - new DockerRunOptions(imageName, "/jdk/bin/java", "MetricsMemoryTester"); - opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/") - .addDockerOpts("--kernel-memory=" + value) - .addJavaOpts("-cp", "/test-classes/") - .addJavaOpts("--add-exports", "java.base/jdk.internal.platform=ALL-UNNAMED") - .addClassOptions("kernelmem", value); - OutputAnalyzer oa = DockerTestUtils.dockerRunJava(opts); - - // Some container runtimes (e.g. runc, docker 18.09) - // have been built without kernel memory accounting. In - // that case, the runtime issues a message on stderr saying - // so. Skip the test in that case. - if (oa.getStderr().contains("kernel memory accounting disabled")) { - System.out.println("Kernel memory accounting disabled, " + - "skipping the test case"); - return; - } - - oa.shouldHaveExitValue(0).shouldContain("TEST PASSED!!!"); - } - private static void testOomKillFlag(String value, boolean oomKillFlag) throws Exception { Common.logNewTestCase("testOomKillFlag, oomKillFlag = " + oomKillFlag); DockerRunOptions opts = diff --git a/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java index 6239a6de769..7b78ad8eef4 100644 --- a/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java +++ b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV1.java @@ -247,13 +247,6 @@ public class MetricsTesterCgroupV1 implements CgroupMetricsTester { fail(Controller.MEMORY, "memory.kmem.failcnt", oldVal, newVal); } - oldVal = metrics.getKernelMemoryLimit(); - newVal = getLongValueFromFile(Controller.MEMORY, "memory.kmem.limit_in_bytes"); - newVal = newVal > unlimited_minimum ? CgroupSubsystem.LONG_RETVAL_UNLIMITED : newVal; - if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) { - fail(Controller.MEMORY, "memory.kmem.limit_in_bytes", oldVal, newVal); - } - oldVal = metrics.getKernelMemoryMaxUsage(); newVal = getLongValueFromFile(Controller.MEMORY, "memory.kmem.max_usage_in_bytes"); if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) { @@ -273,13 +266,6 @@ public class MetricsTesterCgroupV1 implements CgroupMetricsTester { fail(Controller.MEMORY, "memory.kmem.tcp.failcnt", oldVal, newVal); } - oldVal = metrics.getTcpMemoryLimit(); - newVal = getLongValueFromFile(Controller.MEMORY, "memory.kmem.tcp.limit_in_bytes"); - newVal = newVal > unlimited_minimum ? CgroupSubsystem.LONG_RETVAL_UNLIMITED: newVal; - if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) { - fail(Controller.MEMORY, "memory.kmem.tcp.limit_in_bytes", oldVal, newVal); - } - oldVal = metrics.getTcpMemoryMaxUsage(); newVal = getLongValueFromFile(Controller.MEMORY, "memory.kmem.tcp.max_usage_in_bytes"); if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) { -- GitLab From 8630f55ed7a0483ec5dcb13a7f53b52bc4ab6fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Tue, 2 Nov 2021 12:10:47 +0000 Subject: [PATCH 153/890] 8275406: Add copy-to-clipboard feature to snippet UI Reviewed-by: erikj, jjg --- make/CompileInterimLangtools.gmk | 2 +- make/modules/jdk.javadoc/Java.gmk | 4 +- .../doclets/formats/html/HtmlDoclet.java | 2 + .../formats/html/TagletWriterImpl.java | 22 +++++-- .../doclets/formats/html/markup/HtmlAttr.java | 1 + .../formats/html/markup/HtmlStyle.java | 10 +++ .../doclets/toolkit/resources/copy.svg | 33 ++++++++++ .../toolkit/resources/doclets.properties | 2 + .../doclets/toolkit/resources/script.js | 17 ++++- .../doclets/toolkit/resources/stylesheet.css | 62 ++++++++++++++++++- .../doclets/toolkit/util/DocPaths.java | 3 + .../doclet/testSnippetTag/TestSnippetTag.java | 27 ++++++++ .../lib/javadoc/tester/LinkChecker.java | 6 +- .../jdk/javadoc/tool/api/basic/APITest.java | 3 +- 14 files changed, 180 insertions(+), 14 deletions(-) create mode 100644 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/copy.svg diff --git a/make/CompileInterimLangtools.gmk b/make/CompileInterimLangtools.gmk index f0312a5e8fa..a6a42f6a9cd 100644 --- a/make/CompileInterimLangtools.gmk +++ b/make/CompileInterimLangtools.gmk @@ -75,7 +75,7 @@ define SetupInterimModule EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \ Standard.java, \ EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \ - COPY := .gif .png .xml .css .js .js.template .txt javax.tools.JavaCompilerTool, \ + COPY := .gif .png .xml .css .svg .js .js.template .txt javax.tools.JavaCompilerTool, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \ DISABLED_WARNINGS := module options, \ JAVAC_FLAGS := \ diff --git a/make/modules/jdk.javadoc/Java.gmk b/make/modules/jdk.javadoc/Java.gmk index 0fe708e6eae..d64dd37b10b 100644 --- a/make/modules/jdk.javadoc/Java.gmk +++ b/make/modules/jdk.javadoc/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,4 +23,4 @@ # questions. # -COPY += .xml .css .js .js.template .png .txt +COPY += .xml .css .svg .js .js.template .png .txt diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java index a1182b55da6..2e5d966cff1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java @@ -290,6 +290,8 @@ public class HtmlDoclet extends AbstractDoclet { } f = DocFile.createFileForOutput(configuration, DocPaths.JAVASCRIPT); f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.JAVASCRIPT), true, true); + f = DocFile.createFileForOutput(configuration, DocPaths.CLIPBOARD_SVG); + f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.CLIPBOARD_SVG), true, true); if (options.createIndex()) { f = DocFile.createFileForOutput(configuration, DocPaths.SEARCH_JS); f.copyResource(DOCLET_RESOURCES.resolve(DocPaths.SEARCH_JS_TEMPLATE), configuration.docResources); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index f4c352fe546..4b86fd28ebc 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -53,6 +53,7 @@ import com.sun.source.doctree.SystemPropertyTree; import com.sun.source.doctree.ThrowsTree; import com.sun.source.util.DocTreePath; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; +import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlId; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; @@ -381,12 +382,23 @@ public class TagletWriterImpl extends TagletWriter { @Override protected Content snippetTagOutput(Element element, SnippetTree tag, StyledText content) { - HtmlTree result = new HtmlTree(TagName.PRE).setStyle(HtmlStyle.snippet); - result.add(Text.of(utils.normalizeNewlines("\n"))); + String copyText = resources.getText("doclet.Copy_snippet_to_clipboard"); + String copiedText = resources.getText("doclet.Copied_snippet_to_clipboard"); + HtmlTree copy = HtmlTree.DIV(HtmlStyle.snippetContainer, + HtmlTree.A("#", new HtmlTree(TagName.IMG) + .put(HtmlAttr.SRC, htmlWriter.pathToRoot.resolve(DocPaths.CLIPBOARD_SVG).getPath()) + .put(HtmlAttr.ALT, copyText)) + .addStyle(HtmlStyle.snippetCopy) + .put(HtmlAttr.ONCLICK, "copySnippet(this)") + .put(HtmlAttr.ARIA_LABEL, copyText) + .put(HtmlAttr.DATA_COPIED, copiedText)); + HtmlTree pre = new HtmlTree(TagName.PRE) + .setStyle(HtmlStyle.snippet); + pre.add(Text.of(utils.normalizeNewlines("\n"))); content.consumeBy((styles, sequence) -> { CharSequence text = utils.normalizeNewlines(sequence); if (styles.isEmpty()) { - result.add(text); + pre.add(text); } else { Element e = null; String t = null; @@ -431,10 +443,10 @@ public class TagletWriterImpl extends TagletWriter { c = HtmlTree.SPAN(Text.of(sequence)); classes.forEach(((HtmlTree) c)::addStyle); } - result.add(c); + pre.add(c); } }); - return result; + return copy.add(pre); } /* diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlAttr.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlAttr.java index ba95ddc1af5..0c5154aaaca 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlAttr.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlAttr.java @@ -47,6 +47,7 @@ public enum HtmlAttr { CLEAR, COLS, CONTENT, + DATA_COPIED("data-copied"), // custom HTML5 data attribute DISABLED, FOR, HREF, diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java index 13d04522ed9..1d22926b816 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java @@ -52,6 +52,16 @@ import java.util.regex.Pattern; */ public enum HtmlStyle { + /** + * The class of the {@code div} element containing a snippet element. + */ + snippetContainer, + + /** + * The class of the {@code a} element to copy snippet content to the clipboard. + */ + snippetCopy, + // // // The following constants are used for the main navigation bar that appears in the diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/copy.svg b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/copy.svg new file mode 100644 index 00000000000..7c46ab15fea --- /dev/null +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/copy.svg @@ -0,0 +1,33 @@ + + + + + + + + diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties index cf2f8c53f9f..edc3b53ea46 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties @@ -54,6 +54,8 @@ for duplicates. Include error messages and the following diagnostic in your repo doclet.File_not_found=File not found: {0} doclet.Copy_Overwrite_warning=File {0} not copied to {1} due to existing file with same name... doclet.Copy_Ignored_warning=File {0} not copied: invalid name +doclet.Copy_snippet_to_clipboard=Copy +doclet.Copied_snippet_to_clipboard=Copied! doclet.Copying_File_0_To_Dir_1=Copying file {0} to directory {1}... doclet.Copying_File_0_To_File_1=Copying file {0} to file {1}... doclet.No_Public_Classes_To_Document=No public or protected classes found to document. diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js index 864989cf45f..03bdc7e936a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -106,6 +106,21 @@ function indexFilesLoaded() { && tagSearchIndex; } +function copySnippet(link) { + var textarea = document.createElement("textarea"); + textarea.style.height = 0; + document.body.appendChild(textarea); + textarea.value = link.nextElementSibling.innerText; + textarea.select(); + document.execCommand("copy"); + document.body.removeChild(textarea); + link.classList.add("copied"); + var parent = link.parentElement; + parent.onmouseleave = parent.ontouchend = function() { + link.classList.remove("copied"); + }; +} + // Workaround for scroll position not being included in browser history (8249133) document.addEventListener("DOMContentLoaded", function(e) { var contentDiv = document.querySelector("div.flex-content"); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index bb7934c12c0..6bd0892efb5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -933,7 +933,67 @@ pre.snippet { overflow: auto; white-space: pre; } - +div.snippet-container { + position: relative; +} +a.snippet-copy { + position: absolute; + top: 8px; + right: 8px; +} +a.snippet-copy img { + width: 18px; + height: 18px; + padding: 0.05em 0; + opacity: 50%; + transition: opacity 0.2s; +} +div.snippet-container:hover a.snippet-copy img { + opacity: 80%; +} +div.snippet-container a.snippet-copy:hover img { + opacity: 100%; +} +a.snippet-copy:active img { + background: #d3d3d3; + opacity: 100%; +} +a.snippet-copy::before { + color: #3d3d3d; + content: attr(aria-label); + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size: 85%; + line-height: 1.2em; + padding: 0.2em; + position: absolute; + opacity: 80%; + transition: opacity 0.2s; + white-space: nowrap; + top: -0.01em; + right: 1.5em; + display: none; +} +div.snippet-container:hover a.snippet-copy::before { + display: inherit; +} +div.snippet-container a.snippet-copy:hover::before { + opacity: 100%; +} +a.snippet-copy.copied::before { + content: attr(data-copied); +} +a.snippet-copy:active::before { + background-color: #dadada; +} +@media screen and (max-width: 800px) { + pre.snippet { + padding-top: 26px; + } + a.snippet-copy { + top: 6px; + right: 6px; + } +} pre.snippet .italic { font-style: italic; } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java index 42f2c97c49f..a656178e44e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java @@ -97,6 +97,9 @@ public class DocPaths { /** The name of the default javascript file. */ public static final DocPath JAVASCRIPT = DocPath.create("script.js"); + /** The name of the copy-to-clipboard icon file. */ + public static final DocPath CLIPBOARD_SVG = DocPath.create("copy.svg"); + /** The name of the stylesheet file overriding jQuery UI stylesheet. */ public static final DocPath JQUERY_OVERRIDES_CSS = DocPath.create("jquery-ui.overrides.css"); diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index 20a9e81e9ab..7aab8ff19b1 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -211,6 +211,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                                 Hello, Snippet!
                             
    @@ -852,6 +855,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                             %s
    """.formatted(id, t.expectedOutput())); @@ -946,6 +952,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                             %s
    """.formatted(index, expectedOutput)); @@ -1505,6 +1514,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                             %s
    """.formatted(index, t.expectedOutput())); @@ -1620,6 +1632,9 @@ public class TestSnippetTag extends JavadocTester { """ case0()
    +
    \
+                    Copy
                         
    """); @@ -1627,6 +1642,9 @@ public class TestSnippetTag extends JavadocTester { """ case1()
    +
    \
+                    Copy
                         
    """); @@ -1726,6 +1744,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                             2
    @@ -1808,6 +1829,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                             %s
    """.formatted(index, t.expectedOutput())); @@ -2138,6 +2162,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
    +
    Copy
                             %s
    """.formatted(index, t.expectedOutput())); diff --git a/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java b/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java index a384c1d0c2f..2eb3620b85b 100644 --- a/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java +++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -351,7 +351,7 @@ public class LinkChecker extends HtmlChecker { void addReference(String name, Path from, int line) { if (checked) { - if (name != null) { + if (name != null && !name.isEmpty()) { ID id = map.get(name); if (id == null || !id.declared) { error(from, line, "id not found: " + this.name + "#" + name); @@ -368,7 +368,7 @@ public class LinkChecker extends HtmlChecker { void check() { map.forEach((name, id) -> { - if (name != null && !id.declared) { + if (name != null && !name.isEmpty() && !id.declared) { //log.error(currFile, 0, "id not declared: " + name); for (Position ref : id.references) { error(ref.path, ref.line, "id not found: " + this.name + "#" + name); diff --git a/test/langtools/jdk/javadoc/tool/api/basic/APITest.java b/test/langtools/jdk/javadoc/tool/api/basic/APITest.java index c1ec5c25a7f..a0d68d85403 100644 --- a/test/langtools/jdk/javadoc/tool/api/basic/APITest.java +++ b/test/langtools/jdk/javadoc/tool/api/basic/APITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -196,6 +196,7 @@ class APITest { "allclasses-index.html", "allpackages-index.html", "constant-values.html", + "copy.svg", "deprecated-list.html", "help-doc.html", "index-all.html", -- GitLab From 5b4e39863dbc0d61e91675261dd6887f704ab868 Mon Sep 17 00:00:00 2001 From: Yoshiki Sato Date: Tue, 2 Nov 2021 13:02:51 +0000 Subject: [PATCH 154/890] 8275766: (tz) Update Timezone Data to 2021e 8275849: TestZoneInfo310.java fails with tzdata2021e Reviewed-by: naoto, iris, erikj, coffeys --- make/data/tzdata/VERSION | 2 +- make/data/tzdata/asia | 19 ++++++++++----- make/data/tzdata/australasia | 24 +++++++++++++++---- make/data/tzdata/europe | 13 ++++++---- make/data/tzdata/northamerica | 6 ++--- .../sun/util/calendar/ZoneInfoFile.java | 5 ++-- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/make/data/tzdata/VERSION b/make/data/tzdata/VERSION index b5c971d8979..3a40c910333 100644 --- a/make/data/tzdata/VERSION +++ b/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2021c +tzdata2021e diff --git a/make/data/tzdata/asia b/make/data/tzdata/asia index a5cee81a42e..cfe48745e24 100644 --- a/make/data/tzdata/asia +++ b/make/data/tzdata/asia @@ -3409,11 +3409,6 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes. # http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584 -# From Tim Parenti (2020-10-20): -# Predict future fall transitions at 01:00 on the Saturday preceding October's -# last Sunday (i.e., Sat>=24). This is consistent with our predictions since -# 2016, although the time of the change differed slightly in 2019. - # From Pierre Cashon (2020-10-20): # The summer time this year started on March 28 at 00:00. # https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ @@ -3426,6 +3421,17 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # For now, guess spring-ahead transitions are at 00:00 on the Saturday # preceding March's last Sunday (i.e., Sat>=24). +# From P Chan (2021-10-18): +# http://wafa.ps/Pages/Details/34701 +# Palestine winter time will start from midnight 2021-10-29 (Thursday-Friday). +# +# From Heba Hemad, Palestine Ministry of Telecom & IT (2021-10-20): +# ... winter time will begin in Palestine from Friday 10-29, 01:00 AM +# by 60 minutes backwards. +# +# From Paul Eggert (2021-10-20): +# Guess future fall transitions on October's last Friday at 01:00. + # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - @@ -3461,7 +3467,8 @@ Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - Rule Palestine 2019 only - Mar 29 0:00 1:00 S Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S -Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - +Rule Palestine 2020 only - Oct 24 1:00 0 - +Rule Palestine 2021 max - Oct lastFri 1:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct diff --git a/make/data/tzdata/australasia b/make/data/tzdata/australasia index af72f11e5ae..a6ecb3af593 100644 --- a/make/data/tzdata/australasia +++ b/make/data/tzdata/australasia @@ -408,9 +408,22 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # "Minister for Employment, Parveen Bala says they had never thought of # stopping daylight saving. He says it was just to decide on when it should # start and end. Bala says it is a short period..." -# Since the end date is still in line with our ongoing predictions, assume for -# now that the later-than-usual start date is a one-time departure from the -# recent second Sunday in November pattern. +# +# From Tim Parenti (2021-10-11), per Jashneel Kumar (2021-10-11) and P Chan +# (2021-10-12): +# https://www.fiji.gov.fj/Media-Centre/Speeches/English/PM-BAINIMARAMA-S-COVID-19-ANNOUNCEMENT-10-10-21 +# https://www.fbcnews.com.fj/news/covid-19/curfew-moved-back-to-11pm/ +# In a 2021-10-10 speech concerning updated Covid-19 mitigation measures in +# Fiji, prime minister Josaia Voreqe "Frank" Bainimarama announced the +# suspension of DST for the 2021/2022 season: "Given that we are in the process +# of readjusting in the midst of so many changes, we will also put Daylight +# Savings Time on hold for this year. It will also make the reopening of +# scheduled commercial air service much smoother if we don't have to be +# concerned shifting arrival and departure times, which may look like a simple +# thing but requires some significant logistical adjustments domestically and +# internationally." +# Assume for now that DST will resume with the recent pre-2020 rules for the +# 2022/2023 season. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 - @@ -422,10 +435,11 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - Rule Fiji 2014 only - Jan Sun>=18 2:00 0 - Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 - -Rule Fiji 2015 max - Jan Sun>=12 3:00 0 - +Rule Fiji 2015 2021 - Jan Sun>=12 3:00 0 - Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 - Rule Fiji 2020 only - Dec 20 2:00 1:00 - -Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2022 max - Nov Sun>=8 2:00 1:00 - +Rule Fiji 2023 max - Jan Sun>=12 3:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji +12/+13 diff --git a/make/data/tzdata/europe b/make/data/tzdata/europe index 87f9a19f7ac..9b0b64aa3eb 100644 --- a/make/data/tzdata/europe +++ b/make/data/tzdata/europe @@ -844,7 +844,7 @@ Zone Europe/Andorra 0:06:04 - LMT 1901 # Shanks & Pottenger give 02:00, the BEV 00:00. Go with the BEV, # and guess 02:00 for 1945-04-12. -# From Alois Triendl (2019-07-22): +# From Alois Treindl (2019-07-22): # In 1946 the end of DST was on Monday, 7 October 1946, at 3:00 am. # Shanks had this right. Source: Die Weltpresse, 5. Oktober 1946, page 5. @@ -1758,19 +1758,22 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908 # advanced to sixty minutes later starting at hour two on 1944-04-02; ... # Starting at hour three on the date 1944-09-17 standard time will be resumed. # -# From Alois Triendl (2019-07-02): +# From Alois Treindl (2019-07-02): # I spent 6 Euros to buy two archive copies of Il Messaggero, a Roman paper, # for 1 and 2 April 1944. The edition of 2 April has this note: "Tonight at 2 # am, put forward the clock by one hour. Remember that in the night between # today and Monday the 'ora legale' will come in force again." That makes it # clear that in Rome the change was on Monday, 3 April 1944 at 2 am. # -# From Paul Eggert (2016-10-27): +# From Paul Eggert (2021-10-05): # Go with INRiM for DST rules, except as corrected by Inglis for 1944 # for the Kingdom of Italy. This is consistent with Renzo Baldini. # Model Rome's occupation by using C-Eur rules from 1943-09-10 # to 1944-06-04; although Rome was an open city during this period, it -# was effectively controlled by Germany. +# was effectively controlled by Germany. Using C-Eur is consistent +# with Treindl's comment about Rome in April 1944, as the "Rule Italy" +# lines during German occupation do not affect Europe/Rome +# (though they do affect Europe/Malta). # # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Italy 1916 only - Jun 3 24:00 1:00 S @@ -2646,7 +2649,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # Although Shanks lists 1945-01-01 as the date for transition from # +01/+02 to +02/+03, more likely this is a placeholder. Guess that # the transition occurred at 1945-04-10 00:00, which is about when -# Königsberg surrendered to Soviet troops. (Thanks to Alois Triendl.) +# Königsberg surrendered to Soviet troops. (Thanks to Alois Treindl.) # From Paul Eggert (2016-03-18): # The 1989 transition is from USSR act No. 227 (1989-03-14). diff --git a/make/data/tzdata/northamerica b/make/data/tzdata/northamerica index ddd4929b1d4..411099713c3 100644 --- a/make/data/tzdata/northamerica +++ b/make/data/tzdata/northamerica @@ -999,7 +999,7 @@ Zone America/Indiana/Vincennes -5:50:07 - LMT 1883 Nov 18 12:09:53 -5:00 US E%sT # # Perry County, Indiana, switched from eastern to central time in April 2006. -# From Alois Triendl (2019-07-09): +# From Alois Treindl (2019-07-09): # The Indianapolis News, Friday 27 October 1967 states that Perry County # returned to CST. It went again to EST on 27 April 1969, as documented by the # Indianapolis star of Saturday 26 April. @@ -1959,7 +1959,7 @@ Zone America/Swift_Current -7:11:20 - LMT 1905 Sep # Alberta -# From Alois Triendl (2019-07-19): +# From Alois Treindl (2019-07-19): # There was no DST in Alberta in 1967... Calgary Herald, 29 April 1967. # 1969, no DST, from Edmonton Journal 18 April 1969 # @@ -2014,7 +2014,7 @@ Zone America/Edmonton -7:33:52 - LMT 1906 Sep # # From Paul Eggert (2019-07-25): # Shanks says Fort Nelson did not observe DST in 1946, unlike Vancouver. -# Alois Triendl confirmed this on 07-22, citing the 1946-04-27 Vancouver Daily +# Alois Treindl confirmed this on 07-22, citing the 1946-04-27 Vancouver Daily # Province. He also cited the 1946-09-28 Victoria Daily Times, which said # that Vancouver, Victoria, etc. "change at midnight Saturday"; for now, # guess they meant 02:00 Sunday since 02:00 was common practice in Vancouver. diff --git a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java index 9f78c46fd5b..647cd661382 100644 --- a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java +++ b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java @@ -605,9 +605,8 @@ public final class ZoneInfoFile { params[7] = 0; } else { // hacking: see comment above - if (dom < 0 || dom >= 24 && - !(zoneId.equals("Asia/Gaza") || - zoneId.equals("Asia/Hebron"))) { + // No need of hacking for Asia/Gaza and Asia/Hebron from tz2021e + if (dom < 0 || dom >= 24) { params[6] = -1; params[7] = toCalendarDOW[dow]; } else { -- GitLab From b889f2a88a5e182d2424b741d8fedf2c784442f1 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 2 Nov 2021 13:04:09 +0000 Subject: [PATCH 155/890] 8276175: codestrings.validate_vm gtest still broken on ppc64 after JDK-8276046 Reviewed-by: mdoerr --- test/hotspot/gtest/code/test_codestrings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hotspot/gtest/code/test_codestrings.cpp b/test/hotspot/gtest/code/test_codestrings.cpp index 37376cfcf3d..f5fcec36e63 100644 --- a/test/hotspot/gtest/code/test_codestrings.cpp +++ b/test/hotspot/gtest/code/test_codestrings.cpp @@ -25,8 +25,6 @@ #ifndef PRODUCT #ifndef ZERO -// Neither ppc nor s390 compilers use code strings. -#if !defined(PPC) && !defined(S390) #include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" @@ -258,12 +256,16 @@ static void buffer_blob_test() BufferBlob::free(blob); } +#if defined(PPC) || defined(S390) +// Neither ppc nor s390 compiler use code strings +TEST_VM(codestrings, DISABLED_validate) +#else TEST_VM(codestrings, validate) +#endif { code_buffer_test(); buffer_blob_test(); } -#endif // not S390 not PPC #endif // not ZERO #endif // not PRODUCT -- GitLab From cd778f5b049d52b68ab5872aad5f81e86e1718f7 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Tue, 2 Nov 2021 13:23:18 +0000 Subject: [PATCH 156/890] 8202667: java/awt/Debug/DumpOnKey/DumpOnKey.java times out on Windows Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 - test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index b7e772135dc..59227ac954b 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -469,7 +469,6 @@ java/awt/font/TextLayout/LigatureCaretTest.java 8266312 generic-all java/awt/image/VolatileImage/CustomCompositeTest.java 8199002 windows-all,linux-all java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all java/awt/JAWT/JAWT.sh 8197798 windows-all,linux-all -java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all java/awt/Robot/RobotWheelTest/RobotWheelTest.java 8129827 generic-all java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all diff --git a/test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java b/test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java index 5dd99d9e6ea..67b88b0d955 100644 --- a/test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java +++ b/test/jdk/java/awt/Debug/DumpOnKey/DumpOnKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -22,6 +22,7 @@ */ import java.awt.AWTException; +import java.awt.EventQueue; import java.awt.Frame; import java.awt.Robot; import java.awt.Window; @@ -58,9 +59,11 @@ public final class DumpOnKey { w.setSize(200, 200); w.setLocationRelativeTo(null); w.setVisible(true); + w.toFront(); + w.requestFocus(); final Robot robot = new Robot(); - robot.setAutoDelay(50); + robot.setAutoDelay(100); robot.setAutoWaitForIdle(true); robot.mouseMove(w.getX() + w.getWidth() / 2, w.getY() + w.getHeight() / 2); @@ -74,7 +77,14 @@ public final class DumpOnKey { robot.keyRelease(KeyEvent.VK_SHIFT); robot.keyRelease(KeyEvent.VK_CONTROL); - w.dispose(); + try { + EventQueue.invokeAndWait(() -> { + w.dispose(); + }); + } catch (Exception e) {} + + robot.delay(2000); + if (dumped != dump) { throw new RuntimeException("Exp:" + dump + ", actual:" + dumped); } -- GitLab From 495c828ae95205885b091dde795b517ba332a2b1 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Tue, 2 Nov 2021 16:08:11 +0000 Subject: [PATCH 157/890] 8276188: Clarify "default charset" descriptions in String class Reviewed-by: iris, joehw --- .../share/classes/java/lang/String.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/java.base/share/classes/java/lang/String.java b/src/java.base/share/classes/java/lang/String.java index 59a2181ae0e..fd247fa5c76 100644 --- a/src/java.base/share/classes/java/lang/String.java +++ b/src/java.base/share/classes/java/lang/String.java @@ -366,9 +366,8 @@ public final class String * * @deprecated This method does not properly convert bytes into characters. * As of JDK 1.1, the preferred way to do this is via the - * {@code String} constructors that take a {@link - * java.nio.charset.Charset}, charset name, or that use the platform's - * default charset. + * {@code String} constructors that take a {@link Charset}, charset name, + * or that use the {@link Charset#defaultCharset() default charset}. * * @param ascii * The bytes to be converted to characters @@ -428,9 +427,8 @@ public final class String * * @deprecated This method does not properly convert bytes into * characters. As of JDK 1.1, the preferred way to do this is via the - * {@code String} constructors that take a {@link - * java.nio.charset.Charset}, charset name, or that use the platform's - * default charset. + * {@code String} constructors that take a {@link Charset}, charset name, + * or that use the {@link Charset#defaultCharset() default charset}. * * @param ascii * The bytes to be converted to characters @@ -1385,9 +1383,9 @@ public final class String /** * Constructs a new {@code String} by decoding the specified subarray of - * bytes using the platform's default charset. The length of the new - * {@code String} is a function of the charset, and hence may not be equal - * to the length of the subarray. + * bytes using the {@link Charset#defaultCharset() default charset}. + * The length of the new {@code String} is a function of the charset, + * and hence may not be equal to the length of the subarray. * *

    The behavior of this constructor when the given bytes are not valid * in the default charset is unspecified. The {@link @@ -1415,9 +1413,9 @@ public final class String /** * Constructs a new {@code String} by decoding the specified array of bytes - * using the platform's default charset. The length of the new {@code - * String} is a function of the charset, and hence may not be equal to the - * length of the byte array. + * using the {@link Charset#defaultCharset() default charset}. The length + * of the new {@code String} is a function of the charset, and hence may not + * be equal to the length of the byte array. * *

    The behavior of this constructor when the given bytes are not valid * in the default charset is unspecified. The {@link @@ -1693,7 +1691,8 @@ public final class String * * @deprecated This method does not properly convert characters into * bytes. As of JDK 1.1, the preferred way to do this is via the - * {@link #getBytes()} method, which uses the platform's default charset. + * {@link #getBytes()} method, which uses the {@link Charset#defaultCharset() + * default charset}. * * @param srcBegin * Index of the first character in the string to copy @@ -1780,7 +1779,8 @@ public final class String /** * Encodes this {@code String} into a sequence of bytes using the - * platform's default charset, storing the result into a new byte array. + * {@link Charset#defaultCharset() default charset}, storing the result + * into a new byte array. * *

    The behavior of this method when this string cannot be encoded in * the default charset is unspecified. The {@link -- GitLab From fa4ce824a39264e765b8236ee58b1f28faa371e0 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 2 Nov 2021 16:27:56 +0000 Subject: [PATCH 158/890] 8276260: (se) Remove java/nio/channels/Selector/Wakeup.java from ProblemList (win) Reviewed-by: alanb --- test/jdk/ProblemList.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 59227ac954b..30b2416eccb 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -608,8 +608,6 @@ java/nio/channels/DatagramChannel/Unref.java 8233519 generic- java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64 -java/nio/channels/Selector/Wakeup.java 6963118 windows-all - ############################################################################ # jdk_rmi -- GitLab From 8fc16f1605b396bfb9265a97bc126d435d6d5951 Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Tue, 2 Nov 2021 16:32:04 +0000 Subject: [PATCH 159/890] 8275729: Qualified method names in CodeHeap Analytics Reviewed-by: yyang, thartmann --- src/hotspot/share/code/codeHeapState.cpp | 6 ++ .../CodeHeapAnalyticsMethodNames.java | 69 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 test/hotspot/jtreg/serviceability/dcmd/compiler/CodeHeapAnalyticsMethodNames.java diff --git a/src/hotspot/share/code/codeHeapState.cpp b/src/hotspot/share/code/codeHeapState.cpp index 30948e4f718..1c5cd874b2c 100644 --- a/src/hotspot/share/code/codeHeapState.cpp +++ b/src/hotspot/share/code/codeHeapState.cpp @@ -26,6 +26,7 @@ #include "precompiled.hpp" #include "code/codeHeapState.hpp" #include "compiler/compileBroker.hpp" +#include "oops/klass.inline.hpp" #include "runtime/safepoint.hpp" #include "runtime/sweeper.hpp" #include "utilities/powerOfTwo.hpp" @@ -2334,6 +2335,11 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) { Symbol* methSig = method->signature(); const char* methSigS = (methSig == NULL) ? NULL : methSig->as_C_string(); methSigS = (methSigS == NULL) ? "" : methSigS; + + Klass* klass = method->method_holder(); + assert(klass->is_loader_alive(), "must be alive"); + + ast->print("%s.", klass->external_name()); ast->print("%s", methNameS); ast->print("%s", methSigS); } else { diff --git a/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeHeapAnalyticsMethodNames.java b/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeHeapAnalyticsMethodNames.java new file mode 100644 index 00000000000..da10be193b9 --- /dev/null +++ b/test/hotspot/jtreg/serviceability/dcmd/compiler/CodeHeapAnalyticsMethodNames.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021, Amazon.com Inc. 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.util.Iterator; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.dcmd.PidJcmdExecutor; + +/* + * @test CodeHeapAnalyticsMethodNames + * @summary Test Compiler.CodeHeap_Analytics output has qualified method names + * in the 'METHOD NAMES' section. + * @bug 8275729 + * @requires vm.flagless + * @library /test/lib + * @modules java.base/jdk.internal.misc + * java.management + * @run driver CodeHeapAnalyticsMethodNames + */ + +public class CodeHeapAnalyticsMethodNames { + + public static void main(String args[]) throws Exception { + PidJcmdExecutor executor = new PidJcmdExecutor(); + OutputAnalyzer out = executor.execute("Compiler.CodeHeap_Analytics"); + out.shouldHaveExitValue(0); + Iterator iter = out.asLines().listIterator(); + boolean methodNamesSectionFound = false; + while (iter.hasNext()) { + String line = iter.next(); + if (line.contains("M E T H O D N A M E S")) { + methodNamesSectionFound = true; + break; + } + } + boolean nMethodFound = false; + while (iter.hasNext()) { + String line = iter.next(); + if (line.startsWith("0x") && line.contains("nMethod")) { + nMethodFound = true; + if (line.contains("java.lang.invoke.MethodHandle")) { + return; + } + } + } + if (methodNamesSectionFound && nMethodFound) { + throw new RuntimeException("No java.lang.invoke.MethodHandle found."); + } + } +} -- GitLab From 01105d6985b39d4064b9066eab3612da5a401685 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 2 Nov 2021 16:50:47 +0000 Subject: [PATCH 160/890] 8276367: ProblemList vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java Reviewed-by: bpb --- test/hotspot/jtreg/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index b4bb635d7c9..7a2d384325a 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -158,6 +158,7 @@ vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.ja vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all +vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java 8272800 generic-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all -- GitLab From 6a04899ba1a62f52f7e28cc2ed72bdca115e6562 Mon Sep 17 00:00:00 2001 From: Markus Karg Date: Tue, 2 Nov 2021 18:06:14 +0000 Subject: [PATCH 161/890] 8275840: Add test to java/nio/channels/Channels/TransferTo.java to test transfer sizes > 2GB Reviewed-by: lancea --- .../nio/channels/Channels/TransferTo.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test/jdk/java/nio/channels/Channels/TransferTo.java b/test/jdk/java/nio/channels/Channels/TransferTo.java index b345770777e..9cabc88ce35 100644 --- a/test/jdk/java/nio/channels/Channels/TransferTo.java +++ b/test/jdk/java/nio/channels/Channels/TransferTo.java @@ -64,6 +64,10 @@ public class TransferTo { private static final int ITERATIONS = 10; + private static final int NUM_WRITES = 3 * 1024; + private static final int BYTES_PER_WRITE = 1024 * 1024; + private static final long BYTES_WRITTEN = (long) NUM_WRITES * BYTES_PER_WRITE; + private static final Random RND = RandomFactory.getRandom(); /* @@ -126,6 +130,37 @@ public class TransferTo { checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(4096, 0), 0, 4096); } + /* + * Special test for file-to-file transfer of more than two GB. + * This test covers multiple iterations of FileChannel.transerTo(FileChannel), + * which ChannelInputStream.transferTo() only applies in this particular case, + * and cannot get tested using a single byte[] due to size limitation of arrays. + */ + @Test + public void testMoreThanTwoGB() throws IOException { + // preparing two temporary files which will be compared at the end of the test + Path sourceFile = Files.createTempFile(null, null); + Path targetFile = Files.createTempFile(null, null); + + // writing 3 GB of random bytes into source file + for (int i = 0; i < NUM_WRITES; i++) + Files.write(sourceFile, createRandomBytes(BYTES_PER_WRITE, 0), StandardOpenOption.APPEND); + + // performing actual transfer, effectively by multiple invocations of Filechannel.transferTo(FileChannel) + long count; + try (InputStream inputStream = Channels.newInputStream(FileChannel.open(sourceFile)); + OutputStream outputStream = Channels + .newOutputStream(FileChannel.open(targetFile, StandardOpenOption.WRITE))) { + count = inputStream.transferTo(outputStream); + } + + // comparing reported transferred bytes, must be 3 GB + assertEquals(count, BYTES_WRITTEN); + + // comparing content of both files, failing in case of any difference + assertEquals(Files.mismatch(sourceFile, targetFile), -1); + } + /* * Asserts that the transferred content is correct, i. e. compares the actually transferred bytes * to the expected assumption. The position of the input and output stream before the transfer is -- GitLab From bb92fb02ca8c5795989065a9037748dc39ed77db Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Tue, 2 Nov 2021 21:57:16 +0000 Subject: [PATCH 162/890] 8274930: sun/tools/jps/TestJps.java can fail with long VM arguments string Reviewed-by: sspitsyn, lmesnik --- test/jdk/sun/tools/jps/JpsHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/jdk/sun/tools/jps/JpsHelper.java b/test/jdk/sun/tools/jps/JpsHelper.java index c70b3790182..81f49aaa06e 100644 --- a/test/jdk/sun/tools/jps/JpsHelper.java +++ b/test/jdk/sun/tools/jps/JpsHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -106,6 +106,7 @@ public final class JpsHelper { private static String[] testVmArgs = { "-XX:+UsePerfData", "-Xmx512m", "-Xlog:gc", "-Dmultiline.prop=value1\nvalue2\r\nvalue3", + "-XX:PerfMaxStringConstLength=8K", // avoid VM flags truncations for "jps -v" null /* lazily initialized -XX:Flags */}; private static File manifestFile = null; -- GitLab From 2b02b6f513b062261195ca1edd059d16abb7bec6 Mon Sep 17 00:00:00 2001 From: Guoxiong Li Date: Wed, 3 Nov 2021 01:57:52 +0000 Subject: [PATCH 163/890] 8274942: AssertionError at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155) Reviewed-by: vromero --- .../com/sun/tools/javac/comp/Annotate.java | 6 ++ .../typeAnnotations/NestTypeAnnotation.java | 57 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 test/langtools/tools/javac/annotations/typeAnnotations/NestTypeAnnotation.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java index d391ff38dc4..2561ae38f29 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java @@ -672,6 +672,12 @@ public class Annotate { log.error(tree.pos(), Errors.AttributeValueMustBeConstant); return new Attribute.Error(expectedElementType); } + + // Scan the annotation element value and then attribute nested annotations if present + if (tree.type != null && tree.type.tsym != null) { + queueScanTreeAndTypeAnnotate(tree, env, tree.type.tsym, tree.pos()); + } + result = cfolder.coerce(result, expectedElementType); return new Attribute.Constant(expectedElementType, result.constValue()); } diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/NestTypeAnnotation.java b/test/langtools/tools/javac/annotations/typeAnnotations/NestTypeAnnotation.java new file mode 100644 index 00000000000..e1091dd7f36 --- /dev/null +++ b/test/langtools/tools/javac/annotations/typeAnnotations/NestTypeAnnotation.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021, 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 8274942 + * @summary javac should attribute the internal annotations of the annotation element value + * @compile NestTypeAnnotation.java + */ + +import java.lang.annotation.*; + +public class NestTypeAnnotation { + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) + public @interface OuterAnnotation { + int intVal(); + float floatVal(); + } + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) + public @interface InnerAnnotation { } + + public static void main(String[] args) { + int intVal1 = (@OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) int) 2.4; + int[] arr = new int []{1, 2}; // use `2.4 * arr[0] + arr[1]` to prevent optimization. + int intVal2 = (@OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) int) (2.4 * arr[0] + arr[1]); + + int[] singleArr1 = new @OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) int [2]; + @OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) int[] singleArr2 = new int [2]; + int[] singleArr3 = new int @OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) [2]; + + int[][] multiArr1 = new int @OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) [2][3]; + int[][] multiArr2 = new int [2] @OuterAnnotation(intVal = (@InnerAnnotation() int) 2.5, floatVal = (@InnerAnnotation() float) 2.5) [3]; + } +} -- GitLab From 87b926ebb7f1e341da858f7a9892377586abc026 Mon Sep 17 00:00:00 2001 From: sunguoyun Date: Wed, 3 Nov 2021 05:51:18 +0000 Subject: [PATCH 164/890] 8275086: compiler/c2/irTests/TestPostParseCallDevirtualization.java fails when compiler1 is disabled Reviewed-by: iveresov --- .../c2/irTests/TestPostParseCallDevirtualization.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestPostParseCallDevirtualization.java b/test/hotspot/jtreg/compiler/c2/irTests/TestPostParseCallDevirtualization.java index a2db87b0481..a698081a2c8 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestPostParseCallDevirtualization.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestPostParseCallDevirtualization.java @@ -169,8 +169,9 @@ public class TestPostParseCallDevirtualization { } @Run(test = "testMethodHandleCallWithLoop") + @Warmup(5000) public void checkTestMethodHandleCallWithLoop() throws Throwable { - Asserts.assertEquals(testMethodHandleCallWithLoop(), 42); + Asserts.assertEquals( (int)mh2.invokeExact(), 42); } @Test @@ -194,7 +195,8 @@ public class TestPostParseCallDevirtualization { } @Run(test = "testMethodHandleCallWithCCP") + @Warmup(5000) public void checkTestMethodHandleCallWithCCP() throws Throwable { - Asserts.assertEquals(testMethodHandleCallWithCCP(), 42); + Asserts.assertEquals( (int)mh2.invokeExact(), 42); } } -- GitLab From 7439b59b5a6816269b16d210ef10779fc9def8e2 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Wed, 3 Nov 2021 08:44:03 +0000 Subject: [PATCH 165/890] 8276044: ciReplay: C1 does not dump a replay file when using DumpReplay as compile command option Reviewed-by: kvn, thartmann, dlong --- src/hotspot/share/c1/c1_Compilation.cpp | 5 + .../jtreg/compiler/ciReplay/CiReplayBase.java | 16 ++-- .../ciReplay/TestDumpReplayCommandLine.java | 93 +++++++++++++++++++ 3 files changed, 108 insertions(+), 6 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/ciReplay/TestDumpReplayCommandLine.java diff --git a/src/hotspot/share/c1/c1_Compilation.cpp b/src/hotspot/share/c1/c1_Compilation.cpp index 53ef19b1c1f..df4b6bbed54 100644 --- a/src/hotspot/share/c1/c1_Compilation.cpp +++ b/src/hotspot/share/c1/c1_Compilation.cpp @@ -399,6 +399,11 @@ int Compilation::compile_java_method() { } CHECK_BAILOUT_(no_frame_size); + // Dump compilation data to replay it. + if (_directive->DumpReplayOption) { + env()->dump_replay_data(env()->compile_id()); + } + { PhaseTraceTime timeit(_t_codeemit); return emit_code_body(); diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index 6af306f8b08..2fccc385ee1 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -252,13 +252,17 @@ public abstract class CiReplayBase { } public int getCompLevelFromReplay() { - try(BufferedReader br = new BufferedReader(new FileReader(REPLAY_FILE_NAME))) { + return getCompLevelFromReplay(REPLAY_FILE_NAME); + } + + public int getCompLevelFromReplay(String replayFile) { + try (BufferedReader br = new BufferedReader(new FileReader(replayFile))) { return br.lines() - .filter(s -> s.startsWith("compile ")) - .map(s -> s.split("\\s+")[5]) - .map(Integer::parseInt) - .findAny() - .get(); + .filter(s -> s.startsWith("compile ")) + .map(s -> s.split("\\s+")[5]) + .map(Integer::parseInt) + .findAny() + .orElseThrow(); } catch (IOException ioe) { throw new Error("Failed to read replay data: " + ioe, ioe); } diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestDumpReplayCommandLine.java b/test/hotspot/jtreg/compiler/ciReplay/TestDumpReplayCommandLine.java new file mode 100644 index 00000000000..b8d604df602 --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/TestDumpReplayCommandLine.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021, 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 8276044 + * @library / /test/lib + * @summary Testing that a replay file is dumped for C1 and C2 when using the DumpReplay compile command option. + * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.debug == true + * & vm.compiler1.enabled & vm.compiler2.enabled + * @modules java.base/jdk.internal.misc + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+TieredCompilation + * compiler.ciReplay.TestDumpReplayCommandLine + */ + +package compiler.ciReplay; + +import jdk.test.lib.Asserts; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TestDumpReplayCommandLine extends DumpReplayBase { + + public static void main(String[] args) { + new TestDumpReplayCommandLine().runTest(TIERED_ENABLED_VM_OPTION); + } + + @Override + public void testAction() { + List replayFiles = getReplayFiles(); + Asserts.assertEQ(2, replayFiles.size(), "should find a C1 and a C2 replay file"); + String replayFile1 = replayFiles.get(0).getName(); + String replayFile2 = replayFiles.get(1).getName(); + int compileId1 = getCompileIdFromFile(replayFile1); + int compileId2 = getCompileIdFromFile(replayFile2); + int compLevel1 = getCompLevelFromReplay(replayFile1); + int compLevel2 = getCompLevelFromReplay(replayFile2); + Asserts.assertEQ(compileId1 < compileId2 ? compLevel1 : compLevel2, 3, "Must be C1 replay file"); + Asserts.assertEQ(compileId1 < compileId2 ? compLevel2 : compLevel1, 4, "Must be C2 replay file"); + } + + @Override + public String getTestClass() { + return TestDumpReplayCommandFoo.class.getName(); + } +} + +class TestDumpReplayCommandFoo { + public static int iFld; + + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + test(); + } + } + + public static void test() { + for (int i = 0; i < 1; i++) { + iFld = 3; + } + } +} -- GitLab From 465d350d0b3cac277a58b9f8ece196c1cde68e80 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 3 Nov 2021 09:06:21 +0000 Subject: [PATCH 166/890] 8276157: C2: Compiler stack overflow during escape analysis on Linux x86_32 Reviewed-by: kvn, thartmann --- src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp b/src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp index f5fdd6399fe..8f1f64c2d9e 100644 --- a/src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp +++ b/src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp @@ -34,7 +34,13 @@ define_pd_global(intx, CompilerThreadStackSize, 1024); define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default define_pd_global(intx, VMThreadStackSize, 1024); #else -define_pd_global(intx, CompilerThreadStackSize, 512); +// Some tests in debug VM mode run out of compile thread stack. +// Observed on some x86_32 VarHandles tests during escape analysis. +#ifdef ASSERT +define_pd_global(intx, CompilerThreadStackSize, 768); +#else +define_pd_global(intx, CompilerThreadStackSize, 512); +#endif // ThreadStackSize 320 allows a couple of test cases to run while // keeping the number of threads that can be created high. System // default ThreadStackSize appears to be 512 which is too big. -- GitLab From 615063364ab6bdd3fa83401745e05b45e13eacdb Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Wed, 3 Nov 2021 10:07:48 +0000 Subject: [PATCH 167/890] 8276348: Use blessed modifier order in java.base Reviewed-by: dfuchs, darcy, iris, rriggs, martin --- .../share/classes/java/io/ObjectInputFilter.java | 4 ++-- .../share/classes/java/io/ObjectStreamClass.java | 2 +- src/java.base/share/classes/java/lang/Object.java | 2 +- src/java.base/share/classes/java/lang/Process.java | 2 +- .../share/classes/java/lang/StackStreamFactory.java | 6 +++--- src/java.base/share/classes/java/lang/System.java | 4 ++-- src/java.base/share/classes/java/lang/WeakPairMap.java | 4 ++-- .../classes/java/lang/invoke/AbstractConstantGroup.java | 4 ++-- .../share/classes/java/lang/invoke/CallSite.java | 6 +++--- src/java.base/share/classes/java/net/InetAddress.java | 2 +- src/java.base/share/classes/java/security/Provider.java | 2 +- .../share/classes/java/util/ImmutableCollections.java | 8 ++++---- .../classes/jdk/internal/icu/util/CodePointTrie.java | 8 ++++---- .../classes/jdk/internal/jimage/BasicImageReader.java | 6 +++--- .../classes/jdk/internal/jimage/NativeImageBuffer.java | 2 +- .../classes/jdk/internal/logger/SimpleConsoleLogger.java | 2 +- .../classes/jdk/internal/module/ModuleReferences.java | 2 +- .../share/classes/sun/nio/ch/FileChannelImpl.java | 2 +- .../share/classes/sun/security/jca/ProviderList.java | 2 +- .../share/classes/sun/security/rsa/RSAPrivateKeyImpl.java | 4 ++-- .../share/classes/sun/security/ssl/SSLHandshake.java | 4 ++-- 21 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index f339411593d..c9722ea23e7 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -561,7 +561,7 @@ public interface ObjectInputFilter { /** * Lock object for filter and filter factory. */ - private final static Object serialFilterLock = new Object(); + private static final Object serialFilterLock = new Object(); /** * The property name for the filter. @@ -906,7 +906,7 @@ public interface ObjectInputFilter { * used for all ObjectInputStreams that do not set their own filters. * */ - final static class Global implements ObjectInputFilter { + static final class Global implements ObjectInputFilter { /** * The pattern used to create the filter. */ diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java index 82ba054f61f..ff8a934a887 100644 --- a/src/java.base/share/classes/java/io/ObjectStreamClass.java +++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java @@ -2515,7 +2515,7 @@ public class ObjectStreamClass implements Serializable { } // a key composed of ObjectStreamField[] names and types - static abstract class Key { + abstract static class Key { abstract int length(); abstract String fieldName(int i); abstract Class fieldType(int i); diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java index d0ad7d43cd9..b8085b230af 100644 --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -278,7 +278,7 @@ public class Object { *

  • By executing the body of a {@code synchronized} statement * that synchronizes on the object. *
  • For objects of type {@code Class,} by executing a - * synchronized static method of that class. + * static synchronized method of that class. * *

    * Only one thread at a time can own an object's monitor. diff --git a/src/java.base/share/classes/java/lang/Process.java b/src/java.base/share/classes/java/lang/Process.java index 5fad1b889d5..88e3e473e76 100644 --- a/src/java.base/share/classes/java/lang/Process.java +++ b/src/java.base/share/classes/java/lang/Process.java @@ -845,7 +845,7 @@ public abstract class Process { * A nested class to delay looking up the Charset for the native encoding. */ private static class CharsetHolder { - private final static Charset nativeCharset; + private static final Charset nativeCharset; static { Charset cs; try { diff --git a/src/java.base/share/classes/java/lang/StackStreamFactory.java b/src/java.base/share/classes/java/lang/StackStreamFactory.java index 328154dc04e..22cbb2e170a 100644 --- a/src/java.base/share/classes/java/lang/StackStreamFactory.java +++ b/src/java.base/share/classes/java/lang/StackStreamFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -118,7 +118,7 @@ final class StackStreamFactory { * For example, StackFrameInfo for StackWalker::walk or * Class for StackWalker::getCallerClass */ - static abstract class AbstractStackWalker { + abstract static class AbstractStackWalker { protected final StackWalker walker; protected final Thread thread; protected final int maxDepth; @@ -783,7 +783,7 @@ final class StackStreamFactory { * * Each specialized AbstractStackWalker subclass may subclass the FrameBuffer. */ - static abstract class FrameBuffer { + abstract static class FrameBuffer { static final int START_POS = 2; // 0th and 1st elements are reserved // buffers for VM to fill stack frame info diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index fac67162435..6d4137c7aa4 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -331,7 +331,7 @@ public final class System { private static class CallersHolder { // Remember callers of setSecurityManager() here so that warning // is only printed once for each different caller - final static Map, Boolean> callers + static final Map, Boolean> callers = Collections.synchronizedMap(new WeakHashMap<>()); } @@ -1595,7 +1595,7 @@ public final class System { * * @since 9 */ - public static abstract class LoggerFinder { + public abstract static class LoggerFinder { /** * The {@code RuntimePermission("loggerFinder")} is * necessary to subclass and instantiate the {@code LoggerFinder} class, diff --git a/src/java.base/share/classes/java/lang/WeakPairMap.java b/src/java.base/share/classes/java/lang/WeakPairMap.java index 0e521dc901a..f274461a5db 100644 --- a/src/java.base/share/classes/java/lang/WeakPairMap.java +++ b/src/java.base/share/classes/java/lang/WeakPairMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -340,7 +340,7 @@ final class WeakPairMap { /** * Common abstract supertype of a pair of WeakReference peers. */ - private static abstract class WeakRefPeer extends WeakReference { + private abstract static class WeakRefPeer extends WeakReference { WeakRefPeer(K k, ReferenceQueue queue) { super(Objects.requireNonNull(k), queue); diff --git a/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java index b61875762a4..5c0f2ec7944 100644 --- a/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java +++ b/src/java.base/share/classes/java/lang/invoke/AbstractConstantGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -244,7 +244,7 @@ abstract class AbstractConstantGroup implements ConstantGroup { } } - static abstract + abstract static class WithCache extends AbstractConstantGroup { @Stable final Object[] cache; diff --git a/src/java.base/share/classes/java/lang/invoke/CallSite.java b/src/java.base/share/classes/java/lang/invoke/CallSite.java index d6011851d9d..e159e235f30 100644 --- a/src/java.base/share/classes/java/lang/invoke/CallSite.java +++ b/src/java.base/share/classes/java/lang/invoke/CallSite.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -84,8 +84,8 @@ private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String nam * @author John Rose, JSR 292 EG * @since 1.7 */ -abstract -public class CallSite { +public +abstract class CallSite { // The actual payload of this call site. // Can be modified using {@link MethodHandleNatives#setCallSiteTargetNormal} or {@link MethodHandleNatives#setCallSiteTargetVolatile}. diff --git a/src/java.base/share/classes/java/net/InetAddress.java b/src/java.base/share/classes/java/net/InetAddress.java index b43c88e4f0e..38e7fc62921 100644 --- a/src/java.base/share/classes/java/net/InetAddress.java +++ b/src/java.base/share/classes/java/net/InetAddress.java @@ -215,7 +215,7 @@ public class InetAddress implements java.io.Serializable { @Native static final int IPv6 = 2; /* Specify address family preference */ - static transient final int preferIPv6Address; + static final transient int preferIPv6Address; static class InetAddressHolder { /** diff --git a/src/java.base/share/classes/java/security/Provider.java b/src/java.base/share/classes/java/security/Provider.java index ca8c96c3e04..11c8eb29ca7 100644 --- a/src/java.base/share/classes/java/security/Provider.java +++ b/src/java.base/share/classes/java/security/Provider.java @@ -820,7 +820,7 @@ public abstract class Provider extends Properties { // legacy properties changed since last call to any services method? private transient boolean legacyChanged; // serviceMap changed since last call to getServices() - private volatile transient boolean servicesChanged; + private transient volatile boolean servicesChanged; // Map used to keep track of legacy registration private transient Map legacyStrings; diff --git a/src/java.base/share/classes/java/util/ImmutableCollections.java b/src/java.base/share/classes/java/util/ImmutableCollections.java index 52a83552f14..c207e4f1427 100644 --- a/src/java.base/share/classes/java/util/ImmutableCollections.java +++ b/src/java.base/share/classes/java/util/ImmutableCollections.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -142,7 +142,7 @@ class ImmutableCollections { static UnsupportedOperationException uoe() { return new UnsupportedOperationException(); } @jdk.internal.ValueBased - static abstract class AbstractImmutableCollection extends AbstractCollection { + abstract static class AbstractImmutableCollection extends AbstractCollection { // all mutating methods throw UnsupportedOperationException @Override public boolean add(E e) { throw uoe(); } @Override public boolean addAll(Collection c) { throw uoe(); } @@ -249,7 +249,7 @@ class ImmutableCollections { // ---------- List Implementations ---------- @jdk.internal.ValueBased - static abstract class AbstractImmutableList extends AbstractImmutableCollection + abstract static class AbstractImmutableList extends AbstractImmutableCollection implements List, RandomAccess { // all mutating methods throw UnsupportedOperationException @@ -742,7 +742,7 @@ class ImmutableCollections { // ---------- Set Implementations ---------- @jdk.internal.ValueBased - static abstract class AbstractImmutableSet extends AbstractImmutableCollection + abstract static class AbstractImmutableSet extends AbstractImmutableCollection implements Set { @Override diff --git a/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java b/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java index 74dae2089a0..1738696f75a 100644 --- a/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java +++ b/src/java.base/share/classes/jdk/internal/icu/util/CodePointTrie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -624,7 +624,7 @@ public abstract class CodePointTrie extends CodePointMap { static final int NO_INDEX3_NULL_OFFSET = 0x7fff; static final int NO_DATA_NULL_OFFSET = 0xfffff; - private static abstract class Data { + private abstract static class Data { abstract ValueWidth getValueWidth(); abstract int getDataLength(); abstract int getFromIndex(int index); @@ -768,7 +768,7 @@ public abstract class CodePointTrie extends CodePointMap { * * @stable ICU 63 */ - public static abstract class Fast extends CodePointTrie { + public abstract static class Fast extends CodePointTrie { private Fast(char[] index, Data data, int highStart, int index3NullOffset, int dataNullOffset) { super(index, data, highStart, index3NullOffset, dataNullOffset); @@ -906,7 +906,7 @@ public abstract class CodePointTrie extends CodePointMap { * * @stable ICU 63 */ - public static abstract class Small extends CodePointTrie { + public abstract static class Small extends CodePointTrie { private Small(char[] index, Data data, int highStart, int index3NullOffset, int dataNullOffset) { super(index, data, highStart, index3NullOffset, dataNullOffset); diff --git a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java index 75cf8780bd1..7796512a715 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java +++ b/src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java @@ -61,11 +61,11 @@ public class BasicImageReader implements AutoCloseable { }); } - static private final boolean IS_64_BIT = + private static final boolean IS_64_BIT = isSystemProperty("sun.arch.data.model", "64", "32"); - static private final boolean USE_JVM_MAP = + private static final boolean USE_JVM_MAP = isSystemProperty("jdk.image.use.jvm.map", "true", "true"); - static private final boolean MAP_ALL = + private static final boolean MAP_ALL = isSystemProperty("jdk.image.map.all", "true", IS_64_BIT ? "true" : "false"); private final Path imagePath; diff --git a/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java b/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java index cb22cbf4a03..8d228c050c6 100644 --- a/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java +++ b/src/java.base/share/classes/jdk/internal/jimage/NativeImageBuffer.java @@ -45,5 +45,5 @@ class NativeImageBuffer { }); } - native static ByteBuffer getNativeMap(String imagePath); + static native ByteBuffer getNativeMap(String imagePath); } diff --git a/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java b/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java index 769e8d2a1b6..317e475d1a8 100644 --- a/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java +++ b/src/java.base/share/classes/jdk/internal/logger/SimpleConsoleLogger.java @@ -437,7 +437,7 @@ public class SimpleConsoleLogger extends LoggerConfiguration getSimpleFormat(DEFAULT_FORMAT_PROP_KEY, null); // Make it easier to wrap Logger... - static private final String[] skips; + private static final String[] skips; static { String additionalPkgs = GetPropertyAction.privilegedGetProperty("jdk.logger.packages"); diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java index 7edc326bde2..346838b47d9 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java @@ -121,7 +121,7 @@ class ModuleReferences { * A base module reader that encapsulates machinery required to close the * module reader safely. */ - static abstract class SafeCloseModuleReader implements ModuleReader { + abstract static class SafeCloseModuleReader implements ModuleReader { // RW lock to support safe close private final ReadWriteLock lock = new ReentrantReadWriteLock(); diff --git a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java index a59206d0309..ec0bc767eb7 100644 --- a/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java @@ -888,7 +888,7 @@ public class FileChannelImpl // -- Memory-mapped buffers -- - private static abstract class Unmapper + private abstract static class Unmapper implements Runnable, UnmapperProxy { // may be required to close file diff --git a/src/java.base/share/classes/sun/security/jca/ProviderList.java b/src/java.base/share/classes/sun/security/jca/ProviderList.java index 90bb29e17f7..cf0bd736f9d 100644 --- a/src/java.base/share/classes/sun/security/jca/ProviderList.java +++ b/src/java.base/share/classes/sun/security/jca/ProviderList.java @@ -71,7 +71,7 @@ public final class ProviderList { static final ProviderList EMPTY = new ProviderList(PC0, true); // list of all jdk.security.provider.preferred entries - static private PreferredList preferredPropList = null; + private static PreferredList preferredPropList = null; // dummy provider object to use during initialization // used to avoid explicit null checks in various places diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java b/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java index 699a5db6367..efb3258a149 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java @@ -60,12 +60,12 @@ public final class RSAPrivateKeyImpl extends PKCS8Key implements RSAPrivateKey { private final BigInteger n; // modulus private final BigInteger d; // private exponent - private transient final KeyType type; + private final transient KeyType type; // optional parameters associated with this RSA key // specified in the encoding of its AlgorithmId. // must be null for "RSA" keys. - private transient final AlgorithmParameterSpec keyParams; + private final transient AlgorithmParameterSpec keyParams; /** * Construct a key from its components. Used by the diff --git a/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java b/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java index db68eb2b7d4..16481f80071 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2021, 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 @@ -550,7 +550,7 @@ enum SSLHandshake implements SSLConsumer, HandshakeProducer { /** * A (transparent) specification of handshake message. */ - static abstract class HandshakeMessage { + abstract static class HandshakeMessage { final HandshakeContext handshakeContext; HandshakeMessage(HandshakeContext handshakeContext) { -- GitLab From a316c06e03e06b86ceca376cf20dcb9c526905f5 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Wed, 3 Nov 2021 12:08:37 +0000 Subject: [PATCH 168/890] 8275730: Relax memory constraint on MultiThreadedRefCounter Reviewed-by: mgronlun, minqi --- src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp b/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp index d24da8fdd82..149047837b7 100644 --- a/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp +++ b/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp @@ -112,15 +112,15 @@ class MultiThreadedRefCounter { MultiThreadedRefCounter() : _refs(0) {} void inc() const { - Atomic::add(&_refs, 1); + Atomic::inc(&_refs, memory_order_relaxed); } bool dec() const { - return 0 == Atomic::add(&_refs, (-1)); + return 0 == Atomic::sub(&_refs, 1, memory_order_relaxed); } intptr_t current() const { - return _refs; + return Atomic::load(&_refs); } }; -- GitLab From be1ca2bd201170b0d280030a2aae4c8d1da9f4af Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 3 Nov 2021 12:39:15 +0000 Subject: [PATCH 169/890] 8276298: G1: Remove unused G1SegmentedArrayBufferList::add Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/g1SegmentedArray.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp index b3f6680b02a..7eb40719ce7 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp @@ -97,7 +97,6 @@ public: ~G1SegmentedArrayBufferList() { free_all(); } void bulk_add(G1SegmentedArrayBuffer& first, G1SegmentedArrayBuffer& last, size_t num, size_t mem_size); - void add(G1SegmentedArrayBuffer& elem) { _list.prepend(elem); } G1SegmentedArrayBuffer* get(); G1SegmentedArrayBuffer* get_all(size_t& num_buffers, size_t& mem_size); -- GitLab From 87318460012d3fa1a8d3e8749d7a20328b27b826 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 3 Nov 2021 15:02:20 +0000 Subject: [PATCH 170/890] 8276556: ProblemList java/nio/channels/FileChannel/LargeGatheringWrite.java on windows-x64 Reviewed-by: alanb --- test/jdk/ProblemList.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 30b2416eccb..5ef10cbdf33 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -608,6 +608,8 @@ java/nio/channels/DatagramChannel/Unref.java 8233519 generic- java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64 +java/nio/channels/FileChannel/LargeGatheringWrite.java 8276199 windows-x64 + ############################################################################ # jdk_rmi -- GitLab From 61cb4bc6b0252536364a86f38ff2e5c8c7ab610b Mon Sep 17 00:00:00 2001 From: Tobias Holenstein Date: Wed, 3 Nov 2021 15:31:50 +0000 Subject: [PATCH 171/890] 8276036: The value of full_count in the message of insufficient codecache is wrong Reviewed-by: kvn, dlong, thartmann, chagedorn --- src/hotspot/share/code/codeCache.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 71c015cad5b..2b89fa89f32 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -1226,7 +1226,9 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) { CodeHeap* heap = get_code_heap(code_blob_type); assert(heap != NULL, "heap is null"); - if ((heap->full_count() == 0) || print) { + heap->report_full(); + + if ((heap->full_count() == 1) || print) { // Not yet reported for this heap, report if (SegmentedCodeCache) { ResourceMark rm; @@ -1263,15 +1265,13 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) { tty->print("%s", s.as_string()); } - if (heap->full_count() == 0) { + if (heap->full_count() == 1) { if (PrintCodeHeapAnalytics) { CompileBroker::print_heapinfo(tty, "all", 4096); // details, may be a lot! } } } - heap->report_full(); - EventCodeCacheFull event; if (event.should_commit()) { event.set_codeBlobType((u1)code_blob_type); -- GitLab From 724bf3be1458f7da502f8772be6151bed826b4f7 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 3 Nov 2021 15:41:26 +0000 Subject: [PATCH 172/890] 8275604: Zero: Reformat opclabels_data Reviewed-by: adinn, zgu --- .../interpreter/zero/bytecodeInterpreter.cpp | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index 1ec6762be5e..59c1aaf311d 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -447,86 +447,86 @@ void BytecodeInterpreter::run(interpreterState istate) { #ifdef USELABELS const static void* const opclabels_data[256] = { -/* 0x00 */ &&opc_nop, &&opc_aconst_null,&&opc_iconst_m1,&&opc_iconst_0, -/* 0x04 */ &&opc_iconst_1,&&opc_iconst_2, &&opc_iconst_3, &&opc_iconst_4, -/* 0x08 */ &&opc_iconst_5,&&opc_lconst_0, &&opc_lconst_1, &&opc_fconst_0, -/* 0x0C */ &&opc_fconst_1,&&opc_fconst_2, &&opc_dconst_0, &&opc_dconst_1, - -/* 0x10 */ &&opc_bipush, &&opc_sipush, &&opc_ldc, &&opc_ldc_w, -/* 0x14 */ &&opc_ldc2_w, &&opc_iload, &&opc_lload, &&opc_fload, -/* 0x18 */ &&opc_dload, &&opc_aload, &&opc_iload_0,&&opc_iload_1, -/* 0x1C */ &&opc_iload_2,&&opc_iload_3,&&opc_lload_0,&&opc_lload_1, - -/* 0x20 */ &&opc_lload_2,&&opc_lload_3,&&opc_fload_0,&&opc_fload_1, -/* 0x24 */ &&opc_fload_2,&&opc_fload_3,&&opc_dload_0,&&opc_dload_1, -/* 0x28 */ &&opc_dload_2,&&opc_dload_3,&&opc_aload_0,&&opc_aload_1, -/* 0x2C */ &&opc_aload_2,&&opc_aload_3,&&opc_iaload, &&opc_laload, - -/* 0x30 */ &&opc_faload, &&opc_daload, &&opc_aaload, &&opc_baload, -/* 0x34 */ &&opc_caload, &&opc_saload, &&opc_istore, &&opc_lstore, -/* 0x38 */ &&opc_fstore, &&opc_dstore, &&opc_astore, &&opc_istore_0, -/* 0x3C */ &&opc_istore_1,&&opc_istore_2,&&opc_istore_3,&&opc_lstore_0, - -/* 0x40 */ &&opc_lstore_1,&&opc_lstore_2,&&opc_lstore_3,&&opc_fstore_0, -/* 0x44 */ &&opc_fstore_1,&&opc_fstore_2,&&opc_fstore_3,&&opc_dstore_0, -/* 0x48 */ &&opc_dstore_1,&&opc_dstore_2,&&opc_dstore_3,&&opc_astore_0, -/* 0x4C */ &&opc_astore_1,&&opc_astore_2,&&opc_astore_3,&&opc_iastore, - -/* 0x50 */ &&opc_lastore,&&opc_fastore,&&opc_dastore,&&opc_aastore, -/* 0x54 */ &&opc_bastore,&&opc_castore,&&opc_sastore,&&opc_pop, -/* 0x58 */ &&opc_pop2, &&opc_dup, &&opc_dup_x1, &&opc_dup_x2, -/* 0x5C */ &&opc_dup2, &&opc_dup2_x1,&&opc_dup2_x2,&&opc_swap, - -/* 0x60 */ &&opc_iadd,&&opc_ladd,&&opc_fadd,&&opc_dadd, -/* 0x64 */ &&opc_isub,&&opc_lsub,&&opc_fsub,&&opc_dsub, -/* 0x68 */ &&opc_imul,&&opc_lmul,&&opc_fmul,&&opc_dmul, -/* 0x6C */ &&opc_idiv,&&opc_ldiv,&&opc_fdiv,&&opc_ddiv, - -/* 0x70 */ &&opc_irem, &&opc_lrem, &&opc_frem,&&opc_drem, -/* 0x74 */ &&opc_ineg, &&opc_lneg, &&opc_fneg,&&opc_dneg, -/* 0x78 */ &&opc_ishl, &&opc_lshl, &&opc_ishr,&&opc_lshr, -/* 0x7C */ &&opc_iushr,&&opc_lushr,&&opc_iand,&&opc_land, - -/* 0x80 */ &&opc_ior, &&opc_lor,&&opc_ixor,&&opc_lxor, -/* 0x84 */ &&opc_iinc,&&opc_i2l,&&opc_i2f, &&opc_i2d, -/* 0x88 */ &&opc_l2i, &&opc_l2f,&&opc_l2d, &&opc_f2i, -/* 0x8C */ &&opc_f2l, &&opc_f2d,&&opc_d2i, &&opc_d2l, - -/* 0x90 */ &&opc_d2f, &&opc_i2b, &&opc_i2c, &&opc_i2s, -/* 0x94 */ &&opc_lcmp, &&opc_fcmpl,&&opc_fcmpg,&&opc_dcmpl, -/* 0x98 */ &&opc_dcmpg,&&opc_ifeq, &&opc_ifne, &&opc_iflt, -/* 0x9C */ &&opc_ifge, &&opc_ifgt, &&opc_ifle, &&opc_if_icmpeq, - -/* 0xA0 */ &&opc_if_icmpne,&&opc_if_icmplt,&&opc_if_icmpge, &&opc_if_icmpgt, -/* 0xA4 */ &&opc_if_icmple,&&opc_if_acmpeq,&&opc_if_acmpne, &&opc_goto, -/* 0xA8 */ &&opc_jsr, &&opc_ret, &&opc_tableswitch,&&opc_lookupswitch, -/* 0xAC */ &&opc_ireturn, &&opc_lreturn, &&opc_freturn, &&opc_dreturn, - -/* 0xB0 */ &&opc_areturn, &&opc_return, &&opc_getstatic, &&opc_putstatic, -/* 0xB4 */ &&opc_getfield, &&opc_putfield, &&opc_invokevirtual,&&opc_invokespecial, -/* 0xB8 */ &&opc_invokestatic,&&opc_invokeinterface,&&opc_invokedynamic,&&opc_new, -/* 0xBC */ &&opc_newarray, &&opc_anewarray, &&opc_arraylength, &&opc_athrow, - -/* 0xC0 */ &&opc_checkcast, &&opc_instanceof, &&opc_monitorenter, &&opc_monitorexit, -/* 0xC4 */ &&opc_wide, &&opc_multianewarray, &&opc_ifnull, &&opc_ifnonnull, -/* 0xC8 */ &&opc_goto_w, &&opc_jsr_w, &&opc_breakpoint, &&opc_default, -/* 0xCC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, - -/* 0xD0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xD4 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xD8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xDC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, - -/* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xE4 */ &&opc_default, &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, +/* 0x00 */ &&opc_nop, &&opc_aconst_null, &&opc_iconst_m1, &&opc_iconst_0, +/* 0x04 */ &&opc_iconst_1, &&opc_iconst_2, &&opc_iconst_3, &&opc_iconst_4, +/* 0x08 */ &&opc_iconst_5, &&opc_lconst_0, &&opc_lconst_1, &&opc_fconst_0, +/* 0x0C */ &&opc_fconst_1, &&opc_fconst_2, &&opc_dconst_0, &&opc_dconst_1, + +/* 0x10 */ &&opc_bipush, &&opc_sipush, &&opc_ldc, &&opc_ldc_w, +/* 0x14 */ &&opc_ldc2_w, &&opc_iload, &&opc_lload, &&opc_fload, +/* 0x18 */ &&opc_dload, &&opc_aload, &&opc_iload_0, &&opc_iload_1, +/* 0x1C */ &&opc_iload_2, &&opc_iload_3, &&opc_lload_0, &&opc_lload_1, + +/* 0x20 */ &&opc_lload_2, &&opc_lload_3, &&opc_fload_0, &&opc_fload_1, +/* 0x24 */ &&opc_fload_2, &&opc_fload_3, &&opc_dload_0, &&opc_dload_1, +/* 0x28 */ &&opc_dload_2, &&opc_dload_3, &&opc_aload_0, &&opc_aload_1, +/* 0x2C */ &&opc_aload_2, &&opc_aload_3, &&opc_iaload, &&opc_laload, + +/* 0x30 */ &&opc_faload, &&opc_daload, &&opc_aaload, &&opc_baload, +/* 0x34 */ &&opc_caload, &&opc_saload, &&opc_istore, &&opc_lstore, +/* 0x38 */ &&opc_fstore, &&opc_dstore, &&opc_astore, &&opc_istore_0, +/* 0x3C */ &&opc_istore_1, &&opc_istore_2, &&opc_istore_3, &&opc_lstore_0, + +/* 0x40 */ &&opc_lstore_1, &&opc_lstore_2, &&opc_lstore_3, &&opc_fstore_0, +/* 0x44 */ &&opc_fstore_1, &&opc_fstore_2, &&opc_fstore_3, &&opc_dstore_0, +/* 0x48 */ &&opc_dstore_1, &&opc_dstore_2, &&opc_dstore_3, &&opc_astore_0, +/* 0x4C */ &&opc_astore_1, &&opc_astore_2, &&opc_astore_3, &&opc_iastore, + +/* 0x50 */ &&opc_lastore, &&opc_fastore, &&opc_dastore, &&opc_aastore, +/* 0x54 */ &&opc_bastore, &&opc_castore, &&opc_sastore, &&opc_pop, +/* 0x58 */ &&opc_pop2, &&opc_dup, &&opc_dup_x1, &&opc_dup_x2, +/* 0x5C */ &&opc_dup2, &&opc_dup2_x1, &&opc_dup2_x2, &&opc_swap, + +/* 0x60 */ &&opc_iadd, &&opc_ladd, &&opc_fadd, &&opc_dadd, +/* 0x64 */ &&opc_isub, &&opc_lsub, &&opc_fsub, &&opc_dsub, +/* 0x68 */ &&opc_imul, &&opc_lmul, &&opc_fmul, &&opc_dmul, +/* 0x6C */ &&opc_idiv, &&opc_ldiv, &&opc_fdiv, &&opc_ddiv, + +/* 0x70 */ &&opc_irem, &&opc_lrem, &&opc_frem, &&opc_drem, +/* 0x74 */ &&opc_ineg, &&opc_lneg, &&opc_fneg, &&opc_dneg, +/* 0x78 */ &&opc_ishl, &&opc_lshl, &&opc_ishr, &&opc_lshr, +/* 0x7C */ &&opc_iushr, &&opc_lushr, &&opc_iand, &&opc_land, + +/* 0x80 */ &&opc_ior, &&opc_lor, &&opc_ixor, &&opc_lxor, +/* 0x84 */ &&opc_iinc, &&opc_i2l, &&opc_i2f, &&opc_i2d, +/* 0x88 */ &&opc_l2i, &&opc_l2f, &&opc_l2d, &&opc_f2i, +/* 0x8C */ &&opc_f2l, &&opc_f2d, &&opc_d2i, &&opc_d2l, + +/* 0x90 */ &&opc_d2f, &&opc_i2b, &&opc_i2c, &&opc_i2s, +/* 0x94 */ &&opc_lcmp, &&opc_fcmpl, &&opc_fcmpg, &&opc_dcmpl, +/* 0x98 */ &&opc_dcmpg, &&opc_ifeq, &&opc_ifne, &&opc_iflt, +/* 0x9C */ &&opc_ifge, &&opc_ifgt, &&opc_ifle, &&opc_if_icmpeq, + +/* 0xA0 */ &&opc_if_icmpne, &&opc_if_icmplt, &&opc_if_icmpge, &&opc_if_icmpgt, +/* 0xA4 */ &&opc_if_icmple, &&opc_if_acmpeq, &&opc_if_acmpne, &&opc_goto, +/* 0xA8 */ &&opc_jsr, &&opc_ret, &&opc_tableswitch, &&opc_lookupswitch, +/* 0xAC */ &&opc_ireturn, &&opc_lreturn, &&opc_freturn, &&opc_dreturn, + +/* 0xB0 */ &&opc_areturn, &&opc_return, &&opc_getstatic, &&opc_putstatic, +/* 0xB4 */ &&opc_getfield, &&opc_putfield, &&opc_invokevirtual, &&opc_invokespecial, +/* 0xB8 */ &&opc_invokestatic, &&opc_invokeinterface, &&opc_invokedynamic, &&opc_new, +/* 0xBC */ &&opc_newarray, &&opc_anewarray, &&opc_arraylength, &&opc_athrow, + +/* 0xC0 */ &&opc_checkcast, &&opc_instanceof, &&opc_monitorenter, &&opc_monitorexit, +/* 0xC4 */ &&opc_wide, &&opc_multianewarray, &&opc_ifnull, &&opc_ifnonnull, +/* 0xC8 */ &&opc_goto_w, &&opc_jsr_w, &&opc_breakpoint, &&opc_default, +/* 0xCC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + +/* 0xD0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xD4 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xD8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xDC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + +/* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xE4 */ &&opc_default, &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, /* 0xE8 */ &&opc_return_register_finalizer, - &&opc_invokehandle, &&opc_default, &&opc_default, -/* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, + &&opc_invokehandle, &&opc_default, &&opc_default, +/* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xF4 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xF8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xFC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default +/* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xF4 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xF8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xFC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default }; uintptr_t *dispatch_table = (uintptr_t*)&opclabels_data[0]; #endif /* USELABELS */ -- GitLab From 0ef8cbe32540814d4c0be9c7b0f78486408657a7 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 3 Nov 2021 16:22:42 +0000 Subject: [PATCH 173/890] 8276385: Re-run blessed-modifier-order script on java.desktop and jdk.accessibility Reviewed-by: serb --- .../plugins/tiff/BaselineTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/ExifGPSTagSet.java | 2 +- .../tiff/ExifInteroperabilityTagSet.java | 2 +- .../plugins/tiff/ExifParentTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/ExifTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/FaxTIFFTagSet.java | 2 +- .../imageio/plugins/tiff/GeoTIFFTagSet.java | 2 +- .../sun/java2d/cmm/lcms/LCMSTransform.java | 2 +- .../sun/java2d/loops/DrawGlyphListColor.java | 4 +- .../sun/awt/shell/Win32ShellFolder2.java | 2 +- .../accessibility/util/AWTEventMonitor.java | 74 +++++++++--------- .../util/AccessibilityEventMonitor.java | 8 +- .../util/AccessibilityListenerList.java | 2 +- .../sun/java/accessibility/util/EventID.java | 58 +++++++------- .../accessibility/util/EventQueueMonitor.java | 20 ++--- .../accessibility/util/SwingEventMonitor.java | 76 +++++++++---------- .../accessibility/internal/AccessBridge.java | 10 +-- 17 files changed, 135 insertions(+), 135 deletions(-) diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java index 0932b4c2c89..340fe2aee77 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/BaselineTIFFTagSet.java @@ -2173,7 +2173,7 @@ public final class BaselineTIFFTagSet extends TIFFTagSet { * * @return a {@code BaselineTIFFTagSet} instance. */ - public synchronized static BaselineTIFFTagSet getInstance() { + public static synchronized BaselineTIFFTagSet getInstance() { if (theInstance == null) { initTags(); theInstance = new BaselineTIFFTagSet(); diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java index 9b67e609fc3..503ad4b6d68 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java @@ -713,7 +713,7 @@ public final class ExifGPSTagSet extends TIFFTagSet { * * @return an {@code ExifGPSTagSet} instance. */ - public synchronized static ExifGPSTagSet getInstance() { + public static synchronized ExifGPSTagSet getInstance() { if (theInstance == null) { theInstance = new ExifGPSTagSet(); } diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java index 140b66779bd..ab9c85c81e4 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifInteroperabilityTagSet.java @@ -92,7 +92,7 @@ public final class ExifInteroperabilityTagSet extends TIFFTagSet { * * @return the {@code ExifInteroperabilityTagSet} instance. */ - public synchronized static ExifInteroperabilityTagSet getInstance() { + public static synchronized ExifInteroperabilityTagSet getInstance() { if (theInstance == null) { initTags(); theInstance = new ExifInteroperabilityTagSet(); diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java index 194416b4a81..3a546b417ba 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifParentTIFFTagSet.java @@ -84,7 +84,7 @@ public final class ExifParentTIFFTagSet extends TIFFTagSet { * * @return an {@code ExifParentTIFFTagSet} instance. */ - public synchronized static ExifParentTIFFTagSet getInstance() { + public static synchronized ExifParentTIFFTagSet getInstance() { if (theInstance == null) { initTags(); theInstance = new ExifParentTIFFTagSet(); diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java index 3b274b8d978..443465ec59c 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java @@ -1992,7 +1992,7 @@ public final class ExifTIFFTagSet extends TIFFTagSet { * * @return an {@code ExifTIFFTagSet} instance. */ - public synchronized static ExifTIFFTagSet getInstance() { + public static synchronized ExifTIFFTagSet getInstance() { if (theInstance == null) { initTags(); theInstance = new ExifTIFFTagSet(); diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java index 07888435588..f31663bfa63 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/FaxTIFFTagSet.java @@ -135,7 +135,7 @@ public final class FaxTIFFTagSet extends TIFFTagSet { * * @return a {@code FaxTIFFTagSet} instance. */ - public synchronized static FaxTIFFTagSet getInstance() { + public static synchronized FaxTIFFTagSet getInstance() { if (theInstance == null) { initTags(); theInstance = new FaxTIFFTagSet(); diff --git a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java index 18962ed3816..214a17df6e2 100644 --- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java +++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/GeoTIFFTagSet.java @@ -138,7 +138,7 @@ public final class GeoTIFFTagSet extends TIFFTagSet { * * @return a {@code GeoTIFFTagSet} instance. */ - public synchronized static GeoTIFFTagSet getInstance() { + public static synchronized GeoTIFFTagSet getInstance() { if (theInstance == null) { initTags(); theInstance = new GeoTIFFTagSet(); diff --git a/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java b/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java index 8198932bacd..939a583977e 100644 --- a/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java +++ b/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java @@ -52,7 +52,7 @@ import static sun.java2d.cmm.lcms.LCMSImageLayout.ImageLayoutException; final class LCMSTransform implements ColorTransform { - private final static class NativeTransform { + private static final class NativeTransform { private long ID; private int inFormatter; private boolean isInIntPacked; diff --git a/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListColor.java b/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListColor.java index 0950e799dd3..55ceaf4ce4e 100644 --- a/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListColor.java +++ b/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListColor.java @@ -37,10 +37,10 @@ import java.awt.*; */ public class DrawGlyphListColor extends GraphicsPrimitive { - public final static String methodSignature = + public static final String methodSignature = "DrawGlyphListColor(...)".toString(); - public final static int primTypeID = makePrimTypeID(); + public static final int primTypeID = makePrimTypeID(); public static DrawGlyphListColor locate(SurfaceType srctype, CompositeType comptype, diff --git a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java index 0f8ae20454f..f08f5337e2e 100644 --- a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java +++ b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java @@ -85,7 +85,7 @@ final class Win32ShellFolder2 extends ShellFolder { static final int LARGE_ICON_SIZE = 32; static final int MIN_QUALITY_ICON = 16; static final int MAX_QUALITY_ICON = 256; - private final static int[] ICON_RESOLUTIONS + private static final int[] ICON_RESOLUTIONS = {16, 24, 32, 48, 64, 72, 96, 128, 256}; static final int FILE_ICON_ID = 1; diff --git a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java index 2f6cdbbb2d3..b1b93d795e4 100644 --- a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java +++ b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java @@ -50,22 +50,22 @@ public class AWTEventMonitor { */ public AWTEventMonitor() {} - static private Component componentWithFocus = null; + private static Component componentWithFocus = null; // Low-level listeners - static private ComponentListener componentListener = null; - static private ContainerListener containerListener = null; - static private FocusListener focusListener = null; - static private KeyListener keyListener = null; - static private MouseListener mouseListener = null; - static private MouseMotionListener mouseMotionListener = null; - static private WindowListener windowListener = null; + private static ComponentListener componentListener = null; + private static ContainerListener containerListener = null; + private static FocusListener focusListener = null; + private static KeyListener keyListener = null; + private static MouseListener mouseListener = null; + private static MouseMotionListener mouseMotionListener = null; + private static WindowListener windowListener = null; // Semantic listeners - static private ActionListener actionListener = null; - static private AdjustmentListener adjustmentListener = null; - static private ItemListener itemListener = null; - static private TextListener textListener = null; + private static ActionListener actionListener = null; + private static AdjustmentListener adjustmentListener = null; + private static ItemListener itemListener = null; + private static TextListener textListener = null; /** * The actual listener that is installed on the component instances. @@ -73,7 +73,7 @@ public class AWTEventMonitor { * occurs. By doing things this way, the actual number of listeners * installed on a component instance is drastically reduced. */ - static private final AWTEventsListener awtListener = new AWTEventsListener(); + private static final AWTEventsListener awtListener = new AWTEventsListener(); /** * Returns the component that currently has keyboard focus. The return @@ -81,14 +81,14 @@ public class AWTEventMonitor { * * @return the component that has keyboard focus */ - static public Component getComponentWithFocus() { + public static Component getComponentWithFocus() { return componentWithFocus; } /* * Check permissions */ - static private void checkInstallPermission() { + private static void checkInstallPermission() { @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); if (security != null) { @@ -106,7 +106,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeComponentListener */ - static public void addComponentListener(ComponentListener l) { + public static void addComponentListener(ComponentListener l) { if (componentListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.COMPONENT); @@ -121,7 +121,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addComponentListener */ - static public void removeComponentListener(ComponentListener l) { + public static void removeComponentListener(ComponentListener l) { componentListener = AWTEventMulticaster.remove(componentListener, l); if (componentListener == null) { awtListener.removeListeners(EventID.COMPONENT); @@ -138,7 +138,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeContainerListener */ - static public void addContainerListener(ContainerListener l) { + public static void addContainerListener(ContainerListener l) { containerListener = AWTEventMulticaster.add(containerListener, l); } @@ -149,7 +149,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addContainerListener */ - static public void removeContainerListener(ContainerListener l) { + public static void removeContainerListener(ContainerListener l) { containerListener = AWTEventMulticaster.remove(containerListener, l); } @@ -163,7 +163,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeFocusListener */ - static public void addFocusListener(FocusListener l) { + public static void addFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.add(focusListener, l); } @@ -174,7 +174,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addFocusListener */ - static public void removeFocusListener(FocusListener l) { + public static void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); } @@ -188,7 +188,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeKeyListener */ - static public void addKeyListener(KeyListener l) { + public static void addKeyListener(KeyListener l) { if (keyListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.KEY); @@ -203,7 +203,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addKeyListener */ - static public void removeKeyListener(KeyListener l) { + public static void removeKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.remove(keyListener, l); if (keyListener == null) { awtListener.removeListeners(EventID.KEY); @@ -220,7 +220,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeMouseListener */ - static public void addMouseListener(MouseListener l) { + public static void addMouseListener(MouseListener l) { if (mouseListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.MOUSE); @@ -235,7 +235,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addMouseListener */ - static public void removeMouseListener(MouseListener l) { + public static void removeMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.remove(mouseListener, l); if (mouseListener == null) { awtListener.removeListeners(EventID.MOUSE); @@ -252,7 +252,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeMouseMotionListener */ - static public void addMouseMotionListener(MouseMotionListener l) { + public static void addMouseMotionListener(MouseMotionListener l) { if (mouseMotionListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.MOTION); @@ -267,7 +267,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addMouseMotionListener */ - static public void removeMouseMotionListener(MouseMotionListener l) { + public static void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); if (mouseMotionListener == null) { awtListener.removeListeners(EventID.MOTION); @@ -284,7 +284,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeWindowListener */ - static public void addWindowListener(WindowListener l) { + public static void addWindowListener(WindowListener l) { if (windowListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.WINDOW); @@ -299,7 +299,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addWindowListener */ - static public void removeWindowListener(WindowListener l) { + public static void removeWindowListener(WindowListener l) { windowListener = AWTEventMulticaster.remove(windowListener, l); if (windowListener == null) { awtListener.removeListeners(EventID.WINDOW); @@ -316,7 +316,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeActionListener */ - static public void addActionListener(ActionListener l) { + public static void addActionListener(ActionListener l) { if (actionListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.ACTION); @@ -331,7 +331,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addActionListener */ - static public void removeActionListener(ActionListener l) { + public static void removeActionListener(ActionListener l) { actionListener = AWTEventMulticaster.remove(actionListener, l); if (actionListener == null) { awtListener.removeListeners(EventID.ACTION); @@ -349,7 +349,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeAdjustmentListener */ - static public void addAdjustmentListener(AdjustmentListener l) { + public static void addAdjustmentListener(AdjustmentListener l) { if (adjustmentListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.ADJUSTMENT); @@ -364,7 +364,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addAdjustmentListener */ - static public void removeAdjustmentListener(AdjustmentListener l) { + public static void removeAdjustmentListener(AdjustmentListener l) { adjustmentListener = AWTEventMulticaster.remove(adjustmentListener, l); if (adjustmentListener == null) { awtListener.removeListeners(EventID.ADJUSTMENT); @@ -381,7 +381,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeItemListener */ - static public void addItemListener(ItemListener l) { + public static void addItemListener(ItemListener l) { if (itemListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.ITEM); @@ -396,7 +396,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addItemListener */ - static public void removeItemListener(ItemListener l) { + public static void removeItemListener(ItemListener l) { itemListener = AWTEventMulticaster.remove(itemListener, l); if (itemListener == null) { awtListener.removeListeners(EventID.ITEM); @@ -413,7 +413,7 @@ public class AWTEventMonitor { * @param l the listener to add * @see #removeTextListener */ - static public void addTextListener(TextListener l) { + public static void addTextListener(TextListener l) { if (textListener == null) { checkInstallPermission(); awtListener.installListeners(EventID.TEXT); @@ -428,7 +428,7 @@ public class AWTEventMonitor { * @param l the listener to remove * @see #addTextListener */ - static public void removeTextListener(TextListener l) { + public static void removeTextListener(TextListener l) { textListener = AWTEventMulticaster.remove(textListener, l); if (textListener == null) { awtListener.removeListeners(EventID.TEXT); diff --git a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java index 79e0b4d2b09..a2ebac01279 100644 --- a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java +++ b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java @@ -56,7 +56,7 @@ public class AccessibilityEventMonitor { * @see #addPropertyChangeListener * @see #removePropertyChangeListener */ - static protected final AccessibilityListenerList listenerList = + protected static final AccessibilityListenerList listenerList = new AccessibilityListenerList(); @@ -66,7 +66,7 @@ public class AccessibilityEventMonitor { * occurs. By doing things this way, the actual number of listeners * installed on a component instance is drastically reduced. */ - static private final AccessibilityEventListener accessibilityListener = + private static final AccessibilityEventListener accessibilityListener = new AccessibilityEventListener(); /** @@ -80,7 +80,7 @@ public class AccessibilityEventMonitor { * * @see #removePropertyChangeListener */ - static public void addPropertyChangeListener(PropertyChangeListener l) { + public static void addPropertyChangeListener(PropertyChangeListener l) { if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) { accessibilityListener.installListeners(); } @@ -93,7 +93,7 @@ public class AccessibilityEventMonitor { * @see #addPropertyChangeListener * @param l the listener to remove */ - static public void removePropertyChangeListener(PropertyChangeListener l) { + public static void removePropertyChangeListener(PropertyChangeListener l) { listenerList.remove(PropertyChangeListener.class, l); if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) { accessibilityListener.removeListeners(); diff --git a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java index 62133dc6773..6329ef95301 100644 --- a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java +++ b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java @@ -39,7 +39,7 @@ import javax.accessibility.*; public class AccessibilityListenerList { /* A null array to be shared by all empty listener lists */ - private final static Object[] NULL_ARRAY = new Object[0]; + private static final Object[] NULL_ARRAY = new Object[0]; /** * The list of listener type, listener pairs diff --git a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java index 4fbf8ee508a..19ca5f82265 100644 --- a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java +++ b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java @@ -45,166 +45,166 @@ public class EventID { /** * Maps to AWT Action support (i.e., ActionListener and ActionEvent) */ - static public final int ACTION = 0; + public static final int ACTION = 0; /** * Maps to AWT Adjustment support (i.e., AdjustmentListener * and AdjustmentEvent) */ - static public final int ADJUSTMENT = 1; + public static final int ADJUSTMENT = 1; /** * Maps to AWT Component support (i.e., ComponentListener * and ComponentEvent) */ - static public final int COMPONENT = 2; + public static final int COMPONENT = 2; /** * Maps to AWT Container support (i.e., ContainerListener * and ContainerEvent) */ - static public final int CONTAINER = 3; + public static final int CONTAINER = 3; /** * Maps to AWT Focus support (i.e., FocusListener and FocusEvent) */ - static public final int FOCUS = 4; + public static final int FOCUS = 4; /** * Maps to AWT Item support (i.e., ItemListener and ItemEvent) */ - static public final int ITEM = 5; + public static final int ITEM = 5; /** * Maps to AWT Key support (i.e., KeyListener and KeyEvent) */ - static public final int KEY = 6; + public static final int KEY = 6; /** * Maps to AWT Mouse support (i.e., MouseListener and MouseEvent) */ - static public final int MOUSE = 7; + public static final int MOUSE = 7; /** * Maps to AWT MouseMotion support (i.e., MouseMotionListener * and MouseMotionEvent) */ - static public final int MOTION = 8; + public static final int MOTION = 8; /** * Maps to AWT Text support (i.e., TextListener and TextEvent) */ - static public final int TEXT = 10; + public static final int TEXT = 10; /** * Maps to AWT Window support (i.e., WindowListener and WindowEvent) */ - static public final int WINDOW = 11; + public static final int WINDOW = 11; /** * Maps to Swing Ancestor support (i.e., AncestorListener and * AncestorEvent) */ - static public final int ANCESTOR = 12; + public static final int ANCESTOR = 12; /** * Maps to Swing Text Caret support (i.e., CaretListener and * CaretEvent) */ - static public final int CARET = 13; + public static final int CARET = 13; /** * Maps to Swing CellEditor support (i.e., CellEditorListener and * CellEditorEvent) */ - static public final int CELLEDITOR = 14; + public static final int CELLEDITOR = 14; /** * Maps to Swing Change support (i.e., ChangeListener and * ChangeEvent) */ - static public final int CHANGE = 15; + public static final int CHANGE = 15; /** * Maps to Swing TableColumnModel support (i.e., * TableColumnModelListener and TableColumnModelEvent) */ - static public final int COLUMNMODEL = 16; + public static final int COLUMNMODEL = 16; /** * Maps to Swing Document support (i.e., DocumentListener and * DocumentEvent) */ - static public final int DOCUMENT = 17; + public static final int DOCUMENT = 17; /** * Maps to Swing ListData support (i.e., ListDataListener and * ListDataEvent) */ - static public final int LISTDATA = 18; + public static final int LISTDATA = 18; /** * Maps to Swing ListSelection support (i.e., ListSelectionListener and * ListSelectionEvent) */ - static public final int LISTSELECTION = 19; + public static final int LISTSELECTION = 19; /** * Maps to Swing Menu support (i.e., MenuListener and * MenuEvent) */ - static public final int MENU = 20; + public static final int MENU = 20; /** * Maps to Swing PopupMenu support (i.e., PopupMenuListener and * PopupMenuEvent) */ - static public final int POPUPMENU = 21; + public static final int POPUPMENU = 21; /** * Maps to Swing TableModel support (i.e., TableModelListener and * TableModelEvent) */ - static public final int TABLEMODEL = 22; + public static final int TABLEMODEL = 22; /** * Maps to Swing TreeExpansion support (i.e., TreeExpansionListener and * TreeExpansionEvent) */ - static public final int TREEEXPANSION = 23; + public static final int TREEEXPANSION = 23; /** * Maps to Swing TreeModel support (i.e., TreeModelListener and * TreeModelEvent) */ - static public final int TREEMODEL = 24; + public static final int TREEMODEL = 24; /** * Maps to Swing TreeSelection support (i.e., TreeSelectionListener and * TreeSelectionEvent) */ - static public final int TREESELECTION = 25; + public static final int TREESELECTION = 25; /** * Maps to Swing UndoableEdit support (i.e., UndoableEditListener and * UndoableEditEvent) */ - static public final int UNDOABLEEDIT = 26; + public static final int UNDOABLEEDIT = 26; /** * Maps to Beans PropertyChange support (i.e., PropertyChangeListener * and PropertyChangeEvent) */ - static public final int PROPERTYCHANGE = 27; + public static final int PROPERTYCHANGE = 27; /** * Maps to Beans VetoableChange support (i.e., VetoableChangeListener * and VetoableChangeEvent) */ - static public final int VETOABLECHANGE = 28; + public static final int VETOABLECHANGE = 28; /** * Maps to Swing InternalFrame support (i.e., InternalFrameListener) */ - static public final int INTERNALFRAME = 29; + public static final int INTERNALFRAME = 29; } diff --git a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java index 6f06ceb742b..cb630223c49 100644 --- a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java +++ b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java @@ -86,7 +86,7 @@ public class EventQueueMonitor /** * Class that tells us what the component event dispatch thread is. */ - static private ComponentEvtDispatchThread cedt = null; + private static ComponentEvtDispatchThread cedt = null; /** * Handle the synchronization between the thing that populates the @@ -397,7 +397,7 @@ public class EventQueueMonitor * @param p the point to be accessed * @return the {@code Accessible} at the specified point */ - static public Accessible getAccessibleAt(Point p) { + public static Accessible getAccessibleAt(Point p) { Window w = getTopLevelWindowWithFocus(); Window[] wins = getTopLevelWindows(); Component c = null; @@ -464,7 +464,7 @@ public class EventQueueMonitor * @return true if the GUI subsystem has been initialized * @see #addGUIInitializedListener */ - static public boolean isGUIInitialized() { + public static boolean isGUIInitialized() { maybeInitialize(); return guiInitialized; } @@ -478,7 +478,7 @@ public class EventQueueMonitor * @see #isGUIInitialized * @see #removeTopLevelWindowListener */ - static public void addGUIInitializedListener(GUIInitializedListener l) { + public static void addGUIInitializedListener(GUIInitializedListener l) { maybeInitialize(); guiInitializedListener = GUIInitializedMulticaster.add(guiInitializedListener,l); @@ -491,7 +491,7 @@ public class EventQueueMonitor * @param l the listener to remove * @see #addGUIInitializedListener */ - static public void removeGUIInitializedListener(GUIInitializedListener l) { + public static void removeGUIInitializedListener(GUIInitializedListener l) { guiInitializedListener = GUIInitializedMulticaster.remove(guiInitializedListener,l); } @@ -503,7 +503,7 @@ public class EventQueueMonitor * @param l the listener to add * @see #removeTopLevelWindowListener */ - static public void addTopLevelWindowListener(TopLevelWindowListener l) { + public static void addTopLevelWindowListener(TopLevelWindowListener l) { topLevelWindowListener = TopLevelWindowMulticaster.add(topLevelWindowListener,l); } @@ -515,7 +515,7 @@ public class EventQueueMonitor * @param l the listener to remove * @see #addTopLevelWindowListener */ - static public void removeTopLevelWindowListener(TopLevelWindowListener l) { + public static void removeTopLevelWindowListener(TopLevelWindowListener l) { topLevelWindowListener = TopLevelWindowMulticaster.remove(topLevelWindowListener,l); } @@ -525,7 +525,7 @@ public class EventQueueMonitor * * @return the last recorded position of the mouse in screen coordinates */ - static public Point getCurrentMousePosition() { + public static Point getCurrentMousePosition() { return currentMousePosition; } @@ -534,7 +534,7 @@ public class EventQueueMonitor * * @return an array of top level {@code Window}s in use in the Java Virtual Machine */ - static public Window[] getTopLevelWindows() { + public static Window[] getTopLevelWindows() { // Because this method is static, do not make it synchronized because // it can lock the whole class. Instead, just lock what needs to be @@ -559,7 +559,7 @@ public class EventQueueMonitor * * @return the top level {@code Window} that currently has keyboard focus */ - static public Window getTopLevelWindowWithFocus() { + public static Window getTopLevelWindowWithFocus() { return topLevelWindowWithFocus; } } diff --git a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java index d8d82970ef5..e70ed05e609 100644 --- a/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java +++ b/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java @@ -63,7 +63,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * This can only be publicly modified by calling the add or * remove listener methods in this class. */ - static protected final EventListenerList listenerList = new EventListenerList(); + protected static final EventListenerList listenerList = new EventListenerList(); /** * The actual listener that is installed on the component instances. @@ -71,7 +71,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * occurs. By doing things this way, the actual number of listeners * installed on a component instance is drastically reduced. */ - static private final SwingEventListener swingListener = new SwingEventListener(); + private static final SwingEventListener swingListener = new SwingEventListener(); /** * Constructs a {@code SwingEventMonitor}. @@ -88,7 +88,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeAncestorListener */ - static public void addAncestorListener(AncestorListener l) { + public static void addAncestorListener(AncestorListener l) { if (listenerList.getListenerCount(AncestorListener.class) == 0) { swingListener.installListeners(EventID.ANCESTOR); } @@ -102,7 +102,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addAncestorListener */ - static public void removeAncestorListener(AncestorListener l) { + public static void removeAncestorListener(AncestorListener l) { listenerList.remove(AncestorListener.class, l); if (listenerList.getListenerCount(AncestorListener.class) == 0) { swingListener.removeListeners(EventID.ANCESTOR); @@ -119,7 +119,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeCaretListener */ - static public void addCaretListener(CaretListener l) { + public static void addCaretListener(CaretListener l) { if (listenerList.getListenerCount(CaretListener.class) == 0) { swingListener.installListeners(EventID.CARET); } @@ -133,7 +133,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addCaretListener */ - static public void removeCaretListener(CaretListener l) { + public static void removeCaretListener(CaretListener l) { listenerList.remove(CaretListener.class, l); if (listenerList.getListenerCount(CaretListener.class) == 0) { swingListener.removeListeners(EventID.CARET); @@ -151,7 +151,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeCellEditorListener */ - static public void addCellEditorListener(CellEditorListener l) { + public static void addCellEditorListener(CellEditorListener l) { if (listenerList.getListenerCount(CellEditorListener.class) == 0) { swingListener.installListeners(EventID.CELLEDITOR); } @@ -165,7 +165,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addCellEditorListener */ - static public void removeCellEditorListener(CellEditorListener l) { + public static void removeCellEditorListener(CellEditorListener l) { listenerList.remove(CellEditorListener.class, l); if (listenerList.getListenerCount(CellEditorListener.class) == 0) { swingListener.removeListeners(EventID.CELLEDITOR); @@ -182,7 +182,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeChangeListener */ - static public void addChangeListener(ChangeListener l) { + public static void addChangeListener(ChangeListener l) { if (listenerList.getListenerCount(ChangeListener.class) == 0) { swingListener.installListeners(EventID.CHANGE); } @@ -196,7 +196,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addChangeListener */ - static public void removeChangeListener(ChangeListener l) { + public static void removeChangeListener(ChangeListener l) { listenerList.remove(ChangeListener.class, l); if (listenerList.getListenerCount(ChangeListener.class) == 0) { swingListener.removeListeners(EventID.CHANGE); @@ -213,7 +213,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeColumnModelListener */ - static public void addColumnModelListener(TableColumnModelListener l) { + public static void addColumnModelListener(TableColumnModelListener l) { if (listenerList.getListenerCount(TableColumnModelListener.class) == 0) { swingListener.installListeners(EventID.COLUMNMODEL); } @@ -227,7 +227,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addColumnModelListener */ - static public void removeColumnModelListener(TableColumnModelListener l) { + public static void removeColumnModelListener(TableColumnModelListener l) { listenerList.remove(TableColumnModelListener.class, l); if (listenerList.getListenerCount(TableColumnModelListener.class) == 0) { swingListener.removeListeners(EventID.COLUMNMODEL); @@ -244,7 +244,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeDocumentListener */ - static public void addDocumentListener(DocumentListener l) { + public static void addDocumentListener(DocumentListener l) { if (listenerList.getListenerCount(DocumentListener.class) == 0) { swingListener.installListeners(EventID.DOCUMENT); } @@ -258,7 +258,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addDocumentListener */ - static public void removeDocumentListener(DocumentListener l) { + public static void removeDocumentListener(DocumentListener l) { listenerList.remove(DocumentListener.class, l); if (listenerList.getListenerCount(DocumentListener.class) == 0) { swingListener.removeListeners(EventID.DOCUMENT); @@ -275,7 +275,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeListDataListener */ - static public void addListDataListener(ListDataListener l) { + public static void addListDataListener(ListDataListener l) { if (listenerList.getListenerCount(ListDataListener.class) == 0) { swingListener.installListeners(EventID.LISTDATA); } @@ -289,7 +289,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addListDataListener */ - static public void removeListDataListener(ListDataListener l) { + public static void removeListDataListener(ListDataListener l) { listenerList.remove(ListDataListener.class, l); if (listenerList.getListenerCount(ListDataListener.class) == 0) { swingListener.removeListeners(EventID.LISTDATA); @@ -306,7 +306,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeListSelectionListener */ - static public void addListSelectionListener(ListSelectionListener l) { + public static void addListSelectionListener(ListSelectionListener l) { if (listenerList.getListenerCount(ListSelectionListener.class) == 0) { swingListener.installListeners(EventID.LISTSELECTION); } @@ -320,7 +320,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addListSelectionListener */ - static public void removeListSelectionListener(ListSelectionListener l) { + public static void removeListSelectionListener(ListSelectionListener l) { listenerList.remove(ListSelectionListener.class, l); if (listenerList.getListenerCount(ListSelectionListener.class) == 0) { swingListener.removeListeners(EventID.LISTSELECTION); @@ -337,7 +337,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeMenuListener */ - static public void addMenuListener(MenuListener l) { + public static void addMenuListener(MenuListener l) { if (listenerList.getListenerCount(MenuListener.class) == 0) { swingListener.installListeners(EventID.MENU); } @@ -351,7 +351,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addMenuListener */ - static public void removeMenuListener(MenuListener l) { + public static void removeMenuListener(MenuListener l) { listenerList.remove(MenuListener.class, l); if (listenerList.getListenerCount(MenuListener.class) == 0) { swingListener.removeListeners(EventID.MENU); @@ -368,7 +368,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removePopupMenuListener */ - static public void addPopupMenuListener(PopupMenuListener l) { + public static void addPopupMenuListener(PopupMenuListener l) { if (listenerList.getListenerCount(PopupMenuListener.class) == 0) { swingListener.installListeners(EventID.POPUPMENU); } @@ -382,7 +382,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addPopupMenuListener */ - static public void removePopupMenuListener(PopupMenuListener l) { + public static void removePopupMenuListener(PopupMenuListener l) { listenerList.remove(PopupMenuListener.class, l); if (listenerList.getListenerCount(PopupMenuListener.class) == 0) { swingListener.removeListeners(EventID.POPUPMENU); @@ -399,7 +399,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeTableModelListener */ - static public void addTableModelListener(TableModelListener l) { + public static void addTableModelListener(TableModelListener l) { if (listenerList.getListenerCount(TableModelListener.class) == 0) { swingListener.installListeners(EventID.TABLEMODEL); } @@ -413,7 +413,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addTableModelListener */ - static public void removeTableModelListener(TableModelListener l) { + public static void removeTableModelListener(TableModelListener l) { listenerList.remove(TableModelListener.class, l); if (listenerList.getListenerCount(TableModelListener.class) == 0) { swingListener.removeListeners(EventID.TABLEMODEL); @@ -430,7 +430,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeTreeExpansionListener */ - static public void addTreeExpansionListener(TreeExpansionListener l) { + public static void addTreeExpansionListener(TreeExpansionListener l) { if (listenerList.getListenerCount(TreeExpansionListener.class) == 0) { swingListener.installListeners(EventID.TREEEXPANSION); } @@ -444,7 +444,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addTreeExpansionListener */ - static public void removeTreeExpansionListener(TreeExpansionListener l) { + public static void removeTreeExpansionListener(TreeExpansionListener l) { listenerList.remove(TreeExpansionListener.class, l); if (listenerList.getListenerCount(TreeExpansionListener.class) == 0) { swingListener.removeListeners(EventID.TREEEXPANSION); @@ -461,7 +461,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeTreeModelListener */ - static public void addTreeModelListener(TreeModelListener l) { + public static void addTreeModelListener(TreeModelListener l) { if (listenerList.getListenerCount(TreeModelListener.class) == 0) { swingListener.installListeners(EventID.TREEMODEL); } @@ -475,7 +475,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addTreeModelListener */ - static public void removeTreeModelListener(TreeModelListener l) { + public static void removeTreeModelListener(TreeModelListener l) { listenerList.remove(TreeModelListener.class, l); if (listenerList.getListenerCount(TreeModelListener.class) == 0) { swingListener.removeListeners(EventID.TREEMODEL); @@ -492,7 +492,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeTreeSelectionListener */ - static public void addTreeSelectionListener(TreeSelectionListener l) { + public static void addTreeSelectionListener(TreeSelectionListener l) { if (listenerList.getListenerCount(TreeSelectionListener.class) == 0) { swingListener.installListeners(EventID.TREESELECTION); } @@ -505,7 +505,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @see #addTreeSelectionListener * @param l the listener to remove */ - static public void removeTreeSelectionListener(TreeSelectionListener l) { + public static void removeTreeSelectionListener(TreeSelectionListener l) { listenerList.remove(TreeSelectionListener.class, l); if (listenerList.getListenerCount(TreeSelectionListener.class) == 0) { swingListener.removeListeners(EventID.TREESELECTION); @@ -522,7 +522,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeUndoableEditListener */ - static public void addUndoableEditListener(UndoableEditListener l) { + public static void addUndoableEditListener(UndoableEditListener l) { if (listenerList.getListenerCount(UndoableEditListener.class) == 0) { swingListener.installListeners(EventID.UNDOABLEEDIT); } @@ -536,7 +536,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addUndoableEditListener */ - static public void removeUndoableEditListener(UndoableEditListener l) { + public static void removeUndoableEditListener(UndoableEditListener l) { listenerList.remove(UndoableEditListener.class, l); if (listenerList.getListenerCount(UndoableEditListener.class) == 0) { swingListener.removeListeners(EventID.UNDOABLEEDIT); @@ -553,7 +553,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeInternalFrameListener */ - static public void addInternalFrameListener(InternalFrameListener l) { + public static void addInternalFrameListener(InternalFrameListener l) { if (listenerList.getListenerCount(InternalFrameListener.class) == 0) { swingListener.installListeners(EventID.INTERNALFRAME); } @@ -567,7 +567,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addInternalFrameListener */ - static public void removeInternalFrameListener(InternalFrameListener l) { + public static void removeInternalFrameListener(InternalFrameListener l) { listenerList.remove(InternalFrameListener.class, l); if (listenerList.getListenerCount(InternalFrameListener.class) == 0) { swingListener.removeListeners(EventID.INTERNALFRAME); @@ -584,7 +584,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removePropertyChangeListener */ - static public void addPropertyChangeListener(PropertyChangeListener l) { + public static void addPropertyChangeListener(PropertyChangeListener l) { if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) { swingListener.installListeners(EventID.PROPERTYCHANGE); } @@ -597,7 +597,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @see #addPropertyChangeListener * @param l the listener to remove */ - static public void removePropertyChangeListener(PropertyChangeListener l) { + public static void removePropertyChangeListener(PropertyChangeListener l) { listenerList.remove(PropertyChangeListener.class, l); if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) { swingListener.removeListeners(EventID.PROPERTYCHANGE); @@ -614,7 +614,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to add * @see #removeVetoableChangeListener */ - static public void addVetoableChangeListener(VetoableChangeListener l) { + public static void addVetoableChangeListener(VetoableChangeListener l) { if (listenerList.getListenerCount(VetoableChangeListener.class) == 0) { swingListener.installListeners(EventID.VETOABLECHANGE); } @@ -628,7 +628,7 @@ public class SwingEventMonitor extends AWTEventMonitor { * @param l the listener to remove * @see #addVetoableChangeListener */ - static public void removeVetoableChangeListener(VetoableChangeListener l) { + public static void removeVetoableChangeListener(VetoableChangeListener l) { listenerList.remove(VetoableChangeListener.class, l); if (listenerList.getListenerCount(VetoableChangeListener.class) == 0) { swingListener.removeListeners(EventID.VETOABLECHANGE); diff --git a/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java b/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java index faf041e269f..853be197754 100644 --- a/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java +++ b/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java @@ -53,7 +53,7 @@ import java.util.concurrent.ConcurrentHashMap; * Note: This class has to be public. It's loaded from the VM like this: * Class.forName(atName).newInstance(); */ -final public class AccessBridge { +public final class AccessBridge { private static AccessBridge theAccessBridge; private ObjectReferences references; @@ -314,15 +314,15 @@ final public class AccessBridge { } // hash table of native window handle to AccessibleContext mappings - static private ConcurrentHashMap windowHandleToContextMap = new ConcurrentHashMap<>(); + private static ConcurrentHashMap windowHandleToContextMap = new ConcurrentHashMap<>(); // hash table of AccessibleContext to native window handle mappings - static private ConcurrentHashMap contextToWindowHandleMap = new ConcurrentHashMap<>(); + private static ConcurrentHashMap contextToWindowHandleMap = new ConcurrentHashMap<>(); /* * adds a virtual window handler to our hash tables */ - static private void registerVirtualFrame(final Accessible a, + private static void registerVirtualFrame(final Accessible a, Integer nativeWindowHandle ) { if (a != null) { AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable() { @@ -339,7 +339,7 @@ final public class AccessBridge { /* * removes a virtual window handler to our hash tables */ - static private void revokeVirtualFrame(final Accessible a, + private static void revokeVirtualFrame(final Accessible a, Integer nativeWindowHandle ) { AccessibleContext ac = InvocationUtils.invokeAndWait(new Callable() { @Override -- GitLab From 7115892f96a5a57ce9d37602038b787d19da5d81 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Wed, 3 Nov 2021 16:23:57 +0000 Subject: [PATCH 174/890] 8276401: Use blessed modifier order in java.net.http Reviewed-by: prappo, rriggs --- .../jdk/internal/net/http/Http1Exchange.java | 2 +- .../jdk/internal/net/http/Http1Response.java | 8 ++++---- .../jdk/internal/net/http/Http2ClientImpl.java | 2 +- .../jdk/internal/net/http/Http2Connection.java | 6 +++--- .../jdk/internal/net/http/HttpClientImpl.java | 8 ++++---- .../jdk/internal/net/http/HttpConnection.java | 2 +- .../jdk/internal/net/http/ResponseSubscribers.java | 6 +++--- .../classes/jdk/internal/net/http/SocketTube.java | 2 +- .../jdk/internal/net/http/common/DebugLogger.java | 14 +++++++------- .../jdk/internal/net/http/common/FlowTube.java | 4 ++-- .../internal/net/http/common/MinimalFuture.java | 2 +- .../jdk/internal/net/http/common/SSLTube.java | 2 +- .../net/http/common/SequentialScheduler.java | 4 ++-- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java index 6edfe99f13a..4db16436407 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java @@ -117,7 +117,7 @@ class Http1Exchange extends ExchangeImpl { * concrete implementations: {@link Http1Request.StreamSubscriber}, and * {@link Http1Request.FixedContentSubscriber}, for receiving chunked and * fixed length bodies, respectively. */ - static abstract class Http1BodySubscriber implements Flow.Subscriber { + abstract static class Http1BodySubscriber implements Flow.Subscriber { final MinimalFuture whenSubscribed = new MinimalFuture<>(); private volatile Flow.Subscription subscription; volatile boolean complete; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java index d5bd85a13a6..1cf818eb762 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Response.java @@ -71,14 +71,14 @@ class Http1Response { private volatile EOFException eof; private volatile BodyParser bodyParser; // max number of bytes of (fixed length) body to ignore on redirect - private final static int MAX_IGNORE = 1024; + private static final int MAX_IGNORE = 1024; // Revisit: can we get rid of this? static enum State {INITIAL, READING_HEADERS, READING_BODY, DONE} private volatile State readProgress = State.INITIAL; final Logger debug = Utils.getDebugLogger(this::dbgString, Utils.DEBUG); - final static AtomicLong responseCount = new AtomicLong(); + static final AtomicLong responseCount = new AtomicLong(); final long id = responseCount.incrementAndGet(); private Http1HeaderParser hd; @@ -294,7 +294,7 @@ class Http1Response { * subscribed. * @param The type of response. */ - final static class Http1BodySubscriber implements TrustedSubscriber { + static final class Http1BodySubscriber implements TrustedSubscriber { final HttpResponse.BodySubscriber userSubscriber; final AtomicBoolean completed = new AtomicBoolean(); volatile Throwable withError; @@ -585,7 +585,7 @@ class Http1Response { } - static abstract class Receiver + abstract static class Receiver implements Http1AsyncReceiver.Http1AsyncDelegate { abstract void start(T parser); abstract CompletableFuture completion(); diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java index 6dc465adc23..4101133a025 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java @@ -54,7 +54,7 @@ import static jdk.internal.net.http.frame.SettingsFrame.MAX_FRAME_SIZE; */ class Http2ClientImpl { - final static Logger debug = + static final Logger debug = Utils.getDebugLogger("Http2ClientImpl"::toString, Utils.DEBUG); private final HttpClientImpl client; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java index 7bcf9d8b067..6a07d755e69 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java @@ -113,14 +113,14 @@ import static jdk.internal.net.http.frame.SettingsFrame.*; class Http2Connection { final Logger debug = Utils.getDebugLogger(this::dbgString, Utils.DEBUG); - final static Logger DEBUG_LOGGER = + static final Logger DEBUG_LOGGER = Utils.getDebugLogger("Http2Connection"::toString, Utils.DEBUG); private final Logger debugHpack = Utils.getHpackLogger(this::dbgString, Utils.DEBUG_HPACK); static final ByteBuffer EMPTY_TRIGGER = ByteBuffer.allocate(0); - static private final int MAX_CLIENT_STREAM_ID = Integer.MAX_VALUE; // 2147483647 - static private final int MAX_SERVER_STREAM_ID = Integer.MAX_VALUE - 1; // 2147483646 + private static final int MAX_CLIENT_STREAM_ID = Integer.MAX_VALUE; // 2147483647 + private static final int MAX_SERVER_STREAM_ID = Integer.MAX_VALUE - 1; // 2147483646 /** * Flag set when no more streams to be opened on this connection. diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java b/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java index ada37a1fbe9..6394b7b3cfa 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java @@ -135,7 +135,7 @@ final class HttpClientImpl extends HttpClient implements Trackable { * is the SelectorManager thread. If the current thread is not * the selector manager thread the given task is executed inline. */ - final static class DelegatingExecutor implements Executor { + static final class DelegatingExecutor implements Executor { private final BooleanSupplier isInSelectorThread; private final Executor delegate; DelegatingExecutor(BooleanSupplier isInSelectorThread, Executor delegate) { @@ -436,7 +436,7 @@ final class HttpClientImpl extends HttpClient implements Trackable { return pendingOperationCount.get(); } - final static class HttpClientTracker implements Tracker { + static final class HttpClientTracker implements Tracker { final AtomicLong httpCount; final AtomicLong http2Count; final AtomicLong websocketCount; @@ -670,7 +670,7 @@ final class HttpClientImpl extends HttpClient implements Trackable { } // Main loop for this client's selector - private final static class SelectorManager extends Thread { + private static final class SelectorManager extends Thread { // For testing purposes we have an internal System property that // can control the frequency at which the selector manager will wake @@ -1007,7 +1007,7 @@ final class HttpClientImpl extends HttpClient implements Trackable { private final SelectableChannel chan; private final Selector selector; private final Set pending; - private final static Logger debug = + private static final Logger debug = Utils.getDebugLogger("SelectorAttachment"::toString, Utils.DEBUG); private int interestOps; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java b/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java index 6f47a0bad6a..1fe3536b831 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java @@ -67,7 +67,7 @@ import static jdk.internal.net.http.common.Utils.ProxyHeaders; abstract class HttpConnection implements Closeable { final Logger debug = Utils.getDebugLogger(this::dbgString, Utils.DEBUG); - final static Logger DEBUG_LOGGER = Utils.getDebugLogger( + static final Logger DEBUG_LOGGER = Utils.getDebugLogger( () -> "HttpConnection(SocketTube(?))", Utils.DEBUG); /** The address this connection is connected to. Could be a server or a proxy. */ diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java index 1a81b3edcbd..ba9df1b4c9c 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java @@ -362,7 +362,7 @@ public class ResponseSubscribers { result.completeExceptionally(throwable); } - static private byte[] join(List bytes) { + private static byte[] join(List bytes) { int size = Utils.remaining(bytes, Integer.MAX_VALUE); byte[] res = new byte[size]; int from = 0; @@ -396,7 +396,7 @@ public class ResponseSubscribers { public static class HttpResponseInputStream extends InputStream implements TrustedSubscriber { - final static int MAX_BUFFERS_IN_QUEUE = 1; // lock-step with the producer + static final int MAX_BUFFERS_IN_QUEUE = 1; // lock-step with the producer // An immutable ByteBuffer sentinel to mark that the last byte was received. private static final ByteBuffer LAST_BUFFER = ByteBuffer.wrap(new byte[0]); @@ -882,7 +882,7 @@ public class ResponseSubscribers { // A subscription that wraps an upstream subscription and // holds a reference to a subscriber. The subscriber reference // is cleared when the subscription is cancelled - final static class SubscriptionRef implements Flow.Subscription { + static final class SubscriptionRef implements Flow.Subscription { final Flow.Subscription subscription; final SubscriberRef subscriberRef; SubscriptionRef(Flow.Subscription subscription, diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java b/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java index b0b5c373a90..321a228e776 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java @@ -226,7 +226,7 @@ final class SocketTube implements FlowTube { * signaled. It is the responsibility of the code triggered by * {@code signalEvent} to resume the event if required. */ - private static abstract class SocketFlowEvent extends AsyncEvent { + private abstract static class SocketFlowEvent extends AsyncEvent { final SocketChannel channel; final int defaultInterest; volatile int interestOps; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/DebugLogger.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/DebugLogger.java index 57358e33bcc..01f962f5bbe 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/DebugLogger.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/DebugLogger.java @@ -46,19 +46,19 @@ import java.util.function.Supplier; */ final class DebugLogger implements Logger { // deliberately not in the same subtree than standard loggers. - final static String HTTP_NAME = "jdk.internal.httpclient.debug"; - final static String WS_NAME = "jdk.internal.httpclient.websocket.debug"; - final static String HPACK_NAME = "jdk.internal.httpclient.hpack.debug"; - final static System.Logger HTTP = System.getLogger(HTTP_NAME); - final static System.Logger WS = System.getLogger(WS_NAME); - final static System.Logger HPACK = System.getLogger(HPACK_NAME); + static final String HTTP_NAME = "jdk.internal.httpclient.debug"; + static final String WS_NAME = "jdk.internal.httpclient.websocket.debug"; + static final String HPACK_NAME = "jdk.internal.httpclient.hpack.debug"; + static final System.Logger HTTP = System.getLogger(HTTP_NAME); + static final System.Logger WS = System.getLogger(WS_NAME); + static final System.Logger HPACK = System.getLogger(HPACK_NAME); private static final DebugLogger NO_HTTP_LOGGER = new DebugLogger(HTTP, "HTTP"::toString, Level.OFF, Level.OFF); private static final DebugLogger NO_WS_LOGGER = new DebugLogger(HTTP, "WS"::toString, Level.OFF, Level.OFF); private static final DebugLogger NO_HPACK_LOGGER = new DebugLogger(HTTP, "HPACK"::toString, Level.OFF, Level.OFF); - final static long START_NANOS = System.nanoTime(); + static final long START_NANOS = System.nanoTime(); private final Supplier dbgTag; private final Level errLevel; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/FlowTube.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/FlowTube.java index f079f400c12..023086e3dee 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/FlowTube.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/FlowTube.java @@ -138,7 +138,7 @@ public interface FlowTube extends * It is not required that a {@code TubePublisher} implementation extends * this class. */ - static abstract class AbstractTubePublisher implements TubePublisher { + abstract static class AbstractTubePublisher implements TubePublisher { static final class TubePublisherWrapper extends AbstractTubePublisher { final Flow.Publisher> delegate; public TubePublisherWrapper(Flow.Publisher> delegate) { @@ -156,7 +156,7 @@ public interface FlowTube extends * It is not required that a {@code TubeSubscriber} implementation extends * this class. */ - static abstract class AbstractTubeSubscriber implements TubeSubscriber { + abstract static class AbstractTubeSubscriber implements TubeSubscriber { static final class TubeSubscriberWrapper extends AbstractTubeSubscriber { final Flow.Subscriber> delegate; TubeSubscriberWrapper(Flow.Subscriber> delegate) { diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/MinimalFuture.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/MinimalFuture.java index 8fc79b0437c..ddbcce661aa 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/MinimalFuture.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/MinimalFuture.java @@ -42,7 +42,7 @@ public final class MinimalFuture extends CompletableFuture { U get() throws Throwable; } - private final static AtomicLong TOKENS = new AtomicLong(); + private static final AtomicLong TOKENS = new AtomicLong(); private final long id; private final Cancelable cancelable; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java index 620b9af372e..42174ef9c44 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java @@ -184,7 +184,7 @@ public class SSLTube implements FlowTube { // The DelegateWrapper wraps a subscribed {@code Flow.Subscriber} and // tracks the subscriber's state. In particular it makes sure that // onComplete/onError are not called before onSubscribed. - final static class DelegateWrapper implements FlowTube.TubeSubscriber { + static final class DelegateWrapper implements FlowTube.TubeSubscriber { private final FlowTube.TubeSubscriber delegate; private final Logger debug; volatile boolean subscribedCalled; diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/SequentialScheduler.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/SequentialScheduler.java index 499aa944ac3..88809ec0678 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SequentialScheduler.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SequentialScheduler.java @@ -111,7 +111,7 @@ public final class SequentialScheduler { * later time, and maybe in different thread. This type exists for * readability purposes at use-sites only. */ - public static abstract class DeferredCompleter { + public abstract static class DeferredCompleter { /** Extensible from this (outer) class ONLY. */ private DeferredCompleter() { } @@ -140,7 +140,7 @@ public final class SequentialScheduler { * A simple and self-contained task that completes once its {@code run} * method returns. */ - public static abstract class CompleteRestartableTask + public abstract static class CompleteRestartableTask implements RestartableTask { @Override -- GitLab From 684edbb4c884cbc3e05118e4bc9808b5d5b71a74 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Wed, 3 Nov 2021 16:55:23 +0000 Subject: [PATCH 175/890] 8273922: (fs) UserDefinedFileAttributeView doesn't handle file names that are just under the MAX_PATH limit (win) Reviewed-by: alanb --- .../WindowsUserDefinedFileAttributeView.java | 13 +++- .../UserDefinedFileAttributeView/Basic.java | 72 +++++++++++++++---- 2 files changed, 70 insertions(+), 15 deletions(-) diff --git a/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java b/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java index b02b91624ed..2fba50a3832 100644 --- a/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java +++ b/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java @@ -51,8 +51,19 @@ class WindowsUserDefinedFileAttributeView throw new NullPointerException("'name' is null"); return file + ":" + name; } + private String join(WindowsPath file, String name) throws WindowsException { - return join(file.getPathForWin32Calls(), name); + if (name == null) + throw new NullPointerException("'name' is null"); + WindowsFileSystem wfs = file.getFileSystem(); + WindowsPath namePath = WindowsPath.parse(wfs, name); + if (namePath.getRoot() != null) + throw new IllegalArgumentException("'name' has a root component"); + if (namePath.getParent() != null) + throw new IllegalArgumentException("'name' has more than one element"); + String path = join(file.getPathForWin32Calls(), name); + WindowsPath wp = WindowsPath.createFromNormalizedPath(wfs, path); + return wp.getPathForWin32Calls(); } private final WindowsPath file; diff --git a/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java b/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java index 5f40d193cf0..bc47b8719f2 100644 --- a/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java +++ b/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -22,21 +22,27 @@ */ /* @test - * @bug 4313887 6838333 + * @bug 4313887 6838333 8273922 * @summary Unit test for java.nio.file.attribute.UserDefinedFileAttributeView - * @library ../.. + * @library ../.. /test/lib * @key randomness + * @build jdk.test.lib.Platform + * @run main Basic */ +import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.Charset; -import java.nio.file.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; import static java.nio.file.LinkOption.*; import java.nio.file.attribute.*; import java.util.Arrays; import java.util.Map; import java.util.Random; -import java.io.IOException; +import jdk.test.lib.Platform; public class Basic { @@ -144,9 +150,16 @@ public class Basic { throw new RuntimeException("Unexpected attribute value"); } - static void miscTests(final Path file) throws IOException { + private static void setEA(Path longPath, String s) throws IOException { + System.out.println("Setting short EA '" + s + + "' on path of length " + longPath.toString().length()); + Files.setAttribute(longPath, s, + ByteBuffer.wrap("ea-value".getBytes(StandardCharsets.UTF_8))); + } + + static void miscTests(final Path dir) throws IOException { final UserDefinedFileAttributeView view = - Files.getFileAttributeView(file, UserDefinedFileAttributeView.class); + Files.getFileAttributeView(dir, UserDefinedFileAttributeView.class); view.write(ATTR_NAME, ByteBuffer.wrap(ATTR_VALUE.getBytes())); // NullPointerException @@ -178,31 +191,31 @@ public class Basic { }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.getAttribute(file, null); + Files.getAttribute(dir, null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.getAttribute(file, "user:" + ATTR_NAME, (LinkOption[])null); + Files.getAttribute(dir, "user:" + ATTR_NAME, (LinkOption[])null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.setAttribute(file, "user:" + ATTR_NAME, null); + Files.setAttribute(dir, "user:" + ATTR_NAME, null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.setAttribute(file, null, new byte[0]); + Files.setAttribute(dir, null, new byte[0]); }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.setAttribute(file, "user: " + ATTR_NAME, new byte[0], (LinkOption[])null); + Files.setAttribute(dir, "user: " + ATTR_NAME, new byte[0], (LinkOption[])null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.readAttributes(file, (String)null); + Files.readAttributes(dir, (String)null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - Files.readAttributes(file, "*", (LinkOption[])null); + Files.readAttributes(dir, "*", (LinkOption[])null); }}); // Read-only buffer @@ -221,6 +234,37 @@ public class Basic { buf.position(buf.capacity()); view.read(ATTR_NAME, buf); }}); + + // Long attribute name + if (Platform.isWindows()) { + Path tmp = Files.createTempDirectory(dir, "ea-length-bug"); + int len = tmp.toString().length(); + + // We need to run up to MAX_PATH for directories, + // but not quite go over it. + int MAX_PATH = 247; + int requiredLen = MAX_PATH - len - 2; + + // Create a really long directory name. + Path longPath = tmp.resolve("x".repeat(requiredLen)); + + // Make sure the directory exists. + Files.createDirectory(longPath); + + try { + // Try to set absolute path as extended attribute; expect IAE + tryCatch(IllegalArgumentException.class, new Task() { + public void run() throws IOException { + setEA(longPath, "user:C:\\"); + }}); + + // Try to set an extended attribute on it. + setEA(longPath, "user:short"); + setEA(longPath, "user:reallyquitelonglongattrname"); + } finally { + Files.delete(longPath); + } + } } public static void main(String[] args) throws IOException { -- GitLab From c7f070f5f17dad661cc3296f2e3cd7a1cd5fc742 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Wed, 3 Nov 2021 18:18:16 +0000 Subject: [PATCH 176/890] 8276208: vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java fails with "AssertionError: Unexpected output" Reviewed-by: cjplummer, iklam --- .../nsk/jdb/list/list003/list003.java | 23 ++++++++-------- .../nsk/jdb/repeat/repeat001/repeat001.java | 26 +++++++++---------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java index 0858e93adb0..d06bf38bd85 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/list/list003/list003.java @@ -85,10 +85,11 @@ public class list003 extends JdbTest { return line.trim().equals("main[1]"); } - protected static List parseListOutput(String[] lines) { + protected List parseListOutput(String[] lines) { List lineList = new ArrayList<>(Arrays.asList(lines)); if (!isPrompt(lineList.remove(lineList.size() - 1))) { - throw new AssertionError("Expected trailing prompt"); + failure("Expected trailing prompt"); + return null; } else if (lineList.size() == 1 && lineList.get(0).equals("EOF")) { return new ArrayList<>(); } else { @@ -117,14 +118,14 @@ public class list003 extends JdbTest { protected void runCasesNoCleanup() { if (jdb.receiveReplyFor(JdbCommand.repeat + "on").length != 1) { - throw new AssertionError("Missing or unexpected output"); + failure("Missing or unexpected output"); } List autoList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list)); int lineNo = autoList.stream().filter(ListLine::active).findFirst().get().number(); List manualList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list + (lineNo - 1))); if (manualList.stream().filter(ListLine::active).findFirst().get().number() != lineNo) { - throw new AssertionError("Manual listing didn't mark the active source line"); + failure("Manual listing didn't mark the active source line"); } // Verify that we can correctly list by auto-advance all the way to EOF @@ -137,36 +138,36 @@ public class list003 extends JdbTest { List currList = parseListOutput(jdb.receiveReplyFor(command)); if (currList.equals(prevList)) { // This guards against infinite looping - throw new AssertionError("Consecutive listings were identical"); + failure("Consecutive listings were identical"); } int prevEnd = prevList.get(prevList.size() - 1).number(); if (!currList.isEmpty() && currList.get(0).number() != prevEnd + 1) { - throw new AssertionError("Consecutive listings weren't for consecutive source chunks"); + failure("Consecutive listings weren't for consecutive source chunks"); } prevList = currList; } if (reps < 2) { - throw new AssertionError("Didn't get enough consecutive list reps"); + failure("Didn't get enough consecutive list reps"); } String[] lines = jdb.receiveReplyFor(JdbCommand.up); if (!lines[0].equals("End of stack.") || !isPrompt(lines[1])) { - throw new AssertionError("Unexpected output from `up'"); + failure("Unexpected output from `up'"); } List resetList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list)); if (!resetList.stream().anyMatch(ListLine::active)) { - throw new AssertionError("List target didn't reset to active line"); + failure("List target didn't reset to active line"); } List listing = parseListOutput(jdb.receiveReplyFor(JdbCommand.list + "1")); if (!listing.stream().anyMatch(l -> l.number() == 1)) { - throw new AssertionError("Manual listing displayed the wrong lines"); + failure("Manual listing displayed the wrong lines"); } List targetedList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list + "1")); autoList = parseListOutput(jdb.receiveReplyFor(JdbCommand.list)); if (autoList.get(0).number() != targetedList.get(targetedList.size() - 1).number() + 1) { - throw new AssertionError("Auto-advance didn't work after targeted list"); + failure("Auto-advance didn't work after targeted list"); } } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java index f6e45c1d2d6..e0489db2829 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/repeat/repeat001/repeat001.java @@ -94,55 +94,55 @@ public class repeat001 extends JdbTest { // Verify that repeat is off initially String[] reply = jdb.receiveReplyFor(JdbCommand.repeat); if (reply.length != 2 || !isPrompt(reply[1])) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } if (!reply[0].equals("Repeat is off")) { - throw new AssertionError("Incorrect initial repeat setting"); + failure("Incorrect initial repeat setting"); } // Verify that list auto-advance is disabled String[] firstList = jdb.receiveReplyFor(JdbCommand.list); String[] secondList = jdb.receiveReplyFor(JdbCommand.list); if (!Arrays.equals(firstList, secondList)) { - throw new AssertionError("Listing inconsistent with repeat off"); + failure("Listing inconsistent with repeat off"); } // Verify that command repetition doesn't happen when disabled reply = jdb.receiveReplyFor(""); if (reply.length != 1 || !isPrompt(reply[0])) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } reply = jdb.receiveReplyFor(JdbCommand.repeat + "on"); if (reply.length != 1 || !isPrompt(reply[0])) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } // Verify that repeat is reported on reply = jdb.receiveReplyFor(JdbCommand.repeat); if (reply.length != 2 || !isPrompt(reply[1])) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } if (!reply[0].equals("Repeat is on")) { - throw new AssertionError("Incorrect repeat status reported"); + failure("Incorrect repeat status reported"); } // Verify that non-repeatable commands still don't repeat if (jdb.receiveReplyFor(JdbCommand.print + "0").length != 2) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } if (jdb.receiveReplyFor("").length != 1) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } // Verify that repeated commands are repeatable // (`up' just prints `End of stack.' since we're stopped in `main') - reply = jdb.receiveReplyFor("2 2 " + JdbCommand.up); + reply = jdb.receiveReplyFor("2 2 " + JdbCommand.up, true, 4); if (reply.length != 5 || !isPrompt(reply[4])) { - throw new AssertionError("Unexpected output"); + failure("Unexpected output"); } - if (!Arrays.equals(reply, jdb.receiveReplyFor(""))) { - throw new AssertionError("Repeated command didn't repeat correctly"); + if (!Arrays.equals(reply, jdb.receiveReplyFor("", true, 4))) { + failure("Repeated command didn't repeat correctly"); } } } -- GitLab From 32895ac60949ccceb0a3d25c73ec5e3a00c29593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=A0ipka?= Date: Wed, 3 Nov 2021 19:30:12 +0000 Subject: [PATCH 177/890] 8275650: Problemlist java/io/File/createTempFile/SpecialTempFile.java for Windows 11 Reviewed-by: bpb, msheppar --- out | Bin 0 -> 4513 bytes test/jdk/ProblemList.txt | 1 + 2 files changed, 1 insertion(+) create mode 100644 out diff --git a/out b/out new file mode 100644 index 0000000000000000000000000000000000000000..a6975491510071cf25a001374cb40270fa387053 GIT binary patch literal 4513 zcmcIoZBOGk5WcUMU*Qj@J&>sL=DbS%(4*a5b}1lIZgtX0$RutXNaLLCl>PZPc3Wtn zbPKy61a4wK&pb2Z@wj7JR;)mZqX|=JPOFxoF&Ah)!+9a`y(ksKROHig&I)`>=M+yF zZ7egYXg$GKwWO+)= zjsFEuKLcoQL342Ur}aBkZ&`T;mdqI%GBxGJp+OPszqS-i;=hL%f;SS+XUF~QcuBpa zELJ8QtY&F_DRKSnAb(_Z%!ahVO{+GSMBerlAhxPDr@AkpZ`jcDmG%X#(c~gmY1|zeKzXNG6ZTHqy9k}Nl@9R{G6`7L6L>sp7M{2-)f6>?jmz&x=!qYGI|9d!%^Oqfju802D8&)N zb`TLS@*_VaFz}qfCFEWCa1aD>5_^sl`o2fpFpT^M!U^ZaehO{d#u)x=D4R9w$`a!E zLFC3!;5fdUgia8?4-s~~Ac*3?^Sm(h2xyAdocIb&W6sz0Y|3%nAPxg3@U@;OCO+}r z<=h)tAuJ|W(N*D|OqQ?_S>bZS1TS;Y(E^$_`ngM=iAAwofr_>al= z%gJ!ylYoHhk~m6y&r5v&F(F>Xwi5Frd2SSu5U7X;fr}h)tQ)<}nfo&0kdQcr6ok}w z-NYrKAHR`tBTrWRo8fbvIDk}%6BjZ+Awd+n??;BAPj>pywruV zH@eEw0O!Jz2oa0(YN`!h`LuAlet?6i0G zsmto?lL5XOeeA^W=%P3J+_i7YI<;FV9tRR0!RzDGUY0H9thWv?n{Q71RVT4$lTxJX zcG_FO^^s#dwWIgh1ffj>?Tmt^Z}GPiV%M(98`I*LKJb=`eV1q$Xr%-=1bUXuNbc1| zX}=ogC4xrj^o<#Cec+9f-REx<+zX%wf9dtIs}e80*RFc;U2(UO8~gQw8zwI4G34*h zLK#2kE{(SekDJYTLmwC;`!vY+%Srh9%4qr1Jmtyr|w zdu{}6+jBlC@?S!?6&W{FP2UNASqpxMzN~z2Djm;78JPWK{UT!63cIeFL%3pm6Ht(t z*eo4el6Ps*Ym&6E^@RaD_*PMCao4*XWLKwfQ(WEDwq9ypef{iMBi;GKHw0~^WQrPd q4@{A3U9yG?h4fb-iopee@1aweHTG1^Dtj@;dJI?w{&is5lh*(KTEgA{ literal 0 HcmV?d00001 diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 5ef10cbdf33..75a7a351314 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -562,6 +562,7 @@ javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-al # jdk_io java/io/pathNames/GeneralWin32.java 8180264 windows-all +java/io/File/createTempFile/SpecialTempFile.java 8274122 windows11 ############################################################################ -- GitLab From f3320d2fbd28349fa5eab3ea0da0ff0a3ef54c62 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 3 Nov 2021 21:20:09 +0000 Subject: [PATCH 178/890] 8276588: Change "ccc" to "CSR" in HotSpot sources Reviewed-by: dcubed, kbarrett --- src/hotspot/share/oops/instanceKlass.cpp | 2 +- src/hotspot/share/runtime/globals.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 6af522daf58..6c83b0bd7da 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -728,7 +728,7 @@ oop InstanceKlass::protection_domain() const { return java_lang_Class::protection_domain(java_mirror()); } -// To remove these from requires an incompatible change and CCC request. +// To remove these from requires an incompatible change and CSR review. objArrayOop InstanceKlass::signers() const { // return the signers from the mirror return java_lang_Class::signers(java_mirror()); diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 99d27f55e5b..81bfbaaf033 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -86,12 +86,12 @@ // MANAGEABLE flags are writeable external product flags. // They are dynamically writeable through the JDK management interface // (com.sun.management.HotSpotDiagnosticMXBean API) and also through JConsole. -// These flags are external exported interface (see CCC). The list of +// These flags are external exported interface (see CSR). The list of // manageable flags can be queried programmatically through the management // interface. // // A flag can be made as "manageable" only if -// - the flag is defined in a CCC as an external exported interface. +// - the flag is defined in a CSR request as an external exported interface. // - the VM implementation supports dynamic setting of the flag. // This implies that the VM must *always* query the flag variable // and not reuse state related to the flag state at any given time. -- GitLab From 0ab910d626a05106e1366438aeb5b16e16374c2f Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Wed, 3 Nov 2021 22:45:50 +0000 Subject: [PATCH 179/890] 8276066: Reset LoopPercentProfileLimit for x86 due to suboptimal performance Reviewed-by: thartmann, kvn --- src/hotspot/cpu/x86/c2_globals_x86.hpp | 2 +- .../openjdk/bench/vm/compiler/LoopUnroll.java | 88 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 test/micro/org/openjdk/bench/vm/compiler/LoopUnroll.java diff --git a/src/hotspot/cpu/x86/c2_globals_x86.hpp b/src/hotspot/cpu/x86/c2_globals_x86.hpp index 7e5128d7f2d..f7315011e6b 100644 --- a/src/hotspot/cpu/x86/c2_globals_x86.hpp +++ b/src/hotspot/cpu/x86/c2_globals_x86.hpp @@ -44,7 +44,7 @@ define_pd_global(intx, OnStackReplacePercentage, 140); define_pd_global(intx, ConditionalMoveLimit, 3); define_pd_global(intx, FreqInlineSize, 325); define_pd_global(intx, MinJumpTableSize, 10); -define_pd_global(intx, LoopPercentProfileLimit, 30); +define_pd_global(intx, LoopPercentProfileLimit, 10); #ifdef AMD64 define_pd_global(intx, InteriorEntryAlignment, 16); define_pd_global(size_t, NewSizeThreadIncrease, ScaleForWordSize(4*K)); diff --git a/test/micro/org/openjdk/bench/vm/compiler/LoopUnroll.java b/test/micro/org/openjdk/bench/vm/compiler/LoopUnroll.java new file mode 100644 index 00000000000..84630e70b89 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/LoopUnroll.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. + * 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 org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.*; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 5, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 4, time = 5, timeUnit = TimeUnit.SECONDS) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.SECONDS) +@State(Scope.Thread) +@Fork(value=1) +public class LoopUnroll { + @Param({"16", "32", "64", "128", "256", "512", "1024"}) + private int VECLEN; + + private byte[][] a; + private byte[][] b; + private byte[][] c; + + @Setup + public void init() { + a = new byte[VECLEN][VECLEN]; + b = new byte[VECLEN][VECLEN]; + c = new byte[VECLEN][VECLEN]; + } + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + private int run_workload1(int count, byte[][] a , byte[][] b, byte[][] c) { + for(int i = 0; i < a.length; i++) { + for (int j = 0; j < a[0].length; j++) { + a[i][j] = (byte)(b[i][j] + c[i][j]); + } + } + return a[count][count]; + } + + @Benchmark + public void workload1_caller(Blackhole bh) { + int r = 0; + for(int i = 0 ; i < 100; i++) { + r += run_workload1(i % a.length, a, b, c); + } + bh.consume(r); + } + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + private int run_workload2(int count, byte[][] a , byte[][] b) { + for(int i = 0; i < b.length; i++) { + for (int j = 0; j < b[0].length; j++) { + a[i][j] = b[i][j]; + } + } + return a[count][count]; + } + + @Benchmark + public void workload2_caller(Blackhole bh) { + int r = 0; + for(int i = 0 ; i < 100; i++) { + r += run_workload2(i % a.length, a, b); + } + bh.consume(r); + } +} -- GitLab From ce8c76700ba854f43c48d32b068b30e7d78d9d1e Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Wed, 3 Nov 2021 22:57:13 +0000 Subject: [PATCH 180/890] 8276220: Reduce excessive allocations in DateTimeFormatter Reviewed-by: scolebourne, naoto --- .../time/format/DateTimeFormatterBuilder.java | 281 ++++++++++++++++-- .../time/format/DateTimePrintContext.java | 6 +- .../format/TestFractionPrinterParser.java | 175 ++++++++++- .../time/format/DateTimeFormatterBench.java | 121 ++++++++ 4 files changed, 552 insertions(+), 31 deletions(-) create mode 100644 test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterBench.java diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java index 700b8f07531..50c4155c4ac 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -701,11 +701,20 @@ public final class DateTimeFormatterBuilder { */ public DateTimeFormatterBuilder appendFraction( TemporalField field, int minWidth, int maxWidth, boolean decimalPoint) { - if (minWidth == maxWidth && decimalPoint == false) { - // adjacent parsing - appendValue(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint)); + if (field == NANO_OF_SECOND) { + if (minWidth == maxWidth && decimalPoint == false) { + // adjacent parsing + appendValue(new NanosPrinterParser(minWidth, maxWidth, decimalPoint)); + } else { + appendInternal(new NanosPrinterParser(minWidth, maxWidth, decimalPoint)); + } } else { - appendInternal(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint)); + if (minWidth == maxWidth && decimalPoint == false) { + // adjacent parsing + appendValue(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint)); + } else { + appendInternal(new FractionPrinterParser(field, minWidth, maxWidth, decimalPoint)); + } } return this; } @@ -2758,6 +2767,24 @@ public final class DateTimeFormatterBuilder { return new NumberPrinterParser(field, minWidth, maxWidth, signStyle, this.subsequentWidth + subsequentWidth); } + /* + * Copied from Long.stringSize + */ + private static int stringSize(long x) { + int d = 1; + if (x >= 0) { + d = 0; + x = -x; + } + long p = -10; + for (int i = 1; i < 19; i++) { + if (x > p) + return i + d; + p = 10 * p; + } + return 19 + d; + } + @Override public boolean format(DateTimePrintContext context, StringBuilder buf) { Long valueLong = context.getValue(field); @@ -2766,18 +2793,21 @@ public final class DateTimeFormatterBuilder { } long value = getValue(context, valueLong); DecimalStyle decimalStyle = context.getDecimalStyle(); - String str = (value == Long.MIN_VALUE ? "9223372036854775808" : Long.toString(Math.abs(value))); - if (str.length() > maxWidth) { + int size = stringSize(value); + if (value < 0) { + size--; + } + + if (size > maxWidth) { throw new DateTimeException("Field " + field + " cannot be printed as the value " + value + " exceeds the maximum print width of " + maxWidth); } - str = decimalStyle.convertNumberToI18N(str); if (value >= 0) { switch (signStyle) { case EXCEEDS_PAD: - if (minWidth < 19 && value >= EXCEED_POINTS[minWidth]) { + if (minWidth < 19 && size > minWidth) { buf.append(decimalStyle.getPositiveSign()); } break; @@ -2793,10 +2823,16 @@ public final class DateTimeFormatterBuilder { " cannot be negative according to the SignStyle"); } } - for (int i = 0; i < minWidth - str.length(); i++) { - buf.append(decimalStyle.getZeroDigit()); + char zeroDigit = decimalStyle.getZeroDigit(); + for (int i = 0; i < minWidth - size; i++) { + buf.append(zeroDigit); + } + if (zeroDigit == '0' && value != Long.MIN_VALUE) { + buf.append(Math.abs(value)); + } else { + String str = value == Long.MIN_VALUE ? "9223372036854775808" : Long.toString(Math.abs(value)); + buf.append(decimalStyle.convertNumberToI18N(str)); } - buf.append(str); return true; } @@ -3111,12 +3147,216 @@ public final class DateTimeFormatterBuilder { } } + //----------------------------------------------------------------------- + /** + * Prints and parses a NANO_OF_SECOND field with optional padding. + */ + static final class NanosPrinterParser extends NumberPrinterParser { + private final boolean decimalPoint; + + /** + * Constructor. + * + * @param minWidth the minimum width to output, from 0 to 9 + * @param maxWidth the maximum width to output, from 0 to 9 + * @param decimalPoint whether to output the localized decimal point symbol + */ + NanosPrinterParser(int minWidth, int maxWidth, boolean decimalPoint) { + this(minWidth, maxWidth, decimalPoint, 0); + if (minWidth < 0 || minWidth > 9) { + throw new IllegalArgumentException("Minimum width must be from 0 to 9 inclusive but was " + minWidth); + } + if (maxWidth < 1 || maxWidth > 9) { + throw new IllegalArgumentException("Maximum width must be from 1 to 9 inclusive but was " + maxWidth); + } + if (maxWidth < minWidth) { + throw new IllegalArgumentException("Maximum width must exceed or equal the minimum width but " + + maxWidth + " < " + minWidth); + } + } + + /** + * Constructor. + * + * @param minWidth the minimum width to output, from 0 to 9 + * @param maxWidth the maximum width to output, from 0 to 9 + * @param decimalPoint whether to output the localized decimal point symbol + * @param subsequentWidth the subsequentWidth for this instance + */ + NanosPrinterParser(int minWidth, int maxWidth, boolean decimalPoint, int subsequentWidth) { + super(NANO_OF_SECOND, minWidth, maxWidth, SignStyle.NOT_NEGATIVE, subsequentWidth); + this.decimalPoint = decimalPoint; + } + + /** + * Returns a new instance with fixed width flag set. + * + * @return a new updated printer-parser, not null + */ + @Override + NanosPrinterParser withFixedWidth() { + if (subsequentWidth == -1) { + return this; + } + return new NanosPrinterParser(minWidth, maxWidth, decimalPoint, -1); + } + + /** + * Returns a new instance with an updated subsequent width. + * + * @param subsequentWidth the width of subsequent non-negative numbers, 0 or greater + * @return a new updated printer-parser, not null + */ + @Override + NanosPrinterParser withSubsequentWidth(int subsequentWidth) { + return new NanosPrinterParser(minWidth, maxWidth, decimalPoint, this.subsequentWidth + subsequentWidth); + } + + /** + * For NanosPrinterParser, the width is fixed if context is strict, + * minWidth equal to maxWidth and decimalpoint is absent. + * @param context the context + * @return if the field is fixed width + * @see #appendFraction(java.time.temporal.TemporalField, int, int, boolean) + */ + @Override + boolean isFixedWidth(DateTimeParseContext context) { + if (context.isStrict() && minWidth == maxWidth && decimalPoint == false) { + return true; + } + return false; + } + + // Simplified variant of Integer.stringSize that assumes positive values + private static int stringSize(int x) { + int p = 10; + for (int i = 1; i < 10; i++) { + if (x < p) + return i; + p = 10 * p; + } + return 10; + } + + private static final int[] TENS = new int[] { + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + 10000000, + 100000000 + }; + + @Override + public boolean format(DateTimePrintContext context, StringBuilder buf) { + Long value = context.getValue(field); + if (value == null) { + return false; + } + int val = field.range().checkValidIntValue(value, field); + DecimalStyle decimalStyle = context.getDecimalStyle(); + int stringSize = stringSize(val); + char zero = decimalStyle.getZeroDigit(); + if (val == 0 || stringSize < 10 - maxWidth) { + // 0 or would round down to 0 + // to get output identical to FractionPrinterParser use minWidth if the + // value is zero, maxWidth otherwise + int width = val == 0 ? minWidth : maxWidth; + if (width > 0) { + if (decimalPoint) { + buf.append(decimalStyle.getDecimalSeparator()); + } + for (int i = 0; i < width; i++) { + buf.append(zero); + } + } + } else { + if (decimalPoint) { + buf.append(decimalStyle.getDecimalSeparator()); + } + // add leading zeros + for (int i = 9 - stringSize; i > 0; i--) { + buf.append(zero); + } + // truncate unwanted digits + if (maxWidth < 9) { + val /= TENS[9 - maxWidth]; + } + // truncate zeros + for (int i = maxWidth; i > minWidth; i--) { + if ((val % 10) != 0) { + break; + } + val /= 10; + } + if (zero == '0') { + buf.append(val); + } else { + buf.append(decimalStyle.convertNumberToI18N(Integer.toString(val))); + } + } + return true; + } + + @Override + public int parse(DateTimeParseContext context, CharSequence text, int position) { + int effectiveMin = (context.isStrict() || isFixedWidth(context) ? minWidth : 0); + int effectiveMax = (context.isStrict() || isFixedWidth(context) ? maxWidth : 9); + int length = text.length(); + if (position == length) { + // valid if whole field is optional, invalid if minimum width + return (effectiveMin > 0 ? ~position : position); + } + if (decimalPoint) { + if (text.charAt(position) != context.getDecimalStyle().getDecimalSeparator()) { + // valid if whole field is optional, invalid if minimum width + return (effectiveMin > 0 ? ~position : position); + } + position++; + } + int minEndPos = position + effectiveMin; + if (minEndPos > length) { + return ~position; // need at least min width digits + } + int maxEndPos = Math.min(position + effectiveMax, length); + int total = 0; // can use int because we are only parsing up to 9 digits + int pos = position; + while (pos < maxEndPos) { + char ch = text.charAt(pos); + int digit = context.getDecimalStyle().convertToDigit(ch); + if (digit < 0) { + if (pos < minEndPos) { + return ~position; // need at least min width digits + } + break; + } + pos++; + total = total * 10 + digit; + } + for (int i = 9 - (pos - position); i > 0; i--) { + total *= 10; + } + return context.setParsedField(field, total, position, pos); + } + + @Override + public String toString() { + String decimal = (decimalPoint ? ",DecimalPoint" : ""); + return "Fraction(" + field + "," + minWidth + "," + maxWidth + decimal + ")"; + } + } + //----------------------------------------------------------------------- /** * Prints and parses a numeric date-time field with optional padding. */ static final class FractionPrinterParser extends NumberPrinterParser { private final boolean decimalPoint; + private final BigDecimal minBD; + private final BigDecimal rangeBD; /** * Constructor. @@ -3156,6 +3396,9 @@ public final class DateTimeFormatterBuilder { FractionPrinterParser(TemporalField field, int minWidth, int maxWidth, boolean decimalPoint, int subsequentWidth) { super(field, minWidth, maxWidth, SignStyle.NOT_NEGATIVE, subsequentWidth); this.decimalPoint = decimalPoint; + ValueRange range = field.range(); + this.minBD = BigDecimal.valueOf(range.getMinimum()); + this.rangeBD = BigDecimal.valueOf(range.getMaximum()).subtract(minBD).add(BigDecimal.ONE); } /** @@ -3217,12 +3460,12 @@ public final class DateTimeFormatterBuilder { } else { int outputScale = Math.min(Math.max(fraction.scale(), minWidth), maxWidth); fraction = fraction.setScale(outputScale, RoundingMode.FLOOR); - String str = fraction.toPlainString().substring(2); - str = decimalStyle.convertNumberToI18N(str); if (decimalPoint) { buf.append(decimalStyle.getDecimalSeparator()); } - buf.append(str); + String str = fraction.toPlainString(); + str = decimalStyle.convertNumberToI18N(str); + buf.append(str, 2, str.length()); } return true; } @@ -3284,10 +3527,7 @@ public final class DateTimeFormatterBuilder { * @throws DateTimeException if the value cannot be converted to a fraction */ private BigDecimal convertToFraction(long value) { - ValueRange range = field.range(); - range.checkValidValue(value, field); - BigDecimal minBD = BigDecimal.valueOf(range.getMinimum()); - BigDecimal rangeBD = BigDecimal.valueOf(range.getMaximum()).subtract(minBD).add(BigDecimal.ONE); + field.range().checkValidValue(value, field); BigDecimal valueBD = BigDecimal.valueOf(value).subtract(minBD); BigDecimal fraction = valueBD.divide(rangeBD, 9, RoundingMode.FLOOR); // stripTrailingZeros bug @@ -3311,9 +3551,6 @@ public final class DateTimeFormatterBuilder { * @throws DateTimeException if the value cannot be converted */ private long convertFromFraction(BigDecimal fraction) { - ValueRange range = field.range(); - BigDecimal minBD = BigDecimal.valueOf(range.getMinimum()); - BigDecimal rangeBD = BigDecimal.valueOf(range.getMaximum()).subtract(minBD).add(BigDecimal.ONE); BigDecimal valueBD = fraction.multiply(rangeBD).setScale(0, RoundingMode.FLOOR).add(minBD); return valueBD.longValueExact(); } diff --git a/src/java.base/share/classes/java/time/format/DateTimePrintContext.java b/src/java.base/share/classes/java/time/format/DateTimePrintContext.java index 0faec561724..c7eed23b7bc 100644 --- a/src/java.base/share/classes/java/time/format/DateTimePrintContext.java +++ b/src/java.base/share/classes/java/time/format/DateTimePrintContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -98,11 +98,11 @@ final class DateTimePrintContext { /** * The temporal being output. */ - private TemporalAccessor temporal; + private final TemporalAccessor temporal; /** * The formatter, not null. */ - private DateTimeFormatter formatter; + private final DateTimeFormatter formatter; /** * Whether the current formatter is optional. */ diff --git a/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java b/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java index d95591ac520..4dbca06709d 100644 --- a/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/TestFractionPrinterParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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,9 +59,7 @@ */ package test.java.time.format; -import static java.time.temporal.ChronoField.MILLI_OF_SECOND; -import static java.time.temporal.ChronoField.NANO_OF_SECOND; -import static java.time.temporal.ChronoField.SECOND_OF_MINUTE; +import static java.time.temporal.ChronoField.*; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; @@ -69,6 +67,7 @@ import java.text.ParsePosition; import java.time.DateTimeException; import java.time.LocalTime; import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; @@ -77,9 +76,9 @@ import org.testng.annotations.Test; import test.java.time.temporal.MockFieldValue; /** - * Test FractionPrinterParser. + * Test formatters obtained with DateTimeFormatterBuilder.appendFraction (FractionPrinterParser, NanosPrinterParser) * - * @bug 8230136 + * @bug 8230136 8276220 */ @Test public class TestFractionPrinterParser extends AbstractTestPrinterParser { @@ -96,12 +95,54 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(EMPTY_DTA, buf); } + @DataProvider(name="OOB_Nanos") + Object[][] provider_oob_nanos() { + return new Object[][]{ + {-1}, + {1_000_000_000}, + {Integer.MIN_VALUE}, + {Integer.MAX_VALUE}, + {Integer.MAX_VALUE + 1L}, + {Long.MAX_VALUE}, + {Long.MIN_VALUE}, + }; + } + + @Test(dataProvider="OOB_Nanos", expectedExceptions=DateTimeException.class) + public void test_print_oob_nanos(long value) throws Exception { + getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(new MockFieldValue(NANO_OF_SECOND, value), buf); + } + + @DataProvider(name="OOB_Micros") + Object[][] provider_oob_micros() { + return new Object[][]{ + {-1}, + {1_000_000}, + {Integer.MIN_VALUE}, + {Integer.MAX_VALUE}, + {Integer.MAX_VALUE + 1L}, + {Long.MAX_VALUE}, + {Long.MIN_VALUE}, + }; + } + + @Test(dataProvider="OOB_Micros", expectedExceptions=DateTimeException.class) + public void test_print_oob_micros(long value) throws Exception { + getFormatter(MICRO_OF_SECOND, 0, 9, true).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf); + } + public void test_print_append() throws Exception { buf.append("EXISTING"); getFormatter(NANO_OF_SECOND, 0, 9, true).formatTo(LocalTime.of(12, 30, 40, 3), buf); assertEquals(buf.toString(), "EXISTING.000000003"); } + public void test_print_append_micros() throws Exception { + buf.append("EXISTING"); + getFormatter(MICRO_OF_SECOND, 0, 6, true).formatTo(LocalTime.of(12, 30, 40, 3000), buf); + assertEquals(buf.toString(), "EXISTING.000003"); + } + //----------------------------------------------------------------------- @DataProvider(name="Nanos") Object[][] provider_nanos() { @@ -125,6 +166,31 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { {0, 9, 1234567, ".001234567"}, {0, 9, 12345678, ".012345678"}, {0, 9, 123456789, ".123456789"}, + {0, 9, 9, ".000000009"}, + {0, 9, 99, ".000000099"}, + {0, 9, 999, ".000000999"}, + {0, 9, 9999, ".000009999"}, + {0, 9, 99999, ".000099999"}, + {0, 9, 999999, ".000999999"}, + {0, 9, 9999999, ".009999999"}, + {0, 9, 99999999, ".099999999"}, + {0, 9, 999999999, ".999999999"}, + {0, 8, 9, ".00000000"}, + {0, 7, 99, ".0000000"}, + {0, 6, 999, ".000000"}, + {0, 5, 9999, ".00000"}, + {0, 4, 99999, ".0000"}, + {0, 3, 999999, ".000"}, + {0, 2, 9999999, ".00"}, + {0, 1, 99999999, ".0"}, + {0, 8, 1, ".00000000"}, + {0, 7, 11, ".0000000"}, + {0, 6, 111, ".000000"}, + {0, 5, 1111, ".00000"}, + {0, 4, 11111, ".0000"}, + {0, 3, 111111, ".000"}, + {0, 2, 1111111, ".00"}, + {0, 1, 11111111, ".0"}, {1, 9, 0, ".0"}, {1, 9, 2, ".000000002"}, @@ -136,6 +202,24 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { {1, 9, 2000000, ".002"}, {1, 9, 20000000, ".02"}, {1, 9, 200000000, ".2"}, + {1, 9, 1, ".000000001"}, + {1, 9, 10, ".00000001"}, + {1, 9, 100, ".0000001"}, + {1, 9, 1000, ".000001"}, + {1, 9, 10000, ".00001"}, + {1, 9, 100000, ".0001"}, + {1, 9, 1000000, ".001"}, + {1, 9, 10000000, ".01"}, + {1, 9, 100000000, ".1"}, + {1, 9, 9, ".000000009"}, + {1, 9, 99, ".000000099"}, + {1, 9, 999, ".000000999"}, + {1, 9, 9999, ".000009999"}, + {1, 9, 99999, ".000099999"}, + {1, 9, 999999, ".000999999"}, + {1, 9, 9999999, ".009999999"}, + {1, 9, 99999999, ".099999999"}, + {1, 9, 999999999, ".999999999"}, {2, 3, 0, ".00"}, {2, 3, 2, ".000"}, @@ -176,6 +260,9 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { {6, 6, 1234567, ".001234"}, {6, 6, 12345678, ".012345"}, {6, 6, 123456789, ".123456"}, + {7, 7, 123456789, ".1234567"}, + {8, 8, 123456789, ".12345678"}, + {9, 9, 123456789, ".123456789"}, }; } @@ -197,6 +284,82 @@ public class TestFractionPrinterParser extends AbstractTestPrinterParser { assertEquals(buf.toString(), (result.startsWith(".") ? result.substring(1) : result)); } + //----------------------------------------------------------------------- + @DataProvider(name="Micros") + Object[][] provider_micros() { + return new Object[][] { + {0, 6, 0, ""}, + {0, 6, 2, ".000002"}, + {0, 6, 20, ".00002"}, + {0, 6, 200, ".0002"}, + {0, 6, 2000, ".002"}, + {0, 6, 20000, ".02"}, + {0, 6, 200000, ".2"}, + {0, 6, 1, ".000001"}, + {0, 6, 12, ".000012"}, + {0, 6, 123, ".000123"}, + {0, 6, 1234, ".001234"}, + {0, 6, 12345, ".012345"}, + {0, 6, 123456, ".123456"}, + {0, 6, 9, ".000009"}, + {0, 6, 99, ".000099"}, + {0, 6, 999, ".000999"}, + {0, 6, 9999, ".009999"}, + {0, 6, 99999, ".099999"}, + {0, 6, 999999, ".999999"}, + {0, 5, 9, ".00000"}, + {0, 4, 99, ".0000"}, + {0, 3, 999, ".000"}, + {0, 2, 9999, ".00"}, + {0, 1, 99999, ".0"}, + {0, 5, 1, ".00000"}, + {0, 4, 11, ".0000"}, + {0, 3, 111, ".000"}, + {0, 2, 1111, ".00"}, + {0, 1, 11111, ".0"}, + + {1, 6, 0, ".0"}, + {1, 6, 2, ".000002"}, + {1, 6, 20, ".00002"}, + {1, 6, 200, ".0002"}, + {1, 6, 2000, ".002"}, + {1, 6, 20000, ".02"}, + {1, 6, 200000, ".2"}, + + {2, 3, 0, ".00"}, + {2, 3, 2, ".000"}, + {2, 3, 20, ".000"}, + {2, 3, 200, ".000"}, + {2, 3, 2000, ".002"}, + {2, 3, 20000, ".02"}, + {2, 3, 200000, ".20"}, + {2, 3, 1, ".000"}, + {2, 3, 12, ".000"}, + {2, 3, 123, ".000"}, + {2, 3, 1234, ".001"}, + {2, 3, 12345, ".012"}, + {2, 3, 123456, ".123"}, + }; + } + + @Test(dataProvider="Micros") + public void test_print_micros(int minWidth, int maxWidth, int value, String result) throws Exception { + getFormatter(MICRO_OF_SECOND, minWidth, maxWidth, true).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf); + if (result == null) { + fail("Expected exception"); + } + assertEquals(buf.toString(), result); + } + + @Test(dataProvider="Micros") + public void test_print_micros_noDecimalPoint(int minWidth, int maxWidth, int value, String result) throws Exception { + getFormatter(MICRO_OF_SECOND, minWidth, maxWidth, false).formatTo(new MockFieldValue(MICRO_OF_SECOND, value), buf); + if (result == null) { + fail("Expected exception"); + } + assertEquals(buf.toString(), (result.startsWith(".") ? result.substring(1) : result)); + } + //----------------------------------------------------------------------- @DataProvider(name="Seconds") Object[][] provider_seconds() { diff --git a/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterBench.java b/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterBench.java new file mode 100644 index 00000000000..6900ee32ee6 --- /dev/null +++ b/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterBench.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.java.time.format; + +import java.time.Duration; +import java.time.Instant; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; + +import java.util.Locale; +import java.util.Random; +import java.util.TimeZone; +import java.util.concurrent.TimeUnit; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Warmup(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 5, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@State(Scope.Benchmark) +public class DateTimeFormatterBench { + + private static final TimeZone TIME_ZONE = TimeZone.getTimeZone("UTC"); + + private static final Instant[] INSTANTS = createInstants(); + + private static final ZonedDateTime[] ZONED_DATE_TIMES = createZonedDateTimes(); + + @Param({ + "HH:mm:ss", + "HH:mm:ss.SSS", + "yyyy-MM-dd'T'HH:mm:ss", + "yyyy-MM-dd'T'HH:mm:ss.SSS" + }) + public String pattern; + + private static Instant[] createInstants() { + // Various instants during the same day + final Instant loInstant = Instant.EPOCH.plus(Duration.ofDays(365*50)); // 2020-01-01 + final Instant hiInstant = loInstant.plus(Duration.ofDays(1)); + final long maxOffsetNanos = Duration.between(loInstant, hiInstant).toNanos(); + final Random random = new Random(0); + return IntStream + .range(0, 1_000) + .mapToObj(ignored -> { + final long offsetNanos = (long) Math.floor(random.nextDouble() * maxOffsetNanos); + return loInstant.plus(offsetNanos, ChronoUnit.NANOS); + }) + .toArray(Instant[]::new); + } + + private static ZonedDateTime[] createZonedDateTimes() { + return Stream.of(INSTANTS) + .map(instant -> ZonedDateTime.ofInstant(instant, TIME_ZONE.toZoneId())) + .toArray(ZonedDateTime[]::new); + } + + private StringBuilder stringBuilder = new StringBuilder(100); + private DateTimeFormatter dateTimeFormatter; + + @Setup + public void setup() { + dateTimeFormatter = DateTimeFormatter + .ofPattern(pattern, Locale.US) + .withZone(TIME_ZONE.toZoneId()); + } + + @Benchmark + public void formatInstants(final Blackhole blackhole) { + for (final Instant instant : INSTANTS) { + stringBuilder.setLength(0); + dateTimeFormatter.formatTo(instant, stringBuilder); + blackhole.consume(stringBuilder); + } + } + + @Benchmark + public void formatZonedDateTime(final Blackhole blackhole) { + for (final ZonedDateTime zonedDateTime : ZONED_DATE_TIMES) { + stringBuilder.setLength(0); + dateTimeFormatter.formatTo(zonedDateTime, stringBuilder); + blackhole.consume(stringBuilder); + } + } +} -- GitLab From 603bba282a089928fd23f8da23a7c1b2d52944ef Mon Sep 17 00:00:00 2001 From: Yumin Qi Date: Wed, 3 Nov 2021 23:16:15 +0000 Subject: [PATCH 181/890] 8271420: Extend CDS custom loader support to Windows platform Reviewed-by: iklam, ccheung --- src/hotspot/share/cds/classListParser.cpp | 4 ++-- .../cds/appcds/loaderConstraints/LoaderConstraintsTest.java | 1 - .../runtime/cds/appcds/test-classes/CustomAppLoader.java | 4 ++-- test/lib/jdk/test/lib/Platform.java | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/cds/classListParser.cpp b/src/hotspot/share/cds/classListParser.cpp index 9fa59284c5f..66e346b1944 100644 --- a/src/hotspot/share/cds/classListParser.cpp +++ b/src/hotspot/share/cds/classListParser.cpp @@ -446,9 +446,9 @@ void ClassListParser::error(const char* msg, ...) { // This function is used for loading classes for customized class loaders // during archive dumping. InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS) { -#if !(defined(_LP64) && (defined(LINUX) || defined(__APPLE__))) +#if !(defined(_LP64) && (defined(LINUX) || defined(__APPLE__) || defined(_WINDOWS))) // The only supported platforms are: (1) Linux/64-bit and (2) Solaris/64-bit and - // (3) MacOSX/64-bit + // (3) MacOSX/64-bit and (4) Windowss/64-bit // This #if condition should be in sync with the areCustomLoadersSupportedForCDS // method in test/lib/jdk/test/lib/Platform.java. error("AppCDS custom class loaders not supported on this platform"); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/LoaderConstraintsTest.java b/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/LoaderConstraintsTest.java index 8163cf5be66..c9108f67f79 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/LoaderConstraintsTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/LoaderConstraintsTest.java @@ -51,7 +51,6 @@ import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import jdk.test.lib.Asserts; import jdk.test.lib.helpers.ClassFileInstaller; -import jdk.test.lib.Platform; public class LoaderConstraintsTest { static String mainClass = LoaderConstraintsApp.class.getName(); diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/CustomAppLoader.java b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/CustomAppLoader.java index 50e8c8a730b..73729096b2d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/CustomAppLoader.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/CustomAppLoader.java @@ -40,7 +40,7 @@ public class CustomAppLoader { // args[2...] = arguments for the main class public static void main(String args[]) throws Throwable { File f = new File(args[0]); - URL[] classLoaderUrls = new URL[] {new URL("file://" + f.getCanonicalPath())}; + URL[] classLoaderUrls = new URL[] {f.getAbsoluteFile().toURI().toURL()}; URLClassLoader loader = new URLClassLoader(classLoaderUrls, CustomAppLoader.class.getClassLoader()); Class k = Class.forName(args[1], true, loader); Class parameterTypes[] = new Class[] {String[].class}; @@ -52,4 +52,4 @@ public class CustomAppLoader { } mainMethod.invoke(null, invokeArgs); } -} \ No newline at end of file +} diff --git a/test/lib/jdk/test/lib/Platform.java b/test/lib/jdk/test/lib/Platform.java index 3983ac6327a..7666fdcc459 100644 --- a/test/lib/jdk/test/lib/Platform.java +++ b/test/lib/jdk/test/lib/Platform.java @@ -387,6 +387,6 @@ public class Platform { * This should match the #if condition in ClassListParser::load_class_from_source(). */ public static boolean areCustomLoadersSupportedForCDS() { - return (is64bit() && (isLinux() || isOSX())); + return (is64bit() && (isLinux() || isOSX() || isWindows())); } } -- GitLab From 558ee40a4ac158e5be8269c87b7e18af77dd14c5 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Thu, 4 Nov 2021 04:34:07 +0000 Subject: [PATCH 182/890] 8276615: Update CR number of some tests in ProblemList-zgc.txt Reviewed-by: dholmes --- test/hotspot/jtreg/ProblemList-zgc.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-zgc.txt b/test/hotspot/jtreg/ProblemList-zgc.txt index 1032c144e59..5a92dbd5daa 100644 --- a/test/hotspot/jtreg/ProblemList-zgc.txt +++ b/test/hotspot/jtreg/ProblemList-zgc.txt @@ -29,9 +29,9 @@ vmTestbase/jit/escape/AdaptiveBlocking/AdaptiveBlocking001/AdaptiveBlocking001.java 8260303 windows-x64 -resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8220624 generic-all -serviceability/sa/CDSJMapClstats.java 8220624 generic-all -serviceability/sa/ClhsdbJhisto.java 8220624 generic-all +resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8276539 generic-all +serviceability/sa/CDSJMapClstats.java 8276539 generic-all +serviceability/sa/ClhsdbJhisto.java 8276539 generic-all serviceability/sa/ClhsdbCDSCore.java 8268722 macosx-x64 serviceability/sa/ClhsdbFindPC.java#xcomp-core 8268722 macosx-x64 -- GitLab From fb0be81f0148d9aea73321a0c2bd83b2e477d952 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 4 Nov 2021 08:03:51 +0000 Subject: [PATCH 183/890] 8276096: Simplify Unsafe.{load|store}Fence fallbacks by delegating to fullFence Reviewed-by: psandoz, aph, dholmes --- src/hotspot/share/classfile/vmIntrinsics.hpp | 4 ++-- src/hotspot/share/prims/unsafe.cpp | 10 ---------- .../share/classes/jdk/internal/misc/Unsafe.java | 11 ++++++++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index 632a6344138..20f2cba7228 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -517,10 +517,10 @@ class methodHandle; do_intrinsic(_copyMemory, jdk_internal_misc_Unsafe, copyMemory_name, copyMemory_signature, F_RN) \ do_name( copyMemory_name, "copyMemory0") \ do_signature(copyMemory_signature, "(Ljava/lang/Object;JLjava/lang/Object;JJ)V") \ - do_intrinsic(_loadFence, jdk_internal_misc_Unsafe, loadFence_name, loadFence_signature, F_RN) \ + do_intrinsic(_loadFence, jdk_internal_misc_Unsafe, loadFence_name, loadFence_signature, F_R) \ do_name( loadFence_name, "loadFence") \ do_alias( loadFence_signature, void_method_signature) \ - do_intrinsic(_storeFence, jdk_internal_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \ + do_intrinsic(_storeFence, jdk_internal_misc_Unsafe, storeFence_name, storeFence_signature, F_R) \ do_name( storeFence_name, "storeFence") \ do_alias( storeFence_signature, void_method_signature) \ do_intrinsic(_storeStoreFence, jdk_internal_misc_Unsafe, storeStoreFence_name, storeStoreFence_signature, F_R) \ diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp index ade9651bcb8..814a8e0ed3f 100644 --- a/src/hotspot/share/prims/unsafe.cpp +++ b/src/hotspot/share/prims/unsafe.cpp @@ -322,14 +322,6 @@ DEFINE_GETSETOOP_VOLATILE(jdouble, Double); #undef DEFINE_GETSETOOP_VOLATILE -UNSAFE_LEAF(void, Unsafe_LoadFence(JNIEnv *env, jobject unsafe)) { - OrderAccess::acquire(); -} UNSAFE_END - -UNSAFE_LEAF(void, Unsafe_StoreFence(JNIEnv *env, jobject unsafe)) { - OrderAccess::release(); -} UNSAFE_END - UNSAFE_LEAF(void, Unsafe_FullFence(JNIEnv *env, jobject unsafe)) { OrderAccess::fence(); } UNSAFE_END @@ -909,8 +901,6 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { {CC "shouldBeInitialized0", CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized0)}, - {CC "loadFence", CC "()V", FN_PTR(Unsafe_LoadFence)}, - {CC "storeFence", CC "()V", FN_PTR(Unsafe_StoreFence)}, {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, }; diff --git a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java index 284ebc0d36e..47e8bf80c50 100644 --- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java +++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java @@ -3395,7 +3395,10 @@ public final class Unsafe { * @since 1.8 */ @IntrinsicCandidate - public native void loadFence(); + public final void loadFence() { + // If loadFence intrinsic is not available, fall back to full fence. + fullFence(); + } /** * Ensures that loads and stores before the fence will not be reordered with @@ -3406,11 +3409,13 @@ public final class Unsafe { * * Provides a StoreStore barrier followed by a LoadStore barrier. * - * * @since 1.8 */ @IntrinsicCandidate - public native void storeFence(); + public final void storeFence() { + // If storeFence intrinsic is not available, fall back to full fence. + fullFence(); + } /** * Ensures that loads and stores before the fence will not be reordered -- GitLab From 9eadcbb47e902f42d933ba68e24f2bfb0ee20915 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 4 Nov 2021 08:08:07 +0000 Subject: [PATCH 184/890] 8276217: Harmonize StrictMath intrinsics handling Reviewed-by: aph, kvn --- .../cpu/aarch64/c1_LIRGenerator_aarch64.cpp | 6 ++- src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp | 3 +- src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp | 4 +- src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp | 6 ++- src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp | 12 +++-- src/hotspot/share/c1/c1_Compiler.cpp | 1 + src/hotspot/share/c1/c1_GraphBuilder.cpp | 1 + src/hotspot/share/c1/c1_LIRGenerator.cpp | 1 + src/hotspot/share/classfile/vmIntrinsics.cpp | 13 ++++- src/hotspot/share/classfile/vmIntrinsics.hpp | 10 ++++ .../share/interpreter/abstractInterpreter.cpp | 9 +--- .../share/interpreter/abstractInterpreter.hpp | 1 + src/hotspot/share/oops/method.cpp | 15 ------ src/hotspot/share/opto/c2compiler.cpp | 7 +++ src/hotspot/share/opto/library_call.cpp | 54 ++++++++++++++----- 15 files changed, 98 insertions(+), 45 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp index 700cda5d466..59adb698d5e 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp @@ -769,14 +769,16 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { } switch (x->id()) { case vmIntrinsics::_dabs: - case vmIntrinsics::_dsqrt: { + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: { assert(x->number_of_arguments() == 1, "wrong type"); LIRItem value(x->argument_at(0), this); value.load_item(); LIR_Opr dst = rlock_result(x); switch (x->id()) { - case vmIntrinsics::_dsqrt: { + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: { __ sqrt(value.result(), dst, LIR_OprFact::illegalOpr); break; } diff --git a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp index 7697934b718..cfde3451f5b 100644 --- a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp @@ -788,7 +788,8 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { return; #endif // __SOFTFP__ } - case vmIntrinsics::_dsqrt: { + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: { #ifdef __SOFTFP__ runtime_func = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt); break; diff --git a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp index 6d71c87d3e7..b4cd4694068 100644 --- a/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp @@ -722,7 +722,8 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { __ abs(value.result(), dst, LIR_OprFact::illegalOpr); break; } - case vmIntrinsics::_dsqrt: { + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: { if (VM_Version::has_fsqrt()) { assert(x->number_of_arguments() == 1, "wrong type"); LIRItem value(x->argument_at(0), this); @@ -743,6 +744,7 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { address runtime_entry = NULL; switch (x->id()) { case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt); break; case vmIntrinsics::_dsin: diff --git a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp index c6d5085079f..69b0a5f185c 100644 --- a/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp @@ -629,14 +629,16 @@ LIR_Opr LIRGenerator::atomic_add(BasicType type, LIR_Opr addr, LIRItem& value) { void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { switch (x->id()) { case vmIntrinsics::_dabs: - case vmIntrinsics::_dsqrt: { + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: { assert(x->number_of_arguments() == 1, "wrong type"); LIRItem value(x->argument_at(0), this); value.load_item(); LIR_Opr dst = rlock_result(x); switch (x->id()) { - case vmIntrinsics::_dsqrt: { + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: { __ sqrt(value.result(), dst, LIR_OprFact::illegalOpr); break; } diff --git a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp index 0c7428e456d..6f1cbe17395 100644 --- a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp @@ -813,9 +813,15 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { #endif switch(x->id()) { - case vmIntrinsics::_dabs: __ abs (calc_input, calc_result, tmp); break; - case vmIntrinsics::_dsqrt: __ sqrt (calc_input, calc_result, LIR_OprFact::illegalOpr); break; - default: ShouldNotReachHere(); + case vmIntrinsics::_dabs: + __ abs(calc_input, calc_result, tmp); + break; + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: + __ sqrt(calc_input, calc_result, LIR_OprFact::illegalOpr); + break; + default: + ShouldNotReachHere(); } if (use_fpu) { diff --git a/src/hotspot/share/c1/c1_Compiler.cpp b/src/hotspot/share/c1/c1_Compiler.cpp index f60db13e7bf..382f014aca7 100644 --- a/src/hotspot/share/c1/c1_Compiler.cpp +++ b/src/hotspot/share/c1/c1_Compiler.cpp @@ -155,6 +155,7 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) { case vmIntrinsics::_currentThread: case vmIntrinsics::_dabs: case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index 36169af0d6c..9afabb75060 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.cpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp @@ -3220,6 +3220,7 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) switch (scope->method()->intrinsic_id()) { case vmIntrinsics::_dabs : // fall through case vmIntrinsics::_dsqrt : // fall through + case vmIntrinsics::_dsqrt_strict : // fall through case vmIntrinsics::_dsin : // fall through case vmIntrinsics::_dcos : // fall through case vmIntrinsics::_dtan : // fall through diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 0465a5e3cde..f9a7bf69078 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -2951,6 +2951,7 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { case vmIntrinsics::_dlog10: // fall through case vmIntrinsics::_dabs: // fall through case vmIntrinsics::_dsqrt: // fall through + case vmIntrinsics::_dsqrt_strict: // fall through case vmIntrinsics::_dtan: // fall through case vmIntrinsics::_dsin : // fall through case vmIntrinsics::_dcos : // fall through diff --git a/src/hotspot/share/classfile/vmIntrinsics.cpp b/src/hotspot/share/classfile/vmIntrinsics.cpp index c15e1154b13..88f38f406ad 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.cpp +++ b/src/hotspot/share/classfile/vmIntrinsics.cpp @@ -81,6 +81,7 @@ bool vmIntrinsics::preserves_state(vmIntrinsics::ID id) { case vmIntrinsics::_iabs: case vmIntrinsics::_labs: case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: @@ -127,6 +128,7 @@ bool vmIntrinsics::can_trap(vmIntrinsics::ID id) { case vmIntrinsics::_iabs: case vmIntrinsics::_labs: case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: @@ -265,6 +267,7 @@ bool vmIntrinsics::disabled_by_jvm_flags(vmIntrinsics::ID id) { case vmIntrinsics::_iabs: case vmIntrinsics::_labs: case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: case vmIntrinsics::_dsin: case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: @@ -273,14 +276,20 @@ bool vmIntrinsics::disabled_by_jvm_flags(vmIntrinsics::ID id) { case vmIntrinsics::_dpow: case vmIntrinsics::_dlog10: case vmIntrinsics::_datan2: - case vmIntrinsics::_min: - case vmIntrinsics::_max: case vmIntrinsics::_floatToIntBits: case vmIntrinsics::_doubleToLongBits: + case vmIntrinsics::_min: + case vmIntrinsics::_max: case vmIntrinsics::_maxF: case vmIntrinsics::_minF: case vmIntrinsics::_maxD: case vmIntrinsics::_minD: + case vmIntrinsics::_min_strict: + case vmIntrinsics::_max_strict: + case vmIntrinsics::_maxF_strict: + case vmIntrinsics::_minF_strict: + case vmIntrinsics::_maxD_strict: + case vmIntrinsics::_minD_strict: if (!InlineMathNatives) return true; break; case vmIntrinsics::_fmaD: diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index 20f2cba7228..5c79db8a41c 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -190,6 +190,16 @@ class methodHandle; do_intrinsic(_dsignum, java_lang_Math, signum_name, double_double_signature, F_S) \ do_intrinsic(_fsignum, java_lang_Math, signum_name, float_float_signature, F_S) \ \ + /* StrictMath intrinsics, similar to what we have in Math. */ \ + do_intrinsic(_min_strict, java_lang_StrictMath, min_name, int2_int_signature, F_S) \ + do_intrinsic(_max_strict, java_lang_StrictMath, max_name, int2_int_signature, F_S) \ + do_intrinsic(_minF_strict, java_lang_StrictMath, min_name, float2_float_signature, F_S) \ + do_intrinsic(_maxF_strict, java_lang_StrictMath, max_name, float2_float_signature, F_S) \ + do_intrinsic(_minD_strict, java_lang_StrictMath, min_name, double2_double_signature, F_S) \ + do_intrinsic(_maxD_strict, java_lang_StrictMath, max_name, double2_double_signature, F_S) \ + /* Special flavor of dsqrt intrinsic to handle the "native" method in StrictMath. Otherwise the same as in Math. */ \ + do_intrinsic(_dsqrt_strict, java_lang_StrictMath, sqrt_name, double_double_signature, F_SN) \ + \ do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \ do_name( floatToRawIntBits_name, "floatToRawIntBits") \ do_intrinsic(_floatToIntBits, java_lang_Float, floatToIntBits_name, float_int_signature, F_S) \ diff --git a/src/hotspot/share/interpreter/abstractInterpreter.cpp b/src/hotspot/share/interpreter/abstractInterpreter.cpp index 46ffb3705a9..9e327c2d640 100644 --- a/src/hotspot/share/interpreter/abstractInterpreter.cpp +++ b/src/hotspot/share/interpreter/abstractInterpreter.cpp @@ -145,14 +145,9 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan case vmIntrinsics::_dexp: return java_lang_math_exp; case vmIntrinsics::_fmaD: return java_lang_math_fmaD; case vmIntrinsics::_fmaF: return java_lang_math_fmaF; + case vmIntrinsics::_dsqrt: return java_lang_math_sqrt; + case vmIntrinsics::_dsqrt_strict: return native; case vmIntrinsics::_Reference_get: return java_lang_ref_reference_get; - case vmIntrinsics::_dsqrt: - // _dsqrt will be selected for both Math::sqrt and StrictMath::sqrt, but the latter - // is native. Keep treating it like a native method in the interpreter - assert(m->name() == vmSymbols::sqrt_name() && - (m->klass_name() == vmSymbols::java_lang_Math() || - m->klass_name() == vmSymbols::java_lang_StrictMath()), "must be"); - return m->is_native() ? native : java_lang_math_sqrt; case vmIntrinsics::_Object_init: if (RegisterFinalizersAtInit && m->code_size() == 1) { // We need to execute the special return bytecode to check for diff --git a/src/hotspot/share/interpreter/abstractInterpreter.hpp b/src/hotspot/share/interpreter/abstractInterpreter.hpp index 2fb5b97e808..06d35ecd01b 100644 --- a/src/hotspot/share/interpreter/abstractInterpreter.hpp +++ b/src/hotspot/share/interpreter/abstractInterpreter.hpp @@ -149,6 +149,7 @@ class AbstractInterpreter: AllStatic { case vmIntrinsics::_dtan : // fall thru case vmIntrinsics::_dabs : // fall thru case vmIntrinsics::_dsqrt : // fall thru + case vmIntrinsics::_dsqrt_strict : // fall thru case vmIntrinsics::_dlog : // fall thru case vmIntrinsics::_dlog10: // fall thru case vmIntrinsics::_dpow : // fall thru diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index 7b6b7215410..5991d385231 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.cpp @@ -1645,21 +1645,6 @@ void Method::init_intrinsic_id(vmSymbolID klass_id) { // A few slightly irregular cases: switch (klass_id) { - case VM_SYMBOL_ENUM_NAME(java_lang_StrictMath): - // Second chance: check in regular Math. - switch (name_id) { - case VM_SYMBOL_ENUM_NAME(min_name): - case VM_SYMBOL_ENUM_NAME(max_name): - case VM_SYMBOL_ENUM_NAME(sqrt_name): - // pretend it is the corresponding method in the non-strict class: - klass_id = VM_SYMBOL_ENUM_NAME(java_lang_Math); - id = vmIntrinsics::find_id(klass_id, name_id, sig_id, flags); - break; - default: - break; - } - break; - // Signature-polymorphic methods: MethodHandle.invoke*, InvokeDynamic.*., VarHandle case VM_SYMBOL_ENUM_NAME(java_lang_invoke_MethodHandle): case VM_SYMBOL_ENUM_NAME(java_lang_invoke_VarHandle): diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index 83b9766afd6..2e71521e153 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -454,15 +454,19 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt if (!Matcher::match_rule_supported(Op_Whitespace)) return false; break; case vmIntrinsics::_maxF: + case vmIntrinsics::_maxF_strict: if (!Matcher::match_rule_supported(Op_MaxF)) return false; break; case vmIntrinsics::_minF: + case vmIntrinsics::_minF_strict: if (!Matcher::match_rule_supported(Op_MinF)) return false; break; case vmIntrinsics::_maxD: + case vmIntrinsics::_maxD_strict: if (!Matcher::match_rule_supported(Op_MaxD)) return false; break; case vmIntrinsics::_minD: + case vmIntrinsics::_minD_strict: if (!Matcher::match_rule_supported(Op_MinD)) return false; break; case vmIntrinsics::_writeback0: @@ -503,12 +507,15 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_labs: case vmIntrinsics::_datan2: case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: case vmIntrinsics::_dexp: case vmIntrinsics::_dlog: case vmIntrinsics::_dlog10: case vmIntrinsics::_dpow: case vmIntrinsics::_min: case vmIntrinsics::_max: + case vmIntrinsics::_min_strict: + case vmIntrinsics::_max_strict: case vmIntrinsics::_arraycopy: case vmIntrinsics::_indexOfL: case vmIntrinsics::_indexOfU: diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 157d72af6d3..da9e357ac47 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -261,6 +261,7 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_labs: case vmIntrinsics::_datan2: case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: case vmIntrinsics::_dexp: case vmIntrinsics::_dlog: case vmIntrinsics::_dlog10: @@ -270,9 +271,6 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_dsignum: case vmIntrinsics::_fsignum: return inline_math_native(intrinsic_id()); - case vmIntrinsics::_min: - case vmIntrinsics::_max: return inline_min_max(intrinsic_id()); - case vmIntrinsics::_notify: case vmIntrinsics::_notifyAll: return inline_notify(intrinsic_id()); @@ -632,11 +630,21 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_isWhitespace: return inline_character_compare(intrinsic_id()); + case vmIntrinsics::_min: + case vmIntrinsics::_max: + case vmIntrinsics::_min_strict: + case vmIntrinsics::_max_strict: + return inline_min_max(intrinsic_id()); + case vmIntrinsics::_maxF: case vmIntrinsics::_minF: case vmIntrinsics::_maxD: case vmIntrinsics::_minD: - return inline_fp_min_max(intrinsic_id()); + case vmIntrinsics::_maxF_strict: + case vmIntrinsics::_minF_strict: + case vmIntrinsics::_maxD_strict: + case vmIntrinsics::_minD_strict: + return inline_fp_min_max(intrinsic_id()); case vmIntrinsics::_VectorUnaryOp: return inline_vector_nary_operation(1); @@ -1599,7 +1607,9 @@ bool LibraryCallKit::inline_double_math(vmIntrinsics::ID id) { Node* n = NULL; switch (id) { case vmIntrinsics::_dabs: n = new AbsDNode( arg); break; - case vmIntrinsics::_dsqrt: n = new SqrtDNode(C, control(), arg); break; + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: + n = new SqrtDNode(C, control(), arg); break; case vmIntrinsics::_ceil: n = RoundDoubleModeNode::make(_gvn, arg, RoundDoubleModeNode::rmode_ceil); break; case vmIntrinsics::_floor: n = RoundDoubleModeNode::make(_gvn, arg, RoundDoubleModeNode::rmode_floor); break; case vmIntrinsics::_rint: n = RoundDoubleModeNode::make(_gvn, arg, RoundDoubleModeNode::rmode_rint); break; @@ -1742,7 +1752,9 @@ bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { case vmIntrinsics::_ceil: case vmIntrinsics::_floor: case vmIntrinsics::_rint: return Matcher::match_rule_supported(Op_RoundDoubleMode) ? inline_double_math(id) : false; - case vmIntrinsics::_dsqrt: return Matcher::match_rule_supported(Op_SqrtD) ? inline_double_math(id) : false; + case vmIntrinsics::_dsqrt: + case vmIntrinsics::_dsqrt_strict: + return Matcher::match_rule_supported(Op_SqrtD) ? inline_double_math(id) : false; case vmIntrinsics::_dabs: return Matcher::has_match_rule(Op_AbsD) ? inline_double_math(id) : false; case vmIntrinsics::_fabs: return Matcher::match_rule_supported(Op_AbsF) ? inline_math(id) : false; case vmIntrinsics::_iabs: return Matcher::match_rule_supported(Op_AbsI) ? inline_math(id) : false; @@ -1884,7 +1896,7 @@ LibraryCallKit::generate_min_max(vmIntrinsics::ID id, Node* x0, Node* y0) { return xvalue; } - bool want_max = (id == vmIntrinsics::_max); + bool want_max = (id == vmIntrinsics::_max || id == vmIntrinsics::_max_strict); const TypeInt* txvalue = _gvn.type(xvalue)->isa_int(); const TypeInt* tyvalue = _gvn.type(yvalue)->isa_int(); @@ -7061,12 +7073,16 @@ bool LibraryCallKit::inline_fp_min_max(vmIntrinsics::ID id) { switch (id) { case vmIntrinsics::_maxF: case vmIntrinsics::_minF: + case vmIntrinsics::_maxF_strict: + case vmIntrinsics::_minF_strict: assert(callee()->signature()->size() == 2, "minF/maxF has 2 parameters of size 1 each."); a = argument(0); b = argument(1); break; case vmIntrinsics::_maxD: case vmIntrinsics::_minD: + case vmIntrinsics::_maxD_strict: + case vmIntrinsics::_minD_strict: assert(callee()->signature()->size() == 4, "minD/maxD has 2 parameters of size 2 each."); a = round_double_node(argument(0)); b = round_double_node(argument(2)); @@ -7076,11 +7092,25 @@ bool LibraryCallKit::inline_fp_min_max(vmIntrinsics::ID id) { break; } switch (id) { - case vmIntrinsics::_maxF: n = new MaxFNode(a, b); break; - case vmIntrinsics::_minF: n = new MinFNode(a, b); break; - case vmIntrinsics::_maxD: n = new MaxDNode(a, b); break; - case vmIntrinsics::_minD: n = new MinDNode(a, b); break; - default: fatal_unexpected_iid(id); break; + case vmIntrinsics::_maxF: + case vmIntrinsics::_maxF_strict: + n = new MaxFNode(a, b); + break; + case vmIntrinsics::_minF: + case vmIntrinsics::_minF_strict: + n = new MinFNode(a, b); + break; + case vmIntrinsics::_maxD: + case vmIntrinsics::_maxD_strict: + n = new MaxDNode(a, b); + break; + case vmIntrinsics::_minD: + case vmIntrinsics::_minD_strict: + n = new MinDNode(a, b); + break; + default: + fatal_unexpected_iid(id); + break; } set_result(_gvn.transform(n)); return true; -- GitLab From a1f4c428ba1b78a4e18afb87c94a5c731a5aa706 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Thu, 4 Nov 2021 08:53:37 +0000 Subject: [PATCH 185/890] 8276227: ciReplay: SIGSEGV if classfile for replay compilation is not present after JDK-8275868 Reviewed-by: kvn, thartmann, dlong --- src/hotspot/share/ci/ciReplay.cpp | 10 ++- .../compiler/ciReplay/TestNoClassFile.java | 73 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/ciReplay/TestNoClassFile.java diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index 903c42ecea7..b1f5b82c678 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -113,6 +113,7 @@ class CompileReplay : public StackObj { FILE* _stream; Thread* _thread; Handle _protection_domain; + bool _protection_domain_initialized; Handle _loader; GrowableArray _ci_method_records; @@ -140,6 +141,7 @@ class CompileReplay : public StackObj { _thread = THREAD; _loader = Handle(_thread, SystemDictionary::java_system_loader()); _protection_domain = Handle(); + _protection_domain_initialized = false; _stream = fopen(filename, "rt"); if (_stream == NULL) { @@ -874,12 +876,18 @@ class CompileReplay : public StackObj { void process_instanceKlass(TRAPS) { // just load the referenced class Klass* k = parse_klass(CHECK); - if (_protection_domain() == NULL) { + if (!_protection_domain_initialized && k != NULL) { + assert(_protection_domain() == NULL, "must be uninitialized"); // The first entry is the holder class of the method for which a replay compilation is requested. // Use the same protection domain to load all subsequent classes in order to resolve all classes // in signatures of inlinees. This ensures that inlining can be done as stated in the replay file. _protection_domain = Handle(_thread, k->protection_domain()); } + + // Only initialize the protection domain handle with the protection domain of the very first entry. + // This also ensures that older replay files work. + _protection_domain_initialized = true; + if (k == NULL) { return; } diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestNoClassFile.java b/test/hotspot/jtreg/compiler/ciReplay/TestNoClassFile.java new file mode 100644 index 00000000000..be515517e6b --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/TestNoClassFile.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021, 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 8276227 + * @library / /test/lib + * @summary Testing that ciReplay works if we do not find the class files to replay compile. + * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.debug == true & vm.compiler2.enabled + * @modules java.base/jdk.internal.misc + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.ciReplay.TestNoClassFile + */ + +package compiler.ciReplay; + +public class TestNoClassFile extends DumpReplayBase { + + public static void main(String[] args) { + new TestNoClassFile().runTest(TIERED_DISABLED_VM_OPTION); + } + + @Override + public void testAction() { + // Override classpath such that we do not find any class files for replay compilation. Should exit gracefully. + positiveTest("-cp foo", "-XX:+ReplayIgnoreInitErrors"); + } + + @Override + public String getTestClass() { + return NoClassFileMain.class.getName(); + } + +} + +class NoClassFileMain { + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + test(); + } + } + public static void test() { + NoClassFileHelper.bar(); + } +} + +class NoClassFileHelper { + public static int bar() { + return 3; + } +} -- GitLab From c62b3476ce12cea633abead0d6376ea0a05f92f9 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 4 Nov 2021 09:03:21 +0000 Subject: [PATCH 186/890] 8276623: JDK-8275650 accidentally pushed "out" file Reviewed-by: tschatzl, dholmes --- out | Bin 4513 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 out diff --git a/out b/out deleted file mode 100644 index a6975491510071cf25a001374cb40270fa387053..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4513 zcmcIoZBOGk5WcUMU*Qj@J&>sL=DbS%(4*a5b}1lIZgtX0$RutXNaLLCl>PZPc3Wtn zbPKy61a4wK&pb2Z@wj7JR;)mZqX|=JPOFxoF&Ah)!+9a`y(ksKROHig&I)`>=M+yF zZ7egYXg$GKwWO+)= zjsFEuKLcoQL342Ur}aBkZ&`T;mdqI%GBxGJp+OPszqS-i;=hL%f;SS+XUF~QcuBpa zELJ8QtY&F_DRKSnAb(_Z%!ahVO{+GSMBerlAhxPDr@AkpZ`jcDmG%X#(c~gmY1|zeKzXNG6ZTHqy9k}Nl@9R{G6`7L6L>sp7M{2-)f6>?jmz&x=!qYGI|9d!%^Oqfju802D8&)N zb`TLS@*_VaFz}qfCFEWCa1aD>5_^sl`o2fpFpT^M!U^ZaehO{d#u)x=D4R9w$`a!E zLFC3!;5fdUgia8?4-s~~Ac*3?^Sm(h2xyAdocIb&W6sz0Y|3%nAPxg3@U@;OCO+}r z<=h)tAuJ|W(N*D|OqQ?_S>bZS1TS;Y(E^$_`ngM=iAAwofr_>al= z%gJ!ylYoHhk~m6y&r5v&F(F>Xwi5Frd2SSu5U7X;fr}h)tQ)<}nfo&0kdQcr6ok}w z-NYrKAHR`tBTrWRo8fbvIDk}%6BjZ+Awd+n??;BAPj>pywruV zH@eEw0O!Jz2oa0(YN`!h`LuAlet?6i0G zsmto?lL5XOeeA^W=%P3J+_i7YI<;FV9tRR0!RzDGUY0H9thWv?n{Q71RVT4$lTxJX zcG_FO^^s#dwWIgh1ffj>?Tmt^Z}GPiV%M(98`I*LKJb=`eV1q$Xr%-=1bUXuNbc1| zX}=ogC4xrj^o<#Cec+9f-REx<+zX%wf9dtIs}e80*RFc;U2(UO8~gQw8zwI4G34*h zLK#2kE{(SekDJYTLmwC;`!vY+%Srh9%4qr1Jmtyr|w zdu{}6+jBlC@?S!?6&W{FP2UNASqpxMzN~z2Djm;78JPWK{UT!63cIeFL%3pm6Ht(t z*eo4el6Ps*Ym&6E^@RaD_*PMCao4*XWLKwfQ(WEDwq9ypef{iMBi;GKHw0~^WQrPd q4@{A3U9yG?h4fb-iopee@1aweHTG1^Dtj@;dJI?w{&is5lh*(KTEgA{ -- GitLab From 3613ce7c7d5bc8b7d603e1cf6a123588339aed3f Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 4 Nov 2021 10:23:11 +0000 Subject: [PATCH 187/890] 8275586: Zero: Simplify interpreter initialization Reviewed-by: aph, adinn --- src/hotspot/cpu/zero/vm_version_zero.cpp | 4 + src/hotspot/cpu/zero/zeroInterpreter_zero.cpp | 8 -- .../interpreter/zero/bytecodeInterpreter.cpp | 73 +++++-------------- 3 files changed, 22 insertions(+), 63 deletions(-) diff --git a/src/hotspot/cpu/zero/vm_version_zero.cpp b/src/hotspot/cpu/zero/vm_version_zero.cpp index 8b49a084be2..333857afa69 100644 --- a/src/hotspot/cpu/zero/vm_version_zero.cpp +++ b/src/hotspot/cpu/zero/vm_version_zero.cpp @@ -117,4 +117,8 @@ void VM_Version::initialize() { // Not implemented UNSUPPORTED_OPTION(CriticalJNINatives); + UNSUPPORTED_OPTION(UseCompiler); +#ifdef ASSERT + UNSUPPORTED_OPTION(CountCompiledCalls); +#endif } diff --git a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp index 1193102b5e4..f2e8dc2fe23 100644 --- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp @@ -68,14 +68,6 @@ void ZeroInterpreter::initialize_code() { ZeroInterpreterGenerator g(_code); if (PrintInterpreter) print(); } - - // Allow c++ interpreter to do one initialization now that switches are set, etc. - BytecodeInterpreter start_msg(BytecodeInterpreter::initialize); - if (JvmtiExport::can_post_interpreter_events()) { - BytecodeInterpreter::run(&start_msg); - } else { - BytecodeInterpreter::run(&start_msg); - } } void ZeroInterpreter::invoke_method(Method* method, address entry_point, TRAPS) { diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index 59c1aaf311d..d8fac577d59 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -403,25 +403,25 @@ template void BytecodeInterpreter::run(interpreterState istate); template void BytecodeInterpreter::run(interpreterState istate) { - - // In order to simplify some tests based on switches set at runtime - // we invoke the interpreter a single time after switches are enabled - // and set simpler to to test variables rather than method calls or complex - // boolean expressions. - - static int initialized = 0; - static int checkit = 0; - static intptr_t* c_addr = NULL; - static intptr_t c_value; - - if (checkit && *c_addr != c_value) { - os::breakpoint(); - } + intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */ + address pc = istate->bcp(); + jubyte opcode; + intptr_t* locals = istate->locals(); + ConstantPoolCache* cp = istate->constants(); // method()->constants()->cache() +#ifdef LOTS_OF_REGS + JavaThread* THREAD = istate->thread(); +#else +#undef THREAD +#define THREAD istate->thread() +#endif #ifdef ASSERT - if (istate->_msg != initialize) { - assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit"); - } + assert(labs(istate->stack_base() - istate->stack_limit()) == (istate->method()->max_stack() + 1), + "Bad stack limit"); + /* QQQ this should be a stack method so we don't know actual direction */ + assert(topOfStack >= istate->stack_limit() && topOfStack < istate->stack_base(), + "Stack top out of range"); + // Verify linkages. interpreterState l = istate; do { @@ -433,18 +433,6 @@ void BytecodeInterpreter::run(interpreterState istate) { interpreterState orig = istate; #endif - intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */ - address pc = istate->bcp(); - jubyte opcode; - intptr_t* locals = istate->locals(); - ConstantPoolCache* cp = istate->constants(); // method()->constants()->cache() -#ifdef LOTS_OF_REGS - JavaThread* THREAD = istate->thread(); -#else -#undef THREAD -#define THREAD istate->thread() -#endif - #ifdef USELABELS const static void* const opclabels_data[256] = { /* 0x00 */ &&opc_nop, &&opc_aconst_null, &&opc_iconst_m1, &&opc_iconst_0, @@ -531,38 +519,13 @@ void BytecodeInterpreter::run(interpreterState istate) { uintptr_t *dispatch_table = (uintptr_t*)&opclabels_data[0]; #endif /* USELABELS */ -#ifdef ASSERT - // this will trigger a VERIFY_OOP on entry - if (istate->msg() != initialize && ! METHOD->is_static()) { - oop rcvr = LOCALS_OBJECT(0); - VERIFY_OOP(rcvr); - } -#endif - - /* QQQ this should be a stack method so we don't know actual direction */ - guarantee(istate->msg() == initialize || - topOfStack >= istate->stack_limit() && - topOfStack < istate->stack_base(), - "Stack top out of range"); - - assert(!UseCompiler, "Zero does not support compilers"); - assert(!CountCompiledCalls, "Zero does not support counting compiled calls"); - switch (istate->msg()) { case initialize: { - if (initialized++) ShouldNotReachHere(); // Only one initialize call. + ShouldNotCallThis(); return; } - break; case method_entry: { THREAD->set_do_not_unlock(); - // count invocations - assert(initialized, "Interpreter not initialized"); - - if ((istate->_stack_base - istate->_stack_limit) != istate->method()->max_stack() + 1) { - // initialize - os::breakpoint(); - } // Lock method if synchronized. if (METHOD->is_synchronized()) { -- GitLab From ee499632586eabb3dab209645d5b9c781a09034b Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Thu, 4 Nov 2021 11:31:51 +0000 Subject: [PATCH 188/890] 8275534: com.sun.net.httpserver.BasicAuthenticator should check whether "realm" is a quoted string Reviewed-by: michaelm, dfuchs --- .../jdk/internal/net/http/common/Utils.java | 6 +- .../net/httpserver/BasicAuthenticator.java | 25 ++- .../sun/net/httpserver/ServerImpl.java | 23 +-- .../classes/sun/net/httpserver/Utils.java | 91 +++++++++ .../httpserver/BasicAuthenticatorRealm.java | 181 ++++++++++++++++++ .../BasicAuthenticatorExceptionCheck.java | 25 ++- 6 files changed, 317 insertions(+), 34 deletions(-) create mode 100644 src/jdk.httpserver/share/classes/sun/net/httpserver/Utils.java create mode 100644 test/jdk/com/sun/net/httpserver/BasicAuthenticatorRealm.java diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java b/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java index cdeca6d0ad9..c22c36a1eb3 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java @@ -391,7 +391,6 @@ public final class Utils { return new URLPermission(urlString, actionStringBuilder.toString()); } - // ABNF primitives defined in RFC 7230 private static final boolean[] tchar = new boolean[256]; private static final boolean[] fieldvchar = new boolean[256]; @@ -411,7 +410,7 @@ public final class Utils { } /* - * Validates a RFC 7230 field-name. + * Validates an RFC 7230 field-name. */ public static boolean isValidName(String token) { for (int i = 0; i < token.length(); i++) { @@ -472,7 +471,7 @@ public final class Utils { } /* - * Validates a RFC 7230 field-value. + * Validates an RFC 7230 field-value. * * "Obsolete line folding" rule * @@ -495,7 +494,6 @@ public final class Utils { return true; } - @SuppressWarnings("removal") public static int getIntegerNetProperty(String name, int defaultValue) { return AccessController.doPrivileged((PrivilegedAction) () -> diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java index 4b3faf10f8e..ae0ba50f682 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2021, 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,6 +29,7 @@ import java.nio.charset.Charset; import java.util.Base64; import java.util.Objects; +import static sun.net.httpserver.Utils.isQuotedStringContent; import static java.nio.charset.StandardCharsets.UTF_8; /** @@ -49,11 +50,18 @@ public abstract class BasicAuthenticator extends Authenticator { * The Basic authentication credentials (username and password) are decoded * using the platform's {@link Charset#defaultCharset() default character set}. * + * @apiNote The value of the {@code realm} parameter will be embedded in a + * quoted string. + * * @param realm the HTTP Basic authentication realm * @throws NullPointerException if realm is {@code null} - * @throws IllegalArgumentException if realm is an empty string + * @throws IllegalArgumentException if realm is an empty string or is not + * correctly quoted, as specified in + * RFC 7230 section-3.2. Note, any {@code \} character used for + * quoting must itself be quoted in source code. + */ - public BasicAuthenticator (String realm) { + public BasicAuthenticator(String realm) { this(realm, Charset.defaultCharset()); } @@ -65,16 +73,23 @@ public abstract class BasicAuthenticator extends Authenticator { * @apiNote {@code UTF-8} is the recommended charset because its usage is * communicated to the client, and therefore more likely to be used also * by the client. + *

    The value of the {@code realm} parameter will be embedded in a quoted + * string. * * @param realm the HTTP Basic authentication realm * @param charset the {@code Charset} to decode incoming credentials from the client * @throws NullPointerException if realm or charset are {@code null} - * @throws IllegalArgumentException if realm is an empty string + * @throws IllegalArgumentException if realm is an empty string or is not + * correctly quoted, as specified in + * RFC 7230 section-3.2. Note, any {@code \} character used for + * quoting must itself be quoted in source code. */ - public BasicAuthenticator (String realm, Charset charset) { + public BasicAuthenticator(String realm, Charset charset) { Objects.requireNonNull(charset); if (realm.isEmpty()) // implicit NPE check throw new IllegalArgumentException("realm must not be empty"); + if (!isQuotedStringContent(realm)) + throw new IllegalArgumentException("realm invalid: " + realm); this.realm = realm; this.charset = charset; this.isUTF8 = charset.equals(UTF_8); diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java index 928dc7bae99..41d8263c2e8 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java @@ -39,6 +39,7 @@ import java.security.PrivilegedAction; import sun.net.httpserver.HttpConnection.State; import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static sun.net.httpserver.Utils.*; /** * Provides implementation for both HTTP and HTTPS @@ -586,7 +587,7 @@ class ServerImpl implements TimeSource { Headers headers = req.headers(); /* check key for illegal characters */ for (var k : headers.keySet()) { - if (!isValidHeaderKey(k)) { + if (!isValidName(k)) { reject(Code.HTTP_BAD_REQUEST, requestLine, "Header key contains illegal characters"); return; @@ -934,24 +935,4 @@ class ServerImpl implements TimeSource { return secs * 1000; } } - - /* - * Validates a RFC 7230 header-key. - */ - static boolean isValidHeaderKey(String token) { - if (token == null) return false; - - boolean isValidChar; - char[] chars = token.toCharArray(); - String validSpecialChars = "!#$%&'*+-.^_`|~"; - for (char c : chars) { - isValidChar = ((c >= 'a') && (c <= 'z')) || - ((c >= 'A') && (c <= 'Z')) || - ((c >= '0') && (c <= '9')); - if (!isValidChar && validSpecialChars.indexOf(c) == -1) { - return false; - } - } - return !token.isEmpty(); - } } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/Utils.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/Utils.java new file mode 100644 index 00000000000..43dadb84a90 --- /dev/null +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/Utils.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.net.httpserver; + +/** + * Provides utility methods for checking header field names and quoted strings. + */ +public class Utils { + + // ABNF primitives defined in RFC 7230 + private static final boolean[] TCHAR = new boolean[256]; + private static final boolean[] QDTEXT = new boolean[256]; + private static final boolean[] QUOTED_PAIR = new boolean[256]; + + static { + char[] allowedTokenChars = + ("!#$%&'*+-.^_`|~0123456789" + + "abcdefghijklmnopqrstuvwxyz" + + "ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray(); + for (char c : allowedTokenChars) { + TCHAR[c] = true; + } + for (char c = 0x20; c <= 0xFF; c++) { + QDTEXT[c] = true; + } + QDTEXT[0x22] = false; // (") illegal + QDTEXT[0x5c] = false; // (\) illegal + QDTEXT[0x7F] = false; // (DEL) illegal + + for (char c = 0x20; c <= 0xFF; c++) { + QUOTED_PAIR[c] = true; + } + QUOTED_PAIR[0x09] = true; // (\t) legal + QUOTED_PAIR[0x7F] = false; // (DEL) illegal + } + + /* + * Validates an RFC 7230 field-name. + */ + public static boolean isValidName(String token) { + for (int i = 0; i < token.length(); i++) { + char c = token.charAt(i); + if (c > 255 || !TCHAR[c]) { + return false; + } + } + return !token.isEmpty(); + } + + /* + * Validates an RFC 7230 quoted-string. + */ + public static boolean isQuotedStringContent(String token) { + for (int i = 0; i < token.length(); i++) { + char c = token.charAt(i); + if (c > 255) { + return false; + } else if (c == 0x5c) { // check if valid quoted-pair + if (i == token.length() - 1 || !QUOTED_PAIR[token.charAt(i++)]) { + return false; + } + } else if (!QDTEXT[c]) { + return false; // illegal char + } + } + return true; + } +} diff --git a/test/jdk/com/sun/net/httpserver/BasicAuthenticatorRealm.java b/test/jdk/com/sun/net/httpserver/BasicAuthenticatorRealm.java new file mode 100644 index 00000000000..06248e950a5 --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/BasicAuthenticatorRealm.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2021, 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 8275534 + * @summary Check that ISO-8859-1 encoded realm strings are transported correctly + * with HttpURLConnection and HttpClient + * @modules jdk.httpserver + * @library /test/lib + * @run testng/othervm BasicAuthenticatorRealm + */ + +import com.sun.net.httpserver.BasicAuthenticator; +import com.sun.net.httpserver.Headers; +import com.sun.net.httpserver.HttpHandlers; +import com.sun.net.httpserver.HttpServer; +import java.net.Authenticator; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.PasswordAuthentication; +import java.net.Proxy; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse.BodyHandlers; + +import jdk.test.lib.net.URIBuilder; +import org.testng.annotations.Test; + +import static java.net.http.HttpClient.Builder.NO_PROXY; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.testng.Assert.assertEquals; + +public class BasicAuthenticatorRealm { + + static final String REALM = "U\u00ffU@realm"; // non-ASCII char + static final String EXPECTED_AUTH_HEADER_VALUE = "Basic realm=\"U\u00ffU@realm\", charset=\"UTF-8\""; + + static final InetAddress LOOPBACK_ADDR = InetAddress.getLoopbackAddress(); + + @Test + public static void testURLConnection() throws Exception { + var server = HttpServer.create(new InetSocketAddress(LOOPBACK_ADDR, 0), 0); + var handler = HttpHandlers.of(200, Headers.of(), ""); + var context = server.createContext("/test", handler); + var auth = new ServerAuthenticator(REALM); + + context.setAuthenticator(auth); + + try { + server.start(); + var url = uri(server).toURL(); + var connection = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); + assertEquals(connection.getResponseCode(), 401); + assertEquals(connection.getHeaderField("WWW-Authenticate"), EXPECTED_AUTH_HEADER_VALUE); + } finally { + server.stop(0); + } + } + + @Test + public static void testURLConnectionAuthenticated() throws Exception { + var server = HttpServer.create(new InetSocketAddress(LOOPBACK_ADDR, 0), 0); + var handler = HttpHandlers.of(200, Headers.of(), "foo"); + var context = server.createContext("/test", handler); + var auth = new ServerAuthenticator(REALM); + + context.setAuthenticator(auth); + Authenticator.setDefault(new ClientAuthenticator()); + + try { + server.start(); + var url = uri(server).toURL(); + var connection = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY); + assertEquals(connection.getResponseCode(), 200); + assertEquals(connection.getInputStream().readAllBytes(), "foo".getBytes(UTF_8)); + } finally { + server.stop(0); + } + } + + @Test + public static void testHttpClient() throws Exception { + var server = HttpServer.create(new InetSocketAddress(LOOPBACK_ADDR, 0), 0); + var client = HttpClient.newBuilder().proxy(NO_PROXY).build(); + var request = HttpRequest.newBuilder(uri(server)).build(); + var handler = HttpHandlers.of(200, Headers.of(), "foo"); + var context = server.createContext("/test", handler); + var authenticator = new ServerAuthenticator(REALM); + + context.setAuthenticator(authenticator); + + try { + server.start(); + var response = client.send(request, BodyHandlers.ofString(UTF_8)); + assertEquals(response.statusCode(), 401); + assertEquals(response.headers().firstValue("WWW-Authenticate").orElseThrow(), EXPECTED_AUTH_HEADER_VALUE); + } finally { + server.stop(0); + } + } + + @Test + public static void testHttpClientAuthenticated() throws Exception { + var server = HttpServer.create(new InetSocketAddress(LOOPBACK_ADDR, 0), 0); + var request = HttpRequest.newBuilder(uri(server)).build(); + var handler = HttpHandlers.of(200, Headers.of(), "foo"); + var context = server.createContext("/test", handler); + var auth = new ServerAuthenticator(REALM); + var client = HttpClient.newBuilder() + .proxy(NO_PROXY) + .authenticator(new ClientAuthenticator()) + .build(); + + context.setAuthenticator(auth); + + try { + server.start(); + var response = client.send(request, BodyHandlers.ofString(UTF_8)); + assertEquals(response.statusCode(), 200); + assertEquals(response.body(), "foo"); + } finally { + server.stop(0); + } + } + + static class ServerAuthenticator extends BasicAuthenticator { + ServerAuthenticator(String realm) { + super(realm); + } + + @Override + public boolean checkCredentials(String username, String password) { + if (!getRealm().equals(realm)) { + return false; + } + return true; + } + } + + static class ClientAuthenticator extends java.net.Authenticator { + @Override + public PasswordAuthentication getPasswordAuthentication() { + if (!getRequestingPrompt().equals(REALM)) { + throw new RuntimeException("realm does not match"); + } + return new PasswordAuthentication("username", "password".toCharArray()); + } + } + + public static URI uri(HttpServer server) { + return URIBuilder.newBuilder() + .scheme("http") + .host(server.getAddress().getAddress()) + .port(server.getAddress().getPort()) + .path("/test/") + .buildUnchecked(); + } +} diff --git a/test/jdk/com/sun/net/httpserver/bugs/BasicAuthenticatorExceptionCheck.java b/test/jdk/com/sun/net/httpserver/bugs/BasicAuthenticatorExceptionCheck.java index b7043fcd4e6..a07386be746 100644 --- a/test/jdk/com/sun/net/httpserver/bugs/BasicAuthenticatorExceptionCheck.java +++ b/test/jdk/com/sun/net/httpserver/bugs/BasicAuthenticatorExceptionCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -21,12 +21,12 @@ * questions. */ -/** +/* * @test - * @bug 8230159 + * @bug 8230159 8275534 * @library /test/lib * @summary Ensure that correct exceptions are being thrown in - * BasicAuthenticator constructor + * BasicAuthenticator constructor * @run testng BasicAuthenticatorExceptionCheck */ @@ -36,6 +36,7 @@ import com.sun.net.httpserver.BasicAuthenticator; import org.testng.annotations.Test; import static org.testng.Assert.expectThrows; +import static org.testng.Assert.assertEquals; import static java.nio.charset.StandardCharsets.UTF_8; @@ -73,6 +74,7 @@ public class BasicAuthenticatorExceptionCheck { ex = expectThrows(IAE, () -> createBasicAuthenticator("", UTF_8)); + assertEquals(ex.getMessage(), "realm must not be empty"); System.out.println("Empty string for realm and valid charset provided - " + "IllegalArgumentException thrown as expected: " + ex); @@ -83,7 +85,22 @@ public class BasicAuthenticatorExceptionCheck { ex = expectThrows(IAE, () -> createBasicAuthenticator("")); + assertEquals(ex.getMessage(), "realm must not be empty"); System.out.println("Empty string for realm provided - " + "IllegalArgumentException thrown as expected: " + ex); + + ex = expectThrows(IAE, () -> + createBasicAuthenticator("\"/test\"")); + assertEquals(ex.getMessage(), "realm invalid: \"/test\""); + System.out.println("Invalid string for realm provided - " + + "IllegalArgumentException thrown as expected: " + ex); + + ex = expectThrows(IAE, () -> + createBasicAuthenticator("\"")); + assertEquals(ex.getMessage(), "realm invalid: \""); + System.out.println("Invalid string for realm provided - " + + "IllegalArgumentException thrown as expected: " + ex); + + createBasicAuthenticator("\\\"/test\\\""); } } -- GitLab From 7de653e428ee38339ec38533659b23a52e275f3f Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Thu, 4 Nov 2021 12:31:27 +0000 Subject: [PATCH 189/890] 8276301: G1: Refine implementation of G1CardSetFreePool::memory_sizes() Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 24 ++++++--------------- src/hotspot/share/gc/g1/g1CardSetMemory.hpp | 8 +------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index ad21bd548a0..f9ec7161cad 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -140,13 +140,6 @@ G1CardSetMemoryStats::G1CardSetMemoryStats() { clear(); } -G1CardSetMemoryStats::G1CardSetMemoryStats(void(*fn)(const void*,uint,size_t&,size_t&), const void* context) { - clear(); - for (uint i = 0; i < num_pools(); i++) { - fn(context, i, _num_mem_sizes[i], _num_buffers[i]); - } -} - void G1CardSetMemoryStats::clear() { for (uint i = 0; i < num_pools(); i++) { _num_mem_sizes[i] = 0; @@ -277,17 +270,14 @@ G1CardSetFreePool::~G1CardSetFreePool() { FREE_C_HEAP_ARRAY(mtGC, _free_lists); } -static void collect_mem_sizes(const void* context, uint i, size_t& mem_size, size_t& num_buffers) { - ((G1CardSetFreePool*)context)->get_size(i, mem_size, num_buffers); -} - -void G1CardSetFreePool::get_size(uint i, size_t& mem_size, size_t& num_buffers) const { - mem_size = _free_lists[i].mem_size(); - num_buffers = _free_lists[i].num_buffers(); -} - G1CardSetMemoryStats G1CardSetFreePool::memory_sizes() const { - return G1CardSetMemoryStats(collect_mem_sizes, this); + G1CardSetMemoryStats free_list_stats; + assert(free_list_stats.num_pools() == num_free_lists(), "must be"); + for (uint i = 0; i < num_free_lists(); i++) { + free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size(); + free_list_stats._num_buffers[i] = _free_lists[i].num_buffers(); + } + return free_list_stats; } size_t G1CardSetFreePool::mem_size() const { diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp index df64c4af2b8..0b79bfee530 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp @@ -149,9 +149,6 @@ public: // Returns all-zero statistics. G1CardSetMemoryStats(); - // For every element in the set (indicated by i), call fn to provide the - // memory size and number of buffers for that i'th buffer list. - G1CardSetMemoryStats(void (*fn)(const void* context, uint i, size_t& mem_size, size_t& num_buffers), const void* context); void add(G1CardSetMemoryStats const other) { STATIC_ASSERT(ARRAY_SIZE(_num_buffers) == ARRAY_SIZE(_num_mem_sizes)); @@ -171,7 +168,7 @@ class G1CardSetFreePool { // The global free pool. static G1CardSetFreePool _freelist_pool; - uint _num_free_lists; + const uint _num_free_lists; G1CardSetBufferList* _free_lists; public: @@ -193,9 +190,6 @@ public: uint num_free_lists() const { return _num_free_lists; } - // Return sizes for free list i in this free list pool. - void get_size(uint i, size_t& mem_size, size_t& num_buffers) const; - G1CardSetMemoryStats memory_sizes() const; size_t mem_size() const; -- GitLab From 19075b3f6b21f6d3b0624ef8e835b3cfc53228de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 4 Nov 2021 13:06:24 +0000 Subject: [PATCH 190/890] 8275788: Create code element with suitable attributes for code snippets Reviewed-by: prappo --- .../formats/html/TagletWriterImpl.java | 42 ++- .../toolkit/taglets/SnippetTaglet.java | 26 +- .../doclets/toolkit/taglets/TagletWriter.java | 5 +- .../doclet/testSnippetTag/TestSnippetTag.java | 329 +++++++++++------- 4 files changed, 261 insertions(+), 141 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index 4b86fd28ebc..b5992daea7e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -381,24 +381,22 @@ public class TagletWriterImpl extends TagletWriter { } @Override - protected Content snippetTagOutput(Element element, SnippetTree tag, StyledText content) { - String copyText = resources.getText("doclet.Copy_snippet_to_clipboard"); - String copiedText = resources.getText("doclet.Copied_snippet_to_clipboard"); - HtmlTree copy = HtmlTree.DIV(HtmlStyle.snippetContainer, - HtmlTree.A("#", new HtmlTree(TagName.IMG) - .put(HtmlAttr.SRC, htmlWriter.pathToRoot.resolve(DocPaths.CLIPBOARD_SVG).getPath()) - .put(HtmlAttr.ALT, copyText)) - .addStyle(HtmlStyle.snippetCopy) - .put(HtmlAttr.ONCLICK, "copySnippet(this)") - .put(HtmlAttr.ARIA_LABEL, copyText) - .put(HtmlAttr.DATA_COPIED, copiedText)); - HtmlTree pre = new HtmlTree(TagName.PRE) - .setStyle(HtmlStyle.snippet); - pre.add(Text.of(utils.normalizeNewlines("\n"))); + protected Content snippetTagOutput(Element element, SnippetTree tag, StyledText content, + String id, String lang) { + HtmlTree pre = new HtmlTree(TagName.PRE).setStyle(HtmlStyle.snippet); + if (id != null && !id.isBlank()) { + pre.put(HtmlAttr.ID, id); + } + HtmlTree code = new HtmlTree(TagName.CODE) + .add(HtmlTree.EMPTY); // Make sure the element is always rendered + if (lang != null && !lang.isBlank()) { + code.addStyle("language-" + lang); + } + content.consumeBy((styles, sequence) -> { CharSequence text = utils.normalizeNewlines(sequence); if (styles.isEmpty()) { - pre.add(text); + code.add(text); } else { Element e = null; String t = null; @@ -443,10 +441,20 @@ public class TagletWriterImpl extends TagletWriter { c = HtmlTree.SPAN(Text.of(sequence)); classes.forEach(((HtmlTree) c)::addStyle); } - pre.add(c); + code.add(c); } }); - return copy.add(pre); + String copyText = resources.getText("doclet.Copy_snippet_to_clipboard"); + String copiedText = resources.getText("doclet.Copied_snippet_to_clipboard"); + HtmlTree snippetContainer = HtmlTree.DIV(HtmlStyle.snippetContainer, + HtmlTree.A("#", new HtmlTree(TagName.IMG) + .put(HtmlAttr.SRC, htmlWriter.pathToRoot.resolve(DocPaths.CLIPBOARD_SVG).getPath()) + .put(HtmlAttr.ALT, copyText)) + .addStyle(HtmlStyle.snippetCopy) + .put(HtmlAttr.ONCLICK, "copySnippet(this)") + .put(HtmlAttr.ARIA_LABEL, copyText) + .put(HtmlAttr.DATA_COPIED, copiedText)); + return snippetContainer.add(pre.add(code)); } /* diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java index 9fa3a1b0939..9219a78814a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java @@ -261,7 +261,21 @@ public class SnippetTaglet extends BaseTaglet { assert inlineSnippet != null || externalSnippet != null; StyledText text = inlineSnippet != null ? inlineSnippet : externalSnippet; - return writer.snippetTagOutput(holder, snippetTag, text); + String lang = null; + AttributeTree langAttr = attributes.get("lang"); + if (langAttr != null && langAttr.getValueKind() != AttributeTree.ValueKind.EMPTY) { + lang = stringOf(langAttr.getValue()); + } else if (containsClass) { + lang = "java"; + } else if (containsFile) { + lang = languageFromFileName(fileObject.getName()); + } + AttributeTree idAttr = attributes.get("id"); + String id = idAttr == null || idAttr.getValueKind() == AttributeTree.ValueKind.EMPTY + ? null + : stringOf(idAttr.getValue()); + + return writer.snippetTagOutput(holder, snippetTag, text, id, lang); } /* @@ -298,6 +312,16 @@ public class SnippetTaglet extends BaseTaglet { .collect(Collectors.joining()); } + private String languageFromFileName(String fileName) { + // TODO: find a way to extend/customize the list of recognized file name extensions + if (fileName.endsWith(".java")) { + return "java"; + } else if (fileName.endsWith(".properties")) { + return "properties"; + } + return null; + } + private void error(TagletWriter writer, Element holder, DocTree tag, String key, Object... args) { writer.configuration().getMessages().error( writer.configuration().utils.getCommentHelper(holder).getDocTreePath(tag), key, args); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java index ca4ad2064c1..a12c7b42ffd 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java @@ -181,10 +181,13 @@ public abstract class TagletWriter { * * @param element The element that owns the doc comment * @param snippetTag the snippet tag + * @param id the value of the id attribute, or null if not defined + * @param lang the value of the lang attribute, or null if not defined * * @return the output */ - protected abstract Content snippetTagOutput(Element element, SnippetTree snippetTag, StyledText text); + protected abstract Content snippetTagOutput(Element element, SnippetTree snippetTag, StyledText text, + String id, String lang); /** * Returns the output for a {@code {@systemProperty...}} tag. diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index 7aab8ff19b1..19d36d41e7e 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8266666 + * @bug 8266666 8275788 * @summary Implementation for snippets * @library /tools/lib ../../lib * @modules jdk.compiler/com.sun.tools.javac.api @@ -84,144 +84,237 @@ public class TestSnippetTag extends JavadocTester { } /* - * While the "id" and "lang" attributes are advertised in JEP 413, they are - * currently unused by the implementation. The goal of this test is to make - * sure that specifying these attributes causes no errors and exhibits no - * unexpected behavior. + * Make sure the "id" and "lang" attributes defined in JEP 413 are rendered + * properly as recommended by the HTML5 specification. */ @Test public void testIdAndLangAttributes(Path base) throws IOException { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); + + // A record of a snippet content and matching expected attribute values + record SnippetAttributes(String content, String id, String lang) { + public String idAttribute() { + return id == null ? "" : " id=\"" + id + "\""; + } + public String langAttribute() { + return lang == null ? "" : " class=\"language-" + lang + "\""; + } + } + final var snippets = List.of( - """ - {@snippet id="foo" : - Hello, Snippet! - } - """, - """ - {@snippet id="foo": - Hello, Snippet! - } - """, - """ - {@snippet id='foo' : - Hello, Snippet! - } - """, - """ - {@snippet id='foo': - Hello, Snippet! - } - """, - """ - {@snippet id=foo : - Hello, Snippet! - } - """, + new SnippetAttributes(""" + {@snippet id="foo1" : + Hello, Snippet! + } + """, "foo1", null), + new SnippetAttributes(""" + {@snippet id="foo2": + Hello, Snippet! + } + """, "foo2", null), + new SnippetAttributes(""" + {@snippet id='foo3' : + Hello, Snippet! + } + """, "foo3", null), + new SnippetAttributes(""" + {@snippet id='foo4': + Hello, Snippet! + } + """, "foo4", null), + new SnippetAttributes(""" + {@snippet id=foo5 : + Hello, Snippet! + } + """, "foo5", null), // (1) Haven't yet decided on this one. It's a consistency issue. On the one // hand, `:` is considered a part of a javadoc tag's name (e.g. JDK-4750173); // on the other hand, snippet markup treats `:` (next-line modifier) as a value // terminator. -// """ -// {@snippet id=foo: -// Hello, Snippet! -// } -// """, - """ - {@snippet id="" : - Hello, Snippet! - } - """, - """ - {@snippet id="": - Hello, Snippet! - } - """, - """ - {@snippet id='': - Hello, Snippet! - } - """, - """ - {@snippet id=: - Hello, Snippet! - } - """, - """ - {@snippet lang="java" : - Hello, Snippet! - } - """, - """ - {@snippet lang="java": - Hello, Snippet! - } - """, - """ - {@snippet lang='java' : - Hello, Snippet! - } - """, - """ - {@snippet lang='java': - Hello, Snippet! - } - """, - """ - {@snippet lang=java : - Hello, Snippet! - } - """, - """ - {@snippet lang="properties" : - Hello, Snippet! - } - """, - """ - {@snippet lang="text" : - Hello, Snippet! - } - """, - """ - {@snippet lang="" : - Hello, Snippet! - } - """, - """ - {@snippet lang="foo" id="bar" : - Hello, Snippet! - } - """ +// new SnippetAttributes(""" +// {@snippet id=foo6: +// Hello, Snippet! +// } +// """, "foo6", null), + + new SnippetAttributes(""" + {@snippet id="" : + Hello, Snippet! + } + """, null, null), + new SnippetAttributes(""" + {@snippet id="": + Hello, Snippet! + } + """, null, null), + new SnippetAttributes(""" + {@snippet id='': + Hello, Snippet! + } + """, null, null), + new SnippetAttributes(""" + {@snippet id=: + Hello, Snippet! + } + """, null, null), + new SnippetAttributes(""" + {@snippet lang="java" : + Hello, Snippet! + } + """, null, "java"), + new SnippetAttributes(""" + {@snippet lang="java": + Hello, Snippet! + } + """, null, "java"), + new SnippetAttributes(""" + {@snippet lang='java' : + Hello, Snippet! + } + """, null, "java"), + new SnippetAttributes(""" + {@snippet lang='java': + Hello, Snippet! + } + """, null, "java"), + new SnippetAttributes(""" + {@snippet lang=java : + Hello, Snippet! + } + """, null, "java"), + new SnippetAttributes(""" + {@snippet lang="properties" : + Hello, Snippet! + } + """, null, "properties"), + new SnippetAttributes(""" + {@snippet lang="text" : + Hello, Snippet! + } + """, null, "text"), + new SnippetAttributes(""" + {@snippet lang="" : + Hello, Snippet! + } + """, null, null), + new SnippetAttributes(""" + {@snippet lang="foo" id="bar" : + Hello, Snippet! + } + """, "bar", "foo") ); ClassBuilder classBuilder = new ClassBuilder(tb, "pkg.A") .setModifiers("public", "class"); forEachNumbered(snippets, (s, i) -> { classBuilder.addMembers( MethodBuilder.parse("public void case%s() { }".formatted(i)) - .setComments(s)); + .setComments("A method.", s.content())); }); classBuilder.write(srcDir); javadoc("-d", outDir.toString(), "-sourcepath", srcDir.toString(), "pkg"); checkExit(Exit.OK); + checkLinks(); for (int j = 0; j < snippets.size(); j++) { + SnippetAttributes snippet = snippets.get(j); checkOutput("pkg/A.html", true, """ case%s() -

    +
    A method. + \s
    Copy -
    -                            Hello, Snippet!
    -                        
    +
        Hello, Snippet!
    +                        
    - """.formatted(j)); + """.formatted(j, snippet.idAttribute(), snippet.langAttribute())); } } + /* + * Make sure the lang attribute is derived correctly from the snippet source file + * for external snippets when it is not defined in the snippet. Defining the lang + * attribute in the snippet should always override this mechanism. + */ + @Test + public void testExternalImplicitAttributes(Path base) throws IOException { + Path srcDir = base.resolve("src"); + Path outDir = base.resolve("out"); + + ClassBuilder classBuilder = new ClassBuilder(tb, "com.example.Cls") + .setModifiers("public", "class"); + classBuilder.setComments(""" + {@snippet class="Snippets" region="code" id="snippet1"} + {@snippet file="Snippets.java" region="code" id="snippet2"} + {@snippet class="Snippets" region="code" id="snippet3" lang="none"} + {@snippet file="Snippets.java" region="code" id="snippet4" lang="none"} + {@snippet class="Snippets" region="code" id="snippet5" lang=""} + {@snippet file="Snippets.java" region="code" id="snippet6" lang=""} + {@snippet file="user.properties" id="snippet7"} + {@snippet file="user.properties" id="snippet8" lang="none"} + {@snippet file="user.properties" id="snippet9" lang=""} + """); + addSnippetFile(srcDir, "com.example", "Snippets.java", """ + public class Snippets { + public static void printMessage(String msg) { + // @start region="code" + System.out.println(msg); + // @end + } + } + """); + addSnippetFile(srcDir, "com.example", "user.properties", """ + user=jane + home=/home/jane + """); + classBuilder.write(srcDir); + javadoc("-d", outDir.toString(), + "-sourcepath", srcDir.toString(), + "com.example"); + checkExit(Exit.OK); + checkLinks(); + checkOutput("com/example/Cls.html", true, + """ +
    
    +                    System.out.println(msg);
    +                    
    """, + """ +
    
    +                    System.out.println(msg);
    +                    
    """, + """ +
    
    +                    System.out.println(msg);
    +                    
    """, + """ +
    
    +                    System.out.println(msg);
    +                    
    """, + """ +
    
    +                    System.out.println(msg);
    +                    
    """, + """ +
    
    +                    System.out.println(msg);
    +                    
    """, + """ +
    user=jane
    +                    home=/home/jane
    +                    
    """, + """ +
    user=jane
    +                    home=/home/jane
    +                    
    """, + """ +
    user=jane
    +                    home=/home/jane
    +                    
    """); + } + /* * This is a convenience method to iterate through a list. * Unlike List.forEach, this method provides the consumer not only with an @@ -858,8 +951,7 @@ public class TestSnippetTag extends JavadocTester {
    Copy -
    -                        %s
    +
    %s
    """.formatted(id, t.expectedOutput())); }); } @@ -955,8 +1047,7 @@ public class TestSnippetTag extends JavadocTester {
    Copy -
    -                        %s
    +
    %s
    """.formatted(index, expectedOutput)); }); } @@ -1517,8 +1608,7 @@ public class TestSnippetTag extends JavadocTester {
    Copy -
    -                        %s
    +
    %s
    """.formatted(index, t.expectedOutput())); }); } @@ -1635,8 +1725,7 @@ public class TestSnippetTag extends JavadocTester {
    \
                     Copy -
    -                    
    +
    """); checkOutput("pkg/A.html", true, """ @@ -1645,8 +1734,7 @@ public class TestSnippetTag extends JavadocTester {
    \
                     Copy -
    -                    
    +
    """); } @@ -1747,8 +1835,7 @@ public class TestSnippetTag extends JavadocTester {
    Copy -
    -                        2
    +
    2
    """.formatted(j)); } @@ -1832,8 +1919,7 @@ public class TestSnippetTag extends JavadocTester {
    Copy -
    -                        %s
    +
    %s
    """.formatted(index, t.expectedOutput())); }); } @@ -2165,8 +2251,7 @@ public class TestSnippetTag extends JavadocTester {
    Copy -
    -                        %s
    +
    %s
    """.formatted(index, t.expectedOutput())); }); } -- GitLab From a6fa6ed1edc6f473a7fea1fa00edd467ab778983 Mon Sep 17 00:00:00 2001 From: Per Liden Date: Thu, 4 Nov 2021 13:47:59 +0000 Subject: [PATCH 191/890] 8268779: ZGC: runtime/InternalApi/ThreadCpuTimesDeadlock.java#id1 failed with "OutOfMemoryError: Java heap space" Reviewed-by: eosterlund, stefank --- src/hotspot/share/gc/z/zDriver.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/share/gc/z/zDriver.cpp b/src/hotspot/share/gc/z/zDriver.cpp index 2ed482f3085..30fdeb6804f 100644 --- a/src/hotspot/share/gc/z/zDriver.cpp +++ b/src/hotspot/share/gc/z/zDriver.cpp @@ -493,6 +493,11 @@ void ZDriver::run_service() { // Run GC gc(request); + if (should_terminate()) { + // Abort + break; + } + // Notify GC completed _gc_cycle_port.ack(); -- GitLab From 5acff75379a4ad0acfcfc6a64fcc4b588ef048c7 Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Thu, 4 Nov 2021 15:01:26 +0000 Subject: [PATCH 192/890] 8276429: CodeHeapState::print_names() fails with "assert(klass->is_loader_alive()) failed: must be alive" Reviewed-by: kvn --- src/hotspot/share/code/codeHeapState.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/code/codeHeapState.cpp b/src/hotspot/share/code/codeHeapState.cpp index 1c5cd874b2c..d76ef9d1140 100644 --- a/src/hotspot/share/code/codeHeapState.cpp +++ b/src/hotspot/share/code/codeHeapState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -2335,11 +2335,11 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) { Symbol* methSig = method->signature(); const char* methSigS = (methSig == NULL) ? NULL : methSig->as_C_string(); methSigS = (methSigS == NULL) ? "" : methSigS; - Klass* klass = method->method_holder(); - assert(klass->is_loader_alive(), "must be alive"); + assert(klass != nullptr, "No method holder"); + const char* classNameS = (klass->name() == nullptr) ? "" : klass->external_name(); - ast->print("%s.", klass->external_name()); + ast->print("%s.", classNameS); ast->print("%s", methNameS); ast->print("%s", methSigS); } else { -- GitLab From 49b7b2ea0971fe99567bdbd962d63b90ff2eeefd Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 4 Nov 2021 15:06:08 +0000 Subject: [PATCH 193/890] 8276640: Use blessed modifier order in jfr code Reviewed-by: mgronlun --- src/jdk.jfr/share/classes/jdk/jfr/internal/FilePurger.java | 4 ++-- src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java | 2 +- .../share/classes/jdk/jfr/internal/PlatformRecorder.java | 4 ++-- src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java | 2 +- .../share/classes/jdk/jfr/internal/instrument/JDKEvents.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/FilePurger.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/FilePurger.java index e5bd2c5c63b..1e9f68c47ca 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/FilePurger.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/FilePurger.java @@ -38,14 +38,14 @@ final class FilePurger { private static final Set paths = new LinkedHashSet<>(); - public synchronized static void add(SafePath p) { + public static synchronized void add(SafePath p) { paths.add(p); if (paths.size() > 1000) { removeOldest(); } } - public synchronized static void purge() { + public static synchronized void purge() { if (paths.isEmpty()) { return; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java index a88b428dac3..b5aff49cbe0 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java @@ -211,7 +211,7 @@ public final class JVM { * * @throws IllegalStateException if wrong JVMTI phase. */ - public native synchronized void retransformClasses(Class[] classes); + public synchronized native void retransformClasses(Class[] classes); /** * Enable event diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java index 716adf4c7a6..ef1d51a0622 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java @@ -143,7 +143,7 @@ public final class PlatformRecorder { return Collections.unmodifiableList(new ArrayList(recordings)); } - public synchronized static void addListener(FlightRecorderListener changeListener) { + public static synchronized void addListener(FlightRecorderListener changeListener) { @SuppressWarnings("removal") AccessControlContext context = AccessController.getContext(); SecureRecorderListener sl = new SecureRecorderListener(context, changeListener); @@ -157,7 +157,7 @@ public final class PlatformRecorder { } } - public synchronized static boolean removeListener(FlightRecorderListener changeListener) { + public static synchronized boolean removeListener(FlightRecorderListener changeListener) { for (SecureRecorderListener s : new ArrayList<>(changeListeners)) { if (s.getChangeListener() == changeListener) { changeListeners.remove(s); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java index c4dc1a7f345..def05bba4c9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java @@ -51,7 +51,7 @@ import jdk.jfr.internal.management.EventSettingsModifier; * java.lang.reflect. */ public abstract class PrivateAccess { - private volatile static PrivateAccess instance; + private static volatile PrivateAccess instance; public static PrivateAccess getInstance() { // Can't be initialized in because it may diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java index 89c9425cb9c..f69db677611 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/instrument/JDKEvents.java @@ -117,7 +117,7 @@ public final class JDKEvents { private static boolean initializationTriggered; @SuppressWarnings("unchecked") - public synchronized static void initialize() { + public static synchronized void initialize() { try { if (initializationTriggered == false) { for (Class mirrorEventClass : mirrorEventClasses) { -- GitLab From afb502e28a81183cef76a7e60fc052e8cad3afe3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 4 Nov 2021 15:41:39 +0000 Subject: [PATCH 194/890] 8276550: Use SHA256 hash in build.tools.depend.Depend Reviewed-by: adinn, aph, andrew, ihse --- make/jdk/src/classes/build/tools/depend/Depend.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/jdk/src/classes/build/tools/depend/Depend.java b/make/jdk/src/classes/build/tools/depend/Depend.java index 2a2a568ef36..74df2af2d57 100644 --- a/make/jdk/src/classes/build/tools/depend/Depend.java +++ b/make/jdk/src/classes/build/tools/depend/Depend.java @@ -102,7 +102,7 @@ public class Depend implements Plugin { private final MessageDigest apiHash; { try { - apiHash = MessageDigest.getInstance("MD5"); + apiHash = MessageDigest.getInstance("SHA-256"); } catch (NoSuchAlgorithmException ex) { throw new IllegalStateException(ex); } -- GitLab From bf4ddf9cb7408db321e7fd73600a5a9a85ca49eb Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Thu, 4 Nov 2021 15:51:37 +0000 Subject: [PATCH 195/890] 8276338: Minor improve of wording for String.to(Lower|Upper)Case Reviewed-by: rriggs, naoto --- src/java.base/share/classes/java/lang/String.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/java.base/share/classes/java/lang/String.java b/src/java.base/share/classes/java/lang/String.java index fd247fa5c76..50e5525bb3e 100644 --- a/src/java.base/share/classes/java/lang/String.java +++ b/src/java.base/share/classes/java/lang/String.java @@ -3329,10 +3329,10 @@ public final class String * Converts all of the characters in this {@code String} to lower * case using the rules of the given {@code Locale}. Case mapping is based * on the Unicode Standard version specified by the {@link java.lang.Character Character} - * class. Since case mappings are not always 1:1 char mappings, the resulting - * {@code String} may be a different length than the original {@code String}. + * class. Since case mappings are not always 1:1 char mappings, the resulting {@code String} + * and this {@code String} may differ in length. *

    - * Examples of lowercase mappings are in the following table: + * Examples of lowercase mappings are in the following table: * * * @@ -3386,7 +3386,7 @@ public final class String /** * Converts all of the characters in this {@code String} to lower - * case using the rules of the default locale. This is equivalent to calling + * case using the rules of the default locale. This method is equivalent to * {@code toLowerCase(Locale.getDefault())}. *

    * Note: This method is locale sensitive, and may produce unexpected @@ -3411,11 +3411,10 @@ public final class String * Converts all of the characters in this {@code String} to upper * case using the rules of the given {@code Locale}. Case mapping is based * on the Unicode Standard version specified by the {@link java.lang.Character Character} - * class. Since case mappings are not always 1:1 char mappings, the resulting - * {@code String} may be a different length than the original {@code String}. + * class. Since case mappings are not always 1:1 char mappings, the resulting {@code String} + * and this {@code String} may differ in length. *

    - * Examples of locale-sensitive and 1:M case mappings are in the following table. - * + * Examples of locale-sensitive and 1:M case mappings are in the following table: *

    Lowercase mapping examples showing language code of locale, upper case, lower case, and description
    * * -- GitLab From b57715a117d9b7f79fcf4fec3b8f369b6aa42598 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Thu, 4 Nov 2021 15:56:19 +0000 Subject: [PATCH 196/890] 8276573: Use blessed modifier order in jdk.javadoc Reviewed-by: jjg --- .../internal/doclets/formats/html/DeprecatedListWriter.java | 2 +- .../internal/doclets/formats/html/PackageWriterImpl.java | 4 ++-- .../internal/doclets/toolkit/taglets/snippet/Attribute.java | 4 ++-- .../doclets/toolkit/taglets/snippet/MarkupParser.java | 2 +- .../share/classes/jdk/javadoc/internal/doclint/DocLint.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java index 3718a77b847..271a21ecf73 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java @@ -51,7 +51,7 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; */ public class DeprecatedListWriter extends SummaryListWriter { - private final static String TERMINALLY_DEPRECATED_KEY = "doclet.Terminally_Deprecated_Elements"; + private static final String TERMINALLY_DEPRECATED_KEY = "doclet.Terminally_Deprecated_Elements"; /** * Constructor. diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java index a89b3ff68bd..6bca82f17be 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java @@ -84,8 +84,8 @@ public class PackageWriterImpl extends HtmlDocletWriter private final BodyContents bodyContents = new BodyContents(); // Maximum number of subpackages and sibling packages to list in related packages table - private final static int MAX_SUBPACKAGES = 20; - private final static int MAX_SIBLING_PACKAGES = 5; + private static final int MAX_SUBPACKAGES = 20; + private static final int MAX_SIBLING_PACKAGES = 5; /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java index 344fbee6ca8..af2587373ea 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java @@ -83,7 +83,7 @@ public /* sealed */ abstract class Attribute { * SinglyQuoted or Unquoted to form a (sealed) hierarchy. In that case, * `Valued` should become abstract similarly to `Attribute`. */ - final static class Valued extends Attribute { + static final class Valued extends Attribute { private final String value; @@ -104,7 +104,7 @@ public /* sealed */ abstract class Attribute { } } - final static class Valueless extends Attribute { + static final class Valueless extends Attribute { Valueless(String name, int nameStartPosition) { super(name, nameStartPosition); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java index 277f33f9372..879ba7bf2e4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java @@ -48,7 +48,7 @@ import jdk.javadoc.internal.doclets.toolkit.Resources; */ public final class MarkupParser { - private final static int EOI = 0x1A; + private static final int EOI = 0x1A; private char[] buf; private int bp; private int buflen; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/DocLint.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/DocLint.java index 9f1a290ba20..1c4f3a3d650 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/DocLint.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/DocLint.java @@ -378,7 +378,7 @@ public class DocLint extends com.sun.tools.doclint.DocLint { // - static abstract class DeclScanner extends TreePathScanner { + abstract static class DeclScanner extends TreePathScanner { final Env env; public DeclScanner(Env env) { -- GitLab From 7bb2173383bc1c0d55564d31303a547957d87a15 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 4 Nov 2021 16:33:08 +0000 Subject: [PATCH 197/890] 8276199: java/nio/channels/FileChannel/LargeGatheringWrite.java fails to terminate correctly Reviewed-by: alanb --- test/jdk/ProblemList.txt | 2 -- test/jdk/java/nio/channels/FileChannel/LargeGatheringWrite.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 75a7a351314..55fccec6991 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -609,8 +609,6 @@ java/nio/channels/DatagramChannel/Unref.java 8233519 generic- java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64 -java/nio/channels/FileChannel/LargeGatheringWrite.java 8276199 windows-x64 - ############################################################################ # jdk_rmi diff --git a/test/jdk/java/nio/channels/FileChannel/LargeGatheringWrite.java b/test/jdk/java/nio/channels/FileChannel/LargeGatheringWrite.java index 69927150962..f9663359cbe 100644 --- a/test/jdk/java/nio/channels/FileChannel/LargeGatheringWrite.java +++ b/test/jdk/java/nio/channels/FileChannel/LargeGatheringWrite.java @@ -29,7 +29,7 @@ * @library .. * @library /test/lib * @build jdk.test.lib.RandomFactory - * @run main/othervm -Xmx4G LargeGatheringWrite + * @run main/othervm/timeout=240 -Xmx4G LargeGatheringWrite * @key randomness */ import java.io.IOException; -- GitLab From 1533b8191bed9d65ab4af03945584d8b2276d828 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 4 Nov 2021 17:02:42 +0000 Subject: [PATCH 198/890] 8276629: Use blessed modifier order in core-libs code Reviewed-by: dholmes, aefimov, dfuchs, mchung, iris --- .../share/classes/com/sun/jndi/ldap/Connection.java | 8 ++++---- .../share/classes/com/sun/jndi/ldap/LdapClient.java | 4 ++-- .../share/classes/com/sun/jndi/ldap/LdapCtx.java | 2 +- .../share/classes/java/rmi/server/LoaderHandler.java | 2 +- .../classes/java/rmi/server/RMISocketFactory.java | 10 +++++----- .../share/classes/java/rmi/server/RemoteObject.java | 2 +- .../share/classes/java/rmi/server/RemoteRef.java | 2 +- .../share/classes/java/rmi/server/RemoteStub.java | 2 +- .../share/classes/sun/rmi/log/ReliableLog.java | 4 ++-- .../share/classes/sun/rmi/transport/ObjectTable.java | 2 +- .../share/classes/sun/rmi/transport/Target.java | 4 ++-- .../share/classes/javax/sql/rowset/RowSetProvider.java | 8 ++++---- .../share/classes/jdk/dynalink/BiClassValue.java | 2 +- .../classes/com/sun/tools/classfile/Annotation.java | 2 +- .../classes/com/sun/tools/classfile/ConstantPool.java | 4 ++-- .../classes/com/sun/tools/classfile/Dependencies.java | 2 +- .../sun/tools/classfile/StackMapTable_attribute.java | 2 +- .../share/classes/com/sun/tools/javap/JavapTask.java | 2 +- .../share/classes/com/sun/tools/jdeps/JdepsTask.java | 4 ++-- .../share/classes/com/sun/tools/jdeps/Module.java | 2 +- .../share/classes/com/sun/tools/jdeps/Profile.java | 2 +- .../jdk/tools/jlink/internal/ImagePluginStack.java | 2 +- .../jdk/tools/jlink/internal/ImageResourcesTree.java | 2 +- .../jdk/tools/jlink/internal/PluginRepository.java | 4 ++-- .../tools/jlink/internal/plugins/ResourceFilter.java | 2 +- .../share/classes/jdk/tools/jmod/JmodTask.java | 2 +- .../share/classes/com/sun/jndi/dns/DnsContext.java | 2 +- .../sun/jndi/rmi/registry/RegistryContextFactory.java | 2 +- 28 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java index d6de10e643b..80d788d937a 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java @@ -689,7 +689,7 @@ public final class Connection implements Runnable { // "synchronize" might lead to deadlock so don't synchronize method // Use streamLock instead for synchronizing update to stream - synchronized public void replaceStreams(InputStream newIn, OutputStream newOut) { + public synchronized void replaceStreams(InputStream newIn, OutputStream newOut) { if (debug) { System.err.println("Replacing " + inStream + " with: " + newIn); System.err.println("Replacing " + outStream + " with: " + newOut); @@ -712,7 +712,7 @@ public final class Connection implements Runnable { /* * Replace streams and set isUpdradedToStartTls flag to the provided value */ - synchronized public void replaceStreams(InputStream newIn, OutputStream newOut, boolean isStartTls) { + public synchronized void replaceStreams(InputStream newIn, OutputStream newOut, boolean isStartTls) { synchronized (startTlsLock) { replaceStreams(newIn, newOut); isUpgradedToStartTls = isStartTls; @@ -731,7 +731,7 @@ public final class Connection implements Runnable { * This ensures that there is no contention between the main thread * and the Connection thread when the main thread updates inStream. */ - synchronized private InputStream getInputStream() { + private synchronized InputStream getInputStream() { return inStream; } @@ -1043,7 +1043,7 @@ public final class Connection implements Runnable { */ private volatile HandshakeListener tlsHandshakeListener; - synchronized public void setHandshakeCompletedListener(SSLSocket sslSocket) { + public synchronized void setHandshakeCompletedListener(SSLSocket sslSocket) { if (tlsHandshakeListener != null) tlsHandshakeListener.tlsHandshakeCompleted.cancel(false); diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java index 3e916a5d7f8..d972766dc11 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java @@ -312,7 +312,7 @@ public final class LdapClient implements PooledConnection { * @param auth The authentication mechanism * */ - synchronized public LdapResult ldapBind(String dn, byte[]toServer, + public synchronized LdapResult ldapBind(String dn, byte[]toServer, Control[] bindCtls, String auth, boolean pauseAfterReceipt) throws java.io.IOException, NamingException { @@ -486,7 +486,7 @@ public final class LdapClient implements PooledConnection { /* * Used by connection pooling to close physical connection. */ - synchronized public void closeConnection() { + public synchronized void closeConnection() { forceClose(false); // this is a pool callback so no need to clean pool } diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java index 8bd07c08cb5..059b654f581 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -2648,7 +2648,7 @@ public final class LdapCtx extends ComponentDirContext } } - synchronized public void close() throws NamingException { + public synchronized void close() throws NamingException { if (debug) { System.err.println("LdapCtx: close() called " + this); (new Throwable()).printStackTrace(); diff --git a/src/java.rmi/share/classes/java/rmi/server/LoaderHandler.java b/src/java.rmi/share/classes/java/rmi/server/LoaderHandler.java index 1955583741b..5ff1e38f831 100644 --- a/src/java.rmi/share/classes/java/rmi/server/LoaderHandler.java +++ b/src/java.rmi/share/classes/java/rmi/server/LoaderHandler.java @@ -42,7 +42,7 @@ import java.net.URL; public interface LoaderHandler { /** package of system LoaderHandler implementation. */ - final static String packagePrefix = "sun.rmi.server"; + static final String packagePrefix = "sun.rmi.server"; /** * Loads a class from the location specified by the diff --git a/src/java.rmi/share/classes/java/rmi/server/RMISocketFactory.java b/src/java.rmi/share/classes/java/rmi/server/RMISocketFactory.java index 70f2191b4b9..0693992e958 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RMISocketFactory.java +++ b/src/java.rmi/share/classes/java/rmi/server/RMISocketFactory.java @@ -131,7 +131,7 @@ public abstract class RMISocketFactory * @see java.lang.SecurityManager#checkSetFactory() * @since 1.1 */ - public synchronized static void setSocketFactory(RMISocketFactory fac) + public static synchronized void setSocketFactory(RMISocketFactory fac) throws IOException { if (factory != null) { @@ -153,7 +153,7 @@ public abstract class RMISocketFactory * @see #setSocketFactory(RMISocketFactory) * @since 1.1 */ - public synchronized static RMISocketFactory getSocketFactory() + public static synchronized RMISocketFactory getSocketFactory() { return factory; } @@ -166,7 +166,7 @@ public abstract class RMISocketFactory * @return the default RMI socket factory * @since 1.1 */ - public synchronized static RMISocketFactory getDefaultSocketFactory() { + public static synchronized RMISocketFactory getDefaultSocketFactory() { if (defaultSocketFactory == null) { defaultSocketFactory = new sun.rmi.transport.tcp.TCPDirectSocketFactory(); @@ -193,7 +193,7 @@ public abstract class RMISocketFactory * @see java.rmi.server.RMIFailureHandler#failure(Exception) * @since 1.1 */ - public synchronized static void setFailureHandler(RMIFailureHandler fh) + public static synchronized void setFailureHandler(RMIFailureHandler fh) { @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); @@ -210,7 +210,7 @@ public abstract class RMISocketFactory * @see #setFailureHandler(RMIFailureHandler) * @since 1.1 */ - public synchronized static RMIFailureHandler getFailureHandler() + public static synchronized RMIFailureHandler getFailureHandler() { return handler; } diff --git a/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java b/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java index 4bf8367865e..55f4c8ca626 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java +++ b/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java @@ -45,7 +45,7 @@ import sun.rmi.server.Util; public abstract class RemoteObject implements Remote, java.io.Serializable { /** The object's remote reference. */ - transient protected RemoteRef ref; + protected transient RemoteRef ref; /** indicate compatibility with JDK 1.1.x version of class */ @java.io.Serial diff --git a/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java b/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java index 6a059cb6e3d..57201cd8dc3 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java +++ b/src/java.rmi/share/classes/java/rmi/server/RemoteRef.java @@ -53,7 +53,7 @@ public interface RemoteRef extends java.io.Externalizable { * UnicastServerRef) are located in the package defined by the * prefix. */ - final static String packagePrefix = "sun.rmi.server"; + static final String packagePrefix = "sun.rmi.server"; /** * Invoke a method. This form of delegating method invocation diff --git a/src/java.rmi/share/classes/java/rmi/server/RemoteStub.java b/src/java.rmi/share/classes/java/rmi/server/RemoteStub.java index 536a29c4e56..4a64e8ebe92 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RemoteStub.java +++ b/src/java.rmi/share/classes/java/rmi/server/RemoteStub.java @@ -40,7 +40,7 @@ package java.rmi.server; * for information about dynamic stub generation. */ @Deprecated -abstract public class RemoteStub extends RemoteObject { +public abstract class RemoteStub extends RemoteObject { /** indicate compatibility with JDK 1.1.x version of class */ private static final long serialVersionUID = -1585587260594494182L; diff --git a/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java b/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java index 91144b1c94f..d4b06e94e82 100644 --- a/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java +++ b/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java @@ -78,8 +78,8 @@ import java.security.PrivilegedAction; */ public class ReliableLog { - public final static int PreferredMajorVersion = 0; - public final static int PreferredMinorVersion = 2; + public static final int PreferredMajorVersion = 0; + public static final int PreferredMinorVersion = 2; // sun.rmi.log.debug=false private boolean Debug = false; diff --git a/src/java.rmi/share/classes/sun/rmi/transport/ObjectTable.java b/src/java.rmi/share/classes/sun/rmi/transport/ObjectTable.java index 61d2668f45d..d01256f5533 100644 --- a/src/java.rmi/share/classes/sun/rmi/transport/ObjectTable.java +++ b/src/java.rmi/share/classes/sun/rmi/transport/ObjectTable.java @@ -49,7 +49,7 @@ public final class ObjectTable { /** maximum interval between complete garbage collections of local heap */ @SuppressWarnings("removal") - private final static long gcInterval = // default 1 hour + private static final long gcInterval = // default 1 hour AccessController.doPrivileged((PrivilegedAction) () -> Long.getLong("sun.rmi.dgc.server.gcInterval", 3600000)); diff --git a/src/java.rmi/share/classes/sun/rmi/transport/Target.java b/src/java.rmi/share/classes/sun/rmi/transport/Target.java index 1a2c10db4b6..c0d79bb38e2 100644 --- a/src/java.rmi/share/classes/sun/rmi/transport/Target.java +++ b/src/java.rmi/share/classes/sun/rmi/transport/Target.java @@ -308,7 +308,7 @@ public final class Target { * Remove endpoint from the reference set. */ @SuppressWarnings("removal") - synchronized private void refSetRemove(VMID vmid) { + private synchronized void refSetRemove(VMID vmid) { // remove notification request DGCImpl.getDGCImpl().unregisterTarget(vmid, this); @@ -434,7 +434,7 @@ public final class Target { * vmid dies. In that case, the vmid should be removed * from the reference set. */ - synchronized public void vmidDead(VMID vmid) { + public synchronized void vmidDead(VMID vmid) { if (DGCImpl.dgcLog.isLoggable(Log.BRIEF)) { DGCImpl.dgcLog.log(Log.BRIEF, "removing endpoint " + vmid + " from reference set"); diff --git a/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java b/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java index bcee82529ea..f69ece6e469 100644 --- a/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/RowSetProvider.java @@ -226,7 +226,7 @@ public class RowSetProvider { * */ @SuppressWarnings("removal") - static private ClassLoader getContextClassLoader() throws SecurityException { + private static ClassLoader getContextClassLoader() throws SecurityException { return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { @@ -252,7 +252,7 @@ public class RowSetProvider { * context class loader followed by the current class loader. * @return The class which was loaded */ - static private Class getFactoryClass(String factoryClassName, ClassLoader cl, + private static Class getFactoryClass(String factoryClassName, ClassLoader cl, boolean doFallback) throws ClassNotFoundException { Class factoryClass = null; @@ -284,7 +284,7 @@ public class RowSetProvider { * Use the ServiceLoader mechanism to load the default RowSetFactory * @return default RowSetFactory Implementation */ - static private RowSetFactory loadViaServiceLoader() throws SQLException { + private static RowSetFactory loadViaServiceLoader() throws SQLException { RowSetFactory theFactory = null; try { trace("***in loadViaServiceLoader():"); @@ -310,7 +310,7 @@ public class RowSetProvider { * or a {@code SecurityException} occurs. */ @SuppressWarnings("removal") - static private String getSystemProperty(final String propName) { + private static String getSystemProperty(final String propName) { String property = null; try { property = AccessController.doPrivileged(new PrivilegedAction() { diff --git a/src/jdk.dynalink/share/classes/jdk/dynalink/BiClassValue.java b/src/jdk.dynalink/share/classes/jdk/dynalink/BiClassValue.java index 6308c56389a..0a1b739c493 100644 --- a/src/jdk.dynalink/share/classes/jdk/dynalink/BiClassValue.java +++ b/src/jdk.dynalink/share/classes/jdk/dynalink/BiClassValue.java @@ -87,7 +87,7 @@ final class BiClassValue { * creates the association from a type Class object to its BiClassValues'. * @param the type of the values */ - private final static class BiClassValues { + private static final class BiClassValues { // These will be used for compareAndExchange on forward and reverse fields. private static final VarHandle FORWARD; private static final VarHandle REVERSE; diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Annotation.java b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Annotation.java index b027415927b..caf148944ab 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Annotation.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Annotation.java @@ -73,7 +73,7 @@ public class Annotation { /** * See JVMS, section 4.8.16.1. */ - public static abstract class element_value { + public abstract static class element_value { public static element_value read(ClassReader cr) throws IOException, InvalidAnnotation { int tag = cr.readUnsignedByte(); diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java index 6403c954856..801220a026c 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java @@ -370,7 +370,7 @@ public class ConstantPool { R visitUtf8(CONSTANT_Utf8_info info, P p); } - public static abstract class CPInfo { + public abstract static class CPInfo { CPInfo() { this.cp = null; } @@ -394,7 +394,7 @@ public class ConstantPool { protected final ConstantPool cp; } - public static abstract class CPRefInfo extends CPInfo { + public abstract static class CPRefInfo extends CPInfo { protected CPRefInfo(ConstantPool cp, ClassReader cr, int tag) throws IOException { super(cp); this.tag = tag; diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java index 2f217c1b93a..4dcd6d6d8d3 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java @@ -557,7 +557,7 @@ public class Dependencies { private int showAccess; } - static abstract class BasicDependencyFinder implements Finder { + abstract static class BasicDependencyFinder implements Finder { private Map locations = new ConcurrentHashMap<>(); Location getLocation(String className) { diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java index 13c43e42364..a0f94f1bbd5 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java @@ -77,7 +77,7 @@ public class StackMapTable_attribute extends Attribute { public final int number_of_entries; public final stack_map_frame entries[]; - public static abstract class stack_map_frame { + public abstract static class stack_map_frame { static stack_map_frame read(ClassReader cr) throws IOException, InvalidStackMap { int frame_type = cr.readUnsignedByte(); diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java index 8cd6ef6e299..638043d5620 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java @@ -98,7 +98,7 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { boolean showUsage; } - static abstract class Option { + abstract static class Option { Option(boolean hasArg, String... aliases) { this.hasArg = hasArg; this.aliases = aliases; diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java index 3effa227e35..4c1ae566466 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java @@ -106,7 +106,7 @@ class JdepsTask { } } - static abstract class Option { + abstract static class Option { Option(boolean hasArg, String... aliases) { this.hasArg = hasArg; this.aliases = aliases; @@ -139,7 +139,7 @@ class JdepsTask { final String[] aliases; } - static abstract class HiddenOption extends Option { + abstract static class HiddenOption extends Option { HiddenOption(boolean hasArg, String... aliases) { super(hasArg, aliases); } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java index b411b9e264c..8a0539cb774 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java @@ -183,7 +183,7 @@ class Module extends Archive { return name(); } - public final static class Builder { + public static final class Builder { final String name; final ModuleDescriptor descriptor; final boolean isSystem; diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Profile.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Profile.java index 6b20035cdfa..1da0d4a4b59 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Profile.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Profile.java @@ -111,7 +111,7 @@ enum Profile { return null; } - private final static Set JDK = new HashSet<>(); + private static final Set JDK = new HashSet<>(); static synchronized void init(Map systemModules) { Arrays.stream(Profile.values()).forEach(p -> // this includes platform-dependent module that may not exist diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java index ad4188b4395..bd68c451b74 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java @@ -87,7 +87,7 @@ public final class ImagePluginStack { } } - private final static class CheckOrderResourcePoolManager extends ResourcePoolManager { + private static final class CheckOrderResourcePoolManager extends ResourcePoolManager { private final List orderedList; private int currentIndex; diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageResourcesTree.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageResourcesTree.java index 2bfaaec5df3..96f2be83638 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageResourcesTree.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageResourcesTree.java @@ -107,7 +107,7 @@ public final class ImageResourcesTree { * A reference to a package. Empty packages can be located inside one or * more modules. A package with classes exist in only one module. */ - final static class PackageReference { + static final class PackageReference { private final String name; private final boolean isEmpty; diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java index c2decd3c064..3cd34040223 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java @@ -90,7 +90,7 @@ public final class PluginRepository { * Explicit registration of a plugin in the repository. Used by unit tests * @param plugin The plugin to register. */ - public synchronized static void registerPlugin(Plugin plugin) { + public static synchronized void registerPlugin(Plugin plugin) { Objects.requireNonNull(plugin); registeredPlugins.put(plugin.getName(), plugin); } @@ -101,7 +101,7 @@ public final class PluginRepository { * * @param name Plugin name */ - public synchronized static void unregisterPlugin(String name) { + public static synchronized void unregisterPlugin(String name) { Objects.requireNonNull(name); registeredPlugins.remove(name); } diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ResourceFilter.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ResourceFilter.java index 4a5c3b52572..f12fe8510ff 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ResourceFilter.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ResourceFilter.java @@ -42,7 +42,7 @@ import jdk.tools.jlink.internal.Utils; * Filter resource resources using path matcher. */ public class ResourceFilter implements Predicate { - private final static List EMPTY_LIST = Collections.emptyList(); + private static final List EMPTY_LIST = Collections.emptyList(); private final List matchers; private final boolean include; diff --git a/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java b/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java index bcf6a2463b3..eb541bba63f 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java @@ -1041,7 +1041,7 @@ public class JmodTask { * Specific subclasses should do whatever validation is required on the * individual path elements, if any. */ - static abstract class AbstractPathConverter implements ValueConverter> { + abstract static class AbstractPathConverter implements ValueConverter> { @Override public List convert(String value) { List paths = new ArrayList<>(); diff --git a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java index aad05496429..c4f00236edc 100644 --- a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java +++ b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java @@ -989,7 +989,7 @@ abstract class BaseNameClassPairEnumeration implements NamingEnumeration { return hasMore(); } - abstract public T next() throws NamingException; + public abstract T next() throws NamingException; public final T nextElement() { try { diff --git a/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContextFactory.java b/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContextFactory.java index 6746f3c9b7b..aa5dedc0e7c 100644 --- a/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContextFactory.java +++ b/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContextFactory.java @@ -59,7 +59,7 @@ public class RegistryContextFactory /** * The type of each address in an RMI registry reference. */ - public final static String ADDRESS_TYPE = "URL"; + public static final String ADDRESS_TYPE = "URL"; public Context getInitialContext(Hashtable env) throws NamingException { -- GitLab From 99d4b07cddec05428e4d578ba6f494f51b92e841 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Thu, 4 Nov 2021 17:26:18 +0000 Subject: [PATCH 199/890] 8276649: MethodHandles.Lookup docs: replace the table in the cross-module access check section with list Reviewed-by: mchung --- .../java/lang/invoke/MethodHandles.java | 48 ++++++------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 8d3bc8f4781..f6417936d68 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -875,40 +875,20 @@ public class MethodHandles { * with all public types that are accessible to {@code M0}. {@code M0} * reads {@code M1} and hence the set of accessible types includes: * - *
    Examples of locale-sensitive and 1:M case mappings. Shows Language code of locale, lower case, upper case, and description.
    - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    - * Public types in the following packages are accessible to the - * lookup class and the previous lookup class. - *
    Equally accessible types to {@code M0} and {@code M1}
    unconditional-exported packages from {@code M1}
    unconditional-exported packages from {@code M0} if {@code M1} reads {@code M0}
    unconditional-exported packages from a third module {@code M2} - * if both {@code M0} and {@code M1} read {@code M2}
    qualified-exported packages from {@code M1} to {@code M0}
    qualified-exported packages from {@code M0} to {@code M1} - * if {@code M1} reads {@code M0}
    qualified-exported packages from a third module {@code M2} to - * both {@code M0} and {@code M1} if both {@code M0} and {@code M1} read {@code M2}
    + *

      + *
    • unconditional-exported packages from {@code M1}
    • + *
    • unconditional-exported packages from {@code M0} if {@code M1} reads {@code M0}
    • + *
    • + * unconditional-exported packages from a third module {@code M2}if both {@code M0} + * and {@code M1} read {@code M2} + *
    • + *
    • qualified-exported packages from {@code M1} to {@code M0}
    • + *
    • qualified-exported packages from {@code M0} to {@code M1} if {@code M1} reads {@code M0}
    • + *
    • + * qualified-exported packages from a third module {@code M2} to both {@code M0} and + * {@code M1} if both {@code M0} and {@code M1} read {@code M2} + *
    • + *
    * *

    Access modes

    * -- GitLab From 2b5a32c73f22c69d7ccedac761af1dbb4a7f297d Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 4 Nov 2021 19:40:22 +0000 Subject: [PATCH 200/890] 8275718: Relax memory constraint on exception counter updates Reviewed-by: dholmes, minqi --- src/hotspot/share/utilities/exceptions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/utilities/exceptions.cpp b/src/hotspot/share/utilities/exceptions.cpp index bd95b8306be..e71c48c6c42 100644 --- a/src/hotspot/share/utilities/exceptions.cpp +++ b/src/hotspot/share/utilities/exceptions.cpp @@ -166,7 +166,7 @@ void Exceptions::_throw(JavaThread* thread, const char* file, int line, Handle h } if (h_exception->is_a(vmClasses::LinkageError_klass())) { - Atomic::inc(&_linkage_errors); + Atomic::inc(&_linkage_errors, memory_order_relaxed); } assert(h_exception->is_a(vmClasses::Throwable_klass()), "exception is not a subclass of java/lang/Throwable"); @@ -242,7 +242,7 @@ void Exceptions::throw_stack_overflow_exception(JavaThread* THREAD, const char* java_lang_Throwable::fill_in_stack_trace(exception, method); } // Increment counter for hs_err file reporting - Atomic::inc(&Exceptions::_stack_overflow_errors); + Atomic::inc(&Exceptions::_stack_overflow_errors, memory_order_relaxed); } else { // if prior exception, throw that one instead exception = Handle(THREAD, THREAD->pending_exception()); @@ -462,12 +462,12 @@ volatile int Exceptions::_out_of_memory_error_class_metaspace_errors = 0; void Exceptions::count_out_of_memory_exceptions(Handle exception) { if (exception() == Universe::out_of_memory_error_metaspace()) { - Atomic::inc(&_out_of_memory_error_metaspace_errors); + Atomic::inc(&_out_of_memory_error_metaspace_errors, memory_order_relaxed); } else if (exception() == Universe::out_of_memory_error_class_metaspace()) { - Atomic::inc(&_out_of_memory_error_class_metaspace_errors); + Atomic::inc(&_out_of_memory_error_class_metaspace_errors, memory_order_relaxed); } else { // everything else reported as java heap OOM - Atomic::inc(&_out_of_memory_error_java_heap_errors); + Atomic::inc(&_out_of_memory_error_java_heap_errors, memory_order_relaxed); } } -- GitLab From 81203efe411320ff4e390605f980d14e7f70252f Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 4 Nov 2021 19:44:05 +0000 Subject: [PATCH 201/890] 8276655: Use blessed modifier order in SCTP Reviewed-by: alanb, dfuchs --- .../classes/sun/nio/ch/sctp/AssociationChange.java | 12 ++++++------ .../classes/sun/nio/ch/sctp/PeerAddrChange.java | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java index e15e1becca6..c83b1324714 100644 --- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java +++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -35,11 +35,11 @@ public class AssociationChange extends AssociationChangeNotification implements SctpNotification { /* static final ints so that they can be referenced from native */ - @Native private final static int SCTP_COMM_UP = 1; - @Native private final static int SCTP_COMM_LOST = 2; - @Native private final static int SCTP_RESTART = 3; - @Native private final static int SCTP_SHUTDOWN = 4; - @Native private final static int SCTP_CANT_START = 5; + @Native private static final int SCTP_COMM_UP = 1; + @Native private static final int SCTP_COMM_LOST = 2; + @Native private static final int SCTP_RESTART = 3; + @Native private static final int SCTP_SHUTDOWN = 4; + @Native private static final int SCTP_CANT_START = 5; private Association association; diff --git a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/PeerAddrChange.java b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/PeerAddrChange.java index 55ee10fe644..5111c94d029 100644 --- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/PeerAddrChange.java +++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/PeerAddrChange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -36,12 +36,12 @@ public class PeerAddrChange extends PeerAddressChangeNotification implements SctpNotification { /* static final ints so that they can be referenced from native */ - @Native private final static int SCTP_ADDR_AVAILABLE = 1; - @Native private final static int SCTP_ADDR_UNREACHABLE = 2; - @Native private final static int SCTP_ADDR_REMOVED = 3; - @Native private final static int SCTP_ADDR_ADDED = 4; - @Native private final static int SCTP_ADDR_MADE_PRIM = 5; - @Native private final static int SCTP_ADDR_CONFIRMED =6; + @Native private static final int SCTP_ADDR_AVAILABLE = 1; + @Native private static final int SCTP_ADDR_UNREACHABLE = 2; + @Native private static final int SCTP_ADDR_REMOVED = 3; + @Native private static final int SCTP_ADDR_ADDED = 4; + @Native private static final int SCTP_ADDR_MADE_PRIM = 5; + @Native private static final int SCTP_ADDR_CONFIRMED =6; private Association association; -- GitLab From dcf36f87f87d52490c1f0434c2fca99fc8fd90a2 Mon Sep 17 00:00:00 2001 From: Dean Long Date: Thu, 4 Nov 2021 19:52:27 +0000 Subject: [PATCH 202/890] 8275670: ciReplay: java.lang.NoClassDefFoundError when trying to load java/lang/invoke/LambdaForm$MH Reviewed-by: kvn, chagedorn --- src/hotspot/share/ci/ciEnv.cpp | 55 +++++++------ src/hotspot/share/ci/ciEnv.hpp | 4 +- .../jtreg/compiler/ciReplay/TestLambdas.java | 82 +++++++++++++++++++ 3 files changed, 115 insertions(+), 26 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/ciReplay/TestLambdas.java diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 57ccaa2234a..0c6f2b5fa2b 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1443,14 +1443,22 @@ void ciEnv::record_mh(Thread* thread, oop mh) { RecordLocation fp(this, "member"); record_member(thread, member); } else { - // Check .argL0 field - // Probably BoundMethodHandle.Species_L, but we only care if the field exists - oop arg = obj_field(mh, "argL0"); - if (arg != NULL) { - RecordLocation fp(this, "argL0"); - if (arg->klass()->is_instance_klass()) { - InstanceKlass* ik2 = InstanceKlass::cast(arg->klass()); - record_best_dyno_loc(ik2); + // Check .argL fields + // Probably BoundMethodHandle.Species_L*, but we only care if the field exists + char arg_name[] = "argLXX"; + int max_arg = 99; + for (int index = 0; index <= max_arg; ++index) { + jio_snprintf(arg_name, sizeof (arg_name), "argL%d", index); + oop arg = obj_field(mh, arg_name); + if (arg != NULL) { + RecordLocation fp(this, "%s", arg_name); + if (arg->klass()->is_instance_klass()) { + InstanceKlass* ik2 = InstanceKlass::cast(arg->klass()); + record_best_dyno_loc(ik2); + record_call_site_obj(thread, arg); + } + } else { + break; } } } @@ -1459,13 +1467,13 @@ void ciEnv::record_mh(Thread* thread, oop mh) { // Process an object found at an invokedynamic/invokehandle call site and record any dynamic locations. // Types currently supported are MethodHandle and CallSite. // The object is typically the "appendix" object, or Bootstrap Method (BSM) object. -void ciEnv::record_call_site_obj(Thread* thread, const constantPoolHandle& pool, const Handle obj) +void ciEnv::record_call_site_obj(Thread* thread, oop obj) { - if (obj.not_null()) { - if (java_lang_invoke_MethodHandle::is_instance(obj())) { - record_mh(thread, obj()); - } else if (java_lang_invoke_ConstantCallSite::is_instance(obj())) { - oop target = java_lang_invoke_CallSite::target(obj()); + if (obj != NULL) { + if (java_lang_invoke_MethodHandle::is_instance(obj)) { + record_mh(thread, obj); + } else if (java_lang_invoke_ConstantCallSite::is_instance(obj)) { + oop target = java_lang_invoke_CallSite::target(obj); if (target->klass()->is_instance_klass()) { RecordLocation fp(this, "target"); InstanceKlass* ik = InstanceKlass::cast(target->klass()); @@ -1476,7 +1484,7 @@ void ciEnv::record_call_site_obj(Thread* thread, const constantPoolHandle& pool, } // Process an adapter Method* found at an invokedynamic/invokehandle call site and record any dynamic locations. -void ciEnv::record_call_site_method(Thread* thread, const constantPoolHandle& pool, Method* adapter) { +void ciEnv::record_call_site_method(Thread* thread, Method* adapter) { InstanceKlass* holder = adapter->method_holder(); if (!holder->is_hidden()) { return; @@ -1491,21 +1499,20 @@ void ciEnv::process_invokedynamic(const constantPoolHandle &cp, int indy_index, if (cp_cache_entry->is_resolved(Bytecodes::_invokedynamic)) { // process the adapter Method* adapter = cp_cache_entry->f1_as_method(); - record_call_site_method(thread, cp, adapter); + record_call_site_method(thread, adapter); // process the appendix - Handle appendix(thread, cp_cache_entry->appendix_if_resolved(cp)); + oop appendix = cp_cache_entry->appendix_if_resolved(cp); { RecordLocation fp(this, ""); - record_call_site_obj(thread, cp, appendix); + record_call_site_obj(thread, appendix); } // process the BSM int pool_index = cp_cache_entry->constant_pool_index(); BootstrapInfo bootstrap_specifier(cp, pool_index, indy_index); - oop bsm_oop = cp->resolve_possibly_cached_constant_at(bootstrap_specifier.bsm_index(), thread); - Handle bsm(thread, bsm_oop); + oop bsm = cp->resolve_possibly_cached_constant_at(bootstrap_specifier.bsm_index(), thread); { RecordLocation fp(this, ""); - record_call_site_obj(thread, cp, bsm); + record_call_site_obj(thread, bsm); } } } @@ -1523,12 +1530,12 @@ void ciEnv::process_invokehandle(const constantPoolHandle &cp, int index, JavaTh if (cp_cache_entry->is_resolved(Bytecodes::_invokehandle)) { // process the adapter Method* adapter = cp_cache_entry->f1_as_method(); - Handle appendix(thread, cp_cache_entry->appendix_if_resolved(cp)); - record_call_site_method(thread, cp, adapter); + oop appendix = cp_cache_entry->appendix_if_resolved(cp); + record_call_site_method(thread, adapter); // process the appendix { RecordLocation fp(this, ""); - record_call_site_obj(thread, cp, appendix); + record_call_site_obj(thread, appendix); } } } diff --git a/src/hotspot/share/ci/ciEnv.hpp b/src/hotspot/share/ci/ciEnv.hpp index 32dc5f51eaf..52bcc9bddcf 100644 --- a/src/hotspot/share/ci/ciEnv.hpp +++ b/src/hotspot/share/ci/ciEnv.hpp @@ -508,8 +508,8 @@ public: void record_lambdaform(Thread* thread, oop obj); void record_member(Thread* thread, oop obj); void record_mh(Thread* thread, oop obj); - void record_call_site_obj(Thread* thread, const constantPoolHandle& pool, const Handle appendix); - void record_call_site_method(Thread* thread, const constantPoolHandle& pool, Method* adapter); + void record_call_site_obj(Thread* thread, oop obj); + void record_call_site_method(Thread* thread, Method* adapter); void process_invokedynamic(const constantPoolHandle &cp, int index, JavaThread* thread); void process_invokehandle(const constantPoolHandle &cp, int index, JavaThread* thread); void find_dynamic_call_sites(); diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestLambdas.java b/test/hotspot/jtreg/compiler/ciReplay/TestLambdas.java new file mode 100644 index 00000000000..06dd5611411 --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/TestLambdas.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021, 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 8275670 + * @library / /test/lib + * @summary testing of ciReplay with inlining + * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.debug == true & vm.compiler2.enabled + * @modules java.base/jdk.internal.misc + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.ciReplay.TestLambdas + */ + +package compiler.ciReplay; + +public class TestLambdas extends CiReplayBase { + public static void main(String args[]) { + new TestLambdas().runTest(false, TIERED_DISABLED_VM_OPTION); + } + + @Override + public void testAction() { + positiveTest(TIERED_DISABLED_VM_OPTION); + } + + @Override + public String getTestClass() { + return Test.class.getName(); + } +} + +class Test { + public static void main(String[] args) { + for (int i = 0; i < 20_000; i++) { + test(i); + } + } + + static void test(int i) { + concat_lambdas(); + } + + + // Create nested BoundMethodHandle using StringConcatHelper + static boolean concat_lambdas() { + String source = "0123456789abcdefgABCDEFG"; + String result = ""; + + int max = 10; + for (int cp = 0; cp < max; ++cp) { + String regex = new String(Character.toChars(cp)); + result = source.substring(0, 3) + regex + + source.substring(3, 9) + regex + + source.substring(9, 15) + regex + + source.substring(15); + } + return result.equals("xyzzy"); + } +} -- GitLab From 7e87f946cedf93f19c38fd596039a16394c03ea4 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Thu, 4 Nov 2021 20:46:23 +0000 Subject: [PATCH 203/890] 8276652: Missing row headers in MethodHandles.Lookup docs Reviewed-by: mchung --- .../java/lang/invoke/MethodHandles.java | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index f6417936d68..743ebb66759 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -955,7 +955,7 @@ public class MethodHandles { *

  • 2R
    {@code CL.in(D).in(C)} hop back to module{@code CL.in(D).in(C)} hop back to module2R
    {@code PRI1 = privateLookupIn(C1,CL)}{@code PRI1 = privateLookupIn(C1,CL)}PROPRI1R
    {@code PRI1a = privateLookupIn(C,PRI1)}{@code PRI1a = privateLookupIn(C,PRI1)}PROPRI1R
    {@code PRI1.in(C1)} same package{@code PRI1.in(C1)} same package1R
    {@code PRI1.in(C1)} different package{@code PRI1.in(C1)} different package1R
    {@code PRI1.in(D)} different module{@code PRI1.in(D)} different module2R
    {@code PRI1.dropLookupMode(PROTECTED)}{@code PRI1.dropLookupMode(PROTECTED)}PRI1R
    {@code PRI1.dropLookupMode(PRIVATE)}{@code PRI1.dropLookupMode(PRIVATE)}1R
    {@code PRI1.dropLookupMode(PACKAGE)}{@code PRI1.dropLookupMode(PACKAGE)}1R
    {@code PRI1.dropLookupMode(MODULE)}{@code PRI1.dropLookupMode(MODULE)}1R
    {@code PRI1.dropLookupMode(PUBLIC)}{@code PRI1.dropLookupMode(PUBLIC)}none
    {@code PRI2 = privateLookupIn(D,CL)}{@code PRI2 = privateLookupIn(D,CL)}PROPRI2R
    {@code privateLookupIn(D,PRI1)}{@code privateLookupIn(D,PRI1)}PROPRI2R
    {@code privateLookupIn(C,PRI2)} fails{@code privateLookupIn(C,PRI2)} failsIAE
    {@code PRI2.in(D2)} same package{@code PRI2.in(D2)} same package2R
    {@code PRI2.in(D2)} different package{@code PRI2.in(D2)} different package2R
    {@code PRI2.in(C1)} hop back to module{@code PRI2.in(C1)} hop back to module2R
    {@code PRI2.in(E)} hop to third module{@code PRI2.in(E)} hop to third modulenone
    {@code PRI2.dropLookupMode(PROTECTED)}{@code PRI2.dropLookupMode(PROTECTED)}PRI2R
    {@code PRI2.dropLookupMode(PRIVATE)}{@code PRI2.dropLookupMode(PRIVATE)}2R
    {@code PRI2.dropLookupMode(PACKAGE)}{@code PRI2.dropLookupMode(PACKAGE)}2R
    {@code PRI2.dropLookupMode(MODULE)}{@code PRI2.dropLookupMode(MODULE)}2R
    {@code PRI2.dropLookupMode(PUBLIC)}{@code PRI2.dropLookupMode(PUBLIC)}none
    {@code CL.dropLookupMode(PROTECTED)}{@code CL.dropLookupMode(PROTECTED)}PRI1R
    {@code CL.dropLookupMode(PRIVATE)}{@code CL.dropLookupMode(PRIVATE)}1R
    {@code CL.dropLookupMode(PACKAGE)}{@code CL.dropLookupMode(PACKAGE)}1R
    {@code CL.dropLookupMode(MODULE)}{@code CL.dropLookupMode(MODULE)}1R
    {@code CL.dropLookupMode(PUBLIC)}{@code CL.dropLookupMode(PUBLIC)}none
    {@code PUB = publicLookup()}{@code PUB = publicLookup()}U
    {@code PUB.in(D)} different module{@code PUB.in(D)} different moduleU
    {@code PUB.in(D).in(E)} third module{@code PUB.in(D).in(E)} third moduleU
    {@code PUB.dropLookupMode(UNCONDITIONAL)}{@code PUB.dropLookupMode(UNCONDITIONAL)}none
    {@code privateLookupIn(C1,PUB)} fails{@code privateLookupIn(C1,PUB)} failsIAE
    {@code ANY.in(X)}, for inaccessible {@code X}{@code ANY.in(X)}, for inaccessible {@code X}Unicode version
    Java SE 15
    Java SE 15Unicode 13.0
    Java SE 13
    Java SE 13Unicode 12.1
    Java SE 12
    Java SE 12Unicode 11.0
    Java SE 11
    Java SE 11Unicode 10.0
    Java SE 9
    Java SE 9Unicode 8.0
    Java SE 8
    Java SE 8Unicode 6.2
    Java SE 7
    Java SE 7Unicode 6.0
    Java SE 5.0
    Java SE 5.0Unicode 4.0
    Java SE 1.4
    Java SE 1.4Unicode 3.0
    JDK 1.1
    JDK 1.1Unicode 2.0
    JDK 1.0.2
    JDK 1.0.2Unicode 1.1.5
    -- GitLab From 7b1916efda95a46439cf42e006593361d12a8823 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Thu, 4 Nov 2021 21:53:29 +0000 Subject: [PATCH 205/890] 8233557: [TESTBUG] DoubleClickTitleBarTest.java fails on macOs Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 55fccec6991..064daa35b2a 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -493,7 +493,6 @@ java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java 8169468 macosx-all java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223,8274106 macosx-aarch64,linux-all,windows-all -java/awt/Window/WindowResizing/DoubleClickTitleBarTest.java 8233557 macosx-all java/awt/keyboard/AllKeyCode/AllKeyCode.java 8242930 macosx-all java/awt/FullScreen/8013581/bug8013581.java 8169471 macosx-all java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 8233568 macosx-all -- GitLab From e21b5c7b3781430ecf568e7f5c89ef3391e06d9e Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Thu, 4 Nov 2021 23:51:18 +0000 Subject: [PATCH 206/890] 8276650: GenGraphs does not produce deterministic output Reviewed-by: iris --- .../com/sun/tools/jdeps/ModuleDotGraph.java | 4 +- .../tools/jdeps/modules/DotFileTest.java | 75 ++++++++++--------- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java index c823091a961..21c4d67829c 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleDotGraph.java @@ -333,7 +333,7 @@ public class ModuleDotGraph { private final String name; private final Graph graph; - private final Set descriptors = new TreeSet<>(); + private final TreeSet descriptors = new TreeSet<>(); private final List subgraphs = new ArrayList<>(); private final Attributes attributes; public DotGraphBuilder(String name, @@ -414,7 +414,7 @@ public class ModuleDotGraph { .collect(toSet()); String mn = md.name(); - edges.forEach(dn -> { + edges.stream().sorted().forEach(dn -> { String attr = ""; if (dn.equals("java.base")) { attr = "color=\"" + attributes.requiresMandatedColor() + "\""; diff --git a/test/langtools/tools/jdeps/modules/DotFileTest.java b/test/langtools/tools/jdeps/modules/DotFileTest.java index a4adf26a154..f4e8da9bef8 100644 --- a/test/langtools/tools/jdeps/modules/DotFileTest.java +++ b/test/langtools/tools/jdeps/modules/DotFileTest.java @@ -37,13 +37,12 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.HashSet; -import java.util.Set; +import java.util.ArrayList; +import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.spi.ToolProvider; -import java.util.stream.Collectors; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; @@ -72,41 +71,43 @@ public class DotFileTest { @DataProvider(name = "modules") public Object[][] modules() { return new Object[][]{ - {"java.desktop", Set.of("java.datatransfer -> java.base", - "java.desktop -> java.datatransfer", - "java.desktop -> java.prefs", - "java.prefs -> java.xml", - "java.xml -> java.base" ) + // the edges for each module are printed in lexicographical order + {"java.desktop", List.of("java.datatransfer -> java.base", + "java.desktop -> java.datatransfer", + "java.desktop -> java.prefs", + "java.prefs -> java.xml", + "java.xml -> java.base" ) }, - { "java.sql", Set.of("java.logging -> java.base", - "java.transaction.xa -> java.base", - "java.sql -> java.logging", - "java.sql -> java.transaction.xa", - "java.sql -> java.xml", - "java.xml -> java.base" ) + { "java.sql", List.of("java.logging -> java.base", + "java.sql -> java.logging", + "java.sql -> java.transaction.xa", + "java.sql -> java.xml", + "java.transaction.xa -> java.base", + "java.xml -> java.base" ) } }; } @DataProvider(name = "specVersion") public Object[][] specVersion() { return new Object[][]{ - {"java.desktop", Set.of("java.datatransfer -> java.base", - "java.desktop -> java.datatransfer", - "java.desktop -> java.xml", - "java.xml -> java.base") + // the edges for each module are printed in lexicographical order + {"java.desktop", List.of("java.datatransfer -> java.base", + "java.desktop -> java.datatransfer", + "java.desktop -> java.xml", + "java.xml -> java.base") }, - { "java.sql", Set.of("java.logging -> java.base", - "java.transaction.xa -> java.base", - "java.sql -> java.logging", - "java.sql -> java.transaction.xa", - "java.sql -> java.xml", - "java.xml -> java.base" ) + { "java.sql", List.of("java.logging -> java.base", + "java.sql -> java.logging", + "java.sql -> java.transaction.xa", + "java.sql -> java.xml", + "java.transaction.xa -> java.base", + "java.xml -> java.base" ) } }; } @Test(dataProvider = "modules") - public void test(String name, Set edges) throws Exception { + public void test(String name, List edges) throws Exception { String[] options = new String[] { "-dotoutput", DOTS_DIR.toString(), "-s", "-m", name @@ -115,15 +116,15 @@ public class DotFileTest { Path path = DOTS_DIR.resolve(name + ".dot"); assertTrue(Files.exists(path)); - Set lines = Files.readAllLines(path).stream() + List lines = Files.readAllLines(path).stream() .filter(l -> l.contains(" -> ")) .map(this::split) - .collect(Collectors.toSet()); + .toList(); assertEquals(lines, edges); } @Test(dataProvider = "specVersion") - public void testAPIOnly(String name, Set edges) throws Exception { + public void testAPIOnly(String name, List edges) throws Exception { String[] options = new String[]{ "-dotoutput", SPEC_DIR.toString(), "-s", "-apionly", @@ -133,10 +134,10 @@ public class DotFileTest { Path path = SPEC_DIR.resolve(name + ".dot"); assertTrue(Files.exists(path)); - Set lines = Files.readAllLines(path).stream() + List lines = Files.readAllLines(path).stream() .filter(l -> l.contains(" -> ")) .map(this::split) - .collect(Collectors.toSet()); + .toList(); assertEquals(lines, edges); } @@ -160,7 +161,7 @@ public class DotFileTest { assertTrue(Files.exists(path)); // package dependences - Set expected = Set.of( + List expected = List.of( "org.indirect -> java.lang", "org.indirect -> org.unsafe", "org.safe -> java.io", @@ -170,7 +171,7 @@ public class DotFileTest { ); Pattern pattern = Pattern.compile("(.*) -> +([^ ]*) (.*)"); - Set lines = new HashSet<>(); + List lines = new ArrayList<>(); for (String line : Files.readAllLines(path)) { line = line.replace('"', ' ').replace(';', ' '); Matcher pm = pattern.matcher(line); @@ -201,15 +202,15 @@ public class DotFileTest { assertTrue(Files.exists(path)); // module dependences - Set expected = Set.of( - "unsafe -> jdk.unsupported", - "jdk.unsupported -> java.base" + List expected = List.of( + "jdk.unsupported -> java.base", + "unsafe -> jdk.unsupported" ); - Set lines = Files.readAllLines(path).stream() + List lines = Files.readAllLines(path).stream() .filter(l -> l.contains(" -> ")) .map(this::split) - .collect(Collectors.toSet()); + .toList(); assertEquals(lines, expected); } -- GitLab From 9ad4d3d06bb356436d69af07726ef6727c500f59 Mon Sep 17 00:00:00 2001 From: Sandhya Viswanathan Date: Fri, 5 Nov 2021 03:30:09 +0000 Subject: [PATCH 207/890] 8276025: Hotspot's libsvml.so may conflict with user dependency Reviewed-by: kvn, erikj, psandoz, ihse --- make/modules/jdk.incubator.vector/Lib.gmk | 6 +- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 48 +- .../globals_vectorApiSupport_linux.S.inc | 0 .../jsvml_d_acos_linux_x86.S} | 740 +++++------ .../jsvml_d_asin_linux_x86.S} | 704 +++++------ .../jsvml_d_atan2_linux_x86.S} | 906 +++++++------- .../jsvml_d_atan_linux_x86.S} | 652 +++++----- .../jsvml_d_cbrt_linux_x86.S} | 630 +++++----- .../jsvml_d_cos_linux_x86.S} | 706 +++++------ .../jsvml_d_cosh_linux_x86.S} | 518 ++++---- .../jsvml_d_exp_linux_x86.S} | 538 ++++---- .../jsvml_d_expm1_linux_x86.S} | 576 ++++----- .../jsvml_d_hypot_linux_x86.S} | 448 +++---- .../jsvml_d_log10_linux_x86.S} | 556 ++++----- .../jsvml_d_log1p_linux_x86.S} | 600 ++++----- .../jsvml_d_log_linux_x86.S} | 520 ++++---- .../jsvml_d_pow_linux_x86.S} | 792 ++++++------ .../jsvml_d_sin_linux_x86.S} | 710 +++++------ .../jsvml_d_sinh_linux_x86.S} | 580 ++++----- .../jsvml_d_tan_linux_x86.S} | 540 ++++----- .../jsvml_d_tanh_linux_x86.S} | 476 ++++---- .../jsvml_s_acos_linux_x86.S} | 402 +++--- .../jsvml_s_asin_linux_x86.S} | 378 +++--- .../jsvml_s_atan2_linux_x86.S} | 562 ++++----- .../jsvml_s_atan_linux_x86.S} | 504 ++++---- .../jsvml_s_cbrt_linux_x86.S} | 412 +++---- .../jsvml_s_cos_linux_x86.S} | 438 +++---- .../jsvml_s_cosh_linux_x86.S} | 310 ++--- .../jsvml_s_exp_linux_x86.S} | 364 +++--- .../jsvml_s_expm1_linux_x86.S} | 370 +++--- .../jsvml_s_hypot_linux_x86.S} | 276 ++--- .../jsvml_s_log10_linux_x86.S} | 342 +++--- .../jsvml_s_log1p_linux_x86.S} | 382 +++--- .../jsvml_s_log_linux_x86.S} | 396 +++--- .../jsvml_s_pow_linux_x86.S} | 472 +++---- .../jsvml_s_sin_linux_x86.S} | 414 +++---- .../jsvml_s_sinh_linux_x86.S} | 326 ++--- .../jsvml_s_tan_linux_x86.S} | 372 +++--- .../jsvml_s_tanh_linux_x86.S} | 318 ++--- .../globals_vectorApiSupport_windows.S.inc | 0 .../jsvml_d_acos_windows_x86.S} | 610 +++++----- .../jsvml_d_asin_windows_x86.S} | 574 ++++----- .../jsvml_d_atan2_windows_x86.S} | 904 +++++++------- .../jsvml_d_atan_windows_x86.S} | 636 +++++----- .../jsvml_d_cbrt_windows_x86.S} | 550 ++++----- .../jsvml_d_cos_windows_x86.S} | 880 +++++++------- .../jsvml_d_cosh_windows_x86.S} | 476 ++++---- .../jsvml_d_exp_windows_x86.S} | 432 +++---- .../jsvml_d_expm1_windows_x86.S} | 466 +++---- .../jsvml_d_hypot_windows_x86.S} | 320 ++--- .../jsvml_d_log10_windows_x86.S} | 444 +++---- .../jsvml_d_log1p_windows_x86.S} | 494 ++++---- .../jsvml_d_log_windows_x86.S} | 408 +++---- .../jsvml_d_pow_windows_x86.S} | 786 ++++++------ .../jsvml_d_sin_windows_x86.S} | 888 +++++++------- .../jsvml_d_sinh_windows_x86.S} | 574 ++++----- .../jsvml_d_tan_windows_x86.S} | 1080 ++++++++--------- .../jsvml_d_tanh_windows_x86.S} | 604 ++++----- .../jsvml_s_acos_windows_x86.S} | 320 ++--- .../jsvml_s_asin_windows_x86.S} | 296 ++--- .../jsvml_s_atan2_windows_x86.S} | 514 ++++---- .../jsvml_s_atan_windows_x86.S} | 416 +++---- .../jsvml_s_cbrt_windows_x86.S} | 426 +++---- .../jsvml_s_cos_windows_x86.S} | 260 ++-- .../jsvml_s_cosh_windows_x86.S} | 444 +++---- .../jsvml_s_exp_windows_x86.S} | 282 ++--- .../jsvml_s_expm1_windows_x86.S} | 330 ++--- .../jsvml_s_hypot_windows_x86.S} | 196 +-- .../jsvml_s_log10_windows_x86.S} | 294 ++--- .../jsvml_s_log1p_windows_x86.S} | 342 +++--- .../jsvml_s_log_windows_x86.S} | 298 ++--- .../jsvml_s_pow_windows_x86.S} | 480 ++++---- .../jsvml_s_sin_windows_x86.S} | 236 ++-- .../jsvml_s_sinh_windows_x86.S} | 460 +++---- .../jsvml_s_tan_windows_x86.S} | 294 ++--- .../jsvml_s_tanh_windows_x86.S} | 436 +++---- test/jdk/jdk/incubator/vector/ImageTest.java | 22 +- .../{LoadSvmlTest.java => LoadJsvmlTest.java} | 8 +- 78 files changed, 17882 insertions(+), 17882 deletions(-) rename src/jdk.incubator.vector/linux/native/{libsvml => libjsvml}/globals_vectorApiSupport_linux.S.inc (100%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_acos_linux_x86.S => libjsvml/jsvml_d_acos_linux_x86.S} (85%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_asin_linux_x86.S => libjsvml/jsvml_d_asin_linux_x86.S} (86%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_atan2_linux_x86.S => libjsvml/jsvml_d_atan2_linux_x86.S} (89%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_atan_linux_x86.S => libjsvml/jsvml_d_atan_linux_x86.S} (87%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_cbrt_linux_x86.S => libjsvml/jsvml_d_cbrt_linux_x86.S} (85%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_cos_linux_x86.S => libjsvml/jsvml_d_cos_linux_x86.S} (95%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_cosh_linux_x86.S => libjsvml/jsvml_d_cosh_linux_x86.S} (88%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_exp_linux_x86.S => libjsvml/jsvml_d_exp_linux_x86.S} (86%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_expm1_linux_x86.S => libjsvml/jsvml_d_expm1_linux_x86.S} (87%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_hypot_linux_x86.S => libjsvml/jsvml_d_hypot_linux_x86.S} (90%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_log10_linux_x86.S => libjsvml/jsvml_d_log10_linux_x86.S} (88%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_log1p_linux_x86.S => libjsvml/jsvml_d_log1p_linux_x86.S} (90%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_log_linux_x86.S => libjsvml/jsvml_d_log_linux_x86.S} (90%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_pow_linux_x86.S => libjsvml/jsvml_d_pow_linux_x86.S} (92%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_sin_linux_x86.S => libjsvml/jsvml_d_sin_linux_x86.S} (95%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_sinh_linux_x86.S => libjsvml/jsvml_d_sinh_linux_x86.S} (91%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_tan_linux_x86.S => libjsvml/jsvml_d_tan_linux_x86.S} (97%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_d_tanh_linux_x86.S => libjsvml/jsvml_d_tanh_linux_x86.S} (91%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_acos_linux_x86.S => libjsvml/jsvml_s_acos_linux_x86.S} (90%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_asin_linux_x86.S => libjsvml/jsvml_s_asin_linux_x86.S} (90%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_atan2_linux_x86.S => libjsvml/jsvml_s_atan2_linux_x86.S} (90%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_atan_linux_x86.S => libjsvml/jsvml_s_atan_linux_x86.S} (86%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_cbrt_linux_x86.S => libjsvml/jsvml_s_cbrt_linux_x86.S} (87%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_cos_linux_x86.S => libjsvml/jsvml_s_cos_linux_x86.S} (94%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_cosh_linux_x86.S => libjsvml/jsvml_s_cosh_linux_x86.S} (92%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_exp_linux_x86.S => libjsvml/jsvml_s_exp_linux_x86.S} (88%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_expm1_linux_x86.S => libjsvml/jsvml_s_expm1_linux_x86.S} (89%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_hypot_linux_x86.S => libjsvml/jsvml_s_hypot_linux_x86.S} (92%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_log10_linux_x86.S => libjsvml/jsvml_s_log10_linux_x86.S} (89%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_log1p_linux_x86.S => libjsvml/jsvml_s_log1p_linux_x86.S} (89%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_log_linux_x86.S => libjsvml/jsvml_s_log_linux_x86.S} (86%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_pow_linux_x86.S => libjsvml/jsvml_s_pow_linux_x86.S} (95%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_sin_linux_x86.S => libjsvml/jsvml_s_sin_linux_x86.S} (94%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_sinh_linux_x86.S => libjsvml/jsvml_s_sinh_linux_x86.S} (93%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_tan_linux_x86.S => libjsvml/jsvml_s_tan_linux_x86.S} (95%) rename src/jdk.incubator.vector/linux/native/{libsvml/svml_s_tanh_linux_x86.S => libjsvml/jsvml_s_tanh_linux_x86.S} (90%) rename src/jdk.incubator.vector/windows/native/{libsvml => libjsvml}/globals_vectorApiSupport_windows.S.inc (100%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_acos_windows_x86.S => libjsvml/jsvml_d_acos_windows_x86.S} (79%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_asin_windows_x86.S => libjsvml/jsvml_d_asin_windows_x86.S} (80%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_atan2_windows_x86.S => libjsvml/jsvml_d_atan2_windows_x86.S} (81%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_atan_windows_x86.S => libjsvml/jsvml_d_atan_windows_x86.S} (78%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_cbrt_windows_x86.S => libjsvml/jsvml_d_cbrt_windows_x86.S} (76%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_cos_windows_x86.S => libjsvml/jsvml_d_cos_windows_x86.S} (90%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_cosh_windows_x86.S => libjsvml/jsvml_d_cosh_windows_x86.S} (80%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_exp_windows_x86.S => libjsvml/jsvml_d_exp_windows_x86.S} (78%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_expm1_windows_x86.S => libjsvml/jsvml_d_expm1_windows_x86.S} (81%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_hypot_windows_x86.S => libjsvml/jsvml_d_hypot_windows_x86.S} (87%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_log10_windows_x86.S => libjsvml/jsvml_d_log10_windows_x86.S} (85%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_log1p_windows_x86.S => libjsvml/jsvml_d_log1p_windows_x86.S} (86%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_log_windows_x86.S => libjsvml/jsvml_d_log_windows_x86.S} (87%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_pow_windows_x86.S => libjsvml/jsvml_d_pow_windows_x86.S} (88%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_sin_windows_x86.S => libjsvml/jsvml_d_sin_windows_x86.S} (90%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_sinh_windows_x86.S => libjsvml/jsvml_d_sinh_windows_x86.S} (87%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_tan_windows_x86.S => libjsvml/jsvml_d_tan_windows_x86.S} (89%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_d_tanh_windows_x86.S => libjsvml/jsvml_d_tanh_windows_x86.S} (79%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_acos_windows_x86.S => libjsvml/jsvml_s_acos_windows_x86.S} (86%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_asin_windows_x86.S => libjsvml/jsvml_s_asin_windows_x86.S} (86%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_atan2_windows_x86.S => libjsvml/jsvml_s_atan2_windows_x86.S} (85%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_atan_windows_x86.S => libjsvml/jsvml_s_atan_windows_x86.S} (81%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_cbrt_windows_x86.S => libjsvml/jsvml_s_cbrt_windows_x86.S} (76%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_cos_windows_x86.S => libjsvml/jsvml_s_cos_windows_x86.S} (90%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_cosh_windows_x86.S => libjsvml/jsvml_s_cosh_windows_x86.S} (78%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_exp_windows_x86.S => libjsvml/jsvml_s_exp_windows_x86.S} (83%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_expm1_windows_x86.S => libjsvml/jsvml_s_expm1_windows_x86.S} (83%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_hypot_windows_x86.S => libjsvml/jsvml_s_hypot_windows_x86.S} (90%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_log10_windows_x86.S => libjsvml/jsvml_s_log10_windows_x86.S} (81%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_log1p_windows_x86.S => libjsvml/jsvml_s_log1p_windows_x86.S} (83%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_log_windows_x86.S => libjsvml/jsvml_s_log_windows_x86.S} (80%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_pow_windows_x86.S => libjsvml/jsvml_s_pow_windows_x86.S} (92%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_sin_windows_x86.S => libjsvml/jsvml_s_sin_windows_x86.S} (91%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_sinh_windows_x86.S => libjsvml/jsvml_s_sinh_windows_x86.S} (80%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_tan_windows_x86.S => libjsvml/jsvml_s_tan_windows_x86.S} (91%) rename src/jdk.incubator.vector/windows/native/{libsvml/svml_s_tanh_windows_x86.S => libjsvml/jsvml_s_tanh_windows_x86.S} (73%) rename test/jdk/jdk/incubator/vector/{LoadSvmlTest.java => LoadJsvmlTest.java} (93%) diff --git a/make/modules/jdk.incubator.vector/Lib.gmk b/make/modules/jdk.incubator.vector/Lib.gmk index a759b5b6745..bab2c9fe8a5 100644 --- a/make/modules/jdk.incubator.vector/Lib.gmk +++ b/make/modules/jdk.incubator.vector/Lib.gmk @@ -28,15 +28,15 @@ include LibCommon.gmk ################################################################################ ifeq ($(call isTargetOs, linux windows)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2), true+true+true) - $(eval $(call SetupJdkLibrary, BUILD_LIBSVML, \ - NAME := svml, \ + $(eval $(call SetupJdkLibrary, BUILD_LIBJSVML, \ + NAME := jsvml, \ CFLAGS := $(CFLAGS_JDKLIB), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_windows := -defaultlib:msvcrt, \ )) - TARGETS += $(BUILD_LIBSVML) + TARGETS += $(BUILD_LIBJSVML) endif ################################################################################ diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index c23b5edc3fb..24509e694a6 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -7833,15 +7833,15 @@ address generate_avx_ghash_processBlocks() { } // Get svml stub routine addresses - void *libsvml = NULL; + void *libjsvml = NULL; char ebuf[1024]; char dll_name[JVM_MAXPATHLEN]; - if (os::dll_locate_lib(dll_name, sizeof(dll_name), Arguments::get_dll_dir(), "svml")) { - libsvml = os::dll_load(dll_name, ebuf, sizeof ebuf); + if (os::dll_locate_lib(dll_name, sizeof(dll_name), Arguments::get_dll_dir(), "jsvml")) { + libjsvml = os::dll_load(dll_name, ebuf, sizeof ebuf); } - if (libsvml != NULL) { + if (libjsvml != NULL) { // SVML method naming convention - // All the methods are named as __svml_op_ha_ + // All the methods are named as __jsvml_op_ha_ // Where: // ha stands for high accuracy // is optional to indicate float/double @@ -7852,10 +7852,10 @@ address generate_avx_ghash_processBlocks() { // e.g. 128 bit float vector has 4 float elements // indicates the avx/sse level: // z0 is AVX512, l9 is AVX2, e9 is AVX1 and ex is for SSE2 - // e.g. __svml_expf16_ha_z0 is the method for computing 16 element vector float exp using AVX 512 insns - // __svml_exp8_ha_z0 is the method for computing 8 element vector double exp using AVX 512 insns + // e.g. __jsvml_expf16_ha_z0 is the method for computing 16 element vector float exp using AVX 512 insns + // __jsvml_exp8_ha_z0 is the method for computing 8 element vector double exp using AVX 512 insns - log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, JNI_LIB_PREFIX "svml" JNI_LIB_SUFFIX, p2i(libsvml)); + log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, JNI_LIB_PREFIX "jsvml" JNI_LIB_SUFFIX, p2i(libjsvml)); if (UseAVX > 2) { for (int op = 0; op < VectorSupport::NUM_SVML_OP; op++) { int vop = VectorSupport::VECTOR_OP_SVML_START + op; @@ -7863,11 +7863,11 @@ address generate_avx_ghash_processBlocks() { (vop == VectorSupport::VECTOR_OP_LOG || vop == VectorSupport::VECTOR_OP_LOG10 || vop == VectorSupport::VECTOR_OP_POW)) { continue; } - snprintf(ebuf, sizeof(ebuf), "__svml_%sf16_ha_z0", VectorSupport::svmlname[op]); - StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf16_ha_z0", VectorSupport::svmlname[op]); + StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libjsvml, ebuf); - snprintf(ebuf, sizeof(ebuf), "__svml_%s8_ha_z0", VectorSupport::svmlname[op]); - StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%s8_ha_z0", VectorSupport::svmlname[op]); + StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libjsvml, ebuf); } } const char* avx_sse_str = (UseAVX >= 2) ? "l9" : ((UseAVX == 1) ? "e9" : "ex"); @@ -7876,23 +7876,23 @@ address generate_avx_ghash_processBlocks() { if (vop == VectorSupport::VECTOR_OP_POW) { continue; } - snprintf(ebuf, sizeof(ebuf), "__svml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str); - StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str); + StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libjsvml, ebuf); - snprintf(ebuf, sizeof(ebuf), "__svml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str); - StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str); + StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libjsvml, ebuf); - snprintf(ebuf, sizeof(ebuf), "__svml_%sf8_ha_%s", VectorSupport::svmlname[op], avx_sse_str); - StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf8_ha_%s", VectorSupport::svmlname[op], avx_sse_str); + StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libjsvml, ebuf); - snprintf(ebuf, sizeof(ebuf), "__svml_%s1_ha_%s", VectorSupport::svmlname[op], avx_sse_str); - StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%s1_ha_%s", VectorSupport::svmlname[op], avx_sse_str); + StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libjsvml, ebuf); - snprintf(ebuf, sizeof(ebuf), "__svml_%s2_ha_%s", VectorSupport::svmlname[op], avx_sse_str); - StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%s2_ha_%s", VectorSupport::svmlname[op], avx_sse_str); + StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libjsvml, ebuf); - snprintf(ebuf, sizeof(ebuf), "__svml_%s4_ha_%s", VectorSupport::svmlname[op], avx_sse_str); - StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libsvml, ebuf); + snprintf(ebuf, sizeof(ebuf), "__jsvml_%s4_ha_%s", VectorSupport::svmlname[op], avx_sse_str); + StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libjsvml, ebuf); } } #endif // COMPILER2 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/globals_vectorApiSupport_linux.S.inc b/src/jdk.incubator.vector/linux/native/libjsvml/globals_vectorApiSupport_linux.S.inc similarity index 100% rename from src/jdk.incubator.vector/linux/native/libsvml/globals_vectorApiSupport_linux.S.inc rename to src/jdk.incubator.vector/linux/native/libjsvml/globals_vectorApiSupport_linux.S.inc diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_acos_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_acos_linux_x86.S similarity index 85% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_acos_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_acos_linux_x86.S index 611e01543c0..8953c86e981 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_acos_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_acos_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_acos.c" .text ..TXTST0: -.L_2__routine_start___svml_acos2_ha_l9_0: -# -- Begin __svml_acos2_ha_l9 +.L_2__routine_start___jsvml_acos2_ha_l9_0: +# -- Begin __jsvml_acos2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_acos2_ha_l9 -# --- __svml_acos2_ha_l9(__m128d) -__svml_acos2_ha_l9: + .globl __jsvml_acos2_ha_l9 +# --- __jsvml_acos2_ha_l9(__m128d) +__jsvml_acos2_ha_l9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_acos2_ha_l9: .byte 30 #253.546 .byte 250 #253.546 .cfi_startproc -..___tag_value___svml_acos2_ha_l9.1: +..___tag_value___jsvml_acos2_ha_l9.1: ..L2: #155.1 pushq %rbp #155.1 @@ -58,15 +58,15 @@ __svml_acos2_ha_l9: andq $-64, %rsp #155.1 subq $192, %rsp #155.1 vmovapd %xmm0, %xmm7 #155.1 - vmovupd __svml_dacos_ha_data_internal(%rip), %xmm8 #192.44 - vmovupd 64+__svml_dacos_ha_data_internal(%rip), %xmm10 #193.45 + vmovupd __jsvml_dacos_ha_data_internal(%rip), %xmm8 #192.44 + vmovupd 64+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #193.45 vorpd %xmm7, %xmm8, %xmm6 #195.8 vfmadd231pd %xmm6, %xmm10, %xmm10 #198.8 vandpd %xmm7, %xmm8, %xmm5 #196.12 - vmovupd 256+__svml_dacos_ha_data_internal(%rip), %xmm9 #194.42 + vmovupd 256+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #194.42 vmulpd %xmm6, %xmm6, %xmm11 #199.9 vcvtpd2ps %xmm10, %xmm13 #204.546 - vcmpltpd 128+__svml_dacos_ha_data_internal(%rip), %xmm10, %xmm0 #204.717 + vcmpltpd 128+__jsvml_dacos_ha_data_internal(%rip), %xmm10, %xmm0 #204.717 vminpd %xmm10, %xmm11, %xmm4 #200.9 vcmpnlepd %xmm6, %xmm9, %xmm12 #197.13 vaddpd %xmm10, %xmm10, %xmm2 #204.810 @@ -80,45 +80,45 @@ __svml_acos2_ha_l9: vandnpd %xmm6, %xmm3, %xmm6 #241.12 vmulpd %xmm8, %xmm8, %xmm9 #204.1112 vmulpd %xmm12, %xmm8, %xmm2 #204.1207 - vfmsub213pd 384+__svml_dacos_ha_data_internal(%rip), %xmm12, %xmm9 #204.1154 - vmovupd 448+__svml_dacos_ha_data_internal(%rip), %xmm1 #204.1688 + vfmsub213pd 384+__jsvml_dacos_ha_data_internal(%rip), %xmm12, %xmm9 #204.1154 + vmovupd 448+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #204.1688 vorpd %xmm6, %xmm2, %xmm6 #245.13 - vmovupd 832+__svml_dacos_ha_data_internal(%rip), %xmm13 #210.15 - vmovupd 960+__svml_dacos_ha_data_internal(%rip), %xmm0 #214.14 - vmovupd 1088+__svml_dacos_ha_data_internal(%rip), %xmm14 #217.14 - vfmadd213pd 512+__svml_dacos_ha_data_internal(%rip), %xmm9, %xmm1 #204.1688 + vmovupd 832+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #210.15 + vmovupd 960+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #214.14 + vmovupd 1088+__jsvml_dacos_ha_data_internal(%rip), %xmm14 #217.14 + vfmadd213pd 512+__jsvml_dacos_ha_data_internal(%rip), %xmm9, %xmm1 #204.1688 vfmsub213pd %xmm2, %xmm8, %xmm12 #204.1246 - vfmadd213pd 896+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm13 #210.15 - vfmadd213pd 1024+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm0 #214.14 - vfmadd213pd 1152+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm14 #217.14 - vfmadd213pd 576+__svml_dacos_ha_data_internal(%rip), %xmm9, %xmm1 #204.1792 - vandnpd 1664+__svml_dacos_ha_data_internal(%rip), %xmm3, %xmm10 #240.15 + vfmadd213pd 896+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm13 #210.15 + vfmadd213pd 1024+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm0 #214.14 + vfmadd213pd 1152+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm14 #217.14 + vfmadd213pd 576+__jsvml_dacos_ha_data_internal(%rip), %xmm9, %xmm1 #204.1792 + vandnpd 1664+__jsvml_dacos_ha_data_internal(%rip), %xmm3, %xmm10 #240.15 vmulpd %xmm4, %xmm4, %xmm8 #211.13 - vfmadd213pd 640+__svml_dacos_ha_data_internal(%rip), %xmm9, %xmm1 #204.1855 + vfmadd213pd 640+__jsvml_dacos_ha_data_internal(%rip), %xmm9, %xmm1 #204.1855 vfmadd213pd %xmm14, %xmm8, %xmm0 #219.14 vmulpd %xmm2, %xmm9, %xmm11 #204.1746 vmulpd %xmm8, %xmm8, %xmm15 #220.13 vfmsub213pd %xmm12, %xmm11, %xmm1 #204.1913 - vmovupd 704+__svml_dacos_ha_data_internal(%rip), %xmm9 #209.12 - vfmadd213pd 768+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #209.12 + vmovupd 704+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #209.12 + vfmadd213pd 768+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #209.12 vsubpd %xmm1, %xmm6, %xmm2 #246.12 vfmadd213pd %xmm13, %xmm8, %xmm9 #218.12 - vmovupd 1216+__svml_dacos_ha_data_internal(%rip), %xmm13 #223.14 - vfmadd213pd 1280+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm13 #223.14 + vmovupd 1216+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #223.14 + vfmadd213pd 1280+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm13 #223.14 vfmadd213pd %xmm0, %xmm15, %xmm9 #224.12 vfmadd213pd %xmm13, %xmm8, %xmm9 #225.12 - vandnpd 1600+__svml_dacos_ha_data_internal(%rip), %xmm3, %xmm8 #239.15 - vfmadd213pd 1344+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #228.12 - vfmadd213pd 1408+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #229.12 + vandnpd 1600+__jsvml_dacos_ha_data_internal(%rip), %xmm3, %xmm8 #239.15 + vfmadd213pd 1344+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #228.12 + vfmadd213pd 1408+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #229.12 vmulpd %xmm9, %xmm4, %xmm0 #230.12 vcmpnltpd %xmm7, %xmm4, %xmm4 #231.17 vandpd %xmm3, %xmm4, %xmm4 #234.17 - vandpd 1472+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #235.14 + vandpd 1472+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm9 #235.14 vorpd %xmm9, %xmm8, %xmm3 #242.15 vxorpd %xmm5, %xmm3, %xmm3 #244.15 vsubpd %xmm1, %xmm3, %xmm1 #247.14 vfmadd213pd %xmm1, %xmm2, %xmm0 #248.14 - vandpd 1536+__svml_dacos_ha_data_internal(%rip), %xmm4, %xmm11 #236.14 + vandpd 1536+__jsvml_dacos_ha_data_internal(%rip), %xmm4, %xmm11 #236.14 vorpd %xmm11, %xmm10, %xmm4 #243.15 vaddpd %xmm0, %xmm6, %xmm0 #249.14 vxorpd %xmm5, %xmm0, %xmm5 #250.14 @@ -178,29 +178,29 @@ __svml_acos2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #253.546 lea 128(%rsp,%r12,8), %rsi #253.546 -..___tag_value___svml_acos2_ha_l9.19: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #253.546 -..___tag_value___svml_acos2_ha_l9.20: +..___tag_value___jsvml_acos2_ha_l9.19: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #253.546 +..___tag_value___jsvml_acos2_ha_l9.20: jmp ..B1.8 # Prob 100% #253.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acos2_ha_l9,@function - .size __svml_acos2_ha_l9,.-__svml_acos2_ha_l9 -..LN__svml_acos2_ha_l9.0: + .type __jsvml_acos2_ha_l9,@function + .size __jsvml_acos2_ha_l9,.-__jsvml_acos2_ha_l9 +..LN__jsvml_acos2_ha_l9.0: .data -# -- End __svml_acos2_ha_l9 +# -- End __jsvml_acos2_ha_l9 .text -.L_2__routine_start___svml_acos1_ha_ex_1: -# -- Begin __svml_acos1_ha_ex +.L_2__routine_start___jsvml_acos1_ha_ex_1: +# -- Begin __jsvml_acos1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_acos1_ha_ex -# --- __svml_acos1_ha_ex(__m128d) -__svml_acos1_ha_ex: + .globl __jsvml_acos1_ha_ex +# --- __jsvml_acos1_ha_ex(__m128d) +__jsvml_acos1_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -209,7 +209,7 @@ __svml_acos1_ha_ex: .byte 30 #359.546 .byte 250 #359.546 .cfi_startproc -..___tag_value___svml_acos1_ha_ex.22: +..___tag_value___jsvml_acos1_ha_ex.22: ..L23: #261.1 pushq %rbp #261.1 @@ -220,11 +220,11 @@ __svml_acos1_ha_ex: andq $-64, %rsp #261.1 subq $128, %rsp #261.1 movaps %xmm0, %xmm7 #261.1 - movsd __svml_dacos_ha_data_internal(%rip), %xmm5 #298.13 + movsd __jsvml_dacos_ha_data_internal(%rip), %xmm5 #298.13 movaps %xmm5, %xmm6 #301.8 andps %xmm7, %xmm5 #302.12 orps %xmm7, %xmm6 #301.8 - movsd 64+__svml_dacos_ha_data_internal(%rip), %xmm9 #299.14 + movsd 64+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #299.14 movaps %xmm6, %xmm0 #304.20 mulsd %xmm9, %xmm0 #304.20 movaps %xmm6, %xmm4 #305.9 @@ -240,33 +240,33 @@ __svml_acos1_ha_ex: movaps %xmm6, %xmm11 #303.13 minpd %xmm10, %xmm4 #306.9 cvtps2pd %xmm13, %xmm14 #310.504 - cmpltsd 128+__svml_dacos_ha_data_internal(%rip), %xmm15 #310.717 + cmpltsd 128+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #310.717 movaps %xmm4, %xmm3 #309.14 andnps %xmm14, %xmm15 #310.760 - movsd 320+__svml_dacos_ha_data_internal(%rip), %xmm2 #310.1157 + movsd 320+__jsvml_dacos_ha_data_internal(%rip), %xmm2 #310.1157 movaps %xmm4, %xmm10 #316.27 - movsd 256+__svml_dacos_ha_data_internal(%rip), %xmm8 #300.11 + movsd 256+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #300.11 movaps %xmm4, %xmm14 #317.13 movaps %xmm4, %xmm13 #320.26 cmpnltsd %xmm0, %xmm3 #309.14 - mulsd 832+__svml_dacos_ha_data_internal(%rip), %xmm10 #316.27 + mulsd 832+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #316.27 addsd %xmm0, %xmm0 #310.810 cmpnlesd %xmm6, %xmm8 #303.13 mulsd %xmm4, %xmm14 #317.13 - mulsd 960+__svml_dacos_ha_data_internal(%rip), %xmm13 #320.26 - addsd 896+__svml_dacos_ha_data_internal(%rip), %xmm10 #316.15 - addsd 1024+__svml_dacos_ha_data_internal(%rip), %xmm13 #320.14 + mulsd 960+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #320.26 + addsd 896+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #316.15 + addsd 1024+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #320.14 andps %xmm3, %xmm0 #310.846 movsd %xmm8, %xmm11 #303.13 andps %xmm0, %xmm2 #310.1157 movaps %xmm14, %xmm12 #326.13 movmskpd %xmm11, %eax #308.40 movaps %xmm4, %xmm11 #323.26 - mulsd 1088+__svml_dacos_ha_data_internal(%rip), %xmm11 #323.26 + mulsd 1088+__jsvml_dacos_ha_data_internal(%rip), %xmm11 #323.26 subsd %xmm2, %xmm0 #310.1203 mulsd %xmm15, %xmm2 #310.1241 mulsd %xmm14, %xmm13 #325.26 - addsd 1152+__svml_dacos_ha_data_internal(%rip), %xmm11 #323.14 + addsd 1152+__jsvml_dacos_ha_data_internal(%rip), %xmm11 #323.14 mulsd %xmm15, %xmm0 #310.1279 mulsd %xmm14, %xmm12 #326.13 addsd %xmm11, %xmm13 #325.14 @@ -276,40 +276,40 @@ __svml_acos1_ha_ex: movaps %xmm2, %xmm9 #310.1488 addsd %xmm0, %xmm9 #310.1488 mulsd %xmm15, %xmm1 #310.1359 - subsd 384+__svml_dacos_ha_data_internal(%rip), %xmm8 #310.1400 + subsd 384+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #310.1400 movaps %xmm3, %xmm11 #346.15 addsd %xmm1, %xmm8 #310.1445 - movsd 448+__svml_dacos_ha_data_internal(%rip), %xmm1 #310.1913 + movsd 448+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #310.1913 mulsd %xmm8, %xmm1 #310.1913 mulsd %xmm8, %xmm9 #310.1971 - addsd 512+__svml_dacos_ha_data_internal(%rip), %xmm1 #310.1901 + addsd 512+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #310.1901 mulsd %xmm8, %xmm1 #310.2029 - movsd 1664+__svml_dacos_ha_data_internal(%rip), %xmm15 #344.15 + movsd 1664+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #344.15 andnps %xmm15, %xmm11 #346.15 - addsd 576+__svml_dacos_ha_data_internal(%rip), %xmm1 #310.2017 + addsd 576+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #310.2017 mulsd %xmm8, %xmm1 #310.2104 movaps %xmm4, %xmm8 #329.26 - mulsd 1216+__svml_dacos_ha_data_internal(%rip), %xmm8 #329.26 - addsd 640+__svml_dacos_ha_data_internal(%rip), %xmm1 #310.2092 - addsd 1280+__svml_dacos_ha_data_internal(%rip), %xmm8 #329.14 + mulsd 1216+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #329.26 + addsd 640+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #310.2092 + addsd 1280+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #329.14 mulsd %xmm9, %xmm1 #310.2174 - movsd 1472+__svml_dacos_ha_data_internal(%rip), %xmm9 #341.14 + movsd 1472+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #341.14 subsd %xmm0, %xmm1 #310.2162 movaps %xmm4, %xmm0 #315.24 - mulsd 704+__svml_dacos_ha_data_internal(%rip), %xmm0 #315.24 - addsd 768+__svml_dacos_ha_data_internal(%rip), %xmm0 #315.12 + mulsd 704+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #315.24 + addsd 768+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #315.12 mulsd %xmm14, %xmm0 #324.24 addsd %xmm10, %xmm0 #324.12 - movsd 1536+__svml_dacos_ha_data_internal(%rip), %xmm10 #342.14 + movsd 1536+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #342.14 mulsd %xmm12, %xmm0 #330.24 addsd %xmm13, %xmm0 #330.12 mulsd %xmm14, %xmm0 #331.24 addsd %xmm8, %xmm0 #331.12 movaps %xmm3, %xmm8 #345.15 mulsd %xmm4, %xmm0 #334.24 - addsd 1344+__svml_dacos_ha_data_internal(%rip), %xmm0 #334.12 + addsd 1344+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #334.12 mulsd %xmm4, %xmm0 #335.24 - addsd 1408+__svml_dacos_ha_data_internal(%rip), %xmm0 #335.12 + addsd 1408+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #335.12 mulsd %xmm4, %xmm0 #336.12 cmpnltsd %xmm7, %xmm4 #337.17 andps %xmm3, %xmm4 #340.17 @@ -318,7 +318,7 @@ __svml_acos1_ha_ex: andps %xmm4, %xmm9 #341.14 movaps %xmm2, %xmm3 #352.12 andps %xmm4, %xmm10 #342.14 - movsd 1600+__svml_dacos_ha_data_internal(%rip), %xmm4 #343.15 + movsd 1600+__jsvml_dacos_ha_data_internal(%rip), %xmm4 #343.15 orps %xmm10, %xmm11 #349.15 andnps %xmm4, %xmm8 #345.15 subsd %xmm1, %xmm3 #352.12 @@ -364,29 +364,29 @@ __svml_acos1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #359.546 lea 64(%rsp), %rsi #359.546 -..___tag_value___svml_acos1_ha_ex.35: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #359.546 -..___tag_value___svml_acos1_ha_ex.36: +..___tag_value___jsvml_acos1_ha_ex.35: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #359.546 +..___tag_value___jsvml_acos1_ha_ex.36: jmp ..B2.4 # Prob 100% #359.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_acos1_ha_ex,@function - .size __svml_acos1_ha_ex,.-__svml_acos1_ha_ex -..LN__svml_acos1_ha_ex.1: + .type __jsvml_acos1_ha_ex,@function + .size __jsvml_acos1_ha_ex,.-__jsvml_acos1_ha_ex +..LN__jsvml_acos1_ha_ex.1: .data -# -- End __svml_acos1_ha_ex +# -- End __jsvml_acos1_ha_ex .text -.L_2__routine_start___svml_acos1_ha_e9_2: -# -- Begin __svml_acos1_ha_e9 +.L_2__routine_start___jsvml_acos1_ha_e9_2: +# -- Begin __jsvml_acos1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_acos1_ha_e9 -# --- __svml_acos1_ha_e9(__m128d) -__svml_acos1_ha_e9: + .globl __jsvml_acos1_ha_e9 +# --- __jsvml_acos1_ha_e9(__m128d) +__jsvml_acos1_ha_e9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -395,7 +395,7 @@ __svml_acos1_ha_e9: .byte 30 #1217.546 .byte 250 #1217.546 .cfi_startproc -..___tag_value___svml_acos1_ha_e9.38: +..___tag_value___jsvml_acos1_ha_e9.38: ..L39: #1119.1 pushq %rbp #1119.1 @@ -406,11 +406,11 @@ __svml_acos1_ha_e9: andq $-64, %rsp #1119.1 subq $128, %rsp #1119.1 movaps %xmm0, %xmm7 #1119.1 - movsd __svml_dacos_ha_data_internal(%rip), %xmm5 #1156.13 + movsd __jsvml_dacos_ha_data_internal(%rip), %xmm5 #1156.13 movaps %xmm5, %xmm6 #1159.8 andps %xmm7, %xmm5 #1160.12 orps %xmm7, %xmm6 #1159.8 - movsd 64+__svml_dacos_ha_data_internal(%rip), %xmm9 #1157.14 + movsd 64+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1157.14 movaps %xmm6, %xmm0 #1162.20 mulsd %xmm9, %xmm0 #1162.20 movaps %xmm6, %xmm4 #1163.9 @@ -426,33 +426,33 @@ __svml_acos1_ha_e9: movaps %xmm6, %xmm11 #1161.13 minpd %xmm10, %xmm4 #1164.9 cvtps2pd %xmm13, %xmm14 #1168.504 - cmpltsd 128+__svml_dacos_ha_data_internal(%rip), %xmm15 #1168.717 + cmpltsd 128+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1168.717 movaps %xmm4, %xmm3 #1167.14 andnps %xmm14, %xmm15 #1168.760 - movsd 320+__svml_dacos_ha_data_internal(%rip), %xmm2 #1168.1157 + movsd 320+__jsvml_dacos_ha_data_internal(%rip), %xmm2 #1168.1157 movaps %xmm4, %xmm10 #1174.27 - movsd 256+__svml_dacos_ha_data_internal(%rip), %xmm8 #1158.11 + movsd 256+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1158.11 movaps %xmm4, %xmm14 #1175.13 movaps %xmm4, %xmm13 #1178.26 cmpnltsd %xmm0, %xmm3 #1167.14 - mulsd 832+__svml_dacos_ha_data_internal(%rip), %xmm10 #1174.27 + mulsd 832+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1174.27 addsd %xmm0, %xmm0 #1168.810 cmpnlesd %xmm6, %xmm8 #1161.13 mulsd %xmm4, %xmm14 #1175.13 - mulsd 960+__svml_dacos_ha_data_internal(%rip), %xmm13 #1178.26 - addsd 896+__svml_dacos_ha_data_internal(%rip), %xmm10 #1174.15 - addsd 1024+__svml_dacos_ha_data_internal(%rip), %xmm13 #1178.14 + mulsd 960+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1178.26 + addsd 896+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1174.15 + addsd 1024+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1178.14 andps %xmm3, %xmm0 #1168.846 movsd %xmm8, %xmm11 #1161.13 andps %xmm0, %xmm2 #1168.1157 movaps %xmm14, %xmm12 #1184.13 movmskpd %xmm11, %eax #1166.40 movaps %xmm4, %xmm11 #1181.26 - mulsd 1088+__svml_dacos_ha_data_internal(%rip), %xmm11 #1181.26 + mulsd 1088+__jsvml_dacos_ha_data_internal(%rip), %xmm11 #1181.26 subsd %xmm2, %xmm0 #1168.1203 mulsd %xmm15, %xmm2 #1168.1241 mulsd %xmm14, %xmm13 #1183.26 - addsd 1152+__svml_dacos_ha_data_internal(%rip), %xmm11 #1181.14 + addsd 1152+__jsvml_dacos_ha_data_internal(%rip), %xmm11 #1181.14 mulsd %xmm15, %xmm0 #1168.1279 mulsd %xmm14, %xmm12 #1184.13 addsd %xmm11, %xmm13 #1183.14 @@ -462,40 +462,40 @@ __svml_acos1_ha_e9: movaps %xmm2, %xmm9 #1168.1488 addsd %xmm0, %xmm9 #1168.1488 mulsd %xmm15, %xmm1 #1168.1359 - subsd 384+__svml_dacos_ha_data_internal(%rip), %xmm8 #1168.1400 + subsd 384+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1168.1400 movaps %xmm3, %xmm11 #1204.15 addsd %xmm1, %xmm8 #1168.1445 - movsd 448+__svml_dacos_ha_data_internal(%rip), %xmm1 #1168.1913 + movsd 448+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1168.1913 mulsd %xmm8, %xmm1 #1168.1913 mulsd %xmm8, %xmm9 #1168.1971 - addsd 512+__svml_dacos_ha_data_internal(%rip), %xmm1 #1168.1901 + addsd 512+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1168.1901 mulsd %xmm8, %xmm1 #1168.2029 - movsd 1664+__svml_dacos_ha_data_internal(%rip), %xmm15 #1202.15 + movsd 1664+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1202.15 andnps %xmm15, %xmm11 #1204.15 - addsd 576+__svml_dacos_ha_data_internal(%rip), %xmm1 #1168.2017 + addsd 576+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1168.2017 mulsd %xmm8, %xmm1 #1168.2104 movaps %xmm4, %xmm8 #1187.26 - mulsd 1216+__svml_dacos_ha_data_internal(%rip), %xmm8 #1187.26 - addsd 640+__svml_dacos_ha_data_internal(%rip), %xmm1 #1168.2092 - addsd 1280+__svml_dacos_ha_data_internal(%rip), %xmm8 #1187.14 + mulsd 1216+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1187.26 + addsd 640+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1168.2092 + addsd 1280+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1187.14 mulsd %xmm9, %xmm1 #1168.2174 - movsd 1472+__svml_dacos_ha_data_internal(%rip), %xmm9 #1199.14 + movsd 1472+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1199.14 subsd %xmm0, %xmm1 #1168.2162 movaps %xmm4, %xmm0 #1173.24 - mulsd 704+__svml_dacos_ha_data_internal(%rip), %xmm0 #1173.24 - addsd 768+__svml_dacos_ha_data_internal(%rip), %xmm0 #1173.12 + mulsd 704+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #1173.24 + addsd 768+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #1173.12 mulsd %xmm14, %xmm0 #1182.24 addsd %xmm10, %xmm0 #1182.12 - movsd 1536+__svml_dacos_ha_data_internal(%rip), %xmm10 #1200.14 + movsd 1536+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1200.14 mulsd %xmm12, %xmm0 #1188.24 addsd %xmm13, %xmm0 #1188.12 mulsd %xmm14, %xmm0 #1189.24 addsd %xmm8, %xmm0 #1189.12 movaps %xmm3, %xmm8 #1203.15 mulsd %xmm4, %xmm0 #1192.24 - addsd 1344+__svml_dacos_ha_data_internal(%rip), %xmm0 #1192.12 + addsd 1344+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #1192.12 mulsd %xmm4, %xmm0 #1193.24 - addsd 1408+__svml_dacos_ha_data_internal(%rip), %xmm0 #1193.12 + addsd 1408+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #1193.12 mulsd %xmm4, %xmm0 #1194.12 cmpnltsd %xmm7, %xmm4 #1195.17 andps %xmm3, %xmm4 #1198.17 @@ -504,7 +504,7 @@ __svml_acos1_ha_e9: andps %xmm4, %xmm9 #1199.14 movaps %xmm2, %xmm3 #1210.12 andps %xmm4, %xmm10 #1200.14 - movsd 1600+__svml_dacos_ha_data_internal(%rip), %xmm4 #1201.15 + movsd 1600+__jsvml_dacos_ha_data_internal(%rip), %xmm4 #1201.15 orps %xmm10, %xmm11 #1207.15 andnps %xmm4, %xmm8 #1203.15 subsd %xmm1, %xmm3 #1210.12 @@ -550,29 +550,29 @@ __svml_acos1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1217.546 lea 64(%rsp), %rsi #1217.546 -..___tag_value___svml_acos1_ha_e9.51: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #1217.546 -..___tag_value___svml_acos1_ha_e9.52: +..___tag_value___jsvml_acos1_ha_e9.51: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #1217.546 +..___tag_value___jsvml_acos1_ha_e9.52: jmp ..B3.4 # Prob 100% #1217.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_acos1_ha_e9,@function - .size __svml_acos1_ha_e9,.-__svml_acos1_ha_e9 -..LN__svml_acos1_ha_e9.2: + .type __jsvml_acos1_ha_e9,@function + .size __jsvml_acos1_ha_e9,.-__jsvml_acos1_ha_e9 +..LN__jsvml_acos1_ha_e9.2: .data -# -- End __svml_acos1_ha_e9 +# -- End __jsvml_acos1_ha_e9 .text -.L_2__routine_start___svml_acos4_ha_l9_3: -# -- Begin __svml_acos4_ha_l9 +.L_2__routine_start___jsvml_acos4_ha_l9_3: +# -- Begin __jsvml_acos4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_acos4_ha_l9 -# --- __svml_acos4_ha_l9(__m256d) -__svml_acos4_ha_l9: + .globl __jsvml_acos4_ha_l9 +# --- __jsvml_acos4_ha_l9(__m256d) +__jsvml_acos4_ha_l9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -581,7 +581,7 @@ __svml_acos4_ha_l9: .byte 30 #1323.552 .byte 250 #1323.552 .cfi_startproc -..___tag_value___svml_acos4_ha_l9.54: +..___tag_value___jsvml_acos4_ha_l9.54: ..L55: #1225.1 pushq %rbp #1225.1 @@ -591,58 +591,58 @@ __svml_acos4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1225.1 subq $192, %rsp #1225.1 - vmovupd __svml_dacos_ha_data_internal(%rip), %ymm8 #1262.47 - vmovupd 64+__svml_dacos_ha_data_internal(%rip), %ymm9 #1263.48 + vmovupd __jsvml_dacos_ha_data_internal(%rip), %ymm8 #1262.47 + vmovupd 64+__jsvml_dacos_ha_data_internal(%rip), %ymm9 #1263.48 vmovapd %ymm0, %ymm7 #1225.1 vorpd %ymm7, %ymm8, %ymm6 #1265.8 vfmadd231pd %ymm6, %ymm9, %ymm9 #1268.8 vmulpd %ymm6, %ymm6, %ymm10 #1269.9 - vcmpnge_uqpd 256+__svml_dacos_ha_data_internal(%rip), %ymm6, %ymm11 #1267.13 - vcmplt_oqpd 128+__svml_dacos_ha_data_internal(%rip), %ymm9, %ymm14 #1274.666 + vcmpnge_uqpd 256+__jsvml_dacos_ha_data_internal(%rip), %ymm6, %ymm11 #1267.13 + vcmplt_oqpd 128+__jsvml_dacos_ha_data_internal(%rip), %ymm9, %ymm14 #1274.666 vminpd %ymm9, %ymm10, %ymm4 #1270.9 vaddpd %ymm9, %ymm9, %ymm0 #1274.775 vcvtpd2ps %ymm9, %xmm12 #1274.533 vcmpnlt_uqpd %ymm9, %ymm4, %ymm3 #1273.14 vrsqrtps %xmm12, %xmm13 #1274.520 - vmovupd 832+__svml_dacos_ha_data_internal(%rip), %ymm12 #1280.15 + vmovupd 832+__jsvml_dacos_ha_data_internal(%rip), %ymm12 #1280.15 vcvtps2pd %xmm13, %ymm15 #1274.504 - vmovupd 1088+__svml_dacos_ha_data_internal(%rip), %ymm13 #1287.14 - vfmadd213pd 896+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm12 #1280.15 - vfmadd213pd 1152+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm13 #1287.14 + vmovupd 1088+__jsvml_dacos_ha_data_internal(%rip), %ymm13 #1287.14 + vfmadd213pd 896+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm12 #1280.15 + vfmadd213pd 1152+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm13 #1287.14 vmovmskpd %ymm11, %edx #1272.40 vandnpd %ymm15, %ymm14, %ymm1 #1274.722 vandpd %ymm3, %ymm0, %ymm11 #1274.814 vandpd %ymm7, %ymm8, %ymm5 #1266.12 vmulpd %ymm1, %ymm1, %ymm8 #1274.1089 vmulpd %ymm11, %ymm1, %ymm2 #1274.1190 - vmovupd 960+__svml_dacos_ha_data_internal(%rip), %ymm0 #1284.14 + vmovupd 960+__jsvml_dacos_ha_data_internal(%rip), %ymm0 #1284.14 vmulpd %ymm4, %ymm4, %ymm15 #1281.13 - vfmsub213pd 384+__svml_dacos_ha_data_internal(%rip), %ymm11, %ymm8 #1274.1134 + vfmsub213pd 384+__jsvml_dacos_ha_data_internal(%rip), %ymm11, %ymm8 #1274.1134 vfmsub213pd %ymm2, %ymm1, %ymm11 #1274.1232 - vmovupd 448+__svml_dacos_ha_data_internal(%rip), %ymm1 #1274.1689 - vfmadd213pd 1024+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm0 #1284.14 + vmovupd 448+__jsvml_dacos_ha_data_internal(%rip), %ymm1 #1274.1689 + vfmadd213pd 1024+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm0 #1284.14 vmulpd %ymm15, %ymm15, %ymm14 #1290.13 vmulpd %ymm2, %ymm8, %ymm10 #1274.1750 - vfmadd213pd 512+__svml_dacos_ha_data_internal(%rip), %ymm8, %ymm1 #1274.1689 + vfmadd213pd 512+__jsvml_dacos_ha_data_internal(%rip), %ymm8, %ymm1 #1274.1689 vfmadd213pd %ymm13, %ymm15, %ymm0 #1289.14 - vfmadd213pd 576+__svml_dacos_ha_data_internal(%rip), %ymm8, %ymm1 #1274.1799 - vfmadd213pd 640+__svml_dacos_ha_data_internal(%rip), %ymm8, %ymm1 #1274.1865 - vmovupd 704+__svml_dacos_ha_data_internal(%rip), %ymm8 #1279.12 + vfmadd213pd 576+__jsvml_dacos_ha_data_internal(%rip), %ymm8, %ymm1 #1274.1799 + vfmadd213pd 640+__jsvml_dacos_ha_data_internal(%rip), %ymm8, %ymm1 #1274.1865 + vmovupd 704+__jsvml_dacos_ha_data_internal(%rip), %ymm8 #1279.12 vfmsub213pd %ymm11, %ymm10, %ymm1 #1274.1926 - vfmadd213pd 768+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm8 #1279.12 + vfmadd213pd 768+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm8 #1279.12 vfmadd213pd %ymm12, %ymm15, %ymm8 #1288.12 - vmovupd 1216+__svml_dacos_ha_data_internal(%rip), %ymm12 #1293.14 + vmovupd 1216+__jsvml_dacos_ha_data_internal(%rip), %ymm12 #1293.14 vfmadd213pd %ymm0, %ymm14, %ymm8 #1294.12 - vfmadd213pd 1280+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm12 #1293.14 + vfmadd213pd 1280+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm12 #1293.14 vfmadd213pd %ymm12, %ymm15, %ymm8 #1295.12 - vfmadd213pd 1344+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm8 #1298.12 - vfmadd213pd 1408+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm8 #1299.12 + vfmadd213pd 1344+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm8 #1298.12 + vfmadd213pd 1408+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm8 #1299.12 vmulpd %ymm8, %ymm4, %ymm0 #1300.12 vcmpnlt_uqpd %ymm7, %ymm4, %ymm4 #1301.17 vandpd %ymm3, %ymm4, %ymm4 #1304.17 - vandpd 1472+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm9 #1305.14 - vandnpd 1600+__svml_dacos_ha_data_internal(%rip), %ymm3, %ymm8 #1309.15 - vandnpd 1664+__svml_dacos_ha_data_internal(%rip), %ymm3, %ymm10 #1310.15 + vandpd 1472+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm9 #1305.14 + vandnpd 1600+__jsvml_dacos_ha_data_internal(%rip), %ymm3, %ymm8 #1309.15 + vandnpd 1664+__jsvml_dacos_ha_data_internal(%rip), %ymm3, %ymm10 #1310.15 vandnpd %ymm6, %ymm3, %ymm6 #1311.12 vorpd %ymm9, %ymm8, %ymm3 #1312.15 vxorpd %ymm5, %ymm3, %ymm3 #1314.15 @@ -651,7 +651,7 @@ __svml_acos4_ha_l9: vsubpd %ymm1, %ymm3, %ymm1 #1317.14 vfmadd213pd %ymm1, %ymm2, %ymm0 #1318.14 vaddpd %ymm0, %ymm6, %ymm0 #1319.14 - vandpd 1536+__svml_dacos_ha_data_internal(%rip), %ymm4, %ymm11 #1306.14 + vandpd 1536+__jsvml_dacos_ha_data_internal(%rip), %ymm4, %ymm11 #1306.14 vorpd %ymm11, %ymm10, %ymm4 #1313.15 vxorpd %ymm5, %ymm0, %ymm5 #1320.14 vaddpd %ymm5, %ymm4, %ymm0 #1321.14 @@ -714,29 +714,29 @@ __svml_acos4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1323.552 lea 128(%rsp,%r12,8), %rsi #1323.552 -..___tag_value___svml_acos4_ha_l9.72: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #1323.552 -..___tag_value___svml_acos4_ha_l9.73: +..___tag_value___jsvml_acos4_ha_l9.72: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #1323.552 +..___tag_value___jsvml_acos4_ha_l9.73: jmp ..B4.8 # Prob 100% #1323.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acos4_ha_l9,@function - .size __svml_acos4_ha_l9,.-__svml_acos4_ha_l9 -..LN__svml_acos4_ha_l9.3: + .type __jsvml_acos4_ha_l9,@function + .size __jsvml_acos4_ha_l9,.-__jsvml_acos4_ha_l9 +..LN__jsvml_acos4_ha_l9.3: .data -# -- End __svml_acos4_ha_l9 +# -- End __jsvml_acos4_ha_l9 .text -.L_2__routine_start___svml_acos2_ha_e9_4: -# -- Begin __svml_acos2_ha_e9 +.L_2__routine_start___jsvml_acos2_ha_e9_4: +# -- Begin __jsvml_acos2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_acos2_ha_e9 -# --- __svml_acos2_ha_e9(__m128d) -__svml_acos2_ha_e9: + .globl __jsvml_acos2_ha_e9 +# --- __jsvml_acos2_ha_e9(__m128d) +__jsvml_acos2_ha_e9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -745,7 +745,7 @@ __svml_acos2_ha_e9: .byte 30 #1429.546 .byte 250 #1429.546 .cfi_startproc -..___tag_value___svml_acos2_ha_e9.75: +..___tag_value___jsvml_acos2_ha_e9.75: ..L76: #1331.1 pushq %rbp #1331.1 @@ -756,8 +756,8 @@ __svml_acos2_ha_e9: andq $-64, %rsp #1331.1 subq $192, %rsp #1331.1 movaps %xmm0, %xmm7 #1331.1 - movups __svml_dacos_ha_data_internal(%rip), %xmm5 #1368.44 - movups 64+__svml_dacos_ha_data_internal(%rip), %xmm8 #1369.45 + movups __jsvml_dacos_ha_data_internal(%rip), %xmm5 #1368.44 + movups 64+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1369.45 movaps %xmm5, %xmm6 #1371.8 orps %xmm7, %xmm6 #1371.8 movaps %xmm8, %xmm9 #1374.20 @@ -767,7 +767,7 @@ __svml_acos2_ha_e9: movaps %xmm8, %xmm1 #1380.717 cvtpd2ps %xmm8, %xmm11 #1380.546 mulpd %xmm6, %xmm0 #1375.9 - cmpltpd 128+__svml_dacos_ha_data_internal(%rip), %xmm1 #1380.717 + cmpltpd 128+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1380.717 minpd %xmm8, %xmm0 #1376.9 movlhps %xmm11, %xmm11 #1380.530 movaps %xmm0, %xmm4 #1379.14 @@ -775,7 +775,7 @@ __svml_acos2_ha_e9: cmpnltpd %xmm8, %xmm4 #1379.14 addpd %xmm8, %xmm8 #1380.810 cvtps2pd %xmm12, %xmm13 #1380.504 - movups 320+__svml_dacos_ha_data_internal(%rip), %xmm3 #1380.1157 + movups 320+__jsvml_dacos_ha_data_internal(%rip), %xmm3 #1380.1157 andps %xmm4, %xmm8 #1380.846 andnps %xmm13, %xmm1 #1380.760 andps %xmm8, %xmm3 #1380.1157 @@ -786,60 +786,60 @@ __svml_acos2_ha_e9: movaps %xmm3, %xmm2 #1380.1488 mulpd %xmm3, %xmm14 #1380.1319 mulpd %xmm8, %xmm1 #1380.1359 - subpd 384+__svml_dacos_ha_data_internal(%rip), %xmm14 #1380.1400 + subpd 384+__jsvml_dacos_ha_data_internal(%rip), %xmm14 #1380.1400 addpd %xmm8, %xmm2 #1380.1488 addpd %xmm14, %xmm1 #1380.1445 - movups 448+__svml_dacos_ha_data_internal(%rip), %xmm15 #1380.1913 + movups 448+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1380.1913 movaps %xmm0, %xmm14 #1387.13 mulpd %xmm1, %xmm15 #1380.1913 mulpd %xmm0, %xmm14 #1387.13 - addpd 512+__svml_dacos_ha_data_internal(%rip), %xmm15 #1380.1901 + addpd 512+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1380.1901 mulpd %xmm1, %xmm2 #1380.1971 mulpd %xmm1, %xmm15 #1380.2029 - movups 704+__svml_dacos_ha_data_internal(%rip), %xmm9 #1385.24 + movups 704+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1385.24 movaps %xmm14, %xmm11 #1396.13 mulpd %xmm0, %xmm9 #1385.24 - addpd 576+__svml_dacos_ha_data_internal(%rip), %xmm15 #1380.2017 - addpd 768+__svml_dacos_ha_data_internal(%rip), %xmm9 #1385.12 + addpd 576+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1380.2017 + addpd 768+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1385.12 mulpd %xmm14, %xmm11 #1396.13 mulpd %xmm14, %xmm9 #1394.24 mulpd %xmm15, %xmm1 #1380.2104 - movups 256+__svml_dacos_ha_data_internal(%rip), %xmm10 #1370.42 + movups 256+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1370.42 andps %xmm7, %xmm5 #1372.12 cmpnlepd %xmm6, %xmm10 #1373.13 - addpd 640+__svml_dacos_ha_data_internal(%rip), %xmm1 #1380.2092 + addpd 640+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1380.2092 movmskpd %xmm10, %edx #1378.40 - movups 832+__svml_dacos_ha_data_internal(%rip), %xmm12 #1386.27 - movups 960+__svml_dacos_ha_data_internal(%rip), %xmm10 #1390.26 + movups 832+__jsvml_dacos_ha_data_internal(%rip), %xmm12 #1386.27 + movups 960+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1390.26 mulpd %xmm0, %xmm12 #1386.27 mulpd %xmm0, %xmm10 #1390.26 - addpd 896+__svml_dacos_ha_data_internal(%rip), %xmm12 #1386.15 - addpd 1024+__svml_dacos_ha_data_internal(%rip), %xmm10 #1390.14 + addpd 896+__jsvml_dacos_ha_data_internal(%rip), %xmm12 #1386.15 + addpd 1024+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1390.14 mulpd %xmm1, %xmm2 #1380.2174 mulpd %xmm14, %xmm10 #1395.26 addpd %xmm9, %xmm12 #1394.12 subpd %xmm8, %xmm2 #1380.2162 mulpd %xmm11, %xmm12 #1400.24 - movups 1088+__svml_dacos_ha_data_internal(%rip), %xmm13 #1393.26 + movups 1088+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1393.26 mulpd %xmm0, %xmm13 #1393.26 - addpd 1152+__svml_dacos_ha_data_internal(%rip), %xmm13 #1393.14 + addpd 1152+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1393.14 addpd %xmm10, %xmm13 #1395.14 - movups 1216+__svml_dacos_ha_data_internal(%rip), %xmm1 #1399.26 + movups 1216+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1399.26 movaps %xmm4, %xmm10 #1415.15 mulpd %xmm0, %xmm1 #1399.26 addpd %xmm12, %xmm13 #1400.12 - addpd 1280+__svml_dacos_ha_data_internal(%rip), %xmm1 #1399.14 + addpd 1280+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1399.14 mulpd %xmm13, %xmm14 #1401.24 addpd %xmm14, %xmm1 #1401.12 mulpd %xmm0, %xmm1 #1404.24 - addpd 1344+__svml_dacos_ha_data_internal(%rip), %xmm1 #1404.12 + addpd 1344+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1404.12 mulpd %xmm0, %xmm1 #1405.24 - addpd 1408+__svml_dacos_ha_data_internal(%rip), %xmm1 #1405.12 + addpd 1408+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1405.12 mulpd %xmm0, %xmm1 #1406.12 cmpnltpd %xmm7, %xmm0 #1407.17 - movups 1472+__svml_dacos_ha_data_internal(%rip), %xmm8 #1411.14 + movups 1472+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1411.14 andps %xmm4, %xmm0 #1410.17 - movups 1536+__svml_dacos_ha_data_internal(%rip), %xmm9 #1412.14 + movups 1536+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1412.14 andps %xmm0, %xmm8 #1411.14 andps %xmm0, %xmm9 #1412.14 movaps %xmm4, %xmm0 #1416.15 @@ -847,14 +847,14 @@ __svml_acos2_ha_e9: orps %xmm4, %xmm3 #1421.13 movaps %xmm3, %xmm4 #1422.12 subpd %xmm2, %xmm4 #1422.12 - andnps 1600+__svml_dacos_ha_data_internal(%rip), %xmm10 #1415.15 + andnps 1600+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1415.15 mulpd %xmm4, %xmm1 #1424.26 orps %xmm8, %xmm10 #1418.15 pxor %xmm5, %xmm10 #1420.15 subpd %xmm2, %xmm10 #1423.14 addpd %xmm1, %xmm10 #1424.14 addpd %xmm10, %xmm3 #1425.14 - andnps 1664+__svml_dacos_ha_data_internal(%rip), %xmm0 #1416.15 + andnps 1664+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #1416.15 pxor %xmm5, %xmm3 #1426.14 orps %xmm9, %xmm0 #1419.15 addpd %xmm3, %xmm0 #1427.14 @@ -912,29 +912,29 @@ __svml_acos2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1429.546 lea 128(%rsp,%r12,8), %rsi #1429.546 -..___tag_value___svml_acos2_ha_e9.93: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #1429.546 -..___tag_value___svml_acos2_ha_e9.94: +..___tag_value___jsvml_acos2_ha_e9.93: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #1429.546 +..___tag_value___jsvml_acos2_ha_e9.94: jmp ..B5.8 # Prob 100% #1429.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acos2_ha_e9,@function - .size __svml_acos2_ha_e9,.-__svml_acos2_ha_e9 -..LN__svml_acos2_ha_e9.4: + .type __jsvml_acos2_ha_e9,@function + .size __jsvml_acos2_ha_e9,.-__jsvml_acos2_ha_e9 +..LN__jsvml_acos2_ha_e9.4: .data -# -- End __svml_acos2_ha_e9 +# -- End __jsvml_acos2_ha_e9 .text -.L_2__routine_start___svml_acos4_ha_e9_5: -# -- Begin __svml_acos4_ha_e9 +.L_2__routine_start___jsvml_acos4_ha_e9_5: +# -- Begin __jsvml_acos4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_acos4_ha_e9 -# --- __svml_acos4_ha_e9(__m256d) -__svml_acos4_ha_e9: + .globl __jsvml_acos4_ha_e9 +# --- __jsvml_acos4_ha_e9(__m256d) +__jsvml_acos4_ha_e9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -943,7 +943,7 @@ __svml_acos4_ha_e9: .byte 30 #1535.552 .byte 250 #1535.552 .cfi_startproc -..___tag_value___svml_acos4_ha_e9.96: +..___tag_value___jsvml_acos4_ha_e9.96: ..L97: #1437.1 pushq %rbp #1437.1 @@ -953,24 +953,24 @@ __svml_acos4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1437.1 subq $192, %rsp #1437.1 - vmovupd __svml_dacos_ha_data_internal(%rip), %ymm10 #1474.47 - vmovupd 64+__svml_dacos_ha_data_internal(%rip), %ymm11 #1475.48 + vmovupd __jsvml_dacos_ha_data_internal(%rip), %ymm10 #1474.47 + vmovupd 64+__jsvml_dacos_ha_data_internal(%rip), %ymm11 #1475.48 vmovapd %ymm0, %ymm9 #1437.1 vorpd %ymm9, %ymm10, %ymm8 #1477.8 vmulpd %ymm11, %ymm8, %ymm12 #1480.23 vmulpd %ymm8, %ymm8, %ymm13 #1481.9 - vcmpnge_uqpd 256+__svml_dacos_ha_data_internal(%rip), %ymm8, %ymm14 #1479.13 + vcmpnge_uqpd 256+__jsvml_dacos_ha_data_internal(%rip), %ymm8, %ymm14 #1479.13 vandpd %ymm9, %ymm10, %ymm7 #1478.12 vaddpd %ymm12, %ymm11, %ymm10 #1480.8 vcvtpd2ps %ymm10, %xmm2 #1486.533 vminpd %ymm10, %ymm13, %ymm6 #1482.9 vaddpd %ymm10, %ymm10, %ymm11 #1486.775 - vcmplt_oqpd 128+__svml_dacos_ha_data_internal(%rip), %ymm10, %ymm1 #1486.666 + vcmplt_oqpd 128+__jsvml_dacos_ha_data_internal(%rip), %ymm10, %ymm1 #1486.666 vcmpnlt_uqpd %ymm10, %ymm6, %ymm5 #1485.14 vrsqrtps %xmm2, %xmm4 #1486.520 vcvtps2pd %xmm4, %ymm3 #1486.504 vandpd %ymm5, %ymm11, %ymm12 #1486.814 - vandpd 320+__svml_dacos_ha_data_internal(%rip), %ymm12, %ymm13 #1486.1134 + vandpd 320+__jsvml_dacos_ha_data_internal(%rip), %ymm12, %ymm13 #1486.1134 vandnpd %ymm8, %ymm5, %ymm8 #1523.12 vextractf128 $1, %ymm14, %xmm15 #1483.114 vshufps $221, %xmm15, %xmm14, %xmm0 #1484.57 @@ -982,54 +982,54 @@ __svml_acos4_ha_e9: vmulpd %ymm4, %ymm15, %ymm0 #1486.1308 vmulpd %ymm3, %ymm15, %ymm2 #1486.1351 vaddpd %ymm3, %ymm4, %ymm11 #1486.1489 - vsubpd 384+__svml_dacos_ha_data_internal(%rip), %ymm0, %ymm1 #1486.1395 + vsubpd 384+__jsvml_dacos_ha_data_internal(%rip), %ymm0, %ymm1 #1486.1395 vaddpd %ymm1, %ymm2, %ymm14 #1486.1443 - vmulpd 448+__svml_dacos_ha_data_internal(%rip), %ymm14, %ymm10 #1486.1932 + vmulpd 448+__jsvml_dacos_ha_data_internal(%rip), %ymm14, %ymm10 #1486.1932 vmulpd %ymm11, %ymm14, %ymm2 #1486.1993 - vaddpd 512+__svml_dacos_ha_data_internal(%rip), %ymm10, %ymm12 #1486.1917 + vaddpd 512+__jsvml_dacos_ha_data_internal(%rip), %ymm10, %ymm12 #1486.1917 vmulpd %ymm12, %ymm14, %ymm13 #1486.2057 - vaddpd 576+__svml_dacos_ha_data_internal(%rip), %ymm13, %ymm15 #1486.2042 + vaddpd 576+__jsvml_dacos_ha_data_internal(%rip), %ymm13, %ymm15 #1486.2042 vmulpd %ymm15, %ymm14, %ymm0 #1486.2138 - vaddpd 640+__svml_dacos_ha_data_internal(%rip), %ymm0, %ymm1 #1486.2123 - vmulpd 832+__svml_dacos_ha_data_internal(%rip), %ymm6, %ymm0 #1492.30 + vaddpd 640+__jsvml_dacos_ha_data_internal(%rip), %ymm0, %ymm1 #1486.2123 + vmulpd 832+__jsvml_dacos_ha_data_internal(%rip), %ymm6, %ymm0 #1492.30 vmulpd %ymm1, %ymm2, %ymm10 #1486.2214 vmulpd %ymm6, %ymm6, %ymm1 #1493.13 - vaddpd 896+__svml_dacos_ha_data_internal(%rip), %ymm0, %ymm12 #1492.15 + vaddpd 896+__jsvml_dacos_ha_data_internal(%rip), %ymm0, %ymm12 #1492.15 vsubpd %ymm3, %ymm10, %ymm2 #1486.2199 - vmulpd 704+__svml_dacos_ha_data_internal(%rip), %ymm6, %ymm3 #1491.27 - vmulpd 1088+__svml_dacos_ha_data_internal(%rip), %ymm6, %ymm10 #1499.29 - vaddpd 768+__svml_dacos_ha_data_internal(%rip), %ymm3, %ymm11 #1491.12 - vaddpd 1152+__svml_dacos_ha_data_internal(%rip), %ymm10, %ymm15 #1499.14 - vmulpd 960+__svml_dacos_ha_data_internal(%rip), %ymm6, %ymm3 #1496.29 + vmulpd 704+__jsvml_dacos_ha_data_internal(%rip), %ymm6, %ymm3 #1491.27 + vmulpd 1088+__jsvml_dacos_ha_data_internal(%rip), %ymm6, %ymm10 #1499.29 + vaddpd 768+__jsvml_dacos_ha_data_internal(%rip), %ymm3, %ymm11 #1491.12 + vaddpd 1152+__jsvml_dacos_ha_data_internal(%rip), %ymm10, %ymm15 #1499.14 + vmulpd 960+__jsvml_dacos_ha_data_internal(%rip), %ymm6, %ymm3 #1496.29 vmulpd %ymm1, %ymm11, %ymm13 #1500.27 vmulpd %ymm1, %ymm1, %ymm10 #1502.13 - vaddpd 1024+__svml_dacos_ha_data_internal(%rip), %ymm3, %ymm14 #1496.14 + vaddpd 1024+__jsvml_dacos_ha_data_internal(%rip), %ymm3, %ymm14 #1496.14 vaddpd %ymm13, %ymm12, %ymm3 #1500.12 vmulpd %ymm14, %ymm1, %ymm0 #1501.29 vmulpd %ymm10, %ymm3, %ymm12 #1506.27 - vmulpd 1216+__svml_dacos_ha_data_internal(%rip), %ymm6, %ymm14 #1505.29 + vmulpd 1216+__jsvml_dacos_ha_data_internal(%rip), %ymm6, %ymm14 #1505.29 vaddpd %ymm0, %ymm15, %ymm11 #1501.14 - vaddpd 1280+__svml_dacos_ha_data_internal(%rip), %ymm14, %ymm15 #1505.14 + vaddpd 1280+__jsvml_dacos_ha_data_internal(%rip), %ymm14, %ymm15 #1505.14 vaddpd %ymm12, %ymm11, %ymm13 #1506.12 vmulpd %ymm13, %ymm1, %ymm1 #1507.27 vaddpd %ymm1, %ymm15, %ymm0 #1507.12 vmulpd %ymm0, %ymm6, %ymm1 #1510.27 - vaddpd 1344+__svml_dacos_ha_data_internal(%rip), %ymm1, %ymm3 #1510.12 + vaddpd 1344+__jsvml_dacos_ha_data_internal(%rip), %ymm1, %ymm3 #1510.12 vmulpd %ymm3, %ymm6, %ymm10 #1511.27 - vaddpd 1408+__svml_dacos_ha_data_internal(%rip), %ymm10, %ymm11 #1511.12 + vaddpd 1408+__jsvml_dacos_ha_data_internal(%rip), %ymm10, %ymm11 #1511.12 vmulpd %ymm11, %ymm6, %ymm0 #1512.12 vcmpnlt_uqpd %ymm9, %ymm6, %ymm6 #1513.17 vorpd %ymm8, %ymm4, %ymm8 #1527.13 vsubpd %ymm2, %ymm8, %ymm4 #1528.12 vandpd %ymm5, %ymm6, %ymm1 #1516.17 - vandpd 1472+__svml_dacos_ha_data_internal(%rip), %ymm1, %ymm6 #1517.14 - vandnpd 1600+__svml_dacos_ha_data_internal(%rip), %ymm5, %ymm3 #1521.15 - vandnpd 1664+__svml_dacos_ha_data_internal(%rip), %ymm5, %ymm10 #1522.15 + vandpd 1472+__jsvml_dacos_ha_data_internal(%rip), %ymm1, %ymm6 #1517.14 + vandnpd 1600+__jsvml_dacos_ha_data_internal(%rip), %ymm5, %ymm3 #1521.15 + vandnpd 1664+__jsvml_dacos_ha_data_internal(%rip), %ymm5, %ymm10 #1522.15 vorpd %ymm6, %ymm3, %ymm5 #1524.15 vmulpd %ymm4, %ymm0, %ymm0 #1530.29 vxorpd %ymm7, %ymm5, %ymm5 #1526.15 vsubpd %ymm2, %ymm5, %ymm2 #1529.14 - vandpd 1536+__svml_dacos_ha_data_internal(%rip), %ymm1, %ymm11 #1518.14 + vandpd 1536+__jsvml_dacos_ha_data_internal(%rip), %ymm1, %ymm11 #1518.14 vaddpd %ymm0, %ymm2, %ymm1 #1530.14 vaddpd %ymm1, %ymm8, %ymm3 #1531.14 vorpd %ymm11, %ymm10, %ymm6 #1525.15 @@ -1094,29 +1094,29 @@ __svml_acos4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1535.552 lea 128(%rsp,%r12,8), %rsi #1535.552 -..___tag_value___svml_acos4_ha_e9.114: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #1535.552 -..___tag_value___svml_acos4_ha_e9.115: +..___tag_value___jsvml_acos4_ha_e9.114: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #1535.552 +..___tag_value___jsvml_acos4_ha_e9.115: jmp ..B6.8 # Prob 100% #1535.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acos4_ha_e9,@function - .size __svml_acos4_ha_e9,.-__svml_acos4_ha_e9 -..LN__svml_acos4_ha_e9.5: + .type __jsvml_acos4_ha_e9,@function + .size __jsvml_acos4_ha_e9,.-__jsvml_acos4_ha_e9 +..LN__jsvml_acos4_ha_e9.5: .data -# -- End __svml_acos4_ha_e9 +# -- End __jsvml_acos4_ha_e9 .text -.L_2__routine_start___svml_acos8_ha_z0_6: -# -- Begin __svml_acos8_ha_z0 +.L_2__routine_start___jsvml_acos8_ha_z0_6: +# -- Begin __jsvml_acos8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_acos8_ha_z0 -# --- __svml_acos8_ha_z0(__m512d) -__svml_acos8_ha_z0: + .globl __jsvml_acos8_ha_z0 +# --- __jsvml_acos8_ha_z0(__m512d) +__jsvml_acos8_ha_z0: # parameter 1: %zmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1125,80 +1125,80 @@ __svml_acos8_ha_z0: .byte 30 #1645.12 .byte 250 #1645.12 .cfi_startproc -..___tag_value___svml_acos8_ha_z0.117: +..___tag_value___jsvml_acos8_ha_z0.117: ..L118: #1543.1 - vmovups __svml_dacos_ha_data_internal(%rip), %zmm8 #1581.45 - vmovups 64+__svml_dacos_ha_data_internal(%rip), %zmm9 #1582.46 - vmovups 128+__svml_dacos_ha_data_internal(%rip), %zmm12 #1594.575 - vmovups 384+__svml_dacos_ha_data_internal(%rip), %zmm1 #1594.1222 - vmovups 448+__svml_dacos_ha_data_internal(%rip), %zmm15 #1594.1599 - vmovups 512+__svml_dacos_ha_data_internal(%rip), %zmm2 #1594.1940 - vmovups 256+__svml_dacos_ha_data_internal(%rip), %zmm11 #1583.43 + vmovups __jsvml_dacos_ha_data_internal(%rip), %zmm8 #1581.45 + vmovups 64+__jsvml_dacos_ha_data_internal(%rip), %zmm9 #1582.46 + vmovups 128+__jsvml_dacos_ha_data_internal(%rip), %zmm12 #1594.575 + vmovups 384+__jsvml_dacos_ha_data_internal(%rip), %zmm1 #1594.1222 + vmovups 448+__jsvml_dacos_ha_data_internal(%rip), %zmm15 #1594.1599 + vmovups 512+__jsvml_dacos_ha_data_internal(%rip), %zmm2 #1594.1940 + vmovups 256+__jsvml_dacos_ha_data_internal(%rip), %zmm11 #1583.43 vmovaps %zmm0, %zmm7 #1543.1 vorpd %zmm7, %zmm8, %zmm6 #1584.8 vandpd %zmm7, %zmm8, %zmm5 #1585.12 - vmovups 576+__svml_dacos_ha_data_internal(%rip), %zmm0 #1594.1785 + vmovups 576+__jsvml_dacos_ha_data_internal(%rip), %zmm0 #1594.1785 vfmadd231pd {rn-sae}, %zmm6, %zmm9, %zmm9 #1587.8 vmulpd {rn-sae}, %zmm6, %zmm6, %zmm10 #1588.11 vrsqrt14pd %zmm9, %zmm14 #1594.505 vcmppd $17, {sae}, %zmm12, %zmm9, %k2 #1594.636 vcmppd $17, {sae}, %zmm11, %zmm6, %k1 #1586.13 - vmovups 960+__svml_dacos_ha_data_internal(%rip), %zmm11 #1602.56 - vmovups 1088+__svml_dacos_ha_data_internal(%rip), %zmm12 #1605.56 + vmovups 960+__jsvml_dacos_ha_data_internal(%rip), %zmm11 #1602.56 + vmovups 1088+__jsvml_dacos_ha_data_internal(%rip), %zmm12 #1605.56 vminpd {sae}, %zmm9, %zmm10, %zmm4 #1589.11 - vmovups 832+__svml_dacos_ha_data_internal(%rip), %zmm10 #1597.57 + vmovups 832+__jsvml_dacos_ha_data_internal(%rip), %zmm10 #1597.57 vxorpd %zmm14, %zmm14, %zmm14{%k2} #1594.722 vaddpd {rn-sae}, %zmm9, %zmm9, %zmm8 #1594.794 vcmppd $21, {sae}, %zmm9, %zmm4, %k4 #1590.14 vmulpd {rn-sae}, %zmm14, %zmm14, %zmm13 #1594.1118 vmulpd {rn-sae}, %zmm14, %zmm8, %zmm3 #1594.1335 - vmovups 704+__svml_dacos_ha_data_internal(%rip), %zmm9 #1595.57 - vorpd 1856+__svml_dacos_ha_data_internal(%rip), %zmm4, %zmm4{%k1} #1593.11 + vmovups 704+__jsvml_dacos_ha_data_internal(%rip), %zmm9 #1595.57 + vorpd 1856+__jsvml_dacos_ha_data_internal(%rip), %zmm4, %zmm4{%k1} #1593.11 vfmsub231pd {rn-sae}, %zmm8, %zmm13, %zmm1 #1594.1222 - vmovups 640+__svml_dacos_ha_data_internal(%rip), %zmm13 #1594.1878 + vmovups 640+__jsvml_dacos_ha_data_internal(%rip), %zmm13 #1594.1878 vfmsub213pd {rn-sae}, %zmm3, %zmm14, %zmm8 #1594.1436 vcmppd $21, {sae}, %zmm7, %zmm4, %k0 #1621.17 vmulpd {rn-sae}, %zmm1, %zmm3, %zmm14 #1594.2058 vfmadd231pd {rn-sae}, %zmm1, %zmm15, %zmm2 #1594.1940 - vmovups 1216+__svml_dacos_ha_data_internal(%rip), %zmm15 #1611.56 - vmovups 1664+__svml_dacos_ha_data_internal(%rip), %zmm7 #1624.47 + vmovups 1216+__jsvml_dacos_ha_data_internal(%rip), %zmm15 #1611.56 + vmovups 1664+__jsvml_dacos_ha_data_internal(%rip), %zmm7 #1624.47 vfmadd213pd {rn-sae}, %zmm0, %zmm1, %zmm2 #1594.2166 - vmovups 896+__svml_dacos_ha_data_internal(%rip), %zmm0 #1600.15 + vmovups 896+__jsvml_dacos_ha_data_internal(%rip), %zmm0 #1600.15 vxorpd %zmm7, %zmm7, %zmm7{%k4} #1629.15 vfmadd213pd {rn-sae}, %zmm13, %zmm1, %zmm2 #1594.2287 - vmovups 768+__svml_dacos_ha_data_internal(%rip), %zmm1 #1599.12 + vmovups 768+__jsvml_dacos_ha_data_internal(%rip), %zmm1 #1599.12 vfmadd231pd {rn-sae}, %zmm4, %zmm10, %zmm0 #1600.15 - vmovups 1280+__svml_dacos_ha_data_internal(%rip), %zmm10 #1613.14 + vmovups 1280+__jsvml_dacos_ha_data_internal(%rip), %zmm10 #1613.14 vfmsub213pd {rn-sae}, %zmm8, %zmm14, %zmm2 #1594.2403 vfmadd231pd {rn-sae}, %zmm4, %zmm9, %zmm1 #1599.12 - vmovups 1024+__svml_dacos_ha_data_internal(%rip), %zmm8 #1604.14 + vmovups 1024+__jsvml_dacos_ha_data_internal(%rip), %zmm8 #1604.14 vfmadd231pd {rn-sae}, %zmm4, %zmm15, %zmm10 #1613.14 vmulpd {rn-sae}, %zmm4, %zmm4, %zmm9 #1601.15 vfmadd231pd {rn-sae}, %zmm4, %zmm11, %zmm8 #1604.14 - vmovups 1152+__svml_dacos_ha_data_internal(%rip), %zmm11 #1607.14 + vmovups 1152+__jsvml_dacos_ha_data_internal(%rip), %zmm11 #1607.14 vfmadd213pd {rn-sae}, %zmm0, %zmm9, %zmm1 #1608.12 vmulpd {rn-sae}, %zmm9, %zmm9, %zmm0 #1610.15 vfmadd231pd {rn-sae}, %zmm4, %zmm12, %zmm11 #1607.14 - vmovups 1408+__svml_dacos_ha_data_internal(%rip), %zmm12 #1617.56 + vmovups 1408+__jsvml_dacos_ha_data_internal(%rip), %zmm12 #1617.56 kmovw %k4, %eax #1590.14 kmovw %k0, %edx #1621.17 vfmadd213pd {rn-sae}, %zmm11, %zmm9, %zmm8 #1609.14 - vmovups 1344+__svml_dacos_ha_data_internal(%rip), %zmm11 #1616.56 + vmovups 1344+__jsvml_dacos_ha_data_internal(%rip), %zmm11 #1616.56 vfmadd213pd {rn-sae}, %zmm8, %zmm0, %zmm1 #1614.12 vfmadd213pd {rn-sae}, %zmm10, %zmm9, %zmm1 #1615.12 andl %eax, %edx #1622.29 kmovw %edx, %k3 #1630.15 vfmadd213pd {rn-sae}, %zmm11, %zmm4, %zmm1 #1618.12 - vorpd 1536+__svml_dacos_ha_data_internal(%rip), %zmm7, %zmm7{%k3} #1631.15 + vorpd 1536+__jsvml_dacos_ha_data_internal(%rip), %zmm7, %zmm7{%k3} #1631.15 vfmadd213pd {rn-sae}, %zmm12, %zmm4, %zmm1 #1619.12 vmulpd {rn-sae}, %zmm4, %zmm1, %zmm0 #1620.14 - vmovups 1600+__svml_dacos_ha_data_internal(%rip), %zmm4 #1623.47 - vmovups 1728+__svml_dacos_ha_data_internal(%rip), %zmm1 #1627.47 + vmovups 1600+__jsvml_dacos_ha_data_internal(%rip), %zmm4 #1623.47 + vmovups 1728+__jsvml_dacos_ha_data_internal(%rip), %zmm1 #1627.47 vxorpd %zmm4, %zmm4, %zmm4{%k4} #1628.15 vblendmpd %zmm2, %zmm1, %zmm2{%k4} #1633.13 vblendmpd %zmm3, %zmm6, %zmm1{%k4} #1634.13 - vorpd 1472+__svml_dacos_ha_data_internal(%rip), %zmm4, %zmm4{%k3} #1630.15 + vorpd 1472+__jsvml_dacos_ha_data_internal(%rip), %zmm4, %zmm4{%k3} #1630.15 vsubpd {rn-sae}, %zmm2, %zmm1, %zmm3 #1635.14 vxorpd %zmm5, %zmm4, %zmm8 #1632.15 vsubpd {rn-sae}, %zmm2, %zmm8, %zmm6 #1636.17 @@ -1211,20 +1211,20 @@ __svml_acos8_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_acos8_ha_z0,@function - .size __svml_acos8_ha_z0,.-__svml_acos8_ha_z0 -..LN__svml_acos8_ha_z0.6: + .type __jsvml_acos8_ha_z0,@function + .size __jsvml_acos8_ha_z0,.-__jsvml_acos8_ha_z0 +..LN__jsvml_acos8_ha_z0.6: .data -# -- End __svml_acos8_ha_z0 +# -- End __jsvml_acos8_ha_z0 .text -.L_2__routine_start___svml_acos2_ha_ex_7: -# -- Begin __svml_acos2_ha_ex +.L_2__routine_start___jsvml_acos2_ha_ex_7: +# -- Begin __jsvml_acos2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_acos2_ha_ex -# --- __svml_acos2_ha_ex(__m128d) -__svml_acos2_ha_ex: + .globl __jsvml_acos2_ha_ex +# --- __jsvml_acos2_ha_ex(__m128d) +__jsvml_acos2_ha_ex: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1233,7 +1233,7 @@ __svml_acos2_ha_ex: .byte 30 #1748.546 .byte 250 #1748.546 .cfi_startproc -..___tag_value___svml_acos2_ha_ex.120: +..___tag_value___jsvml_acos2_ha_ex.120: ..L121: #1650.1 pushq %rbp #1650.1 @@ -1244,8 +1244,8 @@ __svml_acos2_ha_ex: andq $-64, %rsp #1650.1 subq $192, %rsp #1650.1 movaps %xmm0, %xmm7 #1650.1 - movups __svml_dacos_ha_data_internal(%rip), %xmm5 #1687.44 - movups 64+__svml_dacos_ha_data_internal(%rip), %xmm8 #1688.45 + movups __jsvml_dacos_ha_data_internal(%rip), %xmm5 #1687.44 + movups 64+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1688.45 movaps %xmm5, %xmm6 #1690.8 orps %xmm7, %xmm6 #1690.8 movaps %xmm8, %xmm9 #1693.20 @@ -1255,7 +1255,7 @@ __svml_acos2_ha_ex: movaps %xmm8, %xmm1 #1699.717 cvtpd2ps %xmm8, %xmm11 #1699.546 mulpd %xmm6, %xmm0 #1694.9 - cmpltpd 128+__svml_dacos_ha_data_internal(%rip), %xmm1 #1699.717 + cmpltpd 128+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1699.717 minpd %xmm8, %xmm0 #1695.9 movlhps %xmm11, %xmm11 #1699.530 movaps %xmm0, %xmm4 #1698.14 @@ -1263,7 +1263,7 @@ __svml_acos2_ha_ex: cmpnltpd %xmm8, %xmm4 #1698.14 addpd %xmm8, %xmm8 #1699.810 cvtps2pd %xmm12, %xmm13 #1699.504 - movups 320+__svml_dacos_ha_data_internal(%rip), %xmm3 #1699.1157 + movups 320+__jsvml_dacos_ha_data_internal(%rip), %xmm3 #1699.1157 andps %xmm4, %xmm8 #1699.846 andnps %xmm13, %xmm1 #1699.760 andps %xmm8, %xmm3 #1699.1157 @@ -1274,60 +1274,60 @@ __svml_acos2_ha_ex: movaps %xmm3, %xmm2 #1699.1488 mulpd %xmm3, %xmm14 #1699.1319 mulpd %xmm8, %xmm1 #1699.1359 - subpd 384+__svml_dacos_ha_data_internal(%rip), %xmm14 #1699.1400 + subpd 384+__jsvml_dacos_ha_data_internal(%rip), %xmm14 #1699.1400 addpd %xmm8, %xmm2 #1699.1488 addpd %xmm14, %xmm1 #1699.1445 - movups 448+__svml_dacos_ha_data_internal(%rip), %xmm15 #1699.1913 + movups 448+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1699.1913 movaps %xmm0, %xmm14 #1706.13 mulpd %xmm1, %xmm15 #1699.1913 mulpd %xmm0, %xmm14 #1706.13 - addpd 512+__svml_dacos_ha_data_internal(%rip), %xmm15 #1699.1901 + addpd 512+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1699.1901 mulpd %xmm1, %xmm2 #1699.1971 mulpd %xmm1, %xmm15 #1699.2029 - movups 704+__svml_dacos_ha_data_internal(%rip), %xmm9 #1704.24 + movups 704+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1704.24 movaps %xmm14, %xmm11 #1715.13 mulpd %xmm0, %xmm9 #1704.24 - addpd 576+__svml_dacos_ha_data_internal(%rip), %xmm15 #1699.2017 - addpd 768+__svml_dacos_ha_data_internal(%rip), %xmm9 #1704.12 + addpd 576+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1699.2017 + addpd 768+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1704.12 mulpd %xmm14, %xmm11 #1715.13 mulpd %xmm14, %xmm9 #1713.24 mulpd %xmm15, %xmm1 #1699.2104 - movups 256+__svml_dacos_ha_data_internal(%rip), %xmm10 #1689.42 + movups 256+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1689.42 andps %xmm7, %xmm5 #1691.12 cmpnlepd %xmm6, %xmm10 #1692.13 - addpd 640+__svml_dacos_ha_data_internal(%rip), %xmm1 #1699.2092 + addpd 640+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1699.2092 movmskpd %xmm10, %edx #1697.40 - movups 832+__svml_dacos_ha_data_internal(%rip), %xmm12 #1705.27 - movups 960+__svml_dacos_ha_data_internal(%rip), %xmm10 #1709.26 + movups 832+__jsvml_dacos_ha_data_internal(%rip), %xmm12 #1705.27 + movups 960+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1709.26 mulpd %xmm0, %xmm12 #1705.27 mulpd %xmm0, %xmm10 #1709.26 - addpd 896+__svml_dacos_ha_data_internal(%rip), %xmm12 #1705.15 - addpd 1024+__svml_dacos_ha_data_internal(%rip), %xmm10 #1709.14 + addpd 896+__jsvml_dacos_ha_data_internal(%rip), %xmm12 #1705.15 + addpd 1024+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1709.14 mulpd %xmm1, %xmm2 #1699.2174 mulpd %xmm14, %xmm10 #1714.26 addpd %xmm9, %xmm12 #1713.12 subpd %xmm8, %xmm2 #1699.2162 mulpd %xmm11, %xmm12 #1719.24 - movups 1088+__svml_dacos_ha_data_internal(%rip), %xmm13 #1712.26 + movups 1088+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1712.26 mulpd %xmm0, %xmm13 #1712.26 - addpd 1152+__svml_dacos_ha_data_internal(%rip), %xmm13 #1712.14 + addpd 1152+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1712.14 addpd %xmm10, %xmm13 #1714.14 - movups 1216+__svml_dacos_ha_data_internal(%rip), %xmm1 #1718.26 + movups 1216+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1718.26 movaps %xmm4, %xmm10 #1734.15 mulpd %xmm0, %xmm1 #1718.26 addpd %xmm12, %xmm13 #1719.12 - addpd 1280+__svml_dacos_ha_data_internal(%rip), %xmm1 #1718.14 + addpd 1280+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1718.14 mulpd %xmm13, %xmm14 #1720.24 addpd %xmm14, %xmm1 #1720.12 mulpd %xmm0, %xmm1 #1723.24 - addpd 1344+__svml_dacos_ha_data_internal(%rip), %xmm1 #1723.12 + addpd 1344+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1723.12 mulpd %xmm0, %xmm1 #1724.24 - addpd 1408+__svml_dacos_ha_data_internal(%rip), %xmm1 #1724.12 + addpd 1408+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1724.12 mulpd %xmm0, %xmm1 #1725.12 cmpnltpd %xmm7, %xmm0 #1726.17 - movups 1472+__svml_dacos_ha_data_internal(%rip), %xmm8 #1730.14 + movups 1472+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1730.14 andps %xmm4, %xmm0 #1729.17 - movups 1536+__svml_dacos_ha_data_internal(%rip), %xmm9 #1731.14 + movups 1536+__jsvml_dacos_ha_data_internal(%rip), %xmm9 #1731.14 andps %xmm0, %xmm8 #1730.14 andps %xmm0, %xmm9 #1731.14 movaps %xmm4, %xmm0 #1735.15 @@ -1335,14 +1335,14 @@ __svml_acos2_ha_ex: orps %xmm4, %xmm3 #1740.13 movaps %xmm3, %xmm4 #1741.12 subpd %xmm2, %xmm4 #1741.12 - andnps 1600+__svml_dacos_ha_data_internal(%rip), %xmm10 #1734.15 + andnps 1600+__jsvml_dacos_ha_data_internal(%rip), %xmm10 #1734.15 mulpd %xmm4, %xmm1 #1743.26 orps %xmm8, %xmm10 #1737.15 pxor %xmm5, %xmm10 #1739.15 subpd %xmm2, %xmm10 #1742.14 addpd %xmm1, %xmm10 #1743.14 addpd %xmm10, %xmm3 #1744.14 - andnps 1664+__svml_dacos_ha_data_internal(%rip), %xmm0 #1735.15 + andnps 1664+__jsvml_dacos_ha_data_internal(%rip), %xmm0 #1735.15 pxor %xmm5, %xmm3 #1745.14 orps %xmm9, %xmm0 #1738.15 addpd %xmm3, %xmm0 #1746.14 @@ -1400,29 +1400,29 @@ __svml_acos2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1748.546 lea 128(%rsp,%r12,8), %rsi #1748.546 -..___tag_value___svml_acos2_ha_ex.138: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #1748.546 -..___tag_value___svml_acos2_ha_ex.139: +..___tag_value___jsvml_acos2_ha_ex.138: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #1748.546 +..___tag_value___jsvml_acos2_ha_ex.139: jmp ..B8.8 # Prob 100% #1748.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acos2_ha_ex,@function - .size __svml_acos2_ha_ex,.-__svml_acos2_ha_ex -..LN__svml_acos2_ha_ex.7: + .type __jsvml_acos2_ha_ex,@function + .size __jsvml_acos2_ha_ex,.-__jsvml_acos2_ha_ex +..LN__jsvml_acos2_ha_ex.7: .data -# -- End __svml_acos2_ha_ex +# -- End __jsvml_acos2_ha_ex .text -.L_2__routine_start___svml_acos1_ha_l9_8: -# -- Begin __svml_acos1_ha_l9 +.L_2__routine_start___jsvml_acos1_ha_l9_8: +# -- Begin __jsvml_acos1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_acos1_ha_l9 -# --- __svml_acos1_ha_l9(__m128d) -__svml_acos1_ha_l9: + .globl __jsvml_acos1_ha_l9 +# --- __jsvml_acos1_ha_l9(__m128d) +__jsvml_acos1_ha_l9: # parameter 1: %xmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1431,7 +1431,7 @@ __svml_acos1_ha_l9: .byte 30 #1854.546 .byte 250 #1854.546 .cfi_startproc -..___tag_value___svml_acos1_ha_l9.141: +..___tag_value___jsvml_acos1_ha_l9.141: ..L142: #1756.1 pushq %rbp #1756.1 @@ -1442,18 +1442,18 @@ __svml_acos1_ha_l9: andq $-64, %rsp #1756.1 subq $128, %rsp #1756.1 vmovapd %xmm0, %xmm11 #1756.1 - vmovsd __svml_dacos_ha_data_internal(%rip), %xmm12 #1793.13 + vmovsd __jsvml_dacos_ha_data_internal(%rip), %xmm12 #1793.13 vorpd %xmm11, %xmm12, %xmm10 #1796.8 vandpd %xmm11, %xmm12, %xmm9 #1797.12 - vmovsd 64+__svml_dacos_ha_data_internal(%rip), %xmm15 #1794.14 + vmovsd 64+__jsvml_dacos_ha_data_internal(%rip), %xmm15 #1794.14 vmovapd %xmm10, %xmm6 #1799.8 vfmadd213sd %xmm15, %xmm15, %xmm6 #1799.8 vmulsd %xmm10, %xmm10, %xmm0 #1800.9 vcvtpd2ps %xmm6, %xmm3 #1805.546 - vcmpltsd 128+__svml_dacos_ha_data_internal(%rip), %xmm6, %xmm12 #1805.717 + vcmpltsd 128+__jsvml_dacos_ha_data_internal(%rip), %xmm6, %xmm12 #1805.717 vshufps $0, %xmm3, %xmm3, %xmm1 #1805.530 vrsqrtps %xmm1, %xmm2 #1805.517 - vmovsd 256+__svml_dacos_ha_data_internal(%rip), %xmm13 #1795.11 + vmovsd 256+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1795.11 vunpcklpd %xmm0, %xmm0, %xmm4 #1801.21 vcmpnlesd %xmm10, %xmm13, %xmm14 #1798.13 vcvtps2pd %xmm2, %xmm13 #1805.504 @@ -1467,42 +1467,42 @@ __svml_acos1_ha_l9: vaddsd %xmm6, %xmm6, %xmm6 #1805.810 vandpd %xmm7, %xmm6, %xmm1 #1805.846 vmovapd %xmm1, %xmm0 #1805.1154 - vfmsub213sd 384+__svml_dacos_ha_data_internal(%rip), %xmm14, %xmm0 #1805.1154 - vmovsd 448+__svml_dacos_ha_data_internal(%rip), %xmm4 #1805.1688 - vmovsd 832+__svml_dacos_ha_data_internal(%rip), %xmm6 #1808.25 - vmovsd 704+__svml_dacos_ha_data_internal(%rip), %xmm2 #1806.25 - vmovsd 960+__svml_dacos_ha_data_internal(%rip), %xmm12 #1813.24 - vfmadd213sd 512+__svml_dacos_ha_data_internal(%rip), %xmm0, %xmm4 #1805.1688 + vfmsub213sd 384+__jsvml_dacos_ha_data_internal(%rip), %xmm14, %xmm0 #1805.1154 + vmovsd 448+__jsvml_dacos_ha_data_internal(%rip), %xmm4 #1805.1688 + vmovsd 832+__jsvml_dacos_ha_data_internal(%rip), %xmm6 #1808.25 + vmovsd 704+__jsvml_dacos_ha_data_internal(%rip), %xmm2 #1806.25 + vmovsd 960+__jsvml_dacos_ha_data_internal(%rip), %xmm12 #1813.24 + vfmadd213sd 512+__jsvml_dacos_ha_data_internal(%rip), %xmm0, %xmm4 #1805.1688 vmulsd %xmm15, %xmm1, %xmm5 #1805.1207 - vfmadd213sd 576+__svml_dacos_ha_data_internal(%rip), %xmm0, %xmm4 #1805.1792 + vfmadd213sd 576+__jsvml_dacos_ha_data_internal(%rip), %xmm0, %xmm4 #1805.1792 vfmsub213sd %xmm5, %xmm15, %xmm1 #1805.1246 vmulsd %xmm0, %xmm5, %xmm3 #1805.1746 - vfmadd213sd 640+__svml_dacos_ha_data_internal(%rip), %xmm0, %xmm4 #1805.1855 + vfmadd213sd 640+__jsvml_dacos_ha_data_internal(%rip), %xmm0, %xmm4 #1805.1855 vmovapd %xmm8, %xmm0 #1811.15 - vmovsd 1088+__svml_dacos_ha_data_internal(%rip), %xmm13 #1816.24 - vmovsd 1216+__svml_dacos_ha_data_internal(%rip), %xmm14 #1822.24 + vmovsd 1088+__jsvml_dacos_ha_data_internal(%rip), %xmm13 #1816.24 + vmovsd 1216+__jsvml_dacos_ha_data_internal(%rip), %xmm14 #1822.24 vfmsub213sd %xmm1, %xmm3, %xmm4 #1805.1913 vmovapd %xmm8, %xmm3 #1810.12 - vfmadd213sd 896+__svml_dacos_ha_data_internal(%rip), %xmm6, %xmm0 #1811.15 + vfmadd213sd 896+__jsvml_dacos_ha_data_internal(%rip), %xmm6, %xmm0 #1811.15 vmovapd %xmm8, %xmm1 #1815.14 vmovapd %xmm8, %xmm6 #1818.14 - vfmadd213sd 768+__svml_dacos_ha_data_internal(%rip), %xmm2, %xmm3 #1810.12 + vfmadd213sd 768+__jsvml_dacos_ha_data_internal(%rip), %xmm2, %xmm3 #1810.12 vmulsd %xmm8, %xmm8, %xmm2 #1812.13 - vfmadd213sd 1024+__svml_dacos_ha_data_internal(%rip), %xmm12, %xmm1 #1815.14 - vfmadd213sd 1152+__svml_dacos_ha_data_internal(%rip), %xmm13, %xmm6 #1818.14 + vfmadd213sd 1024+__jsvml_dacos_ha_data_internal(%rip), %xmm12, %xmm1 #1815.14 + vfmadd213sd 1152+__jsvml_dacos_ha_data_internal(%rip), %xmm13, %xmm6 #1818.14 vmovapd %xmm8, %xmm12 #1824.14 vfmadd213sd %xmm0, %xmm2, %xmm3 #1819.12 vfmadd213sd %xmm6, %xmm2, %xmm1 #1820.14 vmulsd %xmm2, %xmm2, %xmm15 #1821.13 - vfmadd213sd 1280+__svml_dacos_ha_data_internal(%rip), %xmm14, %xmm12 #1824.14 - vmovsd 1600+__svml_dacos_ha_data_internal(%rip), %xmm6 #1838.15 + vfmadd213sd 1280+__jsvml_dacos_ha_data_internal(%rip), %xmm14, %xmm12 #1824.14 + vmovsd 1600+__jsvml_dacos_ha_data_internal(%rip), %xmm6 #1838.15 vfmadd213sd %xmm1, %xmm15, %xmm3 #1825.12 - vmovsd 1472+__svml_dacos_ha_data_internal(%rip), %xmm1 #1833.14 + vmovsd 1472+__jsvml_dacos_ha_data_internal(%rip), %xmm1 #1833.14 vfmadd213sd %xmm12, %xmm2, %xmm3 #1826.12 vandnpd %xmm6, %xmm7, %xmm12 #1840.15 - vmovsd 1536+__svml_dacos_ha_data_internal(%rip), %xmm2 #1834.14 - vfmadd213sd 1344+__svml_dacos_ha_data_internal(%rip), %xmm8, %xmm3 #1829.12 - vfmadd213sd 1408+__svml_dacos_ha_data_internal(%rip), %xmm8, %xmm3 #1830.12 + vmovsd 1536+__jsvml_dacos_ha_data_internal(%rip), %xmm2 #1834.14 + vfmadd213sd 1344+__jsvml_dacos_ha_data_internal(%rip), %xmm8, %xmm3 #1829.12 + vfmadd213sd 1408+__jsvml_dacos_ha_data_internal(%rip), %xmm8, %xmm3 #1830.12 vmulsd %xmm8, %xmm3, %xmm0 #1831.12 vcmpnltsd %xmm11, %xmm8, %xmm8 #1832.17 vandpd %xmm7, %xmm8, %xmm3 #1835.17 @@ -1512,7 +1512,7 @@ __svml_acos1_ha_l9: vandpd %xmm3, %xmm2, %xmm15 #1837.14 vxorpd %xmm9, %xmm10, %xmm10 #1845.15 vorpd %xmm1, %xmm5, %xmm2 #1846.13 - vmovsd 1664+__svml_dacos_ha_data_internal(%rip), %xmm8 #1839.15 + vmovsd 1664+__jsvml_dacos_ha_data_internal(%rip), %xmm8 #1839.15 vsubsd %xmm4, %xmm2, %xmm5 #1847.12 vsubsd %xmm4, %xmm10, %xmm4 #1848.14 vfmadd213sd %xmm4, %xmm5, %xmm0 #1849.14 @@ -1559,30 +1559,30 @@ __svml_acos1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1854.546 lea 64(%rsp), %rsi #1854.546 -..___tag_value___svml_acos1_ha_l9.154: -# __svml_dacos_ha_cout_rare_internal(const double *, double *) - call __svml_dacos_ha_cout_rare_internal #1854.546 -..___tag_value___svml_acos1_ha_l9.155: +..___tag_value___jsvml_acos1_ha_l9.154: +# __jsvml_dacos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dacos_ha_cout_rare_internal #1854.546 +..___tag_value___jsvml_acos1_ha_l9.155: jmp ..B9.4 # Prob 100% #1854.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_acos1_ha_l9,@function - .size __svml_acos1_ha_l9,.-__svml_acos1_ha_l9 -..LN__svml_acos1_ha_l9.8: + .type __jsvml_acos1_ha_l9,@function + .size __jsvml_acos1_ha_l9,.-__jsvml_acos1_ha_l9 +..LN__jsvml_acos1_ha_l9.8: .data -# -- End __svml_acos1_ha_l9 +# -- End __jsvml_acos1_ha_l9 .text -.L_2__routine_start___svml_dacos_ha_cout_rare_internal_9: -# -- Begin __svml_dacos_ha_cout_rare_internal +.L_2__routine_start___jsvml_dacos_ha_cout_rare_internal_9: +# -- Begin __jsvml_dacos_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dacos_ha_cout_rare_internal - .globl __svml_dacos_ha_cout_rare_internal -# --- __svml_dacos_ha_cout_rare_internal(const double *, double *) -__svml_dacos_ha_cout_rare_internal: + .hidden __jsvml_dacos_ha_cout_rare_internal + .globl __jsvml_dacos_ha_cout_rare_internal +# --- __jsvml_dacos_ha_cout_rare_internal(const double *, double *) +__jsvml_dacos_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1592,7 +1592,7 @@ __svml_dacos_ha_cout_rare_internal: .byte 30 #1111.17 .byte 250 #1111.17 .cfi_startproc -..___tag_value___svml_dacos_ha_cout_rare_internal.157: +..___tag_value___jsvml_dacos_ha_cout_rare_internal.157: ..L158: #934.1 xorl %eax, %eax #947.14 @@ -2148,17 +2148,17 @@ __svml_dacos_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dacos_ha_cout_rare_internal,@function - .size __svml_dacos_ha_cout_rare_internal,.-__svml_dacos_ha_cout_rare_internal -..LN__svml_dacos_ha_cout_rare_internal.9: + .type __jsvml_dacos_ha_cout_rare_internal,@function + .size __jsvml_dacos_ha_cout_rare_internal,.-__jsvml_dacos_ha_cout_rare_internal +..LN__jsvml_dacos_ha_cout_rare_internal.9: .data -# -- End __svml_dacos_ha_cout_rare_internal +# -- End __jsvml_dacos_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dacos_ha_data_internal - .globl __svml_dacos_ha_data_internal -__svml_dacos_ha_data_internal: + .hidden __jsvml_dacos_ha_data_internal + .globl __jsvml_dacos_ha_data_internal +__jsvml_dacos_ha_data_internal: .long 0 .long 2147483648 .long 0 @@ -2891,8 +2891,8 @@ __svml_dacos_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_dacos_ha_data_internal,@object - .size __svml_dacos_ha_data_internal,2496 + .type __jsvml_dacos_ha_data_internal,@object + .size __jsvml_dacos_ha_data_internal,2496 .align 32 _vmldACosHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_asin_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_asin_linux_x86.S similarity index 86% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_asin_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_asin_linux_x86.S index 8a4cc350899..67eac47ac75 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_asin_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_asin_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_asin.c" .text ..TXTST0: -.L_2__routine_start___svml_asin2_ha_e9_0: -# -- Begin __svml_asin2_ha_e9 +.L_2__routine_start___jsvml_asin2_ha_e9_0: +# -- Begin __jsvml_asin2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_asin2_ha_e9 -# --- __svml_asin2_ha_e9(__m128d) -__svml_asin2_ha_e9: + .globl __jsvml_asin2_ha_e9 +# --- __jsvml_asin2_ha_e9(__m128d) +__jsvml_asin2_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_asin2_ha_e9: .byte 30 #974.546 .byte 250 #974.546 .cfi_startproc -..___tag_value___svml_asin2_ha_e9.1: +..___tag_value___jsvml_asin2_ha_e9.1: ..L2: #880.1 pushq %rbp #880.1 @@ -58,8 +58,8 @@ __svml_asin2_ha_e9: andq $-64, %rsp #880.1 subq $192, %rsp #880.1 movaps %xmm0, %xmm7 #880.1 - movups __svml_dasin_ha_data_internal(%rip), %xmm5 #917.45 - movups 64+__svml_dasin_ha_data_internal(%rip), %xmm10 #918.45 + movups __jsvml_dasin_ha_data_internal(%rip), %xmm5 #917.45 + movups 64+__jsvml_dasin_ha_data_internal(%rip), %xmm10 #918.45 movaps %xmm5, %xmm6 #920.8 andps %xmm7, %xmm6 #920.8 movaps %xmm10, %xmm8 #922.32 @@ -73,10 +73,10 @@ __svml_asin2_ha_e9: movlhps %xmm11, %xmm11 #929.530 movaps %xmm0, %xmm8 #929.717 rsqrtps %xmm11, %xmm12 #929.517 - cmpltpd 128+__svml_dasin_ha_data_internal(%rip), %xmm8 #929.717 + cmpltpd 128+__jsvml_dasin_ha_data_internal(%rip), %xmm8 #929.717 addpd %xmm0, %xmm0 #929.810 cvtps2pd %xmm12, %xmm13 #929.504 - movups 320+__svml_dasin_ha_data_internal(%rip), %xmm2 #929.1113 + movups 320+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #929.1113 andnps %xmm13, %xmm8 #929.760 andps %xmm0, %xmm2 #929.1113 movaps %xmm8, %xmm14 #929.1275 @@ -85,67 +85,67 @@ __svml_asin2_ha_e9: mulpd %xmm8, %xmm0 #929.1235 mulpd %xmm2, %xmm14 #929.1275 mulpd %xmm0, %xmm8 #929.1315 - subpd 384+__svml_dasin_ha_data_internal(%rip), %xmm14 #929.1356 + subpd 384+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #929.1356 addpd %xmm14, %xmm8 #929.1401 - movups 448+__svml_dasin_ha_data_internal(%rip), %xmm15 #929.1869 + movups 448+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #929.1869 movaps %xmm2, %xmm1 #929.1444 mulpd %xmm8, %xmm15 #929.1869 addpd %xmm0, %xmm1 #929.1444 - addpd 512+__svml_dasin_ha_data_internal(%rip), %xmm15 #929.1857 + addpd 512+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #929.1857 mulpd %xmm8, %xmm1 #929.1927 mulpd %xmm8, %xmm15 #929.1985 - addpd 576+__svml_dasin_ha_data_internal(%rip), %xmm15 #929.1973 + addpd 576+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #929.1973 mulpd %xmm15, %xmm8 #929.2060 - addpd 640+__svml_dasin_ha_data_internal(%rip), %xmm8 #929.2048 + addpd 640+__jsvml_dasin_ha_data_internal(%rip), %xmm8 #929.2048 mulpd %xmm8, %xmm1 #929.2130 subpd %xmm0, %xmm1 #929.2118 - movups 704+__svml_dasin_ha_data_internal(%rip), %xmm0 #934.24 + movups 704+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #934.24 movaps %xmm4, %xmm13 #936.13 mulpd %xmm4, %xmm0 #934.24 mulpd %xmm4, %xmm13 #936.13 - addpd 768+__svml_dasin_ha_data_internal(%rip), %xmm0 #934.12 - movups 256+__svml_dasin_ha_data_internal(%rip), %xmm9 #925.13 + addpd 768+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #934.12 + movups 256+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #925.13 movaps %xmm6, %xmm3 #928.14 cmpltpd %xmm6, %xmm9 #925.13 cmpnltpd %xmm10, %xmm3 #928.14 mulpd %xmm13, %xmm0 #943.24 movmskpd %xmm9, %edx #927.40 - movups 832+__svml_dasin_ha_data_internal(%rip), %xmm11 #935.27 + movups 832+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #935.27 movaps %xmm13, %xmm10 #945.13 - movups 960+__svml_dasin_ha_data_internal(%rip), %xmm9 #939.26 + movups 960+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #939.26 movaps %xmm1, %xmm8 #959.12 mulpd %xmm4, %xmm11 #935.27 mulpd %xmm4, %xmm9 #939.26 - addpd 896+__svml_dasin_ha_data_internal(%rip), %xmm11 #935.15 - addpd 1024+__svml_dasin_ha_data_internal(%rip), %xmm9 #939.14 + addpd 896+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #935.15 + addpd 1024+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #939.14 subpd %xmm2, %xmm8 #959.12 mulpd %xmm13, %xmm10 #945.13 mulpd %xmm13, %xmm9 #944.26 addpd %xmm0, %xmm11 #943.12 - movups 1088+__svml_dasin_ha_data_internal(%rip), %xmm12 #942.26 + movups 1088+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #942.26 andps %xmm3, %xmm8 #964.12 mulpd %xmm4, %xmm12 #942.26 mulpd %xmm10, %xmm11 #949.24 - addpd 1152+__svml_dasin_ha_data_internal(%rip), %xmm12 #942.14 + addpd 1152+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #942.14 addpd %xmm9, %xmm12 #944.14 - movups 1216+__svml_dasin_ha_data_internal(%rip), %xmm14 #948.26 + movups 1216+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #948.26 andnps %xmm7, %xmm5 #921.12 mulpd %xmm4, %xmm14 #948.26 addpd %xmm11, %xmm12 #949.12 - addpd 1280+__svml_dasin_ha_data_internal(%rip), %xmm14 #948.14 + addpd 1280+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #948.14 mulpd %xmm12, %xmm13 #950.24 addpd %xmm13, %xmm14 #950.12 mulpd %xmm4, %xmm14 #953.24 - addpd 1344+__svml_dasin_ha_data_internal(%rip), %xmm14 #953.12 - movups 1472+__svml_dasin_ha_data_internal(%rip), %xmm15 #956.46 + addpd 1344+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #953.12 + movups 1472+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #956.46 movaps %xmm15, %xmm0 #958.15 subpd %xmm2, %xmm0 #958.15 mulpd %xmm4, %xmm14 #954.24 subpd %xmm0, %xmm15 #960.14 - addpd 1408+__svml_dasin_ha_data_internal(%rip), %xmm14 #954.12 + addpd 1408+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #954.12 subpd %xmm15, %xmm2 #962.14 mulpd %xmm14, %xmm4 #955.12 - movups 1536+__svml_dasin_ha_data_internal(%rip), %xmm9 #961.14 + movups 1536+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #961.14 andps %xmm3, %xmm0 #966.15 addpd %xmm1, %xmm9 #961.14 subpd %xmm2, %xmm9 #963.14 @@ -211,29 +211,29 @@ __svml_asin2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #974.546 lea 128(%rsp,%r12,8), %rsi #974.546 -..___tag_value___svml_asin2_ha_e9.19: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #974.546 -..___tag_value___svml_asin2_ha_e9.20: +..___tag_value___jsvml_asin2_ha_e9.19: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #974.546 +..___tag_value___jsvml_asin2_ha_e9.20: jmp ..B1.8 # Prob 100% #974.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asin2_ha_e9,@function - .size __svml_asin2_ha_e9,.-__svml_asin2_ha_e9 -..LN__svml_asin2_ha_e9.0: + .type __jsvml_asin2_ha_e9,@function + .size __jsvml_asin2_ha_e9,.-__jsvml_asin2_ha_e9 +..LN__jsvml_asin2_ha_e9.0: .data -# -- End __svml_asin2_ha_e9 +# -- End __jsvml_asin2_ha_e9 .text -.L_2__routine_start___svml_asin2_ha_l9_1: -# -- Begin __svml_asin2_ha_l9 +.L_2__routine_start___jsvml_asin2_ha_l9_1: +# -- Begin __jsvml_asin2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_asin2_ha_l9 -# --- __svml_asin2_ha_l9(__m128d) -__svml_asin2_ha_l9: + .globl __jsvml_asin2_ha_l9 +# --- __jsvml_asin2_ha_l9(__m128d) +__jsvml_asin2_ha_l9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -242,7 +242,7 @@ __svml_asin2_ha_l9: .byte 30 #1076.546 .byte 250 #1076.546 .cfi_startproc -..___tag_value___svml_asin2_ha_l9.22: +..___tag_value___jsvml_asin2_ha_l9.22: ..L23: #982.1 pushq %rbp #982.1 @@ -253,17 +253,17 @@ __svml_asin2_ha_l9: andq $-64, %rsp #982.1 subq $192, %rsp #982.1 vmovapd %xmm0, %xmm7 #982.1 - vmovupd __svml_dasin_ha_data_internal(%rip), %xmm8 #1019.45 - vmovupd 64+__svml_dasin_ha_data_internal(%rip), %xmm12 #1020.45 + vmovupd __jsvml_dasin_ha_data_internal(%rip), %xmm8 #1019.45 + vmovupd 64+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1020.45 vandpd %xmm7, %xmm8, %xmm6 #1022.8 vmovapd %xmm12, %xmm1 #1024.8 vandnpd %xmm7, %xmm8, %xmm5 #1023.12 vfnmadd231pd %xmm6, %xmm12, %xmm1 #1024.8 - vmovupd 256+__svml_dasin_ha_data_internal(%rip), %xmm10 #1021.41 + vmovupd 256+__jsvml_dasin_ha_data_internal(%rip), %xmm10 #1021.41 vmulpd %xmm6, %xmm6, %xmm9 #1025.9 vcvtpd2ps %xmm1, %xmm13 #1031.546 vcmpltpd %xmm6, %xmm10, %xmm11 #1027.13 - vcmpltpd 128+__svml_dasin_ha_data_internal(%rip), %xmm1, %xmm0 #1031.717 + vcmpltpd 128+__jsvml_dasin_ha_data_internal(%rip), %xmm1, %xmm0 #1031.717 vminpd %xmm1, %xmm9, %xmm4 #1026.9 vcmpnltpd %xmm12, %xmm6, %xmm3 #1030.14 vmovmskpd %xmm11, %edx #1029.40 @@ -275,35 +275,35 @@ __svml_asin2_ha_l9: vandnpd %xmm2, %xmm0, %xmm8 #1031.760 vmulpd %xmm8, %xmm8, %xmm9 #1031.1068 vmulpd %xmm11, %xmm8, %xmm2 #1031.1163 - vfmsub213pd 384+__svml_dasin_ha_data_internal(%rip), %xmm11, %xmm9 #1031.1110 - vmovupd 832+__svml_dasin_ha_data_internal(%rip), %xmm12 #1037.15 - vmovupd 960+__svml_dasin_ha_data_internal(%rip), %xmm0 #1041.14 - vmovupd 1088+__svml_dasin_ha_data_internal(%rip), %xmm13 #1044.14 - vmovupd 448+__svml_dasin_ha_data_internal(%rip), %xmm1 #1031.1644 + vfmsub213pd 384+__jsvml_dasin_ha_data_internal(%rip), %xmm11, %xmm9 #1031.1110 + vmovupd 832+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1037.15 + vmovupd 960+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1041.14 + vmovupd 1088+__jsvml_dasin_ha_data_internal(%rip), %xmm13 #1044.14 + vmovupd 448+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1031.1644 vfmsub213pd %xmm2, %xmm8, %xmm11 #1031.1202 - vmovupd 704+__svml_dasin_ha_data_internal(%rip), %xmm8 #1036.12 - vfmadd213pd 768+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm8 #1036.12 - vfmadd213pd 896+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm12 #1037.15 - vfmadd213pd 1024+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm0 #1041.14 - vfmadd213pd 1152+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm13 #1044.14 - vfmadd213pd 512+__svml_dasin_ha_data_internal(%rip), %xmm9, %xmm1 #1031.1644 + vmovupd 704+__jsvml_dasin_ha_data_internal(%rip), %xmm8 #1036.12 + vfmadd213pd 768+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm8 #1036.12 + vfmadd213pd 896+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm12 #1037.15 + vfmadd213pd 1024+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm0 #1041.14 + vfmadd213pd 1152+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm13 #1044.14 + vfmadd213pd 512+__jsvml_dasin_ha_data_internal(%rip), %xmm9, %xmm1 #1031.1644 vmulpd %xmm15, %xmm15, %xmm14 #1047.13 vfmadd213pd %xmm12, %xmm15, %xmm8 #1045.12 vfmadd213pd %xmm13, %xmm15, %xmm0 #1046.14 - vmovupd 1216+__svml_dasin_ha_data_internal(%rip), %xmm12 #1050.14 - vfmadd213pd 1280+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm12 #1050.14 - vfmadd213pd 576+__svml_dasin_ha_data_internal(%rip), %xmm9, %xmm1 #1031.1748 + vmovupd 1216+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1050.14 + vfmadd213pd 1280+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm12 #1050.14 + vfmadd213pd 576+__jsvml_dasin_ha_data_internal(%rip), %xmm9, %xmm1 #1031.1748 vmulpd %xmm2, %xmm9, %xmm10 #1031.1702 vfmadd213pd %xmm0, %xmm14, %xmm8 #1051.12 - vfmadd213pd 640+__svml_dasin_ha_data_internal(%rip), %xmm9, %xmm1 #1031.1811 + vfmadd213pd 640+__jsvml_dasin_ha_data_internal(%rip), %xmm9, %xmm1 #1031.1811 vfmadd213pd %xmm12, %xmm15, %xmm8 #1052.12 vfmsub213pd %xmm11, %xmm10, %xmm1 #1031.1869 - vfmadd213pd 1344+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm8 #1055.12 - vfmadd213pd 1408+__svml_dasin_ha_data_internal(%rip), %xmm4, %xmm8 #1056.12 + vfmadd213pd 1344+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm8 #1055.12 + vfmadd213pd 1408+__jsvml_dasin_ha_data_internal(%rip), %xmm4, %xmm8 #1056.12 vmulpd %xmm8, %xmm4, %xmm0 #1057.12 vsubpd %xmm2, %xmm1, %xmm8 #1061.12 - vaddpd 1536+__svml_dasin_ha_data_internal(%rip), %xmm1, %xmm1 #1063.14 - vmovupd 1472+__svml_dasin_ha_data_internal(%rip), %xmm4 #1058.46 + vaddpd 1536+__jsvml_dasin_ha_data_internal(%rip), %xmm1, %xmm1 #1063.14 + vmovupd 1472+__jsvml_dasin_ha_data_internal(%rip), %xmm4 #1058.46 vandpd %xmm3, %xmm8, %xmm11 #1066.12 vsubpd %xmm2, %xmm4, %xmm10 #1060.15 vsubpd %xmm10, %xmm4, %xmm4 #1062.14 @@ -372,29 +372,29 @@ __svml_asin2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1076.546 lea 128(%rsp,%r12,8), %rsi #1076.546 -..___tag_value___svml_asin2_ha_l9.40: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1076.546 -..___tag_value___svml_asin2_ha_l9.41: +..___tag_value___jsvml_asin2_ha_l9.40: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1076.546 +..___tag_value___jsvml_asin2_ha_l9.41: jmp ..B2.8 # Prob 100% #1076.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asin2_ha_l9,@function - .size __svml_asin2_ha_l9,.-__svml_asin2_ha_l9 -..LN__svml_asin2_ha_l9.1: + .type __jsvml_asin2_ha_l9,@function + .size __jsvml_asin2_ha_l9,.-__jsvml_asin2_ha_l9 +..LN__jsvml_asin2_ha_l9.1: .data -# -- End __svml_asin2_ha_l9 +# -- End __jsvml_asin2_ha_l9 .text -.L_2__routine_start___svml_asin4_ha_l9_2: -# -- Begin __svml_asin4_ha_l9 +.L_2__routine_start___jsvml_asin4_ha_l9_2: +# -- Begin __jsvml_asin4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_asin4_ha_l9 -# --- __svml_asin4_ha_l9(__m256d) -__svml_asin4_ha_l9: + .globl __jsvml_asin4_ha_l9 +# --- __jsvml_asin4_ha_l9(__m256d) +__jsvml_asin4_ha_l9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -403,7 +403,7 @@ __svml_asin4_ha_l9: .byte 30 #1178.552 .byte 250 #1178.552 .cfi_startproc -..___tag_value___svml_asin4_ha_l9.43: +..___tag_value___jsvml_asin4_ha_l9.43: ..L44: #1084.1 pushq %rbp #1084.1 @@ -413,57 +413,57 @@ __svml_asin4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1084.1 subq $192, %rsp #1084.1 - vmovupd __svml_dasin_ha_data_internal(%rip), %ymm8 #1121.48 - vmovupd 64+__svml_dasin_ha_data_internal(%rip), %ymm12 #1122.48 - vmovupd 256+__svml_dasin_ha_data_internal(%rip), %ymm10 #1123.44 + vmovupd __jsvml_dasin_ha_data_internal(%rip), %ymm8 #1121.48 + vmovupd 64+__jsvml_dasin_ha_data_internal(%rip), %ymm12 #1122.48 + vmovupd 256+__jsvml_dasin_ha_data_internal(%rip), %ymm10 #1123.44 vmovapd %ymm0, %ymm7 #1084.1 vandpd %ymm7, %ymm8, %ymm6 #1124.8 vmovapd %ymm12, %ymm2 #1126.8 vfnmadd231pd %ymm6, %ymm12, %ymm2 #1126.8 vmulpd %ymm6, %ymm6, %ymm9 #1127.9 vcmplt_oqpd %ymm6, %ymm10, %ymm11 #1129.13 - vcmplt_oqpd 128+__svml_dasin_ha_data_internal(%rip), %ymm2, %ymm15 #1133.666 + vcmplt_oqpd 128+__jsvml_dasin_ha_data_internal(%rip), %ymm2, %ymm15 #1133.666 vaddpd %ymm2, %ymm2, %ymm10 #1133.775 vminpd %ymm2, %ymm9, %ymm4 #1128.9 vcmpnlt_uqpd %ymm12, %ymm6, %ymm3 #1132.14 vcvtpd2ps %ymm2, %xmm13 #1133.533 - vmovupd 1088+__svml_dasin_ha_data_internal(%rip), %ymm12 #1146.14 + vmovupd 1088+__jsvml_dasin_ha_data_internal(%rip), %ymm12 #1146.14 vrsqrtps %xmm13, %xmm14 #1133.520 - vfmadd213pd 1152+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm12 #1146.14 + vfmadd213pd 1152+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm12 #1146.14 vcvtps2pd %xmm14, %ymm0 #1133.504 - vmovupd 960+__svml_dasin_ha_data_internal(%rip), %ymm14 #1143.14 + vmovupd 960+__jsvml_dasin_ha_data_internal(%rip), %ymm14 #1143.14 vandnpd %ymm0, %ymm15, %ymm1 #1133.722 vandnpd %ymm7, %ymm8, %ymm5 #1125.12 vmulpd %ymm1, %ymm1, %ymm8 #1133.1042 vmulpd %ymm10, %ymm1, %ymm2 #1133.1143 - vfmadd213pd 1024+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm14 #1143.14 + vfmadd213pd 1024+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm14 #1143.14 vmulpd %ymm4, %ymm4, %ymm15 #1140.13 - vmovupd 1216+__svml_dasin_ha_data_internal(%rip), %ymm0 #1152.14 - vfmsub213pd 384+__svml_dasin_ha_data_internal(%rip), %ymm10, %ymm8 #1133.1087 + vmovupd 1216+__jsvml_dasin_ha_data_internal(%rip), %ymm0 #1152.14 + vfmsub213pd 384+__jsvml_dasin_ha_data_internal(%rip), %ymm10, %ymm8 #1133.1087 vfmsub213pd %ymm2, %ymm1, %ymm10 #1133.1185 - vmovupd 448+__svml_dasin_ha_data_internal(%rip), %ymm1 #1133.1642 + vmovupd 448+__jsvml_dasin_ha_data_internal(%rip), %ymm1 #1133.1642 vfmadd213pd %ymm12, %ymm15, %ymm14 #1148.14 vmulpd %ymm15, %ymm15, %ymm13 #1149.13 vmulpd %ymm2, %ymm8, %ymm9 #1133.1703 - vfmadd213pd 1280+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm0 #1152.14 - vfmadd213pd 512+__svml_dasin_ha_data_internal(%rip), %ymm8, %ymm1 #1133.1642 - vfmadd213pd 576+__svml_dasin_ha_data_internal(%rip), %ymm8, %ymm1 #1133.1752 - vfmadd213pd 640+__svml_dasin_ha_data_internal(%rip), %ymm8, %ymm1 #1133.1818 - vmovupd 704+__svml_dasin_ha_data_internal(%rip), %ymm8 #1138.12 + vfmadd213pd 1280+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm0 #1152.14 + vfmadd213pd 512+__jsvml_dasin_ha_data_internal(%rip), %ymm8, %ymm1 #1133.1642 + vfmadd213pd 576+__jsvml_dasin_ha_data_internal(%rip), %ymm8, %ymm1 #1133.1752 + vfmadd213pd 640+__jsvml_dasin_ha_data_internal(%rip), %ymm8, %ymm1 #1133.1818 + vmovupd 704+__jsvml_dasin_ha_data_internal(%rip), %ymm8 #1138.12 vfmsub213pd %ymm10, %ymm9, %ymm1 #1133.1879 - vfmadd213pd 768+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm8 #1138.12 + vfmadd213pd 768+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm8 #1138.12 vmovmskpd %ymm11, %edx #1131.40 - vmovupd 832+__svml_dasin_ha_data_internal(%rip), %ymm11 #1139.15 - vfmadd213pd 896+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm11 #1139.15 + vmovupd 832+__jsvml_dasin_ha_data_internal(%rip), %ymm11 #1139.15 + vfmadd213pd 896+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm11 #1139.15 vfmadd213pd %ymm11, %ymm15, %ymm8 #1147.12 vfmadd213pd %ymm14, %ymm13, %ymm8 #1153.12 vfmadd213pd %ymm0, %ymm15, %ymm8 #1154.12 - vfmadd213pd 1344+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm8 #1157.12 - vfmadd213pd 1408+__svml_dasin_ha_data_internal(%rip), %ymm4, %ymm8 #1158.12 + vfmadd213pd 1344+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm8 #1157.12 + vfmadd213pd 1408+__jsvml_dasin_ha_data_internal(%rip), %ymm4, %ymm8 #1158.12 vmulpd %ymm8, %ymm4, %ymm0 #1159.12 - vmovupd 1472+__svml_dasin_ha_data_internal(%rip), %ymm4 #1160.49 + vmovupd 1472+__jsvml_dasin_ha_data_internal(%rip), %ymm4 #1160.49 vsubpd %ymm2, %ymm1, %ymm8 #1163.12 - vaddpd 1536+__svml_dasin_ha_data_internal(%rip), %ymm1, %ymm1 #1165.14 + vaddpd 1536+__jsvml_dasin_ha_data_internal(%rip), %ymm1, %ymm1 #1165.14 vsubpd %ymm2, %ymm4, %ymm10 #1162.15 vsubpd %ymm10, %ymm4, %ymm4 #1164.14 vsubpd %ymm4, %ymm2, %ymm2 #1166.14 @@ -536,29 +536,29 @@ __svml_asin4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1178.552 lea 128(%rsp,%r12,8), %rsi #1178.552 -..___tag_value___svml_asin4_ha_l9.61: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1178.552 -..___tag_value___svml_asin4_ha_l9.62: +..___tag_value___jsvml_asin4_ha_l9.61: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1178.552 +..___tag_value___jsvml_asin4_ha_l9.62: jmp ..B3.8 # Prob 100% #1178.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asin4_ha_l9,@function - .size __svml_asin4_ha_l9,.-__svml_asin4_ha_l9 -..LN__svml_asin4_ha_l9.2: + .type __jsvml_asin4_ha_l9,@function + .size __jsvml_asin4_ha_l9,.-__jsvml_asin4_ha_l9 +..LN__jsvml_asin4_ha_l9.2: .data -# -- End __svml_asin4_ha_l9 +# -- End __jsvml_asin4_ha_l9 .text -.L_2__routine_start___svml_asin1_ha_ex_3: -# -- Begin __svml_asin1_ha_ex +.L_2__routine_start___jsvml_asin1_ha_ex_3: +# -- Begin __jsvml_asin1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_asin1_ha_ex -# --- __svml_asin1_ha_ex(__m128d) -__svml_asin1_ha_ex: + .globl __jsvml_asin1_ha_ex +# --- __jsvml_asin1_ha_ex(__m128d) +__jsvml_asin1_ha_ex: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -567,7 +567,7 @@ __svml_asin1_ha_ex: .byte 30 #1280.546 .byte 250 #1280.546 .cfi_startproc -..___tag_value___svml_asin1_ha_ex.64: +..___tag_value___jsvml_asin1_ha_ex.64: ..L65: #1186.1 pushq %rbp #1186.1 @@ -578,15 +578,15 @@ __svml_asin1_ha_ex: andq $-64, %rsp #1186.1 subq $128, %rsp #1186.1 movaps %xmm0, %xmm8 #1186.1 - movsd __svml_dasin_ha_data_internal(%rip), %xmm6 #1223.14 + movsd __jsvml_dasin_ha_data_internal(%rip), %xmm6 #1223.14 movaps %xmm6, %xmm7 #1226.8 andnps %xmm8, %xmm6 #1227.12 andps %xmm8, %xmm7 #1226.8 - movsd 64+__svml_dasin_ha_data_internal(%rip), %xmm12 #1224.14 + movsd 64+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1224.14 movaps %xmm7, %xmm9 #1228.32 mulsd %xmm12, %xmm9 #1228.32 movaps %xmm12, %xmm0 #1228.8 - movsd 320+__svml_dasin_ha_data_internal(%rip), %xmm3 #1235.1113 + movsd 320+__jsvml_dasin_ha_data_internal(%rip), %xmm3 #1235.1113 movaps %xmm7, %xmm5 #1229.9 mulsd %xmm7, %xmm5 #1229.9 subsd %xmm9, %xmm0 #1228.8 @@ -598,7 +598,7 @@ __svml_asin1_ha_ex: movaps %xmm0, %xmm2 #1235.717 movaps %xmm7, %xmm4 #1234.14 unpcklpd %xmm0, %xmm10 #1230.72 - cmpltsd 128+__svml_dasin_ha_data_internal(%rip), %xmm2 #1235.717 + cmpltsd 128+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1235.717 addsd %xmm0, %xmm0 #1235.810 cmpnltsd %xmm12, %xmm4 #1234.14 andnps %xmm15, %xmm2 #1235.760 @@ -614,59 +614,59 @@ __svml_asin1_ha_ex: movaps %xmm3, %xmm10 #1235.1444 addsd %xmm0, %xmm10 #1235.1444 mulsd %xmm2, %xmm1 #1235.1315 - subsd 384+__svml_dasin_ha_data_internal(%rip), %xmm9 #1235.1356 - movsd 448+__svml_dasin_ha_data_internal(%rip), %xmm2 #1235.1869 + subsd 384+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1235.1356 + movsd 448+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1235.1869 movaps %xmm5, %xmm14 #1242.13 - movsd 256+__svml_dasin_ha_data_internal(%rip), %xmm11 #1231.13 + movsd 256+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1231.13 movaps %xmm5, %xmm13 #1245.26 mulsd %xmm5, %xmm14 #1242.13 addsd %xmm1, %xmm9 #1235.1401 cmpltsd %xmm7, %xmm11 #1231.13 - mulsd 960+__svml_dasin_ha_data_internal(%rip), %xmm13 #1245.26 + mulsd 960+__jsvml_dasin_ha_data_internal(%rip), %xmm13 #1245.26 mulsd %xmm9, %xmm2 #1235.1869 mulsd %xmm9, %xmm10 #1235.1927 - addsd 1024+__svml_dasin_ha_data_internal(%rip), %xmm13 #1245.14 + addsd 1024+__jsvml_dasin_ha_data_internal(%rip), %xmm13 #1245.14 movmskpd %xmm11, %eax #1233.40 - addsd 512+__svml_dasin_ha_data_internal(%rip), %xmm2 #1235.1857 + addsd 512+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1235.1857 mulsd %xmm14, %xmm13 #1250.26 mulsd %xmm9, %xmm2 #1235.1985 movaps %xmm5, %xmm1 #1240.24 movaps %xmm5, %xmm11 #1248.26 - mulsd 704+__svml_dasin_ha_data_internal(%rip), %xmm1 #1240.24 + mulsd 704+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1240.24 movaps %xmm14, %xmm12 #1251.13 - addsd 576+__svml_dasin_ha_data_internal(%rip), %xmm2 #1235.1973 - mulsd 1088+__svml_dasin_ha_data_internal(%rip), %xmm11 #1248.26 + addsd 576+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1235.1973 + mulsd 1088+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1248.26 mulsd %xmm14, %xmm12 #1251.13 - addsd 768+__svml_dasin_ha_data_internal(%rip), %xmm1 #1240.12 + addsd 768+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1240.12 mulsd %xmm9, %xmm2 #1235.2060 - addsd 1152+__svml_dasin_ha_data_internal(%rip), %xmm11 #1248.14 + addsd 1152+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1248.14 mulsd %xmm14, %xmm1 #1249.24 - addsd 640+__svml_dasin_ha_data_internal(%rip), %xmm2 #1235.2048 + addsd 640+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1235.2048 addsd %xmm11, %xmm13 #1250.14 mulsd %xmm10, %xmm2 #1235.2130 - movsd 1536+__svml_dasin_ha_data_internal(%rip), %xmm10 #1267.14 + movsd 1536+__jsvml_dasin_ha_data_internal(%rip), %xmm10 #1267.14 subsd %xmm0, %xmm2 #1235.2118 movaps %xmm5, %xmm0 #1241.27 movaps %xmm2, %xmm9 #1265.12 - mulsd 832+__svml_dasin_ha_data_internal(%rip), %xmm0 #1241.27 + mulsd 832+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1241.27 subsd %xmm3, %xmm9 #1265.12 addsd %xmm2, %xmm10 #1267.14 - addsd 896+__svml_dasin_ha_data_internal(%rip), %xmm0 #1241.15 + addsd 896+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1241.15 andps %xmm4, %xmm9 #1270.12 addsd %xmm0, %xmm1 #1249.12 mulsd %xmm12, %xmm1 #1255.24 movaps %xmm5, %xmm0 #1254.26 - mulsd 1216+__svml_dasin_ha_data_internal(%rip), %xmm0 #1254.26 + mulsd 1216+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1254.26 addsd %xmm13, %xmm1 #1255.12 - addsd 1280+__svml_dasin_ha_data_internal(%rip), %xmm0 #1254.14 + addsd 1280+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1254.14 mulsd %xmm14, %xmm1 #1256.24 addsd %xmm0, %xmm1 #1256.12 mulsd %xmm5, %xmm1 #1259.24 - addsd 1344+__svml_dasin_ha_data_internal(%rip), %xmm1 #1259.12 + addsd 1344+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1259.12 mulsd %xmm5, %xmm1 #1260.24 - addsd 1408+__svml_dasin_ha_data_internal(%rip), %xmm1 #1260.12 + addsd 1408+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1260.12 mulsd %xmm5, %xmm1 #1261.12 - movsd 1472+__svml_dasin_ha_data_internal(%rip), %xmm5 #1262.15 + movsd 1472+__jsvml_dasin_ha_data_internal(%rip), %xmm5 #1262.15 movaps %xmm5, %xmm0 #1264.15 subsd %xmm3, %xmm0 #1264.15 subsd %xmm0, %xmm5 #1266.14 @@ -715,29 +715,29 @@ __svml_asin1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1280.546 lea 64(%rsp), %rsi #1280.546 -..___tag_value___svml_asin1_ha_ex.77: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1280.546 -..___tag_value___svml_asin1_ha_ex.78: +..___tag_value___jsvml_asin1_ha_ex.77: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1280.546 +..___tag_value___jsvml_asin1_ha_ex.78: jmp ..B4.4 # Prob 100% #1280.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_asin1_ha_ex,@function - .size __svml_asin1_ha_ex,.-__svml_asin1_ha_ex -..LN__svml_asin1_ha_ex.3: + .type __jsvml_asin1_ha_ex,@function + .size __jsvml_asin1_ha_ex,.-__jsvml_asin1_ha_ex +..LN__jsvml_asin1_ha_ex.3: .data -# -- End __svml_asin1_ha_ex +# -- End __jsvml_asin1_ha_ex .text -.L_2__routine_start___svml_asin4_ha_e9_4: -# -- Begin __svml_asin4_ha_e9 +.L_2__routine_start___jsvml_asin4_ha_e9_4: +# -- Begin __jsvml_asin4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_asin4_ha_e9 -# --- __svml_asin4_ha_e9(__m256d) -__svml_asin4_ha_e9: + .globl __jsvml_asin4_ha_e9 +# --- __jsvml_asin4_ha_e9(__m256d) +__jsvml_asin4_ha_e9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -746,7 +746,7 @@ __svml_asin4_ha_e9: .byte 30 #1382.552 .byte 250 #1382.552 .cfi_startproc -..___tag_value___svml_asin4_ha_e9.80: +..___tag_value___jsvml_asin4_ha_e9.80: ..L81: #1288.1 pushq %rbp #1288.1 @@ -756,9 +756,9 @@ __svml_asin4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1288.1 subq $192, %rsp #1288.1 - vmovupd __svml_dasin_ha_data_internal(%rip), %ymm11 #1325.48 - vmovupd 64+__svml_dasin_ha_data_internal(%rip), %ymm4 #1326.48 - vmovupd 256+__svml_dasin_ha_data_internal(%rip), %ymm14 #1327.44 + vmovupd __jsvml_dasin_ha_data_internal(%rip), %ymm11 #1325.48 + vmovupd 64+__jsvml_dasin_ha_data_internal(%rip), %ymm4 #1326.48 + vmovupd 256+__jsvml_dasin_ha_data_internal(%rip), %ymm14 #1327.44 vmovapd %ymm0, %ymm10 #1288.1 vandpd %ymm10, %ymm11, %ymm9 #1328.8 vmulpd %ymm4, %ymm9, %ymm12 #1330.35 @@ -767,13 +767,13 @@ __svml_asin4_ha_e9: vsubpd %ymm12, %ymm4, %ymm6 #1330.8 vcvtpd2ps %ymm6, %xmm2 #1337.533 vminpd %ymm6, %ymm13, %ymm7 #1332.9 - vcmplt_oqpd 128+__svml_dasin_ha_data_internal(%rip), %ymm6, %ymm3 #1337.666 + vcmplt_oqpd 128+__jsvml_dasin_ha_data_internal(%rip), %ymm6, %ymm3 #1337.666 vaddpd %ymm6, %ymm6, %ymm6 #1337.775 vrsqrtps %xmm2, %xmm1 #1337.520 vandnpd %ymm10, %ymm11, %ymm8 #1329.12 vcvtps2pd %xmm1, %ymm11 #1337.504 vandnpd %ymm11, %ymm3, %ymm14 #1337.722 - vandpd 320+__svml_dasin_ha_data_internal(%rip), %ymm6, %ymm12 #1337.1087 + vandpd 320+__jsvml_dasin_ha_data_internal(%rip), %ymm6, %ymm12 #1337.1087 vsubpd %ymm12, %ymm6, %ymm13 #1337.1136 vmulpd %ymm13, %ymm14, %ymm3 #1337.1218 vmulpd %ymm3, %ymm14, %ymm2 #1337.1304 @@ -784,45 +784,45 @@ __svml_asin4_ha_e9: vmulpd %ymm12, %ymm14, %ymm4 #1337.1177 vmulpd %ymm4, %ymm14, %ymm0 #1337.1261 vaddpd %ymm3, %ymm4, %ymm11 #1337.1442 - vsubpd 384+__svml_dasin_ha_data_internal(%rip), %ymm0, %ymm1 #1337.1348 + vsubpd 384+__jsvml_dasin_ha_data_internal(%rip), %ymm0, %ymm1 #1337.1348 vaddpd %ymm1, %ymm2, %ymm14 #1337.1396 - vmulpd 448+__svml_dasin_ha_data_internal(%rip), %ymm14, %ymm6 #1337.1885 + vmulpd 448+__jsvml_dasin_ha_data_internal(%rip), %ymm14, %ymm6 #1337.1885 vmulpd %ymm11, %ymm14, %ymm2 #1337.1946 - vaddpd 512+__svml_dasin_ha_data_internal(%rip), %ymm6, %ymm12 #1337.1870 + vaddpd 512+__jsvml_dasin_ha_data_internal(%rip), %ymm6, %ymm12 #1337.1870 vmulpd %ymm12, %ymm14, %ymm13 #1337.2010 - vaddpd 576+__svml_dasin_ha_data_internal(%rip), %ymm13, %ymm15 #1337.1995 + vaddpd 576+__jsvml_dasin_ha_data_internal(%rip), %ymm13, %ymm15 #1337.1995 vmulpd %ymm15, %ymm14, %ymm0 #1337.2091 - vaddpd 640+__svml_dasin_ha_data_internal(%rip), %ymm0, %ymm1 #1337.2076 - vmulpd 832+__svml_dasin_ha_data_internal(%rip), %ymm7, %ymm0 #1343.30 + vaddpd 640+__jsvml_dasin_ha_data_internal(%rip), %ymm0, %ymm1 #1337.2076 + vmulpd 832+__jsvml_dasin_ha_data_internal(%rip), %ymm7, %ymm0 #1343.30 vmulpd %ymm1, %ymm2, %ymm6 #1337.2167 vmulpd %ymm7, %ymm7, %ymm1 #1344.13 - vaddpd 896+__svml_dasin_ha_data_internal(%rip), %ymm0, %ymm12 #1343.15 + vaddpd 896+__jsvml_dasin_ha_data_internal(%rip), %ymm0, %ymm12 #1343.15 vsubpd %ymm3, %ymm6, %ymm2 #1337.2152 - vmulpd 704+__svml_dasin_ha_data_internal(%rip), %ymm7, %ymm3 #1342.27 - vmulpd 1088+__svml_dasin_ha_data_internal(%rip), %ymm7, %ymm6 #1350.29 - vaddpd 768+__svml_dasin_ha_data_internal(%rip), %ymm3, %ymm11 #1342.12 - vaddpd 1152+__svml_dasin_ha_data_internal(%rip), %ymm6, %ymm15 #1350.14 - vmulpd 960+__svml_dasin_ha_data_internal(%rip), %ymm7, %ymm3 #1347.29 + vmulpd 704+__jsvml_dasin_ha_data_internal(%rip), %ymm7, %ymm3 #1342.27 + vmulpd 1088+__jsvml_dasin_ha_data_internal(%rip), %ymm7, %ymm6 #1350.29 + vaddpd 768+__jsvml_dasin_ha_data_internal(%rip), %ymm3, %ymm11 #1342.12 + vaddpd 1152+__jsvml_dasin_ha_data_internal(%rip), %ymm6, %ymm15 #1350.14 + vmulpd 960+__jsvml_dasin_ha_data_internal(%rip), %ymm7, %ymm3 #1347.29 vmulpd %ymm1, %ymm11, %ymm13 #1351.27 vmulpd %ymm1, %ymm1, %ymm6 #1353.13 - vaddpd 1024+__svml_dasin_ha_data_internal(%rip), %ymm3, %ymm14 #1347.14 + vaddpd 1024+__jsvml_dasin_ha_data_internal(%rip), %ymm3, %ymm14 #1347.14 vaddpd %ymm13, %ymm12, %ymm3 #1351.12 vmulpd %ymm14, %ymm1, %ymm0 #1352.29 vmulpd %ymm6, %ymm3, %ymm12 #1357.27 - vmulpd 1216+__svml_dasin_ha_data_internal(%rip), %ymm7, %ymm14 #1356.29 + vmulpd 1216+__jsvml_dasin_ha_data_internal(%rip), %ymm7, %ymm14 #1356.29 vaddpd %ymm0, %ymm15, %ymm11 #1352.14 - vaddpd 1280+__svml_dasin_ha_data_internal(%rip), %ymm14, %ymm15 #1356.14 + vaddpd 1280+__jsvml_dasin_ha_data_internal(%rip), %ymm14, %ymm15 #1356.14 vaddpd %ymm12, %ymm11, %ymm13 #1357.12 vmulpd %ymm13, %ymm1, %ymm1 #1358.27 vaddpd %ymm1, %ymm15, %ymm0 #1358.12 vmulpd %ymm0, %ymm7, %ymm1 #1361.27 - vaddpd 1344+__svml_dasin_ha_data_internal(%rip), %ymm1, %ymm3 #1361.12 + vaddpd 1344+__jsvml_dasin_ha_data_internal(%rip), %ymm1, %ymm3 #1361.12 vsubpd %ymm4, %ymm2, %ymm1 #1367.12 - vaddpd 1536+__svml_dasin_ha_data_internal(%rip), %ymm2, %ymm2 #1369.14 + vaddpd 1536+__jsvml_dasin_ha_data_internal(%rip), %ymm2, %ymm2 #1369.14 vmulpd %ymm3, %ymm7, %ymm6 #1362.27 - vaddpd 1408+__svml_dasin_ha_data_internal(%rip), %ymm6, %ymm11 #1362.12 + vaddpd 1408+__jsvml_dasin_ha_data_internal(%rip), %ymm6, %ymm11 #1362.12 vmulpd %ymm11, %ymm7, %ymm0 #1363.12 - vmovupd 1472+__svml_dasin_ha_data_internal(%rip), %ymm7 #1364.49 + vmovupd 1472+__jsvml_dasin_ha_data_internal(%rip), %ymm7 #1364.49 vsubpd %ymm4, %ymm7, %ymm6 #1366.15 vsubpd %ymm6, %ymm7, %ymm7 #1368.14 vsubpd %ymm7, %ymm4, %ymm4 #1370.14 @@ -896,29 +896,29 @@ __svml_asin4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1382.552 lea 128(%rsp,%r12,8), %rsi #1382.552 -..___tag_value___svml_asin4_ha_e9.98: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1382.552 -..___tag_value___svml_asin4_ha_e9.99: +..___tag_value___jsvml_asin4_ha_e9.98: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1382.552 +..___tag_value___jsvml_asin4_ha_e9.99: jmp ..B5.8 # Prob 100% #1382.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asin4_ha_e9,@function - .size __svml_asin4_ha_e9,.-__svml_asin4_ha_e9 -..LN__svml_asin4_ha_e9.4: + .type __jsvml_asin4_ha_e9,@function + .size __jsvml_asin4_ha_e9,.-__jsvml_asin4_ha_e9 +..LN__jsvml_asin4_ha_e9.4: .data -# -- End __svml_asin4_ha_e9 +# -- End __jsvml_asin4_ha_e9 .text -.L_2__routine_start___svml_asin2_ha_ex_5: -# -- Begin __svml_asin2_ha_ex +.L_2__routine_start___jsvml_asin2_ha_ex_5: +# -- Begin __jsvml_asin2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_asin2_ha_ex -# --- __svml_asin2_ha_ex(__m128d) -__svml_asin2_ha_ex: + .globl __jsvml_asin2_ha_ex +# --- __jsvml_asin2_ha_ex(__m128d) +__jsvml_asin2_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -927,7 +927,7 @@ __svml_asin2_ha_ex: .byte 30 #1484.546 .byte 250 #1484.546 .cfi_startproc -..___tag_value___svml_asin2_ha_ex.101: +..___tag_value___jsvml_asin2_ha_ex.101: ..L102: #1390.1 pushq %rbp #1390.1 @@ -938,8 +938,8 @@ __svml_asin2_ha_ex: andq $-64, %rsp #1390.1 subq $192, %rsp #1390.1 movaps %xmm0, %xmm7 #1390.1 - movups __svml_dasin_ha_data_internal(%rip), %xmm5 #1427.45 - movups 64+__svml_dasin_ha_data_internal(%rip), %xmm10 #1428.45 + movups __jsvml_dasin_ha_data_internal(%rip), %xmm5 #1427.45 + movups 64+__jsvml_dasin_ha_data_internal(%rip), %xmm10 #1428.45 movaps %xmm5, %xmm6 #1430.8 andps %xmm7, %xmm6 #1430.8 movaps %xmm10, %xmm8 #1432.32 @@ -953,10 +953,10 @@ __svml_asin2_ha_ex: movlhps %xmm11, %xmm11 #1439.530 movaps %xmm0, %xmm8 #1439.717 rsqrtps %xmm11, %xmm12 #1439.517 - cmpltpd 128+__svml_dasin_ha_data_internal(%rip), %xmm8 #1439.717 + cmpltpd 128+__jsvml_dasin_ha_data_internal(%rip), %xmm8 #1439.717 addpd %xmm0, %xmm0 #1439.810 cvtps2pd %xmm12, %xmm13 #1439.504 - movups 320+__svml_dasin_ha_data_internal(%rip), %xmm2 #1439.1113 + movups 320+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1439.1113 andnps %xmm13, %xmm8 #1439.760 andps %xmm0, %xmm2 #1439.1113 movaps %xmm8, %xmm14 #1439.1275 @@ -965,67 +965,67 @@ __svml_asin2_ha_ex: mulpd %xmm8, %xmm0 #1439.1235 mulpd %xmm2, %xmm14 #1439.1275 mulpd %xmm0, %xmm8 #1439.1315 - subpd 384+__svml_dasin_ha_data_internal(%rip), %xmm14 #1439.1356 + subpd 384+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #1439.1356 addpd %xmm14, %xmm8 #1439.1401 - movups 448+__svml_dasin_ha_data_internal(%rip), %xmm15 #1439.1869 + movups 448+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #1439.1869 movaps %xmm2, %xmm1 #1439.1444 mulpd %xmm8, %xmm15 #1439.1869 addpd %xmm0, %xmm1 #1439.1444 - addpd 512+__svml_dasin_ha_data_internal(%rip), %xmm15 #1439.1857 + addpd 512+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #1439.1857 mulpd %xmm8, %xmm1 #1439.1927 mulpd %xmm8, %xmm15 #1439.1985 - addpd 576+__svml_dasin_ha_data_internal(%rip), %xmm15 #1439.1973 + addpd 576+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #1439.1973 mulpd %xmm15, %xmm8 #1439.2060 - addpd 640+__svml_dasin_ha_data_internal(%rip), %xmm8 #1439.2048 + addpd 640+__jsvml_dasin_ha_data_internal(%rip), %xmm8 #1439.2048 mulpd %xmm8, %xmm1 #1439.2130 subpd %xmm0, %xmm1 #1439.2118 - movups 704+__svml_dasin_ha_data_internal(%rip), %xmm0 #1444.24 + movups 704+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1444.24 movaps %xmm4, %xmm13 #1446.13 mulpd %xmm4, %xmm0 #1444.24 mulpd %xmm4, %xmm13 #1446.13 - addpd 768+__svml_dasin_ha_data_internal(%rip), %xmm0 #1444.12 - movups 256+__svml_dasin_ha_data_internal(%rip), %xmm9 #1435.13 + addpd 768+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1444.12 + movups 256+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1435.13 movaps %xmm6, %xmm3 #1438.14 cmpltpd %xmm6, %xmm9 #1435.13 cmpnltpd %xmm10, %xmm3 #1438.14 mulpd %xmm13, %xmm0 #1453.24 movmskpd %xmm9, %edx #1437.40 - movups 832+__svml_dasin_ha_data_internal(%rip), %xmm11 #1445.27 + movups 832+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1445.27 movaps %xmm13, %xmm10 #1455.13 - movups 960+__svml_dasin_ha_data_internal(%rip), %xmm9 #1449.26 + movups 960+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1449.26 movaps %xmm1, %xmm8 #1469.12 mulpd %xmm4, %xmm11 #1445.27 mulpd %xmm4, %xmm9 #1449.26 - addpd 896+__svml_dasin_ha_data_internal(%rip), %xmm11 #1445.15 - addpd 1024+__svml_dasin_ha_data_internal(%rip), %xmm9 #1449.14 + addpd 896+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1445.15 + addpd 1024+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1449.14 subpd %xmm2, %xmm8 #1469.12 mulpd %xmm13, %xmm10 #1455.13 mulpd %xmm13, %xmm9 #1454.26 addpd %xmm0, %xmm11 #1453.12 - movups 1088+__svml_dasin_ha_data_internal(%rip), %xmm12 #1452.26 + movups 1088+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1452.26 andps %xmm3, %xmm8 #1474.12 mulpd %xmm4, %xmm12 #1452.26 mulpd %xmm10, %xmm11 #1459.24 - addpd 1152+__svml_dasin_ha_data_internal(%rip), %xmm12 #1452.14 + addpd 1152+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1452.14 addpd %xmm9, %xmm12 #1454.14 - movups 1216+__svml_dasin_ha_data_internal(%rip), %xmm14 #1458.26 + movups 1216+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #1458.26 andnps %xmm7, %xmm5 #1431.12 mulpd %xmm4, %xmm14 #1458.26 addpd %xmm11, %xmm12 #1459.12 - addpd 1280+__svml_dasin_ha_data_internal(%rip), %xmm14 #1458.14 + addpd 1280+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #1458.14 mulpd %xmm12, %xmm13 #1460.24 addpd %xmm13, %xmm14 #1460.12 mulpd %xmm4, %xmm14 #1463.24 - addpd 1344+__svml_dasin_ha_data_internal(%rip), %xmm14 #1463.12 - movups 1472+__svml_dasin_ha_data_internal(%rip), %xmm15 #1466.46 + addpd 1344+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #1463.12 + movups 1472+__jsvml_dasin_ha_data_internal(%rip), %xmm15 #1466.46 movaps %xmm15, %xmm0 #1468.15 subpd %xmm2, %xmm0 #1468.15 mulpd %xmm4, %xmm14 #1464.24 subpd %xmm0, %xmm15 #1470.14 - addpd 1408+__svml_dasin_ha_data_internal(%rip), %xmm14 #1464.12 + addpd 1408+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #1464.12 subpd %xmm15, %xmm2 #1472.14 mulpd %xmm14, %xmm4 #1465.12 - movups 1536+__svml_dasin_ha_data_internal(%rip), %xmm9 #1471.14 + movups 1536+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1471.14 andps %xmm3, %xmm0 #1476.15 addpd %xmm1, %xmm9 #1471.14 subpd %xmm2, %xmm9 #1473.14 @@ -1091,29 +1091,29 @@ __svml_asin2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1484.546 lea 128(%rsp,%r12,8), %rsi #1484.546 -..___tag_value___svml_asin2_ha_ex.119: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1484.546 -..___tag_value___svml_asin2_ha_ex.120: +..___tag_value___jsvml_asin2_ha_ex.119: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1484.546 +..___tag_value___jsvml_asin2_ha_ex.120: jmp ..B6.8 # Prob 100% #1484.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asin2_ha_ex,@function - .size __svml_asin2_ha_ex,.-__svml_asin2_ha_ex -..LN__svml_asin2_ha_ex.5: + .type __jsvml_asin2_ha_ex,@function + .size __jsvml_asin2_ha_ex,.-__jsvml_asin2_ha_ex +..LN__jsvml_asin2_ha_ex.5: .data -# -- End __svml_asin2_ha_ex +# -- End __jsvml_asin2_ha_ex .text -.L_2__routine_start___svml_asin8_ha_z0_6: -# -- Begin __svml_asin8_ha_z0 +.L_2__routine_start___jsvml_asin8_ha_z0_6: +# -- Begin __jsvml_asin8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_asin8_ha_z0 -# --- __svml_asin8_ha_z0(__m512d) -__svml_asin8_ha_z0: + .globl __jsvml_asin8_ha_z0 +# --- __jsvml_asin8_ha_z0(__m512d) +__jsvml_asin8_ha_z0: # parameter 1: %zmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1122,17 +1122,17 @@ __svml_asin8_ha_z0: .byte 30 #1587.12 .byte 250 #1587.12 .cfi_startproc -..___tag_value___svml_asin8_ha_z0.122: +..___tag_value___jsvml_asin8_ha_z0.122: ..L123: #1492.1 - vmovups 64+__svml_dasin_ha_data_internal(%rip), %zmm7 #1531.46 - vmovups 128+__svml_dasin_ha_data_internal(%rip), %zmm9 #1543.575 - vmovups 384+__svml_dasin_ha_data_internal(%rip), %zmm15 #1543.1222 - vmovups 448+__svml_dasin_ha_data_internal(%rip), %zmm13 #1543.1599 - vmovups 512+__svml_dasin_ha_data_internal(%rip), %zmm1 #1543.1940 - vmovups 256+__svml_dasin_ha_data_internal(%rip), %zmm8 #1532.42 - vmovups 576+__svml_dasin_ha_data_internal(%rip), %zmm14 #1543.1785 - vandpd __svml_dasin_ha_data_internal(%rip), %zmm0, %zmm5 #1533.8 + vmovups 64+__jsvml_dasin_ha_data_internal(%rip), %zmm7 #1531.46 + vmovups 128+__jsvml_dasin_ha_data_internal(%rip), %zmm9 #1543.575 + vmovups 384+__jsvml_dasin_ha_data_internal(%rip), %zmm15 #1543.1222 + vmovups 448+__jsvml_dasin_ha_data_internal(%rip), %zmm13 #1543.1599 + vmovups 512+__jsvml_dasin_ha_data_internal(%rip), %zmm1 #1543.1940 + vmovups 256+__jsvml_dasin_ha_data_internal(%rip), %zmm8 #1532.42 + vmovups 576+__jsvml_dasin_ha_data_internal(%rip), %zmm14 #1543.1785 + vandpd __jsvml_dasin_ha_data_internal(%rip), %zmm0, %zmm5 #1533.8 vmovaps %zmm7, %zmm10 #1534.8 vfnmadd231pd {rn-sae}, %zmm5, %zmm7, %zmm10 #1534.8 vmulpd {rn-sae}, %zmm5, %zmm5, %zmm6 #1535.11 @@ -1140,51 +1140,51 @@ __svml_asin8_ha_z0: vcmppd $17, {sae}, %zmm9, %zmm10, %k2 #1543.636 vcmppd $17, {sae}, %zmm5, %zmm8, %k1 #1538.13 vcmppd $21, {sae}, %zmm7, %zmm5, %k3 #1539.14 - vmovups 704+__svml_dasin_ha_data_internal(%rip), %zmm7 #1544.57 - vmovups 832+__svml_dasin_ha_data_internal(%rip), %zmm8 #1546.57 - vmovups 960+__svml_dasin_ha_data_internal(%rip), %zmm9 #1551.56 + vmovups 704+__jsvml_dasin_ha_data_internal(%rip), %zmm7 #1544.57 + vmovups 832+__jsvml_dasin_ha_data_internal(%rip), %zmm8 #1546.57 + vmovups 960+__jsvml_dasin_ha_data_internal(%rip), %zmm9 #1551.56 vminpd {sae}, %zmm10, %zmm6, %zmm3 #1537.11 vxorpd %zmm12, %zmm12, %zmm12{%k2} #1543.722 vaddpd {rn-sae}, %zmm10, %zmm10, %zmm6 #1543.794 vxorpd %zmm0, %zmm5, %zmm4 #1536.12 - vorpd 1728+__svml_dasin_ha_data_internal(%rip), %zmm3, %zmm3{%k1} #1542.11 + vorpd 1728+__jsvml_dasin_ha_data_internal(%rip), %zmm3, %zmm3{%k1} #1542.11 vmulpd {rn-sae}, %zmm12, %zmm12, %zmm11 #1543.1118 vmulpd {rn-sae}, %zmm12, %zmm6, %zmm2 #1543.1335 - vmovups 640+__svml_dasin_ha_data_internal(%rip), %zmm0 #1543.1878 - vmovups 1088+__svml_dasin_ha_data_internal(%rip), %zmm10 #1554.56 + vmovups 640+__jsvml_dasin_ha_data_internal(%rip), %zmm0 #1543.1878 + vmovups 1088+__jsvml_dasin_ha_data_internal(%rip), %zmm10 #1554.56 vfmsub231pd {rn-sae}, %zmm6, %zmm11, %zmm15 #1543.1222 vfmsub213pd {rn-sae}, %zmm2, %zmm12, %zmm6 #1543.1436 - vmovups 896+__svml_dasin_ha_data_internal(%rip), %zmm12 #1549.15 + vmovups 896+__jsvml_dasin_ha_data_internal(%rip), %zmm12 #1549.15 vfmadd231pd {rn-sae}, %zmm15, %zmm13, %zmm1 #1543.1940 - vmovups 1152+__svml_dasin_ha_data_internal(%rip), %zmm13 #1556.14 + vmovups 1152+__jsvml_dasin_ha_data_internal(%rip), %zmm13 #1556.14 vfmadd231pd {rn-sae}, %zmm3, %zmm8, %zmm12 #1549.15 - vmovups 1280+__svml_dasin_ha_data_internal(%rip), %zmm8 #1562.14 + vmovups 1280+__jsvml_dasin_ha_data_internal(%rip), %zmm8 #1562.14 vmulpd {rn-sae}, %zmm15, %zmm2, %zmm11 #1543.2058 vfmadd213pd {rn-sae}, %zmm14, %zmm15, %zmm1 #1543.2166 vfmadd231pd {rn-sae}, %zmm3, %zmm10, %zmm13 #1556.14 - vmovups 1216+__svml_dasin_ha_data_internal(%rip), %zmm14 #1560.56 - vmovups 1408+__svml_dasin_ha_data_internal(%rip), %zmm10 #1566.56 + vmovups 1216+__jsvml_dasin_ha_data_internal(%rip), %zmm14 #1560.56 + vmovups 1408+__jsvml_dasin_ha_data_internal(%rip), %zmm10 #1566.56 vfmadd213pd {rn-sae}, %zmm0, %zmm15, %zmm1 #1543.2287 - vmovups 768+__svml_dasin_ha_data_internal(%rip), %zmm0 #1548.12 + vmovups 768+__jsvml_dasin_ha_data_internal(%rip), %zmm0 #1548.12 vfmadd231pd {rn-sae}, %zmm3, %zmm14, %zmm8 #1562.14 vfmsub213pd {rn-sae}, %zmm6, %zmm11, %zmm1 #1543.2403 vfmadd231pd {rn-sae}, %zmm3, %zmm7, %zmm0 #1548.12 - vmovups 1024+__svml_dasin_ha_data_internal(%rip), %zmm6 #1553.14 + vmovups 1024+__jsvml_dasin_ha_data_internal(%rip), %zmm6 #1553.14 vmulpd {rn-sae}, %zmm3, %zmm3, %zmm7 #1550.15 vfmadd231pd {rn-sae}, %zmm3, %zmm9, %zmm6 #1553.14 - vmovups 1344+__svml_dasin_ha_data_internal(%rip), %zmm9 #1565.56 + vmovups 1344+__jsvml_dasin_ha_data_internal(%rip), %zmm9 #1565.56 vsubpd {rn-sae}, %zmm2, %zmm1, %zmm5{%k3} #1574.14 vmulpd {rn-sae}, %zmm7, %zmm7, %zmm15 #1559.15 vfmadd213pd {rn-sae}, %zmm12, %zmm7, %zmm0 #1557.12 vfmadd213pd {rn-sae}, %zmm13, %zmm7, %zmm6 #1558.14 vfmadd213pd {rn-sae}, %zmm6, %zmm15, %zmm0 #1563.12 - vmovups 1600+__svml_dasin_ha_data_internal(%rip), %zmm6 #1572.46 + vmovups 1600+__jsvml_dasin_ha_data_internal(%rip), %zmm6 #1572.46 vfmadd213pd {rn-sae}, %zmm8, %zmm7, %zmm0 #1564.12 vfmadd213pd {rn-sae}, %zmm9, %zmm3, %zmm0 #1567.12 vfmadd213pd {rn-sae}, %zmm10, %zmm3, %zmm0 #1568.12 vmulpd {rn-sae}, %zmm3, %zmm0, %zmm8 #1569.14 - vmovups 1472+__svml_dasin_ha_data_internal(%rip), %zmm3 #1570.47 - vmovups 1536+__svml_dasin_ha_data_internal(%rip), %zmm0 #1571.47 + vmovups 1472+__jsvml_dasin_ha_data_internal(%rip), %zmm3 #1570.47 + vmovups 1536+__jsvml_dasin_ha_data_internal(%rip), %zmm0 #1571.47 vsubpd {rn-sae}, %zmm2, %zmm3, %zmm7 #1573.17 vaddpd {rn-sae}, %zmm1, %zmm0, %zmm1 #1576.17 vsubpd {rn-sae}, %zmm7, %zmm3, %zmm3 #1575.16 @@ -1199,20 +1199,20 @@ __svml_asin8_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_asin8_ha_z0,@function - .size __svml_asin8_ha_z0,.-__svml_asin8_ha_z0 -..LN__svml_asin8_ha_z0.6: + .type __jsvml_asin8_ha_z0,@function + .size __jsvml_asin8_ha_z0,.-__jsvml_asin8_ha_z0 +..LN__jsvml_asin8_ha_z0.6: .data -# -- End __svml_asin8_ha_z0 +# -- End __jsvml_asin8_ha_z0 .text -.L_2__routine_start___svml_asin1_ha_l9_7: -# -- Begin __svml_asin1_ha_l9 +.L_2__routine_start___jsvml_asin1_ha_l9_7: +# -- Begin __jsvml_asin1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_asin1_ha_l9 -# --- __svml_asin1_ha_l9(__m128d) -__svml_asin1_ha_l9: + .globl __jsvml_asin1_ha_l9 +# --- __jsvml_asin1_ha_l9(__m128d) +__jsvml_asin1_ha_l9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1221,7 +1221,7 @@ __svml_asin1_ha_l9: .byte 30 #1686.546 .byte 250 #1686.546 .cfi_startproc -..___tag_value___svml_asin1_ha_l9.125: +..___tag_value___jsvml_asin1_ha_l9.125: ..L126: #1592.1 pushq %rbp #1592.1 @@ -1232,19 +1232,19 @@ __svml_asin1_ha_l9: andq $-64, %rsp #1592.1 subq $128, %rsp #1592.1 vmovapd %xmm0, %xmm12 #1592.1 - vmovsd __svml_dasin_ha_data_internal(%rip), %xmm13 #1629.14 + vmovsd __jsvml_dasin_ha_data_internal(%rip), %xmm13 #1629.14 vandpd %xmm12, %xmm13, %xmm11 #1632.8 vandnpd %xmm12, %xmm13, %xmm10 #1633.12 - vmovsd 64+__svml_dasin_ha_data_internal(%rip), %xmm6 #1630.14 + vmovsd 64+__jsvml_dasin_ha_data_internal(%rip), %xmm6 #1630.14 vmovapd %xmm11, %xmm7 #1634.8 vfnmadd213sd %xmm6, %xmm6, %xmm7 #1634.8 - vmovsd 256+__svml_dasin_ha_data_internal(%rip), %xmm8 #1631.10 + vmovsd 256+__jsvml_dasin_ha_data_internal(%rip), %xmm8 #1631.10 vmulsd %xmm11, %xmm11, %xmm14 #1635.9 vcmpltsd %xmm11, %xmm8, %xmm0 #1637.13 vcmpnltsd %xmm6, %xmm11, %xmm8 #1640.14 vcvtpd2ps %xmm7, %xmm5 #1641.546 vmovmskpd %xmm0, %eax #1639.40 - vcmpltsd 128+__svml_dasin_ha_data_internal(%rip), %xmm7, %xmm3 #1641.717 + vcmpltsd 128+__jsvml_dasin_ha_data_internal(%rip), %xmm7, %xmm3 #1641.717 vaddsd %xmm7, %xmm7, %xmm0 #1641.810 vshufps $0, %xmm5, %xmm5, %xmm4 #1641.530 vandnpd %xmm11, %xmm8, %xmm11 #1679.12 @@ -1259,42 +1259,42 @@ __svml_asin1_ha_l9: vmulsd %xmm9, %xmm9, %xmm3 #1648.13 vmovapd %xmm0, %xmm1 #1641.1110 vmovapd %xmm9, %xmm4 #1646.12 - vfmsub213sd 384+__svml_dasin_ha_data_internal(%rip), %xmm7, %xmm1 #1641.1110 - vmovsd 448+__svml_dasin_ha_data_internal(%rip), %xmm5 #1641.1644 - vmovsd 832+__svml_dasin_ha_data_internal(%rip), %xmm2 #1644.25 - vmovsd 960+__svml_dasin_ha_data_internal(%rip), %xmm7 #1649.24 - vmovsd 1088+__svml_dasin_ha_data_internal(%rip), %xmm13 #1652.24 - vfmadd213sd 512+__svml_dasin_ha_data_internal(%rip), %xmm1, %xmm5 #1641.1644 + vfmsub213sd 384+__jsvml_dasin_ha_data_internal(%rip), %xmm7, %xmm1 #1641.1110 + vmovsd 448+__jsvml_dasin_ha_data_internal(%rip), %xmm5 #1641.1644 + vmovsd 832+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1644.25 + vmovsd 960+__jsvml_dasin_ha_data_internal(%rip), %xmm7 #1649.24 + vmovsd 1088+__jsvml_dasin_ha_data_internal(%rip), %xmm13 #1652.24 + vfmadd213sd 512+__jsvml_dasin_ha_data_internal(%rip), %xmm1, %xmm5 #1641.1644 vfmsub213sd %xmm6, %xmm14, %xmm0 #1641.1202 vmulsd %xmm1, %xmm6, %xmm15 #1641.1702 - vfmadd213sd 576+__svml_dasin_ha_data_internal(%rip), %xmm1, %xmm5 #1641.1748 - vmovsd 1216+__svml_dasin_ha_data_internal(%rip), %xmm14 #1658.24 - vfmadd213sd 640+__svml_dasin_ha_data_internal(%rip), %xmm1, %xmm5 #1641.1811 - vmovsd 704+__svml_dasin_ha_data_internal(%rip), %xmm1 #1642.25 - vfmadd213sd 768+__svml_dasin_ha_data_internal(%rip), %xmm1, %xmm4 #1646.12 + vfmadd213sd 576+__jsvml_dasin_ha_data_internal(%rip), %xmm1, %xmm5 #1641.1748 + vmovsd 1216+__jsvml_dasin_ha_data_internal(%rip), %xmm14 #1658.24 + vfmadd213sd 640+__jsvml_dasin_ha_data_internal(%rip), %xmm1, %xmm5 #1641.1811 + vmovsd 704+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1642.25 + vfmadd213sd 768+__jsvml_dasin_ha_data_internal(%rip), %xmm1, %xmm4 #1646.12 vmovapd %xmm9, %xmm1 #1647.15 - vfmadd213sd 896+__svml_dasin_ha_data_internal(%rip), %xmm2, %xmm1 #1647.15 + vfmadd213sd 896+__jsvml_dasin_ha_data_internal(%rip), %xmm2, %xmm1 #1647.15 vmovapd %xmm9, %xmm2 #1651.14 - vfmadd213sd 1024+__svml_dasin_ha_data_internal(%rip), %xmm7, %xmm2 #1651.14 + vfmadd213sd 1024+__jsvml_dasin_ha_data_internal(%rip), %xmm7, %xmm2 #1651.14 vmovapd %xmm9, %xmm7 #1660.14 vfmsub213sd %xmm0, %xmm15, %xmm5 #1641.1869 vmovapd %xmm9, %xmm0 #1654.14 - vfmadd213sd 1152+__svml_dasin_ha_data_internal(%rip), %xmm13, %xmm0 #1654.14 + vfmadd213sd 1152+__jsvml_dasin_ha_data_internal(%rip), %xmm13, %xmm0 #1654.14 vmulsd %xmm3, %xmm3, %xmm15 #1657.13 vfmadd213sd %xmm1, %xmm3, %xmm4 #1655.12 - vfmadd213sd 1280+__svml_dasin_ha_data_internal(%rip), %xmm14, %xmm7 #1660.14 + vfmadd213sd 1280+__jsvml_dasin_ha_data_internal(%rip), %xmm14, %xmm7 #1660.14 vfmadd213sd %xmm0, %xmm3, %xmm2 #1656.14 vfmadd213sd %xmm2, %xmm15, %xmm4 #1661.12 - vmovsd 1536+__svml_dasin_ha_data_internal(%rip), %xmm2 #1669.15 + vmovsd 1536+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1669.15 vfmadd213sd %xmm7, %xmm3, %xmm4 #1662.12 vsubsd %xmm6, %xmm5, %xmm3 #1671.12 vaddsd %xmm5, %xmm2, %xmm5 #1673.14 - vfmadd213sd 1344+__svml_dasin_ha_data_internal(%rip), %xmm9, %xmm4 #1665.12 + vfmadd213sd 1344+__jsvml_dasin_ha_data_internal(%rip), %xmm9, %xmm4 #1665.12 vandpd %xmm8, %xmm3, %xmm7 #1676.12 vorpd %xmm11, %xmm7, %xmm7 #1680.12 - vfmadd213sd 1408+__svml_dasin_ha_data_internal(%rip), %xmm9, %xmm4 #1666.12 + vfmadd213sd 1408+__jsvml_dasin_ha_data_internal(%rip), %xmm9, %xmm4 #1666.12 vmulsd %xmm9, %xmm4, %xmm1 #1667.12 - vmovsd 1472+__svml_dasin_ha_data_internal(%rip), %xmm9 #1668.15 + vmovsd 1472+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1668.15 vsubsd %xmm6, %xmm9, %xmm0 #1670.15 vsubsd %xmm0, %xmm9, %xmm9 #1672.14 vandpd %xmm8, %xmm0, %xmm0 #1678.15 @@ -1343,29 +1343,29 @@ __svml_asin1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1686.546 lea 64(%rsp), %rsi #1686.546 -..___tag_value___svml_asin1_ha_l9.138: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1686.546 -..___tag_value___svml_asin1_ha_l9.139: +..___tag_value___jsvml_asin1_ha_l9.138: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1686.546 +..___tag_value___jsvml_asin1_ha_l9.139: jmp ..B8.4 # Prob 100% #1686.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_asin1_ha_l9,@function - .size __svml_asin1_ha_l9,.-__svml_asin1_ha_l9 -..LN__svml_asin1_ha_l9.7: + .type __jsvml_asin1_ha_l9,@function + .size __jsvml_asin1_ha_l9,.-__jsvml_asin1_ha_l9 +..LN__jsvml_asin1_ha_l9.7: .data -# -- End __svml_asin1_ha_l9 +# -- End __jsvml_asin1_ha_l9 .text -.L_2__routine_start___svml_asin1_ha_e9_8: -# -- Begin __svml_asin1_ha_e9 +.L_2__routine_start___jsvml_asin1_ha_e9_8: +# -- Begin __jsvml_asin1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_asin1_ha_e9 -# --- __svml_asin1_ha_e9(__m128d) -__svml_asin1_ha_e9: + .globl __jsvml_asin1_ha_e9 +# --- __jsvml_asin1_ha_e9(__m128d) +__jsvml_asin1_ha_e9: # parameter 1: %xmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1374,7 +1374,7 @@ __svml_asin1_ha_e9: .byte 30 #1788.546 .byte 250 #1788.546 .cfi_startproc -..___tag_value___svml_asin1_ha_e9.141: +..___tag_value___jsvml_asin1_ha_e9.141: ..L142: #1694.1 pushq %rbp #1694.1 @@ -1385,15 +1385,15 @@ __svml_asin1_ha_e9: andq $-64, %rsp #1694.1 subq $128, %rsp #1694.1 movaps %xmm0, %xmm8 #1694.1 - movsd __svml_dasin_ha_data_internal(%rip), %xmm6 #1731.14 + movsd __jsvml_dasin_ha_data_internal(%rip), %xmm6 #1731.14 movaps %xmm6, %xmm7 #1734.8 andnps %xmm8, %xmm6 #1735.12 andps %xmm8, %xmm7 #1734.8 - movsd 64+__svml_dasin_ha_data_internal(%rip), %xmm12 #1732.14 + movsd 64+__jsvml_dasin_ha_data_internal(%rip), %xmm12 #1732.14 movaps %xmm7, %xmm9 #1736.32 mulsd %xmm12, %xmm9 #1736.32 movaps %xmm12, %xmm0 #1736.8 - movsd 320+__svml_dasin_ha_data_internal(%rip), %xmm3 #1743.1113 + movsd 320+__jsvml_dasin_ha_data_internal(%rip), %xmm3 #1743.1113 movaps %xmm7, %xmm5 #1737.9 mulsd %xmm7, %xmm5 #1737.9 subsd %xmm9, %xmm0 #1736.8 @@ -1405,7 +1405,7 @@ __svml_asin1_ha_e9: movaps %xmm0, %xmm2 #1743.717 movaps %xmm7, %xmm4 #1742.14 unpcklpd %xmm0, %xmm10 #1738.72 - cmpltsd 128+__svml_dasin_ha_data_internal(%rip), %xmm2 #1743.717 + cmpltsd 128+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1743.717 addsd %xmm0, %xmm0 #1743.810 cmpnltsd %xmm12, %xmm4 #1742.14 andnps %xmm15, %xmm2 #1743.760 @@ -1421,59 +1421,59 @@ __svml_asin1_ha_e9: movaps %xmm3, %xmm10 #1743.1444 addsd %xmm0, %xmm10 #1743.1444 mulsd %xmm2, %xmm1 #1743.1315 - subsd 384+__svml_dasin_ha_data_internal(%rip), %xmm9 #1743.1356 - movsd 448+__svml_dasin_ha_data_internal(%rip), %xmm2 #1743.1869 + subsd 384+__jsvml_dasin_ha_data_internal(%rip), %xmm9 #1743.1356 + movsd 448+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1743.1869 movaps %xmm5, %xmm14 #1750.13 - movsd 256+__svml_dasin_ha_data_internal(%rip), %xmm11 #1739.13 + movsd 256+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1739.13 movaps %xmm5, %xmm13 #1753.26 mulsd %xmm5, %xmm14 #1750.13 addsd %xmm1, %xmm9 #1743.1401 cmpltsd %xmm7, %xmm11 #1739.13 - mulsd 960+__svml_dasin_ha_data_internal(%rip), %xmm13 #1753.26 + mulsd 960+__jsvml_dasin_ha_data_internal(%rip), %xmm13 #1753.26 mulsd %xmm9, %xmm2 #1743.1869 mulsd %xmm9, %xmm10 #1743.1927 - addsd 1024+__svml_dasin_ha_data_internal(%rip), %xmm13 #1753.14 + addsd 1024+__jsvml_dasin_ha_data_internal(%rip), %xmm13 #1753.14 movmskpd %xmm11, %eax #1741.40 - addsd 512+__svml_dasin_ha_data_internal(%rip), %xmm2 #1743.1857 + addsd 512+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1743.1857 mulsd %xmm14, %xmm13 #1758.26 mulsd %xmm9, %xmm2 #1743.1985 movaps %xmm5, %xmm1 #1748.24 movaps %xmm5, %xmm11 #1756.26 - mulsd 704+__svml_dasin_ha_data_internal(%rip), %xmm1 #1748.24 + mulsd 704+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1748.24 movaps %xmm14, %xmm12 #1759.13 - addsd 576+__svml_dasin_ha_data_internal(%rip), %xmm2 #1743.1973 - mulsd 1088+__svml_dasin_ha_data_internal(%rip), %xmm11 #1756.26 + addsd 576+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1743.1973 + mulsd 1088+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1756.26 mulsd %xmm14, %xmm12 #1759.13 - addsd 768+__svml_dasin_ha_data_internal(%rip), %xmm1 #1748.12 + addsd 768+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1748.12 mulsd %xmm9, %xmm2 #1743.2060 - addsd 1152+__svml_dasin_ha_data_internal(%rip), %xmm11 #1756.14 + addsd 1152+__jsvml_dasin_ha_data_internal(%rip), %xmm11 #1756.14 mulsd %xmm14, %xmm1 #1757.24 - addsd 640+__svml_dasin_ha_data_internal(%rip), %xmm2 #1743.2048 + addsd 640+__jsvml_dasin_ha_data_internal(%rip), %xmm2 #1743.2048 addsd %xmm11, %xmm13 #1758.14 mulsd %xmm10, %xmm2 #1743.2130 - movsd 1536+__svml_dasin_ha_data_internal(%rip), %xmm10 #1775.14 + movsd 1536+__jsvml_dasin_ha_data_internal(%rip), %xmm10 #1775.14 subsd %xmm0, %xmm2 #1743.2118 movaps %xmm5, %xmm0 #1749.27 movaps %xmm2, %xmm9 #1773.12 - mulsd 832+__svml_dasin_ha_data_internal(%rip), %xmm0 #1749.27 + mulsd 832+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1749.27 subsd %xmm3, %xmm9 #1773.12 addsd %xmm2, %xmm10 #1775.14 - addsd 896+__svml_dasin_ha_data_internal(%rip), %xmm0 #1749.15 + addsd 896+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1749.15 andps %xmm4, %xmm9 #1778.12 addsd %xmm0, %xmm1 #1757.12 mulsd %xmm12, %xmm1 #1763.24 movaps %xmm5, %xmm0 #1762.26 - mulsd 1216+__svml_dasin_ha_data_internal(%rip), %xmm0 #1762.26 + mulsd 1216+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1762.26 addsd %xmm13, %xmm1 #1763.12 - addsd 1280+__svml_dasin_ha_data_internal(%rip), %xmm0 #1762.14 + addsd 1280+__jsvml_dasin_ha_data_internal(%rip), %xmm0 #1762.14 mulsd %xmm14, %xmm1 #1764.24 addsd %xmm0, %xmm1 #1764.12 mulsd %xmm5, %xmm1 #1767.24 - addsd 1344+__svml_dasin_ha_data_internal(%rip), %xmm1 #1767.12 + addsd 1344+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1767.12 mulsd %xmm5, %xmm1 #1768.24 - addsd 1408+__svml_dasin_ha_data_internal(%rip), %xmm1 #1768.12 + addsd 1408+__jsvml_dasin_ha_data_internal(%rip), %xmm1 #1768.12 mulsd %xmm5, %xmm1 #1769.12 - movsd 1472+__svml_dasin_ha_data_internal(%rip), %xmm5 #1770.15 + movsd 1472+__jsvml_dasin_ha_data_internal(%rip), %xmm5 #1770.15 movaps %xmm5, %xmm0 #1772.15 subsd %xmm3, %xmm0 #1772.15 subsd %xmm0, %xmm5 #1774.14 @@ -1522,30 +1522,30 @@ __svml_asin1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1788.546 lea 64(%rsp), %rsi #1788.546 -..___tag_value___svml_asin1_ha_e9.154: -# __svml_dasin_ha_cout_rare_internal(const double *, double *) - call __svml_dasin_ha_cout_rare_internal #1788.546 -..___tag_value___svml_asin1_ha_e9.155: +..___tag_value___jsvml_asin1_ha_e9.154: +# __jsvml_dasin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dasin_ha_cout_rare_internal #1788.546 +..___tag_value___jsvml_asin1_ha_e9.155: jmp ..B9.4 # Prob 100% #1788.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_asin1_ha_e9,@function - .size __svml_asin1_ha_e9,.-__svml_asin1_ha_e9 -..LN__svml_asin1_ha_e9.8: + .type __jsvml_asin1_ha_e9,@function + .size __jsvml_asin1_ha_e9,.-__jsvml_asin1_ha_e9 +..LN__jsvml_asin1_ha_e9.8: .data -# -- End __svml_asin1_ha_e9 +# -- End __jsvml_asin1_ha_e9 .text -.L_2__routine_start___svml_dasin_ha_cout_rare_internal_9: -# -- Begin __svml_dasin_ha_cout_rare_internal +.L_2__routine_start___jsvml_dasin_ha_cout_rare_internal_9: +# -- Begin __jsvml_dasin_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dasin_ha_cout_rare_internal - .globl __svml_dasin_ha_cout_rare_internal -# --- __svml_dasin_ha_cout_rare_internal(const double *, double *) -__svml_dasin_ha_cout_rare_internal: + .hidden __jsvml_dasin_ha_cout_rare_internal + .globl __jsvml_dasin_ha_cout_rare_internal +# --- __jsvml_dasin_ha_cout_rare_internal(const double *, double *) +__jsvml_dasin_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1555,7 +1555,7 @@ __svml_dasin_ha_cout_rare_internal: .byte 30 #858.17 .byte 250 #858.17 .cfi_startproc -..___tag_value___svml_dasin_ha_cout_rare_internal.157: +..___tag_value___jsvml_dasin_ha_cout_rare_internal.157: ..L158: #701.1 xorl %eax, %eax #714.14 @@ -2070,17 +2070,17 @@ __svml_dasin_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dasin_ha_cout_rare_internal,@function - .size __svml_dasin_ha_cout_rare_internal,.-__svml_dasin_ha_cout_rare_internal -..LN__svml_dasin_ha_cout_rare_internal.9: + .type __jsvml_dasin_ha_cout_rare_internal,@function + .size __jsvml_dasin_ha_cout_rare_internal,.-__jsvml_dasin_ha_cout_rare_internal +..LN__jsvml_dasin_ha_cout_rare_internal.9: .data -# -- End __svml_dasin_ha_cout_rare_internal +# -- End __jsvml_dasin_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dasin_ha_data_internal - .globl __svml_dasin_ha_data_internal -__svml_dasin_ha_data_internal: + .hidden __jsvml_dasin_ha_data_internal + .globl __jsvml_dasin_ha_data_internal +__jsvml_dasin_ha_data_internal: .long 4294967295 .long 2147483647 .long 4294967295 @@ -2781,8 +2781,8 @@ __svml_dasin_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_dasin_ha_data_internal,@object - .size __svml_dasin_ha_data_internal,2368 + .type __jsvml_dasin_ha_data_internal,@object + .size __jsvml_dasin_ha_data_internal,2368 .align 32 _vmldASinHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_atan2_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_atan2_linux_x86.S similarity index 89% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_atan2_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_atan2_linux_x86.S index a2d53e432d0..eef410327b7 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_atan2_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_atan2_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_atan2.c" .text ..TXTST0: -.L_2__routine_start___svml_atan22_ha_ex_0: -# -- Begin __svml_atan22_ha_ex +.L_2__routine_start___jsvml_atan22_ha_ex_0: +# -- Begin __jsvml_atan22_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_atan22_ha_ex -# --- __svml_atan22_ha_ex(__m128d, __m128d) -__svml_atan22_ha_ex: + .globl __jsvml_atan22_ha_ex +# --- __jsvml_atan22_ha_ex(__m128d, __m128d) +__jsvml_atan22_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B1.1: # Preds ..B1.0 @@ -48,7 +48,7 @@ __svml_atan22_ha_ex: .byte 30 #551.14 .byte 250 #551.14 .cfi_startproc -..___tag_value___svml_atan22_ha_ex.1: +..___tag_value___jsvml_atan22_ha_ex.1: ..L2: #228.1 pushq %rbp #228.1 @@ -59,13 +59,13 @@ __svml_atan22_ha_ex: andq $-64, %rsp #228.1 subq $256, %rsp #228.1 movaps %xmm1, %xmm12 #357.24 - movups 896+__svml_datan2_ha_data_internal(%rip), %xmm9 #344.51 - lea __svml_datan2_ha_data_internal(%rip), %rsi #409.408 + movups 896+__jsvml_datan2_ha_data_internal(%rip), %xmm9 #344.51 + lea __jsvml_datan2_ha_data_internal(%rip), %rsi #409.408 movaps %xmm9, %xmm15 #345.14 andps %xmm0, %xmm9 #346.14 andps %xmm1, %xmm15 #345.14 movaps %xmm9, %xmm14 #348.17 - movups 1088+__svml_datan2_ha_data_internal(%rip), %xmm6 #349.59 + movups 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #349.59 movaps %xmm15, %xmm13 #347.17 movups %xmm1, (%rsp) #228.1[spill] pxor %xmm1, %xmm13 #347.17 @@ -75,15 +75,15 @@ __svml_atan22_ha_ex: andps %xmm9, %xmm5 #350.19 movups %xmm9, 48(%rsp) #346.14[spill] movaps %xmm9, %xmm4 #351.19 - movq 2688+__svml_datan2_ha_data_internal(%rip), %xmm8 #366.15 + movq 2688+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #366.15 movdqa %xmm7, %xmm10 #366.15 movdqa %xmm1, %xmm9 #371.15 psubd %xmm8, %xmm10 #366.15 - movq 3200+__svml_datan2_ha_data_internal(%rip), %xmm2 #374.15 + movq 3200+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #374.15 movdqa %xmm1, %xmm11 #367.15 psubd %xmm7, %xmm9 #371.15 psubd %xmm8, %xmm11 #367.15 - movq 2752+__svml_datan2_ha_data_internal(%rip), %xmm8 #368.30 + movq 2752+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #368.30 paddd %xmm2, %xmm9 #374.15 movdqa %xmm10, %xmm2 #368.30 pcmpeqd %xmm8, %xmm10 #368.76 @@ -95,7 +95,7 @@ __svml_atan22_ha_ex: pcmpeqd %xmm8, %xmm11 #369.76 por %xmm11, %xmm10 #369.16 movaps %xmm15, %xmm3 #353.19 - movq 3264+__svml_datan2_ha_data_internal(%rip), %xmm11 #375.30 + movq 3264+__jsvml_datan2_ha_data_internal(%rip), %xmm11 #375.30 por %xmm10, %xmm2 #370.17 movdqa %xmm11, %xmm10 #375.30 pcmpeqd %xmm9, %xmm11 #375.68 @@ -105,17 +105,17 @@ __svml_atan22_ha_ex: xorl %edx, %edx #377.5 por %xmm10, %xmm2 #376.17 movdqu %xmm2, 64(%rsp) #376.17[spill] - movups 1152+__svml_datan2_ha_data_internal(%rip), %xmm2 #384.15 - movups 1216+__svml_datan2_ha_data_internal(%rip), %xmm8 #386.15 - movups 1280+__svml_datan2_ha_data_internal(%rip), %xmm7 #387.15 - movups 1344+__svml_datan2_ha_data_internal(%rip), %xmm10 #385.15 + movups 1152+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #384.15 + movups 1216+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #386.15 + movups 1280+__jsvml_datan2_ha_data_internal(%rip), %xmm7 #387.15 + movups 1344+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #385.15 mulpd %xmm15, %xmm2 #384.15 mulpd %xmm15, %xmm10 #385.15 mulpd %xmm15, %xmm8 #386.15 mulpd %xmm15, %xmm7 #387.15 subpd %xmm6, %xmm3 #353.19 subpd %xmm5, %xmm4 #351.19 - cmpltpd 2880+__svml_datan2_ha_data_internal(%rip), %xmm12 #357.24 + cmpltpd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #357.24 movups %xmm15, 32(%rsp) #345.14[spill] pshufd $221, %xmm2, %xmm11 #392.19 pshufd $221, %xmm10, %xmm15 #393.19 @@ -132,7 +132,7 @@ __svml_atan22_ha_ex: paddd %xmm15, %xmm11 #409.181 paddd %xmm10, %xmm8 #409.181 movaps %xmm6, %xmm15 #415.42 - movq 1408+__svml_datan2_ha_data_internal(%rip), %xmm9 #407.17 + movq 1408+__jsvml_datan2_ha_data_internal(%rip), %xmm9 #407.17 paddd %xmm8, %xmm11 #409.181 paddd %xmm9, %xmm11 #409.181 movaps %xmm5, %xmm10 #413.20 @@ -168,9 +168,9 @@ __svml_atan22_ha_ex: subpd %xmm3, %xmm6 #428.23 subpd %xmm15, %xmm8 #419.20 addpd %xmm6, %xmm7 #429.20 - movups 1088+__svml_datan2_ha_data_internal(%rip), %xmm10 #420.19 + movups 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #420.19 andps %xmm1, %xmm10 #420.19 - movups 1088+__svml_datan2_ha_data_internal(%rip), %xmm5 #430.19 + movups 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #430.19 subpd %xmm10, %xmm1 #421.22 andps %xmm3, %xmm5 #430.19 subpd %xmm5, %xmm3 #431.22 @@ -178,26 +178,26 @@ __svml_atan22_ha_ex: addpd %xmm3, %xmm7 #432.19 pshufd $221, %xmm5, %xmm4 #433.1408 movdqa %xmm4, %xmm1 #433.1572 - movq 1600+__svml_datan2_ha_data_internal(%rip), %xmm2 #433.994 + movq 1600+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #433.994 pslld $3, %xmm1 #433.1572 - movq 1664+__svml_datan2_ha_data_internal(%rip), %xmm3 #433.1093 + movq 1664+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #433.1093 pand %xmm2, %xmm1 #433.1610 por %xmm3, %xmm1 #433.1665 rcpps %xmm1, %xmm2 #433.1747 - movq 1472+__svml_datan2_ha_data_internal(%rip), %xmm6 #433.795 + movq 1472+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #433.795 psrld $3, %xmm2 #433.1817 - movq 1728+__svml_datan2_ha_data_internal(%rip), %xmm15 #433.1183 + movq 1728+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #433.1183 pand %xmm6, %xmm4 #433.1474 - movq 1536+__svml_datan2_ha_data_internal(%rip), %xmm6 #433.1524 + movq 1536+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #433.1524 psubd %xmm15, %xmm2 #433.1856 psubd %xmm4, %xmm6 #433.1524 paddd %xmm6, %xmm2 #433.1952 pshufd $80, %xmm2, %xmm4 #433.1952 movaps %xmm10, %xmm2 #442.18 - andps 3008+__svml_datan2_ha_data_internal(%rip), %xmm4 #433.2051 + andps 3008+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #433.2051 mulpd %xmm4, %xmm5 #434.31 mulpd %xmm4, %xmm7 #435.29 - subpd 1792+__svml_datan2_ha_data_internal(%rip), %xmm5 #434.19 + subpd 1792+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #434.19 mulpd %xmm4, %xmm10 #445.29 addpd %xmm7, %xmm5 #435.17 movaps %xmm5, %xmm7 #436.31 @@ -223,38 +223,38 @@ __svml_atan22_ha_ex: mulpd %xmm4, %xmm3 #458.14 movaps %xmm3, %xmm15 #459.14 mulpd %xmm3, %xmm15 #459.14 - movups 1856+__svml_datan2_ha_data_internal(%rip), %xmm5 #460.26 + movups 1856+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #460.26 mulpd %xmm15, %xmm5 #460.26 - movups 1920+__svml_datan2_ha_data_internal(%rip), %xmm8 #461.26 - addpd 1984+__svml_datan2_ha_data_internal(%rip), %xmm5 #460.14 + movups 1920+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #461.26 + addpd 1984+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #460.14 mulpd %xmm15, %xmm8 #461.26 mulpd %xmm15, %xmm5 #462.26 - addpd 2048+__svml_datan2_ha_data_internal(%rip), %xmm8 #461.14 - addpd 2112+__svml_datan2_ha_data_internal(%rip), %xmm5 #462.14 + addpd 2048+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #461.14 + addpd 2112+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #462.14 mulpd %xmm15, %xmm8 #463.26 mulpd %xmm15, %xmm5 #464.26 - addpd 2176+__svml_datan2_ha_data_internal(%rip), %xmm8 #463.14 - addpd 2240+__svml_datan2_ha_data_internal(%rip), %xmm5 #464.14 + addpd 2176+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #463.14 + addpd 2240+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #464.14 mulpd %xmm15, %xmm8 #465.26 mulpd %xmm15, %xmm5 #466.26 - addpd 2304+__svml_datan2_ha_data_internal(%rip), %xmm8 #465.14 - addpd 2368+__svml_datan2_ha_data_internal(%rip), %xmm5 #466.14 + addpd 2304+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #465.14 + addpd 2368+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #466.14 mulpd %xmm15, %xmm8 #467.26 mulpd %xmm15, %xmm5 #468.26 - addpd 2432+__svml_datan2_ha_data_internal(%rip), %xmm8 #467.14 - addpd 2496+__svml_datan2_ha_data_internal(%rip), %xmm5 #468.14 + addpd 2432+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #467.14 + addpd 2496+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #468.14 mulpd %xmm8, %xmm15 #469.26 mulpd %xmm3, %xmm5 #470.26 - addpd 2560+__svml_datan2_ha_data_internal(%rip), %xmm15 #469.14 + addpd 2560+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #469.14 addpd %xmm5, %xmm15 #470.14 mulpd %xmm15, %xmm3 #471.14 movq 16(%rax,%rsi), %xmm9 #411.652 movhpd 16(%rcx,%rsi), %xmm9 #411.620 addpd %xmm2, %xmm9 #473.19 mulpd %xmm3, %xmm4 #475.26 - movups 960+__svml_datan2_ha_data_internal(%rip), %xmm0 #358.20 + movups 960+__jsvml_datan2_ha_data_internal(%rip), %xmm0 #358.20 andps %xmm12, %xmm0 #358.20 - andps 1024+__svml_datan2_ha_data_internal(%rip), %xmm12 #359.20 + andps 1024+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #359.20 pxor %xmm13, %xmm12 #472.16 addpd %xmm9, %xmm12 #474.19 addpd %xmm4, %xmm12 #475.14 @@ -333,10 +333,10 @@ __svml_atan22_ha_ex: lea 64(%rsp,%r12,8), %rdi #554.663 lea 128(%rsp,%r12,8), %rsi #554.663 lea 192(%rsp,%r12,8), %rdx #554.663 -..___tag_value___svml_atan22_ha_ex.29: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #554.663 -..___tag_value___svml_atan22_ha_ex.30: +..___tag_value___jsvml_atan22_ha_ex.29: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #554.663 +..___tag_value___jsvml_atan22_ha_ex.30: jmp ..B1.9 # Prob 100% #554.663 .cfi_restore 12 .cfi_restore 13 @@ -347,9 +347,9 @@ __svml_atan22_ha_ex: movaps %xmm9, %xmm13 #522.19 cmpnltpd %xmm12, %xmm10 #519.21 cmpordpd %xmm9, %xmm13 #522.19 - movups 3136+__svml_datan2_ha_data_internal(%rip), %xmm4 #520.24 + movups 3136+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #520.24 movaps %xmm10, %xmm3 #521.32 - movups 2880+__svml_datan2_ha_data_internal(%rip), %xmm1 #527.18 + movups 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #527.18 movaps %xmm8, %xmm11 #523.19 cmpordpd %xmm8, %xmm11 #523.19 andps %xmm10, %xmm4 #520.24 @@ -369,7 +369,7 @@ __svml_atan22_ha_ex: andps %xmm1, %xmm3 #537.65 movdqa %xmm2, %xmm14 #533.19 orps %xmm3, %xmm10 #537.16 - movups 832+__svml_datan2_ha_data_internal(%rip), %xmm5 #516.56 + movups 832+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #516.56 pandn %xmm7, %xmm14 #533.19 pshufd $221, %xmm9, %xmm7 #542.16 movaps %xmm5, %xmm6 #517.18 @@ -379,7 +379,7 @@ __svml_atan22_ha_ex: orps %xmm6, %xmm10 #538.13 pshufd $80, %xmm15, %xmm1 #544.26 andps %xmm8, %xmm5 #518.18 - andps 3072+__svml_datan2_ha_data_internal(%rip), %xmm1 #546.18 + andps 3072+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #546.18 addpd %xmm1, %xmm10 #547.17 movmskps %xmm14, %edx #534.44 pshufd $80, %xmm2, %xmm2 #549.32 @@ -395,20 +395,20 @@ __svml_atan22_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm8 xmm9 .cfi_endproc # mark_end; - .type __svml_atan22_ha_ex,@function - .size __svml_atan22_ha_ex,.-__svml_atan22_ha_ex -..LN__svml_atan22_ha_ex.0: + .type __jsvml_atan22_ha_ex,@function + .size __jsvml_atan22_ha_ex,.-__jsvml_atan22_ha_ex +..LN__jsvml_atan22_ha_ex.0: .data -# -- End __svml_atan22_ha_ex +# -- End __jsvml_atan22_ha_ex .text -.L_2__routine_start___svml_atan21_ha_ex_1: -# -- Begin __svml_atan21_ha_ex +.L_2__routine_start___jsvml_atan21_ha_ex_1: +# -- Begin __jsvml_atan21_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_atan21_ha_ex -# --- __svml_atan21_ha_ex(__m128d, __m128d) -__svml_atan21_ha_ex: + .globl __jsvml_atan21_ha_ex +# --- __jsvml_atan21_ha_ex(__m128d, __m128d) +__jsvml_atan21_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B2.1: # Preds ..B2.0 @@ -418,7 +418,7 @@ __svml_atan21_ha_ex: .byte 30 #886.14 .byte 250 #886.14 .cfi_startproc -..___tag_value___svml_atan21_ha_ex.34: +..___tag_value___jsvml_atan21_ha_ex.34: ..L35: #563.1 pushq %rbp #563.1 @@ -429,7 +429,7 @@ __svml_atan21_ha_ex: andq $-64, %rsp #563.1 subq $192, %rsp #563.1 movaps %xmm1, %xmm8 #563.1 - movsd 896+__svml_datan2_ha_data_internal(%rip), %xmm6 #679.20 + movsd 896+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #679.20 movl $-2144337920, %eax #699.24 movaps %xmm6, %xmm12 #680.14 andps %xmm0, %xmm6 #681.14 @@ -439,11 +439,11 @@ __svml_atan21_ha_ex: movaps %xmm6, %xmm11 #683.17 movups %xmm8, (%rsp) #563.1[spill] pxor %xmm8, %xmm9 #682.17 - movsd 1088+__svml_datan2_ha_data_internal(%rip), %xmm4 #684.28 + movsd 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #684.28 movl $-36700160, %edx #700.24 - movsd 1024+__svml_datan2_ha_data_internal(%rip), %xmm13 #691.16 + movsd 1024+__jsvml_datan2_ha_data_internal(%rip), %xmm13 #691.16 pxor %xmm0, %xmm11 #683.17 - movsd 960+__svml_datan2_ha_data_internal(%rip), %xmm10 #693.20 + movsd 960+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #693.20 movaps %xmm4, %xmm3 #685.19 movups %xmm0, 16(%rsp) #563.1[spill] andps %xmm6, %xmm3 #685.19 @@ -456,7 +456,7 @@ __svml_atan21_ha_ex: movdqa %xmm0, %xmm7 #702.15 movl $4, %esi #744.181 psubd %xmm14, %xmm7 #702.15 - lea __svml_datan2_ha_data_internal(%rip), %rdx #744.415 + lea __jsvml_datan2_ha_data_internal(%rip), %rdx #744.415 andps %xmm12, %xmm4 #687.19 movaps %xmm12, %xmm1 #688.19 movl $8388607, %r8d #768.1605 @@ -464,7 +464,7 @@ __svml_atan21_ha_ex: movl $-1048576, %r11d #768.1469 movl $133169152, %r10d #768.1851 xorl %eax, %eax #712.5 - cmpltsd 2880+__svml_datan2_ha_data_internal(%rip), %xmm8 #692.24 + cmpltsd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #692.24 subsd %xmm4, %xmm1 #688.19 subsd %xmm3, %xmm2 #686.19 andps %xmm8, %xmm10 #693.20 @@ -495,10 +495,10 @@ __svml_atan21_ha_ex: movaps %xmm12, %xmm6 #719.15 movaps %xmm12, %xmm15 #720.15 movaps %xmm12, %xmm7 #721.15 - mulsd 1152+__svml_datan2_ha_data_internal(%rip), %xmm6 #719.15 - mulsd 1216+__svml_datan2_ha_data_internal(%rip), %xmm7 #721.15 - mulsd 1280+__svml_datan2_ha_data_internal(%rip), %xmm14 #722.15 - mulsd 1344+__svml_datan2_ha_data_internal(%rip), %xmm15 #720.15 + mulsd 1152+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #719.15 + mulsd 1216+__jsvml_datan2_ha_data_internal(%rip), %xmm7 #721.15 + mulsd 1280+__jsvml_datan2_ha_data_internal(%rip), %xmm14 #722.15 + mulsd 1344+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #720.15 movmskps %xmm13, %ecx #713.58 pshufd $85, %xmm6, %xmm5 #727.19 pshufd $85, %xmm15, %xmm6 #728.19 @@ -538,7 +538,7 @@ __svml_atan21_ha_ex: addsd %xmm14, %xmm7 #761.20 andps %xmm2, %xmm15 #749.20 movaps %xmm1, %xmm3 #762.20 - movsd 1088+__svml_datan2_ha_data_internal(%rip), %xmm2 #765.19 + movsd 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #765.19 subsd %xmm6, %xmm15 #751.20 addsd %xmm7, %xmm3 #762.20 movaps %xmm0, %xmm6 #752.20 @@ -561,7 +561,7 @@ __svml_atan21_ha_ex: por %xmm1, %xmm4 #768.1660 movd %r11d, %xmm0 #768.1469 rcpps %xmm4, %xmm4 #768.1742 - movsd 1088+__svml_datan2_ha_data_internal(%rip), %xmm5 #755.19 + movsd 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #755.19 psrld $3, %xmm4 #768.1812 andps %xmm6, %xmm5 #755.19 movd %r10d, %xmm3 #768.1851 @@ -573,13 +573,13 @@ __svml_atan21_ha_ex: subsd %xmm5, %xmm6 #756.22 pshufd $0, %xmm4, %xmm0 #768.1947 addsd %xmm15, %xmm6 #757.19 - movsd 3008+__svml_datan2_ha_data_internal(%rip), %xmm15 #768.1276 + movsd 3008+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #768.1276 andps %xmm15, %xmm0 #768.2046 mulsd %xmm0, %xmm2 #769.31 movaps %xmm0, %xmm1 #779.31 mulsd %xmm0, %xmm7 #770.29 mulsd %xmm6, %xmm1 #779.31 - subsd 1792+__svml_datan2_ha_data_internal(%rip), %xmm2 #769.19 + subsd 1792+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #769.19 addsd %xmm2, %xmm7 #770.17 movaps %xmm7, %xmm2 #771.31 mulsd %xmm7, %xmm2 #771.31 @@ -598,11 +598,11 @@ __svml_atan21_ha_ex: movaps %xmm0, %xmm15 #780.17 mulsd %xmm5, %xmm7 #777.18 mulsd %xmm6, %xmm2 #778.30 - movsd 1920+__svml_datan2_ha_data_internal(%rip), %xmm6 #796.26 + movsd 1920+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #796.26 addsd %xmm7, %xmm2 #778.18 movups 16(%rsp), %xmm7 #816.52[spill] addsd %xmm2, %xmm1 #779.19 - movsd 1856+__svml_datan2_ha_data_internal(%rip), %xmm2 #795.26 + movsd 1856+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #795.26 addsd %xmm1, %xmm15 #780.17 addsd 16(%rdx,%rdi), %xmm1 #808.19 movaps %xmm15, %xmm14 #793.14 @@ -612,24 +612,24 @@ __svml_atan21_ha_ex: mulsd %xmm14, %xmm5 #794.14 mulsd %xmm5, %xmm2 #795.26 mulsd %xmm5, %xmm6 #796.26 - addsd 1984+__svml_datan2_ha_data_internal(%rip), %xmm2 #795.14 - addsd 2048+__svml_datan2_ha_data_internal(%rip), %xmm6 #796.14 + addsd 1984+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #795.14 + addsd 2048+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #796.14 mulsd %xmm5, %xmm2 #797.26 mulsd %xmm5, %xmm6 #798.26 - addsd 2112+__svml_datan2_ha_data_internal(%rip), %xmm2 #797.14 - addsd 2176+__svml_datan2_ha_data_internal(%rip), %xmm6 #798.14 + addsd 2112+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #797.14 + addsd 2176+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #798.14 mulsd %xmm5, %xmm2 #799.26 mulsd %xmm5, %xmm6 #800.26 - addsd 2240+__svml_datan2_ha_data_internal(%rip), %xmm2 #799.14 - addsd 2304+__svml_datan2_ha_data_internal(%rip), %xmm6 #800.14 + addsd 2240+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #799.14 + addsd 2304+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #800.14 mulsd %xmm5, %xmm2 #801.26 mulsd %xmm5, %xmm6 #802.26 - addsd 2368+__svml_datan2_ha_data_internal(%rip), %xmm2 #801.14 - addsd 2432+__svml_datan2_ha_data_internal(%rip), %xmm6 #802.14 + addsd 2368+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #801.14 + addsd 2432+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #802.14 mulsd %xmm5, %xmm2 #803.26 mulsd %xmm5, %xmm6 #804.26 - addsd 2496+__svml_datan2_ha_data_internal(%rip), %xmm2 #803.14 - addsd 2560+__svml_datan2_ha_data_internal(%rip), %xmm6 #804.14 + addsd 2496+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #803.14 + addsd 2560+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #804.14 mulsd %xmm14, %xmm2 #805.26 movups (%rsp), %xmm8 #816.52[spill] addsd %xmm6, %xmm2 #805.14 @@ -687,19 +687,19 @@ __svml_atan21_ha_ex: lea (%rsp), %rdi #889.663 lea 64(%rsp), %rsi #889.663 lea 128(%rsp), %rdx #889.663 -..___tag_value___svml_atan21_ha_ex.53: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #889.663 -..___tag_value___svml_atan21_ha_ex.54: +..___tag_value___jsvml_atan21_ha_ex.53: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #889.663 +..___tag_value___jsvml_atan21_ha_ex.54: jmp ..B2.5 # Prob 100% #889.663 # LOE rbx r12 r13 r14 r15 ..B2.8: # Preds ..B2.1 # Execution count [5.00e-02]: Infreq movaps %xmm11, %xmm9 #854.21 movaps %xmm8, %xmm14 #857.19 - movsd 3136+__svml_datan2_ha_data_internal(%rip), %xmm3 #855.24 + movsd 3136+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #855.24 movaps %xmm7, %xmm10 #858.19 - movsd 2880+__svml_datan2_ha_data_internal(%rip), %xmm1 #862.18 + movsd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #862.18 cmpnltsd %xmm12, %xmm9 #854.21 cmpordsd %xmm8, %xmm14 #857.19 cmpordsd %xmm7, %xmm10 #858.19 @@ -709,7 +709,7 @@ __svml_atan21_ha_ex: andps %xmm11, %xmm9 #856.64 orps %xmm9, %xmm2 #856.21 andps %xmm10, %xmm14 #859.20 - movsd 832+__svml_datan2_ha_data_internal(%rip), %xmm4 #851.25 + movsd 832+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #851.25 cmpeqsd %xmm1, %xmm12 #862.18 cmpeqsd %xmm1, %xmm11 #863.18 cmpeqsd %xmm1, %xmm2 #870.17 @@ -729,7 +729,7 @@ __svml_atan21_ha_ex: orps %xmm2, %xmm9 #872.16 pcmpgtd %xmm13, %xmm1 #878.20 orps %xmm5, %xmm9 #873.13 - movsd 3072+__svml_datan2_ha_data_internal(%rip), %xmm6 #850.18 + movsd 3072+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #850.18 andps %xmm7, %xmm4 #853.18 pshufd $0, %xmm1, %xmm2 #879.26 andps %xmm6, %xmm2 #881.18 @@ -748,20 +748,20 @@ __svml_atan21_ha_ex: # LOE rbx r12 r13 r14 r15 eax xmm0 xmm7 xmm8 .cfi_endproc # mark_end; - .type __svml_atan21_ha_ex,@function - .size __svml_atan21_ha_ex,.-__svml_atan21_ha_ex -..LN__svml_atan21_ha_ex.1: + .type __jsvml_atan21_ha_ex,@function + .size __jsvml_atan21_ha_ex,.-__jsvml_atan21_ha_ex +..LN__jsvml_atan21_ha_ex.1: .data -# -- End __svml_atan21_ha_ex +# -- End __jsvml_atan21_ha_ex .text -.L_2__routine_start___svml_atan24_ha_l9_2: -# -- Begin __svml_atan24_ha_l9 +.L_2__routine_start___jsvml_atan24_ha_l9_2: +# -- Begin __jsvml_atan24_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan24_ha_l9 -# --- __svml_atan24_ha_l9(__m256d, __m256d) -__svml_atan24_ha_l9: + .globl __jsvml_atan24_ha_l9 +# --- __jsvml_atan24_ha_l9(__m256d, __m256d) +__jsvml_atan24_ha_l9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B3.1: # Preds ..B3.0 @@ -771,7 +771,7 @@ __svml_atan24_ha_l9: .byte 30 #1190.14 .byte 250 #1190.14 .cfi_startproc -..___tag_value___svml_atan24_ha_l9.56: +..___tag_value___jsvml_atan24_ha_l9.56: ..L57: #898.1 pushq %rbp #898.1 @@ -781,24 +781,24 @@ __svml_atan24_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #898.1 subq $256, %rsp #898.1 - lea __svml_datan2_ha_data_internal(%rip), %r8 #1068.513 - vmovupd 896+__svml_datan2_ha_data_internal(%rip), %ymm7 #1014.54 + lea __jsvml_datan2_ha_data_internal(%rip), %r8 #1068.513 + vmovupd 896+__jsvml_datan2_ha_data_internal(%rip), %ymm7 #1014.54 xorl %eax, %eax #1036.5 - vmovups 2688+__svml_datan2_ha_data_internal(%rip), %xmm15 #1029.26 + vmovups 2688+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #1029.26 vmovupd %ymm0, (%rsp) #898.1[spill] vmovapd %ymm1, %ymm9 #898.1 vandpd %ymm7, %ymm9, %ymm8 #1015.14 vandpd %ymm7, %ymm0, %ymm7 #1016.14 vxorpd %ymm8, %ymm9, %ymm3 #1017.17 vxorpd %ymm7, %ymm0, %ymm5 #1018.17 - vcmplt_oqpd 2880+__svml_datan2_ha_data_internal(%rip), %ymm9, %ymm6 #1022.24 - vandpd 960+__svml_datan2_ha_data_internal(%rip), %ymm6, %ymm4 #1023.20 - vandpd 1024+__svml_datan2_ha_data_internal(%rip), %ymm6, %ymm1 #1024.20 - vmovups 2752+__svml_datan2_ha_data_internal(%rip), %xmm6 #1030.26 + vcmplt_oqpd 2880+__jsvml_datan2_ha_data_internal(%rip), %ymm9, %ymm6 #1022.24 + vandpd 960+__jsvml_datan2_ha_data_internal(%rip), %ymm6, %ymm4 #1023.20 + vandpd 1024+__jsvml_datan2_ha_data_internal(%rip), %ymm6, %ymm1 #1024.20 + vmovups 2752+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #1030.26 vxorpd %ymm3, %ymm1, %ymm1 #1111.16 vextractf128 $1, %ymm8, %xmm12 #1027.124 vextractf128 $1, %ymm7, %xmm2 #1028.124 - vmulpd 1216+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm0 #1045.15 + vmulpd 1216+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm0 #1045.15 vshufps $221, %xmm12, %xmm8, %xmm14 #1027.34 vshufps $221, %xmm2, %xmm7, %xmm13 #1028.34 vpsubd %xmm15, %xmm14, %xmm11 #1031.17 @@ -808,12 +808,12 @@ __svml_atan24_ha_l9: vpcmpgtd %xmm6, %xmm2, %xmm14 #1034.32 vpcmpeqd %xmm6, %xmm2, %xmm6 #1034.82 vpor %xmm12, %xmm10, %xmm15 #1033.18 - vmulpd 1152+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm10 #1043.15 + vmulpd 1152+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm10 #1043.15 vpor %xmm6, %xmm14, %xmm11 #1034.18 - vmulpd 1344+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm14 #1044.15 + vmulpd 1344+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm14 #1044.15 vpor %xmm11, %xmm15, %xmm6 #1035.19 - vmulpd 1280+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm15 #1046.15 - vmovupd 1792+__svml_datan2_ha_data_internal(%rip), %ymm2 #1042.49 + vmulpd 1280+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm15 #1046.15 + vmovupd 1792+__jsvml_datan2_ha_data_internal(%rip), %ymm2 #1042.49 vmovmskps %xmm6, %r9d #1037.58 vextractf128 $1, %ymm10, %xmm12 #1051.130 vextractf128 $1, %ymm14, %xmm11 #1052.130 @@ -834,7 +834,7 @@ __svml_atan24_ha_l9: vpaddd %xmm15, %xmm10, %xmm15 #1068.183 vpaddd %xmm14, %xmm12, %xmm12 #1068.183 vpaddd %xmm12, %xmm15, %xmm13 #1068.183 - vpaddd 1408+__svml_datan2_ha_data_internal(%rip), %xmm13, %xmm11 #1068.183 + vpaddd 1408+__jsvml_datan2_ha_data_internal(%rip), %xmm13, %xmm11 #1068.183 vpslld $5, %xmm11, %xmm12 #1068.183 vmovd %xmm12, %edx #1068.242 vpextrd $2, %xmm12, %esi #1068.373 @@ -864,47 +864,47 @@ __svml_atan24_ha_l9: vandpd %ymm8, %ymm11, %ymm0 #1074.24 vfnmadd231pd %ymm13, %ymm8, %ymm15 #1073.23 vfmadd213pd %ymm0, %ymm7, %ymm13 #1075.23 - vmovups 1536+__svml_datan2_ha_data_internal(%rip), %xmm11 #1076.910 + vmovups 1536+__jsvml_datan2_ha_data_internal(%rip), %xmm11 #1076.910 vextractf128 $1, %ymm13, %xmm10 #1076.1605 vshufps $221, %xmm10, %xmm13, %xmm0 #1076.1516 vpslld $3, %xmm0, %xmm10 #1076.1795 - vandps 1600+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm10 #1076.1837 - vorps 1664+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm10 #1076.1898 + vandps 1600+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm10 #1076.1837 + vorps 1664+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm10 #1076.1898 vrcpps %xmm10, %xmm10 #1076.1986 - vandps 1472+__svml_datan2_ha_data_internal(%rip), %xmm0, %xmm0 #1076.1685 + vandps 1472+__jsvml_datan2_ha_data_internal(%rip), %xmm0, %xmm0 #1076.1685 vpsrld $3, %xmm10, %xmm10 #1076.2060 - vpsubd 1728+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm10 #1076.2103 + vpsubd 1728+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm10 #1076.2103 vpsubd %xmm0, %xmm11, %xmm11 #1076.1741 vpaddd %xmm11, %xmm10, %xmm0 #1076.2155 vpshufd $80, %xmm0, %xmm11 #1076.2258 vpshufd $250, %xmm0, %xmm10 #1076.2313 vmovapd %ymm2, %ymm0 #1077.21 vinsertf128 $1, %xmm10, %ymm11, %ymm11 #1076.2209 - vandpd 3008+__svml_datan2_ha_data_internal(%rip), %ymm11, %ymm11 #1076.2424 + vandpd 3008+__jsvml_datan2_ha_data_internal(%rip), %ymm11, %ymm11 #1076.2424 vfnmadd231pd %ymm13, %ymm11, %ymm0 #1077.21 vfmadd213pd %ymm0, %ymm0, %ymm0 #1078.21 vfmadd213pd %ymm11, %ymm0, %ymm11 #1079.18 - vmovupd 1920+__svml_datan2_ha_data_internal(%rip), %ymm0 #1100.14 + vmovupd 1920+__jsvml_datan2_ha_data_internal(%rip), %ymm0 #1100.14 vfnmadd231pd %ymm13, %ymm11, %ymm2 #1080.21 vfmadd213pd %ymm11, %ymm2, %ymm11 #1081.22 vmulpd %ymm11, %ymm15, %ymm2 #1082.17 vfnmadd213pd %ymm15, %ymm2, %ymm13 #1083.21 vmulpd %ymm2, %ymm2, %ymm10 #1097.14 vmulpd %ymm13, %ymm11, %ymm15 #1084.19 - vmovupd 1856+__svml_datan2_ha_data_internal(%rip), %ymm11 #1099.14 + vmovupd 1856+__jsvml_datan2_ha_data_internal(%rip), %ymm11 #1099.14 vmulpd %ymm10, %ymm10, %ymm13 #1098.14 vaddpd %ymm15, %ymm14, %ymm14 #1112.19 - vfmadd213pd 1984+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1099.14 - vfmadd213pd 2048+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1100.14 + vfmadd213pd 1984+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1099.14 + vfmadd213pd 2048+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1100.14 vaddpd %ymm14, %ymm1, %ymm1 #1113.19 - vfmadd213pd 2112+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1101.14 - vfmadd213pd 2176+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1102.14 - vfmadd213pd 2240+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1103.14 - vfmadd213pd 2304+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1104.14 - vfmadd213pd 2368+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1105.14 - vfmadd213pd 2432+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1106.14 - vfmadd213pd 2496+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1107.14 - vfmadd213pd 2560+__svml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1108.14 + vfmadd213pd 2112+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1101.14 + vfmadd213pd 2176+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1102.14 + vfmadd213pd 2240+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1103.14 + vfmadd213pd 2304+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1104.14 + vfmadd213pd 2368+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1105.14 + vfmadd213pd 2432+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1106.14 + vfmadd213pd 2496+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm11 #1107.14 + vfmadd213pd 2560+__jsvml_datan2_ha_data_internal(%rip), %ymm13, %ymm0 #1108.14 vfmadd213pd %ymm0, %ymm10, %ymm11 #1109.14 vmulpd %ymm11, %ymm10, %ymm0 #1110.14 vfmadd213pd %ymm1, %ymm2, %ymm0 #1114.14 @@ -980,10 +980,10 @@ __svml_atan24_ha_l9: lea 64(%rsp,%r12,8), %rdi #1193.672 lea 128(%rsp,%r12,8), %rsi #1193.672 lea 192(%rsp,%r12,8), %rdx #1193.672 -..___tag_value___svml_atan24_ha_l9.76: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #1193.672 -..___tag_value___svml_atan24_ha_l9.77: +..___tag_value___jsvml_atan24_ha_l9.76: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #1193.672 +..___tag_value___jsvml_atan24_ha_l9.77: jmp ..B3.9 # Prob 100% #1193.672 .cfi_restore 12 .cfi_restore 13 @@ -991,7 +991,7 @@ __svml_atan24_ha_l9: ..B3.12: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq vmovupd (%rsp), %ymm13 #1157.18[spill] - vmovupd 832+__svml_datan2_ha_data_internal(%rip), %ymm11 #1155.59 + vmovupd 832+__jsvml_datan2_ha_data_internal(%rip), %ymm11 #1155.59 vcmpordpd %ymm9, %ymm9, %ymm14 #1161.19 vcmpordpd %ymm13, %ymm13, %ymm15 #1162.19 vcmpnlt_uqpd %ymm8, %ymm7, %ymm12 #1158.21 @@ -999,10 +999,10 @@ __svml_atan24_ha_l9: vblendvpd %ymm12, %ymm7, %ymm8, %ymm3 #1160.21 vandpd %ymm11, %ymm9, %ymm5 #1156.18 vandpd %ymm11, %ymm13, %ymm10 #1157.18 - vandpd 3136+__svml_datan2_ha_data_internal(%rip), %ymm12, %ymm4 #1159.24 + vandpd 3136+__jsvml_datan2_ha_data_internal(%rip), %ymm12, %ymm4 #1159.24 vextractf128 $1, %ymm2, %xmm1 #1165.136 vshufps $221, %xmm1, %xmm2, %xmm1 #1165.40 - vmovupd 2880+__svml_datan2_ha_data_internal(%rip), %ymm2 #1166.18 + vmovupd 2880+__jsvml_datan2_ha_data_internal(%rip), %ymm2 #1166.18 vcmpeqpd %ymm2, %ymm8, %ymm8 #1166.18 vcmpeqpd %ymm2, %ymm7, %ymm7 #1167.18 vorpd %ymm7, %ymm8, %ymm8 #1168.20 @@ -1022,7 +1022,7 @@ __svml_atan24_ha_l9: vpshufd $80, %xmm1, %xmm15 #1183.75 vpshufd $250, %xmm1, %xmm2 #1183.132 vinsertf128 $1, %xmm2, %ymm15, %ymm3 #1183.26 - vandpd 3072+__svml_datan2_ha_data_internal(%rip), %ymm3, %ymm4 #1185.18 + vandpd 3072+__jsvml_datan2_ha_data_internal(%rip), %ymm3, %ymm4 #1185.18 vaddpd %ymm4, %ymm6, %ymm5 #1186.17 vorpd %ymm10, %ymm5, %ymm1 #1187.19 vpshufd $80, %xmm7, %xmm10 #1188.81 @@ -1034,20 +1034,20 @@ __svml_atan24_ha_l9: # LOE rbx r12 r13 r14 r15 eax ymm0 ymm9 .cfi_endproc # mark_end; - .type __svml_atan24_ha_l9,@function - .size __svml_atan24_ha_l9,.-__svml_atan24_ha_l9 -..LN__svml_atan24_ha_l9.2: + .type __jsvml_atan24_ha_l9,@function + .size __jsvml_atan24_ha_l9,.-__jsvml_atan24_ha_l9 +..LN__jsvml_atan24_ha_l9.2: .data -# -- End __svml_atan24_ha_l9 +# -- End __jsvml_atan24_ha_l9 .text -.L_2__routine_start___svml_atan24_ha_e9_3: -# -- Begin __svml_atan24_ha_e9 +.L_2__routine_start___jsvml_atan24_ha_e9_3: +# -- Begin __jsvml_atan24_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan24_ha_e9 -# --- __svml_atan24_ha_e9(__m256d, __m256d) -__svml_atan24_ha_e9: + .globl __jsvml_atan24_ha_e9 +# --- __jsvml_atan24_ha_e9(__m256d, __m256d) +__jsvml_atan24_ha_e9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B4.1: # Preds ..B4.0 @@ -1057,7 +1057,7 @@ __svml_atan24_ha_e9: .byte 30 #1525.14 .byte 250 #1525.14 .cfi_startproc -..___tag_value___svml_atan24_ha_e9.82: +..___tag_value___jsvml_atan24_ha_e9.82: ..L83: #1202.1 pushq %rbp #1202.1 @@ -1067,28 +1067,28 @@ __svml_atan24_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1202.1 subq $256, %rsp #1202.1 - lea __svml_datan2_ha_data_internal(%rip), %r8 #1383.537 - vmovupd 896+__svml_datan2_ha_data_internal(%rip), %ymm13 #1318.54 + lea __jsvml_datan2_ha_data_internal(%rip), %r8 #1383.537 + vmovupd 896+__jsvml_datan2_ha_data_internal(%rip), %ymm13 #1318.54 xorl %eax, %eax #1351.5 - vmovupd 1088+__svml_datan2_ha_data_internal(%rip), %ymm8 #1323.62 - vmovups 2688+__svml_datan2_ha_data_internal(%rip), %xmm2 #1338.30 + vmovupd 1088+__jsvml_datan2_ha_data_internal(%rip), %ymm8 #1323.62 + vmovups 2688+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #1338.30 vmovupd %ymm0, (%rsp) #1202.1[spill] vmovupd %ymm1, 32(%rsp) #1202.1[spill] vandpd %ymm13, %ymm0, %ymm5 #1320.14 vxorpd %ymm5, %ymm0, %ymm9 #1322.17 vmovupd %ymm9, 128(%rsp) #1322.17[spill] vmovupd %ymm5, 96(%rsp) #1320.14[spill] - vcmplt_oqpd 2880+__svml_datan2_ha_data_internal(%rip), %ymm1, %ymm9 #1331.24 + vcmplt_oqpd 2880+__jsvml_datan2_ha_data_internal(%rip), %ymm1, %ymm9 #1331.24 vandpd %ymm13, %ymm1, %ymm6 #1319.14 vandpd %ymm8, %ymm5, %ymm12 #1324.19 vandpd %ymm8, %ymm6, %ymm7 #1326.19 - vandpd 960+__svml_datan2_ha_data_internal(%rip), %ymm9, %ymm15 #1332.20 + vandpd 960+__jsvml_datan2_ha_data_internal(%rip), %ymm9, %ymm15 #1332.20 vmovupd %ymm6, 64(%rsp) #1319.14[spill] vmovupd %ymm15, 160(%rsp) #1332.20[spill] vsubpd %ymm12, %ymm5, %ymm11 #1325.19 vsubpd %ymm7, %ymm6, %ymm10 #1327.19 vxorpd %ymm6, %ymm1, %ymm13 #1321.17 - vandpd 1024+__svml_datan2_ha_data_internal(%rip), %ymm9, %ymm9 #1333.20 + vandpd 1024+__jsvml_datan2_ha_data_internal(%rip), %ymm9, %ymm9 #1333.20 vxorpd %ymm13, %ymm9, %ymm9 #1446.16 vextractf128 $1, %ymm6, %xmm15 #1334.107 vextractf128 $1, %ymm5, %xmm4 #1335.107 @@ -1097,24 +1097,24 @@ __svml_atan24_ha_e9: vpsubd %xmm2, %xmm3, %xmm15 #1340.21 vpsubd %xmm3, %xmm5, %xmm4 #1345.21 vpsubd %xmm2, %xmm5, %xmm14 #1341.21 - vpaddd 3200+__svml_datan2_ha_data_internal(%rip), %xmm4, %xmm0 #1348.21 - vmovups 2752+__svml_datan2_ha_data_internal(%rip), %xmm4 #1342.36 + vpaddd 3200+__jsvml_datan2_ha_data_internal(%rip), %xmm4, %xmm0 #1348.21 + vmovups 2752+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #1342.36 vpcmpgtd %xmm4, %xmm15, %xmm2 #1342.36 vpcmpeqd %xmm4, %xmm15, %xmm15 #1342.94 vpcmpgtd %xmm4, %xmm14, %xmm1 #1343.36 vpcmpeqd %xmm4, %xmm14, %xmm14 #1343.94 - vmovups 3264+__svml_datan2_ha_data_internal(%rip), %xmm4 #1349.36 + vmovups 3264+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #1349.36 vpor %xmm15, %xmm2, %xmm3 #1342.22 vpor %xmm14, %xmm1, %xmm15 #1343.22 vpcmpgtd %xmm0, %xmm4, %xmm2 #1349.36 vpcmpeqd %xmm0, %xmm4, %xmm1 #1349.86 vpor %xmm15, %xmm3, %xmm14 #1344.23 vpor %xmm1, %xmm2, %xmm0 #1349.22 - vmulpd 1216+__svml_datan2_ha_data_internal(%rip), %ymm6, %ymm2 #1360.15 + vmulpd 1216+__jsvml_datan2_ha_data_internal(%rip), %ymm6, %ymm2 #1360.15 vpor %xmm0, %xmm14, %xmm15 #1350.23 - vmulpd 1152+__svml_datan2_ha_data_internal(%rip), %ymm6, %ymm14 #1358.15 - vmulpd 1344+__svml_datan2_ha_data_internal(%rip), %ymm6, %ymm0 #1359.15 - vmulpd 1280+__svml_datan2_ha_data_internal(%rip), %ymm6, %ymm6 #1361.15 + vmulpd 1152+__jsvml_datan2_ha_data_internal(%rip), %ymm6, %ymm14 #1358.15 + vmulpd 1344+__jsvml_datan2_ha_data_internal(%rip), %ymm6, %ymm0 #1359.15 + vmulpd 1280+__jsvml_datan2_ha_data_internal(%rip), %ymm6, %ymm6 #1361.15 vmovdqu %xmm15, 192(%rsp) #1350.23[spill] vextractf128 $1, %ymm14, %xmm15 #1362.114 vextractf128 $1, %ymm0, %xmm1 #1363.114 @@ -1135,7 +1135,7 @@ __svml_atan24_ha_e9: vpaddd %xmm3, %xmm15, %xmm15 #1383.187 vpaddd %xmm5, %xmm4, %xmm6 #1383.187 vpaddd %xmm6, %xmm15, %xmm4 #1383.187 - vpaddd 1408+__svml_datan2_ha_data_internal(%rip), %xmm4, %xmm2 #1383.187 + vpaddd 1408+__jsvml_datan2_ha_data_internal(%rip), %xmm4, %xmm2 #1383.187 vpslld $5, %xmm2, %xmm3 #1383.187 vmovd %xmm3, %edx #1383.250 vpextrd $2, %xmm3, %esi #1383.389 @@ -1176,7 +1176,7 @@ __svml_atan24_ha_e9: vaddpd %ymm2, %ymm5, %ymm5 #1396.19 vandpd %ymm10, %ymm1, %ymm2 #1398.20 vmulpd %ymm3, %ymm12, %ymm10 #1399.35 - vmovups 1536+__svml_datan2_ha_data_internal(%rip), %xmm3 #1407.918 + vmovups 1536+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #1407.918 vandpd %ymm7, %ymm1, %ymm7 #1397.20 vaddpd %ymm10, %ymm7, %ymm12 #1399.20 vaddpd %ymm11, %ymm2, %ymm10 #1400.20 @@ -1189,21 +1189,21 @@ __svml_atan24_ha_e9: vextractf128 $1, %ymm12, %xmm7 #1407.1566 vshufps $221, %xmm7, %xmm12, %xmm14 #1407.1638 vpslld $3, %xmm14, %xmm11 #1407.1896 - vandps 1600+__svml_datan2_ha_data_internal(%rip), %xmm11, %xmm8 #1407.1946 - vorps 1664+__svml_datan2_ha_data_internal(%rip), %xmm8, %xmm2 #1407.2019 + vandps 1600+__jsvml_datan2_ha_data_internal(%rip), %xmm11, %xmm8 #1407.1946 + vorps 1664+__jsvml_datan2_ha_data_internal(%rip), %xmm8, %xmm2 #1407.2019 vrcpps %xmm2, %xmm1 #1407.2119 - vandps 1472+__svml_datan2_ha_data_internal(%rip), %xmm14, %xmm7 #1407.1762 + vandps 1472+__jsvml_datan2_ha_data_internal(%rip), %xmm14, %xmm7 #1407.1762 vpsrld $3, %xmm1, %xmm0 #1407.2201 - vpsubd 1728+__svml_datan2_ha_data_internal(%rip), %xmm0, %xmm11 #1407.2252 + vpsubd 1728+__jsvml_datan2_ha_data_internal(%rip), %xmm0, %xmm11 #1407.2252 vpsubd %xmm7, %xmm3, %xmm3 #1407.1830 vpaddd %xmm3, %xmm11, %xmm11 #1407.2316 vpshufd $80, %xmm11, %xmm7 #1407.2378 vpshufd $250, %xmm11, %xmm8 #1407.2450 vinsertf128 $1, %xmm8, %ymm7, %ymm2 #1407.2517 - vandpd 3008+__svml_datan2_ha_data_internal(%rip), %ymm2, %ymm2 #1407.2648 + vandpd 3008+__jsvml_datan2_ha_data_internal(%rip), %ymm2, %ymm2 #1407.2648 vmulpd %ymm2, %ymm12, %ymm12 #1408.34 vmulpd %ymm10, %ymm2, %ymm10 #1409.32 - vsubpd 1792+__svml_datan2_ha_data_internal(%rip), %ymm12, %ymm1 #1408.19 + vsubpd 1792+__jsvml_datan2_ha_data_internal(%rip), %ymm12, %ymm1 #1408.19 vaddpd %ymm10, %ymm1, %ymm1 #1409.17 vmulpd %ymm1, %ymm1, %ymm10 #1410.34 vsubpd %ymm1, %ymm10, %ymm12 #1410.19 @@ -1226,26 +1226,26 @@ __svml_atan24_ha_e9: vaddpd %ymm7, %ymm6, %ymm6 #1447.19 vmulpd %ymm12, %ymm12, %ymm11 #1432.14 vmulpd %ymm11, %ymm11, %ymm8 #1433.14 - vmulpd 1856+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm4 #1434.29 - vmulpd 1920+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm0 #1435.29 - vaddpd 1984+__svml_datan2_ha_data_internal(%rip), %ymm4, %ymm1 #1434.14 - vaddpd 2048+__svml_datan2_ha_data_internal(%rip), %ymm0, %ymm3 #1435.14 + vmulpd 1856+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm4 #1434.29 + vmulpd 1920+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm0 #1435.29 + vaddpd 1984+__jsvml_datan2_ha_data_internal(%rip), %ymm4, %ymm1 #1434.14 + vaddpd 2048+__jsvml_datan2_ha_data_internal(%rip), %ymm0, %ymm3 #1435.14 vmulpd %ymm1, %ymm8, %ymm2 #1436.29 vmulpd %ymm3, %ymm8, %ymm4 #1437.29 - vaddpd 2112+__svml_datan2_ha_data_internal(%rip), %ymm2, %ymm5 #1436.14 - vaddpd 2176+__svml_datan2_ha_data_internal(%rip), %ymm4, %ymm0 #1437.14 + vaddpd 2112+__jsvml_datan2_ha_data_internal(%rip), %ymm2, %ymm5 #1436.14 + vaddpd 2176+__jsvml_datan2_ha_data_internal(%rip), %ymm4, %ymm0 #1437.14 vmulpd %ymm5, %ymm8, %ymm14 #1438.29 vmulpd %ymm0, %ymm8, %ymm1 #1439.29 - vaddpd 2240+__svml_datan2_ha_data_internal(%rip), %ymm14, %ymm2 #1438.14 - vaddpd 2304+__svml_datan2_ha_data_internal(%rip), %ymm1, %ymm4 #1439.14 + vaddpd 2240+__jsvml_datan2_ha_data_internal(%rip), %ymm14, %ymm2 #1438.14 + vaddpd 2304+__jsvml_datan2_ha_data_internal(%rip), %ymm1, %ymm4 #1439.14 vmulpd %ymm2, %ymm8, %ymm3 #1440.29 vmulpd %ymm4, %ymm8, %ymm5 #1441.29 - vaddpd 2368+__svml_datan2_ha_data_internal(%rip), %ymm3, %ymm14 #1440.14 - vaddpd 2432+__svml_datan2_ha_data_internal(%rip), %ymm5, %ymm0 #1441.14 + vaddpd 2368+__jsvml_datan2_ha_data_internal(%rip), %ymm3, %ymm14 #1440.14 + vaddpd 2432+__jsvml_datan2_ha_data_internal(%rip), %ymm5, %ymm0 #1441.14 vmulpd %ymm14, %ymm8, %ymm14 #1442.29 vmulpd %ymm0, %ymm8, %ymm8 #1443.29 - vaddpd 2496+__svml_datan2_ha_data_internal(%rip), %ymm14, %ymm1 #1442.14 - vaddpd 2560+__svml_datan2_ha_data_internal(%rip), %ymm8, %ymm0 #1443.14 + vaddpd 2496+__jsvml_datan2_ha_data_internal(%rip), %ymm14, %ymm1 #1442.14 + vaddpd 2560+__jsvml_datan2_ha_data_internal(%rip), %ymm8, %ymm0 #1443.14 vmulpd %ymm1, %ymm11, %ymm2 #1444.29 vaddpd %ymm2, %ymm0, %ymm3 #1444.14 vaddpd %ymm6, %ymm9, %ymm0 #1448.19 @@ -1329,10 +1329,10 @@ __svml_atan24_ha_e9: lea 64(%rsp,%r12,8), %rdi #1528.672 lea 128(%rsp,%r12,8), %rsi #1528.672 lea 192(%rsp,%r12,8), %rdx #1528.672 -..___tag_value___svml_atan24_ha_e9.114: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #1528.672 -..___tag_value___svml_atan24_ha_e9.115: +..___tag_value___jsvml_atan24_ha_e9.114: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #1528.672 +..___tag_value___jsvml_atan24_ha_e9.115: jmp ..B4.9 # Prob 100% #1528.672 .cfi_restore 12 .cfi_restore 13 @@ -1340,7 +1340,7 @@ __svml_atan24_ha_e9: ..B4.12: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq vmovupd (%rsp), %ymm13 #1492.18[spill] - vmovupd 832+__svml_datan2_ha_data_internal(%rip), %ymm11 #1490.59 + vmovupd 832+__jsvml_datan2_ha_data_internal(%rip), %ymm11 #1490.59 vcmpordpd %ymm10, %ymm10, %ymm14 #1496.19 vcmpordpd %ymm13, %ymm13, %ymm15 #1497.19 vcmpnlt_uqpd %ymm2, %ymm1, %ymm12 #1493.21 @@ -1348,10 +1348,10 @@ __svml_atan24_ha_e9: vblendvpd %ymm12, %ymm1, %ymm2, %ymm5 #1495.21 vandpd %ymm11, %ymm10, %ymm7 #1491.18 vandpd %ymm11, %ymm13, %ymm8 #1492.18 - vandpd 3136+__svml_datan2_ha_data_internal(%rip), %ymm12, %ymm6 #1494.24 + vandpd 3136+__jsvml_datan2_ha_data_internal(%rip), %ymm12, %ymm6 #1494.24 vextractf128 $1, %ymm4, %xmm3 #1499.125 vshufps $221, %xmm3, %xmm4, %xmm3 #1500.44 - vmovupd 2880+__svml_datan2_ha_data_internal(%rip), %ymm4 #1501.18 + vmovupd 2880+__jsvml_datan2_ha_data_internal(%rip), %ymm4 #1501.18 vcmpeqpd %ymm4, %ymm2, %ymm2 #1501.18 vcmpeqpd %ymm4, %ymm1, %ymm1 #1502.18 vorpd %ymm1, %ymm2, %ymm11 #1503.20 @@ -1371,7 +1371,7 @@ __svml_atan24_ha_e9: vpshufd $80, %xmm12, %xmm11 #1518.26 vpshufd $250, %xmm12, %xmm13 #1518.102 vinsertf128 $1, %xmm13, %ymm11, %ymm14 #1519.20 - vandpd 3072+__svml_datan2_ha_data_internal(%rip), %ymm14, %ymm15 #1520.18 + vandpd 3072+__jsvml_datan2_ha_data_internal(%rip), %ymm14, %ymm15 #1520.18 vaddpd %ymm15, %ymm1, %ymm1 #1521.17 vorpd %ymm8, %ymm1, %ymm1 #1522.19 vpshufd $80, %xmm2, %xmm8 #1523.32 @@ -1383,20 +1383,20 @@ __svml_atan24_ha_e9: # LOE rbx r12 r13 r14 r15 eax ymm0 ymm10 .cfi_endproc # mark_end; - .type __svml_atan24_ha_e9,@function - .size __svml_atan24_ha_e9,.-__svml_atan24_ha_e9 -..LN__svml_atan24_ha_e9.3: + .type __jsvml_atan24_ha_e9,@function + .size __jsvml_atan24_ha_e9,.-__jsvml_atan24_ha_e9 +..LN__jsvml_atan24_ha_e9.3: .data -# -- End __svml_atan24_ha_e9 +# -- End __jsvml_atan24_ha_e9 .text -.L_2__routine_start___svml_atan22_ha_l9_4: -# -- Begin __svml_atan22_ha_l9 +.L_2__routine_start___jsvml_atan22_ha_l9_4: +# -- Begin __jsvml_atan22_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan22_ha_l9 -# --- __svml_atan22_ha_l9(__m128d, __m128d) -__svml_atan22_ha_l9: + .globl __jsvml_atan22_ha_l9 +# --- __jsvml_atan22_ha_l9(__m128d, __m128d) +__jsvml_atan22_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B5.1: # Preds ..B5.0 @@ -1406,7 +1406,7 @@ __svml_atan22_ha_l9: .byte 30 #1812.96 .byte 250 #1812.96 .cfi_startproc -..___tag_value___svml_atan22_ha_l9.120: +..___tag_value___jsvml_atan22_ha_l9.120: ..L121: #1537.1 pushq %rbp #1537.1 @@ -1417,22 +1417,22 @@ __svml_atan22_ha_l9: andq $-64, %rsp #1537.1 subq $256, %rsp #1537.1 vmovapd %xmm1, %xmm13 #1537.1 - vcmpltpd 2880+__svml_datan2_ha_data_internal(%rip), %xmm13, %xmm12 #1661.24 - vmovupd 896+__svml_datan2_ha_data_internal(%rip), %xmm10 #1653.51 - lea __svml_datan2_ha_data_internal(%rip), %rsi #1707.377 + vcmpltpd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm13, %xmm12 #1661.24 + vmovupd 896+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #1653.51 + lea __jsvml_datan2_ha_data_internal(%rip), %rsi #1707.377 vandpd %xmm10, %xmm13, %xmm11 #1654.14 vandpd %xmm10, %xmm0, %xmm10 #1655.14 vpshufd $221, %xmm10, %xmm1 #1667.16 vxorpd %xmm10, %xmm0, %xmm9 #1657.17 - vmovq 2688+__svml_datan2_ha_data_internal(%rip), %xmm15 #1668.26 + vmovq 2688+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #1668.26 vxorpd %xmm11, %xmm13, %xmm7 #1656.17 vpshufd $221, %xmm11, %xmm5 #1666.16 vpsubd %xmm15, %xmm1, %xmm3 #1671.17 - vandpd 960+__svml_datan2_ha_data_internal(%rip), %xmm12, %xmm8 #1662.20 + vandpd 960+__jsvml_datan2_ha_data_internal(%rip), %xmm12, %xmm8 #1662.20 vpsubd %xmm15, %xmm5, %xmm4 #1670.17 - vandpd 1024+__svml_datan2_ha_data_internal(%rip), %xmm12, %xmm6 #1663.20 + vandpd 1024+__jsvml_datan2_ha_data_internal(%rip), %xmm12, %xmm6 #1663.20 xorl %edx, %edx #1675.5 - vmovq 2752+__svml_datan2_ha_data_internal(%rip), %xmm12 #1669.26 + vmovq 2752+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #1669.26 vxorpd %xmm7, %xmm6, %xmm6 #1750.16 vpcmpgtd %xmm12, %xmm4, %xmm14 #1672.32 vpcmpeqd %xmm12, %xmm4, %xmm2 #1672.82 @@ -1440,11 +1440,11 @@ __svml_atan22_ha_l9: vpcmpeqd %xmm12, %xmm3, %xmm12 #1673.82 vpor %xmm2, %xmm14, %xmm15 #1672.18 vpor %xmm12, %xmm5, %xmm4 #1673.18 - vmulpd 1152+__svml_datan2_ha_data_internal(%rip), %xmm11, %xmm2 #1682.15 - vmulpd 1216+__svml_datan2_ha_data_internal(%rip), %xmm11, %xmm5 #1684.15 - vmulpd 1344+__svml_datan2_ha_data_internal(%rip), %xmm11, %xmm3 #1683.15 + vmulpd 1152+__jsvml_datan2_ha_data_internal(%rip), %xmm11, %xmm2 #1682.15 + vmulpd 1216+__jsvml_datan2_ha_data_internal(%rip), %xmm11, %xmm5 #1684.15 + vmulpd 1344+__jsvml_datan2_ha_data_internal(%rip), %xmm11, %xmm3 #1683.15 vpor %xmm4, %xmm15, %xmm12 #1674.19 - vmulpd 1280+__svml_datan2_ha_data_internal(%rip), %xmm11, %xmm15 #1685.15 + vmulpd 1280+__jsvml_datan2_ha_data_internal(%rip), %xmm11, %xmm15 #1685.15 vmovmskps %xmm12, %edi #1676.58 vmovupd %xmm0, (%rsp) #1537.1[spill] vpshufd $221, %xmm2, %xmm0 #1690.21 @@ -1461,12 +1461,12 @@ __svml_atan22_ha_l9: vpsrad $31, %xmm1, %xmm15 #1701.28 vpaddd %xmm4, %xmm2, %xmm4 #1707.183 vpaddd %xmm15, %xmm5, %xmm5 #1707.183 - vmovq 1408+__svml_datan2_ha_data_internal(%rip), %xmm14 #1705.19 + vmovq 1408+__jsvml_datan2_ha_data_internal(%rip), %xmm14 #1705.19 vpaddd %xmm5, %xmm4, %xmm2 #1707.183 vpaddd %xmm14, %xmm2, %xmm14 #1707.183 vpslld $5, %xmm14, %xmm5 #1707.183 vmovd %xmm5, %eax #1707.242 - vmovq 1664+__svml_datan2_ha_data_internal(%rip), %xmm1 #1715.1101 + vmovq 1664+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #1715.1101 vpextrd $1, %xmm5, %ecx #1707.306 vmovq 24(%rax,%rsi), %xmm2 #1710.612 vmovq (%rax,%rsi), %xmm15 #1707.615 @@ -1482,24 +1482,24 @@ __svml_atan22_ha_l9: vpshufd $221, %xmm3, %xmm0 #1715.1422 vfnmadd231pd %xmm15, %xmm11, %xmm2 #1712.23 vpslld $3, %xmm0, %xmm15 #1715.1596 - vmovq 1600+__svml_datan2_ha_data_internal(%rip), %xmm14 #1715.1000 + vmovq 1600+__jsvml_datan2_ha_data_internal(%rip), %xmm14 #1715.1000 vpand %xmm14, %xmm15, %xmm15 #1715.1638 vpor %xmm1, %xmm15, %xmm1 #1715.1699 vrcpps %xmm1, %xmm15 #1715.1787 - vmovq 1728+__svml_datan2_ha_data_internal(%rip), %xmm1 #1715.1904 + vmovq 1728+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #1715.1904 vpsrld $3, %xmm15, %xmm14 #1715.1861 vpsubd %xmm1, %xmm14, %xmm15 #1715.1904 - vmovq 1472+__svml_datan2_ha_data_internal(%rip), %xmm14 #1715.1486 + vmovq 1472+__jsvml_datan2_ha_data_internal(%rip), %xmm14 #1715.1486 vpand %xmm14, %xmm0, %xmm14 #1715.1486 - vmovq 1536+__svml_datan2_ha_data_internal(%rip), %xmm0 #1715.1542 + vmovq 1536+__jsvml_datan2_ha_data_internal(%rip), %xmm0 #1715.1542 vpsubd %xmm14, %xmm0, %xmm0 #1715.1542 vpaddd %xmm0, %xmm15, %xmm15 #1715.2010 vpshufd $80, %xmm15, %xmm1 #1715.2010 - vmovupd 1792+__svml_datan2_ha_data_internal(%rip), %xmm0 #1716.21 - vandpd 3008+__svml_datan2_ha_data_internal(%rip), %xmm1, %xmm14 #1715.2113 + vmovupd 1792+__jsvml_datan2_ha_data_internal(%rip), %xmm0 #1716.21 + vandpd 3008+__jsvml_datan2_ha_data_internal(%rip), %xmm1, %xmm14 #1715.2113 vmovapd %xmm0, %xmm15 #1716.21 vfnmadd231pd %xmm3, %xmm14, %xmm15 #1716.21 - vmovupd 1856+__svml_datan2_ha_data_internal(%rip), %xmm1 #1738.14 + vmovupd 1856+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #1738.14 vfmadd213pd %xmm15, %xmm15, %xmm15 #1717.21 vfmadd213pd %xmm14, %xmm15, %xmm14 #1718.18 vfnmadd231pd %xmm3, %xmm14, %xmm0 #1719.21 @@ -1509,19 +1509,19 @@ __svml_atan22_ha_l9: vfnmadd213pd %xmm2, %xmm15, %xmm3 #1722.21 vmulpd %xmm0, %xmm0, %xmm2 #1737.14 vmulpd %xmm3, %xmm14, %xmm14 #1723.19 - vfmadd213pd 1984+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1738.14 - vmovupd 1920+__svml_datan2_ha_data_internal(%rip), %xmm3 #1739.14 - vfmadd213pd 2048+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1739.14 + vfmadd213pd 1984+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1738.14 + vmovupd 1920+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #1739.14 + vfmadd213pd 2048+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1739.14 vaddpd %xmm14, %xmm4, %xmm4 #1751.19 - vfmadd213pd 2112+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1740.14 - vfmadd213pd 2176+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1741.14 + vfmadd213pd 2112+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1740.14 + vfmadd213pd 2176+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1741.14 vaddpd %xmm4, %xmm6, %xmm6 #1752.19 - vfmadd213pd 2240+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1742.14 - vfmadd213pd 2304+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1743.14 - vfmadd213pd 2368+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1744.14 - vfmadd213pd 2432+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1745.14 - vfmadd213pd 2496+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1746.14 - vfmadd213pd 2560+__svml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1747.14 + vfmadd213pd 2240+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1742.14 + vfmadd213pd 2304+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1743.14 + vfmadd213pd 2368+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1744.14 + vfmadd213pd 2432+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1745.14 + vfmadd213pd 2496+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm1 #1746.14 + vfmadd213pd 2560+__jsvml_datan2_ha_data_internal(%rip), %xmm2, %xmm3 #1747.14 vfmadd213pd %xmm3, %xmm0, %xmm1 #1748.14 vmulpd %xmm1, %xmm0, %xmm2 #1749.14 vfmadd213pd %xmm6, %xmm15, %xmm2 #1753.14 @@ -1594,10 +1594,10 @@ __svml_atan22_ha_l9: lea 64(%rsp,%r12,8), %rdi #1832.663 lea 128(%rsp,%r12,8), %rsi #1832.663 lea 192(%rsp,%r12,8), %rdx #1832.663 -..___tag_value___svml_atan22_ha_l9.140: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #1832.663 -..___tag_value___svml_atan22_ha_l9.141: +..___tag_value___jsvml_atan22_ha_l9.140: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #1832.663 +..___tag_value___jsvml_atan22_ha_l9.141: jmp ..B5.9 # Prob 100% #1832.663 .cfi_restore 12 .cfi_restore 13 @@ -1609,13 +1609,13 @@ __svml_atan22_ha_l9: vmovapd %xmm11, %xmm2 #1799.21 vmovupd (%rsp), %xmm8 #1796.18[spill] blendvpd %xmm0, %xmm10, %xmm2 #1799.21 - vmovupd 2880+__svml_datan2_ha_data_internal(%rip), %xmm1 #1805.18 - vandpd 3136+__svml_datan2_ha_data_internal(%rip), %xmm0, %xmm3 #1798.24 + vmovupd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #1805.18 + vandpd 3136+__jsvml_datan2_ha_data_internal(%rip), %xmm0, %xmm3 #1798.24 vcmpordpd %xmm8, %xmm8, %xmm14 #1801.19 vcmpeqpd %xmm1, %xmm2, %xmm0 #1813.17 vcmpeqpd %xmm1, %xmm11, %xmm11 #1805.18 vcmpeqpd %xmm1, %xmm10, %xmm15 #1806.18 - vmovupd 832+__svml_datan2_ha_data_internal(%rip), %xmm7 #1794.56 + vmovupd 832+__jsvml_datan2_ha_data_internal(%rip), %xmm7 #1794.56 vorpd %xmm15, %xmm11, %xmm10 #1807.20 blendvpd %xmm0, %xmm1, %xmm3 #1815.16 vandpd %xmm7, %xmm13, %xmm5 #1795.18 @@ -1629,7 +1629,7 @@ __svml_atan22_ha_l9: vpshufd $221, %xmm10, %xmm8 #1809.22 vpshufd $80, %xmm3, %xmm5 #1822.26 vpand %xmm9, %xmm8, %xmm10 #1810.28 - vandpd 3072+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm8 #1824.18 + vandpd 3072+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm8 #1824.18 vpandn %xmm12, %xmm10, %xmm12 #1811.21 vaddpd %xmm8, %xmm7, %xmm9 #1825.17 vmovmskps %xmm12, %edx #1812.44 @@ -1642,20 +1642,20 @@ __svml_atan22_ha_l9: # LOE rbx r12 r13 r14 r15 edx xmm6 xmm13 .cfi_endproc # mark_end; - .type __svml_atan22_ha_l9,@function - .size __svml_atan22_ha_l9,.-__svml_atan22_ha_l9 -..LN__svml_atan22_ha_l9.4: + .type __jsvml_atan22_ha_l9,@function + .size __jsvml_atan22_ha_l9,.-__jsvml_atan22_ha_l9 +..LN__jsvml_atan22_ha_l9.4: .data -# -- End __svml_atan22_ha_l9 +# -- End __jsvml_atan22_ha_l9 .text -.L_2__routine_start___svml_atan22_ha_e9_5: -# -- Begin __svml_atan22_ha_e9 +.L_2__routine_start___jsvml_atan22_ha_e9_5: +# -- Begin __jsvml_atan22_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan22_ha_e9 -# --- __svml_atan22_ha_e9(__m128d, __m128d) -__svml_atan22_ha_e9: + .globl __jsvml_atan22_ha_e9 +# --- __jsvml_atan22_ha_e9(__m128d, __m128d) +__jsvml_atan22_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B6.1: # Preds ..B6.0 @@ -1665,7 +1665,7 @@ __svml_atan22_ha_e9: .byte 30 #2147.96 .byte 250 #2147.96 .cfi_startproc -..___tag_value___svml_atan22_ha_e9.146: +..___tag_value___jsvml_atan22_ha_e9.146: ..L147: #1841.1 pushq %rbp #1841.1 @@ -1676,8 +1676,8 @@ __svml_atan22_ha_e9: andq $-64, %rsp #1841.1 subq $256, %rsp #1841.1 movaps %xmm1, %xmm12 #1970.24 - movups 896+__svml_datan2_ha_data_internal(%rip), %xmm9 #1957.51 - lea __svml_datan2_ha_data_internal(%rip), %rsi #2022.393 + movups 896+__jsvml_datan2_ha_data_internal(%rip), %xmm9 #1957.51 + lea __jsvml_datan2_ha_data_internal(%rip), %rsi #2022.393 movaps %xmm9, %xmm7 #1958.14 andps %xmm0, %xmm9 #1959.14 andps %xmm1, %xmm7 #1958.14 @@ -1690,9 +1690,9 @@ __svml_atan22_ha_e9: movaps %xmm7, %xmm3 #1966.19 pshufd $221, %xmm9, %xmm1 #1976.20 movdqa %xmm2, %xmm8 #1979.21 - movups 1088+__svml_datan2_ha_data_internal(%rip), %xmm6 #1962.59 + movups 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #1962.59 movdqa %xmm1, %xmm11 #1980.21 - movq 2688+__svml_datan2_ha_data_internal(%rip), %xmm10 #1977.30 + movq 2688+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #1977.30 movaps %xmm6, %xmm5 #1963.19 psubd %xmm10, %xmm8 #1979.21 psubd %xmm10, %xmm11 #1980.21 @@ -1700,9 +1700,9 @@ __svml_atan22_ha_e9: andps %xmm9, %xmm5 #1963.19 movups %xmm9, 16(%rsp) #1959.14[spill] psubd %xmm2, %xmm10 #1984.21 - movq 3200+__svml_datan2_ha_data_internal(%rip), %xmm9 #1987.21 + movq 3200+__jsvml_datan2_ha_data_internal(%rip), %xmm9 #1987.21 andps %xmm7, %xmm6 #1965.19 - movq 2752+__svml_datan2_ha_data_internal(%rip), %xmm2 #1981.36 + movq 2752+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #1981.36 paddd %xmm9, %xmm10 #1987.21 movdqa %xmm8, %xmm9 #1981.36 pcmpeqd %xmm2, %xmm8 #1981.94 @@ -1714,24 +1714,24 @@ __svml_atan22_ha_e9: pcmpeqd %xmm2, %xmm11 #1982.94 por %xmm11, %xmm8 #1982.22 xorl %edx, %edx #1990.5 - movq 3264+__svml_datan2_ha_data_internal(%rip), %xmm11 #1988.36 + movq 3264+__jsvml_datan2_ha_data_internal(%rip), %xmm11 #1988.36 por %xmm8, %xmm9 #1983.23 movdqa %xmm11, %xmm8 #1988.36 pcmpeqd %xmm10, %xmm11 #1988.86 pcmpgtd %xmm10, %xmm8 #1988.36 por %xmm11, %xmm8 #1988.22 - movups 1152+__svml_datan2_ha_data_internal(%rip), %xmm10 #1997.15 + movups 1152+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #1997.15 por %xmm8, %xmm9 #1989.23 - movups 1216+__svml_datan2_ha_data_internal(%rip), %xmm11 #1999.15 - movups 1280+__svml_datan2_ha_data_internal(%rip), %xmm8 #2000.15 - movups 1344+__svml_datan2_ha_data_internal(%rip), %xmm2 #1998.15 + movups 1216+__jsvml_datan2_ha_data_internal(%rip), %xmm11 #1999.15 + movups 1280+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #2000.15 + movups 1344+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #1998.15 mulpd %xmm7, %xmm10 #1997.15 mulpd %xmm7, %xmm2 #1998.15 mulpd %xmm7, %xmm11 #1999.15 mulpd %xmm7, %xmm8 #2000.15 subpd %xmm6, %xmm3 #1966.19 subpd %xmm5, %xmm4 #1964.19 - cmpltpd 2880+__svml_datan2_ha_data_internal(%rip), %xmm12 #1970.24 + cmpltpd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #1970.24 movups %xmm7, 48(%rsp) #1958.14[spill] pshufd $221, %xmm10, %xmm10 #2005.25 pshufd $221, %xmm2, %xmm7 #2006.25 @@ -1750,14 +1750,14 @@ __svml_atan22_ha_e9: movaps %xmm3, %xmm1 #2029.42 movdqu %xmm9, 64(%rsp) #1989.23[spill] paddd %xmm2, %xmm10 #2022.187 - movq 1408+__svml_datan2_ha_data_internal(%rip), %xmm9 #2020.23 + movq 1408+__jsvml_datan2_ha_data_internal(%rip), %xmm9 #2020.23 movaps %xmm4, %xmm8 #2027.20 paddd %xmm9, %xmm10 #2022.187 pslld $5, %xmm10 #2022.187 movd %xmm10, %eax #2022.250 movups %xmm0, (%rsp) #1841.1[spill] movaps %xmm6, %xmm0 #2028.42 - movups 960+__svml_datan2_ha_data_internal(%rip), %xmm15 #1971.20 + movups 960+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #1971.20 pextrd $1, %xmm10, %ecx #2022.318 movaps %xmm5, %xmm10 #2026.20 movq (%rax,%rsi), %xmm2 #2022.631 @@ -1786,36 +1786,36 @@ __svml_atan22_ha_e9: subpd %xmm10, %xmm0 #2031.21 addpd %xmm6, %xmm7 #2042.20 subpd %xmm0, %xmm8 #2032.20 - movups 1088+__svml_datan2_ha_data_internal(%rip), %xmm3 #2043.19 + movups 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2043.19 andps %xmm5, %xmm3 #2043.19 subpd %xmm3, %xmm5 #2044.22 - movups 1088+__svml_datan2_ha_data_internal(%rip), %xmm10 #2033.19 + movups 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #2033.19 andps %xmm1, %xmm10 #2033.19 subpd %xmm10, %xmm1 #2034.22 addpd %xmm5, %xmm7 #2045.19 addpd %xmm1, %xmm8 #2035.19 pshufd $221, %xmm3, %xmm5 #2046.1450 movdqa %xmm5, %xmm0 #2046.1656 - movq 1600+__svml_datan2_ha_data_internal(%rip), %xmm2 #2046.1012 + movq 1600+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #2046.1012 pslld $3, %xmm0 #2046.1656 - movq 1664+__svml_datan2_ha_data_internal(%rip), %xmm1 #2046.1117 + movq 1664+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #2046.1117 pand %xmm2, %xmm0 #2046.1706 por %xmm1, %xmm0 #2046.1779 rcpps %xmm0, %xmm2 #2046.1879 - movq 1472+__svml_datan2_ha_data_internal(%rip), %xmm4 #2046.801 + movq 1472+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #2046.801 psrld $3, %xmm2 #2046.1961 - movq 1728+__svml_datan2_ha_data_internal(%rip), %xmm6 #2046.1213 + movq 1728+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #2046.1213 pand %xmm4, %xmm5 #2046.1522 - movq 1536+__svml_datan2_ha_data_internal(%rip), %xmm4 #2046.1590 + movq 1536+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #2046.1590 psubd %xmm6, %xmm2 #2046.2012 psubd %xmm5, %xmm4 #2046.1590 paddd %xmm4, %xmm2 #2046.2138 pshufd $80, %xmm2, %xmm5 #2046.2138 movaps %xmm10, %xmm2 #2055.18 - andps 3008+__svml_datan2_ha_data_internal(%rip), %xmm5 #2046.2249 + andps 3008+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2046.2249 mulpd %xmm5, %xmm3 #2047.31 mulpd %xmm5, %xmm7 #2048.29 - subpd 1792+__svml_datan2_ha_data_internal(%rip), %xmm3 #2047.19 + subpd 1792+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2047.19 mulpd %xmm5, %xmm10 #2058.29 addpd %xmm7, %xmm3 #2048.17 movaps %xmm3, %xmm7 #2049.31 @@ -1841,36 +1841,36 @@ __svml_atan22_ha_e9: mulpd %xmm6, %xmm4 #2071.14 movaps %xmm4, %xmm7 #2072.14 mulpd %xmm4, %xmm7 #2072.14 - movups 1856+__svml_datan2_ha_data_internal(%rip), %xmm5 #2073.26 + movups 1856+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2073.26 mulpd %xmm7, %xmm5 #2073.26 - movups 1920+__svml_datan2_ha_data_internal(%rip), %xmm3 #2074.26 - addpd 1984+__svml_datan2_ha_data_internal(%rip), %xmm5 #2073.14 + movups 1920+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2074.26 + addpd 1984+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2073.14 mulpd %xmm7, %xmm3 #2074.26 mulpd %xmm7, %xmm5 #2075.26 - addpd 2048+__svml_datan2_ha_data_internal(%rip), %xmm3 #2074.14 - addpd 2112+__svml_datan2_ha_data_internal(%rip), %xmm5 #2075.14 + addpd 2048+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2074.14 + addpd 2112+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2075.14 mulpd %xmm7, %xmm3 #2076.26 mulpd %xmm7, %xmm5 #2077.26 - addpd 2176+__svml_datan2_ha_data_internal(%rip), %xmm3 #2076.14 - addpd 2240+__svml_datan2_ha_data_internal(%rip), %xmm5 #2077.14 + addpd 2176+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2076.14 + addpd 2240+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2077.14 mulpd %xmm7, %xmm3 #2078.26 mulpd %xmm7, %xmm5 #2079.26 - addpd 2304+__svml_datan2_ha_data_internal(%rip), %xmm3 #2078.14 - addpd 2368+__svml_datan2_ha_data_internal(%rip), %xmm5 #2079.14 + addpd 2304+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2078.14 + addpd 2368+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2079.14 mulpd %xmm7, %xmm3 #2080.26 mulpd %xmm7, %xmm5 #2081.26 - addpd 2432+__svml_datan2_ha_data_internal(%rip), %xmm3 #2080.14 - addpd 2496+__svml_datan2_ha_data_internal(%rip), %xmm5 #2081.14 + addpd 2432+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2080.14 + addpd 2496+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #2081.14 mulpd %xmm3, %xmm7 #2082.26 mulpd %xmm4, %xmm5 #2083.26 - addpd 2560+__svml_datan2_ha_data_internal(%rip), %xmm7 #2082.14 + addpd 2560+__jsvml_datan2_ha_data_internal(%rip), %xmm7 #2082.14 addpd %xmm5, %xmm7 #2083.14 mulpd %xmm7, %xmm4 #2084.14 movq 16(%rax,%rsi), %xmm9 #2024.637 movhpd 16(%rcx,%rsi), %xmm9 #2024.605 addpd %xmm2, %xmm9 #2086.19 mulpd %xmm4, %xmm6 #2088.26 - andps 1024+__svml_datan2_ha_data_internal(%rip), %xmm12 #1972.20 + andps 1024+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #1972.20 pxor %xmm13, %xmm12 #2085.16 addpd %xmm9, %xmm12 #2087.19 addpd %xmm6, %xmm12 #2088.14 @@ -1949,10 +1949,10 @@ __svml_atan22_ha_e9: lea 64(%rsp,%r12,8), %rdi #2167.663 lea 128(%rsp,%r12,8), %rsi #2167.663 lea 192(%rsp,%r12,8), %rdx #2167.663 -..___tag_value___svml_atan22_ha_e9.173: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #2167.663 -..___tag_value___svml_atan22_ha_e9.174: +..___tag_value___jsvml_atan22_ha_e9.173: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #2167.663 +..___tag_value___jsvml_atan22_ha_e9.174: jmp ..B6.9 # Prob 100% #2167.663 .cfi_restore 12 .cfi_restore 13 @@ -1966,8 +1966,8 @@ __svml_atan22_ha_e9: cmpnltpd %xmm9, %xmm0 #2132.21 cmpordpd %xmm6, %xmm10 #2135.19 movups (%rsp), %xmm7 #2131.18[spill] - movups 832+__svml_datan2_ha_data_internal(%rip), %xmm2 #2129.56 - movups 2880+__svml_datan2_ha_data_internal(%rip), %xmm12 #2140.18 + movups 832+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #2129.56 + movups 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #2140.18 movaps %xmm2, %xmm5 #2130.18 blendvpd %xmm0, %xmm8, %xmm1 #2134.21 andps %xmm7, %xmm2 #2131.18 @@ -1982,7 +1982,7 @@ __svml_atan22_ha_e9: pshufd $221, %xmm10, %xmm9 #2139.26 pand %xmm9, %xmm7 #2145.32 movdqa %xmm7, %xmm11 #2146.25 - movups 3136+__svml_datan2_ha_data_internal(%rip), %xmm3 #2133.24 + movups 3136+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #2133.24 pandn %xmm4, %xmm11 #2146.25 pshufd $221, %xmm6, %xmm4 #2155.22 andps %xmm0, %xmm3 #2133.24 @@ -1992,7 +1992,7 @@ __svml_atan22_ha_e9: blendvpd %xmm0, %xmm12, %xmm3 #2150.16 pshufd $80, %xmm13, %xmm14 #2157.26 orps %xmm5, %xmm3 #2151.13 - andps 3072+__svml_datan2_ha_data_internal(%rip), %xmm14 #2159.18 + andps 3072+__jsvml_datan2_ha_data_internal(%rip), %xmm14 #2159.18 addpd %xmm14, %xmm3 #2160.17 movmskps %xmm11, %edx #2147.44 pshufd $80, %xmm7, %xmm0 #2162.32 @@ -2004,20 +2004,20 @@ __svml_atan22_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm6 xmm15 .cfi_endproc # mark_end; - .type __svml_atan22_ha_e9,@function - .size __svml_atan22_ha_e9,.-__svml_atan22_ha_e9 -..LN__svml_atan22_ha_e9.5: + .type __jsvml_atan22_ha_e9,@function + .size __jsvml_atan22_ha_e9,.-__jsvml_atan22_ha_e9 +..LN__jsvml_atan22_ha_e9.5: .data -# -- End __svml_atan22_ha_e9 +# -- End __jsvml_atan22_ha_e9 .text -.L_2__routine_start___svml_atan28_ha_z0_6: -# -- Begin __svml_atan28_ha_z0 +.L_2__routine_start___jsvml_atan28_ha_z0_6: +# -- Begin __jsvml_atan28_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_atan28_ha_z0 -# --- __svml_atan28_ha_z0(__m512d, __m512d) -__svml_atan28_ha_z0: + .globl __jsvml_atan28_ha_z0 +# --- __jsvml_atan28_ha_z0(__m512d, __m512d) +__jsvml_atan28_ha_z0: # parameter 1: %zmm0 # parameter 2: %zmm1 ..B7.1: # Preds ..B7.0 @@ -2027,7 +2027,7 @@ __svml_atan28_ha_z0: .byte 30 #2458.35 .byte 250 #2458.35 .cfi_startproc -..___tag_value___svml_atan28_ha_z0.180: +..___tag_value___jsvml_atan28_ha_z0.180: ..L181: #2176.1 pushq %rbp #2176.1 @@ -2038,15 +2038,15 @@ __svml_atan28_ha_z0: andq $-64, %rsp #2176.1 subq $256, %rsp #2176.1 xorl %esi, %esi #2308.5 - vmovups 896+__svml_datan2_ha_data_internal(%rip), %zmm8 #2288.52 - vmovups 2880+__svml_datan2_ha_data_internal(%rip), %zmm10 #2293.48 - vmovdqu 2688+__svml_datan2_ha_data_internal(%rip), %ymm2 #2301.63 + vmovups 896+__jsvml_datan2_ha_data_internal(%rip), %zmm8 #2288.52 + vmovups 2880+__jsvml_datan2_ha_data_internal(%rip), %zmm10 #2293.48 + vmovdqu 2688+__jsvml_datan2_ha_data_internal(%rip), %ymm2 #2301.63 vmovaps %zmm1, %zmm11 #2176.1 vandpd %zmm8, %zmm11, %zmm9 #2289.14 vandpd %zmm8, %zmm0, %zmm8 #2290.14 vcmppd $17, {sae}, %zmm10, %zmm11, %k5 #2296.24 - vmovdqu 2752+__svml_datan2_ha_data_internal(%rip), %ymm10 #2302.63 - vmovups 1152+__svml_datan2_ha_data_internal(%rip), %zmm1 #2310.55 + vmovdqu 2752+__jsvml_datan2_ha_data_internal(%rip), %ymm10 #2302.63 + vmovups 1152+__jsvml_datan2_ha_data_internal(%rip), %zmm1 #2310.55 vpsrlq $32, %zmm9, %zmm5 #2299.36 vpsrlq $32, %zmm8, %zmm13 #2300.36 vxorpd %zmm9, %zmm11, %zmm6 #2291.17 @@ -2055,39 +2055,39 @@ __svml_atan28_ha_z0: vxorpd %zmm8, %zmm0, %zmm7 #2292.17 vpsubd %ymm2, %ymm4, %ymm15 #2303.15 vpsubd %ymm2, %ymm3, %ymm5 #2304.15 - vmovups 1792+__svml_datan2_ha_data_internal(%rip), %zmm2 #2314.47 + vmovups 1792+__jsvml_datan2_ha_data_internal(%rip), %zmm2 #2314.47 vpcmpgtd %ymm10, %ymm15, %ymm12 #2305.35 vpcmpeqd %ymm10, %ymm15, %ymm14 #2305.88 vpcmpgtd %ymm10, %ymm5, %ymm4 #2306.35 vpcmpeqd %ymm10, %ymm5, %ymm10 #2306.88 vpor %ymm14, %ymm12, %ymm13 #2305.18 vpor %ymm10, %ymm4, %ymm3 #2306.18 - vmovups 1344+__svml_datan2_ha_data_internal(%rip), %zmm15 #2311.55 - vmovups 1280+__svml_datan2_ha_data_internal(%rip), %zmm14 #2313.55 - vmovups 1216+__svml_datan2_ha_data_internal(%rip), %zmm12 #2312.55 + vmovups 1344+__jsvml_datan2_ha_data_internal(%rip), %zmm15 #2311.55 + vmovups 1280+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2313.55 + vmovups 1216+__jsvml_datan2_ha_data_internal(%rip), %zmm12 #2312.55 vmulpd {rn-sae}, %zmm1, %zmm9, %zmm4 #2315.17 vmulpd {rn-sae}, %zmm15, %zmm9, %zmm5 #2316.17 vmulpd {rn-sae}, %zmm12, %zmm9, %zmm15 #2317.17 - vmovups 768+__svml_datan2_ha_data_internal(%rip), %zmm1 #2328.57 - vmovups 192+__svml_datan2_ha_data_internal(%rip), %zmm12 #2319.57 + vmovups 768+__jsvml_datan2_ha_data_internal(%rip), %zmm1 #2328.57 + vmovups 192+__jsvml_datan2_ha_data_internal(%rip), %zmm12 #2319.57 vcmppd $17, {sae}, %zmm8, %zmm5, %k1 #2330.25 vcmppd $17, {sae}, %zmm8, %zmm4, %k4 #2329.25 vcmppd $17, {sae}, %zmm8, %zmm15, %k2 #2331.25 - vmovups 512+__svml_datan2_ha_data_internal(%rip), %zmm15 #2337.25 + vmovups 512+__jsvml_datan2_ha_data_internal(%rip), %zmm15 #2337.25 vpor %ymm3, %ymm13, %ymm10 #2307.17 - vblendmpd 320+__svml_datan2_ha_data_internal(%rip), %zmm12, %zmm5{%k1} #2333.25 + vblendmpd 320+__jsvml_datan2_ha_data_internal(%rip), %zmm12, %zmm5{%k1} #2333.25 vmulpd {rn-sae}, %zmm14, %zmm9, %zmm3 #2318.17 - vmovups 704+__svml_datan2_ha_data_internal(%rip), %zmm13 #2327.52 - vmovups 256+__svml_datan2_ha_data_internal(%rip), %zmm14 #2320.57 + vmovups 704+__jsvml_datan2_ha_data_internal(%rip), %zmm13 #2327.52 + vmovups 256+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2320.57 vcmppd $17, {sae}, %zmm8, %zmm3, %k3 #2332.25 vblendmpd %zmm2, %zmm13, %zmm3{%k1} #2335.21 - vblendmpd 384+__svml_datan2_ha_data_internal(%rip), %zmm14, %zmm4{%k1} #2334.25 - vmovups 448+__svml_datan2_ha_data_internal(%rip), %zmm13 #2336.25 + vblendmpd 384+__jsvml_datan2_ha_data_internal(%rip), %zmm14, %zmm4{%k1} #2334.25 + vmovups 448+__jsvml_datan2_ha_data_internal(%rip), %zmm13 #2336.25 vblendmpd %zmm2, %zmm1, %zmm1{%k3} #2338.21 - vblendmpd 576+__svml_datan2_ha_data_internal(%rip), %zmm13, %zmm14{%k3} #2336.25 + vblendmpd 576+__jsvml_datan2_ha_data_internal(%rip), %zmm13, %zmm14{%k3} #2336.25 vblendmpd %zmm1, %zmm3, %zmm3{%k2} #2341.20 - vblendmpd 640+__svml_datan2_ha_data_internal(%rip), %zmm15, %zmm13{%k3} #2337.25 - vmovups 1984+__svml_datan2_ha_data_internal(%rip), %zmm1 #2370.14 + vblendmpd 640+__jsvml_datan2_ha_data_internal(%rip), %zmm15, %zmm13{%k3} #2337.25 + vmovups 1984+__jsvml_datan2_ha_data_internal(%rip), %zmm1 #2370.14 vblendmpd %zmm14, %zmm5, %zmm5{%k2} #2339.26 vblendmpd %zmm13, %zmm4, %zmm4{%k2} #2340.26 vmovaps %zmm9, %zmm12 #2346.23 @@ -2107,37 +2107,37 @@ __svml_atan28_ha_z0: vfnmadd213pd {rn-sae}, %zmm13, %zmm3, %zmm12 #2354.21 vmulpd {rn-sae}, %zmm15, %zmm15, %zmm2 #2369.16 vmulpd {rn-sae}, %zmm14, %zmm12, %zmm13 #2355.21 - vmovups 1856+__svml_datan2_ha_data_internal(%rip), %zmm12 #2356.52 - vmovups 1920+__svml_datan2_ha_data_internal(%rip), %zmm14 #2357.52 + vmovups 1856+__jsvml_datan2_ha_data_internal(%rip), %zmm12 #2356.52 + vmovups 1920+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2357.52 vaddpd {rn-sae}, %zmm4, %zmm13, %zmm13{%k4} #2383.21 vfmadd231pd {rn-sae}, %zmm2, %zmm12, %zmm1 #2370.14 - vmovups 2048+__svml_datan2_ha_data_internal(%rip), %zmm12 #2371.14 + vmovups 2048+__jsvml_datan2_ha_data_internal(%rip), %zmm12 #2371.14 vfmadd231pd {rn-sae}, %zmm2, %zmm14, %zmm12 #2371.14 - vmovups 2112+__svml_datan2_ha_data_internal(%rip), %zmm14 #2372.14 + vmovups 2112+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2372.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm1 #2372.14 - vmovups 2176+__svml_datan2_ha_data_internal(%rip), %zmm14 #2373.14 + vmovups 2176+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2373.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm12 #2373.14 - vmovups 2240+__svml_datan2_ha_data_internal(%rip), %zmm14 #2374.14 + vmovups 2240+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2374.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm1 #2374.14 - vmovups 2304+__svml_datan2_ha_data_internal(%rip), %zmm14 #2375.14 + vmovups 2304+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2375.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm12 #2375.14 - vmovups 2368+__svml_datan2_ha_data_internal(%rip), %zmm14 #2376.14 + vmovups 2368+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2376.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm1 #2376.14 - vmovups 2432+__svml_datan2_ha_data_internal(%rip), %zmm14 #2377.14 + vmovups 2432+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2377.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm12 #2377.14 - vmovups 2496+__svml_datan2_ha_data_internal(%rip), %zmm14 #2378.14 + vmovups 2496+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2378.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm1 #2378.14 - vmovups 2560+__svml_datan2_ha_data_internal(%rip), %zmm14 #2379.14 + vmovups 2560+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2379.14 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm12 #2379.14 vfmadd213pd {rn-sae}, %zmm12, %zmm15, %zmm1 #2380.14 vmulpd {rn-sae}, %zmm15, %zmm1, %zmm15 #2381.16 - vxorpd 1024+__svml_datan2_ha_data_internal(%rip), %zmm6, %zmm1 #2382.16 + vxorpd 1024+__jsvml_datan2_ha_data_internal(%rip), %zmm6, %zmm1 #2382.16 vaddpd {rn-sae}, %zmm1, %zmm13, %zmm13{%k5} #2384.21 vfmadd213pd {rn-sae}, %zmm13, %zmm3, %zmm15 #2385.14 vaddpd {rn-sae}, %zmm15, %zmm3, %zmm3 #2386.20 vaddpd {rn-sae}, %zmm5, %zmm3, %zmm3{%k4} #2387.20 vxorpd %zmm6, %zmm3, %zmm1 #2388.18 - vmovups 960+__svml_datan2_ha_data_internal(%rip), %zmm6 #2389.20 + vmovups 960+__jsvml_datan2_ha_data_internal(%rip), %zmm6 #2389.20 vaddpd {rn-sae}, %zmm6, %zmm1, %zmm1{%k5} #2389.20 vmovmskps %ymm10, %eax #2309.58 vorpd %zmm7, %zmm1, %zmm7 #2390.14 @@ -2258,10 +2258,10 @@ __svml_atan28_ha_z0: lea 64(%rsp,%rbx,8), %rdi #2461.878 lea 128(%rsp,%rbx,8), %rsi #2461.878 lea 192(%rsp,%rbx,8), %rdx #2461.878 -..___tag_value___svml_atan28_ha_z0.208: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #2461.878 -..___tag_value___svml_atan28_ha_z0.209: +..___tag_value___jsvml_atan28_ha_z0.208: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #2461.878 +..___tag_value___jsvml_atan28_ha_z0.209: jmp ..B7.14 # Prob 100% #2461.878 .cfi_restore 3 .cfi_restore 12 @@ -2273,9 +2273,9 @@ __svml_atan28_ha_z0: vcmppd $3, {sae}, %zmm11, %zmm11, %k2 #2432.116 vcmppd $3, {sae}, %zmm0, %zmm0, %k3 #2433.116 vcmppd $17, {sae}, %zmm9, %zmm8, %k1 #2429.21 - vmovups 832+__svml_datan2_ha_data_internal(%rip), %zmm14 #2426.57 - vmovups 3136+__svml_datan2_ha_data_internal(%rip), %zmm4 #2424.52 - vmovups 3072+__svml_datan2_ha_data_internal(%rip), %zmm12 #2425.50 + vmovups 832+__jsvml_datan2_ha_data_internal(%rip), %zmm14 #2426.57 + vmovups 3136+__jsvml_datan2_ha_data_internal(%rip), %zmm4 #2424.52 + vmovups 3072+__jsvml_datan2_ha_data_internal(%rip), %zmm12 #2425.50 vblendmpd %zmm9, %zmm8, %zmm3{%k1} #2431.21 vpbroadcastq .L_2il0floatpacket.51(%rip), %zmm5 #2432.65 vandpd %zmm14, %zmm11, %zmm13 #2427.18 @@ -2287,7 +2287,7 @@ __svml_atan28_ha_z0: vpandnq %zmm11, %zmm11, %zmm15{%k2} #2432.40 vpandnq %zmm0, %zmm0, %zmm2{%k3} #2433.40 vandpd %zmm2, %zmm15, %zmm1 #2434.20 - vmovups 2880+__svml_datan2_ha_data_internal(%rip), %zmm2 #2437.115 + vmovups 2880+__jsvml_datan2_ha_data_internal(%rip), %zmm2 #2437.115 vpsrlq $32, %zmm1, %zmm1 #2436.42 vcmppd $4, {sae}, %zmm2, %zmm9, %k4 #2437.115 vcmppd $4, {sae}, %zmm2, %zmm8, %k5 #2438.115 @@ -2321,20 +2321,20 @@ __svml_atan28_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm7 zmm11 .cfi_endproc # mark_end; - .type __svml_atan28_ha_z0,@function - .size __svml_atan28_ha_z0,.-__svml_atan28_ha_z0 -..LN__svml_atan28_ha_z0.6: + .type __jsvml_atan28_ha_z0,@function + .size __jsvml_atan28_ha_z0,.-__jsvml_atan28_ha_z0 +..LN__jsvml_atan28_ha_z0.6: .data -# -- End __svml_atan28_ha_z0 +# -- End __jsvml_atan28_ha_z0 .text -.L_2__routine_start___svml_atan21_ha_e9_7: -# -- Begin __svml_atan21_ha_e9 +.L_2__routine_start___jsvml_atan21_ha_e9_7: +# -- Begin __jsvml_atan21_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan21_ha_e9 -# --- __svml_atan21_ha_e9(__m128d, __m128d) -__svml_atan21_ha_e9: + .globl __jsvml_atan21_ha_e9 +# --- __jsvml_atan21_ha_e9(__m128d, __m128d) +__jsvml_atan21_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B8.1: # Preds ..B8.0 @@ -2344,7 +2344,7 @@ __svml_atan21_ha_e9: .byte 30 #3303.96 .byte 250 #3303.96 .cfi_startproc -..___tag_value___svml_atan21_ha_e9.215: +..___tag_value___jsvml_atan21_ha_e9.215: ..L216: #2997.1 pushq %rbp #2997.1 @@ -2355,7 +2355,7 @@ __svml_atan21_ha_e9: andq $-64, %rsp #2997.1 subq $192, %rsp #2997.1 movaps %xmm1, %xmm8 #2997.1 - movsd 896+__svml_datan2_ha_data_internal(%rip), %xmm6 #3113.20 + movsd 896+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3113.20 movl $-2144337920, %eax #3133.30 movaps %xmm6, %xmm12 #3114.14 andps %xmm0, %xmm6 #3115.14 @@ -2365,11 +2365,11 @@ __svml_atan21_ha_e9: movaps %xmm6, %xmm11 #3117.17 movups %xmm8, (%rsp) #2997.1[spill] pxor %xmm8, %xmm9 #3116.17 - movsd 1088+__svml_datan2_ha_data_internal(%rip), %xmm4 #3118.28 + movsd 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #3118.28 movl $-36700160, %edx #3134.30 - movsd 1024+__svml_datan2_ha_data_internal(%rip), %xmm13 #3125.16 + movsd 1024+__jsvml_datan2_ha_data_internal(%rip), %xmm13 #3125.16 pxor %xmm0, %xmm11 #3117.17 - movsd 960+__svml_datan2_ha_data_internal(%rip), %xmm10 #3127.20 + movsd 960+__jsvml_datan2_ha_data_internal(%rip), %xmm10 #3127.20 movaps %xmm4, %xmm3 #3119.19 movups %xmm0, 16(%rsp) #2997.1[spill] andps %xmm6, %xmm3 #3119.19 @@ -2382,7 +2382,7 @@ __svml_atan21_ha_e9: movdqa %xmm0, %xmm7 #3136.21 movl $4, %esi #3178.187 psubd %xmm14, %xmm7 #3136.21 - lea __svml_datan2_ha_data_internal(%rip), %rdx #3178.433 + lea __jsvml_datan2_ha_data_internal(%rip), %rdx #3178.433 andps %xmm12, %xmm4 #3121.19 movaps %xmm12, %xmm1 #3122.19 movl $8388607, %r8d #3202.1701 @@ -2390,7 +2390,7 @@ __svml_atan21_ha_e9: movl $-1048576, %r11d #3202.1517 movl $133169152, %r10d #3202.2007 xorl %eax, %eax #3146.5 - cmpltsd 2880+__svml_datan2_ha_data_internal(%rip), %xmm8 #3126.24 + cmpltsd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #3126.24 subsd %xmm4, %xmm1 #3122.19 subsd %xmm3, %xmm2 #3120.19 andps %xmm8, %xmm10 #3127.20 @@ -2421,10 +2421,10 @@ __svml_atan21_ha_e9: movaps %xmm12, %xmm6 #3153.15 movaps %xmm12, %xmm15 #3154.15 movaps %xmm12, %xmm5 #3155.15 - mulsd 1152+__svml_datan2_ha_data_internal(%rip), %xmm6 #3153.15 - mulsd 1216+__svml_datan2_ha_data_internal(%rip), %xmm5 #3155.15 - mulsd 1280+__svml_datan2_ha_data_internal(%rip), %xmm14 #3156.15 - mulsd 1344+__svml_datan2_ha_data_internal(%rip), %xmm15 #3154.15 + mulsd 1152+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3153.15 + mulsd 1216+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #3155.15 + mulsd 1280+__jsvml_datan2_ha_data_internal(%rip), %xmm14 #3156.15 + mulsd 1344+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #3154.15 movmskps %xmm13, %ecx #3147.58 pshufd $85, %xmm6, %xmm7 #3161.25 pshufd $85, %xmm15, %xmm6 #3162.25 @@ -2472,11 +2472,11 @@ __svml_atan21_ha_e9: movaps %xmm6, %xmm15 #3187.21 addsd %xmm1, %xmm7 #3198.20 subsd %xmm5, %xmm15 #3187.21 - movsd 1088+__svml_datan2_ha_data_internal(%rip), %xmm5 #3189.19 + movsd 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #3189.19 movd %r8d, %xmm1 #3202.1701 andps %xmm6, %xmm5 #3189.19 movl $2145386496, %r8d #3202.1585 - movsd 1088+__svml_datan2_ha_data_internal(%rip), %xmm2 #3199.19 + movsd 1088+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3199.19 subsd %xmm15, %xmm0 #3188.20 subsd %xmm5, %xmm6 #3190.22 andps %xmm3, %xmm2 #3199.19 @@ -2498,14 +2498,14 @@ __svml_atan21_ha_e9: psubd %xmm3, %xmm4 #3202.2007 psubd %xmm14, %xmm0 #3202.1585 paddd %xmm0, %xmm4 #3202.2133 - movsd 3008+__svml_datan2_ha_data_internal(%rip), %xmm15 #3202.1306 + movsd 3008+__jsvml_datan2_ha_data_internal(%rip), %xmm15 #3202.1306 pshufd $0, %xmm4, %xmm1 #3202.2133 andps %xmm15, %xmm1 #3202.2244 mulsd %xmm1, %xmm2 #3203.31 movaps %xmm1, %xmm3 #3213.31 mulsd %xmm1, %xmm7 #3204.29 mulsd %xmm6, %xmm3 #3213.31 - subsd 1792+__svml_datan2_ha_data_internal(%rip), %xmm2 #3203.19 + subsd 1792+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3203.19 addsd %xmm2, %xmm7 #3204.17 movaps %xmm7, %xmm2 #3205.31 mulsd %xmm7, %xmm2 #3205.31 @@ -2524,10 +2524,10 @@ __svml_atan21_ha_e9: movaps %xmm1, %xmm15 #3214.17 mulsd %xmm5, %xmm7 #3211.18 mulsd %xmm6, %xmm2 #3212.30 - movsd 1920+__svml_datan2_ha_data_internal(%rip), %xmm6 #3230.26 + movsd 1920+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3230.26 addsd %xmm7, %xmm2 #3212.18 addsd %xmm2, %xmm3 #3213.19 - movsd 1856+__svml_datan2_ha_data_internal(%rip), %xmm2 #3229.26 + movsd 1856+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3229.26 addsd %xmm3, %xmm15 #3214.17 addsd 16(%rdx,%rdi), %xmm3 #3242.19 movaps %xmm15, %xmm14 #3227.14 @@ -2537,24 +2537,24 @@ __svml_atan21_ha_e9: mulsd %xmm14, %xmm5 #3228.14 mulsd %xmm5, %xmm2 #3229.26 mulsd %xmm5, %xmm6 #3230.26 - addsd 1984+__svml_datan2_ha_data_internal(%rip), %xmm2 #3229.14 - addsd 2048+__svml_datan2_ha_data_internal(%rip), %xmm6 #3230.14 + addsd 1984+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3229.14 + addsd 2048+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3230.14 mulsd %xmm5, %xmm2 #3231.26 mulsd %xmm5, %xmm6 #3232.26 - addsd 2112+__svml_datan2_ha_data_internal(%rip), %xmm2 #3231.14 - addsd 2176+__svml_datan2_ha_data_internal(%rip), %xmm6 #3232.14 + addsd 2112+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3231.14 + addsd 2176+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3232.14 mulsd %xmm5, %xmm2 #3233.26 mulsd %xmm5, %xmm6 #3234.26 - addsd 2240+__svml_datan2_ha_data_internal(%rip), %xmm2 #3233.14 - addsd 2304+__svml_datan2_ha_data_internal(%rip), %xmm6 #3234.14 + addsd 2240+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3233.14 + addsd 2304+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3234.14 mulsd %xmm5, %xmm2 #3235.26 mulsd %xmm5, %xmm6 #3236.26 - addsd 2368+__svml_datan2_ha_data_internal(%rip), %xmm2 #3235.14 - addsd 2432+__svml_datan2_ha_data_internal(%rip), %xmm6 #3236.14 + addsd 2368+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3235.14 + addsd 2432+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3236.14 mulsd %xmm5, %xmm2 #3237.26 mulsd %xmm5, %xmm6 #3238.26 - addsd 2496+__svml_datan2_ha_data_internal(%rip), %xmm2 #3237.14 - addsd 2560+__svml_datan2_ha_data_internal(%rip), %xmm6 #3238.14 + addsd 2496+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3237.14 + addsd 2560+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3238.14 mulsd %xmm14, %xmm2 #3239.26 addsd %xmm6, %xmm2 #3239.14 movups 32(%rsp), %xmm6 #3250.52[spill] @@ -2608,23 +2608,23 @@ __svml_atan21_ha_e9: lea (%rsp), %rdi #3323.663 lea 64(%rsp), %rsi #3323.663 lea 128(%rsp), %rdx #3323.663 -..___tag_value___svml_atan21_ha_e9.230: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #3323.663 -..___tag_value___svml_atan21_ha_e9.231: +..___tag_value___jsvml_atan21_ha_e9.230: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #3323.663 +..___tag_value___jsvml_atan21_ha_e9.231: jmp ..B8.5 # Prob 100% #3323.663 # LOE rbx r12 r13 r14 r15 ..B8.8: # Preds ..B8.1 # Execution count [5.00e-02]: Infreq movaps %xmm6, %xmm0 #3288.21 movaps %xmm12, %xmm3 #3290.21 - movsd 832+__svml_datan2_ha_data_internal(%rip), %xmm5 #3285.25 + movsd 832+__jsvml_datan2_ha_data_internal(%rip), %xmm5 #3285.25 movaps %xmm9, %xmm11 #3291.19 movups 16(%rsp), %xmm10 #3287.18[spill] movaps %xmm5, %xmm7 #3286.18 - movsd 2880+__svml_datan2_ha_data_internal(%rip), %xmm2 #3296.18 + movsd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm2 #3296.18 andps %xmm10, %xmm5 #3287.18 - movsd 3136+__svml_datan2_ha_data_internal(%rip), %xmm4 #3289.24 + movsd 3136+__jsvml_datan2_ha_data_internal(%rip), %xmm4 #3289.24 andps %xmm9, %xmm7 #3286.18 pshufd $85, %xmm2, %xmm15 #3309.22 cmpnltsd %xmm12, %xmm0 #3288.21 @@ -2645,7 +2645,7 @@ __svml_atan21_ha_e9: pandn %xmm13, %xmm14 #3302.25 pshufd $85, %xmm9, %xmm13 #3311.22 pcmpgtd %xmm13, %xmm15 #3312.26 - movsd 3072+__svml_datan2_ha_data_internal(%rip), %xmm8 #3284.18 + movsd 3072+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #3284.18 blendvpd %xmm0, %xmm2, %xmm4 #3306.16 pshufd $0, %xmm15, %xmm2 #3313.26 orps %xmm7, %xmm4 #3307.13 @@ -2661,20 +2661,20 @@ __svml_atan21_ha_e9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm9 .cfi_endproc # mark_end; - .type __svml_atan21_ha_e9,@function - .size __svml_atan21_ha_e9,.-__svml_atan21_ha_e9 -..LN__svml_atan21_ha_e9.7: + .type __jsvml_atan21_ha_e9,@function + .size __jsvml_atan21_ha_e9,.-__jsvml_atan21_ha_e9 +..LN__jsvml_atan21_ha_e9.7: .data -# -- End __svml_atan21_ha_e9 +# -- End __jsvml_atan21_ha_e9 .text -.L_2__routine_start___svml_atan21_ha_l9_8: -# -- Begin __svml_atan21_ha_l9 +.L_2__routine_start___jsvml_atan21_ha_l9_8: +# -- Begin __jsvml_atan21_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan21_ha_l9 -# --- __svml_atan21_ha_l9(__m128d, __m128d) -__svml_atan21_ha_l9: + .globl __jsvml_atan21_ha_l9 +# --- __jsvml_atan21_ha_l9(__m128d, __m128d) +__jsvml_atan21_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B9.1: # Preds ..B9.0 @@ -2684,7 +2684,7 @@ __svml_atan21_ha_l9: .byte 30 #3607.96 .byte 250 #3607.96 .cfi_startproc -..___tag_value___svml_atan21_ha_l9.234: +..___tag_value___jsvml_atan21_ha_l9.234: ..L235: #3332.1 pushq %rbp #3332.1 @@ -2695,21 +2695,21 @@ __svml_atan21_ha_l9: andq $-64, %rsp #3332.1 subq $192, %rsp #3332.1 vmovapd %xmm1, %xmm15 #3332.1 - vmovsd 2880+__svml_datan2_ha_data_internal(%rip), %xmm13 #3453.16 + vmovsd 2880+__jsvml_datan2_ha_data_internal(%rip), %xmm13 #3453.16 movl $-2144337920, %eax #3463.26 movl $-36700160, %edx #3464.26 vmovapd %xmm0, %xmm14 #3332.1 - vmovsd 896+__svml_datan2_ha_data_internal(%rip), %xmm11 #3448.20 + vmovsd 896+__jsvml_datan2_ha_data_internal(%rip), %xmm11 #3448.20 movl $4, %ecx #3502.183 vandpd %xmm11, %xmm15, %xmm10 #3449.14 vandpd %xmm11, %xmm14, %xmm11 #3450.14 - vmovsd 960+__svml_datan2_ha_data_internal(%rip), %xmm12 #3454.16 + vmovsd 960+__jsvml_datan2_ha_data_internal(%rip), %xmm12 #3454.16 vmovd %eax, %xmm2 #3463.26 vpshufd $85, %xmm11, %xmm1 #3462.16 vmovd %edx, %xmm3 #3464.26 vpshufd $85, %xmm10, %xmm5 #3461.16 - lea __svml_datan2_ha_data_internal(%rip), %rdx #3502.421 - vmovsd 1024+__svml_datan2_ha_data_internal(%rip), %xmm6 #3455.16 + lea __jsvml_datan2_ha_data_internal(%rip), %rdx #3502.421 + vmovsd 1024+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3455.16 vpsubd %xmm2, %xmm5, %xmm0 #3465.17 vpcmpeqd %xmm3, %xmm0, %xmm5 #3467.82 movl $8388607, %edi #3510.1633 @@ -2729,11 +2729,11 @@ __svml_atan21_ha_l9: vpcmpeqd %xmm3, %xmm12, %xmm12 #3468.82 vpor %xmm5, %xmm4, %xmm0 #3467.18 vpor %xmm12, %xmm2, %xmm3 #3468.18 - vmulsd 1344+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm4 #3478.15 + vmulsd 1344+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm4 #3478.15 vpor %xmm3, %xmm0, %xmm12 #3469.19 - vmulsd 1280+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm2 #3480.15 - vmulsd 1216+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm0 #3479.15 - vmulsd 1152+__svml_datan2_ha_data_internal(%rip), %xmm10, %xmm3 #3477.15 + vmulsd 1280+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm2 #3480.15 + vmulsd 1216+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm0 #3479.15 + vmulsd 1152+__jsvml_datan2_ha_data_internal(%rip), %xmm10, %xmm3 #3477.15 vpshufd $85, %xmm4, %xmm4 #3486.21 vpshufd $85, %xmm3, %xmm5 #3485.21 vpsubd %xmm1, %xmm4, %xmm4 #3490.29 @@ -2753,7 +2753,7 @@ __svml_atan21_ha_l9: vpaddd %xmm2, %xmm5, %xmm0 #3502.183 vpslld $5, %xmm0, %xmm3 #3502.183 vmovd %xmm3, %esi #3502.242 - vmovsd 3008+__svml_datan2_ha_data_internal(%rip), %xmm3 #3510.1286 + vmovsd 3008+__jsvml_datan2_ha_data_internal(%rip), %xmm3 #3510.1286 vmovmskps %xmm12, %ecx #3471.58 vmovq 24(%rdx,%rsi), %xmm2 #3505.418 vmovq (%rsi,%rdx), %xmm5 #3502.421 @@ -2779,31 +2779,31 @@ __svml_atan21_ha_l9: vpaddd %xmm0, %xmm2, %xmm2 #3510.2005 vpshufd $0, %xmm2, %xmm1 #3510.2005 vmovaps %xmm5, %xmm2 #3514.21 - vmovsd 1792+__svml_datan2_ha_data_internal(%rip), %xmm0 #3511.21 + vmovsd 1792+__jsvml_datan2_ha_data_internal(%rip), %xmm0 #3511.21 vandpd %xmm3, %xmm1, %xmm1 #3510.2108 vmovaps %xmm5, %xmm3 #3511.21 vfnmadd213sd %xmm0, %xmm1, %xmm3 #3511.21 vfmadd213sd %xmm3, %xmm3, %xmm3 #3512.21 vfmadd213sd %xmm1, %xmm3, %xmm1 #3513.18 vfnmadd213sd %xmm0, %xmm1, %xmm2 #3514.21 - vmovsd 1920+__svml_datan2_ha_data_internal(%rip), %xmm0 #3534.14 + vmovsd 1920+__jsvml_datan2_ha_data_internal(%rip), %xmm0 #3534.14 vfmadd213sd %xmm1, %xmm2, %xmm1 #3515.22 vmulsd %xmm4, %xmm1, %xmm3 #3516.17 vfnmadd213sd %xmm4, %xmm3, %xmm5 #3517.21 vmulsd %xmm3, %xmm3, %xmm2 #3531.14 vmulsd %xmm1, %xmm5, %xmm4 #3518.19 vmulsd %xmm2, %xmm2, %xmm5 #3532.14 - vmovsd 1856+__svml_datan2_ha_data_internal(%rip), %xmm1 #3533.14 - vfmadd213sd 1984+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3533.14 - vfmadd213sd 2048+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3534.14 - vfmadd213sd 2112+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3535.14 - vfmadd213sd 2176+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3536.14 - vfmadd213sd 2240+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3537.14 - vfmadd213sd 2304+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3538.14 - vfmadd213sd 2368+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3539.14 - vfmadd213sd 2432+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3540.14 - vfmadd213sd 2496+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3541.14 - vfmadd213sd 2560+__svml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3542.14 + vmovsd 1856+__jsvml_datan2_ha_data_internal(%rip), %xmm1 #3533.14 + vfmadd213sd 1984+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3533.14 + vfmadd213sd 2048+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3534.14 + vfmadd213sd 2112+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3535.14 + vfmadd213sd 2176+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3536.14 + vfmadd213sd 2240+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3537.14 + vfmadd213sd 2304+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3538.14 + vfmadd213sd 2368+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3539.14 + vfmadd213sd 2432+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3540.14 + vfmadd213sd 2496+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm1 #3541.14 + vfmadd213sd 2560+__jsvml_datan2_ha_data_internal(%rip), %xmm5, %xmm0 #3542.14 vfmadd213sd %xmm0, %xmm2, %xmm1 #3543.14 vxorpd %xmm7, %xmm6, %xmm0 #3545.16 vaddsd 16(%rdx,%rsi), %xmm4, %xmm6 #3546.19 @@ -2855,19 +2855,19 @@ __svml_atan21_ha_l9: lea (%rsp), %rdi #3627.663 lea 64(%rsp), %rsi #3627.663 lea 128(%rsp), %rdx #3627.663 -..___tag_value___svml_atan21_ha_l9.243: -# __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_datan2_ha_cout_rare_internal #3627.663 -..___tag_value___svml_atan21_ha_l9.244: +..___tag_value___jsvml_atan21_ha_l9.243: +# __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_datan2_ha_cout_rare_internal #3627.663 +..___tag_value___jsvml_atan21_ha_l9.244: jmp ..B9.5 # Prob 100% #3627.663 # LOE rbx r12 r13 r14 r15 ..B9.8: # Preds ..B9.1 # Execution count [5.00e-02]: Infreq - vmovsd 832+__svml_datan2_ha_data_internal(%rip), %xmm8 #3589.25 + vmovsd 832+__jsvml_datan2_ha_data_internal(%rip), %xmm8 #3589.25 vmovapd %xmm10, %xmm2 #3594.21 vandpd %xmm8, %xmm15, %xmm7 #3590.18 vandpd %xmm8, %xmm14, %xmm4 #3591.18 - vmovsd 3136+__svml_datan2_ha_data_internal(%rip), %xmm9 #3587.20 + vmovsd 3136+__jsvml_datan2_ha_data_internal(%rip), %xmm9 #3587.20 vcmpnltsd %xmm10, %xmm11, %xmm0 #3592.21 vcmpordsd %xmm15, %xmm15, %xmm1 #3595.19 vcmpordsd %xmm14, %xmm14, %xmm8 #3596.19 @@ -2887,7 +2887,7 @@ __svml_atan21_ha_l9: vpshufd $85, %xmm13, %xmm13 #3613.18 vpandn %xmm12, %xmm11, %xmm12 #3606.21 vpcmpgtd %xmm1, %xmm13, %xmm13 #3616.22 - vmovsd 3072+__svml_datan2_ha_data_internal(%rip), %xmm6 #3588.18 + vmovsd 3072+__jsvml_datan2_ha_data_internal(%rip), %xmm6 #3588.18 vpshufd $0, %xmm13, %xmm2 #3617.26 vandpd %xmm6, %xmm2, %xmm6 #3619.18 vmovmskps %xmm12, %eax #3607.44 @@ -2901,21 +2901,21 @@ __svml_atan21_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm5 xmm14 xmm15 .cfi_endproc # mark_end; - .type __svml_atan21_ha_l9,@function - .size __svml_atan21_ha_l9,.-__svml_atan21_ha_l9 -..LN__svml_atan21_ha_l9.8: + .type __jsvml_atan21_ha_l9,@function + .size __jsvml_atan21_ha_l9,.-__jsvml_atan21_ha_l9 +..LN__jsvml_atan21_ha_l9.8: .data -# -- End __svml_atan21_ha_l9 +# -- End __jsvml_atan21_ha_l9 .text -.L_2__routine_start___svml_datan2_ha_cout_rare_internal_9: -# -- Begin __svml_datan2_ha_cout_rare_internal +.L_2__routine_start___jsvml_datan2_ha_cout_rare_internal_9: +# -- Begin __jsvml_datan2_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_datan2_ha_cout_rare_internal - .globl __svml_datan2_ha_cout_rare_internal -# --- __svml_datan2_ha_cout_rare_internal(const double *, const double *, double *) -__svml_datan2_ha_cout_rare_internal: + .hidden __jsvml_datan2_ha_cout_rare_internal + .globl __jsvml_datan2_ha_cout_rare_internal +# --- __jsvml_datan2_ha_cout_rare_internal(const double *, const double *, double *) +__jsvml_datan2_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -2926,7 +2926,7 @@ __svml_datan2_ha_cout_rare_internal: .byte 30 #2742.139 .byte 250 #2742.139 .cfi_startproc -..___tag_value___svml_datan2_ha_cout_rare_internal.246: +..___tag_value___jsvml_datan2_ha_cout_rare_internal.246: ..L247: #2722.1 movq %rdx, %rcx #2722.1 @@ -3911,17 +3911,17 @@ __svml_datan2_ha_cout_rare_internal: # LOE rcx rbx rbp r12 r13 r14 r15 al dl .cfi_endproc # mark_end; - .type __svml_datan2_ha_cout_rare_internal,@function - .size __svml_datan2_ha_cout_rare_internal,.-__svml_datan2_ha_cout_rare_internal -..LN__svml_datan2_ha_cout_rare_internal.9: + .type __jsvml_datan2_ha_cout_rare_internal,@function + .size __jsvml_datan2_ha_cout_rare_internal,.-__jsvml_datan2_ha_cout_rare_internal +..LN__jsvml_datan2_ha_cout_rare_internal.9: .data -# -- End __svml_datan2_ha_cout_rare_internal +# -- End __jsvml_datan2_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_datan2_ha_data_internal - .globl __svml_datan2_ha_data_internal -__svml_datan2_ha_data_internal: + .hidden __jsvml_datan2_ha_data_internal + .globl __jsvml_datan2_ha_data_internal +__jsvml_datan2_ha_data_internal: .long 0 .long 1072693248 .long 1413754136 @@ -4754,8 +4754,8 @@ __svml_datan2_ha_data_internal: .long 0 .long 0 .long 0 - .type __svml_datan2_ha_data_internal,@object - .size __svml_datan2_ha_data_internal,3328 + .type __jsvml_datan2_ha_data_internal,@object + .size __jsvml_datan2_ha_data_internal,3328 .align 32 _vmldAtanHATab: .long 3892314112 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_atan_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_atan_linux_x86.S similarity index 87% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_atan_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_atan_linux_x86.S index b621f40b94e..26f3f3ee6e9 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_atan_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_atan_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_atan.c" .text ..TXTST0: -.L_2__routine_start___svml_atan2_ha_e9_0: -# -- Begin __svml_atan2_ha_e9 +.L_2__routine_start___jsvml_atan2_ha_e9_0: +# -- Begin __jsvml_atan2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2_ha_e9 -# --- __svml_atan2_ha_e9(__m128d) -__svml_atan2_ha_e9: + .globl __jsvml_atan2_ha_e9 +# --- __jsvml_atan2_ha_e9(__m128d) +__jsvml_atan2_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_atan2_ha_e9: .byte 30 #399.546 .byte 250 #399.546 .cfi_startproc -..___tag_value___svml_atan2_ha_e9.1: +..___tag_value___jsvml_atan2_ha_e9.1: ..L2: #249.1 pushq %rbp #249.1 @@ -58,21 +58,21 @@ __svml_atan2_ha_e9: andq $-64, %rsp #249.1 subq $192, %rsp #249.1 movaps %xmm0, %xmm10 #249.1 - movups 1152+__svml_datan_ha_data_internal(%rip), %xmm11 #301.51 - lea __svml_datan_ha_data_internal(%rip), %rsi #332.393 - movups 1344+__svml_datan_ha_data_internal(%rip), %xmm8 #304.59 + movups 1152+__jsvml_datan_ha_data_internal(%rip), %xmm11 #301.51 + lea __jsvml_datan_ha_data_internal(%rip), %rsi #332.393 + movups 1344+__jsvml_datan_ha_data_internal(%rip), %xmm8 #304.59 andps %xmm10, %xmm11 #302.14 movaps %xmm8, %xmm6 #305.19 movaps %xmm11, %xmm9 #303.17 pshufd $221, %xmm11, %xmm0 #308.20 andps %xmm11, %xmm6 #305.19 - movq 1600+__svml_datan_ha_data_internal(%rip), %xmm3 #320.33 + movq 1600+__jsvml_datan_ha_data_internal(%rip), %xmm3 #320.33 movaps %xmm11, %xmm7 #306.19 - movq 1536+__svml_datan_ha_data_internal(%rip), %xmm1 #322.33 + movq 1536+__jsvml_datan_ha_data_internal(%rip), %xmm1 #322.33 psubd %xmm0, %xmm3 #320.33 - movq 1472+__svml_datan_ha_data_internal(%rip), %xmm2 #321.33 + movq 1472+__jsvml_datan_ha_data_internal(%rip), %xmm2 #321.33 psubd %xmm0, %xmm1 #322.33 - movq 1408+__svml_datan_ha_data_internal(%rip), %xmm11 #319.33 + movq 1408+__jsvml_datan_ha_data_internal(%rip), %xmm11 #319.33 psubd %xmm0, %xmm2 #321.33 psubd %xmm0, %xmm11 #319.33 psrad $31, %xmm3 #324.32 @@ -82,14 +82,14 @@ __svml_atan2_ha_e9: paddd %xmm3, %xmm11 #332.187 paddd %xmm1, %xmm2 #332.187 movdqa %xmm0, %xmm14 #310.21 - movq 1664+__svml_datan_ha_data_internal(%rip), %xmm4 #330.23 + movq 1664+__jsvml_datan_ha_data_internal(%rip), %xmm4 #330.23 paddd %xmm2, %xmm11 #332.187 paddd %xmm4, %xmm11 #332.187 movaps %xmm8, %xmm1 #342.19 pslld $5, %xmm11 #332.187 pxor %xmm10, %xmm9 #303.17 movd %xmm11, %eax #332.250 - movq 2560+__svml_datan_ha_data_internal(%rip), %xmm12 #309.30 + movq 2560+__jsvml_datan_ha_data_internal(%rip), %xmm12 #309.30 psubd %xmm12, %xmm14 #310.21 movaps %xmm6, %xmm12 #336.20 pextrd $1, %xmm11, %ecx #332.318 @@ -103,7 +103,7 @@ __svml_atan2_ha_e9: movhpd 8(%rcx,%rsi), %xmm11 #333.596 andps %xmm11, %xmm12 #336.20 andps %xmm11, %xmm2 #338.20 - movups 1728+__svml_datan_ha_data_internal(%rip), %xmm5 #314.46 + movups 1728+__jsvml_datan_ha_data_internal(%rip), %xmm5 #314.46 subpd %xmm4, %xmm12 #337.20 mulpd %xmm7, %xmm4 #347.20 andps %xmm5, %xmm11 #345.20 @@ -115,7 +115,7 @@ __svml_atan2_ha_e9: subpd %xmm6, %xmm11 #349.23 subpd %xmm8, %xmm6 #352.22 addpd %xmm11, %xmm4 #350.20 - movq 2624+__svml_datan_ha_data_internal(%rip), %xmm13 #311.30 + movq 2624+__jsvml_datan_ha_data_internal(%rip), %xmm13 #311.30 pcmpgtd %xmm13, %xmm15 #312.36 pcmpeqd %xmm13, %xmm14 #312.94 movlhps %xmm7, %xmm7 #354.38 @@ -164,29 +164,29 @@ __svml_atan2_ha_e9: mulpd %xmm12, %xmm11 #367.14 movaps %xmm11, %xmm7 #368.14 mulpd %xmm11, %xmm7 #368.14 - movups 1792+__svml_datan_ha_data_internal(%rip), %xmm4 #373.26 + movups 1792+__jsvml_datan_ha_data_internal(%rip), %xmm4 #373.26 mulpd %xmm7, %xmm4 #373.26 - movups 1856+__svml_datan_ha_data_internal(%rip), %xmm2 #374.26 - addpd 1920+__svml_datan_ha_data_internal(%rip), %xmm4 #373.14 + movups 1856+__jsvml_datan_ha_data_internal(%rip), %xmm2 #374.26 + addpd 1920+__jsvml_datan_ha_data_internal(%rip), %xmm4 #373.14 mulpd %xmm7, %xmm2 #374.26 mulpd %xmm7, %xmm4 #377.26 - addpd 1984+__svml_datan_ha_data_internal(%rip), %xmm2 #374.14 - addpd 2048+__svml_datan_ha_data_internal(%rip), %xmm4 #377.14 + addpd 1984+__jsvml_datan_ha_data_internal(%rip), %xmm2 #374.14 + addpd 2048+__jsvml_datan_ha_data_internal(%rip), %xmm4 #377.14 mulpd %xmm7, %xmm2 #378.26 mulpd %xmm7, %xmm4 #381.26 - addpd 2112+__svml_datan_ha_data_internal(%rip), %xmm2 #378.14 - addpd 2176+__svml_datan_ha_data_internal(%rip), %xmm4 #381.14 + addpd 2112+__jsvml_datan_ha_data_internal(%rip), %xmm2 #378.14 + addpd 2176+__jsvml_datan_ha_data_internal(%rip), %xmm4 #381.14 mulpd %xmm7, %xmm2 #382.26 mulpd %xmm7, %xmm4 #385.26 - addpd 2240+__svml_datan_ha_data_internal(%rip), %xmm2 #382.14 - addpd 2304+__svml_datan_ha_data_internal(%rip), %xmm4 #385.14 + addpd 2240+__jsvml_datan_ha_data_internal(%rip), %xmm2 #382.14 + addpd 2304+__jsvml_datan_ha_data_internal(%rip), %xmm4 #385.14 mulpd %xmm7, %xmm2 #386.26 mulpd %xmm7, %xmm4 #389.26 - addpd 2368+__svml_datan_ha_data_internal(%rip), %xmm2 #386.14 - addpd 2432+__svml_datan_ha_data_internal(%rip), %xmm4 #389.14 + addpd 2368+__jsvml_datan_ha_data_internal(%rip), %xmm2 #386.14 + addpd 2432+__jsvml_datan_ha_data_internal(%rip), %xmm4 #389.14 mulpd %xmm2, %xmm7 #390.26 mulpd %xmm11, %xmm4 #391.26 - addpd 2496+__svml_datan_ha_data_internal(%rip), %xmm7 #390.14 + addpd 2496+__jsvml_datan_ha_data_internal(%rip), %xmm7 #390.14 addpd %xmm4, %xmm7 #391.14 mulpd %xmm7, %xmm11 #392.14 mulpd %xmm11, %xmm12 #394.26 @@ -251,29 +251,29 @@ __svml_atan2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #399.546 lea 128(%rsp,%r12,8), %rsi #399.546 -..___tag_value___svml_atan2_ha_e9.19: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #399.546 -..___tag_value___svml_atan2_ha_e9.20: +..___tag_value___jsvml_atan2_ha_e9.19: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #399.546 +..___tag_value___jsvml_atan2_ha_e9.20: jmp ..B1.8 # Prob 100% #399.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atan2_ha_e9,@function - .size __svml_atan2_ha_e9,.-__svml_atan2_ha_e9 -..LN__svml_atan2_ha_e9.0: + .type __jsvml_atan2_ha_e9,@function + .size __jsvml_atan2_ha_e9,.-__jsvml_atan2_ha_e9 +..LN__jsvml_atan2_ha_e9.0: .data -# -- End __svml_atan2_ha_e9 +# -- End __jsvml_atan2_ha_e9 .text -.L_2__routine_start___svml_atan1_ha_e9_1: -# -- Begin __svml_atan1_ha_e9 +.L_2__routine_start___jsvml_atan1_ha_e9_1: +# -- Begin __jsvml_atan1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan1_ha_e9 -# --- __svml_atan1_ha_e9(__m128d) -__svml_atan1_ha_e9: + .globl __jsvml_atan1_ha_e9 +# --- __jsvml_atan1_ha_e9(__m128d) +__jsvml_atan1_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -282,7 +282,7 @@ __svml_atan1_ha_e9: .byte 30 #557.546 .byte 250 #557.546 .cfi_startproc -..___tag_value___svml_atan1_ha_e9.22: +..___tag_value___jsvml_atan1_ha_e9.22: ..L23: #407.1 pushq %rbp #407.1 @@ -297,9 +297,9 @@ __svml_atan1_ha_e9: movl $1072889856, %edi #479.33 movl $1073971200, %r8d #480.33 movaps %xmm0, %xmm8 #407.1 - movsd 1152+__svml_datan_ha_data_internal(%rip), %xmm9 #459.20 + movsd 1152+__jsvml_datan_ha_data_internal(%rip), %xmm9 #459.20 movl $4, %r9d #490.187 - movsd 1344+__svml_datan_ha_data_internal(%rip), %xmm6 #462.28 + movsd 1344+__jsvml_datan_ha_data_internal(%rip), %xmm6 #462.28 andps %xmm8, %xmm9 #460.14 movaps %xmm6, %xmm0 #463.19 movaps %xmm9, %xmm7 #461.17 @@ -324,7 +324,7 @@ __svml_atan1_ha_e9: paddd %xmm1, %xmm9 #490.187 movl $-2144337920, %eax #468.21 paddd %xmm2, %xmm9 #490.187 - lea __svml_datan_ha_data_internal(%rip), %r11 #490.433 + lea __jsvml_datan_ha_data_internal(%rip), %r11 #490.433 pslld $5, %xmm9 #490.187 movl $-36700160, %edx #469.30 movd %xmm9, %r10d #490.250 @@ -343,7 +343,7 @@ __svml_atan1_ha_e9: pcmpeqd %xmm11, %xmm12 #470.94 por %xmm12, %xmm13 #470.22 movmskps %xmm13, %eax #471.44 - movsd 1728+__svml_datan_ha_data_internal(%rip), %xmm4 #472.15 + movsd 1728+__jsvml_datan_ha_data_internal(%rip), %xmm4 #472.15 movq 8(%r11,%r10), %xmm13 #491.430 movdqa %xmm13, %xmm10 #494.20 movdqa %xmm13, %xmm12 #496.20 @@ -380,7 +380,7 @@ __svml_atan1_ha_e9: mulsd %xmm3, %xmm9 #523.31 movaps %xmm2, %xmm5 #515.31 mulsd %xmm2, %xmm5 #515.31 - movsd 1792+__svml_datan_ha_data_internal(%rip), %xmm10 #531.26 + movsd 1792+__jsvml_datan_ha_data_internal(%rip), %xmm10 #531.26 subsd %xmm2, %xmm5 #515.19 mulsd %xmm2, %xmm5 #516.31 addsd %xmm2, %xmm5 #516.19 @@ -396,7 +396,7 @@ __svml_atan1_ha_e9: movaps %xmm0, %xmm6 #524.17 mulsd %xmm1, %xmm4 #521.18 mulsd %xmm3, %xmm5 #522.30 - movsd 1856+__svml_datan_ha_data_internal(%rip), %xmm3 #532.26 + movsd 1856+__jsvml_datan_ha_data_internal(%rip), %xmm3 #532.26 addsd %xmm4, %xmm5 #522.18 addsd %xmm5, %xmm9 #523.19 addsd %xmm9, %xmm6 #524.17 @@ -407,24 +407,24 @@ __svml_atan1_ha_e9: mulsd %xmm2, %xmm1 #526.14 mulsd %xmm1, %xmm10 #531.26 mulsd %xmm1, %xmm3 #532.26 - addsd 1920+__svml_datan_ha_data_internal(%rip), %xmm10 #531.14 - addsd 1984+__svml_datan_ha_data_internal(%rip), %xmm3 #532.14 + addsd 1920+__jsvml_datan_ha_data_internal(%rip), %xmm10 #531.14 + addsd 1984+__jsvml_datan_ha_data_internal(%rip), %xmm3 #532.14 mulsd %xmm1, %xmm10 #535.26 mulsd %xmm1, %xmm3 #536.26 - addsd 2048+__svml_datan_ha_data_internal(%rip), %xmm10 #535.14 - addsd 2112+__svml_datan_ha_data_internal(%rip), %xmm3 #536.14 + addsd 2048+__jsvml_datan_ha_data_internal(%rip), %xmm10 #535.14 + addsd 2112+__jsvml_datan_ha_data_internal(%rip), %xmm3 #536.14 mulsd %xmm1, %xmm10 #539.26 mulsd %xmm1, %xmm3 #540.26 - addsd 2176+__svml_datan_ha_data_internal(%rip), %xmm10 #539.14 - addsd 2240+__svml_datan_ha_data_internal(%rip), %xmm3 #540.14 + addsd 2176+__jsvml_datan_ha_data_internal(%rip), %xmm10 #539.14 + addsd 2240+__jsvml_datan_ha_data_internal(%rip), %xmm3 #540.14 mulsd %xmm1, %xmm10 #543.26 mulsd %xmm1, %xmm3 #544.26 - addsd 2304+__svml_datan_ha_data_internal(%rip), %xmm10 #543.14 - addsd 2368+__svml_datan_ha_data_internal(%rip), %xmm3 #544.14 + addsd 2304+__jsvml_datan_ha_data_internal(%rip), %xmm10 #543.14 + addsd 2368+__jsvml_datan_ha_data_internal(%rip), %xmm3 #544.14 mulsd %xmm1, %xmm10 #547.26 mulsd %xmm1, %xmm3 #548.26 - addsd 2432+__svml_datan_ha_data_internal(%rip), %xmm10 #547.14 - addsd 2496+__svml_datan_ha_data_internal(%rip), %xmm3 #548.14 + addsd 2432+__jsvml_datan_ha_data_internal(%rip), %xmm10 #547.14 + addsd 2496+__jsvml_datan_ha_data_internal(%rip), %xmm3 #548.14 mulsd %xmm2, %xmm10 #549.26 addsd %xmm3, %xmm10 #549.14 mulsd %xmm2, %xmm10 #550.14 @@ -467,29 +467,29 @@ __svml_atan1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #557.546 lea 64(%rsp), %rsi #557.546 -..___tag_value___svml_atan1_ha_e9.35: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #557.546 -..___tag_value___svml_atan1_ha_e9.36: +..___tag_value___jsvml_atan1_ha_e9.35: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #557.546 +..___tag_value___jsvml_atan1_ha_e9.36: jmp ..B2.4 # Prob 100% #557.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_atan1_ha_e9,@function - .size __svml_atan1_ha_e9,.-__svml_atan1_ha_e9 -..LN__svml_atan1_ha_e9.1: + .type __jsvml_atan1_ha_e9,@function + .size __jsvml_atan1_ha_e9,.-__jsvml_atan1_ha_e9 +..LN__jsvml_atan1_ha_e9.1: .data -# -- End __svml_atan1_ha_e9 +# -- End __jsvml_atan1_ha_e9 .text -.L_2__routine_start___svml_atan4_ha_e9_2: -# -- Begin __svml_atan4_ha_e9 +.L_2__routine_start___jsvml_atan4_ha_e9_2: +# -- Begin __jsvml_atan4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan4_ha_e9 -# --- __svml_atan4_ha_e9(__m256d) -__svml_atan4_ha_e9: + .globl __jsvml_atan4_ha_e9 +# --- __jsvml_atan4_ha_e9(__m256d) +__jsvml_atan4_ha_e9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -498,7 +498,7 @@ __svml_atan4_ha_e9: .byte 30 #715.552 .byte 250 #715.552 .cfi_startproc -..___tag_value___svml_atan4_ha_e9.38: +..___tag_value___jsvml_atan4_ha_e9.38: ..L39: #565.1 pushq %rbp #565.1 @@ -508,27 +508,27 @@ __svml_atan4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #565.1 subq $192, %rsp #565.1 - lea __svml_datan_ha_data_internal(%rip), %r8 #648.537 - vmovupd 1344+__svml_datan_ha_data_internal(%rip), %ymm5 #620.62 - vmovups 2624+__svml_datan_ha_data_internal(%rip), %xmm10 #627.30 - vmovups 1408+__svml_datan_ha_data_internal(%rip), %xmm13 #631.33 - vmovupd 1728+__svml_datan_ha_data_internal(%rip), %ymm7 #630.49 + lea __jsvml_datan_ha_data_internal(%rip), %r8 #648.537 + vmovupd 1344+__jsvml_datan_ha_data_internal(%rip), %ymm5 #620.62 + vmovups 2624+__jsvml_datan_ha_data_internal(%rip), %xmm10 #627.30 + vmovups 1408+__jsvml_datan_ha_data_internal(%rip), %xmm13 #631.33 + vmovupd 1728+__jsvml_datan_ha_data_internal(%rip), %ymm7 #630.49 vmovapd %ymm0, %ymm3 #565.1 - vandpd 1152+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm1 #618.14 + vandpd 1152+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm1 #618.14 vandpd %ymm5, %ymm1, %ymm6 #621.19 vxorpd %ymm1, %ymm3, %ymm2 #619.17 vsubpd %ymm6, %ymm1, %ymm8 #622.19 vextractf128 $1, %ymm1, %xmm4 #623.107 vshufps $221, %xmm4, %xmm1, %xmm0 #624.38 - vpsubd 2560+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm12 #626.21 + vpsubd 2560+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm12 #626.21 vpsubd %xmm0, %xmm13, %xmm15 #635.33 vpcmpgtd %xmm10, %xmm12, %xmm11 #628.36 vpcmpeqd %xmm10, %xmm12, %xmm9 #628.94 - vmovups 1600+__svml_datan_ha_data_internal(%rip), %xmm1 #634.33 + vmovups 1600+__jsvml_datan_ha_data_internal(%rip), %xmm1 #634.33 vpor %xmm9, %xmm11, %xmm14 #628.22 - vmovups 1536+__svml_datan_ha_data_internal(%rip), %xmm11 #633.33 + vmovups 1536+__jsvml_datan_ha_data_internal(%rip), %xmm11 #633.33 vpsubd %xmm0, %xmm1, %xmm4 #636.33 - vmovups 1472+__svml_datan_ha_data_internal(%rip), %xmm12 #632.33 + vmovups 1472+__jsvml_datan_ha_data_internal(%rip), %xmm12 #632.33 vpsrad $31, %xmm15, %xmm15 #639.32 vpsubd %xmm0, %xmm12, %xmm10 #637.33 vpsubd %xmm0, %xmm11, %xmm0 #638.33 @@ -539,7 +539,7 @@ __svml_atan4_ha_e9: vpaddd %xmm9, %xmm15, %xmm15 #648.187 vpaddd %xmm13, %xmm14, %xmm0 #648.187 vpaddd %xmm0, %xmm15, %xmm1 #648.187 - vpaddd 1664+__svml_datan_ha_data_internal(%rip), %xmm1, %xmm4 #648.187 + vpaddd 1664+__jsvml_datan_ha_data_internal(%rip), %xmm1, %xmm4 #648.187 vpslld $5, %xmm4, %xmm11 #648.187 vmovd %xmm11, %edx #648.250 vpextrd $2, %xmm11, %esi #648.389 @@ -612,26 +612,26 @@ __svml_atan4_ha_e9: vaddpd %ymm8, %ymm1, %ymm1 #709.19 vmulpd %ymm6, %ymm6, %ymm5 #683.14 vmulpd %ymm5, %ymm5, %ymm4 #684.14 - vmulpd 1792+__svml_datan_ha_data_internal(%rip), %ymm4, %ymm10 #689.29 - vmulpd 1856+__svml_datan_ha_data_internal(%rip), %ymm4, %ymm12 #690.29 - vaddpd 1920+__svml_datan_ha_data_internal(%rip), %ymm10, %ymm13 #689.14 - vaddpd 1984+__svml_datan_ha_data_internal(%rip), %ymm12, %ymm9 #690.14 + vmulpd 1792+__jsvml_datan_ha_data_internal(%rip), %ymm4, %ymm10 #689.29 + vmulpd 1856+__jsvml_datan_ha_data_internal(%rip), %ymm4, %ymm12 #690.29 + vaddpd 1920+__jsvml_datan_ha_data_internal(%rip), %ymm10, %ymm13 #689.14 + vaddpd 1984+__jsvml_datan_ha_data_internal(%rip), %ymm12, %ymm9 #690.14 vmulpd %ymm13, %ymm4, %ymm14 #693.29 vmulpd %ymm9, %ymm4, %ymm10 #694.29 - vaddpd 2048+__svml_datan_ha_data_internal(%rip), %ymm14, %ymm11 #693.14 - vaddpd 2112+__svml_datan_ha_data_internal(%rip), %ymm10, %ymm13 #694.14 + vaddpd 2048+__jsvml_datan_ha_data_internal(%rip), %ymm14, %ymm11 #693.14 + vaddpd 2112+__jsvml_datan_ha_data_internal(%rip), %ymm10, %ymm13 #694.14 vmulpd %ymm11, %ymm4, %ymm12 #697.29 vmulpd %ymm13, %ymm4, %ymm14 #698.29 - vaddpd 2176+__svml_datan_ha_data_internal(%rip), %ymm12, %ymm15 #697.14 - vaddpd 2240+__svml_datan_ha_data_internal(%rip), %ymm14, %ymm9 #698.14 + vaddpd 2176+__jsvml_datan_ha_data_internal(%rip), %ymm12, %ymm15 #697.14 + vaddpd 2240+__jsvml_datan_ha_data_internal(%rip), %ymm14, %ymm9 #698.14 vmulpd %ymm15, %ymm4, %ymm15 #701.29 vmulpd %ymm9, %ymm4, %ymm10 #702.29 - vaddpd 2304+__svml_datan_ha_data_internal(%rip), %ymm15, %ymm11 #701.14 - vaddpd 2368+__svml_datan_ha_data_internal(%rip), %ymm10, %ymm13 #702.14 + vaddpd 2304+__jsvml_datan_ha_data_internal(%rip), %ymm15, %ymm11 #701.14 + vaddpd 2368+__jsvml_datan_ha_data_internal(%rip), %ymm10, %ymm13 #702.14 vmulpd %ymm11, %ymm4, %ymm12 #705.29 vmulpd %ymm13, %ymm4, %ymm4 #706.29 - vaddpd 2432+__svml_datan_ha_data_internal(%rip), %ymm12, %ymm14 #705.14 - vaddpd 2496+__svml_datan_ha_data_internal(%rip), %ymm4, %ymm4 #706.14 + vaddpd 2432+__jsvml_datan_ha_data_internal(%rip), %ymm12, %ymm14 #705.14 + vaddpd 2496+__jsvml_datan_ha_data_internal(%rip), %ymm4, %ymm4 #706.14 vmulpd %ymm14, %ymm5, %ymm9 #707.29 vaddpd %ymm9, %ymm4, %ymm10 #707.14 vmulpd %ymm10, %ymm5, %ymm5 #708.14 @@ -699,29 +699,29 @@ __svml_atan4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #715.552 lea 128(%rsp,%r12,8), %rsi #715.552 -..___tag_value___svml_atan4_ha_e9.56: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #715.552 -..___tag_value___svml_atan4_ha_e9.57: +..___tag_value___jsvml_atan4_ha_e9.56: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #715.552 +..___tag_value___jsvml_atan4_ha_e9.57: jmp ..B3.8 # Prob 100% #715.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atan4_ha_e9,@function - .size __svml_atan4_ha_e9,.-__svml_atan4_ha_e9 -..LN__svml_atan4_ha_e9.2: + .type __jsvml_atan4_ha_e9,@function + .size __jsvml_atan4_ha_e9,.-__jsvml_atan4_ha_e9 +..LN__jsvml_atan4_ha_e9.2: .data -# -- End __svml_atan4_ha_e9 +# -- End __jsvml_atan4_ha_e9 .text -.L_2__routine_start___svml_atan8_ha_z0_3: -# -- Begin __svml_atan8_ha_z0 +.L_2__routine_start___jsvml_atan8_ha_z0_3: +# -- Begin __jsvml_atan8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_atan8_ha_z0 -# --- __svml_atan8_ha_z0(__m512d) -__svml_atan8_ha_z0: + .globl __jsvml_atan8_ha_z0 +# --- __jsvml_atan8_ha_z0(__m512d) +__jsvml_atan8_ha_z0: # parameter 1: %zmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -730,37 +730,37 @@ __svml_atan8_ha_z0: .byte 30 #846.12 .byte 250 #846.12 .cfi_startproc -..___tag_value___svml_atan8_ha_z0.59: +..___tag_value___jsvml_atan8_ha_z0.59: ..L60: #723.1 - vmovups 128+__svml_datan_ha_data_internal_avx512(%rip), %zmm8 #783.55 - vmovups 320+__svml_datan_ha_data_internal_avx512(%rip), %zmm9 #785.49 - vmovups 64+__svml_datan_ha_data_internal_avx512(%rip), %zmm10 #781.50 - vmovups 256+__svml_datan_ha_data_internal_avx512(%rip), %zmm15 #791.46 - vmovups 192+__svml_datan_ha_data_internal_avx512(%rip), %zmm2 #790.16 - vandpd __svml_datan_ha_data_internal_avx512(%rip), %zmm0, %zmm3 #780.12 + vmovups 128+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm8 #783.55 + vmovups 320+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm9 #785.49 + vmovups 64+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm10 #781.50 + vmovups 256+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm15 #791.46 + vmovups 192+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm2 #790.16 + vandpd __jsvml_datan_ha_data_internal_avx512(%rip), %zmm0, %zmm3 #780.12 vcmppd $17, {sae}, %zmm8, %zmm3, %k1 #784.20 vminpd {sae}, %zmm3, %zmm9, %zmm7 #786.14 - vmovups 960+__svml_datan_ha_data_internal_avx512(%rip), %zmm8 #810.52 - vmovups 448+__svml_datan_ha_data_internal_avx512(%rip), %zmm9 #808.280 + vmovups 960+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm8 #810.52 + vmovups 448+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm9 #808.280 vreducepd $40, {sae}, %zmm3, %zmm2{%k1} #790.16 vaddpd {rn-sae}, %zmm10, %zmm3, %zmm5 #782.19 vxorpd %zmm0, %zmm3, %zmm6 #788.15 knotw %k1, %k3 #800.20 vsubpd {rn-sae}, %zmm10, %zmm5, %zmm11 #789.15 - vpermt2pd 512+__svml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm9 #808.280 - vmovups 576+__svml_datan_ha_data_internal_avx512(%rip), %zmm10 #809.287 + vpermt2pd 512+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm9 #808.280 + vmovups 576+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm10 #809.287 vfmadd213pd {rn-sae}, %zmm15, %zmm11, %zmm7{%k1} #792.12 vcmppd $29, {sae}, %zmm8, %zmm5, %k2 #811.19 - vmovups 1344+__svml_datan_ha_data_internal_avx512(%rip), %zmm8 #826.14 + vmovups 1344+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm8 #826.14 vrcp14pd %zmm7, %zmm0 #794.14 vsubpd {rn-sae}, %zmm15, %zmm7, %zmm12 #793.17 - vpermt2pd 640+__svml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm10 #809.287 + vpermt2pd 640+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm10 #809.287 vfmsub213pd {rn-sae}, %zmm12, %zmm11, %zmm3 #795.15 - vmovups 704+__svml_datan_ha_data_internal_avx512(%rip), %zmm11 #812.284 - vmovups 832+__svml_datan_ha_data_internal_avx512(%rip), %zmm12 #813.291 - vpermt2pd 768+__svml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm11 #812.284 - vpermt2pd 896+__svml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm12 #813.291 + vmovups 704+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm11 #812.284 + vmovups 832+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm12 #813.291 + vpermt2pd 768+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm11 #812.284 + vpermt2pd 896+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm12 #813.291 vblendmpd %zmm10, %zmm9, %zmm5{%k2} #814.14 vmovaps %zmm15, %zmm13 #796.14 vfnmadd231pd {rn-sae}, %zmm7, %zmm0, %zmm13 #796.14 @@ -768,26 +768,26 @@ __svml_atan8_ha_z0: vfmadd213pd {rn-sae}, %zmm0, %zmm13, %zmm0 #797.14 vblendmpd %zmm12, %zmm11, %zmm13{%k2} #815.18 vfmadd213pd {rn-sae}, %zmm0, %zmm14, %zmm0 #799.15 - vmovups 1152+__svml_datan_ha_data_internal_avx512(%rip), %zmm14 #821.51 + vmovups 1152+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm14 #821.51 vmulpd {rn-sae}, %zmm2, %zmm0, %zmm4 #801.14 vmulpd {rn-sae}, %zmm0, %zmm3, %zmm1 #803.18 vfnmadd213pd {rn-sae}, %zmm15, %zmm0, %zmm7 #802.14 - vmovups 1216+__svml_datan_ha_data_internal_avx512(%rip), %zmm3 #823.14 - vmovups 1280+__svml_datan_ha_data_internal_avx512(%rip), %zmm15 #824.51 + vmovups 1216+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm3 #823.14 + vmovups 1280+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm15 #824.51 vfmsub213pd {rn-sae}, %zmm4, %zmm0, %zmm2 #804.13 vfmadd213pd {rn-sae}, %zmm2, %zmm4, %zmm7 #805.13 vmulpd {rn-sae}, %zmm4, %zmm4, %zmm2 #820.15 vfnmadd231pd {rn-sae}, %zmm4, %zmm1, %zmm7{%k1} #806.13 - vblendmpd 1024+__svml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm1{%k3} #818.14 - vblendmpd 1088+__svml_datan_ha_data_internal_avx512(%rip), %zmm13, %zmm5{%k3} #819.18 + vblendmpd 1024+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm5, %zmm1{%k3} #818.14 + vblendmpd 1088+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm13, %zmm5{%k3} #819.18 vmulpd {rn-sae}, %zmm2, %zmm2, %zmm9 #827.15 vmulpd {rn-sae}, %zmm4, %zmm2, %zmm11 #830.15 vfmadd231pd {rn-sae}, %zmm2, %zmm14, %zmm3 #823.14 vfmadd231pd {rn-sae}, %zmm2, %zmm15, %zmm8 #826.14 vaddpd {rn-sae}, %zmm5, %zmm7, %zmm10 #829.15 vaddpd {rn-sae}, %zmm4, %zmm1, %zmm0 #828.17 - vmovups 1408+__svml_datan_ha_data_internal_avx512(%rip), %zmm7 #831.51 - vmovups 1472+__svml_datan_ha_data_internal_avx512(%rip), %zmm5 #832.51 + vmovups 1408+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm7 #831.51 + vmovups 1472+__jsvml_datan_ha_data_internal_avx512(%rip), %zmm5 #832.51 vfmadd213pd {rn-sae}, %zmm8, %zmm9, %zmm3 #834.14 vsubpd {rn-sae}, %zmm1, %zmm0, %zmm1 #835.15 vfmadd213pd {rn-sae}, %zmm5, %zmm7, %zmm2 #833.14 @@ -802,20 +802,20 @@ __svml_atan8_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_atan8_ha_z0,@function - .size __svml_atan8_ha_z0,.-__svml_atan8_ha_z0 -..LN__svml_atan8_ha_z0.3: + .type __jsvml_atan8_ha_z0,@function + .size __jsvml_atan8_ha_z0,.-__jsvml_atan8_ha_z0 +..LN__jsvml_atan8_ha_z0.3: .data -# -- End __svml_atan8_ha_z0 +# -- End __jsvml_atan8_ha_z0 .text -.L_2__routine_start___svml_atan2_ha_ex_4: -# -- Begin __svml_atan2_ha_ex +.L_2__routine_start___jsvml_atan2_ha_ex_4: +# -- Begin __jsvml_atan2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_atan2_ha_ex -# --- __svml_atan2_ha_ex(__m128d) -__svml_atan2_ha_ex: + .globl __jsvml_atan2_ha_ex +# --- __jsvml_atan2_ha_ex(__m128d) +__jsvml_atan2_ha_ex: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -824,7 +824,7 @@ __svml_atan2_ha_ex: .byte 30 #1353.546 .byte 250 #1353.546 .cfi_startproc -..___tag_value___svml_atan2_ha_ex.62: +..___tag_value___jsvml_atan2_ha_ex.62: ..L63: #1203.1 pushq %rbp #1203.1 @@ -835,21 +835,21 @@ __svml_atan2_ha_ex: andq $-64, %rsp #1203.1 subq $192, %rsp #1203.1 movaps %xmm0, %xmm10 #1203.1 - movups 1152+__svml_datan_ha_data_internal(%rip), %xmm11 #1255.51 - lea __svml_datan_ha_data_internal(%rip), %rsi #1286.408 - movups 1344+__svml_datan_ha_data_internal(%rip), %xmm8 #1258.59 + movups 1152+__jsvml_datan_ha_data_internal(%rip), %xmm11 #1255.51 + lea __jsvml_datan_ha_data_internal(%rip), %rsi #1286.408 + movups 1344+__jsvml_datan_ha_data_internal(%rip), %xmm8 #1258.59 andps %xmm10, %xmm11 #1256.14 movaps %xmm8, %xmm6 #1259.19 movaps %xmm11, %xmm9 #1257.17 pshufd $221, %xmm11, %xmm0 #1262.14 andps %xmm11, %xmm6 #1259.19 - movq 1600+__svml_datan_ha_data_internal(%rip), %xmm3 #1274.27 + movq 1600+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1274.27 movaps %xmm11, %xmm7 #1260.19 - movq 1536+__svml_datan_ha_data_internal(%rip), %xmm1 #1276.27 + movq 1536+__jsvml_datan_ha_data_internal(%rip), %xmm1 #1276.27 psubd %xmm0, %xmm3 #1274.27 - movq 1472+__svml_datan_ha_data_internal(%rip), %xmm2 #1275.27 + movq 1472+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1275.27 psubd %xmm0, %xmm1 #1276.27 - movq 1408+__svml_datan_ha_data_internal(%rip), %xmm11 #1273.27 + movq 1408+__jsvml_datan_ha_data_internal(%rip), %xmm11 #1273.27 psubd %xmm0, %xmm2 #1275.27 psubd %xmm0, %xmm11 #1273.27 psrad $31, %xmm3 #1278.26 @@ -859,17 +859,17 @@ __svml_atan2_ha_ex: paddd %xmm3, %xmm11 #1286.181 paddd %xmm1, %xmm2 #1286.181 movdqa %xmm0, %xmm14 #1264.15 - movq 1664+__svml_datan_ha_data_internal(%rip), %xmm4 #1284.17 + movq 1664+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1284.17 paddd %xmm2, %xmm11 #1286.181 paddd %xmm4, %xmm11 #1286.181 movaps %xmm8, %xmm1 #1296.19 - movq 2560+__svml_datan_ha_data_internal(%rip), %xmm12 #1263.24 + movq 2560+__jsvml_datan_ha_data_internal(%rip), %xmm12 #1263.24 pslld $5, %xmm11 #1286.181 movd %xmm11, %eax #1286.238 psubd %xmm12, %xmm14 #1264.15 pshufd $1, %xmm11, %xmm12 #1286.319 movdqa %xmm14, %xmm15 #1266.30 - movq 2624+__svml_datan_ha_data_internal(%rip), %xmm13 #1265.24 + movq 2624+__jsvml_datan_ha_data_internal(%rip), %xmm13 #1265.24 pxor %xmm10, %xmm9 #1257.17 movd %xmm12, %ecx #1286.300 pcmpgtd %xmm13, %xmm15 #1266.30 @@ -886,7 +886,7 @@ __svml_atan2_ha_ex: movhpd 8(%rcx,%rsi), %xmm12 #1287.611 andps %xmm12, %xmm13 #1290.20 andps %xmm12, %xmm2 #1292.20 - movups 1728+__svml_datan_ha_data_internal(%rip), %xmm5 #1268.46 + movups 1728+__jsvml_datan_ha_data_internal(%rip), %xmm5 #1268.46 subpd %xmm4, %xmm13 #1291.20 mulpd %xmm7, %xmm4 #1301.20 andps %xmm5, %xmm12 #1299.20 @@ -939,29 +939,29 @@ __svml_atan2_ha_ex: mulpd %xmm12, %xmm11 #1321.14 movaps %xmm11, %xmm7 #1322.14 mulpd %xmm11, %xmm7 #1322.14 - movups 1792+__svml_datan_ha_data_internal(%rip), %xmm4 #1327.26 + movups 1792+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1327.26 mulpd %xmm7, %xmm4 #1327.26 - movups 1856+__svml_datan_ha_data_internal(%rip), %xmm2 #1328.26 - addpd 1920+__svml_datan_ha_data_internal(%rip), %xmm4 #1327.14 + movups 1856+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1328.26 + addpd 1920+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1327.14 mulpd %xmm7, %xmm2 #1328.26 mulpd %xmm7, %xmm4 #1331.26 - addpd 1984+__svml_datan_ha_data_internal(%rip), %xmm2 #1328.14 - addpd 2048+__svml_datan_ha_data_internal(%rip), %xmm4 #1331.14 + addpd 1984+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1328.14 + addpd 2048+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1331.14 mulpd %xmm7, %xmm2 #1332.26 mulpd %xmm7, %xmm4 #1335.26 - addpd 2112+__svml_datan_ha_data_internal(%rip), %xmm2 #1332.14 - addpd 2176+__svml_datan_ha_data_internal(%rip), %xmm4 #1335.14 + addpd 2112+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1332.14 + addpd 2176+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1335.14 mulpd %xmm7, %xmm2 #1336.26 mulpd %xmm7, %xmm4 #1339.26 - addpd 2240+__svml_datan_ha_data_internal(%rip), %xmm2 #1336.14 - addpd 2304+__svml_datan_ha_data_internal(%rip), %xmm4 #1339.14 + addpd 2240+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1336.14 + addpd 2304+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1339.14 mulpd %xmm7, %xmm2 #1340.26 mulpd %xmm7, %xmm4 #1343.26 - addpd 2368+__svml_datan_ha_data_internal(%rip), %xmm2 #1340.14 - addpd 2432+__svml_datan_ha_data_internal(%rip), %xmm4 #1343.14 + addpd 2368+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1340.14 + addpd 2432+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1343.14 mulpd %xmm2, %xmm7 #1344.26 mulpd %xmm11, %xmm4 #1345.26 - addpd 2496+__svml_datan_ha_data_internal(%rip), %xmm7 #1344.14 + addpd 2496+__jsvml_datan_ha_data_internal(%rip), %xmm7 #1344.14 addpd %xmm4, %xmm7 #1345.14 mulpd %xmm7, %xmm11 #1346.14 mulpd %xmm11, %xmm12 #1348.26 @@ -1029,29 +1029,29 @@ __svml_atan2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1353.546 lea 128(%rsp,%r12,8), %rsi #1353.546 -..___tag_value___svml_atan2_ha_ex.80: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #1353.546 -..___tag_value___svml_atan2_ha_ex.81: +..___tag_value___jsvml_atan2_ha_ex.80: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #1353.546 +..___tag_value___jsvml_atan2_ha_ex.81: jmp ..B5.8 # Prob 100% #1353.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atan2_ha_ex,@function - .size __svml_atan2_ha_ex,.-__svml_atan2_ha_ex -..LN__svml_atan2_ha_ex.4: + .type __jsvml_atan2_ha_ex,@function + .size __jsvml_atan2_ha_ex,.-__jsvml_atan2_ha_ex +..LN__jsvml_atan2_ha_ex.4: .data -# -- End __svml_atan2_ha_ex +# -- End __jsvml_atan2_ha_ex .text -.L_2__routine_start___svml_atan1_ha_l9_5: -# -- Begin __svml_atan1_ha_l9 +.L_2__routine_start___jsvml_atan1_ha_l9_5: +# -- Begin __jsvml_atan1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan1_ha_l9 -# --- __svml_atan1_ha_l9(__m128d) -__svml_atan1_ha_l9: + .globl __jsvml_atan1_ha_l9 +# --- __jsvml_atan1_ha_l9(__m128d) +__jsvml_atan1_ha_l9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -1060,7 +1060,7 @@ __svml_atan1_ha_l9: .byte 30 #1490.546 .byte 250 #1490.546 .cfi_startproc -..___tag_value___svml_atan1_ha_l9.83: +..___tag_value___jsvml_atan1_ha_l9.83: ..L84: #1361.1 pushq %rbp #1361.1 @@ -1077,7 +1077,7 @@ __svml_atan1_ha_l9: movl $1072889856, %edi #1430.29 movl $1073971200, %r8d #1431.29 vmovapd %xmm0, %xmm4 #1361.1 - vmovsd 1152+__svml_datan_ha_data_internal(%rip), %xmm5 #1413.20 + vmovsd 1152+__jsvml_datan_ha_data_internal(%rip), %xmm5 #1413.20 vmovd %eax, %xmm6 #1419.17 vandpd %xmm5, %xmm4, %xmm2 #1414.14 vmovd %esi, %xmm14 #1429.29 @@ -1106,10 +1106,10 @@ __svml_atan1_ha_l9: vpaddd %xmm11, %xmm10, %xmm12 #1441.183 vxorpd %xmm2, %xmm4, %xmm3 #1415.17 vpaddd %xmm13, %xmm12, %xmm1 #1441.183 - lea __svml_datan_ha_data_internal(%rip), %r11 #1441.421 + lea __jsvml_datan_ha_data_internal(%rip), %r11 #1441.421 vpslld $5, %xmm1, %xmm5 #1441.183 vmovd %xmm5, %r10d #1441.242 - vmovsd 1728+__svml_datan_ha_data_internal(%rip), %xmm0 #1423.15 + vmovsd 1728+__jsvml_datan_ha_data_internal(%rip), %xmm0 #1423.15 vmovq 8(%r11,%r10), %xmm7 #1442.418 vmovq (%r10,%r11), %xmm10 #1441.421 vandpd %xmm2, %xmm7, %xmm6 #1445.24 @@ -1129,21 +1129,21 @@ __svml_atan1_ha_l9: vfmadd213sd %xmm1, %xmm6, %xmm1 #1454.22 vmulsd %xmm9, %xmm1, %xmm5 #1455.17 vfnmadd213sd %xmm9, %xmm5, %xmm10 #1456.21 - vmovsd 1792+__svml_datan_ha_data_internal(%rip), %xmm9 #1460.18 + vmovsd 1792+__jsvml_datan_ha_data_internal(%rip), %xmm9 #1460.18 vmulsd %xmm1, %xmm10, %xmm2 #1457.19 vmulsd %xmm5, %xmm5, %xmm10 #1458.14 vmulsd %xmm10, %xmm10, %xmm0 #1459.14 - vmovsd 1856+__svml_datan_ha_data_internal(%rip), %xmm1 #1461.18 - vfmadd213sd 1920+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1464.14 - vfmadd213sd 1984+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1465.14 - vfmadd213sd 2048+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1468.14 - vfmadd213sd 2112+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1469.14 - vfmadd213sd 2176+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1472.14 - vfmadd213sd 2240+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1473.14 - vfmadd213sd 2304+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1476.14 - vfmadd213sd 2368+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1477.14 - vfmadd213sd 2432+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1480.14 - vfmadd213sd 2496+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1481.14 + vmovsd 1856+__jsvml_datan_ha_data_internal(%rip), %xmm1 #1461.18 + vfmadd213sd 1920+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1464.14 + vfmadd213sd 1984+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1465.14 + vfmadd213sd 2048+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1468.14 + vfmadd213sd 2112+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1469.14 + vfmadd213sd 2176+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1472.14 + vfmadd213sd 2240+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1473.14 + vfmadd213sd 2304+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1476.14 + vfmadd213sd 2368+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1477.14 + vfmadd213sd 2432+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm9 #1480.14 + vfmadd213sd 2496+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm1 #1481.14 vaddsd 24(%r11,%r10), %xmm2, %xmm0 #1484.19 vfmadd213sd %xmm1, %xmm10, %xmm9 #1482.14 vmulsd %xmm10, %xmm9, %xmm6 #1483.14 @@ -1189,29 +1189,29 @@ __svml_atan1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1490.546 lea 64(%rsp), %rsi #1490.546 -..___tag_value___svml_atan1_ha_l9.96: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #1490.546 -..___tag_value___svml_atan1_ha_l9.97: +..___tag_value___jsvml_atan1_ha_l9.96: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #1490.546 +..___tag_value___jsvml_atan1_ha_l9.97: jmp ..B6.4 # Prob 100% #1490.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_atan1_ha_l9,@function - .size __svml_atan1_ha_l9,.-__svml_atan1_ha_l9 -..LN__svml_atan1_ha_l9.5: + .type __jsvml_atan1_ha_l9,@function + .size __jsvml_atan1_ha_l9,.-__jsvml_atan1_ha_l9 +..LN__jsvml_atan1_ha_l9.5: .data -# -- End __svml_atan1_ha_l9 +# -- End __jsvml_atan1_ha_l9 .text -.L_2__routine_start___svml_atan2_ha_l9_6: -# -- Begin __svml_atan2_ha_l9 +.L_2__routine_start___jsvml_atan2_ha_l9_6: +# -- Begin __jsvml_atan2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2_ha_l9 -# --- __svml_atan2_ha_l9(__m128d) -__svml_atan2_ha_l9: + .globl __jsvml_atan2_ha_l9 +# --- __jsvml_atan2_ha_l9(__m128d) +__jsvml_atan2_ha_l9: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1220,7 +1220,7 @@ __svml_atan2_ha_l9: .byte 30 #1627.546 .byte 250 #1627.546 .cfi_startproc -..___tag_value___svml_atan2_ha_l9.99: +..___tag_value___jsvml_atan2_ha_l9.99: ..L100: #1498.1 pushq %rbp #1498.1 @@ -1231,20 +1231,20 @@ __svml_atan2_ha_l9: andq $-64, %rsp #1498.1 subq $192, %rsp #1498.1 vmovapd %xmm0, %xmm8 #1498.1 - vandpd 1152+__svml_datan_ha_data_internal(%rip), %xmm8, %xmm6 #1551.14 - lea __svml_datan_ha_data_internal(%rip), %rsi #1578.377 + vandpd 1152+__jsvml_datan_ha_data_internal(%rip), %xmm8, %xmm6 #1551.14 + lea __jsvml_datan_ha_data_internal(%rip), %rsi #1578.377 vpshufd $221, %xmm6, %xmm5 #1554.16 vxorpd %xmm6, %xmm8, %xmm7 #1552.17 - vmovq 2560+__svml_datan_ha_data_internal(%rip), %xmm9 #1555.26 - vmovq 2624+__svml_datan_ha_data_internal(%rip), %xmm11 #1557.26 + vmovq 2560+__jsvml_datan_ha_data_internal(%rip), %xmm9 #1555.26 + vmovq 2624+__jsvml_datan_ha_data_internal(%rip), %xmm11 #1557.26 vpsubd %xmm9, %xmm5, %xmm10 #1556.17 - vmovq 1408+__svml_datan_ha_data_internal(%rip), %xmm15 #1561.29 + vmovq 1408+__jsvml_datan_ha_data_internal(%rip), %xmm15 #1561.29 vpcmpgtd %xmm11, %xmm10, %xmm12 #1558.32 - vmovq 1472+__svml_datan_ha_data_internal(%rip), %xmm9 #1562.29 + vmovq 1472+__jsvml_datan_ha_data_internal(%rip), %xmm9 #1562.29 vpcmpeqd %xmm11, %xmm10, %xmm13 #1558.82 - vmovq 1536+__svml_datan_ha_data_internal(%rip), %xmm10 #1563.29 + vmovq 1536+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1563.29 vpor %xmm13, %xmm12, %xmm14 #1558.18 - vmovq 1600+__svml_datan_ha_data_internal(%rip), %xmm1 #1564.29 + vmovq 1600+__jsvml_datan_ha_data_internal(%rip), %xmm1 #1564.29 vpsubd %xmm5, %xmm15, %xmm2 #1565.29 vpsubd %xmm5, %xmm1, %xmm0 #1566.29 vpsubd %xmm5, %xmm9, %xmm15 #1567.29 @@ -1256,12 +1256,12 @@ __svml_atan2_ha_l9: vpsrad $31, %xmm5, %xmm14 #1572.28 vpaddd %xmm12, %xmm11, %xmm2 #1578.183 vpaddd %xmm14, %xmm13, %xmm1 #1578.183 - vmovq 1664+__svml_datan_ha_data_internal(%rip), %xmm3 #1576.19 + vmovq 1664+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1576.19 vpaddd %xmm1, %xmm2, %xmm0 #1578.183 vpaddd %xmm3, %xmm0, %xmm3 #1578.183 vpslld $5, %xmm3, %xmm2 #1578.183 vmovd %xmm2, %eax #1578.242 - vmovupd 1728+__svml_datan_ha_data_internal(%rip), %xmm4 #1560.46 + vmovupd 1728+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1560.46 vpextrd $1, %xmm2, %ecx #1578.306 vmovq 8(%rax,%rsi), %xmm0 #1579.612 vmovq (%rax,%rsi), %xmm1 #1578.615 @@ -1281,10 +1281,10 @@ __svml_atan2_ha_l9: vrcpps %xmm6, %xmm11 #1586.27 vcvtps2pd %xmm11, %xmm5 #1586.14 vfnmadd231pd %xmm12, %xmm5, %xmm3 #1587.17 - vmovupd 1792+__svml_datan_ha_data_internal(%rip), %xmm6 #1597.49 + vmovupd 1792+__jsvml_datan_ha_data_internal(%rip), %xmm6 #1597.49 vfmadd213pd %xmm3, %xmm3, %xmm3 #1588.17 vfmadd213pd %xmm5, %xmm3, %xmm5 #1589.18 - vmovupd 1856+__svml_datan_ha_data_internal(%rip), %xmm3 #1602.14 + vmovupd 1856+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1602.14 vfnmadd231pd %xmm12, %xmm5, %xmm4 #1590.21 vfmadd213pd %xmm5, %xmm4, %xmm5 #1591.22 vmulpd %xmm5, %xmm0, %xmm10 #1592.17 @@ -1292,17 +1292,17 @@ __svml_atan2_ha_l9: vfnmadd213pd %xmm0, %xmm10, %xmm12 #1593.21 vmulpd %xmm4, %xmm4, %xmm0 #1596.14 vmulpd %xmm12, %xmm5, %xmm9 #1594.19 - vfmadd213pd 1920+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1601.14 - vfmadd213pd 1984+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1602.14 + vfmadd213pd 1920+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1601.14 + vfmadd213pd 1984+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1602.14 vaddpd %xmm9, %xmm1, %xmm1 #1621.19 - vfmadd213pd 2048+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1605.14 - vfmadd213pd 2112+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1606.14 - vfmadd213pd 2176+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1609.14 - vfmadd213pd 2240+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1610.14 - vfmadd213pd 2304+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1613.14 - vfmadd213pd 2368+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1614.14 - vfmadd213pd 2432+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1617.14 - vfmadd213pd 2496+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1618.14 + vfmadd213pd 2048+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1605.14 + vfmadd213pd 2112+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1606.14 + vfmadd213pd 2176+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1609.14 + vfmadd213pd 2240+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1610.14 + vfmadd213pd 2304+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1613.14 + vfmadd213pd 2368+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1614.14 + vfmadd213pd 2432+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm6 #1617.14 + vfmadd213pd 2496+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1618.14 vfmadd213pd %xmm3, %xmm4, %xmm6 #1619.14 vmulpd %xmm6, %xmm4, %xmm11 #1620.14 vfmadd213pd %xmm1, %xmm10, %xmm11 #1622.14 @@ -1364,29 +1364,29 @@ __svml_atan2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1627.546 lea 128(%rsp,%r12,8), %rsi #1627.546 -..___tag_value___svml_atan2_ha_l9.117: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #1627.546 -..___tag_value___svml_atan2_ha_l9.118: +..___tag_value___jsvml_atan2_ha_l9.117: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #1627.546 +..___tag_value___jsvml_atan2_ha_l9.118: jmp ..B7.8 # Prob 100% #1627.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atan2_ha_l9,@function - .size __svml_atan2_ha_l9,.-__svml_atan2_ha_l9 -..LN__svml_atan2_ha_l9.6: + .type __jsvml_atan2_ha_l9,@function + .size __jsvml_atan2_ha_l9,.-__jsvml_atan2_ha_l9 +..LN__jsvml_atan2_ha_l9.6: .data -# -- End __svml_atan2_ha_l9 +# -- End __jsvml_atan2_ha_l9 .text -.L_2__routine_start___svml_atan1_ha_ex_7: -# -- Begin __svml_atan1_ha_ex +.L_2__routine_start___jsvml_atan1_ha_ex_7: +# -- Begin __jsvml_atan1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_atan1_ha_ex -# --- __svml_atan1_ha_ex(__m128d) -__svml_atan1_ha_ex: + .globl __jsvml_atan1_ha_ex +# --- __jsvml_atan1_ha_ex(__m128d) +__jsvml_atan1_ha_ex: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1395,7 +1395,7 @@ __svml_atan1_ha_ex: .byte 30 #1785.546 .byte 250 #1785.546 .cfi_startproc -..___tag_value___svml_atan1_ha_ex.120: +..___tag_value___jsvml_atan1_ha_ex.120: ..L121: #1635.1 pushq %rbp #1635.1 @@ -1410,9 +1410,9 @@ __svml_atan1_ha_ex: movl $1072889856, %edi #1707.27 movl $1073971200, %r8d #1708.27 movaps %xmm0, %xmm8 #1635.1 - movsd 1152+__svml_datan_ha_data_internal(%rip), %xmm9 #1687.20 + movsd 1152+__jsvml_datan_ha_data_internal(%rip), %xmm9 #1687.20 movl $4, %r9d #1718.181 - movsd 1344+__svml_datan_ha_data_internal(%rip), %xmm6 #1690.28 + movsd 1344+__jsvml_datan_ha_data_internal(%rip), %xmm6 #1690.28 andps %xmm8, %xmm9 #1688.14 movaps %xmm6, %xmm0 #1691.19 movaps %xmm9, %xmm7 #1689.17 @@ -1437,7 +1437,7 @@ __svml_atan1_ha_ex: paddd %xmm1, %xmm9 #1718.181 movl $-2144337920, %eax #1696.15 paddd %xmm2, %xmm9 #1718.181 - lea __svml_datan_ha_data_internal(%rip), %r11 #1718.415 + lea __jsvml_datan_ha_data_internal(%rip), %r11 #1718.415 pslld $5, %xmm9 #1718.181 movl $-36700160, %edx #1697.24 movd %xmm9, %r10d #1718.238 @@ -1456,7 +1456,7 @@ __svml_atan1_ha_ex: pcmpeqd %xmm11, %xmm12 #1698.76 por %xmm12, %xmm13 #1698.16 movmskps %xmm13, %eax #1699.44 - movsd 1728+__svml_datan_ha_data_internal(%rip), %xmm4 #1700.15 + movsd 1728+__jsvml_datan_ha_data_internal(%rip), %xmm4 #1700.15 movq 8(%r11,%r10), %xmm13 #1719.412 movdqa %xmm13, %xmm10 #1722.20 movdqa %xmm13, %xmm12 #1724.20 @@ -1493,7 +1493,7 @@ __svml_atan1_ha_ex: mulsd %xmm3, %xmm9 #1751.31 movaps %xmm2, %xmm5 #1743.31 mulsd %xmm2, %xmm5 #1743.31 - movsd 1792+__svml_datan_ha_data_internal(%rip), %xmm10 #1759.26 + movsd 1792+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1759.26 subsd %xmm2, %xmm5 #1743.19 mulsd %xmm2, %xmm5 #1744.31 addsd %xmm2, %xmm5 #1744.19 @@ -1509,7 +1509,7 @@ __svml_atan1_ha_ex: movaps %xmm0, %xmm6 #1752.17 mulsd %xmm1, %xmm4 #1749.18 mulsd %xmm3, %xmm5 #1750.30 - movsd 1856+__svml_datan_ha_data_internal(%rip), %xmm3 #1760.26 + movsd 1856+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1760.26 addsd %xmm4, %xmm5 #1750.18 addsd %xmm5, %xmm9 #1751.19 addsd %xmm9, %xmm6 #1752.17 @@ -1520,24 +1520,24 @@ __svml_atan1_ha_ex: mulsd %xmm2, %xmm1 #1754.14 mulsd %xmm1, %xmm10 #1759.26 mulsd %xmm1, %xmm3 #1760.26 - addsd 1920+__svml_datan_ha_data_internal(%rip), %xmm10 #1759.14 - addsd 1984+__svml_datan_ha_data_internal(%rip), %xmm3 #1760.14 + addsd 1920+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1759.14 + addsd 1984+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1760.14 mulsd %xmm1, %xmm10 #1763.26 mulsd %xmm1, %xmm3 #1764.26 - addsd 2048+__svml_datan_ha_data_internal(%rip), %xmm10 #1763.14 - addsd 2112+__svml_datan_ha_data_internal(%rip), %xmm3 #1764.14 + addsd 2048+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1763.14 + addsd 2112+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1764.14 mulsd %xmm1, %xmm10 #1767.26 mulsd %xmm1, %xmm3 #1768.26 - addsd 2176+__svml_datan_ha_data_internal(%rip), %xmm10 #1767.14 - addsd 2240+__svml_datan_ha_data_internal(%rip), %xmm3 #1768.14 + addsd 2176+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1767.14 + addsd 2240+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1768.14 mulsd %xmm1, %xmm10 #1771.26 mulsd %xmm1, %xmm3 #1772.26 - addsd 2304+__svml_datan_ha_data_internal(%rip), %xmm10 #1771.14 - addsd 2368+__svml_datan_ha_data_internal(%rip), %xmm3 #1772.14 + addsd 2304+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1771.14 + addsd 2368+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1772.14 mulsd %xmm1, %xmm10 #1775.26 mulsd %xmm1, %xmm3 #1776.26 - addsd 2432+__svml_datan_ha_data_internal(%rip), %xmm10 #1775.14 - addsd 2496+__svml_datan_ha_data_internal(%rip), %xmm3 #1776.14 + addsd 2432+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1775.14 + addsd 2496+__jsvml_datan_ha_data_internal(%rip), %xmm3 #1776.14 mulsd %xmm2, %xmm10 #1777.26 addsd %xmm3, %xmm10 #1777.14 mulsd %xmm2, %xmm10 #1778.14 @@ -1580,29 +1580,29 @@ __svml_atan1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1785.546 lea 64(%rsp), %rsi #1785.546 -..___tag_value___svml_atan1_ha_ex.133: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #1785.546 -..___tag_value___svml_atan1_ha_ex.134: +..___tag_value___jsvml_atan1_ha_ex.133: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #1785.546 +..___tag_value___jsvml_atan1_ha_ex.134: jmp ..B8.4 # Prob 100% #1785.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_atan1_ha_ex,@function - .size __svml_atan1_ha_ex,.-__svml_atan1_ha_ex -..LN__svml_atan1_ha_ex.7: + .type __jsvml_atan1_ha_ex,@function + .size __jsvml_atan1_ha_ex,.-__jsvml_atan1_ha_ex +..LN__jsvml_atan1_ha_ex.7: .data -# -- End __svml_atan1_ha_ex +# -- End __jsvml_atan1_ha_ex .text -.L_2__routine_start___svml_atan4_ha_l9_8: -# -- Begin __svml_atan4_ha_l9 +.L_2__routine_start___jsvml_atan4_ha_l9_8: +# -- Begin __jsvml_atan4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan4_ha_l9 -# --- __svml_atan4_ha_l9(__m256d) -__svml_atan4_ha_l9: + .globl __jsvml_atan4_ha_l9 +# --- __jsvml_atan4_ha_l9(__m256d) +__jsvml_atan4_ha_l9: # parameter 1: %ymm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1611,7 +1611,7 @@ __svml_atan4_ha_l9: .byte 30 #1922.552 .byte 250 #1922.552 .cfi_startproc -..___tag_value___svml_atan4_ha_l9.136: +..___tag_value___jsvml_atan4_ha_l9.136: ..L137: #1793.1 pushq %rbp #1793.1 @@ -1621,22 +1621,22 @@ __svml_atan4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1793.1 subq $192, %rsp #1793.1 - lea __svml_datan_ha_data_internal(%rip), %r8 #1873.513 + lea __jsvml_datan_ha_data_internal(%rip), %r8 #1873.513 vmovapd %ymm0, %ymm8 #1793.1 - vandpd 1152+__svml_datan_ha_data_internal(%rip), %ymm8, %ymm6 #1846.14 + vandpd 1152+__jsvml_datan_ha_data_internal(%rip), %ymm8, %ymm6 #1846.14 vxorpd %ymm6, %ymm8, %ymm7 #1847.17 - vmovups 2624+__svml_datan_ha_data_internal(%rip), %xmm11 #1852.26 - vmovups 1408+__svml_datan_ha_data_internal(%rip), %xmm15 #1856.29 - vmovups 1472+__svml_datan_ha_data_internal(%rip), %xmm2 #1857.29 - vmovups 1600+__svml_datan_ha_data_internal(%rip), %xmm0 #1859.29 - vmovupd 1728+__svml_datan_ha_data_internal(%rip), %ymm4 #1855.49 + vmovups 2624+__jsvml_datan_ha_data_internal(%rip), %xmm11 #1852.26 + vmovups 1408+__jsvml_datan_ha_data_internal(%rip), %xmm15 #1856.29 + vmovups 1472+__jsvml_datan_ha_data_internal(%rip), %xmm2 #1857.29 + vmovups 1600+__jsvml_datan_ha_data_internal(%rip), %xmm0 #1859.29 + vmovupd 1728+__jsvml_datan_ha_data_internal(%rip), %ymm4 #1855.49 vextractf128 $1, %ymm6, %xmm9 #1849.124 vshufps $221, %xmm9, %xmm6, %xmm5 #1849.34 - vpsubd 2560+__svml_datan_ha_data_internal(%rip), %xmm5, %xmm10 #1851.17 + vpsubd 2560+__jsvml_datan_ha_data_internal(%rip), %xmm5, %xmm10 #1851.17 vpsubd %xmm5, %xmm15, %xmm1 #1860.29 vpcmpgtd %xmm11, %xmm10, %xmm12 #1853.32 vpcmpeqd %xmm11, %xmm10, %xmm13 #1853.82 - vmovups 1536+__svml_datan_ha_data_internal(%rip), %xmm10 #1858.29 + vmovups 1536+__jsvml_datan_ha_data_internal(%rip), %xmm10 #1858.29 vpor %xmm13, %xmm12, %xmm14 #1853.18 vpsubd %xmm5, %xmm0, %xmm3 #1861.29 vpsubd %xmm5, %xmm2, %xmm9 #1862.29 @@ -1649,7 +1649,7 @@ __svml_atan4_ha_l9: vpaddd %xmm12, %xmm11, %xmm15 #1873.183 vpaddd %xmm14, %xmm13, %xmm1 #1873.183 vpaddd %xmm1, %xmm15, %xmm0 #1873.183 - vpaddd 1664+__svml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1873.183 + vpaddd 1664+__jsvml_datan_ha_data_internal(%rip), %xmm0, %xmm3 #1873.183 vpslld $5, %xmm3, %xmm9 #1873.183 vmovd %xmm9, %edx #1873.242 vpextrd $2, %xmm9, %esi #1873.373 @@ -1682,11 +1682,11 @@ __svml_atan4_ha_l9: vmovapd %ymm4, %ymm5 #1882.17 vinsertf128 $1, %xmm9, %ymm0, %ymm1 #1875.957 vcvtps2pd %xmm2, %ymm9 #1881.14 - vmovupd 1856+__svml_datan_ha_data_internal(%rip), %ymm2 #1897.14 + vmovupd 1856+__jsvml_datan_ha_data_internal(%rip), %ymm2 #1897.14 vfnmadd231pd %ymm3, %ymm9, %ymm5 #1882.17 vfmadd213pd %ymm5, %ymm5, %ymm5 #1883.17 vfmadd213pd %ymm9, %ymm5, %ymm9 #1884.18 - vmovupd 1792+__svml_datan_ha_data_internal(%rip), %ymm5 #1892.52 + vmovupd 1792+__jsvml_datan_ha_data_internal(%rip), %ymm5 #1892.52 vfnmadd231pd %ymm3, %ymm9, %ymm4 #1885.21 vfmadd213pd %ymm9, %ymm4, %ymm9 #1886.22 vmulpd %ymm9, %ymm15, %ymm10 #1887.17 @@ -1694,16 +1694,16 @@ __svml_atan4_ha_l9: vmulpd %ymm10, %ymm10, %ymm4 #1890.14 vmulpd %ymm3, %ymm9, %ymm6 #1889.19 vmulpd %ymm4, %ymm4, %ymm3 #1891.14 - vfmadd213pd 1920+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1896.14 - vfmadd213pd 1984+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1897.14 - vfmadd213pd 2048+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1900.14 - vfmadd213pd 2112+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1901.14 - vfmadd213pd 2176+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1904.14 - vfmadd213pd 2240+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1905.14 - vfmadd213pd 2304+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1908.14 - vfmadd213pd 2368+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1909.14 - vfmadd213pd 2432+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1912.14 - vfmadd213pd 2496+__svml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1913.14 + vfmadd213pd 1920+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1896.14 + vfmadd213pd 1984+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1897.14 + vfmadd213pd 2048+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1900.14 + vfmadd213pd 2112+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1901.14 + vfmadd213pd 2176+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1904.14 + vfmadd213pd 2240+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1905.14 + vfmadd213pd 2304+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1908.14 + vfmadd213pd 2368+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1909.14 + vfmadd213pd 2432+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm5 #1912.14 + vfmadd213pd 2496+__jsvml_datan_ha_data_internal(%rip), %ymm3, %ymm2 #1913.14 vfmadd213pd %ymm2, %ymm4, %ymm5 #1914.14 vinsertf128 $1, %xmm13, %ymm11, %ymm0 #1876.957 vmulpd %ymm5, %ymm4, %ymm11 #1915.14 @@ -1771,30 +1771,30 @@ __svml_atan4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1922.552 lea 128(%rsp,%r12,8), %rsi #1922.552 -..___tag_value___svml_atan4_ha_l9.154: -# __svml_datan_ha_cout_rare_internal(const double *, double *) - call __svml_datan_ha_cout_rare_internal #1922.552 -..___tag_value___svml_atan4_ha_l9.155: +..___tag_value___jsvml_atan4_ha_l9.154: +# __jsvml_datan_ha_cout_rare_internal(const double *, double *) + call __jsvml_datan_ha_cout_rare_internal #1922.552 +..___tag_value___jsvml_atan4_ha_l9.155: jmp ..B9.8 # Prob 100% #1922.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atan4_ha_l9,@function - .size __svml_atan4_ha_l9,.-__svml_atan4_ha_l9 -..LN__svml_atan4_ha_l9.8: + .type __jsvml_atan4_ha_l9,@function + .size __jsvml_atan4_ha_l9,.-__jsvml_atan4_ha_l9 +..LN__jsvml_atan4_ha_l9.8: .data -# -- End __svml_atan4_ha_l9 +# -- End __jsvml_atan4_ha_l9 .text -.L_2__routine_start___svml_datan_ha_cout_rare_internal_9: -# -- Begin __svml_datan_ha_cout_rare_internal +.L_2__routine_start___jsvml_datan_ha_cout_rare_internal_9: +# -- Begin __jsvml_datan_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_datan_ha_cout_rare_internal - .globl __svml_datan_ha_cout_rare_internal -# --- __svml_datan_ha_cout_rare_internal(const double *, double *) -__svml_datan_ha_cout_rare_internal: + .hidden __jsvml_datan_ha_cout_rare_internal + .globl __jsvml_datan_ha_cout_rare_internal +# --- __jsvml_datan_ha_cout_rare_internal(const double *, double *) +__jsvml_datan_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1804,7 +1804,7 @@ __svml_datan_ha_cout_rare_internal: .byte 30 #1195.15 .byte 250 #1195.15 .cfi_startproc -..___tag_value___svml_datan_ha_cout_rare_internal.157: +..___tag_value___jsvml_datan_ha_cout_rare_internal.157: ..L158: #1094.1 movzwl 6(%rdi), %r8d #1102.31 @@ -2154,17 +2154,17 @@ __svml_datan_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_datan_ha_cout_rare_internal,@function - .size __svml_datan_ha_cout_rare_internal,.-__svml_datan_ha_cout_rare_internal -..LN__svml_datan_ha_cout_rare_internal.9: + .type __jsvml_datan_ha_cout_rare_internal,@function + .size __jsvml_datan_ha_cout_rare_internal,.-__jsvml_datan_ha_cout_rare_internal +..LN__jsvml_datan_ha_cout_rare_internal.9: .data -# -- End __svml_datan_ha_cout_rare_internal +# -- End __jsvml_datan_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_datan_ha_data_internal_avx512 - .globl __svml_datan_ha_data_internal_avx512 -__svml_datan_ha_data_internal_avx512: + .hidden __jsvml_datan_ha_data_internal_avx512 + .globl __jsvml_datan_ha_data_internal_avx512 +__jsvml_datan_ha_data_internal_avx512: .long 4294967295 .long 2147483647 .long 4294967295 @@ -2549,12 +2549,12 @@ __svml_datan_ha_data_internal_avx512: .long 3218429269 .long 1431655757 .long 3218429269 - .type __svml_datan_ha_data_internal_avx512,@object - .size __svml_datan_ha_data_internal_avx512,1536 + .type __jsvml_datan_ha_data_internal_avx512,@object + .size __jsvml_datan_ha_data_internal_avx512,1536 .align 64 - .hidden __svml_datan_ha_data_internal - .globl __svml_datan_ha_data_internal -__svml_datan_ha_data_internal: + .hidden __jsvml_datan_ha_data_internal + .globl __jsvml_datan_ha_data_internal +__jsvml_datan_ha_data_internal: .long 0 .long 1072693248 .long 0 @@ -3227,8 +3227,8 @@ __svml_datan_ha_data_internal: .long 4258267136 .long 4258267136 .long 4258267136 - .type __svml_datan_ha_data_internal,@object - .size __svml_datan_ha_data_internal,2688 + .type __jsvml_datan_ha_data_internal,@object + .size __jsvml_datan_ha_data_internal,2688 .align 32 _vmldAtanHATab: .long 3892314112 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_cbrt_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cbrt_linux_x86.S similarity index 85% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_cbrt_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cbrt_linux_x86.S index 7c97a595ddd..97d0303bef1 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_cbrt_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cbrt_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_cbrt.c" .text ..TXTST0: -.L_2__routine_start___svml_cbrt1_ha_e9_0: -# -- Begin __svml_cbrt1_ha_e9 +.L_2__routine_start___jsvml_cbrt1_ha_e9_0: +# -- Begin __jsvml_cbrt1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt1_ha_e9 -# --- __svml_cbrt1_ha_e9(__m128d) -__svml_cbrt1_ha_e9: + .globl __jsvml_cbrt1_ha_e9 +# --- __jsvml_cbrt1_ha_e9(__m128d) +__jsvml_cbrt1_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_cbrt1_ha_e9: .byte 30 #582.546 .byte 250 #582.546 .cfi_startproc -..___tag_value___svml_cbrt1_ha_e9.1: +..___tag_value___jsvml_cbrt1_ha_e9.1: ..L2: #461.1 pushq %rbp #461.1 @@ -75,22 +75,22 @@ __svml_cbrt1_ha_e9: pand %xmm11, %xmm0 #544.18 psrld $12, %xmm10 #528.22 por %xmm12, %xmm0 #545.16 - lea __svml_dcbrt_ha_data_internal(%rip), %r11 #529.11 - movsd 2496+__svml_dcbrt_ha_data_internal(%rip), %xmm12 #551.9 + lea __jsvml_dcbrt_ha_data_internal(%rip), %r11 #529.11 + movsd 2496+__jsvml_dcbrt_ha_data_internal(%rip), %xmm12 #551.9 movl $-2146435072, %edx #524.23 - movsd 2432+__svml_dcbrt_ha_data_internal(%rip), %xmm14 #552.14 + movsd 2432+__jsvml_dcbrt_ha_data_internal(%rip), %xmm14 #552.14 andps %xmm1, %xmm12 #551.9 orps %xmm14, %xmm12 #553.9 pxor %xmm11, %xmm11 #548.16 - movsd 2368+__svml_dcbrt_ha_data_internal(%rip), %xmm14 #554.17 + movsd 2368+__jsvml_dcbrt_ha_data_internal(%rip), %xmm14 #554.17 movl $-2097153, %ecx #525.23 - movq 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm5 #513.23 + movq 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5 #513.23 andps %xmm1, %xmm14 #555.10 - movsd 2304+__svml_dcbrt_ha_data_internal(%rip), %xmm15 #556.18 + movsd 2304+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15 #556.18 pand %xmm5, %xmm7 #531.17 movd %xmm10, %edi #529.81 orps %xmm15, %xmm14 #557.10 - movq 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm6 #532.19 + movq 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm6 #532.19 movd %edx, %xmm2 #524.23 pshufd $0, %xmm7, %xmm9 #533.17 psubd %xmm2, %xmm4 #524.23 @@ -108,34 +108,34 @@ __svml_cbrt1_ha_e9: movmskps %xmm4, %eax #526.40 punpckldq %xmm0, %xmm11 #548.16 psubd %xmm13, %xmm9 #537.17 - movsd 1792+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #560.10 + movsd 1792+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #560.10 paddd %xmm13, %xmm8 #538.17 mulsd %xmm12, %xmm0 #562.21 psubd %xmm8, %xmm9 #538.17 pslld $8, %xmm9 #539.17 - addsd 1856+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #562.9 + addsd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #562.9 mulsd %xmm12, %xmm0 #564.21 paddd %xmm9, %xmm10 #541.27 pslld $1, %xmm10 #541.27 - addsd 1920+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #564.9 + addsd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #564.9 movd %xmm10, %r8d #542.94 mulsd %xmm12, %xmm0 #566.21 movslq %r8d, %r8 #542.51 - addsd 1984+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #566.9 + addsd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #566.9 mulsd %xmm12, %xmm0 #568.21 movups 256(%r11,%r8), %xmm3 #542.51 mulsd %xmm11, %xmm3 #575.15 - addsd 2048+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #568.9 + addsd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #568.9 mulsd %xmm12, %xmm0 #570.21 movaps %xmm3, %xmm13 #577.15 mulsd %xmm12, %xmm13 #577.15 - addsd 2112+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #570.9 + addsd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #570.9 mulsd %xmm12, %xmm0 #572.21 movsd 264(%r11,%r8), %xmm2 #542.51 mulsd %xmm11, %xmm2 #576.15 - addsd 2176+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #572.9 + addsd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #572.9 mulsd %xmm12, %xmm0 #574.21 - addsd 2240+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #574.9 + addsd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #574.9 mulsd %xmm13, %xmm0 #578.9 addsd %xmm2, %xmm0 #579.9 addsd %xmm3, %xmm0 #580.10 @@ -173,29 +173,29 @@ __svml_cbrt1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #582.546 lea 64(%rsp), %rsi #582.546 -..___tag_value___svml_cbrt1_ha_e9.14: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #582.546 -..___tag_value___svml_cbrt1_ha_e9.15: +..___tag_value___jsvml_cbrt1_ha_e9.14: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #582.546 +..___tag_value___jsvml_cbrt1_ha_e9.15: jmp ..B1.4 # Prob 100% #582.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_cbrt1_ha_e9,@function - .size __svml_cbrt1_ha_e9,.-__svml_cbrt1_ha_e9 -..LN__svml_cbrt1_ha_e9.0: + .type __jsvml_cbrt1_ha_e9,@function + .size __jsvml_cbrt1_ha_e9,.-__jsvml_cbrt1_ha_e9 +..LN__jsvml_cbrt1_ha_e9.0: .data -# -- End __svml_cbrt1_ha_e9 +# -- End __jsvml_cbrt1_ha_e9 .text -.L_2__routine_start___svml_cbrt4_ha_l9_1: -# -- Begin __svml_cbrt4_ha_l9 +.L_2__routine_start___jsvml_cbrt4_ha_l9_1: +# -- Begin __jsvml_cbrt4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt4_ha_l9 -# --- __svml_cbrt4_ha_l9(__m256d) -__svml_cbrt4_ha_l9: + .globl __jsvml_cbrt4_ha_l9 +# --- __jsvml_cbrt4_ha_l9(__m256d) +__jsvml_cbrt4_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -204,7 +204,7 @@ __svml_cbrt4_ha_l9: .byte 30 #711.552 .byte 250 #711.552 .cfi_startproc -..___tag_value___svml_cbrt4_ha_l9.17: +..___tag_value___jsvml_cbrt4_ha_l9.17: ..L18: #590.1 pushq %rbp #590.1 @@ -214,19 +214,19 @@ __svml_cbrt4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #590.1 subq $192, %rsp #590.1 - lea __svml_dcbrt_ha_data_internal(%rip), %rax #658.74 + lea __jsvml_dcbrt_ha_data_internal(%rip), %rax #658.74 vmovapd %ymm0, %ymm6 #590.1 vextractf128 $1, %ymm6, %xmm7 #651.118 vpsrlq $52, %ymm6, %ymm0 #659.13 vshufps $221, %xmm7, %xmm6, %xmm5 #651.29 - vandps 2752+__svml_dcbrt_ha_data_internal(%rip), %xmm5, %xmm11 #656.18 + vandps 2752+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5, %xmm11 #656.18 vpsrld $12, %xmm11, %xmm4 #657.18 vmovd %xmm4, %ecx #658.144 - vandps 2816+__svml_dcbrt_ha_data_internal(%rip), %xmm5, %xmm8 #652.19 + vandps 2816+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5, %xmm8 #652.19 vpsrld $20, %xmm5, %xmm5 #672.14 - vpsubd 3008+__svml_dcbrt_ha_data_internal(%rip), %xmm8, %xmm9 #653.19 - vandps 2624+__svml_dcbrt_ha_data_internal(%rip), %ymm0, %ymm1 #660.13 - vpmuludq 2688+__svml_dcbrt_ha_data_internal(%rip), %ymm1, %ymm7 #661.15 + vpsubd 3008+__jsvml_dcbrt_ha_data_internal(%rip), %xmm8, %xmm9 #653.19 + vandps 2624+__jsvml_dcbrt_ha_data_internal(%rip), %ymm0, %ymm1 #660.13 + vpmuludq 2688+__jsvml_dcbrt_ha_data_internal(%rip), %ymm1, %ymm7 #661.15 vpextrd $2, %xmm4, %edi #658.381 movslq %ecx, %rcx #658.74 vpextrd $1, %xmm4, %esi #658.251 @@ -234,7 +234,7 @@ __svml_cbrt4_ha_l9: vpextrd $3, %xmm4, %r8d #658.491 movslq %esi, %rsi #658.181 movslq %r8d, %r8 #658.421 - vpcmpgtd 3072+__svml_dcbrt_ha_data_internal(%rip), %xmm9, %xmm10 #654.19 + vpcmpgtd 3072+__jsvml_dcbrt_ha_data_internal(%rip), %xmm9, %xmm10 #654.19 vmovsd (%rax,%rcx), %xmm12 #658.74 vmovmskps %xmm10, %edx #655.40 vmovsd (%rax,%rdi), %xmm14 #658.311 @@ -248,7 +248,7 @@ __svml_cbrt4_ha_l9: vpsrld $14, %xmm9, %xmm2 #664.15 vpsubd %xmm2, %xmm10, %xmm11 #666.13 vpaddd %xmm2, %xmm2, %xmm12 #667.13 - vandpd 2496+__svml_dcbrt_ha_data_internal(%rip), %ymm6, %ymm10 #680.9 + vandpd 2496+__jsvml_dcbrt_ha_data_internal(%rip), %ymm6, %ymm10 #680.9 vinsertf128 $1, %xmm15, %ymm13, %ymm3 #658.11 vpsubd %xmm12, %xmm11, %xmm13 #667.13 vpslld $8, %xmm13, %xmm14 #668.13 @@ -264,27 +264,27 @@ __svml_cbrt4_ha_l9: movslq %ecx, %rcx #671.438 vmovupd 256(%rax,%r9), %xmm0 #671.45 vmovupd 256(%rax,%r10), %xmm1 #671.174 - vandpd 2368+__svml_dcbrt_ha_data_internal(%rip), %ymm6, %ymm11 #684.10 - vorpd 2432+__svml_dcbrt_ha_data_internal(%rip), %ymm10, %ymm12 #682.9 - vorpd 2304+__svml_dcbrt_ha_data_internal(%rip), %ymm11, %ymm13 #686.10 + vandpd 2368+__jsvml_dcbrt_ha_data_internal(%rip), %ymm6, %ymm11 #684.10 + vorpd 2432+__jsvml_dcbrt_ha_data_internal(%rip), %ymm10, %ymm12 #682.9 + vorpd 2304+__jsvml_dcbrt_ha_data_internal(%rip), %ymm11, %ymm13 #686.10 vsubpd %ymm13, %ymm12, %ymm14 #687.9 vmulpd %ymm14, %ymm3, %ymm3 #688.9 vinsertf128 $1, 256(%rax,%r11), %ymm0, %ymm4 #671.548 vinsertf128 $1, 256(%rax,%rcx), %ymm1, %ymm7 #671.629 vunpcklpd %ymm7, %ymm4, %ymm1 #671.708 vunpckhpd %ymm7, %ymm4, %ymm0 #671.756 - vpand 2880+__svml_dcbrt_ha_data_internal(%rip), %xmm5, %xmm4 #673.14 - vpor 2944+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm5 #674.12 + vpand 2880+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5, %xmm4 #673.14 + vpor 2944+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm5 #674.12 vpaddd %xmm2, %xmm5, %xmm2 #676.12 vpslld $20, %xmm2, %xmm7 #676.12 - vmovupd 1792+__svml_dcbrt_ha_data_internal(%rip), %ymm2 #689.44 - vfmadd213pd 1856+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #691.9 - vfmadd213pd 1920+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #693.9 - vfmadd213pd 1984+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #695.9 - vfmadd213pd 2048+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #697.9 - vfmadd213pd 2112+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #699.9 - vfmadd213pd 2176+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #701.9 - vfmadd213pd 2240+__svml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #703.9 + vmovupd 1792+__jsvml_dcbrt_ha_data_internal(%rip), %ymm2 #689.44 + vfmadd213pd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #691.9 + vfmadd213pd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #693.9 + vfmadd213pd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #695.9 + vfmadd213pd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #697.9 + vfmadd213pd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #699.9 + vfmadd213pd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #701.9 + vfmadd213pd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %ymm3, %ymm2 #703.9 vpermps %ymm7, %ymm8, %ymm9 #677.217 vandps __VUNPACK_ODD_mask.1399.0.2(%rip), %ymm9, %ymm15 #677.203 vmulpd %ymm15, %ymm1, %ymm1 #704.15 @@ -352,18 +352,18 @@ __svml_cbrt4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #711.552 lea 128(%rsp,%r12,8), %rsi #711.552 -..___tag_value___svml_cbrt4_ha_l9.35: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #711.552 -..___tag_value___svml_cbrt4_ha_l9.36: +..___tag_value___jsvml_cbrt4_ha_l9.35: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #711.552 +..___tag_value___jsvml_cbrt4_ha_l9.36: jmp ..B2.8 # Prob 100% #711.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrt4_ha_l9,@function - .size __svml_cbrt4_ha_l9,.-__svml_cbrt4_ha_l9 -..LN__svml_cbrt4_ha_l9.1: + .type __jsvml_cbrt4_ha_l9,@function + .size __jsvml_cbrt4_ha_l9,.-__jsvml_cbrt4_ha_l9 +..LN__jsvml_cbrt4_ha_l9.1: .section .rodata, "a" .align 64 .align 64 @@ -388,16 +388,16 @@ __VUNPACK_ODD_mask.1399.0.2: .long 0 .long -1 .data -# -- End __svml_cbrt4_ha_l9 +# -- End __jsvml_cbrt4_ha_l9 .text -.L_2__routine_start___svml_cbrt8_ha_z0_2: -# -- Begin __svml_cbrt8_ha_z0 +.L_2__routine_start___jsvml_cbrt8_ha_z0_2: +# -- Begin __jsvml_cbrt8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt8_ha_z0 -# --- __svml_cbrt8_ha_z0(__m512d) -__svml_cbrt8_ha_z0: + .globl __jsvml_cbrt8_ha_z0 +# --- __jsvml_cbrt8_ha_z0(__m512d) +__jsvml_cbrt8_ha_z0: # parameter 1: %zmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -406,53 +406,53 @@ __svml_cbrt8_ha_z0: .byte 30 #825.12 .byte 250 #825.12 .cfi_startproc -..___tag_value___svml_cbrt8_ha_z0.38: +..___tag_value___jsvml_cbrt8_ha_z0.38: ..L39: #719.1 vgetexppd {sae}, %zmm0, %zmm9 #769.25 - vmovups 384+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm10 #770.55 + vmovups 384+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm10 #770.55 vgetmantpd $0, {sae}, %zmm0, %zmm2 #768.28 - vmovups 512+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm11 #775.58 - vmovups 576+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm12 #776.55 - vmovups 640+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm13 #779.55 - vmovups 128+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm1 #789.297 - vmovups 704+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm4 #786.19 + vmovups 512+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm11 #775.58 + vmovups 576+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm12 #776.55 + vmovups 640+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm13 #779.55 + vmovups 128+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm1 #789.297 + vmovups 704+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm4 #786.19 vrcp14pd %zmm2, %zmm15 #774.24 vaddpd {rn-sae}, %zmm10, %zmm9, %zmm14 #771.25 - vandpd 448+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm8 #773.21 + vandpd 448+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm8 #773.21 vrndscalepd $72, {sae}, %zmm15, %zmm3 #784.24 vfmsub231pd {rn-sae}, %zmm14, %zmm11, %zmm12 #777.26 - vmovups 256+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm11 #790.297 - vmovups 768+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm9 #793.63 - vmovups 896+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm10 #796.62 + vmovups 256+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm11 #790.297 + vmovups 768+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm9 #793.63 + vmovups 896+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm10 #796.62 vfmsub231pd {rn-sae}, %zmm3, %zmm2, %zmm4 #786.19 vrndscalepd $9, {sae}, %zmm12, %zmm7 #778.26 vpsrlq $49, %zmm3, %zmm0 #787.46 - vmovups 832+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm3 #795.23 + vmovups 832+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm3 #795.23 vfnmadd231pd {rn-sae}, %zmm7, %zmm13, %zmm14 #780.26 - vmovups 1024+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm13 #801.62 + vmovups 1024+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm13 #801.62 vfmadd231pd {rn-sae}, %zmm4, %zmm9, %zmm3 #795.23 - vmovups 1088+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm9 #803.22 - vpermpd __svml_dcbrt_ha_data_internal_avx512(%rip), %zmm14, %zmm6 #782.153 - vpermt2pd 192+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm1 #789.297 - vpermt2pd 320+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm11 #790.297 - vpermpd 64+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm14, %zmm5 #783.153 + vmovups 1088+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm9 #803.22 + vpermpd __jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm14, %zmm6 #782.153 + vpermt2pd 192+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm1 #789.297 + vpermt2pd 320+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm11 #790.297 + vpermpd 64+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm14, %zmm5 #783.153 vmulpd {rn-sae}, %zmm1, %zmm6, %zmm2 #791.27 vmulpd {rn-sae}, %zmm4, %zmm4, %zmm0 #799.23 - vmovups 960+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm14 #798.22 + vmovups 960+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm14 #798.22 vfmadd231pd {rn-sae}, %zmm4, %zmm13, %zmm9 #803.22 vfmadd231pd {rn-sae}, %zmm4, %zmm10, %zmm14 #798.22 - vmovups 1216+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm10 #808.22 + vmovups 1216+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm10 #808.22 vfmadd213pd {rn-sae}, %zmm14, %zmm0, %zmm3 #804.23 vmovaps %zmm6, %zmm12 #792.22 vfmsub213pd {rn-sae}, %zmm2, %zmm1, %zmm12 #792.22 vfmadd213pd {rn-sae}, %zmm9, %zmm0, %zmm3 #809.23 vfmadd213pd {rn-sae}, %zmm12, %zmm11, %zmm6 #800.22 vfmadd213pd {rn-sae}, %zmm6, %zmm1, %zmm5 #805.22 - vmovups 1152+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm1 #806.62 - vmovups 1280+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm6 #810.62 + vmovups 1152+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm1 #806.62 + vmovups 1280+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm6 #810.62 vfmadd231pd {rn-sae}, %zmm4, %zmm1, %zmm10 #808.22 - vmovups 1344+__svml_dcbrt_ha_data_internal_avx512(%rip), %zmm1 #811.62 + vmovups 1344+__jsvml_dcbrt_ha_data_internal_avx512(%rip), %zmm1 #811.62 vfmadd213pd {rn-sae}, %zmm10, %zmm0, %zmm3 #813.23 vfmadd231pd {rn-sae}, %zmm4, %zmm6, %zmm1 #812.23 vmulpd {rn-sae}, %zmm4, %zmm2, %zmm4 #814.26 @@ -466,20 +466,20 @@ __svml_cbrt8_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_cbrt8_ha_z0,@function - .size __svml_cbrt8_ha_z0,.-__svml_cbrt8_ha_z0 -..LN__svml_cbrt8_ha_z0.2: + .type __jsvml_cbrt8_ha_z0,@function + .size __jsvml_cbrt8_ha_z0,.-__jsvml_cbrt8_ha_z0 +..LN__jsvml_cbrt8_ha_z0.2: .data -# -- End __svml_cbrt8_ha_z0 +# -- End __jsvml_cbrt8_ha_z0 .text -.L_2__routine_start___svml_cbrt1_ha_l9_3: -# -- Begin __svml_cbrt1_ha_l9 +.L_2__routine_start___jsvml_cbrt1_ha_l9_3: +# -- Begin __jsvml_cbrt1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt1_ha_l9 -# --- __svml_cbrt1_ha_l9(__m128d) -__svml_cbrt1_ha_l9: + .globl __jsvml_cbrt1_ha_l9 +# --- __jsvml_cbrt1_ha_l9(__m128d) +__jsvml_cbrt1_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -488,7 +488,7 @@ __svml_cbrt1_ha_l9: .byte 30 #1091.546 .byte 250 #1091.546 .cfi_startproc -..___tag_value___svml_cbrt1_ha_l9.41: +..___tag_value___jsvml_cbrt1_ha_l9.41: ..L42: #970.1 pushq %rbp #970.1 @@ -499,9 +499,9 @@ __svml_cbrt1_ha_l9: andq $-64, %rsp #970.1 subq $128, %rsp #970.1 vmovapd %xmm0, %xmm4 #970.1 - vmovq 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm14 #1022.19 + vmovq 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm14 #1022.19 vpsrlq $52, %xmm4, %xmm13 #1039.13 - vmovq 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm15 #1023.14 + vmovq 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15 #1023.14 vpand %xmm14, %xmm13, %xmm13 #1040.13 vpmuludq %xmm15, %xmm13, %xmm1 #1041.15 movl $2147483647, %eax #1032.19 @@ -535,37 +535,37 @@ __svml_cbrt1_ha_l9: vpor %xmm3, %xmm12, %xmm5 #1054.12 vmovmskps %xmm10, %eax #1035.40 vpslld $1, %xmm9, %xmm10 #1050.23 - vmovsd 2368+__svml_dcbrt_ha_data_internal(%rip), %xmm8 #1063.17 + vmovsd 2368+__jsvml_dcbrt_ha_data_internal(%rip), %xmm8 #1063.17 vpaddd %xmm2, %xmm5, %xmm2 #1056.12 - vmovsd 2496+__svml_dcbrt_ha_data_internal(%rip), %xmm5 #1059.20 + vmovsd 2496+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5 #1059.20 vandpd %xmm8, %xmm4, %xmm9 #1064.10 vmovd %xmm7, %edi #1038.81 vandpd %xmm5, %xmm4, %xmm6 #1060.9 - vmovsd 2432+__svml_dcbrt_ha_data_internal(%rip), %xmm7 #1061.14 + vmovsd 2432+__jsvml_dcbrt_ha_data_internal(%rip), %xmm7 #1061.14 vpslld $20, %xmm2, %xmm3 #1056.12 vorpd %xmm7, %xmm6, %xmm11 #1062.9 vmovd %xmm10, %r8d #1051.94 - lea __svml_dcbrt_ha_data_internal(%rip), %r11 #1038.11 - vmovsd 2304+__svml_dcbrt_ha_data_internal(%rip), %xmm10 #1065.18 + lea __jsvml_dcbrt_ha_data_internal(%rip), %r11 #1038.11 + vmovsd 2304+__jsvml_dcbrt_ha_data_internal(%rip), %xmm10 #1065.18 vpxor %xmm2, %xmm2, %xmm2 #1057.35 vorpd %xmm10, %xmm9, %xmm12 #1066.10 movslq %edi, %rdi #1038.11 vsubsd %xmm12, %xmm11, %xmm13 #1067.9 vmulsd (%r11,%rdi), %xmm13, %xmm15 #1068.9 vpunpckldq %xmm3, %xmm2, %xmm14 #1057.16 - vmovsd 1792+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1069.10 - vfmadd213sd 1856+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1071.9 - vfmadd213sd 1920+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1073.9 - vfmadd213sd 1984+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1075.9 - vfmadd213sd 2048+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1077.9 + vmovsd 1792+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1069.10 + vfmadd213sd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1071.9 + vfmadd213sd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1073.9 + vfmadd213sd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1075.9 + vfmadd213sd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1077.9 movslq %r8d, %r8 #1051.51 - vfmadd213sd 2112+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1079.9 + vfmadd213sd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1079.9 vmovupd 256(%r11,%r8), %xmm0 #1051.51 vmovsd 264(%r11,%r8), %xmm1 #1051.51 - vfmadd213sd 2176+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1081.9 + vfmadd213sd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1081.9 vmulsd %xmm14, %xmm0, %xmm3 #1084.15 vmulsd %xmm14, %xmm1, %xmm14 #1085.15 - vfmadd213sd 2240+__svml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1083.9 + vfmadd213sd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15, %xmm2 #1083.9 vmulsd %xmm15, %xmm3, %xmm1 #1086.15 vmulsd %xmm1, %xmm2, %xmm0 #1087.9 vaddsd %xmm14, %xmm0, %xmm0 #1088.9 @@ -608,29 +608,29 @@ __svml_cbrt1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1091.546 lea 64(%rsp), %rsi #1091.546 -..___tag_value___svml_cbrt1_ha_l9.54: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #1091.546 -..___tag_value___svml_cbrt1_ha_l9.55: +..___tag_value___jsvml_cbrt1_ha_l9.54: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #1091.546 +..___tag_value___jsvml_cbrt1_ha_l9.55: jmp ..B4.4 # Prob 100% #1091.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_cbrt1_ha_l9,@function - .size __svml_cbrt1_ha_l9,.-__svml_cbrt1_ha_l9 -..LN__svml_cbrt1_ha_l9.3: + .type __jsvml_cbrt1_ha_l9,@function + .size __jsvml_cbrt1_ha_l9,.-__jsvml_cbrt1_ha_l9 +..LN__jsvml_cbrt1_ha_l9.3: .data -# -- End __svml_cbrt1_ha_l9 +# -- End __jsvml_cbrt1_ha_l9 .text -.L_2__routine_start___svml_cbrt2_ha_l9_4: -# -- Begin __svml_cbrt2_ha_l9 +.L_2__routine_start___jsvml_cbrt2_ha_l9_4: +# -- Begin __jsvml_cbrt2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt2_ha_l9 -# --- __svml_cbrt2_ha_l9(__m128d) -__svml_cbrt2_ha_l9: + .globl __jsvml_cbrt2_ha_l9 +# --- __jsvml_cbrt2_ha_l9(__m128d) +__jsvml_cbrt2_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -639,7 +639,7 @@ __svml_cbrt2_ha_l9: .byte 30 #1220.546 .byte 250 #1220.546 .cfi_startproc -..___tag_value___svml_cbrt2_ha_l9.57: +..___tag_value___jsvml_cbrt2_ha_l9.57: ..L58: #1099.1 pushq %rbp #1099.1 @@ -650,21 +650,21 @@ __svml_cbrt2_ha_l9: andq $-64, %rsp #1099.1 subq $192, %rsp #1099.1 vmovapd %xmm0, %xmm8 #1099.1 - vmovq 2816+__svml_dcbrt_ha_data_internal(%rip), %xmm9 #1154.17 + vmovq 2816+__jsvml_dcbrt_ha_data_internal(%rip), %xmm9 #1154.17 vpsrlq $52, %xmm8, %xmm2 #1168.13 vpshufd $221, %xmm8, %xmm7 #1160.11 - lea __svml_dcbrt_ha_data_internal(%rip), %r8 #1167.28 - vmovq 3008+__svml_dcbrt_ha_data_internal(%rip), %xmm11 #1157.13 + lea __jsvml_dcbrt_ha_data_internal(%rip), %r8 #1167.28 + vmovq 3008+__jsvml_dcbrt_ha_data_internal(%rip), %xmm11 #1157.13 vpand %xmm9, %xmm7, %xmm10 #1161.19 vpsubd %xmm11, %xmm10, %xmm12 #1162.19 - vpand 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm2, %xmm11 #1169.13 - vpmuludq 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm11, %xmm9 #1170.15 - vmovq 3072+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1158.13 + vpand 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2, %xmm11 #1169.13 + vpmuludq 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm11, %xmm9 #1170.15 + vmovq 3072+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1158.13 vpshufd $136, %xmm9, %xmm10 #1172.15 vpcmpgtd %xmm13, %xmm12, %xmm14 #1163.19 vpshufd $136, %xmm11, %xmm12 #1171.13 vpsrld $14, %xmm10, %xmm2 #1173.15 - vmovq 2752+__svml_dcbrt_ha_data_internal(%rip), %xmm15 #1153.22 + vmovq 2752+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15 #1153.22 vpsubd %xmm2, %xmm12, %xmm13 #1175.13 vmovmskps %xmm14, %eax #1164.40 vpaddd %xmm2, %xmm2, %xmm14 #1176.13 @@ -674,8 +674,8 @@ __svml_cbrt2_ha_l9: vpslld $8, %xmm15, %xmm0 #1177.13 vmovd %xmm3, %edx #1167.98 vpsrld $20, %xmm7, %xmm7 #1181.14 - vmovq 2880+__svml_dcbrt_ha_data_internal(%rip), %xmm5 #1155.18 - vmovq 2944+__svml_dcbrt_ha_data_internal(%rip), %xmm6 #1156.14 + vmovq 2880+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5 #1155.18 + vmovq 2944+__jsvml_dcbrt_ha_data_internal(%rip), %xmm6 #1156.14 vpand %xmm5, %xmm7, %xmm5 #1182.14 vpextrd $1, %xmm3, %ecx #1167.205 vpaddd %xmm0, %xmm3, %xmm3 #1179.23 @@ -683,9 +683,9 @@ __svml_cbrt2_ha_l9: vpor %xmm6, %xmm5, %xmm6 #1183.12 vmovd %xmm0, %esi #1180.119 vpaddd %xmm2, %xmm6, %xmm2 #1185.12 - vandpd 2496+__svml_dcbrt_ha_data_internal(%rip), %xmm8, %xmm6 #1189.9 + vandpd 2496+__jsvml_dcbrt_ha_data_internal(%rip), %xmm8, %xmm6 #1189.9 vpslld $20, %xmm2, %xmm5 #1185.12 - vandpd 2368+__svml_dcbrt_ha_data_internal(%rip), %xmm8, %xmm7 #1193.10 + vandpd 2368+__jsvml_dcbrt_ha_data_internal(%rip), %xmm8, %xmm7 #1193.10 vpextrd $1, %xmm0, %edi #1180.270 movslq %edx, %rdx #1167.28 movslq %esi, %rsi #1180.67 @@ -697,22 +697,22 @@ __svml_cbrt2_ha_l9: vmovhpd (%r8,%rcx), %xmm1, %xmm4 #1167.11 vunpcklpd %xmm9, %xmm3, %xmm1 #1180.326 vunpckhpd %xmm9, %xmm3, %xmm0 #1180.369 - vorpd 2432+__svml_dcbrt_ha_data_internal(%rip), %xmm6, %xmm9 #1191.9 + vorpd 2432+__jsvml_dcbrt_ha_data_internal(%rip), %xmm6, %xmm9 #1191.9 vpxor %xmm3, %xmm3, %xmm3 #1186.35 - vorpd 2304+__svml_dcbrt_ha_data_internal(%rip), %xmm7, %xmm10 #1195.10 + vorpd 2304+__jsvml_dcbrt_ha_data_internal(%rip), %xmm7, %xmm10 #1195.10 vsubpd %xmm10, %xmm9, %xmm11 #1196.9 vmulpd %xmm11, %xmm4, %xmm4 #1197.9 - vmovupd 1792+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1198.41 - vfmadd213pd 1856+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1200.9 + vmovupd 1792+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1198.41 + vfmadd213pd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1200.9 vpunpckldq %xmm5, %xmm3, %xmm12 #1186.16 vmulpd %xmm12, %xmm1, %xmm1 #1213.15 - vfmadd213pd 1920+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1202.9 + vfmadd213pd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1202.9 vmulpd %xmm12, %xmm0, %xmm0 #1214.15 - vfmadd213pd 1984+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1204.9 - vfmadd213pd 2048+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1206.9 - vfmadd213pd 2112+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1208.9 - vfmadd213pd 2176+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1210.9 - vfmadd213pd 2240+__svml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1212.9 + vfmadd213pd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1204.9 + vfmadd213pd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1206.9 + vfmadd213pd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1208.9 + vfmadd213pd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1210.9 + vfmadd213pd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4, %xmm2 #1212.9 vmulpd %xmm1, %xmm4, %xmm4 #1215.15 vmulpd %xmm4, %xmm2, %xmm12 #1216.9 vaddpd %xmm12, %xmm0, %xmm3 #1217.9 @@ -772,29 +772,29 @@ __svml_cbrt2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1220.546 lea 128(%rsp,%r12,8), %rsi #1220.546 -..___tag_value___svml_cbrt2_ha_l9.75: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #1220.546 -..___tag_value___svml_cbrt2_ha_l9.76: +..___tag_value___jsvml_cbrt2_ha_l9.75: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #1220.546 +..___tag_value___jsvml_cbrt2_ha_l9.76: jmp ..B5.8 # Prob 100% #1220.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrt2_ha_l9,@function - .size __svml_cbrt2_ha_l9,.-__svml_cbrt2_ha_l9 -..LN__svml_cbrt2_ha_l9.4: + .type __jsvml_cbrt2_ha_l9,@function + .size __jsvml_cbrt2_ha_l9,.-__jsvml_cbrt2_ha_l9 +..LN__jsvml_cbrt2_ha_l9.4: .data -# -- End __svml_cbrt2_ha_l9 +# -- End __jsvml_cbrt2_ha_l9 .text -.L_2__routine_start___svml_cbrt2_ha_e9_5: -# -- Begin __svml_cbrt2_ha_e9 +.L_2__routine_start___jsvml_cbrt2_ha_e9_5: +# -- Begin __jsvml_cbrt2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt2_ha_e9 -# --- __svml_cbrt2_ha_e9(__m128d) -__svml_cbrt2_ha_e9: + .globl __jsvml_cbrt2_ha_e9 +# --- __jsvml_cbrt2_ha_e9(__m128d) +__jsvml_cbrt2_ha_e9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -803,7 +803,7 @@ __svml_cbrt2_ha_e9: .byte 30 #1349.546 .byte 250 #1349.546 .cfi_startproc -..___tag_value___svml_cbrt2_ha_e9.78: +..___tag_value___jsvml_cbrt2_ha_e9.78: ..L79: #1228.1 pushq %rbp #1228.1 @@ -815,18 +815,18 @@ __svml_cbrt2_ha_e9: subq $192, %rsp #1228.1 movaps %xmm0, %xmm9 #1297.17 psrlq $52, %xmm9 #1297.17 - lea __svml_dcbrt_ha_data_internal(%rip), %r8 #1296.28 - pand 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm9 #1298.17 - movdqu 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm8 #1299.19 + lea __jsvml_dcbrt_ha_data_internal(%rip), %r8 #1296.28 + pand 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm9 #1298.17 + movdqu 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm8 #1299.19 pmuludq %xmm9, %xmm8 #1299.19 - movq 2752+__svml_dcbrt_ha_data_internal(%rip), %xmm12 #1294.22 - movq 2816+__svml_dcbrt_ha_data_internal(%rip), %xmm7 #1290.23 + movq 2752+__jsvml_dcbrt_ha_data_internal(%rip), %xmm12 #1294.22 + movq 2816+__jsvml_dcbrt_ha_data_internal(%rip), %xmm7 #1290.23 pshufd $221, %xmm0, %xmm3 #1289.15 - movq 2880+__svml_dcbrt_ha_data_internal(%rip), %xmm1 #1284.22 + movq 2880+__jsvml_dcbrt_ha_data_internal(%rip), %xmm1 #1284.22 pand %xmm3, %xmm7 #1290.23 pand %xmm3, %xmm12 #1294.22 psrld $20, %xmm3 #1310.18 - movq 2944+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1285.18 + movq 2944+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1285.18 pand %xmm1, %xmm3 #1311.18 pshufd $136, %xmm8, %xmm14 #1301.19 por %xmm2, %xmm3 #1312.16 @@ -839,46 +839,46 @@ __svml_cbrt2_ha_e9: movd %xmm12, %edx #1296.98 paddd %xmm14, %xmm10 #1305.17 punpckldq %xmm3, %xmm1 #1315.16 - movups 2496+__svml_dcbrt_ha_data_internal(%rip), %xmm3 #1318.9 - movups 2368+__svml_dcbrt_ha_data_internal(%rip), %xmm15 #1322.10 + movups 2496+__jsvml_dcbrt_ha_data_internal(%rip), %xmm3 #1318.9 + movups 2368+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15 #1322.10 andps %xmm0, %xmm3 #1318.9 andps %xmm0, %xmm15 #1322.10 - orps 2432+__svml_dcbrt_ha_data_internal(%rip), %xmm3 #1320.9 - orps 2304+__svml_dcbrt_ha_data_internal(%rip), %xmm15 #1324.10 + orps 2432+__jsvml_dcbrt_ha_data_internal(%rip), %xmm3 #1320.9 + orps 2304+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15 #1324.10 movslq %edx, %rdx #1296.28 pextrd $1, %xmm12, %ecx #1296.205 subpd %xmm15, %xmm3 #1325.9 movslq %ecx, %rcx #1296.135 movsd (%r8,%rdx), %xmm4 #1296.28 - movups 1792+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1327.41 + movups 1792+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1327.41 pshufd $136, %xmm9, %xmm11 #1300.17 movhpd (%r8,%rcx), %xmm4 #1296.11 psubd %xmm14, %xmm11 #1304.17 mulpd %xmm3, %xmm4 #1326.9 mulpd %xmm4, %xmm2 #1329.21 - addpd 1856+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1329.9 + addpd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1329.9 mulpd %xmm4, %xmm2 #1331.21 - addpd 1920+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1331.9 + addpd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1331.9 mulpd %xmm4, %xmm2 #1333.21 - addpd 1984+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1333.9 + addpd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1333.9 mulpd %xmm4, %xmm2 #1335.21 - addpd 2048+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1335.9 + addpd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1335.9 mulpd %xmm4, %xmm2 #1337.21 - addpd 2112+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1337.9 + addpd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1337.9 psubd %xmm10, %xmm11 #1305.17 pslld $8, %xmm11 #1306.17 paddd %xmm11, %xmm12 #1308.27 mulpd %xmm4, %xmm2 #1339.21 pslld $1, %xmm12 #1308.27 movd %xmm12, %esi #1309.119 - movq 3008+__svml_dcbrt_ha_data_internal(%rip), %xmm5 #1286.17 - movq 3072+__svml_dcbrt_ha_data_internal(%rip), %xmm6 #1287.17 + movq 3008+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5 #1286.17 + movq 3072+__jsvml_dcbrt_ha_data_internal(%rip), %xmm6 #1287.17 psubd %xmm5, %xmm7 #1291.23 movslq %esi, %rsi #1309.67 pcmpgtd %xmm6, %xmm7 #1292.23 pextrd $1, %xmm12, %edi #1309.270 movslq %edi, %rdi #1309.218 - addpd 2176+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1339.9 + addpd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1339.9 movmskps %xmm7, %eax #1293.40 movups 256(%r8,%rsi), %xmm5 #1309.67 movups 256(%r8,%rdi), %xmm13 #1309.218 @@ -887,7 +887,7 @@ __svml_cbrt2_ha_e9: mulpd %xmm1, %xmm6 #1342.15 mulpd %xmm4, %xmm2 #1341.21 mulpd %xmm6, %xmm4 #1344.15 - addpd 2240+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1341.9 + addpd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1341.9 unpckhpd %xmm13, %xmm5 #1309.369 mulpd %xmm1, %xmm5 #1343.15 mulpd %xmm4, %xmm2 #1345.9 @@ -949,29 +949,29 @@ __svml_cbrt2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1349.546 lea 128(%rsp,%r12,8), %rsi #1349.546 -..___tag_value___svml_cbrt2_ha_e9.96: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #1349.546 -..___tag_value___svml_cbrt2_ha_e9.97: +..___tag_value___jsvml_cbrt2_ha_e9.96: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #1349.546 +..___tag_value___jsvml_cbrt2_ha_e9.97: jmp ..B6.8 # Prob 100% #1349.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrt2_ha_e9,@function - .size __svml_cbrt2_ha_e9,.-__svml_cbrt2_ha_e9 -..LN__svml_cbrt2_ha_e9.5: + .type __jsvml_cbrt2_ha_e9,@function + .size __jsvml_cbrt2_ha_e9,.-__jsvml_cbrt2_ha_e9 +..LN__jsvml_cbrt2_ha_e9.5: .data -# -- End __svml_cbrt2_ha_e9 +# -- End __jsvml_cbrt2_ha_e9 .text -.L_2__routine_start___svml_cbrt1_ha_ex_6: -# -- Begin __svml_cbrt1_ha_ex +.L_2__routine_start___jsvml_cbrt1_ha_ex_6: +# -- Begin __jsvml_cbrt1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt1_ha_ex -# --- __svml_cbrt1_ha_ex(__m128d) -__svml_cbrt1_ha_ex: + .globl __jsvml_cbrt1_ha_ex +# --- __jsvml_cbrt1_ha_ex(__m128d) +__jsvml_cbrt1_ha_ex: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -980,7 +980,7 @@ __svml_cbrt1_ha_ex: .byte 30 #1478.546 .byte 250 #1478.546 .cfi_startproc -..___tag_value___svml_cbrt1_ha_ex.99: +..___tag_value___jsvml_cbrt1_ha_ex.99: ..L100: #1357.1 pushq %rbp #1357.1 @@ -1008,22 +1008,22 @@ __svml_cbrt1_ha_ex: pand %xmm11, %xmm0 #1440.12 psrld $12, %xmm10 #1424.16 por %xmm12, %xmm0 #1441.10 - lea __svml_dcbrt_ha_data_internal(%rip), %r11 #1425.17 - movsd 2496+__svml_dcbrt_ha_data_internal(%rip), %xmm12 #1447.9 + lea __jsvml_dcbrt_ha_data_internal(%rip), %r11 #1425.17 + movsd 2496+__jsvml_dcbrt_ha_data_internal(%rip), %xmm12 #1447.9 movl $-2146435072, %edx #1420.17 - movsd 2432+__svml_dcbrt_ha_data_internal(%rip), %xmm14 #1448.14 + movsd 2432+__jsvml_dcbrt_ha_data_internal(%rip), %xmm14 #1448.14 andps %xmm1, %xmm12 #1447.9 orps %xmm14, %xmm12 #1449.9 pxor %xmm11, %xmm11 #1444.16 - movsd 2368+__svml_dcbrt_ha_data_internal(%rip), %xmm14 #1450.17 + movsd 2368+__jsvml_dcbrt_ha_data_internal(%rip), %xmm14 #1450.17 movl $-2097153, %ecx #1421.17 - movq 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm5 #1409.17 + movq 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5 #1409.17 andps %xmm1, %xmm14 #1451.10 - movsd 2304+__svml_dcbrt_ha_data_internal(%rip), %xmm15 #1452.18 + movsd 2304+__jsvml_dcbrt_ha_data_internal(%rip), %xmm15 #1452.18 pand %xmm5, %xmm7 #1427.11 movd %xmm10, %edi #1425.87 orps %xmm15, %xmm14 #1453.10 - movq 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm6 #1428.13 + movq 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm6 #1428.13 movd %edx, %xmm2 #1420.17 pshufd $0, %xmm7, %xmm9 #1429.11 psubd %xmm2, %xmm4 #1420.17 @@ -1041,34 +1041,34 @@ __svml_cbrt1_ha_ex: movmskps %xmm4, %eax #1422.40 punpckldq %xmm0, %xmm11 #1444.16 psubd %xmm13, %xmm9 #1433.11 - movsd 1792+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1456.10 + movsd 1792+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1456.10 paddd %xmm13, %xmm8 #1434.11 mulsd %xmm12, %xmm0 #1458.21 psubd %xmm8, %xmm9 #1434.11 pslld $8, %xmm9 #1435.11 - addsd 1856+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1458.9 + addsd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1458.9 mulsd %xmm12, %xmm0 #1460.21 paddd %xmm9, %xmm10 #1437.21 pslld $1, %xmm10 #1437.21 - addsd 1920+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1460.9 + addsd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1460.9 movd %xmm10, %r8d #1438.100 mulsd %xmm12, %xmm0 #1462.21 movslq %r8d, %r8 #1438.57 - addsd 1984+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1462.9 + addsd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1462.9 mulsd %xmm12, %xmm0 #1464.21 movups 256(%r11,%r8), %xmm3 #1438.57 mulsd %xmm11, %xmm3 #1471.15 - addsd 2048+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1464.9 + addsd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1464.9 mulsd %xmm12, %xmm0 #1466.21 movaps %xmm3, %xmm13 #1473.15 mulsd %xmm12, %xmm13 #1473.15 - addsd 2112+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1466.9 + addsd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1466.9 mulsd %xmm12, %xmm0 #1468.21 movsd 264(%r11,%r8), %xmm2 #1438.57 mulsd %xmm11, %xmm2 #1472.15 - addsd 2176+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1468.9 + addsd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1468.9 mulsd %xmm12, %xmm0 #1470.21 - addsd 2240+__svml_dcbrt_ha_data_internal(%rip), %xmm0 #1470.9 + addsd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0 #1470.9 mulsd %xmm13, %xmm0 #1474.9 addsd %xmm2, %xmm0 #1475.9 addsd %xmm3, %xmm0 #1476.10 @@ -1106,29 +1106,29 @@ __svml_cbrt1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1478.546 lea 64(%rsp), %rsi #1478.546 -..___tag_value___svml_cbrt1_ha_ex.112: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #1478.546 -..___tag_value___svml_cbrt1_ha_ex.113: +..___tag_value___jsvml_cbrt1_ha_ex.112: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #1478.546 +..___tag_value___jsvml_cbrt1_ha_ex.113: jmp ..B7.4 # Prob 100% #1478.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_cbrt1_ha_ex,@function - .size __svml_cbrt1_ha_ex,.-__svml_cbrt1_ha_ex -..LN__svml_cbrt1_ha_ex.6: + .type __jsvml_cbrt1_ha_ex,@function + .size __jsvml_cbrt1_ha_ex,.-__jsvml_cbrt1_ha_ex +..LN__jsvml_cbrt1_ha_ex.6: .data -# -- End __svml_cbrt1_ha_ex +# -- End __jsvml_cbrt1_ha_ex .text -.L_2__routine_start___svml_cbrt4_ha_e9_7: -# -- Begin __svml_cbrt4_ha_e9 +.L_2__routine_start___jsvml_cbrt4_ha_e9_7: +# -- Begin __jsvml_cbrt4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt4_ha_e9 -# --- __svml_cbrt4_ha_e9(__m256d) -__svml_cbrt4_ha_e9: + .globl __jsvml_cbrt4_ha_e9 +# --- __jsvml_cbrt4_ha_e9(__m256d) +__jsvml_cbrt4_ha_e9: # parameter 1: %ymm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1137,7 +1137,7 @@ __svml_cbrt4_ha_e9: .byte 30 #1607.552 .byte 250 #1607.552 .cfi_startproc -..___tag_value___svml_cbrt4_ha_e9.115: +..___tag_value___jsvml_cbrt4_ha_e9.115: ..L116: #1486.1 pushq %rbp #1486.1 @@ -1147,24 +1147,24 @@ __svml_cbrt4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1486.1 subq $192, %rsp #1486.1 - lea __svml_dcbrt_ha_data_internal(%rip), %rax #1554.74 + lea __jsvml_dcbrt_ha_data_internal(%rip), %rax #1554.74 vmovapd %ymm0, %ymm11 #1486.1 - vmovupd 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm8 #1538.23 - vmovupd 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm7 #1539.18 + vmovupd 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm8 #1538.23 + vmovupd 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm7 #1539.18 vpsrlq $52, %xmm11, %xmm4 #1555.17 vextractf128 $1, %ymm11, %xmm9 #1546.101 vshufps $221, %xmm9, %xmm11, %xmm10 #1547.33 vpsrlq $52, %xmm9, %xmm9 #1555.68 - vandps 2752+__svml_dcbrt_ha_data_internal(%rip), %xmm10, %xmm15 #1552.22 + vandps 2752+__jsvml_dcbrt_ha_data_internal(%rip), %xmm10, %xmm15 #1552.22 vpsrld $12, %xmm15, %xmm6 #1553.22 - vandps 2816+__svml_dcbrt_ha_data_internal(%rip), %xmm10, %xmm12 #1548.23 + vandps 2816+__jsvml_dcbrt_ha_data_internal(%rip), %xmm10, %xmm12 #1548.23 vpsrld $20, %xmm10, %xmm10 #1568.18 vmovd %xmm6, %ecx #1554.144 - vpsubd 3008+__svml_dcbrt_ha_data_internal(%rip), %xmm12, %xmm13 #1549.23 + vpsubd 3008+__jsvml_dcbrt_ha_data_internal(%rip), %xmm12, %xmm13 #1549.23 vpand %xmm8, %xmm4, %xmm12 #1556.17 vpand %xmm8, %xmm9, %xmm8 #1556.86 vpextrd $2, %xmm6, %edi #1554.381 - vpcmpgtd 3072+__svml_dcbrt_ha_data_internal(%rip), %xmm13, %xmm14 #1550.23 + vpcmpgtd 3072+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13, %xmm14 #1550.23 vpmuludq %xmm7, %xmm12, %xmm13 #1557.19 vpmuludq %xmm7, %xmm8, %xmm7 #1557.85 vmovmskps %xmm14, %edx #1551.40 @@ -1182,8 +1182,8 @@ __svml_cbrt4_ha_e9: vmovhpd (%rax,%r8), %xmm1, %xmm3 #1554.294 vshufps $136, %xmm8, %xmm12, %xmm15 #1558.35 vpsubd %xmm4, %xmm15, %xmm0 #1562.17 - vandpd 2368+__svml_dcbrt_ha_data_internal(%rip), %ymm11, %ymm12 #1580.10 - vorpd 2304+__svml_dcbrt_ha_data_internal(%rip), %ymm12, %ymm14 #1582.10 + vandpd 2368+__jsvml_dcbrt_ha_data_internal(%rip), %ymm11, %ymm12 #1580.10 + vorpd 2304+__jsvml_dcbrt_ha_data_internal(%rip), %ymm12, %ymm14 #1582.10 vinsertf128 $1, %xmm3, %ymm2, %ymm5 #1554.11 vpaddd %xmm4, %xmm4, %xmm2 #1563.17 vpsubd %xmm2, %xmm0, %xmm1 #1563.17 @@ -1195,22 +1195,22 @@ __svml_cbrt4_ha_e9: movslq %r10d, %r10 #1567.174 vpextrd $2, %xmm0, %r11d #1567.358 vpextrd $3, %xmm0, %ecx #1567.490 - vpand 2880+__svml_dcbrt_ha_data_internal(%rip), %xmm10, %xmm0 #1569.18 - vandpd 2496+__svml_dcbrt_ha_data_internal(%rip), %ymm11, %ymm10 #1576.9 - vorpd 2432+__svml_dcbrt_ha_data_internal(%rip), %ymm10, %ymm13 #1578.9 + vpand 2880+__jsvml_dcbrt_ha_data_internal(%rip), %xmm10, %xmm0 #1569.18 + vandpd 2496+__jsvml_dcbrt_ha_data_internal(%rip), %ymm11, %ymm10 #1576.9 + vorpd 2432+__jsvml_dcbrt_ha_data_internal(%rip), %ymm10, %ymm13 #1578.9 movslq %ecx, %rcx #1567.438 vsubpd %ymm14, %ymm13, %ymm15 #1583.9 vmovupd 256(%rax,%r10), %xmm1 #1567.174 movslq %r9d, %r9 #1567.45 movslq %r11d, %r11 #1567.306 vinsertf128 $1, 256(%rax,%rcx), %ymm1, %ymm7 #1567.629 - vpor 2944+__svml_dcbrt_ha_data_internal(%rip), %xmm0, %xmm1 #1570.16 + vpor 2944+__jsvml_dcbrt_ha_data_internal(%rip), %xmm0, %xmm1 #1570.16 vmulpd %ymm15, %ymm5, %ymm0 #1584.9 vpaddd %xmm4, %xmm1, %xmm4 #1572.16 vpslld $20, %xmm4, %xmm8 #1572.16 vmovupd 256(%rax,%r9), %xmm2 #1567.45 - vmulpd 1792+__svml_dcbrt_ha_data_internal(%rip), %ymm0, %ymm5 #1587.24 - vaddpd 1856+__svml_dcbrt_ha_data_internal(%rip), %ymm5, %ymm4 #1587.9 + vmulpd 1792+__jsvml_dcbrt_ha_data_internal(%rip), %ymm0, %ymm5 #1587.24 + vaddpd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %ymm5, %ymm4 #1587.9 vmulpd %ymm4, %ymm0, %ymm5 #1589.24 vinsertf128 $1, 256(%rax,%r11), %ymm2, %ymm6 #1567.548 vunpcklpd %ymm7, %ymm6, %ymm3 #1567.708 @@ -1219,20 +1219,20 @@ __svml_cbrt4_ha_e9: vpunpckldq %xmm8, %xmm7, %xmm6 #1573.16 vpunpckhdq %xmm8, %xmm7, %xmm9 #1573.106 vinsertf128 $1, %xmm9, %ymm6, %ymm1 #1574.10 - vaddpd 1920+__svml_dcbrt_ha_data_internal(%rip), %ymm5, %ymm6 #1589.9 + vaddpd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %ymm5, %ymm6 #1589.9 vmulpd %ymm1, %ymm3, %ymm3 #1600.15 vmulpd %ymm1, %ymm2, %ymm1 #1601.15 vmulpd %ymm6, %ymm0, %ymm7 #1591.24 - vaddpd 1984+__svml_dcbrt_ha_data_internal(%rip), %ymm7, %ymm8 #1591.9 + vaddpd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %ymm7, %ymm8 #1591.9 vmulpd %ymm8, %ymm0, %ymm9 #1593.24 - vaddpd 2048+__svml_dcbrt_ha_data_internal(%rip), %ymm9, %ymm10 #1593.9 + vaddpd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %ymm9, %ymm10 #1593.9 vmulpd %ymm10, %ymm0, %ymm12 #1595.24 - vaddpd 2112+__svml_dcbrt_ha_data_internal(%rip), %ymm12, %ymm13 #1595.9 + vaddpd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %ymm12, %ymm13 #1595.9 vmulpd %ymm13, %ymm0, %ymm14 #1597.24 - vaddpd 2176+__svml_dcbrt_ha_data_internal(%rip), %ymm14, %ymm15 #1597.9 + vaddpd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %ymm14, %ymm15 #1597.9 vmulpd %ymm15, %ymm0, %ymm4 #1599.24 vmulpd %ymm3, %ymm0, %ymm0 #1602.15 - vaddpd 2240+__svml_dcbrt_ha_data_internal(%rip), %ymm4, %ymm5 #1599.9 + vaddpd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %ymm4, %ymm5 #1599.9 vmulpd %ymm0, %ymm5, %ymm2 #1603.9 vaddpd %ymm2, %ymm1, %ymm0 #1604.9 vaddpd %ymm0, %ymm3, %ymm0 #1605.10 @@ -1295,29 +1295,29 @@ __svml_cbrt4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1607.552 lea 128(%rsp,%r12,8), %rsi #1607.552 -..___tag_value___svml_cbrt4_ha_e9.133: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #1607.552 -..___tag_value___svml_cbrt4_ha_e9.134: +..___tag_value___jsvml_cbrt4_ha_e9.133: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #1607.552 +..___tag_value___jsvml_cbrt4_ha_e9.134: jmp ..B8.8 # Prob 100% #1607.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrt4_ha_e9,@function - .size __svml_cbrt4_ha_e9,.-__svml_cbrt4_ha_e9 -..LN__svml_cbrt4_ha_e9.7: + .type __jsvml_cbrt4_ha_e9,@function + .size __jsvml_cbrt4_ha_e9,.-__jsvml_cbrt4_ha_e9 +..LN__jsvml_cbrt4_ha_e9.7: .data -# -- End __svml_cbrt4_ha_e9 +# -- End __jsvml_cbrt4_ha_e9 .text -.L_2__routine_start___svml_cbrt2_ha_ex_8: -# -- Begin __svml_cbrt2_ha_ex +.L_2__routine_start___jsvml_cbrt2_ha_ex_8: +# -- Begin __jsvml_cbrt2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cbrt2_ha_ex -# --- __svml_cbrt2_ha_ex(__m128d) -__svml_cbrt2_ha_ex: + .globl __jsvml_cbrt2_ha_ex +# --- __jsvml_cbrt2_ha_ex(__m128d) +__jsvml_cbrt2_ha_ex: # parameter 1: %xmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1326,7 +1326,7 @@ __svml_cbrt2_ha_ex: .byte 30 #1736.546 .byte 250 #1736.546 .cfi_startproc -..___tag_value___svml_cbrt2_ha_ex.136: +..___tag_value___jsvml_cbrt2_ha_ex.136: ..L137: #1615.1 pushq %rbp #1615.1 @@ -1338,20 +1338,20 @@ __svml_cbrt2_ha_ex: subq $192, %rsp #1615.1 movaps %xmm0, %xmm10 #1684.11 psrlq $52, %xmm10 #1684.11 - lea __svml_dcbrt_ha_data_internal(%rip), %r8 #1683.33 - pand 2624+__svml_dcbrt_ha_data_internal(%rip), %xmm10 #1685.11 - movdqu 2688+__svml_dcbrt_ha_data_internal(%rip), %xmm9 #1686.13 + lea __jsvml_dcbrt_ha_data_internal(%rip), %r8 #1683.33 + pand 2624+__jsvml_dcbrt_ha_data_internal(%rip), %xmm10 #1685.11 + movdqu 2688+__jsvml_dcbrt_ha_data_internal(%rip), %xmm9 #1686.13 pmuludq %xmm10, %xmm9 #1686.13 - movq 2752+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1681.16 - movq 2816+__svml_dcbrt_ha_data_internal(%rip), %xmm7 #1677.17 + movq 2752+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1681.16 + movq 2816+__jsvml_dcbrt_ha_data_internal(%rip), %xmm7 #1677.17 pshufd $221, %xmm0, %xmm4 #1676.9 - movq 2880+__svml_dcbrt_ha_data_internal(%rip), %xmm3 #1671.16 + movq 2880+__jsvml_dcbrt_ha_data_internal(%rip), %xmm3 #1671.16 pand %xmm4, %xmm7 #1677.17 - movq 3008+__svml_dcbrt_ha_data_internal(%rip), %xmm5 #1673.11 + movq 3008+__jsvml_dcbrt_ha_data_internal(%rip), %xmm5 #1673.11 pand %xmm4, %xmm13 #1681.16 psrld $20, %xmm4 #1697.12 psubd %xmm5, %xmm7 #1678.17 - movq 2944+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1672.12 + movq 2944+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1672.12 pand %xmm3, %xmm4 #1698.12 pshufd $136, %xmm9, %xmm5 #1688.13 por %xmm2, %xmm4 #1699.10 @@ -1365,13 +1365,13 @@ __svml_cbrt2_ha_ex: paddd %xmm5, %xmm11 #1692.11 pshufd $1, %xmm13, %xmm8 #1683.226 punpckldq %xmm4, %xmm3 #1702.16 - movups 2496+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1705.9 - movups 2368+__svml_dcbrt_ha_data_internal(%rip), %xmm4 #1709.10 + movups 2496+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1705.9 + movups 2368+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4 #1709.10 andps %xmm0, %xmm2 #1705.9 movd %xmm8, %ecx #1683.208 andps %xmm0, %xmm4 #1709.10 - orps 2432+__svml_dcbrt_ha_data_internal(%rip), %xmm2 #1707.9 - orps 2304+__svml_dcbrt_ha_data_internal(%rip), %xmm4 #1711.10 + orps 2432+__jsvml_dcbrt_ha_data_internal(%rip), %xmm2 #1707.9 + orps 2304+__jsvml_dcbrt_ha_data_internal(%rip), %xmm4 #1711.10 movslq %edx, %rdx #1683.33 subpd %xmm4, %xmm2 #1712.9 movslq %ecx, %rcx #1683.138 @@ -1386,25 +1386,25 @@ __svml_cbrt2_ha_ex: pslld $1, %xmm13 #1695.21 movd %xmm13, %esi #1696.119 pshufd $1, %xmm13, %xmm14 #1696.286 - movups 1792+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1714.41 + movups 1792+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1714.41 mulpd %xmm1, %xmm13 #1716.21 movd %xmm14, %edi #1696.268 - movq 3072+__svml_dcbrt_ha_data_internal(%rip), %xmm6 #1674.11 + movq 3072+__jsvml_dcbrt_ha_data_internal(%rip), %xmm6 #1674.11 pcmpgtd %xmm6, %xmm7 #1679.17 - addpd 1856+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1716.9 + addpd 1856+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1716.9 movmskps %xmm7, %eax #1680.40 mulpd %xmm1, %xmm13 #1718.21 - addpd 1920+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1718.9 + addpd 1920+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1718.9 mulpd %xmm1, %xmm13 #1720.21 - addpd 1984+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1720.9 + addpd 1984+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1720.9 mulpd %xmm1, %xmm13 #1722.21 - addpd 2048+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1722.9 + addpd 2048+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1722.9 mulpd %xmm1, %xmm13 #1724.21 - addpd 2112+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1724.9 + addpd 2112+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1724.9 mulpd %xmm1, %xmm13 #1726.21 movslq %esi, %rsi #1696.67 movslq %edi, %rdi #1696.216 - addpd 2176+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1726.9 + addpd 2176+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1726.9 movups 256(%r8,%rsi), %xmm6 #1696.67 movups 256(%r8,%rdi), %xmm15 #1696.216 movaps %xmm6, %xmm7 #1696.365 @@ -1412,7 +1412,7 @@ __svml_cbrt2_ha_ex: mulpd %xmm3, %xmm7 #1729.15 mulpd %xmm1, %xmm13 #1728.21 mulpd %xmm7, %xmm1 #1731.15 - addpd 2240+__svml_dcbrt_ha_data_internal(%rip), %xmm13 #1728.9 + addpd 2240+__jsvml_dcbrt_ha_data_internal(%rip), %xmm13 #1728.9 unpckhpd %xmm15, %xmm6 #1696.414 mulpd %xmm3, %xmm6 #1730.15 mulpd %xmm1, %xmm13 #1732.9 @@ -1474,30 +1474,30 @@ __svml_cbrt2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1736.546 lea 128(%rsp,%r12,8), %rsi #1736.546 -..___tag_value___svml_cbrt2_ha_ex.154: -# __svml_dcbrt_ha_cout_rare_internal(const double *, double *) - call __svml_dcbrt_ha_cout_rare_internal #1736.546 -..___tag_value___svml_cbrt2_ha_ex.155: +..___tag_value___jsvml_cbrt2_ha_ex.154: +# __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcbrt_ha_cout_rare_internal #1736.546 +..___tag_value___jsvml_cbrt2_ha_ex.155: jmp ..B9.8 # Prob 100% #1736.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrt2_ha_ex,@function - .size __svml_cbrt2_ha_ex,.-__svml_cbrt2_ha_ex -..LN__svml_cbrt2_ha_ex.8: + .type __jsvml_cbrt2_ha_ex,@function + .size __jsvml_cbrt2_ha_ex,.-__jsvml_cbrt2_ha_ex +..LN__jsvml_cbrt2_ha_ex.8: .data -# -- End __svml_cbrt2_ha_ex +# -- End __jsvml_cbrt2_ha_ex .text -.L_2__routine_start___svml_dcbrt_ha_cout_rare_internal_9: -# -- Begin __svml_dcbrt_ha_cout_rare_internal +.L_2__routine_start___jsvml_dcbrt_ha_cout_rare_internal_9: +# -- Begin __jsvml_dcbrt_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dcbrt_ha_cout_rare_internal - .globl __svml_dcbrt_ha_cout_rare_internal -# --- __svml_dcbrt_ha_cout_rare_internal(const double *, double *) -__svml_dcbrt_ha_cout_rare_internal: + .hidden __jsvml_dcbrt_ha_cout_rare_internal + .globl __jsvml_dcbrt_ha_cout_rare_internal +# --- __jsvml_dcbrt_ha_cout_rare_internal(const double *, double *) +__jsvml_dcbrt_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1507,7 +1507,7 @@ __svml_dcbrt_ha_cout_rare_internal: .byte 30 #963.15 .byte 250 #963.15 .cfi_startproc -..___tag_value___svml_dcbrt_ha_cout_rare_internal.157: +..___tag_value___jsvml_dcbrt_ha_cout_rare_internal.157: ..L158: #888.1 movq %rsi, %r8 #888.1 @@ -1810,17 +1810,17 @@ __svml_dcbrt_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_dcbrt_ha_cout_rare_internal,@function - .size __svml_dcbrt_ha_cout_rare_internal,.-__svml_dcbrt_ha_cout_rare_internal -..LN__svml_dcbrt_ha_cout_rare_internal.9: + .type __jsvml_dcbrt_ha_cout_rare_internal,@function + .size __jsvml_dcbrt_ha_cout_rare_internal,.-__jsvml_dcbrt_ha_cout_rare_internal +..LN__jsvml_dcbrt_ha_cout_rare_internal.9: .data -# -- End __svml_dcbrt_ha_cout_rare_internal +# -- End __jsvml_dcbrt_ha_cout_rare_internal .section .rodata, "a" .space 32, 0x00 # pad .align 64 - .hidden __svml_dcbrt_ha_data_internal_avx512 - .globl __svml_dcbrt_ha_data_internal_avx512 -__svml_dcbrt_ha_data_internal_avx512: + .hidden __jsvml_dcbrt_ha_data_internal_avx512 + .globl __jsvml_dcbrt_ha_data_internal_avx512 +__jsvml_dcbrt_ha_data_internal_avx512: .long 0 .long 1072693248 .long 4186796683 @@ -2173,12 +2173,12 @@ __svml_dcbrt_ha_data_internal_avx512: .long 1070945621 .long 1431655767 .long 1070945621 - .type __svml_dcbrt_ha_data_internal_avx512,@object - .size __svml_dcbrt_ha_data_internal_avx512,1408 + .type __jsvml_dcbrt_ha_data_internal_avx512,@object + .size __jsvml_dcbrt_ha_data_internal_avx512,1408 .align 64 - .hidden __svml_dcbrt_ha_data_internal - .globl __svml_dcbrt_ha_data_internal -__svml_dcbrt_ha_data_internal: + .hidden __jsvml_dcbrt_ha_data_internal + .globl __jsvml_dcbrt_ha_data_internal +__jsvml_dcbrt_ha_data_internal: .long 528611360 .long 3220144632 .long 2884679527 @@ -2963,8 +2963,8 @@ __svml_dcbrt_ha_data_internal: .long 4292870143 .long 4292870143 .long 4292870143 - .type __svml_dcbrt_ha_data_internal,@object - .size __svml_dcbrt_ha_data_internal,3136 + .type __jsvml_dcbrt_ha_data_internal,@object + .size __jsvml_dcbrt_ha_data_internal,3136 .align 32 _vmldCbrtHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_cos_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cos_linux_x86.S similarity index 95% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_cos_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cos_linux_x86.S index 5cfc33f5d11..30be0b60423 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_cos_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cos_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_cos.c" .text ..TXTST0: -.L_2__routine_start___svml_cos2_ha_ex_0: -# -- Begin __svml_cos2_ha_ex +.L_2__routine_start___jsvml_cos2_ha_ex_0: +# -- Begin __jsvml_cos2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cos2_ha_ex -# --- __svml_cos2_ha_ex(__m128d) -__svml_cos2_ha_ex: + .globl __jsvml_cos2_ha_ex +# --- __jsvml_cos2_ha_ex(__m128d) +__jsvml_cos2_ha_ex: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_cos2_ha_ex: .byte 30 #3139.18 .byte 250 #3139.18 .cfi_startproc -..___tag_value___svml_cos2_ha_ex.1: +..___tag_value___jsvml_cos2_ha_ex.1: ..L2: #2777.1 pushq %rbp #2777.1 @@ -58,28 +58,28 @@ __svml_cos2_ha_ex: andq $-64, %rsp #2777.1 subq $192, %rsp #2777.1 movaps %xmm0, %xmm2 #2777.1 - movups 16576+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #2837.25 + movups 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #2837.25 movaps %xmm2, %xmm6 #2840.14 mulpd %xmm2, %xmm13 #2837.25 - movups 16640+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #2836.51 - lea __svml_dcos_ha_data_internal_ha(%rip), %rax #2851.370 + movups 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #2836.51 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rax #2851.370 addpd %xmm8, %xmm13 #2837.13 movaps %xmm13, %xmm11 #2838.13 xorl %edx, %edx #2829.1 subpd %xmm8, %xmm11 #2838.13 - movups 16768+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #2839.48 + movups 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #2839.48 mulpd %xmm11, %xmm9 #2840.34 - movups 16832+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #2842.19 + movups 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #2842.19 mulpd %xmm11, %xmm10 #2842.19 subpd %xmm9, %xmm6 #2840.14 movaps %xmm6, %xmm5 #2843.17 subpd %xmm10, %xmm5 #2843.17 - andps 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #2850.17 + andps 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #2850.17 movaps %xmm5, %xmm3 #2855.22 movd %xmm13, %ecx #2851.128 movaps %xmm5, %xmm8 #2854.19 - movups 16896+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #2846.50 - movups 16384+__svml_dcos_ha_data_internal_ha(%rip), %xmm7 #2832.13 + movups 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #2846.50 + movups 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7 #2832.13 subpd %xmm5, %xmm6 #2844.17 mulpd %xmm11, %xmm12 #2847.32 pextrw $4, %xmm13, %esi #2851.184 @@ -92,29 +92,29 @@ __svml_cos2_ha_ex: movaps %xmm7, %xmm1 #2833.26 mulpd %xmm5, %xmm11 #2863.15 subpd %xmm12, %xmm6 #2847.13 - cmpnlepd 16448+__svml_dcos_ha_data_internal_ha(%rip), %xmm1 #2833.26 + cmpnlepd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm1 #2833.26 movhpd 8(%rsi,%rax), %xmm9 #2853.569 mulpd %xmm9, %xmm3 #2855.22 movmskpd %xmm1, %edi #2883.78 movq 16(%rcx,%rax), %xmm12 #2852.599 - movups 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #2873.26 + movups 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #2873.26 movhpd 16(%rsi,%rax), %xmm12 #2852.567 mulpd %xmm11, %xmm10 #2873.26 movaps %xmm12, %xmm15 #2856.22 movaps %xmm12, %xmm14 #2858.18 addpd %xmm3, %xmm15 #2856.22 - addpd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #2873.14 + addpd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #2873.14 subpd %xmm15, %xmm14 #2858.18 mulpd %xmm11, %xmm10 #2875.26 addpd %xmm14, %xmm3 #2859.18 - addpd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #2875.14 - movups 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #2866.26 + addpd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #2875.14 + movups 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #2866.26 movaps %xmm15, %xmm0 #2857.21 mulpd %xmm11, %xmm14 #2866.26 movq (%rcx,%rax), %xmm4 #2851.599 movhpd (%rsi,%rax), %xmm4 #2851.567 mulpd %xmm4, %xmm8 #2854.19 - addpd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #2866.14 + addpd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #2866.14 addpd %xmm8, %xmm0 #2857.21 addpd %xmm9, %xmm4 #2869.13 mulpd %xmm11, %xmm14 #2867.14 @@ -195,10 +195,10 @@ __svml_cos2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #3142.546 lea 128(%rsp,%r12,8), %rsi #3142.546 -..___tag_value___svml_cos2_ha_ex.19: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #3142.546 -..___tag_value___svml_cos2_ha_ex.20: +..___tag_value___jsvml_cos2_ha_ex.19: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #3142.546 +..___tag_value___jsvml_cos2_ha_ex.20: jmp ..B1.9 # Prob 100% #3142.546 .cfi_restore 12 .cfi_restore 13 @@ -206,11 +206,11 @@ __svml_cos2_ha_ex: ..B1.12: # Preds ..B1.1 # Execution count [5.00e-02]: Infreq movups %xmm0, (%rsp) #[spill] - lea __svml_dcos_ha_reduction_data_internal(%rip), %r9 #2979.372 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %r9 #2979.372 movdqu .L_2il0floatpacket.34(%rip), %xmm0 #2977.16 pand %xmm2, %xmm0 #2977.16 psrlq $52, %xmm0 #2978.16 - movups 16512+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #2887.55 + movups 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #2887.55 movd %xmm0, %ecx #2979.124 andps %xmm9, %xmm7 #2888.17 movdqu .L_2il0floatpacket.35(%rip), %xmm4 #2987.19 @@ -381,12 +381,12 @@ __svml_cos2_ha_ex: movaps %xmm7, %xmm0 #3119.19 mulpd %xmm7, %xmm0 #3119.19 addpd %xmm9, %xmm3 #3118.25 - movups 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #3122.30 - movups 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #3129.30 + movups 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #3122.30 + movups 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #3129.30 mulpd %xmm0, %xmm11 #3122.30 mulpd %xmm0, %xmm14 #3129.30 - movups 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm15 #3129.18 - movups 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #3122.18 + movups 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15 #3129.18 + movups 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #3122.18 addpd %xmm11, %xmm13 #3122.18 addpd %xmm14, %xmm15 #3129.18 mulpd %xmm0, %xmm13 #3123.18 @@ -397,7 +397,7 @@ __svml_cos2_ha_ex: subpd %xmm7, %xmm5 #3134.17 addpd %xmm13, %xmm3 #3126.21 mulpd %xmm5, %xmm8 #3136.32 - movups 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #3131.18 + movups 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #3131.18 addpd %xmm15, %xmm11 #3131.18 mulpd %xmm11, %xmm0 #3132.18 mulpd %xmm4, %xmm0 #3133.33 @@ -416,20 +416,20 @@ __svml_cos2_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm2 .cfi_endproc # mark_end; - .type __svml_cos2_ha_ex,@function - .size __svml_cos2_ha_ex,.-__svml_cos2_ha_ex -..LN__svml_cos2_ha_ex.0: + .type __jsvml_cos2_ha_ex,@function + .size __jsvml_cos2_ha_ex,.-__jsvml_cos2_ha_ex +..LN__jsvml_cos2_ha_ex.0: .data -# -- End __svml_cos2_ha_ex +# -- End __jsvml_cos2_ha_ex .text -.L_2__routine_start___svml_cos8_ha_z0_1: -# -- Begin __svml_cos8_ha_z0 +.L_2__routine_start___jsvml_cos8_ha_z0_1: +# -- Begin __jsvml_cos8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_cos8_ha_z0 -# --- __svml_cos8_ha_z0(__m512d) -__svml_cos8_ha_z0: + .globl __jsvml_cos8_ha_z0 +# --- __jsvml_cos8_ha_z0(__m512d) +__jsvml_cos8_ha_z0: # parameter 1: %zmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -438,7 +438,7 @@ __svml_cos8_ha_z0: .byte 30 #3528.18 .byte 250 #3528.18 .cfi_startproc -..___tag_value___svml_cos8_ha_z0.26: +..___tag_value___jsvml_cos8_ha_z0.26: ..L27: #3150.1 pushq %rbp #3150.1 @@ -449,23 +449,23 @@ __svml_cos8_ha_z0: andq $-64, %rsp #3150.1 subq $192, %rsp #3150.1 xorl %esi, %esi #3229.5 - vmovups 192+__svml_dcos_ha_data_internal(%rip), %zmm13 #3234.52 - vmovups 128+__svml_dcos_ha_data_internal(%rip), %zmm6 #3235.13 - vmovups 256+__svml_dcos_ha_data_internal(%rip), %zmm8 #3239.51 - vmovups 320+__svml_dcos_ha_data_internal(%rip), %zmm10 #3240.51 - vmovups 384+__svml_dcos_ha_data_internal(%rip), %zmm14 #3241.51 - vmovups 64+__svml_dcos_ha_data_internal(%rip), %zmm5 #3231.61 - vmovups 896+__svml_dcos_ha_data_internal(%rip), %zmm12 #3254.50 - vmovups 512+__svml_dcos_ha_data_internal(%rip), %zmm2 #3244.270 - vmovups 640+__svml_dcos_ha_data_internal(%rip), %zmm1 #3245.270 + vmovups 192+__jsvml_dcos_ha_data_internal(%rip), %zmm13 #3234.52 + vmovups 128+__jsvml_dcos_ha_data_internal(%rip), %zmm6 #3235.13 + vmovups 256+__jsvml_dcos_ha_data_internal(%rip), %zmm8 #3239.51 + vmovups 320+__jsvml_dcos_ha_data_internal(%rip), %zmm10 #3240.51 + vmovups 384+__jsvml_dcos_ha_data_internal(%rip), %zmm14 #3241.51 + vmovups 64+__jsvml_dcos_ha_data_internal(%rip), %zmm5 #3231.61 + vmovups 896+__jsvml_dcos_ha_data_internal(%rip), %zmm12 #3254.50 + vmovups 512+__jsvml_dcos_ha_data_internal(%rip), %zmm2 #3244.270 + vmovups 640+__jsvml_dcos_ha_data_internal(%rip), %zmm1 #3245.270 vmovaps %zmm0, %zmm11 #3150.1 vfmadd213pd {rn-sae}, %zmm13, %zmm11, %zmm6 #3235.13 - vmovups 768+__svml_dcos_ha_data_internal(%rip), %zmm0 #3246.273 - vandpd __svml_dcos_ha_data_internal(%rip), %zmm11, %zmm4 #3232.16 + vmovups 768+__jsvml_dcos_ha_data_internal(%rip), %zmm0 #3246.273 + vandpd __jsvml_dcos_ha_data_internal(%rip), %zmm11, %zmm4 #3232.16 vsubpd {rn-sae}, %zmm13, %zmm6, %zmm9 #3238.15 - vpermt2pd 576+__svml_dcos_ha_data_internal(%rip), %zmm6, %zmm2 #3244.270 - vpermt2pd 704+__svml_dcos_ha_data_internal(%rip), %zmm6, %zmm1 #3245.270 - vpermt2pd 832+__svml_dcos_ha_data_internal(%rip), %zmm6, %zmm0 #3246.273 + vpermt2pd 576+__jsvml_dcos_ha_data_internal(%rip), %zmm6, %zmm2 #3244.270 + vpermt2pd 704+__jsvml_dcos_ha_data_internal(%rip), %zmm6, %zmm1 #3245.270 + vpermt2pd 832+__jsvml_dcos_ha_data_internal(%rip), %zmm6, %zmm0 #3246.273 vfnmadd213pd {rn-sae}, %zmm11, %zmm9, %zmm8 #3242.18 vcmppd $22, {sae}, %zmm5, %zmm4, %k1 #3236.30 vpsrlq $4, %zmm6, %zmm6 #3280.44 @@ -475,21 +475,21 @@ __svml_cos8_ha_z0: vmovaps %zmm14, %zmm3 #3248.17 vfnmadd213pd {rn-sae}, %zmm7, %zmm9, %zmm3 #3248.17 vsubpd {rn-sae}, %zmm7, %zmm8, %zmm15 #3249.21 - vmovups 1152+__svml_dcos_ha_data_internal(%rip), %zmm8 #3262.50 + vmovups 1152+__jsvml_dcos_ha_data_internal(%rip), %zmm8 #3262.50 vmulpd {rn-sae}, %zmm3, %zmm3, %zmm4 #3250.21 vfnmadd231pd {rn-sae}, %zmm9, %zmm10, %zmm15 #3252.18 vsubpd {rn-sae}, %zmm7, %zmm3, %zmm13 #3251.21 - vmovups 960+__svml_dcos_ha_data_internal(%rip), %zmm7 #3256.21 + vmovups 960+__jsvml_dcos_ha_data_internal(%rip), %zmm7 #3256.21 vfmadd213pd {rn-sae}, %zmm13, %zmm14, %zmm9 #3257.19 - vmovups 1024+__svml_dcos_ha_data_internal(%rip), %zmm14 #3258.50 - vmovups 1088+__svml_dcos_ha_data_internal(%rip), %zmm13 #3260.21 + vmovups 1024+__jsvml_dcos_ha_data_internal(%rip), %zmm14 #3258.50 + vmovups 1088+__jsvml_dcos_ha_data_internal(%rip), %zmm13 #3260.21 vfmadd231pd {rn-sae}, %zmm4, %zmm12, %zmm7 #3256.21 vsubpd {rn-sae}, %zmm9, %zmm15, %zmm10 #3264.20 vfmadd231pd {rn-sae}, %zmm4, %zmm14, %zmm13 #3260.21 vfmadd213pd {rn-sae}, %zmm8, %zmm4, %zmm7 #3263.21 - vmovups 1280+__svml_dcos_ha_data_internal(%rip), %zmm8 #3269.50 - vmovups 1216+__svml_dcos_ha_data_internal(%rip), %zmm15 #3265.50 - vmovups 1344+__svml_dcos_ha_data_internal(%rip), %zmm14 #3272.50 + vmovups 1280+__jsvml_dcos_ha_data_internal(%rip), %zmm8 #3269.50 + vmovups 1216+__jsvml_dcos_ha_data_internal(%rip), %zmm15 #3265.50 + vmovups 1344+__jsvml_dcos_ha_data_internal(%rip), %zmm14 #3272.50 vpsllq $32, %zmm0, %zmm9 #3268.39 vfmadd213pd {rn-sae}, %zmm8, %zmm4, %zmm7 #3270.21 vfmadd213pd {rn-sae}, %zmm15, %zmm4, %zmm13 #3266.21 @@ -624,10 +624,10 @@ __svml_cos8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #3531.759 lea 128(%rsp,%rbx,8), %rsi #3531.759 -..___tag_value___svml_cos8_ha_z0.54: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #3531.759 -..___tag_value___svml_cos8_ha_z0.55: +..___tag_value___jsvml_cos8_ha_z0.54: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #3531.759 +..___tag_value___jsvml_cos8_ha_z0.55: jmp ..B2.14 # Prob 100% #3531.759 .cfi_restore 3 .cfi_restore 12 @@ -636,13 +636,13 @@ __svml_cos8_ha_z0: # LOE r15 ebx r12d r13d r14d ..B2.17: # Preds ..B2.1 # Execution count [5.00e-02]: Infreq - vmovups 16512+__svml_dcos_ha_data_internal_ha(%rip), %zmm7 #3289.56 - lea __svml_dcos_ha_reduction_data_internal(%rip), %rax #3381.406 + vmovups 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %zmm7 #3289.56 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %rax #3381.406 vmovups %zmm0, (%rsp) #[spill] vpbroadcastq .L_2il0floatpacket.52(%rip), %zmm9 #3291.71 vandpd %zmm11, %zmm7, %zmm8 #3290.17 vcmppd $4, {sae}, %zmm7, %zmm8, %k2 #3291.122 - lea __svml_dcos_ha_data_internal_ha(%rip), %rdx #3498.210 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rdx #3498.210 vmovaps %zmm9, %zmm6 #3291.46 vpandq .L_2il0floatpacket.53(%rip){1to8}, %zmm11, %zmm3 #3379.16 vpsrlq $52, %zmm3, %zmm12 #3380.18 @@ -738,7 +738,7 @@ __svml_cos8_ha_z0: vpxorq .L_2il0floatpacket.63(%rip){1to8}, %zmm14, %zmm0 #3468.20 vpandq .L_2il0floatpacket.64(%rip){1to8}, %zmm10, %zmm14 #3470.18 vpsllq $40, %zmm14, %zmm10 #3471.20 - vmovups 17152+__svml_dcos_ha_data_internal_ha(%rip), %zmm14 #3517.50 + vmovups 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %zmm14 #3517.50 vporq %zmm13, %zmm10, %zmm10 #3473.18 vporq %zmm0, %zmm10, %zmm4 #3474.18 vsubpd {rn-sae}, %zmm0, %zmm4, %zmm5 #3477.20 @@ -766,7 +766,7 @@ __svml_cos8_ha_z0: vandpd %zmm11, %zmm9, %zmm10 #3493.24 vandpd %zmm1, %zmm3, %zmm4 #3494.25 vandpd %zmm12, %zmm3, %zmm0 #3496.9 - vmovups 16960+__svml_dcos_ha_data_internal_ha(%rip), %zmm3 #3510.50 + vmovups 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %zmm3 #3510.50 vorpd %zmm4, %zmm10, %zmm4 #3495.9 vmovaps %zmm4, %zmm2 #3501.26 vfmadd213pd {rn-sae}, %zmm7, %zmm6, %zmm2 #3501.26 @@ -777,13 +777,13 @@ __svml_cos8_ha_z0: vgatherdpd (%rdx,%ymm5), %zmm9{%k2} #3498.210 vfmadd132pd {rn-sae}, %zmm9, %zmm2, %zmm10 #3502.25 vsubpd {rn-sae}, %zmm10, %zmm2, %zmm8 #3505.24 - vmovups 17024+__svml_dcos_ha_data_internal_ha(%rip), %zmm2 #3509.50 + vmovups 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %zmm2 #3509.50 vfmadd231pd {rn-sae}, %zmm9, %zmm4, %zmm8 #3506.22 vaddpd {rn-sae}, %zmm1, %zmm8, %zmm13 #3507.27 vaddpd {rn-sae}, %zmm6, %zmm9, %zmm1 #3514.19 vmulpd {rn-sae}, %zmm4, %zmm4, %zmm8 #3508.21 - vmovups 17216+__svml_dcos_ha_data_internal_ha(%rip), %zmm6 #3516.50 - vmovups 17088+__svml_dcos_ha_data_internal_ha(%rip), %zmm9 #3519.50 + vmovups 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %zmm6 #3516.50 + vmovups 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %zmm9 #3519.50 vfmadd231pd {rn-sae}, %zmm8, %zmm2, %zmm3 #3511.18 vfmadd231pd {rn-sae}, %zmm8, %zmm6, %zmm14 #3518.18 vmulpd {rn-sae}, %zmm8, %zmm3, %zmm12 #3512.20 @@ -804,20 +804,20 @@ __svml_cos8_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm11 .cfi_endproc # mark_end; - .type __svml_cos8_ha_z0,@function - .size __svml_cos8_ha_z0,.-__svml_cos8_ha_z0 -..LN__svml_cos8_ha_z0.1: + .type __jsvml_cos8_ha_z0,@function + .size __jsvml_cos8_ha_z0,.-__jsvml_cos8_ha_z0 +..LN__jsvml_cos8_ha_z0.1: .data -# -- End __svml_cos8_ha_z0 +# -- End __jsvml_cos8_ha_z0 .text -.L_2__routine_start___svml_cos1_ha_l9_2: -# -- Begin __svml_cos1_ha_l9 +.L_2__routine_start___jsvml_cos1_ha_l9_2: +# -- Begin __jsvml_cos1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cos1_ha_l9 -# --- __svml_cos1_ha_l9(__m128d) -__svml_cos1_ha_l9: + .globl __jsvml_cos1_ha_l9 +# --- __jsvml_cos1_ha_l9(__m128d) +__jsvml_cos1_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -826,7 +826,7 @@ __svml_cos1_ha_l9: .byte 30 #3885.18 .byte 250 #3885.18 .cfi_startproc -..___tag_value___svml_cos1_ha_l9.63: +..___tag_value___jsvml_cos1_ha_l9.63: ..L64: #3539.1 pushq %rbp #3539.1 @@ -837,24 +837,24 @@ __svml_cos1_ha_l9: andq $-64, %rsp #3539.1 subq $128, %rsp #3539.1 vmovapd %xmm0, %xmm14 #3539.1 - vmovsd 16640+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #3598.20 + vmovsd 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #3598.20 vmovapd %xmm14, %xmm13 #3599.13 - vfmadd132sd 16576+__svml_dcos_ha_data_internal_ha(%rip), %xmm8, %xmm13 #3599.13 - lea __svml_dcos_ha_data_internal_ha(%rip), %rcx #3612.371 - vmovq 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm15 #3610.23 - vmovsd 16832+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #3603.17 - vmovsd 16384+__svml_dcos_ha_data_internal_ha(%rip), %xmm7 #3592.19 + vfmadd132sd 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8, %xmm13 #3599.13 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rcx #3612.371 + vmovq 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15 #3610.23 + vmovsd 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #3603.17 + vmovsd 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7 #3592.19 vandpd %xmm7, %xmm14, %xmm7 #3594.13 vpand %xmm15, %xmm13, %xmm4 #3611.19 xorl %eax, %eax #3591.1 vmovd %xmm4, %edx #3612.128 vsubsd %xmm8, %xmm13, %xmm6 #3600.13 - vcmpnlesd 16448+__svml_dcos_ha_data_internal_ha(%rip), %xmm7, %xmm0 #3595.26 + vcmpnlesd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7, %xmm0 #3595.26 vmovapd %xmm6, %xmm9 #3602.14 vmovapd %xmm6, %xmm5 #3604.17 - vfnmadd132sd 16768+__svml_dcos_ha_data_internal_ha(%rip), %xmm14, %xmm9 #3602.14 + vfnmadd132sd 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14, %xmm9 #3602.14 vmovapd %xmm6, %xmm12 #3606.17 - vmovsd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #3625.14 + vmovsd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #3625.14 vmovmskpd %xmm0, %esi #3642.78 vfnmadd213sd %xmm9, %xmm10, %xmm5 #3604.17 shll $5, %edx #3612.231 @@ -870,18 +870,18 @@ __svml_cos1_ha_l9: vaddsd %xmm1, %xmm3, %xmm3 #3628.13 vfmadd213sd %xmm9, %xmm5, %xmm4 #3616.21 vsubsd %xmm9, %xmm2, %xmm8 #3617.18 - vfnmadd132sd 16896+__svml_dcos_ha_data_internal_ha(%rip), %xmm12, %xmm6 #3608.13 + vfnmadd132sd 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12, %xmm6 #3608.13 vmovapd %xmm5, %xmm12 #3618.18 vsubsd %xmm4, %xmm9, %xmm10 #3619.18 vmulsd %xmm5, %xmm5, %xmm9 #3622.15 vfmadd213sd %xmm8, %xmm1, %xmm12 #3618.18 vfmadd213sd %xmm10, %xmm5, %xmm11 #3620.18 - vfmadd213sd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm9, %xmm13 #3625.14 - vmovsd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm1 #3632.14 - vfmadd213sd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm9, %xmm1 #3632.14 + vfmadd213sd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9, %xmm13 #3625.14 + vmovsd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm1 #3632.14 + vfmadd213sd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9, %xmm1 #3632.14 vaddsd %xmm12, %xmm11, %xmm8 #3621.21 vmulsd %xmm9, %xmm13, %xmm15 #3626.14 - vfmadd213sd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm9, %xmm1 #3634.14 + vfmadd213sd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9, %xmm1 #3634.14 vmulsd %xmm5, %xmm15, %xmm10 #3627.14 vfnmadd213sd %xmm3, %xmm2, %xmm5 #3637.13 vmulsd %xmm9, %xmm1, %xmm1 #3635.14 @@ -928,20 +928,20 @@ __svml_cos1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #3888.546 lea 64(%rsp), %rsi #3888.546 -..___tag_value___svml_cos1_ha_l9.72: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #3888.546 -..___tag_value___svml_cos1_ha_l9.73: +..___tag_value___jsvml_cos1_ha_l9.72: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #3888.546 +..___tag_value___jsvml_cos1_ha_l9.73: jmp ..B3.5 # Prob 100% #3888.546 # LOE rbx r12 r13 r14 r15 ..B3.8: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.34(%rip), %xmm14, %xmm8 #3736.18 - lea __svml_dcos_ha_reduction_data_internal(%rip), %rsi #3738.383 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %rsi #3738.383 vpsrlq $52, %xmm8, %xmm10 #3737.18 - lea __svml_dcos_ha_data_internal_ha(%rip), %r8 #3855.375 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %r8 #3855.375 vmovd %xmm10, %edx #3738.124 - vmovsd 16512+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #3646.24 + vmovsd 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #3646.24 vpand .L_2il0floatpacket.35(%rip), %xmm14, %xmm4 #3746.21 vandpd %xmm7, %xmm13, %xmm9 #3647.17 vpaddq .L_2il0floatpacket.36(%rip), %xmm4, %xmm2 #3747.21 @@ -1044,10 +1044,10 @@ __svml_cos1_ha_l9: vorpd %xmm7, %xmm5, %xmm9 #3852.9 vmovapd %xmm9, %xmm2 #3858.26 vmovapd %xmm9, %xmm5 #3861.22 - vmovsd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm7 #3868.18 + vmovsd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7 #3868.18 vmulsd %xmm9, %xmm9, %xmm11 #3865.19 vfmadd213sd %xmm13, %xmm6, %xmm10 #3844.13 - vfmadd213sd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm7 #3868.18 + vfmadd213sd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm7 #3868.18 vandpd %xmm10, %xmm8, %xmm6 #3853.9 shll $5, %edi #3855.235 vmovq 16(%r8,%rdi), %xmm13 #3856.375 @@ -1063,11 +1063,11 @@ __svml_cos1_ha_l9: vmulsd %xmm9, %xmm8, %xmm1 #3870.18 vaddsd 8(%r8,%rdi), %xmm15, %xmm2 #3871.17 vfmadd213sd %xmm3, %xmm9, %xmm4 #3863.22 - vmovsd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm15 #3875.18 - vfmadd213sd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm15 #3875.18 + vmovsd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15 #3875.18 + vfmadd213sd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm15 #3875.18 vfnmadd213sd %xmm2, %xmm13, %xmm9 #3880.17 vaddsd %xmm5, %xmm4, %xmm10 #3864.25 - vfmadd213sd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm15 #3877.18 + vfmadd213sd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm15 #3877.18 vfmadd213sd 24(%r8,%rdi), %xmm9, %xmm6 #3882.20 vfmadd213sd %xmm10, %xmm2, %xmm1 #3872.21 vmulsd %xmm11, %xmm15, %xmm3 #3878.18 @@ -1081,20 +1081,20 @@ __svml_cos1_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm14 .cfi_endproc # mark_end; - .type __svml_cos1_ha_l9,@function - .size __svml_cos1_ha_l9,.-__svml_cos1_ha_l9 -..LN__svml_cos1_ha_l9.2: + .type __jsvml_cos1_ha_l9,@function + .size __jsvml_cos1_ha_l9,.-__jsvml_cos1_ha_l9 +..LN__jsvml_cos1_ha_l9.2: .data -# -- End __svml_cos1_ha_l9 +# -- End __jsvml_cos1_ha_l9 .text -.L_2__routine_start___svml_cos2_ha_e9_3: -# -- Begin __svml_cos2_ha_e9 +.L_2__routine_start___jsvml_cos2_ha_e9_3: +# -- Begin __jsvml_cos2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cos2_ha_e9 -# --- __svml_cos2_ha_e9(__m128d) -__svml_cos2_ha_e9: + .globl __jsvml_cos2_ha_e9 +# --- __jsvml_cos2_ha_e9(__m128d) +__jsvml_cos2_ha_e9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -1103,7 +1103,7 @@ __svml_cos2_ha_e9: .byte 30 #4258.18 .byte 250 #4258.18 .cfi_startproc -..___tag_value___svml_cos2_ha_e9.77: +..___tag_value___jsvml_cos2_ha_e9.77: ..L78: #3896.1 pushq %rbp #3896.1 @@ -1114,22 +1114,22 @@ __svml_cos2_ha_e9: andq $-64, %rsp #3896.1 subq $192, %rsp #3896.1 movaps %xmm0, %xmm2 #3896.1 - movups 16576+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #3956.25 + movups 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #3956.25 movaps %xmm2, %xmm6 #3959.14 mulpd %xmm2, %xmm12 #3956.25 - movups 16640+__svml_dcos_ha_data_internal_ha(%rip), %xmm4 #3955.51 - lea __svml_dcos_ha_data_internal_ha(%rip), %rax #3970.383 + movups 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm4 #3955.51 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rax #3970.383 addpd %xmm4, %xmm12 #3956.13 movaps %xmm12, %xmm10 #3957.13 xorl %edx, %edx #3948.1 subpd %xmm4, %xmm10 #3957.13 - movups 16768+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #3958.48 + movups 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #3958.48 mulpd %xmm10, %xmm8 #3959.34 - movups 16832+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #3961.19 + movups 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #3961.19 mulpd %xmm10, %xmm9 #3961.19 subpd %xmm8, %xmm6 #3959.14 movaps %xmm6, %xmm5 #3962.17 - andps 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #3969.23 + andps 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #3969.23 subpd %xmm9, %xmm5 #3962.17 movd %xmm12, %ecx #3970.128 movaps %xmm5, %xmm1 #3974.22 @@ -1141,7 +1141,7 @@ __svml_cos2_ha_e9: movhpd 8(%rsi,%rax), %xmm8 #3972.582 mulpd %xmm8, %xmm1 #3974.22 subpd %xmm5, %xmm6 #3963.17 - movups 16896+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #3965.50 + movups 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #3965.50 movq (%rcx,%rax), %xmm3 #3970.612 mulpd %xmm10, %xmm11 #3966.32 subpd %xmm9, %xmm6 #3964.17 @@ -1162,15 +1162,15 @@ __svml_cos2_ha_e9: subpd %xmm4, %xmm14 #3979.18 addpd %xmm13, %xmm1 #3978.18 addpd %xmm14, %xmm15 #3980.18 - movups 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #3992.26 + movups 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #3992.26 mulpd %xmm9, %xmm14 #3992.26 addpd %xmm15, %xmm1 #3981.21 - addpd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #3992.14 - movups 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #3985.26 + addpd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #3992.14 + movups 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #3985.26 mulpd %xmm9, %xmm13 #3985.26 mulpd %xmm9, %xmm14 #3994.26 - addpd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #3985.14 - addpd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #3994.14 + addpd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #3985.14 + addpd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #3994.14 mulpd %xmm9, %xmm13 #3986.14 mulpd %xmm14, %xmm9 #3995.14 mulpd %xmm5, %xmm13 #3987.14 @@ -1183,11 +1183,11 @@ __svml_cos2_ha_e9: addpd %xmm9, %xmm1 #3996.17 movq 24(%rcx,%rax), %xmm5 #3998.612 movhpd 24(%rsi,%rax), %xmm5 #3998.580 - movups 16384+__svml_dcos_ha_data_internal_ha(%rip), %xmm7 #3951.13 + movups 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7 #3951.13 addpd %xmm6, %xmm5 #3999.16 andps %xmm2, %xmm7 #3951.13 movaps %xmm7, %xmm0 #3952.26 - cmpnlepd 16448+__svml_dcos_ha_data_internal_ha(%rip), %xmm0 #3952.26 + cmpnlepd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm0 #3952.26 addpd %xmm5, %xmm1 #4000.17 movmskpd %xmm0, %edi #4002.78 addpd %xmm1, %xmm4 #4001.14 @@ -1252,10 +1252,10 @@ __svml_cos2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #4261.546 lea 128(%rsp,%r12,8), %rsi #4261.546 -..___tag_value___svml_cos2_ha_e9.95: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #4261.546 -..___tag_value___svml_cos2_ha_e9.96: +..___tag_value___jsvml_cos2_ha_e9.95: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #4261.546 +..___tag_value___jsvml_cos2_ha_e9.96: jmp ..B4.9 # Prob 100% #4261.546 .cfi_restore 12 .cfi_restore 13 @@ -1263,10 +1263,10 @@ __svml_cos2_ha_e9: ..B4.12: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq movdqu .L_2il0floatpacket.34(%rip), %xmm1 #4096.22 - lea __svml_dcos_ha_reduction_data_internal(%rip), %r9 #4098.385 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %r9 #4098.385 pand %xmm2, %xmm1 #4096.22 psrlq $52, %xmm1 #4097.22 - movups 16512+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #4006.55 + movups 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #4006.55 movd %xmm1, %ecx #4098.124 andps %xmm9, %xmm7 #4007.17 movups %xmm4, (%rsp) #[spill] @@ -1438,12 +1438,12 @@ __svml_cos2_ha_e9: movaps %xmm7, %xmm1 #4238.19 mulpd %xmm7, %xmm1 #4238.19 addpd %xmm9, %xmm3 #4237.25 - movups 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #4241.30 - movups 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm14 #4248.30 + movups 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #4241.30 + movups 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14 #4248.30 mulpd %xmm1, %xmm11 #4241.30 mulpd %xmm1, %xmm14 #4248.30 - movups 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm15 #4248.18 - movups 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #4241.18 + movups 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15 #4248.18 + movups 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #4241.18 addpd %xmm11, %xmm13 #4241.18 addpd %xmm14, %xmm15 #4248.18 mulpd %xmm1, %xmm13 #4242.18 @@ -1454,7 +1454,7 @@ __svml_cos2_ha_e9: subpd %xmm7, %xmm5 #4253.17 addpd %xmm13, %xmm3 #4245.21 mulpd %xmm5, %xmm8 #4255.32 - movups 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #4250.18 + movups 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #4250.18 addpd %xmm15, %xmm11 #4250.18 mulpd %xmm11, %xmm1 #4251.18 mulpd %xmm4, %xmm1 #4252.33 @@ -1471,20 +1471,20 @@ __svml_cos2_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm2 xmm4 .cfi_endproc # mark_end; - .type __svml_cos2_ha_e9,@function - .size __svml_cos2_ha_e9,.-__svml_cos2_ha_e9 -..LN__svml_cos2_ha_e9.3: + .type __jsvml_cos2_ha_e9,@function + .size __jsvml_cos2_ha_e9,.-__jsvml_cos2_ha_e9 +..LN__jsvml_cos2_ha_e9.3: .data -# -- End __svml_cos2_ha_e9 +# -- End __jsvml_cos2_ha_e9 .text -.L_2__routine_start___svml_cos4_ha_l9_4: -# -- Begin __svml_cos4_ha_l9 +.L_2__routine_start___jsvml_cos4_ha_l9_4: +# -- Begin __jsvml_cos4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cos4_ha_l9 -# --- __svml_cos4_ha_l9(__m256d) -__svml_cos4_ha_l9: + .globl __jsvml_cos4_ha_l9 +# --- __jsvml_cos4_ha_l9(__m256d) +__jsvml_cos4_ha_l9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -1493,7 +1493,7 @@ __svml_cos4_ha_l9: .byte 30 #4615.18 .byte 250 #4615.18 .cfi_startproc -..___tag_value___svml_cos4_ha_l9.102: +..___tag_value___jsvml_cos4_ha_l9.102: ..L103: #4269.1 pushq %rbp #4269.1 @@ -1503,24 +1503,24 @@ __svml_cos4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #4269.1 subq $192, %rsp #4269.1 - lea __svml_dcos_ha_data_internal_ha(%rip), %r8 #4342.728 - vmovupd 16576+__svml_dcos_ha_data_internal_ha(%rip), %ymm11 #4327.49 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %r8 #4342.728 + vmovupd 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11 #4327.49 xorl %esi, %esi #4321.1 - vmovupd 16640+__svml_dcos_ha_data_internal_ha(%rip), %ymm7 #4328.54 - vmovupd 16768+__svml_dcos_ha_data_internal_ha(%rip), %ymm8 #4331.51 - vmovupd 16832+__svml_dcos_ha_data_internal_ha(%rip), %ymm9 #4333.51 + vmovupd 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7 #4328.54 + vmovupd 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm8 #4331.51 + vmovupd 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm9 #4333.51 vmovapd %ymm0, %ymm14 #4269.1 vfmadd213pd %ymm7, %ymm14, %ymm11 #4329.13 vsubpd %ymm7, %ymm11, %ymm5 #4330.13 vfnmadd213pd %ymm14, %ymm5, %ymm8 #4332.14 vmovapd %ymm9, %ymm4 #4334.17 vfnmadd213pd %ymm8, %ymm5, %ymm4 #4334.17 - vandps 16704+__svml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm12 #4341.19 + vandps 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm12 #4341.19 vsubpd %ymm4, %ymm8, %ymm10 #4335.17 vfnmadd231pd %ymm5, %ymm9, %ymm10 #4336.17 - vfnmadd132pd 16896+__svml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm5 #4338.13 - vandpd 16384+__svml_dcos_ha_data_internal_ha(%rip), %ymm14, %ymm6 #4324.13 - vcmpnle_uqpd 16448+__svml_dcos_ha_data_internal_ha(%rip), %ymm6, %ymm13 #4325.26 + vfnmadd132pd 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm5 #4338.13 + vandpd 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm14, %ymm6 #4324.13 + vcmpnle_uqpd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm6, %ymm13 #4325.26 vmovmskpd %ymm13, %r9d #4372.78 vextractf128 $1, %ymm12, %xmm2 #4342.326 vmovd %xmm12, %eax #4342.128 @@ -1546,7 +1546,7 @@ __svml_cos4_ha_l9: vinsertf128 $1, %xmm10, %ymm8, %ymm2 #4343.1149 vmovhpd 8(%rdi,%r8), %xmm15, %xmm1 #4344.1397 vmovaps %ymm2, %ymm7 #4345.22 - vmovupd 16960+__svml_dcos_ha_data_internal_ha(%rip), %ymm10 #4355.14 + vmovupd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm10 #4355.14 vinsertf128 $1, %xmm1, %ymm12, %ymm0 #4344.1151 vfmadd231pd %ymm4, %ymm0, %ymm7 #4345.22 vmovaps %ymm3, %ymm1 #4346.21 @@ -1557,13 +1557,13 @@ __svml_cos4_ha_l9: vfmadd231pd %ymm4, %ymm0, %ymm8 #4348.18 vfmadd231pd %ymm3, %ymm4, %ymm9 #4350.18 vaddpd %ymm0, %ymm3, %ymm3 #4358.13 - vfmadd231pd 17024+__svml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm10 #4355.14 - vmovupd 17152+__svml_dcos_ha_data_internal_ha(%rip), %ymm0 #4362.14 + vfmadd231pd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm10 #4355.14 + vmovupd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm0 #4362.14 vaddpd %ymm9, %ymm8, %ymm15 #4351.21 vmulpd %ymm10, %ymm7, %ymm11 #4356.14 - vfmadd231pd 17216+__svml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm0 #4362.14 + vfmadd231pd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm0 #4362.14 vmulpd %ymm11, %ymm4, %ymm8 #4357.14 - vfmadd213pd 17088+__svml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm0 #4364.14 + vfmadd213pd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm0 #4364.14 vfnmadd213pd %ymm3, %ymm2, %ymm4 #4367.13 vfmadd213pd %ymm15, %ymm3, %ymm8 #4359.17 vmulpd %ymm0, %ymm7, %ymm7 #4365.14 @@ -1640,18 +1640,18 @@ __svml_cos4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #4618.552 lea 128(%rsp,%r12,8), %rsi #4618.552 -..___tag_value___svml_cos4_ha_l9.120: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #4618.552 -..___tag_value___svml_cos4_ha_l9.121: +..___tag_value___jsvml_cos4_ha_l9.120: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #4618.552 +..___tag_value___jsvml_cos4_ha_l9.121: jmp ..B5.9 # Prob 100% #4618.552 .cfi_restore 12 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B5.12: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq - vmovupd 16512+__svml_dcos_ha_data_internal_ha(%rip), %ymm12 #4376.58 - lea __svml_dcos_ha_reduction_data_internal(%rip), %rcx #4468.736 + vmovupd 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm12 #4376.58 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %rcx #4468.736 vmovupd %ymm0, (%rsp) #[spill] vpand .L_2il0floatpacket.70(%rip), %ymm14, %ymm7 #4466.18 vandpd %ymm6, %ymm12, %ymm8 #4377.17 @@ -1666,7 +1666,7 @@ __svml_cos4_ha_l9: vpextrd $2, %xmm1, %r11d #4468.405 lea (%r9,%r9,2), %r10d #4468.649 vpand .L_2il0floatpacket.71(%rip), %ymm14, %ymm6 #4476.21 - lea __svml_dcos_ha_data_internal_ha(%rip), %r9 #4585.732 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %r9 #4585.732 shll $3, %edx #4468.547 lea (%r8,%r8,2), %eax #4468.598 shll $3, %eax #4468.598 @@ -1804,9 +1804,9 @@ __svml_cos4_ha_l9: vinsertf128 $1, %xmm6, %ymm3, %ymm12 #4586.1153 vinsertf128 $1, %xmm15, %ymm9, %ymm6 #4587.1155 vfmadd213pd %ymm12, %ymm6, %ymm0 #4588.26 - vmovupd 16960+__svml_dcos_ha_data_internal_ha(%rip), %ymm3 #4598.18 + vmovupd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm3 #4598.18 vsubpd %ymm0, %ymm12, %ymm1 #4590.22 - vfmadd231pd 17024+__svml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm3 #4598.18 + vfmadd231pd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm3 #4598.18 vfmadd231pd %ymm8, %ymm6, %ymm1 #4591.22 vmulpd %ymm3, %ymm10, %ymm4 #4599.18 vmovaps %ymm11, %ymm15 #4589.25 @@ -1816,12 +1816,12 @@ __svml_cos4_ha_l9: vfmadd231pd %ymm11, %ymm8, %ymm2 #4593.22 vaddpd %ymm2, %ymm1, %ymm7 #4594.25 vaddpd %ymm6, %ymm11, %ymm1 #4601.17 - vmovupd 17152+__svml_dcos_ha_data_internal_ha(%rip), %ymm11 #4605.18 + vmovupd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11 #4605.18 vfmadd213pd %ymm7, %ymm1, %ymm0 #4602.21 vfnmadd213pd %ymm1, %ymm12, %ymm8 #4610.17 vmovq 24(%rcx,%r9), %xmm1 #4611.1431 - vfmadd231pd 17216+__svml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm11 #4605.18 - vfmadd213pd 17088+__svml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm11 #4607.18 + vfmadd231pd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm11 #4605.18 + vfmadd213pd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm10, %ymm11 #4607.18 vmulpd %ymm11, %ymm10, %ymm3 #4608.18 vfmadd213pd %ymm0, %ymm12, %ymm3 #4609.21 vmovq 24(%rax,%r9), %xmm12 #4611.1231 @@ -1838,20 +1838,20 @@ __svml_cos4_ha_l9: # LOE rbx r12 r13 r14 r15 esi ymm0 ymm14 .cfi_endproc # mark_end; - .type __svml_cos4_ha_l9,@function - .size __svml_cos4_ha_l9,.-__svml_cos4_ha_l9 -..LN__svml_cos4_ha_l9.4: + .type __jsvml_cos4_ha_l9,@function + .size __jsvml_cos4_ha_l9,.-__jsvml_cos4_ha_l9 +..LN__jsvml_cos4_ha_l9.4: .data -# -- End __svml_cos4_ha_l9 +# -- End __jsvml_cos4_ha_l9 .text -.L_2__routine_start___svml_cos2_ha_l9_5: -# -- Begin __svml_cos2_ha_l9 +.L_2__routine_start___jsvml_cos2_ha_l9_5: +# -- Begin __jsvml_cos2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cos2_ha_l9 -# --- __svml_cos2_ha_l9(__m128d) -__svml_cos2_ha_l9: + .globl __jsvml_cos2_ha_l9 +# --- __jsvml_cos2_ha_l9(__m128d) +__jsvml_cos2_ha_l9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -1860,7 +1860,7 @@ __svml_cos2_ha_l9: .byte 30 #4972.18 .byte 250 #4972.18 .cfi_startproc -..___tag_value___svml_cos2_ha_l9.127: +..___tag_value___jsvml_cos2_ha_l9.127: ..L128: #4626.1 pushq %rbp #4626.1 @@ -1871,18 +1871,18 @@ __svml_cos2_ha_l9: andq $-64, %rsp #4626.1 subq $192, %rsp #4626.1 vmovapd %xmm0, %xmm14 #4626.1 - vmovupd 16576+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #4684.46 - lea __svml_dcos_ha_data_internal_ha(%rip), %rsi #4699.383 - vmovupd 16640+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #4685.51 + vmovupd 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #4684.46 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rsi #4699.383 + vmovupd 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #4685.51 xorl %eax, %eax #4678.1 vfmadd213pd %xmm8, %xmm14, %xmm12 #4686.13 - vmovupd 16768+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #4688.48 - vmovupd 16832+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #4690.48 - vandpd 16384+__svml_dcos_ha_data_internal_ha(%rip), %xmm14, %xmm7 #4681.13 - vcmpnlepd 16448+__svml_dcos_ha_data_internal_ha(%rip), %xmm7, %xmm0 #4682.26 + vmovupd 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #4688.48 + vmovupd 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #4690.48 + vandpd 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm14, %xmm7 #4681.13 + vcmpnlepd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7, %xmm0 #4682.26 vsubpd %xmm8, %xmm12, %xmm5 #4687.13 vmovmskpd %xmm0, %edi #4729.78 - vandps 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm12, %xmm13 #4698.19 + vandps 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12, %xmm13 #4698.19 vfnmadd213pd %xmm14, %xmm5, %xmm9 #4689.14 vmovd %xmm13, %edx #4699.128 vmovapd %xmm9, %xmm6 #4691.17 @@ -1904,18 +1904,18 @@ __svml_cos2_ha_l9: vmovapd %xmm8, %xmm2 #4703.21 vfmadd231pd %xmm4, %xmm6, %xmm2 #4703.21 vsubpd %xmm8, %xmm3, %xmm9 #4704.18 - vfnmadd132pd 16896+__svml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm5 #4695.13 + vfnmadd132pd 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11, %xmm5 #4695.13 vsubpd %xmm2, %xmm8, %xmm10 #4706.18 vfmadd231pd %xmm6, %xmm1, %xmm9 #4705.18 vaddpd %xmm1, %xmm4, %xmm1 #4715.13 vfmadd231pd %xmm4, %xmm6, %xmm10 #4707.18 - vmovupd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #4712.14 - vmovupd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm4 #4719.14 - vfmadd231pd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm15, %xmm11 #4712.14 - vfmadd231pd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm15, %xmm4 #4719.14 + vmovupd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #4712.14 + vmovupd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm4 #4719.14 + vfmadd231pd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15, %xmm11 #4712.14 + vfmadd231pd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15, %xmm4 #4719.14 vaddpd %xmm10, %xmm9, %xmm13 #4708.21 vmulpd %xmm11, %xmm15, %xmm12 #4713.14 - vfmadd213pd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm15, %xmm4 #4721.14 + vfmadd213pd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm15, %xmm4 #4721.14 vmulpd %xmm12, %xmm6, %xmm8 #4714.14 vmulpd %xmm4, %xmm15, %xmm9 #4722.14 vfmadd213pd %xmm13, %xmm1, %xmm8 #4716.17 @@ -1987,22 +1987,22 @@ __svml_cos2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #4975.546 lea 128(%rsp,%r12,8), %rsi #4975.546 -..___tag_value___svml_cos2_ha_l9.145: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #4975.546 -..___tag_value___svml_cos2_ha_l9.146: +..___tag_value___jsvml_cos2_ha_l9.145: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #4975.546 +..___tag_value___jsvml_cos2_ha_l9.146: jmp ..B6.9 # Prob 100% #4975.546 .cfi_restore 12 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B6.12: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq - vmovupd 16512+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #4733.55 - lea __svml_dcos_ha_reduction_data_internal(%rip), %r8 #4825.385 + vmovupd 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #4733.55 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %r8 #4825.385 vpand .L_2il0floatpacket.34(%rip), %xmm14, %xmm8 #4823.18 vandpd %xmm7, %xmm13, %xmm9 #4734.17 vpsrlq $52, %xmm8, %xmm7 #4824.18 - lea __svml_dcos_ha_data_internal_ha(%rip), %r11 #4942.387 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %r11 #4942.387 vmovd %xmm7, %edx #4825.124 vmovupd %xmm1, (%rsp) #[spill] vpand .L_2il0floatpacket.35(%rip), %xmm14, %xmm1 #4833.21 @@ -2100,7 +2100,7 @@ __svml_cos2_ha_l9: vandpd .L_2il0floatpacket.50(%rip), %xmm14, %xmm11 #4934.11 vandps .L_2il0floatpacket.41(%rip), %xmm10, %xmm10 #4901.15 vmovd %xmm10, %r9d #4942.132 - vmovupd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm4 #4955.18 + vmovupd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm4 #4955.18 vfmadd132pd .L_2il0floatpacket.69(%rip), %xmm15, %xmm7 #4930.13 vmovups .L_2il0floatpacket.51(%rip), %xmm15 #4933.16 vcmplepd %xmm15, %xmm11, %xmm9 #4936.20 @@ -2123,7 +2123,7 @@ __svml_cos2_ha_l9: vfmadd213pd %xmm13, %xmm7, %xmm1 #4945.26 vmovq (%r9,%r11), %xmm2 #4942.616 vmovhpd (%r10,%r11), %xmm2, %xmm12 #4942.584 - vfmadd231pd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm10, %xmm4 #4955.18 + vfmadd231pd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10, %xmm4 #4955.18 vfmadd132pd %xmm12, %xmm1, %xmm15 #4946.25 vsubpd %xmm1, %xmm13, %xmm2 #4947.22 vmulpd %xmm4, %xmm10, %xmm5 #4956.18 @@ -2131,11 +2131,11 @@ __svml_cos2_ha_l9: vaddpd %xmm7, %xmm12, %xmm1 #4958.17 vmulpd %xmm5, %xmm9, %xmm11 #4957.18 vfmadd231pd %xmm12, %xmm9, %xmm3 #4950.22 - vmovupd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #4962.18 - vfmadd231pd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm10, %xmm12 #4962.18 + vmovupd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #4962.18 + vfmadd231pd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10, %xmm12 #4962.18 vfmadd231pd %xmm9, %xmm7, %xmm2 #4948.22 vfnmadd213pd %xmm1, %xmm13, %xmm9 #4967.17 - vfmadd213pd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm10, %xmm12 #4964.18 + vfmadd213pd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10, %xmm12 #4964.18 vaddpd %xmm3, %xmm2, %xmm8 #4951.25 vmulpd %xmm12, %xmm10, %xmm2 #4965.18 vfmadd213pd %xmm8, %xmm1, %xmm11 #4959.21 @@ -2152,20 +2152,20 @@ __svml_cos2_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm14 .cfi_endproc # mark_end; - .type __svml_cos2_ha_l9,@function - .size __svml_cos2_ha_l9,.-__svml_cos2_ha_l9 -..LN__svml_cos2_ha_l9.5: + .type __jsvml_cos2_ha_l9,@function + .size __jsvml_cos2_ha_l9,.-__jsvml_cos2_ha_l9 +..LN__jsvml_cos2_ha_l9.5: .data -# -- End __svml_cos2_ha_l9 +# -- End __jsvml_cos2_ha_l9 .text -.L_2__routine_start___svml_cos1_ha_ex_6: -# -- Begin __svml_cos1_ha_ex +.L_2__routine_start___jsvml_cos1_ha_ex_6: +# -- Begin __jsvml_cos1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cos1_ha_ex -# --- __svml_cos1_ha_ex(__m128d) -__svml_cos1_ha_ex: + .globl __jsvml_cos1_ha_ex +# --- __jsvml_cos1_ha_ex(__m128d) +__jsvml_cos1_ha_ex: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -2174,7 +2174,7 @@ __svml_cos1_ha_ex: .byte 30 #5345.18 .byte 250 #5345.18 .cfi_startproc -..___tag_value___svml_cos1_ha_ex.152: +..___tag_value___jsvml_cos1_ha_ex.152: ..L153: #4983.1 pushq %rbp #4983.1 @@ -2187,11 +2187,11 @@ __svml_cos1_ha_ex: movaps %xmm0, %xmm2 #4983.1 movaps %xmm2, %xmm11 #5043.25 movaps %xmm2, %xmm4 #5046.14 - mulsd 16576+__svml_dcos_ha_data_internal_ha(%rip), %xmm11 #5043.25 - lea __svml_dcos_ha_data_internal_ha(%rip), %rax #5057.365 - movsd 16640+__svml_dcos_ha_data_internal_ha(%rip), %xmm6 #5042.20 + mulsd 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm11 #5043.25 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rax #5057.365 + movsd 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm6 #5042.20 xorl %edx, %edx #5035.1 - movq 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #5055.21 + movq 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #5055.21 addsd %xmm6, %xmm11 #5043.13 movaps %xmm11, %xmm9 #5044.13 pand %xmm10, %xmm11 #5056.17 @@ -2199,9 +2199,9 @@ __svml_cos1_ha_ex: subsd %xmm6, %xmm9 #5044.13 movaps %xmm9, %xmm7 #5046.34 movaps %xmm9, %xmm8 #5048.19 - mulsd 16768+__svml_dcos_ha_data_internal_ha(%rip), %xmm7 #5046.34 - mulsd 16832+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #5048.19 - mulsd 16896+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5053.32 + mulsd 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7 #5046.34 + mulsd 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #5048.19 + mulsd 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5053.32 subsd %xmm7, %xmm4 #5046.14 movaps %xmm4, %xmm3 #5049.17 shll $5, %ecx #5057.225 @@ -2228,18 +2228,18 @@ __svml_cos1_ha_ex: subsd %xmm0, %xmm6 #5066.18 mulsd %xmm3, %xmm12 #5069.15 addsd %xmm13, %xmm6 #5067.18 - movsd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #5072.26 + movsd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #5072.26 addsd %xmm14, %xmm6 #5068.21 mulsd %xmm12, %xmm13 #5072.26 - movsd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5079.26 + movsd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5079.26 mulsd %xmm12, %xmm9 #5079.26 - addsd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm13 #5072.14 + addsd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm13 #5072.14 mulsd %xmm12, %xmm13 #5073.14 - addsd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5079.14 + addsd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5079.14 mulsd %xmm12, %xmm9 #5081.26 mulsd %xmm3, %xmm13 #5074.14 mulsd %xmm7, %xmm3 #5084.32 - addsd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5081.14 + addsd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5081.14 mulsd %xmm8, %xmm13 #5076.29 subsd %xmm3, %xmm8 #5084.13 mulsd %xmm12, %xmm9 #5082.14 @@ -2248,12 +2248,12 @@ __svml_cos1_ha_ex: mulsd %xmm7, %xmm9 #5083.29 addsd 24(%rax,%rcx), %xmm4 #5086.16 addsd %xmm13, %xmm9 #5083.17 - movsd 16384+__svml_dcos_ha_data_internal_ha(%rip), %xmm5 #5038.13 + movsd 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm5 #5038.13 addsd %xmm4, %xmm9 #5087.17 andps %xmm2, %xmm5 #5038.13 addsd %xmm9, %xmm0 #5088.14 movaps %xmm5, %xmm1 #5039.26 - cmpnlesd 16448+__svml_dcos_ha_data_internal_ha(%rip), %xmm1 #5039.26 + cmpnlesd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm1 #5039.26 movmskpd %xmm1, %esi #5089.78 testl $1, %esi #5090.55 jne ..B7.8 # Prob 5% #5090.66 @@ -2298,17 +2298,17 @@ __svml_cos1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #5348.546 lea 64(%rsp), %rsi #5348.546 -..___tag_value___svml_cos1_ha_ex.165: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #5348.546 -..___tag_value___svml_cos1_ha_ex.166: +..___tag_value___jsvml_cos1_ha_ex.165: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #5348.546 +..___tag_value___jsvml_cos1_ha_ex.166: jmp ..B7.5 # Prob 100% #5348.546 # LOE rbx r12 r13 r14 r15 ..B7.8: # Preds ..B7.1 # Execution count [5.00e-02]: Infreq movups %xmm0, (%rsp) #[spill] - lea __svml_dcos_ha_reduction_data_internal(%rip), %rdi #5185.377 - movsd 16512+__svml_dcos_ha_data_internal_ha(%rip), %xmm0 #5093.24 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %rdi #5185.377 + movsd 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm0 #5093.24 andps %xmm0, %xmm5 #5094.17 movdqu .L_2il0floatpacket.34(%rip), %xmm6 #5183.16 cmpeqsd %xmm0, %xmm5 #5095.25 @@ -2472,25 +2472,25 @@ __svml_cos1_ha_ex: movaps %xmm13, %xmm10 #5319.25 mulsd %xmm3, %xmm7 #5325.19 addsd %xmm5, %xmm10 #5319.25 - movsd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm6 #5328.30 + movsd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm6 #5328.30 subsd %xmm10, %xmm5 #5322.22 mulsd %xmm7, %xmm6 #5328.30 addsd %xmm13, %xmm5 #5323.22 - addsd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm6 #5328.18 + addsd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm6 #5328.18 addsd %xmm0, %xmm5 #5324.25 mulsd %xmm7, %xmm6 #5329.18 - movsd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5335.30 + movsd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5335.30 movaps %xmm1, %xmm0 #5345.29 mulsd %xmm7, %xmm9 #5335.30 mulsd %xmm3, %xmm6 #5330.18 mulsd %xmm14, %xmm3 #5340.36 - addsd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5335.18 + addsd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5335.18 mulsd %xmm8, %xmm6 #5332.33 subsd %xmm3, %xmm8 #5340.17 mulsd %xmm7, %xmm9 #5337.30 addsd %xmm5, %xmm6 #5332.21 mulsd %xmm8, %xmm4 #5342.32 - addsd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5337.18 + addsd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5337.18 addsd 24(%rax,%r8), %xmm4 #5342.20 mulsd %xmm7, %xmm9 #5338.18 mulsd %xmm14, %xmm9 #5339.33 @@ -2505,20 +2505,20 @@ __svml_cos1_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm2 .cfi_endproc # mark_end; - .type __svml_cos1_ha_ex,@function - .size __svml_cos1_ha_ex,.-__svml_cos1_ha_ex -..LN__svml_cos1_ha_ex.6: + .type __jsvml_cos1_ha_ex,@function + .size __jsvml_cos1_ha_ex,.-__jsvml_cos1_ha_ex +..LN__jsvml_cos1_ha_ex.6: .data -# -- End __svml_cos1_ha_ex +# -- End __jsvml_cos1_ha_ex .text -.L_2__routine_start___svml_cos1_ha_e9_7: -# -- Begin __svml_cos1_ha_e9 +.L_2__routine_start___jsvml_cos1_ha_e9_7: +# -- Begin __jsvml_cos1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cos1_ha_e9 -# --- __svml_cos1_ha_e9(__m128d) -__svml_cos1_ha_e9: + .globl __jsvml_cos1_ha_e9 +# --- __jsvml_cos1_ha_e9(__m128d) +__jsvml_cos1_ha_e9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -2527,7 +2527,7 @@ __svml_cos1_ha_e9: .byte 30 #5718.18 .byte 250 #5718.18 .cfi_startproc -..___tag_value___svml_cos1_ha_e9.170: +..___tag_value___jsvml_cos1_ha_e9.170: ..L171: #5356.1 pushq %rbp #5356.1 @@ -2540,11 +2540,11 @@ __svml_cos1_ha_e9: movaps %xmm0, %xmm2 #5356.1 movaps %xmm2, %xmm10 #5416.25 movaps %xmm2, %xmm4 #5419.14 - mulsd 16576+__svml_dcos_ha_data_internal_ha(%rip), %xmm10 #5416.25 - lea __svml_dcos_ha_data_internal_ha(%rip), %rax #5430.371 - movsd 16640+__svml_dcos_ha_data_internal_ha(%rip), %xmm1 #5415.20 + mulsd 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm10 #5416.25 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %rax #5430.371 + movsd 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm1 #5415.20 xorl %edx, %edx #5408.1 - movq 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5428.27 + movq 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5428.27 addsd %xmm1, %xmm10 #5416.13 movaps %xmm10, %xmm8 #5417.13 pand %xmm9, %xmm10 #5429.23 @@ -2552,9 +2552,9 @@ __svml_cos1_ha_e9: subsd %xmm1, %xmm8 #5417.13 movaps %xmm8, %xmm6 #5419.34 movaps %xmm8, %xmm7 #5421.19 - mulsd 16768+__svml_dcos_ha_data_internal_ha(%rip), %xmm6 #5419.34 - mulsd 16832+__svml_dcos_ha_data_internal_ha(%rip), %xmm7 #5421.19 - mulsd 16896+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #5426.32 + mulsd 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm6 #5419.34 + mulsd 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm7 #5421.19 + mulsd 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #5426.32 subsd %xmm6, %xmm4 #5419.14 movaps %xmm4, %xmm3 #5422.17 shll $5, %ecx #5430.231 @@ -2581,18 +2581,18 @@ __svml_cos1_ha_e9: subsd %xmm1, %xmm15 #5439.18 mulsd %xmm3, %xmm11 #5442.15 addsd %xmm12, %xmm15 #5440.18 - movsd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #5445.26 + movsd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #5445.26 addsd %xmm13, %xmm15 #5441.21 mulsd %xmm11, %xmm12 #5445.26 - movsd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #5452.26 + movsd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #5452.26 mulsd %xmm11, %xmm8 #5452.26 - addsd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm12 #5445.14 + addsd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm12 #5445.14 mulsd %xmm11, %xmm12 #5446.14 - addsd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #5452.14 + addsd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #5452.14 mulsd %xmm11, %xmm8 #5454.26 mulsd %xmm3, %xmm12 #5447.14 mulsd %xmm6, %xmm3 #5457.32 - addsd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm8 #5454.14 + addsd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm8 #5454.14 mulsd %xmm7, %xmm12 #5449.29 subsd %xmm3, %xmm7 #5457.13 mulsd %xmm11, %xmm8 #5455.14 @@ -2601,12 +2601,12 @@ __svml_cos1_ha_e9: mulsd %xmm6, %xmm8 #5456.29 addsd 24(%rax,%rcx), %xmm4 #5459.16 addsd %xmm12, %xmm8 #5456.17 - movsd 16384+__svml_dcos_ha_data_internal_ha(%rip), %xmm5 #5411.13 + movsd 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm5 #5411.13 addsd %xmm4, %xmm8 #5460.17 andps %xmm2, %xmm5 #5411.13 addsd %xmm8, %xmm1 #5461.14 movaps %xmm5, %xmm0 #5412.26 - cmpnlesd 16448+__svml_dcos_ha_data_internal_ha(%rip), %xmm0 #5412.26 + cmpnlesd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm0 #5412.26 movmskpd %xmm0, %esi #5462.78 testl $1, %esi #5463.55 jne ..B8.8 # Prob 5% #5463.66 @@ -2646,17 +2646,17 @@ __svml_cos1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #5721.546 lea 64(%rsp), %rsi #5721.546 -..___tag_value___svml_cos1_ha_e9.179: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #5721.546 -..___tag_value___svml_cos1_ha_e9.180: +..___tag_value___jsvml_cos1_ha_e9.179: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #5721.546 +..___tag_value___jsvml_cos1_ha_e9.180: jmp ..B8.5 # Prob 100% #5721.546 # LOE rbx r12 r13 r14 r15 ..B8.8: # Preds ..B8.1 # Execution count [5.00e-02]: Infreq movups %xmm1, (%rsp) #[spill] - lea __svml_dcos_ha_reduction_data_internal(%rip), %rdi #5558.383 - movsd 16512+__svml_dcos_ha_data_internal_ha(%rip), %xmm1 #5466.24 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %rdi #5558.383 + movsd 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm1 #5466.24 andps %xmm1, %xmm5 #5467.17 movdqu .L_2il0floatpacket.34(%rip), %xmm6 #5556.22 cmpeqsd %xmm1, %xmm5 #5468.25 @@ -2820,24 +2820,24 @@ __svml_cos1_ha_e9: movaps %xmm13, %xmm10 #5692.25 mulsd %xmm3, %xmm7 #5698.19 addsd %xmm5, %xmm10 #5692.25 - movsd 17024+__svml_dcos_ha_data_internal_ha(%rip), %xmm6 #5701.30 + movsd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm6 #5701.30 subsd %xmm10, %xmm5 #5695.22 mulsd %xmm7, %xmm6 #5701.30 addsd %xmm13, %xmm5 #5696.22 - addsd 16960+__svml_dcos_ha_data_internal_ha(%rip), %xmm6 #5701.18 + addsd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm6 #5701.18 addsd %xmm1, %xmm5 #5697.25 mulsd %xmm7, %xmm6 #5702.18 - movsd 17216+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5708.30 + movsd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5708.30 mulsd %xmm7, %xmm9 #5708.30 mulsd %xmm3, %xmm6 #5703.18 mulsd %xmm14, %xmm3 #5713.36 - addsd 17152+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5708.18 + addsd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5708.18 mulsd %xmm8, %xmm6 #5705.33 subsd %xmm3, %xmm8 #5713.17 mulsd %xmm7, %xmm9 #5710.30 addsd %xmm5, %xmm6 #5705.21 mulsd %xmm8, %xmm4 #5715.32 - addsd 17088+__svml_dcos_ha_data_internal_ha(%rip), %xmm9 #5710.18 + addsd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm9 #5710.18 addsd 24(%rax,%r8), %xmm4 #5715.20 mulsd %xmm7, %xmm9 #5711.18 mulsd %xmm14, %xmm9 #5712.33 @@ -2851,20 +2851,20 @@ __svml_cos1_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm1 xmm2 .cfi_endproc # mark_end; - .type __svml_cos1_ha_e9,@function - .size __svml_cos1_ha_e9,.-__svml_cos1_ha_e9 -..LN__svml_cos1_ha_e9.7: + .type __jsvml_cos1_ha_e9,@function + .size __jsvml_cos1_ha_e9,.-__jsvml_cos1_ha_e9 +..LN__jsvml_cos1_ha_e9.7: .data -# -- End __svml_cos1_ha_e9 +# -- End __jsvml_cos1_ha_e9 .text -.L_2__routine_start___svml_cos4_ha_e9_8: -# -- Begin __svml_cos4_ha_e9 +.L_2__routine_start___jsvml_cos4_ha_e9_8: +# -- Begin __jsvml_cos4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cos4_ha_e9 -# --- __svml_cos4_ha_e9(__m256d) -__svml_cos4_ha_e9: + .globl __jsvml_cos4_ha_e9 +# --- __jsvml_cos4_ha_e9(__m256d) +__jsvml_cos4_ha_e9: # parameter 1: %ymm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -2873,7 +2873,7 @@ __svml_cos4_ha_e9: .byte 30 #6091.18 .byte 250 #6091.18 .cfi_startproc -..___tag_value___svml_cos4_ha_e9.184: +..___tag_value___jsvml_cos4_ha_e9.184: ..L185: #5729.1 pushq %rbp #5729.1 @@ -2883,24 +2883,24 @@ __svml_cos4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #5729.1 subq $320, %rsp #5729.1 - lea __svml_dcos_ha_data_internal_ha(%rip), %r8 #5803.613 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %r8 #5803.613 vmovapd %ymm0, %ymm6 #5729.1 xorl %esi, %esi #5781.1 - vmovupd 16640+__svml_dcos_ha_data_internal_ha(%rip), %ymm7 #5788.54 - vmulpd 16576+__svml_dcos_ha_data_internal_ha(%rip), %ymm6, %ymm5 #5789.28 + vmovupd 16640+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7 #5788.54 + vmulpd 16576+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm6, %ymm5 #5789.28 vaddpd %ymm5, %ymm7, %ymm13 #5789.13 - vmovupd 16704+__svml_dcos_ha_data_internal_ha(%rip), %xmm5 #5801.27 + vmovupd 16704+__jsvml_dcos_ha_data_internal_ha(%rip), %xmm5 #5801.27 vsubpd %ymm7, %ymm13, %ymm11 #5790.13 - vmulpd 16768+__svml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm3 #5792.37 - vmulpd 16832+__svml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm8 #5794.19 - vmulpd 16896+__svml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm14 #5799.35 + vmulpd 16768+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm3 #5792.37 + vmulpd 16832+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm8 #5794.19 + vmulpd 16896+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm14 #5799.35 vsubpd %ymm3, %ymm6, %ymm9 #5792.14 vsubpd %ymm8, %ymm9, %ymm0 #5795.17 vsubpd %ymm0, %ymm9, %ymm4 #5796.17 vsubpd %ymm8, %ymm4, %ymm10 #5797.17 vsubpd %ymm14, %ymm10, %ymm3 #5799.13 - vandpd 16384+__svml_dcos_ha_data_internal_ha(%rip), %ymm6, %ymm1 #5784.13 - vcmpnle_uqpd 16448+__svml_dcos_ha_data_internal_ha(%rip), %ymm1, %ymm15 #5785.26 + vandpd 16384+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm6, %ymm1 #5784.13 + vcmpnle_uqpd 16448+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm1, %ymm15 #5785.26 vandps %xmm5, %xmm13, %xmm7 #5802.23 vextractf128 $1, %ymm13, %xmm12 #5800.104 vmovd %xmm7, %eax #5803.128 @@ -2937,20 +2937,20 @@ __svml_cos4_ha_e9: vaddpd %ymm11, %ymm12, %ymm12 #5813.18 vmulpd %ymm0, %ymm0, %ymm11 #5815.15 vaddpd %ymm12, %ymm10, %ymm10 #5814.21 - vmulpd 17024+__svml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm7 #5818.29 - vaddpd 16960+__svml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm9 #5818.14 - vmulpd 17216+__svml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm7 #5825.29 + vmulpd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm7 #5818.29 + vaddpd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm9 #5818.14 + vmulpd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm11, %ymm7 #5825.29 vmulpd %ymm9, %ymm11, %ymm8 #5819.14 vaddpd %ymm13, %ymm14, %ymm9 #5821.13 vmulpd %ymm8, %ymm0, %ymm12 #5820.14 vmulpd %ymm0, %ymm4, %ymm0 #5830.35 vmulpd %ymm9, %ymm12, %ymm14 #5822.32 vaddpd %ymm14, %ymm10, %ymm8 #5822.17 - vaddpd 17152+__svml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm10 #5825.14 + vaddpd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm7, %ymm10 #5825.14 vmulpd %ymm10, %ymm11, %ymm12 #5827.29 vsubpd %ymm0, %ymm9, %ymm10 #5830.13 vmovq 24(%rax,%r8), %xmm0 #5831.1112 - vaddpd 17088+__svml_dcos_ha_data_internal_ha(%rip), %ymm12, %ymm13 #5827.14 + vaddpd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm12, %ymm13 #5827.14 vmulpd %ymm10, %ymm3, %ymm3 #5832.31 vmulpd %ymm13, %ymm11, %ymm11 #5828.14 vmulpd %ymm11, %ymm4, %ymm14 #5829.32 @@ -3029,18 +3029,18 @@ __svml_cos4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #6094.552 lea 128(%rsp,%r12,8), %rsi #6094.552 -..___tag_value___svml_cos4_ha_e9.202: -# __svml_dcos_ha_cout_rare_internal(const double *, double *) - call __svml_dcos_ha_cout_rare_internal #6094.552 -..___tag_value___svml_cos4_ha_e9.203: +..___tag_value___jsvml_cos4_ha_e9.202: +# __jsvml_dcos_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcos_ha_cout_rare_internal #6094.552 +..___tag_value___jsvml_cos4_ha_e9.203: jmp ..B9.9 # Prob 100% #6094.552 .cfi_restore 12 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B9.12: # Preds ..B9.1 # Execution count [5.00e-02]: Infreq - vmovupd 16512+__svml_dcos_ha_data_internal_ha(%rip), %ymm4 #5839.58 - lea __svml_dcos_ha_reduction_data_internal(%rip), %rcx #5931.621 + vmovupd 16512+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm4 #5839.58 + lea __jsvml_dcos_ha_reduction_data_internal(%rip), %rcx #5931.621 vmovupd %ymm15, 32(%rsp) #[spill] vmovupd %ymm6, (%rsp) #[spill] vmovdqu .L_2il0floatpacket.34(%rip), %xmm7 #5928.22 @@ -3067,7 +3067,7 @@ __svml_cos4_ha_e9: vpextrd $2, %xmm2, %r8d #5931.189 lea (%r9,%r9,2), %r10d #5931.534 shll $3, %r10d #5931.534 - lea __svml_dcos_ha_data_internal_ha(%rip), %r9 #6059.617 + lea __jsvml_dcos_ha_data_internal_ha(%rip), %r9 #6059.617 vmovq (%r10,%rcx), %xmm11 #5931.1369 shll $3, %edx #5931.432 lea (%r11,%r11,2), %edi #5931.585 @@ -3309,10 +3309,10 @@ __svml_cos4_ha_e9: vaddpd %ymm8, %ymm13, %ymm12 #6070.25 vaddpd %ymm10, %ymm2, %ymm13 #6077.17 vmulpd %ymm1, %ymm1, %ymm8 #6071.19 - vmulpd 17024+__svml_dcos_ha_data_internal_ha(%rip), %ymm8, %ymm0 #6074.33 - vmulpd 17216+__svml_dcos_ha_data_internal_ha(%rip), %ymm8, %ymm9 #6081.33 - vaddpd 16960+__svml_dcos_ha_data_internal_ha(%rip), %ymm0, %ymm3 #6074.18 - vaddpd 17152+__svml_dcos_ha_data_internal_ha(%rip), %ymm9, %ymm0 #6081.18 + vmulpd 17024+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm8, %ymm0 #6074.33 + vmulpd 17216+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm8, %ymm9 #6081.33 + vaddpd 16960+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm0, %ymm3 #6074.18 + vaddpd 17152+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm9, %ymm0 #6081.18 vmulpd %ymm3, %ymm8, %ymm5 #6075.18 vmulpd %ymm5, %ymm1, %ymm11 #6076.18 vmulpd %ymm7, %ymm1, %ymm1 #6086.39 @@ -3320,7 +3320,7 @@ __svml_cos4_ha_e9: vaddpd %ymm2, %ymm12, %ymm5 #6078.21 vmulpd %ymm0, %ymm8, %ymm2 #6083.33 vmovq 24(%rax,%r9), %xmm0 #6087.1116 - vaddpd 17088+__svml_dcos_ha_data_internal_ha(%rip), %ymm2, %ymm3 #6083.18 + vaddpd 17088+__jsvml_dcos_ha_data_internal_ha(%rip), %ymm2, %ymm3 #6083.18 vmovq 24(%rcx,%r9), %xmm2 #6087.1316 vmulpd %ymm3, %ymm8, %ymm8 #6084.18 vmovhpd 24(%r8,%r9), %xmm2, %xmm3 #6087.1284 @@ -3341,21 +3341,21 @@ __svml_cos4_ha_e9: # LOE rbx r12 r13 r14 r15 esi ymm0 ymm6 .cfi_endproc # mark_end; - .type __svml_cos4_ha_e9,@function - .size __svml_cos4_ha_e9,.-__svml_cos4_ha_e9 -..LN__svml_cos4_ha_e9.8: + .type __jsvml_cos4_ha_e9,@function + .size __jsvml_cos4_ha_e9,.-__jsvml_cos4_ha_e9 +..LN__jsvml_cos4_ha_e9.8: .data -# -- End __svml_cos4_ha_e9 +# -- End __jsvml_cos4_ha_e9 .text -.L_2__routine_start___svml_dcos_ha_cout_rare_internal_9: -# -- Begin __svml_dcos_ha_cout_rare_internal +.L_2__routine_start___jsvml_dcos_ha_cout_rare_internal_9: +# -- Begin __jsvml_dcos_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dcos_ha_cout_rare_internal - .globl __svml_dcos_ha_cout_rare_internal -# --- __svml_dcos_ha_cout_rare_internal(const double *, double *) -__svml_dcos_ha_cout_rare_internal: + .hidden __jsvml_dcos_ha_cout_rare_internal + .globl __jsvml_dcos_ha_cout_rare_internal +# --- __jsvml_dcos_ha_cout_rare_internal(const double *, double *) +__jsvml_dcos_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -3365,7 +3365,7 @@ __svml_dcos_ha_cout_rare_internal: .byte 30 #2758.12 .byte 250 #2758.12 .cfi_startproc -..___tag_value___svml_dcos_ha_cout_rare_internal.235: +..___tag_value___jsvml_dcos_ha_cout_rare_internal.235: ..L236: #2739.1 movzwl 6(%rdi), %eax #2744.36 @@ -3411,17 +3411,17 @@ __svml_dcos_ha_cout_rare_internal: # LOE .cfi_endproc # mark_end; - .type __svml_dcos_ha_cout_rare_internal,@function - .size __svml_dcos_ha_cout_rare_internal,.-__svml_dcos_ha_cout_rare_internal -..LN__svml_dcos_ha_cout_rare_internal.9: + .type __jsvml_dcos_ha_cout_rare_internal,@function + .size __jsvml_dcos_ha_cout_rare_internal,.-__jsvml_dcos_ha_cout_rare_internal +..LN__jsvml_dcos_ha_cout_rare_internal.9: .data -# -- End __svml_dcos_ha_cout_rare_internal +# -- End __jsvml_dcos_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dcos_ha_reduction_data_internal - .globl __svml_dcos_ha_reduction_data_internal -__svml_dcos_ha_reduction_data_internal: + .hidden __jsvml_dcos_ha_reduction_data_internal + .globl __jsvml_dcos_ha_reduction_data_internal +__jsvml_dcos_ha_reduction_data_internal: .long 0 .long 0 .long 0 @@ -15710,13 +15710,13 @@ __svml_dcos_ha_reduction_data_internal: .long 484957737 .long 896803160 .long 3984508030 - .type __svml_dcos_ha_reduction_data_internal,@object - .size __svml_dcos_ha_reduction_data_internal,49152 + .type __jsvml_dcos_ha_reduction_data_internal,@object + .size __jsvml_dcos_ha_reduction_data_internal,49152 .space 512, 0x00 # pad .align 64 - .hidden __svml_dcos_ha_data_internal_ha - .globl __svml_dcos_ha_data_internal_ha -__svml_dcos_ha_data_internal_ha: + .hidden __jsvml_dcos_ha_data_internal_ha + .globl __jsvml_dcos_ha_data_internal_ha +__jsvml_dcos_ha_data_internal_ha: .long 0 .long 0 .long 0 @@ -20037,12 +20037,12 @@ __svml_dcos_ha_data_internal_ha: .long 3210133866 .long 2976101079 .long 3210133866 - .type __svml_dcos_ha_data_internal_ha,@object - .size __svml_dcos_ha_data_internal_ha,17280 + .type __jsvml_dcos_ha_data_internal_ha,@object + .size __jsvml_dcos_ha_data_internal_ha,17280 .align 64 - .hidden __svml_dcos_ha_data_internal - .globl __svml_dcos_ha_data_internal -__svml_dcos_ha_data_internal: + .hidden __jsvml_dcos_ha_data_internal + .globl __jsvml_dcos_ha_data_internal +__jsvml_dcos_ha_data_internal: .long 4294967295 .long 2147483647 .long 4294967295 @@ -20395,8 +20395,8 @@ __svml_dcos_ha_data_internal: .long 3217380693 .long 1431655765 .long 3217380693 - .type __svml_dcos_ha_data_internal,@object - .size __svml_dcos_ha_data_internal,1408 + .type __jsvml_dcos_ha_data_internal,@object + .size __jsvml_dcos_ha_data_internal,1408 .align 32 .L_2il0floatpacket.70: .long 0x00000000,0x7ff00000,0x00000000,0x7ff00000,0x00000000,0x7ff00000,0x00000000,0x7ff00000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_cosh_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cosh_linux_x86.S similarity index 88% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_cosh_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cosh_linux_x86.S index a1e2c39ec93..255e51366d4 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_cosh_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_cosh_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_cosh.c" .text ..TXTST0: -.L_2__routine_start___svml_cosh1_ha_e9_0: -# -- Begin __svml_cosh1_ha_e9 +.L_2__routine_start___jsvml_cosh1_ha_e9_0: +# -- Begin __jsvml_cosh1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh1_ha_e9 -# --- __svml_cosh1_ha_e9(__m128d) -__svml_cosh1_ha_e9: + .globl __jsvml_cosh1_ha_e9 +# --- __jsvml_cosh1_ha_e9(__m128d) +__jsvml_cosh1_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_cosh1_ha_e9: .byte 30 #359.546 .byte 250 #359.546 .cfi_startproc -..___tag_value___svml_cosh1_ha_e9.1: +..___tag_value___jsvml_cosh1_ha_e9.1: ..L2: #285.1 pushq %rbp #285.1 @@ -58,19 +58,19 @@ __svml_cosh1_ha_e9: andq $-64, %rsp #285.1 subq $128, %rsp #285.1 movl $127, %edx #327.23 - movsd 4672+__svml_dcosh_ha_data_internal(%rip), %xmm1 #319.16 + movsd 4672+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #319.16 movl $1082531225, %eax #323.27 andnps %xmm0, %xmm1 #319.16 - lea 912+__svml_dcosh_ha_data_internal(%rip), %rsi #328.642 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %rsi #328.642 movaps %xmm1, %xmm12 #320.25 - mulsd 3968+__svml_dcosh_ha_data_internal(%rip), %xmm12 #320.25 + mulsd 3968+__jsvml_dcosh_ha_data_internal(%rip), %xmm12 #320.25 movd %edx, %xmm4 #327.23 - movsd 4160+__svml_dcosh_ha_data_internal(%rip), %xmm7 #309.20 + movsd 4160+__jsvml_dcosh_ha_data_internal(%rip), %xmm7 #309.20 movd %eax, %xmm2 #323.27 - movsd 4032+__svml_dcosh_ha_data_internal(%rip), %xmm8 #332.35 + movsd 4032+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #332.35 addsd %xmm7, %xmm12 #320.13 movaps %xmm12, %xmm9 #331.13 - movsd 4096+__svml_dcosh_ha_data_internal(%rip), %xmm10 #333.32 + movsd 4096+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #333.32 subsd %xmm7, %xmm9 #331.13 mulsd %xmm9, %xmm8 #332.35 mulsd %xmm9, %xmm10 #333.32 @@ -80,7 +80,7 @@ __svml_cosh1_ha_e9: pcmpgtd %xmm2, %xmm3 #323.27 pand %xmm4, %xmm5 #327.23 psllq $45, %xmm12 #334.19 - movsd 4544+__svml_dcosh_ha_data_internal(%rip), %xmm4 #349.25 + movsd 4544+__jsvml_dcosh_ha_data_internal(%rip), %xmm4 #349.25 movdqa %xmm5, %xmm6 #328.242 pslld $1, %xmm6 #328.242 subsd %xmm10, %xmm1 #333.13 @@ -90,15 +90,15 @@ __svml_cosh1_ha_e9: mulsd %xmm1, %xmm13 #348.14 pslld $3, %xmm6 #328.389 movd %xmm6, %ecx #328.463 - movsd 4480+__svml_dcosh_ha_data_internal(%rip), %xmm8 #350.27 + movsd 4480+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #350.27 mulsd %xmm13, %xmm4 #349.25 mulsd %xmm13, %xmm8 #350.27 - addsd 4416+__svml_dcosh_ha_data_internal(%rip), %xmm4 #349.13 - addsd 4352+__svml_dcosh_ha_data_internal(%rip), %xmm8 #350.15 + addsd 4416+__jsvml_dcosh_ha_data_internal(%rip), %xmm4 #349.13 + addsd 4352+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #350.15 mulsd %xmm13, %xmm4 #351.13 mulsd %xmm13, %xmm8 #352.15 mulsd %xmm1, %xmm4 #354.25 - movq 4608+__svml_dcosh_ha_data_internal(%rip), %xmm11 #335.25 + movq 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm11 #335.25 addsd %xmm1, %xmm4 #354.13 movq -16(%rcx,%rsi), %xmm3 #328.642 pand %xmm11, %xmm12 #336.19 @@ -146,29 +146,29 @@ __svml_cosh1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #359.546 lea 64(%rsp), %rsi #359.546 -..___tag_value___svml_cosh1_ha_e9.10: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #359.546 -..___tag_value___svml_cosh1_ha_e9.11: +..___tag_value___jsvml_cosh1_ha_e9.10: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #359.546 +..___tag_value___jsvml_cosh1_ha_e9.11: jmp ..B1.4 # Prob 100% #359.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_cosh1_ha_e9,@function - .size __svml_cosh1_ha_e9,.-__svml_cosh1_ha_e9 -..LN__svml_cosh1_ha_e9.0: + .type __jsvml_cosh1_ha_e9,@function + .size __jsvml_cosh1_ha_e9,.-__jsvml_cosh1_ha_e9 +..LN__jsvml_cosh1_ha_e9.0: .data -# -- End __svml_cosh1_ha_e9 +# -- End __jsvml_cosh1_ha_e9 .text -.L_2__routine_start___svml_cosh4_ha_l9_1: -# -- Begin __svml_cosh4_ha_l9 +.L_2__routine_start___jsvml_cosh4_ha_l9_1: +# -- Begin __jsvml_cosh4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh4_ha_l9 -# --- __svml_cosh4_ha_l9(__m256d) -__svml_cosh4_ha_l9: + .globl __jsvml_cosh4_ha_l9 +# --- __jsvml_cosh4_ha_l9(__m256d) +__jsvml_cosh4_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -177,7 +177,7 @@ __svml_cosh4_ha_l9: .byte 30 #441.552 .byte 250 #441.552 .cfi_startproc -..___tag_value___svml_cosh4_ha_l9.13: +..___tag_value___jsvml_cosh4_ha_l9.13: ..L14: #367.1 pushq %rbp #367.1 @@ -187,18 +187,18 @@ __svml_cosh4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #367.1 subq $192, %rsp #367.1 - lea 912+__svml_dcosh_ha_data_internal(%rip), %r8 #410.706 - vmovupd 4672+__svml_dcosh_ha_data_internal(%rip), %ymm7 #397.51 - vmovupd 4160+__svml_dcosh_ha_data_internal(%rip), %ymm4 #391.54 - vmovupd 3968+__svml_dcosh_ha_data_internal(%rip), %ymm3 #402.13 - vmovupd 4032+__svml_dcosh_ha_data_internal(%rip), %ymm5 #399.53 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %r8 #410.706 + vmovupd 4672+__jsvml_dcosh_ha_data_internal(%rip), %ymm7 #397.51 + vmovupd 4160+__jsvml_dcosh_ha_data_internal(%rip), %ymm4 #391.54 + vmovupd 3968+__jsvml_dcosh_ha_data_internal(%rip), %ymm3 #402.13 + vmovupd 4032+__jsvml_dcosh_ha_data_internal(%rip), %ymm5 #399.53 vmovapd %ymm0, %ymm6 #367.1 vandnpd %ymm6, %ymm7, %ymm2 #401.16 vfmadd213pd %ymm4, %ymm2, %ymm3 #402.13 vextractf128 $1, %ymm3, %xmm11 #408.126 vsubpd %ymm4, %ymm3, %ymm4 #413.13 vshufps $136, %xmm11, %xmm3, %xmm12 #408.37 - vpand 4224+__svml_dcosh_ha_data_internal(%rip), %xmm12, %xmm14 #409.19 + vpand 4224+__jsvml_dcosh_ha_data_internal(%rip), %xmm12, %xmm14 #409.19 vpslld $1, %xmm14, %xmm13 #410.238 vpaddd %xmm14, %xmm13, %xmm15 #410.365 vpslld $3, %xmm15, %xmm7 #410.365 @@ -217,13 +217,13 @@ __svml_cosh4_ha_l9: vextractf128 $1, %ymm2, %xmm8 #404.125 vshufps $221, %xmm8, %xmm2, %xmm9 #404.36 vfnmadd231pd %ymm5, %ymm4, %ymm2 #414.13 - vpcmpgtd 4736+__svml_dcosh_ha_data_internal(%rip), %xmm9, %xmm10 #405.23 - vpand 4608+__svml_dcosh_ha_data_internal(%rip), %ymm3, %ymm5 #418.15 + vpcmpgtd 4736+__jsvml_dcosh_ha_data_internal(%rip), %xmm9, %xmm10 #405.23 + vpand 4608+__jsvml_dcosh_ha_data_internal(%rip), %ymm3, %ymm5 #418.15 vmovq -16(%rsi,%r8), %xmm8 #410.1403 vmovmskps %xmm10, %eax #406.44 vmovq -8(%rdx,%r8), %xmm10 #411.1203 vmovhpd -16(%rdi,%r8), %xmm8, %xmm9 #410.1371 - vfnmadd231pd 4096+__svml_dcosh_ha_data_internal(%rip), %ymm4, %ymm2 #415.13 + vfnmadd231pd 4096+__jsvml_dcosh_ha_data_internal(%rip), %ymm4, %ymm2 #415.13 vmovhpd -8(%rcx,%r8), %xmm10, %xmm11 #411.1171 vmovhpd (%rdi,%r8), %xmm7, %xmm8 #412.1368 vinsertf128 $1, %xmm9, %ymm1, %ymm1 #410.1125 @@ -233,12 +233,12 @@ __svml_cosh4_ha_l9: vpaddq %ymm5, %ymm0, %ymm3 #423.15 vpsubq %ymm5, %ymm9, %ymm8 #426.15 vmulpd %ymm2, %ymm2, %ymm5 #430.14 - vmovupd 4544+__svml_dcosh_ha_data_internal(%rip), %ymm9 #431.13 - vmovupd 4480+__svml_dcosh_ha_data_internal(%rip), %ymm0 #432.15 + vmovupd 4544+__jsvml_dcosh_ha_data_internal(%rip), %ymm9 #431.13 + vmovupd 4480+__jsvml_dcosh_ha_data_internal(%rip), %ymm0 #432.15 vaddpd %ymm8, %ymm11, %ymm1 #429.16 vsubpd %ymm8, %ymm11, %ymm4 #428.16 - vfmadd213pd 4416+__svml_dcosh_ha_data_internal(%rip), %ymm5, %ymm9 #431.13 - vfmadd213pd 4352+__svml_dcosh_ha_data_internal(%rip), %ymm5, %ymm0 #432.15 + vfmadd213pd 4416+__jsvml_dcosh_ha_data_internal(%rip), %ymm5, %ymm9 #431.13 + vfmadd213pd 4352+__jsvml_dcosh_ha_data_internal(%rip), %ymm5, %ymm0 #432.15 vmulpd %ymm9, %ymm5, %ymm10 #433.13 vmulpd %ymm0, %ymm5, %ymm7 #434.15 vfmadd213pd %ymm2, %ymm2, %ymm10 #436.13 @@ -305,29 +305,29 @@ __svml_cosh4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #441.552 lea 128(%rsp,%r12,8), %rsi #441.552 -..___tag_value___svml_cosh4_ha_l9.31: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #441.552 -..___tag_value___svml_cosh4_ha_l9.32: +..___tag_value___jsvml_cosh4_ha_l9.31: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #441.552 +..___tag_value___jsvml_cosh4_ha_l9.32: jmp ..B2.8 # Prob 100% #441.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cosh4_ha_l9,@function - .size __svml_cosh4_ha_l9,.-__svml_cosh4_ha_l9 -..LN__svml_cosh4_ha_l9.1: + .type __jsvml_cosh4_ha_l9,@function + .size __jsvml_cosh4_ha_l9,.-__jsvml_cosh4_ha_l9 +..LN__jsvml_cosh4_ha_l9.1: .data -# -- End __svml_cosh4_ha_l9 +# -- End __jsvml_cosh4_ha_l9 .text -.L_2__routine_start___svml_cosh8_ha_z0_2: -# -- Begin __svml_cosh8_ha_z0 +.L_2__routine_start___jsvml_cosh8_ha_z0_2: +# -- Begin __jsvml_cosh8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh8_ha_z0 -# --- __svml_cosh8_ha_z0(__m512d) -__svml_cosh8_ha_z0: + .globl __jsvml_cosh8_ha_z0 +# --- __jsvml_cosh8_ha_z0(__m512d) +__jsvml_cosh8_ha_z0: # parameter 1: %zmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -336,7 +336,7 @@ __svml_cosh8_ha_z0: .byte 30 #527.759 .byte 250 #527.759 .cfi_startproc -..___tag_value___svml_cosh8_ha_z0.34: +..___tag_value___jsvml_cosh8_ha_z0.34: ..L35: #449.1 pushq %rbp #449.1 @@ -346,42 +346,42 @@ __svml_cosh8_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #449.1 subq $192, %rsp #449.1 - vmovups 4672+__svml_dcosh_ha_data_internal(%rip), %zmm1 #484.49 - vmovups 384+__svml_dcosh_ha_data_internal(%rip), %zmm8 #477.52 - vmovups 3968+__svml_dcosh_ha_data_internal(%rip), %zmm7 #487.13 - vmovups 4032+__svml_dcosh_ha_data_internal(%rip), %zmm9 #475.51 - vmovups 4096+__svml_dcosh_ha_data_internal(%rip), %zmm6 #476.51 - vmovups 128+__svml_dcosh_ha_data_internal(%rip), %zmm4 #495.275 - vmovups 256+__svml_dcosh_ha_data_internal(%rip), %zmm5 #496.268 - vmovups 832+__svml_dcosh_ha_data_internal(%rip), %zmm11 #483.49 - vmovups 768+__svml_dcosh_ha_data_internal(%rip), %zmm13 #482.49 - vmovups 512+__svml_dcosh_ha_data_internal(%rip), %zmm14 #478.49 - vmovups 576+__svml_dcosh_ha_data_internal(%rip), %zmm12 #479.49 + vmovups 4672+__jsvml_dcosh_ha_data_internal(%rip), %zmm1 #484.49 + vmovups 384+__jsvml_dcosh_ha_data_internal(%rip), %zmm8 #477.52 + vmovups 3968+__jsvml_dcosh_ha_data_internal(%rip), %zmm7 #487.13 + vmovups 4032+__jsvml_dcosh_ha_data_internal(%rip), %zmm9 #475.51 + vmovups 4096+__jsvml_dcosh_ha_data_internal(%rip), %zmm6 #476.51 + vmovups 128+__jsvml_dcosh_ha_data_internal(%rip), %zmm4 #495.275 + vmovups 256+__jsvml_dcosh_ha_data_internal(%rip), %zmm5 #496.268 + vmovups 832+__jsvml_dcosh_ha_data_internal(%rip), %zmm11 #483.49 + vmovups 768+__jsvml_dcosh_ha_data_internal(%rip), %zmm13 #482.49 + vmovups 512+__jsvml_dcosh_ha_data_internal(%rip), %zmm14 #478.49 + vmovups 576+__jsvml_dcosh_ha_data_internal(%rip), %zmm12 #479.49 vmovaps %zmm0, %zmm15 #449.1 vandnpd %zmm15, %zmm1, %zmm10 #486.16 vfmadd213pd {rn-sae}, %zmm8, %zmm10, %zmm7 #487.13 vpsrlq $32, %zmm10, %zmm0 #489.38 vsubpd {rn-sae}, %zmm8, %zmm7, %zmm8 #497.15 vpmovqd %zmm0, %ymm2 #489.16 - vpermt2pd 192+__svml_dcosh_ha_data_internal(%rip), %zmm7, %zmm4 #495.275 - vpermt2pd 320+__svml_dcosh_ha_data_internal(%rip), %zmm7, %zmm5 #496.268 + vpermt2pd 192+__jsvml_dcosh_ha_data_internal(%rip), %zmm7, %zmm4 #495.275 + vpermt2pd 320+__jsvml_dcosh_ha_data_internal(%rip), %zmm7, %zmm5 #496.268 vfnmadd231pd {rn-sae}, %zmm9, %zmm8, %zmm10 #498.13 vfnmadd231pd {rn-sae}, %zmm6, %zmm8, %zmm10 #499.13 vpsllq $48, %zmm7, %zmm6 #501.15 - vpcmpgtd 4736+__svml_dcosh_ha_data_internal(%rip), %ymm2, %ymm3 #490.23 + vpcmpgtd 4736+__jsvml_dcosh_ha_data_internal(%rip), %ymm2, %ymm3 #490.23 vmulpd {rn-sae}, %zmm10, %zmm10, %zmm2 #500.16 vmovmskps %ymm3, %esi #491.44 - vmovups __svml_dcosh_ha_data_internal(%rip), %zmm3 #494.271 - vpermt2pd 64+__svml_dcosh_ha_data_internal(%rip), %zmm7, %zmm3 #494.271 - vpandq 4608+__svml_dcosh_ha_data_internal(%rip), %zmm6, %zmm7 #503.13 + vmovups __jsvml_dcosh_ha_data_internal(%rip), %zmm3 #494.271 + vpermt2pd 64+__jsvml_dcosh_ha_data_internal(%rip), %zmm7, %zmm3 #494.271 + vpandq 4608+__jsvml_dcosh_ha_data_internal(%rip), %zmm6, %zmm7 #503.13 vpaddq %zmm7, %zmm4, %zmm0 #508.13 vpaddq %zmm7, %zmm3, %zmm1 #505.13 vpsubq %zmm7, %zmm5, %zmm3 #511.13 - vmovups 704+__svml_dcosh_ha_data_internal(%rip), %zmm4 #515.17 + vmovups 704+__jsvml_dcosh_ha_data_internal(%rip), %zmm4 #515.17 vaddpd {rn-sae}, %zmm3, %zmm1, %zmm5 #514.18 vsubpd {rn-sae}, %zmm3, %zmm1, %zmm9 #513.18 vfmadd231pd {rn-sae}, %zmm2, %zmm11, %zmm4 #515.17 - vmovups 640+__svml_dcosh_ha_data_internal(%rip), %zmm11 #516.19 + vmovups 640+__jsvml_dcosh_ha_data_internal(%rip), %zmm11 #516.19 vfmadd213pd {rn-sae}, %zmm12, %zmm2, %zmm4 #517.17 vfmadd231pd {rn-sae}, %zmm2, %zmm13, %zmm11 #516.19 vmulpd {rn-sae}, %zmm2, %zmm4, %zmm13 #519.15 @@ -501,29 +501,29 @@ __svml_cosh8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #527.759 lea 128(%rsp,%rbx,8), %rsi #527.759 -..___tag_value___svml_cosh8_ha_z0.62: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #527.759 -..___tag_value___svml_cosh8_ha_z0.63: +..___tag_value___jsvml_cosh8_ha_z0.62: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #527.759 +..___tag_value___jsvml_cosh8_ha_z0.63: jmp ..B3.13 # Prob 100% #527.759 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_cosh8_ha_z0,@function - .size __svml_cosh8_ha_z0,.-__svml_cosh8_ha_z0 -..LN__svml_cosh8_ha_z0.2: + .type __jsvml_cosh8_ha_z0,@function + .size __jsvml_cosh8_ha_z0,.-__jsvml_cosh8_ha_z0 +..LN__jsvml_cosh8_ha_z0.2: .data -# -- End __svml_cosh8_ha_z0 +# -- End __jsvml_cosh8_ha_z0 .text -.L_2__routine_start___svml_cosh2_ha_l9_3: -# -- Begin __svml_cosh2_ha_l9 +.L_2__routine_start___jsvml_cosh2_ha_l9_3: +# -- Begin __jsvml_cosh2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh2_ha_l9 -# --- __svml_cosh2_ha_l9(__m128d) -__svml_cosh2_ha_l9: + .globl __jsvml_cosh2_ha_l9 +# --- __jsvml_cosh2_ha_l9(__m128d) +__jsvml_cosh2_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -532,7 +532,7 @@ __svml_cosh2_ha_l9: .byte 30 #609.546 .byte 250 #609.546 .cfi_startproc -..___tag_value___svml_cosh2_ha_l9.65: +..___tag_value___jsvml_cosh2_ha_l9.65: ..L66: #535.1 pushq %rbp #535.1 @@ -543,16 +543,16 @@ __svml_cosh2_ha_l9: andq $-64, %rsp #535.1 subq $192, %rsp #535.1 vmovapd %xmm0, %xmm4 #535.1 - vmovupd 4672+__svml_dcosh_ha_data_internal(%rip), %xmm5 #565.48 - lea 912+__svml_dcosh_ha_data_internal(%rip), %rsi #578.570 - vmovupd 4160+__svml_dcosh_ha_data_internal(%rip), %xmm2 #559.51 + vmovupd 4672+__jsvml_dcosh_ha_data_internal(%rip), %xmm5 #565.48 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %rsi #578.570 + vmovupd 4160+__jsvml_dcosh_ha_data_internal(%rip), %xmm2 #559.51 vandnpd %xmm4, %xmm5, %xmm0 #569.16 - vmovupd 3968+__svml_dcosh_ha_data_internal(%rip), %xmm1 #570.13 + vmovupd 3968+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #570.13 vfmadd213pd %xmm2, %xmm0, %xmm1 #570.13 - vmovupd 4032+__svml_dcosh_ha_data_internal(%rip), %xmm3 #567.50 + vmovupd 4032+__jsvml_dcosh_ha_data_internal(%rip), %xmm3 #567.50 vpshufd $221, %xmm0, %xmm6 #572.18 - vmovq 4224+__svml_dcosh_ha_data_internal(%rip), %xmm10 #560.23 - vmovq 4736+__svml_dcosh_ha_data_internal(%rip), %xmm7 #566.25 + vmovq 4224+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #560.23 + vmovq 4736+__jsvml_dcosh_ha_data_internal(%rip), %xmm7 #566.25 vsubpd %xmm2, %xmm1, %xmm2 #581.13 vfnmadd231pd %xmm3, %xmm2, %xmm0 #582.13 vpcmpgtd %xmm7, %xmm6, %xmm8 #573.23 @@ -561,18 +561,18 @@ __svml_cosh2_ha_l9: vpand %xmm10, %xmm9, %xmm12 #577.19 vpslld $1, %xmm12, %xmm11 #578.238 vpaddd %xmm12, %xmm11, %xmm13 #578.365 - vfnmadd231pd 4096+__svml_dcosh_ha_data_internal(%rip), %xmm2, %xmm0 #583.13 + vfnmadd231pd 4096+__jsvml_dcosh_ha_data_internal(%rip), %xmm2, %xmm0 #583.13 vpslld $3, %xmm13, %xmm14 #578.365 - vmovupd 4544+__svml_dcosh_ha_data_internal(%rip), %xmm10 #599.13 - vmovupd 4480+__svml_dcosh_ha_data_internal(%rip), %xmm12 #600.15 + vmovupd 4544+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #599.13 + vmovupd 4480+__jsvml_dcosh_ha_data_internal(%rip), %xmm12 #600.15 vmovd %xmm14, %eax #578.435 - vpand 4608+__svml_dcosh_ha_data_internal(%rip), %xmm1, %xmm3 #586.15 + vpand 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm1, %xmm3 #586.15 vmulpd %xmm0, %xmm0, %xmm11 #598.14 vmovmskps %xmm8, %edx #574.44 vmovq -8(%rax,%rsi), %xmm5 #579.799 vmovq -16(%rax,%rsi), %xmm15 #578.799 - vfmadd213pd 4416+__svml_dcosh_ha_data_internal(%rip), %xmm11, %xmm10 #599.13 - vfmadd213pd 4352+__svml_dcosh_ha_data_internal(%rip), %xmm11, %xmm12 #600.15 + vfmadd213pd 4416+__jsvml_dcosh_ha_data_internal(%rip), %xmm11, %xmm10 #599.13 + vfmadd213pd 4352+__jsvml_dcosh_ha_data_internal(%rip), %xmm11, %xmm12 #600.15 vmovq (%rax,%rsi), %xmm6 #580.796 vpextrd $1, %xmm14, %ecx #578.499 vmovhpd -8(%rcx,%rsi), %xmm5, %xmm8 #579.767 @@ -645,29 +645,29 @@ __svml_cosh2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #609.546 lea 128(%rsp,%r12,8), %rsi #609.546 -..___tag_value___svml_cosh2_ha_l9.83: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #609.546 -..___tag_value___svml_cosh2_ha_l9.84: +..___tag_value___jsvml_cosh2_ha_l9.83: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #609.546 +..___tag_value___jsvml_cosh2_ha_l9.84: jmp ..B4.8 # Prob 100% #609.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cosh2_ha_l9,@function - .size __svml_cosh2_ha_l9,.-__svml_cosh2_ha_l9 -..LN__svml_cosh2_ha_l9.3: + .type __jsvml_cosh2_ha_l9,@function + .size __jsvml_cosh2_ha_l9,.-__jsvml_cosh2_ha_l9 +..LN__jsvml_cosh2_ha_l9.3: .data -# -- End __svml_cosh2_ha_l9 +# -- End __jsvml_cosh2_ha_l9 .text -.L_2__routine_start___svml_cosh1_ha_l9_4: -# -- Begin __svml_cosh1_ha_l9 +.L_2__routine_start___jsvml_cosh1_ha_l9_4: +# -- Begin __jsvml_cosh1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh1_ha_l9 -# --- __svml_cosh1_ha_l9(__m128d) -__svml_cosh1_ha_l9: + .globl __jsvml_cosh1_ha_l9 +# --- __jsvml_cosh1_ha_l9(__m128d) +__jsvml_cosh1_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -676,7 +676,7 @@ __svml_cosh1_ha_l9: .byte 30 #691.546 .byte 250 #691.546 .cfi_startproc -..___tag_value___svml_cosh1_ha_l9.86: +..___tag_value___jsvml_cosh1_ha_l9.86: ..L87: #617.1 pushq %rbp #617.1 @@ -687,15 +687,15 @@ __svml_cosh1_ha_l9: andq $-64, %rsp #617.1 subq $128, %rsp #617.1 vmovapd %xmm0, %xmm4 #617.1 - vmovsd 4672+__svml_dcosh_ha_data_internal(%rip), %xmm5 #647.17 + vmovsd 4672+__jsvml_dcosh_ha_data_internal(%rip), %xmm5 #647.17 movl $127, %edx #659.19 vandnpd %xmm4, %xmm5, %xmm2 #651.16 movl $1082531225, %eax #655.23 - vmovsd 4160+__svml_dcosh_ha_data_internal(%rip), %xmm1 #641.20 + vmovsd 4160+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #641.20 vmovapd %xmm2, %xmm3 #652.13 - vfmadd132sd 3968+__svml_dcosh_ha_data_internal(%rip), %xmm1, %xmm3 #652.13 - lea 912+__svml_dcosh_ha_data_internal(%rip), %rsi #660.610 - vmovsd 4096+__svml_dcosh_ha_data_internal(%rip), %xmm0 #665.13 + vfmadd132sd 3968+__jsvml_dcosh_ha_data_internal(%rip), %xmm1, %xmm3 #652.13 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %rsi #660.610 + vmovsd 4096+__jsvml_dcosh_ha_data_internal(%rip), %xmm0 #665.13 vmovd %edx, %xmm10 #659.19 vpshufd $85, %xmm2, %xmm6 #654.18 vmovd %eax, %xmm7 #655.23 @@ -703,7 +703,7 @@ __svml_cosh1_ha_l9: vmovmskps %xmm8, %eax #656.44 vpshufd $0, %xmm3, %xmm9 #658.19 vsubsd %xmm1, %xmm3, %xmm15 #663.13 - vmovsd 4032+__svml_dcosh_ha_data_internal(%rip), %xmm1 #664.13 + vmovsd 4032+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #664.13 vpand %xmm10, %xmm9, %xmm12 #659.19 vfnmadd213sd %xmm2, %xmm15, %xmm1 #664.13 vpslld $1, %xmm12, %xmm11 #660.238 @@ -711,10 +711,10 @@ __svml_cosh1_ha_l9: vpsllq $45, %xmm3, %xmm3 #666.15 vpslld $3, %xmm13, %xmm14 #660.365 vmovd %xmm14, %ecx #660.435 - vmovsd 4544+__svml_dcosh_ha_data_internal(%rip), %xmm9 #681.13 - vmovsd 4480+__svml_dcosh_ha_data_internal(%rip), %xmm10 #682.15 + vmovsd 4544+__jsvml_dcosh_ha_data_internal(%rip), %xmm9 #681.13 + vmovsd 4480+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #682.15 vfnmadd213sd %xmm1, %xmm15, %xmm0 #665.13 - vmovq 4608+__svml_dcosh_ha_data_internal(%rip), %xmm2 #667.21 + vmovq 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm2 #667.21 vmovq -16(%rcx,%rsi), %xmm5 #660.610 vpand %xmm2, %xmm3, %xmm8 #668.15 vmovq (%rsi,%rcx), %xmm7 #662.607 @@ -723,8 +723,8 @@ __svml_cosh1_ha_l9: vmulsd %xmm0, %xmm0, %xmm11 #680.14 vaddsd %xmm15, %xmm1, %xmm12 #679.16 vsubsd %xmm15, %xmm1, %xmm14 #678.16 - vfmadd213sd 4416+__svml_dcosh_ha_data_internal(%rip), %xmm11, %xmm9 #681.13 - vfmadd213sd 4352+__svml_dcosh_ha_data_internal(%rip), %xmm11, %xmm10 #682.15 + vfmadd213sd 4416+__jsvml_dcosh_ha_data_internal(%rip), %xmm11, %xmm9 #681.13 + vfmadd213sd 4352+__jsvml_dcosh_ha_data_internal(%rip), %xmm11, %xmm10 #682.15 vmovq -8(%rsi,%rcx), %xmm6 #661.610 vpaddq %xmm8, %xmm6, %xmm13 #673.15 vmulsd %xmm11, %xmm9, %xmm9 #683.13 @@ -772,29 +772,29 @@ __svml_cosh1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #691.546 lea 64(%rsp), %rsi #691.546 -..___tag_value___svml_cosh1_ha_l9.99: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #691.546 -..___tag_value___svml_cosh1_ha_l9.100: +..___tag_value___jsvml_cosh1_ha_l9.99: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #691.546 +..___tag_value___jsvml_cosh1_ha_l9.100: jmp ..B5.4 # Prob 100% #691.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_cosh1_ha_l9,@function - .size __svml_cosh1_ha_l9,.-__svml_cosh1_ha_l9 -..LN__svml_cosh1_ha_l9.4: + .type __jsvml_cosh1_ha_l9,@function + .size __jsvml_cosh1_ha_l9,.-__jsvml_cosh1_ha_l9 +..LN__jsvml_cosh1_ha_l9.4: .data -# -- End __svml_cosh1_ha_l9 +# -- End __jsvml_cosh1_ha_l9 .text -.L_2__routine_start___svml_cosh4_ha_e9_5: -# -- Begin __svml_cosh4_ha_e9 +.L_2__routine_start___jsvml_cosh4_ha_e9_5: +# -- Begin __jsvml_cosh4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh4_ha_e9 -# --- __svml_cosh4_ha_e9(__m256d) -__svml_cosh4_ha_e9: + .globl __jsvml_cosh4_ha_e9 +# --- __jsvml_cosh4_ha_e9(__m256d) +__jsvml_cosh4_ha_e9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -803,7 +803,7 @@ __svml_cosh4_ha_e9: .byte 30 #1028.552 .byte 250 #1028.552 .cfi_startproc -..___tag_value___svml_cosh4_ha_e9.102: +..___tag_value___jsvml_cosh4_ha_e9.102: ..L103: #954.1 pushq %rbp #954.1 @@ -813,17 +813,17 @@ __svml_cosh4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #954.1 subq $192, %rsp #954.1 - lea 912+__svml_dcosh_ha_data_internal(%rip), %r8 #997.750 - vmovupd 4672+__svml_dcosh_ha_data_internal(%rip), %ymm3 #984.51 - vmovupd 4160+__svml_dcosh_ha_data_internal(%rip), %ymm4 #978.54 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %r8 #997.750 + vmovupd 4672+__jsvml_dcosh_ha_data_internal(%rip), %ymm3 #984.51 + vmovupd 4160+__jsvml_dcosh_ha_data_internal(%rip), %ymm4 #978.54 vmovapd %ymm0, %ymm2 #954.1 vandnpd %ymm2, %ymm3, %ymm6 #988.16 - vmulpd 3968+__svml_dcosh_ha_data_internal(%rip), %ymm6, %ymm9 #989.28 + vmulpd 3968+__jsvml_dcosh_ha_data_internal(%rip), %ymm6, %ymm9 #989.28 vaddpd %ymm9, %ymm4, %ymm14 #989.13 vextractf128 $1, %ymm14, %xmm15 #994.104 vshufps $136, %xmm15, %xmm14, %xmm8 #995.41 vpsllq $45, %xmm15, %xmm15 #1003.74 - vpand 4224+__svml_dcosh_ha_data_internal(%rip), %xmm8, %xmm12 #996.23 + vpand 4224+__jsvml_dcosh_ha_data_internal(%rip), %xmm8, %xmm12 #996.23 vpslld $1, %xmm12, %xmm10 #997.242 vpaddd %xmm12, %xmm10, %xmm11 #997.389 vpslld $3, %xmm11, %xmm3 #997.389 @@ -835,22 +835,22 @@ __svml_cosh4_ha_e9: vpsllq $45, %xmm14, %xmm14 #1003.19 vmovq -16(%rsi,%r8), %xmm9 #997.1447 vmovhpd -16(%rdi,%r8), %xmm9, %xmm11 #997.1415 - vmulpd 4032+__svml_dcosh_ha_data_internal(%rip), %ymm3, %ymm4 #1001.38 + vmulpd 4032+__jsvml_dcosh_ha_data_internal(%rip), %ymm3, %ymm4 #1001.38 vmovq (%rsi,%r8), %xmm8 #999.1444 vmovq -16(%rdx,%r8), %xmm13 #997.1247 vmovhpd -16(%rcx,%r8), %xmm13, %xmm13 #997.1215 vextractf128 $1, %ymm6, %xmm5 #990.107 vshufps $221, %xmm5, %xmm6, %xmm1 #991.40 vsubpd %ymm4, %ymm6, %ymm6 #1001.13 - vpcmpgtd 4736+__svml_dcosh_ha_data_internal(%rip), %xmm1, %xmm7 #992.27 + vpcmpgtd 4736+__jsvml_dcosh_ha_data_internal(%rip), %xmm1, %xmm7 #992.27 vmovq -8(%rsi,%r8), %xmm1 #998.1447 - vmulpd 4096+__svml_dcosh_ha_data_internal(%rip), %ymm3, %ymm4 #1002.35 + vmulpd 4096+__jsvml_dcosh_ha_data_internal(%rip), %ymm3, %ymm4 #1002.35 vmovq -8(%rdx,%r8), %xmm5 #998.1247 vmovhpd -8(%rdi,%r8), %xmm1, %xmm10 #998.1415 vmovhpd (%rdi,%r8), %xmm8, %xmm1 #999.1412 vmovhpd -8(%rcx,%r8), %xmm5, %xmm12 #998.1215 vsubpd %ymm4, %ymm6, %ymm9 #1002.13 - vmovupd 4608+__svml_dcosh_ha_data_internal(%rip), %xmm6 #1004.25 + vmovupd 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm6 #1004.25 vpand %xmm6, %xmm14, %xmm8 #1005.19 vpaddq %xmm8, %xmm12, %xmm5 #1010.19 vpaddq %xmm8, %xmm13, %xmm4 #1007.19 @@ -863,10 +863,10 @@ __svml_cosh4_ha_e9: vpaddq %xmm7, %xmm10, %xmm10 #1010.76 vpsubq %xmm7, %xmm1, %xmm1 #1013.76 vpsubq %xmm8, %xmm0, %xmm0 #1013.19 - vmulpd 4544+__svml_dcosh_ha_data_internal(%rip), %ymm12, %ymm7 #1018.28 - vmulpd 4480+__svml_dcosh_ha_data_internal(%rip), %ymm12, %ymm8 #1019.30 - vaddpd 4416+__svml_dcosh_ha_data_internal(%rip), %ymm7, %ymm11 #1018.13 - vaddpd 4352+__svml_dcosh_ha_data_internal(%rip), %ymm8, %ymm13 #1019.15 + vmulpd 4544+__jsvml_dcosh_ha_data_internal(%rip), %ymm12, %ymm7 #1018.28 + vmulpd 4480+__jsvml_dcosh_ha_data_internal(%rip), %ymm12, %ymm8 #1019.30 + vaddpd 4416+__jsvml_dcosh_ha_data_internal(%rip), %ymm7, %ymm11 #1018.13 + vaddpd 4352+__jsvml_dcosh_ha_data_internal(%rip), %ymm8, %ymm13 #1019.15 vmulpd %ymm13, %ymm12, %ymm15 #1021.15 vinsertf128 $1, %xmm3, %ymm4, %ymm6 #1008.17 vinsertf128 $1, %xmm1, %ymm0, %ymm4 #1014.14 @@ -941,29 +941,29 @@ __svml_cosh4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1028.552 lea 128(%rsp,%r12,8), %rsi #1028.552 -..___tag_value___svml_cosh4_ha_e9.120: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #1028.552 -..___tag_value___svml_cosh4_ha_e9.121: +..___tag_value___jsvml_cosh4_ha_e9.120: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #1028.552 +..___tag_value___jsvml_cosh4_ha_e9.121: jmp ..B6.8 # Prob 100% #1028.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cosh4_ha_e9,@function - .size __svml_cosh4_ha_e9,.-__svml_cosh4_ha_e9 -..LN__svml_cosh4_ha_e9.5: + .type __jsvml_cosh4_ha_e9,@function + .size __jsvml_cosh4_ha_e9,.-__jsvml_cosh4_ha_e9 +..LN__jsvml_cosh4_ha_e9.5: .data -# -- End __svml_cosh4_ha_e9 +# -- End __jsvml_cosh4_ha_e9 .text -.L_2__routine_start___svml_cosh1_ha_ex_6: -# -- Begin __svml_cosh1_ha_ex +.L_2__routine_start___jsvml_cosh1_ha_ex_6: +# -- Begin __jsvml_cosh1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cosh1_ha_ex -# --- __svml_cosh1_ha_ex(__m128d) -__svml_cosh1_ha_ex: + .globl __jsvml_cosh1_ha_ex +# --- __jsvml_cosh1_ha_ex(__m128d) +__jsvml_cosh1_ha_ex: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -972,7 +972,7 @@ __svml_cosh1_ha_ex: .byte 30 #1110.546 .byte 250 #1110.546 .cfi_startproc -..___tag_value___svml_cosh1_ha_ex.123: +..___tag_value___jsvml_cosh1_ha_ex.123: ..L124: #1036.1 pushq %rbp #1036.1 @@ -983,19 +983,19 @@ __svml_cosh1_ha_ex: andq $-64, %rsp #1036.1 subq $128, %rsp #1036.1 movl $127, %edx #1078.17 - movsd 4672+__svml_dcosh_ha_data_internal(%rip), %xmm1 #1070.16 + movsd 4672+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #1070.16 movl $1082531225, %eax #1074.21 andnps %xmm0, %xmm1 #1070.16 - lea 912+__svml_dcosh_ha_data_internal(%rip), %rsi #1079.594 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %rsi #1079.594 movaps %xmm1, %xmm12 #1071.25 - mulsd 3968+__svml_dcosh_ha_data_internal(%rip), %xmm12 #1071.25 + mulsd 3968+__jsvml_dcosh_ha_data_internal(%rip), %xmm12 #1071.25 movd %edx, %xmm4 #1078.17 - movsd 4160+__svml_dcosh_ha_data_internal(%rip), %xmm7 #1060.20 + movsd 4160+__jsvml_dcosh_ha_data_internal(%rip), %xmm7 #1060.20 movd %eax, %xmm2 #1074.21 - movsd 4032+__svml_dcosh_ha_data_internal(%rip), %xmm8 #1083.35 + movsd 4032+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #1083.35 addsd %xmm7, %xmm12 #1071.13 movaps %xmm12, %xmm9 #1082.13 - movsd 4096+__svml_dcosh_ha_data_internal(%rip), %xmm10 #1084.32 + movsd 4096+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #1084.32 subsd %xmm7, %xmm9 #1082.13 mulsd %xmm9, %xmm8 #1083.35 mulsd %xmm9, %xmm10 #1084.32 @@ -1005,7 +1005,7 @@ __svml_cosh1_ha_ex: pcmpgtd %xmm2, %xmm3 #1074.21 pand %xmm4, %xmm5 #1078.17 psllq $45, %xmm12 #1085.13 - movsd 4544+__svml_dcosh_ha_data_internal(%rip), %xmm4 #1100.25 + movsd 4544+__jsvml_dcosh_ha_data_internal(%rip), %xmm4 #1100.25 movdqa %xmm5, %xmm6 #1079.236 pslld $1, %xmm6 #1079.236 subsd %xmm10, %xmm1 #1084.13 @@ -1015,15 +1015,15 @@ __svml_cosh1_ha_ex: mulsd %xmm1, %xmm13 #1099.14 pslld $3, %xmm6 #1079.353 movd %xmm6, %ecx #1079.421 - movsd 4480+__svml_dcosh_ha_data_internal(%rip), %xmm8 #1101.27 + movsd 4480+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #1101.27 mulsd %xmm13, %xmm4 #1100.25 mulsd %xmm13, %xmm8 #1101.27 - addsd 4416+__svml_dcosh_ha_data_internal(%rip), %xmm4 #1100.13 - addsd 4352+__svml_dcosh_ha_data_internal(%rip), %xmm8 #1101.15 + addsd 4416+__jsvml_dcosh_ha_data_internal(%rip), %xmm4 #1100.13 + addsd 4352+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #1101.15 mulsd %xmm13, %xmm4 #1102.13 mulsd %xmm13, %xmm8 #1103.15 mulsd %xmm1, %xmm4 #1105.25 - movq 4608+__svml_dcosh_ha_data_internal(%rip), %xmm11 #1086.19 + movq 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm11 #1086.19 addsd %xmm1, %xmm4 #1105.13 movq -16(%rcx,%rsi), %xmm3 #1079.594 pand %xmm11, %xmm12 #1087.13 @@ -1071,29 +1071,29 @@ __svml_cosh1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1110.546 lea 64(%rsp), %rsi #1110.546 -..___tag_value___svml_cosh1_ha_ex.132: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #1110.546 -..___tag_value___svml_cosh1_ha_ex.133: +..___tag_value___jsvml_cosh1_ha_ex.132: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #1110.546 +..___tag_value___jsvml_cosh1_ha_ex.133: jmp ..B7.4 # Prob 100% #1110.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_cosh1_ha_ex,@function - .size __svml_cosh1_ha_ex,.-__svml_cosh1_ha_ex -..LN__svml_cosh1_ha_ex.6: + .type __jsvml_cosh1_ha_ex,@function + .size __jsvml_cosh1_ha_ex,.-__jsvml_cosh1_ha_ex +..LN__jsvml_cosh1_ha_ex.6: .data -# -- End __svml_cosh1_ha_ex +# -- End __jsvml_cosh1_ha_ex .text -.L_2__routine_start___svml_cosh2_ha_ex_7: -# -- Begin __svml_cosh2_ha_ex +.L_2__routine_start___jsvml_cosh2_ha_ex_7: +# -- Begin __jsvml_cosh2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cosh2_ha_ex -# --- __svml_cosh2_ha_ex(__m128d) -__svml_cosh2_ha_ex: + .globl __jsvml_cosh2_ha_ex +# --- __jsvml_cosh2_ha_ex(__m128d) +__jsvml_cosh2_ha_ex: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1102,7 +1102,7 @@ __svml_cosh2_ha_ex: .byte 30 #1192.546 .byte 250 #1192.546 .cfi_startproc -..___tag_value___svml_cosh2_ha_ex.135: +..___tag_value___jsvml_cosh2_ha_ex.135: ..L136: #1118.1 pushq %rbp #1118.1 @@ -1113,35 +1113,35 @@ __svml_cosh2_ha_ex: andq $-64, %rsp #1118.1 subq $192, %rsp #1118.1 movaps %xmm0, %xmm2 #1118.1 - movups 4672+__svml_dcosh_ha_data_internal(%rip), %xmm1 #1152.16 - lea 912+__svml_dcosh_ha_data_internal(%rip), %rsi #1161.591 - movups 3968+__svml_dcosh_ha_data_internal(%rip), %xmm13 #1153.25 + movups 4672+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #1152.16 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %rsi #1161.591 + movups 3968+__jsvml_dcosh_ha_data_internal(%rip), %xmm13 #1153.25 andnps %xmm2, %xmm1 #1152.16 mulpd %xmm1, %xmm13 #1153.25 - movups 4160+__svml_dcosh_ha_data_internal(%rip), %xmm9 #1142.51 + movups 4160+__jsvml_dcosh_ha_data_internal(%rip), %xmm9 #1142.51 addpd %xmm9, %xmm13 #1153.13 movaps %xmm13, %xmm11 #1164.13 subpd %xmm9, %xmm11 #1164.13 - movups 4032+__svml_dcosh_ha_data_internal(%rip), %xmm10 #1165.35 + movups 4032+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #1165.35 mulpd %xmm11, %xmm10 #1165.35 - movups 4096+__svml_dcosh_ha_data_internal(%rip), %xmm12 #1166.32 + movups 4096+__jsvml_dcosh_ha_data_internal(%rip), %xmm12 #1166.32 mulpd %xmm11, %xmm12 #1166.32 pshufd $221, %xmm1, %xmm4 #1155.16 subpd %xmm10, %xmm1 #1165.13 subpd %xmm12, %xmm1 #1166.13 movaps %xmm1, %xmm15 #1181.14 mulpd %xmm1, %xmm15 #1181.14 - movups 4544+__svml_dcosh_ha_data_internal(%rip), %xmm10 #1182.25 + movups 4544+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #1182.25 mulpd %xmm15, %xmm10 #1182.25 - movups 4480+__svml_dcosh_ha_data_internal(%rip), %xmm14 #1183.27 - addpd 4416+__svml_dcosh_ha_data_internal(%rip), %xmm10 #1182.13 + movups 4480+__jsvml_dcosh_ha_data_internal(%rip), %xmm14 #1183.27 + addpd 4416+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #1182.13 mulpd %xmm15, %xmm14 #1183.27 mulpd %xmm15, %xmm10 #1184.13 - addpd 4352+__svml_dcosh_ha_data_internal(%rip), %xmm14 #1183.15 + addpd 4352+__jsvml_dcosh_ha_data_internal(%rip), %xmm14 #1183.15 mulpd %xmm1, %xmm10 #1187.25 mulpd %xmm14, %xmm15 #1185.15 addpd %xmm10, %xmm1 #1187.13 - movq 4224+__svml_dcosh_ha_data_internal(%rip), %xmm5 #1143.21 + movq 4224+__jsvml_dcosh_ha_data_internal(%rip), %xmm5 #1143.21 pshufd $136, %xmm13, %xmm6 #1159.17 psllq $45, %xmm13 #1167.13 pand %xmm5, %xmm6 #1160.17 @@ -1151,11 +1151,11 @@ __svml_cosh2_ha_ex: pslld $3, %xmm7 #1161.353 movd %xmm7, %eax #1161.421 pshufd $1, %xmm7, %xmm8 #1161.502 - movq 4736+__svml_dcosh_ha_data_internal(%rip), %xmm3 #1149.23 + movq 4736+__jsvml_dcosh_ha_data_internal(%rip), %xmm3 #1149.23 movd %xmm8, %ecx #1161.483 pcmpgtd %xmm3, %xmm4 #1156.21 movq -16(%rax,%rsi), %xmm0 #1161.820 - pand 4608+__svml_dcosh_ha_data_internal(%rip), %xmm13 #1169.13 + pand 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm13 #1169.13 movmskps %xmm4, %edx #1157.44 movhpd -16(%rcx,%rsi), %xmm0 #1161.788 movq (%rax,%rsi), %xmm4 #1163.817 @@ -1230,29 +1230,29 @@ __svml_cosh2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1192.546 lea 128(%rsp,%r12,8), %rsi #1192.546 -..___tag_value___svml_cosh2_ha_ex.153: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #1192.546 -..___tag_value___svml_cosh2_ha_ex.154: +..___tag_value___jsvml_cosh2_ha_ex.153: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #1192.546 +..___tag_value___jsvml_cosh2_ha_ex.154: jmp ..B8.8 # Prob 100% #1192.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cosh2_ha_ex,@function - .size __svml_cosh2_ha_ex,.-__svml_cosh2_ha_ex -..LN__svml_cosh2_ha_ex.7: + .type __jsvml_cosh2_ha_ex,@function + .size __jsvml_cosh2_ha_ex,.-__jsvml_cosh2_ha_ex +..LN__jsvml_cosh2_ha_ex.7: .data -# -- End __svml_cosh2_ha_ex +# -- End __jsvml_cosh2_ha_ex .text -.L_2__routine_start___svml_cosh2_ha_e9_8: -# -- Begin __svml_cosh2_ha_e9 +.L_2__routine_start___jsvml_cosh2_ha_e9_8: +# -- Begin __jsvml_cosh2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosh2_ha_e9 -# --- __svml_cosh2_ha_e9(__m128d) -__svml_cosh2_ha_e9: + .globl __jsvml_cosh2_ha_e9 +# --- __jsvml_cosh2_ha_e9(__m128d) +__jsvml_cosh2_ha_e9: # parameter 1: %xmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1261,7 +1261,7 @@ __svml_cosh2_ha_e9: .byte 30 #1274.546 .byte 250 #1274.546 .cfi_startproc -..___tag_value___svml_cosh2_ha_e9.156: +..___tag_value___jsvml_cosh2_ha_e9.156: ..L157: #1200.1 pushq %rbp #1200.1 @@ -1271,35 +1271,35 @@ __svml_cosh2_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1200.1 subq $192, %rsp #1200.1 - lea 912+__svml_dcosh_ha_data_internal(%rip), %rsi #1243.606 - movups 4672+__svml_dcosh_ha_data_internal(%rip), %xmm1 #1234.16 - movups 3968+__svml_dcosh_ha_data_internal(%rip), %xmm11 #1235.25 + lea 912+__jsvml_dcosh_ha_data_internal(%rip), %rsi #1243.606 + movups 4672+__jsvml_dcosh_ha_data_internal(%rip), %xmm1 #1234.16 + movups 3968+__jsvml_dcosh_ha_data_internal(%rip), %xmm11 #1235.25 andnps %xmm0, %xmm1 #1234.16 mulpd %xmm1, %xmm11 #1235.25 - movups 4160+__svml_dcosh_ha_data_internal(%rip), %xmm7 #1224.51 + movups 4160+__jsvml_dcosh_ha_data_internal(%rip), %xmm7 #1224.51 addpd %xmm7, %xmm11 #1235.13 movaps %xmm11, %xmm9 #1246.13 subpd %xmm7, %xmm9 #1246.13 - movups 4032+__svml_dcosh_ha_data_internal(%rip), %xmm8 #1247.35 + movups 4032+__jsvml_dcosh_ha_data_internal(%rip), %xmm8 #1247.35 mulpd %xmm9, %xmm8 #1247.35 - movups 4096+__svml_dcosh_ha_data_internal(%rip), %xmm10 #1248.32 + movups 4096+__jsvml_dcosh_ha_data_internal(%rip), %xmm10 #1248.32 mulpd %xmm9, %xmm10 #1248.32 pshufd $221, %xmm1, %xmm3 #1237.22 subpd %xmm8, %xmm1 #1247.13 subpd %xmm10, %xmm1 #1248.13 movaps %xmm1, %xmm13 #1263.14 mulpd %xmm1, %xmm13 #1263.14 - movups 4544+__svml_dcosh_ha_data_internal(%rip), %xmm15 #1264.25 + movups 4544+__jsvml_dcosh_ha_data_internal(%rip), %xmm15 #1264.25 mulpd %xmm13, %xmm15 #1264.25 - movups 4480+__svml_dcosh_ha_data_internal(%rip), %xmm12 #1265.27 - addpd 4416+__svml_dcosh_ha_data_internal(%rip), %xmm15 #1264.13 + movups 4480+__jsvml_dcosh_ha_data_internal(%rip), %xmm12 #1265.27 + addpd 4416+__jsvml_dcosh_ha_data_internal(%rip), %xmm15 #1264.13 mulpd %xmm13, %xmm12 #1265.27 mulpd %xmm13, %xmm15 #1266.13 - addpd 4352+__svml_dcosh_ha_data_internal(%rip), %xmm12 #1265.15 + addpd 4352+__jsvml_dcosh_ha_data_internal(%rip), %xmm12 #1265.15 mulpd %xmm1, %xmm15 #1269.25 mulpd %xmm12, %xmm13 #1267.15 addpd %xmm15, %xmm1 #1269.13 - movq 4224+__svml_dcosh_ha_data_internal(%rip), %xmm4 #1225.27 + movq 4224+__jsvml_dcosh_ha_data_internal(%rip), %xmm4 #1225.27 pshufd $136, %xmm11, %xmm5 #1241.23 psllq $45, %xmm11 #1249.19 pand %xmm4, %xmm5 #1242.23 @@ -1308,14 +1308,14 @@ __svml_cosh2_ha_e9: paddd %xmm5, %xmm6 #1243.389 pslld $3, %xmm6 #1243.389 movd %xmm6, %eax #1243.463 - movq 4736+__svml_dcosh_ha_data_internal(%rip), %xmm2 #1231.29 + movq 4736+__jsvml_dcosh_ha_data_internal(%rip), %xmm2 #1231.29 pcmpgtd %xmm2, %xmm3 #1238.27 pextrd $1, %xmm6, %ecx #1243.531 movq -16(%rax,%rsi), %xmm4 #1243.835 movmskps %xmm3, %edx #1239.44 movq (%rax,%rsi), %xmm3 #1245.832 movhpd -16(%rcx,%rsi), %xmm4 #1243.803 - pand 4608+__svml_dcosh_ha_data_internal(%rip), %xmm11 #1251.19 + pand 4608+__jsvml_dcosh_ha_data_internal(%rip), %xmm11 #1251.19 movhpd (%rcx,%rsi), %xmm3 #1245.800 paddq %xmm11, %xmm4 #1253.19 psubq %xmm11, %xmm3 #1259.19 @@ -1388,30 +1388,30 @@ __svml_cosh2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1274.546 lea 128(%rsp,%r12,8), %rsi #1274.546 -..___tag_value___svml_cosh2_ha_e9.174: -# __svml_dcosh_ha_cout_rare_internal(const double *, double *) - call __svml_dcosh_ha_cout_rare_internal #1274.546 -..___tag_value___svml_cosh2_ha_e9.175: +..___tag_value___jsvml_cosh2_ha_e9.174: +# __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dcosh_ha_cout_rare_internal #1274.546 +..___tag_value___jsvml_cosh2_ha_e9.175: jmp ..B9.8 # Prob 100% #1274.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cosh2_ha_e9,@function - .size __svml_cosh2_ha_e9,.-__svml_cosh2_ha_e9 -..LN__svml_cosh2_ha_e9.8: + .type __jsvml_cosh2_ha_e9,@function + .size __jsvml_cosh2_ha_e9,.-__jsvml_cosh2_ha_e9 +..LN__jsvml_cosh2_ha_e9.8: .data -# -- End __svml_cosh2_ha_e9 +# -- End __jsvml_cosh2_ha_e9 .text -.L_2__routine_start___svml_dcosh_ha_cout_rare_internal_9: -# -- Begin __svml_dcosh_ha_cout_rare_internal +.L_2__routine_start___jsvml_dcosh_ha_cout_rare_internal_9: +# -- Begin __jsvml_dcosh_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dcosh_ha_cout_rare_internal - .globl __svml_dcosh_ha_cout_rare_internal -# --- __svml_dcosh_ha_cout_rare_internal(const double *, double *) -__svml_dcosh_ha_cout_rare_internal: + .hidden __jsvml_dcosh_ha_cout_rare_internal + .globl __jsvml_dcosh_ha_cout_rare_internal +# --- __jsvml_dcosh_ha_cout_rare_internal(const double *, double *) +__jsvml_dcosh_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1421,7 +1421,7 @@ __svml_dcosh_ha_cout_rare_internal: .byte 30 #947.11 .byte 250 #947.11 .cfi_startproc -..___tag_value___svml_dcosh_ha_cout_rare_internal.177: +..___tag_value___jsvml_dcosh_ha_cout_rare_internal.177: ..L178: #844.1 movq %rsi, %r8 #844.1 @@ -1648,17 +1648,17 @@ __svml_dcosh_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dcosh_ha_cout_rare_internal,@function - .size __svml_dcosh_ha_cout_rare_internal,.-__svml_dcosh_ha_cout_rare_internal -..LN__svml_dcosh_ha_cout_rare_internal.9: + .type __jsvml_dcosh_ha_cout_rare_internal,@function + .size __jsvml_dcosh_ha_cout_rare_internal,.-__jsvml_dcosh_ha_cout_rare_internal +..LN__jsvml_dcosh_ha_cout_rare_internal.9: .data -# -- End __svml_dcosh_ha_cout_rare_internal +# -- End __jsvml_dcosh_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dcosh_ha_data_internal - .globl __svml_dcosh_ha_data_internal -__svml_dcosh_ha_data_internal: + .hidden __jsvml_dcosh_ha_data_internal + .globl __jsvml_dcosh_ha_data_internal +__jsvml_dcosh_ha_data_internal: .long 0 .long 1071644672 .long 1828292879 @@ -2859,8 +2859,8 @@ __svml_dcosh_ha_data_internal: .long 1082531225 .long 1082531225 .long 1082531225 - .type __svml_dcosh_ha_data_internal,@object - .size __svml_dcosh_ha_data_internal,4800 + .type __jsvml_dcosh_ha_data_internal,@object + .size __jsvml_dcosh_ha_data_internal,4800 .align 32 _vmldCoshHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_exp_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_exp_linux_x86.S similarity index 86% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_exp_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_exp_linux_x86.S index a71b8cca42d..f341f6a7d83 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_exp_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_exp_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_exp.c" .text ..TXTST0: -.L_2__routine_start___svml_exp1_ha_e9_0: -# -- Begin __svml_exp1_ha_e9 +.L_2__routine_start___jsvml_exp1_ha_e9_0: +# -- Begin __jsvml_exp1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_exp1_ha_e9 -# --- __svml_exp1_ha_e9(__m128d) -__svml_exp1_ha_e9: + .globl __jsvml_exp1_ha_e9 +# --- __jsvml_exp1_ha_e9(__m128d) +__jsvml_exp1_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_exp1_ha_e9: .byte 30 #349.546 .byte 250 #349.546 .cfi_startproc -..___tag_value___svml_exp1_ha_e9.1: +..___tag_value___jsvml_exp1_ha_e9.1: ..L2: #266.1 pushq %rbp #266.1 @@ -60,15 +60,15 @@ __svml_exp1_ha_e9: movaps %xmm0, %xmm1 #266.1 movaps %xmm1, %xmm13 #296.25 movaps %xmm1, %xmm11 #313.13 - mulsd 1024+__svml_dexp_ha_data_internal(%rip), %xmm13 #296.25 + mulsd 1024+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #296.25 movl $2147483647, %eax #302.26 - movsd 1088+__svml_dexp_ha_data_internal(%rip), %xmm2 #289.20 + movsd 1088+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #289.20 movl $1082532650, %edx #303.31 pshufd $85, %xmm1, %xmm5 #301.26 movd %eax, %xmm3 #302.26 pand %xmm3, %xmm5 #302.26 - lea __svml_dexp_ha_data_internal(%rip), %rsi #311.53 - movq 1600+__svml_dexp_ha_data_internal(%rip), %xmm14 #305.31 + lea __jsvml_dexp_ha_data_internal(%rip), %rsi #311.53 + movq 1600+__jsvml_dexp_ha_data_internal(%rip), %xmm14 #305.31 addsd %xmm2, %xmm13 #296.13 movaps %xmm13, %xmm9 #297.13 movd %edx, %xmm4 #303.31 @@ -76,7 +76,7 @@ __svml_exp1_ha_e9: movdqa %xmm14, %xmm6 #307.27 movmskps %xmm5, %eax #304.48 pand %xmm13, %xmm6 #307.27 - movsd 1536+__svml_dexp_ha_data_internal(%rip), %xmm5 #315.25 + movsd 1536+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #315.25 pandn %xmm13, %xmm14 #309.23 pshufd $0, %xmm6, %xmm7 #308.27 psllq $46, %xmm14 #312.23 @@ -84,20 +84,20 @@ __svml_exp1_ha_e9: subsd %xmm2, %xmm9 #297.13 movd %xmm7, %ecx #311.89 movaps %xmm9, %xmm8 #313.33 - mulsd 1216+__svml_dexp_ha_data_internal(%rip), %xmm8 #313.33 - mulsd 1280+__svml_dexp_ha_data_internal(%rip), %xmm9 #314.32 + mulsd 1216+__jsvml_dexp_ha_data_internal(%rip), %xmm8 #313.33 + mulsd 1280+__jsvml_dexp_ha_data_internal(%rip), %xmm9 #314.32 subsd %xmm8, %xmm11 #313.13 movslq %ecx, %rcx #311.53 subsd %xmm9, %xmm11 #314.13 mulsd %xmm11, %xmm5 #315.25 movaps %xmm11, %xmm10 #317.14 mulsd %xmm11, %xmm10 #317.14 - addsd 1472+__svml_dexp_ha_data_internal(%rip), %xmm5 #315.13 + addsd 1472+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #315.13 mulsd %xmm11, %xmm5 #316.25 movups (%rsi,%rcx), %xmm12 #311.53 - addsd 1408+__svml_dexp_ha_data_internal(%rip), %xmm5 #316.13 + addsd 1408+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #316.13 mulsd %xmm11, %xmm5 #318.25 - addsd 1344+__svml_dexp_ha_data_internal(%rip), %xmm5 #318.13 + addsd 1344+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #318.13 mulsd %xmm10, %xmm5 #319.25 addsd %xmm11, %xmm5 #319.13 mulsd %xmm12, %xmm5 #320.25 @@ -120,11 +120,11 @@ __svml_exp1_ha_e9: # LOE ..B1.3: # Preds ..B1.1 # Execution count [5.00e-02]: Infreq - movsd 1984+__svml_dexp_ha_data_internal(%rip), %xmm2 #336.33 + movsd 1984+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #336.33 movaps %xmm1, %xmm4 #339.28 movaps %xmm1, %xmm0 #337.28 cmpltsd %xmm1, %xmm2 #337.28 - cmpltsd 2048+__svml_dexp_ha_data_internal(%rip), %xmm4 #339.28 + cmpltsd 2048+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #339.28 movsd %xmm2, %xmm0 #337.28 blendvpd %xmm0, .L_2il0floatpacket.33(%rip), %xmm5 #340.22 orps %xmm4, %xmm0 #342.28 @@ -152,29 +152,29 @@ __svml_exp1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #349.546 lea 64(%rsp), %rsi #349.546 -..___tag_value___svml_exp1_ha_e9.10: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #349.546 -..___tag_value___svml_exp1_ha_e9.11: +..___tag_value___jsvml_exp1_ha_e9.10: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #349.546 +..___tag_value___jsvml_exp1_ha_e9.11: jmp ..B1.5 # Prob 100% #349.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_exp1_ha_e9,@function - .size __svml_exp1_ha_e9,.-__svml_exp1_ha_e9 -..LN__svml_exp1_ha_e9.0: + .type __jsvml_exp1_ha_e9,@function + .size __jsvml_exp1_ha_e9,.-__jsvml_exp1_ha_e9 +..LN__jsvml_exp1_ha_e9.0: .data -# -- End __svml_exp1_ha_e9 +# -- End __jsvml_exp1_ha_e9 .text -.L_2__routine_start___svml_exp8_ha_z0_1: -# -- Begin __svml_exp8_ha_z0 +.L_2__routine_start___jsvml_exp8_ha_z0_1: +# -- Begin __jsvml_exp8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_exp8_ha_z0 -# --- __svml_exp8_ha_z0(__m512d) -__svml_exp8_ha_z0: + .globl __jsvml_exp8_ha_z0 +# --- __jsvml_exp8_ha_z0(__m512d) +__jsvml_exp8_ha_z0: # parameter 1: %zmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -183,28 +183,28 @@ __svml_exp8_ha_z0: .byte 30 #429.12 .byte 250 #429.12 .cfi_startproc -..___tag_value___svml_exp8_ha_z0.13: +..___tag_value___jsvml_exp8_ha_z0.13: ..L14: #357.1 - vmovups 256+__svml_dexp_ha_data_internal_avx512(%rip), %zmm4 #396.46 - vmovups 320+__svml_dexp_ha_data_internal_avx512(%rip), %zmm1 #397.50 - vmovups 384+__svml_dexp_ha_data_internal_avx512(%rip), %zmm2 #400.46 - vmovups 448+__svml_dexp_ha_data_internal_avx512(%rip), %zmm3 #401.46 - vmovups 576+__svml_dexp_ha_data_internal_avx512(%rip), %zmm5 #409.54 - vmovups 640+__svml_dexp_ha_data_internal_avx512(%rip), %zmm11 #413.14 + vmovups 256+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm4 #396.46 + vmovups 320+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm1 #397.50 + vmovups 384+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm2 #400.46 + vmovups 448+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm3 #401.46 + vmovups 576+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm5 #409.54 + vmovups 640+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm11 #413.14 vfmadd213pd {rz-sae}, %zmm1, %zmm0, %zmm4 #398.17 - vmovups 704+__svml_dexp_ha_data_internal_avx512(%rip), %zmm6 #411.54 - vmovups 768+__svml_dexp_ha_data_internal_avx512(%rip), %zmm8 #415.14 - vmovups 832+__svml_dexp_ha_data_internal_avx512(%rip), %zmm7 #416.54 - vmovups 896+__svml_dexp_ha_data_internal_avx512(%rip), %zmm10 #418.14 - vmovups 128+__svml_dexp_ha_data_internal_avx512(%rip), %zmm12 #406.286 - vmovups __svml_dexp_ha_data_internal_avx512(%rip), %zmm13 #405.285 + vmovups 704+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm6 #411.54 + vmovups 768+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm8 #415.14 + vmovups 832+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm7 #416.54 + vmovups 896+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm10 #418.14 + vmovups 128+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm12 #406.286 + vmovups __jsvml_dexp_ha_data_internal_avx512(%rip), %zmm13 #405.285 vsubpd {rn-sae}, %zmm1, %zmm4, %zmm15 #399.14 - vpermt2pd 192+__svml_dexp_ha_data_internal_avx512(%rip), %zmm4, %zmm12 #406.286 - vpermt2pd 64+__svml_dexp_ha_data_internal_avx512(%rip), %zmm4, %zmm13 #405.285 + vpermt2pd 192+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm4, %zmm12 #406.286 + vpermt2pd 64+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm4, %zmm13 #405.285 vfnmadd231pd {rn-sae}, %zmm15, %zmm2, %zmm0 #402.12 vfnmadd231pd {rn-sae}, %zmm15, %zmm3, %zmm0 #403.12 - vandpd 512+__svml_dexp_ha_data_internal_avx512(%rip), %zmm0, %zmm14 #408.16 + vandpd 512+__jsvml_dexp_ha_data_internal_avx512(%rip), %zmm0, %zmm14 #408.16 vmulpd {rn-sae}, %zmm14, %zmm14, %zmm9 #414.15 vfmadd231pd {rn-sae}, %zmm14, %zmm5, %zmm11 #413.14 vfmadd231pd {rn-sae}, %zmm14, %zmm6, %zmm8 #415.14 @@ -219,20 +219,20 @@ __svml_exp8_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_exp8_ha_z0,@function - .size __svml_exp8_ha_z0,.-__svml_exp8_ha_z0 -..LN__svml_exp8_ha_z0.1: + .type __jsvml_exp8_ha_z0,@function + .size __jsvml_exp8_ha_z0,.-__jsvml_exp8_ha_z0 +..LN__jsvml_exp8_ha_z0.1: .data -# -- End __svml_exp8_ha_z0 +# -- End __jsvml_exp8_ha_z0 .text -.L_2__routine_start___svml_exp1_ha_l9_2: -# -- Begin __svml_exp1_ha_l9 +.L_2__routine_start___jsvml_exp1_ha_l9_2: +# -- Begin __jsvml_exp1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_exp1_ha_l9 -# --- __svml_exp1_ha_l9(__m128d) -__svml_exp1_ha_l9: + .globl __jsvml_exp1_ha_l9 +# --- __jsvml_exp1_ha_l9(__m128d) +__jsvml_exp1_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -241,7 +241,7 @@ __svml_exp1_ha_l9: .byte 30 #516.546 .byte 250 #516.546 .cfi_startproc -..___tag_value___svml_exp1_ha_l9.16: +..___tag_value___jsvml_exp1_ha_l9.16: ..L17: #434.1 pushq %rbp #434.1 @@ -252,29 +252,29 @@ __svml_exp1_ha_l9: andq $-64, %rsp #434.1 subq $128, %rsp #434.1 vmovapd %xmm0, %xmm1 #434.1 - vmovsd 1088+__svml_dexp_ha_data_internal(%rip), %xmm3 #457.20 + vmovsd 1088+__jsvml_dexp_ha_data_internal(%rip), %xmm3 #457.20 vmovapd %xmm1, %xmm2 #464.13 - vfmadd132sd 1024+__svml_dexp_ha_data_internal(%rip), %xmm3, %xmm2 #464.13 - lea __svml_dexp_ha_data_internal(%rip), %rdx #477.53 - vmovsd 1536+__svml_dexp_ha_data_internal(%rip), %xmm13 #482.13 - vmovq 1664+__svml_dexp_ha_data_internal(%rip), %xmm15 #473.28 - vmovsd 1728+__svml_dexp_ha_data_internal(%rip), %xmm4 #466.23 + vfmadd132sd 1024+__jsvml_dexp_ha_data_internal(%rip), %xmm3, %xmm2 #464.13 + lea __jsvml_dexp_ha_data_internal(%rip), %rdx #477.53 + vmovsd 1536+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #482.13 + vmovq 1664+__jsvml_dexp_ha_data_internal(%rip), %xmm15 #473.28 + vmovsd 1728+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #466.23 vandpd %xmm4, %xmm1, %xmm5 #468.20 vsubsd %xmm3, %xmm2, %xmm11 #465.13 - vcmpnlesd 1792+__svml_dexp_ha_data_internal(%rip), %xmm5, %xmm6 #469.25 - vaddsd 1152+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm0 #474.17 + vcmpnlesd 1792+__jsvml_dexp_ha_data_internal(%rip), %xmm5, %xmm6 #469.25 + vaddsd 1152+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm0 #474.17 vmovmskpd %xmm6, %ecx #471.48 vmovapd %xmm11, %xmm9 #480.13 vpand %xmm15, %xmm0, %xmm7 #476.23 - vfnmadd132sd 1216+__svml_dexp_ha_data_internal(%rip), %xmm1, %xmm9 #480.13 + vfnmadd132sd 1216+__jsvml_dexp_ha_data_internal(%rip), %xmm1, %xmm9 #480.13 vpandn %xmm0, %xmm15, %xmm15 #478.19 vpsllq $42, %xmm15, %xmm3 #479.19 vmovd %xmm7, %eax #477.89 - vfnmadd132sd 1280+__svml_dexp_ha_data_internal(%rip), %xmm9, %xmm11 #481.13 - vfmadd213sd 1472+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm13 #482.13 + vfnmadd132sd 1280+__jsvml_dexp_ha_data_internal(%rip), %xmm9, %xmm11 #481.13 + vfmadd213sd 1472+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm13 #482.13 vmulsd %xmm11, %xmm11, %xmm10 #484.14 - vfmadd213sd 1408+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm13 #483.13 - vfmadd213sd 1344+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm13 #485.13 + vfmadd213sd 1408+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm13 #483.13 + vfmadd213sd 1344+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm13 #485.13 movslq %eax, %rax #477.53 vfmadd213sd %xmm11, %xmm10, %xmm13 #486.13 vmovsd 8(%rdx,%rax), %xmm8 #477.53 @@ -299,9 +299,9 @@ __svml_exp1_ha_l9: # LOE ..B3.3: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq - vmovsd 1984+__svml_dexp_ha_data_internal(%rip), %xmm2 #503.33 + vmovsd 1984+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #503.33 vcmpltsd %xmm1, %xmm2, %xmm3 #504.28 - vcmpltsd 2048+__svml_dexp_ha_data_internal(%rip), %xmm1, %xmm4 #506.28 + vcmpltsd 2048+__jsvml_dexp_ha_data_internal(%rip), %xmm1, %xmm4 #506.28 vmovsd %xmm3, %xmm1, %xmm0 #504.28 vorpd %xmm4, %xmm0, %xmm5 #509.28 vmovmskpd %xmm5, %eax #511.68 @@ -331,29 +331,29 @@ __svml_exp1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #516.546 lea 64(%rsp), %rsi #516.546 -..___tag_value___svml_exp1_ha_l9.25: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #516.546 -..___tag_value___svml_exp1_ha_l9.26: +..___tag_value___jsvml_exp1_ha_l9.25: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #516.546 +..___tag_value___jsvml_exp1_ha_l9.26: jmp ..B3.5 # Prob 100% #516.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_exp1_ha_l9,@function - .size __svml_exp1_ha_l9,.-__svml_exp1_ha_l9 -..LN__svml_exp1_ha_l9.2: + .type __jsvml_exp1_ha_l9,@function + .size __jsvml_exp1_ha_l9,.-__jsvml_exp1_ha_l9 +..LN__jsvml_exp1_ha_l9.2: .data -# -- End __svml_exp1_ha_l9 +# -- End __jsvml_exp1_ha_l9 .text -.L_2__routine_start___svml_exp2_ha_ex_3: -# -- Begin __svml_exp2_ha_ex +.L_2__routine_start___jsvml_exp2_ha_ex_3: +# -- Begin __jsvml_exp2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_exp2_ha_ex -# --- __svml_exp2_ha_ex(__m128d) -__svml_exp2_ha_ex: + .globl __jsvml_exp2_ha_ex +# --- __jsvml_exp2_ha_ex(__m128d) +__jsvml_exp2_ha_ex: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -362,7 +362,7 @@ __svml_exp2_ha_ex: .byte 30 #607.546 .byte 250 #607.546 .cfi_startproc -..___tag_value___svml_exp2_ha_ex.28: +..___tag_value___jsvml_exp2_ha_ex.28: ..L29: #524.1 pushq %rbp #524.1 @@ -373,40 +373,40 @@ __svml_exp2_ha_ex: andq $-64, %rsp #524.1 subq $192, %rsp #524.1 movaps %xmm0, %xmm3 #524.1 - movups 1024+__svml_dexp_ha_data_internal(%rip), %xmm2 #554.25 - lea __svml_dexp_ha_data_internal(%rip), %rcx #569.71 + movups 1024+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #554.25 + lea __jsvml_dexp_ha_data_internal(%rip), %rcx #569.71 mulpd %xmm3, %xmm2 #554.25 - movups 1088+__svml_dexp_ha_data_internal(%rip), %xmm4 #547.51 + movups 1088+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #547.51 addpd %xmm4, %xmm2 #554.13 movaps %xmm2, %xmm1 #555.13 subpd %xmm4, %xmm1 #555.13 - movups 1216+__svml_dexp_ha_data_internal(%rip), %xmm12 #571.33 + movups 1216+__jsvml_dexp_ha_data_internal(%rip), %xmm12 #571.33 mulpd %xmm1, %xmm12 #571.33 - movdqu 1600+__svml_dexp_ha_data_internal(%rip), %xmm4 #563.60 + movdqu 1600+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #563.60 movdqa %xmm4, %xmm8 #565.21 pandn %xmm2, %xmm4 #567.17 pand %xmm2, %xmm8 #565.21 psllq $46, %xmm4 #570.17 - movups 1280+__svml_dexp_ha_data_internal(%rip), %xmm13 #572.32 + movups 1280+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #572.32 pshufd $136, %xmm8, %xmm9 #566.21 mulpd %xmm1, %xmm13 #572.32 pslld $4, %xmm9 #568.21 movd %xmm9, %eax #569.116 pshufd $1, %xmm9, %xmm10 #569.272 movaps %xmm3, %xmm9 #571.13 - movups 1536+__svml_dexp_ha_data_internal(%rip), %xmm14 #573.25 + movups 1536+__jsvml_dexp_ha_data_internal(%rip), %xmm14 #573.25 subpd %xmm12, %xmm9 #571.13 movd %xmm10, %edx #569.254 - movq 1856+__svml_dexp_ha_data_internal(%rip), %xmm5 #556.23 + movq 1856+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #556.23 subpd %xmm13, %xmm9 #572.13 mulpd %xmm9, %xmm14 #573.25 - addpd 1472+__svml_dexp_ha_data_internal(%rip), %xmm14 #573.13 + addpd 1472+__jsvml_dexp_ha_data_internal(%rip), %xmm14 #573.13 mulpd %xmm9, %xmm14 #574.25 - addpd 1408+__svml_dexp_ha_data_internal(%rip), %xmm14 #574.13 + addpd 1408+__jsvml_dexp_ha_data_internal(%rip), %xmm14 #574.13 mulpd %xmm9, %xmm14 #576.25 movaps %xmm9, %xmm15 #575.14 mulpd %xmm9, %xmm15 #575.14 - addpd 1344+__svml_dexp_ha_data_internal(%rip), %xmm14 #576.13 + addpd 1344+__jsvml_dexp_ha_data_internal(%rip), %xmm14 #576.13 mulpd %xmm14, %xmm15 #577.25 movslq %eax, %rax #569.71 movslq %edx, %rdx #569.209 @@ -420,7 +420,7 @@ __svml_exp2_ha_ex: addpd %xmm9, %xmm8 #578.13 pshufd $221, %xmm3, %xmm7 #559.20 addpd %xmm8, %xmm0 #579.13 - movq 1920+__svml_dexp_ha_data_internal(%rip), %xmm6 #557.27 + movq 1920+__jsvml_dexp_ha_data_internal(%rip), %xmm6 #557.27 pand %xmm5, %xmm7 #560.20 pcmpgtd %xmm6, %xmm7 #561.25 movmskps %xmm7, %esi #562.48 @@ -440,9 +440,9 @@ __svml_exp2_ha_ex: # LOE ..B4.3: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq - movups 1984+__svml_dexp_ha_data_internal(%rip), %xmm5 #594.64 + movups 1984+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #594.64 movaps %xmm3, %xmm4 #597.28 - cmpltpd 2048+__svml_dexp_ha_data_internal(%rip), %xmm4 #597.28 + cmpltpd 2048+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #597.28 cmpltpd %xmm3, %xmm5 #595.28 movups .L_2il0floatpacket.33(%rip), %xmm1 #593.24 movaps %xmm5, %xmm2 #598.33 @@ -500,29 +500,29 @@ __svml_exp2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #607.546 lea 128(%rsp,%r12,8), %rsi #607.546 -..___tag_value___svml_exp2_ha_ex.46: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #607.546 -..___tag_value___svml_exp2_ha_ex.47: +..___tag_value___jsvml_exp2_ha_ex.46: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #607.546 +..___tag_value___jsvml_exp2_ha_ex.47: jmp ..B4.9 # Prob 100% #607.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_exp2_ha_ex,@function - .size __svml_exp2_ha_ex,.-__svml_exp2_ha_ex -..LN__svml_exp2_ha_ex.3: + .type __jsvml_exp2_ha_ex,@function + .size __jsvml_exp2_ha_ex,.-__jsvml_exp2_ha_ex +..LN__jsvml_exp2_ha_ex.3: .data -# -- End __svml_exp2_ha_ex +# -- End __jsvml_exp2_ha_ex .text -.L_2__routine_start___svml_exp4_ha_e9_4: -# -- Begin __svml_exp4_ha_e9 +.L_2__routine_start___jsvml_exp4_ha_e9_4: +# -- Begin __jsvml_exp4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_exp4_ha_e9 -# --- __svml_exp4_ha_e9(__m256d) -__svml_exp4_ha_e9: + .globl __jsvml_exp4_ha_e9 +# --- __jsvml_exp4_ha_e9(__m256d) +__jsvml_exp4_ha_e9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -531,7 +531,7 @@ __svml_exp4_ha_e9: .byte 30 #698.552 .byte 250 #698.552 .cfi_startproc -..___tag_value___svml_exp4_ha_e9.49: +..___tag_value___jsvml_exp4_ha_e9.49: ..L50: #615.1 pushq %rbp #615.1 @@ -541,23 +541,23 @@ __svml_exp4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #615.1 subq $192, %rsp #615.1 - lea __svml_dexp_ha_data_internal(%rip), %r8 #660.49 + lea __jsvml_dexp_ha_data_internal(%rip), %r8 #660.49 vmovapd %ymm0, %ymm6 #615.1 - vmovupd 1088+__svml_dexp_ha_data_internal(%rip), %ymm8 #638.54 - vmulpd 1024+__svml_dexp_ha_data_internal(%rip), %ymm6, %ymm7 #645.28 - vmovupd 1600+__svml_dexp_ha_data_internal(%rip), %xmm4 #654.31 + vmovupd 1088+__jsvml_dexp_ha_data_internal(%rip), %ymm8 #638.54 + vmulpd 1024+__jsvml_dexp_ha_data_internal(%rip), %ymm6, %ymm7 #645.28 + vmovupd 1600+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #654.31 vaddpd %ymm7, %ymm8, %ymm3 #645.13 vsubpd %ymm8, %ymm3, %ymm5 #646.13 vextractf128 $1, %ymm6, %xmm9 #649.109 vshufps $221, %xmm9, %xmm6, %xmm10 #650.44 - vandps 1856+__svml_dexp_ha_data_internal(%rip), %xmm10, %xmm11 #651.26 - vmulpd 1216+__svml_dexp_ha_data_internal(%rip), %ymm5, %ymm10 #662.36 - vmulpd 1280+__svml_dexp_ha_data_internal(%rip), %ymm5, %ymm5 #663.35 - vpcmpgtd 1920+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm12 #652.31 + vandps 1856+__jsvml_dexp_ha_data_internal(%rip), %xmm10, %xmm11 #651.26 + vmulpd 1216+__jsvml_dexp_ha_data_internal(%rip), %ymm5, %ymm10 #662.36 + vmulpd 1280+__jsvml_dexp_ha_data_internal(%rip), %ymm5, %ymm5 #663.35 + vpcmpgtd 1920+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm12 #652.31 vmovmskps %xmm12, %eax #653.48 vsubpd %ymm10, %ymm6, %ymm11 #662.13 vsubpd %ymm5, %ymm11, %ymm5 #663.13 - vmulpd 1536+__svml_dexp_ha_data_internal(%rip), %ymm5, %ymm12 #664.28 + vmulpd 1536+__jsvml_dexp_ha_data_internal(%rip), %ymm5, %ymm12 #664.28 vandps %xmm4, %xmm3, %xmm13 #656.27 vextractf128 $1, %ymm3, %xmm2 #655.108 vpandn %xmm3, %xmm4, %xmm3 #658.23 @@ -566,18 +566,18 @@ __svml_exp4_ha_e9: vpandn %xmm2, %xmm4, %xmm2 #658.91 vshufps $136, %xmm14, %xmm13, %xmm15 #657.45 vpsllq $46, %xmm2, %xmm4 #661.76 - vaddpd 1472+__svml_dexp_ha_data_internal(%rip), %ymm12, %ymm13 #664.13 + vaddpd 1472+__jsvml_dexp_ha_data_internal(%rip), %ymm12, %ymm13 #664.13 vpslld $4, %xmm15, %xmm1 #659.27 vmovd %xmm1, %edx #660.94 vmulpd %ymm5, %ymm5, %ymm12 #666.14 vmulpd %ymm13, %ymm5, %ymm14 #665.28 - vaddpd 1408+__svml_dexp_ha_data_internal(%rip), %ymm14, %ymm15 #665.13 + vaddpd 1408+__jsvml_dexp_ha_data_internal(%rip), %ymm14, %ymm15 #665.13 vmulpd %ymm15, %ymm5, %ymm15 #667.28 vpextrd $1, %xmm1, %ecx #660.212 movslq %ecx, %rcx #660.167 vpextrd $3, %xmm1, %edi #660.454 movslq %edi, %rdi #660.409 - vaddpd 1344+__svml_dexp_ha_data_internal(%rip), %ymm15, %ymm13 #667.13 + vaddpd 1344+__jsvml_dexp_ha_data_internal(%rip), %ymm15, %ymm13 #667.13 vmovupd (%r8,%rcx), %xmm7 #660.167 movslq %edx, %rdx #660.49 vpextrd $2, %xmm1, %esi #660.333 @@ -611,8 +611,8 @@ __svml_exp4_ha_e9: # LOE ..B5.3: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq - vcmpgt_oqpd 1984+__svml_dexp_ha_data_internal(%rip), %ymm6, %ymm1 #686.28 - vcmplt_oqpd 2048+__svml_dexp_ha_data_internal(%rip), %ymm6, %ymm2 #688.28 + vcmpgt_oqpd 1984+__jsvml_dexp_ha_data_internal(%rip), %ymm6, %ymm1 #686.28 + vcmplt_oqpd 2048+__jsvml_dexp_ha_data_internal(%rip), %ymm6, %ymm2 #688.28 vblendvpd %ymm1, .L_2il0floatpacket.34(%rip), %ymm0, %ymm0 #689.22 vorpd %ymm2, %ymm1, %ymm3 #691.28 vandnpd %ymm0, %ymm2, %ymm0 #690.22 @@ -669,29 +669,29 @@ __svml_exp4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #698.552 lea 128(%rsp,%r12,8), %rsi #698.552 -..___tag_value___svml_exp4_ha_e9.67: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #698.552 -..___tag_value___svml_exp4_ha_e9.68: +..___tag_value___jsvml_exp4_ha_e9.67: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #698.552 +..___tag_value___jsvml_exp4_ha_e9.68: jmp ..B5.9 # Prob 100% #698.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_exp4_ha_e9,@function - .size __svml_exp4_ha_e9,.-__svml_exp4_ha_e9 -..LN__svml_exp4_ha_e9.4: + .type __jsvml_exp4_ha_e9,@function + .size __jsvml_exp4_ha_e9,.-__jsvml_exp4_ha_e9 +..LN__jsvml_exp4_ha_e9.4: .data -# -- End __svml_exp4_ha_e9 +# -- End __jsvml_exp4_ha_e9 .text -.L_2__routine_start___svml_exp2_ha_l9_5: -# -- Begin __svml_exp2_ha_l9 +.L_2__routine_start___jsvml_exp2_ha_l9_5: +# -- Begin __jsvml_exp2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_exp2_ha_l9 -# --- __svml_exp2_ha_l9(__m128d) -__svml_exp2_ha_l9: + .globl __jsvml_exp2_ha_l9 +# --- __jsvml_exp2_ha_l9(__m128d) +__jsvml_exp2_ha_l9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -700,7 +700,7 @@ __svml_exp2_ha_l9: .byte 30 #788.546 .byte 250 #788.546 .cfi_startproc -..___tag_value___svml_exp2_ha_l9.70: +..___tag_value___jsvml_exp2_ha_l9.70: ..L71: #706.1 pushq %rbp #706.1 @@ -711,28 +711,28 @@ __svml_exp2_ha_l9: andq $-64, %rsp #706.1 subq $192, %rsp #706.1 vmovapd %xmm0, %xmm1 #706.1 - vmovupd 1024+__svml_dexp_ha_data_internal(%rip), %xmm2 #728.50 - lea __svml_dexp_ha_data_internal(%rip), %rcx #749.71 - vmovupd 1088+__svml_dexp_ha_data_internal(%rip), %xmm3 #729.51 + vmovupd 1024+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #728.50 + lea __jsvml_dexp_ha_data_internal(%rip), %rcx #749.71 + vmovupd 1088+__jsvml_dexp_ha_data_internal(%rip), %xmm3 #729.51 vfmadd213pd %xmm3, %xmm1, %xmm2 #736.13 - vmovupd 1216+__svml_dexp_ha_data_internal(%rip), %xmm9 #752.13 - vmovupd 1536+__svml_dexp_ha_data_internal(%rip), %xmm14 #754.13 - vmovdqu 1664+__svml_dexp_ha_data_internal(%rip), %xmm15 #745.63 - vandpd 1728+__svml_dexp_ha_data_internal(%rip), %xmm1, %xmm4 #740.20 + vmovupd 1216+__jsvml_dexp_ha_data_internal(%rip), %xmm9 #752.13 + vmovupd 1536+__jsvml_dexp_ha_data_internal(%rip), %xmm14 #754.13 + vmovdqu 1664+__jsvml_dexp_ha_data_internal(%rip), %xmm15 #745.63 + vandpd 1728+__jsvml_dexp_ha_data_internal(%rip), %xmm1, %xmm4 #740.20 vsubpd %xmm3, %xmm2, %xmm11 #737.13 - vcmpnlepd 1792+__svml_dexp_ha_data_internal(%rip), %xmm4, %xmm5 #741.25 + vcmpnlepd 1792+__jsvml_dexp_ha_data_internal(%rip), %xmm4, %xmm5 #741.25 vfnmadd213pd %xmm1, %xmm11, %xmm9 #752.13 - vaddpd 1152+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm0 #746.17 + vaddpd 1152+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm0 #746.17 vmovmskpd %xmm5, %esi #743.48 - vfnmadd132pd 1280+__svml_dexp_ha_data_internal(%rip), %xmm9, %xmm11 #753.13 + vfnmadd132pd 1280+__jsvml_dexp_ha_data_internal(%rip), %xmm9, %xmm11 #753.13 vpand %xmm15, %xmm0, %xmm6 #748.23 vpandn %xmm0, %xmm15, %xmm15 #750.19 vpsllq $42, %xmm15, %xmm3 #751.19 vmovd %xmm6, %eax #749.116 - vfmadd213pd 1472+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm14 #754.13 + vfmadd213pd 1472+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm14 #754.13 vmulpd %xmm11, %xmm11, %xmm10 #756.14 - vfmadd213pd 1408+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm14 #755.13 - vfmadd213pd 1344+__svml_dexp_ha_data_internal(%rip), %xmm11, %xmm14 #757.13 + vfmadd213pd 1408+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm14 #755.13 + vfmadd213pd 1344+__jsvml_dexp_ha_data_internal(%rip), %xmm11, %xmm14 #757.13 vpextrd $2, %xmm6, %edx #749.256 movslq %eax, %rax #749.71 movslq %edx, %rdx #749.211 @@ -760,8 +760,8 @@ __svml_exp2_ha_l9: # LOE ..B6.3: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq - vmovupd 1984+__svml_dexp_ha_data_internal(%rip), %xmm2 #775.64 - vcmpltpd 2048+__svml_dexp_ha_data_internal(%rip), %xmm1, %xmm3 #778.28 + vmovupd 1984+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #775.64 + vcmpltpd 2048+__jsvml_dexp_ha_data_internal(%rip), %xmm1, %xmm3 #778.28 vcmpltpd %xmm1, %xmm2, %xmm0 #776.28 vorpd %xmm3, %xmm0, %xmm4 #781.28 vmovmskpd %xmm4, %edx #783.68 @@ -813,29 +813,29 @@ __svml_exp2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #788.546 lea 128(%rsp,%r12,8), %rsi #788.546 -..___tag_value___svml_exp2_ha_l9.88: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #788.546 -..___tag_value___svml_exp2_ha_l9.89: +..___tag_value___jsvml_exp2_ha_l9.88: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #788.546 +..___tag_value___jsvml_exp2_ha_l9.89: jmp ..B6.9 # Prob 100% #788.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_exp2_ha_l9,@function - .size __svml_exp2_ha_l9,.-__svml_exp2_ha_l9 -..LN__svml_exp2_ha_l9.5: + .type __jsvml_exp2_ha_l9,@function + .size __jsvml_exp2_ha_l9,.-__jsvml_exp2_ha_l9 +..LN__jsvml_exp2_ha_l9.5: .data -# -- End __svml_exp2_ha_l9 +# -- End __jsvml_exp2_ha_l9 .text -.L_2__routine_start___svml_exp1_ha_ex_6: -# -- Begin __svml_exp1_ha_ex +.L_2__routine_start___jsvml_exp1_ha_ex_6: +# -- Begin __jsvml_exp1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_exp1_ha_ex -# --- __svml_exp1_ha_ex(__m128d) -__svml_exp1_ha_ex: + .globl __jsvml_exp1_ha_ex +# --- __jsvml_exp1_ha_ex(__m128d) +__jsvml_exp1_ha_ex: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -844,7 +844,7 @@ __svml_exp1_ha_ex: .byte 30 #879.546 .byte 250 #879.546 .cfi_startproc -..___tag_value___svml_exp1_ha_ex.91: +..___tag_value___jsvml_exp1_ha_ex.91: ..L92: #796.1 pushq %rbp #796.1 @@ -855,11 +855,11 @@ __svml_exp1_ha_ex: andq $-64, %rsp #796.1 subq $128, %rsp #796.1 movaps %xmm0, %xmm13 #826.25 - mulsd 1024+__svml_dexp_ha_data_internal(%rip), %xmm13 #826.25 + mulsd 1024+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #826.25 movaps %xmm0, %xmm10 #843.13 - movsd 1088+__svml_dexp_ha_data_internal(%rip), %xmm1 #819.20 - lea __svml_dexp_ha_data_internal(%rip), %rsi #841.59 - movq 1600+__svml_dexp_ha_data_internal(%rip), %xmm12 #835.25 + movsd 1088+__jsvml_dexp_ha_data_internal(%rip), %xmm1 #819.20 + lea __jsvml_dexp_ha_data_internal(%rip), %rsi #841.59 + movq 1600+__jsvml_dexp_ha_data_internal(%rip), %xmm12 #835.25 movl $2147483647, %eax #832.20 movdqa %xmm12, %xmm5 #837.21 movl $1082532650, %edx #833.25 @@ -873,27 +873,27 @@ __svml_exp1_ha_ex: pand %xmm2, %xmm4 #832.20 movd %xmm6, %ecx #841.95 movd %edx, %xmm3 #833.25 - movsd 1536+__svml_dexp_ha_data_internal(%rip), %xmm6 #845.25 + movsd 1536+__jsvml_dexp_ha_data_internal(%rip), %xmm6 #845.25 pcmpgtd %xmm3, %xmm4 #833.25 pandn %xmm13, %xmm12 #839.17 subsd %xmm1, %xmm8 #827.13 movmskps %xmm4, %eax #834.48 movaps %xmm8, %xmm7 #843.33 psllq $46, %xmm12 #842.17 - mulsd 1216+__svml_dexp_ha_data_internal(%rip), %xmm7 #843.33 - mulsd 1280+__svml_dexp_ha_data_internal(%rip), %xmm8 #844.32 + mulsd 1216+__jsvml_dexp_ha_data_internal(%rip), %xmm7 #843.33 + mulsd 1280+__jsvml_dexp_ha_data_internal(%rip), %xmm8 #844.32 subsd %xmm7, %xmm10 #843.13 movslq %ecx, %rcx #841.59 subsd %xmm8, %xmm10 #844.13 mulsd %xmm10, %xmm6 #845.25 movaps %xmm10, %xmm9 #847.14 mulsd %xmm10, %xmm9 #847.14 - addsd 1472+__svml_dexp_ha_data_internal(%rip), %xmm6 #845.13 + addsd 1472+__jsvml_dexp_ha_data_internal(%rip), %xmm6 #845.13 mulsd %xmm10, %xmm6 #846.25 movups (%rsi,%rcx), %xmm11 #841.59 - addsd 1408+__svml_dexp_ha_data_internal(%rip), %xmm6 #846.13 + addsd 1408+__jsvml_dexp_ha_data_internal(%rip), %xmm6 #846.13 mulsd %xmm10, %xmm6 #848.25 - addsd 1344+__svml_dexp_ha_data_internal(%rip), %xmm6 #848.13 + addsd 1344+__jsvml_dexp_ha_data_internal(%rip), %xmm6 #848.13 mulsd %xmm9, %xmm6 #849.25 addsd %xmm10, %xmm6 #849.13 mulsd %xmm11, %xmm6 #850.25 @@ -916,11 +916,11 @@ __svml_exp1_ha_ex: # LOE ..B7.3: # Preds ..B7.1 # Execution count [5.00e-02]: Infreq - movsd 1984+__svml_dexp_ha_data_internal(%rip), %xmm1 #866.33 + movsd 1984+__jsvml_dexp_ha_data_internal(%rip), %xmm1 #866.33 movaps %xmm0, %xmm4 #869.28 movaps %xmm0, %xmm5 #867.28 cmpltsd %xmm0, %xmm1 #867.28 - cmpltsd 2048+__svml_dexp_ha_data_internal(%rip), %xmm4 #869.28 + cmpltsd 2048+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #869.28 movups .L_2il0floatpacket.33(%rip), %xmm2 #865.24 movsd %xmm1, %xmm5 #867.28 movaps %xmm5, %xmm3 #870.33 @@ -951,29 +951,29 @@ __svml_exp1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #879.546 lea 64(%rsp), %rsi #879.546 -..___tag_value___svml_exp1_ha_ex.100: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #879.546 -..___tag_value___svml_exp1_ha_ex.101: +..___tag_value___jsvml_exp1_ha_ex.100: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #879.546 +..___tag_value___jsvml_exp1_ha_ex.101: jmp ..B7.5 # Prob 100% #879.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_exp1_ha_ex,@function - .size __svml_exp1_ha_ex,.-__svml_exp1_ha_ex -..LN__svml_exp1_ha_ex.6: + .type __jsvml_exp1_ha_ex,@function + .size __jsvml_exp1_ha_ex,.-__jsvml_exp1_ha_ex +..LN__jsvml_exp1_ha_ex.6: .data -# -- End __svml_exp1_ha_ex +# -- End __jsvml_exp1_ha_ex .text -.L_2__routine_start___svml_exp4_ha_l9_7: -# -- Begin __svml_exp4_ha_l9 +.L_2__routine_start___jsvml_exp4_ha_l9_7: +# -- Begin __jsvml_exp4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_exp4_ha_l9 -# --- __svml_exp4_ha_l9(__m256d) -__svml_exp4_ha_l9: + .globl __jsvml_exp4_ha_l9 +# --- __jsvml_exp4_ha_l9(__m256d) +__jsvml_exp4_ha_l9: # parameter 1: %ymm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -982,7 +982,7 @@ __svml_exp4_ha_l9: .byte 30 #969.552 .byte 250 #969.552 .cfi_startproc -..___tag_value___svml_exp4_ha_l9.103: +..___tag_value___jsvml_exp4_ha_l9.103: ..L104: #887.1 pushq %rbp #887.1 @@ -992,20 +992,20 @@ __svml_exp4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #887.1 subq $192, %rsp #887.1 - lea __svml_dexp_ha_data_internal(%rip), %r8 #930.72 - vmovupd 1024+__svml_dexp_ha_data_internal(%rip), %ymm4 #909.53 - vmovupd 1088+__svml_dexp_ha_data_internal(%rip), %ymm5 #910.54 - vmovupd 1664+__svml_dexp_ha_data_internal(%rip), %ymm1 #926.28 + lea __jsvml_dexp_ha_data_internal(%rip), %r8 #930.72 + vmovupd 1024+__jsvml_dexp_ha_data_internal(%rip), %ymm4 #909.53 + vmovupd 1088+__jsvml_dexp_ha_data_internal(%rip), %ymm5 #910.54 + vmovupd 1664+__jsvml_dexp_ha_data_internal(%rip), %ymm1 #926.28 vmovapd %ymm0, %ymm3 #887.1 vfmadd213pd %ymm5, %ymm3, %ymm4 #917.13 vsubpd %ymm5, %ymm4, %ymm2 #918.13 - vaddpd 1152+__svml_dexp_ha_data_internal(%rip), %ymm2, %ymm0 #927.17 + vaddpd 1152+__jsvml_dexp_ha_data_internal(%rip), %ymm2, %ymm0 #927.17 vandps %ymm1, %ymm0, %ymm8 #929.23 - vandpd 1728+__svml_dexp_ha_data_internal(%rip), %ymm3, %ymm6 #921.20 - vcmpnle_uqpd 1792+__svml_dexp_ha_data_internal(%rip), %ymm6, %ymm7 #922.25 + vandpd 1728+__jsvml_dexp_ha_data_internal(%rip), %ymm3, %ymm6 #921.20 + vcmpnle_uqpd 1792+__jsvml_dexp_ha_data_internal(%rip), %ymm6, %ymm7 #922.25 vpandn %ymm0, %ymm1, %ymm0 #931.19 vmovmskpd %ymm7, %eax #924.48 - vmovupd 1536+__svml_dexp_ha_data_internal(%rip), %ymm7 #935.13 + vmovupd 1536+__jsvml_dexp_ha_data_internal(%rip), %ymm7 #935.13 vpsllq $42, %ymm0, %ymm1 #932.19 vmovd %xmm8, %edx #930.117 vextractf128 $1, %ymm8, %xmm9 #930.477 @@ -1017,20 +1017,20 @@ __svml_exp4_ha_l9: vmovupd (%r8,%rcx), %xmm13 #930.241 vunpcklpd %xmm13, %xmm12, %xmm10 #930.761 vunpckhpd %xmm13, %xmm12, %xmm14 #930.888 - vmovupd 1216+__svml_dexp_ha_data_internal(%rip), %ymm13 #933.13 + vmovupd 1216+__jsvml_dexp_ha_data_internal(%rip), %ymm13 #933.13 vfnmadd213pd %ymm3, %ymm2, %ymm13 #933.13 - vfnmadd132pd 1280+__svml_dexp_ha_data_internal(%rip), %ymm13, %ymm2 #934.13 - vfmadd213pd 1472+__svml_dexp_ha_data_internal(%rip), %ymm2, %ymm7 #935.13 + vfnmadd132pd 1280+__jsvml_dexp_ha_data_internal(%rip), %ymm13, %ymm2 #934.13 + vfmadd213pd 1472+__jsvml_dexp_ha_data_internal(%rip), %ymm2, %ymm7 #935.13 vpextrd $2, %xmm9, %edi #930.632 movslq %esi, %rsi #930.413 movslq %edi, %rdi #930.587 - vfmadd213pd 1408+__svml_dexp_ha_data_internal(%rip), %ymm2, %ymm7 #936.13 + vfmadd213pd 1408+__jsvml_dexp_ha_data_internal(%rip), %ymm2, %ymm7 #936.13 vmovupd (%r8,%rsi), %xmm15 #930.413 vmovupd (%r8,%rdi), %xmm4 #930.587 vunpcklpd %xmm4, %xmm15, %xmm11 #930.794 vunpckhpd %xmm4, %xmm15, %xmm12 #930.921 vmulpd %ymm2, %ymm2, %ymm15 #937.14 - vfmadd213pd 1344+__svml_dexp_ha_data_internal(%rip), %ymm2, %ymm7 #938.13 + vfmadd213pd 1344+__jsvml_dexp_ha_data_internal(%rip), %ymm2, %ymm7 #938.13 vfmadd213pd %ymm2, %ymm15, %ymm7 #939.13 vinsertf128 $1, %xmm11, %ymm10, %ymm6 #930.715 vinsertf128 $1, %xmm12, %ymm14, %ymm5 #930.842 @@ -1052,8 +1052,8 @@ __svml_exp4_ha_l9: # LOE ..B8.3: # Preds ..B8.1 # Execution count [5.00e-02]: Infreq - vcmpgt_oqpd 1984+__svml_dexp_ha_data_internal(%rip), %ymm3, %ymm1 #957.28 - vcmplt_oqpd 2048+__svml_dexp_ha_data_internal(%rip), %ymm3, %ymm2 #959.28 + vcmpgt_oqpd 1984+__jsvml_dexp_ha_data_internal(%rip), %ymm3, %ymm1 #957.28 + vcmplt_oqpd 2048+__jsvml_dexp_ha_data_internal(%rip), %ymm3, %ymm2 #959.28 vblendvpd %ymm1, .L_2il0floatpacket.34(%rip), %ymm0, %ymm0 #960.22 vorpd %ymm2, %ymm1, %ymm4 #962.28 vmovmskpd %ymm4, %edx #964.68 @@ -1108,29 +1108,29 @@ __svml_exp4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #969.552 lea 128(%rsp,%r12,8), %rsi #969.552 -..___tag_value___svml_exp4_ha_l9.121: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #969.552 -..___tag_value___svml_exp4_ha_l9.122: +..___tag_value___jsvml_exp4_ha_l9.121: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #969.552 +..___tag_value___jsvml_exp4_ha_l9.122: jmp ..B8.9 # Prob 100% #969.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_exp4_ha_l9,@function - .size __svml_exp4_ha_l9,.-__svml_exp4_ha_l9 -..LN__svml_exp4_ha_l9.7: + .type __jsvml_exp4_ha_l9,@function + .size __jsvml_exp4_ha_l9,.-__jsvml_exp4_ha_l9 +..LN__jsvml_exp4_ha_l9.7: .data -# -- End __svml_exp4_ha_l9 +# -- End __jsvml_exp4_ha_l9 .text -.L_2__routine_start___svml_exp2_ha_e9_8: -# -- Begin __svml_exp2_ha_e9 +.L_2__routine_start___jsvml_exp2_ha_e9_8: +# -- Begin __jsvml_exp2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_exp2_ha_e9 -# --- __svml_exp2_ha_e9(__m128d) -__svml_exp2_ha_e9: + .globl __jsvml_exp2_ha_e9 +# --- __jsvml_exp2_ha_e9(__m128d) +__jsvml_exp2_ha_e9: # parameter 1: %xmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1139,7 +1139,7 @@ __svml_exp2_ha_e9: .byte 30 #1060.546 .byte 250 #1060.546 .cfi_startproc -..___tag_value___svml_exp2_ha_e9.124: +..___tag_value___jsvml_exp2_ha_e9.124: ..L125: #977.1 pushq %rbp #977.1 @@ -1150,33 +1150,33 @@ __svml_exp2_ha_e9: andq $-64, %rsp #977.1 subq $192, %rsp #977.1 movaps %xmm0, %xmm3 #977.1 - movups 1024+__svml_dexp_ha_data_internal(%rip), %xmm2 #1007.25 + movups 1024+__jsvml_dexp_ha_data_internal(%rip), %xmm2 #1007.25 movaps %xmm3, %xmm15 #1024.13 mulpd %xmm3, %xmm2 #1007.25 - movups 1088+__svml_dexp_ha_data_internal(%rip), %xmm1 #1000.51 - lea __svml_dexp_ha_data_internal(%rip), %rcx #1022.71 + movups 1088+__jsvml_dexp_ha_data_internal(%rip), %xmm1 #1000.51 + lea __jsvml_dexp_ha_data_internal(%rip), %rcx #1022.71 addpd %xmm1, %xmm2 #1007.13 movaps %xmm2, %xmm11 #1008.13 subpd %xmm1, %xmm11 #1008.13 - movups 1216+__svml_dexp_ha_data_internal(%rip), %xmm10 #1024.33 + movups 1216+__jsvml_dexp_ha_data_internal(%rip), %xmm10 #1024.33 mulpd %xmm11, %xmm10 #1024.33 - movups 1280+__svml_dexp_ha_data_internal(%rip), %xmm12 #1025.32 + movups 1280+__jsvml_dexp_ha_data_internal(%rip), %xmm12 #1025.32 mulpd %xmm11, %xmm12 #1025.32 subpd %xmm10, %xmm15 #1024.13 subpd %xmm12, %xmm15 #1025.13 - movups 1536+__svml_dexp_ha_data_internal(%rip), %xmm13 #1026.25 + movups 1536+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #1026.25 movaps %xmm15, %xmm14 #1028.14 mulpd %xmm15, %xmm13 #1026.25 mulpd %xmm15, %xmm14 #1028.14 - addpd 1472+__svml_dexp_ha_data_internal(%rip), %xmm13 #1026.13 + addpd 1472+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #1026.13 mulpd %xmm15, %xmm13 #1027.25 - addpd 1408+__svml_dexp_ha_data_internal(%rip), %xmm13 #1027.13 + addpd 1408+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #1027.13 mulpd %xmm15, %xmm13 #1029.25 - addpd 1344+__svml_dexp_ha_data_internal(%rip), %xmm13 #1029.13 - movq 1856+__svml_dexp_ha_data_internal(%rip), %xmm4 #1009.29 + addpd 1344+__jsvml_dexp_ha_data_internal(%rip), %xmm13 #1029.13 + movq 1856+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #1009.29 pshufd $221, %xmm3, %xmm6 #1012.26 pand %xmm4, %xmm6 #1013.26 - movdqu 1600+__svml_dexp_ha_data_internal(%rip), %xmm4 #1016.66 + movdqu 1600+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #1016.66 movdqa %xmm4, %xmm7 #1018.27 pandn %xmm2, %xmm4 #1020.23 mulpd %xmm13, %xmm14 #1030.25 @@ -1185,7 +1185,7 @@ __svml_exp2_ha_e9: pshufd $136, %xmm7, %xmm8 #1019.27 pslld $4, %xmm8 #1021.27 movd %xmm8, %eax #1022.116 - movq 1920+__svml_dexp_ha_data_internal(%rip), %xmm5 #1010.33 + movq 1920+__jsvml_dexp_ha_data_internal(%rip), %xmm5 #1010.33 pcmpgtd %xmm5, %xmm6 #1014.31 movslq %eax, %rax #1022.71 pextrd $1, %xmm8, %edx #1022.256 @@ -1217,9 +1217,9 @@ __svml_exp2_ha_e9: # LOE ..B9.3: # Preds ..B9.1 # Execution count [5.00e-02]: Infreq - movups 1984+__svml_dexp_ha_data_internal(%rip), %xmm0 #1047.64 + movups 1984+__jsvml_dexp_ha_data_internal(%rip), %xmm0 #1047.64 movaps %xmm3, %xmm4 #1050.28 - cmpltpd 2048+__svml_dexp_ha_data_internal(%rip), %xmm4 #1050.28 + cmpltpd 2048+__jsvml_dexp_ha_data_internal(%rip), %xmm4 #1050.28 cmpltpd %xmm3, %xmm0 #1048.28 blendvpd %xmm0, .L_2il0floatpacket.33(%rip), %xmm1 #1051.22 orps %xmm4, %xmm0 #1053.28 @@ -1274,30 +1274,30 @@ __svml_exp2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1060.546 lea 128(%rsp,%r12,8), %rsi #1060.546 -..___tag_value___svml_exp2_ha_e9.142: -# __svml_dexp_ha_cout_rare_internal(const double *, double *) - call __svml_dexp_ha_cout_rare_internal #1060.546 -..___tag_value___svml_exp2_ha_e9.143: +..___tag_value___jsvml_exp2_ha_e9.142: +# __jsvml_dexp_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexp_ha_cout_rare_internal #1060.546 +..___tag_value___jsvml_exp2_ha_e9.143: jmp ..B9.9 # Prob 100% #1060.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_exp2_ha_e9,@function - .size __svml_exp2_ha_e9,.-__svml_exp2_ha_e9 -..LN__svml_exp2_ha_e9.8: + .type __jsvml_exp2_ha_e9,@function + .size __jsvml_exp2_ha_e9,.-__jsvml_exp2_ha_e9 +..LN__jsvml_exp2_ha_e9.8: .data -# -- End __svml_exp2_ha_e9 +# -- End __jsvml_exp2_ha_e9 .text -.L_2__routine_start___svml_dexp_ha_cout_rare_internal_9: -# -- Begin __svml_dexp_ha_cout_rare_internal +.L_2__routine_start___jsvml_dexp_ha_cout_rare_internal_9: +# -- Begin __jsvml_dexp_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dexp_ha_cout_rare_internal - .globl __svml_dexp_ha_cout_rare_internal -# --- __svml_dexp_ha_cout_rare_internal(const double *, double *) -__svml_dexp_ha_cout_rare_internal: + .hidden __jsvml_dexp_ha_cout_rare_internal + .globl __jsvml_dexp_ha_cout_rare_internal +# --- __jsvml_dexp_ha_cout_rare_internal(const double *, double *) +__jsvml_dexp_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1307,7 +1307,7 @@ __svml_dexp_ha_cout_rare_internal: .byte 30 #1313.15 .byte 250 #1313.15 .cfi_startproc -..___tag_value___svml_dexp_ha_cout_rare_internal.145: +..___tag_value___jsvml_dexp_ha_cout_rare_internal.145: ..L146: #1216.1 xorl %eax, %eax #1217.14 @@ -1542,17 +1542,17 @@ __svml_dexp_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dexp_ha_cout_rare_internal,@function - .size __svml_dexp_ha_cout_rare_internal,.-__svml_dexp_ha_cout_rare_internal -..LN__svml_dexp_ha_cout_rare_internal.9: + .type __jsvml_dexp_ha_cout_rare_internal,@function + .size __jsvml_dexp_ha_cout_rare_internal,.-__jsvml_dexp_ha_cout_rare_internal +..LN__jsvml_dexp_ha_cout_rare_internal.9: .data -# -- End __svml_dexp_ha_cout_rare_internal +# -- End __jsvml_dexp_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dexp_ha_data_internal_avx512 - .globl __svml_dexp_ha_data_internal_avx512 -__svml_dexp_ha_data_internal_avx512: + .hidden __jsvml_dexp_ha_data_internal_avx512 + .globl __jsvml_dexp_ha_data_internal_avx512 +__jsvml_dexp_ha_data_internal_avx512: .long 0 .long 1072693248 .long 1828292879 @@ -1873,12 +1873,12 @@ __svml_dexp_ha_data_internal_avx512: .long 0 .long 32752 .long 0 - .type __svml_dexp_ha_data_internal_avx512,@object - .size __svml_dexp_ha_data_internal_avx512,1280 + .type __jsvml_dexp_ha_data_internal_avx512,@object + .size __jsvml_dexp_ha_data_internal_avx512,1280 .align 64 - .hidden __svml_dexp_ha_data_internal - .globl __svml_dexp_ha_data_internal -__svml_dexp_ha_data_internal: + .hidden __jsvml_dexp_ha_data_internal + .globl __jsvml_dexp_ha_data_internal +__jsvml_dexp_ha_data_internal: .long 0 .long 1072693248 .long 0 @@ -2407,8 +2407,8 @@ __svml_dexp_ha_data_internal: .long 3230091536 .long 3576508497 .long 3230091536 - .type __svml_dexp_ha_data_internal,@object - .size __svml_dexp_ha_data_internal,2112 + .type __jsvml_dexp_ha_data_internal,@object + .size __jsvml_dexp_ha_data_internal,2112 .align 32 .L_2il0floatpacket.34: .long 0x00000000,0x7ff00000,0x00000000,0x7ff00000,0x00000000,0x7ff00000,0x00000000,0x7ff00000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_expm1_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_expm1_linux_x86.S similarity index 87% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_expm1_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_expm1_linux_x86.S index 5fd3f50a819..f361500093e 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_expm1_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_expm1_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_expm1.c" .text ..TXTST0: -.L_2__routine_start___svml_expm14_ha_l9_0: -# -- Begin __svml_expm14_ha_l9 +.L_2__routine_start___jsvml_expm14_ha_l9_0: +# -- Begin __jsvml_expm14_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm14_ha_l9 -# --- __svml_expm14_ha_l9(__m256d) -__svml_expm14_ha_l9: + .globl __jsvml_expm14_ha_l9 +# --- __jsvml_expm14_ha_l9(__m256d) +__jsvml_expm14_ha_l9: # parameter 1: %ymm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_expm14_ha_l9: .byte 30 #443.552 .byte 250 #443.552 .cfi_startproc -..___tag_value___svml_expm14_ha_l9.1: +..___tag_value___jsvml_expm14_ha_l9.1: ..L2: #332.1 pushq %rbp #332.1 @@ -57,25 +57,25 @@ __svml_expm14_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #332.1 subq $192, %rsp #332.1 - lea __svml_dexpm1_ha_data_internal(%rip), %r8 #405.68 + lea __jsvml_dexpm1_ha_data_internal(%rip), %r8 #405.68 vmovapd %ymm0, %ymm2 #332.1 - vmulpd 2304+__svml_dexpm1_ha_data_internal(%rip), %ymm2, %ymm4 #385.12 - vmovupd 2816+__svml_dexpm1_ha_data_internal(%rip), %ymm3 #393.52 - vmovupd 2368+__svml_dexpm1_ha_data_internal(%rip), %ymm0 #389.14 + vmulpd 2304+__jsvml_dexpm1_ha_data_internal(%rip), %ymm2, %ymm4 #385.12 + vmovupd 2816+__jsvml_dexpm1_ha_data_internal(%rip), %ymm3 #393.52 + vmovupd 2368+__jsvml_dexpm1_ha_data_internal(%rip), %ymm0 #389.14 vroundpd $0, %ymm4, %ymm8 #386.12 - vaddpd 2496+__svml_dexpm1_ha_data_internal(%rip), %ymm8, %ymm15 #401.16 - vmulpd 2432+__svml_dexpm1_ha_data_internal(%rip), %ymm8, %ymm1 #390.14 + vaddpd 2496+__jsvml_dexpm1_ha_data_internal(%rip), %ymm8, %ymm15 #401.16 + vmulpd 2432+__jsvml_dexpm1_ha_data_internal(%rip), %ymm8, %ymm1 #390.14 vfnmadd213pd %ymm2, %ymm8, %ymm0 #389.14 - vmovupd 2048+__svml_dexpm1_ha_data_internal(%rip), %ymm8 #416.14 + vmovupd 2048+__jsvml_dexpm1_ha_data_internal(%rip), %ymm8 #416.14 vsubpd %ymm1, %ymm0, %ymm5 #391.12 vcmpeqpd %ymm2, %ymm0, %ymm6 #392.20 - vfmadd213pd 2112+__svml_dexpm1_ha_data_internal(%rip), %ymm5, %ymm8 #416.14 - vandps 2560+__svml_dexpm1_ha_data_internal(%rip), %ymm15, %ymm10 #404.18 + vfmadd213pd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %ymm5, %ymm8 #416.14 + vandps 2560+__jsvml_dexpm1_ha_data_internal(%rip), %ymm15, %ymm10 #404.18 vandpd %ymm3, %ymm2, %ymm9 #395.13 - vcmpnle_uqpd 2880+__svml_dexpm1_ha_data_internal(%rip), %ymm9, %ymm7 #397.18 + vcmpnle_uqpd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %ymm9, %ymm7 #397.18 vmovmskpd %ymm7, %eax #399.44 - vandps 2624+__svml_dexpm1_ha_data_internal(%rip), %ymm15, %ymm15 #407.17 - vorpd 2688+__svml_dexpm1_ha_data_internal(%rip), %ymm6, %ymm6 #420.19 + vandps 2624+__jsvml_dexpm1_ha_data_internal(%rip), %ymm15, %ymm15 #407.17 + vorpd 2688+__jsvml_dexpm1_ha_data_internal(%rip), %ymm6, %ymm6 #420.19 vandpd %ymm6, %ymm0, %ymm6 #421.13 vandnpd %ymm2, %ymm3, %ymm4 #396.14 vextractf128 $1, %ymm10, %xmm11 #405.546 @@ -99,14 +99,14 @@ __svml_expm14_ha_l9: vinsertf128 $1, %xmm7, %ymm9, %ymm10 #405.807 vpsllq $41, %ymm15, %ymm7 #408.17 vorpd %ymm7, %ymm10, %ymm9 #410.13 - vmovupd 2176+__svml_dexpm1_ha_data_internal(%rip), %ymm10 #417.14 - vfmadd213pd 2240+__svml_dexpm1_ha_data_internal(%rip), %ymm5, %ymm10 #417.14 + vmovupd 2176+__jsvml_dexpm1_ha_data_internal(%rip), %ymm10 #417.14 + vfmadd213pd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %ymm5, %ymm10 #417.14 vsubpd %ymm6, %ymm0, %ymm5 #422.13 vfmadd213pd %ymm10, %ymm11, %ymm8 #423.12 vsubpd %ymm1, %ymm5, %ymm1 #424.13 vmulpd %ymm6, %ymm9, %ymm5 #425.15 vfmadd213pd %ymm1, %ymm11, %ymm8 #426.12 - vmovupd 2752+__svml_dexpm1_ha_data_internal(%rip), %ymm1 #427.49 + vmovupd 2752+__jsvml_dexpm1_ha_data_internal(%rip), %ymm1 #427.49 vaddpd %ymm8, %ymm6, %ymm6 #437.13 vandpd %ymm3, %ymm9, %ymm0 #428.163 vandpd %ymm3, %ymm1, %ymm3 #428.211 @@ -186,29 +186,29 @@ __svml_expm14_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #443.552 lea 128(%rsp,%r12,8), %rsi #443.552 -..___tag_value___svml_expm14_ha_l9.19: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #443.552 -..___tag_value___svml_expm14_ha_l9.20: +..___tag_value___jsvml_expm14_ha_l9.19: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #443.552 +..___tag_value___jsvml_expm14_ha_l9.20: jmp ..B1.8 # Prob 100% #443.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm14_ha_l9,@function - .size __svml_expm14_ha_l9,.-__svml_expm14_ha_l9 -..LN__svml_expm14_ha_l9.0: + .type __jsvml_expm14_ha_l9,@function + .size __jsvml_expm14_ha_l9,.-__jsvml_expm14_ha_l9 +..LN__jsvml_expm14_ha_l9.0: .data -# -- End __svml_expm14_ha_l9 +# -- End __jsvml_expm14_ha_l9 .text -.L_2__routine_start___svml_expm12_ha_e9_1: -# -- Begin __svml_expm12_ha_e9 +.L_2__routine_start___jsvml_expm12_ha_e9_1: +# -- Begin __jsvml_expm12_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm12_ha_e9 -# --- __svml_expm12_ha_e9(__m128d) -__svml_expm12_ha_e9: + .globl __jsvml_expm12_ha_e9 +# --- __jsvml_expm12_ha_e9(__m128d) +__jsvml_expm12_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -217,7 +217,7 @@ __svml_expm12_ha_e9: .byte 30 #562.546 .byte 250 #562.546 .cfi_startproc -..___tag_value___svml_expm12_ha_e9.22: +..___tag_value___jsvml_expm12_ha_e9.22: ..L23: #451.1 pushq %rbp #451.1 @@ -228,41 +228,41 @@ __svml_expm12_ha_e9: andq $-64, %rsp #451.1 subq $192, %rsp #451.1 movaps %xmm0, %xmm10 #451.1 - movups 2304+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #503.47 + movups 2304+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #503.47 movaps %xmm10, %xmm9 #508.14 mulpd %xmm10, %xmm11 #504.12 - movups 2368+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #506.45 - lea __svml_dexpm1_ha_data_internal(%rip), %rsi #524.67 + movups 2368+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #506.45 + lea __jsvml_dexpm1_ha_data_internal(%rip), %rsi #524.67 roundpd $0, %xmm11, %xmm11 #505.12 mulpd %xmm11, %xmm12 #508.34 - movups 2432+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #509.14 + movups 2432+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #509.14 mulpd %xmm11, %xmm3 #509.14 subpd %xmm12, %xmm9 #508.14 movaps %xmm9, %xmm6 #510.12 movaps %xmm9, %xmm7 #511.20 subpd %xmm3, %xmm6 #510.12 cmpeqpd %xmm10, %xmm7 #511.20 - movups 2816+__svml_dexpm1_ha_data_internal(%rip), %xmm5 #512.49 + movups 2816+__jsvml_dexpm1_ha_data_internal(%rip), %xmm5 #512.49 movaps %xmm5, %xmm13 #514.13 movaps %xmm5, %xmm8 #515.14 andps %xmm10, %xmm13 #514.13 andnps %xmm10, %xmm8 #515.14 - cmpnlepd 2880+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #516.18 - movups 2048+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #535.26 + cmpnlepd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #516.18 + movups 2048+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #535.26 mulpd %xmm6, %xmm12 #535.26 movmskpd %xmm13, %edx #518.44 - movups 2176+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #536.26 - movups 2496+__svml_dexpm1_ha_data_internal(%rip), %xmm14 #519.53 + movups 2176+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #536.26 + movups 2496+__jsvml_dexpm1_ha_data_internal(%rip), %xmm14 #519.53 mulpd %xmm6, %xmm13 #536.26 mulpd %xmm6, %xmm6 #537.13 - addpd 2112+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #535.14 + addpd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #535.14 addpd %xmm14, %xmm11 #520.16 - addpd 2240+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #536.14 + addpd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #536.14 mulpd %xmm6, %xmm12 #542.24 - movups 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm15 #523.22 + movups 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm15 #523.22 andps %xmm11, %xmm15 #523.22 movd %xmm15, %eax #524.137 - orps 2688+__svml_dexpm1_ha_data_internal(%rip), %xmm7 #539.19 + orps 2688+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7 #539.19 andps %xmm9, %xmm7 #540.13 movslq %eax, %rax #524.67 pextrd $2, %xmm15, %ecx #524.301 @@ -271,7 +271,7 @@ __svml_expm12_ha_e9: mulpd %xmm13, %xmm6 #545.24 subpd %xmm3, %xmm9 #543.13 movslq %ecx, %rcx #524.231 - movdqu 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm0 #526.21 + movdqu 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm0 #526.21 movups (%rsi,%rax), %xmm4 #524.67 pand %xmm0, %xmm11 #526.21 movaps %xmm4, %xmm2 #524.350 @@ -279,7 +279,7 @@ __svml_expm12_ha_e9: movups (%rsi,%rcx), %xmm1 #524.231 movaps %xmm5, %xmm0 #547.163 unpcklpd %xmm1, %xmm2 #524.350 - movups 2752+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #546.46 + movups 2752+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #546.46 orps %xmm11, %xmm2 #529.13 andps %xmm2, %xmm0 #547.163 andps %xmm3, %xmm5 #547.208 @@ -363,29 +363,29 @@ __svml_expm12_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #562.546 lea 128(%rsp,%r12,8), %rsi #562.546 -..___tag_value___svml_expm12_ha_e9.40: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #562.546 -..___tag_value___svml_expm12_ha_e9.41: +..___tag_value___jsvml_expm12_ha_e9.40: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #562.546 +..___tag_value___jsvml_expm12_ha_e9.41: jmp ..B2.8 # Prob 100% #562.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm12_ha_e9,@function - .size __svml_expm12_ha_e9,.-__svml_expm12_ha_e9 -..LN__svml_expm12_ha_e9.1: + .type __jsvml_expm12_ha_e9,@function + .size __jsvml_expm12_ha_e9,.-__jsvml_expm12_ha_e9 +..LN__jsvml_expm12_ha_e9.1: .data -# -- End __svml_expm12_ha_e9 +# -- End __jsvml_expm12_ha_e9 .text -.L_2__routine_start___svml_expm12_ha_l9_2: -# -- Begin __svml_expm12_ha_l9 +.L_2__routine_start___jsvml_expm12_ha_l9_2: +# -- Begin __jsvml_expm12_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm12_ha_l9 -# --- __svml_expm12_ha_l9(__m128d) -__svml_expm12_ha_l9: + .globl __jsvml_expm12_ha_l9 +# --- __jsvml_expm12_ha_l9(__m128d) +__jsvml_expm12_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -394,7 +394,7 @@ __svml_expm12_ha_l9: .byte 30 #940.546 .byte 250 #940.546 .cfi_startproc -..___tag_value___svml_expm12_ha_l9.43: +..___tag_value___jsvml_expm12_ha_l9.43: ..L44: #829.1 pushq %rbp #829.1 @@ -405,20 +405,20 @@ __svml_expm12_ha_l9: andq $-64, %rsp #829.1 subq $192, %rsp #829.1 vmovapd %xmm0, %xmm12 #829.1 - vmulpd 2304+__svml_dexpm1_ha_data_internal(%rip), %xmm12, %xmm13 #882.12 + vmulpd 2304+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12, %xmm13 #882.12 vroundpd $0, %xmm13, %xmm13 #883.12 - lea __svml_dexpm1_ha_data_internal(%rip), %rsi #902.67 - vaddpd 2496+__svml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm2 #898.16 - vmulpd 2432+__svml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm8 #887.14 - vmovupd 2368+__svml_dexpm1_ha_data_internal(%rip), %xmm9 #886.14 + lea __jsvml_dexpm1_ha_data_internal(%rip), %rsi #902.67 + vaddpd 2496+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm2 #898.16 + vmulpd 2432+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm8 #887.14 + vmovupd 2368+__jsvml_dexpm1_ha_data_internal(%rip), %xmm9 #886.14 vfnmadd213pd %xmm12, %xmm13, %xmm9 #886.14 - vandps 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm2, %xmm5 #901.18 - vmovupd 2816+__svml_dexpm1_ha_data_internal(%rip), %xmm10 #890.49 + vandps 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm2, %xmm5 #901.18 + vmovupd 2816+__jsvml_dexpm1_ha_data_internal(%rip), %xmm10 #890.49 vmovd %xmm5, %eax #902.137 vandpd %xmm10, %xmm12, %xmm14 #892.13 - vpand 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm2, %xmm1 #904.17 + vpand 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm2, %xmm1 #904.17 vandnpd %xmm12, %xmm10, %xmm11 #893.14 - vcmpnlepd 2880+__svml_dexpm1_ha_data_internal(%rip), %xmm14, %xmm15 #894.18 + vcmpnlepd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %xmm14, %xmm15 #894.18 vsubpd %xmm8, %xmm9, %xmm7 #888.12 vcmpeqpd %xmm12, %xmm9, %xmm6 #889.20 vmovmskpd %xmm15, %edx #896.44 @@ -426,19 +426,19 @@ __svml_expm12_ha_l9: vpextrd $2, %xmm5, %ecx #902.301 movslq %eax, %rax #902.67 movslq %ecx, %rcx #902.231 - vmovupd 2176+__svml_dexpm1_ha_data_internal(%rip), %xmm1 #914.14 - vfmadd213pd 2240+__svml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm1 #914.14 + vmovupd 2176+__jsvml_dexpm1_ha_data_internal(%rip), %xmm1 #914.14 + vfmadd213pd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm1 #914.14 vmovupd (%rsi,%rax), %xmm3 #902.67 vmovupd (%rsi,%rcx), %xmm4 #902.231 vunpcklpd %xmm4, %xmm3, %xmm0 #902.350 vunpckhpd %xmm4, %xmm3, %xmm14 #902.391 vorpd %xmm15, %xmm0, %xmm5 #907.13 - vmovupd 2048+__svml_dexpm1_ha_data_internal(%rip), %xmm4 #913.14 + vmovupd 2048+__jsvml_dexpm1_ha_data_internal(%rip), %xmm4 #913.14 vandpd %xmm10, %xmm5, %xmm0 #925.163 - vfmadd213pd 2112+__svml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm4 #913.14 - vorpd 2688+__svml_dexpm1_ha_data_internal(%rip), %xmm6, %xmm6 #917.19 + vfmadd213pd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm4 #913.14 + vorpd 2688+__jsvml_dexpm1_ha_data_internal(%rip), %xmm6, %xmm6 #917.19 vandpd %xmm6, %xmm9, %xmm2 #918.13 - vmovupd 2752+__svml_dexpm1_ha_data_internal(%rip), %xmm6 #924.46 + vmovupd 2752+__jsvml_dexpm1_ha_data_internal(%rip), %xmm6 #924.46 vandpd %xmm10, %xmm6, %xmm10 #925.208 vmulpd %xmm7, %xmm7, %xmm7 #915.13 vsubpd %xmm2, %xmm9, %xmm9 #919.13 @@ -520,29 +520,29 @@ __svml_expm12_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #940.546 lea 128(%rsp,%r12,8), %rsi #940.546 -..___tag_value___svml_expm12_ha_l9.61: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #940.546 -..___tag_value___svml_expm12_ha_l9.62: +..___tag_value___jsvml_expm12_ha_l9.61: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #940.546 +..___tag_value___jsvml_expm12_ha_l9.62: jmp ..B3.8 # Prob 100% #940.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm12_ha_l9,@function - .size __svml_expm12_ha_l9,.-__svml_expm12_ha_l9 -..LN__svml_expm12_ha_l9.2: + .type __jsvml_expm12_ha_l9,@function + .size __jsvml_expm12_ha_l9,.-__jsvml_expm12_ha_l9 +..LN__jsvml_expm12_ha_l9.2: .data -# -- End __svml_expm12_ha_l9 +# -- End __jsvml_expm12_ha_l9 .text -.L_2__routine_start___svml_expm11_ha_ex_3: -# -- Begin __svml_expm11_ha_ex +.L_2__routine_start___jsvml_expm11_ha_ex_3: +# -- Begin __jsvml_expm11_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_expm11_ha_ex -# --- __svml_expm11_ha_ex(__m128d) -__svml_expm11_ha_ex: + .globl __jsvml_expm11_ha_ex +# --- __jsvml_expm11_ha_ex(__m128d) +__jsvml_expm11_ha_ex: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -551,7 +551,7 @@ __svml_expm11_ha_ex: .byte 30 #1059.546 .byte 250 #1059.546 .cfi_startproc -..___tag_value___svml_expm11_ha_ex.64: +..___tag_value___jsvml_expm11_ha_ex.64: ..L65: #948.1 pushq %rbp #948.1 @@ -564,53 +564,53 @@ __svml_expm11_ha_ex: movaps %xmm0, %xmm9 #948.1 movaps %xmm9, %xmm15 #1001.12 movaps %xmm9, %xmm8 #1005.14 - mulsd 2304+__svml_dexpm1_ha_data_internal(%rip), %xmm15 #1001.12 - lea __svml_dexpm1_ha_data_internal(%rip), %rdx #1021.17 + mulsd 2304+__jsvml_dexpm1_ha_data_internal(%rip), %xmm15 #1001.12 + lea __jsvml_dexpm1_ha_data_internal(%rip), %rdx #1021.17 movups .L_2il0floatpacket.33(%rip), %xmm10 #1002.107 addpd %xmm10, %xmm15 #1002.297 subpd %xmm10, %xmm15 #1002.342 movaps %xmm15, %xmm11 #1005.34 movaps %xmm15, %xmm10 #1006.14 - mulsd 2368+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1005.34 - addsd 2496+__svml_dexpm1_ha_data_internal(%rip), %xmm15 #1017.16 - mulsd 2432+__svml_dexpm1_ha_data_internal(%rip), %xmm10 #1006.14 + mulsd 2368+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1005.34 + addsd 2496+__jsvml_dexpm1_ha_data_internal(%rip), %xmm15 #1017.16 + mulsd 2432+__jsvml_dexpm1_ha_data_internal(%rip), %xmm10 #1006.14 subsd %xmm11, %xmm8 #1005.14 movaps %xmm8, %xmm7 #1007.12 movaps %xmm8, %xmm1 #1008.20 - movsd 2816+__svml_dexpm1_ha_data_internal(%rip), %xmm0 #1009.18 + movsd 2816+__jsvml_dexpm1_ha_data_internal(%rip), %xmm0 #1009.18 subsd %xmm10, %xmm7 #1007.12 cmpeqsd %xmm9, %xmm1 #1008.20 movaps %xmm0, %xmm12 #1011.13 movaps %xmm0, %xmm6 #1012.14 andps %xmm9, %xmm12 #1011.13 andnps %xmm9, %xmm6 #1012.14 - movsd 2048+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #1032.26 + movsd 2048+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #1032.26 mulsd %xmm7, %xmm3 #1032.26 - cmpnlesd 2880+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1013.18 + cmpnlesd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1013.18 movmskpd %xmm12, %ecx #1015.44 - addsd 2112+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #1032.14 - movsd 2176+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1033.26 + addsd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #1032.14 + movsd 2176+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1033.26 mulsd %xmm7, %xmm12 #1033.26 mulsd %xmm7, %xmm7 #1034.13 - addsd 2240+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1033.14 + addsd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1033.14 mulsd %xmm7, %xmm3 #1039.24 - movsd 2688+__svml_dexpm1_ha_data_internal(%rip), %xmm2 #1036.19 + movsd 2688+__jsvml_dexpm1_ha_data_internal(%rip), %xmm2 #1036.19 addsd %xmm12, %xmm3 #1039.12 orps %xmm1, %xmm2 #1036.19 andps %xmm8, %xmm2 #1037.13 - movq 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #1020.16 + movq 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #1020.16 subsd %xmm2, %xmm8 #1038.13 mulsd %xmm7, %xmm3 #1042.24 subsd %xmm10, %xmm8 #1040.13 pand %xmm15, %xmm13 #1020.16 addsd %xmm8, %xmm3 #1042.12 movd %xmm13, %eax #1021.110 - movq 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm14 #1022.18 + movq 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm14 #1022.18 movaps %xmm0, %xmm8 #1044.163 movslq %eax, %rax #1021.58 pand %xmm14, %xmm15 #1023.15 psllq $41, %xmm15 #1024.15 - movsd 2752+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1043.15 + movsd 2752+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1043.15 andps %xmm11, %xmm0 #1044.208 movaps %xmm11, %xmm7 #1044.346 movups (%rdx,%rax), %xmm4 #1021.58 @@ -681,29 +681,29 @@ __svml_expm11_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1059.546 lea 64(%rsp), %rsi #1059.546 -..___tag_value___svml_expm11_ha_ex.77: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #1059.546 -..___tag_value___svml_expm11_ha_ex.78: +..___tag_value___jsvml_expm11_ha_ex.77: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #1059.546 +..___tag_value___jsvml_expm11_ha_ex.78: jmp ..B4.4 # Prob 100% #1059.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_expm11_ha_ex,@function - .size __svml_expm11_ha_ex,.-__svml_expm11_ha_ex -..LN__svml_expm11_ha_ex.3: + .type __jsvml_expm11_ha_ex,@function + .size __jsvml_expm11_ha_ex,.-__jsvml_expm11_ha_ex +..LN__jsvml_expm11_ha_ex.3: .data -# -- End __svml_expm11_ha_ex +# -- End __jsvml_expm11_ha_ex .text -.L_2__routine_start___svml_expm12_ha_ex_4: -# -- Begin __svml_expm12_ha_ex +.L_2__routine_start___jsvml_expm12_ha_ex_4: +# -- Begin __jsvml_expm12_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_expm12_ha_ex -# --- __svml_expm12_ha_ex(__m128d) -__svml_expm12_ha_ex: + .globl __jsvml_expm12_ha_ex +# --- __jsvml_expm12_ha_ex(__m128d) +__jsvml_expm12_ha_ex: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -712,7 +712,7 @@ __svml_expm12_ha_ex: .byte 30 #1178.546 .byte 250 #1178.546 .cfi_startproc -..___tag_value___svml_expm12_ha_ex.80: +..___tag_value___jsvml_expm12_ha_ex.80: ..L81: #1067.1 pushq %rbp #1067.1 @@ -723,42 +723,42 @@ __svml_expm12_ha_ex: andq $-64, %rsp #1067.1 subq $192, %rsp #1067.1 movaps %xmm0, %xmm9 #1067.1 - movups 2304+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #1120.12 + movups 2304+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #1120.12 movaps %xmm9, %xmm8 #1124.14 mulpd %xmm9, %xmm13 #1120.12 movups .L_2il0floatpacket.33(%rip), %xmm10 #1121.107 - lea __svml_dexpm1_ha_data_internal(%rip), %rsi #1140.67 + lea __jsvml_dexpm1_ha_data_internal(%rip), %rsi #1140.67 addpd %xmm10, %xmm13 #1121.297 subpd %xmm10, %xmm13 #1121.342 - movups 2368+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1122.45 + movups 2368+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1122.45 mulpd %xmm13, %xmm11 #1124.34 - movups 2432+__svml_dexpm1_ha_data_internal(%rip), %xmm0 #1125.14 + movups 2432+__jsvml_dexpm1_ha_data_internal(%rip), %xmm0 #1125.14 mulpd %xmm13, %xmm0 #1125.14 subpd %xmm11, %xmm8 #1124.14 movaps %xmm8, %xmm4 #1126.12 movaps %xmm8, %xmm6 #1127.20 subpd %xmm0, %xmm4 #1126.12 cmpeqpd %xmm9, %xmm6 #1127.20 - movups 2816+__svml_dexpm1_ha_data_internal(%rip), %xmm5 #1128.49 + movups 2816+__jsvml_dexpm1_ha_data_internal(%rip), %xmm5 #1128.49 movaps %xmm5, %xmm12 #1130.13 movaps %xmm5, %xmm7 #1131.14 andps %xmm9, %xmm12 #1130.13 andnps %xmm9, %xmm7 #1131.14 - cmpnlepd 2880+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1132.18 - movups 2048+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1151.26 + cmpnlepd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1132.18 + movups 2048+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1151.26 mulpd %xmm4, %xmm11 #1151.26 movmskpd %xmm12, %edx #1134.44 - movups 2176+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1152.26 - movups 2496+__svml_dexpm1_ha_data_internal(%rip), %xmm10 #1136.16 + movups 2176+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1152.26 + movups 2496+__jsvml_dexpm1_ha_data_internal(%rip), %xmm10 #1136.16 mulpd %xmm4, %xmm12 #1152.26 mulpd %xmm4, %xmm4 #1153.13 - addpd 2112+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1151.14 - addpd 2240+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1152.14 + addpd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1151.14 + addpd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1152.14 addpd %xmm13, %xmm10 #1136.16 mulpd %xmm4, %xmm11 #1158.24 addpd %xmm11, %xmm12 #1158.12 - orps 2688+__svml_dexpm1_ha_data_internal(%rip), %xmm6 #1155.19 - movdqu 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm14 #1139.16 + orps 2688+__jsvml_dexpm1_ha_data_internal(%rip), %xmm6 #1155.19 + movdqu 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm14 #1139.16 andps %xmm8, %xmm6 #1156.13 subpd %xmm6, %xmm8 #1157.13 mulpd %xmm12, %xmm4 #1161.24 @@ -766,11 +766,11 @@ __svml_expm12_ha_ex: pand %xmm10, %xmm14 #1139.16 movd %xmm14, %eax #1140.137 pshufd $2, %xmm14, %xmm15 #1140.317 - movdqu 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #1142.15 + movdqu 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #1142.15 movd %xmm15, %ecx #1140.299 pand %xmm13, %xmm10 #1142.15 psllq $41, %xmm10 #1143.15 - movups 2752+__svml_dexpm1_ha_data_internal(%rip), %xmm14 #1162.46 + movups 2752+__jsvml_dexpm1_ha_data_internal(%rip), %xmm14 #1162.46 movslq %eax, %rax #1140.67 movaps %xmm14, %xmm0 #1163.346 movslq %ecx, %rcx #1140.229 @@ -866,29 +866,29 @@ __svml_expm12_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1178.546 lea 128(%rsp,%r12,8), %rsi #1178.546 -..___tag_value___svml_expm12_ha_ex.98: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #1178.546 -..___tag_value___svml_expm12_ha_ex.99: +..___tag_value___jsvml_expm12_ha_ex.98: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #1178.546 +..___tag_value___jsvml_expm12_ha_ex.99: jmp ..B5.8 # Prob 100% #1178.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm12_ha_ex,@function - .size __svml_expm12_ha_ex,.-__svml_expm12_ha_ex -..LN__svml_expm12_ha_ex.4: + .type __jsvml_expm12_ha_ex,@function + .size __jsvml_expm12_ha_ex,.-__jsvml_expm12_ha_ex +..LN__jsvml_expm12_ha_ex.4: .data -# -- End __svml_expm12_ha_ex +# -- End __jsvml_expm12_ha_ex .text -.L_2__routine_start___svml_expm11_ha_l9_5: -# -- Begin __svml_expm11_ha_l9 +.L_2__routine_start___jsvml_expm11_ha_l9_5: +# -- Begin __jsvml_expm11_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm11_ha_l9 -# --- __svml_expm11_ha_l9(__m128d) -__svml_expm11_ha_l9: + .globl __jsvml_expm11_ha_l9 +# --- __jsvml_expm11_ha_l9(__m128d) +__jsvml_expm11_ha_l9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -897,7 +897,7 @@ __svml_expm11_ha_l9: .byte 30 #1297.546 .byte 250 #1297.546 .cfi_startproc -..___tag_value___svml_expm11_ha_l9.101: +..___tag_value___jsvml_expm11_ha_l9.101: ..L102: #1186.1 pushq %rbp #1186.1 @@ -908,35 +908,35 @@ __svml_expm11_ha_l9: andq $-64, %rsp #1186.1 subq $128, %rsp #1186.1 vmovapd %xmm0, %xmm13 #1186.1 - vmulsd 2304+__svml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm14 #1239.12 - lea __svml_dexpm1_ha_data_internal(%rip), %rdx #1259.17 + vmulsd 2304+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm14 #1239.12 + lea __jsvml_dexpm1_ha_data_internal(%rip), %rdx #1259.17 vroundsd $0, %xmm14, %xmm14, %xmm4 #1240.12 - vmovq 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm5 #1257.22 + vmovq 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm5 #1257.22 vmovapd %xmm4, %xmm9 #1243.14 - vfnmadd132sd 2368+__svml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm9 #1243.14 - vmulsd 2432+__svml_dexpm1_ha_data_internal(%rip), %xmm4, %xmm10 #1244.14 - vaddsd 2496+__svml_dexpm1_ha_data_internal(%rip), %xmm4, %xmm0 #1255.16 + vfnmadd132sd 2368+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13, %xmm9 #1243.14 + vmulsd 2432+__jsvml_dexpm1_ha_data_internal(%rip), %xmm4, %xmm10 #1244.14 + vaddsd 2496+__jsvml_dexpm1_ha_data_internal(%rip), %xmm4, %xmm0 #1255.16 vcmpeqsd %xmm13, %xmm9, %xmm8 #1246.20 vsubsd %xmm10, %xmm9, %xmm7 #1245.12 vpand %xmm5, %xmm0, %xmm2 #1258.18 vmovd %xmm2, %eax #1259.110 - vmovsd 2816+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1247.18 + vmovsd 2816+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1247.18 vandpd %xmm11, %xmm13, %xmm15 #1249.13 vandnpd %xmm13, %xmm11, %xmm12 #1250.14 movslq %eax, %rax #1259.58 - vcmpnlesd 2880+__svml_dexpm1_ha_data_internal(%rip), %xmm15, %xmm6 #1251.18 + vcmpnlesd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %xmm15, %xmm6 #1251.18 vmovsd 8(%rdx,%rax), %xmm1 #1259.58 vunpcklpd %xmm1, %xmm1, %xmm15 #1259.155 - vmovsd 2048+__svml_dexpm1_ha_data_internal(%rip), %xmm5 #1270.14 - vmovsd 2176+__svml_dexpm1_ha_data_internal(%rip), %xmm1 #1271.14 - vmovq 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #1260.20 - vfmadd213sd 2112+__svml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm5 #1270.14 + vmovsd 2048+__jsvml_dexpm1_ha_data_internal(%rip), %xmm5 #1270.14 + vmovsd 2176+__jsvml_dexpm1_ha_data_internal(%rip), %xmm1 #1271.14 + vmovq 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #1260.20 + vfmadd213sd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm5 #1270.14 vpand %xmm3, %xmm0, %xmm14 #1261.17 - vfmadd213sd 2240+__svml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm1 #1271.14 + vfmadd213sd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7, %xmm1 #1271.14 vpsllq $41, %xmm14, %xmm4 #1262.17 vmulsd %xmm7, %xmm7, %xmm3 #1272.13 vmovmskpd %xmm6, %ecx #1253.44 - vmovsd 2688+__svml_dexpm1_ha_data_internal(%rip), %xmm7 #1273.19 + vmovsd 2688+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7 #1273.19 vorpd %xmm8, %xmm7, %xmm8 #1274.19 vandpd %xmm8, %xmm9, %xmm2 #1275.13 vfmadd213sd %xmm1, %xmm3, %xmm5 #1277.12 @@ -946,7 +946,7 @@ __svml_expm11_ha_l9: vmulsd %xmm2, %xmm6, %xmm1 #1279.15 vmulsd %xmm4, %xmm15, %xmm4 #1265.13 vfmadd213sd %xmm10, %xmm3, %xmm5 #1280.12 - vmovsd 2752+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #1281.15 + vmovsd 2752+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #1281.15 vandpd %xmm11, %xmm6, %xmm0 #1282.163 vandpd %xmm11, %xmm3, %xmm11 #1282.208 vmovapd %xmm6, %xmm7 #1282.300 @@ -1005,29 +1005,29 @@ __svml_expm11_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1297.546 lea 64(%rsp), %rsi #1297.546 -..___tag_value___svml_expm11_ha_l9.114: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #1297.546 -..___tag_value___svml_expm11_ha_l9.115: +..___tag_value___jsvml_expm11_ha_l9.114: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #1297.546 +..___tag_value___jsvml_expm11_ha_l9.115: jmp ..B6.4 # Prob 100% #1297.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_expm11_ha_l9,@function - .size __svml_expm11_ha_l9,.-__svml_expm11_ha_l9 -..LN__svml_expm11_ha_l9.5: + .type __jsvml_expm11_ha_l9,@function + .size __jsvml_expm11_ha_l9,.-__jsvml_expm11_ha_l9 +..LN__jsvml_expm11_ha_l9.5: .data -# -- End __svml_expm11_ha_l9 +# -- End __jsvml_expm11_ha_l9 .text -.L_2__routine_start___svml_expm14_ha_e9_6: -# -- Begin __svml_expm14_ha_e9 +.L_2__routine_start___jsvml_expm14_ha_e9_6: +# -- Begin __jsvml_expm14_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm14_ha_e9 -# --- __svml_expm14_ha_e9(__m256d) -__svml_expm14_ha_e9: + .globl __jsvml_expm14_ha_e9 +# --- __jsvml_expm14_ha_e9(__m256d) +__jsvml_expm14_ha_e9: # parameter 1: %ymm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1036,7 +1036,7 @@ __svml_expm14_ha_e9: .byte 30 #1416.552 .byte 250 #1416.552 .cfi_startproc -..___tag_value___svml_expm14_ha_e9.117: +..___tag_value___jsvml_expm14_ha_e9.117: ..L118: #1305.1 pushq %rbp #1305.1 @@ -1046,21 +1046,21 @@ __svml_expm14_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1305.1 subq $192, %rsp #1305.1 - lea __svml_dexpm1_ha_data_internal(%rip), %r8 #1378.68 + lea __jsvml_dexpm1_ha_data_internal(%rip), %r8 #1378.68 vmovapd %ymm0, %ymm6 #1305.1 - vmulpd 2304+__svml_dexpm1_ha_data_internal(%rip), %ymm6, %ymm5 #1358.12 - vmovupd 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1376.26 + vmulpd 2304+__jsvml_dexpm1_ha_data_internal(%rip), %ymm6, %ymm5 #1358.12 + vmovupd 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1376.26 vroundpd $0, %ymm5, %ymm12 #1359.12 - vmulpd 2368+__svml_dexpm1_ha_data_internal(%rip), %ymm12, %ymm4 #1362.37 - vmulpd 2432+__svml_dexpm1_ha_data_internal(%rip), %ymm12, %ymm2 #1363.14 - vaddpd 2496+__svml_dexpm1_ha_data_internal(%rip), %ymm12, %ymm9 #1374.16 + vmulpd 2368+__jsvml_dexpm1_ha_data_internal(%rip), %ymm12, %ymm4 #1362.37 + vmulpd 2432+__jsvml_dexpm1_ha_data_internal(%rip), %ymm12, %ymm2 #1363.14 + vaddpd 2496+__jsvml_dexpm1_ha_data_internal(%rip), %ymm12, %ymm9 #1374.16 vsubpd %ymm4, %ymm6, %ymm3 #1362.14 - vmovupd 2816+__svml_dexpm1_ha_data_internal(%rip), %ymm4 #1366.52 + vmovupd 2816+__jsvml_dexpm1_ha_data_internal(%rip), %ymm4 #1366.52 vsubpd %ymm2, %ymm3, %ymm0 #1364.12 vcmpeqpd %ymm6, %ymm3, %ymm1 #1365.20 vandpd %ymm4, %ymm6, %ymm10 #1368.13 - vcmpnle_uqpd 2880+__svml_dexpm1_ha_data_internal(%rip), %ymm10, %ymm15 #1370.18 - vorpd 2688+__svml_dexpm1_ha_data_internal(%rip), %ymm1, %ymm1 #1393.19 + vcmpnle_uqpd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %ymm10, %ymm15 #1370.18 + vorpd 2688+__jsvml_dexpm1_ha_data_internal(%rip), %ymm1, %ymm1 #1393.19 vandnpd %ymm6, %ymm4, %ymm5 #1369.14 vandps %xmm11, %xmm9, %xmm10 #1377.22 vextractf128 $1, %ymm15, %xmm14 #1371.117 @@ -1085,7 +1085,7 @@ __svml_expm14_ha_e9: vunpckhpd %xmm12, %xmm8, %xmm8 #1378.882 vunpckhpd %xmm7, %xmm11, %xmm7 #1378.915 vinsertf128 $1, %xmm10, %ymm14, %ymm15 #1378.709 - vmovupd 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm10 #1379.24 + vmovupd 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm10 #1379.24 vandps %xmm10, %xmm9, %xmm12 #1380.21 vandps %xmm10, %xmm13, %xmm13 #1380.89 vpsllq $41, %xmm12, %xmm11 #1381.21 @@ -1094,20 +1094,20 @@ __svml_expm14_ha_e9: vpsllq $41, %xmm13, %xmm7 #1381.77 vinsertf128 $1, %xmm7, %ymm11, %ymm9 #1382.16 vmulpd %ymm9, %ymm14, %ymm12 #1384.13 - vmulpd 2048+__svml_dexpm1_ha_data_internal(%rip), %ymm0, %ymm14 #1389.29 - vaddpd 2112+__svml_dexpm1_ha_data_internal(%rip), %ymm14, %ymm7 #1389.14 + vmulpd 2048+__jsvml_dexpm1_ha_data_internal(%rip), %ymm0, %ymm14 #1389.29 + vaddpd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %ymm14, %ymm7 #1389.14 vorpd %ymm9, %ymm15, %ymm13 #1383.13 - vmulpd 2176+__svml_dexpm1_ha_data_internal(%rip), %ymm0, %ymm15 #1390.29 + vmulpd 2176+__jsvml_dexpm1_ha_data_internal(%rip), %ymm0, %ymm15 #1390.29 vandpd %ymm1, %ymm3, %ymm11 #1394.13 vsubpd %ymm11, %ymm3, %ymm9 #1395.13 - vaddpd 2240+__svml_dexpm1_ha_data_internal(%rip), %ymm15, %ymm8 #1390.14 + vaddpd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %ymm15, %ymm8 #1390.14 vmulpd %ymm10, %ymm7, %ymm3 #1396.27 vsubpd %ymm2, %ymm9, %ymm2 #1397.13 vmulpd %ymm11, %ymm13, %ymm9 #1398.15 vaddpd %ymm3, %ymm8, %ymm7 #1396.12 vmulpd %ymm7, %ymm10, %ymm7 #1399.27 vaddpd %ymm7, %ymm2, %ymm8 #1399.12 - vmovupd 2752+__svml_dexpm1_ha_data_internal(%rip), %ymm2 #1400.49 + vmovupd 2752+__jsvml_dexpm1_ha_data_internal(%rip), %ymm2 #1400.49 vandpd %ymm4, %ymm13, %ymm0 #1401.163 vandpd %ymm4, %ymm2, %ymm4 #1401.211 vcmple_oqpd %ymm4, %ymm0, %ymm1 #1401.262 @@ -1187,29 +1187,29 @@ __svml_expm14_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1416.552 lea 128(%rsp,%r12,8), %rsi #1416.552 -..___tag_value___svml_expm14_ha_e9.135: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #1416.552 -..___tag_value___svml_expm14_ha_e9.136: +..___tag_value___jsvml_expm14_ha_e9.135: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #1416.552 +..___tag_value___jsvml_expm14_ha_e9.136: jmp ..B7.8 # Prob 100% #1416.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm14_ha_e9,@function - .size __svml_expm14_ha_e9,.-__svml_expm14_ha_e9 -..LN__svml_expm14_ha_e9.6: + .type __jsvml_expm14_ha_e9,@function + .size __jsvml_expm14_ha_e9,.-__jsvml_expm14_ha_e9 +..LN__jsvml_expm14_ha_e9.6: .data -# -- End __svml_expm14_ha_e9 +# -- End __jsvml_expm14_ha_e9 .text -.L_2__routine_start___svml_expm18_ha_z0_7: -# -- Begin __svml_expm18_ha_z0 +.L_2__routine_start___jsvml_expm18_ha_z0_7: +# -- Begin __jsvml_expm18_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_expm18_ha_z0 -# --- __svml_expm18_ha_z0(__m512d) -__svml_expm18_ha_z0: + .globl __jsvml_expm18_ha_z0 +# --- __jsvml_expm18_ha_z0(__m512d) +__jsvml_expm18_ha_z0: # parameter 1: %zmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1218,7 +1218,7 @@ __svml_expm18_ha_z0: .byte 30 #1536.759 .byte 250 #1536.759 .cfi_startproc -..___tag_value___svml_expm18_ha_z0.138: +..___tag_value___jsvml_expm18_ha_z0.138: ..L139: #1424.1 pushq %rbp #1424.1 @@ -1228,47 +1228,47 @@ __svml_expm18_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #1424.1 subq $192, %rsp #1424.1 - vmovups 256+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm9 #1479.53 - vmovups 320+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm8 #1480.57 - vmovups 512+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm10 #1488.53 - vmovups 576+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm11 #1489.53 - vmovups 640+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm13 #1497.56 - vmovups 384+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm7 #1482.59 - vmovups __svml_dexpm1_ha_data_internal_avx512(%rip), %zmm14 #1493.296 - vmovups 128+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm4 #1494.297 + vmovups 256+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm9 #1479.53 + vmovups 320+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm8 #1480.57 + vmovups 512+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm10 #1488.53 + vmovups 576+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm11 #1489.53 + vmovups 640+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm13 #1497.56 + vmovups 384+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm7 #1482.59 + vmovups __jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm14 #1493.296 + vmovups 128+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm4 #1494.297 vmovaps %zmm0, %zmm6 #1424.1 vfmadd213pd {rn-sae}, %zmm8, %zmm6, %zmm9 #1481.24 - vmovups 704+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm0 #1500.55 + vmovups 704+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm0 #1500.55 vcmppd $21, {sae}, %zmm7, %zmm6, %k0 #1483.27 - vmovups 768+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm7 #1503.61 + vmovups 768+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm7 #1503.61 vsubpd {rn-sae}, %zmm8, %zmm9, %zmm12 #1487.22 - vpermt2pd 64+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm14 #1493.296 - vpermt2pd 192+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm4 #1494.297 - vandpd 448+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm6, %zmm5 #1486.21 + vpermt2pd 64+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm14 #1493.296 + vpermt2pd 192+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm4 #1494.297 + vandpd 448+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm6, %zmm5 #1486.21 vfnmadd213pd {rn-sae}, %zmm6, %zmm12, %zmm10 #1490.21 - vmovups 896+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm8 #1505.61 - vmovups 1024+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm9 #1507.61 + vmovups 896+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm8 #1505.61 + vmovups 1024+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm9 #1507.61 vmaxpd {sae}, %zmm13, %zmm12, %zmm15 #1498.22 kmovw %k0, %esi #1484.48 vscalefpd {rn-sae}, %zmm15, %zmm14, %zmm3 #1499.20 - vmovups 1216+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm15 #1519.53 + vmovups 1216+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm15 #1519.53 vmovaps %zmm11, %zmm2 #1491.19 vfnmadd213pd {rn-sae}, %zmm10, %zmm12, %zmm2 #1491.19 vcmppd $17, {sae}, %zmm15, %zmm3, %k1 #1521.25 vsubpd {rn-sae}, %zmm2, %zmm10, %zmm1 #1495.23 vandpd %zmm0, %zmm2, %zmm2 #1501.19 - vmovups 960+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm10 #1511.21 + vmovups 960+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm10 #1511.21 vfnmadd231pd {rn-sae}, %zmm12, %zmm11, %zmm1 #1496.20 - vmovups 1088+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm11 #1513.21 - vmovups 1152+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm12 #1509.61 + vmovups 1088+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm11 #1513.21 + vmovups 1152+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm12 #1509.61 vfmadd231pd {rn-sae}, %zmm2, %zmm8, %zmm10 #1511.21 vfmadd231pd {rn-sae}, %zmm2, %zmm9, %zmm11 #1513.21 vandpd %zmm0, %zmm1, %zmm13 #1502.20 vmulpd {rn-sae}, %zmm2, %zmm2, %zmm0 #1512.22 - vmovups 832+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm1 #1510.21 + vmovups 832+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm1 #1510.21 vaddpd {rn-sae}, %zmm4, %zmm13, %zmm14 #1517.22 vfmadd231pd {rn-sae}, %zmm2, %zmm7, %zmm1 #1510.21 - vmovups 1280+__svml_dexpm1_ha_data_internal_avx512(%rip), %zmm7 #1520.54 + vmovups 1280+__jsvml_dexpm1_ha_data_internal_avx512(%rip), %zmm7 #1520.54 vfmadd213pd {rn-sae}, %zmm14, %zmm2, %zmm4 #1518.20 vfmadd213pd {rn-sae}, %zmm10, %zmm0, %zmm1 #1514.22 vblendmpd %zmm7, %zmm3, %zmm8{%k1} #1522.19 @@ -1396,29 +1396,29 @@ __svml_expm18_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #1536.759 lea 128(%rsp,%rbx,8), %rsi #1536.759 -..___tag_value___svml_expm18_ha_z0.166: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #1536.759 -..___tag_value___svml_expm18_ha_z0.167: +..___tag_value___jsvml_expm18_ha_z0.166: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #1536.759 +..___tag_value___jsvml_expm18_ha_z0.167: jmp ..B8.13 # Prob 100% #1536.759 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_expm18_ha_z0,@function - .size __svml_expm18_ha_z0,.-__svml_expm18_ha_z0 -..LN__svml_expm18_ha_z0.7: + .type __jsvml_expm18_ha_z0,@function + .size __jsvml_expm18_ha_z0,.-__jsvml_expm18_ha_z0 +..LN__jsvml_expm18_ha_z0.7: .data -# -- End __svml_expm18_ha_z0 +# -- End __jsvml_expm18_ha_z0 .text -.L_2__routine_start___svml_expm11_ha_e9_8: -# -- Begin __svml_expm11_ha_e9 +.L_2__routine_start___jsvml_expm11_ha_e9_8: +# -- Begin __jsvml_expm11_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm11_ha_e9 -# --- __svml_expm11_ha_e9(__m128d) -__svml_expm11_ha_e9: + .globl __jsvml_expm11_ha_e9 +# --- __jsvml_expm11_ha_e9(__m128d) +__jsvml_expm11_ha_e9: # parameter 1: %xmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1427,7 +1427,7 @@ __svml_expm11_ha_e9: .byte 30 #1655.546 .byte 250 #1655.546 .cfi_startproc -..___tag_value___svml_expm11_ha_e9.169: +..___tag_value___jsvml_expm11_ha_e9.169: ..L170: #1544.1 pushq %rbp #1544.1 @@ -1440,39 +1440,39 @@ __svml_expm11_ha_e9: movaps %xmm0, %xmm10 #1544.1 movaps %xmm10, %xmm15 #1597.12 movaps %xmm10, %xmm9 #1601.14 - mulsd 2304+__svml_dexpm1_ha_data_internal(%rip), %xmm15 #1597.12 - lea __svml_dexpm1_ha_data_internal(%rip), %rdx #1617.17 + mulsd 2304+__jsvml_dexpm1_ha_data_internal(%rip), %xmm15 #1597.12 + lea __jsvml_dexpm1_ha_data_internal(%rip), %rdx #1617.17 roundsd $0, %xmm15, %xmm15 #1598.12 movaps %xmm15, %xmm11 #1601.34 - mulsd 2368+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1601.34 - movsd 2048+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #1628.26 + mulsd 2368+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1601.34 + movsd 2048+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #1628.26 subsd %xmm11, %xmm9 #1601.14 movaps %xmm15, %xmm11 #1602.14 movaps %xmm9, %xmm7 #1603.12 - mulsd 2432+__svml_dexpm1_ha_data_internal(%rip), %xmm11 #1602.14 + mulsd 2432+__jsvml_dexpm1_ha_data_internal(%rip), %xmm11 #1602.14 movaps %xmm9, %xmm1 #1604.20 - addsd 2496+__svml_dexpm1_ha_data_internal(%rip), %xmm15 #1613.16 + addsd 2496+__jsvml_dexpm1_ha_data_internal(%rip), %xmm15 #1613.16 cmpeqsd %xmm10, %xmm1 #1604.20 subsd %xmm11, %xmm7 #1603.12 mulsd %xmm7, %xmm3 #1628.26 - movsd 2176+__svml_dexpm1_ha_data_internal(%rip), %xmm0 #1629.26 + movsd 2176+__jsvml_dexpm1_ha_data_internal(%rip), %xmm0 #1629.26 mulsd %xmm7, %xmm0 #1629.26 - addsd 2112+__svml_dexpm1_ha_data_internal(%rip), %xmm3 #1628.14 + addsd 2112+__jsvml_dexpm1_ha_data_internal(%rip), %xmm3 #1628.14 mulsd %xmm7, %xmm7 #1630.13 - addsd 2240+__svml_dexpm1_ha_data_internal(%rip), %xmm0 #1629.14 + addsd 2240+__jsvml_dexpm1_ha_data_internal(%rip), %xmm0 #1629.14 mulsd %xmm7, %xmm3 #1635.24 - movq 2560+__svml_dexpm1_ha_data_internal(%rip), %xmm13 #1616.22 + movq 2560+__jsvml_dexpm1_ha_data_internal(%rip), %xmm13 #1616.22 addsd %xmm0, %xmm3 #1635.12 pand %xmm15, %xmm13 #1616.22 movd %xmm13, %eax #1617.110 - movsd 2816+__svml_dexpm1_ha_data_internal(%rip), %xmm6 #1605.18 - movsd 2688+__svml_dexpm1_ha_data_internal(%rip), %xmm2 #1632.19 + movsd 2816+__jsvml_dexpm1_ha_data_internal(%rip), %xmm6 #1605.18 + movsd 2688+__jsvml_dexpm1_ha_data_internal(%rip), %xmm2 #1632.19 movaps %xmm6, %xmm12 #1607.13 orps %xmm1, %xmm2 #1632.19 andps %xmm10, %xmm12 #1607.13 movslq %eax, %rax #1617.58 andps %xmm9, %xmm2 #1633.13 - movq 2624+__svml_dexpm1_ha_data_internal(%rip), %xmm14 #1618.24 + movq 2624+__jsvml_dexpm1_ha_data_internal(%rip), %xmm14 #1618.24 movaps %xmm6, %xmm0 #1640.163 pand %xmm14, %xmm15 #1619.21 movaps %xmm6, %xmm8 #1608.14 @@ -1481,10 +1481,10 @@ __svml_expm11_ha_e9: movups (%rdx,%rax), %xmm5 #1617.58 subsd %xmm2, %xmm9 #1634.13 mulsd %xmm7, %xmm3 #1638.24 - cmpnlesd 2880+__svml_dexpm1_ha_data_internal(%rip), %xmm12 #1609.18 + cmpnlesd 2880+__jsvml_dexpm1_ha_data_internal(%rip), %xmm12 #1609.18 subsd %xmm11, %xmm9 #1636.13 movmskpd %xmm12, %ecx #1611.44 - movsd 2752+__svml_dexpm1_ha_data_internal(%rip), %xmm7 #1639.15 + movsd 2752+__jsvml_dexpm1_ha_data_internal(%rip), %xmm7 #1639.15 orps %xmm15, %xmm5 #1622.13 andps %xmm5, %xmm0 #1640.163 andps %xmm7, %xmm6 #1640.208 @@ -1550,30 +1550,30 @@ __svml_expm11_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1655.546 lea 64(%rsp), %rsi #1655.546 -..___tag_value___svml_expm11_ha_e9.182: -# __svml_dexpm1_ha_cout_rare_internal(const double *, double *) - call __svml_dexpm1_ha_cout_rare_internal #1655.546 -..___tag_value___svml_expm11_ha_e9.183: +..___tag_value___jsvml_expm11_ha_e9.182: +# __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) + call __jsvml_dexpm1_ha_cout_rare_internal #1655.546 +..___tag_value___jsvml_expm11_ha_e9.183: jmp ..B9.4 # Prob 100% #1655.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_expm11_ha_e9,@function - .size __svml_expm11_ha_e9,.-__svml_expm11_ha_e9 -..LN__svml_expm11_ha_e9.8: + .type __jsvml_expm11_ha_e9,@function + .size __jsvml_expm11_ha_e9,.-__jsvml_expm11_ha_e9 +..LN__jsvml_expm11_ha_e9.8: .data -# -- End __svml_expm11_ha_e9 +# -- End __jsvml_expm11_ha_e9 .text -.L_2__routine_start___svml_dexpm1_ha_cout_rare_internal_9: -# -- Begin __svml_dexpm1_ha_cout_rare_internal +.L_2__routine_start___jsvml_dexpm1_ha_cout_rare_internal_9: +# -- Begin __jsvml_dexpm1_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dexpm1_ha_cout_rare_internal - .globl __svml_dexpm1_ha_cout_rare_internal -# --- __svml_dexpm1_ha_cout_rare_internal(const double *, double *) -__svml_dexpm1_ha_cout_rare_internal: + .hidden __jsvml_dexpm1_ha_cout_rare_internal + .globl __jsvml_dexpm1_ha_cout_rare_internal +# --- __jsvml_dexpm1_ha_cout_rare_internal(const double *, double *) +__jsvml_dexpm1_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1583,7 +1583,7 @@ __svml_dexpm1_ha_cout_rare_internal: .byte 30 #817.15 .byte 250 #817.15 .cfi_startproc -..___tag_value___svml_dexpm1_ha_cout_rare_internal.185: +..___tag_value___jsvml_dexpm1_ha_cout_rare_internal.185: ..L186: #718.1 xorl %eax, %eax #719.14 @@ -1831,17 +1831,17 @@ __svml_dexpm1_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dexpm1_ha_cout_rare_internal,@function - .size __svml_dexpm1_ha_cout_rare_internal,.-__svml_dexpm1_ha_cout_rare_internal -..LN__svml_dexpm1_ha_cout_rare_internal.9: + .type __jsvml_dexpm1_ha_cout_rare_internal,@function + .size __jsvml_dexpm1_ha_cout_rare_internal,.-__jsvml_dexpm1_ha_cout_rare_internal +..LN__jsvml_dexpm1_ha_cout_rare_internal.9: .data -# -- End __svml_dexpm1_ha_cout_rare_internal +# -- End __jsvml_dexpm1_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dexpm1_ha_data_internal_avx512 - .globl __svml_dexpm1_ha_data_internal_avx512 -__svml_dexpm1_ha_data_internal_avx512: + .hidden __jsvml_dexpm1_ha_data_internal_avx512 + .globl __jsvml_dexpm1_ha_data_internal_avx512 +__jsvml_dexpm1_ha_data_internal_avx512: .long 0 .long 1072693248 .long 1828292879 @@ -2178,12 +2178,12 @@ __svml_dexpm1_ha_data_internal_avx512: .long 3220176896 .long 0 .long 3220176896 - .type __svml_dexpm1_ha_data_internal_avx512,@object - .size __svml_dexpm1_ha_data_internal_avx512,1344 + .type __jsvml_dexpm1_ha_data_internal_avx512,@object + .size __jsvml_dexpm1_ha_data_internal_avx512,1344 .align 64 - .hidden __svml_dexpm1_ha_data_internal - .globl __svml_dexpm1_ha_data_internal -__svml_dexpm1_ha_data_internal: + .hidden __jsvml_dexpm1_ha_data_internal + .globl __jsvml_dexpm1_ha_data_internal +__jsvml_dexpm1_ha_data_internal: .long 0 .long 0 .long 0 @@ -2984,8 +2984,8 @@ __svml_dexpm1_ha_data_internal: .long 0 .long 2096128 .long 0 - .type __svml_dexpm1_ha_data_internal,@object - .size __svml_dexpm1_ha_data_internal,3200 + .type __jsvml_dexpm1_ha_data_internal,@object + .size __jsvml_dexpm1_ha_data_internal,3200 .align 32 _imldExpHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_hypot_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_hypot_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_hypot_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_hypot_linux_x86.S index 80edd7c7dde..33643b1f75a 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_hypot_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_hypot_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_hypot.c" .text ..TXTST0: -.L_2__routine_start___svml_hypot2_ha_e9_0: -# -- Begin __svml_hypot2_ha_e9 +.L_2__routine_start___jsvml_hypot2_ha_e9_0: +# -- Begin __jsvml_hypot2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot2_ha_e9 -# --- __svml_hypot2_ha_e9(__m128d, __m128d) -__svml_hypot2_ha_e9: + .globl __jsvml_hypot2_ha_e9 +# --- __jsvml_hypot2_ha_e9(__m128d, __m128d) +__jsvml_hypot2_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B1.1: # Preds ..B1.0 @@ -48,7 +48,7 @@ __svml_hypot2_ha_e9: .byte 30 #221.663 .byte 250 #221.663 .cfi_startproc -..___tag_value___svml_hypot2_ha_e9.1: +..___tag_value___jsvml_hypot2_ha_e9.1: ..L2: #119.1 pushq %rbp #119.1 @@ -59,7 +59,7 @@ __svml_hypot2_ha_e9: andq $-64, %rsp #119.1 subq $256, %rsp #119.1 movaps %xmm1, %xmm3 #119.1 - movups 64+__svml_dhypot_ha_data_internal(%rip), %xmm4 #152.47 + movups 64+__jsvml_dhypot_ha_data_internal(%rip), %xmm4 #152.47 movaps %xmm4, %xmm5 #159.18 andps %xmm3, %xmm4 #160.18 andps %xmm0, %xmm5 #159.18 @@ -70,10 +70,10 @@ __svml_hypot2_ha_e9: movaps %xmm12, %xmm2 #163.150 pshufd $221, %xmm4, %xmm6 #177.20 movaps %xmm4, %xmm13 #184.150 - movq 512+__svml_dhypot_ha_data_internal(%rip), %xmm7 #173.33 + movq 512+__jsvml_dhypot_ha_data_internal(%rip), %xmm7 #173.33 psubd %xmm6, %xmm8 #178.24 pcmpgtd %xmm7, %xmm8 #179.24 - movups __svml_dhypot_ha_data_internal(%rip), %xmm9 #151.48 + movups __jsvml_dhypot_ha_data_internal(%rip), %xmm9 #151.48 pshufd $80, %xmm8, %xmm14 #180.24 movaps %xmm9, %xmm11 #163.105 andnps %xmm9, %xmm14 #182.21 @@ -103,25 +103,25 @@ __svml_hypot2_ha_e9: mulpd %xmm12, %xmm9 #208.10 mulpd %xmm9, %xmm11 #209.23 mulpd %xmm2, %xmm9 #210.23 - subpd 128+__svml_dhypot_ha_data_internal(%rip), %xmm11 #209.11 + subpd 128+__jsvml_dhypot_ha_data_internal(%rip), %xmm11 #209.11 mulpd %xmm12, %xmm2 #218.25 addpd %xmm9, %xmm11 #210.11 - movups 192+__svml_dhypot_ha_data_internal(%rip), %xmm10 #211.23 + movups 192+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #211.23 mulpd %xmm11, %xmm10 #211.23 - addpd 256+__svml_dhypot_ha_data_internal(%rip), %xmm10 #211.11 + addpd 256+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #211.11 mulpd %xmm11, %xmm10 #212.23 - addpd 320+__svml_dhypot_ha_data_internal(%rip), %xmm10 #212.11 + addpd 320+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #212.11 mulpd %xmm11, %xmm10 #213.23 - addpd 384+__svml_dhypot_ha_data_internal(%rip), %xmm10 #213.11 + addpd 384+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #213.11 mulpd %xmm11, %xmm10 #214.23 - addpd 448+__svml_dhypot_ha_data_internal(%rip), %xmm10 #214.11 + addpd 448+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #214.11 mulpd %xmm10, %xmm11 #215.9 mulpd %xmm12, %xmm11 #216.9 mulpd %xmm1, %xmm12 #219.24 pshufd $221, %xmm13, %xmm4 #200.18 mulpd %xmm11, %xmm13 #217.9 - movq 640+__svml_dhypot_ha_data_internal(%rip), %xmm15 #198.26 - movq 576+__svml_dhypot_ha_data_internal(%rip), %xmm5 #201.25 + movq 640+__jsvml_dhypot_ha_data_internal(%rip), %xmm15 #198.26 + movq 576+__jsvml_dhypot_ha_data_internal(%rip), %xmm5 #201.25 pcmpgtd %xmm4, %xmm5 #201.25 pcmpgtd %xmm15, %xmm4 #202.26 addpd %xmm2, %xmm13 #218.13 @@ -186,29 +186,29 @@ __svml_hypot2_ha_e9: lea 64(%rsp,%r12,8), %rdi #221.663 lea 128(%rsp,%r12,8), %rsi #221.663 lea 192(%rsp,%r12,8), %rdx #221.663 -..___tag_value___svml_hypot2_ha_e9.19: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #221.663 -..___tag_value___svml_hypot2_ha_e9.20: +..___tag_value___jsvml_hypot2_ha_e9.19: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #221.663 +..___tag_value___jsvml_hypot2_ha_e9.20: jmp ..B1.8 # Prob 100% #221.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypot2_ha_e9,@function - .size __svml_hypot2_ha_e9,.-__svml_hypot2_ha_e9 -..LN__svml_hypot2_ha_e9.0: + .type __jsvml_hypot2_ha_e9,@function + .size __jsvml_hypot2_ha_e9,.-__jsvml_hypot2_ha_e9 +..LN__jsvml_hypot2_ha_e9.0: .data -# -- End __svml_hypot2_ha_e9 +# -- End __jsvml_hypot2_ha_e9 .text -.L_2__routine_start___svml_hypot4_ha_e9_1: -# -- Begin __svml_hypot4_ha_e9 +.L_2__routine_start___jsvml_hypot4_ha_e9_1: +# -- Begin __jsvml_hypot4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot4_ha_e9 -# --- __svml_hypot4_ha_e9(__m256d, __m256d) -__svml_hypot4_ha_e9: + .globl __jsvml_hypot4_ha_e9 +# --- __jsvml_hypot4_ha_e9(__m256d, __m256d) +__jsvml_hypot4_ha_e9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B2.1: # Preds ..B2.0 @@ -218,7 +218,7 @@ __svml_hypot4_ha_e9: .byte 30 #331.672 .byte 250 #331.672 .cfi_startproc -..___tag_value___svml_hypot4_ha_e9.22: +..___tag_value___jsvml_hypot4_ha_e9.22: ..L23: #229.1 pushq %rbp #229.1 @@ -228,8 +228,8 @@ __svml_hypot4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #229.1 subq $256, %rsp #229.1 - vmovupd 64+__svml_dhypot_ha_data_internal(%rip), %ymm11 #262.50 - vmovupd __svml_dhypot_ha_data_internal(%rip), %ymm9 #261.51 + vmovupd 64+__jsvml_dhypot_ha_data_internal(%rip), %ymm11 #262.50 + vmovupd __jsvml_dhypot_ha_data_internal(%rip), %ymm9 #261.51 vmovapd %ymm1, %ymm10 #229.1 vandpd %ymm11, %ymm0, %ymm13 #269.18 vandpd %ymm11, %ymm10, %ymm12 #270.18 @@ -242,13 +242,13 @@ __svml_hypot4_ha_e9: vshufps $221, %xmm14, %xmm8, %xmm4 #286.38 vshufps $221, %xmm15, %xmm5, %xmm1 #287.38 vpsubd %xmm1, %xmm4, %xmm3 #288.24 - vpcmpgtd 512+__svml_dhypot_ha_data_internal(%rip), %xmm3, %xmm11 #289.24 + vpcmpgtd 512+__jsvml_dhypot_ha_data_internal(%rip), %xmm3, %xmm11 #289.24 vpshufd $80, %xmm11, %xmm2 #290.24 vpshufd $250, %xmm11, %xmm12 #290.104 vmulpd %ymm6, %ymm6, %ymm14 #295.13 vaddpd %ymm6, %ymm8, %ymm6 #297.13 vmulpd %ymm6, %ymm7, %ymm7 #298.13 - vmovups 576+__svml_dhypot_ha_data_internal(%rip), %xmm6 #307.25 + vmovups 576+__jsvml_dhypot_ha_data_internal(%rip), %xmm6 #307.25 vinsertf128 $1, %xmm12, %ymm2, %ymm13 #291.17 vandnpd %ymm9, %ymm13, %ymm9 #292.21 vandpd %ymm9, %ymm5, %ymm1 #294.105 @@ -266,7 +266,7 @@ __svml_hypot4_ha_e9: vcvtps2pd %xmm1, %ymm1 #317.9 vshufps $221, %xmm5, %xmm2, %xmm7 #310.36 vpcmpgtd %xmm7, %xmm6, %xmm8 #311.25 - vpcmpgtd 640+__svml_dhypot_ha_data_internal(%rip), %xmm7, %xmm9 #312.26 + vpcmpgtd 640+__jsvml_dhypot_ha_data_internal(%rip), %xmm7, %xmm9 #312.26 vmulpd %ymm1, %ymm1, %ymm6 #318.10 vpor %xmm9, %xmm8, %xmm11 #313.18 vpshufd $80, %xmm11, %xmm12 #314.18 @@ -277,16 +277,16 @@ __svml_hypot4_ha_e9: vmulpd %ymm6, %ymm3, %ymm8 #320.26 vmulpd %ymm3, %ymm1, %ymm3 #328.28 vmulpd %ymm4, %ymm1, %ymm4 #329.27 - vsubpd 128+__svml_dhypot_ha_data_internal(%rip), %ymm5, %ymm7 #319.11 + vsubpd 128+__jsvml_dhypot_ha_data_internal(%rip), %ymm5, %ymm7 #319.11 vaddpd %ymm8, %ymm7, %ymm5 #320.11 - vmulpd 192+__svml_dhypot_ha_data_internal(%rip), %ymm5, %ymm9 #321.26 - vaddpd 256+__svml_dhypot_ha_data_internal(%rip), %ymm9, %ymm11 #321.11 + vmulpd 192+__jsvml_dhypot_ha_data_internal(%rip), %ymm5, %ymm9 #321.26 + vaddpd 256+__jsvml_dhypot_ha_data_internal(%rip), %ymm9, %ymm11 #321.11 vmulpd %ymm11, %ymm5, %ymm12 #322.26 - vaddpd 320+__svml_dhypot_ha_data_internal(%rip), %ymm12, %ymm13 #322.11 + vaddpd 320+__jsvml_dhypot_ha_data_internal(%rip), %ymm12, %ymm13 #322.11 vmulpd %ymm13, %ymm5, %ymm14 #323.26 - vaddpd 384+__svml_dhypot_ha_data_internal(%rip), %ymm14, %ymm15 #323.11 + vaddpd 384+__jsvml_dhypot_ha_data_internal(%rip), %ymm14, %ymm15 #323.11 vmulpd %ymm15, %ymm5, %ymm9 #324.26 - vaddpd 448+__svml_dhypot_ha_data_internal(%rip), %ymm9, %ymm6 #324.11 + vaddpd 448+__jsvml_dhypot_ha_data_internal(%rip), %ymm9, %ymm6 #324.11 vmulpd %ymm6, %ymm5, %ymm7 #325.9 vmulpd %ymm7, %ymm1, %ymm8 #326.9 vmulpd %ymm8, %ymm2, %ymm2 #327.9 @@ -354,29 +354,29 @@ __svml_hypot4_ha_e9: lea 64(%rsp,%r12,8), %rdi #331.672 lea 128(%rsp,%r12,8), %rsi #331.672 lea 192(%rsp,%r12,8), %rdx #331.672 -..___tag_value___svml_hypot4_ha_e9.40: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #331.672 -..___tag_value___svml_hypot4_ha_e9.41: +..___tag_value___jsvml_hypot4_ha_e9.40: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #331.672 +..___tag_value___jsvml_hypot4_ha_e9.41: jmp ..B2.8 # Prob 100% #331.672 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypot4_ha_e9,@function - .size __svml_hypot4_ha_e9,.-__svml_hypot4_ha_e9 -..LN__svml_hypot4_ha_e9.1: + .type __jsvml_hypot4_ha_e9,@function + .size __jsvml_hypot4_ha_e9,.-__jsvml_hypot4_ha_e9 +..LN__jsvml_hypot4_ha_e9.1: .data -# -- End __svml_hypot4_ha_e9 +# -- End __jsvml_hypot4_ha_e9 .text -.L_2__routine_start___svml_hypot1_ha_l9_2: -# -- Begin __svml_hypot1_ha_l9 +.L_2__routine_start___jsvml_hypot1_ha_l9_2: +# -- Begin __jsvml_hypot1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot1_ha_l9 -# --- __svml_hypot1_ha_l9(__m128d, __m128d) -__svml_hypot1_ha_l9: + .globl __jsvml_hypot1_ha_l9 +# --- __jsvml_hypot1_ha_l9(__m128d, __m128d) +__jsvml_hypot1_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B3.1: # Preds ..B3.0 @@ -386,7 +386,7 @@ __svml_hypot1_ha_l9: .byte 30 #441.663 .byte 250 #441.663 .cfi_startproc -..___tag_value___svml_hypot1_ha_l9.43: +..___tag_value___jsvml_hypot1_ha_l9.43: ..L44: #339.1 pushq %rbp #339.1 @@ -397,7 +397,7 @@ __svml_hypot1_ha_l9: andq $-64, %rsp #339.1 subq $192, %rsp #339.1 vmovapd %xmm1, %xmm9 #339.1 - vmovsd 64+__svml_dhypot_ha_data_internal(%rip), %xmm10 #372.16 + vmovsd 64+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #372.16 vmovapd %xmm0, %xmm8 #339.1 vandpd %xmm10, %xmm8, %xmm11 #379.18 vandpd %xmm10, %xmm9, %xmm12 #380.18 @@ -411,7 +411,7 @@ __svml_hypot1_ha_l9: vmovd %eax, %xmm1 #399.20 vpshufd $85, %xmm5, %xmm0 #397.16 movl $1141899264, %ecx #422.22 - vmovsd __svml_dhypot_ha_data_internal(%rip), %xmm7 #371.17 + vmovsd __jsvml_dhypot_ha_data_internal(%rip), %xmm7 #371.17 vpsubd %xmm0, %xmm15, %xmm2 #398.20 vandpd %xmm7, %xmm6, %xmm3 #383.105 vpcmpgtd %xmm1, %xmm2, %xmm10 #399.20 @@ -442,15 +442,15 @@ __svml_hypot1_ha_l9: vmovapd %xmm2, %xmm3 #430.11 vcvtps2pd %xmm11, %xmm4 #427.9 vmulsd %xmm4, %xmm4, %xmm12 #428.10 - vfmsub213sd 128+__svml_dhypot_ha_data_internal(%rip), %xmm12, %xmm13 #429.11 + vfmsub213sd 128+__jsvml_dhypot_ha_data_internal(%rip), %xmm12, %xmm13 #429.11 vpshufd $0, %xmm5, %xmm6 #424.18 vmovmskpd %xmm6, %eax #425.42 vfmadd213sd %xmm13, %xmm12, %xmm3 #430.11 - vmovsd 192+__svml_dhypot_ha_data_internal(%rip), %xmm12 #431.11 - vfmadd213sd 256+__svml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #431.11 - vfmadd213sd 320+__svml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #432.11 - vfmadd213sd 384+__svml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #433.11 - vfmadd213sd 448+__svml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #434.11 + vmovsd 192+__jsvml_dhypot_ha_data_internal(%rip), %xmm12 #431.11 + vfmadd213sd 256+__jsvml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #431.11 + vfmadd213sd 320+__jsvml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #432.11 + vfmadd213sd 384+__jsvml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #433.11 + vfmadd213sd 448+__jsvml_dhypot_ha_data_internal(%rip), %xmm3, %xmm12 #434.11 vmulsd %xmm3, %xmm12, %xmm14 #435.9 vmulsd %xmm4, %xmm14, %xmm15 #436.9 vmulsd %xmm1, %xmm15, %xmm1 #437.9 @@ -496,29 +496,29 @@ __svml_hypot1_ha_l9: lea (%rsp), %rdi #441.663 lea 64(%rsp), %rsi #441.663 lea 128(%rsp), %rdx #441.663 -..___tag_value___svml_hypot1_ha_l9.56: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #441.663 -..___tag_value___svml_hypot1_ha_l9.57: +..___tag_value___jsvml_hypot1_ha_l9.56: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #441.663 +..___tag_value___jsvml_hypot1_ha_l9.57: jmp ..B3.4 # Prob 100% #441.663 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_hypot1_ha_l9,@function - .size __svml_hypot1_ha_l9,.-__svml_hypot1_ha_l9 -..LN__svml_hypot1_ha_l9.2: + .type __jsvml_hypot1_ha_l9,@function + .size __jsvml_hypot1_ha_l9,.-__jsvml_hypot1_ha_l9 +..LN__jsvml_hypot1_ha_l9.2: .data -# -- End __svml_hypot1_ha_l9 +# -- End __jsvml_hypot1_ha_l9 .text -.L_2__routine_start___svml_hypot2_ha_l9_3: -# -- Begin __svml_hypot2_ha_l9 +.L_2__routine_start___jsvml_hypot2_ha_l9_3: +# -- Begin __jsvml_hypot2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot2_ha_l9 -# --- __svml_hypot2_ha_l9(__m128d, __m128d) -__svml_hypot2_ha_l9: + .globl __jsvml_hypot2_ha_l9 +# --- __jsvml_hypot2_ha_l9(__m128d, __m128d) +__jsvml_hypot2_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B4.1: # Preds ..B4.0 @@ -528,7 +528,7 @@ __svml_hypot2_ha_l9: .byte 30 #551.663 .byte 250 #551.663 .cfi_startproc -..___tag_value___svml_hypot2_ha_l9.59: +..___tag_value___jsvml_hypot2_ha_l9.59: ..L60: #449.1 pushq %rbp #449.1 @@ -539,7 +539,7 @@ __svml_hypot2_ha_l9: andq $-64, %rsp #449.1 subq $256, %rsp #449.1 vmovapd %xmm1, %xmm8 #449.1 - vmovupd 64+__svml_dhypot_ha_data_internal(%rip), %xmm9 #482.47 + vmovupd 64+__jsvml_dhypot_ha_data_internal(%rip), %xmm9 #482.47 vmovapd %xmm0, %xmm7 #449.1 vandpd %xmm9, %xmm7, %xmm11 #489.18 vandpd %xmm9, %xmm8, %xmm10 #490.18 @@ -547,9 +547,9 @@ __svml_hypot2_ha_l9: vminpd %xmm11, %xmm10, %xmm5 #492.11 vpshufd $221, %xmm6, %xmm12 #506.16 vpshufd $221, %xmm5, %xmm13 #507.16 - vmovupd __svml_dhypot_ha_data_internal(%rip), %xmm1 #481.48 + vmovupd __jsvml_dhypot_ha_data_internal(%rip), %xmm1 #481.48 vpsubd %xmm13, %xmm12, %xmm14 #508.20 - vmovq 512+__svml_dhypot_ha_data_internal(%rip), %xmm15 #503.29 + vmovq 512+__jsvml_dhypot_ha_data_internal(%rip), %xmm15 #503.29 vandpd %xmm1, %xmm6, %xmm3 #493.105 vpcmpgtd %xmm15, %xmm14, %xmm0 #509.20 vsubpd %xmm3, %xmm6, %xmm4 #493.150 @@ -561,12 +561,12 @@ __svml_hypot2_ha_l9: vandpd %xmm9, %xmm5, %xmm10 #514.105 vsubpd %xmm10, %xmm5, %xmm2 #514.150 vfmadd231pd %xmm10, %xmm10, %xmm0 #516.13 - vmovq 640+__svml_dhypot_ha_data_internal(%rip), %xmm11 #528.22 + vmovq 640+__jsvml_dhypot_ha_data_internal(%rip), %xmm11 #528.22 vfmadd231pd %xmm2, %xmm5, %xmm4 #519.13 - vmovq 576+__svml_dhypot_ha_data_internal(%rip), %xmm5 #527.21 - vmovupd 128+__svml_dhypot_ha_data_internal(%rip), %xmm9 #539.11 + vmovq 576+__jsvml_dhypot_ha_data_internal(%rip), %xmm5 #527.21 + vmovupd 128+__jsvml_dhypot_ha_data_internal(%rip), %xmm9 #539.11 vfmadd213pd %xmm4, %xmm10, %xmm2 #520.13 - vmovupd 192+__svml_dhypot_ha_data_internal(%rip), %xmm10 #541.11 + vmovupd 192+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #541.11 vaddpd %xmm2, %xmm0, %xmm1 #521.11 vcvtpd2ps %xmm1, %xmm3 #537.51 vpshufd $221, %xmm1, %xmm6 #530.14 @@ -581,10 +581,10 @@ __svml_hypot2_ha_l9: vpshufd $80, %xmm14, %xmm15 #534.18 vmovmskpd %xmm15, %edx #535.42 vfmadd231pd %xmm2, %xmm6, %xmm9 #540.11 - vfmadd213pd 256+__svml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #541.11 - vfmadd213pd 320+__svml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #542.11 - vfmadd213pd 384+__svml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #543.11 - vfmadd213pd 448+__svml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #544.11 + vfmadd213pd 256+__jsvml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #541.11 + vfmadd213pd 320+__jsvml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #542.11 + vfmadd213pd 384+__jsvml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #543.11 + vfmadd213pd 448+__jsvml_dhypot_ha_data_internal(%rip), %xmm9, %xmm10 #544.11 vmulpd %xmm10, %xmm9, %xmm11 #545.9 vmulpd %xmm11, %xmm13, %xmm12 #546.9 vmulpd %xmm12, %xmm1, %xmm1 #547.9 @@ -647,29 +647,29 @@ __svml_hypot2_ha_l9: lea 64(%rsp,%r12,8), %rdi #551.663 lea 128(%rsp,%r12,8), %rsi #551.663 lea 192(%rsp,%r12,8), %rdx #551.663 -..___tag_value___svml_hypot2_ha_l9.77: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #551.663 -..___tag_value___svml_hypot2_ha_l9.78: +..___tag_value___jsvml_hypot2_ha_l9.77: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #551.663 +..___tag_value___jsvml_hypot2_ha_l9.78: jmp ..B4.8 # Prob 100% #551.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypot2_ha_l9,@function - .size __svml_hypot2_ha_l9,.-__svml_hypot2_ha_l9 -..LN__svml_hypot2_ha_l9.3: + .type __jsvml_hypot2_ha_l9,@function + .size __jsvml_hypot2_ha_l9,.-__jsvml_hypot2_ha_l9 +..LN__jsvml_hypot2_ha_l9.3: .data -# -- End __svml_hypot2_ha_l9 +# -- End __jsvml_hypot2_ha_l9 .text -.L_2__routine_start___svml_hypot4_ha_l9_4: -# -- Begin __svml_hypot4_ha_l9 +.L_2__routine_start___jsvml_hypot4_ha_l9_4: +# -- Begin __jsvml_hypot4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot4_ha_l9 -# --- __svml_hypot4_ha_l9(__m256d, __m256d) -__svml_hypot4_ha_l9: + .globl __jsvml_hypot4_ha_l9 +# --- __jsvml_hypot4_ha_l9(__m256d, __m256d) +__jsvml_hypot4_ha_l9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B5.1: # Preds ..B5.0 @@ -679,7 +679,7 @@ __svml_hypot4_ha_l9: .byte 30 #661.672 .byte 250 #661.672 .cfi_startproc -..___tag_value___svml_hypot4_ha_l9.80: +..___tag_value___jsvml_hypot4_ha_l9.80: ..L81: #559.1 pushq %rbp #559.1 @@ -689,8 +689,8 @@ __svml_hypot4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #559.1 subq $256, %rsp #559.1 - vmovupd 64+__svml_dhypot_ha_data_internal(%rip), %ymm10 #592.50 - vmovupd __svml_dhypot_ha_data_internal(%rip), %ymm6 #591.51 + vmovupd 64+__jsvml_dhypot_ha_data_internal(%rip), %ymm10 #592.50 + vmovupd __jsvml_dhypot_ha_data_internal(%rip), %ymm6 #591.51 vmovapd %ymm1, %ymm9 #559.1 vmovapd %ymm0, %ymm8 #559.1 vandpd %ymm10, %ymm8, %ymm12 #599.18 @@ -704,12 +704,12 @@ __svml_hypot4_ha_l9: vshufps $221, %xmm13, %xmm7, %xmm15 #616.34 vshufps $221, %xmm14, %xmm3, %xmm0 #617.34 vpsubd %xmm0, %xmm15, %xmm2 #618.20 - vpcmpgtd 512+__svml_dhypot_ha_data_internal(%rip), %xmm2, %xmm10 #619.20 + vpcmpgtd 512+__jsvml_dhypot_ha_data_internal(%rip), %xmm2, %xmm10 #619.20 vpshufd $80, %xmm10, %xmm1 #620.73 vmulpd %ymm5, %ymm5, %ymm0 #625.13 vpshufd $250, %xmm10, %xmm11 #620.132 vaddpd %ymm5, %ymm7, %ymm5 #627.13 - vmovups 576+__svml_dhypot_ha_data_internal(%rip), %xmm7 #637.21 + vmovups 576+__jsvml_dhypot_ha_data_internal(%rip), %xmm7 #637.21 vmulpd %ymm5, %ymm4, %ymm4 #628.13 vinsertf128 $1, %xmm11, %ymm1, %ymm12 #620.24 vandnpd %ymm6, %ymm12, %ymm6 #622.21 @@ -718,13 +718,13 @@ __svml_hypot4_ha_l9: vfmadd231pd %ymm13, %ymm13, %ymm0 #626.13 vfmadd231pd %ymm2, %ymm3, %ymm4 #629.13 vfmadd213pd %ymm4, %ymm13, %ymm2 #630.13 - vmovupd 128+__svml_dhypot_ha_data_internal(%rip), %ymm13 #649.11 + vmovupd 128+__jsvml_dhypot_ha_data_internal(%rip), %ymm13 #649.11 vaddpd %ymm2, %ymm0, %ymm1 #631.11 vcvtpd2ps %ymm1, %xmm10 #647.38 vextractf128 $1, %ymm1, %xmm3 #640.122 vrsqrtps %xmm10, %xmm11 #647.25 vshufps $221, %xmm3, %xmm1, %xmm14 #640.32 - vpcmpgtd 640+__svml_dhypot_ha_data_internal(%rip), %xmm14, %xmm3 #642.22 + vpcmpgtd 640+__jsvml_dhypot_ha_data_internal(%rip), %xmm14, %xmm3 #642.22 vpcmpgtd %xmm14, %xmm7, %xmm15 #641.21 vpor %xmm3, %xmm15, %xmm5 #643.14 vcvtps2pd %xmm11, %ymm3 #647.9 @@ -733,11 +733,11 @@ __svml_hypot4_ha_l9: vmulpd %ymm3, %ymm3, %ymm12 #648.10 vfmsub231pd %ymm0, %ymm12, %ymm13 #649.11 vfmadd231pd %ymm2, %ymm12, %ymm13 #650.11 - vmovupd 192+__svml_dhypot_ha_data_internal(%rip), %ymm12 #651.11 - vfmadd213pd 256+__svml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #651.11 - vfmadd213pd 320+__svml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #652.11 - vfmadd213pd 384+__svml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #653.11 - vfmadd213pd 448+__svml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #654.11 + vmovupd 192+__jsvml_dhypot_ha_data_internal(%rip), %ymm12 #651.11 + vfmadd213pd 256+__jsvml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #651.11 + vfmadd213pd 320+__jsvml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #652.11 + vfmadd213pd 384+__jsvml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #653.11 + vfmadd213pd 448+__jsvml_dhypot_ha_data_internal(%rip), %ymm13, %ymm12 #654.11 vmulpd %ymm12, %ymm13, %ymm14 #655.9 vmulpd %ymm14, %ymm3, %ymm15 #656.9 vmulpd %ymm15, %ymm1, %ymm1 #657.9 @@ -806,29 +806,29 @@ __svml_hypot4_ha_l9: lea 64(%rsp,%r12,8), %rdi #661.672 lea 128(%rsp,%r12,8), %rsi #661.672 lea 192(%rsp,%r12,8), %rdx #661.672 -..___tag_value___svml_hypot4_ha_l9.98: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #661.672 -..___tag_value___svml_hypot4_ha_l9.99: +..___tag_value___jsvml_hypot4_ha_l9.98: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #661.672 +..___tag_value___jsvml_hypot4_ha_l9.99: jmp ..B5.8 # Prob 100% #661.672 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypot4_ha_l9,@function - .size __svml_hypot4_ha_l9,.-__svml_hypot4_ha_l9 -..LN__svml_hypot4_ha_l9.4: + .type __jsvml_hypot4_ha_l9,@function + .size __jsvml_hypot4_ha_l9,.-__jsvml_hypot4_ha_l9 +..LN__jsvml_hypot4_ha_l9.4: .data -# -- End __svml_hypot4_ha_l9 +# -- End __jsvml_hypot4_ha_l9 .text -.L_2__routine_start___svml_hypot2_ha_ex_5: -# -- Begin __svml_hypot2_ha_ex +.L_2__routine_start___jsvml_hypot2_ha_ex_5: +# -- Begin __jsvml_hypot2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_hypot2_ha_ex -# --- __svml_hypot2_ha_ex(__m128d, __m128d) -__svml_hypot2_ha_ex: + .globl __jsvml_hypot2_ha_ex +# --- __jsvml_hypot2_ha_ex(__m128d, __m128d) +__jsvml_hypot2_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B6.1: # Preds ..B6.0 @@ -838,7 +838,7 @@ __svml_hypot2_ha_ex: .byte 30 #1412.663 .byte 250 #1412.663 .cfi_startproc -..___tag_value___svml_hypot2_ha_ex.101: +..___tag_value___jsvml_hypot2_ha_ex.101: ..L102: #1310.1 pushq %rbp #1310.1 @@ -849,7 +849,7 @@ __svml_hypot2_ha_ex: andq $-64, %rsp #1310.1 subq $256, %rsp #1310.1 movaps %xmm1, %xmm3 #1310.1 - movups 64+__svml_dhypot_ha_data_internal(%rip), %xmm4 #1343.47 + movups 64+__jsvml_dhypot_ha_data_internal(%rip), %xmm4 #1343.47 movaps %xmm4, %xmm5 #1350.18 andps %xmm3, %xmm4 #1351.18 andps %xmm0, %xmm5 #1350.18 @@ -860,10 +860,10 @@ __svml_hypot2_ha_ex: movaps %xmm12, %xmm2 #1354.150 pshufd $221, %xmm4, %xmm6 #1368.14 movaps %xmm4, %xmm13 #1375.150 - movq 512+__svml_dhypot_ha_data_internal(%rip), %xmm7 #1364.27 + movq 512+__jsvml_dhypot_ha_data_internal(%rip), %xmm7 #1364.27 psubd %xmm6, %xmm8 #1369.18 pcmpgtd %xmm7, %xmm8 #1370.18 - movups __svml_dhypot_ha_data_internal(%rip), %xmm9 #1342.48 + movups __jsvml_dhypot_ha_data_internal(%rip), %xmm9 #1342.48 pshufd $80, %xmm8, %xmm14 #1371.24 movaps %xmm9, %xmm11 #1354.105 andnps %xmm9, %xmm14 #1373.21 @@ -893,25 +893,25 @@ __svml_hypot2_ha_ex: mulpd %xmm12, %xmm9 #1399.10 mulpd %xmm9, %xmm11 #1400.23 mulpd %xmm2, %xmm9 #1401.23 - subpd 128+__svml_dhypot_ha_data_internal(%rip), %xmm11 #1400.11 + subpd 128+__jsvml_dhypot_ha_data_internal(%rip), %xmm11 #1400.11 mulpd %xmm12, %xmm2 #1409.25 addpd %xmm9, %xmm11 #1401.11 - movups 192+__svml_dhypot_ha_data_internal(%rip), %xmm10 #1402.23 + movups 192+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #1402.23 mulpd %xmm11, %xmm10 #1402.23 - addpd 256+__svml_dhypot_ha_data_internal(%rip), %xmm10 #1402.11 + addpd 256+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #1402.11 mulpd %xmm11, %xmm10 #1403.23 - addpd 320+__svml_dhypot_ha_data_internal(%rip), %xmm10 #1403.11 + addpd 320+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #1403.11 mulpd %xmm11, %xmm10 #1404.23 - addpd 384+__svml_dhypot_ha_data_internal(%rip), %xmm10 #1404.11 + addpd 384+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #1404.11 mulpd %xmm11, %xmm10 #1405.23 - addpd 448+__svml_dhypot_ha_data_internal(%rip), %xmm10 #1405.11 + addpd 448+__jsvml_dhypot_ha_data_internal(%rip), %xmm10 #1405.11 mulpd %xmm10, %xmm11 #1406.9 mulpd %xmm12, %xmm11 #1407.9 mulpd %xmm1, %xmm12 #1410.24 pshufd $221, %xmm13, %xmm4 #1391.12 mulpd %xmm11, %xmm13 #1408.9 - movq 640+__svml_dhypot_ha_data_internal(%rip), %xmm15 #1389.20 - movq 576+__svml_dhypot_ha_data_internal(%rip), %xmm5 #1392.19 + movq 640+__jsvml_dhypot_ha_data_internal(%rip), %xmm15 #1389.20 + movq 576+__jsvml_dhypot_ha_data_internal(%rip), %xmm5 #1392.19 pcmpgtd %xmm4, %xmm5 #1392.19 pcmpgtd %xmm15, %xmm4 #1393.20 addpd %xmm2, %xmm13 #1409.13 @@ -976,29 +976,29 @@ __svml_hypot2_ha_ex: lea 64(%rsp,%r12,8), %rdi #1412.663 lea 128(%rsp,%r12,8), %rsi #1412.663 lea 192(%rsp,%r12,8), %rdx #1412.663 -..___tag_value___svml_hypot2_ha_ex.119: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #1412.663 -..___tag_value___svml_hypot2_ha_ex.120: +..___tag_value___jsvml_hypot2_ha_ex.119: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #1412.663 +..___tag_value___jsvml_hypot2_ha_ex.120: jmp ..B6.8 # Prob 100% #1412.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypot2_ha_ex,@function - .size __svml_hypot2_ha_ex,.-__svml_hypot2_ha_ex -..LN__svml_hypot2_ha_ex.5: + .type __jsvml_hypot2_ha_ex,@function + .size __jsvml_hypot2_ha_ex,.-__jsvml_hypot2_ha_ex +..LN__jsvml_hypot2_ha_ex.5: .data -# -- End __svml_hypot2_ha_ex +# -- End __jsvml_hypot2_ha_ex .text -.L_2__routine_start___svml_hypot1_ha_ex_6: -# -- Begin __svml_hypot1_ha_ex +.L_2__routine_start___jsvml_hypot1_ha_ex_6: +# -- Begin __jsvml_hypot1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_hypot1_ha_ex -# --- __svml_hypot1_ha_ex(__m128d, __m128d) -__svml_hypot1_ha_ex: + .globl __jsvml_hypot1_ha_ex +# --- __jsvml_hypot1_ha_ex(__m128d, __m128d) +__jsvml_hypot1_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B7.1: # Preds ..B7.0 @@ -1008,7 +1008,7 @@ __svml_hypot1_ha_ex: .byte 30 #1522.663 .byte 250 #1522.663 .cfi_startproc -..___tag_value___svml_hypot1_ha_ex.122: +..___tag_value___jsvml_hypot1_ha_ex.122: ..L123: #1420.1 pushq %rbp #1420.1 @@ -1019,7 +1019,7 @@ __svml_hypot1_ha_ex: andq $-64, %rsp #1420.1 subq $192, %rsp #1420.1 movaps %xmm0, %xmm2 #1420.1 - movsd 64+__svml_dhypot_ha_data_internal(%rip), %xmm4 #1453.16 + movsd 64+__jsvml_dhypot_ha_data_internal(%rip), %xmm4 #1453.16 movaps %xmm1, %xmm3 #1420.1 movaps %xmm4, %xmm5 #1460.18 andps %xmm3, %xmm4 #1461.18 @@ -1039,7 +1039,7 @@ __svml_hypot1_ha_ex: movaps %xmm13, %xmm12 #1464.150 pcmpgtd %xmm7, %xmm8 #1480.18 movl $1141899264, %ecx #1503.20 - movsd __svml_dhypot_ha_data_internal(%rip), %xmm9 #1452.17 + movsd __jsvml_dhypot_ha_data_internal(%rip), %xmm9 #1452.17 movd %edx, %xmm6 #1502.19 pshufd $0, %xmm8, %xmm14 #1481.24 movaps %xmm9, %xmm11 #1464.105 @@ -1075,23 +1075,23 @@ __svml_hypot1_ha_ex: mulsd %xmm15, %xmm0 #1520.24 mulsd %xmm10, %xmm11 #1510.23 mulsd %xmm10, %xmm12 #1511.23 - subsd 128+__svml_dhypot_ha_data_internal(%rip), %xmm11 #1510.11 - movsd 192+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1512.23 + subsd 128+__jsvml_dhypot_ha_data_internal(%rip), %xmm11 #1510.11 + movsd 192+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1512.23 addsd %xmm11, %xmm12 #1511.11 mulsd %xmm12, %xmm14 #1512.23 pshufd $85, %xmm13, %xmm5 #1501.12 - addsd 256+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1512.11 + addsd 256+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1512.11 mulsd %xmm12, %xmm14 #1513.23 pcmpgtd %xmm5, %xmm6 #1502.19 pcmpgtd %xmm4, %xmm5 #1503.20 - addsd 320+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1513.11 + addsd 320+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1513.11 mulsd %xmm12, %xmm14 #1514.23 por %xmm5, %xmm6 #1504.12 pshufd $0, %xmm6, %xmm7 #1505.18 - addsd 384+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1514.11 + addsd 384+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1514.11 movmskpd %xmm7, %eax #1506.42 mulsd %xmm12, %xmm14 #1515.23 - addsd 448+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1515.11 + addsd 448+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1515.11 mulsd %xmm12, %xmm14 #1516.9 mulsd %xmm15, %xmm14 #1517.9 mulsd %xmm13, %xmm14 #1518.9 @@ -1133,29 +1133,29 @@ __svml_hypot1_ha_ex: lea (%rsp), %rdi #1522.663 lea 64(%rsp), %rsi #1522.663 lea 128(%rsp), %rdx #1522.663 -..___tag_value___svml_hypot1_ha_ex.135: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #1522.663 -..___tag_value___svml_hypot1_ha_ex.136: +..___tag_value___jsvml_hypot1_ha_ex.135: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #1522.663 +..___tag_value___jsvml_hypot1_ha_ex.136: jmp ..B7.4 # Prob 100% #1522.663 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_hypot1_ha_ex,@function - .size __svml_hypot1_ha_ex,.-__svml_hypot1_ha_ex -..LN__svml_hypot1_ha_ex.6: + .type __jsvml_hypot1_ha_ex,@function + .size __jsvml_hypot1_ha_ex,.-__jsvml_hypot1_ha_ex +..LN__jsvml_hypot1_ha_ex.6: .data -# -- End __svml_hypot1_ha_ex +# -- End __jsvml_hypot1_ha_ex .text -.L_2__routine_start___svml_hypot8_ha_z0_7: -# -- Begin __svml_hypot8_ha_z0 +.L_2__routine_start___jsvml_hypot8_ha_z0_7: +# -- Begin __jsvml_hypot8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot8_ha_z0 -# --- __svml_hypot8_ha_z0(__m512d, __m512d) -__svml_hypot8_ha_z0: + .globl __jsvml_hypot8_ha_z0 +# --- __jsvml_hypot8_ha_z0(__m512d, __m512d) +__jsvml_hypot8_ha_z0: # parameter 1: %zmm0 # parameter 2: %zmm1 ..B8.1: # Preds ..B8.0 @@ -1165,7 +1165,7 @@ __svml_hypot8_ha_z0: .byte 30 #1595.878 .byte 250 #1595.878 .cfi_startproc -..___tag_value___svml_hypot8_ha_z0.138: +..___tag_value___jsvml_hypot8_ha_z0.138: ..L139: #1530.1 pushq %rbp #1530.1 @@ -1185,15 +1185,15 @@ __svml_hypot8_ha_z0: vmaxpd {sae}, %zmm4, %zmm3, %zmm5 #1566.13 vrsqrt14pd %zmm1, %zmm3 #1584.13 vminpd {sae}, %zmm8, %zmm7, %zmm10 #1579.17 - vandpd 64+__svml_dhypot_ha_data_internal(%rip), %zmm5, %zmm6 #1568.14 + vandpd 64+__jsvml_dhypot_ha_data_internal(%rip), %zmm5, %zmm6 #1568.14 vsubpd {rn-sae}, %zmm9, %zmm1, %zmm11 #1580.15 vmulpd {rn-sae}, %zmm3, %zmm1, %zmm4 #1585.18 - vpcmpq $5, 704+__svml_dhypot_ha_data_internal(%rip), %zmm6, %k0 #1571.16 + vpcmpq $5, 704+__jsvml_dhypot_ha_data_internal(%rip), %zmm6, %k0 #1571.16 vsubpd {rn-sae}, %zmm11, %zmm10, %zmm14 #1581.15 kmovw %k0, %esi #1572.37 vmovaps %zmm0, %zmm12 #1574.16 vfmsub213pd {rn-sae}, %zmm7, %zmm0, %zmm12 #1574.16 - vmovups 832+__svml_dhypot_ha_data_internal(%rip), %zmm7 #1586.48 + vmovups 832+__jsvml_dhypot_ha_data_internal(%rip), %zmm7 #1586.48 vmulpd {rn-sae}, %zmm3, %zmm7, %zmm6 #1587.23 vfnmadd231pd {rn-sae}, %zmm4, %zmm6, %zmm7 #1588.22 vmovaps %zmm2, %zmm13 #1576.16 @@ -1317,29 +1317,29 @@ __svml_hypot8_ha_z0: lea 64(%rsp,%rbx,8), %rdi #1595.878 lea 128(%rsp,%rbx,8), %rsi #1595.878 lea 192(%rsp,%rbx,8), %rdx #1595.878 -..___tag_value___svml_hypot8_ha_z0.166: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #1595.878 -..___tag_value___svml_hypot8_ha_z0.167: +..___tag_value___jsvml_hypot8_ha_z0.166: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #1595.878 +..___tag_value___jsvml_hypot8_ha_z0.167: jmp ..B8.13 # Prob 100% #1595.878 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_hypot8_ha_z0,@function - .size __svml_hypot8_ha_z0,.-__svml_hypot8_ha_z0 -..LN__svml_hypot8_ha_z0.7: + .type __jsvml_hypot8_ha_z0,@function + .size __jsvml_hypot8_ha_z0,.-__jsvml_hypot8_ha_z0 +..LN__jsvml_hypot8_ha_z0.7: .data -# -- End __svml_hypot8_ha_z0 +# -- End __jsvml_hypot8_ha_z0 .text -.L_2__routine_start___svml_hypot1_ha_e9_8: -# -- Begin __svml_hypot1_ha_e9 +.L_2__routine_start___jsvml_hypot1_ha_e9_8: +# -- Begin __jsvml_hypot1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypot1_ha_e9 -# --- __svml_hypot1_ha_e9(__m128d, __m128d) -__svml_hypot1_ha_e9: + .globl __jsvml_hypot1_ha_e9 +# --- __jsvml_hypot1_ha_e9(__m128d, __m128d) +__jsvml_hypot1_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B9.1: # Preds ..B9.0 @@ -1349,7 +1349,7 @@ __svml_hypot1_ha_e9: .byte 30 #1705.663 .byte 250 #1705.663 .cfi_startproc -..___tag_value___svml_hypot1_ha_e9.169: +..___tag_value___jsvml_hypot1_ha_e9.169: ..L170: #1603.1 pushq %rbp #1603.1 @@ -1360,7 +1360,7 @@ __svml_hypot1_ha_e9: andq $-64, %rsp #1603.1 subq $192, %rsp #1603.1 movaps %xmm0, %xmm2 #1603.1 - movsd 64+__svml_dhypot_ha_data_internal(%rip), %xmm4 #1636.16 + movsd 64+__jsvml_dhypot_ha_data_internal(%rip), %xmm4 #1636.16 movaps %xmm1, %xmm3 #1603.1 movaps %xmm4, %xmm5 #1643.18 andps %xmm3, %xmm4 #1644.18 @@ -1380,7 +1380,7 @@ __svml_hypot1_ha_e9: movaps %xmm13, %xmm12 #1647.150 pcmpgtd %xmm7, %xmm8 #1663.24 movl $1141899264, %ecx #1686.26 - movsd __svml_dhypot_ha_data_internal(%rip), %xmm9 #1635.17 + movsd __jsvml_dhypot_ha_data_internal(%rip), %xmm9 #1635.17 movd %edx, %xmm6 #1685.25 pshufd $0, %xmm8, %xmm14 #1664.24 movaps %xmm9, %xmm11 #1647.105 @@ -1416,23 +1416,23 @@ __svml_hypot1_ha_e9: mulsd %xmm15, %xmm0 #1703.24 mulsd %xmm10, %xmm11 #1693.23 mulsd %xmm10, %xmm12 #1694.23 - subsd 128+__svml_dhypot_ha_data_internal(%rip), %xmm11 #1693.11 - movsd 192+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1695.23 + subsd 128+__jsvml_dhypot_ha_data_internal(%rip), %xmm11 #1693.11 + movsd 192+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1695.23 addsd %xmm11, %xmm12 #1694.11 mulsd %xmm12, %xmm14 #1695.23 pshufd $85, %xmm13, %xmm5 #1684.18 - addsd 256+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1695.11 + addsd 256+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1695.11 mulsd %xmm12, %xmm14 #1696.23 pcmpgtd %xmm5, %xmm6 #1685.25 pcmpgtd %xmm4, %xmm5 #1686.26 - addsd 320+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1696.11 + addsd 320+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1696.11 mulsd %xmm12, %xmm14 #1697.23 por %xmm5, %xmm6 #1687.18 pshufd $0, %xmm6, %xmm7 #1688.18 - addsd 384+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1697.11 + addsd 384+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1697.11 movmskpd %xmm7, %eax #1689.42 mulsd %xmm12, %xmm14 #1698.23 - addsd 448+__svml_dhypot_ha_data_internal(%rip), %xmm14 #1698.11 + addsd 448+__jsvml_dhypot_ha_data_internal(%rip), %xmm14 #1698.11 mulsd %xmm12, %xmm14 #1699.9 mulsd %xmm15, %xmm14 #1700.9 mulsd %xmm13, %xmm14 #1701.9 @@ -1474,30 +1474,30 @@ __svml_hypot1_ha_e9: lea (%rsp), %rdi #1705.663 lea 64(%rsp), %rsi #1705.663 lea 128(%rsp), %rdx #1705.663 -..___tag_value___svml_hypot1_ha_e9.182: -# __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) - call __svml_dhypot_ha_cout_rare_internal #1705.663 -..___tag_value___svml_hypot1_ha_e9.183: +..___tag_value___jsvml_hypot1_ha_e9.182: +# __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) + call __jsvml_dhypot_ha_cout_rare_internal #1705.663 +..___tag_value___jsvml_hypot1_ha_e9.183: jmp ..B9.4 # Prob 100% #1705.663 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_hypot1_ha_e9,@function - .size __svml_hypot1_ha_e9,.-__svml_hypot1_ha_e9 -..LN__svml_hypot1_ha_e9.8: + .type __jsvml_hypot1_ha_e9,@function + .size __jsvml_hypot1_ha_e9,.-__jsvml_hypot1_ha_e9 +..LN__jsvml_hypot1_ha_e9.8: .data -# -- End __svml_hypot1_ha_e9 +# -- End __jsvml_hypot1_ha_e9 .text -.L_2__routine_start___svml_dhypot_ha_cout_rare_internal_9: -# -- Begin __svml_dhypot_ha_cout_rare_internal +.L_2__routine_start___jsvml_dhypot_ha_cout_rare_internal_9: +# -- Begin __jsvml_dhypot_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dhypot_ha_cout_rare_internal - .globl __svml_dhypot_ha_cout_rare_internal -# --- __svml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) -__svml_dhypot_ha_cout_rare_internal: + .hidden __jsvml_dhypot_ha_cout_rare_internal + .globl __jsvml_dhypot_ha_cout_rare_internal +# --- __jsvml_dhypot_ha_cout_rare_internal(const double *, const double *, double *) +__jsvml_dhypot_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -1508,7 +1508,7 @@ __svml_dhypot_ha_cout_rare_internal: .byte 30 #1293.145 .byte 250 #1293.145 .cfi_startproc -..___tag_value___svml_dhypot_ha_cout_rare_internal.185: +..___tag_value___jsvml_dhypot_ha_cout_rare_internal.185: ..L186: #1187.1 movq %rdx, %r8 #1187.1 @@ -1842,17 +1842,17 @@ __svml_dhypot_ha_cout_rare_internal: # LOE rbx rbp rsi rdi r8 r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_dhypot_ha_cout_rare_internal,@function - .size __svml_dhypot_ha_cout_rare_internal,.-__svml_dhypot_ha_cout_rare_internal -..LN__svml_dhypot_ha_cout_rare_internal.9: + .type __jsvml_dhypot_ha_cout_rare_internal,@function + .size __jsvml_dhypot_ha_cout_rare_internal,.-__jsvml_dhypot_ha_cout_rare_internal +..LN__jsvml_dhypot_ha_cout_rare_internal.9: .data -# -- End __svml_dhypot_ha_cout_rare_internal +# -- End __jsvml_dhypot_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dhypot_ha_data_internal - .globl __svml_dhypot_ha_data_internal -__svml_dhypot_ha_data_internal: + .hidden __jsvml_dhypot_ha_data_internal + .globl __jsvml_dhypot_ha_data_internal +__jsvml_dhypot_ha_data_internal: .long 0 .long 4294950912 .long 0 @@ -2077,8 +2077,8 @@ __svml_dhypot_ha_data_internal: .long 1071644672 .long 0 .long 1071644672 - .type __svml_dhypot_ha_data_internal,@object - .size __svml_dhypot_ha_data_internal,896 + .type __jsvml_dhypot_ha_data_internal,@object + .size __jsvml_dhypot_ha_data_internal,896 .align 32 _vmldHypotHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_log10_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log10_linux_x86.S similarity index 88% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_log10_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log10_linux_x86.S index 334b9edadc4..4b10758168a 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_log10_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log10_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_log10.c" .text ..TXTST0: -.L_2__routine_start___svml_log102_ha_ex_0: -# -- Begin __svml_log102_ha_ex +.L_2__routine_start___jsvml_log102_ha_ex_0: +# -- Begin __jsvml_log102_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log102_ha_ex -# --- __svml_log102_ha_ex(__m128d) -__svml_log102_ha_ex: + .globl __jsvml_log102_ha_ex +# --- __jsvml_log102_ha_ex(__m128d) +__jsvml_log102_ha_ex: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_log102_ha_ex: .byte 30 #1081.546 .byte 250 #1081.546 .cfi_startproc -..___tag_value___svml_log102_ha_ex.1: +..___tag_value___jsvml_log102_ha_ex.1: ..L2: #992.1 pushq %rbp #992.1 @@ -58,25 +58,25 @@ __svml_log102_ha_ex: andq $-64, %rsp #992.1 subq $192, %rsp #992.1 movaps %xmm0, %xmm5 #1038.12 - movups 9024+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1032.15 + movups 9024+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1032.15 psrlq $20, %xmm5 #1038.12 andps %xmm0, %xmm1 #1032.15 - lea -4221888+__svml_dlog10_ha_data_internal(%rip), %rsi #1055.67 - orps 9088+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1033.15 + lea -4221888+__jsvml_dlog10_ha_data_internal(%rip), %rsi #1055.67 + orps 9088+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1033.15 movaps %xmm0, %xmm8 #1040.14 cvtpd2ps %xmm1, %xmm2 #1036.53 - cmpltpd 9152+__svml_dlog10_ha_data_internal(%rip), %xmm8 #1040.14 + cmpltpd 9152+__jsvml_dlog10_ha_data_internal(%rip), %xmm8 #1040.14 movlhps %xmm2, %xmm2 #1036.37 movaps %xmm0, %xmm7 #1041.14 rcpps %xmm2, %xmm3 #1036.26 - cmpnlepd 9216+__svml_dlog10_ha_data_internal(%rip), %xmm7 #1041.14 + cmpnlepd 9216+__jsvml_dlog10_ha_data_internal(%rip), %xmm7 #1041.14 cvtps2pd %xmm3, %xmm11 #1036.13 - movups 9344+__svml_dlog10_ha_data_internal(%rip), %xmm9 #1042.45 + movups 9344+__jsvml_dlog10_ha_data_internal(%rip), %xmm9 #1042.45 orps %xmm7, %xmm8 #1046.14 mulpd %xmm9, %xmm11 #1043.17 movmskpd %xmm8, %edx #1048.40 movups .L_2il0floatpacket.28(%rip), %xmm4 #1044.103 - movups 9280+__svml_dlog10_ha_data_internal(%rip), %xmm10 #1049.50 + movups 9280+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #1049.50 addpd %xmm4, %xmm11 #1044.293 subpd %xmm4, %xmm11 #1044.343 andps %xmm1, %xmm10 #1050.120 @@ -91,8 +91,8 @@ __svml_log102_ha_ex: movd %xmm11, %eax #1055.144 pshufd $2, %xmm11, %xmm12 #1055.331 movd %xmm12, %ecx #1055.313 - movups 9472+__svml_dlog10_ha_data_internal(%rip), %xmm14 #1059.25 - movups 8448+__svml_dlog10_ha_data_internal(%rip), %xmm12 #1068.26 + movups 9472+__jsvml_dlog10_ha_data_internal(%rip), %xmm14 #1059.25 + movups 8448+__jsvml_dlog10_ha_data_internal(%rip), %xmm12 #1068.26 movslq %eax, %rax #1055.67 movslq %ecx, %rcx #1055.236 mulpd %xmm2, %xmm14 #1059.25 @@ -102,24 +102,24 @@ __svml_log102_ha_ex: movaps %xmm4, %xmm11 #1055.397 unpcklpd %xmm13, %xmm11 #1055.397 unpckhpd %xmm13, %xmm4 #1055.438 - movups 8320+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1067.26 + movups 8320+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1067.26 mulpd %xmm1, %xmm13 #1067.26 addpd %xmm14, %xmm11 #1059.13 - addpd 8384+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1067.14 - addpd 8512+__svml_dlog10_ha_data_internal(%rip), %xmm12 #1068.14 + addpd 8384+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1067.14 + addpd 8512+__jsvml_dlog10_ha_data_internal(%rip), %xmm12 #1068.14 movaps %xmm1, %xmm14 #1069.13 mulpd %xmm1, %xmm14 #1069.13 mulpd %xmm14, %xmm13 #1072.25 - movups 9536+__svml_dlog10_ha_data_internal(%rip), %xmm15 #1058.45 + movups 9536+__jsvml_dlog10_ha_data_internal(%rip), %xmm15 #1058.45 mulpd %xmm15, %xmm2 #1060.25 addpd %xmm13, %xmm12 #1072.13 addpd %xmm2, %xmm4 #1060.13 mulpd %xmm12, %xmm14 #1074.25 - movups 8576+__svml_dlog10_ha_data_internal(%rip), %xmm5 #1070.26 + movups 8576+__jsvml_dlog10_ha_data_internal(%rip), %xmm5 #1070.26 movaps %xmm1, %xmm2 #1071.13 mulpd %xmm1, %xmm5 #1070.26 addpd %xmm11, %xmm2 #1071.13 - addpd 8640+__svml_dlog10_ha_data_internal(%rip), %xmm5 #1070.14 + addpd 8640+__jsvml_dlog10_ha_data_internal(%rip), %xmm5 #1070.14 movaps %xmm2, %xmm3 #1073.13 subpd %xmm11, %xmm3 #1073.13 addpd %xmm14, %xmm5 #1074.13 @@ -183,29 +183,29 @@ __svml_log102_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1081.546 lea 128(%rsp,%r12,8), %rsi #1081.546 -..___tag_value___svml_log102_ha_ex.19: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #1081.546 -..___tag_value___svml_log102_ha_ex.20: +..___tag_value___jsvml_log102_ha_ex.19: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #1081.546 +..___tag_value___jsvml_log102_ha_ex.20: jmp ..B1.8 # Prob 100% #1081.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log102_ha_ex,@function - .size __svml_log102_ha_ex,.-__svml_log102_ha_ex -..LN__svml_log102_ha_ex.0: + .type __jsvml_log102_ha_ex,@function + .size __jsvml_log102_ha_ex,.-__jsvml_log102_ha_ex +..LN__jsvml_log102_ha_ex.0: .data -# -- End __svml_log102_ha_ex +# -- End __jsvml_log102_ha_ex .text -.L_2__routine_start___svml_log101_ha_l9_1: -# -- Begin __svml_log101_ha_l9 +.L_2__routine_start___jsvml_log101_ha_l9_1: +# -- Begin __jsvml_log101_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log101_ha_l9 -# --- __svml_log101_ha_l9(__m128d) -__svml_log101_ha_l9: + .globl __jsvml_log101_ha_l9 +# --- __jsvml_log101_ha_l9(__m128d) +__jsvml_log101_ha_l9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -214,7 +214,7 @@ __svml_log101_ha_l9: .byte 30 #1178.546 .byte 250 #1178.546 .cfi_startproc -..___tag_value___svml_log101_ha_l9.22: +..___tag_value___jsvml_log101_ha_l9.22: ..L23: #1089.1 pushq %rbp #1089.1 @@ -225,19 +225,19 @@ __svml_log101_ha_l9: andq $-64, %rsp #1089.1 subq $128, %rsp #1089.1 vmovapd %xmm0, %xmm2 #1089.1 - vmovsd 9024+__svml_dlog10_ha_data_internal(%rip), %xmm3 #1127.14 + vmovsd 9024+__jsvml_dlog10_ha_data_internal(%rip), %xmm3 #1127.14 vpsrlq $20, %xmm2, %xmm11 #1135.14 - vmovsd 9088+__svml_dlog10_ha_data_internal(%rip), %xmm5 #1128.12 + vmovsd 9088+__jsvml_dlog10_ha_data_internal(%rip), %xmm5 #1128.12 vandpd %xmm3, %xmm2, %xmm4 #1129.15 vorpd %xmm5, %xmm4, %xmm1 #1130.15 - lea -4221880+__svml_dlog10_ha_data_internal(%rip), %rdx #1152.17 + lea -4221880+__jsvml_dlog10_ha_data_internal(%rip), %rdx #1152.17 vcvtpd2ps %xmm1, %xmm6 #1133.53 - vcmpltsd 9152+__svml_dlog10_ha_data_internal(%rip), %xmm2, %xmm14 #1137.14 - vcmpnlesd 9216+__svml_dlog10_ha_data_internal(%rip), %xmm2, %xmm15 #1138.14 + vcmpltsd 9152+__jsvml_dlog10_ha_data_internal(%rip), %xmm2, %xmm14 #1137.14 + vcmpnlesd 9216+__jsvml_dlog10_ha_data_internal(%rip), %xmm2, %xmm15 #1138.14 vmovlhps %xmm6, %xmm6, %xmm7 #1133.37 vrcpps %xmm7, %xmm8 #1133.26 vcvtps2pd %xmm8, %xmm9 #1133.13 - vmovsd 9344+__svml_dlog10_ha_data_internal(%rip), %xmm3 #1139.14 + vmovsd 9344+__jsvml_dlog10_ha_data_internal(%rip), %xmm3 #1139.14 vmulsd %xmm3, %xmm9, %xmm10 #1140.17 vpshufd $85, %xmm11, %xmm12 #1136.15 vorpd %xmm15, %xmm14, %xmm11 #1143.14 @@ -247,25 +247,25 @@ __svml_log101_ha_l9: vcvtdq2pd %xmm13, %xmm0 #1142.20 vfmsub213sd %xmm3, %xmm4, %xmm1 #1147.13 vmovd %xmm5, %eax #1152.117 - vmovsd 9472+__svml_dlog10_ha_data_internal(%rip), %xmm7 #1154.14 + vmovsd 9472+__jsvml_dlog10_ha_data_internal(%rip), %xmm7 #1154.14 vmovapd %xmm0, %xmm10 #1156.13 - vmovsd 8320+__svml_dlog10_ha_data_internal(%rip), %xmm14 #1158.24 + vmovsd 8320+__jsvml_dlog10_ha_data_internal(%rip), %xmm14 #1158.24 movslq %eax, %rax #1152.106 - vmovsd 8448+__svml_dlog10_ha_data_internal(%rip), %xmm9 #1160.24 - vfmadd213sd 8384+__svml_dlog10_ha_data_internal(%rip), %xmm1, %xmm14 #1164.14 - vfmadd213sd 8512+__svml_dlog10_ha_data_internal(%rip), %xmm1, %xmm9 #1165.14 + vmovsd 8448+__jsvml_dlog10_ha_data_internal(%rip), %xmm9 #1160.24 + vfmadd213sd 8384+__jsvml_dlog10_ha_data_internal(%rip), %xmm1, %xmm14 #1164.14 + vfmadd213sd 8512+__jsvml_dlog10_ha_data_internal(%rip), %xmm1, %xmm9 #1165.14 vfmadd213sd -8(%rdx,%rax), %xmm7, %xmm10 #1156.13 vmulsd %xmm1, %xmm1, %xmm12 #1166.13 vmovmskpd %xmm11, %ecx #1145.40 vaddsd %xmm1, %xmm10, %xmm3 #1168.13 vfmadd213sd %xmm9, %xmm12, %xmm14 #1169.13 - vmovsd 8576+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1162.24 + vmovsd 8576+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1162.24 vsubsd %xmm10, %xmm3, %xmm15 #1170.13 - vfmadd213sd 8640+__svml_dlog10_ha_data_internal(%rip), %xmm1, %xmm13 #1167.14 + vfmadd213sd 8640+__jsvml_dlog10_ha_data_internal(%rip), %xmm1, %xmm13 #1167.14 vmovsd (%rdx,%rax), %xmm6 #1152.106 vfmadd213sd %xmm13, %xmm12, %xmm14 #1171.13 vunpcklpd %xmm6, %xmm6, %xmm8 #1152.162 - vfmadd132sd 9536+__svml_dlog10_ha_data_internal(%rip), %xmm8, %xmm0 #1157.13 + vfmadd132sd 9536+__jsvml_dlog10_ha_data_internal(%rip), %xmm8, %xmm0 #1157.13 vmulsd %xmm1, %xmm14, %xmm9 #1172.13 vsubsd %xmm15, %xmm1, %xmm1 #1173.13 vaddsd %xmm1, %xmm0, %xmm0 #1174.13 @@ -309,29 +309,29 @@ __svml_log101_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1178.546 lea 64(%rsp), %rsi #1178.546 -..___tag_value___svml_log101_ha_l9.35: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #1178.546 -..___tag_value___svml_log101_ha_l9.36: +..___tag_value___jsvml_log101_ha_l9.35: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #1178.546 +..___tag_value___jsvml_log101_ha_l9.36: jmp ..B2.4 # Prob 100% #1178.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log101_ha_l9,@function - .size __svml_log101_ha_l9,.-__svml_log101_ha_l9 -..LN__svml_log101_ha_l9.1: + .type __jsvml_log101_ha_l9,@function + .size __jsvml_log101_ha_l9,.-__jsvml_log101_ha_l9 +..LN__jsvml_log101_ha_l9.1: .data -# -- End __svml_log101_ha_l9 +# -- End __jsvml_log101_ha_l9 .text -.L_2__routine_start___svml_log101_ha_e9_2: -# -- Begin __svml_log101_ha_e9 +.L_2__routine_start___jsvml_log101_ha_e9_2: +# -- Begin __jsvml_log101_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log101_ha_e9 -# --- __svml_log101_ha_e9(__m128d) -__svml_log101_ha_e9: + .globl __jsvml_log101_ha_e9 +# --- __jsvml_log101_ha_e9(__m128d) +__jsvml_log101_ha_e9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -340,7 +340,7 @@ __svml_log101_ha_e9: .byte 30 #1275.546 .byte 250 #1275.546 .cfi_startproc -..___tag_value___svml_log101_ha_e9.38: +..___tag_value___jsvml_log101_ha_e9.38: ..L39: #1186.1 pushq %rbp #1186.1 @@ -351,23 +351,23 @@ __svml_log101_ha_e9: andq $-64, %rsp #1186.1 subq $128, %rsp #1186.1 movaps %xmm0, %xmm4 #1232.18 - movsd 9024+__svml_dlog10_ha_data_internal(%rip), %xmm10 #1226.15 + movsd 9024+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #1226.15 psrlq $20, %xmm4 #1232.18 - movsd 9088+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1225.12 + movsd 9088+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1225.12 andps %xmm0, %xmm10 #1226.15 orps %xmm1, %xmm10 #1227.15 - lea -4221880+__svml_dlog10_ha_data_internal(%rip), %rdx #1249.17 + lea -4221880+__jsvml_dlog10_ha_data_internal(%rip), %rdx #1249.17 cvtpd2ps %xmm10, %xmm2 #1230.53 movlhps %xmm2, %xmm2 #1230.37 movaps %xmm0, %xmm8 #1234.14 rcpps %xmm2, %xmm3 #1230.26 - cmpltsd 9152+__svml_dlog10_ha_data_internal(%rip), %xmm8 #1234.14 + cmpltsd 9152+__jsvml_dlog10_ha_data_internal(%rip), %xmm8 #1234.14 cvtps2pd %xmm3, %xmm11 #1230.13 - movsd 9344+__svml_dlog10_ha_data_internal(%rip), %xmm9 #1236.14 + movsd 9344+__jsvml_dlog10_ha_data_internal(%rip), %xmm9 #1236.14 movaps %xmm0, %xmm7 #1235.14 mulsd %xmm9, %xmm11 #1237.17 - cmpnlesd 9216+__svml_dlog10_ha_data_internal(%rip), %xmm7 #1235.14 - movsd 9280+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1244.120 + cmpnlesd 9216+__jsvml_dlog10_ha_data_internal(%rip), %xmm7 #1235.14 + movsd 9280+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1244.120 orps %xmm7, %xmm8 #1240.14 roundsd $0, %xmm11, %xmm11 #1238.13 andps %xmm10, %xmm1 #1244.120 @@ -379,29 +379,29 @@ __svml_log101_ha_e9: subsd %xmm9, %xmm1 #1244.324 pshufd $0, %xmm5, %xmm6 #1239.37 psrlq $40, %xmm11 #1246.22 - movsd 8320+__svml_dlog10_ha_data_internal(%rip), %xmm2 #1261.26 + movsd 8320+__jsvml_dlog10_ha_data_internal(%rip), %xmm2 #1261.26 addsd %xmm10, %xmm1 #1244.367 cvtdq2pd %xmm6, %xmm4 #1239.20 mulsd %xmm1, %xmm2 #1261.26 movd %xmm11, %eax #1249.117 - movsd 8448+__svml_dlog10_ha_data_internal(%rip), %xmm12 #1262.26 + movsd 8448+__jsvml_dlog10_ha_data_internal(%rip), %xmm12 #1262.26 movaps %xmm1, %xmm14 #1263.13 mulsd %xmm1, %xmm12 #1262.26 - addsd 8384+__svml_dlog10_ha_data_internal(%rip), %xmm2 #1261.14 + addsd 8384+__jsvml_dlog10_ha_data_internal(%rip), %xmm2 #1261.14 mulsd %xmm1, %xmm14 #1263.13 - addsd 8512+__svml_dlog10_ha_data_internal(%rip), %xmm12 #1262.14 + addsd 8512+__jsvml_dlog10_ha_data_internal(%rip), %xmm12 #1262.14 mulsd %xmm14, %xmm2 #1266.25 movaps %xmm4, %xmm13 #1253.25 addsd %xmm12, %xmm2 #1266.13 - mulsd 9472+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1253.25 - mulsd 9536+__svml_dlog10_ha_data_internal(%rip), %xmm4 #1254.25 + mulsd 9472+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1253.25 + mulsd 9536+__jsvml_dlog10_ha_data_internal(%rip), %xmm4 #1254.25 mulsd %xmm14, %xmm2 #1268.25 movslq %eax, %rax #1249.106 - movsd 8576+__svml_dlog10_ha_data_internal(%rip), %xmm15 #1264.26 + movsd 8576+__jsvml_dlog10_ha_data_internal(%rip), %xmm15 #1264.26 mulsd %xmm1, %xmm15 #1264.26 addsd -8(%rdx,%rax), %xmm13 #1253.13 addsd (%rdx,%rax), %xmm4 #1254.13 - addsd 8640+__svml_dlog10_ha_data_internal(%rip), %xmm15 #1264.14 + addsd 8640+__jsvml_dlog10_ha_data_internal(%rip), %xmm15 #1264.14 movaps %xmm13, %xmm3 #1265.13 addsd %xmm15, %xmm2 #1268.13 addsd %xmm1, %xmm3 #1265.13 @@ -441,29 +441,29 @@ __svml_log101_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1275.546 lea 64(%rsp), %rsi #1275.546 -..___tag_value___svml_log101_ha_e9.47: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #1275.546 -..___tag_value___svml_log101_ha_e9.48: +..___tag_value___jsvml_log101_ha_e9.47: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #1275.546 +..___tag_value___jsvml_log101_ha_e9.48: jmp ..B3.4 # Prob 100% #1275.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log101_ha_e9,@function - .size __svml_log101_ha_e9,.-__svml_log101_ha_e9 -..LN__svml_log101_ha_e9.2: + .type __jsvml_log101_ha_e9,@function + .size __jsvml_log101_ha_e9,.-__jsvml_log101_ha_e9 +..LN__jsvml_log101_ha_e9.2: .data -# -- End __svml_log101_ha_e9 +# -- End __jsvml_log101_ha_e9 .text -.L_2__routine_start___svml_log104_ha_e9_3: -# -- Begin __svml_log104_ha_e9 +.L_2__routine_start___jsvml_log104_ha_e9_3: +# -- Begin __jsvml_log104_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log104_ha_e9 -# --- __svml_log104_ha_e9(__m256d) -__svml_log104_ha_e9: + .globl __jsvml_log104_ha_e9 +# --- __jsvml_log104_ha_e9(__m256d) +__jsvml_log104_ha_e9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -472,7 +472,7 @@ __svml_log104_ha_e9: .byte 30 #1372.552 .byte 250 #1372.552 .cfi_startproc -..___tag_value___svml_log104_ha_e9.50: +..___tag_value___jsvml_log104_ha_e9.50: ..L51: #1283.1 pushq %rbp #1283.1 @@ -482,23 +482,23 @@ __svml_log104_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1283.1 subq $192, %rsp #1283.1 - lea -4221888+__svml_dlog10_ha_data_internal(%rip), %r8 #1346.68 + lea -4221888+__jsvml_dlog10_ha_data_internal(%rip), %r8 #1346.68 vmovapd %ymm0, %ymm8 #1283.1 - vandpd 9024+__svml_dlog10_ha_data_internal(%rip), %ymm8, %ymm9 #1323.15 - vorpd 9088+__svml_dlog10_ha_data_internal(%rip), %ymm9, %ymm7 #1324.15 + vandpd 9024+__jsvml_dlog10_ha_data_internal(%rip), %ymm8, %ymm9 #1323.15 + vorpd 9088+__jsvml_dlog10_ha_data_internal(%rip), %ymm9, %ymm7 #1324.15 vcvtpd2ps %ymm7, %xmm10 #1327.40 - vmovupd 9344+__svml_dlog10_ha_data_internal(%rip), %ymm6 #1333.48 + vmovupd 9344+__jsvml_dlog10_ha_data_internal(%rip), %ymm6 #1333.48 vrcpps %xmm10, %xmm11 #1327.29 vcvtps2pd %xmm11, %ymm15 #1327.13 vmulpd %ymm6, %ymm15, %ymm0 #1334.17 vroundpd $0, %ymm0, %ymm4 #1335.13 vpsrlq $20, %xmm8, %xmm13 #1329.18 vextractf128 $1, %ymm8, %xmm12 #1328.107 - vcmplt_oqpd 9152+__svml_dlog10_ha_data_internal(%rip), %ymm8, %ymm3 #1331.14 - vcmpnle_uqpd 9216+__svml_dlog10_ha_data_internal(%rip), %ymm8, %ymm2 #1332.14 + vcmplt_oqpd 9152+__jsvml_dlog10_ha_data_internal(%rip), %ymm8, %ymm3 #1331.14 + vcmpnle_uqpd 9216+__jsvml_dlog10_ha_data_internal(%rip), %ymm8, %ymm2 #1332.14 vpsrlq $20, %xmm12, %xmm14 #1329.76 vshufps $221, %xmm14, %xmm13, %xmm1 #1330.37 - vandpd 9280+__svml_dlog10_ha_data_internal(%rip), %ymm7, %ymm12 #1341.120 + vandpd 9280+__jsvml_dlog10_ha_data_internal(%rip), %ymm7, %ymm12 #1341.120 vsubpd %ymm12, %ymm7, %ymm7 #1341.177 vmulpd %ymm12, %ymm4, %ymm13 #1341.233 vcvtdq2pd %xmm1, %ymm5 #1336.20 @@ -506,8 +506,8 @@ __svml_log104_ha_e9: vsubpd %ymm6, %ymm13, %ymm6 #1341.336 vorpd %ymm2, %ymm3, %ymm9 #1337.14 vaddpd %ymm6, %ymm14, %ymm3 #1341.382 - vmulpd 9472+__svml_dlog10_ha_data_internal(%rip), %ymm5, %ymm14 #1350.28 - vmulpd 9536+__svml_dlog10_ha_data_internal(%rip), %ymm5, %ymm5 #1351.28 + vmulpd 9472+__jsvml_dlog10_ha_data_internal(%rip), %ymm5, %ymm14 #1350.28 + vmulpd 9536+__jsvml_dlog10_ha_data_internal(%rip), %ymm5, %ymm5 #1351.28 vpsrlq $40, %xmm4, %xmm0 #1343.22 vextractf128 $1, %ymm4, %xmm15 #1342.110 vmovd %xmm0, %edx #1346.145 @@ -519,7 +519,7 @@ __svml_log104_ha_e9: movslq %edi, %rdi #1346.605 movslq %edx, %rdx #1346.68 movslq %ecx, %rcx #1346.246 - vmulpd 8320+__svml_dlog10_ha_data_internal(%rip), %ymm3, %ymm0 #1358.29 + vmulpd 8320+__jsvml_dlog10_ha_data_internal(%rip), %ymm3, %ymm0 #1358.29 vmovupd (%r8,%rdx), %xmm6 #1346.68 vmovupd (%r8,%rcx), %xmm7 #1346.246 vunpcklpd %xmm7, %xmm6, %xmm2 #1346.783 @@ -532,19 +532,19 @@ __svml_log104_ha_e9: vunpckhpd %xmm11, %xmm10, %xmm12 #1346.943 vmulpd %ymm3, %ymm3, %ymm10 #1360.13 vunpckhpd %xmm7, %xmm6, %xmm9 #1346.910 - vaddpd 8384+__svml_dlog10_ha_data_internal(%rip), %ymm0, %ymm6 #1358.14 + vaddpd 8384+__jsvml_dlog10_ha_data_internal(%rip), %ymm0, %ymm6 #1358.14 vinsertf128 $1, %xmm4, %ymm2, %ymm13 #1346.737 - vmulpd 8448+__svml_dlog10_ha_data_internal(%rip), %ymm3, %ymm4 #1359.29 + vmulpd 8448+__jsvml_dlog10_ha_data_internal(%rip), %ymm3, %ymm4 #1359.29 vaddpd %ymm14, %ymm13, %ymm2 #1350.13 - vaddpd 8512+__svml_dlog10_ha_data_internal(%rip), %ymm4, %ymm7 #1359.14 + vaddpd 8512+__jsvml_dlog10_ha_data_internal(%rip), %ymm4, %ymm7 #1359.14 vaddpd %ymm2, %ymm3, %ymm0 #1362.13 vsubpd %ymm2, %ymm0, %ymm14 #1364.13 vinsertf128 $1, %xmm12, %ymm9, %ymm15 #1346.864 vmulpd %ymm10, %ymm6, %ymm9 #1363.28 vaddpd %ymm5, %ymm15, %ymm1 #1351.13 - vmulpd 8576+__svml_dlog10_ha_data_internal(%rip), %ymm3, %ymm5 #1361.29 + vmulpd 8576+__jsvml_dlog10_ha_data_internal(%rip), %ymm3, %ymm5 #1361.29 vaddpd %ymm9, %ymm7, %ymm11 #1363.13 - vaddpd 8640+__svml_dlog10_ha_data_internal(%rip), %ymm5, %ymm12 #1361.14 + vaddpd 8640+__jsvml_dlog10_ha_data_internal(%rip), %ymm5, %ymm12 #1361.14 vmulpd %ymm11, %ymm10, %ymm2 #1365.28 vaddpd %ymm2, %ymm12, %ymm13 #1365.13 vmulpd %ymm13, %ymm3, %ymm15 #1366.13 @@ -611,29 +611,29 @@ __svml_log104_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1372.552 lea 128(%rsp,%r12,8), %rsi #1372.552 -..___tag_value___svml_log104_ha_e9.68: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #1372.552 -..___tag_value___svml_log104_ha_e9.69: +..___tag_value___jsvml_log104_ha_e9.68: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #1372.552 +..___tag_value___jsvml_log104_ha_e9.69: jmp ..B4.8 # Prob 100% #1372.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log104_ha_e9,@function - .size __svml_log104_ha_e9,.-__svml_log104_ha_e9 -..LN__svml_log104_ha_e9.3: + .type __jsvml_log104_ha_e9,@function + .size __jsvml_log104_ha_e9,.-__jsvml_log104_ha_e9 +..LN__jsvml_log104_ha_e9.3: .data -# -- End __svml_log104_ha_e9 +# -- End __jsvml_log104_ha_e9 .text -.L_2__routine_start___svml_log108_ha_z0_4: -# -- Begin __svml_log108_ha_z0 +.L_2__routine_start___jsvml_log108_ha_z0_4: +# -- Begin __jsvml_log108_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_log108_ha_z0 -# --- __svml_log108_ha_z0(__m512d) -__svml_log108_ha_z0: + .globl __jsvml_log108_ha_z0 +# --- __jsvml_log108_ha_z0(__m512d) +__jsvml_log108_ha_z0: # parameter 1: %zmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -642,43 +642,43 @@ __svml_log108_ha_z0: .byte 30 #1479.12 .byte 250 #1479.12 .cfi_startproc -..___tag_value___svml_log108_ha_z0.71: +..___tag_value___jsvml_log108_ha_z0.71: ..L72: #1380.1 vmovaps %zmm0, %zmm5 #1380.1 vgetmantpd $8, {sae}, %zmm5, %zmm4 #1429.21 - vmovups 256+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm9 #1436.46 - vmovups 320+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm8 #1434.47 + vmovups 256+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm9 #1436.46 + vmovups 320+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm8 #1434.47 vgetexppd {sae}, %zmm5, %zmm3 #1430.18 - vmovups __svml_dlog10_ha_data_internal_avx512(%rip), %zmm2 #1441.289 - vmovups 128+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm15 #1442.289 - vmovups 512+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm12 #1445.54 - vmovups 1024+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm13 #1450.46 - vmovups 384+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm11 #1443.54 - vmovups 448+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm1 #1447.14 - vmovups 1088+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm14 #1452.46 + vmovups __jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm2 #1441.289 + vmovups 128+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm15 #1442.289 + vmovups 512+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm12 #1445.54 + vmovups 1024+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm13 #1450.46 + vmovups 384+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm11 #1443.54 + vmovups 448+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm1 #1447.14 + vmovups 1088+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm14 #1452.46 vrcp14pd %zmm4, %zmm6 #1432.17 vfpclasspd $94, %zmm5, %k2 #1431.24 - vmovups 896+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm5 #1468.55 + vmovups 896+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm5 #1468.55 vrndscalepd $88, {sae}, %zmm6, %zmm7 #1433.17 - vmovups 576+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm6 #1449.14 + vmovups 576+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm6 #1449.14 vfmsub213pd {rn-sae}, %zmm9, %zmm7, %zmm4 #1437.12 vcmppd $17, {sae}, %zmm8, %zmm7, %k1 #1435.19 vfmadd231pd {rn-sae}, %zmm4, %zmm12, %zmm6 #1449.14 - vmovups 640+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm12 #1454.54 + vmovups 640+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm12 #1454.54 vfmadd231pd {rn-sae}, %zmm4, %zmm11, %zmm1 #1447.14 vmulpd {rn-sae}, %zmm4, %zmm4, %zmm0 #1448.15 vpsrlq $48, %zmm7, %zmm10 #1438.42 - vmovups 832+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm7 #1459.14 + vmovups 832+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm7 #1459.14 vmulpd {rn-sae}, %zmm0, %zmm0, %zmm8 #1463.15 vfmadd213pd {rn-sae}, %zmm6, %zmm0, %zmm1 #1460.14 vaddpd {rn-sae}, %zmm9, %zmm3, %zmm3{%k1} #1440.18 - vpermt2pd 64+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm10, %zmm2 #1441.289 - vpermt2pd 192+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm10, %zmm15 #1442.289 - vmovups 960+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm10 #1461.55 + vpermt2pd 64+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm10, %zmm2 #1441.289 + vpermt2pd 192+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm10, %zmm15 #1442.289 + vmovups 960+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm10 #1461.55 vfmadd231pd {rn-sae}, %zmm3, %zmm13, %zmm2 #1451.13 - vmovups 768+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm13 #1456.54 - vmovups 704+__svml_dlog10_ha_data_internal_avx512(%rip), %zmm9 #1458.14 + vmovups 768+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm13 #1456.54 + vmovups 704+__jsvml_dlog10_ha_data_internal_avx512(%rip), %zmm9 #1458.14 vfmadd213pd {rn-sae}, %zmm15, %zmm14, %zmm3 #1453.13 vfmadd231pd {rn-sae}, %zmm4, %zmm13, %zmm7 #1459.14 vfmadd231pd {rn-sae}, %zmm4, %zmm12, %zmm9 #1458.14 @@ -698,20 +698,20 @@ __svml_log108_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_log108_ha_z0,@function - .size __svml_log108_ha_z0,.-__svml_log108_ha_z0 -..LN__svml_log108_ha_z0.4: + .type __jsvml_log108_ha_z0,@function + .size __jsvml_log108_ha_z0,.-__jsvml_log108_ha_z0 +..LN__jsvml_log108_ha_z0.4: .data -# -- End __svml_log108_ha_z0 +# -- End __jsvml_log108_ha_z0 .text -.L_2__routine_start___svml_log101_ha_ex_5: -# -- Begin __svml_log101_ha_ex +.L_2__routine_start___jsvml_log101_ha_ex_5: +# -- Begin __jsvml_log101_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log101_ha_ex -# --- __svml_log101_ha_ex(__m128d) -__svml_log101_ha_ex: + .globl __jsvml_log101_ha_ex +# --- __jsvml_log101_ha_ex(__m128d) +__jsvml_log101_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -720,7 +720,7 @@ __svml_log101_ha_ex: .byte 30 #1880.546 .byte 250 #1880.546 .cfi_startproc -..___tag_value___svml_log101_ha_ex.74: +..___tag_value___jsvml_log101_ha_ex.74: ..L75: #1791.1 pushq %rbp #1791.1 @@ -731,27 +731,27 @@ __svml_log101_ha_ex: andq $-64, %rsp #1791.1 subq $128, %rsp #1791.1 movaps %xmm0, %xmm5 #1837.12 - movsd 9024+__svml_dlog10_ha_data_internal(%rip), %xmm11 #1831.15 + movsd 9024+__jsvml_dlog10_ha_data_internal(%rip), %xmm11 #1831.15 psrlq $20, %xmm5 #1837.12 - movsd 9088+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1830.12 + movsd 9088+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1830.12 andps %xmm0, %xmm11 #1831.15 orps %xmm1, %xmm11 #1832.15 - lea -4221880+__svml_dlog10_ha_data_internal(%rip), %rdx #1854.17 + lea -4221880+__jsvml_dlog10_ha_data_internal(%rip), %rdx #1854.17 cvtpd2ps %xmm11, %xmm2 #1835.53 movlhps %xmm2, %xmm2 #1835.37 movaps %xmm0, %xmm9 #1839.14 rcpps %xmm2, %xmm3 #1835.26 - cmpltsd 9152+__svml_dlog10_ha_data_internal(%rip), %xmm9 #1839.14 + cmpltsd 9152+__jsvml_dlog10_ha_data_internal(%rip), %xmm9 #1839.14 cvtps2pd %xmm3, %xmm12 #1835.13 - movsd 9344+__svml_dlog10_ha_data_internal(%rip), %xmm10 #1841.14 + movsd 9344+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #1841.14 movaps %xmm0, %xmm8 #1840.14 mulsd %xmm10, %xmm12 #1842.17 - cmpnlesd 9216+__svml_dlog10_ha_data_internal(%rip), %xmm8 #1840.14 + cmpnlesd 9216+__jsvml_dlog10_ha_data_internal(%rip), %xmm8 #1840.14 movups .L_2il0floatpacket.28(%rip), %xmm4 #1843.103 orps %xmm8, %xmm9 #1845.14 addpd %xmm4, %xmm12 #1843.293 movmskpd %xmm9, %ecx #1847.40 - movsd 9280+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1849.120 + movsd 9280+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1849.120 subpd %xmm4, %xmm12 #1843.343 andps %xmm11, %xmm1 #1849.120 pshufd $85, %xmm5, %xmm6 #1838.13 @@ -761,29 +761,29 @@ __svml_log101_ha_ex: subsd %xmm10, %xmm1 #1849.324 pshufd $0, %xmm6, %xmm7 #1844.37 psrlq $40, %xmm12 #1851.16 - movsd 8320+__svml_dlog10_ha_data_internal(%rip), %xmm2 #1866.26 + movsd 8320+__jsvml_dlog10_ha_data_internal(%rip), %xmm2 #1866.26 addsd %xmm11, %xmm1 #1849.367 cvtdq2pd %xmm7, %xmm4 #1844.20 mulsd %xmm1, %xmm2 #1866.26 movd %xmm12, %eax #1854.117 - movsd 8448+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1867.26 + movsd 8448+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1867.26 movaps %xmm1, %xmm15 #1868.13 mulsd %xmm1, %xmm13 #1867.26 - addsd 8384+__svml_dlog10_ha_data_internal(%rip), %xmm2 #1866.14 + addsd 8384+__jsvml_dlog10_ha_data_internal(%rip), %xmm2 #1866.14 mulsd %xmm1, %xmm15 #1868.13 - addsd 8512+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1867.14 + addsd 8512+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1867.14 mulsd %xmm15, %xmm2 #1871.25 movaps %xmm4, %xmm14 #1858.25 addsd %xmm13, %xmm2 #1871.13 - mulsd 9472+__svml_dlog10_ha_data_internal(%rip), %xmm14 #1858.25 - mulsd 9536+__svml_dlog10_ha_data_internal(%rip), %xmm4 #1859.25 + mulsd 9472+__jsvml_dlog10_ha_data_internal(%rip), %xmm14 #1858.25 + mulsd 9536+__jsvml_dlog10_ha_data_internal(%rip), %xmm4 #1859.25 mulsd %xmm15, %xmm2 #1873.25 movslq %eax, %rax #1854.106 - movsd 8576+__svml_dlog10_ha_data_internal(%rip), %xmm10 #1869.26 + movsd 8576+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #1869.26 mulsd %xmm1, %xmm10 #1869.26 addsd -8(%rdx,%rax), %xmm14 #1858.13 addsd (%rdx,%rax), %xmm4 #1859.13 - addsd 8640+__svml_dlog10_ha_data_internal(%rip), %xmm10 #1869.14 + addsd 8640+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #1869.14 movaps %xmm14, %xmm3 #1870.13 addsd %xmm10, %xmm2 #1873.13 addsd %xmm1, %xmm3 #1870.13 @@ -823,29 +823,29 @@ __svml_log101_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1880.546 lea 64(%rsp), %rsi #1880.546 -..___tag_value___svml_log101_ha_ex.83: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #1880.546 -..___tag_value___svml_log101_ha_ex.84: +..___tag_value___jsvml_log101_ha_ex.83: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #1880.546 +..___tag_value___jsvml_log101_ha_ex.84: jmp ..B6.4 # Prob 100% #1880.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log101_ha_ex,@function - .size __svml_log101_ha_ex,.-__svml_log101_ha_ex -..LN__svml_log101_ha_ex.5: + .type __jsvml_log101_ha_ex,@function + .size __jsvml_log101_ha_ex,.-__jsvml_log101_ha_ex +..LN__jsvml_log101_ha_ex.5: .data -# -- End __svml_log101_ha_ex +# -- End __jsvml_log101_ha_ex .text -.L_2__routine_start___svml_log102_ha_e9_6: -# -- Begin __svml_log102_ha_e9 +.L_2__routine_start___jsvml_log102_ha_e9_6: +# -- Begin __jsvml_log102_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log102_ha_e9 -# --- __svml_log102_ha_e9(__m128d) -__svml_log102_ha_e9: + .globl __jsvml_log102_ha_e9 +# --- __jsvml_log102_ha_e9(__m128d) +__jsvml_log102_ha_e9: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -854,7 +854,7 @@ __svml_log102_ha_e9: .byte 30 #1977.546 .byte 250 #1977.546 .cfi_startproc -..___tag_value___svml_log102_ha_e9.86: +..___tag_value___jsvml_log102_ha_e9.86: ..L87: #1888.1 pushq %rbp #1888.1 @@ -865,24 +865,24 @@ __svml_log102_ha_e9: andq $-64, %rsp #1888.1 subq $192, %rsp #1888.1 movaps %xmm0, %xmm5 #1934.18 - movups 9024+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1928.15 + movups 9024+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1928.15 psrlq $20, %xmm5 #1934.18 andps %xmm0, %xmm1 #1928.15 - lea -4221888+__svml_dlog10_ha_data_internal(%rip), %rsi #1951.67 - orps 9088+__svml_dlog10_ha_data_internal(%rip), %xmm1 #1929.15 + lea -4221888+__jsvml_dlog10_ha_data_internal(%rip), %rsi #1951.67 + orps 9088+__jsvml_dlog10_ha_data_internal(%rip), %xmm1 #1929.15 movaps %xmm0, %xmm8 #1936.14 cvtpd2ps %xmm1, %xmm2 #1932.53 - cmpltpd 9152+__svml_dlog10_ha_data_internal(%rip), %xmm8 #1936.14 + cmpltpd 9152+__jsvml_dlog10_ha_data_internal(%rip), %xmm8 #1936.14 movlhps %xmm2, %xmm2 #1932.37 movaps %xmm0, %xmm7 #1937.14 rcpps %xmm2, %xmm3 #1932.26 - cmpnlepd 9216+__svml_dlog10_ha_data_internal(%rip), %xmm7 #1937.14 + cmpnlepd 9216+__jsvml_dlog10_ha_data_internal(%rip), %xmm7 #1937.14 cvtps2pd %xmm3, %xmm4 #1932.13 - movups 9344+__svml_dlog10_ha_data_internal(%rip), %xmm9 #1938.45 + movups 9344+__jsvml_dlog10_ha_data_internal(%rip), %xmm9 #1938.45 orps %xmm7, %xmm8 #1942.14 mulpd %xmm9, %xmm4 #1939.17 movmskpd %xmm8, %edx #1944.40 - movups 9280+__svml_dlog10_ha_data_internal(%rip), %xmm10 #1945.50 + movups 9280+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #1945.50 andps %xmm1, %xmm10 #1946.120 roundpd $0, %xmm4, %xmm4 #1940.13 subpd %xmm10, %xmm1 #1946.174 @@ -894,34 +894,34 @@ __svml_log102_ha_e9: cvtdq2pd %xmm6, %xmm14 #1941.20 addpd %xmm10, %xmm1 #1946.367 movd %xmm4, %eax #1951.144 - movups 9472+__svml_dlog10_ha_data_internal(%rip), %xmm12 #1955.25 + movups 9472+__jsvml_dlog10_ha_data_internal(%rip), %xmm12 #1955.25 movaps %xmm1, %xmm5 #1967.13 mulpd %xmm14, %xmm12 #1955.25 movslq %eax, %rax #1951.67 pextrd $2, %xmm4, %ecx #1951.315 movslq %ecx, %rcx #1951.238 - movups 8320+__svml_dlog10_ha_data_internal(%rip), %xmm15 #1963.26 + movups 8320+__jsvml_dlog10_ha_data_internal(%rip), %xmm15 #1963.26 mulpd %xmm1, %xmm15 #1963.26 movups (%rsi,%rax), %xmm2 #1951.67 movups (%rsi,%rcx), %xmm11 #1951.238 movaps %xmm2, %xmm4 #1951.364 unpcklpd %xmm11, %xmm4 #1951.364 addpd %xmm12, %xmm4 #1955.13 - addpd 8384+__svml_dlog10_ha_data_internal(%rip), %xmm15 #1963.14 + addpd 8384+__jsvml_dlog10_ha_data_internal(%rip), %xmm15 #1963.14 addpd %xmm4, %xmm5 #1967.13 movaps %xmm1, %xmm12 #1965.13 mulpd %xmm1, %xmm12 #1965.13 unpckhpd %xmm11, %xmm2 #1951.405 - movups 8448+__svml_dlog10_ha_data_internal(%rip), %xmm11 #1964.26 + movups 8448+__jsvml_dlog10_ha_data_internal(%rip), %xmm11 #1964.26 mulpd %xmm1, %xmm11 #1964.26 mulpd %xmm12, %xmm15 #1968.25 - addpd 8512+__svml_dlog10_ha_data_internal(%rip), %xmm11 #1964.14 - movups 8576+__svml_dlog10_ha_data_internal(%rip), %xmm3 #1966.26 + addpd 8512+__jsvml_dlog10_ha_data_internal(%rip), %xmm11 #1964.14 + movups 8576+__jsvml_dlog10_ha_data_internal(%rip), %xmm3 #1966.26 mulpd %xmm1, %xmm3 #1966.26 addpd %xmm15, %xmm11 #1968.13 - addpd 8640+__svml_dlog10_ha_data_internal(%rip), %xmm3 #1966.14 + addpd 8640+__jsvml_dlog10_ha_data_internal(%rip), %xmm3 #1966.14 mulpd %xmm11, %xmm12 #1970.25 - movups 9536+__svml_dlog10_ha_data_internal(%rip), %xmm13 #1954.45 + movups 9536+__jsvml_dlog10_ha_data_internal(%rip), %xmm13 #1954.45 mulpd %xmm13, %xmm14 #1956.25 addpd %xmm12, %xmm3 #1970.13 addpd %xmm14, %xmm2 #1956.13 @@ -987,29 +987,29 @@ __svml_log102_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1977.546 lea 128(%rsp,%r12,8), %rsi #1977.546 -..___tag_value___svml_log102_ha_e9.104: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #1977.546 -..___tag_value___svml_log102_ha_e9.105: +..___tag_value___jsvml_log102_ha_e9.104: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #1977.546 +..___tag_value___jsvml_log102_ha_e9.105: jmp ..B7.8 # Prob 100% #1977.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log102_ha_e9,@function - .size __svml_log102_ha_e9,.-__svml_log102_ha_e9 -..LN__svml_log102_ha_e9.6: + .type __jsvml_log102_ha_e9,@function + .size __jsvml_log102_ha_e9,.-__jsvml_log102_ha_e9 +..LN__jsvml_log102_ha_e9.6: .data -# -- End __svml_log102_ha_e9 +# -- End __jsvml_log102_ha_e9 .text -.L_2__routine_start___svml_log102_ha_l9_7: -# -- Begin __svml_log102_ha_l9 +.L_2__routine_start___jsvml_log102_ha_l9_7: +# -- Begin __jsvml_log102_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log102_ha_l9 -# --- __svml_log102_ha_l9(__m128d) -__svml_log102_ha_l9: + .globl __jsvml_log102_ha_l9 +# --- __jsvml_log102_ha_l9(__m128d) +__jsvml_log102_ha_l9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1018,7 +1018,7 @@ __svml_log102_ha_l9: .byte 30 #2074.546 .byte 250 #2074.546 .cfi_startproc -..___tag_value___svml_log102_ha_l9.107: +..___tag_value___jsvml_log102_ha_l9.107: ..L108: #1985.1 pushq %rbp #1985.1 @@ -1029,18 +1029,18 @@ __svml_log102_ha_l9: andq $-64, %rsp #1985.1 subq $192, %rsp #1985.1 vmovapd %xmm0, %xmm2 #1985.1 - vandpd 9024+__svml_dlog10_ha_data_internal(%rip), %xmm2, %xmm3 #2025.15 + vandpd 9024+__jsvml_dlog10_ha_data_internal(%rip), %xmm2, %xmm3 #2025.15 vpsrlq $20, %xmm2, %xmm9 #2031.14 - vorpd 9088+__svml_dlog10_ha_data_internal(%rip), %xmm3, %xmm1 #2026.15 - lea -4221888+__svml_dlog10_ha_data_internal(%rip), %rsi #2048.67 + vorpd 9088+__jsvml_dlog10_ha_data_internal(%rip), %xmm3, %xmm1 #2026.15 + lea -4221888+__jsvml_dlog10_ha_data_internal(%rip), %rsi #2048.67 vcvtpd2ps %xmm1, %xmm4 #2029.53 - vcmpltpd 9152+__svml_dlog10_ha_data_internal(%rip), %xmm2, %xmm11 #2033.14 - vcmpnlepd 9216+__svml_dlog10_ha_data_internal(%rip), %xmm2, %xmm12 #2034.14 + vcmpltpd 9152+__jsvml_dlog10_ha_data_internal(%rip), %xmm2, %xmm11 #2033.14 + vcmpnlepd 9216+__jsvml_dlog10_ha_data_internal(%rip), %xmm2, %xmm12 #2034.14 vmovlhps %xmm4, %xmm4, %xmm5 #2029.37 vorpd %xmm12, %xmm11, %xmm13 #2039.14 vrcpps %xmm5, %xmm6 #2029.26 vmovmskpd %xmm13, %edx #2041.40 - vmovupd 9344+__svml_dlog10_ha_data_internal(%rip), %xmm14 #2035.45 + vmovupd 9344+__jsvml_dlog10_ha_data_internal(%rip), %xmm14 #2035.45 vpshufd $221, %xmm9, %xmm10 #2032.15 vcvtps2pd %xmm6, %xmm7 #2029.13 vcvtdq2pd %xmm10, %xmm0 #2038.20 @@ -1048,23 +1048,23 @@ __svml_log102_ha_l9: vroundpd $0, %xmm8, %xmm8 #2037.13 vpsrlq $40, %xmm8, %xmm15 #2045.18 vmovd %xmm15, %eax #2048.144 - vmovupd 8320+__svml_dlog10_ha_data_internal(%rip), %xmm10 #2054.55 - vmovupd 8448+__svml_dlog10_ha_data_internal(%rip), %xmm6 #2056.55 + vmovupd 8320+__jsvml_dlog10_ha_data_internal(%rip), %xmm10 #2054.55 + vmovupd 8448+__jsvml_dlog10_ha_data_internal(%rip), %xmm6 #2056.55 vpextrd $2, %xmm15, %ecx #2048.315 vfmsub213pd %xmm14, %xmm8, %xmm1 #2043.13 - vmovupd 8576+__svml_dlog10_ha_data_internal(%rip), %xmm9 #2058.55 + vmovupd 8576+__jsvml_dlog10_ha_data_internal(%rip), %xmm9 #2058.55 movslq %eax, %rax #2048.67 movslq %ecx, %rcx #2048.238 vmulpd %xmm1, %xmm1, %xmm8 #2062.13 - vfmadd213pd 8512+__svml_dlog10_ha_data_internal(%rip), %xmm1, %xmm6 #2061.14 + vfmadd213pd 8512+__jsvml_dlog10_ha_data_internal(%rip), %xmm1, %xmm6 #2061.14 vmovupd (%rsi,%rax), %xmm3 #2048.67 vmovupd (%rsi,%rcx), %xmm4 #2048.238 vunpcklpd %xmm4, %xmm3, %xmm7 #2048.364 vunpckhpd %xmm4, %xmm3, %xmm5 #2048.405 - vfmadd231pd 9472+__svml_dlog10_ha_data_internal(%rip), %xmm0, %xmm7 #2052.13 - vfmadd213pd 8384+__svml_dlog10_ha_data_internal(%rip), %xmm1, %xmm10 #2060.14 - vfmadd213pd 8640+__svml_dlog10_ha_data_internal(%rip), %xmm1, %xmm9 #2063.14 - vfmadd132pd 9536+__svml_dlog10_ha_data_internal(%rip), %xmm5, %xmm0 #2053.13 + vfmadd231pd 9472+__jsvml_dlog10_ha_data_internal(%rip), %xmm0, %xmm7 #2052.13 + vfmadd213pd 8384+__jsvml_dlog10_ha_data_internal(%rip), %xmm1, %xmm10 #2060.14 + vfmadd213pd 8640+__jsvml_dlog10_ha_data_internal(%rip), %xmm1, %xmm9 #2063.14 + vfmadd132pd 9536+__jsvml_dlog10_ha_data_internal(%rip), %xmm5, %xmm0 #2053.13 vaddpd %xmm7, %xmm1, %xmm13 #2064.13 vfmadd213pd %xmm6, %xmm8, %xmm10 #2065.13 vsubpd %xmm7, %xmm13, %xmm11 #2066.13 @@ -1129,29 +1129,29 @@ __svml_log102_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #2074.546 lea 128(%rsp,%r12,8), %rsi #2074.546 -..___tag_value___svml_log102_ha_l9.125: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #2074.546 -..___tag_value___svml_log102_ha_l9.126: +..___tag_value___jsvml_log102_ha_l9.125: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #2074.546 +..___tag_value___jsvml_log102_ha_l9.126: jmp ..B8.8 # Prob 100% #2074.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log102_ha_l9,@function - .size __svml_log102_ha_l9,.-__svml_log102_ha_l9 -..LN__svml_log102_ha_l9.7: + .type __jsvml_log102_ha_l9,@function + .size __jsvml_log102_ha_l9,.-__jsvml_log102_ha_l9 +..LN__jsvml_log102_ha_l9.7: .data -# -- End __svml_log102_ha_l9 +# -- End __jsvml_log102_ha_l9 .text -.L_2__routine_start___svml_log104_ha_l9_8: -# -- Begin __svml_log104_ha_l9 +.L_2__routine_start___jsvml_log104_ha_l9_8: +# -- Begin __jsvml_log104_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log104_ha_l9 -# --- __svml_log104_ha_l9(__m256d) -__svml_log104_ha_l9: + .globl __jsvml_log104_ha_l9 +# --- __jsvml_log104_ha_l9(__m256d) +__jsvml_log104_ha_l9: # parameter 1: %ymm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1160,7 +1160,7 @@ __svml_log104_ha_l9: .byte 30 #2171.552 .byte 250 #2171.552 .cfi_startproc -..___tag_value___svml_log104_ha_l9.128: +..___tag_value___jsvml_log104_ha_l9.128: ..L129: #2082.1 pushq %rbp #2082.1 @@ -1170,16 +1170,16 @@ __svml_log104_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #2082.1 subq $192, %rsp #2082.1 - lea -4221888+__svml_dlog10_ha_data_internal(%rip), %r8 #2145.68 + lea -4221888+__jsvml_dlog10_ha_data_internal(%rip), %r8 #2145.68 vmovapd %ymm0, %ymm3 #2082.1 - vandpd 9024+__svml_dlog10_ha_data_internal(%rip), %ymm3, %ymm4 #2122.15 - vorpd 9088+__svml_dlog10_ha_data_internal(%rip), %ymm4, %ymm2 #2123.15 + vandpd 9024+__jsvml_dlog10_ha_data_internal(%rip), %ymm3, %ymm4 #2122.15 + vorpd 9088+__jsvml_dlog10_ha_data_internal(%rip), %ymm4, %ymm2 #2123.15 vcvtpd2ps %ymm2, %xmm5 #2126.40 vpsrlq $20, %ymm3, %ymm7 #2128.14 - vmovupd 9344+__svml_dlog10_ha_data_internal(%rip), %ymm15 #2132.48 + vmovupd 9344+__jsvml_dlog10_ha_data_internal(%rip), %ymm15 #2132.48 vrcpps %xmm5, %xmm6 #2126.29 - vcmplt_oqpd 9152+__svml_dlog10_ha_data_internal(%rip), %ymm3, %ymm12 #2130.14 - vcmpnle_uqpd 9216+__svml_dlog10_ha_data_internal(%rip), %ymm3, %ymm13 #2131.14 + vcmplt_oqpd 9152+__jsvml_dlog10_ha_data_internal(%rip), %ymm3, %ymm12 #2130.14 + vcmpnle_uqpd 9216+__jsvml_dlog10_ha_data_internal(%rip), %ymm3, %ymm13 #2131.14 vcvtps2pd %xmm6, %ymm9 #2126.13 vmulpd %ymm15, %ymm9, %ymm10 #2133.17 vroundpd $0, %ymm10, %ymm0 #2134.13 @@ -1197,12 +1197,12 @@ __svml_log104_ha_l9: movslq %ecx, %rcx #2145.268 movslq %esi, %rsi #2145.471 movslq %edi, %rdi #2145.676 - vmovupd 8448+__svml_dlog10_ha_data_internal(%rip), %ymm4 #2153.58 + vmovupd 8448+__jsvml_dlog10_ha_data_internal(%rip), %ymm4 #2153.58 vmovupd (%r8,%rcx), %xmm9 #2145.268 - vmovupd 8576+__svml_dlog10_ha_data_internal(%rip), %ymm5 #2155.58 + vmovupd 8576+__jsvml_dlog10_ha_data_internal(%rip), %ymm5 #2155.58 vmovupd (%r8,%rdi), %xmm12 #2145.676 - vfmadd213pd 8512+__svml_dlog10_ha_data_internal(%rip), %ymm2, %ymm4 #2158.14 - vfmadd213pd 8640+__svml_dlog10_ha_data_internal(%rip), %ymm2, %ymm5 #2160.14 + vfmadd213pd 8512+__jsvml_dlog10_ha_data_internal(%rip), %ymm2, %ymm4 #2158.14 + vfmadd213pd 8640+__jsvml_dlog10_ha_data_internal(%rip), %ymm2, %ymm5 #2160.14 vextractf128 $1, %ymm7, %xmm8 #2129.125 vshufps $221, %xmm8, %xmm7, %xmm11 #2129.33 vmovupd (%r8,%rdx), %xmm8 #2145.68 @@ -1213,9 +1213,9 @@ __svml_log104_ha_l9: vunpckhpd %xmm9, %xmm8, %xmm10 #2145.1008 vunpckhpd %xmm12, %xmm11, %xmm13 #2145.1041 vinsertf128 $1, %xmm7, %ymm6, %ymm0 #2145.835 - vmovupd 8320+__svml_dlog10_ha_data_internal(%rip), %ymm6 #2151.58 - vfmadd231pd 9472+__svml_dlog10_ha_data_internal(%rip), %ymm1, %ymm0 #2149.13 - vfmadd213pd 8384+__svml_dlog10_ha_data_internal(%rip), %ymm2, %ymm6 #2157.14 + vmovupd 8320+__jsvml_dlog10_ha_data_internal(%rip), %ymm6 #2151.58 + vfmadd231pd 9472+__jsvml_dlog10_ha_data_internal(%rip), %ymm1, %ymm0 #2149.13 + vfmadd213pd 8384+__jsvml_dlog10_ha_data_internal(%rip), %ymm2, %ymm6 #2157.14 vaddpd %ymm0, %ymm2, %ymm7 #2161.13 vfmadd213pd %ymm4, %ymm15, %ymm6 #2162.13 vsubpd %ymm0, %ymm7, %ymm0 #2163.13 @@ -1223,7 +1223,7 @@ __svml_log104_ha_l9: vmulpd %ymm6, %ymm2, %ymm4 #2165.13 vsubpd %ymm0, %ymm2, %ymm2 #2166.13 vinsertf128 $1, %xmm13, %ymm10, %ymm14 #2145.962 - vfmadd132pd 9536+__svml_dlog10_ha_data_internal(%rip), %ymm14, %ymm1 #2150.13 + vfmadd132pd 9536+__jsvml_dlog10_ha_data_internal(%rip), %ymm14, %ymm1 #2150.13 vaddpd %ymm2, %ymm1, %ymm1 #2167.13 vaddpd %ymm1, %ymm4, %ymm0 #2168.13 vaddpd %ymm0, %ymm7, %ymm0 #2169.14 @@ -1286,30 +1286,30 @@ __svml_log104_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #2171.552 lea 128(%rsp,%r12,8), %rsi #2171.552 -..___tag_value___svml_log104_ha_l9.146: -# __svml_dlog10_ha_cout_rare_internal(const double *, double *) - call __svml_dlog10_ha_cout_rare_internal #2171.552 -..___tag_value___svml_log104_ha_l9.147: +..___tag_value___jsvml_log104_ha_l9.146: +# __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog10_ha_cout_rare_internal #2171.552 +..___tag_value___jsvml_log104_ha_l9.147: jmp ..B9.8 # Prob 100% #2171.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log104_ha_l9,@function - .size __svml_log104_ha_l9,.-__svml_log104_ha_l9 -..LN__svml_log104_ha_l9.8: + .type __jsvml_log104_ha_l9,@function + .size __jsvml_log104_ha_l9,.-__jsvml_log104_ha_l9 +..LN__jsvml_log104_ha_l9.8: .data -# -- End __svml_log104_ha_l9 +# -- End __jsvml_log104_ha_l9 .text -.L_2__routine_start___svml_dlog10_ha_cout_rare_internal_9: -# -- Begin __svml_dlog10_ha_cout_rare_internal +.L_2__routine_start___jsvml_dlog10_ha_cout_rare_internal_9: +# -- Begin __jsvml_dlog10_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dlog10_ha_cout_rare_internal - .globl __svml_dlog10_ha_cout_rare_internal -# --- __svml_dlog10_ha_cout_rare_internal(const double *, double *) -__svml_dlog10_ha_cout_rare_internal: + .hidden __jsvml_dlog10_ha_cout_rare_internal + .globl __jsvml_dlog10_ha_cout_rare_internal +# --- __jsvml_dlog10_ha_cout_rare_internal(const double *, double *) +__jsvml_dlog10_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1319,7 +1319,7 @@ __svml_dlog10_ha_cout_rare_internal: .byte 30 #1778.19 .byte 250 #1778.19 .cfi_startproc -..___tag_value___svml_dlog10_ha_cout_rare_internal.149: +..___tag_value___jsvml_dlog10_ha_cout_rare_internal.149: ..L150: #1697.1 xorl %eax, %eax #1708.14 @@ -1508,17 +1508,17 @@ __svml_dlog10_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dlog10_ha_cout_rare_internal,@function - .size __svml_dlog10_ha_cout_rare_internal,.-__svml_dlog10_ha_cout_rare_internal -..LN__svml_dlog10_ha_cout_rare_internal.9: + .type __jsvml_dlog10_ha_cout_rare_internal,@function + .size __jsvml_dlog10_ha_cout_rare_internal,.-__jsvml_dlog10_ha_cout_rare_internal +..LN__jsvml_dlog10_ha_cout_rare_internal.9: .data -# -- End __svml_dlog10_ha_cout_rare_internal +# -- End __jsvml_dlog10_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dlog10_ha_data_internal_avx512 - .globl __svml_dlog10_ha_data_internal_avx512 -__svml_dlog10_ha_data_internal_avx512: + .hidden __jsvml_dlog10_ha_data_internal_avx512 + .globl __jsvml_dlog10_ha_data_internal_avx512 +__jsvml_dlog10_ha_data_internal_avx512: .long 0 .long 0 .long 721420288 @@ -1855,12 +1855,12 @@ __svml_dlog10_ha_data_internal_avx512: .long 0 .long 120 .long 0 - .type __svml_dlog10_ha_data_internal_avx512,@object - .size __svml_dlog10_ha_data_internal_avx512,1344 + .type __jsvml_dlog10_ha_data_internal_avx512,@object + .size __jsvml_dlog10_ha_data_internal_avx512,1344 .align 64 - .hidden __svml_dlog10_ha_data_internal - .globl __svml_dlog10_ha_data_internal -__svml_dlog10_ha_data_internal: + .hidden __jsvml_dlog10_ha_data_internal + .globl __jsvml_dlog10_ha_data_internal +__jsvml_dlog10_ha_data_internal: .long 1190572160 .long 3228777073 .long 3860447744 @@ -4559,8 +4559,8 @@ __svml_dlog10_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_dlog10_ha_data_internal,@object - .size __svml_dlog10_ha_data_internal,10048 + .type __jsvml_dlog10_ha_data_internal,@object + .size __jsvml_dlog10_ha_data_internal,10048 .align 32 _vmldLgHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_log1p_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log1p_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_log1p_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log1p_linux_x86.S index b22c36dafe4..29738f58bf0 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_log1p_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log1p_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_log1p.c" .text ..TXTST0: -.L_2__routine_start___svml_log1p4_ha_l9_0: -# -- Begin __svml_log1p4_ha_l9 +.L_2__routine_start___jsvml_log1p4_ha_l9_0: +# -- Begin __jsvml_log1p4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p4_ha_l9 -# --- __svml_log1p4_ha_l9(__m256d) -__svml_log1p4_ha_l9: + .globl __jsvml_log1p4_ha_l9 +# --- __jsvml_log1p4_ha_l9(__m256d) +__jsvml_log1p4_ha_l9: # parameter 1: %ymm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_log1p4_ha_l9: .byte 30 #1365.552 .byte 250 #1365.552 .cfi_startproc -..___tag_value___svml_log1p4_ha_l9.1: +..___tag_value___jsvml_log1p4_ha_l9.1: ..L2: #1244.1 pushq %rbp #1244.1 @@ -57,29 +57,29 @@ __svml_log1p4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1244.1 subq $192, %rsp #1244.1 - lea -8454144+__svml_dlog1p_ha_data_internal(%rip), %r8 #1338.68 - vmovupd 13056+__svml_dlog1p_ha_data_internal(%rip), %ymm15 #1297.52 - vmovupd 12992+__svml_dlog1p_ha_data_internal(%rip), %ymm10 #1296.44 - vmovupd 13632+__svml_dlog1p_ha_data_internal(%rip), %ymm5 #1317.17 + lea -8454144+__jsvml_dlog1p_ha_data_internal(%rip), %r8 #1338.68 + vmovupd 13056+__jsvml_dlog1p_ha_data_internal(%rip), %ymm15 #1297.52 + vmovupd 12992+__jsvml_dlog1p_ha_data_internal(%rip), %ymm10 #1296.44 + vmovupd 13632+__jsvml_dlog1p_ha_data_internal(%rip), %ymm5 #1317.17 vmovapd %ymm0, %ymm12 #1244.1 vandpd %ymm15, %ymm12, %ymm13 #1302.15 - vcmplt_oqpd 13120+__svml_dlog1p_ha_data_internal(%rip), %ymm13, %ymm14 #1303.16 + vcmplt_oqpd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %ymm13, %ymm14 #1303.16 vaddpd %ymm10, %ymm12, %ymm3 #1300.8 vmaxpd %ymm12, %ymm10, %ymm8 #1301.8 vminpd %ymm12, %ymm10, %ymm9 #1306.8 - vorpd 13184+__svml_dlog1p_ha_data_internal(%rip), %ymm14, %ymm0 #1304.17 + vorpd 13184+__jsvml_dlog1p_ha_data_internal(%rip), %ymm14, %ymm0 #1304.17 vandpd %ymm0, %ymm3, %ymm7 #1307.12 - vandpd 12672+__svml_dlog1p_ha_data_internal(%rip), %ymm7, %ymm1 #1312.15 + vandpd 12672+__jsvml_dlog1p_ha_data_internal(%rip), %ymm7, %ymm1 #1312.15 vsubpd %ymm7, %ymm8, %ymm4 #1308.9 - vcmplt_oqpd 12800+__svml_dlog1p_ha_data_internal(%rip), %ymm12, %ymm0 #1325.14 + vcmplt_oqpd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %ymm12, %ymm0 #1325.14 vpsrlq $20, %ymm7, %ymm14 #1323.14 vaddpd %ymm4, %ymm9, %ymm9 #1309.9 - vorpd 12736+__svml_dlog1p_ha_data_internal(%rip), %ymm1, %ymm8 #1313.15 + vorpd 12736+__jsvml_dlog1p_ha_data_internal(%rip), %ymm1, %ymm8 #1313.15 vcvtpd2ps %ymm8, %xmm2 #1318.40 - vcmpnle_uqpd 12864+__svml_dlog1p_ha_data_internal(%rip), %ymm12, %ymm1 #1326.14 + vcmpnle_uqpd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %ymm12, %ymm1 #1326.14 vrcpps %xmm2, %xmm6 #1318.29 vcvtps2pd %xmm6, %ymm13 #1318.13 - vandps 13568+__svml_dlog1p_ha_data_internal(%rip), %ymm7, %ymm7 #1320.13 + vandps 13568+__jsvml_dlog1p_ha_data_internal(%rip), %ymm7, %ymm7 #1320.13 vpsubq %ymm7, %ymm5, %ymm5 #1321.13 vroundpd $0, %ymm13, %ymm6 #1322.13 vfmsub213pd %ymm10, %ymm6, %ymm8 #1327.13 @@ -87,7 +87,7 @@ __svml_log1p4_ha_l9: vorpd %ymm1, %ymm0, %ymm10 #1331.14 vpsrlq $39, %ymm6, %ymm0 #1335.18 vmulpd %ymm4, %ymm9, %ymm4 #1344.13 - vmovupd 12544+__svml_dlog1p_ha_data_internal(%rip), %ymm9 #1350.58 + vmovupd 12544+__jsvml_dlog1p_ha_data_internal(%rip), %ymm9 #1350.58 vandnpd %ymm12, %ymm15, %ymm11 #1305.19 vmovmskpd %ymm10, %eax #1333.40 vextractf128 $1, %ymm0, %xmm5 #1338.567 @@ -112,16 +112,16 @@ __svml_log1p4_ha_l9: vaddpd %ymm4, %ymm8, %ymm15 #1345.12 vcvtdq2pd %xmm3, %ymm3 #1330.20 vsubpd %ymm8, %ymm15, %ymm8 #1346.14 - vfmadd213pd 12608+__svml_dlog1p_ha_data_internal(%rip), %ymm15, %ymm9 #1353.14 + vfmadd213pd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %ymm15, %ymm9 #1353.14 vinsertf128 $1, %xmm1, %ymm2, %ymm14 #1338.962 vsubpd %ymm8, %ymm4, %ymm1 #1347.13 - vmovupd 12416+__svml_dlog1p_ha_data_internal(%rip), %ymm4 #1348.58 + vmovupd 12416+__jsvml_dlog1p_ha_data_internal(%rip), %ymm4 #1348.58 vmulpd %ymm15, %ymm15, %ymm2 #1354.13 - vfmadd213pd 12480+__svml_dlog1p_ha_data_internal(%rip), %ymm15, %ymm4 #1352.14 + vfmadd213pd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %ymm15, %ymm4 #1352.14 vfmadd213pd %ymm9, %ymm2, %ymm4 #1355.12 vinsertf128 $1, %xmm7, %ymm6, %ymm0 #1338.835 - vfmadd231pd 13248+__svml_dlog1p_ha_data_internal(%rip), %ymm3, %ymm0 #1342.13 - vfmadd132pd 13312+__svml_dlog1p_ha_data_internal(%rip), %ymm14, %ymm3 #1343.13 + vfmadd231pd 13248+__jsvml_dlog1p_ha_data_internal(%rip), %ymm3, %ymm0 #1342.13 + vfmadd132pd 13312+__jsvml_dlog1p_ha_data_internal(%rip), %ymm14, %ymm3 #1343.13 vaddpd %ymm15, %ymm0, %ymm5 #1356.17 vaddpd %ymm1, %ymm3, %ymm3 #1359.13 vsubpd %ymm0, %ymm5, %ymm0 #1357.13 @@ -189,29 +189,29 @@ __svml_log1p4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1365.552 lea 128(%rsp,%r12,8), %rsi #1365.552 -..___tag_value___svml_log1p4_ha_l9.19: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #1365.552 -..___tag_value___svml_log1p4_ha_l9.20: +..___tag_value___jsvml_log1p4_ha_l9.19: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #1365.552 +..___tag_value___jsvml_log1p4_ha_l9.20: jmp ..B1.8 # Prob 100% #1365.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1p4_ha_l9,@function - .size __svml_log1p4_ha_l9,.-__svml_log1p4_ha_l9 -..LN__svml_log1p4_ha_l9.0: + .type __jsvml_log1p4_ha_l9,@function + .size __jsvml_log1p4_ha_l9,.-__jsvml_log1p4_ha_l9 +..LN__jsvml_log1p4_ha_l9.0: .data -# -- End __svml_log1p4_ha_l9 +# -- End __jsvml_log1p4_ha_l9 .text -.L_2__routine_start___svml_log1p2_ha_ex_1: -# -- Begin __svml_log1p2_ha_ex +.L_2__routine_start___jsvml_log1p2_ha_ex_1: +# -- Begin __jsvml_log1p2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log1p2_ha_ex -# --- __svml_log1p2_ha_ex(__m128d) -__svml_log1p2_ha_ex: + .globl __jsvml_log1p2_ha_ex +# --- __jsvml_log1p2_ha_ex(__m128d) +__jsvml_log1p2_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -220,7 +220,7 @@ __svml_log1p2_ha_ex: .byte 30 #1494.546 .byte 250 #1494.546 .cfi_startproc -..___tag_value___svml_log1p2_ha_ex.22: +..___tag_value___jsvml_log1p2_ha_ex.22: ..L23: #1373.1 pushq %rbp #1373.1 @@ -231,26 +231,26 @@ __svml_log1p2_ha_ex: andq $-64, %rsp #1373.1 subq $192, %rsp #1373.1 movaps %xmm0, %xmm8 #1373.1 - movups 13056+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #1426.49 + movups 13056+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #1426.49 movaps %xmm8, %xmm1 #1454.14 movaps %xmm7, %xmm9 #1431.15 movaps %xmm8, %xmm2 #1455.14 - movups 12992+__svml_dlog1p_ha_data_internal(%rip), %xmm3 #1425.41 + movups 12992+__jsvml_dlog1p_ha_data_internal(%rip), %xmm3 #1425.41 andps %xmm8, %xmm9 #1431.15 - cmpltpd 13120+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #1432.16 - cmpltpd 12800+__svml_dlog1p_ha_data_internal(%rip), %xmm1 #1454.14 - cmpnlepd 12864+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #1455.14 + cmpltpd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #1432.16 + cmpltpd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %xmm1 #1454.14 + cmpnlepd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #1455.14 movaps %xmm3, %xmm4 #1429.8 movaps %xmm3, %xmm10 #1430.8 addpd %xmm8, %xmm4 #1429.8 maxpd %xmm8, %xmm10 #1430.8 - orps 13184+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #1433.17 + orps 13184+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #1433.17 movaps %xmm3, %xmm6 #1435.8 - movups 12672+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #1441.15 + movups 12672+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #1441.15 andps %xmm9, %xmm4 #1436.12 andps %xmm4, %xmm5 #1441.15 - lea -8454144+__svml_dlog1p_ha_data_internal(%rip), %rsi #1467.67 - orps 12736+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #1442.15 + lea -8454144+__jsvml_dlog1p_ha_data_internal(%rip), %rsi #1467.67 + orps 12736+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #1442.15 orps %xmm2, %xmm1 #1460.14 cvtpd2ps %xmm5, %xmm11 #1447.53 minpd %xmm8, %xmm6 #1435.8 @@ -264,8 +264,8 @@ __svml_log1p2_ha_ex: movups .L_2il0floatpacket.31(%rip), %xmm14 #1451.103 addpd %xmm14, %xmm9 #1451.293 subpd %xmm14, %xmm9 #1451.343 - movdqu 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #1449.11 - movdqu 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm0 #1450.11 + movdqu 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #1449.11 + movdqu 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0 #1450.11 pand %xmm4, %xmm13 #1449.11 psubq %xmm13, %xmm0 #1450.11 mulpd %xmm9, %xmm5 #1456.25 @@ -278,8 +278,8 @@ __svml_log1p2_ha_ex: pshufd $2, %xmm9, %xmm3 #1467.331 pshufd $221, %xmm4, %xmm15 #1453.13 movd %xmm3, %ecx #1467.313 - movups 12544+__svml_dlog1p_ha_data_internal(%rip), %xmm14 #1482.26 - movups 13248+__svml_dlog1p_ha_data_internal(%rip), %xmm10 #1471.25 + movups 12544+__jsvml_dlog1p_ha_data_internal(%rip), %xmm14 #1482.26 + movups 13248+__jsvml_dlog1p_ha_data_internal(%rip), %xmm10 #1471.25 movslq %eax, %rax #1467.67 movslq %ecx, %rcx #1467.236 cvtdq2pd %xmm15, %xmm12 #1459.20 @@ -293,19 +293,19 @@ __svml_log1p2_ha_ex: mulpd %xmm12, %xmm10 #1471.25 mulpd %xmm4, %xmm14 #1482.26 addpd %xmm10, %xmm1 #1471.13 - addpd 12608+__svml_dlog1p_ha_data_internal(%rip), %xmm14 #1482.14 + addpd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %xmm14 #1482.14 movaps %xmm4, %xmm0 #1475.14 movaps %xmm4, %xmm3 #1483.13 subpd %xmm5, %xmm0 #1475.14 mulpd %xmm4, %xmm3 #1483.13 subpd %xmm0, %xmm6 #1476.13 - movups 12416+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #1481.26 + movups 12416+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #1481.26 movaps %xmm1, %xmm0 #1485.17 mulpd %xmm4, %xmm5 #1481.26 addpd %xmm4, %xmm0 #1485.17 - addpd 12480+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #1481.14 + addpd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #1481.14 mulpd %xmm3, %xmm5 #1484.24 - movups 13312+__svml_dlog1p_ha_data_internal(%rip), %xmm11 #1470.45 + movups 13312+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11 #1470.45 movaps %xmm0, %xmm13 #1486.13 mulpd %xmm11, %xmm12 #1472.25 addpd %xmm5, %xmm14 #1484.12 @@ -372,29 +372,29 @@ __svml_log1p2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1494.546 lea 128(%rsp,%r12,8), %rsi #1494.546 -..___tag_value___svml_log1p2_ha_ex.40: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #1494.546 -..___tag_value___svml_log1p2_ha_ex.41: +..___tag_value___jsvml_log1p2_ha_ex.40: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #1494.546 +..___tag_value___jsvml_log1p2_ha_ex.41: jmp ..B2.8 # Prob 100% #1494.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1p2_ha_ex,@function - .size __svml_log1p2_ha_ex,.-__svml_log1p2_ha_ex -..LN__svml_log1p2_ha_ex.1: + .type __jsvml_log1p2_ha_ex,@function + .size __jsvml_log1p2_ha_ex,.-__jsvml_log1p2_ha_ex +..LN__jsvml_log1p2_ha_ex.1: .data -# -- End __svml_log1p2_ha_ex +# -- End __jsvml_log1p2_ha_ex .text -.L_2__routine_start___svml_log1p1_ha_l9_2: -# -- Begin __svml_log1p1_ha_l9 +.L_2__routine_start___jsvml_log1p1_ha_l9_2: +# -- Begin __jsvml_log1p1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p1_ha_l9 -# --- __svml_log1p1_ha_l9(__m128d) -__svml_log1p1_ha_l9: + .globl __jsvml_log1p1_ha_l9 +# --- __jsvml_log1p1_ha_l9(__m128d) +__jsvml_log1p1_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -403,7 +403,7 @@ __svml_log1p1_ha_l9: .byte 30 #1623.546 .byte 250 #1623.546 .cfi_startproc -..___tag_value___svml_log1p1_ha_l9.43: +..___tag_value___jsvml_log1p1_ha_l9.43: ..L44: #1502.1 pushq %rbp #1502.1 @@ -414,21 +414,21 @@ __svml_log1p1_ha_l9: andq $-64, %rsp #1502.1 subq $128, %rsp #1502.1 vmovapd %xmm0, %xmm11 #1502.1 - vmovsd 13056+__svml_dlog1p_ha_data_internal(%rip), %xmm15 #1555.18 - lea -8454136+__svml_dlog1p_ha_data_internal(%rip), %rdx #1596.17 + vmovsd 13056+__jsvml_dlog1p_ha_data_internal(%rip), %xmm15 #1555.18 + lea -8454136+__jsvml_dlog1p_ha_data_internal(%rip), %rdx #1596.17 vandpd %xmm15, %xmm11, %xmm12 #1560.15 vandnpd %xmm11, %xmm15, %xmm9 #1563.19 - vmovsd 12992+__svml_dlog1p_ha_data_internal(%rip), %xmm10 #1554.10 - vmovsd 13184+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #1557.17 + vmovsd 12992+__jsvml_dlog1p_ha_data_internal(%rip), %xmm10 #1554.10 + vmovsd 13184+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #1557.17 vaddsd %xmm11, %xmm10, %xmm6 #1558.8 - vcmpltsd 13120+__svml_dlog1p_ha_data_internal(%rip), %xmm12, %xmm14 #1561.16 + vcmpltsd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %xmm12, %xmm14 #1561.16 vorpd %xmm14, %xmm13, %xmm7 #1562.17 - vmovsd 12672+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #1568.14 + vmovsd 12672+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #1568.14 vandpd %xmm7, %xmm6, %xmm8 #1565.12 - vmovsd 12736+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #1569.12 + vmovsd 12736+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #1569.12 vandpd %xmm5, %xmm8, %xmm12 #1570.15 vorpd %xmm13, %xmm12, %xmm6 #1571.15 - vcmpltsd 12800+__svml_dlog1p_ha_data_internal(%rip), %xmm11, %xmm5 #1583.14 + vcmpltsd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11, %xmm5 #1583.14 vcvtpd2ps %xmm6, %xmm14 #1576.53 vunpcklpd %xmm10, %xmm10, %xmm1 #1559.20 vunpcklpd %xmm11, %xmm11, %xmm0 #1559.73 @@ -439,11 +439,11 @@ __svml_log1p1_ha_l9: vsubsd %xmm8, %xmm2, %xmm4 #1566.9 vcvtps2pd %xmm1, %xmm0 #1576.13 vaddsd %xmm3, %xmm4, %xmm7 #1567.9 - vcmpnlesd 12864+__svml_dlog1p_ha_data_internal(%rip), %xmm11, %xmm3 #1584.14 - vmovq 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #1574.17 + vcmpnlesd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11, %xmm3 #1584.14 + vmovq 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #1574.17 vorpd %xmm3, %xmm5, %xmm3 #1589.14 vroundsd $0, %xmm0, %xmm0, %xmm4 #1580.13 - vmovq 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm12 #1575.17 + vmovq 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm12 #1575.17 vfmsub213sd %xmm10, %xmm4, %xmm6 #1585.13 vpand %xmm2, %xmm8, %xmm10 #1578.13 vpsubq %xmm10, %xmm12, %xmm1 #1579.13 @@ -459,7 +459,7 @@ __svml_log1p1_ha_l9: vaddsd %xmm2, %xmm6, %xmm12 #1603.12 movslq %eax, %rax #1596.106 vmovapd %xmm1, %xmm0 #1600.13 - vmovsd 13248+__svml_dlog1p_ha_data_internal(%rip), %xmm8 #1598.14 + vmovsd 13248+__jsvml_dlog1p_ha_data_internal(%rip), %xmm8 #1598.14 vsubsd %xmm6, %xmm12, %xmm6 #1604.14 vmulsd %xmm12, %xmm12, %xmm15 #1612.13 vfmadd213sd -8(%rdx,%rax), %xmm8, %xmm0 #1600.13 @@ -469,12 +469,12 @@ __svml_log1p1_ha_l9: vsubsd %xmm0, %xmm3, %xmm13 #1615.13 vunpcklpd %xmm5, %xmm5, %xmm10 #1596.162 vsubsd %xmm13, %xmm12, %xmm0 #1616.14 - vfmadd132sd 13312+__svml_dlog1p_ha_data_internal(%rip), %xmm10, %xmm1 #1601.13 - vmovsd 12416+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #1606.24 - vmovsd 12544+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #1608.24 + vfmadd132sd 13312+__jsvml_dlog1p_ha_data_internal(%rip), %xmm10, %xmm1 #1601.13 + vmovsd 12416+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #1606.24 + vmovsd 12544+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #1608.24 vaddsd %xmm14, %xmm1, %xmm1 #1617.13 - vfmadd213sd 12480+__svml_dlog1p_ha_data_internal(%rip), %xmm12, %xmm2 #1610.14 - vfmadd213sd 12608+__svml_dlog1p_ha_data_internal(%rip), %xmm12, %xmm7 #1611.14 + vfmadd213sd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %xmm12, %xmm2 #1610.14 + vfmadd213sd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %xmm12, %xmm7 #1611.14 vfmadd213sd %xmm7, %xmm15, %xmm2 #1613.12 vfmadd213sd %xmm1, %xmm15, %xmm2 #1618.12 vaddsd %xmm2, %xmm0, %xmm12 #1619.13 @@ -518,29 +518,29 @@ __svml_log1p1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1623.546 lea 64(%rsp), %rsi #1623.546 -..___tag_value___svml_log1p1_ha_l9.56: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #1623.546 -..___tag_value___svml_log1p1_ha_l9.57: +..___tag_value___jsvml_log1p1_ha_l9.56: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #1623.546 +..___tag_value___jsvml_log1p1_ha_l9.57: jmp ..B3.4 # Prob 100% #1623.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log1p1_ha_l9,@function - .size __svml_log1p1_ha_l9,.-__svml_log1p1_ha_l9 -..LN__svml_log1p1_ha_l9.2: + .type __jsvml_log1p1_ha_l9,@function + .size __jsvml_log1p1_ha_l9,.-__jsvml_log1p1_ha_l9 +..LN__jsvml_log1p1_ha_l9.2: .data -# -- End __svml_log1p1_ha_l9 +# -- End __jsvml_log1p1_ha_l9 .text -.L_2__routine_start___svml_log1p1_ha_e9_3: -# -- Begin __svml_log1p1_ha_e9 +.L_2__routine_start___jsvml_log1p1_ha_e9_3: +# -- Begin __jsvml_log1p1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p1_ha_e9 -# --- __svml_log1p1_ha_e9(__m128d) -__svml_log1p1_ha_e9: + .globl __jsvml_log1p1_ha_e9 +# --- __jsvml_log1p1_ha_e9(__m128d) +__jsvml_log1p1_ha_e9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -549,7 +549,7 @@ __svml_log1p1_ha_e9: .byte 30 #1752.546 .byte 250 #1752.546 .cfi_startproc -..___tag_value___svml_log1p1_ha_e9.59: +..___tag_value___jsvml_log1p1_ha_e9.59: ..L60: #1631.1 pushq %rbp #1631.1 @@ -560,24 +560,24 @@ __svml_log1p1_ha_e9: andq $-64, %rsp #1631.1 subq $128, %rsp #1631.1 movaps %xmm0, %xmm6 #1631.1 - movsd 13056+__svml_dlog1p_ha_data_internal(%rip), %xmm4 #1684.18 + movsd 13056+__jsvml_dlog1p_ha_data_internal(%rip), %xmm4 #1684.18 movaps %xmm6, %xmm8 #1688.73 movaps %xmm4, %xmm7 #1689.15 - lea -8454136+__svml_dlog1p_ha_data_internal(%rip), %rdx #1725.17 - movsd 12992+__svml_dlog1p_ha_data_internal(%rip), %xmm0 #1683.10 + lea -8454136+__jsvml_dlog1p_ha_data_internal(%rip), %rdx #1725.17 + movsd 12992+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0 #1683.10 andps %xmm6, %xmm7 #1689.15 movaps %xmm0, %xmm3 #1687.8 movaps %xmm0, %xmm10 #1688.20 - movsd 13184+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #1691.17 + movsd 13184+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #1691.17 andnps %xmm6, %xmm4 #1692.19 - movsd 12672+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #1699.15 + movsd 12672+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #1699.15 addsd %xmm6, %xmm3 #1687.8 - cmpltsd 13120+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #1690.16 + cmpltsd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #1690.16 orps %xmm7, %xmm9 #1691.17 movaps %xmm6, %xmm7 #1713.14 andps %xmm9, %xmm3 #1694.12 - cmpnlesd 12864+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #1713.14 - movsd 12736+__svml_dlog1p_ha_data_internal(%rip), %xmm11 #1698.12 + cmpnlesd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #1713.14 + movsd 12736+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11 #1698.12 andps %xmm3, %xmm2 #1699.15 orps %xmm11, %xmm2 #1700.15 cvtpd2ps %xmm2, %xmm12 #1705.53 @@ -594,11 +594,11 @@ __svml_log1p1_ha_e9: movaps %xmm6, %xmm8 #1712.14 mulsd %xmm9, %xmm2 #1714.25 addsd %xmm10, %xmm5 #1696.9 - cmpltsd 12800+__svml_dlog1p_ha_data_internal(%rip), %xmm8 #1712.14 + cmpltsd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %xmm8 #1712.14 subsd %xmm0, %xmm2 #1714.13 - movq 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm14 #1707.17 + movq 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm14 #1707.17 orps %xmm7, %xmm8 #1718.14 - movq 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm0 #1708.17 + movq 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0 #1708.17 pand %xmm3, %xmm14 #1707.17 psubq %xmm14, %xmm0 #1708.17 movmskpd %xmm8, %ecx #1720.40 @@ -612,23 +612,23 @@ __svml_log1p1_ha_e9: movaps %xmm2, %xmm0 #1732.12 cvtdq2pd %xmm1, %xmm1 #1717.20 addsd %xmm5, %xmm0 #1732.12 - movsd 12416+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #1739.26 + movsd 12416+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #1739.26 movaps %xmm1, %xmm10 #1729.25 mulsd %xmm0, %xmm13 #1739.26 movaps %xmm0, %xmm3 #1733.14 subsd %xmm2, %xmm3 #1733.14 - mulsd 13248+__svml_dlog1p_ha_data_internal(%rip), %xmm10 #1729.25 - mulsd 13312+__svml_dlog1p_ha_data_internal(%rip), %xmm1 #1730.25 - addsd 12480+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #1739.14 + mulsd 13248+__jsvml_dlog1p_ha_data_internal(%rip), %xmm10 #1729.25 + mulsd 13312+__jsvml_dlog1p_ha_data_internal(%rip), %xmm1 #1730.25 + addsd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #1739.14 subsd %xmm3, %xmm5 #1734.13 movslq %eax, %rax #1725.106 movaps %xmm0, %xmm12 #1741.13 - movsd 12544+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #1740.26 + movsd 12544+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #1740.26 mulsd %xmm0, %xmm2 #1740.26 mulsd %xmm0, %xmm12 #1741.13 addsd -8(%rdx,%rax), %xmm10 #1729.13 addsd (%rdx,%rax), %xmm1 #1730.13 - addsd 12608+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #1740.14 + addsd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #1740.14 mulsd %xmm12, %xmm13 #1742.24 addsd %xmm5, %xmm1 #1746.13 addsd %xmm2, %xmm13 #1742.12 @@ -676,29 +676,29 @@ __svml_log1p1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1752.546 lea 64(%rsp), %rsi #1752.546 -..___tag_value___svml_log1p1_ha_e9.72: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #1752.546 -..___tag_value___svml_log1p1_ha_e9.73: +..___tag_value___jsvml_log1p1_ha_e9.72: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #1752.546 +..___tag_value___jsvml_log1p1_ha_e9.73: jmp ..B4.4 # Prob 100% #1752.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log1p1_ha_e9,@function - .size __svml_log1p1_ha_e9,.-__svml_log1p1_ha_e9 -..LN__svml_log1p1_ha_e9.3: + .type __jsvml_log1p1_ha_e9,@function + .size __jsvml_log1p1_ha_e9,.-__jsvml_log1p1_ha_e9 +..LN__jsvml_log1p1_ha_e9.3: .data -# -- End __svml_log1p1_ha_e9 +# -- End __jsvml_log1p1_ha_e9 .text -.L_2__routine_start___svml_log1p4_ha_e9_4: -# -- Begin __svml_log1p4_ha_e9 +.L_2__routine_start___jsvml_log1p4_ha_e9_4: +# -- Begin __jsvml_log1p4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p4_ha_e9 -# --- __svml_log1p4_ha_e9(__m256d) -__svml_log1p4_ha_e9: + .globl __jsvml_log1p4_ha_e9 +# --- __jsvml_log1p4_ha_e9(__m256d) +__jsvml_log1p4_ha_e9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -707,7 +707,7 @@ __svml_log1p4_ha_e9: .byte 30 #1881.552 .byte 250 #1881.552 .cfi_startproc -..___tag_value___svml_log1p4_ha_e9.75: +..___tag_value___jsvml_log1p4_ha_e9.75: ..L76: #1760.1 pushq %rbp #1760.1 @@ -717,27 +717,27 @@ __svml_log1p4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1760.1 subq $192, %rsp #1760.1 - lea -8454144+__svml_dlog1p_ha_data_internal(%rip), %r8 #1854.68 - vmovupd 13056+__svml_dlog1p_ha_data_internal(%rip), %ymm8 #1813.52 - vmovupd 12992+__svml_dlog1p_ha_data_internal(%rip), %ymm1 #1812.44 - vmovupd 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm4 #1832.21 - vmovupd 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm6 #1833.21 + lea -8454144+__jsvml_dlog1p_ha_data_internal(%rip), %r8 #1854.68 + vmovupd 13056+__jsvml_dlog1p_ha_data_internal(%rip), %ymm8 #1813.52 + vmovupd 12992+__jsvml_dlog1p_ha_data_internal(%rip), %ymm1 #1812.44 + vmovupd 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm4 #1832.21 + vmovupd 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm6 #1833.21 vmovapd %ymm0, %ymm3 #1760.1 vandpd %ymm8, %ymm3, %ymm2 #1818.15 - vcmplt_oqpd 13120+__svml_dlog1p_ha_data_internal(%rip), %ymm2, %ymm9 #1819.16 + vcmplt_oqpd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %ymm2, %ymm9 #1819.16 vaddpd %ymm1, %ymm3, %ymm7 #1816.8 vmaxpd %ymm3, %ymm1, %ymm10 #1817.8 vminpd %ymm3, %ymm1, %ymm11 #1822.8 - vorpd 13184+__svml_dlog1p_ha_data_internal(%rip), %ymm9, %ymm15 #1820.17 + vorpd 13184+__jsvml_dlog1p_ha_data_internal(%rip), %ymm9, %ymm15 #1820.17 vandpd %ymm15, %ymm7, %ymm14 #1823.12 - vandpd 12672+__svml_dlog1p_ha_data_internal(%rip), %ymm14, %ymm13 #1828.15 - vorpd 12736+__svml_dlog1p_ha_data_internal(%rip), %ymm13, %ymm5 #1829.15 + vandpd 12672+__jsvml_dlog1p_ha_data_internal(%rip), %ymm14, %ymm13 #1828.15 + vorpd 12736+__jsvml_dlog1p_ha_data_internal(%rip), %ymm13, %ymm5 #1829.15 vcvtpd2ps %ymm5, %xmm9 #1834.40 vsubpd %ymm14, %ymm10, %ymm12 #1824.9 vrcpps %xmm9, %xmm9 #1834.29 vaddpd %ymm12, %ymm11, %ymm0 #1825.9 - vcmplt_oqpd 12800+__svml_dlog1p_ha_data_internal(%rip), %ymm3, %ymm12 #1841.14 - vcmpnle_uqpd 12864+__svml_dlog1p_ha_data_internal(%rip), %ymm3, %ymm11 #1842.14 + vcmplt_oqpd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %ymm3, %ymm12 #1841.14 + vcmpnle_uqpd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %ymm3, %ymm11 #1842.14 vandnpd %ymm3, %ymm8, %ymm2 #1821.19 vcvtps2pd %xmm9, %ymm8 #1834.13 vroundpd $0, %ymm8, %ymm15 #1838.13 @@ -770,14 +770,14 @@ __svml_log1p4_ha_e9: movslq %ecx, %rcx #1854.246 movslq %esi, %rsi #1854.427 movslq %edi, %rdi #1854.605 - vmulpd 13248+__svml_dlog1p_ha_data_internal(%rip), %ymm8, %ymm4 #1858.28 + vmulpd 13248+__jsvml_dlog1p_ha_data_internal(%rip), %ymm8, %ymm4 #1858.28 vmovupd (%r8,%rdx), %xmm12 #1854.68 vmovupd (%r8,%rcx), %xmm13 #1854.246 vmovupd (%r8,%rsi), %xmm7 #1854.427 vmovupd (%r8,%rdi), %xmm15 #1854.605 vunpcklpd %xmm13, %xmm12, %xmm10 #1854.783 vunpcklpd %xmm15, %xmm7, %xmm11 #1854.816 - vmulpd 13312+__svml_dlog1p_ha_data_internal(%rip), %ymm8, %ymm8 #1859.28 + vmulpd 13312+__jsvml_dlog1p_ha_data_internal(%rip), %ymm8, %ymm8 #1859.28 vunpckhpd %xmm13, %xmm12, %xmm14 #1854.910 vunpckhpd %xmm15, %xmm7, %xmm7 #1854.943 vinsertf128 $1, %xmm11, %ymm10, %ymm5 #1854.737 @@ -788,13 +788,13 @@ __svml_log1p4_ha_e9: vmulpd %ymm4, %ymm4, %ymm11 #1870.13 vsubpd %ymm1, %ymm0, %ymm10 #1863.13 vsubpd %ymm6, %ymm15, %ymm6 #1873.13 - vmulpd 12416+__svml_dlog1p_ha_data_internal(%rip), %ymm4, %ymm0 #1868.29 - vmulpd 12544+__svml_dlog1p_ha_data_internal(%rip), %ymm4, %ymm1 #1869.29 + vmulpd 12416+__jsvml_dlog1p_ha_data_internal(%rip), %ymm4, %ymm0 #1868.29 + vmulpd 12544+__jsvml_dlog1p_ha_data_internal(%rip), %ymm4, %ymm1 #1869.29 vsubpd %ymm6, %ymm4, %ymm13 #1874.14 vinsertf128 $1, %xmm7, %ymm14, %ymm7 #1854.864 vaddpd %ymm8, %ymm7, %ymm5 #1859.13 - vaddpd 12480+__svml_dlog1p_ha_data_internal(%rip), %ymm0, %ymm7 #1868.14 - vaddpd 12608+__svml_dlog1p_ha_data_internal(%rip), %ymm1, %ymm8 #1869.14 + vaddpd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %ymm0, %ymm7 #1868.14 + vaddpd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %ymm1, %ymm8 #1869.14 vaddpd %ymm10, %ymm5, %ymm5 #1875.13 vmulpd %ymm11, %ymm7, %ymm9 #1871.27 vaddpd %ymm9, %ymm8, %ymm12 #1871.12 @@ -862,29 +862,29 @@ __svml_log1p4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1881.552 lea 128(%rsp,%r12,8), %rsi #1881.552 -..___tag_value___svml_log1p4_ha_e9.93: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #1881.552 -..___tag_value___svml_log1p4_ha_e9.94: +..___tag_value___jsvml_log1p4_ha_e9.93: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #1881.552 +..___tag_value___jsvml_log1p4_ha_e9.94: jmp ..B5.8 # Prob 100% #1881.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1p4_ha_e9,@function - .size __svml_log1p4_ha_e9,.-__svml_log1p4_ha_e9 -..LN__svml_log1p4_ha_e9.4: + .type __jsvml_log1p4_ha_e9,@function + .size __jsvml_log1p4_ha_e9,.-__jsvml_log1p4_ha_e9 +..LN__jsvml_log1p4_ha_e9.4: .data -# -- End __svml_log1p4_ha_e9 +# -- End __jsvml_log1p4_ha_e9 .text -.L_2__routine_start___svml_log1p1_ha_ex_5: -# -- Begin __svml_log1p1_ha_ex +.L_2__routine_start___jsvml_log1p1_ha_ex_5: +# -- Begin __jsvml_log1p1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log1p1_ha_ex -# --- __svml_log1p1_ha_ex(__m128d) -__svml_log1p1_ha_ex: + .globl __jsvml_log1p1_ha_ex +# --- __jsvml_log1p1_ha_ex(__m128d) +__jsvml_log1p1_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -893,7 +893,7 @@ __svml_log1p1_ha_ex: .byte 30 #2314.546 .byte 250 #2314.546 .cfi_startproc -..___tag_value___svml_log1p1_ha_ex.96: +..___tag_value___jsvml_log1p1_ha_ex.96: ..L97: #2193.1 pushq %rbp #2193.1 @@ -904,24 +904,24 @@ __svml_log1p1_ha_ex: andq $-64, %rsp #2193.1 subq $128, %rsp #2193.1 movaps %xmm0, %xmm6 #2193.1 - movsd 13056+__svml_dlog1p_ha_data_internal(%rip), %xmm4 #2246.18 + movsd 13056+__jsvml_dlog1p_ha_data_internal(%rip), %xmm4 #2246.18 movaps %xmm6, %xmm8 #2250.73 movaps %xmm4, %xmm7 #2251.15 - lea -8454136+__svml_dlog1p_ha_data_internal(%rip), %rdx #2287.17 - movsd 12992+__svml_dlog1p_ha_data_internal(%rip), %xmm0 #2245.10 + lea -8454136+__jsvml_dlog1p_ha_data_internal(%rip), %rdx #2287.17 + movsd 12992+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0 #2245.10 andps %xmm6, %xmm7 #2251.15 movaps %xmm0, %xmm3 #2249.8 movaps %xmm0, %xmm10 #2250.20 - movsd 13184+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #2253.17 + movsd 13184+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #2253.17 andnps %xmm6, %xmm4 #2254.19 - movsd 12672+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #2261.15 + movsd 12672+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #2261.15 addsd %xmm6, %xmm3 #2249.8 - cmpltsd 13120+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #2252.16 + cmpltsd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #2252.16 orps %xmm7, %xmm9 #2253.17 movaps %xmm6, %xmm7 #2274.14 andps %xmm9, %xmm3 #2256.12 - cmpltsd 12800+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #2274.14 - movsd 12736+__svml_dlog1p_ha_data_internal(%rip), %xmm11 #2260.12 + cmpltsd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #2274.14 + movsd 12736+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11 #2260.12 andps %xmm3, %xmm2 #2261.15 orps %xmm11, %xmm2 #2262.15 cvtpd2ps %xmm2, %xmm12 #2267.53 @@ -940,11 +940,11 @@ __svml_log1p1_ha_ex: subpd %xmm14, %xmm8 #2271.343 mulsd %xmm8, %xmm2 #2276.25 movaps %xmm6, %xmm14 #2275.14 - cmpnlesd 12864+__svml_dlog1p_ha_data_internal(%rip), %xmm14 #2275.14 + cmpnlesd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %xmm14 #2275.14 subsd %xmm0, %xmm2 #2276.13 - movq 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm15 #2269.11 + movq 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm15 #2269.11 orps %xmm14, %xmm7 #2280.14 - movq 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm0 #2270.11 + movq 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0 #2270.11 pand %xmm3, %xmm15 #2269.11 psubq %xmm15, %xmm0 #2270.11 movmskpd %xmm7, %ecx #2282.40 @@ -958,20 +958,20 @@ __svml_log1p1_ha_ex: movaps %xmm2, %xmm0 #2294.12 cvtdq2pd %xmm3, %xmm1 #2279.20 addsd %xmm5, %xmm0 #2294.12 - movsd 12416+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #2301.26 + movsd 12416+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #2301.26 movaps %xmm0, %xmm9 #2295.14 mulsd %xmm0, %xmm13 #2301.26 subsd %xmm2, %xmm9 #2295.14 - movsd 12544+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #2302.26 + movsd 12544+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #2302.26 movaps %xmm1, %xmm10 #2291.25 movaps %xmm0, %xmm12 #2303.13 - addsd 12480+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #2301.14 - mulsd 13248+__svml_dlog1p_ha_data_internal(%rip), %xmm10 #2291.25 + addsd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #2301.14 + mulsd 13248+__jsvml_dlog1p_ha_data_internal(%rip), %xmm10 #2291.25 subsd %xmm9, %xmm5 #2296.13 mulsd %xmm0, %xmm2 #2302.26 mulsd %xmm0, %xmm12 #2303.13 - mulsd 13312+__svml_dlog1p_ha_data_internal(%rip), %xmm1 #2292.25 - addsd 12608+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #2302.14 + mulsd 13312+__jsvml_dlog1p_ha_data_internal(%rip), %xmm1 #2292.25 + addsd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #2302.14 mulsd %xmm12, %xmm13 #2304.24 movslq %eax, %rax #2287.106 addsd %xmm2, %xmm13 #2304.12 @@ -1022,29 +1022,29 @@ __svml_log1p1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #2314.546 lea 64(%rsp), %rsi #2314.546 -..___tag_value___svml_log1p1_ha_ex.109: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #2314.546 -..___tag_value___svml_log1p1_ha_ex.110: +..___tag_value___jsvml_log1p1_ha_ex.109: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #2314.546 +..___tag_value___jsvml_log1p1_ha_ex.110: jmp ..B6.4 # Prob 100% #2314.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log1p1_ha_ex,@function - .size __svml_log1p1_ha_ex,.-__svml_log1p1_ha_ex -..LN__svml_log1p1_ha_ex.5: + .type __jsvml_log1p1_ha_ex,@function + .size __jsvml_log1p1_ha_ex,.-__jsvml_log1p1_ha_ex +..LN__jsvml_log1p1_ha_ex.5: .data -# -- End __svml_log1p1_ha_ex +# -- End __jsvml_log1p1_ha_ex .text -.L_2__routine_start___svml_log1p2_ha_e9_6: -# -- Begin __svml_log1p2_ha_e9 +.L_2__routine_start___jsvml_log1p2_ha_e9_6: +# -- Begin __jsvml_log1p2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p2_ha_e9 -# --- __svml_log1p2_ha_e9(__m128d) -__svml_log1p2_ha_e9: + .globl __jsvml_log1p2_ha_e9 +# --- __jsvml_log1p2_ha_e9(__m128d) +__jsvml_log1p2_ha_e9: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1053,7 +1053,7 @@ __svml_log1p2_ha_e9: .byte 30 #2443.546 .byte 250 #2443.546 .cfi_startproc -..___tag_value___svml_log1p2_ha_e9.112: +..___tag_value___jsvml_log1p2_ha_e9.112: ..L113: #2322.1 pushq %rbp #2322.1 @@ -1064,26 +1064,26 @@ __svml_log1p2_ha_e9: andq $-64, %rsp #2322.1 subq $192, %rsp #2322.1 movaps %xmm0, %xmm8 #2322.1 - movups 13056+__svml_dlog1p_ha_data_internal(%rip), %xmm7 #2375.49 + movups 13056+__jsvml_dlog1p_ha_data_internal(%rip), %xmm7 #2375.49 movaps %xmm8, %xmm1 #2403.14 movaps %xmm7, %xmm9 #2380.15 movaps %xmm8, %xmm2 #2404.14 - movups 12992+__svml_dlog1p_ha_data_internal(%rip), %xmm3 #2374.41 + movups 12992+__jsvml_dlog1p_ha_data_internal(%rip), %xmm3 #2374.41 andps %xmm8, %xmm9 #2380.15 - cmpltpd 13120+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #2381.16 - cmpltpd 12800+__svml_dlog1p_ha_data_internal(%rip), %xmm1 #2403.14 - cmpnlepd 12864+__svml_dlog1p_ha_data_internal(%rip), %xmm2 #2404.14 + cmpltpd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #2381.16 + cmpltpd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %xmm1 #2403.14 + cmpnlepd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2 #2404.14 movaps %xmm3, %xmm4 #2378.8 movaps %xmm3, %xmm10 #2379.8 addpd %xmm8, %xmm4 #2378.8 maxpd %xmm8, %xmm10 #2379.8 - orps 13184+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #2382.17 + orps 13184+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #2382.17 movaps %xmm3, %xmm6 #2384.8 - movups 12672+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #2390.15 + movups 12672+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #2390.15 andps %xmm9, %xmm4 #2385.12 andps %xmm4, %xmm5 #2390.15 - lea -8454144+__svml_dlog1p_ha_data_internal(%rip), %rsi #2416.67 - orps 12736+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #2391.15 + lea -8454144+__jsvml_dlog1p_ha_data_internal(%rip), %rsi #2416.67 + orps 12736+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #2391.15 orps %xmm2, %xmm1 #2409.14 cvtpd2ps %xmm5, %xmm11 #2396.53 minpd %xmm8, %xmm6 #2384.8 @@ -1094,8 +1094,8 @@ __svml_log1p2_ha_e9: rcpps %xmm11, %xmm12 #2396.26 addpd %xmm10, %xmm6 #2387.9 cvtps2pd %xmm12, %xmm14 #2396.13 - movdqu 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm13 #2398.17 - movdqu 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm0 #2399.17 + movdqu 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm13 #2398.17 + movdqu 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0 #2399.17 pand %xmm4, %xmm13 #2398.17 psubq %xmm13, %xmm0 #2399.17 roundpd $0, %xmm14, %xmm14 #2400.13 @@ -1107,7 +1107,7 @@ __svml_log1p2_ha_e9: psrlq $39, %xmm14 #2413.22 movd %xmm14, %eax #2416.144 pshufd $221, %xmm4, %xmm15 #2402.19 - movups 12544+__svml_dlog1p_ha_data_internal(%rip), %xmm12 #2431.26 + movups 12544+__jsvml_dlog1p_ha_data_internal(%rip), %xmm12 #2431.26 movslq %eax, %rax #2416.67 pextrd $2, %xmm14, %ecx #2416.315 movslq %ecx, %rcx #2416.238 @@ -1125,16 +1125,16 @@ __svml_log1p2_ha_e9: mulpd %xmm3, %xmm13 #2432.13 mulpd %xmm3, %xmm12 #2431.26 subpd %xmm0, %xmm6 #2425.13 - addpd 12608+__svml_dlog1p_ha_data_internal(%rip), %xmm12 #2431.14 - movups 12416+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #2430.26 + addpd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %xmm12 #2431.14 + movups 12416+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #2430.26 mulpd %xmm3, %xmm5 #2430.26 - movups 13248+__svml_dlog1p_ha_data_internal(%rip), %xmm4 #2420.25 - addpd 12480+__svml_dlog1p_ha_data_internal(%rip), %xmm5 #2430.14 + movups 13248+__jsvml_dlog1p_ha_data_internal(%rip), %xmm4 #2420.25 + addpd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5 #2430.14 mulpd %xmm10, %xmm4 #2420.25 mulpd %xmm13, %xmm5 #2433.24 addpd %xmm4, %xmm1 #2420.13 addpd %xmm5, %xmm12 #2433.12 - movups 13312+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #2419.45 + movups 13312+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #2419.45 movaps %xmm1, %xmm0 #2434.17 mulpd %xmm9, %xmm10 #2421.25 addpd %xmm3, %xmm0 #2434.17 @@ -1202,29 +1202,29 @@ __svml_log1p2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #2443.546 lea 128(%rsp,%r12,8), %rsi #2443.546 -..___tag_value___svml_log1p2_ha_e9.130: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #2443.546 -..___tag_value___svml_log1p2_ha_e9.131: +..___tag_value___jsvml_log1p2_ha_e9.130: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #2443.546 +..___tag_value___jsvml_log1p2_ha_e9.131: jmp ..B7.8 # Prob 100% #2443.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1p2_ha_e9,@function - .size __svml_log1p2_ha_e9,.-__svml_log1p2_ha_e9 -..LN__svml_log1p2_ha_e9.6: + .type __jsvml_log1p2_ha_e9,@function + .size __jsvml_log1p2_ha_e9,.-__jsvml_log1p2_ha_e9 +..LN__jsvml_log1p2_ha_e9.6: .data -# -- End __svml_log1p2_ha_e9 +# -- End __jsvml_log1p2_ha_e9 .text -.L_2__routine_start___svml_log1p2_ha_l9_7: -# -- Begin __svml_log1p2_ha_l9 +.L_2__routine_start___jsvml_log1p2_ha_l9_7: +# -- Begin __jsvml_log1p2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p2_ha_l9 -# --- __svml_log1p2_ha_l9(__m128d) -__svml_log1p2_ha_l9: + .globl __jsvml_log1p2_ha_l9 +# --- __jsvml_log1p2_ha_l9(__m128d) +__jsvml_log1p2_ha_l9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1233,7 +1233,7 @@ __svml_log1p2_ha_l9: .byte 30 #2572.546 .byte 250 #2572.546 .cfi_startproc -..___tag_value___svml_log1p2_ha_l9.133: +..___tag_value___jsvml_log1p2_ha_l9.133: ..L134: #2451.1 pushq %rbp #2451.1 @@ -1244,30 +1244,30 @@ __svml_log1p2_ha_l9: andq $-64, %rsp #2451.1 subq $192, %rsp #2451.1 vmovapd %xmm0, %xmm8 #2451.1 - vmovupd 13056+__svml_dlog1p_ha_data_internal(%rip), %xmm11 #2504.49 - lea -8454144+__svml_dlog1p_ha_data_internal(%rip), %rsi #2545.67 + vmovupd 13056+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11 #2504.49 + lea -8454144+__jsvml_dlog1p_ha_data_internal(%rip), %rsi #2545.67 vandpd %xmm11, %xmm8, %xmm9 #2509.15 vandnpd %xmm8, %xmm11, %xmm7 #2512.19 - vmovupd 12992+__svml_dlog1p_ha_data_internal(%rip), %xmm6 #2503.41 - vcmpltpd 13120+__svml_dlog1p_ha_data_internal(%rip), %xmm9, %xmm10 #2510.16 + vmovupd 12992+__jsvml_dlog1p_ha_data_internal(%rip), %xmm6 #2503.41 + vcmpltpd 13120+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9, %xmm10 #2510.16 vaddpd %xmm6, %xmm8, %xmm12 #2507.8 vmaxpd %xmm8, %xmm6, %xmm14 #2508.8 vminpd %xmm8, %xmm6, %xmm15 #2513.8 - vorpd 13184+__svml_dlog1p_ha_data_internal(%rip), %xmm10, %xmm13 #2511.17 + vorpd 13184+__jsvml_dlog1p_ha_data_internal(%rip), %xmm10, %xmm13 #2511.17 vandpd %xmm13, %xmm12, %xmm5 #2514.12 - vandpd 12672+__svml_dlog1p_ha_data_internal(%rip), %xmm5, %xmm0 #2519.15 - vorpd 12736+__svml_dlog1p_ha_data_internal(%rip), %xmm0, %xmm3 #2520.15 + vandpd 12672+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5, %xmm0 #2519.15 + vorpd 12736+__jsvml_dlog1p_ha_data_internal(%rip), %xmm0, %xmm3 #2520.15 vcvtpd2ps %xmm3, %xmm2 #2525.53 vsubpd %xmm5, %xmm14, %xmm1 #2515.9 - vcmpnlepd 12864+__svml_dlog1p_ha_data_internal(%rip), %xmm8, %xmm0 #2533.14 + vcmpnlepd 12864+__jsvml_dlog1p_ha_data_internal(%rip), %xmm8, %xmm0 #2533.14 vaddpd %xmm1, %xmm15, %xmm4 #2516.9 - vcmpltpd 12800+__svml_dlog1p_ha_data_internal(%rip), %xmm8, %xmm15 #2532.14 + vcmpltpd 12800+__jsvml_dlog1p_ha_data_internal(%rip), %xmm8, %xmm15 #2532.14 vmovlhps %xmm2, %xmm2, %xmm9 #2525.37 vrcpps %xmm9, %xmm10 #2525.26 vcvtps2pd %xmm10, %xmm13 #2525.13 - vpand 13568+__svml_dlog1p_ha_data_internal(%rip), %xmm5, %xmm12 #2527.13 + vpand 13568+__jsvml_dlog1p_ha_data_internal(%rip), %xmm5, %xmm12 #2527.13 vpsrlq $20, %xmm5, %xmm5 #2530.14 - vmovdqu 13632+__svml_dlog1p_ha_data_internal(%rip), %xmm11 #2528.13 + vmovdqu 13632+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11 #2528.13 vpsubq %xmm12, %xmm11, %xmm14 #2528.13 vroundpd $0, %xmm13, %xmm13 #2529.13 vmulpd %xmm14, %xmm13, %xmm2 #2536.14 @@ -1286,16 +1286,16 @@ __svml_log1p2_ha_l9: vpextrd $2, %xmm6, %ecx #2545.315 movslq %eax, %rax #2545.67 movslq %ecx, %rcx #2545.238 - vmovupd 12544+__svml_dlog1p_ha_data_internal(%rip), %xmm4 #2557.55 - vfmadd213pd 12608+__svml_dlog1p_ha_data_internal(%rip), %xmm2, %xmm4 #2560.14 + vmovupd 12544+__jsvml_dlog1p_ha_data_internal(%rip), %xmm4 #2557.55 + vfmadd213pd 12608+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2, %xmm4 #2560.14 vmovupd (%rsi,%rax), %xmm9 #2545.67 vmovupd (%rsi,%rcx), %xmm10 #2545.238 vunpcklpd %xmm10, %xmm9, %xmm0 #2545.364 vunpckhpd %xmm10, %xmm9, %xmm11 #2545.405 - vfmadd231pd 13248+__svml_dlog1p_ha_data_internal(%rip), %xmm1, %xmm0 #2549.13 - vmovupd 12416+__svml_dlog1p_ha_data_internal(%rip), %xmm9 #2555.55 - vfmadd132pd 13312+__svml_dlog1p_ha_data_internal(%rip), %xmm11, %xmm1 #2550.13 - vfmadd213pd 12480+__svml_dlog1p_ha_data_internal(%rip), %xmm2, %xmm9 #2559.14 + vfmadd231pd 13248+__jsvml_dlog1p_ha_data_internal(%rip), %xmm1, %xmm0 #2549.13 + vmovupd 12416+__jsvml_dlog1p_ha_data_internal(%rip), %xmm9 #2555.55 + vfmadd132pd 13312+__jsvml_dlog1p_ha_data_internal(%rip), %xmm11, %xmm1 #2550.13 + vfmadd213pd 12480+__jsvml_dlog1p_ha_data_internal(%rip), %xmm2, %xmm9 #2559.14 vaddpd %xmm2, %xmm0, %xmm10 #2563.17 vaddpd %xmm3, %xmm1, %xmm1 #2566.13 vfmadd213pd %xmm4, %xmm5, %xmm9 #2562.12 @@ -1360,29 +1360,29 @@ __svml_log1p2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #2572.546 lea 128(%rsp,%r12,8), %rsi #2572.546 -..___tag_value___svml_log1p2_ha_l9.151: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #2572.546 -..___tag_value___svml_log1p2_ha_l9.152: +..___tag_value___jsvml_log1p2_ha_l9.151: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #2572.546 +..___tag_value___jsvml_log1p2_ha_l9.152: jmp ..B8.8 # Prob 100% #2572.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1p2_ha_l9,@function - .size __svml_log1p2_ha_l9,.-__svml_log1p2_ha_l9 -..LN__svml_log1p2_ha_l9.7: + .type __jsvml_log1p2_ha_l9,@function + .size __jsvml_log1p2_ha_l9,.-__jsvml_log1p2_ha_l9 +..LN__jsvml_log1p2_ha_l9.7: .data -# -- End __svml_log1p2_ha_l9 +# -- End __jsvml_log1p2_ha_l9 .text -.L_2__routine_start___svml_log1p8_ha_z0_8: -# -- Begin __svml_log1p8_ha_z0 +.L_2__routine_start___jsvml_log1p8_ha_z0_8: +# -- Begin __jsvml_log1p8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_log1p8_ha_z0 -# --- __svml_log1p8_ha_z0(__m512d) -__svml_log1p8_ha_z0: + .globl __jsvml_log1p8_ha_z0 +# --- __jsvml_log1p8_ha_z0(__m512d) +__jsvml_log1p8_ha_z0: # parameter 1: %zmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1391,7 +1391,7 @@ __svml_log1p8_ha_z0: .byte 30 #2693.759 .byte 250 #2693.759 .cfi_startproc -..___tag_value___svml_log1p8_ha_z0.154: +..___tag_value___jsvml_log1p8_ha_z0.154: ..L155: #2580.1 pushq %rbp #2580.1 @@ -1401,8 +1401,8 @@ __svml_log1p8_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #2580.1 subq $192, %rsp #2580.1 - vmovups 256+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm8 #2634.54 - vmovups 320+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm3 #2639.57 + vmovups 256+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm8 #2634.54 + vmovups 320+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm3 #2639.57 vmovaps %zmm0, %zmm10 #2580.1 vmaxpd {sae}, %zmm10, %zmm8, %zmm12 #2636.22 vminpd {sae}, %zmm10, %zmm8, %zmm14 #2637.22 @@ -1412,37 +1412,37 @@ __svml_log1p8_ha_z0: vgetexppd {sae}, %zmm13, %zmm9 #2642.25 vsubpd {rn-sae}, %zmm12, %zmm13, %zmm15 #2641.22 vrcp14pd %zmm7, %zmm2 #2643.24 - vmovups 384+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm13 #2649.54 + vmovups 384+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm13 #2649.54 vsubpd {rn-sae}, %zmm15, %zmm14, %zmm0 #2644.22 vxorpd %zmm3, %zmm9, %zmm6 #2646.24 vrndscalepd $88, {sae}, %zmm2, %zmm12 #2647.24 - vmovups 576+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm14 #2663.61 - vmovups 512+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm3 #2665.21 - vmovups 960+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm15 #2668.53 + vmovups 576+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm14 #2663.61 + vmovups 512+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm3 #2665.21 + vmovups 960+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm15 #2668.53 vscalefpd {rn-sae}, %zmm6, %zmm0, %zmm4 #2648.20 vcmppd $17, {sae}, %zmm13, %zmm12, %k1 #2650.26 vfmsub213pd {rn-sae}, %zmm8, %zmm12, %zmm7 #2651.20 - vmovups 128+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm0 #2660.296 + vmovups 128+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm0 #2660.296 vmulpd {rn-sae}, %zmm4, %zmm12, %zmm1 #2652.22 - vmovups __svml_dlog1p_ha_data_internal_avx512(%rip), %zmm4 #2659.296 + vmovups __jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm4 #2659.296 vaddpd {rn-sae}, %zmm8, %zmm9, %zmm9{%k1} #2658.25 vaddpd {rn-sae}, %zmm1, %zmm7, %zmm6 #2653.21 - vmovups 448+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm8 #2661.61 + vmovups 448+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm8 #2661.61 vmulpd {rn-sae}, %zmm6, %zmm6, %zmm2 #2666.22 vfmadd231pd {rn-sae}, %zmm6, %zmm8, %zmm3 #2665.21 - vmovups 896+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm8 #2676.21 + vmovups 896+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm8 #2676.21 vsubpd {rn-sae}, %zmm7, %zmm6, %zmm5 #2654.23 vpsrlq $48, %zmm12, %zmm7 #2656.45 - vmovups 768+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm12 #2675.21 + vmovups 768+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm12 #2675.21 vsubpd {rn-sae}, %zmm5, %zmm1, %zmm5 #2655.22 - vpermt2pd 192+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm7, %zmm0 #2660.296 - vpermt2pd 64+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm7, %zmm4 #2659.296 - vmovups 640+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm1 #2667.21 - vmovups 832+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm7 #2673.61 + vpermt2pd 192+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm7, %zmm0 #2660.296 + vpermt2pd 64+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm7, %zmm4 #2659.296 + vmovups 640+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm1 #2667.21 + vmovups 832+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm7 #2673.61 vfmadd231pd {rn-sae}, %zmm9, %zmm15, %zmm4 #2669.20 vaddpd {rn-sae}, %zmm5, %zmm0, %zmm0 #2670.22 vfmadd231pd {rn-sae}, %zmm6, %zmm14, %zmm1 #2667.21 - vmovups 704+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm5 #2671.61 + vmovups 704+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm5 #2671.61 vfmadd231pd {rn-sae}, %zmm6, %zmm7, %zmm8 #2676.21 vaddpd {rn-sae}, %zmm6, %zmm4, %zmm14 #2678.24 vfmadd213pd {rn-sae}, %zmm1, %zmm2, %zmm3 #2677.21 @@ -1452,7 +1452,7 @@ __svml_log1p8_ha_z0: vsubpd {rn-sae}, %zmm4, %zmm14, %zmm4 #2681.22 vfmadd213pd {rn-sae}, %zmm12, %zmm1, %zmm3 #2682.21 vsubpd {rn-sae}, %zmm4, %zmm6, %zmm13 #2683.21 - vmovups 1024+__svml_dlog1p_ha_data_internal_avx512(%rip), %zmm6 #2684.53 + vmovups 1024+__jsvml_dlog1p_ha_data_internal_avx512(%rip), %zmm6 #2684.53 vfmadd213pd {rn-sae}, %zmm13, %zmm2, %zmm3 #2686.19 vcmppd $4, {sae}, %zmm13, %zmm13, %k0 #2687.27 vfmadd213pd {rn-sae}, %zmm0, %zmm6, %zmm9 #2685.20 @@ -1569,30 +1569,30 @@ __svml_log1p8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #2693.759 lea 128(%rsp,%rbx,8), %rsi #2693.759 -..___tag_value___svml_log1p8_ha_z0.182: -# __svml_dlog1p_ha_cout_rare_internal(const double *, double *) - call __svml_dlog1p_ha_cout_rare_internal #2693.759 -..___tag_value___svml_log1p8_ha_z0.183: +..___tag_value___jsvml_log1p8_ha_z0.182: +# __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog1p_ha_cout_rare_internal #2693.759 +..___tag_value___jsvml_log1p8_ha_z0.183: jmp ..B9.13 # Prob 100% #2693.759 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_log1p8_ha_z0,@function - .size __svml_log1p8_ha_z0,.-__svml_log1p8_ha_z0 -..LN__svml_log1p8_ha_z0.8: + .type __jsvml_log1p8_ha_z0,@function + .size __jsvml_log1p8_ha_z0,.-__jsvml_log1p8_ha_z0 +..LN__jsvml_log1p8_ha_z0.8: .data -# -- End __svml_log1p8_ha_z0 +# -- End __jsvml_log1p8_ha_z0 .text -.L_2__routine_start___svml_dlog1p_ha_cout_rare_internal_9: -# -- Begin __svml_dlog1p_ha_cout_rare_internal +.L_2__routine_start___jsvml_dlog1p_ha_cout_rare_internal_9: +# -- Begin __jsvml_dlog1p_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dlog1p_ha_cout_rare_internal - .globl __svml_dlog1p_ha_cout_rare_internal -# --- __svml_dlog1p_ha_cout_rare_internal(const double *, double *) -__svml_dlog1p_ha_cout_rare_internal: + .hidden __jsvml_dlog1p_ha_cout_rare_internal + .globl __jsvml_dlog1p_ha_cout_rare_internal +# --- __jsvml_dlog1p_ha_cout_rare_internal(const double *, double *) +__jsvml_dlog1p_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1602,7 +1602,7 @@ __svml_dlog1p_ha_cout_rare_internal: .byte 30 #2180.17 .byte 250 #2180.17 .cfi_startproc -..___tag_value___svml_dlog1p_ha_cout_rare_internal.185: +..___tag_value___jsvml_dlog1p_ha_cout_rare_internal.185: ..L186: #2101.1 xorl %eax, %eax #2111.14 @@ -1786,17 +1786,17 @@ __svml_dlog1p_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dlog1p_ha_cout_rare_internal,@function - .size __svml_dlog1p_ha_cout_rare_internal,.-__svml_dlog1p_ha_cout_rare_internal -..LN__svml_dlog1p_ha_cout_rare_internal.9: + .type __jsvml_dlog1p_ha_cout_rare_internal,@function + .size __jsvml_dlog1p_ha_cout_rare_internal,.-__jsvml_dlog1p_ha_cout_rare_internal +..LN__jsvml_dlog1p_ha_cout_rare_internal.9: .data -# -- End __svml_dlog1p_ha_cout_rare_internal +# -- End __jsvml_dlog1p_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dlog1p_ha_data_internal_avx512 - .globl __svml_dlog1p_ha_data_internal_avx512 -__svml_dlog1p_ha_data_internal_avx512: + .hidden __jsvml_dlog1p_ha_data_internal_avx512 + .globl __jsvml_dlog1p_ha_data_internal_avx512 +__jsvml_dlog1p_ha_data_internal_avx512: .long 0 .long 0 .long 3222405120 @@ -2117,12 +2117,12 @@ __svml_dlog1p_ha_data_internal_avx512: .long 0 .long 120 .long 0 - .type __svml_dlog1p_ha_data_internal_avx512,@object - .size __svml_dlog1p_ha_data_internal_avx512,1280 + .type __jsvml_dlog1p_ha_data_internal_avx512,@object + .size __jsvml_dlog1p_ha_data_internal_avx512,1280 .align 64 - .hidden __svml_dlog1p_ha_data_internal - .globl __svml_dlog1p_ha_data_internal -__svml_dlog1p_ha_data_internal: + .hidden __jsvml_dlog1p_ha_data_internal + .globl __jsvml_dlog1p_ha_data_internal +__jsvml_dlog1p_ha_data_internal: .long 3715793664 .long 3230016299 .long 4013928704 @@ -5797,8 +5797,8 @@ __svml_dlog1p_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_dlog1p_ha_data_internal,@object - .size __svml_dlog1p_ha_data_internal,13952 + .type __jsvml_dlog1p_ha_data_internal,@object + .size __jsvml_dlog1p_ha_data_internal,13952 .align 32 _imldLnHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_log_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_log_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log_linux_x86.S index b703743b019..ea60e9c23e0 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_log_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_log_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_log.c" .text ..TXTST0: -.L_2__routine_start___svml_log1_ha_e9_0: -# -- Begin __svml_log1_ha_e9 +.L_2__routine_start___jsvml_log1_ha_e9_0: +# -- Begin __jsvml_log1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1_ha_e9 -# --- __svml_log1_ha_e9(__m128d) -__svml_log1_ha_e9: + .globl __jsvml_log1_ha_e9 +# --- __jsvml_log1_ha_e9(__m128d) +__jsvml_log1_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_log1_ha_e9: .byte 30 #1322.546 .byte 250 #1322.546 .cfi_startproc -..___tag_value___svml_log1_ha_e9.1: +..___tag_value___jsvml_log1_ha_e9.1: ..L2: #1238.1 pushq %rbp #1238.1 @@ -58,49 +58,49 @@ __svml_log1_ha_e9: andq $-64, %rsp #1238.1 subq $128, %rsp #1238.1 movaps %xmm0, %xmm4 #1282.22 - movsd 12672+__svml_dlog_ha_data_internal(%rip), %xmm9 #1276.19 + movsd 12672+__jsvml_dlog_ha_data_internal(%rip), %xmm9 #1276.19 psrlq $20, %xmm4 #1282.22 - movsd 12736+__svml_dlog_ha_data_internal(%rip), %xmm1 #1275.16 + movsd 12736+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1275.16 andps %xmm0, %xmm9 #1276.19 orps %xmm1, %xmm9 #1277.19 - lea -8454136+__svml_dlog_ha_data_internal(%rip), %rdx #1298.21 + lea -8454136+__jsvml_dlog_ha_data_internal(%rip), %rdx #1298.21 cvtpd2ps %xmm9, %xmm2 #1280.57 movlhps %xmm2, %xmm2 #1280.41 movaps %xmm0, %xmm8 #1284.18 rcpps %xmm2, %xmm3 #1280.30 - cmpltsd 12800+__svml_dlog_ha_data_internal(%rip), %xmm8 #1284.18 + cmpltsd 12800+__jsvml_dlog_ha_data_internal(%rip), %xmm8 #1284.18 cvtps2pd %xmm3, %xmm10 #1280.17 - movsd 12928+__svml_dlog_ha_data_internal(%rip), %xmm15 #1293.124 + movsd 12928+__jsvml_dlog_ha_data_internal(%rip), %xmm15 #1293.124 movaps %xmm0, %xmm7 #1285.18 pshufd $85, %xmm4, %xmm5 #1283.23 andps %xmm9, %xmm15 #1293.124 pshufd $0, %xmm5, %xmm6 #1287.41 subsd %xmm15, %xmm9 #1293.178 cvtdq2pd %xmm6, %xmm3 #1287.24 - cmpnlesd 12864+__svml_dlog_ha_data_internal(%rip), %xmm7 #1285.18 + cmpnlesd 12864+__jsvml_dlog_ha_data_internal(%rip), %xmm7 #1285.18 roundsd $0, %xmm10, %xmm10 #1286.17 movaps %xmm3, %xmm13 #1302.17 mulsd %xmm10, %xmm15 #1293.231 orps %xmm7, %xmm8 #1288.18 mulsd %xmm10, %xmm9 #1293.282 - mulsd 13056+__svml_dlog_ha_data_internal(%rip), %xmm13 #1302.17 - subsd 12992+__svml_dlog_ha_data_internal(%rip), %xmm15 #1293.327 - mulsd 13120+__svml_dlog_ha_data_internal(%rip), %xmm3 #1303.17 + mulsd 13056+__jsvml_dlog_ha_data_internal(%rip), %xmm13 #1302.17 + subsd 12992+__jsvml_dlog_ha_data_internal(%rip), %xmm15 #1293.327 + mulsd 13120+__jsvml_dlog_ha_data_internal(%rip), %xmm3 #1303.17 movmskpd %xmm8, %ecx #1290.44 addsd %xmm9, %xmm15 #1293.369 psrlq $39, %xmm10 #1295.26 movaps %xmm15, %xmm12 #1310.17 movd %xmm10, %eax #1298.119 - movsd 12416+__svml_dlog_ha_data_internal(%rip), %xmm1 #1308.30 - movsd 12544+__svml_dlog_ha_data_internal(%rip), %xmm11 #1309.30 + movsd 12416+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1308.30 + movsd 12544+__jsvml_dlog_ha_data_internal(%rip), %xmm11 #1309.30 movslq %eax, %rax #1298.108 mulsd %xmm15, %xmm1 #1308.30 mulsd %xmm15, %xmm11 #1309.30 addsd -8(%rdx,%rax), %xmm13 #1313.17 mulsd %xmm15, %xmm12 #1310.17 addsd (%rdx,%rax), %xmm3 #1314.17 - addsd 12480+__svml_dlog_ha_data_internal(%rip), %xmm1 #1308.18 - addsd 12608+__svml_dlog_ha_data_internal(%rip), %xmm11 #1309.18 + addsd 12480+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1308.18 + addsd 12608+__jsvml_dlog_ha_data_internal(%rip), %xmm11 #1309.18 mulsd %xmm12, %xmm1 #1311.28 movaps %xmm13, %xmm2 #1315.21 addsd %xmm11, %xmm1 #1311.16 @@ -141,29 +141,29 @@ __svml_log1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1322.546 lea 64(%rsp), %rsi #1322.546 -..___tag_value___svml_log1_ha_e9.10: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #1322.546 -..___tag_value___svml_log1_ha_e9.11: +..___tag_value___jsvml_log1_ha_e9.10: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #1322.546 +..___tag_value___jsvml_log1_ha_e9.11: jmp ..B1.4 # Prob 100% #1322.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log1_ha_e9,@function - .size __svml_log1_ha_e9,.-__svml_log1_ha_e9 -..LN__svml_log1_ha_e9.0: + .type __jsvml_log1_ha_e9,@function + .size __jsvml_log1_ha_e9,.-__jsvml_log1_ha_e9 +..LN__jsvml_log1_ha_e9.0: .data -# -- End __svml_log1_ha_e9 +# -- End __jsvml_log1_ha_e9 .text -.L_2__routine_start___svml_log1_ha_ex_1: -# -- Begin __svml_log1_ha_ex +.L_2__routine_start___jsvml_log1_ha_ex_1: +# -- Begin __jsvml_log1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log1_ha_ex -# --- __svml_log1_ha_ex(__m128d) -__svml_log1_ha_ex: + .globl __jsvml_log1_ha_ex +# --- __jsvml_log1_ha_ex(__m128d) +__jsvml_log1_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -172,7 +172,7 @@ __svml_log1_ha_ex: .byte 30 #1414.546 .byte 250 #1414.546 .cfi_startproc -..___tag_value___svml_log1_ha_ex.13: +..___tag_value___jsvml_log1_ha_ex.13: ..L14: #1330.1 pushq %rbp #1330.1 @@ -183,24 +183,24 @@ __svml_log1_ha_ex: andq $-64, %rsp #1330.1 subq $128, %rsp #1330.1 movaps %xmm0, %xmm5 #1374.16 - movsd 12672+__svml_dlog_ha_data_internal(%rip), %xmm10 #1368.19 + movsd 12672+__jsvml_dlog_ha_data_internal(%rip), %xmm10 #1368.19 psrlq $20, %xmm5 #1374.16 - movsd 12736+__svml_dlog_ha_data_internal(%rip), %xmm1 #1367.16 + movsd 12736+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1367.16 andps %xmm0, %xmm10 #1368.19 orps %xmm1, %xmm10 #1369.19 - lea -8454136+__svml_dlog_ha_data_internal(%rip), %rdx #1390.21 + lea -8454136+__jsvml_dlog_ha_data_internal(%rip), %rdx #1390.21 cvtpd2ps %xmm10, %xmm2 #1372.57 movlhps %xmm2, %xmm2 #1372.41 movaps %xmm0, %xmm9 #1376.18 rcpps %xmm2, %xmm3 #1372.30 - cmpltsd 12800+__svml_dlog_ha_data_internal(%rip), %xmm9 #1376.18 + cmpltsd 12800+__jsvml_dlog_ha_data_internal(%rip), %xmm9 #1376.18 cvtps2pd %xmm3, %xmm11 #1372.17 movups .L_2il0floatpacket.26(%rip), %xmm4 #1378.107 movaps %xmm0, %xmm8 #1377.18 addpd %xmm4, %xmm11 #1378.297 - cmpnlesd 12864+__svml_dlog_ha_data_internal(%rip), %xmm8 #1377.18 + cmpnlesd 12864+__jsvml_dlog_ha_data_internal(%rip), %xmm8 #1377.18 subpd %xmm4, %xmm11 #1378.347 - movsd 12928+__svml_dlog_ha_data_internal(%rip), %xmm1 #1385.124 + movsd 12928+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1385.124 orps %xmm8, %xmm9 #1380.18 pshufd $85, %xmm5, %xmm6 #1375.17 andps %xmm10, %xmm1 #1385.124 @@ -209,28 +209,28 @@ __svml_log1_ha_ex: mulsd %xmm11, %xmm1 #1385.231 cvtdq2pd %xmm7, %xmm4 #1379.24 mulsd %xmm11, %xmm10 #1385.282 - subsd 12992+__svml_dlog_ha_data_internal(%rip), %xmm1 #1385.327 + subsd 12992+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1385.327 movmskpd %xmm9, %ecx #1382.44 psrlq $39, %xmm11 #1387.20 movaps %xmm4, %xmm14 #1394.17 movd %xmm11, %eax #1390.119 addsd %xmm10, %xmm1 #1385.369 - mulsd 13056+__svml_dlog_ha_data_internal(%rip), %xmm14 #1394.17 - mulsd 13120+__svml_dlog_ha_data_internal(%rip), %xmm4 #1395.17 + mulsd 13056+__jsvml_dlog_ha_data_internal(%rip), %xmm14 #1394.17 + mulsd 13120+__jsvml_dlog_ha_data_internal(%rip), %xmm4 #1395.17 movslq %eax, %rax #1390.108 movaps %xmm1, %xmm13 #1402.17 - movsd 12416+__svml_dlog_ha_data_internal(%rip), %xmm2 #1400.30 + movsd 12416+__jsvml_dlog_ha_data_internal(%rip), %xmm2 #1400.30 mulsd %xmm1, %xmm2 #1400.30 mulsd %xmm1, %xmm13 #1402.17 addsd -8(%rdx,%rax), %xmm14 #1405.17 addsd (%rdx,%rax), %xmm4 #1406.17 - addsd 12480+__svml_dlog_ha_data_internal(%rip), %xmm2 #1400.18 + addsd 12480+__jsvml_dlog_ha_data_internal(%rip), %xmm2 #1400.18 movaps %xmm14, %xmm3 #1407.21 - movsd 12544+__svml_dlog_ha_data_internal(%rip), %xmm12 #1401.30 + movsd 12544+__jsvml_dlog_ha_data_internal(%rip), %xmm12 #1401.30 addsd %xmm1, %xmm3 #1407.21 mulsd %xmm1, %xmm12 #1401.30 mulsd %xmm13, %xmm2 #1403.28 - addsd 12608+__svml_dlog_ha_data_internal(%rip), %xmm12 #1401.18 + addsd 12608+__jsvml_dlog_ha_data_internal(%rip), %xmm12 #1401.18 movaps %xmm3, %xmm15 #1408.17 addsd %xmm12, %xmm2 #1403.16 subsd %xmm14, %xmm15 #1408.17 @@ -268,29 +268,29 @@ __svml_log1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1414.546 lea 64(%rsp), %rsi #1414.546 -..___tag_value___svml_log1_ha_ex.22: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #1414.546 -..___tag_value___svml_log1_ha_ex.23: +..___tag_value___jsvml_log1_ha_ex.22: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #1414.546 +..___tag_value___jsvml_log1_ha_ex.23: jmp ..B2.4 # Prob 100% #1414.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log1_ha_ex,@function - .size __svml_log1_ha_ex,.-__svml_log1_ha_ex -..LN__svml_log1_ha_ex.1: + .type __jsvml_log1_ha_ex,@function + .size __jsvml_log1_ha_ex,.-__jsvml_log1_ha_ex +..LN__jsvml_log1_ha_ex.1: .data -# -- End __svml_log1_ha_ex +# -- End __jsvml_log1_ha_ex .text -.L_2__routine_start___svml_log2_ha_ex_2: -# -- Begin __svml_log2_ha_ex +.L_2__routine_start___jsvml_log2_ha_ex_2: +# -- Begin __jsvml_log2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log2_ha_ex -# --- __svml_log2_ha_ex(__m128d) -__svml_log2_ha_ex: + .globl __jsvml_log2_ha_ex +# --- __jsvml_log2_ha_ex(__m128d) +__jsvml_log2_ha_ex: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -299,7 +299,7 @@ __svml_log2_ha_ex: .byte 30 #1506.546 .byte 250 #1506.546 .cfi_startproc -..___tag_value___svml_log2_ha_ex.25: +..___tag_value___jsvml_log2_ha_ex.25: ..L26: #1422.1 pushq %rbp #1422.1 @@ -310,37 +310,37 @@ __svml_log2_ha_ex: andq $-64, %rsp #1422.1 subq $192, %rsp #1422.1 movaps %xmm0, %xmm5 #1466.16 - movups 12672+__svml_dlog_ha_data_internal(%rip), %xmm1 #1460.19 + movups 12672+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1460.19 psrlq $20, %xmm5 #1466.16 andps %xmm0, %xmm1 #1460.19 - lea -8454144+__svml_dlog_ha_data_internal(%rip), %rsi #1482.71 - orps 12736+__svml_dlog_ha_data_internal(%rip), %xmm1 #1461.19 + lea -8454144+__jsvml_dlog_ha_data_internal(%rip), %rsi #1482.71 + orps 12736+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #1461.19 movaps %xmm0, %xmm8 #1468.18 cvtpd2ps %xmm1, %xmm2 #1464.57 - cmpltpd 12800+__svml_dlog_ha_data_internal(%rip), %xmm8 #1468.18 + cmpltpd 12800+__jsvml_dlog_ha_data_internal(%rip), %xmm8 #1468.18 movlhps %xmm2, %xmm2 #1464.41 movaps %xmm0, %xmm7 #1469.18 rcpps %xmm2, %xmm3 #1464.30 - cmpnlepd 12864+__svml_dlog_ha_data_internal(%rip), %xmm7 #1469.18 + cmpnlepd 12864+__jsvml_dlog_ha_data_internal(%rip), %xmm7 #1469.18 cvtps2pd %xmm3, %xmm10 #1464.17 movups .L_2il0floatpacket.26(%rip), %xmm4 #1470.107 orps %xmm7, %xmm8 #1472.18 addpd %xmm4, %xmm10 #1470.297 movmskpd %xmm8, %edx #1474.44 - movups 12928+__svml_dlog_ha_data_internal(%rip), %xmm9 #1476.54 + movups 12928+__jsvml_dlog_ha_data_internal(%rip), %xmm9 #1476.54 subpd %xmm4, %xmm10 #1470.347 andps %xmm1, %xmm9 #1477.124 subpd %xmm9, %xmm1 #1477.178 mulpd %xmm10, %xmm9 #1477.231 mulpd %xmm10, %xmm1 #1477.282 - subpd 12992+__svml_dlog_ha_data_internal(%rip), %xmm9 #1477.327 + subpd 12992+__jsvml_dlog_ha_data_internal(%rip), %xmm9 #1477.327 psrlq $39, %xmm10 #1479.20 movd %xmm10, %eax #1482.146 pshufd $2, %xmm10, %xmm11 #1482.331 pshufd $221, %xmm5, %xmm6 #1467.17 movd %xmm11, %ecx #1482.313 - movups 12416+__svml_dlog_ha_data_internal(%rip), %xmm14 #1492.30 - movups 13120+__svml_dlog_ha_data_internal(%rip), %xmm13 #1485.49 + movups 12416+__jsvml_dlog_ha_data_internal(%rip), %xmm14 #1492.30 + movups 13120+__jsvml_dlog_ha_data_internal(%rip), %xmm13 #1485.49 addpd %xmm9, %xmm1 #1477.369 cvtdq2pd %xmm6, %xmm2 #1471.24 mulpd %xmm1, %xmm14 #1492.30 @@ -348,23 +348,23 @@ __svml_log2_ha_ex: movaps %xmm1, %xmm4 #1494.17 movslq %ecx, %rcx #1482.238 mulpd %xmm1, %xmm4 #1494.17 - addpd 12480+__svml_dlog_ha_data_internal(%rip), %xmm14 #1492.18 + addpd 12480+__jsvml_dlog_ha_data_internal(%rip), %xmm14 #1492.18 movups (%rsi,%rax), %xmm3 #1482.71 movups (%rsi,%rcx), %xmm12 #1482.238 movaps %xmm3, %xmm10 #1482.397 unpcklpd %xmm12, %xmm10 #1482.397 unpckhpd %xmm12, %xmm3 #1482.438 - movups 13056+__svml_dlog_ha_data_internal(%rip), %xmm12 #1486.17 + movups 13056+__jsvml_dlog_ha_data_internal(%rip), %xmm12 #1486.17 mulpd %xmm2, %xmm12 #1486.17 mulpd %xmm13, %xmm2 #1487.17 addpd %xmm12, %xmm10 #1497.17 addpd %xmm2, %xmm3 #1498.17 mulpd %xmm4, %xmm14 #1495.28 - movups 12544+__svml_dlog_ha_data_internal(%rip), %xmm15 #1493.30 + movups 12544+__jsvml_dlog_ha_data_internal(%rip), %xmm15 #1493.30 movaps %xmm1, %xmm2 #1499.21 mulpd %xmm1, %xmm15 #1493.30 addpd %xmm10, %xmm2 #1499.21 - addpd 12608+__svml_dlog_ha_data_internal(%rip), %xmm15 #1493.18 + addpd 12608+__jsvml_dlog_ha_data_internal(%rip), %xmm15 #1493.18 addpd %xmm14, %xmm15 #1495.16 movaps %xmm2, %xmm14 #1500.17 subpd %xmm10, %xmm14 #1500.17 @@ -428,29 +428,29 @@ __svml_log2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1506.546 lea 128(%rsp,%r12,8), %rsi #1506.546 -..___tag_value___svml_log2_ha_ex.43: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #1506.546 -..___tag_value___svml_log2_ha_ex.44: +..___tag_value___jsvml_log2_ha_ex.43: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #1506.546 +..___tag_value___jsvml_log2_ha_ex.44: jmp ..B3.8 # Prob 100% #1506.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log2_ha_ex,@function - .size __svml_log2_ha_ex,.-__svml_log2_ha_ex -..LN__svml_log2_ha_ex.2: + .type __jsvml_log2_ha_ex,@function + .size __jsvml_log2_ha_ex,.-__jsvml_log2_ha_ex +..LN__jsvml_log2_ha_ex.2: .data -# -- End __svml_log2_ha_ex +# -- End __jsvml_log2_ha_ex .text -.L_2__routine_start___svml_log4_ha_l9_3: -# -- Begin __svml_log4_ha_l9 +.L_2__routine_start___jsvml_log4_ha_l9_3: +# -- Begin __jsvml_log4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log4_ha_l9 -# --- __svml_log4_ha_l9(__m256d) -__svml_log4_ha_l9: + .globl __jsvml_log4_ha_l9 +# --- __jsvml_log4_ha_l9(__m256d) +__jsvml_log4_ha_l9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -459,7 +459,7 @@ __svml_log4_ha_l9: .byte 30 #1901.552 .byte 250 #1901.552 .cfi_startproc -..___tag_value___svml_log4_ha_l9.46: +..___tag_value___jsvml_log4_ha_l9.46: ..L47: #1817.1 pushq %rbp #1817.1 @@ -469,23 +469,23 @@ __svml_log4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1817.1 subq $192, %rsp #1817.1 - lea -8454144+__svml_dlog_ha_data_internal(%rip), %r8 #1877.72 + lea -8454144+__jsvml_dlog_ha_data_internal(%rip), %r8 #1877.72 vmovapd %ymm0, %ymm3 #1817.1 - vandpd 12672+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm4 #1855.19 - vorpd 12736+__svml_dlog_ha_data_internal(%rip), %ymm4, %ymm2 #1856.19 + vandpd 12672+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm4 #1855.19 + vorpd 12736+__jsvml_dlog_ha_data_internal(%rip), %ymm4, %ymm2 #1856.19 vcvtpd2ps %ymm2, %xmm5 #1859.44 vpsrlq $20, %ymm3, %ymm7 #1861.18 - vmovupd 12992+__svml_dlog_ha_data_internal(%rip), %ymm14 #1870.48 + vmovupd 12992+__jsvml_dlog_ha_data_internal(%rip), %ymm14 #1870.48 vrcpps %xmm5, %xmm6 #1859.33 - vcmplt_oqpd 12800+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm11 #1863.18 - vcmpnle_uqpd 12864+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm12 #1864.18 + vcmplt_oqpd 12800+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm11 #1863.18 + vcmpnle_uqpd 12864+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm12 #1864.18 vcvtps2pd %xmm6, %ymm9 #1859.17 vroundpd $0, %ymm9, %ymm15 #1865.17 vpsrlq $39, %ymm15, %ymm0 #1874.22 vfmsub213pd %ymm14, %ymm15, %ymm2 #1872.16 - vmovupd 12416+__svml_dlog_ha_data_internal(%rip), %ymm14 #1883.62 + vmovupd 12416+__jsvml_dlog_ha_data_internal(%rip), %ymm14 #1883.62 vorpd %ymm12, %ymm11, %ymm13 #1867.18 - vfmadd213pd 12480+__svml_dlog_ha_data_internal(%rip), %ymm2, %ymm14 #1887.18 + vfmadd213pd 12480+__jsvml_dlog_ha_data_internal(%rip), %ymm2, %ymm14 #1887.18 vmovmskpd %ymm13, %eax #1869.44 vmulpd %ymm2, %ymm2, %ymm13 #1889.17 vextractf128 $1, %ymm0, %xmm4 #1877.565 @@ -506,14 +506,14 @@ __svml_log4_ha_l9: vmovupd (%r8,%rsi), %xmm10 #1877.471 vunpcklpd %xmm8, %xmm7, %xmm5 #1877.877 vunpcklpd %xmm11, %xmm10, %xmm6 #1877.910 - vmulpd 13056+__svml_dlog_ha_data_internal(%rip), %ymm1, %ymm15 #1881.17 + vmulpd 13056+__jsvml_dlog_ha_data_internal(%rip), %ymm1, %ymm15 #1881.17 vunpckhpd %xmm8, %xmm7, %xmm9 #1877.1004 vunpckhpd %xmm11, %xmm10, %xmm12 #1877.1037 vinsertf128 $1, %xmm6, %ymm5, %ymm0 #1877.831 - vmulpd 13120+__svml_dlog_ha_data_internal(%rip), %ymm1, %ymm5 #1882.17 - vmovupd 12544+__svml_dlog_ha_data_internal(%rip), %ymm1 #1885.62 + vmulpd 13120+__jsvml_dlog_ha_data_internal(%rip), %ymm1, %ymm5 #1882.17 + vmovupd 12544+__jsvml_dlog_ha_data_internal(%rip), %ymm1 #1885.62 vaddpd %ymm15, %ymm0, %ymm0 #1892.17 - vfmadd213pd 12608+__svml_dlog_ha_data_internal(%rip), %ymm2, %ymm1 #1888.18 + vfmadd213pd 12608+__jsvml_dlog_ha_data_internal(%rip), %ymm2, %ymm1 #1888.18 vaddpd %ymm0, %ymm2, %ymm7 #1894.21 vfmadd213pd %ymm1, %ymm13, %ymm14 #1890.16 vsubpd %ymm0, %ymm7, %ymm15 #1895.17 @@ -583,29 +583,29 @@ __svml_log4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1901.552 lea 128(%rsp,%r12,8), %rsi #1901.552 -..___tag_value___svml_log4_ha_l9.64: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #1901.552 -..___tag_value___svml_log4_ha_l9.65: +..___tag_value___jsvml_log4_ha_l9.64: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #1901.552 +..___tag_value___jsvml_log4_ha_l9.65: jmp ..B4.8 # Prob 100% #1901.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log4_ha_l9,@function - .size __svml_log4_ha_l9,.-__svml_log4_ha_l9 -..LN__svml_log4_ha_l9.3: + .type __jsvml_log4_ha_l9,@function + .size __jsvml_log4_ha_l9,.-__jsvml_log4_ha_l9 +..LN__jsvml_log4_ha_l9.3: .data -# -- End __svml_log4_ha_l9 +# -- End __jsvml_log4_ha_l9 .text -.L_2__routine_start___svml_log2_ha_l9_4: -# -- Begin __svml_log2_ha_l9 +.L_2__routine_start___jsvml_log2_ha_l9_4: +# -- Begin __jsvml_log2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log2_ha_l9 -# --- __svml_log2_ha_l9(__m128d) -__svml_log2_ha_l9: + .globl __jsvml_log2_ha_l9 +# --- __jsvml_log2_ha_l9(__m128d) +__jsvml_log2_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -614,7 +614,7 @@ __svml_log2_ha_l9: .byte 30 #1993.546 .byte 250 #1993.546 .cfi_startproc -..___tag_value___svml_log2_ha_l9.67: +..___tag_value___jsvml_log2_ha_l9.67: ..L68: #1909.1 pushq %rbp #1909.1 @@ -625,29 +625,29 @@ __svml_log2_ha_l9: andq $-64, %rsp #1909.1 subq $192, %rsp #1909.1 vmovapd %xmm0, %xmm1 #1909.1 - vandpd 12672+__svml_dlog_ha_data_internal(%rip), %xmm1, %xmm2 #1947.19 + vandpd 12672+__jsvml_dlog_ha_data_internal(%rip), %xmm1, %xmm2 #1947.19 vpsrlq $20, %xmm1, %xmm7 #1953.18 - vorpd 12736+__svml_dlog_ha_data_internal(%rip), %xmm2, %xmm0 #1948.19 - lea -8454144+__svml_dlog_ha_data_internal(%rip), %rsi #1969.71 + vorpd 12736+__jsvml_dlog_ha_data_internal(%rip), %xmm2, %xmm0 #1948.19 + lea -8454144+__jsvml_dlog_ha_data_internal(%rip), %rsi #1969.71 vcvtpd2ps %xmm0, %xmm3 #1951.57 - vcmpltpd 12800+__svml_dlog_ha_data_internal(%rip), %xmm1, %xmm9 #1955.18 - vcmpnlepd 12864+__svml_dlog_ha_data_internal(%rip), %xmm1, %xmm10 #1956.18 + vcmpltpd 12800+__jsvml_dlog_ha_data_internal(%rip), %xmm1, %xmm9 #1955.18 + vcmpnlepd 12864+__jsvml_dlog_ha_data_internal(%rip), %xmm1, %xmm10 #1956.18 vmovlhps %xmm3, %xmm3, %xmm4 #1951.41 vorpd %xmm10, %xmm9, %xmm11 #1959.18 vrcpps %xmm4, %xmm5 #1951.30 vmovmskpd %xmm11, %edx #1961.44 vpshufd $221, %xmm7, %xmm8 #1954.19 - vmovupd 12992+__svml_dlog_ha_data_internal(%rip), %xmm12 #1962.45 + vmovupd 12992+__jsvml_dlog_ha_data_internal(%rip), %xmm12 #1962.45 vcvtps2pd %xmm5, %xmm6 #1951.17 vcvtdq2pd %xmm8, %xmm2 #1958.24 vroundpd $0, %xmm6, %xmm6 #1957.17 vpsrlq $39, %xmm6, %xmm13 #1966.22 vmovd %xmm13, %eax #1969.146 - vmovupd 12416+__svml_dlog_ha_data_internal(%rip), %xmm3 #1975.59 - vmulpd 13056+__svml_dlog_ha_data_internal(%rip), %xmm2, %xmm5 #1973.17 + vmovupd 12416+__jsvml_dlog_ha_data_internal(%rip), %xmm3 #1975.59 + vmulpd 13056+__jsvml_dlog_ha_data_internal(%rip), %xmm2, %xmm5 #1973.17 vfmsub213pd %xmm12, %xmm6, %xmm0 #1964.16 - vmulpd 13120+__svml_dlog_ha_data_internal(%rip), %xmm2, %xmm7 #1974.17 - vfmadd213pd 12480+__svml_dlog_ha_data_internal(%rip), %xmm0, %xmm3 #1979.18 + vmulpd 13120+__jsvml_dlog_ha_data_internal(%rip), %xmm2, %xmm7 #1974.17 + vfmadd213pd 12480+__jsvml_dlog_ha_data_internal(%rip), %xmm0, %xmm3 #1979.18 vpextrd $2, %xmm13, %ecx #1969.315 movslq %eax, %rax #1969.71 movslq %ecx, %rcx #1969.240 @@ -660,8 +660,8 @@ __svml_log2_ha_l9: vmulpd %xmm0, %xmm0, %xmm15 #1981.17 vsubpd %xmm8, %xmm13, %xmm9 #1987.17 vaddpd %xmm7, %xmm6, %xmm10 #1985.17 - vmovupd 12544+__svml_dlog_ha_data_internal(%rip), %xmm14 #1977.59 - vfmadd213pd 12608+__svml_dlog_ha_data_internal(%rip), %xmm0, %xmm14 #1980.18 + vmovupd 12544+__jsvml_dlog_ha_data_internal(%rip), %xmm14 #1977.59 + vfmadd213pd 12608+__jsvml_dlog_ha_data_internal(%rip), %xmm0, %xmm14 #1980.18 vsubpd %xmm9, %xmm0, %xmm0 #1988.17 vfmadd213pd %xmm14, %xmm15, %xmm3 #1982.16 vaddpd %xmm0, %xmm10, %xmm12 #1989.17 @@ -723,29 +723,29 @@ __svml_log2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1993.546 lea 128(%rsp,%r12,8), %rsi #1993.546 -..___tag_value___svml_log2_ha_l9.85: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #1993.546 -..___tag_value___svml_log2_ha_l9.86: +..___tag_value___jsvml_log2_ha_l9.85: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #1993.546 +..___tag_value___jsvml_log2_ha_l9.86: jmp ..B5.8 # Prob 100% #1993.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log2_ha_l9,@function - .size __svml_log2_ha_l9,.-__svml_log2_ha_l9 -..LN__svml_log2_ha_l9.4: + .type __jsvml_log2_ha_l9,@function + .size __jsvml_log2_ha_l9,.-__jsvml_log2_ha_l9 +..LN__jsvml_log2_ha_l9.4: .data -# -- End __svml_log2_ha_l9 +# -- End __jsvml_log2_ha_l9 .text -.L_2__routine_start___svml_log1_ha_l9_5: -# -- Begin __svml_log1_ha_l9 +.L_2__routine_start___jsvml_log1_ha_l9_5: +# -- Begin __jsvml_log1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1_ha_l9 -# --- __svml_log1_ha_l9(__m128d) -__svml_log1_ha_l9: + .globl __jsvml_log1_ha_l9 +# --- __jsvml_log1_ha_l9(__m128d) +__jsvml_log1_ha_l9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -754,7 +754,7 @@ __svml_log1_ha_l9: .byte 30 #2085.546 .byte 250 #2085.546 .cfi_startproc -..___tag_value___svml_log1_ha_l9.88: +..___tag_value___jsvml_log1_ha_l9.88: ..L89: #2001.1 pushq %rbp #2001.1 @@ -765,15 +765,15 @@ __svml_log1_ha_l9: andq $-64, %rsp #2001.1 subq $128, %rsp #2001.1 vmovapd %xmm0, %xmm1 #2001.1 - vmovsd 12672+__svml_dlog_ha_data_internal(%rip), %xmm2 #2037.18 + vmovsd 12672+__jsvml_dlog_ha_data_internal(%rip), %xmm2 #2037.18 vpsrlq $20, %xmm1, %xmm9 #2045.18 - vmovsd 12736+__svml_dlog_ha_data_internal(%rip), %xmm4 #2038.16 + vmovsd 12736+__jsvml_dlog_ha_data_internal(%rip), %xmm4 #2038.16 vandpd %xmm2, %xmm1, %xmm3 #2039.19 vorpd %xmm4, %xmm3, %xmm0 #2040.19 - lea -8454136+__svml_dlog_ha_data_internal(%rip), %rdx #2061.21 + lea -8454136+__jsvml_dlog_ha_data_internal(%rip), %rdx #2061.21 vcvtpd2ps %xmm0, %xmm5 #2043.57 - vcmpltsd 12800+__svml_dlog_ha_data_internal(%rip), %xmm1, %xmm12 #2047.18 - vcmpnlesd 12864+__svml_dlog_ha_data_internal(%rip), %xmm1, %xmm13 #2048.18 + vcmpltsd 12800+__jsvml_dlog_ha_data_internal(%rip), %xmm1, %xmm12 #2047.18 + vcmpnlesd 12864+__jsvml_dlog_ha_data_internal(%rip), %xmm1, %xmm13 #2048.18 vmovlhps %xmm5, %xmm5, %xmm6 #2043.41 vorpd %xmm13, %xmm12, %xmm14 #2051.18 vrcpps %xmm6, %xmm7 #2043.30 @@ -785,13 +785,13 @@ __svml_log1_ha_l9: vroundsd $0, %xmm8, %xmm8, %xmm15 #2049.17 vpsrlq $39, %xmm15, %xmm12 #2058.22 vmovd %xmm12, %eax #2061.119 - vmovsd 12416+__svml_dlog_ha_data_internal(%rip), %xmm4 #2067.28 - vmovsd 12544+__svml_dlog_ha_data_internal(%rip), %xmm3 #2069.28 - vmulsd 13056+__svml_dlog_ha_data_internal(%rip), %xmm2, %xmm6 #2065.17 - vfmsub213sd 12992+__svml_dlog_ha_data_internal(%rip), %xmm15, %xmm0 #2056.16 - vmulsd 13120+__svml_dlog_ha_data_internal(%rip), %xmm2, %xmm7 #2066.17 - vfmadd213sd 12480+__svml_dlog_ha_data_internal(%rip), %xmm0, %xmm4 #2071.18 - vfmadd213sd 12608+__svml_dlog_ha_data_internal(%rip), %xmm0, %xmm3 #2072.18 + vmovsd 12416+__jsvml_dlog_ha_data_internal(%rip), %xmm4 #2067.28 + vmovsd 12544+__jsvml_dlog_ha_data_internal(%rip), %xmm3 #2069.28 + vmulsd 13056+__jsvml_dlog_ha_data_internal(%rip), %xmm2, %xmm6 #2065.17 + vfmsub213sd 12992+__jsvml_dlog_ha_data_internal(%rip), %xmm15, %xmm0 #2056.16 + vmulsd 13120+__jsvml_dlog_ha_data_internal(%rip), %xmm2, %xmm7 #2066.17 + vfmadd213sd 12480+__jsvml_dlog_ha_data_internal(%rip), %xmm0, %xmm4 #2071.18 + vfmadd213sd 12608+__jsvml_dlog_ha_data_internal(%rip), %xmm0, %xmm3 #2072.18 vmulsd %xmm0, %xmm0, %xmm5 #2073.17 movslq %eax, %rax #2061.108 vfmadd213sd %xmm3, %xmm5, %xmm4 #2074.16 @@ -842,29 +842,29 @@ __svml_log1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #2085.546 lea 64(%rsp), %rsi #2085.546 -..___tag_value___svml_log1_ha_l9.101: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #2085.546 -..___tag_value___svml_log1_ha_l9.102: +..___tag_value___jsvml_log1_ha_l9.101: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #2085.546 +..___tag_value___jsvml_log1_ha_l9.102: jmp ..B6.4 # Prob 100% #2085.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_log1_ha_l9,@function - .size __svml_log1_ha_l9,.-__svml_log1_ha_l9 -..LN__svml_log1_ha_l9.5: + .type __jsvml_log1_ha_l9,@function + .size __jsvml_log1_ha_l9,.-__jsvml_log1_ha_l9 +..LN__jsvml_log1_ha_l9.5: .data -# -- End __svml_log1_ha_l9 +# -- End __jsvml_log1_ha_l9 .text -.L_2__routine_start___svml_log4_ha_e9_6: -# -- Begin __svml_log4_ha_e9 +.L_2__routine_start___jsvml_log4_ha_e9_6: +# -- Begin __jsvml_log4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log4_ha_e9 -# --- __svml_log4_ha_e9(__m256d) -__svml_log4_ha_e9: + .globl __jsvml_log4_ha_e9 +# --- __jsvml_log4_ha_e9(__m256d) +__jsvml_log4_ha_e9: # parameter 1: %ymm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -873,7 +873,7 @@ __svml_log4_ha_e9: .byte 30 #2177.552 .byte 250 #2177.552 .cfi_startproc -..___tag_value___svml_log4_ha_e9.104: +..___tag_value___jsvml_log4_ha_e9.104: ..L105: #2093.1 pushq %rbp #2093.1 @@ -883,33 +883,33 @@ __svml_log4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #2093.1 subq $192, %rsp #2093.1 - lea -8454144+__svml_dlog_ha_data_internal(%rip), %r8 #2153.72 + lea -8454144+__jsvml_dlog_ha_data_internal(%rip), %r8 #2153.72 vmovapd %ymm0, %ymm5 #2093.1 - vandpd 12672+__svml_dlog_ha_data_internal(%rip), %ymm5, %ymm6 #2131.19 - vorpd 12736+__svml_dlog_ha_data_internal(%rip), %ymm6, %ymm4 #2132.19 + vandpd 12672+__jsvml_dlog_ha_data_internal(%rip), %ymm5, %ymm6 #2131.19 + vorpd 12736+__jsvml_dlog_ha_data_internal(%rip), %ymm6, %ymm4 #2132.19 vcvtpd2ps %ymm4, %xmm7 #2135.44 vrcpps %xmm7, %xmm8 #2135.33 vcvtps2pd %xmm8, %ymm12 #2135.17 vroundpd $0, %ymm12, %ymm2 #2141.17 - vandpd 12928+__svml_dlog_ha_data_internal(%rip), %ymm4, %ymm7 #2148.124 + vandpd 12928+__jsvml_dlog_ha_data_internal(%rip), %ymm4, %ymm7 #2148.124 vsubpd %ymm7, %ymm4, %ymm4 #2148.181 vmulpd %ymm7, %ymm2, %ymm8 #2148.237 vpsrlq $20, %xmm5, %xmm10 #2137.22 vextractf128 $1, %ymm5, %xmm9 #2136.111 - vcmpnle_uqpd 12864+__svml_dlog_ha_data_internal(%rip), %ymm5, %ymm15 #2140.18 - vcmplt_oqpd 12800+__svml_dlog_ha_data_internal(%rip), %ymm5, %ymm14 #2139.18 + vcmpnle_uqpd 12864+__jsvml_dlog_ha_data_internal(%rip), %ymm5, %ymm15 #2140.18 + vcmplt_oqpd 12800+__jsvml_dlog_ha_data_internal(%rip), %ymm5, %ymm14 #2139.18 vpsrlq $20, %xmm9, %xmm11 #2137.80 vshufps $221, %xmm11, %xmm10, %xmm13 #2138.41 vmulpd %ymm4, %ymm2, %ymm9 #2148.291 vcvtdq2pd %xmm13, %ymm3 #2142.24 - vsubpd 12992+__svml_dlog_ha_data_internal(%rip), %ymm8, %ymm10 #2148.339 + vsubpd 12992+__jsvml_dlog_ha_data_internal(%rip), %ymm8, %ymm10 #2148.339 vorpd %ymm15, %ymm14, %ymm1 #2143.18 vpsrlq $39, %xmm2, %xmm12 #2150.26 vextractf128 $1, %ymm2, %xmm11 #2149.114 vmovd %xmm12, %edx #2153.147 vpsrlq $39, %xmm11, %xmm13 #2150.85 vmovd %xmm13, %esi #2153.502 - vmulpd 13120+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm11 #2158.17 + vmulpd 13120+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm11 #2158.17 vpextrd $2, %xmm12, %ecx #2153.323 vpextrd $2, %xmm13, %edi #2153.678 movslq %edx, %rdx #2153.72 @@ -926,18 +926,18 @@ __svml_log4_ha_e9: vmovmskps %xmm6, %eax #2145.44 vmovupd (%r8,%rsi), %xmm6 #2153.427 vunpcklpd %xmm7, %xmm6, %xmm15 #2153.812 - vmulpd 13056+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm9 #2157.17 - vmulpd 12416+__svml_dlog_ha_data_internal(%rip), %ymm1, %ymm3 #2163.33 + vmulpd 13056+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm9 #2157.17 + vmulpd 12416+__jsvml_dlog_ha_data_internal(%rip), %ymm1, %ymm3 #2163.33 vunpckhpd %xmm7, %xmm6, %xmm8 #2153.939 vmulpd %ymm1, %ymm1, %ymm7 #2165.17 vinsertf128 $1, %xmm15, %ymm14, %ymm0 #2153.733 vunpckhpd %xmm4, %xmm2, %xmm14 #2153.906 - vaddpd 12480+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm2 #2163.18 + vaddpd 12480+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm2 #2163.18 vaddpd %ymm9, %ymm0, %ymm0 #2168.17 - vmulpd 12544+__svml_dlog_ha_data_internal(%rip), %ymm1, %ymm3 #2164.33 + vmulpd 12544+__jsvml_dlog_ha_data_internal(%rip), %ymm1, %ymm3 #2164.33 vmulpd %ymm7, %ymm2, %ymm6 #2166.31 vaddpd %ymm0, %ymm1, %ymm2 #2170.21 - vaddpd 12608+__svml_dlog_ha_data_internal(%rip), %ymm3, %ymm4 #2164.18 + vaddpd 12608+__jsvml_dlog_ha_data_internal(%rip), %ymm3, %ymm4 #2164.18 vsubpd %ymm0, %ymm2, %ymm12 #2171.17 vsubpd %ymm12, %ymm1, %ymm1 #2172.17 vinsertf128 $1, %xmm8, %ymm14, %ymm10 #2153.860 @@ -1006,29 +1006,29 @@ __svml_log4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #2177.552 lea 128(%rsp,%r12,8), %rsi #2177.552 -..___tag_value___svml_log4_ha_e9.122: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #2177.552 -..___tag_value___svml_log4_ha_e9.123: +..___tag_value___jsvml_log4_ha_e9.122: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #2177.552 +..___tag_value___jsvml_log4_ha_e9.123: jmp ..B7.8 # Prob 100% #2177.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log4_ha_e9,@function - .size __svml_log4_ha_e9,.-__svml_log4_ha_e9 -..LN__svml_log4_ha_e9.6: + .type __jsvml_log4_ha_e9,@function + .size __jsvml_log4_ha_e9,.-__jsvml_log4_ha_e9 +..LN__jsvml_log4_ha_e9.6: .data -# -- End __svml_log4_ha_e9 +# -- End __jsvml_log4_ha_e9 .text -.L_2__routine_start___svml_log2_ha_e9_7: -# -- Begin __svml_log2_ha_e9 +.L_2__routine_start___jsvml_log2_ha_e9_7: +# -- Begin __jsvml_log2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log2_ha_e9 -# --- __svml_log2_ha_e9(__m128d) -__svml_log2_ha_e9: + .globl __jsvml_log2_ha_e9 +# --- __jsvml_log2_ha_e9(__m128d) +__jsvml_log2_ha_e9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1037,7 +1037,7 @@ __svml_log2_ha_e9: .byte 30 #2269.546 .byte 250 #2269.546 .cfi_startproc -..___tag_value___svml_log2_ha_e9.125: +..___tag_value___jsvml_log2_ha_e9.125: ..L126: #2185.1 pushq %rbp #2185.1 @@ -1048,56 +1048,56 @@ __svml_log2_ha_e9: andq $-64, %rsp #2185.1 subq $192, %rsp #2185.1 movaps %xmm0, %xmm5 #2229.22 - movups 12672+__svml_dlog_ha_data_internal(%rip), %xmm1 #2223.19 + movups 12672+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #2223.19 psrlq $20, %xmm5 #2229.22 andps %xmm0, %xmm1 #2223.19 - lea -8454144+__svml_dlog_ha_data_internal(%rip), %rsi #2245.71 - orps 12736+__svml_dlog_ha_data_internal(%rip), %xmm1 #2224.19 + lea -8454144+__jsvml_dlog_ha_data_internal(%rip), %rsi #2245.71 + orps 12736+__jsvml_dlog_ha_data_internal(%rip), %xmm1 #2224.19 movaps %xmm0, %xmm8 #2231.18 cvtpd2ps %xmm1, %xmm2 #2227.57 - cmpltpd 12800+__svml_dlog_ha_data_internal(%rip), %xmm8 #2231.18 + cmpltpd 12800+__jsvml_dlog_ha_data_internal(%rip), %xmm8 #2231.18 movlhps %xmm2, %xmm2 #2227.41 movaps %xmm0, %xmm7 #2232.18 rcpps %xmm2, %xmm3 #2227.30 - cmpnlepd 12864+__svml_dlog_ha_data_internal(%rip), %xmm7 #2232.18 + cmpnlepd 12864+__jsvml_dlog_ha_data_internal(%rip), %xmm7 #2232.18 cvtps2pd %xmm3, %xmm4 #2227.17 - movups 12928+__svml_dlog_ha_data_internal(%rip), %xmm9 #2239.54 + movups 12928+__jsvml_dlog_ha_data_internal(%rip), %xmm9 #2239.54 orps %xmm7, %xmm8 #2235.18 roundpd $0, %xmm4, %xmm4 #2233.17 andps %xmm1, %xmm9 #2240.124 subpd %xmm9, %xmm1 #2240.178 mulpd %xmm4, %xmm9 #2240.231 mulpd %xmm4, %xmm1 #2240.282 - subpd 12992+__svml_dlog_ha_data_internal(%rip), %xmm9 #2240.327 + subpd 12992+__jsvml_dlog_ha_data_internal(%rip), %xmm9 #2240.327 movmskpd %xmm8, %edx #2237.44 pshufd $221, %xmm5, %xmm6 #2230.23 psrlq $39, %xmm4 #2242.26 addpd %xmm9, %xmm1 #2240.369 cvtdq2pd %xmm6, %xmm15 #2234.24 movd %xmm4, %eax #2245.146 - movups 12416+__svml_dlog_ha_data_internal(%rip), %xmm12 #2255.30 + movups 12416+__jsvml_dlog_ha_data_internal(%rip), %xmm12 #2255.30 movaps %xmm1, %xmm3 #2257.17 mulpd %xmm1, %xmm12 #2255.30 mulpd %xmm1, %xmm3 #2257.17 - addpd 12480+__svml_dlog_ha_data_internal(%rip), %xmm12 #2255.18 - movups 13056+__svml_dlog_ha_data_internal(%rip), %xmm14 #2249.17 + addpd 12480+__jsvml_dlog_ha_data_internal(%rip), %xmm12 #2255.18 + movups 13056+__jsvml_dlog_ha_data_internal(%rip), %xmm14 #2249.17 movaps %xmm1, %xmm5 #2262.21 mulpd %xmm15, %xmm14 #2249.17 mulpd %xmm3, %xmm12 #2258.28 movslq %eax, %rax #2245.71 pextrd $2, %xmm4, %ecx #2245.315 movslq %ecx, %rcx #2245.240 - movups 12544+__svml_dlog_ha_data_internal(%rip), %xmm13 #2256.30 + movups 12544+__jsvml_dlog_ha_data_internal(%rip), %xmm13 #2256.30 movups (%rsi,%rax), %xmm2 #2245.71 mulpd %xmm1, %xmm13 #2256.30 movups (%rsi,%rcx), %xmm10 #2245.240 movaps %xmm2, %xmm4 #2245.364 unpcklpd %xmm10, %xmm4 #2245.364 addpd %xmm14, %xmm4 #2260.17 - addpd 12608+__svml_dlog_ha_data_internal(%rip), %xmm13 #2256.18 + addpd 12608+__jsvml_dlog_ha_data_internal(%rip), %xmm13 #2256.18 addpd %xmm4, %xmm5 #2262.21 addpd %xmm12, %xmm13 #2258.16 - movups 13120+__svml_dlog_ha_data_internal(%rip), %xmm11 #2248.49 + movups 13120+__jsvml_dlog_ha_data_internal(%rip), %xmm11 #2248.49 movaps %xmm5, %xmm12 #2263.17 mulpd %xmm11, %xmm15 #2250.17 subpd %xmm4, %xmm12 #2263.17 @@ -1163,29 +1163,29 @@ __svml_log2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #2269.546 lea 128(%rsp,%r12,8), %rsi #2269.546 -..___tag_value___svml_log2_ha_e9.143: -# __svml_dlog_ha_cout_rare_internal(const double *, double *) - call __svml_dlog_ha_cout_rare_internal #2269.546 -..___tag_value___svml_log2_ha_e9.144: +..___tag_value___jsvml_log2_ha_e9.143: +# __jsvml_dlog_ha_cout_rare_internal(const double *, double *) + call __jsvml_dlog_ha_cout_rare_internal #2269.546 +..___tag_value___jsvml_log2_ha_e9.144: jmp ..B8.8 # Prob 100% #2269.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log2_ha_e9,@function - .size __svml_log2_ha_e9,.-__svml_log2_ha_e9 -..LN__svml_log2_ha_e9.7: + .type __jsvml_log2_ha_e9,@function + .size __jsvml_log2_ha_e9,.-__jsvml_log2_ha_e9 +..LN__jsvml_log2_ha_e9.7: .data -# -- End __svml_log2_ha_e9 +# -- End __jsvml_log2_ha_e9 .text -.L_2__routine_start___svml_log8_ha_z0_8: -# -- Begin __svml_log8_ha_z0 +.L_2__routine_start___jsvml_log8_ha_z0_8: +# -- Begin __jsvml_log8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_log8_ha_z0 -# --- __svml_log8_ha_z0(__m512d) -__svml_log8_ha_z0: + .globl __jsvml_log8_ha_z0 +# --- __jsvml_log8_ha_z0(__m512d) +__jsvml_log8_ha_z0: # parameter 1: %zmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1194,42 +1194,42 @@ __svml_log8_ha_z0: .byte 30 #2368.12 .byte 250 #2368.12 .cfi_startproc -..___tag_value___svml_log8_ha_z0.146: +..___tag_value___jsvml_log8_ha_z0.146: ..L147: #2277.1 vmovaps %zmm0, %zmm4 #2277.1 vgetmantpd $8, {sae}, %zmm4, %zmm6 #2321.21 - vmovups 256+__svml_dlog_ha_data_internal_avx512(%rip), %zmm10 #2328.46 - vmovups 320+__svml_dlog_ha_data_internal_avx512(%rip), %zmm9 #2326.47 + vmovups 256+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm10 #2328.46 + vmovups 320+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm9 #2326.47 vgetexppd {sae}, %zmm4, %zmm5 #2322.18 - vmovups __svml_dlog_ha_data_internal_avx512(%rip), %zmm2 #2333.285 - vmovups 512+__svml_dlog_ha_data_internal_avx512(%rip), %zmm13 #2337.54 - vmovups 896+__svml_dlog_ha_data_internal_avx512(%rip), %zmm14 #2342.46 - vmovups 640+__svml_dlog_ha_data_internal_avx512(%rip), %zmm15 #2344.54 - vmovups 384+__svml_dlog_ha_data_internal_avx512(%rip), %zmm12 #2335.54 - vmovups 448+__svml_dlog_ha_data_internal_avx512(%rip), %zmm1 #2339.14 - vmovups 128+__svml_dlog_ha_data_internal_avx512(%rip), %zmm3 #2334.285 + vmovups __jsvml_dlog_ha_data_internal_avx512(%rip), %zmm2 #2333.285 + vmovups 512+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm13 #2337.54 + vmovups 896+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm14 #2342.46 + vmovups 640+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm15 #2344.54 + vmovups 384+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm12 #2335.54 + vmovups 448+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm1 #2339.14 + vmovups 128+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm3 #2334.285 vrcp14pd %zmm6, %zmm7 #2324.17 vfpclasspd $223, %zmm4, %k2 #2323.24 - vmovups 960+__svml_dlog_ha_data_internal_avx512(%rip), %zmm4 #2358.46 + vmovups 960+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm4 #2358.46 vrndscalepd $88, {sae}, %zmm7, %zmm8 #2325.17 - vmovups 576+__svml_dlog_ha_data_internal_avx512(%rip), %zmm7 #2341.14 + vmovups 576+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm7 #2341.14 vfmsub213pd {rn-sae}, %zmm10, %zmm8, %zmm6 #2329.12 vcmppd $17, {sae}, %zmm9, %zmm8, %k1 #2327.19 - vmovups 704+__svml_dlog_ha_data_internal_avx512(%rip), %zmm9 #2348.14 + vmovups 704+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm9 #2348.14 vfmadd231pd {rn-sae}, %zmm6, %zmm13, %zmm7 #2341.14 - vmovups 768+__svml_dlog_ha_data_internal_avx512(%rip), %zmm13 #2346.54 + vmovups 768+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm13 #2346.54 vfmadd231pd {rn-sae}, %zmm6, %zmm12, %zmm1 #2339.14 vmulpd {rn-sae}, %zmm6, %zmm6, %zmm0 #2340.15 vfmadd231pd {rn-sae}, %zmm6, %zmm15, %zmm9 #2348.14 vpsrlq $48, %zmm8, %zmm11 #2330.42 - vmovups 832+__svml_dlog_ha_data_internal_avx512(%rip), %zmm8 #2349.14 + vmovups 832+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm8 #2349.14 vfmadd213pd {rn-sae}, %zmm7, %zmm0, %zmm1 #2350.14 vmulpd {rn-sae}, %zmm0, %zmm0, %zmm15 #2352.15 vfmadd231pd {rn-sae}, %zmm6, %zmm13, %zmm8 #2349.14 vaddpd {rn-sae}, %zmm10, %zmm5, %zmm5{%k1} #2332.18 - vpermt2pd 64+__svml_dlog_ha_data_internal_avx512(%rip), %zmm11, %zmm2 #2333.285 - vpermt2pd 192+__svml_dlog_ha_data_internal_avx512(%rip), %zmm11, %zmm3 #2334.285 + vpermt2pd 64+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm11, %zmm2 #2333.285 + vpermt2pd 192+__jsvml_dlog_ha_data_internal_avx512(%rip), %zmm11, %zmm3 #2334.285 vfmadd213pd {rn-sae}, %zmm8, %zmm0, %zmm9 #2353.14 vfmadd231pd {rn-sae}, %zmm5, %zmm14, %zmm2 #2343.13 vfmadd213pd {rn-sae}, %zmm3, %zmm4, %zmm5 #2359.13 @@ -1246,21 +1246,21 @@ __svml_log8_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_log8_ha_z0,@function - .size __svml_log8_ha_z0,.-__svml_log8_ha_z0 -..LN__svml_log8_ha_z0.8: + .type __jsvml_log8_ha_z0,@function + .size __jsvml_log8_ha_z0,.-__jsvml_log8_ha_z0 +..LN__jsvml_log8_ha_z0.8: .data -# -- End __svml_log8_ha_z0 +# -- End __jsvml_log8_ha_z0 .text -.L_2__routine_start___svml_dlog_ha_cout_rare_internal_9: -# -- Begin __svml_dlog_ha_cout_rare_internal +.L_2__routine_start___jsvml_dlog_ha_cout_rare_internal_9: +# -- Begin __jsvml_dlog_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dlog_ha_cout_rare_internal - .globl __svml_dlog_ha_cout_rare_internal -# --- __svml_dlog_ha_cout_rare_internal(const double *, double *) -__svml_dlog_ha_cout_rare_internal: + .hidden __jsvml_dlog_ha_cout_rare_internal + .globl __jsvml_dlog_ha_cout_rare_internal +# --- __jsvml_dlog_ha_cout_rare_internal(const double *, double *) +__jsvml_dlog_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1270,7 +1270,7 @@ __svml_dlog_ha_cout_rare_internal: .byte 30 #1804.17 .byte 250 #1804.17 .cfi_startproc -..___tag_value___svml_dlog_ha_cout_rare_internal.149: +..___tag_value___jsvml_dlog_ha_cout_rare_internal.149: ..L150: #1726.1 xorl %eax, %eax #1736.14 @@ -1453,17 +1453,17 @@ __svml_dlog_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dlog_ha_cout_rare_internal,@function - .size __svml_dlog_ha_cout_rare_internal,.-__svml_dlog_ha_cout_rare_internal -..LN__svml_dlog_ha_cout_rare_internal.9: + .type __jsvml_dlog_ha_cout_rare_internal,@function + .size __jsvml_dlog_ha_cout_rare_internal,.-__jsvml_dlog_ha_cout_rare_internal +..LN__jsvml_dlog_ha_cout_rare_internal.9: .data -# -- End __svml_dlog_ha_cout_rare_internal +# -- End __jsvml_dlog_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dlog_ha_data_internal_avx512 - .globl __svml_dlog_ha_data_internal_avx512 -__svml_dlog_ha_data_internal_avx512: + .hidden __jsvml_dlog_ha_data_internal_avx512 + .globl __jsvml_dlog_ha_data_internal_avx512 +__jsvml_dlog_ha_data_internal_avx512: .long 0 .long 0 .long 3222405120 @@ -1768,12 +1768,12 @@ __svml_dlog_ha_data_internal_avx512: .long 0 .long 120 .long 0 - .type __svml_dlog_ha_data_internal_avx512,@object - .size __svml_dlog_ha_data_internal_avx512,1216 + .type __jsvml_dlog_ha_data_internal_avx512,@object + .size __jsvml_dlog_ha_data_internal_avx512,1216 .align 64 - .hidden __svml_dlog_ha_data_internal - .globl __svml_dlog_ha_data_internal -__svml_dlog_ha_data_internal: + .hidden __jsvml_dlog_ha_data_internal + .globl __jsvml_dlog_ha_data_internal +__jsvml_dlog_ha_data_internal: .long 3715793664 .long 3230016299 .long 4013928704 @@ -5368,8 +5368,8 @@ __svml_dlog_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_dlog_ha_data_internal,@object - .size __svml_dlog_ha_data_internal,13632 + .type __jsvml_dlog_ha_data_internal,@object + .size __jsvml_dlog_ha_data_internal,13632 .align 32 _imldLnHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_pow_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_pow_linux_x86.S similarity index 92% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_pow_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_pow_linux_x86.S index 1c83d894a1c..73368bd6959 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_pow_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_pow_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_pow.c" .text ..TXTST0: -.L_2__routine_start___svml_pow2_ha_e9_0: -# -- Begin __svml_pow2_ha_e9 +.L_2__routine_start___jsvml_pow2_ha_e9_0: +# -- Begin __jsvml_pow2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_pow2_ha_e9 -# --- __svml_pow2_ha_e9(__m128d, __m128d) -__svml_pow2_ha_e9: + .globl __jsvml_pow2_ha_e9 +# --- __jsvml_pow2_ha_e9(__m128d, __m128d) +__jsvml_pow2_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B1.1: # Preds ..B1.0 @@ -48,7 +48,7 @@ __svml_pow2_ha_e9: .byte 30 #2212.663 .byte 250 #2212.663 .cfi_startproc -..___tag_value___svml_pow2_ha_e9.1: +..___tag_value___jsvml_pow2_ha_e9.1: ..L2: #2001.1 pushq %rbp #2001.1 @@ -60,10 +60,10 @@ __svml_pow2_ha_e9: subq $256, %rsp #2001.1 movaps %xmm1, %xmm11 #2001.1 pshufd $221, %xmm0, %xmm4 #2087.25 - lea __svml_dpow_ha_data_internal(%rip), %rax #2110.36 - movq 28672+__svml_dpow_ha_data_internal(%rip), %xmm12 #2104.27 + lea __jsvml_dpow_ha_data_internal(%rip), %rax #2110.36 + movq 28672+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2104.27 movdqa %xmm4, %xmm13 #2113.23 - movq 28736+__svml_dpow_ha_data_internal(%rip), %xmm10 #2105.30 + movq 28736+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #2105.30 pand %xmm4, %xmm12 #2104.27 paddd %xmm10, %xmm12 #2107.27 psrld $10, %xmm12 #2107.27 @@ -72,7 +72,7 @@ __svml_pow2_ha_e9: movd %xmm12, %esi #2111.119 pslld $3, %xmm1 #2108.28 movd %xmm1, %edx #2110.106 - movups 27520+__svml_dpow_ha_data_internal(%rip), %xmm9 #2099.18 + movups 27520+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #2099.18 andps %xmm0, %xmm9 #2099.18 movslq %esi, %rsi #2111.71 pextrd $1, %xmm12, %edi #2111.263 @@ -80,12 +80,12 @@ __svml_pow2_ha_e9: pextrd $1, %xmm1, %ecx #2110.211 movslq %edi, %rdi #2111.215 movslq %ecx, %rcx #2110.141 - movq 28800+__svml_dpow_ha_data_internal(%rip), %xmm1 #2112.30 + movq 28800+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2112.30 movups 8256(%rax,%rsi), %xmm10 #2111.71 psubd %xmm1, %xmm13 #2113.23 - movups 27840+__svml_dpow_ha_data_internal(%rip), %xmm1 #2123.55 + movups 27840+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2123.55 movaps %xmm10, %xmm7 #2111.314 - orps 27648+__svml_dpow_ha_data_internal(%rip), %xmm9 #2101.18 + orps 27648+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #2101.18 movaps %xmm1, %xmm8 #2124.20 movsd (%rax,%rdx), %xmm14 #2110.36 andps %xmm9, %xmm8 #2124.20 @@ -95,7 +95,7 @@ __svml_pow2_ha_e9: unpcklpd %xmm15, %xmm7 #2111.314 unpckhpd %xmm15, %xmm10 #2111.355 movaps %xmm9, %xmm15 #2125.20 - movq 28864+__svml_dpow_ha_data_internal(%rip), %xmm12 #2115.31 + movq 28864+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2115.31 subpd %xmm8, %xmm15 #2125.20 mulpd %xmm14, %xmm9 #2126.18 mulpd %xmm14, %xmm8 #2129.29 @@ -103,11 +103,11 @@ __svml_pow2_ha_e9: subpd %xmm9, %xmm8 #2129.17 paddd %xmm12, %xmm13 #2117.23 pshufd $80, %xmm13, %xmm12 #2117.23 - andps 27712+__svml_dpow_ha_data_internal(%rip), %xmm12 #2120.17 - subpd 27776+__svml_dpow_ha_data_internal(%rip), %xmm12 #2122.17 + andps 27712+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2120.17 + subpd 27776+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2122.17 addpd %xmm14, %xmm8 #2130.17 addpd %xmm12, %xmm7 #2131.17 - movups 27904+__svml_dpow_ha_data_internal(%rip), %xmm13 #2128.18 + movups 27904+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2128.18 movaps %xmm11, %xmm12 #2159.19 addpd %xmm9, %xmm13 #2128.18 movaps %xmm13, %xmm14 #2132.19 @@ -119,19 +119,19 @@ __svml_pow2_ha_e9: addpd %xmm13, %xmm7 #2134.18 addpd %xmm8, %xmm13 #2140.18 addpd %xmm8, %xmm14 #2137.19 - movups 26816+__svml_dpow_ha_data_internal(%rip), %xmm8 #2143.32 + movups 26816+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2143.32 mulpd %xmm13, %xmm8 #2143.32 addpd %xmm14, %xmm7 #2138.19 - addpd 26880+__svml_dpow_ha_data_internal(%rip), %xmm8 #2143.20 + addpd 26880+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2143.20 addpd %xmm7, %xmm10 #2139.19 mulpd %xmm13, %xmm8 #2145.32 - addpd 26944+__svml_dpow_ha_data_internal(%rip), %xmm8 #2145.20 + addpd 26944+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2145.20 mulpd %xmm13, %xmm8 #2147.32 - addpd 27008+__svml_dpow_ha_data_internal(%rip), %xmm8 #2147.20 + addpd 27008+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2147.20 mulpd %xmm13, %xmm8 #2149.32 - addpd 27072+__svml_dpow_ha_data_internal(%rip), %xmm8 #2149.20 + addpd 27072+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2149.20 mulpd %xmm13, %xmm8 #2151.32 - addpd 27136+__svml_dpow_ha_data_internal(%rip), %xmm8 #2151.20 + addpd 27136+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2151.20 mulpd %xmm8, %xmm13 #2152.31 addpd %xmm13, %xmm10 #2152.19 movaps %xmm9, %xmm8 #2153.26 @@ -151,19 +151,19 @@ __svml_pow2_ha_e9: mulpd %xmm12, %xmm7 #2170.30 movaps %xmm8, %xmm13 #2168.18 mulpd %xmm12, %xmm13 #2168.18 - movq 28352+__svml_dpow_ha_data_internal(%rip), %xmm3 #2089.37 - movq 28480+__svml_dpow_ha_data_internal(%rip), %xmm2 #2091.37 + movq 28352+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #2089.37 + movq 28480+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2091.37 paddd %xmm3, %xmm4 #2094.35 pshufd $221, %xmm11, %xmm6 #2088.25 pshufd $221, %xmm9, %xmm15 #2162.31 pand %xmm2, %xmm6 #2095.35 pand %xmm2, %xmm15 #2163.34 - movq 28416+__svml_dpow_ha_data_internal(%rip), %xmm2 #2094.35 - movq 28544+__svml_dpow_ha_data_internal(%rip), %xmm5 #2092.33 + movq 28416+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2094.35 + movq 28544+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #2092.33 pcmpgtd %xmm4, %xmm2 #2094.35 movdqa %xmm6, %xmm4 #2096.49 pcmpeqd %xmm5, %xmm6 #2096.100 - movq 28608+__svml_dpow_ha_data_internal(%rip), %xmm14 #2164.41 + movq 28608+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #2164.41 pcmpgtd %xmm5, %xmm4 #2096.49 movdqa %xmm15, %xmm5 #2165.49 por %xmm6, %xmm4 #2096.35 @@ -171,7 +171,7 @@ __svml_pow2_ha_e9: pcmpeqd %xmm14, %xmm15 #2165.107 por %xmm4, %xmm2 #2097.39 por %xmm15, %xmm5 #2165.35 - movups 28032+__svml_dpow_ha_data_internal(%rip), %xmm4 #2172.57 + movups 28032+__jsvml_dpow_ha_data_internal(%rip), %xmm4 #2172.57 por %xmm5, %xmm2 #2166.39 movaps %xmm4, %xmm5 #2173.19 addpd %xmm1, %xmm13 #2169.18 @@ -185,21 +185,21 @@ __svml_pow2_ha_e9: addpd %xmm13, %xmm9 #2190.17 movaps %xmm9, %xmm8 #2191.18 mulpd %xmm9, %xmm8 #2191.18 - movups 27200+__svml_dpow_ha_data_internal(%rip), %xmm10 #2195.31 + movups 27200+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #2195.31 movaps %xmm8, %xmm13 #2192.18 mulpd %xmm9, %xmm10 #2195.31 mulpd %xmm8, %xmm13 #2192.18 - addpd 27264+__svml_dpow_ha_data_internal(%rip), %xmm10 #2195.19 - movups 27328+__svml_dpow_ha_data_internal(%rip), %xmm7 #2201.31 + addpd 27264+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #2195.19 + movups 27328+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2201.31 mulpd %xmm9, %xmm7 #2201.31 mulpd %xmm10, %xmm13 #2196.19 - addpd 27392+__svml_dpow_ha_data_internal(%rip), %xmm7 #2201.19 - movq 28992+__svml_dpow_ha_data_internal(%rip), %xmm2 #2177.27 + addpd 27392+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2201.19 + movq 28992+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2177.27 pand %xmm6, %xmm2 #2177.27 pslld $13, %xmm6 #2179.23 pslld $4, %xmm2 #2178.27 movd %xmm2, %r8d #2186.120 - movq 28928+__svml_dpow_ha_data_internal(%rip), %xmm3 #2180.25 + movq 28928+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #2180.25 paddd %xmm3, %xmm6 #2182.23 movslq %r8d, %r8 #2186.71 pextrd $1, %xmm2, %r9d #2186.264 @@ -211,7 +211,7 @@ __svml_pow2_ha_e9: unpcklpd %xmm3, %xmm15 #2186.316 mulpd %xmm15, %xmm13 #2197.19 mulpd %xmm15, %xmm8 #2203.19 - movups 27456+__svml_dpow_ha_data_internal(%rip), %xmm14 #2205.51 + movups 27456+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #2205.51 mulpd %xmm9, %xmm14 #2206.19 unpckhpd %xmm3, %xmm12 #2186.359 addpd %xmm13, %xmm12 #2198.19 @@ -220,7 +220,7 @@ __svml_pow2_ha_e9: addpd %xmm14, %xmm12 #2208.19 addpd %xmm12, %xmm15 #2209.19 pshufd $80, %xmm6, %xmm1 #2182.23 - andps 27968+__svml_dpow_ha_data_internal(%rip), %xmm1 #2185.17 + andps 27968+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2185.17 mulpd %xmm15, %xmm1 #2210.18 andl $3, %edx #2167.110 jne ..B1.3 # Prob 5% #2212.52 @@ -280,29 +280,29 @@ __svml_pow2_ha_e9: lea 64(%rsp,%r12,8), %rdi #2212.663 lea 128(%rsp,%r12,8), %rsi #2212.663 lea 192(%rsp,%r12,8), %rdx #2212.663 -..___tag_value___svml_pow2_ha_e9.19: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #2212.663 -..___tag_value___svml_pow2_ha_e9.20: +..___tag_value___jsvml_pow2_ha_e9.19: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #2212.663 +..___tag_value___jsvml_pow2_ha_e9.20: jmp ..B1.8 # Prob 100% #2212.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_pow2_ha_e9,@function - .size __svml_pow2_ha_e9,.-__svml_pow2_ha_e9 -..LN__svml_pow2_ha_e9.0: + .type __jsvml_pow2_ha_e9,@function + .size __jsvml_pow2_ha_e9,.-__jsvml_pow2_ha_e9 +..LN__jsvml_pow2_ha_e9.0: .data -# -- End __svml_pow2_ha_e9 +# -- End __jsvml_pow2_ha_e9 .text -.L_2__routine_start___svml_pow8_ha_z0_1: -# -- Begin __svml_pow8_ha_z0 +.L_2__routine_start___jsvml_pow8_ha_z0_1: +# -- Begin __jsvml_pow8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_pow8_ha_z0 -# --- __svml_pow8_ha_z0(__m512d, __m512d) -__svml_pow8_ha_z0: + .globl __jsvml_pow8_ha_z0 +# --- __jsvml_pow8_ha_z0(__m512d, __m512d) +__jsvml_pow8_ha_z0: # parameter 1: %zmm0 # parameter 2: %zmm1 ..B2.1: # Preds ..B2.0 @@ -312,7 +312,7 @@ __svml_pow8_ha_z0: .byte 30 #2397.878 .byte 250 #2397.878 .cfi_startproc -..___tag_value___svml_pow8_ha_z0.22: +..___tag_value___jsvml_pow8_ha_z0.22: ..L23: #2220.1 pushq %rbp #2220.1 @@ -323,60 +323,60 @@ __svml_pow8_ha_z0: andq $-64, %rsp #2220.1 subq $256, %rsp #2220.1 vgetmantpd $10, {sae}, %zmm0, %zmm12 #2311.28 - vmovups 768+__svml_dpow_ha_data_internal_avx512(%rip), %zmm10 #2316.57 - vmovups __svml_dpow_ha_data_internal_avx512(%rip), %zmm8 #2328.494 - vmovups 128+__svml_dpow_ha_data_internal_avx512(%rip), %zmm6 #2328.854 + vmovups 768+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm10 #2316.57 + vmovups __jsvml_dpow_ha_data_internal_avx512(%rip), %zmm8 #2328.494 + vmovups 128+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm6 #2328.854 vgetexppd {sae}, %zmm0, %zmm9 #2312.25 - vmovups 896+__svml_dpow_ha_data_internal_avx512(%rip), %zmm2 #2325.53 - vmovups 256+__svml_dpow_ha_data_internal_avx512(%rip), %zmm5 #2329.494 - vmovups 384+__svml_dpow_ha_data_internal_avx512(%rip), %zmm4 #2329.854 + vmovups 896+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm2 #2325.53 + vmovups 256+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm5 #2329.494 + vmovups 384+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm4 #2329.854 vrcp14pd %zmm12, %zmm13 #2315.24 vmulpd {rn-sae}, %zmm10, %zmm12, %zmm14 #2317.28 vrndscalepd $88, {sae}, %zmm13, %zmm15 #2318.24 - vmovups 1152+__svml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2334.61 - vmovups 1024+__svml_dpow_ha_data_internal_avx512(%rip), %zmm12 #2331.62 + vmovups 1152+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2334.61 + vmovups 1024+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm12 #2331.62 vfpclasspd $223, %zmm0, %k0 #2313.27 vpsrlq $47, %zmm15, %zmm3 #2324.45 vfmsub231pd {rn-sae}, %zmm15, %zmm14, %zmm10 #2323.19 - vpermt2pd 64+__svml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm8 #2328.494 - vpermt2pd 192+__svml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm6 #2328.854 - vpermt2pd 320+__svml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm5 #2329.494 - vpermt2pd 448+__svml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm4 #2329.854 + vpermt2pd 64+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm8 #2328.494 + vpermt2pd 192+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm6 #2328.854 + vpermt2pd 320+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm5 #2329.494 + vpermt2pd 448+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm3, %zmm4 #2329.854 vpsllq $59, %zmm3, %zmm7 #2328.917 kmovw %k0, %esi #2313.27 vpmovq2m %zmm7, %k3 #2328.972 - vmovups 1088+__svml_dpow_ha_data_internal_avx512(%rip), %zmm7 #2333.23 + vmovups 1088+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm7 #2333.23 vblendmpd %zmm6, %zmm8, %zmm14{%k3} #2328.1014 vblendmpd %zmm4, %zmm5, %zmm8{%k3} #2329.1014 vmulpd {rn-sae}, %zmm10, %zmm10, %zmm6 #2330.22 - vmovups 1344+__svml_dpow_ha_data_internal_avx512(%rip), %zmm5 #2340.22 + vmovups 1344+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm5 #2340.22 vfmadd231pd {rn-sae}, %zmm10, %zmm12, %zmm7 #2333.23 vmulpd {rn-sae}, %zmm6, %zmm6, %zmm12 #2347.22 vmovaps %zmm1, %zmm11 #2220.1 - vmovups 832+__svml_dpow_ha_data_internal_avx512(%rip), %zmm1 #2321.54 + vmovups 832+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm1 #2321.54 vfpclasspd $153, %zmm11, %k1 #2314.28 vcmppd $17, {sae}, %zmm1, %zmm15, %k2 #2322.26 - vmovups 1216+__svml_dpow_ha_data_internal_avx512(%rip), %zmm1 #2336.22 - vmovups 1408+__svml_dpow_ha_data_internal_avx512(%rip), %zmm15 #2341.61 + vmovups 1216+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm1 #2336.22 + vmovups 1408+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm15 #2341.61 vaddpd {rn-sae}, %zmm2, %zmm9, %zmm9{%k2} #2326.25 - vmovups 1472+__svml_dpow_ha_data_internal_avx512(%rip), %zmm2 #2343.22 + vmovups 1472+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm2 #2343.22 vfmadd231pd {rn-sae}, %zmm10, %zmm13, %zmm1 #2336.22 - vmovups 960+__svml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2345.53 + vmovups 960+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2345.53 vaddpd {rn-sae}, %zmm9, %zmm14, %zmm4 #2337.22 - vmovups 1280+__svml_dpow_ha_data_internal_avx512(%rip), %zmm9 #2338.61 + vmovups 1280+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm9 #2338.61 vfmadd231pd {rn-sae}, %zmm10, %zmm15, %zmm2 #2343.22 vfmadd213pd {rn-sae}, %zmm1, %zmm6, %zmm7 #2344.23 - vmovups 1600+__svml_dpow_ha_data_internal_avx512(%rip), %zmm14 #2351.22 - vmovups 2048+__svml_dpow_ha_data_internal_avx512(%rip), %zmm15 #2388.63 + vmovups 1600+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm14 #2351.22 + vmovups 2048+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm15 #2388.63 vfmadd231pd {rn-sae}, %zmm10, %zmm9, %zmm5 #2340.22 - vmovups 1536+__svml_dpow_ha_data_internal_avx512(%rip), %zmm9 #2349.61 + vmovups 1536+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm9 #2349.61 kmovw %k1, %eax #2314.28 vfmadd213pd {rn-sae}, %zmm2, %zmm6, %zmm5 #2348.22 vfmadd231pd {rn-sae}, %zmm10, %zmm9, %zmm14 #2351.22 vfmadd213pd {rn-sae}, %zmm5, %zmm12, %zmm7 #2353.23 - vmovups 1664+__svml_dpow_ha_data_internal_avx512(%rip), %zmm5 #2372.57 + vmovups 1664+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm5 #2372.57 vfmadd213pd {rn-sae}, %zmm14, %zmm6, %zmm7 #2356.23 - vmovups 1920+__svml_dpow_ha_data_internal_avx512(%rip), %zmm14 #2385.63 + vmovups 1920+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm14 #2385.63 vfmadd213pd {rn-sae}, %zmm8, %zmm10, %zmm7 #2359.20 vmovaps %zmm4, %zmm3 #2346.23 orl %eax, %esi #2320.48 @@ -389,31 +389,31 @@ __svml_pow8_ha_z0: vfnmadd231pd {rn-sae}, %zmm10, %zmm13, %zmm13 #2358.22 vfmsub213pd {rn-sae}, %zmm3, %zmm4, %zmm10 #2360.22 vsubpd {rn-sae}, %zmm10, %zmm13, %zmm10 #2361.24 - vmovups 1792+__svml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2381.63 + vmovups 1792+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2381.63 vaddpd {rn-sae}, %zmm10, %zmm7, %zmm1 #2362.22 vaddpd {rn-sae}, %zmm1, %zmm2, %zmm3 #2363.24 vmulpd {rz-sae}, %zmm11, %zmm3, %zmm4 #2364.21 vsubpd {rn-sae}, %zmm2, %zmm3, %zmm2 #2365.23 vfmsub213pd {rz-sae}, %zmm4, %zmm11, %zmm3 #2366.20 vsubpd {rn-sae}, %zmm2, %zmm1, %zmm6 #2367.23 - vmovups 640+__svml_dpow_ha_data_internal_avx512(%rip), %zmm2 #2378.293 + vmovups 640+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm2 #2378.293 vfmadd213pd {rz-sae}, %zmm3, %zmm11, %zmm6 #2368.20 - vmovups 512+__svml_dpow_ha_data_internal_avx512(%rip), %zmm3 #2377.293 + vmovups 512+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm3 #2377.293 vaddpd {rz-sae}, %zmm6, %zmm4, %zmm1 #2369.22 vsubpd {rn-sae}, %zmm4, %zmm1, %zmm7 #2371.23 vaddpd {rd-sae}, %zmm5, %zmm1, %zmm10 #2373.28 vreducepd $65, {sae}, %zmm1, %zmm8 #2370.20 - vmovups 1856+__svml_dpow_ha_data_internal_avx512(%rip), %zmm4 #2382.63 + vmovups 1856+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm4 #2382.63 vsubpd {rn-sae}, %zmm7, %zmm6, %zmm9 #2374.22 - vpermt2pd 576+__svml_dpow_ha_data_internal_avx512(%rip), %zmm10, %zmm3 #2377.293 - vpermt2pd 704+__svml_dpow_ha_data_internal_avx512(%rip), %zmm10, %zmm2 #2378.293 + vpermt2pd 576+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm10, %zmm3 #2377.293 + vpermt2pd 704+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm10, %zmm2 #2378.293 vaddpd {rn-sae}, %zmm9, %zmm8, %zmm12 #2375.22 - vandpd 1728+__svml_dpow_ha_data_internal_avx512(%rip), %zmm12, %zmm12 #2380.20 + vandpd 1728+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm12, %zmm12 #2380.20 vmulpd {rn-sae}, %zmm12, %zmm12, %zmm10 #2384.23 vfmadd231pd {rn-sae}, %zmm12, %zmm13, %zmm4 #2383.21 - vmovups 1984+__svml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2387.21 + vmovups 1984+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm13 #2387.21 vfmadd231pd {rn-sae}, %zmm12, %zmm14, %zmm13 #2387.21 - vmovups 2112+__svml_dpow_ha_data_internal_avx512(%rip), %zmm14 #2390.21 + vmovups 2112+__jsvml_dpow_ha_data_internal_avx512(%rip), %zmm14 #2390.21 vfmadd213pd {rn-sae}, %zmm13, %zmm10, %zmm4 #2391.21 vfmadd231pd {rn-sae}, %zmm12, %zmm15, %zmm14 #2390.21 vfmadd213pd {rn-sae}, %zmm14, %zmm10, %zmm4 #2392.21 @@ -531,29 +531,29 @@ __svml_pow8_ha_z0: lea 64(%rsp,%rbx,8), %rdi #2397.878 lea 128(%rsp,%rbx,8), %rsi #2397.878 lea 192(%rsp,%rbx,8), %rdx #2397.878 -..___tag_value___svml_pow8_ha_z0.50: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #2397.878 -..___tag_value___svml_pow8_ha_z0.51: +..___tag_value___jsvml_pow8_ha_z0.50: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #2397.878 +..___tag_value___jsvml_pow8_ha_z0.51: jmp ..B2.13 # Prob 100% #2397.878 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_pow8_ha_z0,@function - .size __svml_pow8_ha_z0,.-__svml_pow8_ha_z0 -..LN__svml_pow8_ha_z0.1: + .type __jsvml_pow8_ha_z0,@function + .size __jsvml_pow8_ha_z0,.-__jsvml_pow8_ha_z0 +..LN__jsvml_pow8_ha_z0.1: .data -# -- End __svml_pow8_ha_z0 +# -- End __jsvml_pow8_ha_z0 .text -.L_2__routine_start___svml_pow1_ha_ex_2: -# -- Begin __svml_pow1_ha_ex +.L_2__routine_start___jsvml_pow1_ha_ex_2: +# -- Begin __jsvml_pow1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_pow1_ha_ex -# --- __svml_pow1_ha_ex(__m128d, __m128d) -__svml_pow1_ha_ex: + .globl __jsvml_pow1_ha_ex +# --- __jsvml_pow1_ha_ex(__m128d, __m128d) +__jsvml_pow1_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B3.1: # Preds ..B3.0 @@ -563,7 +563,7 @@ __svml_pow1_ha_ex: .byte 30 #2616.663 .byte 250 #2616.663 .cfi_startproc -..___tag_value___svml_pow1_ha_ex.53: +..___tag_value___jsvml_pow1_ha_ex.53: ..L54: #2405.1 pushq %rbp #2405.1 @@ -581,7 +581,7 @@ __svml_pow1_ha_ex: movl $1094189056, %r11d #2521.23 movdqa %xmm1, %xmm6 #2517.17 movd %esi, %xmm8 #2508.21 - lea __svml_dpow_ha_data_internal(%rip), %rax #2514.25 + lea __jsvml_dpow_ha_data_internal(%rip), %rax #2514.25 pand %xmm1, %xmm8 #2508.21 movd %edi, %xmm11 #2511.21 paddd %xmm11, %xmm8 #2511.21 @@ -594,25 +594,25 @@ __svml_pow1_ha_ex: movd %r11d, %xmm10 #2521.23 movd %xmm13, %r8d #2514.95 pslld $4, %xmm8 #2513.22 - movsd 27520+__svml_dpow_ha_data_internal(%rip), %xmm15 #2503.18 + movsd 27520+__jsvml_dpow_ha_data_internal(%rip), %xmm15 #2503.18 paddd %xmm10, %xmm6 #2521.23 - movsd 27648+__svml_dpow_ha_data_internal(%rip), %xmm9 #2504.19 + movsd 27648+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #2504.19 andps %xmm0, %xmm15 #2503.18 movslq %r8d, %r8 #2514.25 orps %xmm9, %xmm15 #2505.18 - movsd 27712+__svml_dpow_ha_data_internal(%rip), %xmm7 #2523.28 + movsd 27712+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2523.28 movaps %xmm15, %xmm13 #2529.20 movd %xmm8, %r9d #2515.98 movl $2147483647, %edx #2495.31 pshufd $0, %xmm6, %xmm11 #2521.23 - movsd 27840+__svml_dpow_ha_data_internal(%rip), %xmm8 #2527.24 + movsd 27840+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2527.24 andps %xmm7, %xmm11 #2524.17 movsd (%rax,%r8), %xmm14 #2514.25 movaps %xmm8, %xmm9 #2528.20 andps %xmm15, %xmm9 #2528.20 movaps %xmm8, %xmm10 #2560.18 mulsd %xmm14, %xmm15 #2530.18 - subsd 27776+__svml_dpow_ha_data_internal(%rip), %xmm11 #2526.17 + subsd 27776+__jsvml_dpow_ha_data_internal(%rip), %xmm11 #2526.17 subsd %xmm9, %xmm13 #2529.20 mulsd %xmm14, %xmm9 #2533.29 mulsd %xmm14, %xmm13 #2534.29 @@ -631,7 +631,7 @@ __svml_pow1_ha_ex: movl $1048576, %ecx #2498.29 movl $127, %r8d #2581.21 addsd 8256(%rax,%r9), %xmm11 #2535.17 - addsd 27904+__svml_dpow_ha_data_internal(%rip), %xmm12 #2532.18 + addsd 27904+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2532.18 addsd %xmm9, %xmm13 #2534.17 movaps %xmm11, %xmm14 #2536.19 movd %edx, %xmm6 #2568.35 @@ -645,19 +645,19 @@ __svml_pow1_ha_ex: addsd %xmm12, %xmm11 #2538.18 addsd %xmm13, %xmm12 #2544.18 addsd %xmm13, %xmm14 #2541.19 - movsd 26816+__svml_dpow_ha_data_internal(%rip), %xmm13 #2547.32 + movsd 26816+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2547.32 addsd %xmm11, %xmm14 #2542.19 mulsd %xmm12, %xmm13 #2547.32 addsd 8264(%rax,%r9), %xmm14 #2543.19 - addsd 26880+__svml_dpow_ha_data_internal(%rip), %xmm13 #2547.20 + addsd 26880+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2547.20 mulsd %xmm12, %xmm13 #2549.32 - addsd 26944+__svml_dpow_ha_data_internal(%rip), %xmm13 #2549.20 + addsd 26944+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2549.20 mulsd %xmm12, %xmm13 #2551.32 - addsd 27008+__svml_dpow_ha_data_internal(%rip), %xmm13 #2551.20 + addsd 27008+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2551.20 mulsd %xmm12, %xmm13 #2553.32 - addsd 27072+__svml_dpow_ha_data_internal(%rip), %xmm13 #2553.20 + addsd 27072+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2553.20 mulsd %xmm12, %xmm13 #2555.32 - addsd 27136+__svml_dpow_ha_data_internal(%rip), %xmm13 #2555.20 + addsd 27136+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2555.20 mulsd %xmm12, %xmm13 #2556.31 movaps %xmm9, %xmm12 #2557.26 addsd %xmm14, %xmm13 #2556.19 @@ -666,7 +666,7 @@ __svml_pow1_ha_ex: addsd %xmm13, %xmm12 #2557.26 movaps %xmm12, %xmm11 #2558.21 andps %xmm12, %xmm10 #2560.18 - movsd 27968+__svml_dpow_ha_data_internal(%rip), %xmm1 #2588.27 + movsd 27968+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2588.27 subsd %xmm9, %xmm11 #2558.21 subsd %xmm10, %xmm12 #2561.18 subsd %xmm11, %xmm13 #2559.19 @@ -688,7 +688,7 @@ __svml_pow1_ha_ex: addsd %xmm3, %xmm8 #2573.18 pcmpgtd %xmm6, %xmm2 #2569.43 pcmpeqd %xmm6, %xmm7 #2569.89 - movsd 28032+__svml_dpow_ha_data_internal(%rip), %xmm3 #2576.26 + movsd 28032+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #2576.26 por %xmm7, %xmm2 #2569.29 movaps %xmm11, %xmm7 #2577.19 por %xmm5, %xmm14 #2501.33 @@ -715,22 +715,22 @@ __svml_pow1_ha_ex: movaps %xmm9, %xmm10 #2595.18 mulsd %xmm9, %xmm10 #2595.18 andps %xmm1, %xmm5 #2589.17 - movsd 27200+__svml_dpow_ha_data_internal(%rip), %xmm1 #2597.20 + movsd 27200+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2597.20 movaps %xmm10, %xmm11 #2596.18 mulsd %xmm9, %xmm1 #2599.31 mulsd %xmm10, %xmm11 #2596.18 - addsd 27264+__svml_dpow_ha_data_internal(%rip), %xmm1 #2599.19 - movsd 27328+__svml_dpow_ha_data_internal(%rip), %xmm12 #2603.20 + addsd 27264+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2599.19 + movsd 27328+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2603.20 mulsd %xmm9, %xmm12 #2605.31 mulsd %xmm11, %xmm1 #2600.19 - addsd 27392+__svml_dpow_ha_data_internal(%rip), %xmm12 #2605.19 + addsd 27392+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2605.19 movslq %r10d, %r10 #2590.61 mulsd %xmm10, %xmm12 #2606.19 movups 24704(%rax,%r10), %xmm15 #2590.61 mulsd %xmm15, %xmm1 #2601.19 mulsd %xmm15, %xmm12 #2607.19 addsd 24712(%rax,%r10), %xmm1 #2602.19 - movsd 27456+__svml_dpow_ha_data_internal(%rip), %xmm14 #2609.20 + movsd 27456+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #2609.20 addsd %xmm12, %xmm1 #2608.19 mulsd %xmm9, %xmm14 #2610.19 mulsd %xmm15, %xmm14 #2611.19 @@ -768,29 +768,29 @@ __svml_pow1_ha_ex: lea (%rsp), %rdi #2616.663 lea 64(%rsp), %rsi #2616.663 lea 128(%rsp), %rdx #2616.663 -..___tag_value___svml_pow1_ha_ex.62: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #2616.663 -..___tag_value___svml_pow1_ha_ex.63: +..___tag_value___jsvml_pow1_ha_ex.62: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #2616.663 +..___tag_value___jsvml_pow1_ha_ex.63: jmp ..B3.4 # Prob 100% #2616.663 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_pow1_ha_ex,@function - .size __svml_pow1_ha_ex,.-__svml_pow1_ha_ex -..LN__svml_pow1_ha_ex.2: + .type __jsvml_pow1_ha_ex,@function + .size __jsvml_pow1_ha_ex,.-__jsvml_pow1_ha_ex +..LN__jsvml_pow1_ha_ex.2: .data -# -- End __svml_pow1_ha_ex +# -- End __jsvml_pow1_ha_ex .text -.L_2__routine_start___svml_pow2_ha_ex_3: -# -- Begin __svml_pow2_ha_ex +.L_2__routine_start___jsvml_pow2_ha_ex_3: +# -- Begin __jsvml_pow2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_pow2_ha_ex -# --- __svml_pow2_ha_ex(__m128d, __m128d) -__svml_pow2_ha_ex: + .globl __jsvml_pow2_ha_ex +# --- __jsvml_pow2_ha_ex(__m128d, __m128d) +__jsvml_pow2_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B4.1: # Preds ..B4.0 @@ -800,7 +800,7 @@ __svml_pow2_ha_ex: .byte 30 #2835.663 .byte 250 #2835.663 .cfi_startproc -..___tag_value___svml_pow2_ha_ex.65: +..___tag_value___jsvml_pow2_ha_ex.65: ..L66: #2624.1 pushq %rbp #2624.1 @@ -812,9 +812,9 @@ __svml_pow2_ha_ex: subq $256, %rsp #2624.1 movaps %xmm1, %xmm11 #2624.1 pshufd $221, %xmm0, %xmm4 #2710.19 - lea __svml_dpow_ha_data_internal(%rip), %rax #2733.41 - movq 28672+__svml_dpow_ha_data_internal(%rip), %xmm12 #2727.21 - movq 28736+__svml_dpow_ha_data_internal(%rip), %xmm10 #2728.24 + lea __jsvml_dpow_ha_data_internal(%rip), %rax #2733.41 + movq 28672+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #2727.21 + movq 28736+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #2728.24 pand %xmm4, %xmm12 #2727.21 paddd %xmm10, %xmm12 #2730.21 psrld $10, %xmm12 #2730.21 @@ -824,30 +824,30 @@ __svml_pow2_ha_ex: movd %xmm1, %edx #2733.111 pshufd $1, %xmm1, %xmm15 #2733.232 pshufd $1, %xmm12, %xmm1 #2734.279 - movq 28800+__svml_dpow_ha_data_internal(%rip), %xmm8 #2735.24 + movq 28800+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #2735.24 movd %xmm15, %ecx #2733.214 movd %xmm1, %edi #2734.261 movdqa %xmm4, %xmm1 #2736.17 psubd %xmm8, %xmm1 #2736.17 - movq 28864+__svml_dpow_ha_data_internal(%rip), %xmm15 #2738.25 + movq 28864+__jsvml_dpow_ha_data_internal(%rip), %xmm15 #2738.25 psrad $20, %xmm1 #2737.17 movslq %edx, %rdx #2733.41 paddd %xmm15, %xmm1 #2740.23 movslq %ecx, %rcx #2733.144 - movups 27520+__svml_dpow_ha_data_internal(%rip), %xmm9 #2722.18 + movups 27520+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #2722.18 pshufd $80, %xmm1, %xmm15 #2740.23 andps %xmm0, %xmm9 #2722.18 - movups 27840+__svml_dpow_ha_data_internal(%rip), %xmm1 #2746.55 - orps 27648+__svml_dpow_ha_data_internal(%rip), %xmm9 #2724.18 + movups 27840+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2746.55 + orps 27648+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #2724.18 movaps %xmm1, %xmm8 #2747.20 movsd (%rax,%rdx), %xmm14 #2733.41 andps %xmm9, %xmm8 #2747.20 movd %xmm12, %esi #2734.119 movaps %xmm9, %xmm12 #2748.20 movhpd (%rax,%rcx), %xmm14 #2733.25 - andps 27712+__svml_dpow_ha_data_internal(%rip), %xmm15 #2743.17 + andps 27712+__jsvml_dpow_ha_data_internal(%rip), %xmm15 #2743.17 subpd %xmm8, %xmm12 #2748.20 - subpd 27776+__svml_dpow_ha_data_internal(%rip), %xmm15 #2745.17 + subpd 27776+__jsvml_dpow_ha_data_internal(%rip), %xmm15 #2745.17 mulpd %xmm14, %xmm9 #2749.18 mulpd %xmm14, %xmm8 #2752.29 mulpd %xmm12, %xmm14 #2753.29 @@ -860,7 +860,7 @@ __svml_pow2_ha_ex: movaps %xmm10, %xmm7 #2734.353 unpcklpd %xmm13, %xmm7 #2734.353 unpckhpd %xmm13, %xmm10 #2734.400 - movups 27904+__svml_dpow_ha_data_internal(%rip), %xmm13 #2751.18 + movups 27904+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #2751.18 addpd %xmm9, %xmm13 #2751.18 addpd %xmm15, %xmm7 #2754.17 movaps %xmm13, %xmm14 #2755.19 @@ -874,18 +874,18 @@ __svml_pow2_ha_ex: addpd %xmm8, %xmm14 #2760.19 addpd %xmm14, %xmm7 #2761.19 addpd %xmm7, %xmm10 #2762.19 - movups 26816+__svml_dpow_ha_data_internal(%rip), %xmm7 #2766.32 + movups 26816+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2766.32 movaps %xmm9, %xmm8 #2776.26 mulpd %xmm13, %xmm7 #2766.32 - addpd 26880+__svml_dpow_ha_data_internal(%rip), %xmm7 #2766.20 + addpd 26880+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2766.20 mulpd %xmm13, %xmm7 #2768.32 - addpd 26944+__svml_dpow_ha_data_internal(%rip), %xmm7 #2768.20 + addpd 26944+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2768.20 mulpd %xmm13, %xmm7 #2770.32 - addpd 27008+__svml_dpow_ha_data_internal(%rip), %xmm7 #2770.20 + addpd 27008+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2770.20 mulpd %xmm13, %xmm7 #2772.32 - addpd 27072+__svml_dpow_ha_data_internal(%rip), %xmm7 #2772.20 + addpd 27072+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2772.20 mulpd %xmm13, %xmm7 #2774.32 - addpd 27136+__svml_dpow_ha_data_internal(%rip), %xmm7 #2774.20 + addpd 27136+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2774.20 mulpd %xmm7, %xmm13 #2775.31 addpd %xmm13, %xmm10 #2775.19 addpd %xmm10, %xmm8 #2776.26 @@ -906,19 +906,19 @@ __svml_pow2_ha_ex: mulpd %xmm12, %xmm13 #2791.18 mulpd %xmm12, %xmm7 #2793.30 addpd %xmm1, %xmm13 #2792.18 - movq 28352+__svml_dpow_ha_data_internal(%rip), %xmm3 #2712.31 - movq 28480+__svml_dpow_ha_data_internal(%rip), %xmm2 #2714.31 + movq 28352+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #2712.31 + movq 28480+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2714.31 paddd %xmm3, %xmm4 #2717.29 pshufd $221, %xmm11, %xmm6 #2711.19 pshufd $221, %xmm9, %xmm15 #2785.25 pand %xmm2, %xmm6 #2718.29 pand %xmm2, %xmm15 #2786.28 - movq 28416+__svml_dpow_ha_data_internal(%rip), %xmm2 #2717.29 - movq 28544+__svml_dpow_ha_data_internal(%rip), %xmm5 #2715.27 + movq 28416+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2717.29 + movq 28544+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #2715.27 pcmpgtd %xmm4, %xmm2 #2717.29 movdqa %xmm6, %xmm4 #2719.43 pcmpeqd %xmm5, %xmm6 #2719.82 - movq 28608+__svml_dpow_ha_data_internal(%rip), %xmm14 #2787.35 + movq 28608+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #2787.35 pcmpgtd %xmm5, %xmm4 #2719.43 movdqa %xmm15, %xmm5 #2788.43 por %xmm6, %xmm4 #2719.29 @@ -926,7 +926,7 @@ __svml_pow2_ha_ex: pcmpeqd %xmm14, %xmm15 #2788.89 por %xmm4, %xmm2 #2720.33 por %xmm15, %xmm5 #2788.29 - movups 28032+__svml_dpow_ha_data_internal(%rip), %xmm4 #2795.57 + movups 28032+__jsvml_dpow_ha_data_internal(%rip), %xmm4 #2795.57 por %xmm5, %xmm2 #2789.33 movaps %xmm4, %xmm5 #2796.19 addpd %xmm9, %xmm5 #2796.19 @@ -939,27 +939,27 @@ __svml_pow2_ha_ex: addpd %xmm13, %xmm9 #2813.17 movaps %xmm9, %xmm8 #2814.18 mulpd %xmm9, %xmm8 #2814.18 - movups 27200+__svml_dpow_ha_data_internal(%rip), %xmm10 #2818.31 + movups 27200+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #2818.31 movaps %xmm8, %xmm13 #2815.18 mulpd %xmm9, %xmm10 #2818.31 mulpd %xmm8, %xmm13 #2815.18 - addpd 27264+__svml_dpow_ha_data_internal(%rip), %xmm10 #2818.19 - movups 27328+__svml_dpow_ha_data_internal(%rip), %xmm7 #2824.31 + addpd 27264+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #2818.19 + movups 27328+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2824.31 mulpd %xmm9, %xmm7 #2824.31 mulpd %xmm10, %xmm13 #2819.19 - addpd 27392+__svml_dpow_ha_data_internal(%rip), %xmm7 #2824.19 - movq 28992+__svml_dpow_ha_data_internal(%rip), %xmm2 #2800.21 + addpd 27392+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #2824.19 + movq 28992+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2800.21 pand %xmm6, %xmm2 #2800.21 pslld $13, %xmm6 #2802.17 - movq 28928+__svml_dpow_ha_data_internal(%rip), %xmm3 #2803.19 + movq 28928+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #2803.19 pslld $4, %xmm2 #2801.21 movd %xmm2, %r8d #2809.120 paddd %xmm3, %xmm6 #2805.23 pshufd $1, %xmm2, %xmm3 #2809.280 pshufd $80, %xmm6, %xmm1 #2805.23 movd %xmm3, %r9d #2809.262 - movups 27456+__svml_dpow_ha_data_internal(%rip), %xmm14 #2828.51 - andps 27968+__svml_dpow_ha_data_internal(%rip), %xmm1 #2808.17 + movups 27456+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #2828.51 + andps 27968+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #2808.17 movslq %r8d, %r8 #2809.71 movslq %r9d, %r9 #2809.213 mulpd %xmm7, %xmm8 #2825.19 @@ -1035,29 +1035,29 @@ __svml_pow2_ha_ex: lea 64(%rsp,%r12,8), %rdi #2835.663 lea 128(%rsp,%r12,8), %rsi #2835.663 lea 192(%rsp,%r12,8), %rdx #2835.663 -..___tag_value___svml_pow2_ha_ex.83: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #2835.663 -..___tag_value___svml_pow2_ha_ex.84: +..___tag_value___jsvml_pow2_ha_ex.83: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #2835.663 +..___tag_value___jsvml_pow2_ha_ex.84: jmp ..B4.8 # Prob 100% #2835.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_pow2_ha_ex,@function - .size __svml_pow2_ha_ex,.-__svml_pow2_ha_ex -..LN__svml_pow2_ha_ex.3: + .type __jsvml_pow2_ha_ex,@function + .size __jsvml_pow2_ha_ex,.-__jsvml_pow2_ha_ex +..LN__jsvml_pow2_ha_ex.3: .data -# -- End __svml_pow2_ha_ex +# -- End __jsvml_pow2_ha_ex .text -.L_2__routine_start___svml_pow4_ha_e9_4: -# -- Begin __svml_pow4_ha_e9 +.L_2__routine_start___jsvml_pow4_ha_e9_4: +# -- Begin __jsvml_pow4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_pow4_ha_e9 -# --- __svml_pow4_ha_e9(__m256d, __m256d) -__svml_pow4_ha_e9: + .globl __jsvml_pow4_ha_e9 +# --- __jsvml_pow4_ha_e9(__m256d, __m256d) +__jsvml_pow4_ha_e9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B5.1: # Preds ..B5.0 @@ -1067,7 +1067,7 @@ __svml_pow4_ha_e9: .byte 30 #3054.672 .byte 250 #3054.672 .cfi_startproc -..___tag_value___svml_pow4_ha_e9.86: +..___tag_value___jsvml_pow4_ha_e9.86: ..L87: #2843.1 pushq %rbp #2843.1 @@ -1077,19 +1077,19 @@ __svml_pow4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #2843.1 subq $256, %rsp #2843.1 - lea __svml_dpow_ha_data_internal(%rip), %rdx #2952.82 + lea __jsvml_dpow_ha_data_internal(%rip), %rdx #2952.82 vmovapd %ymm1, %ymm6 #2843.1 - vmovups 28480+__svml_dpow_ha_data_internal(%rip), %xmm5 #2933.37 + vmovups 28480+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #2933.37 vextractf128 $1, %ymm0, %xmm3 #2927.109 vshufps $221, %xmm3, %xmm0, %xmm4 #2929.43 - vandps 28672+__svml_dpow_ha_data_internal(%rip), %xmm4, %xmm14 #2946.27 - vpaddd 28736+__svml_dpow_ha_data_internal(%rip), %xmm14, %xmm11 #2949.27 + vandps 28672+__jsvml_dpow_ha_data_internal(%rip), %xmm4, %xmm14 #2946.27 + vpaddd 28736+__jsvml_dpow_ha_data_internal(%rip), %xmm14, %xmm11 #2949.27 vpsrld $10, %xmm11, %xmm15 #2949.27 vpslld $3, %xmm15, %xmm8 #2950.28 vpslld $4, %xmm15, %xmm15 #2951.28 vmovd %xmm8, %eax #2952.152 vmovd %xmm15, %r8d #2953.97 - vmovups 28416+__svml_dpow_ha_data_internal(%rip), %xmm3 #2932.37 + vmovups 28416+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #2932.37 vpextrd $1, %xmm15, %r9d #2953.219 vpextrd $2, %xmm8, %esi #2952.385 movslq %eax, %rax #2952.82 @@ -1104,12 +1104,12 @@ __svml_pow4_ha_e9: movslq %edi, %rdi #2952.423 movslq %r10d, %r10 #2953.296 movslq %r11d, %r11 #2953.421 - vandpd 27520+__svml_dpow_ha_data_internal(%rip), %ymm0, %ymm9 #2941.18 + vandpd 27520+__jsvml_dpow_ha_data_internal(%rip), %ymm0, %ymm9 #2941.18 vmovsd (%rdx,%rax), %xmm12 #2952.82 vmovupd 8256(%rdx,%r8), %xmm14 #2953.49 vmovupd 8256(%rdx,%r9), %xmm11 #2953.171 - vpsubd 28800+__svml_dpow_ha_data_internal(%rip), %xmm4, %xmm8 #2955.23 - vorpd 27648+__svml_dpow_ha_data_internal(%rip), %ymm9, %ymm13 #2943.18 + vpsubd 28800+__jsvml_dpow_ha_data_internal(%rip), %xmm4, %xmm8 #2955.23 + vorpd 27648+__jsvml_dpow_ha_data_internal(%rip), %ymm9, %ymm13 #2943.18 vmovhpd (%rdx,%rcx), %xmm12, %xmm7 #2952.65 vextractf128 $1, %ymm6, %xmm2 #2928.109 vshufps $221, %xmm2, %xmm6, %xmm10 #2930.43 @@ -1117,25 +1117,25 @@ __svml_pow4_ha_e9: vmovsd (%rdx,%rsi), %xmm10 #2952.315 vmovhpd (%rdx,%rdi), %xmm10, %xmm9 #2952.298 vpsrad $20, %xmm8, %xmm10 #2956.23 - vmovups 28544+__svml_dpow_ha_data_internal(%rip), %xmm2 #2934.33 + vmovups 28544+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #2934.33 vinsertf128 $1, 8256(%rdx,%r10), %ymm14, %ymm15 #2953.524 vinsertf128 $1, 8256(%rdx,%r11), %ymm11, %ymm12 #2953.605 vunpcklpd %ymm12, %ymm15, %ymm11 #2953.682 vunpckhpd %ymm12, %ymm15, %ymm12 #2953.728 - vpaddd 28864+__svml_dpow_ha_data_internal(%rip), %xmm10, %xmm15 #2958.23 + vpaddd 28864+__jsvml_dpow_ha_data_internal(%rip), %xmm10, %xmm15 #2958.23 vpshufd $80, %xmm15, %xmm14 #2959.23 vinsertf128 $1, %xmm9, %ymm7, %ymm9 #2952.19 vpshufd $250, %xmm15, %xmm7 #2959.93 - vmovupd 27840+__svml_dpow_ha_data_internal(%rip), %ymm15 #2965.58 + vmovupd 27840+__jsvml_dpow_ha_data_internal(%rip), %ymm15 #2965.58 vinsertf128 $1, %xmm7, %ymm14, %ymm8 #2960.17 vandpd %ymm15, %ymm13, %ymm7 #2966.20 - vandpd 27712+__svml_dpow_ha_data_internal(%rip), %ymm8, %ymm10 #2962.17 + vandpd 27712+__jsvml_dpow_ha_data_internal(%rip), %ymm8, %ymm10 #2962.17 vsubpd %ymm7, %ymm13, %ymm8 #2967.20 - vsubpd 27776+__svml_dpow_ha_data_internal(%rip), %ymm10, %ymm10 #2964.17 + vsubpd 27776+__jsvml_dpow_ha_data_internal(%rip), %ymm10, %ymm10 #2964.17 vmulpd %ymm9, %ymm13, %ymm14 #2968.18 vmulpd %ymm7, %ymm9, %ymm7 #2971.32 vmulpd %ymm8, %ymm9, %ymm9 #2972.32 - vaddpd 27904+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm13 #2970.18 + vaddpd 27904+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm13 #2970.18 vsubpd %ymm14, %ymm7, %ymm14 #2971.17 vaddpd %ymm9, %ymm14, %ymm8 #2972.17 vaddpd %ymm10, %ymm11, %ymm14 #2973.17 @@ -1148,16 +1148,16 @@ __svml_pow4_ha_e9: vaddpd %ymm11, %ymm14, %ymm9 #2980.19 vaddpd %ymm8, %ymm13, %ymm14 #2982.18 vaddpd %ymm9, %ymm12, %ymm12 #2981.19 - vmulpd 26816+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm13 #2985.35 - vaddpd 26880+__svml_dpow_ha_data_internal(%rip), %ymm13, %ymm11 #2985.20 + vmulpd 26816+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm13 #2985.35 + vaddpd 26880+__jsvml_dpow_ha_data_internal(%rip), %ymm13, %ymm11 #2985.20 vmulpd %ymm11, %ymm14, %ymm13 #2987.35 - vaddpd 26944+__svml_dpow_ha_data_internal(%rip), %ymm13, %ymm8 #2987.20 + vaddpd 26944+__jsvml_dpow_ha_data_internal(%rip), %ymm13, %ymm8 #2987.20 vmulpd %ymm8, %ymm14, %ymm9 #2989.35 - vaddpd 27008+__svml_dpow_ha_data_internal(%rip), %ymm9, %ymm10 #2989.20 + vaddpd 27008+__jsvml_dpow_ha_data_internal(%rip), %ymm9, %ymm10 #2989.20 vmulpd %ymm10, %ymm14, %ymm11 #2991.35 - vaddpd 27072+__svml_dpow_ha_data_internal(%rip), %ymm11, %ymm13 #2991.20 + vaddpd 27072+__jsvml_dpow_ha_data_internal(%rip), %ymm11, %ymm13 #2991.20 vmulpd %ymm13, %ymm14, %ymm8 #2993.35 - vaddpd 27136+__svml_dpow_ha_data_internal(%rip), %ymm8, %ymm9 #2993.20 + vaddpd 27136+__jsvml_dpow_ha_data_internal(%rip), %ymm8, %ymm9 #2993.20 vmulpd %ymm9, %ymm14, %ymm14 #2994.34 vaddpd %ymm14, %ymm12, %ymm12 #2994.19 vaddpd %ymm12, %ymm7, %ymm13 #2995.26 @@ -1172,14 +1172,14 @@ __svml_pow4_ha_e9: vextractf128 $1, %ymm15, %xmm12 #3003.117 vshufps $221, %xmm12, %xmm15, %xmm9 #3004.49 vpand %xmm5, %xmm9, %xmm10 #3005.34 - vpaddd 28352+__svml_dpow_ha_data_internal(%rip), %xmm4, %xmm5 #2936.35 + vpaddd 28352+__jsvml_dpow_ha_data_internal(%rip), %xmm4, %xmm5 #2936.35 vpcmpgtd %xmm2, %xmm1, %xmm4 #2938.49 vpcmpgtd %xmm5, %xmm3, %xmm12 #2936.35 vpcmpeqd %xmm2, %xmm1, %xmm3 #2938.100 vpor %xmm3, %xmm4, %xmm1 #2938.35 vpor %xmm1, %xmm12, %xmm4 #2939.39 - vmovupd 28032+__svml_dpow_ha_data_internal(%rip), %ymm12 #3014.60 - vmovups 28608+__svml_dpow_ha_data_internal(%rip), %xmm9 #3006.41 + vmovupd 28032+__jsvml_dpow_ha_data_internal(%rip), %ymm12 #3014.60 + vmovups 28608+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #3006.41 vpcmpgtd %xmm9, %xmm10, %xmm2 #3007.49 vpcmpeqd %xmm9, %xmm10, %xmm5 #3007.107 vpor %xmm5, %xmm2, %xmm9 #3007.35 @@ -1193,11 +1193,11 @@ __svml_pow4_ha_e9: vaddpd %ymm11, %ymm8, %ymm11 #3012.18 vextractf128 $1, %ymm5, %xmm14 #3016.114 vshufps $136, %xmm14, %xmm5, %xmm1 #3017.43 - vandps 28992+__svml_dpow_ha_data_internal(%rip), %xmm1, %xmm7 #3019.27 + vandps 28992+__jsvml_dpow_ha_data_internal(%rip), %xmm1, %xmm7 #3019.27 vpslld $13, %xmm1, %xmm2 #3021.23 vsubpd %ymm12, %ymm5, %ymm5 #3029.19 vpslld $4, %xmm7, %xmm4 #3020.27 - vpaddd 28928+__svml_dpow_ha_data_internal(%rip), %xmm2, %xmm1 #3023.23 + vpaddd 28928+__jsvml_dpow_ha_data_internal(%rip), %xmm2, %xmm1 #3023.23 vpshufd $80, %xmm1, %xmm3 #3024.23 vmovd %xmm4, %ecx #3028.98 vpshufd $250, %xmm1, %xmm14 #3024.93 @@ -1215,20 +1215,20 @@ __svml_pow4_ha_e9: vaddpd %ymm13, %ymm11, %ymm14 #3031.17 vaddpd %ymm14, %ymm15, %ymm14 #3032.17 vmulpd %ymm14, %ymm14, %ymm10 #3033.18 - vandpd 27968+__svml_dpow_ha_data_internal(%rip), %ymm2, %ymm3 #3027.17 + vandpd 27968+__jsvml_dpow_ha_data_internal(%rip), %ymm2, %ymm3 #3027.17 vmulpd %ymm10, %ymm10, %ymm5 #3034.18 vinsertf128 $1, 24704(%rdx,%rdi), %ymm7, %ymm4 #3028.524 vinsertf128 $1, 24704(%rdx,%r8), %ymm8, %ymm9 #3028.605 vunpcklpd %ymm9, %ymm4, %ymm1 #3028.684 vunpckhpd %ymm9, %ymm4, %ymm2 #3028.732 - vmulpd 27200+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm4 #3037.34 - vaddpd 27264+__svml_dpow_ha_data_internal(%rip), %ymm4, %ymm7 #3037.19 + vmulpd 27200+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm4 #3037.34 + vaddpd 27264+__jsvml_dpow_ha_data_internal(%rip), %ymm4, %ymm7 #3037.19 vmulpd %ymm7, %ymm5, %ymm8 #3038.19 vmulpd %ymm8, %ymm1, %ymm9 #3039.19 vaddpd %ymm9, %ymm2, %ymm13 #3040.19 - vmulpd 27328+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm2 #3043.34 - vmulpd 27456+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm14 #3048.19 - vaddpd 27392+__svml_dpow_ha_data_internal(%rip), %ymm2, %ymm11 #3043.19 + vmulpd 27328+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm2 #3043.34 + vmulpd 27456+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm14 #3048.19 + vaddpd 27392+__jsvml_dpow_ha_data_internal(%rip), %ymm2, %ymm11 #3043.19 vmulpd %ymm14, %ymm1, %ymm4 #3049.19 vmulpd %ymm11, %ymm10, %ymm12 #3044.19 vmulpd %ymm12, %ymm1, %ymm15 #3045.19 @@ -1298,29 +1298,29 @@ __svml_pow4_ha_e9: lea 64(%rsp,%r12,8), %rdi #3054.672 lea 128(%rsp,%r12,8), %rsi #3054.672 lea 192(%rsp,%r12,8), %rdx #3054.672 -..___tag_value___svml_pow4_ha_e9.104: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #3054.672 -..___tag_value___svml_pow4_ha_e9.105: +..___tag_value___jsvml_pow4_ha_e9.104: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #3054.672 +..___tag_value___jsvml_pow4_ha_e9.105: jmp ..B5.8 # Prob 100% #3054.672 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_pow4_ha_e9,@function - .size __svml_pow4_ha_e9,.-__svml_pow4_ha_e9 -..LN__svml_pow4_ha_e9.4: + .type __jsvml_pow4_ha_e9,@function + .size __jsvml_pow4_ha_e9,.-__jsvml_pow4_ha_e9 +..LN__jsvml_pow4_ha_e9.4: .data -# -- End __svml_pow4_ha_e9 +# -- End __jsvml_pow4_ha_e9 .text -.L_2__routine_start___svml_pow1_ha_e9_5: -# -- Begin __svml_pow1_ha_e9 +.L_2__routine_start___jsvml_pow1_ha_e9_5: +# -- Begin __jsvml_pow1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_pow1_ha_e9 -# --- __svml_pow1_ha_e9(__m128d, __m128d) -__svml_pow1_ha_e9: + .globl __jsvml_pow1_ha_e9 +# --- __jsvml_pow1_ha_e9(__m128d, __m128d) +__jsvml_pow1_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B6.1: # Preds ..B6.0 @@ -1330,7 +1330,7 @@ __svml_pow1_ha_e9: .byte 30 #3273.663 .byte 250 #3273.663 .cfi_startproc -..___tag_value___svml_pow1_ha_e9.107: +..___tag_value___jsvml_pow1_ha_e9.107: ..L108: #3062.1 pushq %rbp #3062.1 @@ -1348,7 +1348,7 @@ __svml_pow1_ha_e9: movl $1094189056, %r11d #3178.23 movdqa %xmm1, %xmm6 #3174.23 movd %esi, %xmm8 #3165.27 - lea __svml_dpow_ha_data_internal(%rip), %rax #3171.19 + lea __jsvml_dpow_ha_data_internal(%rip), %rax #3171.19 pand %xmm1, %xmm8 #3165.27 movd %edi, %xmm11 #3168.27 paddd %xmm11, %xmm8 #3168.27 @@ -1361,25 +1361,25 @@ __svml_pow1_ha_e9: movd %r11d, %xmm10 #3178.23 movd %xmm13, %r8d #3171.89 pslld $4, %xmm8 #3170.28 - movsd 27520+__svml_dpow_ha_data_internal(%rip), %xmm15 #3160.18 + movsd 27520+__jsvml_dpow_ha_data_internal(%rip), %xmm15 #3160.18 paddd %xmm10, %xmm6 #3178.23 - movsd 27648+__svml_dpow_ha_data_internal(%rip), %xmm9 #3161.19 + movsd 27648+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #3161.19 andps %xmm0, %xmm15 #3160.18 movslq %r8d, %r8 #3171.19 orps %xmm9, %xmm15 #3162.18 - movsd 27712+__svml_dpow_ha_data_internal(%rip), %xmm7 #3180.28 + movsd 27712+__jsvml_dpow_ha_data_internal(%rip), %xmm7 #3180.28 movaps %xmm15, %xmm13 #3186.20 movd %xmm8, %r9d #3172.92 movl $2147483647, %edx #3152.37 pshufd $0, %xmm6, %xmm11 #3178.23 - movsd 27840+__svml_dpow_ha_data_internal(%rip), %xmm8 #3184.24 + movsd 27840+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #3184.24 andps %xmm7, %xmm11 #3181.17 movsd (%rax,%r8), %xmm14 #3171.19 movaps %xmm8, %xmm9 #3185.20 andps %xmm15, %xmm9 #3185.20 movaps %xmm8, %xmm10 #3217.18 mulsd %xmm14, %xmm15 #3187.18 - subsd 27776+__svml_dpow_ha_data_internal(%rip), %xmm11 #3183.17 + subsd 27776+__jsvml_dpow_ha_data_internal(%rip), %xmm11 #3183.17 subsd %xmm9, %xmm13 #3186.20 mulsd %xmm14, %xmm9 #3190.29 mulsd %xmm14, %xmm13 #3191.29 @@ -1398,7 +1398,7 @@ __svml_pow1_ha_e9: movl $1048576, %ecx #3155.35 movl $127, %r8d #3238.27 addsd 8256(%rax,%r9), %xmm11 #3192.17 - addsd 27904+__svml_dpow_ha_data_internal(%rip), %xmm12 #3189.18 + addsd 27904+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3189.18 addsd %xmm9, %xmm13 #3191.17 movaps %xmm11, %xmm14 #3193.19 movd %edx, %xmm6 #3225.41 @@ -1412,19 +1412,19 @@ __svml_pow1_ha_e9: addsd %xmm12, %xmm11 #3195.18 addsd %xmm13, %xmm12 #3201.18 addsd %xmm13, %xmm14 #3198.19 - movsd 26816+__svml_dpow_ha_data_internal(%rip), %xmm13 #3204.32 + movsd 26816+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3204.32 addsd %xmm11, %xmm14 #3199.19 mulsd %xmm12, %xmm13 #3204.32 addsd 8264(%rax,%r9), %xmm14 #3200.19 - addsd 26880+__svml_dpow_ha_data_internal(%rip), %xmm13 #3204.20 + addsd 26880+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3204.20 mulsd %xmm12, %xmm13 #3206.32 - addsd 26944+__svml_dpow_ha_data_internal(%rip), %xmm13 #3206.20 + addsd 26944+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3206.20 mulsd %xmm12, %xmm13 #3208.32 - addsd 27008+__svml_dpow_ha_data_internal(%rip), %xmm13 #3208.20 + addsd 27008+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3208.20 mulsd %xmm12, %xmm13 #3210.32 - addsd 27072+__svml_dpow_ha_data_internal(%rip), %xmm13 #3210.20 + addsd 27072+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3210.20 mulsd %xmm12, %xmm13 #3212.32 - addsd 27136+__svml_dpow_ha_data_internal(%rip), %xmm13 #3212.20 + addsd 27136+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3212.20 mulsd %xmm12, %xmm13 #3213.31 movaps %xmm9, %xmm12 #3214.26 addsd %xmm14, %xmm13 #3213.19 @@ -1433,7 +1433,7 @@ __svml_pow1_ha_e9: addsd %xmm13, %xmm12 #3214.26 movaps %xmm12, %xmm11 #3215.21 andps %xmm12, %xmm10 #3217.18 - movsd 27968+__svml_dpow_ha_data_internal(%rip), %xmm1 #3245.27 + movsd 27968+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #3245.27 subsd %xmm9, %xmm11 #3215.21 subsd %xmm10, %xmm12 #3218.18 subsd %xmm11, %xmm13 #3216.19 @@ -1455,7 +1455,7 @@ __svml_pow1_ha_e9: addsd %xmm3, %xmm8 #3230.18 pcmpgtd %xmm6, %xmm2 #3226.49 pcmpeqd %xmm6, %xmm7 #3226.107 - movsd 28032+__svml_dpow_ha_data_internal(%rip), %xmm3 #3233.26 + movsd 28032+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #3233.26 por %xmm7, %xmm2 #3226.35 movaps %xmm11, %xmm7 #3234.19 por %xmm5, %xmm14 #3158.39 @@ -1482,22 +1482,22 @@ __svml_pow1_ha_e9: movaps %xmm9, %xmm10 #3252.18 mulsd %xmm9, %xmm10 #3252.18 andps %xmm1, %xmm5 #3246.17 - movsd 27200+__svml_dpow_ha_data_internal(%rip), %xmm1 #3254.20 + movsd 27200+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #3254.20 movaps %xmm10, %xmm11 #3253.18 mulsd %xmm9, %xmm1 #3256.31 mulsd %xmm10, %xmm11 #3253.18 - addsd 27264+__svml_dpow_ha_data_internal(%rip), %xmm1 #3256.19 - movsd 27328+__svml_dpow_ha_data_internal(%rip), %xmm12 #3260.20 + addsd 27264+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #3256.19 + movsd 27328+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3260.20 mulsd %xmm9, %xmm12 #3262.31 mulsd %xmm11, %xmm1 #3257.19 - addsd 27392+__svml_dpow_ha_data_internal(%rip), %xmm12 #3262.19 + addsd 27392+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3262.19 movslq %r10d, %r10 #3247.55 mulsd %xmm10, %xmm12 #3263.19 movups 24704(%rax,%r10), %xmm15 #3247.55 mulsd %xmm15, %xmm1 #3258.19 mulsd %xmm15, %xmm12 #3264.19 addsd 24712(%rax,%r10), %xmm1 #3259.19 - movsd 27456+__svml_dpow_ha_data_internal(%rip), %xmm14 #3266.20 + movsd 27456+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #3266.20 addsd %xmm12, %xmm1 #3265.19 mulsd %xmm9, %xmm14 #3267.19 mulsd %xmm15, %xmm14 #3268.19 @@ -1535,29 +1535,29 @@ __svml_pow1_ha_e9: lea (%rsp), %rdi #3273.663 lea 64(%rsp), %rsi #3273.663 lea 128(%rsp), %rdx #3273.663 -..___tag_value___svml_pow1_ha_e9.116: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #3273.663 -..___tag_value___svml_pow1_ha_e9.117: +..___tag_value___jsvml_pow1_ha_e9.116: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #3273.663 +..___tag_value___jsvml_pow1_ha_e9.117: jmp ..B6.4 # Prob 100% #3273.663 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_pow1_ha_e9,@function - .size __svml_pow1_ha_e9,.-__svml_pow1_ha_e9 -..LN__svml_pow1_ha_e9.5: + .type __jsvml_pow1_ha_e9,@function + .size __jsvml_pow1_ha_e9,.-__jsvml_pow1_ha_e9 +..LN__jsvml_pow1_ha_e9.5: .data -# -- End __svml_pow1_ha_e9 +# -- End __jsvml_pow1_ha_e9 .text -.L_2__routine_start___svml_pow4_ha_l9_6: -# -- Begin __svml_pow4_ha_l9 +.L_2__routine_start___jsvml_pow4_ha_l9_6: +# -- Begin __jsvml_pow4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_pow4_ha_l9 -# --- __svml_pow4_ha_l9(__m256d, __m256d) -__svml_pow4_ha_l9: + .globl __jsvml_pow4_ha_l9 +# --- __jsvml_pow4_ha_l9(__m256d, __m256d) +__jsvml_pow4_ha_l9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B7.1: # Preds ..B7.0 @@ -1567,7 +1567,7 @@ __svml_pow4_ha_l9: .byte 30 #3492.672 .byte 250 #3492.672 .cfi_startproc -..___tag_value___svml_pow4_ha_l9.119: +..___tag_value___jsvml_pow4_ha_l9.119: ..L120: #3281.1 pushq %rbp #3281.1 @@ -1577,17 +1577,17 @@ __svml_pow4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #3281.1 subq $256, %rsp #3281.1 - lea __svml_dpow_ha_data_internal(%rip), %rdx #3390.82 + lea __jsvml_dpow_ha_data_internal(%rip), %rdx #3390.82 vmovapd %ymm1, %ymm12 #3281.1 - vmovups 28416+__svml_dpow_ha_data_internal(%rip), %xmm6 #3370.33 - vmovups 28544+__svml_dpow_ha_data_internal(%rip), %xmm8 #3372.29 + vmovups 28416+__jsvml_dpow_ha_data_internal(%rip), %xmm6 #3370.33 + vmovups 28544+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #3372.29 vextractf128 $1, %ymm0, %xmm7 #3367.128 vshufps $221, %xmm7, %xmm0, %xmm7 #3367.39 - vandps 28672+__svml_dpow_ha_data_internal(%rip), %xmm7, %xmm4 #3384.23 - vpaddd 28736+__svml_dpow_ha_data_internal(%rip), %xmm4, %xmm2 #3387.23 - vandpd 27520+__svml_dpow_ha_data_internal(%rip), %ymm0, %ymm11 #3379.18 + vandps 28672+__jsvml_dpow_ha_data_internal(%rip), %xmm7, %xmm4 #3384.23 + vpaddd 28736+__jsvml_dpow_ha_data_internal(%rip), %xmm4, %xmm2 #3387.23 + vandpd 27520+__jsvml_dpow_ha_data_internal(%rip), %ymm0, %ymm11 #3379.18 vpsrld $10, %xmm2, %xmm3 #3387.23 - vorpd 27648+__svml_dpow_ha_data_internal(%rip), %ymm11, %ymm14 #3381.18 + vorpd 27648+__jsvml_dpow_ha_data_internal(%rip), %ymm11, %ymm14 #3381.18 vpslld $3, %xmm3, %xmm11 #3388.24 vmovd %xmm11, %eax #3390.152 vpslld $4, %xmm3, %xmm10 #3389.24 @@ -1617,19 +1617,19 @@ __svml_pow4_ha_l9: vinsertf128 $1, %xmm2, %ymm13, %ymm1 #3390.19 vunpcklpd %ymm15, %ymm10, %ymm13 #3391.682 vunpckhpd %ymm15, %ymm10, %ymm2 #3391.728 - vpsubd 28800+__svml_dpow_ha_data_internal(%rip), %xmm7, %xmm10 #3393.19 + vpsubd 28800+__jsvml_dpow_ha_data_internal(%rip), %xmm7, %xmm10 #3393.19 vpsrad $20, %xmm10, %xmm11 #3394.19 - vpaddd 28864+__svml_dpow_ha_data_internal(%rip), %xmm11, %xmm3 #3396.19 + vpaddd 28864+__jsvml_dpow_ha_data_internal(%rip), %xmm11, %xmm3 #3396.19 vpshufd $80, %xmm3, %xmm4 #3397.72 vpshufd $250, %xmm3, %xmm15 #3397.126 vinsertf128 $1, %xmm15, %ymm4, %ymm10 #3397.23 - vmovupd 27840+__svml_dpow_ha_data_internal(%rip), %ymm4 #3403.58 - vandpd 27712+__svml_dpow_ha_data_internal(%rip), %ymm10, %ymm11 #3400.17 + vmovupd 27840+__jsvml_dpow_ha_data_internal(%rip), %ymm4 #3403.58 + vandpd 27712+__jsvml_dpow_ha_data_internal(%rip), %ymm10, %ymm11 #3400.17 vmulpd %ymm1, %ymm14, %ymm10 #3406.18 - vsubpd 27776+__svml_dpow_ha_data_internal(%rip), %ymm11, %ymm11 #3402.17 + vsubpd 27776+__jsvml_dpow_ha_data_internal(%rip), %ymm11, %ymm11 #3402.17 vandpd %ymm4, %ymm14, %ymm15 #3404.20 vsubpd %ymm15, %ymm14, %ymm3 #3405.20 - vaddpd 27904+__svml_dpow_ha_data_internal(%rip), %ymm10, %ymm14 #3408.18 + vaddpd 27904+__jsvml_dpow_ha_data_internal(%rip), %ymm10, %ymm14 #3408.18 vfmsub213pd %ymm10, %ymm1, %ymm15 #3409.17 vfmadd213pd %ymm15, %ymm1, %ymm3 #3410.17 vaddpd %ymm11, %ymm13, %ymm1 #3411.17 @@ -1641,31 +1641,31 @@ __svml_pow4_ha_l9: vaddpd %ymm3, %ymm14, %ymm14 #3420.18 vaddpd %ymm11, %ymm3, %ymm15 #3417.19 vaddpd %ymm15, %ymm1, %ymm13 #3418.19 - vmovupd 26816+__svml_dpow_ha_data_internal(%rip), %ymm15 #3421.54 + vmovupd 26816+__jsvml_dpow_ha_data_internal(%rip), %ymm15 #3421.54 vaddpd %ymm13, %ymm2, %ymm2 #3419.19 - vfmadd213pd 26880+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3423.20 - vfmadd213pd 26944+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3425.20 - vfmadd213pd 27008+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3427.20 - vfmadd213pd 27072+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3429.20 - vfmadd213pd 27136+__svml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3431.20 + vfmadd213pd 26880+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3423.20 + vfmadd213pd 26944+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3425.20 + vfmadd213pd 27008+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3427.20 + vfmadd213pd 27072+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3429.20 + vfmadd213pd 27136+__jsvml_dpow_ha_data_internal(%rip), %ymm14, %ymm15 #3431.20 vfmadd213pd %ymm2, %ymm14, %ymm15 #3432.19 vaddpd %ymm15, %ymm10, %ymm13 #3433.26 vandpd %ymm4, %ymm13, %ymm1 #3436.18 vsubpd %ymm10, %ymm13, %ymm14 #3434.21 vsubpd %ymm1, %ymm13, %ymm3 #3437.18 - vmovups 28608+__svml_dpow_ha_data_internal(%rip), %xmm13 #3444.37 + vmovups 28608+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3444.37 vsubpd %ymm14, %ymm15, %ymm2 #3435.19 vandpd %ymm4, %ymm12, %ymm4 #3438.19 vmulpd %ymm4, %ymm1, %ymm11 #3440.18 vextractf128 $1, %ymm12, %xmm5 #3368.128 vsubpd %ymm4, %ymm12, %ymm10 #3439.19 vshufps $221, %xmm5, %xmm12, %xmm9 #3368.39 - vmovups 28480+__svml_dpow_ha_data_internal(%rip), %xmm5 #3371.33 + vmovups 28480+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #3371.33 vpand %xmm5, %xmm9, %xmm9 #3375.31 vextractf128 $1, %ymm11, %xmm15 #3442.134 vshufps $221, %xmm15, %xmm11, %xmm14 #3442.45 vpand %xmm5, %xmm14, %xmm15 #3443.30 - vpaddd 28352+__svml_dpow_ha_data_internal(%rip), %xmm7, %xmm5 #3374.31 + vpaddd 28352+__jsvml_dpow_ha_data_internal(%rip), %xmm7, %xmm5 #3374.31 vpcmpgtd %xmm5, %xmm6, %xmm7 #3374.31 vpcmpgtd %xmm8, %xmm9, %xmm6 #3376.45 vpcmpeqd %xmm8, %xmm9, %xmm8 #3376.88 @@ -1677,7 +1677,7 @@ __svml_pow4_ha_l9: vpor %xmm15, %xmm9, %xmm13 #3445.31 vpor %xmm13, %xmm6, %xmm8 #3446.35 vmovmskps %xmm8, %eax #3447.56 - vmovupd 28032+__svml_dpow_ha_data_internal(%rip), %ymm6 #3452.60 + vmovupd 28032+__jsvml_dpow_ha_data_internal(%rip), %ymm6 #3452.60 vfmadd213pd %ymm5, %ymm3, %ymm4 #3449.18 vmulpd %ymm2, %ymm12, %ymm9 #3451.19 vaddpd %ymm11, %ymm6, %ymm8 #3453.19 @@ -1686,12 +1686,12 @@ __svml_pow4_ha_l9: vextractf128 $1, %ymm8, %xmm1 #3455.130 vsubpd %ymm6, %ymm8, %ymm6 #3467.19 vshufps $136, %xmm1, %xmm8, %xmm3 #3455.39 - vandps 28992+__svml_dpow_ha_data_internal(%rip), %xmm3, %xmm2 #3457.23 + vandps 28992+__jsvml_dpow_ha_data_internal(%rip), %xmm3, %xmm2 #3457.23 vpslld $13, %xmm3, %xmm4 #3459.19 vpslld $4, %xmm2, %xmm14 #3458.23 vmovd %xmm14, %ecx #3466.98 vsubpd %ymm6, %ymm11, %ymm11 #3468.19 - vpaddd 28928+__svml_dpow_ha_data_internal(%rip), %xmm4, %xmm15 #3461.19 + vpaddd 28928+__jsvml_dpow_ha_data_internal(%rip), %xmm4, %xmm15 #3461.19 vpshufd $80, %xmm15, %xmm7 #3462.72 vpextrd $1, %xmm14, %esi #3466.220 movslq %ecx, %rcx #3466.49 @@ -1704,23 +1704,23 @@ __svml_pow4_ha_l9: vmovupd 24704(%rdx,%rcx), %xmm2 #3466.49 vmovupd 24704(%rdx,%rsi), %xmm3 #3466.171 vpshufd $250, %xmm15, %xmm13 #3462.126 - vmulpd 27456+__svml_dpow_ha_data_internal(%rip), %ymm9, %ymm10 #3486.19 + vmulpd 27456+__jsvml_dpow_ha_data_internal(%rip), %ymm9, %ymm10 #3486.19 vinsertf128 $1, 24704(%rdx,%rdi), %ymm2, %ymm4 #3466.524 vinsertf128 $1, 24704(%rdx,%r8), %ymm3, %ymm5 #3466.605 vunpcklpd %ymm5, %ymm4, %ymm14 #3466.684 - vmovupd 27200+__svml_dpow_ha_data_internal(%rip), %ymm2 #3473.54 - vfmadd213pd 27264+__svml_dpow_ha_data_internal(%rip), %ymm9, %ymm2 #3475.19 + vmovupd 27200+__jsvml_dpow_ha_data_internal(%rip), %ymm2 #3473.54 + vfmadd213pd 27264+__jsvml_dpow_ha_data_internal(%rip), %ymm9, %ymm2 #3475.19 vinsertf128 $1, %xmm13, %ymm7, %ymm1 #3462.23 vunpckhpd %ymm5, %ymm4, %ymm13 #3466.732 vmulpd %ymm9, %ymm9, %ymm5 #3471.18 - vandpd 27968+__svml_dpow_ha_data_internal(%rip), %ymm1, %ymm15 #3465.17 + vandpd 27968+__jsvml_dpow_ha_data_internal(%rip), %ymm1, %ymm15 #3465.17 vmulpd %ymm5, %ymm5, %ymm1 #3472.18 vmulpd %ymm2, %ymm1, %ymm3 #3476.19 vmulpd %ymm10, %ymm14, %ymm1 #3487.19 vmulpd %ymm3, %ymm14, %ymm4 #3477.19 vaddpd %ymm4, %ymm13, %ymm7 #3478.19 - vmovupd 27328+__svml_dpow_ha_data_internal(%rip), %ymm13 #3479.54 - vfmadd213pd 27392+__svml_dpow_ha_data_internal(%rip), %ymm9, %ymm13 #3481.19 + vmovupd 27328+__jsvml_dpow_ha_data_internal(%rip), %ymm13 #3479.54 + vfmadd213pd 27392+__jsvml_dpow_ha_data_internal(%rip), %ymm9, %ymm13 #3481.19 vmulpd %ymm13, %ymm5, %ymm6 #3482.19 vmulpd %ymm6, %ymm14, %ymm8 #3483.19 vaddpd %ymm8, %ymm7, %ymm11 #3484.19 @@ -1789,29 +1789,29 @@ __svml_pow4_ha_l9: lea 64(%rsp,%r12,8), %rdi #3492.672 lea 128(%rsp,%r12,8), %rsi #3492.672 lea 192(%rsp,%r12,8), %rdx #3492.672 -..___tag_value___svml_pow4_ha_l9.137: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #3492.672 -..___tag_value___svml_pow4_ha_l9.138: +..___tag_value___jsvml_pow4_ha_l9.137: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #3492.672 +..___tag_value___jsvml_pow4_ha_l9.138: jmp ..B7.8 # Prob 100% #3492.672 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_pow4_ha_l9,@function - .size __svml_pow4_ha_l9,.-__svml_pow4_ha_l9 -..LN__svml_pow4_ha_l9.6: + .type __jsvml_pow4_ha_l9,@function + .size __jsvml_pow4_ha_l9,.-__jsvml_pow4_ha_l9 +..LN__jsvml_pow4_ha_l9.6: .data -# -- End __svml_pow4_ha_l9 +# -- End __jsvml_pow4_ha_l9 .text -.L_2__routine_start___svml_pow2_ha_l9_7: -# -- Begin __svml_pow2_ha_l9 +.L_2__routine_start___jsvml_pow2_ha_l9_7: +# -- Begin __jsvml_pow2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_pow2_ha_l9 -# --- __svml_pow2_ha_l9(__m128d, __m128d) -__svml_pow2_ha_l9: + .globl __jsvml_pow2_ha_l9 +# --- __jsvml_pow2_ha_l9(__m128d, __m128d) +__jsvml_pow2_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B8.1: # Preds ..B8.0 @@ -1821,7 +1821,7 @@ __svml_pow2_ha_l9: .byte 30 #3711.663 .byte 250 #3711.663 .cfi_startproc -..___tag_value___svml_pow2_ha_l9.140: +..___tag_value___jsvml_pow2_ha_l9.140: ..L141: #3500.1 pushq %rbp #3500.1 @@ -1833,19 +1833,19 @@ __svml_pow2_ha_l9: subq $256, %rsp #3500.1 vmovapd %xmm1, %xmm11 #3500.1 vpshufd $221, %xmm0, %xmm6 #3586.21 - lea __svml_dpow_ha_data_internal(%rip), %rax #3609.36 - vmovq 28672+__svml_dpow_ha_data_internal(%rip), %xmm13 #3602.27 - vmovq 28736+__svml_dpow_ha_data_internal(%rip), %xmm9 #3604.26 + lea __jsvml_dpow_ha_data_internal(%rip), %rax #3609.36 + vmovq 28672+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3602.27 + vmovq 28736+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #3604.26 vpand %xmm13, %xmm6, %xmm12 #3603.23 vpaddd %xmm9, %xmm12, %xmm10 #3606.23 vpsrld $10, %xmm10, %xmm2 #3606.23 - vandpd 27520+__svml_dpow_ha_data_internal(%rip), %xmm0, %xmm14 #3598.18 + vandpd 27520+__jsvml_dpow_ha_data_internal(%rip), %xmm0, %xmm14 #3598.18 vpslld $3, %xmm2, %xmm1 #3607.24 - vorpd 27648+__svml_dpow_ha_data_internal(%rip), %xmm14, %xmm15 #3600.18 + vorpd 27648+__jsvml_dpow_ha_data_internal(%rip), %xmm14, %xmm15 #3600.18 vpslld $4, %xmm2, %xmm14 #3608.24 vmovd %xmm1, %edx #3609.106 vmovd %xmm14, %esi #3610.119 - vmovq 28480+__svml_dpow_ha_data_internal(%rip), %xmm4 #3590.33 + vmovq 28480+__jsvml_dpow_ha_data_internal(%rip), %xmm4 #3590.33 vpshufd $221, %xmm11, %xmm3 #3587.21 movslq %edx, %rdx #3609.36 vpand %xmm4, %xmm3, %xmm7 #3594.31 @@ -1855,7 +1855,7 @@ __svml_pow2_ha_l9: movslq %esi, %rsi #3610.71 movslq %edi, %rdi #3610.215 vmovsd (%rax,%rdx), %xmm3 #3609.36 - vmovq 28800+__svml_dpow_ha_data_internal(%rip), %xmm2 #3611.26 + vmovq 28800+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #3611.26 vmovhpd (%rax,%rcx), %xmm3, %xmm9 #3609.19 vpsubd %xmm2, %xmm6, %xmm3 #3612.19 vmovupd 8256(%rax,%rsi), %xmm13 #3610.71 @@ -1863,21 +1863,21 @@ __svml_pow2_ha_l9: vmovupd 8256(%rax,%rdi), %xmm10 #3610.215 vunpcklpd %xmm10, %xmm13, %xmm12 #3610.314 vunpckhpd %xmm10, %xmm13, %xmm1 #3610.355 - vmovq 28864+__svml_dpow_ha_data_internal(%rip), %xmm13 #3614.27 + vmovq 28864+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3614.27 vpaddd %xmm13, %xmm14, %xmm10 #3616.23 vpshufd $80, %xmm10, %xmm2 #3616.23 - vandpd 27712+__svml_dpow_ha_data_internal(%rip), %xmm2, %xmm3 #3619.17 - vsubpd 27776+__svml_dpow_ha_data_internal(%rip), %xmm3, %xmm10 #3621.17 - vmovupd 27840+__svml_dpow_ha_data_internal(%rip), %xmm3 #3622.55 + vandpd 27712+__jsvml_dpow_ha_data_internal(%rip), %xmm2, %xmm3 #3619.17 + vsubpd 27776+__jsvml_dpow_ha_data_internal(%rip), %xmm3, %xmm10 #3621.17 + vmovupd 27840+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #3622.55 vandpd %xmm3, %xmm15, %xmm14 #3623.20 vsubpd %xmm14, %xmm15, %xmm2 #3624.20 vaddpd %xmm10, %xmm12, %xmm12 #3630.17 vmulpd %xmm9, %xmm15, %xmm15 #3625.18 - vaddpd 27904+__svml_dpow_ha_data_internal(%rip), %xmm15, %xmm13 #3627.18 + vaddpd 27904+__jsvml_dpow_ha_data_internal(%rip), %xmm15, %xmm13 #3627.18 vfmsub213pd %xmm15, %xmm9, %xmm14 #3628.17 - vmovq 28352+__svml_dpow_ha_data_internal(%rip), %xmm5 #3588.33 + vmovq 28352+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #3588.33 vfmadd213pd %xmm14, %xmm9, %xmm2 #3629.17 - vmovq 28416+__svml_dpow_ha_data_internal(%rip), %xmm8 #3589.33 + vmovq 28416+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #3589.33 vaddpd %xmm12, %xmm13, %xmm14 #3631.19 vsubpd %xmm14, %xmm12, %xmm9 #3632.18 vaddpd %xmm9, %xmm13, %xmm15 #3633.18 @@ -1885,17 +1885,17 @@ __svml_pow2_ha_l9: vaddpd %xmm2, %xmm13, %xmm13 #3639.18 vsubpd %xmm9, %xmm14, %xmm12 #3635.19 vaddpd %xmm12, %xmm2, %xmm10 #3636.19 - vmovupd 26816+__svml_dpow_ha_data_internal(%rip), %xmm2 #3640.51 + vmovupd 26816+__jsvml_dpow_ha_data_internal(%rip), %xmm2 #3640.51 vandpd %xmm3, %xmm11, %xmm12 #3657.19 - vfmadd213pd 26880+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3642.20 + vfmadd213pd 26880+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3642.20 vaddpd %xmm10, %xmm15, %xmm14 #3637.19 - vfmadd213pd 26944+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3644.20 + vfmadd213pd 26944+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3644.20 vaddpd %xmm14, %xmm1, %xmm1 #3638.19 - vfmadd213pd 27008+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3646.20 - vfmadd213pd 27072+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3648.20 - vfmadd213pd 27136+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3650.20 + vfmadd213pd 27008+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3646.20 + vfmadd213pd 27072+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3648.20 + vfmadd213pd 27136+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm2 #3650.20 vfmadd213pd %xmm1, %xmm13, %xmm2 #3651.19 - vmovq 28608+__svml_dpow_ha_data_internal(%rip), %xmm13 #3663.37 + vmovq 28608+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3663.37 vaddpd %xmm2, %xmm9, %xmm14 #3652.26 vandpd %xmm3, %xmm14, %xmm1 #3655.18 vmulpd %xmm12, %xmm1, %xmm10 #3659.18 @@ -1911,12 +1911,12 @@ __svml_pow2_ha_l9: vpcmpeqd %xmm13, %xmm14, %xmm14 #3664.95 vpor %xmm14, %xmm4, %xmm13 #3664.31 vmulpd %xmm9, %xmm15, %xmm14 #3667.18 - vmovq 28544+__svml_dpow_ha_data_internal(%rip), %xmm5 #3595.45 + vmovq 28544+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #3595.45 vpcmpgtd %xmm5, %xmm7, %xmm6 #3595.45 vpcmpeqd %xmm5, %xmm7, %xmm7 #3595.88 vpor %xmm7, %xmm6, %xmm3 #3595.31 vpor %xmm3, %xmm8, %xmm5 #3596.35 - vmovupd 28032+__svml_dpow_ha_data_internal(%rip), %xmm8 #3671.57 + vmovupd 28032+__jsvml_dpow_ha_data_internal(%rip), %xmm8 #3671.57 vpor %xmm13, %xmm5, %xmm6 #3665.35 vaddpd %xmm10, %xmm8, %xmm7 #3672.19 vfmadd213pd %xmm14, %xmm15, %xmm12 #3668.18 @@ -1925,36 +1925,36 @@ __svml_pow2_ha_l9: vfmadd213pd %xmm12, %xmm1, %xmm9 #3669.18 vmovmskps %xmm6, %edx #3666.56 vpshufd $136, %xmm7, %xmm2 #3674.21 - vmovq 28992+__svml_dpow_ha_data_internal(%rip), %xmm12 #3675.27 + vmovq 28992+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3675.27 vpslld $13, %xmm2, %xmm14 #3678.19 vsubpd %xmm5, %xmm10, %xmm10 #3687.19 vaddpd %xmm15, %xmm9, %xmm9 #3688.17 vpand %xmm12, %xmm2, %xmm1 #3676.23 vpslld $4, %xmm1, %xmm1 #3677.23 vmovd %xmm1, %r8d #3685.120 - vmovq 28928+__svml_dpow_ha_data_internal(%rip), %xmm13 #3679.21 + vmovq 28928+__jsvml_dpow_ha_data_internal(%rip), %xmm13 #3679.21 vpaddd %xmm13, %xmm14, %xmm12 #3681.23 vpextrd $1, %xmm1, %r9d #3685.264 vaddpd %xmm9, %xmm10, %xmm7 #3689.17 movslq %r8d, %r8 #3685.71 movslq %r9d, %r9 #3685.215 vpshufd $80, %xmm12, %xmm2 #3681.23 - vmovupd 27200+__svml_dpow_ha_data_internal(%rip), %xmm1 #3692.51 + vmovupd 27200+__jsvml_dpow_ha_data_internal(%rip), %xmm1 #3692.51 vmovupd 24704(%rax,%r8), %xmm3 #3685.71 vmovupd 24704(%rax,%r9), %xmm4 #3685.215 vunpcklpd %xmm4, %xmm3, %xmm13 #3685.316 vunpckhpd %xmm4, %xmm3, %xmm12 #3685.359 vmulpd %xmm7, %xmm7, %xmm3 #3690.18 - vfmadd213pd 27264+__svml_dpow_ha_data_internal(%rip), %xmm7, %xmm1 #3694.19 - vandpd 27968+__svml_dpow_ha_data_internal(%rip), %xmm2, %xmm14 #3684.17 + vfmadd213pd 27264+__jsvml_dpow_ha_data_internal(%rip), %xmm7, %xmm1 #3694.19 + vandpd 27968+__jsvml_dpow_ha_data_internal(%rip), %xmm2, %xmm14 #3684.17 vmulpd %xmm3, %xmm3, %xmm15 #3691.18 - vmulpd 27456+__svml_dpow_ha_data_internal(%rip), %xmm7, %xmm8 #3705.19 + vmulpd 27456+__jsvml_dpow_ha_data_internal(%rip), %xmm7, %xmm8 #3705.19 vmulpd %xmm1, %xmm15, %xmm15 #3695.19 vmulpd %xmm8, %xmm13, %xmm10 #3706.19 vmulpd %xmm15, %xmm13, %xmm2 #3696.19 vaddpd %xmm2, %xmm12, %xmm5 #3697.19 - vmovupd 27328+__svml_dpow_ha_data_internal(%rip), %xmm12 #3698.51 - vfmadd213pd 27392+__svml_dpow_ha_data_internal(%rip), %xmm7, %xmm12 #3700.19 + vmovupd 27328+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3698.51 + vfmadd213pd 27392+__jsvml_dpow_ha_data_internal(%rip), %xmm7, %xmm12 #3700.19 vmulpd %xmm12, %xmm3, %xmm4 #3701.19 vmulpd %xmm4, %xmm13, %xmm6 #3702.19 vaddpd %xmm6, %xmm5, %xmm9 #3703.19 @@ -2019,29 +2019,29 @@ __svml_pow2_ha_l9: lea 64(%rsp,%r12,8), %rdi #3711.663 lea 128(%rsp,%r12,8), %rsi #3711.663 lea 192(%rsp,%r12,8), %rdx #3711.663 -..___tag_value___svml_pow2_ha_l9.158: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #3711.663 -..___tag_value___svml_pow2_ha_l9.159: +..___tag_value___jsvml_pow2_ha_l9.158: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #3711.663 +..___tag_value___jsvml_pow2_ha_l9.159: jmp ..B8.8 # Prob 100% #3711.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_pow2_ha_l9,@function - .size __svml_pow2_ha_l9,.-__svml_pow2_ha_l9 -..LN__svml_pow2_ha_l9.7: + .type __jsvml_pow2_ha_l9,@function + .size __jsvml_pow2_ha_l9,.-__jsvml_pow2_ha_l9 +..LN__jsvml_pow2_ha_l9.7: .data -# -- End __svml_pow2_ha_l9 +# -- End __jsvml_pow2_ha_l9 .text -.L_2__routine_start___svml_pow1_ha_l9_8: -# -- Begin __svml_pow1_ha_l9 +.L_2__routine_start___jsvml_pow1_ha_l9_8: +# -- Begin __jsvml_pow1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_pow1_ha_l9 -# --- __svml_pow1_ha_l9(__m128d, __m128d) -__svml_pow1_ha_l9: + .globl __jsvml_pow1_ha_l9 +# --- __jsvml_pow1_ha_l9(__m128d, __m128d) +__jsvml_pow1_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B9.1: # Preds ..B9.0 @@ -2051,7 +2051,7 @@ __svml_pow1_ha_l9: .byte 30 #3930.663 .byte 250 #3930.663 .cfi_startproc -..___tag_value___svml_pow1_ha_l9.161: +..___tag_value___jsvml_pow1_ha_l9.161: ..L162: #3719.1 pushq %rbp #3719.1 @@ -2076,9 +2076,9 @@ __svml_pow1_ha_l9: vpaddd %xmm12, %xmm6, %xmm10 #3825.23 vpand %xmm1, %xmm14, %xmm2 #3813.31 vpsrld $10, %xmm10, %xmm14 #3825.23 - vmovsd 27520+__svml_dpow_ha_data_internal(%rip), %xmm9 #3816.28 + vmovsd 27520+__jsvml_dpow_ha_data_internal(%rip), %xmm9 #3816.28 vpslld $3, %xmm14, %xmm15 #3826.24 - vmovsd 27648+__svml_dpow_ha_data_internal(%rip), %xmm5 #3818.19 + vmovsd 27648+__jsvml_dpow_ha_data_internal(%rip), %xmm5 #3818.19 vandpd %xmm9, %xmm0, %xmm8 #3817.18 vmovd %xmm15, %r8d #3828.89 vorpd %xmm5, %xmm8, %xmm13 #3819.18 @@ -2087,29 +2087,29 @@ __svml_pow1_ha_l9: vpsubd %xmm8, %xmm4, %xmm5 #3831.19 vpslld $4, %xmm14, %xmm9 #3827.24 movslq %r8d, %r8 #3828.19 - lea __svml_dpow_ha_data_internal(%rip), %rax #3828.19 + lea __jsvml_dpow_ha_data_internal(%rip), %rax #3828.19 vpsrad $20, %xmm5, %xmm11 #3832.19 movl $2139095040, %ecx #3810.29 vpaddd %xmm6, %xmm11, %xmm12 #3835.23 movl $2097152, %esi #3812.31 - vmovsd 27712+__svml_dpow_ha_data_internal(%rip), %xmm14 #3837.28 + vmovsd 27712+__jsvml_dpow_ha_data_internal(%rip), %xmm14 #3837.28 movl $1083129855, %edx #3882.37 vpshufd $0, %xmm12, %xmm10 #3835.23 movl $1072693248, %edi #3900.23 - vmovsd 27840+__svml_dpow_ha_data_internal(%rip), %xmm12 #3841.24 + vmovsd 27840+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3841.24 vmovd %ecx, %xmm3 #3810.29 vmovd %xmm9, %r9d #3829.92 vandpd %xmm14, %xmm10, %xmm9 #3838.17 vmovsd (%rax,%r8), %xmm15 #3828.19 vandpd %xmm12, %xmm13, %xmm8 #3842.20 - vsubsd 27776+__svml_dpow_ha_data_internal(%rip), %xmm9, %xmm5 #3840.17 + vsubsd 27776+__jsvml_dpow_ha_data_internal(%rip), %xmm9, %xmm5 #3840.17 vsubsd %xmm8, %xmm13, %xmm10 #3843.20 vmulsd %xmm15, %xmm13, %xmm13 #3844.18 movslq %r9d, %r9 #3829.53 movl $1048576, %ecx #3812.31 vfmsub213sd %xmm13, %xmm15, %xmm8 #3847.17 movl $127, %r8d #3895.23 - vaddsd 27904+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm6 #3846.18 + vaddsd 27904+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm6 #3846.18 vaddsd 8256(%rax,%r9), %xmm5, %xmm9 #3849.17 vfmadd213sd %xmm8, %xmm15, %xmm10 #3848.17 vaddsd %xmm6, %xmm9, %xmm15 #3850.19 @@ -2119,16 +2119,16 @@ __svml_pow1_ha_l9: vaddsd %xmm6, %xmm11, %xmm9 #3852.18 vaddsd %xmm10, %xmm6, %xmm6 #3858.18 vaddsd %xmm10, %xmm13, %xmm14 #3855.19 - vmovsd 26816+__svml_dpow_ha_data_internal(%rip), %xmm10 #3859.20 + vmovsd 26816+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #3859.20 vandpd %xmm12, %xmm7, %xmm15 #3876.19 - vfmadd213sd 26880+__svml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3861.20 + vfmadd213sd 26880+__jsvml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3861.20 vaddsd %xmm9, %xmm14, %xmm8 #3856.19 - vfmadd213sd 26944+__svml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3863.20 + vfmadd213sd 26944+__jsvml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3863.20 vmovd %edx, %xmm14 #3882.37 vaddsd 8264(%rax,%r9), %xmm8, %xmm11 #3857.19 - vfmadd213sd 27008+__svml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3865.20 - vfmadd213sd 27072+__svml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3867.20 - vfmadd213sd 27136+__svml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3869.20 + vfmadd213sd 27008+__jsvml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3865.20 + vfmadd213sd 27072+__jsvml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3867.20 + vfmadd213sd 27136+__jsvml_dpow_ha_data_internal(%rip), %xmm6, %xmm10 #3869.20 vfmadd213sd %xmm11, %xmm6, %xmm10 #3870.19 vaddsd %xmm10, %xmm5, %xmm6 #3871.26 vandpd %xmm12, %xmm6, %xmm8 #3874.18 @@ -2152,7 +2152,7 @@ __svml_pow1_ha_l9: vpcmpeqd %xmm14, %xmm13, %xmm12 #3883.95 vpor %xmm3, %xmm1, %xmm1 #3815.35 vpor %xmm12, %xmm10, %xmm2 #3883.31 - vmovsd 28032+__svml_dpow_ha_data_internal(%rip), %xmm10 #3890.26 + vmovsd 28032+__jsvml_dpow_ha_data_internal(%rip), %xmm10 #3890.26 vpor %xmm2, %xmm1, %xmm3 #3884.35 vfmadd213sd %xmm4, %xmm9, %xmm15 #3887.18 vaddsd %xmm10, %xmm6, %xmm12 #3891.19 @@ -2170,14 +2170,14 @@ __svml_pow1_ha_l9: vsubsd %xmm4, %xmm6, %xmm6 #3906.19 vaddsd %xmm11, %xmm5, %xmm5 #3907.17 vmovd %xmm3, %r10d #3904.95 - vmovsd 27200+__svml_dpow_ha_data_internal(%rip), %xmm11 #3911.20 + vmovsd 27200+__jsvml_dpow_ha_data_internal(%rip), %xmm11 #3911.20 vaddsd %xmm6, %xmm5, %xmm13 #3908.17 vmulsd %xmm13, %xmm13, %xmm4 #3909.18 - vfmadd213sd 27264+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm11 #3913.19 - vmovsd 27328+__svml_dpow_ha_data_internal(%rip), %xmm3 #3917.20 + vfmadd213sd 27264+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm11 #3913.19 + vmovsd 27328+__jsvml_dpow_ha_data_internal(%rip), %xmm3 #3917.20 vmulsd %xmm4, %xmm4, %xmm1 #3910.18 - vfmadd213sd 27392+__svml_dpow_ha_data_internal(%rip), %xmm13, %xmm3 #3919.19 - vmovsd 27456+__svml_dpow_ha_data_internal(%rip), %xmm12 #3923.20 + vfmadd213sd 27392+__jsvml_dpow_ha_data_internal(%rip), %xmm13, %xmm3 #3919.19 + vmovsd 27456+__jsvml_dpow_ha_data_internal(%rip), %xmm12 #3923.20 movslq %r10d, %r10 #3904.55 vmulsd %xmm1, %xmm11, %xmm11 #3914.19 vmulsd %xmm4, %xmm3, %xmm5 #3920.19 @@ -2185,7 +2185,7 @@ __svml_pow1_ha_l9: vmulsd %xmm8, %xmm11, %xmm2 #3915.19 vmulsd %xmm8, %xmm5, %xmm10 #3921.19 vaddsd 24712(%rax,%r10), %xmm2, %xmm6 #3916.19 - vmovsd 27968+__svml_dpow_ha_data_internal(%rip), %xmm15 #3902.27 + vmovsd 27968+__jsvml_dpow_ha_data_internal(%rip), %xmm15 #3902.27 vandpd %xmm15, %xmm14, %xmm9 #3903.17 vaddsd %xmm10, %xmm6, %xmm15 #3922.19 vmulsd %xmm13, %xmm12, %xmm14 #3924.19 @@ -2228,30 +2228,30 @@ __svml_pow1_ha_l9: lea (%rsp), %rdi #3930.663 lea 64(%rsp), %rsi #3930.663 lea 128(%rsp), %rdx #3930.663 -..___tag_value___svml_pow1_ha_l9.170: -# __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) - call __svml_dpow_ha_cout_rare_internal #3930.663 -..___tag_value___svml_pow1_ha_l9.171: +..___tag_value___jsvml_pow1_ha_l9.170: +# __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) + call __jsvml_dpow_ha_cout_rare_internal #3930.663 +..___tag_value___jsvml_pow1_ha_l9.171: jmp ..B9.4 # Prob 100% #3930.663 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_pow1_ha_l9,@function - .size __svml_pow1_ha_l9,.-__svml_pow1_ha_l9 -..LN__svml_pow1_ha_l9.8: + .type __jsvml_pow1_ha_l9,@function + .size __jsvml_pow1_ha_l9,.-__jsvml_pow1_ha_l9 +..LN__jsvml_pow1_ha_l9.8: .data -# -- End __svml_pow1_ha_l9 +# -- End __jsvml_pow1_ha_l9 .text -.L_2__routine_start___svml_dpow_ha_cout_rare_internal_9: -# -- Begin __svml_dpow_ha_cout_rare_internal +.L_2__routine_start___jsvml_dpow_ha_cout_rare_internal_9: +# -- Begin __jsvml_dpow_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dpow_ha_cout_rare_internal - .globl __svml_dpow_ha_cout_rare_internal -# --- __svml_dpow_ha_cout_rare_internal(const double *, double *, double *) -__svml_dpow_ha_cout_rare_internal: + .hidden __jsvml_dpow_ha_cout_rare_internal + .globl __jsvml_dpow_ha_cout_rare_internal +# --- __jsvml_dpow_ha_cout_rare_internal(const double *, double *, double *) +__jsvml_dpow_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -2262,7 +2262,7 @@ __svml_dpow_ha_cout_rare_internal: .byte 30 #4880.30 .byte 250 #4880.30 .cfi_startproc -..___tag_value___svml_dpow_ha_cout_rare_internal.173: +..___tag_value___jsvml_dpow_ha_cout_rare_internal.173: ..L174: #4799.1 pushq %r12 #4799.1 @@ -3102,17 +3102,17 @@ __svml_dpow_ha_cout_rare_internal: # LOE rbp r8 r14 eax edx esi edi r10d r12d r13d bl r11b xmm0 xmm1 xmm3 .cfi_endproc # mark_end; - .type __svml_dpow_ha_cout_rare_internal,@function - .size __svml_dpow_ha_cout_rare_internal,.-__svml_dpow_ha_cout_rare_internal -..LN__svml_dpow_ha_cout_rare_internal.9: + .type __jsvml_dpow_ha_cout_rare_internal,@function + .size __jsvml_dpow_ha_cout_rare_internal,.-__jsvml_dpow_ha_cout_rare_internal +..LN__jsvml_dpow_ha_cout_rare_internal.9: .data -# -- End __svml_dpow_ha_cout_rare_internal +# -- End __jsvml_dpow_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dpow_ha_data_internal_avx512 - .globl __svml_dpow_ha_data_internal_avx512 -__svml_dpow_ha_data_internal_avx512: + .hidden __jsvml_dpow_ha_data_internal_avx512 + .globl __jsvml_dpow_ha_data_internal_avx512 +__jsvml_dpow_ha_data_internal_avx512: .long 0 .long 0 .long 1972240384 @@ -3753,12 +3753,12 @@ __svml_dpow_ha_data_internal_avx512: .long 2146435072 .long 0 .long 2146435072 - .type __svml_dpow_ha_data_internal_avx512,@object - .size __svml_dpow_ha_data_internal_avx512,2560 + .type __jsvml_dpow_ha_data_internal_avx512,@object + .size __jsvml_dpow_ha_data_internal_avx512,2560 .align 64 - .hidden __svml_dpow_ha_data_internal - .globl __svml_dpow_ha_data_internal -__svml_dpow_ha_data_internal: + .hidden __jsvml_dpow_ha_data_internal + .globl __jsvml_dpow_ha_data_internal +__jsvml_dpow_ha_data_internal: .long 1073741824 .long 1073157447 .long 1073741824 @@ -11095,8 +11095,8 @@ __svml_dpow_ha_data_internal: .long 127 .long 127 .long 127 - .type __svml_dpow_ha_data_internal,@object - .size __svml_dpow_ha_data_internal,29056 + .type __jsvml_dpow_ha_data_internal,@object + .size __jsvml_dpow_ha_data_internal,29056 .space 128, 0x00 # pad .align 32 _vmldPowHATab: diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_sin_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_sin_linux_x86.S similarity index 95% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_sin_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_sin_linux_x86.S index 396466f4f4a..3b47257f052 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_sin_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_sin_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_sin.c" .text ..TXTST0: -.L_2__routine_start___svml_sin2_ha_e9_0: -# -- Begin __svml_sin2_ha_e9 +.L_2__routine_start___jsvml_sin2_ha_e9_0: +# -- Begin __jsvml_sin2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sin2_ha_e9 -# --- __svml_sin2_ha_e9(__m128d) -__svml_sin2_ha_e9: + .globl __jsvml_sin2_ha_e9 +# --- __jsvml_sin2_ha_e9(__m128d) +__jsvml_sin2_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_sin2_ha_e9: .byte 30 #3141.18 .byte 250 #3141.18 .cfi_startproc -..___tag_value___svml_sin2_ha_e9.1: +..___tag_value___jsvml_sin2_ha_e9.1: ..L2: #2782.1 pushq %rbp #2782.1 @@ -57,26 +57,26 @@ __svml_sin2_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #2782.1 subq $192, %rsp #2782.1 - lea __svml_dsin_ha_data_internal_ha(%rip), %rax #2849.383 - movups 16384+__svml_dsin_ha_data_internal_ha(%rip), %xmm1 #2829.50 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rax #2849.383 + movups 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm1 #2829.50 xorl %edx, %edx #2828.1 - movups 16576+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #2835.25 + movups 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #2835.25 movaps %xmm1, %xmm2 #2830.17 andps %xmm0, %xmm1 #2831.12 andnps %xmm0, %xmm2 #2830.17 mulpd %xmm1, %xmm12 #2835.25 - movups 16640+__svml_dsin_ha_data_internal_ha(%rip), %xmm6 #2834.51 + movups 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6 #2834.51 movaps %xmm1, %xmm7 #2838.14 addpd %xmm6, %xmm12 #2835.13 movaps %xmm12, %xmm10 #2836.13 subpd %xmm6, %xmm10 #2836.13 - movups 16768+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #2837.48 + movups 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #2837.48 mulpd %xmm10, %xmm8 #2838.36 - movups 16832+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #2840.19 + movups 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #2840.19 mulpd %xmm10, %xmm9 #2840.19 subpd %xmm8, %xmm7 #2838.14 movaps %xmm7, %xmm5 #2841.17 - andps 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #2848.23 + andps 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #2848.23 subpd %xmm9, %xmm5 #2841.17 movd %xmm12, %ecx #2849.128 movaps %xmm5, %xmm3 #2853.22 @@ -88,7 +88,7 @@ __svml_sin2_ha_e9: movhpd 8(%rsi,%rax), %xmm8 #2850.582 mulpd %xmm8, %xmm3 #2853.22 subpd %xmm5, %xmm7 #2842.17 - movups 16896+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #2844.50 + movups 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #2844.50 movq (%rcx,%rax), %xmm4 #2849.612 mulpd %xmm10, %xmm11 #2845.32 subpd %xmm9, %xmm7 #2843.17 @@ -109,15 +109,15 @@ __svml_sin2_ha_e9: subpd %xmm6, %xmm14 #2858.18 addpd %xmm13, %xmm3 #2857.18 addpd %xmm14, %xmm15 #2859.18 - movups 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm14 #2871.26 + movups 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm14 #2871.26 mulpd %xmm9, %xmm14 #2871.26 addpd %xmm15, %xmm3 #2860.21 - addpd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm14 #2871.14 - movups 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #2864.26 + addpd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm14 #2871.14 + movups 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #2864.26 mulpd %xmm9, %xmm13 #2864.26 mulpd %xmm9, %xmm14 #2873.26 - addpd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #2864.14 - addpd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm14 #2873.14 + addpd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #2864.14 + addpd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm14 #2873.14 mulpd %xmm9, %xmm13 #2865.14 mulpd %xmm14, %xmm9 #2874.14 mulpd %xmm5, %xmm13 #2866.14 @@ -135,7 +135,7 @@ __svml_sin2_ha_e9: addpd %xmm3, %xmm6 #2880.14 movaps %xmm1, %xmm3 #2882.26 pxor %xmm2, %xmm6 #2881.14 - cmpnlepd 16448+__svml_dsin_ha_data_internal_ha(%rip), %xmm3 #2882.26 + cmpnlepd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm3 #2882.26 movmskpd %xmm3, %edi #2884.78 testl %edi, %edi #2885.66 jne ..B1.12 # Prob 5% #2885.66 @@ -198,10 +198,10 @@ __svml_sin2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #3144.546 lea 128(%rsp,%r12,8), %rsi #3144.546 -..___tag_value___svml_sin2_ha_e9.19: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #3144.546 -..___tag_value___svml_sin2_ha_e9.20: +..___tag_value___jsvml_sin2_ha_e9.19: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #3144.546 +..___tag_value___jsvml_sin2_ha_e9.20: jmp ..B1.9 # Prob 100% #3144.546 .cfi_restore 12 .cfi_restore 13 @@ -209,10 +209,10 @@ __svml_sin2_ha_e9: ..B1.12: # Preds ..B1.1 # Execution count [5.00e-02]: Infreq movdqu .L_2il0floatpacket.35(%rip), %xmm10 #2978.22 - lea __svml_dsin_ha_reduction_data_internal(%rip), %r9 #2980.385 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %r9 #2980.385 pand %xmm1, %xmm10 #2978.22 psrlq $52, %xmm10 #2979.22 - movups 16512+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #2888.55 + movups 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #2888.55 movd %xmm10, %ecx #2980.124 movups %xmm0, 32(%rsp) #[spill] movaps %xmm8, %xmm0 #2889.20 @@ -378,9 +378,9 @@ __svml_sin2_ha_e9: addpd %xmm1, %xmm12 #3113.26 subpd %xmm12, %xmm9 #3115.22 addpd %xmm9, %xmm1 #3116.22 - movups 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #3123.30 + movups 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #3123.30 movaps %xmm12, %xmm5 #3114.25 - movups 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #3130.30 + movups 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #3130.30 movq (%r10,%rax), %xmm4 #3108.616 mulpd %xmm14, %xmm9 #3123.30 mulpd %xmm14, %xmm10 #3130.30 @@ -388,8 +388,8 @@ __svml_sin2_ha_e9: mulpd %xmm4, %xmm13 #3111.23 addpd %xmm0, %xmm4 #3126.17 addpd %xmm13, %xmm5 #3114.25 - movups 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3123.18 - movups 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #3130.18 + movups 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3123.18 + movups 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #3130.18 addpd %xmm9, %xmm8 #3123.18 addpd %xmm10, %xmm11 #3130.18 subpd %xmm5, %xmm12 #3117.22 @@ -403,7 +403,7 @@ __svml_sin2_ha_e9: addpd %xmm13, %xmm1 #3119.25 mulpd %xmm4, %xmm6 #3137.32 addpd %xmm8, %xmm1 #3127.21 - movups 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #3132.18 + movups 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #3132.18 addpd %xmm11, %xmm12 #3132.18 mulpd %xmm12, %xmm14 #3133.18 mulpd %xmm3, %xmm14 #3134.33 @@ -423,20 +423,20 @@ __svml_sin2_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm6 .cfi_endproc # mark_end; - .type __svml_sin2_ha_e9,@function - .size __svml_sin2_ha_e9,.-__svml_sin2_ha_e9 -..LN__svml_sin2_ha_e9.0: + .type __jsvml_sin2_ha_e9,@function + .size __jsvml_sin2_ha_e9,.-__jsvml_sin2_ha_e9 +..LN__jsvml_sin2_ha_e9.0: .data -# -- End __svml_sin2_ha_e9 +# -- End __jsvml_sin2_ha_e9 .text -.L_2__routine_start___svml_sin4_ha_l9_1: -# -- Begin __svml_sin4_ha_l9 +.L_2__routine_start___jsvml_sin4_ha_l9_1: +# -- Begin __jsvml_sin4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sin4_ha_l9 -# --- __svml_sin4_ha_l9(__m256d) -__svml_sin4_ha_l9: + .globl __jsvml_sin4_ha_l9 +# --- __jsvml_sin4_ha_l9(__m256d) +__jsvml_sin4_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -445,7 +445,7 @@ __svml_sin4_ha_l9: .byte 30 #3495.18 .byte 250 #3495.18 .cfi_startproc -..___tag_value___svml_sin4_ha_l9.30: +..___tag_value___jsvml_sin4_ha_l9.30: ..L31: #3152.1 pushq %rbp #3152.1 @@ -455,13 +455,13 @@ __svml_sin4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #3152.1 subq $192, %rsp #3152.1 - lea __svml_dsin_ha_data_internal_ha(%rip), %r8 #3218.728 - vmovupd 16384+__svml_dsin_ha_data_internal_ha(%rip), %ymm13 #3199.53 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %r8 #3218.728 + vmovupd 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13 #3199.53 xorl %esi, %esi #3198.1 - vmovupd 16576+__svml_dsin_ha_data_internal_ha(%rip), %ymm11 #3203.49 - vmovupd 16640+__svml_dsin_ha_data_internal_ha(%rip), %ymm7 #3204.54 - vmovupd 16768+__svml_dsin_ha_data_internal_ha(%rip), %ymm8 #3207.51 - vmovupd 16832+__svml_dsin_ha_data_internal_ha(%rip), %ymm9 #3209.51 + vmovupd 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm11 #3203.49 + vmovupd 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm7 #3204.54 + vmovupd 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm8 #3207.51 + vmovupd 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm9 #3209.51 vmovapd %ymm0, %ymm6 #3152.1 vandnpd %ymm6, %ymm13, %ymm14 #3200.17 vandpd %ymm13, %ymm6, %ymm13 #3201.12 @@ -470,10 +470,10 @@ __svml_sin4_ha_l9: vfnmadd213pd %ymm13, %ymm5, %ymm8 #3208.14 vmovapd %ymm9, %ymm4 #3210.17 vfnmadd213pd %ymm8, %ymm5, %ymm4 #3210.17 - vandps 16704+__svml_dsin_ha_data_internal_ha(%rip), %ymm11, %ymm12 #3217.19 + vandps 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm11, %ymm12 #3217.19 vsubpd %ymm4, %ymm8, %ymm10 #3211.17 vfnmadd231pd %ymm5, %ymm9, %ymm10 #3212.17 - vfnmadd132pd 16896+__svml_dsin_ha_data_internal_ha(%rip), %ymm10, %ymm5 #3214.13 + vfnmadd132pd 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm10, %ymm5 #3214.13 vextractf128 $1, %ymm12, %xmm0 #3218.326 vmovd %xmm12, %eax #3218.128 vmovd %xmm0, %ecx #3218.307 @@ -501,7 +501,7 @@ __svml_sin4_ha_l9: vmovaps %ymm3, %ymm1 #3222.21 vinsertf128 $1, %xmm10, %ymm8, %ymm2 #3219.1151 vfmadd231pd %ymm4, %ymm2, %ymm7 #3221.22 - vmovupd 16960+__svml_dsin_ha_data_internal_ha(%rip), %ymm10 #3231.14 + vmovupd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm10 #3231.14 vfmadd213pd %ymm7, %ymm4, %ymm1 #3222.21 vsubpd %ymm7, %ymm0, %ymm8 #3223.18 vsubpd %ymm1, %ymm7, %ymm9 #3225.18 @@ -509,13 +509,13 @@ __svml_sin4_ha_l9: vfmadd231pd %ymm4, %ymm2, %ymm8 #3224.18 vfmadd231pd %ymm3, %ymm4, %ymm9 #3226.18 vaddpd %ymm2, %ymm3, %ymm3 #3234.13 - vfmadd231pd 17024+__svml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm10 #3231.14 - vmovupd 17152+__svml_dsin_ha_data_internal_ha(%rip), %ymm2 #3238.14 + vfmadd231pd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm10 #3231.14 + vmovupd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm2 #3238.14 vaddpd %ymm9, %ymm8, %ymm15 #3227.21 vmulpd %ymm10, %ymm7, %ymm11 #3232.14 - vfmadd231pd 17216+__svml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm2 #3238.14 + vfmadd231pd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm2 #3238.14 vmulpd %ymm11, %ymm4, %ymm8 #3233.14 - vfmadd213pd 17088+__svml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm2 #3240.14 + vfmadd213pd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm2 #3240.14 vfnmadd213pd %ymm3, %ymm0, %ymm4 #3243.13 vfmadd213pd %ymm15, %ymm3, %ymm8 #3235.17 vmulpd %ymm2, %ymm7, %ymm7 #3241.14 @@ -528,7 +528,7 @@ __svml_sin4_ha_l9: vfmadd213pd %ymm2, %ymm4, %ymm5 #3245.16 vaddpd %ymm5, %ymm7, %ymm4 #3246.17 vaddpd %ymm4, %ymm1, %ymm5 #3247.14 - vcmpnle_uqpd 16448+__svml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm1 #3249.26 + vcmpnle_uqpd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm1 #3249.26 vmovmskpd %ymm1, %r9d #3251.78 vxorpd %ymm14, %ymm5, %ymm0 #3248.14 testl %r9d, %r9d #3252.66 @@ -595,10 +595,10 @@ __svml_sin4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #3498.552 lea 128(%rsp,%r12,8), %rsi #3498.552 -..___tag_value___svml_sin4_ha_l9.48: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #3498.552 -..___tag_value___svml_sin4_ha_l9.49: +..___tag_value___jsvml_sin4_ha_l9.48: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #3498.552 +..___tag_value___jsvml_sin4_ha_l9.49: jmp ..B2.9 # Prob 100% #3498.552 .cfi_restore 12 .cfi_restore 13 @@ -606,10 +606,10 @@ __svml_sin4_ha_l9: ..B2.12: # Preds ..B2.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.53(%rip), %ymm13, %ymm7 #3345.18 - lea __svml_dsin_ha_reduction_data_internal(%rip), %rcx #3347.736 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %rcx #3347.736 vmovupd %ymm6, 64(%rsp) #[spill] vmovupd %ymm1, (%rsp) #[spill] - vmovupd 16512+__svml_dsin_ha_data_internal_ha(%rip), %ymm12 #3255.58 + vmovupd 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm12 #3255.58 vmovupd %ymm0, 32(%rsp) #[spill] vpsrlq $52, %ymm7, %ymm6 #3346.18 vandpd %ymm13, %ymm12, %ymm8 #3256.20 @@ -623,7 +623,7 @@ __svml_sin4_ha_l9: vpextrd $2, %xmm1, %r11d #3347.405 lea (%r9,%r9,2), %r10d #3347.649 shll $3, %edx #3347.547 - lea __svml_dsin_ha_data_internal_ha(%rip), %r9 #3464.732 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %r9 #3464.732 shll $3, %r10d #3347.649 vmovq 16(%rdx,%rcx), %xmm11 #3349.1284 lea (%r8,%r8,2), %eax #3347.598 @@ -762,12 +762,12 @@ __svml_sin4_ha_l9: vinsertf128 $1, %xmm10, %ymm6, %ymm12 #3465.1155 vinsertf128 $1, %xmm1, %ymm13, %ymm13 #3466.1153 vfmadd213pd %ymm13, %ymm12, %ymm3 #3467.26 - vmovupd 16960+__svml_dsin_ha_data_internal_ha(%rip), %ymm1 #3477.18 + vmovupd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm1 #3477.18 vmovq 24(%rax,%r9), %xmm6 #3490.1231 vmovq 24(%rcx,%r9), %xmm10 #3490.1431 vmovhpd 24(%rdx,%r9), %xmm6, %xmm7 #3490.1199 vfmadd213pd %ymm3, %ymm8, %ymm15 #3468.25 - vfmadd231pd 17024+__svml_dsin_ha_data_internal_ha(%rip), %ymm2, %ymm1 #3477.18 + vfmadd231pd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm2, %ymm1 #3477.18 vmovupd 64(%rsp), %ymm6 #3495.18[spill] vsubpd %ymm15, %ymm3, %ymm0 #3471.22 vsubpd %ymm3, %ymm13, %ymm4 #3469.22 @@ -776,13 +776,13 @@ __svml_sin4_ha_l9: vfmadd231pd %ymm8, %ymm12, %ymm4 #3470.22 vaddpd %ymm12, %ymm11, %ymm1 #3480.17 vmovhpd 24(%r8,%r9), %xmm10, %xmm12 #3490.1399 - vmovupd 17152+__svml_dsin_ha_data_internal_ha(%rip), %ymm11 #3484.18 + vmovupd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm11 #3484.18 vmulpd %ymm9, %ymm8, %ymm3 #3479.18 vfnmadd213pd %ymm1, %ymm13, %ymm8 #3489.17 vaddpd %ymm0, %ymm4, %ymm0 #3473.25 - vfmadd231pd 17216+__svml_dsin_ha_data_internal_ha(%rip), %ymm2, %ymm11 #3484.18 + vfmadd231pd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm2, %ymm11 #3484.18 vfmadd213pd %ymm0, %ymm1, %ymm3 #3481.21 - vfmadd213pd 17088+__svml_dsin_ha_data_internal_ha(%rip), %ymm2, %ymm11 #3486.18 + vfmadd213pd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm2, %ymm11 #3486.18 vmulpd %ymm11, %ymm2, %ymm0 #3487.18 vfmadd213pd %ymm3, %ymm13, %ymm0 #3488.21 vinsertf128 $1, %xmm12, %ymm7, %ymm1 #3490.1153 @@ -798,20 +798,20 @@ __svml_sin4_ha_l9: # LOE rbx r12 r13 r14 r15 esi ymm0 ymm6 .cfi_endproc # mark_end; - .type __svml_sin4_ha_l9,@function - .size __svml_sin4_ha_l9,.-__svml_sin4_ha_l9 -..LN__svml_sin4_ha_l9.1: + .type __jsvml_sin4_ha_l9,@function + .size __jsvml_sin4_ha_l9,.-__jsvml_sin4_ha_l9 +..LN__jsvml_sin4_ha_l9.1: .data -# -- End __svml_sin4_ha_l9 +# -- End __jsvml_sin4_ha_l9 .text -.L_2__routine_start___svml_sin1_ha_e9_2: -# -- Begin __svml_sin1_ha_e9 +.L_2__routine_start___jsvml_sin1_ha_e9_2: +# -- Begin __jsvml_sin1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sin1_ha_e9 -# --- __svml_sin1_ha_e9(__m128d) -__svml_sin1_ha_e9: + .globl __jsvml_sin1_ha_e9 +# --- __jsvml_sin1_ha_e9(__m128d) +__jsvml_sin1_ha_e9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -820,7 +820,7 @@ __svml_sin1_ha_e9: .byte 30 #3865.18 .byte 250 #3865.18 .cfi_startproc -..___tag_value___svml_sin1_ha_e9.59: +..___tag_value___jsvml_sin1_ha_e9.59: ..L60: #3506.1 pushq %rbp #3506.1 @@ -830,17 +830,17 @@ __svml_sin1_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #3506.1 subq $128, %rsp #3506.1 - lea __svml_dsin_ha_data_internal_ha(%rip), %rax #3573.371 - movsd 16384+__svml_dsin_ha_data_internal_ha(%rip), %xmm2 #3553.19 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rax #3573.371 + movsd 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm2 #3553.19 xorl %edx, %edx #3552.1 movaps %xmm2, %xmm3 #3554.17 andps %xmm0, %xmm2 #3555.12 movaps %xmm2, %xmm10 #3559.25 movaps %xmm2, %xmm5 #3562.14 - mulsd 16576+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #3559.25 + mulsd 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #3559.25 andnps %xmm0, %xmm3 #3554.17 - movsd 16640+__svml_dsin_ha_data_internal_ha(%rip), %xmm1 #3558.20 - movq 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #3571.27 + movsd 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm1 #3558.20 + movq 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #3571.27 addsd %xmm1, %xmm10 #3559.13 movaps %xmm10, %xmm8 #3560.13 pand %xmm9, %xmm10 #3572.23 @@ -848,9 +848,9 @@ __svml_sin1_ha_e9: subsd %xmm1, %xmm8 #3560.13 movaps %xmm8, %xmm6 #3562.36 movaps %xmm8, %xmm7 #3564.19 - mulsd 16768+__svml_dsin_ha_data_internal_ha(%rip), %xmm6 #3562.36 - mulsd 16832+__svml_dsin_ha_data_internal_ha(%rip), %xmm7 #3564.19 - mulsd 16896+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3569.32 + mulsd 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6 #3562.36 + mulsd 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm7 #3564.19 + mulsd 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3569.32 subsd %xmm6, %xmm5 #3562.14 movaps %xmm5, %xmm4 #3565.17 shll $5, %ecx #3573.231 @@ -877,18 +877,18 @@ __svml_sin1_ha_e9: subsd %xmm1, %xmm15 #3582.18 mulsd %xmm4, %xmm11 #3585.15 addsd %xmm12, %xmm15 #3583.18 - movsd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #3588.26 + movsd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #3588.26 addsd %xmm13, %xmm15 #3584.21 mulsd %xmm11, %xmm12 #3588.26 - movsd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3595.26 + movsd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3595.26 mulsd %xmm11, %xmm8 #3595.26 - addsd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #3588.14 + addsd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #3588.14 mulsd %xmm11, %xmm12 #3589.14 - addsd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3595.14 + addsd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3595.14 mulsd %xmm11, %xmm8 #3597.26 mulsd %xmm4, %xmm12 #3590.14 mulsd %xmm6, %xmm4 #3600.32 - addsd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3597.14 + addsd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3597.14 mulsd %xmm7, %xmm12 #3592.29 subsd %xmm4, %xmm7 #3600.13 mulsd %xmm11, %xmm8 #3598.14 @@ -899,7 +899,7 @@ __svml_sin1_ha_e9: addsd %xmm12, %xmm8 #3599.17 movaps %xmm2, %xmm4 #3606.26 addsd %xmm5, %xmm8 #3603.17 - cmpnlesd 16448+__svml_dsin_ha_data_internal_ha(%rip), %xmm4 #3606.26 + cmpnlesd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm4 #3606.26 addsd %xmm8, %xmm1 #3604.14 movmskpd %xmm4, %esi #3608.78 pxor %xmm3, %xmm1 #3605.14 @@ -941,10 +941,10 @@ __svml_sin1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #3868.546 lea 64(%rsp), %rsi #3868.546 -..___tag_value___svml_sin1_ha_e9.68: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #3868.546 -..___tag_value___svml_sin1_ha_e9.69: +..___tag_value___jsvml_sin1_ha_e9.68: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #3868.546 +..___tag_value___jsvml_sin1_ha_e9.69: jmp ..B3.5 # Prob 100% #3868.546 # LOE rbx r12 r13 r14 r15 ..B3.8: # Preds ..B3.1 @@ -952,11 +952,11 @@ __svml_sin1_ha_e9: movdqu .L_2il0floatpacket.35(%rip), %xmm9 #3702.22 movaps %xmm2, %xmm7 #3613.20 pand %xmm2, %xmm9 #3702.22 - lea __svml_dsin_ha_reduction_data_internal(%rip), %rdi #3704.383 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %rdi #3704.383 psrlq $52, %xmm9 #3703.22 movd %xmm9, %ecx #3704.124 movups %xmm1, 16(%rsp) #[spill] - movsd 16512+__svml_dsin_ha_data_internal_ha(%rip), %xmm1 #3612.24 + movsd 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm1 #3612.24 movdqu .L_2il0floatpacket.36(%rip), %xmm6 #3712.25 andps %xmm1, %xmm7 #3613.20 pand %xmm2, %xmm6 #3712.25 @@ -1113,17 +1113,17 @@ __svml_sin1_ha_e9: movdqa %xmm9, %xmm6 #3837.26 addsd %xmm2, %xmm6 #3837.26 addsd 8(%rax,%r8), %xmm10 #3850.17 - movsd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3847.30 + movsd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3847.30 movaps %xmm0, %xmm12 #3838.25 - movsd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #3854.30 + movsd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #3854.30 movdqa %xmm9, %xmm1 #3839.22 mulsd %xmm7, %xmm8 #3847.30 addsd %xmm6, %xmm12 #3838.25 subsd %xmm6, %xmm1 #3839.22 mulsd %xmm7, %xmm11 #3854.30 - addsd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #3847.18 + addsd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #3847.18 subsd %xmm12, %xmm6 #3841.22 - addsd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #3854.18 + addsd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #3854.18 addsd %xmm2, %xmm1 #3840.22 mulsd %xmm7, %xmm8 #3848.18 addsd %xmm0, %xmm6 #3842.22 @@ -1131,7 +1131,7 @@ __svml_sin1_ha_e9: mulsd %xmm4, %xmm8 #3849.18 addsd %xmm1, %xmm6 #3843.25 mulsd %xmm9, %xmm4 #3859.36 - addsd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #3856.18 + addsd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #3856.18 mulsd %xmm10, %xmm8 #3851.33 mulsd %xmm7, %xmm11 #3857.18 subsd %xmm4, %xmm10 #3859.17 @@ -1152,20 +1152,20 @@ __svml_sin1_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm1 .cfi_endproc # mark_end; - .type __svml_sin1_ha_e9,@function - .size __svml_sin1_ha_e9,.-__svml_sin1_ha_e9 -..LN__svml_sin1_ha_e9.2: + .type __jsvml_sin1_ha_e9,@function + .size __jsvml_sin1_ha_e9,.-__jsvml_sin1_ha_e9 +..LN__jsvml_sin1_ha_e9.2: .data -# -- End __svml_sin1_ha_e9 +# -- End __jsvml_sin1_ha_e9 .text -.L_2__routine_start___svml_sin4_ha_e9_3: -# -- Begin __svml_sin4_ha_e9 +.L_2__routine_start___jsvml_sin4_ha_e9_3: +# -- Begin __jsvml_sin4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sin4_ha_e9 -# --- __svml_sin4_ha_e9(__m256d) -__svml_sin4_ha_e9: + .globl __jsvml_sin4_ha_e9 +# --- __jsvml_sin4_ha_e9(__m256d) +__jsvml_sin4_ha_e9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -1174,7 +1174,7 @@ __svml_sin4_ha_e9: .byte 30 #4235.18 .byte 250 #4235.18 .cfi_startproc -..___tag_value___svml_sin4_ha_e9.77: +..___tag_value___jsvml_sin4_ha_e9.77: ..L78: #3876.1 pushq %rbp #3876.1 @@ -1184,20 +1184,20 @@ __svml_sin4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #3876.1 subq $384, %rsp #3876.1 - lea __svml_dsin_ha_data_internal_ha(%rip), %r8 #3943.613 - vmovupd 16384+__svml_dsin_ha_data_internal_ha(%rip), %ymm13 #3923.53 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %r8 #3943.613 + vmovupd 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13 #3923.53 xorl %esi, %esi #3922.1 - vmovupd 16640+__svml_dsin_ha_data_internal_ha(%rip), %ymm14 #3928.54 - vmovupd 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm6 #3941.27 + vmovupd 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm14 #3928.54 + vmovupd 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6 #3941.27 vmovapd %ymm0, %ymm11 #3876.1 vandnpd %ymm11, %ymm13, %ymm10 #3924.17 vandpd %ymm13, %ymm11, %ymm13 #3925.12 - vmulpd 16576+__svml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm12 #3929.28 + vmulpd 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm12 #3929.28 vaddpd %ymm12, %ymm14, %ymm2 #3929.13 vsubpd %ymm14, %ymm2, %ymm1 #3930.13 - vmulpd 16768+__svml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm15 #3932.39 - vmulpd 16832+__svml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm8 #3934.19 - vmulpd 16896+__svml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm3 #3939.35 + vmulpd 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm15 #3932.39 + vmulpd 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm8 #3934.19 + vmulpd 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm3 #3939.35 vsubpd %ymm15, %ymm13, %ymm5 #3932.14 vsubpd %ymm8, %ymm5, %ymm9 #3935.17 vsubpd %ymm9, %ymm5, %ymm0 #3936.17 @@ -1238,19 +1238,19 @@ __svml_sin4_ha_e9: vsubpd %ymm5, %ymm2, %ymm15 #3952.18 vmulpd %ymm9, %ymm9, %ymm3 #3955.15 vaddpd %ymm15, %ymm12, %ymm1 #3953.18 - vmulpd 17024+__svml_dsin_ha_data_internal_ha(%rip), %ymm3, %ymm12 #3958.29 + vmulpd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm3, %ymm12 #3958.29 vaddpd %ymm1, %ymm0, %ymm2 #3954.21 vaddpd %ymm6, %ymm7, %ymm1 #3961.13 - vaddpd 16960+__svml_dsin_ha_data_internal_ha(%rip), %ymm12, %ymm14 #3958.14 + vaddpd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm12, %ymm14 #3958.14 vmulpd %ymm14, %ymm3, %ymm15 #3959.14 vmulpd %ymm15, %ymm9, %ymm0 #3960.14 vmulpd %ymm9, %ymm4, %ymm9 #3970.35 vmulpd %ymm1, %ymm0, %ymm7 #3962.32 - vmulpd 17216+__svml_dsin_ha_data_internal_ha(%rip), %ymm3, %ymm0 #3965.29 + vmulpd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm3, %ymm0 #3965.29 vaddpd %ymm7, %ymm2, %ymm12 #3962.17 - vaddpd 17152+__svml_dsin_ha_data_internal_ha(%rip), %ymm0, %ymm2 #3965.14 + vaddpd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm0, %ymm2 #3965.14 vmulpd %ymm2, %ymm3, %ymm6 #3967.29 - vaddpd 17088+__svml_dsin_ha_data_internal_ha(%rip), %ymm6, %ymm7 #3967.14 + vaddpd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm6, %ymm7 #3967.14 vsubpd %ymm9, %ymm1, %ymm6 #3970.13 vmovq 24(%rax,%r8), %xmm1 #3971.1112 vmovhpd 24(%rdx,%r8), %xmm1, %xmm2 #3971.1080 @@ -1260,7 +1260,7 @@ __svml_sin4_ha_e9: vmovq 24(%rcx,%r8), %xmm3 #3971.1312 vmovhpd 24(%rdi,%r8), %xmm3, %xmm4 #3971.1280 vaddpd %ymm14, %ymm12, %ymm0 #3969.17 - vcmpnle_uqpd 16448+__svml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm12 #3976.26 + vcmpnle_uqpd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm12 #3976.26 vinsertf128 $1, %xmm4, %ymm2, %ymm7 #3971.1034 vaddpd %ymm8, %ymm7, %ymm9 #3972.16 vaddpd %ymm9, %ymm0, %ymm0 #3973.17 @@ -1333,18 +1333,18 @@ __svml_sin4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #4238.552 lea 128(%rsp,%r12,8), %rsi #4238.552 -..___tag_value___svml_sin4_ha_e9.95: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #4238.552 -..___tag_value___svml_sin4_ha_e9.96: +..___tag_value___jsvml_sin4_ha_e9.95: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #4238.552 +..___tag_value___jsvml_sin4_ha_e9.96: jmp ..B4.9 # Prob 100% #4238.552 .cfi_restore 12 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B4.12: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq - vmovupd 16512+__svml_dsin_ha_data_internal_ha(%rip), %ymm9 #3982.58 - lea __svml_dsin_ha_reduction_data_internal(%rip), %rcx #4074.621 + vmovupd 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm9 #3982.58 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %rcx #4074.621 vmovupd %ymm13, (%rsp) #[spill] vmovupd %ymm11, 128(%rsp) #[spill] vmovdqu .L_2il0floatpacket.35(%rip), %xmm7 #4071.22 @@ -1370,7 +1370,7 @@ __svml_sin4_ha_e9: vpextrd $2, %xmm3, %r8d #4074.189 lea (%r9,%r9,2), %r10d #4074.534 shll $3, %r10d #4074.534 - lea __svml_dsin_ha_data_internal_ha(%rip), %r9 #4202.617 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %r9 #4202.617 vmovq (%r10,%rcx), %xmm11 #4074.1369 vmovdqu .L_2il0floatpacket.37(%rip), %xmm7 #4081.24 lea (%r11,%r11,2), %edi #4074.585 @@ -1615,16 +1615,16 @@ __svml_sin4_ha_e9: vaddpd %ymm4, %ymm7, %ymm10 #4220.17 vaddpd %ymm0, %ymm13, %ymm11 #4213.25 vmulpd %ymm15, %ymm15, %ymm13 #4214.19 - vmulpd 17024+__svml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm1 #4217.33 - vmulpd 17216+__svml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm7 #4224.33 - vaddpd 16960+__svml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm3 #4217.18 - vaddpd 17152+__svml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm12 #4224.18 + vmulpd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm1 #4217.33 + vmulpd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm13, %ymm7 #4224.33 + vaddpd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm1, %ymm3 #4217.18 + vaddpd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm7, %ymm12 #4224.18 vmulpd %ymm3, %ymm13, %ymm5 #4218.18 vmulpd %ymm12, %ymm13, %ymm14 #4226.33 vmulpd %ymm5, %ymm15, %ymm6 #4219.18 vmulpd %ymm8, %ymm15, %ymm15 #4229.39 vmovupd 64(%rsp), %ymm5 #4235.18[spill] - vaddpd 17088+__svml_dsin_ha_data_internal_ha(%rip), %ymm14, %ymm7 #4226.18 + vaddpd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %ymm14, %ymm7 #4226.18 vmulpd %ymm10, %ymm6, %ymm4 #4221.36 vmulpd %ymm7, %ymm13, %ymm13 #4227.18 vaddpd %ymm4, %ymm11, %ymm0 #4221.21 @@ -1649,20 +1649,20 @@ __svml_sin4_ha_e9: # LOE rbx r12 r13 r14 r15 esi ymm0 ymm11 .cfi_endproc # mark_end; - .type __svml_sin4_ha_e9,@function - .size __svml_sin4_ha_e9,.-__svml_sin4_ha_e9 -..LN__svml_sin4_ha_e9.3: + .type __jsvml_sin4_ha_e9,@function + .size __jsvml_sin4_ha_e9,.-__jsvml_sin4_ha_e9 +..LN__jsvml_sin4_ha_e9.3: .data -# -- End __svml_sin4_ha_e9 +# -- End __jsvml_sin4_ha_e9 .text -.L_2__routine_start___svml_sin1_ha_ex_4: -# -- Begin __svml_sin1_ha_ex +.L_2__routine_start___jsvml_sin1_ha_ex_4: +# -- Begin __jsvml_sin1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_sin1_ha_ex -# --- __svml_sin1_ha_ex(__m128d) -__svml_sin1_ha_ex: + .globl __jsvml_sin1_ha_ex +# --- __jsvml_sin1_ha_ex(__m128d) +__jsvml_sin1_ha_ex: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -1671,7 +1671,7 @@ __svml_sin1_ha_ex: .byte 30 #4605.18 .byte 250 #4605.18 .cfi_startproc -..___tag_value___svml_sin1_ha_ex.132: +..___tag_value___jsvml_sin1_ha_ex.132: ..L133: #4246.1 pushq %rbp #4246.1 @@ -1682,17 +1682,17 @@ __svml_sin1_ha_ex: andq $-64, %rsp #4246.1 subq $128, %rsp #4246.1 movaps %xmm0, %xmm5 #4246.1 - movsd 16384+__svml_dsin_ha_data_internal_ha(%rip), %xmm1 #4293.19 - lea __svml_dsin_ha_data_internal_ha(%rip), %rax #4313.365 + movsd 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm1 #4293.19 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rax #4313.365 movaps %xmm1, %xmm2 #4294.17 andps %xmm5, %xmm1 #4295.12 movaps %xmm1, %xmm11 #4299.25 movaps %xmm1, %xmm4 #4302.14 - mulsd 16576+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #4299.25 + mulsd 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #4299.25 andnps %xmm5, %xmm2 #4294.17 - movsd 16640+__svml_dsin_ha_data_internal_ha(%rip), %xmm6 #4298.20 + movsd 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6 #4298.20 xorl %edx, %edx #4292.1 - movq 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #4311.21 + movq 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #4311.21 addsd %xmm6, %xmm11 #4299.13 movaps %xmm11, %xmm9 #4300.13 pand %xmm10, %xmm11 #4312.17 @@ -1700,9 +1700,9 @@ __svml_sin1_ha_ex: subsd %xmm6, %xmm9 #4300.13 movaps %xmm9, %xmm7 #4302.36 movaps %xmm9, %xmm8 #4304.19 - mulsd 16768+__svml_dsin_ha_data_internal_ha(%rip), %xmm7 #4302.36 - mulsd 16832+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #4304.19 - mulsd 16896+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #4309.32 + mulsd 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm7 #4302.36 + mulsd 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #4304.19 + mulsd 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #4309.32 subsd %xmm7, %xmm4 #4302.14 movaps %xmm4, %xmm3 #4305.17 shll $5, %ecx #4313.225 @@ -1729,18 +1729,18 @@ __svml_sin1_ha_ex: subsd %xmm0, %xmm6 #4322.18 mulsd %xmm3, %xmm12 #4325.15 addsd %xmm13, %xmm6 #4323.18 - movsd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #4328.26 + movsd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #4328.26 addsd %xmm14, %xmm6 #4324.21 mulsd %xmm12, %xmm13 #4328.26 - movsd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #4335.26 + movsd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #4335.26 mulsd %xmm12, %xmm9 #4335.26 - addsd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #4328.14 + addsd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #4328.14 mulsd %xmm12, %xmm13 #4329.14 - addsd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #4335.14 + addsd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #4335.14 mulsd %xmm12, %xmm9 #4337.26 mulsd %xmm3, %xmm13 #4330.14 mulsd %xmm7, %xmm3 #4340.32 - addsd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #4337.14 + addsd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #4337.14 mulsd %xmm8, %xmm13 #4332.29 subsd %xmm3, %xmm8 #4340.13 mulsd %xmm12, %xmm9 #4338.14 @@ -1751,7 +1751,7 @@ __svml_sin1_ha_ex: addsd %xmm13, %xmm9 #4339.17 movaps %xmm1, %xmm3 #4346.26 addsd %xmm4, %xmm9 #4343.17 - cmpnlesd 16448+__svml_dsin_ha_data_internal_ha(%rip), %xmm3 #4346.26 + cmpnlesd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm3 #4346.26 addsd %xmm9, %xmm0 #4344.14 movmskpd %xmm3, %esi #4348.78 pxor %xmm2, %xmm0 #4345.14 @@ -1798,10 +1798,10 @@ __svml_sin1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #4608.546 lea 64(%rsp), %rsi #4608.546 -..___tag_value___svml_sin1_ha_ex.145: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #4608.546 -..___tag_value___svml_sin1_ha_ex.146: +..___tag_value___jsvml_sin1_ha_ex.145: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #4608.546 +..___tag_value___jsvml_sin1_ha_ex.146: jmp ..B5.5 # Prob 100% #4608.546 # LOE rbx r12 r13 r14 r15 ..B5.8: # Preds ..B5.1 @@ -1809,11 +1809,11 @@ __svml_sin1_ha_ex: movdqu .L_2il0floatpacket.35(%rip), %xmm8 #4442.16 movaps %xmm1, %xmm6 #4353.20 pand %xmm1, %xmm8 #4442.16 - lea __svml_dsin_ha_reduction_data_internal(%rip), %rdi #4444.377 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %rdi #4444.377 psrlq $52, %xmm8 #4443.16 movd %xmm8, %ecx #4444.124 movups %xmm0, 16(%rsp) #[spill] - movsd 16512+__svml_dsin_ha_data_internal_ha(%rip), %xmm0 #4352.24 + movsd 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm0 #4352.24 movups %xmm5, 32(%rsp) #[spill] andps %xmm0, %xmm6 #4353.20 movdqu .L_2il0floatpacket.36(%rip), %xmm5 #4452.19 @@ -1970,17 +1970,17 @@ __svml_sin1_ha_ex: movdqa %xmm9, %xmm6 #4577.26 addsd %xmm1, %xmm6 #4577.26 addsd 8(%rax,%r8), %xmm10 #4590.17 - movsd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #4587.30 + movsd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #4587.30 movaps %xmm0, %xmm12 #4578.25 - movsd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #4594.30 + movsd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #4594.30 movdqa %xmm9, %xmm5 #4579.22 mulsd %xmm7, %xmm8 #4587.30 addsd %xmm6, %xmm12 #4578.25 subsd %xmm6, %xmm5 #4579.22 mulsd %xmm7, %xmm11 #4594.30 - addsd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #4587.18 + addsd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #4587.18 subsd %xmm12, %xmm6 #4581.22 - addsd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #4594.18 + addsd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #4594.18 addsd %xmm1, %xmm5 #4580.22 mulsd %xmm7, %xmm8 #4588.18 addsd %xmm0, %xmm6 #4582.22 @@ -1988,7 +1988,7 @@ __svml_sin1_ha_ex: mulsd %xmm3, %xmm8 #4589.18 addsd %xmm5, %xmm6 #4583.25 mulsd %xmm9, %xmm3 #4599.36 - addsd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #4596.18 + addsd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #4596.18 mulsd %xmm10, %xmm8 #4591.33 mulsd %xmm7, %xmm11 #4597.18 subsd %xmm3, %xmm10 #4599.17 @@ -2011,20 +2011,20 @@ __svml_sin1_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm5 .cfi_endproc # mark_end; - .type __svml_sin1_ha_ex,@function - .size __svml_sin1_ha_ex,.-__svml_sin1_ha_ex -..LN__svml_sin1_ha_ex.4: + .type __jsvml_sin1_ha_ex,@function + .size __jsvml_sin1_ha_ex,.-__jsvml_sin1_ha_ex +..LN__jsvml_sin1_ha_ex.4: .data -# -- End __svml_sin1_ha_ex +# -- End __jsvml_sin1_ha_ex .text -.L_2__routine_start___svml_sin2_ha_l9_5: -# -- Begin __svml_sin2_ha_l9 +.L_2__routine_start___jsvml_sin2_ha_l9_5: +# -- Begin __jsvml_sin2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sin2_ha_l9 -# --- __svml_sin2_ha_l9(__m128d) -__svml_sin2_ha_l9: + .globl __jsvml_sin2_ha_l9 +# --- __jsvml_sin2_ha_l9(__m128d) +__jsvml_sin2_ha_l9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -2033,7 +2033,7 @@ __svml_sin2_ha_l9: .byte 30 #4959.18 .byte 250 #4959.18 .cfi_startproc -..___tag_value___svml_sin2_ha_l9.154: +..___tag_value___jsvml_sin2_ha_l9.154: ..L155: #4616.1 pushq %rbp #4616.1 @@ -2044,19 +2044,19 @@ __svml_sin2_ha_l9: andq $-64, %rsp #4616.1 subq $192, %rsp #4616.1 vmovapd %xmm0, %xmm6 #4616.1 - vmovupd 16384+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #4663.50 - lea __svml_dsin_ha_data_internal_ha(%rip), %rsi #4682.383 - vmovupd 16576+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #4667.46 + vmovupd 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #4663.50 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rsi #4682.383 + vmovupd 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #4667.46 vandnpd %xmm6, %xmm13, %xmm14 #4664.17 - vmovupd 16640+__svml_dsin_ha_data_internal_ha(%rip), %xmm7 #4668.51 + vmovupd 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm7 #4668.51 vandpd %xmm13, %xmm6, %xmm13 #4665.12 vfmadd213pd %xmm7, %xmm13, %xmm11 #4669.13 xorl %eax, %eax #4662.1 - vmovupd 16768+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #4671.48 - vmovupd 16832+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #4673.48 + vmovupd 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #4671.48 + vmovupd 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #4673.48 vsubpd %xmm7, %xmm11, %xmm4 #4670.13 vfnmadd213pd %xmm13, %xmm4, %xmm8 #4672.14 - vandps 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm11, %xmm12 #4681.19 + vandps 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11, %xmm12 #4681.19 vmovd %xmm12, %edx #4682.128 vmovapd %xmm8, %xmm5 #4674.17 vfnmadd231pd %xmm4, %xmm9, %xmm5 #4674.17 @@ -2077,21 +2077,21 @@ __svml_sin2_ha_l9: vmovapd %xmm7, %xmm1 #4686.21 vfmadd231pd %xmm3, %xmm5, %xmm1 #4686.21 vsubpd %xmm7, %xmm0, %xmm8 #4687.18 - vfnmadd132pd 16896+__svml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm4 #4678.13 + vfnmadd132pd 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm4 #4678.13 vsubpd %xmm1, %xmm7, %xmm9 #4689.18 vfmadd231pd %xmm5, %xmm2, %xmm8 #4688.18 - vmovupd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #4695.14 - vfmadd231pd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm15, %xmm10 #4695.14 + vmovupd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #4695.14 + vfmadd231pd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm15, %xmm10 #4695.14 vfmadd231pd %xmm3, %xmm5, %xmm9 #4690.18 vaddpd %xmm2, %xmm3, %xmm3 #4698.13 vmulpd %xmm10, %xmm15, %xmm11 #4696.14 vaddpd %xmm9, %xmm8, %xmm12 #4691.21 vmulpd %xmm11, %xmm5, %xmm7 #4697.14 vfnmadd213pd %xmm3, %xmm0, %xmm5 #4707.13 - vmovupd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm2 #4702.14 - vfmadd231pd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm15, %xmm2 #4702.14 + vmovupd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm2 #4702.14 + vfmadd231pd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm15, %xmm2 #4702.14 vfmadd213pd %xmm12, %xmm3, %xmm7 #4699.17 - vfmadd213pd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm15, %xmm2 #4704.14 + vfmadd213pd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm15, %xmm2 #4704.14 vmulpd %xmm2, %xmm15, %xmm2 #4705.14 vfmadd213pd %xmm7, %xmm0, %xmm2 #4706.17 vmovq 24(%rdx,%rsi), %xmm0 #4708.612 @@ -2099,7 +2099,7 @@ __svml_sin2_ha_l9: vfmadd213pd %xmm3, %xmm5, %xmm4 #4709.16 vaddpd %xmm4, %xmm2, %xmm4 #4710.17 vaddpd %xmm4, %xmm1, %xmm5 #4711.14 - vcmpnlepd 16448+__svml_dsin_ha_data_internal_ha(%rip), %xmm13, %xmm1 #4713.26 + vcmpnlepd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13, %xmm1 #4713.26 vmovmskpd %xmm1, %edi #4715.78 vxorpd %xmm14, %xmm5, %xmm2 #4712.14 testl %edi, %edi #4716.66 @@ -2163,10 +2163,10 @@ __svml_sin2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #4962.546 lea 128(%rsp,%r12,8), %rsi #4962.546 -..___tag_value___svml_sin2_ha_l9.172: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #4962.546 -..___tag_value___svml_sin2_ha_l9.173: +..___tag_value___jsvml_sin2_ha_l9.172: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #4962.546 +..___tag_value___jsvml_sin2_ha_l9.173: jmp ..B6.9 # Prob 100% #4962.546 .cfi_restore 12 .cfi_restore 13 @@ -2174,12 +2174,12 @@ __svml_sin2_ha_l9: ..B6.12: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.35(%rip), %xmm13, %xmm11 #4809.18 - lea __svml_dsin_ha_reduction_data_internal(%rip), %r8 #4811.385 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %r8 #4811.385 vpsrlq $52, %xmm11, %xmm12 #4810.18 - lea __svml_dsin_ha_data_internal_ha(%rip), %r11 #4928.387 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %r11 #4928.387 vmovd %xmm12, %edx #4811.124 vpand .L_2il0floatpacket.36(%rip), %xmm13, %xmm9 #4819.21 - vmovupd 16512+__svml_dsin_ha_data_internal_ha(%rip), %xmm0 #4719.55 + vmovupd 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm0 #4719.55 vpextrd $2, %xmm12, %esi #4811.189 vandpd %xmm13, %xmm0, %xmm10 #4720.20 vmovupd %xmm6, 32(%rsp) #[spill] @@ -2286,7 +2286,7 @@ __svml_sin2_ha_l9: vandpd %xmm4, %xmm5, %xmm0 #4924.25 vfmadd213pd %xmm12, %xmm11, %xmm6 #4917.13 vorpd %xmm0, %xmm13, %xmm11 #4925.9 - vmovupd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm3 #4941.18 + vmovupd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm3 #4941.18 shll $5, %r9d #4928.302 vandpd %xmm6, %xmm5, %xmm12 #4926.9 vpextrd $2, %xmm8, %r10d #4928.194 @@ -2302,18 +2302,18 @@ __svml_sin2_ha_l9: vmovhpd (%r10,%r11), %xmm15, %xmm0 #4928.584 vmovapd %xmm11, %xmm15 #4932.25 vmovq 24(%r9,%r11), %xmm10 #4954.616 - vfmadd231pd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm6, %xmm3 #4941.18 + vfmadd231pd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6, %xmm3 #4941.18 vfmadd132pd %xmm0, %xmm8, %xmm15 #4932.25 vsubpd %xmm8, %xmm13, %xmm1 #4933.22 vaddpd %xmm4, %xmm0, %xmm9 #4944.17 vsubpd %xmm15, %xmm8, %xmm2 #4935.22 vmulpd %xmm3, %xmm6, %xmm8 #4942.18 vfmadd231pd %xmm0, %xmm11, %xmm2 #4936.22 - vmovupd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm0 #4948.18 - vfmadd231pd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm6, %xmm0 #4948.18 + vmovupd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm0 #4948.18 + vfmadd231pd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6, %xmm0 #4948.18 vfmadd231pd %xmm11, %xmm4, %xmm1 #4934.22 vmulpd %xmm8, %xmm11, %xmm7 #4943.18 - vfmadd213pd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm6, %xmm0 #4950.18 + vfmadd213pd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm6, %xmm0 #4950.18 vfnmadd213pd %xmm9, %xmm13, %xmm11 #4953.17 vaddpd %xmm2, %xmm1, %xmm5 #4937.25 vmulpd %xmm0, %xmm6, %xmm1 #4951.18 @@ -2333,20 +2333,20 @@ __svml_sin2_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm2 xmm6 .cfi_endproc # mark_end; - .type __svml_sin2_ha_l9,@function - .size __svml_sin2_ha_l9,.-__svml_sin2_ha_l9 -..LN__svml_sin2_ha_l9.5: + .type __jsvml_sin2_ha_l9,@function + .size __jsvml_sin2_ha_l9,.-__jsvml_sin2_ha_l9 +..LN__jsvml_sin2_ha_l9.5: .data -# -- End __svml_sin2_ha_l9 +# -- End __jsvml_sin2_ha_l9 .text -.L_2__routine_start___svml_sin1_ha_l9_6: -# -- Begin __svml_sin1_ha_l9 +.L_2__routine_start___jsvml_sin1_ha_l9_6: +# -- Begin __jsvml_sin1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sin1_ha_l9 -# --- __svml_sin1_ha_l9(__m128d) -__svml_sin1_ha_l9: + .globl __jsvml_sin1_ha_l9 +# --- __jsvml_sin1_ha_l9(__m128d) +__jsvml_sin1_ha_l9: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -2355,7 +2355,7 @@ __svml_sin1_ha_l9: .byte 30 #5313.18 .byte 250 #5313.18 .cfi_startproc -..___tag_value___svml_sin1_ha_l9.183: +..___tag_value___jsvml_sin1_ha_l9.183: ..L184: #4970.1 pushq %rbp #4970.1 @@ -2366,24 +2366,24 @@ __svml_sin1_ha_l9: andq $-64, %rsp #4970.1 subq $128, %rsp #4970.1 vmovapd %xmm0, %xmm6 #4970.1 - vmovsd 16384+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #5017.19 - lea __svml_dsin_ha_data_internal_ha(%rip), %rcx #5036.371 + vmovsd 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #5017.19 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rcx #5036.371 vandnpd %xmm6, %xmm13, %xmm14 #5018.17 vandpd %xmm13, %xmm6, %xmm13 #5019.12 - vmovsd 16640+__svml_dsin_ha_data_internal_ha(%rip), %xmm7 #5022.20 + vmovsd 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm7 #5022.20 vmovapd %xmm13, %xmm12 #5023.13 - vfmadd132sd 16576+__svml_dsin_ha_data_internal_ha(%rip), %xmm7, %xmm12 #5023.13 + vfmadd132sd 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm7, %xmm12 #5023.13 xorl %eax, %eax #5016.1 - vmovq 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm15 #5034.23 - vmovsd 16832+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #5027.17 + vmovq 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm15 #5034.23 + vmovsd 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #5027.17 vpand %xmm15, %xmm12, %xmm3 #5035.19 vsubsd %xmm7, %xmm12, %xmm5 #5024.13 vmovd %xmm3, %edx #5036.128 vmovapd %xmm5, %xmm8 #5026.14 vmovapd %xmm5, %xmm4 #5028.17 - vfnmadd132sd 16768+__svml_dsin_ha_data_internal_ha(%rip), %xmm13, %xmm8 #5026.14 + vfnmadd132sd 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13, %xmm8 #5026.14 vmovapd %xmm5, %xmm11 #5030.17 - vmovsd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #5049.14 + vmovsd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #5049.14 vfnmadd213sd %xmm8, %xmm9, %xmm4 #5028.17 shll $5, %edx #5036.231 vsubsd %xmm4, %xmm8, %xmm10 #5029.17 @@ -2398,18 +2398,18 @@ __svml_sin1_ha_l9: vaddsd %xmm0, %xmm2, %xmm2 #5052.13 vfmadd213sd %xmm8, %xmm4, %xmm3 #5040.21 vsubsd %xmm8, %xmm1, %xmm7 #5041.18 - vfnmadd132sd 16896+__svml_dsin_ha_data_internal_ha(%rip), %xmm11, %xmm5 #5032.13 + vfnmadd132sd 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11, %xmm5 #5032.13 vmovapd %xmm4, %xmm11 #5042.18 vsubsd %xmm3, %xmm8, %xmm9 #5043.18 vmulsd %xmm4, %xmm4, %xmm8 #5046.15 vfmadd213sd %xmm7, %xmm0, %xmm11 #5042.18 vfmadd213sd %xmm9, %xmm4, %xmm10 #5044.18 - vfmadd213sd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm8, %xmm12 #5049.14 - vmovsd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm0 #5056.14 - vfmadd213sd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm8, %xmm0 #5056.14 + vfmadd213sd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8, %xmm12 #5049.14 + vmovsd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm0 #5056.14 + vfmadd213sd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8, %xmm0 #5056.14 vaddsd %xmm11, %xmm10, %xmm7 #5045.21 vmulsd %xmm8, %xmm12, %xmm15 #5050.14 - vfmadd213sd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm8, %xmm0 #5058.14 + vfmadd213sd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8, %xmm0 #5058.14 vmulsd %xmm4, %xmm15, %xmm9 #5051.14 vfnmadd213sd %xmm2, %xmm1, %xmm4 #5061.13 vmulsd %xmm8, %xmm0, %xmm0 #5059.14 @@ -2418,7 +2418,7 @@ __svml_sin1_ha_l9: vfmadd213sd %xmm9, %xmm1, %xmm0 #5060.17 vaddsd %xmm5, %xmm0, %xmm1 #5064.17 vaddsd %xmm1, %xmm3, %xmm4 #5065.14 - vcmpnlesd 16448+__svml_dsin_ha_data_internal_ha(%rip), %xmm13, %xmm1 #5067.26 + vcmpnlesd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13, %xmm1 #5067.26 vmovmskpd %xmm1, %esi #5069.78 vxorpd %xmm14, %xmm4, %xmm2 #5066.14 testl $1, %esi #5070.55 @@ -2459,20 +2459,20 @@ __svml_sin1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #5316.546 lea 64(%rsp), %rsi #5316.546 -..___tag_value___svml_sin1_ha_l9.192: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #5316.546 -..___tag_value___svml_sin1_ha_l9.193: +..___tag_value___jsvml_sin1_ha_l9.192: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #5316.546 +..___tag_value___jsvml_sin1_ha_l9.193: jmp ..B7.5 # Prob 100% #5316.546 # LOE rbx r12 r13 r14 r15 ..B7.8: # Preds ..B7.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.35(%rip), %xmm13, %xmm15 #5163.18 - lea __svml_dsin_ha_reduction_data_internal(%rip), %rsi #5165.383 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %rsi #5165.383 vpsrlq $52, %xmm15, %xmm12 #5164.18 - lea __svml_dsin_ha_data_internal_ha(%rip), %r8 #5282.375 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %r8 #5282.375 vmovd %xmm12, %edx #5165.124 - vmovsd 16512+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #5073.24 + vmovsd 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #5073.24 vmovupd %xmm6, 32(%rsp) #[spill] vandpd %xmm13, %xmm10, %xmm6 #5074.20 vpand .L_2il0floatpacket.36(%rip), %xmm13, %xmm7 #5173.21 @@ -2570,8 +2570,8 @@ __svml_sin1_ha_l9: vmulsd %xmm15, %xmm12, %xmm5 #5268.13 vandpd %xmm13, %xmm4, %xmm13 #5277.24 vfmsub213sd %xmm5, %xmm15, %xmm0 #5269.13 - vmovsd 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm4 #5295.18 - vmovsd 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #5302.18 + vmovsd 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm4 #5295.18 + vmovsd 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #5302.18 vfmadd132sd .L_2il0floatpacket.72(%rip), %xmm0, %xmm12 #5270.13 vandpd %xmm5, %xmm6, %xmm0 #5278.25 vfmadd213sd %xmm12, %xmm15, %xmm8 #5271.13 @@ -2588,12 +2588,12 @@ __svml_sin1_ha_l9: vmovq (%rdi,%r8), %xmm6 #5282.375 vmovdqa %xmm6, %xmm15 #5286.25 vmovdqa %xmm6, %xmm2 #5290.22 - vfmadd213sd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm4 #5295.18 - vfmadd213sd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm9 #5302.18 + vfmadd213sd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm4 #5295.18 + vfmadd213sd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm9 #5302.18 vfmadd213sd %xmm1, %xmm12, %xmm15 #5286.25 vsubsd %xmm1, %xmm13, %xmm7 #5287.22 vmulsd %xmm10, %xmm4, %xmm5 #5296.18 - vfmadd213sd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm9 #5304.18 + vfmadd213sd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10, %xmm9 #5304.18 vfmadd132sd 8(%r8,%rdi), %xmm7, %xmm3 #5288.22 vsubsd %xmm15, %xmm1, %xmm7 #5289.22 vaddsd 8(%r8,%rdi), %xmm6, %xmm1 #5298.17 @@ -2617,20 +2617,20 @@ __svml_sin1_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm2 xmm6 .cfi_endproc # mark_end; - .type __svml_sin1_ha_l9,@function - .size __svml_sin1_ha_l9,.-__svml_sin1_ha_l9 -..LN__svml_sin1_ha_l9.6: + .type __jsvml_sin1_ha_l9,@function + .size __jsvml_sin1_ha_l9,.-__jsvml_sin1_ha_l9 +..LN__jsvml_sin1_ha_l9.6: .data -# -- End __svml_sin1_ha_l9 +# -- End __jsvml_sin1_ha_l9 .text -.L_2__routine_start___svml_sin2_ha_ex_7: -# -- Begin __svml_sin2_ha_ex +.L_2__routine_start___jsvml_sin2_ha_ex_7: +# -- Begin __jsvml_sin2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_sin2_ha_ex -# --- __svml_sin2_ha_ex(__m128d) -__svml_sin2_ha_ex: + .globl __jsvml_sin2_ha_ex +# --- __jsvml_sin2_ha_ex(__m128d) +__jsvml_sin2_ha_ex: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -2639,7 +2639,7 @@ __svml_sin2_ha_ex: .byte 30 #5683.18 .byte 250 #5683.18 .cfi_startproc -..___tag_value___svml_sin2_ha_ex.201: +..___tag_value___jsvml_sin2_ha_ex.201: ..L202: #5324.1 pushq %rbp #5324.1 @@ -2650,31 +2650,31 @@ __svml_sin2_ha_ex: andq $-64, %rsp #5324.1 subq $192, %rsp #5324.1 movaps %xmm0, %xmm7 #5324.1 - movups 16384+__svml_dsin_ha_data_internal_ha(%rip), %xmm1 #5371.50 - lea __svml_dsin_ha_data_internal_ha(%rip), %rax #5391.370 - movups 16576+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #5377.25 + movups 16384+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm1 #5371.50 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rax #5391.370 + movups 16576+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #5377.25 movaps %xmm1, %xmm2 #5372.17 andps %xmm7, %xmm1 #5373.12 andnps %xmm7, %xmm2 #5372.17 mulpd %xmm1, %xmm13 #5377.25 - movups 16640+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #5376.51 + movups 16640+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #5376.51 movaps %xmm1, %xmm6 #5380.14 addpd %xmm8, %xmm13 #5377.13 movaps %xmm13, %xmm11 #5378.13 xorl %edx, %edx #5370.1 subpd %xmm8, %xmm11 #5378.13 - movups 16768+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #5379.48 + movups 16768+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #5379.48 mulpd %xmm11, %xmm9 #5380.36 - movups 16832+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #5382.19 + movups 16832+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #5382.19 mulpd %xmm11, %xmm10 #5382.19 subpd %xmm9, %xmm6 #5380.14 movaps %xmm6, %xmm5 #5383.17 subpd %xmm10, %xmm5 #5383.17 - andps 16704+__svml_dsin_ha_data_internal_ha(%rip), %xmm13 #5390.17 + andps 16704+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm13 #5390.17 movaps %xmm5, %xmm3 #5395.22 movd %xmm13, %ecx #5391.128 movaps %xmm5, %xmm8 #5394.19 - movups 16896+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #5386.50 + movups 16896+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #5386.50 subpd %xmm5, %xmm6 #5384.17 mulpd %xmm11, %xmm12 #5387.32 pextrw $4, %xmm13, %esi #5391.184 @@ -2688,24 +2688,24 @@ __svml_sin2_ha_ex: movhpd 8(%rsi,%rax), %xmm9 #5392.569 mulpd %xmm9, %xmm3 #5395.22 movq 16(%rcx,%rax), %xmm12 #5393.599 - movups 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #5413.26 + movups 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #5413.26 movhpd 16(%rsi,%rax), %xmm12 #5393.567 mulpd %xmm11, %xmm10 #5413.26 movaps %xmm12, %xmm15 #5396.22 movaps %xmm12, %xmm14 #5398.18 addpd %xmm3, %xmm15 #5396.22 - addpd 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #5413.14 + addpd 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #5413.14 subpd %xmm15, %xmm14 #5398.18 mulpd %xmm11, %xmm10 #5415.26 addpd %xmm14, %xmm3 #5399.18 - addpd 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #5415.14 - movups 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm14 #5406.26 + addpd 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #5415.14 + movups 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm14 #5406.26 movaps %xmm15, %xmm0 #5397.21 mulpd %xmm11, %xmm14 #5406.26 movq (%rcx,%rax), %xmm4 #5391.599 movhpd (%rsi,%rax), %xmm4 #5391.567 mulpd %xmm4, %xmm8 #5394.19 - addpd 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm14 #5406.14 + addpd 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm14 #5406.14 addpd %xmm8, %xmm0 #5397.21 addpd %xmm9, %xmm4 #5409.13 mulpd %xmm11, %xmm14 #5407.14 @@ -2728,7 +2728,7 @@ __svml_sin2_ha_ex: addpd %xmm3, %xmm0 #5422.14 movaps %xmm1, %xmm3 #5424.26 pxor %xmm2, %xmm0 #5423.14 - cmpnlepd 16448+__svml_dsin_ha_data_internal_ha(%rip), %xmm3 #5424.26 + cmpnlepd 16448+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm3 #5424.26 movmskpd %xmm3, %edi #5426.78 testl %edi, %edi #5427.66 jne ..B8.12 # Prob 5% #5427.66 @@ -2790,10 +2790,10 @@ __svml_sin2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #5686.546 lea 128(%rsp,%r12,8), %rsi #5686.546 -..___tag_value___svml_sin2_ha_ex.219: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #5686.546 -..___tag_value___svml_sin2_ha_ex.220: +..___tag_value___jsvml_sin2_ha_ex.219: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #5686.546 +..___tag_value___jsvml_sin2_ha_ex.220: jmp ..B8.9 # Prob 100% #5686.546 .cfi_restore 12 .cfi_restore 13 @@ -2801,10 +2801,10 @@ __svml_sin2_ha_ex: ..B8.12: # Preds ..B8.1 # Execution count [5.00e-02]: Infreq movdqu .L_2il0floatpacket.35(%rip), %xmm10 #5520.16 - lea __svml_dsin_ha_reduction_data_internal(%rip), %r9 #5522.372 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %r9 #5522.372 pand %xmm1, %xmm10 #5520.16 psrlq $52, %xmm10 #5521.16 - movups 16512+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #5430.55 + movups 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #5430.55 movd %xmm10, %ecx #5522.124 movups %xmm0, 16(%rsp) #[spill] movaps %xmm8, %xmm0 #5431.20 @@ -2970,9 +2970,9 @@ __svml_sin2_ha_ex: addpd %xmm1, %xmm12 #5655.26 subpd %xmm12, %xmm9 #5657.22 addpd %xmm9, %xmm1 #5658.22 - movups 17024+__svml_dsin_ha_data_internal_ha(%rip), %xmm9 #5665.30 + movups 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm9 #5665.30 movaps %xmm12, %xmm5 #5656.25 - movups 17216+__svml_dsin_ha_data_internal_ha(%rip), %xmm10 #5672.30 + movups 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm10 #5672.30 movq (%r10,%rax), %xmm4 #5650.603 mulpd %xmm14, %xmm9 #5665.30 mulpd %xmm14, %xmm10 #5672.30 @@ -2980,8 +2980,8 @@ __svml_sin2_ha_ex: mulpd %xmm4, %xmm13 #5653.23 addpd %xmm0, %xmm4 #5668.17 addpd %xmm13, %xmm5 #5656.25 - movups 16960+__svml_dsin_ha_data_internal_ha(%rip), %xmm8 #5665.18 - movups 17152+__svml_dsin_ha_data_internal_ha(%rip), %xmm11 #5672.18 + movups 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm8 #5665.18 + movups 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm11 #5672.18 addpd %xmm9, %xmm8 #5665.18 addpd %xmm10, %xmm11 #5672.18 subpd %xmm5, %xmm12 #5659.22 @@ -2995,7 +2995,7 @@ __svml_sin2_ha_ex: addpd %xmm13, %xmm1 #5661.25 mulpd %xmm4, %xmm6 #5679.32 addpd %xmm8, %xmm1 #5669.21 - movups 17088+__svml_dsin_ha_data_internal_ha(%rip), %xmm12 #5674.18 + movups 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %xmm12 #5674.18 addpd %xmm11, %xmm12 #5674.18 mulpd %xmm12, %xmm14 #5675.18 mulpd %xmm3, %xmm14 #5676.33 @@ -3017,20 +3017,20 @@ __svml_sin2_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 xmm7 .cfi_endproc # mark_end; - .type __svml_sin2_ha_ex,@function - .size __svml_sin2_ha_ex,.-__svml_sin2_ha_ex -..LN__svml_sin2_ha_ex.7: + .type __jsvml_sin2_ha_ex,@function + .size __jsvml_sin2_ha_ex,.-__jsvml_sin2_ha_ex +..LN__jsvml_sin2_ha_ex.7: .data -# -- End __svml_sin2_ha_ex +# -- End __jsvml_sin2_ha_ex .text -.L_2__routine_start___svml_sin8_ha_z0_8: -# -- Begin __svml_sin8_ha_z0 +.L_2__routine_start___jsvml_sin8_ha_z0_8: +# -- Begin __jsvml_sin8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_sin8_ha_z0 -# --- __svml_sin8_ha_z0(__m512d) -__svml_sin8_ha_z0: + .globl __jsvml_sin8_ha_z0 +# --- __jsvml_sin8_ha_z0(__m512d) +__jsvml_sin8_ha_z0: # parameter 1: %zmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -3039,7 +3039,7 @@ __svml_sin8_ha_z0: .byte 30 #6081.18 .byte 250 #6081.18 .cfi_startproc -..___tag_value___svml_sin8_ha_z0.230: +..___tag_value___jsvml_sin8_ha_z0.230: ..L231: #5694.1 pushq %rbp #5694.1 @@ -3050,25 +3050,25 @@ __svml_sin8_ha_z0: andq $-64, %rsp #5694.1 subq $192, %rsp #5694.1 xorl %esi, %esi #5775.5 - vmovups 192+__svml_dsin_ha_data_internal(%rip), %zmm9 #5780.52 - vmovups 128+__svml_dsin_ha_data_internal(%rip), %zmm7 #5781.13 - vmovups 256+__svml_dsin_ha_data_internal(%rip), %zmm10 #5788.51 - vmovups 320+__svml_dsin_ha_data_internal(%rip), %zmm1 #5789.51 - vmovups 384+__svml_dsin_ha_data_internal(%rip), %zmm15 #5790.51 - vmovups 64+__svml_dsin_ha_data_internal(%rip), %zmm5 #5777.61 - vmovups 640+__svml_dsin_ha_data_internal(%rip), %zmm2 #5794.270 - vmovups 512+__svml_dsin_ha_data_internal(%rip), %zmm3 #5793.270 - vmovups 768+__svml_dsin_ha_data_internal(%rip), %zmm6 #5795.273 + vmovups 192+__jsvml_dsin_ha_data_internal(%rip), %zmm9 #5780.52 + vmovups 128+__jsvml_dsin_ha_data_internal(%rip), %zmm7 #5781.13 + vmovups 256+__jsvml_dsin_ha_data_internal(%rip), %zmm10 #5788.51 + vmovups 320+__jsvml_dsin_ha_data_internal(%rip), %zmm1 #5789.51 + vmovups 384+__jsvml_dsin_ha_data_internal(%rip), %zmm15 #5790.51 + vmovups 64+__jsvml_dsin_ha_data_internal(%rip), %zmm5 #5777.61 + vmovups 640+__jsvml_dsin_ha_data_internal(%rip), %zmm2 #5794.270 + vmovups 512+__jsvml_dsin_ha_data_internal(%rip), %zmm3 #5793.270 + vmovups 768+__jsvml_dsin_ha_data_internal(%rip), %zmm6 #5795.273 vmovaps %zmm0, %zmm8 #5694.1 vfmadd213pd {rn-sae}, %zmm9, %zmm8, %zmm7 #5781.13 - vmovups 1024+__svml_dsin_ha_data_internal(%rip), %zmm0 #5805.50 - vpcmpeqq 896+__svml_dsin_ha_data_internal(%rip), %zmm8, %k2 #5787.19 + vmovups 1024+__jsvml_dsin_ha_data_internal(%rip), %zmm0 #5805.50 + vpcmpeqq 896+__jsvml_dsin_ha_data_internal(%rip), %zmm8, %k2 #5787.19 vsubpd {rn-sae}, %zmm9, %zmm7, %zmm14 #5784.15 - vandpd __svml_dsin_ha_data_internal(%rip), %zmm8, %zmm11 #5778.16 - vpermt2pd 704+__svml_dsin_ha_data_internal(%rip), %zmm7, %zmm2 #5794.270 - vpermt2pd 576+__svml_dsin_ha_data_internal(%rip), %zmm7, %zmm3 #5793.270 - vpermt2pd 832+__svml_dsin_ha_data_internal(%rip), %zmm7, %zmm6 #5795.273 - vxorpd 960+__svml_dsin_ha_data_internal(%rip), %zmm7, %zmm7{%k2} #5797.17 + vandpd __jsvml_dsin_ha_data_internal(%rip), %zmm8, %zmm11 #5778.16 + vpermt2pd 704+__jsvml_dsin_ha_data_internal(%rip), %zmm7, %zmm2 #5794.270 + vpermt2pd 576+__jsvml_dsin_ha_data_internal(%rip), %zmm7, %zmm3 #5793.270 + vpermt2pd 832+__jsvml_dsin_ha_data_internal(%rip), %zmm7, %zmm6 #5795.273 + vxorpd 960+__jsvml_dsin_ha_data_internal(%rip), %zmm7, %zmm7{%k2} #5797.17 vfnmadd213pd {rn-sae}, %zmm8, %zmm14, %zmm10 #5791.18 vcmppd $22, {sae}, %zmm5, %zmm11, %k1 #5782.30 vpsrlq $4, %zmm7, %zmm7 #5831.44 @@ -3078,24 +3078,24 @@ __svml_sin8_ha_z0: vmovaps %zmm15, %zmm4 #5799.17 vfnmadd213pd {rn-sae}, %zmm13, %zmm14, %zmm4 #5799.17 vsubpd {rn-sae}, %zmm13, %zmm10, %zmm12 #5800.21 - vmovups 1088+__svml_dsin_ha_data_internal(%rip), %zmm10 #5807.21 + vmovups 1088+__jsvml_dsin_ha_data_internal(%rip), %zmm10 #5807.21 vmulpd {rn-sae}, %zmm4, %zmm4, %zmm5 #5801.21 vfnmadd231pd {rn-sae}, %zmm14, %zmm1, %zmm12 #5803.18 vsubpd {rn-sae}, %zmm13, %zmm4, %zmm13 #5802.21 vfmadd231pd {rn-sae}, %zmm5, %zmm0, %zmm10 #5807.21 - vmovups 1216+__svml_dsin_ha_data_internal(%rip), %zmm0 #5811.21 + vmovups 1216+__jsvml_dsin_ha_data_internal(%rip), %zmm0 #5811.21 vfmadd213pd {rn-sae}, %zmm13, %zmm15, %zmm14 #5808.19 - vmovups 1152+__svml_dsin_ha_data_internal(%rip), %zmm15 #5809.50 - vmovups 1280+__svml_dsin_ha_data_internal(%rip), %zmm13 #5813.50 + vmovups 1152+__jsvml_dsin_ha_data_internal(%rip), %zmm15 #5809.50 + vmovups 1280+__jsvml_dsin_ha_data_internal(%rip), %zmm13 #5813.50 vsubpd {rn-sae}, %zmm14, %zmm12, %zmm14 #5815.20 vfmadd231pd {rn-sae}, %zmm5, %zmm15, %zmm0 #5811.21 vfmadd213pd {rn-sae}, %zmm13, %zmm5, %zmm10 #5814.21 - vmovups 1408+__svml_dsin_ha_data_internal(%rip), %zmm15 #5820.50 - vmovups 1344+__svml_dsin_ha_data_internal(%rip), %zmm12 #5816.50 + vmovups 1408+__jsvml_dsin_ha_data_internal(%rip), %zmm15 #5820.50 + vmovups 1344+__jsvml_dsin_ha_data_internal(%rip), %zmm12 #5816.50 vpsllq $32, %zmm6, %zmm13 #5819.39 vfmadd213pd {rn-sae}, %zmm15, %zmm5, %zmm10 #5821.21 vfmadd213pd {rn-sae}, %zmm12, %zmm5, %zmm0 #5817.21 - vmovups 1472+__svml_dsin_ha_data_internal(%rip), %zmm15 #5823.50 + vmovups 1472+__jsvml_dsin_ha_data_internal(%rip), %zmm15 #5823.50 vmovaps %zmm2, %zmm9 #5804.20 vfmadd213pd {rn-sae}, %zmm3, %zmm4, %zmm9 #5804.20 vfmadd213pd {rn-sae}, %zmm15, %zmm5, %zmm0 #5824.21 @@ -3227,10 +3227,10 @@ __svml_sin8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #6084.759 lea 128(%rsp,%rbx,8), %rsi #6084.759 -..___tag_value___svml_sin8_ha_z0.258: -# __svml_dsin_ha_cout_rare_internal(const double *, double *) - call __svml_dsin_ha_cout_rare_internal #6084.759 -..___tag_value___svml_sin8_ha_z0.259: +..___tag_value___jsvml_sin8_ha_z0.258: +# __jsvml_dsin_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsin_ha_cout_rare_internal #6084.759 +..___tag_value___jsvml_sin8_ha_z0.259: jmp ..B9.14 # Prob 100% #6084.759 .cfi_restore 3 .cfi_restore 12 @@ -3239,8 +3239,8 @@ __svml_sin8_ha_z0: # LOE r15 ebx r12d r13d r14d ..B9.17: # Preds ..B9.1 # Execution count [5.00e-02]: Infreq - vmovups 16512+__svml_dsin_ha_data_internal_ha(%rip), %zmm1 #5841.56 - lea __svml_dsin_ha_reduction_data_internal(%rip), %rax #5933.406 + vmovups 16512+__jsvml_dsin_ha_data_internal_ha(%rip), %zmm1 #5841.56 + lea __jsvml_dsin_ha_reduction_data_internal(%rip), %rax #5933.406 vmovups %zmm8, 64(%rsp) #[spill] vmovups %zmm0, (%rsp) #[spill] vandpd %zmm11, %zmm1, %zmm6 #5842.20 @@ -3249,7 +3249,7 @@ __svml_sin8_ha_z0: vcmppd $4, {sae}, %zmm1, %zmm6, %k2 #5843.122 vmovups %zmm8, 128(%rsp) #5840.17[spill] vmovaps %zmm10, %zmm5 #5843.46 - lea __svml_dsin_ha_data_internal_ha(%rip), %rdx #6050.210 + lea __jsvml_dsin_ha_data_internal_ha(%rip), %rdx #6050.210 vpandq .L_2il0floatpacket.74(%rip){1to8}, %zmm11, %zmm4 #5931.16 vpandnq %zmm6, %zmm6, %zmm5{%k2} #5843.46 vpsrlq $52, %zmm4, %zmm3 #5932.18 @@ -3360,7 +3360,7 @@ __svml_sin8_ha_z0: vpbroadcastq .L_2il0floatpacket.87(%rip), %zmm5 #6035.38 vfmadd213pd {rn-sae}, %zmm3, %zmm5, %zmm12 #6038.13 vfmadd213pd {rn-sae}, %zmm12, %zmm4, %zmm6 #6039.13 - vmovups 16960+__svml_dsin_ha_data_internal_ha(%rip), %zmm4 #6062.50 + vmovups 16960+__jsvml_dsin_ha_data_internal_ha(%rip), %zmm4 #6062.50 vpandnq %zmm14, %zmm14, %zmm10{%k7} #6044.41 vandpd %zmm11, %zmm10, %zmm11 #6045.24 vpsllq $5, %zmm0, %zmm10 #6050.78 @@ -3369,8 +3369,8 @@ __svml_sin8_ha_z0: vandpd %zmm6, %zmm1, %zmm1 #6048.9 vpmovqd %zmm10, %ymm6 #6050.160 vorpd %zmm8, %zmm11, %zmm7 #6047.9 - vmovups 17216+__svml_dsin_ha_data_internal_ha(%rip), %zmm14 #6068.50 - vmovups 17088+__svml_dsin_ha_data_internal_ha(%rip), %zmm15 #6071.50 + vmovups 17216+__jsvml_dsin_ha_data_internal_ha(%rip), %zmm14 #6068.50 + vmovups 17088+__jsvml_dsin_ha_data_internal_ha(%rip), %zmm15 #6071.50 vmulpd {rn-sae}, %zmm7, %zmm7, %zmm11 #6060.21 vmovaps %zmm7, %zmm0 #6053.26 vmovaps %zmm7, %zmm8 #6054.25 @@ -3385,7 +3385,7 @@ __svml_sin8_ha_z0: vgatherdpd (%rdx,%ymm6), %zmm9{%k2} #6050.210 vfmadd132pd {rn-sae}, %zmm9, %zmm0, %zmm8 #6054.25 vsubpd {rn-sae}, %zmm8, %zmm0, %zmm2 #6057.24 - vmovups 17024+__svml_dsin_ha_data_internal_ha(%rip), %zmm0 #6061.50 + vmovups 17024+__jsvml_dsin_ha_data_internal_ha(%rip), %zmm0 #6061.50 vfmadd231pd {rn-sae}, %zmm9, %zmm7, %zmm2 #6058.22 vfmadd231pd {rn-sae}, %zmm11, %zmm0, %zmm4 #6063.18 vaddpd {rn-sae}, %zmm3, %zmm2, %zmm13 #6059.27 @@ -3394,7 +3394,7 @@ __svml_sin8_ha_z0: vmulpd {rn-sae}, %zmm7, %zmm5, %zmm0 #6065.20 vfnmadd213pd {rn-sae}, %zmm2, %zmm10, %zmm7 #6075.17 vfmadd213pd {rn-sae}, %zmm13, %zmm2, %zmm0 #6067.21 - vmovups 17152+__svml_dsin_ha_data_internal_ha(%rip), %zmm13 #6069.50 + vmovups 17152+__jsvml_dsin_ha_data_internal_ha(%rip), %zmm13 #6069.50 vfmadd231pd {rn-sae}, %zmm11, %zmm14, %zmm13 #6070.18 vfmadd213pd {rn-sae}, %zmm15, %zmm11, %zmm13 #6072.18 vmulpd {rn-sae}, %zmm11, %zmm13, %zmm3 #6073.20 @@ -3412,21 +3412,21 @@ __svml_sin8_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm8 .cfi_endproc # mark_end; - .type __svml_sin8_ha_z0,@function - .size __svml_sin8_ha_z0,.-__svml_sin8_ha_z0 -..LN__svml_sin8_ha_z0.8: + .type __jsvml_sin8_ha_z0,@function + .size __jsvml_sin8_ha_z0,.-__jsvml_sin8_ha_z0 +..LN__jsvml_sin8_ha_z0.8: .data -# -- End __svml_sin8_ha_z0 +# -- End __jsvml_sin8_ha_z0 .text -.L_2__routine_start___svml_dsin_ha_cout_rare_internal_9: -# -- Begin __svml_dsin_ha_cout_rare_internal +.L_2__routine_start___jsvml_dsin_ha_cout_rare_internal_9: +# -- Begin __jsvml_dsin_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dsin_ha_cout_rare_internal - .globl __svml_dsin_ha_cout_rare_internal -# --- __svml_dsin_ha_cout_rare_internal(const double *, double *) -__svml_dsin_ha_cout_rare_internal: + .hidden __jsvml_dsin_ha_cout_rare_internal + .globl __jsvml_dsin_ha_cout_rare_internal +# --- __jsvml_dsin_ha_cout_rare_internal(const double *, double *) +__jsvml_dsin_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -3436,7 +3436,7 @@ __svml_dsin_ha_cout_rare_internal: .byte 30 #2762.12 .byte 250 #2762.12 .cfi_startproc -..___tag_value___svml_dsin_ha_cout_rare_internal.271: +..___tag_value___jsvml_dsin_ha_cout_rare_internal.271: ..L272: #2743.1 movzwl 6(%rdi), %eax #2748.32 @@ -3482,17 +3482,17 @@ __svml_dsin_ha_cout_rare_internal: # LOE .cfi_endproc # mark_end; - .type __svml_dsin_ha_cout_rare_internal,@function - .size __svml_dsin_ha_cout_rare_internal,.-__svml_dsin_ha_cout_rare_internal -..LN__svml_dsin_ha_cout_rare_internal.9: + .type __jsvml_dsin_ha_cout_rare_internal,@function + .size __jsvml_dsin_ha_cout_rare_internal,.-__jsvml_dsin_ha_cout_rare_internal +..LN__jsvml_dsin_ha_cout_rare_internal.9: .data -# -- End __svml_dsin_ha_cout_rare_internal +# -- End __jsvml_dsin_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dsin_ha_reduction_data_internal - .globl __svml_dsin_ha_reduction_data_internal -__svml_dsin_ha_reduction_data_internal: + .hidden __jsvml_dsin_ha_reduction_data_internal + .globl __jsvml_dsin_ha_reduction_data_internal +__jsvml_dsin_ha_reduction_data_internal: .long 0 .long 0 .long 0 @@ -15781,13 +15781,13 @@ __svml_dsin_ha_reduction_data_internal: .long 484957737 .long 896803160 .long 3984508030 - .type __svml_dsin_ha_reduction_data_internal,@object - .size __svml_dsin_ha_reduction_data_internal,49152 + .type __jsvml_dsin_ha_reduction_data_internal,@object + .size __jsvml_dsin_ha_reduction_data_internal,49152 .space 512, 0x00 # pad .align 64 - .hidden __svml_dsin_ha_data_internal_ha - .globl __svml_dsin_ha_data_internal_ha -__svml_dsin_ha_data_internal_ha: + .hidden __jsvml_dsin_ha_data_internal_ha + .globl __jsvml_dsin_ha_data_internal_ha +__jsvml_dsin_ha_data_internal_ha: .long 0 .long 0 .long 0 @@ -20108,12 +20108,12 @@ __svml_dsin_ha_data_internal_ha: .long 3210133866 .long 2976101079 .long 3210133866 - .type __svml_dsin_ha_data_internal_ha,@object - .size __svml_dsin_ha_data_internal_ha,17280 + .type __jsvml_dsin_ha_data_internal_ha,@object + .size __jsvml_dsin_ha_data_internal_ha,17280 .align 64 - .hidden __svml_dsin_ha_data_internal - .globl __svml_dsin_ha_data_internal -__svml_dsin_ha_data_internal: + .hidden __jsvml_dsin_ha_data_internal + .globl __jsvml_dsin_ha_data_internal +__jsvml_dsin_ha_data_internal: .long 4294967295 .long 2147483647 .long 4294967295 @@ -20498,8 +20498,8 @@ __svml_dsin_ha_data_internal: .long 3217380693 .long 1431655765 .long 3217380693 - .type __svml_dsin_ha_data_internal,@object - .size __svml_dsin_ha_data_internal,1536 + .type __jsvml_dsin_ha_data_internal,@object + .size __jsvml_dsin_ha_data_internal,1536 .align 32 .L_2il0floatpacket.53: .long 0x00000000,0x7ff00000,0x00000000,0x7ff00000,0x00000000,0x7ff00000,0x00000000,0x7ff00000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_sinh_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_sinh_linux_x86.S similarity index 91% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_sinh_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_sinh_linux_x86.S index 4db1cc68481..3bdcf11c7cf 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_sinh_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_sinh_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_sinh.c" .text ..TXTST0: -.L_2__routine_start___svml_sinh1_ha_e9_0: -# -- Begin __svml_sinh1_ha_e9 +.L_2__routine_start___jsvml_sinh1_ha_e9_0: +# -- Begin __jsvml_sinh1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh1_ha_e9 -# --- __svml_sinh1_ha_e9(__m128d) -__svml_sinh1_ha_e9: + .globl __jsvml_sinh1_ha_e9 +# --- __jsvml_sinh1_ha_e9(__m128d) +__jsvml_sinh1_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_sinh1_ha_e9: .byte 30 #527.546 .byte 250 #527.546 .cfi_startproc -..___tag_value___svml_sinh1_ha_e9.1: +..___tag_value___jsvml_sinh1_ha_e9.1: ..L2: #420.1 pushq %rbp #420.1 @@ -58,24 +58,24 @@ __svml_sinh1_ha_e9: andq $-64, %rsp #420.1 subq $128, %rsp #420.1 movaps %xmm0, %xmm11 #420.1 - movsd 1408+__svml_dsinh_ha_data_internal(%rip), %xmm8 #465.16 + movsd 1408+__jsvml_dsinh_ha_data_internal(%rip), %xmm8 #465.16 movl $1082453555, %eax #471.27 movaps %xmm8, %xmm10 #466.17 - lea __svml_dsinh_ha_data_internal(%rip), %rcx #480.15 + lea __jsvml_dsinh_ha_data_internal(%rip), %rcx #480.15 andps %xmm11, %xmm10 #466.17 movaps %xmm10, %xmm7 #467.16 pxor %xmm11, %xmm7 #467.16 movd %eax, %xmm12 #471.27 movaps %xmm7, %xmm9 #468.25 - mulsd 1216+__svml_dsinh_ha_data_internal(%rip), %xmm9 #468.25 - movsd 512+__svml_dsinh_ha_data_internal(%rip), %xmm6 #455.20 - movsd 576+__svml_dsinh_ha_data_internal(%rip), %xmm0 #474.24 + mulsd 1216+__jsvml_dsinh_ha_data_internal(%rip), %xmm9 #468.25 + movsd 512+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #455.20 + movsd 576+__jsvml_dsinh_ha_data_internal(%rip), %xmm0 #474.24 addsd %xmm6, %xmm9 #468.13 pshufd $85, %xmm7, %xmm13 #470.22 cmpeqsd %xmm9, %xmm0 #474.24 blendvpd %xmm0, %xmm6, %xmm9 #475.21 pcmpgtd %xmm12, %xmm13 #471.27 - movq 704+__svml_dsinh_ha_data_internal(%rip), %xmm12 #477.23 + movq 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm12 #477.23 movaps %xmm9, %xmm1 #484.13 pand %xmm9, %xmm12 #477.23 subsd %xmm6, %xmm1 #484.13 @@ -85,8 +85,8 @@ __svml_sinh1_ha_e9: psllq $3, %xmm14 #479.27 psllq $48, %xmm9 #490.19 movd %xmm14, %edx #480.107 - movsd 1280+__svml_dsinh_ha_data_internal(%rip), %xmm15 #486.35 - movsd 1344+__svml_dsinh_ha_data_internal(%rip), %xmm6 #488.32 + movsd 1280+__jsvml_dsinh_ha_data_internal(%rip), %xmm15 #486.35 + movsd 1344+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #488.32 movslq %edx, %rdx #480.107 mulsd %xmm1, %xmm15 #486.35 mulsd %xmm1, %xmm6 #488.32 @@ -113,23 +113,23 @@ __svml_sinh1_ha_e9: mulsd %xmm13, %xmm7 #520.15 paddq %xmm9, %xmm5 #500.23 addsd %xmm2, %xmm4 #510.22 - movsd 1088+__svml_dsinh_ha_data_internal(%rip), %xmm3 #513.29 + movsd 1088+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #513.29 subsd %xmm4, %xmm5 #511.26 mulsd %xmm1, %xmm3 #513.29 subsd %xmm8, %xmm5 #512.26 - addsd 960+__svml_dsinh_ha_data_internal(%rip), %xmm3 #513.17 - movsd 1152+__svml_dsinh_ha_data_internal(%rip), %xmm4 #514.31 + addsd 960+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #513.17 + movsd 1152+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #514.31 mulsd %xmm1, %xmm4 #514.31 mulsd %xmm1, %xmm3 #515.29 - addsd 1024+__svml_dsinh_ha_data_internal(%rip), %xmm4 #514.19 - addsd 832+__svml_dsinh_ha_data_internal(%rip), %xmm3 #515.17 + addsd 1024+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #514.19 + addsd 832+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #515.17 mulsd %xmm1, %xmm4 #516.31 mulsd %xmm1, %xmm3 #518.13 - addsd 896+__svml_dsinh_ha_data_internal(%rip), %xmm4 #516.19 + addsd 896+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #516.19 mulsd %xmm7, %xmm3 #521.32 mulsd %xmm1, %xmm4 #517.31 addsd %xmm5, %xmm3 #521.20 - addsd 768+__svml_dsinh_ha_data_internal(%rip), %xmm4 #517.19 + addsd 768+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #517.19 mulsd %xmm1, %xmm4 #519.15 mulsd %xmm14, %xmm4 #522.29 addsd %xmm3, %xmm4 #522.17 @@ -165,29 +165,29 @@ __svml_sinh1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #527.546 lea 64(%rsp), %rsi #527.546 -..___tag_value___svml_sinh1_ha_e9.10: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #527.546 -..___tag_value___svml_sinh1_ha_e9.11: +..___tag_value___jsvml_sinh1_ha_e9.10: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #527.546 +..___tag_value___jsvml_sinh1_ha_e9.11: jmp ..B1.4 # Prob 100% #527.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_sinh1_ha_e9,@function - .size __svml_sinh1_ha_e9,.-__svml_sinh1_ha_e9 -..LN__svml_sinh1_ha_e9.0: + .type __jsvml_sinh1_ha_e9,@function + .size __jsvml_sinh1_ha_e9,.-__jsvml_sinh1_ha_e9 +..LN__jsvml_sinh1_ha_e9.0: .data -# -- End __svml_sinh1_ha_e9 +# -- End __jsvml_sinh1_ha_e9 .text -.L_2__routine_start___svml_sinh4_ha_e9_1: -# -- Begin __svml_sinh4_ha_e9 +.L_2__routine_start___jsvml_sinh4_ha_e9_1: +# -- Begin __jsvml_sinh4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh4_ha_e9 -# --- __svml_sinh4_ha_e9(__m256d) -__svml_sinh4_ha_e9: + .globl __jsvml_sinh4_ha_e9 +# --- __jsvml_sinh4_ha_e9(__m256d) +__jsvml_sinh4_ha_e9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -196,7 +196,7 @@ __svml_sinh4_ha_e9: .byte 30 #642.552 .byte 250 #642.552 .cfi_startproc -..___tag_value___svml_sinh4_ha_e9.13: +..___tag_value___jsvml_sinh4_ha_e9.13: ..L14: #535.1 pushq %rbp #535.1 @@ -206,17 +206,17 @@ __svml_sinh4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #535.1 subq $192, %rsp #535.1 - lea __svml_dsinh_ha_data_internal(%rip), %r8 #595.78 - vmovupd 1408+__svml_dsinh_ha_data_internal(%rip), %ymm3 #580.50 + lea __jsvml_dsinh_ha_data_internal(%rip), %r8 #595.78 + vmovupd 1408+__jsvml_dsinh_ha_data_internal(%rip), %ymm3 #580.50 vmovupd %ymm0, (%rsp) #535.1[spill] - vmovupd 512+__svml_dsinh_ha_data_internal(%rip), %ymm15 #570.54 - vmovupd 704+__svml_dsinh_ha_data_internal(%rip), %xmm11 #571.27 + vmovupd 512+__jsvml_dsinh_ha_data_internal(%rip), %ymm15 #570.54 + vmovupd 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm11 #571.27 vandpd %ymm0, %ymm3, %ymm6 #581.17 vxorpd %ymm0, %ymm6, %ymm0 #582.16 - vmulpd 1216+__svml_dsinh_ha_data_internal(%rip), %ymm0, %ymm5 #583.28 + vmulpd 1216+__jsvml_dsinh_ha_data_internal(%rip), %ymm0, %ymm5 #583.28 vmovupd %ymm6, 32(%rsp) #581.17[spill] vaddpd %ymm5, %ymm15, %ymm1 #583.13 - vcmpeqpd 576+__svml_dsinh_ha_data_internal(%rip), %ymm1, %ymm12 #589.24 + vcmpeqpd 576+__jsvml_dsinh_ha_data_internal(%rip), %ymm1, %ymm12 #589.24 vblendvpd %ymm12, %ymm15, %ymm1, %ymm2 #590.21 vpand %xmm11, %xmm2, %xmm5 #592.23 vextractf128 $1, %ymm2, %xmm4 #591.104 @@ -239,8 +239,8 @@ __svml_sinh4_ha_e9: vmovsd (%rsi,%r8), %xmm11 #595.366 vpsllq $48, %xmm2, %xmm2 #605.19 vmovsd 128(%rdx,%r8), %xmm12 #597.82 - vmulpd 1280+__svml_dsinh_ha_data_internal(%rip), %ymm1, %ymm15 #601.38 - vmulpd 1344+__svml_dsinh_ha_data_internal(%rip), %ymm1, %ymm1 #603.35 + vmulpd 1280+__jsvml_dsinh_ha_data_internal(%rip), %ymm1, %ymm15 #601.38 + vmulpd 1344+__jsvml_dsinh_ha_data_internal(%rip), %ymm1, %ymm1 #603.35 vmovsd 128(%rsi,%r8), %xmm14 #597.370 vmovsd (%rdx,%r8), %xmm7 #595.78 vpsubq %xmm4, %xmm10, %xmm10 #610.76 @@ -250,7 +250,7 @@ __svml_sinh4_ha_e9: vpaddq %xmm2, %xmm7, %xmm7 #607.19 vshufps $221, %xmm8, %xmm0, %xmm13 #585.40 vsubpd %ymm15, %ymm0, %ymm0 #601.13 - vpcmpgtd 640+__svml_dsinh_ha_data_internal(%rip), %xmm13, %xmm9 #586.27 + vpcmpgtd 640+__jsvml_dsinh_ha_data_internal(%rip), %xmm13, %xmm9 #586.27 vmovhpd (%rdi,%r8), %xmm11, %xmm8 #595.349 vsubpd %ymm1, %ymm0, %ymm0 #603.13 vmovsd 256(%rdx,%r8), %xmm13 #596.78 @@ -266,7 +266,7 @@ __svml_sinh4_ha_e9: vpaddq %xmm4, %xmm12, %xmm12 #615.80 vpsubq %xmm2, %xmm9, %xmm9 #610.19 vpaddq %xmm4, %xmm8, %xmm8 #607.76 - vmulpd 1152+__svml_dsinh_ha_data_internal(%rip), %ymm1, %ymm15 #629.34 + vmulpd 1152+__jsvml_dsinh_ha_data_internal(%rip), %ymm1, %ymm15 #629.34 vmovhpd 384(%rcx,%r8), %xmm13, %xmm13 #598.65 vmovupd %xmm14, 64(%rsp) #598.353[spill] vinsertf128 $1, %xmm14, %ymm13, %ymm14 #598.19 @@ -276,15 +276,15 @@ __svml_sinh4_ha_e9: vmovupd 64(%rsp), %xmm2 #621.80[spill] vpsubq %xmm4, %xmm2, %xmm4 #621.80 vandnpd %ymm14, %ymm3, %ymm3 #617.22 - vmulpd 1088+__svml_dsinh_ha_data_internal(%rip), %ymm1, %ymm14 #628.32 + vmulpd 1088+__jsvml_dsinh_ha_data_internal(%rip), %ymm1, %ymm14 #628.32 vcmplt_oqpd %ymm5, %ymm3, %ymm3 #619.24 - vaddpd 960+__svml_dsinh_ha_data_internal(%rip), %ymm14, %ymm2 #628.17 + vaddpd 960+__jsvml_dsinh_ha_data_internal(%rip), %ymm14, %ymm2 #628.17 vinsertf128 $1, %xmm4, %ymm13, %ymm6 #622.19 - vaddpd 1024+__svml_dsinh_ha_data_internal(%rip), %ymm15, %ymm4 #629.19 + vaddpd 1024+__jsvml_dsinh_ha_data_internal(%rip), %ymm15, %ymm4 #629.19 vmulpd %ymm4, %ymm1, %ymm5 #631.34 vandnpd %ymm6, %ymm3, %ymm11 #623.23 vmulpd %ymm2, %ymm1, %ymm3 #630.32 - vaddpd 896+__svml_dsinh_ha_data_internal(%rip), %ymm5, %ymm6 #631.19 + vaddpd 896+__jsvml_dsinh_ha_data_internal(%rip), %ymm5, %ymm6 #631.19 vinsertf128 $1, %xmm8, %ymm7, %ymm7 #608.15 vinsertf128 $1, %xmm10, %ymm9, %ymm10 #611.15 vsubpd %ymm10, %ymm7, %ymm8 #613.14 @@ -294,9 +294,9 @@ __svml_sinh4_ha_e9: vaddpd %ymm7, %ymm10, %ymm10 #625.22 vmulpd %ymm6, %ymm1, %ymm7 #632.34 vsubpd %ymm10, %ymm12, %ymm12 #626.26 - vaddpd 832+__svml_dsinh_ha_data_internal(%rip), %ymm3, %ymm10 #630.17 + vaddpd 832+__jsvml_dsinh_ha_data_internal(%rip), %ymm3, %ymm10 #630.17 vsubpd %ymm11, %ymm12, %ymm13 #627.26 - vaddpd 768+__svml_dsinh_ha_data_internal(%rip), %ymm7, %ymm11 #632.19 + vaddpd 768+__jsvml_dsinh_ha_data_internal(%rip), %ymm7, %ymm11 #632.19 vmulpd %ymm10, %ymm1, %ymm12 #633.13 vmulpd %ymm11, %ymm1, %ymm1 #634.15 vmulpd %ymm2, %ymm12, %ymm0 #636.35 @@ -366,29 +366,29 @@ __svml_sinh4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #642.552 lea 128(%rsp,%r12,8), %rsi #642.552 -..___tag_value___svml_sinh4_ha_e9.37: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #642.552 -..___tag_value___svml_sinh4_ha_e9.38: +..___tag_value___jsvml_sinh4_ha_e9.37: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #642.552 +..___tag_value___jsvml_sinh4_ha_e9.38: jmp ..B2.8 # Prob 100% #642.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinh4_ha_e9,@function - .size __svml_sinh4_ha_e9,.-__svml_sinh4_ha_e9 -..LN__svml_sinh4_ha_e9.1: + .type __jsvml_sinh4_ha_e9,@function + .size __jsvml_sinh4_ha_e9,.-__jsvml_sinh4_ha_e9 +..LN__jsvml_sinh4_ha_e9.1: .data -# -- End __svml_sinh4_ha_e9 +# -- End __jsvml_sinh4_ha_e9 .text -.L_2__routine_start___svml_sinh2_ha_ex_2: -# -- Begin __svml_sinh2_ha_ex +.L_2__routine_start___jsvml_sinh2_ha_ex_2: +# -- Begin __jsvml_sinh2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_sinh2_ha_ex -# --- __svml_sinh2_ha_ex(__m128d) -__svml_sinh2_ha_ex: + .globl __jsvml_sinh2_ha_ex +# --- __jsvml_sinh2_ha_ex(__m128d) +__jsvml_sinh2_ha_ex: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -397,7 +397,7 @@ __svml_sinh2_ha_ex: .byte 30 #1063.546 .byte 250 #1063.546 .cfi_startproc -..___tag_value___svml_sinh2_ha_ex.40: +..___tag_value___jsvml_sinh2_ha_ex.40: ..L41: #956.1 pushq %rbp #956.1 @@ -408,25 +408,25 @@ __svml_sinh2_ha_ex: andq $-64, %rsp #956.1 subq $192, %rsp #956.1 movaps %xmm0, %xmm11 #956.1 - movups 1408+__svml_dsinh_ha_data_internal(%rip), %xmm10 #1001.47 - lea __svml_dsinh_ha_data_internal(%rip), %rsi #1016.32 + movups 1408+__jsvml_dsinh_ha_data_internal(%rip), %xmm10 #1001.47 + lea __jsvml_dsinh_ha_data_internal(%rip), %rsi #1016.32 movaps %xmm10, %xmm0 #1002.17 andps %xmm11, %xmm0 #1002.17 movaps %xmm0, %xmm9 #1003.16 - movups 1216+__svml_dsinh_ha_data_internal(%rip), %xmm14 #1004.25 + movups 1216+__jsvml_dsinh_ha_data_internal(%rip), %xmm14 #1004.25 pxor %xmm11, %xmm9 #1003.16 mulpd %xmm9, %xmm14 #1004.25 - movups 512+__svml_dsinh_ha_data_internal(%rip), %xmm8 #991.51 + movups 512+__jsvml_dsinh_ha_data_internal(%rip), %xmm8 #991.51 addpd %xmm8, %xmm14 #1004.13 - movups 576+__svml_dsinh_ha_data_internal(%rip), %xmm15 #1010.24 + movups 576+__jsvml_dsinh_ha_data_internal(%rip), %xmm15 #1010.24 cmpeqpd %xmm14, %xmm15 #1010.24 movaps %xmm15, %xmm7 #1011.32 andps %xmm8, %xmm15 #1011.66 andnps %xmm14, %xmm7 #1011.32 - movq 640+__svml_dsinh_ha_data_internal(%rip), %xmm12 #993.23 + movq 640+__jsvml_dsinh_ha_data_internal(%rip), %xmm12 #993.23 orps %xmm15, %xmm7 #1011.21 pshufd $221, %xmm9, %xmm13 #1006.16 - movdqu 704+__svml_dsinh_ha_data_internal(%rip), %xmm5 #1013.17 + movdqu 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm5 #1013.17 pcmpgtd %xmm12, %xmm13 #1007.21 movaps %xmm7, %xmm12 #1020.13 pand %xmm7, %xmm5 #1013.17 @@ -438,9 +438,9 @@ __svml_sinh2_ha_ex: psllq $48, %xmm7 #1026.13 movd %xmm4, %eax #1016.124 pshufd $2, %xmm4, %xmm1 #1016.267 - movups 1280+__svml_dsinh_ha_data_internal(%rip), %xmm8 #1022.35 + movups 1280+__jsvml_dsinh_ha_data_internal(%rip), %xmm8 #1022.35 movd %xmm1, %ecx #1016.249 - movups 1344+__svml_dsinh_ha_data_internal(%rip), %xmm13 #1024.32 + movups 1344+__jsvml_dsinh_ha_data_internal(%rip), %xmm13 #1024.32 mulpd %xmm12, %xmm8 #1022.35 mulpd %xmm12, %xmm13 #1024.32 subpd %xmm8, %xmm9 #1022.13 @@ -473,19 +473,19 @@ __svml_sinh2_ha_ex: movhpd 128(%rcx,%rsi), %xmm4 #1018.19 paddq %xmm7, %xmm4 #1036.17 subpd %xmm3, %xmm4 #1047.26 - movups 1152+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1050.31 + movups 1152+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1050.31 mulpd %xmm1, %xmm3 #1050.31 subpd %xmm10, %xmm4 #1048.26 - addpd 1024+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1050.19 - movups 1088+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1049.29 + addpd 1024+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1050.19 + movups 1088+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1049.29 mulpd %xmm1, %xmm6 #1049.29 mulpd %xmm1, %xmm3 #1052.31 - addpd 960+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1049.17 - addpd 896+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1052.19 + addpd 960+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1049.17 + addpd 896+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1052.19 mulpd %xmm1, %xmm6 #1051.29 mulpd %xmm1, %xmm3 #1053.31 - addpd 832+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1051.17 - addpd 768+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1053.19 + addpd 832+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1051.17 + addpd 768+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1053.19 mulpd %xmm1, %xmm6 #1054.13 mulpd %xmm3, %xmm1 #1055.15 mulpd %xmm9, %xmm6 #1057.32 @@ -550,29 +550,29 @@ __svml_sinh2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1063.546 lea 128(%rsp,%r12,8), %rsi #1063.546 -..___tag_value___svml_sinh2_ha_ex.58: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1063.546 -..___tag_value___svml_sinh2_ha_ex.59: +..___tag_value___jsvml_sinh2_ha_ex.58: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1063.546 +..___tag_value___jsvml_sinh2_ha_ex.59: jmp ..B3.8 # Prob 100% #1063.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinh2_ha_ex,@function - .size __svml_sinh2_ha_ex,.-__svml_sinh2_ha_ex -..LN__svml_sinh2_ha_ex.2: + .type __jsvml_sinh2_ha_ex,@function + .size __jsvml_sinh2_ha_ex,.-__jsvml_sinh2_ha_ex +..LN__jsvml_sinh2_ha_ex.2: .data -# -- End __svml_sinh2_ha_ex +# -- End __jsvml_sinh2_ha_ex .text -.L_2__routine_start___svml_sinh1_ha_l9_3: -# -- Begin __svml_sinh1_ha_l9 +.L_2__routine_start___jsvml_sinh1_ha_l9_3: +# -- Begin __jsvml_sinh1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh1_ha_l9 -# --- __svml_sinh1_ha_l9(__m128d) -__svml_sinh1_ha_l9: + .globl __jsvml_sinh1_ha_l9 +# --- __jsvml_sinh1_ha_l9(__m128d) +__jsvml_sinh1_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -581,7 +581,7 @@ __svml_sinh1_ha_l9: .byte 30 #1177.546 .byte 250 #1177.546 .cfi_startproc -..___tag_value___svml_sinh1_ha_l9.61: +..___tag_value___jsvml_sinh1_ha_l9.61: ..L62: #1071.1 pushq %rbp #1071.1 @@ -592,28 +592,28 @@ __svml_sinh1_ha_l9: andq $-64, %rsp #1071.1 subq $128, %rsp #1071.1 vmovapd %xmm0, %xmm3 #1071.1 - vmovsd 1408+__svml_dsinh_ha_data_internal(%rip), %xmm4 #1116.16 + vmovsd 1408+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #1116.16 movl $1082453555, %eax #1122.23 vandpd %xmm3, %xmm4, %xmm5 #1117.17 - lea __svml_dsinh_ha_data_internal(%rip), %rcx #1131.15 + lea __jsvml_dsinh_ha_data_internal(%rip), %rcx #1131.15 vxorpd %xmm3, %xmm5, %xmm8 #1118.16 - vmovsd 512+__svml_dsinh_ha_data_internal(%rip), %xmm15 #1106.20 + vmovsd 512+__jsvml_dsinh_ha_data_internal(%rip), %xmm15 #1106.20 vmovapd %xmm8, %xmm9 #1119.13 - vfmadd132sd 1216+__svml_dsinh_ha_data_internal(%rip), %xmm15, %xmm9 #1119.13 + vfmadd132sd 1216+__jsvml_dsinh_ha_data_internal(%rip), %xmm15, %xmm9 #1119.13 vmovd %eax, %xmm6 #1122.23 - vmovsd 576+__svml_dsinh_ha_data_internal(%rip), %xmm10 #1124.26 + vmovsd 576+__jsvml_dsinh_ha_data_internal(%rip), %xmm10 #1124.26 vpshufd $85, %xmm8, %xmm14 #1121.18 vpcmpgtd %xmm6, %xmm14, %xmm7 #1122.23 - vmovq 704+__svml_dsinh_ha_data_internal(%rip), %xmm2 #1107.23 + vmovq 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm2 #1107.23 vmovmskps %xmm7, %eax #1123.44 vcmpeqsd %xmm9, %xmm10, %xmm0 #1125.24 blendvpd %xmm0, %xmm15, %xmm9 #1126.21 vpand %xmm2, %xmm9, %xmm7 #1128.19 vsubsd %xmm15, %xmm9, %xmm14 #1135.13 vpsllq $3, %xmm7, %xmm11 #1130.23 - vmovsd 1280+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1136.19 + vmovsd 1280+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1136.19 vmovd %xmm11, %edx #1131.107 - vmovsd 1344+__svml_dsinh_ha_data_internal(%rip), %xmm15 #1139.13 + vmovsd 1344+__jsvml_dsinh_ha_data_internal(%rip), %xmm15 #1139.13 vfnmadd213sd %xmm8, %xmm14, %xmm6 #1137.13 vpxor %xmm7, %xmm9, %xmm8 #1129.15 vpsllq $48, %xmm8, %xmm11 #1141.15 @@ -634,16 +634,16 @@ __svml_sinh1_ha_l9: vsubsd %xmm7, %xmm6, %xmm6 #1162.26 vpsubq %xmm11, %xmm2, %xmm12 #1157.19 vandnpd %xmm2, %xmm4, %xmm1 #1153.22 - vmovsd 1152+__svml_dsinh_ha_data_internal(%rip), %xmm2 #1165.19 + vmovsd 1152+__jsvml_dsinh_ha_data_internal(%rip), %xmm2 #1165.19 vcmpltsd %xmm11, %xmm1, %xmm4 #1155.24 - vfmadd213sd 1024+__svml_dsinh_ha_data_internal(%rip), %xmm14, %xmm2 #1165.19 - vmovsd 1088+__svml_dsinh_ha_data_internal(%rip), %xmm1 #1164.17 + vfmadd213sd 1024+__jsvml_dsinh_ha_data_internal(%rip), %xmm14, %xmm2 #1165.19 + vmovsd 1088+__jsvml_dsinh_ha_data_internal(%rip), %xmm1 #1164.17 vandnpd %xmm12, %xmm4, %xmm0 #1159.23 - vfmadd213sd 960+__svml_dsinh_ha_data_internal(%rip), %xmm14, %xmm1 #1164.17 + vfmadd213sd 960+__jsvml_dsinh_ha_data_internal(%rip), %xmm14, %xmm1 #1164.17 vsubsd %xmm0, %xmm6, %xmm4 #1163.26 - vfmadd213sd 896+__svml_dsinh_ha_data_internal(%rip), %xmm14, %xmm2 #1167.19 - vfmadd213sd 832+__svml_dsinh_ha_data_internal(%rip), %xmm14, %xmm1 #1166.17 - vfmadd213sd 768+__svml_dsinh_ha_data_internal(%rip), %xmm14, %xmm2 #1168.19 + vfmadd213sd 896+__jsvml_dsinh_ha_data_internal(%rip), %xmm14, %xmm2 #1167.19 + vfmadd213sd 832+__jsvml_dsinh_ha_data_internal(%rip), %xmm14, %xmm1 #1166.17 + vfmadd213sd 768+__jsvml_dsinh_ha_data_internal(%rip), %xmm14, %xmm2 #1168.19 vmulsd %xmm14, %xmm1, %xmm10 #1169.13 vmulsd %xmm14, %xmm2, %xmm14 #1170.15 vfmadd213sd %xmm15, %xmm15, %xmm10 #1171.13 @@ -689,29 +689,29 @@ __svml_sinh1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1177.546 lea 64(%rsp), %rsi #1177.546 -..___tag_value___svml_sinh1_ha_l9.74: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1177.546 -..___tag_value___svml_sinh1_ha_l9.75: +..___tag_value___jsvml_sinh1_ha_l9.74: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1177.546 +..___tag_value___jsvml_sinh1_ha_l9.75: jmp ..B4.4 # Prob 100% #1177.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_sinh1_ha_l9,@function - .size __svml_sinh1_ha_l9,.-__svml_sinh1_ha_l9 -..LN__svml_sinh1_ha_l9.3: + .type __jsvml_sinh1_ha_l9,@function + .size __jsvml_sinh1_ha_l9,.-__jsvml_sinh1_ha_l9 +..LN__jsvml_sinh1_ha_l9.3: .data -# -- End __svml_sinh1_ha_l9 +# -- End __jsvml_sinh1_ha_l9 .text -.L_2__routine_start___svml_sinh2_ha_l9_4: -# -- Begin __svml_sinh2_ha_l9 +.L_2__routine_start___jsvml_sinh2_ha_l9_4: +# -- Begin __jsvml_sinh2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh2_ha_l9 -# --- __svml_sinh2_ha_l9(__m128d) -__svml_sinh2_ha_l9: + .globl __jsvml_sinh2_ha_l9 +# --- __jsvml_sinh2_ha_l9(__m128d) +__jsvml_sinh2_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -720,7 +720,7 @@ __svml_sinh2_ha_l9: .byte 30 #1291.546 .byte 250 #1291.546 .cfi_startproc -..___tag_value___svml_sinh2_ha_l9.77: +..___tag_value___jsvml_sinh2_ha_l9.77: ..L78: #1185.1 pushq %rbp #1185.1 @@ -731,27 +731,27 @@ __svml_sinh2_ha_l9: andq $-64, %rsp #1185.1 subq $192, %rsp #1185.1 vmovapd %xmm0, %xmm6 #1185.1 - vmovupd 1408+__svml_dsinh_ha_data_internal(%rip), %xmm4 #1230.47 - lea __svml_dsinh_ha_data_internal(%rip), %rsi #1245.32 + vmovupd 1408+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #1230.47 + lea __jsvml_dsinh_ha_data_internal(%rip), %rsi #1245.32 vandpd %xmm6, %xmm4, %xmm5 #1231.17 - vmovupd 512+__svml_dsinh_ha_data_internal(%rip), %xmm11 #1220.51 + vmovupd 512+__jsvml_dsinh_ha_data_internal(%rip), %xmm11 #1220.51 vxorpd %xmm6, %xmm5, %xmm7 #1232.16 - vmovupd 1216+__svml_dsinh_ha_data_internal(%rip), %xmm8 #1233.13 + vmovupd 1216+__jsvml_dsinh_ha_data_internal(%rip), %xmm8 #1233.13 vfmadd213pd %xmm11, %xmm7, %xmm8 #1233.13 - vmovq 640+__svml_dsinh_ha_data_internal(%rip), %xmm9 #1222.25 + vmovq 640+__jsvml_dsinh_ha_data_internal(%rip), %xmm9 #1222.25 vpshufd $221, %xmm7, %xmm2 #1235.18 vpcmpgtd %xmm9, %xmm2, %xmm12 #1236.23 vmovmskps %xmm12, %edx #1237.44 - vcmpeqpd 576+__svml_dsinh_ha_data_internal(%rip), %xmm8, %xmm0 #1239.24 + vcmpeqpd 576+__jsvml_dsinh_ha_data_internal(%rip), %xmm8, %xmm0 #1239.24 blendvpd %xmm0, %xmm11, %xmm8 #1240.21 vsubpd %xmm11, %xmm8, %xmm9 #1249.13 - vpand 704+__svml_dsinh_ha_data_internal(%rip), %xmm8, %xmm10 #1242.19 - vmovupd 1280+__svml_dsinh_ha_data_internal(%rip), %xmm11 #1250.50 + vpand 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm8, %xmm10 #1242.19 + vmovupd 1280+__jsvml_dsinh_ha_data_internal(%rip), %xmm11 #1250.50 vpsllq $3, %xmm10, %xmm3 #1244.23 vfnmadd231pd %xmm11, %xmm9, %xmm7 #1251.13 vpxor %xmm10, %xmm8, %xmm10 #1243.15 vmovd %xmm3, %eax #1245.124 - vfnmadd231pd 1344+__svml_dsinh_ha_data_internal(%rip), %xmm9, %xmm7 #1253.13 + vfnmadd231pd 1344+__jsvml_dsinh_ha_data_internal(%rip), %xmm9, %xmm7 #1253.13 movslq %eax, %rax #1245.124 vpextrd $2, %xmm3, %ecx #1245.251 movslq %ecx, %rcx #1245.251 @@ -775,16 +775,16 @@ __svml_sinh2_ha_l9: vpaddq %xmm13, %xmm1, %xmm8 #1265.19 vcmpltpd %xmm13, %xmm4, %xmm15 #1269.24 vaddpd %xmm12, %xmm9, %xmm9 #1275.22 - vmovupd 1152+__svml_dsinh_ha_data_internal(%rip), %xmm13 #1279.19 + vmovupd 1152+__jsvml_dsinh_ha_data_internal(%rip), %xmm13 #1279.19 vandnpd %xmm0, %xmm15, %xmm1 #1273.23 - vfmadd213pd 1024+__svml_dsinh_ha_data_internal(%rip), %xmm2, %xmm13 #1279.19 - vmovupd 1088+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1278.17 - vfmadd213pd 960+__svml_dsinh_ha_data_internal(%rip), %xmm2, %xmm3 #1278.17 + vfmadd213pd 1024+__jsvml_dsinh_ha_data_internal(%rip), %xmm2, %xmm13 #1279.19 + vmovupd 1088+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1278.17 + vfmadd213pd 960+__jsvml_dsinh_ha_data_internal(%rip), %xmm2, %xmm3 #1278.17 vsubpd %xmm9, %xmm8, %xmm8 #1276.26 - vfmadd213pd 896+__svml_dsinh_ha_data_internal(%rip), %xmm2, %xmm13 #1281.19 - vfmadd213pd 832+__svml_dsinh_ha_data_internal(%rip), %xmm2, %xmm3 #1280.17 + vfmadd213pd 896+__jsvml_dsinh_ha_data_internal(%rip), %xmm2, %xmm13 #1281.19 + vfmadd213pd 832+__jsvml_dsinh_ha_data_internal(%rip), %xmm2, %xmm3 #1280.17 vsubpd %xmm1, %xmm8, %xmm4 #1277.26 - vfmadd213pd 768+__svml_dsinh_ha_data_internal(%rip), %xmm2, %xmm13 #1282.19 + vfmadd213pd 768+__jsvml_dsinh_ha_data_internal(%rip), %xmm2, %xmm13 #1282.19 vmulpd %xmm3, %xmm2, %xmm14 #1283.13 vmulpd %xmm13, %xmm2, %xmm2 #1284.15 vfmadd213pd %xmm7, %xmm7, %xmm14 #1285.13 @@ -847,29 +847,29 @@ __svml_sinh2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1291.546 lea 128(%rsp,%r12,8), %rsi #1291.546 -..___tag_value___svml_sinh2_ha_l9.95: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1291.546 -..___tag_value___svml_sinh2_ha_l9.96: +..___tag_value___jsvml_sinh2_ha_l9.95: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1291.546 +..___tag_value___jsvml_sinh2_ha_l9.96: jmp ..B5.8 # Prob 100% #1291.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinh2_ha_l9,@function - .size __svml_sinh2_ha_l9,.-__svml_sinh2_ha_l9 -..LN__svml_sinh2_ha_l9.4: + .type __jsvml_sinh2_ha_l9,@function + .size __jsvml_sinh2_ha_l9,.-__jsvml_sinh2_ha_l9 +..LN__jsvml_sinh2_ha_l9.4: .data -# -- End __svml_sinh2_ha_l9 +# -- End __jsvml_sinh2_ha_l9 .text -.L_2__routine_start___svml_sinh1_ha_ex_5: -# -- Begin __svml_sinh1_ha_ex +.L_2__routine_start___jsvml_sinh1_ha_ex_5: +# -- Begin __jsvml_sinh1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_sinh1_ha_ex -# --- __svml_sinh1_ha_ex(__m128d) -__svml_sinh1_ha_ex: + .globl __jsvml_sinh1_ha_ex +# --- __jsvml_sinh1_ha_ex(__m128d) +__jsvml_sinh1_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -878,7 +878,7 @@ __svml_sinh1_ha_ex: .byte 30 #1406.546 .byte 250 #1406.546 .cfi_startproc -..___tag_value___svml_sinh1_ha_ex.98: +..___tag_value___jsvml_sinh1_ha_ex.98: ..L99: #1299.1 pushq %rbp #1299.1 @@ -889,18 +889,18 @@ __svml_sinh1_ha_ex: andq $-64, %rsp #1299.1 subq $128, %rsp #1299.1 movaps %xmm0, %xmm10 #1299.1 - movsd 1408+__svml_dsinh_ha_data_internal(%rip), %xmm9 #1344.16 + movsd 1408+__jsvml_dsinh_ha_data_internal(%rip), %xmm9 #1344.16 movl $1082453555, %eax #1350.21 movaps %xmm9, %xmm0 #1345.17 - lea __svml_dsinh_ha_data_internal(%rip), %rcx #1359.15 + lea __jsvml_dsinh_ha_data_internal(%rip), %rcx #1359.15 andps %xmm10, %xmm0 #1345.17 movaps %xmm0, %xmm8 #1346.16 pxor %xmm10, %xmm8 #1346.16 movd %eax, %xmm11 #1350.21 movaps %xmm8, %xmm13 #1347.25 - mulsd 1216+__svml_dsinh_ha_data_internal(%rip), %xmm13 #1347.25 - movsd 512+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1334.20 - movsd 576+__svml_dsinh_ha_data_internal(%rip), %xmm14 #1353.24 + mulsd 1216+__jsvml_dsinh_ha_data_internal(%rip), %xmm13 #1347.25 + movsd 512+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1334.20 + movsd 576+__jsvml_dsinh_ha_data_internal(%rip), %xmm14 #1353.24 addsd %xmm6, %xmm13 #1347.13 pshufd $85, %xmm8, %xmm12 #1349.16 cmpeqsd %xmm13, %xmm14 #1353.24 @@ -910,7 +910,7 @@ __svml_sinh1_ha_ex: andps %xmm6, %xmm14 #1354.66 movmskps %xmm12, %eax #1351.44 orps %xmm14, %xmm7 #1354.21 - movq 704+__svml_dsinh_ha_data_internal(%rip), %xmm12 #1356.17 + movq 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm12 #1356.17 movaps %xmm7, %xmm11 #1363.13 pand %xmm7, %xmm12 #1356.17 subsd %xmm6, %xmm11 #1363.13 @@ -919,8 +919,8 @@ __svml_sinh1_ha_ex: psllq $3, %xmm15 #1358.21 psllq $48, %xmm7 #1369.13 movd %xmm15, %edx #1359.107 - movsd 1280+__svml_dsinh_ha_data_internal(%rip), %xmm1 #1365.35 - movsd 1344+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1367.32 + movsd 1280+__jsvml_dsinh_ha_data_internal(%rip), %xmm1 #1365.35 + movsd 1344+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1367.32 movslq %edx, %rdx #1359.107 mulsd %xmm11, %xmm1 #1365.35 mulsd %xmm11, %xmm6 #1367.32 @@ -947,23 +947,23 @@ __svml_sinh1_ha_ex: mulsd %xmm13, %xmm8 #1399.15 paddq %xmm7, %xmm5 #1379.17 addsd %xmm2, %xmm4 #1389.22 - movsd 1088+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1392.29 + movsd 1088+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1392.29 subsd %xmm4, %xmm5 #1390.26 mulsd %xmm1, %xmm3 #1392.29 subsd %xmm9, %xmm5 #1391.26 - addsd 960+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1392.17 - movsd 1152+__svml_dsinh_ha_data_internal(%rip), %xmm4 #1393.31 + addsd 960+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1392.17 + movsd 1152+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #1393.31 mulsd %xmm1, %xmm4 #1393.31 mulsd %xmm1, %xmm3 #1394.29 - addsd 1024+__svml_dsinh_ha_data_internal(%rip), %xmm4 #1393.19 - addsd 832+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1394.17 + addsd 1024+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #1393.19 + addsd 832+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1394.17 mulsd %xmm1, %xmm4 #1395.31 mulsd %xmm1, %xmm3 #1397.13 - addsd 896+__svml_dsinh_ha_data_internal(%rip), %xmm4 #1395.19 + addsd 896+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #1395.19 mulsd %xmm8, %xmm3 #1400.32 mulsd %xmm1, %xmm4 #1396.31 addsd %xmm5, %xmm3 #1400.20 - addsd 768+__svml_dsinh_ha_data_internal(%rip), %xmm4 #1396.19 + addsd 768+__jsvml_dsinh_ha_data_internal(%rip), %xmm4 #1396.19 mulsd %xmm1, %xmm4 #1398.15 mulsd %xmm14, %xmm4 #1401.29 addsd %xmm3, %xmm4 #1401.17 @@ -1004,29 +1004,29 @@ __svml_sinh1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1406.546 lea 64(%rsp), %rsi #1406.546 -..___tag_value___svml_sinh1_ha_ex.111: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1406.546 -..___tag_value___svml_sinh1_ha_ex.112: +..___tag_value___jsvml_sinh1_ha_ex.111: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1406.546 +..___tag_value___jsvml_sinh1_ha_ex.112: jmp ..B6.4 # Prob 100% #1406.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_sinh1_ha_ex,@function - .size __svml_sinh1_ha_ex,.-__svml_sinh1_ha_ex -..LN__svml_sinh1_ha_ex.5: + .type __jsvml_sinh1_ha_ex,@function + .size __jsvml_sinh1_ha_ex,.-__jsvml_sinh1_ha_ex +..LN__jsvml_sinh1_ha_ex.5: .data -# -- End __svml_sinh1_ha_ex +# -- End __jsvml_sinh1_ha_ex .text -.L_2__routine_start___svml_sinh4_ha_l9_6: -# -- Begin __svml_sinh4_ha_l9 +.L_2__routine_start___jsvml_sinh4_ha_l9_6: +# -- Begin __jsvml_sinh4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh4_ha_l9 -# --- __svml_sinh4_ha_l9(__m256d) -__svml_sinh4_ha_l9: + .globl __jsvml_sinh4_ha_l9 +# --- __jsvml_sinh4_ha_l9(__m256d) +__jsvml_sinh4_ha_l9: # parameter 1: %ymm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1035,7 +1035,7 @@ __svml_sinh4_ha_l9: .byte 30 #1520.552 .byte 250 #1520.552 .cfi_startproc -..___tag_value___svml_sinh4_ha_l9.114: +..___tag_value___jsvml_sinh4_ha_l9.114: ..L115: #1414.1 pushq %rbp #1414.1 @@ -1045,22 +1045,22 @@ __svml_sinh4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1414.1 subq $192, %rsp #1414.1 - lea __svml_dsinh_ha_data_internal(%rip), %r8 #1474.78 - vmovupd 1408+__svml_dsinh_ha_data_internal(%rip), %ymm1 #1459.50 - vmovupd 512+__svml_dsinh_ha_data_internal(%rip), %ymm10 #1449.54 - vmovupd 1216+__svml_dsinh_ha_data_internal(%rip), %ymm11 #1462.13 + lea __jsvml_dsinh_ha_data_internal(%rip), %r8 #1474.78 + vmovupd 1408+__jsvml_dsinh_ha_data_internal(%rip), %ymm1 #1459.50 + vmovupd 512+__jsvml_dsinh_ha_data_internal(%rip), %ymm10 #1449.54 + vmovupd 1216+__jsvml_dsinh_ha_data_internal(%rip), %ymm11 #1462.13 vmovapd %ymm0, %ymm3 #1414.1 vandpd %ymm3, %ymm1, %ymm2 #1460.17 vxorpd %ymm3, %ymm2, %ymm5 #1461.16 vfmadd213pd %ymm10, %ymm5, %ymm11 #1462.13 - vcmpeqpd 576+__svml_dsinh_ha_data_internal(%rip), %ymm11, %ymm4 #1468.24 + vcmpeqpd 576+__jsvml_dsinh_ha_data_internal(%rip), %ymm11, %ymm4 #1468.24 vblendvpd %ymm4, %ymm10, %ymm11, %ymm9 #1469.21 - vandps 704+__svml_dsinh_ha_data_internal(%rip), %ymm9, %ymm15 #1471.19 + vandps 704+__jsvml_dsinh_ha_data_internal(%rip), %ymm9, %ymm15 #1471.19 vpsllq $3, %ymm15, %ymm12 #1473.23 vxorps %ymm15, %ymm9, %ymm15 #1472.15 vextractf128 $1, %ymm5, %xmm6 #1464.125 vshufps $221, %xmm6, %xmm5, %xmm7 #1464.36 - vpcmpgtd 640+__svml_dsinh_ha_data_internal(%rip), %xmm7, %xmm8 #1465.23 + vpcmpgtd 640+__jsvml_dsinh_ha_data_internal(%rip), %xmm7, %xmm8 #1465.23 vmovmskps %xmm8, %eax #1466.44 vextractf128 $1, %ymm12, %xmm6 #1474.521 vmovd %xmm12, %edx #1474.170 @@ -1088,19 +1088,19 @@ __svml_sinh4_ha_l9: vmovhpd 128(%rcx,%r8), %xmm7, %xmm8 #1476.65 vmovhpd 384(%rcx,%r8), %xmm6, %xmm7 #1477.65 vsubpd %ymm10, %ymm9, %ymm6 #1478.13 - vmovupd 1280+__svml_dsinh_ha_data_internal(%rip), %ymm10 #1479.53 + vmovupd 1280+__jsvml_dsinh_ha_data_internal(%rip), %ymm10 #1479.53 vfnmadd231pd %ymm10, %ymm6, %ymm5 #1480.13 - vfnmadd231pd 1344+__svml_dsinh_ha_data_internal(%rip), %ymm6, %ymm5 #1482.13 + vfnmadd231pd 1344+__jsvml_dsinh_ha_data_internal(%rip), %ymm6, %ymm5 #1482.13 vmulpd %ymm5, %ymm5, %ymm6 #1483.14 vinsertf128 $1, %xmm12, %ymm8, %ymm0 #1476.19 vpsllq $48, %ymm15, %ymm12 #1484.15 vmovsd 384(%rsi,%r8), %xmm8 #1477.414 vmovhpd 384(%rdi,%r8), %xmm8, %xmm11 #1477.397 vpsubq %ymm12, %ymm13, %ymm8 #1489.15 - vmovupd 1152+__svml_dsinh_ha_data_internal(%rip), %ymm13 #1508.19 - vfmadd213pd 1024+__svml_dsinh_ha_data_internal(%rip), %ymm6, %ymm13 #1508.19 - vfmadd213pd 896+__svml_dsinh_ha_data_internal(%rip), %ymm6, %ymm13 #1510.19 - vfmadd213pd 768+__svml_dsinh_ha_data_internal(%rip), %ymm6, %ymm13 #1511.19 + vmovupd 1152+__jsvml_dsinh_ha_data_internal(%rip), %ymm13 #1508.19 + vfmadd213pd 1024+__jsvml_dsinh_ha_data_internal(%rip), %ymm6, %ymm13 #1508.19 + vfmadd213pd 896+__jsvml_dsinh_ha_data_internal(%rip), %ymm6, %ymm13 #1510.19 + vfmadd213pd 768+__jsvml_dsinh_ha_data_internal(%rip), %ymm6, %ymm13 #1511.19 vinsertf128 $1, %xmm11, %ymm7, %ymm4 #1477.19 vandnpd %ymm4, %ymm1, %ymm1 #1496.22 vpaddq %ymm12, %ymm14, %ymm11 #1486.15 @@ -1109,11 +1109,11 @@ __svml_sinh4_ha_l9: vsubpd %ymm8, %ymm11, %ymm10 #1492.14 vaddpd %ymm8, %ymm11, %ymm9 #1491.14 vpsubq %ymm12, %ymm4, %ymm1 #1500.19 - vmovupd 1088+__svml_dsinh_ha_data_internal(%rip), %ymm12 #1507.17 + vmovupd 1088+__jsvml_dsinh_ha_data_internal(%rip), %ymm12 #1507.17 vsubpd %ymm11, %ymm10, %ymm11 #1503.22 - vfmadd213pd 960+__svml_dsinh_ha_data_internal(%rip), %ymm6, %ymm12 #1507.17 + vfmadd213pd 960+__jsvml_dsinh_ha_data_internal(%rip), %ymm6, %ymm12 #1507.17 vaddpd %ymm11, %ymm8, %ymm8 #1504.22 - vfmadd213pd 832+__svml_dsinh_ha_data_internal(%rip), %ymm6, %ymm12 #1509.17 + vfmadd213pd 832+__jsvml_dsinh_ha_data_internal(%rip), %ymm6, %ymm12 #1509.17 vsubpd %ymm8, %ymm7, %ymm7 #1505.26 vmulpd %ymm12, %ymm6, %ymm15 #1512.13 vmulpd %ymm13, %ymm6, %ymm6 #1513.15 @@ -1183,29 +1183,29 @@ __svml_sinh4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1520.552 lea 128(%rsp,%r12,8), %rsi #1520.552 -..___tag_value___svml_sinh4_ha_l9.132: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1520.552 -..___tag_value___svml_sinh4_ha_l9.133: +..___tag_value___jsvml_sinh4_ha_l9.132: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1520.552 +..___tag_value___jsvml_sinh4_ha_l9.133: jmp ..B7.8 # Prob 100% #1520.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinh4_ha_l9,@function - .size __svml_sinh4_ha_l9,.-__svml_sinh4_ha_l9 -..LN__svml_sinh4_ha_l9.6: + .type __jsvml_sinh4_ha_l9,@function + .size __jsvml_sinh4_ha_l9,.-__jsvml_sinh4_ha_l9 +..LN__jsvml_sinh4_ha_l9.6: .data -# -- End __svml_sinh4_ha_l9 +# -- End __jsvml_sinh4_ha_l9 .text -.L_2__routine_start___svml_sinh2_ha_e9_7: -# -- Begin __svml_sinh2_ha_e9 +.L_2__routine_start___jsvml_sinh2_ha_e9_7: +# -- Begin __jsvml_sinh2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh2_ha_e9 -# --- __svml_sinh2_ha_e9(__m128d) -__svml_sinh2_ha_e9: + .globl __jsvml_sinh2_ha_e9 +# --- __jsvml_sinh2_ha_e9(__m128d) +__jsvml_sinh2_ha_e9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1214,7 +1214,7 @@ __svml_sinh2_ha_e9: .byte 30 #1635.546 .byte 250 #1635.546 .cfi_startproc -..___tag_value___svml_sinh2_ha_e9.135: +..___tag_value___jsvml_sinh2_ha_e9.135: ..L136: #1528.1 pushq %rbp #1528.1 @@ -1225,23 +1225,23 @@ __svml_sinh2_ha_e9: andq $-64, %rsp #1528.1 subq $192, %rsp #1528.1 movaps %xmm0, %xmm11 #1528.1 - movups 1408+__svml_dsinh_ha_data_internal(%rip), %xmm8 #1573.47 - lea __svml_dsinh_ha_data_internal(%rip), %rsi #1588.32 + movups 1408+__jsvml_dsinh_ha_data_internal(%rip), %xmm8 #1573.47 + lea __jsvml_dsinh_ha_data_internal(%rip), %rsi #1588.32 movaps %xmm8, %xmm10 #1574.17 andps %xmm11, %xmm10 #1574.17 movaps %xmm10, %xmm7 #1575.16 - movups 1216+__svml_dsinh_ha_data_internal(%rip), %xmm9 #1576.25 + movups 1216+__jsvml_dsinh_ha_data_internal(%rip), %xmm9 #1576.25 pxor %xmm11, %xmm7 #1575.16 mulpd %xmm7, %xmm9 #1576.25 - movups 512+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1563.51 + movups 512+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1563.51 addpd %xmm6, %xmm9 #1576.13 - movups 576+__svml_dsinh_ha_data_internal(%rip), %xmm0 #1582.24 + movups 576+__jsvml_dsinh_ha_data_internal(%rip), %xmm0 #1582.24 cmpeqpd %xmm9, %xmm0 #1582.24 - movq 640+__svml_dsinh_ha_data_internal(%rip), %xmm12 #1565.29 + movq 640+__jsvml_dsinh_ha_data_internal(%rip), %xmm12 #1565.29 pshufd $221, %xmm7, %xmm13 #1578.22 blendvpd %xmm0, %xmm6, %xmm9 #1583.21 pcmpgtd %xmm12, %xmm13 #1579.27 - movdqu 704+__svml_dsinh_ha_data_internal(%rip), %xmm12 #1585.23 + movdqu 704+__jsvml_dsinh_ha_data_internal(%rip), %xmm12 #1585.23 movaps %xmm9, %xmm1 #1592.13 subpd %xmm6, %xmm1 #1592.13 movmskps %xmm13, %edx #1580.44 @@ -1251,8 +1251,8 @@ __svml_sinh2_ha_e9: psllq $3, %xmm14 #1587.27 psllq $48, %xmm9 #1598.19 movd %xmm14, %eax #1588.124 - movups 1280+__svml_dsinh_ha_data_internal(%rip), %xmm15 #1594.35 - movups 1344+__svml_dsinh_ha_data_internal(%rip), %xmm6 #1596.32 + movups 1280+__jsvml_dsinh_ha_data_internal(%rip), %xmm15 #1594.35 + movups 1344+__jsvml_dsinh_ha_data_internal(%rip), %xmm6 #1596.32 mulpd %xmm1, %xmm15 #1594.35 mulpd %xmm1, %xmm6 #1596.32 subpd %xmm15, %xmm7 #1594.13 @@ -1286,19 +1286,19 @@ __svml_sinh2_ha_e9: movhpd 128(%rcx,%rsi), %xmm4 #1590.19 paddq %xmm9, %xmm4 #1608.23 subpd %xmm3, %xmm4 #1619.26 - movups 1152+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1622.31 + movups 1152+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1622.31 mulpd %xmm1, %xmm3 #1622.31 subpd %xmm8, %xmm4 #1620.26 - addpd 1024+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1622.19 - movups 1088+__svml_dsinh_ha_data_internal(%rip), %xmm5 #1621.29 + addpd 1024+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1622.19 + movups 1088+__jsvml_dsinh_ha_data_internal(%rip), %xmm5 #1621.29 mulpd %xmm1, %xmm5 #1621.29 mulpd %xmm1, %xmm3 #1624.31 - addpd 960+__svml_dsinh_ha_data_internal(%rip), %xmm5 #1621.17 - addpd 896+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1624.19 + addpd 960+__jsvml_dsinh_ha_data_internal(%rip), %xmm5 #1621.17 + addpd 896+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1624.19 mulpd %xmm1, %xmm5 #1623.29 mulpd %xmm1, %xmm3 #1625.31 - addpd 832+__svml_dsinh_ha_data_internal(%rip), %xmm5 #1623.17 - addpd 768+__svml_dsinh_ha_data_internal(%rip), %xmm3 #1625.19 + addpd 832+__jsvml_dsinh_ha_data_internal(%rip), %xmm5 #1623.17 + addpd 768+__jsvml_dsinh_ha_data_internal(%rip), %xmm3 #1625.19 mulpd %xmm1, %xmm5 #1626.13 mulpd %xmm3, %xmm1 #1627.15 mulpd %xmm7, %xmm5 #1629.32 @@ -1364,29 +1364,29 @@ __svml_sinh2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1635.546 lea 128(%rsp,%r12,8), %rsi #1635.546 -..___tag_value___svml_sinh2_ha_e9.153: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1635.546 -..___tag_value___svml_sinh2_ha_e9.154: +..___tag_value___jsvml_sinh2_ha_e9.153: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1635.546 +..___tag_value___jsvml_sinh2_ha_e9.154: jmp ..B8.8 # Prob 100% #1635.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinh2_ha_e9,@function - .size __svml_sinh2_ha_e9,.-__svml_sinh2_ha_e9 -..LN__svml_sinh2_ha_e9.7: + .type __jsvml_sinh2_ha_e9,@function + .size __jsvml_sinh2_ha_e9,.-__jsvml_sinh2_ha_e9 +..LN__jsvml_sinh2_ha_e9.7: .data -# -- End __svml_sinh2_ha_e9 +# -- End __jsvml_sinh2_ha_e9 .text -.L_2__routine_start___svml_sinh8_ha_z0_8: -# -- Begin __svml_sinh8_ha_z0 +.L_2__routine_start___jsvml_sinh8_ha_z0_8: +# -- Begin __jsvml_sinh8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_sinh8_ha_z0 -# --- __svml_sinh8_ha_z0(__m512d) -__svml_sinh8_ha_z0: + .globl __jsvml_sinh8_ha_z0 +# --- __jsvml_sinh8_ha_z0(__m512d) +__jsvml_sinh8_ha_z0: # parameter 1: %zmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1395,7 +1395,7 @@ __svml_sinh8_ha_z0: .byte 30 #1748.759 .byte 250 #1748.759 .cfi_startproc -..___tag_value___svml_sinh8_ha_z0.156: +..___tag_value___jsvml_sinh8_ha_z0.156: ..L157: #1643.1 pushq %rbp #1643.1 @@ -1406,38 +1406,38 @@ __svml_sinh8_ha_z0: andq $-64, %rsp #1643.1 subq $192, %rsp #1643.1 vmovaps %zmm0, %zmm6 #1643.1 - vmovups 1408+__svml_dsinh_ha_data_internal(%rip), %zmm0 #1688.48 - vmovups 512+__svml_dsinh_ha_data_internal(%rip), %zmm9 #1678.52 - vmovups 1216+__svml_dsinh_ha_data_internal(%rip), %zmm7 #1691.13 - vmovups 576+__svml_dsinh_ha_data_internal(%rip), %zmm14 #1696.58 - vmovups __svml_dsinh_ha_data_internal(%rip), %zmm12 #1702.281 - vmovups 128+__svml_dsinh_ha_data_internal(%rip), %zmm15 #1704.285 - vmovups 1088+__svml_dsinh_ha_data_internal(%rip), %zmm3 #1686.49 - vmovups 1152+__svml_dsinh_ha_data_internal(%rip), %zmm4 #1687.49 - vmovups 832+__svml_dsinh_ha_data_internal(%rip), %zmm1 #1682.49 - vmovups 896+__svml_dsinh_ha_data_internal(%rip), %zmm2 #1683.49 + vmovups 1408+__jsvml_dsinh_ha_data_internal(%rip), %zmm0 #1688.48 + vmovups 512+__jsvml_dsinh_ha_data_internal(%rip), %zmm9 #1678.52 + vmovups 1216+__jsvml_dsinh_ha_data_internal(%rip), %zmm7 #1691.13 + vmovups 576+__jsvml_dsinh_ha_data_internal(%rip), %zmm14 #1696.58 + vmovups __jsvml_dsinh_ha_data_internal(%rip), %zmm12 #1702.281 + vmovups 128+__jsvml_dsinh_ha_data_internal(%rip), %zmm15 #1704.285 + vmovups 1088+__jsvml_dsinh_ha_data_internal(%rip), %zmm3 #1686.49 + vmovups 1152+__jsvml_dsinh_ha_data_internal(%rip), %zmm4 #1687.49 + vmovups 832+__jsvml_dsinh_ha_data_internal(%rip), %zmm1 #1682.49 + vmovups 896+__jsvml_dsinh_ha_data_internal(%rip), %zmm2 #1683.49 vandpd %zmm6, %zmm0, %zmm5 #1689.17 vxorpd %zmm6, %zmm5, %zmm8 #1690.16 vfmadd213pd {rn-sae}, %zmm9, %zmm8, %zmm7 #1691.13 vpsrlq $32, %zmm8, %zmm10 #1693.38 vcmppd $0, {sae}, %zmm7, %zmm14, %k1 #1697.24 vpmovqd %zmm10, %ymm11 #1693.16 - vpcmpgtd 640+__svml_dsinh_ha_data_internal(%rip), %ymm11, %ymm13 #1694.23 + vpcmpgtd 640+__jsvml_dsinh_ha_data_internal(%rip), %ymm11, %ymm13 #1694.23 vblendmpd %zmm9, %zmm7, %zmm11{%k1} #1698.21 - vmovups 384+__svml_dsinh_ha_data_internal(%rip), %zmm7 #1705.285 + vmovups 384+__jsvml_dsinh_ha_data_internal(%rip), %zmm7 #1705.285 vmovmskps %ymm13, %esi #1695.44 - vmovups 256+__svml_dsinh_ha_data_internal(%rip), %zmm13 #1703.281 - vpandq 704+__svml_dsinh_ha_data_internal(%rip), %zmm11, %zmm10 #1700.17 + vmovups 256+__jsvml_dsinh_ha_data_internal(%rip), %zmm13 #1703.281 + vpandq 704+__jsvml_dsinh_ha_data_internal(%rip), %zmm11, %zmm10 #1700.17 vpxorq %zmm10, %zmm11, %zmm14 #1701.13 - vpermt2pd 64+__svml_dsinh_ha_data_internal(%rip), %zmm10, %zmm12 #1702.281 - vpermt2pd 320+__svml_dsinh_ha_data_internal(%rip), %zmm10, %zmm13 #1703.281 - vpermt2pd 192+__svml_dsinh_ha_data_internal(%rip), %zmm10, %zmm15 #1704.285 - vpermt2pd 448+__svml_dsinh_ha_data_internal(%rip), %zmm10, %zmm7 #1705.285 + vpermt2pd 64+__jsvml_dsinh_ha_data_internal(%rip), %zmm10, %zmm12 #1702.281 + vpermt2pd 320+__jsvml_dsinh_ha_data_internal(%rip), %zmm10, %zmm13 #1703.281 + vpermt2pd 192+__jsvml_dsinh_ha_data_internal(%rip), %zmm10, %zmm15 #1704.285 + vpermt2pd 448+__jsvml_dsinh_ha_data_internal(%rip), %zmm10, %zmm7 #1705.285 vsubpd {rn-sae}, %zmm9, %zmm11, %zmm10 #1706.15 - vmovups 1280+__svml_dsinh_ha_data_internal(%rip), %zmm9 #1707.51 + vmovups 1280+__jsvml_dsinh_ha_data_internal(%rip), %zmm9 #1707.51 vandnpd %zmm7, %zmm0, %zmm0 #1724.22 vfnmadd231pd {rn-sae}, %zmm9, %zmm10, %zmm8 #1708.13 - vmovups 1344+__svml_dsinh_ha_data_internal(%rip), %zmm9 #1709.51 + vmovups 1344+__jsvml_dsinh_ha_data_internal(%rip), %zmm9 #1709.51 vfnmadd231pd {rn-sae}, %zmm9, %zmm10, %zmm8 #1710.13 vpsllq $48, %zmm14, %zmm10 #1712.15 vmulpd {rn-sae}, %zmm8, %zmm8, %zmm9 #1711.16 @@ -1451,14 +1451,14 @@ __svml_sinh8_ha_z0: vxorpd %zmm7, %zmm7, %zmm7{%k2} #1730.23 vsubpd {rn-sae}, %zmm11, %zmm14, %zmm0 #1731.24 vaddpd {rn-sae}, %zmm0, %zmm12, %zmm12 #1732.24 - vmovups 960+__svml_dsinh_ha_data_internal(%rip), %zmm0 #1735.17 + vmovups 960+__jsvml_dsinh_ha_data_internal(%rip), %zmm0 #1735.17 vsubpd {rn-sae}, %zmm12, %zmm15, %zmm15 #1733.28 vfmadd231pd {rn-sae}, %zmm9, %zmm3, %zmm0 #1735.17 - vmovups 1024+__svml_dsinh_ha_data_internal(%rip), %zmm3 #1736.19 + vmovups 1024+__jsvml_dsinh_ha_data_internal(%rip), %zmm3 #1736.19 vsubpd {rn-sae}, %zmm7, %zmm15, %zmm7 #1734.28 vfmadd213pd {rn-sae}, %zmm1, %zmm9, %zmm0 #1737.17 vfmadd231pd {rn-sae}, %zmm9, %zmm4, %zmm3 #1736.19 - vmovups 768+__svml_dsinh_ha_data_internal(%rip), %zmm1 #1739.19 + vmovups 768+__jsvml_dsinh_ha_data_internal(%rip), %zmm1 #1739.19 vmulpd {rn-sae}, %zmm9, %zmm0, %zmm4 #1740.15 vfmadd213pd {rn-sae}, %zmm2, %zmm9, %zmm3 #1738.19 vfmadd213pd {rn-sae}, %zmm8, %zmm8, %zmm4 #1742.13 @@ -1577,30 +1577,30 @@ __svml_sinh8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #1748.759 lea 128(%rsp,%rbx,8), %rsi #1748.759 -..___tag_value___svml_sinh8_ha_z0.184: -# __svml_dsinh_ha_cout_rare_internal(const double *, double *) - call __svml_dsinh_ha_cout_rare_internal #1748.759 -..___tag_value___svml_sinh8_ha_z0.185: +..___tag_value___jsvml_sinh8_ha_z0.184: +# __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dsinh_ha_cout_rare_internal #1748.759 +..___tag_value___jsvml_sinh8_ha_z0.185: jmp ..B9.13 # Prob 100% #1748.759 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_sinh8_ha_z0,@function - .size __svml_sinh8_ha_z0,.-__svml_sinh8_ha_z0 -..LN__svml_sinh8_ha_z0.8: + .type __jsvml_sinh8_ha_z0,@function + .size __jsvml_sinh8_ha_z0,.-__jsvml_sinh8_ha_z0 +..LN__jsvml_sinh8_ha_z0.8: .data -# -- End __svml_sinh8_ha_z0 +# -- End __jsvml_sinh8_ha_z0 .text -.L_2__routine_start___svml_dsinh_ha_cout_rare_internal_9: -# -- Begin __svml_dsinh_ha_cout_rare_internal +.L_2__routine_start___jsvml_dsinh_ha_cout_rare_internal_9: +# -- Begin __jsvml_dsinh_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dsinh_ha_cout_rare_internal - .globl __svml_dsinh_ha_cout_rare_internal -# --- __svml_dsinh_ha_cout_rare_internal(const double *, double *) -__svml_dsinh_ha_cout_rare_internal: + .hidden __jsvml_dsinh_ha_cout_rare_internal + .globl __jsvml_dsinh_ha_cout_rare_internal +# --- __jsvml_dsinh_ha_cout_rare_internal(const double *, double *) +__jsvml_dsinh_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1610,7 +1610,7 @@ __svml_dsinh_ha_cout_rare_internal: .byte 30 #949.15 .byte 250 #949.15 .cfi_startproc -..___tag_value___svml_dsinh_ha_cout_rare_internal.187: +..___tag_value___jsvml_dsinh_ha_cout_rare_internal.187: ..L188: #800.1 movq %rsi, %r9 #800.1 @@ -2027,17 +2027,17 @@ __svml_dsinh_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dsinh_ha_cout_rare_internal,@function - .size __svml_dsinh_ha_cout_rare_internal,.-__svml_dsinh_ha_cout_rare_internal -..LN__svml_dsinh_ha_cout_rare_internal.9: + .type __jsvml_dsinh_ha_cout_rare_internal,@function + .size __jsvml_dsinh_ha_cout_rare_internal,.-__jsvml_dsinh_ha_cout_rare_internal +..LN__jsvml_dsinh_ha_cout_rare_internal.9: .data -# -- End __svml_dsinh_ha_cout_rare_internal +# -- End __jsvml_dsinh_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dsinh_ha_data_internal - .globl __svml_dsinh_ha_data_internal -__svml_dsinh_ha_data_internal: + .hidden __jsvml_dsinh_ha_data_internal + .globl __jsvml_dsinh_ha_data_internal +__jsvml_dsinh_ha_data_internal: .long 0 .long 1071644672 .long 1828292879 @@ -6598,8 +6598,8 @@ __svml_dsinh_ha_data_internal: .long 1124597760 .long 1 .long 1124597760 - .type __svml_dsinh_ha_data_internal,@object - .size __svml_dsinh_ha_data_internal,18240 + .type __jsvml_dsinh_ha_data_internal,@object + .size __jsvml_dsinh_ha_data_internal,18240 .align 32 _vmldSinhHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_tan_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_tan_linux_x86.S similarity index 97% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_tan_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_tan_linux_x86.S index c698b7880fc..18bc9a3fe58 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_tan_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_tan_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_tan.c" .text ..TXTST0: -.L_2__routine_start___svml_tan1_ha_ex_0: -# -- Begin __svml_tan1_ha_ex +.L_2__routine_start___jsvml_tan1_ha_ex_0: +# -- Begin __jsvml_tan1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_tan1_ha_ex -# --- __svml_tan1_ha_ex(__m128d) -__svml_tan1_ha_ex: + .globl __jsvml_tan1_ha_ex +# --- __jsvml_tan1_ha_ex(__m128d) +__jsvml_tan1_ha_ex: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_tan1_ha_ex: .byte 30 #6476.22 .byte 250 #6476.22 .cfi_startproc -..___tag_value___svml_tan1_ha_ex.1: +..___tag_value___jsvml_tan1_ha_ex.1: ..L2: #6047.1 pushq %rbp #6047.1 @@ -58,17 +58,17 @@ __svml_tan1_ha_ex: andq $-64, %rsp #6047.1 subq $128, %rsp #6047.1 xorl %edx, %edx #6106.9 - movsd 1024+__svml_dtan_ha_data_internal(%rip), %xmm10 #6107.23 + movsd 1024+__jsvml_dtan_ha_data_internal(%rip), %xmm10 #6107.23 movaps %xmm10, %xmm1 #6108.20 andnps %xmm0, %xmm10 #6109.21 andps %xmm0, %xmm1 #6108.20 movaps %xmm1, %xmm11 #6116.29 movaps %xmm1, %xmm3 #6119.18 - mulsd 1472+__svml_dtan_ha_data_internal(%rip), %xmm11 #6116.29 + mulsd 1472+__jsvml_dtan_ha_data_internal(%rip), %xmm11 #6116.29 movaps %xmm1, %xmm2 #6111.34 - cmpnlesd 28160+__svml_dtan_ha_data_internal(%rip), %xmm2 #6111.34 - movsd 1152+__svml_dtan_ha_data_internal(%rip), %xmm5 #6115.22 - movq 1408+__svml_dtan_ha_data_internal(%rip), %xmm8 #6128.25 + cmpnlesd 28160+__jsvml_dtan_ha_data_internal(%rip), %xmm2 #6111.34 + movsd 1152+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #6115.22 + movq 1408+__jsvml_dtan_ha_data_internal(%rip), %xmm8 #6128.25 addsd %xmm5, %xmm11 #6116.17 movmskpd %xmm2, %esi #6113.82 movaps %xmm11, %xmm6 #6117.17 @@ -78,13 +78,13 @@ __svml_tan1_ha_ex: movd %xmm11, %eax #6135.136 movaps %xmm6, %xmm9 #6119.40 movaps %xmm6, %xmm4 #6121.23 - mulsd 1216+__svml_dtan_ha_data_internal(%rip), %xmm9 #6119.40 + mulsd 1216+__jsvml_dtan_ha_data_internal(%rip), %xmm9 #6119.40 imull $104, %eax, %ecx #6135.234 - mulsd 1280+__svml_dtan_ha_data_internal(%rip), %xmm4 #6121.23 - mulsd 1344+__svml_dtan_ha_data_internal(%rip), %xmm6 #6126.36 + mulsd 1280+__jsvml_dtan_ha_data_internal(%rip), %xmm4 #6121.23 + mulsd 1344+__jsvml_dtan_ha_data_internal(%rip), %xmm6 #6126.36 subsd %xmm9, %xmm3 #6119.18 movaps %xmm3, %xmm7 #6122.22 - lea 1632+__svml_dtan_ha_data_internal(%rip), %rax #6135.378 + lea 1632+__jsvml_dtan_ha_data_internal(%rip), %rax #6135.378 movups .L_2il0floatpacket.27(%rip), %xmm15 #6149.24 subsd %xmm4, %xmm7 #6122.22 movaps %xmm7, %xmm5 #6130.17 @@ -217,10 +217,10 @@ __svml_tan1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #6479.546 lea 64(%rsp), %rsi #6479.546 -..___tag_value___svml_tan1_ha_ex.17: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #6479.546 -..___tag_value___svml_tan1_ha_ex.18: +..___tag_value___jsvml_tan1_ha_ex.17: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #6479.546 +..___tag_value___jsvml_tan1_ha_ex.18: jmp ..B1.5 # Prob 100% #6479.546 # LOE rbx r12 r13 r14 r15 ..B1.8: # Preds ..B1.1 @@ -228,7 +228,7 @@ __svml_tan1_ha_ex: movdqu .L_2il0floatpacket.29(%rip), %xmm10 #6286.16 movaps %xmm1, %xmm8 #6197.21 pand %xmm1, %xmm10 #6286.16 - lea __svml_dtan_ha_reduction_data_internal(%rip), %rdi #6288.377 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %rdi #6288.377 psrlq $52, %xmm10 #6287.16 movd %xmm10, %ecx #6288.124 movdqu .L_2il0floatpacket.30(%rip), %xmm14 #6296.19 @@ -241,7 +241,7 @@ __svml_tan1_ha_ex: movq 16(%rdi,%rsi), %xmm11 #6290.377 movdqu .L_2il0floatpacket.32(%rip), %xmm12 #6298.15 movdqa %xmm11, %xmm3 #6303.10 - movsd 1088+__svml_dtan_ha_data_internal(%rip), %xmm6 #6196.28 + movsd 1088+__jsvml_dtan_ha_data_internal(%rip), %xmm6 #6196.28 psrlq $32, %xmm3 #6303.10 movups %xmm0, (%rsp) #[spill] pand %xmm12, %xmm14 #6306.10 @@ -464,20 +464,20 @@ __svml_tan1_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 .cfi_endproc # mark_end; - .type __svml_tan1_ha_ex,@function - .size __svml_tan1_ha_ex,.-__svml_tan1_ha_ex -..LN__svml_tan1_ha_ex.0: + .type __jsvml_tan1_ha_ex,@function + .size __jsvml_tan1_ha_ex,.-__jsvml_tan1_ha_ex +..LN__jsvml_tan1_ha_ex.0: .data -# -- End __svml_tan1_ha_ex +# -- End __jsvml_tan1_ha_ex .text -.L_2__routine_start___svml_tan1_ha_e9_1: -# -- Begin __svml_tan1_ha_e9 +.L_2__routine_start___jsvml_tan1_ha_e9_1: +# -- Begin __jsvml_tan1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tan1_ha_e9 -# --- __svml_tan1_ha_e9(__m128d) -__svml_tan1_ha_e9: + .globl __jsvml_tan1_ha_e9 +# --- __jsvml_tan1_ha_e9(__m128d) +__jsvml_tan1_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -486,7 +486,7 @@ __svml_tan1_ha_e9: .byte 30 #6916.22 .byte 250 #6916.22 .cfi_startproc -..___tag_value___svml_tan1_ha_e9.23: +..___tag_value___jsvml_tan1_ha_e9.23: ..L24: #6487.1 pushq %rbp #6487.1 @@ -497,15 +497,15 @@ __svml_tan1_ha_e9: andq $-64, %rsp #6487.1 subq $128, %rsp #6487.1 xorl %edx, %edx #6546.9 - movsd 1024+__svml_dtan_ha_data_internal(%rip), %xmm9 #6547.23 + movsd 1024+__jsvml_dtan_ha_data_internal(%rip), %xmm9 #6547.23 movaps %xmm9, %xmm1 #6548.20 andnps %xmm0, %xmm9 #6549.21 andps %xmm0, %xmm1 #6548.20 movaps %xmm1, %xmm10 #6556.29 movaps %xmm1, %xmm2 #6559.18 - mulsd 1472+__svml_dtan_ha_data_internal(%rip), %xmm10 #6556.29 - movsd 1152+__svml_dtan_ha_data_internal(%rip), %xmm4 #6555.22 - movq 1408+__svml_dtan_ha_data_internal(%rip), %xmm7 #6568.31 + mulsd 1472+__jsvml_dtan_ha_data_internal(%rip), %xmm10 #6556.29 + movsd 1152+__jsvml_dtan_ha_data_internal(%rip), %xmm4 #6555.22 + movq 1408+__jsvml_dtan_ha_data_internal(%rip), %xmm7 #6568.31 addsd %xmm4, %xmm10 #6556.17 movaps %xmm10, %xmm5 #6557.17 pand %xmm7, %xmm10 #6569.27 @@ -514,13 +514,13 @@ __svml_tan1_ha_e9: movd %xmm10, %eax #6575.136 movaps %xmm5, %xmm8 #6559.40 movaps %xmm5, %xmm3 #6561.23 - mulsd 1216+__svml_dtan_ha_data_internal(%rip), %xmm8 #6559.40 + mulsd 1216+__jsvml_dtan_ha_data_internal(%rip), %xmm8 #6559.40 imull $104, %eax, %ecx #6575.240 - mulsd 1280+__svml_dtan_ha_data_internal(%rip), %xmm3 #6561.23 - mulsd 1344+__svml_dtan_ha_data_internal(%rip), %xmm5 #6566.36 + mulsd 1280+__jsvml_dtan_ha_data_internal(%rip), %xmm3 #6561.23 + mulsd 1344+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #6566.36 subsd %xmm8, %xmm2 #6559.18 movaps %xmm2, %xmm6 #6562.22 - lea 1632+__svml_dtan_ha_data_internal(%rip), %rax #6575.384 + lea 1632+__jsvml_dtan_ha_data_internal(%rip), %rax #6575.384 movups .L_2il0floatpacket.27(%rip), %xmm15 #6589.24 subsd %xmm3, %xmm6 #6562.22 movaps %xmm6, %xmm4 #6570.17 @@ -608,7 +608,7 @@ __svml_tan1_ha_e9: movaps %xmm1, %xmm0 #6551.34 movups %xmm9, 32(%rsp) #6549.21[spill] addsd %xmm2, %xmm11 #6630.19 - cmpnlesd 28160+__svml_dtan_ha_data_internal(%rip), %xmm0 #6551.34 + cmpnlesd 28160+__jsvml_dtan_ha_data_internal(%rip), %xmm0 #6551.34 addsd %xmm11, %xmm12 #6631.18 movmskpd %xmm0, %esi #6553.82 pxor %xmm9, %xmm12 #6632.18 @@ -651,10 +651,10 @@ __svml_tan1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #6919.546 lea 64(%rsp), %rsi #6919.546 -..___tag_value___svml_tan1_ha_e9.35: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #6919.546 -..___tag_value___svml_tan1_ha_e9.36: +..___tag_value___jsvml_tan1_ha_e9.35: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #6919.546 +..___tag_value___jsvml_tan1_ha_e9.36: jmp ..B2.5 # Prob 100% #6919.546 # LOE rbx r12 r13 r14 r15 ..B2.8: # Preds ..B2.1 @@ -662,7 +662,7 @@ __svml_tan1_ha_e9: movdqu .L_2il0floatpacket.29(%rip), %xmm10 #6726.22 movaps %xmm1, %xmm8 #6637.21 pand %xmm1, %xmm10 #6726.22 - lea __svml_dtan_ha_reduction_data_internal(%rip), %rdi #6728.383 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %rdi #6728.383 psrlq $52, %xmm10 #6727.22 movd %xmm10, %ecx #6728.124 movdqu .L_2il0floatpacket.30(%rip), %xmm15 #6736.25 @@ -678,7 +678,7 @@ __svml_tan1_ha_e9: movdqa %xmm11, %xmm3 #6743.16 movdqu .L_2il0floatpacket.32(%rip), %xmm12 #6738.21 psrlq $32, %xmm3 #6743.16 - movsd 1088+__svml_dtan_ha_data_internal(%rip), %xmm6 #6636.28 + movsd 1088+__jsvml_dtan_ha_data_internal(%rip), %xmm6 #6636.28 pand %xmm12, %xmm15 #6746.16 andps %xmm6, %xmm8 #6637.21 movdqa %xmm15, %xmm7 #6756.17 @@ -896,20 +896,20 @@ __svml_tan1_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm12 .cfi_endproc # mark_end; - .type __svml_tan1_ha_e9,@function - .size __svml_tan1_ha_e9,.-__svml_tan1_ha_e9 -..LN__svml_tan1_ha_e9.1: + .type __jsvml_tan1_ha_e9,@function + .size __jsvml_tan1_ha_e9,.-__jsvml_tan1_ha_e9 +..LN__jsvml_tan1_ha_e9.1: .data -# -- End __svml_tan1_ha_e9 +# -- End __jsvml_tan1_ha_e9 .text -.L_2__routine_start___svml_tan4_ha_e9_2: -# -- Begin __svml_tan4_ha_e9 +.L_2__routine_start___jsvml_tan4_ha_e9_2: +# -- Begin __jsvml_tan4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tan4_ha_e9 -# --- __svml_tan4_ha_e9(__m256d) -__svml_tan4_ha_e9: + .globl __jsvml_tan4_ha_e9 +# --- __jsvml_tan4_ha_e9(__m256d) +__jsvml_tan4_ha_e9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -918,7 +918,7 @@ __svml_tan4_ha_e9: .byte 30 #7356.22 .byte 250 #7356.22 .cfi_startproc -..___tag_value___svml_tan4_ha_e9.41: +..___tag_value___jsvml_tan4_ha_e9.41: ..L42: #6927.1 pushq %rbp #6927.1 @@ -928,16 +928,16 @@ __svml_tan4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #6927.1 subq $448, %rsp #6927.1 - lea 1632+__svml_dtan_ha_data_internal(%rip), %rsi #7015.625 - vmovupd 1024+__svml_dtan_ha_data_internal(%rip), %ymm15 #6987.57 + lea 1632+__jsvml_dtan_ha_data_internal(%rip), %rsi #7015.625 + vmovupd 1024+__jsvml_dtan_ha_data_internal(%rip), %ymm15 #6987.57 xorl %eax, %eax #6986.9 - vmovupd 1152+__svml_dtan_ha_data_internal(%rip), %ymm9 #6995.56 - vmovupd 1408+__svml_dtan_ha_data_internal(%rip), %xmm1 #7008.31 + vmovupd 1152+__jsvml_dtan_ha_data_internal(%rip), %ymm9 #6995.56 + vmovupd 1408+__jsvml_dtan_ha_data_internal(%rip), %xmm1 #7008.31 vmovupd %ymm0, 320(%rsp) #6927.1[spill] vandpd %ymm15, %ymm0, %ymm5 #6988.20 - vmulpd 1472+__svml_dtan_ha_data_internal(%rip), %ymm5, %ymm10 #6996.32 + vmulpd 1472+__jsvml_dtan_ha_data_internal(%rip), %ymm5, %ymm10 #6996.32 vmovupd %ymm5, 416(%rsp) #6988.20[spill] - vcmpnle_uqpd 28160+__svml_dtan_ha_data_internal(%rip), %ymm5, %ymm12 #6991.34 + vcmpnle_uqpd 28160+__jsvml_dtan_ha_data_internal(%rip), %ymm5, %ymm12 #6991.34 vaddpd %ymm10, %ymm9, %ymm10 #6996.17 vmovupd %ymm12, 352(%rsp) #6991.34[spill] vandnpd %ymm0, %ymm15, %ymm13 #6989.21 @@ -946,9 +946,9 @@ __svml_tan4_ha_e9: vshufps $221, %xmm11, %xmm12, %xmm14 #6993.99 vsubpd %ymm9, %ymm10, %ymm12 #6997.17 vmovups %xmm14, 96(%rsp) #6993.99[spill] - vmulpd 1216+__svml_dtan_ha_data_internal(%rip), %ymm12, %ymm15 #6999.43 - vmulpd 1280+__svml_dtan_ha_data_internal(%rip), %ymm12, %ymm13 #7001.23 - vmulpd 1344+__svml_dtan_ha_data_internal(%rip), %ymm12, %ymm14 #7006.39 + vmulpd 1216+__jsvml_dtan_ha_data_internal(%rip), %ymm12, %ymm15 #6999.43 + vmulpd 1280+__jsvml_dtan_ha_data_internal(%rip), %ymm12, %ymm13 #7001.23 + vmulpd 1344+__jsvml_dtan_ha_data_internal(%rip), %ymm12, %ymm14 #7006.39 vsubpd %ymm15, %ymm5, %ymm7 #6999.18 vsubpd %ymm13, %ymm7, %ymm9 #7002.22 vsubpd %ymm9, %ymm7, %ymm8 #7003.21 @@ -1166,18 +1166,18 @@ __svml_tan4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #7359.552 lea 128(%rsp,%r12,8), %rsi #7359.552 -..___tag_value___svml_tan4_ha_e9.74: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #7359.552 -..___tag_value___svml_tan4_ha_e9.75: +..___tag_value___jsvml_tan4_ha_e9.74: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #7359.552 +..___tag_value___jsvml_tan4_ha_e9.75: jmp ..B3.9 # Prob 100% #7359.552 .cfi_restore 12 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B3.12: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq - vmovupd 1088+__svml_dtan_ha_data_internal(%rip), %ymm14 #7076.62 - lea __svml_dtan_ha_reduction_data_internal(%rip), %r9 #7168.621 + vmovupd 1088+__jsvml_dtan_ha_data_internal(%rip), %ymm14 #7076.62 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %r9 #7168.621 vmovupd %ymm7, 416(%rsp) #[spill] vmovdqu .L_2il0floatpacket.29(%rip), %xmm6 #7165.22 vmovupd %ymm0, (%rsp) #[spill] @@ -1223,7 +1223,7 @@ __svml_tan4_ha_e9: vmovhpd (%r10,%r9), %xmm4, %xmm13 #7168.1337 vpsrlq $32, %xmm14, %xmm10 #7185.16 vmovq 16(%rsi,%r9), %xmm8 #7170.1369 - lea 1632+__svml_dtan_ha_data_internal(%rip), %rsi #7298.629 + lea 1632+__jsvml_dtan_ha_data_internal(%rip), %rsi #7298.629 vmovdqu .L_2il0floatpacket.32(%rip), %xmm15 #7178.21 vmovhpd 8(%r10,%r9), %xmm12, %xmm4 #7169.1338 vpand %xmm15, %xmm13, %xmm12 #7180.83 @@ -1557,20 +1557,20 @@ __svml_tan4_ha_e9: # LOE rbx r12 r13 r14 r15 eax ymm0 .cfi_endproc # mark_end; - .type __svml_tan4_ha_e9,@function - .size __svml_tan4_ha_e9,.-__svml_tan4_ha_e9 -..LN__svml_tan4_ha_e9.2: + .type __jsvml_tan4_ha_e9,@function + .size __jsvml_tan4_ha_e9,.-__jsvml_tan4_ha_e9 +..LN__jsvml_tan4_ha_e9.2: .data -# -- End __svml_tan4_ha_e9 +# -- End __jsvml_tan4_ha_e9 .text -.L_2__routine_start___svml_tan1_ha_l9_3: -# -- Begin __svml_tan1_ha_l9 +.L_2__routine_start___jsvml_tan1_ha_l9_3: +# -- Begin __jsvml_tan1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tan1_ha_l9 -# --- __svml_tan1_ha_l9(__m128d) -__svml_tan1_ha_l9: + .globl __jsvml_tan1_ha_l9 +# --- __jsvml_tan1_ha_l9(__m128d) +__jsvml_tan1_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -1579,7 +1579,7 @@ __svml_tan1_ha_l9: .byte 30 #7687.18 .byte 250 #7687.18 .cfi_startproc -..___tag_value___svml_tan1_ha_l9.113: +..___tag_value___jsvml_tan1_ha_l9.113: ..L114: #7367.1 pushq %rbp #7367.1 @@ -1590,20 +1590,20 @@ __svml_tan1_ha_l9: andq $-64, %rsp #7367.1 subq $128, %rsp #7367.1 vmovapd %xmm0, %xmm14 #7367.1 - vmovsd 1024+__svml_dtan_ha_data_internal(%rip), %xmm1 #7428.19 + vmovsd 1024+__jsvml_dtan_ha_data_internal(%rip), %xmm1 #7428.19 xorl %esi, %esi #7427.5 - vmovsd 1152+__svml_dtan_ha_data_internal(%rip), %xmm4 #7439.24 + vmovsd 1152+__jsvml_dtan_ha_data_internal(%rip), %xmm4 #7439.24 vandpd %xmm1, %xmm14, %xmm11 #7429.16 vmovapd %xmm14, %xmm1 #7440.17 - vcmpnlesd 28160+__svml_dtan_ha_data_internal(%rip), %xmm11, %xmm0 #7433.30 - vfmadd132sd __svml_dtan_ha_data_internal(%rip), %xmm4, %xmm1 #7440.17 - vmovsd 256+__svml_dtan_ha_data_internal(%rip), %xmm5 #7443.23 - vmovsd 320+__svml_dtan_ha_data_internal(%rip), %xmm7 #7444.23 + vcmpnlesd 28160+__jsvml_dtan_ha_data_internal(%rip), %xmm11, %xmm0 #7433.30 + vfmadd132sd __jsvml_dtan_ha_data_internal(%rip), %xmm4, %xmm1 #7440.17 + vmovsd 256+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #7443.23 + vmovsd 320+__jsvml_dtan_ha_data_internal(%rip), %xmm7 #7444.23 vsubsd %xmm4, %xmm1, %xmm10 #7441.17 vmovmskpd %xmm0, %eax #7435.78 vmovapd %xmm10, %xmm2 #7445.22 vmovapd %xmm10, %xmm3 #7446.22 - vfnmadd132sd 64+__svml_dtan_ha_data_internal(%rip), %xmm14, %xmm2 #7445.22 + vfnmadd132sd 64+__jsvml_dtan_ha_data_internal(%rip), %xmm14, %xmm2 #7445.22 vmovapd %xmm10, %xmm4 #7447.21 vmovapd %xmm10, %xmm9 #7450.22 vfnmadd213sd %xmm2, %xmm5, %xmm3 #7446.22 @@ -1620,15 +1620,15 @@ __svml_tan1_ha_l9: # Execution count [1.00e+00] vmulsd %xmm4, %xmm4, %xmm8 #7692.14 vpsllq $3, %xmm1, %xmm5 #7689.226 - vmovsd 896+__svml_dtan_ha_data_internal(%rip), %xmm7 #7693.21 - lea 512+__svml_dtan_ha_data_internal(%rip), %rdx #7690.14 - vfmadd213sd 832+__svml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7695.20 + vmovsd 896+__jsvml_dtan_ha_data_internal(%rip), %xmm7 #7693.21 + lea 512+__jsvml_dtan_ha_data_internal(%rip), %rdx #7690.14 + vfmadd213sd 832+__jsvml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7695.20 vpand .L_2il0floatpacket.57(%rip), %xmm5, %xmm6 #7689.275 - vmovsd 960+__svml_dtan_ha_data_internal(%rip), %xmm5 #7712.15 + vmovsd 960+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #7712.15 vmovd %xmm6, %eax #7690.104 - vfmadd213sd 768+__svml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7697.20 - vfmadd213sd 704+__svml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7699.16 - vfmadd213sd 640+__svml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7701.16 + vfmadd213sd 768+__jsvml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7697.20 + vfmadd213sd 704+__jsvml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7699.16 + vfmadd213sd 640+__jsvml_dtan_ha_data_internal(%rip), %xmm8, %xmm7 #7701.16 vmulsd %xmm4, %xmm7, %xmm9 #7702.16 vfnmsub213sd %xmm10, %xmm8, %xmm9 #7703.20 movslq %eax, %rax #7690.104 @@ -1701,17 +1701,17 @@ __svml_tan1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #7730.546 lea 64(%rsp), %rsi #7730.546 -..___tag_value___svml_tan1_ha_l9.126: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #7730.546 -..___tag_value___svml_tan1_ha_l9.127: +..___tag_value___jsvml_tan1_ha_l9.126: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #7730.546 +..___tag_value___jsvml_tan1_ha_l9.127: jmp ..B4.5 # Prob 100% #7730.546 # LOE rbx r12 r13 r14 r15 ..B4.8: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq vmovupd %xmm1, (%rsp) #[spill] - lea __svml_dtan_ha_reduction_data_internal(%rip), %rcx #7548.383 - vmovsd 1088+__svml_dtan_ha_data_internal(%rip), %xmm1 #7456.24 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %rcx #7548.383 + vmovsd 1088+__jsvml_dtan_ha_data_internal(%rip), %xmm1 #7456.24 vandpd %xmm11, %xmm1, %xmm7 #7457.17 vmovupd %xmm4, 16(%rsp) #[spill] vcmpeqsd %xmm1, %xmm7, %xmm11 #7458.25 @@ -1849,20 +1849,20 @@ __svml_tan1_ha_l9: # LOE rbx r12 r13 r14 r15 esi xmm1 xmm4 xmm10 xmm14 .cfi_endproc # mark_end; - .type __svml_tan1_ha_l9,@function - .size __svml_tan1_ha_l9,.-__svml_tan1_ha_l9 -..LN__svml_tan1_ha_l9.3: + .type __jsvml_tan1_ha_l9,@function + .size __jsvml_tan1_ha_l9,.-__jsvml_tan1_ha_l9 +..LN__jsvml_tan1_ha_l9.3: .data -# -- End __svml_tan1_ha_l9 +# -- End __jsvml_tan1_ha_l9 .text -.L_2__routine_start___svml_tan8_ha_z0_4: -# -- Begin __svml_tan8_ha_z0 +.L_2__routine_start___jsvml_tan8_ha_z0_4: +# -- Begin __jsvml_tan8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_tan8_ha_z0 -# --- __svml_tan8_ha_z0(__m512d) -__svml_tan8_ha_z0: + .globl __jsvml_tan8_ha_z0 +# --- __jsvml_tan8_ha_z0(__m512d) +__jsvml_tan8_ha_z0: # parameter 1: %zmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -1871,7 +1871,7 @@ __svml_tan8_ha_z0: .byte 30 #8054.18 .byte 250 #8054.18 .cfi_startproc -..___tag_value___svml_tan8_ha_z0.135: +..___tag_value___jsvml_tan8_ha_z0.135: ..L136: #7738.1 pushq %rbp #7738.1 @@ -1883,14 +1883,14 @@ __svml_tan8_ha_z0: subq $192, %rsp #7738.1 xorl %esi, %esi #7798.5 vmovaps %zmm0, %zmm11 #7738.1 - vmovups 1152+__svml_dtan_ha_data_internal(%rip), %zmm1 #7806.56 - vmovups __svml_dtan_ha_data_internal(%rip), %zmm0 #7807.17 - vmovups 64+__svml_dtan_ha_data_internal(%rip), %zmm2 #7809.51 - vmovups 256+__svml_dtan_ha_data_internal(%rip), %zmm5 #7810.55 - vmovups 320+__svml_dtan_ha_data_internal(%rip), %zmm6 #7811.55 - vmovups 28160+__svml_dtan_ha_data_internal(%rip), %zmm3 #7801.61 + vmovups 1152+__jsvml_dtan_ha_data_internal(%rip), %zmm1 #7806.56 + vmovups __jsvml_dtan_ha_data_internal(%rip), %zmm0 #7807.17 + vmovups 64+__jsvml_dtan_ha_data_internal(%rip), %zmm2 #7809.51 + vmovups 256+__jsvml_dtan_ha_data_internal(%rip), %zmm5 #7810.55 + vmovups 320+__jsvml_dtan_ha_data_internal(%rip), %zmm6 #7811.55 + vmovups 28160+__jsvml_dtan_ha_data_internal(%rip), %zmm3 #7801.61 vfmadd213pd {rn-sae}, %zmm1, %zmm11, %zmm0 #7807.17 - vandpd 1024+__svml_dtan_ha_data_internal(%rip), %zmm11, %zmm10 #7800.16 + vandpd 1024+__jsvml_dtan_ha_data_internal(%rip), %zmm11, %zmm10 #7800.16 vsubpd {rn-sae}, %zmm1, %zmm0, %zmm9 #7808.19 vcmppd $22, {sae}, %zmm3, %zmm10, %k1 #7802.30 vfnmadd213pd {rn-sae}, %zmm11, %zmm9, %zmm2 #7812.22 @@ -1910,15 +1910,15 @@ __svml_tan8_ha_z0: ..B5.2: # Preds ..B5.17 ..B5.1 # Execution count [1.00e+00] vmulpd {rn-sae}, %zmm3, %zmm3, %zmm8 #8059.16 - vmovups 384+__svml_dtan_ha_data_internal(%rip), %zmm1 #8057.276 - vmovups 512+__svml_dtan_ha_data_internal(%rip), %zmm2 #8058.280 - vmovups 832+__svml_dtan_ha_data_internal(%rip), %zmm7 #8061.53 - vmovups 768+__svml_dtan_ha_data_internal(%rip), %zmm4 #8063.53 - vmovups 704+__svml_dtan_ha_data_internal(%rip), %zmm5 #8065.49 - vmovups 640+__svml_dtan_ha_data_internal(%rip), %zmm6 #8067.49 - vpermt2pd 576+__svml_dtan_ha_data_internal(%rip), %zmm0, %zmm2 #8058.280 - vpermt2pd 448+__svml_dtan_ha_data_internal(%rip), %zmm0, %zmm1 #8057.276 - vmovups 896+__svml_dtan_ha_data_internal(%rip), %zmm0 #8060.53 + vmovups 384+__jsvml_dtan_ha_data_internal(%rip), %zmm1 #8057.276 + vmovups 512+__jsvml_dtan_ha_data_internal(%rip), %zmm2 #8058.280 + vmovups 832+__jsvml_dtan_ha_data_internal(%rip), %zmm7 #8061.53 + vmovups 768+__jsvml_dtan_ha_data_internal(%rip), %zmm4 #8063.53 + vmovups 704+__jsvml_dtan_ha_data_internal(%rip), %zmm5 #8065.49 + vmovups 640+__jsvml_dtan_ha_data_internal(%rip), %zmm6 #8067.49 + vpermt2pd 576+__jsvml_dtan_ha_data_internal(%rip), %zmm0, %zmm2 #8058.280 + vpermt2pd 448+__jsvml_dtan_ha_data_internal(%rip), %zmm0, %zmm1 #8057.276 + vmovups 896+__jsvml_dtan_ha_data_internal(%rip), %zmm0 #8060.53 vfmadd231pd {rn-sae}, %zmm8, %zmm0, %zmm7 #8062.20 vfmadd213pd {rn-sae}, %zmm4, %zmm8, %zmm7 #8064.20 vfmadd213pd {rn-sae}, %zmm5, %zmm8, %zmm7 #8066.16 @@ -1931,7 +1931,7 @@ __svml_tan8_ha_z0: vaddpd {rn-sae}, %zmm1, %zmm0, %zmm3 #8074.23 vsubpd {rn-sae}, %zmm1, %zmm3, %zmm10 #8075.22 vsubpd {rn-sae}, %zmm10, %zmm0, %zmm12 #8076.22 - vmovups 960+__svml_dtan_ha_data_internal(%rip), %zmm10 #8079.47 + vmovups 960+__jsvml_dtan_ha_data_internal(%rip), %zmm10 #8079.47 vaddpd {rn-sae}, %zmm2, %zmm12, %zmm13 #8077.22 vmovaps %zmm10, %zmm4 #8080.23 vfnmadd231pd {rn-sae}, %zmm1, %zmm0, %zmm4 #8080.23 @@ -2058,10 +2058,10 @@ __svml_tan8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #8095.759 lea 128(%rsp,%rbx,8), %rsi #8095.759 -..___tag_value___svml_tan8_ha_z0.163: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #8095.759 -..___tag_value___svml_tan8_ha_z0.164: +..___tag_value___jsvml_tan8_ha_z0.163: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #8095.759 +..___tag_value___jsvml_tan8_ha_z0.164: jmp ..B5.14 # Prob 100% #8095.759 .cfi_restore 3 .cfi_restore 12 @@ -2070,8 +2070,8 @@ __svml_tan8_ha_z0: # LOE r15 ebx r12d r13d r14d ..B5.17: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq - vmovups 1088+__svml_dtan_ha_data_internal(%rip), %zmm14 #7823.56 - lea __svml_dtan_ha_reduction_data_internal(%rip), %rax #7915.406 + vmovups 1088+__jsvml_dtan_ha_data_internal(%rip), %zmm14 #7823.56 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %rax #7915.406 vmovups %zmm0, (%rsp) #[spill] vmovups %zmm3, 64(%rsp) #[spill] vmovups %zmm12, 128(%rsp) #[spill] @@ -2220,20 +2220,20 @@ __svml_tan8_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm3 zmm11 zmm12 .cfi_endproc # mark_end; - .type __svml_tan8_ha_z0,@function - .size __svml_tan8_ha_z0,.-__svml_tan8_ha_z0 -..LN__svml_tan8_ha_z0.4: + .type __jsvml_tan8_ha_z0,@function + .size __jsvml_tan8_ha_z0,.-__jsvml_tan8_ha_z0 +..LN__jsvml_tan8_ha_z0.4: .data -# -- End __svml_tan8_ha_z0 +# -- End __jsvml_tan8_ha_z0 .text -.L_2__routine_start___svml_tan2_ha_ex_5: -# -- Begin __svml_tan2_ha_ex +.L_2__routine_start___jsvml_tan2_ha_ex_5: +# -- Begin __jsvml_tan2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_tan2_ha_ex -# --- __svml_tan2_ha_ex(__m128d) -__svml_tan2_ha_ex: + .globl __jsvml_tan2_ha_ex +# --- __jsvml_tan2_ha_ex(__m128d) +__jsvml_tan2_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -2242,7 +2242,7 @@ __svml_tan2_ha_ex: .byte 30 #8532.22 .byte 250 #8532.22 .cfi_startproc -..___tag_value___svml_tan2_ha_ex.176: +..___tag_value___jsvml_tan2_ha_ex.176: ..L177: #8103.1 pushq %rbp #8103.1 @@ -2253,31 +2253,31 @@ __svml_tan2_ha_ex: andq $-64, %rsp #8103.1 subq $192, %rsp #8103.1 xorl %edx, %edx #8162.9 - movups 1024+__svml_dtan_ha_data_internal(%rip), %xmm8 #8163.54 + movups 1024+__jsvml_dtan_ha_data_internal(%rip), %xmm8 #8163.54 movaps %xmm8, %xmm14 #8164.20 andnps %xmm0, %xmm8 #8165.21 - movups 1472+__svml_dtan_ha_data_internal(%rip), %xmm6 #8172.29 + movups 1472+__jsvml_dtan_ha_data_internal(%rip), %xmm6 #8172.29 andps %xmm0, %xmm14 #8164.20 mulpd %xmm14, %xmm6 #8172.29 - movups 1152+__svml_dtan_ha_data_internal(%rip), %xmm7 #8171.53 + movups 1152+__jsvml_dtan_ha_data_internal(%rip), %xmm7 #8171.53 movaps %xmm14, %xmm3 #8167.34 addpd %xmm7, %xmm6 #8172.17 - cmpnlepd 28160+__svml_dtan_ha_data_internal(%rip), %xmm3 #8167.34 + cmpnlepd 28160+__jsvml_dtan_ha_data_internal(%rip), %xmm3 #8167.34 movaps %xmm6, %xmm4 #8173.17 subpd %xmm7, %xmm4 #8173.17 - movups 1216+__svml_dtan_ha_data_internal(%rip), %xmm5 #8175.40 + movups 1216+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #8175.40 mulpd %xmm4, %xmm5 #8175.40 - movups 1280+__svml_dtan_ha_data_internal(%rip), %xmm9 #8177.23 + movups 1280+__jsvml_dtan_ha_data_internal(%rip), %xmm9 #8177.23 mulpd %xmm4, %xmm9 #8177.23 movups %xmm14, (%rsp) #8164.20[spill] subpd %xmm5, %xmm14 #8175.18 movaps %xmm14, %xmm12 #8178.22 subpd %xmm9, %xmm12 #8178.22 subpd %xmm12, %xmm14 #8179.21 - movups 1344+__svml_dtan_ha_data_internal(%rip), %xmm11 #8182.36 + movups 1344+__jsvml_dtan_ha_data_internal(%rip), %xmm11 #8182.36 mulpd %xmm4, %xmm11 #8182.36 subpd %xmm9, %xmm14 #8180.21 - pand 1408+__svml_dtan_ha_data_internal(%rip), %xmm6 #8185.21 + pand 1408+__jsvml_dtan_ha_data_internal(%rip), %xmm6 #8185.21 pand .L_2il0floatpacket.26(%rip), %xmm6 #8190.21 subpd %xmm11, %xmm14 #8182.17 pextrw $4, %xmm6, %esi #8191.192 @@ -2285,7 +2285,7 @@ __svml_tan2_ha_ex: movups %xmm8, 64(%rsp) #8165.21[spill] movaps %xmm12, %xmm8 #8186.17 imull $104, %eax, %ecx #8191.294 - lea 1632+__svml_dtan_ha_data_internal(%rip), %rax #8191.380 + lea 1632+__jsvml_dtan_ha_data_internal(%rip), %rax #8191.380 imull $104, %esi, %edi #8191.346 movups %xmm0, 80(%rsp) #8103.1[spill] movups %xmm3, 96(%rsp) #8167.34[spill] @@ -2458,10 +2458,10 @@ __svml_tan2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #8535.546 lea 128(%rsp,%r12,8), %rsi #8535.546 -..___tag_value___svml_tan2_ha_ex.208: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #8535.546 -..___tag_value___svml_tan2_ha_ex.209: +..___tag_value___jsvml_tan2_ha_ex.208: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #8535.546 +..___tag_value___jsvml_tan2_ha_ex.209: jmp ..B6.9 # Prob 100% #8535.546 .cfi_restore 12 .cfi_restore 13 @@ -2469,7 +2469,7 @@ __svml_tan2_ha_ex: ..B6.12: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq movups %xmm0, (%rsp) #[spill] - lea __svml_dtan_ha_reduction_data_internal(%rip), %r9 #8344.372 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %r9 #8344.372 movdqu .L_2il0floatpacket.29(%rip), %xmm0 #8342.16 pand %xmm4, %xmm0 #8342.16 psrlq $52, %xmm0 #8343.16 @@ -2481,7 +2481,7 @@ __svml_tan2_ha_ex: lea (%rcx,%rcx,2), %esi #8344.287 shll $3, %esi #8344.287 lea (%rdi,%rdi,2), %r8d #8344.338 - movups 1088+__svml_dtan_ha_data_internal(%rip), %xmm15 #8252.59 + movups 1088+__jsvml_dtan_ha_data_internal(%rip), %xmm15 #8252.59 paddq .L_2il0floatpacket.31(%rip), %xmm1 #8353.19 shll $3, %r8d #8344.338 movaps %xmm15, %xmm3 #8253.21 @@ -2736,20 +2736,20 @@ __svml_tan2_ha_ex: # LOE rbx r12 r13 r14 r15 edx xmm0 .cfi_endproc # mark_end; - .type __svml_tan2_ha_ex,@function - .size __svml_tan2_ha_ex,.-__svml_tan2_ha_ex -..LN__svml_tan2_ha_ex.5: + .type __jsvml_tan2_ha_ex,@function + .size __jsvml_tan2_ha_ex,.-__jsvml_tan2_ha_ex +..LN__jsvml_tan2_ha_ex.5: .data -# -- End __svml_tan2_ha_ex +# -- End __jsvml_tan2_ha_ex .text -.L_2__routine_start___svml_tan2_ha_l9_6: -# -- Begin __svml_tan2_ha_l9 +.L_2__routine_start___jsvml_tan2_ha_l9_6: +# -- Begin __jsvml_tan2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tan2_ha_l9 -# --- __svml_tan2_ha_l9(__m128d) -__svml_tan2_ha_l9: + .globl __jsvml_tan2_ha_l9 +# --- __jsvml_tan2_ha_l9(__m128d) +__jsvml_tan2_ha_l9: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -2758,7 +2758,7 @@ __svml_tan2_ha_l9: .byte 30 #8863.18 .byte 250 #8863.18 .cfi_startproc -..___tag_value___svml_tan2_ha_l9.224: +..___tag_value___jsvml_tan2_ha_l9.224: ..L225: #8543.1 pushq %rbp #8543.1 @@ -2769,16 +2769,16 @@ __svml_tan2_ha_l9: andq $-64, %rsp #8543.1 subq $192, %rsp #8543.1 vmovapd %xmm0, %xmm14 #8543.1 - vmovupd 1152+__svml_dtan_ha_data_internal(%rip), %xmm3 #8615.55 + vmovupd 1152+__jsvml_dtan_ha_data_internal(%rip), %xmm3 #8615.55 xorl %eax, %eax #8603.5 - vmovupd __svml_dtan_ha_data_internal(%rip), %xmm2 #8616.17 + vmovupd __jsvml_dtan_ha_data_internal(%rip), %xmm2 #8616.17 vfmadd213pd %xmm3, %xmm14, %xmm2 #8616.17 - vmovupd 64+__svml_dtan_ha_data_internal(%rip), %xmm1 #8618.50 - vmovupd 256+__svml_dtan_ha_data_internal(%rip), %xmm5 #8619.54 - vmovupd 320+__svml_dtan_ha_data_internal(%rip), %xmm6 #8620.54 - vandpd 1024+__svml_dtan_ha_data_internal(%rip), %xmm14, %xmm10 #8605.16 + vmovupd 64+__jsvml_dtan_ha_data_internal(%rip), %xmm1 #8618.50 + vmovupd 256+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #8619.54 + vmovupd 320+__jsvml_dtan_ha_data_internal(%rip), %xmm6 #8620.54 + vandpd 1024+__jsvml_dtan_ha_data_internal(%rip), %xmm14, %xmm10 #8605.16 vsubpd %xmm3, %xmm2, %xmm9 #8617.17 - vcmpnlepd 28160+__svml_dtan_ha_data_internal(%rip), %xmm10, %xmm0 #8609.30 + vcmpnlepd 28160+__jsvml_dtan_ha_data_internal(%rip), %xmm10, %xmm0 #8609.30 vfnmadd213pd %xmm14, %xmm9, %xmm1 #8621.22 vmovmskpd %xmm0, %edx #8611.78 vmovapd %xmm1, %xmm4 #8622.22 @@ -2796,15 +2796,15 @@ __svml_tan2_ha_l9: ..B7.2: # Preds ..B7.12 ..B7.1 # Execution count [1.00e+00] vmulpd %xmm3, %xmm3, %xmm9 #8868.14 - vmovupd 896+__svml_dtan_ha_data_internal(%rip), %xmm8 #8869.52 + vmovupd 896+__jsvml_dtan_ha_data_internal(%rip), %xmm8 #8869.52 vpsllq $3, %xmm2, %xmm4 #8865.226 - vfmadd213pd 832+__svml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8871.20 - lea 512+__svml_dtan_ha_data_internal(%rip), %rsi #8866.31 + vfmadd213pd 832+__jsvml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8871.20 + lea 512+__jsvml_dtan_ha_data_internal(%rip), %rsi #8866.31 vpand .L_2il0floatpacket.57(%rip), %xmm4, %xmm5 #8865.275 vmovd %xmm5, %edx #8866.121 - vfmadd213pd 768+__svml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8873.20 - vfmadd213pd 704+__svml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8875.16 - vfmadd213pd 640+__svml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8877.16 + vfmadd213pd 768+__jsvml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8873.20 + vfmadd213pd 704+__jsvml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8875.16 + vfmadd213pd 640+__jsvml_dtan_ha_data_internal(%rip), %xmm9, %xmm8 #8877.16 vmulpd %xmm8, %xmm3, %xmm10 #8878.16 vfnmsub213pd %xmm1, %xmm9, %xmm10 #8879.20 movslq %edx, %rdx #8866.121 @@ -2812,7 +2812,7 @@ __svml_tan2_ha_l9: vsubpd %xmm10, %xmm3, %xmm4 #8880.17 movslq %ecx, %rcx #8866.246 vmovsd -128(%rdx,%rsi), %xmm6 #8866.31 - vmovupd 960+__svml_dtan_ha_data_internal(%rip), %xmm5 #8888.46 + vmovupd 960+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #8888.46 vsubpd %xmm4, %xmm3, %xmm3 #8881.20 vmovhpd -128(%rcx,%rsi), %xmm6, %xmm2 #8866.14 vmovapd %xmm5, %xmm6 #8889.23 @@ -2896,10 +2896,10 @@ __svml_tan2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #8906.546 lea 128(%rsp,%r12,8), %rsi #8906.546 -..___tag_value___svml_tan2_ha_l9.242: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #8906.546 -..___tag_value___svml_tan2_ha_l9.243: +..___tag_value___jsvml_tan2_ha_l9.242: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #8906.546 +..___tag_value___jsvml_tan2_ha_l9.243: jmp ..B7.9 # Prob 100% #8906.546 .cfi_restore 12 .cfi_restore 13 @@ -2907,11 +2907,11 @@ __svml_tan2_ha_l9: ..B7.12: # Preds ..B7.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.29(%rip), %xmm14, %xmm11 #8722.18 - lea __svml_dtan_ha_reduction_data_internal(%rip), %r8 #8724.385 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %r8 #8724.385 vmovupd %xmm2, (%rsp) #[spill] vpsrlq $52, %xmm11, %xmm2 #8723.18 vmovd %xmm2, %edx #8724.124 - vmovupd 1088+__svml_dtan_ha_data_internal(%rip), %xmm7 #8632.55 + vmovupd 1088+__jsvml_dtan_ha_data_internal(%rip), %xmm7 #8632.55 vandpd %xmm10, %xmm7, %xmm8 #8633.17 vpextrd $2, %xmm2, %esi #8724.189 vcmpeqpd %xmm7, %xmm8, %xmm10 #8634.25 @@ -3048,20 +3048,20 @@ __svml_tan2_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm2 xmm3 xmm14 .cfi_endproc # mark_end; - .type __svml_tan2_ha_l9,@function - .size __svml_tan2_ha_l9,.-__svml_tan2_ha_l9 -..LN__svml_tan2_ha_l9.6: + .type __jsvml_tan2_ha_l9,@function + .size __jsvml_tan2_ha_l9,.-__jsvml_tan2_ha_l9 +..LN__jsvml_tan2_ha_l9.6: .data -# -- End __svml_tan2_ha_l9 +# -- End __jsvml_tan2_ha_l9 .text -.L_2__routine_start___svml_tan2_ha_e9_7: -# -- Begin __svml_tan2_ha_e9 +.L_2__routine_start___jsvml_tan2_ha_e9_7: +# -- Begin __jsvml_tan2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tan2_ha_e9 -# --- __svml_tan2_ha_e9(__m128d) -__svml_tan2_ha_e9: + .globl __jsvml_tan2_ha_e9 +# --- __jsvml_tan2_ha_e9(__m128d) +__jsvml_tan2_ha_e9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -3070,7 +3070,7 @@ __svml_tan2_ha_e9: .byte 30 #9343.22 .byte 250 #9343.22 .cfi_startproc -..___tag_value___svml_tan2_ha_e9.253: +..___tag_value___jsvml_tan2_ha_e9.253: ..L254: #8914.1 pushq %rbp #8914.1 @@ -3081,38 +3081,38 @@ __svml_tan2_ha_e9: andq $-64, %rsp #8914.1 subq $192, %rsp #8914.1 xorl %edx, %edx #8973.9 - movups 1024+__svml_dtan_ha_data_internal(%rip), %xmm8 #8974.54 + movups 1024+__jsvml_dtan_ha_data_internal(%rip), %xmm8 #8974.54 movaps %xmm8, %xmm14 #8975.20 andnps %xmm0, %xmm8 #8976.21 - movups 1472+__svml_dtan_ha_data_internal(%rip), %xmm12 #8983.29 + movups 1472+__jsvml_dtan_ha_data_internal(%rip), %xmm12 #8983.29 andps %xmm0, %xmm14 #8975.20 mulpd %xmm14, %xmm12 #8983.29 - movups 1152+__svml_dtan_ha_data_internal(%rip), %xmm3 #8982.53 + movups 1152+__jsvml_dtan_ha_data_internal(%rip), %xmm3 #8982.53 movaps %xmm14, %xmm1 #8978.34 addpd %xmm3, %xmm12 #8983.17 - cmpnlepd 28160+__svml_dtan_ha_data_internal(%rip), %xmm1 #8978.34 + cmpnlepd 28160+__jsvml_dtan_ha_data_internal(%rip), %xmm1 #8978.34 movaps %xmm12, %xmm9 #8984.17 subpd %xmm3, %xmm9 #8984.17 - movups 1216+__svml_dtan_ha_data_internal(%rip), %xmm7 #8986.40 + movups 1216+__jsvml_dtan_ha_data_internal(%rip), %xmm7 #8986.40 mulpd %xmm9, %xmm7 #8986.40 - movups 1280+__svml_dtan_ha_data_internal(%rip), %xmm5 #8988.23 + movups 1280+__jsvml_dtan_ha_data_internal(%rip), %xmm5 #8988.23 mulpd %xmm9, %xmm5 #8988.23 movups %xmm14, (%rsp) #8975.20[spill] subpd %xmm7, %xmm14 #8986.18 movaps %xmm14, %xmm11 #8989.22 subpd %xmm5, %xmm11 #8989.22 subpd %xmm11, %xmm14 #8990.21 - movups 1344+__svml_dtan_ha_data_internal(%rip), %xmm4 #8993.36 + movups 1344+__jsvml_dtan_ha_data_internal(%rip), %xmm4 #8993.36 mulpd %xmm9, %xmm4 #8993.36 subpd %xmm5, %xmm14 #8991.21 - pand 1408+__svml_dtan_ha_data_internal(%rip), %xmm12 #8996.27 + pand 1408+__jsvml_dtan_ha_data_internal(%rip), %xmm12 #8996.27 pand .L_2il0floatpacket.26(%rip), %xmm12 #9001.27 subpd %xmm4, %xmm14 #8993.17 movd %xmm12, %eax #9002.136 movups %xmm8, 64(%rsp) #8976.21[spill] movaps %xmm11, %xmm8 #8997.17 imull $104, %eax, %ecx #9002.307 - lea 1632+__svml_dtan_ha_data_internal(%rip), %rax #9002.393 + lea 1632+__jsvml_dtan_ha_data_internal(%rip), %rax #9002.393 movups %xmm1, 96(%rsp) #8978.34[spill] movups %xmm0, 80(%rsp) #8914.1[spill] addpd %xmm14, %xmm8 #8997.17 @@ -3287,10 +3287,10 @@ __svml_tan2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #9346.546 lea 128(%rsp,%r12,8), %rsi #9346.546 -..___tag_value___svml_tan2_ha_e9.285: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #9346.546 -..___tag_value___svml_tan2_ha_e9.286: +..___tag_value___jsvml_tan2_ha_e9.285: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #9346.546 +..___tag_value___jsvml_tan2_ha_e9.286: jmp ..B8.9 # Prob 100% #9346.546 .cfi_restore 12 .cfi_restore 13 @@ -3298,14 +3298,14 @@ __svml_tan2_ha_e9: ..B8.12: # Preds ..B8.1 # Execution count [5.00e-02]: Infreq movdqu .L_2il0floatpacket.29(%rip), %xmm14 #9153.22 - lea __svml_dtan_ha_reduction_data_internal(%rip), %r9 #9155.385 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %r9 #9155.385 pand %xmm4, %xmm14 #9153.22 psrlq $52, %xmm14 #9154.22 pextrd $2, %xmm14, %edi #9155.189 movd %xmm14, %ecx #9155.124 movdqu .L_2il0floatpacket.30(%rip), %xmm0 #9163.25 pand %xmm4, %xmm0 #9163.25 - movups 1088+__svml_dtan_ha_data_internal(%rip), %xmm15 #9063.59 + movups 1088+__jsvml_dtan_ha_data_internal(%rip), %xmm15 #9063.59 lea (%rdi,%rdi,2), %r8d #9155.351 paddq .L_2il0floatpacket.31(%rip), %xmm0 #9164.25 shll $3, %r8d #9155.351 @@ -3563,20 +3563,20 @@ __svml_tan2_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm1 .cfi_endproc # mark_end; - .type __svml_tan2_ha_e9,@function - .size __svml_tan2_ha_e9,.-__svml_tan2_ha_e9 -..LN__svml_tan2_ha_e9.7: + .type __jsvml_tan2_ha_e9,@function + .size __jsvml_tan2_ha_e9,.-__jsvml_tan2_ha_e9 +..LN__jsvml_tan2_ha_e9.7: .data -# -- End __svml_tan2_ha_e9 +# -- End __jsvml_tan2_ha_e9 .text -.L_2__routine_start___svml_tan4_ha_l9_8: -# -- Begin __svml_tan4_ha_l9 +.L_2__routine_start___jsvml_tan4_ha_l9_8: +# -- Begin __jsvml_tan4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tan4_ha_l9 -# --- __svml_tan4_ha_l9(__m256d) -__svml_tan4_ha_l9: + .globl __jsvml_tan4_ha_l9 +# --- __jsvml_tan4_ha_l9(__m256d) +__jsvml_tan4_ha_l9: # parameter 1: %ymm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -3585,7 +3585,7 @@ __svml_tan4_ha_l9: .byte 30 #9698.17 .byte 250 #9698.17 .cfi_startproc -..___tag_value___svml_tan4_ha_l9.301: +..___tag_value___jsvml_tan4_ha_l9.301: ..L302: #9380.1 pushq %rbp #9380.1 @@ -3597,11 +3597,11 @@ __svml_tan4_ha_l9: subq $192, %rsp #9380.1 xorl %esi, %esi #9440.5 vmovapd %ymm0, %ymm14 #9380.1 - vmovupd 1152+__svml_dtan_ha_data_internal(%rip), %ymm4 #9452.58 - vmovupd __svml_dtan_ha_data_internal(%rip), %ymm0 #9453.17 - vmovupd 64+__svml_dtan_ha_data_internal(%rip), %ymm1 #9455.53 - vmovupd 256+__svml_dtan_ha_data_internal(%rip), %ymm3 #9456.57 - vmovupd 320+__svml_dtan_ha_data_internal(%rip), %ymm5 #9457.57 + vmovupd 1152+__jsvml_dtan_ha_data_internal(%rip), %ymm4 #9452.58 + vmovupd __jsvml_dtan_ha_data_internal(%rip), %ymm0 #9453.17 + vmovupd 64+__jsvml_dtan_ha_data_internal(%rip), %ymm1 #9455.53 + vmovupd 256+__jsvml_dtan_ha_data_internal(%rip), %ymm3 #9456.57 + vmovupd 320+__jsvml_dtan_ha_data_internal(%rip), %ymm5 #9457.57 vfmadd213pd %ymm4, %ymm14, %ymm0 #9453.17 vsubpd %ymm4, %ymm0, %ymm8 #9454.17 vfnmadd213pd %ymm14, %ymm8, %ymm1 #9458.22 @@ -3613,8 +3613,8 @@ __svml_tan4_ha_l9: vsubpd %ymm2, %ymm4, %ymm6 #9462.23 vfnmadd231pd %ymm8, %ymm3, %ymm7 #9463.22 vfmadd213pd %ymm6, %ymm5, %ymm8 #9464.23 - vandpd 1024+__svml_dtan_ha_data_internal(%rip), %ymm14, %ymm9 #9442.16 - vcmpnle_uqpd 28160+__svml_dtan_ha_data_internal(%rip), %ymm9, %ymm13 #9446.30 + vandpd 1024+__jsvml_dtan_ha_data_internal(%rip), %ymm14, %ymm9 #9442.16 + vcmpnle_uqpd 28160+__jsvml_dtan_ha_data_internal(%rip), %ymm9, %ymm13 #9446.30 vsubpd %ymm8, %ymm7, %ymm3 #9465.22 vmovmskpd %ymm13, %eax #9448.78 testl %eax, %eax #9467.66 @@ -3623,14 +3623,14 @@ __svml_tan4_ha_l9: ..B9.2: # Preds ..B9.12 ..B9.1 # Execution count [1.00e+00] vpsllq $3, %ymm0, %ymm5 #9702.232 - lea 512+__svml_dtan_ha_data_internal(%rip), %r8 #9703.77 - vmovupd 896+__svml_dtan_ha_data_internal(%rip), %ymm0 #9706.55 + lea 512+__jsvml_dtan_ha_data_internal(%rip), %r8 #9703.77 + vmovupd 896+__jsvml_dtan_ha_data_internal(%rip), %ymm0 #9706.55 vpand .L_2il0floatpacket.92(%rip), %ymm5, %ymm6 #9702.284 vmulpd %ymm4, %ymm4, %ymm5 #9705.14 - vfmadd213pd 832+__svml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9708.20 - vfmadd213pd 768+__svml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9710.20 - vfmadd213pd 704+__svml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9712.16 - vfmadd213pd 640+__svml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9714.16 + vfmadd213pd 832+__jsvml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9708.20 + vfmadd213pd 768+__jsvml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9710.20 + vfmadd213pd 704+__jsvml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9712.16 + vfmadd213pd 640+__jsvml_dtan_ha_data_internal(%rip), %ymm5, %ymm0 #9714.16 vextractf128 $1, %ymm6, %xmm9 #9703.514 vmovd %xmm6, %eax #9703.167 vmovd %xmm9, %ecx #9703.495 @@ -3654,7 +3654,7 @@ __svml_tan4_ha_l9: vsubpd %ymm7, %ymm4, %ymm4 #9718.20 vsubpd %ymm6, %ymm4, %ymm6 #9719.20 vinsertf128 $1, %xmm11, %ymm8, %ymm2 #9703.14 - vmovupd 960+__svml_dtan_ha_data_internal(%rip), %ymm8 #9725.49 + vmovupd 960+__jsvml_dtan_ha_data_internal(%rip), %ymm8 #9725.49 vaddpd %ymm7, %ymm2, %ymm0 #9720.21 vmovapd %ymm8, %ymm9 #9726.23 vfnmadd231pd %ymm2, %ymm7, %ymm9 #9726.23 @@ -3738,10 +3738,10 @@ __svml_tan4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #9743.552 lea 128(%rsp,%r12,8), %rsi #9743.552 -..___tag_value___svml_tan4_ha_l9.319: -# __svml_dtan_ha_cout_rare_internal(const double *, double *) - call __svml_dtan_ha_cout_rare_internal #9743.552 -..___tag_value___svml_tan4_ha_l9.320: +..___tag_value___jsvml_tan4_ha_l9.319: +# __jsvml_dtan_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtan_ha_cout_rare_internal #9743.552 +..___tag_value___jsvml_tan4_ha_l9.320: jmp ..B9.9 # Prob 100% #9743.552 .cfi_restore 12 .cfi_restore 13 @@ -3749,9 +3749,9 @@ __svml_tan4_ha_l9: ..B9.12: # Preds ..B9.1 # Execution count [5.00e-02]: Infreq vmovupd %ymm4, 32(%rsp) #[spill] - lea __svml_dtan_ha_reduction_data_internal(%rip), %rcx #9561.736 + lea __jsvml_dtan_ha_reduction_data_internal(%rip), %rcx #9561.736 vmovupd %ymm3, 64(%rsp) #[spill] - vmovupd 1088+__svml_dtan_ha_data_internal(%rip), %ymm10 #9469.58 + vmovupd 1088+__jsvml_dtan_ha_data_internal(%rip), %ymm10 #9469.58 vmovupd %ymm0, (%rsp) #[spill] vpand .L_2il0floatpacket.78(%rip), %ymm14, %ymm4 #9559.18 vpsrlq $52, %ymm4, %ymm3 #9560.18 @@ -3909,9 +3909,9 @@ __svml_tan4_ha_l9: # LOE rbx r12 r13 r14 r15 esi ymm0 ymm3 ymm4 ymm14 .cfi_endproc # mark_end; - .type __svml_tan4_ha_l9,@function - .size __svml_tan4_ha_l9,.-__svml_tan4_ha_l9 -..LN__svml_tan4_ha_l9.8: + .type __jsvml_tan4_ha_l9,@function + .size __jsvml_tan4_ha_l9,.-__jsvml_tan4_ha_l9 +..LN__jsvml_tan4_ha_l9.8: .section .rodata, "a" .align 64 .align 64 @@ -3936,17 +3936,17 @@ __VUNPACK_EVEN_mask.2022.0.10: .long -1 .long 0 .data -# -- End __svml_tan4_ha_l9 +# -- End __jsvml_tan4_ha_l9 .text -.L_2__routine_start___svml_dtan_ha_cout_rare_internal_9: -# -- Begin __svml_dtan_ha_cout_rare_internal +.L_2__routine_start___jsvml_dtan_ha_cout_rare_internal_9: +# -- Begin __jsvml_dtan_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dtan_ha_cout_rare_internal - .globl __svml_dtan_ha_cout_rare_internal -# --- __svml_dtan_ha_cout_rare_internal(const double *, double *) -__svml_dtan_ha_cout_rare_internal: + .hidden __jsvml_dtan_ha_cout_rare_internal + .globl __jsvml_dtan_ha_cout_rare_internal +# --- __jsvml_dtan_ha_cout_rare_internal(const double *, double *) +__jsvml_dtan_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -3956,7 +3956,7 @@ __svml_dtan_ha_cout_rare_internal: .byte 30 #9372.19 .byte 250 #9372.19 .cfi_startproc -..___tag_value___svml_dtan_ha_cout_rare_internal.330: +..___tag_value___jsvml_dtan_ha_cout_rare_internal.330: ..L331: #9358.1 xorl %eax, %eax #9359.14 @@ -4001,17 +4001,17 @@ __svml_dtan_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_dtan_ha_cout_rare_internal,@function - .size __svml_dtan_ha_cout_rare_internal,.-__svml_dtan_ha_cout_rare_internal -..LN__svml_dtan_ha_cout_rare_internal.9: + .type __jsvml_dtan_ha_cout_rare_internal,@function + .size __jsvml_dtan_ha_cout_rare_internal,.-__jsvml_dtan_ha_cout_rare_internal +..LN__jsvml_dtan_ha_cout_rare_internal.9: .data -# -- End __svml_dtan_ha_cout_rare_internal +# -- End __jsvml_dtan_ha_cout_rare_internal .section .rodata, "a" .space 32, 0x00 # pad .align 64 - .hidden __svml_dtan_ha_reduction_data_internal - .globl __svml_dtan_ha_reduction_data_internal -__svml_dtan_ha_reduction_data_internal: + .hidden __jsvml_dtan_ha_reduction_data_internal + .globl __jsvml_dtan_ha_reduction_data_internal +__jsvml_dtan_ha_reduction_data_internal: .long 0 .long 0 .long 0 @@ -16300,13 +16300,13 @@ __svml_dtan_ha_reduction_data_internal: .long 484957737 .long 896803160 .long 3984508030 - .type __svml_dtan_ha_reduction_data_internal,@object - .size __svml_dtan_ha_reduction_data_internal,49152 + .type __jsvml_dtan_ha_reduction_data_internal,@object + .size __jsvml_dtan_ha_reduction_data_internal,49152 .space 512, 0x00 # pad .align 64 - .hidden __svml_dtan_ha_data_internal - .globl __svml_dtan_ha_data_internal -__svml_dtan_ha_data_internal: + .hidden __jsvml_dtan_ha_data_internal + .globl __jsvml_dtan_ha_data_internal +__jsvml_dtan_ha_data_internal: .long 1841940611 .long 1075076912 .long 1841940611 @@ -23363,8 +23363,8 @@ __svml_dtan_ha_data_internal: .long 1089470464 .long 239972940 .long 1089470464 - .type __svml_dtan_ha_data_internal,@object - .size __svml_dtan_ha_data_internal,28224 + .type __jsvml_dtan_ha_data_internal,@object + .size __jsvml_dtan_ha_data_internal,28224 .space 960, 0x00 # pad .align 32 .L_2il0floatpacket.45: diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_tanh_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_tanh_linux_x86.S similarity index 91% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_d_tanh_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_tanh_linux_x86.S index 7c8095846f9..59dc691c512 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_d_tanh_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_d_tanh_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_d_tanh.c" .text ..TXTST0: -.L_2__routine_start___svml_tanh4_ha_e9_0: -# -- Begin __svml_tanh4_ha_e9 +.L_2__routine_start___jsvml_tanh4_ha_e9_0: +# -- Begin __jsvml_tanh4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh4_ha_e9 -# --- __svml_tanh4_ha_e9(__m256d) -__svml_tanh4_ha_e9: + .globl __jsvml_tanh4_ha_e9 +# --- __jsvml_tanh4_ha_e9(__m256d) +__jsvml_tanh4_ha_e9: # parameter 1: %ymm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_tanh4_ha_e9: .byte 30 #1335.552 .byte 250 #1335.552 .cfi_startproc -..___tag_value___svml_tanh4_ha_e9.1: +..___tag_value___jsvml_tanh4_ha_e9.1: ..L2: #1241.1 pushq %rbp #1241.1 @@ -57,18 +57,18 @@ __svml_tanh4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1241.1 subq $192, %rsp #1241.1 - lea 2720+__svml_dtanh_ha_data_internal(%rip), %r8 #1295.45 + lea 2720+__jsvml_dtanh_ha_data_internal(%rip), %r8 #1295.45 vmovupd %ymm0, (%rsp) #1241.1[spill] vpxor %xmm3, %xmm3, %xmm3 #1290.23 - vmovups 10688+__svml_dtanh_ha_data_internal(%rip), %xmm13 #1277.28 - vmovups 10752+__svml_dtanh_ha_data_internal(%rip), %xmm8 #1285.28 - vandpd 10432+__svml_dtanh_ha_data_internal(%rip), %ymm0, %ymm1 #1279.12 - vandpd 10368+__svml_dtanh_ha_data_internal(%rip), %ymm0, %ymm12 #1280.13 + vmovups 10688+__jsvml_dtanh_ha_data_internal(%rip), %xmm13 #1277.28 + vmovups 10752+__jsvml_dtanh_ha_data_internal(%rip), %xmm8 #1285.28 + vandpd 10432+__jsvml_dtanh_ha_data_internal(%rip), %ymm0, %ymm1 #1279.12 + vandpd 10368+__jsvml_dtanh_ha_data_internal(%rip), %ymm0, %ymm12 #1280.13 vmovupd %ymm12, 32(%rsp) #1280.13[spill] vextractf128 $1, %ymm0, %xmm10 #1281.101 vshufps $221, %xmm10, %xmm0, %xmm9 #1282.33 - vpand 10496+__svml_dtanh_ha_data_internal(%rip), %xmm9, %xmm4 #1283.22 - vpsubd 10624+__svml_dtanh_ha_data_internal(%rip), %xmm4, %xmm11 #1289.19 + vpand 10496+__jsvml_dtanh_ha_data_internal(%rip), %xmm9, %xmm4 #1283.22 + vpsubd 10624+__jsvml_dtanh_ha_data_internal(%rip), %xmm4, %xmm11 #1289.19 vpcmpgtd %xmm4, %xmm8, %xmm6 #1286.31 vpcmpgtd %xmm3, %xmm11, %xmm2 #1290.23 vpcmpgtd %xmm13, %xmm11, %xmm0 #1291.23 @@ -76,7 +76,7 @@ __svml_tanh4_ha_e9: blendvps %xmm0, %xmm13, %xmm14 #1293.41 vpsrld $10, %xmm14, %xmm13 #1294.23 vmovd %xmm13, %edx #1295.113 - vpcmpgtd 10560+__svml_dtanh_ha_data_internal(%rip), %xmm4, %xmm7 #1284.23 + vpcmpgtd 10560+__jsvml_dtanh_ha_data_internal(%rip), %xmm4, %xmm7 #1284.23 vpor %xmm6, %xmm7, %xmm5 #1287.27 vpextrd $1, %xmm13, %ecx #1295.254 movslq %edx, %rdx #1295.113 @@ -147,7 +147,7 @@ __svml_tanh4_ha_e9: vmulpd %ymm9, %ymm15, %ymm14 #1317.19 vmulpd %ymm14, %ymm15, %ymm0 #1318.34 vaddpd %ymm10, %ymm0, %ymm2 #1318.19 - vmovupd 10304+__svml_dtanh_ha_data_internal(%rip), %ymm10 #1319.63 + vmovupd 10304+__jsvml_dtanh_ha_data_internal(%rip), %ymm10 #1319.63 vandpd %ymm10, %ymm12, %ymm0 #1320.22 vandpd %ymm10, %ymm15, %ymm10 #1322.22 vmulpd %ymm10, %ymm0, %ymm14 #1324.21 @@ -228,29 +228,29 @@ __svml_tanh4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1335.552 lea 128(%rsp,%r12,8), %rsi #1335.552 -..___tag_value___svml_tanh4_ha_e9.23: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1335.552 -..___tag_value___svml_tanh4_ha_e9.24: +..___tag_value___jsvml_tanh4_ha_e9.23: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1335.552 +..___tag_value___jsvml_tanh4_ha_e9.24: jmp ..B1.8 # Prob 100% #1335.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanh4_ha_e9,@function - .size __svml_tanh4_ha_e9,.-__svml_tanh4_ha_e9 -..LN__svml_tanh4_ha_e9.0: + .type __jsvml_tanh4_ha_e9,@function + .size __jsvml_tanh4_ha_e9,.-__jsvml_tanh4_ha_e9 +..LN__jsvml_tanh4_ha_e9.0: .data -# -- End __svml_tanh4_ha_e9 +# -- End __jsvml_tanh4_ha_e9 .text -.L_2__routine_start___svml_tanh4_ha_l9_1: -# -- Begin __svml_tanh4_ha_l9 +.L_2__routine_start___jsvml_tanh4_ha_l9_1: +# -- Begin __jsvml_tanh4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh4_ha_l9 -# --- __svml_tanh4_ha_l9(__m256d) -__svml_tanh4_ha_l9: + .globl __jsvml_tanh4_ha_l9 +# --- __jsvml_tanh4_ha_l9(__m256d) +__jsvml_tanh4_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -259,7 +259,7 @@ __svml_tanh4_ha_l9: .byte 30 #1427.552 .byte 250 #1427.552 .cfi_startproc -..___tag_value___svml_tanh4_ha_l9.26: +..___tag_value___jsvml_tanh4_ha_l9.26: ..L27: #1343.1 pushq %rbp #1343.1 @@ -269,24 +269,24 @@ __svml_tanh4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1343.1 subq $192, %rsp #1343.1 - lea 2720+__svml_dtanh_ha_data_internal(%rip), %r8 #1394.45 + lea 2720+__jsvml_dtanh_ha_data_internal(%rip), %r8 #1394.45 vmovupd %ymm0, (%rsp) #1343.1[spill] vpxor %xmm10, %xmm10, %xmm10 #1389.19 - vmovups 10688+__svml_dtanh_ha_data_internal(%rip), %xmm7 #1379.24 - vandpd 10432+__svml_dtanh_ha_data_internal(%rip), %ymm0, %ymm1 #1381.12 - vandpd 10368+__svml_dtanh_ha_data_internal(%rip), %ymm0, %ymm15 #1382.13 + vmovups 10688+__jsvml_dtanh_ha_data_internal(%rip), %xmm7 #1379.24 + vandpd 10432+__jsvml_dtanh_ha_data_internal(%rip), %ymm0, %ymm1 #1381.12 + vandpd 10368+__jsvml_dtanh_ha_data_internal(%rip), %ymm0, %ymm15 #1382.13 vmovupd %ymm15, 32(%rsp) #1382.13[spill] vextractf128 $1, %ymm0, %xmm14 #1384.118 vshufps $221, %xmm14, %xmm0, %xmm13 #1384.29 - vpand 10496+__svml_dtanh_ha_data_internal(%rip), %xmm13, %xmm11 #1385.18 - vpsubd 10624+__svml_dtanh_ha_data_internal(%rip), %xmm11, %xmm8 #1388.15 + vpand 10496+__jsvml_dtanh_ha_data_internal(%rip), %xmm13, %xmm11 #1385.18 + vpsubd 10624+__jsvml_dtanh_ha_data_internal(%rip), %xmm11, %xmm8 #1388.15 vpcmpgtd %xmm10, %xmm8, %xmm9 #1389.19 vpcmpgtd %xmm7, %xmm8, %xmm0 #1390.19 vpand %xmm9, %xmm8, %xmm6 #1391.19 blendvps %xmm0, %xmm7, %xmm6 #1392.37 vpsrld $10, %xmm6, %xmm5 #1393.19 vmovd %xmm5, %edx #1394.113 - vpcmpgtd 10560+__svml_dtanh_ha_data_internal(%rip), %xmm11, %xmm12 #1386.19 + vpcmpgtd 10560+__jsvml_dtanh_ha_data_internal(%rip), %xmm11, %xmm12 #1386.19 vmovmskps %xmm12, %eax #1387.40 vpextrd $1, %xmm5, %ecx #1394.254 movslq %edx, %rdx #1394.113 @@ -419,29 +419,29 @@ __svml_tanh4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1427.552 lea 128(%rsp,%r12,8), %rsi #1427.552 -..___tag_value___svml_tanh4_ha_l9.48: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1427.552 -..___tag_value___svml_tanh4_ha_l9.49: +..___tag_value___jsvml_tanh4_ha_l9.48: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1427.552 +..___tag_value___jsvml_tanh4_ha_l9.49: jmp ..B2.8 # Prob 100% #1427.552 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanh4_ha_l9,@function - .size __svml_tanh4_ha_l9,.-__svml_tanh4_ha_l9 -..LN__svml_tanh4_ha_l9.1: + .type __jsvml_tanh4_ha_l9,@function + .size __jsvml_tanh4_ha_l9,.-__jsvml_tanh4_ha_l9 +..LN__jsvml_tanh4_ha_l9.1: .data -# -- End __svml_tanh4_ha_l9 +# -- End __jsvml_tanh4_ha_l9 .text -.L_2__routine_start___svml_tanh1_ha_ex_2: -# -- Begin __svml_tanh1_ha_ex +.L_2__routine_start___jsvml_tanh1_ha_ex_2: +# -- Begin __jsvml_tanh1_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_tanh1_ha_ex -# --- __svml_tanh1_ha_ex(__m128d) -__svml_tanh1_ha_ex: + .globl __jsvml_tanh1_ha_ex +# --- __jsvml_tanh1_ha_ex(__m128d) +__jsvml_tanh1_ha_ex: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -450,7 +450,7 @@ __svml_tanh1_ha_ex: .byte 30 #1529.546 .byte 250 #1529.546 .cfi_startproc -..___tag_value___svml_tanh1_ha_ex.51: +..___tag_value___jsvml_tanh1_ha_ex.51: ..L52: #1435.1 pushq %rbp #1435.1 @@ -468,7 +468,7 @@ __svml_tanh1_ha_ex: pshufd $85, %xmm0, %xmm12 #1476.9 pxor %xmm10, %xmm10 #1484.17 movd %edx, %xmm5 #1477.16 - lea 2728+__svml_dtanh_ha_data_internal(%rip), %r9 #1489.28 + lea 2728+__jsvml_dtanh_ha_data_internal(%rip), %r9 #1489.28 pand %xmm5, %xmm12 #1477.16 movd %esi, %xmm7 #1480.25 movd %edi, %xmm9 #1483.13 @@ -490,10 +490,10 @@ __svml_tanh1_ha_ex: psrld $10, %xmm15 #1488.17 por %xmm7, %xmm8 #1481.21 movd %xmm15, %r8d #1489.119 - movsd 10432+__svml_dtanh_ha_data_internal(%rip), %xmm3 #1473.12 + movsd 10432+__jsvml_dtanh_ha_data_internal(%rip), %xmm3 #1473.12 andps %xmm0, %xmm3 #1473.12 movslq %r8d, %r8 #1489.119 - movsd 10368+__svml_dtanh_ha_data_internal(%rip), %xmm4 #1474.13 + movsd 10368+__jsvml_dtanh_ha_data_internal(%rip), %xmm4 #1474.13 movups %xmm0, 16(%rsp) #1435.1[spill] andps %xmm0, %xmm4 #1474.13 movmskps %xmm8, %eax #1482.40 @@ -530,7 +530,7 @@ __svml_tanh1_ha_ex: unpcklpd %xmm14, %xmm14 #1490.174 addsd %xmm14, %xmm0 #1504.15 mulsd %xmm3, %xmm0 #1511.19 - movsd 10304+__svml_dtanh_ha_data_internal(%rip), %xmm5 #1513.29 + movsd 10304+__jsvml_dtanh_ha_data_internal(%rip), %xmm5 #1513.29 movups -88(%r9,%r8), %xmm2 #1490.72 movaps %xmm5, %xmm7 #1514.22 andps %xmm2, %xmm7 #1514.22 @@ -598,29 +598,29 @@ __svml_tanh1_ha_ex: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1529.546 lea 64(%rsp), %rsi #1529.546 -..___tag_value___svml_tanh1_ha_ex.66: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1529.546 -..___tag_value___svml_tanh1_ha_ex.67: +..___tag_value___jsvml_tanh1_ha_ex.66: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1529.546 +..___tag_value___jsvml_tanh1_ha_ex.67: jmp ..B3.4 # Prob 100% #1529.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_tanh1_ha_ex,@function - .size __svml_tanh1_ha_ex,.-__svml_tanh1_ha_ex -..LN__svml_tanh1_ha_ex.2: + .type __jsvml_tanh1_ha_ex,@function + .size __jsvml_tanh1_ha_ex,.-__jsvml_tanh1_ha_ex +..LN__jsvml_tanh1_ha_ex.2: .data -# -- End __svml_tanh1_ha_ex +# -- End __jsvml_tanh1_ha_ex .text -.L_2__routine_start___svml_tanh2_ha_l9_3: -# -- Begin __svml_tanh2_ha_l9 +.L_2__routine_start___jsvml_tanh2_ha_l9_3: +# -- Begin __jsvml_tanh2_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh2_ha_l9 -# --- __svml_tanh2_ha_l9(__m128d) -__svml_tanh2_ha_l9: + .globl __jsvml_tanh2_ha_l9 +# --- __jsvml_tanh2_ha_l9(__m128d) +__jsvml_tanh2_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -629,7 +629,7 @@ __svml_tanh2_ha_l9: .byte 30 #1621.546 .byte 250 #1621.546 .cfi_startproc -..___tag_value___svml_tanh2_ha_l9.69: +..___tag_value___jsvml_tanh2_ha_l9.69: ..L70: #1537.1 pushq %rbp #1537.1 @@ -639,24 +639,24 @@ __svml_tanh2_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1537.1 subq $192, %rsp #1537.1 - lea 2720+__svml_dtanh_ha_data_internal(%rip), %rsi #1588.67 - vmovq 10496+__svml_dtanh_ha_data_internal(%rip), %xmm11 #1571.25 + lea 2720+__jsvml_dtanh_ha_data_internal(%rip), %rsi #1588.67 + vmovq 10496+__jsvml_dtanh_ha_data_internal(%rip), %xmm11 #1571.25 vpxor %xmm8, %xmm8, %xmm8 #1583.19 vpshufd $221, %xmm0, %xmm12 #1578.11 - vmovq 10624+__svml_dtanh_ha_data_internal(%rip), %xmm7 #1572.27 + vmovq 10624+__jsvml_dtanh_ha_data_internal(%rip), %xmm7 #1572.27 vpand %xmm11, %xmm12, %xmm10 #1579.18 vpsubd %xmm7, %xmm10, %xmm6 #1582.15 - vmovq 10688+__svml_dtanh_ha_data_internal(%rip), %xmm3 #1573.24 + vmovq 10688+__jsvml_dtanh_ha_data_internal(%rip), %xmm3 #1573.24 vpcmpgtd %xmm8, %xmm6, %xmm5 #1583.19 vmovupd %xmm0, (%rsp) #1537.1[spill] vpand %xmm5, %xmm6, %xmm4 #1585.19 - vandpd 10432+__svml_dtanh_ha_data_internal(%rip), %xmm0, %xmm14 #1575.12 - vandpd 10368+__svml_dtanh_ha_data_internal(%rip), %xmm0, %xmm15 #1576.13 + vandpd 10432+__jsvml_dtanh_ha_data_internal(%rip), %xmm0, %xmm14 #1575.12 + vandpd 10368+__jsvml_dtanh_ha_data_internal(%rip), %xmm0, %xmm15 #1576.13 vpcmpgtd %xmm3, %xmm6, %xmm0 #1584.19 blendvps %xmm0, %xmm3, %xmm4 #1586.37 vpsrld $10, %xmm4, %xmm2 #1587.19 vmovd %xmm2, %eax #1588.135 - vmovq 10560+__svml_dtanh_ha_data_internal(%rip), %xmm13 #1570.17 + vmovq 10560+__jsvml_dtanh_ha_data_internal(%rip), %xmm13 #1570.17 vmovupd %xmm15, 16(%rsp) #1576.13[spill] vpcmpgtd %xmm13, %xmm10, %xmm9 #1580.19 vpextrd $1, %xmm2, %ecx #1588.298 @@ -769,29 +769,29 @@ __svml_tanh2_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1621.546 lea 128(%rsp,%r12,8), %rsi #1621.546 -..___tag_value___svml_tanh2_ha_l9.91: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1621.546 -..___tag_value___svml_tanh2_ha_l9.92: +..___tag_value___jsvml_tanh2_ha_l9.91: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1621.546 +..___tag_value___jsvml_tanh2_ha_l9.92: jmp ..B4.8 # Prob 100% #1621.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanh2_ha_l9,@function - .size __svml_tanh2_ha_l9,.-__svml_tanh2_ha_l9 -..LN__svml_tanh2_ha_l9.3: + .type __jsvml_tanh2_ha_l9,@function + .size __jsvml_tanh2_ha_l9,.-__jsvml_tanh2_ha_l9 +..LN__jsvml_tanh2_ha_l9.3: .data -# -- End __svml_tanh2_ha_l9 +# -- End __jsvml_tanh2_ha_l9 .text -.L_2__routine_start___svml_tanh1_ha_l9_4: -# -- Begin __svml_tanh1_ha_l9 +.L_2__routine_start___jsvml_tanh1_ha_l9_4: +# -- Begin __jsvml_tanh1_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh1_ha_l9 -# --- __svml_tanh1_ha_l9(__m128d) -__svml_tanh1_ha_l9: + .globl __jsvml_tanh1_ha_l9 +# --- __jsvml_tanh1_ha_l9(__m128d) +__jsvml_tanh1_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -800,7 +800,7 @@ __svml_tanh1_ha_l9: .byte 30 #1713.546 .byte 250 #1713.546 .cfi_startproc -..___tag_value___svml_tanh1_ha_l9.94: +..___tag_value___jsvml_tanh1_ha_l9.94: ..L95: #1629.1 pushq %rbp #1629.1 @@ -814,7 +814,7 @@ __svml_tanh1_ha_l9: movl $1069416448, %esi #1674.15 movl $7733248, %eax #1665.24 vpshufd $85, %xmm0, %xmm15 #1670.11 - lea 2728+__svml_dtanh_ha_data_internal(%rip), %r8 #1680.22 + lea 2728+__jsvml_dtanh_ha_data_internal(%rip), %r8 #1680.22 vpxor %xmm8, %xmm8, %xmm8 #1675.19 movl $2145386496, %ecx #1672.19 vmovd %edx, %xmm11 #1671.18 @@ -822,9 +822,9 @@ __svml_tanh1_ha_l9: vmovd %esi, %xmm7 #1674.15 vpsubd %xmm7, %xmm10, %xmm6 #1674.15 vmovd %eax, %xmm14 #1665.24 - vmovsd 10368+__svml_dtanh_ha_data_internal(%rip), %xmm13 #1660.17 + vmovsd 10368+__jsvml_dtanh_ha_data_internal(%rip), %xmm13 #1660.17 vpcmpgtd %xmm8, %xmm6, %xmm5 #1675.19 - vmovsd 10432+__svml_dtanh_ha_data_internal(%rip), %xmm2 #1661.16 + vmovsd 10432+__jsvml_dtanh_ha_data_internal(%rip), %xmm2 #1661.16 vpand %xmm5, %xmm6, %xmm4 #1677.19 vmovupd %xmm0, 16(%rsp) #1629.1[spill] vandpd %xmm2, %xmm0, %xmm1 #1667.12 @@ -918,29 +918,29 @@ __svml_tanh1_ha_l9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #1713.546 lea 64(%rsp), %rsi #1713.546 -..___tag_value___svml_tanh1_ha_l9.109: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1713.546 -..___tag_value___svml_tanh1_ha_l9.110: +..___tag_value___jsvml_tanh1_ha_l9.109: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1713.546 +..___tag_value___jsvml_tanh1_ha_l9.110: jmp ..B5.4 # Prob 100% #1713.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_tanh1_ha_l9,@function - .size __svml_tanh1_ha_l9,.-__svml_tanh1_ha_l9 -..LN__svml_tanh1_ha_l9.4: + .type __jsvml_tanh1_ha_l9,@function + .size __jsvml_tanh1_ha_l9,.-__jsvml_tanh1_ha_l9 +..LN__jsvml_tanh1_ha_l9.4: .data -# -- End __svml_tanh1_ha_l9 +# -- End __jsvml_tanh1_ha_l9 .text -.L_2__routine_start___svml_tanh2_ha_ex_5: -# -- Begin __svml_tanh2_ha_ex +.L_2__routine_start___jsvml_tanh2_ha_ex_5: +# -- Begin __jsvml_tanh2_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_tanh2_ha_ex -# --- __svml_tanh2_ha_ex(__m128d) -__svml_tanh2_ha_ex: + .globl __jsvml_tanh2_ha_ex +# --- __jsvml_tanh2_ha_ex(__m128d) +__jsvml_tanh2_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -949,7 +949,7 @@ __svml_tanh2_ha_ex: .byte 30 #1815.546 .byte 250 #1815.546 .cfi_startproc -..___tag_value___svml_tanh2_ha_ex.112: +..___tag_value___jsvml_tanh2_ha_ex.112: ..L113: #1721.1 pushq %rbp #1721.1 @@ -959,17 +959,17 @@ __svml_tanh2_ha_ex: .cfi_offset 6, -16 andq $-64, %rsp #1721.1 subq $192, %rsp #1721.1 - lea 2720+__svml_dtanh_ha_data_internal(%rip), %rsi #1775.67 - movq 10496+__svml_dtanh_ha_data_internal(%rip), %xmm14 #1755.23 + lea 2720+__jsvml_dtanh_ha_data_internal(%rip), %rsi #1775.67 + movq 10496+__jsvml_dtanh_ha_data_internal(%rip), %xmm14 #1755.23 pxor %xmm10, %xmm10 #1770.17 pshufd $221, %xmm0, %xmm6 #1762.9 - movq 10624+__svml_dtanh_ha_data_internal(%rip), %xmm9 #1756.25 + movq 10624+__jsvml_dtanh_ha_data_internal(%rip), %xmm9 #1756.25 pand %xmm14, %xmm6 #1763.16 - movq 10752+__svml_dtanh_ha_data_internal(%rip), %xmm11 #1766.25 + movq 10752+__jsvml_dtanh_ha_data_internal(%rip), %xmm11 #1766.25 movdqa %xmm6, %xmm1 #1764.17 pcmpgtd %xmm6, %xmm11 #1766.25 psubd %xmm9, %xmm6 #1769.13 - movq 10688+__svml_dtanh_ha_data_internal(%rip), %xmm7 #1757.22 + movq 10688+__jsvml_dtanh_ha_data_internal(%rip), %xmm7 #1757.22 movdqa %xmm6, %xmm4 #1771.17 movdqa %xmm6, %xmm8 #1770.17 pcmpgtd %xmm7, %xmm4 #1771.17 @@ -982,15 +982,15 @@ __svml_tanh2_ha_ex: psrld $10, %xmm5 #1774.17 movd %xmm5, %eax #1775.135 pshufd $1, %xmm5, %xmm2 #1775.314 - movq 10560+__svml_dtanh_ha_data_internal(%rip), %xmm15 #1754.15 + movq 10560+__jsvml_dtanh_ha_data_internal(%rip), %xmm15 #1754.15 movd %xmm2, %ecx #1775.296 pcmpgtd %xmm15, %xmm1 #1764.17 por %xmm11, %xmm1 #1767.21 - movups 10368+__svml_dtanh_ha_data_internal(%rip), %xmm13 #1760.13 + movups 10368+__jsvml_dtanh_ha_data_internal(%rip), %xmm13 #1760.13 movslq %eax, %rax #1775.135 andps %xmm0, %xmm13 #1760.13 movslq %ecx, %rcx #1775.228 - movups 10432+__svml_dtanh_ha_data_internal(%rip), %xmm12 #1759.12 + movups 10432+__jsvml_dtanh_ha_data_internal(%rip), %xmm12 #1759.12 movups %xmm0, (%rsp) #1721.1[spill] andps %xmm0, %xmm12 #1759.12 movups -96(%rax,%rsi), %xmm11 #1775.67 @@ -1047,7 +1047,7 @@ __svml_tanh2_ha_ex: mulpd %xmm12, %xmm1 #1790.27 addpd %xmm8, %xmm1 #1790.15 mulpd %xmm12, %xmm1 #1797.19 - movups 10304+__svml_dtanh_ha_data_internal(%rip), %xmm0 #1799.60 + movups 10304+__jsvml_dtanh_ha_data_internal(%rip), %xmm0 #1799.60 movaps %xmm0, %xmm2 #1800.22 andps %xmm9, %xmm2 #1800.22 andps %xmm12, %xmm0 #1802.22 @@ -1132,29 +1132,29 @@ __svml_tanh2_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1815.546 lea 128(%rsp,%r12,8), %rsi #1815.546 -..___tag_value___svml_tanh2_ha_ex.134: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1815.546 -..___tag_value___svml_tanh2_ha_ex.135: +..___tag_value___jsvml_tanh2_ha_ex.134: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1815.546 +..___tag_value___jsvml_tanh2_ha_ex.135: jmp ..B6.8 # Prob 100% #1815.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanh2_ha_ex,@function - .size __svml_tanh2_ha_ex,.-__svml_tanh2_ha_ex -..LN__svml_tanh2_ha_ex.5: + .type __jsvml_tanh2_ha_ex,@function + .size __jsvml_tanh2_ha_ex,.-__jsvml_tanh2_ha_ex +..LN__jsvml_tanh2_ha_ex.5: .data -# -- End __svml_tanh2_ha_ex +# -- End __jsvml_tanh2_ha_ex .text -.L_2__routine_start___svml_tanh2_ha_e9_6: -# -- Begin __svml_tanh2_ha_e9 +.L_2__routine_start___jsvml_tanh2_ha_e9_6: +# -- Begin __jsvml_tanh2_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh2_ha_e9 -# --- __svml_tanh2_ha_e9(__m128d) -__svml_tanh2_ha_e9: + .globl __jsvml_tanh2_ha_e9 +# --- __jsvml_tanh2_ha_e9(__m128d) +__jsvml_tanh2_ha_e9: # parameter 1: %xmm0 ..B7.1: # Preds ..B7.0 # Execution count [1.00e+00] @@ -1163,7 +1163,7 @@ __svml_tanh2_ha_e9: .byte 30 #1917.546 .byte 250 #1917.546 .cfi_startproc -..___tag_value___svml_tanh2_ha_e9.137: +..___tag_value___jsvml_tanh2_ha_e9.137: ..L138: #1823.1 pushq %rbp #1823.1 @@ -1173,30 +1173,30 @@ __svml_tanh2_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1823.1 subq $192, %rsp #1823.1 - lea 2720+__svml_dtanh_ha_data_internal(%rip), %rsi #1877.67 - movups 10432+__svml_dtanh_ha_data_internal(%rip), %xmm13 #1861.12 + lea 2720+__jsvml_dtanh_ha_data_internal(%rip), %rsi #1877.67 + movups 10432+__jsvml_dtanh_ha_data_internal(%rip), %xmm13 #1861.12 pxor %xmm9, %xmm9 #1872.23 - movups 10368+__svml_dtanh_ha_data_internal(%rip), %xmm14 #1862.13 + movups 10368+__jsvml_dtanh_ha_data_internal(%rip), %xmm14 #1862.13 andps %xmm0, %xmm13 #1861.12 movups %xmm0, (%rsp) #1823.1[spill] andps %xmm0, %xmm14 #1862.13 - movq 10496+__svml_dtanh_ha_data_internal(%rip), %xmm15 #1857.29 + movq 10496+__jsvml_dtanh_ha_data_internal(%rip), %xmm15 #1857.29 pshufd $221, %xmm0, %xmm0 #1864.15 - movq 10624+__svml_dtanh_ha_data_internal(%rip), %xmm11 #1858.31 + movq 10624+__jsvml_dtanh_ha_data_internal(%rip), %xmm11 #1858.31 pand %xmm15, %xmm0 #1865.22 - movq 10752+__svml_dtanh_ha_data_internal(%rip), %xmm2 #1868.31 + movq 10752+__jsvml_dtanh_ha_data_internal(%rip), %xmm2 #1868.31 movdqa %xmm0, %xmm10 #1866.23 pcmpgtd %xmm0, %xmm2 #1868.31 psubd %xmm11, %xmm0 #1871.19 movdqa %xmm0, %xmm8 #1872.23 - movq 10688+__svml_dtanh_ha_data_internal(%rip), %xmm7 #1859.28 + movq 10688+__jsvml_dtanh_ha_data_internal(%rip), %xmm7 #1859.28 pcmpgtd %xmm9, %xmm8 #1872.23 pand %xmm0, %xmm8 #1874.23 pcmpgtd %xmm7, %xmm0 #1873.23 blendvps %xmm0, %xmm7, %xmm8 #1875.41 psrld $10, %xmm8 #1876.23 movd %xmm8, %eax #1877.135 - movq 10560+__svml_dtanh_ha_data_internal(%rip), %xmm12 #1856.21 + movq 10560+__jsvml_dtanh_ha_data_internal(%rip), %xmm12 #1856.21 pcmpgtd %xmm12, %xmm10 #1866.23 movslq %eax, %rax #1877.135 por %xmm2, %xmm10 #1869.27 @@ -1256,7 +1256,7 @@ __svml_tanh2_ha_e9: mulpd %xmm13, %xmm2 #1892.27 addpd %xmm9, %xmm2 #1892.15 mulpd %xmm13, %xmm2 #1899.19 - movups 10304+__svml_dtanh_ha_data_internal(%rip), %xmm1 #1901.60 + movups 10304+__jsvml_dtanh_ha_data_internal(%rip), %xmm1 #1901.60 movaps %xmm1, %xmm3 #1902.22 andps %xmm10, %xmm3 #1902.22 andps %xmm13, %xmm1 #1904.22 @@ -1341,29 +1341,29 @@ __svml_tanh2_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,8), %rdi #1917.546 lea 128(%rsp,%r12,8), %rsi #1917.546 -..___tag_value___svml_tanh2_ha_e9.159: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #1917.546 -..___tag_value___svml_tanh2_ha_e9.160: +..___tag_value___jsvml_tanh2_ha_e9.159: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #1917.546 +..___tag_value___jsvml_tanh2_ha_e9.160: jmp ..B7.8 # Prob 100% #1917.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanh2_ha_e9,@function - .size __svml_tanh2_ha_e9,.-__svml_tanh2_ha_e9 -..LN__svml_tanh2_ha_e9.6: + .type __jsvml_tanh2_ha_e9,@function + .size __jsvml_tanh2_ha_e9,.-__jsvml_tanh2_ha_e9 +..LN__jsvml_tanh2_ha_e9.6: .data -# -- End __svml_tanh2_ha_e9 +# -- End __jsvml_tanh2_ha_e9 .text -.L_2__routine_start___svml_tanh1_ha_e9_7: -# -- Begin __svml_tanh1_ha_e9 +.L_2__routine_start___jsvml_tanh1_ha_e9_7: +# -- Begin __jsvml_tanh1_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh1_ha_e9 -# --- __svml_tanh1_ha_e9(__m128d) -__svml_tanh1_ha_e9: + .globl __jsvml_tanh1_ha_e9 +# --- __jsvml_tanh1_ha_e9(__m128d) +__jsvml_tanh1_ha_e9: # parameter 1: %xmm0 ..B8.1: # Preds ..B8.0 # Execution count [1.00e+00] @@ -1372,7 +1372,7 @@ __svml_tanh1_ha_e9: .byte 30 #2019.546 .byte 250 #2019.546 .cfi_startproc -..___tag_value___svml_tanh1_ha_e9.162: +..___tag_value___jsvml_tanh1_ha_e9.162: ..L163: #1925.1 pushq %rbp #1925.1 @@ -1385,9 +1385,9 @@ __svml_tanh1_ha_e9: movl $2147352576, %edx #1967.22 movl $535822336, %esi #1970.31 movl $1069416448, %edi #1973.19 - movsd 10432+__svml_dtanh_ha_data_internal(%rip), %xmm4 #1963.12 + movsd 10432+__jsvml_dtanh_ha_data_internal(%rip), %xmm4 #1963.12 movl $7733248, %eax #1961.28 - movsd 10368+__svml_dtanh_ha_data_internal(%rip), %xmm5 #1964.13 + movsd 10368+__jsvml_dtanh_ha_data_internal(%rip), %xmm5 #1964.13 andps %xmm0, %xmm4 #1963.12 movups %xmm0, 16(%rsp) #1925.1[spill] andps %xmm0, %xmm5 #1964.13 @@ -1402,7 +1402,7 @@ __svml_tanh1_ha_e9: movdqa %xmm0, %xmm13 #1974.23 movd %eax, %xmm12 #1961.28 pxor %xmm11, %xmm11 #1974.23 - lea 2728+__svml_dtanh_ha_data_internal(%rip), %r9 #1979.22 + lea 2728+__jsvml_dtanh_ha_data_internal(%rip), %r9 #1979.22 pcmpgtd %xmm11, %xmm13 #1974.23 movl $2145386496, %ecx #1968.23 pand %xmm0, %xmm13 #1976.23 @@ -1448,7 +1448,7 @@ __svml_tanh1_ha_e9: unpcklpd %xmm12, %xmm12 #1980.164 addsd %xmm12, %xmm1 #1994.15 mulsd %xmm4, %xmm1 #2001.19 - movsd 10304+__svml_dtanh_ha_data_internal(%rip), %xmm14 #2003.29 + movsd 10304+__jsvml_dtanh_ha_data_internal(%rip), %xmm14 #2003.29 movups -88(%r9,%r8), %xmm3 #1980.66 movaps %xmm14, %xmm6 #2004.22 andps %xmm3, %xmm6 #2004.22 @@ -1516,29 +1516,29 @@ __svml_tanh1_ha_e9: # Execution count [6.25e-04]: Infreq lea (%rsp), %rdi #2019.546 lea 64(%rsp), %rsi #2019.546 -..___tag_value___svml_tanh1_ha_e9.177: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #2019.546 -..___tag_value___svml_tanh1_ha_e9.178: +..___tag_value___jsvml_tanh1_ha_e9.177: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #2019.546 +..___tag_value___jsvml_tanh1_ha_e9.178: jmp ..B8.4 # Prob 100% #2019.546 .align 16,0x90 # LOE rbx r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_tanh1_ha_e9,@function - .size __svml_tanh1_ha_e9,.-__svml_tanh1_ha_e9 -..LN__svml_tanh1_ha_e9.7: + .type __jsvml_tanh1_ha_e9,@function + .size __jsvml_tanh1_ha_e9,.-__jsvml_tanh1_ha_e9 +..LN__jsvml_tanh1_ha_e9.7: .data -# -- End __svml_tanh1_ha_e9 +# -- End __jsvml_tanh1_ha_e9 .text -.L_2__routine_start___svml_tanh8_ha_z0_8: -# -- Begin __svml_tanh8_ha_z0 +.L_2__routine_start___jsvml_tanh8_ha_z0_8: +# -- Begin __jsvml_tanh8_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_tanh8_ha_z0 -# --- __svml_tanh8_ha_z0(__m512d) -__svml_tanh8_ha_z0: + .globl __jsvml_tanh8_ha_z0 +# --- __jsvml_tanh8_ha_z0(__m512d) +__jsvml_tanh8_ha_z0: # parameter 1: %zmm0 ..B9.1: # Preds ..B9.0 # Execution count [1.00e+00] @@ -1547,7 +1547,7 @@ __svml_tanh8_ha_z0: .byte 30 #2117.759 .byte 250 #2117.759 .cfi_startproc -..___tag_value___svml_tanh8_ha_z0.180: +..___tag_value___jsvml_tanh8_ha_z0.180: ..L181: #2027.1 pushq %rbp #2027.1 @@ -1559,63 +1559,63 @@ __svml_tanh8_ha_z0: subq $320, %rsp #2027.1 vpsrlq $32, %zmm0, %zmm4 #2068.31 vmovups %zmm0, 192(%rsp) #2027.1[spill] - vmovups __svml_dtanh_ha_data_internal(%rip), %zmm14 #2077.257 - vmovups 128+__svml_dtanh_ha_data_internal(%rip), %zmm15 #2079.267 + vmovups __jsvml_dtanh_ha_data_internal(%rip), %zmm14 #2077.257 + vmovups 128+__jsvml_dtanh_ha_data_internal(%rip), %zmm15 #2079.267 vpmovqd %zmm4, %ymm5 #2068.9 - vandpd 10432+__svml_dtanh_ha_data_internal(%rip), %zmm0, %zmm13 #2065.12 - vandpd 10368+__svml_dtanh_ha_data_internal(%rip), %zmm0, %zmm3 #2066.13 - vpand 2432+__svml_dtanh_ha_data_internal(%rip), %ymm5, %ymm7 #2069.16 - vmovups 384+__svml_dtanh_ha_data_internal(%rip), %zmm0 #2080.267 - vmovups 2176+__svml_dtanh_ha_data_internal(%rip), %zmm4 #2094.274 - vmovups 2048+__svml_dtanh_ha_data_internal(%rip), %zmm5 #2093.274 + vandpd 10432+__jsvml_dtanh_ha_data_internal(%rip), %zmm0, %zmm13 #2065.12 + vandpd 10368+__jsvml_dtanh_ha_data_internal(%rip), %zmm0, %zmm3 #2066.13 + vpand 2432+__jsvml_dtanh_ha_data_internal(%rip), %ymm5, %ymm7 #2069.16 + vmovups 384+__jsvml_dtanh_ha_data_internal(%rip), %zmm0 #2080.267 + vmovups 2176+__jsvml_dtanh_ha_data_internal(%rip), %zmm4 #2094.274 + vmovups 2048+__jsvml_dtanh_ha_data_internal(%rip), %zmm5 #2093.274 vmovups %zmm3, (%rsp) #2066.13[spill] - vmovups 512+__svml_dtanh_ha_data_internal(%rip), %zmm3 #2081.267 - vpsubd 2496+__svml_dtanh_ha_data_internal(%rip), %ymm7, %ymm8 #2072.13 + vmovups 512+__jsvml_dtanh_ha_data_internal(%rip), %zmm3 #2081.267 + vpsubd 2496+__jsvml_dtanh_ha_data_internal(%rip), %ymm7, %ymm8 #2072.13 vxorps %ymm9, %ymm9, %ymm9 #2073.17 vpmaxsd %ymm9, %ymm8, %ymm10 #2073.17 - vpminsd 2560+__svml_dtanh_ha_data_internal(%rip), %ymm10, %ymm11 #2074.17 + vpminsd 2560+__jsvml_dtanh_ha_data_internal(%rip), %ymm10, %ymm11 #2074.17 vpsrld $19, %ymm11, %ymm12 #2075.23 - vmovups 1664+__svml_dtanh_ha_data_internal(%rip), %zmm8 #2090.274 - vmovups 1536+__svml_dtanh_ha_data_internal(%rip), %zmm9 #2089.270 - vmovups 1408+__svml_dtanh_ha_data_internal(%rip), %zmm10 #2088.270 - vmovups 1280+__svml_dtanh_ha_data_internal(%rip), %zmm11 #2087.267 + vmovups 1664+__jsvml_dtanh_ha_data_internal(%rip), %zmm8 #2090.274 + vmovups 1536+__jsvml_dtanh_ha_data_internal(%rip), %zmm9 #2089.270 + vmovups 1408+__jsvml_dtanh_ha_data_internal(%rip), %zmm10 #2088.270 + vmovups 1280+__jsvml_dtanh_ha_data_internal(%rip), %zmm11 #2087.267 vpmovzxdq %ymm12, %zmm2 #2076.23 - vmovups 1152+__svml_dtanh_ha_data_internal(%rip), %zmm12 #2086.267 - vpermt2pd 448+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm0 #2080.267 - vpermt2pd 64+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm14 #2077.257 - vpermt2pd 2240+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm4 #2094.274 - vpermt2pd 2112+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm5 #2093.274 + vmovups 1152+__jsvml_dtanh_ha_data_internal(%rip), %zmm12 #2086.267 + vpermt2pd 448+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm0 #2080.267 + vpermt2pd 64+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm14 #2077.257 + vpermt2pd 2240+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm4 #2094.274 + vpermt2pd 2112+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm5 #2093.274 vsubpd {rn-sae}, %zmm14, %zmm13, %zmm1 #2078.21 - vpermt2pd 1728+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm8 #2090.274 - vpermt2pd 1600+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm9 #2089.270 - vpermt2pd 1472+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm10 #2088.270 - vpermt2pd 1344+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm11 #2087.267 - vpermt2pd 1216+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm12 #2086.267 - vpermt2pd 576+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm3 #2081.267 - vpermt2pd 192+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm15 #2079.267 + vpermt2pd 1728+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm8 #2090.274 + vpermt2pd 1600+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm9 #2089.270 + vpermt2pd 1472+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm10 #2088.270 + vpermt2pd 1344+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm11 #2087.267 + vpermt2pd 1216+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm12 #2086.267 + vpermt2pd 576+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm3 #2081.267 + vpermt2pd 192+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm15 #2079.267 vmovups %zmm0, 128(%rsp) #2080.267[spill] - vmovups 2304+__svml_dtanh_ha_data_internal(%rip), %zmm0 #2095.274 - vmovups 1024+__svml_dtanh_ha_data_internal(%rip), %zmm13 #2085.267 - vmovups 896+__svml_dtanh_ha_data_internal(%rip), %zmm14 #2084.267 + vmovups 2304+__jsvml_dtanh_ha_data_internal(%rip), %zmm0 #2095.274 + vmovups 1024+__jsvml_dtanh_ha_data_internal(%rip), %zmm13 #2085.267 + vmovups 896+__jsvml_dtanh_ha_data_internal(%rip), %zmm14 #2084.267 vmovups %zmm3, 256(%rsp) #2081.267[spill] - vmovups 768+__svml_dtanh_ha_data_internal(%rip), %zmm3 #2083.267 + vmovups 768+__jsvml_dtanh_ha_data_internal(%rip), %zmm3 #2083.267 vmovups %zmm15, 64(%rsp) #2079.267[spill] - vmovups 640+__svml_dtanh_ha_data_internal(%rip), %zmm15 #2082.267 - vpermt2pd 2368+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm0 #2095.274 - vpermt2pd 1088+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm13 #2085.267 - vpermt2pd 960+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm14 #2084.267 - vpermt2pd 832+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm3 #2083.267 - vpermt2pd 704+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm15 #2082.267 + vmovups 640+__jsvml_dtanh_ha_data_internal(%rip), %zmm15 #2082.267 + vpermt2pd 2368+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm0 #2095.274 + vpermt2pd 1088+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm13 #2085.267 + vpermt2pd 960+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm14 #2084.267 + vpermt2pd 832+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm3 #2083.267 + vpermt2pd 704+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm15 #2082.267 vfmadd213pd {rn-sae}, %zmm4, %zmm1, %zmm0 #2096.19 - vmovups 256+__svml_dtanh_ha_data_internal(%rip), %zmm4 #2110.271 + vmovups 256+__jsvml_dtanh_ha_data_internal(%rip), %zmm4 #2110.271 vfmadd213pd {rn-sae}, %zmm5, %zmm1, %zmm0 #2097.19 - vpermt2pd 320+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm4 #2110.271 - vpcmpgtd 10560+__svml_dtanh_ha_data_internal(%rip), %ymm7, %ymm6 #2070.19 + vpermt2pd 320+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm4 #2110.271 + vpcmpgtd 10560+__jsvml_dtanh_ha_data_internal(%rip), %ymm7, %ymm6 #2070.19 vmovmskps %ymm6, %esi #2071.40 - vmovups 1920+__svml_dtanh_ha_data_internal(%rip), %zmm6 #2092.274 - vmovups 1792+__svml_dtanh_ha_data_internal(%rip), %zmm7 #2091.274 - vpermt2pd 1984+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm6 #2092.274 - vpermt2pd 1856+__svml_dtanh_ha_data_internal(%rip), %zmm2, %zmm7 #2091.274 + vmovups 1920+__jsvml_dtanh_ha_data_internal(%rip), %zmm6 #2092.274 + vmovups 1792+__jsvml_dtanh_ha_data_internal(%rip), %zmm7 #2091.274 + vpermt2pd 1984+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm6 #2092.274 + vpermt2pd 1856+__jsvml_dtanh_ha_data_internal(%rip), %zmm2, %zmm7 #2091.274 vfmadd213pd {rn-sae}, %zmm6, %zmm1, %zmm0 #2098.19 vfmadd213pd {rn-sae}, %zmm7, %zmm1, %zmm0 #2099.19 vfmadd213pd {rn-sae}, %zmm8, %zmm1, %zmm0 #2100.19 @@ -1746,30 +1746,30 @@ __svml_tanh8_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,8), %rdi #2117.759 lea 128(%rsp,%rbx,8), %rsi #2117.759 -..___tag_value___svml_tanh8_ha_z0.218: -# __svml_dtanh_ha_cout_rare_internal(const double *, double *) - call __svml_dtanh_ha_cout_rare_internal #2117.759 -..___tag_value___svml_tanh8_ha_z0.219: +..___tag_value___jsvml_tanh8_ha_z0.218: +# __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) + call __jsvml_dtanh_ha_cout_rare_internal #2117.759 +..___tag_value___jsvml_tanh8_ha_z0.219: jmp ..B9.13 # Prob 100% #2117.759 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_tanh8_ha_z0,@function - .size __svml_tanh8_ha_z0,.-__svml_tanh8_ha_z0 -..LN__svml_tanh8_ha_z0.8: + .type __jsvml_tanh8_ha_z0,@function + .size __jsvml_tanh8_ha_z0,.-__jsvml_tanh8_ha_z0 +..LN__jsvml_tanh8_ha_z0.8: .data -# -- End __svml_tanh8_ha_z0 +# -- End __jsvml_tanh8_ha_z0 .text -.L_2__routine_start___svml_dtanh_ha_cout_rare_internal_9: -# -- Begin __svml_dtanh_ha_cout_rare_internal +.L_2__routine_start___jsvml_dtanh_ha_cout_rare_internal_9: +# -- Begin __jsvml_dtanh_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_dtanh_ha_cout_rare_internal - .globl __svml_dtanh_ha_cout_rare_internal -# --- __svml_dtanh_ha_cout_rare_internal(const double *, double *) -__svml_dtanh_ha_cout_rare_internal: + .hidden __jsvml_dtanh_ha_cout_rare_internal + .globl __jsvml_dtanh_ha_cout_rare_internal +# --- __jsvml_dtanh_ha_cout_rare_internal(const double *, double *) +__jsvml_dtanh_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B10.1: # Preds ..B10.0 @@ -1779,7 +1779,7 @@ __svml_dtanh_ha_cout_rare_internal: .byte 30 #1219.9 .byte 250 #1219.9 .cfi_startproc -..___tag_value___svml_dtanh_ha_cout_rare_internal.221: +..___tag_value___jsvml_dtanh_ha_cout_rare_internal.221: ..L222: #1196.1 lea _imldTanhHATab(%rip), %rdx #1200.30 @@ -1837,17 +1837,17 @@ __svml_dtanh_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_dtanh_ha_cout_rare_internal,@function - .size __svml_dtanh_ha_cout_rare_internal,.-__svml_dtanh_ha_cout_rare_internal -..LN__svml_dtanh_ha_cout_rare_internal.9: + .type __jsvml_dtanh_ha_cout_rare_internal,@function + .size __jsvml_dtanh_ha_cout_rare_internal,.-__jsvml_dtanh_ha_cout_rare_internal +..LN__jsvml_dtanh_ha_cout_rare_internal.9: .data -# -- End __svml_dtanh_ha_cout_rare_internal +# -- End __jsvml_dtanh_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_dtanh_ha_data_internal - .globl __svml_dtanh_ha_data_internal -__svml_dtanh_ha_data_internal: + .hidden __jsvml_dtanh_ha_data_internal + .globl __jsvml_dtanh_ha_data_internal +__jsvml_dtanh_ha_data_internal: .long 0 .long 0 .long 0 @@ -4552,8 +4552,8 @@ __svml_dtanh_ha_data_internal: .long 535822336 .long 535822336 .long 535822336 - .type __svml_dtanh_ha_data_internal,@object - .size __svml_dtanh_ha_data_internal,10816 + .type __jsvml_dtanh_ha_data_internal,@object + .size __jsvml_dtanh_ha_data_internal,10816 .align 8 _imldTanhHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_acos_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_acos_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_acos_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_acos_linux_x86.S index 1b6ac55edd3..b69ccf39d4d 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_acos_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_acos_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_acos.c" .text ..TXTST0: -.L_2__routine_start___svml_acosf16_ha_z0_0: -# -- Begin __svml_acosf16_ha_z0 +.L_2__routine_start___jsvml_acosf16_ha_z0_0: +# -- Begin __jsvml_acosf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_acosf16_ha_z0 -# --- __svml_acosf16_ha_z0(__m512) -__svml_acosf16_ha_z0: + .globl __jsvml_acosf16_ha_z0 +# --- __jsvml_acosf16_ha_z0(__m512) +__jsvml_acosf16_ha_z0: # parameter 1: %zmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,14 +47,14 @@ __svml_acosf16_ha_z0: .byte 30 #224.12 .byte 250 #224.12 .cfi_startproc -..___tag_value___svml_acosf16_ha_z0.1: +..___tag_value___jsvml_acosf16_ha_z0.1: ..L2: #139.1 - vmovups __svml_sacos_ha_data_internal(%rip), %zmm7 #175.45 - vmovups 64+__svml_sacos_ha_data_internal(%rip), %zmm8 #176.46 - vmovups 192+__svml_sacos_ha_data_internal(%rip), %zmm12 #188.786 - vmovups 256+__svml_sacos_ha_data_internal(%rip), %zmm10 #177.43 - vmovups 448+__svml_sacos_ha_data_internal(%rip), %zmm1 #188.1229 + vmovups __jsvml_sacos_ha_data_internal(%rip), %zmm7 #175.45 + vmovups 64+__jsvml_sacos_ha_data_internal(%rip), %zmm8 #176.46 + vmovups 192+__jsvml_sacos_ha_data_internal(%rip), %zmm12 #188.786 + vmovups 256+__jsvml_sacos_ha_data_internal(%rip), %zmm10 #177.43 + vmovups 448+__jsvml_sacos_ha_data_internal(%rip), %zmm1 #188.1229 vmovaps %zmm0, %zmm6 #139.1 vorps %zmm6, %zmm7, %zmm5 #178.8 vandps %zmm6, %zmm7, %zmm4 #179.12 @@ -65,32 +65,32 @@ __svml_acosf16_ha_z0: vcmpps $22, {sae}, %zmm5, %zmm10, %k1 #180.13 vminps {sae}, %zmm8, %zmm9, %zmm3 #183.11 vaddps {rn-sae}, %zmm8, %zmm8, %zmm13 #188.1005 - vandps 384+__svml_sacos_ha_data_internal(%rip), %zmm11, %zmm0 #188.703 + vandps 384+__jsvml_sacos_ha_data_internal(%rip), %zmm11, %zmm0 #188.703 vcmpps $21, {sae}, %zmm8, %zmm3, %k4 #184.14 - vmovups 512+__svml_sacos_ha_data_internal(%rip), %zmm8 #188.2147 - vandps 320+__svml_sacos_ha_data_internal(%rip), %zmm13, %zmm14 #188.1327 + vmovups 512+__jsvml_sacos_ha_data_internal(%rip), %zmm8 #188.2147 + vandps 320+__jsvml_sacos_ha_data_internal(%rip), %zmm13, %zmm14 #188.1327 vxorps %zmm0, %zmm0, %zmm0{%k2} #188.933 - vorps 1344+__svml_sacos_ha_data_internal(%rip), %zmm3, %zmm3{%k1} #187.11 + vorps 1344+__jsvml_sacos_ha_data_internal(%rip), %zmm3, %zmm3{%k1} #187.11 vsubps {rn-sae}, %zmm14, %zmm13, %zmm15 #188.1378 vmulps {rn-sae}, %zmm0, %zmm14, %zmm2 #188.1480 vmulps {rn-sae}, %zmm0, %zmm15, %zmm12 #188.1582 vmulps {rn-sae}, %zmm3, %zmm3, %zmm15 #195.15 vcmpps $21, {sae}, %zmm6, %zmm3, %k0 #200.17 vfmsub231ps {rn-sae}, %zmm2, %zmm0, %zmm1 #188.1685 - vmovups 640+__svml_sacos_ha_data_internal(%rip), %zmm13 #189.56 - vmovups 768+__svml_sacos_ha_data_internal(%rip), %zmm14 #191.56 - vmovups 960+__svml_sacos_ha_data_internal(%rip), %zmm6 #203.47 + vmovups 640+__jsvml_sacos_ha_data_internal(%rip), %zmm13 #189.56 + vmovups 768+__jsvml_sacos_ha_data_internal(%rip), %zmm14 #191.56 + vmovups 960+__jsvml_sacos_ha_data_internal(%rip), %zmm6 #203.47 vmulps {rn-sae}, %zmm0, %zmm12, %zmm7 #188.1797 - vmovups 832+__svml_sacos_ha_data_internal(%rip), %zmm0 #194.14 + vmovups 832+__jsvml_sacos_ha_data_internal(%rip), %zmm0 #194.14 vaddps {rn-sae}, %zmm12, %zmm2, %zmm9 #188.1900 vaddps {rn-sae}, %zmm7, %zmm1, %zmm10 #188.2004 vxorps %zmm6, %zmm6, %zmm6{%k4} #208.15 - vmovups 704+__svml_sacos_ha_data_internal(%rip), %zmm7 #190.56 + vmovups 704+__jsvml_sacos_ha_data_internal(%rip), %zmm7 #190.56 vfmadd231ps {rn-sae}, %zmm3, %zmm14, %zmm0 #194.14 - vmovups 576+__svml_sacos_ha_data_internal(%rip), %zmm1 #188.2302 + vmovups 576+__jsvml_sacos_ha_data_internal(%rip), %zmm1 #188.2302 vmulps {rn-sae}, %zmm10, %zmm9, %zmm11 #188.2420 vfmadd231ps {rn-sae}, %zmm3, %zmm13, %zmm7 #193.15 - vmovups 896+__svml_sacos_ha_data_internal(%rip), %zmm13 #196.56 + vmovups 896+__jsvml_sacos_ha_data_internal(%rip), %zmm13 #196.56 vfmadd231ps {rn-sae}, %zmm10, %zmm8, %zmm1 #188.2302 vfmadd213ps {rn-sae}, %zmm0, %zmm15, %zmm7 #197.15 vfmsub213ps {rn-sae}, %zmm12, %zmm11, %zmm1 #188.2523 @@ -98,14 +98,14 @@ __svml_acosf16_ha_z0: kmovw %k4, %eax #184.14 kmovw %k0, %edx #200.17 vmulps {rn-sae}, %zmm3, %zmm7, %zmm0 #199.17 - vmovups 1024+__svml_sacos_ha_data_internal(%rip), %zmm3 #202.47 - vmovups 1216+__svml_sacos_ha_data_internal(%rip), %zmm7 #206.47 + vmovups 1024+__jsvml_sacos_ha_data_internal(%rip), %zmm3 #202.47 + vmovups 1216+__jsvml_sacos_ha_data_internal(%rip), %zmm7 #206.47 vxorps %zmm3, %zmm3, %zmm3{%k4} #207.15 vblendmps %zmm1, %zmm7, %zmm1{%k4} #212.13 andl %eax, %edx #201.29 kmovw %edx, %k3 #209.15 - vorps 1152+__svml_sacos_ha_data_internal(%rip), %zmm3, %zmm3{%k3} #209.15 - vorps 1088+__svml_sacos_ha_data_internal(%rip), %zmm6, %zmm6{%k3} #210.15 + vorps 1152+__jsvml_sacos_ha_data_internal(%rip), %zmm3, %zmm3{%k3} #209.15 + vorps 1088+__jsvml_sacos_ha_data_internal(%rip), %zmm6, %zmm6{%k3} #210.15 vxorps %zmm4, %zmm3, %zmm8 #211.15 vblendmps %zmm2, %zmm5, %zmm3{%k4} #213.13 vsubps {rn-sae}, %zmm1, %zmm8, %zmm5 #215.17 @@ -119,20 +119,20 @@ __svml_acosf16_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_acosf16_ha_z0,@function - .size __svml_acosf16_ha_z0,.-__svml_acosf16_ha_z0 -..LN__svml_acosf16_ha_z0.0: + .type __jsvml_acosf16_ha_z0,@function + .size __jsvml_acosf16_ha_z0,.-__jsvml_acosf16_ha_z0 +..LN__jsvml_acosf16_ha_z0.0: .data -# -- End __svml_acosf16_ha_z0 +# -- End __jsvml_acosf16_ha_z0 .text -.L_2__routine_start___svml_acosf4_ha_ex_1: -# -- Begin __svml_acosf4_ha_ex +.L_2__routine_start___jsvml_acosf4_ha_ex_1: +# -- Begin __jsvml_acosf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_acosf4_ha_ex -# --- __svml_acosf4_ha_ex(__m128) -__svml_acosf4_ha_ex: + .globl __jsvml_acosf4_ha_ex +# --- __jsvml_acosf4_ha_ex(__m128) +__jsvml_acosf4_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -141,7 +141,7 @@ __svml_acosf4_ha_ex: .byte 30 #312.540 .byte 250 #312.540 .cfi_startproc -..___tag_value___svml_acosf4_ha_ex.4: +..___tag_value___jsvml_acosf4_ha_ex.4: ..L5: #229.1 pushq %rbp #229.1 @@ -152,8 +152,8 @@ __svml_acosf4_ha_ex: andq $-64, %rsp #229.1 subq $192, %rsp #229.1 movaps %xmm0, %xmm7 #229.1 - movups __svml_sacos_ha_data_internal(%rip), %xmm5 #264.43 - movups 64+__svml_sacos_ha_data_internal(%rip), %xmm4 #265.44 + movups __jsvml_sacos_ha_data_internal(%rip), %xmm5 #264.43 + movups 64+__jsvml_sacos_ha_data_internal(%rip), %xmm4 #265.44 movaps %xmm5, %xmm6 #267.8 orps %xmm7, %xmm6 #267.8 movaps %xmm4, %xmm8 #270.20 @@ -165,16 +165,16 @@ __svml_acosf4_ha_ex: rsqrtps %xmm4, %xmm10 #276.494 movaps %xmm4, %xmm15 #276.620 movaps %xmm0, %xmm3 #275.14 - cmpltps 192+__svml_sacos_ha_data_internal(%rip), %xmm15 #276.620 + cmpltps 192+__jsvml_sacos_ha_data_internal(%rip), %xmm15 #276.620 cmpnltps %xmm4, %xmm3 #275.14 addps %xmm4, %xmm4 #276.713 - movups 320+__svml_sacos_ha_data_internal(%rip), %xmm11 #276.786 + movups 320+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #276.786 andnps %xmm10, %xmm15 #276.663 movaps %xmm11, %xmm2 #276.1058 movaps %xmm15, %xmm13 #276.1350 andps %xmm4, %xmm2 #276.1058 andps %xmm7, %xmm5 #268.12 - movups 512+__svml_sacos_ha_data_internal(%rip), %xmm1 #276.1805 + movups 512+__jsvml_sacos_ha_data_internal(%rip), %xmm1 #276.1805 subps %xmm2, %xmm4 #276.1104 mulps %xmm15, %xmm2 #276.1142 mulps %xmm15, %xmm4 #276.1180 @@ -184,37 +184,37 @@ __svml_acosf4_ha_ex: subps %xmm11, %xmm12 #276.1267 mulps %xmm15, %xmm11 #276.1308 mulps %xmm12, %xmm15 #276.1390 - subps 448+__svml_sacos_ha_data_internal(%rip), %xmm11 #276.1433 + subps 448+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #276.1433 movaps %xmm2, %xmm14 #276.1566 andps %xmm3, %xmm2 #277.13 - movups 640+__svml_sacos_ha_data_internal(%rip), %xmm8 #283.27 + movups 640+__jsvml_sacos_ha_data_internal(%rip), %xmm8 #283.27 movaps %xmm3, %xmm12 #298.15 mulps %xmm0, %xmm8 #283.27 addps %xmm11, %xmm13 #276.1478 addps %xmm4, %xmm14 #276.1566 addps %xmm13, %xmm15 #276.1523 - addps 704+__svml_sacos_ha_data_internal(%rip), %xmm8 #283.15 + addps 704+__jsvml_sacos_ha_data_internal(%rip), %xmm8 #283.15 mulps %xmm15, %xmm1 #276.1805 mulps %xmm14, %xmm15 #276.1863 - addps 576+__svml_sacos_ha_data_internal(%rip), %xmm1 #276.1793 + addps 576+__jsvml_sacos_ha_data_internal(%rip), %xmm1 #276.1793 mulps %xmm15, %xmm1 #276.1916 - movups 768+__svml_sacos_ha_data_internal(%rip), %xmm11 #284.26 + movups 768+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #284.26 subps %xmm4, %xmm1 #276.1904 mulps %xmm0, %xmm11 #284.26 movaps %xmm0, %xmm4 #285.13 andps %xmm3, %xmm1 #278.13 mulps %xmm0, %xmm4 #285.13 - addps 832+__svml_sacos_ha_data_internal(%rip), %xmm11 #284.14 + addps 832+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #284.14 mulps %xmm4, %xmm8 #287.27 - movups 256+__svml_sacos_ha_data_internal(%rip), %xmm9 #266.41 + movups 256+__jsvml_sacos_ha_data_internal(%rip), %xmm9 #266.41 addps %xmm8, %xmm11 #287.15 cmpnleps %xmm6, %xmm9 #269.13 mulps %xmm0, %xmm11 #288.27 movmskps %xmm9, %edx #274.40 - movups 1152+__svml_sacos_ha_data_internal(%rip), %xmm9 #294.14 - movups 1088+__svml_sacos_ha_data_internal(%rip), %xmm10 #295.14 - andnps 1024+__svml_sacos_ha_data_internal(%rip), %xmm12 #298.15 - addps 896+__svml_sacos_ha_data_internal(%rip), %xmm11 #288.15 + movups 1152+__jsvml_sacos_ha_data_internal(%rip), %xmm9 #294.14 + movups 1088+__jsvml_sacos_ha_data_internal(%rip), %xmm10 #295.14 + andnps 1024+__jsvml_sacos_ha_data_internal(%rip), %xmm12 #298.15 + addps 896+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #288.15 mulps %xmm0, %xmm11 #289.15 cmpnltps %xmm7, %xmm0 #290.17 andps %xmm3, %xmm0 #293.17 @@ -226,7 +226,7 @@ __svml_acosf4_ha_ex: orps %xmm9, %xmm12 #301.15 movaps %xmm2, %xmm3 #305.13 pxor %xmm5, %xmm12 #303.15 - andnps 960+__svml_sacos_ha_data_internal(%rip), %xmm0 #299.15 + andnps 960+__jsvml_sacos_ha_data_internal(%rip), %xmm0 #299.15 subps %xmm1, %xmm3 #305.13 subps %xmm1, %xmm12 #306.14 mulps %xmm3, %xmm11 #307.26 @@ -289,29 +289,29 @@ __svml_acosf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #312.540 lea 128(%rsp,%r12,4), %rsi #312.540 -..___tag_value___svml_acosf4_ha_ex.22: -# __svml_sacos_ha_cout_rare_internal(const float *, float *) - call __svml_sacos_ha_cout_rare_internal #312.540 -..___tag_value___svml_acosf4_ha_ex.23: +..___tag_value___jsvml_acosf4_ha_ex.22: +# __jsvml_sacos_ha_cout_rare_internal(const float *, float *) + call __jsvml_sacos_ha_cout_rare_internal #312.540 +..___tag_value___jsvml_acosf4_ha_ex.23: jmp ..B2.8 # Prob 100% #312.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acosf4_ha_ex,@function - .size __svml_acosf4_ha_ex,.-__svml_acosf4_ha_ex -..LN__svml_acosf4_ha_ex.1: + .type __jsvml_acosf4_ha_ex,@function + .size __jsvml_acosf4_ha_ex,.-__jsvml_acosf4_ha_ex +..LN__jsvml_acosf4_ha_ex.1: .data -# -- End __svml_acosf4_ha_ex +# -- End __jsvml_acosf4_ha_ex .text -.L_2__routine_start___svml_acosf8_ha_e9_2: -# -- Begin __svml_acosf8_ha_e9 +.L_2__routine_start___jsvml_acosf8_ha_e9_2: +# -- Begin __jsvml_acosf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_acosf8_ha_e9 -# --- __svml_acosf8_ha_e9(__m256) -__svml_acosf8_ha_e9: + .globl __jsvml_acosf8_ha_e9 +# --- __jsvml_acosf8_ha_e9(__m256) +__jsvml_acosf8_ha_e9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -320,7 +320,7 @@ __svml_acosf8_ha_e9: .byte 30 #403.546 .byte 250 #403.546 .cfi_startproc -..___tag_value___svml_acosf8_ha_e9.25: +..___tag_value___jsvml_acosf8_ha_e9.25: ..L26: #320.1 pushq %rbp #320.1 @@ -330,26 +330,26 @@ __svml_acosf8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #320.1 subq $192, %rsp #320.1 - vmovups __svml_sacos_ha_data_internal(%rip), %ymm11 #355.46 + vmovups __jsvml_sacos_ha_data_internal(%rip), %ymm11 #355.46 vpxor %xmm2, %xmm2, %xmm2 #365.58 - vmovups 64+__svml_sacos_ha_data_internal(%rip), %ymm12 #356.47 + vmovups 64+__jsvml_sacos_ha_data_internal(%rip), %ymm12 #356.47 vmovaps %ymm0, %ymm10 #320.1 vorps %ymm10, %ymm11, %ymm9 #358.8 vmulps %ymm12, %ymm9, %ymm13 #361.23 vmulps %ymm9, %ymm9, %ymm14 #362.9 - vcmpnge_uqps 256+__svml_sacos_ha_data_internal(%rip), %ymm9, %ymm15 #360.13 + vcmpnge_uqps 256+__jsvml_sacos_ha_data_internal(%rip), %ymm9, %ymm15 #360.13 vandps %ymm10, %ymm11, %ymm8 #359.12 vaddps %ymm13, %ymm12, %ymm11 #361.8 vrsqrtps %ymm11, %ymm3 #367.494 - vcmplt_oqps 192+__svml_sacos_ha_data_internal(%rip), %ymm11, %ymm4 #367.626 + vcmplt_oqps 192+__jsvml_sacos_ha_data_internal(%rip), %ymm11, %ymm4 #367.626 vaddps %ymm11, %ymm11, %ymm12 #367.735 vminps %ymm11, %ymm14, %ymm7 #363.9 vandnps %ymm3, %ymm4, %ymm5 #367.682 vextractf128 $1, %ymm15, %xmm0 #364.114 vpackssdw %xmm0, %xmm15, %xmm1 #365.75 - vmovups 320+__svml_sacos_ha_data_internal(%rip), %ymm0 #367.814 + vmovups 320+__jsvml_sacos_ha_data_internal(%rip), %ymm0 #367.814 vpacksswb %xmm2, %xmm1, %xmm6 #365.58 - vmulps 768+__svml_sacos_ha_data_internal(%rip), %ymm7, %ymm15 #375.29 + vmulps 768+__jsvml_sacos_ha_data_internal(%rip), %ymm7, %ymm15 #375.29 vpmovmskb %xmm6, %edx #365.39 vcmpnlt_uqps %ymm11, %ymm7, %ymm6 #366.14 vandps %ymm0, %ymm12, %ymm13 #367.1089 @@ -361,31 +361,31 @@ __svml_acosf8_ha_e9: vmulps %ymm3, %ymm5, %ymm12 #367.1402 vsubps %ymm1, %ymm4, %ymm2 #367.1313 vmulps %ymm2, %ymm5, %ymm0 #367.1445 - vsubps 448+__svml_sacos_ha_data_internal(%rip), %ymm11, %ymm5 #367.1491 + vsubps 448+__jsvml_sacos_ha_data_internal(%rip), %ymm11, %ymm5 #367.1491 vaddps %ymm3, %ymm4, %ymm11 #367.1633 vaddps %ymm5, %ymm12, %ymm1 #367.1539 vaddps %ymm1, %ymm0, %ymm5 #367.1587 - vmulps 512+__svml_sacos_ha_data_internal(%rip), %ymm5, %ymm2 #367.1884 + vmulps 512+__jsvml_sacos_ha_data_internal(%rip), %ymm5, %ymm2 #367.1884 vmulps %ymm11, %ymm5, %ymm13 #367.1945 - vaddps 576+__svml_sacos_ha_data_internal(%rip), %ymm2, %ymm12 #367.1869 + vaddps 576+__jsvml_sacos_ha_data_internal(%rip), %ymm2, %ymm12 #367.1869 vmulps %ymm13, %ymm12, %ymm14 #367.2004 vsubps %ymm3, %ymm14, %ymm3 #367.1989 vandps %ymm6, %ymm4, %ymm2 #368.13 - vmulps 640+__svml_sacos_ha_data_internal(%rip), %ymm7, %ymm4 #374.30 + vmulps 640+__jsvml_sacos_ha_data_internal(%rip), %ymm7, %ymm4 #374.30 vandps %ymm6, %ymm3, %ymm1 #369.13 vmulps %ymm7, %ymm7, %ymm3 #376.13 - vaddps 704+__svml_sacos_ha_data_internal(%rip), %ymm4, %ymm0 #374.15 - vaddps 832+__svml_sacos_ha_data_internal(%rip), %ymm15, %ymm4 #375.14 + vaddps 704+__jsvml_sacos_ha_data_internal(%rip), %ymm4, %ymm0 #374.15 + vaddps 832+__jsvml_sacos_ha_data_internal(%rip), %ymm15, %ymm4 #375.14 vmulps %ymm3, %ymm0, %ymm5 #378.30 vaddps %ymm5, %ymm4, %ymm11 #378.15 vmulps %ymm11, %ymm7, %ymm12 #379.30 - vaddps 896+__svml_sacos_ha_data_internal(%rip), %ymm12, %ymm13 #379.15 + vaddps 896+__jsvml_sacos_ha_data_internal(%rip), %ymm12, %ymm13 #379.15 vmulps %ymm13, %ymm7, %ymm0 #380.15 vcmpnlt_uqps %ymm10, %ymm7, %ymm7 #381.17 vandps %ymm6, %ymm7, %ymm3 #384.17 - vandps 1152+__svml_sacos_ha_data_internal(%rip), %ymm3, %ymm5 #385.14 - vandps 1088+__svml_sacos_ha_data_internal(%rip), %ymm3, %ymm11 #386.14 - vandnps 1024+__svml_sacos_ha_data_internal(%rip), %ymm6, %ymm4 #389.15 + vandps 1152+__jsvml_sacos_ha_data_internal(%rip), %ymm3, %ymm5 #385.14 + vandps 1088+__jsvml_sacos_ha_data_internal(%rip), %ymm3, %ymm11 #386.14 + vandnps 1024+__jsvml_sacos_ha_data_internal(%rip), %ymm6, %ymm4 #389.15 vandnps %ymm9, %ymm6, %ymm3 #391.12 vorps %ymm5, %ymm4, %ymm9 #392.15 vorps %ymm3, %ymm2, %ymm4 #395.13 @@ -394,7 +394,7 @@ __svml_acosf8_ha_e9: vxorps %ymm8, %ymm9, %ymm9 #394.15 vsubps %ymm1, %ymm9, %ymm1 #397.14 vaddps %ymm0, %ymm1, %ymm5 #398.14 - vandnps 960+__svml_sacos_ha_data_internal(%rip), %ymm6, %ymm7 #390.15 + vandnps 960+__jsvml_sacos_ha_data_internal(%rip), %ymm6, %ymm7 #390.15 vaddps %ymm5, %ymm4, %ymm6 #399.14 vorps %ymm11, %ymm7, %ymm7 #393.15 vxorps %ymm8, %ymm6, %ymm8 #400.14 @@ -459,29 +459,29 @@ __svml_acosf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #403.546 lea 128(%rsp,%r12,4), %rsi #403.546 -..___tag_value___svml_acosf8_ha_e9.43: -# __svml_sacos_ha_cout_rare_internal(const float *, float *) - call __svml_sacos_ha_cout_rare_internal #403.546 -..___tag_value___svml_acosf8_ha_e9.44: +..___tag_value___jsvml_acosf8_ha_e9.43: +# __jsvml_sacos_ha_cout_rare_internal(const float *, float *) + call __jsvml_sacos_ha_cout_rare_internal #403.546 +..___tag_value___jsvml_acosf8_ha_e9.44: jmp ..B3.8 # Prob 100% #403.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acosf8_ha_e9,@function - .size __svml_acosf8_ha_e9,.-__svml_acosf8_ha_e9 -..LN__svml_acosf8_ha_e9.2: + .type __jsvml_acosf8_ha_e9,@function + .size __jsvml_acosf8_ha_e9,.-__jsvml_acosf8_ha_e9 +..LN__jsvml_acosf8_ha_e9.2: .data -# -- End __svml_acosf8_ha_e9 +# -- End __jsvml_acosf8_ha_e9 .text -.L_2__routine_start___svml_acosf8_ha_l9_3: -# -- Begin __svml_acosf8_ha_l9 +.L_2__routine_start___jsvml_acosf8_ha_l9_3: +# -- Begin __jsvml_acosf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_acosf8_ha_l9 -# --- __svml_acosf8_ha_l9(__m256) -__svml_acosf8_ha_l9: + .globl __jsvml_acosf8_ha_l9 +# --- __jsvml_acosf8_ha_l9(__m256) +__jsvml_acosf8_ha_l9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -490,7 +490,7 @@ __svml_acosf8_ha_l9: .byte 30 #494.546 .byte 250 #494.546 .cfi_startproc -..___tag_value___svml_acosf8_ha_l9.46: +..___tag_value___jsvml_acosf8_ha_l9.46: ..L47: #411.1 pushq %rbp #411.1 @@ -500,47 +500,47 @@ __svml_acosf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #411.1 subq $192, %rsp #411.1 - vmovups __svml_sacos_ha_data_internal(%rip), %ymm8 #446.46 - vmovups 64+__svml_sacos_ha_data_internal(%rip), %ymm9 #447.47 - vmovups 448+__svml_sacos_ha_data_internal(%rip), %ymm2 #458.902 + vmovups __jsvml_sacos_ha_data_internal(%rip), %ymm8 #446.46 + vmovups 64+__jsvml_sacos_ha_data_internal(%rip), %ymm9 #447.47 + vmovups 448+__jsvml_sacos_ha_data_internal(%rip), %ymm2 #458.902 vmovaps %ymm0, %ymm7 #411.1 vorps %ymm7, %ymm8, %ymm6 #449.8 vfmadd231ps %ymm6, %ymm9, %ymm9 #452.8 vmulps %ymm6, %ymm6, %ymm10 #453.9 - vcmpnge_uqps 256+__svml_sacos_ha_data_internal(%rip), %ymm6, %ymm11 #451.13 + vcmpnge_uqps 256+__jsvml_sacos_ha_data_internal(%rip), %ymm6, %ymm11 #451.13 vaddps %ymm9, %ymm9, %ymm14 #458.735 - vcmplt_oqps 192+__svml_sacos_ha_data_internal(%rip), %ymm9, %ymm12 #458.626 + vcmplt_oqps 192+__jsvml_sacos_ha_data_internal(%rip), %ymm9, %ymm12 #458.626 vminps %ymm9, %ymm10, %ymm4 #454.9 vrsqrtps %ymm9, %ymm13 #458.494 vcmpnlt_uqps %ymm9, %ymm4, %ymm3 #457.14 - vandps 320+__svml_sacos_ha_data_internal(%rip), %ymm14, %ymm15 #458.997 + vandps 320+__jsvml_sacos_ha_data_internal(%rip), %ymm14, %ymm15 #458.997 vsubps %ymm15, %ymm14, %ymm0 #458.1046 - vmovups 512+__svml_sacos_ha_data_internal(%rip), %ymm14 #458.1397 + vmovups 512+__jsvml_sacos_ha_data_internal(%rip), %ymm14 #458.1397 vandnps %ymm13, %ymm12, %ymm1 #458.682 vmulps %ymm15, %ymm1, %ymm13 #458.1087 vmulps %ymm0, %ymm1, %ymm12 #458.1128 - vmovups 768+__svml_sacos_ha_data_internal(%rip), %ymm0 #463.57 + vmovups 768+__jsvml_sacos_ha_data_internal(%rip), %ymm0 #463.57 vmulps %ymm4, %ymm4, %ymm15 #467.13 vfmsub231ps %ymm13, %ymm1, %ymm2 #458.1172 - vfmadd213ps 832+__svml_sacos_ha_data_internal(%rip), %ymm4, %ymm0 #466.14 + vfmadd213ps 832+__jsvml_sacos_ha_data_internal(%rip), %ymm4, %ymm0 #466.14 vaddps %ymm12, %ymm13, %ymm9 #458.1269 vandps %ymm7, %ymm8, %ymm5 #450.12 vmulps %ymm12, %ymm1, %ymm8 #458.1227 vaddps %ymm8, %ymm2, %ymm10 #458.1312 - vmovups 640+__svml_sacos_ha_data_internal(%rip), %ymm8 #461.57 - vfmadd213ps 576+__svml_sacos_ha_data_internal(%rip), %ymm10, %ymm14 #458.1553 - vfmadd213ps 704+__svml_sacos_ha_data_internal(%rip), %ymm4, %ymm8 #465.15 + vmovups 640+__jsvml_sacos_ha_data_internal(%rip), %ymm8 #461.57 + vfmadd213ps 576+__jsvml_sacos_ha_data_internal(%rip), %ymm10, %ymm14 #458.1553 + vfmadd213ps 704+__jsvml_sacos_ha_data_internal(%rip), %ymm4, %ymm8 #465.15 vfmadd213ps %ymm0, %ymm15, %ymm8 #469.15 - vfmadd213ps 896+__svml_sacos_ha_data_internal(%rip), %ymm4, %ymm8 #470.15 + vfmadd213ps 896+__jsvml_sacos_ha_data_internal(%rip), %ymm4, %ymm8 #470.15 vmovmskps %ymm11, %edx #456.41 vmulps %ymm10, %ymm9, %ymm11 #458.1614 vmulps %ymm8, %ymm4, %ymm0 #471.15 vcmpnlt_uqps %ymm7, %ymm4, %ymm4 #472.17 vfmsub213ps %ymm12, %ymm11, %ymm14 #458.1658 vandps %ymm3, %ymm4, %ymm4 #475.17 - vandps 1152+__svml_sacos_ha_data_internal(%rip), %ymm4, %ymm9 #476.14 - vandnps 1024+__svml_sacos_ha_data_internal(%rip), %ymm3, %ymm8 #480.15 - vandnps 960+__svml_sacos_ha_data_internal(%rip), %ymm3, %ymm10 #481.15 + vandps 1152+__jsvml_sacos_ha_data_internal(%rip), %ymm4, %ymm9 #476.14 + vandnps 1024+__jsvml_sacos_ha_data_internal(%rip), %ymm3, %ymm8 #480.15 + vandnps 960+__jsvml_sacos_ha_data_internal(%rip), %ymm3, %ymm10 #481.15 vandps %ymm3, %ymm13, %ymm2 #459.13 vandps %ymm3, %ymm14, %ymm1 #460.13 vandnps %ymm6, %ymm3, %ymm6 #482.12 @@ -551,7 +551,7 @@ __svml_acosf8_ha_l9: vsubps %ymm1, %ymm3, %ymm1 #488.14 vfmadd213ps %ymm1, %ymm2, %ymm0 #489.14 vaddps %ymm0, %ymm6, %ymm0 #490.14 - vandps 1088+__svml_sacos_ha_data_internal(%rip), %ymm4, %ymm11 #477.14 + vandps 1088+__jsvml_sacos_ha_data_internal(%rip), %ymm4, %ymm11 #477.14 vorps %ymm11, %ymm10, %ymm4 #484.15 vxorps %ymm5, %ymm0, %ymm5 #491.14 vaddps %ymm5, %ymm4, %ymm0 #492.14 @@ -614,29 +614,29 @@ __svml_acosf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #494.546 lea 128(%rsp,%r12,4), %rsi #494.546 -..___tag_value___svml_acosf8_ha_l9.64: -# __svml_sacos_ha_cout_rare_internal(const float *, float *) - call __svml_sacos_ha_cout_rare_internal #494.546 -..___tag_value___svml_acosf8_ha_l9.65: +..___tag_value___jsvml_acosf8_ha_l9.64: +# __jsvml_sacos_ha_cout_rare_internal(const float *, float *) + call __jsvml_sacos_ha_cout_rare_internal #494.546 +..___tag_value___jsvml_acosf8_ha_l9.65: jmp ..B4.8 # Prob 100% #494.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acosf8_ha_l9,@function - .size __svml_acosf8_ha_l9,.-__svml_acosf8_ha_l9 -..LN__svml_acosf8_ha_l9.3: + .type __jsvml_acosf8_ha_l9,@function + .size __jsvml_acosf8_ha_l9,.-__jsvml_acosf8_ha_l9 +..LN__jsvml_acosf8_ha_l9.3: .data -# -- End __svml_acosf8_ha_l9 +# -- End __jsvml_acosf8_ha_l9 .text -.L_2__routine_start___svml_acosf4_ha_l9_4: -# -- Begin __svml_acosf4_ha_l9 +.L_2__routine_start___jsvml_acosf4_ha_l9_4: +# -- Begin __jsvml_acosf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_acosf4_ha_l9 -# --- __svml_acosf4_ha_l9(__m128) -__svml_acosf4_ha_l9: + .globl __jsvml_acosf4_ha_l9 +# --- __jsvml_acosf4_ha_l9(__m128) +__jsvml_acosf4_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -645,7 +645,7 @@ __svml_acosf4_ha_l9: .byte 30 #585.540 .byte 250 #585.540 .cfi_startproc -..___tag_value___svml_acosf4_ha_l9.67: +..___tag_value___jsvml_acosf4_ha_l9.67: ..L68: #502.1 pushq %rbp #502.1 @@ -656,55 +656,55 @@ __svml_acosf4_ha_l9: andq $-64, %rsp #502.1 subq $192, %rsp #502.1 vmovaps %xmm0, %xmm7 #502.1 - vmovups __svml_sacos_ha_data_internal(%rip), %xmm8 #537.43 - vmovups 64+__svml_sacos_ha_data_internal(%rip), %xmm10 #538.44 + vmovups __jsvml_sacos_ha_data_internal(%rip), %xmm8 #537.43 + vmovups 64+__jsvml_sacos_ha_data_internal(%rip), %xmm10 #538.44 vorps %xmm7, %xmm8, %xmm6 #540.8 vfmadd231ps %xmm6, %xmm10, %xmm10 #543.8 vandps %xmm7, %xmm8, %xmm5 #541.12 vmulps %xmm6, %xmm6, %xmm11 #544.9 vrsqrtps %xmm10, %xmm14 #549.494 - vcmpltps 192+__svml_sacos_ha_data_internal(%rip), %xmm10, %xmm13 #549.620 + vcmpltps 192+__jsvml_sacos_ha_data_internal(%rip), %xmm10, %xmm13 #549.620 vminps %xmm10, %xmm11, %xmm4 #545.9 vaddps %xmm10, %xmm10, %xmm15 #549.713 vcmpnltps %xmm10, %xmm4, %xmm3 #548.14 - vandps 320+__svml_sacos_ha_data_internal(%rip), %xmm15, %xmm0 #549.966 + vandps 320+__jsvml_sacos_ha_data_internal(%rip), %xmm15, %xmm0 #549.966 vandnps %xmm14, %xmm13, %xmm2 #549.663 vmulps %xmm0, %xmm2, %xmm14 #549.1050 vsubps %xmm0, %xmm15, %xmm1 #549.1012 vmulps %xmm4, %xmm4, %xmm15 #558.13 vmulps %xmm1, %xmm2, %xmm13 #549.1088 - vmovups 256+__svml_sacos_ha_data_internal(%rip), %xmm9 #539.41 + vmovups 256+__jsvml_sacos_ha_data_internal(%rip), %xmm9 #539.41 vaddps %xmm13, %xmm14, %xmm10 #549.1220 vcmpnleps %xmm6, %xmm9, %xmm12 #542.13 vmulps %xmm13, %xmm2, %xmm9 #549.1181 vmovmskps %xmm12, %edx #547.40 - vmovups 448+__svml_sacos_ha_data_internal(%rip), %xmm8 #549.871 + vmovups 448+__jsvml_sacos_ha_data_internal(%rip), %xmm8 #549.871 vandnps %xmm6, %xmm3, %xmm6 #573.12 - vmovups 512+__svml_sacos_ha_data_internal(%rip), %xmm0 #549.1339 + vmovups 512+__jsvml_sacos_ha_data_internal(%rip), %xmm0 #549.1339 vfmsub231ps %xmm14, %xmm2, %xmm8 #549.1129 vandps %xmm3, %xmm14, %xmm2 #550.13 vorps %xmm6, %xmm2, %xmm6 #577.13 vaddps %xmm9, %xmm8, %xmm11 #549.1260 - vmovups 640+__svml_sacos_ha_data_internal(%rip), %xmm9 #552.54 - vfmadd213ps 704+__svml_sacos_ha_data_internal(%rip), %xmm4, %xmm9 #556.15 - vmovups 768+__svml_sacos_ha_data_internal(%rip), %xmm8 #554.54 - vfmadd213ps 832+__svml_sacos_ha_data_internal(%rip), %xmm4, %xmm8 #557.14 - vfmadd213ps 576+__svml_sacos_ha_data_internal(%rip), %xmm11, %xmm0 #549.1492 + vmovups 640+__jsvml_sacos_ha_data_internal(%rip), %xmm9 #552.54 + vfmadd213ps 704+__jsvml_sacos_ha_data_internal(%rip), %xmm4, %xmm9 #556.15 + vmovups 768+__jsvml_sacos_ha_data_internal(%rip), %xmm8 #554.54 + vfmadd213ps 832+__jsvml_sacos_ha_data_internal(%rip), %xmm4, %xmm8 #557.14 + vfmadd213ps 576+__jsvml_sacos_ha_data_internal(%rip), %xmm11, %xmm0 #549.1492 vmulps %xmm11, %xmm10, %xmm12 #549.1550 vfmadd213ps %xmm8, %xmm15, %xmm9 #560.15 - vandnps 1024+__svml_sacos_ha_data_internal(%rip), %xmm3, %xmm8 #571.15 - vandnps 960+__svml_sacos_ha_data_internal(%rip), %xmm3, %xmm10 #572.15 + vandnps 1024+__jsvml_sacos_ha_data_internal(%rip), %xmm3, %xmm8 #571.15 + vandnps 960+__jsvml_sacos_ha_data_internal(%rip), %xmm3, %xmm10 #572.15 vfmsub213ps %xmm13, %xmm12, %xmm0 #549.1591 - vfmadd213ps 896+__svml_sacos_ha_data_internal(%rip), %xmm4, %xmm9 #561.15 + vfmadd213ps 896+__jsvml_sacos_ha_data_internal(%rip), %xmm4, %xmm9 #561.15 vandps %xmm3, %xmm0, %xmm1 #551.13 vmulps %xmm9, %xmm4, %xmm0 #562.15 vsubps %xmm1, %xmm6, %xmm2 #578.13 vcmpnltps %xmm7, %xmm4, %xmm4 #563.17 vandps %xmm3, %xmm4, %xmm4 #566.17 - vandps 1152+__svml_sacos_ha_data_internal(%rip), %xmm4, %xmm9 #567.14 + vandps 1152+__jsvml_sacos_ha_data_internal(%rip), %xmm4, %xmm9 #567.14 vorps %xmm9, %xmm8, %xmm3 #574.15 vxorps %xmm5, %xmm3, %xmm3 #576.15 - vandps 1088+__svml_sacos_ha_data_internal(%rip), %xmm4, %xmm11 #568.14 + vandps 1088+__jsvml_sacos_ha_data_internal(%rip), %xmm4, %xmm11 #568.14 vsubps %xmm1, %xmm3, %xmm1 #579.14 vfmadd213ps %xmm1, %xmm2, %xmm0 #580.14 vorps %xmm11, %xmm10, %xmm4 #575.15 @@ -766,29 +766,29 @@ __svml_acosf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #585.540 lea 128(%rsp,%r12,4), %rsi #585.540 -..___tag_value___svml_acosf4_ha_l9.85: -# __svml_sacos_ha_cout_rare_internal(const float *, float *) - call __svml_sacos_ha_cout_rare_internal #585.540 -..___tag_value___svml_acosf4_ha_l9.86: +..___tag_value___jsvml_acosf4_ha_l9.85: +# __jsvml_sacos_ha_cout_rare_internal(const float *, float *) + call __jsvml_sacos_ha_cout_rare_internal #585.540 +..___tag_value___jsvml_acosf4_ha_l9.86: jmp ..B5.8 # Prob 100% #585.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acosf4_ha_l9,@function - .size __svml_acosf4_ha_l9,.-__svml_acosf4_ha_l9 -..LN__svml_acosf4_ha_l9.4: + .type __jsvml_acosf4_ha_l9,@function + .size __jsvml_acosf4_ha_l9,.-__jsvml_acosf4_ha_l9 +..LN__jsvml_acosf4_ha_l9.4: .data -# -- End __svml_acosf4_ha_l9 +# -- End __jsvml_acosf4_ha_l9 .text -.L_2__routine_start___svml_acosf4_ha_e9_5: -# -- Begin __svml_acosf4_ha_e9 +.L_2__routine_start___jsvml_acosf4_ha_e9_5: +# -- Begin __jsvml_acosf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_acosf4_ha_e9 -# --- __svml_acosf4_ha_e9(__m128) -__svml_acosf4_ha_e9: + .globl __jsvml_acosf4_ha_e9 +# --- __jsvml_acosf4_ha_e9(__m128) +__jsvml_acosf4_ha_e9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -797,7 +797,7 @@ __svml_acosf4_ha_e9: .byte 30 #1427.540 .byte 250 #1427.540 .cfi_startproc -..___tag_value___svml_acosf4_ha_e9.88: +..___tag_value___jsvml_acosf4_ha_e9.88: ..L89: #1344.1 pushq %rbp #1344.1 @@ -808,8 +808,8 @@ __svml_acosf4_ha_e9: andq $-64, %rsp #1344.1 subq $192, %rsp #1344.1 movaps %xmm0, %xmm7 #1344.1 - movups __svml_sacos_ha_data_internal(%rip), %xmm5 #1379.43 - movups 64+__svml_sacos_ha_data_internal(%rip), %xmm4 #1380.44 + movups __jsvml_sacos_ha_data_internal(%rip), %xmm5 #1379.43 + movups 64+__jsvml_sacos_ha_data_internal(%rip), %xmm4 #1380.44 movaps %xmm5, %xmm6 #1382.8 orps %xmm7, %xmm6 #1382.8 movaps %xmm4, %xmm8 #1385.20 @@ -821,16 +821,16 @@ __svml_acosf4_ha_e9: rsqrtps %xmm4, %xmm10 #1391.494 movaps %xmm4, %xmm15 #1391.620 movaps %xmm0, %xmm3 #1390.14 - cmpltps 192+__svml_sacos_ha_data_internal(%rip), %xmm15 #1391.620 + cmpltps 192+__jsvml_sacos_ha_data_internal(%rip), %xmm15 #1391.620 cmpnltps %xmm4, %xmm3 #1390.14 addps %xmm4, %xmm4 #1391.713 - movups 320+__svml_sacos_ha_data_internal(%rip), %xmm11 #1391.786 + movups 320+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #1391.786 andnps %xmm10, %xmm15 #1391.663 movaps %xmm11, %xmm2 #1391.1058 movaps %xmm15, %xmm13 #1391.1350 andps %xmm4, %xmm2 #1391.1058 andps %xmm7, %xmm5 #1383.12 - movups 512+__svml_sacos_ha_data_internal(%rip), %xmm1 #1391.1805 + movups 512+__jsvml_sacos_ha_data_internal(%rip), %xmm1 #1391.1805 subps %xmm2, %xmm4 #1391.1104 mulps %xmm15, %xmm2 #1391.1142 mulps %xmm15, %xmm4 #1391.1180 @@ -840,37 +840,37 @@ __svml_acosf4_ha_e9: subps %xmm11, %xmm12 #1391.1267 mulps %xmm15, %xmm11 #1391.1308 mulps %xmm12, %xmm15 #1391.1390 - subps 448+__svml_sacos_ha_data_internal(%rip), %xmm11 #1391.1433 + subps 448+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #1391.1433 movaps %xmm2, %xmm14 #1391.1566 andps %xmm3, %xmm2 #1392.13 - movups 640+__svml_sacos_ha_data_internal(%rip), %xmm8 #1398.27 + movups 640+__jsvml_sacos_ha_data_internal(%rip), %xmm8 #1398.27 movaps %xmm3, %xmm12 #1413.15 mulps %xmm0, %xmm8 #1398.27 addps %xmm11, %xmm13 #1391.1478 addps %xmm4, %xmm14 #1391.1566 addps %xmm13, %xmm15 #1391.1523 - addps 704+__svml_sacos_ha_data_internal(%rip), %xmm8 #1398.15 + addps 704+__jsvml_sacos_ha_data_internal(%rip), %xmm8 #1398.15 mulps %xmm15, %xmm1 #1391.1805 mulps %xmm14, %xmm15 #1391.1863 - addps 576+__svml_sacos_ha_data_internal(%rip), %xmm1 #1391.1793 + addps 576+__jsvml_sacos_ha_data_internal(%rip), %xmm1 #1391.1793 mulps %xmm15, %xmm1 #1391.1916 - movups 768+__svml_sacos_ha_data_internal(%rip), %xmm11 #1399.26 + movups 768+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #1399.26 subps %xmm4, %xmm1 #1391.1904 mulps %xmm0, %xmm11 #1399.26 movaps %xmm0, %xmm4 #1400.13 andps %xmm3, %xmm1 #1393.13 mulps %xmm0, %xmm4 #1400.13 - addps 832+__svml_sacos_ha_data_internal(%rip), %xmm11 #1399.14 + addps 832+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #1399.14 mulps %xmm4, %xmm8 #1402.27 - movups 256+__svml_sacos_ha_data_internal(%rip), %xmm9 #1381.41 + movups 256+__jsvml_sacos_ha_data_internal(%rip), %xmm9 #1381.41 addps %xmm8, %xmm11 #1402.15 cmpnleps %xmm6, %xmm9 #1384.13 mulps %xmm0, %xmm11 #1403.27 movmskps %xmm9, %edx #1389.40 - movups 1152+__svml_sacos_ha_data_internal(%rip), %xmm9 #1409.14 - movups 1088+__svml_sacos_ha_data_internal(%rip), %xmm10 #1410.14 - andnps 1024+__svml_sacos_ha_data_internal(%rip), %xmm12 #1413.15 - addps 896+__svml_sacos_ha_data_internal(%rip), %xmm11 #1403.15 + movups 1152+__jsvml_sacos_ha_data_internal(%rip), %xmm9 #1409.14 + movups 1088+__jsvml_sacos_ha_data_internal(%rip), %xmm10 #1410.14 + andnps 1024+__jsvml_sacos_ha_data_internal(%rip), %xmm12 #1413.15 + addps 896+__jsvml_sacos_ha_data_internal(%rip), %xmm11 #1403.15 mulps %xmm0, %xmm11 #1404.15 cmpnltps %xmm7, %xmm0 #1405.17 andps %xmm3, %xmm0 #1408.17 @@ -882,7 +882,7 @@ __svml_acosf4_ha_e9: orps %xmm9, %xmm12 #1416.15 movaps %xmm2, %xmm3 #1420.13 pxor %xmm5, %xmm12 #1418.15 - andnps 960+__svml_sacos_ha_data_internal(%rip), %xmm0 #1414.15 + andnps 960+__jsvml_sacos_ha_data_internal(%rip), %xmm0 #1414.15 subps %xmm1, %xmm3 #1420.13 subps %xmm1, %xmm12 #1421.14 mulps %xmm3, %xmm11 #1422.26 @@ -945,30 +945,30 @@ __svml_acosf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1427.540 lea 128(%rsp,%r12,4), %rsi #1427.540 -..___tag_value___svml_acosf4_ha_e9.106: -# __svml_sacos_ha_cout_rare_internal(const float *, float *) - call __svml_sacos_ha_cout_rare_internal #1427.540 -..___tag_value___svml_acosf4_ha_e9.107: +..___tag_value___jsvml_acosf4_ha_e9.106: +# __jsvml_sacos_ha_cout_rare_internal(const float *, float *) + call __jsvml_sacos_ha_cout_rare_internal #1427.540 +..___tag_value___jsvml_acosf4_ha_e9.107: jmp ..B6.8 # Prob 100% #1427.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_acosf4_ha_e9,@function - .size __svml_acosf4_ha_e9,.-__svml_acosf4_ha_e9 -..LN__svml_acosf4_ha_e9.5: + .type __jsvml_acosf4_ha_e9,@function + .size __jsvml_acosf4_ha_e9,.-__jsvml_acosf4_ha_e9 +..LN__jsvml_acosf4_ha_e9.5: .data -# -- End __svml_acosf4_ha_e9 +# -- End __jsvml_acosf4_ha_e9 .text -.L_2__routine_start___svml_sacos_ha_cout_rare_internal_6: -# -- Begin __svml_sacos_ha_cout_rare_internal +.L_2__routine_start___jsvml_sacos_ha_cout_rare_internal_6: +# -- Begin __jsvml_sacos_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_sacos_ha_cout_rare_internal - .globl __svml_sacos_ha_cout_rare_internal -# --- __svml_sacos_ha_cout_rare_internal(const float *, float *) -__svml_sacos_ha_cout_rare_internal: + .hidden __jsvml_sacos_ha_cout_rare_internal + .globl __jsvml_sacos_ha_cout_rare_internal +# --- __jsvml_sacos_ha_cout_rare_internal(const float *, float *) +__jsvml_sacos_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -978,7 +978,7 @@ __svml_sacos_ha_cout_rare_internal: .byte 30 #1336.17 .byte 250 #1336.17 .cfi_startproc -..___tag_value___svml_sacos_ha_cout_rare_internal.109: +..___tag_value___jsvml_sacos_ha_cout_rare_internal.109: ..L110: #1159.1 xorl %eax, %eax #1172.14 @@ -1536,17 +1536,17 @@ __svml_sacos_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_sacos_ha_cout_rare_internal,@function - .size __svml_sacos_ha_cout_rare_internal,.-__svml_sacos_ha_cout_rare_internal -..LN__svml_sacos_ha_cout_rare_internal.6: + .type __jsvml_sacos_ha_cout_rare_internal,@function + .size __jsvml_sacos_ha_cout_rare_internal,.-__jsvml_sacos_ha_cout_rare_internal +..LN__jsvml_sacos_ha_cout_rare_internal.6: .data -# -- End __svml_sacos_ha_cout_rare_internal +# -- End __jsvml_sacos_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_sacos_ha_data_internal - .globl __svml_sacos_ha_data_internal -__svml_sacos_ha_data_internal: + .hidden __jsvml_sacos_ha_data_internal + .globl __jsvml_sacos_ha_data_internal +__jsvml_sacos_ha_data_internal: .long 2147483648 .long 2147483648 .long 2147483648 @@ -1947,8 +1947,8 @@ __svml_sacos_ha_data_internal: .long 939876771 .long 939876771 .long 939876771 - .type __svml_sacos_ha_data_internal,@object - .size __svml_sacos_ha_data_internal,1600 + .type __jsvml_sacos_ha_data_internal,@object + .size __jsvml_sacos_ha_data_internal,1600 .align 32 _vmldACosHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_asin_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_asin_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_asin_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_asin_linux_x86.S index c60b16fa3c0..68ff319953b 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_asin_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_asin_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_asin.c" .text ..TXTST0: -.L_2__routine_start___svml_asinf8_ha_l9_0: -# -- Begin __svml_asinf8_ha_l9 +.L_2__routine_start___jsvml_asinf8_ha_l9_0: +# -- Begin __jsvml_asinf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_asinf8_ha_l9 -# --- __svml_asinf8_ha_l9(__m256) -__svml_asinf8_ha_l9: + .globl __jsvml_asinf8_ha_l9 +# --- __jsvml_asinf8_ha_l9(__m256) +__jsvml_asinf8_ha_l9: # parameter 1: %ymm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_asinf8_ha_l9: .byte 30 #208.546 .byte 250 #208.546 .cfi_startproc -..___tag_value___svml_asinf8_ha_l9.1: +..___tag_value___jsvml_asinf8_ha_l9.1: ..L2: #135.1 pushq %rbp #135.1 @@ -57,9 +57,9 @@ __svml_asinf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #135.1 subq $192, %rsp #135.1 - vmovups __svml_sasin_ha_data_internal(%rip), %ymm8 #166.47 - vmovups 64+__svml_sasin_ha_data_internal(%rip), %ymm12 #167.47 - vmovups 256+__svml_sasin_ha_data_internal(%rip), %ymm9 #168.43 + vmovups __jsvml_sasin_ha_data_internal(%rip), %ymm8 #166.47 + vmovups 64+__jsvml_sasin_ha_data_internal(%rip), %ymm12 #167.47 + vmovups 256+__jsvml_sasin_ha_data_internal(%rip), %ymm9 #168.43 vmovaps %ymm0, %ymm7 #135.1 vandps %ymm7, %ymm8, %ymm6 #169.8 vmovaps %ymm12, %ymm15 #172.8 @@ -67,39 +67,39 @@ __svml_asinf8_ha_l9: vmulps %ymm6, %ymm6, %ymm10 #173.9 vcmplt_oqps %ymm6, %ymm9, %ymm11 #171.13 vaddps %ymm15, %ymm15, %ymm0 #178.735 - vcmplt_oqps 192+__svml_sasin_ha_data_internal(%rip), %ymm15, %ymm13 #178.626 + vcmplt_oqps 192+__jsvml_sasin_ha_data_internal(%rip), %ymm15, %ymm13 #178.626 vminps %ymm15, %ymm10, %ymm4 #174.9 vcmpnlt_uqps %ymm12, %ymm6, %ymm3 #177.14 vrsqrtps %ymm15, %ymm14 #178.494 - vmovups 448+__svml_sasin_ha_data_internal(%rip), %ymm9 #178.902 + vmovups 448+__jsvml_sasin_ha_data_internal(%rip), %ymm9 #178.902 vmulps %ymm4, %ymm4, %ymm15 #185.13 - vandps 320+__svml_sasin_ha_data_internal(%rip), %ymm0, %ymm2 #178.997 + vandps 320+__jsvml_sasin_ha_data_internal(%rip), %ymm0, %ymm2 #178.997 vsubps %ymm2, %ymm0, %ymm1 #178.1046 - vmovups 768+__svml_sasin_ha_data_internal(%rip), %ymm0 #181.57 + vmovups 768+__jsvml_sasin_ha_data_internal(%rip), %ymm0 #181.57 vandnps %ymm7, %ymm8, %ymm5 #170.12 vandnps %ymm14, %ymm13, %ymm8 #178.682 vmulps %ymm2, %ymm8, %ymm2 #178.1087 vmulps %ymm1, %ymm8, %ymm14 #178.1128 - vfmadd213ps 832+__svml_sasin_ha_data_internal(%rip), %ymm4, %ymm0 #184.14 - vmovups 512+__svml_sasin_ha_data_internal(%rip), %ymm1 #178.1553 + vfmadd213ps 832+__jsvml_sasin_ha_data_internal(%rip), %ymm4, %ymm0 #184.14 + vmovups 512+__jsvml_sasin_ha_data_internal(%rip), %ymm1 #178.1553 vfmsub231ps %ymm2, %ymm8, %ymm9 #178.1172 vmulps %ymm14, %ymm8, %ymm10 #178.1227 - vmovups 640+__svml_sasin_ha_data_internal(%rip), %ymm8 #179.57 + vmovups 640+__jsvml_sasin_ha_data_internal(%rip), %ymm8 #179.57 vaddps %ymm10, %ymm9, %ymm12 #178.1312 - vfmadd213ps 704+__svml_sasin_ha_data_internal(%rip), %ymm4, %ymm8 #183.15 - vfmadd213ps 576+__svml_sasin_ha_data_internal(%rip), %ymm12, %ymm1 #178.1553 + vfmadd213ps 704+__jsvml_sasin_ha_data_internal(%rip), %ymm4, %ymm8 #183.15 + vfmadd213ps 576+__jsvml_sasin_ha_data_internal(%rip), %ymm12, %ymm1 #178.1553 vfmadd213ps %ymm0, %ymm15, %ymm8 #187.15 - vfmadd213ps 896+__svml_sasin_ha_data_internal(%rip), %ymm4, %ymm8 #188.15 + vfmadd213ps 896+__jsvml_sasin_ha_data_internal(%rip), %ymm4, %ymm8 #188.15 vmovmskps %ymm11, %edx #176.41 vaddps %ymm14, %ymm2, %ymm11 #178.1269 vmulps %ymm8, %ymm4, %ymm0 #189.15 - vmovups 960+__svml_sasin_ha_data_internal(%rip), %ymm4 #190.48 + vmovups 960+__jsvml_sasin_ha_data_internal(%rip), %ymm4 #190.48 vmulps %ymm12, %ymm11, %ymm13 #178.1614 vsubps %ymm2, %ymm4, %ymm10 #192.15 vfmsub213ps %ymm14, %ymm13, %ymm1 #178.1658 vsubps %ymm10, %ymm4, %ymm4 #194.14 vsubps %ymm2, %ymm1, %ymm8 #193.13 - vaddps 1024+__svml_sasin_ha_data_internal(%rip), %ymm1, %ymm1 #195.14 + vaddps 1024+__jsvml_sasin_ha_data_internal(%rip), %ymm1, %ymm1 #195.14 vsubps %ymm4, %ymm2, %ymm2 #196.14 vsubps %ymm2, %ymm1, %ymm9 #197.14 vandps %ymm3, %ymm8, %ymm11 #198.13 @@ -170,29 +170,29 @@ __svml_asinf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #208.546 lea 128(%rsp,%r12,4), %rsi #208.546 -..___tag_value___svml_asinf8_ha_l9.19: -# __svml_sasin_ha_cout_rare_internal(const float *, float *) - call __svml_sasin_ha_cout_rare_internal #208.546 -..___tag_value___svml_asinf8_ha_l9.20: +..___tag_value___jsvml_asinf8_ha_l9.19: +# __jsvml_sasin_ha_cout_rare_internal(const float *, float *) + call __jsvml_sasin_ha_cout_rare_internal #208.546 +..___tag_value___jsvml_asinf8_ha_l9.20: jmp ..B1.8 # Prob 100% #208.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asinf8_ha_l9,@function - .size __svml_asinf8_ha_l9,.-__svml_asinf8_ha_l9 -..LN__svml_asinf8_ha_l9.0: + .type __jsvml_asinf8_ha_l9,@function + .size __jsvml_asinf8_ha_l9,.-__jsvml_asinf8_ha_l9 +..LN__jsvml_asinf8_ha_l9.0: .data -# -- End __svml_asinf8_ha_l9 +# -- End __jsvml_asinf8_ha_l9 .text -.L_2__routine_start___svml_asinf16_ha_z0_1: -# -- Begin __svml_asinf16_ha_z0 +.L_2__routine_start___jsvml_asinf16_ha_z0_1: +# -- Begin __jsvml_asinf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_asinf16_ha_z0 -# --- __svml_asinf16_ha_z0(__m512) -__svml_asinf16_ha_z0: + .globl __jsvml_asinf16_ha_z0 +# --- __jsvml_asinf16_ha_z0(__m512) +__jsvml_asinf16_ha_z0: # parameter 1: %zmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -201,17 +201,17 @@ __svml_asinf16_ha_z0: .byte 30 #1019.12 .byte 250 #1019.12 .cfi_startproc -..___tag_value___svml_asinf16_ha_z0.22: +..___tag_value___jsvml_asinf16_ha_z0.22: ..L23: #945.1 - vmovups __svml_sasin_ha_data_internal(%rip), %zmm5 #977.46 - vmovups 64+__svml_sasin_ha_data_internal(%rip), %zmm7 #978.46 - vmovups 192+__svml_sasin_ha_data_internal(%rip), %zmm10 #990.786 - vmovups 256+__svml_sasin_ha_data_internal(%rip), %zmm8 #979.42 + vmovups __jsvml_sasin_ha_data_internal(%rip), %zmm5 #977.46 + vmovups 64+__jsvml_sasin_ha_data_internal(%rip), %zmm7 #978.46 + vmovups 192+__jsvml_sasin_ha_data_internal(%rip), %zmm10 #990.786 + vmovups 256+__jsvml_sasin_ha_data_internal(%rip), %zmm8 #979.42 vandps %zmm0, %zmm5, %zmm4 #980.8 vandnps %zmm0, %zmm5, %zmm3 #981.12 - vmovups 448+__svml_sasin_ha_data_internal(%rip), %zmm0 #990.1229 - vmovups 512+__svml_sasin_ha_data_internal(%rip), %zmm5 #990.2147 + vmovups 448+__jsvml_sasin_ha_data_internal(%rip), %zmm0 #990.1229 + vmovups 512+__jsvml_sasin_ha_data_internal(%rip), %zmm5 #990.2147 vmulps {rn-sae}, %zmm4, %zmm4, %zmm6 #984.11 vcmpps $17, {sae}, %zmm4, %zmm8, %k1 #982.13 vcmpps $21, {sae}, %zmm7, %zmm4, %k3 #986.14 @@ -220,37 +220,37 @@ __svml_asinf16_ha_z0: vrsqrt14ps %zmm11, %zmm9 #990.580 vcmpps $17, {sae}, %zmm10, %zmm11, %k2 #990.847 vminps {sae}, %zmm11, %zmm6, %zmm2 #985.11 - vmovups 640+__svml_sasin_ha_data_internal(%rip), %zmm10 #991.56 + vmovups 640+__jsvml_sasin_ha_data_internal(%rip), %zmm10 #991.56 vaddps {rn-sae}, %zmm11, %zmm11, %zmm12 #990.1005 - vandps 384+__svml_sasin_ha_data_internal(%rip), %zmm9, %zmm15 #990.703 - vorps 1216+__svml_sasin_ha_data_internal(%rip), %zmm2, %zmm2{%k1} #989.11 - vandps 320+__svml_sasin_ha_data_internal(%rip), %zmm12, %zmm13 #990.1327 + vandps 384+__jsvml_sasin_ha_data_internal(%rip), %zmm9, %zmm15 #990.703 + vorps 1216+__jsvml_sasin_ha_data_internal(%rip), %zmm2, %zmm2{%k1} #989.11 + vandps 320+__jsvml_sasin_ha_data_internal(%rip), %zmm12, %zmm13 #990.1327 vxorps %zmm15, %zmm15, %zmm15{%k2} #990.933 - vmovups 768+__svml_sasin_ha_data_internal(%rip), %zmm11 #993.56 + vmovups 768+__jsvml_sasin_ha_data_internal(%rip), %zmm11 #993.56 vmulps {rn-sae}, %zmm15, %zmm13, %zmm1 #990.1480 vsubps {rn-sae}, %zmm13, %zmm12, %zmm14 #990.1378 vmulps {rn-sae}, %zmm2, %zmm2, %zmm12 #997.15 vmulps {rn-sae}, %zmm15, %zmm14, %zmm9 #990.1582 vfmsub231ps {rn-sae}, %zmm1, %zmm15, %zmm0 #990.1685 - vmovups 832+__svml_sasin_ha_data_internal(%rip), %zmm13 #996.14 - vmovups 896+__svml_sasin_ha_data_internal(%rip), %zmm14 #998.56 + vmovups 832+__jsvml_sasin_ha_data_internal(%rip), %zmm13 #996.14 + vmovups 896+__jsvml_sasin_ha_data_internal(%rip), %zmm14 #998.56 vmulps {rn-sae}, %zmm15, %zmm9, %zmm15 #990.1797 vfmadd231ps {rn-sae}, %zmm2, %zmm11, %zmm13 #996.14 vaddps {rn-sae}, %zmm9, %zmm1, %zmm6 #990.1900 vaddps {rn-sae}, %zmm15, %zmm0, %zmm7 #990.2004 - vmovups 576+__svml_sasin_ha_data_internal(%rip), %zmm0 #990.2302 + vmovups 576+__jsvml_sasin_ha_data_internal(%rip), %zmm0 #990.2302 vmulps {rn-sae}, %zmm7, %zmm6, %zmm8 #990.2420 vfmadd231ps {rn-sae}, %zmm7, %zmm5, %zmm0 #990.2302 - vmovups 704+__svml_sasin_ha_data_internal(%rip), %zmm5 #992.56 - vmovups 1088+__svml_sasin_ha_data_internal(%rip), %zmm6 #1004.46 + vmovups 704+__jsvml_sasin_ha_data_internal(%rip), %zmm5 #992.56 + vmovups 1088+__jsvml_sasin_ha_data_internal(%rip), %zmm6 #1004.46 vfmsub213ps {rn-sae}, %zmm9, %zmm8, %zmm0 #990.2523 vfmadd231ps {rn-sae}, %zmm2, %zmm10, %zmm5 #995.15 vsubps {rn-sae}, %zmm1, %zmm0, %zmm4{%k3} #1006.14 vfmadd213ps {rn-sae}, %zmm13, %zmm12, %zmm5 #999.15 vfmadd213ps {rn-sae}, %zmm14, %zmm2, %zmm5 #1000.15 vmulps {rn-sae}, %zmm2, %zmm5, %zmm8 #1001.17 - vmovups 960+__svml_sasin_ha_data_internal(%rip), %zmm2 #1002.47 - vmovups 1024+__svml_sasin_ha_data_internal(%rip), %zmm5 #1003.47 + vmovups 960+__jsvml_sasin_ha_data_internal(%rip), %zmm2 #1002.47 + vmovups 1024+__jsvml_sasin_ha_data_internal(%rip), %zmm5 #1003.47 vsubps {rn-sae}, %zmm1, %zmm2, %zmm7 #1005.17 vaddps {rn-sae}, %zmm0, %zmm5, %zmm0 #1008.17 vsubps {rn-sae}, %zmm7, %zmm2, %zmm2 #1007.16 @@ -265,20 +265,20 @@ __svml_asinf16_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_asinf16_ha_z0,@function - .size __svml_asinf16_ha_z0,.-__svml_asinf16_ha_z0 -..LN__svml_asinf16_ha_z0.1: + .type __jsvml_asinf16_ha_z0,@function + .size __jsvml_asinf16_ha_z0,.-__jsvml_asinf16_ha_z0 +..LN__jsvml_asinf16_ha_z0.1: .data -# -- End __svml_asinf16_ha_z0 +# -- End __jsvml_asinf16_ha_z0 .text -.L_2__routine_start___svml_asinf8_ha_e9_2: -# -- Begin __svml_asinf8_ha_e9 +.L_2__routine_start___jsvml_asinf8_ha_e9_2: +# -- Begin __jsvml_asinf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_asinf8_ha_e9 -# --- __svml_asinf8_ha_e9(__m256) -__svml_asinf8_ha_e9: + .globl __jsvml_asinf8_ha_e9 +# --- __jsvml_asinf8_ha_e9(__m256) +__jsvml_asinf8_ha_e9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -287,7 +287,7 @@ __svml_asinf8_ha_e9: .byte 30 #1097.546 .byte 250 #1097.546 .cfi_startproc -..___tag_value___svml_asinf8_ha_e9.25: +..___tag_value___jsvml_asinf8_ha_e9.25: ..L26: #1024.1 pushq %rbp #1024.1 @@ -297,10 +297,10 @@ __svml_asinf8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1024.1 subq $192, %rsp #1024.1 - vmovups __svml_sasin_ha_data_internal(%rip), %ymm11 #1055.47 + vmovups __jsvml_sasin_ha_data_internal(%rip), %ymm11 #1055.47 vpxor %xmm3, %xmm3, %xmm3 #1065.58 - vmovups 64+__svml_sasin_ha_data_internal(%rip), %ymm2 #1056.47 - vmovups 256+__svml_sasin_ha_data_internal(%rip), %ymm12 #1057.43 + vmovups 64+__jsvml_sasin_ha_data_internal(%rip), %ymm2 #1056.47 + vmovups 256+__jsvml_sasin_ha_data_internal(%rip), %ymm12 #1057.43 vmovaps %ymm0, %ymm10 #1024.1 vandps %ymm10, %ymm11, %ymm9 #1058.8 vmulps %ymm2, %ymm9, %ymm13 #1061.35 @@ -310,9 +310,9 @@ __svml_asinf8_ha_e9: vandnps %ymm10, %ymm11, %ymm8 #1059.12 vrsqrtps %ymm6, %ymm11 #1067.494 vminps %ymm6, %ymm14, %ymm7 #1063.9 - vcmplt_oqps 192+__svml_sasin_ha_data_internal(%rip), %ymm6, %ymm4 #1067.626 + vcmplt_oqps 192+__jsvml_sasin_ha_data_internal(%rip), %ymm6, %ymm4 #1067.626 vaddps %ymm6, %ymm6, %ymm6 #1067.735 - vmovups 320+__svml_sasin_ha_data_internal(%rip), %ymm14 #1067.814 + vmovups 320+__jsvml_sasin_ha_data_internal(%rip), %ymm14 #1067.814 vandnps %ymm11, %ymm4, %ymm4 #1067.682 vandps %ymm14, %ymm6, %ymm12 #1067.1089 vsubps %ymm12, %ymm6, %ymm13 #1067.1138 @@ -329,27 +329,27 @@ __svml_asinf8_ha_e9: vsubps %ymm0, %ymm3, %ymm1 #1067.1313 vaddps %ymm2, %ymm3, %ymm0 #1067.1633 vmulps %ymm1, %ymm4, %ymm12 #1067.1445 - vsubps 448+__svml_sasin_ha_data_internal(%rip), %ymm6, %ymm4 #1067.1491 + vsubps 448+__jsvml_sasin_ha_data_internal(%rip), %ymm6, %ymm4 #1067.1491 vaddps %ymm4, %ymm11, %ymm13 #1067.1539 vaddps %ymm13, %ymm12, %ymm15 #1067.1587 - vmulps 512+__svml_sasin_ha_data_internal(%rip), %ymm15, %ymm14 #1067.1884 + vmulps 512+__jsvml_sasin_ha_data_internal(%rip), %ymm15, %ymm14 #1067.1884 vmulps %ymm0, %ymm15, %ymm4 #1067.1945 - vmulps 768+__svml_sasin_ha_data_internal(%rip), %ymm7, %ymm0 #1073.29 - vaddps 576+__svml_sasin_ha_data_internal(%rip), %ymm14, %ymm1 #1067.1869 + vmulps 768+__jsvml_sasin_ha_data_internal(%rip), %ymm7, %ymm0 #1073.29 + vaddps 576+__jsvml_sasin_ha_data_internal(%rip), %ymm14, %ymm1 #1067.1869 vmulps %ymm4, %ymm1, %ymm6 #1067.2004 vmulps %ymm7, %ymm7, %ymm4 #1074.13 vsubps %ymm2, %ymm6, %ymm1 #1067.1989 - vaddps 832+__svml_sasin_ha_data_internal(%rip), %ymm0, %ymm6 #1073.14 - vmulps 640+__svml_sasin_ha_data_internal(%rip), %ymm7, %ymm2 #1072.30 - vaddps 704+__svml_sasin_ha_data_internal(%rip), %ymm2, %ymm2 #1072.15 + vaddps 832+__jsvml_sasin_ha_data_internal(%rip), %ymm0, %ymm6 #1073.14 + vmulps 640+__jsvml_sasin_ha_data_internal(%rip), %ymm7, %ymm2 #1072.30 + vaddps 704+__jsvml_sasin_ha_data_internal(%rip), %ymm2, %ymm2 #1072.15 vmulps %ymm4, %ymm2, %ymm11 #1076.30 vsubps %ymm3, %ymm1, %ymm2 #1082.13 - vaddps 1024+__svml_sasin_ha_data_internal(%rip), %ymm1, %ymm1 #1084.14 + vaddps 1024+__jsvml_sasin_ha_data_internal(%rip), %ymm1, %ymm1 #1084.14 vaddps %ymm11, %ymm6, %ymm12 #1076.15 vmulps %ymm12, %ymm7, %ymm13 #1077.30 - vaddps 896+__svml_sasin_ha_data_internal(%rip), %ymm13, %ymm14 #1077.15 + vaddps 896+__jsvml_sasin_ha_data_internal(%rip), %ymm13, %ymm14 #1077.15 vmulps %ymm14, %ymm7, %ymm0 #1078.15 - vmovups 960+__svml_sasin_ha_data_internal(%rip), %ymm7 #1079.48 + vmovups 960+__jsvml_sasin_ha_data_internal(%rip), %ymm7 #1079.48 vsubps %ymm3, %ymm7, %ymm6 #1081.15 vsubps %ymm6, %ymm7, %ymm7 #1083.14 vsubps %ymm7, %ymm3, %ymm3 #1085.14 @@ -424,29 +424,29 @@ __svml_asinf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1097.546 lea 128(%rsp,%r12,4), %rsi #1097.546 -..___tag_value___svml_asinf8_ha_e9.43: -# __svml_sasin_ha_cout_rare_internal(const float *, float *) - call __svml_sasin_ha_cout_rare_internal #1097.546 -..___tag_value___svml_asinf8_ha_e9.44: +..___tag_value___jsvml_asinf8_ha_e9.43: +# __jsvml_sasin_ha_cout_rare_internal(const float *, float *) + call __jsvml_sasin_ha_cout_rare_internal #1097.546 +..___tag_value___jsvml_asinf8_ha_e9.44: jmp ..B3.8 # Prob 100% #1097.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asinf8_ha_e9,@function - .size __svml_asinf8_ha_e9,.-__svml_asinf8_ha_e9 -..LN__svml_asinf8_ha_e9.2: + .type __jsvml_asinf8_ha_e9,@function + .size __jsvml_asinf8_ha_e9,.-__jsvml_asinf8_ha_e9 +..LN__jsvml_asinf8_ha_e9.2: .data -# -- End __svml_asinf8_ha_e9 +# -- End __jsvml_asinf8_ha_e9 .text -.L_2__routine_start___svml_asinf4_ha_l9_3: -# -- Begin __svml_asinf4_ha_l9 +.L_2__routine_start___jsvml_asinf4_ha_l9_3: +# -- Begin __jsvml_asinf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_asinf4_ha_l9 -# --- __svml_asinf4_ha_l9(__m128) -__svml_asinf4_ha_l9: + .globl __jsvml_asinf4_ha_l9 +# --- __jsvml_asinf4_ha_l9(__m128) +__jsvml_asinf4_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -455,7 +455,7 @@ __svml_asinf4_ha_l9: .byte 30 #1178.540 .byte 250 #1178.540 .cfi_startproc -..___tag_value___svml_asinf4_ha_l9.46: +..___tag_value___jsvml_asinf4_ha_l9.46: ..L47: #1105.1 pushq %rbp #1105.1 @@ -466,8 +466,8 @@ __svml_asinf4_ha_l9: andq $-64, %rsp #1105.1 subq $192, %rsp #1105.1 vmovaps %xmm0, %xmm7 #1105.1 - vmovups __svml_sasin_ha_data_internal(%rip), %xmm8 #1136.44 - vmovups 64+__svml_sasin_ha_data_internal(%rip), %xmm12 #1137.44 + vmovups __jsvml_sasin_ha_data_internal(%rip), %xmm8 #1136.44 + vmovups 64+__jsvml_sasin_ha_data_internal(%rip), %xmm12 #1137.44 vandps %xmm7, %xmm8, %xmm6 #1139.8 vmovaps %xmm12, %xmm15 #1142.8 vandnps %xmm7, %xmm8, %xmm5 #1140.12 @@ -475,37 +475,37 @@ __svml_asinf4_ha_l9: vmulps %xmm6, %xmm6, %xmm10 #1143.9 vcmpnltps %xmm12, %xmm6, %xmm3 #1147.14 vrsqrtps %xmm15, %xmm14 #1148.494 - vcmpltps 192+__svml_sasin_ha_data_internal(%rip), %xmm15, %xmm13 #1148.620 + vcmpltps 192+__jsvml_sasin_ha_data_internal(%rip), %xmm15, %xmm13 #1148.620 vminps %xmm15, %xmm10, %xmm4 #1144.9 vaddps %xmm15, %xmm15, %xmm0 #1148.713 vmulps %xmm4, %xmm4, %xmm15 #1155.13 - vandps 320+__svml_sasin_ha_data_internal(%rip), %xmm0, %xmm2 #1148.966 + vandps 320+__jsvml_sasin_ha_data_internal(%rip), %xmm0, %xmm2 #1148.966 vandnps %xmm14, %xmm13, %xmm8 #1148.663 - vmovups 256+__svml_sasin_ha_data_internal(%rip), %xmm9 #1138.40 + vmovups 256+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1138.40 vsubps %xmm2, %xmm0, %xmm1 #1148.1012 vmulps %xmm2, %xmm8, %xmm2 #1148.1050 vcmpltps %xmm6, %xmm9, %xmm11 #1141.13 vmulps %xmm1, %xmm8, %xmm14 #1148.1088 vmovmskps %xmm11, %edx #1146.40 - vmovups 448+__svml_sasin_ha_data_internal(%rip), %xmm9 #1148.871 + vmovups 448+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1148.871 vaddps %xmm14, %xmm2, %xmm11 #1148.1220 vfmsub231ps %xmm2, %xmm8, %xmm9 #1148.1129 vmulps %xmm14, %xmm8, %xmm10 #1148.1181 - vmovups 640+__svml_sasin_ha_data_internal(%rip), %xmm8 #1149.54 + vmovups 640+__jsvml_sasin_ha_data_internal(%rip), %xmm8 #1149.54 vaddps %xmm10, %xmm9, %xmm12 #1148.1260 - vfmadd213ps 704+__svml_sasin_ha_data_internal(%rip), %xmm4, %xmm8 #1153.15 - vmovups 768+__svml_sasin_ha_data_internal(%rip), %xmm0 #1151.54 - vfmadd213ps 832+__svml_sasin_ha_data_internal(%rip), %xmm4, %xmm0 #1154.14 - vmovups 512+__svml_sasin_ha_data_internal(%rip), %xmm1 #1148.1492 - vfmadd213ps 576+__svml_sasin_ha_data_internal(%rip), %xmm12, %xmm1 #1148.1492 + vfmadd213ps 704+__jsvml_sasin_ha_data_internal(%rip), %xmm4, %xmm8 #1153.15 + vmovups 768+__jsvml_sasin_ha_data_internal(%rip), %xmm0 #1151.54 + vfmadd213ps 832+__jsvml_sasin_ha_data_internal(%rip), %xmm4, %xmm0 #1154.14 + vmovups 512+__jsvml_sasin_ha_data_internal(%rip), %xmm1 #1148.1492 + vfmadd213ps 576+__jsvml_sasin_ha_data_internal(%rip), %xmm12, %xmm1 #1148.1492 vmulps %xmm12, %xmm11, %xmm13 #1148.1550 vfmadd213ps %xmm0, %xmm15, %xmm8 #1157.15 vfmsub213ps %xmm14, %xmm13, %xmm1 #1148.1591 - vfmadd213ps 896+__svml_sasin_ha_data_internal(%rip), %xmm4, %xmm8 #1158.15 + vfmadd213ps 896+__jsvml_sasin_ha_data_internal(%rip), %xmm4, %xmm8 #1158.15 vmulps %xmm8, %xmm4, %xmm0 #1159.15 vsubps %xmm2, %xmm1, %xmm8 #1163.13 - vaddps 1024+__svml_sasin_ha_data_internal(%rip), %xmm1, %xmm1 #1165.14 - vmovups 960+__svml_sasin_ha_data_internal(%rip), %xmm4 #1160.45 + vaddps 1024+__jsvml_sasin_ha_data_internal(%rip), %xmm1, %xmm1 #1165.14 + vmovups 960+__jsvml_sasin_ha_data_internal(%rip), %xmm4 #1160.45 vandps %xmm3, %xmm8, %xmm11 #1168.13 vsubps %xmm2, %xmm4, %xmm10 #1162.15 vandps %xmm3, %xmm10, %xmm12 #1170.15 @@ -574,29 +574,29 @@ __svml_asinf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1178.540 lea 128(%rsp,%r12,4), %rsi #1178.540 -..___tag_value___svml_asinf4_ha_l9.64: -# __svml_sasin_ha_cout_rare_internal(const float *, float *) - call __svml_sasin_ha_cout_rare_internal #1178.540 -..___tag_value___svml_asinf4_ha_l9.65: +..___tag_value___jsvml_asinf4_ha_l9.64: +# __jsvml_sasin_ha_cout_rare_internal(const float *, float *) + call __jsvml_sasin_ha_cout_rare_internal #1178.540 +..___tag_value___jsvml_asinf4_ha_l9.65: jmp ..B4.8 # Prob 100% #1178.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asinf4_ha_l9,@function - .size __svml_asinf4_ha_l9,.-__svml_asinf4_ha_l9 -..LN__svml_asinf4_ha_l9.3: + .type __jsvml_asinf4_ha_l9,@function + .size __jsvml_asinf4_ha_l9,.-__jsvml_asinf4_ha_l9 +..LN__jsvml_asinf4_ha_l9.3: .data -# -- End __svml_asinf4_ha_l9 +# -- End __jsvml_asinf4_ha_l9 .text -.L_2__routine_start___svml_asinf4_ha_e9_4: -# -- Begin __svml_asinf4_ha_e9 +.L_2__routine_start___jsvml_asinf4_ha_e9_4: +# -- Begin __jsvml_asinf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_asinf4_ha_e9 -# --- __svml_asinf4_ha_e9(__m128) -__svml_asinf4_ha_e9: + .globl __jsvml_asinf4_ha_e9 +# --- __jsvml_asinf4_ha_e9(__m128) +__jsvml_asinf4_ha_e9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -605,7 +605,7 @@ __svml_asinf4_ha_e9: .byte 30 #1259.540 .byte 250 #1259.540 .cfi_startproc -..___tag_value___svml_asinf4_ha_e9.67: +..___tag_value___jsvml_asinf4_ha_e9.67: ..L68: #1186.1 pushq %rbp #1186.1 @@ -616,8 +616,8 @@ __svml_asinf4_ha_e9: andq $-64, %rsp #1186.1 subq $192, %rsp #1186.1 movaps %xmm0, %xmm7 #1186.1 - movups __svml_sasin_ha_data_internal(%rip), %xmm5 #1217.44 - movups 64+__svml_sasin_ha_data_internal(%rip), %xmm10 #1218.44 + movups __jsvml_sasin_ha_data_internal(%rip), %xmm5 #1217.44 + movups 64+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1218.44 movaps %xmm5, %xmm6 #1220.8 andps %xmm7, %xmm6 #1220.8 movaps %xmm10, %xmm8 #1223.32 @@ -632,14 +632,14 @@ __svml_asinf4_ha_e9: minps %xmm0, %xmm4 #1225.9 movaps %xmm0, %xmm8 #1229.620 andnps %xmm7, %xmm5 #1221.12 - cmpltps 192+__svml_sasin_ha_data_internal(%rip), %xmm8 #1229.620 + cmpltps 192+__jsvml_sasin_ha_data_internal(%rip), %xmm8 #1229.620 addps %xmm0, %xmm0 #1229.713 - movups 320+__svml_sasin_ha_data_internal(%rip), %xmm12 #1229.786 + movups 320+__jsvml_sasin_ha_data_internal(%rip), %xmm12 #1229.786 andnps %xmm11, %xmm8 #1229.663 movaps %xmm12, %xmm2 #1229.1058 movaps %xmm8, %xmm14 #1229.1350 andps %xmm0, %xmm2 #1229.1058 - movups 512+__svml_sasin_ha_data_internal(%rip), %xmm1 #1229.1805 + movups 512+__jsvml_sasin_ha_data_internal(%rip), %xmm1 #1229.1805 subps %xmm2, %xmm0 #1229.1104 mulps %xmm8, %xmm2 #1229.1142 mulps %xmm8, %xmm0 #1229.1180 @@ -649,29 +649,29 @@ __svml_asinf4_ha_e9: subps %xmm12, %xmm13 #1229.1267 mulps %xmm8, %xmm12 #1229.1308 mulps %xmm13, %xmm8 #1229.1390 - subps 448+__svml_sasin_ha_data_internal(%rip), %xmm12 #1229.1433 + subps 448+__jsvml_sasin_ha_data_internal(%rip), %xmm12 #1229.1433 movaps %xmm2, %xmm15 #1229.1566 addps %xmm12, %xmm14 #1229.1478 addps %xmm0, %xmm15 #1229.1566 addps %xmm14, %xmm8 #1229.1523 mulps %xmm8, %xmm1 #1229.1805 mulps %xmm15, %xmm8 #1229.1863 - addps 576+__svml_sasin_ha_data_internal(%rip), %xmm1 #1229.1793 - movups 256+__svml_sasin_ha_data_internal(%rip), %xmm9 #1219.40 + addps 576+__jsvml_sasin_ha_data_internal(%rip), %xmm1 #1229.1793 + movups 256+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1219.40 cmpltps %xmm6, %xmm9 #1222.13 mulps %xmm8, %xmm1 #1229.1916 movmskps %xmm9, %edx #1227.40 - movups 640+__svml_sasin_ha_data_internal(%rip), %xmm9 #1234.27 + movups 640+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1234.27 subps %xmm0, %xmm1 #1229.1904 mulps %xmm4, %xmm9 #1234.27 - movups 768+__svml_sasin_ha_data_internal(%rip), %xmm10 #1235.26 + movups 768+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1235.26 movaps %xmm4, %xmm0 #1236.13 mulps %xmm4, %xmm10 #1235.26 - addps 704+__svml_sasin_ha_data_internal(%rip), %xmm9 #1234.15 + addps 704+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1234.15 mulps %xmm4, %xmm0 #1236.13 - addps 832+__svml_sasin_ha_data_internal(%rip), %xmm10 #1235.14 + addps 832+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1235.14 mulps %xmm0, %xmm9 #1238.27 - movups 960+__svml_sasin_ha_data_internal(%rip), %xmm11 #1241.45 + movups 960+__jsvml_sasin_ha_data_internal(%rip), %xmm11 #1241.45 movaps %xmm1, %xmm12 #1244.13 movaps %xmm11, %xmm0 #1243.15 addps %xmm9, %xmm10 #1238.15 @@ -679,10 +679,10 @@ __svml_asinf4_ha_e9: subps %xmm2, %xmm12 #1244.13 mulps %xmm4, %xmm10 #1239.27 subps %xmm0, %xmm11 #1245.14 - addps 896+__svml_sasin_ha_data_internal(%rip), %xmm10 #1239.15 + addps 896+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1239.15 subps %xmm11, %xmm2 #1247.14 mulps %xmm10, %xmm4 #1240.15 - movups 1024+__svml_sasin_ha_data_internal(%rip), %xmm13 #1246.14 + movups 1024+__jsvml_sasin_ha_data_internal(%rip), %xmm13 #1246.14 andps %xmm3, %xmm12 #1249.13 andps %xmm3, %xmm0 #1251.15 addps %xmm1, %xmm13 #1246.14 @@ -749,29 +749,29 @@ __svml_asinf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1259.540 lea 128(%rsp,%r12,4), %rsi #1259.540 -..___tag_value___svml_asinf4_ha_e9.85: -# __svml_sasin_ha_cout_rare_internal(const float *, float *) - call __svml_sasin_ha_cout_rare_internal #1259.540 -..___tag_value___svml_asinf4_ha_e9.86: +..___tag_value___jsvml_asinf4_ha_e9.85: +# __jsvml_sasin_ha_cout_rare_internal(const float *, float *) + call __jsvml_sasin_ha_cout_rare_internal #1259.540 +..___tag_value___jsvml_asinf4_ha_e9.86: jmp ..B5.8 # Prob 100% #1259.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asinf4_ha_e9,@function - .size __svml_asinf4_ha_e9,.-__svml_asinf4_ha_e9 -..LN__svml_asinf4_ha_e9.4: + .type __jsvml_asinf4_ha_e9,@function + .size __jsvml_asinf4_ha_e9,.-__jsvml_asinf4_ha_e9 +..LN__jsvml_asinf4_ha_e9.4: .data -# -- End __svml_asinf4_ha_e9 +# -- End __jsvml_asinf4_ha_e9 .text -.L_2__routine_start___svml_asinf4_ha_ex_5: -# -- Begin __svml_asinf4_ha_ex +.L_2__routine_start___jsvml_asinf4_ha_ex_5: +# -- Begin __jsvml_asinf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_asinf4_ha_ex -# --- __svml_asinf4_ha_ex(__m128) -__svml_asinf4_ha_ex: + .globl __jsvml_asinf4_ha_ex +# --- __jsvml_asinf4_ha_ex(__m128) +__jsvml_asinf4_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -780,7 +780,7 @@ __svml_asinf4_ha_ex: .byte 30 #1340.540 .byte 250 #1340.540 .cfi_startproc -..___tag_value___svml_asinf4_ha_ex.88: +..___tag_value___jsvml_asinf4_ha_ex.88: ..L89: #1267.1 pushq %rbp #1267.1 @@ -791,8 +791,8 @@ __svml_asinf4_ha_ex: andq $-64, %rsp #1267.1 subq $192, %rsp #1267.1 movaps %xmm0, %xmm7 #1267.1 - movups __svml_sasin_ha_data_internal(%rip), %xmm5 #1298.44 - movups 64+__svml_sasin_ha_data_internal(%rip), %xmm10 #1299.44 + movups __jsvml_sasin_ha_data_internal(%rip), %xmm5 #1298.44 + movups 64+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1299.44 movaps %xmm5, %xmm6 #1301.8 andps %xmm7, %xmm6 #1301.8 movaps %xmm10, %xmm8 #1304.32 @@ -807,14 +807,14 @@ __svml_asinf4_ha_ex: minps %xmm0, %xmm4 #1306.9 movaps %xmm0, %xmm8 #1310.620 andnps %xmm7, %xmm5 #1302.12 - cmpltps 192+__svml_sasin_ha_data_internal(%rip), %xmm8 #1310.620 + cmpltps 192+__jsvml_sasin_ha_data_internal(%rip), %xmm8 #1310.620 addps %xmm0, %xmm0 #1310.713 - movups 320+__svml_sasin_ha_data_internal(%rip), %xmm12 #1310.786 + movups 320+__jsvml_sasin_ha_data_internal(%rip), %xmm12 #1310.786 andnps %xmm11, %xmm8 #1310.663 movaps %xmm12, %xmm2 #1310.1058 movaps %xmm8, %xmm14 #1310.1350 andps %xmm0, %xmm2 #1310.1058 - movups 512+__svml_sasin_ha_data_internal(%rip), %xmm1 #1310.1805 + movups 512+__jsvml_sasin_ha_data_internal(%rip), %xmm1 #1310.1805 subps %xmm2, %xmm0 #1310.1104 mulps %xmm8, %xmm2 #1310.1142 mulps %xmm8, %xmm0 #1310.1180 @@ -824,29 +824,29 @@ __svml_asinf4_ha_ex: subps %xmm12, %xmm13 #1310.1267 mulps %xmm8, %xmm12 #1310.1308 mulps %xmm13, %xmm8 #1310.1390 - subps 448+__svml_sasin_ha_data_internal(%rip), %xmm12 #1310.1433 + subps 448+__jsvml_sasin_ha_data_internal(%rip), %xmm12 #1310.1433 movaps %xmm2, %xmm15 #1310.1566 addps %xmm12, %xmm14 #1310.1478 addps %xmm0, %xmm15 #1310.1566 addps %xmm14, %xmm8 #1310.1523 mulps %xmm8, %xmm1 #1310.1805 mulps %xmm15, %xmm8 #1310.1863 - addps 576+__svml_sasin_ha_data_internal(%rip), %xmm1 #1310.1793 - movups 256+__svml_sasin_ha_data_internal(%rip), %xmm9 #1300.40 + addps 576+__jsvml_sasin_ha_data_internal(%rip), %xmm1 #1310.1793 + movups 256+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1300.40 cmpltps %xmm6, %xmm9 #1303.13 mulps %xmm8, %xmm1 #1310.1916 movmskps %xmm9, %edx #1308.40 - movups 640+__svml_sasin_ha_data_internal(%rip), %xmm9 #1315.27 + movups 640+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1315.27 subps %xmm0, %xmm1 #1310.1904 mulps %xmm4, %xmm9 #1315.27 - movups 768+__svml_sasin_ha_data_internal(%rip), %xmm10 #1316.26 + movups 768+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1316.26 movaps %xmm4, %xmm0 #1317.13 mulps %xmm4, %xmm10 #1316.26 - addps 704+__svml_sasin_ha_data_internal(%rip), %xmm9 #1315.15 + addps 704+__jsvml_sasin_ha_data_internal(%rip), %xmm9 #1315.15 mulps %xmm4, %xmm0 #1317.13 - addps 832+__svml_sasin_ha_data_internal(%rip), %xmm10 #1316.14 + addps 832+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1316.14 mulps %xmm0, %xmm9 #1319.27 - movups 960+__svml_sasin_ha_data_internal(%rip), %xmm11 #1322.45 + movups 960+__jsvml_sasin_ha_data_internal(%rip), %xmm11 #1322.45 movaps %xmm1, %xmm12 #1325.13 movaps %xmm11, %xmm0 #1324.15 addps %xmm9, %xmm10 #1319.15 @@ -854,10 +854,10 @@ __svml_asinf4_ha_ex: subps %xmm2, %xmm12 #1325.13 mulps %xmm4, %xmm10 #1320.27 subps %xmm0, %xmm11 #1326.14 - addps 896+__svml_sasin_ha_data_internal(%rip), %xmm10 #1320.15 + addps 896+__jsvml_sasin_ha_data_internal(%rip), %xmm10 #1320.15 subps %xmm11, %xmm2 #1328.14 mulps %xmm10, %xmm4 #1321.15 - movups 1024+__svml_sasin_ha_data_internal(%rip), %xmm13 #1327.14 + movups 1024+__jsvml_sasin_ha_data_internal(%rip), %xmm13 #1327.14 andps %xmm3, %xmm12 #1330.13 andps %xmm3, %xmm0 #1332.15 addps %xmm1, %xmm13 #1327.14 @@ -924,30 +924,30 @@ __svml_asinf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1340.540 lea 128(%rsp,%r12,4), %rsi #1340.540 -..___tag_value___svml_asinf4_ha_ex.106: -# __svml_sasin_ha_cout_rare_internal(const float *, float *) - call __svml_sasin_ha_cout_rare_internal #1340.540 -..___tag_value___svml_asinf4_ha_ex.107: +..___tag_value___jsvml_asinf4_ha_ex.106: +# __jsvml_sasin_ha_cout_rare_internal(const float *, float *) + call __jsvml_sasin_ha_cout_rare_internal #1340.540 +..___tag_value___jsvml_asinf4_ha_ex.107: jmp ..B6.8 # Prob 100% #1340.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_asinf4_ha_ex,@function - .size __svml_asinf4_ha_ex,.-__svml_asinf4_ha_ex -..LN__svml_asinf4_ha_ex.5: + .type __jsvml_asinf4_ha_ex,@function + .size __jsvml_asinf4_ha_ex,.-__jsvml_asinf4_ha_ex +..LN__jsvml_asinf4_ha_ex.5: .data -# -- End __svml_asinf4_ha_ex +# -- End __jsvml_asinf4_ha_ex .text -.L_2__routine_start___svml_sasin_ha_cout_rare_internal_6: -# -- Begin __svml_sasin_ha_cout_rare_internal +.L_2__routine_start___jsvml_sasin_ha_cout_rare_internal_6: +# -- Begin __jsvml_sasin_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_sasin_ha_cout_rare_internal - .globl __svml_sasin_ha_cout_rare_internal -# --- __svml_sasin_ha_cout_rare_internal(const float *, float *) -__svml_sasin_ha_cout_rare_internal: + .hidden __jsvml_sasin_ha_cout_rare_internal + .globl __jsvml_sasin_ha_cout_rare_internal +# --- __jsvml_sasin_ha_cout_rare_internal(const float *, float *) +__jsvml_sasin_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -957,7 +957,7 @@ __svml_sasin_ha_cout_rare_internal: .byte 30 #937.17 .byte 250 #937.17 .cfi_startproc -..___tag_value___svml_sasin_ha_cout_rare_internal.109: +..___tag_value___jsvml_sasin_ha_cout_rare_internal.109: ..L110: #780.1 xorl %eax, %eax #793.14 @@ -1471,17 +1471,17 @@ __svml_sasin_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_sasin_ha_cout_rare_internal,@function - .size __svml_sasin_ha_cout_rare_internal,.-__svml_sasin_ha_cout_rare_internal -..LN__svml_sasin_ha_cout_rare_internal.6: + .type __jsvml_sasin_ha_cout_rare_internal,@function + .size __jsvml_sasin_ha_cout_rare_internal,.-__jsvml_sasin_ha_cout_rare_internal +..LN__jsvml_sasin_ha_cout_rare_internal.6: .data -# -- End __svml_sasin_ha_cout_rare_internal +# -- End __jsvml_sasin_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_sasin_ha_data_internal - .globl __svml_sasin_ha_data_internal -__svml_sasin_ha_data_internal: + .hidden __jsvml_sasin_ha_data_internal + .globl __jsvml_sasin_ha_data_internal +__jsvml_sasin_ha_data_internal: .long 2147483647 .long 2147483647 .long 2147483647 @@ -1850,8 +1850,8 @@ __svml_sasin_ha_data_internal: .long 939876771 .long 939876771 .long 939876771 - .type __svml_sasin_ha_data_internal,@object - .size __svml_sasin_ha_data_internal,1472 + .type __jsvml_sasin_ha_data_internal,@object + .size __jsvml_sasin_ha_data_internal,1472 .align 32 _vmldASinHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_atan2_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_atan2_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_atan2_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_atan2_linux_x86.S index c15edb91220..e3500964bdf 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_atan2_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_atan2_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_atan2.c" .text ..TXTST0: -.L_2__routine_start___svml_atan2f4_ha_l9_0: -# -- Begin __svml_atan2f4_ha_l9 +.L_2__routine_start___jsvml_atan2f4_ha_l9_0: +# -- Begin __jsvml_atan2f4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2f4_ha_l9 -# --- __svml_atan2f4_ha_l9(__m128, __m128) -__svml_atan2f4_ha_l9: + .globl __jsvml_atan2f4_ha_l9 +# --- __jsvml_atan2f4_ha_l9(__m128, __m128) +__jsvml_atan2f4_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B1.1: # Preds ..B1.0 @@ -48,7 +48,7 @@ __svml_atan2f4_ha_l9: .byte 30 #974.14 .byte 250 #974.14 .cfi_startproc -..___tag_value___svml_atan2f4_ha_l9.1: +..___tag_value___jsvml_atan2f4_ha_l9.1: ..L2: #682.1 pushq %rbp #682.1 @@ -59,21 +59,21 @@ __svml_atan2f4_ha_l9: andq $-64, %rsp #682.1 subq $256, %rsp #682.1 vmovaps %xmm1, %xmm12 #682.1 - vmovups 192+__svml_satan2_ha_data_internal(%rip), %xmm11 #795.50 + vmovups 192+__jsvml_satan2_ha_data_internal(%rip), %xmm11 #795.50 xorl %edx, %edx #810.5 - vmovups 1728+__svml_satan2_ha_data_internal(%rip), %xmm6 #803.26 + vmovups 1728+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #803.26 vandps %xmm11, %xmm12, %xmm10 #796.14 - vmovups 1792+__svml_satan2_ha_data_internal(%rip), %xmm3 #804.26 + vmovups 1792+__jsvml_satan2_ha_data_internal(%rip), %xmm3 #804.26 vpsubd %xmm6, %xmm10, %xmm8 #805.18 vpcmpgtd %xmm3, %xmm8, %xmm4 #807.32 vpcmpeqd %xmm3, %xmm8, %xmm2 #807.83 vpor %xmm2, %xmm4, %xmm14 #807.18 vandps %xmm11, %xmm0, %xmm11 #797.14 - vmulps 576+__svml_satan2_ha_data_internal(%rip), %xmm10, %xmm2 #819.16 + vmulps 576+__jsvml_satan2_ha_data_internal(%rip), %xmm10, %xmm2 #819.16 vpsubd %xmm6, %xmm11, %xmm5 #806.18 - vmulps 512+__svml_satan2_ha_data_internal(%rip), %xmm10, %xmm4 #818.16 - vmulps 448+__svml_satan2_ha_data_internal(%rip), %xmm10, %xmm8 #817.16 - vmulps 384+__svml_satan2_ha_data_internal(%rip), %xmm10, %xmm6 #816.16 + vmulps 512+__jsvml_satan2_ha_data_internal(%rip), %xmm10, %xmm4 #818.16 + vmulps 448+__jsvml_satan2_ha_data_internal(%rip), %xmm10, %xmm8 #817.16 + vmulps 384+__jsvml_satan2_ha_data_internal(%rip), %xmm10, %xmm6 #816.16 vpcmpgtd %xmm3, %xmm5, %xmm13 #808.32 vpcmpeqd %xmm3, %xmm5, %xmm15 #808.83 vxorps %xmm10, %xmm12, %xmm7 #799.14 @@ -84,13 +84,13 @@ __svml_atan2f4_ha_l9: vpor %xmm7, %xmm14, %xmm9 #809.19 vpcmpgtd %xmm2, %xmm11, %xmm7 #828.22 vpcmpgtd %xmm11, %xmm4, %xmm5 #827.22 - vpxor 1600+__svml_satan2_ha_data_internal(%rip), %xmm7, %xmm3 #833.22 + vpxor 1600+__jsvml_satan2_ha_data_internal(%rip), %xmm7, %xmm3 #833.22 vpcmpgtd %xmm11, %xmm6, %xmm1 #825.22 vmovdqu %xmm9, 48(%rsp) #809.19[spill] vpandn %xmm3, %xmm5, %xmm9 #834.23 - vmovups 640+__svml_satan2_ha_data_internal(%rip), %xmm2 #841.47 + vmovups 640+__jsvml_satan2_ha_data_internal(%rip), %xmm2 #841.47 vandps %xmm1, %xmm11, %xmm14 #844.18 - vmovups 704+__svml_satan2_ha_data_internal(%rip), %xmm3 #842.47 + vmovups 704+__jsvml_satan2_ha_data_internal(%rip), %xmm3 #842.47 vmovaps %xmm2, %xmm13 #845.18 vmovaps %xmm3, %xmm4 #847.18 vfnmadd213ps %xmm11, %xmm10, %xmm13 #845.18 @@ -99,12 +99,12 @@ __svml_atan2f4_ha_l9: vpcmpgtd %xmm11, %xmm8, %xmm0 #826.22 vpandn %xmm0, %xmm1, %xmm8 #830.23 vpandn %xmm5, %xmm0, %xmm6 #832.23 - vxorps 128+__svml_satan2_ha_data_internal(%rip), %xmm10, %xmm5 #851.18 + vxorps 128+__jsvml_satan2_ha_data_internal(%rip), %xmm10, %xmm5 #851.18 vandps %xmm8, %xmm13, %xmm15 #846.18 vandps %xmm7, %xmm5, %xmm5 #852.18 vandps %xmm6, %xmm4, %xmm13 #848.18 vorps %xmm15, %xmm14, %xmm15 #853.18 - vmovups 768+__svml_satan2_ha_data_internal(%rip), %xmm4 #849.18 + vmovups 768+__jsvml_satan2_ha_data_internal(%rip), %xmm4 #849.18 vmovaps %xmm4, %xmm0 #849.18 vfnmadd213ps %xmm11, %xmm10, %xmm0 #849.18 vfmadd213ps %xmm10, %xmm11, %xmm2 #858.18 @@ -122,45 +122,45 @@ __svml_atan2f4_ha_l9: vorps %xmm15, %xmm14, %xmm13 #865.18 vorps %xmm3, %xmm1, %xmm15 #866.18 vorps %xmm15, %xmm13, %xmm14 #867.18 - vandps 832+__svml_satan2_ha_data_internal(%rip), %xmm8, %xmm1 #873.18 + vandps 832+__jsvml_satan2_ha_data_internal(%rip), %xmm8, %xmm1 #873.18 vorps %xmm0, %xmm14, %xmm13 #868.17 - vandps 960+__svml_satan2_ha_data_internal(%rip), %xmm6, %xmm2 #874.18 + vandps 960+__jsvml_satan2_ha_data_internal(%rip), %xmm6, %xmm2 #874.18 vorps %xmm2, %xmm1, %xmm15 #877.18 vrcpps %xmm13, %xmm2 #880.18 - vmovups 64+__svml_satan2_ha_data_internal(%rip), %xmm0 #881.25 + vmovups 64+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #881.25 vfnmadd231ps %xmm2, %xmm13, %xmm0 #881.25 - vandps 1088+__svml_satan2_ha_data_internal(%rip), %xmm9, %xmm4 #875.18 - vandps 1216+__svml_satan2_ha_data_internal(%rip), %xmm7, %xmm3 #876.18 + vandps 1088+__jsvml_satan2_ha_data_internal(%rip), %xmm9, %xmm4 #875.18 + vandps 1216+__jsvml_satan2_ha_data_internal(%rip), %xmm7, %xmm3 #876.18 vorps %xmm3, %xmm4, %xmm14 #878.18 vorps %xmm14, %xmm15, %xmm3 #879.17 vmovaps %xmm13, %xmm15 #885.19 vfmadd213ps %xmm0, %xmm0, %xmm0 #882.25 - vandps 1024+__svml_satan2_ha_data_internal(%rip), %xmm6, %xmm6 #894.18 - vandps 1280+__svml_satan2_ha_data_internal(%rip), %xmm7, %xmm7 #896.18 + vandps 1024+__jsvml_satan2_ha_data_internal(%rip), %xmm6, %xmm6 #894.18 + vandps 1280+__jsvml_satan2_ha_data_internal(%rip), %xmm7, %xmm7 #896.18 vfmadd213ps %xmm2, %xmm0, %xmm2 #883.22 - vcmpltps __svml_satan2_ha_data_internal(%rip), %xmm12, %xmm0 #904.20 + vcmpltps __jsvml_satan2_ha_data_internal(%rip), %xmm12, %xmm0 #904.20 vmulps %xmm2, %xmm5, %xmm1 #884.19 vfnmadd213ps %xmm5, %xmm1, %xmm15 #885.19 vfmadd213ps %xmm1, %xmm2, %xmm15 #886.19 - vmovups 1408+__svml_satan2_ha_data_internal(%rip), %xmm1 #910.47 + vmovups 1408+__jsvml_satan2_ha_data_internal(%rip), %xmm1 #910.47 vfnmadd213ps %xmm5, %xmm15, %xmm13 #887.19 vmulps %xmm15, %xmm15, %xmm4 #907.14 vmulps %xmm13, %xmm2, %xmm14 #888.19 vmulps %xmm4, %xmm4, %xmm2 #908.14 - vandps 896+__svml_satan2_ha_data_internal(%rip), %xmm8, %xmm5 #893.18 - vandps 1152+__svml_satan2_ha_data_internal(%rip), %xmm9, %xmm8 #895.18 + vandps 896+__jsvml_satan2_ha_data_internal(%rip), %xmm8, %xmm5 #893.18 + vandps 1152+__jsvml_satan2_ha_data_internal(%rip), %xmm9, %xmm8 #895.18 vorps %xmm6, %xmm5, %xmm9 #897.18 - vmovups 1344+__svml_satan2_ha_data_internal(%rip), %xmm6 #913.14 + vmovups 1344+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #913.14 vorps %xmm7, %xmm8, %xmm5 #898.18 - vfmadd213ps 1472+__svml_satan2_ha_data_internal(%rip), %xmm2, %xmm6 #913.14 + vfmadd213ps 1472+__jsvml_satan2_ha_data_internal(%rip), %xmm2, %xmm6 #913.14 vorps %xmm5, %xmm9, %xmm13 #899.17 - vfmadd213ps 1536+__svml_satan2_ha_data_internal(%rip), %xmm1, %xmm2 #914.14 + vfmadd213ps 1536+__jsvml_satan2_ha_data_internal(%rip), %xmm1, %xmm2 #914.14 vaddps %xmm14, %xmm13, %xmm9 #900.19 vfmadd213ps %xmm2, %xmm4, %xmm6 #915.13 - vandps 320+__svml_satan2_ha_data_internal(%rip), %xmm0, %xmm7 #906.20 + vandps 320+__jsvml_satan2_ha_data_internal(%rip), %xmm0, %xmm7 #906.20 vmovups 16(%rsp), %xmm5 #917.16[spill] vxorps %xmm5, %xmm7, %xmm8 #917.16 - vandps 256+__svml_satan2_ha_data_internal(%rip), %xmm0, %xmm13 #905.20 + vandps 256+__jsvml_satan2_ha_data_internal(%rip), %xmm0, %xmm13 #905.20 vaddps %xmm9, %xmm8, %xmm14 #918.19 vmulps %xmm6, %xmm4, %xmm0 #916.13 vfmadd213ps %xmm14, %xmm15, %xmm0 #919.14 @@ -236,10 +236,10 @@ __svml_atan2f4_ha_l9: lea 64(%rsp,%r12,4), %rdi #977.654 lea 128(%rsp,%r12,4), %rsi #977.654 lea 192(%rsp,%r12,4), %rdx #977.654 -..___tag_value___svml_atan2f4_ha_l9.27: -# __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_satan2_ha_cout_rare_internal #977.654 -..___tag_value___svml_atan2f4_ha_l9.28: +..___tag_value___jsvml_atan2f4_ha_l9.27: +# __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_satan2_ha_cout_rare_internal #977.654 +..___tag_value___jsvml_atan2f4_ha_l9.28: jmp ..B1.9 # Prob 100% #977.654 .cfi_restore 12 .cfi_restore 13 @@ -249,7 +249,7 @@ __svml_atan2f4_ha_l9: vmovups (%rsp), %xmm6 #947.19[spill] vcmpordps %xmm12, %xmm12, %xmm7 #946.19 vcmpordps %xmm6, %xmm6, %xmm8 #947.19 - vmovups __svml_satan2_ha_data_internal(%rip), %xmm2 #951.20 + vmovups __jsvml_satan2_ha_data_internal(%rip), %xmm2 #951.20 vandps %xmm8, %xmm7, %xmm15 #948.20 vpcmpeqd %xmm2, %xmm10, %xmm9 #951.20 vpcmpeqd %xmm2, %xmm11, %xmm13 #952.20 @@ -259,13 +259,13 @@ __svml_atan2f4_ha_l9: vcmpltps %xmm10, %xmm11, %xmm0 #960.21 vmovmskps %xmm6, %edx #956.44 blendvps %xmm0, %xmm10, %xmm11 #962.21 - vandnps 1856+__svml_satan2_ha_data_internal(%rip), %xmm0, %xmm10 #963.24 + vandnps 1856+__jsvml_satan2_ha_data_internal(%rip), %xmm0, %xmm10 #963.24 vcmpeqps %xmm2, %xmm11, %xmm0 #964.17 blendvps %xmm0, %xmm2, %xmm10 #965.16 vmovaps %xmm1, %xmm0 #974.14 vorps %xmm5, %xmm10, %xmm11 #966.13 vpcmpgtd %xmm12, %xmm2, %xmm5 #968.22 - vandps 1920+__svml_satan2_ha_data_internal(%rip), %xmm5, %xmm2 #970.18 + vandps 1920+__jsvml_satan2_ha_data_internal(%rip), %xmm5, %xmm2 #970.18 vaddps %xmm2, %xmm11, %xmm5 #971.17 vorps %xmm3, %xmm5, %xmm3 #972.19 blendvps %xmm0, %xmm3, %xmm4 #974.14 @@ -274,20 +274,20 @@ __svml_atan2f4_ha_l9: # LOE rbx r12 r13 r14 r15 edx xmm4 xmm12 .cfi_endproc # mark_end; - .type __svml_atan2f4_ha_l9,@function - .size __svml_atan2f4_ha_l9,.-__svml_atan2f4_ha_l9 -..LN__svml_atan2f4_ha_l9.0: + .type __jsvml_atan2f4_ha_l9,@function + .size __jsvml_atan2f4_ha_l9,.-__jsvml_atan2f4_ha_l9 +..LN__jsvml_atan2f4_ha_l9.0: .data -# -- End __svml_atan2f4_ha_l9 +# -- End __jsvml_atan2f4_ha_l9 .text -.L_2__routine_start___svml_atan2f4_ha_e9_1: -# -- Begin __svml_atan2f4_ha_e9 +.L_2__routine_start___jsvml_atan2f4_ha_e9_1: +# -- Begin __jsvml_atan2f4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2f4_ha_e9 -# --- __svml_atan2f4_ha_e9(__m128, __m128) -__svml_atan2f4_ha_e9: + .globl __jsvml_atan2f4_ha_e9 +# --- __jsvml_atan2f4_ha_e9(__m128, __m128) +__jsvml_atan2f4_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B2.1: # Preds ..B2.0 @@ -297,7 +297,7 @@ __svml_atan2f4_ha_e9: .byte 30 #1282.14 .byte 250 #1282.14 .cfi_startproc -..___tag_value___svml_atan2f4_ha_e9.33: +..___tag_value___jsvml_atan2f4_ha_e9.33: ..L34: #985.1 pushq %rbp #985.1 @@ -308,22 +308,22 @@ __svml_atan2f4_ha_e9: andq $-64, %rsp #985.1 subq $256, %rsp #985.1 vmovaps %xmm1, %xmm13 #985.1 - vmovups 192+__svml_satan2_ha_data_internal(%rip), %xmm12 #1098.50 + vmovups 192+__jsvml_satan2_ha_data_internal(%rip), %xmm12 #1098.50 xorl %edx, %edx #1113.5 - vmovups 1728+__svml_satan2_ha_data_internal(%rip), %xmm8 #1106.30 + vmovups 1728+__jsvml_satan2_ha_data_internal(%rip), %xmm8 #1106.30 vandps %xmm12, %xmm13, %xmm11 #1099.14 - vmovups 1792+__svml_satan2_ha_data_internal(%rip), %xmm10 #1107.30 + vmovups 1792+__jsvml_satan2_ha_data_internal(%rip), %xmm10 #1107.30 vandps %xmm12, %xmm0, %xmm12 #1100.14 vpsubd %xmm8, %xmm11, %xmm5 #1108.22 vxorps %xmm12, %xmm0, %xmm6 #1103.14 vmovups %xmm0, (%rsp) #985.1[spill] vpsubd %xmm8, %xmm12, %xmm7 #1109.22 - vmulps 384+__svml_satan2_ha_data_internal(%rip), %xmm11, %xmm8 #1119.16 + vmulps 384+__jsvml_satan2_ha_data_internal(%rip), %xmm11, %xmm8 #1119.16 vpcmpgtd %xmm10, %xmm5, %xmm4 #1110.36 - vmulps 448+__svml_satan2_ha_data_internal(%rip), %xmm11, %xmm0 #1120.16 + vmulps 448+__jsvml_satan2_ha_data_internal(%rip), %xmm11, %xmm0 #1120.16 vpcmpeqd %xmm10, %xmm5, %xmm2 #1110.95 vpcmpgtd %xmm10, %xmm7, %xmm3 #1111.36 - vmulps 512+__svml_satan2_ha_data_internal(%rip), %xmm11, %xmm5 #1121.16 + vmulps 512+__jsvml_satan2_ha_data_internal(%rip), %xmm11, %xmm5 #1121.16 vpcmpeqd %xmm10, %xmm7, %xmm15 #1111.95 vxorps %xmm11, %xmm13, %xmm9 #1102.14 vpor %xmm2, %xmm4, %xmm14 #1110.22 @@ -337,24 +337,24 @@ __svml_atan2f4_ha_e9: vpor %xmm9, %xmm14, %xmm6 #1112.23 vmovdqu %xmm6, 48(%rsp) #1112.23[spill] vpandn %xmm10, %xmm2, %xmm6 #1135.27 - vmovups 640+__svml_satan2_ha_data_internal(%rip), %xmm2 #1144.47 + vmovups 640+__jsvml_satan2_ha_data_internal(%rip), %xmm2 #1144.47 vandps %xmm1, %xmm12, %xmm0 #1147.18 - vmulps 576+__svml_satan2_ha_data_internal(%rip), %xmm11, %xmm4 #1122.16 + vmulps 576+__jsvml_satan2_ha_data_internal(%rip), %xmm11, %xmm4 #1122.16 vmulps %xmm2, %xmm11, %xmm5 #1148.38 vpcmpgtd %xmm4, %xmm12, %xmm7 #1131.26 vsubps %xmm5, %xmm12, %xmm4 #1148.18 - vpxor 1600+__svml_satan2_ha_data_internal(%rip), %xmm7, %xmm3 #1136.26 + vpxor 1600+__jsvml_satan2_ha_data_internal(%rip), %xmm7, %xmm3 #1136.26 vandps %xmm8, %xmm4, %xmm14 #1149.18 vpandn %xmm3, %xmm10, %xmm9 #1137.27 vorps %xmm14, %xmm0, %xmm14 #1156.18 - vmovups 704+__svml_satan2_ha_data_internal(%rip), %xmm3 #1145.47 + vmovups 704+__jsvml_satan2_ha_data_internal(%rip), %xmm3 #1145.47 vandps %xmm1, %xmm11, %xmm0 #1160.18 vmulps %xmm3, %xmm11, %xmm15 #1150.38 vmulps %xmm2, %xmm12, %xmm1 #1161.30 vmulps %xmm3, %xmm12, %xmm3 #1163.30 vsubps %xmm15, %xmm12, %xmm5 #1150.18 vaddps %xmm1, %xmm11, %xmm2 #1161.18 - vmovups 768+__svml_satan2_ha_data_internal(%rip), %xmm4 #1152.38 + vmovups 768+__jsvml_satan2_ha_data_internal(%rip), %xmm4 #1152.38 vandps %xmm6, %xmm5, %xmm15 #1151.18 vmulps %xmm4, %xmm11, %xmm10 #1152.38 vandps %xmm8, %xmm2, %xmm1 #1162.18 @@ -364,7 +364,7 @@ __svml_atan2f4_ha_e9: vaddps %xmm4, %xmm11, %xmm3 #1165.18 vandps %xmm9, %xmm5, %xmm10 #1153.18 vandps %xmm7, %xmm12, %xmm4 #1167.18 - vxorps 128+__svml_satan2_ha_data_internal(%rip), %xmm11, %xmm5 #1154.18 + vxorps 128+__jsvml_satan2_ha_data_internal(%rip), %xmm11, %xmm5 #1154.18 vorps %xmm10, %xmm15, %xmm10 #1157.18 vandps %xmm7, %xmm5, %xmm5 #1155.18 vorps %xmm10, %xmm14, %xmm15 #1158.18 @@ -374,22 +374,22 @@ __svml_atan2f4_ha_e9: vorps %xmm1, %xmm0, %xmm14 #1168.18 vorps %xmm15, %xmm10, %xmm10 #1169.18 vorps %xmm10, %xmm14, %xmm0 #1170.18 - vandps 832+__svml_satan2_ha_data_internal(%rip), %xmm8, %xmm1 #1176.18 + vandps 832+__jsvml_satan2_ha_data_internal(%rip), %xmm8, %xmm1 #1176.18 vorps %xmm4, %xmm0, %xmm14 #1171.17 - vandps 960+__svml_satan2_ha_data_internal(%rip), %xmm6, %xmm4 #1177.18 - vandps 1088+__svml_satan2_ha_data_internal(%rip), %xmm9, %xmm2 #1178.18 + vandps 960+__jsvml_satan2_ha_data_internal(%rip), %xmm6, %xmm4 #1177.18 + vandps 1088+__jsvml_satan2_ha_data_internal(%rip), %xmm9, %xmm2 #1178.18 vorps %xmm4, %xmm1, %xmm3 #1180.18 - vandps 1216+__svml_satan2_ha_data_internal(%rip), %xmm7, %xmm10 #1179.18 + vandps 1216+__jsvml_satan2_ha_data_internal(%rip), %xmm7, %xmm10 #1179.18 vorps %xmm10, %xmm2, %xmm15 #1181.18 vorps %xmm15, %xmm3, %xmm10 #1182.17 vcvtps2pd %xmm5, %ymm15 #1183.23 vcvtps2pd %xmm14, %ymm2 #1184.23 - vandps 896+__svml_satan2_ha_data_internal(%rip), %xmm8, %xmm8 #1201.18 - vandps 1024+__svml_satan2_ha_data_internal(%rip), %xmm6, %xmm6 #1202.18 - vandps 1152+__svml_satan2_ha_data_internal(%rip), %xmm9, %xmm9 #1203.18 + vandps 896+__jsvml_satan2_ha_data_internal(%rip), %xmm8, %xmm8 #1201.18 + vandps 1024+__jsvml_satan2_ha_data_internal(%rip), %xmm6, %xmm6 #1202.18 + vandps 1152+__jsvml_satan2_ha_data_internal(%rip), %xmm9, %xmm9 #1203.18 vrcpps %xmm14, %xmm5 #1185.22 - vmovupd 1664+__svml_satan2_ha_data_internal(%rip), %ymm4 #1187.57 - vandps 1280+__svml_satan2_ha_data_internal(%rip), %xmm7, %xmm7 #1204.18 + vmovupd 1664+__jsvml_satan2_ha_data_internal(%rip), %ymm4 #1187.57 + vandps 1280+__jsvml_satan2_ha_data_internal(%rip), %xmm7, %xmm7 #1204.18 vcvtps2pd %xmm5, %ymm3 #1186.28 vmulpd %ymm3, %ymm2, %ymm5 #1188.49 vorps %xmm7, %xmm9, %xmm2 #1206.18 @@ -405,21 +405,21 @@ __svml_atan2f4_ha_e9: vcvtps2pd %xmm3, %ymm5 #1194.25 vmulps %xmm14, %xmm14, %xmm1 #1216.14 vsubpd %ymm5, %ymm15, %ymm4 #1195.19 - vmulps 1344+__svml_satan2_ha_data_internal(%rip), %xmm1, %xmm0 #1221.26 + vmulps 1344+__jsvml_satan2_ha_data_internal(%rip), %xmm1, %xmm0 #1221.26 vcvtpd2ps %ymm4, %xmm5 #1196.19 vorps %xmm6, %xmm8, %xmm4 #1205.18 - vaddps 1472+__svml_satan2_ha_data_internal(%rip), %xmm0, %xmm8 #1221.14 - vmulps 1408+__svml_satan2_ha_data_internal(%rip), %xmm1, %xmm6 #1222.26 + vaddps 1472+__jsvml_satan2_ha_data_internal(%rip), %xmm0, %xmm8 #1221.14 + vmulps 1408+__jsvml_satan2_ha_data_internal(%rip), %xmm1, %xmm6 #1222.26 vorps %xmm2, %xmm4, %xmm7 #1207.17 - vaddps 1536+__svml_satan2_ha_data_internal(%rip), %xmm6, %xmm9 #1222.14 + vaddps 1536+__jsvml_satan2_ha_data_internal(%rip), %xmm6, %xmm9 #1222.14 vmulps %xmm8, %xmm14, %xmm4 #1223.25 vaddps %xmm7, %xmm5, %xmm2 #1208.19 - vmovups __svml_satan2_ha_data_internal(%rip), %xmm5 #1209.46 + vmovups __jsvml_satan2_ha_data_internal(%rip), %xmm5 #1209.46 vaddps %xmm4, %xmm9, %xmm0 #1223.13 vcmpltps %xmm5, %xmm13, %xmm15 #1212.20 vmulps %xmm0, %xmm14, %xmm0 #1224.13 - vandps 256+__svml_satan2_ha_data_internal(%rip), %xmm15, %xmm7 #1213.20 - vandps 320+__svml_satan2_ha_data_internal(%rip), %xmm15, %xmm15 #1214.20 + vandps 256+__jsvml_satan2_ha_data_internal(%rip), %xmm15, %xmm7 #1213.20 + vandps 320+__jsvml_satan2_ha_data_internal(%rip), %xmm15, %xmm15 #1214.20 vmovups 16(%rsp), %xmm4 #1225.16[spill] vxorps %xmm4, %xmm15, %xmm14 #1225.16 vmulps %xmm0, %xmm3, %xmm1 #1227.26 @@ -505,10 +505,10 @@ __svml_atan2f4_ha_e9: lea 64(%rsp,%r12,4), %rdi #1285.654 lea 128(%rsp,%r12,4), %rsi #1285.654 lea 192(%rsp,%r12,4), %rdx #1285.654 -..___tag_value___svml_atan2f4_ha_e9.59: -# __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_satan2_ha_cout_rare_internal #1285.654 -..___tag_value___svml_atan2f4_ha_e9.60: +..___tag_value___jsvml_atan2f4_ha_e9.59: +# __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_satan2_ha_cout_rare_internal #1285.654 +..___tag_value___jsvml_atan2f4_ha_e9.60: jmp ..B2.9 # Prob 100% #1285.654 .cfi_restore 12 .cfi_restore 13 @@ -527,11 +527,11 @@ __svml_atan2f4_ha_e9: vcmpltps %xmm11, %xmm12, %xmm0 #1268.21 vmovmskps %xmm6, %edx #1264.44 blendvps %xmm0, %xmm11, %xmm12 #1270.21 - vandnps 1856+__svml_satan2_ha_data_internal(%rip), %xmm0, %xmm11 #1271.24 + vandnps 1856+__jsvml_satan2_ha_data_internal(%rip), %xmm0, %xmm11 #1271.24 vcmpeqps %xmm5, %xmm12, %xmm0 #1272.17 blendvps %xmm0, %xmm5, %xmm11 #1273.16 vpcmpgtd %xmm13, %xmm5, %xmm5 #1276.26 - vandps 1920+__svml_satan2_ha_data_internal(%rip), %xmm5, %xmm12 #1278.18 + vandps 1920+__jsvml_satan2_ha_data_internal(%rip), %xmm5, %xmm12 #1278.18 vorps %xmm4, %xmm11, %xmm4 #1274.13 vmovaps %xmm1, %xmm0 #1282.14 vaddps %xmm12, %xmm4, %xmm4 #1279.17 @@ -542,20 +542,20 @@ __svml_atan2f4_ha_e9: # LOE rbx r12 r13 r14 r15 edx xmm3 xmm13 .cfi_endproc # mark_end; - .type __svml_atan2f4_ha_e9,@function - .size __svml_atan2f4_ha_e9,.-__svml_atan2f4_ha_e9 -..LN__svml_atan2f4_ha_e9.1: + .type __jsvml_atan2f4_ha_e9,@function + .size __jsvml_atan2f4_ha_e9,.-__jsvml_atan2f4_ha_e9 +..LN__jsvml_atan2f4_ha_e9.1: .data -# -- End __svml_atan2f4_ha_e9 +# -- End __jsvml_atan2f4_ha_e9 .text -.L_2__routine_start___svml_atan2f16_ha_z0_2: -# -- Begin __svml_atan2f16_ha_z0 +.L_2__routine_start___jsvml_atan2f16_ha_z0_2: +# -- Begin __jsvml_atan2f16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2f16_ha_z0 -# --- __svml_atan2f16_ha_z0(__m512, __m512) -__svml_atan2f16_ha_z0: + .globl __jsvml_atan2f16_ha_z0 +# --- __jsvml_atan2f16_ha_z0(__m512, __m512) +__jsvml_atan2f16_ha_z0: # parameter 1: %zmm0 # parameter 2: %zmm1 ..B3.1: # Preds ..B3.0 @@ -565,7 +565,7 @@ __svml_atan2f16_ha_z0: .byte 30 #1543.35 .byte 250 #1543.35 .cfi_startproc -..___tag_value___svml_atan2f16_ha_z0.65: +..___tag_value___jsvml_atan2f16_ha_z0.65: ..L66: #1293.1 pushq %rbp #1293.1 @@ -576,13 +576,13 @@ __svml_atan2f16_ha_z0: andq $-64, %rsp #1293.1 subq $256, %rsp #1293.1 xorl %esi, %esi #1424.5 - vmovups 192+__svml_satan2_ha_data_internal(%rip), %zmm2 #1409.52 - vmovups 1728+__svml_satan2_ha_data_internal(%rip), %zmm12 #1417.45 - vmovups 1792+__svml_satan2_ha_data_internal(%rip), %zmm14 #1418.45 - vmovups 448+__svml_satan2_ha_data_internal(%rip), %zmm6 #1427.50 - vmovups 576+__svml_satan2_ha_data_internal(%rip), %zmm10 #1429.50 - vmovups 384+__svml_satan2_ha_data_internal(%rip), %zmm7 #1426.50 - vmovups 512+__svml_satan2_ha_data_internal(%rip), %zmm9 #1428.50 + vmovups 192+__jsvml_satan2_ha_data_internal(%rip), %zmm2 #1409.52 + vmovups 1728+__jsvml_satan2_ha_data_internal(%rip), %zmm12 #1417.45 + vmovups 1792+__jsvml_satan2_ha_data_internal(%rip), %zmm14 #1418.45 + vmovups 448+__jsvml_satan2_ha_data_internal(%rip), %zmm6 #1427.50 + vmovups 576+__jsvml_satan2_ha_data_internal(%rip), %zmm10 #1429.50 + vmovups 384+__jsvml_satan2_ha_data_internal(%rip), %zmm7 #1426.50 + vmovups 512+__jsvml_satan2_ha_data_internal(%rip), %zmm9 #1428.50 vandps %zmm2, %zmm0, %zmm4 #1411.14 vpternlogd $255, %zmm8, %zmm8, %zmm8 #1422.16 vpsubd %zmm12, %zmm4, %zmm15 #1420.16 @@ -591,34 +591,34 @@ __svml_atan2f16_ha_z0: vxorps %zmm4, %zmm0, %zmm1 #1414.14 vpcmpgtd %zmm15, %zmm14, %k2 #1422.83 vmulps {rn-sae}, %zmm7, %zmm3, %zmm11 #1430.18 - vmovups 768+__svml_satan2_ha_data_internal(%rip), %zmm7 #1441.49 + vmovups 768+__jsvml_satan2_ha_data_internal(%rip), %zmm7 #1441.49 vpsubd %zmm12, %zmm3, %zmm13 #1419.16 vpternlogd $255, %zmm12, %zmm12, %zmm12 #1421.16 vxorps %zmm3, %zmm5, %zmm2 #1413.14 vpcmpgtd %zmm13, %zmm14, %k1 #1421.83 vcmpps $17, {sae}, %zmm4, %zmm11, %k6 #1434.21 vmulps {rn-sae}, %zmm9, %zmm3, %zmm14 #1432.18 - vmovups 64+__svml_satan2_ha_data_internal(%rip), %zmm11 #1438.47 + vmovups 64+__jsvml_satan2_ha_data_internal(%rip), %zmm11 #1438.47 vcmpps $17, {sae}, %zmm4, %zmm14, %k5 #1436.21 - vmovups 832+__svml_satan2_ha_data_internal(%rip), %zmm14 #1451.57 + vmovups 832+__jsvml_satan2_ha_data_internal(%rip), %zmm14 #1451.57 vpandnd %zmm13, %zmm13, %zmm12{%k1} #1421.16 vpandnd %zmm15, %zmm15, %zmm8{%k2} #1422.16 vmulps {rn-sae}, %zmm6, %zmm3, %zmm13 #1431.18 vmulps {rn-sae}, %zmm10, %zmm3, %zmm15 #1433.18 vcmpps $17, {sae}, %zmm4, %zmm13, %k3 #1435.21 vcmpps $17, {sae}, %zmm4, %zmm15, %k4 #1437.21 - vmovups 1088+__svml_satan2_ha_data_internal(%rip), %zmm15 #1453.57 + vmovups 1088+__jsvml_satan2_ha_data_internal(%rip), %zmm15 #1453.57 vblendmps %zmm11, %zmm7, %zmm9{%k4} #1443.23 - vblendmps 1216+__svml_satan2_ha_data_internal(%rip), %zmm15, %zmm7{%k4} #1456.18 - vmovups 1344+__svml_satan2_ha_data_internal(%rip), %zmm15 #1480.49 + vblendmps 1216+__jsvml_satan2_ha_data_internal(%rip), %zmm15, %zmm7{%k4} #1456.18 + vmovups 1344+__jsvml_satan2_ha_data_internal(%rip), %zmm15 #1480.49 vmovaps %zmm3, %zmm10 #1449.17 vxorps %zmm3, %zmm3, %zmm10{%k4} #1449.17 vpord %zmm8, %zmm12, %zmm12 #1423.17 - vmovups 640+__svml_satan2_ha_data_internal(%rip), %zmm8 #1439.49 + vmovups 640+__jsvml_satan2_ha_data_internal(%rip), %zmm8 #1439.49 vptestmd %zmm12, %zmm12, %k0 #1425.47 - vblendmps 704+__svml_satan2_ha_data_internal(%rip), %zmm8, %zmm6{%k3} #1442.23 - vblendmps 960+__svml_satan2_ha_data_internal(%rip), %zmm14, %zmm8{%k3} #1455.18 - vmovups __svml_satan2_ha_data_internal(%rip), %zmm14 #1474.48 + vblendmps 704+__jsvml_satan2_ha_data_internal(%rip), %zmm8, %zmm6{%k3} #1442.23 + vblendmps 960+__jsvml_satan2_ha_data_internal(%rip), %zmm14, %zmm8{%k3} #1455.18 + vmovups __jsvml_satan2_ha_data_internal(%rip), %zmm14 #1474.48 vblendmps %zmm9, %zmm6, %zmm13{%k5} #1444.20 vblendmps %zmm7, %zmm8, %zmm8{%k5} #1457.17 vcmpps $17, {sae}, %zmm14, %zmm5, %k7 #1477.20 @@ -635,27 +635,27 @@ __svml_atan2f16_ha_z0: vfnmadd213ps {rn-sae}, %zmm9, %zmm6, %zmm7 #1462.19 vfmadd213ps {rn-sae}, %zmm6, %zmm13, %zmm7 #1463.19 vfnmadd213ps {rn-sae}, %zmm9, %zmm7, %zmm10 #1464.19 - vmovups 1152+__svml_satan2_ha_data_internal(%rip), %zmm9 #1468.57 + vmovups 1152+__jsvml_satan2_ha_data_internal(%rip), %zmm9 #1468.57 vmulps {rn-sae}, %zmm7, %zmm7, %zmm14 #1478.16 vmulps {rn-sae}, %zmm13, %zmm10, %zmm6 #1465.21 - vmovups 896+__svml_satan2_ha_data_internal(%rip), %zmm10 #1466.57 - vblendmps 1280+__svml_satan2_ha_data_internal(%rip), %zmm9, %zmm11{%k4} #1471.18 - vmovups 1408+__svml_satan2_ha_data_internal(%rip), %zmm9 #1481.49 - vblendmps 1024+__svml_satan2_ha_data_internal(%rip), %zmm10, %zmm10{%k3} #1470.18 + vmovups 896+__jsvml_satan2_ha_data_internal(%rip), %zmm10 #1466.57 + vblendmps 1280+__jsvml_satan2_ha_data_internal(%rip), %zmm9, %zmm11{%k4} #1471.18 + vmovups 1408+__jsvml_satan2_ha_data_internal(%rip), %zmm9 #1481.49 + vblendmps 1024+__jsvml_satan2_ha_data_internal(%rip), %zmm10, %zmm10{%k3} #1470.18 vblendmps %zmm11, %zmm10, %zmm13{%k5} #1472.17 vmulps {rn-sae}, %zmm14, %zmm14, %zmm11 #1479.16 - vmovups 1536+__svml_satan2_ha_data_internal(%rip), %zmm10 #1483.49 + vmovups 1536+__jsvml_satan2_ha_data_internal(%rip), %zmm10 #1483.49 vaddps {rn-sae}, %zmm13, %zmm6, %zmm6{%k6} #1473.21 - vmovups 1472+__svml_satan2_ha_data_internal(%rip), %zmm13 #1484.14 + vmovups 1472+__jsvml_satan2_ha_data_internal(%rip), %zmm13 #1484.14 vfmadd231ps {rn-sae}, %zmm11, %zmm15, %zmm13 #1484.14 vfmadd213ps {rn-sae}, %zmm10, %zmm9, %zmm11 #1485.14 - vxorps 320+__svml_satan2_ha_data_internal(%rip), %zmm2, %zmm15 #1488.16 + vxorps 320+__jsvml_satan2_ha_data_internal(%rip), %zmm2, %zmm15 #1488.16 vfmadd213ps {rn-sae}, %zmm11, %zmm14, %zmm13 #1486.13 vaddps {rn-sae}, %zmm15, %zmm6, %zmm6{%k7} #1489.21 vmulps {rn-sae}, %zmm14, %zmm13, %zmm9 #1487.15 vfmadd213ps {rn-sae}, %zmm6, %zmm7, %zmm9 #1490.14 vaddps {rn-sae}, %zmm7, %zmm9, %zmm6 #1491.16 - vmovups 256+__svml_satan2_ha_data_internal(%rip), %zmm7 #1494.20 + vmovups 256+__jsvml_satan2_ha_data_internal(%rip), %zmm7 #1494.20 vaddps {rn-sae}, %zmm8, %zmm6, %zmm6{%k6} #1492.20 vorps %zmm2, %zmm6, %zmm8 #1493.14 vaddps {rn-sae}, %zmm7, %zmm8, %zmm8{%k7} #1494.20 @@ -777,10 +777,10 @@ __svml_atan2f16_ha_z0: lea 64(%rsp,%rbx,4), %rdi #1546.878 lea 128(%rsp,%rbx,4), %rsi #1546.878 lea 192(%rsp,%rbx,4), %rdx #1546.878 -..___tag_value___svml_atan2f16_ha_z0.93: -# __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_satan2_ha_cout_rare_internal #1546.878 -..___tag_value___svml_atan2f16_ha_z0.94: +..___tag_value___jsvml_atan2f16_ha_z0.93: +# __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_satan2_ha_cout_rare_internal #1546.878 +..___tag_value___jsvml_atan2f16_ha_z0.94: jmp ..B3.14 # Prob 100% #1546.878 .cfi_restore 3 .cfi_restore 12 @@ -789,8 +789,8 @@ __svml_atan2f16_ha_z0: # LOE r15 ebx r12d r13d r14d ..B3.17: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq - vmovups __svml_satan2_ha_data_internal(%rip), %zmm8 #1522.85 - vmovups 1920+__svml_satan2_ha_data_internal(%rip), %zmm6 #1528.50 + vmovups __jsvml_satan2_ha_data_internal(%rip), %zmm8 #1522.85 + vmovups 1920+__jsvml_satan2_ha_data_internal(%rip), %zmm6 #1528.50 vcmpps $17, {sae}, %zmm3, %zmm4, %k5 #1531.21 vcmpps $3, {sae}, %zmm5, %zmm5, %k1 #1517.108 vcmpps $3, {sae}, %zmm0, %zmm0, %k2 #1518.108 @@ -807,7 +807,7 @@ __svml_atan2f16_ha_z0: vpandnd %zmm5, %zmm5, %zmm10{%k1} #1517.40 vpandnd %zmm0, %zmm0, %zmm11{%k2} #1518.40 vandps %zmm11, %zmm10, %zmm7 #1519.20 - vmovups 1856+__svml_satan2_ha_data_internal(%rip), %zmm10 #1529.52 + vmovups 1856+__jsvml_satan2_ha_data_internal(%rip), %zmm10 #1529.52 vxorps %zmm10, %zmm10, %zmm10{%k5} #1534.24 vpandnd %zmm4, %zmm4, %zmm14{%k4} #1523.18 vpternlogd $255, %zmm4, %zmm4, %zmm4 #1535.38 @@ -831,20 +831,20 @@ __svml_atan2f16_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm5 zmm9 .cfi_endproc # mark_end; - .type __svml_atan2f16_ha_z0,@function - .size __svml_atan2f16_ha_z0,.-__svml_atan2f16_ha_z0 -..LN__svml_atan2f16_ha_z0.2: + .type __jsvml_atan2f16_ha_z0,@function + .size __jsvml_atan2f16_ha_z0,.-__jsvml_atan2f16_ha_z0 +..LN__jsvml_atan2f16_ha_z0.2: .data -# -- End __svml_atan2f16_ha_z0 +# -- End __jsvml_atan2f16_ha_z0 .text -.L_2__routine_start___svml_atan2f8_ha_e9_3: -# -- Begin __svml_atan2f8_ha_e9 +.L_2__routine_start___jsvml_atan2f8_ha_e9_3: +# -- Begin __jsvml_atan2f8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2f8_ha_e9 -# --- __svml_atan2f8_ha_e9(__m256, __m256) -__svml_atan2f8_ha_e9: + .globl __jsvml_atan2f8_ha_e9 +# --- __jsvml_atan2f8_ha_e9(__m256, __m256) +__jsvml_atan2f8_ha_e9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B4.1: # Preds ..B4.0 @@ -854,7 +854,7 @@ __svml_atan2f8_ha_e9: .byte 30 #1851.14 .byte 250 #1851.14 .cfi_startproc -..___tag_value___svml_atan2f8_ha_e9.100: +..___tag_value___jsvml_atan2f8_ha_e9.100: ..L101: #1554.1 pushq %rbp #1554.1 @@ -865,15 +865,15 @@ __svml_atan2f8_ha_e9: andq $-64, %rsp #1554.1 subq $256, %rsp #1554.1 xorl %edx, %edx #1682.5 - vmovups 192+__svml_satan2_ha_data_internal(%rip), %ymm2 #1667.53 - vmovups 1728+__svml_satan2_ha_data_internal(%rip), %xmm11 #1675.30 + vmovups 192+__jsvml_satan2_ha_data_internal(%rip), %ymm2 #1667.53 + vmovups 1728+__jsvml_satan2_ha_data_internal(%rip), %xmm11 #1675.30 vmovups %ymm0, (%rsp) #1554.1[spill] vmovaps %ymm1, %ymm4 #1554.1 vandps %ymm2, %ymm4, %ymm3 #1668.14 vandps %ymm2, %ymm0, %ymm2 #1669.14 vxorps %ymm3, %ymm4, %ymm14 #1671.14 vxorps %ymm2, %ymm0, %ymm7 #1672.14 - vmovups 1792+__svml_satan2_ha_data_internal(%rip), %xmm0 #1676.30 + vmovups 1792+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #1676.30 vmovups %ymm14, 64(%rsp) #1671.14[spill] vmovups %ymm7, 32(%rsp) #1672.14[spill] vpsubd %xmm11, %xmm3, %xmm9 #1677.22 @@ -897,14 +897,14 @@ __svml_atan2f8_ha_e9: vpcmpgtd %xmm0, %xmm1, %xmm5 #1680.186 vpcmpeqd %xmm0, %xmm1, %xmm0 #1680.245 vpor %xmm0, %xmm5, %xmm1 #1680.172 - vmulps 384+__svml_satan2_ha_data_internal(%rip), %ymm3, %ymm15 #1688.16 + vmulps 384+__jsvml_satan2_ha_data_internal(%rip), %ymm3, %ymm15 #1688.16 vpor %xmm1, %xmm12, %xmm6 #1681.89 - vmulps 576+__svml_satan2_ha_data_internal(%rip), %ymm3, %ymm1 #1691.16 + vmulps 576+__jsvml_satan2_ha_data_internal(%rip), %ymm3, %ymm1 #1691.16 vmovdqu %xmm11, 160(%rsp) #1681.23[spill] vmovdqu %xmm6, 128(%rsp) #1681.89[spill] vmovups %xmm8, 144(%rsp) #1674.107[spill] - vmulps 512+__svml_satan2_ha_data_internal(%rip), %ymm3, %ymm11 #1690.16 - vmulps 448+__svml_satan2_ha_data_internal(%rip), %ymm3, %ymm0 #1689.16 + vmulps 512+__jsvml_satan2_ha_data_internal(%rip), %ymm3, %ymm11 #1690.16 + vmulps 448+__jsvml_satan2_ha_data_internal(%rip), %ymm3, %ymm0 #1689.16 vpcmpgtd %xmm2, %xmm15, %xmm5 #1697.26 vextractf128 $1, %ymm15, %xmm10 #1692.117 vpcmpgtd %xmm8, %xmm10, %xmm7 #1697.92 @@ -915,7 +915,7 @@ __svml_atan2f8_ha_e9: vpcmpgtd %xmm2, %xmm11, %xmm11 #1699.26 vextractf128 $1, %ymm0, %xmm14 #1693.117 vpcmpgtd %xmm9, %xmm8, %xmm0 #1700.92 - vmovups 1600+__svml_satan2_ha_data_internal(%rip), %xmm9 #1705.26 + vmovups 1600+__jsvml_satan2_ha_data_internal(%rip), %xmm9 #1705.26 vpcmpgtd %xmm8, %xmm13, %xmm15 #1699.92 vpxor %xmm9, %xmm6, %xmm13 #1705.26 vpcmpgtd %xmm8, %xmm14, %xmm14 #1698.92 @@ -928,14 +928,14 @@ __svml_atan2f8_ha_e9: vpandn %xmm15, %xmm14, %xmm14 #1704.97 vpandn %xmm5, %xmm15, %xmm15 #1706.97 vinsertf128 $1, %xmm15, %ymm11, %ymm13 #1710.21 - vmovups 640+__svml_satan2_ha_data_internal(%rip), %ymm15 #1713.50 + vmovups 640+__jsvml_satan2_ha_data_internal(%rip), %ymm15 #1713.50 vinsertf128 $1, %xmm14, %ymm10, %ymm14 #1709.21 vmulps %ymm15, %ymm3, %ymm10 #1717.41 vinsertf128 $1, %xmm7, %ymm8, %ymm1 #1708.21 vinsertf128 $1, %xmm0, %ymm6, %ymm11 #1711.21 - vmovups 704+__svml_satan2_ha_data_internal(%rip), %ymm0 #1714.50 + vmovups 704+__jsvml_satan2_ha_data_internal(%rip), %ymm0 #1714.50 vsubps %ymm10, %ymm2, %ymm7 #1717.18 - vmovups 768+__svml_satan2_ha_data_internal(%rip), %ymm10 #1721.41 + vmovups 768+__jsvml_satan2_ha_data_internal(%rip), %ymm10 #1721.41 vmulps %ymm0, %ymm3, %ymm8 #1719.41 vmulps %ymm0, %ymm2, %ymm0 #1732.33 vsubps %ymm8, %ymm2, %ymm9 #1719.18 @@ -952,7 +952,7 @@ __svml_atan2f8_ha_e9: vorps %ymm6, %ymm5, %ymm7 #1727.18 vandps %ymm12, %ymm3, %ymm6 #1729.18 vmulps %ymm15, %ymm2, %ymm12 #1730.33 - vxorps 128+__svml_satan2_ha_data_internal(%rip), %ymm3, %ymm8 #1723.18 + vxorps 128+__jsvml_satan2_ha_data_internal(%rip), %ymm3, %ymm8 #1723.18 vandps %ymm11, %ymm8, %ymm8 #1724.18 vorps %ymm8, %ymm7, %ymm8 #1728.17 vaddps %ymm12, %ymm3, %ymm7 #1730.18 @@ -965,17 +965,17 @@ __svml_atan2f8_ha_e9: vandps %ymm11, %ymm2, %ymm15 #1736.18 vorps %ymm9, %ymm12, %ymm6 #1739.18 vorps %ymm15, %ymm6, %ymm5 #1740.17 - vandps 1088+__svml_satan2_ha_data_internal(%rip), %ymm13, %ymm7 #1747.18 - vandps 1216+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm9 #1748.18 + vandps 1088+__jsvml_satan2_ha_data_internal(%rip), %ymm13, %ymm7 #1747.18 + vandps 1216+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm9 #1748.18 vorps %ymm9, %ymm7, %ymm6 #1750.18 - vandps 832+__svml_satan2_ha_data_internal(%rip), %ymm1, %ymm10 #1745.18 - vandps 960+__svml_satan2_ha_data_internal(%rip), %ymm14, %ymm0 #1746.18 + vandps 832+__jsvml_satan2_ha_data_internal(%rip), %ymm1, %ymm10 #1745.18 + vandps 960+__jsvml_satan2_ha_data_internal(%rip), %ymm14, %ymm0 #1746.18 vorps %ymm0, %ymm10, %ymm12 #1749.18 vorps %ymm6, %ymm12, %ymm10 #1751.17 - vandps 896+__svml_satan2_ha_data_internal(%rip), %ymm1, %ymm1 #1770.18 - vandps 1024+__svml_satan2_ha_data_internal(%rip), %ymm14, %ymm14 #1771.18 - vandps 1152+__svml_satan2_ha_data_internal(%rip), %ymm13, %ymm13 #1772.18 - vandps 1280+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm11 #1773.18 + vandps 896+__jsvml_satan2_ha_data_internal(%rip), %ymm1, %ymm1 #1770.18 + vandps 1024+__jsvml_satan2_ha_data_internal(%rip), %ymm14, %ymm14 #1771.18 + vandps 1152+__jsvml_satan2_ha_data_internal(%rip), %ymm13, %ymm13 #1772.18 + vandps 1280+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm11 #1773.18 vcvtps2pd %xmm5, %ymm7 #1753.23 vextractf128 $1, %ymm5, %xmm15 #1753.105 vrcpps %ymm5, %ymm5 #1754.22 @@ -985,7 +985,7 @@ __svml_atan2f8_ha_e9: vcvtps2pd %xmm0, %ymm8 #1752.88 vcvtps2pd %xmm5, %ymm0 #1755.28 vextractf128 $1, %ymm5, %xmm6 #1755.112 - vmovupd 1664+__svml_satan2_ha_data_internal(%rip), %ymm5 #1756.59 + vmovupd 1664+__jsvml_satan2_ha_data_internal(%rip), %ymm5 #1756.59 vmulpd %ymm0, %ymm7, %ymm7 #1757.53 vcvtps2pd %xmm6, %ymm6 #1755.95 vsubpd %ymm7, %ymm5, %ymm7 #1757.27 @@ -1016,18 +1016,18 @@ __svml_atan2f8_ha_e9: vorps %ymm14, %ymm0, %ymm13 #1776.17 vmulps %ymm7, %ymm7, %ymm0 #1784.14 vcvtpd2ps %ymm5, %xmm9 #1765.65 - vcmplt_oqps __svml_satan2_ha_data_internal(%rip), %ymm4, %ymm1 #1781.20 + vcmplt_oqps __jsvml_satan2_ha_data_internal(%rip), %ymm4, %ymm1 #1781.20 vmulps %ymm0, %ymm0, %ymm6 #1785.14 - vmulps 1344+__svml_satan2_ha_data_internal(%rip), %ymm6, %ymm5 #1790.29 - vandps 256+__svml_satan2_ha_data_internal(%rip), %ymm1, %ymm14 #1782.20 - vandps 320+__svml_satan2_ha_data_internal(%rip), %ymm1, %ymm11 #1783.20 + vmulps 1344+__jsvml_satan2_ha_data_internal(%rip), %ymm6, %ymm5 #1790.29 + vandps 256+__jsvml_satan2_ha_data_internal(%rip), %ymm1, %ymm14 #1782.20 + vandps 320+__jsvml_satan2_ha_data_internal(%rip), %ymm1, %ymm11 #1783.20 vinsertf128 $1, %xmm8, %ymm9, %ymm8 #1765.19 vaddps %ymm13, %ymm8, %ymm13 #1777.19 - vaddps 1472+__svml_satan2_ha_data_internal(%rip), %ymm5, %ymm9 #1790.14 - vmulps 1408+__svml_satan2_ha_data_internal(%rip), %ymm6, %ymm8 #1791.29 + vaddps 1472+__jsvml_satan2_ha_data_internal(%rip), %ymm5, %ymm9 #1790.14 + vmulps 1408+__jsvml_satan2_ha_data_internal(%rip), %ymm6, %ymm8 #1791.29 vmulps %ymm9, %ymm0, %ymm15 #1792.28 vmovups 64(%rsp), %ymm9 #1794.16[spill] - vaddps 1536+__svml_satan2_ha_data_internal(%rip), %ymm8, %ymm12 #1791.14 + vaddps 1536+__jsvml_satan2_ha_data_internal(%rip), %ymm8, %ymm12 #1791.14 vaddps %ymm15, %ymm12, %ymm1 #1792.13 vmulps %ymm1, %ymm0, %ymm5 #1793.13 vmulps %ymm5, %ymm7, %ymm6 #1796.29 @@ -1114,10 +1114,10 @@ __svml_atan2f8_ha_e9: lea 64(%rsp,%r12,4), %rdi #1854.663 lea 128(%rsp,%r12,4), %rsi #1854.663 lea 192(%rsp,%r12,4), %rdx #1854.663 -..___tag_value___svml_atan2f8_ha_e9.132: -# __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_satan2_ha_cout_rare_internal #1854.663 -..___tag_value___svml_atan2f8_ha_e9.133: +..___tag_value___jsvml_atan2f8_ha_e9.132: +# __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_satan2_ha_cout_rare_internal #1854.663 +..___tag_value___jsvml_atan2f8_ha_e9.133: jmp ..B4.9 # Prob 100% #1854.663 .cfi_restore 12 .cfi_restore 13 @@ -1125,13 +1125,13 @@ __svml_atan2f8_ha_e9: ..B4.12: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq vmovups (%rsp), %ymm11 #1824.19[spill] - vmovups __svml_satan2_ha_data_internal(%rip), %ymm7 #1827.40 + vmovups __jsvml_satan2_ha_data_internal(%rip), %ymm7 #1827.40 vcmpordps %ymm4, %ymm4, %ymm12 #1823.19 vcmpordps %ymm11, %ymm11, %ymm13 #1824.19 vandps %ymm13, %ymm12, %ymm14 #1825.20 vcmplt_oqps %ymm3, %ymm2, %ymm12 #1837.21 vblendvps %ymm12, %ymm3, %ymm2, %ymm2 #1839.21 - vandnps 1856+__svml_satan2_ha_data_internal(%rip), %ymm12, %ymm3 #1840.24 + vandnps 1856+__jsvml_satan2_ha_data_internal(%rip), %ymm12, %ymm3 #1840.24 vpcmpeqd %xmm7, %xmm1, %xmm1 #1829.24 vextractf128 $1, %ymm7, %xmm8 #1827.113 vpcmpeqd 96(%rsp), %xmm7, %xmm15 #1828.24[spill] @@ -1155,7 +1155,7 @@ __svml_atan2f8_ha_e9: vextractf128 $1, %ymm4, %xmm6 #1844.111 vpcmpgtd %xmm6, %xmm8, %xmm8 #1845.94 vinsertf128 $1, %xmm8, %ymm7, %ymm9 #1846.20 - vandps 1920+__svml_satan2_ha_data_internal(%rip), %ymm9, %ymm11 #1847.18 + vandps 1920+__jsvml_satan2_ha_data_internal(%rip), %ymm9, %ymm11 #1847.18 vaddps %ymm11, %ymm10, %ymm12 #1848.17 vorps 32(%rsp), %ymm12, %ymm13 #1849.19[spill] vinsertf128 $1, %xmm1, %ymm5, %ymm1 #1850.26 @@ -1165,20 +1165,20 @@ __svml_atan2f8_ha_e9: # LOE rbx r12 r13 r14 r15 edx ymm0 ymm4 .cfi_endproc # mark_end; - .type __svml_atan2f8_ha_e9,@function - .size __svml_atan2f8_ha_e9,.-__svml_atan2f8_ha_e9 -..LN__svml_atan2f8_ha_e9.3: + .type __jsvml_atan2f8_ha_e9,@function + .size __jsvml_atan2f8_ha_e9,.-__jsvml_atan2f8_ha_e9 +..LN__jsvml_atan2f8_ha_e9.3: .data -# -- End __svml_atan2f8_ha_e9 +# -- End __jsvml_atan2f8_ha_e9 .text -.L_2__routine_start___svml_atan2f4_ha_ex_4: -# -- Begin __svml_atan2f4_ha_ex +.L_2__routine_start___jsvml_atan2f4_ha_ex_4: +# -- Begin __jsvml_atan2f4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_atan2f4_ha_ex -# --- __svml_atan2f4_ha_ex(__m128, __m128) -__svml_atan2f4_ha_ex: + .globl __jsvml_atan2f4_ha_ex +# --- __jsvml_atan2f4_ha_ex(__m128, __m128) +__jsvml_atan2f4_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B5.1: # Preds ..B5.0 @@ -1188,7 +1188,7 @@ __svml_atan2f4_ha_ex: .byte 30 #2159.14 .byte 250 #2159.14 .cfi_startproc -..___tag_value___svml_atan2f4_ha_ex.143: +..___tag_value___jsvml_atan2f4_ha_ex.143: ..L144: #1862.1 pushq %rbp #1862.1 @@ -1199,15 +1199,15 @@ __svml_atan2f4_ha_ex: andq $-64, %rsp #1862.1 subq $256, %rsp #1862.1 movaps %xmm1, %xmm12 #1862.1 - movups 192+__svml_satan2_ha_data_internal(%rip), %xmm9 #1975.50 + movups 192+__jsvml_satan2_ha_data_internal(%rip), %xmm9 #1975.50 xorl %edx, %edx #1990.5 movaps %xmm9, %xmm10 #1976.14 andps %xmm0, %xmm9 #1977.14 andps %xmm12, %xmm10 #1976.14 movaps %xmm9, %xmm4 #1986.16 - movdqu 1728+__svml_satan2_ha_data_internal(%rip), %xmm6 #1983.59 + movdqu 1728+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #1983.59 movaps %xmm10, %xmm8 #1985.16 - movups 640+__svml_satan2_ha_data_internal(%rip), %xmm15 #2021.47 + movups 640+__jsvml_satan2_ha_data_internal(%rip), %xmm15 #2021.47 psubd %xmm6, %xmm8 #1985.16 psubd %xmm6, %xmm4 #1986.16 movaps %xmm9, %xmm5 #1980.14 @@ -1215,9 +1215,9 @@ __svml_atan2f4_ha_ex: movdqa %xmm8, %xmm1 #1987.30 movups %xmm0, (%rsp) #1862.1[spill] movdqa %xmm4, %xmm2 #1988.30 - movdqu 1792+__svml_satan2_ha_data_internal(%rip), %xmm11 #1984.59 + movdqu 1792+__jsvml_satan2_ha_data_internal(%rip), %xmm11 #1984.59 pxor %xmm0, %xmm5 #1980.14 - movups 576+__svml_satan2_ha_data_internal(%rip), %xmm0 #1999.16 + movups 576+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #1999.16 pcmpgtd %xmm11, %xmm1 #1987.30 mulps %xmm10, %xmm3 #2025.38 pcmpeqd %xmm11, %xmm8 #1987.77 @@ -1231,7 +1231,7 @@ __svml_atan2f4_ha_ex: movaps %xmm10, %xmm7 #1979.14 movdqu %xmm1, 48(%rsp) #1989.17[spill] movaps %xmm9, %xmm2 #2025.18 - movups 704+__svml_satan2_ha_data_internal(%rip), %xmm1 #2022.47 + movups 704+__jsvml_satan2_ha_data_internal(%rip), %xmm1 #2022.47 pxor %xmm12, %xmm7 #1979.14 movups %xmm7, 32(%rsp) #1979.14[spill] movaps %xmm9, %xmm7 #2008.20 @@ -1241,7 +1241,7 @@ __svml_atan2f4_ha_ex: subps %xmm3, %xmm2 #2025.18 addps %xmm10, %xmm15 #2038.18 mulps %xmm9, %xmm1 #2040.30 - movups 768+__svml_satan2_ha_data_internal(%rip), %xmm3 #2029.38 + movups 768+__jsvml_satan2_ha_data_internal(%rip), %xmm3 #2029.38 movaps %xmm9, %xmm4 #2027.18 movaps %xmm3, %xmm0 #2029.38 xorl %eax, %eax #1990.5 @@ -1249,19 +1249,19 @@ __svml_atan2f4_ha_ex: subps %xmm11, %xmm4 #2027.18 addps %xmm10, %xmm1 #2040.18 mulps %xmm9, %xmm3 #2042.30 - movups 384+__svml_satan2_ha_data_internal(%rip), %xmm14 #1996.16 + movups 384+__jsvml_satan2_ha_data_internal(%rip), %xmm14 #1996.16 movaps %xmm9, %xmm11 #2029.18 movups %xmm5, 16(%rsp) #1980.14[spill] subps %xmm0, %xmm11 #2029.18 mulps %xmm10, %xmm14 #1996.16 addps %xmm10, %xmm3 #2042.18 - movups 448+__svml_satan2_ha_data_internal(%rip), %xmm6 #1997.16 + movups 448+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #1997.16 pcmpgtd %xmm9, %xmm14 #2005.20 - movups 512+__svml_satan2_ha_data_internal(%rip), %xmm5 #1998.16 + movups 512+__jsvml_satan2_ha_data_internal(%rip), %xmm5 #1998.16 movaps %xmm14, %xmm8 #2010.21 mulps %xmm10, %xmm6 #1997.16 mulps %xmm10, %xmm5 #1998.16 - movdqu 1600+__svml_satan2_ha_data_internal(%rip), %xmm13 #2013.20 + movdqu 1600+__jsvml_satan2_ha_data_internal(%rip), %xmm13 #2013.20 pcmpgtd %xmm9, %xmm6 #2006.20 pcmpgtd %xmm9, %xmm5 #2007.20 pxor %xmm7, %xmm13 #2013.20 @@ -1277,7 +1277,7 @@ __svml_atan2f4_ha_ex: andps %xmm6, %xmm1 #2041.18 andps %xmm5, %xmm3 #2043.18 andps %xmm8, %xmm2 #2026.18 - movups 128+__svml_satan2_ha_data_internal(%rip), %xmm0 #2031.18 + movups 128+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #2031.18 orps %xmm11, %xmm4 #2034.18 movaps %xmm9, %xmm11 #2044.18 orps %xmm15, %xmm14 #2045.18 @@ -1289,9 +1289,9 @@ __svml_atan2f4_ha_ex: andps %xmm7, %xmm0 #2032.18 orps %xmm4, %xmm13 #2035.18 orps %xmm11, %xmm14 #2048.17 - movups 832+__svml_satan2_ha_data_internal(%rip), %xmm11 #2053.18 + movups 832+__jsvml_satan2_ha_data_internal(%rip), %xmm11 #2053.18 orps %xmm0, %xmm13 #2036.17 - movups 960+__svml_satan2_ha_data_internal(%rip), %xmm4 #2054.18 + movups 960+__jsvml_satan2_ha_data_internal(%rip), %xmm4 #2054.18 andps %xmm8, %xmm11 #2053.18 andps %xmm6, %xmm4 #2054.18 orps %xmm4, %xmm11 #2057.18 @@ -1302,8 +1302,8 @@ __svml_atan2f4_ha_ex: movaps %xmm14, %xmm13 #2061.74 movhlps %xmm14, %xmm13 #2061.74 rcpps %xmm14, %xmm14 #2062.22 - movups 1088+__svml_satan2_ha_data_internal(%rip), %xmm0 #2055.18 - movups 1216+__svml_satan2_ha_data_internal(%rip), %xmm2 #2056.18 + movups 1088+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #2055.18 + movups 1216+__jsvml_satan2_ha_data_internal(%rip), %xmm2 #2056.18 andps %xmm5, %xmm0 #2055.18 andps %xmm7, %xmm2 #2056.18 orps %xmm2, %xmm0 #2058.18 @@ -1314,7 +1314,7 @@ __svml_atan2f4_ha_ex: cvtps2pd %xmm14, %xmm0 #2063.67 mulpd %xmm13, %xmm1 #2065.50 mulpd %xmm0, %xmm2 #2065.121 - movups 1664+__svml_satan2_ha_data_internal(%rip), %xmm15 #2064.56 + movups 1664+__jsvml_satan2_ha_data_internal(%rip), %xmm15 #2064.56 movaps %xmm15, %xmm14 #2065.27 subpd %xmm1, %xmm14 #2065.27 movaps %xmm15, %xmm1 #2065.98 @@ -1344,9 +1344,9 @@ __svml_atan2f4_ha_ex: subpd %xmm14, %xmm3 #2072.67 cvtpd2ps %xmm4, %xmm4 #2073.35 cvtpd2ps %xmm3, %xmm3 #2073.66 - movups 896+__svml_satan2_ha_data_internal(%rip), %xmm0 #2078.18 + movups 896+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #2078.18 andps %xmm8, %xmm0 #2078.18 - movups 1024+__svml_satan2_ha_data_internal(%rip), %xmm8 #2079.18 + movups 1024+__jsvml_satan2_ha_data_internal(%rip), %xmm8 #2079.18 andps %xmm6, %xmm8 #2079.18 orps %xmm8, %xmm0 #2082.18 movaps %xmm2, %xmm8 #2092.14 @@ -1354,27 +1354,27 @@ __svml_atan2f4_ha_ex: movlhps %xmm3, %xmm4 #2073.19 movaps %xmm8, %xmm3 #2093.14 mulps %xmm8, %xmm3 #2093.14 - movups 1152+__svml_satan2_ha_data_internal(%rip), %xmm6 #2080.18 + movups 1152+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #2080.18 andps %xmm5, %xmm6 #2080.18 - movups 1280+__svml_satan2_ha_data_internal(%rip), %xmm5 #2081.18 + movups 1280+__jsvml_satan2_ha_data_internal(%rip), %xmm5 #2081.18 andps %xmm7, %xmm5 #2081.18 movaps %xmm12, %xmm7 #2089.20 orps %xmm5, %xmm6 #2083.18 - movups 1344+__svml_satan2_ha_data_internal(%rip), %xmm5 #2098.26 + movups 1344+__jsvml_satan2_ha_data_internal(%rip), %xmm5 #2098.26 orps %xmm6, %xmm0 #2084.17 mulps %xmm3, %xmm5 #2098.26 addps %xmm0, %xmm4 #2085.19 - movups 1408+__svml_satan2_ha_data_internal(%rip), %xmm6 #2099.26 + movups 1408+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #2099.26 mulps %xmm3, %xmm6 #2099.26 - addps 1472+__svml_satan2_ha_data_internal(%rip), %xmm5 #2098.14 + addps 1472+__jsvml_satan2_ha_data_internal(%rip), %xmm5 #2098.14 mulps %xmm8, %xmm5 #2100.25 - addps 1536+__svml_satan2_ha_data_internal(%rip), %xmm6 #2099.14 - movups __svml_satan2_ha_data_internal(%rip), %xmm1 #2086.46 + addps 1536+__jsvml_satan2_ha_data_internal(%rip), %xmm6 #2099.14 + movups __jsvml_satan2_ha_data_internal(%rip), %xmm1 #2086.46 addps %xmm5, %xmm6 #2100.13 cmpltps %xmm1, %xmm7 #2089.20 mulps %xmm6, %xmm8 #2101.13 - movups 256+__svml_satan2_ha_data_internal(%rip), %xmm0 #2090.20 - movups 320+__svml_satan2_ha_data_internal(%rip), %xmm13 #2091.20 + movups 256+__jsvml_satan2_ha_data_internal(%rip), %xmm0 #2090.20 + movups 320+__jsvml_satan2_ha_data_internal(%rip), %xmm13 #2091.20 andps %xmm7, %xmm0 #2090.20 andps %xmm7, %xmm13 #2091.20 movups 32(%rsp), %xmm7 #2102.16[spill] @@ -1451,10 +1451,10 @@ __svml_atan2f4_ha_ex: lea 64(%rsp,%r12,4), %rdi #2162.654 lea 128(%rsp,%r12,4), %rsi #2162.654 lea 192(%rsp,%r12,4), %rdx #2162.654 -..___tag_value___svml_atan2f4_ha_ex.169: -# __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_satan2_ha_cout_rare_internal #2162.654 -..___tag_value___svml_atan2f4_ha_ex.170: +..___tag_value___jsvml_atan2f4_ha_ex.169: +# __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_satan2_ha_cout_rare_internal #2162.654 +..___tag_value___jsvml_atan2f4_ha_ex.170: jmp ..B5.9 # Prob 100% #2162.654 .cfi_restore 12 .cfi_restore 13 @@ -1484,13 +1484,13 @@ __svml_atan2f4_ha_ex: orps %xmm10, %xmm7 #2147.21 andnps %xmm0, %xmm9 #2159.25 cmpeqps %xmm1, %xmm7 #2149.17 - andnps 1856+__svml_satan2_ha_data_internal(%rip), %xmm5 #2148.24 + andnps 1856+__jsvml_satan2_ha_data_internal(%rip), %xmm5 #2148.24 movaps %xmm7, %xmm10 #2150.27 andnps %xmm5, %xmm10 #2150.27 andps %xmm1, %xmm7 #2150.65 orps %xmm7, %xmm10 #2150.16 pcmpgtd %xmm12, %xmm1 #2153.20 - andps 1920+__svml_satan2_ha_data_internal(%rip), %xmm1 #2155.18 + andps 1920+__jsvml_satan2_ha_data_internal(%rip), %xmm1 #2155.18 movaps %xmm9, %xmm0 #2159.14 orps 32(%rsp), %xmm10 #2151.13[spill] addps %xmm1, %xmm10 #2156.17 @@ -1502,20 +1502,20 @@ __svml_atan2f4_ha_ex: # LOE rbx r12 r13 r14 r15 eax edx xmm0 xmm12 .cfi_endproc # mark_end; - .type __svml_atan2f4_ha_ex,@function - .size __svml_atan2f4_ha_ex,.-__svml_atan2f4_ha_ex -..LN__svml_atan2f4_ha_ex.4: + .type __jsvml_atan2f4_ha_ex,@function + .size __jsvml_atan2f4_ha_ex,.-__jsvml_atan2f4_ha_ex +..LN__jsvml_atan2f4_ha_ex.4: .data -# -- End __svml_atan2f4_ha_ex +# -- End __jsvml_atan2f4_ha_ex .text -.L_2__routine_start___svml_atan2f8_ha_l9_5: -# -- Begin __svml_atan2f8_ha_l9 +.L_2__routine_start___jsvml_atan2f8_ha_l9_5: +# -- Begin __jsvml_atan2f8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atan2f8_ha_l9 -# --- __svml_atan2f8_ha_l9(__m256, __m256) -__svml_atan2f8_ha_l9: + .globl __jsvml_atan2f8_ha_l9 +# --- __jsvml_atan2f8_ha_l9(__m256, __m256) +__jsvml_atan2f8_ha_l9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B6.1: # Preds ..B6.0 @@ -1525,7 +1525,7 @@ __svml_atan2f8_ha_l9: .byte 30 #2462.14 .byte 250 #2462.14 .cfi_startproc -..___tag_value___svml_atan2f8_ha_l9.177: +..___tag_value___jsvml_atan2f8_ha_l9.177: ..L178: #2170.1 pushq %rbp #2170.1 @@ -1536,42 +1536,42 @@ __svml_atan2f8_ha_l9: andq $-64, %rsp #2170.1 subq $256, %rsp #2170.1 xorl %edx, %edx #2298.5 - vmovups 192+__svml_satan2_ha_data_internal(%rip), %ymm10 #2283.53 - vmovups 1728+__svml_satan2_ha_data_internal(%rip), %ymm9 #2291.26 - vmovups 1792+__svml_satan2_ha_data_internal(%rip), %ymm2 #2292.26 + vmovups 192+__jsvml_satan2_ha_data_internal(%rip), %ymm10 #2283.53 + vmovups 1728+__jsvml_satan2_ha_data_internal(%rip), %ymm9 #2291.26 + vmovups 1792+__jsvml_satan2_ha_data_internal(%rip), %ymm2 #2292.26 vmovups %ymm0, (%rsp) #2170.1[spill] vmovaps %ymm1, %ymm12 #2170.1 vandps %ymm10, %ymm12, %ymm11 #2284.14 vandps %ymm10, %ymm0, %ymm10 #2285.14 vxorps %ymm11, %ymm12, %ymm3 #2287.14 vmovups %ymm3, 32(%rsp) #2287.14[spill] - vmulps 576+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm5 #2307.16 + vmulps 576+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm5 #2307.16 vpsubd %ymm9, %ymm11, %ymm6 #2293.18 vpsubd %ymm9, %ymm10, %ymm3 #2294.18 - vmulps 384+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm9 #2304.16 + vmulps 384+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm9 #2304.16 vpcmpgtd %ymm2, %ymm6, %ymm8 #2295.35 vpcmpeqd %ymm2, %ymm6, %ymm4 #2295.89 vpcmpgtd %ymm2, %ymm3, %ymm14 #2296.35 vpcmpeqd %ymm2, %ymm3, %ymm1 #2296.89 vpor %ymm4, %ymm8, %ymm13 #2295.18 vpor %ymm1, %ymm14, %ymm15 #2296.18 - vmulps 448+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm6 #2305.16 - vmulps 512+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm8 #2306.16 - vmovups 640+__svml_satan2_ha_data_internal(%rip), %ymm2 #2329.50 + vmulps 448+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm6 #2305.16 + vmulps 512+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm8 #2306.16 + vmovups 640+__jsvml_satan2_ha_data_internal(%rip), %ymm2 #2329.50 vxorps %ymm10, %ymm0, %ymm7 #2288.14 vmovups %ymm7, 64(%rsp) #2288.14[spill] vpor %ymm15, %ymm13, %ymm7 #2297.19 vmovdqu %ymm7, 96(%rsp) #2297.19[spill] vpcmpgtd %ymm5, %ymm10, %ymm7 #2316.22 - vpxor 1600+__svml_satan2_ha_data_internal(%rip), %ymm7, %ymm3 #2321.22 + vpxor 1600+__jsvml_satan2_ha_data_internal(%rip), %ymm7, %ymm3 #2321.22 vpcmpgtd %ymm10, %ymm6, %ymm0 #2314.22 vpcmpgtd %ymm10, %ymm8, %ymm4 #2315.22 vpcmpgtd %ymm10, %ymm9, %ymm1 #2313.22 vpandn %ymm4, %ymm0, %ymm6 #2320.23 vpandn %ymm3, %ymm4, %ymm9 #2322.23 vpandn %ymm0, %ymm1, %ymm8 #2318.23 - vmovups 704+__svml_satan2_ha_data_internal(%rip), %ymm3 #2330.50 - vmovups 768+__svml_satan2_ha_data_internal(%rip), %ymm4 #2337.18 + vmovups 704+__jsvml_satan2_ha_data_internal(%rip), %ymm3 #2330.50 + vmovups 768+__jsvml_satan2_ha_data_internal(%rip), %ymm4 #2337.18 vmovaps %ymm2, %ymm14 #2333.18 vmovaps %ymm3, %ymm15 #2335.18 vmovaps %ymm4, %ymm5 #2337.18 @@ -1585,7 +1585,7 @@ __svml_atan2f8_ha_l9: vandps %ymm8, %ymm14, %ymm14 #2334.18 vandps %ymm6, %ymm15, %ymm0 #2336.18 vandps %ymm9, %ymm5, %ymm5 #2338.18 - vxorps 128+__svml_satan2_ha_data_internal(%rip), %ymm11, %ymm15 #2339.18 + vxorps 128+__jsvml_satan2_ha_data_internal(%rip), %ymm11, %ymm15 #2339.18 vorps %ymm14, %ymm13, %ymm13 #2341.18 vorps %ymm5, %ymm0, %ymm14 #2342.18 vandps %ymm7, %ymm15, %ymm15 #2340.18 @@ -1600,14 +1600,14 @@ __svml_atan2f8_ha_l9: vandps %ymm7, %ymm10, %ymm15 #2352.18 vorps %ymm2, %ymm3, %ymm14 #2355.18 vorps %ymm15, %ymm14, %ymm4 #2356.17 - vandps 1088+__svml_satan2_ha_data_internal(%rip), %ymm9, %ymm0 #2363.18 - vandps 1216+__svml_satan2_ha_data_internal(%rip), %ymm7, %ymm3 #2364.18 + vandps 1088+__jsvml_satan2_ha_data_internal(%rip), %ymm9, %ymm0 #2363.18 + vandps 1216+__jsvml_satan2_ha_data_internal(%rip), %ymm7, %ymm3 #2364.18 vorps %ymm3, %ymm0, %ymm14 #2366.18 vrcpps %ymm4, %ymm3 #2368.18 - vandps 832+__svml_satan2_ha_data_internal(%rip), %ymm8, %ymm1 #2361.18 - vandps 960+__svml_satan2_ha_data_internal(%rip), %ymm6, %ymm13 #2362.18 + vandps 832+__jsvml_satan2_ha_data_internal(%rip), %ymm8, %ymm1 #2361.18 + vandps 960+__jsvml_satan2_ha_data_internal(%rip), %ymm6, %ymm13 #2362.18 vorps %ymm13, %ymm1, %ymm2 #2365.18 - vmovups 64+__svml_satan2_ha_data_internal(%rip), %ymm13 #2369.25 + vmovups 64+__jsvml_satan2_ha_data_internal(%rip), %ymm13 #2369.25 vfnmadd231ps %ymm3, %ymm4, %ymm13 #2369.25 vfmadd213ps %ymm13, %ymm13, %ymm13 #2370.25 vfmadd213ps %ymm3, %ymm13, %ymm3 #2371.22 @@ -1617,27 +1617,27 @@ __svml_atan2f8_ha_l9: vfnmadd213ps %ymm5, %ymm15, %ymm2 #2373.19 vfmadd213ps %ymm15, %ymm3, %ymm2 #2374.19 vfnmadd213ps %ymm5, %ymm2, %ymm4 #2375.19 - vmovups 1408+__svml_satan2_ha_data_internal(%rip), %ymm5 #2398.50 + vmovups 1408+__jsvml_satan2_ha_data_internal(%rip), %ymm5 #2398.50 vmulps %ymm4, %ymm3, %ymm15 #2376.19 - vandps 1152+__svml_satan2_ha_data_internal(%rip), %ymm9, %ymm9 #2383.18 - vandps 1280+__svml_satan2_ha_data_internal(%rip), %ymm7, %ymm7 #2384.18 + vandps 1152+__jsvml_satan2_ha_data_internal(%rip), %ymm9, %ymm9 #2383.18 + vandps 1280+__jsvml_satan2_ha_data_internal(%rip), %ymm7, %ymm7 #2384.18 vorps %ymm7, %ymm9, %ymm3 #2386.18 vmulps %ymm2, %ymm2, %ymm7 #2395.14 - vandps 896+__svml_satan2_ha_data_internal(%rip), %ymm8, %ymm8 #2381.18 - vandps 1024+__svml_satan2_ha_data_internal(%rip), %ymm6, %ymm6 #2382.18 + vandps 896+__jsvml_satan2_ha_data_internal(%rip), %ymm8, %ymm8 #2381.18 + vandps 1024+__jsvml_satan2_ha_data_internal(%rip), %ymm6, %ymm6 #2382.18 vorps %ymm6, %ymm8, %ymm4 #2385.18 vmulps %ymm7, %ymm7, %ymm6 #2396.14 - vmovups 1344+__svml_satan2_ha_data_internal(%rip), %ymm8 #2401.14 - vfmadd213ps 1472+__svml_satan2_ha_data_internal(%rip), %ymm6, %ymm8 #2401.14 - vfmadd213ps 1536+__svml_satan2_ha_data_internal(%rip), %ymm5, %ymm6 #2402.14 + vmovups 1344+__jsvml_satan2_ha_data_internal(%rip), %ymm8 #2401.14 + vfmadd213ps 1472+__jsvml_satan2_ha_data_internal(%rip), %ymm6, %ymm8 #2401.14 + vfmadd213ps 1536+__jsvml_satan2_ha_data_internal(%rip), %ymm5, %ymm6 #2402.14 vorps %ymm3, %ymm4, %ymm14 #2387.17 - vmovups __svml_satan2_ha_data_internal(%rip), %ymm4 #2389.49 + vmovups __jsvml_satan2_ha_data_internal(%rip), %ymm4 #2389.49 vfmadd213ps %ymm6, %ymm7, %ymm8 #2403.13 vmovups 32(%rsp), %ymm3 #2405.16[spill] vcmplt_oqps %ymm4, %ymm12, %ymm0 #2392.20 vaddps %ymm15, %ymm14, %ymm13 #2388.19 - vandps 320+__svml_satan2_ha_data_internal(%rip), %ymm0, %ymm9 #2394.20 - vandps 256+__svml_satan2_ha_data_internal(%rip), %ymm0, %ymm14 #2393.20 + vandps 320+__jsvml_satan2_ha_data_internal(%rip), %ymm0, %ymm9 #2394.20 + vandps 256+__jsvml_satan2_ha_data_internal(%rip), %ymm0, %ymm14 #2393.20 vmulps %ymm8, %ymm7, %ymm0 #2404.13 vxorps %ymm3, %ymm9, %ymm15 #2405.16 vaddps %ymm13, %ymm15, %ymm13 #2406.19 @@ -1717,10 +1717,10 @@ __svml_atan2f8_ha_l9: lea 64(%rsp,%r12,4), %rdi #2465.663 lea 128(%rsp,%r12,4), %rsi #2465.663 lea 192(%rsp,%r12,4), %rdx #2465.663 -..___tag_value___svml_atan2f8_ha_l9.203: -# __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_satan2_ha_cout_rare_internal #2465.663 -..___tag_value___svml_atan2f8_ha_l9.204: +..___tag_value___jsvml_atan2f8_ha_l9.203: +# __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_satan2_ha_cout_rare_internal #2465.663 +..___tag_value___jsvml_atan2f8_ha_l9.204: jmp ..B6.9 # Prob 100% #2465.663 .cfi_restore 12 .cfi_restore 13 @@ -1735,14 +1735,14 @@ __svml_atan2f8_ha_l9: vpcmpeqd %ymm4, %ymm10, %ymm9 #2440.20 vblendvps %ymm5, %ymm11, %ymm10, %ymm10 #2450.21 vpor %ymm9, %ymm8, %ymm13 #2441.22 - vandnps 1856+__svml_satan2_ha_data_internal(%rip), %ymm5, %ymm11 #2451.24 + vandnps 1856+__jsvml_satan2_ha_data_internal(%rip), %ymm5, %ymm11 #2451.24 vcmpeqps %ymm4, %ymm10, %ymm5 #2452.17 vandps %ymm7, %ymm6, %ymm14 #2436.20 vpand %ymm14, %ymm13, %ymm1 #2442.28 vblendvps %ymm5, %ymm4, %ymm11, %ymm6 #2453.16 vpandn %ymm15, %ymm1, %ymm15 #2443.21 vpcmpgtd %ymm12, %ymm4, %ymm4 #2456.22 - vandps 1920+__svml_satan2_ha_data_internal(%rip), %ymm4, %ymm4 #2458.18 + vandps 1920+__jsvml_satan2_ha_data_internal(%rip), %ymm4, %ymm4 #2458.18 vorps %ymm3, %ymm6, %ymm3 #2454.13 vaddps %ymm4, %ymm3, %ymm3 #2459.17 vorps %ymm2, %ymm3, %ymm2 #2460.19 @@ -1753,21 +1753,21 @@ __svml_atan2f8_ha_l9: # LOE rbx r12 r13 r14 r15 edx ymm0 ymm12 .cfi_endproc # mark_end; - .type __svml_atan2f8_ha_l9,@function - .size __svml_atan2f8_ha_l9,.-__svml_atan2f8_ha_l9 -..LN__svml_atan2f8_ha_l9.5: + .type __jsvml_atan2f8_ha_l9,@function + .size __jsvml_atan2f8_ha_l9,.-__jsvml_atan2f8_ha_l9 +..LN__jsvml_atan2f8_ha_l9.5: .data -# -- End __svml_atan2f8_ha_l9 +# -- End __jsvml_atan2f8_ha_l9 .text -.L_2__routine_start___svml_satan2_ha_cout_rare_internal_6: -# -- Begin __svml_satan2_ha_cout_rare_internal +.L_2__routine_start___jsvml_satan2_ha_cout_rare_internal_6: +# -- Begin __jsvml_satan2_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_satan2_ha_cout_rare_internal - .globl __svml_satan2_ha_cout_rare_internal -# --- __svml_satan2_ha_cout_rare_internal(const float *, const float *, float *) -__svml_satan2_ha_cout_rare_internal: + .hidden __jsvml_satan2_ha_cout_rare_internal + .globl __jsvml_satan2_ha_cout_rare_internal +# --- __jsvml_satan2_ha_cout_rare_internal(const float *, const float *, float *) +__jsvml_satan2_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -1778,7 +1778,7 @@ __svml_satan2_ha_cout_rare_internal: .byte 30 #614.79 .byte 250 #614.79 .cfi_startproc -..___tag_value___svml_satan2_ha_cout_rare_internal.209: +..___tag_value___jsvml_satan2_ha_cout_rare_internal.209: ..L210: #391.1 pxor %xmm1, %xmm1 #404.12 @@ -2769,11 +2769,11 @@ __svml_satan2_ha_cout_rare_internal: # LOE rbx rbp r8 r12 r13 r14 r15 edi r9d dl cl xmm2 xmm3 .cfi_endproc # mark_end; - .type __svml_satan2_ha_cout_rare_internal,@function - .size __svml_satan2_ha_cout_rare_internal,.-__svml_satan2_ha_cout_rare_internal -..LN__svml_satan2_ha_cout_rare_internal.6: + .type __jsvml_satan2_ha_cout_rare_internal,@function + .size __jsvml_satan2_ha_cout_rare_internal,.-__jsvml_satan2_ha_cout_rare_internal +..LN__jsvml_satan2_ha_cout_rare_internal.6: .data -# -- End __svml_satan2_ha_cout_rare_internal +# -- End __jsvml_satan2_ha_cout_rare_internal .data .align 64 .align 64 @@ -2785,9 +2785,9 @@ ione: .section .rodata, "a" .align 64 .align 64 - .hidden __svml_satan2_ha_data_internal - .globl __svml_satan2_ha_data_internal -__svml_satan2_ha_data_internal: + .hidden __jsvml_satan2_ha_data_internal + .globl __jsvml_satan2_ha_data_internal +__jsvml_satan2_ha_data_internal: .long 0 .long 0 .long 0 @@ -3284,8 +3284,8 @@ __svml_satan2_ha_data_internal: .long 1078530011 .long 1078530011 .long 1078530011 - .type __svml_satan2_ha_data_internal,@object - .size __svml_satan2_ha_data_internal,1984 + .type __jsvml_satan2_ha_data_internal,@object + .size __jsvml_satan2_ha_data_internal,1984 .align 32 _vmldAtanHATab: .long 3892314112 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_atan_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_atan_linux_x86.S similarity index 86% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_atan_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_atan_linux_x86.S index 9aa38bb1eca..ec5173b3c6e 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_atan_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_atan_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_atan.c" .text ..TXTST0: -.L_2__routine_start___svml_atanf8_ha_e9_0: -# -- Begin __svml_atanf8_ha_e9 +.L_2__routine_start___jsvml_atanf8_ha_e9_0: +# -- Begin __jsvml_atanf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atanf8_ha_e9 -# --- __svml_atanf8_ha_e9(__m256) -__svml_atanf8_ha_e9: + .globl __jsvml_atanf8_ha_e9 +# --- __jsvml_atanf8_ha_e9(__m256) +__jsvml_atanf8_ha_e9: # parameter 1: %ymm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_atanf8_ha_e9: .byte 30 #402.546 .byte 250 #402.546 .cfi_startproc -..___tag_value___svml_atanf8_ha_e9.1: +..___tag_value___jsvml_atanf8_ha_e9.1: ..L2: #221.1 pushq %rbp #221.1 @@ -58,11 +58,11 @@ __svml_atanf8_ha_e9: andq $-64, %rsp #221.1 subq $192, %rsp #221.1 vmovaps %ymm0, %ymm9 #221.1 - vandps 192+__svml_satan_ha_data_internal(%rip), %ymm9, %ymm7 #290.14 - vmovups 1920+__svml_satan_ha_data_internal(%rip), %xmm10 #294.30 - vmovups 1984+__svml_satan_ha_data_internal(%rip), %xmm11 #295.30 - vmovups 320+__svml_satan_ha_data_internal(%rip), %xmm0 #300.28 - vandps 128+__svml_satan_ha_data_internal(%rip), %ymm9, %ymm8 #292.14 + vandps 192+__jsvml_satan_ha_data_internal(%rip), %ymm9, %ymm7 #290.14 + vmovups 1920+__jsvml_satan_ha_data_internal(%rip), %xmm10 #294.30 + vmovups 1984+__jsvml_satan_ha_data_internal(%rip), %xmm11 #295.30 + vmovups 320+__jsvml_satan_ha_data_internal(%rip), %xmm0 #300.28 + vandps 128+__jsvml_satan_ha_data_internal(%rip), %ymm9, %ymm8 #292.14 vpsubd %xmm10, %xmm7, %xmm1 #296.22 vextractf128 $1, %ymm7, %xmm2 #293.125 vpcmpgtd %xmm11, %xmm1, %xmm3 #297.36 @@ -73,13 +73,13 @@ __svml_atanf8_ha_e9: vpcmpeqd %xmm11, %xmm5, %xmm13 #297.245 vpor %xmm13, %xmm12, %xmm14 #297.172 vpxor %xmm10, %xmm10, %xmm10 #298.62 - vmovups 256+__svml_satan_ha_data_internal(%rip), %xmm4 #299.28 + vmovups 256+__jsvml_satan_ha_data_internal(%rip), %xmm4 #299.28 vpcmpgtd %xmm2, %xmm0, %xmm11 #306.94 vpackssdw %xmm14, %xmm6, %xmm15 #298.79 vpcmpgtd %xmm7, %xmm4, %xmm5 #305.26 - vmovups 384+__svml_satan_ha_data_internal(%rip), %xmm6 #301.28 + vmovups 384+__jsvml_satan_ha_data_internal(%rip), %xmm6 #301.28 vpcmpgtd %xmm2, %xmm4, %xmm4 #305.94 - vmovups 448+__svml_satan_ha_data_internal(%rip), %xmm3 #302.28 + vmovups 448+__jsvml_satan_ha_data_internal(%rip), %xmm3 #302.28 vpcmpgtd %xmm7, %xmm6, %xmm13 #307.26 vpacksswb %xmm10, %xmm15, %xmm1 #298.62 vpcmpgtd %xmm7, %xmm0, %xmm10 #306.26 @@ -87,7 +87,7 @@ __svml_atanf8_ha_e9: vpcmpgtd %xmm3, %xmm7, %xmm15 #308.26 vpmovmskb %xmm1, %edx #298.43 vpcmpgtd %xmm3, %xmm2, %xmm1 #308.94 - vmovups 1728+__svml_satan_ha_data_internal(%rip), %xmm12 #303.30 + vmovups 1728+__jsvml_satan_ha_data_internal(%rip), %xmm12 #303.30 vpandn %xmm11, %xmm4, %xmm3 #310.97 vpandn %xmm14, %xmm11, %xmm11 #312.97 vpandn %xmm10, %xmm5, %xmm2 #310.27 @@ -102,9 +102,9 @@ __svml_atanf8_ha_e9: vinsertf128 $1, %xmm3, %ymm2, %ymm5 #316.21 vinsertf128 $1, %xmm14, %ymm13, %ymm3 #318.21 vinsertf128 $1, %xmm1, %ymm15, %ymm1 #319.21 - vmovups 768+__svml_satan_ha_data_internal(%rip), %ymm15 #321.50 - vmovups 832+__svml_satan_ha_data_internal(%rip), %ymm14 #322.50 - vmovups 896+__svml_satan_ha_data_internal(%rip), %ymm13 #323.50 + vmovups 768+__jsvml_satan_ha_data_internal(%rip), %ymm15 #321.50 + vmovups 832+__jsvml_satan_ha_data_internal(%rip), %ymm14 #322.50 + vmovups 896+__jsvml_satan_ha_data_internal(%rip), %ymm13 #323.50 vsubps %ymm15, %ymm7, %ymm0 #325.18 vsubps %ymm14, %ymm7, %ymm10 #327.18 vsubps %ymm13, %ymm7, %ymm2 #329.18 @@ -117,8 +117,8 @@ __svml_atanf8_ha_e9: vorps %ymm11, %ymm12, %ymm11 #333.18 vorps %ymm2, %ymm10, %ymm12 #334.18 vorps %ymm12, %ymm11, %ymm10 #335.18 - vmovups __svml_satan_ha_data_internal(%rip), %ymm12 #338.18 - vandps 64+__svml_satan_ha_data_internal(%rip), %ymm1, %ymm0 #332.18 + vmovups __jsvml_satan_ha_data_internal(%rip), %ymm12 #338.18 + vandps 64+__jsvml_satan_ha_data_internal(%rip), %ymm1, %ymm0 #332.18 vorps %ymm0, %ymm10, %ymm10 #336.17 vandps %ymm6, %ymm12, %ymm6 #338.18 vcvtps2pd %xmm10, %ymm0 #337.27 @@ -135,15 +135,15 @@ __svml_atanf8_ha_e9: vorps %ymm13, %ymm10, %ymm10 #347.18 vorps %ymm10, %ymm7, %ymm11 #348.18 vorps %ymm12, %ymm11, %ymm6 #349.17 - vandps 960+__svml_satan_ha_data_internal(%rip), %ymm5, %ymm13 #355.18 - vandps 1088+__svml_satan_ha_data_internal(%rip), %ymm4, %ymm14 #356.18 - vandps 1216+__svml_satan_ha_data_internal(%rip), %ymm3, %ymm10 #357.18 - vandps 1344+__svml_satan_ha_data_internal(%rip), %ymm1, %ymm11 #358.18 - vandps 1024+__svml_satan_ha_data_internal(%rip), %ymm5, %ymm5 #379.18 - vandps 1152+__svml_satan_ha_data_internal(%rip), %ymm4, %ymm4 #380.18 + vandps 960+__jsvml_satan_ha_data_internal(%rip), %ymm5, %ymm13 #355.18 + vandps 1088+__jsvml_satan_ha_data_internal(%rip), %ymm4, %ymm14 #356.18 + vandps 1216+__jsvml_satan_ha_data_internal(%rip), %ymm3, %ymm10 #357.18 + vandps 1344+__jsvml_satan_ha_data_internal(%rip), %ymm1, %ymm11 #358.18 + vandps 1024+__jsvml_satan_ha_data_internal(%rip), %ymm5, %ymm5 #379.18 + vandps 1152+__jsvml_satan_ha_data_internal(%rip), %ymm4, %ymm4 #380.18 vorps %ymm4, %ymm5, %ymm4 #383.18 - vandps 1280+__svml_satan_ha_data_internal(%rip), %ymm3, %ymm3 #381.18 - vandps 1408+__svml_satan_ha_data_internal(%rip), %ymm1, %ymm1 #382.18 + vandps 1280+__jsvml_satan_ha_data_internal(%rip), %ymm3, %ymm3 #381.18 + vandps 1408+__jsvml_satan_ha_data_internal(%rip), %ymm1, %ymm1 #382.18 vorps %ymm1, %ymm3, %ymm1 #384.18 vcvtps2pd %xmm6, %ymm15 #350.27 vextractf128 $1, %ymm6, %xmm7 #350.109 @@ -156,7 +156,7 @@ __svml_atanf8_ha_e9: vextractf128 $1, %ymm6, %xmm11 #363.112 vmulpd %ymm14, %ymm15, %ymm15 #365.53 vcvtps2pd %xmm11, %ymm7 #363.95 - vmovupd 1856+__svml_satan_ha_data_internal(%rip), %ymm11 #364.59 + vmovupd 1856+__jsvml_satan_ha_data_internal(%rip), %ymm11 #364.59 vmulpd %ymm7, %ymm12, %ymm12 #365.130 vsubpd %ymm15, %ymm11, %ymm6 #365.27 vsubpd %ymm12, %ymm11, %ymm13 #365.104 @@ -172,7 +172,7 @@ __svml_atanf8_ha_e9: vmulpd %ymm11, %ymm7, %ymm7 #368.72 vmulpd %ymm12, %ymm0, %ymm11 #369.23 vmulpd %ymm7, %ymm2, %ymm0 #369.68 - vmovupd 1792+__svml_satan_ha_data_internal(%rip), %ymm2 #370.62 + vmovupd 1792+__jsvml_satan_ha_data_internal(%rip), %ymm2 #370.62 vandpd %ymm2, %ymm11, %ymm7 #371.21 vandpd %ymm2, %ymm0, %ymm12 #371.77 vcvtpd2ps %ymm7, %xmm2 #372.65 @@ -184,11 +184,11 @@ __svml_atanf8_ha_e9: vcvtpd2ps %ymm11, %xmm0 #374.65 vmulps %ymm14, %ymm14, %ymm5 #388.14 vcvtpd2ps %ymm6, %xmm7 #374.101 - vmulps 1472+__svml_satan_ha_data_internal(%rip), %ymm5, %ymm3 #393.29 - vmulps 1536+__svml_satan_ha_data_internal(%rip), %ymm5, %ymm6 #394.29 - vaddps 1664+__svml_satan_ha_data_internal(%rip), %ymm6, %ymm12 #394.14 + vmulps 1472+__jsvml_satan_ha_data_internal(%rip), %ymm5, %ymm3 #393.29 + vmulps 1536+__jsvml_satan_ha_data_internal(%rip), %ymm5, %ymm6 #394.29 + vaddps 1664+__jsvml_satan_ha_data_internal(%rip), %ymm6, %ymm12 #394.14 vinsertf128 $1, %xmm7, %ymm0, %ymm11 #374.19 - vaddps 1600+__svml_satan_ha_data_internal(%rip), %ymm3, %ymm7 #393.14 + vaddps 1600+__jsvml_satan_ha_data_internal(%rip), %ymm3, %ymm7 #393.14 vmulps %ymm7, %ymm14, %ymm13 #395.28 vaddps %ymm13, %ymm12, %ymm15 #395.13 vmulps %ymm15, %ymm14, %ymm3 #396.13 @@ -259,29 +259,29 @@ __svml_atanf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #402.546 lea 128(%rsp,%r12,4), %rsi #402.546 -..___tag_value___svml_atanf8_ha_e9.19: -# __svml_satan_ha_cout_rare_internal(const float *, float *) - call __svml_satan_ha_cout_rare_internal #402.546 -..___tag_value___svml_atanf8_ha_e9.20: +..___tag_value___jsvml_atanf8_ha_e9.19: +# __jsvml_satan_ha_cout_rare_internal(const float *, float *) + call __jsvml_satan_ha_cout_rare_internal #402.546 +..___tag_value___jsvml_atanf8_ha_e9.20: jmp ..B1.8 # Prob 100% #402.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atanf8_ha_e9,@function - .size __svml_atanf8_ha_e9,.-__svml_atanf8_ha_e9 -..LN__svml_atanf8_ha_e9.0: + .type __jsvml_atanf8_ha_e9,@function + .size __jsvml_atanf8_ha_e9,.-__jsvml_atanf8_ha_e9 +..LN__jsvml_atanf8_ha_e9.0: .data -# -- End __svml_atanf8_ha_e9 +# -- End __jsvml_atanf8_ha_e9 .text -.L_2__routine_start___svml_atanf4_ha_e9_1: -# -- Begin __svml_atanf4_ha_e9 +.L_2__routine_start___jsvml_atanf4_ha_e9_1: +# -- Begin __jsvml_atanf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_atanf4_ha_e9 -# --- __svml_atanf4_ha_e9(__m128) -__svml_atanf4_ha_e9: + .globl __jsvml_atanf4_ha_e9 +# --- __jsvml_atanf4_ha_e9(__m128) +__jsvml_atanf4_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -290,7 +290,7 @@ __svml_atanf4_ha_e9: .byte 30 #591.540 .byte 250 #591.540 .cfi_startproc -..___tag_value___svml_atanf4_ha_e9.22: +..___tag_value___jsvml_atanf4_ha_e9.22: ..L23: #410.1 pushq %rbp #410.1 @@ -301,28 +301,28 @@ __svml_atanf4_ha_e9: andq $-64, %rsp #410.1 subq $192, %rsp #410.1 vmovaps %xmm0, %xmm11 #410.1 - vandps 192+__svml_satan_ha_data_internal(%rip), %xmm11, %xmm3 #479.14 - vmovups 1984+__svml_satan_ha_data_internal(%rip), %xmm9 #484.30 - vpsubd 1920+__svml_satan_ha_data_internal(%rip), %xmm3, %xmm7 #485.22 + vandps 192+__jsvml_satan_ha_data_internal(%rip), %xmm11, %xmm3 #479.14 + vmovups 1984+__jsvml_satan_ha_data_internal(%rip), %xmm9 #484.30 + vpsubd 1920+__jsvml_satan_ha_data_internal(%rip), %xmm3, %xmm7 #485.22 vpcmpgtd %xmm9, %xmm7, %xmm6 #486.36 vpcmpeqd %xmm9, %xmm7, %xmm8 #486.95 - vmovups 256+__svml_satan_ha_data_internal(%rip), %xmm2 #488.28 + vmovups 256+__jsvml_satan_ha_data_internal(%rip), %xmm2 #488.28 vpor %xmm8, %xmm6, %xmm4 #486.22 - vmovups 320+__svml_satan_ha_data_internal(%rip), %xmm1 #489.28 + vmovups 320+__jsvml_satan_ha_data_internal(%rip), %xmm1 #489.28 vpcmpgtd %xmm3, %xmm2, %xmm0 #494.26 - vmovups 384+__svml_satan_ha_data_internal(%rip), %xmm13 #490.28 + vmovups 384+__jsvml_satan_ha_data_internal(%rip), %xmm13 #490.28 vpcmpgtd %xmm3, %xmm1, %xmm12 #495.26 - vpcmpgtd 448+__svml_satan_ha_data_internal(%rip), %xmm3, %xmm7 #497.26 + vpcmpgtd 448+__jsvml_satan_ha_data_internal(%rip), %xmm3, %xmm7 #497.26 vpcmpgtd %xmm3, %xmm13, %xmm9 #496.26 vmovmskps %xmm4, %edx #487.44 vpandn %xmm9, %xmm12, %xmm6 #501.27 - vpxor 1728+__svml_satan_ha_data_internal(%rip), %xmm7, %xmm5 #502.26 + vpxor 1728+__jsvml_satan_ha_data_internal(%rip), %xmm7, %xmm5 #502.26 vpandn %xmm12, %xmm0, %xmm8 #499.27 - vmovups 768+__svml_satan_ha_data_internal(%rip), %xmm1 #510.47 + vmovups 768+__jsvml_satan_ha_data_internal(%rip), %xmm1 #510.47 vpandn %xmm5, %xmm9, %xmm9 #503.27 - vmovups 832+__svml_satan_ha_data_internal(%rip), %xmm2 #511.47 + vmovups 832+__jsvml_satan_ha_data_internal(%rip), %xmm2 #511.47 vandps %xmm0, %xmm3, %xmm14 #513.18 - vmovups 896+__svml_satan_ha_data_internal(%rip), %xmm4 #512.47 + vmovups 896+__jsvml_satan_ha_data_internal(%rip), %xmm4 #512.47 vsubps %xmm1, %xmm3, %xmm15 #514.18 vsubps %xmm2, %xmm3, %xmm13 #516.18 vmulps %xmm2, %xmm3, %xmm2 #530.30 @@ -334,10 +334,10 @@ __svml_atanf4_ha_e9: vorps %xmm12, %xmm14, %xmm14 #522.18 vorps %xmm5, %xmm13, %xmm12 #523.18 vorps %xmm12, %xmm14, %xmm13 #524.18 - vmovups __svml_satan_ha_data_internal(%rip), %xmm14 #527.18 + vmovups __jsvml_satan_ha_data_internal(%rip), %xmm14 #527.18 vandps %xmm0, %xmm14, %xmm12 #527.18 vmulps %xmm1, %xmm3, %xmm0 #528.30 - vandps 64+__svml_satan_ha_data_internal(%rip), %xmm7, %xmm15 #521.18 + vandps 64+__jsvml_satan_ha_data_internal(%rip), %xmm7, %xmm15 #521.18 vaddps %xmm0, %xmm14, %xmm1 #528.18 vorps %xmm15, %xmm13, %xmm15 #525.17 vandps %xmm8, %xmm1, %xmm13 #529.18 @@ -350,34 +350,34 @@ __svml_atanf4_ha_e9: vorps %xmm13, %xmm12, %xmm3 #535.18 vorps %xmm0, %xmm15, %xmm13 #536.18 vorps %xmm13, %xmm3, %xmm12 #537.18 - vandps 960+__svml_satan_ha_data_internal(%rip), %xmm8, %xmm0 #544.18 + vandps 960+__jsvml_satan_ha_data_internal(%rip), %xmm8, %xmm0 #544.18 vorps %xmm14, %xmm12, %xmm12 #538.17 - vandps 1088+__svml_satan_ha_data_internal(%rip), %xmm6, %xmm1 #545.18 + vandps 1088+__jsvml_satan_ha_data_internal(%rip), %xmm6, %xmm1 #545.18 vorps %xmm1, %xmm0, %xmm4 #548.18 vrcpps %xmm12, %xmm0 #551.22 vcvtps2pd %xmm12, %ymm14 #539.27 vcvtps2pd %xmm0, %ymm1 #552.28 - vandps 1216+__svml_satan_ha_data_internal(%rip), %xmm9, %xmm2 #546.18 - vandps 1344+__svml_satan_ha_data_internal(%rip), %xmm7, %xmm3 #547.18 + vandps 1216+__jsvml_satan_ha_data_internal(%rip), %xmm9, %xmm2 #546.18 + vandps 1344+__jsvml_satan_ha_data_internal(%rip), %xmm7, %xmm3 #547.18 vorps %xmm3, %xmm2, %xmm15 #549.18 vmulpd %ymm1, %ymm14, %ymm14 #554.49 vorps %xmm15, %xmm4, %xmm13 #550.17 - vmovupd 1856+__svml_satan_ha_data_internal(%rip), %ymm4 #553.57 - vandps 1024+__svml_satan_ha_data_internal(%rip), %xmm8, %xmm8 #568.18 - vandps 1152+__svml_satan_ha_data_internal(%rip), %xmm6, %xmm6 #569.18 - vandps 1280+__svml_satan_ha_data_internal(%rip), %xmm9, %xmm9 #570.18 + vmovupd 1856+__jsvml_satan_ha_data_internal(%rip), %ymm4 #553.57 + vandps 1024+__jsvml_satan_ha_data_internal(%rip), %xmm8, %xmm8 #568.18 + vandps 1152+__jsvml_satan_ha_data_internal(%rip), %xmm6, %xmm6 #569.18 + vandps 1280+__jsvml_satan_ha_data_internal(%rip), %xmm9, %xmm9 #570.18 vorps %xmm6, %xmm8, %xmm6 #572.18 - vandps 1408+__svml_satan_ha_data_internal(%rip), %xmm7, %xmm7 #571.18 + vandps 1408+__jsvml_satan_ha_data_internal(%rip), %xmm7, %xmm7 #571.18 vsubpd %ymm14, %ymm4, %ymm3 #554.25 vorps %xmm7, %xmm9, %xmm7 #573.18 - vandps 128+__svml_satan_ha_data_internal(%rip), %xmm11, %xmm10 #481.14 + vandps 128+__jsvml_satan_ha_data_internal(%rip), %xmm11, %xmm10 #481.14 vmulpd %ymm3, %ymm1, %ymm2 #555.40 vmulpd %ymm3, %ymm3, %ymm15 #556.36 vaddpd %ymm2, %ymm1, %ymm12 #555.25 vaddpd %ymm15, %ymm4, %ymm0 #556.21 vmulpd %ymm0, %ymm12, %ymm1 #557.21 vmulpd %ymm1, %ymm5, %ymm5 #558.21 - vandpd 1792+__svml_satan_ha_data_internal(%rip), %ymm5, %ymm0 #560.19 + vandpd 1792+__jsvml_satan_ha_data_internal(%rip), %ymm5, %ymm0 #560.19 vcvtpd2ps %ymm0, %xmm12 #561.19 vsubpd %ymm0, %ymm5, %ymm1 #562.19 vorps %xmm7, %xmm6, %xmm0 #574.17 @@ -385,10 +385,10 @@ __svml_atanf4_ha_e9: vcvtpd2ps %ymm1, %xmm2 #563.19 vmulps %xmm14, %xmm14, %xmm3 #577.14 vaddps %xmm0, %xmm2, %xmm0 #575.19 - vmulps 1472+__svml_satan_ha_data_internal(%rip), %xmm3, %xmm1 #582.26 - vmulps 1536+__svml_satan_ha_data_internal(%rip), %xmm3, %xmm4 #583.26 - vaddps 1600+__svml_satan_ha_data_internal(%rip), %xmm1, %xmm5 #582.14 - vaddps 1664+__svml_satan_ha_data_internal(%rip), %xmm4, %xmm8 #583.14 + vmulps 1472+__jsvml_satan_ha_data_internal(%rip), %xmm3, %xmm1 #582.26 + vmulps 1536+__jsvml_satan_ha_data_internal(%rip), %xmm3, %xmm4 #583.26 + vaddps 1600+__jsvml_satan_ha_data_internal(%rip), %xmm1, %xmm5 #582.14 + vaddps 1664+__jsvml_satan_ha_data_internal(%rip), %xmm4, %xmm8 #583.14 vmulps %xmm5, %xmm14, %xmm9 #584.25 vaddps %xmm9, %xmm8, %xmm15 #584.13 vmulps %xmm15, %xmm14, %xmm1 #585.13 @@ -460,29 +460,29 @@ __svml_atanf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #591.540 lea 128(%rsp,%r12,4), %rsi #591.540 -..___tag_value___svml_atanf4_ha_e9.40: -# __svml_satan_ha_cout_rare_internal(const float *, float *) - call __svml_satan_ha_cout_rare_internal #591.540 -..___tag_value___svml_atanf4_ha_e9.41: +..___tag_value___jsvml_atanf4_ha_e9.40: +# __jsvml_satan_ha_cout_rare_internal(const float *, float *) + call __jsvml_satan_ha_cout_rare_internal #591.540 +..___tag_value___jsvml_atanf4_ha_e9.41: jmp ..B2.8 # Prob 100% #591.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atanf4_ha_e9,@function - .size __svml_atanf4_ha_e9,.-__svml_atanf4_ha_e9 -..LN__svml_atanf4_ha_e9.1: + .type __jsvml_atanf4_ha_e9,@function + .size __jsvml_atanf4_ha_e9,.-__jsvml_atanf4_ha_e9 +..LN__jsvml_atanf4_ha_e9.1: .data -# -- End __svml_atanf4_ha_e9 +# -- End __jsvml_atanf4_ha_e9 .text -.L_2__routine_start___svml_atanf4_ha_l9_2: -# -- Begin __svml_atanf4_ha_l9 +.L_2__routine_start___jsvml_atanf4_ha_l9_2: +# -- Begin __jsvml_atanf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atanf4_ha_l9 -# --- __svml_atanf4_ha_l9(__m128) -__svml_atanf4_ha_l9: + .globl __jsvml_atanf4_ha_l9 +# --- __jsvml_atanf4_ha_l9(__m128) +__jsvml_atanf4_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -491,7 +491,7 @@ __svml_atanf4_ha_l9: .byte 30 #775.540 .byte 250 #775.540 .cfi_startproc -..___tag_value___svml_atanf4_ha_l9.43: +..___tag_value___jsvml_atanf4_ha_l9.43: ..L44: #599.1 pushq %rbp #599.1 @@ -502,28 +502,28 @@ __svml_atanf4_ha_l9: andq $-64, %rsp #599.1 subq $192, %rsp #599.1 vmovaps %xmm0, %xmm12 #599.1 - vandps 192+__svml_satan_ha_data_internal(%rip), %xmm12, %xmm3 #668.14 - vmovups 1984+__svml_satan_ha_data_internal(%rip), %xmm6 #673.26 - vpsubd 1920+__svml_satan_ha_data_internal(%rip), %xmm3, %xmm8 #674.18 + vandps 192+__jsvml_satan_ha_data_internal(%rip), %xmm12, %xmm3 #668.14 + vmovups 1984+__jsvml_satan_ha_data_internal(%rip), %xmm6 #673.26 + vpsubd 1920+__jsvml_satan_ha_data_internal(%rip), %xmm3, %xmm8 #674.18 vpcmpgtd %xmm6, %xmm8, %xmm7 #675.32 vpcmpeqd %xmm6, %xmm8, %xmm9 #675.83 - vmovups 256+__svml_satan_ha_data_internal(%rip), %xmm2 #677.24 + vmovups 256+__jsvml_satan_ha_data_internal(%rip), %xmm2 #677.24 vpor %xmm9, %xmm7, %xmm4 #675.18 - vmovups 320+__svml_satan_ha_data_internal(%rip), %xmm1 #678.24 + vmovups 320+__jsvml_satan_ha_data_internal(%rip), %xmm1 #678.24 vpcmpgtd %xmm3, %xmm2, %xmm0 #683.22 - vmovups 384+__svml_satan_ha_data_internal(%rip), %xmm14 #679.24 + vmovups 384+__jsvml_satan_ha_data_internal(%rip), %xmm14 #679.24 vpcmpgtd %xmm3, %xmm1, %xmm13 #684.22 - vpcmpgtd 448+__svml_satan_ha_data_internal(%rip), %xmm3, %xmm8 #686.22 + vpcmpgtd 448+__jsvml_satan_ha_data_internal(%rip), %xmm3, %xmm8 #686.22 vpcmpgtd %xmm3, %xmm14, %xmm6 #685.22 vmovmskps %xmm4, %edx #676.44 vpandn %xmm6, %xmm13, %xmm7 #690.23 - vpxor 1728+__svml_satan_ha_data_internal(%rip), %xmm8, %xmm10 #691.22 + vpxor 1728+__jsvml_satan_ha_data_internal(%rip), %xmm8, %xmm10 #691.22 vpandn %xmm13, %xmm0, %xmm9 #688.23 - vmovups 768+__svml_satan_ha_data_internal(%rip), %xmm1 #699.47 + vmovups 768+__jsvml_satan_ha_data_internal(%rip), %xmm1 #699.47 vpandn %xmm10, %xmm6, %xmm6 #692.23 - vmovups 832+__svml_satan_ha_data_internal(%rip), %xmm2 #700.47 + vmovups 832+__jsvml_satan_ha_data_internal(%rip), %xmm2 #700.47 vandps %xmm0, %xmm3, %xmm15 #702.18 - vmovups 896+__svml_satan_ha_data_internal(%rip), %xmm4 #701.47 + vmovups 896+__jsvml_satan_ha_data_internal(%rip), %xmm4 #701.47 vsubps %xmm1, %xmm3, %xmm5 #703.18 vsubps %xmm2, %xmm3, %xmm14 #705.18 vsubps %xmm4, %xmm3, %xmm10 #707.18 @@ -532,15 +532,15 @@ __svml_atanf4_ha_l9: vandps %xmm6, %xmm10, %xmm10 #708.18 vorps %xmm13, %xmm15, %xmm15 #711.18 vorps %xmm10, %xmm14, %xmm13 #712.18 - vandps 64+__svml_satan_ha_data_internal(%rip), %xmm8, %xmm5 #710.18 + vandps 64+__jsvml_satan_ha_data_internal(%rip), %xmm8, %xmm5 #710.18 vorps %xmm13, %xmm15, %xmm14 #713.18 vorps %xmm5, %xmm14, %xmm10 #714.17 - vmovups __svml_satan_ha_data_internal(%rip), %xmm5 #715.18 + vmovups __jsvml_satan_ha_data_internal(%rip), %xmm5 #715.18 vfmadd213ps %xmm5, %xmm3, %xmm1 #716.18 vandps %xmm0, %xmm5, %xmm15 #715.18 vfmadd213ps %xmm5, %xmm3, %xmm2 #718.18 vfmadd213ps %xmm5, %xmm3, %xmm4 #720.18 - vandps 128+__svml_satan_ha_data_internal(%rip), %xmm12, %xmm11 #670.14 + vandps 128+__jsvml_satan_ha_data_internal(%rip), %xmm12, %xmm11 #670.14 vandps %xmm9, %xmm1, %xmm13 #717.18 vandps %xmm8, %xmm3, %xmm1 #722.18 vandps %xmm7, %xmm2, %xmm14 #719.18 @@ -548,32 +548,32 @@ __svml_atanf4_ha_l9: vandps %xmm6, %xmm4, %xmm0 #721.18 vorps %xmm0, %xmm14, %xmm14 #724.18 vorps %xmm14, %xmm3, %xmm13 #725.18 - vandps 960+__svml_satan_ha_data_internal(%rip), %xmm9, %xmm0 #731.18 + vandps 960+__jsvml_satan_ha_data_internal(%rip), %xmm9, %xmm0 #731.18 vorps %xmm1, %xmm13, %xmm15 #726.17 - vandps 1088+__svml_satan_ha_data_internal(%rip), %xmm7, %xmm2 #732.18 + vandps 1088+__jsvml_satan_ha_data_internal(%rip), %xmm7, %xmm2 #732.18 vorps %xmm2, %xmm0, %xmm14 #735.18 vrcpps %xmm15, %xmm0 #738.18 vfnmadd231ps %xmm0, %xmm15, %xmm5 #741.21 - vandps 1216+__svml_satan_ha_data_internal(%rip), %xmm6, %xmm3 #733.18 - vandps 1344+__svml_satan_ha_data_internal(%rip), %xmm8, %xmm4 #734.18 + vandps 1216+__jsvml_satan_ha_data_internal(%rip), %xmm6, %xmm3 #733.18 + vandps 1344+__jsvml_satan_ha_data_internal(%rip), %xmm8, %xmm4 #734.18 vorps %xmm4, %xmm3, %xmm13 #736.18 vorps %xmm13, %xmm14, %xmm14 #737.17 vfmadd213ps %xmm5, %xmm5, %xmm5 #742.21 - vmovups 1472+__svml_satan_ha_data_internal(%rip), %xmm4 #762.47 - vmovups 1536+__svml_satan_ha_data_internal(%rip), %xmm1 #763.47 - vandps 1024+__svml_satan_ha_data_internal(%rip), %xmm9, %xmm9 #752.18 - vandps 1152+__svml_satan_ha_data_internal(%rip), %xmm7, %xmm7 #753.18 + vmovups 1472+__jsvml_satan_ha_data_internal(%rip), %xmm4 #762.47 + vmovups 1536+__jsvml_satan_ha_data_internal(%rip), %xmm1 #763.47 + vandps 1024+__jsvml_satan_ha_data_internal(%rip), %xmm9, %xmm9 #752.18 + vandps 1152+__jsvml_satan_ha_data_internal(%rip), %xmm7, %xmm7 #753.18 vfmadd213ps %xmm0, %xmm5, %xmm0 #743.22 - vandps 1280+__svml_satan_ha_data_internal(%rip), %xmm6, %xmm6 #754.18 - vandps 1408+__svml_satan_ha_data_internal(%rip), %xmm8, %xmm8 #755.18 + vandps 1280+__jsvml_satan_ha_data_internal(%rip), %xmm6, %xmm6 #754.18 + vandps 1408+__jsvml_satan_ha_data_internal(%rip), %xmm8, %xmm8 #755.18 vmulps %xmm0, %xmm10, %xmm13 #745.19 vmulps %xmm13, %xmm13, %xmm3 #760.14 vfnmadd213ps %xmm10, %xmm13, %xmm15 #746.19 vorps %xmm7, %xmm9, %xmm10 #756.18 vmulps %xmm3, %xmm3, %xmm2 #761.14 vmulps %xmm15, %xmm0, %xmm0 #747.19 - vfmadd213ps 1600+__svml_satan_ha_data_internal(%rip), %xmm2, %xmm4 #766.14 - vfmadd213ps 1664+__svml_satan_ha_data_internal(%rip), %xmm1, %xmm2 #767.14 + vfmadd213ps 1600+__jsvml_satan_ha_data_internal(%rip), %xmm2, %xmm4 #766.14 + vfmadd213ps 1664+__jsvml_satan_ha_data_internal(%rip), %xmm1, %xmm2 #767.14 vorps %xmm8, %xmm6, %xmm15 #757.18 vorps %xmm15, %xmm10, %xmm6 #758.17 vaddps %xmm0, %xmm6, %xmm5 #759.19 @@ -638,29 +638,29 @@ __svml_atanf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #775.540 lea 128(%rsp,%r12,4), %rsi #775.540 -..___tag_value___svml_atanf4_ha_l9.61: -# __svml_satan_ha_cout_rare_internal(const float *, float *) - call __svml_satan_ha_cout_rare_internal #775.540 -..___tag_value___svml_atanf4_ha_l9.62: +..___tag_value___jsvml_atanf4_ha_l9.61: +# __jsvml_satan_ha_cout_rare_internal(const float *, float *) + call __jsvml_satan_ha_cout_rare_internal #775.540 +..___tag_value___jsvml_atanf4_ha_l9.62: jmp ..B3.8 # Prob 100% #775.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atanf4_ha_l9,@function - .size __svml_atanf4_ha_l9,.-__svml_atanf4_ha_l9 -..LN__svml_atanf4_ha_l9.2: + .type __jsvml_atanf4_ha_l9,@function + .size __jsvml_atanf4_ha_l9,.-__jsvml_atanf4_ha_l9 +..LN__jsvml_atanf4_ha_l9.2: .data -# -- End __svml_atanf4_ha_l9 +# -- End __jsvml_atanf4_ha_l9 .text -.L_2__routine_start___svml_atanf4_ha_ex_3: -# -- Begin __svml_atanf4_ha_ex +.L_2__routine_start___jsvml_atanf4_ha_ex_3: +# -- Begin __jsvml_atanf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_atanf4_ha_ex -# --- __svml_atanf4_ha_ex(__m128) -__svml_atanf4_ha_ex: + .globl __jsvml_atanf4_ha_ex +# --- __jsvml_atanf4_ha_ex(__m128) +__jsvml_atanf4_ha_ex: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -669,7 +669,7 @@ __svml_atanf4_ha_ex: .byte 30 #964.540 .byte 250 #964.540 .cfi_startproc -..___tag_value___svml_atanf4_ha_ex.64: +..___tag_value___jsvml_atanf4_ha_ex.64: ..L65: #783.1 pushq %rbp #783.1 @@ -680,39 +680,39 @@ __svml_atanf4_ha_ex: andq $-64, %rsp #783.1 subq $192, %rsp #783.1 movaps %xmm0, %xmm10 #783.1 - movups 192+__svml_satan_ha_data_internal(%rip), %xmm14 #852.14 + movups 192+__jsvml_satan_ha_data_internal(%rip), %xmm14 #852.14 andps %xmm10, %xmm14 #852.14 movaps %xmm14, %xmm4 #858.16 movaps %xmm14, %xmm8 #887.18 - psubd 1920+__svml_satan_ha_data_internal(%rip), %xmm4 #858.16 + psubd 1920+__jsvml_satan_ha_data_internal(%rip), %xmm4 #858.16 movaps %xmm14, %xmm0 #889.18 - movdqu 1984+__svml_satan_ha_data_internal(%rip), %xmm6 #857.59 + movdqu 1984+__jsvml_satan_ha_data_internal(%rip), %xmm6 #857.59 movdqa %xmm4, %xmm5 #859.30 - movups 768+__svml_satan_ha_data_internal(%rip), %xmm12 #883.47 + movups 768+__jsvml_satan_ha_data_internal(%rip), %xmm12 #883.47 movaps %xmm14, %xmm2 #891.18 - movups 832+__svml_satan_ha_data_internal(%rip), %xmm15 #884.47 + movups 832+__jsvml_satan_ha_data_internal(%rip), %xmm15 #884.47 pcmpgtd %xmm6, %xmm5 #859.30 - movups 896+__svml_satan_ha_data_internal(%rip), %xmm13 #885.47 + movups 896+__jsvml_satan_ha_data_internal(%rip), %xmm13 #885.47 pcmpeqd %xmm6, %xmm4 #859.77 - movdqu 256+__svml_satan_ha_data_internal(%rip), %xmm1 #867.20 + movdqu 256+__jsvml_satan_ha_data_internal(%rip), %xmm1 #867.20 por %xmm4, %xmm5 #859.16 movaps %xmm14, %xmm6 #870.20 pcmpgtd %xmm14, %xmm1 #867.20 movmskps %xmm5, %edx #860.44 movdqa %xmm1, %xmm7 #872.21 - movdqu 320+__svml_satan_ha_data_internal(%rip), %xmm5 #868.20 + movdqu 320+__jsvml_satan_ha_data_internal(%rip), %xmm5 #868.20 movaps %xmm14, %xmm11 #886.18 - movdqu 384+__svml_satan_ha_data_internal(%rip), %xmm4 #869.20 + movdqu 384+__jsvml_satan_ha_data_internal(%rip), %xmm4 #869.20 pcmpgtd %xmm14, %xmm5 #868.20 - pcmpgtd 448+__svml_satan_ha_data_internal(%rip), %xmm6 #870.20 + pcmpgtd 448+__jsvml_satan_ha_data_internal(%rip), %xmm6 #870.20 pcmpgtd %xmm14, %xmm4 #869.20 - movdqu 1728+__svml_satan_ha_data_internal(%rip), %xmm3 #875.20 + movdqu 1728+__jsvml_satan_ha_data_internal(%rip), %xmm3 #875.20 pandn %xmm5, %xmm7 #872.21 pxor %xmm6, %xmm3 #875.20 pandn %xmm4, %xmm5 #874.21 pandn %xmm3, %xmm4 #876.21 andps %xmm1, %xmm11 #886.18 - movups 64+__svml_satan_ha_data_internal(%rip), %xmm3 #894.18 + movups 64+__jsvml_satan_ha_data_internal(%rip), %xmm3 #894.18 subps %xmm12, %xmm8 #887.18 mulps %xmm14, %xmm12 #901.30 subps %xmm15, %xmm0 #889.18 @@ -727,7 +727,7 @@ __svml_atanf4_ha_ex: andps %xmm6, %xmm14 #907.18 orps %xmm0, %xmm11 #897.18 andps %xmm6, %xmm3 #894.18 - movups __svml_satan_ha_data_internal(%rip), %xmm0 #900.18 + movups __jsvml_satan_ha_data_internal(%rip), %xmm0 #900.18 orps %xmm3, %xmm11 #898.17 andps %xmm0, %xmm1 #900.18 addps %xmm0, %xmm12 #901.18 @@ -748,12 +748,12 @@ __svml_atanf4_ha_ex: cvtps2pd %xmm12, %xmm2 #912.64 movhlps %xmm11, %xmm11 #899.78 cvtps2pd %xmm11, %xmm8 #899.64 - movups 960+__svml_satan_ha_data_internal(%rip), %xmm0 #917.18 - movups 1088+__svml_satan_ha_data_internal(%rip), %xmm11 #918.18 + movups 960+__jsvml_satan_ha_data_internal(%rip), %xmm0 #917.18 + movups 1088+__jsvml_satan_ha_data_internal(%rip), %xmm11 #918.18 andps %xmm7, %xmm0 #917.18 - movups 1216+__svml_satan_ha_data_internal(%rip), %xmm15 #919.18 + movups 1216+__jsvml_satan_ha_data_internal(%rip), %xmm15 #919.18 andps %xmm5, %xmm11 #918.18 - movups 1344+__svml_satan_ha_data_internal(%rip), %xmm12 #920.18 + movups 1344+__jsvml_satan_ha_data_internal(%rip), %xmm12 #920.18 andps %xmm4, %xmm15 #919.18 andps %xmm6, %xmm12 #920.18 orps %xmm11, %xmm0 #921.18 @@ -764,7 +764,7 @@ __svml_atanf4_ha_ex: cvtps2pd %xmm1, %xmm15 #925.67 mulpd %xmm11, %xmm13 #927.50 mulpd %xmm15, %xmm2 #927.121 - movups 1856+__svml_satan_ha_data_internal(%rip), %xmm14 #926.56 + movups 1856+__jsvml_satan_ha_data_internal(%rip), %xmm14 #926.56 movaps %xmm14, %xmm12 #927.27 subpd %xmm13, %xmm12 #927.27 movaps %xmm14, %xmm13 #927.98 @@ -783,7 +783,7 @@ __svml_atanf4_ha_ex: mulpd %xmm14, %xmm15 #930.69 mulpd %xmm11, %xmm3 #931.23 mulpd %xmm15, %xmm8 #931.65 - movups 1792+__svml_satan_ha_data_internal(%rip), %xmm11 #932.59 + movups 1792+__jsvml_satan_ha_data_internal(%rip), %xmm11 #932.59 movaps %xmm11, %xmm15 #933.21 andps %xmm8, %xmm11 #933.74 andps %xmm3, %xmm15 #933.21 @@ -793,15 +793,15 @@ __svml_atanf4_ha_ex: cvtpd2ps %xmm11, %xmm13 #934.66 cvtpd2ps %xmm3, %xmm11 #936.35 cvtpd2ps %xmm8, %xmm3 #936.66 - movups 1024+__svml_satan_ha_data_internal(%rip), %xmm8 #941.18 + movups 1024+__jsvml_satan_ha_data_internal(%rip), %xmm8 #941.18 andps %xmm7, %xmm8 #941.18 - movups 1152+__svml_satan_ha_data_internal(%rip), %xmm7 #942.18 + movups 1152+__jsvml_satan_ha_data_internal(%rip), %xmm7 #942.18 andps %xmm5, %xmm7 #942.18 - movups 1280+__svml_satan_ha_data_internal(%rip), %xmm5 #943.18 + movups 1280+__jsvml_satan_ha_data_internal(%rip), %xmm5 #943.18 orps %xmm7, %xmm8 #945.18 movlhps %xmm13, %xmm12 #934.19 andps %xmm4, %xmm5 #943.18 - movups 1408+__svml_satan_ha_data_internal(%rip), %xmm4 #944.18 + movups 1408+__jsvml_satan_ha_data_internal(%rip), %xmm4 #944.18 andps %xmm6, %xmm4 #944.18 movaps %xmm12, %xmm6 #949.14 mulps %xmm12, %xmm6 #949.14 @@ -809,17 +809,17 @@ __svml_atanf4_ha_ex: movaps %xmm6, %xmm1 #950.14 orps %xmm5, %xmm8 #947.17 mulps %xmm6, %xmm1 #950.14 - movups 1472+__svml_satan_ha_data_internal(%rip), %xmm2 #955.26 + movups 1472+__jsvml_satan_ha_data_internal(%rip), %xmm2 #955.26 mulps %xmm1, %xmm2 #955.26 movlhps %xmm3, %xmm11 #936.19 - addps 1600+__svml_satan_ha_data_internal(%rip), %xmm2 #955.14 + addps 1600+__jsvml_satan_ha_data_internal(%rip), %xmm2 #955.14 addps %xmm8, %xmm11 #948.19 mulps %xmm6, %xmm2 #957.25 - movups 1536+__svml_satan_ha_data_internal(%rip), %xmm3 #956.26 + movups 1536+__jsvml_satan_ha_data_internal(%rip), %xmm3 #956.26 mulps %xmm1, %xmm3 #956.26 - movups 128+__svml_satan_ha_data_internal(%rip), %xmm9 #854.14 + movups 128+__jsvml_satan_ha_data_internal(%rip), %xmm9 #854.14 andps %xmm10, %xmm9 #854.14 - addps 1664+__svml_satan_ha_data_internal(%rip), %xmm3 #956.14 + addps 1664+__jsvml_satan_ha_data_internal(%rip), %xmm3 #956.14 addps %xmm2, %xmm3 #957.13 mulps %xmm3, %xmm6 #958.13 mulps %xmm12, %xmm6 #959.26 @@ -881,29 +881,29 @@ __svml_atanf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #964.540 lea 128(%rsp,%r12,4), %rsi #964.540 -..___tag_value___svml_atanf4_ha_ex.82: -# __svml_satan_ha_cout_rare_internal(const float *, float *) - call __svml_satan_ha_cout_rare_internal #964.540 -..___tag_value___svml_atanf4_ha_ex.83: +..___tag_value___jsvml_atanf4_ha_ex.82: +# __jsvml_satan_ha_cout_rare_internal(const float *, float *) + call __jsvml_satan_ha_cout_rare_internal #964.540 +..___tag_value___jsvml_atanf4_ha_ex.83: jmp ..B4.8 # Prob 100% #964.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atanf4_ha_ex,@function - .size __svml_atanf4_ha_ex,.-__svml_atanf4_ha_ex -..LN__svml_atanf4_ha_ex.3: + .type __jsvml_atanf4_ha_ex,@function + .size __jsvml_atanf4_ha_ex,.-__jsvml_atanf4_ha_ex +..LN__jsvml_atanf4_ha_ex.3: .data -# -- End __svml_atanf4_ha_ex +# -- End __jsvml_atanf4_ha_ex .text -.L_2__routine_start___svml_atanf8_ha_l9_4: -# -- Begin __svml_atanf8_ha_l9 +.L_2__routine_start___jsvml_atanf8_ha_l9_4: +# -- Begin __jsvml_atanf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_atanf8_ha_l9 -# --- __svml_atanf8_ha_l9(__m256) -__svml_atanf8_ha_l9: + .globl __jsvml_atanf8_ha_l9 +# --- __jsvml_atanf8_ha_l9(__m256) +__jsvml_atanf8_ha_l9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -912,7 +912,7 @@ __svml_atanf8_ha_l9: .byte 30 #1148.546 .byte 250 #1148.546 .cfi_startproc -..___tag_value___svml_atanf8_ha_l9.85: +..___tag_value___jsvml_atanf8_ha_l9.85: ..L86: #972.1 pushq %rbp #972.1 @@ -923,24 +923,24 @@ __svml_atanf8_ha_l9: andq $-64, %rsp #972.1 subq $192, %rsp #972.1 vmovaps %ymm0, %ymm12 #972.1 - vandps 192+__svml_satan_ha_data_internal(%rip), %ymm12, %ymm3 #1041.14 - vmovups 1984+__svml_satan_ha_data_internal(%rip), %ymm6 #1046.26 - vmovups 256+__svml_satan_ha_data_internal(%rip), %ymm2 #1050.24 - vmovups 320+__svml_satan_ha_data_internal(%rip), %ymm1 #1051.24 - vmovups 384+__svml_satan_ha_data_internal(%rip), %ymm14 #1052.24 - vpsubd 1920+__svml_satan_ha_data_internal(%rip), %ymm3, %ymm8 #1047.18 + vandps 192+__jsvml_satan_ha_data_internal(%rip), %ymm12, %ymm3 #1041.14 + vmovups 1984+__jsvml_satan_ha_data_internal(%rip), %ymm6 #1046.26 + vmovups 256+__jsvml_satan_ha_data_internal(%rip), %ymm2 #1050.24 + vmovups 320+__jsvml_satan_ha_data_internal(%rip), %ymm1 #1051.24 + vmovups 384+__jsvml_satan_ha_data_internal(%rip), %ymm14 #1052.24 + vpsubd 1920+__jsvml_satan_ha_data_internal(%rip), %ymm3, %ymm8 #1047.18 vpcmpgtd %ymm6, %ymm8, %ymm7 #1048.35 vpcmpeqd %ymm6, %ymm8, %ymm9 #1048.89 vpor %ymm9, %ymm7, %ymm4 #1048.18 - vpcmpgtd 448+__svml_satan_ha_data_internal(%rip), %ymm3, %ymm8 #1059.22 + vpcmpgtd 448+__jsvml_satan_ha_data_internal(%rip), %ymm3, %ymm8 #1059.22 vmovmskps %ymm4, %edx #1049.45 vpcmpgtd %ymm3, %ymm2, %ymm0 #1056.22 vpcmpgtd %ymm3, %ymm1, %ymm13 #1057.22 - vpxor 1728+__svml_satan_ha_data_internal(%rip), %ymm8, %ymm10 #1064.22 + vpxor 1728+__jsvml_satan_ha_data_internal(%rip), %ymm8, %ymm10 #1064.22 vpandn %ymm13, %ymm0, %ymm9 #1061.23 - vmovups 768+__svml_satan_ha_data_internal(%rip), %ymm1 #1072.50 - vmovups 832+__svml_satan_ha_data_internal(%rip), %ymm2 #1073.50 - vmovups 896+__svml_satan_ha_data_internal(%rip), %ymm4 #1074.50 + vmovups 768+__jsvml_satan_ha_data_internal(%rip), %ymm1 #1072.50 + vmovups 832+__jsvml_satan_ha_data_internal(%rip), %ymm2 #1073.50 + vmovups 896+__jsvml_satan_ha_data_internal(%rip), %ymm4 #1074.50 vsubps %ymm1, %ymm3, %ymm5 #1076.18 vpcmpgtd %ymm3, %ymm14, %ymm6 #1058.22 vpandn %ymm6, %ymm13, %ymm7 #1063.23 @@ -953,10 +953,10 @@ __svml_atanf8_ha_l9: vandps %ymm6, %ymm10, %ymm10 #1081.18 vorps %ymm13, %ymm15, %ymm15 #1084.18 vorps %ymm10, %ymm14, %ymm13 #1085.18 - vandps 64+__svml_satan_ha_data_internal(%rip), %ymm8, %ymm5 #1083.18 + vandps 64+__jsvml_satan_ha_data_internal(%rip), %ymm8, %ymm5 #1083.18 vorps %ymm13, %ymm15, %ymm14 #1086.18 vorps %ymm5, %ymm14, %ymm10 #1087.17 - vmovups __svml_satan_ha_data_internal(%rip), %ymm5 #1088.18 + vmovups __jsvml_satan_ha_data_internal(%rip), %ymm5 #1088.18 vfmadd213ps %ymm5, %ymm3, %ymm1 #1089.18 vfmadd213ps %ymm5, %ymm3, %ymm2 #1091.18 vfmadd213ps %ymm5, %ymm3, %ymm4 #1093.18 @@ -969,31 +969,31 @@ __svml_atanf8_ha_l9: vorps %ymm0, %ymm14, %ymm14 #1097.18 vorps %ymm14, %ymm3, %ymm13 #1098.18 vorps %ymm1, %ymm13, %ymm15 #1099.17 - vandps 960+__svml_satan_ha_data_internal(%rip), %ymm9, %ymm0 #1104.18 - vandps 1088+__svml_satan_ha_data_internal(%rip), %ymm7, %ymm2 #1105.18 + vandps 960+__jsvml_satan_ha_data_internal(%rip), %ymm9, %ymm0 #1104.18 + vandps 1088+__jsvml_satan_ha_data_internal(%rip), %ymm7, %ymm2 #1105.18 vorps %ymm2, %ymm0, %ymm14 #1108.18 vrcpps %ymm15, %ymm0 #1111.18 - vmovups 1536+__svml_satan_ha_data_internal(%rip), %ymm1 #1136.50 + vmovups 1536+__jsvml_satan_ha_data_internal(%rip), %ymm1 #1136.50 vfnmadd231ps %ymm0, %ymm15, %ymm5 #1114.21 vfmadd213ps %ymm5, %ymm5, %ymm5 #1115.21 vfmadd213ps %ymm0, %ymm5, %ymm0 #1116.22 - vandps 1216+__svml_satan_ha_data_internal(%rip), %ymm6, %ymm3 #1106.18 - vandps 1344+__svml_satan_ha_data_internal(%rip), %ymm8, %ymm4 #1107.18 + vandps 1216+__jsvml_satan_ha_data_internal(%rip), %ymm6, %ymm3 #1106.18 + vandps 1344+__jsvml_satan_ha_data_internal(%rip), %ymm8, %ymm4 #1107.18 vorps %ymm4, %ymm3, %ymm13 #1109.18 vorps %ymm13, %ymm14, %ymm14 #1110.17 vmulps %ymm0, %ymm10, %ymm13 #1118.19 - vmovups 1472+__svml_satan_ha_data_internal(%rip), %ymm4 #1135.50 + vmovups 1472+__jsvml_satan_ha_data_internal(%rip), %ymm4 #1135.50 vmulps %ymm13, %ymm13, %ymm3 #1133.14 vfnmadd213ps %ymm10, %ymm13, %ymm15 #1119.19 vmulps %ymm3, %ymm3, %ymm2 #1134.14 vmulps %ymm15, %ymm0, %ymm0 #1120.19 - vfmadd213ps 1600+__svml_satan_ha_data_internal(%rip), %ymm2, %ymm4 #1139.14 - vfmadd213ps 1664+__svml_satan_ha_data_internal(%rip), %ymm1, %ymm2 #1140.14 + vfmadd213ps 1600+__jsvml_satan_ha_data_internal(%rip), %ymm2, %ymm4 #1139.14 + vfmadd213ps 1664+__jsvml_satan_ha_data_internal(%rip), %ymm1, %ymm2 #1140.14 vfmadd213ps %ymm2, %ymm3, %ymm4 #1141.13 - vandps 1024+__svml_satan_ha_data_internal(%rip), %ymm9, %ymm9 #1125.18 - vandps 1152+__svml_satan_ha_data_internal(%rip), %ymm7, %ymm7 #1126.18 - vandps 1280+__svml_satan_ha_data_internal(%rip), %ymm6, %ymm6 #1127.18 - vandps 1408+__svml_satan_ha_data_internal(%rip), %ymm8, %ymm8 #1128.18 + vandps 1024+__jsvml_satan_ha_data_internal(%rip), %ymm9, %ymm9 #1125.18 + vandps 1152+__jsvml_satan_ha_data_internal(%rip), %ymm7, %ymm7 #1126.18 + vandps 1280+__jsvml_satan_ha_data_internal(%rip), %ymm6, %ymm6 #1127.18 + vandps 1408+__jsvml_satan_ha_data_internal(%rip), %ymm8, %ymm8 #1128.18 vorps %ymm7, %ymm9, %ymm10 #1129.18 vorps %ymm8, %ymm6, %ymm15 #1130.18 vmulps %ymm4, %ymm3, %ymm7 #1142.13 @@ -1002,7 +1002,7 @@ __svml_atanf8_ha_l9: vfmadd213ps %ymm5, %ymm13, %ymm7 #1143.14 vaddps %ymm7, %ymm13, %ymm8 #1144.14 vaddps %ymm8, %ymm14, %ymm9 #1145.18 - vandps 128+__svml_satan_ha_data_internal(%rip), %ymm12, %ymm11 #1043.14 + vandps 128+__jsvml_satan_ha_data_internal(%rip), %ymm12, %ymm11 #1043.14 vorps %ymm11, %ymm9, %ymm0 #1146.14 testl %edx, %edx #1148.52 jne ..B5.3 # Prob 5% #1148.52 @@ -1063,29 +1063,29 @@ __svml_atanf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1148.546 lea 128(%rsp,%r12,4), %rsi #1148.546 -..___tag_value___svml_atanf8_ha_l9.103: -# __svml_satan_ha_cout_rare_internal(const float *, float *) - call __svml_satan_ha_cout_rare_internal #1148.546 -..___tag_value___svml_atanf8_ha_l9.104: +..___tag_value___jsvml_atanf8_ha_l9.103: +# __jsvml_satan_ha_cout_rare_internal(const float *, float *) + call __jsvml_satan_ha_cout_rare_internal #1148.546 +..___tag_value___jsvml_atanf8_ha_l9.104: jmp ..B5.8 # Prob 100% #1148.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_atanf8_ha_l9,@function - .size __svml_atanf8_ha_l9,.-__svml_atanf8_ha_l9 -..LN__svml_atanf8_ha_l9.4: + .type __jsvml_atanf8_ha_l9,@function + .size __jsvml_atanf8_ha_l9,.-__jsvml_atanf8_ha_l9 +..LN__jsvml_atanf8_ha_l9.4: .data -# -- End __svml_atanf8_ha_l9 +# -- End __jsvml_atanf8_ha_l9 .text -.L_2__routine_start___svml_atanf16_ha_z0_5: -# -- Begin __svml_atanf16_ha_z0 +.L_2__routine_start___jsvml_atanf16_ha_z0_5: +# -- Begin __jsvml_atanf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_atanf16_ha_z0 -# --- __svml_atanf16_ha_z0(__m512) -__svml_atanf16_ha_z0: + .globl __jsvml_atanf16_ha_z0 +# --- __jsvml_atanf16_ha_z0(__m512) +__jsvml_atanf16_ha_z0: # parameter 1: %zmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -1094,36 +1094,36 @@ __svml_atanf16_ha_z0: .byte 30 #1617.12 .byte 250 #1617.12 .cfi_startproc -..___tag_value___svml_atanf16_ha_z0.106: +..___tag_value___jsvml_atanf16_ha_z0.106: ..L107: #1509.1 - vmovups 128+__svml_satan_ha_data_internal_avx512(%rip), %zmm4 #1569.55 - vmovups 320+__svml_satan_ha_data_internal_avx512(%rip), %zmm5 #1571.49 - vmovups 64+__svml_satan_ha_data_internal_avx512(%rip), %zmm6 #1567.50 - vmovups 256+__svml_satan_ha_data_internal_avx512(%rip), %zmm10 #1577.46 - vmovups 192+__svml_satan_ha_data_internal_avx512(%rip), %zmm13 #1576.16 - vmovups 448+__svml_satan_ha_data_internal_avx512(%rip), %zmm15 #1592.277 - vandps __svml_satan_ha_data_internal_avx512(%rip), %zmm0, %zmm11 #1566.12 + vmovups 128+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm4 #1569.55 + vmovups 320+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm5 #1571.49 + vmovups 64+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm6 #1567.50 + vmovups 256+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm10 #1577.46 + vmovups 192+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm13 #1576.16 + vmovups 448+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm15 #1592.277 + vandps __jsvml_satan_ha_data_internal_avx512(%rip), %zmm0, %zmm11 #1566.12 vcmpps $17, {sae}, %zmm4, %zmm11, %k1 #1570.20 vminps {sae}, %zmm11, %zmm5, %zmm2 #1572.14 - vmovups 576+__svml_satan_ha_data_internal_avx512(%rip), %zmm4 #1593.281 + vmovups 576+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm4 #1593.281 vaddps {rn-sae}, %zmm6, %zmm11, %zmm3 #1568.19 vxorps %zmm0, %zmm11, %zmm1 #1574.15 vreduceps $40, {sae}, %zmm11, %zmm13{%k1} #1576.16 vsubps {rn-sae}, %zmm6, %zmm3, %zmm7 #1575.15 - vpermt2ps 512+__svml_satan_ha_data_internal_avx512(%rip), %zmm3, %zmm15 #1592.277 - vpermt2ps 640+__svml_satan_ha_data_internal_avx512(%rip), %zmm3, %zmm4 #1593.281 + vpermt2ps 512+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm3, %zmm15 #1592.277 + vpermt2ps 640+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm3, %zmm4 #1593.281 vfmadd213ps {rn-sae}, %zmm10, %zmm7, %zmm2{%k1} #1578.12 - vmovups 832+__svml_satan_ha_data_internal_avx512(%rip), %zmm3 #1599.51 - vmovups 896+__svml_satan_ha_data_internal_avx512(%rip), %zmm6 #1600.51 + vmovups 832+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm3 #1599.51 + vmovups 896+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm6 #1600.51 vsubps {rn-sae}, %zmm10, %zmm2, %zmm8 #1579.17 vrcp14ps %zmm2, %zmm12 #1580.15 vfmsub213ps {rn-sae}, %zmm8, %zmm7, %zmm11 #1581.15 knotw %k1, %k2 #1584.20 vmovaps %zmm10, %zmm9 #1582.14 vfnmadd231ps {rn-sae}, %zmm2, %zmm12, %zmm9 #1582.14 - vblendmps 704+__svml_satan_ha_data_internal_avx512(%rip), %zmm15, %zmm7{%k2} #1596.14 - vblendmps 768+__svml_satan_ha_data_internal_avx512(%rip), %zmm4, %zmm5{%k2} #1597.18 + vblendmps 704+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm15, %zmm7{%k2} #1596.14 + vblendmps 768+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm4, %zmm5{%k2} #1597.18 vfmadd213ps {rn-sae}, %zmm12, %zmm9, %zmm12 #1583.15 vmulps {rn-sae}, %zmm13, %zmm12, %zmm0 #1585.14 vmulps {rn-sae}, %zmm12, %zmm11, %zmm14 #1587.18 @@ -1137,7 +1137,7 @@ __svml_atanf16_ha_z0: vfmadd231ps {rn-sae}, %zmm12, %zmm3, %zmm6 #1601.15 vsubps {rn-sae}, %zmm7, %zmm13, %zmm8 #1607.15 vaddps {rn-sae}, %zmm5, %zmm2, %zmm9 #1603.15 - vmovups 960+__svml_satan_ha_data_internal_avx512(%rip), %zmm2 #1605.51 + vmovups 960+__jsvml_satan_ha_data_internal_avx512(%rip), %zmm2 #1605.51 vsubps {rn-sae}, %zmm8, %zmm0, %zmm0 #1608.16 vfmadd213ps {rn-sae}, %zmm2, %zmm6, %zmm12 #1606.15 vaddps {rn-sae}, %zmm0, %zmm9, %zmm11 #1609.15 @@ -1149,21 +1149,21 @@ __svml_atanf16_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_atanf16_ha_z0,@function - .size __svml_atanf16_ha_z0,.-__svml_atanf16_ha_z0 -..LN__svml_atanf16_ha_z0.5: + .type __jsvml_atanf16_ha_z0,@function + .size __jsvml_atanf16_ha_z0,.-__jsvml_atanf16_ha_z0 +..LN__jsvml_atanf16_ha_z0.5: .data -# -- End __svml_atanf16_ha_z0 +# -- End __jsvml_atanf16_ha_z0 .text -.L_2__routine_start___svml_satan_ha_cout_rare_internal_6: -# -- Begin __svml_satan_ha_cout_rare_internal +.L_2__routine_start___jsvml_satan_ha_cout_rare_internal_6: +# -- Begin __jsvml_satan_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_satan_ha_cout_rare_internal - .globl __svml_satan_ha_cout_rare_internal -# --- __svml_satan_ha_cout_rare_internal(const float *, float *) -__svml_satan_ha_cout_rare_internal: + .hidden __jsvml_satan_ha_cout_rare_internal + .globl __jsvml_satan_ha_cout_rare_internal +# --- __jsvml_satan_ha_cout_rare_internal(const float *, float *) +__jsvml_satan_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1173,7 +1173,7 @@ __svml_satan_ha_cout_rare_internal: .byte 30 #1501.15 .byte 250 #1501.15 .cfi_startproc -..___tag_value___svml_satan_ha_cout_rare_internal.109: +..___tag_value___jsvml_satan_ha_cout_rare_internal.109: ..L110: #1399.1 movzwl 2(%rdi), %edx #1408.31 @@ -1527,17 +1527,17 @@ __svml_satan_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_satan_ha_cout_rare_internal,@function - .size __svml_satan_ha_cout_rare_internal,.-__svml_satan_ha_cout_rare_internal -..LN__svml_satan_ha_cout_rare_internal.6: + .type __jsvml_satan_ha_cout_rare_internal,@function + .size __jsvml_satan_ha_cout_rare_internal,.-__jsvml_satan_ha_cout_rare_internal +..LN__jsvml_satan_ha_cout_rare_internal.6: .data -# -- End __svml_satan_ha_cout_rare_internal +# -- End __jsvml_satan_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_satan_ha_data_internal_avx512 - .globl __svml_satan_ha_data_internal_avx512 -__svml_satan_ha_data_internal_avx512: + .hidden __jsvml_satan_ha_data_internal_avx512 + .globl __jsvml_satan_ha_data_internal_avx512 +__jsvml_satan_ha_data_internal_avx512: .long 2147483647 .long 2147483647 .long 2147483647 @@ -1794,12 +1794,12 @@ __svml_satan_ha_data_internal_avx512: .long 3198855850 .long 3198855850 .long 3198855850 - .type __svml_satan_ha_data_internal_avx512,@object - .size __svml_satan_ha_data_internal_avx512,1024 + .type __jsvml_satan_ha_data_internal_avx512,@object + .size __jsvml_satan_ha_data_internal_avx512,1024 .align 64 - .hidden __svml_satan_ha_data_internal - .globl __svml_satan_ha_data_internal -__svml_satan_ha_data_internal: + .hidden __jsvml_satan_ha_data_internal + .globl __jsvml_satan_ha_data_internal +__jsvml_satan_ha_data_internal: .long 1065353216 .long 1065353216 .long 1065353216 @@ -2312,8 +2312,8 @@ __svml_satan_ha_data_internal: .long 4227858432 .long 4227858432 .long 4227858432 - .type __svml_satan_ha_data_internal,@object - .size __svml_satan_ha_data_internal,2048 + .type __jsvml_satan_ha_data_internal,@object + .size __jsvml_satan_ha_data_internal,2048 .align 32 _vmlsAtanHATab: .long 3892314112 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_cbrt_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cbrt_linux_x86.S similarity index 87% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_cbrt_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cbrt_linux_x86.S index 012a95dd00d..7c7dcafb5f2 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_cbrt_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cbrt_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_cbrt.c" .text ..TXTST0: -.L_2__routine_start___svml_cbrtf4_ha_l9_0: -# -- Begin __svml_cbrtf4_ha_l9 +.L_2__routine_start___jsvml_cbrtf4_ha_l9_0: +# -- Begin __jsvml_cbrtf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrtf4_ha_l9 -# --- __svml_cbrtf4_ha_l9(__m128) -__svml_cbrtf4_ha_l9: + .globl __jsvml_cbrtf4_ha_l9 +# --- __jsvml_cbrtf4_ha_l9(__m128) +__jsvml_cbrtf4_ha_l9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_cbrtf4_ha_l9: .byte 30 #978.540 .byte 250 #978.540 .cfi_startproc -..___tag_value___svml_cbrtf4_ha_l9.1: +..___tag_value___jsvml_cbrtf4_ha_l9.1: ..L2: #869.1 pushq %rbp #869.1 @@ -59,11 +59,11 @@ __svml_cbrtf4_ha_l9: subq $192, %rsp #869.1 vmovaps %xmm0, %xmm5 #869.1 vpsrld $16, %xmm5, %xmm12 #932.13 - lea __svml_scbrt_ha_data_internal(%rip), %rdx #934.69 - vpand 1408+__svml_scbrt_ha_data_internal(%rip), %xmm12, %xmm4 #933.18 + lea __jsvml_scbrt_ha_data_internal(%rip), %rdx #934.69 + vpand 1408+__jsvml_scbrt_ha_data_internal(%rip), %xmm12, %xmm4 #933.18 vmovd %xmm4, %eax #934.157 - vandps 1792+__svml_scbrt_ha_data_internal(%rip), %xmm5, %xmm13 #937.14 - vandps 1152+__svml_scbrt_ha_data_internal(%rip), %xmm5, %xmm15 #941.9 + vandps 1792+__jsvml_scbrt_ha_data_internal(%rip), %xmm5, %xmm13 #937.14 + vandps 1152+__jsvml_scbrt_ha_data_internal(%rip), %xmm5, %xmm15 #941.9 vpextrd $1, %xmm4, %ecx #934.284 movslq %eax, %rax #934.69 movslq %ecx, %rcx #934.196 @@ -71,11 +71,11 @@ __svml_cbrtf4_ha_l9: vpextrd $3, %xmm4, %edi #934.565 movslq %esi, %rsi #934.347 movslq %edi, %rdi #934.477 - vandps 1216+__svml_scbrt_ha_data_internal(%rip), %xmm5, %xmm1 #942.10 - vpsubd 1856+__svml_scbrt_ha_data_internal(%rip), %xmm13, %xmm14 #938.14 - vorps 1280+__svml_scbrt_ha_data_internal(%rip), %xmm15, %xmm0 #943.9 - vorps 1344+__svml_scbrt_ha_data_internal(%rip), %xmm1, %xmm13 #944.10 - vpcmpgtd 1920+__svml_scbrt_ha_data_internal(%rip), %xmm14, %xmm2 #939.19 + vandps 1216+__jsvml_scbrt_ha_data_internal(%rip), %xmm5, %xmm1 #942.10 + vpsubd 1856+__jsvml_scbrt_ha_data_internal(%rip), %xmm13, %xmm14 #938.14 + vorps 1280+__jsvml_scbrt_ha_data_internal(%rip), %xmm15, %xmm0 #943.9 + vorps 1344+__jsvml_scbrt_ha_data_internal(%rip), %xmm1, %xmm13 #944.10 + vpcmpgtd 1920+__jsvml_scbrt_ha_data_internal(%rip), %xmm14, %xmm2 #939.19 vsubps %xmm13, %xmm0, %xmm14 #945.9 vmovd (%rdx,%rax), %xmm6 #934.69 vmovd (%rdx,%rcx), %xmm7 #934.196 @@ -84,23 +84,23 @@ __svml_cbrtf4_ha_l9: vmovd (%rdx,%rsi), %xmm8 #934.347 vmovd (%rdx,%rdi), %xmm9 #934.477 vpunpcklqdq %xmm9, %xmm8, %xmm11 #934.327 - vpand 1472+__svml_scbrt_ha_data_internal(%rip), %xmm7, %xmm3 #936.22 + vpand 1472+__jsvml_scbrt_ha_data_internal(%rip), %xmm7, %xmm3 #936.22 vshufps $136, %xmm11, %xmm10, %xmm6 #934.29 - vpmulld 1728+__svml_scbrt_ha_data_internal(%rip), %xmm3, %xmm15 #948.16 - vpsubd 1664+__svml_scbrt_ha_data_internal(%rip), %xmm3, %xmm3 #950.24 + vpmulld 1728+__jsvml_scbrt_ha_data_internal(%rip), %xmm3, %xmm15 #948.16 + vpsubd 1664+__jsvml_scbrt_ha_data_internal(%rip), %xmm3, %xmm3 #950.24 vmulps %xmm14, %xmm6, %xmm1 #946.9 vpsrld $12, %xmm15, %xmm6 #951.11 vmovmskps %xmm2, %eax #940.40 vpsubd %xmm6, %xmm3, %xmm11 #952.11 vpsubd %xmm6, %xmm11, %xmm12 #953.11 vpsubd %xmm6, %xmm12, %xmm3 #954.11 - vpand 1536+__svml_scbrt_ha_data_internal(%rip), %xmm7, %xmm9 #949.14 + vpand 1536+__jsvml_scbrt_ha_data_internal(%rip), %xmm7, %xmm9 #949.14 vpslld $7, %xmm3, %xmm7 #955.11 vpaddd %xmm7, %xmm4, %xmm4 #961.19 vpandn %xmm4, %xmm2, %xmm2 #961.19 vpslld $1, %xmm2, %xmm2 #962.19 vmovd %xmm2, %r8d #963.151 - vpaddd 1600+__svml_scbrt_ha_data_internal(%rip), %xmm6, %xmm8 #957.11 + vpaddd 1600+__jsvml_scbrt_ha_data_internal(%rip), %xmm6, %xmm8 #957.11 vpor %xmm9, %xmm8, %xmm10 #957.11 vpextrd $1, %xmm2, %r9d #963.341 vpslld $23, %xmm10, %xmm0 #958.11 @@ -120,10 +120,10 @@ __svml_cbrtf4_ha_l9: vshufps $238, %xmm9, %xmm8, %xmm11 #963.906 vmulps %xmm10, %xmm0, %xmm14 #964.17 vmulps %xmm11, %xmm0, %xmm12 #965.17 - vmovups 896+__svml_scbrt_ha_data_internal(%rip), %xmm0 #966.40 - vfmadd213ps 960+__svml_scbrt_ha_data_internal(%rip), %xmm1, %xmm0 #968.9 - vfmadd213ps 1024+__svml_scbrt_ha_data_internal(%rip), %xmm1, %xmm0 #970.9 - vfmadd213ps 1088+__svml_scbrt_ha_data_internal(%rip), %xmm1, %xmm0 #972.9 + vmovups 896+__jsvml_scbrt_ha_data_internal(%rip), %xmm0 #966.40 + vfmadd213ps 960+__jsvml_scbrt_ha_data_internal(%rip), %xmm1, %xmm0 #968.9 + vfmadd213ps 1024+__jsvml_scbrt_ha_data_internal(%rip), %xmm1, %xmm0 #970.9 + vfmadd213ps 1088+__jsvml_scbrt_ha_data_internal(%rip), %xmm1, %xmm0 #972.9 vmulps %xmm14, %xmm1, %xmm1 #973.15 vmulps %xmm1, %xmm0, %xmm13 #974.9 vaddps %xmm13, %xmm12, %xmm15 #975.9 @@ -183,29 +183,29 @@ __svml_cbrtf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #978.540 lea 128(%rsp,%r12,4), %rsi #978.540 -..___tag_value___svml_cbrtf4_ha_l9.19: -# __svml_scbrt_ha_cout_rare_internal(const float *, float *) - call __svml_scbrt_ha_cout_rare_internal #978.540 -..___tag_value___svml_cbrtf4_ha_l9.20: +..___tag_value___jsvml_cbrtf4_ha_l9.19: +# __jsvml_scbrt_ha_cout_rare_internal(const float *, float *) + call __jsvml_scbrt_ha_cout_rare_internal #978.540 +..___tag_value___jsvml_cbrtf4_ha_l9.20: jmp ..B1.8 # Prob 100% #978.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrtf4_ha_l9,@function - .size __svml_cbrtf4_ha_l9,.-__svml_cbrtf4_ha_l9 -..LN__svml_cbrtf4_ha_l9.0: + .type __jsvml_cbrtf4_ha_l9,@function + .size __jsvml_cbrtf4_ha_l9,.-__jsvml_cbrtf4_ha_l9 +..LN__jsvml_cbrtf4_ha_l9.0: .data -# -- End __svml_cbrtf4_ha_l9 +# -- End __jsvml_cbrtf4_ha_l9 .text -.L_2__routine_start___svml_cbrtf4_ha_ex_1: -# -- Begin __svml_cbrtf4_ha_ex +.L_2__routine_start___jsvml_cbrtf4_ha_ex_1: +# -- Begin __jsvml_cbrtf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cbrtf4_ha_ex -# --- __svml_cbrtf4_ha_ex(__m128) -__svml_cbrtf4_ha_ex: + .globl __jsvml_cbrtf4_ha_ex +# --- __jsvml_cbrtf4_ha_ex(__m128) +__jsvml_cbrtf4_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -214,7 +214,7 @@ __svml_cbrtf4_ha_ex: .byte 30 #1095.540 .byte 250 #1095.540 .cfi_startproc -..___tag_value___svml_cbrtf4_ha_ex.22: +..___tag_value___jsvml_cbrtf4_ha_ex.22: ..L23: #986.1 pushq %rbp #986.1 @@ -226,8 +226,8 @@ __svml_cbrtf4_ha_ex: subq $192, %rsp #986.1 movaps %xmm0, %xmm5 #986.1 movaps %xmm5, %xmm2 #1049.11 - lea __svml_scbrt_ha_data_internal(%rip), %rdx #1051.68 - movdqu 1408+__svml_scbrt_ha_data_internal(%rip), %xmm3 #1050.16 + lea __jsvml_scbrt_ha_data_internal(%rip), %rdx #1051.68 + movdqu 1408+__jsvml_scbrt_ha_data_internal(%rip), %xmm3 #1050.16 psrld $16, %xmm2 #1049.11 pand %xmm2, %xmm3 #1050.16 psrld $7, %xmm2 #1052.23 @@ -240,12 +240,12 @@ __svml_cbrtf4_ha_ex: movslq %ecx, %rcx #1051.193 movd %xmm8, %esi #1051.466 movd %xmm9, %edi #1051.631 - movdqu 1472+__svml_scbrt_ha_data_internal(%rip), %xmm1 #1053.20 - movups 1152+__svml_scbrt_ha_data_internal(%rip), %xmm13 #1058.9 + movdqu 1472+__jsvml_scbrt_ha_data_internal(%rip), %xmm1 #1053.20 + movups 1152+__jsvml_scbrt_ha_data_internal(%rip), %xmm13 #1058.9 pand %xmm2, %xmm1 #1053.20 - movups 1216+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1059.10 + movups 1216+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1059.10 andps %xmm5, %xmm13 #1058.9 - movdqu 1728+__svml_scbrt_ha_data_internal(%rip), %xmm15 #1064.46 + movdqu 1728+__jsvml_scbrt_ha_data_internal(%rip), %xmm15 #1064.46 andps %xmm5, %xmm12 #1059.10 movslq %esi, %rsi #1051.378 movdqa %xmm15, %xmm6 #1065.188 @@ -255,8 +255,8 @@ __svml_cbrtf4_ha_ex: movd (%rdx,%rcx), %xmm7 #1051.193 punpcklqdq %xmm7, %xmm4 #1051.49 movdqa %xmm1, %xmm7 #1067.22 - orps 1280+__svml_scbrt_ha_data_internal(%rip), %xmm13 #1060.9 - orps 1344+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1061.10 + orps 1280+__jsvml_scbrt_ha_data_internal(%rip), %xmm13 #1060.9 + orps 1344+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1061.10 pmuludq %xmm1, %xmm6 #1065.188 psrlq $32, %xmm1 #1065.93 subps %xmm12, %xmm13 #1062.9 @@ -269,27 +269,27 @@ __svml_cbrtf4_ha_ex: mulps %xmm13, %xmm4 #1063.9 pand .L_2il0floatpacket.46(%rip), %xmm6 #1065.273 por %xmm1, %xmm6 #1065.343 - psubd 1664+__svml_scbrt_ha_data_internal(%rip), %xmm7 #1067.22 + psubd 1664+__jsvml_scbrt_ha_data_internal(%rip), %xmm7 #1067.22 psrld $12, %xmm6 #1068.9 psubd %xmm6, %xmm7 #1069.9 - movups 896+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1083.40 + movups 896+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1083.40 psubd %xmm6, %xmm7 #1070.9 - movdqu 1792+__svml_scbrt_ha_data_internal(%rip), %xmm0 #1054.12 + movdqu 1792+__jsvml_scbrt_ha_data_internal(%rip), %xmm0 #1054.12 psubd %xmm6, %xmm7 #1071.9 mulps %xmm4, %xmm12 #1085.21 pand %xmm5, %xmm0 #1054.12 - psubd 1856+__svml_scbrt_ha_data_internal(%rip), %xmm0 #1055.12 + psubd 1856+__jsvml_scbrt_ha_data_internal(%rip), %xmm0 #1055.12 pslld $7, %xmm7 #1072.9 - pcmpgtd 1920+__svml_scbrt_ha_data_internal(%rip), %xmm0 #1056.17 + pcmpgtd 1920+__jsvml_scbrt_ha_data_internal(%rip), %xmm0 #1056.17 paddd %xmm7, %xmm3 #1078.17 movmskps %xmm0, %eax #1057.40 pandn %xmm3, %xmm0 #1078.17 - movdqu 1536+__svml_scbrt_ha_data_internal(%rip), %xmm14 #1066.12 + movdqu 1536+__jsvml_scbrt_ha_data_internal(%rip), %xmm14 #1066.12 pslld $1, %xmm0 #1079.17 - movdqu 1600+__svml_scbrt_ha_data_internal(%rip), %xmm1 #1074.9 + movdqu 1600+__jsvml_scbrt_ha_data_internal(%rip), %xmm1 #1074.9 pand %xmm14, %xmm2 #1066.12 paddd %xmm6, %xmm1 #1074.9 - addps 960+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1085.9 + addps 960+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1085.9 movd %xmm0, %r8d #1080.151 por %xmm2, %xmm1 #1074.9 pshufd $1, %xmm0, %xmm2 #1080.357 @@ -301,7 +301,7 @@ __svml_cbrtf4_ha_ex: movd %xmm0, %r11d #1080.795 mulps %xmm4, %xmm12 #1087.21 movslq %r8d, %r8 #1080.57 - addps 1024+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1087.9 + addps 1024+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1087.9 movslq %r9d, %r9 #1080.245 movslq %r10d, %r10 #1080.473 movslq %r11d, %r11 #1080.701 @@ -316,7 +316,7 @@ __svml_cbrtf4_ha_ex: mulps %xmm1, %xmm0 #1081.17 mulps %xmm4, %xmm12 #1089.21 mulps %xmm0, %xmm4 #1090.15 - addps 1088+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1089.9 + addps 1088+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1089.9 shufps $238, %xmm10, %xmm11 #1080.1009 mulps %xmm11, %xmm1 #1082.17 mulps %xmm4, %xmm12 #1091.9 @@ -376,29 +376,29 @@ __svml_cbrtf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1095.540 lea 128(%rsp,%r12,4), %rsi #1095.540 -..___tag_value___svml_cbrtf4_ha_ex.40: -# __svml_scbrt_ha_cout_rare_internal(const float *, float *) - call __svml_scbrt_ha_cout_rare_internal #1095.540 -..___tag_value___svml_cbrtf4_ha_ex.41: +..___tag_value___jsvml_cbrtf4_ha_ex.40: +# __jsvml_scbrt_ha_cout_rare_internal(const float *, float *) + call __jsvml_scbrt_ha_cout_rare_internal #1095.540 +..___tag_value___jsvml_cbrtf4_ha_ex.41: jmp ..B2.8 # Prob 100% #1095.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrtf4_ha_ex,@function - .size __svml_cbrtf4_ha_ex,.-__svml_cbrtf4_ha_ex -..LN__svml_cbrtf4_ha_ex.1: + .type __jsvml_cbrtf4_ha_ex,@function + .size __jsvml_cbrtf4_ha_ex,.-__jsvml_cbrtf4_ha_ex +..LN__jsvml_cbrtf4_ha_ex.1: .data -# -- End __svml_cbrtf4_ha_ex +# -- End __jsvml_cbrtf4_ha_ex .text -.L_2__routine_start___svml_cbrtf4_ha_e9_2: -# -- Begin __svml_cbrtf4_ha_e9 +.L_2__routine_start___jsvml_cbrtf4_ha_e9_2: +# -- Begin __jsvml_cbrtf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrtf4_ha_e9 -# --- __svml_cbrtf4_ha_e9(__m128) -__svml_cbrtf4_ha_e9: + .globl __jsvml_cbrtf4_ha_e9 +# --- __jsvml_cbrtf4_ha_e9(__m128) +__jsvml_cbrtf4_ha_e9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -407,7 +407,7 @@ __svml_cbrtf4_ha_e9: .byte 30 #1212.540 .byte 250 #1212.540 .cfi_startproc -..___tag_value___svml_cbrtf4_ha_e9.43: +..___tag_value___jsvml_cbrtf4_ha_e9.43: ..L44: #1103.1 pushq %rbp #1103.1 @@ -418,14 +418,14 @@ __svml_cbrtf4_ha_e9: andq $-64, %rsp #1103.1 subq $192, %rsp #1103.1 movaps %xmm0, %xmm8 #1166.17 - movups 1408+__svml_scbrt_ha_data_internal(%rip), %xmm11 #1167.22 + movups 1408+__jsvml_scbrt_ha_data_internal(%rip), %xmm11 #1167.22 psrld $16, %xmm8 #1166.17 pand %xmm8, %xmm11 #1167.22 - lea __svml_scbrt_ha_data_internal(%rip), %rdx #1168.69 + lea __jsvml_scbrt_ha_data_internal(%rip), %rdx #1168.69 movd %xmm11, %eax #1168.157 psrld $7, %xmm8 #1169.29 - movups 1152+__svml_scbrt_ha_data_internal(%rip), %xmm6 #1175.9 - movups 1216+__svml_scbrt_ha_data_internal(%rip), %xmm5 #1176.10 + movups 1152+__jsvml_scbrt_ha_data_internal(%rip), %xmm6 #1175.9 + movups 1216+__jsvml_scbrt_ha_data_internal(%rip), %xmm5 #1176.10 andps %xmm0, %xmm6 #1175.9 pextrd $1, %xmm11, %ecx #1168.284 andps %xmm0, %xmm5 #1176.10 @@ -435,41 +435,41 @@ __svml_cbrtf4_ha_e9: movslq %ecx, %rcx #1168.196 movslq %esi, %rsi #1168.347 movslq %edi, %rdi #1168.477 - orps 1280+__svml_scbrt_ha_data_internal(%rip), %xmm6 #1177.9 - orps 1344+__svml_scbrt_ha_data_internal(%rip), %xmm5 #1178.10 + orps 1280+__jsvml_scbrt_ha_data_internal(%rip), %xmm6 #1177.9 + orps 1344+__jsvml_scbrt_ha_data_internal(%rip), %xmm5 #1178.10 movd (%rdx,%rax), %xmm1 #1168.69 subps %xmm5, %xmm6 #1179.9 movd (%rdx,%rcx), %xmm2 #1168.196 movd (%rdx,%rsi), %xmm4 #1168.347 movd (%rdx,%rdi), %xmm3 #1168.477 - movups 1472+__svml_scbrt_ha_data_internal(%rip), %xmm10 #1170.26 + movups 1472+__jsvml_scbrt_ha_data_internal(%rip), %xmm10 #1170.26 punpcklqdq %xmm2, %xmm1 #1168.49 pand %xmm8, %xmm10 #1170.26 punpcklqdq %xmm3, %xmm4 #1168.327 - movups 1728+__svml_scbrt_ha_data_internal(%rip), %xmm9 #1182.20 + movups 1728+__jsvml_scbrt_ha_data_internal(%rip), %xmm9 #1182.20 shufps $136, %xmm4, %xmm1 #1168.29 pmulld %xmm10, %xmm9 #1182.20 mulps %xmm6, %xmm1 #1180.9 psrld $12, %xmm9 #1185.15 - psubd 1664+__svml_scbrt_ha_data_internal(%rip), %xmm10 #1184.28 + psubd 1664+__jsvml_scbrt_ha_data_internal(%rip), %xmm10 #1184.28 psubd %xmm9, %xmm10 #1186.15 - movups 1600+__svml_scbrt_ha_data_internal(%rip), %xmm2 #1191.15 + movups 1600+__jsvml_scbrt_ha_data_internal(%rip), %xmm2 #1191.15 psubd %xmm9, %xmm10 #1187.15 paddd %xmm9, %xmm2 #1191.15 psubd %xmm9, %xmm10 #1188.15 - movups 896+__svml_scbrt_ha_data_internal(%rip), %xmm9 #1200.40 + movups 896+__jsvml_scbrt_ha_data_internal(%rip), %xmm9 #1200.40 pslld $7, %xmm10 #1189.15 mulps %xmm1, %xmm9 #1202.21 paddd %xmm10, %xmm11 #1195.23 - movups 1792+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1171.18 + movups 1792+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1171.18 andps %xmm0, %xmm12 #1171.18 - addps 960+__svml_scbrt_ha_data_internal(%rip), %xmm9 #1202.9 - psubd 1856+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1172.18 - pcmpgtd 1920+__svml_scbrt_ha_data_internal(%rip), %xmm12 #1173.23 + addps 960+__jsvml_scbrt_ha_data_internal(%rip), %xmm9 #1202.9 + psubd 1856+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1172.18 + pcmpgtd 1920+__jsvml_scbrt_ha_data_internal(%rip), %xmm12 #1173.23 movmskps %xmm12, %eax #1174.40 pandn %xmm11, %xmm12 #1195.23 pslld $1, %xmm12 #1196.23 - movups 1536+__svml_scbrt_ha_data_internal(%rip), %xmm7 #1155.22 + movups 1536+__jsvml_scbrt_ha_data_internal(%rip), %xmm7 #1155.22 movd %xmm12, %r8d #1197.151 pand %xmm7, %xmm8 #1183.18 por %xmm8, %xmm2 #1191.15 @@ -477,7 +477,7 @@ __svml_cbrtf4_ha_e9: pextrd $1, %xmm12, %r9d #1197.341 mulps %xmm1, %xmm9 #1204.21 movslq %r8d, %r8 #1197.57 - addps 1024+__svml_scbrt_ha_data_internal(%rip), %xmm9 #1204.9 + addps 1024+__jsvml_scbrt_ha_data_internal(%rip), %xmm9 #1204.9 movslq %r9d, %r9 #1197.247 pextrd $2, %xmm12, %r10d #1197.534 pextrd $3, %xmm12, %r11d #1197.727 @@ -494,7 +494,7 @@ __svml_cbrtf4_ha_e9: mulps %xmm2, %xmm3 #1198.17 mulps %xmm1, %xmm9 #1206.21 mulps %xmm3, %xmm1 #1207.15 - addps 1088+__svml_scbrt_ha_data_internal(%rip), %xmm9 #1206.9 + addps 1088+__jsvml_scbrt_ha_data_internal(%rip), %xmm9 #1206.9 shufps $238, %xmm15, %xmm8 #1197.906 mulps %xmm8, %xmm2 #1199.17 mulps %xmm1, %xmm9 #1208.9 @@ -555,29 +555,29 @@ __svml_cbrtf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1212.540 lea 128(%rsp,%r12,4), %rsi #1212.540 -..___tag_value___svml_cbrtf4_ha_e9.61: -# __svml_scbrt_ha_cout_rare_internal(const float *, float *) - call __svml_scbrt_ha_cout_rare_internal #1212.540 -..___tag_value___svml_cbrtf4_ha_e9.62: +..___tag_value___jsvml_cbrtf4_ha_e9.61: +# __jsvml_scbrt_ha_cout_rare_internal(const float *, float *) + call __jsvml_scbrt_ha_cout_rare_internal #1212.540 +..___tag_value___jsvml_cbrtf4_ha_e9.62: jmp ..B3.8 # Prob 100% #1212.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrtf4_ha_e9,@function - .size __svml_cbrtf4_ha_e9,.-__svml_cbrtf4_ha_e9 -..LN__svml_cbrtf4_ha_e9.2: + .type __jsvml_cbrtf4_ha_e9,@function + .size __jsvml_cbrtf4_ha_e9,.-__jsvml_cbrtf4_ha_e9 +..LN__jsvml_cbrtf4_ha_e9.2: .data -# -- End __svml_cbrtf4_ha_e9 +# -- End __jsvml_cbrtf4_ha_e9 .text -.L_2__routine_start___svml_cbrtf16_ha_z0_3: -# -- Begin __svml_cbrtf16_ha_z0 +.L_2__routine_start___jsvml_cbrtf16_ha_z0_3: +# -- Begin __jsvml_cbrtf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrtf16_ha_z0 -# --- __svml_cbrtf16_ha_z0(__m512) -__svml_cbrtf16_ha_z0: + .globl __jsvml_cbrtf16_ha_z0 +# --- __jsvml_cbrtf16_ha_z0(__m512) +__jsvml_cbrtf16_ha_z0: # parameter 1: %zmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -586,35 +586,35 @@ __svml_cbrtf16_ha_z0: .byte 30 #1303.12 .byte 250 #1303.12 .cfi_startproc -..___tag_value___svml_cbrtf16_ha_z0.64: +..___tag_value___jsvml_cbrtf16_ha_z0.64: ..L65: #1220.1 vgetexpps {sae}, %zmm0, %zmm4 #1262.25 - vmovups 384+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm5 #1263.55 + vmovups 384+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm5 #1263.55 vgetmantps $0, {sae}, %zmm0, %zmm11 #1261.28 - vmovups 512+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm6 #1268.58 - vmovups 576+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm7 #1269.55 - vmovups 640+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm8 #1272.55 - vmovups 256+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm15 #1283.294 - vmovups 768+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm14 #1286.62 + vmovups 512+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm6 #1268.58 + vmovups 576+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm7 #1269.55 + vmovups 640+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm8 #1272.55 + vmovups 256+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm15 #1283.294 + vmovups 768+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm14 #1286.62 vrcp14ps %zmm11, %zmm10 #1267.24 vaddps {rn-sae}, %zmm5, %zmm4, %zmm9 #1264.25 - vandps 448+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm3 #1266.21 + vandps 448+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm0, %zmm3 #1266.21 vrndscaleps $88, {sae}, %zmm10, %zmm12 #1277.24 vfmsub231ps {rn-sae}, %zmm9, %zmm6, %zmm7 #1270.26 - vmovups 704+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm4 #1279.19 - vmovups 832+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm5 #1288.23 + vmovups 704+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm4 #1279.19 + vmovups 832+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm5 #1288.23 vpsrld $19, %zmm12, %zmm13 #1280.46 vrndscaleps $9, {sae}, %zmm7, %zmm2 #1271.26 vfmsub231ps {rn-sae}, %zmm12, %zmm11, %zmm4 #1279.19 - vmovups 128+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm11 #1282.294 - vpermt2ps 320+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm13, %zmm15 #1283.294 + vmovups 128+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm11 #1282.294 + vpermt2ps 320+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm13, %zmm15 #1283.294 vfnmadd231ps {rn-sae}, %zmm2, %zmm8, %zmm9 #1273.26 vfmadd231ps {rn-sae}, %zmm4, %zmm14, %zmm5 #1288.23 - vmovups 896+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm14 #1290.62 - vpermps __svml_scbrt_ha_data_internal_avx512(%rip), %zmm9, %zmm0 #1275.151 - vpermt2ps 192+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm13, %zmm11 #1282.294 - vpermps 64+__svml_scbrt_ha_data_internal_avx512(%rip), %zmm9, %zmm1 #1276.151 + vmovups 896+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm14 #1290.62 + vpermps __jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm9, %zmm0 #1275.151 + vpermt2ps 192+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm13, %zmm11 #1282.294 + vpermps 64+__jsvml_scbrt_ha_data_internal_avx512(%rip), %zmm9, %zmm1 #1276.151 vfmadd213ps {rn-sae}, %zmm14, %zmm4, %zmm5 #1291.23 vmulps {rn-sae}, %zmm11, %zmm0, %zmm6 #1284.27 vmovaps %zmm0, %zmm13 #1285.22 @@ -631,20 +631,20 @@ __svml_cbrtf16_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_cbrtf16_ha_z0,@function - .size __svml_cbrtf16_ha_z0,.-__svml_cbrtf16_ha_z0 -..LN__svml_cbrtf16_ha_z0.3: + .type __jsvml_cbrtf16_ha_z0,@function + .size __jsvml_cbrtf16_ha_z0,.-__jsvml_cbrtf16_ha_z0 +..LN__jsvml_cbrtf16_ha_z0.3: .data -# -- End __svml_cbrtf16_ha_z0 +# -- End __jsvml_cbrtf16_ha_z0 .text -.L_2__routine_start___svml_cbrtf8_ha_l9_4: -# -- Begin __svml_cbrtf8_ha_l9 +.L_2__routine_start___jsvml_cbrtf8_ha_l9_4: +# -- Begin __jsvml_cbrtf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrtf8_ha_l9 -# --- __svml_cbrtf8_ha_l9(__m256) -__svml_cbrtf8_ha_l9: + .globl __jsvml_cbrtf8_ha_l9 +# --- __jsvml_cbrtf8_ha_l9(__m256) +__jsvml_cbrtf8_ha_l9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -653,7 +653,7 @@ __svml_cbrtf8_ha_l9: .byte 30 #1417.546 .byte 250 #1417.546 .cfi_startproc -..___tag_value___svml_cbrtf8_ha_l9.67: +..___tag_value___jsvml_cbrtf8_ha_l9.67: ..L68: #1308.1 pushq %rbp #1308.1 @@ -663,10 +663,10 @@ __svml_cbrtf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #1308.1 subq $192, %rsp #1308.1 - lea __svml_scbrt_ha_data_internal(%rip), %rdx #1373.115 + lea __jsvml_scbrt_ha_data_internal(%rip), %rdx #1373.115 vmovaps %ymm0, %ymm7 #1308.1 vpsrld $16, %ymm7, %ymm5 #1371.13 - vpand 1408+__svml_scbrt_ha_data_internal(%rip), %ymm5, %ymm6 #1372.18 + vpand 1408+__jsvml_scbrt_ha_data_internal(%rip), %ymm5, %ymm6 #1372.18 vextractf128 $1, %ymm6, %xmm0 #1373.936 vmovd %xmm6, %eax #1373.203 vmovd %xmm0, %r8d #1373.917 @@ -695,30 +695,30 @@ __svml_cbrtf8_ha_l9: vpextrd $3, %xmm6, %edi #1373.695 movslq %esi, %rsi #1373.449 movslq %edi, %rdi #1373.607 - vpand 1472+__svml_scbrt_ha_data_internal(%rip), %ymm2, %ymm4 #1375.22 - vpand 1536+__svml_scbrt_ha_data_internal(%rip), %ymm2, %ymm2 #1388.14 + vpand 1472+__jsvml_scbrt_ha_data_internal(%rip), %ymm2, %ymm4 #1375.22 + vpand 1536+__jsvml_scbrt_ha_data_internal(%rip), %ymm2, %ymm2 #1388.14 vmovd (%rdx,%rsi), %xmm10 #1373.449 vmovd (%rdx,%rdi), %xmm11 #1373.607 vpunpcklqdq %xmm11, %xmm10, %xmm13 #1373.429 - vandps 1792+__svml_scbrt_ha_data_internal(%rip), %ymm7, %ymm5 #1376.14 - vandps 1152+__svml_scbrt_ha_data_internal(%rip), %ymm7, %ymm10 #1380.9 - vandps 1216+__svml_scbrt_ha_data_internal(%rip), %ymm7, %ymm11 #1381.10 - vpsubd 1856+__svml_scbrt_ha_data_internal(%rip), %ymm5, %ymm9 #1377.14 + vandps 1792+__jsvml_scbrt_ha_data_internal(%rip), %ymm7, %ymm5 #1376.14 + vandps 1152+__jsvml_scbrt_ha_data_internal(%rip), %ymm7, %ymm10 #1380.9 + vandps 1216+__jsvml_scbrt_ha_data_internal(%rip), %ymm7, %ymm11 #1381.10 + vpsubd 1856+__jsvml_scbrt_ha_data_internal(%rip), %ymm5, %ymm9 #1377.14 vshufps $136, %xmm13, %xmm12, %xmm14 #1373.75 - vorps 1280+__svml_scbrt_ha_data_internal(%rip), %ymm10, %ymm12 #1382.9 - vorps 1344+__svml_scbrt_ha_data_internal(%rip), %ymm11, %ymm13 #1383.10 - vpmulld 1728+__svml_scbrt_ha_data_internal(%rip), %ymm4, %ymm5 #1387.16 - vpsubd 1664+__svml_scbrt_ha_data_internal(%rip), %ymm4, %ymm4 #1389.24 + vorps 1280+__jsvml_scbrt_ha_data_internal(%rip), %ymm10, %ymm12 #1382.9 + vorps 1344+__jsvml_scbrt_ha_data_internal(%rip), %ymm11, %ymm13 #1383.10 + vpmulld 1728+__jsvml_scbrt_ha_data_internal(%rip), %ymm4, %ymm5 #1387.16 + vpsubd 1664+__jsvml_scbrt_ha_data_internal(%rip), %ymm4, %ymm4 #1389.24 vsubps %ymm13, %ymm12, %ymm0 #1384.9 vpsrld $12, %ymm5, %ymm12 #1390.11 vpsubd %ymm12, %ymm4, %ymm10 #1391.11 vpsubd %ymm12, %ymm10, %ymm11 #1392.11 vpsubd %ymm12, %ymm11, %ymm13 #1393.11 - vpcmpgtd 1920+__svml_scbrt_ha_data_internal(%rip), %ymm9, %ymm3 #1378.19 + vpcmpgtd 1920+__jsvml_scbrt_ha_data_internal(%rip), %ymm9, %ymm3 #1378.19 vmovmskps %ymm3, %eax #1379.41 vinsertf128 $1, %xmm8, %ymm14, %ymm1 #1373.11 vpslld $7, %ymm13, %ymm14 #1394.11 - vpaddd 1600+__svml_scbrt_ha_data_internal(%rip), %ymm12, %ymm8 #1395.11 + vpaddd 1600+__jsvml_scbrt_ha_data_internal(%rip), %ymm12, %ymm8 #1395.11 vmulps %ymm0, %ymm1, %ymm1 #1385.9 vpaddd %ymm14, %ymm6, %ymm6 #1399.19 vpor %ymm2, %ymm8, %ymm9 #1396.11 @@ -760,10 +760,10 @@ __svml_cbrtf8_ha_l9: vunpckhps %ymm5, %ymm4, %ymm8 #1402.2339 vmulps %ymm6, %ymm0, %ymm9 #1403.17 vmulps %ymm8, %ymm0, %ymm8 #1404.17 - vmovups 896+__svml_scbrt_ha_data_internal(%rip), %ymm0 #1405.43 - vfmadd213ps 960+__svml_scbrt_ha_data_internal(%rip), %ymm1, %ymm0 #1407.9 - vfmadd213ps 1024+__svml_scbrt_ha_data_internal(%rip), %ymm1, %ymm0 #1409.9 - vfmadd213ps 1088+__svml_scbrt_ha_data_internal(%rip), %ymm1, %ymm0 #1411.9 + vmovups 896+__jsvml_scbrt_ha_data_internal(%rip), %ymm0 #1405.43 + vfmadd213ps 960+__jsvml_scbrt_ha_data_internal(%rip), %ymm1, %ymm0 #1407.9 + vfmadd213ps 1024+__jsvml_scbrt_ha_data_internal(%rip), %ymm1, %ymm0 #1409.9 + vfmadd213ps 1088+__jsvml_scbrt_ha_data_internal(%rip), %ymm1, %ymm0 #1411.9 vmulps %ymm9, %ymm1, %ymm1 #1412.15 vmulps %ymm1, %ymm0, %ymm0 #1413.9 vaddps %ymm0, %ymm8, %ymm1 #1414.9 @@ -827,29 +827,29 @@ __svml_cbrtf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1417.546 lea 128(%rsp,%r12,4), %rsi #1417.546 -..___tag_value___svml_cbrtf8_ha_l9.85: -# __svml_scbrt_ha_cout_rare_internal(const float *, float *) - call __svml_scbrt_ha_cout_rare_internal #1417.546 -..___tag_value___svml_cbrtf8_ha_l9.86: +..___tag_value___jsvml_cbrtf8_ha_l9.85: +# __jsvml_scbrt_ha_cout_rare_internal(const float *, float *) + call __jsvml_scbrt_ha_cout_rare_internal #1417.546 +..___tag_value___jsvml_cbrtf8_ha_l9.86: jmp ..B5.8 # Prob 100% #1417.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrtf8_ha_l9,@function - .size __svml_cbrtf8_ha_l9,.-__svml_cbrtf8_ha_l9 -..LN__svml_cbrtf8_ha_l9.4: + .type __jsvml_cbrtf8_ha_l9,@function + .size __jsvml_cbrtf8_ha_l9,.-__jsvml_cbrtf8_ha_l9 +..LN__jsvml_cbrtf8_ha_l9.4: .data -# -- End __svml_cbrtf8_ha_l9 +# -- End __jsvml_cbrtf8_ha_l9 .text -.L_2__routine_start___svml_cbrtf8_ha_e9_5: -# -- Begin __svml_cbrtf8_ha_e9 +.L_2__routine_start___jsvml_cbrtf8_ha_e9_5: +# -- Begin __jsvml_cbrtf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cbrtf8_ha_e9 -# --- __svml_cbrtf8_ha_e9(__m256) -__svml_cbrtf8_ha_e9: + .globl __jsvml_cbrtf8_ha_e9 +# --- __jsvml_cbrtf8_ha_e9(__m256) +__jsvml_cbrtf8_ha_e9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -858,7 +858,7 @@ __svml_cbrtf8_ha_e9: .byte 30 #1534.546 .byte 250 #1534.546 .cfi_startproc -..___tag_value___svml_cbrtf8_ha_e9.88: +..___tag_value___jsvml_cbrtf8_ha_e9.88: ..L89: #1425.1 pushq %rbp #1425.1 @@ -868,15 +868,15 @@ __svml_cbrtf8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1425.1 subq $192, %rsp #1425.1 - lea __svml_scbrt_ha_data_internal(%rip), %rdx #1490.115 + lea __jsvml_scbrt_ha_data_internal(%rip), %rdx #1490.115 vmovaps %ymm0, %ymm15 #1425.1 - vmovups 1408+__svml_scbrt_ha_data_internal(%rip), %xmm10 #1475.26 - vmovups 1472+__svml_scbrt_ha_data_internal(%rip), %xmm0 #1476.22 - vmovups 1792+__svml_scbrt_ha_data_internal(%rip), %xmm3 #1484.21 - vmovups 1856+__svml_scbrt_ha_data_internal(%rip), %xmm4 #1485.22 - vmovups 1920+__svml_scbrt_ha_data_internal(%rip), %xmm5 #1486.22 - vmovups 1536+__svml_scbrt_ha_data_internal(%rip), %xmm1 #1477.22 - vmovups 1600+__svml_scbrt_ha_data_internal(%rip), %xmm2 #1479.18 + vmovups 1408+__jsvml_scbrt_ha_data_internal(%rip), %xmm10 #1475.26 + vmovups 1472+__jsvml_scbrt_ha_data_internal(%rip), %xmm0 #1476.22 + vmovups 1792+__jsvml_scbrt_ha_data_internal(%rip), %xmm3 #1484.21 + vmovups 1856+__jsvml_scbrt_ha_data_internal(%rip), %xmm4 #1485.22 + vmovups 1920+__jsvml_scbrt_ha_data_internal(%rip), %xmm5 #1486.22 + vmovups 1536+__jsvml_scbrt_ha_data_internal(%rip), %xmm1 #1477.22 + vmovups 1600+__jsvml_scbrt_ha_data_internal(%rip), %xmm2 #1479.18 vpsrld $16, %xmm15, %xmm7 #1488.17 vextractf128 $1, %ymm15, %xmm6 #1487.101 vpand %xmm10, %xmm7, %xmm9 #1489.22 @@ -928,14 +928,14 @@ __svml_cbrtf8_ha_e9: vpackssdw %xmm6, %xmm0, %xmm4 #1496.75 vpxor %xmm5, %xmm5, %xmm5 #1496.58 vpacksswb %xmm5, %xmm4, %xmm3 #1496.58 - vandps 1152+__svml_scbrt_ha_data_internal(%rip), %ymm15, %ymm4 #1497.9 - vandps 1216+__svml_scbrt_ha_data_internal(%rip), %ymm15, %ymm5 #1498.10 - vorps 1280+__svml_scbrt_ha_data_internal(%rip), %ymm4, %ymm14 #1499.9 + vandps 1152+__jsvml_scbrt_ha_data_internal(%rip), %ymm15, %ymm4 #1497.9 + vandps 1216+__jsvml_scbrt_ha_data_internal(%rip), %ymm15, %ymm5 #1498.10 + vorps 1280+__jsvml_scbrt_ha_data_internal(%rip), %ymm4, %ymm14 #1499.9 vpmovmskb %xmm3, %eax #1496.39 - vorps 1344+__svml_scbrt_ha_data_internal(%rip), %ymm5, %ymm3 #1500.10 + vorps 1344+__jsvml_scbrt_ha_data_internal(%rip), %ymm5, %ymm3 #1500.10 vsubps %ymm3, %ymm14, %ymm4 #1501.9 vmulps %ymm4, %ymm11, %ymm3 #1502.9 - vmovups 1728+__svml_scbrt_ha_data_internal(%rip), %xmm4 #1503.17 + vmovups 1728+__jsvml_scbrt_ha_data_internal(%rip), %xmm4 #1503.17 vpmulld %xmm4, %xmm13, %xmm14 #1504.97 vpmulld %xmm4, %xmm7, %xmm11 #1504.20 vpsrld $12, %xmm14, %xmm4 #1507.69 @@ -945,7 +945,7 @@ __svml_cbrtf8_ha_e9: vpor %xmm8, %xmm1, %xmm2 #1513.74 vpslld $23, %xmm2, %xmm1 #1514.64 vpor %xmm12, %xmm11, %xmm14 #1513.15 - vmovups 1664+__svml_scbrt_ha_data_internal(%rip), %xmm2 #1506.28 + vmovups 1664+__jsvml_scbrt_ha_data_internal(%rip), %xmm2 #1506.28 vpslld $23, %xmm14, %xmm14 #1514.15 vpsubd %xmm2, %xmm7, %xmm7 #1506.28 vpsubd %xmm5, %xmm7, %xmm7 #1508.15 @@ -998,13 +998,13 @@ __svml_cbrtf8_ha_e9: vunpckhps %ymm4, %ymm2, %ymm6 #1519.1967 vmulps %ymm5, %ymm1, %ymm7 #1520.17 vmulps %ymm6, %ymm1, %ymm5 #1521.17 - vmulps 896+__svml_scbrt_ha_data_internal(%rip), %ymm3, %ymm1 #1524.24 - vaddps 960+__svml_scbrt_ha_data_internal(%rip), %ymm1, %ymm1 #1524.9 + vmulps 896+__jsvml_scbrt_ha_data_internal(%rip), %ymm3, %ymm1 #1524.24 + vaddps 960+__jsvml_scbrt_ha_data_internal(%rip), %ymm1, %ymm1 #1524.9 vmulps %ymm1, %ymm3, %ymm6 #1526.24 - vaddps 1024+__svml_scbrt_ha_data_internal(%rip), %ymm6, %ymm0 #1526.9 + vaddps 1024+__jsvml_scbrt_ha_data_internal(%rip), %ymm6, %ymm0 #1526.9 vmulps %ymm0, %ymm3, %ymm2 #1528.24 vmulps %ymm7, %ymm3, %ymm3 #1529.15 - vaddps 1088+__svml_scbrt_ha_data_internal(%rip), %ymm2, %ymm4 #1528.9 + vaddps 1088+__jsvml_scbrt_ha_data_internal(%rip), %ymm2, %ymm4 #1528.9 vmulps %ymm3, %ymm4, %ymm0 #1530.9 vaddps %ymm0, %ymm5, %ymm1 #1531.9 vaddps %ymm1, %ymm7, %ymm0 #1532.10 @@ -1068,30 +1068,30 @@ __svml_cbrtf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1534.546 lea 128(%rsp,%r12,4), %rsi #1534.546 -..___tag_value___svml_cbrtf8_ha_e9.106: -# __svml_scbrt_ha_cout_rare_internal(const float *, float *) - call __svml_scbrt_ha_cout_rare_internal #1534.546 -..___tag_value___svml_cbrtf8_ha_e9.107: +..___tag_value___jsvml_cbrtf8_ha_e9.106: +# __jsvml_scbrt_ha_cout_rare_internal(const float *, float *) + call __jsvml_scbrt_ha_cout_rare_internal #1534.546 +..___tag_value___jsvml_cbrtf8_ha_e9.107: jmp ..B6.8 # Prob 100% #1534.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_cbrtf8_ha_e9,@function - .size __svml_cbrtf8_ha_e9,.-__svml_cbrtf8_ha_e9 -..LN__svml_cbrtf8_ha_e9.5: + .type __jsvml_cbrtf8_ha_e9,@function + .size __jsvml_cbrtf8_ha_e9,.-__jsvml_cbrtf8_ha_e9 +..LN__jsvml_cbrtf8_ha_e9.5: .data -# -- End __svml_cbrtf8_ha_e9 +# -- End __jsvml_cbrtf8_ha_e9 .text -.L_2__routine_start___svml_scbrt_ha_cout_rare_internal_6: -# -- Begin __svml_scbrt_ha_cout_rare_internal +.L_2__routine_start___jsvml_scbrt_ha_cout_rare_internal_6: +# -- Begin __jsvml_scbrt_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_scbrt_ha_cout_rare_internal - .globl __svml_scbrt_ha_cout_rare_internal -# --- __svml_scbrt_ha_cout_rare_internal(const float *, float *) -__svml_scbrt_ha_cout_rare_internal: + .hidden __jsvml_scbrt_ha_cout_rare_internal + .globl __jsvml_scbrt_ha_cout_rare_internal +# --- __jsvml_scbrt_ha_cout_rare_internal(const float *, float *) +__jsvml_scbrt_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1101,7 +1101,7 @@ __svml_scbrt_ha_cout_rare_internal: .byte 30 #847.15 .byte 250 #847.15 .cfi_startproc -..___tag_value___svml_scbrt_ha_cout_rare_internal.109: +..___tag_value___jsvml_scbrt_ha_cout_rare_internal.109: ..L110: #740.1 movq %rsi, %r9 #740.1 @@ -1231,11 +1231,11 @@ __svml_scbrt_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_scbrt_ha_cout_rare_internal,@function - .size __svml_scbrt_ha_cout_rare_internal,.-__svml_scbrt_ha_cout_rare_internal -..LN__svml_scbrt_ha_cout_rare_internal.6: + .type __jsvml_scbrt_ha_cout_rare_internal,@function + .size __jsvml_scbrt_ha_cout_rare_internal,.-__jsvml_scbrt_ha_cout_rare_internal +..LN__jsvml_scbrt_ha_cout_rare_internal.6: .data -# -- End __svml_scbrt_ha_cout_rare_internal +# -- End __jsvml_scbrt_ha_cout_rare_internal .data .align 64 .align 64 @@ -1731,9 +1731,9 @@ vscbrt_ha_cout_data: .type vscbrt_ha_cout_data,@object .size vscbrt_ha_cout_data,1920 .align 64 - .hidden __svml_scbrt_ha_data_internal_avx512 - .globl __svml_scbrt_ha_data_internal_avx512 -__svml_scbrt_ha_data_internal_avx512: + .hidden __jsvml_scbrt_ha_data_internal_avx512 + .globl __jsvml_scbrt_ha_data_internal_avx512 +__jsvml_scbrt_ha_data_internal_avx512: .long 1065353216 .long 1067533592 .long 1070280693 @@ -1974,12 +1974,12 @@ __svml_scbrt_ha_data_internal_avx512: .long 1051372202 .long 1051372202 .long 1051372202 - .type __svml_scbrt_ha_data_internal_avx512,@object - .size __svml_scbrt_ha_data_internal_avx512,960 + .type __jsvml_scbrt_ha_data_internal_avx512,@object + .size __jsvml_scbrt_ha_data_internal_avx512,960 .align 64 - .hidden __svml_scbrt_ha_data_internal - .globl __svml_scbrt_ha_data_internal -__svml_scbrt_ha_data_internal: + .hidden __jsvml_scbrt_ha_data_internal + .globl __jsvml_scbrt_ha_data_internal +__jsvml_scbrt_ha_data_internal: .long 3212578753 .long 3212085645 .long 3211621124 @@ -2476,8 +2476,8 @@ __svml_scbrt_ha_data_internal: .long 4278190079 .long 4278190079 .long 4278190079 - .type __svml_scbrt_ha_data_internal,@object - .size __svml_scbrt_ha_data_internal,1984 + .type __jsvml_scbrt_ha_data_internal,@object + .size __jsvml_scbrt_ha_data_internal,1984 .align 16 .L_2il0floatpacket.46: .long 0xffffffff,0x00000000,0xffffffff,0x00000000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_cos_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cos_linux_x86.S similarity index 94% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_cos_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cos_linux_x86.S index 6beef42418c..ff7de767bd7 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_cos_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cos_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_cos.c" .text ..TXTST0: -.L_2__routine_start___svml_cosf8_ha_e9_0: -# -- Begin __svml_cosf8_ha_e9 +.L_2__routine_start___jsvml_cosf8_ha_e9_0: +# -- Begin __jsvml_cosf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosf8_ha_e9 -# --- __svml_cosf8_ha_e9(__m256) -__svml_cosf8_ha_e9: + .globl __jsvml_cosf8_ha_e9 +# --- __jsvml_cosf8_ha_e9(__m256) +__jsvml_cosf8_ha_e9: # parameter 1: %ymm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_cosf8_ha_e9: .byte 30 #1008.14 .byte 250 #1008.14 .cfi_startproc -..___tag_value___svml_cosf8_ha_e9.1: +..___tag_value___jsvml_cosf8_ha_e9.1: ..L2: #666.1 pushq %rbp #666.1 @@ -59,22 +59,22 @@ __svml_cosf8_ha_e9: pushq %r15 #666.1 subq $312, %rsp #666.1 xorl %eax, %eax #682.1 - vandps 4096+__svml_scos_ha_data_internal(%rip), %ymm0, %ymm8 #685.10 - vaddps 5504+__svml_scos_ha_data_internal(%rip), %ymm8, %ymm9 #686.9 - vcmpnle_uqps 4160+__svml_scos_ha_data_internal(%rip), %ymm8, %ymm1 #688.26 - vmovups 5440+__svml_scos_ha_data_internal(%rip), %ymm14 #707.57 - vmulps 5376+__svml_scos_ha_data_internal(%rip), %ymm9, %ymm10 #709.32 + vandps 4096+__jsvml_scos_ha_data_internal(%rip), %ymm0, %ymm8 #685.10 + vaddps 5504+__jsvml_scos_ha_data_internal(%rip), %ymm8, %ymm9 #686.9 + vcmpnle_uqps 4160+__jsvml_scos_ha_data_internal(%rip), %ymm8, %ymm1 #688.26 + vmovups 5440+__jsvml_scos_ha_data_internal(%rip), %ymm14 #707.57 + vmulps 5376+__jsvml_scos_ha_data_internal(%rip), %ymm9, %ymm10 #709.32 vaddps %ymm10, %ymm14, %ymm11 #709.17 vpslld $31, %xmm11, %xmm12 #710.84 vsubps %ymm14, %ymm11, %ymm2 #711.17 vextractf128 $1, %ymm11, %xmm13 #710.215 - vsubps 5568+__svml_scos_ha_data_internal(%rip), %ymm2, %ymm4 #713.17 + vsubps 5568+__jsvml_scos_ha_data_internal(%rip), %ymm2, %ymm4 #713.17 vpslld $31, %xmm13, %xmm15 #710.181 - vmovupd 4992+__svml_scos_ha_data_internal(%rip), %ymm13 #716.55 + vmovupd 4992+__jsvml_scos_ha_data_internal(%rip), %ymm13 #716.55 vextractf128 $1, %ymm4, %xmm3 #714.105 vcvtps2pd %xmm4, %ymm5 #714.23 vcvtps2pd %xmm3, %ymm6 #714.88 - vmovupd 5056+__svml_scos_ha_data_internal(%rip), %ymm3 #718.55 + vmovupd 5056+__jsvml_scos_ha_data_internal(%rip), %ymm3 #718.55 vmulpd %ymm13, %ymm6, %ymm14 #717.115 vmulpd %ymm3, %ymm6, %ymm6 #719.115 vinsertf128 $1, %xmm15, %ymm12, %ymm7 #710.20 @@ -87,17 +87,17 @@ __svml_cosf8_ha_e9: vsubpd %ymm5, %ymm2, %ymm4 #719.19 vsubpd %ymm14, %ymm15, %ymm9 #717.91 vmulpd %ymm4, %ymm4, %ymm14 #720.20 - vmovupd 5184+__svml_scos_ha_data_internal(%rip), %ymm15 #724.54 + vmovupd 5184+__jsvml_scos_ha_data_internal(%rip), %ymm15 #724.54 vsubpd %ymm6, %ymm9, %ymm2 #719.91 - vmovupd 5312+__svml_scos_ha_data_internal(%rip), %ymm6 #721.54 - vmovupd 5248+__svml_scos_ha_data_internal(%rip), %ymm9 #722.54 + vmovupd 5312+__jsvml_scos_ha_data_internal(%rip), %ymm6 #721.54 + vmovupd 5248+__jsvml_scos_ha_data_internal(%rip), %ymm9 #722.54 vmulpd %ymm2, %ymm2, %ymm3 #720.66 vmulpd %ymm14, %ymm6, %ymm5 #723.34 vmulpd %ymm3, %ymm6, %ymm10 #723.108 vaddpd %ymm5, %ymm9, %ymm11 #723.19 vaddpd %ymm10, %ymm9, %ymm13 #723.93 vmulpd %ymm11, %ymm14, %ymm12 #725.34 - vmovupd 5120+__svml_scos_ha_data_internal(%rip), %ymm10 #726.54 + vmovupd 5120+__jsvml_scos_ha_data_internal(%rip), %ymm10 #726.54 vmulpd %ymm13, %ymm3, %ymm13 #725.107 vaddpd %ymm12, %ymm15, %ymm5 #725.19 vaddpd %ymm13, %ymm15, %ymm9 #725.92 @@ -185,16 +185,16 @@ __svml_cosf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r15,4), %rdi #1011.546 lea 128(%rsp,%r15,4), %rsi #1011.546 -..___tag_value___svml_cosf8_ha_e9.17: -# __svml_scos_ha_cout_rare_internal(const float *, float *) - call __svml_scos_ha_cout_rare_internal #1011.546 -..___tag_value___svml_cosf8_ha_e9.18: +..___tag_value___jsvml_cosf8_ha_e9.17: +# __jsvml_scos_ha_cout_rare_internal(const float *, float *) + call __jsvml_scos_ha_cout_rare_internal #1011.546 +..___tag_value___jsvml_cosf8_ha_e9.18: jmp ..B1.9 # Prob 100% #1011.546 .cfi_restore 12 # LOE rbx r13 r14 r12d r15d ..B1.12: # Preds ..B1.1 # Execution count [5.00e-02]: Infreq - vmovups 4224+__svml_scos_ha_data_internal(%rip), %ymm2 #757.53 + vmovups 4224+__jsvml_scos_ha_data_internal(%rip), %ymm2 #757.53 movl $2139095040, %r15d #846.24 vmovups %ymm0, (%rsp) #[spill] vmovups %ymm14, 64(%rsp) #[spill] @@ -203,7 +203,7 @@ __svml_cosf8_ha_e9: vandps %ymm8, %ymm2, %ymm3 #758.14 vmovd %r15d, %xmm8 #846.24 vcmpeqps %ymm2, %ymm3, %ymm5 #759.21 - lea __svml_scos_ha_reduction_data_internal(%rip), %rdx #849.1256 + lea __jsvml_scos_ha_reduction_data_internal(%rip), %rdx #849.1256 vpshufd $0, %xmm8, %xmm10 #846.24 vpand %xmm0, %xmm10, %xmm9 #847.22 vextractf128 $1, %ymm0, %xmm15 #845.109 @@ -293,7 +293,7 @@ __svml_cosf8_ha_e9: vpunpcklqdq %xmm12, %xmm3, %xmm7 #851.2964 vpsrld $16, %xmm10, %xmm11 #862.16 vpshufd $0, %xmm0, %xmm15 #859.23 - lea __svml_scos_ha_data_internal(%rip), %r10 #979.878 + lea __jsvml_scos_ha_data_internal(%rip), %r10 #979.878 vshufps $136, %xmm7, %xmm4, %xmm3 #851.2745 vpand %xmm15, %xmm5, %xmm7 #861.16 vpand %xmm15, %xmm14, %xmm9 #867.16 @@ -569,16 +569,16 @@ __svml_cosf8_ha_e9: vsubps %ymm4, %ymm12, %ymm6 #987.18 vaddps %ymm6, %ymm10, %ymm15 #988.18 vsubps %ymm9, %ymm4, %ymm10 #989.18 - vmulps 4352+__svml_scos_ha_data_internal(%rip), %ymm5, %ymm4 #994.29 + vmulps 4352+__jsvml_scos_ha_data_internal(%rip), %ymm5, %ymm4 #994.29 vaddps %ymm10, %ymm7, %ymm7 #990.18 vaddps %ymm7, %ymm15, %ymm6 #991.22 - vaddps 4288+__svml_scos_ha_data_internal(%rip), %ymm4, %ymm7 #994.14 + vaddps 4288+__jsvml_scos_ha_data_internal(%rip), %ymm4, %ymm7 #994.14 vmulps %ymm7, %ymm5, %ymm10 #995.14 vaddps %ymm8, %ymm13, %ymm7 #997.13 - vmulps 4480+__svml_scos_ha_data_internal(%rip), %ymm5, %ymm13 #1000.29 + vmulps 4480+__jsvml_scos_ha_data_internal(%rip), %ymm5, %ymm13 #1000.29 vmulps %ymm10, %ymm3, %ymm4 #996.14 vmulps %ymm12, %ymm3, %ymm3 #1002.35 - vaddps 4416+__svml_scos_ha_data_internal(%rip), %ymm13, %ymm13 #1000.14 + vaddps 4416+__jsvml_scos_ha_data_internal(%rip), %ymm13, %ymm13 #1000.14 vsubps %ymm3, %ymm7, %ymm3 #1002.13 vmulps %ymm13, %ymm5, %ymm5 #1001.14 vmulps %ymm3, %ymm2, %ymm2 #1003.31 @@ -595,20 +595,20 @@ __svml_cosf8_ha_e9: # LOE rbx r12 r13 r14 eax ymm0 ymm14 .cfi_endproc # mark_end; - .type __svml_cosf8_ha_e9,@function - .size __svml_cosf8_ha_e9,.-__svml_cosf8_ha_e9 -..LN__svml_cosf8_ha_e9.0: + .type __jsvml_cosf8_ha_e9,@function + .size __jsvml_cosf8_ha_e9,.-__jsvml_cosf8_ha_e9 +..LN__jsvml_cosf8_ha_e9.0: .data -# -- End __svml_cosf8_ha_e9 +# -- End __jsvml_cosf8_ha_e9 .text -.L_2__routine_start___svml_cosf4_ha_ex_1: -# -- Begin __svml_cosf4_ha_ex +.L_2__routine_start___jsvml_cosf4_ha_ex_1: +# -- Begin __jsvml_cosf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_cosf4_ha_ex -# --- __svml_cosf4_ha_ex(__m128) -__svml_cosf4_ha_ex: + .globl __jsvml_cosf4_ha_ex +# --- __jsvml_cosf4_ha_ex(__m128) +__jsvml_cosf4_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -617,7 +617,7 @@ __svml_cosf4_ha_ex: .byte 30 #1362.14 .byte 250 #1362.14 .cfi_startproc -..___tag_value___svml_cosf4_ha_ex.49: +..___tag_value___jsvml_cosf4_ha_ex.49: ..L50: #1020.1 pushq %rbp #1020.1 @@ -628,29 +628,29 @@ __svml_cosf4_ha_ex: andq $-64, %rsp #1020.1 subq $192, %rsp #1020.1 xorl %eax, %eax #1036.1 - movups 4096+__svml_scos_ha_data_internal(%rip), %xmm8 #1039.10 - movups 5504+__svml_scos_ha_data_internal(%rip), %xmm10 #1037.44 + movups 4096+__jsvml_scos_ha_data_internal(%rip), %xmm8 #1039.10 + movups 5504+__jsvml_scos_ha_data_internal(%rip), %xmm10 #1037.44 andps %xmm0, %xmm8 #1039.10 - movups 5440+__svml_scos_ha_data_internal(%rip), %xmm9 #1061.54 + movups 5440+__jsvml_scos_ha_data_internal(%rip), %xmm9 #1061.54 movaps %xmm8, %xmm11 #1069.75 - movups 4992+__svml_scos_ha_data_internal(%rip), %xmm13 #1070.52 + movups 4992+__jsvml_scos_ha_data_internal(%rip), %xmm13 #1070.52 movaps %xmm8, %xmm7 #1042.26 movaps %xmm13, %xmm12 #1071.40 addps %xmm8, %xmm10 #1040.9 cvtps2pd %xmm8, %xmm5 #1069.23 - cmpnleps 4160+__svml_scos_ha_data_internal(%rip), %xmm7 #1042.26 - mulps 5376+__svml_scos_ha_data_internal(%rip), %xmm10 #1063.29 + cmpnleps 4160+__jsvml_scos_ha_data_internal(%rip), %xmm7 #1042.26 + mulps 5376+__jsvml_scos_ha_data_internal(%rip), %xmm10 #1063.29 movmskps %xmm7, %edx #1088.74 movhlps %xmm8, %xmm11 #1069.75 addps %xmm9, %xmm10 #1063.17 cvtps2pd %xmm11, %xmm4 #1069.61 movaps %xmm10, %xmm6 #1064.38 subps %xmm9, %xmm10 #1065.17 - movups 5056+__svml_scos_ha_data_internal(%rip), %xmm15 #1072.52 + movups 5056+__jsvml_scos_ha_data_internal(%rip), %xmm15 #1072.52 pslld $31, %xmm6 #1064.38 - movups 5312+__svml_scos_ha_data_internal(%rip), %xmm9 #1075.51 - movups 5184+__svml_scos_ha_data_internal(%rip), %xmm11 #1078.51 - subps 5568+__svml_scos_ha_data_internal(%rip), %xmm10 #1067.17 + movups 5312+__jsvml_scos_ha_data_internal(%rip), %xmm9 #1075.51 + movups 5184+__jsvml_scos_ha_data_internal(%rip), %xmm11 #1078.51 + subps 5568+__jsvml_scos_ha_data_internal(%rip), %xmm10 #1067.17 cvtps2pd %xmm10, %xmm14 #1068.23 movhlps %xmm10, %xmm10 #1068.74 cvtps2pd %xmm10, %xmm1 #1068.60 @@ -669,7 +669,7 @@ __svml_cosf4_ha_ex: movaps %xmm9, %xmm1 #1077.31 mulpd %xmm3, %xmm1 #1077.31 mulpd %xmm2, %xmm9 #1077.99 - movups 5248+__svml_scos_ha_data_internal(%rip), %xmm10 #1076.51 + movups 5248+__jsvml_scos_ha_data_internal(%rip), %xmm10 #1076.51 addpd %xmm10, %xmm1 #1077.19 addpd %xmm9, %xmm10 #1077.87 mulpd %xmm3, %xmm1 #1079.31 @@ -678,7 +678,7 @@ __svml_cosf4_ha_ex: addpd %xmm10, %xmm11 #1079.86 mulpd %xmm3, %xmm1 #1081.31 mulpd %xmm2, %xmm11 #1081.98 - movups 5120+__svml_scos_ha_data_internal(%rip), %xmm12 #1080.51 + movups 5120+__jsvml_scos_ha_data_internal(%rip), %xmm12 #1080.51 addpd %xmm12, %xmm1 #1081.19 addpd %xmm11, %xmm12 #1081.86 mulpd %xmm1, %xmm3 #1082.19 @@ -752,10 +752,10 @@ __svml_cosf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1365.540 lea 128(%rsp,%r12,4), %rsi #1365.540 -..___tag_value___svml_cosf4_ha_ex.67: -# __svml_scos_ha_cout_rare_internal(const float *, float *) - call __svml_scos_ha_cout_rare_internal #1365.540 -..___tag_value___svml_cosf4_ha_ex.68: +..___tag_value___jsvml_cosf4_ha_ex.67: +# __jsvml_scos_ha_cout_rare_internal(const float *, float *) + call __jsvml_scos_ha_cout_rare_internal #1365.540 +..___tag_value___jsvml_cosf4_ha_ex.68: jmp ..B2.9 # Prob 100% #1365.540 .cfi_restore 12 .cfi_restore 13 @@ -763,8 +763,8 @@ __svml_cosf4_ha_ex: ..B2.12: # Preds ..B2.1 # Execution count [5.00e-02]: Infreq movl $2139095040, %edx #1200.18 - lea __svml_scos_ha_reduction_data_internal(%rip), %r9 #1203.803 - movups 4224+__svml_scos_ha_data_internal(%rip), %xmm15 #1111.50 + lea __jsvml_scos_ha_reduction_data_internal(%rip), %r9 #1203.803 + movups 4224+__jsvml_scos_ha_data_internal(%rip), %xmm15 #1111.50 movl $8388607, %r10d #1209.21 andps %xmm15, %xmm8 #1112.14 movl $8388608, %r11d #1210.20 @@ -1008,7 +1008,7 @@ __svml_cosf4_ha_ex: movl $897581056, %r9d #1322.34 pshufd $0, %xmm4, %xmm12 #1306.39 movl $255, %r10d #1278.15 - lea __svml_scos_ha_data_internal(%rip), %rdi #1333.614 + lea __jsvml_scos_ha_data_internal(%rip), %rdi #1333.614 addps %xmm1, %xmm15 #1300.11 andps %xmm15, %xmm8 #1308.20 subps %xmm15, %xmm2 #1301.17 @@ -1062,7 +1062,7 @@ __svml_cosf4_ha_ex: movd (%rdx,%rdi), %xmm15 #1333.1163 movd (%rcx,%rdi), %xmm14 #1333.1267 punpcklqdq %xmm4, %xmm5 #1335.1247 - movups 4352+__svml_scos_ha_data_internal(%rip), %xmm4 #1348.26 + movups 4352+__jsvml_scos_ha_data_internal(%rip), %xmm4 #1348.26 punpcklqdq %xmm15, %xmm10 #1333.1061 punpcklqdq %xmm7, %xmm14 #1333.1247 movd 4(%r11,%rdi), %xmm7 #1334.1080 @@ -1071,7 +1071,7 @@ __svml_cosf4_ha_ex: movd 8(%rdx,%rdi), %xmm3 #1335.1163 movd 12(%rdx,%rdi), %xmm6 #1336.1165 shufps $136, %xmm14, %xmm10 #1333.1041 - addps 4288+__svml_scos_ha_data_internal(%rip), %xmm4 #1348.14 + addps 4288+__jsvml_scos_ha_data_internal(%rip), %xmm4 #1348.14 punpcklqdq %xmm13, %xmm7 #1334.1061 movd 8(%r11,%rdi), %xmm14 #1335.1080 movd 12(%r11,%rdi), %xmm13 #1336.1082 @@ -1094,13 +1094,13 @@ __svml_cosf4_ha_ex: shufps $136, %xmm2, %xmm7 #1334.1041 movaps %xmm7, %xmm2 #1339.22 movaps %xmm7, %xmm1 #1341.18 - movups 4480+__svml_scos_ha_data_internal(%rip), %xmm13 #1354.26 + movups 4480+__jsvml_scos_ha_data_internal(%rip), %xmm13 #1354.26 addps %xmm5, %xmm2 #1339.22 mulps %xmm8, %xmm4 #1350.14 mulps %xmm11, %xmm13 #1354.26 mulps %xmm7, %xmm8 #1356.32 subps %xmm2, %xmm1 #1341.18 - addps 4416+__svml_scos_ha_data_internal(%rip), %xmm13 #1354.14 + addps 4416+__jsvml_scos_ha_data_internal(%rip), %xmm13 #1354.14 subps %xmm8, %xmm10 #1356.13 addps %xmm1, %xmm5 #1342.18 mulps %xmm13, %xmm11 #1355.14 @@ -1127,20 +1127,20 @@ __svml_cosf4_ha_ex: # LOE rbx r12 r13 r14 r15 eax xmm0 xmm10 .cfi_endproc # mark_end; - .type __svml_cosf4_ha_ex,@function - .size __svml_cosf4_ha_ex,.-__svml_cosf4_ha_ex -..LN__svml_cosf4_ha_ex.1: + .type __jsvml_cosf4_ha_ex,@function + .size __jsvml_cosf4_ha_ex,.-__jsvml_cosf4_ha_ex +..LN__jsvml_cosf4_ha_ex.1: .data -# -- End __svml_cosf4_ha_ex +# -- End __jsvml_cosf4_ha_ex .text -.L_2__routine_start___svml_cosf4_ha_l9_2: -# -- Begin __svml_cosf4_ha_l9 +.L_2__routine_start___jsvml_cosf4_ha_l9_2: +# -- Begin __jsvml_cosf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosf4_ha_l9 -# --- __svml_cosf4_ha_l9(__m128) -__svml_cosf4_ha_l9: + .globl __jsvml_cosf4_ha_l9 +# --- __jsvml_cosf4_ha_l9(__m128) +__jsvml_cosf4_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -1149,7 +1149,7 @@ __svml_cosf4_ha_l9: .byte 30 #1703.14 .byte 250 #1703.14 .cfi_startproc -..___tag_value___svml_cosf4_ha_l9.90: +..___tag_value___jsvml_cosf4_ha_l9.90: ..L91: #1374.1 pushq %rbp #1374.1 @@ -1160,25 +1160,25 @@ __svml_cosf4_ha_l9: andq $-64, %rsp #1374.1 subq $192, %rsp #1374.1 vmovaps %xmm0, %xmm14 #1374.1 - vandps 4096+__svml_scos_ha_data_internal(%rip), %xmm14, %xmm12 #1393.10 + vandps 4096+__jsvml_scos_ha_data_internal(%rip), %xmm14, %xmm12 #1393.10 xorl %eax, %eax #1390.1 - vmovups 5440+__svml_scos_ha_data_internal(%rip), %xmm2 #1415.54 + vmovups 5440+__jsvml_scos_ha_data_internal(%rip), %xmm2 #1415.54 vcvtps2pd %xmm12, %ymm5 #1423.23 - vmovupd 5312+__svml_scos_ha_data_internal(%rip), %ymm7 #1429.52 - vaddps 5504+__svml_scos_ha_data_internal(%rip), %xmm12, %xmm1 #1394.9 - vcmpnleps 4160+__svml_scos_ha_data_internal(%rip), %xmm12, %xmm0 #1396.26 - vfmadd132ps 5376+__svml_scos_ha_data_internal(%rip), %xmm2, %xmm1 #1417.17 + vmovupd 5312+__jsvml_scos_ha_data_internal(%rip), %ymm7 #1429.52 + vaddps 5504+__jsvml_scos_ha_data_internal(%rip), %xmm12, %xmm1 #1394.9 + vcmpnleps 4160+__jsvml_scos_ha_data_internal(%rip), %xmm12, %xmm0 #1396.26 + vfmadd132ps 5376+__jsvml_scos_ha_data_internal(%rip), %xmm2, %xmm1 #1417.17 vmovmskps %xmm0, %edx #1442.74 vpslld $31, %xmm1, %xmm11 #1418.38 vsubps %xmm2, %xmm1, %xmm3 #1419.17 - vsubps 5568+__svml_scos_ha_data_internal(%rip), %xmm3, %xmm4 #1421.17 + vsubps 5568+__jsvml_scos_ha_data_internal(%rip), %xmm3, %xmm4 #1421.17 vcvtps2pd %xmm4, %ymm8 #1422.23 - vfnmadd231pd 4992+__svml_scos_ha_data_internal(%rip), %ymm8, %ymm5 #1425.17 - vfnmadd132pd 5056+__svml_scos_ha_data_internal(%rip), %ymm5, %ymm8 #1427.17 + vfnmadd231pd 4992+__jsvml_scos_ha_data_internal(%rip), %ymm8, %ymm5 #1425.17 + vfnmadd132pd 5056+__jsvml_scos_ha_data_internal(%rip), %ymm5, %ymm8 #1427.17 vmulpd %ymm8, %ymm8, %ymm6 #1428.18 - vfmadd213pd 5248+__svml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #1431.17 - vfmadd213pd 5184+__svml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #1433.17 - vfmadd213pd 5120+__svml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #1435.17 + vfmadd213pd 5248+__jsvml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #1431.17 + vfmadd213pd 5184+__jsvml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #1433.17 + vfmadd213pd 5120+__jsvml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #1435.17 vmulpd %ymm7, %ymm6, %ymm9 #1436.17 vfmadd213pd %ymm8, %ymm8, %ymm9 #1437.19 vcvtpd2ps %ymm9, %xmm10 #1438.18 @@ -1252,10 +1252,10 @@ __svml_cosf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1706.540 lea 128(%rsp,%r12,4), %rsi #1706.540 -..___tag_value___svml_cosf4_ha_l9.108: -# __svml_scos_ha_cout_rare_internal(const float *, float *) - call __svml_scos_ha_cout_rare_internal #1706.540 -..___tag_value___svml_cosf4_ha_l9.109: +..___tag_value___jsvml_cosf4_ha_l9.108: +# __jsvml_scos_ha_cout_rare_internal(const float *, float *) + call __jsvml_scos_ha_cout_rare_internal #1706.540 +..___tag_value___jsvml_cosf4_ha_l9.109: jmp ..B3.9 # Prob 100% #1706.540 .cfi_restore 12 .cfi_restore 13 @@ -1263,8 +1263,8 @@ __svml_cosf4_ha_l9: ..B3.12: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.29(%rip), %xmm14, %xmm13 #1555.18 - lea __svml_scos_ha_reduction_data_internal(%rip), %r8 #1557.708 - vmovups 4224+__svml_scos_ha_data_internal(%rip), %xmm10 #1465.50 + lea __jsvml_scos_ha_reduction_data_internal(%rip), %r8 #1557.708 + vmovups 4224+__jsvml_scos_ha_data_internal(%rip), %xmm10 #1465.50 vpsrld $23, %xmm13, %xmm8 #1556.18 vandps %xmm12, %xmm10, %xmm11 #1466.14 vpslld $1, %xmm8, %xmm7 #1557.234 @@ -1289,7 +1289,7 @@ __svml_cosf4_ha_l9: vmovd 8(%rdx,%r8), %xmm1 #1559.1236 vmovd 4(%rcx,%r8), %xmm8 #1558.1320 vmovd 8(%rcx,%r8), %xmm2 #1559.1319 - lea __svml_scos_ha_data_internal(%rip), %rcx #1676.509 + lea __jsvml_scos_ha_data_internal(%rip), %rcx #1676.509 vmovd 4(%rsi,%r8), %xmm15 #1558.1424 vmovd 8(%rsi,%r8), %xmm12 #1559.1423 vshufps $136, %xmm13, %xmm6, %xmm11 #1557.1196 @@ -1425,8 +1425,8 @@ __svml_cosf4_ha_l9: vmovaps %xmm11, %xmm2 #1680.22 vshufps $136, %xmm1, %xmm15, %xmm15 #1679.938 vfmadd213ps %xmm9, %xmm15, %xmm2 #1680.22 - vmovups 4352+__svml_scos_ha_data_internal(%rip), %xmm1 #1689.14 - vfmadd213ps 4288+__svml_scos_ha_data_internal(%rip), %xmm7, %xmm1 #1689.14 + vmovups 4352+__jsvml_scos_ha_data_internal(%rip), %xmm1 #1689.14 + vfmadd213ps 4288+__jsvml_scos_ha_data_internal(%rip), %xmm7, %xmm1 #1689.14 vmovaps %xmm2, %xmm12 #1681.21 vsubps %xmm2, %xmm9, %xmm3 #1682.18 vfmadd231ps %xmm8, %xmm11, %xmm12 #1681.21 @@ -1436,9 +1436,9 @@ __svml_cosf4_ha_l9: vsubps %xmm12, %xmm2, %xmm13 #1684.18 vmulps %xmm4, %xmm11, %xmm2 #1691.14 vfmadd231ps %xmm8, %xmm11, %xmm13 #1685.18 - vmovups 4480+__svml_scos_ha_data_internal(%rip), %xmm8 #1695.14 + vmovups 4480+__jsvml_scos_ha_data_internal(%rip), %xmm8 #1695.14 vmovups (%rsp), %xmm1 #1703.14[spill] - vfmadd213ps 4416+__svml_scos_ha_data_internal(%rip), %xmm7, %xmm8 #1695.14 + vfmadd213ps 4416+__jsvml_scos_ha_data_internal(%rip), %xmm7, %xmm8 #1695.14 vfnmadd213ps %xmm15, %xmm9, %xmm11 #1697.13 vaddps %xmm13, %xmm3, %xmm13 #1686.22 vmulps %xmm8, %xmm7, %xmm7 #1696.14 @@ -1453,20 +1453,20 @@ __svml_cosf4_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm14 .cfi_endproc # mark_end; - .type __svml_cosf4_ha_l9,@function - .size __svml_cosf4_ha_l9,.-__svml_cosf4_ha_l9 -..LN__svml_cosf4_ha_l9.2: + .type __jsvml_cosf4_ha_l9,@function + .size __jsvml_cosf4_ha_l9,.-__jsvml_cosf4_ha_l9 +..LN__jsvml_cosf4_ha_l9.2: .data -# -- End __svml_cosf4_ha_l9 +# -- End __jsvml_cosf4_ha_l9 .text -.L_2__routine_start___svml_cosf4_ha_e9_3: -# -- Begin __svml_cosf4_ha_e9 +.L_2__routine_start___jsvml_cosf4_ha_e9_3: +# -- Begin __jsvml_cosf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosf4_ha_e9 -# --- __svml_cosf4_ha_e9(__m128) -__svml_cosf4_ha_e9: + .globl __jsvml_cosf4_ha_e9 +# --- __jsvml_cosf4_ha_e9(__m128) +__jsvml_cosf4_ha_e9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -1475,7 +1475,7 @@ __svml_cosf4_ha_e9: .byte 30 #2089.14 .byte 250 #2089.14 .cfi_startproc -..___tag_value___svml_cosf4_ha_e9.115: +..___tag_value___jsvml_cosf4_ha_e9.115: ..L116: #1747.1 pushq %rbp #1747.1 @@ -1486,30 +1486,30 @@ __svml_cosf4_ha_e9: andq $-64, %rsp #1747.1 subq $192, %rsp #1747.1 vmovaps %xmm0, %xmm14 #1747.1 - vandps 4096+__svml_scos_ha_data_internal(%rip), %xmm14, %xmm2 #1766.10 + vandps 4096+__jsvml_scos_ha_data_internal(%rip), %xmm14, %xmm2 #1766.10 xorl %eax, %eax #1763.1 - vmovups 5440+__svml_scos_ha_data_internal(%rip), %xmm6 #1788.54 + vmovups 5440+__jsvml_scos_ha_data_internal(%rip), %xmm6 #1788.54 vcvtps2pd %xmm2, %ymm9 #1796.23 - vcmpnleps 4160+__svml_scos_ha_data_internal(%rip), %xmm2, %xmm0 #1769.26 - vaddps 5504+__svml_scos_ha_data_internal(%rip), %xmm2, %xmm3 #1767.9 + vcmpnleps 4160+__jsvml_scos_ha_data_internal(%rip), %xmm2, %xmm0 #1769.26 + vaddps 5504+__jsvml_scos_ha_data_internal(%rip), %xmm2, %xmm3 #1767.9 vmovmskps %xmm0, %edx #1815.74 - vmulps 5376+__svml_scos_ha_data_internal(%rip), %xmm3, %xmm4 #1790.29 + vmulps 5376+__jsvml_scos_ha_data_internal(%rip), %xmm3, %xmm4 #1790.29 vaddps %xmm4, %xmm6, %xmm5 #1790.17 vpslld $31, %xmm5, %xmm1 #1791.38 vsubps %xmm6, %xmm5, %xmm7 #1792.17 - vsubps 5568+__svml_scos_ha_data_internal(%rip), %xmm7, %xmm8 #1794.17 + vsubps 5568+__jsvml_scos_ha_data_internal(%rip), %xmm7, %xmm8 #1794.17 vcvtps2pd %xmm8, %ymm11 #1795.23 - vmulpd 4992+__svml_scos_ha_data_internal(%rip), %ymm11, %ymm10 #1798.39 - vmulpd 5056+__svml_scos_ha_data_internal(%rip), %ymm11, %ymm13 #1800.39 + vmulpd 4992+__jsvml_scos_ha_data_internal(%rip), %ymm11, %ymm10 #1798.39 + vmulpd 5056+__jsvml_scos_ha_data_internal(%rip), %ymm11, %ymm13 #1800.39 vsubpd %ymm10, %ymm9, %ymm12 #1798.17 vsubpd %ymm13, %ymm12, %ymm9 #1800.17 vmulpd %ymm9, %ymm9, %ymm6 #1801.18 - vmulpd 5312+__svml_scos_ha_data_internal(%rip), %ymm6, %ymm15 #1804.32 - vaddpd 5248+__svml_scos_ha_data_internal(%rip), %ymm15, %ymm15 #1804.17 + vmulpd 5312+__jsvml_scos_ha_data_internal(%rip), %ymm6, %ymm15 #1804.32 + vaddpd 5248+__jsvml_scos_ha_data_internal(%rip), %ymm15, %ymm15 #1804.17 vmulpd %ymm15, %ymm6, %ymm3 #1806.32 - vaddpd 5184+__svml_scos_ha_data_internal(%rip), %ymm3, %ymm4 #1806.17 + vaddpd 5184+__jsvml_scos_ha_data_internal(%rip), %ymm3, %ymm4 #1806.17 vmulpd %ymm4, %ymm6, %ymm5 #1808.32 - vaddpd 5120+__svml_scos_ha_data_internal(%rip), %ymm5, %ymm7 #1808.17 + vaddpd 5120+__jsvml_scos_ha_data_internal(%rip), %ymm5, %ymm7 #1808.17 vmulpd %ymm7, %ymm6, %ymm8 #1809.17 vmulpd %ymm8, %ymm9, %ymm10 #1810.34 vaddpd %ymm10, %ymm9, %ymm11 #1810.19 @@ -1584,10 +1584,10 @@ __svml_cosf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #2092.540 lea 128(%rsp,%r12,4), %rsi #2092.540 -..___tag_value___svml_cosf4_ha_e9.133: -# __svml_scos_ha_cout_rare_internal(const float *, float *) - call __svml_scos_ha_cout_rare_internal #2092.540 -..___tag_value___svml_cosf4_ha_e9.134: +..___tag_value___jsvml_cosf4_ha_e9.133: +# __jsvml_scos_ha_cout_rare_internal(const float *, float *) + call __jsvml_scos_ha_cout_rare_internal #2092.540 +..___tag_value___jsvml_cosf4_ha_e9.134: jmp ..B4.9 # Prob 100% #2092.540 .cfi_restore 12 .cfi_restore 13 @@ -1595,8 +1595,8 @@ __svml_cosf4_ha_e9: ..B4.12: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq movl $2139095040, %edx #1927.24 - lea __svml_scos_ha_reduction_data_internal(%rip), %r9 #1930.752 - vmovups 4224+__svml_scos_ha_data_internal(%rip), %xmm8 #1838.50 + lea __jsvml_scos_ha_reduction_data_internal(%rip), %r9 #1930.752 + vmovups 4224+__jsvml_scos_ha_data_internal(%rip), %xmm8 #1838.50 movl $8388607, %r10d #1936.27 vandps %xmm2, %xmm8, %xmm13 #1839.14 movl $8388608, %r11d #1937.26 @@ -1715,7 +1715,7 @@ __svml_cosf4_ha_e9: vpand %xmm6, %xmm12, %xmm5 #2010.24 vpslld $5, %xmm5, %xmm13 #2011.24 vpsrld $18, %xmm6, %xmm6 #2021.23 - lea __svml_scos_ha_data_internal(%rip), %r8 #2060.533 + lea __jsvml_scos_ha_data_internal(%rip), %r8 #2060.533 vaddps %xmm8, %xmm9, %xmm1 #2001.19 vsubps %xmm8, %xmm1, %xmm7 #2002.9 vsubps %xmm7, %xmm9, %xmm2 #2003.17 @@ -1802,17 +1802,17 @@ __svml_cosf4_ha_e9: vsubps %xmm5, %xmm8, %xmm3 #2068.18 vaddps %xmm5, %xmm13, %xmm6 #2067.21 vaddps %xmm3, %xmm2, %xmm1 #2069.18 - vmulps 4352+__svml_scos_ha_data_internal(%rip), %xmm11, %xmm3 #2075.26 + vmulps 4352+__jsvml_scos_ha_data_internal(%rip), %xmm11, %xmm3 #2075.26 vsubps %xmm6, %xmm5, %xmm15 #2070.18 - vaddps 4288+__svml_scos_ha_data_internal(%rip), %xmm3, %xmm5 #2075.14 + vaddps 4288+__jsvml_scos_ha_data_internal(%rip), %xmm3, %xmm5 #2075.14 vaddps %xmm15, %xmm13, %xmm2 #2071.18 vmulps %xmm5, %xmm11, %xmm15 #2076.14 vaddps %xmm2, %xmm1, %xmm13 #2072.22 vaddps %xmm12, %xmm10, %xmm1 #2078.13 - vmulps 4480+__svml_scos_ha_data_internal(%rip), %xmm11, %xmm10 #2081.26 + vmulps 4480+__jsvml_scos_ha_data_internal(%rip), %xmm11, %xmm10 #2081.26 vmulps %xmm15, %xmm4, %xmm15 #2077.14 vmulps %xmm8, %xmm4, %xmm4 #2083.32 - vaddps 4416+__svml_scos_ha_data_internal(%rip), %xmm10, %xmm10 #2081.14 + vaddps 4416+__jsvml_scos_ha_data_internal(%rip), %xmm10, %xmm10 #2081.14 vmulps %xmm10, %xmm11, %xmm11 #2082.14 vsubps %xmm4, %xmm1, %xmm1 #2083.13 vmulps %xmm1, %xmm7, %xmm7 #2084.28 @@ -1830,20 +1830,20 @@ __svml_cosf4_ha_e9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm14 .cfi_endproc # mark_end; - .type __svml_cosf4_ha_e9,@function - .size __svml_cosf4_ha_e9,.-__svml_cosf4_ha_e9 -..LN__svml_cosf4_ha_e9.3: + .type __jsvml_cosf4_ha_e9,@function + .size __jsvml_cosf4_ha_e9,.-__jsvml_cosf4_ha_e9 +..LN__jsvml_cosf4_ha_e9.3: .data -# -- End __svml_cosf4_ha_e9 +# -- End __jsvml_cosf4_ha_e9 .text -.L_2__routine_start___svml_cosf8_ha_l9_4: -# -- Begin __svml_cosf8_ha_l9 +.L_2__routine_start___jsvml_cosf8_ha_l9_4: +# -- Begin __jsvml_cosf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_cosf8_ha_l9 -# --- __svml_cosf8_ha_l9(__m256) -__svml_cosf8_ha_l9: + .globl __jsvml_cosf8_ha_l9 +# --- __jsvml_cosf8_ha_l9(__m256) +__jsvml_cosf8_ha_l9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -1852,7 +1852,7 @@ __svml_cosf8_ha_l9: .byte 30 #2430.14 .byte 250 #2430.14 .cfi_startproc -..___tag_value___svml_cosf8_ha_l9.140: +..___tag_value___jsvml_cosf8_ha_l9.140: ..L141: #2101.1 pushq %rbp #2101.1 @@ -1865,19 +1865,19 @@ __svml_cosf8_ha_l9: subq $184, %rsp #2101.1 xorl %eax, %eax #2117.1 vmovaps %ymm0, %ymm14 #2101.1 - vmovups 5440+__svml_scos_ha_data_internal(%rip), %ymm5 #2142.57 - vmovupd 4992+__svml_scos_ha_data_internal(%rip), %ymm10 #2151.55 - vmovupd 5056+__svml_scos_ha_data_internal(%rip), %ymm12 #2153.55 - vandps 4096+__svml_scos_ha_data_internal(%rip), %ymm14, %ymm2 #2120.10 - vaddps 5504+__svml_scos_ha_data_internal(%rip), %ymm2, %ymm4 #2121.9 - vcmpnle_uqps 4160+__svml_scos_ha_data_internal(%rip), %ymm2, %ymm13 #2123.26 - vfmadd132ps 5376+__svml_scos_ha_data_internal(%rip), %ymm5, %ymm4 #2144.17 + vmovups 5440+__jsvml_scos_ha_data_internal(%rip), %ymm5 #2142.57 + vmovupd 4992+__jsvml_scos_ha_data_internal(%rip), %ymm10 #2151.55 + vmovupd 5056+__jsvml_scos_ha_data_internal(%rip), %ymm12 #2153.55 + vandps 4096+__jsvml_scos_ha_data_internal(%rip), %ymm14, %ymm2 #2120.10 + vaddps 5504+__jsvml_scos_ha_data_internal(%rip), %ymm2, %ymm4 #2121.9 + vcmpnle_uqps 4160+__jsvml_scos_ha_data_internal(%rip), %ymm2, %ymm13 #2123.26 + vfmadd132ps 5376+__jsvml_scos_ha_data_internal(%rip), %ymm5, %ymm4 #2144.17 vsubps %ymm5, %ymm4, %ymm6 #2146.17 vpslld $31, %ymm4, %ymm3 #2145.41 - vmovupd 5248+__svml_scos_ha_data_internal(%rip), %ymm4 #2157.54 - vmovupd 5312+__svml_scos_ha_data_internal(%rip), %ymm5 #2156.54 - vsubps 5568+__svml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #2148.17 - vmovupd 5184+__svml_scos_ha_data_internal(%rip), %ymm6 #2159.54 + vmovupd 5248+__jsvml_scos_ha_data_internal(%rip), %ymm4 #2157.54 + vmovupd 5312+__jsvml_scos_ha_data_internal(%rip), %ymm5 #2156.54 + vsubps 5568+__jsvml_scos_ha_data_internal(%rip), %ymm6, %ymm7 #2148.17 + vmovupd 5184+__jsvml_scos_ha_data_internal(%rip), %ymm6 #2159.54 vmovmskps %ymm13, %edx #2169.75 vextractf128 $1, %ymm7, %xmm8 #2149.105 vextractf128 $1, %ymm2, %xmm9 #2150.106 @@ -1885,7 +1885,7 @@ __svml_cosf8_ha_l9: vcvtps2pd %xmm2, %ymm11 #2150.23 vcvtps2pd %xmm8, %ymm0 #2149.88 vcvtps2pd %xmm9, %ymm15 #2150.89 - vmovupd 5120+__svml_scos_ha_data_internal(%rip), %ymm7 #2161.54 + vmovupd 5120+__jsvml_scos_ha_data_internal(%rip), %ymm7 #2161.54 vfnmadd231pd %ymm1, %ymm10, %ymm11 #2152.19 vfnmadd231pd %ymm0, %ymm10, %ymm15 #2152.78 vfnmadd213pd %ymm11, %ymm12, %ymm1 #2154.19 @@ -1970,18 +1970,18 @@ __svml_cosf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #2433.546 lea 128(%rsp,%r12,4), %rsi #2433.546 -..___tag_value___svml_cosf8_ha_l9.156: -# __svml_scos_ha_cout_rare_internal(const float *, float *) - call __svml_scos_ha_cout_rare_internal #2433.546 -..___tag_value___svml_cosf8_ha_l9.157: +..___tag_value___jsvml_cosf8_ha_l9.156: +# __jsvml_scos_ha_cout_rare_internal(const float *, float *) + call __jsvml_scos_ha_cout_rare_internal #2433.546 +..___tag_value___jsvml_cosf8_ha_l9.157: jmp ..B5.9 # Prob 100% #2433.546 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B5.12: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.48(%rip), %ymm14, %ymm9 #2282.18 - lea __svml_scos_ha_reduction_data_internal(%rip), %rcx #2284.1212 - vmovups 4224+__svml_scos_ha_data_internal(%rip), %ymm8 #2192.53 + lea __jsvml_scos_ha_reduction_data_internal(%rip), %rcx #2284.1212 + vmovups 4224+__jsvml_scos_ha_data_internal(%rip), %ymm8 #2192.53 vmovups %ymm0, (%rsp) #[spill] vpsrld $23, %ymm9, %ymm3 #2283.18 vpslld $1, %ymm3, %ymm7 #2284.234 @@ -2031,7 +2031,7 @@ __svml_cosf8_ha_l9: vmovd 8(%rsi,%rcx), %xmm5 #2286.2300 vmovd 8(%rdi,%rcx), %xmm12 #2286.2389 vmovd 8(%r11,%rcx), %xmm0 #2286.2741 - lea __svml_scos_ha_data_internal(%rip), %r11 #2403.1007 + lea __jsvml_scos_ha_data_internal(%rip), %r11 #2403.1007 vmovd 8(%r10,%rcx), %xmm1 #2286.2830 vmovd 8(%r12,%rcx), %xmm11 #2286.2940 vpunpcklqdq %xmm12, %xmm5, %xmm15 #2286.2280 @@ -2206,9 +2206,9 @@ __svml_cosf8_ha_l9: vpunpcklqdq %xmm3, %xmm2, %xmm11 #2406.2596 vshufps $136, %xmm11, %xmm4, %xmm12 #2406.2377 vmovaps %ymm10, %ymm0 #2407.22 - vmovups 4352+__svml_scos_ha_data_internal(%rip), %ymm2 #2416.14 + vmovups 4352+__jsvml_scos_ha_data_internal(%rip), %ymm2 #2416.14 vmovaps %ymm7, %ymm11 #2408.21 - vfmadd213ps 4288+__svml_scos_ha_data_internal(%rip), %ymm9, %ymm2 #2416.14 + vfmadd213ps 4288+__jsvml_scos_ha_data_internal(%rip), %ymm9, %ymm2 #2416.14 vmulps %ymm2, %ymm9, %ymm3 #2417.14 vmulps %ymm3, %ymm10, %ymm4 #2418.14 vinsertf128 $1, %xmm12, %ymm15, %ymm15 #2406.1872 @@ -2220,10 +2220,10 @@ __svml_cosf8_ha_l9: vmovups (%rsp), %ymm0 #2430.14[spill] vfmadd231ps %ymm7, %ymm10, %ymm1 #2412.18 vaddps %ymm15, %ymm7, %ymm15 #2419.13 - vmovups 4480+__svml_scos_ha_data_internal(%rip), %ymm7 #2422.14 + vmovups 4480+__jsvml_scos_ha_data_internal(%rip), %ymm7 #2422.14 vfnmadd213ps %ymm15, %ymm8, %ymm10 #2424.13 vaddps %ymm1, %ymm12, %ymm12 #2413.22 - vfmadd213ps 4416+__svml_scos_ha_data_internal(%rip), %ymm9, %ymm7 #2422.14 + vfmadd213ps 4416+__jsvml_scos_ha_data_internal(%rip), %ymm9, %ymm7 #2422.14 vfmadd213ps %ymm5, %ymm10, %ymm6 #2425.16 vfmadd213ps %ymm12, %ymm10, %ymm4 #2427.18 vmulps %ymm7, %ymm9, %ymm9 #2423.14 @@ -2236,20 +2236,20 @@ __svml_cosf8_ha_l9: # LOE rbx r13 r14 r15 eax ymm0 ymm14 .cfi_endproc # mark_end; - .type __svml_cosf8_ha_l9,@function - .size __svml_cosf8_ha_l9,.-__svml_cosf8_ha_l9 -..LN__svml_cosf8_ha_l9.4: + .type __jsvml_cosf8_ha_l9,@function + .size __jsvml_cosf8_ha_l9,.-__jsvml_cosf8_ha_l9 +..LN__jsvml_cosf8_ha_l9.4: .data -# -- End __svml_cosf8_ha_l9 +# -- End __jsvml_cosf8_ha_l9 .text -.L_2__routine_start___svml_cosf16_ha_z0_5: -# -- Begin __svml_cosf16_ha_z0 +.L_2__routine_start___jsvml_cosf16_ha_z0_5: +# -- Begin __jsvml_cosf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_cosf16_ha_z0 -# --- __svml_cosf16_ha_z0(__m512) -__svml_cosf16_ha_z0: + .globl __jsvml_cosf16_ha_z0 +# --- __jsvml_cosf16_ha_z0(__m512) +__jsvml_cosf16_ha_z0: # parameter 1: %zmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -2258,7 +2258,7 @@ __svml_cosf16_ha_z0: .byte 30 #2771.35 .byte 250 #2771.35 .cfi_startproc -..___tag_value___svml_cosf16_ha_z0.162: +..___tag_value___jsvml_cosf16_ha_z0.162: ..L163: #2442.1 pushq %rbp #2442.1 @@ -2269,24 +2269,24 @@ __svml_cosf16_ha_z0: andq $-64, %rsp #2442.1 subq $192, %rsp #2442.1 xorl %esi, %esi #2458.1 - vmovups 5504+__svml_scos_ha_data_internal(%rip), %zmm10 #2459.46 - vmovups 5440+__svml_scos_ha_data_internal(%rip), %zmm7 #2483.56 - vmovups 5376+__svml_scos_ha_data_internal(%rip), %zmm5 #2484.53 - vmovups 4160+__svml_scos_ha_data_internal(%rip), %zmm4 #2463.57 - vmovups 5568+__svml_scos_ha_data_internal(%rip), %zmm9 #2488.55 - vmovups 4992+__svml_scos_ha_data_internal(%rip), %zmm15 #2492.53 + vmovups 5504+__jsvml_scos_ha_data_internal(%rip), %zmm10 #2459.46 + vmovups 5440+__jsvml_scos_ha_data_internal(%rip), %zmm7 #2483.56 + vmovups 5376+__jsvml_scos_ha_data_internal(%rip), %zmm5 #2484.53 + vmovups 4160+__jsvml_scos_ha_data_internal(%rip), %zmm4 #2463.57 + vmovups 5568+__jsvml_scos_ha_data_internal(%rip), %zmm9 #2488.55 + vmovups 4992+__jsvml_scos_ha_data_internal(%rip), %zmm15 #2492.53 vmovaps %zmm0, %zmm11 #2442.1 - vandps 4096+__svml_scos_ha_data_internal(%rip), %zmm11, %zmm3 #2461.10 + vandps 4096+__jsvml_scos_ha_data_internal(%rip), %zmm11, %zmm3 #2461.10 vaddps {rn-sae}, %zmm10, %zmm3, %zmm6 #2462.11 vpternlogd $255, %zmm10, %zmm10, %zmm10 #2464.47 vcmpps $18, {sae}, %zmm4, %zmm3, %k1 #2464.115 vfmadd213ps {rn-sae}, %zmm7, %zmm5, %zmm6 #2485.17 vsubps {rn-sae}, %zmm7, %zmm6, %zmm8 #2487.19 vpslld $31, %zmm6, %zmm2 #2486.41 - vmovups 5312+__svml_scos_ha_data_internal(%rip), %zmm6 #2497.52 - vmovups 5184+__svml_scos_ha_data_internal(%rip), %zmm7 #2500.52 + vmovups 5312+__jsvml_scos_ha_data_internal(%rip), %zmm6 #2497.52 + vmovups 5184+__jsvml_scos_ha_data_internal(%rip), %zmm7 #2500.52 vsubps {rn-sae}, %zmm9, %zmm8, %zmm12 #2489.19 - vmovups 5120+__svml_scos_ha_data_internal(%rip), %zmm8 #2502.52 + vmovups 5120+__jsvml_scos_ha_data_internal(%rip), %zmm8 #2502.52 vpandnd %zmm3, %zmm3, %zmm10{%k1} #2464.47 vextractf32x8 $1, %zmm12, %ymm13 #2490.136 vextractf32x8 $1, %zmm3, %ymm14 #2491.137 @@ -2295,10 +2295,10 @@ __svml_cosf16_ha_z0: vcvtps2pd {sae}, %ymm3, %zmm4 #2491.23 vcvtps2pd {sae}, %ymm14, %zmm5 #2491.114 vptestmd %zmm10, %zmm10, %k0 #2510.63 - vmovups 5248+__svml_scos_ha_data_internal(%rip), %zmm13 #2498.52 + vmovups 5248+__jsvml_scos_ha_data_internal(%rip), %zmm13 #2498.52 vfnmadd231pd {rn-sae}, %zmm1, %zmm15, %zmm4 #2493.19 vfnmadd231pd {rn-sae}, %zmm0, %zmm15, %zmm5 #2493.133 - vmovups 5056+__svml_scos_ha_data_internal(%rip), %zmm15 #2494.53 + vmovups 5056+__jsvml_scos_ha_data_internal(%rip), %zmm15 #2494.53 kmovw %k0, %eax #2510.63 vfnmadd213pd {rn-sae}, %zmm5, %zmm15, %zmm0 #2495.133 vfnmadd213pd {rn-sae}, %zmm4, %zmm15, %zmm1 #2495.19 @@ -2433,10 +2433,10 @@ __svml_cosf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #2774.760 lea 128(%rsp,%rbx,4), %rsi #2774.760 -..___tag_value___svml_cosf16_ha_z0.190: -# __svml_scos_ha_cout_rare_internal(const float *, float *) - call __svml_scos_ha_cout_rare_internal #2774.760 -..___tag_value___svml_cosf16_ha_z0.191: +..___tag_value___jsvml_cosf16_ha_z0.190: +# __jsvml_scos_ha_cout_rare_internal(const float *, float *) + call __jsvml_scos_ha_cout_rare_internal #2774.760 +..___tag_value___jsvml_cosf16_ha_z0.191: jmp ..B6.14 # Prob 100% #2774.760 .cfi_restore 3 .cfi_restore 12 @@ -2445,13 +2445,13 @@ __svml_cosf16_ha_z0: # LOE r15 ebx r12d r13d r14d ..B6.17: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq - vmovups 4224+__svml_scos_ha_data_internal(%rip), %zmm6 #2533.52 - lea __svml_scos_ha_reduction_data_internal(%rip), %rax #2625.328 + vmovups 4224+__jsvml_scos_ha_data_internal(%rip), %zmm6 #2533.52 + lea __jsvml_scos_ha_reduction_data_internal(%rip), %rax #2625.328 vmovups %zmm0, (%rsp) #[spill] vpternlogd $255, %zmm7, %zmm7, %zmm7 #2535.42 vandps %zmm3, %zmm6, %zmm4 #2534.14 vcmpps $4, {sae}, %zmm6, %zmm4, %k1 #2535.110 - lea __svml_scos_ha_data_internal(%rip), %rdx #2744.125 + lea __jsvml_scos_ha_data_internal(%rip), %rdx #2744.125 vmovups .L_2il0floatpacket.63(%rip), %zmm6 #2635.15 vpandd .L_2il0floatpacket.60(%rip), %zmm11, %zmm1 #2623.16 vpsrld $23, %zmm1, %zmm8 #2624.18 @@ -2573,7 +2573,7 @@ __svml_cosf16_ha_z0: vpandnd %zmm6, %zmm6, %zmm0{%k6} #2736.41 vandps %zmm11, %zmm0, %zmm1 #2737.24 vorps %zmm12, %zmm1, %zmm2 #2739.9 - vmovups 4352+__svml_scos_ha_data_internal(%rip), %zmm12 #2755.46 + vmovups 4352+__jsvml_scos_ha_data_internal(%rip), %zmm12 #2755.46 vmulps {rn-sae}, %zmm2, %zmm2, %zmm4 #2743.17 vmovaps %zmm2, %zmm14 #2748.22 vfmadd213ps {rn-sae}, %zmm9, %zmm7, %zmm14 #2748.22 @@ -2584,15 +2584,15 @@ __svml_cosf16_ha_z0: vgatherdps (%rdx,%zmm13), %zmm0{%k7} #2744.125 vfmadd132ps {rn-sae}, %zmm0, %zmm14, %zmm8 #2749.21 vaddps {rn-sae}, %zmm7, %zmm0, %zmm15 #2760.15 - vmovups 4416+__svml_scos_ha_data_internal(%rip), %zmm7 #2762.46 + vmovups 4416+__jsvml_scos_ha_data_internal(%rip), %zmm7 #2762.46 vsubps {rn-sae}, %zmm8, %zmm14, %zmm6 #2752.20 vfmadd231ps {rn-sae}, %zmm0, %zmm2, %zmm6 #2753.18 - vmovups 4480+__svml_scos_ha_data_internal(%rip), %zmm0 #2761.46 + vmovups 4480+__jsvml_scos_ha_data_internal(%rip), %zmm0 #2761.46 vaddps {rn-sae}, %zmm1, %zmm6, %zmm6 #2754.24 vfmadd231ps {rn-sae}, %zmm4, %zmm0, %zmm7 #2763.14 vpxord %zmm5, %zmm5, %zmm5 #2746.125 vgatherdps 8(%rdx,%zmm13), %zmm5{%k2} #2746.125 - vmovups 4288+__svml_scos_ha_data_internal(%rip), %zmm13 #2756.46 + vmovups 4288+__jsvml_scos_ha_data_internal(%rip), %zmm13 #2756.46 vfmadd231ps {rn-sae}, %zmm4, %zmm12, %zmm13 #2757.14 vmulps {rn-sae}, %zmm4, %zmm13, %zmm14 #2758.16 vmulps {rn-sae}, %zmm4, %zmm7, %zmm4 #2764.16 @@ -2611,21 +2611,21 @@ __svml_cosf16_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm11 .cfi_endproc # mark_end; - .type __svml_cosf16_ha_z0,@function - .size __svml_cosf16_ha_z0,.-__svml_cosf16_ha_z0 -..LN__svml_cosf16_ha_z0.5: + .type __jsvml_cosf16_ha_z0,@function + .size __jsvml_cosf16_ha_z0,.-__jsvml_cosf16_ha_z0 +..LN__jsvml_cosf16_ha_z0.5: .data -# -- End __svml_cosf16_ha_z0 +# -- End __jsvml_cosf16_ha_z0 .text -.L_2__routine_start___svml_scos_ha_cout_rare_internal_6: -# -- Begin __svml_scos_ha_cout_rare_internal +.L_2__routine_start___jsvml_scos_ha_cout_rare_internal_6: +# -- Begin __jsvml_scos_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_scos_ha_cout_rare_internal - .globl __svml_scos_ha_cout_rare_internal -# --- __svml_scos_ha_cout_rare_internal(const float *, float *) -__svml_scos_ha_cout_rare_internal: + .hidden __jsvml_scos_ha_cout_rare_internal + .globl __jsvml_scos_ha_cout_rare_internal +# --- __jsvml_scos_ha_cout_rare_internal(const float *, float *) +__jsvml_scos_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -2635,7 +2635,7 @@ __svml_scos_ha_cout_rare_internal: .byte 30 #1740.12 .byte 250 #1740.12 .cfi_startproc -..___tag_value___svml_scos_ha_cout_rare_internal.199: +..___tag_value___jsvml_scos_ha_cout_rare_internal.199: ..L200: #1721.1 movl (%rdi), %edx #1724.19 @@ -2680,11 +2680,11 @@ __svml_scos_ha_cout_rare_internal: # LOE .cfi_endproc # mark_end; - .type __svml_scos_ha_cout_rare_internal,@function - .size __svml_scos_ha_cout_rare_internal,.-__svml_scos_ha_cout_rare_internal -..LN__svml_scos_ha_cout_rare_internal.6: + .type __jsvml_scos_ha_cout_rare_internal,@function + .size __jsvml_scos_ha_cout_rare_internal,.-__jsvml_scos_ha_cout_rare_internal +..LN__jsvml_scos_ha_cout_rare_internal.6: .data -# -- End __svml_scos_ha_cout_rare_internal +# -- End __jsvml_scos_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 @@ -2768,9 +2768,9 @@ __svml_scos_ha_cout_rare_internal: .type .L_2il0floatpacket.75,@object .size .L_2il0floatpacket.75,64 .align 64 - .hidden __svml_scos_ha_reduction_data_internal - .globl __svml_scos_ha_reduction_data_internal -__svml_scos_ha_reduction_data_internal: + .hidden __jsvml_scos_ha_reduction_data_internal + .globl __jsvml_scos_ha_reduction_data_internal +__jsvml_scos_ha_reduction_data_internal: .long 0 .long 0 .long 0 @@ -3539,12 +3539,12 @@ __svml_scos_ha_reduction_data_internal: .long 2590957677 .long 2974469278 .long 566763775 - .type __svml_scos_ha_reduction_data_internal,@object - .size __svml_scos_ha_reduction_data_internal,3072 + .type __jsvml_scos_ha_reduction_data_internal,@object + .size __jsvml_scos_ha_reduction_data_internal,3072 .align 64 - .hidden __svml_scos_ha_data_internal - .globl __svml_scos_ha_data_internal -__svml_scos_ha_data_internal: + .hidden __jsvml_scos_ha_data_internal + .globl __jsvml_scos_ha_data_internal +__jsvml_scos_ha_data_internal: .long 0 .long 1065353216 .long 0 @@ -4969,8 +4969,8 @@ __svml_scos_ha_data_internal: .long 1065353216 .long 1065353216 .long 1065353216 - .type __svml_scos_ha_data_internal,@object - .size __svml_scos_ha_data_internal,5696 + .type __jsvml_scos_ha_data_internal,@object + .size __jsvml_scos_ha_data_internal,5696 .align 32 .L_2il0floatpacket.21: .long 0x47400000,0x47400000,0x47400000,0x47400000,0x47400000,0x47400000,0x47400000,0x47400000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_cosh_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cosh_linux_x86.S similarity index 92% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_cosh_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cosh_linux_x86.S index 80efe5399b8..73e4587242c 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_cosh_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_cosh_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_cosh.c" .text ..TXTST0: -.L_2__routine_start___svml_coshf16_ha_z0_0: -# -- Begin __svml_coshf16_ha_z0 +.L_2__routine_start___jsvml_coshf16_ha_z0_0: +# -- Begin __jsvml_coshf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_coshf16_ha_z0 -# --- __svml_coshf16_ha_z0(__m512) -__svml_coshf16_ha_z0: + .globl __jsvml_coshf16_ha_z0 +# --- __jsvml_coshf16_ha_z0(__m512) +__jsvml_coshf16_ha_z0: # parameter 1: %zmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_coshf16_ha_z0: .byte 30 #497.760 .byte 250 #497.760 .cfi_startproc -..___tag_value___svml_coshf16_ha_z0.1: +..___tag_value___jsvml_coshf16_ha_z0.1: ..L2: #417.1 pushq %rbp #417.1 @@ -57,26 +57,26 @@ __svml_coshf16_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #417.1 subq $192, %rsp #417.1 - vmovups 1024+__svml_scosh_ha_data_internal(%rip), %zmm5 #460.48 - vmovups 384+__svml_scosh_ha_data_internal(%rip), %zmm7 #455.51 - vmovups 768+__svml_scosh_ha_data_internal(%rip), %zmm11 #465.17 - vmovups 896+__svml_scosh_ha_data_internal(%rip), %zmm8 #453.49 - vmovups 960+__svml_scosh_ha_data_internal(%rip), %zmm10 #454.49 - vmovups 640+__svml_scosh_ha_data_internal(%rip), %zmm3 #458.49 - vmovups 704+__svml_scosh_ha_data_internal(%rip), %zmm2 #459.49 - vmovups __svml_scosh_ha_data_internal(%rip), %zmm13 #472.279 - vmovups 256+__svml_scosh_ha_data_internal(%rip), %zmm15 #474.280 - vmovups 128+__svml_scosh_ha_data_internal(%rip), %zmm14 #473.284 + vmovups 1024+__jsvml_scosh_ha_data_internal(%rip), %zmm5 #460.48 + vmovups 384+__jsvml_scosh_ha_data_internal(%rip), %zmm7 #455.51 + vmovups 768+__jsvml_scosh_ha_data_internal(%rip), %zmm11 #465.17 + vmovups 896+__jsvml_scosh_ha_data_internal(%rip), %zmm8 #453.49 + vmovups 960+__jsvml_scosh_ha_data_internal(%rip), %zmm10 #454.49 + vmovups 640+__jsvml_scosh_ha_data_internal(%rip), %zmm3 #458.49 + vmovups 704+__jsvml_scosh_ha_data_internal(%rip), %zmm2 #459.49 + vmovups __jsvml_scosh_ha_data_internal(%rip), %zmm13 #472.279 + vmovups 256+__jsvml_scosh_ha_data_internal(%rip), %zmm15 #474.280 + vmovups 128+__jsvml_scosh_ha_data_internal(%rip), %zmm14 #473.284 vpternlogd $255, %zmm6, %zmm6, %zmm6 #463.21 vmovaps %zmm0, %zmm4 #417.1 vandnps %zmm4, %zmm5, %zmm1 #461.16 vfmadd213ps {rn-sae}, %zmm7, %zmm1, %zmm11 #465.17 - vpcmpd $1, 512+__svml_scosh_ha_data_internal(%rip), %zmm1, %k1 #463.88 + vpcmpd $1, 512+__jsvml_scosh_ha_data_internal(%rip), %zmm1, %k1 #463.88 vpslld $18, %zmm11, %zmm12 #475.19 vsubps {rn-sae}, %zmm7, %zmm11, %zmm9 #466.19 - vpermt2ps 64+__svml_scosh_ha_data_internal(%rip), %zmm11, %zmm13 #472.279 - vpermt2ps 320+__svml_scosh_ha_data_internal(%rip), %zmm11, %zmm15 #474.280 - vpermt2ps 192+__svml_scosh_ha_data_internal(%rip), %zmm11, %zmm14 #473.284 + vpermt2ps 64+__jsvml_scosh_ha_data_internal(%rip), %zmm11, %zmm13 #472.279 + vpermt2ps 320+__jsvml_scosh_ha_data_internal(%rip), %zmm11, %zmm15 #474.280 + vpermt2ps 192+__jsvml_scosh_ha_data_internal(%rip), %zmm11, %zmm14 #473.284 vpandnd %zmm1, %zmm1, %zmm6{%k1} #463.21 vfnmadd231ps {rn-sae}, %zmm8, %zmm9, %zmm1 #467.17 vptestmd %zmm6, %zmm6, %k0 #464.33 @@ -86,7 +86,7 @@ __svml_coshf16_ha_z0: vmulps {rn-sae}, %zmm0, %zmm2, %zmm2 #489.28 vmulps {rn-sae}, %zmm0, %zmm3, %zmm0 #491.25 vfmadd213ps {rn-sae}, %zmm1, %zmm1, %zmm2 #490.26 - vpandd 1216+__svml_scosh_ha_data_internal(%rip), %zmm12, %zmm5 #477.17 + vpandd 1216+__jsvml_scosh_ha_data_internal(%rip), %zmm12, %zmm5 #477.17 vpaddd %zmm5, %zmm13, %zmm8 #479.20 vpsubd %zmm5, %zmm15, %zmm7 #485.20 vpaddd %zmm5, %zmm14, %zmm14 #482.24 @@ -205,29 +205,29 @@ __svml_coshf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #497.760 lea 128(%rsp,%rbx,4), %rsi #497.760 -..___tag_value___svml_coshf16_ha_z0.29: -# __svml_scosh_ha_cout_rare_internal(const float *, float *) - call __svml_scosh_ha_cout_rare_internal #497.760 -..___tag_value___svml_coshf16_ha_z0.30: +..___tag_value___jsvml_coshf16_ha_z0.29: +# __jsvml_scosh_ha_cout_rare_internal(const float *, float *) + call __jsvml_scosh_ha_cout_rare_internal #497.760 +..___tag_value___jsvml_coshf16_ha_z0.30: jmp ..B1.13 # Prob 100% #497.760 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_coshf16_ha_z0,@function - .size __svml_coshf16_ha_z0,.-__svml_coshf16_ha_z0 -..LN__svml_coshf16_ha_z0.0: + .type __jsvml_coshf16_ha_z0,@function + .size __jsvml_coshf16_ha_z0,.-__jsvml_coshf16_ha_z0 +..LN__jsvml_coshf16_ha_z0.0: .data -# -- End __svml_coshf16_ha_z0 +# -- End __jsvml_coshf16_ha_z0 .text -.L_2__routine_start___svml_coshf8_ha_e9_1: -# -- Begin __svml_coshf8_ha_e9 +.L_2__routine_start___jsvml_coshf8_ha_e9_1: +# -- Begin __jsvml_coshf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_coshf8_ha_e9 -# --- __svml_coshf8_ha_e9(__m256) -__svml_coshf8_ha_e9: + .globl __jsvml_coshf8_ha_e9 +# --- __jsvml_coshf8_ha_e9(__m256) +__jsvml_coshf8_ha_e9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -236,7 +236,7 @@ __svml_coshf8_ha_e9: .byte 30 #562.546 .byte 250 #562.546 .cfi_startproc -..___tag_value___svml_coshf8_ha_e9.32: +..___tag_value___jsvml_coshf8_ha_e9.32: ..L33: #505.1 pushq %rbp #505.1 @@ -247,15 +247,15 @@ __svml_coshf8_ha_e9: andq $-64, %rsp #505.1 pushq %r15 #505.1 subq $184, %rsp #505.1 - lea 1484+__svml_scosh_ha_data_internal(%rip), %r10 #549.878 - vmovups 1024+__svml_scosh_ha_data_internal(%rip), %ymm14 #525.50 + lea 1484+__jsvml_scosh_ha_data_internal(%rip), %r10 #549.878 + vmovups 1024+__jsvml_scosh_ha_data_internal(%rip), %ymm14 #525.50 vpxor %xmm4, %xmm4, %xmm4 #536.62 - vmovups 1280+__svml_scosh_ha_data_internal(%rip), %ymm12 #526.52 - vmovups 1408+__svml_scosh_ha_data_internal(%rip), %xmm5 #527.29 - vmovups 1344+__svml_scosh_ha_data_internal(%rip), %xmm11 #528.27 + vmovups 1280+__jsvml_scosh_ha_data_internal(%rip), %ymm12 #526.52 + vmovups 1408+__jsvml_scosh_ha_data_internal(%rip), %xmm5 #527.29 + vmovups 1344+__jsvml_scosh_ha_data_internal(%rip), %xmm11 #528.27 vmovaps %ymm0, %ymm13 #505.1 vandnps %ymm13, %ymm14, %ymm10 #532.16 - vmulps 768+__svml_scosh_ha_data_internal(%rip), %ymm10, %ymm15 #533.28 + vmulps 768+__jsvml_scosh_ha_data_internal(%rip), %ymm10, %ymm15 #533.28 vaddps %ymm15, %ymm12, %ymm9 #533.13 vpcmpgtd %xmm5, %xmm10, %xmm7 #535.27 vextractf128 $1, %ymm10, %xmm8 #534.107 @@ -285,8 +285,8 @@ __svml_coshf8_ha_e9: vpslld $19, %xmm6, %xmm7 #545.24 vpslld $19, %xmm5, %xmm8 #545.87 vmovd -4(%r9,%r10), %xmm1 #549.1863 - vmulps 896+__svml_scosh_ha_data_internal(%rip), %ymm11, %ymm9 #547.38 - vmulps 960+__svml_scosh_ha_data_internal(%rip), %ymm11, %ymm2 #548.35 + vmulps 896+__jsvml_scosh_ha_data_internal(%rip), %ymm11, %ymm9 #547.38 + vmulps 960+__jsvml_scosh_ha_data_internal(%rip), %ymm11, %ymm2 #548.35 vsubps %ymm9, %ymm10, %ymm12 #547.13 vpextrd $1, %xmm0, %r8d #549.376 vpextrd $2, %xmm0, %edi #549.447 @@ -425,29 +425,29 @@ __svml_coshf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r15,4), %rdi #562.546 lea 128(%rsp,%r15,4), %rsi #562.546 -..___tag_value___svml_coshf8_ha_e9.48: -# __svml_scosh_ha_cout_rare_internal(const float *, float *) - call __svml_scosh_ha_cout_rare_internal #562.546 -..___tag_value___svml_coshf8_ha_e9.49: +..___tag_value___jsvml_coshf8_ha_e9.48: +# __jsvml_scosh_ha_cout_rare_internal(const float *, float *) + call __jsvml_scosh_ha_cout_rare_internal #562.546 +..___tag_value___jsvml_coshf8_ha_e9.49: jmp ..B2.8 # Prob 100% #562.546 .align 16,0x90 # LOE rbx r13 r14 r12d r15d .cfi_endproc # mark_end; - .type __svml_coshf8_ha_e9,@function - .size __svml_coshf8_ha_e9,.-__svml_coshf8_ha_e9 -..LN__svml_coshf8_ha_e9.1: + .type __jsvml_coshf8_ha_e9,@function + .size __jsvml_coshf8_ha_e9,.-__jsvml_coshf8_ha_e9 +..LN__jsvml_coshf8_ha_e9.1: .data -# -- End __svml_coshf8_ha_e9 +# -- End __jsvml_coshf8_ha_e9 .text -.L_2__routine_start___svml_coshf4_ha_l9_2: -# -- Begin __svml_coshf4_ha_l9 +.L_2__routine_start___jsvml_coshf4_ha_l9_2: +# -- Begin __jsvml_coshf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_coshf4_ha_l9 -# --- __svml_coshf4_ha_l9(__m128) -__svml_coshf4_ha_l9: + .globl __jsvml_coshf4_ha_l9 +# --- __jsvml_coshf4_ha_l9(__m128) +__jsvml_coshf4_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -456,7 +456,7 @@ __svml_coshf4_ha_l9: .byte 30 #627.540 .byte 250 #627.540 .cfi_startproc -..___tag_value___svml_coshf4_ha_l9.51: +..___tag_value___jsvml_coshf4_ha_l9.51: ..L52: #570.1 pushq %rbp #570.1 @@ -467,15 +467,15 @@ __svml_coshf4_ha_l9: andq $-64, %rsp #570.1 subq $192, %rsp #570.1 vmovaps %xmm0, %xmm5 #570.1 - vmovups 1024+__svml_scosh_ha_data_internal(%rip), %xmm6 #590.47 - lea 1484+__svml_scosh_ha_data_internal(%rip), %r8 #614.509 - vmovups 1280+__svml_scosh_ha_data_internal(%rip), %xmm14 #591.49 + vmovups 1024+__jsvml_scosh_ha_data_internal(%rip), %xmm6 #590.47 + lea 1484+__jsvml_scosh_ha_data_internal(%rip), %r8 #614.509 + vmovups 1280+__jsvml_scosh_ha_data_internal(%rip), %xmm14 #591.49 vandnps %xmm5, %xmm6, %xmm4 #597.16 - vmovups 768+__svml_scosh_ha_data_internal(%rip), %xmm13 #598.13 + vmovups 768+__jsvml_scosh_ha_data_internal(%rip), %xmm13 #598.13 vfmadd213ps %xmm14, %xmm4, %xmm13 #598.13 - vmovups 1344+__svml_scosh_ha_data_internal(%rip), %xmm12 #593.23 - vmovups 896+__svml_scosh_ha_data_internal(%rip), %xmm15 #594.48 - vpcmpgtd 1408+__svml_scosh_ha_data_internal(%rip), %xmm4, %xmm7 #600.23 + vmovups 1344+__jsvml_scosh_ha_data_internal(%rip), %xmm12 #593.23 + vmovups 896+__jsvml_scosh_ha_data_internal(%rip), %xmm15 #594.48 + vpcmpgtd 1408+__jsvml_scosh_ha_data_internal(%rip), %xmm4, %xmm7 #600.23 vmovmskps %xmm7, %eax #601.44 vxorps %xmm14, %xmm13, %xmm3 #602.13 vsubps %xmm14, %xmm13, %xmm0 #611.13 @@ -489,7 +489,7 @@ __svml_coshf4_ha_l9: vpsubd %xmm2, %xmm3, %xmm2 #609.20 vpslld $19, %xmm2, %xmm3 #610.20 vmovd %xmm1, %edx #614.238 - vfnmadd231ps 960+__svml_scosh_ha_data_internal(%rip), %xmm0, %xmm4 #613.13 + vfnmadd231ps 960+__jsvml_scosh_ha_data_internal(%rip), %xmm0, %xmm4 #613.13 vmovd -4(%rdx,%r8), %xmm6 #614.986 vmovd (%rdx,%r8), %xmm12 #615.986 vpextrd $1, %xmm1, %ecx #614.302 @@ -582,29 +582,29 @@ __svml_coshf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #627.540 lea 128(%rsp,%r12,4), %rsi #627.540 -..___tag_value___svml_coshf4_ha_l9.69: -# __svml_scosh_ha_cout_rare_internal(const float *, float *) - call __svml_scosh_ha_cout_rare_internal #627.540 -..___tag_value___svml_coshf4_ha_l9.70: +..___tag_value___jsvml_coshf4_ha_l9.69: +# __jsvml_scosh_ha_cout_rare_internal(const float *, float *) + call __jsvml_scosh_ha_cout_rare_internal #627.540 +..___tag_value___jsvml_coshf4_ha_l9.70: jmp ..B3.8 # Prob 100% #627.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_coshf4_ha_l9,@function - .size __svml_coshf4_ha_l9,.-__svml_coshf4_ha_l9 -..LN__svml_coshf4_ha_l9.2: + .type __jsvml_coshf4_ha_l9,@function + .size __jsvml_coshf4_ha_l9,.-__jsvml_coshf4_ha_l9 +..LN__jsvml_coshf4_ha_l9.2: .data -# -- End __svml_coshf4_ha_l9 +# -- End __jsvml_coshf4_ha_l9 .text -.L_2__routine_start___svml_coshf8_ha_l9_3: -# -- Begin __svml_coshf8_ha_l9 +.L_2__routine_start___jsvml_coshf8_ha_l9_3: +# -- Begin __jsvml_coshf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_coshf8_ha_l9 -# --- __svml_coshf8_ha_l9(__m256) -__svml_coshf8_ha_l9: + .globl __jsvml_coshf8_ha_l9 +# --- __jsvml_coshf8_ha_l9(__m256) +__jsvml_coshf8_ha_l9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -613,7 +613,7 @@ __svml_coshf8_ha_l9: .byte 30 #692.546 .byte 250 #692.546 .cfi_startproc -..___tag_value___svml_coshf8_ha_l9.72: +..___tag_value___jsvml_coshf8_ha_l9.72: ..L73: #635.1 pushq %rbp #635.1 @@ -624,11 +624,11 @@ __svml_coshf8_ha_l9: andq $-64, %rsp #635.1 pushq %r15 #635.1 subq $184, %rsp #635.1 - lea 1484+__svml_scosh_ha_data_internal(%rip), %r10 #679.1007 - vmovups 1024+__svml_scosh_ha_data_internal(%rip), %ymm7 #655.50 - vmovups 1280+__svml_scosh_ha_data_internal(%rip), %ymm15 #656.52 - vmovups 768+__svml_scosh_ha_data_internal(%rip), %ymm14 #663.13 - vmovups 1344+__svml_scosh_ha_data_internal(%rip), %ymm13 #658.23 + lea 1484+__jsvml_scosh_ha_data_internal(%rip), %r10 #679.1007 + vmovups 1024+__jsvml_scosh_ha_data_internal(%rip), %ymm7 #655.50 + vmovups 1280+__jsvml_scosh_ha_data_internal(%rip), %ymm15 #656.52 + vmovups 768+__jsvml_scosh_ha_data_internal(%rip), %ymm14 #663.13 + vmovups 1344+__jsvml_scosh_ha_data_internal(%rip), %ymm13 #658.23 vmovaps %ymm0, %ymm6 #635.1 vandnps %ymm6, %ymm7, %ymm5 #662.16 vfmadd213ps %ymm15, %ymm5, %ymm14 #663.13 @@ -641,10 +641,10 @@ __svml_coshf8_ha_l9: vpand %ymm13, %ymm12, %ymm3 #673.19 vpslld $4, %ymm3, %ymm1 #679.179 vpsubd %ymm3, %ymm4, %ymm3 #674.20 - vpcmpgtd 1408+__svml_scosh_ha_data_internal(%rip), %ymm5, %ymm8 #665.23 - vfnmadd231ps 896+__svml_scosh_ha_data_internal(%rip), %ymm0, %ymm5 #677.13 + vpcmpgtd 1408+__jsvml_scosh_ha_data_internal(%rip), %ymm5, %ymm8 #665.23 + vfnmadd231ps 896+__jsvml_scosh_ha_data_internal(%rip), %ymm0, %ymm5 #677.13 vpslld $19, %ymm3, %ymm4 #675.20 - vfnmadd231ps 960+__svml_scosh_ha_data_internal(%rip), %ymm0, %ymm5 #678.13 + vfnmadd231ps 960+__jsvml_scosh_ha_data_internal(%rip), %ymm0, %ymm5 #678.13 vmovmskps %ymm8, %r11d #666.45 vextractf128 $1, %ymm1, %xmm13 #679.629 vmovd %xmm1, %r9d #679.241 @@ -779,29 +779,29 @@ __svml_coshf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r15,4), %rdi #692.546 lea 128(%rsp,%r15,4), %rsi #692.546 -..___tag_value___svml_coshf8_ha_l9.88: -# __svml_scosh_ha_cout_rare_internal(const float *, float *) - call __svml_scosh_ha_cout_rare_internal #692.546 -..___tag_value___svml_coshf8_ha_l9.89: +..___tag_value___jsvml_coshf8_ha_l9.88: +# __jsvml_scosh_ha_cout_rare_internal(const float *, float *) + call __jsvml_scosh_ha_cout_rare_internal #692.546 +..___tag_value___jsvml_coshf8_ha_l9.89: jmp ..B4.8 # Prob 100% #692.546 .align 16,0x90 # LOE rbx r13 r14 r12d r15d .cfi_endproc # mark_end; - .type __svml_coshf8_ha_l9,@function - .size __svml_coshf8_ha_l9,.-__svml_coshf8_ha_l9 -..LN__svml_coshf8_ha_l9.3: + .type __jsvml_coshf8_ha_l9,@function + .size __jsvml_coshf8_ha_l9,.-__jsvml_coshf8_ha_l9 +..LN__jsvml_coshf8_ha_l9.3: .data -# -- End __svml_coshf8_ha_l9 +# -- End __jsvml_coshf8_ha_l9 .text -.L_2__routine_start___svml_coshf4_ha_ex_4: -# -- Begin __svml_coshf4_ha_ex +.L_2__routine_start___jsvml_coshf4_ha_ex_4: +# -- Begin __jsvml_coshf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_coshf4_ha_ex -# --- __svml_coshf4_ha_ex(__m128) -__svml_coshf4_ha_ex: + .globl __jsvml_coshf4_ha_ex +# --- __jsvml_coshf4_ha_ex(__m128) +__jsvml_coshf4_ha_ex: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -810,7 +810,7 @@ __svml_coshf4_ha_ex: .byte 30 #757.540 .byte 250 #757.540 .cfi_startproc -..___tag_value___svml_coshf4_ha_ex.91: +..___tag_value___jsvml_coshf4_ha_ex.91: ..L92: #700.1 pushq %rbp #700.1 @@ -820,28 +820,28 @@ __svml_coshf4_ha_ex: .cfi_offset 6, -16 andq $-64, %rsp #700.1 subq $192, %rsp #700.1 - lea 1484+__svml_scosh_ha_data_internal(%rip), %r8 #744.614 - movups 1024+__svml_scosh_ha_data_internal(%rip), %xmm4 #727.16 - movups 768+__svml_scosh_ha_data_internal(%rip), %xmm9 #728.25 + lea 1484+__jsvml_scosh_ha_data_internal(%rip), %r8 #744.614 + movups 1024+__jsvml_scosh_ha_data_internal(%rip), %xmm4 #727.16 + movups 768+__jsvml_scosh_ha_data_internal(%rip), %xmm9 #728.25 andnps %xmm0, %xmm4 #727.16 mulps %xmm4, %xmm9 #728.25 movaps %xmm4, %xmm5 #730.21 - movups 1280+__svml_scosh_ha_data_internal(%rip), %xmm7 #721.49 + movups 1280+__jsvml_scosh_ha_data_internal(%rip), %xmm7 #721.49 movaps %xmm7, %xmm3 #732.13 addps %xmm7, %xmm9 #728.13 pxor %xmm9, %xmm3 #732.13 subps %xmm7, %xmm9 #741.13 - movdqu 1344+__svml_scosh_ha_data_internal(%rip), %xmm6 #723.56 + movdqu 1344+__jsvml_scosh_ha_data_internal(%rip), %xmm6 #723.56 movdqa %xmm6, %xmm2 #734.17 psubd %xmm3, %xmm2 #734.17 - movups 896+__svml_scosh_ha_data_internal(%rip), %xmm8 #742.35 + movups 896+__jsvml_scosh_ha_data_internal(%rip), %xmm8 #742.35 psrld $28, %xmm2 #735.17 mulps %xmm9, %xmm8 #742.35 pslld $4, %xmm2 #736.17 por %xmm3, %xmm2 #737.17 subps %xmm8, %xmm4 #742.13 pand %xmm6, %xmm2 #738.17 - movups 960+__svml_scosh_ha_data_internal(%rip), %xmm10 #743.32 + movups 960+__jsvml_scosh_ha_data_internal(%rip), %xmm10 #743.32 movdqa %xmm2, %xmm13 #744.177 mulps %xmm9, %xmm10 #743.32 pslld $4, %xmm13 #744.177 @@ -862,7 +862,7 @@ __svml_coshf4_ha_ex: punpcklqdq %xmm7, %xmm10 #745.1071 punpcklqdq %xmm8, %xmm9 #745.1257 shufps $136, %xmm9, %xmm10 #745.1051 - pcmpgtd 1408+__svml_scosh_ha_data_internal(%rip), %xmm5 #730.21 + pcmpgtd 1408+__jsvml_scosh_ha_data_internal(%rip), %xmm5 #730.21 mulps %xmm4, %xmm10 #747.27 movmskps %xmm5, %eax #731.44 movd -4(%rdx,%r8), %xmm1 #744.1090 @@ -950,29 +950,29 @@ __svml_coshf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #757.540 lea 128(%rsp,%r12,4), %rsi #757.540 -..___tag_value___svml_coshf4_ha_ex.109: -# __svml_scosh_ha_cout_rare_internal(const float *, float *) - call __svml_scosh_ha_cout_rare_internal #757.540 -..___tag_value___svml_coshf4_ha_ex.110: +..___tag_value___jsvml_coshf4_ha_ex.109: +# __jsvml_scosh_ha_cout_rare_internal(const float *, float *) + call __jsvml_scosh_ha_cout_rare_internal #757.540 +..___tag_value___jsvml_coshf4_ha_ex.110: jmp ..B5.8 # Prob 100% #757.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_coshf4_ha_ex,@function - .size __svml_coshf4_ha_ex,.-__svml_coshf4_ha_ex -..LN__svml_coshf4_ha_ex.4: + .type __jsvml_coshf4_ha_ex,@function + .size __jsvml_coshf4_ha_ex,.-__jsvml_coshf4_ha_ex +..LN__jsvml_coshf4_ha_ex.4: .data -# -- End __svml_coshf4_ha_ex +# -- End __jsvml_coshf4_ha_ex .text -.L_2__routine_start___svml_coshf4_ha_e9_5: -# -- Begin __svml_coshf4_ha_e9 +.L_2__routine_start___jsvml_coshf4_ha_e9_5: +# -- Begin __jsvml_coshf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_coshf4_ha_e9 -# --- __svml_coshf4_ha_e9(__m128) -__svml_coshf4_ha_e9: + .globl __jsvml_coshf4_ha_e9 +# --- __jsvml_coshf4_ha_e9(__m128) +__jsvml_coshf4_ha_e9: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -981,7 +981,7 @@ __svml_coshf4_ha_e9: .byte 30 #822.540 .byte 250 #822.540 .cfi_startproc -..___tag_value___svml_coshf4_ha_e9.112: +..___tag_value___jsvml_coshf4_ha_e9.112: ..L113: #765.1 pushq %rbp #765.1 @@ -991,33 +991,33 @@ __svml_coshf4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #765.1 subq $192, %rsp #765.1 - lea 1484+__svml_scosh_ha_data_internal(%rip), %r8 #809.533 - movups 1024+__svml_scosh_ha_data_internal(%rip), %xmm4 #792.16 - movups 768+__svml_scosh_ha_data_internal(%rip), %xmm9 #793.25 + lea 1484+__jsvml_scosh_ha_data_internal(%rip), %r8 #809.533 + movups 1024+__jsvml_scosh_ha_data_internal(%rip), %xmm4 #792.16 + movups 768+__jsvml_scosh_ha_data_internal(%rip), %xmm9 #793.25 andnps %xmm0, %xmm4 #792.16 mulps %xmm4, %xmm9 #793.25 movaps %xmm4, %xmm5 #795.27 - movups 1280+__svml_scosh_ha_data_internal(%rip), %xmm7 #786.49 + movups 1280+__jsvml_scosh_ha_data_internal(%rip), %xmm7 #786.49 movaps %xmm7, %xmm3 #797.13 addps %xmm7, %xmm9 #793.13 pxor %xmm9, %xmm3 #797.13 subps %xmm7, %xmm9 #806.13 - movups 1344+__svml_scosh_ha_data_internal(%rip), %xmm6 #788.27 + movups 1344+__jsvml_scosh_ha_data_internal(%rip), %xmm6 #788.27 movaps %xmm6, %xmm2 #799.23 psubd %xmm3, %xmm2 #799.23 - movups 896+__svml_scosh_ha_data_internal(%rip), %xmm8 #807.35 + movups 896+__jsvml_scosh_ha_data_internal(%rip), %xmm8 #807.35 psrld $28, %xmm2 #800.23 mulps %xmm9, %xmm8 #807.35 pslld $4, %xmm2 #801.23 por %xmm3, %xmm2 #802.23 subps %xmm8, %xmm4 #807.13 pand %xmm6, %xmm2 #803.23 - movups 960+__svml_scosh_ha_data_internal(%rip), %xmm10 #808.32 + movups 960+__jsvml_scosh_ha_data_internal(%rip), %xmm10 #808.32 movdqa %xmm2, %xmm11 #809.183 mulps %xmm9, %xmm10 #808.32 pslld $4, %xmm11 #809.183 movd %xmm11, %edx #809.246 - pcmpgtd 1408+__svml_scosh_ha_data_internal(%rip), %xmm5 #795.27 + pcmpgtd 1408+__jsvml_scosh_ha_data_internal(%rip), %xmm5 #795.27 psubd %xmm2, %xmm3 #804.24 pextrd $1, %xmm11, %ecx #809.314 pslld $19, %xmm3 #805.24 @@ -1118,30 +1118,30 @@ __svml_coshf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #822.540 lea 128(%rsp,%r12,4), %rsi #822.540 -..___tag_value___svml_coshf4_ha_e9.130: -# __svml_scosh_ha_cout_rare_internal(const float *, float *) - call __svml_scosh_ha_cout_rare_internal #822.540 -..___tag_value___svml_coshf4_ha_e9.131: +..___tag_value___jsvml_coshf4_ha_e9.130: +# __jsvml_scosh_ha_cout_rare_internal(const float *, float *) + call __jsvml_scosh_ha_cout_rare_internal #822.540 +..___tag_value___jsvml_coshf4_ha_e9.131: jmp ..B6.8 # Prob 100% #822.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_coshf4_ha_e9,@function - .size __svml_coshf4_ha_e9,.-__svml_coshf4_ha_e9 -..LN__svml_coshf4_ha_e9.5: + .type __jsvml_coshf4_ha_e9,@function + .size __jsvml_coshf4_ha_e9,.-__jsvml_coshf4_ha_e9 +..LN__jsvml_coshf4_ha_e9.5: .data -# -- End __svml_coshf4_ha_e9 +# -- End __jsvml_coshf4_ha_e9 .text -.L_2__routine_start___svml_scosh_ha_cout_rare_internal_6: -# -- Begin __svml_scosh_ha_cout_rare_internal +.L_2__routine_start___jsvml_scosh_ha_cout_rare_internal_6: +# -- Begin __jsvml_scosh_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_scosh_ha_cout_rare_internal - .globl __svml_scosh_ha_cout_rare_internal -# --- __svml_scosh_ha_cout_rare_internal(const float *, float *) -__svml_scosh_ha_cout_rare_internal: + .hidden __jsvml_scosh_ha_cout_rare_internal + .globl __jsvml_scosh_ha_cout_rare_internal +# --- __jsvml_scosh_ha_cout_rare_internal(const float *, float *) +__jsvml_scosh_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1151,7 +1151,7 @@ __svml_scosh_ha_cout_rare_internal: .byte 30 #1078.11 .byte 250 #1078.11 .cfi_startproc -..___tag_value___svml_scosh_ha_cout_rare_internal.133: +..___tag_value___jsvml_scosh_ha_cout_rare_internal.133: ..L134: #975.1 movq %rsi, %r8 #975.1 @@ -1382,17 +1382,17 @@ __svml_scosh_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_scosh_ha_cout_rare_internal,@function - .size __svml_scosh_ha_cout_rare_internal,.-__svml_scosh_ha_cout_rare_internal -..LN__svml_scosh_ha_cout_rare_internal.6: + .type __jsvml_scosh_ha_cout_rare_internal,@function + .size __jsvml_scosh_ha_cout_rare_internal,.-__jsvml_scosh_ha_cout_rare_internal +..LN__jsvml_scosh_ha_cout_rare_internal.6: .data -# -- End __svml_scosh_ha_cout_rare_internal +# -- End __jsvml_scosh_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_scosh_ha_data_internal - .globl __svml_scosh_ha_data_internal -__svml_scosh_ha_data_internal: + .hidden __jsvml_scosh_ha_data_internal + .globl __jsvml_scosh_ha_data_internal +__jsvml_scosh_ha_data_internal: .long 1056964608 .long 1057148295 .long 1057336003 @@ -2785,8 +2785,8 @@ __svml_scosh_ha_data_internal: .long 1190471037 .long 1182083057 .long 1168339481 - .type __svml_scosh_ha_data_internal,@object - .size __svml_scosh_ha_data_internal,5568 + .type __jsvml_scosh_ha_data_internal,@object + .size __jsvml_scosh_ha_data_internal,5568 .align 32 _vmldCoshHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_exp_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_exp_linux_x86.S similarity index 88% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_exp_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_exp_linux_x86.S index ad5a2b6ed90..4a88088f250 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_exp_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_exp_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_exp.c" .text ..TXTST0: -.L_2__routine_start___svml_expf4_ha_l9_0: -# -- Begin __svml_expf4_ha_l9 +.L_2__routine_start___jsvml_expf4_ha_l9_0: +# -- Begin __jsvml_expf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expf4_ha_l9 -# --- __svml_expf4_ha_l9(__m128) -__svml_expf4_ha_l9: + .globl __jsvml_expf4_ha_l9 +# --- __jsvml_expf4_ha_l9(__m128) +__jsvml_expf4_ha_l9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_expf4_ha_l9: .byte 30 #416.540 .byte 250 #416.540 .cfi_startproc -..___tag_value___svml_expf4_ha_l9.1: +..___tag_value___jsvml_expf4_ha_l9.1: ..L2: #333.1 pushq %rbp #333.1 @@ -58,25 +58,25 @@ __svml_expf4_ha_l9: andq $-64, %rsp #333.1 subq $192, %rsp #333.1 vmovaps %xmm0, %xmm1 #333.1 - vmovups 64+__svml_sexp_ha_data_internal(%rip), %xmm2 #361.57 - vmovups __svml_sexp_ha_data_internal(%rip), %xmm8 #363.23 + vmovups 64+__jsvml_sexp_ha_data_internal(%rip), %xmm2 #361.57 + vmovups __jsvml_sexp_ha_data_internal(%rip), %xmm8 #363.23 vfmadd213ps %xmm2, %xmm1, %xmm8 #363.23 - vmovups 256+__svml_sexp_ha_data_internal(%rip), %xmm5 #373.55 - vmovups 512+__svml_sexp_ha_data_internal(%rip), %xmm15 #379.52 - vmovups 384+__svml_sexp_ha_data_internal(%rip), %xmm6 #377.64 - vandps 128+__svml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #364.26 + vmovups 256+__jsvml_sexp_ha_data_internal(%rip), %xmm5 #373.55 + vmovups 512+__jsvml_sexp_ha_data_internal(%rip), %xmm15 #379.52 + vmovups 384+__jsvml_sexp_ha_data_internal(%rip), %xmm6 #377.64 + vandps 128+__jsvml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #364.26 vpermilps %xmm8, %xmm6, %xmm11 #377.116 vpslld $21, %xmm8, %xmm9 #385.43 - vcmpnleps 192+__svml_sexp_ha_data_internal(%rip), %xmm3, %xmm4 #369.33 + vcmpnleps 192+__jsvml_sexp_ha_data_internal(%rip), %xmm3, %xmm4 #369.33 vsubps %xmm2, %xmm8, %xmm14 #365.23 vmovmskps %xmm4, %eax #371.56 - vmovups 448+__svml_sexp_ha_data_internal(%rip), %xmm7 #378.64 - vandps 704+__svml_sexp_ha_data_internal(%rip), %xmm9, %xmm13 #387.25 + vmovups 448+__jsvml_sexp_ha_data_internal(%rip), %xmm7 #378.64 + vandps 704+__jsvml_sexp_ha_data_internal(%rip), %xmm9, %xmm13 #387.25 vfnmadd213ps %xmm1, %xmm14, %xmm5 #375.21 - vfnmadd132ps 320+__svml_sexp_ha_data_internal(%rip), %xmm5, %xmm14 #376.21 - vfmadd213ps 576+__svml_sexp_ha_data_internal(%rip), %xmm14, %xmm15 #382.25 + vfnmadd132ps 320+__jsvml_sexp_ha_data_internal(%rip), %xmm5, %xmm14 #376.21 + vfmadd213ps 576+__jsvml_sexp_ha_data_internal(%rip), %xmm14, %xmm15 #382.25 vmulps %xmm14, %xmm14, %xmm10 #383.26 - vfmadd213ps 640+__svml_sexp_ha_data_internal(%rip), %xmm14, %xmm15 #384.25 + vfmadd213ps 640+__jsvml_sexp_ha_data_internal(%rip), %xmm14, %xmm15 #384.25 vfmadd213ps %xmm11, %xmm10, %xmm15 #388.25 vpermilps %xmm8, %xmm7, %xmm12 #378.116 vaddps %xmm15, %xmm14, %xmm5 #390.25 @@ -98,8 +98,8 @@ __svml_expf4_ha_l9: # LOE ..B1.3: # Preds ..B1.1 # Execution count [5.00e-02]: Infreq - vmovups 2560+__svml_sexp_ha_data_internal(%rip), %xmm2 #403.62 - vcmpltps 2624+__svml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #406.27 + vmovups 2560+__jsvml_sexp_ha_data_internal(%rip), %xmm2 #403.62 + vcmpltps 2624+__jsvml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #406.27 vcmpltps %xmm1, %xmm2, %xmm0 #404.27 vorps %xmm3, %xmm0, %xmm4 #409.27 vmovmskps %xmm4, %edx #411.68 @@ -151,29 +151,29 @@ __svml_expf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #416.540 lea 128(%rsp,%r12,4), %rsi #416.540 -..___tag_value___svml_expf4_ha_l9.19: -# __svml_sexp_ha_cout_rare_internal(const float *, float *) - call __svml_sexp_ha_cout_rare_internal #416.540 -..___tag_value___svml_expf4_ha_l9.20: +..___tag_value___jsvml_expf4_ha_l9.19: +# __jsvml_sexp_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexp_ha_cout_rare_internal #416.540 +..___tag_value___jsvml_expf4_ha_l9.20: jmp ..B1.9 # Prob 100% #416.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expf4_ha_l9,@function - .size __svml_expf4_ha_l9,.-__svml_expf4_ha_l9 -..LN__svml_expf4_ha_l9.0: + .type __jsvml_expf4_ha_l9,@function + .size __jsvml_expf4_ha_l9,.-__jsvml_expf4_ha_l9 +..LN__jsvml_expf4_ha_l9.0: .data -# -- End __svml_expf4_ha_l9 +# -- End __jsvml_expf4_ha_l9 .text -.L_2__routine_start___svml_expf4_ha_e9_1: -# -- Begin __svml_expf4_ha_e9 +.L_2__routine_start___jsvml_expf4_ha_e9_1: +# -- Begin __jsvml_expf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expf4_ha_e9 -# --- __svml_expf4_ha_e9(__m128) -__svml_expf4_ha_e9: + .globl __jsvml_expf4_ha_e9 +# --- __jsvml_expf4_ha_e9(__m128) +__jsvml_expf4_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -182,7 +182,7 @@ __svml_expf4_ha_e9: .byte 30 #776.540 .byte 250 #776.540 .cfi_startproc -..___tag_value___svml_expf4_ha_e9.22: +..___tag_value___jsvml_expf4_ha_e9.22: ..L23: #692.1 pushq %rbp #692.1 @@ -193,27 +193,27 @@ __svml_expf4_ha_e9: andq $-64, %rsp #692.1 subq $192, %rsp #692.1 vmovaps %xmm0, %xmm1 #692.1 - vmulps __svml_sexp_ha_data_internal(%rip), %xmm1, %xmm2 #722.23 + vmulps __jsvml_sexp_ha_data_internal(%rip), %xmm1, %xmm2 #722.23 vroundps $0, %xmm2, %xmm2 #724.23 - vmulps 256+__svml_sexp_ha_data_internal(%rip), %xmm2, %xmm5 #734.41 - vaddps 64+__svml_sexp_ha_data_internal(%rip), %xmm2, %xmm13 #735.22 - vmulps 320+__svml_sexp_ha_data_internal(%rip), %xmm2, %xmm7 #736.40 + vmulps 256+__jsvml_sexp_ha_data_internal(%rip), %xmm2, %xmm5 #734.41 + vaddps 64+__jsvml_sexp_ha_data_internal(%rip), %xmm2, %xmm13 #735.22 + vmulps 320+__jsvml_sexp_ha_data_internal(%rip), %xmm2, %xmm7 #736.40 vsubps %xmm5, %xmm1, %xmm6 #734.21 - vmovups 384+__svml_sexp_ha_data_internal(%rip), %xmm8 #737.64 + vmovups 384+__jsvml_sexp_ha_data_internal(%rip), %xmm8 #737.64 vpslld $21, %xmm13, %xmm14 #745.43 vpermilps %xmm13, %xmm8, %xmm8 #737.116 vsubps %xmm7, %xmm6, %xmm0 #736.21 - vmulps 512+__svml_sexp_ha_data_internal(%rip), %xmm0, %xmm10 #742.37 + vmulps 512+__jsvml_sexp_ha_data_internal(%rip), %xmm0, %xmm10 #742.37 vmulps %xmm0, %xmm0, %xmm15 #743.26 - vaddps 576+__svml_sexp_ha_data_internal(%rip), %xmm10, %xmm11 #742.25 + vaddps 576+__jsvml_sexp_ha_data_internal(%rip), %xmm10, %xmm11 #742.25 vmulps %xmm11, %xmm0, %xmm12 #744.37 - vmovups 448+__svml_sexp_ha_data_internal(%rip), %xmm9 #738.64 - vandps 128+__svml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #723.26 + vmovups 448+__jsvml_sexp_ha_data_internal(%rip), %xmm9 #738.64 + vandps 128+__jsvml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #723.26 vpermilps %xmm13, %xmm9, %xmm2 #738.116 - vcmpnleps 192+__svml_sexp_ha_data_internal(%rip), %xmm3, %xmm4 #728.33 - vaddps 640+__svml_sexp_ha_data_internal(%rip), %xmm12, %xmm10 #744.25 + vcmpnleps 192+__jsvml_sexp_ha_data_internal(%rip), %xmm3, %xmm4 #728.33 + vaddps 640+__jsvml_sexp_ha_data_internal(%rip), %xmm12, %xmm10 #744.25 vmovmskps %xmm4, %eax #730.56 - vandps 704+__svml_sexp_ha_data_internal(%rip), %xmm14, %xmm4 #747.25 + vandps 704+__jsvml_sexp_ha_data_internal(%rip), %xmm14, %xmm4 #747.25 vmulps %xmm10, %xmm15, %xmm15 #748.37 vaddps %xmm15, %xmm8, %xmm11 #748.25 vaddps %xmm11, %xmm0, %xmm12 #749.25 @@ -236,8 +236,8 @@ __svml_expf4_ha_e9: # LOE ..B2.3: # Preds ..B2.1 # Execution count [5.00e-02]: Infreq - vmovups 2560+__svml_sexp_ha_data_internal(%rip), %xmm2 #763.62 - vcmpltps 2624+__svml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #766.27 + vmovups 2560+__jsvml_sexp_ha_data_internal(%rip), %xmm2 #763.62 + vcmpltps 2624+__jsvml_sexp_ha_data_internal(%rip), %xmm1, %xmm3 #766.27 vcmpltps %xmm1, %xmm2, %xmm0 #764.27 vorps %xmm3, %xmm0, %xmm4 #769.27 vmovmskps %xmm4, %edx #771.68 @@ -289,29 +289,29 @@ __svml_expf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #776.540 lea 128(%rsp,%r12,4), %rsi #776.540 -..___tag_value___svml_expf4_ha_e9.40: -# __svml_sexp_ha_cout_rare_internal(const float *, float *) - call __svml_sexp_ha_cout_rare_internal #776.540 -..___tag_value___svml_expf4_ha_e9.41: +..___tag_value___jsvml_expf4_ha_e9.40: +# __jsvml_sexp_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexp_ha_cout_rare_internal #776.540 +..___tag_value___jsvml_expf4_ha_e9.41: jmp ..B2.9 # Prob 100% #776.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expf4_ha_e9,@function - .size __svml_expf4_ha_e9,.-__svml_expf4_ha_e9 -..LN__svml_expf4_ha_e9.1: + .type __jsvml_expf4_ha_e9,@function + .size __jsvml_expf4_ha_e9,.-__jsvml_expf4_ha_e9 +..LN__jsvml_expf4_ha_e9.1: .data -# -- End __svml_expf4_ha_e9 +# -- End __jsvml_expf4_ha_e9 .text -.L_2__routine_start___svml_expf8_ha_l9_2: -# -- Begin __svml_expf8_ha_l9 +.L_2__routine_start___jsvml_expf8_ha_l9_2: +# -- Begin __jsvml_expf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expf8_ha_l9 -# --- __svml_expf8_ha_l9(__m256) -__svml_expf8_ha_l9: + .globl __jsvml_expf8_ha_l9 +# --- __jsvml_expf8_ha_l9(__m256) +__jsvml_expf8_ha_l9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -320,7 +320,7 @@ __svml_expf8_ha_l9: .byte 30 #867.546 .byte 250 #867.546 .cfi_startproc -..___tag_value___svml_expf8_ha_l9.43: +..___tag_value___jsvml_expf8_ha_l9.43: ..L44: #784.1 pushq %rbp #784.1 @@ -330,27 +330,27 @@ __svml_expf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #784.1 subq $192, %rsp #784.1 - vmovups 64+__svml_sexp_ha_data_internal(%rip), %ymm1 #812.60 - vmovups __svml_sexp_ha_data_internal(%rip), %ymm7 #814.23 - vmovups 256+__svml_sexp_ha_data_internal(%rip), %ymm4 #824.58 - vmovups 512+__svml_sexp_ha_data_internal(%rip), %ymm14 #830.55 - vmovups 384+__svml_sexp_ha_data_internal(%rip), %ymm5 #828.67 - vmovups 448+__svml_sexp_ha_data_internal(%rip), %ymm6 #829.67 + vmovups 64+__jsvml_sexp_ha_data_internal(%rip), %ymm1 #812.60 + vmovups __jsvml_sexp_ha_data_internal(%rip), %ymm7 #814.23 + vmovups 256+__jsvml_sexp_ha_data_internal(%rip), %ymm4 #824.58 + vmovups 512+__jsvml_sexp_ha_data_internal(%rip), %ymm14 #830.55 + vmovups 384+__jsvml_sexp_ha_data_internal(%rip), %ymm5 #828.67 + vmovups 448+__jsvml_sexp_ha_data_internal(%rip), %ymm6 #829.67 vfmadd213ps %ymm1, %ymm0, %ymm7 #814.23 vsubps %ymm1, %ymm7, %ymm13 #816.23 vpslld $21, %ymm7, %ymm8 #836.46 vfnmadd213ps %ymm0, %ymm13, %ymm4 #826.21 - vfnmadd132ps 320+__svml_sexp_ha_data_internal(%rip), %ymm4, %ymm13 #827.21 - vfmadd213ps 576+__svml_sexp_ha_data_internal(%rip), %ymm13, %ymm14 #833.25 + vfnmadd132ps 320+__jsvml_sexp_ha_data_internal(%rip), %ymm4, %ymm13 #827.21 + vfmadd213ps 576+__jsvml_sexp_ha_data_internal(%rip), %ymm13, %ymm14 #833.25 vmulps %ymm13, %ymm13, %ymm9 #834.26 - vfmadd213ps 640+__svml_sexp_ha_data_internal(%rip), %ymm13, %ymm14 #835.25 + vfmadd213ps 640+__jsvml_sexp_ha_data_internal(%rip), %ymm13, %ymm14 #835.25 vpermilps %ymm7, %ymm5, %ymm10 #828.119 vfmadd213ps %ymm10, %ymm9, %ymm14 #839.25 - vandps 704+__svml_sexp_ha_data_internal(%rip), %ymm8, %ymm12 #838.25 + vandps 704+__jsvml_sexp_ha_data_internal(%rip), %ymm8, %ymm12 #838.25 vpermilps %ymm7, %ymm6, %ymm11 #829.119 - vandps 128+__svml_sexp_ha_data_internal(%rip), %ymm0, %ymm2 #815.26 + vandps 128+__jsvml_sexp_ha_data_internal(%rip), %ymm0, %ymm2 #815.26 vmulps %ymm12, %ymm11, %ymm15 #840.26 - vcmpnle_uqps 192+__svml_sexp_ha_data_internal(%rip), %ymm2, %ymm3 #820.33 + vcmpnle_uqps 192+__jsvml_sexp_ha_data_internal(%rip), %ymm2, %ymm3 #820.33 vaddps %ymm14, %ymm13, %ymm1 #841.25 vmovmskps %ymm3, %eax #822.57 vfmadd213ps %ymm15, %ymm15, %ymm1 #842.26 @@ -370,8 +370,8 @@ __svml_expf8_ha_l9: # LOE ..B3.3: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq - vcmpgt_oqps 2560+__svml_sexp_ha_data_internal(%rip), %ymm0, %ymm2 #855.27 - vcmplt_oqps 2624+__svml_sexp_ha_data_internal(%rip), %ymm0, %ymm3 #857.27 + vcmpgt_oqps 2560+__jsvml_sexp_ha_data_internal(%rip), %ymm0, %ymm2 #855.27 + vcmplt_oqps 2624+__jsvml_sexp_ha_data_internal(%rip), %ymm0, %ymm3 #857.27 vblendvps %ymm2, .L_2il0floatpacket.38(%rip), %ymm1, %ymm1 #858.22 vorps %ymm3, %ymm2, %ymm4 #860.27 vmovmskps %ymm4, %edx #862.69 @@ -426,29 +426,29 @@ __svml_expf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #867.546 lea 128(%rsp,%r12,4), %rsi #867.546 -..___tag_value___svml_expf8_ha_l9.61: -# __svml_sexp_ha_cout_rare_internal(const float *, float *) - call __svml_sexp_ha_cout_rare_internal #867.546 -..___tag_value___svml_expf8_ha_l9.62: +..___tag_value___jsvml_expf8_ha_l9.61: +# __jsvml_sexp_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexp_ha_cout_rare_internal #867.546 +..___tag_value___jsvml_expf8_ha_l9.62: jmp ..B3.9 # Prob 100% #867.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expf8_ha_l9,@function - .size __svml_expf8_ha_l9,.-__svml_expf8_ha_l9 -..LN__svml_expf8_ha_l9.2: + .type __jsvml_expf8_ha_l9,@function + .size __jsvml_expf8_ha_l9,.-__jsvml_expf8_ha_l9 +..LN__jsvml_expf8_ha_l9.2: .data -# -- End __svml_expf8_ha_l9 +# -- End __jsvml_expf8_ha_l9 .text -.L_2__routine_start___svml_expf16_ha_z0_3: -# -- Begin __svml_expf16_ha_z0 +.L_2__routine_start___jsvml_expf16_ha_z0_3: +# -- Begin __jsvml_expf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_expf16_ha_z0 -# --- __svml_expf16_ha_z0(__m512) -__svml_expf16_ha_z0: + .globl __jsvml_expf16_ha_z0 +# --- __jsvml_expf16_ha_z0(__m512) +__jsvml_expf16_ha_z0: # parameter 1: %zmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -457,50 +457,50 @@ __svml_expf16_ha_z0: .byte 30 #941.12 .byte 250 #941.12 .cfi_startproc -..___tag_value___svml_expf16_ha_z0.64: +..___tag_value___jsvml_expf16_ha_z0.64: ..L65: #875.1 - vmovups 256+__svml_sexp_ha_data_internal_avx512(%rip), %zmm4 #907.46 - vmovups 320+__svml_sexp_ha_data_internal_avx512(%rip), %zmm1 #908.50 - vmovups 384+__svml_sexp_ha_data_internal_avx512(%rip), %zmm2 #911.46 - vmovups 448+__svml_sexp_ha_data_internal_avx512(%rip), %zmm3 #912.46 - vmovups __svml_sexp_ha_data_internal_avx512(%rip), %zmm6 #916.281 - vmovups 576+__svml_sexp_ha_data_internal_avx512(%rip), %zmm5 #920.54 + vmovups 256+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm4 #907.46 + vmovups 320+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm1 #908.50 + vmovups 384+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm2 #911.46 + vmovups 448+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm3 #912.46 + vmovups __jsvml_sexp_ha_data_internal_avx512(%rip), %zmm6 #916.281 + vmovups 576+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm5 #920.54 vfmadd213ps {rz-sae}, %zmm1, %zmm0, %zmm4 #909.17 - vmovups 640+__svml_sexp_ha_data_internal_avx512(%rip), %zmm8 #921.54 - vmovups 128+__svml_sexp_ha_data_internal_avx512(%rip), %zmm10 #917.280 + vmovups 640+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm8 #921.54 + vmovups 128+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm10 #917.280 vsubps {rn-sae}, %zmm1, %zmm4, %zmm13 #910.14 - vpermt2ps 64+__svml_sexp_ha_data_internal_avx512(%rip), %zmm4, %zmm6 #916.281 - vpermt2ps 192+__svml_sexp_ha_data_internal_avx512(%rip), %zmm4, %zmm10 #917.280 + vpermt2ps 64+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm4, %zmm6 #916.281 + vpermt2ps 192+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm4, %zmm10 #917.280 vfnmadd231ps {rn-sae}, %zmm13, %zmm2, %zmm0 #913.12 vfnmadd231ps {rn-sae}, %zmm13, %zmm3, %zmm0 #914.12 - vandps 512+__svml_sexp_ha_data_internal_avx512(%rip), %zmm0, %zmm7 #919.12 + vandps 512+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm0, %zmm7 #919.12 vmulps {rn-sae}, %zmm7, %zmm7, %zmm11 #923.15 vfmadd231ps {rn-sae}, %zmm7, %zmm5, %zmm8 #922.14 vaddps {rn-sae}, %zmm7, %zmm6, %zmm9 #924.16 vfmadd213ps {rn-sae}, %zmm9, %zmm8, %zmm11 #925.12 vfmadd213ps {rn-sae}, %zmm10, %zmm10, %zmm11 #927.16 - vandps 704+__svml_sexp_ha_data_internal_avx512(%rip), %zmm11, %zmm12 #929.16 + vandps 704+__jsvml_sexp_ha_data_internal_avx512(%rip), %zmm11, %zmm12 #929.16 vscalefps {rn-sae}, %zmm13, %zmm12, %zmm0 #930.22 ret #941.12 .align 16,0x90 # LOE .cfi_endproc # mark_end; - .type __svml_expf16_ha_z0,@function - .size __svml_expf16_ha_z0,.-__svml_expf16_ha_z0 -..LN__svml_expf16_ha_z0.3: + .type __jsvml_expf16_ha_z0,@function + .size __jsvml_expf16_ha_z0,.-__jsvml_expf16_ha_z0 +..LN__jsvml_expf16_ha_z0.3: .data -# -- End __svml_expf16_ha_z0 +# -- End __jsvml_expf16_ha_z0 .text -.L_2__routine_start___svml_expf8_ha_e9_4: -# -- Begin __svml_expf8_ha_e9 +.L_2__routine_start___jsvml_expf8_ha_e9_4: +# -- Begin __jsvml_expf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expf8_ha_e9 -# --- __svml_expf8_ha_e9(__m256) -__svml_expf8_ha_e9: + .globl __jsvml_expf8_ha_e9 +# --- __jsvml_expf8_ha_e9(__m256) +__jsvml_expf8_ha_e9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -509,7 +509,7 @@ __svml_expf8_ha_e9: .byte 30 #1026.46 .byte 250 #1026.46 .cfi_startproc -..___tag_value___svml_expf8_ha_e9.67: +..___tag_value___jsvml_expf8_ha_e9.67: ..L68: #946.1 pushq %rbp #946.1 @@ -520,29 +520,29 @@ __svml_expf8_ha_e9: andq $-64, %rsp #946.1 subq $192, %rsp #946.1 vmovaps %ymm0, %ymm6 #946.1 - vmulps __svml_sexp_ha_data_internal(%rip), %ymm6, %ymm5 #976.23 - vmovups 384+__svml_sexp_ha_data_internal(%rip), %ymm1 #991.67 - vmovups 448+__svml_sexp_ha_data_internal(%rip), %ymm0 #992.67 + vmulps __jsvml_sexp_ha_data_internal(%rip), %ymm6, %ymm5 #976.23 + vmovups 384+__jsvml_sexp_ha_data_internal(%rip), %ymm1 #991.67 + vmovups 448+__jsvml_sexp_ha_data_internal(%rip), %ymm0 #992.67 vroundps $0, %ymm5, %ymm13 #978.23 vpxor %xmm5, %xmm5, %xmm5 #984.55 - vmulps 256+__svml_sexp_ha_data_internal(%rip), %ymm13, %ymm12 #988.44 - vmulps 320+__svml_sexp_ha_data_internal(%rip), %ymm13, %ymm15 #990.43 - vaddps 64+__svml_sexp_ha_data_internal(%rip), %ymm13, %ymm4 #989.22 + vmulps 256+__jsvml_sexp_ha_data_internal(%rip), %ymm13, %ymm12 #988.44 + vmulps 320+__jsvml_sexp_ha_data_internal(%rip), %ymm13, %ymm15 #990.43 + vaddps 64+__jsvml_sexp_ha_data_internal(%rip), %ymm13, %ymm4 #989.22 vsubps %ymm12, %ymm6, %ymm14 #988.21 vsubps %ymm15, %ymm14, %ymm3 #990.21 - vandps 128+__svml_sexp_ha_data_internal(%rip), %ymm6, %ymm7 #977.26 - vcmpnle_uqps 192+__svml_sexp_ha_data_internal(%rip), %ymm7, %ymm8 #982.33 - vmulps 512+__svml_sexp_ha_data_internal(%rip), %ymm3, %ymm7 #996.40 + vandps 128+__jsvml_sexp_ha_data_internal(%rip), %ymm6, %ymm7 #977.26 + vcmpnle_uqps 192+__jsvml_sexp_ha_data_internal(%rip), %ymm7, %ymm8 #982.33 + vmulps 512+__jsvml_sexp_ha_data_internal(%rip), %ymm3, %ymm7 #996.40 vpermilps %ymm4, %ymm1, %ymm2 #991.119 vpermilps %ymm4, %ymm0, %ymm1 #992.119 vmulps %ymm3, %ymm3, %ymm0 #997.26 vextractf128 $1, %ymm8, %xmm9 #983.140 vpackssdw %xmm9, %xmm8, %xmm10 #984.91 - vaddps 576+__svml_sexp_ha_data_internal(%rip), %ymm7, %ymm8 #996.25 + vaddps 576+__jsvml_sexp_ha_data_internal(%rip), %ymm7, %ymm8 #996.25 vpacksswb %xmm5, %xmm10, %xmm11 #984.74 vpmovmskb %xmm11, %edx #984.55 vmulps %ymm8, %ymm3, %ymm9 #998.40 - vaddps 640+__svml_sexp_ha_data_internal(%rip), %ymm9, %ymm14 #998.25 + vaddps 640+__jsvml_sexp_ha_data_internal(%rip), %ymm9, %ymm14 #998.25 vmulps %ymm14, %ymm0, %ymm15 #1002.40 vaddps %ymm15, %ymm2, %ymm2 #1002.25 vaddps %ymm2, %ymm3, %ymm3 #1003.25 @@ -552,7 +552,7 @@ __svml_expf8_ha_e9: vextractf128 $1, %ymm4, %xmm11 #999.222 vpslld $21, %xmm11, %xmm12 #999.188 vinsertf128 $1, %xmm12, %ymm10, %ymm13 #999.25 - vandps 704+__svml_sexp_ha_data_internal(%rip), %ymm13, %ymm4 #1001.25 + vandps 704+__jsvml_sexp_ha_data_internal(%rip), %ymm13, %ymm4 #1001.25 vmulps %ymm1, %ymm4, %ymm0 #1005.26 testb %dl, %dl #1006.52 jne ..B5.12 # Prob 5% #1006.52 @@ -619,18 +619,18 @@ __svml_expf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1030.546 lea 128(%rsp,%r12,4), %rsi #1030.546 -..___tag_value___svml_expf8_ha_e9.85: -# __svml_sexp_ha_cout_rare_internal(const float *, float *) - call __svml_sexp_ha_cout_rare_internal #1030.546 -..___tag_value___svml_expf8_ha_e9.86: +..___tag_value___jsvml_expf8_ha_e9.85: +# __jsvml_sexp_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexp_ha_cout_rare_internal #1030.546 +..___tag_value___jsvml_expf8_ha_e9.86: jmp ..B5.9 # Prob 100% #1030.546 .cfi_restore 12 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d ..B5.12: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq - vcmpgt_oqps 2560+__svml_sexp_ha_data_internal(%rip), %ymm6, %ymm1 #1018.27 - vcmplt_oqps 2624+__svml_sexp_ha_data_internal(%rip), %ymm6, %ymm2 #1020.27 + vcmpgt_oqps 2560+__jsvml_sexp_ha_data_internal(%rip), %ymm6, %ymm1 #1018.27 + vcmplt_oqps 2624+__jsvml_sexp_ha_data_internal(%rip), %ymm6, %ymm2 #1020.27 vblendvps %ymm1, .L_2il0floatpacket.38(%rip), %ymm0, %ymm0 #1021.22 vorps %ymm2, %ymm1, %ymm3 #1023.27 vandnps %ymm0, %ymm2, %ymm0 #1022.22 @@ -646,20 +646,20 @@ __svml_expf8_ha_e9: # LOE rbx r12 r13 r14 r15 edx ymm0 ymm6 .cfi_endproc # mark_end; - .type __svml_expf8_ha_e9,@function - .size __svml_expf8_ha_e9,.-__svml_expf8_ha_e9 -..LN__svml_expf8_ha_e9.4: + .type __jsvml_expf8_ha_e9,@function + .size __jsvml_expf8_ha_e9,.-__jsvml_expf8_ha_e9 +..LN__jsvml_expf8_ha_e9.4: .data -# -- End __svml_expf8_ha_e9 +# -- End __jsvml_expf8_ha_e9 .text -.L_2__routine_start___svml_expf4_ha_ex_5: -# -- Begin __svml_expf4_ha_ex +.L_2__routine_start___jsvml_expf4_ha_ex_5: +# -- Begin __jsvml_expf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_expf4_ha_ex -# --- __svml_expf4_ha_ex(__m128) -__svml_expf4_ha_ex: + .globl __jsvml_expf4_ha_ex +# --- __jsvml_expf4_ha_ex(__m128) +__jsvml_expf4_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -668,7 +668,7 @@ __svml_expf4_ha_ex: .byte 30 #1127.540 .byte 250 #1127.540 .cfi_startproc -..___tag_value___svml_expf4_ha_ex.90: +..___tag_value___jsvml_expf4_ha_ex.90: ..L91: #1038.1 pushq %rbp #1038.1 @@ -679,11 +679,11 @@ __svml_expf4_ha_ex: andq $-64, %rsp #1038.1 subq $192, %rsp #1038.1 movaps %xmm0, %xmm3 #1038.1 - movups 1792+__svml_sexp_ha_data_internal(%rip), %xmm0 #1080.33 - lea 768+__svml_sexp_ha_data_internal(%rip), %r8 #1089.69 + movups 1792+__jsvml_sexp_ha_data_internal(%rip), %xmm0 #1080.33 + lea 768+__jsvml_sexp_ha_data_internal(%rip), %r8 #1089.69 mulps %xmm3, %xmm0 #1080.33 - movups 1856+__svml_sexp_ha_data_internal(%rip), %xmm4 #1071.53 - movdqu 2176+__svml_sexp_ha_data_internal(%rip), %xmm8 #1087.25 + movups 1856+__jsvml_sexp_ha_data_internal(%rip), %xmm4 #1071.53 + movdqu 2176+__jsvml_sexp_ha_data_internal(%rip), %xmm8 #1087.25 addps %xmm4, %xmm0 #1080.21 pand %xmm0, %xmm8 #1087.25 movaps %xmm0, %xmm2 #1081.17 @@ -696,8 +696,8 @@ __svml_expf4_ha_ex: pshufd $3, %xmm8, %xmm9 #1089.789 movd %xmm7, %esi #1089.553 movd %xmm9, %edi #1089.771 - movups 1920+__svml_sexp_ha_data_internal(%rip), %xmm14 #1096.41 - movups 1984+__svml_sexp_ha_data_internal(%rip), %xmm15 #1097.40 + movups 1920+__jsvml_sexp_ha_data_internal(%rip), %xmm14 #1096.41 + movups 1984+__jsvml_sexp_ha_data_internal(%rip), %xmm15 #1097.40 movslq %edx, %rdx #1089.69 movslq %ecx, %rcx #1089.247 movslq %esi, %rsi #1089.465 @@ -714,22 +714,22 @@ __svml_expf4_ha_ex: movlhps %xmm12, %xmm4 #1089.929 shufps $238, %xmm12, %xmm1 #1089.973 movaps %xmm3, %xmm12 #1096.21 - movdqu 2432+__svml_sexp_ha_data_internal(%rip), %xmm5 #1083.20 + movdqu 2432+__jsvml_sexp_ha_data_internal(%rip), %xmm5 #1083.20 subps %xmm14, %xmm12 #1096.21 pand %xmm3, %xmm5 #1083.20 subps %xmm15, %xmm12 #1097.21 movaps %xmm12, %xmm2 #1098.22 mulps %xmm12, %xmm2 #1098.22 - mulps 2368+__svml_sexp_ha_data_internal(%rip), %xmm2 #1099.33 - movdqu 2048+__svml_sexp_ha_data_internal(%rip), %xmm13 #1093.25 + mulps 2368+__jsvml_sexp_ha_data_internal(%rip), %xmm2 #1099.33 + movdqu 2048+__jsvml_sexp_ha_data_internal(%rip), %xmm13 #1093.25 addps %xmm2, %xmm12 #1099.21 mulps %xmm4, %xmm12 #1100.37 paddd %xmm13, %xmm0 #1093.25 - pcmpgtd 2496+__svml_sexp_ha_data_internal(%rip), %xmm5 #1084.25 + pcmpgtd 2496+__jsvml_sexp_ha_data_internal(%rip), %xmm5 #1084.25 pslld $16, %xmm0 #1093.25 movmskps %xmm5, %eax #1085.48 addps %xmm12, %xmm1 #1100.25 - pand 2112+__svml_sexp_ha_data_internal(%rip), %xmm0 #1094.25 + pand 2112+__jsvml_sexp_ha_data_internal(%rip), %xmm0 #1094.25 addps %xmm1, %xmm4 #1101.22 mulps %xmm4, %xmm0 #1102.30 testl %eax, %eax #1103.52 @@ -747,10 +747,10 @@ __svml_expf4_ha_ex: # LOE ..B6.3: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq - movups 2560+__svml_sexp_ha_data_internal(%rip), %xmm6 #1114.62 + movups 2560+__jsvml_sexp_ha_data_internal(%rip), %xmm6 #1114.62 movaps %xmm3, %xmm5 #1117.27 movl $2139095040, %edx #1113.41 - cmpltps 2624+__svml_sexp_ha_data_internal(%rip), %xmm5 #1117.27 + cmpltps 2624+__jsvml_sexp_ha_data_internal(%rip), %xmm5 #1117.27 cmpltps %xmm3, %xmm6 #1115.27 movd %edx, %xmm1 #1113.41 movaps %xmm6, %xmm4 #1118.33 @@ -808,30 +808,30 @@ __svml_expf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1127.540 lea 128(%rsp,%r12,4), %rsi #1127.540 -..___tag_value___svml_expf4_ha_ex.108: -# __svml_sexp_ha_cout_rare_internal(const float *, float *) - call __svml_sexp_ha_cout_rare_internal #1127.540 -..___tag_value___svml_expf4_ha_ex.109: +..___tag_value___jsvml_expf4_ha_ex.108: +# __jsvml_sexp_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexp_ha_cout_rare_internal #1127.540 +..___tag_value___jsvml_expf4_ha_ex.109: jmp ..B6.9 # Prob 100% #1127.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expf4_ha_ex,@function - .size __svml_expf4_ha_ex,.-__svml_expf4_ha_ex -..LN__svml_expf4_ha_ex.5: + .type __jsvml_expf4_ha_ex,@function + .size __jsvml_expf4_ha_ex,.-__jsvml_expf4_ha_ex +..LN__jsvml_expf4_ha_ex.5: .data -# -- End __svml_expf4_ha_ex +# -- End __jsvml_expf4_ha_ex .text -.L_2__routine_start___svml_sexp_ha_cout_rare_internal_6: -# -- Begin __svml_sexp_ha_cout_rare_internal +.L_2__routine_start___jsvml_sexp_ha_cout_rare_internal_6: +# -- Begin __jsvml_sexp_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_sexp_ha_cout_rare_internal - .globl __svml_sexp_ha_cout_rare_internal -# --- __svml_sexp_ha_cout_rare_internal(const float *, float *) -__svml_sexp_ha_cout_rare_internal: + .hidden __jsvml_sexp_ha_cout_rare_internal + .globl __jsvml_sexp_ha_cout_rare_internal +# --- __jsvml_sexp_ha_cout_rare_internal(const float *, float *) +__jsvml_sexp_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -841,7 +841,7 @@ __svml_sexp_ha_cout_rare_internal: .byte 30 #680.19 .byte 250 #680.19 .cfi_startproc -..___tag_value___svml_sexp_ha_cout_rare_internal.111: +..___tag_value___jsvml_sexp_ha_cout_rare_internal.111: ..L112: #572.1 xorl %eax, %eax #580.14 @@ -1080,17 +1080,17 @@ __svml_sexp_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_sexp_ha_cout_rare_internal,@function - .size __svml_sexp_ha_cout_rare_internal,.-__svml_sexp_ha_cout_rare_internal -..LN__svml_sexp_ha_cout_rare_internal.6: + .type __jsvml_sexp_ha_cout_rare_internal,@function + .size __jsvml_sexp_ha_cout_rare_internal,.-__jsvml_sexp_ha_cout_rare_internal +..LN__jsvml_sexp_ha_cout_rare_internal.6: .data -# -- End __svml_sexp_ha_cout_rare_internal +# -- End __jsvml_sexp_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_sexp_ha_data_internal_avx512 - .globl __svml_sexp_ha_data_internal_avx512 -__svml_sexp_ha_data_internal_avx512: + .hidden __jsvml_sexp_ha_data_internal_avx512 + .globl __jsvml_sexp_ha_data_internal_avx512 +__jsvml_sexp_ha_data_internal_avx512: .long 0 .long 3007986186 .long 860277610 @@ -1331,12 +1331,12 @@ __svml_sexp_ha_data_internal_avx512: .long 124 .long 124 .long 124 - .type __svml_sexp_ha_data_internal_avx512,@object - .size __svml_sexp_ha_data_internal_avx512,960 + .type __jsvml_sexp_ha_data_internal_avx512,@object + .size __jsvml_sexp_ha_data_internal_avx512,960 .align 64 - .hidden __svml_sexp_ha_data_internal - .globl __svml_sexp_ha_data_internal -__svml_sexp_ha_data_internal: + .hidden __jsvml_sexp_ha_data_internal + .globl __jsvml_sexp_ha_data_internal +__jsvml_sexp_ha_data_internal: .long 1085844027 .long 1085844027 .long 1085844027 @@ -2009,8 +2009,8 @@ __svml_sexp_ha_data_internal: .long 3268407732 .long 3268407732 .long 3268407732 - .type __svml_sexp_ha_data_internal,@object - .size __svml_sexp_ha_data_internal,2688 + .type __jsvml_sexp_ha_data_internal,@object + .size __jsvml_sexp_ha_data_internal,2688 .align 32 .L_2il0floatpacket.38: .long 0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_expm1_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_expm1_linux_x86.S similarity index 89% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_expm1_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_expm1_linux_x86.S index cea89cda327..4a146e1aad6 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_expm1_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_expm1_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_expm1.c" .text ..TXTST0: -.L_2__routine_start___svml_expm1f4_ha_e9_0: -# -- Begin __svml_expm1f4_ha_e9 +.L_2__routine_start___jsvml_expm1f4_ha_e9_0: +# -- Begin __jsvml_expm1f4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm1f4_ha_e9 -# --- __svml_expm1f4_ha_e9(__m128) -__svml_expm1f4_ha_e9: + .globl __jsvml_expm1f4_ha_e9 +# --- __jsvml_expm1f4_ha_e9(__m128) +__jsvml_expm1f4_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_expm1f4_ha_e9: .byte 30 #636.540 .byte 250 #636.540 .cfi_startproc -..___tag_value___svml_expm1f4_ha_e9.1: +..___tag_value___jsvml_expm1f4_ha_e9.1: ..L2: #530.1 pushq %rbp #530.1 @@ -58,27 +58,27 @@ __svml_expm1f4_ha_e9: andq $-64, %rsp #530.1 subq $192, %rsp #530.1 movaps %xmm0, %xmm11 #530.1 - movups 768+__svml_sexpm1_ha_data_internal(%rip), %xmm5 #581.46 + movups 768+__jsvml_sexpm1_ha_data_internal(%rip), %xmm5 #581.46 movaps %xmm11, %xmm10 #586.14 mulps %xmm11, %xmm5 #582.12 - lea __svml_sexpm1_ha_data_internal(%rip), %r8 #602.61 - movups 832+__svml_sexpm1_ha_data_internal(%rip), %xmm12 #584.44 + lea __jsvml_sexpm1_ha_data_internal(%rip), %r8 #602.61 + movups 832+__jsvml_sexpm1_ha_data_internal(%rip), %xmm12 #584.44 roundps $0, %xmm5, %xmm5 #583.12 mulps %xmm5, %xmm12 #586.34 - movups 896+__svml_sexpm1_ha_data_internal(%rip), %xmm4 #587.14 + movups 896+__jsvml_sexpm1_ha_data_internal(%rip), %xmm4 #587.14 subps %xmm12, %xmm10 #586.14 mulps %xmm5, %xmm4 #587.14 - movups 960+__svml_sexpm1_ha_data_internal(%rip), %xmm14 #597.52 + movups 960+__jsvml_sexpm1_ha_data_internal(%rip), %xmm14 #597.52 movaps %xmm10, %xmm8 #589.20 - movups 1024+__svml_sexpm1_ha_data_internal(%rip), %xmm15 #601.22 + movups 1024+__jsvml_sexpm1_ha_data_internal(%rip), %xmm15 #601.22 movaps %xmm10, %xmm7 #588.12 cmpeqps %xmm11, %xmm8 #589.20 addps %xmm14, %xmm5 #598.16 subps %xmm4, %xmm7 #588.12 andps %xmm5, %xmm15 #601.22 movd %xmm15, %edx #602.175 - movups 1088+__svml_sexpm1_ha_data_internal(%rip), %xmm12 #603.24 - orps 1152+__svml_sexpm1_ha_data_internal(%rip), %xmm8 #614.19 + movups 1088+__jsvml_sexpm1_ha_data_internal(%rip), %xmm12 #603.24 + orps 1152+__jsvml_sexpm1_ha_data_internal(%rip), %xmm8 #614.19 andps %xmm12, %xmm5 #604.21 pextrd $1, %xmm15, %ecx #602.380 andps %xmm10, %xmm8 #615.13 @@ -104,12 +104,12 @@ __svml_expm1f4_ha_e9: mulps %xmm5, %xmm3 #608.13 movaps %xmm2, %xmm1 #618.15 mulps %xmm8, %xmm1 #618.15 - movups 512+__svml_sexpm1_ha_data_internal(%rip), %xmm5 #611.24 + movups 512+__jsvml_sexpm1_ha_data_internal(%rip), %xmm5 #611.24 mulps %xmm7, %xmm5 #611.24 mulps %xmm7, %xmm7 #612.13 - addps 576+__svml_sexpm1_ha_data_internal(%rip), %xmm5 #611.12 - movups 1280+__svml_sexpm1_ha_data_internal(%rip), %xmm6 #590.48 - movups 1216+__svml_sexpm1_ha_data_internal(%rip), %xmm4 #620.45 + addps 576+__jsvml_sexpm1_ha_data_internal(%rip), %xmm5 #611.12 + movups 1280+__jsvml_sexpm1_ha_data_internal(%rip), %xmm6 #590.48 + movups 1216+__jsvml_sexpm1_ha_data_internal(%rip), %xmm4 #620.45 movaps %xmm6, %xmm13 #592.13 movaps %xmm6, %xmm0 #621.160 andps %xmm11, %xmm13 #592.13 @@ -117,7 +117,7 @@ __svml_expm1f4_ha_e9: andps %xmm2, %xmm0 #621.160 andps %xmm4, %xmm6 #621.205 andnps %xmm11, %xmm9 #593.14 - cmpnleps 1344+__svml_sexpm1_ha_data_internal(%rip), %xmm13 #594.18 + cmpnleps 1344+__jsvml_sexpm1_ha_data_internal(%rip), %xmm13 #594.18 cmpleps %xmm6, %xmm0 #621.253 mulps %xmm7, %xmm5 #619.24 movmskps %xmm13, %eax #596.44 @@ -196,29 +196,29 @@ __svml_expm1f4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #636.540 lea 128(%rsp,%r12,4), %rsi #636.540 -..___tag_value___svml_expm1f4_ha_e9.19: -# __svml_sexpm1_ha_cout_rare_internal(const float *, float *) - call __svml_sexpm1_ha_cout_rare_internal #636.540 -..___tag_value___svml_expm1f4_ha_e9.20: +..___tag_value___jsvml_expm1f4_ha_e9.19: +# __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexpm1_ha_cout_rare_internal #636.540 +..___tag_value___jsvml_expm1f4_ha_e9.20: jmp ..B1.8 # Prob 100% #636.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm1f4_ha_e9,@function - .size __svml_expm1f4_ha_e9,.-__svml_expm1f4_ha_e9 -..LN__svml_expm1f4_ha_e9.0: + .type __jsvml_expm1f4_ha_e9,@function + .size __jsvml_expm1f4_ha_e9,.-__jsvml_expm1f4_ha_e9 +..LN__jsvml_expm1f4_ha_e9.0: .data -# -- End __svml_expm1f4_ha_e9 +# -- End __jsvml_expm1f4_ha_e9 .text -.L_2__routine_start___svml_expm1f4_ha_ex_1: -# -- Begin __svml_expm1f4_ha_ex +.L_2__routine_start___jsvml_expm1f4_ha_ex_1: +# -- Begin __jsvml_expm1f4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_expm1f4_ha_ex -# --- __svml_expm1f4_ha_ex(__m128) -__svml_expm1f4_ha_ex: + .globl __jsvml_expm1f4_ha_ex +# --- __jsvml_expm1f4_ha_ex(__m128) +__jsvml_expm1f4_ha_ex: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -227,7 +227,7 @@ __svml_expm1f4_ha_ex: .byte 30 #750.540 .byte 250 #750.540 .cfi_startproc -..___tag_value___svml_expm1f4_ha_ex.22: +..___tag_value___jsvml_expm1f4_ha_ex.22: ..L23: #644.1 pushq %rbp #644.1 @@ -238,22 +238,22 @@ __svml_expm1f4_ha_ex: andq $-64, %rsp #644.1 subq $192, %rsp #644.1 movaps %xmm0, %xmm10 #644.1 - movups 768+__svml_sexpm1_ha_data_internal(%rip), %xmm14 #696.12 + movups 768+__jsvml_sexpm1_ha_data_internal(%rip), %xmm14 #696.12 movaps %xmm10, %xmm9 #700.14 mulps %xmm10, %xmm14 #696.12 - lea __svml_sexpm1_ha_data_internal(%rip), %r8 #716.61 + lea __jsvml_sexpm1_ha_data_internal(%rip), %r8 #716.61 movups .L_2il0floatpacket.29(%rip), %xmm11 #697.105 - movups 960+__svml_sexpm1_ha_data_internal(%rip), %xmm0 #712.16 + movups 960+__jsvml_sexpm1_ha_data_internal(%rip), %xmm0 #712.16 addps %xmm11, %xmm14 #697.162 - movups 832+__svml_sexpm1_ha_data_internal(%rip), %xmm12 #698.44 + movups 832+__jsvml_sexpm1_ha_data_internal(%rip), %xmm12 #698.44 subps %xmm11, %xmm14 #697.207 - movdqu 1024+__svml_sexpm1_ha_data_internal(%rip), %xmm1 #715.16 + movdqu 1024+__jsvml_sexpm1_ha_data_internal(%rip), %xmm1 #715.16 addps %xmm14, %xmm0 #712.16 mulps %xmm14, %xmm12 #700.34 pand %xmm0, %xmm1 #715.16 subps %xmm12, %xmm9 #700.14 movd %xmm1, %edx #716.175 - movups 1280+__svml_sexpm1_ha_data_internal(%rip), %xmm6 #704.48 + movups 1280+__jsvml_sexpm1_ha_data_internal(%rip), %xmm6 #704.48 movaps %xmm9, %xmm7 #702.12 pshufd $1, %xmm1, %xmm15 #716.396 movaps %xmm6, %xmm13 #706.13 @@ -266,9 +266,9 @@ __svml_expm1f4_ha_ex: movd %xmm2, %esi #716.621 andnps %xmm10, %xmm8 #707.14 movd %xmm11, %edi #716.864 - movups 896+__svml_sexpm1_ha_data_internal(%rip), %xmm4 #701.14 - movdqu 1088+__svml_sexpm1_ha_data_internal(%rip), %xmm15 #718.15 - cmpnleps 1344+__svml_sexpm1_ha_data_internal(%rip), %xmm13 #708.18 + movups 896+__jsvml_sexpm1_ha_data_internal(%rip), %xmm4 #701.14 + movdqu 1088+__jsvml_sexpm1_ha_data_internal(%rip), %xmm15 #718.15 + cmpnleps 1344+__jsvml_sexpm1_ha_data_internal(%rip), %xmm13 #708.18 cmpeqps %xmm10, %xmm5 #703.20 mulps %xmm14, %xmm4 #701.14 movmskps %xmm13, %eax #710.44 @@ -291,13 +291,13 @@ __svml_expm1f4_ha_ex: orps %xmm0, %xmm2 #721.13 mulps %xmm0, %xmm3 #722.13 movaps %xmm2, %xmm1 #732.15 - movups 512+__svml_sexpm1_ha_data_internal(%rip), %xmm0 #725.24 + movups 512+__jsvml_sexpm1_ha_data_internal(%rip), %xmm0 #725.24 mulps %xmm7, %xmm0 #725.24 mulps %xmm7, %xmm7 #726.13 - addps 576+__svml_sexpm1_ha_data_internal(%rip), %xmm0 #725.12 - orps 1152+__svml_sexpm1_ha_data_internal(%rip), %xmm5 #728.19 + addps 576+__jsvml_sexpm1_ha_data_internal(%rip), %xmm0 #725.12 + orps 1152+__jsvml_sexpm1_ha_data_internal(%rip), %xmm5 #728.19 andps %xmm9, %xmm5 #729.13 - movups 1216+__svml_sexpm1_ha_data_internal(%rip), %xmm11 #734.45 + movups 1216+__jsvml_sexpm1_ha_data_internal(%rip), %xmm11 #734.45 subps %xmm5, %xmm9 #730.13 mulps %xmm7, %xmm0 #733.24 mulps %xmm5, %xmm1 #732.15 @@ -386,29 +386,29 @@ __svml_expm1f4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #750.540 lea 128(%rsp,%r12,4), %rsi #750.540 -..___tag_value___svml_expm1f4_ha_ex.40: -# __svml_sexpm1_ha_cout_rare_internal(const float *, float *) - call __svml_sexpm1_ha_cout_rare_internal #750.540 -..___tag_value___svml_expm1f4_ha_ex.41: +..___tag_value___jsvml_expm1f4_ha_ex.40: +# __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexpm1_ha_cout_rare_internal #750.540 +..___tag_value___jsvml_expm1f4_ha_ex.41: jmp ..B2.8 # Prob 100% #750.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm1f4_ha_ex,@function - .size __svml_expm1f4_ha_ex,.-__svml_expm1f4_ha_ex -..LN__svml_expm1f4_ha_ex.1: + .type __jsvml_expm1f4_ha_ex,@function + .size __jsvml_expm1f4_ha_ex,.-__jsvml_expm1f4_ha_ex +..LN__jsvml_expm1f4_ha_ex.1: .data -# -- End __svml_expm1f4_ha_ex +# -- End __jsvml_expm1f4_ha_ex .text -.L_2__routine_start___svml_expm1f8_ha_l9_2: -# -- Begin __svml_expm1f8_ha_l9 +.L_2__routine_start___jsvml_expm1f8_ha_l9_2: +# -- Begin __jsvml_expm1f8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm1f8_ha_l9 -# --- __svml_expm1f8_ha_l9(__m256) -__svml_expm1f8_ha_l9: + .globl __jsvml_expm1f8_ha_l9 +# --- __jsvml_expm1f8_ha_l9(__m256) +__jsvml_expm1f8_ha_l9: # parameter 1: %ymm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -417,7 +417,7 @@ __svml_expm1f8_ha_l9: .byte 30 #864.546 .byte 250 #864.546 .cfi_startproc -..___tag_value___svml_expm1f8_ha_l9.43: +..___tag_value___jsvml_expm1f8_ha_l9.43: ..L44: #758.1 pushq %rbp #758.1 @@ -427,24 +427,24 @@ __svml_expm1f8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #758.1 subq $192, %rsp #758.1 - lea __svml_sexpm1_ha_data_internal(%rip), %rax #830.64 + lea __jsvml_sexpm1_ha_data_internal(%rip), %rax #830.64 vmovaps %ymm0, %ymm13 #758.1 - vmulps 768+__svml_sexpm1_ha_data_internal(%rip), %ymm13, %ymm12 #810.12 - vmovups 1280+__svml_sexpm1_ha_data_internal(%rip), %ymm11 #818.51 - vmovups 832+__svml_sexpm1_ha_data_internal(%rip), %ymm10 #814.14 + vmulps 768+__jsvml_sexpm1_ha_data_internal(%rip), %ymm13, %ymm12 #810.12 + vmovups 1280+__jsvml_sexpm1_ha_data_internal(%rip), %ymm11 #818.51 + vmovups 832+__jsvml_sexpm1_ha_data_internal(%rip), %ymm10 #814.14 vroundps $0, %ymm12, %ymm5 #811.12 - vaddps 960+__svml_sexpm1_ha_data_internal(%rip), %ymm5, %ymm2 #826.16 + vaddps 960+__jsvml_sexpm1_ha_data_internal(%rip), %ymm5, %ymm2 #826.16 vfnmadd213ps %ymm13, %ymm5, %ymm10 #814.14 - vmulps 896+__svml_sexpm1_ha_data_internal(%rip), %ymm5, %ymm9 #815.14 + vmulps 896+__jsvml_sexpm1_ha_data_internal(%rip), %ymm5, %ymm9 #815.14 vcmpeqps %ymm13, %ymm10, %ymm7 #817.20 vsubps %ymm9, %ymm10, %ymm8 #816.12 - vandps 1024+__svml_sexpm1_ha_data_internal(%rip), %ymm2, %ymm6 #829.18 + vandps 1024+__jsvml_sexpm1_ha_data_internal(%rip), %ymm2, %ymm6 #829.18 vandps %ymm11, %ymm13, %ymm1 #820.13 - vcmpnle_uqps 1344+__svml_sexpm1_ha_data_internal(%rip), %ymm1, %ymm3 #822.18 - vandps 1088+__svml_sexpm1_ha_data_internal(%rip), %ymm2, %ymm2 #832.17 + vcmpnle_uqps 1344+__jsvml_sexpm1_ha_data_internal(%rip), %ymm1, %ymm3 #822.18 + vandps 1088+__jsvml_sexpm1_ha_data_internal(%rip), %ymm2, %ymm2 #832.17 vmovmskps %ymm3, %edx #824.45 vpslld $14, %ymm2, %ymm2 #833.17 - vorps 1152+__svml_sexpm1_ha_data_internal(%rip), %ymm7, %ymm7 #842.19 + vorps 1152+__jsvml_sexpm1_ha_data_internal(%rip), %ymm7, %ymm7 #842.19 vandnps %ymm13, %ymm11, %ymm12 #821.14 vmovd %xmm6, %ecx #830.178 vpextrd $1, %xmm6, %esi #830.414 @@ -481,9 +481,9 @@ __svml_expm1f8_ha_l9: vunpckhps %ymm3, %ymm1, %ymm4 #830.2455 vorps %ymm2, %ymm5, %ymm6 #835.13 vmulps %ymm2, %ymm4, %ymm4 #836.13 - vmovups 512+__svml_sexpm1_ha_data_internal(%rip), %ymm2 #839.12 - vmovups 1216+__svml_sexpm1_ha_data_internal(%rip), %ymm1 #848.48 - vfmadd213ps 576+__svml_sexpm1_ha_data_internal(%rip), %ymm8, %ymm2 #839.12 + vmovups 512+__jsvml_sexpm1_ha_data_internal(%rip), %ymm2 #839.12 + vmovups 1216+__jsvml_sexpm1_ha_data_internal(%rip), %ymm1 #848.48 + vfmadd213ps 576+__jsvml_sexpm1_ha_data_internal(%rip), %ymm8, %ymm2 #839.12 vmulps %ymm8, %ymm8, %ymm8 #840.13 vandps %ymm7, %ymm10, %ymm15 #843.13 vsubps %ymm15, %ymm10, %ymm10 #844.13 @@ -567,29 +567,29 @@ __svml_expm1f8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #864.546 lea 128(%rsp,%r12,4), %rsi #864.546 -..___tag_value___svml_expm1f8_ha_l9.61: -# __svml_sexpm1_ha_cout_rare_internal(const float *, float *) - call __svml_sexpm1_ha_cout_rare_internal #864.546 -..___tag_value___svml_expm1f8_ha_l9.62: +..___tag_value___jsvml_expm1f8_ha_l9.61: +# __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexpm1_ha_cout_rare_internal #864.546 +..___tag_value___jsvml_expm1f8_ha_l9.62: jmp ..B3.8 # Prob 100% #864.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm1f8_ha_l9,@function - .size __svml_expm1f8_ha_l9,.-__svml_expm1f8_ha_l9 -..LN__svml_expm1f8_ha_l9.2: + .type __jsvml_expm1f8_ha_l9,@function + .size __jsvml_expm1f8_ha_l9,.-__jsvml_expm1f8_ha_l9 +..LN__jsvml_expm1f8_ha_l9.2: .data -# -- End __svml_expm1f8_ha_l9 +# -- End __jsvml_expm1f8_ha_l9 .text -.L_2__routine_start___svml_expm1f16_ha_z0_3: -# -- Begin __svml_expm1f16_ha_z0 +.L_2__routine_start___jsvml_expm1f16_ha_z0_3: +# -- Begin __jsvml_expm1f16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_expm1f16_ha_z0 -# --- __svml_expm1f16_ha_z0(__m512) -__svml_expm1f16_ha_z0: + .globl __jsvml_expm1f16_ha_z0 +# --- __jsvml_expm1f16_ha_z0(__m512) +__jsvml_expm1f16_ha_z0: # parameter 1: %zmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -598,7 +598,7 @@ __svml_expm1f16_ha_z0: .byte 30 #969.760 .byte 250 #969.760 .cfi_startproc -..___tag_value___svml_expm1f16_ha_z0.64: +..___tag_value___jsvml_expm1f16_ha_z0.64: ..L65: #872.1 pushq %rbp #872.1 @@ -608,23 +608,23 @@ __svml_expm1f16_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #872.1 subq $192, %rsp #872.1 - vmovups 128+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm9 #920.53 - vmovups 192+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm8 #921.57 - vmovups 384+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm10 #929.53 - vmovups 448+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm11 #930.53 - vmovups 512+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm13 #938.56 - vmovups 256+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm7 #923.59 + vmovups 128+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm9 #920.53 + vmovups 192+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm8 #921.57 + vmovups 384+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm10 #929.53 + vmovups 448+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm11 #930.53 + vmovups 512+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm13 #938.56 + vmovups 256+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm7 #923.59 vmovaps %zmm0, %zmm6 #872.1 vfmadd213ps {rn-sae}, %zmm8, %zmm6, %zmm9 #922.24 - vmovups 576+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm0 #941.55 + vmovups 576+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm0 #941.55 vcmpps $21, {sae}, %zmm7, %zmm6, %k0 #924.27 - vmovups 640+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm7 #944.61 + vmovups 640+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm7 #944.61 vsubps {rn-sae}, %zmm8, %zmm9, %zmm12 #928.22 - vpermps __svml_sexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm14 #934.154 - vpermps 64+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm4 #935.155 - vandps 320+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm6, %zmm5 #927.21 + vpermps __jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm14 #934.154 + vpermps 64+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm9, %zmm4 #935.155 + vandps 320+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm6, %zmm5 #927.21 vfnmadd213ps {rn-sae}, %zmm6, %zmm12, %zmm10 #931.21 - vmovups 768+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm8 #946.61 + vmovups 768+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm8 #946.61 vmaxps {sae}, %zmm13, %zmm12, %zmm15 #939.22 kmovw %k0, %esi #925.48 vscalefps {rn-sae}, %zmm15, %zmm14, %zmm3 #940.20 @@ -633,10 +633,10 @@ __svml_expm1f16_ha_z0: vsubps {rn-sae}, %zmm2, %zmm10, %zmm1 #936.23 vandps %zmm0, %zmm2, %zmm2 #942.19 vfnmadd231ps {rn-sae}, %zmm12, %zmm11, %zmm1 #937.20 - vmovups 832+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm11 #952.53 - vmovups 896+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm12 #953.54 + vmovups 832+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm11 #952.53 + vmovups 896+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm12 #953.54 vandps %zmm0, %zmm1, %zmm9 #943.20 - vmovups 704+__svml_sexpm1_ha_data_internal_avx512(%rip), %zmm1 #947.21 + vmovups 704+__jsvml_sexpm1_ha_data_internal_avx512(%rip), %zmm1 #947.21 vmulps {rn-sae}, %zmm2, %zmm2, %zmm0 #948.22 vcmpps $17, {sae}, %zmm11, %zmm3, %k1 #954.25 vfmadd231ps {rn-sae}, %zmm2, %zmm7, %zmm1 #947.21 @@ -766,29 +766,29 @@ __svml_expm1f16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #969.760 lea 128(%rsp,%rbx,4), %rsi #969.760 -..___tag_value___svml_expm1f16_ha_z0.92: -# __svml_sexpm1_ha_cout_rare_internal(const float *, float *) - call __svml_sexpm1_ha_cout_rare_internal #969.760 -..___tag_value___svml_expm1f16_ha_z0.93: +..___tag_value___jsvml_expm1f16_ha_z0.92: +# __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexpm1_ha_cout_rare_internal #969.760 +..___tag_value___jsvml_expm1f16_ha_z0.93: jmp ..B4.13 # Prob 100% #969.760 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_expm1f16_ha_z0,@function - .size __svml_expm1f16_ha_z0,.-__svml_expm1f16_ha_z0 -..LN__svml_expm1f16_ha_z0.3: + .type __jsvml_expm1f16_ha_z0,@function + .size __jsvml_expm1f16_ha_z0,.-__jsvml_expm1f16_ha_z0 +..LN__jsvml_expm1f16_ha_z0.3: .data -# -- End __svml_expm1f16_ha_z0 +# -- End __jsvml_expm1f16_ha_z0 .text -.L_2__routine_start___svml_expm1f4_ha_l9_4: -# -- Begin __svml_expm1f4_ha_l9 +.L_2__routine_start___jsvml_expm1f4_ha_l9_4: +# -- Begin __jsvml_expm1f4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm1f4_ha_l9 -# --- __svml_expm1f4_ha_l9(__m128) -__svml_expm1f4_ha_l9: + .globl __jsvml_expm1f4_ha_l9 +# --- __jsvml_expm1f4_ha_l9(__m128) +__jsvml_expm1f4_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -797,7 +797,7 @@ __svml_expm1f4_ha_l9: .byte 30 #1083.540 .byte 250 #1083.540 .cfi_startproc -..___tag_value___svml_expm1f4_ha_l9.95: +..___tag_value___jsvml_expm1f4_ha_l9.95: ..L96: #977.1 pushq %rbp #977.1 @@ -808,24 +808,24 @@ __svml_expm1f4_ha_l9: andq $-64, %rsp #977.1 subq $192, %rsp #977.1 vmovaps %xmm0, %xmm13 #977.1 - vmulps 768+__svml_sexpm1_ha_data_internal(%rip), %xmm13, %xmm14 #1029.12 - lea __svml_sexpm1_ha_data_internal(%rip), %r8 #1049.61 + vmulps 768+__jsvml_sexpm1_ha_data_internal(%rip), %xmm13, %xmm14 #1029.12 + lea __jsvml_sexpm1_ha_data_internal(%rip), %r8 #1049.61 vroundps $0, %xmm14, %xmm14 #1030.12 - vmovups 832+__svml_sexpm1_ha_data_internal(%rip), %xmm10 #1033.14 + vmovups 832+__jsvml_sexpm1_ha_data_internal(%rip), %xmm10 #1033.14 vfnmadd213ps %xmm13, %xmm14, %xmm10 #1033.14 - vmovups 1280+__svml_sexpm1_ha_data_internal(%rip), %xmm11 #1037.48 + vmovups 1280+__jsvml_sexpm1_ha_data_internal(%rip), %xmm11 #1037.48 vandps %xmm11, %xmm13, %xmm15 #1039.13 vandnps %xmm13, %xmm11, %xmm12 #1040.14 - vcmpnleps 1344+__svml_sexpm1_ha_data_internal(%rip), %xmm15, %xmm5 #1041.18 - vmulps 896+__svml_sexpm1_ha_data_internal(%rip), %xmm14, %xmm9 #1034.14 - vaddps 960+__svml_sexpm1_ha_data_internal(%rip), %xmm14, %xmm6 #1045.16 + vcmpnleps 1344+__jsvml_sexpm1_ha_data_internal(%rip), %xmm15, %xmm5 #1041.18 + vmulps 896+__jsvml_sexpm1_ha_data_internal(%rip), %xmm14, %xmm9 #1034.14 + vaddps 960+__jsvml_sexpm1_ha_data_internal(%rip), %xmm14, %xmm6 #1045.16 vcmpeqps %xmm13, %xmm10, %xmm7 #1036.20 vsubps %xmm9, %xmm10, %xmm8 #1035.12 vmovmskps %xmm5, %eax #1043.44 - vandps 1024+__svml_sexpm1_ha_data_internal(%rip), %xmm6, %xmm3 #1048.18 + vandps 1024+__jsvml_sexpm1_ha_data_internal(%rip), %xmm6, %xmm3 #1048.18 vmovd %xmm3, %edx #1049.175 - vandps 1088+__svml_sexpm1_ha_data_internal(%rip), %xmm6, %xmm6 #1051.17 - vorps 1152+__svml_sexpm1_ha_data_internal(%rip), %xmm7, %xmm7 #1061.19 + vandps 1088+__jsvml_sexpm1_ha_data_internal(%rip), %xmm6, %xmm6 #1051.17 + vorps 1152+__jsvml_sexpm1_ha_data_internal(%rip), %xmm7, %xmm7 #1061.19 vpextrd $1, %xmm3, %ecx #1049.380 vpextrd $2, %xmm3, %esi #1049.588 vpextrd $3, %xmm3, %edi #1049.796 @@ -848,13 +848,13 @@ __svml_expm1f4_ha_l9: vsubps %xmm2, %xmm10, %xmm10 #1063.13 vmulps %xmm2, %xmm5, %xmm1 #1065.15 vsubps %xmm9, %xmm10, %xmm9 #1064.13 - vmovups 1216+__svml_sexpm1_ha_data_internal(%rip), %xmm6 #1067.45 + vmovups 1216+__jsvml_sexpm1_ha_data_internal(%rip), %xmm6 #1067.45 vandps %xmm11, %xmm5, %xmm0 #1068.160 vandps %xmm11, %xmm6, %xmm11 #1068.205 vmovaps %xmm5, %xmm7 #1068.297 - vmovups 512+__svml_sexpm1_ha_data_internal(%rip), %xmm4 #1058.12 + vmovups 512+__jsvml_sexpm1_ha_data_internal(%rip), %xmm4 #1058.12 vcmpleps %xmm11, %xmm0, %xmm0 #1068.253 - vfmadd213ps 576+__svml_sexpm1_ha_data_internal(%rip), %xmm8, %xmm4 #1058.12 + vfmadd213ps 576+__jsvml_sexpm1_ha_data_internal(%rip), %xmm8, %xmm4 #1058.12 vaddps %xmm6, %xmm5, %xmm11 #1069.14 vmulps %xmm8, %xmm8, %xmm8 #1059.13 vfmadd213ps %xmm9, %xmm8, %xmm4 #1066.12 @@ -928,29 +928,29 @@ __svml_expm1f4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1083.540 lea 128(%rsp,%r12,4), %rsi #1083.540 -..___tag_value___svml_expm1f4_ha_l9.113: -# __svml_sexpm1_ha_cout_rare_internal(const float *, float *) - call __svml_sexpm1_ha_cout_rare_internal #1083.540 -..___tag_value___svml_expm1f4_ha_l9.114: +..___tag_value___jsvml_expm1f4_ha_l9.113: +# __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexpm1_ha_cout_rare_internal #1083.540 +..___tag_value___jsvml_expm1f4_ha_l9.114: jmp ..B5.8 # Prob 100% #1083.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm1f4_ha_l9,@function - .size __svml_expm1f4_ha_l9,.-__svml_expm1f4_ha_l9 -..LN__svml_expm1f4_ha_l9.4: + .type __jsvml_expm1f4_ha_l9,@function + .size __jsvml_expm1f4_ha_l9,.-__jsvml_expm1f4_ha_l9 +..LN__jsvml_expm1f4_ha_l9.4: .data -# -- End __svml_expm1f4_ha_l9 +# -- End __jsvml_expm1f4_ha_l9 .text -.L_2__routine_start___svml_expm1f8_ha_e9_5: -# -- Begin __svml_expm1f8_ha_e9 +.L_2__routine_start___jsvml_expm1f8_ha_e9_5: +# -- Begin __jsvml_expm1f8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_expm1f8_ha_e9 -# --- __svml_expm1f8_ha_e9(__m256) -__svml_expm1f8_ha_e9: + .globl __jsvml_expm1f8_ha_e9 +# --- __jsvml_expm1f8_ha_e9(__m256) +__jsvml_expm1f8_ha_e9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -959,7 +959,7 @@ __svml_expm1f8_ha_e9: .byte 30 #1197.546 .byte 250 #1197.546 .cfi_startproc -..___tag_value___svml_expm1f8_ha_e9.116: +..___tag_value___jsvml_expm1f8_ha_e9.116: ..L117: #1091.1 pushq %rbp #1091.1 @@ -969,22 +969,22 @@ __svml_expm1f8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1091.1 subq $192, %rsp #1091.1 - lea __svml_sexpm1_ha_data_internal(%rip), %rax #1163.42 - vmovups 1280+__svml_sexpm1_ha_data_internal(%rip), %ymm14 #1151.51 + lea __jsvml_sexpm1_ha_data_internal(%rip), %rax #1163.42 + vmovups 1280+__jsvml_sexpm1_ha_data_internal(%rip), %ymm14 #1151.51 vpxor %xmm9, %xmm9, %xmm9 #1157.62 - vmulps 768+__svml_sexpm1_ha_data_internal(%rip), %ymm0, %ymm15 #1143.12 - vmovups 1024+__svml_sexpm1_ha_data_internal(%rip), %xmm7 #1161.26 + vmulps 768+__jsvml_sexpm1_ha_data_internal(%rip), %ymm0, %ymm15 #1143.12 + vmovups 1024+__jsvml_sexpm1_ha_data_internal(%rip), %xmm7 #1161.26 vmovups %ymm0, (%rsp) #1091.1[spill] vroundps $0, %ymm15, %ymm6 #1144.12 vandps %ymm14, %ymm0, %ymm1 #1153.13 - vcmpnle_uqps 1344+__svml_sexpm1_ha_data_internal(%rip), %ymm1, %ymm3 #1155.18 - vmulps 832+__svml_sexpm1_ha_data_internal(%rip), %ymm6, %ymm11 #1147.37 - vmulps 896+__svml_sexpm1_ha_data_internal(%rip), %ymm6, %ymm13 #1148.14 + vcmpnle_uqps 1344+__jsvml_sexpm1_ha_data_internal(%rip), %ymm1, %ymm3 #1155.18 + vmulps 832+__jsvml_sexpm1_ha_data_internal(%rip), %ymm6, %ymm11 #1147.37 + vmulps 896+__jsvml_sexpm1_ha_data_internal(%rip), %ymm6, %ymm13 #1148.14 vsubps %ymm11, %ymm0, %ymm12 #1147.14 vcmpeqps %ymm0, %ymm12, %ymm10 #1150.20 vsubps %ymm13, %ymm12, %ymm11 #1149.12 vandnps %ymm0, %ymm14, %ymm15 #1154.14 - vorps 1152+__svml_sexpm1_ha_data_internal(%rip), %ymm10, %ymm10 #1175.19 + vorps 1152+__jsvml_sexpm1_ha_data_internal(%rip), %ymm10, %ymm10 #1175.19 vandps %ymm10, %ymm12, %ymm10 #1176.13 vsubps %ymm10, %ymm12, %ymm12 #1177.13 vsubps %ymm13, %ymm12, %ymm13 #1178.13 @@ -992,7 +992,7 @@ __svml_expm1f8_ha_e9: vpackssdw %xmm4, %xmm3, %xmm5 #1157.79 vpacksswb %xmm9, %xmm5, %xmm8 #1157.62 vpmovmskb %xmm8, %edx #1157.43 - vaddps 960+__svml_sexpm1_ha_data_internal(%rip), %ymm6, %ymm8 #1159.16 + vaddps 960+__jsvml_sexpm1_ha_data_internal(%rip), %ymm6, %ymm8 #1159.16 vandps %xmm7, %xmm8, %xmm3 #1162.22 vmovd %xmm3, %ecx #1163.156 vextractf128 $1, %ymm8, %xmm9 #1160.115 @@ -1026,8 +1026,8 @@ __svml_expm1f8_ha_e9: vunpcklps %xmm6, %xmm7, %xmm4 #1163.1747 vinsertf128 $1, %xmm1, %ymm0, %ymm5 #1163.1810 vinsertf128 $1, %xmm4, %ymm2, %ymm7 #1163.1918 - vmovups 1088+__svml_sexpm1_ha_data_internal(%rip), %xmm1 #1164.24 - vmulps 512+__svml_sexpm1_ha_data_internal(%rip), %ymm11, %ymm4 #1172.27 + vmovups 1088+__jsvml_sexpm1_ha_data_internal(%rip), %xmm1 #1164.24 + vmulps 512+__jsvml_sexpm1_ha_data_internal(%rip), %ymm11, %ymm4 #1172.27 vandps %xmm1, %xmm8, %xmm8 #1165.21 vandps %xmm1, %xmm9, %xmm9 #1165.89 vpslld $14, %xmm8, %xmm0 #1166.21 @@ -1035,9 +1035,9 @@ __svml_expm1f8_ha_e9: vmulps %ymm11, %ymm11, %ymm11 #1173.13 vunpcklps %ymm7, %ymm5, %ymm6 #1163.2009 vunpckhps %ymm7, %ymm5, %ymm7 #1163.2083 - vaddps 576+__svml_sexpm1_ha_data_internal(%rip), %ymm4, %ymm5 #1172.12 + vaddps 576+__jsvml_sexpm1_ha_data_internal(%rip), %ymm4, %ymm5 #1172.12 vinsertf128 $1, %xmm2, %ymm0, %ymm3 #1167.16 - vmovups 1216+__svml_sexpm1_ha_data_internal(%rip), %ymm2 #1181.48 + vmovups 1216+__jsvml_sexpm1_ha_data_internal(%rip), %ymm2 #1181.48 vmulps %ymm11, %ymm5, %ymm0 #1180.27 vmulps %ymm3, %ymm7, %ymm9 #1169.13 vaddps %ymm0, %ymm13, %ymm13 #1180.12 @@ -1124,30 +1124,30 @@ __svml_expm1f8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1197.546 lea 128(%rsp,%r12,4), %rsi #1197.546 -..___tag_value___svml_expm1f8_ha_e9.136: -# __svml_sexpm1_ha_cout_rare_internal(const float *, float *) - call __svml_sexpm1_ha_cout_rare_internal #1197.546 -..___tag_value___svml_expm1f8_ha_e9.137: +..___tag_value___jsvml_expm1f8_ha_e9.136: +# __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) + call __jsvml_sexpm1_ha_cout_rare_internal #1197.546 +..___tag_value___jsvml_expm1f8_ha_e9.137: jmp ..B6.8 # Prob 100% #1197.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_expm1f8_ha_e9,@function - .size __svml_expm1f8_ha_e9,.-__svml_expm1f8_ha_e9 -..LN__svml_expm1f8_ha_e9.5: + .type __jsvml_expm1f8_ha_e9,@function + .size __jsvml_expm1f8_ha_e9,.-__jsvml_expm1f8_ha_e9 +..LN__jsvml_expm1f8_ha_e9.5: .data -# -- End __svml_expm1f8_ha_e9 +# -- End __jsvml_expm1f8_ha_e9 .text -.L_2__routine_start___svml_sexpm1_ha_cout_rare_internal_6: -# -- Begin __svml_sexpm1_ha_cout_rare_internal +.L_2__routine_start___jsvml_sexpm1_ha_cout_rare_internal_6: +# -- Begin __jsvml_sexpm1_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_sexpm1_ha_cout_rare_internal - .globl __svml_sexpm1_ha_cout_rare_internal -# --- __svml_sexpm1_ha_cout_rare_internal(const float *, float *) -__svml_sexpm1_ha_cout_rare_internal: + .hidden __jsvml_sexpm1_ha_cout_rare_internal + .globl __jsvml_sexpm1_ha_cout_rare_internal +# --- __jsvml_sexpm1_ha_cout_rare_internal(const float *, float *) +__jsvml_sexpm1_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1157,7 +1157,7 @@ __svml_sexpm1_ha_cout_rare_internal: .byte 30 #503.19 .byte 250 #503.19 .cfi_startproc -..___tag_value___svml_sexpm1_ha_cout_rare_internal.139: +..___tag_value___jsvml_sexpm1_ha_cout_rare_internal.139: ..L140: #394.1 xorl %eax, %eax #402.14 @@ -1406,17 +1406,17 @@ __svml_sexpm1_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_sexpm1_ha_cout_rare_internal,@function - .size __svml_sexpm1_ha_cout_rare_internal,.-__svml_sexpm1_ha_cout_rare_internal -..LN__svml_sexpm1_ha_cout_rare_internal.6: + .type __jsvml_sexpm1_ha_cout_rare_internal,@function + .size __jsvml_sexpm1_ha_cout_rare_internal,.-__jsvml_sexpm1_ha_cout_rare_internal +..LN__jsvml_sexpm1_ha_cout_rare_internal.6: .data -# -- End __svml_sexpm1_ha_cout_rare_internal +# -- End __jsvml_sexpm1_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_sexpm1_ha_data_internal_avx512 - .globl __svml_sexpm1_ha_data_internal_avx512 -__svml_sexpm1_ha_data_internal_avx512: + .hidden __jsvml_sexpm1_ha_data_internal_avx512 + .globl __jsvml_sexpm1_ha_data_internal_avx512 +__jsvml_sexpm1_ha_data_internal_avx512: .long 1065353216 .long 1065724611 .long 1066112450 @@ -1657,12 +1657,12 @@ __svml_sexpm1_ha_data_internal_avx512: .long 3212836864 .long 3212836864 .long 3212836864 - .type __svml_sexpm1_ha_data_internal_avx512,@object - .size __svml_sexpm1_ha_data_internal_avx512,960 + .type __jsvml_sexpm1_ha_data_internal_avx512,@object + .size __jsvml_sexpm1_ha_data_internal_avx512,960 .align 64 - .hidden __svml_sexpm1_ha_data_internal - .globl __svml_sexpm1_ha_data_internal -__svml_sexpm1_ha_data_internal: + .hidden __jsvml_sexpm1_ha_data_internal + .globl __jsvml_sexpm1_ha_data_internal +__jsvml_sexpm1_ha_data_internal: .long 0 .long 0 .long 90112 @@ -2095,8 +2095,8 @@ __svml_sexpm1_ha_data_internal: .long 32640 .long 32640 .long 32640 - .type __svml_sexpm1_ha_data_internal,@object - .size __svml_sexpm1_ha_data_internal,1728 + .type __jsvml_sexpm1_ha_data_internal,@object + .size __jsvml_sexpm1_ha_data_internal,1728 .align 32 _vmldExpHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_hypot_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_hypot_linux_x86.S similarity index 92% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_hypot_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_hypot_linux_x86.S index a05bf8bef92..b89d0ba30b4 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_hypot_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_hypot_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_hypot.c" .text ..TXTST0: -.L_2__routine_start___svml_hypotf8_ha_l9_0: -# -- Begin __svml_hypotf8_ha_l9 +.L_2__routine_start___jsvml_hypotf8_ha_l9_0: +# -- Begin __jsvml_hypotf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypotf8_ha_l9 -# --- __svml_hypotf8_ha_l9(__m256, __m256) -__svml_hypotf8_ha_l9: + .globl __jsvml_hypotf8_ha_l9 +# --- __jsvml_hypotf8_ha_l9(__m256, __m256) +__jsvml_hypotf8_ha_l9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B1.1: # Preds ..B1.0 @@ -48,7 +48,7 @@ __svml_hypotf8_ha_l9: .byte 30 #200.663 .byte 250 #200.663 .cfi_startproc -..___tag_value___svml_hypotf8_ha_l9.1: +..___tag_value___jsvml_hypotf8_ha_l9.1: ..L2: #109.1 pushq %rbp #109.1 @@ -58,9 +58,9 @@ __svml_hypotf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #109.1 subq $256, %rsp #109.1 - vmovups 128+__svml_shypot_ha_data_internal(%rip), %ymm5 #140.53 - vmovups __svml_shypot_ha_data_internal(%rip), %ymm10 #139.54 - vmovups 192+__svml_shypot_ha_data_internal(%rip), %ymm3 #141.49 + vmovups 128+__jsvml_shypot_ha_data_internal(%rip), %ymm5 #140.53 + vmovups __jsvml_shypot_ha_data_internal(%rip), %ymm10 #139.54 + vmovups 192+__jsvml_shypot_ha_data_internal(%rip), %ymm3 #141.49 vmovaps %ymm1, %ymm4 #109.1 vandps %ymm5, %ymm0, %ymm7 #143.20 vandps %ymm5, %ymm4, %ymm6 #144.20 @@ -72,12 +72,12 @@ __svml_hypotf8_ha_l9: vaddps %ymm13, %ymm12, %ymm15 #165.15 vmulps %ymm13, %ymm13, %ymm2 #163.15 vmulps %ymm15, %ymm14, %ymm7 #166.15 - vpcmpgtd 320+__svml_shypot_ha_data_internal(%rip), %ymm8, %ymm9 #158.24 + vpcmpgtd 320+__jsvml_shypot_ha_data_internal(%rip), %ymm8, %ymm9 #158.24 vandnps %ymm10, %ymm9, %ymm11 #160.25 vandps %ymm11, %ymm5, %ymm6 #162.105 vsubps %ymm6, %ymm5, %ymm1 #162.153 vfmadd231ps %ymm6, %ymm6, %ymm2 #164.15 - vmovups 384+__svml_shypot_ha_data_internal(%rip), %ymm8 #174.23 + vmovups 384+__jsvml_shypot_ha_data_internal(%rip), %ymm8 #174.23 vfmadd231ps %ymm1, %ymm5, %ymm7 #167.15 vfmadd213ps %ymm7, %ymm6, %ymm1 #168.15 vaddps %ymm1, %ymm2, %ymm12 #169.13 @@ -87,13 +87,13 @@ __svml_hypotf8_ha_l9: vfnmadd231ps %ymm5, %ymm6, %ymm3 #185.14 vfmadd213ps %ymm5, %ymm3, %ymm5 #187.14 vfmadd132ps %ymm3, %ymm6, %ymm6 #186.14 - vandps 64+__svml_shypot_ha_data_internal(%rip), %ymm5, %ymm3 #192.109 + vandps 64+__jsvml_shypot_ha_data_internal(%rip), %ymm5, %ymm3 #192.109 vfmsub231ps %ymm3, %ymm3, %ymm2 #193.18 vsubps %ymm3, %ymm5, %ymm14 #192.158 vfmadd213ps %ymm2, %ymm14, %ymm3 #194.18 vfmadd231ps %ymm5, %ymm14, %ymm3 #195.18 vpcmpgtd %ymm12, %ymm8, %ymm9 #177.23 - vpcmpgtd 448+__svml_shypot_ha_data_internal(%rip), %ymm12, %ymm10 #178.24 + vpcmpgtd 448+__jsvml_shypot_ha_data_internal(%rip), %ymm12, %ymm10 #178.24 vpor %ymm10, %ymm9, %ymm11 #179.16 vsubps %ymm1, %ymm3, %ymm1 #196.18 vmovmskps %ymm11, %edx #180.45 @@ -160,29 +160,29 @@ __svml_hypotf8_ha_l9: lea 64(%rsp,%r12,4), %rdi #200.663 lea 128(%rsp,%r12,4), %rsi #200.663 lea 192(%rsp,%r12,4), %rdx #200.663 -..___tag_value___svml_hypotf8_ha_l9.19: -# __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_shypot_ha_cout_rare_internal #200.663 -..___tag_value___svml_hypotf8_ha_l9.20: +..___tag_value___jsvml_hypotf8_ha_l9.19: +# __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_shypot_ha_cout_rare_internal #200.663 +..___tag_value___jsvml_hypotf8_ha_l9.20: jmp ..B1.8 # Prob 100% #200.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypotf8_ha_l9,@function - .size __svml_hypotf8_ha_l9,.-__svml_hypotf8_ha_l9 -..LN__svml_hypotf8_ha_l9.0: + .type __jsvml_hypotf8_ha_l9,@function + .size __jsvml_hypotf8_ha_l9,.-__jsvml_hypotf8_ha_l9 +..LN__jsvml_hypotf8_ha_l9.0: .data -# -- End __svml_hypotf8_ha_l9 +# -- End __jsvml_hypotf8_ha_l9 .text -.L_2__routine_start___svml_hypotf4_ha_l9_1: -# -- Begin __svml_hypotf4_ha_l9 +.L_2__routine_start___jsvml_hypotf4_ha_l9_1: +# -- Begin __jsvml_hypotf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypotf4_ha_l9 -# --- __svml_hypotf4_ha_l9(__m128, __m128) -__svml_hypotf4_ha_l9: + .globl __jsvml_hypotf4_ha_l9 +# --- __jsvml_hypotf4_ha_l9(__m128, __m128) +__jsvml_hypotf4_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B2.1: # Preds ..B2.0 @@ -192,7 +192,7 @@ __svml_hypotf4_ha_l9: .byte 30 #299.654 .byte 250 #299.654 .cfi_startproc -..___tag_value___svml_hypotf4_ha_l9.22: +..___tag_value___jsvml_hypotf4_ha_l9.22: ..L23: #208.1 pushq %rbp #208.1 @@ -203,15 +203,15 @@ __svml_hypotf4_ha_l9: andq $-64, %rsp #208.1 subq $256, %rsp #208.1 vmovaps %xmm1, %xmm4 #208.1 - vmovups 128+__svml_shypot_ha_data_internal(%rip), %xmm5 #239.50 + vmovups 128+__jsvml_shypot_ha_data_internal(%rip), %xmm5 #239.50 vandps %xmm5, %xmm0, %xmm7 #242.20 vandps %xmm5, %xmm4, %xmm6 #243.20 vmaxps %xmm6, %xmm7, %xmm12 #244.13 vminps %xmm7, %xmm6, %xmm5 #245.13 - vmovups __svml_shypot_ha_data_internal(%rip), %xmm10 #238.51 + vmovups __jsvml_shypot_ha_data_internal(%rip), %xmm10 #238.51 vpsubd %xmm5, %xmm12, %xmm8 #256.24 vandps %xmm10, %xmm12, %xmm13 #246.105 - vpcmpgtd 320+__svml_shypot_ha_data_internal(%rip), %xmm8, %xmm9 #257.24 + vpcmpgtd 320+__jsvml_shypot_ha_data_internal(%rip), %xmm8, %xmm9 #257.24 vsubps %xmm13, %xmm12, %xmm14 #246.150 vmulps %xmm13, %xmm13, %xmm2 #262.15 vaddps %xmm13, %xmm12, %xmm15 #264.15 @@ -220,9 +220,9 @@ __svml_hypotf4_ha_l9: vmulps %xmm15, %xmm14, %xmm7 #265.15 vsubps %xmm6, %xmm5, %xmm1 #261.150 vfmadd231ps %xmm6, %xmm6, %xmm2 #263.15 - vmovups 192+__svml_shypot_ha_data_internal(%rip), %xmm3 #240.46 + vmovups 192+__jsvml_shypot_ha_data_internal(%rip), %xmm3 #240.46 vfmadd231ps %xmm1, %xmm5, %xmm7 #266.15 - vmovups 384+__svml_shypot_ha_data_internal(%rip), %xmm8 #273.23 + vmovups 384+__jsvml_shypot_ha_data_internal(%rip), %xmm8 #273.23 vfmadd213ps %xmm7, %xmm6, %xmm1 #267.15 vaddps %xmm1, %xmm2, %xmm12 #268.13 vrsqrtps %xmm12, %xmm13 #281.14 @@ -230,12 +230,12 @@ __svml_hypotf4_ha_l9: vpcmpgtd %xmm12, %xmm8, %xmm9 #276.23 vmulps %xmm3, %xmm13, %xmm6 #283.14 vfnmadd231ps %xmm5, %xmm6, %xmm3 #284.14 - vpcmpgtd 448+__svml_shypot_ha_data_internal(%rip), %xmm12, %xmm10 #277.24 + vpcmpgtd 448+__jsvml_shypot_ha_data_internal(%rip), %xmm12, %xmm10 #277.24 vpor %xmm10, %xmm9, %xmm11 #278.16 vmovmskps %xmm11, %edx #279.44 vfmadd213ps %xmm5, %xmm3, %xmm5 #286.14 vfmadd132ps %xmm3, %xmm6, %xmm6 #285.14 - vandps 64+__svml_shypot_ha_data_internal(%rip), %xmm5, %xmm3 #291.109 + vandps 64+__jsvml_shypot_ha_data_internal(%rip), %xmm5, %xmm3 #291.109 vfmsub231ps %xmm3, %xmm3, %xmm2 #292.18 vsubps %xmm3, %xmm5, %xmm14 #291.155 vfmadd213ps %xmm2, %xmm14, %xmm3 #293.18 @@ -300,29 +300,29 @@ __svml_hypotf4_ha_l9: lea 64(%rsp,%r12,4), %rdi #299.654 lea 128(%rsp,%r12,4), %rsi #299.654 lea 192(%rsp,%r12,4), %rdx #299.654 -..___tag_value___svml_hypotf4_ha_l9.40: -# __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_shypot_ha_cout_rare_internal #299.654 -..___tag_value___svml_hypotf4_ha_l9.41: +..___tag_value___jsvml_hypotf4_ha_l9.40: +# __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_shypot_ha_cout_rare_internal #299.654 +..___tag_value___jsvml_hypotf4_ha_l9.41: jmp ..B2.8 # Prob 100% #299.654 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypotf4_ha_l9,@function - .size __svml_hypotf4_ha_l9,.-__svml_hypotf4_ha_l9 -..LN__svml_hypotf4_ha_l9.1: + .type __jsvml_hypotf4_ha_l9,@function + .size __jsvml_hypotf4_ha_l9,.-__jsvml_hypotf4_ha_l9 +..LN__jsvml_hypotf4_ha_l9.1: .data -# -- End __svml_hypotf4_ha_l9 +# -- End __jsvml_hypotf4_ha_l9 .text -.L_2__routine_start___svml_hypotf8_ha_e9_2: -# -- Begin __svml_hypotf8_ha_e9 +.L_2__routine_start___jsvml_hypotf8_ha_e9_2: +# -- Begin __jsvml_hypotf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypotf8_ha_e9 -# --- __svml_hypotf8_ha_e9(__m256, __m256) -__svml_hypotf8_ha_e9: + .globl __jsvml_hypotf8_ha_e9 +# --- __jsvml_hypotf8_ha_e9(__m256, __m256) +__jsvml_hypotf8_ha_e9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B3.1: # Preds ..B3.0 @@ -332,7 +332,7 @@ __svml_hypotf8_ha_e9: .byte 30 #398.663 .byte 250 #398.663 .cfi_startproc -..___tag_value___svml_hypotf8_ha_e9.43: +..___tag_value___jsvml_hypotf8_ha_e9.43: ..L44: #307.1 pushq %rbp #307.1 @@ -342,10 +342,10 @@ __svml_hypotf8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #307.1 subq $256, %rsp #307.1 - vmovups 128+__svml_shypot_ha_data_internal(%rip), %ymm13 #338.53 - vmovups __svml_shypot_ha_data_internal(%rip), %ymm10 #337.54 - vmovups 320+__svml_shypot_ha_data_internal(%rip), %xmm5 #352.37 - vmovups 192+__svml_shypot_ha_data_internal(%rip), %ymm11 #339.49 + vmovups 128+__jsvml_shypot_ha_data_internal(%rip), %ymm13 #338.53 + vmovups __jsvml_shypot_ha_data_internal(%rip), %ymm10 #337.54 + vmovups 320+__jsvml_shypot_ha_data_internal(%rip), %xmm5 #352.37 + vmovups 192+__jsvml_shypot_ha_data_internal(%rip), %ymm11 #339.49 vmovaps %ymm1, %ymm12 #307.1 vandps %ymm13, %ymm0, %ymm15 #341.20 vandps %ymm13, %ymm12, %ymm14 #342.20 @@ -359,11 +359,11 @@ __svml_hypotf8_ha_e9: vpcmpgtd %xmm5, %xmm1, %xmm3 #356.28 vextractf128 $1, %ymm6, %xmm2 #354.110 vaddps %ymm7, %ymm9, %ymm7 #363.15 - vmovups 384+__svml_shypot_ha_data_internal(%rip), %xmm9 #372.27 + vmovups 384+__jsvml_shypot_ha_data_internal(%rip), %xmm9 #372.27 vpsubd %xmm2, %xmm4, %xmm13 #355.92 vpcmpgtd %xmm5, %xmm13, %xmm5 #356.111 vmulps %ymm7, %ymm8, %ymm8 #364.15 - vmovups 448+__svml_shypot_ha_data_internal(%rip), %xmm13 #373.28 + vmovups 448+__jsvml_shypot_ha_data_internal(%rip), %xmm13 #373.28 vinsertf128 $1, %xmm5, %ymm3, %ymm14 #357.21 vandnps %ymm10, %ymm14, %ymm10 #358.25 vandps %ymm10, %ymm6, %ymm3 #360.105 @@ -395,7 +395,7 @@ __svml_hypotf8_ha_e9: vmulps %ymm2, %ymm10, %ymm11 #384.29 vaddps %ymm5, %ymm13, %ymm15 #385.14 vaddps %ymm11, %ymm10, %ymm1 #384.14 - vandps 64+__svml_shypot_ha_data_internal(%rip), %ymm15, %ymm7 #390.109 + vandps 64+__jsvml_shypot_ha_data_internal(%rip), %ymm15, %ymm7 #390.109 vsubps %ymm7, %ymm15, %ymm9 #390.158 vmulps %ymm7, %ymm7, %ymm6 #391.33 vmulps %ymm9, %ymm7, %ymm8 #392.33 @@ -469,29 +469,29 @@ __svml_hypotf8_ha_e9: lea 64(%rsp,%r12,4), %rdi #398.663 lea 128(%rsp,%r12,4), %rsi #398.663 lea 192(%rsp,%r12,4), %rdx #398.663 -..___tag_value___svml_hypotf8_ha_e9.61: -# __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_shypot_ha_cout_rare_internal #398.663 -..___tag_value___svml_hypotf8_ha_e9.62: +..___tag_value___jsvml_hypotf8_ha_e9.61: +# __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_shypot_ha_cout_rare_internal #398.663 +..___tag_value___jsvml_hypotf8_ha_e9.62: jmp ..B3.8 # Prob 100% #398.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypotf8_ha_e9,@function - .size __svml_hypotf8_ha_e9,.-__svml_hypotf8_ha_e9 -..LN__svml_hypotf8_ha_e9.2: + .type __jsvml_hypotf8_ha_e9,@function + .size __jsvml_hypotf8_ha_e9,.-__jsvml_hypotf8_ha_e9 +..LN__jsvml_hypotf8_ha_e9.2: .data -# -- End __svml_hypotf8_ha_e9 +# -- End __jsvml_hypotf8_ha_e9 .text -.L_2__routine_start___svml_hypotf4_ha_ex_3: -# -- Begin __svml_hypotf4_ha_ex +.L_2__routine_start___jsvml_hypotf4_ha_ex_3: +# -- Begin __jsvml_hypotf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_hypotf4_ha_ex -# --- __svml_hypotf4_ha_ex(__m128, __m128) -__svml_hypotf4_ha_ex: + .globl __jsvml_hypotf4_ha_ex +# --- __jsvml_hypotf4_ha_ex(__m128, __m128) +__jsvml_hypotf4_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B4.1: # Preds ..B4.0 @@ -501,7 +501,7 @@ __svml_hypotf4_ha_ex: .byte 30 #1138.654 .byte 250 #1138.654 .cfi_startproc -..___tag_value___svml_hypotf4_ha_ex.64: +..___tag_value___jsvml_hypotf4_ha_ex.64: ..L65: #1047.1 pushq %rbp #1047.1 @@ -512,7 +512,7 @@ __svml_hypotf4_ha_ex: andq $-64, %rsp #1047.1 subq $256, %rsp #1047.1 movaps %xmm1, %xmm4 #1047.1 - movups 128+__svml_shypot_ha_data_internal(%rip), %xmm10 #1078.50 + movups 128+__jsvml_shypot_ha_data_internal(%rip), %xmm10 #1078.50 movaps %xmm10, %xmm5 #1081.20 andps %xmm4, %xmm10 #1082.20 andps %xmm0, %xmm5 #1081.20 @@ -523,8 +523,8 @@ __svml_hypotf4_ha_ex: movaps %xmm9, %xmm3 #1085.150 psubd %xmm10, %xmm12 #1095.22 movaps %xmm10, %xmm11 #1100.150 - movups __svml_shypot_ha_data_internal(%rip), %xmm6 #1077.51 - pcmpgtd 320+__svml_shypot_ha_data_internal(%rip), %xmm12 #1096.22 + movups __jsvml_shypot_ha_data_internal(%rip), %xmm6 #1077.51 + pcmpgtd 320+__jsvml_shypot_ha_data_internal(%rip), %xmm12 #1096.22 movaps %xmm6, %xmm8 #1085.105 andnps %xmm6, %xmm12 #1098.25 andps %xmm9, %xmm8 #1085.105 @@ -543,17 +543,17 @@ __svml_hypotf4_ha_ex: addps %xmm10, %xmm3 #1105.15 movaps %xmm2, %xmm10 #1107.13 addps %xmm12, %xmm3 #1106.15 - movdqu 384+__svml_shypot_ha_data_internal(%rip), %xmm14 #1115.21 + movdqu 384+__jsvml_shypot_ha_data_internal(%rip), %xmm14 #1115.21 addps %xmm3, %xmm10 #1107.13 rsqrtps %xmm10, %xmm9 #1120.14 - movups 192+__svml_shypot_ha_data_internal(%rip), %xmm1 #1079.46 + movups 192+__jsvml_shypot_ha_data_internal(%rip), %xmm1 #1079.46 pcmpgtd %xmm10, %xmm14 #1115.21 movaps %xmm10, %xmm13 #1116.22 mulps %xmm9, %xmm10 #1121.14 mulps %xmm1, %xmm9 #1122.14 movaps %xmm10, %xmm15 #1123.36 mulps %xmm9, %xmm15 #1123.36 - movups 64+__svml_shypot_ha_data_internal(%rip), %xmm6 #1130.109 + movups 64+__jsvml_shypot_ha_data_internal(%rip), %xmm6 #1130.109 subps %xmm15, %xmm1 #1123.14 movaps %xmm1, %xmm5 #1124.26 mulps %xmm10, %xmm1 #1125.26 @@ -569,7 +569,7 @@ __svml_hypotf4_ha_ex: subps %xmm2, %xmm8 #1131.18 mulps %xmm10, %xmm7 #1133.30 addps %xmm6, %xmm8 #1132.18 - pcmpgtd 448+__svml_shypot_ha_data_internal(%rip), %xmm13 #1116.22 + pcmpgtd 448+__jsvml_shypot_ha_data_internal(%rip), %xmm13 #1116.22 addps %xmm7, %xmm8 #1133.18 por %xmm13, %xmm14 #1117.14 subps %xmm3, %xmm8 #1134.18 @@ -633,29 +633,29 @@ __svml_hypotf4_ha_ex: lea 64(%rsp,%r12,4), %rdi #1138.654 lea 128(%rsp,%r12,4), %rsi #1138.654 lea 192(%rsp,%r12,4), %rdx #1138.654 -..___tag_value___svml_hypotf4_ha_ex.82: -# __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_shypot_ha_cout_rare_internal #1138.654 -..___tag_value___svml_hypotf4_ha_ex.83: +..___tag_value___jsvml_hypotf4_ha_ex.82: +# __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_shypot_ha_cout_rare_internal #1138.654 +..___tag_value___jsvml_hypotf4_ha_ex.83: jmp ..B4.8 # Prob 100% #1138.654 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypotf4_ha_ex,@function - .size __svml_hypotf4_ha_ex,.-__svml_hypotf4_ha_ex -..LN__svml_hypotf4_ha_ex.3: + .type __jsvml_hypotf4_ha_ex,@function + .size __jsvml_hypotf4_ha_ex,.-__jsvml_hypotf4_ha_ex +..LN__jsvml_hypotf4_ha_ex.3: .data -# -- End __svml_hypotf4_ha_ex +# -- End __jsvml_hypotf4_ha_ex .text -.L_2__routine_start___svml_hypotf16_ha_z0_4: -# -- Begin __svml_hypotf16_ha_z0 +.L_2__routine_start___jsvml_hypotf16_ha_z0_4: +# -- Begin __jsvml_hypotf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_hypotf16_ha_z0 -# --- __svml_hypotf16_ha_z0(__m512, __m512) -__svml_hypotf16_ha_z0: + .globl __jsvml_hypotf16_ha_z0 +# --- __jsvml_hypotf16_ha_z0(__m512, __m512) +__jsvml_hypotf16_ha_z0: # parameter 1: %zmm0 # parameter 2: %zmm1 ..B5.1: # Preds ..B5.0 @@ -665,7 +665,7 @@ __svml_hypotf16_ha_z0: .byte 30 #1210.878 .byte 250 #1210.878 .cfi_startproc -..___tag_value___svml_hypotf16_ha_z0.85: +..___tag_value___jsvml_hypotf16_ha_z0.85: ..L86: #1146.1 pushq %rbp #1146.1 @@ -685,10 +685,10 @@ __svml_hypotf16_ha_z0: vmaxps {sae}, %zmm4, %zmm3, %zmm5 #1184.17 vrsqrt14ps %zmm1, %zmm4 #1202.13 vminps {sae}, %zmm8, %zmm7, %zmm10 #1197.17 - vmovups 192+__svml_shypot_ha_data_internal(%rip), %zmm3 #1204.48 - vandps 128+__svml_shypot_ha_data_internal(%rip), %zmm5, %zmm6 #1186.18 + vmovups 192+__jsvml_shypot_ha_data_internal(%rip), %zmm3 #1204.48 + vandps 128+__jsvml_shypot_ha_data_internal(%rip), %zmm5, %zmm6 #1186.18 vsubps {rn-sae}, %zmm9, %zmm1, %zmm11 #1198.15 - vpcmpd $5, 512+__svml_shypot_ha_data_internal(%rip), %zmm6, %k0 #1189.20 + vpcmpd $5, 512+__jsvml_shypot_ha_data_internal(%rip), %zmm6, %k0 #1189.20 vmulps {rn-sae}, %zmm4, %zmm3, %zmm6 #1205.23 vsubps {rn-sae}, %zmm11, %zmm10, %zmm14 #1199.15 kmovw %k0, %esi #1190.41 @@ -814,29 +814,29 @@ __svml_hypotf16_ha_z0: lea 64(%rsp,%rbx,4), %rdi #1210.878 lea 128(%rsp,%rbx,4), %rsi #1210.878 lea 192(%rsp,%rbx,4), %rdx #1210.878 -..___tag_value___svml_hypotf16_ha_z0.113: -# __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_shypot_ha_cout_rare_internal #1210.878 -..___tag_value___svml_hypotf16_ha_z0.114: +..___tag_value___jsvml_hypotf16_ha_z0.113: +# __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_shypot_ha_cout_rare_internal #1210.878 +..___tag_value___jsvml_hypotf16_ha_z0.114: jmp ..B5.13 # Prob 100% #1210.878 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_hypotf16_ha_z0,@function - .size __svml_hypotf16_ha_z0,.-__svml_hypotf16_ha_z0 -..LN__svml_hypotf16_ha_z0.4: + .type __jsvml_hypotf16_ha_z0,@function + .size __jsvml_hypotf16_ha_z0,.-__jsvml_hypotf16_ha_z0 +..LN__jsvml_hypotf16_ha_z0.4: .data -# -- End __svml_hypotf16_ha_z0 +# -- End __jsvml_hypotf16_ha_z0 .text -.L_2__routine_start___svml_hypotf4_ha_e9_5: -# -- Begin __svml_hypotf4_ha_e9 +.L_2__routine_start___jsvml_hypotf4_ha_e9_5: +# -- Begin __jsvml_hypotf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_hypotf4_ha_e9 -# --- __svml_hypotf4_ha_e9(__m128, __m128) -__svml_hypotf4_ha_e9: + .globl __jsvml_hypotf4_ha_e9 +# --- __jsvml_hypotf4_ha_e9(__m128, __m128) +__jsvml_hypotf4_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B6.1: # Preds ..B6.0 @@ -846,7 +846,7 @@ __svml_hypotf4_ha_e9: .byte 30 #1309.654 .byte 250 #1309.654 .cfi_startproc -..___tag_value___svml_hypotf4_ha_e9.116: +..___tag_value___jsvml_hypotf4_ha_e9.116: ..L117: #1218.1 pushq %rbp #1218.1 @@ -857,7 +857,7 @@ __svml_hypotf4_ha_e9: andq $-64, %rsp #1218.1 subq $256, %rsp #1218.1 movaps %xmm1, %xmm4 #1218.1 - movups 128+__svml_shypot_ha_data_internal(%rip), %xmm10 #1249.50 + movups 128+__jsvml_shypot_ha_data_internal(%rip), %xmm10 #1249.50 movaps %xmm10, %xmm5 #1252.20 andps %xmm4, %xmm10 #1253.20 andps %xmm0, %xmm5 #1252.20 @@ -868,8 +868,8 @@ __svml_hypotf4_ha_e9: movaps %xmm9, %xmm3 #1256.150 psubd %xmm10, %xmm12 #1266.28 movaps %xmm10, %xmm11 #1271.150 - movups __svml_shypot_ha_data_internal(%rip), %xmm6 #1248.51 - pcmpgtd 320+__svml_shypot_ha_data_internal(%rip), %xmm12 #1267.28 + movups __jsvml_shypot_ha_data_internal(%rip), %xmm6 #1248.51 + pcmpgtd 320+__jsvml_shypot_ha_data_internal(%rip), %xmm12 #1267.28 movaps %xmm6, %xmm8 #1256.105 andnps %xmm6, %xmm12 #1269.25 andps %xmm9, %xmm8 #1256.105 @@ -888,17 +888,17 @@ __svml_hypotf4_ha_e9: addps %xmm10, %xmm3 #1276.15 movaps %xmm2, %xmm10 #1278.13 addps %xmm12, %xmm3 #1277.15 - movups 384+__svml_shypot_ha_data_internal(%rip), %xmm14 #1283.27 + movups 384+__jsvml_shypot_ha_data_internal(%rip), %xmm14 #1283.27 addps %xmm3, %xmm10 #1278.13 rsqrtps %xmm10, %xmm9 #1291.14 - movups 192+__svml_shypot_ha_data_internal(%rip), %xmm1 #1250.46 + movups 192+__jsvml_shypot_ha_data_internal(%rip), %xmm1 #1250.46 pcmpgtd %xmm10, %xmm14 #1286.27 movaps %xmm10, %xmm13 #1287.28 mulps %xmm9, %xmm10 #1292.14 mulps %xmm1, %xmm9 #1293.14 movaps %xmm10, %xmm15 #1294.36 mulps %xmm9, %xmm15 #1294.36 - movups 64+__svml_shypot_ha_data_internal(%rip), %xmm6 #1301.109 + movups 64+__jsvml_shypot_ha_data_internal(%rip), %xmm6 #1301.109 subps %xmm15, %xmm1 #1294.14 movaps %xmm1, %xmm5 #1295.26 mulps %xmm10, %xmm1 #1296.26 @@ -914,7 +914,7 @@ __svml_hypotf4_ha_e9: subps %xmm2, %xmm8 #1302.18 mulps %xmm10, %xmm7 #1304.30 addps %xmm6, %xmm8 #1303.18 - pcmpgtd 448+__svml_shypot_ha_data_internal(%rip), %xmm13 #1287.28 + pcmpgtd 448+__jsvml_shypot_ha_data_internal(%rip), %xmm13 #1287.28 addps %xmm7, %xmm8 #1304.18 por %xmm13, %xmm14 #1288.20 subps %xmm3, %xmm8 #1305.18 @@ -978,30 +978,30 @@ __svml_hypotf4_ha_e9: lea 64(%rsp,%r12,4), %rdi #1309.654 lea 128(%rsp,%r12,4), %rsi #1309.654 lea 192(%rsp,%r12,4), %rdx #1309.654 -..___tag_value___svml_hypotf4_ha_e9.134: -# __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) - call __svml_shypot_ha_cout_rare_internal #1309.654 -..___tag_value___svml_hypotf4_ha_e9.135: +..___tag_value___jsvml_hypotf4_ha_e9.134: +# __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) + call __jsvml_shypot_ha_cout_rare_internal #1309.654 +..___tag_value___jsvml_hypotf4_ha_e9.135: jmp ..B6.8 # Prob 100% #1309.654 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_hypotf4_ha_e9,@function - .size __svml_hypotf4_ha_e9,.-__svml_hypotf4_ha_e9 -..LN__svml_hypotf4_ha_e9.5: + .type __jsvml_hypotf4_ha_e9,@function + .size __jsvml_hypotf4_ha_e9,.-__jsvml_hypotf4_ha_e9 +..LN__jsvml_hypotf4_ha_e9.5: .data -# -- End __svml_hypotf4_ha_e9 +# -- End __jsvml_hypotf4_ha_e9 .text -.L_2__routine_start___svml_shypot_ha_cout_rare_internal_6: -# -- Begin __svml_shypot_ha_cout_rare_internal +.L_2__routine_start___jsvml_shypot_ha_cout_rare_internal_6: +# -- Begin __jsvml_shypot_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_shypot_ha_cout_rare_internal - .globl __svml_shypot_ha_cout_rare_internal -# --- __svml_shypot_ha_cout_rare_internal(const float *, const float *, float *) -__svml_shypot_ha_cout_rare_internal: + .hidden __jsvml_shypot_ha_cout_rare_internal + .globl __jsvml_shypot_ha_cout_rare_internal +# --- __jsvml_shypot_ha_cout_rare_internal(const float *, const float *, float *) +__jsvml_shypot_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -1012,7 +1012,7 @@ __svml_shypot_ha_cout_rare_internal: .byte 30 #1027.25 .byte 250 #1027.25 .cfi_startproc -..___tag_value___svml_shypot_ha_cout_rare_internal.137: +..___tag_value___jsvml_shypot_ha_cout_rare_internal.137: ..L138: #924.1 movq %rdx, %r8 #924.1 @@ -1318,17 +1318,17 @@ __svml_shypot_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_shypot_ha_cout_rare_internal,@function - .size __svml_shypot_ha_cout_rare_internal,.-__svml_shypot_ha_cout_rare_internal -..LN__svml_shypot_ha_cout_rare_internal.6: + .type __jsvml_shypot_ha_cout_rare_internal,@function + .size __jsvml_shypot_ha_cout_rare_internal,.-__jsvml_shypot_ha_cout_rare_internal +..LN__jsvml_shypot_ha_cout_rare_internal.6: .data -# -- End __svml_shypot_ha_cout_rare_internal +# -- End __jsvml_shypot_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_shypot_ha_data_internal - .globl __svml_shypot_ha_data_internal -__svml_shypot_ha_data_internal: + .hidden __jsvml_shypot_ha_data_internal + .globl __jsvml_shypot_ha_data_internal +__jsvml_shypot_ha_data_internal: .long 4294443008 .long 4294443008 .long 4294443008 @@ -1473,8 +1473,8 @@ __svml_shypot_ha_data_internal: .long 1115422720 .long 1115422720 .long 1115422720 - .type __svml_shypot_ha_data_internal,@object - .size __svml_shypot_ha_data_internal,576 + .type __jsvml_shypot_ha_data_internal,@object + .size __jsvml_shypot_ha_data_internal,576 .align 32 _vmlsHypotHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_log10_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log10_linux_x86.S similarity index 89% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_log10_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log10_linux_x86.S index 3599016b4f0..d7833c28dd4 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_log10_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log10_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_log10.c" .text ..TXTST0: -.L_2__routine_start___svml_log10f4_ha_e9_0: -# -- Begin __svml_log10f4_ha_e9 +.L_2__routine_start___jsvml_log10f4_ha_e9_0: +# -- Begin __jsvml_log10f4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log10f4_ha_e9 -# --- __svml_log10f4_ha_e9(__m128) -__svml_log10f4_ha_e9: + .globl __jsvml_log10f4_ha_e9 +# --- __jsvml_log10f4_ha_e9(__m128) +__jsvml_log10f4_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_log10f4_ha_e9: .byte 30 #450.540 .byte 250 #450.540 .cfi_startproc -..___tag_value___svml_log10f4_ha_e9.1: +..___tag_value___jsvml_log10f4_ha_e9.1: ..L2: #375.1 pushq %rbp #375.1 @@ -58,24 +58,24 @@ __svml_log10f4_ha_e9: andq $-64, %rsp #375.1 subq $192, %rsp #375.1 movaps %xmm0, %xmm3 #416.23 - movups 1280+__svml_slog10_ha_data_internal(%rip), %xmm1 #410.19 + movups 1280+__jsvml_slog10_ha_data_internal(%rip), %xmm1 #410.19 psrld $23, %xmm3 #416.23 andps %xmm0, %xmm1 #410.19 - lea -136944+__svml_slog10_ha_data_internal(%rip), %r8 #432.61 - orps 1344+__svml_slog10_ha_data_internal(%rip), %xmm1 #411.19 + lea -136944+__jsvml_slog10_ha_data_internal(%rip), %r8 #432.61 + orps 1344+__jsvml_slog10_ha_data_internal(%rip), %xmm1 #411.19 movaps %xmm0, %xmm5 #417.18 rcpps %xmm1, %xmm2 #414.17 cvtdq2ps %xmm3, %xmm13 #422.18 - cmpltps 1408+__svml_slog10_ha_data_internal(%rip), %xmm5 #417.18 - movups 1600+__svml_slog10_ha_data_internal(%rip), %xmm6 #419.44 + cmpltps 1408+__jsvml_slog10_ha_data_internal(%rip), %xmm5 #417.18 + movups 1600+__jsvml_slog10_ha_data_internal(%rip), %xmm6 #419.44 movaps %xmm0, %xmm4 #418.18 mulps %xmm6, %xmm2 #420.17 - cmpnleps 1472+__svml_slog10_ha_data_internal(%rip), %xmm4 #418.18 - movups 1536+__svml_slog10_ha_data_internal(%rip), %xmm7 #426.49 + cmpnleps 1472+__jsvml_slog10_ha_data_internal(%rip), %xmm4 #418.18 + movups 1536+__jsvml_slog10_ha_data_internal(%rip), %xmm7 #426.49 orps %xmm4, %xmm5 #423.18 roundps $0, %xmm2, %xmm2 #421.17 andps %xmm1, %xmm7 #427.118 - movups 1664+__svml_slog10_ha_data_internal(%rip), %xmm11 #436.25 + movups 1664+__jsvml_slog10_ha_data_internal(%rip), %xmm11 #436.25 subps %xmm7, %xmm1 #427.172 mulps %xmm2, %xmm7 #427.225 mulps %xmm13, %xmm11 #436.25 @@ -90,12 +90,12 @@ __svml_log10f4_ha_e9: pextrd $1, %xmm2, %ecx #432.396 pextrd $2, %xmm2, %esi #432.612 pextrd $3, %xmm2, %edi #432.828 - movups 1088+__svml_slog10_ha_data_internal(%rip), %xmm2 #438.54 + movups 1088+__jsvml_slog10_ha_data_internal(%rip), %xmm2 #438.54 movslq %edx, %rdx #432.61 movslq %ecx, %rcx #432.274 mulps %xmm1, %xmm2 #441.26 movslq %esi, %rsi #432.490 - addps 1152+__svml_slog10_ha_data_internal(%rip), %xmm2 #441.14 + addps 1152+__jsvml_slog10_ha_data_internal(%rip), %xmm2 #441.14 movslq %edi, %rdi #432.706 movq (%r8,%rdx), %xmm3 #432.61 movq (%r8,%rcx), %xmm8 #432.274 @@ -107,10 +107,10 @@ __svml_log10f4_ha_e9: movlhps %xmm10, %xmm14 #432.950 mulps %xmm1, %xmm2 #442.25 addps %xmm11, %xmm14 #436.13 - movups 1728+__svml_slog10_ha_data_internal(%rip), %xmm12 #435.44 + movups 1728+__jsvml_slog10_ha_data_internal(%rip), %xmm12 #435.44 addps %xmm14, %xmm5 #443.17 mulps %xmm12, %xmm13 #437.25 - addps 1216+__svml_slog10_ha_data_internal(%rip), %xmm2 #442.13 + addps 1216+__jsvml_slog10_ha_data_internal(%rip), %xmm2 #442.13 shufps $238, %xmm10, %xmm3 #432.994 movaps %xmm5, %xmm15 #444.13 mulps %xmm2, %xmm1 #446.25 @@ -175,29 +175,29 @@ __svml_log10f4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #450.540 lea 128(%rsp,%r12,4), %rsi #450.540 -..___tag_value___svml_log10f4_ha_e9.19: -# __svml_slog10_ha_cout_rare_internal(const float *, float *) - call __svml_slog10_ha_cout_rare_internal #450.540 -..___tag_value___svml_log10f4_ha_e9.20: +..___tag_value___jsvml_log10f4_ha_e9.19: +# __jsvml_slog10_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog10_ha_cout_rare_internal #450.540 +..___tag_value___jsvml_log10f4_ha_e9.20: jmp ..B1.8 # Prob 100% #450.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log10f4_ha_e9,@function - .size __svml_log10f4_ha_e9,.-__svml_log10f4_ha_e9 -..LN__svml_log10f4_ha_e9.0: + .type __jsvml_log10f4_ha_e9,@function + .size __jsvml_log10f4_ha_e9,.-__jsvml_log10f4_ha_e9 +..LN__jsvml_log10f4_ha_e9.0: .data -# -- End __svml_log10f4_ha_e9 +# -- End __jsvml_log10f4_ha_e9 .text -.L_2__routine_start___svml_log10f8_ha_l9_1: -# -- Begin __svml_log10f8_ha_l9 +.L_2__routine_start___jsvml_log10f8_ha_l9_1: +# -- Begin __jsvml_log10f8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log10f8_ha_l9 -# --- __svml_log10f8_ha_l9(__m256) -__svml_log10f8_ha_l9: + .globl __jsvml_log10f8_ha_l9 +# --- __jsvml_log10f8_ha_l9(__m256) +__jsvml_log10f8_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -206,7 +206,7 @@ __svml_log10f8_ha_l9: .byte 30 #533.546 .byte 250 #533.546 .cfi_startproc -..___tag_value___svml_log10f8_ha_l9.22: +..___tag_value___jsvml_log10f8_ha_l9.22: ..L23: #458.1 pushq %rbp #458.1 @@ -216,15 +216,15 @@ __svml_log10f8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #458.1 subq $192, %rsp #458.1 - lea -136944+__svml_slog10_ha_data_internal(%rip), %rax #515.64 + lea -136944+__jsvml_slog10_ha_data_internal(%rip), %rax #515.64 vmovaps %ymm0, %ymm2 #458.1 - vandps 1280+__svml_slog10_ha_data_internal(%rip), %ymm2, %ymm3 #493.19 - vorps 1344+__svml_slog10_ha_data_internal(%rip), %ymm3, %ymm1 #494.19 + vandps 1280+__jsvml_slog10_ha_data_internal(%rip), %ymm2, %ymm3 #493.19 + vorps 1344+__jsvml_slog10_ha_data_internal(%rip), %ymm3, %ymm1 #494.19 vrcpps %ymm1, %ymm4 #497.17 - vmovups 1600+__svml_slog10_ha_data_internal(%rip), %ymm10 #502.47 + vmovups 1600+__jsvml_slog10_ha_data_internal(%rip), %ymm10 #502.47 vpsrld $23, %ymm2, %ymm6 #499.19 - vcmplt_oqps 1408+__svml_slog10_ha_data_internal(%rip), %ymm2, %ymm7 #500.18 - vcmpnle_uqps 1472+__svml_slog10_ha_data_internal(%rip), %ymm2, %ymm8 #501.18 + vcmplt_oqps 1408+__jsvml_slog10_ha_data_internal(%rip), %ymm2, %ymm7 #500.18 + vcmpnle_uqps 1472+__jsvml_slog10_ha_data_internal(%rip), %ymm2, %ymm8 #501.18 vcvtdq2ps %ymm6, %ymm0 #505.18 vmulps %ymm10, %ymm4, %ymm5 #503.17 vroundps $0, %ymm5, %ymm11 #504.17 @@ -253,7 +253,7 @@ __svml_log10f8_ha_l9: vmovq (%rax,%r9), %xmm5 #515.1049 vmovq (%rax,%r11), %xmm6 #515.1550 vunpcklps %xmm6, %xmm5, %xmm10 #515.2128 - vmovups 1088+__svml_slog10_ha_data_internal(%rip), %ymm6 #521.57 + vmovups 1088+__jsvml_slog10_ha_data_internal(%rip), %ymm6 #521.57 vmovq (%rax,%rsi), %xmm3 #515.308 vmovq (%rax,%rdi), %xmm15 #515.555 vmovq (%rax,%r8), %xmm4 #515.802 @@ -262,14 +262,14 @@ __svml_log10f8_ha_l9: vunpcklps %xmm15, %xmm14, %xmm9 #515.2018 vunpcklps %xmm4, %xmm3, %xmm11 #515.2073 vunpcklps %xmm8, %xmm7, %xmm12 #515.2183 - vfmadd213ps 1152+__svml_slog10_ha_data_internal(%rip), %ymm1, %ymm6 #524.14 - vfmadd213ps 1216+__svml_slog10_ha_data_internal(%rip), %ymm1, %ymm6 #525.13 + vfmadd213ps 1152+__jsvml_slog10_ha_data_internal(%rip), %ymm1, %ymm6 #524.14 + vfmadd213ps 1216+__jsvml_slog10_ha_data_internal(%rip), %ymm1, %ymm6 #525.13 vinsertf128 $1, %xmm10, %ymm9, %ymm13 #515.2246 vinsertf128 $1, %xmm12, %ymm11, %ymm14 #515.2354 vunpcklps %ymm14, %ymm13, %ymm3 #515.2445 - vfmadd231ps 1664+__svml_slog10_ha_data_internal(%rip), %ymm0, %ymm3 #519.13 + vfmadd231ps 1664+__jsvml_slog10_ha_data_internal(%rip), %ymm0, %ymm3 #519.13 vunpckhps %ymm14, %ymm13, %ymm15 #515.2519 - vfmadd132ps 1728+__svml_slog10_ha_data_internal(%rip), %ymm15, %ymm0 #520.13 + vfmadd132ps 1728+__jsvml_slog10_ha_data_internal(%rip), %ymm15, %ymm0 #520.13 vaddps %ymm3, %ymm1, %ymm7 #526.17 vfmadd213ps %ymm0, %ymm1, %ymm6 #529.13 vsubps %ymm3, %ymm7, %ymm4 #527.13 @@ -335,29 +335,29 @@ __svml_log10f8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #533.546 lea 128(%rsp,%r12,4), %rsi #533.546 -..___tag_value___svml_log10f8_ha_l9.40: -# __svml_slog10_ha_cout_rare_internal(const float *, float *) - call __svml_slog10_ha_cout_rare_internal #533.546 -..___tag_value___svml_log10f8_ha_l9.41: +..___tag_value___jsvml_log10f8_ha_l9.40: +# __jsvml_slog10_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog10_ha_cout_rare_internal #533.546 +..___tag_value___jsvml_log10f8_ha_l9.41: jmp ..B2.8 # Prob 100% #533.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log10f8_ha_l9,@function - .size __svml_log10f8_ha_l9,.-__svml_log10f8_ha_l9 -..LN__svml_log10f8_ha_l9.1: + .type __jsvml_log10f8_ha_l9,@function + .size __jsvml_log10f8_ha_l9,.-__jsvml_log10f8_ha_l9 +..LN__jsvml_log10f8_ha_l9.1: .data -# -- End __svml_log10f8_ha_l9 +# -- End __jsvml_log10f8_ha_l9 .text -.L_2__routine_start___svml_log10f4_ha_l9_2: -# -- Begin __svml_log10f4_ha_l9 +.L_2__routine_start___jsvml_log10f4_ha_l9_2: +# -- Begin __jsvml_log10f4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log10f4_ha_l9 -# --- __svml_log10f4_ha_l9(__m128) -__svml_log10f4_ha_l9: + .globl __jsvml_log10f4_ha_l9 +# --- __jsvml_log10f4_ha_l9(__m128) +__jsvml_log10f4_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -366,7 +366,7 @@ __svml_log10f4_ha_l9: .byte 30 #616.540 .byte 250 #616.540 .cfi_startproc -..___tag_value___svml_log10f4_ha_l9.43: +..___tag_value___jsvml_log10f4_ha_l9.43: ..L44: #541.1 pushq %rbp #541.1 @@ -377,19 +377,19 @@ __svml_log10f4_ha_l9: andq $-64, %rsp #541.1 subq $192, %rsp #541.1 vmovaps %xmm0, %xmm2 #541.1 - vandps 1280+__svml_slog10_ha_data_internal(%rip), %xmm2, %xmm3 #576.19 - lea -136944+__svml_slog10_ha_data_internal(%rip), %r8 #598.61 - vorps 1344+__svml_slog10_ha_data_internal(%rip), %xmm3, %xmm1 #577.19 + vandps 1280+__jsvml_slog10_ha_data_internal(%rip), %xmm2, %xmm3 #576.19 + lea -136944+__jsvml_slog10_ha_data_internal(%rip), %r8 #598.61 + vorps 1344+__jsvml_slog10_ha_data_internal(%rip), %xmm3, %xmm1 #577.19 vpsrld $23, %xmm2, %xmm6 #582.19 vrcpps %xmm1, %xmm4 #580.17 vcvtdq2ps %xmm6, %xmm0 #588.18 - vcmpltps 1408+__svml_slog10_ha_data_internal(%rip), %xmm2, %xmm7 #583.18 - vcmpnleps 1472+__svml_slog10_ha_data_internal(%rip), %xmm2, %xmm8 #584.18 - vmovups 1600+__svml_slog10_ha_data_internal(%rip), %xmm10 #585.44 + vcmpltps 1408+__jsvml_slog10_ha_data_internal(%rip), %xmm2, %xmm7 #583.18 + vcmpnleps 1472+__jsvml_slog10_ha_data_internal(%rip), %xmm2, %xmm8 #584.18 + vmovups 1600+__jsvml_slog10_ha_data_internal(%rip), %xmm10 #585.44 vorps %xmm8, %xmm7, %xmm9 #589.18 vmulps %xmm10, %xmm4, %xmm5 #586.17 vmovmskps %xmm9, %eax #591.44 - vmovups 1088+__svml_slog10_ha_data_internal(%rip), %xmm9 #604.54 + vmovups 1088+__jsvml_slog10_ha_data_internal(%rip), %xmm9 #604.54 vroundps $0, %xmm5, %xmm5 #587.17 vpsrld $13, %xmm5, %xmm11 #595.18 vmovd %xmm11, %edx #598.183 @@ -408,12 +408,12 @@ __svml_log10f4_ha_l9: vunpcklps %xmm13, %xmm12, %xmm3 #598.875 vunpcklps %xmm15, %xmm14, %xmm4 #598.910 vmovlhps %xmm4, %xmm3, %xmm6 #598.950 - vfmadd231ps 1664+__svml_slog10_ha_data_internal(%rip), %xmm0, %xmm6 #602.13 - vfmadd213ps 1152+__svml_slog10_ha_data_internal(%rip), %xmm1, %xmm9 #607.14 + vfmadd231ps 1664+__jsvml_slog10_ha_data_internal(%rip), %xmm0, %xmm6 #602.13 + vfmadd213ps 1152+__jsvml_slog10_ha_data_internal(%rip), %xmm1, %xmm9 #607.14 vshufps $238, %xmm4, %xmm3, %xmm5 #598.994 - vfmadd132ps 1728+__svml_slog10_ha_data_internal(%rip), %xmm5, %xmm0 #603.13 + vfmadd132ps 1728+__jsvml_slog10_ha_data_internal(%rip), %xmm5, %xmm0 #603.13 vaddps %xmm6, %xmm1, %xmm10 #609.17 - vfmadd213ps 1216+__svml_slog10_ha_data_internal(%rip), %xmm1, %xmm9 #608.13 + vfmadd213ps 1216+__jsvml_slog10_ha_data_internal(%rip), %xmm1, %xmm9 #608.13 vsubps %xmm6, %xmm10, %xmm7 #610.13 vfmadd213ps %xmm0, %xmm1, %xmm9 #612.13 vsubps %xmm7, %xmm1, %xmm8 #611.13 @@ -474,29 +474,29 @@ __svml_log10f4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #616.540 lea 128(%rsp,%r12,4), %rsi #616.540 -..___tag_value___svml_log10f4_ha_l9.61: -# __svml_slog10_ha_cout_rare_internal(const float *, float *) - call __svml_slog10_ha_cout_rare_internal #616.540 -..___tag_value___svml_log10f4_ha_l9.62: +..___tag_value___jsvml_log10f4_ha_l9.61: +# __jsvml_slog10_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog10_ha_cout_rare_internal #616.540 +..___tag_value___jsvml_log10f4_ha_l9.62: jmp ..B3.8 # Prob 100% #616.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log10f4_ha_l9,@function - .size __svml_log10f4_ha_l9,.-__svml_log10f4_ha_l9 -..LN__svml_log10f4_ha_l9.2: + .type __jsvml_log10f4_ha_l9,@function + .size __jsvml_log10f4_ha_l9,.-__jsvml_log10f4_ha_l9 +..LN__jsvml_log10f4_ha_l9.2: .data -# -- End __svml_log10f4_ha_l9 +# -- End __jsvml_log10f4_ha_l9 .text -.L_2__routine_start___svml_log10f4_ha_ex_3: -# -- Begin __svml_log10f4_ha_ex +.L_2__routine_start___jsvml_log10f4_ha_ex_3: +# -- Begin __jsvml_log10f4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log10f4_ha_ex -# --- __svml_log10f4_ha_ex(__m128) -__svml_log10f4_ha_ex: + .globl __jsvml_log10f4_ha_ex +# --- __jsvml_log10f4_ha_ex(__m128) +__jsvml_log10f4_ha_ex: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -505,7 +505,7 @@ __svml_log10f4_ha_ex: .byte 30 #699.540 .byte 250 #699.540 .cfi_startproc -..___tag_value___svml_log10f4_ha_ex.64: +..___tag_value___jsvml_log10f4_ha_ex.64: ..L65: #624.1 pushq %rbp #624.1 @@ -516,23 +516,23 @@ __svml_log10f4_ha_ex: andq $-64, %rsp #624.1 subq $192, %rsp #624.1 movaps %xmm0, %xmm3 #624.1 - movups 1280+__svml_slog10_ha_data_internal(%rip), %xmm2 #659.19 + movups 1280+__jsvml_slog10_ha_data_internal(%rip), %xmm2 #659.19 movaps %xmm3, %xmm5 #665.17 andps %xmm3, %xmm2 #659.19 psrld $23, %xmm5 #665.17 - orps 1344+__svml_slog10_ha_data_internal(%rip), %xmm2 #660.19 + orps 1344+__jsvml_slog10_ha_data_internal(%rip), %xmm2 #660.19 movaps %xmm3, %xmm7 #666.18 rcpps %xmm2, %xmm12 #663.17 cvtdq2ps %xmm5, %xmm0 #671.18 - cmpltps 1408+__svml_slog10_ha_data_internal(%rip), %xmm7 #666.18 - movups 1600+__svml_slog10_ha_data_internal(%rip), %xmm8 #668.44 + cmpltps 1408+__jsvml_slog10_ha_data_internal(%rip), %xmm7 #666.18 + movups 1600+__jsvml_slog10_ha_data_internal(%rip), %xmm8 #668.44 movaps %xmm3, %xmm6 #667.18 mulps %xmm8, %xmm12 #669.17 - lea -136944+__svml_slog10_ha_data_internal(%rip), %r8 #681.61 - cmpnleps 1472+__svml_slog10_ha_data_internal(%rip), %xmm6 #667.18 + lea -136944+__jsvml_slog10_ha_data_internal(%rip), %r8 #681.61 + cmpnleps 1472+__jsvml_slog10_ha_data_internal(%rip), %xmm6 #667.18 movups .L_2il0floatpacket.20(%rip), %xmm4 #670.105 orps %xmm6, %xmm7 #672.18 - movups 1536+__svml_slog10_ha_data_internal(%rip), %xmm9 #675.49 + movups 1536+__jsvml_slog10_ha_data_internal(%rip), %xmm9 #675.49 addps %xmm4, %xmm12 #670.162 movmskps %xmm7, %eax #674.44 andps %xmm2, %xmm9 #676.118 @@ -551,13 +551,13 @@ __svml_log10f4_ha_ex: pshufd $3, %xmm12, %xmm13 #681.914 movd %xmm11, %esi #681.645 movd %xmm13, %edi #681.896 - movups 1088+__svml_slog10_ha_data_internal(%rip), %xmm9 #687.54 - movups 1664+__svml_slog10_ha_data_internal(%rip), %xmm5 #685.25 + movups 1088+__jsvml_slog10_ha_data_internal(%rip), %xmm9 #687.54 + movups 1664+__jsvml_slog10_ha_data_internal(%rip), %xmm5 #685.25 movslq %edx, %rdx #681.61 movslq %ecx, %rcx #681.272 mulps %xmm2, %xmm9 #690.26 mulps %xmm0, %xmm5 #685.25 - addps 1152+__svml_slog10_ha_data_internal(%rip), %xmm9 #690.14 + addps 1152+__jsvml_slog10_ha_data_internal(%rip), %xmm9 #690.14 movslq %esi, %rsi #681.523 movslq %edi, %rdi #681.774 movq (%r8,%rdx), %xmm1 #681.61 @@ -567,13 +567,13 @@ __svml_log10f4_ha_ex: unpcklps %xmm14, %xmm1 #681.978 unpcklps %xmm15, %xmm4 #681.1013 movaps %xmm1, %xmm7 #681.1053 - movups 1728+__svml_slog10_ha_data_internal(%rip), %xmm6 #684.44 + movups 1728+__jsvml_slog10_ha_data_internal(%rip), %xmm6 #684.44 movlhps %xmm4, %xmm7 #681.1053 mulps %xmm6, %xmm0 #686.25 addps %xmm5, %xmm7 #685.13 mulps %xmm2, %xmm9 #691.25 shufps $238, %xmm4, %xmm1 #681.1097 - addps 1216+__svml_slog10_ha_data_internal(%rip), %xmm9 #691.13 + addps 1216+__jsvml_slog10_ha_data_internal(%rip), %xmm9 #691.13 addps %xmm0, %xmm1 #686.13 movaps %xmm2, %xmm0 #692.17 mulps %xmm9, %xmm2 #695.25 @@ -638,29 +638,29 @@ __svml_log10f4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #699.540 lea 128(%rsp,%r12,4), %rsi #699.540 -..___tag_value___svml_log10f4_ha_ex.82: -# __svml_slog10_ha_cout_rare_internal(const float *, float *) - call __svml_slog10_ha_cout_rare_internal #699.540 -..___tag_value___svml_log10f4_ha_ex.83: +..___tag_value___jsvml_log10f4_ha_ex.82: +# __jsvml_slog10_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog10_ha_cout_rare_internal #699.540 +..___tag_value___jsvml_log10f4_ha_ex.83: jmp ..B4.8 # Prob 100% #699.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log10f4_ha_ex,@function - .size __svml_log10f4_ha_ex,.-__svml_log10f4_ha_ex -..LN__svml_log10f4_ha_ex.3: + .type __jsvml_log10f4_ha_ex,@function + .size __jsvml_log10f4_ha_ex,.-__jsvml_log10f4_ha_ex +..LN__jsvml_log10f4_ha_ex.3: .data -# -- End __svml_log10f4_ha_ex +# -- End __jsvml_log10f4_ha_ex .text -.L_2__routine_start___svml_log10f16_ha_z0_4: -# -- Begin __svml_log10f16_ha_z0 +.L_2__routine_start___jsvml_log10f16_ha_z0_4: +# -- Begin __jsvml_log10f16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_log10f16_ha_z0 -# --- __svml_log10f16_ha_z0(__m512) -__svml_log10f16_ha_z0: + .globl __jsvml_log10f16_ha_z0 +# --- __jsvml_log10f16_ha_z0(__m512) +__jsvml_log10f16_ha_z0: # parameter 1: %zmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -669,34 +669,34 @@ __svml_log10f16_ha_z0: .byte 30 #783.12 .byte 250 #783.12 .cfi_startproc -..___tag_value___svml_log10f16_ha_z0.85: +..___tag_value___jsvml_log10f16_ha_z0.85: ..L86: #707.1 vmovaps %zmm0, %zmm2 #707.1 vgetmantps $10, {sae}, %zmm2, %zmm4 #745.33 - vmovups 256+__svml_slog10_ha_data_internal_avx512(%rip), %zmm1 #752.24 + vmovups 256+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm1 #752.24 vgetexpps {sae}, %zmm2, %zmm7 #746.30 - vmovups __svml_slog10_ha_data_internal_avx512(%rip), %zmm0 #755.298 - vmovups 320+__svml_slog10_ha_data_internal_avx512(%rip), %zmm12 #762.66 - vmovups 640+__svml_slog10_ha_data_internal_avx512(%rip), %zmm9 #758.58 - vmovups 448+__svml_slog10_ha_data_internal_avx512(%rip), %zmm13 #766.66 - vmovups 512+__svml_slog10_ha_data_internal_avx512(%rip), %zmm15 #767.67 - vmovups 128+__svml_slog10_ha_data_internal_avx512(%rip), %zmm11 #756.298 - vmovups 704+__svml_slog10_ha_data_internal_avx512(%rip), %zmm10 #760.58 + vmovups __jsvml_slog10_ha_data_internal_avx512(%rip), %zmm0 #755.298 + vmovups 320+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm12 #762.66 + vmovups 640+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm9 #758.58 + vmovups 448+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm13 #766.66 + vmovups 512+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm15 #767.67 + vmovups 128+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm11 #756.298 + vmovups 704+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm10 #760.58 vrcp14ps %zmm4, %zmm3 #748.29 vfpclassps $94, %zmm2, %k1 #747.36 vrndscaleps $88, {sae}, %zmm3, %zmm5 #749.29 vgetexpps {sae}, %zmm5, %zmm8 #750.31 vfmsub231ps {rn-sae}, %zmm5, %zmm4, %zmm1 #752.24 - vmovups 384+__svml_slog10_ha_data_internal_avx512(%rip), %zmm4 #763.66 + vmovups 384+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm4 #763.66 vpsrld $18, %zmm5, %zmm6 #753.50 vsubps {rn-sae}, %zmm8, %zmm7, %zmm3 #757.30 vfmadd231ps {rn-sae}, %zmm1, %zmm12, %zmm4 #764.24 - vmovups 576+__svml_slog10_ha_data_internal_avx512(%rip), %zmm12 #769.67 + vmovups 576+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm12 #769.67 vfmadd231ps {rn-sae}, %zmm1, %zmm13, %zmm15 #768.26 vmulps {rn-sae}, %zmm1, %zmm1, %zmm14 #765.27 - vpermt2ps 64+__svml_slog10_ha_data_internal_avx512(%rip), %zmm6, %zmm0 #755.298 - vpermt2ps 192+__svml_slog10_ha_data_internal_avx512(%rip), %zmm6, %zmm11 #756.298 + vpermt2ps 64+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm6, %zmm0 #755.298 + vpermt2ps 192+__jsvml_slog10_ha_data_internal_avx512(%rip), %zmm6, %zmm11 #756.298 vfmadd213ps {rn-sae}, %zmm15, %zmm14, %zmm4 #771.24 vfmadd231ps {rn-sae}, %zmm3, %zmm9, %zmm0 #759.25 vfmadd213ps {rn-sae}, %zmm11, %zmm10, %zmm3 #761.25 @@ -713,20 +713,20 @@ __svml_log10f16_ha_z0: # LOE .cfi_endproc # mark_end; - .type __svml_log10f16_ha_z0,@function - .size __svml_log10f16_ha_z0,.-__svml_log10f16_ha_z0 -..LN__svml_log10f16_ha_z0.4: + .type __jsvml_log10f16_ha_z0,@function + .size __jsvml_log10f16_ha_z0,.-__jsvml_log10f16_ha_z0 +..LN__jsvml_log10f16_ha_z0.4: .data -# -- End __svml_log10f16_ha_z0 +# -- End __jsvml_log10f16_ha_z0 .text -.L_2__routine_start___svml_log10f8_ha_e9_5: -# -- Begin __svml_log10f8_ha_e9 +.L_2__routine_start___jsvml_log10f8_ha_e9_5: +# -- Begin __jsvml_log10f8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log10f8_ha_e9 -# --- __svml_log10f8_ha_e9(__m256) -__svml_log10f8_ha_e9: + .globl __jsvml_log10f8_ha_e9 +# --- __jsvml_log10f8_ha_e9(__m256) +__jsvml_log10f8_ha_e9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -735,7 +735,7 @@ __svml_log10f8_ha_e9: .byte 30 #1173.546 .byte 250 #1173.546 .cfi_startproc -..___tag_value___svml_log10f8_ha_e9.88: +..___tag_value___jsvml_log10f8_ha_e9.88: ..L89: #1098.1 pushq %rbp #1098.1 @@ -745,23 +745,23 @@ __svml_log10f8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1098.1 subq $192, %rsp #1098.1 - lea -136944+__svml_slog10_ha_data_internal(%rip), %rax #1155.42 + lea -136944+__jsvml_slog10_ha_data_internal(%rip), %rax #1155.42 vmovaps %ymm0, %ymm5 #1098.1 - vandps 1280+__svml_slog10_ha_data_internal(%rip), %ymm5, %ymm6 #1133.19 - vorps 1344+__svml_slog10_ha_data_internal(%rip), %ymm6, %ymm4 #1134.19 + vandps 1280+__jsvml_slog10_ha_data_internal(%rip), %ymm5, %ymm6 #1133.19 + vorps 1344+__jsvml_slog10_ha_data_internal(%rip), %ymm6, %ymm4 #1134.19 vrcpps %ymm4, %ymm7 #1137.17 - vmovups 1600+__svml_slog10_ha_data_internal(%rip), %ymm3 #1142.47 + vmovups 1600+__jsvml_slog10_ha_data_internal(%rip), %ymm3 #1142.47 vmulps %ymm3, %ymm7, %ymm8 #1143.17 vpxor %xmm7, %xmm7, %xmm7 #1148.62 vroundps $0, %ymm8, %ymm2 #1144.17 vpsrld $23, %xmm5, %xmm9 #1139.23 vextractf128 $1, %ymm5, %xmm10 #1138.113 - vcmplt_oqps 1408+__svml_slog10_ha_data_internal(%rip), %ymm5, %ymm13 #1140.18 - vcmpnle_uqps 1472+__svml_slog10_ha_data_internal(%rip), %ymm5, %ymm14 #1141.18 + vcmplt_oqps 1408+__jsvml_slog10_ha_data_internal(%rip), %ymm5, %ymm13 #1140.18 + vcmpnle_uqps 1472+__jsvml_slog10_ha_data_internal(%rip), %ymm5, %ymm14 #1141.18 vpsrld $23, %xmm10, %xmm11 #1139.80 vorps %ymm14, %ymm13, %ymm15 #1146.18 vinsertf128 $1, %xmm11, %ymm9, %ymm12 #1145.38 - vandps 1536+__svml_slog10_ha_data_internal(%rip), %ymm4, %ymm9 #1150.118 + vandps 1536+__jsvml_slog10_ha_data_internal(%rip), %ymm4, %ymm9 #1150.118 vsubps %ymm9, %ymm4, %ymm4 #1150.175 vcvtdq2ps %ymm12, %ymm1 #1145.18 vmulps %ymm9, %ymm2, %ymm10 #1150.231 @@ -796,8 +796,8 @@ __svml_log10f8_ha_e9: vpacksswb %xmm7, %xmm6, %xmm8 #1148.62 vmovq (%rax,%r8), %xmm6 #1155.648 vunpcklps %xmm6, %xmm4, %xmm13 #1155.1701 - vmulps 1664+__svml_slog10_ha_data_internal(%rip), %ymm1, %ymm4 #1159.28 - vmulps 1728+__svml_slog10_ha_data_internal(%rip), %ymm1, %ymm1 #1160.28 + vmulps 1664+__jsvml_slog10_ha_data_internal(%rip), %ymm1, %ymm4 #1159.28 + vmulps 1728+__jsvml_slog10_ha_data_internal(%rip), %ymm1, %ymm1 #1160.28 vmovq (%rax,%r9), %xmm7 #1155.851 vaddps %ymm3, %ymm11, %ymm0 #1150.380 vmovq (%rax,%rdi), %xmm3 #1155.445 @@ -809,13 +809,13 @@ __svml_log10f8_ha_e9: vinsertf128 $1, %xmm14, %ymm13, %ymm2 #1155.1982 vunpckhps %ymm2, %ymm15, %ymm6 #1155.2147 vaddps %ymm1, %ymm6, %ymm8 #1160.13 - vmulps 1088+__svml_slog10_ha_data_internal(%rip), %ymm0, %ymm1 #1164.29 - vaddps 1152+__svml_slog10_ha_data_internal(%rip), %ymm1, %ymm6 #1164.14 + vmulps 1088+__jsvml_slog10_ha_data_internal(%rip), %ymm0, %ymm1 #1164.29 + vaddps 1152+__jsvml_slog10_ha_data_internal(%rip), %ymm1, %ymm6 #1164.14 vunpcklps %ymm2, %ymm15, %ymm3 #1155.2073 vaddps %ymm4, %ymm3, %ymm7 #1159.13 vmulps %ymm6, %ymm0, %ymm2 #1165.28 vaddps %ymm7, %ymm0, %ymm11 #1166.17 - vaddps 1216+__svml_slog10_ha_data_internal(%rip), %ymm2, %ymm4 #1165.13 + vaddps 1216+__jsvml_slog10_ha_data_internal(%rip), %ymm2, %ymm4 #1165.13 vsubps %ymm7, %ymm11, %ymm3 #1167.13 vsubps %ymm3, %ymm0, %ymm9 #1168.13 vmulps %ymm4, %ymm0, %ymm0 #1169.28 @@ -882,30 +882,30 @@ __svml_log10f8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1173.546 lea 128(%rsp,%r12,4), %rsi #1173.546 -..___tag_value___svml_log10f8_ha_e9.106: -# __svml_slog10_ha_cout_rare_internal(const float *, float *) - call __svml_slog10_ha_cout_rare_internal #1173.546 -..___tag_value___svml_log10f8_ha_e9.107: +..___tag_value___jsvml_log10f8_ha_e9.106: +# __jsvml_slog10_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog10_ha_cout_rare_internal #1173.546 +..___tag_value___jsvml_log10f8_ha_e9.107: jmp ..B6.8 # Prob 100% #1173.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log10f8_ha_e9,@function - .size __svml_log10f8_ha_e9,.-__svml_log10f8_ha_e9 -..LN__svml_log10f8_ha_e9.5: + .type __jsvml_log10f8_ha_e9,@function + .size __jsvml_log10f8_ha_e9,.-__jsvml_log10f8_ha_e9 +..LN__jsvml_log10f8_ha_e9.5: .data -# -- End __svml_log10f8_ha_e9 +# -- End __jsvml_log10f8_ha_e9 .text -.L_2__routine_start___svml_slog10_ha_cout_rare_internal_6: -# -- Begin __svml_slog10_ha_cout_rare_internal +.L_2__routine_start___jsvml_slog10_ha_cout_rare_internal_6: +# -- Begin __jsvml_slog10_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_slog10_ha_cout_rare_internal - .globl __svml_slog10_ha_cout_rare_internal -# --- __svml_slog10_ha_cout_rare_internal(const float *, float *) -__svml_slog10_ha_cout_rare_internal: + .hidden __jsvml_slog10_ha_cout_rare_internal + .globl __jsvml_slog10_ha_cout_rare_internal +# --- __jsvml_slog10_ha_cout_rare_internal(const float *, float *) +__jsvml_slog10_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -915,7 +915,7 @@ __svml_slog10_ha_cout_rare_internal: .byte 30 #1085.19 .byte 250 #1085.19 .cfi_startproc -..___tag_value___svml_slog10_ha_cout_rare_internal.109: +..___tag_value___jsvml_slog10_ha_cout_rare_internal.109: ..L110: #1004.1 xorl %eax, %eax #1015.14 @@ -1099,17 +1099,17 @@ __svml_slog10_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_slog10_ha_cout_rare_internal,@function - .size __svml_slog10_ha_cout_rare_internal,.-__svml_slog10_ha_cout_rare_internal -..LN__svml_slog10_ha_cout_rare_internal.6: + .type __jsvml_slog10_ha_cout_rare_internal,@function + .size __jsvml_slog10_ha_cout_rare_internal,.-__jsvml_slog10_ha_cout_rare_internal +..LN__jsvml_slog10_ha_cout_rare_internal.6: .data -# -- End __svml_slog10_ha_cout_rare_internal +# -- End __jsvml_slog10_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_slog10_ha_data_internal_avx512 - .globl __svml_slog10_ha_data_internal_avx512 -__svml_slog10_ha_data_internal_avx512: + .hidden __jsvml_slog10_ha_data_internal_avx512 + .globl __jsvml_slog10_ha_data_internal_avx512 +__jsvml_slog10_ha_data_internal_avx512: .long 1050288128 .long 1049839616 .long 1049405440 @@ -1350,12 +1350,12 @@ __svml_slog10_ha_data_internal_avx512: .long 124 .long 124 .long 124 - .type __svml_slog10_ha_data_internal_avx512,@object - .size __svml_slog10_ha_data_internal_avx512,960 + .type __jsvml_slog10_ha_data_internal_avx512,@object + .size __jsvml_slog10_ha_data_internal_avx512,960 .align 64 - .hidden __svml_slog10_ha_data_internal - .globl __svml_slog10_ha_data_internal -__svml_slog10_ha_data_internal: + .hidden __jsvml_slog10_ha_data_internal + .globl __jsvml_slog10_ha_data_internal +__jsvml_slog10_ha_data_internal: .long 3256334460 .long 969394728 .long 3256334974 @@ -2308,8 +2308,8 @@ __svml_slog10_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_slog10_ha_data_internal,@object - .size __svml_slog10_ha_data_internal,3136 + .type __jsvml_slog10_ha_data_internal,@object + .size __jsvml_slog10_ha_data_internal,3136 .align 32 _vmldLgHATab: .long 1121868800 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_log1p_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log1p_linux_x86.S similarity index 89% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_log1p_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log1p_linux_x86.S index 01ed49653dd..75b195b1b3b 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_log1p_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log1p_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_log1p.c" .text ..TXTST0: -.L_2__routine_start___svml_log1pf4_ha_e9_0: -# -- Begin __svml_log1pf4_ha_e9 +.L_2__routine_start___jsvml_log1pf4_ha_e9_0: +# -- Begin __jsvml_log1pf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1pf4_ha_e9 -# --- __svml_log1pf4_ha_e9(__m128) -__svml_log1pf4_ha_e9: + .globl __jsvml_log1pf4_ha_e9 +# --- __jsvml_log1pf4_ha_e9(__m128) +__jsvml_log1pf4_ha_e9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_log1pf4_ha_e9: .byte 30 #439.540 .byte 250 #439.540 .cfi_startproc -..___tag_value___svml_log1pf4_ha_e9.1: +..___tag_value___jsvml_log1pf4_ha_e9.1: ..L2: #325.1 pushq %rbp #325.1 @@ -58,39 +58,39 @@ __svml_log1pf4_ha_e9: andq $-64, %rsp #325.1 subq $192, %rsp #325.1 movaps %xmm0, %xmm8 #325.1 - movups 1984+__svml_slog1p_ha_data_internal(%rip), %xmm4 #374.44 - lea -137216+__svml_slog1p_ha_data_internal(%rip), %r8 #420.61 + movups 1984+__jsvml_slog1p_ha_data_internal(%rip), %xmm4 #374.44 + lea -137216+__jsvml_slog1p_ha_data_internal(%rip), %r8 #420.61 movaps %xmm4, %xmm10 #379.12 movaps %xmm4, %xmm6 #380.12 maxps %xmm8, %xmm10 #379.12 minps %xmm8, %xmm6 #380.12 - movups 1088+__svml_slog1p_ha_data_internal(%rip), %xmm9 #375.48 + movups 1088+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #375.48 movaps %xmm10, %xmm5 #384.12 movaps %xmm9, %xmm7 #378.19 andps %xmm8, %xmm9 #381.15 - cmpltps 1152+__svml_slog1p_ha_data_internal(%rip), %xmm9 #382.16 + cmpltps 1152+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #382.16 addps %xmm6, %xmm5 #384.12 - orps 1216+__svml_slog1p_ha_data_internal(%rip), %xmm9 #383.17 + orps 1216+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #383.17 movaps %xmm8, %xmm15 #402.18 - movups 1536+__svml_slog1p_ha_data_internal(%rip), %xmm11 #390.19 + movups 1536+__jsvml_slog1p_ha_data_internal(%rip), %xmm11 #390.19 andps %xmm9, %xmm5 #385.12 andps %xmm5, %xmm11 #390.19 movaps %xmm5, %xmm13 #401.23 - orps 1600+__svml_slog1p_ha_data_internal(%rip), %xmm11 #391.19 + orps 1600+__jsvml_slog1p_ha_data_internal(%rip), %xmm11 #391.19 psrld $23, %xmm13 #401.23 rcpps %xmm11, %xmm3 #396.17 cvtdq2ps %xmm13, %xmm0 #407.18 - cmpltps 1664+__svml_slog1p_ha_data_internal(%rip), %xmm15 #402.18 + cmpltps 1664+__jsvml_slog1p_ha_data_internal(%rip), %xmm15 #402.18 subps %xmm5, %xmm10 #386.13 - movups 1280+__svml_slog1p_ha_data_internal(%rip), %xmm12 #398.21 + movups 1280+__jsvml_slog1p_ha_data_internal(%rip), %xmm12 #398.21 movaps %xmm8, %xmm14 #403.18 - movups 1344+__svml_slog1p_ha_data_internal(%rip), %xmm2 #399.21 + movups 1344+__jsvml_slog1p_ha_data_internal(%rip), %xmm2 #399.21 andps %xmm5, %xmm12 #398.21 roundps $0, %xmm3, %xmm3 #404.17 psubd %xmm12, %xmm2 #399.21 mulps %xmm3, %xmm2 #406.18 addps %xmm10, %xmm6 #387.13 - cmpnleps 1728+__svml_slog1p_ha_data_internal(%rip), %xmm14 #403.18 + cmpnleps 1728+__jsvml_slog1p_ha_data_internal(%rip), %xmm14 #403.18 mulps %xmm2, %xmm5 #411.25 mulps %xmm2, %xmm6 #412.13 subps %xmm4, %xmm5 #411.13 @@ -98,9 +98,9 @@ __svml_log1pf4_ha_e9: psrld $13, %xmm3 #417.22 movd %xmm3, %edx #420.181 orps %xmm14, %xmm15 #408.18 - movups 1920+__svml_slog1p_ha_data_internal(%rip), %xmm10 #423.44 + movups 1920+__jsvml_slog1p_ha_data_internal(%rip), %xmm10 #423.44 andnps %xmm8, %xmm7 #378.19 - movups 1856+__svml_slog1p_ha_data_internal(%rip), %xmm9 #424.25 + movups 1856+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #424.25 addps %xmm6, %xmm2 #413.12 mulps %xmm0, %xmm9 #424.25 mulps %xmm10, %xmm0 #425.25 @@ -115,14 +115,14 @@ __svml_log1pf4_ha_e9: movslq %ecx, %rcx #420.272 movslq %esi, %rsi #420.486 movslq %edi, %rdi #420.700 - movups 1408+__svml_slog1p_ha_data_internal(%rip), %xmm11 #426.54 + movups 1408+__jsvml_slog1p_ha_data_internal(%rip), %xmm11 #426.54 mulps %xmm2, %xmm11 #428.25 movq (%r8,%rdx), %xmm1 #420.61 movq (%r8,%rcx), %xmm4 #420.272 movq (%r8,%rsi), %xmm5 #420.486 movq (%r8,%rdi), %xmm3 #420.700 unpcklps %xmm4, %xmm1 #420.867 - addps 1472+__svml_slog1p_ha_data_internal(%rip), %xmm11 #428.13 + addps 1472+__jsvml_slog1p_ha_data_internal(%rip), %xmm11 #428.13 unpcklps %xmm3, %xmm5 #420.902 movaps %xmm1, %xmm12 #420.942 shufps $238, %xmm5, %xmm1 #420.986 @@ -196,29 +196,29 @@ __svml_log1pf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #439.540 lea 128(%rsp,%r12,4), %rsi #439.540 -..___tag_value___svml_log1pf4_ha_e9.19: -# __svml_slog1p_ha_cout_rare_internal(const float *, float *) - call __svml_slog1p_ha_cout_rare_internal #439.540 -..___tag_value___svml_log1pf4_ha_e9.20: +..___tag_value___jsvml_log1pf4_ha_e9.19: +# __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog1p_ha_cout_rare_internal #439.540 +..___tag_value___jsvml_log1pf4_ha_e9.20: jmp ..B1.8 # Prob 100% #439.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1pf4_ha_e9,@function - .size __svml_log1pf4_ha_e9,.-__svml_log1pf4_ha_e9 -..LN__svml_log1pf4_ha_e9.0: + .type __jsvml_log1pf4_ha_e9,@function + .size __jsvml_log1pf4_ha_e9,.-__jsvml_log1pf4_ha_e9 +..LN__jsvml_log1pf4_ha_e9.0: .data -# -- End __svml_log1pf4_ha_e9 +# -- End __jsvml_log1pf4_ha_e9 .text -.L_2__routine_start___svml_log1pf8_ha_l9_1: -# -- Begin __svml_log1pf8_ha_l9 +.L_2__routine_start___jsvml_log1pf8_ha_l9_1: +# -- Begin __jsvml_log1pf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1pf8_ha_l9 -# --- __svml_log1pf8_ha_l9(__m256) -__svml_log1pf8_ha_l9: + .globl __jsvml_log1pf8_ha_l9 +# --- __jsvml_log1pf8_ha_l9(__m256) +__jsvml_log1pf8_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -227,7 +227,7 @@ __svml_log1pf8_ha_l9: .byte 30 #561.546 .byte 250 #561.546 .cfi_startproc -..___tag_value___svml_log1pf8_ha_l9.22: +..___tag_value___jsvml_log1pf8_ha_l9.22: ..L23: #447.1 pushq %rbp #447.1 @@ -237,30 +237,30 @@ __svml_log1pf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #447.1 subq $192, %rsp #447.1 - lea -137216+__svml_slog1p_ha_data_internal(%rip), %rax #542.64 - vmovups 1984+__svml_slog1p_ha_data_internal(%rip), %ymm8 #496.47 - vmovups 1088+__svml_slog1p_ha_data_internal(%rip), %ymm11 #497.51 + lea -137216+__jsvml_slog1p_ha_data_internal(%rip), %rax #542.64 + vmovups 1984+__jsvml_slog1p_ha_data_internal(%rip), %ymm8 #496.47 + vmovups 1088+__jsvml_slog1p_ha_data_internal(%rip), %ymm11 #497.51 vmovaps %ymm0, %ymm10 #447.1 vmaxps %ymm10, %ymm8, %ymm4 #501.12 vminps %ymm10, %ymm8, %ymm3 #502.12 vandps %ymm11, %ymm10, %ymm12 #503.15 - vcmplt_oqps 1152+__svml_slog1p_ha_data_internal(%rip), %ymm12, %ymm13 #504.16 + vcmplt_oqps 1152+__jsvml_slog1p_ha_data_internal(%rip), %ymm12, %ymm13 #504.16 vaddps %ymm3, %ymm4, %ymm14 #506.12 - vorps 1216+__svml_slog1p_ha_data_internal(%rip), %ymm13, %ymm15 #505.17 + vorps 1216+__jsvml_slog1p_ha_data_internal(%rip), %ymm13, %ymm15 #505.17 vandps %ymm15, %ymm14, %ymm7 #507.12 - vandps 1536+__svml_slog1p_ha_data_internal(%rip), %ymm7, %ymm0 #512.19 - vorps 1600+__svml_slog1p_ha_data_internal(%rip), %ymm0, %ymm1 #513.19 + vandps 1536+__jsvml_slog1p_ha_data_internal(%rip), %ymm7, %ymm0 #512.19 + vorps 1600+__jsvml_slog1p_ha_data_internal(%rip), %ymm0, %ymm1 #513.19 vrcpps %ymm1, %ymm5 #518.17 vpsrld $23, %ymm7, %ymm14 #523.19 vsubps %ymm7, %ymm4, %ymm2 #508.13 vroundps $0, %ymm5, %ymm5 #526.17 - vcmplt_oqps 1664+__svml_slog1p_ha_data_internal(%rip), %ymm10, %ymm15 #524.18 + vcmplt_oqps 1664+__jsvml_slog1p_ha_data_internal(%rip), %ymm10, %ymm15 #524.18 vaddps %ymm2, %ymm3, %ymm6 #509.13 - vcmpnle_uqps 1728+__svml_slog1p_ha_data_internal(%rip), %ymm10, %ymm3 #525.18 + vcmpnle_uqps 1728+__jsvml_slog1p_ha_data_internal(%rip), %ymm10, %ymm3 #525.18 vcvtdq2ps %ymm14, %ymm4 #529.18 vandnps %ymm10, %ymm11, %ymm9 #500.19 - vmovups 1344+__svml_slog1p_ha_data_internal(%rip), %ymm11 #517.21 - vandps 1280+__svml_slog1p_ha_data_internal(%rip), %ymm7, %ymm12 #520.17 + vmovups 1344+__jsvml_slog1p_ha_data_internal(%rip), %ymm11 #517.21 + vandps 1280+__jsvml_slog1p_ha_data_internal(%rip), %ymm7, %ymm12 #520.17 vpsubd %ymm12, %ymm11, %ymm13 #521.17 vmulps %ymm13, %ymm5, %ymm0 #528.18 vfmsub213ps %ymm8, %ymm0, %ymm7 #533.13 @@ -300,17 +300,17 @@ __svml_log1pf8_ha_l9: vunpcklps %xmm11, %xmm1, %xmm5 #542.2057 vunpcklps %xmm13, %xmm12, %xmm1 #542.2112 vunpcklps %xmm14, %xmm0, %xmm0 #542.2167 - vmovups 1408+__svml_slog1p_ha_data_internal(%rip), %ymm8 #548.57 + vmovups 1408+__jsvml_slog1p_ha_data_internal(%rip), %ymm8 #548.57 vmulps %ymm3, %ymm3, %ymm6 #551.14 - vfmadd213ps 1472+__svml_slog1p_ha_data_internal(%rip), %ymm3, %ymm8 #550.13 + vfmadd213ps 1472+__jsvml_slog1p_ha_data_internal(%rip), %ymm3, %ymm8 #550.13 vfmadd213ps %ymm2, %ymm6, %ymm8 #552.13 vinsertf128 $1, %xmm1, %ymm15, %ymm1 #542.2230 vinsertf128 $1, %xmm0, %ymm5, %ymm0 #542.2338 vunpcklps %ymm0, %ymm1, %ymm7 #542.2429 - vfmadd231ps 1856+__svml_slog1p_ha_data_internal(%rip), %ymm4, %ymm7 #546.13 + vfmadd231ps 1856+__jsvml_slog1p_ha_data_internal(%rip), %ymm4, %ymm7 #546.13 vunpckhps %ymm0, %ymm1, %ymm5 #542.2503 vaddps %ymm7, %ymm3, %ymm0 #553.17 - vfmadd132ps 1920+__svml_slog1p_ha_data_internal(%rip), %ymm5, %ymm4 #547.13 + vfmadd132ps 1920+__jsvml_slog1p_ha_data_internal(%rip), %ymm5, %ymm4 #547.13 vsubps %ymm7, %ymm0, %ymm2 #554.13 vsubps %ymm2, %ymm3, %ymm3 #555.13 vaddps %ymm3, %ymm4, %ymm4 #556.13 @@ -376,29 +376,29 @@ __svml_log1pf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #561.546 lea 128(%rsp,%r12,4), %rsi #561.546 -..___tag_value___svml_log1pf8_ha_l9.40: -# __svml_slog1p_ha_cout_rare_internal(const float *, float *) - call __svml_slog1p_ha_cout_rare_internal #561.546 -..___tag_value___svml_log1pf8_ha_l9.41: +..___tag_value___jsvml_log1pf8_ha_l9.40: +# __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog1p_ha_cout_rare_internal #561.546 +..___tag_value___jsvml_log1pf8_ha_l9.41: jmp ..B2.8 # Prob 100% #561.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1pf8_ha_l9,@function - .size __svml_log1pf8_ha_l9,.-__svml_log1pf8_ha_l9 -..LN__svml_log1pf8_ha_l9.1: + .type __jsvml_log1pf8_ha_l9,@function + .size __jsvml_log1pf8_ha_l9,.-__jsvml_log1pf8_ha_l9 +..LN__jsvml_log1pf8_ha_l9.1: .data -# -- End __svml_log1pf8_ha_l9 +# -- End __jsvml_log1pf8_ha_l9 .text -.L_2__routine_start___svml_log1pf4_ha_l9_2: -# -- Begin __svml_log1pf4_ha_l9 +.L_2__routine_start___jsvml_log1pf4_ha_l9_2: +# -- Begin __jsvml_log1pf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1pf4_ha_l9 -# --- __svml_log1pf4_ha_l9(__m128) -__svml_log1pf4_ha_l9: + .globl __jsvml_log1pf4_ha_l9 +# --- __jsvml_log1pf4_ha_l9(__m128) +__jsvml_log1pf4_ha_l9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -407,7 +407,7 @@ __svml_log1pf4_ha_l9: .byte 30 #683.540 .byte 250 #683.540 .cfi_startproc -..___tag_value___svml_log1pf4_ha_l9.43: +..___tag_value___jsvml_log1pf4_ha_l9.43: ..L44: #569.1 pushq %rbp #569.1 @@ -418,34 +418,34 @@ __svml_log1pf4_ha_l9: andq $-64, %rsp #569.1 subq $192, %rsp #569.1 vmovaps %xmm0, %xmm8 #569.1 - vmovups 1984+__svml_slog1p_ha_data_internal(%rip), %xmm6 #618.44 - lea -137216+__svml_slog1p_ha_data_internal(%rip), %r8 #664.61 + vmovups 1984+__jsvml_slog1p_ha_data_internal(%rip), %xmm6 #618.44 + lea -137216+__jsvml_slog1p_ha_data_internal(%rip), %r8 #664.61 vmaxps %xmm8, %xmm6, %xmm14 #623.12 vminps %xmm8, %xmm6, %xmm15 #624.12 - vmovups 1088+__svml_slog1p_ha_data_internal(%rip), %xmm9 #619.48 + vmovups 1088+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #619.48 vaddps %xmm15, %xmm14, %xmm12 #628.12 vandps %xmm9, %xmm8, %xmm10 #625.15 vandnps %xmm8, %xmm9, %xmm7 #622.19 - vcmpltps 1152+__svml_slog1p_ha_data_internal(%rip), %xmm10, %xmm11 #626.16 - vorps 1216+__svml_slog1p_ha_data_internal(%rip), %xmm11, %xmm13 #627.17 + vcmpltps 1152+__jsvml_slog1p_ha_data_internal(%rip), %xmm10, %xmm11 #626.16 + vorps 1216+__jsvml_slog1p_ha_data_internal(%rip), %xmm11, %xmm13 #627.17 vandps %xmm13, %xmm12, %xmm5 #629.12 - vandps 1536+__svml_slog1p_ha_data_internal(%rip), %xmm5, %xmm1 #634.19 + vandps 1536+__jsvml_slog1p_ha_data_internal(%rip), %xmm5, %xmm1 #634.19 vpsrld $23, %xmm5, %xmm12 #645.19 - vorps 1600+__svml_slog1p_ha_data_internal(%rip), %xmm1, %xmm0 #635.19 + vorps 1600+__jsvml_slog1p_ha_data_internal(%rip), %xmm1, %xmm0 #635.19 vsubps %xmm5, %xmm14, %xmm2 #630.13 vrcpps %xmm0, %xmm3 #640.17 - vcmpltps 1664+__svml_slog1p_ha_data_internal(%rip), %xmm8, %xmm13 #646.18 - vcmpnleps 1728+__svml_slog1p_ha_data_internal(%rip), %xmm8, %xmm14 #647.18 + vcmpltps 1664+__jsvml_slog1p_ha_data_internal(%rip), %xmm8, %xmm13 #646.18 + vcmpnleps 1728+__jsvml_slog1p_ha_data_internal(%rip), %xmm8, %xmm14 #647.18 vaddps %xmm2, %xmm15, %xmm4 #631.13 vcvtdq2ps %xmm12, %xmm2 #651.18 - vmovups 1344+__svml_slog1p_ha_data_internal(%rip), %xmm9 #639.21 + vmovups 1344+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #639.21 vorps %xmm14, %xmm13, %xmm15 #652.18 - vandps 1280+__svml_slog1p_ha_data_internal(%rip), %xmm5, %xmm10 #642.17 + vandps 1280+__jsvml_slog1p_ha_data_internal(%rip), %xmm5, %xmm10 #642.17 vroundps $0, %xmm3, %xmm3 #648.17 vpsubd %xmm10, %xmm9, %xmm11 #643.17 vmulps %xmm11, %xmm3, %xmm1 #650.18 vmovmskps %xmm15, %eax #654.44 - vmovups 1408+__svml_slog1p_ha_data_internal(%rip), %xmm14 #670.54 + vmovups 1408+__jsvml_slog1p_ha_data_internal(%rip), %xmm14 #670.54 vfmsub213ps %xmm6, %xmm1, %xmm5 #655.13 vpsrld $13, %xmm3, %xmm6 #661.18 vmulps %xmm1, %xmm4, %xmm4 #656.13 @@ -453,7 +453,7 @@ __svml_log1pf4_ha_l9: vaddps %xmm4, %xmm5, %xmm1 #657.12 vpextrd $1, %xmm6, %ecx #664.392 vsubps %xmm5, %xmm1, %xmm5 #658.14 - vfmadd213ps 1472+__svml_slog1p_ha_data_internal(%rip), %xmm1, %xmm14 #672.13 + vfmadd213ps 1472+__jsvml_slog1p_ha_data_internal(%rip), %xmm1, %xmm14 #672.13 vmulps %xmm1, %xmm1, %xmm12 #673.14 vsubps %xmm5, %xmm4, %xmm0 #659.13 vpextrd $2, %xmm6, %esi #664.606 @@ -469,10 +469,10 @@ __svml_log1pf4_ha_l9: vunpcklps %xmm4, %xmm3, %xmm9 #664.867 vunpcklps %xmm6, %xmm5, %xmm10 #664.902 vmovlhps %xmm10, %xmm9, %xmm13 #664.942 - vfmadd231ps 1856+__svml_slog1p_ha_data_internal(%rip), %xmm2, %xmm13 #668.13 + vfmadd231ps 1856+__jsvml_slog1p_ha_data_internal(%rip), %xmm2, %xmm13 #668.13 vfmadd213ps %xmm0, %xmm12, %xmm14 #674.13 vshufps $238, %xmm10, %xmm9, %xmm11 #664.986 - vfmadd132ps 1920+__svml_slog1p_ha_data_internal(%rip), %xmm11, %xmm2 #669.13 + vfmadd132ps 1920+__jsvml_slog1p_ha_data_internal(%rip), %xmm11, %xmm2 #669.13 vaddps %xmm13, %xmm1, %xmm15 #675.17 vsubps %xmm13, %xmm15, %xmm0 #676.13 vsubps %xmm0, %xmm1, %xmm1 #677.13 @@ -535,29 +535,29 @@ __svml_log1pf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #683.540 lea 128(%rsp,%r12,4), %rsi #683.540 -..___tag_value___svml_log1pf4_ha_l9.61: -# __svml_slog1p_ha_cout_rare_internal(const float *, float *) - call __svml_slog1p_ha_cout_rare_internal #683.540 -..___tag_value___svml_log1pf4_ha_l9.62: +..___tag_value___jsvml_log1pf4_ha_l9.61: +# __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog1p_ha_cout_rare_internal #683.540 +..___tag_value___jsvml_log1pf4_ha_l9.62: jmp ..B3.8 # Prob 100% #683.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1pf4_ha_l9,@function - .size __svml_log1pf4_ha_l9,.-__svml_log1pf4_ha_l9 -..LN__svml_log1pf4_ha_l9.2: + .type __jsvml_log1pf4_ha_l9,@function + .size __jsvml_log1pf4_ha_l9,.-__jsvml_log1pf4_ha_l9 +..LN__jsvml_log1pf4_ha_l9.2: .data -# -- End __svml_log1pf4_ha_l9 +# -- End __jsvml_log1pf4_ha_l9 .text -.L_2__routine_start___svml_log1pf4_ha_ex_3: -# -- Begin __svml_log1pf4_ha_ex +.L_2__routine_start___jsvml_log1pf4_ha_ex_3: +# -- Begin __jsvml_log1pf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_log1pf4_ha_ex -# --- __svml_log1pf4_ha_ex(__m128) -__svml_log1pf4_ha_ex: + .globl __jsvml_log1pf4_ha_ex +# --- __jsvml_log1pf4_ha_ex(__m128) +__jsvml_log1pf4_ha_ex: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -566,7 +566,7 @@ __svml_log1pf4_ha_ex: .byte 30 #805.540 .byte 250 #805.540 .cfi_startproc -..___tag_value___svml_log1pf4_ha_ex.64: +..___tag_value___jsvml_log1pf4_ha_ex.64: ..L65: #691.1 pushq %rbp #691.1 @@ -577,35 +577,35 @@ __svml_log1pf4_ha_ex: andq $-64, %rsp #691.1 subq $192, %rsp #691.1 movaps %xmm0, %xmm8 #691.1 - movups 1984+__svml_slog1p_ha_data_internal(%rip), %xmm4 #740.44 + movups 1984+__jsvml_slog1p_ha_data_internal(%rip), %xmm4 #740.44 movaps %xmm8, %xmm2 #768.18 movaps %xmm4, %xmm10 #745.12 movaps %xmm4, %xmm6 #746.12 maxps %xmm8, %xmm10 #745.12 minps %xmm8, %xmm6 #746.12 - cmpltps 1664+__svml_slog1p_ha_data_internal(%rip), %xmm2 #768.18 - movups 1088+__svml_slog1p_ha_data_internal(%rip), %xmm9 #741.48 + cmpltps 1664+__jsvml_slog1p_ha_data_internal(%rip), %xmm2 #768.18 + movups 1088+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #741.48 movaps %xmm10, %xmm5 #750.12 movaps %xmm9, %xmm7 #744.19 andps %xmm8, %xmm9 #747.15 - cmpltps 1152+__svml_slog1p_ha_data_internal(%rip), %xmm9 #748.16 + cmpltps 1152+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #748.16 addps %xmm6, %xmm5 #750.12 - orps 1216+__svml_slog1p_ha_data_internal(%rip), %xmm9 #749.17 + orps 1216+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #749.17 movaps %xmm8, %xmm15 #769.18 - movups 1536+__svml_slog1p_ha_data_internal(%rip), %xmm11 #756.19 + movups 1536+__jsvml_slog1p_ha_data_internal(%rip), %xmm11 #756.19 andps %xmm9, %xmm5 #751.12 andps %xmm5, %xmm11 #756.19 movaps %xmm5, %xmm14 #767.17 - orps 1600+__svml_slog1p_ha_data_internal(%rip), %xmm11 #757.19 - lea -137216+__svml_slog1p_ha_data_internal(%rip), %r8 #786.61 + orps 1600+__jsvml_slog1p_ha_data_internal(%rip), %xmm11 #757.19 + lea -137216+__jsvml_slog1p_ha_data_internal(%rip), %r8 #786.61 rcpps %xmm11, %xmm3 #762.17 - cmpnleps 1728+__svml_slog1p_ha_data_internal(%rip), %xmm15 #769.18 + cmpnleps 1728+__jsvml_slog1p_ha_data_internal(%rip), %xmm15 #769.18 subps %xmm5, %xmm10 #752.13 movups .L_2il0floatpacket.23(%rip), %xmm13 #770.105 orps %xmm15, %xmm2 #774.18 - movdqu 1280+__svml_slog1p_ha_data_internal(%rip), %xmm12 #764.15 + movdqu 1280+__jsvml_slog1p_ha_data_internal(%rip), %xmm12 #764.15 psrld $23, %xmm14 #767.17 - movdqu 1344+__svml_slog1p_ha_data_internal(%rip), %xmm1 #765.15 + movdqu 1344+__jsvml_slog1p_ha_data_internal(%rip), %xmm1 #765.15 pand %xmm5, %xmm12 #764.15 psubd %xmm12, %xmm1 #765.15 andnps %xmm8, %xmm7 #744.19 @@ -637,8 +637,8 @@ __svml_log1pf4_ha_ex: movq (%r8,%rsi), %xmm12 #786.519 movslq %ecx, %rcx #786.270 movslq %edi, %rdi #786.768 - movups 1920+__svml_slog1p_ha_data_internal(%rip), %xmm14 #789.44 - movups 1856+__svml_slog1p_ha_data_internal(%rip), %xmm13 #790.25 + movups 1920+__jsvml_slog1p_ha_data_internal(%rip), %xmm14 #789.44 + movups 1856+__jsvml_slog1p_ha_data_internal(%rip), %xmm13 #790.25 movq (%r8,%rcx), %xmm10 #786.270 movq (%r8,%rdi), %xmm11 #786.768 unpcklps %xmm10, %xmm1 #786.970 @@ -650,11 +650,11 @@ __svml_log1pf4_ha_ex: mulps %xmm14, %xmm0 #791.25 addps %xmm13, %xmm3 #790.13 addps %xmm0, %xmm1 #791.13 - movups 1408+__svml_slog1p_ha_data_internal(%rip), %xmm12 #792.54 + movups 1408+__jsvml_slog1p_ha_data_internal(%rip), %xmm12 #792.54 movaps %xmm2, %xmm0 #795.14 mulps %xmm2, %xmm12 #794.25 mulps %xmm2, %xmm0 #795.14 - addps 1472+__svml_slog1p_ha_data_internal(%rip), %xmm12 #794.13 + addps 1472+__jsvml_slog1p_ha_data_internal(%rip), %xmm12 #794.13 mulps %xmm0, %xmm12 #796.25 movaps %xmm2, %xmm0 #797.17 addps %xmm3, %xmm0 #797.17 @@ -720,29 +720,29 @@ __svml_log1pf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #805.540 lea 128(%rsp,%r12,4), %rsi #805.540 -..___tag_value___svml_log1pf4_ha_ex.82: -# __svml_slog1p_ha_cout_rare_internal(const float *, float *) - call __svml_slog1p_ha_cout_rare_internal #805.540 -..___tag_value___svml_log1pf4_ha_ex.83: +..___tag_value___jsvml_log1pf4_ha_ex.82: +# __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog1p_ha_cout_rare_internal #805.540 +..___tag_value___jsvml_log1pf4_ha_ex.83: jmp ..B4.8 # Prob 100% #805.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1pf4_ha_ex,@function - .size __svml_log1pf4_ha_ex,.-__svml_log1pf4_ha_ex -..LN__svml_log1pf4_ha_ex.3: + .type __jsvml_log1pf4_ha_ex,@function + .size __jsvml_log1pf4_ha_ex,.-__jsvml_log1pf4_ha_ex +..LN__jsvml_log1pf4_ha_ex.3: .data -# -- End __svml_log1pf4_ha_ex +# -- End __jsvml_log1pf4_ha_ex .text -.L_2__routine_start___svml_log1pf16_ha_z0_4: -# -- Begin __svml_log1pf16_ha_z0 +.L_2__routine_start___jsvml_log1pf16_ha_z0_4: +# -- Begin __jsvml_log1pf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_log1pf16_ha_z0 -# --- __svml_log1pf16_ha_z0(__m512) -__svml_log1pf16_ha_z0: + .globl __jsvml_log1pf16_ha_z0 +# --- __jsvml_log1pf16_ha_z0(__m512) +__jsvml_log1pf16_ha_z0: # parameter 1: %zmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -751,7 +751,7 @@ __svml_log1pf16_ha_z0: .byte 30 #902.760 .byte 250 #902.760 .cfi_startproc -..___tag_value___svml_log1pf16_ha_z0.85: +..___tag_value___jsvml_log1pf16_ha_z0.85: ..L86: #813.1 pushq %rbp #813.1 @@ -761,8 +761,8 @@ __svml_log1pf16_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #813.1 subq $192, %rsp #813.1 - vmovups 256+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm4 #853.54 - vmovups 320+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm11 #858.57 + vmovups 256+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm4 #853.54 + vmovups 320+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm11 #858.57 vmovaps %zmm0, %zmm6 #813.1 vmaxps {sae}, %zmm6, %zmm4, %zmm7 #855.22 vminps {sae}, %zmm6, %zmm4, %zmm9 #856.22 @@ -775,25 +775,25 @@ __svml_log1pf16_ha_z0: vsubps {rn-sae}, %zmm10, %zmm9, %zmm13 #863.22 vxorps %zmm11, %zmm2, %zmm14 #865.24 vrndscaleps $104, {sae}, %zmm12, %zmm7 #866.24 - vmovups 128+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm10 #879.293 - vmovups 640+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm9 #881.53 - vmovups 448+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm12 #884.61 + vmovups 128+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm10 #879.293 + vmovups 640+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm9 #881.53 + vmovups 448+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm12 #884.61 vscalefps {rn-sae}, %zmm14, %zmm13, %zmm15 #867.20 vfmsub213ps {rn-sae}, %zmm4, %zmm7, %zmm3 #870.20 vgetexpps {sae}, %zmm7, %zmm8 #868.26 - vmovups 576+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm13 #888.61 - vmovups 704+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm14 #891.53 + vmovups 576+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm13 #888.61 + vmovups 704+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm14 #891.53 vmulps {rn-sae}, %zmm15, %zmm7, %zmm0 #871.22 vsubps {rn-sae}, %zmm4, %zmm2, %zmm4 #874.25 vpsrld $18, %zmm7, %zmm2 #876.45 vaddps {rn-sae}, %zmm0, %zmm3, %zmm1 #872.21 - vpermt2ps 192+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm2, %zmm10 #879.293 + vpermt2ps 192+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm2, %zmm10 #879.293 vsubps {rn-sae}, %zmm3, %zmm1, %zmm3 #873.23 vsubps {rn-sae}, %zmm3, %zmm0, %zmm11 #875.22 - vmovups __svml_slog1p_ha_data_internal_avx512(%rip), %zmm0 #878.293 - vmovups 512+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm3 #885.61 + vmovups __jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm0 #878.293 + vmovups 512+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm3 #885.61 vaddps {rn-sae}, %zmm11, %zmm10, %zmm15 #883.22 - vpermt2ps 64+__svml_slog1p_ha_data_internal_avx512(%rip), %zmm2, %zmm0 #878.293 + vpermt2ps 64+__jsvml_slog1p_ha_data_internal_avx512(%rip), %zmm2, %zmm0 #878.293 vsubps {rn-sae}, %zmm8, %zmm4, %zmm2 #880.25 vfmadd231ps {rn-sae}, %zmm1, %zmm12, %zmm3 #886.19 vmulps {rn-sae}, %zmm1, %zmm1, %zmm12 #887.22 @@ -918,29 +918,29 @@ __svml_log1pf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #902.760 lea 128(%rsp,%rbx,4), %rsi #902.760 -..___tag_value___svml_log1pf16_ha_z0.113: -# __svml_slog1p_ha_cout_rare_internal(const float *, float *) - call __svml_slog1p_ha_cout_rare_internal #902.760 -..___tag_value___svml_log1pf16_ha_z0.114: +..___tag_value___jsvml_log1pf16_ha_z0.113: +# __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog1p_ha_cout_rare_internal #902.760 +..___tag_value___jsvml_log1pf16_ha_z0.114: jmp ..B5.13 # Prob 100% #902.760 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_log1pf16_ha_z0,@function - .size __svml_log1pf16_ha_z0,.-__svml_log1pf16_ha_z0 -..LN__svml_log1pf16_ha_z0.4: + .type __jsvml_log1pf16_ha_z0,@function + .size __jsvml_log1pf16_ha_z0,.-__jsvml_log1pf16_ha_z0 +..LN__jsvml_log1pf16_ha_z0.4: .data -# -- End __svml_log1pf16_ha_z0 +# -- End __jsvml_log1pf16_ha_z0 .text -.L_2__routine_start___svml_log1pf8_ha_e9_5: -# -- Begin __svml_log1pf8_ha_e9 +.L_2__routine_start___jsvml_log1pf8_ha_e9_5: +# -- Begin __jsvml_log1pf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_log1pf8_ha_e9 -# --- __svml_log1pf8_ha_e9(__m256) -__svml_log1pf8_ha_e9: + .globl __jsvml_log1pf8_ha_e9 +# --- __jsvml_log1pf8_ha_e9(__m256) +__jsvml_log1pf8_ha_e9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -949,7 +949,7 @@ __svml_log1pf8_ha_e9: .byte 30 #1348.546 .byte 250 #1348.546 .cfi_startproc -..___tag_value___svml_log1pf8_ha_e9.116: +..___tag_value___jsvml_log1pf8_ha_e9.116: ..L117: #1234.1 pushq %rbp #1234.1 @@ -959,27 +959,27 @@ __svml_log1pf8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #1234.1 subq $192, %rsp #1234.1 - lea -137216+__svml_slog1p_ha_data_internal(%rip), %rax #1329.42 - vmovups 1984+__svml_slog1p_ha_data_internal(%rip), %ymm15 #1283.47 - vmovups 1088+__svml_slog1p_ha_data_internal(%rip), %ymm4 #1284.51 - vmovups 1280+__svml_slog1p_ha_data_internal(%rip), %xmm7 #1303.25 - vmovups 1344+__svml_slog1p_ha_data_internal(%rip), %xmm9 #1304.25 + lea -137216+__jsvml_slog1p_ha_data_internal(%rip), %rax #1329.42 + vmovups 1984+__jsvml_slog1p_ha_data_internal(%rip), %ymm15 #1283.47 + vmovups 1088+__jsvml_slog1p_ha_data_internal(%rip), %ymm4 #1284.51 + vmovups 1280+__jsvml_slog1p_ha_data_internal(%rip), %xmm7 #1303.25 + vmovups 1344+__jsvml_slog1p_ha_data_internal(%rip), %xmm9 #1304.25 vmaxps %ymm0, %ymm15, %ymm14 #1288.12 vminps %ymm0, %ymm15, %ymm6 #1289.12 vandps %ymm4, %ymm0, %ymm3 #1290.15 - vcmplt_oqps 1152+__svml_slog1p_ha_data_internal(%rip), %ymm3, %ymm5 #1291.16 + vcmplt_oqps 1152+__jsvml_slog1p_ha_data_internal(%rip), %ymm3, %ymm5 #1291.16 vaddps %ymm6, %ymm14, %ymm2 #1293.12 - vorps 1216+__svml_slog1p_ha_data_internal(%rip), %ymm5, %ymm13 #1292.17 + vorps 1216+__jsvml_slog1p_ha_data_internal(%rip), %ymm5, %ymm13 #1292.17 vandps %ymm13, %ymm2, %ymm8 #1294.12 - vandps 1536+__svml_slog1p_ha_data_internal(%rip), %ymm8, %ymm12 #1299.19 - vorps 1600+__svml_slog1p_ha_data_internal(%rip), %ymm12, %ymm10 #1300.19 + vandps 1536+__jsvml_slog1p_ha_data_internal(%rip), %ymm8, %ymm12 #1299.19 + vorps 1600+__jsvml_slog1p_ha_data_internal(%rip), %ymm12, %ymm10 #1300.19 vandnps %ymm0, %ymm4, %ymm1 #1287.19 vrcpps %ymm10, %ymm4 #1305.17 vsubps %ymm8, %ymm14, %ymm11 #1295.13 - vcmplt_oqps 1664+__svml_slog1p_ha_data_internal(%rip), %ymm0, %ymm12 #1311.18 + vcmplt_oqps 1664+__jsvml_slog1p_ha_data_internal(%rip), %ymm0, %ymm12 #1311.18 vroundps $0, %ymm4, %ymm13 #1313.17 vaddps %ymm11, %ymm6, %ymm14 #1296.13 - vcmpnle_uqps 1728+__svml_slog1p_ha_data_internal(%rip), %ymm0, %ymm11 #1312.18 + vcmpnle_uqps 1728+__jsvml_slog1p_ha_data_internal(%rip), %ymm0, %ymm11 #1312.18 vpand %xmm7, %xmm8, %xmm3 #1307.21 vextractf128 $1, %ymm8, %xmm10 #1306.109 vpsubd %xmm3, %xmm9, %xmm5 #1308.21 @@ -1027,8 +1027,8 @@ __svml_log1pf8_ha_e9: movslq %r11d, %r11 #1329.1242 movslq %ecx, %rcx #1329.1443 vunpcklps %xmm12, %xmm11, %xmm8 #1329.1685 - vmulps 1856+__svml_slog1p_ha_data_internal(%rip), %ymm5, %ymm12 #1333.28 - vmulps 1920+__svml_slog1p_ha_data_internal(%rip), %ymm5, %ymm5 #1334.28 + vmulps 1856+__jsvml_slog1p_ha_data_internal(%rip), %ymm5, %ymm12 #1333.28 + vmulps 1920+__jsvml_slog1p_ha_data_internal(%rip), %ymm5, %ymm5 #1334.28 vmovq (%rax,%r9), %xmm14 #1329.843 vmovq (%rax,%r11), %xmm15 #1329.1242 vmovq (%rax,%rcx), %xmm6 #1329.1443 @@ -1040,9 +1040,9 @@ __svml_log1pf8_ha_e9: vinsertf128 $1, %xmm2, %ymm8, %ymm10 #1329.1966 vunpckhps %ymm10, %ymm9, %ymm13 #1329.2131 vaddps %ymm5, %ymm13, %ymm7 #1334.13 - vmulps 1408+__svml_slog1p_ha_data_internal(%rip), %ymm4, %ymm5 #1337.28 + vmulps 1408+__jsvml_slog1p_ha_data_internal(%rip), %ymm4, %ymm5 #1337.28 vmulps %ymm4, %ymm4, %ymm2 #1338.14 - vaddps 1472+__svml_slog1p_ha_data_internal(%rip), %ymm5, %ymm13 #1337.13 + vaddps 1472+__jsvml_slog1p_ha_data_internal(%rip), %ymm5, %ymm13 #1337.13 vunpcklps %ymm10, %ymm9, %ymm11 #1329.2057 vaddps %ymm12, %ymm11, %ymm15 #1333.13 vmulps %ymm2, %ymm13, %ymm6 #1339.28 @@ -1115,30 +1115,30 @@ __svml_log1pf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1348.546 lea 128(%rsp,%r12,4), %rsi #1348.546 -..___tag_value___svml_log1pf8_ha_e9.134: -# __svml_slog1p_ha_cout_rare_internal(const float *, float *) - call __svml_slog1p_ha_cout_rare_internal #1348.546 -..___tag_value___svml_log1pf8_ha_e9.135: +..___tag_value___jsvml_log1pf8_ha_e9.134: +# __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog1p_ha_cout_rare_internal #1348.546 +..___tag_value___jsvml_log1pf8_ha_e9.135: jmp ..B6.8 # Prob 100% #1348.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_log1pf8_ha_e9,@function - .size __svml_log1pf8_ha_e9,.-__svml_log1pf8_ha_e9 -..LN__svml_log1pf8_ha_e9.5: + .type __jsvml_log1pf8_ha_e9,@function + .size __jsvml_log1pf8_ha_e9,.-__jsvml_log1pf8_ha_e9 +..LN__jsvml_log1pf8_ha_e9.5: .data -# -- End __svml_log1pf8_ha_e9 +# -- End __jsvml_log1pf8_ha_e9 .text -.L_2__routine_start___svml_slog1p_ha_cout_rare_internal_6: -# -- Begin __svml_slog1p_ha_cout_rare_internal +.L_2__routine_start___jsvml_slog1p_ha_cout_rare_internal_6: +# -- Begin __jsvml_slog1p_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_slog1p_ha_cout_rare_internal - .globl __svml_slog1p_ha_cout_rare_internal -# --- __svml_slog1p_ha_cout_rare_internal(const float *, float *) -__svml_slog1p_ha_cout_rare_internal: + .hidden __jsvml_slog1p_ha_cout_rare_internal + .globl __jsvml_slog1p_ha_cout_rare_internal +# --- __jsvml_slog1p_ha_cout_rare_internal(const float *, float *) +__jsvml_slog1p_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1148,7 +1148,7 @@ __svml_slog1p_ha_cout_rare_internal: .byte 30 #1221.13 .byte 250 #1221.13 .cfi_startproc -..___tag_value___svml_slog1p_ha_cout_rare_internal.137: +..___tag_value___jsvml_slog1p_ha_cout_rare_internal.137: ..L138: #1121.1 xorl %eax, %eax #1132.14 @@ -1376,17 +1376,17 @@ __svml_slog1p_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_slog1p_ha_cout_rare_internal,@function - .size __svml_slog1p_ha_cout_rare_internal,.-__svml_slog1p_ha_cout_rare_internal -..LN__svml_slog1p_ha_cout_rare_internal.6: + .type __jsvml_slog1p_ha_cout_rare_internal,@function + .size __jsvml_slog1p_ha_cout_rare_internal,.-__jsvml_slog1p_ha_cout_rare_internal +..LN__jsvml_slog1p_ha_cout_rare_internal.6: .data -# -- End __svml_slog1p_ha_cout_rare_internal +# -- End __jsvml_slog1p_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_slog1p_ha_data_internal_avx512 - .globl __svml_slog1p_ha_data_internal_avx512 -__svml_slog1p_ha_data_internal_avx512: + .hidden __jsvml_slog1p_ha_data_internal_avx512 + .globl __jsvml_slog1p_ha_data_internal_avx512 +__jsvml_slog1p_ha_data_internal_avx512: .long 1060205056 .long 1059688960 .long 1059187712 @@ -1579,12 +1579,12 @@ __svml_slog1p_ha_data_internal_avx512: .long 901758606 .long 901758606 .long 901758606 - .type __svml_slog1p_ha_data_internal_avx512,@object - .size __svml_slog1p_ha_data_internal_avx512,768 + .type __jsvml_slog1p_ha_data_internal_avx512,@object + .size __jsvml_slog1p_ha_data_internal_avx512,768 .align 64 - .hidden __svml_slog1p_ha_data_internal - .globl __svml_slog1p_ha_data_internal -__svml_slog1p_ha_data_internal: + .hidden __jsvml_slog1p_ha_data_internal + .globl __jsvml_slog1p_ha_data_internal +__jsvml_slog1p_ha_data_internal: .long 3266227256 .long 3107766024 .long 3266228276 @@ -2569,8 +2569,8 @@ __svml_slog1p_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_slog1p_ha_data_internal,@object - .size __svml_slog1p_ha_data_internal,3264 + .type __jsvml_slog1p_ha_data_internal,@object + .size __jsvml_slog1p_ha_data_internal,3264 .align 32 _vmldLnHATab: .long 1065353216 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_log_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log_linux_x86.S similarity index 86% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_log_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log_linux_x86.S index 176b82fd7bf..f6fac091963 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_log_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_log_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_log.c" .text ..TXTST0: -.L_2__routine_start___svml_logf4_ha_ex_0: -# -- Begin __svml_logf4_ha_ex +.L_2__routine_start___jsvml_logf4_ha_ex_0: +# -- Begin __jsvml_logf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_logf4_ha_ex -# --- __svml_logf4_ha_ex(__m128) -__svml_logf4_ha_ex: + .globl __jsvml_logf4_ha_ex +# --- __jsvml_logf4_ha_ex(__m128) +__jsvml_logf4_ha_ex: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_logf4_ha_ex: .byte 30 #283.540 .byte 250 #283.540 .cfi_startproc -..___tag_value___svml_logf4_ha_ex.1: +..___tag_value___jsvml_logf4_ha_ex.1: ..L2: #223.1 pushq %rbp #223.1 @@ -58,40 +58,40 @@ __svml_logf4_ha_ex: andq $-64, %rsp #223.1 subq $192, %rsp #223.1 movaps %xmm0, %xmm2 #250.9 - movdqu 576+__svml_slog_ha_data_internal(%rip), %xmm1 #247.17 - movdqu 640+__svml_slog_ha_data_internal(%rip), %xmm4 #247.17 + movdqu 576+__jsvml_slog_ha_data_internal(%rip), %xmm1 #247.17 + movdqu 640+__jsvml_slog_ha_data_internal(%rip), %xmm4 #247.17 paddd %xmm0, %xmm1 #247.17 - movdqu 704+__svml_slog_ha_data_internal(%rip), %xmm3 #248.51 + movdqu 704+__jsvml_slog_ha_data_internal(%rip), %xmm3 #248.51 pcmpgtd %xmm1, %xmm4 #247.17 - movdqu 768+__svml_slog_ha_data_internal(%rip), %xmm1 #251.9 + movdqu 768+__jsvml_slog_ha_data_internal(%rip), %xmm1 #251.9 psubd %xmm3, %xmm2 #250.9 pand %xmm2, %xmm1 #251.9 psrad $23, %xmm2 #252.9 paddd %xmm3, %xmm1 #255.9 - movups 512+__svml_slog_ha_data_internal(%rip), %xmm5 #259.49 + movups 512+__jsvml_slog_ha_data_internal(%rip), %xmm5 #259.49 cvtdq2ps %xmm2, %xmm8 #254.9 - subps 832+__svml_slog_ha_data_internal(%rip), %xmm1 #258.9 + subps 832+__jsvml_slog_ha_data_internal(%rip), %xmm1 #258.9 movmskps %xmm4, %edx #256.40 - movups 960+__svml_slog_ha_data_internal(%rip), %xmm6 #279.47 + movups 960+__jsvml_slog_ha_data_internal(%rip), %xmm6 #279.47 mulps %xmm1, %xmm5 #261.25 mulps %xmm8, %xmm6 #280.26 - addps 448+__svml_slog_ha_data_internal(%rip), %xmm5 #261.13 + addps 448+__jsvml_slog_ha_data_internal(%rip), %xmm5 #261.13 mulps %xmm1, %xmm5 #263.25 - movups 896+__svml_slog_ha_data_internal(%rip), %xmm7 #278.47 + movups 896+__jsvml_slog_ha_data_internal(%rip), %xmm7 #278.47 mulps %xmm7, %xmm8 #281.26 - addps 384+__svml_slog_ha_data_internal(%rip), %xmm5 #263.13 + addps 384+__jsvml_slog_ha_data_internal(%rip), %xmm5 #263.13 mulps %xmm1, %xmm5 #265.25 - addps 320+__svml_slog_ha_data_internal(%rip), %xmm5 #265.13 + addps 320+__jsvml_slog_ha_data_internal(%rip), %xmm5 #265.13 mulps %xmm1, %xmm5 #267.25 - addps 256+__svml_slog_ha_data_internal(%rip), %xmm5 #267.13 + addps 256+__jsvml_slog_ha_data_internal(%rip), %xmm5 #267.13 mulps %xmm1, %xmm5 #269.25 - addps 192+__svml_slog_ha_data_internal(%rip), %xmm5 #269.13 + addps 192+__jsvml_slog_ha_data_internal(%rip), %xmm5 #269.13 mulps %xmm1, %xmm5 #271.25 - addps 128+__svml_slog_ha_data_internal(%rip), %xmm5 #271.13 + addps 128+__jsvml_slog_ha_data_internal(%rip), %xmm5 #271.13 mulps %xmm1, %xmm5 #273.25 - addps 64+__svml_slog_ha_data_internal(%rip), %xmm5 #273.13 + addps 64+__jsvml_slog_ha_data_internal(%rip), %xmm5 #273.13 mulps %xmm1, %xmm5 #275.25 - addps __svml_slog_ha_data_internal(%rip), %xmm5 #275.13 + addps __jsvml_slog_ha_data_internal(%rip), %xmm5 #275.13 mulps %xmm1, %xmm5 #276.9 mulps %xmm1, %xmm5 #277.21 addps %xmm5, %xmm1 #277.9 @@ -152,29 +152,29 @@ __svml_logf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #283.540 lea 128(%rsp,%r12,4), %rsi #283.540 -..___tag_value___svml_logf4_ha_ex.19: -# __svml_slog_ha_cout_rare_internal(const float *, float *) - call __svml_slog_ha_cout_rare_internal #283.540 -..___tag_value___svml_logf4_ha_ex.20: +..___tag_value___jsvml_logf4_ha_ex.19: +# __jsvml_slog_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog_ha_cout_rare_internal #283.540 +..___tag_value___jsvml_logf4_ha_ex.20: jmp ..B1.8 # Prob 100% #283.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_logf4_ha_ex,@function - .size __svml_logf4_ha_ex,.-__svml_logf4_ha_ex -..LN__svml_logf4_ha_ex.0: + .type __jsvml_logf4_ha_ex,@function + .size __jsvml_logf4_ha_ex,.-__jsvml_logf4_ha_ex +..LN__jsvml_logf4_ha_ex.0: .data -# -- End __svml_logf4_ha_ex +# -- End __jsvml_logf4_ha_ex .text -.L_2__routine_start___svml_logf4_ha_e9_1: -# -- Begin __svml_logf4_ha_e9 +.L_2__routine_start___jsvml_logf4_ha_e9_1: +# -- Begin __jsvml_logf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_logf4_ha_e9 -# --- __svml_logf4_ha_e9(__m128) -__svml_logf4_ha_e9: + .globl __jsvml_logf4_ha_e9 +# --- __jsvml_logf4_ha_e9(__m128) +__jsvml_logf4_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -183,7 +183,7 @@ __svml_logf4_ha_e9: .byte 30 #351.540 .byte 250 #351.540 .cfi_startproc -..___tag_value___svml_logf4_ha_e9.22: +..___tag_value___jsvml_logf4_ha_e9.22: ..L23: #291.1 pushq %rbp #291.1 @@ -194,41 +194,41 @@ __svml_logf4_ha_e9: andq $-64, %rsp #291.1 subq $192, %rsp #291.1 movaps %xmm0, %xmm10 #318.15 - movups 704+__svml_slog_ha_data_internal(%rip), %xmm3 #316.22 - movups 768+__svml_slog_ha_data_internal(%rip), %xmm2 #317.25 + movups 704+__jsvml_slog_ha_data_internal(%rip), %xmm3 #316.22 + movups 768+__jsvml_slog_ha_data_internal(%rip), %xmm2 #317.25 psubd %xmm3, %xmm10 #318.15 movdqa %xmm10, %xmm1 #320.15 pand %xmm2, %xmm10 #319.15 paddd %xmm3, %xmm10 #323.9 psrad $23, %xmm1 #320.15 - movups 512+__svml_slog_ha_data_internal(%rip), %xmm6 #327.49 + movups 512+__jsvml_slog_ha_data_internal(%rip), %xmm6 #327.49 cvtdq2ps %xmm1, %xmm9 #322.9 - subps 832+__svml_slog_ha_data_internal(%rip), %xmm10 #326.9 + subps 832+__jsvml_slog_ha_data_internal(%rip), %xmm10 #326.9 mulps %xmm10, %xmm6 #329.25 - movups 960+__svml_slog_ha_data_internal(%rip), %xmm7 #347.47 + movups 960+__jsvml_slog_ha_data_internal(%rip), %xmm7 #347.47 mulps %xmm9, %xmm7 #348.26 - addps 448+__svml_slog_ha_data_internal(%rip), %xmm6 #329.13 + addps 448+__jsvml_slog_ha_data_internal(%rip), %xmm6 #329.13 mulps %xmm10, %xmm6 #331.25 - movups 576+__svml_slog_ha_data_internal(%rip), %xmm4 #315.23 - movups 896+__svml_slog_ha_data_internal(%rip), %xmm8 #346.47 + movups 576+__jsvml_slog_ha_data_internal(%rip), %xmm4 #315.23 + movups 896+__jsvml_slog_ha_data_internal(%rip), %xmm8 #346.47 paddd %xmm0, %xmm4 #315.23 - movups 640+__svml_slog_ha_data_internal(%rip), %xmm5 #315.23 + movups 640+__jsvml_slog_ha_data_internal(%rip), %xmm5 #315.23 mulps %xmm8, %xmm9 #349.26 - addps 384+__svml_slog_ha_data_internal(%rip), %xmm6 #331.13 + addps 384+__jsvml_slog_ha_data_internal(%rip), %xmm6 #331.13 mulps %xmm10, %xmm6 #333.25 pcmpgtd %xmm4, %xmm5 #315.23 movmskps %xmm5, %edx #324.40 - addps 320+__svml_slog_ha_data_internal(%rip), %xmm6 #333.13 + addps 320+__jsvml_slog_ha_data_internal(%rip), %xmm6 #333.13 mulps %xmm10, %xmm6 #335.25 - addps 256+__svml_slog_ha_data_internal(%rip), %xmm6 #335.13 + addps 256+__jsvml_slog_ha_data_internal(%rip), %xmm6 #335.13 mulps %xmm10, %xmm6 #337.25 - addps 192+__svml_slog_ha_data_internal(%rip), %xmm6 #337.13 + addps 192+__jsvml_slog_ha_data_internal(%rip), %xmm6 #337.13 mulps %xmm10, %xmm6 #339.25 - addps 128+__svml_slog_ha_data_internal(%rip), %xmm6 #339.13 + addps 128+__jsvml_slog_ha_data_internal(%rip), %xmm6 #339.13 mulps %xmm10, %xmm6 #341.25 - addps 64+__svml_slog_ha_data_internal(%rip), %xmm6 #341.13 + addps 64+__jsvml_slog_ha_data_internal(%rip), %xmm6 #341.13 mulps %xmm10, %xmm6 #343.25 - addps __svml_slog_ha_data_internal(%rip), %xmm6 #343.13 + addps __jsvml_slog_ha_data_internal(%rip), %xmm6 #343.13 mulps %xmm10, %xmm6 #344.9 mulps %xmm10, %xmm6 #345.21 addps %xmm6, %xmm10 #345.9 @@ -289,29 +289,29 @@ __svml_logf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #351.540 lea 128(%rsp,%r12,4), %rsi #351.540 -..___tag_value___svml_logf4_ha_e9.40: -# __svml_slog_ha_cout_rare_internal(const float *, float *) - call __svml_slog_ha_cout_rare_internal #351.540 -..___tag_value___svml_logf4_ha_e9.41: +..___tag_value___jsvml_logf4_ha_e9.40: +# __jsvml_slog_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog_ha_cout_rare_internal #351.540 +..___tag_value___jsvml_logf4_ha_e9.41: jmp ..B2.8 # Prob 100% #351.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_logf4_ha_e9,@function - .size __svml_logf4_ha_e9,.-__svml_logf4_ha_e9 -..LN__svml_logf4_ha_e9.1: + .type __jsvml_logf4_ha_e9,@function + .size __jsvml_logf4_ha_e9,.-__jsvml_logf4_ha_e9 +..LN__jsvml_logf4_ha_e9.1: .data -# -- End __svml_logf4_ha_e9 +# -- End __jsvml_logf4_ha_e9 .text -.L_2__routine_start___svml_logf16_ha_z0_2: -# -- Begin __svml_logf16_ha_z0 +.L_2__routine_start___jsvml_logf16_ha_z0_2: +# -- Begin __jsvml_logf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_logf16_ha_z0 -# --- __svml_logf16_ha_z0(__m512) -__svml_logf16_ha_z0: + .globl __jsvml_logf16_ha_z0 +# --- __jsvml_logf16_ha_z0(__m512) +__jsvml_logf16_ha_z0: # parameter 1: %zmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -320,34 +320,34 @@ __svml_logf16_ha_z0: .byte 30 #463.28 .byte 250 #463.28 .cfi_startproc -..___tag_value___svml_logf16_ha_z0.43: +..___tag_value___jsvml_logf16_ha_z0.43: ..L44: #359.1 vmovaps %zmm0, %zmm6 #359.1 vrcp14ps %zmm6, %zmm1 #397.21 - vmovups 128+__svml_slog_ha_data_internal_avx512(%rip), %zmm2 #409.288 - vmovups 256+__svml_slog_ha_data_internal_avx512(%rip), %zmm3 #410.288 - vmovups 768+__svml_slog_ha_data_internal_avx512(%rip), %zmm11 #419.16 - vpaddd __svml_slog_ha_data_internal_avx512(%rip), %zmm1, %zmm4 #401.19 - vmovups 640+__svml_slog_ha_data_internal_avx512(%rip), %zmm1 #406.50 - vpandd 64+__svml_slog_ha_data_internal_avx512(%rip), %zmm4, %zmm7 #402.19 + vmovups 128+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm2 #409.288 + vmovups 256+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm3 #410.288 + vmovups 768+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm11 #419.16 + vpaddd __jsvml_slog_ha_data_internal_avx512(%rip), %zmm1, %zmm4 #401.19 + vmovups 640+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm1 #406.50 + vpandd 64+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm4, %zmm7 #402.19 vpsrld $18, %zmm7, %zmm5 #403.27 vgetexpps {sae}, %zmm7, %zmm10 #405.22 - vmovups 960+__svml_slog_ha_data_internal_avx512(%rip), %zmm4 #413.50 - vpermt2ps 192+__svml_slog_ha_data_internal_avx512(%rip), %zmm5, %zmm2 #409.288 - vpermt2ps 320+__svml_slog_ha_data_internal_avx512(%rip), %zmm5, %zmm3 #410.288 + vmovups 960+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm4 #413.50 + vpermt2ps 192+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm5, %zmm2 #409.288 + vpermt2ps 320+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm5, %zmm3 #410.288 vfpclassps $255, %zmm7, %k2 #407.30 - vmovups 896+__svml_slog_ha_data_internal_avx512(%rip), %zmm5 #411.50 + vmovups 896+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm5 #411.50 vfmsub213ps {rn-sae}, %zmm1, %zmm6, %zmm7 #408.16 kmovw %k2, %eax #415.61 vfnmadd231ps {rn-sae}, %zmm10, %zmm5, %zmm2 #412.17 vfnmadd213ps {rn-sae}, %zmm3, %zmm4, %zmm10 #414.17 - vmovups 704+__svml_slog_ha_data_internal_avx512(%rip), %zmm3 #417.58 + vmovups 704+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm3 #417.58 vmulps {rn-sae}, %zmm7, %zmm7, %zmm9 #420.19 vfmadd231ps {rn-sae}, %zmm7, %zmm3, %zmm11 #419.16 vaddps {rn-sae}, %zmm7, %zmm2, %zmm13 #416.21 vsubps {rn-sae}, %zmm2, %zmm13, %zmm8 #421.19 - vmovups 832+__svml_slog_ha_data_internal_avx512(%rip), %zmm2 #422.58 + vmovups 832+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm2 #422.58 vsubps {rn-sae}, %zmm8, %zmm7, %zmm12 #424.18 vfmadd213ps {rn-sae}, %zmm2, %zmm7, %zmm11 #423.16 vfmadd213ps {rn-sae}, %zmm10, %zmm9, %zmm11 #425.16 @@ -364,8 +364,8 @@ __svml_logf16_ha_z0: # Execution count [5.00e-02]: Infreq vgetmantps $10, {sae}, %zmm6, %zmm8 #433.33 vgetexpps {sae}, %zmm6, %zmm11 #434.30 - vmovups 384+__svml_slog_ha_data_internal_avx512(%rip), %zmm14 #443.294 - vmovups 512+__svml_slog_ha_data_internal_avx512(%rip), %zmm13 #444.294 + vmovups 384+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm14 #443.294 + vmovups 512+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm13 #444.294 vrcp14ps %zmm8, %zmm7 #436.29 vfpclassps $223, %zmm6, %k1 #435.36 vrndscaleps $88, {sae}, %zmm7, %zmm9 #437.29 @@ -373,10 +373,10 @@ __svml_logf16_ha_z0: vfmsub231ps {rn-sae}, %zmm9, %zmm8, %zmm1 #440.24 vpsrld $18, %zmm9, %zmm10 #441.50 vsubps {rn-sae}, %zmm12, %zmm11, %zmm15 #445.30 - vpermt2ps 448+__svml_slog_ha_data_internal_avx512(%rip), %zmm10, %zmm14 #443.294 - vpermt2ps 576+__svml_slog_ha_data_internal_avx512(%rip), %zmm10, %zmm13 #444.294 + vpermt2ps 448+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm10, %zmm14 #443.294 + vpermt2ps 576+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm10, %zmm13 #444.294 vfmadd231ps {rn-sae}, %zmm15, %zmm5, %zmm14 #447.25 - vmovups 768+__svml_slog_ha_data_internal_avx512(%rip), %zmm5 #450.24 + vmovups 768+__jsvml_slog_ha_data_internal_avx512(%rip), %zmm5 #450.24 vfmadd213ps {rn-sae}, %zmm13, %zmm4, %zmm15 #456.25 vfmadd231ps {rn-sae}, %zmm1, %zmm3, %zmm5 #450.24 vmulps {rn-sae}, %zmm1, %zmm1, %zmm3 #451.27 @@ -393,20 +393,20 @@ __svml_logf16_ha_z0: # LOE rbx rbp r12 r13 r14 r15 zmm0 .cfi_endproc # mark_end; - .type __svml_logf16_ha_z0,@function - .size __svml_logf16_ha_z0,.-__svml_logf16_ha_z0 -..LN__svml_logf16_ha_z0.2: + .type __jsvml_logf16_ha_z0,@function + .size __jsvml_logf16_ha_z0,.-__jsvml_logf16_ha_z0 +..LN__jsvml_logf16_ha_z0.2: .data -# -- End __svml_logf16_ha_z0 +# -- End __jsvml_logf16_ha_z0 .text -.L_2__routine_start___svml_logf4_ha_l9_3: -# -- Begin __svml_logf4_ha_l9 +.L_2__routine_start___jsvml_logf4_ha_l9_3: +# -- Begin __jsvml_logf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_logf4_ha_l9 -# --- __svml_logf4_ha_l9(__m128) -__svml_logf4_ha_l9: + .globl __jsvml_logf4_ha_l9 +# --- __jsvml_logf4_ha_l9(__m128) +__jsvml_logf4_ha_l9: # parameter 1: %xmm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -415,7 +415,7 @@ __svml_logf4_ha_l9: .byte 30 #837.540 .byte 250 #837.540 .cfi_startproc -..___tag_value___svml_logf4_ha_l9.46: +..___tag_value___jsvml_logf4_ha_l9.46: ..L47: #777.1 pushq %rbp #777.1 @@ -425,30 +425,30 @@ __svml_logf4_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #777.1 subq $192, %rsp #777.1 - vmovups 704+__svml_slog_ha_data_internal(%rip), %xmm4 #802.18 + vmovups 704+__jsvml_slog_ha_data_internal(%rip), %xmm4 #802.18 vpsubd %xmm4, %xmm0, %xmm2 #804.11 - vpand 768+__svml_slog_ha_data_internal(%rip), %xmm2, %xmm3 #805.11 + vpand 768+__jsvml_slog_ha_data_internal(%rip), %xmm2, %xmm3 #805.11 vpsrad $23, %xmm2, %xmm1 #806.11 vpaddd %xmm4, %xmm3, %xmm8 #809.9 - vmovups 512+__svml_slog_ha_data_internal(%rip), %xmm9 #813.49 + vmovups 512+__jsvml_slog_ha_data_internal(%rip), %xmm9 #813.49 vcvtdq2ps %xmm1, %xmm1 #808.9 - vsubps 832+__svml_slog_ha_data_internal(%rip), %xmm8, %xmm10 #812.9 - vfmadd213ps 448+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #815.13 - vmovups 640+__svml_slog_ha_data_internal(%rip), %xmm5 #798.17 - vpaddd 576+__svml_slog_ha_data_internal(%rip), %xmm0, %xmm6 #801.19 + vsubps 832+__jsvml_slog_ha_data_internal(%rip), %xmm8, %xmm10 #812.9 + vfmadd213ps 448+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #815.13 + vmovups 640+__jsvml_slog_ha_data_internal(%rip), %xmm5 #798.17 + vpaddd 576+__jsvml_slog_ha_data_internal(%rip), %xmm0, %xmm6 #801.19 vpcmpgtd %xmm6, %xmm5, %xmm7 #801.19 vmovmskps %xmm7, %edx #810.40 - vfmadd213ps 384+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #817.13 - vfmadd213ps 320+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #819.13 - vfmadd213ps 256+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #821.13 - vfmadd213ps 192+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #823.13 - vfmadd213ps 128+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #825.13 - vfmadd213ps 64+__svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #827.13 - vfmadd213ps __svml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #829.13 + vfmadd213ps 384+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #817.13 + vfmadd213ps 320+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #819.13 + vfmadd213ps 256+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #821.13 + vfmadd213ps 192+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #823.13 + vfmadd213ps 128+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #825.13 + vfmadd213ps 64+__jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #827.13 + vfmadd213ps __jsvml_slog_ha_data_internal(%rip), %xmm10, %xmm9 #829.13 vmulps %xmm9, %xmm10, %xmm11 #830.9 vfmadd213ps %xmm10, %xmm10, %xmm11 #831.9 - vfmadd231ps 960+__svml_slog_ha_data_internal(%rip), %xmm1, %xmm11 #834.14 - vfmadd132ps 896+__svml_slog_ha_data_internal(%rip), %xmm11, %xmm1 #835.14 + vfmadd231ps 960+__jsvml_slog_ha_data_internal(%rip), %xmm1, %xmm11 #834.14 + vfmadd132ps 896+__jsvml_slog_ha_data_internal(%rip), %xmm11, %xmm1 #835.14 testl %edx, %edx #837.52 jne ..B4.3 # Prob 5% #837.52 # LOE rbx r12 r13 r14 r15 edx xmm0 xmm1 @@ -505,29 +505,29 @@ __svml_logf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #837.540 lea 128(%rsp,%r12,4), %rsi #837.540 -..___tag_value___svml_logf4_ha_l9.64: -# __svml_slog_ha_cout_rare_internal(const float *, float *) - call __svml_slog_ha_cout_rare_internal #837.540 -..___tag_value___svml_logf4_ha_l9.65: +..___tag_value___jsvml_logf4_ha_l9.64: +# __jsvml_slog_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog_ha_cout_rare_internal #837.540 +..___tag_value___jsvml_logf4_ha_l9.65: jmp ..B4.8 # Prob 100% #837.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_logf4_ha_l9,@function - .size __svml_logf4_ha_l9,.-__svml_logf4_ha_l9 -..LN__svml_logf4_ha_l9.3: + .type __jsvml_logf4_ha_l9,@function + .size __jsvml_logf4_ha_l9,.-__jsvml_logf4_ha_l9 +..LN__jsvml_logf4_ha_l9.3: .data -# -- End __svml_logf4_ha_l9 +# -- End __jsvml_logf4_ha_l9 .text -.L_2__routine_start___svml_logf8_ha_e9_4: -# -- Begin __svml_logf8_ha_e9 +.L_2__routine_start___jsvml_logf8_ha_e9_4: +# -- Begin __jsvml_logf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_logf8_ha_e9 -# --- __svml_logf8_ha_e9(__m256) -__svml_logf8_ha_e9: + .globl __jsvml_logf8_ha_e9 +# --- __jsvml_logf8_ha_e9(__m256) +__jsvml_logf8_ha_e9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -536,7 +536,7 @@ __svml_logf8_ha_e9: .byte 30 #905.546 .byte 250 #905.546 .cfi_startproc -..___tag_value___svml_logf8_ha_e9.67: +..___tag_value___jsvml_logf8_ha_e9.67: ..L68: #845.1 pushq %rbp #845.1 @@ -548,14 +548,14 @@ __svml_logf8_ha_e9: subq $192, %rsp #845.1 vmovaps %ymm0, %ymm8 #845.1 vextractf128 $1, %ymm8, %xmm5 #867.101 - vmovups 704+__svml_slog_ha_data_internal(%rip), %xmm4 #870.22 - vmovups 768+__svml_slog_ha_data_internal(%rip), %xmm3 #871.25 + vmovups 704+__jsvml_slog_ha_data_internal(%rip), %xmm4 #870.22 + vmovups 768+__jsvml_slog_ha_data_internal(%rip), %xmm3 #871.25 vpsubd %xmm4, %xmm5, %xmm2 #872.79 vpsrad $23, %xmm2, %xmm10 #874.64 vpand %xmm3, %xmm2, %xmm15 #873.82 vpaddd %xmm4, %xmm15, %xmm2 #877.90 - vmovups 576+__svml_slog_ha_data_internal(%rip), %xmm7 #865.21 - vmovups 640+__svml_slog_ha_data_internal(%rip), %xmm6 #866.21 + vmovups 576+__jsvml_slog_ha_data_internal(%rip), %xmm7 #865.21 + vmovups 640+__jsvml_slog_ha_data_internal(%rip), %xmm6 #866.21 vpaddd %xmm5, %xmm7, %xmm5 #869.100 vmovaps %xmm8, %xmm0 #867.33 vpsubd %xmm4, %xmm0, %xmm12 #872.15 @@ -572,28 +572,28 @@ __svml_logf8_ha_e9: vpacksswb %xmm9, %xmm7, %xmm10 #878.58 vpmovmskb %xmm10, %edx #878.39 vinsertf128 $1, %xmm2, %ymm14, %ymm11 #877.9 - vsubps 832+__svml_slog_ha_data_internal(%rip), %ymm11, %ymm0 #880.9 - vmulps 512+__svml_slog_ha_data_internal(%rip), %ymm0, %ymm12 #883.28 - vaddps 448+__svml_slog_ha_data_internal(%rip), %ymm12, %ymm13 #883.13 + vsubps 832+__jsvml_slog_ha_data_internal(%rip), %ymm11, %ymm0 #880.9 + vmulps 512+__jsvml_slog_ha_data_internal(%rip), %ymm0, %ymm12 #883.28 + vaddps 448+__jsvml_slog_ha_data_internal(%rip), %ymm12, %ymm13 #883.13 vmulps %ymm13, %ymm0, %ymm15 #885.28 - vaddps 384+__svml_slog_ha_data_internal(%rip), %ymm15, %ymm2 #885.13 + vaddps 384+__jsvml_slog_ha_data_internal(%rip), %ymm15, %ymm2 #885.13 vmulps %ymm2, %ymm0, %ymm3 #887.28 - vaddps 320+__svml_slog_ha_data_internal(%rip), %ymm3, %ymm4 #887.13 + vaddps 320+__jsvml_slog_ha_data_internal(%rip), %ymm3, %ymm4 #887.13 vmulps %ymm4, %ymm0, %ymm5 #889.28 - vaddps 256+__svml_slog_ha_data_internal(%rip), %ymm5, %ymm6 #889.13 + vaddps 256+__jsvml_slog_ha_data_internal(%rip), %ymm5, %ymm6 #889.13 vmulps %ymm6, %ymm0, %ymm7 #891.28 - vaddps 192+__svml_slog_ha_data_internal(%rip), %ymm7, %ymm9 #891.13 + vaddps 192+__jsvml_slog_ha_data_internal(%rip), %ymm7, %ymm9 #891.13 vmulps %ymm9, %ymm0, %ymm10 #893.28 - vaddps 128+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm11 #893.13 + vaddps 128+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm11 #893.13 vmulps %ymm11, %ymm0, %ymm12 #895.28 - vaddps 64+__svml_slog_ha_data_internal(%rip), %ymm12, %ymm13 #895.13 + vaddps 64+__jsvml_slog_ha_data_internal(%rip), %ymm12, %ymm13 #895.13 vmulps %ymm13, %ymm0, %ymm14 #897.28 - vaddps __svml_slog_ha_data_internal(%rip), %ymm14, %ymm15 #897.13 + vaddps __jsvml_slog_ha_data_internal(%rip), %ymm14, %ymm15 #897.13 vmulps %ymm15, %ymm0, %ymm2 #898.9 vmulps %ymm2, %ymm0, %ymm3 #899.24 vaddps %ymm3, %ymm0, %ymm2 #899.9 - vmulps 960+__svml_slog_ha_data_internal(%rip), %ymm1, %ymm3 #902.29 - vmulps 896+__svml_slog_ha_data_internal(%rip), %ymm1, %ymm1 #903.29 + vmulps 960+__jsvml_slog_ha_data_internal(%rip), %ymm1, %ymm3 #902.29 + vmulps 896+__jsvml_slog_ha_data_internal(%rip), %ymm1, %ymm1 #903.29 vaddps %ymm3, %ymm2, %ymm2 #902.14 vaddps %ymm1, %ymm2, %ymm0 #903.14 testb %dl, %dl #905.52 @@ -656,29 +656,29 @@ __svml_logf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #905.546 lea 128(%rsp,%r12,4), %rsi #905.546 -..___tag_value___svml_logf8_ha_e9.85: -# __svml_slog_ha_cout_rare_internal(const float *, float *) - call __svml_slog_ha_cout_rare_internal #905.546 -..___tag_value___svml_logf8_ha_e9.86: +..___tag_value___jsvml_logf8_ha_e9.85: +# __jsvml_slog_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog_ha_cout_rare_internal #905.546 +..___tag_value___jsvml_logf8_ha_e9.86: jmp ..B5.8 # Prob 100% #905.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_logf8_ha_e9,@function - .size __svml_logf8_ha_e9,.-__svml_logf8_ha_e9 -..LN__svml_logf8_ha_e9.4: + .type __jsvml_logf8_ha_e9,@function + .size __jsvml_logf8_ha_e9,.-__jsvml_logf8_ha_e9 +..LN__jsvml_logf8_ha_e9.4: .data -# -- End __svml_logf8_ha_e9 +# -- End __jsvml_logf8_ha_e9 .text -.L_2__routine_start___svml_logf8_ha_l9_5: -# -- Begin __svml_logf8_ha_l9 +.L_2__routine_start___jsvml_logf8_ha_l9_5: +# -- Begin __jsvml_logf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_logf8_ha_l9 -# --- __svml_logf8_ha_l9(__m256) -__svml_logf8_ha_l9: + .globl __jsvml_logf8_ha_l9 +# --- __jsvml_logf8_ha_l9(__m256) +__jsvml_logf8_ha_l9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -687,7 +687,7 @@ __svml_logf8_ha_l9: .byte 30 #973.546 .byte 250 #973.546 .cfi_startproc -..___tag_value___svml_logf8_ha_l9.88: +..___tag_value___jsvml_logf8_ha_l9.88: ..L89: #913.1 pushq %rbp #913.1 @@ -697,30 +697,30 @@ __svml_logf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #913.1 subq $192, %rsp #913.1 - vmovups 704+__svml_slog_ha_data_internal(%rip), %ymm4 #938.18 - vmovups 512+__svml_slog_ha_data_internal(%rip), %ymm9 #949.52 - vmovups 640+__svml_slog_ha_data_internal(%rip), %ymm5 #934.17 - vpaddd 576+__svml_slog_ha_data_internal(%rip), %ymm0, %ymm6 #936.15 + vmovups 704+__jsvml_slog_ha_data_internal(%rip), %ymm4 #938.18 + vmovups 512+__jsvml_slog_ha_data_internal(%rip), %ymm9 #949.52 + vmovups 640+__jsvml_slog_ha_data_internal(%rip), %ymm5 #934.17 + vpaddd 576+__jsvml_slog_ha_data_internal(%rip), %ymm0, %ymm6 #936.15 vpsubd %ymm4, %ymm0, %ymm2 #940.11 - vpand 768+__svml_slog_ha_data_internal(%rip), %ymm2, %ymm3 #941.11 + vpand 768+__jsvml_slog_ha_data_internal(%rip), %ymm2, %ymm3 #941.11 vpsrad $23, %ymm2, %ymm1 #942.11 vpaddd %ymm4, %ymm3, %ymm8 #943.11 vcvtdq2ps %ymm1, %ymm1 #944.9 - vsubps 832+__svml_slog_ha_data_internal(%rip), %ymm8, %ymm10 #948.9 - vfmadd213ps 448+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #951.13 - vfmadd213ps 384+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #953.13 - vfmadd213ps 320+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #955.13 - vfmadd213ps 256+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #957.13 - vfmadd213ps 192+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #959.13 - vfmadd213ps 128+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #961.13 - vfmadd213ps 64+__svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #963.13 - vfmadd213ps __svml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #965.13 + vsubps 832+__jsvml_slog_ha_data_internal(%rip), %ymm8, %ymm10 #948.9 + vfmadd213ps 448+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #951.13 + vfmadd213ps 384+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #953.13 + vfmadd213ps 320+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #955.13 + vfmadd213ps 256+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #957.13 + vfmadd213ps 192+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #959.13 + vfmadd213ps 128+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #961.13 + vfmadd213ps 64+__jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #963.13 + vfmadd213ps __jsvml_slog_ha_data_internal(%rip), %ymm10, %ymm9 #965.13 vmulps %ymm9, %ymm10, %ymm11 #966.9 vfmadd213ps %ymm10, %ymm10, %ymm11 #967.9 - vfmadd231ps 960+__svml_slog_ha_data_internal(%rip), %ymm1, %ymm11 #970.14 + vfmadd231ps 960+__jsvml_slog_ha_data_internal(%rip), %ymm1, %ymm11 #970.14 vpcmpgtd %ymm6, %ymm5, %ymm7 #937.19 vmovmskps %ymm7, %edx #946.41 - vfmadd132ps 896+__svml_slog_ha_data_internal(%rip), %ymm11, %ymm1 #971.14 + vfmadd132ps 896+__jsvml_slog_ha_data_internal(%rip), %ymm11, %ymm1 #971.14 testl %edx, %edx #973.52 jne ..B6.3 # Prob 5% #973.52 # LOE rbx r12 r13 r14 r15 edx ymm0 ymm1 @@ -781,30 +781,30 @@ __svml_logf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #973.546 lea 128(%rsp,%r12,4), %rsi #973.546 -..___tag_value___svml_logf8_ha_l9.106: -# __svml_slog_ha_cout_rare_internal(const float *, float *) - call __svml_slog_ha_cout_rare_internal #973.546 -..___tag_value___svml_logf8_ha_l9.107: +..___tag_value___jsvml_logf8_ha_l9.106: +# __jsvml_slog_ha_cout_rare_internal(const float *, float *) + call __jsvml_slog_ha_cout_rare_internal #973.546 +..___tag_value___jsvml_logf8_ha_l9.107: jmp ..B6.8 # Prob 100% #973.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_logf8_ha_l9,@function - .size __svml_logf8_ha_l9,.-__svml_logf8_ha_l9 -..LN__svml_logf8_ha_l9.5: + .type __jsvml_logf8_ha_l9,@function + .size __jsvml_logf8_ha_l9,.-__jsvml_logf8_ha_l9 +..LN__jsvml_logf8_ha_l9.5: .data -# -- End __svml_logf8_ha_l9 +# -- End __jsvml_logf8_ha_l9 .text -.L_2__routine_start___svml_slog_ha_cout_rare_internal_6: -# -- Begin __svml_slog_ha_cout_rare_internal +.L_2__routine_start___jsvml_slog_ha_cout_rare_internal_6: +# -- Begin __jsvml_slog_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_slog_ha_cout_rare_internal - .globl __svml_slog_ha_cout_rare_internal -# --- __svml_slog_ha_cout_rare_internal(const float *, float *) -__svml_slog_ha_cout_rare_internal: + .hidden __jsvml_slog_ha_cout_rare_internal + .globl __jsvml_slog_ha_cout_rare_internal +# --- __jsvml_slog_ha_cout_rare_internal(const float *, float *) +__jsvml_slog_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -814,7 +814,7 @@ __svml_slog_ha_cout_rare_internal: .byte 30 #764.13 .byte 250 #764.13 .cfi_startproc -..___tag_value___svml_slog_ha_cout_rare_internal.109: +..___tag_value___jsvml_slog_ha_cout_rare_internal.109: ..L110: #685.1 xorl %eax, %eax #695.14 @@ -999,17 +999,17 @@ __svml_slog_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_slog_ha_cout_rare_internal,@function - .size __svml_slog_ha_cout_rare_internal,.-__svml_slog_ha_cout_rare_internal -..LN__svml_slog_ha_cout_rare_internal.6: + .type __jsvml_slog_ha_cout_rare_internal,@function + .size __jsvml_slog_ha_cout_rare_internal,.-__jsvml_slog_ha_cout_rare_internal +..LN__jsvml_slog_ha_cout_rare_internal.6: .data -# -- End __svml_slog_ha_cout_rare_internal +# -- End __jsvml_slog_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_slog_ha_data_internal_avx512 - .globl __svml_slog_ha_data_internal_avx512 -__svml_slog_ha_data_internal_avx512: + .hidden __jsvml_slog_ha_data_internal_avx512 + .globl __jsvml_slog_ha_data_internal_avx512 +__jsvml_slog_ha_data_internal_avx512: .long 131072 .long 131072 .long 131072 @@ -1490,12 +1490,12 @@ __svml_slog_ha_data_internal_avx512: .long 3204448254 .long 3204448254 .long 3204448254 - .type __svml_slog_ha_data_internal_avx512,@object - .size __svml_slog_ha_data_internal_avx512,1920 + .type __jsvml_slog_ha_data_internal_avx512,@object + .size __jsvml_slog_ha_data_internal_avx512,1920 .align 64 - .hidden __svml_slog_ha_data_internal - .globl __svml_slog_ha_data_internal -__svml_slog_ha_data_internal: + .hidden __jsvml_slog_ha_data_internal + .globl __jsvml_slog_ha_data_internal +__jsvml_slog_ha_data_internal: .long 3204448256 .long 3204448256 .long 3204448256 @@ -1926,8 +1926,8 @@ __svml_slog_ha_data_internal: .byte 0 .byte 0 .byte 0 - .type __svml_slog_ha_data_internal,@object - .size __svml_slog_ha_data_internal,1216 + .type __jsvml_slog_ha_data_internal,@object + .size __jsvml_slog_ha_data_internal,1216 .align 32 _imlsLnHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_pow_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_pow_linux_x86.S similarity index 95% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_pow_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_pow_linux_x86.S index 1317cb0b64b..7a36b112fbb 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_pow_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_pow_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_pow.c" .text ..TXTST0: -.L_2__routine_start___svml_powf16_ha_z0_0: -# -- Begin __svml_powf16_ha_z0 +.L_2__routine_start___jsvml_powf16_ha_z0_0: +# -- Begin __jsvml_powf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_powf16_ha_z0 -# --- __svml_powf16_ha_z0(__m512, __m512) -__svml_powf16_ha_z0: + .globl __jsvml_powf16_ha_z0 +# --- __jsvml_powf16_ha_z0(__m512, __m512) +__jsvml_powf16_ha_z0: # parameter 1: %zmm0 # parameter 2: %zmm1 ..B1.1: # Preds ..B1.0 @@ -48,7 +48,7 @@ __svml_powf16_ha_z0: .byte 30 #3556.878 .byte 250 #3556.878 .cfi_startproc -..___tag_value___svml_powf16_ha_z0.1: +..___tag_value___jsvml_powf16_ha_z0.1: ..L2: #3421.1 pushq %rbp #3421.1 @@ -59,32 +59,32 @@ __svml_powf16_ha_z0: andq $-64, %rsp #3421.1 subq $256, %rsp #3421.1 vgetmantps $10, {sae}, %zmm0, %zmm5 #3487.28 - vmovups 576+__svml_spow_ha_data_internal_avx512(%rip), %zmm10 #3497.53 - vmovups 512+__svml_spow_ha_data_internal_avx512(%rip), %zmm9 #3495.53 - vmovups 640+__svml_spow_ha_data_internal_avx512(%rip), %zmm12 #3505.61 - vmovups 704+__svml_spow_ha_data_internal_avx512(%rip), %zmm13 #3506.61 + vmovups 576+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm10 #3497.53 + vmovups 512+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm9 #3495.53 + vmovups 640+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm12 #3505.61 + vmovups 704+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm13 #3506.61 vgetexpps {sae}, %zmm0, %zmm15 #3488.25 - vmovups __svml_spow_ha_data_internal_avx512(%rip), %zmm14 #3503.287 - vmovups 128+__svml_spow_ha_data_internal_avx512(%rip), %zmm4 #3504.287 + vmovups __jsvml_spow_ha_data_internal_avx512(%rip), %zmm14 #3503.287 + vmovups 128+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm4 #3504.287 vrcp14ps %zmm5, %zmm7 #3491.24 vfpclassps $223, %zmm0, %k0 #3489.27 vrndscaleps $88, {sae}, %zmm7, %zmm8 #3492.24 - vmovups 832+__svml_spow_ha_data_internal_avx512(%rip), %zmm7 #3513.22 + vmovups 832+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm7 #3513.22 kmovw %k0, %esi #3489.27 vfmsub213ps {rn-sae}, %zmm10, %zmm8, %zmm5 #3498.19 vcmpps $17, {sae}, %zmm9, %zmm8, %k2 #3496.26 vfmadd231ps {rn-sae}, %zmm5, %zmm12, %zmm13 #3507.22 - vmovups 896+__svml_spow_ha_data_internal_avx512(%rip), %zmm9 #3518.22 - vmovups 1024+__svml_spow_ha_data_internal_avx512(%rip), %zmm12 #3519.58 + vmovups 896+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm9 #3518.22 + vmovups 1024+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm12 #3519.58 vmulps {rn-sae}, %zmm5, %zmm5, %zmm3 #3508.22 vpsrld $18, %zmm8, %zmm11 #3499.45 vaddps {rn-sae}, %zmm10, %zmm15, %zmm15{%k2} #3501.25 - vmovups 960+__svml_spow_ha_data_internal_avx512(%rip), %zmm10 #3515.58 - vpermt2ps 64+__svml_spow_ha_data_internal_avx512(%rip), %zmm11, %zmm14 #3503.287 - vpermt2ps 192+__svml_spow_ha_data_internal_avx512(%rip), %zmm11, %zmm4 #3504.287 + vmovups 960+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm10 #3515.58 + vpermt2ps 64+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm11, %zmm14 #3503.287 + vpermt2ps 192+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm11, %zmm4 #3504.287 vaddps {rn-sae}, %zmm15, %zmm14, %zmm8 #3511.22 vmovaps %zmm1, %zmm6 #3421.1 - vmovups 768+__svml_spow_ha_data_internal_avx512(%rip), %zmm1 #3509.61 + vmovups 768+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm1 #3509.61 vfpclassps $153, %zmm6, %k1 #3490.28 vfmadd231ps {rn-sae}, %zmm5, %zmm13, %zmm1 #3510.22 kmovw %k1, %eax #3490.28 @@ -97,23 +97,23 @@ __svml_powf16_ha_z0: vmovaps %zmm8, %zmm11 #3516.23 vfmadd231ps {rn-sae}, %zmm5, %zmm10, %zmm11 #3516.23 vfmadd231ps {rn-sae}, %zmm5, %zmm9, %zmm2 #3523.20 - vmovups 1216+__svml_spow_ha_data_internal_avx512(%rip), %zmm9 #3547.63 + vmovups 1216+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm9 #3547.63 vsubps {rn-sae}, %zmm8, %zmm11, %zmm4 #3521.26 vmovaps %zmm11, %zmm14 #3522.23 vfmadd231ps {rn-sae}, %zmm3, %zmm12, %zmm14 #3522.23 vfmsub213ps {rn-sae}, %zmm4, %zmm10, %zmm5 #3524.24 - vmovups 1344+__svml_spow_ha_data_internal_avx512(%rip), %zmm10 #3550.63 + vmovups 1344+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm10 #3550.63 vaddps {rn-sae}, %zmm2, %zmm14, %zmm1 #3526.24 vsubps {rn-sae}, %zmm11, %zmm14, %zmm13 #3525.27 vmulps {rz-sae}, %zmm6, %zmm1, %zmm4 #3529.21 vfmsub213ps {rn-sae}, %zmm13, %zmm12, %zmm3 #3527.25 - vmovups 384+__svml_spow_ha_data_internal_avx512(%rip), %zmm12 #3544.288 - vmovups 256+__svml_spow_ha_data_internal_avx512(%rip), %zmm13 #3543.288 + vmovups 384+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm12 #3544.288 + vmovups 256+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm13 #3543.288 vsubps {rn-sae}, %zmm14, %zmm1, %zmm15 #3528.23 vaddps {rn-sae}, %zmm3, %zmm5, %zmm3 #3530.26 vfmsub213ps {rz-sae}, %zmm4, %zmm6, %zmm1 #3532.20 - vmovups 1088+__svml_spow_ha_data_internal_avx512(%rip), %zmm5 #3538.57 - vmovups 1280+__svml_spow_ha_data_internal_avx512(%rip), %zmm14 #3548.63 + vmovups 1088+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm5 #3538.57 + vmovups 1280+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm14 #3548.63 vsubps {rn-sae}, %zmm15, %zmm2, %zmm2 #3531.22 vaddps {rn-sae}, %zmm3, %zmm2, %zmm2 #3533.22 vfmadd213ps {rz-sae}, %zmm1, %zmm6, %zmm2 #3534.20 @@ -122,10 +122,10 @@ __svml_powf16_ha_z0: vaddps {rd-sae}, %zmm5, %zmm1, %zmm7 #3539.28 vreduceps $81, {sae}, %zmm1, %zmm3 #3536.20 vsubps {rn-sae}, %zmm4, %zmm2, %zmm5 #3540.22 - vpermt2ps 448+__svml_spow_ha_data_internal_avx512(%rip), %zmm7, %zmm12 #3544.288 - vpermt2ps 320+__svml_spow_ha_data_internal_avx512(%rip), %zmm7, %zmm13 #3543.288 + vpermt2ps 448+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm7, %zmm12 #3544.288 + vpermt2ps 320+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm7, %zmm13 #3543.288 vaddps {rn-sae}, %zmm5, %zmm3, %zmm8 #3541.22 - vandps 1152+__svml_spow_ha_data_internal_avx512(%rip), %zmm8, %zmm11 #3546.20 + vandps 1152+__jsvml_spow_ha_data_internal_avx512(%rip), %zmm8, %zmm11 #3546.20 vfmadd231ps {rn-sae}, %zmm11, %zmm9, %zmm14 #3549.20 vfmadd213ps {rn-sae}, %zmm10, %zmm11, %zmm14 #3551.20 vfmadd213ps {rn-sae}, %zmm12, %zmm11, %zmm14 #3552.20 @@ -242,29 +242,29 @@ __svml_powf16_ha_z0: lea 64(%rsp,%rbx,4), %rdi #3556.878 lea 128(%rsp,%rbx,4), %rsi #3556.878 lea 192(%rsp,%rbx,4), %rdx #3556.878 -..___tag_value___svml_powf16_ha_z0.29: -# __svml_spow_ha_cout_rare_internal(const float *, float *, float *) - call __svml_spow_ha_cout_rare_internal #3556.878 -..___tag_value___svml_powf16_ha_z0.30: +..___tag_value___jsvml_powf16_ha_z0.29: +# __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) + call __jsvml_spow_ha_cout_rare_internal #3556.878 +..___tag_value___jsvml_powf16_ha_z0.30: jmp ..B1.13 # Prob 100% #3556.878 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_powf16_ha_z0,@function - .size __svml_powf16_ha_z0,.-__svml_powf16_ha_z0 -..LN__svml_powf16_ha_z0.0: + .type __jsvml_powf16_ha_z0,@function + .size __jsvml_powf16_ha_z0,.-__jsvml_powf16_ha_z0 +..LN__jsvml_powf16_ha_z0.0: .data -# -- End __svml_powf16_ha_z0 +# -- End __jsvml_powf16_ha_z0 .text -.L_2__routine_start___svml_powf8_ha_l9_1: -# -- Begin __svml_powf8_ha_l9 +.L_2__routine_start___jsvml_powf8_ha_l9_1: +# -- Begin __jsvml_powf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_powf8_ha_l9 -# --- __svml_powf8_ha_l9(__m256, __m256) -__svml_powf8_ha_l9: + .globl __jsvml_powf8_ha_l9 +# --- __jsvml_powf8_ha_l9(__m256, __m256) +__jsvml_powf8_ha_l9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B2.1: # Preds ..B2.0 @@ -274,7 +274,7 @@ __svml_powf8_ha_l9: .byte 30 #4438.663 .byte 250 #4438.663 .cfi_startproc -..___tag_value___svml_powf8_ha_l9.32: +..___tag_value___jsvml_powf8_ha_l9.32: ..L33: #4288.1 pushq %rbp #4288.1 @@ -284,13 +284,13 @@ __svml_powf8_ha_l9: .cfi_offset 6, -16 andq $-64, %rsp #4288.1 subq $256, %rsp #4288.1 - lea 13952+__svml_spow_ha_data_internal(%rip), %rdx #4390.78 - vmovupd 12992+__svml_spow_ha_data_internal(%rip), %ymm8 #4374.54 - vmovupd 13056+__svml_spow_ha_data_internal(%rip), %ymm14 #4375.52 + lea 13952+__jsvml_spow_ha_data_internal(%rip), %rdx #4390.78 + vmovupd 12992+__jsvml_spow_ha_data_internal(%rip), %ymm8 #4374.54 + vmovupd 13056+__jsvml_spow_ha_data_internal(%rip), %ymm14 #4375.52 vmovaps %ymm1, %ymm13 #4288.1 vextractf128 $1, %ymm0, %xmm9 #4363.102 vcvtps2pd %xmm0, %ymm7 #4363.19 - vpsubd __svml_spow_ha_data_internal(%rip), %ymm0, %ymm10 #4369.19 + vpsubd __jsvml_spow_ha_data_internal(%rip), %ymm0, %ymm10 #4369.19 vcvtps2pd %xmm9, %ymm2 #4363.85 vandpd %ymm8, %ymm7, %ymm4 #4376.21 vandpd %ymm8, %ymm2, %ymm6 #4376.77 @@ -309,7 +309,7 @@ __svml_powf8_ha_l9: vpermps %ymm2, %ymm14, %ymm15 #4383.309 vpermps %ymm7, %ymm14, %ymm6 #4383.189 vroundpd $0, %ymm5, %ymm14 #4384.91 - vmovupd 13312+__svml_spow_ha_data_internal(%rip), %ymm5 #4386.50 + vmovupd 13312+__jsvml_spow_ha_data_internal(%rip), %ymm5 #4386.50 vfmsub213pd %ymm5, %ymm1, %ymm8 #4387.15 vfmsub213pd %ymm5, %ymm14, %ymm4 #4387.82 vcvtdq2pd %xmm15, %ymm3 #4385.104 @@ -343,48 +343,48 @@ __svml_powf8_ha_l9: vmovhpd -4232448(%rdx,%r9), %xmm15, %xmm7 #4390.822 vmovsd -4232448(%rdx,%r10), %xmm15 #4390.1185 vmovhpd -4232448(%rdx,%r11), %xmm15, %xmm6 #4390.1168 - vmovupd 13504+__svml_spow_ha_data_internal(%rip), %ymm15 #4391.56 + vmovupd 13504+__jsvml_spow_ha_data_internal(%rip), %ymm15 #4391.56 vcmplt_oqpd %ymm1, %ymm15, %ymm1 #4395.18 vcmplt_oqpd %ymm14, %ymm15, %ymm14 #4395.89 - vmovupd 13568+__svml_spow_ha_data_internal(%rip), %ymm15 #4396.18 + vmovupd 13568+__jsvml_spow_ha_data_internal(%rip), %ymm15 #4396.18 vandpd %ymm15, %ymm1, %ymm1 #4396.18 vandpd %ymm15, %ymm14, %ymm14 #4396.71 - vmovupd 13632+__svml_spow_ha_data_internal(%rip), %ymm15 #4396.125 + vmovupd 13632+__jsvml_spow_ha_data_internal(%rip), %ymm15 #4396.125 vorpd %ymm15, %ymm1, %ymm1 #4396.125 vorpd %ymm15, %ymm14, %ymm14 #4396.178 vsubpd %ymm1, %ymm2, %ymm2 #4397.20 vsubpd %ymm14, %ymm3, %ymm3 #4397.78 - vmovupd 12928+__svml_spow_ha_data_internal(%rip), %ymm14 #4400.60 + vmovupd 12928+__jsvml_spow_ha_data_internal(%rip), %ymm14 #4400.60 vmovapd %ymm14, %ymm15 #4401.16 vinsertf128 $1, %xmm6, %ymm7, %ymm6 #4390.776 - vmovupd 13696+__svml_spow_ha_data_internal(%rip), %ymm7 #4394.49 + vmovupd 13696+__jsvml_spow_ha_data_internal(%rip), %ymm7 #4394.49 vmulpd %ymm2, %ymm7, %ymm1 #4398.15 vmulpd %ymm3, %ymm7, %ymm2 #4398.65 - vmovupd 12864+__svml_spow_ha_data_internal(%rip), %ymm3 #4399.60 + vmovupd 12864+__jsvml_spow_ha_data_internal(%rip), %ymm3 #4399.60 vmulpd %ymm8, %ymm8, %ymm7 #4402.15 vfmadd231pd %ymm8, %ymm3, %ymm15 #4401.16 vfmadd231pd %ymm4, %ymm3, %ymm14 #4401.95 vmulpd %ymm4, %ymm4, %ymm3 #4402.60 vmulpd %ymm7, %ymm15, %ymm15 #4403.15 vmulpd %ymm3, %ymm14, %ymm3 #4403.61 - vmovups 64+__svml_spow_ha_data_internal(%rip), %ymm14 #4370.36 + vmovups 64+__jsvml_spow_ha_data_internal(%rip), %ymm14 #4370.36 vaddpd %ymm15, %ymm8, %ymm8 #4404.15 vaddpd %ymm3, %ymm4, %ymm4 #4404.60 vaddpd %ymm8, %ymm5, %ymm8 #4405.15 vaddpd %ymm4, %ymm6, %ymm4 #4405.60 vaddpd %ymm8, %ymm1, %ymm5 #4406.15 vaddpd %ymm4, %ymm2, %ymm3 #4406.60 - vmovupd 30464+__svml_spow_ha_data_internal(%rip), %ymm1 #4413.56 + vmovupd 30464+__jsvml_spow_ha_data_internal(%rip), %ymm1 #4413.56 vpcmpgtd %ymm14, %ymm10, %ymm15 #4370.36 vpcmpeqd %ymm14, %ymm10, %ymm10 #4370.86 vextractf128 $1, %ymm13, %xmm11 #4364.102 vcvtps2pd %xmm13, %ymm9 #4364.19 vcvtps2pd %xmm11, %ymm12 #4364.85 - vpand 192+__svml_spow_ha_data_internal(%rip), %ymm13, %ymm11 #4371.19 + vpand 192+__jsvml_spow_ha_data_internal(%rip), %ymm13, %ymm11 #4371.19 vmulpd %ymm5, %ymm9, %ymm7 #4407.15 - vmovupd 30528+__svml_spow_ha_data_internal(%rip), %ymm9 #4410.53 + vmovupd 30528+__jsvml_spow_ha_data_internal(%rip), %ymm9 #4410.53 vmulpd %ymm3, %ymm12, %ymm8 #4407.60 - vmovupd 30400+__svml_spow_ha_data_internal(%rip), %ymm12 #4408.57 + vmovupd 30400+__jsvml_spow_ha_data_internal(%rip), %ymm12 #4408.57 vmulpd %ymm7, %ymm12, %ymm5 #4409.17 vmulpd %ymm8, %ymm12, %ymm4 #4409.72 vsubpd %ymm9, %ymm5, %ymm12 #4411.15 @@ -396,19 +396,19 @@ __svml_powf8_ha_l9: vmovups __VPACK_ODD_ind.1471.0.4(%rip), %ymm1 #4416.259 vsubpd %ymm2, %ymm5, %ymm5 #4426.15 vsubpd %ymm3, %ymm4, %ymm2 #4426.62 - vmovupd 30592+__svml_spow_ha_data_internal(%rip), %ymm4 #4427.51 + vmovupd 30592+__jsvml_spow_ha_data_internal(%rip), %ymm4 #4427.51 vpermps %ymm7, %ymm1, %ymm6 #4416.188 vpermps %ymm8, %ymm1, %ymm7 #4416.305 - vmovups 128+__svml_spow_ha_data_internal(%rip), %ymm8 #4372.36 + vmovups 128+__jsvml_spow_ha_data_internal(%rip), %ymm8 #4372.36 vpor %ymm10, %ymm15, %ymm1 #4370.19 vpcmpgtd %ymm8, %ymm11, %ymm10 #4372.36 vpcmpeqd %ymm8, %ymm11, %ymm11 #4372.82 - vmovupd 30656+__svml_spow_ha_data_internal(%rip), %ymm8 #4424.24 + vmovupd 30656+__jsvml_spow_ha_data_internal(%rip), %ymm8 #4424.24 vinsertf128 $1, %xmm7, %ymm6, %ymm7 #4416.118 vpor %ymm11, %ymm10, %ymm6 #4372.19 vpor %ymm6, %ymm1, %ymm14 #4373.23 - vandps 30720+__svml_spow_ha_data_internal(%rip), %ymm7, %ymm7 #4418.18 - vpcmpgtd 30784+__svml_spow_ha_data_internal(%rip), %ymm7, %ymm15 #4420.25 + vandps 30720+__jsvml_spow_ha_data_internal(%rip), %ymm7, %ymm7 #4418.18 + vpcmpgtd 30784+__jsvml_spow_ha_data_internal(%rip), %ymm7, %ymm15 #4420.25 vpor %ymm15, %ymm14, %ymm11 #4421.23 vmovmskps %ymm11, %eax #4422.45 vandps %ymm8, %ymm12, %ymm11 #4425.17 @@ -516,18 +516,18 @@ __svml_powf8_ha_l9: lea 64(%rsp,%r12,4), %rdi #4438.663 lea 128(%rsp,%r12,4), %rsi #4438.663 lea 192(%rsp,%r12,4), %rdx #4438.663 -..___tag_value___svml_powf8_ha_l9.50: -# __svml_spow_ha_cout_rare_internal(const float *, float *, float *) - call __svml_spow_ha_cout_rare_internal #4438.663 -..___tag_value___svml_powf8_ha_l9.51: +..___tag_value___jsvml_powf8_ha_l9.50: +# __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) + call __jsvml_spow_ha_cout_rare_internal #4438.663 +..___tag_value___jsvml_powf8_ha_l9.51: jmp ..B2.8 # Prob 100% #4438.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_powf8_ha_l9,@function - .size __svml_powf8_ha_l9,.-__svml_powf8_ha_l9 -..LN__svml_powf8_ha_l9.1: + .type __jsvml_powf8_ha_l9,@function + .size __jsvml_powf8_ha_l9,.-__jsvml_powf8_ha_l9 +..LN__jsvml_powf8_ha_l9.1: .section .rodata, "a" .align 64 .align 64 @@ -552,16 +552,16 @@ __VPACK_ODD_ind.1471.0.4: .long 0 .long 0 .data -# -- End __svml_powf8_ha_l9 +# -- End __jsvml_powf8_ha_l9 .text -.L_2__routine_start___svml_powf4_ha_e9_2: -# -- Begin __svml_powf4_ha_e9 +.L_2__routine_start___jsvml_powf4_ha_e9_2: +# -- Begin __jsvml_powf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_powf4_ha_e9 -# --- __svml_powf4_ha_e9(__m128, __m128) -__svml_powf4_ha_e9: + .globl __jsvml_powf4_ha_e9 +# --- __jsvml_powf4_ha_e9(__m128, __m128) +__jsvml_powf4_ha_e9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B3.1: # Preds ..B3.0 @@ -571,7 +571,7 @@ __svml_powf4_ha_e9: .byte 30 #4596.654 .byte 250 #4596.654 .cfi_startproc -..___tag_value___svml_powf4_ha_e9.53: +..___tag_value___jsvml_powf4_ha_e9.53: ..L54: #4446.1 pushq %rbp #4446.1 @@ -581,16 +581,16 @@ __svml_powf4_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #4446.1 subq $256, %rsp #4446.1 - lea 13952+__svml_spow_ha_data_internal(%rip), %rdx #4548.76 + lea 13952+__jsvml_spow_ha_data_internal(%rip), %rdx #4548.76 vcvtps2pd %xmm0, %ymm4 #4521.19 vcvtps2pd %xmm1, %ymm12 #4522.19 - vmovups 64+__svml_spow_ha_data_internal(%rip), %xmm13 #4524.25 - vmovups 128+__svml_spow_ha_data_internal(%rip), %xmm14 #4525.21 - vpand 192+__svml_spow_ha_data_internal(%rip), %xmm1, %xmm3 #4529.23 - vandpd 12992+__svml_spow_ha_data_internal(%rip), %ymm4, %ymm2 #4534.19 - vorpd 13056+__svml_spow_ha_data_internal(%rip), %ymm2, %ymm11 #4535.19 + vmovups 64+__jsvml_spow_ha_data_internal(%rip), %xmm13 #4524.25 + vmovups 128+__jsvml_spow_ha_data_internal(%rip), %xmm14 #4525.21 + vpand 192+__jsvml_spow_ha_data_internal(%rip), %xmm1, %xmm3 #4529.23 + vandpd 12992+__jsvml_spow_ha_data_internal(%rip), %ymm4, %ymm2 #4534.19 + vorpd 13056+__jsvml_spow_ha_data_internal(%rip), %ymm2, %ymm11 #4535.19 vcvtpd2ps %ymm11, %xmm6 #4538.44 - vpsubd __svml_spow_ha_data_internal(%rip), %xmm0, %xmm15 #4527.23 + vpsubd __jsvml_spow_ha_data_internal(%rip), %xmm0, %xmm15 #4527.23 vrcpps %xmm6, %xmm5 #4538.33 vcvtps2pd %xmm5, %ymm10 #4538.17 vroundpd $0, %ymm10, %ymm10 #4542.17 @@ -600,7 +600,7 @@ __svml_powf4_ha_e9: vpsrlq $20, %xmm7, %xmm9 #4540.80 vshufps $221, %xmm9, %xmm8, %xmm2 #4541.41 vcvtdq2pd %xmm2, %ymm9 #4543.24 - vsubpd 13312+__svml_spow_ha_data_internal(%rip), %ymm11, %ymm8 #4545.13 + vsubpd 13312+__jsvml_spow_ha_data_internal(%rip), %ymm11, %ymm8 #4545.13 vpsrlq $40, %xmm10, %xmm6 #4547.22 vextractf128 $1, %ymm10, %xmm2 #4546.114 vmovd %xmm6, %eax #4548.174 @@ -612,23 +612,23 @@ __svml_powf4_ha_e9: vpextrd $2, %xmm7, %edi #4548.610 movslq %ecx, %rcx #4548.214 movslq %edi, %rdi #4548.512 - vmovupd 13504+__svml_spow_ha_data_internal(%rip), %ymm6 #4549.54 + vmovupd 13504+__jsvml_spow_ha_data_internal(%rip), %ymm6 #4549.54 vmovsd -4232448(%rdx,%rax), %xmm5 #4548.76 vmovsd -4232448(%rdx,%rsi), %xmm11 #4548.374 vmovhpd -4232448(%rdx,%rcx), %xmm5, %xmm4 #4548.59 vmovhpd -4232448(%rdx,%rdi), %xmm11, %xmm2 #4548.357 vcmplt_oqpd %ymm10, %ymm6, %ymm5 #4553.16 - vandpd 13568+__svml_spow_ha_data_internal(%rip), %ymm5, %ymm10 #4554.16 + vandpd 13568+__jsvml_spow_ha_data_internal(%rip), %ymm5, %ymm10 #4554.16 vmulpd %ymm8, %ymm8, %ymm5 #4560.13 - vorpd 13632+__svml_spow_ha_data_internal(%rip), %ymm10, %ymm11 #4554.64 + vorpd 13632+__jsvml_spow_ha_data_internal(%rip), %ymm10, %ymm11 #4554.64 vsubpd %ymm11, %ymm9, %ymm9 #4555.18 - vmovupd 30656+__svml_spow_ha_data_internal(%rip), %xmm11 #4582.26 - vmulpd 13696+__svml_spow_ha_data_internal(%rip), %ymm9, %ymm9 #4556.13 + vmovupd 30656+__jsvml_spow_ha_data_internal(%rip), %xmm11 #4582.26 + vmulpd 13696+__jsvml_spow_ha_data_internal(%rip), %ymm9, %ymm9 #4556.13 vinsertf128 $1, %xmm2, %ymm4, %ymm7 #4548.13 - vmulpd 12864+__svml_spow_ha_data_internal(%rip), %ymm8, %ymm2 #4559.29 - vaddpd 12928+__svml_spow_ha_data_internal(%rip), %ymm2, %ymm6 #4559.14 + vmulpd 12864+__jsvml_spow_ha_data_internal(%rip), %ymm8, %ymm2 #4559.29 + vaddpd 12928+__jsvml_spow_ha_data_internal(%rip), %ymm2, %ymm6 #4559.14 vmulpd %ymm5, %ymm6, %ymm4 #4561.13 - vmovupd 30464+__svml_spow_ha_data_internal(%rip), %ymm5 #4571.54 + vmovupd 30464+__jsvml_spow_ha_data_internal(%rip), %ymm5 #4571.54 vaddpd %ymm4, %ymm8, %ymm8 #4562.13 vaddpd %ymm8, %ymm7, %ymm2 #4563.13 vpcmpgtd %xmm13, %xmm15, %xmm7 #4528.37 @@ -640,16 +640,16 @@ __svml_powf4_ha_e9: vpor %xmm14, %xmm15, %xmm3 #4530.23 vpor %xmm3, %xmm7, %xmm8 #4531.27 vmulpd %ymm6, %ymm12, %ymm12 #4565.13 - vmulpd 30400+__svml_spow_ha_data_internal(%rip), %ymm12, %ymm6 #4567.15 - vsubpd 30528+__svml_spow_ha_data_internal(%rip), %ymm6, %ymm2 #4569.13 + vmulpd 30400+__jsvml_spow_ha_data_internal(%rip), %ymm12, %ymm6 #4567.15 + vsubpd 30528+__jsvml_spow_ha_data_internal(%rip), %ymm6, %ymm2 #4569.13 vaddpd %ymm2, %ymm5, %ymm2 #4572.13 vsubpd %ymm5, %ymm2, %ymm5 #4573.13 vsubpd %ymm5, %ymm6, %ymm5 #4584.13 vextractf128 $1, %ymm12, %xmm4 #4570.104 vshufps $221, %xmm4, %xmm12, %xmm4 #4574.40 - vandps 30720+__svml_spow_ha_data_internal(%rip), %xmm4, %xmm4 #4576.22 - vpcmpgtd 30784+__svml_spow_ha_data_internal(%rip), %xmm4, %xmm9 #4578.29 - vmulpd 30592+__svml_spow_ha_data_internal(%rip), %ymm5, %ymm4 #4586.13 + vandps 30720+__jsvml_spow_ha_data_internal(%rip), %xmm4, %xmm4 #4576.22 + vpcmpgtd 30784+__jsvml_spow_ha_data_internal(%rip), %xmm4, %xmm9 #4578.29 + vmulpd 30592+__jsvml_spow_ha_data_internal(%rip), %ymm5, %ymm4 #4586.13 vpor %xmm9, %xmm8, %xmm10 #4579.27 vmovmskps %xmm10, %eax #4580.44 vandps %xmm11, %xmm2, %xmm12 #4583.19 @@ -745,29 +745,29 @@ __svml_powf4_ha_e9: lea 64(%rsp,%r12,4), %rdi #4596.654 lea 128(%rsp,%r12,4), %rsi #4596.654 lea 192(%rsp,%r12,4), %rdx #4596.654 -..___tag_value___svml_powf4_ha_e9.71: -# __svml_spow_ha_cout_rare_internal(const float *, float *, float *) - call __svml_spow_ha_cout_rare_internal #4596.654 -..___tag_value___svml_powf4_ha_e9.72: +..___tag_value___jsvml_powf4_ha_e9.71: +# __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) + call __jsvml_spow_ha_cout_rare_internal #4596.654 +..___tag_value___jsvml_powf4_ha_e9.72: jmp ..B3.8 # Prob 100% #4596.654 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_powf4_ha_e9,@function - .size __svml_powf4_ha_e9,.-__svml_powf4_ha_e9 -..LN__svml_powf4_ha_e9.2: + .type __jsvml_powf4_ha_e9,@function + .size __jsvml_powf4_ha_e9,.-__jsvml_powf4_ha_e9 +..LN__jsvml_powf4_ha_e9.2: .data -# -- End __svml_powf4_ha_e9 +# -- End __jsvml_powf4_ha_e9 .text -.L_2__routine_start___svml_powf8_ha_e9_3: -# -- Begin __svml_powf8_ha_e9 +.L_2__routine_start___jsvml_powf8_ha_e9_3: +# -- Begin __jsvml_powf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_powf8_ha_e9 -# --- __svml_powf8_ha_e9(__m256, __m256) -__svml_powf8_ha_e9: + .globl __jsvml_powf8_ha_e9 +# --- __jsvml_powf8_ha_e9(__m256, __m256) +__jsvml_powf8_ha_e9: # parameter 1: %ymm0 # parameter 2: %ymm1 ..B4.1: # Preds ..B4.0 @@ -777,7 +777,7 @@ __svml_powf8_ha_e9: .byte 30 #4754.663 .byte 250 #4754.663 .cfi_startproc -..___tag_value___svml_powf8_ha_e9.74: +..___tag_value___jsvml_powf8_ha_e9.74: ..L75: #4604.1 pushq %rbp #4604.1 @@ -787,12 +787,12 @@ __svml_powf8_ha_e9: .cfi_offset 6, -16 andq $-64, %rsp #4604.1 subq $256, %rsp #4604.1 - lea 13952+__svml_spow_ha_data_internal(%rip), %rdx #4706.78 + lea 13952+__jsvml_spow_ha_data_internal(%rip), %rdx #4706.78 vmovups %ymm0, (%rsp) #4604.1[spill] - vmovupd 12992+__svml_spow_ha_data_internal(%rip), %ymm9 #4690.54 - vmovupd 13056+__svml_spow_ha_data_internal(%rip), %ymm7 #4691.52 - vmovups __svml_spow_ha_data_internal(%rip), %xmm2 #4681.26 - vmovups 192+__svml_spow_ha_data_internal(%rip), %xmm14 #4684.25 + vmovupd 12992+__jsvml_spow_ha_data_internal(%rip), %ymm9 #4690.54 + vmovupd 13056+__jsvml_spow_ha_data_internal(%rip), %ymm7 #4691.52 + vmovups __jsvml_spow_ha_data_internal(%rip), %xmm2 #4681.26 + vmovups 192+__jsvml_spow_ha_data_internal(%rip), %xmm14 #4684.25 vextractf128 $1, %ymm1, %xmm11 #4678.105 vmovups %ymm1, 32(%rsp) #4604.1[spill] vpand %xmm14, %xmm11, %xmm8 #4687.90 @@ -821,7 +821,7 @@ __svml_powf8_ha_e9: vpsrlq $20, %xmm4, %xmm14 #4698.86 vshufps $221, %xmm14, %xmm11, %xmm11 #4699.41 vroundpd $0, %ymm7, %ymm14 #4700.19 - vmovupd 13312+__svml_spow_ha_data_internal(%rip), %ymm7 #4702.50 + vmovupd 13312+__jsvml_spow_ha_data_internal(%rip), %ymm7 #4702.50 vcvtdq2pd %xmm11, %ymm11 #4701.24 vmulpd %ymm14, %ymm5, %ymm5 #4703.30 vpsrlq $20, %xmm13, %xmm8 #4698.148 @@ -862,25 +862,25 @@ __svml_powf8_ha_e9: vinsertf128 $1, %xmm6, %ymm8, %ymm8 #4706.15 vmovsd -4232448(%rdx,%r10), %xmm6 #4706.1043 vmovhpd -4232448(%rdx,%r11), %xmm6, %xmm4 #4706.1026 - vmovupd 13504+__svml_spow_ha_data_internal(%rip), %ymm6 #4707.56 + vmovupd 13504+__jsvml_spow_ha_data_internal(%rip), %ymm6 #4707.56 vmovsd -4232448(%rdx,%r8), %xmm7 #4706.741 vmovhpd -4232448(%rdx,%r9), %xmm7, %xmm5 #4706.724 - vmovupd 13568+__svml_spow_ha_data_internal(%rip), %ymm7 #4708.51 + vmovupd 13568+__jsvml_spow_ha_data_internal(%rip), %ymm7 #4708.51 vcmplt_oqpd %ymm14, %ymm6, %ymm14 #4711.18 vcmplt_oqpd %ymm13, %ymm6, %ymm6 #4711.89 vandpd %ymm7, %ymm14, %ymm13 #4712.18 vandpd %ymm7, %ymm6, %ymm14 #4712.71 - vmovupd 13632+__svml_spow_ha_data_internal(%rip), %ymm6 #4712.125 + vmovupd 13632+__jsvml_spow_ha_data_internal(%rip), %ymm6 #4712.125 vorpd %ymm6, %ymm13, %ymm13 #4712.125 vorpd %ymm6, %ymm14, %ymm14 #4712.178 vsubpd %ymm13, %ymm11, %ymm11 #4713.20 vsubpd %ymm14, %ymm12, %ymm12 #4713.78 - vmovupd 12928+__svml_spow_ha_data_internal(%rip), %ymm14 #4716.60 + vmovupd 12928+__jsvml_spow_ha_data_internal(%rip), %ymm14 #4716.60 vinsertf128 $1, %xmm4, %ymm5, %ymm5 #4706.678 - vmovupd 13696+__svml_spow_ha_data_internal(%rip), %ymm4 #4710.49 + vmovupd 13696+__jsvml_spow_ha_data_internal(%rip), %ymm4 #4710.49 vmulpd %ymm11, %ymm4, %ymm7 #4714.15 vmulpd %ymm12, %ymm4, %ymm6 #4714.65 - vmovupd 12864+__svml_spow_ha_data_internal(%rip), %ymm4 #4715.60 + vmovupd 12864+__jsvml_spow_ha_data_internal(%rip), %ymm4 #4715.60 vmulpd %ymm10, %ymm4, %ymm13 #4717.31 vmulpd %ymm9, %ymm4, %ymm12 #4717.125 vaddpd %ymm13, %ymm14, %ymm11 #4717.16 @@ -895,27 +895,27 @@ __svml_powf8_ha_e9: vaddpd %ymm13, %ymm5, %ymm9 #4721.60 vaddpd %ymm4, %ymm7, %ymm13 #4722.15 vaddpd %ymm9, %ymm6, %ymm4 #4722.60 - vmovupd 30464+__svml_spow_ha_data_internal(%rip), %ymm9 #4729.56 + vmovupd 30464+__jsvml_spow_ha_data_internal(%rip), %ymm9 #4729.56 vmulpd %ymm13, %ymm15, %ymm14 #4723.15 vmulpd %ymm4, %ymm3, %ymm13 #4723.60 - vmovupd 30400+__svml_spow_ha_data_internal(%rip), %ymm3 #4724.57 - vmovupd 30528+__svml_spow_ha_data_internal(%rip), %ymm15 #4726.53 + vmovupd 30400+__jsvml_spow_ha_data_internal(%rip), %ymm3 #4724.57 + vmovupd 30528+__jsvml_spow_ha_data_internal(%rip), %ymm15 #4726.53 vmulpd %ymm14, %ymm3, %ymm6 #4725.17 vmulpd %ymm13, %ymm3, %ymm3 #4725.72 vsubpd %ymm15, %ymm6, %ymm11 #4727.15 vsubpd %ymm15, %ymm3, %ymm8 #4727.66 vaddpd %ymm11, %ymm9, %ymm11 #4730.15 vaddpd %ymm8, %ymm9, %ymm4 #4730.67 - vmovups 30720+__svml_spow_ha_data_internal(%rip), %xmm8 #4733.25 + vmovups 30720+__jsvml_spow_ha_data_internal(%rip), %xmm8 #4733.25 vsubpd %ymm9, %ymm11, %ymm7 #4731.15 vsubpd %ymm9, %ymm4, %ymm5 #4731.67 - vmovups 30784+__svml_spow_ha_data_internal(%rip), %xmm9 #4735.29 + vmovups 30784+__jsvml_spow_ha_data_internal(%rip), %xmm9 #4735.29 vsubpd %ymm7, %ymm6, %ymm6 #4742.15 vsubpd %ymm5, %ymm3, %ymm5 #4742.62 - vmovupd 30592+__svml_spow_ha_data_internal(%rip), %ymm3 #4743.51 + vmovupd 30592+__jsvml_spow_ha_data_internal(%rip), %ymm3 #4743.51 vextractf128 $1, %ymm13, %xmm12 #4728.254 vshufps $221, %xmm12, %xmm13, %xmm10 #4732.183 - vmovups 64+__svml_spow_ha_data_internal(%rip), %xmm12 #4686.37 + vmovups 64+__jsvml_spow_ha_data_internal(%rip), %xmm12 #4686.37 vandps %xmm8, %xmm10, %xmm10 #4734.91 vextractf128 $1, %ymm14, %xmm15 #4728.110 vshufps $221, %xmm15, %xmm14, %xmm15 #4732.40 @@ -923,7 +923,7 @@ __svml_powf8_ha_e9: vpcmpeqd %xmm12, %xmm0, %xmm0 #4686.92 vandps %xmm8, %xmm15, %xmm15 #4734.22 vpor %xmm0, %xmm14, %xmm14 #4686.23 - vmovups 128+__svml_spow_ha_data_internal(%rip), %xmm0 #4688.37 + vmovups 128+__jsvml_spow_ha_data_internal(%rip), %xmm0 #4688.37 vpcmpgtd %xmm0, %xmm2, %xmm13 #4688.37 vpcmpeqd %xmm0, %xmm2, %xmm2 #4688.88 vpor %xmm2, %xmm13, %xmm13 #4688.23 @@ -940,7 +940,7 @@ __svml_powf8_ha_e9: vpor %xmm1, %xmm2, %xmm12 #4689.99 vpcmpgtd %xmm9, %xmm10, %xmm13 #4736.111 vpor %xmm13, %xmm12, %xmm0 #4737.109 - vmovupd 30656+__svml_spow_ha_data_internal(%rip), %xmm15 #4740.28 + vmovupd 30656+__jsvml_spow_ha_data_internal(%rip), %xmm15 #4740.28 vpxor %xmm1, %xmm1, %xmm1 #4738.62 vpackssdw %xmm0, %xmm14, %xmm2 #4738.79 vpacksswb %xmm1, %xmm2, %xmm14 #4738.62 @@ -1066,29 +1066,29 @@ __svml_powf8_ha_e9: lea 64(%rsp,%r12,4), %rdi #4754.663 lea 128(%rsp,%r12,4), %rsi #4754.663 lea 192(%rsp,%r12,4), %rdx #4754.663 -..___tag_value___svml_powf8_ha_e9.98: -# __svml_spow_ha_cout_rare_internal(const float *, float *, float *) - call __svml_spow_ha_cout_rare_internal #4754.663 -..___tag_value___svml_powf8_ha_e9.99: +..___tag_value___jsvml_powf8_ha_e9.98: +# __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) + call __jsvml_spow_ha_cout_rare_internal #4754.663 +..___tag_value___jsvml_powf8_ha_e9.99: jmp ..B4.8 # Prob 100% #4754.663 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_powf8_ha_e9,@function - .size __svml_powf8_ha_e9,.-__svml_powf8_ha_e9 -..LN__svml_powf8_ha_e9.3: + .type __jsvml_powf8_ha_e9,@function + .size __jsvml_powf8_ha_e9,.-__jsvml_powf8_ha_e9 +..LN__jsvml_powf8_ha_e9.3: .data -# -- End __svml_powf8_ha_e9 +# -- End __jsvml_powf8_ha_e9 .text -.L_2__routine_start___svml_powf4_ha_l9_4: -# -- Begin __svml_powf4_ha_l9 +.L_2__routine_start___jsvml_powf4_ha_l9_4: +# -- Begin __jsvml_powf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_powf4_ha_l9 -# --- __svml_powf4_ha_l9(__m128, __m128) -__svml_powf4_ha_l9: + .globl __jsvml_powf4_ha_l9 +# --- __jsvml_powf4_ha_l9(__m128, __m128) +__jsvml_powf4_ha_l9: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B5.1: # Preds ..B5.0 @@ -1098,7 +1098,7 @@ __svml_powf4_ha_l9: .byte 30 #4912.654 .byte 250 #4912.654 .cfi_startproc -..___tag_value___svml_powf4_ha_l9.101: +..___tag_value___jsvml_powf4_ha_l9.101: ..L102: #4762.1 pushq %rbp #4762.1 @@ -1110,18 +1110,18 @@ __svml_powf4_ha_l9: subq $256, %rsp #4762.1 vmovaps %xmm1, %xmm14 #4762.1 vcvtps2pd %xmm0, %ymm2 #4837.19 - lea 13952+__svml_spow_ha_data_internal(%rip), %rdx #4864.76 + lea 13952+__jsvml_spow_ha_data_internal(%rip), %rdx #4864.76 vcvtps2pd %xmm14, %ymm9 #4838.19 - vmovups 64+__svml_spow_ha_data_internal(%rip), %xmm10 #4840.21 - vpsubd __svml_spow_ha_data_internal(%rip), %xmm0, %xmm13 #4843.19 - vmovups 128+__svml_spow_ha_data_internal(%rip), %xmm11 #4841.17 - vandpd 12992+__svml_spow_ha_data_internal(%rip), %ymm2, %ymm15 #4850.19 - vorpd 13056+__svml_spow_ha_data_internal(%rip), %ymm15, %ymm8 #4851.19 + vmovups 64+__jsvml_spow_ha_data_internal(%rip), %xmm10 #4840.21 + vpsubd __jsvml_spow_ha_data_internal(%rip), %xmm0, %xmm13 #4843.19 + vmovups 128+__jsvml_spow_ha_data_internal(%rip), %xmm11 #4841.17 + vandpd 12992+__jsvml_spow_ha_data_internal(%rip), %ymm2, %ymm15 #4850.19 + vorpd 13056+__jsvml_spow_ha_data_internal(%rip), %ymm15, %ymm8 #4851.19 vcvtpd2ps %ymm8, %xmm3 #4854.44 vpsrlq $20, %ymm2, %ymm1 #4856.18 - vpand 192+__svml_spow_ha_data_internal(%rip), %xmm14, %xmm12 #4845.19 + vpand 192+__jsvml_spow_ha_data_internal(%rip), %xmm14, %xmm12 #4845.19 vrcpps %xmm3, %xmm4 #4854.33 - vmovupd 13312+__svml_spow_ha_data_internal(%rip), %ymm3 #4860.48 + vmovupd 13312+__jsvml_spow_ha_data_internal(%rip), %ymm3 #4860.48 vcvtps2pd %xmm4, %ymm6 #4854.17 vroundpd $0, %ymm6, %ymm7 #4858.17 vpsrlq $40, %ymm7, %ymm4 #4863.18 @@ -1137,7 +1137,7 @@ __svml_powf4_ha_l9: movslq %esi, %rsi #4864.418 vpextrd $2, %xmm5, %edi #4864.681 movslq %ecx, %rcx #4864.236 - vmovupd 13504+__svml_spow_ha_data_internal(%rip), %ymm4 #4865.54 + vmovupd 13504+__jsvml_spow_ha_data_internal(%rip), %ymm4 #4865.54 vmovsd -4232448(%rdx,%rax), %xmm2 #4864.76 vmovsd -4232448(%rdx,%rsi), %xmm15 #4864.418 vmovhpd -4232448(%rdx,%rcx), %xmm2, %xmm1 #4864.59 @@ -1145,14 +1145,14 @@ __svml_powf4_ha_l9: vcmplt_oqpd %ymm7, %ymm4, %ymm7 #4869.16 vmovhpd -4232448(%rdx,%rdi), %xmm15, %xmm3 #4864.401 vinsertf128 $1, %xmm3, %ymm1, %ymm5 #4864.13 - vmovupd 12864+__svml_spow_ha_data_internal(%rip), %ymm1 #4873.58 - vandpd 13568+__svml_spow_ha_data_internal(%rip), %ymm7, %ymm3 #4870.16 - vorpd 13632+__svml_spow_ha_data_internal(%rip), %ymm3, %ymm4 #4870.64 + vmovupd 12864+__jsvml_spow_ha_data_internal(%rip), %ymm1 #4873.58 + vandpd 13568+__jsvml_spow_ha_data_internal(%rip), %ymm7, %ymm3 #4870.16 + vorpd 13632+__jsvml_spow_ha_data_internal(%rip), %ymm3, %ymm4 #4870.64 vsubpd %ymm4, %ymm6, %ymm2 #4871.18 - vfmadd213pd 12928+__svml_spow_ha_data_internal(%rip), %ymm8, %ymm1 #4875.14 + vfmadd213pd 12928+__jsvml_spow_ha_data_internal(%rip), %ymm8, %ymm1 #4875.14 vmulpd %ymm8, %ymm8, %ymm6 #4876.13 - vmulpd 13696+__svml_spow_ha_data_internal(%rip), %ymm2, %ymm15 #4872.13 - vmovupd 30464+__svml_spow_ha_data_internal(%rip), %ymm2 #4887.54 + vmulpd 13696+__jsvml_spow_ha_data_internal(%rip), %ymm2, %ymm15 #4872.13 + vmovupd 30464+__jsvml_spow_ha_data_internal(%rip), %ymm2 #4887.54 vmulpd %ymm6, %ymm1, %ymm7 #4877.13 vpcmpgtd %xmm10, %xmm13, %xmm6 #4844.33 vpcmpeqd %xmm10, %xmm13, %xmm10 #4844.80 @@ -1163,20 +1163,20 @@ __svml_powf4_ha_l9: vaddpd %ymm8, %ymm5, %ymm3 #4879.13 vaddpd %ymm3, %ymm15, %ymm4 #4880.13 vmulpd %ymm4, %ymm9, %ymm1 #4881.13 - vmulpd 30400+__svml_spow_ha_data_internal(%rip), %ymm1, %ymm4 #4883.15 - vsubpd 30528+__svml_spow_ha_data_internal(%rip), %ymm4, %ymm9 #4885.13 + vmulpd 30400+__jsvml_spow_ha_data_internal(%rip), %ymm1, %ymm4 #4883.15 + vsubpd 30528+__jsvml_spow_ha_data_internal(%rip), %ymm4, %ymm9 #4885.13 vaddpd %ymm9, %ymm2, %ymm3 #4888.13 - vandps 30656+__svml_spow_ha_data_internal(%rip), %ymm3, %ymm8 #4899.15 + vandps 30656+__jsvml_spow_ha_data_internal(%rip), %ymm3, %ymm8 #4899.15 vsubpd %ymm2, %ymm3, %ymm2 #4889.13 vpsrlq $11, %ymm3, %ymm3 #4903.15 vsubpd %ymm2, %ymm4, %ymm2 #4900.13 - vmulpd 30592+__svml_spow_ha_data_internal(%rip), %ymm2, %ymm13 #4902.13 + vmulpd 30592+__jsvml_spow_ha_data_internal(%rip), %ymm2, %ymm13 #4902.13 vextractf128 $1, %ymm1, %xmm5 #4890.125 vshufps $221, %xmm5, %xmm1, %xmm1 #4890.36 vpor %xmm10, %xmm6, %xmm5 #4844.19 vpor %xmm12, %xmm5, %xmm5 #4847.23 - vandps 30720+__svml_spow_ha_data_internal(%rip), %xmm1, %xmm1 #4892.18 - vpcmpgtd 30784+__svml_spow_ha_data_internal(%rip), %xmm1, %xmm6 #4894.25 + vandps 30720+__jsvml_spow_ha_data_internal(%rip), %xmm1, %xmm1 #4892.18 + vpcmpgtd 30784+__jsvml_spow_ha_data_internal(%rip), %xmm1, %xmm6 #4894.25 vpsllq $52, %ymm3, %ymm1 #4905.15 vpor %xmm6, %xmm5, %xmm7 #4895.23 vmovmskps %xmm7, %eax #4896.44 @@ -1263,29 +1263,29 @@ __svml_powf4_ha_l9: lea 64(%rsp,%r12,4), %rdi #4912.654 lea 128(%rsp,%r12,4), %rsi #4912.654 lea 192(%rsp,%r12,4), %rdx #4912.654 -..___tag_value___svml_powf4_ha_l9.119: -# __svml_spow_ha_cout_rare_internal(const float *, float *, float *) - call __svml_spow_ha_cout_rare_internal #4912.654 -..___tag_value___svml_powf4_ha_l9.120: +..___tag_value___jsvml_powf4_ha_l9.119: +# __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) + call __jsvml_spow_ha_cout_rare_internal #4912.654 +..___tag_value___jsvml_powf4_ha_l9.120: jmp ..B5.8 # Prob 100% #4912.654 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_powf4_ha_l9,@function - .size __svml_powf4_ha_l9,.-__svml_powf4_ha_l9 -..LN__svml_powf4_ha_l9.4: + .type __jsvml_powf4_ha_l9,@function + .size __jsvml_powf4_ha_l9,.-__jsvml_powf4_ha_l9 +..LN__jsvml_powf4_ha_l9.4: .data -# -- End __svml_powf4_ha_l9 +# -- End __jsvml_powf4_ha_l9 .text -.L_2__routine_start___svml_powf4_ha_ex_5: -# -- Begin __svml_powf4_ha_ex +.L_2__routine_start___jsvml_powf4_ha_ex_5: +# -- Begin __jsvml_powf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_powf4_ha_ex -# --- __svml_powf4_ha_ex(__m128, __m128) -__svml_powf4_ha_ex: + .globl __jsvml_powf4_ha_ex +# --- __jsvml_powf4_ha_ex(__m128, __m128) +__jsvml_powf4_ha_ex: # parameter 1: %xmm0 # parameter 2: %xmm1 ..B6.1: # Preds ..B6.0 @@ -1295,7 +1295,7 @@ __svml_powf4_ha_ex: .byte 30 #5070.654 .byte 250 #5070.654 .cfi_startproc -..___tag_value___svml_powf4_ha_ex.122: +..___tag_value___jsvml_powf4_ha_ex.122: ..L123: #4920.1 pushq %rbp #4920.1 @@ -1311,11 +1311,11 @@ __svml_powf4_ha_ex: cvtps2pd %xmm0, %xmm6 #4995.19 cvtps2pd %xmm12, %xmm7 #4995.57 cvtps2pd %xmm13, %xmm12 #4996.19 - movups 12992+__svml_spow_ha_data_internal(%rip), %xmm5 #5006.51 - lea 13952+__svml_spow_ha_data_internal(%rip), %rdx #5022.32 + movups 12992+__jsvml_spow_ha_data_internal(%rip), %xmm5 #5006.51 + lea 13952+__jsvml_spow_ha_data_internal(%rip), %rdx #5022.32 movaps %xmm5, %xmm4 #5008.21 andps %xmm7, %xmm5 #5008.74 - movups 13056+__svml_spow_ha_data_internal(%rip), %xmm8 #5007.49 + movups 13056+__jsvml_spow_ha_data_internal(%rip), %xmm8 #5007.49 andps %xmm6, %xmm4 #5008.21 orps %xmm8, %xmm4 #5009.21 orps %xmm8, %xmm5 #5009.77 @@ -1340,7 +1340,7 @@ __svml_powf4_ha_ex: subpd %xmm7, %xmm2 #5016.757 mulpd %xmm1, %xmm4 #5019.27 mulpd %xmm2, %xmm5 #5019.103 - movups 13312+__svml_spow_ha_data_internal(%rip), %xmm14 #5018.47 + movups 13312+__jsvml_spow_ha_data_internal(%rip), %xmm14 #5018.47 movaps %xmm1, %xmm15 #5021.18 subpd %xmm14, %xmm4 #5019.15 subpd %xmm14, %xmm5 #5019.91 @@ -1351,19 +1351,19 @@ __svml_powf4_ha_ex: pshufd $2, %xmm14, %xmm14 #5022.611 pshufd $2, %xmm15, %xmm7 #5022.280 movd %xmm14, %edi #5022.593 - movups 13504+__svml_spow_ha_data_internal(%rip), %xmm14 #5023.53 + movups 13504+__jsvml_spow_ha_data_internal(%rip), %xmm14 #5023.53 pshufd $238, %xmm6, %xmm6 #5017.90 movd %xmm15, %eax #5022.130 movaps %xmm14, %xmm15 #5027.18 movd %xmm7, %ecx #5022.262 movhlps %xmm13, %xmm11 #4996.71 - psubd __svml_spow_ha_data_internal(%rip), %xmm10 #5001.17 + psubd __jsvml_spow_ha_data_internal(%rip), %xmm10 #5001.17 cmpltpd %xmm1, %xmm15 #5027.18 cmpltpd %xmm2, %xmm14 #5027.76 cvtdq2pd %xmm6, %xmm3 #5017.73 cvtps2pd %xmm11, %xmm9 #4996.57 - movups 13568+__svml_spow_ha_data_internal(%rip), %xmm1 #5028.18 - movups 13632+__svml_spow_ha_data_internal(%rip), %xmm2 #5028.119 + movups 13568+__jsvml_spow_ha_data_internal(%rip), %xmm1 #5028.18 + movups 13632+__jsvml_spow_ha_data_internal(%rip), %xmm2 #5028.119 andps %xmm1, %xmm15 #5028.18 andps %xmm1, %xmm14 #5028.68 orps %xmm2, %xmm15 #5028.119 @@ -1372,14 +1372,14 @@ __svml_powf4_ha_ex: subpd %xmm15, %xmm8 #5029.20 subpd %xmm14, %xmm3 #5029.75 mulpd %xmm4, %xmm1 #5034.15 - movups 13696+__svml_spow_ha_data_internal(%rip), %xmm2 #5030.15 - movups 12864+__svml_spow_ha_data_internal(%rip), %xmm15 #5031.57 + movups 13696+__jsvml_spow_ha_data_internal(%rip), %xmm2 #5030.15 + movups 12864+__jsvml_spow_ha_data_internal(%rip), %xmm15 #5031.57 mulpd %xmm2, %xmm8 #5030.15 mulpd %xmm3, %xmm2 #5030.62 movaps %xmm15, %xmm3 #5033.28 mulpd %xmm4, %xmm3 #5033.28 mulpd %xmm5, %xmm15 #5033.116 - movups 12928+__svml_spow_ha_data_internal(%rip), %xmm14 #5032.57 + movups 12928+__jsvml_spow_ha_data_internal(%rip), %xmm14 #5032.57 addpd %xmm14, %xmm3 #5033.16 addpd %xmm15, %xmm14 #5033.104 mulpd %xmm1, %xmm3 #5035.15 @@ -1403,16 +1403,16 @@ __svml_powf4_ha_ex: addpd %xmm7, %xmm2 #5038.57 mulpd %xmm8, %xmm12 #5039.15 mulpd %xmm2, %xmm9 #5039.57 - movups 30400+__svml_spow_ha_data_internal(%rip), %xmm4 #5040.54 + movups 30400+__jsvml_spow_ha_data_internal(%rip), %xmm4 #5040.54 movaps %xmm4, %xmm6 #5041.17 mulpd %xmm12, %xmm6 #5041.17 mulpd %xmm9, %xmm4 #5041.69 - movups 30528+__svml_spow_ha_data_internal(%rip), %xmm3 #5042.50 + movups 30528+__jsvml_spow_ha_data_internal(%rip), %xmm3 #5042.50 movaps %xmm6, %xmm5 #5043.15 movaps %xmm4, %xmm8 #5043.63 subpd %xmm3, %xmm5 #5043.15 subpd %xmm3, %xmm8 #5043.63 - movups 30464+__svml_spow_ha_data_internal(%rip), %xmm7 #5045.53 + movups 30464+__jsvml_spow_ha_data_internal(%rip), %xmm7 #5045.53 addpd %xmm7, %xmm5 #5046.15 addpd %xmm7, %xmm8 #5046.64 movaps %xmm5, %xmm15 #5047.15 @@ -1421,8 +1421,8 @@ __svml_powf4_ha_ex: subpd %xmm7, %xmm14 #5047.64 subpd %xmm15, %xmm6 #5058.15 subpd %xmm14, %xmm4 #5058.59 - movups 30656+__svml_spow_ha_data_internal(%rip), %xmm2 #5056.57 - movups 30592+__svml_spow_ha_data_internal(%rip), %xmm14 #5059.48 + movups 30656+__jsvml_spow_ha_data_internal(%rip), %xmm2 #5056.57 + movups 30592+__jsvml_spow_ha_data_internal(%rip), %xmm14 #5059.48 movaps %xmm2, %xmm3 #5057.15 mulpd %xmm14, %xmm6 #5060.15 mulpd %xmm4, %xmm14 #5060.59 @@ -1432,7 +1432,7 @@ __svml_powf4_ha_ex: psrlq $11, %xmm5 #5061.15 movd %xmm2, %r10d #5062.238 psrlq $11, %xmm8 #5061.56 - movdqu 192+__svml_spow_ha_data_internal(%rip), %xmm11 #5003.17 + movdqu 192+__jsvml_spow_ha_data_internal(%rip), %xmm11 #5003.17 psllq $52, %xmm5 #5063.15 shufps $221, %xmm9, %xmm12 #5048.34 pand %xmm13, %xmm11 #5003.17 @@ -1453,17 +1453,17 @@ __svml_powf4_ha_ex: addpd %xmm14, %xmm7 #5064.84 paddq %xmm5, %xmm4 #5066.15 paddq %xmm8, %xmm7 #5066.60 - movdqu 64+__svml_spow_ha_data_internal(%rip), %xmm9 #5002.31 + movdqu 64+__jsvml_spow_ha_data_internal(%rip), %xmm9 #5002.31 pcmpgtd %xmm9, %xmm1 #5002.31 pcmpeqd %xmm9, %xmm10 #5002.74 por %xmm10, %xmm1 #5002.17 movdqa %xmm11, %xmm9 #5004.31 - movdqu 128+__svml_spow_ha_data_internal(%rip), %xmm10 #5004.31 + movdqu 128+__jsvml_spow_ha_data_internal(%rip), %xmm10 #5004.31 pcmpgtd %xmm10, %xmm9 #5004.31 pcmpeqd %xmm10, %xmm11 #5004.70 - pand 30720+__svml_spow_ha_data_internal(%rip), %xmm12 #5050.16 + pand 30720+__jsvml_spow_ha_data_internal(%rip), %xmm12 #5050.16 por %xmm11, %xmm9 #5004.17 - pcmpgtd 30784+__svml_spow_ha_data_internal(%rip), %xmm12 #5052.23 + pcmpgtd 30784+__jsvml_spow_ha_data_internal(%rip), %xmm12 #5052.23 por %xmm9, %xmm1 #5005.21 por %xmm12, %xmm1 #5053.21 movmskps %xmm1, %eax #5054.44 @@ -1527,20 +1527,20 @@ __svml_powf4_ha_ex: lea 64(%rsp,%r12,4), %rdi #5070.654 lea 128(%rsp,%r12,4), %rsi #5070.654 lea 192(%rsp,%r12,4), %rdx #5070.654 -..___tag_value___svml_powf4_ha_ex.140: -# __svml_spow_ha_cout_rare_internal(const float *, float *, float *) - call __svml_spow_ha_cout_rare_internal #5070.654 -..___tag_value___svml_powf4_ha_ex.141: +..___tag_value___jsvml_powf4_ha_ex.140: +# __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) + call __jsvml_spow_ha_cout_rare_internal #5070.654 +..___tag_value___jsvml_powf4_ha_ex.141: jmp ..B6.8 # Prob 100% #5070.654 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_powf4_ha_ex,@function - .size __svml_powf4_ha_ex,.-__svml_powf4_ha_ex -..LN__svml_powf4_ha_ex.5: + .type __jsvml_powf4_ha_ex,@function + .size __jsvml_powf4_ha_ex,.-__jsvml_powf4_ha_ex +..LN__jsvml_powf4_ha_ex.5: .data -# -- End __svml_powf4_ha_ex +# -- End __jsvml_powf4_ha_ex .text .L_2__routine_start__TestInt_6: # -- Begin _TestInt @@ -1605,15 +1605,15 @@ _TestInt: .data # -- End _TestInt .text -.L_2__routine_start___svml_spow_ha_cout_rare_internal_7: -# -- Begin __svml_spow_ha_cout_rare_internal +.L_2__routine_start___jsvml_spow_ha_cout_rare_internal_7: +# -- Begin __jsvml_spow_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_spow_ha_cout_rare_internal - .globl __svml_spow_ha_cout_rare_internal -# --- __svml_spow_ha_cout_rare_internal(const float *, float *, float *) -__svml_spow_ha_cout_rare_internal: + .hidden __jsvml_spow_ha_cout_rare_internal + .globl __jsvml_spow_ha_cout_rare_internal +# --- __jsvml_spow_ha_cout_rare_internal(const float *, float *, float *) +__jsvml_spow_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi # parameter 3: %rdx @@ -1624,7 +1624,7 @@ __svml_spow_ha_cout_rare_internal: .byte 30 #3996.48 .byte 250 #3996.48 .cfi_startproc -..___tag_value___svml_spow_ha_cout_rare_internal.146: +..___tag_value___jsvml_spow_ha_cout_rare_internal.146: ..L147: #3969.1 pushq %r12 #3969.1 @@ -1718,10 +1718,10 @@ __svml_spow_ha_cout_rare_internal: movss %xmm0, 40(%rsp) #3995.19[spill] movss %xmm3, 48(%rsp) #3995.19[spill] movss %xmm4, 56(%rsp) #3995.19[spill] -..___tag_value___svml_spow_ha_cout_rare_internal.167: +..___tag_value___jsvml_spow_ha_cout_rare_internal.167: # _TestInt(float) call _TestInt #3995.19 -..___tag_value___svml_spow_ha_cout_rare_internal.168: +..___tag_value___jsvml_spow_ha_cout_rare_internal.168: # LOE r15 eax ebx ebp r12d r13d r14d ..B8.64: # Preds ..B8.8 # Execution count [8.40e-01] @@ -2442,10 +2442,10 @@ __svml_spow_ha_cout_rare_internal: movss %xmm0, 40(%rsp) #3995.19[spill] movss %xmm3, 48(%rsp) #3995.19[spill] movss %xmm4, 56(%rsp) #3995.19[spill] -..___tag_value___svml_spow_ha_cout_rare_internal.208: +..___tag_value___jsvml_spow_ha_cout_rare_internal.208: # _TestInt(float) call _TestInt #3995.19 -..___tag_value___svml_spow_ha_cout_rare_internal.209: +..___tag_value___jsvml_spow_ha_cout_rare_internal.209: # LOE r15 eax ebx ebp r12d r13d r14d ..B8.65: # Preds ..B8.59 # Execution count [1.60e-01]: Infreq @@ -2471,17 +2471,17 @@ __svml_spow_ha_cout_rare_internal: # LOE r15 edx ebx ebp r12d r13d r14d xmm0 xmm2 xmm3 xmm4 .cfi_endproc # mark_end; - .type __svml_spow_ha_cout_rare_internal,@function - .size __svml_spow_ha_cout_rare_internal,.-__svml_spow_ha_cout_rare_internal -..LN__svml_spow_ha_cout_rare_internal.7: + .type __jsvml_spow_ha_cout_rare_internal,@function + .size __jsvml_spow_ha_cout_rare_internal,.-__jsvml_spow_ha_cout_rare_internal +..LN__jsvml_spow_ha_cout_rare_internal.7: .data -# -- End __svml_spow_ha_cout_rare_internal +# -- End __jsvml_spow_ha_cout_rare_internal .section .rodata, "a" .space 32, 0x00 # pad .align 64 - .hidden __svml_spow_ha_data_internal_avx512 - .globl __svml_spow_ha_data_internal_avx512 -__svml_spow_ha_data_internal_avx512: + .hidden __jsvml_spow_ha_data_internal_avx512 + .globl __jsvml_spow_ha_data_internal_avx512 +__jsvml_spow_ha_data_internal_avx512: .long 0 .long 3174420480 .long 3182632960 @@ -2930,12 +2930,12 @@ __svml_spow_ha_data_internal_avx512: .long 2139095040 .long 2139095040 .long 2139095040 - .type __svml_spow_ha_data_internal_avx512,@object - .size __svml_spow_ha_data_internal_avx512,1792 + .type __jsvml_spow_ha_data_internal_avx512,@object + .size __jsvml_spow_ha_data_internal_avx512,1792 .align 64 - .hidden __svml_spow_ha_data_internal - .globl __svml_spow_ha_data_internal -__svml_spow_ha_data_internal: + .hidden __jsvml_spow_ha_data_internal + .globl __jsvml_spow_ha_data_internal +__jsvml_spow_ha_data_internal: .long 2155872256 .long 2155872256 .long 2155872256 @@ -10876,8 +10876,8 @@ __svml_spow_ha_data_internal: .long 1079639606 .long 1079639606 .long 1079639606 - .type __svml_spow_ha_data_internal,@object - .size __svml_spow_ha_data_internal,30848 + .type __jsvml_spow_ha_data_internal,@object + .size __jsvml_spow_ha_data_internal,30848 .align 32 _vmlsPowHATab: .long 1065353216 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_sin_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_sin_linux_x86.S similarity index 94% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_sin_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_sin_linux_x86.S index 03bdea977cc..5ffd39354f7 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_sin_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_sin_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_sin.c" .text ..TXTST0: -.L_2__routine_start___svml_sinf16_ha_z0_0: -# -- Begin __svml_sinf16_ha_z0 +.L_2__routine_start___jsvml_sinf16_ha_z0_0: +# -- Begin __jsvml_sinf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_sinf16_ha_z0 -# --- __svml_sinf16_ha_z0(__m512) -__svml_sinf16_ha_z0: + .globl __jsvml_sinf16_ha_z0 +# --- __jsvml_sinf16_ha_z0(__m512) +__jsvml_sinf16_ha_z0: # parameter 1: %zmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_sinf16_ha_z0: .byte 30 #990.35 .byte 250 #990.35 .cfi_startproc -..___tag_value___svml_sinf16_ha_z0.1: +..___tag_value___jsvml_sinf16_ha_z0.1: ..L2: #660.1 pushq %rbp #660.1 @@ -58,12 +58,12 @@ __svml_sinf16_ha_z0: andq $-64, %rsp #660.1 subq $192, %rsp #660.1 xorl %esi, %esi #677.1 - vmovups 4096+__svml_ssin_ha_data_internal(%rip), %zmm3 #675.47 - vmovups 5056+__svml_ssin_ha_data_internal(%rip), %zmm6 #698.53 - vmovups 4544+__svml_ssin_ha_data_internal(%rip), %zmm7 #699.56 - vmovups 5120+__svml_ssin_ha_data_internal(%rip), %zmm10 #704.53 - vmovups 5184+__svml_ssin_ha_data_internal(%rip), %zmm13 #706.53 - vmovups 5440+__svml_ssin_ha_data_internal(%rip), %zmm15 #710.52 + vmovups 4096+__jsvml_ssin_ha_data_internal(%rip), %zmm3 #675.47 + vmovups 5056+__jsvml_ssin_ha_data_internal(%rip), %zmm6 #698.53 + vmovups 4544+__jsvml_ssin_ha_data_internal(%rip), %zmm7 #699.56 + vmovups 5120+__jsvml_ssin_ha_data_internal(%rip), %zmm10 #704.53 + vmovups 5184+__jsvml_ssin_ha_data_internal(%rip), %zmm13 #706.53 + vmovups 5440+__jsvml_ssin_ha_data_internal(%rip), %zmm15 #710.52 vmovaps %zmm0, %zmm11 #660.1 vandps %zmm3, %zmm11, %zmm4 #676.12 vfmadd213ps {rn-sae}, %zmm7, %zmm4, %zmm6 #700.17 @@ -72,7 +72,7 @@ __svml_sinf16_ha_z0: vsubps {rn-sae}, %zmm7, %zmm6, %zmm8 #702.19 vpslld $31, %zmm6, %zmm2 #701.41 vcvtps2pd {sae}, %ymm5, %zmm14 #697.116 - vmovups 5376+__svml_ssin_ha_data_internal(%rip), %zmm7 #711.52 + vmovups 5376+__jsvml_ssin_ha_data_internal(%rip), %zmm7 #711.52 vmovaps %zmm7, %zmm5 #712.19 vextractf32x8 $1, %zmm8, %ymm9 #703.136 vcvtps2pd {sae}, %ymm8, %zmm1 #703.23 @@ -80,17 +80,17 @@ __svml_sinf16_ha_z0: vandnps %zmm11, %zmm3, %zmm9 #709.21 vfnmadd231pd {rn-sae}, %zmm1, %zmm10, %zmm12 #705.19 vfnmadd231pd {rn-sae}, %zmm0, %zmm10, %zmm14 #705.133 - vmovups 5248+__svml_ssin_ha_data_internal(%rip), %zmm3 #715.52 + vmovups 5248+__jsvml_ssin_ha_data_internal(%rip), %zmm3 #715.52 vfnmadd213pd {rn-sae}, %zmm12, %zmm13, %zmm1 #707.19 vfnmadd213pd {rn-sae}, %zmm14, %zmm13, %zmm0 #707.133 - vmovups 4160+__svml_ssin_ha_data_internal(%rip), %zmm14 #723.57 + vmovups 4160+__jsvml_ssin_ha_data_internal(%rip), %zmm14 #723.57 vxorps %zmm9, %zmm2, %zmm13 #719.20 vmulpd {rn-sae}, %zmm1, %zmm1, %zmm6 #708.22 vmulpd {rn-sae}, %zmm0, %zmm0, %zmm8 #708.129 vcmpps $18, {sae}, %zmm14, %zmm4, %k1 #724.115 vfmadd231pd {rn-sae}, %zmm6, %zmm15, %zmm5 #712.19 vfmadd231pd {rn-sae}, %zmm8, %zmm15, %zmm7 #712.133 - vmovups 5312+__svml_ssin_ha_data_internal(%rip), %zmm15 #713.52 + vmovups 5312+__jsvml_ssin_ha_data_internal(%rip), %zmm15 #713.52 vfmadd213pd {rn-sae}, %zmm15, %zmm6, %zmm5 #714.19 vfmadd213pd {rn-sae}, %zmm15, %zmm8, %zmm7 #714.132 vfmadd213pd {rn-sae}, %zmm3, %zmm6, %zmm5 #716.19 @@ -221,10 +221,10 @@ __svml_sinf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #993.760 lea 128(%rsp,%rbx,4), %rsi #993.760 -..___tag_value___svml_sinf16_ha_z0.29: -# __svml_ssin_ha_cout_rare_internal(const float *, float *) - call __svml_ssin_ha_cout_rare_internal #993.760 -..___tag_value___svml_sinf16_ha_z0.30: +..___tag_value___jsvml_sinf16_ha_z0.29: +# __jsvml_ssin_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssin_ha_cout_rare_internal #993.760 +..___tag_value___jsvml_sinf16_ha_z0.30: jmp ..B1.14 # Prob 100% #993.760 .cfi_restore 3 .cfi_restore 12 @@ -233,13 +233,13 @@ __svml_sinf16_ha_z0: # LOE r15 ebx r12d r13d r14d ..B1.17: # Preds ..B1.1 # Execution count [5.00e-02]: Infreq - vmovups 4224+__svml_ssin_ha_data_internal(%rip), %zmm8 #752.52 - lea __svml_ssin_ha_reduction_data_internal(%rip), %rax #844.328 + vmovups 4224+__jsvml_ssin_ha_data_internal(%rip), %zmm8 #752.52 + lea __jsvml_ssin_ha_reduction_data_internal(%rip), %rax #844.328 vmovups %zmm0, (%rsp) #[spill] vpternlogd $255, %zmm1, %zmm1, %zmm1 #754.42 vandps %zmm4, %zmm8, %zmm6 #753.16 vcmpps $4, {sae}, %zmm8, %zmm6, %k1 #754.110 - lea __svml_ssin_ha_data_internal(%rip), %rdx #963.125 + lea __jsvml_ssin_ha_data_internal(%rip), %rdx #963.125 vpandd .L_2il0floatpacket.20(%rip), %zmm11, %zmm12 #842.16 vpsrld $23, %zmm12, %zmm13 #843.18 vpslld $1, %zmm13, %zmm4 #844.140 @@ -361,7 +361,7 @@ __svml_sinf16_ha_z0: vpandnd %zmm3, %zmm3, %zmm0{%k6} #955.41 vandps %zmm11, %zmm0, %zmm1 #956.24 vorps %zmm12, %zmm1, %zmm13 #958.9 - vmovups 4352+__svml_ssin_ha_data_internal(%rip), %zmm12 #973.46 + vmovups 4352+__jsvml_ssin_ha_data_internal(%rip), %zmm12 #973.46 vmulps {rn-sae}, %zmm13, %zmm13, %zmm3 #962.17 vmovaps %zmm13, %zmm8 #966.22 vfmadd213ps {rn-sae}, %zmm5, %zmm7, %zmm8 #966.22 @@ -375,9 +375,9 @@ __svml_sinf16_ha_z0: vfmadd231ps {rn-sae}, %zmm0, %zmm13, %zmm6 #971.18 vaddps {rn-sae}, %zmm1, %zmm6, %zmm8 #972.24 vaddps {rn-sae}, %zmm7, %zmm0, %zmm1 #978.15 - vmovups 4288+__svml_ssin_ha_data_internal(%rip), %zmm6 #974.46 - vmovups 4480+__svml_ssin_ha_data_internal(%rip), %zmm0 #979.46 - vmovups 4416+__svml_ssin_ha_data_internal(%rip), %zmm7 #980.46 + vmovups 4288+__jsvml_ssin_ha_data_internal(%rip), %zmm6 #974.46 + vmovups 4480+__jsvml_ssin_ha_data_internal(%rip), %zmm0 #979.46 + vmovups 4416+__jsvml_ssin_ha_data_internal(%rip), %zmm7 #980.46 vfmadd231ps {rn-sae}, %zmm3, %zmm12, %zmm6 #975.14 vfmadd231ps {rn-sae}, %zmm3, %zmm0, %zmm7 #981.14 vmulps {rn-sae}, %zmm3, %zmm6, %zmm14 #976.16 @@ -399,20 +399,20 @@ __svml_sinf16_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm11 .cfi_endproc # mark_end; - .type __svml_sinf16_ha_z0,@function - .size __svml_sinf16_ha_z0,.-__svml_sinf16_ha_z0 -..LN__svml_sinf16_ha_z0.0: + .type __jsvml_sinf16_ha_z0,@function + .size __jsvml_sinf16_ha_z0,.-__jsvml_sinf16_ha_z0 +..LN__jsvml_sinf16_ha_z0.0: .data -# -- End __svml_sinf16_ha_z0 +# -- End __jsvml_sinf16_ha_z0 .text -.L_2__routine_start___svml_sinf8_ha_l9_1: -# -- Begin __svml_sinf8_ha_l9 +.L_2__routine_start___jsvml_sinf8_ha_l9_1: +# -- Begin __jsvml_sinf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinf8_ha_l9 -# --- __svml_sinf8_ha_l9(__m256) -__svml_sinf8_ha_l9: + .globl __jsvml_sinf8_ha_l9 +# --- __jsvml_sinf8_ha_l9(__m256) +__jsvml_sinf8_ha_l9: # parameter 1: %ymm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -421,7 +421,7 @@ __svml_sinf8_ha_l9: .byte 30 #1364.14 .byte 250 #1364.14 .cfi_startproc -..___tag_value___svml_sinf8_ha_l9.38: +..___tag_value___jsvml_sinf8_ha_l9.38: ..L39: #1034.1 pushq %rbp #1034.1 @@ -433,12 +433,12 @@ __svml_sinf8_ha_l9: pushq %r13 #1034.1 subq $184, %rsp #1034.1 xorl %eax, %eax #1051.1 - vmovups 4096+__svml_ssin_ha_data_internal(%rip), %ymm3 #1049.48 - vmovups 5056+__svml_ssin_ha_data_internal(%rip), %ymm6 #1072.54 - vmovups 4544+__svml_ssin_ha_data_internal(%rip), %ymm7 #1073.57 - vmovupd 5120+__svml_ssin_ha_data_internal(%rip), %ymm10 #1078.55 - vmovupd 5184+__svml_ssin_ha_data_internal(%rip), %ymm12 #1080.55 - vmovupd 5376+__svml_ssin_ha_data_internal(%rip), %ymm15 #1085.54 + vmovups 4096+__jsvml_ssin_ha_data_internal(%rip), %ymm3 #1049.48 + vmovups 5056+__jsvml_ssin_ha_data_internal(%rip), %ymm6 #1072.54 + vmovups 4544+__jsvml_ssin_ha_data_internal(%rip), %ymm7 #1073.57 + vmovupd 5120+__jsvml_ssin_ha_data_internal(%rip), %ymm10 #1078.55 + vmovupd 5184+__jsvml_ssin_ha_data_internal(%rip), %ymm12 #1080.55 + vmovupd 5376+__jsvml_ssin_ha_data_internal(%rip), %ymm15 #1085.54 vmovaps %ymm0, %ymm14 #1034.1 vandps %ymm3, %ymm14, %ymm4 #1050.12 vfmadd213ps %ymm7, %ymm4, %ymm6 #1074.17 @@ -447,8 +447,8 @@ __svml_sinf8_ha_l9: vsubps %ymm7, %ymm6, %ymm8 #1076.17 vpslld $31, %ymm6, %ymm2 #1075.41 vcvtps2pd %xmm5, %ymm13 #1071.91 - vmovupd 5312+__svml_ssin_ha_data_internal(%rip), %ymm5 #1087.54 - vmovupd 5248+__svml_ssin_ha_data_internal(%rip), %ymm6 #1089.54 + vmovupd 5312+__jsvml_ssin_ha_data_internal(%rip), %ymm5 #1087.54 + vmovupd 5248+__jsvml_ssin_ha_data_internal(%rip), %ymm6 #1089.54 vextractf128 $1, %ymm8, %xmm9 #1077.105 vcvtps2pd %xmm8, %ymm1 #1077.23 vcvtps2pd %xmm9, %ymm0 #1077.88 @@ -459,7 +459,7 @@ __svml_sinf8_ha_l9: vmulpd %ymm1, %ymm1, %ymm7 #1082.20 vmulpd %ymm0, %ymm0, %ymm9 #1082.66 vandnps %ymm14, %ymm3, %ymm10 #1083.21 - vmovupd 5440+__svml_ssin_ha_data_internal(%rip), %ymm3 #1084.54 + vmovupd 5440+__jsvml_ssin_ha_data_internal(%rip), %ymm3 #1084.54 vmovapd %ymm15, %ymm8 #1086.19 vfmadd231pd %ymm7, %ymm3, %ymm8 #1086.19 vfmadd231pd %ymm9, %ymm3, %ymm15 #1086.78 @@ -476,7 +476,7 @@ __svml_sinf8_ha_l9: vxorps %ymm10, %ymm2, %ymm13 #1093.20 vinsertf128 $1, %xmm1, %ymm0, %ymm2 #1094.18 vxorps %ymm13, %ymm2, %ymm0 #1095.18 - vcmpnle_uqps 4160+__svml_ssin_ha_data_internal(%rip), %ymm4, %ymm13 #1098.26 + vcmpnle_uqps 4160+__jsvml_ssin_ha_data_internal(%rip), %ymm4, %ymm13 #1098.26 vmovmskps %ymm13, %edx #1100.75 testl %edx, %edx #1101.62 jne ..B2.12 # Prob 5% #1101.62 @@ -541,18 +541,18 @@ __svml_sinf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r13,4), %rdi #1367.546 lea 128(%rsp,%r13,4), %rsi #1367.546 -..___tag_value___svml_sinf8_ha_l9.54: -# __svml_ssin_ha_cout_rare_internal(const float *, float *) - call __svml_ssin_ha_cout_rare_internal #1367.546 -..___tag_value___svml_sinf8_ha_l9.55: +..___tag_value___jsvml_sinf8_ha_l9.54: +# __jsvml_ssin_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssin_ha_cout_rare_internal #1367.546 +..___tag_value___jsvml_sinf8_ha_l9.55: jmp ..B2.9 # Prob 100% #1367.546 .cfi_restore 12 # LOE rbx r14 r15 r12d r13d ..B2.12: # Preds ..B2.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.36(%rip), %ymm14, %ymm6 #1216.18 - lea __svml_ssin_ha_reduction_data_internal(%rip), %rcx #1218.1212 - vmovups 4224+__svml_ssin_ha_data_internal(%rip), %ymm8 #1126.53 + lea __jsvml_ssin_ha_reduction_data_internal(%rip), %rcx #1218.1212 + vmovups 4224+__jsvml_ssin_ha_data_internal(%rip), %ymm8 #1126.53 vmovups %ymm0, (%rsp) #[spill] vpsrld $23, %ymm6, %ymm3 #1217.18 vpslld $1, %ymm3, %ymm7 #1218.234 @@ -600,7 +600,7 @@ __svml_sinf8_ha_l9: vmovd 8(%rsi,%rcx), %xmm12 #1220.2300 vmovd 8(%rdi,%rcx), %xmm15 #1220.2389 vmovd 8(%r11,%rcx), %xmm3 #1220.2741 - lea __svml_ssin_ha_data_internal(%rip), %r11 #1337.1007 + lea __jsvml_ssin_ha_data_internal(%rip), %r11 #1337.1007 vpunpcklqdq %xmm15, %xmm12, %xmm1 #1220.2280 vinsertf128 $1, %xmm8, %ymm4, %ymm10 #1218.2196 vpunpcklqdq %xmm7, %xmm0, %xmm8 #1219.2722 @@ -763,8 +763,8 @@ __svml_sinf8_ha_l9: vshufps $136, %xmm11, %xmm5, %xmm12 #1339.2377 vmovaps %ymm3, %ymm8 #1340.22 vmovaps %ymm15, %ymm7 #1341.21 - vmovups 4352+__svml_ssin_ha_data_internal(%rip), %ymm2 #1347.47 - vfmadd213ps 4288+__svml_ssin_ha_data_internal(%rip), %ymm6, %ymm2 #1349.14 + vmovups 4352+__jsvml_ssin_ha_data_internal(%rip), %ymm2 #1347.47 + vfmadd213ps 4288+__jsvml_ssin_ha_data_internal(%rip), %ymm6, %ymm2 #1349.14 vmulps %ymm2, %ymm6, %ymm4 #1350.14 vinsertf128 $1, %xmm12, %ymm1, %ymm11 #1339.1872 vfmadd213ps %ymm9, %ymm11, %ymm8 #1340.22 @@ -775,10 +775,10 @@ __svml_sinf8_ha_l9: vfmadd231ps %ymm3, %ymm11, %ymm5 #1343.18 vfmadd231ps %ymm15, %ymm3, %ymm0 #1345.18 vaddps %ymm11, %ymm15, %ymm11 #1352.13 - vmovups 4480+__svml_ssin_ha_data_internal(%rip), %ymm15 #1355.14 + vmovups 4480+__jsvml_ssin_ha_data_internal(%rip), %ymm15 #1355.14 vaddps %ymm0, %ymm5, %ymm8 #1346.22 vmovd 8(%r8,%r11), %xmm0 #1357.2173 - vfmadd213ps 4416+__svml_ssin_ha_data_internal(%rip), %ymm6, %ymm15 #1355.14 + vfmadd213ps 4416+__jsvml_ssin_ha_data_internal(%rip), %ymm6, %ymm15 #1355.14 vmulps %ymm4, %ymm3, %ymm5 #1351.14 vpunpcklqdq %xmm1, %xmm0, %xmm4 #1357.2153 vmovd 8(%rcx,%r11), %xmm0 #1357.2504 @@ -807,20 +807,20 @@ __svml_sinf8_ha_l9: # LOE rbx r12 r14 r15 eax ymm0 ymm14 .cfi_endproc # mark_end; - .type __svml_sinf8_ha_l9,@function - .size __svml_sinf8_ha_l9,.-__svml_sinf8_ha_l9 -..LN__svml_sinf8_ha_l9.1: + .type __jsvml_sinf8_ha_l9,@function + .size __jsvml_sinf8_ha_l9,.-__jsvml_sinf8_ha_l9 +..LN__jsvml_sinf8_ha_l9.1: .data -# -- End __svml_sinf8_ha_l9 +# -- End __jsvml_sinf8_ha_l9 .text -.L_2__routine_start___svml_sinf4_ha_e9_2: -# -- Begin __svml_sinf4_ha_e9 +.L_2__routine_start___jsvml_sinf4_ha_e9_2: +# -- Begin __jsvml_sinf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinf4_ha_e9 -# --- __svml_sinf4_ha_e9(__m128) -__svml_sinf4_ha_e9: + .globl __jsvml_sinf4_ha_e9 +# --- __jsvml_sinf4_ha_e9(__m128) +__jsvml_sinf4_ha_e9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -829,7 +829,7 @@ __svml_sinf4_ha_e9: .byte 30 #1719.14 .byte 250 #1719.14 .cfi_startproc -..___tag_value___svml_sinf4_ha_e9.60: +..___tag_value___jsvml_sinf4_ha_e9.60: ..L61: #1376.1 pushq %rbp #1376.1 @@ -840,35 +840,35 @@ __svml_sinf4_ha_e9: andq $-64, %rsp #1376.1 subq $192, %rsp #1376.1 vmovaps %xmm0, %xmm14 #1376.1 - vmovups 4096+__svml_ssin_ha_data_internal(%rip), %xmm11 #1391.45 + vmovups 4096+__jsvml_ssin_ha_data_internal(%rip), %xmm11 #1391.45 xorl %eax, %eax #1393.1 vandps %xmm11, %xmm14, %xmm1 #1392.12 - vmulps 5056+__svml_ssin_ha_data_internal(%rip), %xmm1, %xmm2 #1416.29 + vmulps 5056+__jsvml_ssin_ha_data_internal(%rip), %xmm1, %xmm2 #1416.29 vcvtps2pd %xmm1, %ymm6 #1413.23 - vmovups 4544+__svml_ssin_ha_data_internal(%rip), %xmm4 #1415.54 + vmovups 4544+__jsvml_ssin_ha_data_internal(%rip), %xmm4 #1415.54 vaddps %xmm2, %xmm4, %xmm3 #1416.17 vpslld $31, %xmm3, %xmm0 #1417.38 vsubps %xmm4, %xmm3, %xmm5 #1418.17 vcvtps2pd %xmm5, %ymm8 #1419.23 vandnps %xmm14, %xmm11, %xmm5 #1425.21 - vmulpd 5120+__svml_ssin_ha_data_internal(%rip), %ymm8, %ymm7 #1421.39 - vmulpd 5184+__svml_ssin_ha_data_internal(%rip), %ymm8, %ymm10 #1423.39 + vmulpd 5120+__jsvml_ssin_ha_data_internal(%rip), %ymm8, %ymm7 #1421.39 + vmulpd 5184+__jsvml_ssin_ha_data_internal(%rip), %ymm8, %ymm10 #1423.39 vsubpd %ymm7, %ymm6, %ymm9 #1421.17 vxorps %xmm5, %xmm0, %xmm7 #1435.20 vsubpd %ymm10, %ymm9, %ymm3 #1423.17 vmulpd %ymm3, %ymm3, %ymm2 #1424.18 - vmulpd 5440+__svml_ssin_ha_data_internal(%rip), %ymm2, %ymm12 #1428.32 - vaddpd 5376+__svml_ssin_ha_data_internal(%rip), %ymm12, %ymm13 #1428.17 + vmulpd 5440+__jsvml_ssin_ha_data_internal(%rip), %ymm2, %ymm12 #1428.32 + vaddpd 5376+__jsvml_ssin_ha_data_internal(%rip), %ymm12, %ymm13 #1428.17 vmulpd %ymm13, %ymm2, %ymm15 #1430.32 - vaddpd 5312+__svml_ssin_ha_data_internal(%rip), %ymm15, %ymm12 #1430.17 + vaddpd 5312+__jsvml_ssin_ha_data_internal(%rip), %ymm15, %ymm12 #1430.17 vmulpd %ymm12, %ymm2, %ymm13 #1432.32 - vaddpd 5248+__svml_ssin_ha_data_internal(%rip), %ymm13, %ymm15 #1432.17 + vaddpd 5248+__jsvml_ssin_ha_data_internal(%rip), %ymm13, %ymm15 #1432.17 vmulpd %ymm15, %ymm2, %ymm11 #1433.17 vmulpd %ymm11, %ymm3, %ymm4 #1434.34 vaddpd %ymm4, %ymm3, %ymm6 #1434.19 vcvtpd2ps %ymm6, %xmm0 #1436.18 vxorps %xmm7, %xmm0, %xmm2 #1437.18 - vcmpnleps 4160+__svml_ssin_ha_data_internal(%rip), %xmm1, %xmm0 #1440.26 + vcmpnleps 4160+__jsvml_ssin_ha_data_internal(%rip), %xmm1, %xmm0 #1440.26 vmovmskps %xmm0, %edx #1442.74 testl %edx, %edx #1443.62 jne ..B3.12 # Prob 5% #1443.62 @@ -939,10 +939,10 @@ __svml_sinf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1722.540 lea 128(%rsp,%r12,4), %rsi #1722.540 -..___tag_value___svml_sinf4_ha_e9.78: -# __svml_ssin_ha_cout_rare_internal(const float *, float *) - call __svml_ssin_ha_cout_rare_internal #1722.540 -..___tag_value___svml_sinf4_ha_e9.79: +..___tag_value___jsvml_sinf4_ha_e9.78: +# __jsvml_ssin_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssin_ha_cout_rare_internal #1722.540 +..___tag_value___jsvml_sinf4_ha_e9.79: jmp ..B3.9 # Prob 100% #1722.540 .cfi_restore 12 .cfi_restore 13 @@ -950,8 +950,8 @@ __svml_sinf4_ha_e9: ..B3.12: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq movl $2139095040, %edx #1557.24 - lea __svml_ssin_ha_reduction_data_internal(%rip), %r9 #1560.752 - vmovups 4224+__svml_ssin_ha_data_internal(%rip), %xmm13 #1468.50 + lea __jsvml_ssin_ha_reduction_data_internal(%rip), %r9 #1560.752 + vmovups 4224+__jsvml_ssin_ha_data_internal(%rip), %xmm13 #1468.50 movl $8388607, %r10d #1566.27 vandps %xmm1, %xmm13, %xmm11 #1469.16 movl $8388608, %r11d #1567.26 @@ -1083,7 +1083,7 @@ __svml_sinf4_ha_e9: vpand %xmm8, %xmm12, %xmm8 #1649.24 vsubps %xmm13, %xmm11, %xmm2 #1645.17 vpslld $14, %xmm8, %xmm15 #1650.24 - lea __svml_ssin_ha_data_internal(%rip), %r8 #1690.533 + lea __jsvml_ssin_ha_data_internal(%rip), %r8 #1690.533 vpor %xmm6, %xmm15, %xmm11 #1652.24 vpor %xmm4, %xmm11, %xmm13 #1653.24 vmovups .L_2il0floatpacket.55(%rip), %xmm12 #1663.21 @@ -1150,17 +1150,17 @@ __svml_sinf4_ha_e9: vsubps %xmm12, %xmm8, %xmm6 #1697.18 vaddps %xmm12, %xmm13, %xmm9 #1696.21 vaddps %xmm6, %xmm5, %xmm2 #1698.18 - vmulps 4352+__svml_ssin_ha_data_internal(%rip), %xmm7, %xmm5 #1704.26 + vmulps 4352+__jsvml_ssin_ha_data_internal(%rip), %xmm7, %xmm5 #1704.26 vsubps %xmm9, %xmm12, %xmm1 #1699.18 - vaddps 4288+__svml_ssin_ha_data_internal(%rip), %xmm5, %xmm12 #1704.14 + vaddps 4288+__jsvml_ssin_ha_data_internal(%rip), %xmm5, %xmm12 #1704.14 vaddps %xmm1, %xmm13, %xmm3 #1700.18 vmulps %xmm12, %xmm7, %xmm13 #1705.14 vaddps %xmm3, %xmm2, %xmm6 #1701.22 vmulps %xmm13, %xmm4, %xmm12 #1706.14 vaddps %xmm15, %xmm10, %xmm13 #1707.13 - vmulps 4480+__svml_ssin_ha_data_internal(%rip), %xmm7, %xmm10 #1710.26 + vmulps 4480+__jsvml_ssin_ha_data_internal(%rip), %xmm7, %xmm10 #1710.26 vmulps %xmm8, %xmm4, %xmm4 #1713.32 - vaddps 4416+__svml_ssin_ha_data_internal(%rip), %xmm10, %xmm15 #1710.14 + vaddps 4416+__jsvml_ssin_ha_data_internal(%rip), %xmm10, %xmm15 #1710.14 vmulps %xmm15, %xmm7, %xmm15 #1711.14 vmovd 8(%rdx,%r8), %xmm7 #1712.1000 vmovd 8(%rcx,%r8), %xmm1 #1712.1083 @@ -1185,20 +1185,20 @@ __svml_sinf4_ha_e9: # LOE rbx r12 r13 r14 r15 eax xmm2 xmm14 .cfi_endproc # mark_end; - .type __svml_sinf4_ha_e9,@function - .size __svml_sinf4_ha_e9,.-__svml_sinf4_ha_e9 -..LN__svml_sinf4_ha_e9.2: + .type __jsvml_sinf4_ha_e9,@function + .size __jsvml_sinf4_ha_e9,.-__jsvml_sinf4_ha_e9 +..LN__jsvml_sinf4_ha_e9.2: .data -# -- End __svml_sinf4_ha_e9 +# -- End __jsvml_sinf4_ha_e9 .text -.L_2__routine_start___svml_sinf8_ha_e9_3: -# -- Begin __svml_sinf8_ha_e9 +.L_2__routine_start___jsvml_sinf8_ha_e9_3: +# -- Begin __jsvml_sinf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinf8_ha_e9 -# --- __svml_sinf8_ha_e9(__m256) -__svml_sinf8_ha_e9: + .globl __jsvml_sinf8_ha_e9 +# --- __jsvml_sinf8_ha_e9(__m256) +__jsvml_sinf8_ha_e9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -1207,7 +1207,7 @@ __svml_sinf8_ha_e9: .byte 30 #2074.14 .byte 250 #2074.14 .cfi_startproc -..___tag_value___svml_sinf8_ha_e9.85: +..___tag_value___jsvml_sinf8_ha_e9.85: ..L86: #1731.1 pushq %rbp #1731.1 @@ -1219,19 +1219,19 @@ __svml_sinf8_ha_e9: pushq %rbx #1731.1 subq $312, %rsp #1731.1 xorl %eax, %eax #1748.1 - vmovups 4096+__svml_ssin_ha_data_internal(%rip), %ymm7 #1746.48 - vmovups 4544+__svml_ssin_ha_data_internal(%rip), %ymm12 #1770.57 + vmovups 4096+__jsvml_ssin_ha_data_internal(%rip), %ymm7 #1746.48 + vmovups 4544+__jsvml_ssin_ha_data_internal(%rip), %ymm12 #1770.57 vandps %ymm7, %ymm0, %ymm8 #1747.12 - vmulps 5056+__svml_ssin_ha_data_internal(%rip), %ymm8, %ymm10 #1771.32 + vmulps 5056+__jsvml_ssin_ha_data_internal(%rip), %ymm8, %ymm10 #1771.32 vcvtps2pd %xmm8, %ymm6 #1768.23 vextractf128 $1, %ymm8, %xmm9 #1768.108 vaddps %ymm10, %ymm12, %ymm11 #1771.17 vcvtps2pd %xmm9, %ymm5 #1768.91 - vmovupd 5120+__svml_ssin_ha_data_internal(%rip), %ymm9 #1775.55 + vmovupd 5120+__jsvml_ssin_ha_data_internal(%rip), %ymm9 #1775.55 vpslld $31, %xmm11, %xmm14 #1772.84 vsubps %ymm12, %ymm11, %ymm1 #1773.17 vextractf128 $1, %ymm11, %xmm15 #1772.215 - vmovupd 5184+__svml_ssin_ha_data_internal(%rip), %ymm12 #1777.55 + vmovupd 5184+__jsvml_ssin_ha_data_internal(%rip), %ymm12 #1777.55 vpslld $31, %xmm15, %xmm13 #1772.181 vcvtps2pd %xmm1, %ymm10 #1774.23 vextractf128 $1, %ymm1, %xmm3 #1774.105 @@ -1239,15 +1239,15 @@ __svml_sinf8_ha_e9: vsubpd %ymm2, %ymm6, %ymm15 #1776.19 vinsertf128 $1, %xmm13, %ymm14, %ymm4 #1772.20 vcvtps2pd %xmm3, %ymm13 #1774.88 - vmovupd 5312+__svml_ssin_ha_data_internal(%rip), %ymm14 #1784.54 + vmovupd 5312+__jsvml_ssin_ha_data_internal(%rip), %ymm14 #1784.54 vmulpd %ymm9, %ymm13, %ymm6 #1776.115 vmulpd %ymm12, %ymm13, %ymm2 #1778.115 vsubpd %ymm6, %ymm5, %ymm1 #1776.91 vmulpd %ymm12, %ymm10, %ymm5 #1778.43 - vmovupd 5376+__svml_ssin_ha_data_internal(%rip), %ymm6 #1782.54 + vmovupd 5376+__jsvml_ssin_ha_data_internal(%rip), %ymm6 #1782.54 vsubpd %ymm2, %ymm1, %ymm1 #1778.91 vsubpd %ymm5, %ymm15, %ymm3 #1778.19 - vmovupd 5440+__svml_ssin_ha_data_internal(%rip), %ymm5 #1781.54 + vmovupd 5440+__jsvml_ssin_ha_data_internal(%rip), %ymm5 #1781.54 vmulpd %ymm1, %ymm1, %ymm2 #1779.66 vmulpd %ymm3, %ymm3, %ymm12 #1779.20 vandnps %ymm0, %ymm7, %ymm13 #1780.21 @@ -1255,7 +1255,7 @@ __svml_sinf8_ha_e9: vaddpd %ymm7, %ymm6, %ymm9 #1783.19 vmulpd %ymm2, %ymm5, %ymm7 #1783.108 vmulpd %ymm9, %ymm12, %ymm10 #1785.34 - vmovupd 5248+__svml_ssin_ha_data_internal(%rip), %ymm9 #1786.54 + vmovupd 5248+__jsvml_ssin_ha_data_internal(%rip), %ymm9 #1786.54 vaddpd %ymm7, %ymm6, %ymm11 #1783.93 vaddpd %ymm10, %ymm14, %ymm5 #1785.19 vmulpd %ymm11, %ymm2, %ymm15 #1785.107 @@ -1276,7 +1276,7 @@ __svml_sinf8_ha_e9: vcvtpd2ps %ymm1, %xmm13 #1791.100 vinsertf128 $1, %xmm13, %ymm4, %ymm12 #1791.18 vxorps %ymm2, %ymm12, %ymm13 #1792.18 - vcmpnle_uqps 4160+__svml_ssin_ha_data_internal(%rip), %ymm8, %ymm12 #1795.26 + vcmpnle_uqps 4160+__jsvml_ssin_ha_data_internal(%rip), %ymm8, %ymm12 #1795.26 vextractf128 $1, %ymm12, %xmm3 #1796.151 vpackssdw %xmm3, %xmm12, %xmm5 #1797.109 vpacksswb %xmm6, %xmm5, %xmm7 #1797.92 @@ -1346,16 +1346,16 @@ __svml_sinf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #2077.546 lea 128(%rsp,%rbx,4), %rsi #2077.546 -..___tag_value___svml_sinf8_ha_e9.101: -# __svml_ssin_ha_cout_rare_internal(const float *, float *) - call __svml_ssin_ha_cout_rare_internal #2077.546 -..___tag_value___svml_sinf8_ha_e9.102: +..___tag_value___jsvml_sinf8_ha_e9.101: +# __jsvml_ssin_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssin_ha_cout_rare_internal #2077.546 +..___tag_value___jsvml_sinf8_ha_e9.102: jmp ..B4.9 # Prob 100% #2077.546 .cfi_restore 12 # LOE r13 r14 r15 ebx r12d ..B4.12: # Preds ..B4.1 # Execution count [5.00e-02]: Infreq - vmovups 4224+__svml_ssin_ha_data_internal(%rip), %ymm1 #1823.53 + vmovups 4224+__jsvml_ssin_ha_data_internal(%rip), %ymm1 #1823.53 movl $2139095040, %r11d #1912.24 vmovups %ymm0, (%rsp) #[spill] vmovups %ymm13, 64(%rsp) #[spill] @@ -1364,7 +1364,7 @@ __svml_sinf8_ha_e9: vandps %ymm8, %ymm1, %ymm2 #1824.16 vmovd %r11d, %xmm8 #1912.24 vcmpeqps %ymm1, %ymm2, %ymm11 #1825.21 - lea __svml_ssin_ha_reduction_data_internal(%rip), %rdx #1915.1256 + lea __jsvml_ssin_ha_reduction_data_internal(%rip), %rdx #1915.1256 vpshufd $0, %xmm8, %xmm13 #1912.24 vpand %xmm0, %xmm13, %xmm6 #1913.22 vextractf128 $1, %ymm0, %xmm15 #1911.109 @@ -1440,7 +1440,7 @@ __svml_sinf8_ha_e9: movl $511, %r11d #2003.26 vshufps $136, %xmm12, %xmm9, %xmm1 #1917.2304 vmovd %r9d, %xmm9 #1922.26 - lea __svml_ssin_ha_data_internal(%rip), %r9 #2045.878 + lea __jsvml_ssin_ha_data_internal(%rip), %r9 #2045.878 vmovd %edx, %xmm6 #1921.27 movl $872415232, %edx #2001.28 vpshufd $0, %xmm6, %xmm12 #1921.27 @@ -1715,18 +1715,18 @@ __svml_sinf8_ha_e9: vaddps %ymm4, %ymm5, %ymm9 #2051.21 vaddps %ymm6, %ymm7, %ymm15 #2053.18 vsubps %ymm9, %ymm4, %ymm14 #2054.18 - vmulps 4352+__svml_ssin_ha_data_internal(%rip), %ymm11, %ymm6 #2059.29 + vmulps 4352+__jsvml_ssin_ha_data_internal(%rip), %ymm11, %ymm6 #2059.29 vaddps %ymm14, %ymm5, %ymm7 #2055.18 - vaddps 4288+__svml_ssin_ha_data_internal(%rip), %ymm6, %ymm4 #2059.14 + vaddps 4288+__jsvml_ssin_ha_data_internal(%rip), %ymm6, %ymm4 #2059.14 vaddps %ymm7, %ymm15, %ymm7 #2056.22 vmulps %ymm4, %ymm11, %ymm5 #2060.14 vmulps %ymm5, %ymm2, %ymm6 #2061.14 vmulps %ymm10, %ymm2, %ymm2 #2068.35 vaddps %ymm8, %ymm3, %ymm5 #2062.13 vmovd 8(%rdi,%r9), %xmm8 #2067.2044 - vmulps 4480+__svml_ssin_ha_data_internal(%rip), %ymm11, %ymm3 #2065.29 + vmulps 4480+__jsvml_ssin_ha_data_internal(%rip), %ymm11, %ymm3 #2065.29 vsubps %ymm2, %ymm5, %ymm2 #2068.13 - vaddps 4416+__svml_ssin_ha_data_internal(%rip), %ymm3, %ymm4 #2065.14 + vaddps 4416+__jsvml_ssin_ha_data_internal(%rip), %ymm3, %ymm4 #2065.14 vmovd 8(%r8,%r9), %xmm3 #2067.1934 vmulps %ymm2, %ymm1, %ymm1 #2069.31 vmulps %ymm4, %ymm11, %ymm4 #2066.14 @@ -1756,20 +1756,20 @@ __svml_sinf8_ha_e9: # LOE r12 r13 r14 r15 eax ymm0 ymm13 .cfi_endproc # mark_end; - .type __svml_sinf8_ha_e9,@function - .size __svml_sinf8_ha_e9,.-__svml_sinf8_ha_e9 -..LN__svml_sinf8_ha_e9.3: + .type __jsvml_sinf8_ha_e9,@function + .size __jsvml_sinf8_ha_e9,.-__jsvml_sinf8_ha_e9 +..LN__jsvml_sinf8_ha_e9.3: .data -# -- End __svml_sinf8_ha_e9 +# -- End __jsvml_sinf8_ha_e9 .text -.L_2__routine_start___svml_sinf4_ha_l9_4: -# -- Begin __svml_sinf4_ha_l9 +.L_2__routine_start___jsvml_sinf4_ha_l9_4: +# -- Begin __jsvml_sinf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinf4_ha_l9 -# --- __svml_sinf4_ha_l9(__m128) -__svml_sinf4_ha_l9: + .globl __jsvml_sinf4_ha_l9 +# --- __jsvml_sinf4_ha_l9(__m128) +__jsvml_sinf4_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -1778,7 +1778,7 @@ __svml_sinf4_ha_l9: .byte 30 #2416.14 .byte 250 #2416.14 .cfi_startproc -..___tag_value___svml_sinf4_ha_l9.133: +..___tag_value___jsvml_sinf4_ha_l9.133: ..L134: #2086.1 pushq %rbp #2086.1 @@ -1789,27 +1789,27 @@ __svml_sinf4_ha_l9: andq $-64, %rsp #2086.1 subq $192, %rsp #2086.1 vmovaps %xmm0, %xmm14 #2086.1 - vmovups 4096+__svml_ssin_ha_data_internal(%rip), %xmm6 #2101.45 + vmovups 4096+__jsvml_ssin_ha_data_internal(%rip), %xmm6 #2101.45 xorl %eax, %eax #2103.1 - vmovups 5056+__svml_ssin_ha_data_internal(%rip), %xmm2 #2124.51 + vmovups 5056+__jsvml_ssin_ha_data_internal(%rip), %xmm2 #2124.51 vandps %xmm6, %xmm14, %xmm1 #2102.12 - vmovups 4544+__svml_ssin_ha_data_internal(%rip), %xmm3 #2125.54 + vmovups 4544+__jsvml_ssin_ha_data_internal(%rip), %xmm3 #2125.54 vandnps %xmm14, %xmm6, %xmm11 #2135.21 vfmadd213ps %xmm3, %xmm1, %xmm2 #2126.17 - vmovupd 5440+__svml_ssin_ha_data_internal(%rip), %ymm8 #2136.52 - vcmpnleps 4160+__svml_ssin_ha_data_internal(%rip), %xmm1, %xmm0 #2150.26 + vmovupd 5440+__jsvml_ssin_ha_data_internal(%rip), %ymm8 #2136.52 + vcmpnleps 4160+__jsvml_ssin_ha_data_internal(%rip), %xmm1, %xmm0 #2150.26 vcvtps2pd %xmm1, %ymm5 #2123.23 vsubps %xmm3, %xmm2, %xmm4 #2128.17 vmovmskps %xmm0, %edx #2152.74 vpslld $31, %xmm2, %xmm10 #2127.38 vcvtps2pd %xmm4, %ymm9 #2129.23 vxorps %xmm11, %xmm10, %xmm15 #2145.20 - vfnmadd231pd 5120+__svml_ssin_ha_data_internal(%rip), %ymm9, %ymm5 #2131.17 - vfnmadd132pd 5184+__svml_ssin_ha_data_internal(%rip), %ymm5, %ymm9 #2133.17 + vfnmadd231pd 5120+__jsvml_ssin_ha_data_internal(%rip), %ymm9, %ymm5 #2131.17 + vfnmadd132pd 5184+__jsvml_ssin_ha_data_internal(%rip), %ymm5, %ymm9 #2133.17 vmulpd %ymm9, %ymm9, %ymm7 #2134.18 - vfmadd213pd 5376+__svml_ssin_ha_data_internal(%rip), %ymm7, %ymm8 #2138.17 - vfmadd213pd 5312+__svml_ssin_ha_data_internal(%rip), %ymm7, %ymm8 #2140.17 - vfmadd213pd 5248+__svml_ssin_ha_data_internal(%rip), %ymm7, %ymm8 #2142.17 + vfmadd213pd 5376+__jsvml_ssin_ha_data_internal(%rip), %ymm7, %ymm8 #2138.17 + vfmadd213pd 5312+__jsvml_ssin_ha_data_internal(%rip), %ymm7, %ymm8 #2140.17 + vfmadd213pd 5248+__jsvml_ssin_ha_data_internal(%rip), %ymm7, %ymm8 #2142.17 vmulpd %ymm8, %ymm7, %ymm12 #2143.17 vfmadd213pd %ymm9, %ymm9, %ymm12 #2144.19 vcvtpd2ps %ymm12, %xmm13 #2146.18 @@ -1883,10 +1883,10 @@ __svml_sinf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #2419.540 lea 128(%rsp,%r12,4), %rsi #2419.540 -..___tag_value___svml_sinf4_ha_l9.151: -# __svml_ssin_ha_cout_rare_internal(const float *, float *) - call __svml_ssin_ha_cout_rare_internal #2419.540 -..___tag_value___svml_sinf4_ha_l9.152: +..___tag_value___jsvml_sinf4_ha_l9.151: +# __jsvml_ssin_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssin_ha_cout_rare_internal #2419.540 +..___tag_value___jsvml_sinf4_ha_l9.152: jmp ..B5.9 # Prob 100% #2419.540 .cfi_restore 12 .cfi_restore 13 @@ -1894,8 +1894,8 @@ __svml_sinf4_ha_l9: ..B5.12: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.62(%rip), %xmm14, %xmm13 #2268.18 - lea __svml_ssin_ha_reduction_data_internal(%rip), %r8 #2270.708 - vmovups 4224+__svml_ssin_ha_data_internal(%rip), %xmm7 #2178.50 + lea __jsvml_ssin_ha_reduction_data_internal(%rip), %r8 #2270.708 + vmovups 4224+__jsvml_ssin_ha_data_internal(%rip), %xmm7 #2178.50 vpsrld $23, %xmm13, %xmm4 #2269.18 vandps %xmm1, %xmm7, %xmm11 #2179.16 vpslld $1, %xmm4, %xmm10 #2270.234 @@ -1928,7 +1928,7 @@ __svml_sinf4_ha_l9: vpaddd .L_2il0floatpacket.64(%rip), %xmm13, %xmm4 #2279.21 vmovd 4(%rdx,%r8), %xmm15 #2271.1237 vmovd 4(%rcx,%r8), %xmm10 #2271.1320 - lea __svml_ssin_ha_data_internal(%rip), %rcx #2389.509 + lea __jsvml_ssin_ha_data_internal(%rip), %rcx #2389.509 vshufps $136, %xmm12, %xmm6, %xmm12 #2272.1196 vmovdqu .L_2il0floatpacket.65(%rip), %xmm13 #2280.17 vpsrld $16, %xmm12, %xmm1 #2285.12 @@ -2049,10 +2049,10 @@ __svml_sinf4_ha_l9: vshufps $136, %xmm8, %xmm9, %xmm8 #2390.936 vshufps $136, %xmm3, %xmm2, %xmm1 #2391.938 vfmadd213ps %xmm8, %xmm1, %xmm4 #2392.22 - vmovups 4352+__svml_ssin_ha_data_internal(%rip), %xmm13 #2399.44 + vmovups 4352+__jsvml_ssin_ha_data_internal(%rip), %xmm13 #2399.44 vmovd 8(%r11,%rcx), %xmm2 #2409.1163 vmovd 8(%rdx,%rcx), %xmm3 #2409.1246 - vfmadd213ps 4288+__svml_ssin_ha_data_internal(%rip), %xmm10, %xmm13 #2401.14 + vfmadd213ps 4288+__jsvml_ssin_ha_data_internal(%rip), %xmm10, %xmm13 #2401.14 vmovaps %xmm4, %xmm9 #2393.21 vsubps %xmm4, %xmm8, %xmm6 #2394.18 vfmadd231ps %xmm15, %xmm11, %xmm9 #2393.21 @@ -2061,9 +2061,9 @@ __svml_sinf4_ha_l9: vfmadd231ps %xmm11, %xmm1, %xmm6 #2395.18 vsubps %xmm9, %xmm4, %xmm12 #2396.18 vfmadd231ps %xmm15, %xmm11, %xmm12 #2397.18 - vmovups 4480+__svml_ssin_ha_data_internal(%rip), %xmm15 #2407.14 + vmovups 4480+__jsvml_ssin_ha_data_internal(%rip), %xmm15 #2407.14 vmovd 8(%r10,%rcx), %xmm1 #2409.1059 - vfmadd213ps 4416+__svml_ssin_ha_data_internal(%rip), %xmm10, %xmm15 #2407.14 + vfmadd213ps 4416+__jsvml_ssin_ha_data_internal(%rip), %xmm10, %xmm15 #2407.14 vaddps %xmm12, %xmm6, %xmm6 #2398.22 vmulps %xmm5, %xmm11, %xmm12 #2403.14 vfnmadd213ps %xmm13, %xmm8, %xmm11 #2410.13 @@ -2084,20 +2084,20 @@ __svml_sinf4_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm2 xmm14 .cfi_endproc # mark_end; - .type __svml_sinf4_ha_l9,@function - .size __svml_sinf4_ha_l9,.-__svml_sinf4_ha_l9 -..LN__svml_sinf4_ha_l9.4: + .type __jsvml_sinf4_ha_l9,@function + .size __jsvml_sinf4_ha_l9,.-__jsvml_sinf4_ha_l9 +..LN__jsvml_sinf4_ha_l9.4: .data -# -- End __svml_sinf4_ha_l9 +# -- End __jsvml_sinf4_ha_l9 .text -.L_2__routine_start___svml_sinf4_ha_ex_5: -# -- Begin __svml_sinf4_ha_ex +.L_2__routine_start___jsvml_sinf4_ha_ex_5: +# -- Begin __jsvml_sinf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_sinf4_ha_ex -# --- __svml_sinf4_ha_ex(__m128) -__svml_sinf4_ha_ex: + .globl __jsvml_sinf4_ha_ex +# --- __jsvml_sinf4_ha_ex(__m128) +__jsvml_sinf4_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -2106,7 +2106,7 @@ __svml_sinf4_ha_ex: .byte 30 #2771.14 .byte 250 #2771.14 .cfi_startproc -..___tag_value___svml_sinf4_ha_ex.158: +..___tag_value___jsvml_sinf4_ha_ex.158: ..L159: #2428.1 pushq %rbp #2428.1 @@ -2117,16 +2117,16 @@ __svml_sinf4_ha_ex: andq $-64, %rsp #2428.1 subq $192, %rsp #2428.1 xorl %eax, %eax #2445.1 - movups 4096+__svml_ssin_ha_data_internal(%rip), %xmm2 #2443.45 + movups 4096+__jsvml_ssin_ha_data_internal(%rip), %xmm2 #2443.45 movaps %xmm2, %xmm8 #2444.12 andnps %xmm0, %xmm2 #2477.21 - movups 5056+__svml_ssin_ha_data_internal(%rip), %xmm11 #2468.29 + movups 5056+__jsvml_ssin_ha_data_internal(%rip), %xmm11 #2468.29 andps %xmm0, %xmm8 #2444.12 mulps %xmm8, %xmm11 #2468.29 movaps %xmm8, %xmm9 #2465.77 cvtps2pd %xmm8, %xmm7 #2465.23 - movups 4544+__svml_ssin_ha_data_internal(%rip), %xmm10 #2467.54 - movups 5120+__svml_ssin_ha_data_internal(%rip), %xmm13 #2472.52 + movups 4544+__jsvml_ssin_ha_data_internal(%rip), %xmm10 #2467.54 + movups 5120+__jsvml_ssin_ha_data_internal(%rip), %xmm13 #2472.52 addps %xmm10, %xmm11 #2468.17 movaps %xmm11, %xmm6 #2469.38 movaps %xmm13, %xmm12 #2473.40 @@ -2142,7 +2142,7 @@ __svml_sinf4_ha_ex: mulpd %xmm1, %xmm13 #2473.106 subpd %xmm12, %xmm7 #2473.19 subpd %xmm13, %xmm5 #2473.85 - movups 5184+__svml_ssin_ha_data_internal(%rip), %xmm15 #2474.52 + movups 5184+__jsvml_ssin_ha_data_internal(%rip), %xmm15 #2474.52 mulpd %xmm15, %xmm14 #2475.40 mulpd %xmm15, %xmm1 #2475.106 subpd %xmm14, %xmm7 #2475.19 @@ -2151,21 +2151,21 @@ __svml_sinf4_ha_ex: movaps %xmm5, %xmm4 #2476.63 mulpd %xmm7, %xmm3 #2476.20 mulpd %xmm5, %xmm4 #2476.63 - movups 5440+__svml_ssin_ha_data_internal(%rip), %xmm9 #2478.51 + movups 5440+__jsvml_ssin_ha_data_internal(%rip), %xmm9 #2478.51 movaps %xmm9, %xmm1 #2480.31 mulpd %xmm3, %xmm1 #2480.31 mulpd %xmm4, %xmm9 #2480.99 - movups 5376+__svml_ssin_ha_data_internal(%rip), %xmm10 #2479.51 + movups 5376+__jsvml_ssin_ha_data_internal(%rip), %xmm10 #2479.51 addpd %xmm10, %xmm1 #2480.19 addpd %xmm9, %xmm10 #2480.87 mulpd %xmm3, %xmm1 #2482.31 mulpd %xmm4, %xmm10 #2482.98 - movups 5312+__svml_ssin_ha_data_internal(%rip), %xmm11 #2481.51 + movups 5312+__jsvml_ssin_ha_data_internal(%rip), %xmm11 #2481.51 addpd %xmm11, %xmm1 #2482.19 addpd %xmm10, %xmm11 #2482.86 mulpd %xmm3, %xmm1 #2484.31 mulpd %xmm4, %xmm11 #2484.98 - movups 5248+__svml_ssin_ha_data_internal(%rip), %xmm12 #2483.51 + movups 5248+__jsvml_ssin_ha_data_internal(%rip), %xmm12 #2483.51 addpd %xmm12, %xmm1 #2484.19 addpd %xmm11, %xmm12 #2484.86 mulpd %xmm1, %xmm3 #2485.19 @@ -2177,7 +2177,7 @@ __svml_sinf4_ha_ex: cvtpd2ps %xmm7, %xmm10 #2488.34 cvtpd2ps %xmm5, %xmm2 #2488.65 movaps %xmm8, %xmm1 #2492.26 - cmpnleps 4160+__svml_ssin_ha_data_internal(%rip), %xmm1 #2492.26 + cmpnleps 4160+__jsvml_ssin_ha_data_internal(%rip), %xmm1 #2492.26 movmskps %xmm1, %edx #2494.74 movlhps %xmm2, %xmm10 #2488.18 pxor %xmm6, %xmm10 #2489.18 @@ -2242,10 +2242,10 @@ __svml_sinf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #2774.540 lea 128(%rsp,%r12,4), %rsi #2774.540 -..___tag_value___svml_sinf4_ha_ex.176: -# __svml_ssin_ha_cout_rare_internal(const float *, float *) - call __svml_ssin_ha_cout_rare_internal #2774.540 -..___tag_value___svml_sinf4_ha_ex.177: +..___tag_value___jsvml_sinf4_ha_ex.176: +# __jsvml_ssin_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssin_ha_cout_rare_internal #2774.540 +..___tag_value___jsvml_sinf4_ha_ex.177: jmp ..B6.9 # Prob 100% #2774.540 .cfi_restore 12 .cfi_restore 13 @@ -2254,8 +2254,8 @@ __svml_sinf4_ha_ex: # Execution count [5.00e-02]: Infreq movl $2139095040, %edx #2609.18 movl $8388607, %r10d #2618.21 - movups 4224+__svml_ssin_ha_data_internal(%rip), %xmm4 #2520.50 - lea __svml_ssin_ha_reduction_data_internal(%rip), %r9 #2612.803 + movups 4224+__jsvml_ssin_ha_data_internal(%rip), %xmm4 #2520.50 + lea __jsvml_ssin_ha_reduction_data_internal(%rip), %r9 #2612.803 andps %xmm4, %xmm8 #2521.16 movl $8388608, %r11d #2619.20 cmpeqps %xmm4, %xmm8 #2522.21 @@ -2501,7 +2501,7 @@ __svml_sinf4_ha_ex: movd %r9d, %xmm15 #2731.34 pshufd $0, %xmm15, %xmm1 #2731.34 subps %xmm12, %xmm5 #2710.17 - lea __svml_ssin_ha_data_internal(%rip), %rdi #2742.614 + lea __jsvml_ssin_ha_data_internal(%rip), %rdi #2742.614 addps %xmm5, %xmm10 #2711.18 movd %ecx, %xmm5 #2714.38 addps %xmm10, %xmm6 #2712.11 @@ -2573,19 +2573,19 @@ __svml_sinf4_ha_ex: shufps $136, %xmm3, %xmm14 #2743.1041 movaps %xmm14, %xmm9 #2747.22 movaps %xmm14, %xmm8 #2749.18 - movups 4480+__svml_ssin_ha_data_internal(%rip), %xmm2 #2762.26 + movups 4480+__jsvml_ssin_ha_data_internal(%rip), %xmm2 #2762.26 addps %xmm15, %xmm9 #2747.22 mulps %xmm10, %xmm2 #2762.26 subps %xmm9, %xmm8 #2749.18 - addps 4416+__svml_ssin_ha_data_internal(%rip), %xmm2 #2762.14 + addps 4416+__jsvml_ssin_ha_data_internal(%rip), %xmm2 #2762.14 addps %xmm8, %xmm15 #2750.18 - movups 4352+__svml_ssin_ha_data_internal(%rip), %xmm8 #2756.26 + movups 4352+__jsvml_ssin_ha_data_internal(%rip), %xmm8 #2756.26 movaps %xmm9, %xmm13 #2748.21 mulps %xmm10, %xmm8 #2756.26 addps %xmm4, %xmm13 #2748.21 movd 8(%r11,%rdi), %xmm1 #2764.1080 subps %xmm13, %xmm9 #2751.18 - addps 4288+__svml_ssin_ha_data_internal(%rip), %xmm8 #2756.14 + addps 4288+__jsvml_ssin_ha_data_internal(%rip), %xmm8 #2756.14 addps %xmm9, %xmm4 #2752.18 mulps %xmm10, %xmm8 #2757.14 mulps %xmm2, %xmm10 #2763.14 @@ -2617,21 +2617,21 @@ __svml_sinf4_ha_ex: # LOE rbx r12 r13 r14 r15 eax xmm0 xmm10 .cfi_endproc # mark_end; - .type __svml_sinf4_ha_ex,@function - .size __svml_sinf4_ha_ex,.-__svml_sinf4_ha_ex -..LN__svml_sinf4_ha_ex.5: + .type __jsvml_sinf4_ha_ex,@function + .size __jsvml_sinf4_ha_ex,.-__jsvml_sinf4_ha_ex +..LN__jsvml_sinf4_ha_ex.5: .data -# -- End __svml_sinf4_ha_ex +# -- End __jsvml_sinf4_ha_ex .text -.L_2__routine_start___svml_ssin_ha_cout_rare_internal_6: -# -- Begin __svml_ssin_ha_cout_rare_internal +.L_2__routine_start___jsvml_ssin_ha_cout_rare_internal_6: +# -- Begin __jsvml_ssin_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_ssin_ha_cout_rare_internal - .globl __svml_ssin_ha_cout_rare_internal -# --- __svml_ssin_ha_cout_rare_internal(const float *, float *) -__svml_ssin_ha_cout_rare_internal: + .hidden __jsvml_ssin_ha_cout_rare_internal + .globl __jsvml_ssin_ha_cout_rare_internal +# --- __jsvml_ssin_ha_cout_rare_internal(const float *, float *) +__jsvml_ssin_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -2641,7 +2641,7 @@ __svml_ssin_ha_cout_rare_internal: .byte 30 #1028.12 .byte 250 #1028.12 .cfi_startproc -..___tag_value___svml_ssin_ha_cout_rare_internal.199: +..___tag_value___jsvml_ssin_ha_cout_rare_internal.199: ..L200: #1009.1 movl (%rdi), %edx #1012.22 @@ -2686,11 +2686,11 @@ __svml_ssin_ha_cout_rare_internal: # LOE .cfi_endproc # mark_end; - .type __svml_ssin_ha_cout_rare_internal,@function - .size __svml_ssin_ha_cout_rare_internal,.-__svml_ssin_ha_cout_rare_internal -..LN__svml_ssin_ha_cout_rare_internal.6: + .type __jsvml_ssin_ha_cout_rare_internal,@function + .size __jsvml_ssin_ha_cout_rare_internal,.-__jsvml_ssin_ha_cout_rare_internal +..LN__jsvml_ssin_ha_cout_rare_internal.6: .data -# -- End __svml_ssin_ha_cout_rare_internal +# -- End __jsvml_ssin_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 @@ -2774,9 +2774,9 @@ __svml_ssin_ha_cout_rare_internal: .type .L_2il0floatpacket.35,@object .size .L_2il0floatpacket.35,64 .align 64 - .hidden __svml_ssin_ha_reduction_data_internal - .globl __svml_ssin_ha_reduction_data_internal -__svml_ssin_ha_reduction_data_internal: + .hidden __jsvml_ssin_ha_reduction_data_internal + .globl __jsvml_ssin_ha_reduction_data_internal +__jsvml_ssin_ha_reduction_data_internal: .long 0 .long 0 .long 0 @@ -3545,12 +3545,12 @@ __svml_ssin_ha_reduction_data_internal: .long 2590957677 .long 2974469278 .long 566763775 - .type __svml_ssin_ha_reduction_data_internal,@object - .size __svml_ssin_ha_reduction_data_internal,3072 + .type __jsvml_ssin_ha_reduction_data_internal,@object + .size __jsvml_ssin_ha_reduction_data_internal,3072 .align 64 - .hidden __svml_ssin_ha_data_internal - .globl __svml_ssin_ha_data_internal -__svml_ssin_ha_data_internal: + .hidden __jsvml_ssin_ha_data_internal + .globl __jsvml_ssin_ha_data_internal +__jsvml_ssin_ha_data_internal: .long 0 .long 0 .long 0 @@ -4927,8 +4927,8 @@ __svml_ssin_ha_data_internal: .long 1053154271 .long 239893998 .long 1053154271 - .type __svml_ssin_ha_data_internal,@object - .size __svml_ssin_ha_data_internal,5504 + .type __jsvml_ssin_ha_data_internal,@object + .size __jsvml_ssin_ha_data_internal,5504 .align 32 .L_2il0floatpacket.36: .long 0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_sinh_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_sinh_linux_x86.S similarity index 93% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_sinh_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_sinh_linux_x86.S index bdc01390260..a143f847b2d 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_sinh_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_sinh_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_sinh.c" .text ..TXTST0: -.L_2__routine_start___svml_sinhf4_ha_l9_0: -# -- Begin __svml_sinhf4_ha_l9 +.L_2__routine_start___jsvml_sinhf4_ha_l9_0: +# -- Begin __jsvml_sinhf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinhf4_ha_l9 -# --- __svml_sinhf4_ha_l9(__m128) -__svml_sinhf4_ha_l9: + .globl __jsvml_sinhf4_ha_l9 +# --- __jsvml_sinhf4_ha_l9(__m128) +__jsvml_sinhf4_ha_l9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_sinhf4_ha_l9: .byte 30 #492.540 .byte 250 #492.540 .cfi_startproc -..___tag_value___svml_sinhf4_ha_l9.1: +..___tag_value___jsvml_sinhf4_ha_l9.1: ..L2: #426.1 pushq %rbp #426.1 @@ -58,29 +58,29 @@ __svml_sinhf4_ha_l9: andq $-64, %rsp #426.1 subq $192, %rsp #426.1 vmovaps %xmm0, %xmm11 #426.1 - vandps 1152+__svml_ssinh_ha_data_internal(%rip), %xmm11, %xmm10 #455.17 - lea 1484+__svml_ssinh_ha_data_internal(%rip), %r8 #473.509 - vmovups 1280+__svml_ssinh_ha_data_internal(%rip), %xmm0 #448.49 + vandps 1152+__jsvml_ssinh_ha_data_internal(%rip), %xmm11, %xmm10 #455.17 + lea 1484+__jsvml_ssinh_ha_data_internal(%rip), %r8 #473.509 + vmovups 1280+__jsvml_ssinh_ha_data_internal(%rip), %xmm0 #448.49 vxorps %xmm11, %xmm10, %xmm8 #456.16 - vmovups 960+__svml_ssinh_ha_data_internal(%rip), %xmm5 #453.48 + vmovups 960+__jsvml_ssinh_ha_data_internal(%rip), %xmm5 #453.48 vfmadd213ps %xmm0, %xmm8, %xmm5 #457.13 - vmovups 1344+__svml_ssinh_ha_data_internal(%rip), %xmm3 #450.23 - vpcmpgtd 1408+__svml_ssinh_ha_data_internal(%rip), %xmm8, %xmm12 #459.23 + vmovups 1344+__jsvml_ssinh_ha_data_internal(%rip), %xmm3 #450.23 + vpcmpgtd 1408+__jsvml_ssinh_ha_data_internal(%rip), %xmm8, %xmm12 #459.23 vmovmskps %xmm12, %eax #460.44 - vmovups 5568+__svml_ssinh_ha_data_internal(%rip), %xmm7 #454.25 + vmovups 5568+__jsvml_ssinh_ha_data_internal(%rip), %xmm7 #454.25 vxorps %xmm0, %xmm5, %xmm9 #461.13 vsubps %xmm0, %xmm5, %xmm1 #470.13 vpsubd %xmm9, %xmm3, %xmm13 #463.19 vpsrld $28, %xmm13, %xmm14 #464.19 vpslld $4, %xmm14, %xmm15 #465.19 vpor %xmm9, %xmm15, %xmm6 #466.19 - vmovups 1024+__svml_ssinh_ha_data_internal(%rip), %xmm5 #471.13 + vmovups 1024+__jsvml_ssinh_ha_data_internal(%rip), %xmm5 #471.13 vpand %xmm3, %xmm6, %xmm6 #467.19 vfnmadd213ps %xmm8, %xmm1, %xmm5 #471.13 vpslld $4, %xmm6, %xmm2 #473.179 vpsubd %xmm6, %xmm9, %xmm9 #468.20 vmovd %xmm2, %edx #473.238 - vfnmadd231ps 1088+__svml_ssinh_ha_data_internal(%rip), %xmm1, %xmm5 #472.13 + vfnmadd231ps 1088+__jsvml_ssinh_ha_data_internal(%rip), %xmm1, %xmm5 #472.13 vmovd -4(%rdx,%r8), %xmm4 #473.986 vmovd (%rdx,%r8), %xmm0 #474.986 vpextrd $1, %xmm2, %ecx #473.302 @@ -179,29 +179,29 @@ __svml_sinhf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #492.540 lea 128(%rsp,%r12,4), %rsi #492.540 -..___tag_value___svml_sinhf4_ha_l9.19: -# __svml_ssinh_ha_cout_rare_internal(const float *, float *) - call __svml_ssinh_ha_cout_rare_internal #492.540 -..___tag_value___svml_sinhf4_ha_l9.20: +..___tag_value___jsvml_sinhf4_ha_l9.19: +# __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssinh_ha_cout_rare_internal #492.540 +..___tag_value___jsvml_sinhf4_ha_l9.20: jmp ..B1.8 # Prob 100% #492.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinhf4_ha_l9,@function - .size __svml_sinhf4_ha_l9,.-__svml_sinhf4_ha_l9 -..LN__svml_sinhf4_ha_l9.0: + .type __jsvml_sinhf4_ha_l9,@function + .size __jsvml_sinhf4_ha_l9,.-__jsvml_sinhf4_ha_l9 +..LN__jsvml_sinhf4_ha_l9.0: .data -# -- End __svml_sinhf4_ha_l9 +# -- End __jsvml_sinhf4_ha_l9 .text -.L_2__routine_start___svml_sinhf16_ha_z0_1: -# -- Begin __svml_sinhf16_ha_z0 +.L_2__routine_start___jsvml_sinhf16_ha_z0_1: +# -- Begin __jsvml_sinhf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_sinhf16_ha_z0 -# --- __svml_sinhf16_ha_z0(__m512) -__svml_sinhf16_ha_z0: + .globl __jsvml_sinhf16_ha_z0 +# --- __jsvml_sinhf16_ha_z0(__m512) +__jsvml_sinhf16_ha_z0: # parameter 1: %zmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -210,7 +210,7 @@ __svml_sinhf16_ha_z0: .byte 30 #596.760 .byte 250 #596.760 .cfi_startproc -..___tag_value___svml_sinhf16_ha_z0.22: +..___tag_value___jsvml_sinhf16_ha_z0.22: ..L23: #500.1 pushq %rbp #500.1 @@ -220,45 +220,45 @@ __svml_sinhf16_ha_z0: .cfi_offset 6, -16 andq $-64, %rsp #500.1 subq $192, %rsp #500.1 - vmovups 1152+__svml_ssinh_ha_data_internal(%rip), %zmm10 #543.48 - vmovups 960+__svml_ssinh_ha_data_internal(%rip), %zmm9 #549.17 - vmovups 576+__svml_ssinh_ha_data_internal(%rip), %zmm5 #550.61 - vmovups 1024+__svml_ssinh_ha_data_internal(%rip), %zmm1 #536.49 - vmovups 1088+__svml_ssinh_ha_data_internal(%rip), %zmm8 #537.49 - vmovups 896+__svml_ssinh_ha_data_internal(%rip), %zmm12 #542.49 - vmovups 832+__svml_ssinh_ha_data_internal(%rip), %zmm13 #541.49 + vmovups 1152+__jsvml_ssinh_ha_data_internal(%rip), %zmm10 #543.48 + vmovups 960+__jsvml_ssinh_ha_data_internal(%rip), %zmm9 #549.17 + vmovups 576+__jsvml_ssinh_ha_data_internal(%rip), %zmm5 #550.61 + vmovups 1024+__jsvml_ssinh_ha_data_internal(%rip), %zmm1 #536.49 + vmovups 1088+__jsvml_ssinh_ha_data_internal(%rip), %zmm8 #537.49 + vmovups 896+__jsvml_ssinh_ha_data_internal(%rip), %zmm12 #542.49 + vmovups 832+__jsvml_ssinh_ha_data_internal(%rip), %zmm13 #541.49 vpternlogd $255, %zmm4, %zmm4, %zmm4 #547.21 vmovaps %zmm0, %zmm15 #500.1 vandps %zmm15, %zmm10, %zmm14 #544.17 - vmovups 512+__svml_ssinh_ha_data_internal(%rip), %zmm0 #538.51 + vmovups 512+__jsvml_ssinh_ha_data_internal(%rip), %zmm0 #538.51 vxorps %zmm15, %zmm14, %zmm11 #545.16 vfmadd213ps {rn-sae}, %zmm0, %zmm11, %zmm9 #549.17 - vpcmpd $2, 704+__svml_ssinh_ha_data_internal(%rip), %zmm11, %k1 #547.88 + vpcmpd $2, 704+__jsvml_ssinh_ha_data_internal(%rip), %zmm11, %k1 #547.88 vcmpps $0, {sae}, %zmm9, %zmm5, %k2 #551.24 - vmovups 256+__svml_ssinh_ha_data_internal(%rip), %zmm5 #562.280 + vmovups 256+__jsvml_ssinh_ha_data_internal(%rip), %zmm5 #562.280 vblendmps %zmm0, %zmm9, %zmm6{%k2} #552.25 vsubps {rn-sae}, %zmm0, %zmm6, %zmm3 #553.19 - vmovups 128+__svml_ssinh_ha_data_internal(%rip), %zmm0 #572.284 + vmovups 128+__jsvml_ssinh_ha_data_internal(%rip), %zmm0 #572.284 vpandnd %zmm11, %zmm11, %zmm4{%k1} #547.21 vfnmadd231ps {rn-sae}, %zmm1, %zmm3, %zmm11 #554.17 vptestmd %zmm4, %zmm4, %k0 #548.33 - vmovups __svml_ssinh_ha_data_internal(%rip), %zmm4 #561.280 + vmovups __jsvml_ssinh_ha_data_internal(%rip), %zmm4 #561.280 vfnmadd231ps {rn-sae}, %zmm8, %zmm3, %zmm11 #555.17 kmovw %k0, %esi #548.33 vmulps {rn-sae}, %zmm11, %zmm11, %zmm9 #556.20 vmulps {rn-sae}, %zmm9, %zmm12, %zmm12 #588.28 vfmadd213ps {rn-sae}, %zmm11, %zmm11, %zmm12 #589.26 vmulps {rn-sae}, %zmm9, %zmm13, %zmm11 #590.25 - vpandd 640+__svml_ssinh_ha_data_internal(%rip), %zmm6, %zmm7 #559.21 + vpandd 640+__jsvml_ssinh_ha_data_internal(%rip), %zmm6, %zmm7 #559.21 vpxord %zmm7, %zmm6, %zmm2 #560.17 vpslld $18, %zmm2, %zmm8 #563.19 - vmovups 384+__svml_ssinh_ha_data_internal(%rip), %zmm2 #573.284 - vpermt2ps 320+__svml_ssinh_ha_data_internal(%rip), %zmm7, %zmm5 #562.280 - vpermt2ps 64+__svml_ssinh_ha_data_internal(%rip), %zmm7, %zmm4 #561.280 - vpermt2ps 448+__svml_ssinh_ha_data_internal(%rip), %zmm7, %zmm2 #573.284 + vmovups 384+__jsvml_ssinh_ha_data_internal(%rip), %zmm2 #573.284 + vpermt2ps 320+__jsvml_ssinh_ha_data_internal(%rip), %zmm7, %zmm5 #562.280 + vpermt2ps 64+__jsvml_ssinh_ha_data_internal(%rip), %zmm7, %zmm4 #561.280 + vpermt2ps 448+__jsvml_ssinh_ha_data_internal(%rip), %zmm7, %zmm2 #573.284 vpsubd %zmm8, %zmm5, %zmm3 #568.20 vpaddd %zmm8, %zmm4, %zmm6 #565.20 - vpermt2ps 192+__svml_ssinh_ha_data_internal(%rip), %zmm7, %zmm0 #572.284 + vpermt2ps 192+__jsvml_ssinh_ha_data_internal(%rip), %zmm7, %zmm0 #572.284 vandnps %zmm2, %zmm10, %zmm7 #577.26 vsubps {rn-sae}, %zmm3, %zmm6, %zmm5 #571.20 vpaddd %zmm8, %zmm0, %zmm1 #575.24 @@ -383,29 +383,29 @@ __svml_sinhf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #596.760 lea 128(%rsp,%rbx,4), %rsi #596.760 -..___tag_value___svml_sinhf16_ha_z0.50: -# __svml_ssinh_ha_cout_rare_internal(const float *, float *) - call __svml_ssinh_ha_cout_rare_internal #596.760 -..___tag_value___svml_sinhf16_ha_z0.51: +..___tag_value___jsvml_sinhf16_ha_z0.50: +# __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssinh_ha_cout_rare_internal #596.760 +..___tag_value___jsvml_sinhf16_ha_z0.51: jmp ..B2.13 # Prob 100% #596.760 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_sinhf16_ha_z0,@function - .size __svml_sinhf16_ha_z0,.-__svml_sinhf16_ha_z0 -..LN__svml_sinhf16_ha_z0.1: + .type __jsvml_sinhf16_ha_z0,@function + .size __jsvml_sinhf16_ha_z0,.-__jsvml_sinhf16_ha_z0 +..LN__jsvml_sinhf16_ha_z0.1: .data -# -- End __svml_sinhf16_ha_z0 +# -- End __jsvml_sinhf16_ha_z0 .text -.L_2__routine_start___svml_sinhf4_ha_e9_2: -# -- Begin __svml_sinhf4_ha_e9 +.L_2__routine_start___jsvml_sinhf4_ha_e9_2: +# -- Begin __jsvml_sinhf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinhf4_ha_e9 -# --- __svml_sinhf4_ha_e9(__m128) -__svml_sinhf4_ha_e9: + .globl __jsvml_sinhf4_ha_e9 +# --- __jsvml_sinhf4_ha_e9(__m128) +__jsvml_sinhf4_ha_e9: # parameter 1: %xmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -414,7 +414,7 @@ __svml_sinhf4_ha_e9: .byte 30 #975.540 .byte 250 #975.540 .cfi_startproc -..___tag_value___svml_sinhf4_ha_e9.53: +..___tag_value___jsvml_sinhf4_ha_e9.53: ..L54: #909.1 pushq %rbp #909.1 @@ -425,30 +425,30 @@ __svml_sinhf4_ha_e9: andq $-64, %rsp #909.1 subq $192, %rsp #909.1 movaps %xmm0, %xmm9 #909.1 - movups 1152+__svml_ssinh_ha_data_internal(%rip), %xmm0 #938.17 - lea 1484+__svml_ssinh_ha_data_internal(%rip), %r8 #956.533 + movups 1152+__jsvml_ssinh_ha_data_internal(%rip), %xmm0 #938.17 + lea 1484+__jsvml_ssinh_ha_data_internal(%rip), %r8 #956.533 andps %xmm9, %xmm0 #938.17 movaps %xmm0, %xmm8 #939.16 - movups 960+__svml_ssinh_ha_data_internal(%rip), %xmm14 #940.25 + movups 960+__jsvml_ssinh_ha_data_internal(%rip), %xmm14 #940.25 pxor %xmm9, %xmm8 #939.16 mulps %xmm8, %xmm14 #940.25 movaps %xmm8, %xmm5 #954.13 - movups 1280+__svml_ssinh_ha_data_internal(%rip), %xmm12 #931.49 + movups 1280+__jsvml_ssinh_ha_data_internal(%rip), %xmm12 #931.49 movaps %xmm8, %xmm10 #942.27 movaps %xmm12, %xmm7 #944.13 addps %xmm12, %xmm14 #940.13 pxor %xmm14, %xmm7 #944.13 subps %xmm12, %xmm14 #953.13 - movups 1344+__svml_ssinh_ha_data_internal(%rip), %xmm11 #933.27 + movups 1344+__jsvml_ssinh_ha_data_internal(%rip), %xmm11 #933.27 movaps %xmm11, %xmm6 #946.23 - movups 1024+__svml_ssinh_ha_data_internal(%rip), %xmm13 #954.35 + movups 1024+__jsvml_ssinh_ha_data_internal(%rip), %xmm13 #954.35 psubd %xmm7, %xmm6 #946.23 mulps %xmm14, %xmm13 #954.35 psrld $28, %xmm6 #947.23 pslld $4, %xmm6 #948.23 subps %xmm13, %xmm5 #954.13 por %xmm7, %xmm6 #949.23 - movups 1088+__svml_ssinh_ha_data_internal(%rip), %xmm15 #955.32 + movups 1088+__jsvml_ssinh_ha_data_internal(%rip), %xmm15 #955.32 pand %xmm11, %xmm6 #950.23 mulps %xmm14, %xmm15 #955.32 movdqa %xmm6, %xmm2 #956.183 @@ -456,7 +456,7 @@ __svml_sinhf4_ha_e9: psubd %xmm6, %xmm7 #951.24 movd %xmm2, %edx #956.246 pslld $19, %xmm7 #952.24 - pcmpgtd 1408+__svml_ssinh_ha_data_internal(%rip), %xmm10 #942.27 + pcmpgtd 1408+__jsvml_ssinh_ha_data_internal(%rip), %xmm10 #942.27 subps %xmm15, %xmm5 #955.13 movmskps %xmm10, %eax #943.44 movd (%rdx,%r8), %xmm14 #957.1010 @@ -497,7 +497,7 @@ __svml_sinhf4_ha_e9: movd -12(%rdi,%r8), %xmm4 #965.1280 punpcklqdq %xmm4, %xmm10 #965.1177 shufps $136, %xmm10, %xmm11 #965.970 - movups 5568+__svml_ssinh_ha_data_internal(%rip), %xmm3 #958.19 + movups 5568+__jsvml_ssinh_ha_data_internal(%rip), %xmm3 #958.19 addps %xmm5, %xmm11 #967.15 pcmpgtd %xmm6, %xmm3 #958.19 andps %xmm3, %xmm8 #963.16 @@ -560,29 +560,29 @@ __svml_sinhf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #975.540 lea 128(%rsp,%r12,4), %rsi #975.540 -..___tag_value___svml_sinhf4_ha_e9.71: -# __svml_ssinh_ha_cout_rare_internal(const float *, float *) - call __svml_ssinh_ha_cout_rare_internal #975.540 -..___tag_value___svml_sinhf4_ha_e9.72: +..___tag_value___jsvml_sinhf4_ha_e9.71: +# __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssinh_ha_cout_rare_internal #975.540 +..___tag_value___jsvml_sinhf4_ha_e9.72: jmp ..B3.8 # Prob 100% #975.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinhf4_ha_e9,@function - .size __svml_sinhf4_ha_e9,.-__svml_sinhf4_ha_e9 -..LN__svml_sinhf4_ha_e9.2: + .type __jsvml_sinhf4_ha_e9,@function + .size __jsvml_sinhf4_ha_e9,.-__jsvml_sinhf4_ha_e9 +..LN__jsvml_sinhf4_ha_e9.2: .data -# -- End __svml_sinhf4_ha_e9 +# -- End __jsvml_sinhf4_ha_e9 .text -.L_2__routine_start___svml_sinhf8_ha_e9_3: -# -- Begin __svml_sinhf8_ha_e9 +.L_2__routine_start___jsvml_sinhf8_ha_e9_3: +# -- Begin __jsvml_sinhf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinhf8_ha_e9 -# --- __svml_sinhf8_ha_e9(__m256) -__svml_sinhf8_ha_e9: + .globl __jsvml_sinhf8_ha_e9 +# --- __jsvml_sinhf8_ha_e9(__m256) +__jsvml_sinhf8_ha_e9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -591,7 +591,7 @@ __svml_sinhf8_ha_e9: .byte 30 #1049.546 .byte 250 #1049.546 .cfi_startproc -..___tag_value___svml_sinhf8_ha_e9.74: +..___tag_value___jsvml_sinhf8_ha_e9.74: ..L75: #983.1 pushq %rbp #983.1 @@ -602,15 +602,15 @@ __svml_sinhf8_ha_e9: andq $-64, %rsp #983.1 pushq %r13 #983.1 subq $184, %rsp #983.1 - lea 1484+__svml_ssinh_ha_data_internal(%rip), %r10 #1030.878 + lea 1484+__jsvml_ssinh_ha_data_internal(%rip), %r10 #1030.878 vmovaps %ymm0, %ymm7 #983.1 - vandps 1152+__svml_ssinh_ha_data_internal(%rip), %ymm7, %ymm6 #1012.17 + vandps 1152+__jsvml_ssinh_ha_data_internal(%rip), %ymm7, %ymm6 #1012.17 vxorps %ymm7, %ymm6, %ymm0 #1013.16 - vmovups 1280+__svml_ssinh_ha_data_internal(%rip), %ymm14 #1005.52 - vmulps 960+__svml_ssinh_ha_data_internal(%rip), %ymm0, %ymm5 #1014.28 - vmovups 1408+__svml_ssinh_ha_data_internal(%rip), %xmm2 #1006.29 - vmovups 1344+__svml_ssinh_ha_data_internal(%rip), %xmm3 #1007.27 - vmovups 5568+__svml_ssinh_ha_data_internal(%rip), %xmm8 #1011.29 + vmovups 1280+__jsvml_ssinh_ha_data_internal(%rip), %ymm14 #1005.52 + vmulps 960+__jsvml_ssinh_ha_data_internal(%rip), %ymm0, %ymm5 #1014.28 + vmovups 1408+__jsvml_ssinh_ha_data_internal(%rip), %xmm2 #1006.29 + vmovups 1344+__jsvml_ssinh_ha_data_internal(%rip), %xmm3 #1007.27 + vmovups 5568+__jsvml_ssinh_ha_data_internal(%rip), %xmm8 #1011.29 vaddps %ymm5, %ymm14, %ymm1 #1014.13 vpxor %xmm5, %xmm5, %xmm5 #1017.62 vpcmpgtd %xmm2, %xmm0, %xmm12 #1016.27 @@ -621,7 +621,7 @@ __svml_sinhf8_ha_e9: vpmovmskb %xmm4, %r11d #1017.43 vxorps %ymm14, %ymm1, %ymm4 #1018.13 vsubps %ymm14, %ymm1, %ymm14 #1027.13 - vmulps 1024+__svml_ssinh_ha_data_internal(%rip), %ymm14, %ymm1 #1028.38 + vmulps 1024+__jsvml_ssinh_ha_data_internal(%rip), %ymm14, %ymm1 #1028.38 vpsubd %xmm4, %xmm3, %xmm2 #1020.23 vextractf128 $1, %ymm4, %xmm5 #1019.104 vpsrld $28, %xmm2, %xmm10 #1021.23 @@ -638,7 +638,7 @@ __svml_sinhf8_ha_e9: vpslld $4, %xmm3, %xmm13 #1030.245 vmovd %xmm9, %r9d #1030.308 vmovd %xmm13, %ecx #1030.589 - vmulps 1088+__svml_ssinh_ha_data_internal(%rip), %ymm14, %ymm1 #1029.35 + vmulps 1088+__jsvml_ssinh_ha_data_internal(%rip), %ymm14, %ymm1 #1029.35 vmovd -4(%r9,%r10), %xmm14 #1030.1863 vpextrd $1, %xmm9, %r8d #1030.376 vpextrd $2, %xmm9, %edi #1030.447 @@ -788,29 +788,29 @@ __svml_sinhf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r13,4), %rdi #1049.546 lea 128(%rsp,%r13,4), %rsi #1049.546 -..___tag_value___svml_sinhf8_ha_e9.90: -# __svml_ssinh_ha_cout_rare_internal(const float *, float *) - call __svml_ssinh_ha_cout_rare_internal #1049.546 -..___tag_value___svml_sinhf8_ha_e9.91: +..___tag_value___jsvml_sinhf8_ha_e9.90: +# __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssinh_ha_cout_rare_internal #1049.546 +..___tag_value___jsvml_sinhf8_ha_e9.91: jmp ..B4.8 # Prob 100% #1049.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinhf8_ha_e9,@function - .size __svml_sinhf8_ha_e9,.-__svml_sinhf8_ha_e9 -..LN__svml_sinhf8_ha_e9.3: + .type __jsvml_sinhf8_ha_e9,@function + .size __jsvml_sinhf8_ha_e9,.-__jsvml_sinhf8_ha_e9 +..LN__jsvml_sinhf8_ha_e9.3: .data -# -- End __svml_sinhf8_ha_e9 +# -- End __jsvml_sinhf8_ha_e9 .text -.L_2__routine_start___svml_sinhf8_ha_l9_4: -# -- Begin __svml_sinhf8_ha_l9 +.L_2__routine_start___jsvml_sinhf8_ha_l9_4: +# -- Begin __jsvml_sinhf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_sinhf8_ha_l9 -# --- __svml_sinhf8_ha_l9(__m256) -__svml_sinhf8_ha_l9: + .globl __jsvml_sinhf8_ha_l9 +# --- __jsvml_sinhf8_ha_l9(__m256) +__jsvml_sinhf8_ha_l9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -819,7 +819,7 @@ __svml_sinhf8_ha_l9: .byte 30 #1123.546 .byte 250 #1123.546 .cfi_startproc -..___tag_value___svml_sinhf8_ha_l9.93: +..___tag_value___jsvml_sinhf8_ha_l9.93: ..L94: #1057.1 pushq %rbp #1057.1 @@ -830,13 +830,13 @@ __svml_sinhf8_ha_l9: andq $-64, %rsp #1057.1 pushq %r15 #1057.1 subq $184, %rsp #1057.1 - lea 1484+__svml_ssinh_ha_data_internal(%rip), %r10 #1104.1007 + lea 1484+__jsvml_ssinh_ha_data_internal(%rip), %r10 #1104.1007 vmovaps %ymm0, %ymm14 #1057.1 - vmovups 1280+__svml_ssinh_ha_data_internal(%rip), %ymm0 #1079.52 - vmovups 960+__svml_ssinh_ha_data_internal(%rip), %ymm4 #1084.51 - vmovups 1344+__svml_ssinh_ha_data_internal(%rip), %ymm3 #1081.23 - vmovups 5568+__svml_ssinh_ha_data_internal(%rip), %ymm10 #1085.25 - vandps 1152+__svml_ssinh_ha_data_internal(%rip), %ymm14, %ymm13 #1086.17 + vmovups 1280+__jsvml_ssinh_ha_data_internal(%rip), %ymm0 #1079.52 + vmovups 960+__jsvml_ssinh_ha_data_internal(%rip), %ymm4 #1084.51 + vmovups 1344+__jsvml_ssinh_ha_data_internal(%rip), %ymm3 #1081.23 + vmovups 5568+__jsvml_ssinh_ha_data_internal(%rip), %ymm10 #1085.25 + vandps 1152+__jsvml_ssinh_ha_data_internal(%rip), %ymm14, %ymm13 #1086.17 vxorps %ymm14, %ymm13, %ymm11 #1087.16 vfmadd213ps %ymm0, %ymm11, %ymm4 #1088.13 vxorps %ymm0, %ymm4, %ymm12 #1092.13 @@ -845,13 +845,13 @@ __svml_sinhf8_ha_l9: vpsrld $28, %ymm9, %ymm5 #1095.19 vpslld $4, %ymm5, %ymm8 #1096.19 vpor %ymm12, %ymm8, %ymm1 #1097.19 - vmovups 1024+__svml_ssinh_ha_data_internal(%rip), %ymm8 #1102.13 + vmovups 1024+__jsvml_ssinh_ha_data_internal(%rip), %ymm8 #1102.13 vpand %ymm3, %ymm1, %ymm9 #1098.19 vfnmadd213ps %ymm11, %ymm2, %ymm8 #1102.13 vpslld $4, %ymm9, %ymm6 #1104.179 vpsubd %ymm9, %ymm12, %ymm12 #1099.20 - vfnmadd231ps 1088+__svml_ssinh_ha_data_internal(%rip), %ymm2, %ymm8 #1103.13 - vpcmpgtd 1408+__svml_ssinh_ha_data_internal(%rip), %ymm11, %ymm15 #1090.23 + vfnmadd231ps 1088+__jsvml_ssinh_ha_data_internal(%rip), %ymm2, %ymm8 #1103.13 + vpcmpgtd 1408+__jsvml_ssinh_ha_data_internal(%rip), %ymm11, %ymm15 #1090.23 vmovmskps %ymm15, %r11d #1091.45 vextractf128 $1, %ymm6, %xmm7 #1104.629 vmovd %xmm6, %r9d #1104.241 @@ -992,29 +992,29 @@ __svml_sinhf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r15,4), %rdi #1123.546 lea 128(%rsp,%r15,4), %rsi #1123.546 -..___tag_value___svml_sinhf8_ha_l9.109: -# __svml_ssinh_ha_cout_rare_internal(const float *, float *) - call __svml_ssinh_ha_cout_rare_internal #1123.546 -..___tag_value___svml_sinhf8_ha_l9.110: +..___tag_value___jsvml_sinhf8_ha_l9.109: +# __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssinh_ha_cout_rare_internal #1123.546 +..___tag_value___jsvml_sinhf8_ha_l9.110: jmp ..B5.8 # Prob 100% #1123.546 .align 16,0x90 # LOE rbx r13 r14 r12d r15d .cfi_endproc # mark_end; - .type __svml_sinhf8_ha_l9,@function - .size __svml_sinhf8_ha_l9,.-__svml_sinhf8_ha_l9 -..LN__svml_sinhf8_ha_l9.4: + .type __jsvml_sinhf8_ha_l9,@function + .size __jsvml_sinhf8_ha_l9,.-__jsvml_sinhf8_ha_l9 +..LN__jsvml_sinhf8_ha_l9.4: .data -# -- End __svml_sinhf8_ha_l9 +# -- End __jsvml_sinhf8_ha_l9 .text -.L_2__routine_start___svml_sinhf4_ha_ex_5: -# -- Begin __svml_sinhf4_ha_ex +.L_2__routine_start___jsvml_sinhf4_ha_ex_5: +# -- Begin __jsvml_sinhf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_sinhf4_ha_ex -# --- __svml_sinhf4_ha_ex(__m128) -__svml_sinhf4_ha_ex: + .globl __jsvml_sinhf4_ha_ex +# --- __jsvml_sinhf4_ha_ex(__m128) +__jsvml_sinhf4_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -1023,7 +1023,7 @@ __svml_sinhf4_ha_ex: .byte 30 #1197.540 .byte 250 #1197.540 .cfi_startproc -..___tag_value___svml_sinhf4_ha_ex.112: +..___tag_value___jsvml_sinhf4_ha_ex.112: ..L113: #1131.1 pushq %rbp #1131.1 @@ -1034,31 +1034,31 @@ __svml_sinhf4_ha_ex: andq $-64, %rsp #1131.1 subq $192, %rsp #1131.1 movaps %xmm0, %xmm9 #1131.1 - movups 1152+__svml_ssinh_ha_data_internal(%rip), %xmm0 #1160.17 - lea 1484+__svml_ssinh_ha_data_internal(%rip), %r8 #1178.614 + movups 1152+__jsvml_ssinh_ha_data_internal(%rip), %xmm0 #1160.17 + lea 1484+__jsvml_ssinh_ha_data_internal(%rip), %r8 #1178.614 andps %xmm9, %xmm0 #1160.17 movaps %xmm0, %xmm8 #1161.16 - movups 960+__svml_ssinh_ha_data_internal(%rip), %xmm14 #1162.25 + movups 960+__jsvml_ssinh_ha_data_internal(%rip), %xmm14 #1162.25 pxor %xmm9, %xmm8 #1161.16 mulps %xmm8, %xmm14 #1162.25 movaps %xmm8, %xmm5 #1176.13 - movups 1280+__svml_ssinh_ha_data_internal(%rip), %xmm12 #1153.49 + movups 1280+__jsvml_ssinh_ha_data_internal(%rip), %xmm12 #1153.49 movaps %xmm8, %xmm10 #1164.21 movaps %xmm12, %xmm7 #1166.13 addps %xmm12, %xmm14 #1162.13 pxor %xmm14, %xmm7 #1166.13 subps %xmm12, %xmm14 #1175.13 - movdqu 1344+__svml_ssinh_ha_data_internal(%rip), %xmm11 #1155.56 + movdqu 1344+__jsvml_ssinh_ha_data_internal(%rip), %xmm11 #1155.56 movdqa %xmm11, %xmm6 #1168.17 psubd %xmm7, %xmm6 #1168.17 - movups 1024+__svml_ssinh_ha_data_internal(%rip), %xmm13 #1176.35 + movups 1024+__jsvml_ssinh_ha_data_internal(%rip), %xmm13 #1176.35 psrld $28, %xmm6 #1169.17 mulps %xmm14, %xmm13 #1176.35 pslld $4, %xmm6 #1170.17 por %xmm7, %xmm6 #1171.17 subps %xmm13, %xmm5 #1176.13 pand %xmm11, %xmm6 #1172.17 - movups 1088+__svml_ssinh_ha_data_internal(%rip), %xmm15 #1177.32 + movups 1088+__jsvml_ssinh_ha_data_internal(%rip), %xmm15 #1177.32 movdqa %xmm6, %xmm1 #1178.177 mulps %xmm14, %xmm15 #1177.32 pslld $4, %xmm1 #1178.177 @@ -1079,7 +1079,7 @@ __svml_sinhf4_ha_ex: punpcklqdq %xmm13, %xmm1 #1179.1071 punpcklqdq %xmm14, %xmm2 #1179.1257 shufps $136, %xmm2, %xmm1 #1179.1051 - pcmpgtd 1408+__svml_ssinh_ha_data_internal(%rip), %xmm10 #1164.21 + pcmpgtd 1408+__jsvml_ssinh_ha_data_internal(%rip), %xmm10 #1164.21 mulps %xmm5, %xmm1 #1183.27 movmskps %xmm10, %eax #1165.44 movd -4(%rdx,%r8), %xmm4 #1178.1090 @@ -1109,7 +1109,7 @@ __svml_sinhf4_ha_ex: punpcklqdq %xmm4, %xmm10 #1187.1071 punpcklqdq %xmm12, %xmm13 #1187.1257 shufps $136, %xmm13, %xmm10 #1187.1051 - movdqu 5568+__svml_ssinh_ha_data_internal(%rip), %xmm3 #1180.13 + movdqu 5568+__jsvml_ssinh_ha_data_internal(%rip), %xmm3 #1180.13 addps %xmm5, %xmm10 #1189.15 pcmpgtd %xmm6, %xmm3 #1180.13 andps %xmm3, %xmm8 #1185.16 @@ -1172,30 +1172,30 @@ __svml_sinhf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #1197.540 lea 128(%rsp,%r12,4), %rsi #1197.540 -..___tag_value___svml_sinhf4_ha_ex.130: -# __svml_ssinh_ha_cout_rare_internal(const float *, float *) - call __svml_ssinh_ha_cout_rare_internal #1197.540 -..___tag_value___svml_sinhf4_ha_ex.131: +..___tag_value___jsvml_sinhf4_ha_ex.130: +# __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) + call __jsvml_ssinh_ha_cout_rare_internal #1197.540 +..___tag_value___jsvml_sinhf4_ha_ex.131: jmp ..B6.8 # Prob 100% #1197.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_sinhf4_ha_ex,@function - .size __svml_sinhf4_ha_ex,.-__svml_sinhf4_ha_ex -..LN__svml_sinhf4_ha_ex.5: + .type __jsvml_sinhf4_ha_ex,@function + .size __jsvml_sinhf4_ha_ex,.-__jsvml_sinhf4_ha_ex +..LN__jsvml_sinhf4_ha_ex.5: .data -# -- End __svml_sinhf4_ha_ex +# -- End __jsvml_sinhf4_ha_ex .text -.L_2__routine_start___svml_ssinh_ha_cout_rare_internal_6: -# -- Begin __svml_ssinh_ha_cout_rare_internal +.L_2__routine_start___jsvml_ssinh_ha_cout_rare_internal_6: +# -- Begin __jsvml_ssinh_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_ssinh_ha_cout_rare_internal - .globl __svml_ssinh_ha_cout_rare_internal -# --- __svml_ssinh_ha_cout_rare_internal(const float *, float *) -__svml_ssinh_ha_cout_rare_internal: + .hidden __jsvml_ssinh_ha_cout_rare_internal + .globl __jsvml_ssinh_ha_cout_rare_internal +# --- __jsvml_ssinh_ha_cout_rare_internal(const float *, float *) +__jsvml_ssinh_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1205,7 +1205,7 @@ __svml_ssinh_ha_cout_rare_internal: .byte 30 #902.11 .byte 250 #902.11 .cfi_startproc -..___tag_value___svml_ssinh_ha_cout_rare_internal.133: +..___tag_value___jsvml_ssinh_ha_cout_rare_internal.133: ..L134: #754.1 movq %rsi, %r9 #754.1 @@ -1630,17 +1630,17 @@ __svml_ssinh_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_ssinh_ha_cout_rare_internal,@function - .size __svml_ssinh_ha_cout_rare_internal,.-__svml_ssinh_ha_cout_rare_internal -..LN__svml_ssinh_ha_cout_rare_internal.6: + .type __jsvml_ssinh_ha_cout_rare_internal,@function + .size __jsvml_ssinh_ha_cout_rare_internal,.-__jsvml_ssinh_ha_cout_rare_internal +..LN__jsvml_ssinh_ha_cout_rare_internal.6: .data -# -- End __svml_ssinh_ha_cout_rare_internal +# -- End __jsvml_ssinh_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_ssinh_ha_data_internal - .globl __svml_ssinh_ha_data_internal -__svml_ssinh_ha_data_internal: + .hidden __jsvml_ssinh_ha_data_internal + .globl __jsvml_ssinh_ha_data_internal +__jsvml_ssinh_ha_data_internal: .long 1056964608 .long 1057148295 .long 1057336003 @@ -3049,8 +3049,8 @@ __svml_ssinh_ha_data_internal: .long 32 .long 32 .long 32 - .type __svml_ssinh_ha_data_internal,@object - .size __svml_ssinh_ha_data_internal,5632 + .type __jsvml_ssinh_ha_data_internal,@object + .size __jsvml_ssinh_ha_data_internal,5632 .align 32 _vmldSinhHATab: .long 0 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_tan_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_tan_linux_x86.S similarity index 95% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_tan_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_tan_linux_x86.S index f96bf68140d..638c2ebc2db 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_tan_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_tan_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_tan.c" .text ..TXTST0: -.L_2__routine_start___svml_tanf4_ha_ex_0: -# -- Begin __svml_tanf4_ha_ex +.L_2__routine_start___jsvml_tanf4_ha_ex_0: +# -- Begin __jsvml_tanf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_tanf4_ha_ex -# --- __svml_tanf4_ha_ex(__m128) -__svml_tanf4_ha_ex: + .globl __jsvml_tanf4_ha_ex +# --- __jsvml_tanf4_ha_ex(__m128) +__jsvml_tanf4_ha_ex: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_tanf4_ha_ex: .byte 30 #2395.22 .byte 250 #2395.22 .cfi_startproc -..___tag_value___svml_tanf4_ha_ex.1: +..___tag_value___jsvml_tanf4_ha_ex.1: ..L2: #1964.1 pushq %rbp #1964.1 @@ -58,26 +58,26 @@ __svml_tanf4_ha_ex: andq $-64, %rsp #1964.1 subq $256, %rsp #1964.1 xorl %eax, %eax #2008.9 - movups 960+__svml_stan_ha_data_internal(%rip), %xmm10 #2009.53 + movups 960+__jsvml_stan_ha_data_internal(%rip), %xmm10 #2009.53 pxor %xmm14, %xmm14 #2024.23 movaps %xmm10, %xmm15 #2010.20 andnps %xmm0, %xmm10 #2011.21 andps %xmm0, %xmm15 #2010.20 - movups 832+__svml_stan_ha_data_internal(%rip), %xmm12 #2017.51 + movups 832+__jsvml_stan_ha_data_internal(%rip), %xmm12 #2017.51 movaps %xmm15, %xmm11 #2016.83 cvtps2pd %xmm15, %xmm9 #2016.26 movhlps %xmm15, %xmm11 #2016.83 movaps %xmm15, %xmm3 #2013.34 mulps %xmm12, %xmm15 #2019.29 cvtps2pd %xmm11, %xmm7 #2016.69 - cmpnleps 1216+__svml_stan_ha_data_internal(%rip), %xmm3 #2013.34 - movups 1088+__svml_stan_ha_data_internal(%rip), %xmm13 #2018.54 - movups 1280+__svml_stan_ha_data_internal(%rip), %xmm1 #2028.52 + cmpnleps 1216+__jsvml_stan_ha_data_internal(%rip), %xmm3 #2013.34 + movups 1088+__jsvml_stan_ha_data_internal(%rip), %xmm13 #2018.54 + movups 1280+__jsvml_stan_ha_data_internal(%rip), %xmm1 #2028.52 addps %xmm13, %xmm15 #2019.17 movmskps %xmm3, %edx #2015.86 movaps %xmm15, %xmm8 #2020.38 movaps %xmm1, %xmm2 #2029.43 - movups 1344+__svml_stan_ha_data_internal(%rip), %xmm11 #2030.52 + movups 1344+__jsvml_stan_ha_data_internal(%rip), %xmm11 #2030.52 pslld $31, %xmm8 #2020.38 pcmpeqd %xmm8, %xmm14 #2024.23 pxor %xmm10, %xmm8 #2045.20 @@ -98,11 +98,11 @@ __svml_tanf4_ha_ex: movaps %xmm7, %xmm4 #2032.63 mulpd %xmm9, %xmm1 #2032.20 mulpd %xmm7, %xmm4 #2032.63 - movups 1664+__svml_stan_ha_data_internal(%rip), %xmm15 #2036.51 + movups 1664+__jsvml_stan_ha_data_internal(%rip), %xmm15 #2036.51 movaps %xmm15, %xmm11 #2038.31 mulpd %xmm1, %xmm11 #2038.31 mulpd %xmm4, %xmm15 #2038.99 - movups 1472+__svml_stan_ha_data_internal(%rip), %xmm13 #2033.51 + movups 1472+__jsvml_stan_ha_data_internal(%rip), %xmm13 #2033.51 pshufd $250, %xmm14, %xmm5 #2025.105 movaps %xmm13, %xmm14 #2034.19 mulpd %xmm9, %xmm14 #2034.19 @@ -111,13 +111,13 @@ __svml_tanf4_ha_ex: mulpd %xmm4, %xmm13 #2035.97 addpd %xmm14, %xmm9 #2035.19 addpd %xmm13, %xmm7 #2035.85 - movups 1600+__svml_stan_ha_data_internal(%rip), %xmm2 #2037.51 + movups 1600+__jsvml_stan_ha_data_internal(%rip), %xmm2 #2037.51 movdqa %xmm6, %xmm14 #2041.32 addpd %xmm2, %xmm11 #2038.19 addpd %xmm15, %xmm2 #2038.87 mulpd %xmm11, %xmm1 #2040.31 mulpd %xmm2, %xmm4 #2040.98 - movups 1536+__svml_stan_ha_data_internal(%rip), %xmm12 #2039.51 + movups 1536+__jsvml_stan_ha_data_internal(%rip), %xmm12 #2039.51 movdqa %xmm5, %xmm15 #2041.135 addpd %xmm12, %xmm1 #2040.19 movaps %xmm12, %xmm2 #2040.86 @@ -205,10 +205,10 @@ __svml_tanf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #2398.540 lea 128(%rsp,%r12,4), %rsi #2398.540 -..___tag_value___svml_tanf4_ha_ex.19: -# __svml_stan_ha_cout_rare_internal(const float *, float *) - call __svml_stan_ha_cout_rare_internal #2398.540 -..___tag_value___svml_tanf4_ha_ex.20: +..___tag_value___jsvml_tanf4_ha_ex.19: +# __jsvml_stan_ha_cout_rare_internal(const float *, float *) + call __jsvml_stan_ha_cout_rare_internal #2398.540 +..___tag_value___jsvml_tanf4_ha_ex.20: jmp ..B1.9 # Prob 100% #2398.540 .cfi_restore 12 .cfi_restore 13 @@ -221,7 +221,7 @@ __svml_tanf4_ha_ex: movaps %xmm0, %xmm13 #2124.29 movups %xmm2, 80(%rsp) #[spill] movaps %xmm0, %xmm2 #2118.25 - lea __svml_stan_ha_reduction_data_internal(%rip), %r9 #2213.803 + lea __jsvml_stan_ha_reduction_data_internal(%rip), %r9 #2213.803 movl $8388607, %r10d #2219.21 movd %eax, %xmm15 #2117.49 movd %edx, %xmm3 #2123.50 @@ -507,7 +507,7 @@ __svml_tanf4_ha_ex: andps %xmm4, %xmm11 #2339.9 orps %xmm0, %xmm13 #2338.9 pshufd $0, %xmm8, %xmm4 #2288.15 - lea 1764+__svml_stan_ha_data_internal(%rip), %rdi #2344.817 + lea 1764+__jsvml_stan_ha_data_internal(%rip), %rdi #2344.817 pand %xmm4, %xmm5 #2289.13 pand %xmm12, %xmm5 #2343.29 movaps %xmm5, %xmm14 #2344.252 @@ -604,7 +604,7 @@ __svml_tanf4_ha_ex: andps %xmm15, %xmm6 #2364.32 mulps %xmm6, %xmm3 #2366.47 punpcklqdq %xmm1, %xmm2 #2353.1473 - movups 1152+__svml_stan_ha_data_internal(%rip), %xmm1 #2366.26 + movups 1152+__jsvml_stan_ha_data_internal(%rip), %xmm1 #2366.26 shufps $136, %xmm2, %xmm7 #2353.1267 subps %xmm3, %xmm1 #2366.26 movups %xmm1, 16(%rsp) #2366.26[spill] @@ -670,20 +670,20 @@ __svml_tanf4_ha_ex: # LOE rbx r12 r13 r14 r15 eax xmm0 xmm2 .cfi_endproc # mark_end; - .type __svml_tanf4_ha_ex,@function - .size __svml_tanf4_ha_ex,.-__svml_tanf4_ha_ex -..LN__svml_tanf4_ha_ex.0: + .type __jsvml_tanf4_ha_ex,@function + .size __jsvml_tanf4_ha_ex,.-__jsvml_tanf4_ha_ex +..LN__jsvml_tanf4_ha_ex.0: .data -# -- End __svml_tanf4_ha_ex +# -- End __jsvml_tanf4_ha_ex .text -.L_2__routine_start___svml_tanf4_ha_e9_1: -# -- Begin __svml_tanf4_ha_e9 +.L_2__routine_start___jsvml_tanf4_ha_e9_1: +# -- Begin __jsvml_tanf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanf4_ha_e9 -# --- __svml_tanf4_ha_e9(__m128) -__svml_tanf4_ha_e9: + .globl __jsvml_tanf4_ha_e9 +# --- __jsvml_tanf4_ha_e9(__m128) +__jsvml_tanf4_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -692,7 +692,7 @@ __svml_tanf4_ha_e9: .byte 30 #2869.22 .byte 250 #2869.22 .cfi_startproc -..___tag_value___svml_tanf4_ha_e9.54: +..___tag_value___jsvml_tanf4_ha_e9.54: ..L55: #2438.1 pushq %rbp #2438.1 @@ -703,15 +703,15 @@ __svml_tanf4_ha_e9: andq $-64, %rsp #2438.1 subq $192, %rsp #2438.1 vmovaps %xmm0, %xmm5 #2438.1 - vmovups 960+__svml_stan_ha_data_internal(%rip), %xmm4 #2483.53 + vmovups 960+__jsvml_stan_ha_data_internal(%rip), %xmm4 #2483.53 xorl %eax, %eax #2482.9 vandps %xmm4, %xmm5, %xmm6 #2484.20 vandnps %xmm5, %xmm4, %xmm3 #2485.21 - vmulps 832+__svml_stan_ha_data_internal(%rip), %xmm6, %xmm7 #2493.29 + vmulps 832+__jsvml_stan_ha_data_internal(%rip), %xmm6, %xmm7 #2493.29 vpxor %xmm10, %xmm10, %xmm10 #2498.29 - vcmpnleps 1216+__svml_stan_ha_data_internal(%rip), %xmm6, %xmm4 #2487.34 + vcmpnleps 1216+__jsvml_stan_ha_data_internal(%rip), %xmm6, %xmm4 #2487.34 vcvtps2pd %xmm6, %ymm2 #2490.26 - vmovups 1088+__svml_stan_ha_data_internal(%rip), %xmm9 #2492.54 + vmovups 1088+__jsvml_stan_ha_data_internal(%rip), %xmm9 #2492.54 vmovmskps %xmm4, %edx #2489.86 vaddps %xmm7, %xmm9, %xmm8 #2493.17 vpslld $31, %xmm8, %xmm1 #2494.38 @@ -721,19 +721,19 @@ __svml_tanf4_ha_e9: vpshufd $80, %xmm12, %xmm11 #2499.29 vxorps %xmm3, %xmm1, %xmm1 #2519.20 vpshufd $250, %xmm12, %xmm13 #2499.111 - vmulpd 1280+__svml_stan_ha_data_internal(%rip), %ymm6, %ymm15 #2503.42 - vmulpd 1344+__svml_stan_ha_data_internal(%rip), %ymm6, %ymm7 #2505.39 + vmulpd 1280+__jsvml_stan_ha_data_internal(%rip), %ymm6, %ymm15 #2503.42 + vmulpd 1344+__jsvml_stan_ha_data_internal(%rip), %ymm6, %ymm7 #2505.39 vsubpd %ymm15, %ymm2, %ymm2 #2503.17 vsubpd %ymm7, %ymm2, %ymm9 #2505.17 vmulpd %ymm9, %ymm9, %ymm12 #2506.18 - vmulpd 1472+__svml_stan_ha_data_internal(%rip), %ymm9, %ymm8 #2508.17 + vmulpd 1472+__jsvml_stan_ha_data_internal(%rip), %ymm9, %ymm8 #2508.17 vmulpd %ymm8, %ymm12, %ymm10 #2509.32 vaddpd %ymm10, %ymm9, %ymm15 #2509.17 vinsertf128 $1, %xmm13, %ymm11, %ymm0 #2500.23 - vmulpd 1664+__svml_stan_ha_data_internal(%rip), %ymm12, %ymm11 #2512.32 - vaddpd 1600+__svml_stan_ha_data_internal(%rip), %ymm11, %ymm13 #2512.17 + vmulpd 1664+__jsvml_stan_ha_data_internal(%rip), %ymm12, %ymm11 #2512.32 + vaddpd 1600+__jsvml_stan_ha_data_internal(%rip), %ymm11, %ymm13 #2512.17 vmulpd %ymm13, %ymm12, %ymm14 #2514.32 - vaddpd 1536+__svml_stan_ha_data_internal(%rip), %ymm14, %ymm2 #2514.17 + vaddpd 1536+__jsvml_stan_ha_data_internal(%rip), %ymm14, %ymm2 #2514.17 vblendvpd %ymm0, %ymm15, %ymm2, %ymm6 #2515.19 vblendvpd %ymm0, %ymm2, %ymm15, %ymm0 #2516.19 vdivpd %ymm0, %ymm6, %ymm0 #2517.19 @@ -808,10 +808,10 @@ __svml_tanf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #2872.540 lea 128(%rsp,%r12,4), %rsi #2872.540 -..___tag_value___svml_tanf4_ha_e9.72: -# __svml_stan_ha_cout_rare_internal(const float *, float *) - call __svml_stan_ha_cout_rare_internal #2872.540 -..___tag_value___svml_tanf4_ha_e9.73: +..___tag_value___jsvml_tanf4_ha_e9.72: +# __jsvml_stan_ha_cout_rare_internal(const float *, float *) + call __jsvml_stan_ha_cout_rare_internal #2872.540 +..___tag_value___jsvml_tanf4_ha_e9.73: jmp ..B2.9 # Prob 100% #2872.540 .cfi_restore 12 .cfi_restore 13 @@ -821,7 +821,7 @@ __svml_tanf4_ha_e9: vmovups .L_2il0floatpacket.27(%rip), %xmm0 #2591.31 movl $2139095040, %edx #2684.24 vandps %xmm0, %xmm5, %xmm12 #2592.25 - lea __svml_stan_ha_reduction_data_internal(%rip), %r9 #2687.752 + lea __jsvml_stan_ha_reduction_data_internal(%rip), %r9 #2687.752 vcmpeqps %xmm0, %xmm12, %xmm12 #2594.35 vmovups .L_2il0floatpacket.28(%rip), %xmm7 #2597.32 movl $8388607, %r10d #2693.27 @@ -952,7 +952,7 @@ __svml_tanf4_ha_e9: vsubps %xmm4, %xmm8, %xmm8 #2760.17 vsubps %xmm1, %xmm7, %xmm7 #2772.17 vmovd %r9d, %xmm4 #2773.28 - lea 1764+__svml_stan_ha_data_internal(%rip), %r9 #2818.766 + lea 1764+__jsvml_stan_ha_data_internal(%rip), %r9 #2818.766 vpshufd $0, %xmm4, %xmm11 #2773.28 vpxor %xmm11, %xmm3, %xmm9 #2774.26 vmovd %r10d, %xmm3 #2775.26 @@ -1090,7 +1090,7 @@ __svml_tanf4_ha_e9: vrcpps %xmm0, %xmm14 #2837.32 vandps %xmm11, %xmm14, %xmm13 #2838.32 vmulps %xmm13, %xmm0, %xmm0 #2840.47 - vmovups 1152+__svml_stan_ha_data_internal(%rip), %xmm11 #2839.57 + vmovups 1152+__jsvml_stan_ha_data_internal(%rip), %xmm11 #2839.57 vmovups 32(%rsp), %xmm5 #2869.22[spill] vsubps %xmm0, %xmm11, %xmm11 #2840.26 vmulps %xmm11, %xmm13, %xmm0 #2842.40 @@ -1131,20 +1131,20 @@ __svml_tanf4_ha_e9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm5 .cfi_endproc # mark_end; - .type __svml_tanf4_ha_e9,@function - .size __svml_tanf4_ha_e9,.-__svml_tanf4_ha_e9 -..LN__svml_tanf4_ha_e9.1: + .type __jsvml_tanf4_ha_e9,@function + .size __jsvml_tanf4_ha_e9,.-__jsvml_tanf4_ha_e9 +..LN__jsvml_tanf4_ha_e9.1: .data -# -- End __svml_tanf4_ha_e9 +# -- End __jsvml_tanf4_ha_e9 .text -.L_2__routine_start___svml_tanf16_ha_z0_2: -# -- Begin __svml_tanf16_ha_z0 +.L_2__routine_start___jsvml_tanf16_ha_z0_2: +# -- Begin __jsvml_tanf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_tanf16_ha_z0 -# --- __svml_tanf16_ha_z0(__m512) -__svml_tanf16_ha_z0: + .globl __jsvml_tanf16_ha_z0 +# --- __jsvml_tanf16_ha_z0(__m512) +__jsvml_tanf16_ha_z0: # parameter 1: %zmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -1153,7 +1153,7 @@ __svml_tanf16_ha_z0: .byte 30 #3188.18 .byte 250 #3188.18 .cfi_startproc -..___tag_value___svml_tanf16_ha_z0.83: +..___tag_value___jsvml_tanf16_ha_z0.83: ..L84: #2881.1 pushq %rbp #2881.1 @@ -1164,15 +1164,15 @@ __svml_tanf16_ha_z0: andq $-64, %rsp #2881.1 subq $192, %rsp #2881.1 xorl %esi, %esi #2937.5 - vmovups 768+__svml_stan_ha_data_internal(%rip), %zmm9 #2940.61 - vmovups 1088+__svml_stan_ha_data_internal(%rip), %zmm1 #2945.56 - vmovups 64+__svml_stan_ha_data_internal(%rip), %zmm2 #2948.51 - vmovups 256+__svml_stan_ha_data_internal(%rip), %zmm4 #2949.55 - vmovups 320+__svml_stan_ha_data_internal(%rip), %zmm5 #2950.55 + vmovups 768+__jsvml_stan_ha_data_internal(%rip), %zmm9 #2940.61 + vmovups 1088+__jsvml_stan_ha_data_internal(%rip), %zmm1 #2945.56 + vmovups 64+__jsvml_stan_ha_data_internal(%rip), %zmm2 #2948.51 + vmovups 256+__jsvml_stan_ha_data_internal(%rip), %zmm4 #2949.55 + vmovups 320+__jsvml_stan_ha_data_internal(%rip), %zmm5 #2950.55 vmovaps %zmm0, %zmm11 #2881.1 - vandps 960+__svml_stan_ha_data_internal(%rip), %zmm11, %zmm10 #2939.16 + vandps 960+__jsvml_stan_ha_data_internal(%rip), %zmm11, %zmm10 #2939.16 vcmpps $22, {sae}, %zmm9, %zmm10, %k6 #2941.34 - vmovups __svml_stan_ha_data_internal(%rip), %zmm9 #2946.17 + vmovups __jsvml_stan_ha_data_internal(%rip), %zmm9 #2946.17 kmovw %k6, %eax #2942.79 vfmadd213ps {rn-sae}, %zmm1, %zmm11, %zmm9 #2946.17 vsubps {rn-sae}, %zmm1, %zmm9, %zmm8 #2947.19 @@ -1192,14 +1192,14 @@ __svml_tanf16_ha_z0: ..B3.2: # Preds ..B3.17 ..B3.1 # Execution count [1.00e+00] vmulps {rn-sae}, %zmm0, %zmm0, %zmm6 #3193.16 - vmovups 704+__svml_stan_ha_data_internal(%rip), %zmm4 #3194.53 - vmovups 640+__svml_stan_ha_data_internal(%rip), %zmm5 #3195.53 - vmovups 384+__svml_stan_ha_data_internal(%rip), %zmm3 #3191.271 - vmovups 1152+__svml_stan_ha_data_internal(%rip), %zmm14 #3207.47 - vmovups 512+__svml_stan_ha_data_internal(%rip), %zmm2 #3192.275 + vmovups 704+__jsvml_stan_ha_data_internal(%rip), %zmm4 #3194.53 + vmovups 640+__jsvml_stan_ha_data_internal(%rip), %zmm5 #3195.53 + vmovups 384+__jsvml_stan_ha_data_internal(%rip), %zmm3 #3191.271 + vmovups 1152+__jsvml_stan_ha_data_internal(%rip), %zmm14 #3207.47 + vmovups 512+__jsvml_stan_ha_data_internal(%rip), %zmm2 #3192.275 vfmadd231ps {rn-sae}, %zmm6, %zmm4, %zmm5 #3196.20 - vpermt2ps 448+__svml_stan_ha_data_internal(%rip), %zmm9, %zmm3 #3191.271 - vpermt2ps 576+__svml_stan_ha_data_internal(%rip), %zmm9, %zmm2 #3192.275 + vpermt2ps 448+__jsvml_stan_ha_data_internal(%rip), %zmm9, %zmm3 #3191.271 + vpermt2ps 576+__jsvml_stan_ha_data_internal(%rip), %zmm9, %zmm2 #3192.275 vmulps {rn-sae}, %zmm0, %zmm5, %zmm8 #3197.22 vfnmsub213ps {rn-sae}, %zmm1, %zmm6, %zmm8 #3198.20 vsubps {rn-sae}, %zmm8, %zmm0, %zmm1 #3199.19 @@ -1334,10 +1334,10 @@ __svml_tanf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #3223.760 lea 128(%rsp,%rbx,4), %rsi #3223.760 -..___tag_value___svml_tanf16_ha_z0.111: -# __svml_stan_ha_cout_rare_internal(const float *, float *) - call __svml_stan_ha_cout_rare_internal #3223.760 -..___tag_value___svml_tanf16_ha_z0.112: +..___tag_value___jsvml_tanf16_ha_z0.111: +# __jsvml_stan_ha_cout_rare_internal(const float *, float *) + call __jsvml_stan_ha_cout_rare_internal #3223.760 +..___tag_value___jsvml_tanf16_ha_z0.112: jmp ..B3.14 # Prob 100% #3223.760 .cfi_restore 3 .cfi_restore 12 @@ -1346,8 +1346,8 @@ __svml_tanf16_ha_z0: # LOE r15 ebx r12d r13d r14d ..B3.17: # Preds ..B3.1 # Execution count [5.00e-02]: Infreq - vmovups 1024+__svml_stan_ha_data_internal(%rip), %zmm6 #2962.56 - lea __svml_stan_ha_reduction_data_internal(%rip), %rax #3052.328 + vmovups 1024+__jsvml_stan_ha_data_internal(%rip), %zmm6 #2962.56 + lea __jsvml_stan_ha_reduction_data_internal(%rip), %rax #3052.328 vmovups %zmm1, 64(%rsp) #[spill] vmovups %zmm0, (%rsp) #[spill] vandps %zmm10, %zmm6, %zmm8 #2963.17 @@ -1487,20 +1487,20 @@ __svml_tanf16_ha_z0: # LOE rbx r12 r13 r14 r15 esi zmm0 zmm1 zmm9 zmm11 .cfi_endproc # mark_end; - .type __svml_tanf16_ha_z0,@function - .size __svml_tanf16_ha_z0,.-__svml_tanf16_ha_z0 -..LN__svml_tanf16_ha_z0.2: + .type __jsvml_tanf16_ha_z0,@function + .size __jsvml_tanf16_ha_z0,.-__jsvml_tanf16_ha_z0 +..LN__jsvml_tanf16_ha_z0.2: .data -# -- End __svml_tanf16_ha_z0 +# -- End __jsvml_tanf16_ha_z0 .text -.L_2__routine_start___svml_tanf8_ha_e9_3: -# -- Begin __svml_tanf8_ha_e9 +.L_2__routine_start___jsvml_tanf8_ha_e9_3: +# -- Begin __jsvml_tanf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanf8_ha_e9 -# --- __svml_tanf8_ha_e9(__m256) -__svml_tanf8_ha_e9: + .globl __jsvml_tanf8_ha_e9 +# --- __jsvml_tanf8_ha_e9(__m256) +__jsvml_tanf8_ha_e9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -1509,7 +1509,7 @@ __svml_tanf8_ha_e9: .byte 30 #3663.22 .byte 250 #3663.22 .cfi_startproc -..___tag_value___svml_tanf8_ha_e9.122: +..___tag_value___jsvml_tanf8_ha_e9.122: ..L123: #3232.1 pushq %rbp #3232.1 @@ -1521,15 +1521,15 @@ __svml_tanf8_ha_e9: pushq %r12 #3232.1 subq $376, %rsp #3232.1 xorl %eax, %eax #3276.9 - vmovups 960+__svml_stan_ha_data_internal(%rip), %ymm1 #3277.56 + vmovups 960+__jsvml_stan_ha_data_internal(%rip), %ymm1 #3277.56 vandps %ymm1, %ymm0, %ymm10 #3278.20 vandnps %ymm0, %ymm1, %ymm9 #3279.21 - vcmpnle_uqps 1216+__svml_stan_ha_data_internal(%rip), %ymm10, %ymm1 #3281.34 + vcmpnle_uqps 1216+__jsvml_stan_ha_data_internal(%rip), %ymm10, %ymm1 #3281.34 vextractf128 $1, %ymm10, %xmm12 #3284.114 - vmulps 832+__svml_stan_ha_data_internal(%rip), %ymm10, %ymm2 #3287.32 + vmulps 832+__jsvml_stan_ha_data_internal(%rip), %ymm10, %ymm2 #3287.32 vcvtps2pd %xmm12, %ymm13 #3284.97 vcvtps2pd %xmm10, %ymm3 #3284.26 - vmovups 1088+__svml_stan_ha_data_internal(%rip), %ymm12 #3286.57 + vmovups 1088+__jsvml_stan_ha_data_internal(%rip), %ymm12 #3286.57 vaddps %ymm2, %ymm12, %ymm4 #3287.17 vpslld $31, %xmm4, %xmm5 #3288.84 vextractf128 $1, %ymm4, %xmm8 #3288.215 @@ -1541,7 +1541,7 @@ __svml_tanf8_ha_e9: vpshufd $250, %xmm8, %xmm15 #3293.275 vpcmpeqd %xmm12, %xmm5, %xmm4 #3292.29 vinsertf128 $1, %xmm15, %ymm14, %ymm8 #3294.176 - vmovupd 1280+__svml_stan_ha_data_internal(%rip), %ymm15 #3296.55 + vmovupd 1280+__jsvml_stan_ha_data_internal(%rip), %ymm15 #3296.55 vpshufd $80, %xmm4, %xmm2 #3293.29 vinsertf128 $1, %xmm7, %ymm5, %ymm10 #3288.20 vpshufd $250, %xmm4, %xmm5 #3293.111 @@ -1554,27 +1554,27 @@ __svml_tanf8_ha_e9: vsubpd %ymm4, %ymm3, %ymm2 #3297.19 vmulpd %ymm15, %ymm5, %ymm3 #3297.121 vsubpd %ymm3, %ymm13, %ymm6 #3297.94 - vmovupd 1344+__svml_stan_ha_data_internal(%rip), %ymm3 #3298.55 + vmovupd 1344+__jsvml_stan_ha_data_internal(%rip), %ymm3 #3298.55 vmulpd %ymm3, %ymm14, %ymm13 #3299.43 vsubpd %ymm13, %ymm2, %ymm4 #3299.19 vmulpd %ymm3, %ymm5, %ymm2 #3299.115 - vmovupd 1472+__svml_stan_ha_data_internal(%rip), %ymm5 #3301.54 + vmovupd 1472+__jsvml_stan_ha_data_internal(%rip), %ymm5 #3301.54 vmulpd %ymm4, %ymm4, %ymm14 #3300.20 - vmovupd 1600+__svml_stan_ha_data_internal(%rip), %ymm3 #3305.54 + vmovupd 1600+__jsvml_stan_ha_data_internal(%rip), %ymm3 #3305.54 vsubpd %ymm2, %ymm6, %ymm15 #3299.91 vmulpd %ymm4, %ymm5, %ymm6 #3302.19 vmulpd %ymm15, %ymm15, %ymm2 #3300.66 vmulpd %ymm15, %ymm5, %ymm5 #3302.65 vmulpd %ymm6, %ymm14, %ymm13 #3303.34 vaddpd %ymm13, %ymm4, %ymm6 #3303.19 - vmovupd 1664+__svml_stan_ha_data_internal(%rip), %ymm13 #3304.54 + vmovupd 1664+__jsvml_stan_ha_data_internal(%rip), %ymm13 #3304.54 vmulpd %ymm5, %ymm2, %ymm4 #3303.106 vaddpd %ymm4, %ymm15, %ymm5 #3303.91 vmulpd %ymm14, %ymm13, %ymm15 #3306.34 vmulpd %ymm2, %ymm13, %ymm4 #3306.108 vaddpd %ymm15, %ymm3, %ymm15 #3306.19 vaddpd %ymm4, %ymm3, %ymm3 #3306.93 - vmovupd 1536+__svml_stan_ha_data_internal(%rip), %ymm4 #3307.54 + vmovupd 1536+__jsvml_stan_ha_data_internal(%rip), %ymm4 #3307.54 vmulpd %ymm15, %ymm14, %ymm14 #3308.34 vmulpd %ymm3, %ymm2, %ymm2 #3308.107 vaddpd %ymm14, %ymm4, %ymm14 #3308.19 @@ -1658,10 +1658,10 @@ __svml_tanf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #3666.546 lea 128(%rsp,%r12,4), %rsi #3666.546 -..___tag_value___svml_tanf8_ha_e9.138: -# __svml_stan_ha_cout_rare_internal(const float *, float *) - call __svml_stan_ha_cout_rare_internal #3666.546 -..___tag_value___svml_tanf8_ha_e9.139: +..___tag_value___jsvml_tanf8_ha_e9.138: +# __jsvml_stan_ha_cout_rare_internal(const float *, float *) + call __jsvml_stan_ha_cout_rare_internal #3666.546 +..___tag_value___jsvml_tanf8_ha_e9.139: jmp ..B4.9 # Prob 100% #3666.546 .cfi_restore 13 # LOE rbx r14 r15 r12d r13d @@ -1674,7 +1674,7 @@ __svml_tanf8_ha_e9: vmovups %ymm0, 32(%rsp) #[spill] vmovups %ymm1, 64(%rsp) #[spill] vandps %ymm4, %ymm0, %ymm13 #3386.25 - lea __svml_stan_ha_reduction_data_internal(%rip), %rdx #3481.1256 + lea __jsvml_stan_ha_reduction_data_internal(%rip), %rdx #3481.1256 vcmpeqps %ymm4, %ymm13, %ymm9 #3388.35 vandps %ymm6, %ymm0, %ymm7 #3392.29 vmovups %ymm7, (%rsp) #3392.29[spill] @@ -1952,7 +1952,7 @@ __svml_tanf8_ha_e9: vaddps %ymm11, %ymm12, %ymm1 #3595.17 vmovd %r10d, %xmm11 #3610.47 vaddps %ymm1, %ymm13, %ymm7 #3596.17 - lea 1764+__svml_stan_ha_data_internal(%rip), %r10 #3612.1264 + lea 1764+__jsvml_stan_ha_data_internal(%rip), %r10 #3612.1264 vandps .L_2il0floatpacket.62(%rip), %ymm6, %ymm2 #3601.11 vsubps %ymm7, %ymm13, %ymm13 #3597.20 vcmpgt_oqps %ymm3, %ymm2, %ymm14 #3602.17 @@ -2150,7 +2150,7 @@ __svml_tanf8_ha_e9: vsubps %ymm2, %ymm14, %ymm14 #3628.30 vmulps %ymm6, %ymm12, %ymm6 #3654.41 vaddps %ymm14, %ymm15, %ymm15 #3629.30 - vmovups 1152+__svml_stan_ha_data_internal(%rip), %ymm14 #3633.60 + vmovups 1152+__jsvml_stan_ha_data_internal(%rip), %ymm14 #3633.60 vaddps %ymm15, %ymm11, %ymm15 #3630.28 vaddps %ymm6, %ymm4, %ymm4 #3654.26 vrcpps %ymm2, %ymm11 #3631.32 @@ -2198,20 +2198,20 @@ __svml_tanf8_ha_e9: # LOE rbx r13 r14 r15 eax ymm0 ymm4 .cfi_endproc # mark_end; - .type __svml_tanf8_ha_e9,@function - .size __svml_tanf8_ha_e9,.-__svml_tanf8_ha_e9 -..LN__svml_tanf8_ha_e9.3: + .type __jsvml_tanf8_ha_e9,@function + .size __jsvml_tanf8_ha_e9,.-__jsvml_tanf8_ha_e9 +..LN__jsvml_tanf8_ha_e9.3: .data -# -- End __svml_tanf8_ha_e9 +# -- End __jsvml_tanf8_ha_e9 .text -.L_2__routine_start___svml_tanf4_ha_l9_4: -# -- Begin __svml_tanf4_ha_l9 +.L_2__routine_start___jsvml_tanf4_ha_l9_4: +# -- Begin __jsvml_tanf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanf4_ha_l9 -# --- __svml_tanf4_ha_l9(__m128) -__svml_tanf4_ha_l9: + .globl __jsvml_tanf4_ha_l9 +# --- __jsvml_tanf4_ha_l9(__m128) +__jsvml_tanf4_ha_l9: # parameter 1: %xmm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -2220,7 +2220,7 @@ __svml_tanf4_ha_l9: .byte 30 #3990.18 .byte 250 #3990.18 .cfi_startproc -..___tag_value___svml_tanf4_ha_l9.178: +..___tag_value___jsvml_tanf4_ha_l9.178: ..L179: #3675.1 pushq %rbp #3675.1 @@ -2231,15 +2231,15 @@ __svml_tanf4_ha_l9: andq $-64, %rsp #3675.1 subq $192, %rsp #3675.1 vmovaps %xmm0, %xmm14 #3675.1 - vmovups 1088+__svml_stan_ha_data_internal(%rip), %xmm3 #3743.54 + vmovups 1088+__jsvml_stan_ha_data_internal(%rip), %xmm3 #3743.54 xorl %eax, %eax #3731.5 - vmovups __svml_stan_ha_data_internal(%rip), %xmm1 #3744.17 + vmovups __jsvml_stan_ha_data_internal(%rip), %xmm1 #3744.17 vfmadd213ps %xmm3, %xmm14, %xmm1 #3744.17 - vmovups 64+__svml_stan_ha_data_internal(%rip), %xmm2 #3746.49 - vmovups 256+__svml_stan_ha_data_internal(%rip), %xmm5 #3747.53 - vmovups 320+__svml_stan_ha_data_internal(%rip), %xmm6 #3748.53 - vandps 960+__svml_stan_ha_data_internal(%rip), %xmm14, %xmm10 #3733.16 - vcmpnleps 768+__svml_stan_ha_data_internal(%rip), %xmm10, %xmm0 #3737.34 + vmovups 64+__jsvml_stan_ha_data_internal(%rip), %xmm2 #3746.49 + vmovups 256+__jsvml_stan_ha_data_internal(%rip), %xmm5 #3747.53 + vmovups 320+__jsvml_stan_ha_data_internal(%rip), %xmm6 #3748.53 + vandps 960+__jsvml_stan_ha_data_internal(%rip), %xmm14, %xmm10 #3733.16 + vcmpnleps 768+__jsvml_stan_ha_data_internal(%rip), %xmm10, %xmm0 #3737.34 vsubps %xmm3, %xmm1, %xmm9 #3745.17 vmovmskps %xmm0, %edx #3739.82 vfnmadd213ps %xmm14, %xmm9, %xmm2 #3749.18 @@ -2258,7 +2258,7 @@ __svml_tanf4_ha_l9: ..B5.2: # Preds ..B5.12 ..B5.1 # Execution count [1.00e+00] vpslld $2, %xmm1, %xmm7 #3992.216 - lea 512+__svml_stan_ha_data_internal(%rip), %r8 #3993.72 + lea 512+__jsvml_stan_ha_data_internal(%rip), %r8 #3993.72 vpand .L_2il0floatpacket.77(%rip), %xmm7, %xmm8 #3992.265 vmovd %xmm8, %edx #3993.179 vpextrd $1, %xmm8, %ecx #3993.322 @@ -2270,10 +2270,10 @@ __svml_tanf4_ha_l9: vmovd -128(%rcx,%r8), %xmm10 #3993.215 vpunpcklqdq %xmm10, %xmm9, %xmm13 #3993.52 vmulps %xmm3, %xmm3, %xmm10 #3995.14 - vmovups 704+__svml_stan_ha_data_internal(%rip), %xmm9 #3996.51 + vmovups 704+__jsvml_stan_ha_data_internal(%rip), %xmm9 #3996.51 movslq %esi, %rsi #3993.489 movslq %edi, %rdi #3993.635 - vfmadd213ps 640+__svml_stan_ha_data_internal(%rip), %xmm10, %xmm9 #3998.20 + vfmadd213ps 640+__jsvml_stan_ha_data_internal(%rip), %xmm10, %xmm9 #3998.20 vmovd (%rdx,%r8), %xmm5 #3994.76 vmovd -128(%rsi,%r8), %xmm11 #3993.382 vmovd -128(%rdi,%r8), %xmm12 #3993.528 @@ -2296,7 +2296,7 @@ __svml_tanf4_ha_l9: vaddps %xmm4, %xmm6, %xmm3 #4004.21 vsubps %xmm6, %xmm3, %xmm12 #4005.20 vsubps %xmm12, %xmm4, %xmm13 #4006.20 - vmovups 1152+__svml_stan_ha_data_internal(%rip), %xmm12 #4009.45 + vmovups 1152+__jsvml_stan_ha_data_internal(%rip), %xmm12 #4009.45 vsubps %xmm7, %xmm12, %xmm1 #4011.23 vaddps %xmm13, %xmm5, %xmm15 #4007.20 vsubps %xmm12, %xmm1, %xmm8 #4013.19 @@ -2369,10 +2369,10 @@ __svml_tanf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #4028.540 lea 128(%rsp,%r12,4), %rsi #4028.540 -..___tag_value___svml_tanf4_ha_l9.196: -# __svml_stan_ha_cout_rare_internal(const float *, float *) - call __svml_stan_ha_cout_rare_internal #4028.540 -..___tag_value___svml_tanf4_ha_l9.197: +..___tag_value___jsvml_tanf4_ha_l9.196: +# __jsvml_stan_ha_cout_rare_internal(const float *, float *) + call __jsvml_stan_ha_cout_rare_internal #4028.540 +..___tag_value___jsvml_tanf4_ha_l9.197: jmp ..B5.9 # Prob 100% #4028.540 .cfi_restore 12 .cfi_restore 13 @@ -2380,10 +2380,10 @@ __svml_tanf4_ha_l9: ..B5.12: # Preds ..B5.1 # Execution count [5.00e-02]: Infreq vpand .L_2il0floatpacket.27(%rip), %xmm14, %xmm11 #3852.18 - lea __svml_stan_ha_reduction_data_internal(%rip), %r8 #3854.708 + lea __jsvml_stan_ha_reduction_data_internal(%rip), %r8 #3854.708 vmovups %xmm3, 16(%rsp) #[spill] vpsrld $23, %xmm11, %xmm3 #3853.18 - vmovups 1024+__svml_stan_ha_data_internal(%rip), %xmm7 #3760.54 + vmovups 1024+__jsvml_stan_ha_data_internal(%rip), %xmm7 #3760.54 vmovups %xmm1, (%rsp) #[spill] vpslld $1, %xmm3, %xmm1 #3854.234 vandps %xmm10, %xmm7, %xmm8 #3761.17 @@ -2533,20 +2533,20 @@ __svml_tanf4_ha_l9: # LOE rbx r12 r13 r14 r15 eax xmm1 xmm2 xmm3 xmm14 .cfi_endproc # mark_end; - .type __svml_tanf4_ha_l9,@function - .size __svml_tanf4_ha_l9,.-__svml_tanf4_ha_l9 -..LN__svml_tanf4_ha_l9.4: + .type __jsvml_tanf4_ha_l9,@function + .size __jsvml_tanf4_ha_l9,.-__jsvml_tanf4_ha_l9 +..LN__jsvml_tanf4_ha_l9.4: .data -# -- End __svml_tanf4_ha_l9 +# -- End __jsvml_tanf4_ha_l9 .text -.L_2__routine_start___svml_tanf8_ha_l9_5: -# -- Begin __svml_tanf8_ha_l9 +.L_2__routine_start___jsvml_tanf8_ha_l9_5: +# -- Begin __jsvml_tanf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanf8_ha_l9 -# --- __svml_tanf8_ha_l9(__m256) -__svml_tanf8_ha_l9: + .globl __jsvml_tanf8_ha_l9 +# --- __jsvml_tanf8_ha_l9(__m256) +__jsvml_tanf8_ha_l9: # parameter 1: %ymm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -2555,7 +2555,7 @@ __svml_tanf8_ha_l9: .byte 30 #4352.18 .byte 250 #4352.18 .cfi_startproc -..___tag_value___svml_tanf8_ha_l9.207: +..___tag_value___jsvml_tanf8_ha_l9.207: ..L208: #4037.1 pushq %rbp #4037.1 @@ -2568,11 +2568,11 @@ __svml_tanf8_ha_l9: subq $184, %rsp #4037.1 xorl %eax, %eax #4093.5 vmovaps %ymm0, %ymm14 #4037.1 - vmovups 1088+__svml_stan_ha_data_internal(%rip), %ymm2 #4105.57 - vmovups __svml_stan_ha_data_internal(%rip), %ymm0 #4106.17 - vmovups 64+__svml_stan_ha_data_internal(%rip), %ymm1 #4108.52 - vmovups 256+__svml_stan_ha_data_internal(%rip), %ymm4 #4109.56 - vmovups 320+__svml_stan_ha_data_internal(%rip), %ymm5 #4110.56 + vmovups 1088+__jsvml_stan_ha_data_internal(%rip), %ymm2 #4105.57 + vmovups __jsvml_stan_ha_data_internal(%rip), %ymm0 #4106.17 + vmovups 64+__jsvml_stan_ha_data_internal(%rip), %ymm1 #4108.52 + vmovups 256+__jsvml_stan_ha_data_internal(%rip), %ymm4 #4109.56 + vmovups 320+__jsvml_stan_ha_data_internal(%rip), %ymm5 #4110.56 vfmadd213ps %ymm2, %ymm14, %ymm0 #4106.17 vsubps %ymm2, %ymm0, %ymm8 #4107.17 vfnmadd213ps %ymm14, %ymm8, %ymm1 #4111.18 @@ -2584,8 +2584,8 @@ __svml_tanf8_ha_l9: vsubps %ymm3, %ymm2, %ymm6 #4115.23 vfnmadd231ps %ymm8, %ymm4, %ymm7 #4116.22 vfmadd213ps %ymm6, %ymm5, %ymm8 #4117.23 - vandps 960+__svml_stan_ha_data_internal(%rip), %ymm14, %ymm9 #4095.16 - vcmpnle_uqps 768+__svml_stan_ha_data_internal(%rip), %ymm9, %ymm13 #4099.34 + vandps 960+__jsvml_stan_ha_data_internal(%rip), %ymm14, %ymm9 #4095.16 + vcmpnle_uqps 768+__jsvml_stan_ha_data_internal(%rip), %ymm9, %ymm13 #4099.34 vsubps %ymm8, %ymm7, %ymm1 #4118.22 vmovmskps %ymm13, %edx #4101.83 testl %edx, %edx #4120.66 @@ -2595,7 +2595,7 @@ __svml_tanf8_ha_l9: ..B6.2: # Preds ..B6.12 ..B6.1 # Execution count [1.00e+00] vpslld $2, %ymm0, %ymm7 #4354.222 - lea 512+__svml_stan_ha_data_internal(%rip), %r11 #4355.118 + lea 512+__jsvml_stan_ha_data_internal(%rip), %r11 #4355.118 vpand .L_2il0floatpacket.93(%rip), %ymm7, %ymm8 #4354.274 vextractf128 $1, %ymm8, %xmm3 #4355.1022 vmovd %xmm8, %r10d #4355.225 @@ -2642,15 +2642,15 @@ __svml_tanf8_ha_l9: vpunpcklqdq %xmm5, %xmm15, %xmm0 #4356.468 vshufps $136, %xmm0, %xmm3, %xmm4 #4356.82 vmulps %ymm2, %ymm2, %ymm15 #4357.14 - vmovups 704+__svml_stan_ha_data_internal(%rip), %ymm3 #4358.54 + vmovups 704+__jsvml_stan_ha_data_internal(%rip), %ymm3 #4358.54 vpunpcklqdq %xmm8, %xmm7, %xmm11 #4356.880 vshufps $136, %xmm12, %xmm11, %xmm13 #4356.860 - vfmadd213ps 640+__svml_stan_ha_data_internal(%rip), %ymm15, %ymm3 #4360.20 + vfmadd213ps 640+__jsvml_stan_ha_data_internal(%rip), %ymm15, %ymm3 #4360.20 vmulps %ymm3, %ymm2, %ymm0 #4361.20 vfnmsub213ps %ymm1, %ymm15, %ymm0 #4362.20 vinsertf128 $1, %xmm13, %ymm4, %ymm5 #4356.18 vsubps %ymm0, %ymm2, %ymm4 #4363.17 - vmovups 1152+__svml_stan_ha_data_internal(%rip), %ymm13 #4371.48 + vmovups 1152+__jsvml_stan_ha_data_internal(%rip), %ymm13 #4371.48 vmulps %ymm4, %ymm6, %ymm9 #4372.15 vsubps %ymm4, %ymm2, %ymm1 #4364.20 vaddps %ymm4, %ymm6, %ymm3 #4366.21 @@ -2733,20 +2733,20 @@ __svml_tanf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r15,4), %rdi #4390.546 lea 128(%rsp,%r15,4), %rsi #4390.546 -..___tag_value___svml_tanf8_ha_l9.223: -# __svml_stan_ha_cout_rare_internal(const float *, float *) - call __svml_stan_ha_cout_rare_internal #4390.546 -..___tag_value___svml_tanf8_ha_l9.224: +..___tag_value___jsvml_tanf8_ha_l9.223: +# __jsvml_stan_ha_cout_rare_internal(const float *, float *) + call __jsvml_stan_ha_cout_rare_internal #4390.546 +..___tag_value___jsvml_tanf8_ha_l9.224: jmp ..B6.9 # Prob 100% #4390.546 .cfi_restore 12 # LOE rbx r13 r14 r12d r15d ..B6.12: # Preds ..B6.1 # Execution count [5.00e-02]: Infreq vmovups %ymm0, (%rsp) #[spill] - lea __svml_stan_ha_reduction_data_internal(%rip), %r11 #4216.1212 + lea __jsvml_stan_ha_reduction_data_internal(%rip), %r11 #4216.1212 vmovups %ymm1, 64(%rsp) #[spill] vmovups %ymm2, 32(%rsp) #[spill] - vmovups 1024+__svml_stan_ha_data_internal(%rip), %ymm6 #4122.57 + vmovups 1024+__jsvml_stan_ha_data_internal(%rip), %ymm6 #4122.57 vpand .L_2il0floatpacket.78(%rip), %ymm14, %ymm0 #4214.18 vpsrld $23, %ymm0, %ymm1 #4215.18 vpslld $1, %ymm1, %ymm2 #4216.234 @@ -2925,21 +2925,21 @@ __svml_tanf8_ha_l9: # LOE rbx r12 r13 r14 eax ymm0 ymm1 ymm2 ymm14 .cfi_endproc # mark_end; - .type __svml_tanf8_ha_l9,@function - .size __svml_tanf8_ha_l9,.-__svml_tanf8_ha_l9 -..LN__svml_tanf8_ha_l9.5: + .type __jsvml_tanf8_ha_l9,@function + .size __jsvml_tanf8_ha_l9,.-__jsvml_tanf8_ha_l9 +..LN__jsvml_tanf8_ha_l9.5: .data -# -- End __svml_tanf8_ha_l9 +# -- End __jsvml_tanf8_ha_l9 .text -.L_2__routine_start___svml_stan_ha_cout_rare_internal_6: -# -- Begin __svml_stan_ha_cout_rare_internal +.L_2__routine_start___jsvml_stan_ha_cout_rare_internal_6: +# -- Begin __jsvml_stan_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_stan_ha_cout_rare_internal - .globl __svml_stan_ha_cout_rare_internal -# --- __svml_stan_ha_cout_rare_internal(const float *, float *) -__svml_stan_ha_cout_rare_internal: + .hidden __jsvml_stan_ha_cout_rare_internal + .globl __jsvml_stan_ha_cout_rare_internal +# --- __jsvml_stan_ha_cout_rare_internal(const float *, float *) +__jsvml_stan_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -2949,7 +2949,7 @@ __svml_stan_ha_cout_rare_internal: .byte 30 #2428.19 .byte 250 #2428.19 .cfi_startproc -..___tag_value___svml_stan_ha_cout_rare_internal.233: +..___tag_value___jsvml_stan_ha_cout_rare_internal.233: ..L234: #2414.1 xorl %eax, %eax #2415.14 @@ -2990,11 +2990,11 @@ __svml_stan_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 eax .cfi_endproc # mark_end; - .type __svml_stan_ha_cout_rare_internal,@function - .size __svml_stan_ha_cout_rare_internal,.-__svml_stan_ha_cout_rare_internal -..LN__svml_stan_ha_cout_rare_internal.6: + .type __jsvml_stan_ha_cout_rare_internal,@function + .size __jsvml_stan_ha_cout_rare_internal,.-__jsvml_stan_ha_cout_rare_internal +..LN__jsvml_stan_ha_cout_rare_internal.6: .data -# -- End __svml_stan_ha_cout_rare_internal +# -- End __jsvml_stan_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 @@ -3093,9 +3093,9 @@ __svml_stan_ha_cout_rare_internal: .type .L_2il0floatpacket.54,@object .size .L_2il0floatpacket.54,64 .align 64 - .hidden __svml_stan_ha_reduction_data_internal - .globl __svml_stan_ha_reduction_data_internal -__svml_stan_ha_reduction_data_internal: + .hidden __jsvml_stan_ha_reduction_data_internal + .globl __jsvml_stan_ha_reduction_data_internal +__jsvml_stan_ha_reduction_data_internal: .long 0 .long 0 .long 0 @@ -3864,12 +3864,12 @@ __svml_stan_ha_reduction_data_internal: .long 2590957677 .long 2974469278 .long 566763775 - .type __svml_stan_ha_reduction_data_internal,@object - .size __svml_stan_ha_reduction_data_internal,3072 + .type __jsvml_stan_ha_reduction_data_internal,@object + .size __jsvml_stan_ha_reduction_data_internal,3072 .align 64 - .hidden __svml_stan_ha_data_internal - .globl __svml_stan_ha_data_internal -__svml_stan_ha_data_internal: + .hidden __jsvml_stan_ha_data_internal + .globl __jsvml_stan_ha_data_internal +__jsvml_stan_ha_data_internal: .long 1092811139 .long 1092811139 .long 1092811139 @@ -5582,8 +5582,8 @@ __svml_stan_ha_data_internal: .long 3167303981 .long 1051400329 .long 3163053371 - .type __svml_stan_ha_data_internal,@object - .size __svml_stan_ha_data_internal,6848 + .type __jsvml_stan_ha_data_internal,@object + .size __jsvml_stan_ha_data_internal,6848 .align 32 .L_2il0floatpacket.55: .long 0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000,0x7f800000 diff --git a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_tanh_linux_x86.S b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_tanh_linux_x86.S similarity index 90% rename from src/jdk.incubator.vector/linux/native/libsvml/svml_s_tanh_linux_x86.S rename to src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_tanh_linux_x86.S index 1a2a56b45e9..aaa577d8974 100644 --- a/src/jdk.incubator.vector/linux/native/libsvml/svml_s_tanh_linux_x86.S +++ b/src/jdk.incubator.vector/linux/native/libjsvml/jsvml_s_tanh_linux_x86.S @@ -31,14 +31,14 @@ .file "svml_s_tanh.c" .text ..TXTST0: -.L_2__routine_start___svml_tanhf4_ha_l9_0: -# -- Begin __svml_tanhf4_ha_l9 +.L_2__routine_start___jsvml_tanhf4_ha_l9_0: +# -- Begin __jsvml_tanhf4_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanhf4_ha_l9 -# --- __svml_tanhf4_ha_l9(__m128) -__svml_tanhf4_ha_l9: + .globl __jsvml_tanhf4_ha_l9 +# --- __jsvml_tanhf4_ha_l9(__m128) +__jsvml_tanhf4_ha_l9: # parameter 1: %xmm0 ..B1.1: # Preds ..B1.0 # Execution count [1.00e+00] @@ -47,7 +47,7 @@ __svml_tanhf4_ha_l9: .byte 30 #490.540 .byte 250 #490.540 .cfi_startproc -..___tag_value___svml_tanhf4_ha_l9.1: +..___tag_value___jsvml_tanhf4_ha_l9.1: ..L2: #427.1 pushq %rbp #427.1 @@ -58,19 +58,19 @@ __svml_tanhf4_ha_l9: andq $-64, %rsp #427.1 subq $192, %rsp #427.1 vmovaps %xmm0, %xmm7 #427.1 - vpand 3200+__svml_stanh_ha_data_internal(%rip), %xmm7, %xmm11 #466.18 - lea 1392+__svml_stanh_ha_data_internal(%rip), %r8 #475.49 - vpsubd 3328+__svml_stanh_ha_data_internal(%rip), %xmm11, %xmm14 #469.15 + vpand 3200+__jsvml_stanh_ha_data_internal(%rip), %xmm7, %xmm11 #466.18 + lea 1392+__jsvml_stanh_ha_data_internal(%rip), %r8 #475.49 + vpsubd 3328+__jsvml_stanh_ha_data_internal(%rip), %xmm11, %xmm14 #469.15 vpxor %xmm12, %xmm12, %xmm12 #470.19 - vmovups 3392+__svml_stanh_ha_data_internal(%rip), %xmm15 #461.24 + vmovups 3392+__jsvml_stanh_ha_data_internal(%rip), %xmm15 #461.24 vpcmpgtd %xmm12, %xmm14, %xmm13 #470.19 vpand %xmm13, %xmm14, %xmm6 #472.19 vpcmpgtd %xmm15, %xmm14, %xmm0 #471.19 blendvps %xmm0, %xmm15, %xmm6 #473.37 vpsrld $15, %xmm6, %xmm5 #474.23 vmovd %xmm5, %edx #475.117 - vpcmpgtd 3264+__svml_stanh_ha_data_internal(%rip), %xmm11, %xmm10 #467.19 - vandps 3136+__svml_stanh_ha_data_internal(%rip), %xmm7, %xmm8 #463.12 + vpcmpgtd 3264+__jsvml_stanh_ha_data_internal(%rip), %xmm11, %xmm10 #467.19 + vandps 3136+__jsvml_stanh_ha_data_internal(%rip), %xmm7, %xmm8 #463.12 vpextrd $1, %xmm5, %ecx #475.258 movslq %edx, %rdx #475.117 movslq %ecx, %rcx #475.190 @@ -86,7 +86,7 @@ __svml_tanhf4_ha_l9: vmovupd -48(%rdx,%r8), %xmm4 #475.49 vmovupd -16(%rdx,%r8), %xmm13 #477.54 vmovupd -16(%rcx,%r8), %xmm14 #477.195 - vandps 3072+__svml_stanh_ha_data_internal(%rip), %xmm7, %xmm9 #464.13 + vandps 3072+__jsvml_stanh_ha_data_internal(%rip), %xmm7, %xmm9 #464.13 vinsertf128 $1, -32(%rsi,%r8), %ymm0, %ymm11 #476.600 vinsertf128 $1, -32(%rdi,%r8), %ymm10, %ymm12 #476.681 vmovupd (%rdx,%r8), %xmm0 #478.54 @@ -177,29 +177,29 @@ __svml_tanhf4_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #490.540 lea 128(%rsp,%r12,4), %rsi #490.540 -..___tag_value___svml_tanhf4_ha_l9.19: -# __svml_stanh_ha_cout_rare_internal(const float *, float *) - call __svml_stanh_ha_cout_rare_internal #490.540 -..___tag_value___svml_tanhf4_ha_l9.20: +..___tag_value___jsvml_tanhf4_ha_l9.19: +# __jsvml_stanh_ha_cout_rare_internal(const float *, float *) + call __jsvml_stanh_ha_cout_rare_internal #490.540 +..___tag_value___jsvml_tanhf4_ha_l9.20: jmp ..B1.8 # Prob 100% #490.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanhf4_ha_l9,@function - .size __svml_tanhf4_ha_l9,.-__svml_tanhf4_ha_l9 -..LN__svml_tanhf4_ha_l9.0: + .type __jsvml_tanhf4_ha_l9,@function + .size __jsvml_tanhf4_ha_l9,.-__jsvml_tanhf4_ha_l9 +..LN__jsvml_tanhf4_ha_l9.0: .data -# -- End __svml_tanhf4_ha_l9 +# -- End __jsvml_tanhf4_ha_l9 .text -.L_2__routine_start___svml_tanhf4_ha_e9_1: -# -- Begin __svml_tanhf4_ha_e9 +.L_2__routine_start___jsvml_tanhf4_ha_e9_1: +# -- Begin __jsvml_tanhf4_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanhf4_ha_e9 -# --- __svml_tanhf4_ha_e9(__m128) -__svml_tanhf4_ha_e9: + .globl __jsvml_tanhf4_ha_e9 +# --- __jsvml_tanhf4_ha_e9(__m128) +__jsvml_tanhf4_ha_e9: # parameter 1: %xmm0 ..B2.1: # Preds ..B2.0 # Execution count [1.00e+00] @@ -208,7 +208,7 @@ __svml_tanhf4_ha_e9: .byte 30 #561.540 .byte 250 #561.540 .cfi_startproc -..___tag_value___svml_tanhf4_ha_e9.22: +..___tag_value___jsvml_tanhf4_ha_e9.22: ..L23: #498.1 pushq %rbp #498.1 @@ -219,19 +219,19 @@ __svml_tanhf4_ha_e9: andq $-64, %rsp #498.1 subq $192, %rsp #498.1 vmovaps %xmm0, %xmm10 #498.1 - vpand 3200+__svml_stanh_ha_data_internal(%rip), %xmm10, %xmm12 #537.22 - lea 1392+__svml_stanh_ha_data_internal(%rip), %r8 #546.49 - vpsubd 3328+__svml_stanh_ha_data_internal(%rip), %xmm12, %xmm15 #540.19 + vpand 3200+__jsvml_stanh_ha_data_internal(%rip), %xmm10, %xmm12 #537.22 + lea 1392+__jsvml_stanh_ha_data_internal(%rip), %r8 #546.49 + vpsubd 3328+__jsvml_stanh_ha_data_internal(%rip), %xmm12, %xmm15 #540.19 vpxor %xmm13, %xmm13, %xmm13 #541.23 - vmovups 3392+__svml_stanh_ha_data_internal(%rip), %xmm7 #532.28 + vmovups 3392+__jsvml_stanh_ha_data_internal(%rip), %xmm7 #532.28 vpcmpgtd %xmm13, %xmm15, %xmm14 #541.23 vpand %xmm14, %xmm15, %xmm1 #543.23 vpcmpgtd %xmm7, %xmm15, %xmm0 #542.23 blendvps %xmm0, %xmm7, %xmm1 #544.41 vpsrld $15, %xmm1, %xmm6 #545.27 vmovd %xmm6, %edx #546.117 - vpcmpgtd 3264+__svml_stanh_ha_data_internal(%rip), %xmm12, %xmm11 #538.23 - vandps 3136+__svml_stanh_ha_data_internal(%rip), %xmm10, %xmm8 #534.12 + vpcmpgtd 3264+__jsvml_stanh_ha_data_internal(%rip), %xmm12, %xmm11 #538.23 + vandps 3136+__jsvml_stanh_ha_data_internal(%rip), %xmm10, %xmm8 #534.12 vpextrd $1, %xmm6, %ecx #546.258 movslq %edx, %rdx #546.117 movslq %ecx, %rcx #546.190 @@ -246,7 +246,7 @@ __svml_tanhf4_ha_e9: vmovupd -48(%rcx,%r8), %xmm4 #546.190 vmovupd -48(%rdx,%r8), %xmm5 #546.49 vmovupd -16(%rdx,%r8), %xmm15 #548.54 - vandps 3072+__svml_stanh_ha_data_internal(%rip), %xmm10, %xmm9 #535.13 + vandps 3072+__jsvml_stanh_ha_data_internal(%rip), %xmm10, %xmm9 #535.13 vinsertf128 $1, -32(%rsi,%r8), %ymm11, %ymm13 #547.600 vinsertf128 $1, -32(%rdi,%r8), %ymm12, %ymm14 #547.681 vinsertf128 $1, -16(%rdi,%r8), %ymm1, %ymm0 #548.686 @@ -345,29 +345,29 @@ __svml_tanhf4_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #561.540 lea 128(%rsp,%r12,4), %rsi #561.540 -..___tag_value___svml_tanhf4_ha_e9.40: -# __svml_stanh_ha_cout_rare_internal(const float *, float *) - call __svml_stanh_ha_cout_rare_internal #561.540 -..___tag_value___svml_tanhf4_ha_e9.41: +..___tag_value___jsvml_tanhf4_ha_e9.40: +# __jsvml_stanh_ha_cout_rare_internal(const float *, float *) + call __jsvml_stanh_ha_cout_rare_internal #561.540 +..___tag_value___jsvml_tanhf4_ha_e9.41: jmp ..B2.8 # Prob 100% #561.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanhf4_ha_e9,@function - .size __svml_tanhf4_ha_e9,.-__svml_tanhf4_ha_e9 -..LN__svml_tanhf4_ha_e9.1: + .type __jsvml_tanhf4_ha_e9,@function + .size __jsvml_tanhf4_ha_e9,.-__jsvml_tanhf4_ha_e9 +..LN__jsvml_tanhf4_ha_e9.1: .data -# -- End __svml_tanhf4_ha_e9 +# -- End __jsvml_tanhf4_ha_e9 .text -.L_2__routine_start___svml_tanhf16_ha_z0_2: -# -- Begin __svml_tanhf16_ha_z0 +.L_2__routine_start___jsvml_tanhf16_ha_z0_2: +# -- Begin __jsvml_tanhf16_ha_z0 .text # mark_begin; .align 16,0x90 - .globl __svml_tanhf16_ha_z0 -# --- __svml_tanhf16_ha_z0(__m512) -__svml_tanhf16_ha_z0: + .globl __jsvml_tanhf16_ha_z0 +# --- __jsvml_tanhf16_ha_z0(__m512) +__jsvml_tanhf16_ha_z0: # parameter 1: %zmm0 ..B3.1: # Preds ..B3.0 # Execution count [1.00e+00] @@ -376,7 +376,7 @@ __svml_tanhf16_ha_z0: .byte 30 #652.760 .byte 250 #652.760 .cfi_startproc -..___tag_value___svml_tanhf16_ha_z0.43: +..___tag_value___jsvml_tanhf16_ha_z0.43: ..L44: #589.1 pushq %rbp #589.1 @@ -387,39 +387,39 @@ __svml_tanhf16_ha_z0: andq $-64, %rsp #589.1 subq $192, %rsp #589.1 vmovaps %zmm0, %zmm1 #589.1 - vmovups __svml_stanh_ha_data_internal(%rip), %zmm9 #632.252 - vmovups 896+__svml_stanh_ha_data_internal(%rip), %zmm10 #639.261 - vmovups 1024+__svml_stanh_ha_data_internal(%rip), %zmm15 #640.261 - vmovups 768+__svml_stanh_ha_data_internal(%rip), %zmm11 #638.261 - vmovups 640+__svml_stanh_ha_data_internal(%rip), %zmm12 #637.257 - vmovups 512+__svml_stanh_ha_data_internal(%rip), %zmm13 #636.257 - vandps 3136+__svml_stanh_ha_data_internal(%rip), %zmm1, %zmm8 #622.12 + vmovups __jsvml_stanh_ha_data_internal(%rip), %zmm9 #632.252 + vmovups 896+__jsvml_stanh_ha_data_internal(%rip), %zmm10 #639.261 + vmovups 1024+__jsvml_stanh_ha_data_internal(%rip), %zmm15 #640.261 + vmovups 768+__jsvml_stanh_ha_data_internal(%rip), %zmm11 #638.261 + vmovups 640+__jsvml_stanh_ha_data_internal(%rip), %zmm12 #637.257 + vmovups 512+__jsvml_stanh_ha_data_internal(%rip), %zmm13 #636.257 + vandps 3136+__jsvml_stanh_ha_data_internal(%rip), %zmm1, %zmm8 #622.12 vpternlogd $255, %zmm2, %zmm2, %zmm2 #626.17 - vandps 3072+__svml_stanh_ha_data_internal(%rip), %zmm1, %zmm0 #623.13 - vpandd 1152+__svml_stanh_ha_data_internal(%rip), %zmm1, %zmm3 #625.16 - vpsubd 1216+__svml_stanh_ha_data_internal(%rip), %zmm3, %zmm4 #628.13 - vpcmpd $2, 3264+__svml_stanh_ha_data_internal(%rip), %zmm3, %k1 #626.84 + vandps 3072+__jsvml_stanh_ha_data_internal(%rip), %zmm1, %zmm0 #623.13 + vpandd 1152+__jsvml_stanh_ha_data_internal(%rip), %zmm1, %zmm3 #625.16 + vpsubd 1216+__jsvml_stanh_ha_data_internal(%rip), %zmm3, %zmm4 #628.13 + vpcmpd $2, 3264+__jsvml_stanh_ha_data_internal(%rip), %zmm3, %k1 #626.84 vpxord %zmm5, %zmm5, %zmm5 #629.17 vpmaxsd %zmm5, %zmm4, %zmm6 #629.17 - vpminsd 1280+__svml_stanh_ha_data_internal(%rip), %zmm6, %zmm7 #630.17 + vpminsd 1280+__jsvml_stanh_ha_data_internal(%rip), %zmm6, %zmm7 #630.17 vpsrld $21, %zmm7, %zmm14 #631.23 - vmovups 128+__svml_stanh_ha_data_internal(%rip), %zmm4 #634.257 - vpermt2ps 64+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm9 #632.252 - vpermt2ps 960+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm10 #639.261 - vpermt2ps 1088+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm15 #640.261 - vpermt2ps 832+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm11 #638.261 - vpermt2ps 704+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm12 #637.257 - vpermt2ps 576+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm13 #636.257 - vpermt2ps 192+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm4 #634.257 + vmovups 128+__jsvml_stanh_ha_data_internal(%rip), %zmm4 #634.257 + vpermt2ps 64+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm9 #632.252 + vpermt2ps 960+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm10 #639.261 + vpermt2ps 1088+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm15 #640.261 + vpermt2ps 832+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm11 #638.261 + vpermt2ps 704+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm12 #637.257 + vpermt2ps 576+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm13 #636.257 + vpermt2ps 192+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm4 #634.257 vpandnd %zmm3, %zmm3, %zmm2{%k1} #626.17 vsubps {rn-sae}, %zmm9, %zmm8, %zmm3 #633.18 vptestmd %zmm2, %zmm2, %k0 #627.29 - vmovups 384+__svml_stanh_ha_data_internal(%rip), %zmm2 #635.257 + vmovups 384+__jsvml_stanh_ha_data_internal(%rip), %zmm2 #635.257 vfmadd213ps {rn-sae}, %zmm10, %zmm3, %zmm15 #641.20 - vmovups 256+__svml_stanh_ha_data_internal(%rip), %zmm10 #645.265 - vpermt2ps 448+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm2 #635.257 + vmovups 256+__jsvml_stanh_ha_data_internal(%rip), %zmm10 #645.265 + vpermt2ps 448+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm2 #635.257 vfmadd213ps {rn-sae}, %zmm11, %zmm3, %zmm15 #642.20 - vpermt2ps 320+__svml_stanh_ha_data_internal(%rip), %zmm14, %zmm10 #645.265 + vpermt2ps 320+__jsvml_stanh_ha_data_internal(%rip), %zmm14, %zmm10 #645.265 kmovw %k0, %esi #627.29 vfmadd213ps {rn-sae}, %zmm12, %zmm3, %zmm15 #643.20 vfmadd213ps {rn-sae}, %zmm13, %zmm3, %zmm15 #644.20 @@ -537,29 +537,29 @@ __svml_tanhf16_ha_z0: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%rbx,4), %rdi #652.760 lea 128(%rsp,%rbx,4), %rsi #652.760 -..___tag_value___svml_tanhf16_ha_z0.71: -# __svml_stanh_ha_cout_rare_internal(const float *, float *) - call __svml_stanh_ha_cout_rare_internal #652.760 -..___tag_value___svml_tanhf16_ha_z0.72: +..___tag_value___jsvml_tanhf16_ha_z0.71: +# __jsvml_stanh_ha_cout_rare_internal(const float *, float *) + call __jsvml_stanh_ha_cout_rare_internal #652.760 +..___tag_value___jsvml_tanhf16_ha_z0.72: jmp ..B3.13 # Prob 100% #652.760 .align 16,0x90 # LOE r15 ebx r12d r13d r14d .cfi_endproc # mark_end; - .type __svml_tanhf16_ha_z0,@function - .size __svml_tanhf16_ha_z0,.-__svml_tanhf16_ha_z0 -..LN__svml_tanhf16_ha_z0.2: + .type __jsvml_tanhf16_ha_z0,@function + .size __jsvml_tanhf16_ha_z0,.-__jsvml_tanhf16_ha_z0 +..LN__jsvml_tanhf16_ha_z0.2: .data -# -- End __svml_tanhf16_ha_z0 +# -- End __jsvml_tanhf16_ha_z0 .text -.L_2__routine_start___svml_tanhf8_ha_l9_3: -# -- Begin __svml_tanhf8_ha_l9 +.L_2__routine_start___jsvml_tanhf8_ha_l9_3: +# -- Begin __jsvml_tanhf8_ha_l9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanhf8_ha_l9 -# --- __svml_tanhf8_ha_l9(__m256) -__svml_tanhf8_ha_l9: + .globl __jsvml_tanhf8_ha_l9 +# --- __jsvml_tanhf8_ha_l9(__m256) +__jsvml_tanhf8_ha_l9: # parameter 1: %ymm0 ..B4.1: # Preds ..B4.0 # Execution count [1.00e+00] @@ -568,7 +568,7 @@ __svml_tanhf8_ha_l9: .byte 30 #723.546 .byte 250 #723.546 .cfi_startproc -..___tag_value___svml_tanhf8_ha_l9.74: +..___tag_value___jsvml_tanhf8_ha_l9.74: ..L75: #660.1 pushq %rbp #660.1 @@ -579,20 +579,20 @@ __svml_tanhf8_ha_l9: andq $-64, %rsp #660.1 pushq %r14 #660.1 subq $184, %rsp #660.1 - lea 1392+__svml_stanh_ha_data_internal(%rip), %r10 #708.71 - vpand 3200+__svml_stanh_ha_data_internal(%rip), %ymm0, %ymm8 #699.18 - vmovups 3392+__svml_stanh_ha_data_internal(%rip), %ymm3 #694.24 + lea 1392+__jsvml_stanh_ha_data_internal(%rip), %r10 #708.71 + vpand 3200+__jsvml_stanh_ha_data_internal(%rip), %ymm0, %ymm8 #699.18 + vmovups 3392+__jsvml_stanh_ha_data_internal(%rip), %ymm3 #694.24 vmovups %ymm0, (%rsp) #660.1[spill] - vpsubd 3328+__svml_stanh_ha_data_internal(%rip), %ymm8, %ymm7 #702.15 + vpsubd 3328+__jsvml_stanh_ha_data_internal(%rip), %ymm8, %ymm7 #702.15 vxorps %ymm6, %ymm6, %ymm6 #703.19 vpcmpgtd %ymm6, %ymm7, %ymm9 #703.19 vpand %ymm9, %ymm7, %ymm5 #705.19 - vandps 3136+__svml_stanh_ha_data_internal(%rip), %ymm0, %ymm12 #696.12 - vandps 3072+__svml_stanh_ha_data_internal(%rip), %ymm0, %ymm10 #697.13 + vandps 3136+__jsvml_stanh_ha_data_internal(%rip), %ymm0, %ymm12 #696.12 + vandps 3072+__jsvml_stanh_ha_data_internal(%rip), %ymm0, %ymm10 #697.13 vpcmpgtd %ymm3, %ymm7, %ymm0 #704.19 vmovups %ymm10, 32(%rsp) #697.13[spill] vblendvps %ymm0, %ymm3, %ymm5, %ymm10 #706.40 - vpcmpgtd 3264+__svml_stanh_ha_data_internal(%rip), %ymm8, %ymm11 #700.19 + vpcmpgtd 3264+__jsvml_stanh_ha_data_internal(%rip), %ymm8, %ymm11 #700.19 vmovmskps %ymm11, %r11d #701.41 vpsrld $15, %ymm10, %ymm11 #707.23 vextractf128 $1, %ymm11, %xmm8 #708.931 @@ -742,29 +742,29 @@ __svml_tanhf8_ha_l9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r14,4), %rdi #723.546 lea 128(%rsp,%r14,4), %rsi #723.546 -..___tag_value___svml_tanhf8_ha_l9.98: -# __svml_stanh_ha_cout_rare_internal(const float *, float *) - call __svml_stanh_ha_cout_rare_internal #723.546 -..___tag_value___svml_tanhf8_ha_l9.99: +..___tag_value___jsvml_tanhf8_ha_l9.98: +# __jsvml_stanh_ha_cout_rare_internal(const float *, float *) + call __jsvml_stanh_ha_cout_rare_internal #723.546 +..___tag_value___jsvml_tanhf8_ha_l9.99: jmp ..B4.8 # Prob 100% #723.546 .align 16,0x90 # LOE rbx r13 r15 r12d r14d .cfi_endproc # mark_end; - .type __svml_tanhf8_ha_l9,@function - .size __svml_tanhf8_ha_l9,.-__svml_tanhf8_ha_l9 -..LN__svml_tanhf8_ha_l9.3: + .type __jsvml_tanhf8_ha_l9,@function + .size __jsvml_tanhf8_ha_l9,.-__jsvml_tanhf8_ha_l9 +..LN__jsvml_tanhf8_ha_l9.3: .data -# -- End __svml_tanhf8_ha_l9 +# -- End __jsvml_tanhf8_ha_l9 .text -.L_2__routine_start___svml_tanhf8_ha_e9_4: -# -- Begin __svml_tanhf8_ha_e9 +.L_2__routine_start___jsvml_tanhf8_ha_e9_4: +# -- Begin __jsvml_tanhf8_ha_e9 .text # mark_begin; .align 16,0x90 - .globl __svml_tanhf8_ha_e9 -# --- __svml_tanhf8_ha_e9(__m256) -__svml_tanhf8_ha_e9: + .globl __jsvml_tanhf8_ha_e9 +# --- __jsvml_tanhf8_ha_e9(__m256) +__jsvml_tanhf8_ha_e9: # parameter 1: %ymm0 ..B5.1: # Preds ..B5.0 # Execution count [1.00e+00] @@ -773,7 +773,7 @@ __svml_tanhf8_ha_e9: .byte 30 #794.546 .byte 250 #794.546 .cfi_startproc -..___tag_value___svml_tanhf8_ha_e9.101: +..___tag_value___jsvml_tanhf8_ha_e9.101: ..L102: #731.1 pushq %rbp #731.1 @@ -784,15 +784,15 @@ __svml_tanhf8_ha_e9: andq $-64, %rsp #731.1 pushq %r12 #731.1 subq $184, %rsp #731.1 - lea 1392+__svml_stanh_ha_data_internal(%rip), %r10 #779.49 + lea 1392+__jsvml_stanh_ha_data_internal(%rip), %r10 #779.49 vmovups %ymm0, (%rsp) #731.1[spill] vpxor %xmm14, %xmm14, %xmm14 #772.39 - vmovups 3200+__svml_stanh_ha_data_internal(%rip), %xmm9 #763.29 - vmovups 3264+__svml_stanh_ha_data_internal(%rip), %xmm8 #762.21 - vmovups 3328+__svml_stanh_ha_data_internal(%rip), %xmm13 #764.31 - vmovups 3392+__svml_stanh_ha_data_internal(%rip), %xmm12 #765.28 - vandps 3136+__svml_stanh_ha_data_internal(%rip), %ymm0, %ymm1 #767.12 - vandps 3072+__svml_stanh_ha_data_internal(%rip), %ymm0, %ymm11 #768.13 + vmovups 3200+__jsvml_stanh_ha_data_internal(%rip), %xmm9 #763.29 + vmovups 3264+__jsvml_stanh_ha_data_internal(%rip), %xmm8 #762.21 + vmovups 3328+__jsvml_stanh_ha_data_internal(%rip), %xmm13 #764.31 + vmovups 3392+__jsvml_stanh_ha_data_internal(%rip), %xmm12 #765.28 + vandps 3136+__jsvml_stanh_ha_data_internal(%rip), %ymm0, %ymm1 #767.12 + vandps 3072+__jsvml_stanh_ha_data_internal(%rip), %ymm0, %ymm11 #768.13 vmovups %ymm11, 32(%rsp) #768.13[spill] vextractf128 $1, %ymm0, %xmm10 #769.101 vpand %xmm9, %xmm0, %xmm0 #770.22 @@ -975,29 +975,29 @@ __svml_tanhf8_ha_e9: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #794.546 lea 128(%rsp,%r12,4), %rsi #794.546 -..___tag_value___svml_tanhf8_ha_e9.125: -# __svml_stanh_ha_cout_rare_internal(const float *, float *) - call __svml_stanh_ha_cout_rare_internal #794.546 -..___tag_value___svml_tanhf8_ha_e9.126: +..___tag_value___jsvml_tanhf8_ha_e9.125: +# __jsvml_stanh_ha_cout_rare_internal(const float *, float *) + call __jsvml_stanh_ha_cout_rare_internal #794.546 +..___tag_value___jsvml_tanhf8_ha_e9.126: jmp ..B5.8 # Prob 100% #794.546 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanhf8_ha_e9,@function - .size __svml_tanhf8_ha_e9,.-__svml_tanhf8_ha_e9 -..LN__svml_tanhf8_ha_e9.4: + .type __jsvml_tanhf8_ha_e9,@function + .size __jsvml_tanhf8_ha_e9,.-__jsvml_tanhf8_ha_e9 +..LN__jsvml_tanhf8_ha_e9.4: .data -# -- End __svml_tanhf8_ha_e9 +# -- End __jsvml_tanhf8_ha_e9 .text -.L_2__routine_start___svml_tanhf4_ha_ex_5: -# -- Begin __svml_tanhf4_ha_ex +.L_2__routine_start___jsvml_tanhf4_ha_ex_5: +# -- Begin __jsvml_tanhf4_ha_ex .text # mark_begin; .align 16,0x90 - .globl __svml_tanhf4_ha_ex -# --- __svml_tanhf4_ha_ex(__m128) -__svml_tanhf4_ha_ex: + .globl __jsvml_tanhf4_ha_ex +# --- __jsvml_tanhf4_ha_ex(__m128) +__jsvml_tanhf4_ha_ex: # parameter 1: %xmm0 ..B6.1: # Preds ..B6.0 # Execution count [1.00e+00] @@ -1006,7 +1006,7 @@ __svml_tanhf4_ha_ex: .byte 30 #865.540 .byte 250 #865.540 .cfi_startproc -..___tag_value___svml_tanhf4_ha_ex.128: +..___tag_value___jsvml_tanhf4_ha_ex.128: ..L129: #802.1 pushq %rbp #802.1 @@ -1017,13 +1017,13 @@ __svml_tanhf4_ha_ex: andq $-64, %rsp #802.1 subq $192, %rsp #802.1 movaps %xmm0, %xmm12 #802.1 - movdqu 3200+__svml_stanh_ha_data_internal(%rip), %xmm10 #841.16 - lea 1392+__svml_stanh_ha_data_internal(%rip), %r8 #850.71 + movdqu 3200+__jsvml_stanh_ha_data_internal(%rip), %xmm10 #841.16 + lea 1392+__jsvml_stanh_ha_data_internal(%rip), %r8 #850.71 pand %xmm12, %xmm10 #841.16 pxor %xmm8, %xmm8 #845.17 movdqa %xmm10, %xmm7 #842.17 - psubd 3328+__svml_stanh_ha_data_internal(%rip), %xmm10 #844.13 - movdqu 3392+__svml_stanh_ha_data_internal(%rip), %xmm3 #836.57 + psubd 3328+__jsvml_stanh_ha_data_internal(%rip), %xmm10 #844.13 + movdqu 3392+__jsvml_stanh_ha_data_internal(%rip), %xmm3 #836.57 movdqa %xmm10, %xmm4 #846.17 movdqa %xmm10, %xmm9 #845.17 pcmpgtd %xmm3, %xmm4 #846.17 @@ -1041,15 +1041,15 @@ __svml_tanhf4_ha_ex: movd %xmm13, %edi #850.702 movd %xmm1, %edx #850.139 movd %xmm5, %ecx #850.300 - movups 3136+__svml_stanh_ha_data_internal(%rip), %xmm0 #838.12 - movups 3072+__svml_stanh_ha_data_internal(%rip), %xmm11 #839.13 + movups 3136+__jsvml_stanh_ha_data_internal(%rip), %xmm0 #838.12 + movups 3072+__jsvml_stanh_ha_data_internal(%rip), %xmm11 #839.13 andps %xmm12, %xmm0 #838.12 movslq %esi, %rsi #850.433 andps %xmm12, %xmm11 #839.13 movslq %edi, %rdi #850.634 movslq %edx, %rdx #850.139 movups %xmm12, (%rsp) #802.1[spill] - pcmpgtd 3264+__svml_stanh_ha_data_internal(%rip), %xmm7 #842.17 + pcmpgtd 3264+__jsvml_stanh_ha_data_internal(%rip), %xmm7 #842.17 movslq %ecx, %rcx #850.232 movups -48(%rsi,%r8), %xmm12 #850.433 movmskps %xmm7, %eax #843.40 @@ -1186,30 +1186,30 @@ __svml_tanhf4_ha_ex: # Execution count [6.25e-04]: Infreq lea 64(%rsp,%r12,4), %rdi #865.540 lea 128(%rsp,%r12,4), %rsi #865.540 -..___tag_value___svml_tanhf4_ha_ex.154: -# __svml_stanh_ha_cout_rare_internal(const float *, float *) - call __svml_stanh_ha_cout_rare_internal #865.540 -..___tag_value___svml_tanhf4_ha_ex.155: +..___tag_value___jsvml_tanhf4_ha_ex.154: +# __jsvml_stanh_ha_cout_rare_internal(const float *, float *) + call __jsvml_stanh_ha_cout_rare_internal #865.540 +..___tag_value___jsvml_tanhf4_ha_ex.155: jmp ..B6.8 # Prob 100% #865.540 .align 16,0x90 # LOE rbx r14 r15 r12d r13d .cfi_endproc # mark_end; - .type __svml_tanhf4_ha_ex,@function - .size __svml_tanhf4_ha_ex,.-__svml_tanhf4_ha_ex -..LN__svml_tanhf4_ha_ex.5: + .type __jsvml_tanhf4_ha_ex,@function + .size __jsvml_tanhf4_ha_ex,.-__jsvml_tanhf4_ha_ex +..LN__jsvml_tanhf4_ha_ex.5: .data -# -- End __svml_tanhf4_ha_ex +# -- End __jsvml_tanhf4_ha_ex .text -.L_2__routine_start___svml_stanh_ha_cout_rare_internal_6: -# -- Begin __svml_stanh_ha_cout_rare_internal +.L_2__routine_start___jsvml_stanh_ha_cout_rare_internal_6: +# -- Begin __jsvml_stanh_ha_cout_rare_internal .text # mark_begin; .align 16,0x90 - .hidden __svml_stanh_ha_cout_rare_internal - .globl __svml_stanh_ha_cout_rare_internal -# --- __svml_stanh_ha_cout_rare_internal(const float *, float *) -__svml_stanh_ha_cout_rare_internal: + .hidden __jsvml_stanh_ha_cout_rare_internal + .globl __jsvml_stanh_ha_cout_rare_internal +# --- __jsvml_stanh_ha_cout_rare_internal(const float *, float *) +__jsvml_stanh_ha_cout_rare_internal: # parameter 1: %rdi # parameter 2: %rsi ..B7.1: # Preds ..B7.0 @@ -1219,7 +1219,7 @@ __svml_stanh_ha_cout_rare_internal: .byte 30 #582.9 .byte 250 #582.9 .cfi_startproc -..___tag_value___svml_stanh_ha_cout_rare_internal.157: +..___tag_value___jsvml_stanh_ha_cout_rare_internal.157: ..L158: #572.1 lea _imlsTanhHATab(%rip), %rdx #575.29 @@ -1257,17 +1257,17 @@ __svml_stanh_ha_cout_rare_internal: # LOE rbx rbp r12 r13 r14 r15 .cfi_endproc # mark_end; - .type __svml_stanh_ha_cout_rare_internal,@function - .size __svml_stanh_ha_cout_rare_internal,.-__svml_stanh_ha_cout_rare_internal -..LN__svml_stanh_ha_cout_rare_internal.6: + .type __jsvml_stanh_ha_cout_rare_internal,@function + .size __jsvml_stanh_ha_cout_rare_internal,.-__jsvml_stanh_ha_cout_rare_internal +..LN__jsvml_stanh_ha_cout_rare_internal.6: .data -# -- End __svml_stanh_ha_cout_rare_internal +# -- End __jsvml_stanh_ha_cout_rare_internal .section .rodata, "a" .align 64 .align 64 - .hidden __svml_stanh_ha_data_internal - .globl __svml_stanh_ha_data_internal -__svml_stanh_ha_data_internal: + .hidden __jsvml_stanh_ha_data_internal + .globl __jsvml_stanh_ha_data_internal +__jsvml_stanh_ha_data_internal: .long 0 .long 1030750208 .long 1032847360 @@ -2132,8 +2132,8 @@ __svml_stanh_ha_data_internal: .long 54525952 .long 54525952 .long 54525952 - .type __svml_stanh_ha_data_internal,@object - .size __svml_stanh_ha_data_internal,3456 + .type __jsvml_stanh_ha_data_internal,@object + .size __jsvml_stanh_ha_data_internal,3456 .align 4 _imlsTanhHATab: .long 1065353216 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/globals_vectorApiSupport_windows.S.inc b/src/jdk.incubator.vector/windows/native/libjsvml/globals_vectorApiSupport_windows.S.inc similarity index 100% rename from src/jdk.incubator.vector/windows/native/libsvml/globals_vectorApiSupport_windows.S.inc rename to src/jdk.incubator.vector/windows/native/libjsvml/globals_vectorApiSupport_windows.S.inc diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_acos_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_acos_windows_x86.S similarity index 79% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_acos_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_acos_windows_x86.S index ae2e316f39f..2ff34da607f 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_acos_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_acos_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos2_ha_l9 + PUBLIC __jsvml_acos2_ha_l9 -__svml_acos2_ha_l9 PROC EXPORT +__jsvml_acos2_ha_l9 PROC EXPORT _B1_1:: @@ -59,17 +59,17 @@ L1:: vmovapd xmm7, xmm0 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal] + vmovupd xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 - vmovupd xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+64] + vmovupd xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+64] vorpd xmm1, xmm5, xmm7 vfmadd231pd xmm4, xmm4, xmm1 vandpd xmm5, xmm5, xmm7 vmulpd xmm3, xmm1, xmm1 vcvtpd2ps xmm8, xmm4 vminpd xmm10, xmm3, xmm4 - vcmpltpd xmm9, xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+128] - vcmpngepd xmm2, xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+256] + vcmpltpd xmm9, xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+128] + vcmpngepd xmm2, xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+256] vmovlhps xmm0, xmm8, xmm8 vrsqrtps xmm3, xmm0 vmovmskpd edx, xmm2 @@ -80,41 +80,41 @@ L1:: vandpd xmm9, xmm4, xmm2 vmulpd xmm8, xmm12, xmm12 vmulpd xmm3, xmm12, xmm9 - vfmsub213pd xmm8, xmm9, XMMWORD PTR [__svml_dacos_ha_data_internal+384] - vmovupd xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+448] - vmovupd xmm11, XMMWORD PTR [__svml_dacos_ha_data_internal+832] + vfmsub213pd xmm8, xmm9, XMMWORD PTR [__jsvml_dacos_ha_data_internal+384] + vmovupd xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+448] + vmovupd xmm11, XMMWORD PTR [__jsvml_dacos_ha_data_internal+832] vfmsub213pd xmm9, xmm12, xmm3 - vfmadd213pd xmm11, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+896] - vfmadd213pd xmm4, xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+512] - vmovupd xmm12, XMMWORD PTR [__svml_dacos_ha_data_internal+1088] + vfmadd213pd xmm11, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+896] + vfmadd213pd xmm4, xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+512] + vmovupd xmm12, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1088] vmulpd xmm0, xmm8, xmm3 - vfmadd213pd xmm4, xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+576] - vfmadd213pd xmm12, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+1152] - vfmadd213pd xmm4, xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+640] + vfmadd213pd xmm4, xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+576] + vfmadd213pd xmm12, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1152] + vfmadd213pd xmm4, xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+640] vmulpd xmm8, xmm10, xmm10 vfmsub213pd xmm4, xmm0, xmm9 - vmovupd xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+704] - vmovupd xmm9, XMMWORD PTR [__svml_dacos_ha_data_internal+960] - vfmadd213pd xmm0, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+768] - vfmadd213pd xmm9, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+1024] + vmovupd xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+704] + vmovupd xmm9, XMMWORD PTR [__jsvml_dacos_ha_data_internal+960] + vfmadd213pd xmm0, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+768] + vfmadd213pd xmm9, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1024] vfmadd213pd xmm0, xmm8, xmm11 vfmadd213pd xmm9, xmm8, xmm12 - vmovupd xmm12, XMMWORD PTR [__svml_dacos_ha_data_internal+1216] + vmovupd xmm12, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1216] vmulpd xmm11, xmm8, xmm8 - vfmadd213pd xmm12, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+1280] + vfmadd213pd xmm12, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1280] vfmadd213pd xmm0, xmm11, xmm9 vandnpd xmm9, xmm2, xmm1 vorpd xmm3, xmm3, xmm9 - vandnpd xmm11, xmm2, XMMWORD PTR [__svml_dacos_ha_data_internal+1664] + vandnpd xmm11, xmm2, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1664] vfmadd213pd xmm0, xmm8, xmm12 - vfmadd213pd xmm0, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+1344] - vfmadd213pd xmm0, xmm10, XMMWORD PTR [__svml_dacos_ha_data_internal+1408] + vfmadd213pd xmm0, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1344] + vfmadd213pd xmm0, xmm10, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1408] vmulpd xmm0, xmm10, xmm0 vcmpnltpd xmm10, xmm10, xmm7 vandpd xmm8, xmm10, xmm2 - vandpd xmm12, xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+1472] - vandpd xmm10, xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+1536] - vandnpd xmm8, xmm2, XMMWORD PTR [__svml_dacos_ha_data_internal+1600] + vandpd xmm12, xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1472] + vandpd xmm10, xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1536] + vandnpd xmm8, xmm2, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1600] vorpd xmm1, xmm8, xmm12 vorpd xmm8, xmm11, xmm10 vxorpd xmm1, xmm1, xmm5 @@ -176,19 +176,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_acos2_ha_l9 ENDP +__jsvml_acos2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos2_ha_l9_B1_B3: +_unwind___jsvml_acos2_ha_l9_B1_B3: DD 1068289 DD 2413645 DD 882753 @@ -206,19 +206,19 @@ _unwind___svml_acos2_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_acos2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acos2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos2_ha_l9_B6_B10: +_unwind___jsvml_acos2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_acos2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acos2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -227,7 +227,7 @@ _unwind___svml_acos2_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_acos2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_acos2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -241,9 +241,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos1_ha_ex + PUBLIC __jsvml_acos1_ha_ex -__svml_acos1_ha_ex PROC EXPORT +__jsvml_acos1_ha_ex PROC EXPORT _B2_1:: @@ -262,16 +262,16 @@ L20:: movups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm8, QWORD PTR [__svml_dacos_ha_data_internal] + movsd xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 movaps xmm2, xmm8 andps xmm8, xmm0 orps xmm2, xmm0 - movsd xmm5, QWORD PTR [__svml_dacos_ha_data_internal+64] + movsd xmm5, QWORD PTR [__jsvml_dacos_ha_data_internal+64] movaps xmm12, xmm2 mulsd xmm12, xmm5 movaps xmm4, xmm2 - movsd xmm1, QWORD PTR [__svml_dacos_ha_data_internal+256] + movsd xmm1, QWORD PTR [__jsvml_dacos_ha_data_internal+256] addsd xmm12, xmm5 cmpnlesd xmm1, xmm2 cvtpd2ps xmm7, xmm12 @@ -289,14 +289,14 @@ L20:: cvtps2pd xmm13, xmm6 movaps xmm5, xmm1 movaps xmm3, xmm12 - movsd xmm7, QWORD PTR [__svml_dacos_ha_data_internal+320] + movsd xmm7, QWORD PTR [__jsvml_dacos_ha_data_internal+320] movaps xmm4, xmm1 - movsd xmm6, QWORD PTR [__svml_dacos_ha_data_internal+448] + movsd xmm6, QWORD PTR [__jsvml_dacos_ha_data_internal+448] cmpnltsd xmm5, xmm12 - mulsd xmm4, QWORD PTR [__svml_dacos_ha_data_internal+832] + mulsd xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+832] addsd xmm12, xmm12 - cmpltsd xmm3, QWORD PTR [__svml_dacos_ha_data_internal+128] - addsd xmm4, QWORD PTR [__svml_dacos_ha_data_internal+896] + cmpltsd xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+128] + addsd xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+896] andps xmm12, xmm5 andnps xmm3, xmm13 andps xmm7, xmm12 @@ -308,30 +308,30 @@ L20:: movaps xmm14, xmm12 mulsd xmm13, xmm3 mulsd xmm14, xmm3 - subsd xmm13, QWORD PTR [__svml_dacos_ha_data_internal+384] + subsd xmm13, QWORD PTR [__jsvml_dacos_ha_data_internal+384] movaps xmm3, xmm7 addsd xmm13, xmm14 addsd xmm3, xmm12 mulsd xmm6, xmm13 mulsd xmm3, xmm13 - addsd xmm6, QWORD PTR [__svml_dacos_ha_data_internal+512] + addsd xmm6, QWORD PTR [__jsvml_dacos_ha_data_internal+512] mulsd xmm6, xmm13 movaps xmm14, xmm1 - mulsd xmm14, QWORD PTR [__svml_dacos_ha_data_internal+1088] - addsd xmm6, QWORD PTR [__svml_dacos_ha_data_internal+576] - addsd xmm14, QWORD PTR [__svml_dacos_ha_data_internal+1152] + mulsd xmm14, QWORD PTR [__jsvml_dacos_ha_data_internal+1088] + addsd xmm6, QWORD PTR [__jsvml_dacos_ha_data_internal+576] + addsd xmm14, QWORD PTR [__jsvml_dacos_ha_data_internal+1152] mulsd xmm6, xmm13 movaps xmm13, xmm1 - addsd xmm6, QWORD PTR [__svml_dacos_ha_data_internal+640] - mulsd xmm13, QWORD PTR [__svml_dacos_ha_data_internal+960] + addsd xmm6, QWORD PTR [__jsvml_dacos_ha_data_internal+640] + mulsd xmm13, QWORD PTR [__jsvml_dacos_ha_data_internal+960] mulsd xmm6, xmm3 - addsd xmm13, QWORD PTR [__svml_dacos_ha_data_internal+1024] + addsd xmm13, QWORD PTR [__jsvml_dacos_ha_data_internal+1024] subsd xmm6, xmm12 movaps xmm12, xmm1 movaps xmm3, xmm1 - mulsd xmm12, QWORD PTR [__svml_dacos_ha_data_internal+704] + mulsd xmm12, QWORD PTR [__jsvml_dacos_ha_data_internal+704] mulsd xmm3, xmm1 - addsd xmm12, QWORD PTR [__svml_dacos_ha_data_internal+768] + addsd xmm12, QWORD PTR [__jsvml_dacos_ha_data_internal+768] mulsd xmm13, xmm3 mulsd xmm12, xmm3 addsd xmm13, xmm14 @@ -339,20 +339,20 @@ L20:: movaps xmm4, xmm3 movaps xmm14, xmm1 mulsd xmm4, xmm3 - mulsd xmm14, QWORD PTR [__svml_dacos_ha_data_internal+1216] + mulsd xmm14, QWORD PTR [__jsvml_dacos_ha_data_internal+1216] mulsd xmm12, xmm4 - addsd xmm14, QWORD PTR [__svml_dacos_ha_data_internal+1280] + addsd xmm14, QWORD PTR [__jsvml_dacos_ha_data_internal+1280] addsd xmm12, xmm13 mulsd xmm12, xmm3 - movsd xmm3, QWORD PTR [__svml_dacos_ha_data_internal+1472] + movsd xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+1472] addsd xmm12, xmm14 mulsd xmm12, xmm1 - movsd xmm4, QWORD PTR [__svml_dacos_ha_data_internal+1536] - movsd xmm13, QWORD PTR [__svml_dacos_ha_data_internal+1600] - movsd xmm14, QWORD PTR [__svml_dacos_ha_data_internal+1664] - addsd xmm12, QWORD PTR [__svml_dacos_ha_data_internal+1344] + movsd xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+1536] + movsd xmm13, QWORD PTR [__jsvml_dacos_ha_data_internal+1600] + movsd xmm14, QWORD PTR [__jsvml_dacos_ha_data_internal+1664] + addsd xmm12, QWORD PTR [__jsvml_dacos_ha_data_internal+1344] mulsd xmm12, xmm1 - addsd xmm12, QWORD PTR [__svml_dacos_ha_data_internal+1408] + addsd xmm12, QWORD PTR [__jsvml_dacos_ha_data_internal+1408] mulsd xmm12, xmm1 cmpnltsd xmm1, xmm0 andps xmm1, xmm5 @@ -406,19 +406,19 @@ _B2_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B2_4 ALIGN 16 _B2_7:: -__svml_acos1_ha_ex ENDP +__jsvml_acos1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos1_ha_ex_B1_B6: +_unwind___jsvml_acos1_ha_ex_B1_B6: DD 1066753 DD 1430599 DD 944191 @@ -436,7 +436,7 @@ _unwind___svml_acos1_ha_ex_B1_B6: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_acos1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_acos1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -450,9 +450,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos1_ha_e9 + PUBLIC __jsvml_acos1_ha_e9 -__svml_acos1_ha_e9 PROC EXPORT +__jsvml_acos1_ha_e9 PROC EXPORT _B3_1:: @@ -472,12 +472,12 @@ L35:: vmovups XMMWORD PTR [176+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm14, QWORD PTR [__svml_dacos_ha_data_internal] + vmovsd xmm14, QWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 - vmovsd xmm3, QWORD PTR [__svml_dacos_ha_data_internal+64] + vmovsd xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+64] vorpd xmm7, xmm14, xmm15 vmulsd xmm5, xmm7, xmm3 - vcmpngesd xmm13, xmm7, QWORD PTR [__svml_dacos_ha_data_internal+256] + vcmpngesd xmm13, xmm7, QWORD PTR [__jsvml_dacos_ha_data_internal+256] vmulsd xmm4, xmm7, xmm7 vmovmskpd eax, xmm13 vaddsd xmm8, xmm5, xmm3 @@ -490,9 +490,9 @@ L35:: vrsqrtps xmm1, xmm3 vcmpnltsd xmm6, xmm4, xmm8 vcvtps2pd xmm0, xmm1 - vcmpltsd xmm2, xmm8, QWORD PTR [__svml_dacos_ha_data_internal+128] + vcmpltsd xmm2, xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal+128] vaddsd xmm8, xmm8, xmm8 - vmovsd xmm5, QWORD PTR [__svml_dacos_ha_data_internal+320] + vmovsd xmm5, QWORD PTR [__jsvml_dacos_ha_data_internal+320] vandpd xmm8, xmm8, xmm6 vandnpd xmm13, xmm2, xmm0 vandpd xmm3, xmm8, xmm5 @@ -502,53 +502,53 @@ L35:: vmulsd xmm3, xmm1, xmm13 vmulsd xmm2, xmm8, xmm13 vmulsd xmm0, xmm3, xmm13 - vsubsd xmm13, xmm2, QWORD PTR [__svml_dacos_ha_data_internal+384] + vsubsd xmm13, xmm2, QWORD PTR [__jsvml_dacos_ha_data_internal+384] vaddsd xmm2, xmm8, xmm3 vaddsd xmm5, xmm13, xmm0 - vmovsd xmm13, QWORD PTR [__svml_dacos_ha_data_internal+448] + vmovsd xmm13, QWORD PTR [__jsvml_dacos_ha_data_internal+448] vmulsd xmm1, xmm13, xmm5 vmulsd xmm13, xmm2, xmm5 - vaddsd xmm0, xmm1, QWORD PTR [__svml_dacos_ha_data_internal+512] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_dacos_ha_data_internal+512] vmulsd xmm1, xmm0, xmm5 - vmulsd xmm0, xmm4, QWORD PTR [__svml_dacos_ha_data_internal+960] - vaddsd xmm2, xmm1, QWORD PTR [__svml_dacos_ha_data_internal+576] - vmulsd xmm1, xmm4, QWORD PTR [__svml_dacos_ha_data_internal+832] - vaddsd xmm0, xmm0, QWORD PTR [__svml_dacos_ha_data_internal+1024] + vmulsd xmm0, xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+960] + vaddsd xmm2, xmm1, QWORD PTR [__jsvml_dacos_ha_data_internal+576] + vmulsd xmm1, xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+832] + vaddsd xmm0, xmm0, QWORD PTR [__jsvml_dacos_ha_data_internal+1024] vmulsd xmm5, xmm2, xmm5 vmulsd xmm2, xmm4, xmm4 - vaddsd xmm5, xmm5, QWORD PTR [__svml_dacos_ha_data_internal+640] + vaddsd xmm5, xmm5, QWORD PTR [__jsvml_dacos_ha_data_internal+640] vmulsd xmm13, xmm5, xmm13 - vaddsd xmm5, xmm1, QWORD PTR [__svml_dacos_ha_data_internal+896] - vmulsd xmm1, xmm4, QWORD PTR [__svml_dacos_ha_data_internal+1088] + vaddsd xmm5, xmm1, QWORD PTR [__jsvml_dacos_ha_data_internal+896] + vmulsd xmm1, xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+1088] vsubsd xmm13, xmm13, xmm3 - vmulsd xmm3, xmm4, QWORD PTR [__svml_dacos_ha_data_internal+704] - vaddsd xmm1, xmm1, QWORD PTR [__svml_dacos_ha_data_internal+1152] - vaddsd xmm3, xmm3, QWORD PTR [__svml_dacos_ha_data_internal+768] + vmulsd xmm3, xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+704] + vaddsd xmm1, xmm1, QWORD PTR [__jsvml_dacos_ha_data_internal+1152] + vaddsd xmm3, xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+768] vmulsd xmm3, xmm3, xmm2 vaddsd xmm3, xmm3, xmm5 vmulsd xmm5, xmm0, xmm2 vmulsd xmm0, xmm2, xmm2 vaddsd xmm1, xmm5, xmm1 - vmulsd xmm5, xmm4, QWORD PTR [__svml_dacos_ha_data_internal+1216] + vmulsd xmm5, xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+1216] vmulsd xmm3, xmm3, xmm0 - vaddsd xmm5, xmm5, QWORD PTR [__svml_dacos_ha_data_internal+1280] + vaddsd xmm5, xmm5, QWORD PTR [__jsvml_dacos_ha_data_internal+1280] vaddsd xmm1, xmm3, xmm1 vmulsd xmm2, xmm1, xmm2 vaddsd xmm5, xmm2, xmm5 vmulsd xmm3, xmm5, xmm4 - vaddsd xmm1, xmm3, QWORD PTR [__svml_dacos_ha_data_internal+1344] + vaddsd xmm1, xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+1344] vmulsd xmm2, xmm1, xmm4 - vmovsd xmm3, QWORD PTR [__svml_dacos_ha_data_internal+1472] - vaddsd xmm0, xmm2, QWORD PTR [__svml_dacos_ha_data_internal+1408] + vmovsd xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+1472] + vaddsd xmm0, xmm2, QWORD PTR [__jsvml_dacos_ha_data_internal+1408] vmulsd xmm5, xmm0, xmm4 vcmpnltsd xmm4, xmm4, xmm15 - vmovsd xmm2, QWORD PTR [__svml_dacos_ha_data_internal+1536] + vmovsd xmm2, QWORD PTR [__jsvml_dacos_ha_data_internal+1536] vandpd xmm4, xmm4, xmm6 - vmovsd xmm0, QWORD PTR [__svml_dacos_ha_data_internal+1600] + vmovsd xmm0, QWORD PTR [__jsvml_dacos_ha_data_internal+1600] vandpd xmm1, xmm3, xmm4 vandpd xmm3, xmm2, xmm4 vandnpd xmm2, xmm6, xmm0 - vmovsd xmm4, QWORD PTR [__svml_dacos_ha_data_internal+1664] + vmovsd xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal+1664] vorpd xmm1, xmm2, xmm1 vandnpd xmm4, xmm6, xmm4 vandnpd xmm6, xmm6, xmm7 @@ -593,19 +593,19 @@ _B3_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B3_4 ALIGN 16 _B3_7:: -__svml_acos1_ha_e9 ENDP +__jsvml_acos1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos1_ha_e9_B1_B6: +_unwind___jsvml_acos1_ha_e9_B1_B6: DD 1068289 DD 1430605 DD 747589 @@ -623,7 +623,7 @@ _unwind___svml_acos1_ha_e9_B1_B6: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_acos1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_acos1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -637,9 +637,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos4_ha_l9 + PUBLIC __jsvml_acos4_ha_l9 -__svml_acos4_ha_l9 PROC EXPORT +__jsvml_acos4_ha_l9 PROC EXPORT _B4_1:: @@ -658,65 +658,65 @@ L50:: vmovups YMMWORD PTR [400+rsp], ymm7 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm5, YMMWORD PTR [__svml_dacos_ha_data_internal] + vmovupd ymm5, YMMWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 - vmovupd ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+64] + vmovupd ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+64] vmovdqa ymm7, ymm0 vorpd ymm1, ymm5, ymm7 vfmadd231pd ymm4, ymm4, ymm1 vmulpd ymm3, ymm1, ymm1 - vcmpnge_uqpd ymm2, ymm1, YMMWORD PTR [__svml_dacos_ha_data_internal+256] + vcmpnge_uqpd ymm2, ymm1, YMMWORD PTR [__jsvml_dacos_ha_data_internal+256] vcvtpd2ps xmm8, ymm4 vminpd ymm10, ymm3, ymm4 - vcmplt_oqpd ymm3, ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+128] + vcmplt_oqpd ymm3, ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+128] vrsqrtps xmm0, xmm8 vcvtps2pd ymm9, xmm0 vandnpd ymm11, ymm3, ymm9 vmulpd ymm12, ymm11, ymm11 - vmovupd ymm9, YMMWORD PTR [__svml_dacos_ha_data_internal+704] + vmovupd ymm9, YMMWORD PTR [__jsvml_dacos_ha_data_internal+704] vmovmskpd edx, ymm2 vcmpnlt_uqpd ymm2, ymm10, ymm4 test edx, edx vaddpd ymm4, ymm4, ymm4 - vfmadd213pd ymm9, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+768] + vfmadd213pd ymm9, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+768] vandpd ymm0, ymm4, ymm2 - vfmsub213pd ymm12, ymm0, YMMWORD PTR [__svml_dacos_ha_data_internal+384] - vmovupd ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+448] + vfmsub213pd ymm12, ymm0, YMMWORD PTR [__jsvml_dacos_ha_data_internal+384] + vmovupd ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+448] vmulpd ymm3, ymm11, ymm0 - vfmadd213pd ymm4, ymm12, YMMWORD PTR [__svml_dacos_ha_data_internal+512] + vfmadd213pd ymm4, ymm12, YMMWORD PTR [__jsvml_dacos_ha_data_internal+512] vfmsub213pd ymm0, ymm11, ymm3 vmulpd ymm8, ymm12, ymm3 - vmovupd ymm11, YMMWORD PTR [__svml_dacos_ha_data_internal+832] - vfmadd213pd ymm4, ymm12, YMMWORD PTR [__svml_dacos_ha_data_internal+576] - vfmadd213pd ymm11, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+896] - vfmadd213pd ymm4, ymm12, YMMWORD PTR [__svml_dacos_ha_data_internal+640] - vmovupd ymm12, YMMWORD PTR [__svml_dacos_ha_data_internal+1088] + vmovupd ymm11, YMMWORD PTR [__jsvml_dacos_ha_data_internal+832] + vfmadd213pd ymm4, ymm12, YMMWORD PTR [__jsvml_dacos_ha_data_internal+576] + vfmadd213pd ymm11, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+896] + vfmadd213pd ymm4, ymm12, YMMWORD PTR [__jsvml_dacos_ha_data_internal+640] + vmovupd ymm12, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1088] vfmsub213pd ymm4, ymm8, ymm0 - vmovupd ymm8, YMMWORD PTR [__svml_dacos_ha_data_internal+960] + vmovupd ymm8, YMMWORD PTR [__jsvml_dacos_ha_data_internal+960] vmulpd ymm0, ymm10, ymm10 - vfmadd213pd ymm12, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1152] - vfmadd213pd ymm8, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1024] + vfmadd213pd ymm12, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1152] + vfmadd213pd ymm8, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1024] vfmadd213pd ymm9, ymm0, ymm11 vmulpd ymm11, ymm0, ymm0 vfmadd213pd ymm8, ymm0, ymm12 - vmovupd ymm12, YMMWORD PTR [__svml_dacos_ha_data_internal+1216] + vmovupd ymm12, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1216] vfmadd213pd ymm9, ymm11, ymm8 - vfmadd213pd ymm12, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1280] + vfmadd213pd ymm12, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1280] vfmadd213pd ymm9, ymm0, ymm12 - vfmadd213pd ymm9, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1344] - vfmadd213pd ymm9, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1408] + vfmadd213pd ymm9, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1344] + vfmadd213pd ymm9, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1408] vmulpd ymm0, ymm10, ymm9 vcmpnlt_uqpd ymm9, ymm10, ymm7 vandpd ymm10, ymm9, ymm2 - vandpd ymm12, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1472] - vandnpd ymm8, ymm2, YMMWORD PTR [__svml_dacos_ha_data_internal+1600] + vandpd ymm12, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1472] + vandnpd ymm8, ymm2, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1600] vandpd ymm5, ymm5, ymm7 vandnpd ymm9, ymm2, ymm1 vorpd ymm1, ymm8, ymm12 vxorpd ymm1, ymm1, ymm5 vorpd ymm3, ymm3, ymm9 - vandpd ymm11, ymm10, YMMWORD PTR [__svml_dacos_ha_data_internal+1536] - vandnpd ymm10, ymm2, YMMWORD PTR [__svml_dacos_ha_data_internal+1664] + vandpd ymm11, ymm10, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1536] + vandnpd ymm10, ymm2, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1664] vsubpd ymm2, ymm3, ymm4 vsubpd ymm4, ymm1, ymm4 vfmadd213pd ymm0, ymm2, ymm4 @@ -784,19 +784,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_acos4_ha_l9 ENDP +__jsvml_acos4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos4_ha_l9_B1_B3: +_unwind___jsvml_acos4_ha_l9_B1_B3: DD 1067265 DD 4379721 DD 1669185 @@ -814,13 +814,13 @@ _unwind___svml_acos4_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_acos4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acos4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos4_ha_l9_B6_B10: +_unwind___jsvml_acos4_ha_l9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -830,7 +830,7 @@ _unwind___svml_acos4_ha_l9_B6_B10: DD 550923 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_acos4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acos4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -839,7 +839,7 @@ _unwind___svml_acos4_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_acos4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_acos4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -853,9 +853,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos2_ha_e9 + PUBLIC __jsvml_acos2_ha_e9 -__svml_acos2_ha_e9 PROC EXPORT +__jsvml_acos2_ha_e9 PROC EXPORT _B5_1:: @@ -875,17 +875,17 @@ L77:: vmovups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm14, XMMWORD PTR [__svml_dacos_ha_data_internal] + vmovupd xmm14, XMMWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 - vmovupd xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal+64] + vmovupd xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal+64] vorpd xmm6, xmm14, xmm15 vmulpd xmm4, xmm6, xmm5 vmulpd xmm3, xmm6, xmm6 vaddpd xmm8, xmm5, xmm4 - vcmpngepd xmm2, xmm6, XMMWORD PTR [__svml_dacos_ha_data_internal+256] + vcmpngepd xmm2, xmm6, XMMWORD PTR [__jsvml_dacos_ha_data_internal+256] vcvtpd2ps xmm1, xmm8 vminpd xmm4, xmm3, xmm8 - vcmpltpd xmm3, xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+128] + vcmpltpd xmm3, xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+128] vmovmskpd edx, xmm2 vcmpnltpd xmm7, xmm4, xmm8 vaddpd xmm8, xmm8, xmm8 @@ -893,57 +893,57 @@ L77:: vandpd xmm1, xmm8, xmm7 vrsqrtps xmm9, xmm5 vcvtps2pd xmm2, xmm9 - vandpd xmm0, xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+320] + vandpd xmm0, xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+320] vandnpd xmm9, xmm3, xmm2 vsubpd xmm5, xmm1, xmm0 vmulpd xmm8, xmm9, xmm0 vmulpd xmm3, xmm9, xmm5 vmulpd xmm2, xmm9, xmm8 vmulpd xmm9, xmm9, xmm3 - vsubpd xmm1, xmm2, XMMWORD PTR [__svml_dacos_ha_data_internal+384] + vsubpd xmm1, xmm2, XMMWORD PTR [__jsvml_dacos_ha_data_internal+384] vaddpd xmm5, xmm9, xmm1 vaddpd xmm9, xmm8, xmm3 - vmulpd xmm0, xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal+448] + vmulpd xmm0, xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal+448] vmulpd xmm9, xmm5, xmm9 - vaddpd xmm2, xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+512] + vaddpd xmm2, xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+512] vmulpd xmm1, xmm5, xmm2 - vaddpd xmm0, xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+576] - vmulpd xmm1, xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+960] + vaddpd xmm0, xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+576] + vmulpd xmm1, xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+960] vmulpd xmm5, xmm5, xmm0 - vaddpd xmm0, xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1024] - vaddpd xmm5, xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal+640] - vmulpd xmm1, xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+1088] + vaddpd xmm0, xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1024] + vaddpd xmm5, xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal+640] + vmulpd xmm1, xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1088] vmulpd xmm9, xmm9, xmm5 - vmulpd xmm5, xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+832] + vmulpd xmm5, xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+832] vsubpd xmm9, xmm9, xmm3 - vaddpd xmm1, xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1152] - vaddpd xmm5, xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal+896] - vmulpd xmm3, xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+704] - vaddpd xmm2, xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+768] + vaddpd xmm1, xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1152] + vaddpd xmm5, xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal+896] + vmulpd xmm3, xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+704] + vaddpd xmm2, xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+768] vmulpd xmm3, xmm4, xmm4 vmulpd xmm0, xmm3, xmm0 vmulpd xmm2, xmm2, xmm3 vaddpd xmm1, xmm1, xmm0 vaddpd xmm2, xmm5, xmm2 vmulpd xmm0, xmm3, xmm3 - vmulpd xmm5, xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+1216] + vmulpd xmm5, xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1216] vmulpd xmm2, xmm2, xmm0 - vaddpd xmm5, xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal+1280] + vaddpd xmm5, xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1280] vaddpd xmm0, xmm1, xmm2 vmulpd xmm3, xmm3, xmm0 vaddpd xmm5, xmm5, xmm3 vmulpd xmm3, xmm4, xmm5 - vaddpd xmm2, xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+1344] + vaddpd xmm2, xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1344] vmulpd xmm0, xmm4, xmm2 - vaddpd xmm1, xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+1408] + vaddpd xmm1, xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1408] vmulpd xmm5, xmm4, xmm1 vcmpnltpd xmm4, xmm4, xmm15 vandpd xmm3, xmm4, xmm7 vandpd xmm14, xmm14, xmm15 - vandpd xmm2, xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+1472] - vandpd xmm4, xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+1536] - vandnpd xmm0, xmm7, XMMWORD PTR [__svml_dacos_ha_data_internal+1600] - vandnpd xmm3, xmm7, XMMWORD PTR [__svml_dacos_ha_data_internal+1664] + vandpd xmm2, xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1472] + vandpd xmm4, xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1536] + vandnpd xmm0, xmm7, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1600] + vandnpd xmm3, xmm7, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1664] vandnpd xmm7, xmm7, xmm6 vorpd xmm1, xmm0, xmm2 vorpd xmm0, xmm8, xmm7 @@ -1008,19 +1008,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_acos2_ha_e9 ENDP +__jsvml_acos2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos2_ha_e9_B1_B3: +_unwind___jsvml_acos2_ha_e9_B1_B3: DD 1068289 DD 2413645 DD 1009733 @@ -1038,19 +1038,19 @@ _unwind___svml_acos2_ha_e9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_acos2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acos2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos2_ha_e9_B6_B10: +_unwind___jsvml_acos2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_acos2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acos2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1059,7 +1059,7 @@ _unwind___svml_acos2_ha_e9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_acos2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_acos2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1073,9 +1073,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos4_ha_e9 + PUBLIC __jsvml_acos4_ha_e9 -__svml_acos4_ha_e9 PROC EXPORT +__jsvml_acos4_ha_e9 PROC EXPORT _B6_1:: @@ -1094,14 +1094,14 @@ L96:: vmovups YMMWORD PTR [336+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm14, YMMWORD PTR [__svml_dacos_ha_data_internal] + vmovupd ymm14, YMMWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 - vmovupd ymm5, YMMWORD PTR [__svml_dacos_ha_data_internal+64] + vmovupd ymm5, YMMWORD PTR [__jsvml_dacos_ha_data_internal+64] vmovapd ymm15, ymm0 vorpd ymm7, ymm14, ymm15 vmulpd ymm4, ymm7, ymm5 vmulpd ymm2, ymm7, ymm7 - vcmpnge_uqpd ymm3, ymm7, YMMWORD PTR [__svml_dacos_ha_data_internal+256] + vcmpnge_uqpd ymm3, ymm7, YMMWORD PTR [__jsvml_dacos_ha_data_internal+256] vaddpd ymm8, ymm5, ymm4 vcvtpd2ps xmm13, ymm8 vminpd ymm4, ymm2, ymm8 @@ -1112,59 +1112,59 @@ L96:: mov QWORD PTR [536+rsp], r13 vextractf128 xmm1, ymm3, 1 vshufps xmm5, xmm3, xmm1, 221 - vcmplt_oqpd ymm3, ymm8, YMMWORD PTR [__svml_dacos_ha_data_internal+128] + vcmplt_oqpd ymm3, ymm8, YMMWORD PTR [__jsvml_dacos_ha_data_internal+128] vaddpd ymm8, ymm8, ymm8 vmovmskps edx, xmm5 vandpd ymm1, ymm8, ymm6 vandnpd ymm13, ymm3, ymm0 - vandpd ymm5, ymm1, YMMWORD PTR [__svml_dacos_ha_data_internal+320] + vandpd ymm5, ymm1, YMMWORD PTR [__jsvml_dacos_ha_data_internal+320] vsubpd ymm2, ymm1, ymm5 vmulpd ymm8, ymm13, ymm5 vmulpd ymm2, ymm13, ymm2 vmulpd ymm3, ymm13, ymm8 vmulpd ymm13, ymm13, ymm2 - vsubpd ymm0, ymm3, YMMWORD PTR [__svml_dacos_ha_data_internal+384] + vsubpd ymm0, ymm3, YMMWORD PTR [__jsvml_dacos_ha_data_internal+384] vaddpd ymm5, ymm13, ymm0 vaddpd ymm13, ymm8, ymm2 - vmulpd ymm1, ymm5, YMMWORD PTR [__svml_dacos_ha_data_internal+448] + vmulpd ymm1, ymm5, YMMWORD PTR [__jsvml_dacos_ha_data_internal+448] vmulpd ymm13, ymm5, ymm13 - vaddpd ymm3, ymm1, YMMWORD PTR [__svml_dacos_ha_data_internal+512] + vaddpd ymm3, ymm1, YMMWORD PTR [__jsvml_dacos_ha_data_internal+512] vmulpd ymm0, ymm5, ymm3 - vaddpd ymm1, ymm0, YMMWORD PTR [__svml_dacos_ha_data_internal+576] - vmulpd ymm0, ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+960] + vaddpd ymm1, ymm0, YMMWORD PTR [__jsvml_dacos_ha_data_internal+576] + vmulpd ymm0, ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+960] vmulpd ymm5, ymm5, ymm1 - vmulpd ymm1, ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+1088] - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_dacos_ha_data_internal+1024] - vaddpd ymm5, ymm5, YMMWORD PTR [__svml_dacos_ha_data_internal+640] - vaddpd ymm1, ymm1, YMMWORD PTR [__svml_dacos_ha_data_internal+1152] + vmulpd ymm1, ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1088] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1024] + vaddpd ymm5, ymm5, YMMWORD PTR [__jsvml_dacos_ha_data_internal+640] + vaddpd ymm1, ymm1, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1152] vmulpd ymm13, ymm13, ymm5 - vmulpd ymm5, ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+832] + vmulpd ymm5, ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+832] vsubpd ymm13, ymm13, ymm2 - vaddpd ymm5, ymm5, YMMWORD PTR [__svml_dacos_ha_data_internal+896] - vmulpd ymm2, ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+704] - vaddpd ymm3, ymm2, YMMWORD PTR [__svml_dacos_ha_data_internal+768] + vaddpd ymm5, ymm5, YMMWORD PTR [__jsvml_dacos_ha_data_internal+896] + vmulpd ymm2, ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+704] + vaddpd ymm3, ymm2, YMMWORD PTR [__jsvml_dacos_ha_data_internal+768] vmulpd ymm2, ymm4, ymm4 vmulpd ymm3, ymm3, ymm2 vaddpd ymm3, ymm5, ymm3 vmulpd ymm5, ymm2, ymm0 vaddpd ymm0, ymm1, ymm5 vmulpd ymm1, ymm2, ymm2 - vmulpd ymm5, ymm4, YMMWORD PTR [__svml_dacos_ha_data_internal+1216] + vmulpd ymm5, ymm4, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1216] vmulpd ymm3, ymm3, ymm1 - vaddpd ymm5, ymm5, YMMWORD PTR [__svml_dacos_ha_data_internal+1280] + vaddpd ymm5, ymm5, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1280] vaddpd ymm0, ymm0, ymm3 vmulpd ymm2, ymm2, ymm0 vaddpd ymm5, ymm5, ymm2 vmulpd ymm2, ymm4, ymm5 - vaddpd ymm3, ymm2, YMMWORD PTR [__svml_dacos_ha_data_internal+1344] + vaddpd ymm3, ymm2, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1344] vmulpd ymm0, ymm4, ymm3 - vaddpd ymm1, ymm0, YMMWORD PTR [__svml_dacos_ha_data_internal+1408] + vaddpd ymm1, ymm0, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1408] vmulpd ymm5, ymm4, ymm1 vcmpnlt_uqpd ymm4, ymm4, ymm15 vandpd ymm2, ymm4, ymm6 - vandpd ymm3, ymm2, YMMWORD PTR [__svml_dacos_ha_data_internal+1472] - vandnpd ymm0, ymm6, YMMWORD PTR [__svml_dacos_ha_data_internal+1600] - vandnpd ymm4, ymm6, YMMWORD PTR [__svml_dacos_ha_data_internal+1664] + vandpd ymm3, ymm2, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1472] + vandnpd ymm0, ymm6, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1600] + vandnpd ymm4, ymm6, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1664] vandnpd ymm6, ymm6, ymm7 vorpd ymm1, ymm0, ymm3 vorpd ymm0, ymm8, ymm6 @@ -1173,7 +1173,7 @@ L96:: vxorpd ymm3, ymm1, ymm14 vsubpd ymm3, ymm3, ymm13 vaddpd ymm1, ymm3, ymm5 - vandpd ymm2, ymm2, YMMWORD PTR [__svml_dacos_ha_data_internal+1536] + vandpd ymm2, ymm2, YMMWORD PTR [__jsvml_dacos_ha_data_internal+1536] vorpd ymm7, ymm4, ymm2 vaddpd ymm2, ymm0, ymm1 vxorpd ymm14, ymm2, ymm14 @@ -1238,19 +1238,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_acos4_ha_e9 ENDP +__jsvml_acos4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos4_ha_e9_B1_B3: +_unwind___jsvml_acos4_ha_e9_B1_B3: DD 1067265 DD 4379721 DD 1402945 @@ -1268,13 +1268,13 @@ _unwind___svml_acos4_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_acos4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acos4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos4_ha_e9_B6_B10: +_unwind___jsvml_acos4_ha_e9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -1284,7 +1284,7 @@ _unwind___svml_acos4_ha_e9_B6_B10: DD 563211 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_acos4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acos4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1293,7 +1293,7 @@ _unwind___svml_acos4_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_acos4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_acos4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1307,9 +1307,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos8_ha_z0 + PUBLIC __jsvml_acos8_ha_z0 -__svml_acos8_ha_z0 PROC EXPORT +__jsvml_acos8_ha_z0 PROC EXPORT _B7_1:: @@ -1319,74 +1319,74 @@ _B7_1:: DB 250 L123:: - vmovups zmm23, ZMMWORD PTR [__svml_dacos_ha_data_internal] - vmovups zmm27, ZMMWORD PTR [__svml_dacos_ha_data_internal+64] - vmovups zmm26, ZMMWORD PTR [__svml_dacos_ha_data_internal+128] - vmovups zmm30, ZMMWORD PTR [__svml_dacos_ha_data_internal+448] - vmovups zmm1, ZMMWORD PTR [__svml_dacos_ha_data_internal+512] - vmovups zmm31, ZMMWORD PTR [__svml_dacos_ha_data_internal+576] - vmovups zmm25, ZMMWORD PTR [__svml_dacos_ha_data_internal+256] + vmovups zmm23, ZMMWORD PTR [__jsvml_dacos_ha_data_internal] + vmovups zmm27, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+64] + vmovups zmm26, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+128] + vmovups zmm30, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+448] + vmovups zmm1, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+512] + vmovups zmm31, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+576] + vmovups zmm25, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+256] vmovaps zmm22, zmm0 vorpd zmm5, zmm23, zmm22 vandpd zmm4, zmm23, zmm22 - vmovups zmm0, ZMMWORD PTR [__svml_dacos_ha_data_internal+384] + vmovups zmm0, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+384] vfmadd231pd zmm27, zmm27, zmm5 {rn-sae} vmulpd zmm24, zmm5, zmm5 {rn-sae} vrsqrt14pd zmm29, zmm27 vcmppd k3, zmm27, zmm26, 17 {sae} vcmppd k2, zmm5, zmm25, 17 {sae} - vmovups zmm26, ZMMWORD PTR [__svml_dacos_ha_data_internal+960] - vmovups zmm25, ZMMWORD PTR [__svml_dacos_ha_data_internal+832] + vmovups zmm26, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+960] + vmovups zmm25, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+832] vminpd zmm3, zmm24, zmm27 {sae} - vmovups zmm24, ZMMWORD PTR [__svml_dacos_ha_data_internal+704] + vmovups zmm24, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+704] vxorpd zmm29{k3}, zmm29, zmm29 vaddpd zmm23, zmm27, zmm27 {rn-sae} vcmppd k1, zmm3, zmm27, 21 {sae} vmulpd zmm28, zmm29, zmm29 {rn-sae} vmulpd zmm2, zmm23, zmm29 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dacos_ha_data_internal+1088] - vorpd zmm3{k2}, zmm3, ZMMWORD PTR [__svml_dacos_ha_data_internal+1856] + vmovups zmm27, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1088] + vorpd zmm3{k2}, zmm3, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1856] vfmsub231pd zmm0, zmm28, zmm23 {rn-sae} vfmsub213pd zmm23, zmm29, zmm2 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_dacos_ha_data_internal+640] + vmovups zmm28, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+640] vcmppd k2{k1}, zmm3, zmm22, 21 {sae} vmulpd zmm29, zmm2, zmm0 {rn-sae} vfmadd231pd zmm1, zmm30, zmm0 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dacos_ha_data_internal+896] - vmovups zmm22, ZMMWORD PTR [__svml_dacos_ha_data_internal+1728] + vmovups zmm30, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+896] + vmovups zmm22, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1728] vfmadd213pd zmm1, zmm0, zmm31 {rn-sae} vfmadd231pd zmm30, zmm25, zmm3 {rn-sae} - vmovups zmm31, ZMMWORD PTR [__svml_dacos_ha_data_internal+1216] - vmovups zmm25, ZMMWORD PTR [__svml_dacos_ha_data_internal+1280] + vmovups zmm31, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1216] + vmovups zmm25, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1280] vfmadd213pd zmm1, zmm0, zmm28 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dacos_ha_data_internal+768] - vmovups zmm28, ZMMWORD PTR [__svml_dacos_ha_data_internal+1408] + vmovups zmm0, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+768] + vmovups zmm28, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1408] vfmadd231pd zmm25, zmm31, zmm3 {rn-sae} vfmsub213pd zmm1, zmm29, zmm23 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_dacos_ha_data_internal+1024] + vmovups zmm23, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1024] vfmadd231pd zmm0, zmm24, zmm3 {rn-sae} vmulpd zmm24, zmm3, zmm3 {rn-sae} vfmadd231pd zmm23, zmm26, zmm3 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_dacos_ha_data_internal+1152] + vmovups zmm26, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1152] vblendmpd zmm1{k1}, zmm22, zmm1 vblendmpd zmm22{k1}, zmm5, zmm2 vfmadd213pd zmm0, zmm24, zmm30 {rn-sae} vfmadd231pd zmm26, zmm27, zmm3 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dacos_ha_data_internal+1344] + vmovups zmm27, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1344] vsubpd zmm2, zmm22, zmm1 {rn-sae} vfmadd213pd zmm23, zmm24, zmm26 {rn-sae} vmulpd zmm26, zmm24, zmm24 {rn-sae} vfmadd213pd zmm0, zmm26, zmm23 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_dacos_ha_data_internal+1664] + vmovups zmm23, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1664] vfmadd213pd zmm0, zmm24, zmm25 {rn-sae} vxorpd zmm23{k1}, zmm23, zmm23 vfmadd213pd zmm0, zmm3, zmm27 {rn-sae} - vorpd zmm23{k2}, zmm23, ZMMWORD PTR [__svml_dacos_ha_data_internal+1536] + vorpd zmm23{k2}, zmm23, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1536] vfmadd213pd zmm0, zmm3, zmm28 {rn-sae} vmulpd zmm0, zmm0, zmm3 {rn-sae} - vmovups zmm3, ZMMWORD PTR [__svml_dacos_ha_data_internal+1600] + vmovups zmm3, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1600] vxorpd zmm3{k1}, zmm3, zmm3 - vorpd zmm3{k2}, zmm3, ZMMWORD PTR [__svml_dacos_ha_data_internal+1472] + vorpd zmm3{k2}, zmm3, ZMMWORD PTR [__jsvml_dacos_ha_data_internal+1472] vxorpd zmm3, zmm3, zmm4 vsubpd zmm5, zmm3, zmm1 {rn-sae} vfmadd213pd zmm0, zmm2, zmm5 {rn-sae} @@ -1398,7 +1398,7 @@ L123:: _B7_2:: -__svml_acos8_ha_z0 ENDP +__jsvml_acos8_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -1412,9 +1412,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos2_ha_ex + PUBLIC __jsvml_acos2_ha_ex -__svml_acos2_ha_ex PROC EXPORT +__jsvml_acos2_ha_ex PROC EXPORT _B8_1:: @@ -1434,9 +1434,9 @@ L124:: movups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm14, XMMWORD PTR [__svml_dacos_ha_data_internal] + movups xmm14, XMMWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 - movups xmm6, XMMWORD PTR [__svml_dacos_ha_data_internal+64] + movups xmm6, XMMWORD PTR [__jsvml_dacos_ha_data_internal+64] movaps xmm10, xmm14 orps xmm10, xmm15 movaps xmm5, xmm6 @@ -1446,7 +1446,7 @@ L124:: movaps xmm0, xmm6 cvtpd2ps xmm1, xmm6 mulpd xmm8, xmm10 - cmpltpd xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+128] + cmpltpd xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+128] minpd xmm8, xmm6 movlhps xmm1, xmm1 movaps xmm7, xmm8 @@ -1454,70 +1454,70 @@ L124:: cmpnltpd xmm7, xmm6 addpd xmm6, xmm6 cvtps2pd xmm3, xmm2 - movups xmm5, XMMWORD PTR [__svml_dacos_ha_data_internal+320] + movups xmm5, XMMWORD PTR [__jsvml_dacos_ha_data_internal+320] andps xmm6, xmm7 andnps xmm0, xmm3 andps xmm5, xmm6 subpd xmm6, xmm5 mulpd xmm5, xmm0 mulpd xmm6, xmm0 - movups xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+256] + movups xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+256] movaps xmm2, xmm8 cmpnlepd xmm4, xmm10 mulpd xmm2, xmm8 movmskpd eax, xmm4 movaps xmm4, xmm0 andps xmm14, xmm15 - movups xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+448] + movups xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+448] mulpd xmm4, xmm5 mulpd xmm0, xmm6 - subpd xmm4, XMMWORD PTR [__svml_dacos_ha_data_internal+384] + subpd xmm4, XMMWORD PTR [__jsvml_dacos_ha_data_internal+384] addpd xmm0, xmm4 mulpd xmm1, xmm0 - addpd xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+512] + addpd xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+512] mulpd xmm1, xmm0 movaps xmm4, xmm5 - addpd xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+576] + addpd xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+576] addpd xmm4, xmm6 mulpd xmm4, xmm0 mulpd xmm0, xmm1 - addpd xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+640] + addpd xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+640] mulpd xmm4, xmm0 subpd xmm4, xmm6 - movups xmm6, XMMWORD PTR [__svml_dacos_ha_data_internal+704] + movups xmm6, XMMWORD PTR [__jsvml_dacos_ha_data_internal+704] mulpd xmm6, xmm8 - movups xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+832] - addpd xmm6, XMMWORD PTR [__svml_dacos_ha_data_internal+768] + movups xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+832] + addpd xmm6, XMMWORD PTR [__jsvml_dacos_ha_data_internal+768] mulpd xmm3, xmm8 mulpd xmm6, xmm2 - addpd xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+896] - movups xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+960] + addpd xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+896] + movups xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+960] mulpd xmm1, xmm8 addpd xmm3, xmm6 - addpd xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1024] - movups xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+1088] + addpd xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1024] + movups xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1088] movaps xmm6, xmm2 mulpd xmm0, xmm8 mulpd xmm6, xmm2 mulpd xmm1, xmm2 - addpd xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+1152] + addpd xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1152] mulpd xmm3, xmm6 addpd xmm0, xmm1 - movups xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1216] + movups xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1216] mulpd xmm1, xmm8 addpd xmm0, xmm3 - addpd xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1280] + addpd xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1280] mulpd xmm2, xmm0 addpd xmm1, xmm2 mulpd xmm1, xmm8 - addpd xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1344] + addpd xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1344] mulpd xmm1, xmm8 - addpd xmm1, XMMWORD PTR [__svml_dacos_ha_data_internal+1408] + addpd xmm1, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1408] mulpd xmm1, xmm8 cmpnltpd xmm8, xmm15 - movups xmm2, XMMWORD PTR [__svml_dacos_ha_data_internal+1472] + movups xmm2, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1472] andps xmm8, xmm7 - movups xmm3, XMMWORD PTR [__svml_dacos_ha_data_internal+1536] + movups xmm3, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1536] andps xmm2, xmm8 andps xmm3, xmm8 movaps xmm8, xmm7 @@ -1526,14 +1526,14 @@ L124:: orps xmm5, xmm7 movaps xmm7, xmm5 subpd xmm7, xmm4 - andnps xmm8, XMMWORD PTR [__svml_dacos_ha_data_internal+1600] + andnps xmm8, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1600] mulpd xmm1, xmm7 orps xmm8, xmm2 pxor xmm8, xmm14 subpd xmm8, xmm4 addpd xmm8, xmm1 addpd xmm5, xmm8 - andnps xmm0, XMMWORD PTR [__svml_dacos_ha_data_internal+1664] + andnps xmm0, XMMWORD PTR [__jsvml_dacos_ha_data_internal+1664] pxor xmm5, xmm14 orps xmm0, xmm3 mov QWORD PTR [296+rsp], r13 @@ -1592,19 +1592,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_acos2_ha_ex ENDP +__jsvml_acos2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos2_ha_ex_B1_B3: +_unwind___jsvml_acos2_ha_ex_B1_B3: DD 1067777 DD 2413643 DD 878659 @@ -1622,19 +1622,19 @@ _unwind___svml_acos2_ha_ex_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_acos2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_acos2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos2_ha_ex_B6_B10: +_unwind___jsvml_acos2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_acos2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_acos2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1643,7 +1643,7 @@ _unwind___svml_acos2_ha_ex_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_acos2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_acos2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1657,9 +1657,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acos1_ha_l9 + PUBLIC __jsvml_acos1_ha_l9 -__svml_acos1_ha_l9 PROC EXPORT +__jsvml_acos1_ha_l9 PROC EXPORT _B9_1:: @@ -1680,18 +1680,18 @@ L143:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm4, QWORD PTR [__svml_dacos_ha_data_internal] + vmovsd xmm4, QWORD PTR [__jsvml_dacos_ha_data_internal] and r13, -64 vorpd xmm0, xmm4, xmm5 vandpd xmm4, xmm4, xmm5 - vmovsd xmm3, QWORD PTR [__svml_dacos_ha_data_internal+64] + vmovsd xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+64] vmovdqa xmm9, xmm0 vfmadd213sd xmm9, xmm3, xmm3 vmulsd xmm2, xmm0, xmm0 - vcmpngesd xmm8, xmm0, QWORD PTR [__svml_dacos_ha_data_internal+256] + vcmpngesd xmm8, xmm0, QWORD PTR [__jsvml_dacos_ha_data_internal+256] vcvtpd2ps xmm3, xmm9 vmovmskpd eax, xmm8 - vcmpltsd xmm11, xmm9, QWORD PTR [__svml_dacos_ha_data_internal+128] + vcmpltsd xmm11, xmm9, QWORD PTR [__jsvml_dacos_ha_data_internal+128] vmovddup xmm1, xmm2 and eax, 1 vbroadcastss xmm2, xmm3 @@ -1706,43 +1706,43 @@ L143:: vmulsd xmm6, xmm3, xmm3 vmovdqa xmm8, xmm10 vmulsd xmm2, xmm10, xmm3 - vfmsub213sd xmm8, xmm6, QWORD PTR [__svml_dacos_ha_data_internal+384] - vmovsd xmm11, QWORD PTR [__svml_dacos_ha_data_internal+704] + vfmsub213sd xmm8, xmm6, QWORD PTR [__jsvml_dacos_ha_data_internal+384] + vmovsd xmm11, QWORD PTR [__jsvml_dacos_ha_data_internal+704] vmovdqa xmm6, xmm7 vmovapd xmm15, xmm7 vfmsub213sd xmm10, xmm3, xmm2 - vmovsd xmm3, QWORD PTR [__svml_dacos_ha_data_internal+448] - vfmadd213sd xmm3, xmm8, QWORD PTR [__svml_dacos_ha_data_internal+512] + vmovsd xmm3, QWORD PTR [__jsvml_dacos_ha_data_internal+448] + vfmadd213sd xmm3, xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal+512] vmulsd xmm9, xmm2, xmm8 - vfmadd213sd xmm6, xmm11, QWORD PTR [__svml_dacos_ha_data_internal+768] - vfmadd213sd xmm3, xmm8, QWORD PTR [__svml_dacos_ha_data_internal+576] + vfmadd213sd xmm6, xmm11, QWORD PTR [__jsvml_dacos_ha_data_internal+768] + vfmadd213sd xmm3, xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal+576] vmovapd xmm11, xmm7 - vfmadd213sd xmm3, xmm8, QWORD PTR [__svml_dacos_ha_data_internal+640] - vmovsd xmm8, QWORD PTR [__svml_dacos_ha_data_internal+960] - vfmadd213sd xmm11, xmm8, QWORD PTR [__svml_dacos_ha_data_internal+1024] + vfmadd213sd xmm3, xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal+640] + vmovsd xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal+960] + vfmadd213sd xmm11, xmm8, QWORD PTR [__jsvml_dacos_ha_data_internal+1024] vmovapd xmm8, xmm7 vfmsub213sd xmm3, xmm9, xmm10 - vmovsd xmm9, QWORD PTR [__svml_dacos_ha_data_internal+832] - vfmadd213sd xmm15, xmm9, QWORD PTR [__svml_dacos_ha_data_internal+896] - vmovsd xmm9, QWORD PTR [__svml_dacos_ha_data_internal+1088] - vfmadd213sd xmm8, xmm9, QWORD PTR [__svml_dacos_ha_data_internal+1152] + vmovsd xmm9, QWORD PTR [__jsvml_dacos_ha_data_internal+832] + vfmadd213sd xmm15, xmm9, QWORD PTR [__jsvml_dacos_ha_data_internal+896] + vmovsd xmm9, QWORD PTR [__jsvml_dacos_ha_data_internal+1088] + vfmadd213sd xmm8, xmm9, QWORD PTR [__jsvml_dacos_ha_data_internal+1152] vmulsd xmm10, xmm7, xmm7 vfmadd213sd xmm6, xmm10, xmm15 vfmadd213sd xmm11, xmm10, xmm8 vmovapd xmm8, xmm7 vmulsd xmm9, xmm10, xmm10 - vmovsd xmm15, QWORD PTR [__svml_dacos_ha_data_internal+1216] - vfmadd213sd xmm8, xmm15, QWORD PTR [__svml_dacos_ha_data_internal+1280] + vmovsd xmm15, QWORD PTR [__jsvml_dacos_ha_data_internal+1216] + vfmadd213sd xmm8, xmm15, QWORD PTR [__jsvml_dacos_ha_data_internal+1280] vfmadd213sd xmm6, xmm9, xmm11 - vmovsd xmm11, QWORD PTR [__svml_dacos_ha_data_internal+1600] - vmovsd xmm15, QWORD PTR [__svml_dacos_ha_data_internal+1664] + vmovsd xmm11, QWORD PTR [__jsvml_dacos_ha_data_internal+1600] + vmovsd xmm15, QWORD PTR [__jsvml_dacos_ha_data_internal+1664] vfmadd213sd xmm6, xmm10, xmm8 - vmovsd xmm10, QWORD PTR [__svml_dacos_ha_data_internal+1536] - vfmadd213sd xmm6, xmm7, QWORD PTR [__svml_dacos_ha_data_internal+1344] - vfmadd213sd xmm6, xmm7, QWORD PTR [__svml_dacos_ha_data_internal+1408] + vmovsd xmm10, QWORD PTR [__jsvml_dacos_ha_data_internal+1536] + vfmadd213sd xmm6, xmm7, QWORD PTR [__jsvml_dacos_ha_data_internal+1344] + vfmadd213sd xmm6, xmm7, QWORD PTR [__jsvml_dacos_ha_data_internal+1408] vmulsd xmm9, xmm6, xmm7 vcmpnltsd xmm7, xmm7, xmm5 - vmovsd xmm6, QWORD PTR [__svml_dacos_ha_data_internal+1472] + vmovsd xmm6, QWORD PTR [__jsvml_dacos_ha_data_internal+1472] vandpd xmm7, xmm7, xmm1 vandpd xmm8, xmm6, xmm7 vandnpd xmm6, xmm1, xmm11 @@ -1791,19 +1791,19 @@ _B9_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dacos_ha_cout_rare_internal + call __jsvml_dacos_ha_cout_rare_internal jmp _B9_4 ALIGN 16 _B9_7:: -__svml_acos1_ha_l9 ENDP +__jsvml_acos1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acos1_ha_l9_B1_B6: +_unwind___jsvml_acos1_ha_l9_B1_B6: DD 1201665 DD 1430614 DD 1075278 @@ -1822,7 +1822,7 @@ _unwind___svml_acos1_ha_l9_B1_B6: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_acos1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_acos1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1836,9 +1836,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dacos_ha_cout_rare_internal + PUBLIC __jsvml_dacos_ha_cout_rare_internal -__svml_dacos_ha_cout_rare_internal PROC +__jsvml_dacos_ha_cout_rare_internal PROC _B10_1:: @@ -2425,13 +2425,13 @@ _B10_21:: _B10_22:: -__svml_dacos_ha_cout_rare_internal ENDP +__jsvml_dacos_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dacos_ha_cout_rare_internal_B1_B21: +_unwind___jsvml_dacos_ha_cout_rare_internal_B1_B21: DD 621958401 DD 354389 DD 555089 @@ -2450,7 +2450,7 @@ _unwind___svml_dacos_ha_cout_rare_internal_B1_B21: DD imagerel _B10_1 DD imagerel _B10_22 - DD imagerel _unwind___svml_dacos_ha_cout_rare_internal_B1_B21 + DD imagerel _unwind___jsvml_dacos_ha_cout_rare_internal_B1_B21 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2458,8 +2458,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dacos_ha_data_internal -__svml_dacos_ha_data_internal DD 0 + PUBLIC __jsvml_dacos_ha_data_internal +__jsvml_dacos_ha_data_internal DD 0 DD 2147483648 DD 0 DD 2147483648 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_asin_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_asin_windows_x86.S similarity index 80% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_asin_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_asin_windows_x86.S index f80632e2e4d..ef99e539a98 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_asin_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_asin_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin2_ha_e9 + PUBLIC __jsvml_asin2_ha_e9 -__svml_asin2_ha_e9 PROC EXPORT +__jsvml_asin2_ha_e9 PROC EXPORT _B1_1:: @@ -59,71 +59,71 @@ L1:: vmovups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm9, XMMWORD PTR [__svml_dasin_ha_data_internal] + vmovupd xmm9, XMMWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 - vmovupd xmm4, XMMWORD PTR [__svml_dasin_ha_data_internal+64] + vmovupd xmm4, XMMWORD PTR [__jsvml_dasin_ha_data_internal+64] vandpd xmm7, xmm9, xmm10 vmulpd xmm11, xmm7, xmm4 vmulpd xmm3, xmm7, xmm7 vsubpd xmm5, xmm4, xmm11 - vcmpgtpd xmm8, xmm7, XMMWORD PTR [__svml_dasin_ha_data_internal+256] + vcmpgtpd xmm8, xmm7, XMMWORD PTR [__jsvml_dasin_ha_data_internal+256] vcvtpd2ps xmm1, xmm5 vminpd xmm3, xmm3, xmm5 vmovmskpd edx, xmm8 vcmpnltpd xmm8, xmm7, xmm4 - vcmpltpd xmm4, xmm5, XMMWORD PTR [__svml_dasin_ha_data_internal+128] + vcmpltpd xmm4, xmm5, XMMWORD PTR [__jsvml_dasin_ha_data_internal+128] vaddpd xmm5, xmm5, xmm5 vmovlhps xmm2, xmm1, xmm1 vandnpd xmm7, xmm8, xmm7 vrsqrtps xmm11, xmm2 vcvtps2pd xmm6, xmm11 - vandpd xmm11, xmm5, XMMWORD PTR [__svml_dasin_ha_data_internal+320] + vandpd xmm11, xmm5, XMMWORD PTR [__jsvml_dasin_ha_data_internal+320] vandnpd xmm6, xmm4, xmm6 vsubpd xmm1, xmm5, xmm11 vmulpd xmm5, xmm6, xmm11 vmulpd xmm4, xmm6, xmm1 vmulpd xmm0, xmm6, xmm5 vmulpd xmm2, xmm6, xmm4 - vsubpd xmm11, xmm0, XMMWORD PTR [__svml_dasin_ha_data_internal+384] + vsubpd xmm11, xmm0, XMMWORD PTR [__jsvml_dasin_ha_data_internal+384] vaddpd xmm1, xmm5, xmm4 vaddpd xmm11, xmm2, xmm11 - vmulpd xmm6, xmm11, XMMWORD PTR [__svml_dasin_ha_data_internal+448] - vaddpd xmm0, xmm6, XMMWORD PTR [__svml_dasin_ha_data_internal+512] + vmulpd xmm6, xmm11, XMMWORD PTR [__jsvml_dasin_ha_data_internal+448] + vaddpd xmm0, xmm6, XMMWORD PTR [__jsvml_dasin_ha_data_internal+512] vmulpd xmm6, xmm11, xmm1 vmulpd xmm2, xmm11, xmm0 - vaddpd xmm1, xmm2, XMMWORD PTR [__svml_dasin_ha_data_internal+576] + vaddpd xmm1, xmm2, XMMWORD PTR [__jsvml_dasin_ha_data_internal+576] vmulpd xmm11, xmm11, xmm1 - vmulpd xmm1, xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+960] - vaddpd xmm0, xmm11, XMMWORD PTR [__svml_dasin_ha_data_internal+640] + vmulpd xmm1, xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+960] + vaddpd xmm0, xmm11, XMMWORD PTR [__jsvml_dasin_ha_data_internal+640] vmulpd xmm6, xmm6, xmm0 - vaddpd xmm0, xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+1024] + vaddpd xmm0, xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1024] vsubpd xmm6, xmm6, xmm4 - vmulpd xmm4, xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+704] - vmulpd xmm1, xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+1088] - vaddpd xmm11, xmm4, XMMWORD PTR [__svml_dasin_ha_data_internal+768] - vaddpd xmm1, xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+1152] - vmulpd xmm4, xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+832] - vaddpd xmm2, xmm4, XMMWORD PTR [__svml_dasin_ha_data_internal+896] + vmulpd xmm4, xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+704] + vmulpd xmm1, xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1088] + vaddpd xmm11, xmm4, XMMWORD PTR [__jsvml_dasin_ha_data_internal+768] + vaddpd xmm1, xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1152] + vmulpd xmm4, xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+832] + vaddpd xmm2, xmm4, XMMWORD PTR [__jsvml_dasin_ha_data_internal+896] vmulpd xmm4, xmm3, xmm3 vmulpd xmm11, xmm11, xmm4 vmulpd xmm0, xmm4, xmm0 vaddpd xmm2, xmm2, xmm11 vaddpd xmm0, xmm1, xmm0 vmulpd xmm11, xmm4, xmm4 - vmulpd xmm1, xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+1216] + vmulpd xmm1, xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1216] vmulpd xmm2, xmm2, xmm11 - vaddpd xmm1, xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+1280] + vaddpd xmm1, xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1280] vaddpd xmm11, xmm0, xmm2 vmulpd xmm4, xmm4, xmm11 vaddpd xmm0, xmm1, xmm4 vmulpd xmm1, xmm3, xmm0 - vaddpd xmm2, xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+1344] + vaddpd xmm2, xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1344] vmulpd xmm11, xmm3, xmm2 - vaddpd xmm4, xmm11, XMMWORD PTR [__svml_dasin_ha_data_internal+1408] + vaddpd xmm4, xmm11, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1408] vsubpd xmm11, xmm6, xmm5 - vaddpd xmm6, xmm6, XMMWORD PTR [__svml_dasin_ha_data_internal+1536] + vaddpd xmm6, xmm6, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1536] vmulpd xmm3, xmm3, xmm4 - vmovupd xmm0, XMMWORD PTR [__svml_dasin_ha_data_internal+1472] + vmovupd xmm0, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1472] vandnpd xmm9, xmm9, xmm10 vsubpd xmm4, xmm0, xmm5 vsubpd xmm1, xmm0, xmm4 @@ -190,19 +190,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_asin2_ha_e9 ENDP +__jsvml_asin2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin2_ha_e9_B1_B3: +_unwind___jsvml_asin2_ha_e9_B1_B3: DD 1068289 DD 2413645 DD 878661 @@ -220,19 +220,19 @@ _unwind___svml_asin2_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_asin2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asin2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin2_ha_e9_B6_B10: +_unwind___jsvml_asin2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_asin2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asin2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -241,7 +241,7 @@ _unwind___svml_asin2_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_asin2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_asin2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -255,9 +255,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin2_ha_l9 + PUBLIC __jsvml_asin2_ha_l9 -__svml_asin2_ha_l9 PROC EXPORT +__jsvml_asin2_ha_l9 PROC EXPORT _B2_1:: @@ -277,20 +277,20 @@ L20:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal] + vmovupd xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 vandpd xmm2, xmm3, xmm4 vandnpd xmm3, xmm3, xmm4 - vmovupd xmm6, XMMWORD PTR [__svml_dasin_ha_data_internal+64] + vmovupd xmm6, XMMWORD PTR [__jsvml_dasin_ha_data_internal+64] vmovapd xmm9, xmm2 vfnmadd213pd xmm9, xmm6, xmm6 - vcmpgtpd xmm1, xmm2, XMMWORD PTR [__svml_dasin_ha_data_internal+256] + vcmpgtpd xmm1, xmm2, XMMWORD PTR [__jsvml_dasin_ha_data_internal+256] vmulpd xmm5, xmm2, xmm2 vcvtpd2ps xmm0, xmm9 vmovmskpd edx, xmm1 vmovlhps xmm1, xmm0, xmm0 vrsqrtps xmm11, xmm1 - vcmpltpd xmm12, xmm9, XMMWORD PTR [__svml_dasin_ha_data_internal+128] + vcmpltpd xmm12, xmm9, XMMWORD PTR [__jsvml_dasin_ha_data_internal+128] vminpd xmm8, xmm5, xmm9 vcmpnltpd xmm5, xmm2, xmm6 vcvtps2pd xmm13, xmm11 @@ -299,36 +299,36 @@ L20:: vandnpd xmm2, xmm5, xmm2 vmulpd xmm9, xmm6, xmm6 vmulpd xmm0, xmm6, xmm11 - vfmsub213pd xmm9, xmm11, XMMWORD PTR [__svml_dasin_ha_data_internal+384] - vmovupd xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+448] - vmovupd xmm12, XMMWORD PTR [__svml_dasin_ha_data_internal+704] - vmovupd xmm13, XMMWORD PTR [__svml_dasin_ha_data_internal+960] + vfmsub213pd xmm9, xmm11, XMMWORD PTR [__jsvml_dasin_ha_data_internal+384] + vmovupd xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+448] + vmovupd xmm12, XMMWORD PTR [__jsvml_dasin_ha_data_internal+704] + vmovupd xmm13, XMMWORD PTR [__jsvml_dasin_ha_data_internal+960] vfmsub213pd xmm11, xmm6, xmm0 - vfmadd213pd xmm1, xmm9, XMMWORD PTR [__svml_dasin_ha_data_internal+512] - vfmadd213pd xmm12, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+768] - vfmadd213pd xmm13, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+1024] + vfmadd213pd xmm1, xmm9, XMMWORD PTR [__jsvml_dasin_ha_data_internal+512] + vfmadd213pd xmm12, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+768] + vfmadd213pd xmm13, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1024] vmulpd xmm6, xmm9, xmm0 - vfmadd213pd xmm1, xmm9, XMMWORD PTR [__svml_dasin_ha_data_internal+576] - vfmadd213pd xmm1, xmm9, XMMWORD PTR [__svml_dasin_ha_data_internal+640] - vmovupd xmm9, XMMWORD PTR [__svml_dasin_ha_data_internal+832] - vfmadd213pd xmm9, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+896] + vfmadd213pd xmm1, xmm9, XMMWORD PTR [__jsvml_dasin_ha_data_internal+576] + vfmadd213pd xmm1, xmm9, XMMWORD PTR [__jsvml_dasin_ha_data_internal+640] + vmovupd xmm9, XMMWORD PTR [__jsvml_dasin_ha_data_internal+832] + vfmadd213pd xmm9, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+896] vfmsub213pd xmm1, xmm6, xmm11 - vmovupd xmm6, XMMWORD PTR [__svml_dasin_ha_data_internal+1088] + vmovupd xmm6, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1088] vmulpd xmm11, xmm8, xmm8 - vfmadd213pd xmm6, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+1152] + vfmadd213pd xmm6, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1152] vfmadd213pd xmm12, xmm11, xmm9 vmulpd xmm9, xmm11, xmm11 vfmadd213pd xmm13, xmm11, xmm6 - vmovupd xmm6, XMMWORD PTR [__svml_dasin_ha_data_internal+1216] - vfmadd213pd xmm6, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+1280] + vmovupd xmm6, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1216] + vfmadd213pd xmm6, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1280] vfmadd213pd xmm12, xmm9, xmm13 vfmadd213pd xmm12, xmm11, xmm6 vsubpd xmm6, xmm1, xmm0 - vaddpd xmm1, xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+1536] - vfmadd213pd xmm12, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+1344] - vfmadd213pd xmm12, xmm8, XMMWORD PTR [__svml_dasin_ha_data_internal+1408] + vaddpd xmm1, xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1536] + vfmadd213pd xmm12, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1344] + vfmadd213pd xmm12, xmm8, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1408] vmulpd xmm9, xmm8, xmm12 - vmovupd xmm12, XMMWORD PTR [__svml_dasin_ha_data_internal+1472] + vmovupd xmm12, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1472] vsubpd xmm8, xmm12, xmm0 vsubpd xmm13, xmm12, xmm8 vsubpd xmm0, xmm0, xmm13 @@ -393,19 +393,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_asin2_ha_l9 ENDP +__jsvml_asin2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin2_ha_l9_B1_B3: +_unwind___jsvml_asin2_ha_l9_B1_B3: DD 1068289 DD 2413645 DD 1075269 @@ -423,19 +423,19 @@ _unwind___svml_asin2_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_asin2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asin2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin2_ha_l9_B6_B10: +_unwind___jsvml_asin2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_asin2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asin2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -444,7 +444,7 @@ _unwind___svml_asin2_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_asin2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_asin2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -458,9 +458,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin4_ha_l9 + PUBLIC __jsvml_asin4_ha_l9 -__svml_asin4_ha_l9 PROC EXPORT +__jsvml_asin4_ha_l9 PROC EXPORT _B3_1:: @@ -479,16 +479,16 @@ L39:: vmovups YMMWORD PTR [496+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm3, YMMWORD PTR [__svml_dasin_ha_data_internal] + vmovupd ymm3, YMMWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 - vmovupd ymm6, YMMWORD PTR [__svml_dasin_ha_data_internal+64] + vmovupd ymm6, YMMWORD PTR [__jsvml_dasin_ha_data_internal+64] vmovdqa ymm4, ymm0 vandpd ymm2, ymm3, ymm4 vmovdqa ymm9, ymm2 vfnmadd213pd ymm9, ymm6, ymm6 vmulpd ymm5, ymm2, ymm2 - vcmpgt_oqpd ymm1, ymm2, YMMWORD PTR [__svml_dasin_ha_data_internal+256] - vcmplt_oqpd ymm11, ymm9, YMMWORD PTR [__svml_dasin_ha_data_internal+128] + vcmpgt_oqpd ymm1, ymm2, YMMWORD PTR [__jsvml_dasin_ha_data_internal+256] + vcmplt_oqpd ymm11, ymm9, YMMWORD PTR [__jsvml_dasin_ha_data_internal+128] vminpd ymm8, ymm5, ymm9 vcmpnlt_uqpd ymm5, ymm2, ymm6 vcvtpd2ps xmm0, ymm9 @@ -496,39 +496,39 @@ L39:: vrsqrtps xmm1, xmm0 vcvtps2pd ymm12, xmm1 test edx, edx - vmovupd ymm1, YMMWORD PTR [__svml_dasin_ha_data_internal+448] + vmovupd ymm1, YMMWORD PTR [__jsvml_dasin_ha_data_internal+448] vandnpd ymm13, ymm11, ymm12 vaddpd ymm11, ymm9, ymm9 vmulpd ymm9, ymm13, ymm13 vmulpd ymm12, ymm8, ymm8 vmulpd ymm0, ymm13, ymm11 - vfmsub213pd ymm9, ymm11, YMMWORD PTR [__svml_dasin_ha_data_internal+384] + vfmsub213pd ymm9, ymm11, YMMWORD PTR [__jsvml_dasin_ha_data_internal+384] vfmsub213pd ymm11, ymm13, ymm0 - vmovupd ymm13, YMMWORD PTR [__svml_dasin_ha_data_internal+704] - vfmadd213pd ymm1, ymm9, YMMWORD PTR [__svml_dasin_ha_data_internal+512] + vmovupd ymm13, YMMWORD PTR [__jsvml_dasin_ha_data_internal+704] + vfmadd213pd ymm1, ymm9, YMMWORD PTR [__jsvml_dasin_ha_data_internal+512] vmulpd ymm6, ymm9, ymm0 - vfmadd213pd ymm13, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+768] - vfmadd213pd ymm1, ymm9, YMMWORD PTR [__svml_dasin_ha_data_internal+576] - vfmadd213pd ymm1, ymm9, YMMWORD PTR [__svml_dasin_ha_data_internal+640] - vmovupd ymm9, YMMWORD PTR [__svml_dasin_ha_data_internal+832] + vfmadd213pd ymm13, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+768] + vfmadd213pd ymm1, ymm9, YMMWORD PTR [__jsvml_dasin_ha_data_internal+576] + vfmadd213pd ymm1, ymm9, YMMWORD PTR [__jsvml_dasin_ha_data_internal+640] + vmovupd ymm9, YMMWORD PTR [__jsvml_dasin_ha_data_internal+832] vfmsub213pd ymm1, ymm6, ymm11 - vmovupd ymm11, YMMWORD PTR [__svml_dasin_ha_data_internal+960] - vmovupd ymm6, YMMWORD PTR [__svml_dasin_ha_data_internal+1088] - vfmadd213pd ymm9, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+896] - vfmadd213pd ymm11, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+1024] - vfmadd213pd ymm6, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+1152] + vmovupd ymm11, YMMWORD PTR [__jsvml_dasin_ha_data_internal+960] + vmovupd ymm6, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1088] + vfmadd213pd ymm9, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+896] + vfmadd213pd ymm11, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1024] + vfmadd213pd ymm6, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1152] vfmadd213pd ymm13, ymm12, ymm9 vmulpd ymm9, ymm12, ymm12 vfmadd213pd ymm11, ymm12, ymm6 - vmovupd ymm6, YMMWORD PTR [__svml_dasin_ha_data_internal+1216] + vmovupd ymm6, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1216] vfmadd213pd ymm13, ymm9, ymm11 - vfmadd213pd ymm6, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+1280] + vfmadd213pd ymm6, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1280] vfmadd213pd ymm13, ymm12, ymm6 - vmovupd ymm12, YMMWORD PTR [__svml_dasin_ha_data_internal+1472] + vmovupd ymm12, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1472] vsubpd ymm6, ymm1, ymm0 - vaddpd ymm1, ymm1, YMMWORD PTR [__svml_dasin_ha_data_internal+1536] - vfmadd213pd ymm13, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+1344] - vfmadd213pd ymm13, ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+1408] + vaddpd ymm1, ymm1, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1536] + vfmadd213pd ymm13, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1344] + vfmadd213pd ymm13, ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1408] vmulpd ymm9, ymm8, ymm13 vsubpd ymm8, ymm12, ymm0 vsubpd ymm13, ymm12, ymm8 @@ -604,19 +604,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_asin4_ha_l9 ENDP +__jsvml_asin4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin4_ha_l9_B1_B3: +_unwind___jsvml_asin4_ha_l9_B1_B3: DD 1067265 DD 4379721 DD 2058305 @@ -634,13 +634,13 @@ _unwind___svml_asin4_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_asin4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asin4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin4_ha_l9_B6_B10: +_unwind___jsvml_asin4_ha_l9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -650,7 +650,7 @@ _unwind___svml_asin4_ha_l9_B6_B10: DD 555019 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_asin4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asin4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -659,7 +659,7 @@ _unwind___svml_asin4_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_asin4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_asin4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -673,9 +673,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin1_ha_ex + PUBLIC __jsvml_asin1_ha_ex -__svml_asin1_ha_ex PROC EXPORT +__jsvml_asin1_ha_ex PROC EXPORT _B4_1:: @@ -695,12 +695,12 @@ L66:: movups XMMWORD PTR [192+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm10, QWORD PTR [__svml_dasin_ha_data_internal] + movsd xmm10, QWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 movaps xmm9, xmm10 andnps xmm10, xmm12 andps xmm9, xmm12 - movsd xmm1, QWORD PTR [__svml_dasin_ha_data_internal+64] + movsd xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+64] movaps xmm4, xmm9 mulsd xmm4, xmm1 movaps xmm5, xmm1 @@ -719,17 +719,17 @@ L66:: minpd xmm8, xmm3 movaps xmm3, xmm5 movaps xmm1, xmm8 - movsd xmm2, QWORD PTR [__svml_dasin_ha_data_internal+256] + movsd xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+256] movaps xmm14, xmm8 mulsd xmm1, xmm8 - cmpltsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal+128] + cmpltsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+128] addsd xmm5, xmm5 - mulsd xmm14, QWORD PTR [__svml_dasin_ha_data_internal+1088] + mulsd xmm14, QWORD PTR [__jsvml_dasin_ha_data_internal+1088] cmpltsd xmm2, xmm9 andnps xmm3, xmm4 - addsd xmm14, QWORD PTR [__svml_dasin_ha_data_internal+1152] + addsd xmm14, QWORD PTR [__jsvml_dasin_ha_data_internal+1152] movmskpd eax, xmm2 - movsd xmm4, QWORD PTR [__svml_dasin_ha_data_internal+320] + movsd xmm4, QWORD PTR [__jsvml_dasin_ha_data_internal+320] andps xmm4, xmm5 and eax, 1 mov QWORD PTR [272+rsp], r13 @@ -740,53 +740,53 @@ L66:: movaps xmm2, xmm5 mulsd xmm0, xmm3 mulsd xmm2, xmm3 - subsd xmm0, QWORD PTR [__svml_dasin_ha_data_internal+384] - movsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal+448] + subsd xmm0, QWORD PTR [__jsvml_dasin_ha_data_internal+384] + movsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+448] addsd xmm0, xmm2 mulsd xmm3, xmm0 movaps xmm2, xmm4 addsd xmm2, xmm5 - addsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal+512] + addsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+512] mulsd xmm2, xmm0 mulsd xmm3, xmm0 - addsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal+576] + addsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+576] mulsd xmm3, xmm0 movaps xmm0, xmm8 - mulsd xmm0, QWORD PTR [__svml_dasin_ha_data_internal+960] - addsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal+640] - addsd xmm0, QWORD PTR [__svml_dasin_ha_data_internal+1024] + mulsd xmm0, QWORD PTR [__jsvml_dasin_ha_data_internal+960] + addsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+640] + addsd xmm0, QWORD PTR [__jsvml_dasin_ha_data_internal+1024] mulsd xmm3, xmm2 mulsd xmm0, xmm1 subsd xmm3, xmm5 addsd xmm0, xmm14 movaps xmm2, xmm8 movaps xmm5, xmm8 - mulsd xmm2, QWORD PTR [__svml_dasin_ha_data_internal+704] + mulsd xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+704] movaps xmm14, xmm8 - mulsd xmm5, QWORD PTR [__svml_dasin_ha_data_internal+832] - mulsd xmm14, QWORD PTR [__svml_dasin_ha_data_internal+1216] - addsd xmm2, QWORD PTR [__svml_dasin_ha_data_internal+768] - addsd xmm5, QWORD PTR [__svml_dasin_ha_data_internal+896] - addsd xmm14, QWORD PTR [__svml_dasin_ha_data_internal+1280] + mulsd xmm5, QWORD PTR [__jsvml_dasin_ha_data_internal+832] + mulsd xmm14, QWORD PTR [__jsvml_dasin_ha_data_internal+1216] + addsd xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+768] + addsd xmm5, QWORD PTR [__jsvml_dasin_ha_data_internal+896] + addsd xmm14, QWORD PTR [__jsvml_dasin_ha_data_internal+1280] mulsd xmm2, xmm1 addsd xmm2, xmm5 movaps xmm5, xmm1 mulsd xmm5, xmm1 mulsd xmm2, xmm5 - movsd xmm5, QWORD PTR [__svml_dasin_ha_data_internal+1536] + movsd xmm5, QWORD PTR [__jsvml_dasin_ha_data_internal+1536] addsd xmm2, xmm0 addsd xmm5, xmm3 mulsd xmm2, xmm1 - movsd xmm1, QWORD PTR [__svml_dasin_ha_data_internal+1472] + movsd xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+1472] addsd xmm2, xmm14 mulsd xmm2, xmm8 movaps xmm0, xmm1 subsd xmm0, xmm4 - addsd xmm2, QWORD PTR [__svml_dasin_ha_data_internal+1344] + addsd xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+1344] subsd xmm1, xmm0 mulsd xmm2, xmm8 andps xmm0, xmm6 - addsd xmm2, QWORD PTR [__svml_dasin_ha_data_internal+1408] + addsd xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+1408] mulsd xmm2, xmm8 movaps xmm8, xmm3 subsd xmm8, xmm4 @@ -831,19 +831,19 @@ _B4_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B4_4 ALIGN 16 _B4_7:: -__svml_asin1_ha_ex ENDP +__jsvml_asin1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin1_ha_ex_B1_B6: +_unwind___jsvml_asin1_ha_ex_B1_B6: DD 1068033 DD 1430604 DD 813124 @@ -861,7 +861,7 @@ _unwind___svml_asin1_ha_ex_B1_B6: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_asin1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_asin1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -875,9 +875,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin4_ha_e9 + PUBLIC __jsvml_asin4_ha_e9 -__svml_asin4_ha_e9 PROC EXPORT +__jsvml_asin4_ha_e9 PROC EXPORT _B5_1:: @@ -896,14 +896,14 @@ L81:: vmovups YMMWORD PTR [400+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm9, YMMWORD PTR [__svml_dasin_ha_data_internal] + vmovupd ymm9, YMMWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 - vmovupd ymm8, YMMWORD PTR [__svml_dasin_ha_data_internal+64] + vmovupd ymm8, YMMWORD PTR [__jsvml_dasin_ha_data_internal+64] vmovapd ymm10, ymm0 vandpd ymm7, ymm9, ymm10 vmulpd ymm4, ymm7, ymm8 vmulpd ymm2, ymm7, ymm7 - vcmpgt_oqpd ymm1, ymm7, YMMWORD PTR [__svml_dasin_ha_data_internal+256] + vcmpgt_oqpd ymm1, ymm7, YMMWORD PTR [__jsvml_dasin_ha_data_internal+256] vsubpd ymm5, ymm8, ymm4 vcmpnlt_uqpd ymm8, ymm7, ymm8 vminpd ymm4, ymm2, ymm5 @@ -915,55 +915,55 @@ L81:: vextractf128 xmm3, ymm1, 1 vshufps xmm11, xmm1, xmm3, 221 vcvtps2pd ymm3, xmm6 - vcmplt_oqpd ymm1, ymm5, YMMWORD PTR [__svml_dasin_ha_data_internal+128] + vcmplt_oqpd ymm1, ymm5, YMMWORD PTR [__jsvml_dasin_ha_data_internal+128] vaddpd ymm5, ymm5, ymm5 vmovmskps edx, xmm11 vandnpd ymm6, ymm1, ymm3 - vandpd ymm11, ymm5, YMMWORD PTR [__svml_dasin_ha_data_internal+320] + vandpd ymm11, ymm5, YMMWORD PTR [__jsvml_dasin_ha_data_internal+320] vsubpd ymm0, ymm5, ymm11 vmulpd ymm5, ymm6, ymm11 vmulpd ymm2, ymm6, ymm0 vmulpd ymm11, ymm6, ymm5 vmulpd ymm6, ymm6, ymm2 - vsubpd ymm1, ymm11, YMMWORD PTR [__svml_dasin_ha_data_internal+384] + vsubpd ymm1, ymm11, YMMWORD PTR [__jsvml_dasin_ha_data_internal+384] vaddpd ymm0, ymm5, ymm2 vaddpd ymm11, ymm6, ymm1 - vmulpd ymm3, ymm11, YMMWORD PTR [__svml_dasin_ha_data_internal+448] + vmulpd ymm3, ymm11, YMMWORD PTR [__jsvml_dasin_ha_data_internal+448] vmulpd ymm6, ymm11, ymm0 - vaddpd ymm1, ymm3, YMMWORD PTR [__svml_dasin_ha_data_internal+512] + vaddpd ymm1, ymm3, YMMWORD PTR [__jsvml_dasin_ha_data_internal+512] vmulpd ymm3, ymm11, ymm1 - vmulpd ymm1, ymm4, YMMWORD PTR [__svml_dasin_ha_data_internal+960] - vaddpd ymm0, ymm3, YMMWORD PTR [__svml_dasin_ha_data_internal+576] + vmulpd ymm1, ymm4, YMMWORD PTR [__jsvml_dasin_ha_data_internal+960] + vaddpd ymm0, ymm3, YMMWORD PTR [__jsvml_dasin_ha_data_internal+576] vmulpd ymm11, ymm11, ymm0 - vaddpd ymm0, ymm1, YMMWORD PTR [__svml_dasin_ha_data_internal+1024] - vmulpd ymm1, ymm4, YMMWORD PTR [__svml_dasin_ha_data_internal+1088] - vaddpd ymm11, ymm11, YMMWORD PTR [__svml_dasin_ha_data_internal+640] - vaddpd ymm1, ymm1, YMMWORD PTR [__svml_dasin_ha_data_internal+1152] + vaddpd ymm0, ymm1, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1024] + vmulpd ymm1, ymm4, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1088] + vaddpd ymm11, ymm11, YMMWORD PTR [__jsvml_dasin_ha_data_internal+640] + vaddpd ymm1, ymm1, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1152] vmulpd ymm6, ymm6, ymm11 vsubpd ymm6, ymm6, ymm2 - vmulpd ymm2, ymm4, YMMWORD PTR [__svml_dasin_ha_data_internal+704] - vaddpd ymm11, ymm2, YMMWORD PTR [__svml_dasin_ha_data_internal+768] - vmulpd ymm2, ymm4, YMMWORD PTR [__svml_dasin_ha_data_internal+832] - vaddpd ymm3, ymm2, YMMWORD PTR [__svml_dasin_ha_data_internal+896] + vmulpd ymm2, ymm4, YMMWORD PTR [__jsvml_dasin_ha_data_internal+704] + vaddpd ymm11, ymm2, YMMWORD PTR [__jsvml_dasin_ha_data_internal+768] + vmulpd ymm2, ymm4, YMMWORD PTR [__jsvml_dasin_ha_data_internal+832] + vaddpd ymm3, ymm2, YMMWORD PTR [__jsvml_dasin_ha_data_internal+896] vmulpd ymm2, ymm4, ymm4 vmulpd ymm11, ymm11, ymm2 vmulpd ymm0, ymm2, ymm0 vaddpd ymm3, ymm3, ymm11 vaddpd ymm11, ymm1, ymm0 vmulpd ymm0, ymm2, ymm2 - vmulpd ymm1, ymm4, YMMWORD PTR [__svml_dasin_ha_data_internal+1216] + vmulpd ymm1, ymm4, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1216] vmulpd ymm3, ymm3, ymm0 - vaddpd ymm1, ymm1, YMMWORD PTR [__svml_dasin_ha_data_internal+1280] + vaddpd ymm1, ymm1, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1280] vaddpd ymm11, ymm11, ymm3 vmulpd ymm2, ymm2, ymm11 vaddpd ymm0, ymm1, ymm2 vmulpd ymm1, ymm4, ymm0 - vmovupd ymm0, YMMWORD PTR [__svml_dasin_ha_data_internal+1472] - vaddpd ymm3, ymm1, YMMWORD PTR [__svml_dasin_ha_data_internal+1344] + vmovupd ymm0, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1472] + vaddpd ymm3, ymm1, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1344] vmulpd ymm11, ymm4, ymm3 - vaddpd ymm2, ymm11, YMMWORD PTR [__svml_dasin_ha_data_internal+1408] + vaddpd ymm2, ymm11, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1408] vsubpd ymm11, ymm6, ymm5 - vaddpd ymm6, ymm6, YMMWORD PTR [__svml_dasin_ha_data_internal+1536] + vaddpd ymm6, ymm6, YMMWORD PTR [__jsvml_dasin_ha_data_internal+1536] vmulpd ymm4, ymm4, ymm2 vsubpd ymm2, ymm0, ymm5 vsubpd ymm1, ymm0, ymm2 @@ -1038,19 +1038,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_asin4_ha_e9 ENDP +__jsvml_asin4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin4_ha_e9_B1_B3: +_unwind___jsvml_asin4_ha_e9_B1_B3: DD 1067265 DD 4379721 DD 1665089 @@ -1068,13 +1068,13 @@ _unwind___svml_asin4_ha_e9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_asin4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asin4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin4_ha_e9_B6_B10: +_unwind___jsvml_asin4_ha_e9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -1084,7 +1084,7 @@ _unwind___svml_asin4_ha_e9_B6_B10: DD 575499 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_asin4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asin4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1093,7 +1093,7 @@ _unwind___svml_asin4_ha_e9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_asin4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_asin4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1107,9 +1107,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin2_ha_ex + PUBLIC __jsvml_asin2_ha_ex -__svml_asin2_ha_ex PROC EXPORT +__jsvml_asin2_ha_ex PROC EXPORT _B6_1:: @@ -1129,9 +1129,9 @@ L108:: movups XMMWORD PTR [256+rsp], xmm9 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm12, XMMWORD PTR [__svml_dasin_ha_data_internal] + movups xmm12, XMMWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 - movups xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+64] + movups xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+64] movaps xmm11, xmm12 andps xmm11, xmm13 movaps xmm4, xmm1 @@ -1149,74 +1149,74 @@ L108:: cvtps2pd xmm4, xmm14 movaps xmm1, xmm5 andnps xmm12, xmm13 - cmpltpd xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+128] + cmpltpd xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+128] addpd xmm5, xmm5 andnps xmm1, xmm4 - movups xmm4, XMMWORD PTR [__svml_dasin_ha_data_internal+320] + movups xmm4, XMMWORD PTR [__jsvml_dasin_ha_data_internal+320] andps xmm4, xmm5 subpd xmm5, xmm4 mulpd xmm4, xmm1 mulpd xmm5, xmm1 - movups xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+256] + movups xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+256] cmpltpd xmm3, xmm11 movmskpd eax, xmm3 movaps xmm3, xmm1 - movups xmm0, XMMWORD PTR [__svml_dasin_ha_data_internal+448] - movups xmm14, XMMWORD PTR [__svml_dasin_ha_data_internal+960] + movups xmm0, XMMWORD PTR [__jsvml_dasin_ha_data_internal+448] + movups xmm14, XMMWORD PTR [__jsvml_dasin_ha_data_internal+960] mulpd xmm3, xmm4 mulpd xmm1, xmm5 - subpd xmm3, XMMWORD PTR [__svml_dasin_ha_data_internal+384] + subpd xmm3, XMMWORD PTR [__jsvml_dasin_ha_data_internal+384] mulpd xmm14, xmm10 addpd xmm1, xmm3 - addpd xmm14, XMMWORD PTR [__svml_dasin_ha_data_internal+1024] + addpd xmm14, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1024] mulpd xmm0, xmm1 - addpd xmm0, XMMWORD PTR [__svml_dasin_ha_data_internal+512] + addpd xmm0, XMMWORD PTR [__jsvml_dasin_ha_data_internal+512] mulpd xmm0, xmm1 movaps xmm3, xmm4 - addpd xmm0, XMMWORD PTR [__svml_dasin_ha_data_internal+576] + addpd xmm0, XMMWORD PTR [__jsvml_dasin_ha_data_internal+576] addpd xmm3, xmm5 mulpd xmm3, xmm1 mulpd xmm1, xmm0 - addpd xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+640] + addpd xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+640] mulpd xmm3, xmm1 subpd xmm3, xmm5 - movups xmm5, XMMWORD PTR [__svml_dasin_ha_data_internal+704] + movups xmm5, XMMWORD PTR [__jsvml_dasin_ha_data_internal+704] movaps xmm0, xmm10 mulpd xmm5, xmm10 mulpd xmm0, xmm10 - addpd xmm5, XMMWORD PTR [__svml_dasin_ha_data_internal+768] + addpd xmm5, XMMWORD PTR [__jsvml_dasin_ha_data_internal+768] mulpd xmm14, xmm0 mulpd xmm5, xmm0 - movups xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+832] + movups xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+832] mulpd xmm1, xmm10 - addpd xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+896] - movups xmm2, XMMWORD PTR [__svml_dasin_ha_data_internal+1088] + addpd xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+896] + movups xmm2, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1088] mulpd xmm2, xmm10 addpd xmm1, xmm5 - addpd xmm2, XMMWORD PTR [__svml_dasin_ha_data_internal+1152] + addpd xmm2, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1152] movaps xmm5, xmm0 mulpd xmm5, xmm0 addpd xmm2, xmm14 mulpd xmm1, xmm5 - movups xmm14, XMMWORD PTR [__svml_dasin_ha_data_internal+1216] + movups xmm14, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1216] mulpd xmm14, xmm10 addpd xmm2, xmm1 - addpd xmm14, XMMWORD PTR [__svml_dasin_ha_data_internal+1280] + addpd xmm14, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1280] mulpd xmm0, xmm2 addpd xmm14, xmm0 mulpd xmm14, xmm10 - addpd xmm14, XMMWORD PTR [__svml_dasin_ha_data_internal+1344] - movups xmm1, XMMWORD PTR [__svml_dasin_ha_data_internal+1472] + addpd xmm14, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1344] + movups xmm1, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1472] movaps xmm2, xmm3 movaps xmm0, xmm1 subpd xmm0, xmm4 subpd xmm2, xmm4 mulpd xmm14, xmm10 subpd xmm1, xmm0 - addpd xmm14, XMMWORD PTR [__svml_dasin_ha_data_internal+1408] + addpd xmm14, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1408] subpd xmm4, xmm1 mulpd xmm10, xmm14 - movups xmm5, XMMWORD PTR [__svml_dasin_ha_data_internal+1536] + movups xmm5, XMMWORD PTR [__jsvml_dasin_ha_data_internal+1536] andps xmm2, xmm9 addpd xmm5, xmm3 subpd xmm5, xmm4 @@ -1284,19 +1284,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_asin2_ha_ex ENDP +__jsvml_asin2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin2_ha_ex_B1_B3: +_unwind___jsvml_asin2_ha_ex_B1_B3: DD 1068289 DD 2413645 DD 1087557 @@ -1314,19 +1314,19 @@ _unwind___svml_asin2_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_asin2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_asin2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin2_ha_ex_B6_B10: +_unwind___jsvml_asin2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_asin2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_asin2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1335,7 +1335,7 @@ _unwind___svml_asin2_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_asin2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_asin2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1349,9 +1349,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin8_ha_z0 + PUBLIC __jsvml_asin8_ha_z0 -__svml_asin8_ha_z0 PROC EXPORT +__jsvml_asin8_ha_z0 PROC EXPORT _B7_1:: @@ -1361,15 +1361,15 @@ _B7_1:: DB 250 L127:: - vmovups zmm23, ZMMWORD PTR [__svml_dasin_ha_data_internal+64] - vmovups zmm25, ZMMWORD PTR [__svml_dasin_ha_data_internal+128] - vmovups zmm31, ZMMWORD PTR [__svml_dasin_ha_data_internal+384] - vmovups zmm29, ZMMWORD PTR [__svml_dasin_ha_data_internal+448] - vmovups zmm2, ZMMWORD PTR [__svml_dasin_ha_data_internal+512] - vmovups zmm24, ZMMWORD PTR [__svml_dasin_ha_data_internal+256] - vmovups zmm30, ZMMWORD PTR [__svml_dasin_ha_data_internal+576] - vmovups zmm1, ZMMWORD PTR [__svml_dasin_ha_data_internal+640] - vandpd zmm5, zmm0, ZMMWORD PTR [__svml_dasin_ha_data_internal] + vmovups zmm23, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+64] + vmovups zmm25, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+128] + vmovups zmm31, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+384] + vmovups zmm29, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+448] + vmovups zmm2, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+512] + vmovups zmm24, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+256] + vmovups zmm30, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+576] + vmovups zmm1, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+640] + vandpd zmm5, zmm0, ZMMWORD PTR [__jsvml_dasin_ha_data_internal] vmovaps zmm26, zmm5 vfnmadd213pd zmm26, zmm23, zmm23 {rn-sae} vmulpd zmm22, zmm5, zmm5 {rn-sae} @@ -1377,48 +1377,48 @@ L127:: vcmppd k2, zmm26, zmm25, 17 {sae} vcmppd k1, zmm24, zmm5, 17 {sae} vcmppd k3, zmm5, zmm23, 21 {sae} - vmovups zmm23, ZMMWORD PTR [__svml_dasin_ha_data_internal+704] - vmovups zmm24, ZMMWORD PTR [__svml_dasin_ha_data_internal+832] - vmovups zmm25, ZMMWORD PTR [__svml_dasin_ha_data_internal+960] + vmovups zmm23, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+704] + vmovups zmm24, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+832] + vmovups zmm25, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+960] vminpd zmm4, zmm22, zmm26 {sae} vxorpd zmm28{k2}, zmm28, zmm28 vaddpd zmm22, zmm26, zmm26 {rn-sae} - vorpd zmm4{k1}, zmm4, ZMMWORD PTR [__svml_dasin_ha_data_internal+1728] + vorpd zmm4{k1}, zmm4, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1728] vmulpd zmm27, zmm28, zmm28 {rn-sae} vmulpd zmm3, zmm22, zmm28 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_dasin_ha_data_internal+1088] + vmovups zmm26, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1088] vfmsub231pd zmm31, zmm27, zmm22 {rn-sae} vfmsub213pd zmm22, zmm28, zmm3 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_dasin_ha_data_internal+896] + vmovups zmm28, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+896] vfmadd231pd zmm2, zmm29, zmm31 {rn-sae} - vmovups zmm29, ZMMWORD PTR [__svml_dasin_ha_data_internal+1152] + vmovups zmm29, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1152] vfmadd231pd zmm28, zmm24, zmm4 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_dasin_ha_data_internal+1280] + vmovups zmm24, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1280] vmulpd zmm27, zmm3, zmm31 {rn-sae} vfmadd213pd zmm2, zmm31, zmm30 {rn-sae} vfmadd231pd zmm29, zmm26, zmm4 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dasin_ha_data_internal+1216] - vmovups zmm26, ZMMWORD PTR [__svml_dasin_ha_data_internal+1408] + vmovups zmm30, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1216] + vmovups zmm26, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1408] vfmadd213pd zmm2, zmm31, zmm1 {rn-sae} - vmovups zmm1, ZMMWORD PTR [__svml_dasin_ha_data_internal+768] + vmovups zmm1, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+768] vfmadd231pd zmm24, zmm30, zmm4 {rn-sae} vfmsub213pd zmm2, zmm27, zmm22 {rn-sae} vfmadd231pd zmm1, zmm23, zmm4 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dasin_ha_data_internal+1024] + vmovups zmm22, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1024] vmulpd zmm23, zmm4, zmm4 {rn-sae} vfmadd231pd zmm22, zmm25, zmm4 {rn-sae} - vmovups zmm25, ZMMWORD PTR [__svml_dasin_ha_data_internal+1344] + vmovups zmm25, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1344] vmulpd zmm31, zmm23, zmm23 {rn-sae} vfmadd213pd zmm1, zmm23, zmm28 {rn-sae} vfmadd213pd zmm22, zmm23, zmm29 {rn-sae} vfmadd213pd zmm1, zmm31, zmm22 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dasin_ha_data_internal+1600] + vmovups zmm22, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1600] vfmadd213pd zmm1, zmm23, zmm24 {rn-sae} vfmadd213pd zmm1, zmm4, zmm25 {rn-sae} vfmadd213pd zmm1, zmm4, zmm26 {rn-sae} vmulpd zmm25, zmm1, zmm4 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_dasin_ha_data_internal+1472] - vmovups zmm1, ZMMWORD PTR [__svml_dasin_ha_data_internal+1536] + vmovups zmm4, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1472] + vmovups zmm1, ZMMWORD PTR [__jsvml_dasin_ha_data_internal+1536] vsubpd zmm24, zmm4, zmm3 {rn-sae} vsubpd zmm4, zmm4, zmm24 {rn-sae} vmovaps zmm23, zmm5 @@ -1435,7 +1435,7 @@ L127:: _B7_2:: -__svml_asin8_ha_z0 ENDP +__jsvml_asin8_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -1449,9 +1449,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin1_ha_l9 + PUBLIC __jsvml_asin1_ha_l9 -__svml_asin1_ha_l9 PROC EXPORT +__jsvml_asin1_ha_l9 PROC EXPORT _B8_1:: @@ -1472,15 +1472,15 @@ L128:: vmovups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal] + vmovsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 vandpd xmm2, xmm3, xmm4 vandnpd xmm3, xmm3, xmm4 - vmovsd xmm13, QWORD PTR [__svml_dasin_ha_data_internal+64] + vmovsd xmm13, QWORD PTR [__jsvml_dasin_ha_data_internal+64] vmovapd xmm8, xmm2 vfnmadd213sd xmm8, xmm13, xmm13 vmulsd xmm5, xmm2, xmm2 - vcmpltsd xmm12, xmm8, QWORD PTR [__svml_dasin_ha_data_internal+128] + vcmpltsd xmm12, xmm8, QWORD PTR [__jsvml_dasin_ha_data_internal+128] vmovddup xmm1, xmm5 vmovddup xmm5, xmm8 vminpd xmm7, xmm1, xmm5 @@ -1488,7 +1488,7 @@ L128:: vcmpnltsd xmm5, xmm2, xmm13 vaddsd xmm13, xmm8, xmm8 vbroadcastss xmm10, xmm1 - vmovsd xmm6, QWORD PTR [__svml_dasin_ha_data_internal+256] + vmovsd xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+256] vrsqrtps xmm11, xmm10 vcmpltsd xmm0, xmm6, xmm2 vcvtps2pd xmm6, xmm11 @@ -1498,41 +1498,41 @@ L128:: vmulsd xmm8, xmm1, xmm1 vmovapd xmm12, xmm7 vmulsd xmm0, xmm13, xmm1 - vfmsub213sd xmm6, xmm8, QWORD PTR [__svml_dasin_ha_data_internal+384] - vmovsd xmm11, QWORD PTR [__svml_dasin_ha_data_internal+832] + vfmsub213sd xmm6, xmm8, QWORD PTR [__jsvml_dasin_ha_data_internal+384] + vmovsd xmm11, QWORD PTR [__jsvml_dasin_ha_data_internal+832] vandnpd xmm2, xmm5, xmm2 - vmovsd xmm10, QWORD PTR [__svml_dasin_ha_data_internal+704] + vmovsd xmm10, QWORD PTR [__jsvml_dasin_ha_data_internal+704] vfmsub213sd xmm13, xmm1, xmm0 - vmovsd xmm1, QWORD PTR [__svml_dasin_ha_data_internal+448] - vfmadd213sd xmm1, xmm6, QWORD PTR [__svml_dasin_ha_data_internal+512] + vmovsd xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+448] + vfmadd213sd xmm1, xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+512] vmulsd xmm8, xmm0, xmm6 - vfmadd213sd xmm12, xmm11, QWORD PTR [__svml_dasin_ha_data_internal+896] - vfmadd213sd xmm1, xmm6, QWORD PTR [__svml_dasin_ha_data_internal+576] + vfmadd213sd xmm12, xmm11, QWORD PTR [__jsvml_dasin_ha_data_internal+896] + vfmadd213sd xmm1, xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+576] vmovapd xmm11, xmm7 - vfmadd213sd xmm1, xmm6, QWORD PTR [__svml_dasin_ha_data_internal+640] - vmovsd xmm6, QWORD PTR [__svml_dasin_ha_data_internal+1088] + vfmadd213sd xmm1, xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+640] + vmovsd xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+1088] vfmsub213sd xmm1, xmm8, xmm13 vmovapd xmm13, xmm7 - vmovsd xmm8, QWORD PTR [__svml_dasin_ha_data_internal+960] - vfmadd213sd xmm11, xmm8, QWORD PTR [__svml_dasin_ha_data_internal+1024] + vmovsd xmm8, QWORD PTR [__jsvml_dasin_ha_data_internal+960] + vfmadd213sd xmm11, xmm8, QWORD PTR [__jsvml_dasin_ha_data_internal+1024] vmovapd xmm8, xmm7 - vfmadd213sd xmm13, xmm10, QWORD PTR [__svml_dasin_ha_data_internal+768] + vfmadd213sd xmm13, xmm10, QWORD PTR [__jsvml_dasin_ha_data_internal+768] vmulsd xmm10, xmm7, xmm7 - vfmadd213sd xmm8, xmm6, QWORD PTR [__svml_dasin_ha_data_internal+1152] + vfmadd213sd xmm8, xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+1152] vmovapd xmm6, xmm7 vfmadd213sd xmm13, xmm10, xmm12 vfmadd213sd xmm11, xmm10, xmm8 vmulsd xmm8, xmm10, xmm10 - vmovsd xmm12, QWORD PTR [__svml_dasin_ha_data_internal+1216] - vfmadd213sd xmm6, xmm12, QWORD PTR [__svml_dasin_ha_data_internal+1280] + vmovsd xmm12, QWORD PTR [__jsvml_dasin_ha_data_internal+1216] + vfmadd213sd xmm6, xmm12, QWORD PTR [__jsvml_dasin_ha_data_internal+1280] vfmadd213sd xmm13, xmm8, xmm11 - vmovsd xmm11, QWORD PTR [__svml_dasin_ha_data_internal+1536] + vmovsd xmm11, QWORD PTR [__jsvml_dasin_ha_data_internal+1536] vfmadd213sd xmm13, xmm10, xmm6 vsubsd xmm6, xmm1, xmm0 vaddsd xmm1, xmm11, xmm1 - vfmadd213sd xmm13, xmm7, QWORD PTR [__svml_dasin_ha_data_internal+1344] - vmovsd xmm10, QWORD PTR [__svml_dasin_ha_data_internal+1472] - vfmadd213sd xmm13, xmm7, QWORD PTR [__svml_dasin_ha_data_internal+1408] + vfmadd213sd xmm13, xmm7, QWORD PTR [__jsvml_dasin_ha_data_internal+1344] + vmovsd xmm10, QWORD PTR [__jsvml_dasin_ha_data_internal+1472] + vfmadd213sd xmm13, xmm7, QWORD PTR [__jsvml_dasin_ha_data_internal+1408] vmulsd xmm8, xmm13, xmm7 vsubsd xmm7, xmm10, xmm0 mov QWORD PTR [288+rsp], r13 @@ -1579,19 +1579,19 @@ _B8_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B8_4 ALIGN 16 _B8_7:: -__svml_asin1_ha_l9 ENDP +__jsvml_asin1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin1_ha_l9_B1_B6: +_unwind___jsvml_asin1_ha_l9_B1_B6: DD 1201665 DD 1430614 DD 1009742 @@ -1610,7 +1610,7 @@ _unwind___svml_asin1_ha_l9_B1_B6: DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_asin1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_asin1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1624,9 +1624,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asin1_ha_e9 + PUBLIC __jsvml_asin1_ha_e9 -__svml_asin1_ha_e9 PROC EXPORT +__jsvml_asin1_ha_e9 PROC EXPORT _B9_1:: @@ -1646,9 +1646,9 @@ L145:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm9, QWORD PTR [__svml_dasin_ha_data_internal] + vmovsd xmm9, QWORD PTR [__jsvml_dasin_ha_data_internal] and r13, -64 - vmovsd xmm8, QWORD PTR [__svml_dasin_ha_data_internal+64] + vmovsd xmm8, QWORD PTR [__jsvml_dasin_ha_data_internal+64] vandpd xmm7, xmm9, xmm10 vmulsd xmm2, xmm7, xmm8 vandnpd xmm9, xmm9, xmm10 @@ -1661,13 +1661,13 @@ L145:: vminpd xmm4, xmm5, xmm1 vshufps xmm5, xmm2, xmm2, 0 vrsqrtps xmm1, xmm5 - vmovsd xmm3, QWORD PTR [__svml_dasin_ha_data_internal+256] + vmovsd xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+256] vcvtps2pd xmm0, xmm1 vcmpltsd xmm11, xmm3, xmm7 - vcmpltsd xmm3, xmm6, QWORD PTR [__svml_dasin_ha_data_internal+128] + vcmpltsd xmm3, xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+128] vmovmskpd eax, xmm11 vaddsd xmm11, xmm6, xmm6 - vmovsd xmm6, QWORD PTR [__svml_dasin_ha_data_internal+320] + vmovsd xmm6, QWORD PTR [__jsvml_dasin_ha_data_internal+320] vandnpd xmm5, xmm3, xmm0 vandpd xmm2, xmm11, xmm6 vandnpd xmm7, xmm8, xmm7 @@ -1676,46 +1676,46 @@ L145:: vmulsd xmm2, xmm1, xmm5 vmulsd xmm3, xmm6, xmm5 vmulsd xmm0, xmm2, xmm5 - vsubsd xmm5, xmm3, QWORD PTR [__svml_dasin_ha_data_internal+384] + vsubsd xmm5, xmm3, QWORD PTR [__jsvml_dasin_ha_data_internal+384] vaddsd xmm3, xmm6, xmm2 vaddsd xmm11, xmm5, xmm0 - vmovsd xmm5, QWORD PTR [__svml_dasin_ha_data_internal+448] + vmovsd xmm5, QWORD PTR [__jsvml_dasin_ha_data_internal+448] vmulsd xmm1, xmm5, xmm11 vmulsd xmm5, xmm3, xmm11 - vaddsd xmm0, xmm1, QWORD PTR [__svml_dasin_ha_data_internal+512] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+512] vmulsd xmm1, xmm0, xmm11 - vmulsd xmm0, xmm4, QWORD PTR [__svml_dasin_ha_data_internal+960] - vaddsd xmm3, xmm1, QWORD PTR [__svml_dasin_ha_data_internal+576] - vmulsd xmm1, xmm4, QWORD PTR [__svml_dasin_ha_data_internal+1088] - vaddsd xmm0, xmm0, QWORD PTR [__svml_dasin_ha_data_internal+1024] + vmulsd xmm0, xmm4, QWORD PTR [__jsvml_dasin_ha_data_internal+960] + vaddsd xmm3, xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+576] + vmulsd xmm1, xmm4, QWORD PTR [__jsvml_dasin_ha_data_internal+1088] + vaddsd xmm0, xmm0, QWORD PTR [__jsvml_dasin_ha_data_internal+1024] vmulsd xmm11, xmm3, xmm11 - vaddsd xmm1, xmm1, QWORD PTR [__svml_dasin_ha_data_internal+1152] - vaddsd xmm11, xmm11, QWORD PTR [__svml_dasin_ha_data_internal+640] + vaddsd xmm1, xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+1152] + vaddsd xmm11, xmm11, QWORD PTR [__jsvml_dasin_ha_data_internal+640] vmulsd xmm5, xmm11, xmm5 mov QWORD PTR [272+rsp], r13 vsubsd xmm5, xmm5, xmm2 - vmulsd xmm2, xmm4, QWORD PTR [__svml_dasin_ha_data_internal+704] - vaddsd xmm11, xmm2, QWORD PTR [__svml_dasin_ha_data_internal+768] - vmulsd xmm2, xmm4, QWORD PTR [__svml_dasin_ha_data_internal+832] - vaddsd xmm3, xmm2, QWORD PTR [__svml_dasin_ha_data_internal+896] + vmulsd xmm2, xmm4, QWORD PTR [__jsvml_dasin_ha_data_internal+704] + vaddsd xmm11, xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+768] + vmulsd xmm2, xmm4, QWORD PTR [__jsvml_dasin_ha_data_internal+832] + vaddsd xmm3, xmm2, QWORD PTR [__jsvml_dasin_ha_data_internal+896] vmulsd xmm2, xmm4, xmm4 vmulsd xmm11, xmm11, xmm2 vmulsd xmm0, xmm0, xmm2 vaddsd xmm3, xmm11, xmm3 vaddsd xmm11, xmm0, xmm1 vmulsd xmm0, xmm2, xmm2 - vmulsd xmm1, xmm4, QWORD PTR [__svml_dasin_ha_data_internal+1216] + vmulsd xmm1, xmm4, QWORD PTR [__jsvml_dasin_ha_data_internal+1216] vmulsd xmm3, xmm3, xmm0 - vaddsd xmm1, xmm1, QWORD PTR [__svml_dasin_ha_data_internal+1280] + vaddsd xmm1, xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+1280] vaddsd xmm11, xmm3, xmm11 vmulsd xmm2, xmm11, xmm2 vaddsd xmm0, xmm2, xmm1 vmulsd xmm1, xmm0, xmm4 - vmovsd xmm0, QWORD PTR [__svml_dasin_ha_data_internal+1472] - vaddsd xmm3, xmm1, QWORD PTR [__svml_dasin_ha_data_internal+1344] + vmovsd xmm0, QWORD PTR [__jsvml_dasin_ha_data_internal+1472] + vaddsd xmm3, xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+1344] vmulsd xmm11, xmm3, xmm4 - vmovsd xmm1, QWORD PTR [__svml_dasin_ha_data_internal+1536] - vaddsd xmm2, xmm11, QWORD PTR [__svml_dasin_ha_data_internal+1408] + vmovsd xmm1, QWORD PTR [__jsvml_dasin_ha_data_internal+1536] + vaddsd xmm2, xmm11, QWORD PTR [__jsvml_dasin_ha_data_internal+1408] vsubsd xmm11, xmm5, xmm6 vaddsd xmm5, xmm1, xmm5 vmulsd xmm2, xmm2, xmm4 @@ -1763,19 +1763,19 @@ _B9_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dasin_ha_cout_rare_internal + call __jsvml_dasin_ha_cout_rare_internal jmp _B9_4 ALIGN 16 _B9_7:: -__svml_asin1_ha_e9 ENDP +__jsvml_asin1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asin1_ha_e9_B1_B6: +_unwind___jsvml_asin1_ha_e9_B1_B6: DD 1068289 DD 1430605 DD 1075269 @@ -1793,7 +1793,7 @@ _unwind___svml_asin1_ha_e9_B1_B6: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_asin1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_asin1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1807,9 +1807,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dasin_ha_cout_rare_internal + PUBLIC __jsvml_dasin_ha_cout_rare_internal -__svml_dasin_ha_cout_rare_internal PROC +__jsvml_dasin_ha_cout_rare_internal PROC _B10_1:: @@ -2355,13 +2355,13 @@ _B10_13:: _B10_14:: -__svml_dasin_ha_cout_rare_internal ENDP +__jsvml_dasin_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dasin_ha_cout_rare_internal_B1_B13: +_unwind___jsvml_dasin_ha_cout_rare_internal_B1_B13: DD 621959425 DD 686169 DD 493650 @@ -2380,7 +2380,7 @@ _unwind___svml_dasin_ha_cout_rare_internal_B1_B13: DD imagerel _B10_1 DD imagerel _B10_14 - DD imagerel _unwind___svml_dasin_ha_cout_rare_internal_B1_B13 + DD imagerel _unwind___jsvml_dasin_ha_cout_rare_internal_B1_B13 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2388,8 +2388,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dasin_ha_data_internal -__svml_dasin_ha_data_internal DD 4294967295 + PUBLIC __jsvml_dasin_ha_data_internal +__jsvml_dasin_ha_data_internal DD 4294967295 DD 2147483647 DD 4294967295 DD 2147483647 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_atan2_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_atan2_windows_x86.S similarity index 81% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_atan2_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_atan2_windows_x86.S index 966674c7af1..122de75dd6e 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_atan2_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_atan2_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan22_ha_ex + PUBLIC __jsvml_atan22_ha_ex -__svml_atan22_ha_ex PROC EXPORT +__jsvml_atan22_ha_ex PROC EXPORT _B1_1:: @@ -65,7 +65,7 @@ L1:: movups XMMWORD PTR [336+rsp], xmm6 mov QWORD PTR [512+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+896] + movups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+896] and r13, -64 movaps xmm1, xmm4 andps xmm4, xmm0 @@ -75,11 +75,11 @@ L1:: pxor xmm2, xmm0 movups XMMWORD PTR [480+rsp], xmm2 movaps xmm14, xmm1 - movups xmm5, XMMWORD PTR [__svml_datan2_ha_data_internal+2880] + movups xmm5, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2880] movdqa xmm7, xmm15 pshufd xmm2, xmm4, 221 pxor xmm14, xmm13 - movq xmm3, QWORD PTR [__svml_datan2_ha_data_internal+2688] + movq xmm3, QWORD PTR [__jsvml_datan2_ha_data_internal+2688] movdqa xmm6, xmm2 movups XMMWORD PTR [416+rsp], xmm13 psubd xmm7, xmm3 @@ -90,11 +90,11 @@ L1:: movdqa xmm3, xmm7 psubd xmm5, xmm15 movaps xmm9, xmm4 - movq xmm15, QWORD PTR [__svml_datan2_ha_data_internal+2752] + movq xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+2752] movaps xmm8, xmm1 pcmpgtd xmm3, xmm15 pcmpeqd xmm7, xmm15 - movups xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+1088] + movups xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1088] por xmm3, xmm7 movdqa xmm7, xmm6 movaps xmm10, xmm12 @@ -102,9 +102,9 @@ L1:: pcmpeqd xmm6, xmm15 movups XMMWORD PTR [448+rsp], xmm4 andps xmm10, xmm4 - movq xmm4, QWORD PTR [__svml_datan2_ha_data_internal+3200] + movq xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+3200] por xmm7, xmm6 - movq xmm6, QWORD PTR [__svml_datan2_ha_data_internal+3264] + movq xmm6, QWORD PTR [__jsvml_datan2_ha_data_internal+3264] paddd xmm5, xmm4 por xmm3, xmm7 movdqa xmm7, xmm6 @@ -115,10 +115,10 @@ L1:: por xmm3, xmm7 andps xmm11, xmm1 movdqu XMMWORD PTR [496+rsp], xmm3 - movups xmm15, XMMWORD PTR [__svml_datan2_ha_data_internal+1152] - movups xmm7, XMMWORD PTR [__svml_datan2_ha_data_internal+1216] - movups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1280] - movups xmm3, XMMWORD PTR [__svml_datan2_ha_data_internal+1344] + movups xmm15, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1152] + movups xmm7, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1216] + movups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1280] + movups xmm3, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1344] mulpd xmm15, xmm1 mulpd xmm3, xmm1 mulpd xmm7, xmm1 @@ -141,7 +141,7 @@ L1:: paddd xmm6, xmm1 paddd xmm15, xmm7 movaps xmm1, xmm11 - movq xmm5, QWORD PTR [__svml_datan2_ha_data_internal+1408] + movq xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+1408] paddd xmm6, xmm15 paddd xmm6, xmm5 movaps xmm15, xmm8 @@ -152,14 +152,14 @@ L1:: movups XMMWORD PTR [32+rsp], xmm0 movd ecx, xmm2 movaps xmm2, xmm10 - movq xmm3, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+r8+rdx] - movq xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+r8+rdx] - movhpd xmm3, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+r8+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+r8+rdx] + movq xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+r8+rdx] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+r8+rcx] mulpd xmm1, xmm3 mulpd xmm15, xmm3 mulpd xmm10, xmm3 mulpd xmm3, xmm9 - movhpd xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+r8+rcx] + movhpd xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+r8+rcx] andps xmm2, xmm4 andps xmm7, xmm4 subpd xmm2, xmm1 @@ -183,29 +183,29 @@ L1:: pshufd xmm15, xmm12, 221 andps xmm2, xmm1 movdqa xmm11, xmm15 - movq xmm8, QWORD PTR [__svml_datan2_ha_data_internal+1600] + movq xmm8, QWORD PTR [__jsvml_datan2_ha_data_internal+1600] pslld xmm11, 3 - movq xmm10, QWORD PTR [__svml_datan2_ha_data_internal+1664] + movq xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+1664] pand xmm11, xmm8 por xmm11, xmm10 addpd xmm4, xmm9 subpd xmm1, xmm2 rcpps xmm9, xmm11 addpd xmm7, xmm1 - movq xmm3, QWORD PTR [__svml_datan2_ha_data_internal+1472] + movq xmm3, QWORD PTR [__jsvml_datan2_ha_data_internal+1472] psrld xmm9, 3 - movq xmm8, QWORD PTR [__svml_datan2_ha_data_internal+1536] + movq xmm8, QWORD PTR [__jsvml_datan2_ha_data_internal+1536] pand xmm15, xmm3 - movq xmm1, QWORD PTR [__svml_datan2_ha_data_internal+1728] + movq xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+1728] psubd xmm8, xmm15 psubd xmm9, xmm1 movaps xmm1, xmm2 paddd xmm9, xmm8 pshufd xmm10, xmm9, 80 - andps xmm10, XMMWORD PTR [__svml_datan2_ha_data_internal+3008] + andps xmm10, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3008] mulpd xmm12, xmm10 mulpd xmm4, xmm10 - subpd xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+1792] + subpd xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1792] mulpd xmm2, xmm10 addpd xmm12, xmm4 movaps xmm4, xmm12 @@ -231,44 +231,44 @@ L1:: mulpd xmm3, xmm8 movaps xmm7, xmm3 mulpd xmm7, xmm3 - movups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1856] + movups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1856] mulpd xmm4, xmm7 - movups xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+1920] - addpd xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1984] + movups xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1920] + addpd xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1984] mulpd xmm12, xmm7 mulpd xmm4, xmm7 - addpd xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+2048] - addpd xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2112] + addpd xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2048] + addpd xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2112] mulpd xmm12, xmm7 mulpd xmm4, xmm7 - addpd xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+2176] - addpd xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2240] + addpd xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2176] + addpd xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2240] mulpd xmm12, xmm7 mulpd xmm4, xmm7 - addpd xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+2304] - addpd xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2368] + addpd xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2304] + addpd xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2368] mulpd xmm12, xmm7 mulpd xmm4, xmm7 - addpd xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+2432] - addpd xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2496] + addpd xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2432] + addpd xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2496] mulpd xmm7, xmm12 mulpd xmm4, xmm3 - addpd xmm7, XMMWORD PTR [__svml_datan2_ha_data_internal+2560] + addpd xmm7, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2560] addpd xmm7, xmm4 mulpd xmm3, xmm7 - movq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+r8+rdx] - movhpd xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+r8+rcx] + movq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+r8+rdx] + movhpd xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+r8+rcx] addpd xmm5, xmm1 mulpd xmm8, xmm3 - movups xmm0, XMMWORD PTR [__svml_datan2_ha_data_internal+960] + movups xmm0, XMMWORD PTR [__jsvml_datan2_ha_data_internal+960] andps xmm0, xmm13 - andps xmm13, XMMWORD PTR [__svml_datan2_ha_data_internal+1024] + andps xmm13, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1024] pxor xmm13, xmm14 addpd xmm13, xmm5 addpd xmm13, xmm8 addpd xmm2, xmm13 - movq xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+r8+rdx] - movhpd xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+r8+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+r8+rdx] + movhpd xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+r8+rcx] addpd xmm6, xmm2 pxor xmm6, xmm14 addpd xmm0, xmm6 @@ -345,7 +345,7 @@ _B1_11:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B1_9 _B1_12:: @@ -359,8 +359,8 @@ _B1_12:: movaps xmm11, xmm5 movups xmm13, XMMWORD PTR [432+rsp] andnps xmm2, xmm10 - movups xmm3, XMMWORD PTR [__svml_datan2_ha_data_internal+832] - movups xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+3136] + movups xmm3, XMMWORD PTR [__jsvml_datan2_ha_data_internal+832] + movups xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3136] movaps xmm4, xmm3 cmpordpd xmm11, xmm5 cmpeqpd xmm10, xmm13 @@ -388,7 +388,7 @@ _B1_12:: pcmpgtd xmm14, xmm6 orps xmm8, xmm4 pshufd xmm15, xmm14, 80 - andps xmm15, XMMWORD PTR [__svml_datan2_ha_data_internal+3072] + andps xmm15, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3072] addpd xmm8, xmm15 movmskps eax, xmm12 pshufd xmm1, xmm7, 80 @@ -404,13 +404,13 @@ _B1_12:: _B1_13:: -__svml_atan22_ha_ex ENDP +__jsvml_atan22_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_ex_B1_B4: +_unwind___jsvml_atan22_ha_ex_B1_B4: DD 1603585 DD 4248696 DD 1402992 @@ -432,19 +432,19 @@ _unwind___svml_atan22_ha_ex_B1_B4: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_atan22_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_ex_B7_B11: +_unwind___jsvml_atan22_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_atan22_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -453,17 +453,17 @@ _unwind___svml_atan22_ha_ex_B7_B11: DD imagerel _B1_7 DD imagerel _B1_12 - DD imagerel _unwind___svml_atan22_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_atan22_ha_ex_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_ex_B12_B12: +_unwind___jsvml_atan22_ha_ex_B12_B12: DD 33 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_atan22_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -472,7 +472,7 @@ _unwind___svml_atan22_ha_ex_B12_B12: DD imagerel _B1_12 DD imagerel _B1_13 - DD imagerel _unwind___svml_atan22_ha_ex_B12_B12 + DD imagerel _unwind___jsvml_atan22_ha_ex_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -486,9 +486,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan21_ha_ex + PUBLIC __jsvml_atan21_ha_ex -__svml_atan21_ha_ex PROC EXPORT +__jsvml_atan21_ha_ex PROC EXPORT _B2_1:: @@ -520,13 +520,13 @@ L44:: movups XMMWORD PTR [384+rsp], xmm6 mov QWORD PTR [232+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm5, QWORD PTR [__svml_datan2_ha_data_internal+896] + movsd xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+896] and r13, -64 movaps xmm12, xmm5 andps xmm5, xmm0 andps xmm12, xmm9 movaps xmm2, xmm5 - movsd xmm13, QWORD PTR [__svml_datan2_ha_data_internal+2880] + movsd xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+2880] movaps xmm10, xmm12 movups XMMWORD PTR [416+rsp], xmm9 pxor xmm10, xmm9 @@ -534,15 +534,15 @@ L44:: pxor xmm2, xmm0 movups XMMWORD PTR [432+rsp], xmm13 movaps xmm1, xmm12 - movsd xmm11, QWORD PTR [__svml_datan2_ha_data_internal+960] + movsd xmm11, QWORD PTR [__jsvml_datan2_ha_data_internal+960] cmpltsd xmm9, xmm13 - movsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+1024] + movsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+1024] andps xmm11, xmm9 pshufd xmm13, xmm12, 85 andps xmm9, xmm7 pshufd xmm0, xmm5, 85 movdqa xmm15, xmm13 - movsd xmm8, QWORD PTR [__svml_datan2_ha_data_internal+1088] + movsd xmm8, QWORD PTR [__jsvml_datan2_ha_data_internal+1088] movdqa xmm7, xmm0 movaps xmm3, xmm8 psubd xmm15, xmm14 @@ -576,13 +576,13 @@ L44:: movaps xmm15, xmm12 movaps xmm6, xmm12 por xmm13, xmm5 - mulsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+1152] + mulsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+1152] andps xmm4, xmm12 subsd xmm1, xmm4 - mulsd xmm6, QWORD PTR [__svml_datan2_ha_data_internal+1216] + mulsd xmm6, QWORD PTR [__jsvml_datan2_ha_data_internal+1216] subsd xmm2, xmm3 - mulsd xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1280] - mulsd xmm15, QWORD PTR [__svml_datan2_ha_data_internal+1344] + mulsd xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1280] + mulsd xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+1344] pshufd xmm5, xmm7, 85 mov r8d, 1065353216 pshufd xmm7, xmm15, 85 @@ -606,12 +606,12 @@ L44:: pslld xmm5, 5 pxor xmm9, xmm10 movd edx, xmm5 - movq xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rax+rdx] + movq xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rax+rdx] movdqa xmm5, xmm6 movdqa xmm7, xmm6 mulsd xmm5, xmm4 mulsd xmm7, xmm1 - movq xmm14, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rax+rdx] + movq xmm14, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rax+rdx] movdqa xmm0, xmm14 movdqa xmm15, xmm14 andps xmm4, xmm14 @@ -659,15 +659,15 @@ L44:: psubd xmm0, xmm14 psubd xmm1, xmm2 paddd xmm1, xmm0 - movsd xmm15, QWORD PTR [__svml_datan2_ha_data_internal+3008] + movsd xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+3008] pshufd xmm0, xmm1, 0 andps xmm0, xmm15 mulsd xmm8, xmm0 movaps xmm1, xmm0 mulsd xmm6, xmm0 mulsd xmm1, xmm7 - subsd xmm8, QWORD PTR [__svml_datan2_ha_data_internal+1792] - movsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+1856] + subsd xmm8, QWORD PTR [__jsvml_datan2_ha_data_internal+1792] + movsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+1856] addsd xmm6, xmm8 movaps xmm8, xmm6 mulsd xmm8, xmm6 @@ -686,11 +686,11 @@ L44:: movaps xmm15, xmm0 mulsd xmm6, xmm5 mulsd xmm8, xmm7 - movsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+1920] + movsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+1920] addsd xmm8, xmm6 addsd xmm1, xmm8 addsd xmm15, xmm1 - addsd xmm1, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rax+rdx] + addsd xmm1, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rax+rdx] movaps xmm14, xmm15 addsd xmm1, xmm9 mulsd xmm14, xmm15 @@ -698,31 +698,31 @@ L44:: mulsd xmm5, xmm14 mulsd xmm2, xmm5 mulsd xmm7, xmm5 - addsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+1984] - addsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+2048] + addsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+1984] + addsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+2048] mulsd xmm2, xmm5 mulsd xmm7, xmm5 - addsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+2112] - addsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+2176] + addsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+2112] + addsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+2176] mulsd xmm2, xmm5 mulsd xmm7, xmm5 - addsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+2240] - addsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+2304] + addsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+2240] + addsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+2304] mulsd xmm2, xmm5 mulsd xmm7, xmm5 - addsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+2368] - addsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+2432] + addsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+2368] + addsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+2432] mulsd xmm2, xmm5 mulsd xmm7, xmm5 - addsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+2496] - addsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+2560] + addsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+2496] + addsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+2560] mulsd xmm2, xmm14 addsd xmm2, xmm7 mulsd xmm2, xmm14 mulsd xmm2, xmm15 addsd xmm2, xmm1 addsd xmm0, xmm2 - addsd xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rax+rdx] + addsd xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rax+rdx] movmskps eax, xmm13 pxor xmm0, xmm10 movups xmm10, XMMWORD PTR [448+rsp] @@ -776,7 +776,7 @@ _B2_7:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B2_5 _B2_8:: @@ -788,9 +788,9 @@ _B2_8:: movaps xmm2, xmm8 movups xmm1, XMMWORD PTR [432+rsp] movaps xmm11, xmm7 - movsd xmm4, QWORD PTR [__svml_datan2_ha_data_internal+832] + movsd xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+832] andnps xmm2, xmm12 - movsd xmm3, QWORD PTR [__svml_datan2_ha_data_internal+3136] + movsd xmm3, QWORD PTR [__jsvml_datan2_ha_data_internal+3136] movaps xmm5, xmm4 andps xmm4, xmm9 andps xmm3, xmm8 @@ -817,7 +817,7 @@ _B2_8:: pshufd xmm13, xmm7, 85 orps xmm8, xmm5 pcmpgtd xmm15, xmm13 - movsd xmm6, QWORD PTR [__svml_datan2_ha_data_internal+3072] + movsd xmm6, QWORD PTR [__jsvml_datan2_ha_data_internal+3072] pshufd xmm1, xmm15, 0 andps xmm1, xmm6 pshufd xmm2, xmm12, 0 @@ -835,13 +835,13 @@ _B2_8:: _B2_9:: -__svml_atan21_ha_ex ENDP +__jsvml_atan21_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan21_ha_ex_B1_B8: +_unwind___jsvml_atan21_ha_ex_B1_B8: DD 1612289 DD 1954970 DD 1599634 @@ -863,7 +863,7 @@ _unwind___svml_atan21_ha_ex_B1_B8: DD imagerel _B2_1 DD imagerel _B2_9 - DD imagerel _unwind___svml_atan21_ha_ex_B1_B8 + DD imagerel _unwind___jsvml_atan21_ha_ex_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -877,9 +877,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan24_ha_l9 + PUBLIC __jsvml_atan24_ha_l9 -__svml_atan24_ha_l9 PROC EXPORT +__jsvml_atan24_ha_l9 PROC EXPORT _B3_1:: @@ -904,10 +904,10 @@ L79:: vmovups YMMWORD PTR [304+rsp], ymm6 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd ymm14, YMMWORD PTR [__svml_datan2_ha_data_internal+896] + vmovupd ymm14, YMMWORD PTR [__jsvml_datan2_ha_data_internal+896] and r13, -64 - vmovupd ymm12, YMMWORD PTR [__svml_datan2_ha_data_internal+2880] - vmovups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2688] + vmovupd ymm12, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2880] + vmovups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2688] vmovupd YMMWORD PTR [32+r13], ymm0 vcmplt_oqpd ymm5, ymm1, ymm12 vmovupd YMMWORD PTR [r13], ymm12 @@ -915,9 +915,9 @@ L79:: vandpd ymm14, ymm0, ymm14 vxorpd ymm11, ymm1, ymm15 vxorpd ymm13, ymm0, ymm14 - vandpd ymm12, ymm5, YMMWORD PTR [__svml_datan2_ha_data_internal+960] - vandpd ymm10, ymm5, YMMWORD PTR [__svml_datan2_ha_data_internal+1024] - vmovups xmm0, XMMWORD PTR [__svml_datan2_ha_data_internal+2752] + vandpd ymm12, ymm5, YMMWORD PTR [__jsvml_datan2_ha_data_internal+960] + vandpd ymm10, ymm5, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1024] + vmovups xmm0, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2752] vxorpd ymm10, ymm10, ymm11 mov QWORD PTR [600+rsp], r13 vextracti128 xmm9, ymm15, 1 @@ -929,15 +929,15 @@ L79:: vpcmpgtd xmm9, xmm8, xmm0 vpcmpeqd xmm7, xmm8, xmm0 vpcmpgtd xmm2, xmm3, xmm0 - vmulpd ymm8, ymm15, YMMWORD PTR [__svml_datan2_ha_data_internal+1344] + vmulpd ymm8, ymm15, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1344] vpcmpeqd xmm0, xmm3, xmm0 - vmulpd ymm3, ymm15, YMMWORD PTR [__svml_datan2_ha_data_internal+1152] + vmulpd ymm3, ymm15, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1152] vpor xmm6, xmm9, xmm7 - vmulpd ymm7, ymm15, YMMWORD PTR [__svml_datan2_ha_data_internal+1216] + vmulpd ymm7, ymm15, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1216] vpor xmm4, xmm2, xmm0 vpor xmm0, xmm6, xmm4 - vmulpd ymm6, ymm15, YMMWORD PTR [__svml_datan2_ha_data_internal+1280] - vmovupd ymm9, YMMWORD PTR [__svml_datan2_ha_data_internal+1792] + vmulpd ymm6, ymm15, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1280] + vmovupd ymm9, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1792] vmovmskps r11d, xmm0 test r11d, r11d vextracti128 xmm2, ymm3, 1 @@ -959,77 +959,77 @@ L79:: vpsrad xmm5, xmm5, 31 vpaddd xmm8, xmm8, xmm5 vpaddd xmm3, xmm7, xmm8 - vpaddd xmm2, xmm3, XMMWORD PTR [__svml_datan2_ha_data_internal+1408] + vpaddd xmm2, xmm3, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1408] vpslld xmm8, xmm2, 5 vmovd ecx, xmm8 vpextrd r9d, xmm8, 2 vpextrd eax, xmm8, 1 - vmovq xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+rcx] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+rcx] vpextrd r10d, xmm8, 3 - vmovq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+r9] - vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+rax] - vmovhpd xmm7, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+r10] - vmovq xmm3, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+rcx] - vmovq xmm8, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+r9] - vmovhpd xmm6, xmm3, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+rax] - vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+r9] + vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+rax] + vmovhpd xmm7, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+rcx] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+r9] + vmovhpd xmm6, xmm3, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+rax] + vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+r10] vinsertf128 ymm2, ymm4, xmm7, 1 - vmovq xmm7, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+rcx] - vmovq xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+r9] - vmovhpd xmm3, xmm7, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+rax] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+r9] + vmovhpd xmm3, xmm7, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+rax] vinsertf128 ymm8, ymm6, xmm5, 1 - vmovhpd xmm5, xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+r10] - vmovq xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+rcx] - vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+rax] + vmovhpd xmm5, xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+r10] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+rcx] + vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+rax] vinsertf128 ymm7, ymm3, xmm5, 1 - vmovq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+r9] - vmovhpd xmm3, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+r9] + vmovhpd xmm3, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+r10] vinsertf128 ymm6, ymm4, xmm3, 1 vandpd ymm3, ymm6, ymm14 vandpd ymm5, ymm6, ymm15 vfnmadd231pd ymm3, ymm15, ymm2 vfmadd213pd ymm2, ymm14, ymm5 - vmovups xmm5, XMMWORD PTR [__svml_datan2_ha_data_internal+1536] + vmovups xmm5, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1536] vextracti128 xmm6, ymm2, 1 vshufps xmm4, xmm2, xmm6, 221 - vandps xmm6, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1472] + vandps xmm6, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1472] vpslld xmm4, xmm4, 3 vpsubd xmm6, xmm5, xmm6 - vandps xmm5, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1600] - vorps xmm4, xmm5, XMMWORD PTR [__svml_datan2_ha_data_internal+1664] + vandps xmm5, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1600] + vorps xmm4, xmm5, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1664] vrcpps xmm5, xmm4 vpsrld xmm4, xmm5, 3 - vpsubd xmm5, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1728] + vpsubd xmm5, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1728] vpaddd xmm5, xmm5, xmm6 vpshufd xmm6, xmm5, 80 vpshufd xmm4, xmm5, 250 vinserti128 ymm5, ymm6, xmm4, 1 - vandpd ymm4, ymm5, YMMWORD PTR [__svml_datan2_ha_data_internal+3008] + vandpd ymm4, ymm5, YMMWORD PTR [__jsvml_datan2_ha_data_internal+3008] vmovdqa ymm6, ymm9 vfnmadd231pd ymm6, ymm4, ymm2 vfmadd213pd ymm6, ymm6, ymm6 vfmadd213pd ymm4, ymm6, ymm4 - vmovupd ymm6, YMMWORD PTR [__svml_datan2_ha_data_internal+1856] + vmovupd ymm6, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1856] vfnmadd231pd ymm9, ymm4, ymm2 vfmadd213pd ymm4, ymm9, ymm4 vmulpd ymm5, ymm3, ymm4 vfnmadd213pd ymm2, ymm5, ymm3 - vmovupd ymm3, YMMWORD PTR [__svml_datan2_ha_data_internal+1920] + vmovupd ymm3, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1920] vmulpd ymm9, ymm4, ymm2 vmulpd ymm4, ymm5, ymm5 vaddpd ymm7, ymm7, ymm9 vmulpd ymm2, ymm4, ymm4 vaddpd ymm9, ymm10, ymm7 - vfmadd213pd ymm6, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+1984] - vfmadd213pd ymm3, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2048] - vfmadd213pd ymm6, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2112] - vfmadd213pd ymm3, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2176] - vfmadd213pd ymm6, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2240] - vfmadd213pd ymm3, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2304] - vfmadd213pd ymm6, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2368] - vfmadd213pd ymm3, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2432] - vfmadd213pd ymm6, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2496] - vfmadd213pd ymm3, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+2560] + vfmadd213pd ymm6, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vfmadd213pd ymm3, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2048] + vfmadd213pd ymm6, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2112] + vfmadd213pd ymm3, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2176] + vfmadd213pd ymm6, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vfmadd213pd ymm3, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2304] + vfmadd213pd ymm6, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vfmadd213pd ymm3, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2432] + vfmadd213pd ymm6, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2496] + vfmadd213pd ymm3, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2560] vfmadd213pd ymm6, ymm4, ymm3 vmulpd ymm2, ymm4, ymm6 vfmadd213pd ymm2, ymm5, ymm9 @@ -1103,13 +1103,13 @@ _B3_11:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B3_9 _B3_12:: vmovupd ymm11, YMMWORD PTR [32+r13] - vmovupd ymm9, YMMWORD PTR [__svml_datan2_ha_data_internal+832] + vmovupd ymm9, YMMWORD PTR [__jsvml_datan2_ha_data_internal+832] vcmpordpd ymm12, ymm1, ymm1 vcmpordpd ymm13, ymm11, ymm11 vcmpnlt_uqpd ymm10, ymm14, ymm15 @@ -1117,7 +1117,7 @@ _B3_12:: vblendvpd ymm4, ymm15, ymm14, ymm10 vandpd ymm6, ymm1, ymm9 vandpd ymm7, ymm11, ymm9 - vandpd ymm5, ymm10, YMMWORD PTR [__svml_datan2_ha_data_internal+3136] + vandpd ymm5, ymm10, YMMWORD PTR [__jsvml_datan2_ha_data_internal+3136] vextracti128 xmm2, ymm3, 1 vshufps xmm2, xmm3, xmm2, 221 vmovupd ymm3, YMMWORD PTR [r13] @@ -1140,7 +1140,7 @@ _B3_12:: vpshufd xmm2, xmm3, 80 vpshufd xmm3, xmm3, 250 vinserti128 ymm2, ymm2, xmm3, 1 - vandpd ymm2, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+3072] + vandpd ymm2, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+3072] vaddpd ymm2, ymm14, ymm2 vorpd ymm3, ymm2, ymm7 vpshufd xmm2, xmm15, 80 @@ -1152,13 +1152,13 @@ _B3_12:: _B3_13:: -__svml_atan24_ha_l9 ENDP +__jsvml_atan24_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan24_ha_l9_B1_B4: +_unwind___jsvml_atan24_ha_l9_B1_B4: DD 1603329 DD 4904055 DD 1271919 @@ -1180,19 +1180,19 @@ _unwind___svml_atan24_ha_l9_B1_B4: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_atan24_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan24_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan24_ha_l9_B7_B11: +_unwind___jsvml_atan24_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_atan24_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan24_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1201,17 +1201,17 @@ _unwind___svml_atan24_ha_l9_B7_B11: DD imagerel _B3_7 DD imagerel _B3_12 - DD imagerel _unwind___svml_atan24_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_atan24_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan24_ha_l9_B12_B12: +_unwind___jsvml_atan24_ha_l9_B12_B12: DD 33 DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_atan24_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan24_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1220,7 +1220,7 @@ _unwind___svml_atan24_ha_l9_B12_B12: DD imagerel _B3_12 DD imagerel _B3_13 - DD imagerel _unwind___svml_atan24_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_atan24_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1234,9 +1234,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan24_ha_e9 + PUBLIC __jsvml_atan24_ha_e9 -__svml_atan24_ha_e9 PROC EXPORT +__jsvml_atan24_ha_e9 PROC EXPORT _B4_1:: @@ -1261,10 +1261,10 @@ L111:: vmovups YMMWORD PTR [368+rsp], ymm6 mov QWORD PTR [656+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd ymm13, YMMWORD PTR [__svml_datan2_ha_data_internal+896] + vmovupd ymm13, YMMWORD PTR [__jsvml_datan2_ha_data_internal+896] and r13, -64 - vmovupd ymm8, YMMWORD PTR [__svml_datan2_ha_data_internal+1088] - vmovupd ymm9, YMMWORD PTR [__svml_datan2_ha_data_internal+2880] + vmovupd ymm8, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1088] + vmovupd ymm9, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2880] vmovupd YMMWORD PTR [64+r13], ymm1 vmovupd YMMWORD PTR [32+r13], ymm0 vcmplt_oqpd ymm2, ymm1, ymm9 @@ -1280,10 +1280,10 @@ L111:: vsubpd ymm11, ymm5, ymm12 vsubpd ymm10, ymm6, ymm7 vxorpd ymm13, ymm1, ymm6 - vandpd ymm4, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+960] + vandpd ymm4, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+960] vmovupd YMMWORD PTR [192+r13], ymm4 - vmovups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2688] - vandpd ymm9, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+1024] + vmovups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2688] + vandpd ymm9, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1024] vxorpd ymm9, ymm9, ymm13 mov QWORD PTR [664+rsp], r13 vextractf128 xmm3, ymm6, 1 @@ -1293,25 +1293,25 @@ L111:: vpsubd xmm15, xmm2, xmm4 vpsubd xmm14, xmm5, xmm4 vpsubd xmm1, xmm5, xmm2 - vmovups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2752] - vpaddd xmm0, xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+3200] + vmovups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2752] + vpaddd xmm0, xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3200] vpcmpgtd xmm3, xmm15, xmm4 vpcmpeqd xmm15, xmm15, xmm4 vpcmpgtd xmm2, xmm14, xmm4 vpcmpeqd xmm14, xmm14, xmm4 vpor xmm1, xmm3, xmm15 - vmovups xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+3264] + vmovups xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3264] vpor xmm15, xmm2, xmm14 vpcmpgtd xmm2, xmm4, xmm0 vpcmpeqd xmm0, xmm4, xmm0 - vmulpd ymm14, ymm6, YMMWORD PTR [__svml_datan2_ha_data_internal+1152] + vmulpd ymm14, ymm6, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1152] vpor xmm3, xmm1, xmm15 vpor xmm15, xmm2, xmm0 vpor xmm4, xmm3, xmm15 vmovdqu XMMWORD PTR [32+rsp], xmm4 - vmulpd ymm0, ymm6, YMMWORD PTR [__svml_datan2_ha_data_internal+1344] - vmulpd ymm2, ymm6, YMMWORD PTR [__svml_datan2_ha_data_internal+1216] - vmulpd ymm6, ymm6, YMMWORD PTR [__svml_datan2_ha_data_internal+1280] + vmulpd ymm0, ymm6, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1344] + vmulpd ymm2, ymm6, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1216] + vmulpd ymm6, ymm6, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1280] vextractf128 xmm15, ymm14, 1 vextractf128 xmm1, ymm0, 1 vextractf128 xmm3, ymm2, 1 @@ -1331,31 +1331,31 @@ L111:: vpaddd xmm15, xmm15, xmm4 vpaddd xmm6, xmm2, xmm5 vpaddd xmm4, xmm15, xmm6 - vpaddd xmm2, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1408] + vpaddd xmm2, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1408] vpslld xmm3, xmm2, 5 vmovd ecx, xmm3 vpextrd r9d, xmm3, 2 vpextrd eax, xmm3, 1 - vmovq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+rcx] vpextrd r10d, xmm3, 3 - vmovq xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+r9] - vmovq xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+r9] - vmovhpd xmm1, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+rax] - vmovq xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+rcx] - vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rdx+r10] - vmovq xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+r9] - vmovhpd xmm6, xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+rax] - vmovhpd xmm2, xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rdx+r10] - vmovq xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+r9] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+r9] + vmovhpd xmm1, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+rax] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+rcx] + vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rdx+r10] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+r9] + vmovhpd xmm6, xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+rax] + vmovhpd xmm2, xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rdx+r10] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+rcx] vinsertf128 ymm3, ymm1, xmm14, 1 - vmovhpd xmm1, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+rax] - vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rdx+r10] - vmovq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+r9] + vmovhpd xmm1, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+rax] + vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+r9] vinsertf128 ymm15, ymm6, xmm2, 1 - vmovhpd xmm2, xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+rax] + vmovhpd xmm2, xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+rax] vinsertf128 ymm6, ymm1, xmm14, 1 - vmovhpd xmm1, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rdx+r10] + vmovhpd xmm1, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rdx+r10] vmulpd ymm14, ymm7, ymm3 vinsertf128 ymm1, ymm2, xmm1, 1 vmulpd ymm2, ymm3, ymm10 @@ -1381,25 +1381,25 @@ L111:: vandpd ymm10, ymm12, ymm8 vsubpd ymm8, ymm12, ymm10 vaddpd ymm3, ymm7, ymm8 - vmovups xmm7, XMMWORD PTR [__svml_datan2_ha_data_internal+1536] + vmovups xmm7, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1536] vextractf128 xmm12, ymm10, 1 vshufps xmm8, xmm10, xmm12, 221 vpslld xmm2, xmm8, 3 - vandps xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+1600] - vorps xmm0, xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+1664] + vandps xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1600] + vorps xmm0, xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1664] vrcpps xmm14, xmm0 - vandps xmm11, xmm8, XMMWORD PTR [__svml_datan2_ha_data_internal+1472] + vandps xmm11, xmm8, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1472] vpsrld xmm12, xmm14, 3 vpsubd xmm11, xmm7, xmm11 - vpsubd xmm7, xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+1728] + vpsubd xmm7, xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1728] vpaddd xmm2, xmm7, xmm11 vpshufd xmm8, xmm2, 80 vpshufd xmm1, xmm2, 250 vinsertf128 ymm0, ymm8, xmm1, 1 - vandpd ymm2, ymm0, YMMWORD PTR [__svml_datan2_ha_data_internal+3008] + vandpd ymm2, ymm0, YMMWORD PTR [__jsvml_datan2_ha_data_internal+3008] vmulpd ymm10, ymm10, ymm2 vmulpd ymm3, ymm2, ymm3 - vsubpd ymm14, ymm10, YMMWORD PTR [__svml_datan2_ha_data_internal+1792] + vsubpd ymm14, ymm10, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1792] vaddpd ymm1, ymm14, ymm3 vmulpd ymm10, ymm1, ymm1 vsubpd ymm12, ymm10, ymm1 @@ -1422,26 +1422,26 @@ L111:: vaddpd ymm6, ymm6, ymm7 vmulpd ymm11, ymm12, ymm12 vmulpd ymm8, ymm11, ymm11 - vmulpd ymm2, ymm8, YMMWORD PTR [__svml_datan2_ha_data_internal+1856] - vmulpd ymm4, ymm8, YMMWORD PTR [__svml_datan2_ha_data_internal+1920] - vaddpd ymm0, ymm2, YMMWORD PTR [__svml_datan2_ha_data_internal+1984] - vaddpd ymm2, ymm4, YMMWORD PTR [__svml_datan2_ha_data_internal+2048] + vmulpd ymm2, ymm8, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1856] + vmulpd ymm4, ymm8, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1920] + vaddpd ymm0, ymm2, YMMWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vaddpd ymm2, ymm4, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2048] vmulpd ymm1, ymm8, ymm0 vmulpd ymm3, ymm8, ymm2 - vaddpd ymm4, ymm1, YMMWORD PTR [__svml_datan2_ha_data_internal+2112] - vaddpd ymm14, ymm3, YMMWORD PTR [__svml_datan2_ha_data_internal+2176] + vaddpd ymm4, ymm1, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2112] + vaddpd ymm14, ymm3, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2176] vmulpd ymm5, ymm8, ymm4 vmulpd ymm14, ymm8, ymm14 - vaddpd ymm0, ymm5, YMMWORD PTR [__svml_datan2_ha_data_internal+2240] - vaddpd ymm2, ymm14, YMMWORD PTR [__svml_datan2_ha_data_internal+2304] + vaddpd ymm0, ymm5, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vaddpd ymm2, ymm14, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2304] vmulpd ymm1, ymm8, ymm0 vmulpd ymm3, ymm8, ymm2 - vaddpd ymm4, ymm1, YMMWORD PTR [__svml_datan2_ha_data_internal+2368] - vaddpd ymm0, ymm3, YMMWORD PTR [__svml_datan2_ha_data_internal+2432] + vaddpd ymm4, ymm1, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vaddpd ymm0, ymm3, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2432] vmulpd ymm5, ymm8, ymm4 vmulpd ymm8, ymm8, ymm0 - vaddpd ymm1, ymm5, YMMWORD PTR [__svml_datan2_ha_data_internal+2496] - vaddpd ymm0, ymm8, YMMWORD PTR [__svml_datan2_ha_data_internal+2560] + vaddpd ymm1, ymm5, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2496] + vaddpd ymm0, ymm8, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2560] vmulpd ymm2, ymm11, ymm1 vaddpd ymm3, ymm0, ymm2 vaddpd ymm0, ymm9, ymm6 @@ -1523,13 +1523,13 @@ _B4_11:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B4_9 _B4_12:: vmovupd ymm13, YMMWORD PTR [32+r13] - vmovupd ymm11, YMMWORD PTR [__svml_datan2_ha_data_internal+832] + vmovupd ymm11, YMMWORD PTR [__jsvml_datan2_ha_data_internal+832] vcmpordpd ymm14, ymm10, ymm10 vcmpordpd ymm15, ymm13, ymm13 vcmpnlt_uqpd ymm12, ymm1, ymm2 @@ -1537,7 +1537,7 @@ _B4_12:: vblendvpd ymm5, ymm2, ymm1, ymm12 vandpd ymm7, ymm10, ymm11 vandpd ymm8, ymm13, ymm11 - vandpd ymm6, ymm12, YMMWORD PTR [__svml_datan2_ha_data_internal+3136] + vandpd ymm6, ymm12, YMMWORD PTR [__jsvml_datan2_ha_data_internal+3136] vextractf128 xmm3, ymm4, 1 vshufps xmm3, xmm4, xmm3, 221 vmovupd ymm4, YMMWORD PTR [r13] @@ -1560,7 +1560,7 @@ _B4_12:: vpshufd xmm11, xmm12, 80 vpshufd xmm13, xmm12, 250 vinsertf128 ymm14, ymm11, xmm13, 1 - vandpd ymm15, ymm14, YMMWORD PTR [__svml_datan2_ha_data_internal+3072] + vandpd ymm15, ymm14, YMMWORD PTR [__jsvml_datan2_ha_data_internal+3072] vaddpd ymm1, ymm1, ymm15 vorpd ymm1, ymm1, ymm8 vpshufd xmm8, xmm2, 80 @@ -1572,13 +1572,13 @@ _B4_12:: _B4_13:: -__svml_atan24_ha_e9 ENDP +__jsvml_atan24_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan24_ha_e9_B1_B4: +_unwind___jsvml_atan24_ha_e9_B1_B4: DD 1603329 DD 5428343 DD 1534063 @@ -1600,19 +1600,19 @@ _unwind___svml_atan24_ha_e9_B1_B4: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_atan24_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan24_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan24_ha_e9_B7_B11: +_unwind___jsvml_atan24_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_atan24_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan24_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1621,17 +1621,17 @@ _unwind___svml_atan24_ha_e9_B7_B11: DD imagerel _B4_7 DD imagerel _B4_12 - DD imagerel _unwind___svml_atan24_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_atan24_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan24_ha_e9_B12_B12: +_unwind___jsvml_atan24_ha_e9_B12_B12: DD 33 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_atan24_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan24_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1640,7 +1640,7 @@ _unwind___svml_atan24_ha_e9_B12_B12: DD imagerel _B4_12 DD imagerel _B4_13 - DD imagerel _unwind___svml_atan24_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_atan24_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1654,9 +1654,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan22_ha_l9 + PUBLIC __jsvml_atan22_ha_l9 -__svml_atan22_ha_l9 PROC EXPORT +__jsvml_atan22_ha_l9 PROC EXPORT _B5_1:: @@ -1682,24 +1682,24 @@ L155:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [432+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm5, XMMWORD PTR [__svml_datan2_ha_data_internal+2880] + vmovupd xmm5, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2880] and r13, -64 vcmpltpd xmm4, xmm13, xmm5 - vmovupd xmm10, XMMWORD PTR [__svml_datan2_ha_data_internal+896] + vmovupd xmm10, XMMWORD PTR [__jsvml_datan2_ha_data_internal+896] vandpd xmm11, xmm13, xmm10 vandpd xmm10, xmm0, xmm10 vpshufd xmm1, xmm10, 221 vxorpd xmm9, xmm0, xmm10 - vmovq xmm3, QWORD PTR [__svml_datan2_ha_data_internal+2688] + vmovq xmm3, QWORD PTR [__jsvml_datan2_ha_data_internal+2688] vxorpd xmm7, xmm13, xmm11 vpshufd xmm2, xmm11, 221 vpsubd xmm14, xmm1, xmm3 - vmovq xmm12, QWORD PTR [__svml_datan2_ha_data_internal+2752] + vmovq xmm12, QWORD PTR [__jsvml_datan2_ha_data_internal+2752] vmovupd XMMWORD PTR [416+rsp], xmm5 vpsubd xmm5, xmm2, xmm3 - vandpd xmm8, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+960] + vandpd xmm8, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+960] vpcmpgtd xmm15, xmm5, xmm12 - vandpd xmm6, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+1024] + vandpd xmm6, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1024] vpcmpeqd xmm4, xmm5, xmm12 vpcmpgtd xmm2, xmm14, xmm12 vpcmpeqd xmm12, xmm14, xmm12 @@ -1707,11 +1707,11 @@ L155:: vpor xmm3, xmm15, xmm4 vpor xmm0, xmm2, xmm12 vxorpd xmm6, xmm6, xmm7 - vmulpd xmm4, xmm11, XMMWORD PTR [__svml_datan2_ha_data_internal+1152] - vmulpd xmm5, xmm11, XMMWORD PTR [__svml_datan2_ha_data_internal+1216] - vmulpd xmm15, xmm11, XMMWORD PTR [__svml_datan2_ha_data_internal+1280] + vmulpd xmm4, xmm11, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1152] + vmulpd xmm5, xmm11, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1216] + vmulpd xmm15, xmm11, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1280] vpor xmm12, xmm3, xmm0 - vmulpd xmm3, xmm11, XMMWORD PTR [__svml_datan2_ha_data_internal+1344] + vmulpd xmm3, xmm11, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1344] vmovmskps r9d, xmm12 vpshufd xmm2, xmm4, 221 vpshufd xmm3, xmm3, 221 @@ -1727,44 +1727,44 @@ L155:: vpsrad xmm15, xmm1, 31 vpaddd xmm4, xmm2, xmm4 vpaddd xmm5, xmm5, xmm15 - vmovq xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1408] + vmovq xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1408] vpaddd xmm2, xmm4, xmm5 vpaddd xmm14, xmm2, xmm14 vpslld xmm3, xmm14, 5 vmovd edx, xmm3 vpextrd ecx, xmm3, 1 - vmovq xmm14, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+r8+rdx] - vmovq xmm1, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+r8+rdx] - vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+r8+rcx] - vmovhpd xmm0, xmm1, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+r8+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+r8+rdx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+r8+rdx] + vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+r8+rcx] + vmovhpd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+r8+rcx] vandpd xmm2, xmm3, xmm10 vandpd xmm3, xmm3, xmm11 vfmadd231pd xmm3, xmm10, xmm0 - vmovq xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+r8+rdx] - vmovhpd xmm4, xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+r8+rcx] - vmovq xmm15, QWORD PTR [__svml_datan2_ha_data_internal+1600] - vmovq xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1664] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+r8+rdx] + vmovhpd xmm4, xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+r8+rcx] + vmovq xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+1600] + vmovq xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1664] vpshufd xmm1, xmm3, 221 vfnmadd231pd xmm2, xmm11, xmm0 vpslld xmm0, xmm1, 3 vpand xmm0, xmm0, xmm15 vpor xmm14, xmm0, xmm14 - vmovq xmm0, QWORD PTR [__svml_datan2_ha_data_internal+1728] - vmovq xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+r8+rdx] + vmovq xmm0, QWORD PTR [__jsvml_datan2_ha_data_internal+1728] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+r8+rdx] vrcpps xmm15, xmm14 vpsrld xmm14, xmm15, 3 vpsubd xmm15, xmm14, xmm0 - vmovq xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1472] + vmovq xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1472] vpand xmm14, xmm1, xmm14 - vmovq xmm1, QWORD PTR [__svml_datan2_ha_data_internal+1536] + vmovq xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+1536] vpsubd xmm0, xmm1, xmm14 vpaddd xmm15, xmm15, xmm0 vpshufd xmm1, xmm15, 80 - vandpd xmm1, xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+3008] - vmovupd xmm0, XMMWORD PTR [__svml_datan2_ha_data_internal+1792] + vandpd xmm1, xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3008] + vmovupd xmm0, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1792] vmovapd xmm14, xmm1 vfnmadd213pd xmm14, xmm3, xmm0 - vmovhpd xmm5, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+r8+rcx] + vmovhpd xmm5, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+r8+rcx] vfmadd213pd xmm14, xmm14, xmm14 vfmadd213pd xmm1, xmm14, xmm1 vfnmadd231pd xmm0, xmm1, xmm3 @@ -1774,20 +1774,20 @@ L155:: vfnmadd213pd xmm3, xmm15, xmm2 vmulpd xmm2, xmm0, xmm0 vmulpd xmm14, xmm1, xmm3 - vmovupd xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+1856] - vmovupd xmm3, XMMWORD PTR [__svml_datan2_ha_data_internal+1920] - vfmadd213pd xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+1984] - vfmadd213pd xmm3, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2048] + vmovupd xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1856] + vmovupd xmm3, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1920] + vfmadd213pd xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vfmadd213pd xmm3, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2048] vaddpd xmm4, xmm4, xmm14 - vfmadd213pd xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2112] - vfmadd213pd xmm3, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2176] + vfmadd213pd xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2112] + vfmadd213pd xmm3, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2176] vaddpd xmm6, xmm6, xmm4 - vfmadd213pd xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2240] - vfmadd213pd xmm3, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2304] - vfmadd213pd xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2368] - vfmadd213pd xmm3, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2432] - vfmadd213pd xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2496] - vfmadd213pd xmm3, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+2560] + vfmadd213pd xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vfmadd213pd xmm3, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2304] + vfmadd213pd xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vfmadd213pd xmm3, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2432] + vfmadd213pd xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2496] + vfmadd213pd xmm3, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2560] vfmadd213pd xmm1, xmm0, xmm3 vmulpd xmm2, xmm0, xmm1 vfmadd213pd xmm2, xmm15, xmm6 @@ -1861,7 +1861,7 @@ _B5_11:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B5_9 _B5_12:: @@ -1875,9 +1875,9 @@ _B5_12:: vcmpeqpd xmm11, xmm11, xmm1 vcmpeqpd xmm15, xmm10, xmm1 vcmpeqpd xmm2, xmm2, xmm1 - vmovupd xmm6, XMMWORD PTR [__svml_datan2_ha_data_internal+832] + vmovupd xmm6, XMMWORD PTR [__jsvml_datan2_ha_data_internal+832] vorpd xmm10, xmm11, xmm15 - vandpd xmm3, xmm7, XMMWORD PTR [__svml_datan2_ha_data_internal+3136] + vandpd xmm3, xmm7, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3136] vandpd xmm5, xmm13, xmm6 vandpd xmm4, xmm8, xmm6 vandpd xmm6, xmm9, xmm14 @@ -1891,7 +1891,7 @@ _B5_12:: vpshufd xmm5, xmm13, 221 vpcmpgtd xmm6, xmm1, xmm5 vpshufd xmm7, xmm6, 80 - vandpd xmm9, xmm7, XMMWORD PTR [__svml_datan2_ha_data_internal+3072] + vandpd xmm9, xmm7, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3072] vaddpd xmm11, xmm8, xmm9 vmovmskps eax, xmm12 vpshufd xmm10, xmm10, 80 @@ -1903,13 +1903,13 @@ _B5_12:: _B5_13:: -__svml_atan22_ha_l9 ENDP +__jsvml_atan22_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_l9_B1_B4: +_unwind___jsvml_atan22_ha_l9_B1_B4: DD 1604097 DD 3593338 DD 1075314 @@ -1931,19 +1931,19 @@ _unwind___svml_atan22_ha_l9_B1_B4: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_atan22_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_l9_B7_B11: +_unwind___jsvml_atan22_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_atan22_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1952,17 +1952,17 @@ _unwind___svml_atan22_ha_l9_B7_B11: DD imagerel _B5_7 DD imagerel _B5_12 - DD imagerel _unwind___svml_atan22_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_atan22_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_l9_B12_B12: +_unwind___jsvml_atan22_ha_l9_B12_B12: DD 33 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_atan22_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1971,7 +1971,7 @@ _unwind___svml_atan22_ha_l9_B12_B12: DD imagerel _B5_12 DD imagerel _B5_13 - DD imagerel _unwind___svml_atan22_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_atan22_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1985,9 +1985,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan22_ha_e9 + PUBLIC __jsvml_atan22_ha_e9 -__svml_atan22_ha_e9 PROC EXPORT +__jsvml_atan22_ha_e9 PROC EXPORT _B6_1:: @@ -2012,11 +2012,11 @@ L187:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [496+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm12, XMMWORD PTR [__svml_datan2_ha_data_internal+2880] + vmovupd xmm12, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2880] and r13, -64 vcmpltpd xmm3, xmm1, xmm12 - vmovupd xmm13, XMMWORD PTR [__svml_datan2_ha_data_internal+896] - vmovupd xmm6, XMMWORD PTR [__svml_datan2_ha_data_internal+1088] + vmovupd xmm13, XMMWORD PTR [__jsvml_datan2_ha_data_internal+896] + vmovupd xmm6, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1088] vandpd xmm4, xmm0, xmm13 vandpd xmm2, xmm1, xmm13 vandpd xmm10, xmm4, xmm6 @@ -2025,39 +2025,39 @@ L187:: vmovupd XMMWORD PTR [464+rsp], xmm4 vxorpd xmm11, xmm1, xmm2 vsubpd xmm9, xmm4, xmm10 - vandpd xmm12, xmm3, XMMWORD PTR [__svml_datan2_ha_data_internal+960] + vandpd xmm12, xmm3, XMMWORD PTR [__jsvml_datan2_ha_data_internal+960] vandpd xmm5, xmm2, xmm6 - vandpd xmm7, xmm3, XMMWORD PTR [__svml_datan2_ha_data_internal+1024] + vandpd xmm7, xmm3, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1024] vpshufd xmm3, xmm2, 221 vxorpd xmm7, xmm7, xmm11 vpshufd xmm4, xmm4, 221 - vmovq xmm15, QWORD PTR [__svml_datan2_ha_data_internal+2688] + vmovq xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+2688] vmovupd XMMWORD PTR [432+rsp], xmm1 vpsubd xmm14, xmm4, xmm15 vmovupd XMMWORD PTR [32+rsp], xmm0 vpsubd xmm0, xmm3, xmm15 - vmovq xmm1, QWORD PTR [__svml_datan2_ha_data_internal+3200] + vmovq xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+3200] vpsubd xmm15, xmm4, xmm3 vpaddd xmm3, xmm15, xmm1 - vmovq xmm15, QWORD PTR [__svml_datan2_ha_data_internal+2752] + vmovq xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+2752] vpcmpgtd xmm1, xmm0, xmm15 vpcmpeqd xmm0, xmm0, xmm15 vpor xmm0, xmm1, xmm0 vpcmpgtd xmm1, xmm14, xmm15 vpcmpeqd xmm14, xmm14, xmm15 vpor xmm15, xmm1, xmm14 - vmovq xmm14, QWORD PTR [__svml_datan2_ha_data_internal+3264] + vmovq xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+3264] vpor xmm0, xmm0, xmm15 vpcmpgtd xmm1, xmm14, xmm3 vpcmpeqd xmm3, xmm14, xmm3 vpor xmm3, xmm1, xmm3 - vmulpd xmm15, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+1152] - vmulpd xmm1, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+1216] + vmulpd xmm15, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1152] + vmulpd xmm1, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1216] vsubpd xmm8, xmm2, xmm5 vpor xmm0, xmm0, xmm3 - vmulpd xmm3, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+1344] + vmulpd xmm3, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1344] vmovdqu XMMWORD PTR [480+rsp], xmm0 - vmulpd xmm0, xmm2, XMMWORD PTR [__svml_datan2_ha_data_internal+1280] + vmulpd xmm0, xmm2, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1280] vmovupd XMMWORD PTR [448+rsp], xmm2 vpshufd xmm2, xmm15, 221 vpshufd xmm3, xmm3, 221 @@ -2073,19 +2073,19 @@ L187:: vpsrad xmm4, xmm4, 31 vpaddd xmm15, xmm15, xmm2 vpaddd xmm3, xmm3, xmm4 - vmovq xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1408] + vmovq xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1408] vpaddd xmm2, xmm15, xmm3 vpaddd xmm14, xmm2, xmm14 vpslld xmm3, xmm14, 5 vmovd edx, xmm3 vpextrd ecx, xmm3, 1 - vmovq xmm2, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+r8+rdx] - vmovq xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+r8+rdx] - vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+r8+rcx] - vmovhpd xmm2, xmm4, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+r8+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+r8+rdx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+r8+rdx] + vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+r8+rcx] + vmovhpd xmm2, xmm4, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+r8+rcx] vmulpd xmm4, xmm5, xmm1 - vmovq xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+r8+rdx] - vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+r8+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+r8+rdx] + vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+r8+rcx] vandpd xmm14, xmm0, xmm10 vandpd xmm5, xmm0, xmm5 vmulpd xmm10, xmm10, xmm1 @@ -2093,9 +2093,9 @@ L187:: vaddpd xmm10, xmm5, xmm10 vmulpd xmm14, xmm1, xmm8 vmulpd xmm5, xmm1, xmm9 - vmovq xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+r8+rdx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+r8+rdx] vandpd xmm8, xmm0, xmm8 - vmovhpd xmm3, xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+r8+rcx] + vmovhpd xmm3, xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+r8+rcx] vandpd xmm15, xmm0, xmm9 vsubpd xmm15, xmm15, xmm14 vaddpd xmm9, xmm8, xmm5 @@ -2112,25 +2112,25 @@ L187:: vsubpd xmm6, xmm5, xmm14 vpshufd xmm1, xmm14, 221 vaddpd xmm0, xmm10, xmm6 - vmovq xmm10, QWORD PTR [__svml_datan2_ha_data_internal+1600] + vmovq xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+1600] vpslld xmm8, xmm1, 3 - vmovq xmm5, QWORD PTR [__svml_datan2_ha_data_internal+1664] + vmovq xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+1664] vpand xmm8, xmm8, xmm10 vpor xmm5, xmm8, xmm5 vrcpps xmm8, xmm5 - vmovq xmm9, QWORD PTR [__svml_datan2_ha_data_internal+1728] + vmovq xmm9, QWORD PTR [__jsvml_datan2_ha_data_internal+1728] vpsrld xmm10, xmm8, 3 - vmovq xmm6, QWORD PTR [__svml_datan2_ha_data_internal+1472] + vmovq xmm6, QWORD PTR [__jsvml_datan2_ha_data_internal+1472] vpsubd xmm8, xmm10, xmm9 - vmovq xmm9, QWORD PTR [__svml_datan2_ha_data_internal+1536] + vmovq xmm9, QWORD PTR [__jsvml_datan2_ha_data_internal+1536] vpand xmm6, xmm1, xmm6 vpsubd xmm1, xmm9, xmm6 vpaddd xmm8, xmm8, xmm1 vpshufd xmm10, xmm8, 80 - vandpd xmm10, xmm10, XMMWORD PTR [__svml_datan2_ha_data_internal+3008] + vandpd xmm10, xmm10, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3008] vmulpd xmm14, xmm14, xmm10 vmulpd xmm0, xmm10, xmm0 - vsubpd xmm8, xmm14, XMMWORD PTR [__svml_datan2_ha_data_internal+1792] + vsubpd xmm8, xmm14, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1792] vaddpd xmm8, xmm8, xmm0 vmulpd xmm5, xmm8, xmm8 vsubpd xmm9, xmm5, xmm8 @@ -2153,26 +2153,26 @@ L187:: vaddpd xmm2, xmm2, xmm5 vmulpd xmm9, xmm10, xmm10 vmulpd xmm6, xmm9, xmm9 - vmulpd xmm15, xmm6, XMMWORD PTR [__svml_datan2_ha_data_internal+1856] - vmulpd xmm0, xmm6, XMMWORD PTR [__svml_datan2_ha_data_internal+1920] - vaddpd xmm1, xmm15, XMMWORD PTR [__svml_datan2_ha_data_internal+1984] - vaddpd xmm14, xmm0, XMMWORD PTR [__svml_datan2_ha_data_internal+2048] + vmulpd xmm15, xmm6, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1856] + vmulpd xmm0, xmm6, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1920] + vaddpd xmm1, xmm15, XMMWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vaddpd xmm14, xmm0, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2048] vmulpd xmm4, xmm6, xmm1 vmulpd xmm15, xmm6, xmm14 - vaddpd xmm0, xmm4, XMMWORD PTR [__svml_datan2_ha_data_internal+2112] - vaddpd xmm4, xmm15, XMMWORD PTR [__svml_datan2_ha_data_internal+2176] + vaddpd xmm0, xmm4, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2112] + vaddpd xmm4, xmm15, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2176] vmulpd xmm1, xmm6, xmm0 vmulpd xmm14, xmm6, xmm4 - vaddpd xmm15, xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+2240] - vaddpd xmm0, xmm14, XMMWORD PTR [__svml_datan2_ha_data_internal+2304] + vaddpd xmm15, xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vaddpd xmm0, xmm14, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2304] vmulpd xmm15, xmm6, xmm15 vmulpd xmm1, xmm6, xmm0 - vaddpd xmm4, xmm15, XMMWORD PTR [__svml_datan2_ha_data_internal+2368] - vaddpd xmm0, xmm1, XMMWORD PTR [__svml_datan2_ha_data_internal+2432] + vaddpd xmm4, xmm15, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vaddpd xmm0, xmm1, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2432] vmulpd xmm14, xmm6, xmm4 vmulpd xmm6, xmm6, xmm0 - vaddpd xmm1, xmm14, XMMWORD PTR [__svml_datan2_ha_data_internal+2496] - vaddpd xmm0, xmm6, XMMWORD PTR [__svml_datan2_ha_data_internal+2560] + vaddpd xmm1, xmm14, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2496] + vaddpd xmm0, xmm6, XMMWORD PTR [__jsvml_datan2_ha_data_internal+2560] vmulpd xmm4, xmm9, xmm1 vaddpd xmm6, xmm0, xmm4 vaddpd xmm0, xmm7, xmm2 @@ -2254,7 +2254,7 @@ _B6_11:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B6_9 _B6_12:: @@ -2268,12 +2268,12 @@ _B6_12:: vcmpeqpd xmm14, xmm14, xmm2 vcmpeqpd xmm15, xmm1, xmm2 vcmpeqpd xmm3, xmm3, xmm2 - vmovupd xmm9, XMMWORD PTR [__svml_datan2_ha_data_internal+832] + vmovupd xmm9, XMMWORD PTR [__jsvml_datan2_ha_data_internal+832] vorpd xmm1, xmm14, xmm15 vandpd xmm6, xmm8, xmm9 vandpd xmm5, xmm11, xmm9 vandpd xmm9, xmm12, xmm13 - vandpd xmm4, xmm10, XMMWORD PTR [__svml_datan2_ha_data_internal+3136] + vandpd xmm4, xmm10, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3136] vpshufd xmm10, xmm1, 221 vpshufd xmm11, xmm9, 221 vblendvpd xmm4, xmm4, xmm2, xmm3 @@ -2285,7 +2285,7 @@ _B6_12:: vmovmskps eax, xmm7 vpcmpgtd xmm7, xmm2, xmm6 vpshufd xmm9, xmm7, 80 - vandpd xmm11, xmm9, XMMWORD PTR [__svml_datan2_ha_data_internal+3072] + vandpd xmm11, xmm9, XMMWORD PTR [__jsvml_datan2_ha_data_internal+3072] vaddpd xmm12, xmm10, xmm11 vpshufd xmm1, xmm1, 80 vorpd xmm5, xmm12, xmm5 @@ -2296,13 +2296,13 @@ _B6_12:: _B6_13:: -__svml_atan22_ha_e9 ENDP +__jsvml_atan22_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_e9_B1_B4: +_unwind___jsvml_atan22_ha_e9_B1_B4: DD 1603073 DD 4117622 DD 1075310 @@ -2324,19 +2324,19 @@ _unwind___svml_atan22_ha_e9_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan22_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_e9_B7_B11: +_unwind___jsvml_atan22_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan22_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2345,17 +2345,17 @@ _unwind___svml_atan22_ha_e9_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_atan22_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_atan22_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan22_ha_e9_B12_B12: +_unwind___jsvml_atan22_ha_e9_B12_B12: DD 33 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan22_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan22_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2364,7 +2364,7 @@ _unwind___svml_atan22_ha_e9_B12_B12: DD imagerel _B6_12 DD imagerel _B6_13 - DD imagerel _unwind___svml_atan22_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_atan22_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2378,9 +2378,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan28_ha_z0 + PUBLIC __jsvml_atan28_ha_z0 -__svml_atan28_ha_z0 PROC EXPORT +__jsvml_atan28_ha_z0 PROC EXPORT _B7_1:: @@ -2406,21 +2406,21 @@ L227:: vmovups ZMMWORD PTR [1120+rsp], zmm6 mov QWORD PTR [728+rsp], r13 lea r13, QWORD PTR [527+rsp] - vmovups zmm2, ZMMWORD PTR [__svml_datan2_ha_data_internal+896] + vmovups zmm2, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+896] and r13, -64 - vmovdqu ymm8, YMMWORD PTR [__svml_datan2_ha_data_internal+2688] - vmovups zmm25, ZMMWORD PTR [__svml_datan2_ha_data_internal+1344] - vmovups zmm23, ZMMWORD PTR [__svml_datan2_ha_data_internal+1280] - vmovups zmm24, ZMMWORD PTR [__svml_datan2_ha_data_internal+1216] - vmovups zmm31, ZMMWORD PTR [__svml_datan2_ha_data_internal+1152] - vmovups zmm26, ZMMWORD PTR [__svml_datan2_ha_data_internal+1792] - vmovups zmm28, ZMMWORD PTR [__svml_datan2_ha_data_internal+960] + vmovdqu ymm8, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2688] + vmovups zmm25, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1344] + vmovups zmm23, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1280] + vmovups zmm24, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1216] + vmovups zmm31, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1152] + vmovups zmm26, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1792] + vmovups zmm28, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+960] vmovaps zmm6, zmm1 vmovaps zmm5, zmm0 vandpd zmm4, zmm6, zmm2 vandpd zmm3, zmm5, zmm2 - vmovdqu ymm1, YMMWORD PTR [__svml_datan2_ha_data_internal+2752] - vmovups zmm2, ZMMWORD PTR [__svml_datan2_ha_data_internal+2880] + vmovdqu ymm1, YMMWORD PTR [__jsvml_datan2_ha_data_internal+2752] + vmovups zmm2, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2880] vmulpd zmm22, zmm4, zmm31 {rn-sae} vcmppd k5, zmm6, zmm2, 17 {sae} vpsrlq zmm29, zmm4, 32 @@ -2443,28 +2443,28 @@ L227:: vpcmpeqd ymm14, ymm12, ymm1 vpor ymm15, ymm10, ymm11 vpor ymm1, ymm13, ymm14 - vmovups zmm11, ZMMWORD PTR [__svml_datan2_ha_data_internal+704] - vmovups zmm14, ZMMWORD PTR [__svml_datan2_ha_data_internal+768] - vmovups zmm9, ZMMWORD PTR [__svml_datan2_ha_data_internal+192] - vmovups zmm10, ZMMWORD PTR [__svml_datan2_ha_data_internal+256] - vmovups zmm13, ZMMWORD PTR [__svml_datan2_ha_data_internal+512] - vmovups zmm12, ZMMWORD PTR [__svml_datan2_ha_data_internal+448] + vmovups zmm11, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+704] + vmovups zmm14, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+768] + vmovups zmm9, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+192] + vmovups zmm10, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+256] + vmovups zmm13, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+512] + vmovups zmm12, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+448] vblendmpd zmm23{k1}, zmm11, zmm26 vblendmpd zmm22{k3}, zmm14, zmm26 vpor ymm1, ymm15, ymm1 - vblendmpd zmm15{k1}, zmm9, ZMMWORD PTR [__svml_datan2_ha_data_internal+320] - vblendmpd zmm30{k1}, zmm10, ZMMWORD PTR [__svml_datan2_ha_data_internal+384] + vblendmpd zmm15{k1}, zmm9, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+320] + vblendmpd zmm30{k1}, zmm10, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+384] vblendmpd zmm0{k2}, zmm23, zmm22 - vblendmpd zmm31{k3}, zmm13, ZMMWORD PTR [__svml_datan2_ha_data_internal+640] - vblendmpd zmm29{k3}, zmm12, ZMMWORD PTR [__svml_datan2_ha_data_internal+576] - vmovups zmm11, ZMMWORD PTR [__svml_datan2_ha_data_internal+2368] - vmovups zmm12, ZMMWORD PTR [__svml_datan2_ha_data_internal+2432] - vmovups zmm13, ZMMWORD PTR [__svml_datan2_ha_data_internal+2496] + vblendmpd zmm31{k3}, zmm13, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+640] + vblendmpd zmm29{k3}, zmm12, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+576] + vmovups zmm11, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vmovups zmm12, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2432] + vmovups zmm13, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2496] vblendmpd zmm24{k2}, zmm30, zmm31 vblendmpd zmm25{k2}, zmm15, zmm29 - vmovups zmm30, ZMMWORD PTR [__svml_datan2_ha_data_internal+1984] - vmovups zmm29, ZMMWORD PTR [__svml_datan2_ha_data_internal+2048] - vmovups zmm15, ZMMWORD PTR [__svml_datan2_ha_data_internal+2560] + vmovups zmm30, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vmovups zmm29, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2048] + vmovups zmm15, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2560] vmovaps zmm9, zmm4 vxorpd zmm9{k3}, zmm4, zmm4 vfmadd231pd zmm9{k4}, zmm0, zmm3 {rn-sae} @@ -2472,25 +2472,25 @@ L227:: vmovaps zmm7, zmm9 vfnmadd213pd zmm7, zmm10, zmm26 {rn-sae} vfmadd213pd zmm10, zmm7, zmm10 {rn-sae} - vmovups zmm7, ZMMWORD PTR [__svml_datan2_ha_data_internal+2112] + vmovups zmm7, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2112] vfnmadd231pd zmm26, zmm10, zmm9 {rn-sae} vmovaps zmm8, zmm3 vxorpd zmm8{k3}, zmm3, zmm3 vfmadd213pd zmm10, zmm26, zmm10 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_datan2_ha_data_internal+1856] + vmovups zmm26, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1856] vfnmadd231pd zmm8{k4}, zmm0, zmm4 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_datan2_ha_data_internal+1920] + vmovups zmm0, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1920] vmulpd zmm23, zmm10, zmm8 {rn-sae} vmulpd zmm31, zmm23, zmm23 {rn-sae} vfnmadd213pd zmm9, zmm23, zmm8 {rn-sae} - vmovups zmm8, ZMMWORD PTR [__svml_datan2_ha_data_internal+2176] + vmovups zmm8, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2176] vmulpd zmm14, zmm31, zmm31 {rn-sae} vmulpd zmm22, zmm9, zmm10 {rn-sae} - vmovups zmm9, ZMMWORD PTR [__svml_datan2_ha_data_internal+2240] - vmovups zmm10, ZMMWORD PTR [__svml_datan2_ha_data_internal+2304] + vmovups zmm9, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vmovups zmm10, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+2304] vfmadd231pd zmm30, zmm26, zmm14 {rn-sae} vfmadd231pd zmm29, zmm0, zmm14 {rn-sae} - vxorpd zmm26, zmm27, ZMMWORD PTR [__svml_datan2_ha_data_internal+1024] + vxorpd zmm26, zmm27, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+1024] vaddpd zmm22{k4}, zmm22, zmm24 {rn-sae} vfmadd213pd zmm30, zmm14, zmm7 {rn-sae} vfmadd213pd zmm29, zmm14, zmm8 {rn-sae} @@ -2637,7 +2637,7 @@ _B7_16:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B7_14 _B7_17:: @@ -2647,9 +2647,9 @@ _B7_17:: vcmppd k3, zmm5, zmm5, 3 {sae} vcmppd k4, zmm4, zmm2, 4 {sae} vcmppd k5, zmm3, zmm2, 4 {sae} - vmovups zmm24, ZMMWORD PTR [__svml_datan2_ha_data_internal+3136] - vmovups zmm23, ZMMWORD PTR [__svml_datan2_ha_data_internal+832] - vmovups zmm22, ZMMWORD PTR [__svml_datan2_ha_data_internal+3072] + vmovups zmm24, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+3136] + vmovups zmm23, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+832] + vmovups zmm22, ZMMWORD PTR [__jsvml_datan2_ha_data_internal+3072] vblendmpd zmm9{k1}, zmm3, zmm4 vpbroadcastq zmm8, QWORD PTR [_2il0floatpacket_51] vxorpd zmm24{k1}, zmm24, zmm24 @@ -2688,13 +2688,13 @@ _B7_17:: _B7_18:: -__svml_atan28_ha_z0 ENDP +__jsvml_atan28_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan28_ha_z0_B1_B10: +_unwind___jsvml_atan28_ha_z0_B1_B10: DD 1873409 DD 6018198 DD 4614286 @@ -2718,13 +2718,13 @@ _unwind___svml_atan28_ha_z0_B1_B10: DD imagerel _B7_1 DD imagerel _B7_12 - DD imagerel _unwind___svml_atan28_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_atan28_ha_z0_B1_B10 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan28_ha_z0_B12_B16: +_unwind___jsvml_atan28_ha_z0_B12_B16: DD 1604897 DD 3757181 DD 3568754 @@ -2740,7 +2740,7 @@ _unwind___svml_atan28_ha_z0_B12_B16: DD 3500811 DD imagerel _B7_1 DD imagerel _B7_12 - DD imagerel _unwind___svml_atan28_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_atan28_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2749,17 +2749,17 @@ _unwind___svml_atan28_ha_z0_B12_B16: DD imagerel _B7_12 DD imagerel _B7_17 - DD imagerel _unwind___svml_atan28_ha_z0_B12_B16 + DD imagerel _unwind___jsvml_atan28_ha_z0_B12_B16 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan28_ha_z0_B17_B17: +_unwind___jsvml_atan28_ha_z0_B17_B17: DD 33 DD imagerel _B7_1 DD imagerel _B7_12 - DD imagerel _unwind___svml_atan28_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_atan28_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2768,7 +2768,7 @@ _unwind___svml_atan28_ha_z0_B17_B17: DD imagerel _B7_17 DD imagerel _B7_18 - DD imagerel _unwind___svml_atan28_ha_z0_B17_B17 + DD imagerel _unwind___jsvml_atan28_ha_z0_B17_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2782,9 +2782,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan21_ha_e9 + PUBLIC __jsvml_atan21_ha_e9 -__svml_atan21_ha_e9 PROC EXPORT +__jsvml_atan21_ha_e9 PROC EXPORT _B8_1:: @@ -2815,15 +2815,15 @@ L278:: vmovups XMMWORD PTR [384+rsp], xmm6 mov QWORD PTR [232+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+2880] + vmovsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+2880] and r13, -64 - vmovsd xmm12, QWORD PTR [__svml_datan2_ha_data_internal+896] + vmovsd xmm12, QWORD PTR [__jsvml_datan2_ha_data_internal+896] vcmpltsd xmm8, xmm1, xmm2 - vmovsd xmm11, QWORD PTR [__svml_datan2_ha_data_internal+960] + vmovsd xmm11, QWORD PTR [__jsvml_datan2_ha_data_internal+960] vandpd xmm13, xmm1, xmm12 - vmovsd xmm3, QWORD PTR [__svml_datan2_ha_data_internal+1024] + vmovsd xmm3, QWORD PTR [__jsvml_datan2_ha_data_internal+1024] vandpd xmm14, xmm0, xmm12 - vmovsd xmm5, QWORD PTR [__svml_datan2_ha_data_internal+1088] + vmovsd xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+1088] vxorpd xmm10, xmm1, xmm13 vmovupd XMMWORD PTR [432+rsp], xmm1 vandpd xmm4, xmm14, xmm5 @@ -2857,11 +2857,11 @@ L278:: vpcmpgtd xmm0, xmm14, xmm1 vpcmpeqd xmm1, xmm14, xmm1 vpor xmm15, xmm0, xmm1 - vmulsd xmm1, xmm13, QWORD PTR [__svml_datan2_ha_data_internal+1152] + vmulsd xmm1, xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+1152] vpor xmm2, xmm2, xmm15 - vmulsd xmm0, xmm13, QWORD PTR [__svml_datan2_ha_data_internal+1216] - vmulsd xmm14, xmm13, QWORD PTR [__svml_datan2_ha_data_internal+1280] - vmulsd xmm15, xmm13, QWORD PTR [__svml_datan2_ha_data_internal+1344] + vmulsd xmm0, xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+1216] + vmulsd xmm14, xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+1280] + vmulsd xmm15, xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+1344] vpshufd xmm1, xmm1, 85 vpshufd xmm15, xmm15, 85 vpsubd xmm1, xmm1, xmm3 @@ -2882,9 +2882,9 @@ L278:: vpaddd xmm14, xmm0, xmm15 vpslld xmm3, xmm14, 5 vmovd edx, xmm3 - vmovq xmm1, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rax+rdx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rax+rdx] vmulsd xmm3, xmm1, xmm6 - vmovq xmm0, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rax+rdx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rax+rdx] vandpd xmm15, xmm0, xmm4 vandpd xmm14, xmm0, xmm9 vmulsd xmm4, xmm1, xmm4 @@ -2925,19 +2925,19 @@ L278:: vpsubd xmm6, xmm6, xmm15 vpsubd xmm4, xmm9, xmm7 vpaddd xmm6, xmm6, xmm4 - vmovsd xmm5, QWORD PTR [__svml_datan2_ha_data_internal+3008] + vmovsd xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+3008] vpshufd xmm9, xmm6, 0 vandpd xmm4, xmm9, xmm5 vmulsd xmm5, xmm0, xmm4 vmulsd xmm1, xmm1, xmm4 - vsubsd xmm0, xmm5, QWORD PTR [__svml_datan2_ha_data_internal+1792] + vsubsd xmm0, xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+1792] vaddsd xmm7, xmm1, xmm0 vmulsd xmm6, xmm7, xmm7 vsubsd xmm9, xmm6, xmm7 vmulsd xmm5, xmm9, xmm7 vaddsd xmm0, xmm5, xmm7 vmulsd xmm1, xmm0, xmm7 - vmovsd xmm0, QWORD PTR [__svml_datan2_ha_data_internal+1920] + vmovsd xmm0, QWORD PTR [__jsvml_datan2_ha_data_internal+1920] vsubsd xmm15, xmm1, xmm7 vmulsd xmm6, xmm15, xmm7 vaddsd xmm9, xmm6, xmm7 @@ -2949,42 +2949,42 @@ L278:: vmulsd xmm3, xmm4, xmm3 vmulsd xmm7, xmm4, xmm14 vaddsd xmm5, xmm6, xmm9 - vmovsd xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1856] + vmovsd xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1856] vaddsd xmm6, xmm3, xmm5 vaddsd xmm4, xmm7, xmm6 vmulsd xmm9, xmm4, xmm4 vmulsd xmm5, xmm9, xmm9 vmulsd xmm14, xmm14, xmm5 vmulsd xmm1, xmm0, xmm5 - vaddsd xmm3, xmm14, QWORD PTR [__svml_datan2_ha_data_internal+1984] - vaddsd xmm0, xmm1, QWORD PTR [__svml_datan2_ha_data_internal+2048] + vaddsd xmm3, xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+2048] vmulsd xmm15, xmm3, xmm5 vmulsd xmm1, xmm0, xmm5 - vaddsd xmm3, xmm15, QWORD PTR [__svml_datan2_ha_data_internal+2112] - vaddsd xmm15, xmm1, QWORD PTR [__svml_datan2_ha_data_internal+2176] + vaddsd xmm3, xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+2112] + vaddsd xmm15, xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+2176] vmulsd xmm14, xmm3, xmm5 vmulsd xmm15, xmm15, xmm5 - vaddsd xmm0, xmm14, QWORD PTR [__svml_datan2_ha_data_internal+2240] - vaddsd xmm3, xmm15, QWORD PTR [__svml_datan2_ha_data_internal+2304] + vaddsd xmm0, xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vaddsd xmm3, xmm15, QWORD PTR [__jsvml_datan2_ha_data_internal+2304] vmulsd xmm1, xmm0, xmm5 vmulsd xmm14, xmm3, xmm5 - vaddsd xmm0, xmm1, QWORD PTR [__svml_datan2_ha_data_internal+2368] - vaddsd xmm3, xmm14, QWORD PTR [__svml_datan2_ha_data_internal+2432] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vaddsd xmm3, xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+2432] vmulsd xmm1, xmm0, xmm5 vmulsd xmm5, xmm3, xmm5 - vaddsd xmm14, xmm1, QWORD PTR [__svml_datan2_ha_data_internal+2496] - vaddsd xmm1, xmm5, QWORD PTR [__svml_datan2_ha_data_internal+2560] + vaddsd xmm14, xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+2496] + vaddsd xmm1, xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+2560] vmulsd xmm0, xmm14, xmm9 vaddsd xmm3, xmm0, xmm1 vxorpd xmm0, xmm8, xmm10 - vaddsd xmm8, xmm6, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rax+rdx] + vaddsd xmm8, xmm6, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rax+rdx] vmulsd xmm9, xmm3, xmm9 vaddsd xmm1, xmm8, xmm0 vmulsd xmm4, xmm9, xmm4 vmovupd xmm9, XMMWORD PTR [432+rsp] vaddsd xmm3, xmm4, xmm1 vaddsd xmm5, xmm7, xmm3 - vaddsd xmm6, xmm5, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rax+rdx] + vaddsd xmm6, xmm5, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rax+rdx] vmovmskps eax, xmm2 vxorpd xmm10, xmm6, xmm10 vmovupd xmm5, XMMWORD PTR [448+rsp] @@ -3037,7 +3037,7 @@ _B8_7:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B8_5 _B8_8:: @@ -3046,7 +3046,7 @@ _B8_8:: vcmpordsd xmm15, xmm9, xmm9 vcmpordsd xmm1, xmm14, xmm14 vcmpnltsd xmm12, xmm5, xmm13 - vmovsd xmm10, QWORD PTR [__svml_datan2_ha_data_internal+832] + vmovsd xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+832] vandpd xmm7, xmm9, xmm10 vandpd xmm6, xmm14, xmm10 vandpd xmm10, xmm15, xmm1 @@ -3054,7 +3054,7 @@ _B8_8:: vblendvpd xmm3, xmm13, xmm5, xmm12 vcmpeqsd xmm13, xmm13, xmm1 vcmpeqsd xmm5, xmm5, xmm1 - vmovsd xmm11, QWORD PTR [__svml_datan2_ha_data_internal+3136] + vmovsd xmm11, QWORD PTR [__jsvml_datan2_ha_data_internal+3136] vorpd xmm13, xmm13, xmm5 vpshufd xmm5, xmm13, 85 vandpd xmm4, xmm12, xmm11 @@ -3069,7 +3069,7 @@ _B8_8:: vpshufd xmm1, xmm1, 85 vorpd xmm10, xmm3, xmm7 vpcmpgtd xmm5, xmm1, xmm4 - vmovsd xmm8, QWORD PTR [__svml_datan2_ha_data_internal+3072] + vmovsd xmm8, QWORD PTR [__jsvml_datan2_ha_data_internal+3072] vpshufd xmm7, xmm5, 0 vandpd xmm8, xmm7, xmm8 vpshufd xmm12, xmm13, 0 @@ -3081,13 +3081,13 @@ _B8_8:: _B8_9:: -__svml_atan21_ha_e9 ENDP +__jsvml_atan21_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan21_ha_e9_B1_B8: +_unwind___jsvml_atan21_ha_e9_B1_B8: DD 1611521 DD 1954967 DD 1599631 @@ -3109,7 +3109,7 @@ _unwind___svml_atan21_ha_e9_B1_B8: DD imagerel _B8_1 DD imagerel _B8_9 - DD imagerel _unwind___svml_atan21_ha_e9_B1_B8 + DD imagerel _unwind___jsvml_atan21_ha_e9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3123,9 +3123,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan21_ha_l9 + PUBLIC __jsvml_atan21_ha_l9 -__svml_atan21_ha_l9 PROC EXPORT +__jsvml_atan21_ha_l9 PROC EXPORT _B9_1:: @@ -3159,15 +3159,15 @@ L310:: xor ecx, ecx mov QWORD PTR [232+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm5, QWORD PTR [__svml_datan2_ha_data_internal+2880] + vmovsd xmm5, QWORD PTR [__jsvml_datan2_ha_data_internal+2880] and r13, -64 - vmovsd xmm9, QWORD PTR [__svml_datan2_ha_data_internal+896] + vmovsd xmm9, QWORD PTR [__jsvml_datan2_ha_data_internal+896] vcmpltsd xmm3, xmm12, xmm5 vandpd xmm10, xmm12, xmm9 vandpd xmm9, xmm0, xmm9 - vmovsd xmm4, QWORD PTR [__svml_datan2_ha_data_internal+960] + vmovsd xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+960] vxorpd xmm6, xmm12, xmm10 - vmovsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+1024] + vmovsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+1024] vandpd xmm7, xmm3, xmm4 vpshufd xmm1, xmm9, 85 vxorpd xmm8, xmm0, xmm9 @@ -3182,11 +3182,11 @@ L310:: vpcmpeqd xmm11, xmm2, xmm11 vpor xmm13, xmm3, xmm15 vpor xmm11, xmm14, xmm11 - vmulsd xmm3, xmm10, QWORD PTR [__svml_datan2_ha_data_internal+1152] + vmulsd xmm3, xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+1152] vpor xmm11, xmm13, xmm11 - vmulsd xmm15, xmm10, QWORD PTR [__svml_datan2_ha_data_internal+1216] - vmulsd xmm2, xmm10, QWORD PTR [__svml_datan2_ha_data_internal+1280] - vmulsd xmm13, xmm10, QWORD PTR [__svml_datan2_ha_data_internal+1344] + vmulsd xmm15, xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+1216] + vmulsd xmm2, xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+1280] + vmulsd xmm13, xmm10, QWORD PTR [__jsvml_datan2_ha_data_internal+1344] vpshufd xmm14, xmm3, 85 vpshufd xmm13, xmm13, 85 vpsubd xmm3, xmm14, xmm1 @@ -3207,16 +3207,16 @@ L310:: vpaddd xmm2, xmm3, xmm15 vpslld xmm14, xmm2, 5 vmovd edx, xmm14 - vmovsd xmm4, QWORD PTR [__svml_datan2_ha_data_internal+1792] - vmovq xmm15, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+24+rax+rdx] - vmovq xmm3, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+rax+rdx] + vmovsd xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+1792] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+24+rax+rdx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+rax+rdx] vandpd xmm2, xmm15, xmm10 vmovdqa xmm1, xmm3 vandpd xmm13, xmm15, xmm9 vfmadd213sd xmm3, xmm9, xmm2 vmovd xmm2, r10d vfnmadd213sd xmm1, xmm10, xmm13 - vmovsd xmm13, QWORD PTR [__svml_datan2_ha_data_internal+3008] + vmovsd xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+3008] vpshufd xmm14, xmm3, 85 vpslld xmm15, xmm14, 3 mov r10d, 2145386496 @@ -3243,30 +3243,30 @@ L310:: vfmadd213sd xmm2, xmm14, xmm2 vmulsd xmm14, xmm2, xmm1 vfnmadd213sd xmm3, xmm14, xmm1 - vmovsd xmm1, QWORD PTR [__svml_datan2_ha_data_internal+1920] + vmovsd xmm1, QWORD PTR [__jsvml_datan2_ha_data_internal+1920] vmulsd xmm13, xmm3, xmm2 vmulsd xmm3, xmm14, xmm14 vmulsd xmm4, xmm3, xmm3 - vmovsd xmm2, QWORD PTR [__svml_datan2_ha_data_internal+1856] - vfmadd213sd xmm2, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+1984] - vfmadd213sd xmm1, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2048] - vfmadd213sd xmm2, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2112] - vfmadd213sd xmm1, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2176] - vfmadd213sd xmm2, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2240] - vfmadd213sd xmm1, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2304] - vfmadd213sd xmm2, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2368] - vfmadd213sd xmm1, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2432] - vfmadd213sd xmm2, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2496] - vfmadd213sd xmm1, xmm4, QWORD PTR [__svml_datan2_ha_data_internal+2560] + vmovsd xmm2, QWORD PTR [__jsvml_datan2_ha_data_internal+1856] + vfmadd213sd xmm2, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+1984] + vfmadd213sd xmm1, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2048] + vfmadd213sd xmm2, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2112] + vfmadd213sd xmm1, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2176] + vfmadd213sd xmm2, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2240] + vfmadd213sd xmm1, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2304] + vfmadd213sd xmm2, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2368] + vfmadd213sd xmm1, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2432] + vfmadd213sd xmm2, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2496] + vfmadd213sd xmm1, xmm4, QWORD PTR [__jsvml_datan2_ha_data_internal+2560] vfmadd213sd xmm2, xmm3, xmm1 vxorpd xmm1, xmm5, xmm6 - vaddsd xmm5, xmm13, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+16+rax+rdx] + vaddsd xmm5, xmm13, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+16+rax+rdx] vmulsd xmm15, xmm2, xmm3 vaddsd xmm5, xmm5, xmm1 vfmadd213sd xmm15, xmm14, xmm5 mov QWORD PTR [416+rsp], r13 vaddsd xmm2, xmm14, xmm15 - vaddsd xmm3, xmm2, QWORD PTR [imagerel(__svml_datan2_ha_data_internal)+8+rax+rdx] + vaddsd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_datan2_ha_data_internal)+8+rax+rdx] vmovmskps eax, xmm11 vxorpd xmm6, xmm3, xmm6 vaddsd xmm7, xmm6, xmm7 @@ -3318,12 +3318,12 @@ _B9_7:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_datan2_ha_cout_rare_internal + call __jsvml_datan2_ha_cout_rare_internal jmp _B9_5 _B9_8:: - vmovsd xmm13, QWORD PTR [__svml_datan2_ha_data_internal+832] + vmovsd xmm13, QWORD PTR [__jsvml_datan2_ha_data_internal+832] vcmpordsd xmm2, xmm12, xmm12 vcmpordsd xmm1, xmm0, xmm0 vcmpnltsd xmm15, xmm9, xmm10 @@ -3339,7 +3339,7 @@ _B9_8:: vpshufd xmm1, xmm1, 85 vpand xmm9, xmm13, xmm1 vcmpeqsd xmm1, xmm3, xmm2 - vmovsd xmm14, QWORD PTR [__svml_datan2_ha_data_internal+3136] + vmovsd xmm14, QWORD PTR [__jsvml_datan2_ha_data_internal+3136] vpandn xmm11, xmm9, xmm11 vandpd xmm4, xmm15, xmm14 vblendvpd xmm3, xmm4, xmm2, xmm1 @@ -3348,7 +3348,7 @@ _B9_8:: vmovmskps ecx, xmm11 vorpd xmm11, xmm3, xmm6 vpcmpgtd xmm6, xmm2, xmm4 - vmovsd xmm7, QWORD PTR [__svml_datan2_ha_data_internal+3072] + vmovsd xmm7, QWORD PTR [__jsvml_datan2_ha_data_internal+3072] vpshufd xmm10, xmm6, 0 and ecx, 1 vandpd xmm7, xmm10, xmm7 @@ -3361,13 +3361,13 @@ _B9_8:: _B9_9:: -__svml_atan21_ha_l9 ENDP +__jsvml_atan21_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan21_ha_l9_B1_B8: +_unwind___jsvml_atan21_ha_l9_B1_B8: DD 1615361 DD 1954982 DD 1599644 @@ -3389,7 +3389,7 @@ _unwind___svml_atan21_ha_l9_B1_B8: DD imagerel _B9_1 DD imagerel _B9_9 - DD imagerel _unwind___svml_atan21_ha_l9_B1_B8 + DD imagerel _unwind___jsvml_atan21_ha_l9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3403,9 +3403,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_datan2_ha_cout_rare_internal + PUBLIC __jsvml_datan2_ha_cout_rare_internal -__svml_datan2_ha_cout_rare_internal PROC +__jsvml_datan2_ha_cout_rare_internal PROC _B10_1:: @@ -4405,13 +4405,13 @@ _B10_57:: _B10_54:: -__svml_datan2_ha_cout_rare_internal ENDP +__jsvml_datan2_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_datan2_ha_cout_rare_internal_B1_B57: +_unwind___jsvml_datan2_ha_cout_rare_internal_B1_B57: DD 551425 DD 419946 DD 579685 @@ -4425,7 +4425,7 @@ _unwind___svml_datan2_ha_cout_rare_internal_B1_B57: DD imagerel _B10_1 DD imagerel _B10_54 - DD imagerel _unwind___svml_datan2_ha_cout_rare_internal_B1_B57 + DD imagerel _unwind___jsvml_datan2_ha_cout_rare_internal_B1_B57 .pdata ENDS _DATA SEGMENT 'DATA' @@ -4433,8 +4433,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_datan2_ha_data_internal -__svml_datan2_ha_data_internal DD 0 + PUBLIC __jsvml_datan2_ha_data_internal +__jsvml_datan2_ha_data_internal DD 0 DD 1072693248 DD 1413754136 DD 1073291771 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_atan_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_atan_windows_x86.S similarity index 78% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_atan_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_atan_windows_x86.S index 03326a5b3c6..eaaacf247e3 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_atan_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_atan_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2_ha_e9 + PUBLIC __jsvml_atan2_ha_e9 -__svml_atan2_ha_e9 PROC EXPORT +__jsvml_atan2_ha_e9 PROC EXPORT _B1_1:: @@ -61,26 +61,26 @@ L1:: vmovups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [304+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd xmm3, xmm5, XMMWORD PTR [__svml_datan_ha_data_internal+1152] + vandpd xmm3, xmm5, XMMWORD PTR [__jsvml_datan_ha_data_internal+1152] and r13, -64 - vmovupd xmm2, XMMWORD PTR [__svml_datan_ha_data_internal+1344] + vmovupd xmm2, XMMWORD PTR [__jsvml_datan_ha_data_internal+1344] vxorpd xmm4, xmm5, xmm3 vpshufd xmm6, xmm3, 221 vandpd xmm0, xmm3, xmm2 - vmovq xmm15, QWORD PTR [__svml_datan_ha_data_internal+2560] + vmovq xmm15, QWORD PTR [__jsvml_datan_ha_data_internal+2560] vsubpd xmm1, xmm3, xmm0 - vmovq xmm3, QWORD PTR [__svml_datan_ha_data_internal+2624] + vmovq xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+2624] vpsubd xmm12, xmm6, xmm15 vpcmpgtd xmm10, xmm12, xmm3 vpcmpeqd xmm7, xmm12, xmm3 vpor xmm13, xmm10, xmm7 vmovmskps edx, xmm13 - vmovq xmm14, QWORD PTR [__svml_datan_ha_data_internal+1408] - vmovq xmm13, QWORD PTR [__svml_datan_ha_data_internal+1472] + vmovq xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+1408] + vmovq xmm13, QWORD PTR [__jsvml_datan_ha_data_internal+1472] vpsubd xmm12, xmm14, xmm6 - vmovq xmm7, QWORD PTR [__svml_datan_ha_data_internal+1536] + vmovq xmm7, QWORD PTR [__jsvml_datan_ha_data_internal+1536] vpsubd xmm13, xmm13, xmm6 - vmovq xmm15, QWORD PTR [__svml_datan_ha_data_internal+1600] + vmovq xmm15, QWORD PTR [__jsvml_datan_ha_data_internal+1600] vpsrad xmm12, xmm12, 31 vpsubd xmm15, xmm15, xmm6 vpsubd xmm6, xmm7, xmm6 @@ -89,24 +89,24 @@ L1:: vpsrad xmm6, xmm6, 31 vpaddd xmm15, xmm12, xmm14 vpaddd xmm12, xmm13, xmm6 - vmovq xmm10, QWORD PTR [__svml_datan_ha_data_internal+1664] + vmovq xmm10, QWORD PTR [__jsvml_datan_ha_data_internal+1664] vpaddd xmm7, xmm15, xmm12 vpaddd xmm10, xmm7, xmm10 vpslld xmm13, xmm10, 5 vmovd eax, xmm13 - vmovupd xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1728] + vmovupd xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1728] vpextrd ecx, xmm13, 1 - vmovq xmm14, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+r8+rax] - vmovq xmm6, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+r8+rax] - vmovhpd xmm15, xmm14, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+r8+rcx] - vmovhpd xmm14, xmm6, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+r8+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+r8+rax] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+r8+rax] + vmovhpd xmm15, xmm14, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+r8+rcx] + vmovhpd xmm14, xmm6, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+r8+rcx] vandpd xmm7, xmm14, xmm0 vsubpd xmm7, xmm7, xmm15 vmulpd xmm0, xmm0, xmm15 - vmovq xmm12, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+r8+rax] - vmovq xmm10, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+r8+rax] - vmovhpd xmm6, xmm12, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+r8+rcx] - vmovhpd xmm12, xmm10, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+r8+rcx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+r8+rax] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+r8+rax] + vmovhpd xmm6, xmm12, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+r8+rcx] + vmovhpd xmm12, xmm10, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+r8+rcx] vandpd xmm10, xmm14, xmm1 vsubpd xmm13, xmm7, xmm10 vmulpd xmm1, xmm15, xmm1 @@ -152,26 +152,26 @@ L1:: vaddpd xmm12, xmm12, xmm0 vmulpd xmm2, xmm1, xmm1 vmulpd xmm3, xmm2, xmm2 - vmulpd xmm10, xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1792] - vmulpd xmm7, xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1856] - vaddpd xmm10, xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+1920] - vaddpd xmm14, xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+1984] + vmulpd xmm10, xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1792] + vmulpd xmm7, xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1856] + vaddpd xmm10, xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+1920] + vaddpd xmm14, xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+1984] vmulpd xmm13, xmm3, xmm10 vmulpd xmm14, xmm3, xmm14 - vaddpd xmm7, xmm13, XMMWORD PTR [__svml_datan_ha_data_internal+2048] - vaddpd xmm13, xmm14, XMMWORD PTR [__svml_datan_ha_data_internal+2112] + vaddpd xmm7, xmm13, XMMWORD PTR [__jsvml_datan_ha_data_internal+2048] + vaddpd xmm13, xmm14, XMMWORD PTR [__jsvml_datan_ha_data_internal+2112] vmulpd xmm10, xmm3, xmm7 vmulpd xmm13, xmm3, xmm13 - vaddpd xmm7, xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2176] - vaddpd xmm14, xmm13, XMMWORD PTR [__svml_datan_ha_data_internal+2240] + vaddpd xmm7, xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2176] + vaddpd xmm14, xmm13, XMMWORD PTR [__jsvml_datan_ha_data_internal+2240] vmulpd xmm10, xmm3, xmm7 vmulpd xmm14, xmm3, xmm14 - vaddpd xmm7, xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2304] - vaddpd xmm13, xmm14, XMMWORD PTR [__svml_datan_ha_data_internal+2368] + vaddpd xmm7, xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2304] + vaddpd xmm13, xmm14, XMMWORD PTR [__jsvml_datan_ha_data_internal+2368] vmulpd xmm10, xmm3, xmm7 vmulpd xmm3, xmm3, xmm13 - vaddpd xmm7, xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2432] - vaddpd xmm3, xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+2496] + vaddpd xmm7, xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2432] + vaddpd xmm3, xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+2496] vmulpd xmm10, xmm2, xmm7 vaddpd xmm13, xmm3, xmm10 vmulpd xmm2, xmm2, xmm13 @@ -234,19 +234,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_atan2_ha_e9 ENDP +__jsvml_atan2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2_ha_e9_B1_B3: +_unwind___jsvml_atan2_ha_e9_B1_B3: DD 1203457 DD 2544733 DD 878677 @@ -265,19 +265,19 @@ _unwind___svml_atan2_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_atan2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atan2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2_ha_e9_B6_B10: +_unwind___jsvml_atan2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_atan2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atan2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -286,7 +286,7 @@ _unwind___svml_atan2_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_atan2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_atan2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -300,9 +300,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan1_ha_e9 + PUBLIC __jsvml_atan1_ha_e9 -__svml_atan1_ha_e9 PROC EXPORT +__jsvml_atan1_ha_e9 PROC EXPORT _B2_1:: @@ -326,11 +326,11 @@ L22:: mov ecx, 1071382528 mov QWORD PTR [168+rsp], r13 mov r9d, 1072889856 - vmovsd xmm11, QWORD PTR [__svml_datan_ha_data_internal+1152] + vmovsd xmm11, QWORD PTR [__jsvml_datan_ha_data_internal+1152] vmovd xmm4, edx vandpd xmm8, xmm12, xmm11 mov r10d, 1073971200 - vmovsd xmm5, QWORD PTR [__svml_datan_ha_data_internal+1344] + vmovsd xmm5, QWORD PTR [__jsvml_datan_ha_data_internal+1344] vxorpd xmm11, xmm12, xmm8 vpshufd xmm3, xmm8, 85 vandpd xmm1, xmm8, xmm5 @@ -363,9 +363,9 @@ L22:: vpaddd xmm9, xmm4, xmm0 vpslld xmm10, xmm9, 5 vmovd edx, xmm10 - vmovsd xmm8, QWORD PTR [__svml_datan_ha_data_internal+1728] - vmovq xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rcx+rdx] - vmovq xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rcx+rdx] + vmovsd xmm8, QWORD PTR [__jsvml_datan_ha_data_internal+1728] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rcx+rdx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rcx+rdx] vandpd xmm9, xmm3, xmm1 vandpd xmm10, xmm3, xmm2 vandpd xmm3, xmm3, xmm8 @@ -410,40 +410,40 @@ L22:: vmulsd xmm9, xmm1, xmm9 vmulsd xmm5, xmm1, xmm10 vaddsd xmm0, xmm8, xmm2 - vmovsd xmm1, QWORD PTR [__svml_datan_ha_data_internal+1792] + vmovsd xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1792] vaddsd xmm2, xmm9, xmm0 - vmovsd xmm0, QWORD PTR [__svml_datan_ha_data_internal+1856] + vmovsd xmm0, QWORD PTR [__jsvml_datan_ha_data_internal+1856] vaddsd xmm8, xmm5, xmm2 - vaddsd xmm2, xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rcx+rdx] + vaddsd xmm2, xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rcx+rdx] vmulsd xmm9, xmm8, xmm8 vmulsd xmm10, xmm9, xmm9 vmulsd xmm1, xmm1, xmm10 vmulsd xmm3, xmm0, xmm10 - vaddsd xmm4, xmm1, QWORD PTR [__svml_datan_ha_data_internal+1920] - vaddsd xmm0, xmm3, QWORD PTR [__svml_datan_ha_data_internal+1984] + vaddsd xmm4, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1920] + vaddsd xmm0, xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+1984] vmulsd xmm4, xmm4, xmm10 vmulsd xmm1, xmm0, xmm10 - vaddsd xmm3, xmm4, QWORD PTR [__svml_datan_ha_data_internal+2048] - vaddsd xmm0, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2112] + vaddsd xmm3, xmm4, QWORD PTR [__jsvml_datan_ha_data_internal+2048] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2112] vmulsd xmm3, xmm3, xmm10 vmulsd xmm1, xmm0, xmm10 - vaddsd xmm4, xmm3, QWORD PTR [__svml_datan_ha_data_internal+2176] - vaddsd xmm0, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2240] + vaddsd xmm4, xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+2176] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2240] vmulsd xmm4, xmm4, xmm10 vmulsd xmm1, xmm0, xmm10 - vaddsd xmm3, xmm4, QWORD PTR [__svml_datan_ha_data_internal+2304] - vaddsd xmm0, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2368] + vaddsd xmm3, xmm4, QWORD PTR [__jsvml_datan_ha_data_internal+2304] + vaddsd xmm0, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2368] vmulsd xmm3, xmm3, xmm10 vmulsd xmm10, xmm0, xmm10 - vaddsd xmm1, xmm3, QWORD PTR [__svml_datan_ha_data_internal+2432] - vaddsd xmm3, xmm10, QWORD PTR [__svml_datan_ha_data_internal+2496] + vaddsd xmm1, xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+2432] + vaddsd xmm3, xmm10, QWORD PTR [__jsvml_datan_ha_data_internal+2496] vmulsd xmm0, xmm1, xmm9 vaddsd xmm4, xmm0, xmm3 vmulsd xmm9, xmm4, xmm9 vmulsd xmm8, xmm9, xmm8 vaddsd xmm10, xmm8, xmm2 vaddsd xmm5, xmm5, xmm10 - vaddsd xmm0, xmm5, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rcx+rdx] + vaddsd xmm0, xmm5, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rcx+rdx] vorpd xmm0, xmm0, xmm11 and eax, 1 jne _B2_3 @@ -475,19 +475,19 @@ _B2_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B2_4 ALIGN 16 _B2_7:: -__svml_atan1_ha_e9 ENDP +__jsvml_atan1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan1_ha_e9_B1_B6: +_unwind___jsvml_atan1_ha_e9_B1_B6: DD 941313 DD 1430621 DD 1017936 @@ -504,7 +504,7 @@ _unwind___svml_atan1_ha_e9_B1_B6: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_atan1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_atan1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -518,9 +518,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan4_ha_e9 + PUBLIC __jsvml_atan4_ha_e9 -__svml_atan4_ha_e9 PROC EXPORT +__jsvml_atan4_ha_e9 PROC EXPORT _B3_1:: @@ -541,29 +541,29 @@ L35:: vmovups YMMWORD PTR [400+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [207+rsp] - vmovupd ymm5, YMMWORD PTR [__svml_datan_ha_data_internal+1344] + vmovupd ymm5, YMMWORD PTR [__jsvml_datan_ha_data_internal+1344] and r13, -64 - vmovups xmm6, XMMWORD PTR [__svml_datan_ha_data_internal+2624] + vmovups xmm6, XMMWORD PTR [__jsvml_datan_ha_data_internal+2624] vmovapd ymm15, ymm0 - vandpd ymm3, ymm15, YMMWORD PTR [__svml_datan_ha_data_internal+1152] + vandpd ymm3, ymm15, YMMWORD PTR [__jsvml_datan_ha_data_internal+1152] vandpd ymm1, ymm3, ymm5 vxorpd ymm14, ymm15, ymm3 vsubpd ymm2, ymm3, ymm1 mov QWORD PTR [536+rsp], r13 vextractf128 xmm4, ymm3, 1 vshufps xmm10, xmm3, xmm4, 221 - vpsubd xmm13, xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2560] - vmovups xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+1408] + vpsubd xmm13, xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2560] + vmovups xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+1408] vpcmpgtd xmm12, xmm13, xmm6 vpcmpeqd xmm7, xmm13, xmm6 vpsubd xmm0, xmm4, xmm10 vpor xmm3, xmm12, xmm7 vpsrad xmm7, xmm0, 31 vmovmskps r8d, xmm3 - vmovups xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1472] - vmovups xmm0, XMMWORD PTR [__svml_datan_ha_data_internal+1536] + vmovups xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1472] + vmovups xmm0, XMMWORD PTR [__jsvml_datan_ha_data_internal+1536] vpsubd xmm4, xmm3, xmm10 - vmovups xmm13, XMMWORD PTR [__svml_datan_ha_data_internal+1600] + vmovups xmm13, XMMWORD PTR [__jsvml_datan_ha_data_internal+1600] vpsubd xmm12, xmm13, xmm10 vpsubd xmm10, xmm0, xmm10 vpsrad xmm12, xmm12, 31 @@ -572,31 +572,31 @@ L35:: vpaddd xmm12, xmm7, xmm12 vpaddd xmm13, xmm13, xmm10 vpaddd xmm7, xmm12, xmm13 - vpaddd xmm3, xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+1664] + vpaddd xmm3, xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+1664] vpslld xmm13, xmm3, 5 vmovd ecx, xmm13 - vmovupd ymm6, YMMWORD PTR [__svml_datan_ha_data_internal+1728] - vmovq xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+rcx] - vmovq xmm10, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+rcx] + vmovupd ymm6, YMMWORD PTR [__jsvml_datan_ha_data_internal+1728] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+rcx] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+rcx] vpextrd r9d, xmm13, 2 vpextrd eax, xmm13, 1 vpextrd r10d, xmm13, 3 - vmovq xmm12, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+r9] - vmovhpd xmm0, xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+rax] - vmovhpd xmm7, xmm12, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+r10] - vmovq xmm13, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+r9] - vmovhpd xmm3, xmm10, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+rax] - vmovhpd xmm12, xmm13, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+r9] + vmovhpd xmm0, xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+rax] + vmovhpd xmm7, xmm12, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+r10] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+r9] + vmovhpd xmm3, xmm10, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+rax] + vmovhpd xmm12, xmm13, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+r10] vinsertf128 ymm4, ymm0, xmm7, 1 - vmovq xmm7, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+rcx] - vmovq xmm0, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+r9] - vmovhpd xmm10, xmm7, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+rax] - vmovhpd xmm13, xmm0, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+r10] - vmovq xmm0, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+r9] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+r9] + vmovhpd xmm10, xmm7, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+rax] + vmovhpd xmm13, xmm0, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+r10] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+r9] vinsertf128 ymm3, ymm3, xmm12, 1 - vmovq xmm12, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+rcx] - vmovhpd xmm7, xmm12, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+rax] - vmovhpd xmm12, xmm0, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+rcx] + vmovhpd xmm7, xmm12, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+rax] + vmovhpd xmm12, xmm0, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+r10] vinsertf128 ymm13, ymm10, xmm13, 1 vandpd ymm10, ymm3, ymm1 vmulpd ymm1, ymm1, ymm4 @@ -646,26 +646,26 @@ L35:: vaddpd ymm12, ymm12, ymm2 vmulpd ymm7, ymm6, ymm6 vmulpd ymm10, ymm7, ymm7 - vmulpd ymm3, ymm10, YMMWORD PTR [__svml_datan_ha_data_internal+1792] - vmulpd ymm0, ymm10, YMMWORD PTR [__svml_datan_ha_data_internal+1856] - vaddpd ymm1, ymm3, YMMWORD PTR [__svml_datan_ha_data_internal+1920] - vaddpd ymm4, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+1984] + vmulpd ymm3, ymm10, YMMWORD PTR [__jsvml_datan_ha_data_internal+1792] + vmulpd ymm0, ymm10, YMMWORD PTR [__jsvml_datan_ha_data_internal+1856] + vaddpd ymm1, ymm3, YMMWORD PTR [__jsvml_datan_ha_data_internal+1920] + vaddpd ymm4, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+1984] vmulpd ymm3, ymm10, ymm1 vmulpd ymm4, ymm10, ymm4 - vaddpd ymm0, ymm3, YMMWORD PTR [__svml_datan_ha_data_internal+2048] - vaddpd ymm3, ymm4, YMMWORD PTR [__svml_datan_ha_data_internal+2112] + vaddpd ymm0, ymm3, YMMWORD PTR [__jsvml_datan_ha_data_internal+2048] + vaddpd ymm3, ymm4, YMMWORD PTR [__jsvml_datan_ha_data_internal+2112] vmulpd ymm1, ymm10, ymm0 vmulpd ymm3, ymm10, ymm3 - vaddpd ymm0, ymm1, YMMWORD PTR [__svml_datan_ha_data_internal+2176] - vaddpd ymm4, ymm3, YMMWORD PTR [__svml_datan_ha_data_internal+2240] + vaddpd ymm0, ymm1, YMMWORD PTR [__jsvml_datan_ha_data_internal+2176] + vaddpd ymm4, ymm3, YMMWORD PTR [__jsvml_datan_ha_data_internal+2240] vmulpd ymm1, ymm10, ymm0 vmulpd ymm4, ymm10, ymm4 - vaddpd ymm0, ymm1, YMMWORD PTR [__svml_datan_ha_data_internal+2304] - vaddpd ymm3, ymm4, YMMWORD PTR [__svml_datan_ha_data_internal+2368] + vaddpd ymm0, ymm1, YMMWORD PTR [__jsvml_datan_ha_data_internal+2304] + vaddpd ymm3, ymm4, YMMWORD PTR [__jsvml_datan_ha_data_internal+2368] vmulpd ymm1, ymm10, ymm0 vmulpd ymm10, ymm10, ymm3 - vaddpd ymm0, ymm1, YMMWORD PTR [__svml_datan_ha_data_internal+2432] - vaddpd ymm1, ymm10, YMMWORD PTR [__svml_datan_ha_data_internal+2496] + vaddpd ymm0, ymm1, YMMWORD PTR [__jsvml_datan_ha_data_internal+2432] + vaddpd ymm1, ymm10, YMMWORD PTR [__jsvml_datan_ha_data_internal+2496] vmulpd ymm3, ymm7, ymm0 vaddpd ymm4, ymm1, ymm3 vmulpd ymm7, ymm7, ymm4 @@ -733,19 +733,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_atan4_ha_e9 ENDP +__jsvml_atan4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan4_ha_e9_B1_B3: +_unwind___jsvml_atan4_ha_e9_B1_B3: DD 1202433 DD 4379737 DD 1665105 @@ -764,13 +764,13 @@ _unwind___svml_atan4_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_atan4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atan4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan4_ha_e9_B6_B10: +_unwind___jsvml_atan4_ha_e9_B6_B10: DD 665121 DD 1074214 DD 1127452 @@ -779,7 +779,7 @@ _unwind___svml_atan4_ha_e9_B6_B10: DD 428040 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_atan4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atan4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -788,7 +788,7 @@ _unwind___svml_atan4_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_atan4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_atan4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -802,9 +802,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan8_ha_z0 + PUBLIC __jsvml_atan8_ha_z0 -__svml_atan8_ha_z0 PROC EXPORT +__jsvml_atan8_ha_z0 PROC EXPORT _B4_1:: @@ -814,61 +814,61 @@ _B4_1:: DB 250 L62:: - vmovups zmm26, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+128] - vmovups zmm27, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+320] - vmovups zmm28, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+64] - vmovups zmm5, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+256] - vmovups zmm1, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+192] - vandpd zmm25, zmm0, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512] + vmovups zmm26, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+128] + vmovups zmm27, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+320] + vmovups zmm28, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+64] + vmovups zmm5, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+256] + vmovups zmm1, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+192] + vandpd zmm25, zmm0, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512] vcmppd k1, zmm25, zmm26, 17 {sae} vminpd zmm24, zmm27, zmm25 {sae} - vmovups zmm26, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+960] - vmovups zmm27, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+448] + vmovups zmm26, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+960] + vmovups zmm27, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+448] vreducepd zmm1{k1}, zmm25, 40 {sae} vaddpd zmm23, zmm25, zmm28 {rn-sae} knotw k3, k1 vsubpd zmm29, zmm23, zmm28 {rn-sae} - vpermt2pd zmm27, zmm23, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+512] - vmovups zmm28, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+576] + vpermt2pd zmm27, zmm23, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+512] + vmovups zmm28, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+576] vfmadd213pd zmm24{k1}, zmm29, zmm5 {rn-sae} vcmppd k2, zmm23, zmm26, 29 {sae} - vmovups zmm26, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1344] + vmovups zmm26, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1344] vrcp14pd zmm4, zmm24 vsubpd zmm2, zmm24, zmm5 {rn-sae} - vpermt2pd zmm28, zmm23, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+640] + vpermt2pd zmm28, zmm23, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+640] vfmsub231pd zmm2, zmm29, zmm25 {rn-sae} - vmovups zmm29, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+704] + vmovups zmm29, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+704] vmovaps zmm30, zmm24 vfnmadd213pd zmm30, zmm4, zmm5 {rn-sae} - vpermt2pd zmm29, zmm23, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+768] + vpermt2pd zmm29, zmm23, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+768] vmulpd zmm31, zmm30, zmm30 {rn-sae} vfmadd213pd zmm4, zmm30, zmm4 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+832] + vmovups zmm30, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+832] vfmadd213pd zmm4, zmm31, zmm4 {rn-sae} - vpermt2pd zmm30, zmm23, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+896] + vpermt2pd zmm30, zmm23, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+896] vblendmpd zmm23{k2}, zmm27, zmm28 vmulpd zmm22, zmm4, zmm1 {rn-sae} vmulpd zmm3, zmm2, zmm4 {rn-sae} vfnmadd213pd zmm24, zmm4, zmm5 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1152] - vmovups zmm5, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1216] + vmovups zmm2, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1152] + vmovups zmm5, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1216] vfmsub213pd zmm1, zmm4, zmm22 {rn-sae} vmulpd zmm4, zmm22, zmm22 {rn-sae} vfmadd213pd zmm24, zmm22, zmm1 {rn-sae} - vmovups zmm1, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1280] + vmovups zmm1, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1280] vblendmpd zmm31{k2}, zmm29, zmm30 vfmadd231pd zmm5, zmm2, zmm4 {rn-sae} vfnmadd231pd zmm24{k1}, zmm3, zmm22 {rn-sae} vfmadd231pd zmm26, zmm1, zmm4 {rn-sae} vmulpd zmm1, zmm4, zmm4 {rn-sae} vmulpd zmm28, zmm4, zmm22 {rn-sae} - vblendmpd zmm3{k3}, zmm23, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1024] - vblendmpd zmm23{k3}, zmm31, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1088] + vblendmpd zmm3{k3}, zmm23, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1024] + vblendmpd zmm23{k3}, zmm31, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1088] vfmadd213pd zmm5, zmm1, zmm26 {rn-sae} vaddpd zmm27, zmm24, zmm23 {rn-sae} vaddpd zmm2, zmm3, zmm22 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1408] - vmovups zmm23, ZMMWORD PTR [__svml_datan_ha_data_internal_avx512+1472] + vmovups zmm24, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1408] + vmovups zmm23, ZMMWORD PTR [__jsvml_datan_ha_data_internal_avx512+1472] vsubpd zmm3, zmm2, zmm3 {rn-sae} vfmadd213pd zmm4, zmm24, zmm23 {rn-sae} vsubpd zmm22, zmm22, zmm3 {rn-sae} @@ -882,7 +882,7 @@ L62:: _B4_2:: -__svml_atan8_ha_z0 ENDP +__jsvml_atan8_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -896,9 +896,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2_ha_ex + PUBLIC __jsvml_atan2_ha_ex -__svml_atan2_ha_ex PROC EXPORT +__jsvml_atan2_ha_ex PROC EXPORT _B5_1:: @@ -921,28 +921,28 @@ L63:: movups XMMWORD PTR [272+rsp], xmm6 mov QWORD PTR [320+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+1152] + movups xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+1152] and r13, -64 andps xmm4, xmm8 pshufd xmm0, xmm4, 221 movaps xmm9, xmm4 - movq xmm1, QWORD PTR [__svml_datan_ha_data_internal+2560] + movq xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2560] movdqa xmm3, xmm0 psubd xmm3, xmm1 movaps xmm12, xmm4 - movq xmm2, QWORD PTR [__svml_datan_ha_data_internal+2624] + movq xmm2, QWORD PTR [__jsvml_datan_ha_data_internal+2624] movdqa xmm5, xmm3 - movups xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+1344] + movups xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+1344] pcmpgtd xmm5, xmm2 movaps xmm11, xmm10 pcmpeqd xmm3, xmm2 - movq xmm2, QWORD PTR [__svml_datan_ha_data_internal+1472] + movq xmm2, QWORD PTR [__jsvml_datan_ha_data_internal+1472] andps xmm11, xmm4 - movq xmm1, QWORD PTR [__svml_datan_ha_data_internal+1536] + movq xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1536] por xmm5, xmm3 - movq xmm4, QWORD PTR [__svml_datan_ha_data_internal+1600] + movq xmm4, QWORD PTR [__jsvml_datan_ha_data_internal+1600] psubd xmm2, xmm0 - movq xmm3, QWORD PTR [__svml_datan_ha_data_internal+1408] + movq xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+1408] psubd xmm4, xmm0 psubd xmm3, xmm0 psubd xmm1, xmm0 @@ -952,7 +952,7 @@ L63:: psrad xmm1, 31 paddd xmm3, xmm4 paddd xmm2, xmm1 - movq xmm15, QWORD PTR [__svml_datan_ha_data_internal+1664] + movq xmm15, QWORD PTR [__jsvml_datan_ha_data_internal+1664] paddd xmm3, xmm2 paddd xmm3, xmm15 movaps xmm1, xmm11 @@ -960,15 +960,15 @@ L63:: pxor xmm9, xmm8 movd edx, xmm3 pshufd xmm0, xmm3, 1 - movups xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+1728] + movups xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+1728] movd ecx, xmm0 - movq xmm6, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+r8+rdx] - movq xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+r8+rdx] - movhpd xmm6, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+r8+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+r8+rdx] + movq xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+r8+rdx] + movhpd xmm6, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+r8+rcx] subpd xmm12, xmm11 mulpd xmm11, xmm6 movmskps eax, xmm5 - movhpd xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+r8+rcx] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+r8+rcx] movaps xmm2, xmm12 andps xmm1, xmm3 andps xmm2, xmm3 @@ -1026,39 +1026,39 @@ L63:: mulpd xmm3, xmm6 movaps xmm2, xmm3 mulpd xmm2, xmm3 - movups xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+1792] + movups xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+1792] mulpd xmm10, xmm2 - movups xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+1856] - addpd xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+1920] + movups xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+1856] + addpd xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+1920] mulpd xmm7, xmm2 mulpd xmm10, xmm2 - addpd xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+1984] - addpd xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2048] + addpd xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+1984] + addpd xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2048] mulpd xmm7, xmm2 mulpd xmm10, xmm2 - addpd xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+2112] - addpd xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2176] + addpd xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+2112] + addpd xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2176] mulpd xmm7, xmm2 mulpd xmm10, xmm2 - addpd xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+2240] - addpd xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2304] + addpd xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+2240] + addpd xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2304] mulpd xmm7, xmm2 mulpd xmm10, xmm2 - addpd xmm7, XMMWORD PTR [__svml_datan_ha_data_internal+2368] - addpd xmm10, XMMWORD PTR [__svml_datan_ha_data_internal+2432] + addpd xmm7, XMMWORD PTR [__jsvml_datan_ha_data_internal+2368] + addpd xmm10, XMMWORD PTR [__jsvml_datan_ha_data_internal+2432] mulpd xmm2, xmm7 mulpd xmm10, xmm3 - addpd xmm2, XMMWORD PTR [__svml_datan_ha_data_internal+2496] + addpd xmm2, XMMWORD PTR [__jsvml_datan_ha_data_internal+2496] addpd xmm2, xmm10 mulpd xmm3, xmm2 mulpd xmm6, xmm3 - movq xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+r8+rdx] - movhpd xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+r8+rcx] + movq xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+r8+rdx] + movhpd xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+r8+rcx] addpd xmm4, xmm5 addpd xmm4, xmm6 addpd xmm1, xmm4 - movq xmm0, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+r8+rdx] - movhpd xmm0, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+r8+rcx] + movq xmm0, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+r8+rdx] + movhpd xmm0, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+r8+rcx] addpd xmm0, xmm1 mov QWORD PTR [328+rsp], r13 orps xmm0, xmm9 @@ -1118,19 +1118,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_atan2_ha_ex ENDP +__jsvml_atan2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2_ha_ex_B1_B3: +_unwind___jsvml_atan2_ha_ex_B1_B3: DD 1336321 DD 2675812 DD 1140828 @@ -1150,19 +1150,19 @@ _unwind___svml_atan2_ha_ex_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_atan2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_atan2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2_ha_ex_B6_B10: +_unwind___jsvml_atan2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_atan2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_atan2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1171,7 +1171,7 @@ _unwind___svml_atan2_ha_ex_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_atan2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_atan2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1185,9 +1185,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan1_ha_l9 + PUBLIC __jsvml_atan1_ha_l9 -__svml_atan1_ha_l9 PROC EXPORT +__jsvml_atan1_ha_l9 PROC EXPORT _B6_1:: @@ -1207,7 +1207,7 @@ L86:: mov r8d, 1072037888 mov QWORD PTR [168+rsp], r13 vmovd xmm1, eax - vmovsd xmm2, QWORD PTR [__svml_datan_ha_data_internal+1152] + vmovsd xmm2, QWORD PTR [__jsvml_datan_ha_data_internal+1152] mov ecx, 1071382528 vandpd xmm0, xmm3, xmm2 mov r9d, 1072889856 @@ -1243,9 +1243,9 @@ L86:: lea r13, QWORD PTR [95+rsp] vmovd edx, xmm9 and r13, -64 - vmovsd xmm1, QWORD PTR [__svml_datan_ha_data_internal+1728] - vmovq xmm10, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rcx+rdx] - vmovq xmm9, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rcx+rdx] + vmovsd xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1728] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rcx+rdx] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rcx+rdx] vandpd xmm5, xmm10, xmm0 vandpd xmm11, xmm10, xmm1 vsubsd xmm5, xmm5, xmm9 @@ -1263,28 +1263,28 @@ L86:: vfmadd213sd xmm0, xmm11, xmm0 vmulsd xmm4, xmm0, xmm5 vfnmadd213sd xmm9, xmm4, xmm5 - vmovsd xmm5, QWORD PTR [__svml_datan_ha_data_internal+1856] + vmovsd xmm5, QWORD PTR [__jsvml_datan_ha_data_internal+1856] vmulsd xmm10, xmm9, xmm0 vmulsd xmm0, xmm4, xmm4 vmulsd xmm1, xmm0, xmm0 - vmovsd xmm9, QWORD PTR [__svml_datan_ha_data_internal+1792] - vfmadd213sd xmm9, xmm1, QWORD PTR [__svml_datan_ha_data_internal+1920] - vfmadd213sd xmm5, xmm1, QWORD PTR [__svml_datan_ha_data_internal+1984] - vfmadd213sd xmm9, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2048] - vfmadd213sd xmm5, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2112] - vfmadd213sd xmm9, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2176] - vfmadd213sd xmm5, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2240] - vfmadd213sd xmm9, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2304] - vfmadd213sd xmm5, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2368] - vfmadd213sd xmm9, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2432] - vfmadd213sd xmm5, xmm1, QWORD PTR [__svml_datan_ha_data_internal+2496] - vaddsd xmm1, xmm10, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rcx+rdx] + vmovsd xmm9, QWORD PTR [__jsvml_datan_ha_data_internal+1792] + vfmadd213sd xmm9, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1920] + vfmadd213sd xmm5, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1984] + vfmadd213sd xmm9, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2048] + vfmadd213sd xmm5, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2112] + vfmadd213sd xmm9, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2176] + vfmadd213sd xmm5, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2240] + vfmadd213sd xmm9, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2304] + vfmadd213sd xmm5, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2368] + vfmadd213sd xmm9, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2432] + vfmadd213sd xmm5, xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+2496] + vaddsd xmm1, xmm10, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rcx+rdx] vfmadd213sd xmm9, xmm0, xmm5 vmulsd xmm5, xmm9, xmm0 vfmadd213sd xmm5, xmm4, xmm1 mov QWORD PTR [224+rsp], r13 vaddsd xmm4, xmm4, xmm5 - vaddsd xmm9, xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rcx+rdx] + vaddsd xmm9, xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rcx+rdx] vorpd xmm0, xmm9, xmm2 and eax, 1 jne _B6_3 @@ -1314,19 +1314,19 @@ _B6_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_atan1_ha_l9 ENDP +__jsvml_atan1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan1_ha_l9_B1_B6: +_unwind___jsvml_atan1_ha_l9_B1_B6: DD 672257 DD 1430594 DD 890932 @@ -1341,7 +1341,7 @@ _unwind___svml_atan1_ha_l9_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_atan1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1355,9 +1355,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2_ha_l9 + PUBLIC __jsvml_atan2_ha_l9 -__svml_atan2_ha_l9 PROC EXPORT +__jsvml_atan2_ha_l9 PROC EXPORT _B7_1:: @@ -1376,23 +1376,23 @@ L95:: vmovups XMMWORD PTR [240+rsp], xmm11 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd xmm0, xmm2, XMMWORD PTR [__svml_datan_ha_data_internal+1152] + vandpd xmm0, xmm2, XMMWORD PTR [__jsvml_datan_ha_data_internal+1152] and r13, -64 vpshufd xmm5, xmm0, 221 vxorpd xmm1, xmm2, xmm0 - vmovq xmm3, QWORD PTR [__svml_datan_ha_data_internal+2560] + vmovq xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+2560] vpsubd xmm13, xmm5, xmm3 - vmovq xmm3, QWORD PTR [__svml_datan_ha_data_internal+2624] + vmovq xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+2624] vpcmpgtd xmm11, xmm13, xmm3 vpcmpeqd xmm14, xmm13, xmm3 vpor xmm4, xmm11, xmm14 vmovmskps edx, xmm4 - vmovq xmm13, QWORD PTR [__svml_datan_ha_data_internal+1408] - vmovq xmm4, QWORD PTR [__svml_datan_ha_data_internal+1472] + vmovq xmm13, QWORD PTR [__jsvml_datan_ha_data_internal+1408] + vmovq xmm4, QWORD PTR [__jsvml_datan_ha_data_internal+1472] vpsubd xmm13, xmm13, xmm5 - vmovq xmm15, QWORD PTR [__svml_datan_ha_data_internal+1536] + vmovq xmm15, QWORD PTR [__jsvml_datan_ha_data_internal+1536] vpsubd xmm4, xmm4, xmm5 - vmovq xmm11, QWORD PTR [__svml_datan_ha_data_internal+1600] + vmovq xmm11, QWORD PTR [__jsvml_datan_ha_data_internal+1600] vpsrad xmm13, xmm13, 31 vpsubd xmm11, xmm11, xmm5 vpsubd xmm5, xmm15, xmm5 @@ -1401,22 +1401,22 @@ L95:: vpsrad xmm5, xmm5, 31 vpaddd xmm13, xmm13, xmm11 vpaddd xmm11, xmm4, xmm5 - vmovq xmm14, QWORD PTR [__svml_datan_ha_data_internal+1664] + vmovq xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+1664] vpaddd xmm4, xmm13, xmm11 vpaddd xmm14, xmm4, xmm14 vpslld xmm15, xmm14, 5 vmovd eax, xmm15 - vmovupd xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1728] + vmovupd xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1728] vpextrd ecx, xmm15, 1 - vmovq xmm11, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+r8+rax] - vmovq xmm13, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+r8+rax] - vmovq xmm5, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+r8+rax] - vmovhpd xmm15, xmm11, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+r8+rcx] - vmovhpd xmm4, xmm13, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+r8+rcx] - vmovhpd xmm13, xmm5, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+r8+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+r8+rax] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+r8+rax] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+r8+rax] + vmovhpd xmm15, xmm11, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+r8+rcx] + vmovhpd xmm4, xmm13, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+r8+rcx] + vmovhpd xmm13, xmm5, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+r8+rcx] vandpd xmm5, xmm15, xmm0 - vmovq xmm14, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+r8+rax] - vmovhpd xmm11, xmm14, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+r8+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+r8+rax] + vmovhpd xmm11, xmm14, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+r8+rcx] vsubpd xmm14, xmm5, xmm4 vandpd xmm5, xmm15, xmm3 vfmadd231pd xmm5, xmm0, xmm4 @@ -1436,18 +1436,18 @@ L95:: vmulpd xmm3, xmm15, xmm5 vmulpd xmm4, xmm14, xmm14 vaddpd xmm3, xmm11, xmm3 - vmovupd xmm15, XMMWORD PTR [__svml_datan_ha_data_internal+1792] - vmovupd xmm5, XMMWORD PTR [__svml_datan_ha_data_internal+1856] - vfmadd213pd xmm15, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+1920] - vfmadd213pd xmm5, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+1984] - vfmadd213pd xmm15, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2048] - vfmadd213pd xmm5, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2112] - vfmadd213pd xmm15, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2176] - vfmadd213pd xmm5, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2240] - vfmadd213pd xmm15, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2304] - vfmadd213pd xmm5, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2368] - vfmadd213pd xmm15, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2432] - vfmadd213pd xmm5, xmm4, XMMWORD PTR [__svml_datan_ha_data_internal+2496] + vmovupd xmm15, XMMWORD PTR [__jsvml_datan_ha_data_internal+1792] + vmovupd xmm5, XMMWORD PTR [__jsvml_datan_ha_data_internal+1856] + vfmadd213pd xmm15, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+1920] + vfmadd213pd xmm5, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+1984] + vfmadd213pd xmm15, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2048] + vfmadd213pd xmm5, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2112] + vfmadd213pd xmm15, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2176] + vfmadd213pd xmm5, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2240] + vfmadd213pd xmm15, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2304] + vfmadd213pd xmm5, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2368] + vfmadd213pd xmm15, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2432] + vfmadd213pd xmm5, xmm4, XMMWORD PTR [__jsvml_datan_ha_data_internal+2496] vfmadd213pd xmm15, xmm14, xmm5 vmulpd xmm4, xmm14, xmm15 vfmadd213pd xmm4, xmm0, xmm3 @@ -1505,19 +1505,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_atan2_ha_l9 ENDP +__jsvml_atan2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2_ha_l9_B1_B3: +_unwind___jsvml_atan2_ha_l9_B1_B3: DD 803329 DD 2151490 DD 1030202 @@ -1533,19 +1533,19 @@ _unwind___svml_atan2_ha_l9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_atan2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atan2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2_ha_l9_B6_B10: +_unwind___jsvml_atan2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_atan2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atan2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1554,7 +1554,7 @@ _unwind___svml_atan2_ha_l9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_atan2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_atan2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1568,9 +1568,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan1_ha_ex + PUBLIC __jsvml_atan1_ha_ex -__svml_atan1_ha_ex PROC EXPORT +__jsvml_atan1_ha_ex PROC EXPORT _B8_1:: @@ -1596,9 +1596,9 @@ L110:: mov r10d, 1073971200 mov QWORD PTR [168+rsp], r13 movd xmm3, edx - movsd xmm4, QWORD PTR [__svml_datan_ha_data_internal+1152] + movsd xmm4, QWORD PTR [__jsvml_datan_ha_data_internal+1152] movd xmm7, r8d - movsd xmm1, QWORD PTR [__svml_datan_ha_data_internal+1344] + movsd xmm1, QWORD PTR [__jsvml_datan_ha_data_internal+1344] andps xmm4, xmm0 pshufd xmm13, xmm4, 85 movaps xmm14, xmm1 @@ -1634,13 +1634,13 @@ L110:: lea r13, QWORD PTR [95+rsp] movd edx, xmm12 pxor xmm2, xmm0 - movsd xmm3, QWORD PTR [__svml_datan_ha_data_internal+1728] + movsd xmm3, QWORD PTR [__jsvml_datan_ha_data_internal+1728] subsd xmm15, xmm14 - movq xmm6, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rcx+rdx] + movq xmm6, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rcx+rdx] and r13, -64 movdqa xmm13, xmm6 movdqa xmm4, xmm6 - movq xmm7, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rcx+rdx] + movq xmm7, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rcx+rdx] andps xmm13, xmm14 andps xmm4, xmm15 andps xmm6, xmm3 @@ -1676,7 +1676,7 @@ L110:: mulsd xmm7, xmm4 mulsd xmm13, xmm12 subsd xmm1, xmm3 - movsd xmm14, QWORD PTR [__svml_datan_ha_data_internal+1792] + movsd xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+1792] addsd xmm7, xmm1 movaps xmm3, xmm7 mulsd xmm3, xmm7 @@ -1695,42 +1695,42 @@ L110:: movaps xmm7, xmm4 mulsd xmm1, xmm5 mulsd xmm3, xmm12 - movsd xmm12, QWORD PTR [__svml_datan_ha_data_internal+1856] + movsd xmm12, QWORD PTR [__jsvml_datan_ha_data_internal+1856] addsd xmm3, xmm1 addsd xmm13, xmm3 addsd xmm7, xmm13 - addsd xmm13, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rcx+rdx] + addsd xmm13, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rcx+rdx] movaps xmm6, xmm7 mulsd xmm6, xmm7 movaps xmm5, xmm6 mulsd xmm5, xmm6 mulsd xmm14, xmm5 mulsd xmm12, xmm5 - addsd xmm14, QWORD PTR [__svml_datan_ha_data_internal+1920] - addsd xmm12, QWORD PTR [__svml_datan_ha_data_internal+1984] + addsd xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+1920] + addsd xmm12, QWORD PTR [__jsvml_datan_ha_data_internal+1984] mulsd xmm14, xmm5 mulsd xmm12, xmm5 - addsd xmm14, QWORD PTR [__svml_datan_ha_data_internal+2048] - addsd xmm12, QWORD PTR [__svml_datan_ha_data_internal+2112] + addsd xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+2048] + addsd xmm12, QWORD PTR [__jsvml_datan_ha_data_internal+2112] mulsd xmm14, xmm5 mulsd xmm12, xmm5 - addsd xmm14, QWORD PTR [__svml_datan_ha_data_internal+2176] - addsd xmm12, QWORD PTR [__svml_datan_ha_data_internal+2240] + addsd xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+2176] + addsd xmm12, QWORD PTR [__jsvml_datan_ha_data_internal+2240] mulsd xmm14, xmm5 mulsd xmm12, xmm5 - addsd xmm14, QWORD PTR [__svml_datan_ha_data_internal+2304] - addsd xmm12, QWORD PTR [__svml_datan_ha_data_internal+2368] + addsd xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+2304] + addsd xmm12, QWORD PTR [__jsvml_datan_ha_data_internal+2368] mulsd xmm14, xmm5 mulsd xmm12, xmm5 - addsd xmm14, QWORD PTR [__svml_datan_ha_data_internal+2432] - addsd xmm12, QWORD PTR [__svml_datan_ha_data_internal+2496] + addsd xmm14, QWORD PTR [__jsvml_datan_ha_data_internal+2432] + addsd xmm12, QWORD PTR [__jsvml_datan_ha_data_internal+2496] mulsd xmm14, xmm6 addsd xmm14, xmm12 mulsd xmm14, xmm6 mulsd xmm14, xmm7 addsd xmm14, xmm13 addsd xmm4, xmm14 - addsd xmm4, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rcx+rdx] + addsd xmm4, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rcx+rdx] orps xmm4, xmm2 jne _B8_3 @@ -1763,19 +1763,19 @@ _B8_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B8_4 ALIGN 16 _B8_7:: -__svml_atan1_ha_ex ENDP +__jsvml_atan1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan1_ha_ex_B1_B6: +_unwind___jsvml_atan1_ha_ex_B1_B6: DD 1076225 DD 1430636 DD 813150 @@ -1793,7 +1793,7 @@ _unwind___svml_atan1_ha_ex_B1_B6: DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_atan1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_atan1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1807,9 +1807,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan4_ha_l9 + PUBLIC __jsvml_atan4_ha_l9 -__svml_atan4_ha_l9 PROC EXPORT +__jsvml_atan4_ha_l9 PROC EXPORT _B9_1:: @@ -1829,58 +1829,58 @@ L125:: lea r13, QWORD PTR [303+rsp] vmovapd ymm5, ymm0 and r13, -64 - vandpd ymm1, ymm5, YMMWORD PTR [__svml_datan_ha_data_internal+1152] + vandpd ymm1, ymm5, YMMWORD PTR [__jsvml_datan_ha_data_internal+1152] vxorpd ymm4, ymm5, ymm1 - vmovups xmm9, XMMWORD PTR [__svml_datan_ha_data_internal+2624] + vmovups xmm9, XMMWORD PTR [__jsvml_datan_ha_data_internal+2624] mov QWORD PTR [536+rsp], r13 vextracti128 xmm3, ymm1, 1 vshufps xmm14, xmm1, xmm3, 221 - vpsubd xmm12, xmm14, XMMWORD PTR [__svml_datan_ha_data_internal+2560] + vpsubd xmm12, xmm14, XMMWORD PTR [__jsvml_datan_ha_data_internal+2560] vpcmpgtd xmm2, xmm12, xmm9 vpcmpeqd xmm0, xmm12, xmm9 - vmovups xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1408] + vmovups xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1408] vpor xmm15, xmm2, xmm0 - vmovups xmm9, XMMWORD PTR [__svml_datan_ha_data_internal+1600] + vmovups xmm9, XMMWORD PTR [__jsvml_datan_ha_data_internal+1600] vpsubd xmm12, xmm3, xmm14 vmovmskps r8d, xmm15 vpsubd xmm15, xmm9, xmm14 - vmovups xmm3, XMMWORD PTR [__svml_datan_ha_data_internal+1472] + vmovups xmm3, XMMWORD PTR [__jsvml_datan_ha_data_internal+1472] vpsrad xmm2, xmm12, 31 vpsrad xmm12, xmm15, 31 vpsubd xmm9, xmm3, xmm14 - vmovups xmm15, XMMWORD PTR [__svml_datan_ha_data_internal+1536] + vmovups xmm15, XMMWORD PTR [__jsvml_datan_ha_data_internal+1536] vpsrad xmm3, xmm9, 31 vpsubd xmm14, xmm15, xmm14 vpaddd xmm2, xmm2, xmm12 vpsrad xmm9, xmm14, 31 vpaddd xmm3, xmm3, xmm9 vpaddd xmm12, xmm2, xmm3 - vpaddd xmm9, xmm12, XMMWORD PTR [__svml_datan_ha_data_internal+1664] + vpaddd xmm9, xmm12, XMMWORD PTR [__jsvml_datan_ha_data_internal+1664] vpslld xmm15, xmm9, 5 vmovd ecx, xmm15 - vmovupd ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+1728] - vmovq xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+rcx] + vmovupd ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+1728] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+rcx] vpextrd r9d, xmm15, 2 vpextrd eax, xmm15, 1 vpextrd r10d, xmm15, 3 - vmovq xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+r9] - vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+rax] - vmovhpd xmm12, xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+rdx+r10] - vmovq xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+rcx] - vmovq xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+r9] - vmovhpd xmm15, xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+rax] - vmovq xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+r9] + vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+rax] + vmovhpd xmm12, xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+rdx+r10] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+r9] + vmovhpd xmm15, xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+rax] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+rcx] vinsertf128 ymm9, ymm14, xmm12, 1 - vmovhpd xmm12, xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+8+rdx+r10] - vmovq xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+r9] - vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+rax] - vmovq xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+rcx] + vmovhpd xmm12, xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+8+rdx+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+r9] + vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+rax] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+rcx] vinsertf128 ymm15, ymm15, xmm12, 1 - vmovhpd xmm12, xmm3, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+16+rdx+r10] + vmovhpd xmm12, xmm3, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+16+rdx+r10] vinsertf128 ymm3, ymm14, xmm12, 1 - vmovhpd xmm12, xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+rax] - vmovq xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+r9] - vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__svml_datan_ha_data_internal)+24+rdx+r10] + vmovhpd xmm12, xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+rax] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+r9] + vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__jsvml_datan_ha_data_internal)+24+rdx+r10] vinsertf128 ymm2, ymm12, xmm14, 1 vandpd ymm12, ymm15, ymm1 vandpd ymm15, ymm15, ymm0 @@ -1893,26 +1893,26 @@ L125:: vfnmadd231pd ymm15, ymm1, ymm9 vfmadd213pd ymm15, ymm15, ymm15 vfmadd213pd ymm1, ymm15, ymm1 - vmovupd ymm15, YMMWORD PTR [__svml_datan_ha_data_internal+1792] + vmovupd ymm15, YMMWORD PTR [__jsvml_datan_ha_data_internal+1792] vfnmadd231pd ymm0, ymm1, ymm9 vfmadd213pd ymm1, ymm0, ymm1 vmulpd ymm12, ymm14, ymm1 vfnmadd213pd ymm9, ymm12, ymm14 vmulpd ymm14, ymm12, ymm12 vmulpd ymm9, ymm1, ymm9 - vmovupd ymm1, YMMWORD PTR [__svml_datan_ha_data_internal+1856] + vmovupd ymm1, YMMWORD PTR [__jsvml_datan_ha_data_internal+1856] vmulpd ymm0, ymm14, ymm14 vaddpd ymm2, ymm2, ymm9 - vfmadd213pd ymm15, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+1920] - vfmadd213pd ymm1, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+1984] - vfmadd213pd ymm15, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2048] - vfmadd213pd ymm1, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2112] - vfmadd213pd ymm15, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2176] - vfmadd213pd ymm1, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2240] - vfmadd213pd ymm15, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2304] - vfmadd213pd ymm1, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2368] - vfmadd213pd ymm15, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2432] - vfmadd213pd ymm1, ymm0, YMMWORD PTR [__svml_datan_ha_data_internal+2496] + vfmadd213pd ymm15, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+1920] + vfmadd213pd ymm1, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+1984] + vfmadd213pd ymm15, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2048] + vfmadd213pd ymm1, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2112] + vfmadd213pd ymm15, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2176] + vfmadd213pd ymm1, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2240] + vfmadd213pd ymm15, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2304] + vfmadd213pd ymm1, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2368] + vfmadd213pd ymm15, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2432] + vfmadd213pd ymm1, ymm0, YMMWORD PTR [__jsvml_datan_ha_data_internal+2496] vfmadd213pd ymm15, ymm14, ymm1 vmulpd ymm0, ymm14, ymm15 vfmadd213pd ymm0, ymm12, ymm2 @@ -1981,19 +1981,19 @@ _B9_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_datan_ha_cout_rare_internal + call __jsvml_datan_ha_cout_rare_internal jmp _B9_8 ALIGN 16 _B9_11:: -__svml_atan4_ha_l9 ENDP +__jsvml_atan4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan4_ha_l9_B1_B3: +_unwind___jsvml_atan4_ha_l9_B1_B3: DD 802305 DD 4379710 DD 2070582 @@ -2009,13 +2009,13 @@ _unwind___svml_atan4_ha_l9_B1_B3: DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_atan4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atan4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan4_ha_l9_B6_B10: +_unwind___jsvml_atan4_ha_l9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -2027,7 +2027,7 @@ _unwind___svml_atan4_ha_l9_B6_B10: DD 813067 DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_atan4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atan4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2036,7 +2036,7 @@ _unwind___svml_atan4_ha_l9_B6_B10: DD imagerel _B9_6 DD imagerel _B9_11 - DD imagerel _unwind___svml_atan4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_atan4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2050,9 +2050,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_datan_ha_cout_rare_internal + PUBLIC __jsvml_datan_ha_cout_rare_internal -__svml_datan_ha_cout_rare_internal PROC +__jsvml_datan_ha_cout_rare_internal PROC _B10_1:: @@ -2413,13 +2413,13 @@ _B10_15:: _B10_16:: -__svml_datan_ha_cout_rare_internal ENDP +__jsvml_datan_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_datan_ha_cout_rare_internal_B1_B15: +_unwind___jsvml_datan_ha_cout_rare_internal_B1_B15: DD 67585 DD 41480 @@ -2430,7 +2430,7 @@ _unwind___svml_datan_ha_cout_rare_internal_B1_B15: DD imagerel _B10_1 DD imagerel _B10_16 - DD imagerel _unwind___svml_datan_ha_cout_rare_internal_B1_B15 + DD imagerel _unwind___jsvml_datan_ha_cout_rare_internal_B1_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2438,8 +2438,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_datan_ha_data_internal_avx512 -__svml_datan_ha_data_internal_avx512 DD 4294967295 + PUBLIC __jsvml_datan_ha_data_internal_avx512 +__jsvml_datan_ha_data_internal_avx512 DD 4294967295 DD 2147483647 DD 4294967295 DD 2147483647 @@ -2823,8 +2823,8 @@ __svml_datan_ha_data_internal_avx512 DD 4294967295 DD 3218429269 DD 1431655757 DD 3218429269 - PUBLIC __svml_datan_ha_data_internal -__svml_datan_ha_data_internal DD 0 + PUBLIC __jsvml_datan_ha_data_internal +__jsvml_datan_ha_data_internal DD 0 DD 1072693248 DD 0 DD 0 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_cbrt_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cbrt_windows_x86.S similarity index 76% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_cbrt_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cbrt_windows_x86.S index 35bb06146b9..6137912bdbd 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_cbrt_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cbrt_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt1_ha_e9 + PUBLIC __jsvml_cbrt1_ha_e9 -__svml_cbrt1_ha_e9 PROC EXPORT +__jsvml_cbrt1_ha_e9 PROC EXPORT _B1_1:: @@ -68,11 +68,11 @@ L1:: vpcmpgtd xmm13, xmm3, xmm1 vmovd xmm3, r8d lea r13, QWORD PTR [95+rsp] - vmovq xmm2, QWORD PTR [__svml_dcbrt_ha_data_internal+2624] + vmovq xmm2, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] vpand xmm1, xmm0, xmm3 vmovmskps eax, xmm13 vpsrlq xmm13, xmm4, 52 - vmovq xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2688] + vmovq xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] vpsrld xmm3, xmm1, 12 vpand xmm1, xmm13, xmm2 vpsrld xmm0, xmm0, 20 @@ -94,42 +94,42 @@ L1:: movsxd r10, r10d movsxd r9, r9d mov QWORD PTR [192+rsp], r13 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rdx+r10] - vmovsd xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+264+rdx+r10] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rdx+r10] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+264+rdx+r10] mov r10d, 682 vmovd xmm2, r10d vpor xmm5, xmm0, xmm2 vpaddd xmm13, xmm5, xmm13 - vmovsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2496] + vmovsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] vpslld xmm13, xmm13, 20 vpxor xmm5, xmm5, xmm5 vpunpckldq xmm2, xmm5, xmm13 vandpd xmm5, xmm4, xmm0 - vmovsd xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+2432] - vmovsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2368] + vmovsd xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + vmovsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] vorpd xmm5, xmm5, xmm13 vandpd xmm13, xmm4, xmm0 - vmovsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2304] + vmovsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] vorpd xmm13, xmm13, xmm0 vmulsd xmm3, xmm3, xmm2 vsubsd xmm5, xmm5, xmm13 - vmulsd xmm0, xmm5, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rdx+r9] - vmovsd xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+1792] + vmulsd xmm0, xmm5, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rdx+r9] + vmovsd xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] vmulsd xmm13, xmm5, xmm0 - vaddsd xmm5, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+1856] + vaddsd xmm5, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] vmulsd xmm13, xmm5, xmm0 - vaddsd xmm5, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+1920] + vaddsd xmm5, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] vmulsd xmm13, xmm5, xmm0 - vaddsd xmm5, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+1984] + vaddsd xmm5, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] vmulsd xmm13, xmm5, xmm0 - vaddsd xmm5, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+2048] + vaddsd xmm5, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] vmulsd xmm13, xmm5, xmm0 - vaddsd xmm5, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+2112] + vaddsd xmm5, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] vmulsd xmm13, xmm5, xmm0 - vaddsd xmm5, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+2176] + vaddsd xmm5, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] vmulsd xmm13, xmm5, xmm0 vmulsd xmm5, xmm1, xmm2 - vaddsd xmm13, xmm13, QWORD PTR [__svml_dcbrt_ha_data_internal+2240] + vaddsd xmm13, xmm13, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] vmulsd xmm1, xmm5, xmm0 vmulsd xmm2, xmm13, xmm1 vaddsd xmm0, xmm2, xmm3 @@ -160,19 +160,19 @@ _B1_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B1_4 ALIGN 16 _B1_7:: -__svml_cbrt1_ha_e9 ENDP +__jsvml_cbrt1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt1_ha_e9_B1_B6: +_unwind___jsvml_cbrt1_ha_e9_B1_B6: DD 416769 DD 1430620 DD 776252 @@ -185,7 +185,7 @@ _unwind___svml_cbrt1_ha_e9_B1_B6: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_cbrt1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_cbrt1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -199,9 +199,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt4_ha_l9 + PUBLIC __jsvml_cbrt4_ha_l9 -__svml_cbrt4_ha_l9 PROC EXPORT +__jsvml_cbrt4_ha_l9 PROC EXPORT _B2_1:: @@ -221,29 +221,29 @@ L6:: mov QWORD PTR [536+rsp], r13 vextracti128 xmm2, ymm15, 1 vshufps xmm1, xmm15, xmm2, 221 - vandps xmm5, xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2752] + vandps xmm5, xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2752] vpsrld xmm5, xmm5, 12 vmovd ecx, xmm5 - vandps xmm4, xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2816] + vandps xmm4, xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2816] vpsrld xmm1, xmm1, 20 - vpsubd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+3008] + vpsubd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+3008] movsxd rcx, ecx vpextrd r8d, xmm5, 1 movsxd r8, r8d vpextrd r9d, xmm5, 2 movsxd r9, r9d vpextrd r10d, xmm5, 3 - vmovsd xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+rcx] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+rcx] movsxd r10, r10d - vmovhpd xmm4, xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r8] + vmovhpd xmm4, xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r8] vpsrlq ymm3, ymm15, 52 - vpcmpgtd xmm2, xmm0, XMMWORD PTR [__svml_dcbrt_ha_data_internal+3072] - vmovsd xmm0, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r9] + vpcmpgtd xmm2, xmm0, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+3072] + vmovsd xmm0, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r9] vmovmskps edx, xmm2 - vmovhpd xmm2, xmm0, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r10] + vmovhpd xmm2, xmm0, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r10] vinsertf128 ymm2, ymm4, xmm2, 1 - vpand ymm4, ymm3, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2624] - vpmuludq ymm0, ymm4, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2688] + vpand ymm4, ymm3, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] + vpmuludq ymm0, ymm4, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] vextracti128 xmm3, ymm4, 1 vshufps xmm4, xmm4, xmm3, 136 vextracti128 xmm3, ymm0, 1 @@ -263,35 +263,35 @@ L6:: vpextrd r9d, xmm4, 3 movsxd r8, r8d movsxd r9, r9d - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r11] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+rcx] - vinsertf128 ymm5, ymm5, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r8], 1 - vinsertf128 ymm3, ymm3, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r9], 1 + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r11] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+rcx] + vinsertf128 ymm5, ymm5, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r8], 1 + vinsertf128 ymm3, ymm3, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r9], 1 vunpcklpd ymm4, ymm5, ymm3 vunpckhpd ymm5, ymm5, ymm3 - vpand xmm3, xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2880] - vpor xmm1, xmm3, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2944] + vpand xmm3, xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2880] + vpor xmm1, xmm3, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2944] vmovups ymm3, YMMWORD PTR [__VUNPACK_ODD_ind1_2671_0_2] vpaddd xmm0, xmm1, xmm0 vpslld xmm0, xmm0, 20 vpermps ymm1, ymm3, ymm0 - vandpd ymm0, ymm15, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2496] + vandpd ymm0, ymm15, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] vandps ymm3, ymm1, YMMWORD PTR [__VUNPACK_ODD_mask_2671_0_2] - vorpd ymm1, ymm0, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2432] - vandpd ymm0, ymm15, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2368] - vorpd ymm0, ymm0, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2304] + vorpd ymm1, ymm0, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + vandpd ymm0, ymm15, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] + vorpd ymm0, ymm0, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] vsubpd ymm1, ymm1, ymm0 - vmovupd ymm0, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1792] + vmovupd ymm0, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] vmulpd ymm4, ymm4, ymm3 vmulpd ymm2, ymm2, ymm1 vmulpd ymm5, ymm5, ymm3 - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1856] - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1920] - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1984] - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2048] - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2112] - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2176] - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2240] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] vmulpd ymm2, ymm2, ymm4 vmulpd ymm0, ymm0, ymm2 vaddpd ymm1, ymm5, ymm0 @@ -361,19 +361,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_cbrt4_ha_l9 ENDP +__jsvml_cbrt4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt4_ha_l9_B1_B3: +_unwind___jsvml_cbrt4_ha_l9_B1_B3: DD 403201 DD 4379687 DD 2095131 @@ -386,13 +386,13 @@ _unwind___svml_cbrt4_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cbrt4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrt4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt4_ha_l9_B6_B10: +_unwind___jsvml_cbrt4_ha_l9_B6_B10: DD 1858561 DD 2647132 DD 2700370 @@ -416,7 +416,7 @@ _unwind___svml_cbrt4_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_cbrt4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cbrt4_ha_l9_B6_B10 .pdata ENDS _RDATA SEGMENT READ PAGE 'DATA' @@ -450,9 +450,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt8_ha_z0 + PUBLIC __jsvml_cbrt8_ha_z0 -__svml_cbrt8_ha_z0 PROC EXPORT +__jsvml_cbrt8_ha_z0 PROC EXPORT _B3_1:: @@ -463,48 +463,48 @@ _B3_1:: L33:: vgetexppd zmm25, zmm0 {sae} - vmovups zmm26, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+384] + vmovups zmm26, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+384] vgetmantpd zmm3, zmm0, 0 {sae} - vmovups zmm27, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+512] - vmovups zmm28, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+576] - vmovups zmm29, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+640] - vmovups zmm2, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+128] - vmovups zmm5, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+704] + vmovups zmm27, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+512] + vmovups zmm28, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+576] + vmovups zmm29, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+640] + vmovups zmm2, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+128] + vmovups zmm5, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+704] vrcp14pd zmm31, zmm3 vaddpd zmm30, zmm25, zmm26 {rn-sae} - vmovups zmm25, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+768] + vmovups zmm25, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+768] vrndscalepd zmm4, zmm31, 72 {sae} vfmsub231pd zmm28, zmm27, zmm30 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+256] - vmovups zmm26, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+896] + vmovups zmm27, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+256] + vmovups zmm26, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+896] vpsrlq zmm1, zmm4, 49 vrndscalepd zmm24, zmm28, 9 {sae} vfmsub231pd zmm5, zmm3, zmm4 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+832] - vpermt2pd zmm2, zmm1, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+192] - vpermt2pd zmm27, zmm1, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+320] + vmovups zmm4, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+832] + vpermt2pd zmm2, zmm1, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+192] + vpermt2pd zmm27, zmm1, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+320] vfnmadd231pd zmm30, zmm29, zmm24 {rn-sae} vfmadd231pd zmm4, zmm25, zmm5 {rn-sae} - vmovups zmm29, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+1024] - vmovups zmm25, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+1088] + vmovups zmm29, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+1024] + vmovups zmm25, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+1088] vmulpd zmm1, zmm5, zmm5 {rn-sae} vfmadd231pd zmm25, zmm29, zmm5 {rn-sae} - vpermpd zmm23, zmm30, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512] - vpermpd zmm22, zmm30, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+64] - vmovups zmm30, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+960] + vpermpd zmm23, zmm30, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512] + vpermpd zmm22, zmm30, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+64] + vmovups zmm30, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+960] vmulpd zmm3, zmm23, zmm2 {rn-sae} vfmadd231pd zmm30, zmm26, zmm5 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+1216] + vmovups zmm26, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+1216] vfmadd213pd zmm4, zmm1, zmm30 {rn-sae} vmovaps zmm28, zmm23 vfmsub213pd zmm28, zmm2, zmm3 {rn-sae} vfmadd213pd zmm4, zmm1, zmm25 {rn-sae} vfmadd213pd zmm23, zmm27, zmm28 {rn-sae} vfmadd213pd zmm22, zmm2, zmm23 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+1152] - vmovups zmm23, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+1280] + vmovups zmm2, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+1152] + vmovups zmm23, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+1280] vfmadd231pd zmm26, zmm2, zmm5 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+1344] + vmovups zmm2, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+1344] vfmadd213pd zmm4, zmm1, zmm26 {rn-sae} vfmadd231pd zmm2, zmm23, zmm5 {rn-sae} vmulpd zmm5, zmm3, zmm5 {rn-sae} @@ -512,13 +512,13 @@ L33:: vfmadd213pd zmm5, zmm4, zmm22 {rn-sae} vaddpd zmm22, zmm5, zmm3 {rn-sae} vscalefpd zmm24, zmm22, zmm24 {rn-sae} - vpternlogq zmm0, zmm24, ZMMWORD PTR [__svml_dcbrt_ha_data_internal_avx512+448], 236 + vpternlogq zmm0, zmm24, ZMMWORD PTR [__jsvml_dcbrt_ha_data_internal_avx512+448], 236 ret ALIGN 16 _B3_2:: -__svml_cbrt8_ha_z0 ENDP +__jsvml_cbrt8_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -532,9 +532,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt1_ha_l9 + PUBLIC __jsvml_cbrt1_ha_l9 -__svml_cbrt1_ha_l9 PROC EXPORT +__jsvml_cbrt1_ha_l9 PROC EXPORT _B4_1:: @@ -561,11 +561,11 @@ L34:: vpcmpgtd xmm1, xmm5, xmm3 mov QWORD PTR [168+rsp], r13 vmovd xmm5, r8d - vmovq xmm2, QWORD PTR [__svml_dcbrt_ha_data_internal+2624] + vmovq xmm2, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] vpand xmm3, xmm0, xmm5 vmovmskps eax, xmm1 vpsrlq xmm1, xmm4, 52 - vmovq xmm14, QWORD PTR [__svml_dcbrt_ha_data_internal+2688] + vmovq xmm14, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] vpand xmm1, xmm1, xmm2 vpsrld xmm3, xmm3, 12 vpsrld xmm0, xmm0, 20 @@ -589,36 +589,36 @@ L34:: movsxd r10, r10d movsxd r9, r9d mov QWORD PTR [192+rsp], r13 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rdx+r10] - vmovsd xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+264+rdx+r10] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rdx+r10] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+264+rdx+r10] mov r10d, 682 vmovd xmm2, r10d vpor xmm14, xmm0, xmm2 vpaddd xmm5, xmm14, xmm5 vpslld xmm0, xmm5, 20 vpxor xmm14, xmm14, xmm14 - vmovsd xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2496] + vmovsd xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] vpunpckldq xmm2, xmm14, xmm0 vandpd xmm14, xmm4, xmm5 - vmovsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2432] - vmovsd xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2368] + vmovsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + vmovsd xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] vorpd xmm14, xmm14, xmm0 vandpd xmm0, xmm4, xmm5 - vmovsd xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2304] + vmovsd xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] vorpd xmm0, xmm0, xmm5 vmulsd xmm3, xmm3, xmm2 vsubsd xmm14, xmm14, xmm0 - vmulsd xmm5, xmm14, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rdx+r9] + vmulsd xmm5, xmm14, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rdx+r9] vmulsd xmm14, xmm1, xmm2 - vmovsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+1792] - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+1856] + vmovsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] vmulsd xmm1, xmm14, xmm5 - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+1920] - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+1984] - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2048] - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2112] - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2176] - vfmadd213sd xmm0, xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2240] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] + vfmadd213sd xmm0, xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] vmulsd xmm2, xmm0, xmm1 vaddsd xmm0, xmm2, xmm3 vaddsd xmm0, xmm0, xmm14 @@ -648,19 +648,19 @@ _B4_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B4_4 ALIGN 16 _B4_7:: -__svml_cbrt1_ha_l9 ENDP +__jsvml_cbrt1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt1_ha_l9_B1_B6: +_unwind___jsvml_cbrt1_ha_l9_B1_B6: DD 415745 DD 1430616 DD 780364 @@ -673,7 +673,7 @@ _unwind___svml_cbrt1_ha_l9_B1_B6: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_cbrt1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_cbrt1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -687,9 +687,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt2_ha_l9 + PUBLIC __jsvml_cbrt2_ha_l9 -__svml_cbrt2_ha_l9 PROC EXPORT +__jsvml_cbrt2_ha_l9 PROC EXPORT _B5_1:: @@ -707,11 +707,11 @@ L39:: vmovups XMMWORD PTR [208+rsp], xmm10 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovq xmm4, QWORD PTR [__svml_dcbrt_ha_data_internal+2752] + vmovq xmm4, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2752] and r13, -64 - vmovq xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2816] + vmovq xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2816] vpshufd xmm2, xmm11, 221 - vmovq xmm10, QWORD PTR [__svml_dcbrt_ha_data_internal+3008] + vmovq xmm10, QWORD PTR [__jsvml_dcbrt_ha_data_internal+3008] vpand xmm3, xmm2, xmm5 vpand xmm4, xmm2, xmm4 vpsubd xmm5, xmm3, xmm10 @@ -719,16 +719,16 @@ L39:: vpsrlq xmm3, xmm11, 52 vmovd ecx, xmm10 vpsrld xmm2, xmm2, 20 - vmovq xmm12, QWORD PTR [__svml_dcbrt_ha_data_internal+3072] + vmovq xmm12, QWORD PTR [__jsvml_dcbrt_ha_data_internal+3072] vpcmpgtd xmm12, xmm5, xmm12 movsxd rcx, ecx vpextrd r8d, xmm10, 1 movsxd r8, r8d vmovmskps edx, xmm12 - vmovsd xmm12, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+rcx] - vpand xmm5, xmm3, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2624] - vmovhpd xmm4, xmm12, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r8] - vpmuludq xmm12, xmm5, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2688] + vmovsd xmm12, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+rcx] + vpand xmm5, xmm3, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] + vmovhpd xmm4, xmm12, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r8] + vpmuludq xmm12, xmm5, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] vpshufd xmm3, xmm12, 136 vpshufd xmm5, xmm5, 136 vpsrld xmm3, xmm3, 14 @@ -739,39 +739,39 @@ L39:: vpaddd xmm10, xmm10, xmm5 vpslld xmm5, xmm10, 1 vmovd r9d, xmm5 - vmovq xmm1, QWORD PTR [__svml_dcbrt_ha_data_internal+2880] - vmovq xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2944] + vmovq xmm1, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2880] + vmovq xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2944] vpand xmm1, xmm2, xmm1 vpextrd r10d, xmm5, 1 movsxd r9, r9d movsxd r10, r10d - vandpd xmm2, xmm11, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2496] + vandpd xmm2, xmm11, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] mov QWORD PTR [248+rsp], r13 - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r9] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r10] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r9] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r10] vunpcklpd xmm5, xmm12, xmm10 vunpckhpd xmm10, xmm12, xmm10 vpor xmm12, xmm1, xmm0 vpaddd xmm3, xmm12, xmm3 - vandpd xmm12, xmm11, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2368] + vandpd xmm12, xmm11, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] vpslld xmm1, xmm3, 20 vpxor xmm0, xmm0, xmm0 vpunpckldq xmm3, xmm0, xmm1 - vorpd xmm0, xmm2, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2432] - vorpd xmm1, xmm12, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2304] + vorpd xmm0, xmm2, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + vorpd xmm1, xmm12, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] vsubpd xmm2, xmm0, xmm1 vmulpd xmm12, xmm5, xmm3 vmulpd xmm4, xmm4, xmm2 vmulpd xmm10, xmm10, xmm3 vmulpd xmm5, xmm4, xmm12 - vmovupd xmm0, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1792] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1856] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1920] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1984] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2048] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2112] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2176] - vfmadd213pd xmm0, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2240] + vmovupd xmm0, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] + vfmadd213pd xmm0, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] vmulpd xmm0, xmm0, xmm5 vaddpd xmm1, xmm10, xmm0 vaddpd xmm0, xmm12, xmm1 @@ -824,19 +824,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_cbrt2_ha_l9 ENDP +__jsvml_cbrt2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt2_ha_l9_B1_B3: +_unwind___jsvml_cbrt2_ha_l9_B1_B3: DD 669953 DD 2020409 DD 895025 @@ -851,19 +851,19 @@ _unwind___svml_cbrt2_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_cbrt2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrt2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt2_ha_l9_B6_B10: +_unwind___jsvml_cbrt2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_cbrt2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrt2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -872,7 +872,7 @@ _unwind___svml_cbrt2_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_cbrt2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cbrt2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -886,9 +886,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt2_ha_e9 + PUBLIC __jsvml_cbrt2_ha_e9 -__svml_cbrt2_ha_e9 PROC EXPORT +__jsvml_cbrt2_ha_e9 PROC EXPORT _B6_1:: @@ -906,11 +906,11 @@ L52:: vmovups XMMWORD PTR [192+rsp], xmm6 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovq xmm9, QWORD PTR [__svml_dcbrt_ha_data_internal+2752] + vmovq xmm9, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2752] and r13, -64 - vmovq xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2816] + vmovq xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2816] vpshufd xmm2, xmm8, 221 - vmovq xmm6, QWORD PTR [__svml_dcbrt_ha_data_internal+3008] + vmovq xmm6, QWORD PTR [__jsvml_dcbrt_ha_data_internal+3008] vpand xmm3, xmm2, xmm5 vpand xmm9, xmm2, xmm9 vpsubd xmm5, xmm3, xmm6 @@ -918,17 +918,17 @@ L52:: vpsrlq xmm9, xmm8, 52 vmovd ecx, xmm6 vpsrld xmm2, xmm2, 20 - vmovq xmm4, QWORD PTR [__svml_dcbrt_ha_data_internal+3072] + vmovq xmm4, QWORD PTR [__jsvml_dcbrt_ha_data_internal+3072] vpcmpgtd xmm4, xmm5, xmm4 movsxd rcx, ecx vpextrd r8d, xmm6, 1 movsxd r8, r8d - vpand xmm5, xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2624] - vmovsd xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+rcx] + vpand xmm5, xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+rcx] vmovmskps edx, xmm4 - vmovhpd xmm4, xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r8] - vmovq xmm1, QWORD PTR [__svml_dcbrt_ha_data_internal+2880] - vpmuludq xmm3, xmm5, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2688] + vmovhpd xmm4, xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r8] + vmovq xmm1, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2880] + vpmuludq xmm3, xmm5, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] vpand xmm1, xmm2, xmm1 vpshufd xmm9, xmm3, 136 vpshufd xmm5, xmm5, 136 @@ -940,40 +940,40 @@ L52:: vpaddd xmm6, xmm6, xmm5 vpslld xmm5, xmm6, 1 vmovd r9d, xmm5 - vmovq xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2944] - vandpd xmm2, xmm8, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2496] + vmovq xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2944] + vandpd xmm2, xmm8, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] vpextrd r10d, xmm5, 1 movsxd r9, r9d movsxd r10, r10d mov QWORD PTR [248+rsp], r13 - vmovupd xmm9, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r9] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r10] + vmovupd xmm9, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r9] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r10] vunpcklpd xmm5, xmm9, xmm6 vunpckhpd xmm6, xmm9, xmm6 vpor xmm9, xmm1, xmm0 vpaddd xmm3, xmm9, xmm3 - vandpd xmm9, xmm8, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2368] + vandpd xmm9, xmm8, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] vpslld xmm1, xmm3, 20 vpxor xmm0, xmm0, xmm0 vpunpckldq xmm3, xmm0, xmm1 - vorpd xmm0, xmm2, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2432] - vorpd xmm1, xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2304] + vorpd xmm0, xmm2, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + vorpd xmm1, xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] vsubpd xmm2, xmm0, xmm1 vmulpd xmm4, xmm4, xmm2 - vmulpd xmm9, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1792] - vaddpd xmm0, xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1856] + vmulpd xmm9, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] + vaddpd xmm0, xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] vmulpd xmm1, xmm4, xmm0 - vaddpd xmm2, xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1920] + vaddpd xmm2, xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] vmulpd xmm9, xmm4, xmm2 - vaddpd xmm0, xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1984] + vaddpd xmm0, xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] vmulpd xmm1, xmm4, xmm0 - vaddpd xmm2, xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2048] + vaddpd xmm2, xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] vmulpd xmm9, xmm4, xmm2 - vaddpd xmm0, xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2112] + vaddpd xmm0, xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] vmulpd xmm1, xmm4, xmm0 - vaddpd xmm2, xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2176] + vaddpd xmm2, xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] vmulpd xmm9, xmm4, xmm2 - vaddpd xmm0, xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2240] + vaddpd xmm0, xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] vmulpd xmm9, xmm5, xmm3 vmulpd xmm5, xmm6, xmm3 vmulpd xmm4, xmm4, xmm9 @@ -1029,19 +1029,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_cbrt2_ha_e9 ENDP +__jsvml_cbrt2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt2_ha_e9_B1_B3: +_unwind___jsvml_cbrt2_ha_e9_B1_B3: DD 669953 DD 2020409 DD 813105 @@ -1056,19 +1056,19 @@ _unwind___svml_cbrt2_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_cbrt2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrt2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt2_ha_e9_B6_B10: +_unwind___jsvml_cbrt2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_cbrt2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrt2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1077,7 +1077,7 @@ _unwind___svml_cbrt2_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_cbrt2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cbrt2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1091,9 +1091,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt1_ha_ex + PUBLIC __jsvml_cbrt1_ha_ex -__svml_cbrt1_ha_ex PROC EXPORT +__jsvml_cbrt1_ha_ex PROC EXPORT _B7_1:: @@ -1119,9 +1119,9 @@ L65:: psubd xmm11, xmm3 movaps xmm3, xmm1 movd xmm2, ecx - movq xmm5, QWORD PTR [__svml_dcbrt_ha_data_internal+2624] + movq xmm5, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] psrlq xmm3, 52 - movq xmm4, QWORD PTR [__svml_dcbrt_ha_data_internal+2688] + movq xmm4, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] pand xmm3, xmm5 pmuludq xmm4, xmm3 pcmpgtd xmm11, xmm2 @@ -1152,43 +1152,43 @@ L65:: and r13, -64 mov QWORD PTR [192+rsp], r13 and eax, 1 - movups xmm5, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rdx+r10] - movsd xmm4, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+264+rdx+r10] + movups xmm5, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rdx+r10] + movsd xmm4, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+264+rdx+r10] mov r10d, 682 movd xmm11, r10d por xmm0, xmm11 paddd xmm0, xmm2 - movsd xmm2, QWORD PTR [__svml_dcbrt_ha_data_internal+2496] + movsd xmm2, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] pslld xmm0, 20 punpckldq xmm3, xmm0 andps xmm2, xmm1 - movsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2432] - movsd xmm11, QWORD PTR [__svml_dcbrt_ha_data_internal+2368] + movsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + movsd xmm11, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] orps xmm2, xmm0 - movsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2304] + movsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] andps xmm11, xmm1 orps xmm11, xmm0 - movsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+1792] + movsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] subsd xmm2, xmm11 mulsd xmm5, xmm3 mulsd xmm4, xmm3 - mulsd xmm2, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rdx+r9] + mulsd xmm2, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rdx+r9] mulsd xmm0, xmm2 movaps xmm3, xmm5 mulsd xmm3, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+1856] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] mulsd xmm0, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+1920] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] mulsd xmm0, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+1984] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] mulsd xmm0, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2048] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] mulsd xmm0, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2112] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] mulsd xmm0, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2176] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] mulsd xmm0, xmm2 - addsd xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2240] + addsd xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] mulsd xmm0, xmm3 addsd xmm0, xmm4 addsd xmm0, xmm5 @@ -1217,19 +1217,19 @@ _B7_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B7_4 ALIGN 16 _B7_7:: -__svml_cbrt1_ha_ex ENDP +__jsvml_cbrt1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt1_ha_ex_B1_B6: +_unwind___jsvml_cbrt1_ha_ex_B1_B6: DD 412929 DD 1430605 DD 768033 @@ -1242,7 +1242,7 @@ _unwind___svml_cbrt1_ha_ex_B1_B6: DD imagerel _B7_1 DD imagerel _B7_7 - DD imagerel _unwind___svml_cbrt1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_cbrt1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1256,9 +1256,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt4_ha_e9 + PUBLIC __jsvml_cbrt4_ha_e9 -__svml_cbrt4_ha_e9 PROC EXPORT +__jsvml_cbrt4_ha_e9 PROC EXPORT _B8_1:: @@ -1275,23 +1275,23 @@ L70:: vmovapd ymm15, ymm0 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [367+rsp] - vmovupd xmm0, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2624] + vmovupd xmm0, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] and r13, -64 - vmovupd xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2688] + vmovupd xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] mov QWORD PTR [536+rsp], r13 vextractf128 xmm2, ymm15, 1 vshufps xmm3, xmm15, xmm2, 221 vpsrlq xmm2, xmm2, 52 - vandps xmm5, xmm3, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2816] + vandps xmm5, xmm3, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2816] vpand xmm2, xmm2, xmm0 - vpsubd xmm4, xmm5, XMMWORD PTR [__svml_dcbrt_ha_data_internal+3008] - vpcmpgtd xmm5, xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+3072] - vandps xmm4, xmm3, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2752] + vpsubd xmm4, xmm5, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+3008] + vpcmpgtd xmm5, xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+3072] + vandps xmm4, xmm3, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2752] vpsrld xmm3, xmm3, 20 vpsrld xmm4, xmm4, 12 vmovd ecx, xmm4 vmovmskps edx, xmm5 - vpand xmm3, xmm3, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2880] + vpand xmm3, xmm3, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2880] movsxd rcx, ecx vpextrd r8d, xmm4, 1 vpextrd r9d, xmm4, 2 @@ -1299,10 +1299,10 @@ L70:: movsxd r9, r9d vpextrd r10d, xmm4, 3 movsxd r10, r10d - vmovsd xmm8, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+rcx] - vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r8] - vmovsd xmm8, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r9] - vmovhpd xmm8, xmm8, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r10] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+rcx] + vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r8] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r9] + vmovhpd xmm8, xmm8, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r10] vinsertf128 ymm5, ymm5, xmm8, 1 vpsrlq xmm8, xmm15, 52 vpand xmm8, xmm8, xmm0 @@ -1325,42 +1325,42 @@ L70:: vpextrd r9d, xmm2, 3 movsxd r8, r8d movsxd r9, r9d - vpor xmm2, xmm3, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2944] - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r11] + vpor xmm2, xmm3, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2944] + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r11] vpaddd xmm1, xmm2, xmm1 - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+rcx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+rcx] vpslld xmm1, xmm1, 20 vpxor xmm3, xmm3, xmm3 vpunpckhdq xmm2, xmm3, xmm1 - vinsertf128 ymm8, ymm8, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r8], 1 - vinsertf128 ymm0, ymm4, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r9], 1 + vinsertf128 ymm8, ymm8, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r8], 1 + vinsertf128 ymm0, ymm4, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r9], 1 vunpcklpd ymm4, ymm8, ymm0 vunpckhpd ymm0, ymm8, ymm0 vpunpckldq xmm8, xmm3, xmm1 - vandpd ymm3, ymm15, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2496] - vandpd ymm1, ymm15, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2368] + vandpd ymm3, ymm15, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] + vandpd ymm1, ymm15, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] vinsertf128 ymm2, ymm8, xmm2, 1 - vorpd ymm8, ymm3, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2432] - vorpd ymm3, ymm1, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2304] + vorpd ymm8, ymm3, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + vorpd ymm3, ymm1, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] vsubpd ymm1, ymm8, ymm3 vmulpd ymm1, ymm5, ymm1 - vmulpd ymm5, ymm1, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1792] - vaddpd ymm3, ymm5, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1856] + vmulpd ymm5, ymm1, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] + vaddpd ymm3, ymm5, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] vmulpd ymm5, ymm1, ymm3 - vaddpd ymm8, ymm5, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1920] + vaddpd ymm8, ymm5, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] vmulpd ymm3, ymm1, ymm8 - vaddpd ymm5, ymm3, YMMWORD PTR [__svml_dcbrt_ha_data_internal+1984] + vaddpd ymm5, ymm3, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] vmulpd ymm8, ymm1, ymm5 - vaddpd ymm3, ymm8, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2048] + vaddpd ymm3, ymm8, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] vmulpd ymm5, ymm1, ymm3 - vaddpd ymm8, ymm5, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2112] + vaddpd ymm8, ymm5, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] vmulpd ymm3, ymm1, ymm8 - vaddpd ymm5, ymm3, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2176] + vaddpd ymm5, ymm3, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] vmulpd ymm3, ymm4, ymm2 vmulpd ymm4, ymm0, ymm2 vmulpd ymm8, ymm1, ymm5 vmulpd ymm0, ymm1, ymm3 - vaddpd ymm5, ymm8, YMMWORD PTR [__svml_dcbrt_ha_data_internal+2240] + vaddpd ymm5, ymm8, YMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] vmulpd ymm1, ymm5, ymm0 vaddpd ymm2, ymm4, ymm1 vaddpd ymm0, ymm3, ymm2 @@ -1428,19 +1428,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_cbrt4_ha_e9 ENDP +__jsvml_cbrt4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt4_ha_e9_B1_B3: +_unwind___jsvml_cbrt4_ha_e9_B1_B3: DD 536577 DD 4379696 DD 2066468 @@ -1454,13 +1454,13 @@ _unwind___svml_cbrt4_ha_e9_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_cbrt4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrt4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt4_ha_e9_B6_B10: +_unwind___jsvml_cbrt4_ha_e9_B6_B10: DD 1332001 DD 2384979 DD 2438217 @@ -1474,7 +1474,7 @@ _unwind___svml_cbrt4_ha_e9_B6_B10: DD 1075211 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_cbrt4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrt4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1483,7 +1483,7 @@ _unwind___svml_cbrt4_ha_e9_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_cbrt4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cbrt4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1497,9 +1497,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrt2_ha_ex + PUBLIC __jsvml_cbrt2_ha_ex -__svml_cbrt2_ha_ex PROC EXPORT +__jsvml_cbrt2_ha_ex PROC EXPORT _B9_1:: @@ -1517,31 +1517,31 @@ L97:: movups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - movq xmm0, QWORD PTR [__svml_dcbrt_ha_data_internal+2752] + movq xmm0, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2752] and r13, -64 pshufd xmm7, xmm5, 221 pand xmm0, xmm7 psrld xmm0, 12 - movq xmm2, QWORD PTR [__svml_dcbrt_ha_data_internal+2816] + movq xmm2, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2816] pshufd xmm9, xmm0, 1 pand xmm2, xmm7 - movq xmm3, QWORD PTR [__svml_dcbrt_ha_data_internal+3008] + movq xmm3, QWORD PTR [__jsvml_dcbrt_ha_data_internal+3008] psrld xmm7, 20 movd r8d, xmm9 movaps xmm9, xmm5 - movq xmm1, QWORD PTR [__svml_dcbrt_ha_data_internal+3072] + movq xmm1, QWORD PTR [__jsvml_dcbrt_ha_data_internal+3072] psubd xmm2, xmm3 psrlq xmm9, 52 pcmpgtd xmm2, xmm1 - pand xmm9, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2624] - movdqu xmm1, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2688] + pand xmm9, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2624] + movdqu xmm1, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2688] pmuludq xmm1, xmm9 movmskps edx, xmm2 movd ecx, xmm0 - movq xmm4, QWORD PTR [__svml_dcbrt_ha_data_internal+2880] + movq xmm4, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2880] pshufd xmm2, xmm1, 136 pand xmm7, xmm4 - movq xmm6, QWORD PTR [__svml_dcbrt_ha_data_internal+2944] + movq xmm6, QWORD PTR [__jsvml_dcbrt_ha_data_internal+2944] psrld xmm2, 14 por xmm7, xmm6 movdqa xmm1, xmm2 @@ -1555,46 +1555,46 @@ L97:: pslld xmm9, 8 punpckldq xmm2, xmm7 paddd xmm0, xmm9 - movups xmm7, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2496] + movups xmm7, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2496] pslld xmm0, 1 - movups xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2368] + movups xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2368] andps xmm7, xmm5 andps xmm4, xmm5 and edx, 3 - orps xmm7, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2432] - orps xmm4, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2304] + orps xmm7, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2432] + orps xmm4, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2304] movsxd rcx, ecx subpd xmm7, xmm4 movd r9d, xmm0 - movsd xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+rcx] + movsd xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+rcx] movsxd r8, r8d - movups xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1792] + movups xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1792] pshufd xmm0, xmm0, 1 movd r10d, xmm0 - movhpd xmm3, QWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+rax+r8] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+rax+r8] mulpd xmm3, xmm7 mulpd xmm6, xmm3 - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1856] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1856] mulpd xmm6, xmm3 - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1920] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1920] mulpd xmm6, xmm3 - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+1984] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+1984] mulpd xmm6, xmm3 - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2048] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2048] mulpd xmm6, xmm3 - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2112] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2112] mulpd xmm6, xmm3 movsxd r9, r9d movsxd r10, r10d - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2176] - movups xmm1, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r9] - movups xmm9, XMMWORD PTR [imagerel(__svml_dcbrt_ha_data_internal)+256+rax+r10] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2176] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r9] + movups xmm9, XMMWORD PTR [imagerel(__jsvml_dcbrt_ha_data_internal)+256+rax+r10] movaps xmm0, xmm1 unpcklpd xmm0, xmm9 mulpd xmm0, xmm2 mulpd xmm6, xmm3 mulpd xmm3, xmm0 - addpd xmm6, XMMWORD PTR [__svml_dcbrt_ha_data_internal+2240] + addpd xmm6, XMMWORD PTR [__jsvml_dcbrt_ha_data_internal+2240] unpckhpd xmm1, xmm9 mulpd xmm1, xmm2 mulpd xmm6, xmm3 @@ -1652,19 +1652,19 @@ _B9_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcbrt_ha_cout_rare_internal + call __jsvml_dcbrt_ha_cout_rare_internal jmp _B9_8 ALIGN 16 _B9_11:: -__svml_cbrt2_ha_ex ENDP +__jsvml_cbrt2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt2_ha_ex_B1_B3: +_unwind___jsvml_cbrt2_ha_ex_B1_B3: DD 669185 DD 2020406 DD 878638 @@ -1679,19 +1679,19 @@ _unwind___svml_cbrt2_ha_ex_B1_B3: DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_cbrt2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cbrt2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrt2_ha_ex_B6_B10: +_unwind___jsvml_cbrt2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_cbrt2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cbrt2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1700,7 +1700,7 @@ _unwind___svml_cbrt2_ha_ex_B6_B10: DD imagerel _B9_6 DD imagerel _B9_11 - DD imagerel _unwind___svml_cbrt2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_cbrt2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1714,9 +1714,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dcbrt_ha_cout_rare_internal + PUBLIC __jsvml_dcbrt_ha_cout_rare_internal -__svml_dcbrt_ha_cout_rare_internal PROC +__jsvml_dcbrt_ha_cout_rare_internal PROC _B10_1:: @@ -2037,13 +2037,13 @@ _B10_9:: _B10_10:: -__svml_dcbrt_ha_cout_rare_internal ENDP +__jsvml_dcbrt_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dcbrt_ha_cout_rare_internal_B1_B9: +_unwind___jsvml_dcbrt_ha_cout_rare_internal_B1_B9: DD 540929 DD 178241 DD 247867 @@ -2057,7 +2057,7 @@ _unwind___svml_dcbrt_ha_cout_rare_internal_B1_B9: DD imagerel _B10_1 DD imagerel _B10_10 - DD imagerel _unwind___svml_dcbrt_ha_cout_rare_internal_B1_B9 + DD imagerel _unwind___jsvml_dcbrt_ha_cout_rare_internal_B1_B9 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2065,8 +2065,8 @@ _DATA ENDS _RDATA SEGMENT READ 'DATA' DD 8 DUP (0H) - PUBLIC __svml_dcbrt_ha_data_internal_avx512 -__svml_dcbrt_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dcbrt_ha_data_internal_avx512 +__jsvml_dcbrt_ha_data_internal_avx512 DD 0 DD 1072693248 DD 4186796683 DD 1072965794 @@ -2418,8 +2418,8 @@ __svml_dcbrt_ha_data_internal_avx512 DD 0 DD 1070945621 DD 1431655767 DD 1070945621 - PUBLIC __svml_dcbrt_ha_data_internal -__svml_dcbrt_ha_data_internal DD 528611360 + PUBLIC __jsvml_dcbrt_ha_data_internal +__jsvml_dcbrt_ha_data_internal DD 528611360 DD 3220144632 DD 2884679527 DD 3220082993 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_cos_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cos_windows_x86.S similarity index 90% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_cos_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cos_windows_x86.S index 3e05172fe61..5583b0b456d 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_cos_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cos_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos2_ha_ex + PUBLIC __jsvml_cos2_ha_ex -__svml_cos2_ha_ex PROC EXPORT +__jsvml_cos2_ha_ex PROC EXPORT _B1_1:: @@ -66,20 +66,20 @@ L1:: movups XMMWORD PTR [416+rsp], xmm6 mov QWORD PTR [432+rsp], r13 lea r13, QWORD PTR [191+rsp] - movups xmm3, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16576] + movups xmm3, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] and r13, -64 mulpd xmm3, xmm2 - movups xmm1, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16640] + movups xmm1, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] addpd xmm3, xmm1 movaps xmm10, xmm3 subpd xmm10, xmm1 - movups xmm4, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16768] + movups xmm4, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] mulpd xmm4, xmm10 - movups xmm5, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16832] + movups xmm5, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] mulpd xmm5, xmm10 subpd xmm12, xmm4 movaps xmm11, xmm12 - andps xmm3, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + andps xmm3, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] subpd xmm11, xmm5 pextrw r8d, xmm3, 4 movd ecx, xmm3 @@ -88,19 +88,19 @@ L1:: movaps xmm8, xmm11 shl r8d, 5 movaps xmm4, xmm11 - movq xmm3, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] movaps xmm6, xmm11 - movhpd xmm3, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] mulpd xmm8, xmm3 subpd xmm12, xmm5 mulpd xmm6, xmm11 - movq xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - movups xmm0, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16896] - movhpd xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] + movq xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + movups xmm0, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] mulpd xmm0, xmm10 - movq xmm10, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + movq xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] movaps xmm7, xmm9 - movhpd xmm10, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] + movhpd xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] movaps xmm1, xmm9 addpd xmm7, xmm8 subpd xmm12, xmm0 @@ -110,25 +110,25 @@ L1:: addpd xmm8, xmm1 movaps xmm0, xmm7 addpd xmm0, xmm4 - movups xmm1, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + movups xmm1, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] movaps xmm15, xmm1 mulpd xmm15, xmm6 subpd xmm7, xmm0 addpd xmm4, xmm7 - movups xmm7, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + movups xmm7, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] addpd xmm15, xmm7 addpd xmm8, xmm4 mulpd xmm15, xmm6 mulpd xmm15, xmm11 mulpd xmm15, xmm10 - movups xmm5, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17216] + movups xmm5, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] addpd xmm8, xmm15 movaps xmm15, xmm5 mulpd xmm15, xmm6 - movups xmm4, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + movups xmm4, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] addpd xmm15, xmm4 mulpd xmm15, xmm6 - movups xmm3, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + movups xmm3, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] addpd xmm15, xmm3 mulpd xmm6, xmm15 mulpd xmm6, xmm9 @@ -136,13 +136,13 @@ L1:: addpd xmm8, xmm6 subpd xmm10, xmm9 mulpd xmm12, xmm10 - movq xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] - movhpd xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] - movups xmm14, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16384] + movq xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] + movups xmm14, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] addpd xmm9, xmm12 andps xmm14, xmm2 movaps xmm13, xmm14 - cmpnlepd xmm13, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16448] + cmpnlepd xmm13, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] addpd xmm8, xmm9 movmskpd r9d, xmm13 addpd xmm0, xmm8 @@ -211,7 +211,7 @@ _B1_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B1_9 _B1_12:: @@ -221,7 +221,7 @@ _B1_12:: pand xmm0, xmm2 psrlq xmm0, 52 movd ecx, xmm0 - movups xmm9, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + movups xmm9, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] andps xmm14, xmm9 pextrw r9d, xmm0, 4 cmpeqpd xmm14, xmm9 @@ -233,20 +233,20 @@ _B1_12:: shl r8d, 3 paddq xmm4, XMMWORD PTR [_2il0floatpacket_36] movmskpd edx, xmm14 - movq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r8] + movq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r8] movdqa xmm8, xmm4 movups XMMWORD PTR [32+rsp], xmm7 psrlq xmm8, 32 shl r10d, 3 movdqa xmm9, xmm8 - movhpd xmm6, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r10] + movhpd xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r10] movdqu xmm7, XMMWORD PTR [_2il0floatpacket_37] movaps xmm11, xmm6 - movq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r8] + movq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r8] psrlq xmm11, 32 pand xmm4, xmm7 pand xmm6, xmm7 - movhpd xmm14, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r10] + movhpd xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r10] movdqa xmm12, xmm4 pmuludq xmm9, xmm11 movaps xmm15, xmm14 @@ -266,11 +266,11 @@ _B1_12:: pand xmm0, xmm12 pmuludq xmm15, xmm8 paddq xmm0, xmm9 - movq xmm10, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r8] + movq xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r8] psrlq xmm12, 32 movups XMMWORD PTR [80+rsp], xmm3 movdqa xmm3, xmm7 - movhpd xmm10, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r10] + movhpd xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r10] movdqa xmm11, xmm7 movups XMMWORD PTR [48+rsp], xmm5 pand xmm3, xmm10 @@ -380,14 +380,14 @@ _B1_12:: addpd xmm12, xmm1 shl r11d, 5 shl ecx, 5 - movq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r11] - movhpd xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + movq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r11] + movhpd xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] mulpd xmm3, xmm11 mulpd xmm12, xmm13 - movq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r11] - movq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r11] - movhpd xmm5, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] - movhpd xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] + movq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r11] + movq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r11] + movhpd xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] + movhpd xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] mulpd xmm9, xmm5 mulpd xmm12, xmm8 addpd xmm5, xmm11 @@ -415,8 +415,8 @@ _B1_12:: addpd xmm12, xmm11 mulpd xmm13, xmm12 mulpd xmm13, xmm4 - movq xmm0, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r11] - movhpd xmm0, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + movq xmm0, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r11] + movhpd xmm0, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] addpd xmm3, xmm13 addpd xmm0, xmm7 addpd xmm3, xmm0 @@ -431,13 +431,13 @@ _B1_12:: _B1_13:: -__svml_cos2_ha_ex ENDP +__jsvml_cos2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_ex_B1_B4: +_unwind___jsvml_cos2_ha_ex_B1_B4: DD 1604353 DD 3593339 DD 1730675 @@ -459,19 +459,19 @@ _unwind___svml_cos2_ha_ex_B1_B4: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_cos2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_ex_B7_B11: +_unwind___jsvml_cos2_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_cos2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -480,17 +480,17 @@ _unwind___svml_cos2_ha_ex_B7_B11: DD imagerel _B1_7 DD imagerel _B1_12 - DD imagerel _unwind___svml_cos2_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_cos2_ha_ex_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_ex_B12_B12: +_unwind___jsvml_cos2_ha_ex_B12_B12: DD 33 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_cos2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -499,7 +499,7 @@ _unwind___svml_cos2_ha_ex_B12_B12: DD imagerel _B1_12 DD imagerel _B1_13 - DD imagerel _unwind___svml_cos2_ha_ex_B12_B12 + DD imagerel _unwind___jsvml_cos2_ha_ex_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -513,9 +513,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos8_ha_z0 + PUBLIC __jsvml_cos8_ha_z0 -__svml_cos8_ha_z0 PROC EXPORT +__jsvml_cos8_ha_z0 PROC EXPORT _B2_1:: @@ -530,28 +530,28 @@ L40:: vmovups ZMMWORD PTR [1264+rsp], zmm17 mov QWORD PTR [1256+rsp], r13 lea r13, QWORD PTR [1119+rsp] - vmovups zmm29, ZMMWORD PTR [__svml_dcos_ha_data_internal+128] + vmovups zmm29, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+128] and r13, -64 - vmovups zmm23, ZMMWORD PTR [__svml_dcos_ha_data_internal+192] - vmovups zmm5, ZMMWORD PTR [__svml_dcos_ha_data_internal+256] - vmovups zmm2, ZMMWORD PTR [__svml_dcos_ha_data_internal+384] - vmovups zmm31, ZMMWORD PTR [__svml_dcos_ha_data_internal+64] - vmovups zmm1, ZMMWORD PTR [__svml_dcos_ha_data_internal+896] - vmovups zmm17, ZMMWORD PTR [__svml_dcos_ha_data_internal+960] - vmovups zmm24, ZMMWORD PTR [__svml_dcos_ha_data_internal+512] - vmovups zmm25, ZMMWORD PTR [__svml_dcos_ha_data_internal+640] - vmovups zmm26, ZMMWORD PTR [__svml_dcos_ha_data_internal+768] + vmovups zmm23, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+192] + vmovups zmm5, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+256] + vmovups zmm2, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+384] + vmovups zmm31, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+64] + vmovups zmm1, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+896] + vmovups zmm17, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+960] + vmovups zmm24, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+512] + vmovups zmm25, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+640] + vmovups zmm26, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+768] vmovaps zmm27, zmm0 vfmadd213pd zmm29, zmm27, zmm23 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dcos_ha_data_internal+320] - vandpd zmm30, zmm27, ZMMWORD PTR [__svml_dcos_ha_data_internal] + vmovups zmm0, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+320] + vandpd zmm30, zmm27, ZMMWORD PTR [__jsvml_dcos_ha_data_internal] vsubpd zmm22, zmm29, zmm23 {rn-sae} - vpermt2pd zmm24, zmm29, ZMMWORD PTR [__svml_dcos_ha_data_internal+576] - vpermt2pd zmm25, zmm29, ZMMWORD PTR [__svml_dcos_ha_data_internal+704] - vpermt2pd zmm26, zmm29, ZMMWORD PTR [__svml_dcos_ha_data_internal+832] + vpermt2pd zmm24, zmm29, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+576] + vpermt2pd zmm25, zmm29, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+704] + vpermt2pd zmm26, zmm29, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+832] vfnmadd213pd zmm5, zmm22, zmm27 {rn-sae} vcmppd k1, zmm30, zmm31, 22 {sae} - vmovups zmm31, ZMMWORD PTR [__svml_dcos_ha_data_internal+1024] + vmovups zmm31, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+1024] vpsrlq zmm29, zmm29, 4 kortestw k1, k1 vmovaps zmm3, zmm22 @@ -561,20 +561,20 @@ L40:: vsubpd zmm4, zmm5, zmm3 {rn-sae} vmulpd zmm23, zmm28, zmm28 {rn-sae} vfnmadd231pd zmm4, zmm0, zmm22 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dcos_ha_data_internal+1152] + vmovups zmm0, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+1152] vsubpd zmm30, zmm28, zmm3 {rn-sae} vfmadd231pd zmm17, zmm1, zmm23 {rn-sae} - vmovups zmm3, ZMMWORD PTR [__svml_dcos_ha_data_internal+1088] + vmovups zmm3, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+1088] vfmadd213pd zmm22, zmm2, zmm30 {rn-sae} vfmadd213pd zmm17, zmm23, zmm0 {rn-sae} vfmadd231pd zmm3, zmm31, zmm23 {rn-sae} vpsllq zmm0, zmm26, 32 vsubpd zmm1, zmm4, zmm22 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dcos_ha_data_internal+1280] - vmovups zmm4, ZMMWORD PTR [__svml_dcos_ha_data_internal+1216] + vmovups zmm22, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+1280] + vmovups zmm4, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+1216] vfmadd213pd zmm17, zmm23, zmm22 {rn-sae} vfmadd213pd zmm3, zmm23, zmm4 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_dcos_ha_data_internal+1344] + vmovups zmm4, ZMMWORD PTR [__jsvml_dcos_ha_data_internal+1344] vmulpd zmm17, zmm25, zmm17 {rn-sae} vfmadd213pd zmm3, zmm23, zmm4 {rn-sae} vmovaps zmm5, zmm24 @@ -727,7 +727,7 @@ _B2_16:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B2_14 _B2_17:: @@ -736,7 +736,7 @@ _B2_17:: lea rdx, QWORD PTR [__ImageBase] vpsrlq zmm4, zmm24, 52 mov rcx, rdx - vmovups zmm5, ZMMWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovups zmm5, ZMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vpcmpeqd k3, zmm0, zmm0 vpsllq zmm22, zmm4, 1 vandpd zmm17, zmm5, zmm27 @@ -752,7 +752,7 @@ _B2_17:: mov r10, rdx mov r11, rdx vpxord zmm5, zmm5, zmm5 - vgatherdpd zmm5{k3}, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rdx+ymm28] + vgatherdpd zmm5{k3}, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rdx+ymm28] vpcmpeqd k3, zmm0, zmm0 vpandnq zmm23{k2}, zmm17, zmm17 vpcmpeqd k2, zmm0, zmm0 @@ -763,8 +763,8 @@ _B2_17:: vpandq zmm26, zmm27, QWORD BCST [_2il0floatpacket_54] vpaddq zmm24, zmm26, QWORD BCST [_2il0floatpacket_55] vpsrlq zmm26, zmm5, 32 - vgatherdpd zmm17{k2}, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rcx+ymm28] - vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+r8+ymm28] + vgatherdpd zmm17{k2}, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rcx+ymm28] + vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+r8+ymm28] vpsrlq zmm31, zmm17, 32 vpsrlq zmm29, zmm23, 32 vpandq zmm28, zmm17, zmm22 @@ -832,7 +832,7 @@ _B2_17:: vpandq zmm29, zmm29, QWORD BCST [_2il0floatpacket_64] vsubpd zmm17, zmm30, zmm26 {rn-sae} vpsllq zmm26, zmm29, 40 - vmovups zmm30, ZMMWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + vmovups zmm30, ZMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] vmovaps zmm28, zmm25 vpxorq zmm1, zmm5, QWORD BCST [_2il0floatpacket_63] vpternlogq zmm3, zmm26, zmm1, 254 @@ -845,7 +845,7 @@ _B2_17:: vsubpd zmm4, zmm4, zmm24 {rn-sae} vfmsub213pd zmm1, zmm24, zmm3 {rn-sae} vaddpd zmm26, zmm26, zmm4 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + vmovups zmm4, ZMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] vfmadd213pd zmm24, zmm5, zmm1 {rn-sae} vaddpd zmm29, zmm26, zmm17 {rn-sae} vpsllq zmm26, zmm31, 5 @@ -855,19 +855,19 @@ _B2_17:: vpcmpeqd k2, zmm0, zmm0 vandpd zmm5, zmm28, zmm3 vandpd zmm1, zmm28, zmm29 - vmovups zmm3, ZMMWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + vmovups zmm3, ZMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] vpandnq zmm25{k3}, zmm2, zmm2 vpternlogq zmm5, zmm25, zmm27, 248 vpcmpeqd k3, zmm0, zmm0 vmovaps zmm31, zmm5 vmovaps zmm26, zmm5 vpxord zmm25, zmm25, zmm25 - vgatherdpd zmm25{k2}, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+r9+ymm17] + vgatherdpd zmm25{k2}, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+r9+ymm17] vpcmpeqd k2, zmm0, zmm0 vpxord zmm23, zmm23, zmm23 vpxord zmm22, zmm22, zmm22 - vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+r10+ymm17] - vgatherdpd zmm22{k2}, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+r11+ymm17] + vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+r10+ymm17] + vgatherdpd zmm22{k2}, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+r11+ymm17] vpcmpeqd k3, zmm0, zmm0 vfmadd213pd zmm31, zmm22, zmm23 {rn-sae} vfmadd132pd zmm26, zmm31, zmm25 {rn-sae} @@ -880,8 +880,8 @@ _B2_17:: vfmadd231pd zmm3, zmm30, zmm24 {rn-sae} vmulpd zmm30, zmm3, zmm24 {rn-sae} vaddpd zmm3, zmm25, zmm22 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dcos_ha_data_internal_ha+17216] - vmovups zmm25, ZMMWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovups zmm22, ZMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] + vmovups zmm25, ZMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vmulpd zmm28, zmm30, zmm5 {rn-sae} vfmadd231pd zmm4, zmm22, zmm24 {rn-sae} vfnmadd213pd zmm5, zmm23, zmm3 {rn-sae} @@ -890,7 +890,7 @@ _B2_17:: vmulpd zmm2, zmm4, zmm24 {rn-sae} vfmadd213pd zmm2, zmm23, zmm28 {rn-sae} vpxord zmm23, zmm23, zmm23 - vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rdx+ymm17] + vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rdx+ymm17] vfmadd213pd zmm1, zmm5, zmm23 {rn-sae} vaddpd zmm1, zmm2, zmm1 {rn-sae} vaddpd zmm0{k1}, zmm26, zmm1 {rn-sae} @@ -899,13 +899,13 @@ _B2_17:: _B2_18:: -__svml_cos8_ha_z0 ENDP +__jsvml_cos8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos8_ha_z0_B1_B10: +_unwind___jsvml_cos8_ha_z0_B1_B10: DD 401409 DD 10343456 DD 5183512 @@ -918,13 +918,13 @@ _unwind___svml_cos8_ha_z0_B1_B10: DD imagerel _B2_1 DD imagerel _B2_12 - DD imagerel _unwind___svml_cos8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_cos8_ha_z0_B1_B10 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos8_ha_z0_B12_B16: +_unwind___jsvml_cos8_ha_z0_B12_B16: DD 3470081 DD 8606963 DD 8418537 @@ -960,13 +960,13 @@ _unwind___svml_cos8_ha_z0_B12_B16: DD imagerel _B2_12 DD imagerel _B2_17 - DD imagerel _unwind___svml_cos8_ha_z0_B12_B16 + DD imagerel _unwind___jsvml_cos8_ha_z0_B12_B16 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos8_ha_z0_B17_B17: +_unwind___jsvml_cos8_ha_z0_B17_B17: DD 393217 DD 5183488 DD 10343424 @@ -979,7 +979,7 @@ _unwind___svml_cos8_ha_z0_B17_B17: DD imagerel _B2_17 DD imagerel _B2_18 - DD imagerel _unwind___svml_cos8_ha_z0_B17_B17 + DD imagerel _unwind___jsvml_cos8_ha_z0_B17_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -993,9 +993,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos1_ha_l9 + PUBLIC __jsvml_cos1_ha_l9 -__svml_cos1_ha_l9 PROC EXPORT +__jsvml_cos1_ha_l9 PROC EXPORT _B3_1:: @@ -1021,57 +1021,57 @@ L91:: vmovups XMMWORD PTR [272+rsp], xmm6 mov QWORD PTR [264+rsp], r13 lea r13, QWORD PTR [191+rsp] - vmovsd xmm2, QWORD PTR [__svml_dcos_ha_data_internal_ha+16384] + vmovsd xmm2, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] and r13, -64 - vmovsd xmm3, QWORD PTR [__svml_dcos_ha_data_internal_ha+16640] + vmovsd xmm3, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] vandpd xmm12, xmm13, xmm2 vmovapd xmm2, xmm13 - vcmpnlesd xmm11, xmm12, QWORD PTR [__svml_dcos_ha_data_internal_ha+16448] - vfmadd132sd xmm2, xmm3, QWORD PTR [__svml_dcos_ha_data_internal_ha+16576] - vmovsd xmm8, QWORD PTR [__svml_dcos_ha_data_internal_ha+16832] + vcmpnlesd xmm11, xmm12, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] + vfmadd132sd xmm2, xmm3, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] + vmovsd xmm8, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] vmovmskpd r8d, xmm11 vsubsd xmm9, xmm2, xmm3 vmovapd xmm1, xmm9 vmovapd xmm10, xmm9 - vfnmadd132sd xmm1, xmm13, QWORD PTR [__svml_dcos_ha_data_internal_ha+16768] + vfnmadd132sd xmm1, xmm13, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] vmovapd xmm14, xmm9 - vmovq xmm3, QWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + vmovq xmm3, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] vpand xmm7, xmm2, xmm3 vmovd ecx, xmm7 vfnmadd213sd xmm10, xmm8, xmm1 shl ecx, 5 vmovapd xmm4, xmm10 - vmovq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] vsubsd xmm6, xmm1, xmm10 - vfmadd132sd xmm4, xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + vfmadd132sd xmm4, xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] vfnmadd213sd xmm14, xmm8, xmm6 vmovdqa xmm8, xmm1 vfmadd213sd xmm8, xmm10, xmm4 vsubsd xmm0, xmm7, xmm4 - vfnmadd132sd xmm9, xmm14, QWORD PTR [__svml_dcos_ha_data_internal_ha+16896] + vfnmadd132sd xmm9, xmm14, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] vmovapd xmm6, xmm10 vsubsd xmm5, xmm4, xmm8 - vfmadd132sd xmm6, xmm0, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vaddsd xmm0, xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + vfmadd132sd xmm6, xmm0, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vaddsd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] vmovdqa xmm15, xmm1 vfmadd213sd xmm15, xmm10, xmm5 vmulsd xmm5, xmm10, xmm10 vaddsd xmm15, xmm15, xmm6 - vmovsd xmm14, QWORD PTR [__svml_dcos_ha_data_internal_ha+17024] - vmovsd xmm6, QWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + vmovsd xmm14, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] + vmovsd xmm6, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] vmovapd xmm2, xmm14 vfmadd213sd xmm2, xmm5, xmm6 - vmovsd xmm1, QWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovsd xmm1, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vmulsd xmm3, xmm2, xmm5 vmulsd xmm4, xmm3, xmm10 vfnmadd213sd xmm10, xmm7, xmm0 - vmovsd xmm3, QWORD PTR [__svml_dcos_ha_data_internal_ha+17216] - vmovsd xmm2, QWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + vmovsd xmm3, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] + vmovsd xmm2, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] vfmadd213sd xmm4, xmm0, xmm15 vmovapd xmm15, xmm3 vfmadd213sd xmm15, xmm5, xmm2 - vfmadd213sd xmm9, xmm10, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vfmadd213sd xmm9, xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vfmadd213sd xmm15, xmm5, xmm1 vmulsd xmm5, xmm15, xmm5 vfmadd213sd xmm5, xmm7, xmm4 @@ -1122,7 +1122,7 @@ _B3_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B3_5 _B3_8:: @@ -1131,7 +1131,7 @@ _B3_8:: vpsrlq xmm10, xmm7, 52 vmovd ecx, xmm10 vmovupd XMMWORD PTR [32+rsp], xmm6 - vmovsd xmm6, QWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovsd xmm6, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vpand xmm9, xmm13, XMMWORD PTR [_2il0floatpacket_35] vandpd xmm12, xmm6, xmm12 vmovupd XMMWORD PTR [80+rsp], xmm1 @@ -1142,7 +1142,7 @@ _B3_8:: vmovmskpd edx, xmm8 vmovupd XMMWORD PTR [96+rsp], xmm11 vpsrlq xmm9, xmm1, 32 - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r8] vmovdqu xmm12, XMMWORD PTR [_2il0floatpacket_37] and edx, 1 vmovupd XMMWORD PTR [112+rsp], xmm0 @@ -1150,7 +1150,7 @@ _B3_8:: vpand xmm6, xmm1, xmm12 vpand xmm15, xmm11, xmm12 vmovupd XMMWORD PTR [48+rsp], xmm3 - vmovq xmm3, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r8] vpmuludq xmm11, xmm9, xmm0 vpsrlq xmm4, xmm3, 32 vpmuludq xmm0, xmm6, xmm0 @@ -1166,7 +1166,7 @@ _B3_8:: vpand xmm15, xmm1, xmm12 vpsrlq xmm5, xmm5, 32 vpaddq xmm15, xmm15, xmm11 - vmovq xmm10, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r8] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r8] vpand xmm0, xmm3, xmm12 vpand xmm7, xmm10, xmm12 vpsrlq xmm10, xmm10, 32 @@ -1236,12 +1236,12 @@ _B3_8:: vandpd xmm7, xmm8, xmm3 shl r9d, 5 vorpd xmm5, xmm4, xmm7 - vmovq xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r9] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r9] vmovapd xmm1, xmm5 - vfmadd132sd xmm1, xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] + vfmadd132sd xmm1, xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] vmovapd xmm4, xmm5 vfmadd213sd xmm9, xmm11, xmm0 - vmovq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r9] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r9] vmovdqa xmm12, xmm6 vmovdqa xmm3, xmm6 vfmadd213sd xmm12, xmm5, xmm1 @@ -1249,7 +1249,7 @@ _B3_8:: vandpd xmm11, xmm8, xmm9 vsubsd xmm2, xmm1, xmm12 vmulsd xmm8, xmm5, xmm5 - vfmadd132sd xmm4, xmm0, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] + vfmadd132sd xmm4, xmm0, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] vfmadd213sd xmm3, xmm5, xmm2 vfmadd213sd xmm14, xmm8, QWORD PTR [32+rsp] vmovupd xmm0, XMMWORD PTR [48+rsp] @@ -1257,13 +1257,13 @@ _B3_8:: vfmadd213sd xmm0, xmm8, QWORD PTR [64+rsp] vaddsd xmm7, xmm3, xmm4 vmulsd xmm14, xmm14, xmm8 - vaddsd xmm2, xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] + vaddsd xmm2, xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] vfmadd213sd xmm0, xmm8, QWORD PTR [80+rsp] vmulsd xmm1, xmm14, xmm5 vfnmadd213sd xmm5, xmm15, xmm2 vmulsd xmm3, xmm0, xmm8 vfmadd213sd xmm1, xmm2, xmm7 - vfmadd213sd xmm11, xmm5, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r9] + vfmadd213sd xmm11, xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r9] vmovupd xmm0, XMMWORD PTR [112+rsp] vfmadd213sd xmm3, xmm15, xmm1 vaddsd xmm4, xmm3, xmm11 @@ -1274,13 +1274,13 @@ _B3_8:: _B3_9:: -__svml_cos1_ha_l9 ENDP +__jsvml_cos1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos1_ha_l9_B1_B8: +_unwind___jsvml_cos1_ha_l9_B1_B8: DD 1604097 DD 2217082 DD 1140850 @@ -1302,7 +1302,7 @@ _unwind___svml_cos1_ha_l9_B1_B8: DD imagerel _B3_1 DD imagerel _B3_9 - DD imagerel _unwind___svml_cos1_ha_l9_B1_B8 + DD imagerel _unwind___jsvml_cos1_ha_l9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1316,9 +1316,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos2_ha_e9 + PUBLIC __jsvml_cos2_ha_e9 -__svml_cos2_ha_e9 PROC EXPORT +__jsvml_cos2_ha_e9 PROC EXPORT _B4_1:: @@ -1343,35 +1343,35 @@ L126:: vmovups XMMWORD PTR [416+rsp], xmm6 mov QWORD PTR [432+rsp], r13 lea r13, QWORD PTR [191+rsp] - vmulpd xmm1, xmm0, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16576] - vmovupd xmm4, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16640] + vmulpd xmm1, xmm0, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] + vmovupd xmm4, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] and r13, -64 vaddpd xmm10, xmm4, xmm1 vsubpd xmm13, xmm10, xmm4 - vmulpd xmm1, xmm13, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16768] - vmulpd xmm15, xmm13, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16832] + vmulpd xmm1, xmm13, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] + vmulpd xmm15, xmm13, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] vsubpd xmm9, xmm0, xmm1 - vmulpd xmm5, xmm13, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16896] + vmulpd xmm5, xmm13, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] vsubpd xmm6, xmm9, xmm15 - vandps xmm3, xmm10, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + vandps xmm3, xmm10, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] vsubpd xmm14, xmm9, xmm6 vmovd ecx, xmm3 - vandpd xmm8, xmm0, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16384] + vandpd xmm8, xmm0, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] shl ecx, 5 vpextrd r8d, xmm3, 2 shl r8d, 5 - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] vsubpd xmm11, xmm14, xmm15 - vcmpnlepd xmm7, xmm8, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16448] + vcmpnlepd xmm7, xmm8, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] vsubpd xmm5, xmm11, xmm5 vmovmskpd r9d, xmm7 - vmovhpd xmm15, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] + vmovhpd xmm15, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] vmulpd xmm1, xmm15, xmm6 - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm13, xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm13, xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] vmulpd xmm11, xmm13, xmm6 - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] vaddpd xmm14, xmm3, xmm1 vaddpd xmm4, xmm11, xmm14 vsubpd xmm9, xmm3, xmm14 @@ -1380,21 +1380,21 @@ L126:: vaddpd xmm2, xmm11, xmm10 vaddpd xmm14, xmm12, xmm2 vmulpd xmm2, xmm6, xmm6 - vmovupd xmm1, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + vmovupd xmm1, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] vmulpd xmm11, xmm1, xmm2 - vmovupd xmm9, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + vmovupd xmm9, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] vaddpd xmm10, xmm9, xmm11 vmulpd xmm12, xmm2, xmm10 vaddpd xmm10, xmm13, xmm15 vmulpd xmm11, xmm6, xmm12 vmulpd xmm15, xmm11, xmm10 vaddpd xmm12, xmm14, xmm15 - vmovupd xmm15, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17216] + vmovupd xmm15, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] vmulpd xmm13, xmm15, xmm2 - vmovupd xmm14, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + vmovupd xmm14, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] vaddpd xmm11, xmm14, xmm13 vmulpd xmm11, xmm2, xmm11 - vmovupd xmm13, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovupd xmm13, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vaddpd xmm11, xmm13, xmm11 vmulpd xmm2, xmm2, xmm11 vmulpd xmm11, xmm3, xmm2 @@ -1402,8 +1402,8 @@ L126:: vaddpd xmm11, xmm12, xmm11 vsubpd xmm2, xmm10, xmm3 vmulpd xmm5, xmm5, xmm2 - vmovq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] - vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] vaddpd xmm2, xmm3, xmm5 vaddpd xmm3, xmm11, xmm2 mov QWORD PTR [440+rsp], r13 @@ -1470,7 +1470,7 @@ _B4_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B4_9 _B4_12:: @@ -1479,7 +1479,7 @@ _B4_12:: vpand xmm14, xmm0, XMMWORD PTR [_2il0floatpacket_34] vpsrlq xmm4, xmm14, 52 vmovd ecx, xmm4 - vmovupd xmm11, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovupd xmm11, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vmovupd XMMWORD PTR [32+rsp], xmm9 vandpd xmm9, xmm11, xmm8 vpextrd r9d, xmm4, 2 @@ -1490,12 +1490,12 @@ _B4_12:: lea r10d, DWORD PTR [r9+r9*2] vmovupd XMMWORD PTR [80+rsp], xmm13 shl r10d, 3 - vmovq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r8] - vmovq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r8] vpaddq xmm6, xmm9, XMMWORD PTR [_2il0floatpacket_36] vmovmskpd edx, xmm10 - vmovhpd xmm11, xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r10] - vmovhpd xmm13, xmm13, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r10] + vmovhpd xmm11, xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm13, xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r10] vpsrlq xmm5, xmm11, 32 vmovdqu xmm14, XMMWORD PTR [_2il0floatpacket_37] vpsrlq xmm8, xmm13, 32 @@ -1506,8 +1506,8 @@ _B4_12:: vpmuludq xmm13, xmm11, xmm15 vmovupd XMMWORD PTR [96+rsp], xmm7 vpsrlq xmm15, xmm13, 32 - vmovq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r8] - vmovhpd xmm12, xmm7, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r10] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r8] + vmovhpd xmm12, xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r10] vpand xmm7, xmm6, xmm14 vpmuludq xmm13, xmm11, xmm8 vpand xmm9, xmm12, xmm14 @@ -1600,15 +1600,15 @@ _B4_12:: vandpd xmm13, xmm9, xmm8 shl ecx, 5 vorpd xmm11, xmm12, xmm13 - vmovq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r11] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r11] vaddpd xmm6, xmm2, xmm15 - vmovq xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r11] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r11] vandpd xmm9, xmm9, xmm6 - vmovhpd xmm14, xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm10, xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm14, xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm10, xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] vmulpd xmm15, xmm11, xmm14 - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r11] - vmovhpd xmm6, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r11] + vmovhpd xmm6, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] vaddpd xmm3, xmm6, xmm15 vmulpd xmm4, xmm11, xmm10 vsubpd xmm2, xmm6, xmm3 @@ -1635,8 +1635,8 @@ _B4_12:: vaddpd xmm10, xmm4, xmm5 vsubpd xmm7, xmm1, xmm6 vmulpd xmm9, xmm9, xmm7 - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r11] - vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vaddpd xmm1, xmm8, xmm9 vaddpd xmm2, xmm10, xmm1 vaddpd xmm13, xmm13, xmm2 @@ -1648,13 +1648,13 @@ _B4_12:: _B4_13:: -__svml_cos2_ha_e9 ENDP +__jsvml_cos2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_e9_B1_B4: +_unwind___jsvml_cos2_ha_e9_B1_B4: DD 1603073 DD 3593334 DD 1730670 @@ -1676,19 +1676,19 @@ _unwind___svml_cos2_ha_e9_B1_B4: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_cos2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_e9_B7_B11: +_unwind___jsvml_cos2_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_cos2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1697,17 +1697,17 @@ _unwind___svml_cos2_ha_e9_B7_B11: DD imagerel _B4_7 DD imagerel _B4_12 - DD imagerel _unwind___svml_cos2_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_cos2_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_e9_B12_B12: +_unwind___jsvml_cos2_ha_e9_B12_B12: DD 33 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_cos2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1716,7 +1716,7 @@ _unwind___svml_cos2_ha_e9_B12_B12: DD imagerel _B4_12 DD imagerel _B4_13 - DD imagerel _unwind___svml_cos2_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_cos2_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1730,9 +1730,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos4_ha_l9 + PUBLIC __jsvml_cos4_ha_l9 -__svml_cos4_ha_l9 PROC EXPORT +__jsvml_cos4_ha_l9 PROC EXPORT _B5_1:: @@ -1757,22 +1757,22 @@ L165:: vmovups YMMWORD PTR [592+rsp], ymm6 mov QWORD PTR [624+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd ymm9, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16576] + vmovupd ymm9, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] and r13, -64 - vmovupd ymm1, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16640] - vmovupd ymm15, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16768] - vmovupd ymm4, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16832] + vmovupd ymm1, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] + vmovupd ymm15, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] + vmovupd ymm4, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] vfmadd213pd ymm9, ymm0, ymm1 vsubpd ymm5, ymm9, ymm1 vfnmadd213pd ymm15, ymm5, ymm0 vmovdqa ymm3, ymm4 vfnmadd213pd ymm3, ymm5, ymm15 - vandps ymm1, ymm9, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + vandps ymm1, ymm9, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] vsubpd ymm14, ymm15, ymm3 vfnmadd231pd ymm14, ymm4, ymm5 - vfnmadd132pd ymm5, ymm14, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16896] - vandpd ymm8, ymm0, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16384] - vcmpnle_uqpd ymm7, ymm8, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16448] + vfnmadd132pd ymm5, ymm14, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] + vandpd ymm8, ymm0, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] + vcmpnle_uqpd ymm7, ymm8, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] vmovmskpd r11d, ymm7 mov QWORD PTR [632+rsp], r13 vextracti128 xmm6, ymm1, 1 @@ -1783,21 +1783,21 @@ L165:: shl r9d, 5 vpextrd r10d, xmm6, 2 shl ecx, 5 - vmovq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] shl r10d, 5 - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r9] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r9] test r11d, r11d - vmovhpd xmm12, xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] - vmovhpd xmm10, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r10] - vmovq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r9] - vmovhpd xmm4, xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovq xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] - vmovhpd xmm1, xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r10] - vmovhpd xmm13, xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm12, xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] + vmovhpd xmm10, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r10] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r9] + vmovhpd xmm4, xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] + vmovhpd xmm1, xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r10] + vmovhpd xmm13, xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] vinsertf128 ymm15, ymm12, xmm10, 1 - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] - vmovhpd xmm2, xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] + vmovhpd xmm2, xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r10] vinsertf128 ymm6, ymm4, xmm1, 1 vmovdqa ymm10, ymm6 vmovdqa ymm4, ymm15 @@ -1810,27 +1810,27 @@ L165:: vfmadd231pd ymm1, ymm14, ymm3 vfmadd231pd ymm9, ymm3, ymm15 vaddpd ymm13, ymm1, ymm9 - vmovupd ymm9, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16960] - vmovupd ymm1, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + vmovupd ymm9, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] + vmovupd ymm1, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] vmovdqa ymm12, ymm9 vfmadd231pd ymm12, ymm1, ymm2 vmulpd ymm11, ymm2, ymm12 vmulpd ymm10, ymm3, ymm11 vaddpd ymm11, ymm15, ymm14 - vmovupd ymm14, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17152] - vmovupd ymm15, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17216] + vmovupd ymm14, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] + vmovupd ymm15, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] vfmadd213pd ymm10, ymm11, ymm13 - vmovupd ymm13, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovupd ymm13, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vfnmadd213pd ymm3, ymm6, ymm11 vmovdqa ymm12, ymm14 vfmadd231pd ymm12, ymm15, ymm2 vfmadd213pd ymm12, ymm2, ymm13 vmulpd ymm12, ymm2, ymm12 vfmadd213pd ymm12, ymm6, ymm10 - vmovq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] - vmovhpd xmm2, xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] - vmovq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r9] - vmovhpd xmm10, xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r10] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] + vmovhpd xmm2, xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r9] + vmovhpd xmm10, xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r10] vinsertf128 ymm11, ymm2, xmm10, 1 vfmadd213pd ymm5, ymm3, ymm11 vaddpd ymm3, ymm12, ymm5 @@ -1897,7 +1897,7 @@ _B5_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B5_9 _B5_12:: @@ -1906,7 +1906,7 @@ _B5_12:: vmovupd YMMWORD PTR [128+r13], ymm7 vmovupd YMMWORD PTR [160+r13], ymm2 vmovupd YMMWORD PTR [64+r13], ymm14 - vmovupd ymm14, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovupd ymm14, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vmovupd YMMWORD PTR [96+r13], ymm13 vmovupd YMMWORD PTR [32+r13], ymm15 vpand ymm9, ymm0, YMMWORD PTR [_2il0floatpacket_70] @@ -1926,24 +1926,24 @@ _B5_12:: lea r10d, DWORD PTR [rcx+rcx*2] shl r10d, 3 lea ecx, DWORD PTR [r8+r8*2] - vmovq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r11] - vmovhpd xmm13, xmm14, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r10] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r11] + vmovhpd xmm13, xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r10] shl r9d, 3 vmovdqu ymm14, YMMWORD PTR [_2il0floatpacket_73] - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r9] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r9] vpaddq ymm2, ymm7, YMMWORD PTR [_2il0floatpacket_72] - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r11] - vmovq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r9] - vmovhpd xmm12, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r10] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r11] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r9] + vmovhpd xmm12, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r10] shl ecx, 3 - vmovhpd xmm9, xmm11, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+rcx] - vmovhpd xmm8, xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+rcx] + vmovhpd xmm9, xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+rcx] + vmovhpd xmm8, xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+rcx] vpsrlq ymm11, ymm2, 32 vpand ymm7, ymm2, ymm14 - vmovq xmm3, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r11] - vmovq xmm10, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r9] - vmovhpd xmm15, xmm3, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r10] - vmovhpd xmm6, xmm10, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r11] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r9] + vmovhpd xmm15, xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm6, xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+rcx] vinsertf128 ymm13, ymm13, xmm9, 1 vinsertf128 ymm12, ymm12, xmm8, 1 vpsrlq ymm8, ymm13, 32 @@ -2040,19 +2040,19 @@ _B5_12:: shl r10d, 5 vpextrd r11d, xmm13, 2 shl ecx, 5 - vmovq xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] shl r11d, 5 - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r10] - vmovq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r10] - vmovq xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r10] - vmovhpd xmm14, xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm5, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r11] - vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r11] - vmovhpd xmm11, xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm15, xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r11] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r10] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r10] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r10] + vmovhpd xmm14, xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm5, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r11] + vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r11] + vmovhpd xmm11, xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm15, xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r11] vmulpd ymm9, ymm10, ymm10 vmovapd ymm2, ymm10 vinsertf128 ymm13, ymm14, xmm3, 1 @@ -2073,15 +2073,15 @@ _B5_12:: vmovupd ymm13, YMMWORD PTR [64+r13] vfnmadd213pd ymm10, ymm14, ymm1 vaddpd ymm8, ymm3, ymm4 - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r10] - vmovhpd xmm5, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r11] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r10] + vmovhpd xmm5, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r11] vfmadd231pd ymm13, ymm9, YMMWORD PTR [32+r13] vfmadd213pd ymm2, ymm1, ymm8 vfmadd213pd ymm13, ymm9, YMMWORD PTR [96+r13] vmulpd ymm12, ymm9, ymm13 vfmadd213pd ymm12, ymm14, ymm2 - vmovq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] - vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] + vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vmovupd ymm2, YMMWORD PTR [160+r13] vinsertf128 ymm11, ymm3, xmm5, 1 vfmadd213pd ymm6, ymm10, ymm11 @@ -2094,13 +2094,13 @@ _B5_12:: _B5_13:: -__svml_cos4_ha_l9 ENDP +__jsvml_cos4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos4_ha_l9_B1_B4: +_unwind___jsvml_cos4_ha_l9_B1_B4: DD 1603073 DD 5166198 DD 2451566 @@ -2122,19 +2122,19 @@ _unwind___svml_cos4_ha_l9_B1_B4: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_cos4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_cos4_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos4_ha_l9_B7_B11: +_unwind___jsvml_cos4_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_cos4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_cos4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2143,17 +2143,17 @@ _unwind___svml_cos4_ha_l9_B7_B11: DD imagerel _B5_7 DD imagerel _B5_12 - DD imagerel _unwind___svml_cos4_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_cos4_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos4_ha_l9_B12_B12: +_unwind___jsvml_cos4_ha_l9_B12_B12: DD 33 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_cos4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_cos4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2162,7 +2162,7 @@ _unwind___svml_cos4_ha_l9_B12_B12: DD imagerel _B5_12 DD imagerel _B5_13 - DD imagerel _unwind___svml_cos4_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_cos4_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2176,9 +2176,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos2_ha_l9 + PUBLIC __jsvml_cos2_ha_l9 -__svml_cos2_ha_l9 PROC EXPORT +__jsvml_cos2_ha_l9 PROC EXPORT _B6_1:: @@ -2203,20 +2203,20 @@ L204:: vmovups XMMWORD PTR [416+rsp], xmm6 mov QWORD PTR [432+rsp], r13 lea r13, QWORD PTR [191+rsp] - vmovupd xmm9, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16576] + vmovupd xmm9, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] and r13, -64 - vmovupd xmm1, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16640] + vmovupd xmm1, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] vfmadd213pd xmm9, xmm0, xmm1 - vmovupd xmm15, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16768] - vmovupd xmm4, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16832] - vandpd xmm8, xmm0, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16384] - vcmpnlepd xmm7, xmm8, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16448] + vmovupd xmm15, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] + vmovupd xmm4, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] + vandpd xmm8, xmm0, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] + vcmpnlepd xmm7, xmm8, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] vsubpd xmm6, xmm9, xmm1 vmovmskpd r9d, xmm7 vmovapd xmm3, xmm6 - vandps xmm1, xmm9, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + vandps xmm1, xmm9, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] vfnmadd213pd xmm15, xmm6, xmm0 - vmovupd xmm9, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + vmovupd xmm9, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] vmovd ecx, xmm1 vfnmadd213pd xmm3, xmm4, xmm15 vsubpd xmm14, xmm15, xmm3 @@ -2225,13 +2225,13 @@ L204:: shl ecx, 5 vpextrd r8d, xmm1, 2 shl r8d, 5 - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vfnmadd132pd xmm6, xmm14, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16896] - vmovhpd xmm5, xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] - vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] - vmovq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm15, xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vfnmadd132pd xmm6, xmm14, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] + vmovhpd xmm5, xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] + vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm15, xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] vfmadd213pd xmm10, xmm14, xmm5 vmulpd xmm2, xmm3, xmm3 vsubpd xmm11, xmm5, xmm10 @@ -2243,22 +2243,22 @@ L204:: vfmadd231pd xmm1, xmm3, xmm15 vaddpd xmm13, xmm11, xmm1 vaddpd xmm11, xmm15, xmm14 - vmovupd xmm1, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + vmovupd xmm1, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] vfmadd213pd xmm12, xmm1, xmm9 - vmovupd xmm15, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17216] - vmovupd xmm14, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + vmovupd xmm15, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] + vmovupd xmm14, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] vmulpd xmm10, xmm2, xmm12 vmulpd xmm10, xmm3, xmm10 vfnmadd213pd xmm3, xmm5, xmm11 vmovapd xmm12, xmm2 vfmadd213pd xmm12, xmm15, xmm14 vfmadd213pd xmm10, xmm11, xmm13 - vmovupd xmm13, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovupd xmm13, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vfmadd213pd xmm12, xmm2, xmm13 vmulpd xmm12, xmm2, xmm12 vfmadd213pd xmm12, xmm5, xmm10 - vmovq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] - vmovhpd xmm2, xmm5, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovhpd xmm2, xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] vfmadd213pd xmm6, xmm3, xmm2 vaddpd xmm3, xmm12, xmm6 mov QWORD PTR [440+rsp], r13 @@ -2325,7 +2325,7 @@ _B6_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B6_9 _B6_12:: @@ -2336,7 +2336,7 @@ _B6_12:: vpsrlq xmm7, xmm9, 52 vmovd ecx, xmm7 vmovupd XMMWORD PTR [64+rsp], xmm14 - vmovupd xmm14, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovupd xmm14, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vpextrd r9d, xmm7, 2 vandpd xmm10, xmm14, xmm8 vcmpeqpd xmm11, xmm10, xmm14 @@ -2346,12 +2346,12 @@ _B6_12:: lea r10d, DWORD PTR [r9+r9*2] shl r10d, 3 vmovupd XMMWORD PTR [48+rsp], xmm15 - vmovq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r8] vpaddq xmm15, xmm8, XMMWORD PTR [_2il0floatpacket_36] vmovmskpd edx, xmm11 vmovupd XMMWORD PTR [80+rsp], xmm13 vpsrlq xmm11, xmm15, 32 - vmovhpd xmm13, xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r10] + vmovhpd xmm13, xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r10] vmovdqu xmm14, XMMWORD PTR [_2il0floatpacket_37] vpsrlq xmm8, xmm13, 32 vpand xmm6, xmm13, xmm14 @@ -2359,8 +2359,8 @@ _B6_12:: vpmuludq xmm13, xmm11, xmm6 vmovupd XMMWORD PTR [112+rsp], xmm2 vpsrlq xmm6, xmm13, 32 - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r8] - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r10] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r8] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r10] vpmuludq xmm13, xmm11, xmm8 vpsrlq xmm5, xmm3, 32 vpmuludq xmm8, xmm7, xmm8 @@ -2369,9 +2369,9 @@ _B6_12:: vpmuludq xmm2, xmm7, xmm3 vpmuludq xmm3, xmm11, xmm3 vpaddq xmm13, xmm13, xmm8 - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r8] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r8] vpand xmm15, xmm2, xmm14 - vmovhpd xmm12, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r10] + vmovhpd xmm12, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r10] vpsrlq xmm2, xmm2, 32 vpmuludq xmm4, xmm7, xmm5 vpand xmm9, xmm12, xmm14 @@ -2451,15 +2451,15 @@ _B6_12:: vmovapd xmm2, xmm10 vpextrd ecx, xmm11, 2 shl ecx, 5 - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r11] - vmovq xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r11] - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r11] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r11] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] vmovapd xmm15, xmm10 vfmadd213pd xmm2, xmm7, xmm14 vfmadd231pd xmm5, xmm1, xmm9 - vmovq xmm3, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r11] - vmovhpd xmm13, xmm3, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r11] + vmovhpd xmm13, xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] vfmadd132pd xmm15, xmm2, xmm13 vmulpd xmm1, xmm9, xmm5 vsubpd xmm4, xmm2, xmm15 @@ -2476,8 +2476,8 @@ _B6_12:: vfmadd213pd xmm2, xmm1, xmm8 vmulpd xmm4, xmm9, xmm13 vfmadd213pd xmm4, xmm14, xmm2 - vmovq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r11] - vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vmovupd xmm2, XMMWORD PTR [112+rsp] vfmadd213pd xmm6, xmm10, xmm3 vmovupd xmm10, XMMWORD PTR [96+rsp] @@ -2489,13 +2489,13 @@ _B6_12:: _B6_13:: -__svml_cos2_ha_l9 ENDP +__jsvml_cos2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_l9_B1_B4: +_unwind___jsvml_cos2_ha_l9_B1_B4: DD 1603073 DD 3593334 DD 1730670 @@ -2517,19 +2517,19 @@ _unwind___svml_cos2_ha_l9_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_cos2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_l9_B7_B11: +_unwind___jsvml_cos2_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_cos2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2538,17 +2538,17 @@ _unwind___svml_cos2_ha_l9_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_cos2_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_cos2_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos2_ha_l9_B12_B12: +_unwind___jsvml_cos2_ha_l9_B12_B12: DD 33 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_cos2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_cos2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2557,7 +2557,7 @@ _unwind___svml_cos2_ha_l9_B12_B12: DD imagerel _B6_12 DD imagerel _B6_13 - DD imagerel _unwind___svml_cos2_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_cos2_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2571,9 +2571,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos1_ha_ex + PUBLIC __jsvml_cos1_ha_ex -__svml_cos1_ha_ex PROC EXPORT +__jsvml_cos1_ha_ex PROC EXPORT _B7_1:: @@ -2601,10 +2601,10 @@ L243:: movups XMMWORD PTR [288+rsp], xmm6 mov QWORD PTR [264+rsp], r13 lea r13, QWORD PTR [191+rsp] - mulsd xmm3, QWORD PTR [__svml_dcos_ha_data_internal_ha+16576] + mulsd xmm3, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] and r13, -64 - movsd xmm1, QWORD PTR [__svml_dcos_ha_data_internal_ha+16640] - movq xmm7, QWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + movsd xmm1, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] + movq xmm7, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] addsd xmm3, xmm1 movaps xmm6, xmm3 pand xmm3, xmm7 @@ -2612,40 +2612,40 @@ L243:: subsd xmm6, xmm1 movaps xmm5, xmm6 movaps xmm0, xmm6 - mulsd xmm5, QWORD PTR [__svml_dcos_ha_data_internal_ha+16768] - mulsd xmm0, QWORD PTR [__svml_dcos_ha_data_internal_ha+16832] - mulsd xmm6, QWORD PTR [__svml_dcos_ha_data_internal_ha+16896] + mulsd xmm5, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] + mulsd xmm0, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] + mulsd xmm6, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] subsd xmm9, xmm5 movaps xmm8, xmm9 shl ecx, 5 subsd xmm8, xmm0 movaps xmm1, xmm8 movaps xmm3, xmm8 - mulsd xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + mulsd xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] subsd xmm9, xmm8 mulsd xmm3, xmm8 subsd xmm9, xmm0 - movq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + movq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] subsd xmm9, xmm6 - movq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] movdqa xmm4, xmm7 mulsd xmm4, xmm8 movdqa xmm13, xmm6 addsd xmm13, xmm1 - addsd xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + addsd xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] movaps xmm0, xmm4 movdqa xmm12, xmm6 - movsd xmm5, QWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + movsd xmm5, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] addsd xmm0, xmm13 subsd xmm12, xmm13 subsd xmm13, xmm0 addsd xmm12, xmm1 addsd xmm13, xmm4 - movsd xmm1, QWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + movsd xmm1, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] addsd xmm13, xmm12 movaps xmm4, xmm1 mulsd xmm4, xmm3 - movsd xmm12, QWORD PTR [__svml_dcos_ha_data_internal_ha+17216] + movsd xmm12, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] addsd xmm4, xmm5 mulsd xmm4, xmm3 movaps xmm14, xmm12 @@ -2656,18 +2656,18 @@ L243:: subsd xmm7, xmm8 addsd xmm4, xmm13 mulsd xmm9, xmm7 - movsd xmm13, QWORD PTR [__svml_dcos_ha_data_internal_ha+17152] - movsd xmm15, QWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + movsd xmm13, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] + movsd xmm15, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] addsd xmm14, xmm13 - addsd xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + addsd xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] mulsd xmm14, xmm3 - movsd xmm11, QWORD PTR [__svml_dcos_ha_data_internal_ha+16384] + movsd xmm11, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] addsd xmm14, xmm15 mulsd xmm14, xmm3 andps xmm11, xmm2 mulsd xmm14, xmm6 movaps xmm10, xmm11 - cmpnlesd xmm10, QWORD PTR [__svml_dcos_ha_data_internal_ha+16448] + cmpnlesd xmm10, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] addsd xmm14, xmm4 movmskpd r8d, xmm10 addsd xmm14, xmm9 @@ -2717,7 +2717,7 @@ _B7_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B7_5 _B7_8:: @@ -2730,7 +2730,7 @@ _B7_8:: movdqu xmm5, XMMWORD PTR [_2il0floatpacket_35] movups XMMWORD PTR [112+rsp], xmm0 pand xmm5, xmm2 - movsd xmm0, QWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + movsd xmm0, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] lea r8d, DWORD PTR [rcx+rcx*2] andps xmm11, xmm0 paddq xmm5, XMMWORD PTR [_2il0floatpacket_36] @@ -2739,7 +2739,7 @@ _B7_8:: movdqa xmm4, xmm5 movups XMMWORD PTR [64+rsp], xmm13 psrlq xmm4, 32 - movq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r8] + movq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r8] movdqa xmm0, xmm4 movdqu xmm14, XMMWORD PTR [_2il0floatpacket_37] movdqa xmm8, xmm13 @@ -2747,7 +2747,7 @@ _B7_8:: pand xmm5, xmm14 movmskpd edx, xmm11 movdqa xmm9, xmm5 - movq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r8] + movq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r8] pand xmm13, xmm14 movups XMMWORD PTR [48+rsp], xmm12 movdqa xmm12, xmm11 @@ -2773,7 +2773,7 @@ _B7_8:: paddq xmm13, xmm6 movups XMMWORD PTR [80+rsp], xmm15 movdqa xmm15, xmm14 - movq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r8] + movq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r8] movdqa xmm3, xmm5 pand xmm15, xmm7 movdqa xmm8, xmm14 @@ -2877,16 +2877,16 @@ _B7_8:: orps xmm3, xmm12 shl r9d, 5 movaps xmm7, xmm3 - mulsd xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] - movq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r9] + mulsd xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] + movq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r9] movdqa xmm5, xmm14 movdqa xmm0, xmm14 - movq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r9] + movq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r9] addsd xmm5, xmm7 movdqa xmm13, xmm6 subsd xmm0, xmm5 mulsd xmm13, xmm3 - addsd xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] + addsd xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] addsd xmm0, xmm7 movaps xmm7, xmm3 movaps xmm9, xmm13 @@ -2912,7 +2912,7 @@ _B7_8:: mulsd xmm8, xmm14 mulsd xmm4, xmm6 addsd xmm8, xmm1 - addsd xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r9] + addsd xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r9] movups xmm1, XMMWORD PTR [96+rsp] addsd xmm8, xmm4 movaps xmm0, xmm1 @@ -2925,13 +2925,13 @@ _B7_8:: _B7_9:: -__svml_cos1_ha_ex ENDP +__jsvml_cos1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos1_ha_ex_B1_B8: +_unwind___jsvml_cos1_ha_ex_B1_B8: DD 1605121 DD 2217086 DD 1206390 @@ -2953,7 +2953,7 @@ _unwind___svml_cos1_ha_ex_B1_B8: DD imagerel _B7_1 DD imagerel _B7_9 - DD imagerel _unwind___svml_cos1_ha_ex_B1_B8 + DD imagerel _unwind___jsvml_cos1_ha_ex_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2967,9 +2967,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos1_ha_e9 + PUBLIC __jsvml_cos1_ha_e9 -__svml_cos1_ha_e9 PROC EXPORT +__jsvml_cos1_ha_e9 PROC EXPORT _B8_1:: @@ -2994,32 +2994,32 @@ L278:: vmovups XMMWORD PTR [416+rsp], xmm6 mov QWORD PTR [264+rsp], r13 lea r13, QWORD PTR [191+rsp] - vmulsd xmm3, xmm0, QWORD PTR [__svml_dcos_ha_data_internal_ha+16576] + vmulsd xmm3, xmm0, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] and r13, -64 - vmovsd xmm1, QWORD PTR [__svml_dcos_ha_data_internal_ha+16384] + vmovsd xmm1, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] vandpd xmm8, xmm0, xmm1 - vmovsd xmm1, QWORD PTR [__svml_dcos_ha_data_internal_ha+16640] - vmovq xmm12, QWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + vmovsd xmm1, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] + vmovq xmm12, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] vaddsd xmm5, xmm3, xmm1 - vcmpnlesd xmm7, xmm8, QWORD PTR [__svml_dcos_ha_data_internal_ha+16448] + vcmpnlesd xmm7, xmm8, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] vsubsd xmm11, xmm5, xmm1 vmovmskpd r8d, xmm7 vpand xmm2, xmm5, xmm12 - vmulsd xmm9, xmm11, QWORD PTR [__svml_dcos_ha_data_internal_ha+16768] - vmulsd xmm13, xmm11, QWORD PTR [__svml_dcos_ha_data_internal_ha+16832] - vmulsd xmm10, xmm11, QWORD PTR [__svml_dcos_ha_data_internal_ha+16896] + vmulsd xmm9, xmm11, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] + vmulsd xmm13, xmm11, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] + vmulsd xmm10, xmm11, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] vsubsd xmm14, xmm0, xmm9 vmovd ecx, xmm2 vsubsd xmm4, xmm14, xmm13 shl ecx, 5 vsubsd xmm15, xmm14, xmm4 - vmulsd xmm9, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmulsd xmm9, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] vmulsd xmm2, xmm4, xmm4 vsubsd xmm6, xmm15, xmm13 - vmovq xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] vsubsd xmm6, xmm6, xmm10 vmulsd xmm11, xmm15, xmm4 - vmovq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] mov QWORD PTR [432+rsp], r13 vaddsd xmm14, xmm5, xmm9 vaddsd xmm3, xmm11, xmm14 @@ -3027,22 +3027,22 @@ L278:: vsubsd xmm13, xmm14, xmm3 vaddsd xmm12, xmm1, xmm9 vaddsd xmm10, xmm13, xmm11 - vmovsd xmm1, QWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + vmovsd xmm1, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] vaddsd xmm14, xmm10, xmm12 vmulsd xmm13, xmm1, xmm2 - vaddsd xmm10, xmm15, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vmovsd xmm9, QWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + vaddsd xmm10, xmm15, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovsd xmm9, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] vaddsd xmm13, xmm13, xmm9 vmulsd xmm11, xmm13, xmm2 vmulsd xmm12, xmm11, xmm4 vmulsd xmm4, xmm4, xmm5 vmulsd xmm15, xmm12, xmm10 vaddsd xmm12, xmm15, xmm14 - vmovsd xmm15, QWORD PTR [__svml_dcos_ha_data_internal_ha+17216] + vmovsd xmm15, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] vmulsd xmm13, xmm15, xmm2 - vmovsd xmm14, QWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + vmovsd xmm14, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] vaddsd xmm11, xmm13, xmm14 - vmovsd xmm13, QWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovsd xmm13, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vmulsd xmm11, xmm11, xmm2 vaddsd xmm11, xmm11, xmm13 vmulsd xmm2, xmm11, xmm2 @@ -3050,7 +3050,7 @@ L278:: vsubsd xmm2, xmm10, xmm4 vmulsd xmm4, xmm6, xmm2 vaddsd xmm11, xmm11, xmm12 - vaddsd xmm5, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vaddsd xmm5, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vaddsd xmm6, xmm11, xmm5 vaddsd xmm2, xmm3, xmm6 test r8d, 1 @@ -3098,7 +3098,7 @@ _B8_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B8_5 _B8_8:: @@ -3106,7 +3106,7 @@ _B8_8:: vpand xmm5, xmm0, XMMWORD PTR [_2il0floatpacket_34] vpsrlq xmm11, xmm5, 52 vmovupd XMMWORD PTR [32+rsp], xmm9 - vmovsd xmm9, QWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovsd xmm9, QWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vmovd ecx, xmm11 vandpd xmm10, xmm9, xmm8 vmovupd XMMWORD PTR [64+rsp], xmm14 @@ -3119,12 +3119,12 @@ _B8_8:: vmovmskpd edx, xmm14 vmovupd XMMWORD PTR [80+rsp], xmm13 vpsrlq xmm11, xmm6, 32 - vmovq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r8] vmovdqu xmm14, XMMWORD PTR [_2il0floatpacket_37] vpsrlq xmm8, xmm13, 32 vpand xmm7, xmm6, xmm14 vpand xmm13, xmm13, xmm14 - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r8] and edx, 1 vmovupd XMMWORD PTR [48+rsp], xmm15 vpand xmm3, xmm4, xmm14 @@ -3142,7 +3142,7 @@ _B8_8:: vpaddq xmm13, xmm13, xmm8 vpand xmm6, xmm2, xmm14 vpaddq xmm6, xmm6, xmm13 - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r8] vpaddq xmm13, xmm15, xmm6 vpsrlq xmm15, xmm2, 32 vpand xmm9, xmm12, xmm14 @@ -3224,9 +3224,9 @@ _B8_8:: vaddsd xmm13, xmm15, xmm3 shl r9d, 5 vandpd xmm10, xmm10, xmm13 - vmulsd xmm2, xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] - vmovq xmm13, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r9] - vmovq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r9] + vmulsd xmm2, xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r9] vaddsd xmm3, xmm13, xmm2 vmulsd xmm5, xmm14, xmm9 vsubsd xmm15, xmm13, xmm3 @@ -3239,7 +3239,7 @@ _B8_8:: vaddsd xmm1, xmm1, QWORD PTR [32+rsp] vaddsd xmm12, xmm7, xmm8 vmulsd xmm2, xmm1, xmm15 - vaddsd xmm1, xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] + vaddsd xmm1, xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] vmulsd xmm11, xmm2, xmm9 vmulsd xmm9, xmm9, xmm13 vmulsd xmm14, xmm11, xmm1 @@ -3254,7 +3254,7 @@ _B8_8:: vsubsd xmm13, xmm1, xmm9 vmulsd xmm10, xmm10, xmm13 vaddsd xmm12, xmm8, xmm11 - vaddsd xmm1, xmm10, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r9] + vaddsd xmm1, xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r9] vaddsd xmm2, xmm12, xmm1 vmovupd xmm1, XMMWORD PTR [96+rsp] vaddsd xmm6, xmm6, xmm2 @@ -3265,13 +3265,13 @@ _B8_8:: _B8_9:: -__svml_cos1_ha_e9 ENDP +__jsvml_cos1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos1_ha_e9_B1_B8: +_unwind___jsvml_cos1_ha_e9_B1_B8: DD 1603073 DD 2217078 DD 1730670 @@ -3293,7 +3293,7 @@ _unwind___svml_cos1_ha_e9_B1_B8: DD imagerel _B8_1 DD imagerel _B8_9 - DD imagerel _unwind___svml_cos1_ha_e9_B1_B8 + DD imagerel _unwind___jsvml_cos1_ha_e9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3307,9 +3307,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cos4_ha_e9 + PUBLIC __jsvml_cos4_ha_e9 -__svml_cos4_ha_e9 PROC EXPORT +__jsvml_cos4_ha_e9 PROC EXPORT _B9_1:: @@ -3338,17 +3338,17 @@ L313:: lea r13, QWORD PTR [79+rbp] vmovapd ymm13, ymm0 and r13, -64 - vandpd ymm5, ymm13, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16384] - vcmpnle_uqpd ymm15, ymm5, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16448] - vmovupd xmm14, XMMWORD PTR [__svml_dcos_ha_data_internal_ha+16704] + vandpd ymm5, ymm13, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16384] + vcmpnle_uqpd ymm15, ymm5, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16448] + vmovupd xmm14, XMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16704] vmovupd YMMWORD PTR [256+r13], ymm5 - vmovupd ymm6, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16640] - vmulpd ymm5, ymm13, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16576] + vmovupd ymm6, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16640] + vmulpd ymm5, ymm13, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16576] vaddpd ymm2, ymm6, ymm5 vsubpd ymm8, ymm2, ymm6 - vmulpd ymm9, ymm8, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16768] - vmulpd ymm3, ymm8, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16832] - vmulpd ymm7, ymm8, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16896] + vmulpd ymm9, ymm8, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16768] + vmulpd ymm3, ymm8, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16832] + vmulpd ymm7, ymm8, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16896] vsubpd ymm10, ymm13, ymm9 vsubpd ymm0, ymm10, ymm3 vsubpd ymm12, ymm10, ymm0 @@ -3365,20 +3365,20 @@ L313:: shl r9d, 5 vpextrd r10d, xmm10, 2 shl ecx, 5 - vmovq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] shl r10d, 5 - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r9] - vmovhpd xmm9, xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] - vmovq xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] - vmovhpd xmm3, xmm12, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r10] - vmovq xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r9] - vmovhpd xmm5, xmm14, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vmovq xmm8, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] - vmovhpd xmm7, xmm8, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r9] - vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r9] + vmovhpd xmm9, xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] + vmovhpd xmm3, xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r10] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r9] + vmovhpd xmm5, xmm14, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] + vmovhpd xmm7, xmm8, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r9] + vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r10] vinsertf128 ymm12, ymm9, xmm3, 1 - vmovhpd xmm9, xmm6, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r10] + vmovhpd xmm9, xmm6, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r10] vmulpd ymm14, ymm12, ymm0 vinsertf128 ymm10, ymm5, xmm9, 1 vmulpd ymm8, ymm10, ymm0 @@ -3390,9 +3390,9 @@ L313:: vaddpd ymm6, ymm8, ymm7 vmulpd ymm4, ymm0, ymm0 vaddpd ymm9, ymm14, ymm5 - vmovupd ymm5, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17024] + vmovupd ymm5, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17024] vaddpd ymm9, ymm6, ymm9 - vmovupd ymm6, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16960] + vmovupd ymm6, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16960] vmulpd ymm8, ymm5, ymm4 vaddpd ymm7, ymm6, ymm8 vmulpd ymm14, ymm4, ymm7 @@ -3401,22 +3401,22 @@ L313:: vmulpd ymm0, ymm2, ymm0 vmulpd ymm10, ymm8, ymm7 vsubpd ymm7, ymm7, ymm0 - vmovq xmm0, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] vaddpd ymm8, ymm9, ymm10 - vmovupd ymm9, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17216] - vmovupd ymm10, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17152] + vmovupd ymm9, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17216] + vmovupd ymm10, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17152] vmulpd ymm1, ymm1, ymm7 vmulpd ymm12, ymm9, ymm4 vaddpd ymm14, ymm10, ymm12 - vmovupd ymm12, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+17088] + vmovupd ymm12, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+17088] vmulpd ymm14, ymm4, ymm14 vaddpd ymm14, ymm12, ymm14 vmulpd ymm4, ymm4, ymm14 vmulpd ymm4, ymm2, ymm4 - vmovhpd xmm2, xmm0, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovhpd xmm2, xmm0, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vaddpd ymm8, ymm8, ymm4 - vmovq xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r9] - vmovhpd xmm14, xmm4, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r10] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r9] + vmovhpd xmm14, xmm4, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r10] vextractf128 xmm11, ymm15, 1 vshufps xmm11, xmm15, xmm11, 221 vmovmskps r11d, xmm11 @@ -3487,12 +3487,12 @@ _B9_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcos_ha_cout_rare_internal + call __jsvml_dcos_ha_cout_rare_internal jmp _B9_9 _B9_12:: - vmovupd ymm2, YMMWORD PTR [__svml_dcos_ha_data_internal_ha+16512] + vmovupd ymm2, YMMWORD PTR [__jsvml_dcos_ha_data_internal_ha+16512] vmovupd YMMWORD PTR [128+r13], ymm10 vmovdqu xmm10, XMMWORD PTR [_2il0floatpacket_34] vmovupd YMMWORD PTR [r13], ymm13 @@ -3526,26 +3526,26 @@ _B9_12:: lea r9d, DWORD PTR [r9+r9*2] shl r10d, 3 shl r9d, 3 - vmovq xmm1, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r11] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r11] lea ecx, DWORD PTR [r8+r8*2] - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r11] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r11] shl ecx, 3 - vmovhpd xmm9, xmm1, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r10] - vmovq xmm3, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+r9] + vmovhpd xmm9, xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+r9] vmovups XMMWORD PTR [368+rbp], xmm7 vpand xmm7, xmm15, xmm7 - vmovhpd xmm1, xmm11, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r10] + vmovhpd xmm1, xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r10] vpaddq xmm11, xmm13, xmm4 vpaddq xmm7, xmm7, xmm4 - vmovhpd xmm8, xmm3, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+rax+rcx] - vmovq xmm12, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r11] - vmovq xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r9] + vmovhpd xmm8, xmm3, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+rax+rcx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r11] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r9] vmovdqu xmm13, XMMWORD PTR [_2il0floatpacket_37] vmovupd XMMWORD PTR [400+rbp], xmm8 vpand xmm15, xmm9, xmm13 - vmovhpd xmm0, xmm12, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm0, xmm12, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+r10] vpand xmm14, xmm8, xmm13 - vmovhpd xmm10, xmm5, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+8+rax+rcx] + vmovhpd xmm10, xmm5, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+8+rax+rcx] vpand xmm8, xmm11, xmm13 vmovupd XMMWORD PTR [384+rbp], xmm9 vpsrlq xmm12, xmm0, 32 @@ -3556,10 +3556,10 @@ _B9_12:: vpsrlq xmm10, xmm7, 32 vpand xmm11, xmm7, xmm13 vpmuludq xmm7, xmm8, xmm15 - vmovq xmm2, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+r9] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+r9] vmovdqu XMMWORD PTR [432+rbp], xmm14 vpmuludq xmm14, xmm11, xmm14 - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dcos_ha_reduction_data_internal)+16+rax+rcx] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dcos_ha_reduction_data_internal)+16+rax+rcx] vpsrlq xmm2, xmm1, 32 vmovdqu XMMWORD PTR [480+rbp], xmm0 vpsrlq xmm4, xmm3, 32 @@ -3729,31 +3729,31 @@ _B9_12:: vaddpd ymm1, ymm11, ymm10 vaddpd ymm3, ymm15, ymm4 vaddpd ymm6, ymm1, ymm3 - vmovq xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r8] - vmovhpd xmm9, xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r8] + vmovhpd xmm9, xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+rcx] vaddpd ymm11, ymm5, ymm6 - vmovq xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r10] - vmovhpd xmm3, xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r11] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r10] + vmovhpd xmm3, xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r11] vandpd ymm14, ymm13, YMMWORD PTR [_2il0floatpacket_89] vsubpd ymm12, ymm5, ymm11 vcmpgt_oqpd ymm15, ymm14, ymm7 vcmple_oqpd ymm0, ymm14, ymm7 vaddpd ymm4, ymm6, ymm12 - vmovq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r10] - vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+rax+r11] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r10] + vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+rax+r11] vandpd ymm2, ymm0, ymm13 vandpd ymm10, ymm15, ymm11 vorpd ymm11, ymm2, ymm10 - vmovq xmm10, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+r8] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+r8] vandpd ymm0, ymm15, ymm4 - vmovhpd xmm4, xmm10, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+8+rax+rcx] - vmovq xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r8] + vmovhpd xmm4, xmm10, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r8] vinsertf128 ymm4, ymm4, xmm3, 1 vmulpd ymm5, ymm11, ymm4 vinsertf128 ymm15, ymm9, xmm8, 1 - vmovq xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r10] - vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm2, xmm9, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+16+rax+r11] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r10] + vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm2, xmm9, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+16+rax+r11] vmulpd ymm14, ymm11, ymm15 vinsertf128 ymm2, ymm8, xmm2, 1 vaddpd ymm12, ymm2, ymm5 @@ -3771,7 +3771,7 @@ _B9_12:: vaddpd ymm1, ymm8, YMMWORD PTR [128+r13] vmulpd ymm5, ymm10, ymm3 vmulpd ymm3, ymm10, ymm1 - vmovq xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r10] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r10] vmulpd ymm6, ymm11, ymm5 vaddpd ymm4, ymm3, YMMWORD PTR [160+r13] vmulpd ymm15, ymm6, ymm9 @@ -3779,11 +3779,11 @@ _B9_12:: vaddpd ymm5, ymm12, ymm15 vmulpd ymm6, ymm2, ymm10 vmulpd ymm2, ymm11, ymm2 - vmovq xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r8] - vmovhpd xmm11, xmm11, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r8] + vmovhpd xmm11, xmm11, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+rcx] vaddpd ymm8, ymm5, ymm6 vsubpd ymm3, ymm9, ymm2 - vmovhpd xmm2, xmm1, QWORD PTR [imagerel(__svml_dcos_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm2, xmm1, QWORD PTR [imagerel(__jsvml_dcos_ha_data_internal_ha)+24+rax+r11] vmulpd ymm0, ymm0, ymm3 vmovupd ymm3, YMMWORD PTR [192+r13] vinsertf128 ymm4, ymm11, xmm2, 1 @@ -3797,13 +3797,13 @@ _B9_12:: _B9_13:: -__svml_cos4_ha_e9 ENDP +__jsvml_cos4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos4_ha_e9_B1_B4: +_unwind___jsvml_cos4_ha_e9_B1_B4: DD 622489857 DD 7263345 DD 3500138 @@ -3826,19 +3826,19 @@ _unwind___svml_cos4_ha_e9_B1_B4: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_cos4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_cos4_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos4_ha_e9_B7_B11: +_unwind___jsvml_cos4_ha_e9_B7_B11: DD 621022241 DD 287756 DD 340998 DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_cos4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_cos4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3847,17 +3847,17 @@ _unwind___svml_cos4_ha_e9_B7_B11: DD imagerel _B9_7 DD imagerel _B9_12 - DD imagerel _unwind___svml_cos4_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_cos4_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cos4_ha_e9_B12_B12: +_unwind___jsvml_cos4_ha_e9_B12_B12: DD 620757025 DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_cos4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_cos4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3866,7 +3866,7 @@ _unwind___svml_cos4_ha_e9_B12_B12: DD imagerel _B9_12 DD imagerel _B9_13 - DD imagerel _unwind___svml_cos4_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_cos4_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3880,9 +3880,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dcos_ha_cout_rare_internal + PUBLIC __jsvml_dcos_ha_cout_rare_internal -__svml_dcos_ha_cout_rare_internal PROC +__jsvml_dcos_ha_cout_rare_internal PROC _B10_1:: @@ -3940,13 +3940,13 @@ _B10_6:: _B10_7:: -__svml_dcos_ha_cout_rare_internal ENDP +__jsvml_dcos_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dcos_ha_cout_rare_internal_B1_B6: +_unwind___jsvml_dcos_ha_cout_rare_internal_B1_B6: DD 67585 DD 16904 @@ -3957,7 +3957,7 @@ _unwind___svml_dcos_ha_cout_rare_internal_B1_B6: DD imagerel _B10_1 DD imagerel _B10_7 - DD imagerel _unwind___svml_dcos_ha_cout_rare_internal_B1_B6 + DD imagerel _unwind___jsvml_dcos_ha_cout_rare_internal_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3965,8 +3965,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dcos_ha_reduction_data_internal -__svml_dcos_ha_reduction_data_internal DD 0 + PUBLIC __jsvml_dcos_ha_reduction_data_internal +__jsvml_dcos_ha_reduction_data_internal DD 0 DD 0 DD 0 DD 0 @@ -16255,8 +16255,8 @@ __svml_dcos_ha_reduction_data_internal DD 0 DD 896803160 DD 3984508030 DD 128 DUP (0H) - PUBLIC __svml_dcos_ha_data_internal_ha -__svml_dcos_ha_data_internal_ha DD 0 + PUBLIC __jsvml_dcos_ha_data_internal_ha +__jsvml_dcos_ha_data_internal_ha DD 0 DD 0 DD 0 DD 0 @@ -20576,8 +20576,8 @@ __svml_dcos_ha_data_internal_ha DD 0 DD 3210133866 DD 2976101079 DD 3210133866 - PUBLIC __svml_dcos_ha_data_internal -__svml_dcos_ha_data_internal DD 4294967295 + PUBLIC __jsvml_dcos_ha_data_internal +__jsvml_dcos_ha_data_internal DD 4294967295 DD 2147483647 DD 4294967295 DD 2147483647 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_cosh_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cosh_windows_x86.S similarity index 80% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_cosh_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cosh_windows_x86.S index 6635c2b140e..3f94b113ff9 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_cosh_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_cosh_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh1_ha_e9 + PUBLIC __jsvml_cosh1_ha_e9 -__svml_cosh1_ha_e9 PROC EXPORT +__jsvml_cosh1_ha_e9 PROC EXPORT _B1_1:: @@ -61,20 +61,20 @@ L1:: vmovups XMMWORD PTR [176+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm5, QWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovsd xmm5, QWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 vandnpd xmm13, xmm5, xmm4 vmovd xmm5, eax - vmulsd xmm0, xmm13, QWORD PTR [__svml_dcosh_ha_data_internal+3968] - vmovsd xmm1, QWORD PTR [__svml_dcosh_ha_data_internal+4160] - vmovsd xmm11, QWORD PTR [__svml_dcosh_ha_data_internal+4032] + vmulsd xmm0, xmm13, QWORD PTR [__jsvml_dcosh_ha_data_internal+3968] + vmovsd xmm1, QWORD PTR [__jsvml_dcosh_ha_data_internal+4160] + vmovsd xmm11, QWORD PTR [__jsvml_dcosh_ha_data_internal+4032] vaddsd xmm0, xmm0, xmm1 vpshufd xmm15, xmm13, 85 vsubsd xmm1, xmm0, xmm1 vmulsd xmm11, xmm11, xmm1 vpcmpgtd xmm6, xmm15, xmm5 vmovmskps eax, xmm6 - vmovsd xmm12, QWORD PTR [__svml_dcosh_ha_data_internal+4096] + vmovsd xmm12, QWORD PTR [__jsvml_dcosh_ha_data_internal+4096] vmovd xmm5, edx vpshufd xmm15, xmm0, 0 vpsllq xmm0, xmm0, 45 @@ -86,21 +86,21 @@ L1:: vpaddd xmm5, xmm6, xmm15 vpslld xmm6, xmm5, 3 vmovd ecx, xmm6 - vmovq xmm12, QWORD PTR [__svml_dcosh_ha_data_internal+4608] + vmovq xmm12, QWORD PTR [__jsvml_dcosh_ha_data_internal+4608] vpand xmm11, xmm0, xmm12 - vmovq xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rcx] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rcx] vpsubq xmm12, xmm6, xmm11 vmulsd xmm6, xmm1, xmm1 - vmovsd xmm2, QWORD PTR [__svml_dcosh_ha_data_internal+4544] + vmovsd xmm2, QWORD PTR [__jsvml_dcosh_ha_data_internal+4544] vmulsd xmm2, xmm2, xmm6 - vmovsd xmm3, QWORD PTR [__svml_dcosh_ha_data_internal+4480] + vmovsd xmm3, QWORD PTR [__jsvml_dcosh_ha_data_internal+4480] vmulsd xmm3, xmm3, xmm6 - vaddsd xmm2, xmm2, QWORD PTR [__svml_dcosh_ha_data_internal+4416] - vmovq xmm15, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rcx] + vaddsd xmm2, xmm2, QWORD PTR [__jsvml_dcosh_ha_data_internal+4416] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rcx] vpaddq xmm0, xmm15, xmm11 vpaddq xmm13, xmm5, xmm11 - vaddsd xmm11, xmm3, QWORD PTR [__svml_dcosh_ha_data_internal+4352] + vaddsd xmm11, xmm3, QWORD PTR [__jsvml_dcosh_ha_data_internal+4352] vmulsd xmm3, xmm2, xmm6 vaddsd xmm5, xmm0, xmm12 vsubsd xmm15, xmm0, xmm12 @@ -144,19 +144,19 @@ _B1_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B1_4 ALIGN 16 _B1_7:: -__svml_cosh1_ha_e9 ENDP +__jsvml_cosh1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh1_ha_e9_B1_B6: +_unwind___jsvml_cosh1_ha_e9_B1_B6: DD 939265 DD 1430613 DD 747597 @@ -173,7 +173,7 @@ _unwind___svml_cosh1_ha_e9_B1_B6: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_cosh1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_cosh1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -187,9 +187,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh4_ha_l9 + PUBLIC __jsvml_cosh4_ha_l9 -__svml_cosh4_ha_l9 PROC EXPORT +__jsvml_cosh4_ha_l9 PROC EXPORT _B2_1:: @@ -208,54 +208,54 @@ L14:: vmovups YMMWORD PTR [368+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovupd ymm3, YMMWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovupd ymm3, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 - vmovupd ymm8, YMMWORD PTR [__svml_dcosh_ha_data_internal+3968] - vmovupd ymm4, YMMWORD PTR [__svml_dcosh_ha_data_internal+4160] - vmovupd ymm1, YMMWORD PTR [__svml_dcosh_ha_data_internal+4544] + vmovupd ymm8, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+3968] + vmovupd ymm4, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4160] + vmovupd ymm1, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4544] vmovapd ymm2, ymm0 vandnpd ymm3, ymm3, ymm2 vfmadd213pd ymm8, ymm3, ymm4 - vmovupd ymm0, YMMWORD PTR [__svml_dcosh_ha_data_internal+4480] + vmovupd ymm0, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4480] mov QWORD PTR [536+rsp], r13 vextracti128 xmm5, ymm3, 1 vshufps xmm9, xmm3, xmm5, 221 - vpcmpgtd xmm5, xmm9, XMMWORD PTR [__svml_dcosh_ha_data_internal+4736] + vpcmpgtd xmm5, xmm9, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4736] vmovmskps r8d, xmm5 vextracti128 xmm6, ymm8, 1 vsubpd ymm4, ymm8, ymm4 vshufps xmm15, xmm8, xmm6, 136 - vpand xmm9, xmm15, XMMWORD PTR [__svml_dcosh_ha_data_internal+4224] + vpand xmm9, xmm15, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4224] vpslld xmm10, xmm9, 1 vpaddd xmm5, xmm10, xmm9 vpslld xmm10, xmm5, 3 - vfnmadd231pd ymm3, ymm4, YMMWORD PTR [__svml_dcosh_ha_data_internal+4032] + vfnmadd231pd ymm3, ymm4, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4032] vpsllq ymm8, ymm8, 45 vmovd ecx, xmm10 - vfnmadd231pd ymm3, ymm4, YMMWORD PTR [__svml_dcosh_ha_data_internal+4096] - vmovq xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+rcx] - vpand ymm4, ymm8, YMMWORD PTR [__svml_dcosh_ha_data_internal+4608] + vfnmadd231pd ymm3, ymm4, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4096] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+rcx] + vpand ymm4, ymm8, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4608] vpextrd r9d, xmm10, 2 vpextrd eax, xmm10, 1 vpextrd r10d, xmm10, 3 - vmovq xmm9, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+r9] - vmovhpd xmm15, xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+rax] - vmovhpd xmm5, xmm9, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+r10] - vmovq xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+rcx] - vmovhpd xmm10, xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+rax] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+r9] + vmovhpd xmm15, xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+rax] + vmovhpd xmm5, xmm9, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+r10] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+rcx] + vmovhpd xmm10, xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+rax] vinsertf128 ymm9, ymm15, xmm5, 1 - vmovq xmm5, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+r9] - vmovhpd xmm6, xmm5, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+r10] - vmovq xmm5, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+r9] + vmovhpd xmm6, xmm5, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+rcx] vpaddq ymm9, ymm9, ymm4 vinsertf128 ymm15, ymm10, xmm6, 1 vpaddq ymm8, ymm15, ymm4 - vmovq xmm10, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+r9] - vmovhpd xmm6, xmm5, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+rax] - vmovhpd xmm5, xmm10, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+r10] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+r9] + vmovhpd xmm6, xmm5, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+rax] + vmovhpd xmm5, xmm10, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+r10] vmulpd ymm15, ymm3, ymm3 - vfmadd213pd ymm1, ymm15, YMMWORD PTR [__svml_dcosh_ha_data_internal+4416] - vfmadd213pd ymm0, ymm15, YMMWORD PTR [__svml_dcosh_ha_data_internal+4352] + vfmadd213pd ymm1, ymm15, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4416] + vfmadd213pd ymm0, ymm15, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4352] vinsertf128 ymm10, ymm6, xmm5, 1 vpsubq ymm6, ymm10, ymm4 vmulpd ymm10, ymm15, ymm1 @@ -328,19 +328,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_cosh4_ha_l9 ENDP +__jsvml_cosh4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh4_ha_l9_B1_B3: +_unwind___jsvml_cosh4_ha_l9_B1_B3: DD 935681 DD 4379719 DD 1534015 @@ -357,13 +357,13 @@ _unwind___svml_cosh4_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cosh4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosh4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh4_ha_l9_B6_B10: +_unwind___jsvml_cosh4_ha_l9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -374,7 +374,7 @@ _unwind___svml_cosh4_ha_l9_B6_B10: DD 686091 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cosh4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosh4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -383,7 +383,7 @@ _unwind___svml_cosh4_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_cosh4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cosh4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -397,9 +397,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh8_ha_z0 + PUBLIC __jsvml_cosh8_ha_z0 -__svml_cosh8_ha_z0 PROC EXPORT +__jsvml_cosh8_ha_z0 PROC EXPORT _B3_1:: @@ -412,34 +412,34 @@ L41:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm26, ZMMWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovups zmm26, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 - vmovups zmm22, ZMMWORD PTR [__svml_dcosh_ha_data_internal+3968] - vmovups zmm3, ZMMWORD PTR [__svml_dcosh_ha_data_internal+384] - vmovups zmm4, ZMMWORD PTR [__svml_dcosh_ha_data_internal+4032] - vmovups zmm2, ZMMWORD PTR [__svml_dcosh_ha_data_internal+4096] - vmovups zmm31, ZMMWORD PTR [__svml_dcosh_ha_data_internal+640] - vmovups zmm30, ZMMWORD PTR [__svml_dcosh_ha_data_internal+704] - vmovups zmm28, ZMMWORD PTR [__svml_dcosh_ha_data_internal+768] - vmovups zmm27, ZMMWORD PTR [__svml_dcosh_ha_data_internal+832] - vmovups zmm25, ZMMWORD PTR [__svml_dcosh_ha_data_internal+512] - vmovups zmm24, ZMMWORD PTR [__svml_dcosh_ha_data_internal+576] - vmovups zmm5, ZMMWORD PTR [__svml_dcosh_ha_data_internal+128] + vmovups zmm22, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+3968] + vmovups zmm3, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+384] + vmovups zmm4, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+4032] + vmovups zmm2, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+4096] + vmovups zmm31, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+640] + vmovups zmm30, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+704] + vmovups zmm28, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+768] + vmovups zmm27, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+832] + vmovups zmm25, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+512] + vmovups zmm24, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+576] + vmovups zmm5, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+128] vmovaps zmm29, zmm0 vandnpd zmm26, zmm26, zmm29 vpsrlq zmm23, zmm26, 32 vfmadd213pd zmm22, zmm26, zmm3 {rn-sae} vpmovqd ymm0, zmm23 - vmovups zmm23, ZMMWORD PTR [__svml_dcosh_ha_data_internal+256] - vpermt2pd zmm5, zmm22, ZMMWORD PTR [__svml_dcosh_ha_data_internal+192] - vpermt2pd zmm23, zmm22, ZMMWORD PTR [__svml_dcosh_ha_data_internal+320] - vpcmpgtd ymm1, ymm0, YMMWORD PTR [__svml_dcosh_ha_data_internal+4736] + vmovups zmm23, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+256] + vpermt2pd zmm5, zmm22, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+192] + vpermt2pd zmm23, zmm22, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+320] + vpcmpgtd ymm1, ymm0, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4736] vmovmskps r8d, ymm1 vsubpd zmm1, zmm22, zmm3 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dcosh_ha_data_internal] + vmovups zmm0, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal] vpsllq zmm3, zmm22, 48 vfnmadd231pd zmm26, zmm1, zmm4 {rn-sae} - vpermt2pd zmm0, zmm22, ZMMWORD PTR [__svml_dcosh_ha_data_internal+64] + vpermt2pd zmm0, zmm22, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+64] vfnmadd231pd zmm26, zmm1, zmm2 {rn-sae} vmulpd zmm2, zmm26, zmm26 {rn-sae} vfmadd231pd zmm30, zmm27, zmm2 {rn-sae} @@ -450,7 +450,7 @@ L41:: vmulpd zmm24, zmm31, zmm2 {rn-sae} vfmadd213pd zmm25, zmm26, zmm26 {rn-sae} mov QWORD PTR [1328+rsp], r13 - vpandq zmm4, zmm3, ZMMWORD PTR [__svml_dcosh_ha_data_internal+4608] + vpandq zmm4, zmm3, ZMMWORD PTR [__jsvml_dcosh_ha_data_internal+4608] vpaddq zmm22, zmm0, zmm4 vpsubq zmm3, zmm23, zmm4 vpaddq zmm5, zmm5, zmm4 @@ -591,19 +591,19 @@ _B3_15:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B3_13 ALIGN 16 _B3_16:: -__svml_cosh8_ha_z0 ENDP +__jsvml_cosh8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh8_ha_z0_B1_B9: +_unwind___jsvml_cosh8_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -615,13 +615,13 @@ _unwind___svml_cosh8_ha_z0_B1_B9: DD imagerel _B3_1 DD imagerel _B3_11 - DD imagerel _unwind___svml_cosh8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_cosh8_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh8_ha_z0_B11_B15: +_unwind___jsvml_cosh8_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -657,7 +657,7 @@ _unwind___svml_cosh8_ha_z0_B11_B15: DD imagerel _B3_11 DD imagerel _B3_16 - DD imagerel _unwind___svml_cosh8_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_cosh8_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -671,9 +671,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh2_ha_l9 + PUBLIC __jsvml_cosh2_ha_l9 -__svml_cosh2_ha_l9 PROC EXPORT +__jsvml_cosh2_ha_l9 PROC EXPORT _B4_1:: @@ -692,43 +692,43 @@ L92:: vmovups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm1, XMMWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovupd xmm1, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 - vmovupd xmm11, XMMWORD PTR [__svml_dcosh_ha_data_internal+3968] + vmovupd xmm11, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+3968] vandnpd xmm1, xmm1, xmm3 - vmovupd xmm9, XMMWORD PTR [__svml_dcosh_ha_data_internal+4160] + vmovupd xmm9, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4160] vfmadd213pd xmm11, xmm1, xmm9 - vmovq xmm0, QWORD PTR [__svml_dcosh_ha_data_internal+4736] + vmovq xmm0, QWORD PTR [__jsvml_dcosh_ha_data_internal+4736] vpshufd xmm2, xmm1, 221 - vmovq xmm8, QWORD PTR [__svml_dcosh_ha_data_internal+4224] + vmovq xmm8, QWORD PTR [__jsvml_dcosh_ha_data_internal+4224] vpcmpgtd xmm2, xmm2, xmm0 - vmovupd xmm5, XMMWORD PTR [__svml_dcosh_ha_data_internal+4480] + vmovupd xmm5, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4480] vsubpd xmm9, xmm11, xmm9 vmovmskps edx, xmm2 vpshufd xmm6, xmm11, 136 vpsllq xmm11, xmm11, 45 vpand xmm2, xmm6, xmm8 - vfnmadd231pd xmm1, xmm9, XMMWORD PTR [__svml_dcosh_ha_data_internal+4032] + vfnmadd231pd xmm1, xmm9, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4032] vpslld xmm8, xmm2, 1 vpaddd xmm0, xmm8, xmm2 vpslld xmm8, xmm0, 3 vmovd eax, xmm8 - vmovupd xmm4, XMMWORD PTR [__svml_dcosh_ha_data_internal+4544] - vfnmadd231pd xmm1, xmm9, XMMWORD PTR [__svml_dcosh_ha_data_internal+4096] - vmovq xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rax] - vmovq xmm0, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rax] + vmovupd xmm4, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4544] + vfnmadd231pd xmm1, xmm9, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4096] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rax] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rax] vpextrd ecx, xmm8, 1 - vmovq xmm8, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rax] - vmovhpd xmm2, xmm6, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rcx] - vmovhpd xmm6, xmm8, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rcx] - vpand xmm8, xmm11, XMMWORD PTR [__svml_dcosh_ha_data_internal+4608] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rax] + vmovhpd xmm2, xmm6, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rcx] + vmovhpd xmm6, xmm8, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rcx] + vpand xmm8, xmm11, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4608] vpsubq xmm11, xmm6, xmm8 vpaddq xmm2, xmm2, xmm8 vmulpd xmm6, xmm1, xmm1 vsubpd xmm9, xmm2, xmm11 - vfmadd213pd xmm4, xmm6, XMMWORD PTR [__svml_dcosh_ha_data_internal+4416] - vfmadd213pd xmm5, xmm6, XMMWORD PTR [__svml_dcosh_ha_data_internal+4352] - vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rcx] + vfmadd213pd xmm4, xmm6, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4416] + vfmadd213pd xmm5, xmm6, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4352] + vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rcx] vpaddq xmm0, xmm0, xmm8 vmulpd xmm4, xmm6, xmm4 vmulpd xmm5, xmm6, xmm5 @@ -789,19 +789,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_cosh2_ha_l9 ENDP +__jsvml_cosh2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh2_ha_l9_B1_B3: +_unwind___jsvml_cosh2_ha_l9_B1_B3: DD 803329 DD 2151490 DD 944186 @@ -817,19 +817,19 @@ _unwind___svml_cosh2_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_cosh2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosh2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh2_ha_l9_B6_B10: +_unwind___jsvml_cosh2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_cosh2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosh2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -838,7 +838,7 @@ _unwind___svml_cosh2_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_cosh2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cosh2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -852,9 +852,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh1_ha_l9 + PUBLIC __jsvml_cosh1_ha_l9 -__svml_cosh1_ha_l9 PROC EXPORT +__jsvml_cosh1_ha_l9 PROC EXPORT _B5_1:: @@ -877,17 +877,17 @@ L107:: vmovd xmm0, eax mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm1, QWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovsd xmm1, QWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 vandnpd xmm6, xmm1, xmm4 - vmovsd xmm9, QWORD PTR [__svml_dcosh_ha_data_internal+4160] + vmovsd xmm9, QWORD PTR [__jsvml_dcosh_ha_data_internal+4160] vmovapd xmm14, xmm6 - vfmadd132sd xmm14, xmm9, QWORD PTR [__svml_dcosh_ha_data_internal+3968] + vfmadd132sd xmm14, xmm9, QWORD PTR [__jsvml_dcosh_ha_data_internal+3968] vpshufd xmm15, xmm6, 85 - vmovsd xmm10, QWORD PTR [__svml_dcosh_ha_data_internal+4032] + vmovsd xmm10, QWORD PTR [__jsvml_dcosh_ha_data_internal+4032] vpcmpgtd xmm1, xmm15, xmm0 vmovd xmm0, edx - vmovsd xmm5, QWORD PTR [__svml_dcosh_ha_data_internal+4096] + vmovsd xmm5, QWORD PTR [__jsvml_dcosh_ha_data_internal+4096] vpshufd xmm15, xmm14, 0 vsubsd xmm9, xmm14, xmm9 vmovmskps eax, xmm1 @@ -898,18 +898,18 @@ L107:: vpaddd xmm0, xmm1, xmm15 vpslld xmm1, xmm0, 3 vmovd ecx, xmm1 - vmovq xmm6, QWORD PTR [__svml_dcosh_ha_data_internal+4608] - vmovsd xmm2, QWORD PTR [__svml_dcosh_ha_data_internal+4544] + vmovq xmm6, QWORD PTR [__jsvml_dcosh_ha_data_internal+4608] + vmovsd xmm2, QWORD PTR [__jsvml_dcosh_ha_data_internal+4544] vfnmadd213sd xmm5, xmm9, xmm10 vpand xmm10, xmm14, xmm6 - vmovq xmm0, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rcx] vpaddq xmm14, xmm0, xmm10 - vmovsd xmm3, QWORD PTR [__svml_dcosh_ha_data_internal+4480] + vmovsd xmm3, QWORD PTR [__jsvml_dcosh_ha_data_internal+4480] vmulsd xmm0, xmm5, xmm5 - vfmadd213sd xmm2, xmm0, QWORD PTR [__svml_dcosh_ha_data_internal+4416] - vfmadd213sd xmm3, xmm0, QWORD PTR [__svml_dcosh_ha_data_internal+4352] - vmovq xmm15, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rcx] + vfmadd213sd xmm2, xmm0, QWORD PTR [__jsvml_dcosh_ha_data_internal+4416] + vfmadd213sd xmm3, xmm0, QWORD PTR [__jsvml_dcosh_ha_data_internal+4352] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rcx] vpaddq xmm15, xmm15, xmm10 vpsubq xmm10, xmm1, xmm10 vmulsd xmm2, xmm2, xmm0 @@ -952,19 +952,19 @@ _B5_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B5_4 ALIGN 16 _B5_7:: -__svml_cosh1_ha_l9 ENDP +__jsvml_cosh1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh1_ha_l9_B1_B6: +_unwind___jsvml_cosh1_ha_l9_B1_B6: DD 940289 DD 1430617 DD 747597 @@ -981,7 +981,7 @@ _unwind___svml_cosh1_ha_l9_B1_B6: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_cosh1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_cosh1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -995,9 +995,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh4_ha_e9 + PUBLIC __jsvml_cosh4_ha_e9 -__svml_cosh4_ha_e9 PROC EXPORT +__jsvml_cosh4_ha_e9 PROC EXPORT _B6_1:: @@ -1017,47 +1017,47 @@ L120:: vmovups YMMWORD PTR [496+rsp], ymm10 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm2, YMMWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovupd ymm2, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 - vmovupd ymm15, YMMWORD PTR [__svml_dcosh_ha_data_internal+4160] + vmovupd ymm15, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4160] vmovapd ymm5, ymm0 vandnpd ymm10, ymm2, ymm5 - vmulpd ymm4, ymm10, YMMWORD PTR [__svml_dcosh_ha_data_internal+3968] + vmulpd ymm4, ymm10, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+3968] vaddpd ymm11, ymm15, ymm4 mov QWORD PTR [536+rsp], r13 vextractf128 xmm12, ymm11, 1 vshufps xmm13, xmm11, xmm12, 136 vpsllq xmm12, xmm12, 45 - vpand xmm4, xmm13, XMMWORD PTR [__svml_dcosh_ha_data_internal+4224] + vpand xmm4, xmm13, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4224] vpslld xmm2, xmm4, 1 vextractf128 xmm1, ymm10, 1 vshufps xmm3, xmm10, xmm1, 221 vpaddd xmm1, xmm2, xmm4 vpslld xmm0, xmm1, 3 vmovd ecx, xmm0 - vpcmpgtd xmm14, xmm3, XMMWORD PTR [__svml_dcosh_ha_data_internal+4736] + vpcmpgtd xmm14, xmm3, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4736] vmovmskps r8d, xmm14 - vmovq xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+rcx] - vmovq xmm3, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+rcx] vpextrd eax, xmm0, 1 vpextrd r9d, xmm0, 2 vpextrd r10d, xmm0, 3 - vmovhpd xmm0, xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+rax] - vmovq xmm4, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+r9] - vmovq xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+r9] - vmovhpd xmm1, xmm4, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+rdx+r10] - vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+r10] + vmovhpd xmm0, xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+rax] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+r9] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+r9] + vmovhpd xmm1, xmm4, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+rdx+r10] + vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+r10] vsubpd ymm2, ymm11, ymm15 vpsllq xmm11, xmm11, 45 - vmovq xmm14, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+r9] - vmovhpd xmm13, xmm3, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+rax] - vmulpd ymm15, ymm2, YMMWORD PTR [__svml_dcosh_ha_data_internal+4032] - vmulpd ymm2, ymm2, YMMWORD PTR [__svml_dcosh_ha_data_internal+4096] - vmovhpd xmm14, xmm14, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+rdx+r10] - vmovq xmm3, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+rcx] - vmovhpd xmm3, xmm3, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+rdx+rax] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+r9] + vmovhpd xmm13, xmm3, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+rax] + vmulpd ymm15, ymm2, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4032] + vmulpd ymm2, ymm2, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4096] + vmovhpd xmm14, xmm14, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+rdx+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+rcx] + vmovhpd xmm3, xmm3, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+rdx+rax] vsubpd ymm15, ymm10, ymm15 - vmovupd xmm10, XMMWORD PTR [__svml_dcosh_ha_data_internal+4608] + vmovupd xmm10, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4608] vpand xmm12, xmm12, xmm10 vsubpd ymm2, ymm15, ymm2 vpand xmm15, xmm11, xmm10 @@ -1067,13 +1067,13 @@ L120:: vpaddq xmm14, xmm14, xmm12 vinsertf128 ymm1, ymm0, xmm10, 1 vmulpd ymm0, ymm2, ymm2 - vmulpd ymm11, ymm0, YMMWORD PTR [__svml_dcosh_ha_data_internal+4480] - vaddpd ymm10, ymm11, YMMWORD PTR [__svml_dcosh_ha_data_internal+4352] + vmulpd ymm11, ymm0, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4480] + vaddpd ymm10, ymm11, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4352] vinsertf128 ymm14, ymm13, xmm14, 1 vpsubq xmm13, xmm3, xmm15 vpsubq xmm15, xmm4, xmm12 - vmulpd ymm4, ymm0, YMMWORD PTR [__svml_dcosh_ha_data_internal+4544] - vaddpd ymm12, ymm4, YMMWORD PTR [__svml_dcosh_ha_data_internal+4416] + vmulpd ymm4, ymm0, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4544] + vaddpd ymm12, ymm4, YMMWORD PTR [__jsvml_dcosh_ha_data_internal+4416] vmulpd ymm4, ymm0, ymm12 vmulpd ymm0, ymm0, ymm10 vinsertf128 ymm13, ymm13, xmm15, 1 @@ -1147,19 +1147,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_cosh4_ha_e9 ENDP +__jsvml_cosh4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh4_ha_e9_B1_B3: +_unwind___jsvml_cosh4_ha_e9_B1_B3: DD 1069057 DD 4379728 DD 2074696 @@ -1177,13 +1177,13 @@ _unwind___svml_cosh4_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_cosh4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosh4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh4_ha_e9_B6_B10: +_unwind___jsvml_cosh4_ha_e9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -1193,7 +1193,7 @@ _unwind___svml_cosh4_ha_e9_B6_B10: DD 550923 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_cosh4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosh4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1202,7 +1202,7 @@ _unwind___svml_cosh4_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_cosh4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cosh4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1216,9 +1216,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh1_ha_ex + PUBLIC __jsvml_cosh1_ha_ex -__svml_cosh1_ha_ex PROC EXPORT +__jsvml_cosh1_ha_ex PROC EXPORT _B7_1:: @@ -1243,22 +1243,22 @@ L147:: movups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm8, QWORD PTR [__svml_dcosh_ha_data_internal+4672] + movsd xmm8, QWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 andnps xmm8, xmm10 movaps xmm6, xmm8 - mulsd xmm6, QWORD PTR [__svml_dcosh_ha_data_internal+3968] - movsd xmm9, QWORD PTR [__svml_dcosh_ha_data_internal+4160] - movsd xmm5, QWORD PTR [__svml_dcosh_ha_data_internal+4032] + mulsd xmm6, QWORD PTR [__jsvml_dcosh_ha_data_internal+3968] + movsd xmm9, QWORD PTR [__jsvml_dcosh_ha_data_internal+4160] + movsd xmm5, QWORD PTR [__jsvml_dcosh_ha_data_internal+4032] addsd xmm6, xmm9 movaps xmm11, xmm6 - movsd xmm4, QWORD PTR [__svml_dcosh_ha_data_internal+4096] + movsd xmm4, QWORD PTR [__jsvml_dcosh_ha_data_internal+4096] subsd xmm11, xmm9 mulsd xmm5, xmm11 mulsd xmm4, xmm11 pshufd xmm2, xmm8, 85 subsd xmm8, xmm5 - movsd xmm0, QWORD PTR [__svml_dcosh_ha_data_internal+4544] + movsd xmm0, QWORD PTR [__jsvml_dcosh_ha_data_internal+4544] pcmpgtd xmm2, xmm1 pshufd xmm1, xmm6, 0 psllq xmm6, 45 @@ -1271,17 +1271,17 @@ L147:: pslld xmm2, 1 mulsd xmm0, xmm5 paddd xmm2, xmm1 - movsd xmm7, QWORD PTR [__svml_dcosh_ha_data_internal+4480] + movsd xmm7, QWORD PTR [__jsvml_dcosh_ha_data_internal+4480] pslld xmm2, 3 mulsd xmm7, xmm5 - addsd xmm0, QWORD PTR [__svml_dcosh_ha_data_internal+4416] + addsd xmm0, QWORD PTR [__jsvml_dcosh_ha_data_internal+4416] movd ecx, xmm2 - movq xmm4, QWORD PTR [__svml_dcosh_ha_data_internal+4608] + movq xmm4, QWORD PTR [__jsvml_dcosh_ha_data_internal+4608] mulsd xmm0, xmm5 - addsd xmm7, QWORD PTR [__svml_dcosh_ha_data_internal+4352] - movq xmm1, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rcx] + addsd xmm7, QWORD PTR [__jsvml_dcosh_ha_data_internal+4352] + movq xmm1, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rcx] pand xmm6, xmm4 - movq xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rcx] + movq xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rcx] and eax, 1 paddq xmm1, xmm6 psubq xmm2, xmm6 @@ -1290,7 +1290,7 @@ L147:: movdqa xmm4, xmm1 addsd xmm0, xmm8 addsd xmm4, xmm2 - movq xmm3, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rcx] paddq xmm3, xmm6 mulsd xmm7, xmm4 movdqa xmm6, xmm1 @@ -1331,19 +1331,19 @@ _B7_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B7_4 ALIGN 16 _B7_7:: -__svml_cosh1_ha_ex ENDP +__jsvml_cosh1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh1_ha_ex_B1_B6: +_unwind___jsvml_cosh1_ha_ex_B1_B6: DD 1074177 DD 1430628 DD 1075292 @@ -1361,7 +1361,7 @@ _unwind___svml_cosh1_ha_ex_B1_B6: DD imagerel _B7_1 DD imagerel _B7_7 - DD imagerel _unwind___svml_cosh1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_cosh1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1375,9 +1375,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh2_ha_ex + PUBLIC __jsvml_cosh2_ha_ex -__svml_cosh2_ha_ex PROC EXPORT +__jsvml_cosh2_ha_ex PROC EXPORT _B8_1:: @@ -1398,15 +1398,15 @@ L162:: movups XMMWORD PTR [192+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm10, XMMWORD PTR [__svml_dcosh_ha_data_internal+4672] + movups xmm10, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 - movups xmm6, XMMWORD PTR [__svml_dcosh_ha_data_internal+3968] + movups xmm6, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+3968] andnps xmm10, xmm12 mulpd xmm6, xmm10 - movups xmm11, XMMWORD PTR [__svml_dcosh_ha_data_internal+4160] + movups xmm11, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4160] addpd xmm6, xmm11 - movq xmm2, QWORD PTR [__svml_dcosh_ha_data_internal+4224] - movq xmm0, QWORD PTR [__svml_dcosh_ha_data_internal+4736] + movq xmm2, QWORD PTR [__jsvml_dcosh_ha_data_internal+4224] + movq xmm0, QWORD PTR [__jsvml_dcosh_ha_data_internal+4736] pshufd xmm1, xmm10, 221 pshufd xmm13, xmm6, 136 pcmpgtd xmm1, xmm0 @@ -1417,13 +1417,13 @@ L162:: paddd xmm1, xmm13 movaps xmm13, xmm6 subpd xmm13, xmm11 - movups xmm4, XMMWORD PTR [__svml_dcosh_ha_data_internal+4032] + movups xmm4, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4032] pslld xmm1, 3 mulpd xmm4, xmm13 movd edx, xmm1 - movups xmm3, XMMWORD PTR [__svml_dcosh_ha_data_internal+4096] + movups xmm3, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4096] psllq xmm6, 45 - movups xmm9, XMMWORD PTR [__svml_dcosh_ha_data_internal+4544] + movups xmm9, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4544] mulpd xmm3, xmm13 subpd xmm10, xmm4 subpd xmm10, xmm3 @@ -1431,27 +1431,27 @@ L162:: and eax, 3 mulpd xmm3, xmm10 mulpd xmm9, xmm3 - movups xmm5, XMMWORD PTR [__svml_dcosh_ha_data_internal+4480] - addpd xmm9, XMMWORD PTR [__svml_dcosh_ha_data_internal+4416] + movups xmm5, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4480] + addpd xmm9, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4416] mulpd xmm5, xmm3 mulpd xmm9, xmm3 - addpd xmm5, XMMWORD PTR [__svml_dcosh_ha_data_internal+4352] + addpd xmm5, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4352] mulpd xmm9, xmm10 mulpd xmm3, xmm5 addpd xmm10, xmm9 pshufd xmm2, xmm1, 1 movd ecx, xmm2 - movq xmm0, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rdx] - movq xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rdx] - movhpd xmm0, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rcx] - pand xmm6, XMMWORD PTR [__svml_dcosh_ha_data_internal+4608] - movhpd xmm2, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rcx] + movq xmm0, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rdx] + movq xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rdx] + movhpd xmm0, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rcx] + pand xmm6, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4608] + movhpd xmm2, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rcx] paddq xmm0, xmm6 psubq xmm2, xmm6 movaps xmm4, xmm0 addpd xmm4, xmm2 - movq xmm1, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rdx] - movhpd xmm1, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rcx] + movq xmm1, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rdx] + movhpd xmm1, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rcx] paddq xmm1, xmm6 mulpd xmm4, xmm3 movaps xmm6, xmm0 @@ -1516,19 +1516,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_cosh2_ha_ex ENDP +__jsvml_cosh2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh2_ha_ex_B1_B3: +_unwind___jsvml_cosh2_ha_ex_B1_B3: DD 1069825 DD 2413651 DD 813131 @@ -1546,19 +1546,19 @@ _unwind___svml_cosh2_ha_ex_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_cosh2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cosh2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh2_ha_ex_B6_B10: +_unwind___jsvml_cosh2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_cosh2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cosh2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1567,7 +1567,7 @@ _unwind___svml_cosh2_ha_ex_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_cosh2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_cosh2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1581,9 +1581,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosh2_ha_e9 + PUBLIC __jsvml_cosh2_ha_e9 -__svml_cosh2_ha_e9 PROC EXPORT +__jsvml_cosh2_ha_e9 PROC EXPORT _B9_1:: @@ -1602,48 +1602,48 @@ L181:: vmovapd xmm11, xmm0 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm5, XMMWORD PTR [__svml_dcosh_ha_data_internal+4672] + vmovupd xmm5, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4672] and r13, -64 vandnpd xmm0, xmm5, xmm11 - vmulpd xmm4, xmm0, XMMWORD PTR [__svml_dcosh_ha_data_internal+3968] - vmovupd xmm3, XMMWORD PTR [__svml_dcosh_ha_data_internal+4160] + vmulpd xmm4, xmm0, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+3968] + vmovupd xmm3, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4160] vaddpd xmm12, xmm3, xmm4 - vmovq xmm1, QWORD PTR [__svml_dcosh_ha_data_internal+4224] + vmovq xmm1, QWORD PTR [__jsvml_dcosh_ha_data_internal+4224] vpshufd xmm5, xmm12, 136 vpand xmm5, xmm5, xmm1 vpslld xmm1, xmm5, 1 - vmovq xmm14, QWORD PTR [__svml_dcosh_ha_data_internal+4736] + vmovq xmm14, QWORD PTR [__jsvml_dcosh_ha_data_internal+4736] vpaddd xmm4, xmm1, xmm5 vpshufd xmm2, xmm0, 221 vpcmpgtd xmm13, xmm2, xmm14 vpslld xmm2, xmm4, 3 vmovd eax, xmm2 vmovmskps edx, xmm13 - vmovq xmm1, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rax] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rax] vpextrd ecx, xmm2, 1 - vmovhpd xmm5, xmm1, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+896+r8+rcx] + vmovhpd xmm5, xmm1, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+896+r8+rcx] vsubpd xmm1, xmm12, xmm3 - vmulpd xmm3, xmm1, XMMWORD PTR [__svml_dcosh_ha_data_internal+4032] - vmovq xmm14, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rax] + vmulpd xmm3, xmm1, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4032] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rax] vpsllq xmm12, xmm12, 45 - vmovhpd xmm2, xmm14, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+904+r8+rcx] + vmovhpd xmm2, xmm14, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+904+r8+rcx] vsubpd xmm14, xmm0, xmm3 - vmulpd xmm0, xmm1, XMMWORD PTR [__svml_dcosh_ha_data_internal+4096] + vmulpd xmm0, xmm1, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4096] vsubpd xmm1, xmm14, xmm0 - vmovq xmm13, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rax] - vmovhpd xmm4, xmm13, QWORD PTR [imagerel(__svml_dcosh_ha_data_internal)+912+r8+rcx] - vpand xmm3, xmm12, XMMWORD PTR [__svml_dcosh_ha_data_internal+4608] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rax] + vmovhpd xmm4, xmm13, QWORD PTR [imagerel(__jsvml_dcosh_ha_data_internal)+912+r8+rcx] + vpand xmm3, xmm12, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4608] vpaddq xmm5, xmm5, xmm3 vpaddq xmm0, xmm2, xmm3 vpsubq xmm4, xmm4, xmm3 vmulpd xmm3, xmm1, xmm1 vaddpd xmm12, xmm5, xmm4 vsubpd xmm2, xmm5, xmm4 - vmulpd xmm13, xmm3, XMMWORD PTR [__svml_dcosh_ha_data_internal+4544] - vaddpd xmm14, xmm13, XMMWORD PTR [__svml_dcosh_ha_data_internal+4416] - vmulpd xmm13, xmm3, XMMWORD PTR [__svml_dcosh_ha_data_internal+4480] + vmulpd xmm13, xmm3, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4544] + vaddpd xmm14, xmm13, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4416] + vmulpd xmm13, xmm3, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4480] vmulpd xmm14, xmm3, xmm14 - vaddpd xmm13, xmm13, XMMWORD PTR [__svml_dcosh_ha_data_internal+4352] + vaddpd xmm13, xmm13, XMMWORD PTR [__jsvml_dcosh_ha_data_internal+4352] vmulpd xmm14, xmm1, xmm14 vmulpd xmm3, xmm3, xmm13 vaddpd xmm1, xmm1, xmm14 @@ -1704,19 +1704,19 @@ _B9_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dcosh_ha_cout_rare_internal + call __jsvml_dcosh_ha_cout_rare_internal jmp _B9_8 ALIGN 16 _B9_11:: -__svml_cosh2_ha_e9 ENDP +__jsvml_cosh2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh2_ha_e9_B1_B3: +_unwind___jsvml_cosh2_ha_e9_B1_B3: DD 803329 DD 2151490 DD 1030198 @@ -1732,19 +1732,19 @@ _unwind___svml_cosh2_ha_e9_B1_B3: DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_cosh2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosh2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosh2_ha_e9_B6_B10: +_unwind___jsvml_cosh2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_cosh2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosh2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1753,7 +1753,7 @@ _unwind___svml_cosh2_ha_e9_B6_B10: DD imagerel _B9_6 DD imagerel _B9_11 - DD imagerel _unwind___svml_cosh2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cosh2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1767,9 +1767,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dcosh_ha_cout_rare_internal + PUBLIC __jsvml_dcosh_ha_cout_rare_internal -__svml_dcosh_ha_cout_rare_internal PROC +__jsvml_dcosh_ha_cout_rare_internal PROC _B10_1:: @@ -2014,13 +2014,13 @@ _B10_12:: _B10_13:: -__svml_dcosh_ha_cout_rare_internal ENDP +__jsvml_dcosh_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dcosh_ha_cout_rare_internal_B1_B12: +_unwind___jsvml_dcosh_ha_cout_rare_internal_B1_B12: DD 535041 DD 354346 DD 505893 @@ -2034,7 +2034,7 @@ _unwind___svml_dcosh_ha_cout_rare_internal_B1_B12: DD imagerel _B10_1 DD imagerel _B10_13 - DD imagerel _unwind___svml_dcosh_ha_cout_rare_internal_B1_B12 + DD imagerel _unwind___jsvml_dcosh_ha_cout_rare_internal_B1_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2042,8 +2042,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dcosh_ha_data_internal -__svml_dcosh_ha_data_internal DD 0 + PUBLIC __jsvml_dcosh_ha_data_internal +__jsvml_dcosh_ha_data_internal DD 0 DD 1071644672 DD 1828292879 DD 1071691096 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_exp_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_exp_windows_x86.S similarity index 78% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_exp_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_exp_windows_x86.S index de4ef22a036..2ecd7323102 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_exp_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_exp_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp1_ha_e9 + PUBLIC __jsvml_exp1_ha_e9 -__svml_exp1_ha_e9 PROC EXPORT +__jsvml_exp1_ha_e9 PROC EXPORT _B1_1:: @@ -53,11 +53,11 @@ L1:: vmovapd xmm3, xmm0 mov QWORD PTR [168+rsp], r13 mov eax, 2147483647 - vmulsd xmm1, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1024] + vmulsd xmm1, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1024] mov edx, 1082532650 - vmovsd xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1088] + vmovsd xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1088] vmovd xmm5, eax - vmovsd xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1536] + vmovsd xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1536] lea r8, QWORD PTR [__ImageBase] vaddsd xmm1, xmm1, xmm2 vsubsd xmm4, xmm1, xmm2 @@ -68,31 +68,31 @@ L1:: lea r13, QWORD PTR [95+rsp] vmovmskps eax, xmm2 and r13, -64 - vmovq xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1600] + vmovq xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1600] vpand xmm5, xmm1, xmm2 vpandn xmm1, xmm2, xmm1 vpshufd xmm5, xmm5, 0 vpslld xmm5, xmm5, 4 vmovd ecx, xmm5 - vmulsd xmm5, xmm4, QWORD PTR [__svml_dexp_ha_data_internal+1216] - vmulsd xmm4, xmm4, QWORD PTR [__svml_dexp_ha_data_internal+1280] + vmulsd xmm5, xmm4, QWORD PTR [__jsvml_dexp_ha_data_internal+1216] + vmulsd xmm4, xmm4, QWORD PTR [__jsvml_dexp_ha_data_internal+1280] vsubsd xmm5, xmm3, xmm5 movsxd rcx, ecx vsubsd xmm5, xmm5, xmm4 vmulsd xmm0, xmm0, xmm5 mov QWORD PTR [176+rsp], r13 - vaddsd xmm4, xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1472] + vaddsd xmm4, xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1472] vmulsd xmm0, xmm4, xmm5 vmulsd xmm4, xmm5, xmm5 - vaddsd xmm0, xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1408] + vaddsd xmm0, xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1408] vmulsd xmm0, xmm0, xmm5 - vaddsd xmm0, xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1344] + vaddsd xmm0, xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1344] vmulsd xmm4, xmm0, xmm4 vaddsd xmm5, xmm4, xmm5 - vmulsd xmm0, xmm5, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+r8+rcx] - vaddsd xmm4, xmm0, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+8+r8+rcx] + vmulsd xmm0, xmm5, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+r8+rcx] + vaddsd xmm4, xmm0, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+8+r8+rcx] vpsllq xmm0, xmm1, 46 - vaddsd xmm5, xmm4, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+r8+rcx] + vaddsd xmm5, xmm4, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+r8+rcx] vpaddq xmm0, xmm5, xmm0 test al, 1 jne _B1_3 @@ -105,8 +105,8 @@ _B1_2:: _B1_3:: - vcmpgtsd xmm1, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1984] - vcmpltsd xmm2, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+2048] + vcmpgtsd xmm1, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1984] + vcmpltsd xmm2, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+2048] vblendvpd xmm0, xmm0, XMMWORD PTR [_2il0floatpacket_33], xmm1 vorpd xmm4, xmm1, xmm2 vmovmskpd edx, xmm4 @@ -132,19 +132,19 @@ _B1_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B1_5 ALIGN 16 _B1_8:: -__svml_exp1_ha_e9 ENDP +__jsvml_exp1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp1_ha_e9_B1_B7: +_unwind___jsvml_exp1_ha_e9_B1_B7: DD 268033 DD 1430551 DD 1507595 @@ -156,7 +156,7 @@ _unwind___svml_exp1_ha_e9_B1_B7: DD imagerel _B1_1 DD imagerel _B1_8 - DD imagerel _unwind___svml_exp1_ha_e9_B1_B7 + DD imagerel _unwind___jsvml_exp1_ha_e9_B1_B7 .pdata ENDS _DATA SEGMENT 'DATA' @@ -170,9 +170,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp8_ha_z0 + PUBLIC __jsvml_exp8_ha_z0 -__svml_exp8_ha_z0 PROC EXPORT +__jsvml_exp8_ha_z0 PROC EXPORT _B2_1:: @@ -182,25 +182,25 @@ _B2_1:: DB 250 L4:: - vmovups zmm4, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+256] - vmovups zmm1, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+320] - vmovups zmm2, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+384] - vmovups zmm3, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+448] - vmovups zmm5, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+576] - vmovups zmm27, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+640] + vmovups zmm4, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+256] + vmovups zmm1, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+320] + vmovups zmm2, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+384] + vmovups zmm3, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+448] + vmovups zmm5, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+576] + vmovups zmm27, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+640] vfmadd213pd zmm4, zmm0, zmm1 {rz-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+704] - vmovups zmm24, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+768] - vmovups zmm23, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+832] - vmovups zmm26, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+896] - vmovups zmm28, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+128] - vmovups zmm29, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512] + vmovups zmm22, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+704] + vmovups zmm24, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+768] + vmovups zmm23, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+832] + vmovups zmm26, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+896] + vmovups zmm28, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+128] + vmovups zmm29, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512] vsubpd zmm31, zmm4, zmm1 {rn-sae} - vpermt2pd zmm28, zmm4, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+192] - vpermt2pd zmm29, zmm4, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+64] + vpermt2pd zmm28, zmm4, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+192] + vpermt2pd zmm29, zmm4, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+64] vfnmadd231pd zmm0, zmm2, zmm31 {rn-sae} vfnmadd231pd zmm0, zmm3, zmm31 {rn-sae} - vandpd zmm30, zmm0, ZMMWORD PTR [__svml_dexp_ha_data_internal_avx512+512] + vandpd zmm30, zmm0, ZMMWORD PTR [__jsvml_dexp_ha_data_internal_avx512+512] vmulpd zmm25, zmm30, zmm30 {rn-sae} vfmadd231pd zmm27, zmm5, zmm30 {rn-sae} vfmadd231pd zmm24, zmm22, zmm30 {rn-sae} @@ -215,7 +215,7 @@ L4:: _B2_2:: -__svml_exp8_ha_z0 ENDP +__jsvml_exp8_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -229,9 +229,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp1_ha_l9 + PUBLIC __jsvml_exp1_ha_l9 -__svml_exp1_ha_l9 PROC EXPORT +__jsvml_exp1_ha_l9 PROC EXPORT _B3_1:: @@ -247,35 +247,35 @@ L5:: vmovapd xmm1, xmm4 mov QWORD PTR [168+rsp], r13 lea rdx, QWORD PTR [__ImageBase] - vmovsd xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1088] + vmovsd xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1088] lea r13, QWORD PTR [95+rsp] - vfmadd132sd xmm1, xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1024] + vfmadd132sd xmm1, xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1024] and r13, -64 - vmovsd xmm8, QWORD PTR [__svml_dexp_ha_data_internal+1728] - vmovsd xmm5, QWORD PTR [__svml_dexp_ha_data_internal+1536] + vmovsd xmm8, QWORD PTR [__jsvml_dexp_ha_data_internal+1728] + vmovsd xmm5, QWORD PTR [__jsvml_dexp_ha_data_internal+1536] mov QWORD PTR [192+rsp], r13 vsubsd xmm3, xmm1, xmm2 vandpd xmm1, xmm4, xmm8 vmovapd xmm8, xmm3 - vfnmadd132sd xmm8, xmm4, QWORD PTR [__svml_dexp_ha_data_internal+1216] - vcmpnlesd xmm2, xmm1, QWORD PTR [__svml_dexp_ha_data_internal+1792] - vaddsd xmm1, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1152] - vfnmadd132sd xmm3, xmm8, QWORD PTR [__svml_dexp_ha_data_internal+1280] + vfnmadd132sd xmm8, xmm4, QWORD PTR [__jsvml_dexp_ha_data_internal+1216] + vcmpnlesd xmm2, xmm1, QWORD PTR [__jsvml_dexp_ha_data_internal+1792] + vaddsd xmm1, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1152] + vfnmadd132sd xmm3, xmm8, QWORD PTR [__jsvml_dexp_ha_data_internal+1280] vmovmskpd ecx, xmm2 - vmovq xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1664] + vmovq xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1664] vpand xmm0, xmm1, xmm2 - vfmadd213sd xmm5, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1472] + vfmadd213sd xmm5, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1472] vmulsd xmm8, xmm3, xmm3 vmovd eax, xmm0 - vfmadd213sd xmm5, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1408] - vfmadd213sd xmm5, xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1344] + vfmadd213sd xmm5, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1408] + vfmadd213sd xmm5, xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1344] movsxd rax, eax vfmadd213sd xmm5, xmm8, xmm3 vpandn xmm3, xmm2, xmm1 - vmovddup xmm0, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+8+rdx+rax] - vfmadd132sd xmm5, xmm0, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rdx+rax] + vmovddup xmm0, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+8+rdx+rax] + vfmadd132sd xmm5, xmm0, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rdx+rax] vpsllq xmm0, xmm3, 42 - vaddsd xmm5, xmm5, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rdx+rax] + vaddsd xmm5, xmm5, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rdx+rax] vpaddq xmm0, xmm5, xmm0 test cl, 1 jne _B3_3 @@ -289,8 +289,8 @@ _B3_2:: _B3_3:: - vcmpgtsd xmm1, xmm4, QWORD PTR [__svml_dexp_ha_data_internal+1984] - vcmpltsd xmm2, xmm4, QWORD PTR [__svml_dexp_ha_data_internal+2048] + vcmpgtsd xmm1, xmm4, QWORD PTR [__jsvml_dexp_ha_data_internal+1984] + vcmpltsd xmm2, xmm4, QWORD PTR [__jsvml_dexp_ha_data_internal+2048] vblendvpd xmm0, xmm0, XMMWORD PTR [_2il0floatpacket_33], xmm1 vorpd xmm3, xmm1, xmm2 vmovmskpd eax, xmm3 @@ -315,19 +315,19 @@ _B3_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B3_5 ALIGN 16 _B3_8:: -__svml_exp1_ha_l9 ENDP +__jsvml_exp1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp1_ha_l9_B1_B7: +_unwind___jsvml_exp1_ha_l9_B1_B7: DD 402433 DD 1430564 DD 755736 @@ -340,7 +340,7 @@ _unwind___svml_exp1_ha_l9_B1_B7: DD imagerel _B3_1 DD imagerel _B3_8 - DD imagerel _unwind___svml_exp1_ha_l9_B1_B7 + DD imagerel _unwind___jsvml_exp1_ha_l9_B1_B7 .pdata ENDS _DATA SEGMENT 'DATA' @@ -354,9 +354,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp2_ha_ex + PUBLIC __jsvml_exp2_ha_ex -__svml_exp2_ha_ex PROC EXPORT +__jsvml_exp2_ha_ex PROC EXPORT _B4_1:: @@ -375,20 +375,20 @@ L10:: movups XMMWORD PTR [208+rsp], xmm7 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm13, XMMWORD PTR [__svml_dexp_ha_data_internal+1024] + movups xmm13, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1024] and r13, -64 mulpd xmm13, xmm4 - movups xmm3, XMMWORD PTR [__svml_dexp_ha_data_internal+1088] + movups xmm3, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1088] addpd xmm13, xmm3 movaps xmm14, xmm13 subpd xmm14, xmm3 - movq xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1856] + movq xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1856] pshufd xmm1, xmm4, 221 - movdqu xmm3, XMMWORD PTR [__svml_dexp_ha_data_internal+1600] + movdqu xmm3, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1600] pand xmm1, xmm2 movdqa xmm2, xmm3 pandn xmm3, xmm13 - movq xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1920] + movq xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1920] pand xmm2, xmm13 pcmpgtd xmm1, xmm0 psllq xmm3, 46 @@ -396,18 +396,18 @@ L10:: pslld xmm0, 4 movmskps r8d, xmm1 pshufd xmm1, xmm0, 1 - movups xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+1216] + movups xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1216] movd eax, xmm0 movd edx, xmm1 - movups xmm7, XMMWORD PTR [__svml_dexp_ha_data_internal+1280] - movups xmm8, XMMWORD PTR [__svml_dexp_ha_data_internal+1536] + movups xmm7, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1280] + movups xmm8, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1536] mulpd xmm5, xmm14 mulpd xmm7, xmm14 movsxd rax, eax movsxd rdx, edx mov QWORD PTR [264+rsp], r13 - movups xmm2, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rcx+rax] - movups xmm1, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rcx+rdx] + movups xmm2, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rcx+rax] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rcx+rdx] movaps xmm0, xmm2 unpcklpd xmm0, xmm1 unpckhpd xmm2, xmm1 @@ -415,13 +415,13 @@ L10:: subpd xmm1, xmm5 subpd xmm1, xmm7 mulpd xmm8, xmm1 - addpd xmm8, XMMWORD PTR [__svml_dexp_ha_data_internal+1472] + addpd xmm8, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1472] mulpd xmm8, xmm1 - addpd xmm8, XMMWORD PTR [__svml_dexp_ha_data_internal+1408] + addpd xmm8, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1408] mulpd xmm8, xmm1 movaps xmm5, xmm1 mulpd xmm5, xmm1 - addpd xmm8, XMMWORD PTR [__svml_dexp_ha_data_internal+1344] + addpd xmm8, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1344] mulpd xmm5, xmm8 addpd xmm1, xmm5 mulpd xmm1, xmm0 @@ -443,10 +443,10 @@ _B4_2:: _B4_3:: - movups xmm3, XMMWORD PTR [__svml_dexp_ha_data_internal+1984] + movups xmm3, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1984] movaps xmm2, xmm4 cmpltpd xmm3, xmm4 - cmpltpd xmm2, XMMWORD PTR [__svml_dexp_ha_data_internal+2048] + cmpltpd xmm2, XMMWORD PTR [__jsvml_dexp_ha_data_internal+2048] movaps xmm1, xmm3 andnps xmm1, xmm0 movups xmm0, XMMWORD PTR [_2il0floatpacket_33] @@ -501,19 +501,19 @@ _B4_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B4_9 ALIGN 16 _B4_12:: -__svml_exp2_ha_ex ENDP +__jsvml_exp2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp2_ha_ex_B1_B4: +_unwind___jsvml_exp2_ha_ex_B1_B4: DD 802817 DD 2151488 DD 882744 @@ -529,19 +529,19 @@ _unwind___svml_exp2_ha_ex_B1_B4: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_exp2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_exp2_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp2_ha_ex_B7_B11: +_unwind___jsvml_exp2_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_exp2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_exp2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -550,7 +550,7 @@ _unwind___svml_exp2_ha_ex_B7_B11: DD imagerel _B4_7 DD imagerel _B4_12 - DD imagerel _unwind___svml_exp2_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_exp2_ha_ex_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -564,9 +564,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp4_ha_e9 + PUBLIC __jsvml_exp4_ha_e9 -__svml_exp4_ha_e9 PROC EXPORT +__jsvml_exp4_ha_e9 PROC EXPORT _B5_1:: @@ -585,16 +585,16 @@ L25:: lea r13, QWORD PTR [335+rsp] vmovapd ymm5, ymm0 and r13, -64 - vmovupd ymm4, YMMWORD PTR [__svml_dexp_ha_data_internal+1088] - vmulpd ymm2, ymm5, YMMWORD PTR [__svml_dexp_ha_data_internal+1024] + vmovupd ymm4, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1088] + vmulpd ymm2, ymm5, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1024] vaddpd ymm3, ymm4, ymm2 vsubpd ymm0, ymm3, ymm4 mov QWORD PTR [536+rsp], r13 vextractf128 xmm6, ymm5, 1 vshufps xmm2, xmm5, xmm6, 221 - vandps xmm4, xmm2, XMMWORD PTR [__svml_dexp_ha_data_internal+1856] - vpcmpgtd xmm1, xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1920] - vmovupd xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1600] + vandps xmm4, xmm2, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1856] + vpcmpgtd xmm1, xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1920] + vmovupd xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1600] vmovmskps edx, xmm1 vandps xmm9, xmm3, xmm4 vextractf128 xmm2, ymm3, 1 @@ -612,23 +612,23 @@ L25:: vpextrd r10d, xmm9, 3 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm7, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+r8] - vinsertf128 ymm9, ymm7, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+r9], 1 - vinsertf128 ymm6, ymm1, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+r10], 1 + vmovupd xmm7, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+r8] + vinsertf128 ymm9, ymm7, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+r9], 1 + vinsertf128 ymm6, ymm1, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+r10], 1 vunpcklpd ymm1, ymm9, ymm6 vunpckhpd ymm6, ymm9, ymm6 - vmulpd ymm9, ymm0, YMMWORD PTR [__svml_dexp_ha_data_internal+1216] - vmulpd ymm0, ymm0, YMMWORD PTR [__svml_dexp_ha_data_internal+1280] + vmulpd ymm9, ymm0, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1216] + vmulpd ymm0, ymm0, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1280] vsubpd ymm9, ymm5, ymm9 vsubpd ymm9, ymm9, ymm0 - vmulpd ymm7, ymm9, YMMWORD PTR [__svml_dexp_ha_data_internal+1536] - vaddpd ymm0, ymm7, YMMWORD PTR [__svml_dexp_ha_data_internal+1472] + vmulpd ymm7, ymm9, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1536] + vaddpd ymm0, ymm7, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1472] vmulpd ymm7, ymm9, ymm0 - vaddpd ymm0, ymm7, YMMWORD PTR [__svml_dexp_ha_data_internal+1408] + vaddpd ymm0, ymm7, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1408] vmulpd ymm7, ymm9, ymm9 vmulpd ymm0, ymm9, ymm0 - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_dexp_ha_data_internal+1344] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1344] vmulpd ymm7, ymm7, ymm0 vaddpd ymm9, ymm9, ymm7 vmulpd ymm0, ymm1, ymm9 @@ -653,8 +653,8 @@ _B5_2:: _B5_3:: - vcmpgt_oqpd ymm1, ymm5, YMMWORD PTR [__svml_dexp_ha_data_internal+1984] - vcmplt_oqpd ymm2, ymm5, YMMWORD PTR [__svml_dexp_ha_data_internal+2048] + vcmpgt_oqpd ymm1, ymm5, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1984] + vcmplt_oqpd ymm2, ymm5, YMMWORD PTR [__jsvml_dexp_ha_data_internal+2048] vblendvpd ymm0, ymm0, YMMWORD PTR [_2il0floatpacket_34], ymm1 vorpd ymm3, ymm1, ymm2 vandnpd ymm0, ymm2, ymm0 @@ -717,19 +717,19 @@ _B5_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B5_9 ALIGN 16 _B5_12:: -__svml_exp4_ha_e9 ENDP +__jsvml_exp4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp4_ha_e9_B1_B4: +_unwind___jsvml_exp4_ha_e9_B1_B4: DD 668929 DD 4379701 DD 1796141 @@ -744,13 +744,13 @@ _unwind___svml_exp4_ha_e9_B1_B4: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_exp4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_exp4_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp4_ha_e9_B7_B11: +_unwind___jsvml_exp4_ha_e9_B7_B11: DD 1198625 DD 2122826 DD 2176064 @@ -763,7 +763,7 @@ _unwind___svml_exp4_ha_e9_B7_B11: DD 952331 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_exp4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_exp4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -772,7 +772,7 @@ _unwind___svml_exp4_ha_e9_B7_B11: DD imagerel _B5_7 DD imagerel _B5_12 - DD imagerel _unwind___svml_exp4_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_exp4_ha_e9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -786,9 +786,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp2_ha_l9 + PUBLIC __jsvml_exp2_ha_l9 -__svml_exp2_ha_l9 PROC EXPORT +__jsvml_exp2_ha_l9 PROC EXPORT _B6_1:: @@ -806,33 +806,33 @@ L52:: vmovups XMMWORD PTR [224+rsp], xmm8 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm2, XMMWORD PTR [__svml_dexp_ha_data_internal+1024] + vmovupd xmm2, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1024] and r13, -64 - vmovupd xmm3, XMMWORD PTR [__svml_dexp_ha_data_internal+1088] + vmovupd xmm3, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1088] vfmadd213pd xmm2, xmm5, xmm3 - vmovupd xmm8, XMMWORD PTR [__svml_dexp_ha_data_internal+1216] - vmovupd xmm9, XMMWORD PTR [__svml_dexp_ha_data_internal+1536] - vandpd xmm1, xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+1728] - vcmpnlepd xmm10, xmm1, XMMWORD PTR [__svml_dexp_ha_data_internal+1792] + vmovupd xmm8, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1216] + vmovupd xmm9, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1536] + vandpd xmm1, xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1728] + vcmpnlepd xmm10, xmm1, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1792] vsubpd xmm4, xmm2, xmm3 vmovmskpd r8d, xmm10 - vmovdqu xmm3, XMMWORD PTR [__svml_dexp_ha_data_internal+1664] + vmovdqu xmm3, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1664] vfnmadd213pd xmm8, xmm4, xmm5 - vaddpd xmm2, xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1152] - vfnmadd132pd xmm4, xmm8, XMMWORD PTR [__svml_dexp_ha_data_internal+1280] + vaddpd xmm2, xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1152] + vfnmadd132pd xmm4, xmm8, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1280] vpand xmm0, xmm2, xmm3 vmovd eax, xmm0 - vfmadd213pd xmm9, xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1472] + vfmadd213pd xmm9, xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1472] vmulpd xmm8, xmm4, xmm4 - vfmadd213pd xmm9, xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1408] - vfmadd213pd xmm9, xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1344] + vfmadd213pd xmm9, xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1408] + vfmadd213pd xmm9, xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1344] vpextrd edx, xmm0, 2 movsxd rax, eax movsxd rdx, edx vfmadd213pd xmm9, xmm8, xmm4 vpandn xmm4, xmm3, xmm2 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rcx+rax] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rcx+rdx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rcx+rax] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rcx+rdx] vunpcklpd xmm0, xmm1, xmm10 vunpckhpd xmm1, xmm1, xmm10 vfmadd213pd xmm9, xmm0, xmm1 @@ -854,8 +854,8 @@ _B6_2:: _B6_3:: - vcmpgtpd xmm1, xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+1984] - vcmpltpd xmm2, xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+2048] + vcmpgtpd xmm1, xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1984] + vcmpltpd xmm2, xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+2048] vblendvpd xmm0, xmm0, XMMWORD PTR [_2il0floatpacket_33], xmm1 vorpd xmm3, xmm1, xmm2 vmovmskpd eax, xmm3 @@ -900,19 +900,19 @@ _B6_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B6_9 ALIGN 16 _B6_12:: -__svml_exp2_ha_l9 ENDP +__jsvml_exp2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp2_ha_l9_B1_B4: +_unwind___jsvml_exp2_ha_l9_B1_B4: DD 669953 DD 2020409 DD 952369 @@ -927,19 +927,19 @@ _unwind___svml_exp2_ha_l9_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_exp2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_exp2_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp2_ha_l9_B7_B11: +_unwind___jsvml_exp2_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_exp2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_exp2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -948,7 +948,7 @@ _unwind___svml_exp2_ha_l9_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_exp2_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_exp2_ha_l9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -962,9 +962,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp1_ha_ex + PUBLIC __jsvml_exp1_ha_ex -__svml_exp1_ha_ex PROC EXPORT +__jsvml_exp1_ha_ex PROC EXPORT _B7_1:: @@ -980,13 +980,13 @@ L65:: movaps xmm3, xmm5 mov QWORD PTR [168+rsp], r13 mov eax, 2147483647 - mulsd xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1024] + mulsd xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1024] mov edx, 1082532650 - movsd xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1088] + movsd xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1088] movd xmm1, eax movd xmm13, edx lea r8, QWORD PTR [__ImageBase] - movsd xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1536] + movsd xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1536] lea r13, QWORD PTR [95+rsp] and r13, -64 addsd xmm3, xmm2 @@ -997,7 +997,7 @@ L65:: pand xmm2, xmm1 pcmpgtd xmm2, xmm13 movmskps eax, xmm2 - movq xmm2, QWORD PTR [__svml_dexp_ha_data_internal+1600] + movq xmm2, QWORD PTR [__jsvml_dexp_ha_data_internal+1600] movdqa xmm1, xmm2 pandn xmm2, xmm3 pand xmm1, xmm3 @@ -1007,24 +1007,24 @@ L65:: pslld xmm13, 4 movd ecx, xmm13 movaps xmm13, xmm4 - mulsd xmm13, QWORD PTR [__svml_dexp_ha_data_internal+1216] - mulsd xmm4, QWORD PTR [__svml_dexp_ha_data_internal+1280] + mulsd xmm13, QWORD PTR [__jsvml_dexp_ha_data_internal+1216] + mulsd xmm4, QWORD PTR [__jsvml_dexp_ha_data_internal+1280] subsd xmm1, xmm13 movsxd rcx, ecx subsd xmm1, xmm4 mulsd xmm0, xmm1 movaps xmm4, xmm1 mulsd xmm4, xmm1 - addsd xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1472] + addsd xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1472] mulsd xmm0, xmm1 - addsd xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1408] + addsd xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1408] mulsd xmm0, xmm1 - addsd xmm0, QWORD PTR [__svml_dexp_ha_data_internal+1344] + addsd xmm0, QWORD PTR [__jsvml_dexp_ha_data_internal+1344] mulsd xmm0, xmm4 addsd xmm0, xmm1 - mulsd xmm0, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+r8+rcx] - addsd xmm0, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+8+r8+rcx] - addsd xmm0, QWORD PTR [imagerel(__svml_dexp_ha_data_internal)+r8+rcx] + mulsd xmm0, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+r8+rcx] + addsd xmm0, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+8+r8+rcx] + addsd xmm0, QWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+r8+rcx] paddq xmm0, xmm2 test al, 1 jne _B7_3 @@ -1038,11 +1038,11 @@ _B7_2:: _B7_3:: - movsd xmm1, QWORD PTR [__svml_dexp_ha_data_internal+1984] + movsd xmm1, QWORD PTR [__jsvml_dexp_ha_data_internal+1984] movaps xmm3, xmm5 movaps xmm4, xmm5 cmpltsd xmm1, xmm5 - cmpltsd xmm3, QWORD PTR [__svml_dexp_ha_data_internal+2048] + cmpltsd xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+2048] movsd xmm4, xmm1 movaps xmm2, xmm4 andnps xmm2, xmm0 @@ -1074,19 +1074,19 @@ _B7_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B7_5 ALIGN 16 _B7_8:: -__svml_exp1_ha_ex ENDP +__jsvml_exp1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp1_ha_ex_B1_B7: +_unwind___jsvml_exp1_ha_ex_B1_B7: DD 401921 DD 1430562 DD 776215 @@ -1099,7 +1099,7 @@ _unwind___svml_exp1_ha_ex_B1_B7: DD imagerel _B7_1 DD imagerel _B7_8 - DD imagerel _unwind___svml_exp1_ha_ex_B1_B7 + DD imagerel _unwind___jsvml_exp1_ha_ex_B1_B7 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1113,9 +1113,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp4_ha_l9 + PUBLIC __jsvml_exp4_ha_l9 -__svml_exp4_ha_l9 PROC EXPORT +__jsvml_exp4_ha_l9 PROC EXPORT _B8_1:: @@ -1135,28 +1135,28 @@ L70:: vmovups YMMWORD PTR [496+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm4, YMMWORD PTR [__svml_dexp_ha_data_internal+1024] + vmovupd ymm4, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1024] and r13, -64 - vmovupd ymm5, YMMWORD PTR [__svml_dexp_ha_data_internal+1088] - vmovupd ymm9, YMMWORD PTR [__svml_dexp_ha_data_internal+1216] - vmovupd ymm10, YMMWORD PTR [__svml_dexp_ha_data_internal+1536] + vmovupd ymm5, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1088] + vmovupd ymm9, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1216] + vmovupd ymm10, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1536] vmovdqa ymm8, ymm0 vfmadd213pd ymm4, ymm8, ymm5 vsubpd ymm7, ymm4, ymm5 - vmovupd ymm5, YMMWORD PTR [__svml_dexp_ha_data_internal+1664] + vmovupd ymm5, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1664] vfnmadd213pd ymm9, ymm7, ymm8 - vaddpd ymm4, ymm7, YMMWORD PTR [__svml_dexp_ha_data_internal+1152] - vfnmadd132pd ymm7, ymm9, YMMWORD PTR [__svml_dexp_ha_data_internal+1280] - vfmadd213pd ymm10, ymm7, YMMWORD PTR [__svml_dexp_ha_data_internal+1472] + vaddpd ymm4, ymm7, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1152] + vfnmadd132pd ymm7, ymm9, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1280] + vfmadd213pd ymm10, ymm7, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1472] vmulpd ymm9, ymm7, ymm7 - vfmadd213pd ymm10, ymm7, YMMWORD PTR [__svml_dexp_ha_data_internal+1408] + vfmadd213pd ymm10, ymm7, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1408] vandps ymm15, ymm4, ymm5 - vfmadd213pd ymm10, ymm7, YMMWORD PTR [__svml_dexp_ha_data_internal+1344] + vfmadd213pd ymm10, ymm7, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1344] vpandn ymm4, ymm5, ymm4 vfmadd213pd ymm10, ymm9, ymm7 vpsllq ymm5, ymm4, 42 - vandpd ymm2, ymm8, YMMWORD PTR [__svml_dexp_ha_data_internal+1728] - vcmpnle_uqpd ymm1, ymm2, YMMWORD PTR [__svml_dexp_ha_data_internal+1792] + vandpd ymm2, ymm8, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1728] + vcmpnle_uqpd ymm1, ymm2, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1792] vmovmskpd edx, ymm1 mov QWORD PTR [536+rsp], r13 test edx, edx @@ -1169,10 +1169,10 @@ L70:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+rcx] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+r8] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+r9] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rax+r10] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+r8] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+r9] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rax+r10] vunpcklpd xmm0, xmm6, xmm3 vunpckhpd xmm3, xmm6, xmm3 vunpcklpd xmm15, xmm2, xmm1 @@ -1198,8 +1198,8 @@ _B8_2:: _B8_3:: - vcmpgt_oqpd ymm1, ymm8, YMMWORD PTR [__svml_dexp_ha_data_internal+1984] - vcmplt_oqpd ymm2, ymm8, YMMWORD PTR [__svml_dexp_ha_data_internal+2048] + vcmpgt_oqpd ymm1, ymm8, YMMWORD PTR [__jsvml_dexp_ha_data_internal+1984] + vcmplt_oqpd ymm2, ymm8, YMMWORD PTR [__jsvml_dexp_ha_data_internal+2048] vblendvpd ymm0, ymm0, YMMWORD PTR [_2il0floatpacket_34], ymm1 vorpd ymm3, ymm1, ymm2 vmovmskpd eax, ymm3 @@ -1253,19 +1253,19 @@ _B8_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B8_9 ALIGN 16 _B8_12:: -__svml_exp4_ha_l9 ENDP +__jsvml_exp4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp4_ha_l9_B1_B4: +_unwind___jsvml_exp4_ha_l9_B1_B4: DD 1069057 DD 4379728 DD 2058312 @@ -1283,13 +1283,13 @@ _unwind___svml_exp4_ha_l9_B1_B4: DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_exp4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_exp4_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp4_ha_l9_B7_B11: +_unwind___jsvml_exp4_ha_l9_B7_B11: DD 798497 DD 1336367 DD 1389605 @@ -1299,7 +1299,7 @@ _unwind___svml_exp4_ha_l9_B7_B11: DD 571403 DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_exp4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_exp4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1308,7 +1308,7 @@ _unwind___svml_exp4_ha_l9_B7_B11: DD imagerel _B8_7 DD imagerel _B8_12 - DD imagerel _unwind___svml_exp4_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_exp4_ha_l9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1322,9 +1322,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_exp2_ha_e9 + PUBLIC __jsvml_exp2_ha_e9 -__svml_exp2_ha_e9 PROC EXPORT +__jsvml_exp2_ha_e9 PROC EXPORT _B9_1:: @@ -1341,43 +1341,43 @@ L97:: vmovups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [224+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmulpd xmm4, xmm7, XMMWORD PTR [__svml_dexp_ha_data_internal+1024] - vmovupd xmm3, XMMWORD PTR [__svml_dexp_ha_data_internal+1088] + vmulpd xmm4, xmm7, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1024] + vmovupd xmm3, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1088] and r13, -64 vaddpd xmm6, xmm3, xmm4 - vmovq xmm1, QWORD PTR [__svml_dexp_ha_data_internal+1856] + vmovq xmm1, QWORD PTR [__jsvml_dexp_ha_data_internal+1856] vpshufd xmm2, xmm7, 221 vsubpd xmm5, xmm6, xmm3 - vmovq xmm3, QWORD PTR [__svml_dexp_ha_data_internal+1920] + vmovq xmm3, QWORD PTR [__jsvml_dexp_ha_data_internal+1920] vpand xmm4, xmm2, xmm1 vpcmpgtd xmm2, xmm4, xmm3 - vmovdqu xmm4, XMMWORD PTR [__svml_dexp_ha_data_internal+1600] + vmovdqu xmm4, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1600] vpand xmm1, xmm6, xmm4 vpandn xmm4, xmm4, xmm6 vpshufd xmm0, xmm1, 136 vpsllq xmm6, xmm4, 46 vpslld xmm3, xmm0, 4 - vmulpd xmm0, xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+1216] + vmulpd xmm0, xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1216] vmovd eax, xmm3 vmovmskps r8d, xmm2 - vmulpd xmm5, xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+1280] + vmulpd xmm5, xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1280] vpextrd edx, xmm3, 1 movsxd rax, eax movsxd rdx, edx mov QWORD PTR [232+rsp], r13 - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rcx+rax] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dexp_ha_data_internal)+rcx+rdx] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rcx+rax] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dexp_ha_data_internal)+rcx+rdx] vunpcklpd xmm3, xmm2, xmm1 vunpckhpd xmm2, xmm2, xmm1 vsubpd xmm1, xmm7, xmm0 vsubpd xmm1, xmm1, xmm5 - vmulpd xmm0, xmm1, XMMWORD PTR [__svml_dexp_ha_data_internal+1536] - vaddpd xmm5, xmm0, XMMWORD PTR [__svml_dexp_ha_data_internal+1472] + vmulpd xmm0, xmm1, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1536] + vaddpd xmm5, xmm0, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1472] vmulpd xmm0, xmm1, xmm5 - vaddpd xmm5, xmm0, XMMWORD PTR [__svml_dexp_ha_data_internal+1408] + vaddpd xmm5, xmm0, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1408] vmulpd xmm0, xmm1, xmm1 vmulpd xmm5, xmm1, xmm5 - vaddpd xmm5, xmm5, XMMWORD PTR [__svml_dexp_ha_data_internal+1344] + vaddpd xmm5, xmm5, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1344] vmulpd xmm0, xmm0, xmm5 vaddpd xmm1, xmm1, xmm0 vmulpd xmm0, xmm3, xmm1 @@ -1397,8 +1397,8 @@ _B9_2:: _B9_3:: - vcmpgtpd xmm1, xmm7, XMMWORD PTR [__svml_dexp_ha_data_internal+1984] - vcmpltpd xmm2, xmm7, XMMWORD PTR [__svml_dexp_ha_data_internal+2048] + vcmpgtpd xmm1, xmm7, XMMWORD PTR [__jsvml_dexp_ha_data_internal+1984] + vcmpltpd xmm2, xmm7, XMMWORD PTR [__jsvml_dexp_ha_data_internal+2048] vblendvpd xmm0, xmm0, XMMWORD PTR [_2il0floatpacket_33], xmm1 vorpd xmm3, xmm1, xmm2 vmovmskpd edx, xmm3 @@ -1445,19 +1445,19 @@ _B9_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexp_ha_cout_rare_internal + call __jsvml_dexp_ha_cout_rare_internal jmp _B9_9 ALIGN 16 _B9_12:: -__svml_exp2_ha_e9 ENDP +__jsvml_exp2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp2_ha_e9_B1_B4: +_unwind___jsvml_exp2_ha_e9_B1_B4: DD 536577 DD 1889328 DD 878632 @@ -1471,19 +1471,19 @@ _unwind___svml_exp2_ha_e9_B1_B4: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_exp2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_exp2_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_exp2_ha_e9_B7_B11: +_unwind___jsvml_exp2_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_exp2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_exp2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1492,7 +1492,7 @@ _unwind___svml_exp2_ha_e9_B7_B11: DD imagerel _B9_7 DD imagerel _B9_12 - DD imagerel _unwind___svml_exp2_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_exp2_ha_e9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1506,9 +1506,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dexp_ha_cout_rare_internal + PUBLIC __jsvml_dexp_ha_cout_rare_internal -__svml_dexp_ha_cout_rare_internal PROC +__jsvml_dexp_ha_cout_rare_internal PROC _B10_1:: @@ -1760,13 +1760,13 @@ _B10_21:: _B10_22:: -__svml_dexp_ha_cout_rare_internal ENDP +__jsvml_dexp_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dexp_ha_cout_rare_internal_B1_B21: +_unwind___jsvml_dexp_ha_cout_rare_internal_B1_B21: DD 67585 DD 49672 @@ -1777,7 +1777,7 @@ _unwind___svml_dexp_ha_cout_rare_internal_B1_B21: DD imagerel _B10_1 DD imagerel _B10_22 - DD imagerel _unwind___svml_dexp_ha_cout_rare_internal_B1_B21 + DD imagerel _unwind___jsvml_dexp_ha_cout_rare_internal_B1_B21 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1785,8 +1785,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dexp_ha_data_internal_avx512 -__svml_dexp_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dexp_ha_data_internal_avx512 +__jsvml_dexp_ha_data_internal_avx512 DD 0 DD 1072693248 DD 1828292879 DD 1072739672 @@ -2106,8 +2106,8 @@ __svml_dexp_ha_data_internal_avx512 DD 0 DD 0 DD 32752 DD 0 - PUBLIC __svml_dexp_ha_data_internal -__svml_dexp_ha_data_internal DD 0 + PUBLIC __jsvml_dexp_ha_data_internal +__jsvml_dexp_ha_data_internal DD 0 DD 1072693248 DD 0 DD 0 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_expm1_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_expm1_windows_x86.S similarity index 81% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_expm1_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_expm1_windows_x86.S index 1c9cafd7434..243b6b23d71 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_expm1_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_expm1_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm14_ha_l9 + PUBLIC __jsvml_expm14_ha_l9 -__svml_expm14_ha_l9 PROC EXPORT +__jsvml_expm14_ha_l9 PROC EXPORT _B1_1:: @@ -63,20 +63,20 @@ L1:: lea r13, QWORD PTR [175+rsp] vmovdqa ymm6, ymm0 and r13, -64 - vmulpd ymm5, ymm6, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2304] - vmovupd ymm4, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2816] - vmovupd ymm3, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2368] + vmulpd ymm5, ymm6, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] + vmovupd ymm4, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] + vmovupd ymm3, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] vroundpd ymm14, ymm5, 0 - vaddpd ymm7, ymm14, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2496] - vmulpd ymm2, ymm14, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2432] + vaddpd ymm7, ymm14, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] + vmulpd ymm2, ymm14, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] vfnmadd213pd ymm3, ymm14, ymm6 - vandps ymm11, ymm7, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2560] + vandps ymm11, ymm7, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] vandpd ymm15, ymm6, ymm4 - vcmpnle_uqpd ymm13, ymm15, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2880] + vcmpnle_uqpd ymm13, ymm15, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] vsubpd ymm0, ymm3, ymm2 vcmpeqpd ymm1, ymm3, ymm6 vmovmskpd edx, ymm13 - vorpd ymm1, ymm1, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2688] + vorpd ymm1, ymm1, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] test edx, edx vandnpd ymm5, ymm4, ymm6 mov QWORD PTR [536+rsp], r13 @@ -89,28 +89,28 @@ L1:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+rcx] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+r8] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+r9] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+r10] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+rcx] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+r8] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+r9] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+r10] vunpcklpd xmm15, xmm12, xmm10 vunpcklpd xmm11, xmm14, xmm13 vunpckhpd xmm13, xmm14, xmm13 - vandps ymm14, ymm7, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2624] + vandps ymm14, ymm7, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] vpsllq ymm7, ymm14, 41 vunpckhpd xmm12, xmm12, xmm10 - vmovupd ymm14, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2048] - vfmadd213pd ymm14, ymm0, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2112] + vmovupd ymm14, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] + vfmadd213pd ymm14, ymm0, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] vinsertf128 ymm15, ymm15, xmm11, 1 - vmovupd ymm11, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2176] - vfmadd213pd ymm11, ymm0, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2240] + vmovupd ymm11, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] + vfmadd213pd ymm11, ymm0, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] vorpd ymm15, ymm15, ymm7 vinsertf128 ymm10, ymm12, xmm13, 1 vmulpd ymm12, ymm0, ymm0 vmulpd ymm13, ymm10, ymm7 vfmadd213pd ymm14, ymm12, ymm11 vandpd ymm10, ymm3, ymm1 - vmovupd ymm1, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2752] + vmovupd ymm1, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] vmulpd ymm7, ymm15, ymm10 vsubpd ymm3, ymm3, ymm10 vandpd ymm0, ymm15, ymm4 @@ -190,19 +190,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_expm14_ha_l9 ENDP +__jsvml_expm14_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm14_ha_l9_B1_B3: +_unwind___jsvml_expm14_ha_l9_B1_B3: DD 1335809 DD 4379746 DD 1140826 @@ -222,13 +222,13 @@ _unwind___svml_expm14_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_expm14_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm14_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm14_ha_l9_B6_B10: +_unwind___jsvml_expm14_ha_l9_B6_B10: DD 530977 DD 812058 DD 865299 @@ -236,7 +236,7 @@ _unwind___svml_expm14_ha_l9_B6_B10: DD 296968 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_expm14_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm14_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -245,7 +245,7 @@ _unwind___svml_expm14_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_expm14_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_expm14_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -259,9 +259,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm12_ha_e9 + PUBLIC __jsvml_expm12_ha_e9 -__svml_expm12_ha_e9 PROC EXPORT +__jsvml_expm12_ha_e9 PROC EXPORT _B2_1:: @@ -281,22 +281,22 @@ L28:: vmovups XMMWORD PTR [192+rsp], xmm6 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmulpd xmm12, xmm1, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2304] + vmulpd xmm12, xmm1, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] vroundpd xmm12, xmm12, 0 and r13, -64 - vmulpd xmm4, xmm12, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2368] - vaddpd xmm13, xmm12, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2496] + vmulpd xmm4, xmm12, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] + vaddpd xmm13, xmm12, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] vsubpd xmm0, xmm1, xmm4 - vmulpd xmm2, xmm12, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2432] + vmulpd xmm2, xmm12, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] vcmpeqpd xmm15, xmm0, xmm1 vsubpd xmm14, xmm0, xmm2 - vmovupd xmm3, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2816] + vmovupd xmm3, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] vandpd xmm5, xmm1, xmm3 vandnpd xmm4, xmm3, xmm1 - vcmpnlepd xmm6, xmm5, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2880] + vcmpnlepd xmm6, xmm5, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] vmovmskpd edx, xmm6 - vandps xmm6, xmm13, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2560] - vorpd xmm15, xmm15, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2688] + vandps xmm6, xmm13, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] + vorpd xmm15, xmm15, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] vmovd eax, xmm6 vandpd xmm15, xmm0, xmm15 vsubpd xmm0, xmm0, xmm15 @@ -304,25 +304,25 @@ L28:: movsxd rax, eax movsxd rcx, ecx vsubpd xmm2, xmm0, xmm2 - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+r8+rax] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+r8+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+r8+rax] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+r8+rcx] vunpcklpd xmm12, xmm5, xmm6 vunpckhpd xmm6, xmm5, xmm6 - vpand xmm5, xmm13, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2624] + vpand xmm5, xmm13, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] vpsllq xmm13, xmm5, 41 vorpd xmm5, xmm12, xmm13 - vmulpd xmm12, xmm14, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2048] + vmulpd xmm12, xmm14, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] vmulpd xmm6, xmm6, xmm13 - vmulpd xmm13, xmm14, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2176] + vmulpd xmm13, xmm14, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] vmulpd xmm14, xmm14, xmm14 - vaddpd xmm12, xmm12, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2112] - vaddpd xmm13, xmm13, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2240] + vaddpd xmm12, xmm12, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] + vaddpd xmm13, xmm13, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] vmulpd xmm12, xmm12, xmm14 vaddpd xmm12, xmm13, xmm12 vmulpd xmm13, xmm5, xmm15 vmulpd xmm14, xmm14, xmm12 vaddpd xmm2, xmm2, xmm14 - vmovupd xmm14, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2752] + vmovupd xmm14, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] vandpd xmm0, xmm5, xmm3 vandpd xmm3, xmm14, xmm3 vcmplepd xmm12, xmm0, xmm3 @@ -394,19 +394,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_expm12_ha_e9 ENDP +__jsvml_expm12_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm12_ha_e9_B1_B3: +_unwind___jsvml_expm12_ha_e9_B1_B3: DD 936705 DD 2282571 DD 813123 @@ -423,19 +423,19 @@ _unwind___svml_expm12_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_expm12_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm12_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm12_ha_e9_B6_B10: +_unwind___jsvml_expm12_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_expm12_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm12_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -444,7 +444,7 @@ _unwind___svml_expm12_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_expm12_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_expm12_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -458,9 +458,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm12_ha_l9 + PUBLIC __jsvml_expm12_ha_l9 -__svml_expm12_ha_l9 PROC EXPORT +__jsvml_expm12_ha_l9 PROC EXPORT _B3_1:: @@ -480,47 +480,47 @@ L45:: vmovups XMMWORD PTR [192+rsp], xmm6 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmulpd xmm6, xmm1, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2304] + vmulpd xmm6, xmm1, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] vroundpd xmm6, xmm6, 0 and r13, -64 - vaddpd xmm8, xmm6, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2496] - vmulpd xmm2, xmm6, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2432] - vmovupd xmm0, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2368] - vmovupd xmm3, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2816] - vandps xmm7, xmm8, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2560] + vaddpd xmm8, xmm6, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] + vmulpd xmm2, xmm6, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] + vmovupd xmm0, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] + vmovupd xmm3, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] + vandps xmm7, xmm8, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] vandpd xmm5, xmm1, xmm3 vfnmadd213pd xmm0, xmm6, xmm1 vandnpd xmm4, xmm3, xmm1 - vpand xmm8, xmm8, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2624] + vpand xmm8, xmm8, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] vpsllq xmm8, xmm8, 41 vmovd eax, xmm7 - vcmpnlepd xmm5, xmm5, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2880] + vcmpnlepd xmm5, xmm5, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] vcmpeqpd xmm15, xmm0, xmm1 vsubpd xmm9, xmm0, xmm2 vmovmskpd edx, xmm5 - vorpd xmm15, xmm15, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2688] + vorpd xmm15, xmm15, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] vpextrd ecx, xmm7, 2 vandpd xmm15, xmm0, xmm15 movsxd rax, eax movsxd rcx, ecx vsubpd xmm0, xmm0, xmm15 - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+r8+rax] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+r8+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+r8+rax] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+r8+rcx] vunpcklpd xmm7, xmm5, xmm6 vunpckhpd xmm6, xmm5, xmm6 vorpd xmm5, xmm7, xmm8 vmulpd xmm6, xmm6, xmm8 vsubpd xmm0, xmm0, xmm2 vmulpd xmm2, xmm5, xmm15 - vmovupd xmm7, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2048] - vmovupd xmm8, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2176] - vfmadd213pd xmm7, xmm9, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2112] - vfmadd213pd xmm8, xmm9, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2240] + vmovupd xmm7, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] + vmovupd xmm8, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] + vfmadd213pd xmm7, xmm9, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] + vfmadd213pd xmm8, xmm9, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] vmulpd xmm9, xmm9, xmm9 vfmadd213pd xmm7, xmm9, xmm8 vandpd xmm8, xmm5, xmm3 vfmadd213pd xmm7, xmm9, xmm0 - vmovupd xmm9, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2752] + vmovupd xmm9, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] vandpd xmm3, xmm9, xmm3 vcmplepd xmm0, xmm8, xmm3 vaddpd xmm3, xmm5, xmm9 @@ -589,19 +589,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_expm12_ha_l9 ENDP +__jsvml_expm12_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm12_ha_l9_B1_B3: +_unwind___jsvml_expm12_ha_l9_B1_B3: DD 936705 DD 2282571 DD 813123 @@ -618,19 +618,19 @@ _unwind___svml_expm12_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_expm12_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm12_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm12_ha_l9_B6_B10: +_unwind___jsvml_expm12_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_expm12_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm12_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -639,7 +639,7 @@ _unwind___svml_expm12_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_expm12_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_expm12_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -653,9 +653,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm11_ha_ex + PUBLIC __jsvml_expm11_ha_ex -__svml_expm11_ha_ex PROC EXPORT +__jsvml_expm11_ha_ex PROC EXPORT _B4_1:: @@ -677,53 +677,53 @@ L62:: movups XMMWORD PTR [256+rsp], xmm7 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - mulsd xmm3, QWORD PTR [__svml_dexpm1_ha_data_internal+2304] + mulsd xmm3, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] and r13, -64 movups xmm4, XMMWORD PTR [_2il0floatpacket_33] addpd xmm3, xmm4 subpd xmm3, xmm4 movaps xmm5, xmm3 movaps xmm8, xmm3 - mulsd xmm5, QWORD PTR [__svml_dexpm1_ha_data_internal+2368] - addsd xmm3, QWORD PTR [__svml_dexpm1_ha_data_internal+2496] - mulsd xmm8, QWORD PTR [__svml_dexpm1_ha_data_internal+2432] + mulsd xmm5, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] + addsd xmm3, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] + mulsd xmm8, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] subsd xmm0, xmm5 movaps xmm1, xmm0 movaps xmm11, xmm0 - movq xmm7, QWORD PTR [__svml_dexpm1_ha_data_internal+2560] + movq xmm7, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] subsd xmm1, xmm8 cmpeqsd xmm11, xmm10 pand xmm7, xmm3 movd eax, xmm7 - movsd xmm7, QWORD PTR [__svml_dexpm1_ha_data_internal+2048] - movsd xmm2, QWORD PTR [__svml_dexpm1_ha_data_internal+2816] + movsd xmm7, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] + movsd xmm2, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] mulsd xmm7, xmm1 movaps xmm4, xmm2 - movq xmm12, QWORD PTR [__svml_dexpm1_ha_data_internal+2624] + movq xmm12, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] andps xmm4, xmm10 pand xmm3, xmm12 movaps xmm9, xmm2 - movsd xmm12, QWORD PTR [__svml_dexpm1_ha_data_internal+2176] + movsd xmm12, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] psllq xmm3, 41 movsxd rax, eax andnps xmm9, xmm10 mulsd xmm12, xmm1 - cmpnlesd xmm4, QWORD PTR [__svml_dexpm1_ha_data_internal+2880] - addsd xmm7, QWORD PTR [__svml_dexpm1_ha_data_internal+2112] + cmpnlesd xmm4, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] + addsd xmm7, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] mulsd xmm1, xmm1 movmskpd ecx, xmm4 - addsd xmm12, QWORD PTR [__svml_dexpm1_ha_data_internal+2240] + addsd xmm12, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] mulsd xmm7, xmm1 - movsd xmm4, QWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+8+rdx+rax] + movsd xmm4, QWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+8+rdx+rax] and ecx, 1 - movups xmm5, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rdx+rax] + movups xmm5, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rdx+rax] addsd xmm7, xmm12 unpcklpd xmm4, xmm4 orps xmm5, xmm3 mulsd xmm4, xmm3 movaps xmm12, xmm2 mulsd xmm7, xmm1 - movsd xmm3, QWORD PTR [__svml_dexpm1_ha_data_internal+2688] + movsd xmm3, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] andps xmm12, xmm5 orps xmm3, xmm11 andps xmm3, xmm0 @@ -733,7 +733,7 @@ L62:: movaps xmm8, xmm5 mulsd xmm8, xmm3 addsd xmm7, xmm0 - movsd xmm0, QWORD PTR [__svml_dexpm1_ha_data_internal+2752] + movsd xmm0, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] andps xmm2, xmm0 movaps xmm1, xmm0 cmplesd xmm12, xmm2 @@ -792,19 +792,19 @@ _B4_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B4_4 ALIGN 16 _B4_7:: -__svml_expm11_ha_ex ENDP +__jsvml_expm11_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm11_ha_ex_B1_B6: +_unwind___jsvml_expm11_ha_ex_B1_B6: DD 1070849 DD 1430615 DD 1079375 @@ -822,7 +822,7 @@ _unwind___svml_expm11_ha_ex_B1_B6: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_expm11_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_expm11_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -836,9 +836,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm12_ha_ex + PUBLIC __jsvml_expm12_ha_ex -__svml_expm12_ha_ex PROC EXPORT +__jsvml_expm12_ha_ex PROC EXPORT _B5_1:: @@ -858,64 +858,64 @@ L77:: movaps xmm6, xmm0 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm4, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2304] + movups xmm4, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] and r13, -64 mulpd xmm4, xmm6 movups xmm2, XMMWORD PTR [_2il0floatpacket_33] addpd xmm4, xmm2 subpd xmm4, xmm2 - movups xmm3, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2368] + movups xmm3, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] movaps xmm2, xmm6 mulpd xmm3, xmm4 - movups xmm0, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2816] - movups xmm10, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2496] + movups xmm0, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] + movups xmm10, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] movaps xmm1, xmm0 addpd xmm10, xmm4 subpd xmm2, xmm3 andps xmm1, xmm6 movaps xmm8, xmm2 - cmpnlepd xmm1, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2880] - movups xmm7, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2432] + cmpnlepd xmm1, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] + movups xmm7, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] movaps xmm3, xmm2 mulpd xmm7, xmm4 movmskpd eax, xmm1 - movdqu xmm9, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2560] + movdqu xmm9, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] movaps xmm5, xmm0 pand xmm9, xmm10 andnps xmm5, xmm6 movd edx, xmm9 pshufd xmm1, xmm9, 2 - pand xmm10, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2624] + pand xmm10, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] movd ecx, xmm1 psllq xmm10, 41 subpd xmm8, xmm7 cmpeqpd xmm3, xmm6 movsxd rdx, edx movsxd rcx, ecx - orps xmm3, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2688] + orps xmm3, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] andps xmm3, xmm2 - movups xmm4, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+r8+rdx] - movups xmm9, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+r8+rcx] + movups xmm4, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+r8+rdx] + movups xmm9, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+r8+rcx] movaps xmm1, xmm4 unpcklpd xmm1, xmm9 unpckhpd xmm4, xmm9 orps xmm1, xmm10 mulpd xmm4, xmm10 subpd xmm2, xmm3 - movups xmm10, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2048] + movups xmm10, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] mulpd xmm10, xmm8 subpd xmm2, xmm7 - addpd xmm10, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2112] - movups xmm9, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2176] + addpd xmm10, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] + movups xmm9, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] movaps xmm7, xmm1 mulpd xmm9, xmm8 mulpd xmm8, xmm8 - addpd xmm9, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2240] + addpd xmm9, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] mulpd xmm10, xmm8 mulpd xmm7, xmm3 addpd xmm9, xmm10 mulpd xmm8, xmm9 - movups xmm10, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2752] + movups xmm10, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] movaps xmm9, xmm0 andps xmm9, xmm1 andps xmm0, xmm10 @@ -1000,19 +1000,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_expm12_ha_ex ENDP +__jsvml_expm12_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm12_ha_ex_B1_B3: +_unwind___jsvml_expm12_ha_ex_B1_B3: DD 935937 DD 2282568 DD 1075261 @@ -1029,19 +1029,19 @@ _unwind___svml_expm12_ha_ex_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_expm12_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_expm12_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm12_ha_ex_B6_B10: +_unwind___jsvml_expm12_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_expm12_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_expm12_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1050,7 +1050,7 @@ _unwind___svml_expm12_ha_ex_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_expm12_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_expm12_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1064,9 +1064,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm11_ha_l9 + PUBLIC __jsvml_expm11_ha_l9 -__svml_expm11_ha_l9 PROC EXPORT +__jsvml_expm11_ha_l9 PROC EXPORT _B6_1:: @@ -1087,42 +1087,42 @@ L94:: vmovups XMMWORD PTR [176+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmulsd xmm3, xmm4, QWORD PTR [__svml_dexpm1_ha_data_internal+2304] + vmulsd xmm3, xmm4, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] and r13, -64 vroundsd xmm1, xmm3, xmm3, 0 - vmovsd xmm2, QWORD PTR [__svml_dexpm1_ha_data_internal+2816] + vmovsd xmm2, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] vmovapd xmm13, xmm1 - vmovq xmm6, QWORD PTR [__svml_dexpm1_ha_data_internal+2560] + vmovq xmm6, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] vandpd xmm5, xmm4, xmm2 - vfnmadd132sd xmm13, xmm4, QWORD PTR [__svml_dexpm1_ha_data_internal+2368] + vfnmadd132sd xmm13, xmm4, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] vandnpd xmm3, xmm2, xmm4 - vmulsd xmm14, xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2432] - vaddsd xmm10, xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2496] - vcmpnlesd xmm0, xmm5, QWORD PTR [__svml_dexpm1_ha_data_internal+2880] + vmulsd xmm14, xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] + vaddsd xmm10, xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] + vcmpnlesd xmm0, xmm5, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] vcmpeqsd xmm9, xmm13, xmm4 vsubsd xmm15, xmm13, xmm14 vmovmskpd ecx, xmm0 vpand xmm5, xmm10, xmm6 vmovd eax, xmm5 - vmovq xmm0, QWORD PTR [__svml_dexpm1_ha_data_internal+2624] + vmovq xmm0, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] vpand xmm6, xmm10, xmm0 movsxd rax, eax vpsllq xmm5, xmm6, 41 - vmovsd xmm10, QWORD PTR [__svml_dexpm1_ha_data_internal+2176] - vfmadd213sd xmm10, xmm15, QWORD PTR [__svml_dexpm1_ha_data_internal+2240] + vmovsd xmm10, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] + vfmadd213sd xmm10, xmm15, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] vmulsd xmm0, xmm15, xmm15 - vmovddup xmm1, QWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+8+rdx+rax] - vorpd xmm6, xmm5, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rdx+rax] + vmovddup xmm1, QWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+8+rdx+rax] + vorpd xmm6, xmm5, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rdx+rax] vmulsd xmm1, xmm1, xmm5 - vmovsd xmm5, QWORD PTR [__svml_dexpm1_ha_data_internal+2048] - vfmadd213sd xmm5, xmm15, QWORD PTR [__svml_dexpm1_ha_data_internal+2112] - vmovsd xmm15, QWORD PTR [__svml_dexpm1_ha_data_internal+2688] + vmovsd xmm5, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] + vfmadd213sd xmm5, xmm15, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] + vmovsd xmm15, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] vorpd xmm9, xmm15, xmm9 vandpd xmm9, xmm13, xmm9 vmulsd xmm15, xmm6, xmm9 vsubsd xmm13, xmm13, xmm9 vfmadd213sd xmm5, xmm0, xmm10 - vmovsd xmm10, QWORD PTR [__svml_dexpm1_ha_data_internal+2752] + vmovsd xmm10, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] vsubsd xmm14, xmm13, xmm14 vfmadd213sd xmm5, xmm0, xmm14 vandpd xmm0, xmm6, xmm2 @@ -1175,19 +1175,19 @@ _B6_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_expm11_ha_l9 ENDP +__jsvml_expm11_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm11_ha_l9_B1_B6: +_unwind___jsvml_expm11_ha_l9_B1_B6: DD 1070081 DD 1430612 DD 747596 @@ -1205,7 +1205,7 @@ _unwind___svml_expm11_ha_l9_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_expm11_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_expm11_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1219,9 +1219,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm14_ha_e9 + PUBLIC __jsvml_expm14_ha_e9 -__svml_expm14_ha_e9 PROC EXPORT +__jsvml_expm14_ha_e9 PROC EXPORT _B7_1:: @@ -1246,23 +1246,23 @@ L109:: lea r13, QWORD PTR [143+rsp] vmovapd ymm9, ymm0 and r13, -64 - vmulpd ymm4, ymm9, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2304] + vmulpd ymm4, ymm9, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] vroundpd ymm12, ymm4, 0 - vmovupd ymm4, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2816] - vmulpd ymm2, ymm12, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2368] + vmovupd ymm4, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] + vmulpd ymm2, ymm12, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] vandpd ymm5, ymm9, ymm4 - vcmpnle_uqpd ymm11, ymm5, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2880] - vmovupd xmm5, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2560] + vcmpnle_uqpd ymm11, ymm5, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] + vmovupd xmm5, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] vsubpd ymm3, ymm9, ymm2 - vmulpd ymm2, ymm12, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2432] + vmulpd ymm2, ymm12, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] vcmpeqpd ymm1, ymm3, ymm9 vsubpd ymm0, ymm3, ymm2 - vorpd ymm1, ymm1, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2688] + vorpd ymm1, ymm1, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] vandnpd ymm8, ymm4, ymm9 mov QWORD PTR [536+rsp], r13 vextractf128 xmm10, ymm11, 1 vshufps xmm7, xmm11, xmm10, 221 - vaddpd ymm11, ymm12, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2496] + vaddpd ymm11, ymm12, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] vmovmskps edx, xmm7 vandps xmm13, xmm11, xmm5 vextractf128 xmm14, ymm11, 1 @@ -1275,13 +1275,13 @@ L109:: vpextrd r10d, xmm10, 2 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+rcx] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+r8] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+r9] - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rax+r10] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+r8] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+r9] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rax+r10] vunpcklpd xmm7, xmm15, xmm5 vunpckhpd xmm15, xmm15, xmm5 - vmovupd xmm5, XMMWORD PTR [__svml_dexpm1_ha_data_internal+2624] + vmovupd xmm5, XMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] vunpcklpd xmm10, xmm13, xmm12 vandps xmm11, xmm11, xmm5 vandps xmm14, xmm14, xmm5 @@ -1290,18 +1290,18 @@ L109:: vpsllq xmm12, xmm11, 41 vpsllq xmm11, xmm14, 41 vinsertf128 ymm13, ymm12, xmm11, 1 - vmulpd ymm11, ymm0, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2176] + vmulpd ymm11, ymm0, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] vorpd ymm5, ymm7, ymm13 vinsertf128 ymm10, ymm15, xmm10, 1 vmulpd ymm7, ymm10, ymm13 - vmulpd ymm10, ymm0, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2048] - vaddpd ymm15, ymm11, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2240] + vmulpd ymm10, ymm0, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] + vaddpd ymm15, ymm11, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] vmulpd ymm11, ymm0, ymm0 - vaddpd ymm14, ymm10, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2112] + vaddpd ymm14, ymm10, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] vandpd ymm0, ymm3, ymm1 vsubpd ymm10, ymm3, ymm0 vmulpd ymm3, ymm14, ymm11 - vmovupd ymm14, YMMWORD PTR [__svml_dexpm1_ha_data_internal+2752] + vmovupd ymm14, YMMWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] vmulpd ymm13, ymm5, ymm0 vaddpd ymm12, ymm15, ymm3 vsubpd ymm1, ymm10, ymm2 @@ -1384,19 +1384,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_expm14_ha_e9 ENDP +__jsvml_expm14_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm14_ha_e9_B1_B3: +_unwind___jsvml_expm14_ha_e9_B1_B3: DD 1469185 DD 4379755 DD 2062435 @@ -1417,20 +1417,20 @@ _unwind___svml_expm14_ha_e9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_expm14_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm14_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm14_ha_e9_B6_B10: +_unwind___jsvml_expm14_ha_e9_B6_B10: DD 398369 DD 549908 DD 603149 DD 157704 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_expm14_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm14_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1439,7 +1439,7 @@ _unwind___svml_expm14_ha_e9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_expm14_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_expm14_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1453,9 +1453,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm18_ha_z0 + PUBLIC __jsvml_expm18_ha_z0 -__svml_expm18_ha_z0 PROC EXPORT +__jsvml_expm18_ha_z0 PROC EXPORT _B8_1:: @@ -1468,47 +1468,47 @@ L136:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm24, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+256] + vmovups zmm24, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+256] and r13, -64 - vmovups zmm23, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+320] - vmovups zmm25, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+512] - vmovups zmm26, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+576] - vmovups zmm28, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+640] - vmovups zmm22, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+384] - vmovups zmm29, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512] - vmovups zmm4, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+128] + vmovups zmm23, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+320] + vmovups zmm25, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+512] + vmovups zmm26, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+576] + vmovups zmm28, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+640] + vmovups zmm22, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+384] + vmovups zmm29, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512] + vmovups zmm4, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+128] vmovaps zmm5, zmm0 vfmadd213pd zmm24, zmm5, zmm23 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+704] + vmovups zmm0, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+704] vcmppd k0, zmm5, zmm22, 21 {sae} - vmovups zmm22, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+768] + vmovups zmm22, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+768] vsubpd zmm27, zmm24, zmm23 {rn-sae} - vpermt2pd zmm29, zmm24, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+64] - vpermt2pd zmm4, zmm24, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+192] + vpermt2pd zmm29, zmm24, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+64] + vpermt2pd zmm4, zmm24, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+192] vfnmadd213pd zmm25, zmm27, zmm5 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+896] - vmovups zmm24, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+1024] + vmovups zmm23, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+896] + vmovups zmm24, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+1024] vmaxpd zmm30, zmm27, zmm28 {sae} kmovw r8d, k0 vscalefpd zmm3, zmm29, zmm30 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+1216] + vmovups zmm30, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+1216] vmovaps zmm31, zmm27 vfnmadd213pd zmm31, zmm26, zmm25 {rn-sae} vcmppd k1, zmm3, zmm30, 17 {sae} vsubpd zmm1, zmm25, zmm31 {rn-sae} vandpd zmm2, zmm31, zmm0 - vmovups zmm25, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+960] + vmovups zmm25, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+960] vfnmadd231pd zmm1, zmm26, zmm27 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+1088] - vmovups zmm27, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+1152] - vmovups zmm31, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+1280] + vmovups zmm26, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+1088] + vmovups zmm27, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+1152] + vmovups zmm31, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+1280] vfmadd231pd zmm25, zmm23, zmm2 {rn-sae} vfmadd231pd zmm26, zmm24, zmm2 {rn-sae} vblendmpd zmm23{k1}, zmm31, zmm3 vandpd zmm28, zmm1, zmm0 vaddpd zmm24, zmm3, zmm31 {rn-sae} vmulpd zmm0, zmm2, zmm2 {rn-sae} - vmovups zmm1, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+832] + vmovups zmm1, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+832] vaddpd zmm29, zmm28, zmm4 {rn-sae} vfmadd231pd zmm1, zmm22, zmm2 {rn-sae} vfmadd213pd zmm4, zmm2, zmm29 {rn-sae} @@ -1527,7 +1527,7 @@ L136:: vaddpd zmm2, zmm3, zmm4 {rn-sae} vaddpd zmm0, zmm0, zmm2 {rn-sae} mov QWORD PTR [1328+rsp], r13 - vpternlogq zmm0, zmm5, ZMMWORD PTR [__svml_dexpm1_ha_data_internal_avx512+448], 248 + vpternlogq zmm0, zmm5, ZMMWORD PTR [__jsvml_dexpm1_ha_data_internal_avx512+448], 248 test r8d, r8d jne _B8_3 @@ -1659,19 +1659,19 @@ _B8_15:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B8_13 ALIGN 16 _B8_16:: -__svml_expm18_ha_z0 ENDP +__jsvml_expm18_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm18_ha_z0_B1_B9: +_unwind___jsvml_expm18_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -1683,13 +1683,13 @@ _unwind___svml_expm18_ha_z0_B1_B9: DD imagerel _B8_1 DD imagerel _B8_11 - DD imagerel _unwind___svml_expm18_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_expm18_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm18_ha_z0_B11_B15: +_unwind___jsvml_expm18_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -1725,7 +1725,7 @@ _unwind___svml_expm18_ha_z0_B11_B15: DD imagerel _B8_11 DD imagerel _B8_16 - DD imagerel _unwind___svml_expm18_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_expm18_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1739,9 +1739,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm11_ha_e9 + PUBLIC __jsvml_expm11_ha_e9 -__svml_expm11_ha_e9 PROC EXPORT +__jsvml_expm11_ha_e9 PROC EXPORT _B9_1:: @@ -1762,44 +1762,44 @@ L187:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm11, QWORD PTR [__svml_dexpm1_ha_data_internal+2816] + vmovsd xmm11, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2816] and r13, -64 - vmulsd xmm12, xmm13, QWORD PTR [__svml_dexpm1_ha_data_internal+2304] + vmulsd xmm12, xmm13, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2304] vandpd xmm5, xmm13, xmm11 - vcmpnlesd xmm6, xmm5, QWORD PTR [__svml_dexpm1_ha_data_internal+2880] + vcmpnlesd xmm6, xmm5, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2880] vroundsd xmm1, xmm12, xmm12, 0 vandnpd xmm12, xmm11, xmm13 - vmulsd xmm3, xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2368] - vmulsd xmm2, xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2432] + vmulsd xmm3, xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2368] + vmulsd xmm2, xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2432] vmovmskpd ecx, xmm6 - vaddsd xmm6, xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2496] + vaddsd xmm6, xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2496] vsubsd xmm0, xmm13, xmm3 - vmovq xmm4, QWORD PTR [__svml_dexpm1_ha_data_internal+2560] + vmovq xmm4, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2560] vsubsd xmm14, xmm0, xmm2 vcmpeqsd xmm15, xmm0, xmm13 vpand xmm3, xmm6, xmm4 vmovd eax, xmm3 - vmovq xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2624] + vmovq xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2624] vpand xmm4, xmm6, xmm1 movsxd rax, eax vpsllq xmm3, xmm4, 41 - vmovsd xmm1, QWORD PTR [__svml_dexpm1_ha_data_internal+2048] + vmovsd xmm1, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2048] vmulsd xmm4, xmm1, xmm14 - vmovddup xmm5, QWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+8+rdx+rax] - vorpd xmm6, xmm3, XMMWORD PTR [imagerel(__svml_dexpm1_ha_data_internal)+rdx+rax] + vmovddup xmm5, QWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+8+rdx+rax] + vorpd xmm6, xmm3, XMMWORD PTR [imagerel(__jsvml_dexpm1_ha_data_internal)+rdx+rax] vmulsd xmm5, xmm5, xmm3 - vaddsd xmm4, xmm4, QWORD PTR [__svml_dexpm1_ha_data_internal+2112] - vmovsd xmm3, QWORD PTR [__svml_dexpm1_ha_data_internal+2176] + vaddsd xmm4, xmm4, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2112] + vmovsd xmm3, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2176] vmulsd xmm3, xmm3, xmm14 mov QWORD PTR [272+rsp], r13 - vaddsd xmm1, xmm3, QWORD PTR [__svml_dexpm1_ha_data_internal+2240] + vaddsd xmm1, xmm3, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2240] vmulsd xmm3, xmm14, xmm14 - vmovsd xmm14, QWORD PTR [__svml_dexpm1_ha_data_internal+2688] + vmovsd xmm14, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2688] vorpd xmm15, xmm14, xmm15 vandpd xmm15, xmm0, xmm15 vsubsd xmm14, xmm0, xmm15 vmulsd xmm0, xmm4, xmm3 - vmovsd xmm4, QWORD PTR [__svml_dexpm1_ha_data_internal+2752] + vmovsd xmm4, QWORD PTR [__jsvml_dexpm1_ha_data_internal+2752] vaddsd xmm0, xmm0, xmm1 vsubsd xmm1, xmm14, xmm2 vmulsd xmm2, xmm6, xmm15 @@ -1856,19 +1856,19 @@ _B9_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dexpm1_ha_cout_rare_internal + call __jsvml_dexpm1_ha_cout_rare_internal jmp _B9_4 ALIGN 16 _B9_7:: -__svml_expm11_ha_e9 ENDP +__jsvml_expm11_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm11_ha_e9_B1_B6: +_unwind___jsvml_expm11_ha_e9_B1_B6: DD 1070081 DD 1430612 DD 1075276 @@ -1886,7 +1886,7 @@ _unwind___svml_expm11_ha_e9_B1_B6: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_expm11_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_expm11_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1900,9 +1900,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dexpm1_ha_cout_rare_internal + PUBLIC __jsvml_dexpm1_ha_cout_rare_internal -__svml_dexpm1_ha_cout_rare_internal PROC +__jsvml_dexpm1_ha_cout_rare_internal PROC _B10_1:: @@ -2168,13 +2168,13 @@ _B10_23:: _B10_24:: -__svml_dexpm1_ha_cout_rare_internal ENDP +__jsvml_dexpm1_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dexpm1_ha_cout_rare_internal_B1_B23: +_unwind___jsvml_dexpm1_ha_cout_rare_internal_B1_B23: DD 67585 DD 49672 @@ -2185,7 +2185,7 @@ _unwind___svml_dexpm1_ha_cout_rare_internal_B1_B23: DD imagerel _B10_1 DD imagerel _B10_24 - DD imagerel _unwind___svml_dexpm1_ha_cout_rare_internal_B1_B23 + DD imagerel _unwind___jsvml_dexpm1_ha_cout_rare_internal_B1_B23 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2193,8 +2193,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dexpm1_ha_data_internal_avx512 -__svml_dexpm1_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dexpm1_ha_data_internal_avx512 +__jsvml_dexpm1_ha_data_internal_avx512 DD 0 DD 1072693248 DD 1828292879 DD 1072739672 @@ -2530,8 +2530,8 @@ __svml_dexpm1_ha_data_internal_avx512 DD 0 DD 3220176896 DD 0 DD 3220176896 - PUBLIC __svml_dexpm1_ha_data_internal -__svml_dexpm1_ha_data_internal DD 0 + PUBLIC __jsvml_dexpm1_ha_data_internal +__jsvml_dexpm1_ha_data_internal DD 0 DD 0 DD 0 DD 0 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_hypot_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_hypot_windows_x86.S similarity index 87% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_hypot_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_hypot_windows_x86.S index 4f9d92f23e7..225d3b41991 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_hypot_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_hypot_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot2_ha_e9 + PUBLIC __jsvml_hypot2_ha_e9 -__svml_hypot2_ha_e9 PROC EXPORT +__jsvml_hypot2_ha_e9 PROC EXPORT _B1_1:: @@ -57,7 +57,7 @@ L1:: vmovapd xmm10, xmm1 mov QWORD PTR [320+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm4, XMMWORD PTR [__svml_dhypot_ha_data_internal+64] + vmovupd xmm4, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 vandpd xmm5, xmm0, xmm4 vandpd xmm3, xmm10, xmm4 @@ -65,10 +65,10 @@ L1:: vminpd xmm2, xmm3, xmm5 vpshufd xmm14, xmm1, 221 vpshufd xmm15, xmm2, 221 - vmovq xmm5, QWORD PTR [__svml_dhypot_ha_data_internal+512] + vmovq xmm5, QWORD PTR [__jsvml_dhypot_ha_data_internal+512] vpsubd xmm14, xmm14, xmm15 vpcmpgtd xmm5, xmm14, xmm5 - vmovupd xmm11, XMMWORD PTR [__svml_dhypot_ha_data_internal] + vmovupd xmm11, XMMWORD PTR [__jsvml_dhypot_ha_data_internal] vpshufd xmm5, xmm5, 80 vandpd xmm3, xmm1, xmm11 vandnpd xmm11, xmm5, xmm11 @@ -85,11 +85,11 @@ L1:: vaddpd xmm5, xmm5, xmm11 vaddpd xmm15, xmm4, xmm14 vaddpd xmm2, xmm5, xmm15 - vmovq xmm3, QWORD PTR [__svml_dhypot_ha_data_internal+640] + vmovq xmm3, QWORD PTR [__jsvml_dhypot_ha_data_internal+640] vpshufd xmm1, xmm2, 221 vpcmpgtd xmm14, xmm1, xmm3 vcvtpd2ps xmm3, xmm2 - vmovq xmm11, QWORD PTR [__svml_dhypot_ha_data_internal+576] + vmovq xmm11, QWORD PTR [__jsvml_dhypot_ha_data_internal+576] vpcmpgtd xmm4, xmm11, xmm1 vpor xmm11, xmm4, xmm14 vmovlhps xmm4, xmm3, xmm3 @@ -100,18 +100,18 @@ L1:: vmulpd xmm1, xmm14, xmm14 vmulpd xmm11, xmm5, xmm1 vmulpd xmm4, xmm15, xmm1 - vsubpd xmm3, xmm11, XMMWORD PTR [__svml_dhypot_ha_data_internal+128] + vsubpd xmm3, xmm11, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+128] vmulpd xmm15, xmm14, xmm15 vaddpd xmm11, xmm3, xmm4 vmulpd xmm5, xmm14, xmm5 - vmulpd xmm1, xmm11, XMMWORD PTR [__svml_dhypot_ha_data_internal+192] - vaddpd xmm3, xmm1, XMMWORD PTR [__svml_dhypot_ha_data_internal+256] + vmulpd xmm1, xmm11, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+192] + vaddpd xmm3, xmm1, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+256] vmulpd xmm4, xmm11, xmm3 - vaddpd xmm1, xmm4, XMMWORD PTR [__svml_dhypot_ha_data_internal+320] + vaddpd xmm1, xmm4, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+320] vmulpd xmm3, xmm11, xmm1 - vaddpd xmm4, xmm3, XMMWORD PTR [__svml_dhypot_ha_data_internal+384] + vaddpd xmm4, xmm3, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+384] vmulpd xmm1, xmm11, xmm4 - vaddpd xmm3, xmm1, XMMWORD PTR [__svml_dhypot_ha_data_internal+448] + vaddpd xmm3, xmm1, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+448] vmulpd xmm11, xmm11, xmm3 vmulpd xmm1, xmm14, xmm11 vmulpd xmm2, xmm2, xmm1 @@ -170,19 +170,19 @@ _B1_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_hypot2_ha_e9 ENDP +__jsvml_hypot2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot2_ha_e9_B1_B3: +_unwind___jsvml_hypot2_ha_e9_B1_B3: DD 801537 DD 2675771 DD 1222703 @@ -198,19 +198,19 @@ _unwind___svml_hypot2_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_hypot2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypot2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot2_ha_e9_B6_B10: +_unwind___jsvml_hypot2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_hypot2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypot2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -219,7 +219,7 @@ _unwind___svml_hypot2_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_hypot2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_hypot2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -233,9 +233,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot4_ha_e9 + PUBLIC __jsvml_hypot4_ha_e9 -__svml_hypot4_ha_e9 PROC EXPORT +__jsvml_hypot4_ha_e9 PROC EXPORT _B2_1:: @@ -252,10 +252,10 @@ L16:: vmovups YMMWORD PTR [528+rsp], ymm6 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [303+rsp] - vmovupd ymm2, YMMWORD PTR [__svml_dhypot_ha_data_internal+64] + vmovupd ymm2, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 vmovapd ymm14, ymm1 - vmovupd ymm1, YMMWORD PTR [__svml_dhypot_ha_data_internal] + vmovupd ymm1, YMMWORD PTR [__jsvml_dhypot_ha_data_internal] vandpd ymm4, ymm0, ymm2 vandpd ymm12, ymm14, ymm2 vmaxpd ymm6, ymm4, ymm12 @@ -268,7 +268,7 @@ L16:: vshufps xmm12, xmm6, xmm12, 221 vshufps xmm15, xmm4, xmm2, 221 vpsubd xmm2, xmm12, xmm15 - vpcmpgtd xmm15, xmm2, XMMWORD PTR [__svml_dhypot_ha_data_internal+512] + vpcmpgtd xmm15, xmm2, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+512] vpshufd xmm12, xmm15, 80 vpshufd xmm2, xmm15, 250 vinsertf128 ymm12, ymm12, xmm2, 1 @@ -283,12 +283,12 @@ L16:: vmulpd ymm3, ymm3, ymm5 vaddpd ymm5, ymm3, ymm4 vmulpd ymm3, ymm1, ymm15 - vmovups xmm1, XMMWORD PTR [__svml_dhypot_ha_data_internal+576] + vmovups xmm1, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+576] vaddpd ymm5, ymm5, ymm3 vaddpd ymm3, ymm12, ymm5 vextractf128 xmm15, ymm3, 1 vshufps xmm6, xmm3, xmm15, 221 - vpcmpgtd xmm15, xmm6, XMMWORD PTR [__svml_dhypot_ha_data_internal+640] + vpcmpgtd xmm15, xmm6, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+640] vpcmpgtd xmm4, xmm1, xmm6 vpor xmm1, xmm4, xmm15 vcvtpd2ps xmm15, ymm3 @@ -303,16 +303,16 @@ L16:: vmulpd ymm1, ymm5, ymm6 vmulpd ymm5, ymm4, ymm5 vmulpd ymm12, ymm4, ymm12 - vsubpd ymm15, ymm2, YMMWORD PTR [__svml_dhypot_ha_data_internal+128] + vsubpd ymm15, ymm2, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+128] vaddpd ymm15, ymm15, ymm1 - vmulpd ymm2, ymm15, YMMWORD PTR [__svml_dhypot_ha_data_internal+192] - vaddpd ymm6, ymm2, YMMWORD PTR [__svml_dhypot_ha_data_internal+256] + vmulpd ymm2, ymm15, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+192] + vaddpd ymm6, ymm2, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+256] vmulpd ymm1, ymm15, ymm6 - vaddpd ymm2, ymm1, YMMWORD PTR [__svml_dhypot_ha_data_internal+320] + vaddpd ymm2, ymm1, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+320] vmulpd ymm6, ymm15, ymm2 - vaddpd ymm1, ymm6, YMMWORD PTR [__svml_dhypot_ha_data_internal+384] + vaddpd ymm1, ymm6, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+384] vmulpd ymm2, ymm15, ymm1 - vaddpd ymm6, ymm2, YMMWORD PTR [__svml_dhypot_ha_data_internal+448] + vaddpd ymm6, ymm2, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+448] vmulpd ymm15, ymm15, ymm6 vmulpd ymm1, ymm4, ymm15 vmulpd ymm3, ymm3, ymm1 @@ -383,19 +383,19 @@ _B2_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_hypot4_ha_e9 ENDP +__jsvml_hypot4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot4_ha_e9_B1_B3: +_unwind___jsvml_hypot4_ha_e9_B1_B3: DD 800513 DD 4903991 DD 2189359 @@ -411,13 +411,13 @@ _unwind___svml_hypot4_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_hypot4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypot4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot4_ha_e9_B6_B10: +_unwind___jsvml_hypot4_ha_e9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -429,7 +429,7 @@ _unwind___svml_hypot4_ha_e9_B6_B10: DD 817163 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_hypot4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypot4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -438,7 +438,7 @@ _unwind___svml_hypot4_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_hypot4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_hypot4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -452,9 +452,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot1_ha_l9 + PUBLIC __jsvml_hypot1_ha_l9 -__svml_hypot1_ha_l9 PROC EXPORT +__jsvml_hypot1_ha_l9 PROC EXPORT _B3_1:: @@ -477,7 +477,7 @@ L43:: vmovups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [232+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+64] + vmovsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 vandpd xmm5, xmm2, xmm1 vandpd xmm6, xmm4, xmm1 @@ -487,7 +487,7 @@ L43:: vminpd xmm15, xmm15, xmm7 vpshufd xmm1, xmm5, 85 vpshufd xmm6, xmm15, 85 - vmovsd xmm0, QWORD PTR [__svml_dhypot_ha_data_internal] + vmovsd xmm0, QWORD PTR [__jsvml_dhypot_ha_data_internal] vpsubd xmm7, xmm1, xmm6 vmovd xmm1, eax vandpd xmm9, xmm5, xmm0 @@ -505,7 +505,7 @@ L43:: vfmadd213sd xmm5, xmm15, xmm10 vmovd xmm10, ecx vfmadd213sd xmm0, xmm7, xmm6 - vmovsd xmm3, QWORD PTR [__svml_dhypot_ha_data_internal+192] + vmovsd xmm3, QWORD PTR [__jsvml_dhypot_ha_data_internal+192] vfmadd213sd xmm1, xmm7, xmm5 vmovd xmm7, edx mov QWORD PTR [320+rsp], r13 @@ -523,12 +523,12 @@ L43:: vrsqrtps xmm5, xmm15 vcvtps2pd xmm5, xmm5 vmulsd xmm7, xmm5, xmm5 - vfmsub213sd xmm9, xmm7, QWORD PTR [__svml_dhypot_ha_data_internal+128] + vfmsub213sd xmm9, xmm7, QWORD PTR [__jsvml_dhypot_ha_data_internal+128] vfmadd213sd xmm10, xmm7, xmm9 - vfmadd213sd xmm3, xmm10, QWORD PTR [__svml_dhypot_ha_data_internal+256] - vfmadd213sd xmm3, xmm10, QWORD PTR [__svml_dhypot_ha_data_internal+320] - vfmadd213sd xmm3, xmm10, QWORD PTR [__svml_dhypot_ha_data_internal+384] - vfmadd213sd xmm3, xmm10, QWORD PTR [__svml_dhypot_ha_data_internal+448] + vfmadd213sd xmm3, xmm10, QWORD PTR [__jsvml_dhypot_ha_data_internal+256] + vfmadd213sd xmm3, xmm10, QWORD PTR [__jsvml_dhypot_ha_data_internal+320] + vfmadd213sd xmm3, xmm10, QWORD PTR [__jsvml_dhypot_ha_data_internal+384] + vfmadd213sd xmm3, xmm10, QWORD PTR [__jsvml_dhypot_ha_data_internal+448] vmulsd xmm3, xmm3, xmm10 vmulsd xmm3, xmm3, xmm5 vmulsd xmm6, xmm3, xmm6 @@ -566,19 +566,19 @@ _B3_6:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B3_4 ALIGN 16 _B3_7:: -__svml_hypot1_ha_l9 ENDP +__jsvml_hypot1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot1_ha_l9_B1_B6: +_unwind___jsvml_hypot1_ha_l9_B1_B6: DD 939777 DD 1954903 DD 1009743 @@ -595,7 +595,7 @@ _unwind___svml_hypot1_ha_l9_B1_B6: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_hypot1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_hypot1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -609,9 +609,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot2_ha_l9 + PUBLIC __jsvml_hypot2_ha_l9 -__svml_hypot2_ha_l9 PROC EXPORT +__jsvml_hypot2_ha_l9 PROC EXPORT _B4_1:: @@ -631,19 +631,19 @@ L56:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [352+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm2, XMMWORD PTR [__svml_dhypot_ha_data_internal+64] + vmovupd xmm2, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 vandpd xmm3, xmm0, xmm2 vandpd xmm4, xmm8, xmm2 vmaxpd xmm1, xmm3, xmm4 vminpd xmm2, xmm4, xmm3 - vmovupd xmm11, XMMWORD PTR [__svml_dhypot_ha_data_internal] + vmovupd xmm11, XMMWORD PTR [__jsvml_dhypot_ha_data_internal] vandpd xmm3, xmm1, xmm11 vsubpd xmm4, xmm1, xmm3 vpshufd xmm9, xmm1, 221 vaddpd xmm1, xmm1, xmm3 vpshufd xmm10, xmm2, 221 - vmovq xmm14, QWORD PTR [__svml_dhypot_ha_data_internal+512] + vmovq xmm14, QWORD PTR [__jsvml_dhypot_ha_data_internal+512] vpsubd xmm9, xmm9, xmm10 vpcmpgtd xmm14, xmm9, xmm14 vpshufd xmm14, xmm14, 80 @@ -654,10 +654,10 @@ L56:: vmulpd xmm14, xmm3, xmm3 vfmadd231pd xmm4, xmm2, xmm11 vfmadd231pd xmm14, xmm10, xmm10 - vmovq xmm2, QWORD PTR [__svml_dhypot_ha_data_internal+576] - vmovq xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+640] - vmovupd xmm6, XMMWORD PTR [__svml_dhypot_ha_data_internal+128] - vmovupd xmm5, XMMWORD PTR [__svml_dhypot_ha_data_internal+192] + vmovq xmm2, QWORD PTR [__jsvml_dhypot_ha_data_internal+576] + vmovq xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+640] + vmovupd xmm6, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+128] + vmovupd xmm5, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+192] vfmadd213pd xmm11, xmm10, xmm4 vaddpd xmm9, xmm14, xmm11 vpshufd xmm3, xmm9, 221 @@ -673,10 +673,10 @@ L56:: vmulpd xmm4, xmm10, xmm10 vfmsub231pd xmm6, xmm4, xmm14 vfmadd231pd xmm6, xmm4, xmm11 - vfmadd213pd xmm5, xmm6, XMMWORD PTR [__svml_dhypot_ha_data_internal+256] - vfmadd213pd xmm5, xmm6, XMMWORD PTR [__svml_dhypot_ha_data_internal+320] - vfmadd213pd xmm5, xmm6, XMMWORD PTR [__svml_dhypot_ha_data_internal+384] - vfmadd213pd xmm5, xmm6, XMMWORD PTR [__svml_dhypot_ha_data_internal+448] + vfmadd213pd xmm5, xmm6, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+256] + vfmadd213pd xmm5, xmm6, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+320] + vfmadd213pd xmm5, xmm6, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+384] + vfmadd213pd xmm5, xmm6, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+448] vmulpd xmm5, xmm6, xmm5 vmulpd xmm4, xmm10, xmm5 vmulpd xmm5, xmm9, xmm4 @@ -737,19 +737,19 @@ _B4_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_hypot2_ha_l9 ENDP +__jsvml_hypot2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot2_ha_l9_B1_B3: +_unwind___jsvml_hypot2_ha_l9_B1_B3: DD 1068289 DD 2937933 DD 1075269 @@ -767,19 +767,19 @@ _unwind___svml_hypot2_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_hypot2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypot2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot2_ha_l9_B6_B10: +_unwind___jsvml_hypot2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_hypot2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypot2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -788,7 +788,7 @@ _unwind___svml_hypot2_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_hypot2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_hypot2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -802,9 +802,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot4_ha_l9 + PUBLIC __jsvml_hypot4_ha_l9 -__svml_hypot4_ha_l9 PROC EXPORT +__jsvml_hypot4_ha_l9 PROC EXPORT _B5_1:: @@ -822,11 +822,11 @@ L75:: vmovups YMMWORD PTR [560+rsp], ymm7 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovupd ymm5, YMMWORD PTR [__svml_dhypot_ha_data_internal+64] + vmovupd ymm5, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 - vmovupd ymm2, YMMWORD PTR [__svml_dhypot_ha_data_internal] - vmovupd ymm12, YMMWORD PTR [__svml_dhypot_ha_data_internal+128] - vmovupd ymm14, YMMWORD PTR [__svml_dhypot_ha_data_internal+192] + vmovupd ymm2, YMMWORD PTR [__jsvml_dhypot_ha_data_internal] + vmovupd ymm12, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+128] + vmovupd ymm14, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+192] vmovdqa ymm10, ymm0 vandpd ymm8, ymm10, ymm5 vandpd ymm0, ymm1, ymm5 @@ -840,7 +840,7 @@ L75:: vshufps xmm0, xmm7, xmm0, 221 vshufps xmm8, xmm4, xmm8, 221 vpsubd xmm0, xmm0, xmm8 - vpcmpgtd xmm8, xmm0, XMMWORD PTR [__svml_dhypot_ha_data_internal+512] + vpcmpgtd xmm8, xmm0, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+512] vpshufd xmm0, xmm8, 80 vpshufd xmm8, xmm8, 250 vinserti128 ymm0, ymm0, xmm8, 1 @@ -853,11 +853,11 @@ L75:: vfmadd231pd ymm0, ymm2, ymm2 vfmadd231pd ymm3, ymm4, ymm8 vfmadd213pd ymm8, ymm2, ymm3 - vmovups xmm2, XMMWORD PTR [__svml_dhypot_ha_data_internal+576] + vmovups xmm2, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+576] vaddpd ymm3, ymm0, ymm8 vextracti128 xmm4, ymm3, 1 vshufps xmm5, xmm3, xmm4, 221 - vpcmpgtd xmm4, xmm5, XMMWORD PTR [__svml_dhypot_ha_data_internal+640] + vpcmpgtd xmm4, xmm5, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+640] vpcmpgtd xmm7, xmm2, xmm5 vpor xmm5, xmm7, xmm4 vpshufd xmm2, xmm5, 80 @@ -871,10 +871,10 @@ L75:: vmulpd ymm7, ymm4, ymm4 vfmsub231pd ymm12, ymm7, ymm0 vfmadd231pd ymm12, ymm7, ymm8 - vfmadd213pd ymm14, ymm12, YMMWORD PTR [__svml_dhypot_ha_data_internal+256] - vfmadd213pd ymm14, ymm12, YMMWORD PTR [__svml_dhypot_ha_data_internal+320] - vfmadd213pd ymm14, ymm12, YMMWORD PTR [__svml_dhypot_ha_data_internal+384] - vfmadd213pd ymm14, ymm12, YMMWORD PTR [__svml_dhypot_ha_data_internal+448] + vfmadd213pd ymm14, ymm12, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+256] + vfmadd213pd ymm14, ymm12, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+320] + vfmadd213pd ymm14, ymm12, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+384] + vfmadd213pd ymm14, ymm12, YMMWORD PTR [__jsvml_dhypot_ha_data_internal+448] vmulpd ymm12, ymm12, ymm14 vmulpd ymm14, ymm4, ymm12 vmulpd ymm2, ymm3, ymm14 @@ -942,19 +942,19 @@ _B5_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_hypot4_ha_l9 ENDP +__jsvml_hypot4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot4_ha_l9_B1_B3: +_unwind___jsvml_hypot4_ha_l9_B1_B3: DD 933889 DD 4904000 DD 2324536 @@ -971,13 +971,13 @@ _unwind___svml_hypot4_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_hypot4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypot4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot4_ha_l9_B6_B10: +_unwind___jsvml_hypot4_ha_l9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -988,7 +988,7 @@ _unwind___svml_hypot4_ha_l9_B6_B10: DD 681995 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_hypot4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypot4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -997,7 +997,7 @@ _unwind___svml_hypot4_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_hypot4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_hypot4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1011,9 +1011,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot2_ha_ex + PUBLIC __jsvml_hypot2_ha_ex -__svml_hypot2_ha_ex PROC EXPORT +__jsvml_hypot2_ha_ex PROC EXPORT _B6_1:: @@ -1032,7 +1032,7 @@ L102:: movups XMMWORD PTR [272+rsp], xmm6 mov QWORD PTR [336+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm9, XMMWORD PTR [__svml_dhypot_ha_data_internal+64] + movups xmm9, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 movaps xmm3, xmm9 andps xmm9, xmm1 @@ -1043,11 +1043,11 @@ L102:: pshufd xmm3, xmm10, 221 movaps xmm6, xmm10 pshufd xmm0, xmm9, 221 - movq xmm2, QWORD PTR [__svml_dhypot_ha_data_internal+512] + movq xmm2, QWORD PTR [__jsvml_dhypot_ha_data_internal+512] psubd xmm3, xmm0 pcmpgtd xmm3, xmm2 movaps xmm0, xmm9 - movups xmm5, XMMWORD PTR [__svml_dhypot_ha_data_internal] + movups xmm5, XMMWORD PTR [__jsvml_dhypot_ha_data_internal] pshufd xmm2, xmm3, 80 movaps xmm4, xmm5 andnps xmm2, xmm5 @@ -1071,8 +1071,8 @@ L102:: cvtpd2ps xmm9, xmm0 movlhps xmm9, xmm9 rsqrtps xmm10, xmm9 - movq xmm5, QWORD PTR [__svml_dhypot_ha_data_internal+576] - movq xmm4, QWORD PTR [__svml_dhypot_ha_data_internal+640] + movq xmm5, QWORD PTR [__jsvml_dhypot_ha_data_internal+576] + movq xmm4, QWORD PTR [__jsvml_dhypot_ha_data_internal+640] pshufd xmm2, xmm0, 221 pcmpgtd xmm5, xmm2 pcmpgtd xmm2, xmm4 @@ -1085,18 +1085,18 @@ L102:: mulpd xmm2, xmm5 mulpd xmm4, xmm2 mulpd xmm2, xmm6 - subpd xmm4, XMMWORD PTR [__svml_dhypot_ha_data_internal+128] + subpd xmm4, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+128] mulpd xmm6, xmm5 addpd xmm4, xmm2 - movups xmm13, XMMWORD PTR [__svml_dhypot_ha_data_internal+192] + movups xmm13, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+192] mulpd xmm13, xmm4 - addpd xmm13, XMMWORD PTR [__svml_dhypot_ha_data_internal+256] + addpd xmm13, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+256] mulpd xmm13, xmm4 - addpd xmm13, XMMWORD PTR [__svml_dhypot_ha_data_internal+320] + addpd xmm13, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+320] mulpd xmm13, xmm4 - addpd xmm13, XMMWORD PTR [__svml_dhypot_ha_data_internal+384] + addpd xmm13, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+384] mulpd xmm13, xmm4 - addpd xmm13, XMMWORD PTR [__svml_dhypot_ha_data_internal+448] + addpd xmm13, XMMWORD PTR [__jsvml_dhypot_ha_data_internal+448] mulpd xmm4, xmm13 mulpd xmm4, xmm5 mulpd xmm5, xmm3 @@ -1159,19 +1159,19 @@ _B6_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_hypot2_ha_ex ENDP +__jsvml_hypot2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot2_ha_ex_B1_B3: +_unwind___jsvml_hypot2_ha_ex_B1_B3: DD 934657 DD 2806851 DD 1140795 @@ -1188,19 +1188,19 @@ _unwind___svml_hypot2_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_hypot2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_hypot2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot2_ha_ex_B6_B10: +_unwind___jsvml_hypot2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_hypot2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_hypot2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1209,7 +1209,7 @@ _unwind___svml_hypot2_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_hypot2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_hypot2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1223,9 +1223,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot1_ha_ex + PUBLIC __jsvml_hypot1_ha_ex -__svml_hypot1_ha_ex PROC EXPORT +__jsvml_hypot1_ha_ex PROC EXPORT _B7_1:: @@ -1248,7 +1248,7 @@ L119:: movd xmm4, eax mov QWORD PTR [232+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm12, QWORD PTR [__svml_dhypot_ha_data_internal+64] + movsd xmm12, QWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 movaps xmm5, xmm12 andps xmm12, xmm2 @@ -1263,7 +1263,7 @@ L119:: pshufd xmm3, xmm12, 85 psubd xmm5, xmm3 pcmpgtd xmm5, xmm4 - movsd xmm8, QWORD PTR [__svml_dhypot_ha_data_internal] + movsd xmm8, QWORD PTR [__jsvml_dhypot_ha_data_internal] pshufd xmm4, xmm5, 0 movaps xmm9, xmm8 andnps xmm4, xmm8 @@ -1287,7 +1287,7 @@ L119:: movd xmm12, edx movd xmm4, ecx addsd xmm5, xmm9 - movsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+192] + movsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+192] addsd xmm3, xmm5 pshufd xmm11, xmm3, 85 pcmpgtd xmm12, xmm11 @@ -1308,17 +1308,17 @@ L119:: mulsd xmm8, xmm13 mulsd xmm12, xmm11 mulsd xmm4, xmm11 - subsd xmm12, QWORD PTR [__svml_dhypot_ha_data_internal+128] + subsd xmm12, QWORD PTR [__jsvml_dhypot_ha_data_internal+128] mov QWORD PTR [320+rsp], r13 addsd xmm4, xmm12 mulsd xmm1, xmm4 - addsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+256] + addsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+256] mulsd xmm1, xmm4 - addsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+320] + addsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+320] mulsd xmm1, xmm4 - addsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+384] + addsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+384] mulsd xmm1, xmm4 - addsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+448] + addsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+448] mulsd xmm1, xmm4 mulsd xmm1, xmm13 mulsd xmm1, xmm3 @@ -1356,19 +1356,19 @@ _B7_6:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B7_4 ALIGN 16 _B7_7:: -__svml_hypot1_ha_ex ENDP +__jsvml_hypot1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot1_ha_ex_B1_B6: +_unwind___jsvml_hypot1_ha_ex_B1_B6: DD 939521 DD 1954902 DD 1280074 @@ -1385,7 +1385,7 @@ _unwind___svml_hypot1_ha_ex_B1_B6: DD imagerel _B7_1 DD imagerel _B7_7 - DD imagerel _unwind___svml_hypot1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_hypot1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1399,9 +1399,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot8_ha_z0 + PUBLIC __jsvml_hypot8_ha_z0 -__svml_hypot8_ha_z0 PROC EXPORT +__jsvml_hypot8_ha_z0 PROC EXPORT _B8_1:: @@ -1430,9 +1430,9 @@ L132:: vmovaps zmm28, zmm0 and r13, -64 vfmsub213pd zmm28, zmm0, zmm23 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_dhypot_ha_data_internal+832] - vandpd zmm22, zmm5, ZMMWORD PTR [__svml_dhypot_ha_data_internal+64] - vpcmpq k0, zmm22, ZMMWORD PTR [__svml_dhypot_ha_data_internal+704], 5 + vmovups zmm23, ZMMWORD PTR [__jsvml_dhypot_ha_data_internal+832] + vandpd zmm22, zmm5, ZMMWORD PTR [__jsvml_dhypot_ha_data_internal+64] + vpcmpq k0, zmm22, ZMMWORD PTR [__jsvml_dhypot_ha_data_internal+704], 5 vmulpd zmm22, zmm23, zmm3 {rn-sae} kmovw r8d, k0 vfnmadd231pd zmm23, zmm22, zmm4 {rn-sae} @@ -1580,19 +1580,19 @@ _B8_15:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B8_13 ALIGN 16 _B8_16:: -__svml_hypot8_ha_z0 ENDP +__jsvml_hypot8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot8_ha_z0_B1_B9: +_unwind___jsvml_hypot8_ha_z0_B1_B9: DD 286977 DD 11392097 DD 11469067 @@ -1604,13 +1604,13 @@ _unwind___svml_hypot8_ha_z0_B1_B9: DD imagerel _B8_1 DD imagerel _B8_11 - DD imagerel _unwind___svml_hypot8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_hypot8_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot8_ha_z0_B11_B15: +_unwind___jsvml_hypot8_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -1646,7 +1646,7 @@ _unwind___svml_hypot8_ha_z0_B11_B15: DD imagerel _B8_11 DD imagerel _B8_16 - DD imagerel _unwind___svml_hypot8_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_hypot8_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1660,9 +1660,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypot1_ha_e9 + PUBLIC __jsvml_hypot1_ha_e9 -__svml_hypot1_ha_e9 PROC EXPORT +__jsvml_hypot1_ha_e9 PROC EXPORT _B9_1:: @@ -1684,7 +1684,7 @@ L183:: vmovups XMMWORD PTR [304+rsp], xmm10 mov QWORD PTR [232+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm4, QWORD PTR [__svml_dhypot_ha_data_internal+64] + vmovsd xmm4, QWORD PTR [__jsvml_dhypot_ha_data_internal+64] and r13, -64 vandpd xmm5, xmm0, xmm4 vandpd xmm11, xmm3, xmm4 @@ -1697,7 +1697,7 @@ L183:: vpsubd xmm13, xmm14, xmm4 vmovd xmm14, eax vpcmpgtd xmm4, xmm13, xmm14 - vmovsd xmm2, QWORD PTR [__svml_dhypot_ha_data_internal] + vmovsd xmm2, QWORD PTR [__jsvml_dhypot_ha_data_internal] vpshufd xmm13, xmm4, 0 vandpd xmm11, xmm10, xmm2 vandnpd xmm2, xmm13, xmm2 @@ -1714,7 +1714,7 @@ L183:: vaddsd xmm10, xmm15, xmm5 vmovd xmm14, ecx vmovd xmm4, edx - vmovsd xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+192] + vmovsd xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+192] vaddsd xmm11, xmm11, xmm10 mov QWORD PTR [320+rsp], r13 vaddsd xmm10, xmm2, xmm11 @@ -1732,17 +1732,17 @@ L183:: vmulsd xmm4, xmm2, xmm13 vmulsd xmm14, xmm11, xmm13 vmulsd xmm11, xmm11, xmm5 - vsubsd xmm15, xmm4, QWORD PTR [__svml_dhypot_ha_data_internal+128] + vsubsd xmm15, xmm4, QWORD PTR [__jsvml_dhypot_ha_data_internal+128] vmulsd xmm2, xmm2, xmm5 vaddsd xmm4, xmm14, xmm15 vmulsd xmm1, xmm1, xmm4 - vaddsd xmm1, xmm1, QWORD PTR [__svml_dhypot_ha_data_internal+256] + vaddsd xmm1, xmm1, QWORD PTR [__jsvml_dhypot_ha_data_internal+256] vmulsd xmm13, xmm1, xmm4 - vaddsd xmm14, xmm13, QWORD PTR [__svml_dhypot_ha_data_internal+320] + vaddsd xmm14, xmm13, QWORD PTR [__jsvml_dhypot_ha_data_internal+320] vmulsd xmm15, xmm14, xmm4 - vaddsd xmm1, xmm15, QWORD PTR [__svml_dhypot_ha_data_internal+384] + vaddsd xmm1, xmm15, QWORD PTR [__jsvml_dhypot_ha_data_internal+384] vmulsd xmm13, xmm1, xmm4 - vaddsd xmm14, xmm13, QWORD PTR [__svml_dhypot_ha_data_internal+448] + vaddsd xmm14, xmm13, QWORD PTR [__jsvml_dhypot_ha_data_internal+448] vmulsd xmm4, xmm14, xmm4 vmulsd xmm1, xmm4, xmm5 vmulsd xmm10, xmm1, xmm10 @@ -1781,19 +1781,19 @@ _B9_6:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_dhypot_ha_cout_rare_internal + call __jsvml_dhypot_ha_cout_rare_internal jmp _B9_4 ALIGN 16 _B9_7:: -__svml_hypot1_ha_e9 ENDP +__jsvml_hypot1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypot1_ha_e9_B1_B6: +_unwind___jsvml_hypot1_ha_e9_B1_B6: DD 938753 DD 1954899 DD 1288267 @@ -1810,7 +1810,7 @@ _unwind___svml_hypot1_ha_e9_B1_B6: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_hypot1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_hypot1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1824,9 +1824,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dhypot_ha_cout_rare_internal + PUBLIC __jsvml_dhypot_ha_cout_rare_internal -__svml_dhypot_ha_cout_rare_internal PROC +__jsvml_dhypot_ha_cout_rare_internal PROC _B10_1:: @@ -2173,13 +2173,13 @@ _B10_22:: _B10_25:: -__svml_dhypot_ha_cout_rare_internal ENDP +__jsvml_dhypot_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dhypot_ha_cout_rare_internal_B1_B22: +_unwind___jsvml_dhypot_ha_cout_rare_internal_B1_B22: DD 403713 DD 256041 DD 194595 @@ -2192,7 +2192,7 @@ _unwind___svml_dhypot_ha_cout_rare_internal_B1_B22: DD imagerel _B10_1 DD imagerel _B10_25 - DD imagerel _unwind___svml_dhypot_ha_cout_rare_internal_B1_B22 + DD imagerel _unwind___jsvml_dhypot_ha_cout_rare_internal_B1_B22 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2200,8 +2200,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dhypot_ha_data_internal -__svml_dhypot_ha_data_internal DD 0 + PUBLIC __jsvml_dhypot_ha_data_internal +__jsvml_dhypot_ha_data_internal DD 0 DD 4294950912 DD 0 DD 4294950912 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_log10_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log10_windows_x86.S similarity index 85% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_log10_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log10_windows_x86.S index fcc64ff498a..2e50e34e5ea 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_log10_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log10_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log102_ha_ex + PUBLIC __jsvml_log102_ha_ex -__svml_log102_ha_ex PROC EXPORT +__jsvml_log102_ha_ex PROC EXPORT _B1_1:: @@ -59,25 +59,25 @@ L1:: movaps xmm7, xmm0 mov QWORD PTR [240+rsp], r13 psrlq xmm7, 20 - movups xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+9024] + movups xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9024] lea r13, QWORD PTR [111+rsp] andps xmm2, xmm0 and r13, -64 - orps xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+9088] + orps xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9088] cvtpd2ps xmm4, xmm2 - cmpltpd xmm1, XMMWORD PTR [__svml_dlog10_ha_data_internal+9152] - cmpnlepd xmm8, XMMWORD PTR [__svml_dlog10_ha_data_internal+9216] + cmpltpd xmm1, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9152] + cmpnlepd xmm8, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9216] movlhps xmm4, xmm4 orps xmm1, xmm8 rcpps xmm5, xmm4 movmskpd eax, xmm1 - movups xmm15, XMMWORD PTR [__svml_dlog10_ha_data_internal+9344] + movups xmm15, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9344] movups xmm4, XMMWORD PTR [_2il0floatpacket_28] cvtps2pd xmm3, xmm5 mulpd xmm3, xmm15 addpd xmm3, xmm4 subpd xmm3, xmm4 - movups xmm1, XMMWORD PTR [__svml_dlog10_ha_data_internal+9280] + movups xmm1, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9280] andps xmm1, xmm2 subpd xmm2, xmm1 mulpd xmm1, xmm3 @@ -90,30 +90,30 @@ L1:: movd edx, xmm3 pshufd xmm8, xmm3, 2 movaps xmm5, xmm2 - movups xmm15, XMMWORD PTR [__svml_dlog10_ha_data_internal+9472] + movups xmm15, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9472] movd ecx, xmm8 - movups xmm7, XMMWORD PTR [__svml_dlog10_ha_data_internal+8576] + movups xmm7, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8576] mulpd xmm15, xmm4 mulpd xmm5, xmm2 - mulpd xmm4, XMMWORD PTR [__svml_dlog10_ha_data_internal+9536] + mulpd xmm4, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9536] mulpd xmm7, xmm2 movsxd rdx, edx movsxd rcx, ecx - addpd xmm7, XMMWORD PTR [__svml_dlog10_ha_data_internal+8640] - movups xmm1, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+r8+rdx] - movups xmm3, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+r8+rcx] + addpd xmm7, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8640] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+r8+rdx] + movups xmm3, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+r8+rcx] movaps xmm8, xmm1 unpcklpd xmm8, xmm3 addpd xmm8, xmm15 - movups xmm15, XMMWORD PTR [__svml_dlog10_ha_data_internal+8320] + movups xmm15, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8320] mulpd xmm15, xmm2 unpckhpd xmm1, xmm3 - movups xmm3, XMMWORD PTR [__svml_dlog10_ha_data_internal+8448] - addpd xmm15, XMMWORD PTR [__svml_dlog10_ha_data_internal+8384] + movups xmm3, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8448] + addpd xmm15, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8384] addpd xmm1, xmm4 mulpd xmm3, xmm2 mulpd xmm15, xmm5 - addpd xmm3, XMMWORD PTR [__svml_dlog10_ha_data_internal+8512] + addpd xmm3, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8512] addpd xmm3, xmm15 mulpd xmm5, xmm3 movaps xmm4, xmm2 @@ -179,19 +179,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_log102_ha_ex ENDP +__jsvml_log102_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log102_ha_ex_B1_B3: +_unwind___jsvml_log102_ha_ex_B1_B3: DD 671233 DD 2020414 DD 882739 @@ -206,19 +206,19 @@ _unwind___svml_log102_ha_ex_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log102_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log102_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log102_ha_ex_B6_B10: +_unwind___jsvml_log102_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log102_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log102_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -227,7 +227,7 @@ _unwind___svml_log102_ha_ex_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_log102_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_log102_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -241,9 +241,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log101_ha_l9 + PUBLIC __jsvml_log101_ha_l9 -__svml_log101_ha_l9 PROC EXPORT +__jsvml_log101_ha_l9 PROC EXPORT _B2_1:: @@ -261,19 +261,19 @@ L14:: vmovups XMMWORD PTR [192+rsp], xmm10 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm2, QWORD PTR [__svml_dlog10_ha_data_internal+9024] + vmovsd xmm2, QWORD PTR [__jsvml_dlog10_ha_data_internal+9024] and r13, -64 - vmovsd xmm0, QWORD PTR [__svml_dlog10_ha_data_internal+9088] + vmovsd xmm0, QWORD PTR [__jsvml_dlog10_ha_data_internal+9088] vandpd xmm5, xmm1, xmm2 vorpd xmm0, xmm5, xmm0 - vcmpnlesd xmm5, xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+9216] + vcmpnlesd xmm5, xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+9216] vcvtpd2ps xmm2, xmm0 vmovlhps xmm3, xmm2, xmm2 vpsrlq xmm2, xmm1, 20 vrcpps xmm4, xmm3 vcvtps2pd xmm10, xmm4 - vcmpltsd xmm4, xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+9152] - vmovsd xmm3, QWORD PTR [__svml_dlog10_ha_data_internal+9344] + vcmpltsd xmm4, xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+9152] + vmovsd xmm3, QWORD PTR [__jsvml_dlog10_ha_data_internal+9344] vorpd xmm5, xmm4, xmm5 vmulsd xmm13, xmm10, xmm3 vmovmskpd ecx, xmm5 @@ -282,20 +282,20 @@ L14:: vfmsub213sd xmm0, xmm14, xmm3 vpsrlq xmm14, xmm14, 40 vpshufd xmm13, xmm10, 0 - vmovsd xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+9472] + vmovsd xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+9472] vmovd eax, xmm14 - vmovsd xmm10, QWORD PTR [__svml_dlog10_ha_data_internal+8320] - vmovsd xmm14, QWORD PTR [__svml_dlog10_ha_data_internal+8448] + vmovsd xmm10, QWORD PTR [__jsvml_dlog10_ha_data_internal+8320] + vmovsd xmm14, QWORD PTR [__jsvml_dlog10_ha_data_internal+8448] vcvtdq2pd xmm2, xmm13 - vfmadd213sd xmm10, xmm0, QWORD PTR [__svml_dlog10_ha_data_internal+8384] - vfmadd213sd xmm14, xmm0, QWORD PTR [__svml_dlog10_ha_data_internal+8512] + vfmadd213sd xmm10, xmm0, QWORD PTR [__jsvml_dlog10_ha_data_internal+8384] + vfmadd213sd xmm14, xmm0, QWORD PTR [__jsvml_dlog10_ha_data_internal+8512] vmovapd xmm13, xmm2 - vmovsd xmm4, QWORD PTR [__svml_dlog10_ha_data_internal+8576] + vmovsd xmm4, QWORD PTR [__jsvml_dlog10_ha_data_internal+8576] movsxd rax, eax - vfmadd213sd xmm4, xmm0, QWORD PTR [__svml_dlog10_ha_data_internal+8640] - vmovddup xmm3, QWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221880+rdx+rax] - vfmadd213sd xmm13, xmm5, QWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rdx+rax] - vfmadd132sd xmm2, xmm3, QWORD PTR [__svml_dlog10_ha_data_internal+9536] + vfmadd213sd xmm4, xmm0, QWORD PTR [__jsvml_dlog10_ha_data_internal+8640] + vmovddup xmm3, QWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221880+rdx+rax] + vfmadd213sd xmm13, xmm5, QWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rdx+rax] + vfmadd132sd xmm2, xmm3, QWORD PTR [__jsvml_dlog10_ha_data_internal+9536] vmulsd xmm3, xmm0, xmm0 vaddsd xmm5, xmm13, xmm0 vfmadd213sd xmm10, xmm3, xmm14 @@ -335,19 +335,19 @@ _B2_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B2_4 ALIGN 16 _B2_7:: -__svml_log101_ha_l9 ENDP +__jsvml_log101_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log101_ha_l9_B1_B6: +_unwind___jsvml_log101_ha_l9_B1_B6: DD 669953 DD 1430585 DD 829489 @@ -362,7 +362,7 @@ _unwind___svml_log101_ha_l9_B1_B6: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_log101_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_log101_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -376,9 +376,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log101_ha_e9 + PUBLIC __jsvml_log101_ha_e9 -__svml_log101_ha_e9 PROC EXPORT +__jsvml_log101_ha_e9 PROC EXPORT _B3_1:: @@ -396,19 +396,19 @@ L23:: vmovups XMMWORD PTR [192+rsp], xmm7 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+9024] + vmovsd xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+9024] and r13, -64 - vmovsd xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+9088] + vmovsd xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+9088] vandpd xmm11, xmm13, xmm1 vorpd xmm2, xmm11, xmm5 vpsrlq xmm5, xmm13, 20 vcvtpd2ps xmm7, xmm2 - vcmpltsd xmm3, xmm13, QWORD PTR [__svml_dlog10_ha_data_internal+9152] + vcmpltsd xmm3, xmm13, QWORD PTR [__jsvml_dlog10_ha_data_internal+9152] vmovlhps xmm0, xmm7, xmm7 - vcmpnlesd xmm7, xmm13, QWORD PTR [__svml_dlog10_ha_data_internal+9216] + vcmpnlesd xmm7, xmm13, QWORD PTR [__jsvml_dlog10_ha_data_internal+9216] vrcpps xmm4, xmm0 vcvtps2pd xmm1, xmm4 - vmovsd xmm4, QWORD PTR [__svml_dlog10_ha_data_internal+9344] + vmovsd xmm4, QWORD PTR [__jsvml_dlog10_ha_data_internal+9344] vorpd xmm3, xmm3, xmm7 vmulsd xmm11, xmm1, xmm4 vmovmskpd ecx, xmm3 @@ -416,30 +416,30 @@ L23:: vroundsd xmm0, xmm11, xmm11, 0 vpshufd xmm11, xmm1, 0 vcvtdq2pd xmm5, xmm11 - vmovsd xmm11, QWORD PTR [__svml_dlog10_ha_data_internal+9280] + vmovsd xmm11, QWORD PTR [__jsvml_dlog10_ha_data_internal+9280] vandpd xmm7, xmm2, xmm11 vmulsd xmm11, xmm7, xmm0 vsubsd xmm2, xmm2, xmm7 vmulsd xmm3, xmm2, xmm0 vsubsd xmm7, xmm11, xmm4 - vmulsd xmm4, xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+9472] - vmulsd xmm5, xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+9536] + vmulsd xmm4, xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+9472] + vmulsd xmm5, xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+9536] vaddsd xmm7, xmm7, xmm3 vpsrlq xmm0, xmm0, 40 vmovd eax, xmm0 - vmovsd xmm2, QWORD PTR [__svml_dlog10_ha_data_internal+8320] - vmovsd xmm11, QWORD PTR [__svml_dlog10_ha_data_internal+8576] + vmovsd xmm2, QWORD PTR [__jsvml_dlog10_ha_data_internal+8320] + vmovsd xmm11, QWORD PTR [__jsvml_dlog10_ha_data_internal+8576] movsxd rax, eax vmulsd xmm1, xmm2, xmm7 vmulsd xmm11, xmm11, xmm7 - vaddsd xmm0, xmm4, QWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rdx+rax] - vaddsd xmm5, xmm5, QWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221880+rdx+rax] - vaddsd xmm1, xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+8384] - vmovsd xmm4, QWORD PTR [__svml_dlog10_ha_data_internal+8448] + vaddsd xmm0, xmm4, QWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rdx+rax] + vaddsd xmm5, xmm5, QWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221880+rdx+rax] + vaddsd xmm1, xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+8384] + vmovsd xmm4, QWORD PTR [__jsvml_dlog10_ha_data_internal+8448] vmulsd xmm3, xmm4, xmm7 - vaddsd xmm4, xmm11, QWORD PTR [__svml_dlog10_ha_data_internal+8640] + vaddsd xmm4, xmm11, QWORD PTR [__jsvml_dlog10_ha_data_internal+8640] vaddsd xmm11, xmm0, xmm7 - vaddsd xmm2, xmm3, QWORD PTR [__svml_dlog10_ha_data_internal+8512] + vaddsd xmm2, xmm3, QWORD PTR [__jsvml_dlog10_ha_data_internal+8512] vmulsd xmm3, xmm7, xmm7 vsubsd xmm0, xmm11, xmm0 vmulsd xmm1, xmm1, xmm3 @@ -480,19 +480,19 @@ _B3_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B3_4 ALIGN 16 _B3_7:: -__svml_log101_ha_e9 ENDP +__jsvml_log101_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log101_ha_e9_B1_B6: +_unwind___jsvml_log101_ha_e9_B1_B6: DD 669953 DD 1430585 DD 817201 @@ -507,7 +507,7 @@ _unwind___svml_log101_ha_e9_B1_B6: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_log101_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_log101_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -521,9 +521,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log104_ha_e9 + PUBLIC __jsvml_log104_ha_e9 -__svml_log104_ha_e9 PROC EXPORT +__jsvml_log104_ha_e9 PROC EXPORT _B4_1:: @@ -542,8 +542,8 @@ L32:: lea r13, QWORD PTR [335+rsp] vmovapd ymm13, ymm0 and r13, -64 - vandpd ymm1, ymm13, YMMWORD PTR [__svml_dlog10_ha_data_internal+9024] - vorpd ymm4, ymm1, YMMWORD PTR [__svml_dlog10_ha_data_internal+9088] + vandpd ymm1, ymm13, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9024] + vorpd ymm4, ymm1, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9088] vcvtpd2ps xmm3, ymm4 vrcpps xmm5, xmm3 vcvtps2pd ymm5, xmm5 @@ -552,13 +552,13 @@ L32:: vextractf128 xmm2, ymm13, 1 vpsrlq xmm15, xmm2, 20 vshufps xmm3, xmm10, xmm15, 221 - vmovupd ymm15, YMMWORD PTR [__svml_dlog10_ha_data_internal+9344] + vmovupd ymm15, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9344] vcvtdq2pd ymm0, xmm3 - vcmplt_oqpd ymm10, ymm13, YMMWORD PTR [__svml_dlog10_ha_data_internal+9152] - vcmpnle_uqpd ymm2, ymm13, YMMWORD PTR [__svml_dlog10_ha_data_internal+9216] + vcmplt_oqpd ymm10, ymm13, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9152] + vcmpnle_uqpd ymm2, ymm13, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9216] vmulpd ymm1, ymm5, ymm15 vorpd ymm2, ymm10, ymm2 - vandpd ymm3, ymm4, YMMWORD PTR [__svml_dlog10_ha_data_internal+9280] + vandpd ymm3, ymm4, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9280] vroundpd ymm5, ymm1, 0 vsubpd ymm4, ymm4, ymm3 vextractf128 xmm10, ymm2, 1 @@ -579,29 +579,29 @@ L32:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+rcx] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+r8] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+r9] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+r10] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+rcx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+r8] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+r9] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+r10] vunpcklpd xmm15, xmm3, xmm4 vunpcklpd xmm5, xmm1, xmm2 vunpckhpd xmm2, xmm1, xmm2 vunpckhpd xmm3, xmm3, xmm4 vinsertf128 ymm5, ymm15, xmm5, 1 - vmulpd ymm15, ymm0, YMMWORD PTR [__svml_dlog10_ha_data_internal+9472] - vmulpd ymm0, ymm0, YMMWORD PTR [__svml_dlog10_ha_data_internal+9536] + vmulpd ymm15, ymm0, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9472] + vmulpd ymm0, ymm0, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9536] vaddpd ymm1, ymm5, ymm15 - vmulpd ymm5, ymm10, YMMWORD PTR [__svml_dlog10_ha_data_internal+8320] + vmulpd ymm5, ymm10, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8320] vinsertf128 ymm4, ymm3, xmm2, 1 vmulpd ymm3, ymm10, ymm10 vaddpd ymm2, ymm4, ymm0 - vaddpd ymm0, ymm5, YMMWORD PTR [__svml_dlog10_ha_data_internal+8384] - vmulpd ymm5, ymm10, YMMWORD PTR [__svml_dlog10_ha_data_internal+8448] - vmulpd ymm4, ymm10, YMMWORD PTR [__svml_dlog10_ha_data_internal+8576] + vaddpd ymm0, ymm5, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8384] + vmulpd ymm5, ymm10, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8448] + vmulpd ymm4, ymm10, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8576] vmulpd ymm0, ymm0, ymm3 - vaddpd ymm15, ymm5, YMMWORD PTR [__svml_dlog10_ha_data_internal+8512] + vaddpd ymm15, ymm5, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8512] vaddpd ymm5, ymm10, ymm1 - vaddpd ymm4, ymm4, YMMWORD PTR [__svml_dlog10_ha_data_internal+8640] + vaddpd ymm4, ymm4, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8640] vaddpd ymm0, ymm15, ymm0 vsubpd ymm15, ymm5, ymm1 vmulpd ymm1, ymm3, ymm0 @@ -674,19 +674,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_log104_ha_e9 ENDP +__jsvml_log104_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log104_ha_e9_B1_B3: +_unwind___jsvml_log104_ha_e9_B1_B3: DD 668929 DD 4379701 DD 1812525 @@ -701,13 +701,13 @@ _unwind___svml_log104_ha_e9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log104_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log104_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log104_ha_e9_B6_B10: +_unwind___jsvml_log104_ha_e9_B6_B10: DD 1198625 DD 2122826 DD 2176064 @@ -720,7 +720,7 @@ _unwind___svml_log104_ha_e9_B6_B10: DD 944139 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log104_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log104_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -729,7 +729,7 @@ _unwind___svml_log104_ha_e9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_log104_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log104_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -743,9 +743,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log108_ha_z0 + PUBLIC __jsvml_log108_ha_z0 -__svml_log108_ha_z0 PROC EXPORT +__jsvml_log108_ha_z0 PROC EXPORT _B5_1:: @@ -761,35 +761,35 @@ L59:: vfpclasspd k2, zmm5, 94 vrcp14pd zmm22, zmm4 vrndscalepd zmm23, zmm22, 88 {sae} - vmovups zmm25, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+256] - vmovups zmm24, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+320] - vmovups zmm2, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512] - vmovups zmm29, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+1024] - vmovups zmm27, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+384] + vmovups zmm25, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+256] + vmovups zmm24, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+320] + vmovups zmm2, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512] + vmovups zmm29, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+1024] + vmovups zmm27, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+384] vfmsub213pd zmm4, zmm23, zmm25 {rn-sae} - vmovups zmm1, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+448] - vmovups zmm28, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+512] - vmovups zmm22, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+576] - vmovups zmm31, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+128] - vmovups zmm30, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+1088] + vmovups zmm1, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+448] + vmovups zmm28, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+512] + vmovups zmm22, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+576] + vmovups zmm31, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+128] + vmovups zmm30, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+1088] vfmadd231pd zmm1, zmm27, zmm4 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+640] + vmovups zmm27, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+640] vfmadd231pd zmm22, zmm28, zmm4 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+768] - vmovups zmm5, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+896] + vmovups zmm28, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+768] + vmovups zmm5, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+896] vcmppd k1, zmm23, zmm24, 17 {sae} vmulpd zmm0, zmm4, zmm4 {rn-sae} vpsrlq zmm26, zmm23, 48 - vmovups zmm23, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+832] + vmovups zmm23, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+832] vmulpd zmm24, zmm0, zmm0 {rn-sae} vfmadd231pd zmm23, zmm28, zmm4 {rn-sae} vfmadd213pd zmm1, zmm0, zmm22 {rn-sae} vaddpd zmm3{k1}, zmm3, zmm25 {rn-sae} - vpermt2pd zmm2, zmm26, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+64] - vpermt2pd zmm31, zmm26, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+192] - vmovups zmm25, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+704] + vpermt2pd zmm2, zmm26, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+64] + vpermt2pd zmm31, zmm26, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+192] + vmovups zmm25, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+704] vfmadd231pd zmm2, zmm29, zmm3 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_dlog10_ha_data_internal_avx512+960] + vmovups zmm26, ZMMWORD PTR [__jsvml_dlog10_ha_data_internal_avx512+960] vfmadd213pd zmm3, zmm30, zmm31 {rn-sae} vfmadd231pd zmm25, zmm27, zmm4 {rn-sae} vmovaps zmm29, zmm2 @@ -808,7 +808,7 @@ L59:: _B5_2:: -__svml_log108_ha_z0 ENDP +__jsvml_log108_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -822,9 +822,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log101_ha_ex + PUBLIC __jsvml_log101_ha_ex -__svml_log101_ha_ex PROC EXPORT +__jsvml_log101_ha_ex PROC EXPORT _B6_1:: @@ -844,27 +844,27 @@ L60:: movaps xmm7, xmm2 mov QWORD PTR [168+rsp], r13 psrlq xmm7, 20 - movsd xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+9024] + movsd xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+9024] lea r13, QWORD PTR [95+rsp] - movsd xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+9088] + movsd xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+9088] andps xmm5, xmm2 orps xmm5, xmm1 movaps xmm1, xmm2 cvtpd2ps xmm3, xmm5 - cmpltsd xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+9152] - cmpnlesd xmm9, QWORD PTR [__svml_dlog10_ha_data_internal+9216] + cmpltsd xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+9152] + cmpnlesd xmm9, QWORD PTR [__jsvml_dlog10_ha_data_internal+9216] movlhps xmm3, xmm3 orps xmm1, xmm9 rcpps xmm4, xmm3 movmskpd ecx, xmm1 - movsd xmm3, QWORD PTR [__svml_dlog10_ha_data_internal+9344] + movsd xmm3, QWORD PTR [__jsvml_dlog10_ha_data_internal+9344] movups xmm0, XMMWORD PTR [_2il0floatpacket_28] cvtps2pd xmm4, xmm4 mulsd xmm4, xmm3 and r13, -64 addpd xmm4, xmm0 subpd xmm4, xmm0 - movsd xmm1, QWORD PTR [__svml_dlog10_ha_data_internal+9280] + movsd xmm1, QWORD PTR [__jsvml_dlog10_ha_data_internal+9280] and ecx, 1 andps xmm1, xmm5 pshufd xmm8, xmm7, 85 @@ -874,29 +874,29 @@ L60:: subsd xmm1, xmm3 pshufd xmm0, xmm8, 0 psrlq xmm4, 40 - movsd xmm8, QWORD PTR [__svml_dlog10_ha_data_internal+8320] + movsd xmm8, QWORD PTR [__jsvml_dlog10_ha_data_internal+8320] addsd xmm1, xmm5 cvtdq2pd xmm0, xmm0 mulsd xmm8, xmm1 movd eax, xmm4 - movsd xmm9, QWORD PTR [__svml_dlog10_ha_data_internal+8448] + movsd xmm9, QWORD PTR [__jsvml_dlog10_ha_data_internal+8448] movaps xmm4, xmm1 mulsd xmm9, xmm1 - addsd xmm8, QWORD PTR [__svml_dlog10_ha_data_internal+8384] + addsd xmm8, QWORD PTR [__jsvml_dlog10_ha_data_internal+8384] mulsd xmm4, xmm1 - addsd xmm9, QWORD PTR [__svml_dlog10_ha_data_internal+8512] + addsd xmm9, QWORD PTR [__jsvml_dlog10_ha_data_internal+8512] mulsd xmm8, xmm4 movaps xmm3, xmm0 addsd xmm8, xmm9 - mulsd xmm3, QWORD PTR [__svml_dlog10_ha_data_internal+9472] - mulsd xmm0, QWORD PTR [__svml_dlog10_ha_data_internal+9536] + mulsd xmm3, QWORD PTR [__jsvml_dlog10_ha_data_internal+9472] + mulsd xmm0, QWORD PTR [__jsvml_dlog10_ha_data_internal+9536] mulsd xmm8, xmm4 movsxd rax, eax - movsd xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+8576] + movsd xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+8576] mulsd xmm5, xmm1 - addsd xmm3, QWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rdx+rax] - addsd xmm0, QWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221880+rdx+rax] - addsd xmm5, QWORD PTR [__svml_dlog10_ha_data_internal+8640] + addsd xmm3, QWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rdx+rax] + addsd xmm0, QWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221880+rdx+rax] + addsd xmm5, QWORD PTR [__jsvml_dlog10_ha_data_internal+8640] movaps xmm7, xmm3 addsd xmm8, xmm5 addsd xmm7, xmm1 @@ -935,19 +935,19 @@ _B6_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_log101_ha_ex ENDP +__jsvml_log101_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log101_ha_ex_B1_B6: +_unwind___jsvml_log101_ha_ex_B1_B6: DD 671233 DD 1430590 DD 882739 @@ -962,7 +962,7 @@ _unwind___svml_log101_ha_ex_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_log101_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_log101_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -976,9 +976,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log102_ha_e9 + PUBLIC __jsvml_log102_ha_e9 -__svml_log102_ha_e9 PROC EXPORT +__jsvml_log102_ha_e9 PROC EXPORT _B7_1:: @@ -997,20 +997,20 @@ L69:: vmovups XMMWORD PTR [224+rsp], xmm9 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd xmm1, xmm3, XMMWORD PTR [__svml_dlog10_ha_data_internal+9024] + vandpd xmm1, xmm3, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9024] and r13, -64 - vorpd xmm4, xmm1, XMMWORD PTR [__svml_dlog10_ha_data_internal+9088] + vorpd xmm4, xmm1, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9088] vcvtpd2ps xmm2, xmm4 - vcmpnlepd xmm0, xmm3, XMMWORD PTR [__svml_dlog10_ha_data_internal+9216] + vcmpnlepd xmm0, xmm3, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9216] vmovlhps xmm5, xmm2, xmm2 vrcpps xmm15, xmm5 - vcmpltpd xmm5, xmm3, XMMWORD PTR [__svml_dlog10_ha_data_internal+9152] + vcmpltpd xmm5, xmm3, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9152] vcvtps2pd xmm9, xmm15 - vmovupd xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+9344] + vmovupd xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9344] vorpd xmm5, xmm5, xmm0 vmulpd xmm1, xmm9, xmm2 vmovmskpd edx, xmm5 - vandpd xmm0, xmm4, XMMWORD PTR [__svml_dlog10_ha_data_internal+9280] + vandpd xmm0, xmm4, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9280] vpshufd xmm15, xmm11, 221 vroundpd xmm1, xmm1, 0 vsubpd xmm4, xmm4, xmm0 @@ -1022,25 +1022,25 @@ L69:: vmovd eax, xmm1 vaddpd xmm2, xmm5, xmm2 vpextrd ecx, xmm1, 2 - vmulpd xmm1, xmm9, XMMWORD PTR [__svml_dlog10_ha_data_internal+9472] - vmulpd xmm9, xmm9, XMMWORD PTR [__svml_dlog10_ha_data_internal+9536] - vmulpd xmm5, xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+8448] + vmulpd xmm1, xmm9, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9472] + vmulpd xmm9, xmm9, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9536] + vmulpd xmm5, xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8448] movsxd rax, eax movsxd rcx, ecx mov QWORD PTR [248+rsp], r13 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+r8+rax] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+r8+rcx] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+r8+rax] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+r8+rcx] vunpcklpd xmm15, xmm0, xmm4 vunpckhpd xmm11, xmm0, xmm4 vaddpd xmm0, xmm15, xmm1 vaddpd xmm1, xmm11, xmm9 - vaddpd xmm15, xmm5, XMMWORD PTR [__svml_dlog10_ha_data_internal+8512] - vmulpd xmm9, xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+8320] + vaddpd xmm15, xmm5, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8512] + vmulpd xmm9, xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8320] vmulpd xmm4, xmm2, xmm2 - vaddpd xmm11, xmm9, XMMWORD PTR [__svml_dlog10_ha_data_internal+8384] - vmulpd xmm9, xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+8576] + vaddpd xmm11, xmm9, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8384] + vmulpd xmm9, xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8576] vmulpd xmm11, xmm11, xmm4 - vaddpd xmm5, xmm9, XMMWORD PTR [__svml_dlog10_ha_data_internal+8640] + vaddpd xmm5, xmm9, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8640] vaddpd xmm9, xmm2, xmm0 vaddpd xmm15, xmm15, xmm11 vsubpd xmm11, xmm9, xmm0 @@ -1099,19 +1099,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_log102_ha_e9 ENDP +__jsvml_log102_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log102_ha_e9_B1_B3: +_unwind___jsvml_log102_ha_e9_B1_B3: DD 671233 DD 2020414 DD 956470 @@ -1126,19 +1126,19 @@ _unwind___svml_log102_ha_e9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_log102_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log102_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log102_ha_e9_B6_B10: +_unwind___jsvml_log102_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_log102_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log102_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1147,7 +1147,7 @@ _unwind___svml_log102_ha_e9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_log102_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log102_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1161,9 +1161,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log102_ha_l9 + PUBLIC __jsvml_log102_ha_l9 -__svml_log102_ha_l9 PROC EXPORT +__jsvml_log102_ha_l9 PROC EXPORT _B8_1:: @@ -1182,16 +1182,16 @@ L82:: vmovups XMMWORD PTR [224+rsp], xmm10 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd xmm2, xmm1, XMMWORD PTR [__svml_dlog10_ha_data_internal+9024] + vandpd xmm2, xmm1, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9024] and r13, -64 - vorpd xmm0, xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+9088] + vorpd xmm0, xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9088] vcvtpd2ps xmm4, xmm0 - vcmpnlepd xmm5, xmm1, XMMWORD PTR [__svml_dlog10_ha_data_internal+9216] + vcmpnlepd xmm5, xmm1, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9216] vmovlhps xmm2, xmm4, xmm4 vrcpps xmm3, xmm2 vcvtps2pd xmm10, xmm3 - vcmpltpd xmm3, xmm1, XMMWORD PTR [__svml_dlog10_ha_data_internal+9152] - vmovupd xmm4, XMMWORD PTR [__svml_dlog10_ha_data_internal+9344] + vcmpltpd xmm3, xmm1, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9152] + vmovupd xmm4, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9344] vorpd xmm5, xmm3, xmm5 vmulpd xmm15, xmm10, xmm4 vmovmskpd edx, xmm5 @@ -1200,24 +1200,24 @@ L82:: vroundpd xmm15, xmm15, 0 vfmsub213pd xmm0, xmm15, xmm4 vpsrlq xmm4, xmm15, 40 - vmovupd xmm15, XMMWORD PTR [__svml_dlog10_ha_data_internal+8448] + vmovupd xmm15, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8448] vmovd eax, xmm4 - vfmadd213pd xmm15, xmm0, XMMWORD PTR [__svml_dlog10_ha_data_internal+8512] + vfmadd213pd xmm15, xmm0, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8512] vpextrd ecx, xmm4, 2 movsxd rax, eax movsxd rcx, ecx mov QWORD PTR [248+rsp], r13 - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+r8+rax] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+r8+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+r8+rax] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+r8+rcx] vunpcklpd xmm12, xmm3, xmm5 vunpckhpd xmm10, xmm3, xmm5 vmulpd xmm5, xmm0, xmm0 - vfmadd231pd xmm12, xmm2, XMMWORD PTR [__svml_dlog10_ha_data_internal+9472] - vfmadd132pd xmm2, xmm10, XMMWORD PTR [__svml_dlog10_ha_data_internal+9536] - vmovupd xmm10, XMMWORD PTR [__svml_dlog10_ha_data_internal+8320] - vmovupd xmm3, XMMWORD PTR [__svml_dlog10_ha_data_internal+8576] - vfmadd213pd xmm10, xmm0, XMMWORD PTR [__svml_dlog10_ha_data_internal+8384] - vfmadd213pd xmm3, xmm0, XMMWORD PTR [__svml_dlog10_ha_data_internal+8640] + vfmadd231pd xmm12, xmm2, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9472] + vfmadd132pd xmm2, xmm10, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+9536] + vmovupd xmm10, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8320] + vmovupd xmm3, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8576] + vfmadd213pd xmm10, xmm0, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8384] + vfmadd213pd xmm3, xmm0, XMMWORD PTR [__jsvml_dlog10_ha_data_internal+8640] vaddpd xmm4, xmm0, xmm12 vfmadd213pd xmm10, xmm5, xmm15 vsubpd xmm12, xmm4, xmm12 @@ -1275,19 +1275,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_log102_ha_l9 ENDP +__jsvml_log102_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log102_ha_l9_B1_B3: +_unwind___jsvml_log102_ha_l9_B1_B3: DD 671233 DD 2020414 DD 960566 @@ -1302,19 +1302,19 @@ _unwind___svml_log102_ha_l9_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_log102_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log102_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log102_ha_l9_B6_B10: +_unwind___jsvml_log102_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_log102_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log102_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1323,7 +1323,7 @@ _unwind___svml_log102_ha_l9_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_log102_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log102_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1337,9 +1337,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log104_ha_l9 + PUBLIC __jsvml_log104_ha_l9 -__svml_log104_ha_l9 PROC EXPORT +__jsvml_log104_ha_l9 PROC EXPORT _B9_1:: @@ -1358,13 +1358,13 @@ L95:: lea r13, QWORD PTR [335+rsp] vmovdqa ymm2, ymm0 and r13, -64 - vandpd ymm12, ymm2, YMMWORD PTR [__svml_dlog10_ha_data_internal+9024] - vorpd ymm0, ymm12, YMMWORD PTR [__svml_dlog10_ha_data_internal+9088] + vandpd ymm12, ymm2, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9024] + vorpd ymm0, ymm12, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9088] vcvtpd2ps xmm1, ymm0 vpsrlq ymm4, ymm2, 20 - vmovupd ymm14, YMMWORD PTR [__svml_dlog10_ha_data_internal+9344] + vmovupd ymm14, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9344] vrcpps xmm5, xmm1 - vcmpnle_uqpd ymm13, ymm2, YMMWORD PTR [__svml_dlog10_ha_data_internal+9216] + vcmpnle_uqpd ymm13, ymm2, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9216] vcvtps2pd ymm1, xmm5 vmulpd ymm12, ymm1, ymm14 vroundpd ymm12, ymm12, 0 @@ -1372,7 +1372,7 @@ L95:: mov QWORD PTR [536+rsp], r13 vextracti128 xmm3, ymm4, 1 vshufps xmm5, xmm4, xmm3, 221 - vcmplt_oqpd ymm3, ymm2, YMMWORD PTR [__svml_dlog10_ha_data_internal+9152] + vcmplt_oqpd ymm3, ymm2, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9152] vcvtdq2pd ymm1, xmm5 vorpd ymm4, ymm3, ymm13 vpsrlq ymm13, ymm12, 40 @@ -1387,25 +1387,25 @@ L95:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+rcx] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+r8] - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+r9] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dlog10_ha_data_internal)-4221888+rax+r10] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+rcx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+r8] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+r9] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dlog10_ha_data_internal)-4221888+rax+r10] vunpcklpd xmm13, xmm5, xmm4 vunpckhpd xmm4, xmm5, xmm4 vunpcklpd xmm3, xmm12, xmm14 vunpckhpd xmm14, xmm12, xmm14 - vmovupd ymm5, YMMWORD PTR [__svml_dlog10_ha_data_internal+8576] - vfmadd213pd ymm5, ymm0, YMMWORD PTR [__svml_dlog10_ha_data_internal+8640] + vmovupd ymm5, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8576] + vfmadd213pd ymm5, ymm0, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8640] vinsertf128 ymm3, ymm13, xmm3, 1 vinsertf128 ymm12, ymm4, xmm14, 1 - vmovupd ymm13, YMMWORD PTR [__svml_dlog10_ha_data_internal+8320] - vmovupd ymm14, YMMWORD PTR [__svml_dlog10_ha_data_internal+8448] + vmovupd ymm13, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8320] + vmovupd ymm14, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8448] vmulpd ymm4, ymm0, ymm0 - vfmadd231pd ymm3, ymm1, YMMWORD PTR [__svml_dlog10_ha_data_internal+9472] - vfmadd132pd ymm1, ymm12, YMMWORD PTR [__svml_dlog10_ha_data_internal+9536] - vfmadd213pd ymm13, ymm0, YMMWORD PTR [__svml_dlog10_ha_data_internal+8384] - vfmadd213pd ymm14, ymm0, YMMWORD PTR [__svml_dlog10_ha_data_internal+8512] + vfmadd231pd ymm3, ymm1, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9472] + vfmadd132pd ymm1, ymm12, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+9536] + vfmadd213pd ymm13, ymm0, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8384] + vfmadd213pd ymm14, ymm0, YMMWORD PTR [__jsvml_dlog10_ha_data_internal+8512] vaddpd ymm12, ymm0, ymm3 vfmadd213pd ymm13, ymm4, ymm14 vsubpd ymm3, ymm12, ymm3 @@ -1477,19 +1477,19 @@ _B9_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog10_ha_cout_rare_internal + call __jsvml_dlog10_ha_cout_rare_internal jmp _B9_8 ALIGN 16 _B9_11:: -__svml_log104_ha_l9 ENDP +__jsvml_log104_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log104_ha_l9_B1_B3: +_unwind___jsvml_log104_ha_l9_B1_B3: DD 668929 DD 4379701 DD 2082861 @@ -1504,13 +1504,13 @@ _unwind___svml_log104_ha_l9_B1_B3: DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_log104_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log104_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log104_ha_l9_B6_B10: +_unwind___jsvml_log104_ha_l9_B6_B10: DD 1198625 DD 2122826 DD 2176064 @@ -1523,7 +1523,7 @@ _unwind___svml_log104_ha_l9_B6_B10: DD 944139 DD imagerel _B9_1 DD imagerel _B9_6 - DD imagerel _unwind___svml_log104_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log104_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1532,7 +1532,7 @@ _unwind___svml_log104_ha_l9_B6_B10: DD imagerel _B9_6 DD imagerel _B9_11 - DD imagerel _unwind___svml_log104_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log104_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1546,9 +1546,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dlog10_ha_cout_rare_internal + PUBLIC __jsvml_dlog10_ha_cout_rare_internal -__svml_dlog10_ha_cout_rare_internal PROC +__jsvml_dlog10_ha_cout_rare_internal PROC _B10_1:: @@ -1755,13 +1755,13 @@ _B10_16:: _B10_17:: -__svml_dlog10_ha_cout_rare_internal ENDP +__jsvml_dlog10_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dlog10_ha_cout_rare_internal_B1_B16: +_unwind___jsvml_dlog10_ha_cout_rare_internal_B1_B16: DD 67585 DD 25096 @@ -1772,7 +1772,7 @@ _unwind___svml_dlog10_ha_cout_rare_internal_B1_B16: DD imagerel _B10_1 DD imagerel _B10_17 - DD imagerel _unwind___svml_dlog10_ha_cout_rare_internal_B1_B16 + DD imagerel _unwind___jsvml_dlog10_ha_cout_rare_internal_B1_B16 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1780,8 +1780,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dlog10_ha_data_internal_avx512 -__svml_dlog10_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dlog10_ha_data_internal_avx512 +__jsvml_dlog10_ha_data_internal_avx512 DD 0 DD 0 DD 721420288 DD 3214603769 @@ -2117,8 +2117,8 @@ __svml_dlog10_ha_data_internal_avx512 DD 0 DD 0 DD 120 DD 0 - PUBLIC __svml_dlog10_ha_data_internal -__svml_dlog10_ha_data_internal DD 1190572160 + PUBLIC __jsvml_dlog10_ha_data_internal +__jsvml_dlog10_ha_data_internal DD 1190572160 DD 3228777073 DD 3860447744 DD 3189665916 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_log1p_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log1p_windows_x86.S similarity index 86% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_log1p_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log1p_windows_x86.S index 0f3d075d362..28104c394b7 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_log1p_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log1p_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p4_ha_l9 + PUBLIC __jsvml_log1p4_ha_l9 -__svml_log1p4_ha_l9 PROC EXPORT +__jsvml_log1p4_ha_l9 PROC EXPORT _B1_1:: @@ -59,28 +59,28 @@ L1:: vmovups YMMWORD PTR [496+rsp], ymm9 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovupd ymm9, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13056] + vmovupd ymm9, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 - vmovupd ymm15, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12992] + vmovupd ymm15, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] vmovdqa ymm4, ymm0 vandpd ymm3, ymm4, ymm9 - vcmplt_oqpd ymm1, ymm3, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13120] + vcmplt_oqpd ymm1, ymm3, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] vaddpd ymm10, ymm4, ymm15 vmaxpd ymm13, ymm15, ymm4 vminpd ymm5, ymm15, ymm4 - vorpd ymm12, ymm1, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13184] + vorpd ymm12, ymm1, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] vandpd ymm2, ymm10, ymm12 vsubpd ymm1, ymm13, ymm2 - vmovupd ymm12, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13632] + vmovupd ymm12, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] vaddpd ymm0, ymm5, ymm1 - vandpd ymm14, ymm2, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12672] - vorpd ymm1, ymm14, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12736] + vandpd ymm14, ymm2, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] + vorpd ymm1, ymm14, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] vandnpd ymm3, ymm9, ymm4 vcvtpd2ps xmm9, ymm1 - vcmplt_oqpd ymm14, ymm4, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12800] + vcmplt_oqpd ymm14, ymm4, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] vrcpps xmm10, xmm9 vcvtps2pd ymm5, xmm10 - vandps ymm13, ymm2, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13568] + vandps ymm13, ymm2, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] vpsubq ymm12, ymm12, ymm13 vpsrlq ymm2, ymm2, 20 vroundpd ymm5, ymm5, 0 @@ -101,15 +101,15 @@ L1:: movsxd r10, r10d vextracti128 xmm9, ymm2, 1 vshufps xmm10, xmm2, xmm9, 221 - vcmpnle_uqpd ymm9, ymm4, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12864] + vcmpnle_uqpd ymm9, ymm4, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] vcvtdq2pd ymm2, xmm10 - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+rcx] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+rcx] vorpd ymm15, ymm14, ymm9 - vmovupd xmm9, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+r8] + vmovupd xmm9, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+r8] vmovmskpd edx, ymm15 - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+r9] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+r9] test edx, edx - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+r10] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+r10] vunpcklpd xmm12, xmm10, xmm9 vunpckhpd xmm9, xmm10, xmm9 vunpcklpd xmm5, xmm15, xmm14 @@ -117,13 +117,13 @@ L1:: vinsertf128 ymm5, ymm12, xmm5, 1 vinsertf128 ymm14, ymm9, xmm10, 1 vsubpd ymm9, ymm13, ymm1 - vmovupd ymm12, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12416] - vmovupd ymm1, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12544] + vmovupd ymm12, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] + vmovupd ymm1, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] vmulpd ymm10, ymm13, ymm13 - vfmadd231pd ymm5, ymm2, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13248] - vfmadd132pd ymm2, ymm14, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13312] - vfmadd213pd ymm12, ymm13, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12480] - vfmadd213pd ymm1, ymm13, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12608] + vfmadd231pd ymm5, ymm2, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] + vfmadd132pd ymm2, ymm14, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] + vfmadd213pd ymm12, ymm13, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] + vfmadd213pd ymm1, ymm13, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] vsubpd ymm0, ymm0, ymm9 vaddpd ymm9, ymm5, ymm13 vfmadd213pd ymm12, ymm10, ymm1 @@ -193,19 +193,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_log1p4_ha_l9 ENDP +__jsvml_log1p4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p4_ha_l9_B1_B3: +_unwind___jsvml_log1p4_ha_l9_B1_B3: DD 1069057 DD 4379728 DD 2070600 @@ -223,13 +223,13 @@ _unwind___svml_log1p4_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log1p4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1p4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p4_ha_l9_B6_B10: +_unwind___jsvml_log1p4_ha_l9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -239,7 +239,7 @@ _unwind___svml_log1p4_ha_l9_B6_B10: DD 550923 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log1p4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1p4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -248,7 +248,7 @@ _unwind___svml_log1p4_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_log1p4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log1p4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -262,9 +262,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p2_ha_ex + PUBLIC __jsvml_log1p2_ha_ex -__svml_log1p2_ha_ex PROC EXPORT +__jsvml_log1p2_ha_ex PROC EXPORT _B2_1:: @@ -283,23 +283,23 @@ L28:: movups XMMWORD PTR [240+rsp], xmm9 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm4, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13056] + movups xmm4, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 movaps xmm2, xmm4 andnps xmm4, xmm5 - movups xmm13, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12992] + movups xmm13, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] andps xmm2, xmm5 - cmpltpd xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13120] + cmpltpd xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] movaps xmm0, xmm13 movaps xmm11, xmm13 addpd xmm0, xmm5 maxpd xmm11, xmm5 - orps xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13184] + orps xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] movaps xmm3, xmm13 andps xmm0, xmm2 - movups xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12672] + movups xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] andps xmm2, xmm0 - orps xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12736] + orps xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] cvtpd2ps xmm1, xmm2 minpd xmm3, xmm5 subpd xmm11, xmm0 @@ -310,18 +310,18 @@ L28:: movups xmm10, XMMWORD PTR [_2il0floatpacket_31] addpd xmm11, xmm10 subpd xmm11, xmm10 - movdqu xmm9, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13568] + movdqu xmm9, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] movaps xmm10, xmm5 - movdqu xmm1, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13632] + movdqu xmm1, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] pand xmm9, xmm0 mulpd xmm2, xmm11 psubq xmm1, xmm9 - cmpltpd xmm10, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12800] + cmpltpd xmm10, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] subpd xmm2, xmm13 mulpd xmm1, xmm11 movaps xmm9, xmm5 psrlq xmm0, 20 - cmpnlepd xmm9, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12864] + cmpnlepd xmm9, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] mulpd xmm3, xmm1 pshufd xmm13, xmm0, 221 psrlq xmm11, 39 @@ -331,14 +331,14 @@ L28:: orps xmm10, xmm9 movd ecx, xmm13 movmskpd eax, xmm10 - movups xmm10, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13248] + movups xmm10, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] mulpd xmm10, xmm0 - mulpd xmm0, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13312] + mulpd xmm0, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] movsxd rdx, edx movsxd rcx, ecx mov QWORD PTR [264+rsp], r13 - movups xmm9, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+r8+rdx] - movups xmm11, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+r8+rcx] + movups xmm9, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+r8+rdx] + movups xmm11, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+r8+rcx] movaps xmm13, xmm9 unpcklpd xmm13, xmm11 unpckhpd xmm9, xmm11 @@ -346,20 +346,20 @@ L28:: addpd xmm11, xmm3 addpd xmm13, xmm10 addpd xmm9, xmm0 - movups xmm10, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12416] + movups xmm10, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] movaps xmm1, xmm11 mulpd xmm10, xmm11 mulpd xmm1, xmm11 - addpd xmm10, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12480] + addpd xmm10, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] movaps xmm0, xmm11 subpd xmm0, xmm2 mulpd xmm10, xmm1 subpd xmm3, xmm0 - movups xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12544] + movups xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] movaps xmm0, xmm13 mulpd xmm2, xmm11 addpd xmm0, xmm11 - addpd xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12608] + addpd xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] addpd xmm9, xmm3 addpd xmm2, xmm10 mulpd xmm1, xmm2 @@ -422,19 +422,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_log1p2_ha_ex ENDP +__jsvml_log1p2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p2_ha_ex_B1_B3: +_unwind___jsvml_log1p2_ha_ex_B1_B3: DD 803073 DD 2151489 DD 1022009 @@ -450,19 +450,19 @@ _unwind___svml_log1p2_ha_ex_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_log1p2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log1p2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p2_ha_ex_B6_B10: +_unwind___jsvml_log1p2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_log1p2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log1p2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -471,7 +471,7 @@ _unwind___svml_log1p2_ha_ex_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_log1p2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_log1p2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -485,9 +485,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p1_ha_l9 + PUBLIC __jsvml_log1p1_ha_l9 -__svml_log1p1_ha_l9 PROC EXPORT +__jsvml_log1p1_ha_l9 PROC EXPORT _B3_1:: @@ -507,41 +507,41 @@ L43:: vmovups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm10, QWORD PTR [__svml_dlog1p_ha_data_internal+13056] + vmovsd xmm10, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 vandpd xmm14, xmm15, xmm10 - vmovsd xmm0, QWORD PTR [__svml_dlog1p_ha_data_internal+12992] - vmovddup xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+12992] + vmovsd xmm0, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] + vmovddup xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] vaddsd xmm1, xmm0, xmm15 - vcmpltsd xmm4, xmm14, QWORD PTR [__svml_dlog1p_ha_data_internal+13120] + vcmpltsd xmm4, xmm14, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] vmovddup xmm7, xmm15 vandnpd xmm14, xmm10, xmm15 vmaxpd xmm2, xmm5, xmm7 vminpd xmm7, xmm5, xmm7 - vmovsd xmm3, QWORD PTR [__svml_dlog1p_ha_data_internal+13184] + vmovsd xmm3, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] vorpd xmm3, xmm3, xmm4 vandpd xmm1, xmm1, xmm3 - vmovsd xmm6, QWORD PTR [__svml_dlog1p_ha_data_internal+12736] + vmovsd xmm6, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] vsubsd xmm5, xmm2, xmm1 - vmovsd xmm2, QWORD PTR [__svml_dlog1p_ha_data_internal+12672] + vmovsd xmm2, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] vaddsd xmm5, xmm5, xmm7 vandpd xmm4, xmm1, xmm2 vorpd xmm7, xmm4, xmm6 vcvtpd2ps xmm2, xmm7 vmovlhps xmm3, xmm2, xmm2 vrcpps xmm4, xmm3 - vcmpltsd xmm3, xmm15, QWORD PTR [__svml_dlog1p_ha_data_internal+12800] + vcmpltsd xmm3, xmm15, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] vcvtps2pd xmm2, xmm4 - vcmpnlesd xmm4, xmm15, QWORD PTR [__svml_dlog1p_ha_data_internal+12864] - vmovq xmm6, QWORD PTR [__svml_dlog1p_ha_data_internal+13568] + vcmpnlesd xmm4, xmm15, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] + vmovq xmm6, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] vorpd xmm3, xmm3, xmm4 vroundsd xmm2, xmm2, xmm2, 0 - vmovq xmm10, QWORD PTR [__svml_dlog1p_ha_data_internal+13632] + vmovq xmm10, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] vfmsub213sd xmm7, xmm2, xmm0 vpand xmm0, xmm1, xmm6 vpsubq xmm10, xmm10, xmm0 vpsrlq xmm1, xmm1, 20 - vmovsd xmm4, QWORD PTR [__svml_dlog1p_ha_data_internal+13248] + vmovsd xmm4, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] vmulsd xmm0, xmm10, xmm2 vpsrlq xmm2, xmm2, 39 vmovd eax, xmm2 @@ -552,16 +552,16 @@ L43:: vmulsd xmm5, xmm5, xmm0 movsxd rax, eax vmovapd xmm6, xmm10 - vmovsd xmm2, QWORD PTR [__svml_dlog1p_ha_data_internal+12416] - vmovsd xmm0, QWORD PTR [__svml_dlog1p_ha_data_internal+12544] + vmovsd xmm2, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] + vmovsd xmm0, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] mov QWORD PTR [256+rsp], r13 - vfmadd213sd xmm6, xmm4, QWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rdx+rax] + vfmadd213sd xmm6, xmm4, QWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rdx+rax] vaddsd xmm4, xmm7, xmm5 - vmovddup xmm1, QWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454136+rdx+rax] + vmovddup xmm1, QWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454136+rdx+rax] vsubsd xmm7, xmm4, xmm7 - vfmadd132sd xmm10, xmm1, QWORD PTR [__svml_dlog1p_ha_data_internal+13312] - vfmadd213sd xmm2, xmm4, QWORD PTR [__svml_dlog1p_ha_data_internal+12480] - vfmadd213sd xmm0, xmm4, QWORD PTR [__svml_dlog1p_ha_data_internal+12608] + vfmadd132sd xmm10, xmm1, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] + vfmadd213sd xmm2, xmm4, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] + vfmadd213sd xmm0, xmm4, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] vmulsd xmm3, xmm4, xmm4 vsubsd xmm7, xmm5, xmm7 vaddsd xmm5, xmm6, xmm4 @@ -603,19 +603,19 @@ _B3_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B3_4 ALIGN 16 _B3_7:: -__svml_log1p1_ha_l9 ENDP +__jsvml_log1p1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p1_ha_l9_B1_B6: +_unwind___jsvml_log1p1_ha_l9_B1_B6: DD 936705 DD 1430603 DD 1009731 @@ -632,7 +632,7 @@ _unwind___svml_log1p1_ha_l9_B1_B6: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_log1p1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_log1p1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -646,9 +646,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p1_ha_e9 + PUBLIC __jsvml_log1p1_ha_e9 -__svml_log1p1_ha_e9 PROC EXPORT +__jsvml_log1p1_ha_e9 PROC EXPORT _B4_1:: @@ -668,23 +668,23 @@ L56:: vmovups XMMWORD PTR [192+rsp], xmm7 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm13, QWORD PTR [__svml_dlog1p_ha_data_internal+13056] + vmovsd xmm13, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 vandpd xmm7, xmm8, xmm13 - vmovsd xmm12, QWORD PTR [__svml_dlog1p_ha_data_internal+12992] - vmovddup xmm3, QWORD PTR [__svml_dlog1p_ha_data_internal+12992] + vmovsd xmm12, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] + vmovddup xmm3, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] vaddsd xmm5, xmm12, xmm8 - vcmpltsd xmm15, xmm7, QWORD PTR [__svml_dlog1p_ha_data_internal+13120] + vcmpltsd xmm15, xmm7, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] vmovddup xmm4, xmm8 vandnpd xmm7, xmm13, xmm8 vmaxpd xmm2, xmm3, xmm4 vminpd xmm3, xmm3, xmm4 - vmovsd xmm1, QWORD PTR [__svml_dlog1p_ha_data_internal+13184] + vmovsd xmm1, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] vorpd xmm0, xmm1, xmm15 vandpd xmm1, xmm5, xmm0 - vmovsd xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+12672] + vmovsd xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] vsubsd xmm4, xmm2, xmm1 - vmovsd xmm0, QWORD PTR [__svml_dlog1p_ha_data_internal+12736] + vmovsd xmm0, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] vandpd xmm2, xmm1, xmm5 vorpd xmm0, xmm2, xmm0 vaddsd xmm4, xmm4, xmm3 @@ -692,13 +692,13 @@ L56:: vmovlhps xmm3, xmm5, xmm5 vrcpps xmm2, xmm3 vcvtps2pd xmm5, xmm2 - vcmpnlesd xmm2, xmm8, QWORD PTR [__svml_dlog1p_ha_data_internal+12864] + vcmpnlesd xmm2, xmm8, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] vroundsd xmm3, xmm5, xmm5, 0 vmulsd xmm0, xmm0, xmm3 - vcmpltsd xmm5, xmm8, QWORD PTR [__svml_dlog1p_ha_data_internal+12800] - vmovq xmm13, QWORD PTR [__svml_dlog1p_ha_data_internal+13568] + vcmpltsd xmm5, xmm8, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] + vmovq xmm13, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] vorpd xmm5, xmm5, xmm2 - vmovq xmm15, QWORD PTR [__svml_dlog1p_ha_data_internal+13632] + vmovq xmm15, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] vsubsd xmm0, xmm0, xmm12 vmovmskpd ecx, xmm5 vpand xmm12, xmm1, xmm13 @@ -712,20 +712,20 @@ L56:: vpshufd xmm12, xmm1, 0 vcvtdq2pd xmm13, xmm12 vaddsd xmm12, xmm0, xmm4 - vmulsd xmm2, xmm13, QWORD PTR [__svml_dlog1p_ha_data_internal+13248] + vmulsd xmm2, xmm13, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] vsubsd xmm0, xmm12, xmm0 - vmulsd xmm13, xmm13, QWORD PTR [__svml_dlog1p_ha_data_internal+13312] + vmulsd xmm13, xmm13, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] vsubsd xmm1, xmm4, xmm0 - vmovsd xmm15, QWORD PTR [__svml_dlog1p_ha_data_internal+12416] + vmovsd xmm15, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] vmulsd xmm4, xmm15, xmm12 movsxd rax, eax - vmovsd xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+12544] + vmovsd xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] vmulsd xmm0, xmm5, xmm12 vmulsd xmm5, xmm12, xmm12 - vaddsd xmm3, xmm13, QWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454136+rdx+rax] - vaddsd xmm13, xmm4, QWORD PTR [__svml_dlog1p_ha_data_internal+12480] - vaddsd xmm2, xmm2, QWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rdx+rax] - vaddsd xmm4, xmm0, QWORD PTR [__svml_dlog1p_ha_data_internal+12608] + vaddsd xmm3, xmm13, QWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454136+rdx+rax] + vaddsd xmm13, xmm4, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] + vaddsd xmm2, xmm2, QWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rdx+rax] + vaddsd xmm4, xmm0, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] vaddsd xmm3, xmm3, xmm1 vmulsd xmm15, xmm13, xmm5 mov QWORD PTR [256+rsp], r13 @@ -768,19 +768,19 @@ _B4_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B4_4 ALIGN 16 _B4_7:: -__svml_log1p1_ha_e9 ENDP +__jsvml_log1p1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p1_ha_e9_B1_B6: +_unwind___jsvml_log1p1_ha_e9_B1_B6: DD 936705 DD 1430603 DD 817219 @@ -797,7 +797,7 @@ _unwind___svml_log1p1_ha_e9_B1_B6: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_log1p1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_log1p1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -811,9 +811,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p4_ha_e9 + PUBLIC __jsvml_log1p4_ha_e9 -__svml_log1p4_ha_e9 PROC EXPORT +__jsvml_log1p4_ha_e9 PROC EXPORT _B5_1:: @@ -834,22 +834,22 @@ L69:: vmovups YMMWORD PTR [464+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [207+rsp] - vmovupd ymm1, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13056] + vmovupd ymm1, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 - vmovupd ymm15, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12992] + vmovupd ymm15, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] vmovapd ymm3, ymm0 vandpd ymm2, ymm3, ymm1 - vcmplt_oqpd ymm2, ymm2, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13120] + vcmplt_oqpd ymm2, ymm2, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] vaddpd ymm5, ymm3, ymm15 vmaxpd ymm4, ymm15, ymm3 - vorpd ymm8, ymm2, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13184] + vorpd ymm8, ymm2, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] vandpd ymm6, ymm5, ymm8 - vandpd ymm14, ymm6, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12672] - vorpd ymm0, ymm14, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12736] + vandpd ymm14, ymm6, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] + vorpd ymm0, ymm14, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] vcvtpd2ps xmm7, ymm0 - vmovupd xmm5, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13632] + vmovupd xmm5, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] vsubpd ymm13, ymm4, ymm6 - vmovupd xmm4, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13568] + vmovupd xmm4, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] vrcpps xmm9, xmm7 vcvtps2pd ymm8, xmm9 vroundpd ymm8, ymm8, 0 @@ -866,8 +866,8 @@ L69:: vpsrlq xmm14, xmm7, 20 vandps xmm4, xmm7, xmm4 vshufps xmm9, xmm13, xmm14, 221 - vcmplt_oqpd ymm13, ymm3, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12800] - vcmpnle_uqpd ymm14, ymm3, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12864] + vcmplt_oqpd ymm13, ymm3, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] + vcmpnle_uqpd ymm14, ymm3, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] vpsubq xmm5, xmm5, xmm4 vcvtdq2pd ymm9, xmm9 vorpd ymm13, ymm13, ymm14 @@ -888,30 +888,30 @@ L69:: vpextrd r10d, xmm14, 2 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+rcx] - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+r8] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+rcx] + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+r8] vaddpd ymm14, ymm0, ymm1 vunpcklpd xmm7, xmm13, xmm8 vunpckhpd xmm13, xmm13, xmm8 - vmulpd ymm8, ymm9, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13248] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+r9] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rax+r10] + vmulpd ymm8, ymm9, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+r9] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rax+r10] vunpcklpd xmm15, xmm4, xmm6 vunpckhpd xmm6, xmm4, xmm6 - vmulpd ymm5, ymm14, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12416] - vmulpd ymm9, ymm9, YMMWORD PTR [__svml_dlog1p_ha_data_internal+13312] + vmulpd ymm5, ymm14, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] + vmulpd ymm9, ymm9, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] vsubpd ymm0, ymm14, ymm0 vinsertf128 ymm15, ymm7, xmm15, 1 vaddpd ymm7, ymm15, ymm8 vmulpd ymm8, ymm14, ymm14 vinsertf128 ymm4, ymm13, xmm6, 1 vsubpd ymm13, ymm1, ymm0 - vaddpd ymm0, ymm5, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12480] + vaddpd ymm0, ymm5, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] vaddpd ymm4, ymm4, ymm9 - vmulpd ymm1, ymm14, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12544] + vmulpd ymm1, ymm14, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] vmulpd ymm6, ymm0, ymm8 vaddpd ymm4, ymm4, ymm13 - vaddpd ymm5, ymm1, YMMWORD PTR [__svml_dlog1p_ha_data_internal+12608] + vaddpd ymm5, ymm1, YMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] vaddpd ymm1, ymm7, ymm14 vaddpd ymm9, ymm5, ymm6 vsubpd ymm7, ymm1, ymm7 @@ -980,19 +980,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_log1p4_ha_e9 ENDP +__jsvml_log1p4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p4_ha_e9_B1_B3: +_unwind___jsvml_log1p4_ha_e9_B1_B3: DD 1202433 DD 4379737 DD 1927249 @@ -1011,13 +1011,13 @@ _unwind___svml_log1p4_ha_e9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_log1p4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1p4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p4_ha_e9_B6_B10: +_unwind___jsvml_log1p4_ha_e9_B6_B10: DD 665121 DD 1074214 DD 1127452 @@ -1026,7 +1026,7 @@ _unwind___svml_log1p4_ha_e9_B6_B10: DD 436232 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_log1p4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1p4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1035,7 +1035,7 @@ _unwind___svml_log1p4_ha_e9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_log1p4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log1p4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1049,9 +1049,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p1_ha_ex + PUBLIC __jsvml_log1p1_ha_ex -__svml_log1p1_ha_ex PROC EXPORT +__jsvml_log1p1_ha_ex PROC EXPORT _B6_1:: @@ -1072,27 +1072,27 @@ L96:: movaps xmm3, xmm10 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm6, QWORD PTR [__svml_dlog1p_ha_data_internal+13056] + movsd xmm6, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 movaps xmm5, xmm6 andnps xmm6, xmm10 - movsd xmm12, QWORD PTR [__svml_dlog1p_ha_data_internal+12992] + movsd xmm12, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] andps xmm5, xmm10 movaps xmm11, xmm12 movaps xmm2, xmm12 - movsd xmm1, QWORD PTR [__svml_dlog1p_ha_data_internal+13184] + movsd xmm1, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] addsd xmm11, xmm10 - cmpltsd xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+13120] + cmpltsd xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] unpcklpd xmm2, xmm12 orps xmm1, xmm5 unpcklpd xmm3, xmm10 movaps xmm4, xmm2 - movsd xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+12672] + movsd xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] andps xmm11, xmm1 maxpd xmm4, xmm3 minpd xmm2, xmm3 subsd xmm4, xmm11 - movsd xmm0, QWORD PTR [__svml_dlog1p_ha_data_internal+12736] + movsd xmm0, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] andps xmm5, xmm11 orps xmm5, xmm0 addsd xmm4, xmm2 @@ -1103,15 +1103,15 @@ L96:: movups xmm1, XMMWORD PTR [_2il0floatpacket_31] movaps xmm2, xmm10 addpd xmm0, xmm1 - cmpnlesd xmm2, QWORD PTR [__svml_dlog1p_ha_data_internal+12864] + cmpnlesd xmm2, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] subpd xmm0, xmm1 - movq xmm14, QWORD PTR [__svml_dlog1p_ha_data_internal+13568] + movq xmm14, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] movaps xmm1, xmm10 - movq xmm3, QWORD PTR [__svml_dlog1p_ha_data_internal+13632] + movq xmm3, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] pand xmm14, xmm11 psubq xmm3, xmm14 mulsd xmm5, xmm0 - cmpltsd xmm1, QWORD PTR [__svml_dlog1p_ha_data_internal+12800] + cmpltsd xmm1, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] mulsd xmm3, xmm0 subsd xmm5, xmm12 mulsd xmm4, xmm3 @@ -1127,23 +1127,23 @@ L96:: movmskpd ecx, xmm1 movaps xmm3, xmm0 movaps xmm11, xmm12 - mulsd xmm11, QWORD PTR [__svml_dlog1p_ha_data_internal+13248] + mulsd xmm11, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] subsd xmm3, xmm5 - mulsd xmm12, QWORD PTR [__svml_dlog1p_ha_data_internal+13312] + mulsd xmm12, QWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] subsd xmm4, xmm3 - movsd xmm3, QWORD PTR [__svml_dlog1p_ha_data_internal+12416] + movsd xmm3, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] movaps xmm2, xmm0 mulsd xmm3, xmm0 and ecx, 1 mulsd xmm2, xmm0 - addsd xmm3, QWORD PTR [__svml_dlog1p_ha_data_internal+12480] + addsd xmm3, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] movsxd rax, eax - movsd xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+12544] + movsd xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] mulsd xmm5, xmm0 mulsd xmm3, xmm2 - addsd xmm11, QWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+rdx+rax] - addsd xmm12, QWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454136+rdx+rax] - addsd xmm5, QWORD PTR [__svml_dlog1p_ha_data_internal+12608] + addsd xmm11, QWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+rdx+rax] + addsd xmm12, QWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454136+rdx+rax] + addsd xmm5, QWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] addsd xmm12, xmm4 addsd xmm3, xmm5 movaps xmm14, xmm11 @@ -1186,19 +1186,19 @@ _B6_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_log1p1_ha_ex ENDP +__jsvml_log1p1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p1_ha_ex_B1_B6: +_unwind___jsvml_log1p1_ha_ex_B1_B6: DD 937473 DD 1430606 DD 1009730 @@ -1215,7 +1215,7 @@ _unwind___svml_log1p1_ha_ex_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_log1p1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_log1p1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1229,9 +1229,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p2_ha_e9 + PUBLIC __jsvml_log1p2_ha_e9 -__svml_log1p2_ha_e9 PROC EXPORT +__jsvml_log1p2_ha_e9 PROC EXPORT _B7_1:: @@ -1250,19 +1250,19 @@ L109:: vmovups XMMWORD PTR [240+rsp], xmm11 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm13, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13056] + vmovupd xmm13, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 vandpd xmm4, xmm5, xmm13 - vmovupd xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12992] - vcmpltpd xmm4, xmm4, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13120] + vmovupd xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] + vcmpltpd xmm4, xmm4, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] vaddpd xmm1, xmm5, xmm14 vmaxpd xmm3, xmm14, xmm5 vminpd xmm11, xmm14, xmm5 - vorpd xmm2, xmm4, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13184] + vorpd xmm2, xmm4, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] vandnpd xmm4, xmm13, xmm5 vandpd xmm2, xmm1, xmm2 - vandpd xmm12, xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12672] - vorpd xmm1, xmm12, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12736] + vandpd xmm12, xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] + vorpd xmm1, xmm12, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] vcvtpd2ps xmm13, xmm1 vsubpd xmm3, xmm3, xmm2 vaddpd xmm3, xmm11, xmm3 @@ -1271,13 +1271,13 @@ L109:: vcvtps2pd xmm11, xmm0 vroundpd xmm11, xmm11, 0 vmulpd xmm1, xmm1, xmm11 - vpand xmm13, xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13568] + vpand xmm13, xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] vpsrlq xmm2, xmm2, 20 - vmovdqu xmm12, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13632] + vmovdqu xmm12, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] vpsubq xmm0, xmm12, xmm13 vsubpd xmm1, xmm1, xmm14 - vcmpltpd xmm12, xmm5, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12800] - vcmpnlepd xmm13, xmm5, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12864] + vcmpltpd xmm12, xmm5, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] + vcmpnlepd xmm13, xmm5, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] vmulpd xmm0, xmm11, xmm0 vpshufd xmm14, xmm2, 221 vpsrlq xmm2, xmm11, 39 @@ -1285,26 +1285,26 @@ L109:: vmulpd xmm3, xmm3, xmm0 vmovd eax, xmm2 vorpd xmm13, xmm12, xmm13 - vmulpd xmm11, xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13248] - vmulpd xmm14, xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13312] + vmulpd xmm11, xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] + vmulpd xmm14, xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] vmovmskpd edx, xmm13 vpextrd ecx, xmm2, 2 movsxd rax, eax movsxd rcx, ecx mov QWORD PTR [264+rsp], r13 - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+r8+rax] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+r8+rcx] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+r8+rax] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+r8+rcx] vunpcklpd xmm2, xmm12, xmm13 vunpckhpd xmm13, xmm12, xmm13 vaddpd xmm12, xmm2, xmm11 vaddpd xmm11, xmm13, xmm14 vaddpd xmm14, xmm1, xmm3 - vmulpd xmm2, xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12544] + vmulpd xmm2, xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] vsubpd xmm13, xmm14, xmm1 - vmulpd xmm1, xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12416] + vmulpd xmm1, xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] vsubpd xmm0, xmm3, xmm13 - vaddpd xmm13, xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12608] - vaddpd xmm3, xmm1, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12480] + vaddpd xmm13, xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] + vaddpd xmm3, xmm1, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] vmulpd xmm2, xmm14, xmm14 vaddpd xmm0, xmm11, xmm0 vmulpd xmm1, xmm3, xmm2 @@ -1366,19 +1366,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_log1p2_ha_e9 ENDP +__jsvml_log1p2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p2_ha_e9_B1_B3: +_unwind___jsvml_log1p2_ha_e9_B1_B3: DD 803329 DD 2151490 DD 1030202 @@ -1394,19 +1394,19 @@ _unwind___svml_log1p2_ha_e9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_log1p2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1p2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p2_ha_e9_B6_B10: +_unwind___jsvml_log1p2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_log1p2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1p2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1415,7 +1415,7 @@ _unwind___svml_log1p2_ha_e9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_log1p2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log1p2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1429,9 +1429,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p2_ha_l9 + PUBLIC __jsvml_log1p2_ha_l9 -__svml_log1p2_ha_l9 PROC EXPORT +__jsvml_log1p2_ha_l9 PROC EXPORT _B8_1:: @@ -1450,31 +1450,31 @@ L124:: vmovups XMMWORD PTR [240+rsp], xmm12 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm5, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13056] + vmovupd xmm5, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13056] and r13, -64 vandpd xmm12, xmm13, xmm5 - vmovupd xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12992] - vcmpltpd xmm2, xmm12, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13120] + vmovupd xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12992] + vcmpltpd xmm2, xmm12, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13120] vaddpd xmm3, xmm13, xmm14 vmaxpd xmm4, xmm14, xmm13 - vorpd xmm1, xmm2, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13184] + vorpd xmm1, xmm2, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13184] vandnpd xmm12, xmm5, xmm13 vandpd xmm15, xmm3, xmm1 vminpd xmm2, xmm14, xmm13 vsubpd xmm4, xmm4, xmm15 - vandpd xmm0, xmm15, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12672] + vandpd xmm0, xmm15, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12672] vaddpd xmm5, xmm2, xmm4 - vorpd xmm4, xmm0, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12736] + vorpd xmm4, xmm0, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12736] vcvtpd2ps xmm3, xmm4 vmovlhps xmm1, xmm3, xmm3 vrcpps xmm2, xmm1 vcvtps2pd xmm1, xmm2 - vpand xmm3, xmm15, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13568] + vpand xmm3, xmm15, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13568] vpsrlq xmm15, xmm15, 20 - vmovdqu xmm0, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13632] + vmovdqu xmm0, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13632] vpsubq xmm2, xmm0, xmm3 - vcmpltpd xmm3, xmm13, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12800] - vcmpnlepd xmm0, xmm13, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12864] + vcmpltpd xmm3, xmm13, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12800] + vcmpnlepd xmm0, xmm13, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12864] vroundpd xmm1, xmm1, 0 vorpd xmm0, xmm3, xmm0 vmulpd xmm2, xmm1, xmm2 @@ -1489,18 +1489,18 @@ L124:: movsxd rax, eax movsxd rcx, ecx mov QWORD PTR [264+rsp], r13 - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+r8+rax] - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dlog1p_ha_data_internal)-8454144+r8+rcx] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+r8+rax] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dlog1p_ha_data_internal)-8454144+r8+rcx] vunpcklpd xmm1, xmm15, xmm0 vunpckhpd xmm3, xmm15, xmm0 - vfmadd231pd xmm1, xmm14, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13248] - vfmadd132pd xmm14, xmm3, XMMWORD PTR [__svml_dlog1p_ha_data_internal+13312] - vmovupd xmm0, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12416] - vmovupd xmm15, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12544] + vfmadd231pd xmm1, xmm14, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13248] + vfmadd132pd xmm14, xmm3, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+13312] + vmovupd xmm0, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12416] + vmovupd xmm15, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12544] vaddpd xmm3, xmm4, xmm2 vsubpd xmm4, xmm3, xmm4 - vfmadd213pd xmm0, xmm3, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12480] - vfmadd213pd xmm15, xmm3, XMMWORD PTR [__svml_dlog1p_ha_data_internal+12608] + vfmadd213pd xmm0, xmm3, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12480] + vfmadd213pd xmm15, xmm3, XMMWORD PTR [__jsvml_dlog1p_ha_data_internal+12608] vsubpd xmm5, xmm2, xmm4 vaddpd xmm4, xmm1, xmm3 vmulpd xmm2, xmm3, xmm3 @@ -1561,19 +1561,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_log1p2_ha_l9 ENDP +__jsvml_log1p2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p2_ha_l9_B1_B3: +_unwind___jsvml_log1p2_ha_l9_B1_B3: DD 803329 DD 2151490 DD 1034298 @@ -1589,19 +1589,19 @@ _unwind___svml_log1p2_ha_l9_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_log1p2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1p2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p2_ha_l9_B6_B10: +_unwind___jsvml_log1p2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_log1p2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1p2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1610,7 +1610,7 @@ _unwind___svml_log1p2_ha_l9_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_log1p2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log1p2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1624,9 +1624,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1p8_ha_z0 + PUBLIC __jsvml_log1p8_ha_z0 -__svml_log1p8_ha_z0 PROC EXPORT +__jsvml_log1p8_ha_z0 PROC EXPORT _B9_1:: @@ -1639,9 +1639,9 @@ L139:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm24, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+256] + vmovups zmm24, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+256] and r13, -64 - vmovups zmm26, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+320] + vmovups zmm26, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+320] vmovaps zmm27, zmm0 vmaxpd zmm28, zmm24, zmm27 {sae} vminpd zmm30, zmm24, zmm27 {sae} @@ -1650,36 +1650,36 @@ L139:: vgetexppd zmm25, zmm29 {sae} vsubpd zmm31, zmm29, zmm28 {rn-sae} vrcp14pd zmm3, zmm23 - vmovups zmm29, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+384] + vmovups zmm29, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+384] vsubpd zmm1, zmm30, zmm31 {rn-sae} vxorpd zmm0, zmm25, zmm26 vrndscalepd zmm28, zmm3, 88 {sae} - vmovups zmm3, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+512] - vmovups zmm30, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+576] - vmovups zmm31, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+960] + vmovups zmm3, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+512] + vmovups zmm30, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+576] + vmovups zmm31, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+960] vscalefpd zmm22, zmm1, zmm0 {rn-sae} vcmppd k1, zmm28, zmm29, 17 {sae} vfmsub213pd zmm23, zmm28, zmm24 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+128] + vmovups zmm0, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+128] vmulpd zmm4, zmm28, zmm22 {rn-sae} vaddpd zmm25{k1}, zmm25, zmm24 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+448] + vmovups zmm24, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+448] vaddpd zmm22, zmm23, zmm4 {rn-sae} vsubpd zmm2, zmm22, zmm23 {rn-sae} vmulpd zmm1, zmm22, zmm22 {rn-sae} vfmadd231pd zmm3, zmm24, zmm22 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+896] + vmovups zmm24, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+896] vpsrlq zmm23, zmm28, 48 - vmovups zmm28, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+768] + vmovups zmm28, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+768] vsubpd zmm5, zmm4, zmm2 {rn-sae} - vpermt2pd zmm0, zmm23, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+192] - vmovups zmm2, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+640] - vmovups zmm4, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512] + vpermt2pd zmm0, zmm23, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+192] + vmovups zmm2, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+640] + vmovups zmm4, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512] vaddpd zmm0, zmm0, zmm5 {rn-sae} vfmadd231pd zmm2, zmm30, zmm22 {rn-sae} - vmovups zmm5, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+704] - vpermt2pd zmm4, zmm23, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+64] - vmovups zmm23, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+832] + vmovups zmm5, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+704] + vpermt2pd zmm4, zmm23, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+64] + vmovups zmm23, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+832] vfmadd213pd zmm3, zmm1, zmm2 {rn-sae} vfmadd231pd zmm4, zmm31, zmm25 {rn-sae} vfmadd231pd zmm28, zmm5, zmm22 {rn-sae} @@ -1690,7 +1690,7 @@ L139:: vsubpd zmm4, zmm29, zmm4 {rn-sae} vfmadd213pd zmm3, zmm2, zmm28 {rn-sae} vsubpd zmm5, zmm22, zmm4 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dlog1p_ha_data_internal_avx512+1024] + vmovups zmm22, ZMMWORD PTR [__jsvml_dlog1p_ha_data_internal_avx512+1024] vfmadd213pd zmm3, zmm1, zmm5 {rn-sae} vcmppd k0, zmm5, zmm5, 4 {sae} vfmadd213pd zmm25, zmm22, zmm0 {rn-sae} @@ -1830,19 +1830,19 @@ _B9_15:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog1p_ha_cout_rare_internal + call __jsvml_dlog1p_ha_cout_rare_internal jmp _B9_13 ALIGN 16 _B9_16:: -__svml_log1p8_ha_z0 ENDP +__jsvml_log1p8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p8_ha_z0_B1_B9: +_unwind___jsvml_log1p8_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -1854,13 +1854,13 @@ _unwind___svml_log1p8_ha_z0_B1_B9: DD imagerel _B9_1 DD imagerel _B9_11 - DD imagerel _unwind___svml_log1p8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_log1p8_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1p8_ha_z0_B11_B15: +_unwind___jsvml_log1p8_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -1896,7 +1896,7 @@ _unwind___svml_log1p8_ha_z0_B11_B15: DD imagerel _B9_11 DD imagerel _B9_16 - DD imagerel _unwind___svml_log1p8_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_log1p8_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1910,9 +1910,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dlog1p_ha_cout_rare_internal + PUBLIC __jsvml_dlog1p_ha_cout_rare_internal -__svml_dlog1p_ha_cout_rare_internal PROC +__jsvml_dlog1p_ha_cout_rare_internal PROC _B10_1:: @@ -2112,13 +2112,13 @@ _B10_16:: _B10_17:: -__svml_dlog1p_ha_cout_rare_internal ENDP +__jsvml_dlog1p_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dlog1p_ha_cout_rare_internal_B1_B16: +_unwind___jsvml_dlog1p_ha_cout_rare_internal_B1_B16: DD 67585 DD 25096 @@ -2129,7 +2129,7 @@ _unwind___svml_dlog1p_ha_cout_rare_internal_B1_B16: DD imagerel _B10_1 DD imagerel _B10_17 - DD imagerel _unwind___svml_dlog1p_ha_cout_rare_internal_B1_B16 + DD imagerel _unwind___jsvml_dlog1p_ha_cout_rare_internal_B1_B16 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2137,8 +2137,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dlog1p_ha_data_internal_avx512 -__svml_dlog1p_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dlog1p_ha_data_internal_avx512 +__jsvml_dlog1p_ha_data_internal_avx512 DD 0 DD 0 DD 3222405120 DD 3215919664 @@ -2458,8 +2458,8 @@ __svml_dlog1p_ha_data_internal_avx512 DD 0 DD 0 DD 120 DD 0 - PUBLIC __svml_dlog1p_ha_data_internal -__svml_dlog1p_ha_data_internal DD 3715793664 + PUBLIC __jsvml_dlog1p_ha_data_internal +__jsvml_dlog1p_ha_data_internal DD 3715793664 DD 3230016299 DD 4013928704 DD 3189565726 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_log_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log_windows_x86.S similarity index 87% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_log_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log_windows_x86.S index f946679e963..b5a24abb17e 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_log_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_log_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1_ha_e9 + PUBLIC __jsvml_log1_ha_e9 -__svml_log1_ha_e9 PROC EXPORT +__jsvml_log1_ha_e9 PROC EXPORT _B1_1:: @@ -55,48 +55,48 @@ L1:: lea rdx, QWORD PTR [__ImageBase] mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm4, QWORD PTR [__svml_dlog_ha_data_internal+12672] + vmovsd xmm4, QWORD PTR [__jsvml_dlog_ha_data_internal+12672] and r13, -64 - vmovsd xmm2, QWORD PTR [__svml_dlog_ha_data_internal+12736] + vmovsd xmm2, QWORD PTR [__jsvml_dlog_ha_data_internal+12736] vandpd xmm3, xmm5, xmm4 vorpd xmm1, xmm3, xmm2 vcvtpd2ps xmm10, xmm1 vmovlhps xmm4, xmm10, xmm10 vpsrlq xmm10, xmm5, 20 vrcpps xmm3, xmm4 - vcmpnlesd xmm4, xmm5, QWORD PTR [__svml_dlog_ha_data_internal+12864] + vcmpnlesd xmm4, xmm5, QWORD PTR [__jsvml_dlog_ha_data_internal+12864] vcvtps2pd xmm0, xmm3 - vcmpltsd xmm3, xmm5, QWORD PTR [__svml_dlog_ha_data_internal+12800] + vcmpltsd xmm3, xmm5, QWORD PTR [__jsvml_dlog_ha_data_internal+12800] vroundsd xmm2, xmm0, xmm0, 0 vorpd xmm4, xmm3, xmm4 vpshufd xmm0, xmm10, 85 vpshufd xmm10, xmm0, 0 - vmovsd xmm3, QWORD PTR [__svml_dlog_ha_data_internal+12928] + vmovsd xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+12928] vcvtdq2pd xmm0, xmm10 vmovmskpd ecx, xmm4 vandpd xmm10, xmm1, xmm3 - vmulsd xmm3, xmm0, QWORD PTR [__svml_dlog_ha_data_internal+13056] + vmulsd xmm3, xmm0, QWORD PTR [__jsvml_dlog_ha_data_internal+13056] vsubsd xmm1, xmm1, xmm10 vmulsd xmm10, xmm10, xmm2 vmulsd xmm4, xmm1, xmm2 - vsubsd xmm1, xmm10, QWORD PTR [__svml_dlog_ha_data_internal+12992] + vsubsd xmm1, xmm10, QWORD PTR [__jsvml_dlog_ha_data_internal+12992] vpsrlq xmm2, xmm2, 39 vaddsd xmm4, xmm1, xmm4 vmovd eax, xmm2 - vmulsd xmm2, xmm0, QWORD PTR [__svml_dlog_ha_data_internal+13120] - vmovsd xmm0, QWORD PTR [__svml_dlog_ha_data_internal+12416] + vmulsd xmm2, xmm0, QWORD PTR [__jsvml_dlog_ha_data_internal+13120] + vmovsd xmm0, QWORD PTR [__jsvml_dlog_ha_data_internal+12416] vmulsd xmm1, xmm0, xmm4 vmulsd xmm0, xmm4, xmm4 - vaddsd xmm1, xmm1, QWORD PTR [__svml_dlog_ha_data_internal+12480] - vmovsd xmm10, QWORD PTR [__svml_dlog_ha_data_internal+12544] + vaddsd xmm1, xmm1, QWORD PTR [__jsvml_dlog_ha_data_internal+12480] + vmovsd xmm10, QWORD PTR [__jsvml_dlog_ha_data_internal+12544] vmulsd xmm10, xmm10, xmm4 vmulsd xmm1, xmm1, xmm0 - vaddsd xmm10, xmm10, QWORD PTR [__svml_dlog_ha_data_internal+12608] + vaddsd xmm10, xmm10, QWORD PTR [__jsvml_dlog_ha_data_internal+12608] movsxd rax, eax vaddsd xmm10, xmm1, xmm10 - vaddsd xmm3, xmm3, QWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rdx+rax] + vaddsd xmm3, xmm3, QWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rdx+rax] vmulsd xmm1, xmm10, xmm0 - vaddsd xmm10, xmm2, QWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454136+rdx+rax] + vaddsd xmm10, xmm2, QWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454136+rdx+rax] vaddsd xmm2, xmm3, xmm4 mov QWORD PTR [192+rsp], r13 vsubsd xmm0, xmm2, xmm3 @@ -130,19 +130,19 @@ _B1_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B1_4 ALIGN 16 _B1_7:: -__svml_log1_ha_e9 ENDP +__jsvml_log1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1_ha_e9_B1_B6: +_unwind___jsvml_log1_ha_e9_B1_B6: DD 403201 DD 1430567 DD 763928 @@ -155,7 +155,7 @@ _unwind___svml_log1_ha_e9_B1_B6: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_log1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_log1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -169,9 +169,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1_ha_ex + PUBLIC __jsvml_log1_ha_ex -__svml_log1_ha_ex PROC EXPORT +__jsvml_log1_ha_ex PROC EXPORT _B2_1:: @@ -187,15 +187,15 @@ L6:: movaps xmm6, xmm1 mov QWORD PTR [168+rsp], r13 movaps xmm5, xmm1 - movsd xmm3, QWORD PTR [__svml_dlog_ha_data_internal+12672] + movsd xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+12672] lea rdx, QWORD PTR [__ImageBase] - movsd xmm2, QWORD PTR [__svml_dlog_ha_data_internal+12736] + movsd xmm2, QWORD PTR [__jsvml_dlog_ha_data_internal+12736] andps xmm3, xmm1 orps xmm3, xmm2 lea r13, QWORD PTR [95+rsp] cvtpd2ps xmm4, xmm3 - cmpltsd xmm6, QWORD PTR [__svml_dlog_ha_data_internal+12800] - cmpnlesd xmm5, QWORD PTR [__svml_dlog_ha_data_internal+12864] + cmpltsd xmm6, QWORD PTR [__jsvml_dlog_ha_data_internal+12800] + cmpnlesd xmm5, QWORD PTR [__jsvml_dlog_ha_data_internal+12864] movlhps xmm4, xmm4 orps xmm6, xmm5 rcpps xmm0, xmm4 @@ -211,32 +211,32 @@ L6:: and ecx, 1 pshufd xmm4, xmm0, 0 cvtdq2pd xmm0, xmm4 - movsd xmm4, QWORD PTR [__svml_dlog_ha_data_internal+12928] + movsd xmm4, QWORD PTR [__jsvml_dlog_ha_data_internal+12928] andps xmm4, xmm3 - movsd xmm5, QWORD PTR [__svml_dlog_ha_data_internal+12544] + movsd xmm5, QWORD PTR [__jsvml_dlog_ha_data_internal+12544] subsd xmm3, xmm4 mulsd xmm4, xmm2 mulsd xmm3, xmm2 - subsd xmm4, QWORD PTR [__svml_dlog_ha_data_internal+12992] + subsd xmm4, QWORD PTR [__jsvml_dlog_ha_data_internal+12992] psrlq xmm2, 39 addsd xmm4, xmm3 movd eax, xmm2 - movsd xmm3, QWORD PTR [__svml_dlog_ha_data_internal+12416] + movsd xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+12416] movaps xmm6, xmm4 mulsd xmm3, xmm4 movaps xmm2, xmm0 mulsd xmm5, xmm4 mulsd xmm6, xmm4 - addsd xmm3, QWORD PTR [__svml_dlog_ha_data_internal+12480] - mulsd xmm2, QWORD PTR [__svml_dlog_ha_data_internal+13056] - addsd xmm5, QWORD PTR [__svml_dlog_ha_data_internal+12608] - mulsd xmm0, QWORD PTR [__svml_dlog_ha_data_internal+13120] + addsd xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+12480] + mulsd xmm2, QWORD PTR [__jsvml_dlog_ha_data_internal+13056] + addsd xmm5, QWORD PTR [__jsvml_dlog_ha_data_internal+12608] + mulsd xmm0, QWORD PTR [__jsvml_dlog_ha_data_internal+13120] mulsd xmm3, xmm6 movsxd rax, eax addsd xmm3, xmm5 - addsd xmm2, QWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rdx+rax] + addsd xmm2, QWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rdx+rax] mulsd xmm3, xmm6 - addsd xmm0, QWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454136+rdx+rax] + addsd xmm0, QWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454136+rdx+rax] movaps xmm6, xmm2 mov QWORD PTR [192+rsp], r13 addsd xmm6, xmm4 @@ -271,19 +271,19 @@ _B2_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B2_4 ALIGN 16 _B2_7:: -__svml_log1_ha_ex ENDP +__jsvml_log1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1_ha_ex_B1_B6: +_unwind___jsvml_log1_ha_ex_B1_B6: DD 401665 DD 1430561 DD 747542 @@ -296,7 +296,7 @@ _unwind___svml_log1_ha_ex_B1_B6: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_log1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_log1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -310,9 +310,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log2_ha_ex + PUBLIC __jsvml_log2_ha_ex -__svml_log2_ha_ex PROC EXPORT +__jsvml_log2_ha_ex PROC EXPORT _B3_1:: @@ -332,10 +332,10 @@ L11:: lea r8, QWORD PTR [__ImageBase] mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm13, XMMWORD PTR [__svml_dlog_ha_data_internal+12672] + movups xmm13, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12672] and r13, -64 andps xmm13, xmm5 - orps xmm13, XMMWORD PTR [__svml_dlog_ha_data_internal+12736] + orps xmm13, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12736] cvtpd2ps xmm3, xmm13 movlhps xmm3, xmm3 rcpps xmm2, xmm3 @@ -343,16 +343,16 @@ L11:: movups xmm1, XMMWORD PTR [_2il0floatpacket_26] movaps xmm2, xmm5 addpd xmm4, xmm1 - cmpltpd xmm2, XMMWORD PTR [__svml_dlog_ha_data_internal+12800] + cmpltpd xmm2, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12800] subpd xmm4, xmm1 - movups xmm1, XMMWORD PTR [__svml_dlog_ha_data_internal+12928] + movups xmm1, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12928] movaps xmm3, xmm5 andps xmm1, xmm13 subpd xmm13, xmm1 - cmpnlepd xmm3, XMMWORD PTR [__svml_dlog_ha_data_internal+12864] + cmpnlepd xmm3, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12864] mulpd xmm1, xmm4 mulpd xmm13, xmm4 - subpd xmm1, XMMWORD PTR [__svml_dlog_ha_data_internal+12992] + subpd xmm1, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12992] pshufd xmm14, xmm15, 221 psrlq xmm4, 39 cvtdq2pd xmm0, xmm14 @@ -361,27 +361,27 @@ L11:: pshufd xmm4, xmm4, 2 orps xmm2, xmm3 movd ecx, xmm4 - movups xmm4, XMMWORD PTR [__svml_dlog_ha_data_internal+13056] - movups xmm14, XMMWORD PTR [__svml_dlog_ha_data_internal+12416] + movups xmm4, XMMWORD PTR [__jsvml_dlog_ha_data_internal+13056] + movups xmm14, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12416] movsxd rdx, edx mulpd xmm4, xmm0 mulpd xmm14, xmm13 - mulpd xmm0, XMMWORD PTR [__svml_dlog_ha_data_internal+13120] + mulpd xmm0, XMMWORD PTR [__jsvml_dlog_ha_data_internal+13120] movmskpd eax, xmm2 - movups xmm3, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+r8+rdx] + movups xmm3, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+r8+rdx] movaps xmm2, xmm3 movsxd rcx, ecx - movups xmm15, XMMWORD PTR [__svml_dlog_ha_data_internal+12544] - addpd xmm14, XMMWORD PTR [__svml_dlog_ha_data_internal+12480] + movups xmm15, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12544] + addpd xmm14, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12480] mulpd xmm15, xmm13 - movups xmm1, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+r8+rcx] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+r8+rcx] unpcklpd xmm2, xmm1 unpckhpd xmm3, xmm1 movaps xmm1, xmm13 mulpd xmm1, xmm13 addpd xmm2, xmm4 addpd xmm3, xmm0 - addpd xmm15, XMMWORD PTR [__svml_dlog_ha_data_internal+12608] + addpd xmm15, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12608] mulpd xmm14, xmm1 movaps xmm0, xmm13 addpd xmm0, xmm2 @@ -445,19 +445,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_log2_ha_ex ENDP +__jsvml_log2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log2_ha_ex_B1_B3: +_unwind___jsvml_log2_ha_ex_B1_B3: DD 672257 DD 2020418 DD 972851 @@ -472,19 +472,19 @@ _unwind___svml_log2_ha_ex_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_log2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log2_ha_ex_B6_B10: +_unwind___jsvml_log2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_log2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -493,7 +493,7 @@ _unwind___svml_log2_ha_ex_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_log2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_log2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -507,9 +507,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log4_ha_l9 + PUBLIC __jsvml_log4_ha_l9 -__svml_log4_ha_l9 PROC EXPORT +__jsvml_log4_ha_l9 PROC EXPORT _B4_1:: @@ -528,21 +528,21 @@ L24:: lea r13, QWORD PTR [335+rsp] vmovapd ymm3, ymm0 and r13, -64 - vandpd ymm2, ymm3, YMMWORD PTR [__svml_dlog_ha_data_internal+12672] - vorpd ymm2, ymm2, YMMWORD PTR [__svml_dlog_ha_data_internal+12736] + vandpd ymm2, ymm3, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12672] + vorpd ymm2, ymm2, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12736] vcvtpd2ps xmm1, ymm2 vpsrlq ymm5, ymm3, 20 - vcmplt_oqpd ymm13, ymm3, YMMWORD PTR [__svml_dlog_ha_data_internal+12800] + vcmplt_oqpd ymm13, ymm3, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12800] vrcpps xmm4, xmm1 vcvtps2pd ymm12, xmm4 - vcmpnle_uqpd ymm4, ymm3, YMMWORD PTR [__svml_dlog_ha_data_internal+12864] + vcmpnle_uqpd ymm4, ymm3, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12864] mov QWORD PTR [536+rsp], r13 vextracti128 xmm14, ymm5, 1 vshufps xmm1, xmm5, xmm14, 221 vroundpd ymm14, ymm12, 0 vcvtdq2pd ymm0, xmm1 vpsrlq ymm1, ymm14, 39 - vfmsub213pd ymm2, ymm14, YMMWORD PTR [__svml_dlog_ha_data_internal+12992] + vfmsub213pd ymm2, ymm14, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12992] vorpd ymm5, ymm13, ymm4 vmovmskpd edx, ymm5 vextracti128 xmm13, ymm1, 1 @@ -554,24 +554,24 @@ L24:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+rcx] - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+r8] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+r9] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+r10] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+rcx] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+r8] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+r9] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+r10] vunpcklpd xmm1, xmm14, xmm12 vunpckhpd xmm12, xmm14, xmm12 vunpcklpd xmm13, xmm5, xmm4 vunpckhpd xmm4, xmm5, xmm4 - vmovupd ymm5, YMMWORD PTR [__svml_dlog_ha_data_internal+12416] - vfmadd213pd ymm5, ymm2, YMMWORD PTR [__svml_dlog_ha_data_internal+12480] + vmovupd ymm5, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12416] + vfmadd213pd ymm5, ymm2, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12480] vinsertf128 ymm1, ymm1, xmm13, 1 vinsertf128 ymm14, ymm12, xmm4, 1 - vmulpd ymm13, ymm0, YMMWORD PTR [__svml_dlog_ha_data_internal+13056] - vmulpd ymm12, ymm0, YMMWORD PTR [__svml_dlog_ha_data_internal+13120] - vmovupd ymm0, YMMWORD PTR [__svml_dlog_ha_data_internal+12544] + vmulpd ymm13, ymm0, YMMWORD PTR [__jsvml_dlog_ha_data_internal+13056] + vmulpd ymm12, ymm0, YMMWORD PTR [__jsvml_dlog_ha_data_internal+13120] + vmovupd ymm0, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12544] vmulpd ymm4, ymm2, ymm2 vaddpd ymm12, ymm14, ymm12 - vfmadd213pd ymm0, ymm2, YMMWORD PTR [__svml_dlog_ha_data_internal+12608] + vfmadd213pd ymm0, ymm2, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12608] vfmadd213pd ymm5, ymm4, ymm0 vaddpd ymm0, ymm1, ymm13 vmulpd ymm5, ymm4, ymm5 @@ -644,19 +644,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_log4_ha_l9 ENDP +__jsvml_log4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log4_ha_l9_B1_B3: +_unwind___jsvml_log4_ha_l9_B1_B3: DD 668929 DD 4379701 DD 2082861 @@ -671,13 +671,13 @@ _unwind___svml_log4_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log4_ha_l9_B6_B10: +_unwind___jsvml_log4_ha_l9_B6_B10: DD 1198625 DD 2122826 DD 2176064 @@ -690,7 +690,7 @@ _unwind___svml_log4_ha_l9_B6_B10: DD 944139 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -699,7 +699,7 @@ _unwind___svml_log4_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_log4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -713,9 +713,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log2_ha_l9 + PUBLIC __jsvml_log2_ha_l9 -__svml_log2_ha_l9 PROC EXPORT +__jsvml_log2_ha_l9 PROC EXPORT _B5_1:: @@ -734,39 +734,39 @@ L51:: vmovups XMMWORD PTR [224+rsp], xmm11 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd xmm1, xmm13, XMMWORD PTR [__svml_dlog_ha_data_internal+12672] + vandpd xmm1, xmm13, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12672] and r13, -64 - vorpd xmm12, xmm1, XMMWORD PTR [__svml_dlog_ha_data_internal+12736] + vorpd xmm12, xmm1, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12736] vcvtpd2ps xmm2, xmm12 vmovlhps xmm4, xmm2, xmm2 vrcpps xmm5, xmm4 - vcmpltpd xmm2, xmm13, XMMWORD PTR [__svml_dlog_ha_data_internal+12800] - vcmpnlepd xmm4, xmm13, XMMWORD PTR [__svml_dlog_ha_data_internal+12864] + vcmpltpd xmm2, xmm13, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12800] + vcmpnlepd xmm4, xmm13, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12864] vcvtps2pd xmm3, xmm5 vpshufd xmm1, xmm0, 221 vorpd xmm5, xmm2, xmm4 vroundpd xmm3, xmm3, 0 vcvtdq2pd xmm11, xmm1 - vfmsub213pd xmm12, xmm3, XMMWORD PTR [__svml_dlog_ha_data_internal+12992] + vfmsub213pd xmm12, xmm3, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12992] vmovmskpd edx, xmm5 vpsrlq xmm0, xmm3, 39 vmovd eax, xmm0 - vmulpd xmm3, xmm11, XMMWORD PTR [__svml_dlog_ha_data_internal+13056] + vmulpd xmm3, xmm11, XMMWORD PTR [__jsvml_dlog_ha_data_internal+13056] vpextrd ecx, xmm0, 2 movsxd rax, eax movsxd rcx, ecx vmulpd xmm0, xmm12, xmm12 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+r8+rax] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+r8+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+r8+rax] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+r8+rcx] vunpcklpd xmm5, xmm1, xmm2 vunpckhpd xmm4, xmm1, xmm2 - vmulpd xmm2, xmm11, XMMWORD PTR [__svml_dlog_ha_data_internal+13120] + vmulpd xmm2, xmm11, XMMWORD PTR [__jsvml_dlog_ha_data_internal+13120] vaddpd xmm3, xmm5, xmm3 vaddpd xmm4, xmm4, xmm2 - vmovupd xmm1, XMMWORD PTR [__svml_dlog_ha_data_internal+12416] - vmovupd xmm11, XMMWORD PTR [__svml_dlog_ha_data_internal+12544] - vfmadd213pd xmm1, xmm12, XMMWORD PTR [__svml_dlog_ha_data_internal+12480] - vfmadd213pd xmm11, xmm12, XMMWORD PTR [__svml_dlog_ha_data_internal+12608] + vmovupd xmm1, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12416] + vmovupd xmm11, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12544] + vfmadd213pd xmm1, xmm12, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12480] + vfmadd213pd xmm11, xmm12, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12608] vfmadd213pd xmm1, xmm0, xmm11 vmulpd xmm1, xmm0, xmm1 vaddpd xmm0, xmm12, xmm3 @@ -824,19 +824,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_log2_ha_l9 ENDP +__jsvml_log2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log2_ha_l9_B1_B3: +_unwind___jsvml_log2_ha_l9_B1_B3: DD 671489 DD 2020415 DD 964663 @@ -851,19 +851,19 @@ _unwind___svml_log2_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_log2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log2_ha_l9_B6_B10: +_unwind___jsvml_log2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_log2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -872,7 +872,7 @@ _unwind___svml_log2_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_log2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -886,9 +886,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1_ha_l9 + PUBLIC __jsvml_log1_ha_l9 -__svml_log1_ha_l9 PROC EXPORT +__jsvml_log1_ha_l9 PROC EXPORT _B6_1:: @@ -903,16 +903,16 @@ L64:: vmovups XMMWORD PTR [176+rsp], xmm11 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm1, QWORD PTR [__svml_dlog_ha_data_internal+12672] + vmovsd xmm1, QWORD PTR [__jsvml_dlog_ha_data_internal+12672] and r13, -64 - vmovsd xmm4, QWORD PTR [__svml_dlog_ha_data_internal+12736] + vmovsd xmm4, QWORD PTR [__jsvml_dlog_ha_data_internal+12736] vandpd xmm3, xmm0, xmm1 vorpd xmm1, xmm3, xmm4 vcvtpd2ps xmm2, xmm1 vmovlhps xmm5, xmm2, xmm2 - vcmpnlesd xmm2, xmm0, QWORD PTR [__svml_dlog_ha_data_internal+12864] + vcmpnlesd xmm2, xmm0, QWORD PTR [__jsvml_dlog_ha_data_internal+12864] vrcpps xmm11, xmm5 - vcmpltsd xmm5, xmm0, QWORD PTR [__svml_dlog_ha_data_internal+12800] + vcmpltsd xmm5, xmm0, QWORD PTR [__jsvml_dlog_ha_data_internal+12800] vcvtps2pd xmm3, xmm11 vpsrlq xmm11, xmm0, 20 vorpd xmm2, xmm5, xmm2 @@ -920,23 +920,23 @@ L64:: vpshufd xmm3, xmm11, 85 vpshufd xmm11, xmm3, 0 vcvtdq2pd xmm3, xmm11 - vfmsub213sd xmm1, xmm4, QWORD PTR [__svml_dlog_ha_data_internal+12992] + vfmsub213sd xmm1, xmm4, QWORD PTR [__jsvml_dlog_ha_data_internal+12992] vmovmskpd ecx, xmm2 vpsrlq xmm4, xmm4, 39 - vmovsd xmm2, QWORD PTR [__svml_dlog_ha_data_internal+12416] + vmovsd xmm2, QWORD PTR [__jsvml_dlog_ha_data_internal+12416] vmovd eax, xmm4 - vmulsd xmm11, xmm3, QWORD PTR [__svml_dlog_ha_data_internal+13056] - vfmadd213sd xmm2, xmm1, QWORD PTR [__svml_dlog_ha_data_internal+12480] - vmulsd xmm5, xmm3, QWORD PTR [__svml_dlog_ha_data_internal+13120] + vmulsd xmm11, xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+13056] + vfmadd213sd xmm2, xmm1, QWORD PTR [__jsvml_dlog_ha_data_internal+12480] + vmulsd xmm5, xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+13120] vmulsd xmm4, xmm1, xmm1 movsxd rax, eax - vmovsd xmm3, QWORD PTR [__svml_dlog_ha_data_internal+12544] - vfmadd213sd xmm3, xmm1, QWORD PTR [__svml_dlog_ha_data_internal+12608] - vaddsd xmm11, xmm11, QWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rdx+rax] + vmovsd xmm3, QWORD PTR [__jsvml_dlog_ha_data_internal+12544] + vfmadd213sd xmm3, xmm1, QWORD PTR [__jsvml_dlog_ha_data_internal+12608] + vaddsd xmm11, xmm11, QWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rdx+rax] vfmadd213sd xmm2, xmm4, xmm3 vaddsd xmm3, xmm11, xmm1 vmulsd xmm4, xmm2, xmm4 - vaddsd xmm2, xmm5, QWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454136+rdx+rax] + vaddsd xmm2, xmm5, QWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454136+rdx+rax] vsubsd xmm5, xmm3, xmm11 mov QWORD PTR [192+rsp], r13 vsubsd xmm1, xmm1, xmm5 @@ -970,19 +970,19 @@ _B6_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_log1_ha_l9 ENDP +__jsvml_log1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1_ha_l9_B1_B6: +_unwind___jsvml_log1_ha_l9_B1_B6: DD 402177 DD 1430563 DD 768027 @@ -995,7 +995,7 @@ _unwind___svml_log1_ha_l9_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_log1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_log1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1009,9 +1009,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log4_ha_e9 + PUBLIC __jsvml_log4_ha_e9 -__svml_log4_ha_e9 PROC EXPORT +__jsvml_log4_ha_e9 PROC EXPORT _B7_1:: @@ -1030,29 +1030,29 @@ L69:: lea r13, QWORD PTR [335+rsp] vmovapd ymm9, ymm0 and r13, -64 - vandpd ymm5, ymm9, YMMWORD PTR [__svml_dlog_ha_data_internal+12672] - vorpd ymm13, ymm5, YMMWORD PTR [__svml_dlog_ha_data_internal+12736] + vandpd ymm5, ymm9, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12672] + vorpd ymm13, ymm5, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12736] vcvtpd2ps xmm1, ymm13 vrcpps xmm4, xmm1 vcvtps2pd ymm5, xmm4 mov QWORD PTR [536+rsp], r13 vpsrlq xmm2, xmm9, 20 vextractf128 xmm3, ymm9, 1 - vcmplt_oqpd ymm4, ymm9, YMMWORD PTR [__svml_dlog_ha_data_internal+12800] + vcmplt_oqpd ymm4, ymm9, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12800] vpsrlq xmm14, xmm3, 20 vshufps xmm1, xmm2, xmm14, 221 - vcmpnle_uqpd ymm2, ymm9, YMMWORD PTR [__svml_dlog_ha_data_internal+12864] + vcmpnle_uqpd ymm2, ymm9, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12864] vroundpd ymm3, ymm5, 0 vcvtdq2pd ymm0, xmm1 vorpd ymm5, ymm4, ymm2 - vandpd ymm4, ymm13, YMMWORD PTR [__svml_dlog_ha_data_internal+12928] + vandpd ymm4, ymm13, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12928] vsubpd ymm13, ymm13, ymm4 vmulpd ymm13, ymm3, ymm13 vextractf128 xmm14, ymm5, 1 vshufps xmm1, xmm5, xmm14, 221 vmulpd ymm14, ymm3, ymm4 vmovmskps edx, xmm1 - vsubpd ymm5, ymm14, YMMWORD PTR [__svml_dlog_ha_data_internal+12992] + vsubpd ymm5, ymm14, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12992] vaddpd ymm5, ymm13, ymm5 vpsrlq xmm14, xmm3, 39 vextractf128 xmm13, ymm3, 1 @@ -1065,21 +1065,21 @@ L69:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+rcx] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+r8] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+r9] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+rax+r10] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+rcx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+r8] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+r9] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+rax+r10] vunpcklpd xmm3, xmm13, xmm4 vunpckhpd xmm4, xmm13, xmm4 vunpcklpd xmm14, xmm2, xmm1 vunpckhpd xmm2, xmm2, xmm1 - vmulpd ymm1, ymm0, YMMWORD PTR [__svml_dlog_ha_data_internal+13120] - vmulpd ymm13, ymm5, YMMWORD PTR [__svml_dlog_ha_data_internal+12544] - vaddpd ymm13, ymm13, YMMWORD PTR [__svml_dlog_ha_data_internal+12608] + vmulpd ymm1, ymm0, YMMWORD PTR [__jsvml_dlog_ha_data_internal+13120] + vmulpd ymm13, ymm5, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12544] + vaddpd ymm13, ymm13, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12608] vinsertf128 ymm4, ymm4, xmm2, 1 - vmulpd ymm2, ymm0, YMMWORD PTR [__svml_dlog_ha_data_internal+13056] - vmulpd ymm0, ymm5, YMMWORD PTR [__svml_dlog_ha_data_internal+12416] - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_dlog_ha_data_internal+12480] + vmulpd ymm2, ymm0, YMMWORD PTR [__jsvml_dlog_ha_data_internal+13056] + vmulpd ymm0, ymm5, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12416] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_dlog_ha_data_internal+12480] vinsertf128 ymm3, ymm3, xmm14, 1 vmulpd ymm14, ymm5, ymm5 vaddpd ymm2, ymm3, ymm2 @@ -1156,19 +1156,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_log4_ha_e9 ENDP +__jsvml_log4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log4_ha_e9_B1_B3: +_unwind___jsvml_log4_ha_e9_B1_B3: DD 668929 DD 4379701 DD 1939501 @@ -1183,13 +1183,13 @@ _unwind___svml_log4_ha_e9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_log4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log4_ha_e9_B6_B10: +_unwind___jsvml_log4_ha_e9_B6_B10: DD 1198625 DD 2122826 DD 2176064 @@ -1202,7 +1202,7 @@ _unwind___svml_log4_ha_e9_B6_B10: DD 944139 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_log4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1211,7 +1211,7 @@ _unwind___svml_log4_ha_e9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_log4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1225,9 +1225,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log2_ha_e9 + PUBLIC __jsvml_log2_ha_e9 -__svml_log2_ha_e9 PROC EXPORT +__jsvml_log2_ha_e9 PROC EXPORT _B8_1:: @@ -1246,45 +1246,45 @@ L96:: vmovups XMMWORD PTR [224+rsp], xmm7 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd xmm1, xmm5, XMMWORD PTR [__svml_dlog_ha_data_internal+12672] + vandpd xmm1, xmm5, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12672] and r13, -64 - vorpd xmm4, xmm1, XMMWORD PTR [__svml_dlog_ha_data_internal+12736] + vorpd xmm4, xmm1, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12736] vcvtpd2ps xmm3, xmm4 - vcmpnlepd xmm12, xmm5, XMMWORD PTR [__svml_dlog_ha_data_internal+12864] + vcmpnlepd xmm12, xmm5, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12864] vmovlhps xmm7, xmm3, xmm3 vrcpps xmm10, xmm7 - vcmpltpd xmm3, xmm5, XMMWORD PTR [__svml_dlog_ha_data_internal+12800] + vcmpltpd xmm3, xmm5, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12800] vcvtps2pd xmm2, xmm10 vroundpd xmm2, xmm2, 0 vorpd xmm7, xmm3, xmm12 - vandpd xmm10, xmm4, XMMWORD PTR [__svml_dlog_ha_data_internal+12928] + vandpd xmm10, xmm4, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12928] vmovmskpd edx, xmm7 vpshufd xmm1, xmm0, 221 vmulpd xmm7, xmm2, xmm10 vsubpd xmm4, xmm4, xmm10 vcvtdq2pd xmm0, xmm1 vmulpd xmm10, xmm2, xmm4 - vsubpd xmm4, xmm7, XMMWORD PTR [__svml_dlog_ha_data_internal+12992] + vsubpd xmm4, xmm7, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12992] vpsrlq xmm2, xmm2, 39 vmovd eax, xmm2 vaddpd xmm4, xmm10, xmm4 vpextrd ecx, xmm2, 2 movsxd rax, eax movsxd rcx, ecx - vmulpd xmm7, xmm4, XMMWORD PTR [__svml_dlog_ha_data_internal+12416] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+r8+rax] - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dlog_ha_data_internal)-8454144+r8+rcx] + vmulpd xmm7, xmm4, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12416] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+r8+rax] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dlog_ha_data_internal)-8454144+r8+rcx] vunpcklpd xmm1, xmm3, xmm12 vunpckhpd xmm2, xmm3, xmm12 - vmulpd xmm12, xmm4, XMMWORD PTR [__svml_dlog_ha_data_internal+12544] - vaddpd xmm10, xmm7, XMMWORD PTR [__svml_dlog_ha_data_internal+12480] - vaddpd xmm7, xmm12, XMMWORD PTR [__svml_dlog_ha_data_internal+12608] + vmulpd xmm12, xmm4, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12544] + vaddpd xmm10, xmm7, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12480] + vaddpd xmm7, xmm12, XMMWORD PTR [__jsvml_dlog_ha_data_internal+12608] vmulpd xmm12, xmm4, xmm4 - vmulpd xmm3, xmm0, XMMWORD PTR [__svml_dlog_ha_data_internal+13056] + vmulpd xmm3, xmm0, XMMWORD PTR [__jsvml_dlog_ha_data_internal+13056] vmulpd xmm10, xmm10, xmm12 vaddpd xmm1, xmm1, xmm3 vaddpd xmm7, xmm7, xmm10 - vmulpd xmm0, xmm0, XMMWORD PTR [__svml_dlog_ha_data_internal+13120] + vmulpd xmm0, xmm0, XMMWORD PTR [__jsvml_dlog_ha_data_internal+13120] vmulpd xmm10, xmm12, xmm7 vaddpd xmm7, xmm4, xmm1 vaddpd xmm2, xmm2, xmm0 @@ -1342,19 +1342,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dlog_ha_cout_rare_internal + call __jsvml_dlog_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_log2_ha_e9 ENDP +__jsvml_log2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log2_ha_e9_B1_B3: +_unwind___jsvml_log2_ha_e9_B1_B3: DD 671233 DD 2020414 DD 948278 @@ -1369,19 +1369,19 @@ _unwind___svml_log2_ha_e9_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_log2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log2_ha_e9_B6_B10: +_unwind___jsvml_log2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_log2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1390,7 +1390,7 @@ _unwind___svml_log2_ha_e9_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_log2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1404,9 +1404,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log8_ha_z0 + PUBLIC __jsvml_log8_ha_z0 -__svml_log8_ha_z0 PROC EXPORT +__jsvml_log8_ha_z0 PROC EXPORT _B9_1:: @@ -1422,33 +1422,33 @@ L109:: vfpclasspd k2, zmm4, 223 vrcp14pd zmm23, zmm22 vrndscalepd zmm24, zmm23, 88 {sae} - vmovups zmm26, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+256] - vmovups zmm25, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+320] - vmovups zmm2, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512] - vmovups zmm28, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+384] - vmovups zmm1, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+448] + vmovups zmm26, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+256] + vmovups zmm25, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+320] + vmovups zmm2, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512] + vmovups zmm28, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+384] + vmovups zmm1, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+448] vfmsub213pd zmm22, zmm24, zmm26 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+896] - vmovups zmm31, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+640] - vmovups zmm23, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+576] - vmovups zmm29, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+512] + vmovups zmm30, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+896] + vmovups zmm31, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+640] + vmovups zmm23, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+576] + vmovups zmm29, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+512] vfmadd231pd zmm1, zmm28, zmm22 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+768] - vmovups zmm3, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+128] - vmovups zmm4, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+960] + vmovups zmm28, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+768] + vmovups zmm3, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+128] + vmovups zmm4, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+960] vfmadd231pd zmm23, zmm29, zmm22 {rn-sae} vmulpd zmm0, zmm22, zmm22 {rn-sae} vcmppd k1, zmm24, zmm25, 17 {sae} - vmovups zmm25, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+704] + vmovups zmm25, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+704] vpsrlq zmm27, zmm24, 48 - vmovups zmm24, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+832] + vmovups zmm24, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+832] vfmadd213pd zmm1, zmm0, zmm23 {rn-sae} vfmadd231pd zmm25, zmm31, zmm22 {rn-sae} vmulpd zmm31, zmm0, zmm0 {rn-sae} vfmadd231pd zmm24, zmm28, zmm22 {rn-sae} vaddpd zmm5{k1}, zmm5, zmm26 {rn-sae} - vpermt2pd zmm2, zmm27, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+64] - vpermt2pd zmm3, zmm27, ZMMWORD PTR [__svml_dlog_ha_data_internal_avx512+192] + vpermt2pd zmm2, zmm27, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+64] + vpermt2pd zmm3, zmm27, ZMMWORD PTR [__jsvml_dlog_ha_data_internal_avx512+192] vfmadd213pd zmm25, zmm0, zmm24 {rn-sae} vfmadd231pd zmm2, zmm30, zmm5 {rn-sae} vfmadd213pd zmm5, zmm4, zmm3 {rn-sae} @@ -1465,7 +1465,7 @@ L109:: _B9_2:: -__svml_log8_ha_z0 ENDP +__jsvml_log8_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -1479,9 +1479,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dlog_ha_cout_rare_internal + PUBLIC __jsvml_dlog_ha_cout_rare_internal -__svml_dlog_ha_cout_rare_internal PROC +__jsvml_dlog_ha_cout_rare_internal PROC _B10_1:: @@ -1681,13 +1681,13 @@ _B10_16:: _B10_17:: -__svml_dlog_ha_cout_rare_internal ENDP +__jsvml_dlog_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dlog_ha_cout_rare_internal_B1_B16: +_unwind___jsvml_dlog_ha_cout_rare_internal_B1_B16: DD 67585 DD 25096 @@ -1698,7 +1698,7 @@ _unwind___svml_dlog_ha_cout_rare_internal_B1_B16: DD imagerel _B10_1 DD imagerel _B10_17 - DD imagerel _unwind___svml_dlog_ha_cout_rare_internal_B1_B16 + DD imagerel _unwind___jsvml_dlog_ha_cout_rare_internal_B1_B16 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1706,8 +1706,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dlog_ha_data_internal_avx512 -__svml_dlog_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dlog_ha_data_internal_avx512 +__jsvml_dlog_ha_data_internal_avx512 DD 0 DD 0 DD 3222405120 DD 3215919664 @@ -2011,8 +2011,8 @@ __svml_dlog_ha_data_internal_avx512 DD 0 DD 0 DD 120 DD 0 - PUBLIC __svml_dlog_ha_data_internal -__svml_dlog_ha_data_internal DD 3715793664 + PUBLIC __jsvml_dlog_ha_data_internal +__jsvml_dlog_ha_data_internal DD 3715793664 DD 3230016299 DD 4013928704 DD 3189565726 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_pow_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_pow_windows_x86.S similarity index 88% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_pow_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_pow_windows_x86.S index 110b4f2107e..2322865fab3 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_pow_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_pow_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow2_ha_e9 + PUBLIC __jsvml_pow2_ha_e9 -__svml_pow2_ha_e9 PROC EXPORT +__jsvml_pow2_ha_e9 PROC EXPORT _B1_1:: @@ -66,19 +66,19 @@ L1:: lea r13, QWORD PTR [111+rsp] vpshufd xmm5, xmm0, 221 and r13, -64 - vmovq xmm12, QWORD PTR [__svml_dpow_ha_data_internal+28672] - vmovq xmm11, QWORD PTR [__svml_dpow_ha_data_internal+28736] + vmovq xmm12, QWORD PTR [__jsvml_dpow_ha_data_internal+28672] + vmovq xmm11, QWORD PTR [__jsvml_dpow_ha_data_internal+28736] vpand xmm15, xmm5, xmm12 - vandpd xmm14, xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27520] + vandpd xmm14, xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27520] vpaddd xmm10, xmm15, xmm11 - vorpd xmm13, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27648] + vorpd xmm13, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27648] vpsrld xmm14, xmm10, 10 vpslld xmm12, xmm14, 3 vpslld xmm9, xmm14, 4 vmovd edx, xmm12 vmovd r8d, xmm9 - vmovq xmm14, QWORD PTR [__svml_dpow_ha_data_internal+28800] - vmovq xmm4, QWORD PTR [__svml_dpow_ha_data_internal+28352] + vmovq xmm14, QWORD PTR [__jsvml_dpow_ha_data_internal+28800] + vmovq xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+28352] movsxd rdx, edx vpaddd xmm4, xmm5, xmm4 vpextrd ecx, xmm12, 1 @@ -86,25 +86,25 @@ L1:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovsd xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+rdx] - vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+rcx] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+rdx] + vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+rcx] vpsubd xmm15, xmm5, xmm14 - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r8] + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r8] vpsrad xmm9, xmm15, 20 - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r9] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r9] vunpcklpd xmm11, xmm8, xmm10 vunpckhpd xmm12, xmm8, xmm10 - vmovq xmm8, QWORD PTR [__svml_dpow_ha_data_internal+28864] + vmovq xmm8, QWORD PTR [__jsvml_dpow_ha_data_internal+28864] vpaddd xmm10, xmm9, xmm8 vpshufd xmm14, xmm10, 80 - vandpd xmm15, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27712] - vsubpd xmm10, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+27776] + vandpd xmm15, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27712] + vsubpd xmm10, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27776] vmulpd xmm14, xmm13, xmm7 vaddpd xmm11, xmm11, xmm10 - vmovupd xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+27840] + vmovupd xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27840] vandpd xmm8, xmm13, xmm15 vsubpd xmm9, xmm13, xmm8 - vaddpd xmm13, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27904] + vaddpd xmm13, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27904] vmulpd xmm8, xmm7, xmm8 vmulpd xmm7, xmm7, xmm9 vsubpd xmm14, xmm8, xmm14 @@ -118,16 +118,16 @@ L1:: vaddpd xmm9, xmm11, xmm14 vaddpd xmm14, xmm13, xmm8 vaddpd xmm9, xmm12, xmm9 - vmulpd xmm13, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+26816] - vaddpd xmm12, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+26880] + vmulpd xmm13, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26816] + vaddpd xmm12, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26880] vmulpd xmm13, xmm14, xmm12 - vaddpd xmm8, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+26944] + vaddpd xmm8, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26944] vmulpd xmm10, xmm14, xmm8 - vaddpd xmm11, xmm10, XMMWORD PTR [__svml_dpow_ha_data_internal+27008] + vaddpd xmm11, xmm10, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27008] vmulpd xmm12, xmm14, xmm11 - vaddpd xmm13, xmm12, XMMWORD PTR [__svml_dpow_ha_data_internal+27072] + vaddpd xmm13, xmm12, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27072] vmulpd xmm8, xmm14, xmm13 - vaddpd xmm10, xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+27136] + vaddpd xmm10, xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27136] vmulpd xmm14, xmm14, xmm10 vaddpd xmm9, xmm9, xmm14 vaddpd xmm13, xmm7, xmm9 @@ -140,37 +140,37 @@ L1:: vsubpd xmm9, xmm6, xmm7 vmulpd xmm7, xmm7, xmm8 vmulpd xmm12, xmm12, xmm9 - vmovq xmm2, QWORD PTR [__svml_dpow_ha_data_internal+28416] - vmovq xmm1, QWORD PTR [__svml_dpow_ha_data_internal+28480] + vmovq xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+28416] + vmovq xmm1, QWORD PTR [__jsvml_dpow_ha_data_internal+28480] vpshufd xmm3, xmm6, 221 vpshufd xmm11, xmm15, 221 vpand xmm3, xmm3, xmm1 vpand xmm11, xmm11, xmm1 vpcmpgtd xmm1, xmm2, xmm4 - vmovq xmm2, QWORD PTR [__svml_dpow_ha_data_internal+28544] + vmovq xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+28544] vpcmpgtd xmm5, xmm3, xmm2 vpcmpeqd xmm4, xmm3, xmm2 vpor xmm2, xmm5, xmm4 vmulpd xmm4, xmm8, xmm9 - vmovq xmm10, QWORD PTR [__svml_dpow_ha_data_internal+28608] + vmovq xmm10, QWORD PTR [__jsvml_dpow_ha_data_internal+28608] vpor xmm13, xmm1, xmm2 vpcmpgtd xmm3, xmm11, xmm10 vpcmpeqd xmm5, xmm11, xmm10 vpor xmm10, xmm3, xmm5 vpor xmm11, xmm13, xmm10 - vmovupd xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+28032] + vmovupd xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28032] vaddpd xmm1, xmm13, xmm15 vaddpd xmm8, xmm4, xmm7 vmulpd xmm5, xmm6, xmm14 vaddpd xmm12, xmm8, xmm12 vmovmskps edx, xmm11 vpshufd xmm4, xmm1, 136 - vmovq xmm14, QWORD PTR [__svml_dpow_ha_data_internal+28992] + vmovq xmm14, QWORD PTR [__jsvml_dpow_ha_data_internal+28992] vpslld xmm2, xmm4, 13 vpand xmm9, xmm4, xmm14 vpslld xmm8, xmm9, 4 vmovd r10d, xmm8 - vmovq xmm14, QWORD PTR [__svml_dpow_ha_data_internal+28928] + vmovq xmm14, QWORD PTR [__jsvml_dpow_ha_data_internal+28928] vpaddd xmm3, xmm2, xmm14 vpextrd r11d, xmm8, 1 vsubpd xmm1, xmm1, xmm13 @@ -178,23 +178,23 @@ L1:: movsxd r11, r11d vpshufd xmm7, xmm3, 80 vsubpd xmm15, xmm15, xmm1 - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r10] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r11] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r10] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r11] vunpcklpd xmm2, xmm14, xmm3 vunpckhpd xmm3, xmm14, xmm3 vaddpd xmm14, xmm12, xmm5 vaddpd xmm14, xmm15, xmm14 vmulpd xmm10, xmm14, xmm14 - vmulpd xmm1, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27200] + vmulpd xmm1, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27200] vmulpd xmm5, xmm10, xmm10 - vandpd xmm4, xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+27968] - vaddpd xmm7, xmm1, XMMWORD PTR [__svml_dpow_ha_data_internal+27264] + vandpd xmm4, xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27968] + vaddpd xmm7, xmm1, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27264] vmulpd xmm8, xmm5, xmm7 vmulpd xmm9, xmm2, xmm8 vaddpd xmm13, xmm3, xmm9 - vmulpd xmm3, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27328] - vmulpd xmm14, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27456] - vaddpd xmm11, xmm3, XMMWORD PTR [__svml_dpow_ha_data_internal+27392] + vmulpd xmm3, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27328] + vmulpd xmm14, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27456] + vaddpd xmm11, xmm3, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27392] vmulpd xmm3, xmm2, xmm14 vmulpd xmm12, xmm10, xmm11 vmulpd xmm15, xmm2, xmm12 @@ -262,19 +262,19 @@ _B1_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_pow2_ha_e9 ENDP +__jsvml_pow2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow2_ha_e9_B1_B3: +_unwind___jsvml_pow2_ha_e9_B1_B3: DD 1603585 DD 3462264 DD 1599596 @@ -296,19 +296,19 @@ _unwind___svml_pow2_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_pow2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_pow2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow2_ha_e9_B6_B10: +_unwind___jsvml_pow2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_pow2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_pow2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -317,7 +317,7 @@ _unwind___svml_pow2_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_pow2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_pow2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -331,9 +331,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow8_ha_z0 + PUBLIC __jsvml_pow8_ha_z0 -__svml_pow8_ha_z0 PROC EXPORT +__jsvml_pow8_ha_z0 PROC EXPORT _B2_1:: @@ -352,52 +352,52 @@ L28:: vrndscalepd zmm30, zmm28, 88 {sae} mov QWORD PTR [1384+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm25, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+768] + vmovups zmm25, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+768] and r13, -64 - vmovups zmm31, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+832] - vmovups zmm5, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512] - vmovups zmm2, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+128] - vmovups zmm4, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+256] - vmovups zmm3, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+384] - vmovups zmm28, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1152] + vmovups zmm31, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+832] + vmovups zmm5, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512] + vmovups zmm2, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+128] + vmovups zmm4, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+256] + vmovups zmm3, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+384] + vmovups zmm28, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1152] vmulpd zmm29, zmm27, zmm25 {rn-sae} vcmppd k2, zmm30, zmm31, 17 {sae} - vmovups zmm27, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1024] - vmovups zmm31, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1536] + vmovups zmm27, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1024] + vmovups zmm31, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1536] vpsrlq zmm22, zmm30, 47 vfmsub231pd zmm25, zmm29, zmm30 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1408] + vmovups zmm30, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1408] vpsllq zmm23, zmm22, 59 - vpermt2pd zmm5, zmm22, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+64] - vpermt2pd zmm2, zmm22, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+192] + vpermt2pd zmm5, zmm22, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+64] + vpermt2pd zmm2, zmm22, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+192] vpmovq2m k3, zmm23 - vpermt2pd zmm4, zmm22, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+320] - vpermt2pd zmm3, zmm22, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+448] + vpermt2pd zmm4, zmm22, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+320] + vpermt2pd zmm3, zmm22, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+448] vblendmpd zmm29{k3}, zmm5, zmm2 vmulpd zmm22, zmm25, zmm25 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1088] - vmovups zmm2, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+960] + vmovups zmm23, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1088] + vmovups zmm2, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+960] vblendmpd zmm5{k3}, zmm4, zmm3 - vmovups zmm4, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1344] + vmovups zmm4, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1344] vfmadd231pd zmm23, zmm27, zmm25 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1600] + vmovups zmm27, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1600] vmovaps zmm26, zmm1 - vmovups zmm1, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+896] + vmovups zmm1, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+896] vfmadd231pd zmm27, zmm31, zmm25 {rn-sae} - vmovups zmm31, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1920] + vmovups zmm31, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1920] vaddpd zmm24{k2}, zmm24, zmm1 {rn-sae} vfpclasspd k1, zmm26, 153 - vmovups zmm1, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1216] + vmovups zmm1, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1216] vaddpd zmm3, zmm29, zmm24 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1280] + vmovups zmm24, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1280] vfmadd231pd zmm1, zmm28, zmm25 {rn-sae} kmovw eax, k1 vfmadd231pd zmm4, zmm24, zmm25 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1472] + vmovups zmm24, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1472] vfmadd213pd zmm23, zmm22, zmm1 {rn-sae} vmulpd zmm1, zmm22, zmm22 {rn-sae} vfmadd231pd zmm24, zmm30, zmm25 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1792] + vmovups zmm30, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1792] vfmadd213pd zmm4, zmm22, zmm24 {rn-sae} vmovaps zmm28, zmm3 or r8d, eax @@ -412,33 +412,33 @@ L28:: vfnmadd213pd zmm4, zmm25, zmm28 {rn-sae} vsubpd zmm22, zmm28, zmm4 {rn-sae} vfmsub213pd zmm25, zmm3, zmm22 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1664] + vmovups zmm22, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1664] vsubpd zmm25, zmm2, zmm25 {rn-sae} vaddpd zmm1, zmm23, zmm25 {rn-sae} vaddpd zmm3, zmm4, zmm1 {rn-sae} vmulpd zmm5, zmm3, zmm26 {rz-sae} vsubpd zmm2, zmm3, zmm4 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+512] + vmovups zmm4, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+512] vfmsub213pd zmm3, zmm26, zmm5 {rz-sae} vsubpd zmm23, zmm1, zmm2 {rn-sae} vfmadd213pd zmm23, zmm26, zmm3 {rz-sae} - vmovups zmm3, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+640] + vmovups zmm3, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+640] vaddpd zmm1, zmm5, zmm23 {rz-sae} vsubpd zmm24, zmm1, zmm5 {rn-sae} vaddpd zmm28, zmm1, zmm22 {rd-sae} vreducepd zmm25, zmm1, 65 {sae} - vmovups zmm5, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1856] + vmovups zmm5, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1856] vsubpd zmm27, zmm23, zmm24 {rn-sae} - vpermt2pd zmm4, zmm28, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+576] - vpermt2pd zmm3, zmm28, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+704] + vpermt2pd zmm4, zmm28, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+576] + vpermt2pd zmm3, zmm28, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+704] vaddpd zmm29, zmm25, zmm27 {rn-sae} - vandpd zmm2, zmm29, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1728] - vmovups zmm29, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+2112] + vandpd zmm2, zmm29, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1728] + vmovups zmm29, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+2112] vmulpd zmm28, zmm2, zmm2 {rn-sae} vfmadd231pd zmm5, zmm30, zmm2 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+1984] + vmovups zmm30, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+1984] vfmadd231pd zmm30, zmm31, zmm2 {rn-sae} - vmovups zmm31, ZMMWORD PTR [__svml_dpow_ha_data_internal_avx512+2048] + vmovups zmm31, ZMMWORD PTR [__jsvml_dpow_ha_data_internal_avx512+2048] vfmadd213pd zmm5, zmm28, zmm30 {rn-sae} vfmadd231pd zmm29, zmm31, zmm2 {rn-sae} vfmadd213pd zmm5, zmm28, zmm29 {rn-sae} @@ -579,19 +579,19 @@ _B2_15:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B2_13 ALIGN 16 _B2_16:: -__svml_pow8_ha_z0 ENDP +__jsvml_pow8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow8_ha_z0_B1_B9: +_unwind___jsvml_pow8_ha_z0_B1_B9: DD 276481 DD 11392056 DD 11469067 @@ -603,13 +603,13 @@ _unwind___svml_pow8_ha_z0_B1_B9: DD imagerel _B2_1 DD imagerel _B2_11 - DD imagerel _unwind___svml_pow8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_pow8_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow8_ha_z0_B11_B15: +_unwind___jsvml_pow8_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -645,7 +645,7 @@ _unwind___svml_pow8_ha_z0_B11_B15: DD imagerel _B2_11 DD imagerel _B2_16 - DD imagerel _unwind___svml_pow8_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_pow8_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -659,9 +659,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow1_ha_ex + PUBLIC __jsvml_pow1_ha_ex -__svml_pow1_ha_ex PROC EXPORT +__jsvml_pow1_ha_ex PROC EXPORT _B3_1:: @@ -701,9 +701,9 @@ L79:: movd xmm15, edx mov QWORD PTR [232+rsp], r13 pslld xmm12, 4 - movsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+27520] + movsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+27520] movd xmm13, ecx - movsd xmm4, QWORD PTR [__svml_dpow_ha_data_internal+27648] + movsd xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+27648] andps xmm9, xmm0 movd r10d, xmm3 orps xmm9, xmm4 @@ -714,24 +714,24 @@ L79:: mov r9d, 1048576 movsxd r10, r10d paddd xmm4, xmm13 - movsd xmm8, QWORD PTR [__svml_dpow_ha_data_internal+27712] + movsd xmm8, QWORD PTR [__jsvml_dpow_ha_data_internal+27712] mov edx, 2097152 pshufd xmm13, xmm4, 0 mov r8d, 1083129855 - movsd xmm4, QWORD PTR [__svml_dpow_ha_data_internal+27840] + movsd xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+27840] andps xmm13, xmm8 movd r11d, xmm12 movaps xmm5, xmm4 andps xmm5, xmm9 - subsd xmm13, QWORD PTR [__svml_dpow_ha_data_internal+27776] - mulsd xmm9, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] + subsd xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+27776] + mulsd xmm9, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] subsd xmm15, xmm5 - mulsd xmm5, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] - mulsd xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] + mulsd xmm5, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] + mulsd xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] subsd xmm5, xmm9 movsxd r11, r11d movaps xmm8, xmm9 - movsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+26816] + movsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+26816] mov ecx, 1072693248 pshufd xmm11, xmm14, 85 lea r13, QWORD PTR [95+rsp] @@ -739,8 +739,8 @@ L79:: and r13, -64 mov QWORD PTR [368+rsp], r13 addsd xmm15, xmm5 - addsd xmm13, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r11] - addsd xmm8, QWORD PTR [__svml_dpow_ha_data_internal+27904] + addsd xmm13, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r11] + addsd xmm8, QWORD PTR [__jsvml_dpow_ha_data_internal+27904] movaps xmm3, xmm13 movaps xmm5, xmm4 andps xmm4, xmm14 @@ -753,19 +753,19 @@ L79:: subsd xmm3, xmm12 mulsd xmm9, xmm8 addsd xmm3, xmm15 - addsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+26880] + addsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+26880] addsd xmm3, xmm13 mulsd xmm9, xmm8 - addsd xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8264+rax+r11] - addsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+26944] + addsd xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8264+rax+r11] + addsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+26944] mulsd xmm9, xmm8 movd xmm15, r8d mov r8d, 127 - addsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+27008] + addsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+27008] mulsd xmm9, xmm8 - addsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+27072] + addsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+27072] mulsd xmm9, xmm8 - addsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+27136] + addsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+27136] mulsd xmm9, xmm8 movaps xmm8, xmm12 addsd xmm9, xmm3 @@ -797,7 +797,7 @@ L79:: movaps xmm8, xmm13 mulsd xmm12, xmm5 addsd xmm4, xmm15 - movsd xmm5, QWORD PTR [__svml_dpow_ha_data_internal+28032] + movsd xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+28032] por xmm10, xmm11 por xmm1, xmm10 movaps xmm10, xmm14 @@ -812,13 +812,13 @@ L79:: movdqa xmm1, xmm4 pand xmm4, xmm3 pslld xmm1, 13 - movsd xmm3, QWORD PTR [__svml_dpow_ha_data_internal+27200] + movsd xmm3, QWORD PTR [__jsvml_dpow_ha_data_internal+27200] movd xmm9, ecx paddd xmm1, xmm9 pslld xmm4, 4 pshufd xmm15, xmm1, 0 and edx, 1 - movsd xmm1, QWORD PTR [__svml_dpow_ha_data_internal+27328] + movsd xmm1, QWORD PTR [__jsvml_dpow_ha_data_internal+27328] subsd xmm8, xmm5 addsd xmm12, xmm10 movd r9d, xmm4 @@ -829,23 +829,23 @@ L79:: mulsd xmm13, xmm12 mulsd xmm3, xmm12 mulsd xmm1, xmm12 - addsd xmm3, QWORD PTR [__svml_dpow_ha_data_internal+27264] - addsd xmm1, QWORD PTR [__svml_dpow_ha_data_internal+27392] + addsd xmm3, QWORD PTR [__jsvml_dpow_ha_data_internal+27264] + addsd xmm1, QWORD PTR [__jsvml_dpow_ha_data_internal+27392] movaps xmm11, xmm13 mulsd xmm11, xmm13 mulsd xmm1, xmm13 mulsd xmm3, xmm11 - mulsd xmm1, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - mulsd xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - movsd xmm2, QWORD PTR [__svml_dpow_ha_data_internal+27968] + mulsd xmm1, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + mulsd xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + movsd xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+27968] andps xmm15, xmm2 - addsd xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24712+rax+r9] - movsd xmm2, QWORD PTR [__svml_dpow_ha_data_internal+27456] + addsd xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24712+rax+r9] + movsd xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+27456] addsd xmm3, xmm1 mulsd xmm2, xmm12 - mulsd xmm2, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] + mulsd xmm2, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] addsd xmm3, xmm2 - addsd xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] + addsd xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] mulsd xmm3, xmm15 jne _B3_3 @@ -882,19 +882,19 @@ _B3_6:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B3_4 ALIGN 16 _B3_7:: -__svml_pow1_ha_ex ENDP +__jsvml_pow1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow1_ha_ex_B1_B6: +_unwind___jsvml_pow1_ha_ex_B1_B6: DD 1359105 DD 1955005 DD 1476784 @@ -914,7 +914,7 @@ _unwind___svml_pow1_ha_ex_B1_B6: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_pow1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_pow1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -928,9 +928,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow2_ha_ex + PUBLIC __jsvml_pow2_ha_ex -__svml_pow2_ha_ex PROC EXPORT +__jsvml_pow2_ha_ex PROC EXPORT _B4_1:: @@ -957,8 +957,8 @@ L98:: lea r13, QWORD PTR [111+rsp] pshufd xmm1, xmm0, 221 and r13, -64 - movq xmm13, QWORD PTR [__svml_dpow_ha_data_internal+28672] - movq xmm11, QWORD PTR [__svml_dpow_ha_data_internal+28736] + movq xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+28672] + movq xmm11, QWORD PTR [__jsvml_dpow_ha_data_internal+28736] pand xmm13, xmm1 paddd xmm13, xmm11 psrld xmm13, 10 @@ -970,29 +970,29 @@ L98:: pshufd xmm12, xmm9, 1 movd edx, xmm9 movd r9d, xmm7 - movups xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+27520] + movups xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27520] movups XMMWORD PTR [32+rsp], xmm0 andps xmm8, xmm0 movd ecx, xmm12 movdqa xmm12, xmm1 - movq xmm0, QWORD PTR [__svml_dpow_ha_data_internal+28800] + movq xmm0, QWORD PTR [__jsvml_dpow_ha_data_internal+28800] psubd xmm12, xmm0 movsxd r8, r8d psrad xmm12, 20 movsxd rdx, edx movsxd r9, r9d movsxd rcx, ecx - movq xmm11, QWORD PTR [__svml_dpow_ha_data_internal+28864] - movups xmm9, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r8] + movq xmm11, QWORD PTR [__jsvml_dpow_ha_data_internal+28864] + movups xmm9, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r8] paddd xmm12, xmm11 - movups xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+27840] + movups xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27840] movaps xmm13, xmm9 - orps xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+27648] - movsd xmm14, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+rdx] - movups xmm15, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r9] + orps xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27648] + movsd xmm14, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+rdx] + movups xmm15, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r9] pshufd xmm0, xmm12, 80 movaps xmm12, xmm7 - movhpd xmm14, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+rcx] + movhpd xmm14, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+rcx] andps xmm12, xmm8 unpcklpd xmm13, xmm15 unpckhpd xmm9, xmm15 @@ -1002,12 +1002,12 @@ L98:: mulpd xmm12, xmm14 mulpd xmm14, xmm15 subpd xmm12, xmm8 - andps xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27712] + andps xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27712] movaps xmm15, xmm7 - subpd xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27776] + subpd xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27776] addpd xmm12, xmm14 addpd xmm13, xmm0 - movups xmm11, XMMWORD PTR [__svml_dpow_ha_data_internal+27904] + movups xmm11, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27904] andps xmm7, xmm10 addpd xmm11, xmm8 movaps xmm14, xmm11 @@ -1018,20 +1018,20 @@ L98:: addpd xmm13, xmm11 addpd xmm11, xmm12 subpd xmm14, xmm8 - movups xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+26816] + movups xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26816] mulpd xmm0, xmm11 addpd xmm14, xmm12 - addpd xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+26880] + addpd xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26880] addpd xmm13, xmm14 mulpd xmm0, xmm11 addpd xmm9, xmm13 - addpd xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+26944] + addpd xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26944] mulpd xmm0, xmm11 - addpd xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27008] + addpd xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27008] mulpd xmm0, xmm11 - addpd xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27072] + addpd xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27072] mulpd xmm0, xmm11 - addpd xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27136] + addpd xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27136] mulpd xmm11, xmm0 addpd xmm9, xmm11 movaps xmm0, xmm8 @@ -1052,20 +1052,20 @@ L98:: addpd xmm12, xmm7 mulpd xmm9, xmm10 addpd xmm12, xmm15 - movq xmm5, QWORD PTR [__svml_dpow_ha_data_internal+28480] + movq xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+28480] pshufd xmm3, xmm10, 221 - movq xmm2, QWORD PTR [__svml_dpow_ha_data_internal+28352] + movq xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+28352] pand xmm3, xmm5 - movq xmm6, QWORD PTR [__svml_dpow_ha_data_internal+28544] + movq xmm6, QWORD PTR [__jsvml_dpow_ha_data_internal+28544] paddd xmm1, xmm2 pshufd xmm13, xmm8, 221 movdqa xmm2, xmm3 pand xmm13, xmm5 pcmpgtd xmm2, xmm6 pcmpeqd xmm3, xmm6 - movq xmm5, QWORD PTR [__svml_dpow_ha_data_internal+28608] + movq xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+28608] por xmm2, xmm3 - movq xmm4, QWORD PTR [__svml_dpow_ha_data_internal+28416] + movq xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+28416] movdqa xmm3, xmm13 pcmpgtd xmm4, xmm1 pcmpgtd xmm3, xmm5 @@ -1073,7 +1073,7 @@ L98:: por xmm4, xmm2 por xmm3, xmm13 por xmm4, xmm3 - movups xmm3, XMMWORD PTR [__svml_dpow_ha_data_internal+28032] + movups xmm3, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28032] movaps xmm5, xmm3 addpd xmm5, xmm8 addpd xmm12, xmm9 @@ -1085,33 +1085,33 @@ L98:: movaps xmm7, xmm8 and edx, 3 mulpd xmm7, xmm8 - movups xmm9, XMMWORD PTR [__svml_dpow_ha_data_internal+27200] + movups xmm9, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27200] movaps xmm12, xmm7 mulpd xmm9, xmm8 mulpd xmm12, xmm7 - addpd xmm9, XMMWORD PTR [__svml_dpow_ha_data_internal+27264] - movups xmm6, XMMWORD PTR [__svml_dpow_ha_data_internal+27328] + addpd xmm9, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27264] + movups xmm6, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27328] mulpd xmm6, xmm8 mulpd xmm12, xmm9 - addpd xmm6, XMMWORD PTR [__svml_dpow_ha_data_internal+27392] - movq xmm1, QWORD PTR [__svml_dpow_ha_data_internal+28992] + addpd xmm6, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27392] + movq xmm1, QWORD PTR [__jsvml_dpow_ha_data_internal+28992] pand xmm1, xmm0 pslld xmm0, 13 - movq xmm4, QWORD PTR [__svml_dpow_ha_data_internal+28928] + movq xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+28928] pslld xmm1, 4 movd r10d, xmm1 paddd xmm0, xmm4 pshufd xmm4, xmm1, 1 - movups xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+27456] + movups xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27456] movd r11d, xmm4 pshufd xmm0, xmm0, 80 - andps xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27968] + andps xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27968] movsxd r10, r10d movsxd r11, r11d mulpd xmm7, xmm6 mulpd xmm13, xmm8 - movups xmm11, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r10] - movups xmm2, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r11] + movups xmm11, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r10] + movups xmm2, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r11] movaps xmm14, xmm11 unpcklpd xmm14, xmm2 mulpd xmm12, xmm14 @@ -1185,19 +1185,19 @@ _B4_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_pow2_ha_ex ENDP +__jsvml_pow2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow2_ha_ex_B1_B3: +_unwind___jsvml_pow2_ha_ex_B1_B3: DD 1603073 DD 3462262 DD 1075310 @@ -1219,19 +1219,19 @@ _unwind___svml_pow2_ha_ex_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_pow2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_pow2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow2_ha_ex_B6_B10: +_unwind___jsvml_pow2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_pow2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_pow2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1240,7 +1240,7 @@ _unwind___svml_pow2_ha_ex_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_pow2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_pow2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1254,9 +1254,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow4_ha_e9 + PUBLIC __jsvml_pow4_ha_e9 -__svml_pow4_ha_e9 PROC EXPORT +__jsvml_pow4_ha_e9 PROC EXPORT _B5_1:: @@ -1280,67 +1280,67 @@ L127:: vmovapd ymm6, ymm1 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [143+rsp] - vmovups xmm4, XMMWORD PTR [__svml_dpow_ha_data_internal+28416] + vmovups xmm4, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28416] and r13, -64 - vmovups xmm1, XMMWORD PTR [__svml_dpow_ha_data_internal+28544] + vmovups xmm1, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28544] mov QWORD PTR [600+rsp], r13 vextractf128 xmm5, ymm0, 1 vshufps xmm15, xmm0, xmm5, 221 - vmovups xmm5, XMMWORD PTR [__svml_dpow_ha_data_internal+28480] - vandpd ymm2, ymm0, YMMWORD PTR [__svml_dpow_ha_data_internal+27520] - vorpd ymm7, ymm2, YMMWORD PTR [__svml_dpow_ha_data_internal+27648] + vmovups xmm5, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28480] + vandpd ymm2, ymm0, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27520] + vorpd ymm7, ymm2, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27648] vextractf128 xmm3, ymm6, 1 vshufps xmm8, xmm6, xmm3, 221 - vpaddd xmm3, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+28352] + vpaddd xmm3, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28352] vpcmpgtd xmm4, xmm4, xmm3 vpand xmm3, xmm8, xmm5 - vandps xmm8, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+28672] - vpaddd xmm13, xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+28736] + vandps xmm8, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28672] + vpaddd xmm13, xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28736] vpsrld xmm2, xmm13, 10 vpslld xmm14, xmm2, 3 vpslld xmm2, xmm2, 4 vmovd eax, xmm14 vmovd r10d, xmm2 - vpsubd xmm15, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+28800] + vpsubd xmm15, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28800] movsxd rax, eax vpextrd ecx, xmm14, 1 movsxd rcx, ecx vpextrd r8d, xmm14, 2 vpextrd r11d, xmm2, 1 - vmovsd xmm9, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+rax] + vmovsd xmm9, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+rax] movsxd r8, r8d vpextrd r9d, xmm14, 3 movsxd r10, r10d movsxd r11, r11d - vmovhpd xmm12, xmm9, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+rcx] + vmovhpd xmm12, xmm9, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+rcx] movsxd r9, r9d vpextrd eax, xmm2, 2 vpextrd ecx, xmm2, 3 movsxd rax, eax movsxd rcx, ecx - vmovsd xmm11, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+r8] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+r10] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+r11] - vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+r9] + vmovsd xmm11, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+r8] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+r10] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+r11] + vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+r9] vinsertf128 ymm9, ymm12, xmm8, 1 vpsrad xmm8, xmm15, 20 - vinsertf128 ymm2, ymm13, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+rax], 1 - vinsertf128 ymm11, ymm14, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+rcx], 1 + vinsertf128 ymm2, ymm13, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+rax], 1 + vinsertf128 ymm11, ymm14, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+rcx], 1 vunpcklpd ymm12, ymm2, ymm11 vunpckhpd ymm14, ymm2, ymm11 - vpaddd xmm2, xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+28864] + vpaddd xmm2, xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28864] vpshufd xmm13, xmm2, 80 vpshufd xmm15, xmm2, 250 - vmovupd ymm2, YMMWORD PTR [__svml_dpow_ha_data_internal+27840] + vmovupd ymm2, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27840] vinsertf128 ymm11, ymm13, xmm15, 1 - vandpd ymm8, ymm11, YMMWORD PTR [__svml_dpow_ha_data_internal+27712] + vandpd ymm8, ymm11, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27712] vandpd ymm11, ymm7, ymm2 - vsubpd ymm13, ymm8, YMMWORD PTR [__svml_dpow_ha_data_internal+27776] + vsubpd ymm13, ymm8, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27776] vsubpd ymm8, ymm7, ymm11 vmulpd ymm7, ymm7, ymm9 vmulpd ymm11, ymm9, ymm11 vmulpd ymm9, ymm9, ymm8 - vaddpd ymm15, ymm7, YMMWORD PTR [__svml_dpow_ha_data_internal+27904] + vaddpd ymm15, ymm7, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27904] vsubpd ymm7, ymm11, ymm7 vaddpd ymm13, ymm12, ymm13 vaddpd ymm8, ymm7, ymm9 @@ -1353,16 +1353,16 @@ L127:: vaddpd ymm12, ymm13, ymm9 vaddpd ymm11, ymm14, ymm12 vaddpd ymm14, ymm15, ymm8 - vmulpd ymm8, ymm14, YMMWORD PTR [__svml_dpow_ha_data_internal+26816] - vaddpd ymm15, ymm8, YMMWORD PTR [__svml_dpow_ha_data_internal+26880] + vmulpd ymm8, ymm14, YMMWORD PTR [__jsvml_dpow_ha_data_internal+26816] + vaddpd ymm15, ymm8, YMMWORD PTR [__jsvml_dpow_ha_data_internal+26880] vmulpd ymm8, ymm14, ymm15 - vaddpd ymm13, ymm8, YMMWORD PTR [__svml_dpow_ha_data_internal+26944] + vaddpd ymm13, ymm8, YMMWORD PTR [__jsvml_dpow_ha_data_internal+26944] vmulpd ymm9, ymm14, ymm13 - vaddpd ymm12, ymm9, YMMWORD PTR [__svml_dpow_ha_data_internal+27008] + vaddpd ymm12, ymm9, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27008] vmulpd ymm15, ymm14, ymm12 - vaddpd ymm8, ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+27072] + vaddpd ymm8, ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27072] vmulpd ymm13, ymm14, ymm8 - vaddpd ymm9, ymm13, YMMWORD PTR [__svml_dpow_ha_data_internal+27136] + vaddpd ymm9, ymm13, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27136] vmulpd ymm14, ymm14, ymm9 vaddpd ymm8, ymm11, ymm14 vaddpd ymm13, ymm7, ymm8 @@ -1381,7 +1381,7 @@ L127:: vmulpd ymm8, ymm12, ymm8 vpcmpgtd xmm5, xmm3, xmm1 vpcmpeqd xmm1, xmm3, xmm1 - vmovups xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+28608] + vmovups xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28608] vpor xmm5, xmm5, xmm1 vpor xmm3, xmm4, xmm5 vpcmpgtd xmm4, xmm11, xmm7 @@ -1392,16 +1392,16 @@ L127:: vmulpd ymm13, ymm6, ymm15 vaddpd ymm8, ymm9, ymm8 vmovmskps eax, xmm1 - vmovupd ymm9, YMMWORD PTR [__svml_dpow_ha_data_internal+28032] + vmovupd ymm9, YMMWORD PTR [__jsvml_dpow_ha_data_internal+28032] vaddpd ymm12, ymm9, ymm2 vextractf128 xmm7, ymm12, 1 vsubpd ymm9, ymm12, ymm9 vshufps xmm15, xmm12, xmm7, 136 - vandps xmm11, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+28992] + vandps xmm11, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28992] vpslld xmm5, xmm15, 13 vpslld xmm14, xmm11, 4 vmovd r8d, xmm14 - vpaddd xmm4, xmm5, XMMWORD PTR [__svml_dpow_ha_data_internal+28928] + vpaddd xmm4, xmm5, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28928] vpshufd xmm3, xmm4, 80 vpextrd r9d, xmm14, 1 movsxd r8, r8d @@ -1410,28 +1410,28 @@ L127:: vpextrd ecx, xmm14, 3 movsxd r10, r10d movsxd rcx, ecx - vmovupd xmm11, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+r8] - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+r9] + vmovupd xmm11, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+r8] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+r9] vpshufd xmm1, xmm4, 250 vsubpd ymm2, ymm2, ymm9 - vinsertf128 ymm14, ymm11, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+r10], 1 - vinsertf128 ymm4, ymm15, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+rcx], 1 + vinsertf128 ymm14, ymm11, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+r10], 1 + vinsertf128 ymm4, ymm15, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+rcx], 1 vinsertf128 ymm7, ymm3, xmm1, 1 vunpcklpd ymm3, ymm14, ymm4 vunpckhpd ymm1, ymm14, ymm4 vaddpd ymm4, ymm8, ymm13 vaddpd ymm4, ymm2, ymm4 vmulpd ymm12, ymm4, ymm4 - vmulpd ymm2, ymm4, YMMWORD PTR [__svml_dpow_ha_data_internal+27200] - vandpd ymm5, ymm7, YMMWORD PTR [__svml_dpow_ha_data_internal+27968] + vmulpd ymm2, ymm4, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27200] + vandpd ymm5, ymm7, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27968] vmulpd ymm7, ymm12, ymm12 - vaddpd ymm8, ymm2, YMMWORD PTR [__svml_dpow_ha_data_internal+27264] + vaddpd ymm8, ymm2, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27264] vmulpd ymm9, ymm7, ymm8 vmulpd ymm11, ymm3, ymm9 vaddpd ymm15, ymm1, ymm11 - vmulpd ymm1, ymm4, YMMWORD PTR [__svml_dpow_ha_data_internal+27328] - vmulpd ymm4, ymm4, YMMWORD PTR [__svml_dpow_ha_data_internal+27456] - vaddpd ymm13, ymm1, YMMWORD PTR [__svml_dpow_ha_data_internal+27392] + vmulpd ymm1, ymm4, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27328] + vmulpd ymm4, ymm4, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27456] + vaddpd ymm13, ymm1, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27392] vmulpd ymm7, ymm3, ymm4 vmulpd ymm14, ymm12, ymm13 vmulpd ymm1, ymm3, ymm14 @@ -1499,19 +1499,19 @@ _B5_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_pow4_ha_e9 ENDP +__jsvml_pow4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow4_ha_e9_B1_B3: +_unwind___jsvml_pow4_ha_e9_B1_B3: DD 1470209 DD 4904047 DD 1407075 @@ -1532,20 +1532,20 @@ _unwind___svml_pow4_ha_e9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_pow4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_pow4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow4_ha_e9_B6_B10: +_unwind___jsvml_pow4_ha_e9_B6_B10: DD 398369 DD 549908 DD 603149 DD 174088 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_pow4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_pow4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1554,7 +1554,7 @@ _unwind___svml_pow4_ha_e9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_pow4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_pow4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1568,9 +1568,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow1_ha_e9 + PUBLIC __jsvml_pow1_ha_e9 -__svml_pow1_ha_e9 PROC EXPORT +__jsvml_pow1_ha_e9 PROC EXPORT _B6_1:: @@ -1606,9 +1606,9 @@ L154:: vmovd xmm1, ecx mov QWORD PTR [232+rsp], r13 mov ecx, 1094189056 - vmovsd xmm15, QWORD PTR [__svml_dpow_ha_data_internal+27520] + vmovsd xmm15, QWORD PTR [__jsvml_dpow_ha_data_internal+27520] vpaddd xmm4, xmm14, xmm12 - vmovsd xmm13, QWORD PTR [__svml_dpow_ha_data_internal+27648] + vmovsd xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+27648] vandpd xmm5, xmm0, xmm15 vpsrld xmm6, xmm4, 10 vorpd xmm15, xmm5, xmm13 @@ -1621,7 +1621,7 @@ L154:: vpaddd xmm5, xmm12, xmm4 vmovd r11d, xmm13 mov r9d, 1048576 - vmovsd xmm13, QWORD PTR [__svml_dpow_ha_data_internal+27712] + vmovsd xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+27712] vpshufd xmm6, xmm5, 0 movsxd r10, r10d vandpd xmm8, xmm6, xmm13 @@ -1631,18 +1631,18 @@ L154:: mov ecx, 1072693248 vpand xmm2, xmm2, xmm9 lea r13, QWORD PTR [95+rsp] - vmulsd xmm6, xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] + vmulsd xmm6, xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] and r13, -64 - vsubsd xmm12, xmm8, QWORD PTR [__svml_dpow_ha_data_internal+27776] - vaddsd xmm4, xmm6, QWORD PTR [__svml_dpow_ha_data_internal+27904] - vmovsd xmm8, QWORD PTR [__svml_dpow_ha_data_internal+27840] + vsubsd xmm12, xmm8, QWORD PTR [__jsvml_dpow_ha_data_internal+27776] + vaddsd xmm4, xmm6, QWORD PTR [__jsvml_dpow_ha_data_internal+27904] + vmovsd xmm8, QWORD PTR [__jsvml_dpow_ha_data_internal+27840] vandpd xmm5, xmm15, xmm8 mov QWORD PTR [368+rsp], r13 vsubsd xmm14, xmm15, xmm5 - vmulsd xmm15, xmm5, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] + vmulsd xmm15, xmm5, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] vsubsd xmm5, xmm15, xmm6 - vmulsd xmm15, xmm14, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] - vaddsd xmm14, xmm12, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r11] + vmulsd xmm15, xmm14, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] + vaddsd xmm14, xmm12, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r11] vaddsd xmm13, xmm15, xmm5 vaddsd xmm15, xmm14, xmm4 vaddsd xmm6, xmm15, xmm13 @@ -1651,19 +1651,19 @@ L154:: vaddsd xmm12, xmm12, xmm4 vaddsd xmm14, xmm5, xmm13 vaddsd xmm15, xmm14, xmm12 - vaddsd xmm5, xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8264+rax+r11] + vaddsd xmm5, xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8264+rax+r11] vaddsd xmm15, xmm4, xmm13 - vmovsd xmm4, QWORD PTR [__svml_dpow_ha_data_internal+26816] + vmovsd xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+26816] vmulsd xmm13, xmm4, xmm15 - vaddsd xmm14, xmm13, QWORD PTR [__svml_dpow_ha_data_internal+26880] + vaddsd xmm14, xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+26880] vmulsd xmm12, xmm14, xmm15 - vaddsd xmm4, xmm12, QWORD PTR [__svml_dpow_ha_data_internal+26944] + vaddsd xmm4, xmm12, QWORD PTR [__jsvml_dpow_ha_data_internal+26944] vmulsd xmm13, xmm4, xmm15 - vaddsd xmm14, xmm13, QWORD PTR [__svml_dpow_ha_data_internal+27008] + vaddsd xmm14, xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+27008] vmulsd xmm12, xmm14, xmm15 - vaddsd xmm4, xmm12, QWORD PTR [__svml_dpow_ha_data_internal+27072] + vaddsd xmm4, xmm12, QWORD PTR [__jsvml_dpow_ha_data_internal+27072] vmulsd xmm13, xmm4, xmm15 - vaddsd xmm14, xmm13, QWORD PTR [__svml_dpow_ha_data_internal+27136] + vaddsd xmm14, xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+27136] vmulsd xmm15, xmm14, xmm15 vandpd xmm14, xmm7, xmm8 vaddsd xmm5, xmm15, xmm5 @@ -1695,7 +1695,7 @@ L154:: vaddsd xmm4, xmm14, xmm9 vpor xmm3, xmm2, xmm12 vmovd xmm6, ecx - vmovsd xmm12, QWORD PTR [__svml_dpow_ha_data_internal+28032] + vmovsd xmm12, QWORD PTR [__jsvml_dpow_ha_data_internal+28032] mov r8d, 127 vmovmskps edx, xmm3 vaddsd xmm14, xmm8, xmm12 @@ -1707,33 +1707,33 @@ L154:: vpand xmm3, xmm4, xmm2 vpaddd xmm15, xmm5, xmm6 vpslld xmm4, xmm3, 4 - vmovsd xmm6, QWORD PTR [__svml_dpow_ha_data_internal+27968] + vmovsd xmm6, QWORD PTR [__jsvml_dpow_ha_data_internal+27968] vpshufd xmm5, xmm15, 0 vandpd xmm15, xmm5, xmm6 vsubsd xmm5, xmm8, xmm9 vaddsd xmm8, xmm1, xmm13 vmovd r9d, xmm4 - vmovsd xmm1, QWORD PTR [__svml_dpow_ha_data_internal+27200] + vmovsd xmm1, QWORD PTR [__jsvml_dpow_ha_data_internal+27200] vaddsd xmm5, xmm8, xmm5 vmulsd xmm6, xmm5, xmm5 vmulsd xmm2, xmm1, xmm5 vmulsd xmm4, xmm6, xmm6 - vaddsd xmm3, xmm2, QWORD PTR [__svml_dpow_ha_data_internal+27264] - vmovsd xmm12, QWORD PTR [__svml_dpow_ha_data_internal+27328] + vaddsd xmm3, xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+27264] + vmovsd xmm12, QWORD PTR [__jsvml_dpow_ha_data_internal+27328] vmulsd xmm13, xmm12, xmm5 vmulsd xmm8, xmm3, xmm4 - vaddsd xmm14, xmm13, QWORD PTR [__svml_dpow_ha_data_internal+27392] + vaddsd xmm14, xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+27392] movsxd r9, r9d vmulsd xmm6, xmm14, xmm6 - vmulsd xmm9, xmm8, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - vmulsd xmm2, xmm6, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - vaddsd xmm1, xmm9, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24712+rax+r9] - vmovsd xmm3, QWORD PTR [__svml_dpow_ha_data_internal+27456] + vmulsd xmm9, xmm8, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + vmulsd xmm2, xmm6, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + vaddsd xmm1, xmm9, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24712+rax+r9] + vmovsd xmm3, QWORD PTR [__jsvml_dpow_ha_data_internal+27456] vaddsd xmm4, xmm1, xmm2 vmulsd xmm5, xmm3, xmm5 - vmulsd xmm6, xmm5, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] + vmulsd xmm6, xmm5, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] vaddsd xmm8, xmm4, xmm6 - vaddsd xmm9, xmm8, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] + vaddsd xmm9, xmm8, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] vmulsd xmm1, xmm9, xmm15 and edx, 1 jne _B6_3 @@ -1771,19 +1771,19 @@ _B6_6:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_pow1_ha_e9 ENDP +__jsvml_pow1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow1_ha_e9_B1_B6: +_unwind___jsvml_pow1_ha_e9_B1_B6: DD 1353473 DD 1954983 DD 1009819 @@ -1803,7 +1803,7 @@ _unwind___svml_pow1_ha_e9_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_pow1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_pow1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1817,9 +1817,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow4_ha_l9 + PUBLIC __jsvml_pow4_ha_l9 -__svml_pow4_ha_l9 PROC EXPORT +__jsvml_pow4_ha_l9 PROC EXPORT _B7_1:: @@ -1842,24 +1842,24 @@ L173:: vmovups YMMWORD PTR [432+rsp], ymm6 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [143+rsp] - vmovups xmm4, XMMWORD PTR [__svml_dpow_ha_data_internal+28416] + vmovups xmm4, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28416] and r13, -64 vmovapd ymm14, ymm1 - vmovups xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+28480] - vmovups xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+28544] + vmovups xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28480] + vmovups xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28544] mov QWORD PTR [600+rsp], r13 vextracti128 xmm5, ymm0, 1 vshufps xmm6, xmm0, xmm5, 221 - vandps xmm12, xmm6, XMMWORD PTR [__svml_dpow_ha_data_internal+28672] - vpaddd xmm13, xmm12, XMMWORD PTR [__svml_dpow_ha_data_internal+28736] - vpaddd xmm3, xmm6, XMMWORD PTR [__svml_dpow_ha_data_internal+28352] + vandps xmm12, xmm6, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28672] + vpaddd xmm13, xmm12, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28736] + vpaddd xmm3, xmm6, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28352] vpsrld xmm5, xmm13, 10 vpcmpgtd xmm10, xmm4, xmm3 vpslld xmm3, xmm5, 3 vmovd eax, xmm3 vpslld xmm12, xmm5, 4 vmovd r10d, xmm12 - vpsubd xmm6, xmm6, XMMWORD PTR [__svml_dpow_ha_data_internal+28800] + vpsubd xmm6, xmm6, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28800] movsxd rax, eax vpextrd ecx, xmm3, 1 movsxd rcx, ecx @@ -1870,38 +1870,38 @@ L173:: movsxd r10, r10d movsxd r11, r11d movsxd r9, r9d - vandpd ymm15, ymm0, YMMWORD PTR [__svml_dpow_ha_data_internal+27520] - vorpd ymm1, ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+27648] - vmovsd xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+r8] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+r10] - vmovhpd xmm13, xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+r9] + vandpd ymm15, ymm0, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27520] + vorpd ymm1, ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27648] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+r8] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+r10] + vmovhpd xmm13, xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+r9] vextracti128 xmm2, ymm14, 1 vshufps xmm9, xmm14, xmm2, 221 - vmovsd xmm2, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+rax] + vmovsd xmm2, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+rax] vpand xmm9, xmm9, xmm7 - vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rdx+rcx] + vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rdx+rcx] vpextrd eax, xmm12, 2 vpextrd ecx, xmm12, 3 movsxd rax, eax movsxd rcx, ecx - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+r11] - vinsertf128 ymm12, ymm5, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+rax], 1 - vinsertf128 ymm15, ymm2, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rdx+rcx], 1 + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+r11] + vinsertf128 ymm12, ymm5, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+rax], 1 + vinsertf128 ymm15, ymm2, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rdx+rcx], 1 vunpcklpd ymm2, ymm12, ymm15 vinsertf128 ymm3, ymm4, xmm13, 1 vunpckhpd ymm4, ymm12, ymm15 vpsrad xmm15, xmm6, 20 - vpaddd xmm6, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+28864] + vpaddd xmm6, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28864] vpshufd xmm12, xmm6, 80 vpshufd xmm13, xmm6, 250 - vmovupd ymm6, YMMWORD PTR [__svml_dpow_ha_data_internal+27840] + vmovupd ymm6, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27840] vinserti128 ymm5, ymm12, xmm13, 1 vmulpd ymm12, ymm1, ymm3 - vandpd ymm15, ymm5, YMMWORD PTR [__svml_dpow_ha_data_internal+27712] - vsubpd ymm13, ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+27776] + vandpd ymm15, ymm5, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27712] + vsubpd ymm13, ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27776] vandpd ymm15, ymm1, ymm6 vsubpd ymm5, ymm1, ymm15 - vaddpd ymm1, ymm12, YMMWORD PTR [__svml_dpow_ha_data_internal+27904] + vaddpd ymm1, ymm12, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27904] vfmsub213pd ymm15, ymm3, ymm12 vfmadd213pd ymm5, ymm3, ymm15 vaddpd ymm3, ymm2, ymm13 @@ -1913,13 +1913,13 @@ L173:: vaddpd ymm1, ymm1, ymm5 vaddpd ymm15, ymm5, ymm2 vaddpd ymm13, ymm3, ymm15 - vmovupd ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+26816] + vmovupd ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+26816] vaddpd ymm4, ymm4, ymm13 - vfmadd213pd ymm15, ymm1, YMMWORD PTR [__svml_dpow_ha_data_internal+26880] - vfmadd213pd ymm15, ymm1, YMMWORD PTR [__svml_dpow_ha_data_internal+26944] - vfmadd213pd ymm15, ymm1, YMMWORD PTR [__svml_dpow_ha_data_internal+27008] - vfmadd213pd ymm15, ymm1, YMMWORD PTR [__svml_dpow_ha_data_internal+27072] - vfmadd213pd ymm15, ymm1, YMMWORD PTR [__svml_dpow_ha_data_internal+27136] + vfmadd213pd ymm15, ymm1, YMMWORD PTR [__jsvml_dpow_ha_data_internal+26880] + vfmadd213pd ymm15, ymm1, YMMWORD PTR [__jsvml_dpow_ha_data_internal+26944] + vfmadd213pd ymm15, ymm1, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27008] + vfmadd213pd ymm15, ymm1, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27072] + vfmadd213pd ymm15, ymm1, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27136] vfmadd213pd ymm15, ymm1, ymm4 vaddpd ymm13, ymm12, ymm15 vandpd ymm5, ymm13, ymm6 @@ -1937,7 +1937,7 @@ L173:: vpor xmm9, xmm7, xmm8 vmulpd ymm7, ymm1, ymm12 vpor xmm8, xmm10, xmm9 - vmovups xmm3, XMMWORD PTR [__svml_dpow_ha_data_internal+28608] + vmovups xmm3, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28608] vpcmpgtd xmm10, xmm4, xmm3 vpcmpeqd xmm9, xmm4, xmm3 vpor xmm10, xmm10, xmm9 @@ -1946,18 +1946,18 @@ L173:: vmovmskps eax, xmm6 vmulpd ymm6, ymm14, ymm15 vfmadd213pd ymm12, ymm5, ymm2 - vmovupd ymm5, YMMWORD PTR [__svml_dpow_ha_data_internal+28032] + vmovupd ymm5, YMMWORD PTR [__jsvml_dpow_ha_data_internal+28032] vaddpd ymm12, ymm12, ymm6 vaddpd ymm7, ymm5, ymm13 - vmovupd ymm6, YMMWORD PTR [__svml_dpow_ha_data_internal+27328] + vmovupd ymm6, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27328] vextracti128 xmm15, ymm7, 1 vsubpd ymm5, ymm7, ymm5 vshufps xmm2, xmm7, xmm15, 136 - vandps xmm1, xmm2, XMMWORD PTR [__svml_dpow_ha_data_internal+28992] + vandps xmm1, xmm2, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28992] vpslld xmm3, xmm2, 13 vpslld xmm15, xmm1, 4 vmovd r8d, xmm15 - vpaddd xmm9, xmm3, XMMWORD PTR [__svml_dpow_ha_data_internal+28928] + vpaddd xmm9, xmm3, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28928] vpshufd xmm4, xmm9, 80 vpextrd r9d, xmm15, 1 movsxd r8, r8d @@ -1967,21 +1967,21 @@ L173:: movsxd r10, r10d movsxd rcx, ecx vsubpd ymm13, ymm13, ymm5 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+r8] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+r9] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+r8] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+r9] vpshufd xmm8, xmm9, 250 vinserti128 ymm10, ymm4, xmm8, 1 - vinsertf128 ymm15, ymm1, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+r10], 1 - vinsertf128 ymm3, ymm2, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rdx+rcx], 1 - vandpd ymm9, ymm10, YMMWORD PTR [__svml_dpow_ha_data_internal+27968] + vinsertf128 ymm15, ymm1, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+r10], 1 + vinsertf128 ymm3, ymm2, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rdx+rcx], 1 + vandpd ymm9, ymm10, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27968] vunpcklpd ymm8, ymm15, ymm3 vunpckhpd ymm10, ymm15, ymm3 vaddpd ymm15, ymm13, ymm12 - vmovupd ymm2, YMMWORD PTR [__svml_dpow_ha_data_internal+27200] + vmovupd ymm2, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27200] vmulpd ymm5, ymm15, ymm15 - vfmadd213pd ymm6, ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+27392] - vfmadd213pd ymm2, ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+27264] - vmulpd ymm15, ymm15, YMMWORD PTR [__svml_dpow_ha_data_internal+27456] + vfmadd213pd ymm6, ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27392] + vfmadd213pd ymm2, ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27264] + vmulpd ymm15, ymm15, YMMWORD PTR [__jsvml_dpow_ha_data_internal+27456] vmulpd ymm1, ymm5, ymm5 vmulpd ymm7, ymm5, ymm6 vmulpd ymm3, ymm1, ymm2 @@ -2053,19 +2053,19 @@ _B7_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_pow4_ha_l9 ENDP +__jsvml_pow4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow4_ha_l9_B1_B3: +_unwind___jsvml_pow4_ha_l9_B1_B3: DD 1469185 DD 4904043 DD 1796195 @@ -2086,20 +2086,20 @@ _unwind___svml_pow4_ha_l9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_pow4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_pow4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow4_ha_l9_B6_B10: +_unwind___jsvml_pow4_ha_l9_B6_B10: DD 398369 DD 549908 DD 603149 DD 178184 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_pow4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_pow4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2108,7 +2108,7 @@ _unwind___svml_pow4_ha_l9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_pow4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_pow4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2122,9 +2122,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow2_ha_l9 + PUBLIC __jsvml_pow2_ha_l9 -__svml_pow2_ha_l9 PROC EXPORT +__jsvml_pow2_ha_l9 PROC EXPORT _B8_1:: @@ -2151,18 +2151,18 @@ L200:: lea r13, QWORD PTR [111+rsp] vpshufd xmm6, xmm0, 221 and r13, -64 - vmovq xmm13, QWORD PTR [__svml_dpow_ha_data_internal+28672] - vmovq xmm9, QWORD PTR [__svml_dpow_ha_data_internal+28736] + vmovq xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+28672] + vmovq xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+28736] vpand xmm12, xmm6, xmm13 vpaddd xmm10, xmm12, xmm9 vpsrld xmm2, xmm10, 10 - vandpd xmm14, xmm0, XMMWORD PTR [__svml_dpow_ha_data_internal+27520] + vandpd xmm14, xmm0, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27520] vpslld xmm1, xmm2, 3 - vorpd xmm15, xmm14, XMMWORD PTR [__svml_dpow_ha_data_internal+27648] + vorpd xmm15, xmm14, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27648] vpslld xmm14, xmm2, 4 vmovd edx, xmm1 vmovd r8d, xmm14 - vmovq xmm4, QWORD PTR [__svml_dpow_ha_data_internal+28480] + vmovq xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+28480] vpshufd xmm3, xmm11, 221 movsxd rdx, edx vpand xmm7, xmm3, xmm4 @@ -2171,28 +2171,28 @@ L200:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovsd xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+rdx] - vmovq xmm2, QWORD PTR [__svml_dpow_ha_data_internal+28800] - vmovhpd xmm9, xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+rcx] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+rdx] + vmovq xmm2, QWORD PTR [__jsvml_dpow_ha_data_internal+28800] + vmovhpd xmm9, xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+rcx] vpsubd xmm3, xmm6, xmm2 - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r8] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r8] vpsrad xmm14, xmm3, 20 - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r9] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r9] vunpcklpd xmm12, xmm13, xmm10 vunpckhpd xmm1, xmm13, xmm10 - vmovq xmm13, QWORD PTR [__svml_dpow_ha_data_internal+28864] + vmovq xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+28864] vpaddd xmm10, xmm14, xmm13 vpshufd xmm2, xmm10, 80 - vandpd xmm3, xmm2, XMMWORD PTR [__svml_dpow_ha_data_internal+27712] - vsubpd xmm10, xmm3, XMMWORD PTR [__svml_dpow_ha_data_internal+27776] - vmovupd xmm3, XMMWORD PTR [__svml_dpow_ha_data_internal+27840] + vandpd xmm3, xmm2, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27712] + vsubpd xmm10, xmm3, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27776] + vmovupd xmm3, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27840] vandpd xmm14, xmm15, xmm3 vsubpd xmm2, xmm15, xmm14 vmulpd xmm15, xmm15, xmm9 vfmsub213pd xmm14, xmm9, xmm15 - vmovq xmm5, QWORD PTR [__svml_dpow_ha_data_internal+28352] - vmovq xmm8, QWORD PTR [__svml_dpow_ha_data_internal+28416] - vaddpd xmm13, xmm15, XMMWORD PTR [__svml_dpow_ha_data_internal+27904] + vmovq xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+28352] + vmovq xmm8, QWORD PTR [__jsvml_dpow_ha_data_internal+28416] + vaddpd xmm13, xmm15, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27904] vfmadd213pd xmm2, xmm9, xmm14 vaddpd xmm14, xmm12, xmm10 vaddpd xmm15, xmm13, xmm14 @@ -2202,17 +2202,17 @@ L200:: vaddpd xmm14, xmm13, xmm12 vaddpd xmm13, xmm13, xmm2 vaddpd xmm12, xmm2, xmm10 - vmovupd xmm2, XMMWORD PTR [__svml_dpow_ha_data_internal+26816] - vfmadd213pd xmm2, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+26880] + vmovupd xmm2, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26816] + vfmadd213pd xmm2, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26880] vaddpd xmm15, xmm14, xmm12 - vfmadd213pd xmm2, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+26944] + vfmadd213pd xmm2, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+26944] vandpd xmm12, xmm11, xmm3 vaddpd xmm1, xmm1, xmm15 - vfmadd213pd xmm2, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+27008] - vfmadd213pd xmm2, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+27072] - vfmadd213pd xmm2, xmm13, XMMWORD PTR [__svml_dpow_ha_data_internal+27136] + vfmadd213pd xmm2, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27008] + vfmadd213pd xmm2, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27072] + vfmadd213pd xmm2, xmm13, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27136] vfmadd213pd xmm2, xmm13, xmm1 - vmovq xmm13, QWORD PTR [__svml_dpow_ha_data_internal+28608] + vmovq xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+28608] vaddpd xmm14, xmm9, xmm2 vandpd xmm1, xmm14, xmm3 vmulpd xmm10, xmm1, xmm12 @@ -2223,7 +2223,7 @@ L200:: vpshufd xmm3, xmm10, 221 vpand xmm14, xmm3, xmm4 vpaddd xmm4, xmm6, xmm5 - vmovq xmm5, QWORD PTR [__svml_dpow_ha_data_internal+28544] + vmovq xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+28544] vpcmpgtd xmm3, xmm8, xmm4 vpcmpgtd xmm8, xmm7, xmm5 vpcmpeqd xmm7, xmm7, xmm5 @@ -2235,43 +2235,43 @@ L200:: vpor xmm14, xmm6, xmm13 vmulpd xmm13, xmm15, xmm9 vmovmskps edx, xmm14 - vmovupd xmm8, XMMWORD PTR [__svml_dpow_ha_data_internal+28032] + vmovupd xmm8, XMMWORD PTR [__jsvml_dpow_ha_data_internal+28032] vaddpd xmm7, xmm8, xmm10 vfmadd213pd xmm12, xmm15, xmm13 vmulpd xmm15, xmm11, xmm2 vsubpd xmm5, xmm7, xmm8 vfmadd213pd xmm9, xmm1, xmm12 vpshufd xmm2, xmm7, 136 - vmovq xmm12, QWORD PTR [__svml_dpow_ha_data_internal+28992] + vmovq xmm12, QWORD PTR [__jsvml_dpow_ha_data_internal+28992] vpslld xmm14, xmm2, 13 vsubpd xmm10, xmm10, xmm5 vaddpd xmm9, xmm9, xmm15 vpand xmm1, xmm2, xmm12 vpslld xmm1, xmm1, 4 vmovd r10d, xmm1 - vmovq xmm13, QWORD PTR [__svml_dpow_ha_data_internal+28928] + vmovq xmm13, QWORD PTR [__jsvml_dpow_ha_data_internal+28928] vpaddd xmm12, xmm14, xmm13 vpextrd r11d, xmm1, 1 vaddpd xmm7, xmm10, xmm9 movsxd r10, r10d movsxd r11, r11d vpshufd xmm2, xmm12, 80 - vmovupd xmm1, XMMWORD PTR [__svml_dpow_ha_data_internal+27200] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r10] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r11] + vmovupd xmm1, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27200] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r10] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r11] vunpcklpd xmm13, xmm3, xmm4 vunpckhpd xmm12, xmm3, xmm4 vmulpd xmm3, xmm7, xmm7 - vfmadd213pd xmm1, xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+27264] - vandpd xmm14, xmm2, XMMWORD PTR [__svml_dpow_ha_data_internal+27968] + vfmadd213pd xmm1, xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27264] + vandpd xmm14, xmm2, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27968] vmulpd xmm15, xmm3, xmm3 - vmulpd xmm8, xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+27456] + vmulpd xmm8, xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27456] vmulpd xmm15, xmm15, xmm1 vmulpd xmm10, xmm13, xmm8 vmulpd xmm2, xmm13, xmm15 vaddpd xmm5, xmm12, xmm2 - vmovupd xmm12, XMMWORD PTR [__svml_dpow_ha_data_internal+27328] - vfmadd213pd xmm12, xmm7, XMMWORD PTR [__svml_dpow_ha_data_internal+27392] + vmovupd xmm12, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27328] + vfmadd213pd xmm12, xmm7, XMMWORD PTR [__jsvml_dpow_ha_data_internal+27392] vmulpd xmm4, xmm3, xmm12 vmulpd xmm6, xmm13, xmm4 vaddpd xmm9, xmm5, xmm6 @@ -2338,19 +2338,19 @@ _B8_10:: lea rdx, QWORD PTR [64+r13+rbx*8] lea r8, QWORD PTR [128+r13+rbx*8] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_pow2_ha_l9 ENDP +__jsvml_pow2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow2_ha_l9_B1_B3: +_unwind___jsvml_pow2_ha_l9_B1_B3: DD 1603585 DD 3462264 DD 1599600 @@ -2372,19 +2372,19 @@ _unwind___svml_pow2_ha_l9_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_pow2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_pow2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow2_ha_l9_B6_B10: +_unwind___jsvml_pow2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_pow2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_pow2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2393,7 +2393,7 @@ _unwind___svml_pow2_ha_l9_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_pow2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_pow2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2407,9 +2407,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_pow1_ha_l9 + PUBLIC __jsvml_pow1_ha_l9 -__svml_pow1_ha_l9 PROC EXPORT +__jsvml_pow1_ha_l9 PROC EXPORT _B9_1:: @@ -2446,9 +2446,9 @@ L227:: lea r13, QWORD PTR [95+rsp] vpshufd xmm10, xmm1, 85 vpand xmm8, xmm3, xmm14 - vmovsd xmm5, QWORD PTR [__svml_dpow_ha_data_internal+27520] + vmovsd xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+27520] vpand xmm6, xmm10, xmm2 - vmovsd xmm15, QWORD PTR [__svml_dpow_ha_data_internal+27648] + vmovsd xmm15, QWORD PTR [__jsvml_dpow_ha_data_internal+27648] vandpd xmm10, xmm0, xmm5 vpaddd xmm13, xmm8, xmm9 vorpd xmm4, xmm10, xmm15 @@ -2465,20 +2465,20 @@ L227:: mov edx, 2097152 vmovd r11d, xmm15 mov ecx, 1072693248 - vmovsd xmm15, QWORD PTR [__svml_dpow_ha_data_internal+27712] + vmovsd xmm15, QWORD PTR [__jsvml_dpow_ha_data_internal+27712] vpshufd xmm10, xmm5, 0 vandpd xmm14, xmm10, xmm15 and r13, -64 - vmovsd xmm15, QWORD PTR [__svml_dpow_ha_data_internal+27840] + vmovsd xmm15, QWORD PTR [__jsvml_dpow_ha_data_internal+27840] vandpd xmm8, xmm4, xmm15 - vsubsd xmm9, xmm14, QWORD PTR [__svml_dpow_ha_data_internal+27776] + vsubsd xmm9, xmm14, QWORD PTR [__jsvml_dpow_ha_data_internal+27776] vsubsd xmm10, xmm4, xmm8 - vmulsd xmm4, xmm4, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] + vmulsd xmm4, xmm4, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] movsxd r11, r11d - vaddsd xmm5, xmm4, QWORD PTR [__svml_dpow_ha_data_internal+27904] - vfmsub132sd xmm8, xmm4, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] - vaddsd xmm4, xmm9, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8256+rax+r11] - vfmadd132sd xmm10, xmm8, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+rax+r10] + vaddsd xmm5, xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+27904] + vfmsub132sd xmm8, xmm4, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] + vaddsd xmm4, xmm9, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8256+rax+r11] + vfmadd132sd xmm10, xmm8, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+rax+r10] vaddsd xmm13, xmm4, xmm5 mov QWORD PTR [368+rsp], r13 vsubsd xmm14, xmm4, xmm13 @@ -2488,14 +2488,14 @@ L227:: vaddsd xmm8, xmm4, xmm10 vaddsd xmm10, xmm5, xmm10 vaddsd xmm13, xmm8, xmm9 - vmovsd xmm5, QWORD PTR [__svml_dpow_ha_data_internal+26816] + vmovsd xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+26816] vandpd xmm9, xmm1, xmm15 - vfmadd213sd xmm5, xmm10, QWORD PTR [__svml_dpow_ha_data_internal+26880] - vaddsd xmm4, xmm13, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+8264+rax+r11] - vfmadd213sd xmm5, xmm10, QWORD PTR [__svml_dpow_ha_data_internal+26944] - vfmadd213sd xmm5, xmm10, QWORD PTR [__svml_dpow_ha_data_internal+27008] - vfmadd213sd xmm5, xmm10, QWORD PTR [__svml_dpow_ha_data_internal+27072] - vfmadd213sd xmm5, xmm10, QWORD PTR [__svml_dpow_ha_data_internal+27136] + vfmadd213sd xmm5, xmm10, QWORD PTR [__jsvml_dpow_ha_data_internal+26880] + vaddsd xmm4, xmm13, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+8264+rax+r11] + vfmadd213sd xmm5, xmm10, QWORD PTR [__jsvml_dpow_ha_data_internal+26944] + vfmadd213sd xmm5, xmm10, QWORD PTR [__jsvml_dpow_ha_data_internal+27008] + vfmadd213sd xmm5, xmm10, QWORD PTR [__jsvml_dpow_ha_data_internal+27072] + vfmadd213sd xmm5, xmm10, QWORD PTR [__jsvml_dpow_ha_data_internal+27136] vfmadd213sd xmm5, xmm10, xmm4 vaddsd xmm4, xmm14, xmm5 vsubsd xmm10, xmm4, xmm14 @@ -2524,9 +2524,9 @@ L227:: vmulsd xmm4, xmm1, xmm13 vmovd xmm2, ecx vfmadd213sd xmm15, xmm10, xmm9 - vmovsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+28032] + vmovsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+28032] vpor xmm6, xmm3, xmm5 - vmovsd xmm5, QWORD PTR [__svml_dpow_ha_data_internal+27968] + vmovsd xmm5, QWORD PTR [__jsvml_dpow_ha_data_internal+27968] vaddsd xmm8, xmm14, xmm9 vmovmskps edx, xmm6 vaddsd xmm15, xmm15, xmm4 @@ -2541,25 +2541,25 @@ L227:: vmovd r9d, xmm2 vandpd xmm10, xmm3, xmm5 vsubsd xmm9, xmm14, xmm8 - vmovsd xmm14, QWORD PTR [__svml_dpow_ha_data_internal+27200] + vmovsd xmm14, QWORD PTR [__jsvml_dpow_ha_data_internal+27200] vaddsd xmm15, xmm15, xmm9 vmulsd xmm5, xmm15, xmm15 - vfmadd213sd xmm14, xmm15, QWORD PTR [__svml_dpow_ha_data_internal+27264] - vmovsd xmm4, QWORD PTR [__svml_dpow_ha_data_internal+27328] + vfmadd213sd xmm14, xmm15, QWORD PTR [__jsvml_dpow_ha_data_internal+27264] + vmovsd xmm4, QWORD PTR [__jsvml_dpow_ha_data_internal+27328] vmulsd xmm2, xmm5, xmm5 - vfmadd213sd xmm4, xmm15, QWORD PTR [__svml_dpow_ha_data_internal+27392] - vmovsd xmm9, QWORD PTR [__svml_dpow_ha_data_internal+27456] + vfmadd213sd xmm4, xmm15, QWORD PTR [__jsvml_dpow_ha_data_internal+27392] + vmovsd xmm9, QWORD PTR [__jsvml_dpow_ha_data_internal+27456] vmulsd xmm14, xmm14, xmm2 vmulsd xmm6, xmm4, xmm5 vmulsd xmm15, xmm9, xmm15 movsxd r9, r9d - vmulsd xmm3, xmm14, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - vmulsd xmm8, xmm6, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - vmulsd xmm2, xmm15, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] - vaddsd xmm7, xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24712+rax+r9] + vmulsd xmm3, xmm14, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + vmulsd xmm8, xmm6, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + vmulsd xmm2, xmm15, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] + vaddsd xmm7, xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24712+rax+r9] vaddsd xmm13, xmm7, xmm8 vaddsd xmm3, xmm13, xmm2 - vaddsd xmm4, xmm3, QWORD PTR [imagerel(__svml_dpow_ha_data_internal)+24704+rax+r9] + vaddsd xmm4, xmm3, QWORD PTR [imagerel(__jsvml_dpow_ha_data_internal)+24704+rax+r9] vmulsd xmm2, xmm4, xmm10 and edx, 1 jne _B9_3 @@ -2597,19 +2597,19 @@ _B9_6:: lea rdx, QWORD PTR [64+r13] lea r8, QWORD PTR [128+r13] - call __svml_dpow_ha_cout_rare_internal + call __jsvml_dpow_ha_cout_rare_internal jmp _B9_4 ALIGN 16 _B9_7:: -__svml_pow1_ha_l9 ENDP +__jsvml_pow1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_pow1_ha_l9_B1_B6: +_unwind___jsvml_pow1_ha_l9_B1_B6: DD 1350145 DD 1954970 DD 1009805 @@ -2629,7 +2629,7 @@ _unwind___svml_pow1_ha_l9_B1_B6: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_pow1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_pow1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2643,9 +2643,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dpow_ha_cout_rare_internal + PUBLIC __jsvml_dpow_ha_cout_rare_internal -__svml_dpow_ha_cout_rare_internal PROC +__jsvml_dpow_ha_cout_rare_internal PROC _B10_1:: @@ -3478,13 +3478,13 @@ _B10_76:: _B10_77:: -__svml_dpow_ha_cout_rare_internal ENDP +__jsvml_dpow_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dpow_ha_cout_rare_internal_B1_B76: +_unwind___jsvml_dpow_ha_cout_rare_internal_B1_B76: DD 1219329 DD 551067 DD 489619 @@ -3503,7 +3503,7 @@ _unwind___svml_dpow_ha_cout_rare_internal_B1_B76: DD imagerel _B10_1 DD imagerel _B10_77 - DD imagerel _unwind___svml_dpow_ha_cout_rare_internal_B1_B76 + DD imagerel _unwind___jsvml_dpow_ha_cout_rare_internal_B1_B76 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3511,8 +3511,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dpow_ha_data_internal_avx512 -__svml_dpow_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_dpow_ha_data_internal_avx512 +__jsvml_dpow_ha_data_internal_avx512 DD 0 DD 0 DD 1972240384 DD 3215375059 @@ -4152,8 +4152,8 @@ __svml_dpow_ha_data_internal_avx512 DD 0 DD 2146435072 DD 0 DD 2146435072 - PUBLIC __svml_dpow_ha_data_internal -__svml_dpow_ha_data_internal DD 1073741824 + PUBLIC __jsvml_dpow_ha_data_internal +__jsvml_dpow_ha_data_internal DD 1073741824 DD 1073157447 DD 1073741824 DD 1073155971 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_sin_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_sin_windows_x86.S similarity index 90% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_sin_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_sin_windows_x86.S index 4693b66fd5e..cced3b7f9b3 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_sin_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_sin_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin2_ha_e9 + PUBLIC __jsvml_sin2_ha_e9 -__svml_sin2_ha_e9 PROC EXPORT +__jsvml_sin2_ha_e9 PROC EXPORT _B1_1:: @@ -65,35 +65,35 @@ L1:: vmovups XMMWORD PTR [448+rsp], xmm6 mov QWORD PTR [464+rsp], r13 lea r13, QWORD PTR [223+rsp] - vmovupd xmm1, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + vmovupd xmm1, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 vandnpd xmm7, xmm1, xmm8 vandpd xmm1, xmm8, xmm1 - vmulpd xmm2, xmm1, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16576] - vmovupd xmm9, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16640] + vmulpd xmm2, xmm1, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] + vmovupd xmm9, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] vaddpd xmm10, xmm9, xmm2 vsubpd xmm4, xmm10, xmm9 - vmulpd xmm2, xmm4, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16768] - vmulpd xmm13, xmm4, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16832] + vmulpd xmm2, xmm4, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] + vmulpd xmm13, xmm4, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] vsubpd xmm14, xmm1, xmm2 - vmulpd xmm5, xmm4, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16896] + vmulpd xmm5, xmm4, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] vsubpd xmm6, xmm14, xmm13 - vandps xmm3, xmm10, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + vandps xmm3, xmm10, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] vsubpd xmm15, xmm14, xmm6 vmovd ecx, xmm3 vsubpd xmm11, xmm15, xmm13 shl ecx, 5 vpextrd r8d, xmm3, 2 shl r8d, 5 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm15, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm15, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] vmulpd xmm9, xmm15, xmm6 vsubpd xmm5, xmm11, xmm5 - vmovq xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm13, xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm13, xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] vmulpd xmm10, xmm13, xmm6 - vmovq xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] vaddpd xmm11, xmm3, xmm9 vaddpd xmm4, xmm10, xmm11 vsubpd xmm14, xmm3, xmm11 @@ -102,21 +102,21 @@ L1:: vaddpd xmm2, xmm10, xmm12 vaddpd xmm14, xmm0, xmm2 vmulpd xmm0, xmm6, xmm6 - vmovupd xmm2, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + vmovupd xmm2, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] vmulpd xmm11, xmm2, xmm0 - vmovupd xmm9, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + vmovupd xmm9, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] vaddpd xmm10, xmm9, xmm11 vmulpd xmm12, xmm0, xmm10 vaddpd xmm10, xmm13, xmm15 vmulpd xmm11, xmm6, xmm12 vmulpd xmm15, xmm11, xmm10 vaddpd xmm12, xmm14, xmm15 - vmovupd xmm15, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17216] + vmovupd xmm15, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] vmulpd xmm13, xmm15, xmm0 - vmovupd xmm14, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + vmovupd xmm14, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] vaddpd xmm11, xmm14, xmm13 vmulpd xmm11, xmm0, xmm11 - vmovupd xmm13, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovupd xmm13, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vaddpd xmm11, xmm13, xmm11 vmulpd xmm0, xmm0, xmm11 vmulpd xmm11, xmm3, xmm0 @@ -124,12 +124,12 @@ L1:: vaddpd xmm11, xmm12, xmm11 vsubpd xmm0, xmm10, xmm3 vmulpd xmm5, xmm5, xmm0 - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] - vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] vaddpd xmm0, xmm3, xmm5 vaddpd xmm3, xmm11, xmm0 vaddpd xmm4, xmm4, xmm3 - vcmpnlepd xmm3, xmm1, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + vcmpnlepd xmm3, xmm1, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] vmovmskpd r9d, xmm3 vxorpd xmm0, xmm4, xmm7 mov QWORD PTR [472+rsp], r13 @@ -194,7 +194,7 @@ _B1_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B1_9 _B1_12:: @@ -202,7 +202,7 @@ _B1_12:: vpand xmm12, xmm1, XMMWORD PTR [_2il0floatpacket_36] vpsrlq xmm11, xmm12, 52 vmovupd XMMWORD PTR [32+rsp], xmm9 - vmovupd xmm9, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovupd xmm9, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vmovd ecx, xmm11 vandpd xmm10, xmm9, xmm1 vmovupd XMMWORD PTR [64+rsp], xmm14 @@ -214,23 +214,23 @@ _B1_12:: shl r8d, 3 lea r10d, DWORD PTR [r9+r9*2] shl r10d, 3 - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r8] vpaddq xmm7, xmm4, XMMWORD PTR [_2il0floatpacket_38] vmovmskpd edx, xmm14 vmovupd XMMWORD PTR [80+rsp], xmm13 vpsrlq xmm11, xmm7, 32 vmovupd XMMWORD PTR [144+rsp], xmm8 - vmovq xmm8, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r8] - vmovhpd xmm13, xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r10] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r8] + vmovhpd xmm13, xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r10] vmovdqu xmm14, XMMWORD PTR [_2il0floatpacket_39] - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r8] vmovupd XMMWORD PTR [128+rsp], xmm0 vpsrlq xmm0, xmm13, 32 - vmovhpd xmm12, xmm8, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r10] + vmovhpd xmm12, xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r10] vpand xmm8, xmm7, xmm14 vpand xmm13, xmm13, xmm14 vpand xmm9, xmm12, xmm14 - vmovhpd xmm10, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm10, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r10] vpsrlq xmm12, xmm12, 32 vmovupd XMMWORD PTR [48+rsp], xmm15 vpand xmm4, xmm10, xmm14 @@ -327,17 +327,17 @@ _B1_12:: vandpd xmm13, xmm7, xmm14 shl ecx, 5 vorpd xmm9, xmm1, xmm13 - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r11] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r11] vandpd xmm10, xmm7, xmm15 - vmovhpd xmm15, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm15, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] vmulpd xmm3, xmm9, xmm15 vmulpd xmm1, xmm9, xmm9 - vmovq xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r11] - vmovhpd xmm7, xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r11] + vmovhpd xmm7, xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] vmulpd xmm6, xmm9, xmm7 vmulpd xmm2, xmm2, xmm1 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r11] - vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r11] + vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] vaddpd xmm5, xmm14, xmm3 vaddpd xmm2, xmm2, XMMWORD PTR [32+rsp] vaddpd xmm13, xmm6, xmm5 @@ -360,8 +360,8 @@ _B1_12:: vmulpd xmm10, xmm10, xmm2 vmulpd xmm1, xmm1, xmm11 vmulpd xmm15, xmm14, xmm1 - vmovq xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r11] - vmovhpd xmm9, xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm9, xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vaddpd xmm0, xmm12, xmm15 vaddpd xmm1, xmm9, xmm10 vaddpd xmm2, xmm0, xmm1 @@ -376,13 +376,13 @@ _B1_12:: _B1_13:: -__svml_sin2_ha_e9 ENDP +__jsvml_sin2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_e9_B1_B4: +_unwind___jsvml_sin2_ha_e9_B1_B4: DD 1604097 DD 3855482 DD 1861746 @@ -404,19 +404,19 @@ _unwind___svml_sin2_ha_e9_B1_B4: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_sin2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_e9_B7_B11: +_unwind___jsvml_sin2_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_sin2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -425,17 +425,17 @@ _unwind___svml_sin2_ha_e9_B7_B11: DD imagerel _B1_7 DD imagerel _B1_12 - DD imagerel _unwind___svml_sin2_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_sin2_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_e9_B12_B12: +_unwind___jsvml_sin2_ha_e9_B12_B12: DD 33 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_sin2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -444,7 +444,7 @@ _unwind___svml_sin2_ha_e9_B12_B12: DD imagerel _B1_12 DD imagerel _B1_13 - DD imagerel _unwind___svml_sin2_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_sin2_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -458,9 +458,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin4_ha_l9 + PUBLIC __jsvml_sin4_ha_l9 -__svml_sin4_ha_l9 PROC EXPORT +__jsvml_sin4_ha_l9 PROC EXPORT _B2_1:: @@ -485,12 +485,12 @@ L44:: vmovups YMMWORD PTR [656+rsp], ymm6 mov QWORD PTR [688+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd ymm2, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + vmovupd ymm2, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 - vmovupd ymm13, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16576] - vmovupd ymm1, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16640] - vmovupd ymm15, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16768] - vmovupd ymm14, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16832] + vmovupd ymm13, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] + vmovupd ymm1, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] + vmovupd ymm15, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] + vmovupd ymm14, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] vmovdqa ymm8, ymm0 vandnpd ymm7, ymm2, ymm8 vandpd ymm2, ymm8, ymm2 @@ -498,11 +498,11 @@ L44:: vsubpd ymm5, ymm13, ymm1 vfnmadd213pd ymm15, ymm5, ymm2 vmovdqa ymm3, ymm14 - vandps ymm1, ymm13, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + vandps ymm1, ymm13, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] vfnmadd213pd ymm3, ymm5, ymm15 vsubpd ymm9, ymm15, ymm3 vfnmadd231pd ymm9, ymm14, ymm5 - vfnmadd132pd ymm5, ymm9, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16896] + vfnmadd132pd ymm5, ymm9, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] mov QWORD PTR [696+rsp], r13 vextracti128 xmm6, ymm1, 1 vmovd r8d, xmm1 @@ -512,26 +512,26 @@ L44:: shl r9d, 5 vpextrd r10d, xmm6, 2 shl ecx, 5 - vmovq xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] shl r10d, 5 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r9] - vmovhpd xmm12, xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm10, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r10] - vmovq xmm13, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] - vmovhpd xmm4, xmm13, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm9, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r10] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r9] + vmovhpd xmm12, xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm10, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r10] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] + vmovhpd xmm4, xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm9, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r10] vinsertf128 ymm15, ymm12, xmm10, 1 - vmovq xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r9] - vmovhpd xmm6, xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r9] + vmovhpd xmm6, xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r10] vinsertf128 ymm6, ymm4, xmm6, 1 vmovdqa ymm0, ymm6 vmovdqa ymm4, ymm15 vinsertf128 ymm14, ymm14, xmm9, 1 vfmadd231pd ymm0, ymm14, ymm3 - vmovupd ymm9, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + vmovupd ymm9, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] vfmadd213pd ymm4, ymm3, ymm0 vsubpd ymm10, ymm6, ymm0 vsubpd ymm1, ymm0, ymm4 @@ -539,31 +539,31 @@ L44:: vmulpd ymm0, ymm3, ymm3 vfmadd231pd ymm1, ymm3, ymm15 vaddpd ymm13, ymm10, ymm1 - vmovupd ymm1, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + vmovupd ymm1, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] vmovdqa ymm12, ymm9 vfmadd231pd ymm12, ymm1, ymm0 vmulpd ymm11, ymm0, ymm12 vmulpd ymm10, ymm3, ymm11 vaddpd ymm11, ymm15, ymm14 - vmovupd ymm14, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17152] - vmovupd ymm15, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17216] + vmovupd ymm14, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] + vmovupd ymm15, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] vfmadd213pd ymm10, ymm11, ymm13 - vmovupd ymm13, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovupd ymm13, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vfnmadd213pd ymm3, ymm6, ymm11 vmovdqa ymm12, ymm14 vfmadd231pd ymm12, ymm15, ymm0 vfmadd213pd ymm12, ymm0, ymm13 vmulpd ymm12, ymm0, ymm12 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] vfmadd213pd ymm12, ymm6, ymm10 - vmovq xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r9] - vmovhpd xmm6, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] - vmovhpd xmm11, xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r10] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r9] + vmovhpd xmm6, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovhpd xmm11, xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r10] vinsertf128 ymm0, ymm6, xmm11, 1 vfmadd213pd ymm5, ymm3, ymm0 vaddpd ymm3, ymm12, ymm5 vaddpd ymm5, ymm4, ymm3 - vcmpnle_uqpd ymm3, ymm2, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + vcmpnle_uqpd ymm3, ymm2, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] vmovmskpd r11d, ymm3 vxorpd ymm0, ymm5, ymm7 test r11d, r11d @@ -628,7 +628,7 @@ _B2_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B2_9 _B2_12:: @@ -637,7 +637,7 @@ _B2_12:: vmovupd YMMWORD PTR [224+r13], ymm8 vmovupd YMMWORD PTR [160+r13], ymm3 vmovupd YMMWORD PTR [64+r13], ymm14 - vmovupd ymm14, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovupd ymm14, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vmovupd YMMWORD PTR [96+r13], ymm13 vmovupd YMMWORD PTR [192+r13], ymm0 vmovupd YMMWORD PTR [32+r13], ymm15 @@ -658,23 +658,23 @@ _B2_12:: shl r9d, 3 vpand ymm8, ymm2, YMMWORD PTR [_2il0floatpacket_55] lea r10d, DWORD PTR [rcx+rcx*2] - vmovq xmm13, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r11] - vmovq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r9] - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r11] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r11] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r9] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r11] shl r10d, 3 lea ecx, DWORD PTR [r8+r8*2] shl ecx, 3 - vmovhpd xmm14, xmm13, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r10] - vmovhpd xmm9, xmm11, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+rcx] + vmovhpd xmm14, xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r10] + vmovhpd xmm9, xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+rcx] vpaddq ymm3, ymm8, YMMWORD PTR [_2il0floatpacket_56] - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r9] - vmovhpd xmm12, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r10] - vmovhpd xmm0, xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+rcx] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r9] + vmovhpd xmm12, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r10] + vmovhpd xmm0, xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+rcx] vpsrlq ymm11, ymm3, 32 - vmovq xmm4, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r11] - vmovq xmm10, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r9] - vmovhpd xmm15, xmm4, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r10] - vmovhpd xmm7, xmm10, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r11] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r9] + vmovhpd xmm15, xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm7, xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+rcx] vinsertf128 ymm13, ymm14, xmm9, 1 vmovdqu ymm14, YMMWORD PTR [_2il0floatpacket_57] vpand ymm8, ymm3, ymm14 @@ -775,19 +775,19 @@ _B2_12:: vpextrd r11d, xmm14, 2 shl ecx, 5 shl r11d, 5 - vmovq xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r10] - vmovhpd xmm13, xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm3, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r11] - vmovq xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] - vmovq xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] - vmovq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r10] - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r10] - vmovhpd xmm8, xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm2, xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm12, xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r11] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r10] + vmovhpd xmm13, xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm3, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r11] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r10] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r10] + vmovhpd xmm8, xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm2, xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm12, xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r11] vinsertf128 ymm13, ymm13, xmm3, 1 - vmovhpd xmm3, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r11] + vmovhpd xmm3, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r11] vmovaps ymm15, ymm13 vinsertf128 ymm14, ymm8, xmm12, 1 vinsertf128 ymm2, ymm2, xmm3, 1 @@ -796,11 +796,11 @@ _B2_12:: vfmadd213pd ymm15, ymm10, ymm5 vsubpd ymm6, ymm2, ymm5 vsubpd ymm0, ymm5, ymm15 - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r10] vfmadd231pd ymm6, ymm14, ymm10 vfmadd231pd ymm0, ymm10, ymm13 vaddpd ymm11, ymm6, ymm0 - vmovhpd xmm6, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm6, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r11] vmulpd ymm0, ymm10, ymm10 vfmadd231pd ymm3, ymm1, ymm0 vmulpd ymm1, ymm0, ymm3 @@ -815,8 +815,8 @@ _B2_12:: vmulpd ymm9, ymm0, ymm13 vmovupd ymm0, YMMWORD PTR [192+r13] vfmadd213pd ymm9, ymm2, ymm3 - vmovq xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] - vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] + vmovhpd xmm4, xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vinsertf128 ymm8, ymm4, xmm6, 1 vfmadd213pd ymm7, ymm10, ymm8 vmovupd ymm8, YMMWORD PTR [224+r13] @@ -829,13 +829,13 @@ _B2_12:: _B2_13:: -__svml_sin4_ha_l9 ENDP +__jsvml_sin4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin4_ha_l9_B1_B4: +_unwind___jsvml_sin4_ha_l9_B1_B4: DD 1603073 DD 5690486 DD 2713710 @@ -857,19 +857,19 @@ _unwind___svml_sin4_ha_l9_B1_B4: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_sin4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_sin4_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin4_ha_l9_B7_B11: +_unwind___jsvml_sin4_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_sin4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_sin4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -878,17 +878,17 @@ _unwind___svml_sin4_ha_l9_B7_B11: DD imagerel _B2_7 DD imagerel _B2_12 - DD imagerel _unwind___svml_sin4_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_sin4_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin4_ha_l9_B12_B12: +_unwind___jsvml_sin4_ha_l9_B12_B12: DD 33 DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_sin4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_sin4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -897,7 +897,7 @@ _unwind___svml_sin4_ha_l9_B12_B12: DD imagerel _B2_12 DD imagerel _B2_13 - DD imagerel _unwind___svml_sin4_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_sin4_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -911,9 +911,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin1_ha_e9 + PUBLIC __jsvml_sin1_ha_e9 -__svml_sin1_ha_e9 PROC EXPORT +__jsvml_sin1_ha_e9 PROC EXPORT _B3_1:: @@ -939,54 +939,54 @@ L87:: vmovups XMMWORD PTR [448+rsp], xmm6 mov QWORD PTR [296+rsp], r13 lea r13, QWORD PTR [223+rsp] - vmovsd xmm1, QWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + vmovsd xmm1, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 vandnpd xmm7, xmm1, xmm8 vandpd xmm1, xmm8, xmm1 - vmulsd xmm2, xmm1, QWORD PTR [__svml_dsin_ha_data_internal_ha+16576] - vmovsd xmm9, QWORD PTR [__svml_dsin_ha_data_internal_ha+16640] - vmovq xmm5, QWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + vmulsd xmm2, xmm1, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] + vmovsd xmm9, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] + vmovq xmm5, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] vaddsd xmm10, xmm2, xmm9 vpand xmm12, xmm10, xmm5 vsubsd xmm3, xmm10, xmm9 vmovd ecx, xmm12 - vmulsd xmm2, xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16768] - vmulsd xmm13, xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16832] - vmulsd xmm6, xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16896] + vmulsd xmm2, xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] + vmulsd xmm13, xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] + vmulsd xmm6, xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] vsubsd xmm14, xmm1, xmm2 shl ecx, 5 vsubsd xmm4, xmm14, xmm13 - vmulsd xmm2, xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmulsd xmm2, xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] vsubsd xmm15, xmm14, xmm4 - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] vsubsd xmm11, xmm15, xmm13 vaddsd xmm9, xmm5, xmm2 vsubsd xmm6, xmm11, xmm6 vsubsd xmm0, xmm5, xmm9 - vmovq xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] vaddsd xmm10, xmm0, xmm2 vmulsd xmm13, xmm15, xmm4 vmulsd xmm0, xmm4, xmm4 vaddsd xmm3, xmm13, xmm9 - vmovsd xmm2, QWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + vmovsd xmm2, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] vsubsd xmm14, xmm9, xmm3 - vmovsd xmm9, QWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + vmovsd xmm9, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] vaddsd xmm11, xmm14, xmm13 vmulsd xmm13, xmm2, xmm0 vaddsd xmm14, xmm11, xmm10 vaddsd xmm12, xmm13, xmm9 - vaddsd xmm10, xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + vaddsd xmm10, xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] vmulsd xmm13, xmm12, xmm0 vmulsd xmm11, xmm13, xmm4 vmulsd xmm4, xmm4, xmm5 vmulsd xmm15, xmm11, xmm10 mov QWORD PTR [464+rsp], r13 vaddsd xmm12, xmm15, xmm14 - vmovsd xmm15, QWORD PTR [__svml_dsin_ha_data_internal_ha+17216] + vmovsd xmm15, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] vmulsd xmm13, xmm15, xmm0 - vmovsd xmm14, QWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + vmovsd xmm14, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] vaddsd xmm11, xmm13, xmm14 - vmovsd xmm13, QWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovsd xmm13, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vmulsd xmm11, xmm11, xmm0 vaddsd xmm11, xmm11, xmm13 vmulsd xmm0, xmm11, xmm0 @@ -994,11 +994,11 @@ L87:: vsubsd xmm0, xmm10, xmm4 vmulsd xmm4, xmm6, xmm0 vaddsd xmm11, xmm11, xmm12 - vaddsd xmm5, xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vaddsd xmm5, xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vaddsd xmm6, xmm11, xmm5 vaddsd xmm3, xmm3, xmm6 vxorpd xmm0, xmm3, xmm7 - vcmpnlesd xmm3, xmm1, QWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + vcmpnlesd xmm3, xmm1, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] vmovmskpd r8d, xmm3 test r8d, 1 jne _B3_8 @@ -1044,7 +1044,7 @@ _B3_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B3_5 _B3_8:: @@ -1055,7 +1055,7 @@ _B3_8:: vmovd ecx, xmm11 vmovupd XMMWORD PTR [64+rsp], xmm14 vmovupd XMMWORD PTR [144+rsp], xmm8 - vmovsd xmm14, QWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovsd xmm14, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vpand xmm8, xmm1, XMMWORD PTR [_2il0floatpacket_37] lea r8d, DWORD PTR [rcx+rcx*2] shl r8d, 3 @@ -1066,14 +1066,14 @@ _B3_8:: vmovmskpd edx, xmm5 vmovupd XMMWORD PTR [80+rsp], xmm13 vpsrlq xmm11, xmm3, 32 - vmovq xmm13, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r8] vmovdqu xmm14, XMMWORD PTR [_2il0floatpacket_39] and edx, 1 vmovupd XMMWORD PTR [112+rsp], xmm0 vpsrlq xmm0, xmm13, 32 vpand xmm8, xmm3, xmm14 vpand xmm13, xmm13, xmm14 - vmovq xmm4, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r8] vmovupd XMMWORD PTR [96+rsp], xmm7 vpsrlq xmm6, xmm4, 32 vpmuludq xmm7, xmm11, xmm13 @@ -1091,7 +1091,7 @@ _B3_8:: vpaddq xmm7, xmm7, xmm13 vpaddq xmm13, xmm15, xmm7 vpmuludq xmm15, xmm11, xmm4 - vmovq xmm12, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r8] vpsrlq xmm4, xmm3, 32 vpand xmm9, xmm12, xmm14 vpand xmm7, xmm5, xmm14 @@ -1173,10 +1173,10 @@ _B3_8:: vmovd r9d, xmm1 vmulsd xmm1, xmm10, xmm10 shl r9d, 5 - vmulsd xmm3, xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] + vmulsd xmm3, xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] vmulsd xmm2, xmm2, xmm1 - vmovq xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r9] - vmovq xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r9] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r9] vmulsd xmm6, xmm15, xmm10 vaddsd xmm4, xmm14, xmm3 vaddsd xmm2, xmm2, QWORD PTR [32+rsp] @@ -1185,7 +1185,7 @@ _B3_8:: vsubsd xmm5, xmm4, xmm13 vaddsd xmm9, xmm0, xmm3 vmulsd xmm0, xmm2, xmm1 - vaddsd xmm2, xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] + vaddsd xmm2, xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] vaddsd xmm8, xmm5, xmm6 vmulsd xmm3, xmm0, xmm10 vmulsd xmm10, xmm10, xmm14 @@ -1204,7 +1204,7 @@ _B3_8:: vaddsd xmm3, xmm12, xmm0 vmovupd xmm1, XMMWORD PTR [128+rsp] vmovupd xmm0, XMMWORD PTR [112+rsp] - vaddsd xmm6, xmm7, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r9] + vaddsd xmm6, xmm7, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r9] vaddsd xmm8, xmm3, xmm6 vaddsd xmm9, xmm13, xmm8 vmovupd xmm8, XMMWORD PTR [144+rsp] @@ -1215,13 +1215,13 @@ _B3_8:: _B3_9:: -__svml_sin1_ha_e9 ENDP +__jsvml_sin1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin1_ha_e9_B1_B8: +_unwind___jsvml_sin1_ha_e9_B1_B8: DD 1604097 DD 2479226 DD 1861746 @@ -1243,7 +1243,7 @@ _unwind___svml_sin1_ha_e9_B1_B8: DD imagerel _B3_1 DD imagerel _B3_9 - DD imagerel _unwind___svml_sin1_ha_e9_B1_B8 + DD imagerel _unwind___jsvml_sin1_ha_e9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1257,9 +1257,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin4_ha_e9 + PUBLIC __jsvml_sin4_ha_e9 -__svml_sin4_ha_e9 PROC EXPORT +__jsvml_sin4_ha_e9 PROC EXPORT _B4_1:: @@ -1286,19 +1286,19 @@ L126:: vmovups YMMWORD PTR [848+rbp], ymm6 mov QWORD PTR [880+rbp], r13 lea r13, QWORD PTR [79+rbp] - vmovupd ymm8, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + vmovupd ymm8, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 - vmovupd ymm7, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16640] + vmovupd ymm7, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] vmovapd ymm10, ymm0 vandnpd ymm9, ymm8, ymm10 vandpd ymm8, ymm10, ymm8 - vmulpd ymm6, ymm8, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16576] + vmulpd ymm6, ymm8, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] vaddpd ymm3, ymm7, ymm6 - vmovupd xmm6, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + vmovupd xmm6, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] vsubpd ymm15, ymm3, ymm7 - vmulpd ymm11, ymm15, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16768] - vmulpd ymm5, ymm15, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16832] - vmulpd ymm14, ymm15, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16896] + vmulpd ymm11, ymm15, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] + vmulpd ymm5, ymm15, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] + vmulpd ymm14, ymm15, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] vsubpd ymm12, ymm8, ymm11 vsubpd ymm2, ymm12, ymm5 vsubpd ymm13, ymm12, ymm2 @@ -1315,19 +1315,19 @@ L126:: shl r9d, 5 vpextrd r10d, xmm13, 2 shl ecx, 5 - vmovq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] - vmovq xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] shl r10d, 5 - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r9] - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] - vmovhpd xmm12, xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm15, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r10] - vmovhpd xmm0, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r10] - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r9] - vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm5, xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] + vmovhpd xmm12, xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm15, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r10] + vmovhpd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r10] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r9] + vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm5, xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r10] vinsertf128 ymm13, ymm12, xmm15, 1 vinsertf128 ymm12, ymm3, xmm0, 1 vmulpd ymm15, ymm12, ymm2 @@ -1341,9 +1341,9 @@ L126:: vaddpd ymm3, ymm13, ymm12 vaddpd ymm11, ymm0, ymm6 vmulpd ymm0, ymm2, ymm2 - vmovupd ymm6, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + vmovupd ymm6, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] vaddpd ymm11, ymm7, ymm11 - vmovupd ymm7, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + vmovupd ymm7, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] vmulpd ymm15, ymm7, ymm0 vaddpd ymm14, ymm6, ymm15 vmulpd ymm15, ymm0, ymm14 @@ -1351,24 +1351,24 @@ L126:: vmulpd ymm2, ymm1, ymm2 vmulpd ymm12, ymm14, ymm3 vaddpd ymm15, ymm11, ymm12 - vmovupd ymm11, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17216] - vmovupd ymm12, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + vmovupd ymm11, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] + vmovupd ymm12, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] vmulpd ymm13, ymm11, ymm0 vaddpd ymm14, ymm12, ymm13 - vmovupd ymm13, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovupd ymm13, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vmulpd ymm14, ymm0, ymm14 vaddpd ymm14, ymm13, ymm14 vmulpd ymm0, ymm0, ymm14 vmulpd ymm14, ymm1, ymm0 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] - vmovhpd xmm1, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] + vmovhpd xmm1, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vaddpd ymm15, ymm15, ymm14 vsubpd ymm14, ymm3, ymm2 - vmovq xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r9] - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r10] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r9] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r10] vmulpd ymm4, ymm4, ymm14 vinsertf128 ymm0, ymm1, xmm3, 1 - vcmpnle_uqpd ymm1, ymm8, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + vcmpnle_uqpd ymm1, ymm8, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] vaddpd ymm14, ymm0, ymm4 vaddpd ymm15, ymm15, ymm14 vaddpd ymm5, ymm5, ymm15 @@ -1439,12 +1439,12 @@ _B4_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B4_9 _B4_12:: - vmovupd ymm14, YMMWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovupd ymm14, YMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vmovupd YMMWORD PTR [32+r13], ymm7 vmovdqu xmm7, XMMWORD PTR [_2il0floatpacket_36] vmovupd YMMWORD PTR [r13], ymm8 @@ -1475,33 +1475,33 @@ _B4_12:: vpextrd r8d, xmm0, 2 lea r9d, DWORD PTR [r9+r9*2] shl r9d, 3 - vmovq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r9] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r9] vmovdqu xmm7, XMMWORD PTR [_2il0floatpacket_38] lea r10d, DWORD PTR [rcx+rcx*2] shl r11d, 3 lea ecx, DWORD PTR [r8+r8*2] shl ecx, 3 - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r9] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r9] shl r10d, 3 - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r11] - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r11] - vmovq xmm14, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r11] - vmovhpd xmm4, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r10] - vmovq xmm12, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r9] - vmovhpd xmm3, xmm12, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r11] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r11] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r11] + vmovhpd xmm4, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r9] + vmovhpd xmm3, xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+rcx] vmovupd XMMWORD PTR [416+rbp], xmm4 vextractf128 xmm2, ymm9, 1 vshufps xmm10, xmm9, xmm2, 221 vmovmskps edx, xmm10 - vmovhpd xmm10, xmm11, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+rcx] + vmovhpd xmm10, xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+rcx] vpaddq xmm11, xmm8, xmm7 vpaddq xmm7, xmm13, xmm7 - vmovhpd xmm9, xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+rcx] + vmovhpd xmm9, xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+rcx] vmovdqu xmm13, XMMWORD PTR [_2il0floatpacket_39] vpsrlq xmm5, xmm9, 32 - vmovhpd xmm2, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm2, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r10] vpand xmm0, xmm9, xmm13 - vmovhpd xmm1, xmm14, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r10] + vmovhpd xmm1, xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r10] vpand xmm14, xmm10, xmm13 vpsrlq xmm9, xmm11, 32 vpand xmm8, xmm11, xmm13 @@ -1683,29 +1683,29 @@ _B4_12:: vaddpd ymm3, ymm15, ymm8 vaddpd ymm12, ymm7, ymm4 vaddpd ymm1, ymm3, ymm12 - vmovq xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r10] vaddpd ymm2, ymm0, ymm1 vandpd ymm6, ymm9, YMMWORD PTR [_2il0floatpacket_68] vsubpd ymm5, ymm0, ymm2 vcmple_oqpd ymm14, ymm6, ymm11 vcmpgt_oqpd ymm7, ymm6, ymm11 vaddpd ymm4, ymm1, ymm5 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] - vmovhpd xmm13, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] + vmovhpd xmm13, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] vandpd ymm15, ymm14, ymm9 - vmovq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r10] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r10] vandpd ymm8, ymm7, ymm2 - vmovhpd xmm10, xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r11] - vmovq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] + vmovhpd xmm10, xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r11] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] vorpd ymm15, ymm15, ymm8 - vmovq xmm8, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r10] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r10] vandpd ymm2, ymm7, ymm4 - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] - vmovhpd xmm1, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] - vmovhpd xmm5, xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r11] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] + vmovhpd xmm1, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovhpd xmm5, xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r11] vinsertf128 ymm7, ymm13, xmm10, 1 - vmovhpd xmm10, xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r11] + vmovhpd xmm10, xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r11] vmulpd ymm14, ymm15, ymm7 vinsertf128 ymm4, ymm10, xmm13, 1 vmulpd ymm6, ymm15, ymm4 @@ -1733,13 +1733,13 @@ _B4_12:: vmulpd ymm13, ymm13, ymm7 vaddpd ymm0, ymm11, ymm4 vmulpd ymm1, ymm8, ymm13 - vmovq xmm8, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] vaddpd ymm4, ymm0, ymm1 vsubpd ymm1, ymm10, ymm15 - vmovq xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r10] - vmovhpd xmm10, xmm8, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r10] + vmovhpd xmm10, xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vmulpd ymm2, ymm2, ymm1 - vmovhpd xmm0, xmm15, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm0, xmm15, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r11] vinsertf128 ymm3, ymm10, xmm0, 1 vaddpd ymm0, ymm3, ymm2 vmovupd ymm10, YMMWORD PTR [288+r13] @@ -1753,13 +1753,13 @@ _B4_12:: _B4_13:: -__svml_sin4_ha_e9 ENDP +__jsvml_sin4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin4_ha_e9_B1_B4: +_unwind___jsvml_sin4_ha_e9_B1_B4: DD 622489857 DD 7525489 DD 3631210 @@ -1782,19 +1782,19 @@ _unwind___svml_sin4_ha_e9_B1_B4: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_sin4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_sin4_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin4_ha_e9_B7_B11: +_unwind___jsvml_sin4_ha_e9_B7_B11: DD 621022241 DD 287756 DD 340998 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_sin4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_sin4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1803,17 +1803,17 @@ _unwind___svml_sin4_ha_e9_B7_B11: DD imagerel _B4_7 DD imagerel _B4_12 - DD imagerel _unwind___svml_sin4_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_sin4_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin4_ha_e9_B12_B12: +_unwind___jsvml_sin4_ha_e9_B12_B12: DD 620757025 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_sin4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_sin4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1822,7 +1822,7 @@ _unwind___svml_sin4_ha_e9_B12_B12: DD imagerel _B4_12 DD imagerel _B4_13 - DD imagerel _unwind___svml_sin4_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_sin4_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1836,9 +1836,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin1_ha_ex + PUBLIC __jsvml_sin1_ha_ex -__svml_sin1_ha_ex PROC EXPORT +__jsvml_sin1_ha_ex PROC EXPORT _B5_1:: @@ -1864,16 +1864,16 @@ L195:: movups XMMWORD PTR [304+rsp], xmm6 mov QWORD PTR [296+rsp], r13 lea r13, QWORD PTR [223+rsp] - movsd xmm2, QWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + movsd xmm2, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 movaps xmm13, xmm2 andps xmm2, xmm14 movaps xmm9, xmm2 movaps xmm12, xmm2 - mulsd xmm9, QWORD PTR [__svml_dsin_ha_data_internal_ha+16576] + mulsd xmm9, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] andnps xmm13, xmm14 - movsd xmm1, QWORD PTR [__svml_dsin_ha_data_internal_ha+16640] - movq xmm0, QWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + movsd xmm1, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] + movq xmm0, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] addsd xmm9, xmm1 movaps xmm5, xmm9 pand xmm9, xmm0 @@ -1881,28 +1881,28 @@ L195:: subsd xmm5, xmm1 movaps xmm3, xmm5 movaps xmm4, xmm5 - mulsd xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16768] - mulsd xmm4, QWORD PTR [__svml_dsin_ha_data_internal_ha+16832] - mulsd xmm5, QWORD PTR [__svml_dsin_ha_data_internal_ha+16896] + mulsd xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] + mulsd xmm4, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] + mulsd xmm5, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] subsd xmm12, xmm3 movaps xmm11, xmm12 shl ecx, 5 subsd xmm11, xmm4 movaps xmm1, xmm11 subsd xmm12, xmm11 - mulsd xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + mulsd xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] subsd xmm12, xmm4 - movq xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] + movq xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] subsd xmm12, xmm5 - movq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + movq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] movdqa xmm6, xmm10 mulsd xmm6, xmm11 movdqa xmm3, xmm9 addsd xmm3, xmm1 - addsd xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + addsd xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] movaps xmm0, xmm6 movdqa xmm7, xmm9 - movsd xmm8, QWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + movsd xmm8, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] addsd xmm0, xmm3 subsd xmm7, xmm3 subsd xmm3, xmm0 @@ -1911,10 +1911,10 @@ L195:: movaps xmm6, xmm11 addsd xmm3, xmm7 mulsd xmm6, xmm11 - movsd xmm1, QWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + movsd xmm1, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] movaps xmm7, xmm1 mulsd xmm7, xmm6 - movsd xmm5, QWORD PTR [__svml_dsin_ha_data_internal_ha+17216] + movsd xmm5, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] addsd xmm7, xmm8 mulsd xmm7, xmm6 movaps xmm15, xmm5 @@ -1925,16 +1925,16 @@ L195:: subsd xmm10, xmm11 addsd xmm7, xmm3 mulsd xmm12, xmm10 - movsd xmm4, QWORD PTR [__svml_dsin_ha_data_internal_ha+17152] - movsd xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + movsd xmm4, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] + movsd xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] addsd xmm15, xmm4 - addsd xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + addsd xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] mulsd xmm15, xmm6 mov QWORD PTR [464+rsp], r13 addsd xmm15, xmm3 mulsd xmm15, xmm6 movaps xmm6, xmm2 - cmpnlesd xmm6, QWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + cmpnlesd xmm6, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] mulsd xmm15, xmm9 movmskpd r8d, xmm6 addsd xmm15, xmm7 @@ -1985,7 +1985,7 @@ _B5_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B5_5 _B5_8:: @@ -1998,7 +1998,7 @@ _B5_8:: movups XMMWORD PTR [128+rsp], xmm0 movups XMMWORD PTR [112+rsp], xmm6 movaps xmm6, xmm2 - movsd xmm0, QWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + movsd xmm0, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] movups XMMWORD PTR [48+rsp], xmm5 andps xmm6, xmm0 movdqu xmm5, XMMWORD PTR [_2il0floatpacket_37] @@ -2012,7 +2012,7 @@ _B5_8:: movdqa xmm4, xmm5 shl r8d, 3 psrlq xmm4, 32 - movq xmm13, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r8] + movq xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r8] movdqa xmm6, xmm4 movups XMMWORD PTR [144+rsp], xmm14 movdqa xmm0, xmm13 @@ -2020,7 +2020,7 @@ _B5_8:: psrlq xmm0, 32 pand xmm5, xmm14 pand xmm13, xmm14 - movq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r8] + movq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r8] movdqa xmm9, xmm5 pmuludq xmm6, xmm0 movdqa xmm12, xmm11 @@ -2038,7 +2038,7 @@ _B5_8:: pand xmm8, xmm9 pmuludq xmm12, xmm4 paddq xmm8, xmm6 - movq xmm7, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r8] + movq xmm7, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r8] movdqa xmm15, xmm14 psrlq xmm13, 32 psrlq xmm9, 32 @@ -2149,16 +2149,16 @@ _B5_8:: shl r9d, 5 movaps xmm2, xmm3 movaps xmm7, xmm3 - mulsd xmm2, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] + mulsd xmm2, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] mulsd xmm7, xmm3 - movq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r9] - movq xmm8, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r9] + movq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r9] + movq xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r9] movdqa xmm0, xmm9 mulsd xmm0, xmm3 movdqa xmm6, xmm8 addsd xmm6, xmm2 mulsd xmm1, xmm7 - addsd xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] + addsd xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] movups xmm10, XMMWORD PTR [48+rsp] movaps xmm11, xmm0 mulsd xmm10, xmm7 @@ -2182,7 +2182,7 @@ _B5_8:: mulsd xmm4, xmm9 mulsd xmm10, xmm8 addsd xmm1, xmm6 - addsd xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r9] + addsd xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r9] addsd xmm10, xmm1 movups xmm1, XMMWORD PTR [112+rsp] addsd xmm10, xmm4 @@ -2198,13 +2198,13 @@ _B5_8:: _B5_9:: -__svml_sin1_ha_ex ENDP +__jsvml_sin1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin1_ha_ex_B1_B8: +_unwind___jsvml_sin1_ha_ex_B1_B8: DD 1603585 DD 2479224 DD 1271920 @@ -2226,7 +2226,7 @@ _unwind___svml_sin1_ha_ex_B1_B8: DD imagerel _B5_1 DD imagerel _B5_9 - DD imagerel _unwind___svml_sin1_ha_ex_B1_B8 + DD imagerel _unwind___jsvml_sin1_ha_ex_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2240,9 +2240,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin2_ha_l9 + PUBLIC __jsvml_sin2_ha_l9 -__svml_sin2_ha_l9 PROC EXPORT +__jsvml_sin2_ha_l9 PROC EXPORT _B6_1:: @@ -2268,19 +2268,19 @@ L234:: vmovups XMMWORD PTR [448+rsp], xmm6 mov QWORD PTR [464+rsp], r13 lea r13, QWORD PTR [223+rsp] - vmovupd xmm1, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + vmovupd xmm1, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 - vmovupd xmm13, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16576] + vmovupd xmm13, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] vandnpd xmm7, xmm1, xmm8 - vmovupd xmm2, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16640] + vmovupd xmm2, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] vandpd xmm1, xmm8, xmm1 vfmadd213pd xmm13, xmm1, xmm2 - vmovupd xmm15, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16768] - vmovupd xmm14, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16832] + vmovupd xmm15, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] + vmovupd xmm14, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] vsubpd xmm6, xmm13, xmm2 vfnmadd213pd xmm15, xmm6, xmm1 vmovapd xmm3, xmm6 - vandps xmm2, xmm13, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + vandps xmm2, xmm13, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] vmovd ecx, xmm2 vfnmadd213pd xmm3, xmm14, xmm15 vsubpd xmm9, xmm15, xmm3 @@ -2288,17 +2288,17 @@ L234:: vmovapd xmm0, xmm3 vpextrd r8d, xmm2, 2 shl r8d, 5 - vmovq xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] vfnmadd231pd xmm9, xmm14, xmm6 - vmovhpd xmm14, xmm12, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] - vmovhpd xmm5, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] - vmovq xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm15, xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] + vmovhpd xmm14, xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] + vmovhpd xmm5, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm15, xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] vfmadd213pd xmm0, xmm14, xmm5 - vfnmadd132pd xmm6, xmm9, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16896] - vmovupd xmm9, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16960] - vmovupd xmm2, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + vfnmadd132pd xmm6, xmm9, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] + vmovupd xmm9, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] + vmovupd xmm2, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] vmovapd xmm4, xmm0 vfmadd231pd xmm4, xmm3, xmm15 vsubpd xmm10, xmm5, xmm0 @@ -2313,21 +2313,21 @@ L234:: vmulpd xmm10, xmm0, xmm12 vmulpd xmm10, xmm3, xmm10 vfnmadd213pd xmm3, xmm5, xmm11 - vmovupd xmm15, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17216] + vmovupd xmm15, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] vmovapd xmm12, xmm0 - vmovupd xmm14, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + vmovupd xmm14, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] vfmadd213pd xmm12, xmm15, xmm14 vfmadd213pd xmm10, xmm11, xmm13 - vmovupd xmm13, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovupd xmm13, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vfmadd213pd xmm12, xmm0, xmm13 vmulpd xmm12, xmm0, xmm12 vfmadd213pd xmm12, xmm5, xmm10 - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] - vmovhpd xmm0, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovhpd xmm0, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] vfmadd213pd xmm6, xmm3, xmm0 vaddpd xmm3, xmm12, xmm6 vaddpd xmm0, xmm4, xmm3 - vcmpnlepd xmm3, xmm1, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + vcmpnlepd xmm3, xmm1, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] vmovmskpd r9d, xmm3 vxorpd xmm0, xmm0, xmm7 mov QWORD PTR [472+rsp], r13 @@ -2392,7 +2392,7 @@ _B6_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B6_9 _B6_12:: @@ -2401,7 +2401,7 @@ _B6_12:: vpsrlq xmm12, xmm11, 52 vmovd ecx, xmm12 vmovupd XMMWORD PTR [32+rsp], xmm9 - vmovupd xmm9, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovupd xmm9, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vpextrd r9d, xmm12, 2 vpand xmm4, xmm1, XMMWORD PTR [_2il0floatpacket_37] lea r8d, DWORD PTR [rcx+rcx*2] @@ -2411,23 +2411,23 @@ _B6_12:: lea r10d, DWORD PTR [r9+r9*2] shl r10d, 3 vandpd xmm14, xmm9, xmm1 - vmovq xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r8] vpaddq xmm15, xmm4, XMMWORD PTR [_2il0floatpacket_38] vcmpeqpd xmm10, xmm14, xmm9 vmovupd XMMWORD PTR [96+rsp], xmm7 vpsrlq xmm11, xmm15, 32 vmovupd XMMWORD PTR [144+rsp], xmm8 - vmovq xmm8, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r8] - vmovhpd xmm7, xmm5, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r10] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r8] + vmovhpd xmm7, xmm5, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r10] vmovdqu xmm14, XMMWORD PTR [_2il0floatpacket_39] - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r8] vmovupd XMMWORD PTR [128+rsp], xmm0 vpsrlq xmm0, xmm7, 32 - vmovhpd xmm12, xmm8, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r10] + vmovhpd xmm12, xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r10] vpand xmm8, xmm15, xmm14 vmovupd XMMWORD PTR [112+rsp], xmm3 vpand xmm9, xmm12, xmm14 - vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r10] vpsrlq xmm12, xmm12, 32 vmovupd XMMWORD PTR [80+rsp], xmm13 vpand xmm13, xmm7, xmm14 @@ -2518,13 +2518,13 @@ _B6_12:: vmovapd xmm9, xmm7 shl ecx, 5 vmovapd xmm15, xmm7 - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r11] - vmovq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r11] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r11] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r11] vfmadd213pd xmm8, xmm13, xmm3 - vmovq xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r11] - vmovhpd xmm14, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovhpd xmm1, xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r11] + vmovhpd xmm14, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovhpd xmm1, xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] vfmadd213pd xmm9, xmm0, xmm1 vandpd xmm13, xmm6, xmm8 vmulpd xmm5, xmm7, xmm7 @@ -2547,8 +2547,8 @@ _B6_12:: vfmadd213pd xmm14, xmm5, XMMWORD PTR [80+rsp] vmulpd xmm8, xmm5, xmm14 vfmadd213pd xmm8, xmm1, xmm3 - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r11] - vmovhpd xmm6, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r11] + vmovhpd xmm6, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vfmadd213pd xmm13, xmm7, xmm6 vaddpd xmm7, xmm8, xmm13 vaddpd xmm9, xmm15, xmm7 @@ -2560,13 +2560,13 @@ _B6_12:: _B6_13:: -__svml_sin2_ha_l9 ENDP +__jsvml_sin2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_l9_B1_B4: +_unwind___jsvml_sin2_ha_l9_B1_B4: DD 1604097 DD 3855482 DD 1861746 @@ -2588,19 +2588,19 @@ _unwind___svml_sin2_ha_l9_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_sin2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_l9_B7_B11: +_unwind___jsvml_sin2_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_sin2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2609,17 +2609,17 @@ _unwind___svml_sin2_ha_l9_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_sin2_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_sin2_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_l9_B12_B12: +_unwind___jsvml_sin2_ha_l9_B12_B12: DD 33 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_sin2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2628,7 +2628,7 @@ _unwind___svml_sin2_ha_l9_B12_B12: DD imagerel _B6_12 DD imagerel _B6_13 - DD imagerel _unwind___svml_sin2_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_sin2_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2642,9 +2642,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin1_ha_l9 + PUBLIC __jsvml_sin1_ha_l9 -__svml_sin1_ha_l9 PROC EXPORT +__jsvml_sin1_ha_l9 PROC EXPORT _B7_1:: @@ -2670,30 +2670,30 @@ L277:: vmovups XMMWORD PTR [448+rsp], xmm6 mov QWORD PTR [296+rsp], r13 lea r13, QWORD PTR [223+rsp] - vmovsd xmm2, QWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + vmovsd xmm2, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 vandpd xmm13, xmm11, xmm2 vandnpd xmm12, xmm2, xmm11 - vmovsd xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16640] + vmovsd xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] vmovapd xmm8, xmm13 - vfmadd132sd xmm8, xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16576] - vmovsd xmm6, QWORD PTR [__svml_dsin_ha_data_internal_ha+16832] + vfmadd132sd xmm8, xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] + vmovsd xmm6, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] mov QWORD PTR [464+rsp], r13 vsubsd xmm9, xmm8, xmm3 vmovapd xmm1, xmm9 vmovapd xmm10, xmm9 - vfnmadd132sd xmm1, xmm13, QWORD PTR [__svml_dsin_ha_data_internal_ha+16768] + vfnmadd132sd xmm1, xmm13, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] vmovapd xmm2, xmm9 - vmovq xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + vmovq xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] vpand xmm7, xmm8, xmm3 vmovd ecx, xmm7 vfnmadd213sd xmm10, xmm6, xmm1 shl ecx, 5 vmovapd xmm4, xmm10 - vmovq xmm7, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] vsubsd xmm14, xmm1, xmm10 - vfmadd132sd xmm4, xmm7, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] + vfmadd132sd xmm4, xmm7, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] vmovdqa xmm8, xmm1 vmovdqa xmm15, xmm1 vfmadd213sd xmm8, xmm10, xmm4 @@ -2701,33 +2701,33 @@ L277:: vfnmadd213sd xmm2, xmm6, xmm14 vmovapd xmm6, xmm10 vsubsd xmm5, xmm4, xmm8 - vfmadd132sd xmm6, xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] - vfnmadd132sd xmm9, xmm2, QWORD PTR [__svml_dsin_ha_data_internal_ha+16896] - vaddsd xmm0, xmm1, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + vfmadd132sd xmm6, xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] + vfnmadd132sd xmm9, xmm2, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] + vaddsd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] vfmadd213sd xmm15, xmm10, xmm5 vmulsd xmm5, xmm10, xmm10 vaddsd xmm15, xmm15, xmm6 - vmovsd xmm14, QWORD PTR [__svml_dsin_ha_data_internal_ha+17024] - vmovsd xmm6, QWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + vmovsd xmm14, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] + vmovsd xmm6, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] vmovapd xmm2, xmm14 vfmadd213sd xmm2, xmm5, xmm6 - vmovsd xmm1, QWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovsd xmm1, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vmulsd xmm3, xmm2, xmm5 vmulsd xmm4, xmm3, xmm10 vfnmadd213sd xmm10, xmm7, xmm0 - vmovsd xmm3, QWORD PTR [__svml_dsin_ha_data_internal_ha+17216] - vmovsd xmm2, QWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + vmovsd xmm3, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] + vmovsd xmm2, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] vfmadd213sd xmm4, xmm0, xmm15 vmovapd xmm15, xmm3 vfmadd213sd xmm15, xmm5, xmm2 - vfmadd213sd xmm9, xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + vfmadd213sd xmm9, xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] vfmadd213sd xmm15, xmm5, xmm1 vmulsd xmm5, xmm15, xmm5 vfmadd213sd xmm5, xmm7, xmm4 vaddsd xmm0, xmm5, xmm9 vaddsd xmm4, xmm8, xmm0 vxorpd xmm0, xmm4, xmm12 - vcmpnlesd xmm4, xmm13, QWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + vcmpnlesd xmm4, xmm13, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] vmovmskpd r8d, xmm4 test r8d, 1 jne _B7_8 @@ -2773,7 +2773,7 @@ _B7_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B7_5 _B7_8:: @@ -2781,7 +2781,7 @@ _B7_8:: vmovupd XMMWORD PTR [96+rsp], xmm12 vpand xmm12, xmm13, XMMWORD PTR [_2il0floatpacket_36] vpsrlq xmm9, xmm12, 52 - vmovsd xmm15, QWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovsd xmm15, QWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vmovd ecx, xmm9 vandpd xmm10, xmm15, xmm13 vmovupd XMMWORD PTR [144+rsp], xmm11 @@ -2794,8 +2794,8 @@ _B7_8:: vmovmskpd edx, xmm11 vmovupd XMMWORD PTR [32+rsp], xmm6 vpsrlq xmm9, xmm3, 32 - vmovq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r8] and edx, 1 vmovdqu xmm12, XMMWORD PTR [_2il0floatpacket_39] vmovupd XMMWORD PTR [64+rsp], xmm2 @@ -2824,7 +2824,7 @@ _B7_8:: vpaddq xmm5, xmm2, xmm1 vpand xmm0, xmm3, xmm12 vpsrlq xmm15, xmm11, 32 - vmovq xmm10, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r8] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r8] vpand xmm11, xmm11, xmm12 vpaddq xmm2, xmm0, xmm5 vpand xmm7, xmm10, xmm12 @@ -2895,16 +2895,16 @@ _B7_8:: vmulsd xmm5, xmm11, xmm11 shl r9d, 5 vandpd xmm12, xmm4, xmm6 - vmovq xmm13, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r9] - vfmadd132sd xmm0, xmm13, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] - vmovq xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r9] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r9] + vfmadd132sd xmm0, xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r9] vmovdqa xmm15, xmm3 vmovdqa xmm1, xmm3 vfmadd213sd xmm14, xmm5, QWORD PTR [32+rsp] vfmadd213sd xmm15, xmm11, xmm0 vsubsd xmm9, xmm13, xmm0 vmulsd xmm14, xmm14, xmm5 - vfmadd132sd xmm2, xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] + vfmadd132sd xmm2, xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] vsubsd xmm9, xmm0, xmm15 vmovupd xmm0, XMMWORD PTR [48+rsp] vfmadd213sd xmm0, xmm5, QWORD PTR [64+rsp] @@ -2912,13 +2912,13 @@ _B7_8:: vfmadd213sd xmm0, xmm5, QWORD PTR [80+rsp] vaddsd xmm4, xmm1, xmm2 vmulsd xmm1, xmm14, xmm11 - vaddsd xmm2, xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r9] + vaddsd xmm2, xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r9] vmulsd xmm6, xmm0, xmm5 vfmadd213sd xmm1, xmm2, xmm4 vfnmadd213sd xmm11, xmm13, xmm2 vmovupd xmm0, XMMWORD PTR [112+rsp] vfmadd213sd xmm6, xmm13, xmm1 - vfmadd213sd xmm12, xmm11, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r9] + vfmadd213sd xmm12, xmm11, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r9] vmovupd xmm11, XMMWORD PTR [144+rsp] vaddsd xmm7, xmm6, xmm12 vaddsd xmm8, xmm15, xmm7 @@ -2929,13 +2929,13 @@ _B7_8:: _B7_9:: -__svml_sin1_ha_l9 ENDP +__jsvml_sin1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin1_ha_l9_B1_B8: +_unwind___jsvml_sin1_ha_l9_B1_B8: DD 1604097 DD 2479226 DD 1861746 @@ -2957,7 +2957,7 @@ _unwind___svml_sin1_ha_l9_B1_B8: DD imagerel _B7_1 DD imagerel _B7_9 - DD imagerel _unwind___svml_sin1_ha_l9_B1_B8 + DD imagerel _unwind___jsvml_sin1_ha_l9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2971,9 +2971,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin2_ha_ex + PUBLIC __jsvml_sin2_ha_ex -__svml_sin2_ha_ex PROC EXPORT +__jsvml_sin2_ha_ex PROC EXPORT _B8_1:: @@ -2999,25 +2999,25 @@ L316:: movups XMMWORD PTR [448+rsp], xmm6 mov QWORD PTR [464+rsp], r13 lea r13, QWORD PTR [223+rsp] - movups xmm1, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16384] + movups xmm1, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16384] and r13, -64 - movups xmm3, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16576] + movups xmm3, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16576] movaps xmm13, xmm1 andps xmm1, xmm14 andnps xmm13, xmm14 mulpd xmm3, xmm1 - movups xmm2, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16640] + movups xmm2, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16640] movaps xmm12, xmm1 addpd xmm3, xmm2 movaps xmm10, xmm3 subpd xmm10, xmm2 - movups xmm4, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16768] + movups xmm4, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16768] mulpd xmm4, xmm10 - movups xmm5, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16832] + movups xmm5, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16832] mulpd xmm5, xmm10 subpd xmm12, xmm4 movaps xmm11, xmm12 - andps xmm3, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16704] + andps xmm3, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16704] subpd xmm11, xmm5 pextrw r8d, xmm3, 4 movd ecx, xmm3 @@ -3026,19 +3026,19 @@ L316:: movaps xmm8, xmm11 shl r8d, 5 movaps xmm4, xmm11 - movq xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] movaps xmm6, xmm11 - movhpd xmm3, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r8] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r8] mulpd xmm8, xmm3 subpd xmm12, xmm5 mulpd xmm6, xmm11 - movq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] - movups xmm0, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16896] - movhpd xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r8] + movq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] + movups xmm0, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16896] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r8] mulpd xmm0, xmm10 - movq xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] + movq xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] movaps xmm7, xmm9 - movhpd xmm10, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r8] + movhpd xmm10, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r8] movaps xmm2, xmm9 addpd xmm7, xmm8 subpd xmm12, xmm0 @@ -3048,25 +3048,25 @@ L316:: addpd xmm8, xmm2 movaps xmm0, xmm7 addpd xmm0, xmm4 - movups xmm2, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + movups xmm2, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] movaps xmm15, xmm2 mulpd xmm15, xmm6 subpd xmm7, xmm0 addpd xmm4, xmm7 - movups xmm7, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + movups xmm7, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] addpd xmm15, xmm7 addpd xmm8, xmm4 mulpd xmm15, xmm6 mulpd xmm15, xmm11 mulpd xmm15, xmm10 - movups xmm5, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17216] + movups xmm5, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] addpd xmm8, xmm15 movaps xmm15, xmm5 mulpd xmm15, xmm6 - movups xmm4, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + movups xmm4, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] addpd xmm15, xmm4 mulpd xmm15, xmm6 - movups xmm3, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + movups xmm3, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] addpd xmm15, xmm3 mulpd xmm6, xmm15 mulpd xmm6, xmm9 @@ -3074,11 +3074,11 @@ L316:: addpd xmm8, xmm6 subpd xmm10, xmm9 mulpd xmm12, xmm10 - movq xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + movq xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] movaps xmm6, xmm1 - movhpd xmm9, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r8] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r8] addpd xmm9, xmm12 - cmpnlepd xmm6, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16448] + cmpnlepd xmm6, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16448] addpd xmm8, xmm9 movmskpd r9d, xmm6 addpd xmm0, xmm8 @@ -3148,7 +3148,7 @@ _B8_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B8_9 _B8_12:: @@ -3158,7 +3158,7 @@ _B8_12:: psrlq xmm9, 52 movd ecx, xmm9 movups XMMWORD PTR [32+rsp], xmm7 - movups xmm7, XMMWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + movups xmm7, XMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] pextrw r9d, xmm9, 4 movups XMMWORD PTR [128+rsp], xmm0 movaps xmm0, xmm7 @@ -3173,19 +3173,19 @@ _B8_12:: paddq xmm6, XMMWORD PTR [_2il0floatpacket_38] movmskpd edx, xmm0 movups XMMWORD PTR [144+rsp], xmm14 - movq xmm14, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r8] + movq xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r8] shl r10d, 3 movups XMMWORD PTR [64+rsp], xmm4 movdqa xmm4, xmm6 - movhpd xmm14, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+rax+r10] + movhpd xmm14, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+rax+r10] psrlq xmm4, 32 movdqu xmm15, XMMWORD PTR [_2il0floatpacket_39] movaps xmm7, xmm14 - movq xmm12, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r8] + movq xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r8] psrlq xmm7, 32 pand xmm6, xmm15 movdqa xmm0, xmm4 - movhpd xmm12, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rax+r10] + movhpd xmm12, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rax+r10] movdqa xmm10, xmm6 pmuludq xmm0, xmm7 pand xmm14, xmm15 @@ -3205,11 +3205,11 @@ _B8_12:: pand xmm9, xmm10 pmuludq xmm13, xmm4 paddq xmm9, xmm0 - movq xmm8, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r8] + movq xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r8] psrlq xmm14, 32 movups XMMWORD PTR [80+rsp], xmm3 movdqa xmm3, xmm15 - movhpd xmm8, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rax+r10] + movhpd xmm8, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rax+r10] psrlq xmm10, 32 movups XMMWORD PTR [48+rsp], xmm5 pand xmm3, xmm8 @@ -3315,13 +3315,13 @@ _B8_12:: shl r11d, 5 andps xmm5, xmm15 shl ecx, 5 - movq xmm13, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+r11] - movhpd xmm13, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+rax+rcx] + movq xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+r11] + movhpd xmm13, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+rax+rcx] mulpd xmm1, xmm13 - movq xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+r11] - movq xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+r11] - movhpd xmm4, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+rax+rcx] - movhpd xmm0, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+rax+rcx] + movq xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+r11] + movq xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+r11] + movhpd xmm4, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+rax+rcx] + movhpd xmm0, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+rax+rcx] mulpd xmm12, xmm4 addpd xmm4, xmm13 movaps xmm11, xmm0 @@ -3355,8 +3355,8 @@ _B8_12:: addpd xmm13, xmm8 mulpd xmm11, xmm13 mulpd xmm11, xmm0 - movq xmm6, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+r11] - movhpd xmm6, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rax+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+r11] + movhpd xmm6, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rax+rcx] addpd xmm1, xmm11 addpd xmm6, xmm5 addpd xmm1, xmm6 @@ -3373,13 +3373,13 @@ _B8_12:: _B8_13:: -__svml_sin2_ha_ex ENDP +__jsvml_sin2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_ex_B1_B4: +_unwind___jsvml_sin2_ha_ex_B1_B4: DD 1603585 DD 3855480 DD 1861744 @@ -3401,19 +3401,19 @@ _unwind___svml_sin2_ha_ex_B1_B4: DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_sin2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_ex_B7_B11: +_unwind___jsvml_sin2_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_sin2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3422,17 +3422,17 @@ _unwind___svml_sin2_ha_ex_B7_B11: DD imagerel _B8_7 DD imagerel _B8_12 - DD imagerel _unwind___svml_sin2_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_sin2_ha_ex_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin2_ha_ex_B12_B12: +_unwind___jsvml_sin2_ha_ex_B12_B12: DD 33 DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_sin2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_sin2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3441,7 +3441,7 @@ _unwind___svml_sin2_ha_ex_B12_B12: DD imagerel _B8_12 DD imagerel _B8_13 - DD imagerel _unwind___svml_sin2_ha_ex_B12_B12 + DD imagerel _unwind___jsvml_sin2_ha_ex_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3455,9 +3455,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sin8_ha_z0 + PUBLIC __jsvml_sin8_ha_z0 -__svml_sin8_ha_z0 PROC EXPORT +__jsvml_sin8_ha_z0 PROC EXPORT _B9_1:: @@ -3473,29 +3473,29 @@ L359:: vmovups ZMMWORD PTR [1200+rsp], zmm8 mov QWORD PTR [1192+rsp], r13 lea r13, QWORD PTR [1055+rsp] - vmovups zmm28, ZMMWORD PTR [__svml_dsin_ha_data_internal+128] + vmovups zmm28, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+128] and r13, -64 - vmovups zmm30, ZMMWORD PTR [__svml_dsin_ha_data_internal+192] - vmovups zmm31, ZMMWORD PTR [__svml_dsin_ha_data_internal+256] - vmovups zmm2, ZMMWORD PTR [__svml_dsin_ha_data_internal+320] - vmovups zmm1, ZMMWORD PTR [__svml_dsin_ha_data_internal+384] - vmovups zmm29, ZMMWORD PTR [__svml_dsin_ha_data_internal+64] - vmovups zmm24, ZMMWORD PTR [__svml_dsin_ha_data_internal+640] - vmovups zmm22, ZMMWORD PTR [__svml_dsin_ha_data_internal+512] - vmovups zmm3, ZMMWORD PTR [__svml_dsin_ha_data_internal+1088] - vmovups zmm25, ZMMWORD PTR [__svml_dsin_ha_data_internal+768] + vmovups zmm30, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+192] + vmovups zmm31, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+256] + vmovups zmm2, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+320] + vmovups zmm1, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+384] + vmovups zmm29, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+64] + vmovups zmm24, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+640] + vmovups zmm22, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+512] + vmovups zmm3, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1088] + vmovups zmm25, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+768] vmovaps zmm27, zmm0 vfmadd213pd zmm28, zmm27, zmm30 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_dsin_ha_data_internal+1024] - vpcmpeqq k2, zmm27, ZMMWORD PTR [__svml_dsin_ha_data_internal+896] + vmovups zmm0, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1024] + vpcmpeqq k2, zmm27, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+896] vsubpd zmm8, zmm28, zmm30 {rn-sae} - vandpd zmm26, zmm27, ZMMWORD PTR [__svml_dsin_ha_data_internal] - vpermt2pd zmm24, zmm28, ZMMWORD PTR [__svml_dsin_ha_data_internal+704] - vpermt2pd zmm22, zmm28, ZMMWORD PTR [__svml_dsin_ha_data_internal+576] - vpermt2pd zmm25, zmm28, ZMMWORD PTR [__svml_dsin_ha_data_internal+832] - vxorpd zmm28{k2}, zmm28, ZMMWORD PTR [__svml_dsin_ha_data_internal+960] + vandpd zmm26, zmm27, ZMMWORD PTR [__jsvml_dsin_ha_data_internal] + vpermt2pd zmm24, zmm28, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+704] + vpermt2pd zmm22, zmm28, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+576] + vpermt2pd zmm25, zmm28, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+832] + vxorpd zmm28{k2}, zmm28, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+960] vfnmadd213pd zmm31, zmm8, zmm27 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_dsin_ha_data_internal+1152] + vmovups zmm30, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1152] vcmppd k1, zmm26, zmm29, 22 {sae} vpsrlq zmm28, zmm28, 4 kortestw k1, k1 @@ -3504,21 +3504,21 @@ L359:: vmovaps zmm23, zmm8 vfnmadd213pd zmm23, zmm1, zmm4 {rn-sae} vsubpd zmm5, zmm31, zmm4 {rn-sae} - vmovups zmm31, ZMMWORD PTR [__svml_dsin_ha_data_internal+1280] + vmovups zmm31, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1280] vmulpd zmm21, zmm23, zmm23 {rn-sae} vfnmadd231pd zmm5, zmm2, zmm8 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_dsin_ha_data_internal+1216] + vmovups zmm2, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1216] vsubpd zmm29, zmm23, zmm4 {rn-sae} vfmadd231pd zmm3, zmm0, zmm21 {rn-sae} vfmadd231pd zmm2, zmm30, zmm21 {rn-sae} vfmadd213pd zmm8, zmm1, zmm29 {rn-sae} vfmadd213pd zmm3, zmm21, zmm31 {rn-sae} vsubpd zmm0, zmm5, zmm8 {rn-sae} - vmovups zmm8, ZMMWORD PTR [__svml_dsin_ha_data_internal+1408] - vmovups zmm5, ZMMWORD PTR [__svml_dsin_ha_data_internal+1344] + vmovups zmm8, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1408] + vmovups zmm5, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1344] vfmadd213pd zmm3, zmm21, zmm8 {rn-sae} vfmadd213pd zmm2, zmm21, zmm5 {rn-sae} - vmovups zmm8, ZMMWORD PTR [__svml_dsin_ha_data_internal+1472] + vmovups zmm8, ZMMWORD PTR [__jsvml_dsin_ha_data_internal+1472] vpsllq zmm5, zmm25, 32 vmulpd zmm3, zmm22, zmm3 {rn-sae} vfmadd213pd zmm2, zmm21, zmm8 {rn-sae} @@ -3671,7 +3671,7 @@ _B9_16:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsin_ha_cout_rare_internal + call __jsvml_dsin_ha_cout_rare_internal jmp _B9_14 _B9_17:: @@ -3680,7 +3680,7 @@ _B9_17:: lea rdx, QWORD PTR [__ImageBase] vpsrlq zmm4, zmm23, 52 mov rcx, rdx - vmovups zmm5, ZMMWORD PTR [__svml_dsin_ha_data_internal_ha+16512] + vmovups zmm5, ZMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16512] vpcmpeqd k3, zmm0, zmm0 vpsllq zmm21, zmm4, 1 vandpd zmm8, zmm5, zmm26 @@ -3696,7 +3696,7 @@ _B9_17:: mov r10, rdx mov r11, rdx vpxord zmm5, zmm5, zmm5 - vgatherdpd zmm5{k3}, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+rdx+ymm28] + vgatherdpd zmm5{k3}, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+rdx+ymm28] vpcmpeqd k3, zmm0, zmm0 vpandnq zmm22{k2}, zmm8, zmm8 vpcmpeqd k2, zmm0, zmm0 @@ -3707,8 +3707,8 @@ _B9_17:: vpandq zmm24, zmm26, QWORD BCST [_2il0floatpacket_76] vpaddq zmm23, zmm24, QWORD BCST [_2il0floatpacket_77] vpsrlq zmm24, zmm5, 32 - vgatherdpd zmm8{k2}, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+8+rcx+ymm28] - vgatherdpd zmm22{k3}, QWORD PTR [imagerel(__svml_dsin_ha_reduction_data_internal)+16+r8+ymm28] + vgatherdpd zmm8{k2}, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+8+rcx+ymm28] + vgatherdpd zmm22{k3}, QWORD PTR [imagerel(__jsvml_dsin_ha_reduction_data_internal)+16+r8+ymm28] vpsrlq zmm31, zmm8, 32 vpsrlq zmm29, zmm22, 32 vpandq zmm28, zmm8, zmm21 @@ -3776,7 +3776,7 @@ _B9_17:: vpandq zmm29, zmm29, QWORD BCST [_2il0floatpacket_86] vsubpd zmm8, zmm30, zmm24 {rn-sae} vpsllq zmm24, zmm29, 40 - vmovups zmm30, ZMMWORD PTR [__svml_dsin_ha_data_internal_ha+17024] + vmovups zmm30, ZMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17024] vmovaps zmm28, zmm25 vpxorq zmm1, zmm5, QWORD BCST [_2il0floatpacket_85] vpternlogq zmm3, zmm24, zmm1, 254 @@ -3789,7 +3789,7 @@ _B9_17:: vsubpd zmm4, zmm4, zmm23 {rn-sae} vfmsub213pd zmm1, zmm23, zmm3 {rn-sae} vaddpd zmm24, zmm24, zmm4 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_dsin_ha_data_internal_ha+17152] + vmovups zmm4, ZMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17152] vfmadd213pd zmm23, zmm5, zmm1 {rn-sae} vaddpd zmm29, zmm24, zmm8 {rn-sae} vpsllq zmm24, zmm31, 5 @@ -3799,19 +3799,19 @@ _B9_17:: vpcmpeqd k2, zmm0, zmm0 vandpd zmm5, zmm28, zmm3 vandpd zmm1, zmm28, zmm29 - vmovups zmm3, ZMMWORD PTR [__svml_dsin_ha_data_internal_ha+16960] + vmovups zmm3, ZMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+16960] vpandnq zmm25{k3}, zmm2, zmm2 vpternlogq zmm5, zmm25, zmm26, 248 vpcmpeqd k3, zmm0, zmm0 vmovaps zmm31, zmm5 vmovaps zmm24, zmm5 vpxord zmm25, zmm25, zmm25 - vgatherdpd zmm25{k2}, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+r9+ymm8] + vgatherdpd zmm25{k2}, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+r9+ymm8] vpcmpeqd k2, zmm0, zmm0 vpxord zmm21, zmm21, zmm21 vpxord zmm22, zmm22, zmm22 - vgatherdpd zmm21{k3}, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+8+r10+ymm8] - vgatherdpd zmm22{k2}, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+16+r11+ymm8] + vgatherdpd zmm21{k3}, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+8+r10+ymm8] + vgatherdpd zmm22{k2}, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+16+r11+ymm8] vpcmpeqd k3, zmm0, zmm0 vfmadd213pd zmm31, zmm21, zmm22 {rn-sae} vfmadd132pd zmm24, zmm31, zmm25 {rn-sae} @@ -3824,8 +3824,8 @@ _B9_17:: vfmadd231pd zmm3, zmm30, zmm23 {rn-sae} vmulpd zmm30, zmm3, zmm23 {rn-sae} vaddpd zmm3, zmm25, zmm21 {rn-sae} - vmovups zmm21, ZMMWORD PTR [__svml_dsin_ha_data_internal_ha+17216] - vmovups zmm25, ZMMWORD PTR [__svml_dsin_ha_data_internal_ha+17088] + vmovups zmm21, ZMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17216] + vmovups zmm25, ZMMWORD PTR [__jsvml_dsin_ha_data_internal_ha+17088] vmulpd zmm28, zmm30, zmm5 {rn-sae} vfmadd231pd zmm4, zmm21, zmm23 {rn-sae} vfnmadd213pd zmm5, zmm22, zmm3 {rn-sae} @@ -3834,7 +3834,7 @@ _B9_17:: vmulpd zmm2, zmm4, zmm23 {rn-sae} vfmadd213pd zmm2, zmm22, zmm28 {rn-sae} vpxord zmm22, zmm22, zmm22 - vgatherdpd zmm22{k3}, QWORD PTR [imagerel(__svml_dsin_ha_data_internal_ha)+24+rdx+ymm8] + vgatherdpd zmm22{k3}, QWORD PTR [imagerel(__jsvml_dsin_ha_data_internal_ha)+24+rdx+ymm8] vfmadd213pd zmm1, zmm5, zmm22 {rn-sae} vaddpd zmm1, zmm2, zmm1 {rn-sae} vaddpd zmm5, zmm24, zmm1 {rn-sae} @@ -3845,13 +3845,13 @@ _B9_17:: _B9_18:: -__svml_sin8_ha_z0 ENDP +__jsvml_sin8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin8_ha_z0_B1_B10: +_unwind___jsvml_sin8_ha_z0_B1_B10: DD 535297 DD 9819179 DD 4950051 @@ -3865,13 +3865,13 @@ _unwind___svml_sin8_ha_z0_B1_B10: DD imagerel _B9_1 DD imagerel _B9_12 - DD imagerel _unwind___svml_sin8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_sin8_ha_z0_B1_B10 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin8_ha_z0_B12_B16: +_unwind___jsvml_sin8_ha_z0_B12_B16: DD 2943009 DD 8082664 DD 7894238 @@ -3897,7 +3897,7 @@ _unwind___svml_sin8_ha_z0_B12_B16: DD 7817996 DD imagerel _B9_1 DD imagerel _B9_12 - DD imagerel _unwind___svml_sin8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_sin8_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3906,17 +3906,17 @@ _unwind___svml_sin8_ha_z0_B12_B16: DD imagerel _B9_12 DD imagerel _B9_17 - DD imagerel _unwind___svml_sin8_ha_z0_B12_B16 + DD imagerel _unwind___jsvml_sin8_ha_z0_B12_B16 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sin8_ha_z0_B17_B17: +_unwind___jsvml_sin8_ha_z0_B17_B17: DD 33 DD imagerel _B9_1 DD imagerel _B9_12 - DD imagerel _unwind___svml_sin8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_sin8_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3925,7 +3925,7 @@ _unwind___svml_sin8_ha_z0_B17_B17: DD imagerel _B9_17 DD imagerel _B9_18 - DD imagerel _unwind___svml_sin8_ha_z0_B17_B17 + DD imagerel _unwind___jsvml_sin8_ha_z0_B17_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3939,9 +3939,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dsin_ha_cout_rare_internal + PUBLIC __jsvml_dsin_ha_cout_rare_internal -__svml_dsin_ha_cout_rare_internal PROC +__jsvml_dsin_ha_cout_rare_internal PROC _B10_1:: @@ -3999,13 +3999,13 @@ _B10_6:: _B10_7:: -__svml_dsin_ha_cout_rare_internal ENDP +__jsvml_dsin_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dsin_ha_cout_rare_internal_B1_B6: +_unwind___jsvml_dsin_ha_cout_rare_internal_B1_B6: DD 67585 DD 16904 @@ -4016,7 +4016,7 @@ _unwind___svml_dsin_ha_cout_rare_internal_B1_B6: DD imagerel _B10_1 DD imagerel _B10_7 - DD imagerel _unwind___svml_dsin_ha_cout_rare_internal_B1_B6 + DD imagerel _unwind___jsvml_dsin_ha_cout_rare_internal_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -4024,8 +4024,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dsin_ha_reduction_data_internal -__svml_dsin_ha_reduction_data_internal DD 0 + PUBLIC __jsvml_dsin_ha_reduction_data_internal +__jsvml_dsin_ha_reduction_data_internal DD 0 DD 0 DD 0 DD 0 @@ -16314,8 +16314,8 @@ __svml_dsin_ha_reduction_data_internal DD 0 DD 896803160 DD 3984508030 DD 128 DUP (0H) - PUBLIC __svml_dsin_ha_data_internal_ha -__svml_dsin_ha_data_internal_ha DD 0 + PUBLIC __jsvml_dsin_ha_data_internal_ha +__jsvml_dsin_ha_data_internal_ha DD 0 DD 0 DD 0 DD 1072693248 @@ -20635,8 +20635,8 @@ __svml_dsin_ha_data_internal_ha DD 0 DD 3210133866 DD 2976101079 DD 3210133866 - PUBLIC __svml_dsin_ha_data_internal -__svml_dsin_ha_data_internal DD 4294967295 + PUBLIC __jsvml_dsin_ha_data_internal +__jsvml_dsin_ha_data_internal DD 4294967295 DD 2147483647 DD 4294967295 DD 2147483647 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_sinh_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_sinh_windows_x86.S similarity index 87% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_sinh_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_sinh_windows_x86.S index a87d02c86c2..75d9ea922c1 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_sinh_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_sinh_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh1_ha_e9 + PUBLIC __jsvml_sinh1_ha_e9 -__svml_sinh1_ha_e9 PROC EXPORT +__jsvml_sinh1_ha_e9 PROC EXPORT _B1_1:: @@ -64,37 +64,37 @@ L1:: vmovups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm1, QWORD PTR [__svml_dsinh_ha_data_internal+1408] + vmovsd xmm1, QWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 vandpd xmm4, xmm1, xmm5 vxorpd xmm8, xmm4, xmm5 - vmulsd xmm7, xmm8, QWORD PTR [__svml_dsinh_ha_data_internal+1216] - vmovsd xmm11, QWORD PTR [__svml_dsinh_ha_data_internal+512] - vmovsd xmm13, QWORD PTR [__svml_dsinh_ha_data_internal+576] + vmulsd xmm7, xmm8, QWORD PTR [__jsvml_dsinh_ha_data_internal+1216] + vmovsd xmm11, QWORD PTR [__jsvml_dsinh_ha_data_internal+512] + vmovsd xmm13, QWORD PTR [__jsvml_dsinh_ha_data_internal+576] vaddsd xmm0, xmm7, xmm11 vpshufd xmm14, xmm8, 85 vcmpeqsd xmm7, xmm13, xmm0 vblendvpd xmm13, xmm0, xmm11, xmm7 vpcmpgtd xmm6, xmm14, xmm12 - vmovq xmm15, QWORD PTR [__svml_dsinh_ha_data_internal+704] + vmovq xmm15, QWORD PTR [__jsvml_dsinh_ha_data_internal+704] vpand xmm0, xmm13, xmm15 vsubsd xmm12, xmm13, xmm11 vmovmskps eax, xmm6 - vmovsd xmm11, QWORD PTR [__svml_dsinh_ha_data_internal+1280] + vmovsd xmm11, QWORD PTR [__jsvml_dsinh_ha_data_internal+1280] vpsllq xmm15, xmm0, 3 vmulsd xmm11, xmm11, xmm12 vmovd edx, xmm15 - vmovsd xmm2, QWORD PTR [__svml_dsinh_ha_data_internal+1088] + vmovsd xmm2, QWORD PTR [__jsvml_dsinh_ha_data_internal+1088] vsubsd xmm11, xmm8, xmm11 - vmovsd xmm8, QWORD PTR [__svml_dsinh_ha_data_internal+1344] + vmovsd xmm8, QWORD PTR [__jsvml_dsinh_ha_data_internal+1344] vmulsd xmm8, xmm8, xmm12 vpxor xmm12, xmm13, xmm0 movsxd rdx, edx vpsllq xmm12, xmm12, 48 - vmovsd xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+1152] + vmovsd xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+1152] vsubsd xmm8, xmm11, xmm8 - vmovsd xmm15, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rcx+rdx] - vmovsd xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rcx+rdx] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rcx+rdx] + vmovsd xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rcx+rdx] vpaddq xmm0, xmm15, xmm12 vpsubq xmm13, xmm14, xmm12 vmulsd xmm11, xmm8, xmm8 @@ -103,26 +103,26 @@ L1:: vmulsd xmm2, xmm2, xmm11 vsubsd xmm0, xmm15, xmm0 vmulsd xmm3, xmm3, xmm11 - vmovsd xmm7, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rcx+rdx] + vmovsd xmm7, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rcx+rdx] vandnpd xmm1, xmm1, xmm7 vpsubq xmm7, xmm7, xmm12 vcmpltsd xmm1, xmm1, xmm12 - vmovsd xmm6, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rcx+rdx] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rcx+rdx] vpaddq xmm6, xmm6, xmm12 vandnpd xmm12, xmm1, xmm7 vaddsd xmm1, xmm13, xmm0 - vaddsd xmm0, xmm2, QWORD PTR [__svml_dsinh_ha_data_internal+960] - vaddsd xmm2, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+1024] + vaddsd xmm0, xmm2, QWORD PTR [__jsvml_dsinh_ha_data_internal+960] + vaddsd xmm2, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+1024] vsubsd xmm6, xmm6, xmm1 vmulsd xmm1, xmm0, xmm11 vmulsd xmm3, xmm2, xmm11 vsubsd xmm7, xmm6, xmm12 - vaddsd xmm13, xmm1, QWORD PTR [__svml_dsinh_ha_data_internal+832] - vaddsd xmm6, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+896] + vaddsd xmm13, xmm1, QWORD PTR [__jsvml_dsinh_ha_data_internal+832] + vaddsd xmm6, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+896] vmulsd xmm1, xmm13, xmm11 vmulsd xmm12, xmm6, xmm11 mov QWORD PTR [304+rsp], r13 - vaddsd xmm0, xmm12, QWORD PTR [__svml_dsinh_ha_data_internal+768] + vaddsd xmm0, xmm12, QWORD PTR [__jsvml_dsinh_ha_data_internal+768] vmulsd xmm11, xmm0, xmm11 vmulsd xmm0, xmm8, xmm14 vmulsd xmm8, xmm1, xmm0 @@ -165,19 +165,19 @@ _B1_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B1_4 ALIGN 16 _B1_7:: -__svml_sinh1_ha_e9 ENDP +__jsvml_sinh1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh1_ha_e9_B1_B6: +_unwind___jsvml_sinh1_ha_e9_B1_B6: DD 1339137 DD 1430639 DD 944231 @@ -197,7 +197,7 @@ _unwind___svml_sinh1_ha_e9_B1_B6: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_sinh1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_sinh1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -211,9 +211,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh4_ha_e9 + PUBLIC __jsvml_sinh4_ha_e9 -__svml_sinh4_ha_e9 PROC EXPORT +__jsvml_sinh4_ha_e9 PROC EXPORT _B2_1:: @@ -237,17 +237,17 @@ L20:: vmovups YMMWORD PTR [272+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd ymm3, YMMWORD PTR [__svml_dsinh_ha_data_internal+1408] + vmovupd ymm3, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 vmovupd YMMWORD PTR [32+r13], ymm0 - vmovupd ymm15, YMMWORD PTR [__svml_dsinh_ha_data_internal+512] - vmovupd xmm11, XMMWORD PTR [__svml_dsinh_ha_data_internal+704] + vmovupd ymm15, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+512] + vmovupd xmm11, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+704] vandpd ymm5, ymm3, ymm0 vxorpd ymm0, ymm5, ymm0 - vmulpd ymm8, ymm0, YMMWORD PTR [__svml_dsinh_ha_data_internal+1216] + vmulpd ymm8, ymm0, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1216] vmovupd YMMWORD PTR [r13], ymm5 vaddpd ymm12, ymm15, ymm8 - vcmpeqpd ymm10, ymm12, YMMWORD PTR [__svml_dsinh_ha_data_internal+576] + vcmpeqpd ymm10, ymm12, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+576] vblendvpd ymm2, ymm12, ymm15, ymm10 mov QWORD PTR [536+rsp], r13 vpand xmm5, xmm2, xmm11 @@ -257,7 +257,7 @@ L20:: vmovd ecx, xmm8 vshufps xmm9, xmm0, xmm13, 221 vandps xmm6, xmm4, xmm11 - vpcmpgtd xmm1, xmm9, XMMWORD PTR [__svml_dsinh_ha_data_internal+640] + vpcmpgtd xmm1, xmm9, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+640] vpsllq xmm9, xmm6, 3 vmovd r9d, xmm9 vxorps xmm4, xmm4, xmm6 @@ -267,38 +267,38 @@ L20:: vpextrd r10d, xmm9, 2 movsxd r10, r10d vpextrd eax, xmm8, 2 - vmovsd xmm1, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+r9] + vmovsd xmm1, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+r9] movsxd rcx, ecx - vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+r10] - vmovsd xmm1, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+r9] - vmovhpd xmm12, xmm1, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+r10] + vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+r10] + vmovsd xmm1, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+r9] + vmovhpd xmm12, xmm1, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+r10] vsubpd ymm1, ymm2, ymm15 vpxor xmm2, xmm2, xmm5 - vmovsd xmm13, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+rcx] + vmovsd xmm13, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+rcx] vpsllq xmm2, xmm2, 48 - vmovsd xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+rcx] - vmulpd ymm15, ymm1, YMMWORD PTR [__svml_dsinh_ha_data_internal+1280] - vmulpd ymm1, ymm1, YMMWORD PTR [__svml_dsinh_ha_data_internal+1344] - vmovsd xmm11, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+r9] + vmovsd xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+rcx] + vmulpd ymm15, ymm1, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1280] + vmulpd ymm1, ymm1, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1344] + vmovsd xmm11, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+r9] vpaddq xmm5, xmm8, xmm4 vpaddq xmm12, xmm12, xmm4 vsubpd ymm0, ymm0, ymm15 - vmovhpd xmm10, xmm11, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+r10] + vmovhpd xmm10, xmm11, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+r10] vpsubq xmm8, xmm10, xmm4 vsubpd ymm0, ymm0, ymm1 movsxd rax, eax vmulpd ymm1, ymm0, ymm0 - vmovhpd xmm7, xmm13, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+rax] - vmovhpd xmm9, xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+rax] - vmovsd xmm13, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+rcx] - vmovsd xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+rcx] + vmovhpd xmm7, xmm13, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+rax] + vmovhpd xmm9, xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+rax] + vmovsd xmm13, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+rcx] + vmovsd xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+rcx] vpaddq xmm7, xmm7, xmm2 vpsubq xmm6, xmm9, xmm2 - vmulpd ymm15, ymm1, YMMWORD PTR [__svml_dsinh_ha_data_internal+1152] - vmovhpd xmm11, xmm13, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+rax] - vmovhpd xmm13, xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+rax] - vmovsd xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+r9] - vmovhpd xmm14, xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+r10] + vmulpd ymm15, ymm1, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1152] + vmovhpd xmm11, xmm13, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+rax] + vmovhpd xmm13, xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+rax] + vmovsd xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+r9] + vmovhpd xmm14, xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+r10] vmovupd XMMWORD PTR [32+rsp], xmm14 vinsertf128 ymm7, ymm7, xmm5, 1 vpaddq xmm5, xmm11, xmm2 @@ -309,12 +309,12 @@ L20:: vmovupd xmm2, XMMWORD PTR [32+rsp] vpsubq xmm4, xmm2, xmm4 vandnpd ymm3, ymm3, ymm14 - vmulpd ymm14, ymm1, YMMWORD PTR [__svml_dsinh_ha_data_internal+1088] + vmulpd ymm14, ymm1, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1088] vcmplt_oqpd ymm3, ymm3, ymm5 - vaddpd ymm2, ymm14, YMMWORD PTR [__svml_dsinh_ha_data_internal+960] + vaddpd ymm2, ymm14, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+960] vinsertf128 ymm10, ymm6, xmm8, 1 vinsertf128 ymm6, ymm13, xmm4, 1 - vaddpd ymm4, ymm15, YMMWORD PTR [__svml_dsinh_ha_data_internal+1024] + vaddpd ymm4, ymm15, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1024] vsubpd ymm8, ymm7, ymm10 vaddpd ymm9, ymm7, ymm10 vmulpd ymm5, ymm1, ymm4 @@ -323,13 +323,13 @@ L20:: vmulpd ymm3, ymm1, ymm2 vmulpd ymm2, ymm0, ymm9 vaddpd ymm10, ymm10, ymm7 - vaddpd ymm6, ymm5, YMMWORD PTR [__svml_dsinh_ha_data_internal+896] + vaddpd ymm6, ymm5, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+896] vsubpd ymm12, ymm12, ymm10 - vaddpd ymm10, ymm3, YMMWORD PTR [__svml_dsinh_ha_data_internal+832] + vaddpd ymm10, ymm3, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+832] vmulpd ymm7, ymm1, ymm6 vsubpd ymm13, ymm12, ymm11 vmulpd ymm12, ymm1, ymm10 - vaddpd ymm11, ymm7, YMMWORD PTR [__svml_dsinh_ha_data_internal+768] + vaddpd ymm11, ymm7, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+768] vmulpd ymm0, ymm12, ymm2 vmulpd ymm1, ymm1, ymm11 vaddpd ymm9, ymm13, ymm0 @@ -395,19 +395,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_sinh4_ha_e9 ENDP +__jsvml_sinh4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh4_ha_e9_B1_B3: +_unwind___jsvml_sinh4_ha_e9_B1_B3: DD 1602561 DD 4379764 DD 1140844 @@ -429,19 +429,19 @@ _unwind___svml_sinh4_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_sinh4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinh4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh4_ha_e9_B6_B10: +_unwind___jsvml_sinh4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_sinh4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinh4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -450,7 +450,7 @@ _unwind___svml_sinh4_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_sinh4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_sinh4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -464,9 +464,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh2_ha_ex + PUBLIC __jsvml_sinh2_ha_ex -__svml_sinh2_ha_ex PROC EXPORT +__jsvml_sinh2_ha_ex PROC EXPORT _B3_1:: @@ -489,24 +489,24 @@ L53:: movups XMMWORD PTR [304+rsp], xmm6 mov QWORD PTR [320+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm4, XMMWORD PTR [__svml_dsinh_ha_data_internal+1408] + movups xmm4, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 movaps xmm0, xmm4 andps xmm0, xmm11 movaps xmm10, xmm0 - movups xmm3, XMMWORD PTR [__svml_dsinh_ha_data_internal+1216] + movups xmm3, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1216] pxor xmm10, xmm11 mulpd xmm3, xmm10 - movups xmm13, XMMWORD PTR [__svml_dsinh_ha_data_internal+512] + movups xmm13, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+512] addpd xmm3, xmm13 - movups xmm1, XMMWORD PTR [__svml_dsinh_ha_data_internal+576] + movups xmm1, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+576] cmpeqpd xmm1, xmm3 movaps xmm12, xmm1 andps xmm1, xmm13 andnps xmm12, xmm3 - movq xmm2, QWORD PTR [__svml_dsinh_ha_data_internal+640] + movq xmm2, QWORD PTR [__jsvml_dsinh_ha_data_internal+640] orps xmm12, xmm1 - movdqu xmm1, XMMWORD PTR [__svml_dsinh_ha_data_internal+704] + movdqu xmm1, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+704] pshufd xmm5, xmm10, 221 pand xmm1, xmm12 pcmpgtd xmm5, xmm2 @@ -516,16 +516,16 @@ L53:: pshufd xmm8, xmm5, 2 movd ecx, xmm8 movaps xmm8, xmm12 - movups xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+1152] + movups xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1152] pxor xmm12, xmm1 - movups xmm7, XMMWORD PTR [__svml_dsinh_ha_data_internal+1088] + movups xmm7, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1088] psllq xmm12, 48 subpd xmm8, xmm13 movd edx, xmm5 - movups xmm13, XMMWORD PTR [__svml_dsinh_ha_data_internal+1280] + movups xmm13, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1280] mulpd xmm13, xmm8 subpd xmm10, xmm13 - movups xmm13, XMMWORD PTR [__svml_dsinh_ha_data_internal+1344] + movups xmm13, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1344] and eax, 3 mulpd xmm13, xmm8 subpd xmm10, xmm13 @@ -533,22 +533,22 @@ L53:: mulpd xmm8, xmm10 mulpd xmm6, xmm8 mulpd xmm7, xmm8 - addpd xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+1024] - addpd xmm7, XMMWORD PTR [__svml_dsinh_ha_data_internal+960] + addpd xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1024] + addpd xmm7, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+960] mulpd xmm6, xmm8 mulpd xmm7, xmm8 - addpd xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+896] - addpd xmm7, XMMWORD PTR [__svml_dsinh_ha_data_internal+832] + addpd xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+896] + addpd xmm7, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+832] mulpd xmm6, xmm8 mulpd xmm7, xmm8 - addpd xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+768] + addpd xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+768] movsxd rdx, edx movsxd rcx, ecx mulpd xmm8, xmm6 - movsd xmm2, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+r8+rdx] - movhpd xmm2, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+r8+rcx] - movsd xmm5, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+r8+rdx] - movhpd xmm5, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+r8+rcx] + movsd xmm2, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+r8+rdx] + movhpd xmm2, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+r8+rcx] + movsd xmm5, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+r8+rdx] + movhpd xmm5, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+r8+rcx] paddq xmm2, xmm12 psubq xmm5, xmm12 movaps xmm1, xmm2 @@ -557,10 +557,10 @@ L53:: addpd xmm13, xmm5 mulpd xmm8, xmm1 mulpd xmm10, xmm13 - movsd xmm3, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+r8+rdx] - movsd xmm9, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+r8+rdx] - movhpd xmm3, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+r8+rcx] - movhpd xmm9, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+r8+rcx] + movsd xmm3, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+r8+rdx] + movsd xmm9, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+r8+rdx] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+r8+rcx] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+r8+rcx] andnps xmm4, xmm3 paddq xmm9, xmm12 psubq xmm3, xmm12 @@ -634,19 +634,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_sinh2_ha_ex ENDP +__jsvml_sinh2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh2_ha_ex_B1_B3: +_unwind___jsvml_sinh2_ha_ex_B1_B3: DD 1336321 DD 2675812 DD 1271900 @@ -666,19 +666,19 @@ _unwind___svml_sinh2_ha_ex_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_sinh2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_sinh2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh2_ha_ex_B6_B10: +_unwind___jsvml_sinh2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_sinh2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_sinh2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -687,7 +687,7 @@ _unwind___svml_sinh2_ha_ex_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_sinh2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_sinh2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -701,9 +701,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh1_ha_l9 + PUBLIC __jsvml_sinh1_ha_l9 -__svml_sinh1_ha_l9 PROC EXPORT +__jsvml_sinh1_ha_l9 PROC EXPORT _B4_1:: @@ -728,52 +728,52 @@ L76:: vmovups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - vmovsd xmm1, QWORD PTR [__svml_dsinh_ha_data_internal+1408] + vmovsd xmm1, QWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 vandpd xmm8, xmm1, xmm9 vxorpd xmm4, xmm8, xmm9 - vmovsd xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+512] + vmovsd xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+512] vmovapd xmm15, xmm4 - vfmadd132sd xmm15, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+1216] + vfmadd132sd xmm15, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+1216] vpshufd xmm2, xmm4, 85 - vmovsd xmm7, QWORD PTR [__svml_dsinh_ha_data_internal+576] + vmovsd xmm7, QWORD PTR [__jsvml_dsinh_ha_data_internal+576] vpcmpgtd xmm0, xmm2, xmm11 - vmovq xmm14, QWORD PTR [__svml_dsinh_ha_data_internal+704] - vmovsd xmm6, QWORD PTR [__svml_dsinh_ha_data_internal+1152] + vmovq xmm14, QWORD PTR [__jsvml_dsinh_ha_data_internal+704] + vmovsd xmm6, QWORD PTR [__jsvml_dsinh_ha_data_internal+1152] vmovmskps eax, xmm0 vcmpeqsd xmm2, xmm7, xmm15 vblendvpd xmm10, xmm15, xmm3, xmm2 - vmovsd xmm15, QWORD PTR [__svml_dsinh_ha_data_internal+1280] + vmovsd xmm15, QWORD PTR [__jsvml_dsinh_ha_data_internal+1280] vpand xmm11, xmm10, xmm14 vsubsd xmm3, xmm10, xmm3 vpsllq xmm14, xmm11, 3 vpxor xmm10, xmm10, xmm11 vmovd edx, xmm14 vpsllq xmm10, xmm10, 48 - vmovsd xmm5, QWORD PTR [__svml_dsinh_ha_data_internal+1088] + vmovsd xmm5, QWORD PTR [__jsvml_dsinh_ha_data_internal+1088] vfnmadd213sd xmm15, xmm3, xmm4 - vmovsd xmm4, QWORD PTR [__svml_dsinh_ha_data_internal+1344] + vmovsd xmm4, QWORD PTR [__jsvml_dsinh_ha_data_internal+1344] movsxd rdx, edx vfnmadd213sd xmm4, xmm3, xmm15 - vmovsd xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rcx+rdx] - vmovsd xmm2, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rcx+rdx] - vmovsd xmm0, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rcx+rdx] + vmovsd xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rcx+rdx] + vmovsd xmm2, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rcx+rdx] + vmovsd xmm0, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rcx+rdx] vpaddq xmm15, xmm14, xmm10 vpsubq xmm2, xmm2, xmm10 vmulsd xmm3, xmm4, xmm4 vsubsd xmm11, xmm15, xmm2 vaddsd xmm14, xmm15, xmm2 - vfmadd213sd xmm6, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+1024] - vfmadd213sd xmm5, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+960] + vfmadd213sd xmm6, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+1024] + vfmadd213sd xmm5, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+960] vandnpd xmm1, xmm1, xmm0 vpsubq xmm0, xmm0, xmm10 vcmpltsd xmm1, xmm1, xmm10 - vfmadd213sd xmm6, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+896] - vfmadd213sd xmm5, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+832] + vfmadd213sd xmm6, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+896] + vfmadd213sd xmm5, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+832] vandnpd xmm0, xmm1, xmm0 vsubsd xmm1, xmm11, xmm15 - vfmadd213sd xmm6, xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+768] - vmovsd xmm7, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rcx+rdx] + vfmadd213sd xmm6, xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+768] + vmovsd xmm7, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rcx+rdx] vaddsd xmm2, xmm2, xmm1 vpaddq xmm7, xmm7, xmm10 mov QWORD PTR [304+rsp], r13 @@ -819,19 +819,19 @@ _B4_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B4_4 ALIGN 16 _B4_7:: -__svml_sinh1_ha_l9 ENDP +__jsvml_sinh1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh1_ha_l9_B1_B6: +_unwind___jsvml_sinh1_ha_l9_B1_B6: DD 1339137 DD 1430639 DD 944231 @@ -851,7 +851,7 @@ _unwind___svml_sinh1_ha_l9_B1_B6: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_sinh1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_sinh1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -865,9 +865,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh2_ha_l9 + PUBLIC __jsvml_sinh2_ha_l9 -__svml_sinh2_ha_l9 PROC EXPORT +__jsvml_sinh2_ha_l9 PROC EXPORT _B5_1:: @@ -890,55 +890,55 @@ L95:: vmovups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [320+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm9, XMMWORD PTR [__svml_dsinh_ha_data_internal+1408] + vmovupd xmm9, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 vandpd xmm6, xmm9, xmm8 - vmovupd xmm11, XMMWORD PTR [__svml_dsinh_ha_data_internal+1216] + vmovupd xmm11, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1216] vxorpd xmm13, xmm6, xmm8 - vmovupd xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+512] + vmovupd xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+512] vfmadd213pd xmm11, xmm13, xmm14 - vmovq xmm2, QWORD PTR [__svml_dsinh_ha_data_internal+640] + vmovq xmm2, QWORD PTR [__jsvml_dsinh_ha_data_internal+640] vpshufd xmm1, xmm13, 221 vpcmpgtd xmm3, xmm1, xmm2 - vmovupd xmm4, XMMWORD PTR [__svml_dsinh_ha_data_internal+1152] - vcmpeqpd xmm15, xmm11, XMMWORD PTR [__svml_dsinh_ha_data_internal+576] + vmovupd xmm4, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1152] + vcmpeqpd xmm15, xmm11, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+576] vmovmskps edx, xmm3 vblendvpd xmm3, xmm11, xmm14, xmm15 - vmovupd xmm5, XMMWORD PTR [__svml_dsinh_ha_data_internal+1088] + vmovupd xmm5, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1088] vsubpd xmm14, xmm3, xmm14 - vpand xmm0, xmm3, XMMWORD PTR [__svml_dsinh_ha_data_internal+704] + vpand xmm0, xmm3, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+704] vpsllq xmm1, xmm0, 3 vpxor xmm0, xmm3, xmm0 - vfnmadd231pd xmm13, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+1280] + vfnmadd231pd xmm13, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1280] vmovd eax, xmm1 - vfnmadd231pd xmm13, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+1344] + vfnmadd231pd xmm13, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1344] movsxd rax, eax vpextrd ecx, xmm1, 2 movsxd rcx, ecx vmulpd xmm14, xmm13, xmm13 - vmovsd xmm2, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+r8+rax] - vmovsd xmm11, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+r8+rax] - vmovsd xmm15, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+r8+rax] - vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+r8+rcx] - vmovhpd xmm2, xmm11, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+r8+rcx] - vmovhpd xmm11, xmm15, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+r8+rcx] + vmovsd xmm2, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+r8+rax] + vmovsd xmm11, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+r8+rax] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+r8+rax] + vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+r8+rcx] + vmovhpd xmm2, xmm11, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+r8+rcx] + vmovhpd xmm11, xmm15, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+r8+rcx] vpsllq xmm15, xmm0, 48 vpaddq xmm3, xmm1, xmm15 vpsubq xmm0, xmm2, xmm15 - vfmadd213pd xmm4, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+1024] - vfmadd213pd xmm5, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+960] + vfmadd213pd xmm4, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1024] + vfmadd213pd xmm5, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+960] vandnpd xmm9, xmm9, xmm11 - vmovsd xmm10, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+r8+rax] - vmovhpd xmm10, xmm10, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+r8+rcx] + vmovsd xmm10, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+r8+rax] + vmovhpd xmm10, xmm10, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+r8+rcx] vpaddq xmm10, xmm10, xmm15 vpsubq xmm11, xmm11, xmm15 vsubpd xmm2, xmm3, xmm0 vaddpd xmm1, xmm3, xmm0 vcmpltpd xmm9, xmm9, xmm15 - vfmadd213pd xmm4, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+896] - vfmadd213pd xmm5, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+832] + vfmadd213pd xmm4, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+896] + vfmadd213pd xmm5, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+832] vsubpd xmm3, xmm2, xmm3 - vfmadd213pd xmm4, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+768] + vfmadd213pd xmm4, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+768] vmulpd xmm5, xmm14, xmm5 vaddpd xmm0, xmm0, xmm3 vmulpd xmm4, xmm14, xmm4 @@ -1005,19 +1005,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_sinh2_ha_l9 ENDP +__jsvml_sinh2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh2_ha_l9_B1_B3: +_unwind___jsvml_sinh2_ha_l9_B1_B3: DD 1336833 DD 2675814 DD 1009758 @@ -1037,19 +1037,19 @@ _unwind___svml_sinh2_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_sinh2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinh2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh2_ha_l9_B6_B10: +_unwind___jsvml_sinh2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_sinh2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinh2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1058,7 +1058,7 @@ _unwind___svml_sinh2_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_sinh2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_sinh2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1072,9 +1072,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh1_ha_ex + PUBLIC __jsvml_sinh1_ha_ex -__svml_sinh1_ha_ex PROC EXPORT +__jsvml_sinh1_ha_ex PROC EXPORT _B6_1:: @@ -1099,16 +1099,16 @@ L118:: movups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [168+rsp], r13 lea r13, QWORD PTR [95+rsp] - movsd xmm7, QWORD PTR [__svml_dsinh_ha_data_internal+1408] + movsd xmm7, QWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 movaps xmm0, xmm7 andps xmm0, xmm5 movaps xmm12, xmm0 pxor xmm12, xmm5 movaps xmm3, xmm12 - mulsd xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+1216] - movsd xmm13, QWORD PTR [__svml_dsinh_ha_data_internal+512] - movsd xmm8, QWORD PTR [__svml_dsinh_ha_data_internal+576] + mulsd xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+1216] + movsd xmm13, QWORD PTR [__jsvml_dsinh_ha_data_internal+512] + movsd xmm8, QWORD PTR [__jsvml_dsinh_ha_data_internal+576] addsd xmm3, xmm13 pshufd xmm2, xmm12, 85 cmpeqsd xmm8, xmm3 @@ -1120,9 +1120,9 @@ L118:: orps xmm2, xmm8 movaps xmm3, xmm2 and eax, 1 - movq xmm1, QWORD PTR [__svml_dsinh_ha_data_internal+704] + movq xmm1, QWORD PTR [__jsvml_dsinh_ha_data_internal+704] subsd xmm3, xmm13 - movsd xmm13, QWORD PTR [__svml_dsinh_ha_data_internal+1280] + movsd xmm13, QWORD PTR [__jsvml_dsinh_ha_data_internal+1280] pand xmm1, xmm2 mulsd xmm13, xmm3 movdqa xmm9, xmm1 @@ -1130,36 +1130,36 @@ L118:: pxor xmm2, xmm1 movd edx, xmm9 psllq xmm2, 48 - movsd xmm11, QWORD PTR [__svml_dsinh_ha_data_internal+1152] + movsd xmm11, QWORD PTR [__jsvml_dsinh_ha_data_internal+1152] subsd xmm12, xmm13 - movsd xmm13, QWORD PTR [__svml_dsinh_ha_data_internal+1344] + movsd xmm13, QWORD PTR [__jsvml_dsinh_ha_data_internal+1344] mulsd xmm13, xmm3 movsxd rdx, edx subsd xmm12, xmm13 movaps xmm3, xmm12 mulsd xmm3, xmm12 mulsd xmm11, xmm3 - movsd xmm10, QWORD PTR [__svml_dsinh_ha_data_internal+1088] - movsd xmm4, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rcx+rdx] + movsd xmm10, QWORD PTR [__jsvml_dsinh_ha_data_internal+1088] + movsd xmm4, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rcx+rdx] mulsd xmm10, xmm3 - addsd xmm11, QWORD PTR [__svml_dsinh_ha_data_internal+1024] + addsd xmm11, QWORD PTR [__jsvml_dsinh_ha_data_internal+1024] paddq xmm4, xmm2 mulsd xmm11, xmm3 - addsd xmm10, QWORD PTR [__svml_dsinh_ha_data_internal+960] - movsd xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rcx+rdx] + addsd xmm10, QWORD PTR [__jsvml_dsinh_ha_data_internal+960] + movsd xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rcx+rdx] movaps xmm1, xmm4 - movsd xmm6, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rcx+rdx] + movsd xmm6, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rcx+rdx] movaps xmm13, xmm4 psubq xmm8, xmm2 mulsd xmm10, xmm3 - addsd xmm11, QWORD PTR [__svml_dsinh_ha_data_internal+896] + addsd xmm11, QWORD PTR [__jsvml_dsinh_ha_data_internal+896] subsd xmm1, xmm8 addsd xmm13, xmm8 mulsd xmm11, xmm3 - addsd xmm10, QWORD PTR [__svml_dsinh_ha_data_internal+832] + addsd xmm10, QWORD PTR [__jsvml_dsinh_ha_data_internal+832] mulsd xmm12, xmm13 mulsd xmm10, xmm3 - addsd xmm11, QWORD PTR [__svml_dsinh_ha_data_internal+768] + addsd xmm11, QWORD PTR [__jsvml_dsinh_ha_data_internal+768] andnps xmm7, xmm6 psubq xmm6, xmm2 mulsd xmm11, xmm3 @@ -1168,7 +1168,7 @@ L118:: mulsd xmm11, xmm1 andnps xmm7, xmm6 movaps xmm6, xmm1 - movsd xmm9, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rcx+rdx] + movsd xmm9, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rcx+rdx] subsd xmm6, xmm4 paddq xmm9, xmm2 addsd xmm8, xmm6 @@ -1212,19 +1212,19 @@ _B6_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B6_4 ALIGN 16 _B6_7:: -__svml_sinh1_ha_ex ENDP +__jsvml_sinh1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh1_ha_ex_B1_B6: +_unwind___jsvml_sinh1_ha_ex_B1_B6: DD 1338369 DD 1430636 DD 1009764 @@ -1244,7 +1244,7 @@ _unwind___svml_sinh1_ha_ex_B1_B6: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_sinh1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_sinh1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1258,9 +1258,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh4_ha_l9 + PUBLIC __jsvml_sinh4_ha_l9 -__svml_sinh4_ha_l9 PROC EXPORT +__jsvml_sinh4_ha_l9 PROC EXPORT _B7_1:: @@ -1284,27 +1284,27 @@ L137:: lea r13, QWORD PTR [175+rsp] vmovdqa ymm4, ymm0 and r13, -64 - vmovupd ymm0, YMMWORD PTR [__svml_dsinh_ha_data_internal+1408] - vmovupd ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+1216] - vmovupd ymm9, YMMWORD PTR [__svml_dsinh_ha_data_internal+512] - vmovupd ymm1, YMMWORD PTR [__svml_dsinh_ha_data_internal+1152] - vmovupd ymm2, YMMWORD PTR [__svml_dsinh_ha_data_internal+1088] + vmovupd ymm0, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1408] + vmovupd ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1216] + vmovupd ymm9, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+512] + vmovupd ymm1, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1152] + vmovupd ymm2, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1088] vandpd ymm3, ymm0, ymm4 vxorpd ymm7, ymm3, ymm4 vfmadd213pd ymm8, ymm7, ymm9 - vcmpeqpd ymm6, ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+576] + vcmpeqpd ymm6, ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+576] mov QWORD PTR [536+rsp], r13 vextracti128 xmm5, ymm7, 1 vshufps xmm14, xmm7, xmm5, 221 - vpcmpgtd xmm15, xmm14, XMMWORD PTR [__svml_dsinh_ha_data_internal+640] + vpcmpgtd xmm15, xmm14, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+640] vmovmskps r8d, xmm15 vblendvpd ymm15, ymm8, ymm9, ymm6 - vandps ymm11, ymm15, YMMWORD PTR [__svml_dsinh_ha_data_internal+704] + vandps ymm11, ymm15, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+704] test r8d, r8d vpsllq ymm5, ymm11, 3 vsubpd ymm9, ymm15, ymm9 - vfnmadd231pd ymm7, ymm9, YMMWORD PTR [__svml_dsinh_ha_data_internal+1280] - vfnmadd231pd ymm7, ymm9, YMMWORD PTR [__svml_dsinh_ha_data_internal+1344] + vfnmadd231pd ymm7, ymm9, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1280] + vfnmadd231pd ymm7, ymm9, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1344] vxorps ymm11, ymm15, ymm11 vpsllq ymm9, ymm11, 48 vextracti128 xmm8, ymm5, 1 @@ -1316,37 +1316,37 @@ L137:: vpextrd r10d, xmm8, 2 movsxd rax, eax movsxd r10, r10d - vmovsd xmm10, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+rcx] - vmovsd xmm6, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+r9] - vmovsd xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+rcx] - vmovhpd xmm14, xmm10, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+rax] - vmovhpd xmm10, xmm6, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+rdx+r10] - vmovhpd xmm6, xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+rax] - vmovsd xmm5, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+r9] - vmovsd xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+rcx] + vmovsd xmm10, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+rcx] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+r9] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+rcx] + vmovhpd xmm14, xmm10, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+rax] + vmovhpd xmm10, xmm6, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+rdx+r10] + vmovhpd xmm6, xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+rax] + vmovsd xmm5, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+r9] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+rcx] vinsertf128 ymm10, ymm14, xmm10, 1 - vmovhpd xmm14, xmm5, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+rdx+r10] - vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+rax] - vmovsd xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+r9] + vmovhpd xmm14, xmm5, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+rdx+r10] + vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+rax] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+r9] vpaddq ymm10, ymm10, ymm9 vinsertf128 ymm14, ymm6, xmm14, 1 - vmovhpd xmm6, xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+rdx+r10] - vmovsd xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+rcx] - vmovhpd xmm8, xmm8, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+rax] + vmovhpd xmm6, xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+rdx+r10] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+rcx] + vmovhpd xmm8, xmm8, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+rax] vpsubq ymm11, ymm14, ymm9 vsubpd ymm15, ymm10, ymm11 vaddpd ymm14, ymm10, ymm11 vinsertf128 ymm5, ymm5, xmm6, 1 - vmovsd xmm6, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+r9] - vmovhpd xmm6, xmm6, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+rdx+r10] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+r9] + vmovhpd xmm6, xmm6, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+rdx+r10] vpaddq ymm5, ymm5, ymm9 vinsertf128 ymm6, ymm8, xmm6, 1 vmulpd ymm8, ymm7, ymm7 - vfmadd213pd ymm1, ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+1024] - vfmadd213pd ymm2, ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+960] - vfmadd213pd ymm1, ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+896] - vfmadd213pd ymm2, ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+832] - vfmadd213pd ymm1, ymm8, YMMWORD PTR [__svml_dsinh_ha_data_internal+768] + vfmadd213pd ymm1, ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+1024] + vfmadd213pd ymm2, ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+960] + vfmadd213pd ymm1, ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+896] + vfmadd213pd ymm2, ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+832] + vfmadd213pd ymm1, ymm8, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+768] vmulpd ymm2, ymm8, ymm2 vmulpd ymm1, ymm8, ymm1 vfmadd213pd ymm2, ymm7, ymm7 @@ -1419,19 +1419,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_sinh4_ha_l9 ENDP +__jsvml_sinh4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh4_ha_l9_B1_B3: +_unwind___jsvml_sinh4_ha_l9_B1_B3: DD 1335809 DD 4379746 DD 1140826 @@ -1451,13 +1451,13 @@ _unwind___svml_sinh4_ha_l9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_sinh4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinh4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh4_ha_l9_B6_B10: +_unwind___jsvml_sinh4_ha_l9_B6_B10: DD 530977 DD 812058 DD 865299 @@ -1465,7 +1465,7 @@ _unwind___svml_sinh4_ha_l9_B6_B10: DD 313352 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_sinh4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinh4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1474,7 +1474,7 @@ _unwind___svml_sinh4_ha_l9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_sinh4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_sinh4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1488,9 +1488,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh2_ha_e9 + PUBLIC __jsvml_sinh2_ha_e9 -__svml_sinh2_ha_e9 PROC EXPORT +__jsvml_sinh2_ha_e9 PROC EXPORT _B8_1:: @@ -1511,17 +1511,17 @@ L164:: vmovups XMMWORD PTR [192+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd xmm0, XMMWORD PTR [__svml_dsinh_ha_data_internal+1408] + vmovupd xmm0, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 vandpd xmm1, xmm0, xmm2 vxorpd xmm7, xmm1, xmm2 - vmulpd xmm5, xmm7, XMMWORD PTR [__svml_dsinh_ha_data_internal+1216] - vmovupd xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+512] + vmulpd xmm5, xmm7, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1216] + vmovupd xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+512] vaddpd xmm5, xmm6, xmm5 - vcmpeqpd xmm13, xmm5, XMMWORD PTR [__svml_dsinh_ha_data_internal+576] + vcmpeqpd xmm13, xmm5, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+576] vblendvpd xmm13, xmm5, xmm6, xmm13 - vmovq xmm3, QWORD PTR [__svml_dsinh_ha_data_internal+640] - vpand xmm12, xmm13, XMMWORD PTR [__svml_dsinh_ha_data_internal+704] + vmovq xmm3, QWORD PTR [__jsvml_dsinh_ha_data_internal+640] + vpand xmm12, xmm13, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+704] vpshufd xmm4, xmm7, 221 vpcmpgtd xmm14, xmm4, xmm3 vpsllq xmm4, xmm12, 3 @@ -1532,16 +1532,16 @@ L164:: vpextrd ecx, xmm4, 2 movsxd rcx, ecx mov QWORD PTR [296+rsp], r13 - vmovsd xmm3, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+r8+rax] - vmovsd xmm5, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+r8+rax] - vmovhpd xmm11, xmm3, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+r8+rcx] - vmovhpd xmm3, xmm5, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+128+r8+rcx] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+r8+rax] + vmovsd xmm5, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+r8+rax] + vmovhpd xmm11, xmm3, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+r8+rcx] + vmovhpd xmm3, xmm5, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+128+r8+rcx] vsubpd xmm5, xmm13, xmm6 - vmulpd xmm6, xmm5, XMMWORD PTR [__svml_dsinh_ha_data_internal+1280] - vmulpd xmm5, xmm5, XMMWORD PTR [__svml_dsinh_ha_data_internal+1344] + vmulpd xmm6, xmm5, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1280] + vmulpd xmm5, xmm5, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1344] vsubpd xmm7, xmm7, xmm6 - vmovsd xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+r8+rax] - vmovhpd xmm14, xmm14, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+256+r8+rcx] + vmovsd xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+r8+rax] + vmovhpd xmm14, xmm14, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+256+r8+rcx] vsubpd xmm5, xmm7, xmm5 vpsllq xmm7, xmm12, 48 vpaddq xmm11, xmm11, xmm7 @@ -1551,26 +1551,26 @@ L164:: vaddpd xmm13, xmm11, xmm12 vmulpd xmm6, xmm5, xmm5 vsubpd xmm11, xmm14, xmm11 - vmovsd xmm4, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+r8+rax] - vmovhpd xmm4, xmm4, QWORD PTR [imagerel(__svml_dsinh_ha_data_internal)+384+r8+rcx] + vmovsd xmm4, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+r8+rax] + vmovhpd xmm4, xmm4, QWORD PTR [imagerel(__jsvml_dsinh_ha_data_internal)+384+r8+rcx] vandnpd xmm0, xmm0, xmm4 vcmpltpd xmm0, xmm0, xmm7 vpsubq xmm7, xmm4, xmm7 vandnpd xmm0, xmm0, xmm7 vaddpd xmm7, xmm12, xmm11 vsubpd xmm4, xmm3, xmm7 - vmulpd xmm3, xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+1152] + vmulpd xmm3, xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1152] vsubpd xmm7, xmm4, xmm0 - vmulpd xmm0, xmm6, XMMWORD PTR [__svml_dsinh_ha_data_internal+1088] - vaddpd xmm11, xmm0, XMMWORD PTR [__svml_dsinh_ha_data_internal+960] - vaddpd xmm0, xmm3, XMMWORD PTR [__svml_dsinh_ha_data_internal+1024] + vmulpd xmm0, xmm6, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1088] + vaddpd xmm11, xmm0, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+960] + vaddpd xmm0, xmm3, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+1024] vmulpd xmm12, xmm6, xmm11 vmulpd xmm3, xmm6, xmm0 - vaddpd xmm4, xmm12, XMMWORD PTR [__svml_dsinh_ha_data_internal+832] - vaddpd xmm11, xmm3, XMMWORD PTR [__svml_dsinh_ha_data_internal+896] + vaddpd xmm4, xmm12, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+832] + vaddpd xmm11, xmm3, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+896] vmulpd xmm4, xmm6, xmm4 vmulpd xmm12, xmm6, xmm11 - vaddpd xmm0, xmm12, XMMWORD PTR [__svml_dsinh_ha_data_internal+768] + vaddpd xmm0, xmm12, XMMWORD PTR [__jsvml_dsinh_ha_data_internal+768] vmulpd xmm6, xmm6, xmm0 vmulpd xmm0, xmm5, xmm13 vmulpd xmm5, xmm4, xmm0 @@ -1632,19 +1632,19 @@ _B8_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B8_8 ALIGN 16 _B8_11:: -__svml_sinh2_ha_e9 ENDP +__jsvml_sinh2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh2_ha_e9_B1_B3: +_unwind___jsvml_sinh2_ha_e9_B1_B3: DD 1070081 DD 2413652 DD 813132 @@ -1662,19 +1662,19 @@ _unwind___svml_sinh2_ha_e9_B1_B3: DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_sinh2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinh2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh2_ha_e9_B6_B10: +_unwind___jsvml_sinh2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_6 - DD imagerel _unwind___svml_sinh2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinh2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1683,7 +1683,7 @@ _unwind___svml_sinh2_ha_e9_B6_B10: DD imagerel _B8_6 DD imagerel _B8_11 - DD imagerel _unwind___svml_sinh2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_sinh2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1697,9 +1697,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinh8_ha_z0 + PUBLIC __jsvml_sinh8_ha_z0 -__svml_sinh8_ha_z0 PROC EXPORT +__jsvml_sinh8_ha_z0 PROC EXPORT _B9_1:: @@ -1715,20 +1715,20 @@ L183:: vmovups ZMMWORD PTR [1264+rsp], zmm6 mov QWORD PTR [1128+rsp], r13 lea r13, QWORD PTR [991+rsp] - vmovups zmm2, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1408] + vmovups zmm2, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1408] and r13, -64 - vmovups zmm26, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1216] - vmovups zmm27, ZMMWORD PTR [__svml_dsinh_ha_data_internal+512] - vmovups zmm31, ZMMWORD PTR [__svml_dsinh_ha_data_internal+576] - vmovups zmm29, ZMMWORD PTR [__svml_dsinh_ha_data_internal] - vmovups zmm30, ZMMWORD PTR [__svml_dsinh_ha_data_internal+256] - vmovups zmm25, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1024] - vmovups zmm4, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1152] - vmovups zmm3, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1088] - vmovups zmm6, ZMMWORD PTR [__svml_dsinh_ha_data_internal+896] - vmovups zmm24, ZMMWORD PTR [__svml_dsinh_ha_data_internal+960] - vmovups zmm8, ZMMWORD PTR [__svml_dsinh_ha_data_internal+768] - vmovups zmm5, ZMMWORD PTR [__svml_dsinh_ha_data_internal+832] + vmovups zmm26, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1216] + vmovups zmm27, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+512] + vmovups zmm31, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+576] + vmovups zmm29, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal] + vmovups zmm30, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+256] + vmovups zmm25, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1024] + vmovups zmm4, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1152] + vmovups zmm3, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1088] + vmovups zmm6, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+896] + vmovups zmm24, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+960] + vmovups zmm8, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+768] + vmovups zmm5, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+832] vmovaps zmm23, zmm0 vandpd zmm22, zmm2, zmm23 vxorpd zmm9, zmm22, zmm23 @@ -1737,23 +1737,23 @@ L183:: vcmppd k1, zmm31, zmm26, 0 {sae} vpmovqd ymm0, zmm28 vblendmpd zmm28{k1}, zmm26, zmm27 - vmovups zmm26, ZMMWORD PTR [__svml_dsinh_ha_data_internal+384] - vpcmpgtd ymm1, ymm0, YMMWORD PTR [__svml_dsinh_ha_data_internal+640] + vmovups zmm26, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+384] + vpcmpgtd ymm1, ymm0, YMMWORD PTR [__jsvml_dsinh_ha_data_internal+640] vmovmskps r8d, ymm1 - vmovups zmm1, ZMMWORD PTR [__svml_dsinh_ha_data_internal+128] + vmovups zmm1, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+128] mov QWORD PTR [1328+rsp], r13 - vpandq zmm0, zmm28, ZMMWORD PTR [__svml_dsinh_ha_data_internal+704] + vpandq zmm0, zmm28, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+704] vpxorq zmm31, zmm28, zmm0 - vpermt2pd zmm29, zmm0, ZMMWORD PTR [__svml_dsinh_ha_data_internal+64] - vpermt2pd zmm30, zmm0, ZMMWORD PTR [__svml_dsinh_ha_data_internal+320] - vpermt2pd zmm1, zmm0, ZMMWORD PTR [__svml_dsinh_ha_data_internal+192] - vpermt2pd zmm26, zmm0, ZMMWORD PTR [__svml_dsinh_ha_data_internal+448] + vpermt2pd zmm29, zmm0, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+64] + vpermt2pd zmm30, zmm0, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+320] + vpermt2pd zmm1, zmm0, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+192] + vpermt2pd zmm26, zmm0, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+448] vsubpd zmm0, zmm28, zmm27 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1280] + vmovups zmm27, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1280] vpsllq zmm28, zmm31, 48 vandnpd zmm2, zmm2, zmm26 vfnmadd231pd zmm9, zmm0, zmm27 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_dsinh_ha_data_internal+1344] + vmovups zmm27, ZMMWORD PTR [__jsvml_dsinh_ha_data_internal+1344] vcmppd k2, zmm2, zmm28, 17 {sae} vfnmadd231pd zmm9, zmm0, zmm27 {rn-sae} vpaddq zmm29, zmm29, zmm28 @@ -1908,19 +1908,19 @@ _B9_15:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dsinh_ha_cout_rare_internal + call __jsvml_dsinh_ha_cout_rare_internal jmp _B9_13 ALIGN 16 _B9_16:: -__svml_sinh8_ha_z0 ENDP +__jsvml_sinh8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh8_ha_z0_B1_B9: +_unwind___jsvml_sinh8_ha_z0_B1_B9: DD 668673 DD 9294900 DD 5204012 @@ -1935,13 +1935,13 @@ _unwind___svml_sinh8_ha_z0_B1_B9: DD imagerel _B9_1 DD imagerel _B9_11 - DD imagerel _unwind___svml_sinh8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_sinh8_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinh8_ha_z0_B11_B15: +_unwind___jsvml_sinh8_ha_z0_B11_B15: DD 2808865 DD 7558364 DD 7369937 @@ -1966,7 +1966,7 @@ _unwind___svml_sinh8_ha_z0_B11_B15: DD 7293707 DD imagerel _B9_1 DD imagerel _B9_11 - DD imagerel _unwind___svml_sinh8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_sinh8_ha_z0_B1_B9 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1975,7 +1975,7 @@ _unwind___svml_sinh8_ha_z0_B11_B15: DD imagerel _B9_11 DD imagerel _B9_16 - DD imagerel _unwind___svml_sinh8_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_sinh8_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1989,9 +1989,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dsinh_ha_cout_rare_internal + PUBLIC __jsvml_dsinh_ha_cout_rare_internal -__svml_dsinh_ha_cout_rare_internal PROC +__jsvml_dsinh_ha_cout_rare_internal PROC _B10_1:: @@ -2437,13 +2437,13 @@ _B10_17:: _B10_18:: -__svml_dsinh_ha_cout_rare_internal ENDP +__jsvml_dsinh_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dsinh_ha_cout_rare_internal_B1_B17: +_unwind___jsvml_dsinh_ha_cout_rare_internal_B1_B17: DD 1271297 DD 821350 DD 759901 @@ -2463,7 +2463,7 @@ _unwind___svml_dsinh_ha_cout_rare_internal_B1_B17: DD imagerel _B10_1 DD imagerel _B10_18 - DD imagerel _unwind___svml_dsinh_ha_cout_rare_internal_B1_B17 + DD imagerel _unwind___jsvml_dsinh_ha_cout_rare_internal_B1_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2471,8 +2471,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dsinh_ha_data_internal -__svml_dsinh_ha_data_internal DD 0 + PUBLIC __jsvml_dsinh_ha_data_internal +__jsvml_dsinh_ha_data_internal DD 0 DD 1071644672 DD 1828292879 DD 1071691096 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_tan_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_tan_windows_x86.S similarity index 89% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_tan_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_tan_windows_x86.S index 98de2886eac..3f6789593a2 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_tan_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_tan_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan1_ha_ex + PUBLIC __jsvml_tan1_ha_ex -__svml_tan1_ha_ex PROC EXPORT +__jsvml_tan1_ha_ex PROC EXPORT _B1_1:: @@ -63,17 +63,17 @@ L1:: movups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [184+rsp], r13 lea r13, QWORD PTR [111+rsp] - movsd xmm9, QWORD PTR [__svml_dtan_ha_data_internal+1024] + movsd xmm9, QWORD PTR [__jsvml_dtan_ha_data_internal+1024] and r13, -64 movaps xmm12, xmm9 andnps xmm9, xmm0 andps xmm12, xmm0 movaps xmm6, xmm12 movaps xmm2, xmm12 - mulsd xmm6, QWORD PTR [__svml_dtan_ha_data_internal+1472] + mulsd xmm6, QWORD PTR [__jsvml_dtan_ha_data_internal+1472] movaps xmm1, xmm12 - cmpnlesd xmm1, QWORD PTR [__svml_dtan_ha_data_internal+28160] - movsd xmm4, QWORD PTR [__svml_dtan_ha_data_internal+1152] + cmpnlesd xmm1, QWORD PTR [__jsvml_dtan_ha_data_internal+28160] + movsd xmm4, QWORD PTR [__jsvml_dtan_ha_data_internal+1152] movups XMMWORD PTR [352+rsp], xmm0 addsd xmm6, xmm4 movmskpd r8d, xmm1 @@ -82,12 +82,12 @@ L1:: subsd xmm0, xmm4 movaps xmm3, xmm0 movaps xmm5, xmm0 - mulsd xmm3, QWORD PTR [__svml_dtan_ha_data_internal+1216] - mulsd xmm5, QWORD PTR [__svml_dtan_ha_data_internal+1280] - mulsd xmm0, QWORD PTR [__svml_dtan_ha_data_internal+1344] + mulsd xmm3, QWORD PTR [__jsvml_dtan_ha_data_internal+1216] + mulsd xmm5, QWORD PTR [__jsvml_dtan_ha_data_internal+1280] + mulsd xmm0, QWORD PTR [__jsvml_dtan_ha_data_internal+1344] subsd xmm2, xmm3 movaps xmm8, xmm2 - movq xmm3, QWORD PTR [__svml_dtan_ha_data_internal+1408] + movq xmm3, QWORD PTR [__jsvml_dtan_ha_data_internal+1408] subsd xmm8, xmm5 pand xmm6, xmm3 movaps xmm4, xmm8 @@ -101,7 +101,7 @@ L1:: movaps xmm0, xmm15 lea rax, QWORD PTR [__ImageBase] addsd xmm4, xmm2 - movq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+rcx] + movq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+rcx] subsd xmm8, xmm4 movdqa xmm14, xmm10 addsd xmm2, xmm8 @@ -112,7 +112,7 @@ L1:: subsd xmm10, xmm4 subsd xmm14, xmm0 subsd xmm10, xmm2 - addsd xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+rcx] + addsd xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+rcx] movlhps xmm13, xmm13 addsd xmm10, xmm14 rcpps xmm11, xmm13 @@ -121,14 +121,14 @@ L1:: mulsd xmm0, xmm11 movups xmm13, XMMWORD PTR [_2il0floatpacket_28] movaps xmm14, xmm13 - movq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+rcx] + movq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+rcx] subsd xmm14, xmm0 movaps xmm0, xmm11 movaps xmm15, xmm14 mulsd xmm0, xmm14 mulsd xmm15, xmm14 addsd xmm0, xmm11 - mulsd xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] + mulsd xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] addsd xmm15, xmm13 mulsd xmm0, xmm15 mulsd xmm10, xmm0 @@ -138,41 +138,41 @@ L1:: movdqa xmm14, xmm8 subsd xmm10, xmm13 mulsd xmm14, xmm4 - addsd xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] + addsd xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] mulsd xmm10, xmm0 mulsd xmm8, xmm2 - mulsd xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] - movq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+rcx] + mulsd xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] + movq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+rcx] movdqa xmm13, xmm5 - movq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+rcx] addsd xmm13, xmm14 mulsd xmm6, xmm4 subsd xmm5, xmm13 - addsd xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+rcx] + addsd xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+rcx] addsd xmm5, xmm14 movaps xmm0, xmm13 addsd xmm5, xmm10 addsd xmm0, xmm11 - movq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+rcx] + movq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+rcx] movaps xmm10, xmm4 mulsd xmm7, xmm4 subsd xmm11, xmm0 mulsd xmm10, xmm4 addsd xmm11, xmm13 - addsd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+rcx] + addsd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+rcx] mulsd xmm6, xmm10 addsd xmm5, xmm11 - movq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+rcx] addsd xmm8, xmm5 mulsd xmm3, xmm4 - movq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+rcx] + movq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+rcx] mulsd xmm11, xmm10 - addsd xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] + addsd xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] mulsd xmm10, xmm10 addsd xmm11, xmm7 addsd xmm6, xmm3 mulsd xmm11, xmm10 - movq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+rcx] + movq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+rcx] addsd xmm11, xmm6 addsd xmm2, xmm8 mulsd xmm11, xmm4 @@ -225,7 +225,7 @@ _B1_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B1_5 _B1_8:: @@ -235,7 +235,7 @@ _B1_8:: pand xmm6, xmm12 psrlq xmm6, 52 movd ecx, xmm6 - movsd xmm15, QWORD PTR [__svml_dtan_ha_data_internal+1088] + movsd xmm15, QWORD PTR [__jsvml_dtan_ha_data_internal+1088] movdqu xmm2, XMMWORD PTR [_2il0floatpacket_30] andps xmm13, xmm15 pand xmm2, xmm12 @@ -249,13 +249,13 @@ _B1_8:: lea r8d, DWORD PTR [rcx+rcx*2] shl r8d, 3 pand xmm2, xmm10 - movq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r8] + movq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r8] movdqa xmm13, xmm3 movdqa xmm0, xmm9 movdqa xmm5, xmm2 psrlq xmm0, 32 pand xmm9, xmm10 - movq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r8] + movq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r8] movdqa xmm6, xmm2 pmuludq xmm13, xmm0 movdqa xmm8, xmm7 @@ -274,7 +274,7 @@ _B1_8:: pand xmm15, xmm5 psrlq xmm9, 32 paddq xmm15, xmm13 - movq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r8] + movq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r8] psrlq xmm5, 32 pand xmm14, xmm11 movdqa xmm4, xmm2 @@ -379,20 +379,20 @@ _B1_8:: cmplesd xmm13, xmm5 movsd xmm11, xmm0 andps xmm13, xmm12 - movq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+r10] + movq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+r10] andps xmm14, xmm11 orps xmm13, xmm14 movdqa xmm12, xmm10 movaps xmm0, xmm2 andps xmm11, xmm3 - movq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+r10] + movq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+r10] subsd xmm12, xmm13 andps xmm0, xmm12 subsd xmm10, xmm12 subsd xmm12, xmm0 cvtpd2ps xmm14, xmm0 subsd xmm10, xmm13 - addsd xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+r10] + addsd xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+r10] subsd xmm10, xmm11 movlhps xmm14, xmm14 addsd xmm10, xmm12 @@ -403,13 +403,13 @@ _B1_8:: movaps xmm15, xmm12 movups xmm14, XMMWORD PTR [_2il0floatpacket_28] movaps xmm2, xmm14 - movq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+r10] + movq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+r10] subsd xmm2, xmm0 movaps xmm0, xmm2 mulsd xmm15, xmm2 mulsd xmm0, xmm2 addsd xmm15, xmm12 - mulsd xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r10] + mulsd xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r10] addsd xmm0, xmm14 mulsd xmm15, xmm0 movdqa xmm0, xmm6 @@ -420,40 +420,40 @@ _B1_8:: movdqa xmm2, xmm9 subsd xmm10, xmm14 mulsd xmm2, xmm13 - addsd xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r10] + addsd xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r10] mulsd xmm10, xmm15 addsd xmm0, xmm2 mulsd xmm9, xmm11 - mulsd xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r10] + mulsd xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r10] subsd xmm6, xmm0 - movq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+r10] + movq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+r10] movaps xmm14, xmm0 - movq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+r10] + movq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+r10] addsd xmm6, xmm2 mulsd xmm3, xmm13 addsd xmm14, xmm12 mulsd xmm7, xmm13 addsd xmm6, xmm10 - addsd xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+r10] + addsd xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+r10] subsd xmm12, xmm14 - addsd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+r10] + addsd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+r10] addsd xmm12, xmm0 movaps xmm10, xmm13 movaps xmm0, xmm1 mulsd xmm10, xmm13 addsd xmm6, xmm12 - movq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+r10] + movq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+r10] addsd xmm9, xmm6 mulsd xmm4, xmm13 mulsd xmm3, xmm10 - addsd xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r10] - movq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+r10] + addsd xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r10] + movq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+r10] addsd xmm3, xmm4 mulsd xmm5, xmm10 mulsd xmm10, xmm10 addsd xmm5, xmm7 mulsd xmm5, xmm10 - movq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+r10] + movq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+r10] addsd xmm5, xmm3 addsd xmm8, xmm9 mulsd xmm5, xmm13 @@ -468,13 +468,13 @@ _B1_8:: _B1_9:: -__svml_tan1_ha_ex ENDP +__jsvml_tan1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan1_ha_ex_B1_B8: +_unwind___jsvml_tan1_ha_ex_B1_B8: DD 1600769 DD 1561709 DD 878693 @@ -496,7 +496,7 @@ _unwind___svml_tan1_ha_ex_B1_B8: DD imagerel _B1_1 DD imagerel _B1_9 - DD imagerel _unwind___svml_tan1_ha_ex_B1_B8 + DD imagerel _unwind___jsvml_tan1_ha_ex_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -510,9 +510,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan1_ha_e9 + PUBLIC __jsvml_tan1_ha_e9 -__svml_tan1_ha_e9 PROC EXPORT +__jsvml_tan1_ha_e9 PROC EXPORT _B2_1:: @@ -536,22 +536,22 @@ L30:: vmovups XMMWORD PTR [336+rsp], xmm6 mov QWORD PTR [184+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovsd xmm2, QWORD PTR [__svml_dtan_ha_data_internal+1024] + vmovsd xmm2, QWORD PTR [__jsvml_dtan_ha_data_internal+1024] and r13, -64 vandpd xmm1, xmm0, xmm2 vandnpd xmm12, xmm2, xmm0 - vmulsd xmm3, xmm1, QWORD PTR [__svml_dtan_ha_data_internal+1472] - vcmpnlesd xmm2, xmm1, QWORD PTR [__svml_dtan_ha_data_internal+28160] - vmovsd xmm8, QWORD PTR [__svml_dtan_ha_data_internal+1152] + vmulsd xmm3, xmm1, QWORD PTR [__jsvml_dtan_ha_data_internal+1472] + vcmpnlesd xmm2, xmm1, QWORD PTR [__jsvml_dtan_ha_data_internal+28160] + vmovsd xmm8, QWORD PTR [__jsvml_dtan_ha_data_internal+1152] vmovupd XMMWORD PTR [352+rsp], xmm0 vaddsd xmm9, xmm3, xmm8 vmovmskpd r8d, xmm2 - vmovq xmm3, QWORD PTR [__svml_dtan_ha_data_internal+1408] + vmovq xmm3, QWORD PTR [__jsvml_dtan_ha_data_internal+1408] vsubsd xmm14, xmm9, xmm8 - vmulsd xmm11, xmm14, QWORD PTR [__svml_dtan_ha_data_internal+1216] + vmulsd xmm11, xmm14, QWORD PTR [__jsvml_dtan_ha_data_internal+1216] vpand xmm9, xmm9, xmm3 - vmulsd xmm10, xmm14, QWORD PTR [__svml_dtan_ha_data_internal+1280] - vmulsd xmm5, xmm14, QWORD PTR [__svml_dtan_ha_data_internal+1344] + vmulsd xmm10, xmm14, QWORD PTR [__jsvml_dtan_ha_data_internal+1280] + vmulsd xmm5, xmm14, QWORD PTR [__jsvml_dtan_ha_data_internal+1344] vsubsd xmm13, xmm1, xmm11 vpand xmm8, xmm9, XMMWORD PTR [_2il0floatpacket_26] vsubsd xmm6, xmm13, xmm10 @@ -563,70 +563,70 @@ L30:: vsubsd xmm15, xmm4, xmm10 lea rax, QWORD PTR [__ImageBase] vsubsd xmm7, xmm15, xmm5 - vmovq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+rcx] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+rcx] vaddsd xmm11, xmm6, xmm7 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+rcx] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+rcx] vsubsd xmm0, xmm6, xmm11 - vmovq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+rcx] vaddsd xmm10, xmm7, xmm0 vsubsd xmm0, xmm13, xmm11 vandpd xmm15, xmm0, xmm8 vsubsd xmm14, xmm13, xmm0 vsubsd xmm0, xmm0, xmm15 vsubsd xmm3, xmm14, xmm11 - vaddsd xmm14, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+rcx] + vaddsd xmm14, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+rcx] vsubsd xmm13, xmm3, xmm10 - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+rcx] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+rcx] vaddsd xmm3, xmm13, xmm14 vmulsd xmm6, xmm6, xmm11 vcvtpd2ps xmm13, xmm15 - vaddsd xmm6, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+rcx] + vaddsd xmm6, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+rcx] vmovlhps xmm14, xmm13, xmm13 vrcpps xmm0, xmm14 vcvtps2pd xmm13, xmm0 vandpd xmm0, xmm13, xmm8 vmulsd xmm15, xmm15, xmm0 vmovupd xmm14, XMMWORD PTR [_2il0floatpacket_28] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+rcx] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+rcx] vsubsd xmm13, xmm14, xmm15 vmulsd xmm7, xmm7, xmm11 vmulsd xmm8, xmm0, xmm13 vmulsd xmm15, xmm13, xmm13 vaddsd xmm8, xmm8, xmm0 vaddsd xmm14, xmm15, xmm14 - vmulsd xmm15, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] + vmulsd xmm15, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] vmulsd xmm0, xmm9, xmm11 vmulsd xmm8, xmm8, xmm14 vmulsd xmm3, xmm3, xmm8 - vmovq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+rcx] vsubsd xmm14, xmm3, xmm13 vmulsd xmm13, xmm3, xmm3 vmulsd xmm5, xmm5, xmm11 vsubsd xmm13, xmm13, xmm14 vaddsd xmm14, xmm4, xmm0 - vaddsd xmm5, xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] + vaddsd xmm5, xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] vmulsd xmm8, xmm13, xmm8 vsubsd xmm4, xmm4, xmm14 - vmulsd xmm13, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] + vmulsd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] vaddsd xmm8, xmm14, xmm15 vaddsd xmm4, xmm4, xmm0 - vaddsd xmm0, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+rcx] + vaddsd xmm0, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+rcx] vsubsd xmm15, xmm15, xmm8 vaddsd xmm13, xmm4, xmm13 vaddsd xmm14, xmm15, xmm14 vmulsd xmm15, xmm11, xmm11 vmulsd xmm3, xmm6, xmm15 vaddsd xmm4, xmm13, xmm14 - vaddsd xmm14, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] + vaddsd xmm14, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] vaddsd xmm5, xmm3, xmm5 vmulsd xmm10, xmm14, xmm10 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+rcx] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+rcx] vaddsd xmm3, xmm10, xmm4 vmulsd xmm13, xmm9, xmm15 vmulsd xmm15, xmm15, xmm15 vaddsd xmm13, xmm13, xmm0 vmulsd xmm13, xmm13, xmm15 - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+rcx] vaddsd xmm4, xmm13, xmm5 vaddsd xmm6, xmm0, xmm3 vmulsd xmm11, xmm4, xmm11 @@ -679,7 +679,7 @@ _B2_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B2_5 _B2_8:: @@ -687,7 +687,7 @@ _B2_8:: vpand xmm13, xmm1, XMMWORD PTR [_2il0floatpacket_29] vpsrlq xmm8, xmm13, 52 vmovd ecx, xmm8 - vmovsd xmm5, QWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovsd xmm5, QWORD PTR [__jsvml_dtan_ha_data_internal+1088] vandpd xmm14, xmm5, xmm1 vpand xmm3, xmm1, XMMWORD PTR [_2il0floatpacket_30] vcmpeqsd xmm6, xmm14, xmm5 @@ -700,8 +700,8 @@ _B2_8:: and edx, 1 lea r8d, DWORD PTR [rcx+rcx*2] shl r8d, 3 - vmovq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r8] - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r8] vpand xmm7, xmm13, xmm14 vpsrlq xmm6, xmm0, 32 vpand xmm4, xmm0, xmm14 @@ -720,7 +720,7 @@ _B2_8:: vpaddq xmm13, xmm13, xmm0 vpaddq xmm0, xmm4, xmm3 vpaddq xmm7, xmm7, xmm13 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r8] vpand xmm9, xmm12, xmm14 vpsrlq xmm12, xmm12, 32 vpmuludq xmm10, xmm8, xmm9 @@ -802,17 +802,17 @@ _B2_8:: vpand xmm13, xmm1, XMMWORD PTR [_2il0floatpacket_26] vmovd r9d, xmm13 imul r10d, r9d, 104 - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+r10] - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+r10] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+r10] vsubsd xmm1, xmm3, xmm5 vandpd xmm4, xmm1, xmm15 vsubsd xmm0, xmm3, xmm1 vsubsd xmm1, xmm1, xmm4 vsubsd xmm14, xmm0, xmm5 - vaddsd xmm0, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+r10] + vaddsd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+r10] vcvtpd2ps xmm1, xmm4 vsubsd xmm3, xmm14, xmm8 - vmovq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+r10] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+r10] vaddsd xmm14, xmm3, xmm0 vmovlhps xmm3, xmm1, xmm1 vrcpps xmm0, xmm3 @@ -820,7 +820,7 @@ _B2_8:: vandpd xmm1, xmm1, xmm15 vmulsd xmm4, xmm4, xmm1 vmovupd xmm15, XMMWORD PTR [_2il0floatpacket_28] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+r10] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+r10] vsubsd xmm0, xmm15, xmm4 vmulsd xmm7, xmm7, xmm5 vmulsd xmm3, xmm1, xmm0 @@ -831,16 +831,16 @@ _B2_8:: vmulsd xmm3, xmm14, xmm4 vmulsd xmm15, xmm3, xmm3 vsubsd xmm0, xmm3, xmm0 - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+r10] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+r10] vsubsd xmm14, xmm15, xmm0 - vmulsd xmm0, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r10] + vmulsd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r10] vmulsd xmm10, xmm10, xmm5 vmulsd xmm4, xmm14, xmm4 vmulsd xmm14, xmm11, xmm5 - vmulsd xmm3, xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r10] - vaddsd xmm4, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+r10] + vmulsd xmm3, xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r10] + vaddsd xmm4, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+r10] vaddsd xmm15, xmm13, xmm14 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+r10] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+r10] vsubsd xmm13, xmm13, xmm15 vmulsd xmm9, xmm9, xmm5 vaddsd xmm1, xmm15, xmm0 @@ -848,21 +848,21 @@ _B2_8:: vsubsd xmm0, xmm0, xmm1 vaddsd xmm3, xmm13, xmm3 vaddsd xmm15, xmm0, xmm15 - vaddsd xmm0, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r10] - vaddsd xmm7, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+r10] + vaddsd xmm0, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r10] + vaddsd xmm7, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+r10] vaddsd xmm13, xmm3, xmm15 vmulsd xmm15, xmm5, xmm5 - vaddsd xmm3, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r10] + vaddsd xmm3, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r10] vmulsd xmm4, xmm4, xmm15 vmulsd xmm3, xmm3, xmm8 vaddsd xmm0, xmm4, xmm0 vaddsd xmm10, xmm3, xmm13 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+r10] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+r10] vmulsd xmm11, xmm12, xmm15 vmulsd xmm15, xmm15, xmm15 vaddsd xmm9, xmm11, xmm7 vmulsd xmm8, xmm9, xmm15 - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+r10] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+r10] vaddsd xmm12, xmm8, xmm0 vaddsd xmm6, xmm6, xmm10 vmulsd xmm5, xmm12, xmm5 @@ -876,13 +876,13 @@ _B2_8:: _B2_9:: -__svml_tan1_ha_e9 ENDP +__jsvml_tan1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan1_ha_e9_B1_B8: +_unwind___jsvml_tan1_ha_e9_B1_B8: DD 1601281 DD 1561711 DD 1402983 @@ -904,7 +904,7 @@ _unwind___svml_tan1_ha_e9_B1_B8: DD imagerel _B2_1 DD imagerel _B2_9 - DD imagerel _unwind___svml_tan1_ha_e9_B1_B8 + DD imagerel _unwind___jsvml_tan1_ha_e9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -918,9 +918,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan4_ha_e9 + PUBLIC __jsvml_tan4_ha_e9 -__svml_tan4_ha_e9 PROC EXPORT +__jsvml_tan4_ha_e9 PROC EXPORT _B3_1:: @@ -947,24 +947,24 @@ L59:: vmovdqu xmm6, XMMWORD PTR [_2il0floatpacket_26] mov QWORD PTR [816+rbp], r13 lea r13, QWORD PTR [239+rbp] - vmovupd ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+1024] + vmovupd ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1024] and r13, -64 - vmovupd ymm10, YMMWORD PTR [__svml_dtan_ha_data_internal+1152] + vmovupd ymm10, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1152] vmovupd YMMWORD PTR [128+r13], ymm0 vandpd ymm9, ymm0, ymm5 - vmulpd ymm14, ymm9, YMMWORD PTR [__svml_dtan_ha_data_internal+1472] + vmulpd ymm14, ymm9, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1472] vmovupd YMMWORD PTR [224+r13], ymm9 - vcmpnle_uqpd ymm13, ymm9, YMMWORD PTR [__svml_dtan_ha_data_internal+28160] + vcmpnle_uqpd ymm13, ymm9, YMMWORD PTR [__jsvml_dtan_ha_data_internal+28160] vaddpd ymm8, ymm10, ymm14 vmovupd YMMWORD PTR [160+r13], ymm13 vandnpd ymm15, ymm5, ymm0 vsubpd ymm5, ymm8, ymm10 vmovupd YMMWORD PTR [192+r13], ymm15 - vmulpd ymm4, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+1216] - vmulpd ymm1, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+1280] - vmulpd ymm7, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+1344] + vmulpd ymm4, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1216] + vmulpd ymm1, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1280] + vmulpd ymm7, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1344] vsubpd ymm3, ymm9, ymm4 - vmovupd xmm9, XMMWORD PTR [__svml_dtan_ha_data_internal+1408] + vmovupd xmm9, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1408] mov QWORD PTR [824+rbp], r13 vextractf128 xmm12, ymm13, 1 vshufps xmm11, xmm13, xmm12, 221 @@ -989,77 +989,77 @@ L59:: vpextrd r10d, xmm3, 2 lea rdx, QWORD PTR [__ImageBase] imul r8d, r10d, 104 - vmovq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+r9] - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+rcx] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+r9] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+rcx] vpextrd r10d, xmm0, 2 imul r11d, r10d, 104 - vmovhpd xmm12, xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+r8] - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+r9] - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+r9] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+rcx] - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+r11] - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+rcx] - vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+r8] - vmovhpd xmm9, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+r8] - vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+r11] - vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+r11] - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+r9] - vmovhpd xmm7, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+r8] + vmovhpd xmm12, xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+r8] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+r9] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+r9] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+rcx] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+r11] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+rcx] + vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+r8] + vmovhpd xmm9, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+r8] + vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+r11] + vmovhpd xmm3, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+r11] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+r9] + vmovhpd xmm7, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+r8] vinsertf128 ymm0, ymm12, xmm14, 1 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+r9] - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+rcx] - vmovhpd xmm11, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+r8] - vmovhpd xmm10, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+r11] - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+r9] - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+rcx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+rcx] + vmovhpd xmm11, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+r8] + vmovhpd xmm10, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+r11] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+rcx] vinsertf128 ymm4, ymm1, xmm8, 1 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+rcx] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+rcx] vinsertf128 ymm6, ymm9, xmm3, 1 vinsertf128 ymm9, ymm11, xmm10, 1 - vmovhpd xmm11, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+r8] - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+r9] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+rcx] - vmovhpd xmm10, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+r11] - vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+r11] + vmovhpd xmm11, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+r8] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+rcx] + vmovhpd xmm10, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+r11] + vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+r11] vmovups YMMWORD PTR [32+r13], ymm9 - vmovhpd xmm2, xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+r8] - vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+r11] - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+r9] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+rcx] - vmovhpd xmm3, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+r8] + vmovhpd xmm2, xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+r8] + vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+r11] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+rcx] + vmovhpd xmm3, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+r8] vinsertf128 ymm12, ymm11, xmm10, 1 - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+r9] - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+rcx] - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+r8] - vmovhpd xmm9, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+r11] - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+r9] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+rcx] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+r8] + vmovhpd xmm9, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+r11] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+rcx] vinsertf128 ymm7, ymm7, xmm13, 1 vinsertf128 ymm13, ymm2, xmm8, 1 - vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+r11] - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+r9] - vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+r8] + vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+r11] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+r9] + vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+r8] vinsertf128 ymm8, ymm3, xmm8, 1 vinsertf128 ymm10, ymm14, xmm9, 1 - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+r11] - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+r9] - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+rcx] - vmovhpd xmm2, xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+r8] - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+r9] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+r11] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+r9] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+rcx] + vmovhpd xmm2, xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+r8] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+r9] vmulpd ymm8, ymm8, ymm15 vaddpd ymm8, ymm12, ymm8 vinsertf128 ymm9, ymm1, xmm14, 1 - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+r11] - vmovhpd xmm1, xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+r8] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+r11] + vmovhpd xmm1, xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+r8] vmulpd ymm9, ymm9, ymm15 vaddpd ymm10, ymm10, ymm9 vinsertf128 ymm11, ymm2, xmm14, 1 - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+rcx] - vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+r11] - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+rcx] + vmovhpd xmm3, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+r11] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+r9] vinsertf128 ymm14, ymm1, xmm3, 1 - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+r8] - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+rcx] - vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+r11] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+r8] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+rcx] + vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+r11] vmovupd ymm2, YMMWORD PTR [_2il0floatpacket_46] vmulpd ymm14, ymm14, ymm15 vaddpd ymm11, ymm11, ymm14 @@ -1184,12 +1184,12 @@ _B3_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B3_9 _B3_12:: - vmovupd ymm14, YMMWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovupd ymm14, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1088] vmovdqu xmm6, XMMWORD PTR [_2il0floatpacket_29] vmovupd YMMWORD PTR [224+r13], ymm7 vmovupd YMMWORD PTR [r13], ymm0 @@ -1211,18 +1211,18 @@ _B3_12:: lea r10d, DWORD PTR [r10+r10*2] shl r9d, 3 shl r10d, 3 - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rdx+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rdx+r9] lea r11d, DWORD PTR [rcx+rcx*2] shl r11d, 3 lea ecx, DWORD PTR [r8+r8*2] shl ecx, 3 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rdx+r9] - vmovq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rdx+r10] - vmovhpd xmm1, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rdx+r11] - vmovhpd xmm9, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rdx+r11] - vmovq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rdx+r9] - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rdx+r10] - vmovhpd xmm2, xmm5, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rdx+r11] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rdx+r9] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rdx+r10] + vmovhpd xmm1, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rdx+r11] + vmovhpd xmm9, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rdx+r11] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rdx+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rdx+r10] + vmovhpd xmm2, xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rdx+r11] vmovupd XMMWORD PTR [32+rbp], xmm2 vextractf128 xmm13, ymm8, 1 vshufps xmm10, xmm8, xmm13, 221 @@ -1232,13 +1232,13 @@ _B3_12:: vpand xmm11, xmm10, xmm11 vpaddq xmm14, xmm7, xmm15 vpaddq xmm6, xmm11, xmm15 - vmovhpd xmm13, xmm4, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rdx+rcx] + vmovhpd xmm13, xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rdx+rcx] vpsrlq xmm10, xmm14, 32 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rdx+r10] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rdx+r10] vmovdqu xmm15, XMMWORD PTR [_2il0floatpacket_32] - vmovhpd xmm4, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rdx+rcx] + vmovhpd xmm4, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rdx+rcx] vpand xmm12, xmm13, xmm15 - vmovhpd xmm3, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rdx+rcx] + vmovhpd xmm3, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rdx+rcx] vpsrlq xmm8, xmm9, 32 vpand xmm5, xmm9, xmm15 vpand xmm9, xmm14, xmm15 @@ -1431,77 +1431,77 @@ _B3_12:: vmovd ecx, xmm9 imul r9d, r9d, 104 imul ecx, ecx, 104 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+r9] - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+r9] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+r9] vpextrd r11d, xmm7, 2 vpextrd r10d, xmm9, 2 imul r8d, r11d, 104 imul r11d, r10d, 104 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+rcx] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+rcx] - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+r9] - vmovhpd xmm14, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+r8] - vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rdx+r11] - vmovhpd xmm2, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+r8] - vmovhpd xmm11, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rdx+r11] - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+rcx] - vmovhpd xmm15, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+r8] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+r9] - vmovhpd xmm0, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rdx+r11] - vmovhpd xmm9, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+r8] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+rcx] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+rcx] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+r9] + vmovhpd xmm14, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+r8] + vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rdx+r11] + vmovhpd xmm2, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+r8] + vmovhpd xmm11, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rdx+r11] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+rcx] + vmovhpd xmm15, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+r8] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+r9] + vmovhpd xmm0, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rdx+r11] + vmovhpd xmm9, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+r8] vinsertf128 ymm1, ymm14, xmm13, 1 - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+r9] - vmovq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+rcx] - vmovhpd xmm8, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+r8] - vmovhpd xmm10, xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rdx+r11] - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+r9] - vmovq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+r9] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+rcx] + vmovhpd xmm8, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+r8] + vmovhpd xmm10, xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rdx+r11] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+r9] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+rcx] vinsertf128 ymm2, ymm2, xmm11, 1 - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+rcx] - vmovhpd xmm12, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rdx+r11] - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+rcx] + vmovhpd xmm12, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rdx+r11] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+rcx] vinsertf128 ymm6, ymm15, xmm0, 1 - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+r9] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+r9] vinsertf128 ymm15, ymm8, xmm10, 1 vinsertf128 ymm7, ymm9, xmm12, 1 - vmovhpd xmm9, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+r8] - vmovhpd xmm12, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rdx+r11] + vmovhpd xmm9, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+r8] + vmovhpd xmm12, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rdx+r11] vmovups YMMWORD PTR [64+r13], ymm15 - vmovhpd xmm8, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+r8] - vmovq xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+r9] - vmovhpd xmm10, xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rdx+r11] - vmovhpd xmm0, xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+r8] + vmovhpd xmm8, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+r9] + vmovhpd xmm10, xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rdx+r11] + vmovhpd xmm0, xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+r8] vinsertf128 ymm11, ymm9, xmm12, 1 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+rcx] - vmovhpd xmm14, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rdx+r11] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+rcx] + vmovhpd xmm14, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rdx+r11] vinsertf128 ymm12, ymm8, xmm10, 1 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+r9] - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+rcx] - vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+r8] - vmovhpd xmm15, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rdx+r11] - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+rcx] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+r9] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+rcx] + vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+r8] + vmovhpd xmm15, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rdx+r11] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+rcx] vinsertf128 ymm9, ymm0, xmm14, 1 - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+r9] - vmovhpd xmm8, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+r8] - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+r9] - vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+r8] - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+r9] + vmovhpd xmm8, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+r9] + vmovhpd xmm14, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+r9] vmulpd ymm9, ymm4, ymm9 vaddpd ymm9, ymm12, ymm9 vinsertf128 ymm13, ymm13, xmm15, 1 - vmovhpd xmm15, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rdx+r11] + vmovhpd xmm15, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rdx+r11] vinsertf128 ymm10, ymm8, xmm15, 1 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+rcx] - vmovhpd xmm15, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rdx+r11] - vmovhpd xmm8, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+r8] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+rcx] + vmovhpd xmm15, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rdx+r11] + vmovhpd xmm8, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+r8] vinsertf128 ymm14, ymm14, xmm15, 1 - vmovq xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+rcx] - vmovhpd xmm0, xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rdx+r11] - vmovq xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+r9] - vmovhpd xmm15, xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+rcx] + vmovhpd xmm0, xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rdx+r11] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+r9] + vmovhpd xmm15, xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+r8] vinsertf128 ymm8, ymm8, xmm0, 1 - vmovq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+rcx] - vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rdx+r11] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+rcx] + vmovhpd xmm0, xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rdx+r11] vmulpd ymm8, ymm4, ymm8 vaddpd ymm14, ymm14, ymm8 vinsertf128 ymm15, ymm15, xmm0, 1 @@ -1568,13 +1568,13 @@ _B3_12:: _B3_13:: -__svml_tan4_ha_e9 ENDP +__jsvml_tan4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan4_ha_e9_B1_B4: +_unwind___jsvml_tan4_ha_e9_B1_B4: DD 622490113 DD 7001202 DD 3369059 @@ -1597,19 +1597,19 @@ _unwind___svml_tan4_ha_e9_B1_B4: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_tan4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_tan4_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan4_ha_e9_B7_B11: +_unwind___jsvml_tan4_ha_e9_B7_B11: DD 621022241 DD 287756 DD 340998 DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_tan4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_tan4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1618,17 +1618,17 @@ _unwind___svml_tan4_ha_e9_B7_B11: DD imagerel _B3_7 DD imagerel _B3_12 - DD imagerel _unwind___svml_tan4_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_tan4_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan4_ha_e9_B12_B12: +_unwind___jsvml_tan4_ha_e9_B12_B12: DD 620757025 DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_tan4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_tan4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1637,7 +1637,7 @@ _unwind___svml_tan4_ha_e9_B12_B12: DD imagerel _B3_12 DD imagerel _B3_13 - DD imagerel _unwind___svml_tan4_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_tan4_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1651,9 +1651,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan1_ha_l9 + PUBLIC __jsvml_tan1_ha_l9 -__svml_tan1_ha_l9 PROC EXPORT +__jsvml_tan1_ha_l9 PROC EXPORT _B4_1:: @@ -1679,20 +1679,20 @@ L135:: vmovups XMMWORD PTR [368+rsp], xmm6 mov QWORD PTR [216+rsp], r13 lea r13, QWORD PTR [143+rsp] - vmovsd xmm2, QWORD PTR [__svml_dtan_ha_data_internal+1152] + vmovsd xmm2, QWORD PTR [__jsvml_dtan_ha_data_internal+1152] and r13, -64 - vfmadd132sd xmm0, xmm2, QWORD PTR [__svml_dtan_ha_data_internal] - vmovsd xmm5, QWORD PTR [__svml_dtan_ha_data_internal+256] - vmovsd xmm1, QWORD PTR [__svml_dtan_ha_data_internal+1024] + vfmadd132sd xmm0, xmm2, QWORD PTR [__jsvml_dtan_ha_data_internal] + vmovsd xmm5, QWORD PTR [__jsvml_dtan_ha_data_internal+256] + vmovsd xmm1, QWORD PTR [__jsvml_dtan_ha_data_internal+1024] vandpd xmm8, xmm14, xmm1 - vcmpnlesd xmm13, xmm8, QWORD PTR [__svml_dtan_ha_data_internal+28160] + vcmpnlesd xmm13, xmm8, QWORD PTR [__jsvml_dtan_ha_data_internal+28160] vsubsd xmm7, xmm0, xmm2 vmovmskpd ecx, xmm13 vmovapd xmm3, xmm7 vmovapd xmm4, xmm7 - vmovsd xmm2, QWORD PTR [__svml_dtan_ha_data_internal+320] + vmovsd xmm2, QWORD PTR [__jsvml_dtan_ha_data_internal+320] vmovapd xmm1, xmm7 - vfnmadd132sd xmm3, xmm14, QWORD PTR [__svml_dtan_ha_data_internal+64] + vfnmadd132sd xmm3, xmm14, QWORD PTR [__jsvml_dtan_ha_data_internal+64] vmovapd xmm6, xmm7 vfnmadd213sd xmm4, xmm5, xmm3 vfnmadd213sd xmm1, xmm2, xmm4 @@ -1709,19 +1709,19 @@ _B4_2:: vmulsd xmm7, xmm1, xmm1 vpsllq xmm4, xmm0, 3 - vmovsd xmm6, QWORD PTR [__svml_dtan_ha_data_internal+896] - vfmadd213sd xmm6, xmm7, QWORD PTR [__svml_dtan_ha_data_internal+832] + vmovsd xmm6, QWORD PTR [__jsvml_dtan_ha_data_internal+896] + vfmadd213sd xmm6, xmm7, QWORD PTR [__jsvml_dtan_ha_data_internal+832] vpand xmm5, xmm4, XMMWORD PTR [_2il0floatpacket_58] vmovd ecx, xmm5 - vmovsd xmm5, QWORD PTR [__svml_dtan_ha_data_internal+960] - vfmadd213sd xmm6, xmm7, QWORD PTR [__svml_dtan_ha_data_internal+768] - vfmadd213sd xmm6, xmm7, QWORD PTR [__svml_dtan_ha_data_internal+704] - vfmadd213sd xmm6, xmm7, QWORD PTR [__svml_dtan_ha_data_internal+640] + vmovsd xmm5, QWORD PTR [__jsvml_dtan_ha_data_internal+960] + vfmadd213sd xmm6, xmm7, QWORD PTR [__jsvml_dtan_ha_data_internal+768] + vfmadd213sd xmm6, xmm7, QWORD PTR [__jsvml_dtan_ha_data_internal+704] + vfmadd213sd xmm6, xmm7, QWORD PTR [__jsvml_dtan_ha_data_internal+640] vmulsd xmm9, xmm6, xmm1 vfnmsub213sd xmm9, xmm7, xmm10 movsxd rcx, ecx vsubsd xmm0, xmm1, xmm9 - vmovsd xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+rdx+rcx] + vmovsd xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+rdx+rcx] vsubsd xmm8, xmm1, xmm0 vaddsd xmm1, xmm0, xmm2 vsubsd xmm15, xmm8, xmm9 @@ -1731,7 +1731,7 @@ _B4_2:: vfnmadd213sd xmm6, xmm0, xmm5 vsubsd xmm11, xmm0, xmm10 vdivsd xmm8, xmm5, xmm6 - vmovsd xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+rdx+rcx] + vmovsd xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+rdx+rcx] vsubsd xmm13, xmm6, xmm5 vaddsd xmm12, xmm11, xmm3 vfmadd213sd xmm4, xmm0, xmm13 @@ -1790,7 +1790,7 @@ _B4_7:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B4_5 _B4_8:: @@ -1800,7 +1800,7 @@ _B4_8:: vpsrlq xmm1, xmm15, 52 vmovd ecx, xmm1 vmovupd XMMWORD PTR [64+rsp], xmm10 - vmovsd xmm10, QWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovsd xmm10, QWORD PTR [__jsvml_dtan_ha_data_internal+1088] vandpd xmm6, xmm10, xmm8 vmovupd XMMWORD PTR [32+rsp], xmm0 lea r8d, DWORD PTR [rcx+rcx*2] @@ -1813,11 +1813,11 @@ _B4_8:: vpand xmm6, xmm8, xmm12 shl r8d, 3 and eax, 1 - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rdx+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rdx+r8] vpand xmm15, xmm11, xmm12 vpsrlq xmm0, xmm11, 32 vpmuludq xmm11, xmm9, xmm15 - vmovq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rdx+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rdx+r8] vpsrlq xmm15, xmm11, 32 vpmuludq xmm11, xmm9, xmm0 vpand xmm2, xmm5, xmm12 @@ -1831,7 +1831,7 @@ _B4_8:: vpmuludq xmm4, xmm9, xmm4 vpand xmm5, xmm1, xmm12 vpsrlq xmm1, xmm1, 32 - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rdx+r8] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rdx+r8] vpand xmm0, xmm3, xmm12 vpaddq xmm5, xmm5, xmm11 vpand xmm7, xmm10, xmm12 @@ -1933,13 +1933,13 @@ _B4_8:: _B4_9:: -__svml_tan1_ha_l9 ENDP +__jsvml_tan1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan1_ha_l9_B1_B8: +_unwind___jsvml_tan1_ha_l9_B1_B8: DD 1604097 DD 1823866 DD 1534066 @@ -1961,7 +1961,7 @@ _unwind___svml_tan1_ha_l9_B1_B8: DD imagerel _B4_1 DD imagerel _B4_9 - DD imagerel _unwind___svml_tan1_ha_l9_B1_B8 + DD imagerel _unwind___jsvml_tan1_ha_l9_B1_B8 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1975,9 +1975,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan8_ha_z0 + PUBLIC __jsvml_tan8_ha_z0 -__svml_tan8_ha_z0 PROC EXPORT +__jsvml_tan8_ha_z0 PROC EXPORT _B5_1:: @@ -1996,14 +1996,14 @@ L164:: lea r13, QWORD PTR [991+rsp] vmovaps zmm4, zmm0 and r13, -64 - vmovups zmm0, ZMMWORD PTR [__svml_dtan_ha_data_internal] - vmovups zmm1, ZMMWORD PTR [__svml_dtan_ha_data_internal+1152] - vmovups zmm2, ZMMWORD PTR [__svml_dtan_ha_data_internal+64] - vmovups zmm22, ZMMWORD PTR [__svml_dtan_ha_data_internal+256] - vmovups zmm3, ZMMWORD PTR [__svml_dtan_ha_data_internal+28160] - vmovups zmm23, ZMMWORD PTR [__svml_dtan_ha_data_internal+320] + vmovups zmm0, ZMMWORD PTR [__jsvml_dtan_ha_data_internal] + vmovups zmm1, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+1152] + vmovups zmm2, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+64] + vmovups zmm22, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+256] + vmovups zmm3, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+28160] + vmovups zmm23, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+320] vfmadd213pd zmm0, zmm4, zmm1 {rn-sae} - vandpd zmm6, zmm4, ZMMWORD PTR [__svml_dtan_ha_data_internal+1024] + vandpd zmm6, zmm4, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+1024] vsubpd zmm26, zmm0, zmm1 {rn-sae} vcmppd k1, zmm6, zmm3, 22 {sae} vfnmadd213pd zmm2, zmm26, zmm4 {rn-sae} @@ -2023,16 +2023,16 @@ L164:: _B5_2:: vmulpd zmm23, zmm3, zmm3 {rn-sae} - vmovups zmm5, ZMMWORD PTR [__svml_dtan_ha_data_internal+384] - vmovups zmm1, ZMMWORD PTR [__svml_dtan_ha_data_internal+512] - vmovups zmm22, ZMMWORD PTR [__svml_dtan_ha_data_internal+832] - vmovups zmm6, ZMMWORD PTR [__svml_dtan_ha_data_internal+768] - vmovups zmm14, ZMMWORD PTR [__svml_dtan_ha_data_internal+704] - vmovups zmm15, ZMMWORD PTR [__svml_dtan_ha_data_internal+640] - vmovups zmm30, ZMMWORD PTR [__svml_dtan_ha_data_internal+960] - vpermt2pd zmm5, zmm0, ZMMWORD PTR [__svml_dtan_ha_data_internal+448] - vpermt2pd zmm1, zmm0, ZMMWORD PTR [__svml_dtan_ha_data_internal+576] - vmovups zmm0, ZMMWORD PTR [__svml_dtan_ha_data_internal+896] + vmovups zmm5, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+384] + vmovups zmm1, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+512] + vmovups zmm22, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+832] + vmovups zmm6, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+768] + vmovups zmm14, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+704] + vmovups zmm15, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+640] + vmovups zmm30, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+960] + vpermt2pd zmm5, zmm0, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+448] + vpermt2pd zmm1, zmm0, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+576] + vmovups zmm0, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+896] vfmadd231pd zmm22, zmm0, zmm23 {rn-sae} vfmadd213pd zmm22, zmm23, zmm6 {rn-sae} vfmadd213pd zmm22, zmm23, zmm14 {rn-sae} @@ -2190,7 +2190,7 @@ _B5_16:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B5_14 _B5_17:: @@ -2199,7 +2199,7 @@ _B5_17:: lea rax, QWORD PTR [__ImageBase] vpsrlq zmm27, zmm29, 52 mov rdx, rax - vmovups zmm14, ZMMWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovups zmm14, ZMMWORD PTR [__jsvml_dtan_ha_data_internal+1088] vpcmpeqd k3, zmm0, zmm0 vpsllq zmm30, zmm27, 1 vandpd zmm1, zmm14, zmm6 @@ -2214,18 +2214,18 @@ _B5_17:: vpandnq zmm28{k2}, zmm1, zmm1 vpcmpeqd k2, zmm0, zmm0 vcmppd k0, zmm28, zmm28, 3 {sae} - vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+ymm25] + vgatherdpd zmm23{k3}, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+ymm25] vpcmpeqd k3, zmm0, zmm0 vpbroadcastq zmm28, QWORD PTR [_2il0floatpacket_63] vpsrlq zmm1, zmm23, 32 kmovw r8d, k0 vpxord zmm15, zmm15, zmm15 - vgatherdpd zmm15{k2}, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rdx+ymm25] + vgatherdpd zmm15{k2}, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rdx+ymm25] vpsrlq zmm22, zmm15, 32 vpxord zmm29, zmm29, zmm29 vpandq zmm24, zmm4, QWORD BCST [_2il0floatpacket_61] vpaddq zmm14, zmm24, QWORD BCST [_2il0floatpacket_62] - vgatherdpd zmm29{k3}, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rcx+ymm25] + vgatherdpd zmm29{k3}, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rcx+ymm25] vpsrlq zmm30, zmm14, 32 vpsrlq zmm6, zmm29, 32 vpmullq zmm25, zmm30, zmm22 @@ -2338,13 +2338,13 @@ _B5_17:: _B5_18:: -__svml_tan8_ha_z0 ENDP +__jsvml_tan8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan8_ha_z0_B1_B10: +_unwind___jsvml_tan8_ha_z0_B1_B10: DD 669441 DD 9294903 DD 5204015 @@ -2359,13 +2359,13 @@ _unwind___svml_tan8_ha_z0_B1_B10: DD imagerel _B5_1 DD imagerel _B5_12 - DD imagerel _unwind___svml_tan8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_tan8_ha_z0_B1_B10 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan8_ha_z0_B12_B16: +_unwind___jsvml_tan8_ha_z0_B12_B16: DD 2808865 DD 7558364 DD 7369937 @@ -2390,7 +2390,7 @@ _unwind___svml_tan8_ha_z0_B12_B16: DD 7293707 DD imagerel _B5_1 DD imagerel _B5_12 - DD imagerel _unwind___svml_tan8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_tan8_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2399,17 +2399,17 @@ _unwind___svml_tan8_ha_z0_B12_B16: DD imagerel _B5_12 DD imagerel _B5_17 - DD imagerel _unwind___svml_tan8_ha_z0_B12_B16 + DD imagerel _unwind___jsvml_tan8_ha_z0_B12_B16 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan8_ha_z0_B17_B17: +_unwind___jsvml_tan8_ha_z0_B17_B17: DD 33 DD imagerel _B5_1 DD imagerel _B5_12 - DD imagerel _unwind___svml_tan8_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_tan8_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2418,7 +2418,7 @@ _unwind___svml_tan8_ha_z0_B17_B17: DD imagerel _B5_17 DD imagerel _B5_18 - DD imagerel _unwind___svml_tan8_ha_z0_B17_B17 + DD imagerel _unwind___jsvml_tan8_ha_z0_B17_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2432,9 +2432,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan2_ha_ex + PUBLIC __jsvml_tan2_ha_ex -__svml_tan2_ha_ex PROC EXPORT +__jsvml_tan2_ha_ex PROC EXPORT _B6_1:: @@ -2458,24 +2458,24 @@ L215:: movups XMMWORD PTR [384+rsp], xmm6 mov QWORD PTR [464+rsp], r13 lea r13, QWORD PTR [159+rsp] - movups xmm3, XMMWORD PTR [__svml_dtan_ha_data_internal+1024] + movups xmm3, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1024] and r13, -64 movaps xmm14, xmm3 andnps xmm3, xmm0 andps xmm14, xmm0 movaps xmm5, xmm14 - cmpnlepd xmm5, XMMWORD PTR [__svml_dtan_ha_data_internal+28160] + cmpnlepd xmm5, XMMWORD PTR [__jsvml_dtan_ha_data_internal+28160] movups XMMWORD PTR [448+rsp], xmm5 - movups xmm5, XMMWORD PTR [__svml_dtan_ha_data_internal+1472] + movups xmm5, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1472] mulpd xmm5, xmm14 - movups xmm4, XMMWORD PTR [__svml_dtan_ha_data_internal+1152] + movups xmm4, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1152] addpd xmm5, xmm4 movups XMMWORD PTR [416+rsp], xmm3 movaps xmm3, xmm5 subpd xmm3, xmm4 - movups xmm1, XMMWORD PTR [__svml_dtan_ha_data_internal+1216] + movups xmm1, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1216] mulpd xmm1, xmm3 - movups xmm8, XMMWORD PTR [__svml_dtan_ha_data_internal+1280] + movups xmm8, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1280] mulpd xmm8, xmm3 movups XMMWORD PTR [432+rsp], xmm14 subpd xmm14, xmm1 @@ -2483,10 +2483,10 @@ L215:: movaps xmm0, xmm14 subpd xmm0, xmm8 subpd xmm14, xmm0 - movups xmm7, XMMWORD PTR [__svml_dtan_ha_data_internal+1344] + movups xmm7, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1344] mulpd xmm7, xmm3 subpd xmm14, xmm8 - pand xmm5, XMMWORD PTR [__svml_dtan_ha_data_internal+1408] + pand xmm5, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1408] movaps xmm8, xmm0 pand xmm5, XMMWORD PTR [_2il0floatpacket_26] subpd xmm14, xmm7 @@ -2498,13 +2498,13 @@ L215:: subpd xmm0, xmm8 lea rax, QWORD PTR [__ImageBase] addpd xmm14, xmm0 - movq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+rcx] - movhpd xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+r9] + movq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+rcx] + movhpd xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+r9] movaps xmm15, xmm1 subpd xmm15, xmm8 - movq xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+rcx] + movq xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+rcx] subpd xmm1, xmm15 - movhpd xmm13, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+r9] + movhpd xmm13, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+r9] movups XMMWORD PTR [64+rsp], xmm13 movups xmm13, XMMWORD PTR [_2il0floatpacket_27] movaps xmm0, xmm13 @@ -2512,8 +2512,8 @@ L215:: subpd xmm1, xmm8 subpd xmm15, xmm0 subpd xmm1, xmm14 - movq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+rcx] - movhpd xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+r9] + movq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+rcx] + movhpd xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+r9] addpd xmm2, xmm15 addpd xmm1, xmm2 cvtpd2ps xmm2, xmm0 @@ -2537,41 +2537,41 @@ L215:: movaps xmm14, xmm1 mulpd xmm1, xmm1 subpd xmm14, xmm15 - movq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+rcx] subpd xmm1, xmm14 - movhpd xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+r9] + movhpd xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+r9] mulpd xmm6, xmm8 mulpd xmm13, xmm1 - movq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+rcx] + movq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+rcx] movaps xmm1, xmm8 - movhpd xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+r9] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+r9] movups XMMWORD PTR [48+rsp], xmm9 - movq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+rcx] - movhpd xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+r9] + movq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+rcx] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+r9] mulpd xmm1, xmm9 - movq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+rcx] - movq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+rcx] - movhpd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+r9] - movhpd xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+r9] + movq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+rcx] + movq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+rcx] + movhpd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+r9] + movhpd xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+r9] mulpd xmm7, xmm8 addpd xmm4, xmm6 movaps xmm6, xmm8 mulpd xmm6, xmm8 - movq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] - movq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+rcx] - movq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+rcx] - movhpd xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r9] - movhpd xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+r9] - movhpd xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+r9] + movq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] + movq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+rcx] + movq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+rcx] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r9] + movhpd xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+r9] + movhpd xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+r9] mulpd xmm2, xmm3 mulpd xmm10, xmm8 mulpd xmm3, xmm13 mulpd xmm4, xmm6 movaps xmm13, xmm12 addpd xmm13, xmm1 - movq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] + movq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] movaps xmm0, xmm13 - movhpd xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r9] + movhpd xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r9] addpd xmm7, xmm11 addpd xmm9, xmm11 subpd xmm12, xmm13 @@ -2585,8 +2585,8 @@ L215:: mulpd xmm11, xmm6 mulpd xmm6, xmm6 addpd xmm3, xmm13 - movq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+rcx] - movhpd xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+r9] + movq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+rcx] + movhpd xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+r9] addpd xmm5, xmm10 addpd xmm5, xmm11 mulpd xmm5, xmm6 @@ -2668,7 +2668,7 @@ _B6_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B6_9 _B6_12:: @@ -2678,7 +2678,7 @@ _B6_12:: pand xmm7, xmm12 psrlq xmm7, 52 movd ecx, xmm7 - movups xmm6, XMMWORD PTR [__svml_dtan_ha_data_internal+1088] + movups xmm6, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1088] movdqu xmm13, XMMWORD PTR [_2il0floatpacket_30] movaps xmm4, xmm6 pextrw r9d, xmm7, 4 @@ -2691,18 +2691,18 @@ _B6_12:: cmpeqpd xmm4, xmm6 shl r10d, 3 movdqa xmm11, xmm13 - movq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r8] + movq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r8] psrlq xmm11, 32 - movhpd xmm5, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r10] + movhpd xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r10] movdqu xmm8, XMMWORD PTR [_2il0floatpacket_32] movaps xmm3, xmm5 - movq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r8] + movq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r8] psrlq xmm3, 32 movups XMMWORD PTR [32+rsp], xmm0 pand xmm13, xmm8 movdqa xmm0, xmm11 pand xmm5, xmm8 - movhpd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r10] + movhpd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r10] movdqa xmm9, xmm13 pmuludq xmm0, xmm3 movaps xmm2, xmm7 @@ -2721,11 +2721,11 @@ _B6_12:: pand xmm15, xmm4 pmuludq xmm2, xmm11 paddq xmm15, xmm0 - movq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r8] + movq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r8] psrlq xmm5, 32 movups XMMWORD PTR [448+rsp], xmm1 movdqa xmm1, xmm8 - movhpd xmm14, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r10] + movhpd xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r10] psrlq xmm4, 32 pand xmm1, xmm14 movdqa xmm10, xmm13 @@ -2825,31 +2825,31 @@ _B6_12:: imul ecx, r11d, 104 imul r9d, r8d, 104 andps xmm11, xmm12 - movq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+rcx] - movq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+rcx] + movq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+rcx] + movq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+rcx] subpd xmm2, xmm0 - movhpd xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+r9] + movhpd xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+r9] andps xmm0, xmm13 - movhpd xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+r9] + movhpd xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+r9] orps xmm11, xmm0 movups XMMWORD PTR [64+rsp], xmm12 movaps xmm12, xmm1 subpd xmm12, xmm11 addpd xmm8, xmm2 subpd xmm1, xmm12 - movq xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+rcx] + movq xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+rcx] andps xmm13, xmm8 - movhpd xmm0, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+r9] + movhpd xmm0, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+r9] movups XMMWORD PTR [80+rsp], xmm0 movaps xmm0, xmm14 subpd xmm1, xmm11 andps xmm0, xmm12 subpd xmm12, xmm0 subpd xmm1, xmm13 - movq xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+rcx] + movq xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+rcx] movups XMMWORD PTR [48+rsp], xmm13 cvtpd2ps xmm13, xmm0 - movhpd xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+r9] + movhpd xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+r9] addpd xmm15, xmm12 movlhps xmm13, xmm13 addpd xmm1, xmm15 @@ -2868,34 +2868,34 @@ _B6_12:: addpd xmm15, xmm0 mulpd xmm12, xmm15 mulpd xmm1, xmm12 - movq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+rcx] + movq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+rcx] movaps xmm0, xmm1 - movhpd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+r9] + movhpd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+r9] subpd xmm0, xmm14 mulpd xmm1, xmm1 movaps xmm14, xmm11 mulpd xmm14, xmm7 subpd xmm1, xmm0 - movq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+rcx] - movhpd xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+r9] + movq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+rcx] + movhpd xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+r9] movaps xmm0, xmm2 addpd xmm0, xmm14 mulpd xmm12, xmm1 subpd xmm2, xmm0 - movq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+rcx] + movq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+rcx] movaps xmm1, xmm0 - movq xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+rcx] - movhpd xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+r9] - movhpd xmm5, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+r9] + movq xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+rcx] + movhpd xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+r9] + movhpd xmm5, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+r9] addpd xmm14, xmm2 mulpd xmm6, xmm11 mulpd xmm5, xmm11 movaps xmm2, xmm11 mulpd xmm2, xmm11 - movq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] - movq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+rcx] - movhpd xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r9] - movhpd xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+r9] + movq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] + movq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+rcx] + movhpd xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r9] + movhpd xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+r9] mulpd xmm13, xmm10 mulpd xmm8, xmm11 addpd xmm1, xmm13 @@ -2903,10 +2903,10 @@ _B6_12:: subpd xmm13, xmm1 addpd xmm10, xmm14 addpd xmm0, xmm13 - movq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] - movq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+rcx] - movhpd xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r9] - movhpd xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+r9] + movq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+rcx] + movhpd xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r9] + movhpd xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+r9] addpd xmm6, xmm9 addpd xmm7, xmm9 addpd xmm3, xmm5 @@ -2916,8 +2916,8 @@ _B6_12:: mulpd xmm9, xmm2 mulpd xmm2, xmm2 addpd xmm6, xmm3 - movq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+rcx] - movhpd xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+r9] + movq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+rcx] + movhpd xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+r9] addpd xmm4, xmm8 addpd xmm4, xmm9 mulpd xmm4, xmm2 @@ -2941,13 +2941,13 @@ _B6_12:: _B6_13:: -__svml_tan2_ha_ex ENDP +__jsvml_tan2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_ex_B1_B4: +_unwind___jsvml_tan2_ha_ex_B1_B4: DD 1600769 DD 3855469 DD 1599589 @@ -2969,19 +2969,19 @@ _unwind___svml_tan2_ha_ex_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_tan2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_ex_B7_B11: +_unwind___jsvml_tan2_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_tan2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2990,17 +2990,17 @@ _unwind___svml_tan2_ha_ex_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_tan2_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_tan2_ha_ex_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_ex_B12_B12: +_unwind___jsvml_tan2_ha_ex_B12_B12: DD 33 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_tan2_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3009,7 +3009,7 @@ _unwind___svml_tan2_ha_ex_B12_B12: DD imagerel _B6_12 DD imagerel _B6_13 - DD imagerel _unwind___svml_tan2_ha_ex_B12_B12 + DD imagerel _unwind___jsvml_tan2_ha_ex_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3023,9 +3023,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan2_ha_l9 + PUBLIC __jsvml_tan2_ha_l9 -__svml_tan2_ha_l9 PROC EXPORT +__jsvml_tan2_ha_l9 PROC EXPORT _B7_1:: @@ -3051,16 +3051,16 @@ L267:: vmovups XMMWORD PTR [368+rsp], xmm6 mov QWORD PTR [384+rsp], r13 lea r13, QWORD PTR [143+rsp] - vmovupd xmm0, XMMWORD PTR [__svml_dtan_ha_data_internal] + vmovupd xmm0, XMMWORD PTR [__jsvml_dtan_ha_data_internal] and r13, -64 - vmovupd xmm3, XMMWORD PTR [__svml_dtan_ha_data_internal+1152] + vmovupd xmm3, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1152] vfmadd213pd xmm0, xmm14, xmm3 - vmovupd xmm1, XMMWORD PTR [__svml_dtan_ha_data_internal+64] - vmovupd xmm4, XMMWORD PTR [__svml_dtan_ha_data_internal+256] - vmovupd xmm5, XMMWORD PTR [__svml_dtan_ha_data_internal+320] - vandpd xmm7, xmm14, XMMWORD PTR [__svml_dtan_ha_data_internal+1024] + vmovupd xmm1, XMMWORD PTR [__jsvml_dtan_ha_data_internal+64] + vmovupd xmm4, XMMWORD PTR [__jsvml_dtan_ha_data_internal+256] + vmovupd xmm5, XMMWORD PTR [__jsvml_dtan_ha_data_internal+320] + vandpd xmm7, xmm14, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1024] vsubpd xmm6, xmm0, xmm3 - vcmpnlepd xmm13, xmm7, XMMWORD PTR [__svml_dtan_ha_data_internal+28160] + vcmpnlepd xmm13, xmm7, XMMWORD PTR [__jsvml_dtan_ha_data_internal+28160] vfnmadd213pd xmm1, xmm6, xmm14 vmovapd xmm2, xmm6 vmovapd xmm3, xmm6 @@ -3079,28 +3079,28 @@ L267:: _B7_2:: vmulpd xmm9, xmm3, xmm3 - vmovupd xmm8, XMMWORD PTR [__svml_dtan_ha_data_internal+896] + vmovupd xmm8, XMMWORD PTR [__jsvml_dtan_ha_data_internal+896] vpsllq xmm4, xmm0, 3 - vfmadd213pd xmm8, xmm9, XMMWORD PTR [__svml_dtan_ha_data_internal+832] + vfmadd213pd xmm8, xmm9, XMMWORD PTR [__jsvml_dtan_ha_data_internal+832] vpand xmm5, xmm4, XMMWORD PTR [_2il0floatpacket_58] vmovd ecx, xmm5 - vfmadd213pd xmm8, xmm9, XMMWORD PTR [__svml_dtan_ha_data_internal+768] - vfmadd213pd xmm8, xmm9, XMMWORD PTR [__svml_dtan_ha_data_internal+704] - vfmadd213pd xmm8, xmm9, XMMWORD PTR [__svml_dtan_ha_data_internal+640] + vfmadd213pd xmm8, xmm9, XMMWORD PTR [__jsvml_dtan_ha_data_internal+768] + vfmadd213pd xmm8, xmm9, XMMWORD PTR [__jsvml_dtan_ha_data_internal+704] + vfmadd213pd xmm8, xmm9, XMMWORD PTR [__jsvml_dtan_ha_data_internal+640] vmulpd xmm10, xmm3, xmm8 vfnmsub213pd xmm10, xmm9, xmm11 movsxd rcx, ecx vpextrd r8d, xmm5, 2 vsubpd xmm4, xmm3, xmm10 movsxd r8, r8d - vmovsd xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+rax+rcx] - vmovupd xmm5, XMMWORD PTR [__svml_dtan_ha_data_internal+960] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+rax+rcx] + vmovupd xmm5, XMMWORD PTR [__jsvml_dtan_ha_data_internal+960] vsubpd xmm3, xmm3, xmm4 - vmovhpd xmm1, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+rax+r8] + vmovhpd xmm1, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+rax+r8] vmovapd xmm6, xmm5 vfnmadd231pd xmm6, xmm4, xmm1 - vmovsd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+rax+rcx] - vmovhpd xmm2, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+rax+r8] + vmovsd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+rax+rcx] + vmovhpd xmm2, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+rax+r8] vaddpd xmm0, xmm1, xmm4 vsubpd xmm15, xmm3, xmm10 vsubpd xmm3, xmm6, xmm5 @@ -3179,7 +3179,7 @@ _B7_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B7_9 _B7_12:: @@ -3189,7 +3189,7 @@ _B7_12:: vmovupd XMMWORD PTR [48+rsp], xmm3 vpsrlq xmm3, xmm0, 52 vmovd ecx, xmm3 - vmovupd xmm6, XMMWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovupd xmm6, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1088] vandpd xmm9, xmm6, xmm7 vpextrd r9d, xmm3, 2 vcmpeqpd xmm10, xmm9, xmm6 @@ -3198,22 +3198,22 @@ _B7_12:: shl r8d, 3 lea r10d, DWORD PTR [r9+r9*2] shl r10d, 3 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r8] vpaddq xmm6, xmm7, XMMWORD PTR [_2il0floatpacket_31] vmovmskpd edx, xmm10 vmovupd XMMWORD PTR [64+rsp], xmm11 vpsrlq xmm9, xmm6, 32 - vmovhpd xmm11, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r10] - vmovq xmm15, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r8] + vmovhpd xmm11, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r10] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r8] vpsrlq xmm0, xmm11, 32 vmovdqu xmm12, XMMWORD PTR [_2il0floatpacket_32] - vmovhpd xmm10, xmm15, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r10] + vmovhpd xmm10, xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r10] vpand xmm15, xmm11, xmm12 vpmuludq xmm11, xmm9, xmm15 vpand xmm6, xmm6, xmm12 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r8] vpsrlq xmm15, xmm11, 32 - vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r10] vpand xmm7, xmm10, xmm12 vpmuludq xmm11, xmm9, xmm0 vpand xmm2, xmm5, xmm12 @@ -3325,13 +3325,13 @@ _B7_12:: _B7_13:: -__svml_tan2_ha_l9 ENDP +__jsvml_tan2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_l9_B1_B4: +_unwind___jsvml_tan2_ha_l9_B1_B4: DD 1604097 DD 3200122 DD 1534066 @@ -3353,19 +3353,19 @@ _unwind___svml_tan2_ha_l9_B1_B4: DD imagerel _B7_1 DD imagerel _B7_7 - DD imagerel _unwind___svml_tan2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_l9_B7_B11: +_unwind___jsvml_tan2_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B7_1 DD imagerel _B7_7 - DD imagerel _unwind___svml_tan2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3374,17 +3374,17 @@ _unwind___svml_tan2_ha_l9_B7_B11: DD imagerel _B7_7 DD imagerel _B7_12 - DD imagerel _unwind___svml_tan2_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_tan2_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_l9_B12_B12: +_unwind___jsvml_tan2_ha_l9_B12_B12: DD 33 DD imagerel _B7_1 DD imagerel _B7_7 - DD imagerel _unwind___svml_tan2_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3393,7 +3393,7 @@ _unwind___svml_tan2_ha_l9_B12_B12: DD imagerel _B7_12 DD imagerel _B7_13 - DD imagerel _unwind___svml_tan2_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_tan2_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3407,9 +3407,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan2_ha_e9 + PUBLIC __jsvml_tan2_ha_e9 -__svml_tan2_ha_e9 PROC EXPORT +__jsvml_tan2_ha_e9 PROC EXPORT _B8_1:: @@ -3433,25 +3433,25 @@ L300:: vmovups XMMWORD PTR [384+rsp], xmm6 mov QWORD PTR [448+rsp], r13 lea r13, QWORD PTR [159+rsp] - vmovupd xmm5, XMMWORD PTR [__svml_dtan_ha_data_internal+1024] + vmovupd xmm5, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1024] and r13, -64 vandpd xmm14, xmm0, xmm5 vandnpd xmm15, xmm5, xmm0 - vmulpd xmm12, xmm14, XMMWORD PTR [__svml_dtan_ha_data_internal+1472] - vcmpnlepd xmm13, xmm14, XMMWORD PTR [__svml_dtan_ha_data_internal+28160] - vmovupd xmm11, XMMWORD PTR [__svml_dtan_ha_data_internal+1152] + vmulpd xmm12, xmm14, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1472] + vcmpnlepd xmm13, xmm14, XMMWORD PTR [__jsvml_dtan_ha_data_internal+28160] + vmovupd xmm11, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1152] vmovupd XMMWORD PTR [416+rsp], xmm15 vaddpd xmm15, xmm11, xmm12 vsubpd xmm2, xmm15, xmm11 - vmulpd xmm10, xmm2, XMMWORD PTR [__svml_dtan_ha_data_internal+1216] - vmulpd xmm3, xmm2, XMMWORD PTR [__svml_dtan_ha_data_internal+1280] + vmulpd xmm10, xmm2, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1216] + vmulpd xmm3, xmm2, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1280] vsubpd xmm9, xmm14, xmm10 - vmulpd xmm5, xmm2, XMMWORD PTR [__svml_dtan_ha_data_internal+1344] + vmulpd xmm5, xmm2, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1344] vsubpd xmm7, xmm9, xmm3 vsubpd xmm4, xmm9, xmm7 vsubpd xmm1, xmm4, xmm3 vsubpd xmm8, xmm1, xmm5 - vpand xmm12, xmm15, XMMWORD PTR [__svml_dtan_ha_data_internal+1408] + vpand xmm12, xmm15, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1408] vaddpd xmm15, xmm7, xmm8 vpand xmm11, xmm12, XMMWORD PTR [_2il0floatpacket_26] vmovd eax, xmm11 @@ -3463,31 +3463,31 @@ L300:: vsubpd xmm13, xmm7, xmm15 vpextrd r8d, xmm11, 2 imul r9d, r8d, 104 - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+rcx] - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+rcx] - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+rcx] - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+rcx] - vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+r9] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+rcx] + vmovhpd xmm1, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+r9] vaddpd xmm5, xmm8, xmm13 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+rcx] - vmovhpd xmm7, xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+r9] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+rcx] + vmovhpd xmm7, xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+r9] vmovupd XMMWORD PTR [64+rsp], xmm1 - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+rcx] - vmovhpd xmm4, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+r9] - vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+r9] - vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+r9] - vmovhpd xmm11, xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+r9] - vmovhpd xmm3, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+r9] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+rcx] + vmovhpd xmm4, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+r9] + vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+r9] + vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+r9] + vmovhpd xmm11, xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+r9] + vmovhpd xmm3, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+r9] vsubpd xmm1, xmm4, xmm15 vmulpd xmm8, xmm8, xmm15 vsubpd xmm4, xmm4, xmm1 - vmovq xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+rcx] - vmovq xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+rcx] - vmovq xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+rcx] - vmovhpd xmm0, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+r9] - vmovhpd xmm10, xmm14, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+r9] - vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+r9] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+rcx] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+rcx] + vmovhpd xmm0, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+r9] + vmovhpd xmm10, xmm14, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+r9] + vmovhpd xmm14, xmm2, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+r9] vmovupd xmm2, XMMWORD PTR [_2il0floatpacket_27] vsubpd xmm4, xmm4, xmm15 vmulpd xmm14, xmm14, xmm15 @@ -3518,8 +3518,8 @@ L300:: vsubpd xmm0, xmm5, xmm3 vmulpd xmm1, xmm2, xmm0 vmulpd xmm2, xmm13, xmm15 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] - vmovhpd xmm6, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r9] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] + vmovhpd xmm6, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r9] vmulpd xmm3, xmm6, xmm4 vaddpd xmm4, xmm7, xmm2 vmulpd xmm6, xmm6, xmm1 @@ -3530,14 +3530,14 @@ L300:: vmulpd xmm2, xmm15, xmm15 vaddpd xmm6, xmm6, xmm7 vaddpd xmm7, xmm4, xmm0 - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+rcx] - vmovhpd xmm9, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+r9] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+rcx] + vmovhpd xmm9, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+r9] vmulpd xmm0, xmm9, xmm15 vmulpd xmm9, xmm2, xmm2 vaddpd xmm1, xmm10, xmm0 vaddpd xmm7, xmm6, xmm7 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] - vmovhpd xmm12, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] + vmovhpd xmm12, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r9] vaddpd xmm8, xmm12, xmm8 vaddpd xmm3, xmm13, xmm12 vmulpd xmm12, xmm2, XMMWORD PTR [80+rsp] @@ -3619,7 +3619,7 @@ _B8_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B8_9 _B8_12:: @@ -3627,7 +3627,7 @@ _B8_12:: vpand xmm10, xmm1, XMMWORD PTR [_2il0floatpacket_29] vmovupd XMMWORD PTR [432+rsp], xmm2 vpsrlq xmm2, xmm10, 52 - vmovupd xmm3, XMMWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovupd xmm3, XMMWORD PTR [__jsvml_dtan_ha_data_internal+1088] vmovd ecx, xmm2 vandpd xmm9, xmm3, xmm1 vmovupd XMMWORD PTR [32+rsp], xmm0 @@ -3636,18 +3636,18 @@ _B8_12:: lea r8d, DWORD PTR [rcx+rcx*2] shl r8d, 3 vpand xmm9, xmm1, XMMWORD PTR [_2il0floatpacket_30] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r8] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r8] vpaddq xmm11, xmm9, XMMWORD PTR [_2il0floatpacket_31] vmovmskpd edx, xmm0 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r8] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r8] vmovdqu xmm3, XMMWORD PTR [_2il0floatpacket_32] - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r8] lea r10d, DWORD PTR [r9+r9*2] shl r10d, 3 vpand xmm9, xmm11, xmm3 - vmovhpd xmm0, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+rax+r10] + vmovhpd xmm0, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+rax+r10] vpsrlq xmm7, xmm11, 32 - vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+rax+r10] + vmovhpd xmm5, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+rax+r10] vpand xmm2, xmm0, xmm3 vpsrlq xmm15, xmm5, 32 vpand xmm13, xmm5, xmm3 @@ -3656,7 +3656,7 @@ _B8_12:: vpmuludq xmm13, xmm7, xmm13 vpmuludq xmm14, xmm9, xmm15 vpmuludq xmm15, xmm7, xmm15 - vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+rax+r10] + vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+rax+r10] vpsrlq xmm6, xmm0, 32 vpsrlq xmm2, xmm5, 32 vpand xmm0, xmm12, xmm3 @@ -3749,31 +3749,31 @@ _B8_12:: vorpd xmm10, xmm1, xmm10 imul r9d, r8d, 104 vandpd xmm14, xmm13, xmm14 - vmovq xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+rcx] - vmovq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+rcx] - vmovq xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+rcx] - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+rcx] - vmovq xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+rcx] - vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1536+rax+r9] - vmovhpd xmm11, xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1552+rax+r9] - vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1576+rax+r9] - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+rcx] - vmovq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+rcx] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+rcx] - vmovhpd xmm15, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1544+rax+r9] - vmovhpd xmm2, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1560+rax+r9] - vmovhpd xmm5, xmm3, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1568+rax+r9] - vmovhpd xmm7, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1584+rax+r9] - vmovhpd xmm3, xmm4, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1600+rax+r9] - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+rcx] - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+rcx] - vmovhpd xmm4, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1616+rax+r9] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+rcx] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+rcx] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+rcx] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+rcx] + vmovhpd xmm13, xmm8, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1536+rax+r9] + vmovhpd xmm11, xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1552+rax+r9] + vmovhpd xmm8, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1576+rax+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+rcx] + vmovhpd xmm15, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1544+rax+r9] + vmovhpd xmm2, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1560+rax+r9] + vmovhpd xmm5, xmm3, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1568+rax+r9] + vmovhpd xmm7, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1584+rax+r9] + vmovhpd xmm3, xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1600+rax+r9] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+rcx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+rcx] + vmovhpd xmm4, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1616+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+rcx] vmovupd XMMWORD PTR [64+rsp], xmm5 - vmovhpd xmm5, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1608+rax+r9] - vmovhpd xmm9, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1624+rax+r9] - vmovhpd xmm12, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1632+rax+r9] + vmovhpd xmm5, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1608+rax+r9] + vmovhpd xmm9, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1624+rax+r9] + vmovhpd xmm12, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1632+rax+r9] vmovupd XMMWORD PTR [80+rsp], xmm12 vsubpd xmm12, xmm13, xmm10 vmulpd xmm9, xmm10, xmm9 @@ -3822,8 +3822,8 @@ _B8_12:: vmulpd xmm14, xmm5, xmm5 vmulpd xmm8, xmm3, xmm5 vmulpd xmm12, xmm11, XMMWORD PTR [48+rsp] - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+rcx] - vmovhpd xmm6, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+1592+rax+r9] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+rcx] + vmovhpd xmm6, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+1592+rax+r9] vmulpd xmm6, xmm10, xmm6 vaddpd xmm1, xmm2, xmm12 vaddpd xmm6, xmm7, xmm6 @@ -3845,13 +3845,13 @@ _B8_12:: _B8_13:: -__svml_tan2_ha_e9 ENDP +__jsvml_tan2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_e9_B1_B4: +_unwind___jsvml_tan2_ha_e9_B1_B4: DD 1601281 DD 3724399 DD 1599591 @@ -3873,19 +3873,19 @@ _unwind___svml_tan2_ha_e9_B1_B4: DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_tan2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_e9_B7_B11: +_unwind___jsvml_tan2_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_tan2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3894,17 +3894,17 @@ _unwind___svml_tan2_ha_e9_B7_B11: DD imagerel _B8_7 DD imagerel _B8_12 - DD imagerel _unwind___svml_tan2_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_tan2_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan2_ha_e9_B12_B12: +_unwind___jsvml_tan2_ha_e9_B12_B12: DD 33 DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_tan2_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_tan2_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -3913,7 +3913,7 @@ _unwind___svml_tan2_ha_e9_B12_B12: DD imagerel _B8_12 DD imagerel _B8_13 - DD imagerel _unwind___svml_tan2_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_tan2_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3927,9 +3927,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tan4_ha_l9 + PUBLIC __jsvml_tan4_ha_l9 -__svml_tan4_ha_l9 PROC EXPORT +__jsvml_tan4_ha_l9 PROC EXPORT _B9_1:: @@ -3956,11 +3956,11 @@ L352:: lea r13, QWORD PTR [111+rsp] vmovdqa ymm14, ymm0 and r13, -64 - vmovupd ymm0, YMMWORD PTR [__svml_dtan_ha_data_internal] - vmovupd ymm4, YMMWORD PTR [__svml_dtan_ha_data_internal+1152] - vmovupd ymm1, YMMWORD PTR [__svml_dtan_ha_data_internal+64] - vmovupd ymm3, YMMWORD PTR [__svml_dtan_ha_data_internal+256] - vmovupd ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+320] + vmovupd ymm0, YMMWORD PTR [__jsvml_dtan_ha_data_internal] + vmovupd ymm4, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1152] + vmovupd ymm1, YMMWORD PTR [__jsvml_dtan_ha_data_internal+64] + vmovupd ymm3, YMMWORD PTR [__jsvml_dtan_ha_data_internal+256] + vmovupd ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+320] vfmadd213pd ymm0, ymm14, ymm4 vsubpd ymm6, ymm0, ymm4 vfnmadd213pd ymm1, ymm6, ymm14 @@ -3972,8 +3972,8 @@ L352:: vsubpd ymm2, ymm4, ymm2 vfnmadd231pd ymm1, ymm3, ymm6 vfmadd213pd ymm6, ymm5, ymm2 - vandpd ymm7, ymm14, YMMWORD PTR [__svml_dtan_ha_data_internal+1024] - vcmpnle_uqpd ymm13, ymm7, YMMWORD PTR [__svml_dtan_ha_data_internal+28160] + vandpd ymm7, ymm14, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1024] + vcmpnle_uqpd ymm13, ymm7, YMMWORD PTR [__jsvml_dtan_ha_data_internal+28160] vsubpd ymm3, ymm1, ymm6 vmovmskpd eax, ymm13 mov QWORD PTR [536+rsp], r13 @@ -3983,13 +3983,13 @@ L352:: _B9_2:: vpsllq ymm5, ymm0, 3 - vmovupd ymm0, YMMWORD PTR [__svml_dtan_ha_data_internal+896] + vmovupd ymm0, YMMWORD PTR [__jsvml_dtan_ha_data_internal+896] vpand ymm6, ymm5, YMMWORD PTR [_2il0floatpacket_93] vmulpd ymm5, ymm4, ymm4 - vfmadd213pd ymm0, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+832] - vfmadd213pd ymm0, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+768] - vfmadd213pd ymm0, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+704] - vfmadd213pd ymm0, ymm5, YMMWORD PTR [__svml_dtan_ha_data_internal+640] + vfmadd213pd ymm0, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+832] + vfmadd213pd ymm0, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+768] + vfmadd213pd ymm0, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+704] + vfmadd213pd ymm0, ymm5, YMMWORD PTR [__jsvml_dtan_ha_data_internal+640] vextracti128 xmm9, ymm6, 1 vmovd edx, xmm6 vmovd ecx, xmm9 @@ -4000,20 +4000,20 @@ _B9_2:: vpextrd r10d, xmm9, 2 movsxd rax, eax movsxd r10, r10d - vmovsd xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+r8+rdx] - vmovsd xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+r8+rcx] + vmovsd xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+r8+rdx] + vmovsd xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+r8+rcx] vfnmsub213pd ymm6, ymm5, ymm3 - vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+r8+rax] - vmovhpd xmm11, xmm10, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+384+r8+r10] - vmovsd xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+r8+rdx] - vmovsd xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+r8+rcx] + vmovhpd xmm8, xmm7, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+r8+rax] + vmovhpd xmm11, xmm10, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+384+r8+r10] + vmovsd xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+r8+rdx] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+r8+rcx] vsubpd ymm7, ymm4, ymm6 - vmovhpd xmm13, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+r8+rax] - vmovhpd xmm1, xmm15, QWORD PTR [imagerel(__svml_dtan_ha_data_internal)+512+r8+r10] + vmovhpd xmm13, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+r8+rax] + vmovhpd xmm1, xmm15, QWORD PTR [imagerel(__jsvml_dtan_ha_data_internal)+512+r8+r10] vsubpd ymm4, ymm4, ymm7 vsubpd ymm6, ymm4, ymm6 vinsertf128 ymm2, ymm8, xmm11, 1 - vmovupd ymm8, YMMWORD PTR [__svml_dtan_ha_data_internal+960] + vmovupd ymm8, YMMWORD PTR [__jsvml_dtan_ha_data_internal+960] vaddpd ymm0, ymm2, ymm7 vmovapd ymm9, ymm8 vfnmadd231pd ymm9, ymm7, ymm2 @@ -4095,14 +4095,14 @@ _B9_11:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtan_ha_cout_rare_internal + call __jsvml_dtan_ha_cout_rare_internal jmp _B9_9 _B9_12:: vmovupd YMMWORD PTR [32+r13], ymm4 vmovupd YMMWORD PTR [64+r13], ymm3 - vmovupd ymm10, YMMWORD PTR [__svml_dtan_ha_data_internal+1088] + vmovupd ymm10, YMMWORD PTR [__jsvml_dtan_ha_data_internal+1088] vmovupd YMMWORD PTR [r13], ymm0 vpand ymm4, ymm14, YMMWORD PTR [_2il0floatpacket_79] vpsrlq ymm3, ymm4, 52 @@ -4119,24 +4119,24 @@ _B9_12:: vpextrd r10d, xmm5, 2 lea eax, DWORD PTR [rax+rax*2] shl edx, 3 - vmovq xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+r8+rcx] - vmovhpd xmm15, xmm12, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+r8+rdx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+r8+rcx] + vmovhpd xmm15, xmm12, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+r8+rdx] vpand ymm12, ymm14, YMMWORD PTR [_2il0floatpacket_80] lea r11d, DWORD PTR [r10+r10*2] - vmovq xmm1, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+r8+rcx] - vmovhpd xmm0, xmm1, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+r8+rdx] - vmovq xmm9, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+r8+rcx] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+r8+rcx] + vmovhpd xmm0, xmm1, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+r8+rdx] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+r8+rcx] shl eax, 3 shl r11d, 3 - vmovq xmm11, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+r8+rax] - vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+r8+r11] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+r8+rax] + vmovhpd xmm8, xmm11, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+r8+r11] vpaddq ymm11, ymm12, YMMWORD PTR [_2il0floatpacket_81] - vmovq xmm4, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+r8+rax] - vmovhpd xmm3, xmm4, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+16+r8+r11] - vmovq xmm6, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+r8+rax] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+r8+rax] + vmovhpd xmm3, xmm4, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+16+r8+r11] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+r8+rax] vmovdqu ymm12, YMMWORD PTR [_2il0floatpacket_82] - vmovhpd xmm7, xmm9, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+r8+rdx] - vmovhpd xmm2, xmm6, QWORD PTR [imagerel(__svml_dtan_ha_reduction_data_internal)+8+r8+r11] + vmovhpd xmm7, xmm9, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+r8+rdx] + vmovhpd xmm2, xmm6, QWORD PTR [imagerel(__jsvml_dtan_ha_reduction_data_internal)+8+r8+r11] vpsrlq ymm9, ymm11, 32 vpand ymm6, ymm11, ymm12 vinsertf128 ymm5, ymm0, xmm3, 1 @@ -4260,13 +4260,13 @@ _B9_12:: _B9_13:: -__svml_tan4_ha_l9 ENDP +__jsvml_tan4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan4_ha_l9_B1_B4: +_unwind___jsvml_tan4_ha_l9_B1_B4: DD 1603329 DD 4379767 DD 2058351 @@ -4288,19 +4288,19 @@ _unwind___svml_tan4_ha_l9_B1_B4: DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_tan4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_tan4_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan4_ha_l9_B7_B11: +_unwind___jsvml_tan4_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_tan4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_tan4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -4309,17 +4309,17 @@ _unwind___svml_tan4_ha_l9_B7_B11: DD imagerel _B9_7 DD imagerel _B9_12 - DD imagerel _unwind___svml_tan4_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_tan4_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tan4_ha_l9_B12_B12: +_unwind___jsvml_tan4_ha_l9_B12_B12: DD 33 DD imagerel _B9_1 DD imagerel _B9_7 - DD imagerel _unwind___svml_tan4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_tan4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -4328,7 +4328,7 @@ _unwind___svml_tan4_ha_l9_B12_B12: DD imagerel _B9_12 DD imagerel _B9_13 - DD imagerel _unwind___svml_tan4_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_tan4_ha_l9_B12_B12 .pdata ENDS _RDATA SEGMENT READ PAGE 'DATA' @@ -4362,9 +4362,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dtan_ha_cout_rare_internal + PUBLIC __jsvml_dtan_ha_cout_rare_internal -__svml_dtan_ha_cout_rare_internal PROC +__jsvml_dtan_ha_cout_rare_internal PROC _B10_1:: @@ -4420,13 +4420,13 @@ _B10_6:: _B10_7:: -__svml_dtan_ha_cout_rare_internal ENDP +__jsvml_dtan_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_dtan_ha_cout_rare_internal_B1_B6: +_unwind___jsvml_dtan_ha_cout_rare_internal_B1_B6: DD 67585 DD 16904 @@ -4437,7 +4437,7 @@ _unwind___svml_dtan_ha_cout_rare_internal_B1_B6: DD imagerel _B10_1 DD imagerel _B10_7 - DD imagerel _unwind___svml_dtan_ha_cout_rare_internal_B1_B6 + DD imagerel _unwind___jsvml_dtan_ha_cout_rare_internal_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -4445,8 +4445,8 @@ _DATA ENDS _RDATA SEGMENT READ 'DATA' DD 8 DUP (0H) - PUBLIC __svml_dtan_ha_reduction_data_internal -__svml_dtan_ha_reduction_data_internal DD 0 + PUBLIC __jsvml_dtan_ha_reduction_data_internal +__jsvml_dtan_ha_reduction_data_internal DD 0 DD 0 DD 0 DD 0 @@ -16735,8 +16735,8 @@ __svml_dtan_ha_reduction_data_internal DD 0 DD 896803160 DD 3984508030 DD 128 DUP (0H) - PUBLIC __svml_dtan_ha_data_internal -__svml_dtan_ha_data_internal DD 1841940611 + PUBLIC __jsvml_dtan_ha_data_internal +__jsvml_dtan_ha_data_internal DD 1841940611 DD 1075076912 DD 1841940611 DD 1075076912 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_tanh_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_tanh_windows_x86.S similarity index 79% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_d_tanh_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_tanh_windows_x86.S index a3c930a47b6..a4d0525cf73 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_d_tanh_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_d_tanh_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh4_ha_e9 + PUBLIC __jsvml_tanh4_ha_e9 -__svml_tanh4_ha_e9 PROC EXPORT +__jsvml_tanh4_ha_e9 PROC EXPORT _B1_1:: @@ -67,22 +67,22 @@ L1:: vmovapd ymm4, ymm0 and r13, -64 vmovupd YMMWORD PTR [32+r13], ymm4 - vmovups xmm12, XMMWORD PTR [__svml_dtanh_ha_data_internal+10688] - vmovups xmm1, XMMWORD PTR [__svml_dtanh_ha_data_internal+10752] - vandpd ymm0, ymm4, YMMWORD PTR [__svml_dtanh_ha_data_internal+10432] - vandpd ymm5, ymm4, YMMWORD PTR [__svml_dtanh_ha_data_internal+10368] + vmovups xmm12, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10688] + vmovups xmm1, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10752] + vandpd ymm0, ymm4, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+10432] + vandpd ymm5, ymm4, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+10368] vmovupd YMMWORD PTR [r13], ymm5 mov QWORD PTR [536+rsp], r13 vextractf128 xmm3, ymm4, 1 vshufps xmm2, xmm4, xmm3, 221 - vpand xmm9, xmm2, XMMWORD PTR [__svml_dtanh_ha_data_internal+10496] - vpsubd xmm6, xmm9, XMMWORD PTR [__svml_dtanh_ha_data_internal+10624] + vpand xmm9, xmm2, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10496] + vpsubd xmm6, xmm9, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10624] vpcmpgtd xmm14, xmm1, xmm9 vpcmpgtd xmm7, xmm6, xmm8 vpcmpgtd xmm4, xmm6, xmm12 vpand xmm5, xmm6, xmm7 vblendvps xmm12, xmm5, xmm12, xmm4 - vpcmpgtd xmm13, xmm9, XMMWORD PTR [__svml_dtanh_ha_data_internal+10560] + vpcmpgtd xmm13, xmm9, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10560] vpsrld xmm3, xmm12, 10 vpor xmm11, xmm13, xmm14 vmovd ecx, xmm3 @@ -94,46 +94,46 @@ L1:: vpextrd r10d, xmm3, 3 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+rax] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+rax] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+rax] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+rcx] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+rcx] - vinsertf128 ymm10, ymm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+r9], 1 - vinsertf128 ymm15, ymm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+r10], 1 - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+rax] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+rax] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+rax] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+rax] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+rcx] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+rcx] + vinsertf128 ymm10, ymm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+r9], 1 + vinsertf128 ymm15, ymm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+r10], 1 + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+rax] vunpcklpd ymm9, ymm10, ymm15 vunpckhpd ymm12, ymm10, ymm15 - vinsertf128 ymm8, ymm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+r9], 1 - vinsertf128 ymm4, ymm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+r9], 1 - vinsertf128 ymm10, ymm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+r9], 1 - vinsertf128 ymm7, ymm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+r10], 1 - vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+r10], 1 - vinsertf128 ymm15, ymm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+r10], 1 - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+rcx] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+rax] + vinsertf128 ymm8, ymm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+r9], 1 + vinsertf128 ymm4, ymm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+r9], 1 + vinsertf128 ymm10, ymm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+r9], 1 + vinsertf128 ymm7, ymm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+r10], 1 + vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+r10], 1 + vinsertf128 ymm15, ymm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+r10], 1 + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+rcx] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+rax] vunpcklpd ymm11, ymm8, ymm7 vunpckhpd ymm8, ymm8, ymm7 vunpcklpd ymm7, ymm4, ymm3 vunpckhpd ymm6, ymm4, ymm3 vunpcklpd ymm5, ymm10, ymm15 vunpckhpd ymm4, ymm10, ymm15 - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+rax] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+rcx] - vinsertf128 ymm2, ymm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+r9], 1 - vinsertf128 ymm1, ymm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+r10], 1 + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+rax] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+rcx] + vinsertf128 ymm2, ymm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+r9], 1 + vinsertf128 ymm1, ymm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+r10], 1 vunpcklpd ymm3, ymm2, ymm1 vunpckhpd ymm2, ymm2, ymm1 - vinsertf128 ymm13, ymm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+r9], 1 - vinsertf128 ymm14, ymm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+r10], 1 + vinsertf128 ymm13, ymm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+r9], 1 + vinsertf128 ymm14, ymm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+r10], 1 vunpcklpd ymm1, ymm13, ymm14 vunpckhpd ymm10, ymm13, ymm14 - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+rcx] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+rax] - vinsertf128 ymm13, ymm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+r9], 1 - vinsertf128 ymm14, ymm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+r10], 1 + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+rcx] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+rax] + vinsertf128 ymm13, ymm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+r9], 1 + vinsertf128 ymm14, ymm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+r10], 1 vunpcklpd ymm15, ymm13, ymm14 vaddpd ymm14, ymm0, ymm15 vmulpd ymm0, ymm14, ymm10 @@ -155,7 +155,7 @@ L1:: vmulpd ymm13, ymm14, ymm8 vmulpd ymm0, ymm14, ymm13 vaddpd ymm2, ymm0, ymm9 - vmovupd ymm9, YMMWORD PTR [__svml_dtanh_ha_data_internal+10304] + vmovupd ymm9, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+10304] vandpd ymm0, ymm11, ymm9 vandpd ymm9, ymm14, ymm9 vmulpd ymm13, ymm0, ymm9 @@ -233,19 +233,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_tanh4_ha_e9 ENDP +__jsvml_tanh4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh4_ha_e9_B1_B3: +_unwind___jsvml_tanh4_ha_e9_B1_B3: DD 1603841 DD 4379769 DD 2058353 @@ -267,19 +267,19 @@ _unwind___svml_tanh4_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_tanh4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanh4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh4_ha_e9_B6_B10: +_unwind___jsvml_tanh4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_tanh4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanh4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -288,7 +288,7 @@ _unwind___svml_tanh4_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_tanh4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_tanh4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -302,9 +302,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh4_ha_l9 + PUBLIC __jsvml_tanh4_ha_l9 -__svml_tanh4_ha_l9 PROC EXPORT +__jsvml_tanh4_ha_l9 PROC EXPORT _B2_1:: @@ -331,20 +331,20 @@ L32:: lea r13, QWORD PTR [111+rsp] and r13, -64 vmovupd YMMWORD PTR [32+r13], ymm0 - vmovups xmm10, XMMWORD PTR [__svml_dtanh_ha_data_internal+10688] - vandpd ymm15, ymm0, YMMWORD PTR [__svml_dtanh_ha_data_internal+10432] - vandpd ymm5, ymm0, YMMWORD PTR [__svml_dtanh_ha_data_internal+10368] + vmovups xmm10, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10688] + vandpd ymm15, ymm0, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+10432] + vandpd ymm5, ymm0, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+10368] vmovupd YMMWORD PTR [r13], ymm5 mov QWORD PTR [536+rsp], r13 vextracti128 xmm4, ymm0, 1 vshufps xmm3, xmm0, xmm4, 221 - vpand xmm2, xmm3, XMMWORD PTR [__svml_dtanh_ha_data_internal+10496] - vpsubd xmm14, xmm2, XMMWORD PTR [__svml_dtanh_ha_data_internal+10624] + vpand xmm2, xmm3, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10496] + vpsubd xmm14, xmm2, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10624] vpcmpgtd xmm12, xmm14, xmm13 vpcmpgtd xmm9, xmm14, xmm10 vpand xmm11, xmm14, xmm12 vblendvps xmm8, xmm11, xmm10, xmm9 - vpcmpgtd xmm1, xmm2, XMMWORD PTR [__svml_dtanh_ha_data_internal+10560] + vpcmpgtd xmm1, xmm2, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10560] vpsrld xmm7, xmm8, 10 vmovd ecx, xmm7 vmovmskps r8d, xmm1 @@ -356,46 +356,46 @@ L32:: vpextrd r10d, xmm7, 3 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+rcx] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+rax] - vmovupd xmm9, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+rax] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+rcx] - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+rax] - vinsertf128 ymm4, ymm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+r9], 1 - vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+rdx+r10], 1 - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+rcx] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+rax] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+rax] + vmovupd xmm9, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+rax] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+rcx] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+rax] + vinsertf128 ymm4, ymm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+r9], 1 + vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+rdx+r10], 1 + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+rax] vunpcklpd ymm14, ymm4, ymm3 vunpckhpd ymm13, ymm4, ymm3 - vinsertf128 ymm8, ymm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+r9], 1 - vinsertf128 ymm4, ymm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+r9], 1 - vinsertf128 ymm7, ymm9, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+rdx+r10], 1 - vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+rdx+r10], 1 + vinsertf128 ymm8, ymm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+r9], 1 + vinsertf128 ymm4, ymm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+r9], 1 + vinsertf128 ymm7, ymm9, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+rdx+r10], 1 + vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+rdx+r10], 1 vunpcklpd ymm10, ymm8, ymm7 vunpckhpd ymm9, ymm8, ymm7 vunpcklpd ymm8, ymm4, ymm3 vunpckhpd ymm7, ymm4, ymm3 - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+rcx] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+rax] - vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+r9], 1 - vinsertf128 ymm11, ymm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+rdx+r10], 1 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+rax] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+rax] + vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+r9], 1 + vinsertf128 ymm11, ymm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+rdx+r10], 1 + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+rax] vunpcklpd ymm12, ymm2, ymm11 vunpckhpd ymm11, ymm2, ymm11 - vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+r9], 1 - vinsertf128 ymm5, ymm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+rdx+r10], 1 + vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+r9], 1 + vinsertf128 ymm5, ymm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+rdx+r10], 1 vunpcklpd ymm6, ymm2, ymm5 vunpckhpd ymm5, ymm2, ymm5 - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+rax] - vinsertf128 ymm0, ymm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+r9], 1 - vinsertf128 ymm1, ymm3, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+rdx+r10], 1 + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+rax] + vinsertf128 ymm0, ymm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+r9], 1 + vinsertf128 ymm1, ymm3, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+rdx+r10], 1 vunpcklpd ymm4, ymm0, ymm1 vunpckhpd ymm3, ymm0, ymm1 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+rcx] - vinsertf128 ymm1, ymm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+r9], 1 - vinsertf128 ymm2, ymm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+rdx+r10], 1 + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+rcx] + vinsertf128 ymm1, ymm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+r9], 1 + vinsertf128 ymm2, ymm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+rdx+r10], 1 vunpcklpd ymm0, ymm1, ymm2 vaddpd ymm15, ymm15, ymm0 vfmadd213pd ymm3, ymm15, ymm4 @@ -476,19 +476,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_tanh4_ha_l9 ENDP +__jsvml_tanh4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh4_ha_l9_B1_B3: +_unwind___jsvml_tanh4_ha_l9_B1_B3: DD 1603841 DD 4379769 DD 2058353 @@ -510,19 +510,19 @@ _unwind___svml_tanh4_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_tanh4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanh4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh4_ha_l9_B6_B10: +_unwind___jsvml_tanh4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_tanh4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanh4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -531,7 +531,7 @@ _unwind___svml_tanh4_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_tanh4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_tanh4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -545,9 +545,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh1_ha_ex + PUBLIC __jsvml_tanh1_ha_ex -__svml_tanh1_ha_ex PROC EXPORT +__jsvml_tanh1_ha_ex PROC EXPORT _B3_1:: @@ -582,9 +582,9 @@ L63:: pxor xmm7, xmm7 pshufd xmm9, xmm0, 85 lea r13, QWORD PTR [95+rsp] - movsd xmm4, QWORD PTR [__svml_dtanh_ha_data_internal+10368] + movsd xmm4, QWORD PTR [__jsvml_dtanh_ha_data_internal+10368] pand xmm9, xmm5 - movsd xmm3, QWORD PTR [__svml_dtanh_ha_data_internal+10432] + movsd xmm3, QWORD PTR [__jsvml_dtanh_ha_data_internal+10432] movd xmm5, r8d movups XMMWORD PTR [241+r13], xmm0 andps xmm3, xmm0 @@ -611,42 +611,42 @@ L63:: movsxd r10, r10d and eax, 1 mov QWORD PTR [352+rsp], r13 - movups xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r11+r10] - movsd xmm0, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2712+r11+r10] + movups xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r11+r10] + movsd xmm0, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2712+r11+r10] addsd xmm3, xmm14 unpcklpd xmm0, xmm0 mulsd xmm0, xmm3 - movups xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r11+r10] - movsd xmm5, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2696+r11+r10] + movups xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r11+r10] + movsd xmm5, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2696+r11+r10] addsd xmm0, xmm15 mulsd xmm0, xmm3 unpcklpd xmm5, xmm5 - movups xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r11+r10] + movups xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r11+r10] addsd xmm0, xmm5 mulsd xmm0, xmm3 - movsd xmm7, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2680+r11+r10] + movsd xmm7, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2680+r11+r10] addsd xmm0, xmm6 mulsd xmm0, xmm3 unpcklpd xmm7, xmm7 - movups xmm8, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r11+r10] + movups xmm8, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r11+r10] addsd xmm0, xmm7 mulsd xmm0, xmm3 - movsd xmm9, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2664+r11+r10] + movsd xmm9, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2664+r11+r10] addsd xmm0, xmm8 mulsd xmm0, xmm3 unpcklpd xmm9, xmm9 - movups xmm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r11+r10] + movups xmm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r11+r10] addsd xmm0, xmm9 mulsd xmm0, xmm3 - movsd xmm11, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2648+r11+r10] + movsd xmm11, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2648+r11+r10] addsd xmm0, xmm10 mulsd xmm0, xmm3 unpcklpd xmm11, xmm11 - movups xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r11+r10] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r11+r10] addsd xmm0, xmm11 mulsd xmm0, xmm3 movaps xmm5, xmm1 - movsd xmm14, QWORD PTR [__svml_dtanh_ha_data_internal+10304] + movsd xmm14, QWORD PTR [__jsvml_dtanh_ha_data_internal+10304] andps xmm5, xmm14 andps xmm14, xmm3 subsd xmm1, xmm5 @@ -659,9 +659,9 @@ L63:: mulsd xmm1, xmm14 mulsd xmm6, xmm14 addsd xmm5, xmm13 - movups xmm12, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r11+r10] + movups xmm12, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r11+r10] movaps xmm3, xmm6 - movsd xmm2, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2632+r11+r10] + movsd xmm2, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2632+r11+r10] addsd xmm0, xmm12 addsd xmm1, xmm5 unpcklpd xmm2, xmm2 @@ -712,19 +712,19 @@ _B3_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B3_4 ALIGN 16 _B3_7:: -__svml_tanh1_ha_ex ENDP +__jsvml_tanh1_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh1_ha_ex_B1_B6: +_unwind___jsvml_tanh1_ha_ex_B1_B6: DD 1613313 DD 1430686 DD 1337489 @@ -746,7 +746,7 @@ _unwind___svml_tanh1_ha_ex_B1_B6: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_tanh1_ha_ex_B1_B6 + DD imagerel _unwind___jsvml_tanh1_ha_ex_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -760,9 +760,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh2_ha_l9 + PUBLIC __jsvml_tanh2_ha_l9 -__svml_tanh2_ha_l9 PROC EXPORT +__jsvml_tanh2_ha_l9 PROC EXPORT _B4_1:: @@ -787,51 +787,51 @@ L88:: vmovups XMMWORD PTR [320+rsp], xmm6 mov QWORD PTR [368+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovq xmm2, QWORD PTR [__svml_dtanh_ha_data_internal+10496] + vmovq xmm2, QWORD PTR [__jsvml_dtanh_ha_data_internal+10496] and r13, -64 vpshufd xmm5, xmm0, 221 - vmovq xmm15, QWORD PTR [__svml_dtanh_ha_data_internal+10624] + vmovq xmm15, QWORD PTR [__jsvml_dtanh_ha_data_internal+10624] vpand xmm14, xmm5, xmm2 vpsubd xmm12, xmm14, xmm15 - vmovq xmm9, QWORD PTR [__svml_dtanh_ha_data_internal+10688] + vmovq xmm9, QWORD PTR [__jsvml_dtanh_ha_data_internal+10688] vpcmpgtd xmm10, xmm12, xmm11 vpand xmm8, xmm12, xmm10 vpcmpgtd xmm6, xmm12, xmm9 vblendvps xmm7, xmm8, xmm9, xmm6 - vandpd xmm4, xmm0, XMMWORD PTR [__svml_dtanh_ha_data_internal+10368] + vandpd xmm4, xmm0, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10368] vmovupd XMMWORD PTR [352+rsp], xmm4 vpsrld xmm4, xmm7, 10 vmovd eax, xmm4 - vmovq xmm3, QWORD PTR [__svml_dtanh_ha_data_internal+10560] + vmovq xmm3, QWORD PTR [__jsvml_dtanh_ha_data_internal+10560] vpcmpgtd xmm1, xmm14, xmm3 vpextrd ecx, xmm4, 1 movsxd rax, eax movsxd rcx, ecx vmovupd XMMWORD PTR [32+rsp], xmm0 - vandpd xmm13, xmm0, XMMWORD PTR [__svml_dtanh_ha_data_internal+10432] + vandpd xmm13, xmm0, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10432] vmovmskps edx, xmm1 - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r8+rax] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r8+rax] - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r8+rax] - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r8+rax] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r8+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r8+rcx] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r8+rcx] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r8+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r8+rax] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r8+rax] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r8+rax] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r8+rax] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r8+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r8+rcx] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r8+rcx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r8+rcx] vunpcklpd xmm12, xmm5, xmm2 vunpckhpd xmm11, xmm5, xmm2 vunpcklpd xmm10, xmm3, xmm1 vunpckhpd xmm9, xmm3, xmm1 - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r8+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r8+rcx] vunpcklpd xmm8, xmm0, xmm14 vunpckhpd xmm7, xmm0, xmm14 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r8+rcx] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r8+rcx] vunpcklpd xmm6, xmm15, xmm4 vunpckhpd xmm5, xmm15, xmm4 - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r8+rcx] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r8+rax] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r8+rax] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r8+rax] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r8+rcx] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r8+rax] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r8+rax] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r8+rax] vunpcklpd xmm4, xmm2, xmm3 vunpckhpd xmm3, xmm2, xmm3 vunpcklpd xmm2, xmm1, xmm0 @@ -918,19 +918,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_tanh2_ha_l9 ENDP +__jsvml_tanh2_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh2_ha_l9_B1_B3: +_unwind___jsvml_tanh2_ha_l9_B1_B3: DD 1603841 DD 3069049 DD 1337457 @@ -952,19 +952,19 @@ _unwind___svml_tanh2_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_tanh2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanh2_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh2_ha_l9_B6_B10: +_unwind___jsvml_tanh2_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_tanh2_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanh2_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -973,7 +973,7 @@ _unwind___svml_tanh2_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_tanh2_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_tanh2_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -987,9 +987,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh1_ha_l9 + PUBLIC __jsvml_tanh1_ha_l9 -__svml_tanh1_ha_l9 PROC EXPORT +__jsvml_tanh1_ha_l9 PROC EXPORT _B5_1:: @@ -1023,9 +1023,9 @@ L119:: lea r13, QWORD PTR [95+rsp] vpshufd xmm3, xmm0, 85 and r13, -64 - vmovsd xmm2, QWORD PTR [__svml_dtanh_ha_data_internal+10368] + vmovsd xmm2, QWORD PTR [__jsvml_dtanh_ha_data_internal+10368] vpand xmm15, xmm3, xmm4 - vmovsd xmm1, QWORD PTR [__svml_dtanh_ha_data_internal+10432] + vmovsd xmm1, QWORD PTR [__jsvml_dtanh_ha_data_internal+10432] vandpd xmm12, xmm0, xmm2 vmovupd XMMWORD PTR [336+rsp], xmm0 vandpd xmm13, xmm0, xmm1 @@ -1041,24 +1041,24 @@ L119:: vmovd r9d, xmm5 movsxd r9, r9d mov QWORD PTR [352+rsp], r13 - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r10+r9] - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r10+r9] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r10+r9] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r10+r9] vaddsd xmm13, xmm13, xmm15 - vmovddup xmm11, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2712+r10+r9] + vmovddup xmm11, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2712+r10+r9] vfmadd213sd xmm11, xmm13, xmm0 - vmovddup xmm1, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2696+r10+r9] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r10+r9] - vmovddup xmm3, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2680+r10+r9] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r10+r9] + vmovddup xmm1, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2696+r10+r9] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r10+r9] + vmovddup xmm3, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2680+r10+r9] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r10+r9] vfmadd213sd xmm11, xmm13, xmm1 - vmovddup xmm5, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2664+r10+r9] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r10+r9] - vmovddup xmm7, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2648+r10+r9] - vmovupd xmm9, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r10+r9] + vmovddup xmm5, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2664+r10+r9] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r10+r9] + vmovddup xmm7, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2648+r10+r9] + vmovupd xmm9, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r10+r9] vfmadd213sd xmm11, xmm13, xmm2 - vmovddup xmm10, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2632+r10+r9] + vmovddup xmm10, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2632+r10+r9] vfmadd213sd xmm11, xmm13, xmm3 - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r10+r9] + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r10+r9] vfmadd213sd xmm11, xmm13, xmm4 vfmadd213sd xmm11, xmm13, xmm5 vfmadd213sd xmm11, xmm13, xmm6 @@ -1113,19 +1113,19 @@ _B5_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B5_4 ALIGN 16 _B5_7:: -__svml_tanh1_ha_l9 ENDP +__jsvml_tanh1_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh1_ha_l9_B1_B6: +_unwind___jsvml_tanh1_ha_l9_B1_B6: DD 1612289 DD 1430682 DD 1206418 @@ -1147,7 +1147,7 @@ _unwind___svml_tanh1_ha_l9_B1_B6: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_tanh1_ha_l9_B1_B6 + DD imagerel _unwind___jsvml_tanh1_ha_l9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1161,9 +1161,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh2_ha_ex + PUBLIC __jsvml_tanh2_ha_ex -__svml_tanh2_ha_ex PROC EXPORT +__jsvml_tanh2_ha_ex PROC EXPORT _B6_1:: @@ -1188,18 +1188,18 @@ L144:: movups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [368+rsp], r13 lea r13, QWORD PTR [111+rsp] - movq xmm4, QWORD PTR [__svml_dtanh_ha_data_internal+10496] + movq xmm4, QWORD PTR [__jsvml_dtanh_ha_data_internal+10496] and r13, -64 pshufd xmm11, xmm0, 221 - movq xmm13, QWORD PTR [__svml_dtanh_ha_data_internal+10624] + movq xmm13, QWORD PTR [__jsvml_dtanh_ha_data_internal+10624] pand xmm11, xmm4 - movq xmm2, QWORD PTR [__svml_dtanh_ha_data_internal+10752] + movq xmm2, QWORD PTR [__jsvml_dtanh_ha_data_internal+10752] movdqa xmm3, xmm11 - movups xmm1, XMMWORD PTR [__svml_dtanh_ha_data_internal+10368] + movups xmm1, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10368] pcmpgtd xmm2, xmm11 psubd xmm11, xmm13 andps xmm1, xmm0 - movq xmm9, QWORD PTR [__svml_dtanh_ha_data_internal+10688] + movq xmm9, QWORD PTR [__jsvml_dtanh_ha_data_internal+10688] movdqa xmm15, xmm11 movups XMMWORD PTR [352+rsp], xmm1 movdqa xmm1, xmm11 @@ -1213,49 +1213,49 @@ L144:: psrld xmm10, 10 movd edx, xmm10 pshufd xmm8, xmm10, 1 - movq xmm5, QWORD PTR [__svml_dtanh_ha_data_internal+10560] + movq xmm5, QWORD PTR [__jsvml_dtanh_ha_data_internal+10560] movd ecx, xmm8 pcmpgtd xmm3, xmm5 por xmm3, xmm2 - movups xmm12, XMMWORD PTR [__svml_dtanh_ha_data_internal+10432] + movups xmm12, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10432] movsxd rdx, edx andps xmm12, xmm0 movsxd rcx, ecx movups XMMWORD PTR [32+rsp], xmm0 movmskps eax, xmm3 - movups xmm11, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r8+rdx] - movups xmm8, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r8+rdx] + movups xmm11, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r8+rdx] + movups xmm8, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r8+rdx] movaps xmm10, xmm11 - movups xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r8+rcx] + movups xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r8+rcx] movaps xmm9, xmm8 - movups xmm7, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r8+rcx] + movups xmm7, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r8+rcx] and eax, 3 unpcklpd xmm10, xmm6 unpckhpd xmm11, xmm6 - movups xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r8+rdx] + movups xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r8+rdx] unpcklpd xmm9, xmm7 unpckhpd xmm8, xmm7 movaps xmm7, xmm6 - movups xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r8+rcx] + movups xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r8+rcx] unpcklpd xmm7, xmm4 unpckhpd xmm6, xmm4 - movups xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r8+rdx] - movups xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r8+rcx] + movups xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r8+rdx] + movups xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r8+rcx] movaps xmm5, xmm4 unpcklpd xmm5, xmm2 unpckhpd xmm4, xmm2 - movups xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r8+rdx] - movups xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r8+rdx] + movups xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r8+rdx] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r8+rdx] movaps xmm3, xmm2 - movups xmm0, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r8+rcx] - movups xmm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r8+rcx] + movups xmm0, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r8+rcx] + movups xmm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r8+rcx] unpcklpd xmm3, xmm0 unpckhpd xmm2, xmm0 movaps xmm0, xmm1 unpcklpd xmm0, xmm13 unpckhpd xmm1, xmm13 - movups xmm13, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r8+rdx] - movups xmm14, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r8+rcx] + movups xmm13, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r8+rdx] + movups xmm14, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r8+rcx] movaps xmm15, xmm13 unpcklpd xmm15, xmm14 addpd xmm12, xmm15 @@ -1276,7 +1276,7 @@ L144:: mulpd xmm1, xmm12 addpd xmm1, xmm8 mulpd xmm1, xmm12 - movups xmm5, XMMWORD PTR [__svml_dtanh_ha_data_internal+10304] + movups xmm5, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10304] movaps xmm3, xmm5 andps xmm3, xmm9 andps xmm5, xmm12 @@ -1365,19 +1365,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_tanh2_ha_ex ENDP +__jsvml_tanh2_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh2_ha_ex_B1_B3: +_unwind___jsvml_tanh2_ha_ex_B1_B3: DD 1603329 DD 3069047 DD 1075311 @@ -1399,19 +1399,19 @@ _unwind___svml_tanh2_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_tanh2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_tanh2_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh2_ha_ex_B6_B10: +_unwind___jsvml_tanh2_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_tanh2_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_tanh2_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1420,7 +1420,7 @@ _unwind___svml_tanh2_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_tanh2_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_tanh2_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1434,9 +1434,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh2_ha_e9 + PUBLIC __jsvml_tanh2_ha_e9 -__svml_tanh2_ha_e9 PROC EXPORT +__jsvml_tanh2_ha_e9 PROC EXPORT _B7_1:: @@ -1462,24 +1462,24 @@ L175:: vmovups XMMWORD PTR [320+rsp], xmm6 mov QWORD PTR [368+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovq xmm2, QWORD PTR [__svml_dtanh_ha_data_internal+10496] + vmovq xmm2, QWORD PTR [__jsvml_dtanh_ha_data_internal+10496] and r13, -64 vpshufd xmm5, xmm4, 221 - vmovq xmm11, QWORD PTR [__svml_dtanh_ha_data_internal+10624] + vmovq xmm11, QWORD PTR [__jsvml_dtanh_ha_data_internal+10624] vpand xmm10, xmm5, xmm2 vpsubd xmm6, xmm10, xmm11 - vmovq xmm15, QWORD PTR [__svml_dtanh_ha_data_internal+10688] + vmovq xmm15, QWORD PTR [__jsvml_dtanh_ha_data_internal+10688] vpcmpgtd xmm9, xmm6, xmm8 vmovupd XMMWORD PTR [32+rsp], xmm4 vpand xmm7, xmm6, xmm9 - vandpd xmm0, xmm4, XMMWORD PTR [__svml_dtanh_ha_data_internal+10432] - vandpd xmm1, xmm4, XMMWORD PTR [__svml_dtanh_ha_data_internal+10368] + vandpd xmm0, xmm4, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10432] + vandpd xmm1, xmm4, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10368] vpcmpgtd xmm4, xmm6, xmm15 vblendvps xmm5, xmm7, xmm15, xmm4 - vmovq xmm3, QWORD PTR [__svml_dtanh_ha_data_internal+10560] + vmovq xmm3, QWORD PTR [__jsvml_dtanh_ha_data_internal+10560] vpsrld xmm2, xmm5, 10 vmovd eax, xmm2 - vmovq xmm13, QWORD PTR [__svml_dtanh_ha_data_internal+10752] + vmovq xmm13, QWORD PTR [__jsvml_dtanh_ha_data_internal+10752] vmovupd XMMWORD PTR [352+rsp], xmm1 vpcmpgtd xmm1, xmm10, xmm3 vpextrd ecx, xmm2, 1 @@ -1488,24 +1488,24 @@ L175:: vpor xmm14, xmm1, xmm12 movsxd rcx, ecx vmovmskps edx, xmm14 - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r8+rax] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r8+rax] - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r8+rcx] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r8+rcx] - vmovupd xmm9, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r8+rcx] - vmovupd xmm7, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r8+rcx] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r8+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r8+rax] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r8+rax] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r8+rcx] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r8+rcx] + vmovupd xmm9, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r8+rcx] + vmovupd xmm7, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r8+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r8+rcx] vunpcklpd xmm14, xmm3, xmm15 vunpckhpd xmm13, xmm3, xmm15 - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r8+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r8+rcx] vunpcklpd xmm12, xmm1, xmm10 vunpckhpd xmm10, xmm1, xmm10 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r8+rcx] - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r8+rax] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r8+rax] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r8+rax] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r8+rax] - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r8+rax] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r8+rcx] + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r8+rax] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r8+rax] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r8+rax] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r8+rax] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r8+rax] vunpcklpd xmm11, xmm8, xmm9 vunpckhpd xmm8, xmm8, xmm9 vunpcklpd xmm9, xmm6, xmm7 @@ -1535,7 +1535,7 @@ L175:: vmulpd xmm0, xmm1, xmm10 vmulpd xmm2, xmm1, xmm0 vaddpd xmm5, xmm2, xmm14 - vmovupd xmm14, XMMWORD PTR [__svml_dtanh_ha_data_internal+10304] + vmovupd xmm14, XMMWORD PTR [__jsvml_dtanh_ha_data_internal+10304] vandpd xmm2, xmm12, xmm14 vandpd xmm14, xmm1, xmm14 vmulpd xmm0, xmm2, xmm14 @@ -1614,19 +1614,19 @@ _B7_10:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B7_8 ALIGN 16 _B7_11:: -__svml_tanh2_ha_e9 ENDP +__jsvml_tanh2_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh2_ha_e9_B1_B3: +_unwind___jsvml_tanh2_ha_e9_B1_B3: DD 1604865 DD 3069053 DD 1337461 @@ -1648,19 +1648,19 @@ _unwind___svml_tanh2_ha_e9_B1_B3: DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_tanh2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanh2_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh2_ha_e9_B6_B10: +_unwind___jsvml_tanh2_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B7_1 DD imagerel _B7_6 - DD imagerel _unwind___svml_tanh2_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanh2_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1669,7 +1669,7 @@ _unwind___svml_tanh2_ha_e9_B6_B10: DD imagerel _B7_6 DD imagerel _B7_11 - DD imagerel _unwind___svml_tanh2_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_tanh2_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1683,9 +1683,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh1_ha_e9 + PUBLIC __jsvml_tanh1_ha_e9 -__svml_tanh1_ha_e9 PROC EXPORT +__jsvml_tanh1_ha_e9 PROC EXPORT _B8_1:: @@ -1722,7 +1722,7 @@ L206:: vpsubd xmm6, xmm10, xmm9 mov QWORD PTR [168+rsp], r13 vpcmpgtd xmm7, xmm6, xmm8 - vmovsd xmm5, QWORD PTR [__svml_dtanh_ha_data_internal+10368] + vmovsd xmm5, QWORD PTR [__jsvml_dtanh_ha_data_internal+10368] vpand xmm4, xmm6, xmm7 vandpd xmm15, xmm0, xmm5 vmovd xmm5, r9d @@ -1730,7 +1730,7 @@ L206:: lea r13, QWORD PTR [95+rsp] vblendvps xmm2, xmm4, XMMWORD PTR [_2il0floatpacket_17], xmm3 and r13, -64 - vmovsd xmm1, QWORD PTR [__svml_dtanh_ha_data_internal+10432] + vmovsd xmm1, QWORD PTR [__jsvml_dtanh_ha_data_internal+10432] vpsrld xmm11, xmm2, 10 vandpd xmm14, xmm0, xmm1 vmovd r10d, xmm11 @@ -1740,45 +1740,45 @@ L206:: movsxd r10, r10d vpor xmm12, xmm13, xmm1 vmovmskps eax, xmm12 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2720+r11+r10] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2720+r11+r10] vaddsd xmm1, xmm14, xmm1 - vmovddup xmm11, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2712+r11+r10] + vmovddup xmm11, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2712+r11+r10] vmulsd xmm14, xmm11, xmm1 - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2704+r11+r10] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2704+r11+r10] vaddsd xmm0, xmm14, xmm2 vmulsd xmm2, xmm0, xmm1 - vmovddup xmm3, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2696+r11+r10] + vmovddup xmm3, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2696+r11+r10] vaddsd xmm3, xmm2, xmm3 vmulsd xmm11, xmm3, xmm1 - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2688+r11+r10] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2688+r11+r10] vaddsd xmm4, xmm11, xmm4 vmulsd xmm14, xmm4, xmm1 - vmovddup xmm5, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2680+r11+r10] + vmovddup xmm5, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2680+r11+r10] vaddsd xmm5, xmm14, xmm5 vmulsd xmm0, xmm5, xmm1 - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2672+r11+r10] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2672+r11+r10] vaddsd xmm6, xmm0, xmm6 vmulsd xmm0, xmm6, xmm1 - vmovddup xmm7, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2664+r11+r10] + vmovddup xmm7, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2664+r11+r10] vaddsd xmm7, xmm0, xmm7 vmulsd xmm0, xmm7, xmm1 - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2656+r11+r10] + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2656+r11+r10] vaddsd xmm8, xmm0, xmm8 vmulsd xmm0, xmm8, xmm1 - vmovddup xmm9, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2648+r11+r10] + vmovddup xmm9, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2648+r11+r10] vaddsd xmm9, xmm0, xmm9 vmulsd xmm0, xmm9, xmm1 vmulsd xmm2, xmm0, xmm1 - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2624+r11+r10] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2624+r11+r10] vaddsd xmm5, xmm2, xmm10 - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2640+r11+r10] - vmovsd xmm10, QWORD PTR [__svml_dtanh_ha_data_internal+10304] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2640+r11+r10] + vmovsd xmm10, QWORD PTR [__jsvml_dtanh_ha_data_internal+10304] vandpd xmm2, xmm12, xmm10 vandpd xmm4, xmm1, xmm10 vmulsd xmm0, xmm2, xmm4 vsubsd xmm3, xmm12, xmm2 vsubsd xmm1, xmm1, xmm4 - vmovddup xmm13, QWORD PTR [imagerel(__svml_dtanh_ha_data_internal)+2632+r11+r10] + vmovddup xmm13, QWORD PTR [imagerel(__jsvml_dtanh_ha_data_internal)+2632+r11+r10] vaddsd xmm9, xmm0, xmm13 vmulsd xmm10, xmm3, xmm1 vmulsd xmm12, xmm2, xmm1 @@ -1831,19 +1831,19 @@ _B8_6:: lea rcx, QWORD PTR [r13] lea rdx, QWORD PTR [64+r13] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B8_4 ALIGN 16 _B8_7:: -__svml_tanh1_ha_e9 ENDP +__jsvml_tanh1_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh1_ha_e9_B1_B6: +_unwind___jsvml_tanh1_ha_e9_B1_B6: DD 1618689 DD 1430707 DD 1140902 @@ -1865,7 +1865,7 @@ _unwind___svml_tanh1_ha_e9_B1_B6: DD imagerel _B8_1 DD imagerel _B8_7 - DD imagerel _unwind___svml_tanh1_ha_e9_B1_B6 + DD imagerel _unwind___jsvml_tanh1_ha_e9_B1_B6 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1879,9 +1879,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanh8_ha_z0 + PUBLIC __jsvml_tanh8_ha_z0 -__svml_tanh8_ha_z0 PROC EXPORT +__jsvml_tanh8_ha_z0 PROC EXPORT _B9_1:: @@ -1901,57 +1901,57 @@ L231:: vpmovqd ymm1, zmm23 mov QWORD PTR [1064+rsp], r13 lea r13, QWORD PTR [927+rsp] - vpand ymm3, ymm1, YMMWORD PTR [__svml_dtanh_ha_data_internal+2432] + vpand ymm3, ymm1, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+2432] and r13, -64 - vmovups zmm25, ZMMWORD PTR [__svml_dtanh_ha_data_internal] - vmovups zmm26, ZMMWORD PTR [__svml_dtanh_ha_data_internal+2176] - vmovups zmm18, ZMMWORD PTR [__svml_dtanh_ha_data_internal+2304] - vmovups zmm27, ZMMWORD PTR [__svml_dtanh_ha_data_internal+2048] - vmovups zmm28, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1920] - vmovups zmm29, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1792] - vmovups zmm30, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1664] - vmovups zmm31, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1536] - vmovups zmm23, ZMMWORD PTR [__svml_dtanh_ha_data_internal+768] - vmovups zmm20, ZMMWORD PTR [__svml_dtanh_ha_data_internal+384] - vmovups zmm21, ZMMWORD PTR [__svml_dtanh_ha_data_internal+128] - vpsubd ymm4, ymm3, YMMWORD PTR [__svml_dtanh_ha_data_internal+2496] - vandpd zmm24, zmm0, ZMMWORD PTR [__svml_dtanh_ha_data_internal+10432] - vpcmpgtd ymm2, ymm3, YMMWORD PTR [__svml_dtanh_ha_data_internal+10560] + vmovups zmm25, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal] + vmovups zmm26, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+2176] + vmovups zmm18, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+2304] + vmovups zmm27, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+2048] + vmovups zmm28, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1920] + vmovups zmm29, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1792] + vmovups zmm30, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1664] + vmovups zmm31, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1536] + vmovups zmm23, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+768] + vmovups zmm20, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+384] + vmovups zmm21, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+128] + vpsubd ymm4, ymm3, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+2496] + vandpd zmm24, zmm0, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+10432] + vpcmpgtd ymm2, ymm3, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+10560] vpmaxsd ymm1, ymm4, ymm5 vmovmskps r8d, ymm2 - vpminsd ymm2, ymm1, YMMWORD PTR [__svml_dtanh_ha_data_internal+2560] + vpminsd ymm2, ymm1, YMMWORD PTR [__jsvml_dtanh_ha_data_internal+2560] vpsrld ymm3, ymm2, 19 - vmovups zmm1, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1408] - vmovups zmm2, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1280] - vmovups zmm4, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1024] - vmovups zmm5, ZMMWORD PTR [__svml_dtanh_ha_data_internal+896] + vmovups zmm1, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1408] + vmovups zmm2, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1280] + vmovups zmm4, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1024] + vmovups zmm5, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+896] vpmovzxdq zmm22, ymm3 - vmovups zmm3, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1152] - vpermt2pd zmm25, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+64] - vpermt2pd zmm26, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+2240] - vpermt2pd zmm18, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+2368] + vmovups zmm3, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1152] + vpermt2pd zmm25, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+64] + vpermt2pd zmm26, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+2240] + vpermt2pd zmm18, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+2368] vsubpd zmm19, zmm24, zmm25 {rn-sae} - vpermt2pd zmm27, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+2112] - vpermt2pd zmm28, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1984] - vpermt2pd zmm29, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1856] - vpermt2pd zmm30, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1728] - vpermt2pd zmm31, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1600] - vpermt2pd zmm1, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1472] - vpermt2pd zmm2, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1344] - vpermt2pd zmm3, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1216] - vpermt2pd zmm4, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+1088] - vpermt2pd zmm5, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+960] - vpermt2pd zmm23, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+832] - vpermt2pd zmm20, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+448] - vpermt2pd zmm21, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+192] + vpermt2pd zmm27, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+2112] + vpermt2pd zmm28, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1984] + vpermt2pd zmm29, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1856] + vpermt2pd zmm30, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1728] + vpermt2pd zmm31, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1600] + vpermt2pd zmm1, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1472] + vpermt2pd zmm2, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1344] + vpermt2pd zmm3, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1216] + vpermt2pd zmm4, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+1088] + vpermt2pd zmm5, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+960] + vpermt2pd zmm23, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+832] + vpermt2pd zmm20, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+448] + vpermt2pd zmm21, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+192] vfmadd213pd zmm18, zmm19, zmm26 {rn-sae} - vmovups zmm24, ZMMWORD PTR [__svml_dtanh_ha_data_internal+640] - vmovups zmm25, ZMMWORD PTR [__svml_dtanh_ha_data_internal+512] - vmovups zmm26, ZMMWORD PTR [__svml_dtanh_ha_data_internal+256] + vmovups zmm24, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+640] + vmovups zmm25, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+512] + vmovups zmm26, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+256] vfmadd213pd zmm18, zmm19, zmm27 {rn-sae} - vpermt2pd zmm24, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+704] - vpermt2pd zmm25, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+576] - vpermt2pd zmm26, zmm22, ZMMWORD PTR [__svml_dtanh_ha_data_internal+320] + vpermt2pd zmm24, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+704] + vpermt2pd zmm25, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+576] + vpermt2pd zmm26, zmm22, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+320] vfmadd213pd zmm18, zmm19, zmm28 {rn-sae} vfmadd213pd zmm18, zmm19, zmm29 {rn-sae} vfmadd213pd zmm18, zmm19, zmm30 {rn-sae} @@ -1969,7 +1969,7 @@ L231:: vfmadd213pd zmm20, zmm19, zmm18 {rn-sae} vaddpd zmm1, zmm20, zmm21 {rn-sae} mov QWORD PTR [1328+rsp], r13 - vpternlogq zmm1, zmm0, ZMMWORD PTR [__svml_dtanh_ha_data_internal+10368], 248 + vpternlogq zmm1, zmm0, ZMMWORD PTR [__jsvml_dtanh_ha_data_internal+10368], 248 test r8d, r8d jne _B9_3 @@ -2098,19 +2098,19 @@ _B9_15:: lea rcx, QWORD PTR [r13+rbx*8] lea rdx, QWORD PTR [64+r13+rbx*8] - call __svml_dtanh_ha_cout_rare_internal + call __jsvml_dtanh_ha_cout_rare_internal jmp _B9_13 ALIGN 16 _B9_16:: -__svml_tanh8_ha_z0 ENDP +__jsvml_tanh8_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh8_ha_z0_B1_B9: +_unwind___jsvml_tanh8_ha_z0_B1_B9: DD 806913 DD 8770640 DD 5187650 @@ -2126,13 +2126,13 @@ _unwind___svml_tanh8_ha_z0_B1_B9: DD imagerel _B9_1 DD imagerel _B9_11 - DD imagerel _unwind___svml_tanh8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_tanh8_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanh8_ha_z0_B11_B15: +_unwind___jsvml_tanh8_ha_z0_B11_B15: DD 2674977 DD 7034065 DD 6845638 @@ -2156,7 +2156,7 @@ _unwind___svml_tanh8_ha_z0_B11_B15: DD 6769419 DD imagerel _B9_1 DD imagerel _B9_11 - DD imagerel _unwind___svml_tanh8_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_tanh8_ha_z0_B1_B9 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2165,7 +2165,7 @@ _unwind___svml_tanh8_ha_z0_B11_B15: DD imagerel _B9_11 DD imagerel _B9_16 - DD imagerel _unwind___svml_tanh8_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_tanh8_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2179,9 +2179,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_dtanh_ha_cout_rare_internal + PUBLIC __jsvml_dtanh_ha_cout_rare_internal -__svml_dtanh_ha_cout_rare_internal PROC +__jsvml_dtanh_ha_cout_rare_internal PROC _B10_1:: @@ -2247,7 +2247,7 @@ _B10_9:: _B10_10:: -__svml_dtanh_ha_cout_rare_internal ENDP +__jsvml_dtanh_ha_cout_rare_internal ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -2255,8 +2255,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_dtanh_ha_data_internal -__svml_dtanh_ha_data_internal DD 0 + PUBLIC __jsvml_dtanh_ha_data_internal +__jsvml_dtanh_ha_data_internal DD 0 DD 0 DD 0 DD 1070333952 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_acos_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_acos_windows_x86.S similarity index 86% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_acos_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_acos_windows_x86.S index b84172ff300..4738ecc9815 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_acos_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_acos_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acosf16_ha_z0 + PUBLIC __jsvml_acosf16_ha_z0 -__svml_acosf16_ha_z0 PROC EXPORT +__jsvml_acosf16_ha_z0 PROC EXPORT _B1_1:: @@ -49,60 +49,60 @@ _B1_1:: DB 250 L1:: - vmovups zmm22, ZMMWORD PTR [__svml_sacos_ha_data_internal] - vmovups zmm27, ZMMWORD PTR [__svml_sacos_ha_data_internal+64] - vmovups zmm26, ZMMWORD PTR [__svml_sacos_ha_data_internal+192] - vmovups zmm24, ZMMWORD PTR [__svml_sacos_ha_data_internal+256] + vmovups zmm22, ZMMWORD PTR [__jsvml_sacos_ha_data_internal] + vmovups zmm27, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+64] + vmovups zmm26, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+192] + vmovups zmm24, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+256] vmovaps zmm5, zmm0 vorps zmm4, zmm22, zmm5 vandps zmm3, zmm22, zmm5 - vmovups zmm0, ZMMWORD PTR [__svml_sacos_ha_data_internal+448] + vmovups zmm0, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+448] vfmadd231ps zmm27, zmm27, zmm4 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_sacos_ha_data_internal+512] + vmovups zmm22, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+512] vmulps zmm23, zmm4, zmm4 {rn-sae} vrsqrt14ps zmm25, zmm27 vcmpps k3, zmm27, zmm26, 17 {sae} vcmpps k2, zmm24, zmm4, 22 {sae} vminps zmm2, zmm23, zmm27 {sae} vaddps zmm28, zmm27, zmm27 {rn-sae} - vandps zmm31, zmm25, ZMMWORD PTR [__svml_sacos_ha_data_internal+384] + vandps zmm31, zmm25, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+384] vcmpps k1, zmm2, zmm27, 21 {sae} - vmovups zmm27, ZMMWORD PTR [__svml_sacos_ha_data_internal+640] - vandps zmm29, zmm28, ZMMWORD PTR [__svml_sacos_ha_data_internal+320] + vmovups zmm27, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+640] + vandps zmm29, zmm28, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+320] vxorps zmm31{k3}, zmm31, zmm31 - vorps zmm2{k2}, zmm2, ZMMWORD PTR [__svml_sacos_ha_data_internal+1344] + vorps zmm2{k2}, zmm2, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+1344] vsubps zmm30, zmm28, zmm29 {rn-sae} vmulps zmm1, zmm29, zmm31 {rn-sae} vmulps zmm29, zmm2, zmm2 {rn-sae} vmulps zmm26, zmm30, zmm31 {rn-sae} vcmpps k2{k1}, zmm2, zmm5, 21 {sae} - vmovups zmm28, ZMMWORD PTR [__svml_sacos_ha_data_internal+768] + vmovups zmm28, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+768] vfmsub231ps zmm0, zmm31, zmm1 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_sacos_ha_data_internal+832] - vmovups zmm5, ZMMWORD PTR [__svml_sacos_ha_data_internal+1216] + vmovups zmm30, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+832] + vmovups zmm5, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+1216] vmulps zmm31, zmm26, zmm31 {rn-sae} vfmadd231ps zmm30, zmm28, zmm2 {rn-sae} vaddps zmm23, zmm1, zmm26 {rn-sae} vaddps zmm24, zmm0, zmm31 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_sacos_ha_data_internal+576] + vmovups zmm0, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+576] vmulps zmm25, zmm23, zmm24 {rn-sae} vfmadd231ps zmm0, zmm22, zmm24 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_sacos_ha_data_internal+704] + vmovups zmm22, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+704] vfmsub213ps zmm0, zmm25, zmm26 {rn-sae} vfmadd231ps zmm22, zmm27, zmm2 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_sacos_ha_data_internal+896] + vmovups zmm27, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+896] vblendmps zmm0{k1}, zmm5, zmm0 vblendmps zmm5{k1}, zmm4, zmm1 vfmadd213ps zmm22, zmm29, zmm30 {rn-sae} vsubps zmm1, zmm5, zmm0 {rn-sae} vfmadd213ps zmm22, zmm2, zmm27 {rn-sae} vmulps zmm23, zmm22, zmm2 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_sacos_ha_data_internal+1024] - vmovups zmm22, ZMMWORD PTR [__svml_sacos_ha_data_internal+960] + vmovups zmm2, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+1024] + vmovups zmm22, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+960] vxorps zmm2{k1}, zmm2, zmm2 vxorps zmm22{k1}, zmm22, zmm22 - vorps zmm2{k2}, zmm2, ZMMWORD PTR [__svml_sacos_ha_data_internal+1152] - vorps zmm22{k2}, zmm22, ZMMWORD PTR [__svml_sacos_ha_data_internal+1088] + vorps zmm2{k2}, zmm2, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+1152] + vorps zmm22{k2}, zmm22, ZMMWORD PTR [__jsvml_sacos_ha_data_internal+1088] vxorps zmm2, zmm2, zmm3 vsubps zmm4, zmm2, zmm0 {rn-sae} vfmadd213ps zmm23, zmm1, zmm4 {rn-sae} @@ -114,7 +114,7 @@ L1:: _B1_2:: -__svml_acosf16_ha_z0 ENDP +__jsvml_acosf16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -128,9 +128,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acosf4_ha_ex + PUBLIC __jsvml_acosf4_ha_ex -__svml_acosf4_ha_ex PROC EXPORT +__jsvml_acosf4_ha_ex PROC EXPORT _B2_1:: @@ -149,27 +149,27 @@ L2:: movups XMMWORD PTR [256+rsp], xmm7 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm8, XMMWORD PTR [__svml_sacos_ha_data_internal] + movups xmm8, XMMWORD PTR [__jsvml_sacos_ha_data_internal] and r13, -64 movaps xmm1, xmm8 andps xmm8, xmm9 orps xmm1, xmm9 - movups xmm2, XMMWORD PTR [__svml_sacos_ha_data_internal+64] + movups xmm2, XMMWORD PTR [__jsvml_sacos_ha_data_internal+64] movaps xmm4, xmm1 mulps xmm4, xmm2 movaps xmm0, xmm1 mulps xmm0, xmm1 addps xmm2, xmm4 - movups xmm3, XMMWORD PTR [__svml_sacos_ha_data_internal+256] + movups xmm3, XMMWORD PTR [__jsvml_sacos_ha_data_internal+256] movaps xmm5, xmm2 cmpnleps xmm3, xmm1 minps xmm0, xmm2 - cmpltps xmm5, XMMWORD PTR [__svml_sacos_ha_data_internal+192] + cmpltps xmm5, XMMWORD PTR [__jsvml_sacos_ha_data_internal+192] rsqrtps xmm7, xmm2 movmskps eax, xmm3 movaps xmm3, xmm0 andnps xmm5, xmm7 - movups xmm10, XMMWORD PTR [__svml_sacos_ha_data_internal+320] + movups xmm10, XMMWORD PTR [__jsvml_sacos_ha_data_internal+320] movaps xmm4, xmm5 cmpnltps xmm3, xmm2 addps xmm2, xmm2 @@ -185,35 +185,35 @@ L2:: subps xmm15, xmm10 mulps xmm10, xmm5 mulps xmm5, xmm15 - subps xmm10, XMMWORD PTR [__svml_sacos_ha_data_internal+448] + subps xmm10, XMMWORD PTR [__jsvml_sacos_ha_data_internal+448] movaps xmm15, xmm7 andps xmm7, xmm3 addps xmm4, xmm10 - movups xmm10, XMMWORD PTR [__svml_sacos_ha_data_internal+1152] + movups xmm10, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1152] addps xmm15, xmm2 addps xmm5, xmm4 - movups xmm4, XMMWORD PTR [__svml_sacos_ha_data_internal+512] + movups xmm4, XMMWORD PTR [__jsvml_sacos_ha_data_internal+512] mulps xmm4, xmm5 mulps xmm5, xmm15 - addps xmm4, XMMWORD PTR [__svml_sacos_ha_data_internal+576] - movups xmm15, XMMWORD PTR [__svml_sacos_ha_data_internal+640] + addps xmm4, XMMWORD PTR [__jsvml_sacos_ha_data_internal+576] + movups xmm15, XMMWORD PTR [__jsvml_sacos_ha_data_internal+640] mulps xmm4, xmm5 mulps xmm15, xmm0 subps xmm4, xmm2 - addps xmm15, XMMWORD PTR [__svml_sacos_ha_data_internal+704] - movups xmm5, XMMWORD PTR [__svml_sacos_ha_data_internal+768] + addps xmm15, XMMWORD PTR [__jsvml_sacos_ha_data_internal+704] + movups xmm5, XMMWORD PTR [__jsvml_sacos_ha_data_internal+768] movaps xmm2, xmm0 mulps xmm5, xmm0 andps xmm4, xmm3 mulps xmm2, xmm0 - addps xmm5, XMMWORD PTR [__svml_sacos_ha_data_internal+832] + addps xmm5, XMMWORD PTR [__jsvml_sacos_ha_data_internal+832] mulps xmm15, xmm2 - movups xmm2, XMMWORD PTR [__svml_sacos_ha_data_internal+1088] + movups xmm2, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1088] addps xmm5, xmm15 mulps xmm5, xmm0 movaps xmm15, xmm3 - andnps xmm15, XMMWORD PTR [__svml_sacos_ha_data_internal+1024] - addps xmm5, XMMWORD PTR [__svml_sacos_ha_data_internal+896] + andnps xmm15, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1024] + addps xmm5, XMMWORD PTR [__jsvml_sacos_ha_data_internal+896] mulps xmm5, xmm0 cmpnltps xmm0, xmm9 andps xmm0, xmm3 @@ -225,7 +225,7 @@ L2:: orps xmm15, xmm10 movaps xmm1, xmm7 pxor xmm15, xmm8 - andnps xmm0, XMMWORD PTR [__svml_sacos_ha_data_internal+960] + andnps xmm0, XMMWORD PTR [__jsvml_sacos_ha_data_internal+960] subps xmm1, xmm4 subps xmm15, xmm4 mulps xmm5, xmm1 @@ -287,19 +287,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sacos_ha_cout_rare_internal + call __jsvml_sacos_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_acosf4_ha_ex ENDP +__jsvml_acosf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf4_ha_ex_B1_B3: +_unwind___jsvml_acosf4_ha_ex_B1_B3: DD 934657 DD 2282563 DD 1079355 @@ -316,19 +316,19 @@ _unwind___svml_acosf4_ha_ex_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_acosf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_acosf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf4_ha_ex_B6_B10: +_unwind___jsvml_acosf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_acosf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_acosf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -337,7 +337,7 @@ _unwind___svml_acosf4_ha_ex_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_acosf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_acosf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -351,9 +351,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acosf8_ha_e9 + PUBLIC __jsvml_acosf8_ha_e9 -__svml_acosf8_ha_e9 PROC EXPORT +__jsvml_acosf8_ha_e9 PROC EXPORT _B3_1:: @@ -371,25 +371,25 @@ L19:: vmovups YMMWORD PTR [368+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovups ymm5, YMMWORD PTR [__svml_sacos_ha_data_internal] + vmovups ymm5, YMMWORD PTR [__jsvml_sacos_ha_data_internal] and r13, -64 - vmovups ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+64] + vmovups ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+64] vmovaps ymm7, ymm0 vorps ymm4, ymm5, ymm7 vmulps ymm1, ymm4, ymm3 vmulps ymm6, ymm4, ymm4 - vcmpnge_uqps ymm14, ymm4, YMMWORD PTR [__svml_sacos_ha_data_internal+256] + vcmpnge_uqps ymm14, ymm4, YMMWORD PTR [__jsvml_sacos_ha_data_internal+256] vaddps ymm2, ymm3, ymm1 vpxor xmm1, xmm1, xmm1 vminps ymm3, ymm6, ymm2 - vcmplt_oqps ymm0, ymm2, YMMWORD PTR [__svml_sacos_ha_data_internal+192] + vcmplt_oqps ymm0, ymm2, YMMWORD PTR [__jsvml_sacos_ha_data_internal+192] vandps ymm5, ymm5, ymm7 mov QWORD PTR [536+rsp], r13 vextractf128 xmm13, ymm14, 1 vpackssdw xmm15, xmm14, xmm13 vrsqrtps ymm14, ymm2 vpacksswb xmm6, xmm15, xmm1 - vmovups ymm1, YMMWORD PTR [__svml_sacos_ha_data_internal+320] + vmovups ymm1, YMMWORD PTR [__jsvml_sacos_ha_data_internal+320] vpmovmskb edx, xmm6 vcmpnlt_uqps ymm6, ymm3, ymm2 vaddps ymm2, ymm2, ymm2 @@ -403,33 +403,33 @@ L19:: vmulps ymm1, ymm13, ymm1 vmulps ymm2, ymm13, ymm14 vmulps ymm0, ymm13, ymm0 - vsubps ymm13, ymm1, YMMWORD PTR [__svml_sacos_ha_data_internal+448] + vsubps ymm13, ymm1, YMMWORD PTR [__jsvml_sacos_ha_data_internal+448] vaddps ymm1, ymm2, ymm13 vaddps ymm13, ymm15, ymm14 vaddps ymm0, ymm0, ymm1 - vmulps ymm2, ymm0, YMMWORD PTR [__svml_sacos_ha_data_internal+512] - vaddps ymm1, ymm2, YMMWORD PTR [__svml_sacos_ha_data_internal+576] + vmulps ymm2, ymm0, YMMWORD PTR [__jsvml_sacos_ha_data_internal+512] + vaddps ymm1, ymm2, YMMWORD PTR [__jsvml_sacos_ha_data_internal+576] vmulps ymm2, ymm0, ymm13 vmulps ymm0, ymm1, ymm2 - vmulps ymm1, ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+768] + vmulps ymm1, ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+768] vsubps ymm14, ymm0, ymm14 vandps ymm0, ymm15, ymm6 - vmulps ymm15, ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+640] + vmulps ymm15, ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+640] vandps ymm2, ymm14, ymm6 vmulps ymm14, ymm3, ymm3 - vaddps ymm13, ymm15, YMMWORD PTR [__svml_sacos_ha_data_internal+704] - vaddps ymm15, ymm1, YMMWORD PTR [__svml_sacos_ha_data_internal+832] + vaddps ymm13, ymm15, YMMWORD PTR [__jsvml_sacos_ha_data_internal+704] + vaddps ymm15, ymm1, YMMWORD PTR [__jsvml_sacos_ha_data_internal+832] vmulps ymm1, ymm13, ymm14 vaddps ymm13, ymm15, ymm1 vmulps ymm14, ymm3, ymm13 - vaddps ymm15, ymm14, YMMWORD PTR [__svml_sacos_ha_data_internal+896] + vaddps ymm15, ymm14, YMMWORD PTR [__jsvml_sacos_ha_data_internal+896] vmulps ymm1, ymm3, ymm15 vcmpnlt_uqps ymm3, ymm3, ymm7 vandps ymm13, ymm3, ymm6 - vandps ymm15, ymm13, YMMWORD PTR [__svml_sacos_ha_data_internal+1152] - vandps ymm14, ymm13, YMMWORD PTR [__svml_sacos_ha_data_internal+1088] - vandnps ymm3, ymm6, YMMWORD PTR [__svml_sacos_ha_data_internal+1024] - vandnps ymm13, ymm6, YMMWORD PTR [__svml_sacos_ha_data_internal+960] + vandps ymm15, ymm13, YMMWORD PTR [__jsvml_sacos_ha_data_internal+1152] + vandps ymm14, ymm13, YMMWORD PTR [__jsvml_sacos_ha_data_internal+1088] + vandnps ymm3, ymm6, YMMWORD PTR [__jsvml_sacos_ha_data_internal+1024] + vandnps ymm13, ymm6, YMMWORD PTR [__jsvml_sacos_ha_data_internal+960] vandnps ymm6, ymm6, ymm4 vorps ymm6, ymm0, ymm6 vsubps ymm0, ymm6, ymm2 @@ -505,19 +505,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sacos_ha_cout_rare_internal + call __jsvml_sacos_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_acosf8_ha_e9 ENDP +__jsvml_acosf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf8_ha_e9_B1_B3: +_unwind___jsvml_acosf8_ha_e9_B1_B3: DD 933889 DD 4379712 DD 1534008 @@ -534,13 +534,13 @@ _unwind___svml_acosf8_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_acosf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acosf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf8_ha_e9_B6_B10: +_unwind___jsvml_acosf8_ha_e9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -551,7 +551,7 @@ _unwind___svml_acosf8_ha_e9_B6_B10: DD 690187 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_acosf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acosf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -560,7 +560,7 @@ _unwind___svml_acosf8_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_acosf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_acosf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -574,9 +574,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acosf8_ha_l9 + PUBLIC __jsvml_acosf8_ha_l9 -__svml_acosf8_ha_l9 PROC EXPORT +__jsvml_acosf8_ha_l9 PROC EXPORT _B4_1:: @@ -594,50 +594,50 @@ L46:: vmovups YMMWORD PTR [496+rsp], ymm7 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovups ymm5, YMMWORD PTR [__svml_sacos_ha_data_internal] + vmovups ymm5, YMMWORD PTR [__jsvml_sacos_ha_data_internal] and r13, -64 - vmovups ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+64] + vmovups ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+64] vmovdqa ymm7, ymm0 vorps ymm1, ymm5, ymm7 vfmadd231ps ymm3, ymm3, ymm1 vmulps ymm12, ymm1, ymm1 - vcmpnge_uqps ymm4, ymm1, YMMWORD PTR [__svml_sacos_ha_data_internal+256] - vcmplt_oqps ymm2, ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+192] + vcmpnge_uqps ymm4, ymm1, YMMWORD PTR [__jsvml_sacos_ha_data_internal+256] + vcmplt_oqps ymm2, ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+192] vminps ymm8, ymm12, ymm3 vrsqrtps ymm12, ymm3 vcmpnlt_uqps ymm0, ymm8, ymm3 vaddps ymm3, ymm3, ymm3 vmovmskps edx, ymm4 - vandps ymm4, ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+320] + vandps ymm4, ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+320] test edx, edx vandnps ymm10, ymm2, ymm12 vsubps ymm2, ymm3, ymm4 - vmovups ymm12, YMMWORD PTR [__svml_sacos_ha_data_internal+448] + vmovups ymm12, YMMWORD PTR [__jsvml_sacos_ha_data_internal+448] vmulps ymm11, ymm10, ymm4 vmulps ymm2, ymm10, ymm2 - vmovups ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+512] + vmovups ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+512] vfmsub231ps ymm12, ymm10, ymm11 vmulps ymm10, ymm10, ymm2 vaddps ymm4, ymm11, ymm2 vaddps ymm12, ymm12, ymm10 - vfmadd213ps ymm3, ymm12, YMMWORD PTR [__svml_sacos_ha_data_internal+576] + vfmadd213ps ymm3, ymm12, YMMWORD PTR [__jsvml_sacos_ha_data_internal+576] vmulps ymm4, ymm4, ymm12 - vmovups ymm12, YMMWORD PTR [__svml_sacos_ha_data_internal+768] + vmovups ymm12, YMMWORD PTR [__jsvml_sacos_ha_data_internal+768] vfmsub213ps ymm3, ymm4, ymm2 - vfmadd213ps ymm12, ymm8, YMMWORD PTR [__svml_sacos_ha_data_internal+832] + vfmadd213ps ymm12, ymm8, YMMWORD PTR [__jsvml_sacos_ha_data_internal+832] vandps ymm4, ymm3, ymm0 - vmovups ymm3, YMMWORD PTR [__svml_sacos_ha_data_internal+640] - vfmadd213ps ymm3, ymm8, YMMWORD PTR [__svml_sacos_ha_data_internal+704] + vmovups ymm3, YMMWORD PTR [__jsvml_sacos_ha_data_internal+640] + vfmadd213ps ymm3, ymm8, YMMWORD PTR [__jsvml_sacos_ha_data_internal+704] vandps ymm2, ymm11, ymm0 vmulps ymm11, ymm8, ymm8 vfmadd213ps ymm3, ymm11, ymm12 - vfmadd213ps ymm3, ymm8, YMMWORD PTR [__svml_sacos_ha_data_internal+896] + vfmadd213ps ymm3, ymm8, YMMWORD PTR [__jsvml_sacos_ha_data_internal+896] vmulps ymm3, ymm8, ymm3 vcmpnlt_uqps ymm8, ymm8, ymm7 vandps ymm12, ymm8, ymm0 - vandps ymm11, ymm12, YMMWORD PTR [__svml_sacos_ha_data_internal+1152] - vandnps ymm10, ymm0, YMMWORD PTR [__svml_sacos_ha_data_internal+1024] - vandnps ymm8, ymm0, YMMWORD PTR [__svml_sacos_ha_data_internal+960] + vandps ymm11, ymm12, YMMWORD PTR [__jsvml_sacos_ha_data_internal+1152] + vandnps ymm10, ymm0, YMMWORD PTR [__jsvml_sacos_ha_data_internal+1024] + vandnps ymm8, ymm0, YMMWORD PTR [__jsvml_sacos_ha_data_internal+960] vandps ymm5, ymm5, ymm7 vandnps ymm1, ymm0, ymm1 vorps ymm0, ymm10, ymm11 @@ -647,7 +647,7 @@ L46:: vsubps ymm0, ymm0, ymm4 vfmadd213ps ymm3, ymm1, ymm0 vaddps ymm1, ymm2, ymm3 - vandps ymm12, ymm12, YMMWORD PTR [__svml_sacos_ha_data_internal+1088] + vandps ymm12, ymm12, YMMWORD PTR [__jsvml_sacos_ha_data_internal+1088] vorps ymm12, ymm8, ymm12 vxorps ymm5, ymm1, ymm5 mov QWORD PTR [536+rsp], r13 @@ -712,19 +712,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sacos_ha_cout_rare_internal + call __jsvml_sacos_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_acosf8_ha_l9 ENDP +__jsvml_acosf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf8_ha_l9_B1_B3: +_unwind___jsvml_acosf8_ha_l9_B1_B3: DD 933889 DD 4379712 DD 2062392 @@ -741,13 +741,13 @@ _unwind___svml_acosf8_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_acosf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acosf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf8_ha_l9_B6_B10: +_unwind___jsvml_acosf8_ha_l9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -758,7 +758,7 @@ _unwind___svml_acosf8_ha_l9_B6_B10: DD 681995 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_acosf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acosf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -767,7 +767,7 @@ _unwind___svml_acosf8_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_acosf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_acosf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -781,9 +781,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acosf4_ha_l9 + PUBLIC __jsvml_acosf4_ha_l9 -__svml_acosf4_ha_l9 PROC EXPORT +__jsvml_acosf4_ha_l9 PROC EXPORT _B5_1:: @@ -802,15 +802,15 @@ L73:: vmovups XMMWORD PTR [256+rsp], xmm7 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm3, XMMWORD PTR [__svml_sacos_ha_data_internal] + vmovups xmm3, XMMWORD PTR [__jsvml_sacos_ha_data_internal] and r13, -64 - vmovups xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+64] + vmovups xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+64] vorps xmm7, xmm3, xmm5 vfmadd231ps xmm1, xmm1, xmm7 vandps xmm3, xmm3, xmm5 vmulps xmm4, xmm7, xmm7 - vcmpngeps xmm11, xmm7, XMMWORD PTR [__svml_sacos_ha_data_internal+256] - vcmpltps xmm2, xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+192] + vcmpngeps xmm11, xmm7, XMMWORD PTR [__jsvml_sacos_ha_data_internal+256] + vcmpltps xmm2, xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+192] vminps xmm8, xmm4, xmm1 vmovmskps edx, xmm11 vrsqrtps xmm11, xmm1 @@ -818,40 +818,40 @@ L73:: vaddps xmm1, xmm1, xmm1 vandnps xmm10, xmm2, xmm11 vandnps xmm7, xmm4, xmm7 - vandps xmm2, xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+320] + vandps xmm2, xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+320] test edx, edx vmulps xmm12, xmm10, xmm2 vsubps xmm0, xmm1, xmm2 vmulps xmm0, xmm10, xmm0 - vmovups xmm11, XMMWORD PTR [__svml_sacos_ha_data_internal+448] + vmovups xmm11, XMMWORD PTR [__jsvml_sacos_ha_data_internal+448] vaddps xmm2, xmm12, xmm0 vfmsub231ps xmm11, xmm10, xmm12 vmulps xmm10, xmm10, xmm0 - vmovups xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+512] + vmovups xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+512] vaddps xmm11, xmm11, xmm10 - vfmadd213ps xmm1, xmm11, XMMWORD PTR [__svml_sacos_ha_data_internal+576] + vfmadd213ps xmm1, xmm11, XMMWORD PTR [__jsvml_sacos_ha_data_internal+576] vmulps xmm2, xmm2, xmm11 vfmsub213ps xmm1, xmm2, xmm0 vandps xmm0, xmm12, xmm4 - vmovups xmm11, XMMWORD PTR [__svml_sacos_ha_data_internal+768] + vmovups xmm11, XMMWORD PTR [__jsvml_sacos_ha_data_internal+768] vorps xmm0, xmm0, xmm7 - vfmadd213ps xmm11, xmm8, XMMWORD PTR [__svml_sacos_ha_data_internal+832] + vfmadd213ps xmm11, xmm8, XMMWORD PTR [__jsvml_sacos_ha_data_internal+832] vmulps xmm12, xmm8, xmm8 vandps xmm2, xmm1, xmm4 - vmovups xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+640] + vmovups xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+640] vsubps xmm7, xmm0, xmm2 - vfmadd213ps xmm1, xmm8, XMMWORD PTR [__svml_sacos_ha_data_internal+704] + vfmadd213ps xmm1, xmm8, XMMWORD PTR [__jsvml_sacos_ha_data_internal+704] vfmadd213ps xmm1, xmm12, xmm11 - vandnps xmm12, xmm4, XMMWORD PTR [__svml_sacos_ha_data_internal+960] - vfmadd213ps xmm1, xmm8, XMMWORD PTR [__svml_sacos_ha_data_internal+896] + vandnps xmm12, xmm4, XMMWORD PTR [__jsvml_sacos_ha_data_internal+960] + vfmadd213ps xmm1, xmm8, XMMWORD PTR [__jsvml_sacos_ha_data_internal+896] vmulps xmm1, xmm8, xmm1 vcmpnltps xmm8, xmm8, xmm5 vandps xmm11, xmm8, xmm4 - vandps xmm10, xmm11, XMMWORD PTR [__svml_sacos_ha_data_internal+1152] - vandnps xmm8, xmm4, XMMWORD PTR [__svml_sacos_ha_data_internal+1024] + vandps xmm10, xmm11, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1152] + vandnps xmm8, xmm4, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1024] vorps xmm4, xmm8, xmm10 vxorps xmm4, xmm4, xmm3 - vandps xmm11, xmm11, XMMWORD PTR [__svml_sacos_ha_data_internal+1088] + vandps xmm11, xmm11, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1088] vsubps xmm2, xmm4, xmm2 vfmadd213ps xmm1, xmm7, xmm2 vorps xmm11, xmm12, xmm11 @@ -908,19 +908,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sacos_ha_cout_rare_internal + call __jsvml_sacos_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_acosf4_ha_l9 ENDP +__jsvml_acosf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf4_ha_l9_B1_B3: +_unwind___jsvml_acosf4_ha_l9_B1_B3: DD 934913 DD 2282564 DD 1079356 @@ -937,19 +937,19 @@ _unwind___svml_acosf4_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_acosf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acosf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf4_ha_l9_B6_B10: +_unwind___jsvml_acosf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_acosf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_acosf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -958,7 +958,7 @@ _unwind___svml_acosf4_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_acosf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_acosf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -972,9 +972,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_acosf4_ha_e9 + PUBLIC __jsvml_acosf4_ha_e9 -__svml_acosf4_ha_e9 PROC EXPORT +__jsvml_acosf4_ha_e9 PROC EXPORT _B6_1:: @@ -993,22 +993,22 @@ L90:: vmovups XMMWORD PTR [256+rsp], xmm6 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm5, XMMWORD PTR [__svml_sacos_ha_data_internal] + vmovups xmm5, XMMWORD PTR [__jsvml_sacos_ha_data_internal] and r13, -64 - vmovups xmm2, XMMWORD PTR [__svml_sacos_ha_data_internal+64] + vmovups xmm2, XMMWORD PTR [__jsvml_sacos_ha_data_internal+64] vorps xmm4, xmm5, xmm7 vmulps xmm3, xmm4, xmm2 vandps xmm5, xmm5, xmm7 - vcmpngeps xmm6, xmm4, XMMWORD PTR [__svml_sacos_ha_data_internal+256] + vcmpngeps xmm6, xmm4, XMMWORD PTR [__jsvml_sacos_ha_data_internal+256] vmulps xmm1, xmm4, xmm4 vaddps xmm15, xmm2, xmm3 vmovmskps edx, xmm6 vrsqrtps xmm0, xmm15 - vcmpltps xmm2, xmm15, XMMWORD PTR [__svml_sacos_ha_data_internal+192] + vcmpltps xmm2, xmm15, XMMWORD PTR [__jsvml_sacos_ha_data_internal+192] vminps xmm3, xmm1, xmm15 vaddps xmm9, xmm15, xmm15 vcmpnltps xmm6, xmm3, xmm15 - vmovups xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+320] + vmovups xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+320] vandnps xmm8, xmm2, xmm0 vandps xmm2, xmm9, xmm1 vmulps xmm15, xmm8, xmm2 @@ -1019,34 +1019,34 @@ L90:: vmulps xmm1, xmm8, xmm1 vmulps xmm2, xmm8, xmm9 vmulps xmm0, xmm8, xmm0 - vsubps xmm8, xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+448] + vsubps xmm8, xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+448] mov QWORD PTR [280+rsp], r13 vaddps xmm1, xmm2, xmm8 vaddps xmm8, xmm15, xmm9 vaddps xmm0, xmm0, xmm1 - vmulps xmm2, xmm0, XMMWORD PTR [__svml_sacos_ha_data_internal+512] - vaddps xmm1, xmm2, XMMWORD PTR [__svml_sacos_ha_data_internal+576] + vmulps xmm2, xmm0, XMMWORD PTR [__jsvml_sacos_ha_data_internal+512] + vaddps xmm1, xmm2, XMMWORD PTR [__jsvml_sacos_ha_data_internal+576] vmulps xmm2, xmm0, xmm8 vmulps xmm0, xmm1, xmm2 - vmulps xmm1, xmm3, XMMWORD PTR [__svml_sacos_ha_data_internal+768] + vmulps xmm1, xmm3, XMMWORD PTR [__jsvml_sacos_ha_data_internal+768] vsubps xmm9, xmm0, xmm9 - vaddps xmm8, xmm1, XMMWORD PTR [__svml_sacos_ha_data_internal+832] + vaddps xmm8, xmm1, XMMWORD PTR [__jsvml_sacos_ha_data_internal+832] vandps xmm0, xmm15, xmm6 vandps xmm2, xmm9, xmm6 - vmulps xmm15, xmm3, XMMWORD PTR [__svml_sacos_ha_data_internal+640] - vaddps xmm9, xmm15, XMMWORD PTR [__svml_sacos_ha_data_internal+704] + vmulps xmm15, xmm3, XMMWORD PTR [__jsvml_sacos_ha_data_internal+640] + vaddps xmm9, xmm15, XMMWORD PTR [__jsvml_sacos_ha_data_internal+704] vmulps xmm15, xmm3, xmm3 vmulps xmm1, xmm9, xmm15 vaddps xmm9, xmm8, xmm1 vmulps xmm15, xmm3, xmm9 - vaddps xmm8, xmm15, XMMWORD PTR [__svml_sacos_ha_data_internal+896] + vaddps xmm8, xmm15, XMMWORD PTR [__jsvml_sacos_ha_data_internal+896] vmulps xmm1, xmm3, xmm8 vcmpnltps xmm3, xmm3, xmm7 vandps xmm9, xmm3, xmm6 - vandps xmm3, xmm9, XMMWORD PTR [__svml_sacos_ha_data_internal+1152] - vandps xmm15, xmm9, XMMWORD PTR [__svml_sacos_ha_data_internal+1088] - vandnps xmm8, xmm6, XMMWORD PTR [__svml_sacos_ha_data_internal+1024] - vandnps xmm9, xmm6, XMMWORD PTR [__svml_sacos_ha_data_internal+960] + vandps xmm3, xmm9, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1152] + vandps xmm15, xmm9, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1088] + vandnps xmm8, xmm6, XMMWORD PTR [__jsvml_sacos_ha_data_internal+1024] + vandnps xmm9, xmm6, XMMWORD PTR [__jsvml_sacos_ha_data_internal+960] vandnps xmm6, xmm6, xmm4 vorps xmm6, xmm0, xmm6 vorps xmm3, xmm8, xmm3 @@ -1109,19 +1109,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sacos_ha_cout_rare_internal + call __jsvml_sacos_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_acosf4_ha_e9 ENDP +__jsvml_acosf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf4_ha_e9_B1_B3: +_unwind___jsvml_acosf4_ha_e9_B1_B3: DD 934913 DD 2282564 DD 1075260 @@ -1138,19 +1138,19 @@ _unwind___svml_acosf4_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_acosf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acosf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_acosf4_ha_e9_B6_B10: +_unwind___jsvml_acosf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_acosf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_acosf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1159,7 +1159,7 @@ _unwind___svml_acosf4_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_acosf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_acosf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1173,9 +1173,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sacos_ha_cout_rare_internal + PUBLIC __jsvml_sacos_ha_cout_rare_internal -__svml_sacos_ha_cout_rare_internal PROC +__jsvml_sacos_ha_cout_rare_internal PROC _B7_1:: @@ -1764,13 +1764,13 @@ _B7_20:: _B7_21:: -__svml_sacos_ha_cout_rare_internal ENDP +__jsvml_sacos_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sacos_ha_cout_rare_internal_B1_B20: +_unwind___jsvml_sacos_ha_cout_rare_internal_B1_B20: DD 621957633 DD 424018 DD 362574 @@ -1789,7 +1789,7 @@ _unwind___svml_sacos_ha_cout_rare_internal_B1_B20: DD imagerel _B7_1 DD imagerel _B7_21 - DD imagerel _unwind___svml_sacos_ha_cout_rare_internal_B1_B20 + DD imagerel _unwind___jsvml_sacos_ha_cout_rare_internal_B1_B20 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1797,8 +1797,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_sacos_ha_data_internal -__svml_sacos_ha_data_internal DD 2147483648 + PUBLIC __jsvml_sacos_ha_data_internal +__jsvml_sacos_ha_data_internal DD 2147483648 DD 2147483648 DD 2147483648 DD 2147483648 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_asin_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_asin_windows_x86.S similarity index 86% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_asin_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_asin_windows_x86.S index 0936b901bf7..8ab30b67f89 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_asin_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_asin_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asinf8_ha_l9 + PUBLIC __jsvml_asinf8_ha_l9 -__svml_asinf8_ha_l9 PROC EXPORT +__jsvml_asinf8_ha_l9 PROC EXPORT _B1_1:: @@ -56,24 +56,24 @@ L1:: vmovups YMMWORD PTR [464+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [303+rsp] - vmovups ymm4, YMMWORD PTR [__svml_sasin_ha_data_internal] + vmovups ymm4, YMMWORD PTR [__jsvml_sasin_ha_data_internal] and r13, -64 - vmovups ymm1, YMMWORD PTR [__svml_sasin_ha_data_internal+64] + vmovups ymm1, YMMWORD PTR [__jsvml_sasin_ha_data_internal+64] vmovdqa ymm5, ymm0 vandps ymm2, ymm4, ymm5 vmovdqa ymm6, ymm2 vfnmadd213ps ymm6, ymm1, ymm1 vmulps ymm3, ymm2, ymm2 - vmovups ymm0, YMMWORD PTR [__svml_sasin_ha_data_internal+448] - vcmpgt_oqps ymm11, ymm2, YMMWORD PTR [__svml_sasin_ha_data_internal+256] + vmovups ymm0, YMMWORD PTR [__jsvml_sasin_ha_data_internal+448] + vcmpgt_oqps ymm11, ymm2, YMMWORD PTR [__jsvml_sasin_ha_data_internal+256] vminps ymm7, ymm3, ymm6 vcmpnlt_uqps ymm3, ymm2, ymm1 vrsqrtps ymm1, ymm6 vmovmskps edx, ymm11 - vcmplt_oqps ymm11, ymm6, YMMWORD PTR [__svml_sasin_ha_data_internal+192] + vcmplt_oqps ymm11, ymm6, YMMWORD PTR [__jsvml_sasin_ha_data_internal+192] test edx, edx vaddps ymm6, ymm6, ymm6 - vandps ymm9, ymm6, YMMWORD PTR [__svml_sasin_ha_data_internal+320] + vandps ymm9, ymm6, YMMWORD PTR [__jsvml_sasin_ha_data_internal+320] vsubps ymm6, ymm6, ymm9 vandnps ymm11, ymm11, ymm1 vmulps ymm1, ymm11, ymm9 @@ -82,21 +82,21 @@ L1:: vmulps ymm11, ymm11, ymm6 vaddps ymm9, ymm1, ymm6 vaddps ymm11, ymm0, ymm11 - vmovups ymm0, YMMWORD PTR [__svml_sasin_ha_data_internal+512] + vmovups ymm0, YMMWORD PTR [__jsvml_sasin_ha_data_internal+512] vmulps ymm9, ymm9, ymm11 - vfmadd213ps ymm0, ymm11, YMMWORD PTR [__svml_sasin_ha_data_internal+576] - vmovups ymm11, YMMWORD PTR [__svml_sasin_ha_data_internal+768] + vfmadd213ps ymm0, ymm11, YMMWORD PTR [__jsvml_sasin_ha_data_internal+576] + vmovups ymm11, YMMWORD PTR [__jsvml_sasin_ha_data_internal+768] vfmsub213ps ymm0, ymm9, ymm6 - vmovups ymm9, YMMWORD PTR [__svml_sasin_ha_data_internal+640] - vfmadd213ps ymm11, ymm7, YMMWORD PTR [__svml_sasin_ha_data_internal+832] + vmovups ymm9, YMMWORD PTR [__jsvml_sasin_ha_data_internal+640] + vfmadd213ps ymm11, ymm7, YMMWORD PTR [__jsvml_sasin_ha_data_internal+832] vmulps ymm6, ymm7, ymm7 - vfmadd213ps ymm9, ymm7, YMMWORD PTR [__svml_sasin_ha_data_internal+704] + vfmadd213ps ymm9, ymm7, YMMWORD PTR [__jsvml_sasin_ha_data_internal+704] vfmadd213ps ymm9, ymm6, ymm11 vsubps ymm11, ymm0, ymm1 - vaddps ymm0, ymm0, YMMWORD PTR [__svml_sasin_ha_data_internal+1024] - vfmadd213ps ymm9, ymm7, YMMWORD PTR [__svml_sasin_ha_data_internal+896] + vaddps ymm0, ymm0, YMMWORD PTR [__jsvml_sasin_ha_data_internal+1024] + vfmadd213ps ymm9, ymm7, YMMWORD PTR [__jsvml_sasin_ha_data_internal+896] vmulps ymm6, ymm7, ymm9 - vmovups ymm9, YMMWORD PTR [__svml_sasin_ha_data_internal+960] + vmovups ymm9, YMMWORD PTR [__jsvml_sasin_ha_data_internal+960] vsubps ymm7, ymm9, ymm1 vsubps ymm9, ymm9, ymm7 vsubps ymm1, ymm1, ymm9 @@ -173,19 +173,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sasin_ha_cout_rare_internal + call __jsvml_sasin_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_asinf8_ha_l9 ENDP +__jsvml_asinf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf8_ha_l9_B1_B3: +_unwind___jsvml_asinf8_ha_l9_B1_B3: DD 800513 DD 4379703 DD 1927215 @@ -201,13 +201,13 @@ _unwind___svml_asinf8_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_asinf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asinf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf8_ha_l9_B6_B10: +_unwind___jsvml_asinf8_ha_l9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -219,7 +219,7 @@ _unwind___svml_asinf8_ha_l9_B6_B10: DD 821259 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_asinf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asinf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -228,7 +228,7 @@ _unwind___svml_asinf8_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_asinf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_asinf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -242,9 +242,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asinf16_ha_z0 + PUBLIC __jsvml_asinf16_ha_z0 -__svml_asinf16_ha_z0 PROC EXPORT +__jsvml_asinf16_ha_z0 PROC EXPORT _B2_1:: @@ -254,14 +254,14 @@ _B2_1:: DB 250 L28:: - vmovups zmm5, ZMMWORD PTR [__svml_sasin_ha_data_internal] - vmovups zmm23, ZMMWORD PTR [__svml_sasin_ha_data_internal+64] - vmovups zmm26, ZMMWORD PTR [__svml_sasin_ha_data_internal+192] - vmovups zmm24, ZMMWORD PTR [__svml_sasin_ha_data_internal+256] + vmovups zmm5, ZMMWORD PTR [__jsvml_sasin_ha_data_internal] + vmovups zmm23, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+64] + vmovups zmm26, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+192] + vmovups zmm24, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+256] vandps zmm4, zmm5, zmm0 vandnps zmm3, zmm5, zmm0 - vmovups zmm0, ZMMWORD PTR [__svml_sasin_ha_data_internal+448] - vmovups zmm5, ZMMWORD PTR [__svml_sasin_ha_data_internal+512] + vmovups zmm0, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+448] + vmovups zmm5, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+512] vmulps zmm22, zmm4, zmm4 {rn-sae} vcmpps k1, zmm24, zmm4, 17 {sae} vcmpps k3, zmm4, zmm23, 21 {sae} @@ -270,37 +270,37 @@ L28:: vrsqrt14ps zmm25, zmm27 vcmpps k2, zmm27, zmm26, 17 {sae} vminps zmm2, zmm22, zmm27 {sae} - vmovups zmm26, ZMMWORD PTR [__svml_sasin_ha_data_internal+640] + vmovups zmm26, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+640] vaddps zmm28, zmm27, zmm27 {rn-sae} - vandps zmm31, zmm25, ZMMWORD PTR [__svml_sasin_ha_data_internal+384] - vorps zmm2{k1}, zmm2, ZMMWORD PTR [__svml_sasin_ha_data_internal+1216] - vandps zmm29, zmm28, ZMMWORD PTR [__svml_sasin_ha_data_internal+320] + vandps zmm31, zmm25, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+384] + vorps zmm2{k1}, zmm2, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+1216] + vandps zmm29, zmm28, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+320] vxorps zmm31{k2}, zmm31, zmm31 - vmovups zmm27, ZMMWORD PTR [__svml_sasin_ha_data_internal+768] + vmovups zmm27, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+768] vmulps zmm1, zmm29, zmm31 {rn-sae} vsubps zmm30, zmm28, zmm29 {rn-sae} vmulps zmm28, zmm2, zmm2 {rn-sae} vmulps zmm25, zmm30, zmm31 {rn-sae} vfmsub231ps zmm0, zmm31, zmm1 {rn-sae} - vmovups zmm29, ZMMWORD PTR [__svml_sasin_ha_data_internal+832] - vmovups zmm30, ZMMWORD PTR [__svml_sasin_ha_data_internal+896] + vmovups zmm29, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+832] + vmovups zmm30, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+896] vmulps zmm31, zmm25, zmm31 {rn-sae} vfmadd231ps zmm29, zmm27, zmm2 {rn-sae} vaddps zmm22, zmm1, zmm25 {rn-sae} vaddps zmm23, zmm0, zmm31 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_sasin_ha_data_internal+576] + vmovups zmm0, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+576] vmulps zmm24, zmm22, zmm23 {rn-sae} vfmadd231ps zmm0, zmm5, zmm23 {rn-sae} - vmovups zmm5, ZMMWORD PTR [__svml_sasin_ha_data_internal+704] - vmovups zmm22, ZMMWORD PTR [__svml_sasin_ha_data_internal+1088] + vmovups zmm5, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+704] + vmovups zmm22, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+1088] vfmsub213ps zmm0, zmm24, zmm25 {rn-sae} vfmadd231ps zmm5, zmm26, zmm2 {rn-sae} vsubps zmm4{k3}, zmm0, zmm1 {rn-sae} vfmadd213ps zmm5, zmm28, zmm29 {rn-sae} vfmadd213ps zmm5, zmm2, zmm30 {rn-sae} vmulps zmm24, zmm5, zmm2 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_sasin_ha_data_internal+960] - vmovups zmm5, ZMMWORD PTR [__svml_sasin_ha_data_internal+1024] + vmovups zmm2, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+960] + vmovups zmm5, ZMMWORD PTR [__jsvml_sasin_ha_data_internal+1024] vsubps zmm23, zmm2, zmm1 {rn-sae} vaddps zmm0, zmm5, zmm0 {rn-sae} vsubps zmm2, zmm2, zmm23 {rn-sae} @@ -315,7 +315,7 @@ L28:: _B2_2:: -__svml_asinf16_ha_z0 ENDP +__jsvml_asinf16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -329,9 +329,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asinf8_ha_e9 + PUBLIC __jsvml_asinf8_ha_e9 -__svml_asinf8_ha_e9 PROC EXPORT +__jsvml_asinf8_ha_e9 PROC EXPORT _B3_1:: @@ -349,17 +349,17 @@ L29:: vmovups YMMWORD PTR [368+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovups ymm8, YMMWORD PTR [__svml_sasin_ha_data_internal] + vmovups ymm8, YMMWORD PTR [__jsvml_sasin_ha_data_internal] and r13, -64 - vmovups ymm7, YMMWORD PTR [__svml_sasin_ha_data_internal+64] + vmovups ymm7, YMMWORD PTR [__jsvml_sasin_ha_data_internal+64] vmovaps ymm10, ymm0 vandps ymm6, ymm8, ymm10 vmulps ymm4, ymm6, ymm7 vmulps ymm1, ymm6, ymm6 - vcmpgt_oqps ymm3, ymm6, YMMWORD PTR [__svml_sasin_ha_data_internal+256] + vcmpgt_oqps ymm3, ymm6, YMMWORD PTR [__jsvml_sasin_ha_data_internal+256] vsubps ymm5, ymm7, ymm4 vcmpnlt_uqps ymm7, ymm6, ymm7 - vcmplt_oqps ymm0, ymm5, YMMWORD PTR [__svml_sasin_ha_data_internal+192] + vcmplt_oqps ymm0, ymm5, YMMWORD PTR [__jsvml_sasin_ha_data_internal+192] vminps ymm4, ymm1, ymm5 vpxor xmm1, xmm1, xmm1 vandnps ymm6, ymm7, ymm6 @@ -372,7 +372,7 @@ L29:: vaddps ymm5, ymm5, ymm5 vpmovmskb edx, xmm3 vandnps ymm0, ymm0, ymm2 - vmovups ymm2, YMMWORD PTR [__svml_sasin_ha_data_internal+320] + vmovups ymm2, YMMWORD PTR [__jsvml_sasin_ha_data_internal+320] vandps ymm15, ymm5, ymm2 vsubps ymm1, ymm5, ymm15 vmulps ymm5, ymm0, ymm15 @@ -382,27 +382,27 @@ L29:: vsubps ymm15, ymm5, ymm3 vmulps ymm3, ymm0, ymm1 vmulps ymm0, ymm0, ymm15 - vsubps ymm2, ymm2, YMMWORD PTR [__svml_sasin_ha_data_internal+448] + vsubps ymm2, ymm2, YMMWORD PTR [__jsvml_sasin_ha_data_internal+448] vaddps ymm15, ymm3, ymm2 vaddps ymm3, ymm5, ymm1 vaddps ymm15, ymm0, ymm15 - vmulps ymm0, ymm15, YMMWORD PTR [__svml_sasin_ha_data_internal+512] + vmulps ymm0, ymm15, YMMWORD PTR [__jsvml_sasin_ha_data_internal+512] vmulps ymm2, ymm15, ymm3 - vaddps ymm0, ymm0, YMMWORD PTR [__svml_sasin_ha_data_internal+576] + vaddps ymm0, ymm0, YMMWORD PTR [__jsvml_sasin_ha_data_internal+576] vmulps ymm15, ymm0, ymm2 vmulps ymm0, ymm4, ymm4 vsubps ymm3, ymm15, ymm1 - vmulps ymm1, ymm4, YMMWORD PTR [__svml_sasin_ha_data_internal+640] - vmulps ymm15, ymm4, YMMWORD PTR [__svml_sasin_ha_data_internal+768] - vaddps ymm1, ymm1, YMMWORD PTR [__svml_sasin_ha_data_internal+704] - vaddps ymm2, ymm15, YMMWORD PTR [__svml_sasin_ha_data_internal+832] + vmulps ymm1, ymm4, YMMWORD PTR [__jsvml_sasin_ha_data_internal+640] + vmulps ymm15, ymm4, YMMWORD PTR [__jsvml_sasin_ha_data_internal+768] + vaddps ymm1, ymm1, YMMWORD PTR [__jsvml_sasin_ha_data_internal+704] + vaddps ymm2, ymm15, YMMWORD PTR [__jsvml_sasin_ha_data_internal+832] vmulps ymm15, ymm1, ymm0 vaddps ymm1, ymm2, ymm15 vsubps ymm15, ymm3, ymm5 - vaddps ymm3, ymm3, YMMWORD PTR [__svml_sasin_ha_data_internal+1024] + vaddps ymm3, ymm3, YMMWORD PTR [__jsvml_sasin_ha_data_internal+1024] vmulps ymm0, ymm4, ymm1 - vaddps ymm2, ymm0, YMMWORD PTR [__svml_sasin_ha_data_internal+896] - vmovups ymm0, YMMWORD PTR [__svml_sasin_ha_data_internal+960] + vaddps ymm2, ymm0, YMMWORD PTR [__jsvml_sasin_ha_data_internal+896] + vmovups ymm0, YMMWORD PTR [__jsvml_sasin_ha_data_internal+960] vmulps ymm4, ymm4, ymm2 vsubps ymm1, ymm0, ymm5 vsubps ymm2, ymm0, ymm1 @@ -480,19 +480,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sasin_ha_cout_rare_internal + call __jsvml_sasin_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_asinf8_ha_e9 ENDP +__jsvml_asinf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf8_ha_e9_B1_B3: +_unwind___jsvml_asinf8_ha_e9_B1_B3: DD 933889 DD 4379712 DD 1534008 @@ -509,13 +509,13 @@ _unwind___svml_asinf8_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_asinf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asinf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf8_ha_e9_B6_B10: +_unwind___jsvml_asinf8_ha_e9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -526,7 +526,7 @@ _unwind___svml_asinf8_ha_e9_B6_B10: DD 694283 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_asinf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asinf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -535,7 +535,7 @@ _unwind___svml_asinf8_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_asinf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_asinf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -549,9 +549,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asinf4_ha_l9 + PUBLIC __jsvml_asinf4_ha_l9 -__svml_asinf4_ha_l9 PROC EXPORT +__jsvml_asinf4_ha_l9 PROC EXPORT _B4_1:: @@ -569,24 +569,24 @@ L56:: vmovups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm3, XMMWORD PTR [__svml_sasin_ha_data_internal] + vmovups xmm3, XMMWORD PTR [__jsvml_sasin_ha_data_internal] and r13, -64 vandps xmm5, xmm3, xmm4 vandnps xmm3, xmm3, xmm4 - vmovups xmm6, XMMWORD PTR [__svml_sasin_ha_data_internal+64] + vmovups xmm6, XMMWORD PTR [__jsvml_sasin_ha_data_internal+64] vmovaps xmm0, xmm5 vfnmadd213ps xmm0, xmm6, xmm6 vmulps xmm1, xmm5, xmm5 - vcmpgtps xmm11, xmm5, XMMWORD PTR [__svml_sasin_ha_data_internal+256] + vcmpgtps xmm11, xmm5, XMMWORD PTR [__jsvml_sasin_ha_data_internal+256] vrsqrtps xmm9, xmm0 - vcmpltps xmm2, xmm0, XMMWORD PTR [__svml_sasin_ha_data_internal+192] + vcmpltps xmm2, xmm0, XMMWORD PTR [__jsvml_sasin_ha_data_internal+192] vminps xmm7, xmm1, xmm0 vcmpnltps xmm1, xmm5, xmm6 vaddps xmm0, xmm0, xmm0 vmovmskps edx, xmm11 - vandps xmm6, xmm0, XMMWORD PTR [__svml_sasin_ha_data_internal+320] + vandps xmm6, xmm0, XMMWORD PTR [__jsvml_sasin_ha_data_internal+320] vandnps xmm11, xmm2, xmm9 - vmovups xmm2, XMMWORD PTR [__svml_sasin_ha_data_internal+448] + vmovups xmm2, XMMWORD PTR [__jsvml_sasin_ha_data_internal+448] vandnps xmm5, xmm1, xmm5 mov QWORD PTR [264+rsp], r13 vsubps xmm9, xmm0, xmm6 @@ -596,21 +596,21 @@ L56:: vmulps xmm11, xmm11, xmm6 vaddps xmm9, xmm0, xmm6 vaddps xmm11, xmm2, xmm11 - vmovups xmm2, XMMWORD PTR [__svml_sasin_ha_data_internal+512] - vfmadd213ps xmm2, xmm11, XMMWORD PTR [__svml_sasin_ha_data_internal+576] + vmovups xmm2, XMMWORD PTR [__jsvml_sasin_ha_data_internal+512] + vfmadd213ps xmm2, xmm11, XMMWORD PTR [__jsvml_sasin_ha_data_internal+576] vmulps xmm9, xmm9, xmm11 vfmsub213ps xmm2, xmm9, xmm6 - vmovups xmm9, XMMWORD PTR [__svml_sasin_ha_data_internal+640] - vmovups xmm11, XMMWORD PTR [__svml_sasin_ha_data_internal+768] - vfmadd213ps xmm9, xmm7, XMMWORD PTR [__svml_sasin_ha_data_internal+704] - vfmadd213ps xmm11, xmm7, XMMWORD PTR [__svml_sasin_ha_data_internal+832] + vmovups xmm9, XMMWORD PTR [__jsvml_sasin_ha_data_internal+640] + vmovups xmm11, XMMWORD PTR [__jsvml_sasin_ha_data_internal+768] + vfmadd213ps xmm9, xmm7, XMMWORD PTR [__jsvml_sasin_ha_data_internal+704] + vfmadd213ps xmm11, xmm7, XMMWORD PTR [__jsvml_sasin_ha_data_internal+832] vmulps xmm6, xmm7, xmm7 vfmadd213ps xmm9, xmm6, xmm11 vsubps xmm11, xmm2, xmm0 - vaddps xmm2, xmm2, XMMWORD PTR [__svml_sasin_ha_data_internal+1024] - vfmadd213ps xmm9, xmm7, XMMWORD PTR [__svml_sasin_ha_data_internal+896] + vaddps xmm2, xmm2, XMMWORD PTR [__jsvml_sasin_ha_data_internal+1024] + vfmadd213ps xmm9, xmm7, XMMWORD PTR [__jsvml_sasin_ha_data_internal+896] vmulps xmm7, xmm7, xmm9 - vmovups xmm9, XMMWORD PTR [__svml_sasin_ha_data_internal+960] + vmovups xmm9, XMMWORD PTR [__jsvml_sasin_ha_data_internal+960] vsubps xmm6, xmm9, xmm0 vsubps xmm9, xmm9, xmm6 vsubps xmm0, xmm0, xmm9 @@ -672,19 +672,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sasin_ha_cout_rare_internal + call __jsvml_sasin_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_asinf4_ha_l9 ENDP +__jsvml_asinf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf4_ha_l9_B1_B3: +_unwind___jsvml_asinf4_ha_l9_B1_B3: DD 801537 DD 2151483 DD 944179 @@ -700,19 +700,19 @@ _unwind___svml_asinf4_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_asinf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asinf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf4_ha_l9_B6_B10: +_unwind___jsvml_asinf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_asinf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_asinf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -721,7 +721,7 @@ _unwind___svml_asinf4_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_asinf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_asinf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -735,9 +735,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asinf4_ha_e9 + PUBLIC __jsvml_asinf4_ha_e9 -__svml_asinf4_ha_e9 PROC EXPORT +__jsvml_asinf4_ha_e9 PROC EXPORT _B5_1:: @@ -756,24 +756,24 @@ L71:: vmovups XMMWORD PTR [192+rsp], xmm8 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm10, XMMWORD PTR [__svml_sasin_ha_data_internal] + vmovups xmm10, XMMWORD PTR [__jsvml_sasin_ha_data_internal] and r13, -64 - vmovups xmm1, XMMWORD PTR [__svml_sasin_ha_data_internal+64] + vmovups xmm1, XMMWORD PTR [__jsvml_sasin_ha_data_internal+64] vandps xmm8, xmm10, xmm11 vmulps xmm12, xmm8, xmm1 vandnps xmm10, xmm10, xmm11 - vcmpgtps xmm9, xmm8, XMMWORD PTR [__svml_sasin_ha_data_internal+256] + vcmpgtps xmm9, xmm8, XMMWORD PTR [__jsvml_sasin_ha_data_internal+256] vmulps xmm4, xmm8, xmm8 vsubps xmm5, xmm1, xmm12 vmovmskps edx, xmm9 vcmpnltps xmm9, xmm8, xmm1 - vcmpltps xmm3, xmm5, XMMWORD PTR [__svml_sasin_ha_data_internal+192] + vcmpltps xmm3, xmm5, XMMWORD PTR [__jsvml_sasin_ha_data_internal+192] vminps xmm4, xmm4, xmm5 vrsqrtps xmm2, xmm5 vaddps xmm5, xmm5, xmm5 vandnps xmm0, xmm3, xmm2 vandnps xmm8, xmm9, xmm8 - vmovups xmm2, XMMWORD PTR [__svml_sasin_ha_data_internal+320] + vmovups xmm2, XMMWORD PTR [__jsvml_sasin_ha_data_internal+320] vandps xmm12, xmm5, xmm2 mov QWORD PTR [280+rsp], r13 vsubps xmm1, xmm5, xmm12 @@ -784,27 +784,27 @@ L71:: vsubps xmm12, xmm5, xmm3 vmulps xmm3, xmm0, xmm1 vmulps xmm0, xmm0, xmm12 - vsubps xmm2, xmm2, XMMWORD PTR [__svml_sasin_ha_data_internal+448] + vsubps xmm2, xmm2, XMMWORD PTR [__jsvml_sasin_ha_data_internal+448] vaddps xmm12, xmm3, xmm2 vaddps xmm3, xmm5, xmm1 vaddps xmm12, xmm0, xmm12 - vmulps xmm0, xmm12, XMMWORD PTR [__svml_sasin_ha_data_internal+512] + vmulps xmm0, xmm12, XMMWORD PTR [__jsvml_sasin_ha_data_internal+512] vmulps xmm2, xmm12, xmm3 - vaddps xmm0, xmm0, XMMWORD PTR [__svml_sasin_ha_data_internal+576] + vaddps xmm0, xmm0, XMMWORD PTR [__jsvml_sasin_ha_data_internal+576] vmulps xmm12, xmm0, xmm2 vmulps xmm0, xmm4, xmm4 vsubps xmm3, xmm12, xmm1 - vmulps xmm1, xmm4, XMMWORD PTR [__svml_sasin_ha_data_internal+640] - vmulps xmm12, xmm4, XMMWORD PTR [__svml_sasin_ha_data_internal+768] - vaddps xmm1, xmm1, XMMWORD PTR [__svml_sasin_ha_data_internal+704] - vaddps xmm2, xmm12, XMMWORD PTR [__svml_sasin_ha_data_internal+832] + vmulps xmm1, xmm4, XMMWORD PTR [__jsvml_sasin_ha_data_internal+640] + vmulps xmm12, xmm4, XMMWORD PTR [__jsvml_sasin_ha_data_internal+768] + vaddps xmm1, xmm1, XMMWORD PTR [__jsvml_sasin_ha_data_internal+704] + vaddps xmm2, xmm12, XMMWORD PTR [__jsvml_sasin_ha_data_internal+832] vmulps xmm12, xmm1, xmm0 vaddps xmm1, xmm2, xmm12 vsubps xmm12, xmm3, xmm5 - vaddps xmm3, xmm3, XMMWORD PTR [__svml_sasin_ha_data_internal+1024] + vaddps xmm3, xmm3, XMMWORD PTR [__jsvml_sasin_ha_data_internal+1024] vmulps xmm0, xmm4, xmm1 - vaddps xmm2, xmm0, XMMWORD PTR [__svml_sasin_ha_data_internal+896] - vmovups xmm0, XMMWORD PTR [__svml_sasin_ha_data_internal+960] + vaddps xmm2, xmm0, XMMWORD PTR [__jsvml_sasin_ha_data_internal+896] + vmovups xmm0, XMMWORD PTR [__jsvml_sasin_ha_data_internal+960] vmulps xmm4, xmm4, xmm2 vsubps xmm1, xmm0, xmm5 vsubps xmm2, xmm0, xmm1 @@ -869,19 +869,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sasin_ha_cout_rare_internal + call __jsvml_sasin_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_asinf4_ha_e9 ENDP +__jsvml_asinf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf4_ha_e9_B1_B3: +_unwind___jsvml_asinf4_ha_e9_B1_B3: DD 934913 DD 2282564 DD 821308 @@ -898,19 +898,19 @@ _unwind___svml_asinf4_ha_e9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_asinf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asinf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf4_ha_e9_B6_B10: +_unwind___jsvml_asinf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_asinf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_asinf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -919,7 +919,7 @@ _unwind___svml_asinf4_ha_e9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_asinf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_asinf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -933,9 +933,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_asinf4_ha_ex + PUBLIC __jsvml_asinf4_ha_ex -__svml_asinf4_ha_ex PROC EXPORT +__jsvml_asinf4_ha_ex PROC EXPORT _B6_1:: @@ -954,16 +954,16 @@ L88:: movups XMMWORD PTR [208+rsp], xmm7 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm11, XMMWORD PTR [__svml_sasin_ha_data_internal] + movups xmm11, XMMWORD PTR [__jsvml_sasin_ha_data_internal] and r13, -64 movaps xmm7, xmm11 andnps xmm11, xmm5 andps xmm7, xmm5 - movups xmm2, XMMWORD PTR [__svml_sasin_ha_data_internal+64] + movups xmm2, XMMWORD PTR [__jsvml_sasin_ha_data_internal+64] movaps xmm4, xmm7 mulps xmm4, xmm2 movaps xmm12, xmm2 - movups xmm3, XMMWORD PTR [__svml_sasin_ha_data_internal+256] + movups xmm3, XMMWORD PTR [__jsvml_sasin_ha_data_internal+256] subps xmm12, xmm4 cmpltps xmm3, xmm7 rsqrtps xmm1, xmm12 @@ -972,13 +972,13 @@ L88:: movaps xmm0, xmm12 movaps xmm3, xmm7 mulps xmm4, xmm7 - cmpltps xmm0, XMMWORD PTR [__svml_sasin_ha_data_internal+192] + cmpltps xmm0, XMMWORD PTR [__jsvml_sasin_ha_data_internal+192] cmpnltps xmm3, xmm2 minps xmm4, xmm12 addps xmm12, xmm12 andnps xmm0, xmm1 movaps xmm2, xmm12 - movups xmm1, XMMWORD PTR [__svml_sasin_ha_data_internal+320] + movups xmm1, XMMWORD PTR [__jsvml_sasin_ha_data_internal+320] movaps xmm13, xmm0 andps xmm2, xmm1 mov QWORD PTR [280+rsp], r13 @@ -991,35 +991,35 @@ L88:: subps xmm14, xmm1 mulps xmm1, xmm0 mulps xmm0, xmm14 - subps xmm1, XMMWORD PTR [__svml_sasin_ha_data_internal+448] + subps xmm1, XMMWORD PTR [__jsvml_sasin_ha_data_internal+448] movaps xmm14, xmm2 addps xmm13, xmm1 addps xmm14, xmm12 addps xmm0, xmm13 - movups xmm1, XMMWORD PTR [__svml_sasin_ha_data_internal+512] + movups xmm1, XMMWORD PTR [__jsvml_sasin_ha_data_internal+512] mulps xmm1, xmm0 mulps xmm0, xmm14 - addps xmm1, XMMWORD PTR [__svml_sasin_ha_data_internal+576] + addps xmm1, XMMWORD PTR [__jsvml_sasin_ha_data_internal+576] mulps xmm1, xmm0 movaps xmm0, xmm4 mulps xmm0, xmm4 subps xmm1, xmm12 - movups xmm12, XMMWORD PTR [__svml_sasin_ha_data_internal+640] + movups xmm12, XMMWORD PTR [__jsvml_sasin_ha_data_internal+640] mulps xmm12, xmm4 - movups xmm13, XMMWORD PTR [__svml_sasin_ha_data_internal+768] + movups xmm13, XMMWORD PTR [__jsvml_sasin_ha_data_internal+768] mulps xmm13, xmm4 - addps xmm12, XMMWORD PTR [__svml_sasin_ha_data_internal+704] + addps xmm12, XMMWORD PTR [__jsvml_sasin_ha_data_internal+704] mulps xmm12, xmm0 - addps xmm13, XMMWORD PTR [__svml_sasin_ha_data_internal+832] - movups xmm14, XMMWORD PTR [__svml_sasin_ha_data_internal+960] + addps xmm13, XMMWORD PTR [__jsvml_sasin_ha_data_internal+832] + movups xmm14, XMMWORD PTR [__jsvml_sasin_ha_data_internal+960] addps xmm13, xmm12 mulps xmm13, xmm4 movaps xmm0, xmm14 subps xmm0, xmm2 - addps xmm13, XMMWORD PTR [__svml_sasin_ha_data_internal+896] + addps xmm13, XMMWORD PTR [__jsvml_sasin_ha_data_internal+896] subps xmm14, xmm0 mulps xmm4, xmm13 - movups xmm13, XMMWORD PTR [__svml_sasin_ha_data_internal+1024] + movups xmm13, XMMWORD PTR [__jsvml_sasin_ha_data_internal+1024] movaps xmm12, xmm1 andps xmm0, xmm3 subps xmm12, xmm2 @@ -1088,19 +1088,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sasin_ha_cout_rare_internal + call __jsvml_sasin_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_asinf4_ha_ex ENDP +__jsvml_asinf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf4_ha_ex_B1_B3: +_unwind___jsvml_asinf4_ha_ex_B1_B3: DD 934401 DD 2282562 DD 882746 @@ -1117,19 +1117,19 @@ _unwind___svml_asinf4_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_asinf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_asinf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_asinf4_ha_ex_B6_B10: +_unwind___jsvml_asinf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_asinf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_asinf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1138,7 +1138,7 @@ _unwind___svml_asinf4_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_asinf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_asinf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1152,9 +1152,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sasin_ha_cout_rare_internal + PUBLIC __jsvml_sasin_ha_cout_rare_internal -__svml_sasin_ha_cout_rare_internal PROC +__jsvml_sasin_ha_cout_rare_internal PROC _B7_1:: @@ -1696,13 +1696,13 @@ _B7_12:: _B7_13:: -__svml_sasin_ha_cout_rare_internal ENDP +__jsvml_sasin_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sasin_ha_cout_rare_internal_B1_B12: +_unwind___jsvml_sasin_ha_cout_rare_internal_B1_B12: DD 1072129 DD 686172 DD 624724 @@ -1720,7 +1720,7 @@ _unwind___svml_sasin_ha_cout_rare_internal_B1_B12: DD imagerel _B7_1 DD imagerel _B7_13 - DD imagerel _unwind___svml_sasin_ha_cout_rare_internal_B1_B12 + DD imagerel _unwind___jsvml_sasin_ha_cout_rare_internal_B1_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1728,8 +1728,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_sasin_ha_data_internal -__svml_sasin_ha_data_internal DD 2147483647 + PUBLIC __jsvml_sasin_ha_data_internal +__jsvml_sasin_ha_data_internal DD 2147483647 DD 2147483647 DD 2147483647 DD 2147483647 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_atan2_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_atan2_windows_x86.S similarity index 85% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_atan2_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_atan2_windows_x86.S index faf8dad771f..b1694c23886 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_atan2_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_atan2_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2f4_ha_l9 + PUBLIC __jsvml_atan2f4_ha_l9 -__svml_atan2f4_ha_l9 PROC EXPORT +__jsvml_atan2f4_ha_l9 PROC EXPORT _B1_1:: @@ -64,21 +64,21 @@ L1:: vmovups XMMWORD PTR [368+rsp], xmm6 mov QWORD PTR [464+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm9, XMMWORD PTR [__svml_satan2_ha_data_internal+192] + vmovups xmm9, XMMWORD PTR [__jsvml_satan2_ha_data_internal+192] and r13, -64 vandps xmm10, xmm11, xmm9 vandps xmm9, xmm0, xmm9 - vmovups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+1728] + vmovups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1728] vxorps xmm2, xmm11, xmm10 vmovups XMMWORD PTR [32+rsp], xmm0 vxorps xmm5, xmm0, xmm9 vmovups XMMWORD PTR [432+rsp], xmm2 vpsubd xmm2, xmm10, xmm3 - vmulps xmm1, xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+384] + vmulps xmm1, xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+384] vpsubd xmm15, xmm9, xmm3 - vmulps xmm0, xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+448] - vmulps xmm3, xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+512] - vmovups xmm12, XMMWORD PTR [__svml_satan2_ha_data_internal+1792] + vmulps xmm0, xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+448] + vmulps xmm3, xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+512] + vmovups xmm12, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1792] vpcmpgtd xmm13, xmm2, xmm12 vpcmpeqd xmm4, xmm2, xmm12 vpcmpgtd xmm14, xmm15, xmm12 @@ -87,13 +87,13 @@ L1:: vpor xmm8, xmm13, xmm4 vpor xmm5, xmm14, xmm6 vpcmpgtd xmm2, xmm1, xmm9 - vmulps xmm13, xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+576] + vmulps xmm13, xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+576] vpcmpgtd xmm4, xmm0, xmm9 vpcmpgtd xmm15, xmm3, xmm9 vpor xmm7, xmm8, xmm5 - vmovups xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+640] + vmovups xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+640] vpandn xmm5, xmm4, xmm15 - vmovups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+704] + vmovups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+704] vmovdqa xmm14, xmm10 vmovdqu XMMWORD PTR [448+rsp], xmm7 vpandn xmm7, xmm2, xmm4 @@ -103,22 +103,22 @@ L1:: vandps xmm13, xmm9, xmm2 vfnmadd213ps xmm4, xmm3, xmm9 vandps xmm2, xmm10, xmm2 - vpxor xmm12, xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+1600] + vpxor xmm12, xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1600] vpandn xmm8, xmm15, xmm12 vmovdqa xmm15, xmm10 vfmadd213ps xmm1, xmm9, xmm10 vandps xmm0, xmm14, xmm7 vandps xmm14, xmm4, xmm5 vorps xmm0, xmm13, xmm0 - vmovups xmm4, XMMWORD PTR [__svml_satan2_ha_data_internal+768] + vmovups xmm4, XMMWORD PTR [__jsvml_satan2_ha_data_internal+768] vfnmadd213ps xmm15, xmm4, xmm9 vfmadd213ps xmm3, xmm9, xmm10 vandps xmm1, xmm1, xmm7 vfmadd213ps xmm4, xmm9, xmm10 vorps xmm2, xmm2, xmm1 - vandps xmm1, xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+960] + vandps xmm1, xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+960] vandps xmm12, xmm15, xmm8 - vxorps xmm15, xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+128] + vxorps xmm15, xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+128] vorps xmm13, xmm14, xmm12 vandps xmm15, xmm15, xmm6 vorps xmm12, xmm0, xmm13 @@ -128,23 +128,23 @@ L1:: vorps xmm15, xmm3, xmm4 vandps xmm14, xmm9, xmm6 vorps xmm12, xmm2, xmm15 - vandps xmm2, xmm8, XMMWORD PTR [__svml_satan2_ha_data_internal+1088] + vandps xmm2, xmm8, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1088] vorps xmm3, xmm12, xmm14 - vandps xmm4, xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+1216] + vandps xmm4, xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1216] vorps xmm12, xmm2, xmm4 vrcpps xmm2, xmm3 - vmovups xmm14, XMMWORD PTR [__svml_satan2_ha_data_internal+64] + vmovups xmm14, XMMWORD PTR [__jsvml_satan2_ha_data_internal+64] vfnmadd231ps xmm14, xmm3, xmm2 - vandps xmm0, xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+832] + vandps xmm0, xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+832] vorps xmm15, xmm0, xmm1 vorps xmm4, xmm15, xmm12 vmovdqa xmm15, xmm3 - vandps xmm8, xmm8, XMMWORD PTR [__svml_satan2_ha_data_internal+1152] + vandps xmm8, xmm8, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1152] vfmadd213ps xmm14, xmm14, xmm14 - vandps xmm6, xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+1280] - vandps xmm7, xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+896] - vandps xmm5, xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+1024] - vmovups xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1408] + vandps xmm6, xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1280] + vandps xmm7, xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+896] + vandps xmm5, xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1024] + vmovups xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1408] vfmadd213ps xmm2, xmm14, xmm2 vmulps xmm0, xmm13, xmm2 vfnmadd213ps xmm15, xmm0, xmm13 @@ -157,16 +157,16 @@ L1:: vmulps xmm5, xmm6, xmm6 vorps xmm13, xmm3, xmm2 vaddps xmm12, xmm13, xmm14 - vmovups xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+1344] - vfmadd213ps xmm7, xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+1472] - vfmadd213ps xmm5, xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1536] - vmovups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal] + vmovups xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1344] + vfmadd213ps xmm7, xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1472] + vfmadd213ps xmm5, xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1536] + vmovups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal] vmovups xmm2, XMMWORD PTR [432+rsp] vcmpltps xmm0, xmm11, xmm3 vfmadd213ps xmm7, xmm6, xmm5 - vandps xmm8, xmm0, XMMWORD PTR [__svml_satan2_ha_data_internal+320] + vandps xmm8, xmm0, XMMWORD PTR [__jsvml_satan2_ha_data_internal+320] vxorps xmm14, xmm8, xmm2 - vandps xmm13, xmm0, XMMWORD PTR [__svml_satan2_ha_data_internal+256] + vandps xmm13, xmm0, XMMWORD PTR [__jsvml_satan2_ha_data_internal+256] vaddps xmm12, xmm14, xmm12 vmulps xmm0, xmm6, xmm7 vfmadd213ps xmm0, xmm15, xmm12 @@ -242,7 +242,7 @@ _B1_11:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_satan2_ha_cout_rare_internal + call __jsvml_satan2_ha_cout_rare_internal jmp _B1_9 _B1_12:: @@ -256,11 +256,11 @@ _B1_12:: vmovups xmm4, XMMWORD PTR [32+rsp] vcmpordps xmm6, xmm4, xmm4 vcmpeqps xmm4, xmm9, xmm3 - vandnps xmm10, xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+1856] + vandnps xmm10, xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1856] vandps xmm13, xmm5, xmm6 vblendvps xmm5, xmm10, xmm3, xmm4 vpcmpgtd xmm3, xmm3, xmm11 - vandps xmm3, xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+1920] + vandps xmm3, xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1920] vpand xmm1, xmm12, xmm13 vorps xmm2, xmm5, xmm2 vpandn xmm14, xmm1, xmm14 @@ -273,13 +273,13 @@ _B1_12:: _B1_13:: -__svml_atan2f4_ha_l9 ENDP +__jsvml_atan2f4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_l9_B1_B4: +_unwind___jsvml_atan2f4_ha_l9_B1_B4: DD 1602305 DD 3855475 DD 1534059 @@ -301,19 +301,19 @@ _unwind___svml_atan2f4_ha_l9_B1_B4: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_atan2f4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_l9_B7_B11: +_unwind___jsvml_atan2f4_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_atan2f4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -322,17 +322,17 @@ _unwind___svml_atan2f4_ha_l9_B7_B11: DD imagerel _B1_7 DD imagerel _B1_12 - DD imagerel _unwind___svml_atan2f4_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_atan2f4_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_l9_B12_B12: +_unwind___jsvml_atan2f4_ha_l9_B12_B12: DD 33 DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_atan2f4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -341,7 +341,7 @@ _unwind___svml_atan2f4_ha_l9_B12_B12: DD imagerel _B1_12 DD imagerel _B1_13 - DD imagerel _unwind___svml_atan2f4_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_atan2f4_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -355,9 +355,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2f4_ha_e9 + PUBLIC __jsvml_atan2f4_ha_e9 -__svml_atan2f4_ha_e9 PROC EXPORT +__jsvml_atan2f4_ha_e9 PROC EXPORT _B2_1:: @@ -382,17 +382,17 @@ L38:: vmovups XMMWORD PTR [352+rsp], xmm6 mov QWORD PTR [464+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm11, XMMWORD PTR [__svml_satan2_ha_data_internal+192] + vmovups xmm11, XMMWORD PTR [__jsvml_satan2_ha_data_internal+192] and r13, -64 - vmovups xmm2, XMMWORD PTR [__svml_satan2_ha_data_internal+1728] + vmovups xmm2, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1728] vandps xmm12, xmm13, xmm11 vandps xmm11, xmm0, xmm11 vpsubd xmm9, xmm12, xmm2 vpsubd xmm7, xmm11, xmm2 vxorps xmm4, xmm13, xmm12 - vmulps xmm2, xmm12, XMMWORD PTR [__svml_satan2_ha_data_internal+448] + vmulps xmm2, xmm12, XMMWORD PTR [__jsvml_satan2_ha_data_internal+448] vxorps xmm3, xmm0, xmm11 - vmovups xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+1792] + vmovups xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1792] vpcmpgtd xmm10, xmm9, xmm15 vpcmpeqd xmm5, xmm9, xmm15 vpcmpgtd xmm14, xmm7, xmm15 @@ -400,25 +400,25 @@ L38:: vpor xmm8, xmm10, xmm5 vpor xmm1, xmm14, xmm6 vpcmpgtd xmm5, xmm2, xmm11 - vmovups xmm2, XMMWORD PTR [__svml_satan2_ha_data_internal+640] + vmovups xmm2, XMMWORD PTR [__jsvml_satan2_ha_data_internal+640] vmovups XMMWORD PTR [432+rsp], xmm4 vpor xmm4, xmm8, xmm1 vmovdqu XMMWORD PTR [448+rsp], xmm4 - vmulps xmm10, xmm12, XMMWORD PTR [__svml_satan2_ha_data_internal+576] + vmulps xmm10, xmm12, XMMWORD PTR [__jsvml_satan2_ha_data_internal+576] vmulps xmm4, xmm12, xmm2 - vmulps xmm9, xmm12, XMMWORD PTR [__svml_satan2_ha_data_internal+512] + vmulps xmm9, xmm12, XMMWORD PTR [__jsvml_satan2_ha_data_internal+512] vmulps xmm2, xmm11, xmm2 vmovups XMMWORD PTR [416+rsp], xmm3 vpcmpgtd xmm7, xmm11, xmm10 - vmulps xmm3, xmm12, XMMWORD PTR [__svml_satan2_ha_data_internal+384] + vmulps xmm3, xmm12, XMMWORD PTR [__jsvml_satan2_ha_data_internal+384] vsubps xmm10, xmm11, xmm4 vpcmpgtd xmm1, xmm3, xmm11 vpcmpgtd xmm15, xmm9, xmm11 - vpxor xmm14, xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+1600] + vpxor xmm14, xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1600] vpandn xmm8, xmm1, xmm5 - vmovups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+704] + vmovups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+704] vpandn xmm6, xmm5, xmm15 - vmovups xmm4, XMMWORD PTR [__svml_satan2_ha_data_internal+768] + vmovups xmm4, XMMWORD PTR [__jsvml_satan2_ha_data_internal+768] vpandn xmm9, xmm15, xmm14 vmulps xmm5, xmm12, xmm3 vandps xmm14, xmm10, xmm8 @@ -437,7 +437,7 @@ L38:: vaddps xmm4, xmm12, xmm14 vorps xmm15, xmm0, xmm5 vandps xmm0, xmm12, xmm1 - vxorps xmm10, xmm12, XMMWORD PTR [__svml_satan2_ha_data_internal+128] + vxorps xmm10, xmm12, XMMWORD PTR [__jsvml_satan2_ha_data_internal+128] vandps xmm14, xmm11, xmm7 vandps xmm10, xmm10, xmm7 vaddps xmm1, xmm12, xmm2 @@ -447,22 +447,22 @@ L38:: vandps xmm3, xmm4, xmm9 vorps xmm2, xmm0, xmm1 vorps xmm10, xmm10, xmm3 - vandps xmm0, xmm8, XMMWORD PTR [__svml_satan2_ha_data_internal+832] + vandps xmm0, xmm8, XMMWORD PTR [__jsvml_satan2_ha_data_internal+832] vorps xmm15, xmm2, xmm10 - vandps xmm1, xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+960] + vandps xmm1, xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+960] vorps xmm14, xmm15, xmm14 - vandps xmm3, xmm9, XMMWORD PTR [__svml_satan2_ha_data_internal+1088] + vandps xmm3, xmm9, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1088] vorps xmm10, xmm0, xmm1 - vandps xmm2, xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+1216] + vandps xmm2, xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1216] vorps xmm15, xmm3, xmm2 vorps xmm10, xmm10, xmm15 vcvtps2pd ymm15, xmm5 vcvtps2pd ymm3, xmm14 - vandps xmm8, xmm8, XMMWORD PTR [__svml_satan2_ha_data_internal+896] - vandps xmm6, xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+1024] - vandps xmm7, xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+1280] + vandps xmm8, xmm8, XMMWORD PTR [__jsvml_satan2_ha_data_internal+896] + vandps xmm6, xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1024] + vandps xmm7, xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1280] vrcpps xmm5, xmm14 - vmovupd ymm2, YMMWORD PTR [__svml_satan2_ha_data_internal+1664] + vmovupd ymm2, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1664] vcvtps2pd ymm14, xmm5 vmulpd ymm5, ymm3, ymm14 vsubpd ymm1, ymm2, ymm5 @@ -471,7 +471,7 @@ L38:: vaddpd ymm3, ymm14, ymm0 vaddpd ymm2, ymm2, ymm4 vmulpd ymm3, ymm3, ymm2 - vandps xmm2, xmm9, XMMWORD PTR [__svml_satan2_ha_data_internal+1152] + vandps xmm2, xmm9, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1152] vorps xmm9, xmm8, xmm6 vorps xmm2, xmm2, xmm7 vorps xmm7, xmm9, xmm2 @@ -483,17 +483,17 @@ L38:: vcvtpd2ps xmm3, ymm0 vmulps xmm1, xmm14, xmm14 vaddps xmm7, xmm3, xmm7 - vmulps xmm0, xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1344] - vmulps xmm4, xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1408] - vaddps xmm6, xmm0, XMMWORD PTR [__svml_satan2_ha_data_internal+1472] - vaddps xmm8, xmm4, XMMWORD PTR [__svml_satan2_ha_data_internal+1536] + vmulps xmm0, xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1344] + vmulps xmm4, xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1408] + vaddps xmm6, xmm0, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1472] + vaddps xmm8, xmm4, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1536] vmulps xmm2, xmm14, xmm6 - vmovups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal] + vmovups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal] vaddps xmm0, xmm8, xmm2 vcmpltps xmm15, xmm13, xmm3 vmulps xmm0, xmm14, xmm0 - vandps xmm9, xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+256] - vandps xmm15, xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+320] + vandps xmm9, xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+256] + vandps xmm15, xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+320] vmovups xmm2, XMMWORD PTR [432+rsp] vxorps xmm14, xmm15, xmm2 vmulps xmm4, xmm5, xmm0 @@ -573,7 +573,7 @@ _B2_11:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_satan2_ha_cout_rare_internal + call __jsvml_satan2_ha_cout_rare_internal jmp _B2_9 _B2_12:: @@ -587,11 +587,11 @@ _B2_12:: vmovups xmm4, XMMWORD PTR [32+rsp] vcmpordps xmm6, xmm4, xmm4 vcmpeqps xmm4, xmm11, xmm3 - vandnps xmm12, xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+1856] + vandnps xmm12, xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1856] vandps xmm10, xmm5, xmm6 vblendvps xmm5, xmm12, xmm3, xmm4 vpcmpgtd xmm3, xmm3, xmm13 - vandps xmm3, xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+1920] + vandps xmm3, xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1920] vpand xmm1, xmm9, xmm10 vorps xmm2, xmm5, xmm2 vpandn xmm14, xmm1, xmm14 @@ -604,13 +604,13 @@ _B2_12:: _B2_13:: -__svml_atan2f4_ha_e9 ENDP +__jsvml_atan2f4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_e9_B1_B4: +_unwind___jsvml_atan2f4_ha_e9_B1_B4: DD 1602305 DD 3855475 DD 1468523 @@ -632,19 +632,19 @@ _unwind___svml_atan2f4_ha_e9_B1_B4: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_atan2f4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_e9_B7_B11: +_unwind___jsvml_atan2f4_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_atan2f4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -653,17 +653,17 @@ _unwind___svml_atan2f4_ha_e9_B7_B11: DD imagerel _B2_7 DD imagerel _B2_12 - DD imagerel _unwind___svml_atan2f4_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_atan2f4_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_e9_B12_B12: +_unwind___jsvml_atan2f4_ha_e9_B12_B12: DD 33 DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_atan2f4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -672,7 +672,7 @@ _unwind___svml_atan2f4_ha_e9_B12_B12: DD imagerel _B2_12 DD imagerel _B2_13 - DD imagerel _unwind___svml_atan2f4_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_atan2f4_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -686,9 +686,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2f16_ha_z0 + PUBLIC __jsvml_atan2f16_ha_z0 -__svml_atan2f16_ha_z0 PROC EXPORT +__jsvml_atan2f16_ha_z0 PROC EXPORT _B3_1:: @@ -706,16 +706,16 @@ L75:: vmovups ZMMWORD PTR [1312+rsp], zmm20 mov QWORD PTR [1376+rsp], r13 lea r13, QWORD PTR [1055+rsp] - vmovups zmm23, ZMMWORD PTR [__svml_satan2_ha_data_internal+192] + vmovups zmm23, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+192] and r13, -64 - vmovups zmm22, ZMMWORD PTR [__svml_satan2_ha_data_internal+1728] - vmovups zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+1792] - vmovups zmm5, ZMMWORD PTR [__svml_satan2_ha_data_internal+448] - vmovups zmm3, ZMMWORD PTR [__svml_satan2_ha_data_internal+576] - vmovups zmm4, ZMMWORD PTR [__svml_satan2_ha_data_internal+512] + vmovups zmm22, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1728] + vmovups zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1792] + vmovups zmm5, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+448] + vmovups zmm3, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+576] + vmovups zmm4, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+512] vmovaps zmm28, zmm1 vandps zmm26, zmm28, zmm23 - vmovups zmm1, ZMMWORD PTR [__svml_satan2_ha_data_internal+384] + vmovups zmm1, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+384] vmulps zmm21, zmm26, zmm5 {rn-sae} vmulps zmm20, zmm26, zmm1 {rn-sae} vpsubd zmm29, zmm26, zmm22 @@ -725,31 +725,31 @@ L75:: vandps zmm25, zmm27, zmm23 vmulps zmm0, zmm26, zmm4 {rn-sae} vcmpps k1, zmm20, zmm25, 17 {sae} - vmovups zmm4, ZMMWORD PTR [__svml_satan2_ha_data_internal+832] + vmovups zmm4, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+832] vpsubd zmm31, zmm25, zmm22 vpternlogd zmm22, zmm22, zmm22, 255 vxorps zmm23, zmm27, zmm25 vpcmpgtd k3, zmm30, zmm31 vcmpps k6, zmm0, zmm25, 17 {sae} - vmovups zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+640] + vmovups zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+640] vmovaps zmm20, zmm26 mov QWORD PTR [1384+rsp], r13 vpandnd zmm22{k2}, zmm29, zmm29 vmulps zmm29, zmm26, zmm3 {rn-sae} vcmpps k2, zmm21, zmm25, 17 {sae} - vmovups zmm21, ZMMWORD PTR [__svml_satan2_ha_data_internal+64] - vmovups zmm3, ZMMWORD PTR [__svml_satan2_ha_data_internal+1088] - vblendmps zmm0{k2}, zmm4, ZMMWORD PTR [__svml_satan2_ha_data_internal+960] + vmovups zmm21, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+64] + vmovups zmm3, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1088] + vblendmps zmm0{k2}, zmm4, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+960] vpandnd zmm2{k3}, zmm31, zmm31 vcmpps k3, zmm29, zmm25, 17 {sae} - vmovups zmm31, ZMMWORD PTR [__svml_satan2_ha_data_internal+768] + vmovups zmm31, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+768] vxorps zmm20{k3}, zmm26, zmm26 vblendmps zmm1{k3}, zmm31, zmm21 - vblendmps zmm29{k3}, zmm3, ZMMWORD PTR [__svml_satan2_ha_data_internal+1216] + vblendmps zmm29{k3}, zmm3, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1216] vpord zmm22, zmm22, zmm2 - vblendmps zmm2{k2}, zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+704] + vblendmps zmm2{k2}, zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+704] vptestmd k0, zmm22, zmm22 - vmovups zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+1152] + vmovups zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1152] vblendmps zmm5{k6}, zmm2, zmm1 kortestw k0, k0 vfmadd231ps zmm20{k1}, zmm5, zmm25 {rn-sae} @@ -760,30 +760,30 @@ L75:: vfmadd213ps zmm1, zmm21, zmm1 {rn-sae} vfnmadd231ps zmm2{k1}, zmm5, zmm26 {rn-sae} vblendmps zmm5{k6}, zmm0, zmm29 - vmovups zmm0, ZMMWORD PTR [__svml_satan2_ha_data_internal+1344] + vmovups zmm0, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1344] vmulps zmm21, zmm1, zmm2 {rn-sae} vmovaps zmm4, zmm20 vfnmadd213ps zmm4, zmm21, zmm2 {rn-sae} vfmadd213ps zmm4, zmm1, zmm21 {rn-sae} - vmovups zmm21, ZMMWORD PTR [__svml_satan2_ha_data_internal+1536] + vmovups zmm21, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1536] vfnmadd213ps zmm20, zmm4, zmm2 {rn-sae} vmulps zmm3, zmm20, zmm1 {rn-sae} - vmovups zmm20, ZMMWORD PTR [__svml_satan2_ha_data_internal+896] - vblendmps zmm1{k3}, zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+1280] - vmovups zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+1472] - vblendmps zmm31{k2}, zmm20, ZMMWORD PTR [__svml_satan2_ha_data_internal+1024] - vmovups zmm20, ZMMWORD PTR [__svml_satan2_ha_data_internal+1408] + vmovups zmm20, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+896] + vblendmps zmm1{k3}, zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1280] + vmovups zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1472] + vblendmps zmm31{k2}, zmm20, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1024] + vmovups zmm20, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1408] vblendmps zmm2{k6}, zmm31, zmm1 vmulps zmm31, zmm4, zmm4 {rn-sae} - vmovups zmm1, ZMMWORD PTR [__svml_satan2_ha_data_internal+256] + vmovups zmm1, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+256] vaddps zmm3{k1}, zmm3, zmm2 {rn-sae} vmulps zmm29, zmm31, zmm31 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_satan2_ha_data_internal] + vmovups zmm2, ZMMWORD PTR [__jsvml_satan2_ha_data_internal] vfmadd231ps zmm30, zmm0, zmm29 {rn-sae} vfmadd213ps zmm29, zmm20, zmm21 {rn-sae} vcmpps k2, zmm28, zmm2, 17 {sae} vfmadd213ps zmm30, zmm31, zmm29 {rn-sae} - vxorps zmm0, zmm24, ZMMWORD PTR [__svml_satan2_ha_data_internal+320] + vxorps zmm0, zmm24, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+320] vmulps zmm20, zmm30, zmm31 {rn-sae} vaddps zmm3{k2}, zmm3, zmm0 {rn-sae} vfmadd213ps zmm20, zmm4, zmm3 {rn-sae} @@ -926,7 +926,7 @@ _B3_16:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_satan2_ha_cout_rare_internal + call __jsvml_satan2_ha_cout_rare_internal jmp _B3_14 _B3_17:: @@ -935,7 +935,7 @@ _B3_17:: vcmpps k2, zmm27, zmm27, 3 {sae} vpcmpd k6, zmm25, zmm2, 4 vpcmpd k3, zmm26, zmm2, 4 - vmovups zmm30, ZMMWORD PTR [__svml_satan2_ha_data_internal+1920] + vmovups zmm30, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1920] vpternlogd zmm3, zmm3, zmm3, 255 vpternlogd zmm4, zmm4, zmm4, 255 vpternlogd zmm20, zmm20, zmm20, 255 @@ -952,7 +952,7 @@ _B3_17:: vpternlogd zmm26, zmm26, zmm26, 255 vpcmpgtd k3, zmm2, zmm28 vpandnd zmm21, zmm1, zmm22 - vmovups zmm22, ZMMWORD PTR [__svml_satan2_ha_data_internal+1856] + vmovups zmm22, ZMMWORD PTR [__jsvml_satan2_ha_data_internal+1856] vptestmd k0, zmm21, zmm21 vxorps zmm22{k1}, zmm22, zmm22 kmovw r8d, k0 @@ -969,13 +969,13 @@ _B3_17:: _B3_18:: -__svml_atan2f16_ha_z0 ENDP +__jsvml_atan2f16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f16_ha_z0_B1_B10: +_unwind___jsvml_atan2f16_ha_z0_B1_B10: DD 670721 DD 11326524 DD 5392436 @@ -990,13 +990,13 @@ _unwind___svml_atan2f16_ha_z0_B1_B10: DD imagerel _B3_1 DD imagerel _B3_12 - DD imagerel _unwind___svml_atan2f16_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_atan2f16_ha_z0_B1_B10 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f16_ha_z0_B12_B16: +_unwind___jsvml_atan2f16_ha_z0_B12_B16: DD 2809377 DD 8017118 DD 7828691 @@ -1021,7 +1021,7 @@ _unwind___svml_atan2f16_ha_z0_B12_B16: DD 7752459 DD imagerel _B3_1 DD imagerel _B3_12 - DD imagerel _unwind___svml_atan2f16_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_atan2f16_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1030,17 +1030,17 @@ _unwind___svml_atan2f16_ha_z0_B12_B16: DD imagerel _B3_12 DD imagerel _B3_17 - DD imagerel _unwind___svml_atan2f16_ha_z0_B12_B16 + DD imagerel _unwind___jsvml_atan2f16_ha_z0_B12_B16 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f16_ha_z0_B17_B17: +_unwind___jsvml_atan2f16_ha_z0_B17_B17: DD 33 DD imagerel _B3_1 DD imagerel _B3_12 - DD imagerel _unwind___svml_atan2f16_ha_z0_B1_B10 + DD imagerel _unwind___jsvml_atan2f16_ha_z0_B1_B10 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1049,7 +1049,7 @@ _unwind___svml_atan2f16_ha_z0_B17_B17: DD imagerel _B3_17 DD imagerel _B3_18 - DD imagerel _unwind___svml_atan2f16_ha_z0_B17_B17 + DD imagerel _unwind___jsvml_atan2f16_ha_z0_B17_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1063,9 +1063,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2f8_ha_e9 + PUBLIC __jsvml_atan2f8_ha_e9 -__svml_atan2f8_ha_e9 PROC EXPORT +__jsvml_atan2f8_ha_e9 PROC EXPORT _B4_1:: @@ -1091,9 +1091,9 @@ L126:: lea r13, QWORD PTR [111+rsp] vmovaps ymm4, ymm1 and r13, -64 - vmovups ymm1, YMMWORD PTR [__svml_satan2_ha_data_internal+192] - vmovups xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+1728] - vmovups xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+1792] + vmovups ymm1, YMMWORD PTR [__jsvml_satan2_ha_data_internal+192] + vmovups xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1728] + vmovups xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1792] vmovups YMMWORD PTR [32+r13], ymm0 vandps ymm2, ymm4, ymm1 vandps ymm1, ymm0, ymm1 @@ -1125,10 +1125,10 @@ L126:: vpor xmm3, xmm15, xmm5 vpor xmm0, xmm12, xmm3 vmovdqu XMMWORD PTR [608+rsp], xmm0 - vmulps ymm0, ymm2, YMMWORD PTR [__svml_satan2_ha_data_internal+448] - vmulps ymm5, ymm2, YMMWORD PTR [__svml_satan2_ha_data_internal+384] - vmulps ymm7, ymm2, YMMWORD PTR [__svml_satan2_ha_data_internal+512] - vmulps ymm3, ymm2, YMMWORD PTR [__svml_satan2_ha_data_internal+576] + vmulps ymm0, ymm2, YMMWORD PTR [__jsvml_satan2_ha_data_internal+448] + vmulps ymm5, ymm2, YMMWORD PTR [__jsvml_satan2_ha_data_internal+384] + vmulps ymm7, ymm2, YMMWORD PTR [__jsvml_satan2_ha_data_internal+512] + vmulps ymm3, ymm2, YMMWORD PTR [__jsvml_satan2_ha_data_internal+576] vmovdqu XMMWORD PTR [624+rsp], xmm10 vmovups XMMWORD PTR [640+rsp], xmm8 vpcmpgtd xmm14, xmm0, xmm1 @@ -1147,12 +1147,12 @@ L126:: vpcmpgtd xmm0, xmm8, xmm9 vpandn xmm9, xmm14, xmm11 vpandn xmm8, xmm5, xmm14 - vmovups xmm14, XMMWORD PTR [__svml_satan2_ha_data_internal+1600] + vmovups xmm14, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1600] vinsertf128 ymm13, ymm5, xmm6, 1 vpxor xmm6, xmm7, xmm14 vpxor xmm5, xmm0, xmm14 vpandn xmm11, xmm11, xmm6 - vmovups ymm14, YMMWORD PTR [__svml_satan2_ha_data_internal+640] + vmovups ymm14, YMMWORD PTR [__jsvml_satan2_ha_data_internal+640] vpandn xmm10, xmm10, xmm5 vmulps ymm5, ymm2, ymm14 vandps ymm6, ymm1, ymm13 @@ -1160,9 +1160,9 @@ L126:: vsubps ymm10, ymm1, ymm5 vinsertf128 ymm3, ymm8, xmm3, 1 vinsertf128 ymm11, ymm7, xmm0, 1 - vmovups ymm0, YMMWORD PTR [__svml_satan2_ha_data_internal+704] + vmovups ymm0, YMMWORD PTR [__jsvml_satan2_ha_data_internal+704] vandps ymm7, ymm10, ymm3 - vmovups ymm10, YMMWORD PTR [__svml_satan2_ha_data_internal+768] + vmovups ymm10, YMMWORD PTR [__jsvml_satan2_ha_data_internal+768] vmulps ymm8, ymm2, ymm0 vmulps ymm0, ymm1, ymm0 vmulps ymm5, ymm2, ymm10 @@ -1178,7 +1178,7 @@ L126:: vmulps ymm13, ymm1, ymm14 vaddps ymm14, ymm2, ymm0 vmulps ymm0, ymm1, ymm10 - vxorps ymm8, ymm2, YMMWORD PTR [__svml_satan2_ha_data_internal+128] + vxorps ymm8, ymm2, YMMWORD PTR [__jsvml_satan2_ha_data_internal+128] vandps ymm8, ymm8, ymm11 vorps ymm8, ymm9, ymm8 vaddps ymm9, ymm2, ymm13 @@ -1191,17 +1191,17 @@ L126:: vandps ymm14, ymm1, ymm11 vorps ymm13, ymm5, ymm6 vorps ymm5, ymm13, ymm14 - vandps ymm9, ymm12, YMMWORD PTR [__svml_satan2_ha_data_internal+1088] - vandps ymm7, ymm11, YMMWORD PTR [__svml_satan2_ha_data_internal+1216] + vandps ymm9, ymm12, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1088] + vandps ymm7, ymm11, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1216] vorps ymm13, ymm9, ymm7 - vandps ymm0, ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal+832] - vandps ymm10, ymm15, YMMWORD PTR [__svml_satan2_ha_data_internal+960] + vandps ymm0, ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal+832] + vandps ymm10, ymm15, YMMWORD PTR [__jsvml_satan2_ha_data_internal+960] vorps ymm6, ymm0, ymm10 vorps ymm10, ymm6, ymm13 - vandps ymm12, ymm12, YMMWORD PTR [__svml_satan2_ha_data_internal+1152] - vandps ymm11, ymm11, YMMWORD PTR [__svml_satan2_ha_data_internal+1280] - vandps ymm3, ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal+896] - vandps ymm15, ymm15, YMMWORD PTR [__svml_satan2_ha_data_internal+1024] + vandps ymm12, ymm12, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1152] + vandps ymm11, ymm11, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1280] + vandps ymm3, ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal+896] + vandps ymm15, ymm15, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1024] vorps ymm3, ymm3, ymm15 vcvtps2pd ymm14, xmm5 vextractf128 xmm7, ymm5, 1 @@ -1212,7 +1212,7 @@ L126:: vcvtps2pd ymm8, xmm0 vcvtps2pd ymm0, xmm5 vextractf128 xmm6, ymm5, 1 - vmovupd ymm5, YMMWORD PTR [__svml_satan2_ha_data_internal+1664] + vmovupd ymm5, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1664] vmulpd ymm14, ymm14, ymm0 vcvtps2pd ymm6, xmm6 vsubpd ymm7, ymm5, ymm14 @@ -1245,14 +1245,14 @@ L126:: vorps ymm5, ymm3, ymm0 vaddps ymm9, ymm7, ymm5 vmulps ymm7, ymm12, ymm12 - vmovups ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal] - vmulps ymm6, ymm7, YMMWORD PTR [__svml_satan2_ha_data_internal+1344] - vmulps ymm13, ymm7, YMMWORD PTR [__svml_satan2_ha_data_internal+1408] + vmovups ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal] + vmulps ymm6, ymm7, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1344] + vmulps ymm13, ymm7, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1408] vcmplt_oqps ymm11, ymm4, ymm3 - vaddps ymm14, ymm6, YMMWORD PTR [__svml_satan2_ha_data_internal+1472] - vaddps ymm0, ymm13, YMMWORD PTR [__svml_satan2_ha_data_internal+1536] - vandps ymm5, ymm11, YMMWORD PTR [__svml_satan2_ha_data_internal+256] - vandps ymm15, ymm11, YMMWORD PTR [__svml_satan2_ha_data_internal+320] + vaddps ymm14, ymm6, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1472] + vaddps ymm0, ymm13, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1536] + vandps ymm5, ymm11, YMMWORD PTR [__jsvml_satan2_ha_data_internal+256] + vandps ymm15, ymm11, YMMWORD PTR [__jsvml_satan2_ha_data_internal+320] vmulps ymm11, ymm12, ymm14 vaddps ymm6, ymm0, ymm11 vmovups ymm11, YMMWORD PTR [64+r13] @@ -1339,7 +1339,7 @@ _B4_11:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_satan2_ha_cout_rare_internal + call __jsvml_satan2_ha_cout_rare_internal jmp _B4_9 _B4_12:: @@ -1367,14 +1367,14 @@ _B4_12:: vpmovmskb edx, xmm15 vblendvps ymm1, ymm1, ymm2, ymm7 vcmpeqps ymm1, ymm1, ymm3 - vandnps ymm2, ymm7, YMMWORD PTR [__svml_satan2_ha_data_internal+1856] + vandnps ymm2, ymm7, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1856] vblendvps ymm2, ymm2, ymm3, ymm1 vorps ymm10, ymm2, YMMWORD PTR [64+r13] vpcmpgtd xmm3, xmm3, xmm4 vextractf128 xmm7, ymm4, 1 vpcmpgtd xmm8, xmm8, xmm7 vinsertf128 ymm9, ymm3, xmm8, 1 - vandps ymm11, ymm9, YMMWORD PTR [__svml_satan2_ha_data_internal+1920] + vandps ymm11, ymm9, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1920] vaddps ymm12, ymm10, ymm11 vorps ymm13, ymm12, YMMWORD PTR [r13] vinsertf128 ymm5, ymm6, xmm5, 1 @@ -1384,13 +1384,13 @@ _B4_12:: _B4_13:: -__svml_atan2f8_ha_e9 ENDP +__jsvml_atan2f8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f8_ha_e9_B1_B4: +_unwind___jsvml_atan2f8_ha_e9_B1_B4: DD 1601281 DD 5428335 DD 1927271 @@ -1412,19 +1412,19 @@ _unwind___svml_atan2f8_ha_e9_B1_B4: DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_atan2f8_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan2f8_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f8_ha_e9_B7_B11: +_unwind___jsvml_atan2f8_ha_e9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_atan2f8_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan2f8_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1433,17 +1433,17 @@ _unwind___svml_atan2f8_ha_e9_B7_B11: DD imagerel _B4_7 DD imagerel _B4_12 - DD imagerel _unwind___svml_atan2f8_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_atan2f8_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f8_ha_e9_B12_B12: +_unwind___jsvml_atan2f8_ha_e9_B12_B12: DD 33 DD imagerel _B4_1 DD imagerel _B4_7 - DD imagerel _unwind___svml_atan2f8_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_atan2f8_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1452,7 +1452,7 @@ _unwind___svml_atan2f8_ha_e9_B12_B12: DD imagerel _B4_12 DD imagerel _B4_13 - DD imagerel _unwind___svml_atan2f8_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_atan2f8_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1466,9 +1466,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2f4_ha_ex + PUBLIC __jsvml_atan2f4_ha_ex -__svml_atan2f4_ha_ex PROC EXPORT +__jsvml_atan2f4_ha_ex PROC EXPORT _B5_1:: @@ -1494,23 +1494,23 @@ L174:: movups XMMWORD PTR [304+rsp], xmm6 mov QWORD PTR [480+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm10, XMMWORD PTR [__svml_satan2_ha_data_internal+192] + movups xmm10, XMMWORD PTR [__jsvml_satan2_ha_data_internal+192] and r13, -64 andps xmm11, xmm10 andps xmm10, xmm0 - movdqu xmm4, XMMWORD PTR [__svml_satan2_ha_data_internal+1728] + movdqu xmm4, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1728] movaps xmm2, xmm11 psubd xmm2, xmm4 movaps xmm6, xmm10 - movdqu xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1792] + movdqu xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1792] movdqa xmm8, xmm2 pcmpgtd xmm8, xmm1 pcmpeqd xmm2, xmm1 - movups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+576] + movups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+576] psubd xmm6, xmm4 por xmm8, xmm2 movaps xmm15, xmm11 - movups xmm2, XMMWORD PTR [__svml_satan2_ha_data_internal+640] + movups xmm2, XMMWORD PTR [__jsvml_satan2_ha_data_internal+640] movdqa xmm7, xmm6 mulps xmm3, xmm11 pcmpgtd xmm7, xmm1 @@ -1522,7 +1522,7 @@ L174:: pxor xmm9, xmm0 por xmm8, xmm7 movaps xmm4, xmm10 - movups xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+704] + movups xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+704] movaps xmm5, xmm11 movups XMMWORD PTR [32+rsp], xmm0 movaps xmm0, xmm10 @@ -1538,20 +1538,20 @@ L174:: addps xmm1, xmm11 pcmpgtd xmm8, xmm3 movaps xmm15, xmm11 - movups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+768] + movups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+768] movaps xmm9, xmm10 mulps xmm15, xmm3 pxor xmm5, xmm12 mulps xmm3, xmm10 subps xmm9, xmm15 addps xmm3, xmm11 - movups xmm14, XMMWORD PTR [__svml_satan2_ha_data_internal+384] - movups xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+448] - movups xmm7, XMMWORD PTR [__svml_satan2_ha_data_internal+512] + movups xmm14, XMMWORD PTR [__jsvml_satan2_ha_data_internal+384] + movups xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+448] + movups xmm7, XMMWORD PTR [__jsvml_satan2_ha_data_internal+512] mulps xmm14, xmm11 mulps xmm6, xmm11 mulps xmm7, xmm11 - movdqu xmm13, XMMWORD PTR [__svml_satan2_ha_data_internal+1600] + movdqu xmm13, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1600] pcmpgtd xmm14, xmm10 movups XMMWORD PTR [448+rsp], xmm5 pcmpgtd xmm6, xmm10 @@ -1562,7 +1562,7 @@ L174:: pandn xmm6, xmm7 pandn xmm7, xmm13 movaps xmm13, xmm10 - movups xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+128] + movups xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+128] andps xmm13, xmm14 andps xmm0, xmm5 andps xmm4, xmm6 @@ -1582,9 +1582,9 @@ L174:: orps xmm13, xmm15 andps xmm4, xmm8 orps xmm14, xmm1 - movups xmm0, XMMWORD PTR [__svml_satan2_ha_data_internal+1088] + movups xmm0, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1088] orps xmm14, xmm4 - movups xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1216] + movups xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1216] andps xmm0, xmm7 cvtps2pd xmm4, xmm13 movhlps xmm13, xmm13 @@ -1595,8 +1595,8 @@ L174:: cvtps2pd xmm1, xmm14 movhlps xmm13, xmm14 rcpps xmm14, xmm14 - movups xmm9, XMMWORD PTR [__svml_satan2_ha_data_internal+832] - movups xmm2, XMMWORD PTR [__svml_satan2_ha_data_internal+960] + movups xmm9, XMMWORD PTR [__jsvml_satan2_ha_data_internal+832] + movups xmm2, XMMWORD PTR [__jsvml_satan2_ha_data_internal+960] andps xmm9, xmm5 andps xmm2, xmm6 orps xmm9, xmm2 @@ -1607,7 +1607,7 @@ L174:: cvtps2pd xmm0, xmm14 mulpd xmm1, xmm13 mulpd xmm2, xmm0 - movups xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+1664] + movups xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1664] movaps xmm14, xmm15 subpd xmm14, xmm1 movaps xmm1, xmm15 @@ -1637,42 +1637,42 @@ L174:: subpd xmm3, xmm14 cvtpd2ps xmm4, xmm4 cvtpd2ps xmm3, xmm3 - movups xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1152] + movups xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1152] andps xmm1, xmm7 movaps xmm7, xmm2 mulps xmm7, xmm2 movlhps xmm4, xmm3 - movups xmm3, XMMWORD PTR [__svml_satan2_ha_data_internal+896] - movups xmm15, XMMWORD PTR [__svml_satan2_ha_data_internal+1024] + movups xmm3, XMMWORD PTR [__jsvml_satan2_ha_data_internal+896] + movups xmm15, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1024] andps xmm3, xmm5 - movups xmm0, XMMWORD PTR [__svml_satan2_ha_data_internal+1280] + movups xmm0, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1280] andps xmm15, xmm6 andps xmm0, xmm8 orps xmm3, xmm15 orps xmm1, xmm0 orps xmm3, xmm1 - movups xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+1344] + movups xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1344] addps xmm4, xmm3 movaps xmm3, xmm7 mulps xmm3, xmm7 mulps xmm5, xmm3 - movups xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+1408] + movups xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1408] mulps xmm6, xmm3 - addps xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+1472] + addps xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1472] mulps xmm5, xmm7 - addps xmm6, XMMWORD PTR [__svml_satan2_ha_data_internal+1536] - movups xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal] + addps xmm6, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1536] + movups xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal] addps xmm6, xmm5 movups XMMWORD PTR [416+rsp], xmm12 cmpltps xmm12, xmm1 mulps xmm7, xmm6 - movups xmm8, XMMWORD PTR [__svml_satan2_ha_data_internal+320] + movups xmm8, XMMWORD PTR [__jsvml_satan2_ha_data_internal+320] movups xmm3, XMMWORD PTR [448+rsp] andps xmm8, xmm12 pxor xmm8, xmm3 mulps xmm7, xmm2 addps xmm8, xmm4 - movups xmm0, XMMWORD PTR [__svml_satan2_ha_data_internal+256] + movups xmm0, XMMWORD PTR [__jsvml_satan2_ha_data_internal+256] addps xmm8, xmm7 andps xmm0, xmm12 addps xmm2, xmm8 @@ -1751,7 +1751,7 @@ _B5_11:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_satan2_ha_cout_rare_internal + call __jsvml_satan2_ha_cout_rare_internal jmp _B5_9 _B5_12:: @@ -1778,13 +1778,13 @@ _B5_12:: andnps xmm7, xmm10 orps xmm7, xmm11 cmpeqps xmm7, xmm1 - andnps xmm5, XMMWORD PTR [__svml_satan2_ha_data_internal+1856] + andnps xmm5, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1856] movaps xmm10, xmm7 andnps xmm10, xmm5 andps xmm7, xmm1 orps xmm10, xmm7 pcmpgtd xmm1, xmm8 - andps xmm1, XMMWORD PTR [__svml_satan2_ha_data_internal+1920] + andps xmm1, XMMWORD PTR [__jsvml_satan2_ha_data_internal+1920] orps xmm10, XMMWORD PTR [448+rsp] addps xmm10, xmm1 movaps xmm1, xmm9 @@ -1798,13 +1798,13 @@ _B5_12:: _B5_13:: -__svml_atan2f4_ha_ex ENDP +__jsvml_atan2f4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_ex_B1_B4: +_unwind___jsvml_atan2f4_ha_ex_B1_B4: DD 1602817 DD 3986549 DD 1271917 @@ -1826,19 +1826,19 @@ _unwind___svml_atan2f4_ha_ex_B1_B4: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_atan2f4_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_ex_B7_B11: +_unwind___jsvml_atan2f4_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_atan2f4_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1847,17 +1847,17 @@ _unwind___svml_atan2f4_ha_ex_B7_B11: DD imagerel _B5_7 DD imagerel _B5_12 - DD imagerel _unwind___svml_atan2f4_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_atan2f4_ha_ex_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f4_ha_ex_B12_B12: +_unwind___jsvml_atan2f4_ha_ex_B12_B12: DD 33 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_atan2f4_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_atan2f4_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1866,7 +1866,7 @@ _unwind___svml_atan2f4_ha_ex_B12_B12: DD imagerel _B5_12 DD imagerel _B5_13 - DD imagerel _unwind___svml_atan2f4_ha_ex_B12_B12 + DD imagerel _unwind___jsvml_atan2f4_ha_ex_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1880,9 +1880,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atan2f8_ha_l9 + PUBLIC __jsvml_atan2f8_ha_l9 -__svml_atan2f8_ha_l9 PROC EXPORT +__jsvml_atan2f8_ha_l9 PROC EXPORT _B6_1:: @@ -1906,36 +1906,36 @@ L215:: vmovups YMMWORD PTR [496+rsp], ymm6 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups ymm9, YMMWORD PTR [__svml_satan2_ha_data_internal+192] + vmovups ymm9, YMMWORD PTR [__jsvml_satan2_ha_data_internal+192] and r13, -64 - vmovups ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal+1728] - vmovups ymm12, YMMWORD PTR [__svml_satan2_ha_data_internal+1792] + vmovups ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1728] + vmovups ymm12, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1792] vmovups YMMWORD PTR [32+r13], ymm0 vmovdqa ymm11, ymm1 vandps ymm10, ymm11, ymm9 vandps ymm9, ymm0, ymm9 vxorps ymm2, ymm11, ymm10 vmovups YMMWORD PTR [64+r13], ymm2 - vmulps ymm1, ymm10, YMMWORD PTR [__svml_satan2_ha_data_internal+384] + vmulps ymm1, ymm10, YMMWORD PTR [__jsvml_satan2_ha_data_internal+384] vpsubd ymm2, ymm10, ymm3 vpsubd ymm15, ymm9, ymm3 - vmulps ymm3, ymm10, YMMWORD PTR [__svml_satan2_ha_data_internal+512] + vmulps ymm3, ymm10, YMMWORD PTR [__jsvml_satan2_ha_data_internal+512] vxorps ymm5, ymm0, ymm9 vpcmpgtd ymm13, ymm2, ymm12 vpcmpeqd ymm4, ymm2, ymm12 vpcmpgtd ymm14, ymm15, ymm12 vpcmpeqd ymm6, ymm15, ymm12 vmovups YMMWORD PTR [r13], ymm5 - vmulps ymm0, ymm10, YMMWORD PTR [__svml_satan2_ha_data_internal+448] + vmulps ymm0, ymm10, YMMWORD PTR [__jsvml_satan2_ha_data_internal+448] vpor ymm8, ymm13, ymm4 vpor ymm5, ymm14, ymm6 - vmulps ymm13, ymm10, YMMWORD PTR [__svml_satan2_ha_data_internal+576] + vmulps ymm13, ymm10, YMMWORD PTR [__jsvml_satan2_ha_data_internal+576] vpor ymm7, ymm8, ymm5 vpcmpgtd ymm2, ymm1, ymm9 - vmovups ymm1, YMMWORD PTR [__svml_satan2_ha_data_internal+640] + vmovups ymm1, YMMWORD PTR [__jsvml_satan2_ha_data_internal+640] vmovdqu YMMWORD PTR [96+r13], ymm7 vpcmpgtd ymm15, ymm3, ymm9 - vmovups ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal+704] + vmovups ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal+704] vpcmpgtd ymm4, ymm0, ymm9 vpandn ymm7, ymm2, ymm4 vpandn ymm5, ymm4, ymm15 @@ -1946,17 +1946,17 @@ L215:: vfmadd213ps ymm1, ymm9, ymm10 vfmadd213ps ymm3, ymm9, ymm10 vpcmpgtd ymm6, ymm9, ymm13 - vpxor ymm12, ymm6, YMMWORD PTR [__svml_satan2_ha_data_internal+1600] + vpxor ymm12, ymm6, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1600] vandps ymm0, ymm14, ymm7 vandps ymm14, ymm4, ymm5 - vmovups ymm4, YMMWORD PTR [__svml_satan2_ha_data_internal+768] + vmovups ymm4, YMMWORD PTR [__jsvml_satan2_ha_data_internal+768] vpandn ymm8, ymm15, ymm12 vmovdqa ymm15, ymm10 vfnmadd213ps ymm15, ymm4, ymm9 vfmadd213ps ymm4, ymm9, ymm10 vandps ymm13, ymm9, ymm2 vandps ymm12, ymm15, ymm8 - vxorps ymm15, ymm10, YMMWORD PTR [__svml_satan2_ha_data_internal+128] + vxorps ymm15, ymm10, YMMWORD PTR [__jsvml_satan2_ha_data_internal+128] vorps ymm0, ymm13, ymm0 vorps ymm13, ymm14, ymm12 vandps ymm15, ymm15, ymm6 @@ -1971,44 +1971,44 @@ L215:: vandps ymm14, ymm9, ymm6 vorps ymm12, ymm2, ymm15 vorps ymm3, ymm12, ymm14 - vandps ymm2, ymm8, YMMWORD PTR [__svml_satan2_ha_data_internal+1088] - vandps ymm4, ymm6, YMMWORD PTR [__svml_satan2_ha_data_internal+1216] + vandps ymm2, ymm8, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1088] + vandps ymm4, ymm6, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1216] vorps ymm12, ymm2, ymm4 vrcpps ymm2, ymm3 - vmovups ymm14, YMMWORD PTR [__svml_satan2_ha_data_internal+64] + vmovups ymm14, YMMWORD PTR [__jsvml_satan2_ha_data_internal+64] vfnmadd231ps ymm14, ymm3, ymm2 vfmadd213ps ymm14, ymm14, ymm14 vfmadd213ps ymm2, ymm14, ymm2 - vandps ymm0, ymm7, YMMWORD PTR [__svml_satan2_ha_data_internal+832] - vandps ymm1, ymm5, YMMWORD PTR [__svml_satan2_ha_data_internal+960] + vandps ymm0, ymm7, YMMWORD PTR [__jsvml_satan2_ha_data_internal+832] + vandps ymm1, ymm5, YMMWORD PTR [__jsvml_satan2_ha_data_internal+960] vorps ymm15, ymm0, ymm1 vmulps ymm0, ymm13, ymm2 - vmovups ymm1, YMMWORD PTR [__svml_satan2_ha_data_internal+1408] + vmovups ymm1, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1408] vorps ymm4, ymm15, ymm12 vmovdqa ymm15, ymm3 vfnmadd213ps ymm15, ymm0, ymm13 vfmadd213ps ymm15, ymm2, ymm0 vfnmadd213ps ymm3, ymm15, ymm13 - vandps ymm8, ymm8, YMMWORD PTR [__svml_satan2_ha_data_internal+1152] - vandps ymm6, ymm6, YMMWORD PTR [__svml_satan2_ha_data_internal+1280] + vandps ymm8, ymm8, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1152] + vandps ymm6, ymm6, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1280] vmulps ymm14, ymm2, ymm3 vorps ymm2, ymm8, ymm6 vmulps ymm6, ymm15, ymm15 - vandps ymm7, ymm7, YMMWORD PTR [__svml_satan2_ha_data_internal+896] - vandps ymm5, ymm5, YMMWORD PTR [__svml_satan2_ha_data_internal+1024] + vandps ymm7, ymm7, YMMWORD PTR [__jsvml_satan2_ha_data_internal+896] + vandps ymm5, ymm5, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1024] vorps ymm3, ymm7, ymm5 vmulps ymm5, ymm6, ymm6 - vmovups ymm7, YMMWORD PTR [__svml_satan2_ha_data_internal+1344] - vfmadd213ps ymm7, ymm5, YMMWORD PTR [__svml_satan2_ha_data_internal+1472] - vfmadd213ps ymm5, ymm1, YMMWORD PTR [__svml_satan2_ha_data_internal+1536] + vmovups ymm7, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1344] + vfmadd213ps ymm7, ymm5, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1472] + vfmadd213ps ymm5, ymm1, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1536] vorps ymm13, ymm3, ymm2 - vmovups ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal] + vmovups ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal] vfmadd213ps ymm7, ymm6, ymm5 vmovups ymm2, YMMWORD PTR [64+r13] vcmplt_oqps ymm0, ymm11, ymm3 vaddps ymm12, ymm13, ymm14 - vandps ymm8, ymm0, YMMWORD PTR [__svml_satan2_ha_data_internal+320] - vandps ymm13, ymm0, YMMWORD PTR [__svml_satan2_ha_data_internal+256] + vandps ymm8, ymm0, YMMWORD PTR [__jsvml_satan2_ha_data_internal+320] + vandps ymm13, ymm0, YMMWORD PTR [__jsvml_satan2_ha_data_internal+256] vmulps ymm0, ymm6, ymm7 vxorps ymm14, ymm8, ymm2 vaddps ymm12, ymm14, ymm12 @@ -2086,7 +2086,7 @@ _B6_11:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_satan2_ha_cout_rare_internal + call __jsvml_satan2_ha_cout_rare_internal jmp _B6_9 _B6_12:: @@ -2101,12 +2101,12 @@ _B6_12:: vpor ymm12, ymm7, ymm8 vcmpeqps ymm4, ymm9, ymm3 vandps ymm13, ymm5, ymm6 - vandnps ymm10, ymm15, YMMWORD PTR [__svml_satan2_ha_data_internal+1856] + vandnps ymm10, ymm15, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1856] vpand ymm1, ymm12, ymm13 vblendvps ymm5, ymm10, ymm3, ymm4 vpandn ymm14, ymm1, ymm14 vpcmpgtd ymm3, ymm3, ymm11 - vandps ymm3, ymm3, YMMWORD PTR [__svml_satan2_ha_data_internal+1920] + vandps ymm3, ymm3, YMMWORD PTR [__jsvml_satan2_ha_data_internal+1920] vorps ymm2, ymm5, ymm2 vaddps ymm2, ymm2, ymm3 vorps ymm4, ymm2, YMMWORD PTR [r13] @@ -2117,13 +2117,13 @@ _B6_12:: _B6_13:: -__svml_atan2f8_ha_l9 ENDP +__jsvml_atan2f8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f8_ha_l9_B1_B4: +_unwind___jsvml_atan2f8_ha_l9_B1_B4: DD 1601281 DD 4904047 DD 2058343 @@ -2145,19 +2145,19 @@ _unwind___svml_atan2f8_ha_l9_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan2f8_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan2f8_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f8_ha_l9_B7_B11: +_unwind___jsvml_atan2f8_ha_l9_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan2f8_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan2f8_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2166,17 +2166,17 @@ _unwind___svml_atan2f8_ha_l9_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_atan2f8_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_atan2f8_ha_l9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atan2f8_ha_l9_B12_B12: +_unwind___jsvml_atan2f8_ha_l9_B12_B12: DD 33 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_atan2f8_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_atan2f8_ha_l9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -2185,7 +2185,7 @@ _unwind___svml_atan2f8_ha_l9_B12_B12: DD imagerel _B6_12 DD imagerel _B6_13 - DD imagerel _unwind___svml_atan2f8_ha_l9_B12_B12 + DD imagerel _unwind___jsvml_atan2f8_ha_l9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2199,9 +2199,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_satan2_ha_cout_rare_internal + PUBLIC __jsvml_satan2_ha_cout_rare_internal -__svml_satan2_ha_cout_rare_internal PROC +__jsvml_satan2_ha_cout_rare_internal PROC _B7_1:: @@ -3209,13 +3209,13 @@ _B7_48:: _B7_49:: -__svml_satan2_ha_cout_rare_internal ENDP +__jsvml_satan2_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_satan2_ha_cout_rare_internal_B1_B48: +_unwind___jsvml_satan2_ha_cout_rare_internal_B1_B48: DD 563713 DD 485530 DD 649365 @@ -3229,7 +3229,7 @@ _unwind___svml_satan2_ha_cout_rare_internal_B1_B48: DD imagerel _B7_1 DD imagerel _B7_49 - DD imagerel _unwind___svml_satan2_ha_cout_rare_internal_B1_B48 + DD imagerel _unwind___jsvml_satan2_ha_cout_rare_internal_B1_B48 .pdata ENDS _DATA SEGMENT 'DATA' @@ -3242,8 +3242,8 @@ ione DD 1065353216 _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_satan2_ha_data_internal -__svml_satan2_ha_data_internal DD 0 + PUBLIC __jsvml_satan2_ha_data_internal +__jsvml_satan2_ha_data_internal DD 0 DD 0 DD 0 DD 0 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_atan_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_atan_windows_x86.S similarity index 81% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_atan_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_atan_windows_x86.S index 60f13e4bfe4..5924b1ed45b 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_atan_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_atan_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atanf8_ha_e9 + PUBLIC __jsvml_atanf8_ha_e9 -__svml_atanf8_ha_e9 PROC EXPORT +__jsvml_atanf8_ha_e9 PROC EXPORT _B1_1:: @@ -63,13 +63,13 @@ L1:: vpxor xmm6, xmm6, xmm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps ymm3, ymm0, YMMWORD PTR [__svml_satan_ha_data_internal+192] + vandps ymm3, ymm0, YMMWORD PTR [__jsvml_satan_ha_data_internal+192] and r13, -64 - vmovups xmm5, XMMWORD PTR [__svml_satan_ha_data_internal+1920] - vmovups xmm15, XMMWORD PTR [__svml_satan_ha_data_internal+1984] + vmovups xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal+1920] + vmovups xmm15, XMMWORD PTR [__jsvml_satan_ha_data_internal+1984] vmovups YMMWORD PTR [32+r13], ymm0 - vandps ymm14, ymm0, YMMWORD PTR [__svml_satan_ha_data_internal+128] - vmovups xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+448] + vandps ymm14, ymm0, YMMWORD PTR [__jsvml_satan_ha_data_internal+128] + vmovups xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+448] mov QWORD PTR [536+rsp], r13 vpsubd xmm2, xmm3, xmm5 vextractf128 xmm12, ymm3, 1 @@ -82,14 +82,14 @@ L1:: vpor xmm8, xmm10, xmm11 vpcmpgtd xmm15, xmm3, xmm0 vpackssdw xmm9, xmm13, xmm8 - vmovups xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+256] - vmovups xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+320] + vmovups xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+256] + vmovups xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+320] vpcmpgtd xmm13, xmm2, xmm3 - vmovups xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+384] + vmovups xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+384] vpcmpgtd xmm10, xmm2, xmm12 vpacksswb xmm5, xmm9, xmm6 vpcmpgtd xmm8, xmm4, xmm3 - vmovups xmm6, XMMWORD PTR [__svml_satan_ha_data_internal+1728] + vmovups xmm6, XMMWORD PTR [__jsvml_satan_ha_data_internal+1728] vpcmpgtd xmm9, xmm1, xmm3 vpxor xmm2, xmm15, xmm6 vpcmpgtd xmm11, xmm4, xmm12 @@ -97,12 +97,12 @@ L1:: vpcmpgtd xmm7, xmm1, xmm12 vpcmpgtd xmm12, xmm12, xmm0 vpxor xmm6, xmm12, xmm6 - vmovups ymm1, YMMWORD PTR [__svml_satan_ha_data_internal+768] - vmovups ymm4, YMMWORD PTR [__svml_satan_ha_data_internal+896] + vmovups ymm1, YMMWORD PTR [__jsvml_satan_ha_data_internal+768] + vmovups ymm4, YMMWORD PTR [__jsvml_satan_ha_data_internal+896] vpandn xmm5, xmm13, xmm8 vpandn xmm8, xmm8, xmm9 vpandn xmm9, xmm9, xmm2 - vmovups ymm2, YMMWORD PTR [__svml_satan_ha_data_internal+832] + vmovups ymm2, YMMWORD PTR [__jsvml_satan_ha_data_internal+832] vinsertf128 ymm0, ymm13, xmm10, 1 vpandn xmm10, xmm10, xmm11 vpandn xmm11, xmm11, xmm7 @@ -114,7 +114,7 @@ L1:: vsubps ymm7, ymm3, ymm1 vsubps ymm15, ymm3, ymm2 vsubps ymm9, ymm3, ymm4 - vmovups ymm5, YMMWORD PTR [__svml_satan_ha_data_internal] + vmovups ymm5, YMMWORD PTR [__jsvml_satan_ha_data_internal] vmulps ymm1, ymm3, ymm1 vmulps ymm4, ymm3, ymm4 vandps ymm9, ymm9, ymm10 @@ -123,13 +123,13 @@ L1:: vandps ymm15, ymm15, ymm11 vorps ymm8, ymm6, ymm8 vorps ymm6, ymm15, ymm9 - vandps ymm7, ymm12, YMMWORD PTR [__svml_satan_ha_data_internal+64] + vandps ymm7, ymm12, YMMWORD PTR [__jsvml_satan_ha_data_internal+64] vorps ymm15, ymm8, ymm6 vorps ymm7, ymm15, ymm7 vandps ymm6, ymm5, ymm0 vaddps ymm0, ymm5, ymm1 vandps ymm15, ymm0, ymm13 - vandps ymm1, ymm10, YMMWORD PTR [__svml_satan_ha_data_internal+1216] + vandps ymm1, ymm10, YMMWORD PTR [__jsvml_satan_ha_data_internal+1216] vcvtps2pd ymm8, xmm7 vextractf128 xmm9, ymm7, 1 vmulps ymm7, ymm3, ymm2 @@ -143,15 +143,15 @@ L1:: vorps ymm7, ymm7, ymm2 vorps ymm15, ymm3, ymm7 vorps ymm6, ymm15, ymm5 - vandps ymm7, ymm12, YMMWORD PTR [__svml_satan_ha_data_internal+1344] + vandps ymm7, ymm12, YMMWORD PTR [__jsvml_satan_ha_data_internal+1344] vorps ymm5, ymm1, ymm7 - vandps ymm2, ymm13, YMMWORD PTR [__svml_satan_ha_data_internal+960] - vandps ymm4, ymm11, YMMWORD PTR [__svml_satan_ha_data_internal+1088] - vandps ymm10, ymm10, YMMWORD PTR [__svml_satan_ha_data_internal+1280] - vandps ymm12, ymm12, YMMWORD PTR [__svml_satan_ha_data_internal+1408] + vandps ymm2, ymm13, YMMWORD PTR [__jsvml_satan_ha_data_internal+960] + vandps ymm4, ymm11, YMMWORD PTR [__jsvml_satan_ha_data_internal+1088] + vandps ymm10, ymm10, YMMWORD PTR [__jsvml_satan_ha_data_internal+1280] + vandps ymm12, ymm12, YMMWORD PTR [__jsvml_satan_ha_data_internal+1408] vorps ymm10, ymm10, ymm12 - vandps ymm13, ymm13, YMMWORD PTR [__svml_satan_ha_data_internal+1024] - vandps ymm11, ymm11, YMMWORD PTR [__svml_satan_ha_data_internal+1152] + vandps ymm13, ymm13, YMMWORD PTR [__jsvml_satan_ha_data_internal+1024] + vandps ymm11, ymm11, YMMWORD PTR [__jsvml_satan_ha_data_internal+1152] vorps ymm11, ymm13, ymm11 vcvtps2pd ymm0, xmm6 vextractf128 xmm3, ymm6, 1 @@ -161,7 +161,7 @@ L1:: vorps ymm7, ymm3, ymm5 vcvtps2pd ymm1, xmm6 vextractf128 xmm2, ymm6, 1 - vmovupd ymm6, YMMWORD PTR [__svml_satan_ha_data_internal+1856] + vmovupd ymm6, YMMWORD PTR [__jsvml_satan_ha_data_internal+1856] vmulpd ymm0, ymm0, ymm1 vcvtps2pd ymm2, xmm2 vsubpd ymm4, ymm6, ymm0 @@ -179,7 +179,7 @@ L1:: vmulpd ymm15, ymm15, ymm4 vmulpd ymm8, ymm8, ymm6 vmulpd ymm1, ymm9, ymm15 - vmovupd ymm9, YMMWORD PTR [__svml_satan_ha_data_internal+1792] + vmovupd ymm9, YMMWORD PTR [__jsvml_satan_ha_data_internal+1792] vandpd ymm0, ymm8, ymm9 vandpd ymm2, ymm1, ymm9 vcvtpd2ps xmm15, ymm0 @@ -192,12 +192,12 @@ L1:: vinsertf128 ymm15, ymm15, xmm9, 1 vmulps ymm9, ymm15, ymm15 vmulps ymm3, ymm9, ymm9 - vmulps ymm4, ymm3, YMMWORD PTR [__svml_satan_ha_data_internal+1536] - vaddps ymm6, ymm4, YMMWORD PTR [__svml_satan_ha_data_internal+1664] + vmulps ymm4, ymm3, YMMWORD PTR [__jsvml_satan_ha_data_internal+1536] + vaddps ymm6, ymm4, YMMWORD PTR [__jsvml_satan_ha_data_internal+1664] vinsertf128 ymm2, ymm8, xmm1, 1 - vmulps ymm1, ymm3, YMMWORD PTR [__svml_satan_ha_data_internal+1472] + vmulps ymm1, ymm3, YMMWORD PTR [__jsvml_satan_ha_data_internal+1472] vaddps ymm0, ymm2, ymm0 - vaddps ymm5, ymm1, YMMWORD PTR [__svml_satan_ha_data_internal+1600] + vaddps ymm5, ymm1, YMMWORD PTR [__jsvml_satan_ha_data_internal+1600] vmulps ymm8, ymm9, ymm5 vaddps ymm12, ymm6, ymm8 vmulps ymm13, ymm9, ymm12 @@ -265,19 +265,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_satan_ha_cout_rare_internal + call __jsvml_satan_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_atanf8_ha_e9 ENDP +__jsvml_atanf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf8_ha_e9_B1_B3: +_unwind___jsvml_atanf8_ha_e9_B1_B3: DD 1601793 DD 4379761 DD 1271909 @@ -299,19 +299,19 @@ _unwind___svml_atanf8_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_atanf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atanf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf8_ha_e9_B6_B10: +_unwind___jsvml_atanf8_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_atanf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atanf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -320,7 +320,7 @@ _unwind___svml_atanf8_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_atanf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_atanf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -334,9 +334,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atanf4_ha_e9 + PUBLIC __jsvml_atanf4_ha_e9 -__svml_atanf4_ha_e9 PROC EXPORT +__jsvml_atanf4_ha_e9 PROC EXPORT _B2_1:: @@ -359,29 +359,29 @@ L30:: vmovups XMMWORD PTR [336+rsp], xmm6 mov QWORD PTR [352+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm4, xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+192] + vandps xmm4, xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+192] and r13, -64 - vmovups xmm5, XMMWORD PTR [__svml_satan_ha_data_internal+1984] - vpsubd xmm3, xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+1920] - vmovups xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+320] + vmovups xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal+1984] + vpsubd xmm3, xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+1920] + vmovups xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+320] vpcmpgtd xmm2, xmm3, xmm5 - vmovups xmm12, XMMWORD PTR [__svml_satan_ha_data_internal+256] + vmovups xmm12, XMMWORD PTR [__jsvml_satan_ha_data_internal+256] vpcmpeqd xmm1, xmm3, xmm5 - vmovups xmm10, XMMWORD PTR [__svml_satan_ha_data_internal+384] + vmovups xmm10, XMMWORD PTR [__jsvml_satan_ha_data_internal+384] vpcmpgtd xmm7, xmm8, xmm4 - vpcmpgtd xmm8, xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+448] + vpcmpgtd xmm8, xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+448] vpor xmm13, xmm2, xmm1 vmovups XMMWORD PTR [32+rsp], xmm0 vpcmpgtd xmm6, xmm10, xmm4 - vandps xmm11, xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+128] + vandps xmm11, xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+128] vpcmpgtd xmm0, xmm12, xmm4 - vpxor xmm14, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+1728] + vpxor xmm14, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+1728] vpandn xmm9, xmm0, xmm7 - vmovups xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+768] + vmovups xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+768] vpandn xmm7, xmm7, xmm6 - vmovups xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+832] + vmovups xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+832] vpandn xmm10, xmm6, xmm14 - vmovups xmm5, XMMWORD PTR [__svml_satan_ha_data_internal+896] + vmovups xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal+896] vandps xmm12, xmm4, xmm0 vmovmskps edx, xmm13 vsubps xmm15, xmm4, xmm1 @@ -393,12 +393,12 @@ L30:: vandps xmm15, xmm6, xmm7 vandps xmm6, xmm14, xmm10 vorps xmm13, xmm12, xmm13 - vmovups xmm3, XMMWORD PTR [__svml_satan_ha_data_internal] + vmovups xmm3, XMMWORD PTR [__jsvml_satan_ha_data_internal] vorps xmm12, xmm15, xmm6 vorps xmm15, xmm13, xmm12 vandps xmm12, xmm3, xmm0 vmulps xmm0, xmm4, xmm1 - vandps xmm14, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+64] + vandps xmm14, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+64] vaddps xmm1, xmm3, xmm0 vorps xmm13, xmm15, xmm14 vandps xmm0, xmm4, xmm8 @@ -414,22 +414,22 @@ L30:: vorps xmm12, xmm12, xmm0 vrcpps xmm0, xmm12 vcvtps2pd ymm14, xmm12 - vandps xmm1, xmm9, XMMWORD PTR [__svml_satan_ha_data_internal+960] - vandps xmm2, xmm7, XMMWORD PTR [__svml_satan_ha_data_internal+1088] + vandps xmm1, xmm9, XMMWORD PTR [__jsvml_satan_ha_data_internal+960] + vandps xmm2, xmm7, XMMWORD PTR [__jsvml_satan_ha_data_internal+1088] vorps xmm5, xmm1, xmm2 vcvtps2pd ymm1, xmm0 - vandps xmm3, xmm10, XMMWORD PTR [__svml_satan_ha_data_internal+1216] - vandps xmm4, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+1344] + vandps xmm3, xmm10, XMMWORD PTR [__jsvml_satan_ha_data_internal+1216] + vandps xmm4, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+1344] vorps xmm15, xmm3, xmm4 - vmovupd ymm2, YMMWORD PTR [__svml_satan_ha_data_internal+1856] + vmovupd ymm2, YMMWORD PTR [__jsvml_satan_ha_data_internal+1856] vorps xmm13, xmm5, xmm15 vmulpd ymm14, ymm14, ymm1 - vandps xmm10, xmm10, XMMWORD PTR [__svml_satan_ha_data_internal+1280] - vandps xmm8, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+1408] + vandps xmm10, xmm10, XMMWORD PTR [__jsvml_satan_ha_data_internal+1280] + vandps xmm8, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+1408] vorps xmm8, xmm10, xmm8 - vandps xmm9, xmm9, XMMWORD PTR [__svml_satan_ha_data_internal+1024] + vandps xmm9, xmm9, XMMWORD PTR [__jsvml_satan_ha_data_internal+1024] vsubpd ymm14, ymm2, ymm14 - vandps xmm7, xmm7, XMMWORD PTR [__svml_satan_ha_data_internal+1152] + vandps xmm7, xmm7, XMMWORD PTR [__jsvml_satan_ha_data_internal+1152] vorps xmm7, xmm9, xmm7 vmulpd ymm12, ymm1, ymm14 vmulpd ymm0, ymm14, ymm14 @@ -437,7 +437,7 @@ L30:: vaddpd ymm4, ymm2, ymm0 vmulpd ymm5, ymm3, ymm4 vmulpd ymm6, ymm6, ymm5 - vandpd ymm0, ymm6, YMMWORD PTR [__svml_satan_ha_data_internal+1792] + vandpd ymm0, ymm6, YMMWORD PTR [__jsvml_satan_ha_data_internal+1792] vcvtpd2ps xmm12, ymm0 vsubpd ymm1, ymm6, ymm0 vorps xmm0, xmm7, xmm8 @@ -445,10 +445,10 @@ L30:: vcvtpd2ps xmm2, ymm1 vmulps xmm3, xmm10, xmm10 vaddps xmm0, xmm2, xmm0 - vmulps xmm1, xmm3, XMMWORD PTR [__svml_satan_ha_data_internal+1472] - vmulps xmm4, xmm3, XMMWORD PTR [__svml_satan_ha_data_internal+1536] - vaddps xmm5, xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+1600] - vaddps xmm6, xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+1664] + vmulps xmm1, xmm3, XMMWORD PTR [__jsvml_satan_ha_data_internal+1472] + vmulps xmm4, xmm3, XMMWORD PTR [__jsvml_satan_ha_data_internal+1536] + vaddps xmm5, xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+1600] + vaddps xmm6, xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+1664] vmulps xmm9, xmm10, xmm5 mov QWORD PTR [360+rsp], r13 vaddps xmm14, xmm6, xmm9 @@ -516,19 +516,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_satan_ha_cout_rare_internal + call __jsvml_satan_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_atanf4_ha_e9 ENDP +__jsvml_atanf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf4_ha_e9_B1_B3: +_unwind___jsvml_atanf4_ha_e9_B1_B3: DD 1600769 DD 2937965 DD 1402981 @@ -550,19 +550,19 @@ _unwind___svml_atanf4_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_atanf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atanf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf4_ha_e9_B6_B10: +_unwind___jsvml_atanf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_atanf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_atanf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -571,7 +571,7 @@ _unwind___svml_atanf4_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_atanf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_atanf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -585,9 +585,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atanf4_ha_l9 + PUBLIC __jsvml_atanf4_ha_l9 -__svml_atanf4_ha_l9 PROC EXPORT +__jsvml_atanf4_ha_l9 PROC EXPORT _B3_1:: @@ -610,34 +610,34 @@ L59:: vmovups XMMWORD PTR [288+rsp], xmm6 mov QWORD PTR [352+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm1, xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+192] + vandps xmm1, xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+192] and r13, -64 - vmovups xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+1984] - vpsubd xmm5, xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+1920] + vmovups xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+1984] + vpsubd xmm5, xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+1920] vpcmpgtd xmm3, xmm5, xmm2 vpcmpeqd xmm4, xmm5, xmm2 vpor xmm12, xmm3, xmm4 - vmovups xmm3, XMMWORD PTR [__svml_satan_ha_data_internal+768] - vmovups xmm11, XMMWORD PTR [__svml_satan_ha_data_internal+256] + vmovups xmm3, XMMWORD PTR [__jsvml_satan_ha_data_internal+768] + vmovups xmm11, XMMWORD PTR [__jsvml_satan_ha_data_internal+256] vsubps xmm15, xmm1, xmm3 vmovmskps edx, xmm12 - vmovups xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+320] + vmovups xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+320] vpcmpgtd xmm4, xmm11, xmm1 - vmovups xmm6, XMMWORD PTR [__svml_satan_ha_data_internal+384] + vmovups xmm6, XMMWORD PTR [__jsvml_satan_ha_data_internal+384] vpcmpgtd xmm7, xmm8, xmm1 - vpcmpgtd xmm8, xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+448] + vpcmpgtd xmm8, xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+448] vpcmpgtd xmm5, xmm6, xmm1 vmovups XMMWORD PTR [32+rsp], xmm0 vpandn xmm9, xmm4, xmm7 - vandps xmm10, xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+128] + vandps xmm10, xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+128] vpandn xmm7, xmm7, xmm5 - vpxor xmm14, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+1728] + vpxor xmm14, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+1728] vandps xmm13, xmm1, xmm4 - vmovups xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+832] + vmovups xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+832] vpandn xmm6, xmm5, xmm14 - vmovups xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+896] + vmovups xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+896] vandps xmm14, xmm15, xmm9 - vmovups xmm5, XMMWORD PTR [__svml_satan_ha_data_internal] + vmovups xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal] vorps xmm13, xmm13, xmm14 vfmadd213ps xmm3, xmm1, xmm5 vsubps xmm12, xmm1, xmm0 @@ -648,7 +648,7 @@ L59:: vandps xmm15, xmm15, xmm6 vorps xmm11, xmm11, xmm15 vandps xmm4, xmm5, xmm4 - vandps xmm12, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+64] + vandps xmm12, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+64] vorps xmm14, xmm13, xmm11 vandps xmm3, xmm3, xmm9 vandps xmm0, xmm0, xmm7 @@ -659,25 +659,25 @@ L59:: vorps xmm12, xmm0, xmm2 test edx, edx vorps xmm11, xmm1, xmm12 - vandps xmm0, xmm9, XMMWORD PTR [__svml_satan_ha_data_internal+960] + vandps xmm0, xmm9, XMMWORD PTR [__jsvml_satan_ha_data_internal+960] vorps xmm13, xmm11, xmm13 - vandps xmm1, xmm7, XMMWORD PTR [__svml_satan_ha_data_internal+1088] + vandps xmm1, xmm7, XMMWORD PTR [__jsvml_satan_ha_data_internal+1088] vorps xmm4, xmm0, xmm1 vrcpps xmm0, xmm13 vfnmadd231ps xmm5, xmm13, xmm0 - vandps xmm2, xmm6, XMMWORD PTR [__svml_satan_ha_data_internal+1216] - vandps xmm3, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+1344] + vandps xmm2, xmm6, XMMWORD PTR [__jsvml_satan_ha_data_internal+1216] + vandps xmm3, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+1344] vorps xmm15, xmm2, xmm3 vorps xmm12, xmm4, xmm15 vfmadd213ps xmm5, xmm5, xmm5 - vmovups xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+1472] - vmovups xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+1536] - vandps xmm9, xmm9, XMMWORD PTR [__svml_satan_ha_data_internal+1024] - vandps xmm7, xmm7, XMMWORD PTR [__svml_satan_ha_data_internal+1152] + vmovups xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+1472] + vmovups xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+1536] + vandps xmm9, xmm9, XMMWORD PTR [__jsvml_satan_ha_data_internal+1024] + vandps xmm7, xmm7, XMMWORD PTR [__jsvml_satan_ha_data_internal+1152] vfmadd213ps xmm0, xmm5, xmm0 vorps xmm5, xmm9, xmm7 - vandps xmm6, xmm6, XMMWORD PTR [__svml_satan_ha_data_internal+1280] - vandps xmm8, xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+1408] + vandps xmm6, xmm6, XMMWORD PTR [__jsvml_satan_ha_data_internal+1280] + vandps xmm8, xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+1408] vmulps xmm11, xmm14, xmm0 vmulps xmm3, xmm11, xmm11 vfnmadd213ps xmm13, xmm11, xmm14 @@ -685,8 +685,8 @@ L59:: vmulps xmm2, xmm3, xmm3 vorps xmm5, xmm5, xmm14 vmulps xmm0, xmm0, xmm13 - vfmadd213ps xmm4, xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+1600] - vfmadd213ps xmm2, xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+1664] + vfmadd213ps xmm4, xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+1600] + vfmadd213ps xmm2, xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+1664] vaddps xmm6, xmm5, xmm0 vfmadd213ps xmm4, xmm3, xmm2 vmulps xmm7, xmm3, xmm4 @@ -750,19 +750,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_satan_ha_cout_rare_internal + call __jsvml_satan_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_atanf4_ha_l9 ENDP +__jsvml_atanf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf4_ha_l9_B1_B3: +_unwind___jsvml_atanf4_ha_l9_B1_B3: DD 1600769 DD 2937965 DD 1206373 @@ -784,19 +784,19 @@ _unwind___svml_atanf4_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_atanf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atanf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf4_ha_l9_B6_B10: +_unwind___jsvml_atanf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_atanf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atanf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -805,7 +805,7 @@ _unwind___svml_atanf4_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_atanf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_atanf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -819,9 +819,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atanf4_ha_ex + PUBLIC __jsvml_atanf4_ha_ex -__svml_atanf4_ha_ex PROC EXPORT +__jsvml_atanf4_ha_ex PROC EXPORT _B4_1:: @@ -844,33 +844,33 @@ L88:: movups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [352+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm12, XMMWORD PTR [__svml_satan_ha_data_internal+192] + movups xmm12, XMMWORD PTR [__jsvml_satan_ha_data_internal+192] and r13, -64 andps xmm12, xmm0 - movups xmm14, XMMWORD PTR [__svml_satan_ha_data_internal+768] + movups xmm14, XMMWORD PTR [__jsvml_satan_ha_data_internal+768] movaps xmm7, xmm12 - movups xmm10, XMMWORD PTR [__svml_satan_ha_data_internal+832] + movups xmm10, XMMWORD PTR [__jsvml_satan_ha_data_internal+832] movaps xmm15, xmm12 - movups xmm9, XMMWORD PTR [__svml_satan_ha_data_internal+896] + movups xmm9, XMMWORD PTR [__jsvml_satan_ha_data_internal+896] movaps xmm13, xmm12 movaps xmm4, xmm12 movaps xmm6, xmm12 - psubd xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+1920] + psubd xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+1920] subps xmm7, xmm14 mulps xmm14, xmm12 subps xmm15, xmm10 subps xmm13, xmm9 mulps xmm10, xmm12 mulps xmm9, xmm12 - movups xmm8, XMMWORD PTR [__svml_satan_ha_data_internal+128] + movups xmm8, XMMWORD PTR [__jsvml_satan_ha_data_internal+128] movdqa xmm5, xmm4 - movdqu xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+256] + movdqu xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+256] andps xmm8, xmm0 - movdqu xmm3, XMMWORD PTR [__svml_satan_ha_data_internal+1984] + movdqu xmm3, XMMWORD PTR [__jsvml_satan_ha_data_internal+1984] pcmpgtd xmm1, xmm12 movups XMMWORD PTR [32+rsp], xmm0 movaps xmm0, xmm12 - movups xmm11, XMMWORD PTR [__svml_satan_ha_data_internal] + movups xmm11, XMMWORD PTR [__jsvml_satan_ha_data_internal] pcmpgtd xmm5, xmm3 pcmpeqd xmm4, xmm3 movdqa xmm3, xmm1 @@ -881,12 +881,12 @@ L88:: addps xmm10, xmm11 addps xmm11, xmm9 movmskps eax, xmm5 - movdqu xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+320] - movdqu xmm5, XMMWORD PTR [__svml_satan_ha_data_internal+384] + movdqu xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+320] + movdqu xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal+384] pcmpgtd xmm4, xmm12 - pcmpgtd xmm6, XMMWORD PTR [__svml_satan_ha_data_internal+448] + pcmpgtd xmm6, XMMWORD PTR [__jsvml_satan_ha_data_internal+448] pcmpgtd xmm5, xmm12 - movdqu xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+1728] + movdqu xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+1728] pandn xmm3, xmm4 pxor xmm2, xmm6 pandn xmm4, xmm5 @@ -915,23 +915,23 @@ L88:: cvtps2pd xmm13, xmm1 mulpd xmm10, xmm14 mulpd xmm15, xmm13 - movups xmm2, XMMWORD PTR [__svml_satan_ha_data_internal+64] + movups xmm2, XMMWORD PTR [__jsvml_satan_ha_data_internal+64] andps xmm2, xmm6 orps xmm0, xmm2 cvtps2pd xmm2, xmm0 movhlps xmm0, xmm0 cvtps2pd xmm7, xmm0 - movups xmm0, XMMWORD PTR [__svml_satan_ha_data_internal+960] - movups xmm9, XMMWORD PTR [__svml_satan_ha_data_internal+1088] + movups xmm0, XMMWORD PTR [__jsvml_satan_ha_data_internal+960] + movups xmm9, XMMWORD PTR [__jsvml_satan_ha_data_internal+1088] andps xmm0, xmm3 - movups xmm12, XMMWORD PTR [__svml_satan_ha_data_internal+1216] + movups xmm12, XMMWORD PTR [__jsvml_satan_ha_data_internal+1216] andps xmm9, xmm4 - movups xmm11, XMMWORD PTR [__svml_satan_ha_data_internal+1344] + movups xmm11, XMMWORD PTR [__jsvml_satan_ha_data_internal+1344] andps xmm12, xmm5 andps xmm11, xmm6 orps xmm0, xmm9 orps xmm12, xmm11 - movups xmm11, XMMWORD PTR [__svml_satan_ha_data_internal+1856] + movups xmm11, XMMWORD PTR [__jsvml_satan_ha_data_internal+1856] orps xmm0, xmm12 movaps xmm12, xmm11 movaps xmm1, xmm11 @@ -951,7 +951,7 @@ L88:: mulpd xmm13, xmm11 mulpd xmm2, xmm14 mulpd xmm7, xmm13 - movups xmm13, XMMWORD PTR [__svml_satan_ha_data_internal+1792] + movups xmm13, XMMWORD PTR [__jsvml_satan_ha_data_internal+1792] movaps xmm12, xmm13 andps xmm13, xmm7 andps xmm12, xmm2 @@ -962,28 +962,28 @@ L88:: cvtpd2ps xmm9, xmm2 cvtpd2ps xmm2, xmm7 movlhps xmm10, xmm11 - movups xmm14, XMMWORD PTR [__svml_satan_ha_data_internal+1408] + movups xmm14, XMMWORD PTR [__jsvml_satan_ha_data_internal+1408] andps xmm14, xmm6 movaps xmm6, xmm10 mulps xmm6, xmm10 - movups xmm1, XMMWORD PTR [__svml_satan_ha_data_internal+1024] + movups xmm1, XMMWORD PTR [__jsvml_satan_ha_data_internal+1024] andps xmm1, xmm3 movaps xmm3, xmm6 mulps xmm3, xmm6 - movups xmm7, XMMWORD PTR [__svml_satan_ha_data_internal+1152] + movups xmm7, XMMWORD PTR [__jsvml_satan_ha_data_internal+1152] andps xmm7, xmm4 - movups xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+1472] + movups xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+1472] orps xmm1, xmm7 mulps xmm4, xmm3 - movups xmm15, XMMWORD PTR [__svml_satan_ha_data_internal+1280] + movups xmm15, XMMWORD PTR [__jsvml_satan_ha_data_internal+1280] andps xmm15, xmm5 - addps xmm4, XMMWORD PTR [__svml_satan_ha_data_internal+1600] - movups xmm5, XMMWORD PTR [__svml_satan_ha_data_internal+1536] + addps xmm4, XMMWORD PTR [__jsvml_satan_ha_data_internal+1600] + movups xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal+1536] orps xmm15, xmm14 mulps xmm5, xmm3 orps xmm1, xmm15 mulps xmm4, xmm6 - addps xmm5, XMMWORD PTR [__svml_satan_ha_data_internal+1664] + addps xmm5, XMMWORD PTR [__jsvml_satan_ha_data_internal+1664] movlhps xmm9, xmm2 addps xmm5, xmm4 addps xmm9, xmm1 @@ -1053,19 +1053,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_satan_ha_cout_rare_internal + call __jsvml_satan_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_atanf4_ha_ex ENDP +__jsvml_atanf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf4_ha_ex_B1_B3: +_unwind___jsvml_atanf4_ha_ex_B1_B3: DD 1600257 DD 2937963 DD 878691 @@ -1087,19 +1087,19 @@ _unwind___svml_atanf4_ha_ex_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_atanf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_atanf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf4_ha_ex_B6_B10: +_unwind___jsvml_atanf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_atanf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_atanf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1108,7 +1108,7 @@ _unwind___svml_atanf4_ha_ex_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_atanf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_atanf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1122,9 +1122,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atanf8_ha_l9 + PUBLIC __jsvml_atanf8_ha_l9 -__svml_atanf8_ha_l9 PROC EXPORT +__jsvml_atanf8_ha_l9 PROC EXPORT _B5_1:: @@ -1147,31 +1147,31 @@ L117:: vmovups YMMWORD PTR [400+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups ymm8, YMMWORD PTR [__svml_satan_ha_data_internal+320] + vmovups ymm8, YMMWORD PTR [__jsvml_satan_ha_data_internal+320] and r13, -64 - vmovups ymm2, YMMWORD PTR [__svml_satan_ha_data_internal+1984] - vmovups ymm11, YMMWORD PTR [__svml_satan_ha_data_internal+256] - vmovups ymm6, YMMWORD PTR [__svml_satan_ha_data_internal+384] + vmovups ymm2, YMMWORD PTR [__jsvml_satan_ha_data_internal+1984] + vmovups ymm11, YMMWORD PTR [__jsvml_satan_ha_data_internal+256] + vmovups ymm6, YMMWORD PTR [__jsvml_satan_ha_data_internal+384] vmovups YMMWORD PTR [32+r13], ymm0 - vandps ymm1, ymm0, YMMWORD PTR [__svml_satan_ha_data_internal+192] - vpsubd ymm5, ymm1, YMMWORD PTR [__svml_satan_ha_data_internal+1920] + vandps ymm1, ymm0, YMMWORD PTR [__jsvml_satan_ha_data_internal+192] + vpsubd ymm5, ymm1, YMMWORD PTR [__jsvml_satan_ha_data_internal+1920] vpcmpgtd ymm7, ymm8, ymm1 - vpcmpgtd ymm8, ymm1, YMMWORD PTR [__svml_satan_ha_data_internal+448] + vpcmpgtd ymm8, ymm1, YMMWORD PTR [__jsvml_satan_ha_data_internal+448] vpcmpgtd ymm3, ymm5, ymm2 vpcmpeqd ymm4, ymm5, ymm2 - vpxor ymm14, ymm8, YMMWORD PTR [__svml_satan_ha_data_internal+1728] + vpxor ymm14, ymm8, YMMWORD PTR [__jsvml_satan_ha_data_internal+1728] vpor ymm12, ymm3, ymm4 - vmovups ymm3, YMMWORD PTR [__svml_satan_ha_data_internal+768] - vmovups ymm2, YMMWORD PTR [__svml_satan_ha_data_internal+896] + vmovups ymm3, YMMWORD PTR [__jsvml_satan_ha_data_internal+768] + vmovups ymm2, YMMWORD PTR [__jsvml_satan_ha_data_internal+896] vsubps ymm15, ymm1, ymm3 vpcmpgtd ymm4, ymm11, ymm1 vpcmpgtd ymm5, ymm6, ymm1 - vandps ymm10, ymm0, YMMWORD PTR [__svml_satan_ha_data_internal+128] - vmovups ymm0, YMMWORD PTR [__svml_satan_ha_data_internal+832] + vandps ymm10, ymm0, YMMWORD PTR [__jsvml_satan_ha_data_internal+128] + vmovups ymm0, YMMWORD PTR [__jsvml_satan_ha_data_internal+832] vpandn ymm9, ymm4, ymm7 vpandn ymm7, ymm7, ymm5 vpandn ymm6, ymm5, ymm14 - vmovups ymm5, YMMWORD PTR [__svml_satan_ha_data_internal] + vmovups ymm5, YMMWORD PTR [__jsvml_satan_ha_data_internal] vmovmskps edx, ymm12 vandps ymm14, ymm15, ymm9 test edx, edx @@ -1185,7 +1185,7 @@ L117:: vandps ymm15, ymm15, ymm6 vorps ymm13, ymm13, ymm14 vorps ymm11, ymm11, ymm15 - vandps ymm12, ymm8, YMMWORD PTR [__svml_satan_ha_data_internal+64] + vandps ymm12, ymm8, YMMWORD PTR [__jsvml_satan_ha_data_internal+64] vorps ymm14, ymm13, ymm11 vandps ymm4, ymm5, ymm4 vandps ymm3, ymm3, ymm9 @@ -1197,31 +1197,31 @@ L117:: vorps ymm12, ymm0, ymm2 vorps ymm11, ymm1, ymm12 vorps ymm13, ymm11, ymm13 - vandps ymm0, ymm9, YMMWORD PTR [__svml_satan_ha_data_internal+960] - vandps ymm1, ymm7, YMMWORD PTR [__svml_satan_ha_data_internal+1088] + vandps ymm0, ymm9, YMMWORD PTR [__jsvml_satan_ha_data_internal+960] + vandps ymm1, ymm7, YMMWORD PTR [__jsvml_satan_ha_data_internal+1088] vorps ymm4, ymm0, ymm1 vrcpps ymm0, ymm13 - vmovups ymm1, YMMWORD PTR [__svml_satan_ha_data_internal+1536] + vmovups ymm1, YMMWORD PTR [__jsvml_satan_ha_data_internal+1536] vfnmadd231ps ymm5, ymm13, ymm0 vfmadd213ps ymm5, ymm5, ymm5 vfmadd213ps ymm0, ymm5, ymm0 vmulps ymm11, ymm14, ymm0 - vandps ymm2, ymm6, YMMWORD PTR [__svml_satan_ha_data_internal+1216] - vandps ymm3, ymm8, YMMWORD PTR [__svml_satan_ha_data_internal+1344] + vandps ymm2, ymm6, YMMWORD PTR [__jsvml_satan_ha_data_internal+1216] + vandps ymm3, ymm8, YMMWORD PTR [__jsvml_satan_ha_data_internal+1344] vorps ymm15, ymm2, ymm3 vmulps ymm3, ymm11, ymm11 vfnmadd213ps ymm13, ymm11, ymm14 vmulps ymm2, ymm3, ymm3 vmulps ymm0, ymm0, ymm13 vorps ymm12, ymm4, ymm15 - vmovups ymm4, YMMWORD PTR [__svml_satan_ha_data_internal+1472] - vfmadd213ps ymm4, ymm2, YMMWORD PTR [__svml_satan_ha_data_internal+1600] - vfmadd213ps ymm2, ymm1, YMMWORD PTR [__svml_satan_ha_data_internal+1664] + vmovups ymm4, YMMWORD PTR [__jsvml_satan_ha_data_internal+1472] + vfmadd213ps ymm4, ymm2, YMMWORD PTR [__jsvml_satan_ha_data_internal+1600] + vfmadd213ps ymm2, ymm1, YMMWORD PTR [__jsvml_satan_ha_data_internal+1664] vfmadd213ps ymm4, ymm3, ymm2 - vandps ymm9, ymm9, YMMWORD PTR [__svml_satan_ha_data_internal+1024] - vandps ymm7, ymm7, YMMWORD PTR [__svml_satan_ha_data_internal+1152] - vandps ymm6, ymm6, YMMWORD PTR [__svml_satan_ha_data_internal+1280] - vandps ymm8, ymm8, YMMWORD PTR [__svml_satan_ha_data_internal+1408] + vandps ymm9, ymm9, YMMWORD PTR [__jsvml_satan_ha_data_internal+1024] + vandps ymm7, ymm7, YMMWORD PTR [__jsvml_satan_ha_data_internal+1152] + vandps ymm6, ymm6, YMMWORD PTR [__jsvml_satan_ha_data_internal+1280] + vandps ymm8, ymm8, YMMWORD PTR [__jsvml_satan_ha_data_internal+1408] vorps ymm5, ymm9, ymm7 vorps ymm14, ymm6, ymm8 vmulps ymm7, ymm3, ymm4 @@ -1288,19 +1288,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_satan_ha_cout_rare_internal + call __jsvml_satan_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_atanf8_ha_l9 ENDP +__jsvml_atanf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf8_ha_l9_B1_B3: +_unwind___jsvml_atanf8_ha_l9_B1_B3: DD 1600769 DD 4379757 DD 1665125 @@ -1322,19 +1322,19 @@ _unwind___svml_atanf8_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_atanf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atanf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_atanf8_ha_l9_B6_B10: +_unwind___jsvml_atanf8_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_atanf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_atanf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1343,7 +1343,7 @@ _unwind___svml_atanf8_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_atanf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_atanf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1357,9 +1357,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_atanf16_ha_z0 + PUBLIC __jsvml_atanf16_ha_z0 -__svml_atanf16_ha_z0 PROC EXPORT +__jsvml_atanf16_ha_z0 PROC EXPORT _B6_1:: @@ -1369,32 +1369,32 @@ _B6_1:: DB 250 L146:: - vmovups zmm5, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+128] - vmovups zmm22, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+320] - vmovups zmm23, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+64] - vmovups zmm26, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+256] - vmovups zmm29, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+192] - vmovups zmm31, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+448] - vandps zmm4, zmm0, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512] + vmovups zmm5, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+128] + vmovups zmm22, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+320] + vmovups zmm23, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+64] + vmovups zmm26, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+256] + vmovups zmm29, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+192] + vmovups zmm31, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+448] + vandps zmm4, zmm0, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512] vcmpps k1, zmm4, zmm5, 17 {sae} vminps zmm2, zmm22, zmm4 {sae} - vmovups zmm5, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+576] + vmovups zmm5, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+576] vaddps zmm3, zmm4, zmm23 {rn-sae} vreduceps zmm29{k1}, zmm4, 40 {sae} vsubps zmm24, zmm3, zmm23 {rn-sae} - vpermt2ps zmm31, zmm3, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+512] - vpermt2ps zmm5, zmm3, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+640] + vpermt2ps zmm31, zmm3, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+512] + vpermt2ps zmm5, zmm3, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+640] vfmadd213ps zmm2{k1}, zmm24, zmm26 {rn-sae} - vmovups zmm3, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+832] - vmovups zmm23, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+896] + vmovups zmm3, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+832] + vmovups zmm23, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+896] vsubps zmm27, zmm2, zmm26 {rn-sae} vrcp14ps zmm28, zmm2 vfmsub231ps zmm27, zmm24, zmm4 {rn-sae} knotw k2, k1 vmovaps zmm25, zmm2 vfnmadd213ps zmm25, zmm28, zmm26 {rn-sae} - vblendmps zmm24{k2}, zmm31, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+704] - vblendmps zmm22{k2}, zmm5, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+768] + vblendmps zmm24{k2}, zmm31, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+704] + vblendmps zmm22{k2}, zmm5, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+768] vfmadd213ps zmm28, zmm25, zmm28 {rn-sae} vmulps zmm1, zmm28, zmm29 {rn-sae} vmulps zmm30, zmm27, zmm28 {rn-sae} @@ -1408,7 +1408,7 @@ L146:: vfmadd231ps zmm23, zmm3, zmm29 {rn-sae} vaddps zmm26, zmm2, zmm22 {rn-sae} vsubps zmm25, zmm30, zmm24 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_satan_ha_data_internal_avx512+960] + vmovups zmm2, ZMMWORD PTR [__jsvml_satan_ha_data_internal_avx512+960] vsubps zmm1, zmm1, zmm25 {rn-sae} vfmadd213ps zmm29, zmm23, zmm2 {rn-sae} vaddps zmm28, zmm26, zmm1 {rn-sae} @@ -1420,7 +1420,7 @@ L146:: _B6_2:: -__svml_atanf16_ha_z0 ENDP +__jsvml_atanf16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -1434,9 +1434,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_satan_ha_cout_rare_internal + PUBLIC __jsvml_satan_ha_cout_rare_internal -__svml_satan_ha_cout_rare_internal PROC +__jsvml_satan_ha_cout_rare_internal PROC _B7_1:: @@ -1801,13 +1801,13 @@ _B7_14:: _B7_15:: -__svml_satan_ha_cout_rare_internal ENDP +__jsvml_satan_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_satan_ha_cout_rare_internal_B1_B14: +_unwind___jsvml_satan_ha_cout_rare_internal_B1_B14: DD 67585 DD 41480 @@ -1818,7 +1818,7 @@ _unwind___svml_satan_ha_cout_rare_internal_B1_B14: DD imagerel _B7_1 DD imagerel _B7_15 - DD imagerel _unwind___svml_satan_ha_cout_rare_internal_B1_B14 + DD imagerel _unwind___jsvml_satan_ha_cout_rare_internal_B1_B14 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1826,8 +1826,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_satan_ha_data_internal_avx512 -__svml_satan_ha_data_internal_avx512 DD 2147483647 + PUBLIC __jsvml_satan_ha_data_internal_avx512 +__jsvml_satan_ha_data_internal_avx512 DD 2147483647 DD 2147483647 DD 2147483647 DD 2147483647 @@ -2083,8 +2083,8 @@ __svml_satan_ha_data_internal_avx512 DD 2147483647 DD 3198855850 DD 3198855850 DD 3198855850 - PUBLIC __svml_satan_ha_data_internal -__svml_satan_ha_data_internal DD 1065353216 + PUBLIC __jsvml_satan_ha_data_internal +__jsvml_satan_ha_data_internal DD 1065353216 DD 1065353216 DD 1065353216 DD 1065353216 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_cbrt_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cbrt_windows_x86.S similarity index 76% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_cbrt_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cbrt_windows_x86.S index e5f9cabb6bf..0b2c87f0943 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_cbrt_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cbrt_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrtf4_ha_l9 + PUBLIC __jsvml_cbrtf4_ha_l9 -__svml_cbrtf4_ha_l9 PROC EXPORT +__jsvml_cbrtf4_ha_l9 PROC EXPORT _B1_1:: @@ -57,7 +57,7 @@ L1:: vpsrld xmm8, xmm4, 16 mov QWORD PTR [224+rsp], r13 lea r13, QWORD PTR [111+rsp] - vpand xmm0, xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+1408] + vpand xmm0, xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1408] and r13, -64 vmovd eax, xmm0 vpextrd r8d, xmm0, 2 @@ -67,28 +67,28 @@ L1:: vpextrd r9d, xmm0, 3 movsxd rcx, ecx movsxd r9, r9d - vmovd xmm1, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] - vmovd xmm2, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r8] - vpinsrd xmm5, xmm1, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx], 1 - vpinsrd xmm1, xmm2, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r9], 1 - vandps xmm2, xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1792] - vpsubd xmm9, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1856] - vandps xmm2, xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1152] - vorps xmm2, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1280] + vmovd xmm1, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r8] + vpinsrd xmm5, xmm1, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx], 1 + vpinsrd xmm1, xmm2, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r9], 1 + vandps xmm2, xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1792] + vpsubd xmm9, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1856] + vandps xmm2, xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1152] + vorps xmm2, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1280] vpunpcklqdq xmm3, xmm5, xmm1 vpsrld xmm5, xmm8, 7 - vpcmpgtd xmm1, xmm9, XMMWORD PTR [__svml_scbrt_ha_data_internal+1920] - vandps xmm9, xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1216] - vorps xmm9, xmm9, XMMWORD PTR [__svml_scbrt_ha_data_internal+1344] - vpand xmm8, xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1472] + vpcmpgtd xmm1, xmm9, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1920] + vandps xmm9, xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1216] + vorps xmm9, xmm9, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1344] + vpand xmm8, xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1472] vsubps xmm2, xmm2, xmm9 vmovmskps eax, xmm1 - vpsubd xmm9, xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+1664] + vpsubd xmm9, xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1664] vmulps xmm2, xmm3, xmm2 - vpmulld xmm3, xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+1728] + vpmulld xmm3, xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1728] vpsrld xmm3, xmm3, 12 - vpand xmm5, xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1536] - vpaddd xmm8, xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1600] + vpand xmm5, xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1536] + vpaddd xmm8, xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1600] vpor xmm5, xmm8, xmm5 vpslld xmm8, xmm5, 23 vpsubd xmm5, xmm9, xmm3 @@ -106,20 +106,20 @@ L1:: movsxd r11, r11d movsxd rcx, ecx movsxd r8, r8d - vmovq xmm9, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r10] - vmovq xmm1, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r11] - vmovq xmm0, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] - vmovq xmm3, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r10] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r11] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] vunpcklps xmm5, xmm9, xmm1 vunpcklps xmm0, xmm0, xmm3 vmovlhps xmm1, xmm5, xmm0 vshufps xmm0, xmm5, xmm0, 238 vmulps xmm1, xmm8, xmm1 vmulps xmm0, xmm8, xmm0 - vmovups xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+896] - vfmadd213ps xmm8, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+960] - vfmadd213ps xmm8, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1024] - vfmadd213ps xmm8, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1088] + vmovups xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+896] + vfmadd213ps xmm8, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+960] + vfmadd213ps xmm8, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1024] + vfmadd213ps xmm8, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1088] vmulps xmm2, xmm2, xmm1 vmulps xmm2, xmm8, xmm2 mov QWORD PTR [232+rsp], r13 @@ -172,19 +172,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scbrt_ha_cout_rare_internal + call __jsvml_scbrt_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_cbrtf4_ha_l9 ENDP +__jsvml_cbrtf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf4_ha_l9_B1_B3: +_unwind___jsvml_cbrtf4_ha_l9_B1_B3: DD 537857 DD 1889333 DD 886824 @@ -198,19 +198,19 @@ _unwind___svml_cbrtf4_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_cbrtf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf4_ha_l9_B6_B10: +_unwind___jsvml_cbrtf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_cbrtf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -219,7 +219,7 @@ _unwind___svml_cbrtf4_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_cbrtf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cbrtf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -233,9 +233,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrtf4_ha_ex + PUBLIC __jsvml_cbrtf4_ha_ex -__svml_cbrtf4_ha_ex PROC EXPORT +__jsvml_cbrtf4_ha_ex PROC EXPORT _B2_1:: @@ -255,39 +255,39 @@ L12:: lea rdx, QWORD PTR [__ImageBase] mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - movdqu xmm1, XMMWORD PTR [__svml_scbrt_ha_data_internal+1408] + movdqu xmm1, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1408] and r13, -64 pand xmm1, xmm2 psrld xmm2, 7 pshufd xmm10, xmm1, 1 movd eax, xmm1 pshufd xmm0, xmm1, 2 - movups xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1152] + movups xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1152] movd ecx, xmm10 andps xmm3, xmm5 pshufd xmm10, xmm1, 3 - movups xmm15, XMMWORD PTR [__svml_scbrt_ha_data_internal+1216] + movups xmm15, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1216] movd r8d, xmm0 andps xmm15, xmm5 movd r9d, xmm10 - orps xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1280] - orps xmm15, XMMWORD PTR [__svml_scbrt_ha_data_internal+1344] + orps xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1280] + orps xmm15, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1344] movsxd rax, eax subps xmm3, xmm15 movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - movd xmm4, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] - movd xmm9, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx] + movd xmm4, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] + movd xmm9, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx] punpckldq xmm4, xmm9 - movd xmm0, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r8] - movd xmm9, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r9] + movd xmm0, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r8] + movd xmm9, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r9] punpckldq xmm0, xmm9 punpcklqdq xmm4, xmm0 - movdqu xmm0, XMMWORD PTR [__svml_scbrt_ha_data_internal+1472] + movdqu xmm0, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1472] mulps xmm4, xmm3 pand xmm0, xmm2 - movdqu xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1728] + movdqu xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1728] movdqa xmm15, xmm0 movdqa xmm10, xmm3 psrlq xmm3, 32 @@ -297,22 +297,22 @@ L12:: pand xmm10, XMMWORD PTR [_2il0floatpacket_46] psllq xmm0, 32 por xmm10, xmm0 - psubd xmm15, XMMWORD PTR [__svml_scbrt_ha_data_internal+1664] + psubd xmm15, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1664] psrld xmm10, 12 psubd xmm15, xmm10 - movdqu xmm9, XMMWORD PTR [__svml_scbrt_ha_data_internal+1792] + movdqu xmm9, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1792] psubd xmm15, xmm10 pand xmm9, xmm5 psubd xmm15, xmm10 - psubd xmm9, XMMWORD PTR [__svml_scbrt_ha_data_internal+1856] + psubd xmm9, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1856] pslld xmm15, 7 - pcmpgtd xmm9, XMMWORD PTR [__svml_scbrt_ha_data_internal+1920] + pcmpgtd xmm9, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1920] paddd xmm1, xmm15 movmskps eax, xmm9 pandn xmm9, xmm1 - movdqu xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1600] + movdqu xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1600] pslld xmm9, 1 - pand xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1536] + pand xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1536] paddd xmm3, xmm10 por xmm3, xmm2 pshufd xmm2, xmm9, 1 @@ -327,10 +327,10 @@ L12:: movsxd r11, r11d movsxd rcx, ecx movsxd r8, r8d - movq xmm1, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r10] - movq xmm15, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r11] - movq xmm10, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] - movq xmm2, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] + movq xmm1, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r10] + movq xmm15, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r11] + movq xmm10, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] + movq xmm2, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] unpcklps xmm1, xmm15 unpcklps xmm10, xmm2 movaps xmm0, xmm1 @@ -338,15 +338,15 @@ L12:: shufps xmm1, xmm10, 238 mulps xmm0, xmm3 mulps xmm3, xmm1 - movups xmm1, XMMWORD PTR [__svml_scbrt_ha_data_internal+896] + movups xmm1, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+896] mulps xmm1, xmm4 mov QWORD PTR [248+rsp], r13 - addps xmm1, XMMWORD PTR [__svml_scbrt_ha_data_internal+960] + addps xmm1, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+960] mulps xmm1, xmm4 - addps xmm1, XMMWORD PTR [__svml_scbrt_ha_data_internal+1024] + addps xmm1, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1024] mulps xmm1, xmm4 mulps xmm4, xmm0 - addps xmm1, XMMWORD PTR [__svml_scbrt_ha_data_internal+1088] + addps xmm1, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1088] mulps xmm1, xmm4 addps xmm3, xmm1 addps xmm0, xmm3 @@ -401,19 +401,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scbrt_ha_cout_rare_internal + call __jsvml_scbrt_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_cbrtf4_ha_ex ENDP +__jsvml_cbrtf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf4_ha_ex_B1_B3: +_unwind___jsvml_cbrtf4_ha_ex_B1_B3: DD 671745 DD 2020416 DD 956465 @@ -428,19 +428,19 @@ _unwind___svml_cbrtf4_ha_ex_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cbrtf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cbrtf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf4_ha_ex_B6_B10: +_unwind___jsvml_cbrtf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cbrtf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cbrtf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -449,7 +449,7 @@ _unwind___svml_cbrtf4_ha_ex_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_cbrtf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_cbrtf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -463,9 +463,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrtf4_ha_e9 + PUBLIC __jsvml_cbrtf4_ha_e9 -__svml_cbrtf4_ha_e9 PROC EXPORT +__jsvml_cbrtf4_ha_e9 PROC EXPORT _B3_1:: @@ -483,7 +483,7 @@ L25:: vpsrld xmm7, xmm4, 16 mov QWORD PTR [224+rsp], r13 lea r13, QWORD PTR [111+rsp] - vpand xmm0, xmm7, XMMWORD PTR [__svml_scbrt_ha_data_internal+1408] + vpand xmm0, xmm7, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1408] and r13, -64 vmovd eax, xmm0 vpextrd r8d, xmm0, 2 @@ -493,29 +493,29 @@ L25:: vpextrd r9d, xmm0, 3 movsxd rcx, ecx movsxd r9, r9d - vmovd xmm1, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] - vmovd xmm2, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r8] - vpinsrd xmm5, xmm1, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx], 1 - vpinsrd xmm1, xmm2, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r9], 1 - vandps xmm2, xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1792] - vpsubd xmm8, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1856] - vandps xmm2, xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1152] - vorps xmm2, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1280] + vmovd xmm1, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r8] + vpinsrd xmm5, xmm1, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx], 1 + vpinsrd xmm1, xmm2, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r9], 1 + vandps xmm2, xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1792] + vpsubd xmm8, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1856] + vandps xmm2, xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1152] + vorps xmm2, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1280] vpunpcklqdq xmm3, xmm5, xmm1 vpsrld xmm5, xmm7, 7 - vpcmpgtd xmm1, xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+1920] - vandps xmm8, xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1216] - vorps xmm8, xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+1344] - vpand xmm7, xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1472] + vpcmpgtd xmm1, xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1920] + vandps xmm8, xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1216] + vorps xmm8, xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1344] + vpand xmm7, xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1472] vsubps xmm2, xmm2, xmm8 vmovmskps eax, xmm1 - vpsubd xmm8, xmm7, XMMWORD PTR [__svml_scbrt_ha_data_internal+1664] + vpsubd xmm8, xmm7, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1664] vmulps xmm2, xmm3, xmm2 - vpmulld xmm3, xmm7, XMMWORD PTR [__svml_scbrt_ha_data_internal+1728] + vpmulld xmm3, xmm7, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1728] vpsrld xmm3, xmm3, 12 - vpand xmm5, xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1536] + vpand xmm5, xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1536] vpsubd xmm8, xmm8, xmm3 - vpaddd xmm7, xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1600] + vpaddd xmm7, xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1600] vpor xmm5, xmm7, xmm5 vpslld xmm7, xmm5, 23 vpsubd xmm5, xmm8, xmm3 @@ -532,24 +532,24 @@ L25:: movsxd r11, r11d movsxd rcx, ecx movsxd r8, r8d - vmovq xmm3, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r10] - vmovq xmm5, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r11] - vmovq xmm8, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] - vmovq xmm0, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r11] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] vunpcklps xmm1, xmm3, xmm5 vunpcklps xmm8, xmm8, xmm0 vmovlhps xmm0, xmm1, xmm8 vshufps xmm3, xmm1, xmm8, 238 vmulps xmm0, xmm7, xmm0 vmulps xmm1, xmm7, xmm3 - vmulps xmm7, xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+896] + vmulps xmm7, xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+896] mov QWORD PTR [232+rsp], r13 - vaddps xmm3, xmm7, XMMWORD PTR [__svml_scbrt_ha_data_internal+960] + vaddps xmm3, xmm7, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+960] vmulps xmm5, xmm2, xmm3 - vaddps xmm7, xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1024] + vaddps xmm7, xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1024] vmulps xmm8, xmm2, xmm7 vmulps xmm2, xmm2, xmm0 - vaddps xmm3, xmm8, XMMWORD PTR [__svml_scbrt_ha_data_internal+1088] + vaddps xmm3, xmm8, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1088] vmulps xmm2, xmm3, xmm2 vaddps xmm1, xmm1, xmm2 vaddps xmm0, xmm0, xmm1 @@ -600,19 +600,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scbrt_ha_cout_rare_internal + call __jsvml_scbrt_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_cbrtf4_ha_e9 ENDP +__jsvml_cbrtf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf4_ha_e9_B1_B3: +_unwind___jsvml_cbrtf4_ha_e9_B1_B3: DD 537857 DD 1889333 DD 882728 @@ -626,19 +626,19 @@ _unwind___svml_cbrtf4_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_cbrtf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf4_ha_e9_B6_B10: +_unwind___jsvml_cbrtf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_cbrtf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -647,7 +647,7 @@ _unwind___svml_cbrtf4_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_cbrtf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cbrtf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -661,9 +661,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrtf16_ha_z0 + PUBLIC __jsvml_cbrtf16_ha_z0 -__svml_cbrtf16_ha_z0 PROC EXPORT +__jsvml_cbrtf16_ha_z0 PROC EXPORT _B4_1:: @@ -674,30 +674,30 @@ _B4_1:: L36:: vgetexpps zmm4, zmm0 {sae} - vmovups zmm5, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+384] + vmovups zmm5, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+384] vgetmantps zmm27, zmm0, 0 {sae} - vmovups zmm22, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+512] - vmovups zmm23, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+576] - vmovups zmm24, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+640] - vmovups zmm31, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+256] - vmovups zmm30, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+768] + vmovups zmm22, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+512] + vmovups zmm23, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+576] + vmovups zmm24, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+640] + vmovups zmm31, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+256] + vmovups zmm30, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+768] vrcp14ps zmm26, zmm27 vaddps zmm25, zmm4, zmm5 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+704] + vmovups zmm4, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+704] vrndscaleps zmm28, zmm26, 88 {sae} vfmsub231ps zmm23, zmm22, zmm25 {rn-sae} - vmovups zmm5, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+832] + vmovups zmm5, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+832] vfmsub231ps zmm4, zmm27, zmm28 {rn-sae} vrndscaleps zmm3, zmm23, 9 {sae} - vmovups zmm27, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+128] + vmovups zmm27, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+128] vpsrld zmm29, zmm28, 19 vfmadd231ps zmm5, zmm30, zmm4 {rn-sae} vfnmadd231ps zmm25, zmm24, zmm3 {rn-sae} - vmovups zmm30, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+896] - vpermt2ps zmm27, zmm29, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+192] - vpermps zmm1, zmm25, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512] - vpermt2ps zmm31, zmm29, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+320] - vpermps zmm2, zmm25, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+64] + vmovups zmm30, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+896] + vpermt2ps zmm27, zmm29, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+192] + vpermps zmm1, zmm25, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512] + vpermt2ps zmm31, zmm29, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+320] + vpermps zmm2, zmm25, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+64] vmulps zmm22, zmm1, zmm27 {rn-sae} vfmadd213ps zmm5, zmm4, zmm30 {rn-sae} vmovaps zmm29, zmm1 @@ -708,13 +708,13 @@ L36:: vfmadd213ps zmm1, zmm5, zmm2 {rn-sae} vaddps zmm2, zmm1, zmm22 {rn-sae} vscalefps zmm3, zmm2, zmm3 {rn-sae} - vpternlogd zmm0, zmm3, ZMMWORD PTR [__svml_scbrt_ha_data_internal_avx512+448], 236 + vpternlogd zmm0, zmm3, ZMMWORD PTR [__jsvml_scbrt_ha_data_internal_avx512+448], 236 ret ALIGN 16 _B4_2:: -__svml_cbrtf16_ha_z0 ENDP +__jsvml_cbrtf16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -728,9 +728,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrtf8_ha_l9 + PUBLIC __jsvml_cbrtf8_ha_l9 -__svml_cbrtf8_ha_l9 PROC EXPORT +__jsvml_cbrtf8_ha_l9 PROC EXPORT _B5_1:: @@ -752,9 +752,9 @@ L37:: vpsrld ymm0, ymm1, 7 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vpand ymm5, ymm1, YMMWORD PTR [__svml_scbrt_ha_data_internal+1408] + vpand ymm5, ymm1, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1408] and r13, -64 - vandps ymm1, ymm4, YMMWORD PTR [__svml_scbrt_ha_data_internal+1792] + vandps ymm1, ymm4, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1792] mov QWORD PTR [536+rsp], r13 vmovd eax, xmm5 movsxd rax, eax @@ -763,11 +763,11 @@ L37:: vpextrd r8d, xmm5, 2 movsxd r8, r8d vpextrd r9d, xmm5, 3 - vmovd xmm2, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] movsxd r9, r9d - vpinsrd xmm14, xmm2, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx], 1 - vmovd xmm3, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r8] - vpinsrd xmm15, xmm3, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r9], 1 + vpinsrd xmm14, xmm2, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx], 1 + vmovd xmm3, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r8] + vpinsrd xmm15, xmm3, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r9], 1 vextracti128 xmm2, ymm5, 1 vpunpcklqdq xmm13, xmm14, xmm15 vmovd r10d, xmm2 @@ -778,26 +778,26 @@ L37:: vpextrd ecx, xmm2, 3 movsxd r11, r11d movsxd rcx, ecx - vmovd xmm12, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r10] - vmovd xmm3, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] - vpinsrd xmm14, xmm12, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r11], 1 - vpinsrd xmm15, xmm3, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx], 1 - vpand ymm3, ymm0, YMMWORD PTR [__svml_scbrt_ha_data_internal+1472] - vpand ymm0, ymm0, YMMWORD PTR [__svml_scbrt_ha_data_internal+1536] + vmovd xmm12, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r10] + vmovd xmm3, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] + vpinsrd xmm14, xmm12, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r11], 1 + vpinsrd xmm15, xmm3, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx], 1 + vpand ymm3, ymm0, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1472] + vpand ymm0, ymm0, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1536] vpunpcklqdq xmm11, xmm14, xmm15 - vpsubd ymm14, ymm1, YMMWORD PTR [__svml_scbrt_ha_data_internal+1856] - vandps ymm15, ymm4, YMMWORD PTR [__svml_scbrt_ha_data_internal+1152] - vorps ymm1, ymm15, YMMWORD PTR [__svml_scbrt_ha_data_internal+1280] - vpmulld ymm15, ymm3, YMMWORD PTR [__svml_scbrt_ha_data_internal+1728] + vpsubd ymm14, ymm1, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1856] + vandps ymm15, ymm4, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1152] + vorps ymm1, ymm15, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1280] + vpmulld ymm15, ymm3, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1728] vinsertf128 ymm2, ymm13, xmm11, 1 - vandps ymm11, ymm4, YMMWORD PTR [__svml_scbrt_ha_data_internal+1216] - vorps ymm12, ymm11, YMMWORD PTR [__svml_scbrt_ha_data_internal+1344] - vpcmpgtd ymm13, ymm14, YMMWORD PTR [__svml_scbrt_ha_data_internal+1920] + vandps ymm11, ymm4, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1216] + vorps ymm12, ymm11, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1344] + vpcmpgtd ymm13, ymm14, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1920] vsubps ymm14, ymm1, ymm12 vpsrld ymm11, ymm15, 12 vmulps ymm2, ymm2, ymm14 - vpsubd ymm14, ymm3, YMMWORD PTR [__svml_scbrt_ha_data_internal+1664] - vpaddd ymm3, ymm11, YMMWORD PTR [__svml_scbrt_ha_data_internal+1600] + vpsubd ymm14, ymm3, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1664] + vpaddd ymm3, ymm11, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1600] vpsubd ymm15, ymm14, ymm11 vpor ymm3, ymm3, ymm0 vpsubd ymm0, ymm15, ymm11 @@ -815,10 +815,10 @@ L37:: vpextrd ecx, xmm11, 3 movsxd r9, r9d movsxd rcx, ecx - vmovq xmm14, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] vmovd r8d, xmm13 - vmovq xmm0, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r9] - vmovq xmm1, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] vpextrd r10d, xmm11, 2 vpextrd r9d, xmm13, 1 vpextrd r11d, xmm13, 2 @@ -828,11 +828,11 @@ L37:: movsxd r9, r9d movsxd r11, r11d movsxd rcx, ecx - vmovq xmm15, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r10] - vmovq xmm5, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r9] - vmovq xmm12, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r11] - vmovq xmm13, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r11] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] vunpcklps xmm15, xmm14, xmm15 vunpcklps xmm14, xmm0, xmm1 vunpcklps xmm0, xmm5, xmm12 @@ -843,10 +843,10 @@ L37:: vunpckhps ymm1, ymm5, ymm12 vmulps ymm5, ymm3, ymm0 vmulps ymm1, ymm3, ymm1 - vmovups ymm3, YMMWORD PTR [__svml_scbrt_ha_data_internal+896] - vfmadd213ps ymm3, ymm2, YMMWORD PTR [__svml_scbrt_ha_data_internal+960] - vfmadd213ps ymm3, ymm2, YMMWORD PTR [__svml_scbrt_ha_data_internal+1024] - vfmadd213ps ymm3, ymm2, YMMWORD PTR [__svml_scbrt_ha_data_internal+1088] + vmovups ymm3, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+896] + vfmadd213ps ymm3, ymm2, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+960] + vfmadd213ps ymm3, ymm2, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1024] + vfmadd213ps ymm3, ymm2, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1088] vmulps ymm2, ymm2, ymm5 vmulps ymm2, ymm3, ymm2 vaddps ymm0, ymm1, ymm2 @@ -912,19 +912,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scbrt_ha_cout_rare_internal + call __jsvml_scbrt_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_cbrtf8_ha_l9 ENDP +__jsvml_cbrtf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf8_ha_l9_B1_B3: +_unwind___jsvml_cbrtf8_ha_l9_B1_B3: DD 939265 DD 4379733 DD 2078792 @@ -941,13 +941,13 @@ _unwind___svml_cbrtf8_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_cbrtf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf8_ha_l9_B6_B10: +_unwind___jsvml_cbrtf8_ha_l9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -958,7 +958,7 @@ _unwind___svml_cbrtf8_ha_l9_B6_B10: DD 681995 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_cbrtf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -967,7 +967,7 @@ _unwind___svml_cbrtf8_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_cbrtf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cbrtf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -981,9 +981,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cbrtf8_ha_e9 + PUBLIC __jsvml_cbrtf8_ha_e9 -__svml_cbrtf8_ha_e9 PROC EXPORT +__jsvml_cbrtf8_ha_e9 PROC EXPORT _B6_1:: @@ -1008,15 +1008,15 @@ L64:: vmovaps ymm15, ymm0 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm11, XMMWORD PTR [__svml_scbrt_ha_data_internal+1408] + vmovups xmm11, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1408] and r13, -64 - vmovups xmm4, XMMWORD PTR [__svml_scbrt_ha_data_internal+1792] - vmovups xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1856] - vmovups xmm6, XMMWORD PTR [__svml_scbrt_ha_data_internal+1920] - vmovups xmm0, XMMWORD PTR [__svml_scbrt_ha_data_internal+1472] - vmovups xmm1, XMMWORD PTR [__svml_scbrt_ha_data_internal+1536] - vmovups xmm3, XMMWORD PTR [__svml_scbrt_ha_data_internal+1600] - vmovups xmm2, XMMWORD PTR [__svml_scbrt_ha_data_internal+1664] + vmovups xmm4, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1792] + vmovups xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1856] + vmovups xmm6, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1920] + vmovups xmm0, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1472] + vmovups xmm1, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1536] + vmovups xmm3, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1600] + vmovups xmm2, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1664] mov QWORD PTR [536+rsp], r13 vpsrld xmm8, xmm15, 16 vpand xmm10, xmm8, xmm11 @@ -1033,10 +1033,10 @@ L64:: vpextrd r9d, xmm10, 3 movsxd rcx, ecx movsxd r9, r9d - vmovd xmm14, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] - vmovd xmm13, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r8] - vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx], 1 - vpinsrd xmm12, xmm13, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r9], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r8] + vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx], 1 + vpinsrd xmm12, xmm13, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r9], 1 vmovd r10d, xmm11 vpunpcklqdq xmm12, xmm14, xmm12 movsxd r10, r10d @@ -1046,10 +1046,10 @@ L64:: movsxd rax, eax vpextrd ecx, xmm11, 3 movsxd rcx, ecx - vmovd xmm14, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r10] - vpinsrd xmm13, xmm14, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+r11], 1 - vmovd xmm14, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rax] - vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+rdx+rcx], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r10] + vpinsrd xmm13, xmm14, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+r11], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rax] + vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+rdx+rcx], 1 vpunpcklqdq xmm13, xmm13, xmm14 vpand xmm14, xmm15, xmm4 vandps xmm4, xmm7, xmm4 @@ -1060,17 +1060,17 @@ L64:: vpackssdw xmm4, xmm14, xmm7 vpxor xmm5, xmm5, xmm5 vpacksswb xmm6, xmm4, xmm5 - vandps ymm4, ymm15, YMMWORD PTR [__svml_scbrt_ha_data_internal+1152] - vandps ymm5, ymm15, YMMWORD PTR [__svml_scbrt_ha_data_internal+1216] + vandps ymm4, ymm15, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1152] + vandps ymm5, ymm15, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1216] vpmovmskb eax, xmm6 - vorps ymm6, ymm4, YMMWORD PTR [__svml_scbrt_ha_data_internal+1280] - vorps ymm4, ymm5, YMMWORD PTR [__svml_scbrt_ha_data_internal+1344] + vorps ymm6, ymm4, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1280] + vorps ymm4, ymm5, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1344] vsubps ymm5, ymm6, ymm4 vinsertf128 ymm12, ymm12, xmm13, 1 vpand xmm13, xmm8, xmm0 vmulps ymm4, ymm12, ymm5 vpand xmm0, xmm9, xmm0 - vmovups xmm5, XMMWORD PTR [__svml_scbrt_ha_data_internal+1728] + vmovups xmm5, XMMWORD PTR [__jsvml_scbrt_ha_data_internal+1728] vpand xmm9, xmm9, xmm1 vpmulld xmm12, xmm13, xmm5 vpsrld xmm6, xmm12, 12 @@ -1106,11 +1106,11 @@ L64:: vpextrd ecx, xmm10, 3 movsxd r9, r9d movsxd rcx, ecx - vmovq xmm9, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] vmovd r8d, xmm8 - vmovq xmm12, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r9] vpextrd r10d, xmm10, 2 - vmovq xmm10, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] vpextrd r9d, xmm8, 1 vpextrd r11d, xmm8, 2 vpextrd ecx, xmm8, 3 @@ -1119,11 +1119,11 @@ L64:: movsxd r9, r9d movsxd r11, r11d movsxd rcx, ecx - vmovq xmm11, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r10] - vmovq xmm13, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r8] - vmovq xmm0, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r9] - vmovq xmm14, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+r11] - vmovq xmm1, QWORD PTR [imagerel(__svml_scbrt_ha_data_internal)+128+rdx+rcx] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r10] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+r11] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_scbrt_ha_data_internal)+128+rdx+rcx] vunpcklps xmm2, xmm9, xmm11 vunpcklps xmm5, xmm12, xmm10 vunpcklps xmm13, xmm13, xmm14 @@ -1134,13 +1134,13 @@ L64:: vunpckhps ymm10, ymm7, ymm8 vmulps ymm11, ymm3, ymm9 vmulps ymm5, ymm3, ymm10 - vmulps ymm3, ymm4, YMMWORD PTR [__svml_scbrt_ha_data_internal+896] - vaddps ymm3, ymm3, YMMWORD PTR [__svml_scbrt_ha_data_internal+960] + vmulps ymm3, ymm4, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+896] + vaddps ymm3, ymm3, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+960] vmulps ymm10, ymm4, ymm3 - vaddps ymm0, ymm10, YMMWORD PTR [__svml_scbrt_ha_data_internal+1024] + vaddps ymm0, ymm10, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1024] vmulps ymm1, ymm4, ymm0 vmulps ymm4, ymm4, ymm11 - vaddps ymm2, ymm1, YMMWORD PTR [__svml_scbrt_ha_data_internal+1088] + vaddps ymm2, ymm1, YMMWORD PTR [__jsvml_scbrt_ha_data_internal+1088] vmulps ymm0, ymm2, ymm4 vaddps ymm1, ymm5, ymm0 vaddps ymm0, ymm11, ymm1 @@ -1202,19 +1202,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scbrt_ha_cout_rare_internal + call __jsvml_scbrt_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_cbrtf8_ha_e9 ENDP +__jsvml_cbrtf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf8_ha_e9_B1_B3: +_unwind___jsvml_cbrtf8_ha_e9_B1_B3: DD 1603585 DD 4379768 DD 2058348 @@ -1236,19 +1236,19 @@ _unwind___svml_cbrtf8_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_cbrtf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cbrtf8_ha_e9_B6_B10: +_unwind___jsvml_cbrtf8_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_cbrtf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cbrtf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1257,7 +1257,7 @@ _unwind___svml_cbrtf8_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_cbrtf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cbrtf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1271,9 +1271,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_scbrt_ha_cout_rare_internal + PUBLIC __jsvml_scbrt_ha_cout_rare_internal -__svml_scbrt_ha_cout_rare_internal PROC +__jsvml_scbrt_ha_cout_rare_internal PROC _B7_1:: @@ -1418,13 +1418,13 @@ _B7_9:: _B7_10:: -__svml_scbrt_ha_cout_rare_internal ENDP +__jsvml_scbrt_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_scbrt_ha_cout_rare_internal_B1_B9: +_unwind___jsvml_scbrt_ha_cout_rare_internal_B1_B9: DD 199169 DD 1342595594 DD 12293 @@ -1436,7 +1436,7 @@ _unwind___svml_scbrt_ha_cout_rare_internal_B1_B9: DD imagerel _B7_1 DD imagerel _B7_10 - DD imagerel _unwind___svml_scbrt_ha_cout_rare_internal_B1_B9 + DD imagerel _unwind___jsvml_scbrt_ha_cout_rare_internal_B1_B9 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1929,8 +1929,8 @@ vscbrt_ha_cout_data DD 3212578753 DD 4278190079 DD 4278190079 DD 4278190079 - PUBLIC __svml_scbrt_ha_data_internal_avx512 -__svml_scbrt_ha_data_internal_avx512 DD 1065353216 + PUBLIC __jsvml_scbrt_ha_data_internal_avx512 +__jsvml_scbrt_ha_data_internal_avx512 DD 1065353216 DD 1067533592 DD 1070280693 DD 0 @@ -2170,8 +2170,8 @@ __svml_scbrt_ha_data_internal_avx512 DD 1065353216 DD 1051372202 DD 1051372202 DD 1051372202 - PUBLIC __svml_scbrt_ha_data_internal -__svml_scbrt_ha_data_internal DD 3212578753 + PUBLIC __jsvml_scbrt_ha_data_internal +__jsvml_scbrt_ha_data_internal DD 3212578753 DD 3212085645 DD 3211621124 DD 3211182772 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_cos_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cos_windows_x86.S similarity index 90% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_cos_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cos_windows_x86.S index acb52463c44..01f106e806d 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_cos_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cos_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosf8_ha_e9 + PUBLIC __jsvml_cosf8_ha_e9 -__svml_cosf8_ha_e9 PROC EXPORT +__jsvml_cosf8_ha_e9 PROC EXPORT _B1_1:: @@ -58,49 +58,49 @@ L1:: lea r13, QWORD PTR [303+rsp] vmovaps ymm8, ymm0 and r13, -64 - vandps ymm3, ymm8, YMMWORD PTR [__svml_scos_ha_data_internal+4096] - vaddps ymm6, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+5504] - vcmpnle_uqps ymm7, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+4160] - vmovups ymm2, YMMWORD PTR [__svml_scos_ha_data_internal+5440] - vmulps ymm10, ymm6, YMMWORD PTR [__svml_scos_ha_data_internal+5376] + vandps ymm3, ymm8, YMMWORD PTR [__jsvml_scos_ha_data_internal+4096] + vaddps ymm6, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+5504] + vcmpnle_uqps ymm7, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+4160] + vmovups ymm2, YMMWORD PTR [__jsvml_scos_ha_data_internal+5440] + vmulps ymm10, ymm6, YMMWORD PTR [__jsvml_scos_ha_data_internal+5376] vaddps ymm1, ymm2, ymm10 mov QWORD PTR [536+rsp], r13 vpslld xmm4, xmm1, 31 vsubps ymm2, ymm1, ymm2 vextractf128 xmm5, ymm1, 1 - vsubps ymm10, ymm2, YMMWORD PTR [__svml_scos_ha_data_internal+5568] + vsubps ymm10, ymm2, YMMWORD PTR [__jsvml_scos_ha_data_internal+5568] vpslld xmm6, xmm5, 31 vextractf128 xmm5, ymm10, 1 vcvtps2pd ymm0, xmm10 vcvtps2pd ymm2, xmm5 - vmovupd ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+4992] + vmovupd ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+4992] vcvtps2pd ymm10, xmm3 vextractf128 xmm3, ymm3, 1 vcvtps2pd ymm1, xmm3 vmulpd ymm3, ymm2, ymm5 vsubpd ymm3, ymm1, ymm3 - vmovupd ymm1, YMMWORD PTR [__svml_scos_ha_data_internal+5056] + vmovupd ymm1, YMMWORD PTR [__jsvml_scos_ha_data_internal+5056] vmulpd ymm2, ymm2, ymm1 vsubpd ymm2, ymm3, ymm2 vmulpd ymm3, ymm2, ymm2 vinsertf128 ymm6, ymm4, xmm6, 1 vmulpd ymm4, ymm0, ymm5 vmulpd ymm0, ymm0, ymm1 - vmovupd ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5312] + vmovupd ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5312] vsubpd ymm10, ymm10, ymm4 - vmovupd ymm4, YMMWORD PTR [__svml_scos_ha_data_internal+5248] + vmovupd ymm4, YMMWORD PTR [__jsvml_scos_ha_data_internal+5248] vsubpd ymm10, ymm10, ymm0 vmulpd ymm1, ymm10, ymm10 vmulpd ymm0, ymm5, ymm1 vmulpd ymm5, ymm5, ymm3 vaddpd ymm0, ymm4, ymm0 vaddpd ymm4, ymm4, ymm5 - vmovupd ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5184] + vmovupd ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5184] vmulpd ymm0, ymm1, ymm0 vmulpd ymm4, ymm3, ymm4 vaddpd ymm0, ymm5, ymm0 vaddpd ymm5, ymm5, ymm4 - vmovupd ymm4, YMMWORD PTR [__svml_scos_ha_data_internal+5120] + vmovupd ymm4, YMMWORD PTR [__jsvml_scos_ha_data_internal+5120] vmulpd ymm0, ymm1, ymm0 vmulpd ymm5, ymm3, ymm5 vaddpd ymm0, ymm4, ymm0 @@ -184,19 +184,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scos_ha_cout_rare_internal + call __jsvml_scos_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_cosf8_ha_e9 ENDP +__jsvml_cosf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf8_ha_e9_B1_B3: +_unwind___jsvml_cosf8_ha_e9_B1_B3: DD 800513 DD 4379703 DD 2058287 @@ -212,13 +212,13 @@ _unwind___svml_cosf8_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_cosf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf8_ha_e9_B6_B10: +_unwind___jsvml_cosf8_ha_e9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -230,7 +230,7 @@ _unwind___svml_cosf8_ha_e9_B6_B10: DD 825355 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_cosf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -239,7 +239,7 @@ _unwind___svml_cosf8_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_cosf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cosf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -253,9 +253,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosf4_ha_ex + PUBLIC __jsvml_cosf4_ha_ex -__svml_cosf4_ha_ex PROC EXPORT +__jsvml_cosf4_ha_ex PROC EXPORT _B2_1:: @@ -273,35 +273,35 @@ L28:: movups XMMWORD PTR [192+rsp], xmm7 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm12, XMMWORD PTR [__svml_scos_ha_data_internal+4096] + movups xmm12, XMMWORD PTR [__jsvml_scos_ha_data_internal+4096] and r13, -64 - movups xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5504] + movups xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5504] andps xmm12, xmm4 - movups xmm1, XMMWORD PTR [__svml_scos_ha_data_internal+5440] + movups xmm1, XMMWORD PTR [__jsvml_scos_ha_data_internal+5440] movaps xmm3, xmm12 cvtps2pd xmm0, xmm12 - cmpnleps xmm3, XMMWORD PTR [__svml_scos_ha_data_internal+4160] + cmpnleps xmm3, XMMWORD PTR [__jsvml_scos_ha_data_internal+4160] addps xmm5, xmm12 movmskps eax, xmm3 movhlps xmm12, xmm12 - mulps xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5376] + mulps xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5376] mov QWORD PTR [264+rsp], r13 addps xmm5, xmm1 movaps xmm2, xmm5 subps xmm5, xmm1 cvtps2pd xmm1, xmm12 - subps xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5568] + subps xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5568] cvtps2pd xmm10, xmm5 movhlps xmm5, xmm5 pslld xmm2, 31 cvtps2pd xmm7, xmm5 - movups xmm12, XMMWORD PTR [__svml_scos_ha_data_internal+4992] + movups xmm12, XMMWORD PTR [__jsvml_scos_ha_data_internal+4992] movaps xmm14, xmm12 mulpd xmm14, xmm10 mulpd xmm12, xmm7 subpd xmm0, xmm14 subpd xmm1, xmm12 - movups xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5056] + movups xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5056] mulpd xmm10, xmm5 mulpd xmm7, xmm5 subpd xmm0, xmm10 @@ -310,21 +310,21 @@ L28:: movaps xmm12, xmm1 mulpd xmm10, xmm0 mulpd xmm12, xmm1 - movups xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5312] + movups xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5312] movaps xmm7, xmm5 mulpd xmm7, xmm10 mulpd xmm5, xmm12 - movups xmm14, XMMWORD PTR [__svml_scos_ha_data_internal+5248] + movups xmm14, XMMWORD PTR [__jsvml_scos_ha_data_internal+5248] addpd xmm7, xmm14 addpd xmm14, xmm5 mulpd xmm7, xmm10 mulpd xmm14, xmm12 - movups xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5184] + movups xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5184] addpd xmm7, xmm5 addpd xmm5, xmm14 mulpd xmm7, xmm10 mulpd xmm5, xmm12 - movups xmm14, XMMWORD PTR [__svml_scos_ha_data_internal+5120] + movups xmm14, XMMWORD PTR [__jsvml_scos_ha_data_internal+5120] addpd xmm7, xmm14 addpd xmm14, xmm5 mulpd xmm10, xmm7 @@ -389,19 +389,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scos_ha_cout_rare_internal + call __jsvml_scos_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_cosf4_ha_ex ENDP +__jsvml_cosf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf4_ha_ex_B1_B3: +_unwind___jsvml_cosf4_ha_ex_B1_B3: DD 801025 DD 2151481 DD 817201 @@ -417,19 +417,19 @@ _unwind___svml_cosf4_ha_ex_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cosf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cosf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf4_ha_ex_B6_B10: +_unwind___jsvml_cosf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_cosf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_cosf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -438,7 +438,7 @@ _unwind___svml_cosf4_ha_ex_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_cosf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_cosf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -452,9 +452,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosf4_ha_l9 + PUBLIC __jsvml_cosf4_ha_l9 -__svml_cosf4_ha_l9 PROC EXPORT +__jsvml_cosf4_ha_l9 PROC EXPORT _B3_1:: @@ -468,26 +468,26 @@ L43:: vmovaps xmm2, xmm0 mov QWORD PTR [192+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm3, xmm2, XMMWORD PTR [__svml_scos_ha_data_internal+4096] + vandps xmm3, xmm2, XMMWORD PTR [__jsvml_scos_ha_data_internal+4096] and r13, -64 - vmovups xmm0, XMMWORD PTR [__svml_scos_ha_data_internal+5440] - vcmpnleps xmm1, xmm3, XMMWORD PTR [__svml_scos_ha_data_internal+4160] - vaddps xmm5, xmm3, XMMWORD PTR [__svml_scos_ha_data_internal+5504] + vmovups xmm0, XMMWORD PTR [__jsvml_scos_ha_data_internal+5440] + vcmpnleps xmm1, xmm3, XMMWORD PTR [__jsvml_scos_ha_data_internal+4160] + vaddps xmm5, xmm3, XMMWORD PTR [__jsvml_scos_ha_data_internal+5504] vcvtps2pd ymm3, xmm3 vmovmskps edx, xmm1 - vfmadd132ps xmm5, xmm0, XMMWORD PTR [__svml_scos_ha_data_internal+5376] + vfmadd132ps xmm5, xmm0, XMMWORD PTR [__jsvml_scos_ha_data_internal+5376] vpslld xmm4, xmm5, 31 vsubps xmm5, xmm5, xmm0 mov QWORD PTR [200+rsp], r13 - vsubps xmm0, xmm5, XMMWORD PTR [__svml_scos_ha_data_internal+5568] - vmovupd ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5312] + vsubps xmm0, xmm5, XMMWORD PTR [__jsvml_scos_ha_data_internal+5568] + vmovupd ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5312] vcvtps2pd ymm0, xmm0 - vfnmadd231pd ymm3, ymm0, YMMWORD PTR [__svml_scos_ha_data_internal+4992] - vfnmadd132pd ymm0, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+5056] + vfnmadd231pd ymm3, ymm0, YMMWORD PTR [__jsvml_scos_ha_data_internal+4992] + vfnmadd132pd ymm0, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+5056] vmulpd ymm3, ymm0, ymm0 - vfmadd213pd ymm5, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+5248] - vfmadd213pd ymm5, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+5184] - vfmadd213pd ymm5, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+5120] + vfmadd213pd ymm5, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+5248] + vfmadd213pd ymm5, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+5184] + vfmadd213pd ymm5, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+5120] vmulpd ymm3, ymm3, ymm5 vfmadd213pd ymm3, ymm0, ymm0 vcvtpd2ps xmm0, ymm3 @@ -539,19 +539,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scos_ha_cout_rare_internal + call __jsvml_scos_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_cosf4_ha_l9 ENDP +__jsvml_cosf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf4_ha_l9_B1_B3: +_unwind___jsvml_cosf4_ha_l9_B1_B3: DD 268033 DD 1627159 DD 1769739 @@ -563,13 +563,13 @@ _unwind___svml_cosf4_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_cosf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf4_ha_l9_B6_B10: +_unwind___jsvml_cosf4_ha_l9_B6_B10: DD 527873 DD 287758 DD 340999 @@ -583,7 +583,7 @@ _unwind___svml_cosf4_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_cosf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cosf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -597,9 +597,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosf4_ha_e9 + PUBLIC __jsvml_cosf4_ha_e9 -__svml_cosf4_ha_e9 PROC EXPORT +__jsvml_cosf4_ha_e9 PROC EXPORT _B4_1:: @@ -612,31 +612,31 @@ L50:: sub rsp, 216 mov QWORD PTR [192+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm4, xmm0, XMMWORD PTR [__svml_scos_ha_data_internal+4096] + vandps xmm4, xmm0, XMMWORD PTR [__jsvml_scos_ha_data_internal+4096] and r13, -64 - vmovups xmm3, XMMWORD PTR [__svml_scos_ha_data_internal+5440] - vcmpnleps xmm1, xmm4, XMMWORD PTR [__svml_scos_ha_data_internal+4160] - vaddps xmm2, xmm4, XMMWORD PTR [__svml_scos_ha_data_internal+5504] + vmovups xmm3, XMMWORD PTR [__jsvml_scos_ha_data_internal+5440] + vcmpnleps xmm1, xmm4, XMMWORD PTR [__jsvml_scos_ha_data_internal+4160] + vaddps xmm2, xmm4, XMMWORD PTR [__jsvml_scos_ha_data_internal+5504] vcvtps2pd ymm4, xmm4 vmovmskps edx, xmm1 - vmulps xmm5, xmm2, XMMWORD PTR [__svml_scos_ha_data_internal+5376] + vmulps xmm5, xmm2, XMMWORD PTR [__jsvml_scos_ha_data_internal+5376] mov QWORD PTR [200+rsp], r13 vaddps xmm5, xmm3, xmm5 vpslld xmm2, xmm5, 31 vsubps xmm3, xmm5, xmm3 - vsubps xmm3, xmm3, XMMWORD PTR [__svml_scos_ha_data_internal+5568] + vsubps xmm3, xmm3, XMMWORD PTR [__jsvml_scos_ha_data_internal+5568] vcvtps2pd ymm5, xmm3 - vmulpd ymm3, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+4992] - vmulpd ymm5, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5056] + vmulpd ymm3, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+4992] + vmulpd ymm5, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5056] vsubpd ymm4, ymm4, ymm3 vsubpd ymm3, ymm4, ymm5 vmulpd ymm4, ymm3, ymm3 - vmulpd ymm5, ymm4, YMMWORD PTR [__svml_scos_ha_data_internal+5312] - vaddpd ymm5, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5248] + vmulpd ymm5, ymm4, YMMWORD PTR [__jsvml_scos_ha_data_internal+5312] + vaddpd ymm5, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5248] vmulpd ymm5, ymm4, ymm5 - vaddpd ymm5, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5184] + vaddpd ymm5, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5184] vmulpd ymm5, ymm4, ymm5 - vaddpd ymm5, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5120] + vaddpd ymm5, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5120] vmulpd ymm4, ymm4, ymm5 vmulpd ymm4, ymm3, ymm4 vaddpd ymm3, ymm3, ymm4 @@ -690,19 +690,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scos_ha_cout_rare_internal + call __jsvml_scos_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_cosf4_ha_e9 ENDP +__jsvml_cosf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf4_ha_e9_B1_B3: +_unwind___jsvml_cosf4_ha_e9_B1_B3: DD 267009 DD 1627155 DD 1769739 @@ -714,13 +714,13 @@ _unwind___svml_cosf4_ha_e9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_cosf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_cosf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf4_ha_e9_B6_B10: +_unwind___jsvml_cosf4_ha_e9_B6_B10: DD 527873 DD 287758 DD 340999 @@ -734,7 +734,7 @@ _unwind___svml_cosf4_ha_e9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_cosf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_cosf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -748,9 +748,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosf8_ha_l9 + PUBLIC __jsvml_cosf8_ha_l9 -__svml_cosf8_ha_l9 PROC EXPORT +__jsvml_cosf8_ha_l9 PROC EXPORT _B5_1:: @@ -767,16 +767,16 @@ L57:: vmovups YMMWORD PTR [432+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [303+rsp] - vmovups ymm4, YMMWORD PTR [__svml_scos_ha_data_internal+5440] + vmovups ymm4, YMMWORD PTR [__jsvml_scos_ha_data_internal+5440] and r13, -64 - vmovupd ymm14, YMMWORD PTR [__svml_scos_ha_data_internal+4992] - vandps ymm5, ymm0, YMMWORD PTR [__svml_scos_ha_data_internal+4096] - vaddps ymm3, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5504] - vcmpnle_uqps ymm1, ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+4160] - vfmadd132ps ymm3, ymm4, YMMWORD PTR [__svml_scos_ha_data_internal+5376] + vmovupd ymm14, YMMWORD PTR [__jsvml_scos_ha_data_internal+4992] + vandps ymm5, ymm0, YMMWORD PTR [__jsvml_scos_ha_data_internal+4096] + vaddps ymm3, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5504] + vcmpnle_uqps ymm1, ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+4160] + vfmadd132ps ymm3, ymm4, YMMWORD PTR [__jsvml_scos_ha_data_internal+5376] vpslld ymm2, ymm3, 31 vsubps ymm3, ymm3, ymm4 - vsubps ymm4, ymm3, YMMWORD PTR [__svml_scos_ha_data_internal+5568] + vsubps ymm4, ymm3, YMMWORD PTR [__jsvml_scos_ha_data_internal+5568] vmovmskps edx, ymm1 mov QWORD PTR [536+rsp], r13 test edx, edx @@ -786,22 +786,22 @@ L57:: vcvtps2pd ymm4, xmm13 vcvtps2pd ymm15, xmm5 vcvtps2pd ymm13, xmm6 - vmovupd ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5056] + vmovupd ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5056] vfnmadd231pd ymm15, ymm14, ymm3 vfnmadd231pd ymm13, ymm14, ymm4 vfnmadd213pd ymm3, ymm5, ymm15 vfnmadd213pd ymm4, ymm5, ymm13 - vmovupd ymm5, YMMWORD PTR [__svml_scos_ha_data_internal+5248] - vmovupd ymm15, YMMWORD PTR [__svml_scos_ha_data_internal+5312] + vmovupd ymm5, YMMWORD PTR [__jsvml_scos_ha_data_internal+5248] + vmovupd ymm15, YMMWORD PTR [__jsvml_scos_ha_data_internal+5312] vmulpd ymm6, ymm3, ymm3 vmulpd ymm13, ymm4, ymm4 vmovdqa ymm14, ymm5 vfmadd231pd ymm14, ymm15, ymm6 vfmadd231pd ymm5, ymm15, ymm13 - vmovupd ymm15, YMMWORD PTR [__svml_scos_ha_data_internal+5184] + vmovupd ymm15, YMMWORD PTR [__jsvml_scos_ha_data_internal+5184] vfmadd213pd ymm14, ymm6, ymm15 vfmadd213pd ymm5, ymm13, ymm15 - vmovupd ymm15, YMMWORD PTR [__svml_scos_ha_data_internal+5120] + vmovupd ymm15, YMMWORD PTR [__jsvml_scos_ha_data_internal+5120] vfmadd213pd ymm14, ymm6, ymm15 vfmadd213pd ymm5, ymm13, ymm15 vmulpd ymm6, ymm6, ymm14 @@ -874,19 +874,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scos_ha_cout_rare_internal + call __jsvml_scos_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_cosf8_ha_l9 ENDP +__jsvml_cosf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf8_ha_l9_B1_B3: +_unwind___jsvml_cosf8_ha_l9_B1_B3: DD 800513 DD 4379703 DD 1796143 @@ -902,13 +902,13 @@ _unwind___svml_cosf8_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_cosf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf8_ha_l9_B6_B10: +_unwind___jsvml_cosf8_ha_l9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -920,7 +920,7 @@ _unwind___svml_cosf8_ha_l9_B6_B10: DD 817163 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_cosf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_cosf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -929,7 +929,7 @@ _unwind___svml_cosf8_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_cosf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_cosf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -943,9 +943,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_cosf16_ha_z0 + PUBLIC __jsvml_cosf16_ha_z0 -__svml_cosf16_ha_z0 PROC EXPORT +__jsvml_cosf16_ha_z0 PROC EXPORT _B6_1:: @@ -958,25 +958,25 @@ L84:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm22, ZMMWORD PTR [__svml_scos_ha_data_internal+5504] + vmovups zmm22, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5504] and r13, -64 - vmovups zmm26, ZMMWORD PTR [__svml_scos_ha_data_internal+5440] - vmovups zmm24, ZMMWORD PTR [__svml_scos_ha_data_internal+5376] - vmovups zmm23, ZMMWORD PTR [__svml_scos_ha_data_internal+4160] - vmovups zmm28, ZMMWORD PTR [__svml_scos_ha_data_internal+5568] + vmovups zmm26, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5440] + vmovups zmm24, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5376] + vmovups zmm23, ZMMWORD PTR [__jsvml_scos_ha_data_internal+4160] + vmovups zmm28, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5568] vpternlogd zmm4, zmm4, zmm4, 255 vmovaps zmm5, zmm0 - vandps zmm2, zmm5, ZMMWORD PTR [__svml_scos_ha_data_internal+4096] + vandps zmm2, zmm5, ZMMWORD PTR [__jsvml_scos_ha_data_internal+4096] vaddps zmm25, zmm2, zmm22 {rn-sae} vcmpps k1, zmm2, zmm23, 18 {sae} vfmadd213ps zmm25, zmm24, zmm26 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_scos_ha_data_internal+5056] + vmovups zmm23, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5056] vsubps zmm27, zmm25, zmm26 {rn-sae} vpslld zmm3, zmm25, 31 - vmovups zmm25, ZMMWORD PTR [__svml_scos_ha_data_internal+5312] - vmovups zmm26, ZMMWORD PTR [__svml_scos_ha_data_internal+5184] + vmovups zmm25, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5312] + vmovups zmm26, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5184] vsubps zmm29, zmm27, zmm28 {rn-sae} - vmovups zmm27, ZMMWORD PTR [__svml_scos_ha_data_internal+5120] + vmovups zmm27, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5120] mov QWORD PTR [1328+rsp], r13 vpandnd zmm4{k1}, zmm2, zmm2 vextractf32x8 ymm30, zmm29, 1 @@ -986,8 +986,8 @@ L84:: vcvtps2pd zmm24, ymm31 {sae} vcvtps2pd zmm1, ymm29 {sae} vptestmd k0, zmm4, zmm4 - vmovups zmm2, ZMMWORD PTR [__svml_scos_ha_data_internal+4992] - vmovups zmm30, ZMMWORD PTR [__svml_scos_ha_data_internal+5248] + vmovups zmm2, ZMMWORD PTR [__jsvml_scos_ha_data_internal+4992] + vmovups zmm30, ZMMWORD PTR [__jsvml_scos_ha_data_internal+5248] kmovw r8d, k0 vfnmadd231pd zmm24, zmm2, zmm0 {rn-sae} vfnmadd231pd zmm22, zmm2, zmm1 {rn-sae} @@ -1141,19 +1141,19 @@ _B6_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scos_ha_cout_rare_internal + call __jsvml_scos_ha_cout_rare_internal jmp _B6_13 ALIGN 16 _B6_16:: -__svml_cosf16_ha_z0 ENDP +__jsvml_cosf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf16_ha_z0_B1_B9: +_unwind___jsvml_cosf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -1165,13 +1165,13 @@ _unwind___svml_cosf16_ha_z0_B1_B9: DD imagerel _B6_1 DD imagerel _B6_11 - DD imagerel _unwind___svml_cosf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_cosf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_cosf16_ha_z0_B11_B15: +_unwind___jsvml_cosf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -1207,7 +1207,7 @@ _unwind___svml_cosf16_ha_z0_B11_B15: DD imagerel _B6_11 DD imagerel _B6_16 - DD imagerel _unwind___svml_cosf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_cosf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1221,9 +1221,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_scos_ha_cout_rare_internal + PUBLIC __jsvml_scos_ha_cout_rare_internal -__svml_scos_ha_cout_rare_internal PROC +__jsvml_scos_ha_cout_rare_internal PROC _B7_1:: @@ -1759,13 +1759,13 @@ _B7_17:: _B7_18:: -__svml_scos_ha_cout_rare_internal ENDP +__jsvml_scos_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_scos_ha_cout_rare_internal_B1_B17: +_unwind___jsvml_scos_ha_cout_rare_internal_B1_B17: DD 676865 DD 489556 DD 374863 @@ -1780,7 +1780,7 @@ _unwind___svml_scos_ha_cout_rare_internal_B1_B17: DD imagerel _B7_1 DD imagerel _B7_18 - DD imagerel _unwind___svml_scos_ha_cout_rare_internal_B1_B17 + DD imagerel _unwind___jsvml_scos_ha_cout_rare_internal_B1_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1788,8 +1788,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_scos_ha_data_internal -__svml_scos_ha_data_internal DD 0 + PUBLIC __jsvml_scos_ha_data_internal +__jsvml_scos_ha_data_internal DD 0 DD 1065353216 DD 0 DD 0 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_cosh_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cosh_windows_x86.S similarity index 78% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_cosh_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cosh_windows_x86.S index 3b3f32332ba..080f75118f1 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_cosh_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_cosh_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_coshf16_ha_z0 + PUBLIC __jsvml_coshf16_ha_z0 -__svml_coshf16_ha_z0 PROC EXPORT +__jsvml_coshf16_ha_z0 PROC EXPORT _B1_1:: @@ -52,27 +52,27 @@ L1:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm5, ZMMWORD PTR [__svml_scosh_ha_data_internal+1024] + vmovups zmm5, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+1024] and r13, -64 - vmovups zmm27, ZMMWORD PTR [__svml_scosh_ha_data_internal+768] - vmovups zmm23, ZMMWORD PTR [__svml_scosh_ha_data_internal+384] - vmovups zmm24, ZMMWORD PTR [__svml_scosh_ha_data_internal+896] - vmovups zmm26, ZMMWORD PTR [__svml_scosh_ha_data_internal+960] - vmovups zmm3, ZMMWORD PTR [__svml_scosh_ha_data_internal+640] - vmovups zmm2, ZMMWORD PTR [__svml_scosh_ha_data_internal+704] - vmovups zmm29, ZMMWORD PTR [__svml_scosh_ha_data_internal] - vmovups zmm31, ZMMWORD PTR [__svml_scosh_ha_data_internal+256] - vmovups zmm30, ZMMWORD PTR [__svml_scosh_ha_data_internal+128] + vmovups zmm27, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+768] + vmovups zmm23, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+384] + vmovups zmm24, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+896] + vmovups zmm26, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+960] + vmovups zmm3, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+640] + vmovups zmm2, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+704] + vmovups zmm29, ZMMWORD PTR [__jsvml_scosh_ha_data_internal] + vmovups zmm31, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+256] + vmovups zmm30, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+128] vpternlogd zmm22, zmm22, zmm22, 255 vmovaps zmm4, zmm0 vandnps zmm1, zmm5, zmm4 vfmadd213ps zmm27, zmm1, zmm23 {rn-sae} - vpcmpd k1, zmm1, ZMMWORD PTR [__svml_scosh_ha_data_internal+512], 1 + vpcmpd k1, zmm1, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+512], 1 vpslld zmm28, zmm27, 18 vsubps zmm25, zmm27, zmm23 {rn-sae} - vpermt2ps zmm29, zmm27, ZMMWORD PTR [__svml_scosh_ha_data_internal+64] - vpermt2ps zmm31, zmm27, ZMMWORD PTR [__svml_scosh_ha_data_internal+320] - vpermt2ps zmm30, zmm27, ZMMWORD PTR [__svml_scosh_ha_data_internal+192] + vpermt2ps zmm29, zmm27, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+64] + vpermt2ps zmm31, zmm27, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+320] + vpermt2ps zmm30, zmm27, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+192] mov QWORD PTR [1328+rsp], r13 vpandnd zmm22{k1}, zmm1, zmm1 vfnmadd231ps zmm1, zmm25, zmm24 {rn-sae} @@ -83,7 +83,7 @@ L1:: vmulps zmm2, zmm2, zmm0 {rn-sae} vmulps zmm0, zmm3, zmm0 {rn-sae} vfmadd213ps zmm2, zmm1, zmm1 {rn-sae} - vpandd zmm5, zmm28, ZMMWORD PTR [__svml_scosh_ha_data_internal+1216] + vpandd zmm5, zmm28, ZMMWORD PTR [__jsvml_scosh_ha_data_internal+1216] vpaddd zmm24, zmm29, zmm5 vpsubd zmm23, zmm31, zmm5 vpaddd zmm30, zmm30, zmm5 @@ -224,19 +224,19 @@ _B1_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scosh_ha_cout_rare_internal + call __jsvml_scosh_ha_cout_rare_internal jmp _B1_13 ALIGN 16 _B1_16:: -__svml_coshf16_ha_z0 ENDP +__jsvml_coshf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf16_ha_z0_B1_B9: +_unwind___jsvml_coshf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -248,13 +248,13 @@ _unwind___svml_coshf16_ha_z0_B1_B9: DD imagerel _B1_1 DD imagerel _B1_11 - DD imagerel _unwind___svml_coshf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_coshf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf16_ha_z0_B11_B15: +_unwind___jsvml_coshf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -290,7 +290,7 @@ _unwind___svml_coshf16_ha_z0_B11_B15: DD imagerel _B1_11 DD imagerel _B1_16 - DD imagerel _unwind___svml_coshf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_coshf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -304,9 +304,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_coshf8_ha_e9 + PUBLIC __jsvml_coshf8_ha_e9 -__svml_coshf8_ha_e9 PROC EXPORT +__jsvml_coshf8_ha_e9 PROC EXPORT _B2_1:: @@ -329,14 +329,14 @@ L52:: vmovups YMMWORD PTR [480+rsp], ymm11 mov QWORD PTR [512+rsp], r13 lea r13, QWORD PTR [255+rsp] - vmovups ymm5, YMMWORD PTR [__svml_scosh_ha_data_internal+1024] + vmovups ymm5, YMMWORD PTR [__jsvml_scosh_ha_data_internal+1024] and r13, -64 - vmovups ymm1, YMMWORD PTR [__svml_scosh_ha_data_internal+1280] - vmovups xmm15, XMMWORD PTR [__svml_scosh_ha_data_internal+1408] - vmovups xmm3, XMMWORD PTR [__svml_scosh_ha_data_internal+1344] + vmovups ymm1, YMMWORD PTR [__jsvml_scosh_ha_data_internal+1280] + vmovups xmm15, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1408] + vmovups xmm3, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1344] vmovaps ymm11, ymm0 vandnps ymm0, ymm5, ymm11 - vmulps ymm4, ymm0, YMMWORD PTR [__svml_scosh_ha_data_internal+768] + vmulps ymm4, ymm0, YMMWORD PTR [__jsvml_scosh_ha_data_internal+768] vaddps ymm12, ymm1, ymm4 mov QWORD PTR [520+rsp], r13 vpcmpgtd xmm5, xmm0, xmm15 @@ -347,8 +347,8 @@ L52:: vsubps ymm12, ymm12, ymm1 vpacksswb xmm13, xmm2, xmm14 vpmovmskb edi, xmm13 - vmulps ymm1, ymm12, YMMWORD PTR [__svml_scosh_ha_data_internal+896] - vmulps ymm12, ymm12, YMMWORD PTR [__svml_scosh_ha_data_internal+960] + vmulps ymm1, ymm12, YMMWORD PTR [__jsvml_scosh_ha_data_internal+896] + vmulps ymm12, ymm12, YMMWORD PTR [__jsvml_scosh_ha_data_internal+960] vsubps ymm1, ymm0, ymm1 vsubps ymm0, ymm1, ymm12 vpsubd xmm2, xmm3, xmm4 @@ -368,61 +368,61 @@ L52:: vmovd ecx, xmm1 vpsubd xmm2, xmm4, xmm2 vpsubd xmm3, xmm5, xmm3 - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+r12] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+r12] vpslld xmm3, xmm3, 19 vpextrd r10d, xmm15, 2 vpextrd r11d, xmm15, 1 vpextrd eax, xmm1, 2 vpextrd r9d, xmm15, 3 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+r10] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+r10] vpextrd edx, xmm1, 1 - vpinsrd xmm12, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+r11], 1 - vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+r9], 1 - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+rax] + vpinsrd xmm12, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+r11], 1 + vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+r9], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+rax] vpextrd r14d, xmm1, 3 - vmovd xmm1, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+rcx] - vpinsrd xmm13, xmm1, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+rdx], 1 - vpinsrd xmm1, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r8+r14], 1 + vmovd xmm1, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+rcx] + vpinsrd xmm13, xmm1, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+rdx], 1 + vpinsrd xmm1, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r8+r14], 1 vpunpcklqdq xmm12, xmm12, xmm15 - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+r10] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+r10] vpunpcklqdq xmm15, xmm13, xmm1 - vpinsrd xmm1, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+r9], 1 - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+rax] + vpinsrd xmm1, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+r9], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+rax] vinsertf128 ymm13, ymm12, xmm15, 1 - vmovd xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+r12] - vpinsrd xmm12, xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+r11], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+rcx] + vmovd xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+r12] + vpinsrd xmm12, xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+r11], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+rcx] vpunpcklqdq xmm1, xmm12, xmm1 - vpinsrd xmm12, xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+rdx], 1 - vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r8+r14], 1 + vpinsrd xmm12, xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+rdx], 1 + vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r8+r14], 1 vpunpcklqdq xmm14, xmm12, xmm15 vinsertf128 ymm12, ymm1, xmm14, 1 vmulps ymm15, ymm12, ymm0 - vmovd xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+r10] + vmovd xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+r10] vaddps ymm1, ymm13, ymm13 vaddps ymm14, ymm13, ymm15 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+r12] - vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+r11], 1 - vpinsrd xmm13, xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+r9], 1 - vmovd xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+rcx] - vpinsrd xmm12, xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+rdx], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+r12] + vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+r11], 1 + vpinsrd xmm13, xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+r9], 1 + vmovd xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+rcx] + vpinsrd xmm12, xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+rdx], 1 vmulps ymm14, ymm0, ymm14 vpunpcklqdq xmm15, xmm15, xmm13 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+rax] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r8+r14], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+rax] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r8+r14], 1 vpunpcklqdq xmm12, xmm12, xmm13 vinsertf128 ymm15, ymm15, xmm12, 1 - vmovd xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+r12] + vmovd xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+r12] vaddps ymm15, ymm15, ymm14 - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+r10] - vpinsrd xmm13, xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+r11], 1 - vpinsrd xmm12, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+r9], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+r10] + vpinsrd xmm13, xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+r11], 1 + vpinsrd xmm12, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+r9], 1 vmulps ymm0, ymm0, ymm15 vpunpcklqdq xmm14, xmm13, xmm12 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+rcx] - vmovd xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+rax] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+rdx], 1 - vpinsrd xmm12, xmm12, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r8+r14], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+rcx] + vmovd xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+rax] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+rdx], 1 + vpinsrd xmm12, xmm12, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r8+r14], 1 vpunpcklqdq xmm13, xmm13, xmm12 vinsertf128 ymm14, ymm14, xmm13, 1 vaddps ymm12, ymm14, ymm0 @@ -492,19 +492,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+r12*4] lea rdx, QWORD PTR [64+r13+r12*4] - call __svml_scosh_ha_cout_rare_internal + call __jsvml_scosh_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_coshf8_ha_e9 ENDP +__jsvml_coshf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf8_ha_e9_B1_B3: +_unwind___jsvml_coshf8_ha_e9_B1_B3: DD 1134849 DD 4248657 DD 2013257 @@ -523,13 +523,13 @@ _unwind___svml_coshf8_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_coshf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_coshf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf8_ha_e9_B6_B10: +_unwind___jsvml_coshf8_ha_e9_B6_B10: DD 665377 DD 174119 DD 301089 @@ -538,7 +538,7 @@ _unwind___svml_coshf8_ha_e9_B6_B10: DD 681993 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_coshf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_coshf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -547,7 +547,7 @@ _unwind___svml_coshf8_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_coshf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_coshf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -561,9 +561,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_coshf4_ha_l9 + PUBLIC __jsvml_coshf4_ha_l9 -__svml_coshf4_ha_l9 PROC EXPORT +__jsvml_coshf4_ha_l9 PROC EXPORT _B3_1:: @@ -580,14 +580,14 @@ L75:: vmovups XMMWORD PTR [208+rsp], xmm13 mov QWORD PTR [224+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm1, XMMWORD PTR [__svml_scosh_ha_data_internal+1024] + vmovups xmm1, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1024] and r13, -64 - vmovups xmm5, XMMWORD PTR [__svml_scosh_ha_data_internal+1280] + vmovups xmm5, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1280] vandnps xmm3, xmm1, xmm2 - vmovups xmm4, XMMWORD PTR [__svml_scosh_ha_data_internal+768] + vmovups xmm4, XMMWORD PTR [__jsvml_scosh_ha_data_internal+768] vfmadd213ps xmm4, xmm3, xmm5 - vpcmpgtd xmm1, xmm3, XMMWORD PTR [__svml_scosh_ha_data_internal+1408] - vmovups xmm0, XMMWORD PTR [__svml_scosh_ha_data_internal+1344] + vpcmpgtd xmm1, xmm3, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1408] + vmovups xmm0, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1344] vmovmskps ecx, xmm1 vxorps xmm1, xmm4, xmm5 vsubps xmm4, xmm4, xmm5 @@ -596,35 +596,35 @@ L75:: vpslld xmm14, xmm13, 4 vpor xmm13, xmm14, xmm1 vpand xmm0, xmm13, xmm0 - vfnmadd231ps xmm3, xmm4, XMMWORD PTR [__svml_scosh_ha_data_internal+896] + vfnmadd231ps xmm3, xmm4, XMMWORD PTR [__jsvml_scosh_ha_data_internal+896] vpslld xmm5, xmm0, 4 vmovd edx, xmm5 - vfnmadd231ps xmm3, xmm4, XMMWORD PTR [__svml_scosh_ha_data_internal+960] - vmovd xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+rdx] + vfnmadd231ps xmm3, xmm4, XMMWORD PTR [__jsvml_scosh_ha_data_internal+960] + vmovd xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+rdx] vpextrd r8d, xmm5, 2 vpextrd eax, xmm5, 1 vpextrd r9d, xmm5, 3 - vmovd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+r8] - vpinsrd xmm13, xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+rax], 1 - vpinsrd xmm14, xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+r9], 1 - vmovd xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+rdx] - vmovd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+r8] + vmovd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+r8] + vpinsrd xmm13, xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+rax], 1 + vpinsrd xmm14, xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+r9], 1 + vmovd xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+rdx] + vmovd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+r8] vunpcklpd xmm13, xmm13, xmm14 - vpinsrd xmm14, xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+rax], 1 - vpinsrd xmm4, xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+r9], 1 + vpinsrd xmm14, xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+rax], 1 + vpinsrd xmm4, xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+r9], 1 vaddps xmm5, xmm13, xmm13 vpunpcklqdq xmm4, xmm14, xmm4 vfmadd213ps xmm4, xmm3, xmm13 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+rdx] - vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+rax], 1 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+r8] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+r9], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+rdx] + vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+rax], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+r8] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+r9], 1 vpunpcklqdq xmm14, xmm14, xmm13 vfmadd213ps xmm4, xmm3, xmm14 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+rdx] - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+r8] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+rax], 1 - vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+r9], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+rdx] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+r8] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+rax], 1 + vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+r9], 1 vpunpcklqdq xmm13, xmm13, xmm14 vfmadd213ps xmm4, xmm3, xmm13 vpsubd xmm3, xmm1, xmm0 @@ -679,19 +679,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scosh_ha_cout_rare_internal + call __jsvml_scosh_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_coshf4_ha_l9 ENDP +__jsvml_coshf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf4_ha_l9_B1_B3: +_unwind___jsvml_coshf4_ha_l9_B1_B3: DD 536577 DD 1889328 DD 907304 @@ -705,19 +705,19 @@ _unwind___svml_coshf4_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_coshf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_coshf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf4_ha_l9_B6_B10: +_unwind___jsvml_coshf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_coshf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_coshf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -726,7 +726,7 @@ _unwind___svml_coshf4_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_coshf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_coshf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -740,9 +740,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_coshf8_ha_l9 + PUBLIC __jsvml_coshf8_ha_l9 -__svml_coshf8_ha_l9 PROC EXPORT +__jsvml_coshf8_ha_l9 PROC EXPORT _B4_1:: @@ -762,81 +762,81 @@ L86:: vmovups YMMWORD PTR [480+rsp], ymm13 mov QWORD PTR [512+rsp], r13 lea r13, QWORD PTR [319+rsp] - vmovups ymm4, YMMWORD PTR [__svml_scosh_ha_data_internal+1024] + vmovups ymm4, YMMWORD PTR [__jsvml_scosh_ha_data_internal+1024] and r13, -64 - vmovups ymm14, YMMWORD PTR [__svml_scosh_ha_data_internal+768] - vmovups ymm3, YMMWORD PTR [__svml_scosh_ha_data_internal+1344] + vmovups ymm14, YMMWORD PTR [__jsvml_scosh_ha_data_internal+768] + vmovups ymm3, YMMWORD PTR [__jsvml_scosh_ha_data_internal+1344] vmovaps ymm5, ymm0 - vmovups ymm0, YMMWORD PTR [__svml_scosh_ha_data_internal+1280] + vmovups ymm0, YMMWORD PTR [__jsvml_scosh_ha_data_internal+1280] vandnps ymm1, ymm4, ymm5 vfmadd213ps ymm14, ymm1, ymm0 - vpcmpgtd ymm4, ymm1, YMMWORD PTR [__svml_scosh_ha_data_internal+1408] + vpcmpgtd ymm4, ymm1, YMMWORD PTR [__jsvml_scosh_ha_data_internal+1408] vmovmskps ebx, ymm4 vxorps ymm4, ymm14, ymm0 vpsubd ymm2, ymm3, ymm4 vsubps ymm0, ymm14, ymm0 vpsrld ymm2, ymm2, 28 - vfnmadd231ps ymm1, ymm0, YMMWORD PTR [__svml_scosh_ha_data_internal+896] + vfnmadd231ps ymm1, ymm0, YMMWORD PTR [__jsvml_scosh_ha_data_internal+896] vpslld ymm13, ymm2, 4 - vfnmadd231ps ymm1, ymm0, YMMWORD PTR [__svml_scosh_ha_data_internal+960] + vfnmadd231ps ymm1, ymm0, YMMWORD PTR [__jsvml_scosh_ha_data_internal+960] vpor ymm15, ymm13, ymm4 vpand ymm3, ymm15, ymm3 vpslld ymm14, ymm3, 4 mov QWORD PTR [520+rsp], r13 vmovd r11d, xmm14 vextracti128 xmm15, ymm14, 1 - vmovd xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+r11] + vmovd xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+r11] vpextrd r9d, xmm14, 2 vpextrd r10d, xmm14, 1 vpextrd r8d, xmm14, 3 - vmovd xmm2, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+r9] - vpinsrd xmm13, xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+r10], 1 - vpinsrd xmm0, xmm2, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+r8], 1 + vmovd xmm2, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+r9] + vpinsrd xmm13, xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+r10], 1 + vpinsrd xmm0, xmm2, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+r8], 1 vmovd ecx, xmm15 vpunpcklqdq xmm2, xmm13, xmm0 vpextrd eax, xmm15, 2 vpextrd edx, xmm15, 1 vpextrd r15d, xmm15, 3 - vmovd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+rcx] - vmovd xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+rax] - vpinsrd xmm14, xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+rdx], 1 - vpinsrd xmm13, xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+rbp+r15], 1 - vmovd xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+r9] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+rcx] + vmovd xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+rax] + vpinsrd xmm14, xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+rdx], 1 + vpinsrd xmm13, xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+rbp+r15], 1 + vmovd xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+r9] vpunpcklqdq xmm15, xmm14, xmm13 - vpinsrd xmm14, xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+r8], 1 + vpinsrd xmm14, xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+r8], 1 vinsertf128 ymm13, ymm2, xmm15, 1 - vmovd xmm2, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+r11] - vpinsrd xmm2, xmm2, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+r10], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+rcx] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+r11] + vpinsrd xmm2, xmm2, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+r10], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+rcx] vpunpcklqdq xmm0, xmm2, xmm14 - vmovd xmm2, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+rax] - vpinsrd xmm14, xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+rdx], 1 - vpinsrd xmm15, xmm2, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+rbp+r15], 1 + vmovd xmm2, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+rax] + vpinsrd xmm14, xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+rdx], 1 + vpinsrd xmm15, xmm2, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+rbp+r15], 1 vpunpcklqdq xmm2, xmm14, xmm15 - vmovd xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+r9] - vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+r8], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+r9] + vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+r8], 1 vinsertf128 ymm0, ymm0, xmm2, 1 vaddps ymm2, ymm13, ymm13 vfmadd213ps ymm0, ymm1, ymm13 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+r11] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+r10], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+r11] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+r10], 1 vpunpcklqdq xmm14, xmm13, xmm15 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+rcx] - vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+rdx], 1 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+rax] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+rbp+r15], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+rcx] + vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+rdx], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+rax] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+rbp+r15], 1 vpunpcklqdq xmm15, xmm15, xmm13 - vmovd xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+r11] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+r11] vinsertf128 ymm14, ymm14, xmm15, 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+r9] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+r9] vfmadd213ps ymm0, ymm1, ymm14 - vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+r10], 1 - vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+r8], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+rcx] + vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+r10], 1 + vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+r8], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+rcx] vpunpcklqdq xmm14, xmm14, xmm13 - vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+rdx], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+rax] - vpinsrd xmm15, xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+rbp+r15], 1 + vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+rdx], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+rax] + vpinsrd xmm15, xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+rbp+r15], 1 vpunpcklqdq xmm13, xmm13, xmm15 vinsertf128 ymm14, ymm14, xmm13, 1 vfmadd213ps ymm0, ymm1, ymm14 @@ -904,19 +904,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbp*4] lea rdx, QWORD PTR [64+r13+rbp*4] - call __svml_scosh_ha_cout_rare_internal + call __jsvml_scosh_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_coshf8_ha_l9 ENDP +__jsvml_coshf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf8_ha_l9_B1_B3: +_unwind___jsvml_coshf8_ha_l9_B1_B3: DD 866561 DD 4248633 DD 2021425 @@ -933,13 +933,13 @@ _unwind___svml_coshf8_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_coshf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_coshf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf8_ha_l9_B6_B10: +_unwind___jsvml_coshf8_ha_l9_B6_B10: DD 931873 DD 182328 DD 309298 @@ -950,7 +950,7 @@ _unwind___svml_coshf8_ha_l9_B6_B10: DD 944137 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_coshf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_coshf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -959,7 +959,7 @@ _unwind___svml_coshf8_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_coshf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_coshf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -973,9 +973,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_coshf4_ha_ex + PUBLIC __jsvml_coshf4_ha_ex -__svml_coshf4_ha_ex PROC EXPORT +__jsvml_coshf4_ha_ex PROC EXPORT _B5_1:: @@ -992,27 +992,27 @@ L109:: movups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm1, XMMWORD PTR [__svml_scosh_ha_data_internal+1024] + movups xmm1, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1024] and r13, -64 - movups xmm7, XMMWORD PTR [__svml_scosh_ha_data_internal+768] + movups xmm7, XMMWORD PTR [__jsvml_scosh_ha_data_internal+768] andnps xmm1, xmm0 mulps xmm7, xmm1 movaps xmm2, xmm1 - movups xmm4, XMMWORD PTR [__svml_scosh_ha_data_internal+1280] - movups xmm6, XMMWORD PTR [__svml_scosh_ha_data_internal+896] + movups xmm4, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1280] + movups xmm6, XMMWORD PTR [__jsvml_scosh_ha_data_internal+896] addps xmm7, xmm4 movaps xmm3, xmm7 subps xmm7, xmm4 - movdqu xmm15, XMMWORD PTR [__svml_scosh_ha_data_internal+1344] + movdqu xmm15, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1344] pxor xmm3, xmm4 - pcmpgtd xmm2, XMMWORD PTR [__svml_scosh_ha_data_internal+1408] + pcmpgtd xmm2, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1408] mulps xmm6, xmm7 movmskps ecx, xmm2 movdqa xmm2, xmm15 subps xmm1, xmm6 psubd xmm2, xmm3 psrld xmm2, 28 - movups xmm5, XMMWORD PTR [__svml_scosh_ha_data_internal+960] + movups xmm5, XMMWORD PTR [__jsvml_scosh_ha_data_internal+960] pslld xmm2, 4 mulps xmm5, xmm7 por xmm2, xmm3 @@ -1029,39 +1029,39 @@ L109:: movd eax, xmm5 movd r8d, xmm6 movd r9d, xmm15 - movd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+rdx] - movd xmm7, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+rax] - movd xmm6, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+r8] - movd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+r9] + movd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+rdx] + movd xmm7, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+rax] + movd xmm6, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+r8] + movd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+r9] punpckldq xmm15, xmm7 punpckldq xmm6, xmm5 - movd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+r9] + movd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+r9] unpcklpd xmm15, xmm6 - movd xmm7, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+rdx] - movd xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+rax] - movd xmm6, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+r8] + movd xmm7, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+rdx] + movd xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+rax] + movd xmm6, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+r8] punpckldq xmm7, xmm4 punpckldq xmm6, xmm5 punpcklqdq xmm7, xmm6 movaps xmm6, xmm15 mulps xmm7, xmm1 addps xmm6, xmm15 - movd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+rdx] + movd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+rdx] addps xmm15, xmm7 mulps xmm15, xmm1 - movd xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+rax] + movd xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+rax] punpckldq xmm5, xmm4 - movd xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+r8] - movd xmm7, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+r9] + movd xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+r8] + movd xmm7, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+r9] punpckldq xmm4, xmm7 punpcklqdq xmm5, xmm4 - movd xmm4, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+rdx] + movd xmm4, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+rdx] addps xmm5, xmm15 mulps xmm1, xmm5 - movd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+rax] + movd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+rax] punpckldq xmm4, xmm15 - movd xmm15, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+r8] - movd xmm7, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+r9] + movd xmm15, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+r8] + movd xmm7, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+r9] punpckldq xmm15, xmm7 punpcklqdq xmm4, xmm15 mov QWORD PTR [248+rsp], r13 @@ -1120,19 +1120,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scosh_ha_cout_rare_internal + call __jsvml_scosh_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_coshf4_ha_ex ENDP +__jsvml_coshf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf4_ha_ex_B1_B3: +_unwind___jsvml_coshf4_ha_ex_B1_B3: DD 668417 DD 2020403 DD 878635 @@ -1147,19 +1147,19 @@ _unwind___svml_coshf4_ha_ex_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_coshf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_coshf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf4_ha_ex_B6_B10: +_unwind___jsvml_coshf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_coshf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_coshf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1168,7 +1168,7 @@ _unwind___svml_coshf4_ha_ex_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_coshf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_coshf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1182,9 +1182,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_coshf4_ha_e9 + PUBLIC __jsvml_coshf4_ha_e9 -__svml_coshf4_ha_e9 PROC EXPORT +__jsvml_coshf4_ha_e9 PROC EXPORT _B6_1:: @@ -1201,58 +1201,58 @@ L122:: vmovups XMMWORD PTR [208+rsp], xmm6 mov QWORD PTR [224+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm2, XMMWORD PTR [__svml_scosh_ha_data_internal+1024] + vmovups xmm2, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1024] and r13, -64 vandnps xmm4, xmm2, xmm3 - vmulps xmm2, xmm4, XMMWORD PTR [__svml_scosh_ha_data_internal+768] - vmovups xmm11, XMMWORD PTR [__svml_scosh_ha_data_internal+1280] - vmovups xmm1, XMMWORD PTR [__svml_scosh_ha_data_internal+1344] + vmulps xmm2, xmm4, XMMWORD PTR [__jsvml_scosh_ha_data_internal+768] + vmovups xmm11, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1280] + vmovups xmm1, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1344] vaddps xmm0, xmm11, xmm2 vxorps xmm2, xmm0, xmm11 vsubps xmm11, xmm0, xmm11 - vpcmpgtd xmm6, xmm4, XMMWORD PTR [__svml_scosh_ha_data_internal+1408] + vpcmpgtd xmm6, xmm4, XMMWORD PTR [__jsvml_scosh_ha_data_internal+1408] vpsubd xmm5, xmm1, xmm2 vmovmskps ecx, xmm6 vpsrld xmm6, xmm5, 28 vpslld xmm5, xmm6, 4 vpor xmm6, xmm5, xmm2 - vmulps xmm0, xmm11, XMMWORD PTR [__svml_scosh_ha_data_internal+896] + vmulps xmm0, xmm11, XMMWORD PTR [__jsvml_scosh_ha_data_internal+896] vpand xmm1, xmm6, xmm1 vpslld xmm6, xmm1, 4 vpsubd xmm1, xmm2, xmm1 vmovd edx, xmm6 vpslld xmm1, xmm1, 19 vsubps xmm4, xmm4, xmm0 - vmulps xmm0, xmm11, XMMWORD PTR [__svml_scosh_ha_data_internal+960] + vmulps xmm0, xmm11, XMMWORD PTR [__jsvml_scosh_ha_data_internal+960] vpextrd r8d, xmm6, 2 vsubps xmm4, xmm4, xmm0 vpextrd eax, xmm6, 1 vpextrd r9d, xmm6, 3 - vmovd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+rdx] - vmovd xmm11, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+r8] - vpinsrd xmm0, xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+rax], 1 - vpinsrd xmm6, xmm11, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1480+r10+r9], 1 - vmovd xmm11, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+rdx] + vmovd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+rdx] + vmovd xmm11, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+r8] + vpinsrd xmm0, xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+rax], 1 + vpinsrd xmm6, xmm11, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1480+r10+r9], 1 + vmovd xmm11, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+rdx] vunpcklpd xmm5, xmm0, xmm6 - vmovd xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+r8] - vpinsrd xmm6, xmm11, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+rax], 1 - vpinsrd xmm11, xmm0, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1484+r10+r9], 1 + vmovd xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+r8] + vpinsrd xmm6, xmm11, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+rax], 1 + vpinsrd xmm11, xmm0, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1484+r10+r9], 1 vaddps xmm0, xmm5, xmm5 vpunpcklqdq xmm6, xmm6, xmm11 vmulps xmm11, xmm6, xmm4 mov QWORD PTR [232+rsp], r13 vaddps xmm6, xmm5, xmm11 - vmovd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+rdx] - vpinsrd xmm11, xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+rax], 1 + vmovd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+rdx] + vpinsrd xmm11, xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+rax], 1 vmulps xmm6, xmm4, xmm6 - vmovd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+r8] - vpinsrd xmm5, xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1476+r10+r9], 1 + vmovd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+r8] + vpinsrd xmm5, xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1476+r10+r9], 1 vpunpcklqdq xmm11, xmm11, xmm5 - vmovd xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+rdx] + vmovd xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+rdx] vaddps xmm6, xmm11, xmm6 - vpinsrd xmm5, xmm5, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+rax], 1 - vmovd xmm11, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+r8] - vpinsrd xmm11, xmm11, DWORD PTR [imagerel(__svml_scosh_ha_data_internal)+1472+r10+r9], 1 + vpinsrd xmm5, xmm5, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+rax], 1 + vmovd xmm11, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+r8] + vpinsrd xmm11, xmm11, DWORD PTR [imagerel(__jsvml_scosh_ha_data_internal)+1472+r10+r9], 1 vmulps xmm4, xmm4, xmm6 vpunpcklqdq xmm5, xmm5, xmm11 vaddps xmm4, xmm5, xmm4 @@ -1305,19 +1305,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_scosh_ha_cout_rare_internal + call __jsvml_scosh_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_coshf4_ha_e9 ENDP +__jsvml_coshf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf4_ha_e9_B1_B3: +_unwind___jsvml_coshf4_ha_e9_B1_B3: DD 536577 DD 1889328 DD 878632 @@ -1331,19 +1331,19 @@ _unwind___svml_coshf4_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_coshf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_coshf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_coshf4_ha_e9_B6_B10: +_unwind___jsvml_coshf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_coshf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_coshf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1352,7 +1352,7 @@ _unwind___svml_coshf4_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_coshf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_coshf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1366,9 +1366,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_scosh_ha_cout_rare_internal + PUBLIC __jsvml_scosh_ha_cout_rare_internal -__svml_scosh_ha_cout_rare_internal PROC +__jsvml_scosh_ha_cout_rare_internal PROC _B7_1:: @@ -1617,13 +1617,13 @@ _B7_12:: _B7_13:: -__svml_scosh_ha_cout_rare_internal ENDP +__jsvml_scosh_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_scosh_ha_cout_rare_internal_B1_B12: +_unwind___jsvml_scosh_ha_cout_rare_internal_B1_B12: DD 535297 DD 432171 DD 518181 @@ -1637,7 +1637,7 @@ _unwind___svml_scosh_ha_cout_rare_internal_B1_B12: DD imagerel _B7_1 DD imagerel _B7_13 - DD imagerel _unwind___svml_scosh_ha_cout_rare_internal_B1_B12 + DD imagerel _unwind___jsvml_scosh_ha_cout_rare_internal_B1_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1645,8 +1645,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_scosh_ha_data_internal -__svml_scosh_ha_data_internal DD 1056964608 + PUBLIC __jsvml_scosh_ha_data_internal +__jsvml_scosh_ha_data_internal DD 1056964608 DD 1057148295 DD 1057336003 DD 1057527823 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_exp_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_exp_windows_x86.S similarity index 83% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_exp_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_exp_windows_x86.S index 608f0119679..533c26ef33a 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_exp_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_exp_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expf4_ha_l9 + PUBLIC __jsvml_expf4_ha_l9 -__svml_expf4_ha_l9 PROC EXPORT +__jsvml_expf4_ha_l9 PROC EXPORT _B1_1:: @@ -54,28 +54,28 @@ L1:: vmovups XMMWORD PTR [192+rsp], xmm14 mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm14, XMMWORD PTR [__svml_sexp_ha_data_internal] + vmovups xmm14, XMMWORD PTR [__jsvml_sexp_ha_data_internal] and r13, -64 - vmovups xmm4, XMMWORD PTR [__svml_sexp_ha_data_internal+64] + vmovups xmm4, XMMWORD PTR [__jsvml_sexp_ha_data_internal+64] vfmadd213ps xmm14, xmm5, xmm4 - vmovups xmm2, XMMWORD PTR [__svml_sexp_ha_data_internal+256] - vandps xmm3, xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+128] - vmovups xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+384] - vcmpnleps xmm1, xmm3, XMMWORD PTR [__svml_sexp_ha_data_internal+192] + vmovups xmm2, XMMWORD PTR [__jsvml_sexp_ha_data_internal+256] + vandps xmm3, xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+128] + vmovups xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+384] + vcmpnleps xmm1, xmm3, XMMWORD PTR [__jsvml_sexp_ha_data_internal+192] vsubps xmm4, xmm14, xmm4 vmovmskps edx, xmm1 - vmovups xmm1, XMMWORD PTR [__svml_sexp_ha_data_internal+448] + vmovups xmm1, XMMWORD PTR [__jsvml_sexp_ha_data_internal+448] vfnmadd213ps xmm2, xmm4, xmm5 - vfnmadd132ps xmm4, xmm2, XMMWORD PTR [__svml_sexp_ha_data_internal+320] + vfnmadd132ps xmm4, xmm2, XMMWORD PTR [__jsvml_sexp_ha_data_internal+320] vpermilps xmm3, xmm0, xmm14 - vmovups xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+512] - vfmadd213ps xmm0, xmm4, XMMWORD PTR [__svml_sexp_ha_data_internal+576] + vmovups xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+512] + vfmadd213ps xmm0, xmm4, XMMWORD PTR [__jsvml_sexp_ha_data_internal+576] vmulps xmm2, xmm4, xmm4 - vfmadd213ps xmm0, xmm4, XMMWORD PTR [__svml_sexp_ha_data_internal+640] + vfmadd213ps xmm0, xmm4, XMMWORD PTR [__jsvml_sexp_ha_data_internal+640] vfmadd213ps xmm0, xmm2, xmm3 vpermilps xmm1, xmm1, xmm14 vpslld xmm14, xmm14, 21 - vandps xmm14, xmm14, XMMWORD PTR [__svml_sexp_ha_data_internal+704] + vandps xmm14, xmm14, XMMWORD PTR [__jsvml_sexp_ha_data_internal+704] vaddps xmm0, xmm4, xmm0 vmulps xmm2, xmm1, xmm14 mov QWORD PTR [216+rsp], r13 @@ -92,8 +92,8 @@ _B1_2:: _B1_3:: - vcmpgtps xmm1, xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+2560] - vcmpltps xmm2, xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+2624] + vcmpgtps xmm1, xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2560] + vcmpltps xmm2, xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2624] vblendvps xmm0, xmm0, XMMWORD PTR [_2il0floatpacket_37], xmm1 vorps xmm3, xmm1, xmm2 vmovmskps eax, xmm3 @@ -138,19 +138,19 @@ _B1_11:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexp_ha_cout_rare_internal + call __jsvml_sexp_ha_cout_rare_internal jmp _B1_9 ALIGN 16 _B1_12:: -__svml_expf4_ha_l9 ENDP +__jsvml_expf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf4_ha_l9_B1_B4: +_unwind___jsvml_expf4_ha_l9_B1_B4: DD 401409 DD 1758240 DD 845848 @@ -163,13 +163,13 @@ _unwind___svml_expf4_ha_l9_B1_B4: DD imagerel _B1_1 DD imagerel _B1_7 - DD imagerel _unwind___svml_expf4_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_expf4_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf4_ha_l9_B7_B11: +_unwind___jsvml_expf4_ha_l9_B7_B11: DD 658945 DD 287758 DD 340999 @@ -184,7 +184,7 @@ _unwind___svml_expf4_ha_l9_B7_B11: DD imagerel _B1_7 DD imagerel _B1_12 - DD imagerel _unwind___svml_expf4_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_expf4_ha_l9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -198,9 +198,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expf4_ha_e9 + PUBLIC __jsvml_expf4_ha_e9 -__svml_expf4_ha_e9 PROC EXPORT +__jsvml_expf4_ha_e9 PROC EXPORT _B2_1:: @@ -214,29 +214,29 @@ L10:: vmovups XMMWORD PTR [192+rsp], xmm9 mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmulps xmm3, xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal] + vmulps xmm3, xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal] and r13, -64 vroundps xmm3, xmm3, 0 - vmulps xmm4, xmm3, XMMWORD PTR [__svml_sexp_ha_data_internal+256] - vaddps xmm9, xmm3, XMMWORD PTR [__svml_sexp_ha_data_internal+64] - vmulps xmm3, xmm3, XMMWORD PTR [__svml_sexp_ha_data_internal+320] + vmulps xmm4, xmm3, XMMWORD PTR [__jsvml_sexp_ha_data_internal+256] + vaddps xmm9, xmm3, XMMWORD PTR [__jsvml_sexp_ha_data_internal+64] + vmulps xmm3, xmm3, XMMWORD PTR [__jsvml_sexp_ha_data_internal+320] vsubps xmm5, xmm0, xmm4 - vandps xmm1, xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+128] - vcmpnleps xmm2, xmm1, XMMWORD PTR [__svml_sexp_ha_data_internal+192] + vandps xmm1, xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+128] + vcmpnleps xmm2, xmm1, XMMWORD PTR [__jsvml_sexp_ha_data_internal+192] vsubps xmm1, xmm5, xmm3 vmovmskps eax, xmm2 - vmovups xmm4, XMMWORD PTR [__svml_sexp_ha_data_internal+448] - vmovups xmm2, XMMWORD PTR [__svml_sexp_ha_data_internal+384] - vmulps xmm5, xmm1, XMMWORD PTR [__svml_sexp_ha_data_internal+512] + vmovups xmm4, XMMWORD PTR [__jsvml_sexp_ha_data_internal+448] + vmovups xmm2, XMMWORD PTR [__jsvml_sexp_ha_data_internal+384] + vmulps xmm5, xmm1, XMMWORD PTR [__jsvml_sexp_ha_data_internal+512] vpermilps xmm3, xmm4, xmm9 vmulps xmm4, xmm1, xmm1 - vaddps xmm5, xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+576] + vaddps xmm5, xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+576] vmulps xmm5, xmm1, xmm5 vpermilps xmm2, xmm2, xmm9 vpslld xmm9, xmm9, 21 - vandps xmm9, xmm9, XMMWORD PTR [__svml_sexp_ha_data_internal+704] + vandps xmm9, xmm9, XMMWORD PTR [__jsvml_sexp_ha_data_internal+704] mov QWORD PTR [216+rsp], r13 - vaddps xmm5, xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+640] + vaddps xmm5, xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+640] vmulps xmm4, xmm4, xmm5 vaddps xmm2, xmm2, xmm4 vaddps xmm1, xmm1, xmm2 @@ -256,8 +256,8 @@ _B2_2:: _B2_3:: - vcmpgtps xmm2, xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+2560] - vcmpltps xmm3, xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+2624] + vcmpgtps xmm2, xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2560] + vcmpltps xmm3, xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2624] vblendvps xmm1, xmm1, XMMWORD PTR [_2il0floatpacket_37], xmm2 vorps xmm4, xmm2, xmm3 vmovmskps edx, xmm4 @@ -303,19 +303,19 @@ _B2_11:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexp_ha_cout_rare_internal + call __jsvml_sexp_ha_cout_rare_internal jmp _B2_9 ALIGN 16 _B2_12:: -__svml_expf4_ha_e9 ENDP +__jsvml_expf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf4_ha_e9_B1_B4: +_unwind___jsvml_expf4_ha_e9_B1_B4: DD 400385 DD 1758236 DD 825364 @@ -328,13 +328,13 @@ _unwind___svml_expf4_ha_e9_B1_B4: DD imagerel _B2_1 DD imagerel _B2_7 - DD imagerel _unwind___svml_expf4_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_expf4_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf4_ha_e9_B7_B11: +_unwind___jsvml_expf4_ha_e9_B7_B11: DD 658945 DD 287758 DD 340999 @@ -349,7 +349,7 @@ _unwind___svml_expf4_ha_e9_B7_B11: DD imagerel _B2_7 DD imagerel _B2_12 - DD imagerel _unwind___svml_expf4_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_expf4_ha_e9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -363,9 +363,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expf8_ha_l9 + PUBLIC __jsvml_expf8_ha_l9 -__svml_expf8_ha_l9 PROC EXPORT +__jsvml_expf8_ha_l9 PROC EXPORT _B3_1:: @@ -379,30 +379,30 @@ L19:: vmovups YMMWORD PTR [496+rsp], ymm14 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [399+rsp] - vmovups ymm14, YMMWORD PTR [__svml_sexp_ha_data_internal] + vmovups ymm14, YMMWORD PTR [__jsvml_sexp_ha_data_internal] and r13, -64 - vmovups ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+64] - vmovups ymm2, YMMWORD PTR [__svml_sexp_ha_data_internal+256] + vmovups ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+64] + vmovups ymm2, YMMWORD PTR [__jsvml_sexp_ha_data_internal+256] vmovdqa ymm5, ymm0 vfmadd213ps ymm14, ymm5, ymm4 - vmovups ymm0, YMMWORD PTR [__svml_sexp_ha_data_internal+448] + vmovups ymm0, YMMWORD PTR [__jsvml_sexp_ha_data_internal+448] vsubps ymm4, ymm14, ymm4 - vandps ymm1, ymm5, YMMWORD PTR [__svml_sexp_ha_data_internal+128] - vcmpnle_uqps ymm3, ymm1, YMMWORD PTR [__svml_sexp_ha_data_internal+192] + vandps ymm1, ymm5, YMMWORD PTR [__jsvml_sexp_ha_data_internal+128] + vcmpnle_uqps ymm3, ymm1, YMMWORD PTR [__jsvml_sexp_ha_data_internal+192] vfnmadd213ps ymm2, ymm4, ymm5 - vmovups ymm1, YMMWORD PTR [__svml_sexp_ha_data_internal+384] - vfnmadd132ps ymm4, ymm2, YMMWORD PTR [__svml_sexp_ha_data_internal+320] + vmovups ymm1, YMMWORD PTR [__jsvml_sexp_ha_data_internal+384] + vfnmadd132ps ymm4, ymm2, YMMWORD PTR [__jsvml_sexp_ha_data_internal+320] vmovmskps edx, ymm3 vpermilps ymm3, ymm1, ymm14 test edx, edx - vmovups ymm1, YMMWORD PTR [__svml_sexp_ha_data_internal+512] - vfmadd213ps ymm1, ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+576] - vfmadd213ps ymm1, ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+640] + vmovups ymm1, YMMWORD PTR [__jsvml_sexp_ha_data_internal+512] + vfmadd213ps ymm1, ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+576] + vfmadd213ps ymm1, ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+640] vpermilps ymm2, ymm0, ymm14 vmulps ymm0, ymm4, ymm4 vpslld ymm14, ymm14, 21 vfmadd213ps ymm1, ymm0, ymm3 - vandps ymm14, ymm14, YMMWORD PTR [__svml_sexp_ha_data_internal+704] + vandps ymm14, ymm14, YMMWORD PTR [__jsvml_sexp_ha_data_internal+704] vmulps ymm2, ymm2, ymm14 vaddps ymm0, ymm4, ymm1 mov QWORD PTR [536+rsp], r13 @@ -418,8 +418,8 @@ _B3_2:: _B3_3:: - vcmpgt_oqps ymm1, ymm5, YMMWORD PTR [__svml_sexp_ha_data_internal+2560] - vcmplt_oqps ymm2, ymm5, YMMWORD PTR [__svml_sexp_ha_data_internal+2624] + vcmpgt_oqps ymm1, ymm5, YMMWORD PTR [__jsvml_sexp_ha_data_internal+2560] + vcmplt_oqps ymm2, ymm5, YMMWORD PTR [__jsvml_sexp_ha_data_internal+2624] vblendvps ymm0, ymm0, YMMWORD PTR [_2il0floatpacket_38], ymm1 vorps ymm3, ymm1, ymm2 vmovmskps eax, ymm3 @@ -483,19 +483,19 @@ _B3_11:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexp_ha_cout_rare_internal + call __jsvml_sexp_ha_cout_rare_internal jmp _B3_9 ALIGN 16 _B3_12:: -__svml_expf8_ha_l9 ENDP +__jsvml_expf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf8_ha_l9_B1_B4: +_unwind___jsvml_expf8_ha_l9_B1_B4: DD 400385 DD 4379676 DD 2091028 @@ -508,13 +508,13 @@ _unwind___svml_expf8_ha_l9_B1_B4: DD imagerel _B3_1 DD imagerel _B3_7 - DD imagerel _unwind___svml_expf8_ha_l9_B1_B4 + DD imagerel _unwind___jsvml_expf8_ha_l9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf8_ha_l9_B7_B11: +_unwind___jsvml_expf8_ha_l9_B7_B11: DD 1858561 DD 2647132 DD 2700370 @@ -538,7 +538,7 @@ _unwind___svml_expf8_ha_l9_B7_B11: DD imagerel _B3_7 DD imagerel _B3_12 - DD imagerel _unwind___svml_expf8_ha_l9_B7_B11 + DD imagerel _unwind___jsvml_expf8_ha_l9_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -552,9 +552,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expf16_ha_z0 + PUBLIC __jsvml_expf16_ha_z0 -__svml_expf16_ha_z0 PROC EXPORT +__jsvml_expf16_ha_z0 PROC EXPORT _B4_1:: @@ -564,34 +564,34 @@ _B4_1:: DB 250 L46:: - vmovups zmm4, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+256] - vmovups zmm1, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+320] - vmovups zmm2, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+384] - vmovups zmm3, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+448] - vmovups zmm22, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512] - vmovups zmm5, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+576] + vmovups zmm4, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+256] + vmovups zmm1, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+320] + vmovups zmm2, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+384] + vmovups zmm3, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+448] + vmovups zmm22, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512] + vmovups zmm5, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+576] vfmadd213ps zmm4, zmm0, zmm1 {rz-sae} - vmovups zmm24, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+640] - vmovups zmm26, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+128] + vmovups zmm24, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+640] + vmovups zmm26, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+128] vsubps zmm29, zmm4, zmm1 {rn-sae} - vpermt2ps zmm22, zmm4, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+64] - vpermt2ps zmm26, zmm4, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+192] + vpermt2ps zmm22, zmm4, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+64] + vpermt2ps zmm26, zmm4, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+192] vfnmadd231ps zmm0, zmm2, zmm29 {rn-sae} vfnmadd231ps zmm0, zmm3, zmm29 {rn-sae} - vandps zmm23, zmm0, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+512] + vandps zmm23, zmm0, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+512] vmulps zmm27, zmm23, zmm23 {rn-sae} vfmadd231ps zmm24, zmm5, zmm23 {rn-sae} vaddps zmm25, zmm22, zmm23 {rn-sae} vfmadd213ps zmm27, zmm24, zmm25 {rn-sae} vfmadd213ps zmm27, zmm26, zmm26 {rn-sae} - vandps zmm28, zmm27, ZMMWORD PTR [__svml_sexp_ha_data_internal_avx512+704] + vandps zmm28, zmm27, ZMMWORD PTR [__jsvml_sexp_ha_data_internal_avx512+704] vscalefps zmm0, zmm28, zmm29 {rn-sae} ret ALIGN 16 _B4_2:: -__svml_expf16_ha_z0 ENDP +__jsvml_expf16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -605,9 +605,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expf8_ha_e9 + PUBLIC __jsvml_expf8_ha_e9 -__svml_expf8_ha_e9 PROC EXPORT +__jsvml_expf8_ha_e9 PROC EXPORT _B5_1:: @@ -624,29 +624,29 @@ L47:: lea r13, QWORD PTR [367+rsp] vmovaps ymm6, ymm0 and r13, -64 - vmulps ymm3, ymm6, YMMWORD PTR [__svml_sexp_ha_data_internal] - vandps ymm2, ymm6, YMMWORD PTR [__svml_sexp_ha_data_internal+128] - vcmpnle_uqps ymm5, ymm2, YMMWORD PTR [__svml_sexp_ha_data_internal+192] + vmulps ymm3, ymm6, YMMWORD PTR [__jsvml_sexp_ha_data_internal] + vandps ymm2, ymm6, YMMWORD PTR [__jsvml_sexp_ha_data_internal+128] + vcmpnle_uqps ymm5, ymm2, YMMWORD PTR [__jsvml_sexp_ha_data_internal+192] vroundps ymm4, ymm3, 0 vpxor xmm3, xmm3, xmm3 - vaddps ymm0, ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+64] + vaddps ymm0, ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+64] mov QWORD PTR [536+rsp], r13 vextractf128 xmm1, ymm5, 1 vpackssdw xmm10, xmm5, xmm1 - vmulps ymm5, ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+256] - vmulps ymm4, ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+320] + vmulps ymm5, ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+256] + vmulps ymm4, ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+320] vpacksswb xmm2, xmm10, xmm3 - vmovups ymm10, YMMWORD PTR [__svml_sexp_ha_data_internal+384] + vmovups ymm10, YMMWORD PTR [__jsvml_sexp_ha_data_internal+384] vsubps ymm1, ymm6, ymm5 vpmovmskb edx, xmm2 vsubps ymm3, ymm1, ymm4 - vmovups ymm4, YMMWORD PTR [__svml_sexp_ha_data_internal+448] - vmulps ymm5, ymm3, YMMWORD PTR [__svml_sexp_ha_data_internal+512] - vaddps ymm1, ymm5, YMMWORD PTR [__svml_sexp_ha_data_internal+576] + vmovups ymm4, YMMWORD PTR [__jsvml_sexp_ha_data_internal+448] + vmulps ymm5, ymm3, YMMWORD PTR [__jsvml_sexp_ha_data_internal+512] + vaddps ymm1, ymm5, YMMWORD PTR [__jsvml_sexp_ha_data_internal+576] vmulps ymm5, ymm3, ymm3 vpermilps ymm2, ymm10, ymm0 vmulps ymm10, ymm3, ymm1 - vaddps ymm1, ymm10, YMMWORD PTR [__svml_sexp_ha_data_internal+640] + vaddps ymm1, ymm10, YMMWORD PTR [__jsvml_sexp_ha_data_internal+640] vmulps ymm1, ymm5, ymm1 vaddps ymm2, ymm2, ymm1 vaddps ymm3, ymm3, ymm2 @@ -657,7 +657,7 @@ L47:: vextractf128 xmm0, ymm0, 1 vpslld xmm0, xmm0, 21 vinsertf128 ymm10, ymm10, xmm0, 1 - vandps ymm10, ymm10, YMMWORD PTR [__svml_sexp_ha_data_internal+704] + vandps ymm10, ymm10, YMMWORD PTR [__jsvml_sexp_ha_data_internal+704] vmulps ymm0, ymm10, ymm4 test dl, dl jne _B5_12 @@ -730,13 +730,13 @@ _B5_11:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexp_ha_cout_rare_internal + call __jsvml_sexp_ha_cout_rare_internal jmp _B5_9 _B5_12:: - vcmpgt_oqps ymm1, ymm6, YMMWORD PTR [__svml_sexp_ha_data_internal+2560] - vcmplt_oqps ymm2, ymm6, YMMWORD PTR [__svml_sexp_ha_data_internal+2624] + vcmpgt_oqps ymm1, ymm6, YMMWORD PTR [__jsvml_sexp_ha_data_internal+2560] + vcmplt_oqps ymm2, ymm6, YMMWORD PTR [__jsvml_sexp_ha_data_internal+2624] vpxor xmm10, xmm10, xmm10 vblendvps ymm0, ymm0, YMMWORD PTR [_2il0floatpacket_38], ymm1 vorps ymm3, ymm1, ymm2 @@ -753,13 +753,13 @@ _B5_12:: _B5_13:: -__svml_expf8_ha_e9 ENDP +__jsvml_expf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf8_ha_e9_B1_B4: +_unwind___jsvml_expf8_ha_e9_B1_B4: DD 533761 DD 4379685 DD 1927197 @@ -773,13 +773,13 @@ _unwind___svml_expf8_ha_e9_B1_B4: DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_expf8_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_expf8_ha_e9_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf8_ha_e9_B7_B11: +_unwind___jsvml_expf8_ha_e9_B7_B11: DD 1332001 DD 2384979 DD 2438217 @@ -793,7 +793,7 @@ _unwind___svml_expf8_ha_e9_B7_B11: DD 1079307 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_expf8_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_expf8_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -802,17 +802,17 @@ _unwind___svml_expf8_ha_e9_B7_B11: DD imagerel _B5_7 DD imagerel _B5_12 - DD imagerel _unwind___svml_expf8_ha_e9_B7_B11 + DD imagerel _unwind___jsvml_expf8_ha_e9_B7_B11 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf8_ha_e9_B12_B12: +_unwind___jsvml_expf8_ha_e9_B12_B12: DD 33 DD imagerel _B5_1 DD imagerel _B5_7 - DD imagerel _unwind___svml_expf8_ha_e9_B1_B4 + DD imagerel _unwind___jsvml_expf8_ha_e9_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -821,7 +821,7 @@ _unwind___svml_expf8_ha_e9_B12_B12: DD imagerel _B5_12 DD imagerel _B5_13 - DD imagerel _unwind___svml_expf8_ha_e9_B12_B12 + DD imagerel _unwind___jsvml_expf8_ha_e9_B12_B12 .pdata ENDS _DATA SEGMENT 'DATA' @@ -835,9 +835,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expf4_ha_ex + PUBLIC __jsvml_expf4_ha_ex -__svml_expf4_ha_ex PROC EXPORT +__jsvml_expf4_ha_ex PROC EXPORT _B6_1:: @@ -855,31 +855,31 @@ L74:: movups XMMWORD PTR [208+rsp], xmm12 mov QWORD PTR [240+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+1792] + movups xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+1792] and r13, -64 mulps xmm0, xmm3 - movups xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+1856] - movdqu xmm13, XMMWORD PTR [__svml_sexp_ha_data_internal+2432] + movups xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+1856] + movdqu xmm13, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2432] addps xmm0, xmm5 pand xmm13, xmm3 movaps xmm4, xmm0 - pcmpgtd xmm13, XMMWORD PTR [__svml_sexp_ha_data_internal+2496] + pcmpgtd xmm13, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2496] subps xmm4, xmm5 movmskps edx, xmm13 - movdqu xmm13, XMMWORD PTR [__svml_sexp_ha_data_internal+2176] + movdqu xmm13, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2176] pand xmm13, xmm0 pslld xmm13, 3 pshufd xmm14, xmm13, 1 movd ecx, xmm13 movd r8d, xmm14 - movups xmm2, XMMWORD PTR [__svml_sexp_ha_data_internal+1920] - movups xmm1, XMMWORD PTR [__svml_sexp_ha_data_internal+1984] + movups xmm2, XMMWORD PTR [__jsvml_sexp_ha_data_internal+1920] + movups xmm1, XMMWORD PTR [__jsvml_sexp_ha_data_internal+1984] movsxd rcx, ecx movsxd r8, r8d mulps xmm2, xmm4 mulps xmm1, xmm4 - movq xmm5, QWORD PTR [imagerel(__svml_sexp_ha_data_internal)+768+rax+rcx] - movq xmm14, QWORD PTR [imagerel(__svml_sexp_ha_data_internal)+768+rax+r8] + movq xmm5, QWORD PTR [imagerel(__jsvml_sexp_ha_data_internal)+768+rax+rcx] + movq xmm14, QWORD PTR [imagerel(__jsvml_sexp_ha_data_internal)+768+rax+r8] unpcklps xmm5, xmm14 movaps xmm14, xmm3 pshufd xmm12, xmm13, 2 @@ -890,20 +890,20 @@ L74:: movd r10d, xmm13 movaps xmm1, xmm14 mulps xmm1, xmm14 - mulps xmm1, XMMWORD PTR [__svml_sexp_ha_data_internal+2368] + mulps xmm1, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2368] movsxd r9, r9d addps xmm14, xmm1 movsxd r10, r10d - movq xmm12, QWORD PTR [imagerel(__svml_sexp_ha_data_internal)+768+rax+r9] - paddd xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+2048] + movq xmm12, QWORD PTR [imagerel(__jsvml_sexp_ha_data_internal)+768+rax+r9] + paddd xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2048] pslld xmm0, 16 - movq xmm13, QWORD PTR [imagerel(__svml_sexp_ha_data_internal)+768+rax+r10] + movq xmm13, QWORD PTR [imagerel(__jsvml_sexp_ha_data_internal)+768+rax+r10] unpcklps xmm12, xmm13 movaps xmm13, xmm5 movlhps xmm13, xmm12 mulps xmm14, xmm13 shufps xmm5, xmm12, 238 - pand xmm0, XMMWORD PTR [__svml_sexp_ha_data_internal+2112] + pand xmm0, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2112] addps xmm5, xmm14 mov QWORD PTR [248+rsp], r13 addps xmm13, xmm5 @@ -922,10 +922,10 @@ _B6_2:: _B6_3:: - movups xmm12, XMMWORD PTR [__svml_sexp_ha_data_internal+2560] + movups xmm12, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2560] movaps xmm5, xmm3 mov eax, 2139095040 - cmpltps xmm5, XMMWORD PTR [__svml_sexp_ha_data_internal+2624] + cmpltps xmm5, XMMWORD PTR [__jsvml_sexp_ha_data_internal+2624] cmpltps xmm12, xmm3 movd xmm1, eax movaps xmm4, xmm12 @@ -981,19 +981,19 @@ _B6_11:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexp_ha_cout_rare_internal + call __jsvml_sexp_ha_cout_rare_internal jmp _B6_9 ALIGN 16 _B6_12:: -__svml_expf4_ha_ex ENDP +__jsvml_expf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf4_ha_ex_B1_B4: +_unwind___jsvml_expf4_ha_ex_B1_B4: DD 669697 DD 2020408 DD 903216 @@ -1008,19 +1008,19 @@ _unwind___svml_expf4_ha_ex_B1_B4: DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_expf4_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_expf4_ha_ex_B1_B4 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expf4_ha_ex_B7_B11: +_unwind___jsvml_expf4_ha_ex_B7_B11: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_7 - DD imagerel _unwind___svml_expf4_ha_ex_B1_B4 + DD imagerel _unwind___jsvml_expf4_ha_ex_B1_B4 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1029,7 +1029,7 @@ _unwind___svml_expf4_ha_ex_B7_B11: DD imagerel _B6_7 DD imagerel _B6_12 - DD imagerel _unwind___svml_expf4_ha_ex_B7_B11 + DD imagerel _unwind___jsvml_expf4_ha_ex_B7_B11 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1043,9 +1043,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sexp_ha_cout_rare_internal + PUBLIC __jsvml_sexp_ha_cout_rare_internal -__svml_sexp_ha_cout_rare_internal PROC +__jsvml_sexp_ha_cout_rare_internal PROC _B7_1:: @@ -1300,13 +1300,13 @@ _B7_20:: _B7_21:: -__svml_sexp_ha_cout_rare_internal ENDP +__jsvml_sexp_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sexp_ha_cout_rare_internal_B1_B20: +_unwind___jsvml_sexp_ha_cout_rare_internal_B1_B20: DD 67585 DD 49672 @@ -1317,7 +1317,7 @@ _unwind___svml_sexp_ha_cout_rare_internal_B1_B20: DD imagerel _B7_1 DD imagerel _B7_21 - DD imagerel _unwind___svml_sexp_ha_cout_rare_internal_B1_B20 + DD imagerel _unwind___jsvml_sexp_ha_cout_rare_internal_B1_B20 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1325,8 +1325,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_sexp_ha_data_internal_avx512 -__svml_sexp_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_sexp_ha_data_internal_avx512 +__jsvml_sexp_ha_data_internal_avx512 DD 0 DD 3007986186 DD 860277610 DD 3010384254 @@ -1566,8 +1566,8 @@ __svml_sexp_ha_data_internal_avx512 DD 0 DD 124 DD 124 DD 124 - PUBLIC __svml_sexp_ha_data_internal -__svml_sexp_ha_data_internal DD 1085844027 + PUBLIC __jsvml_sexp_ha_data_internal +__jsvml_sexp_ha_data_internal DD 1085844027 DD 1085844027 DD 1085844027 DD 1085844027 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_expm1_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_expm1_windows_x86.S similarity index 83% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_expm1_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_expm1_windows_x86.S index cbb0b09a82f..c7fccdcb129 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_expm1_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_expm1_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm1f4_ha_e9 + PUBLIC __jsvml_expm1f4_ha_e9 -__svml_expm1f4_ha_e9 PROC EXPORT +__jsvml_expm1f4_ha_e9 PROC EXPORT _B1_1:: @@ -60,18 +60,18 @@ L1:: vmovaps xmm10, xmm0 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm4, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1280] + vmovups xmm4, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1280] and r13, -64 vandps xmm11, xmm10, xmm4 - vmulps xmm14, xmm10, XMMWORD PTR [__svml_sexpm1_ha_data_internal+768] - vcmpnleps xmm13, xmm11, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1344] + vmulps xmm14, xmm10, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+768] + vcmpnleps xmm13, xmm11, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1344] vroundps xmm14, xmm14, 0 vmovmskps edx, xmm13 - vaddps xmm13, xmm14, XMMWORD PTR [__svml_sexpm1_ha_data_internal+960] - vmulps xmm5, xmm14, XMMWORD PTR [__svml_sexpm1_ha_data_internal+832] - vmulps xmm2, xmm14, XMMWORD PTR [__svml_sexpm1_ha_data_internal+896] + vaddps xmm13, xmm14, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+960] + vmulps xmm5, xmm14, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+832] + vmulps xmm2, xmm14, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+896] vsubps xmm3, xmm10, xmm5 - vandps xmm12, xmm13, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1024] + vandps xmm12, xmm13, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1024] vandnps xmm5, xmm4, xmm10 vmovd ecx, xmm12 vsubps xmm1, xmm3, xmm2 @@ -83,28 +83,28 @@ L1:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovq xmm14, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - vmovq xmm15, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] - vmovq xmm12, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r10] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r10] vunpcklps xmm15, xmm14, xmm15 vunpcklps xmm11, xmm11, xmm12 - vandps xmm13, xmm13, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1088] + vandps xmm13, xmm13, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1088] vmovlhps xmm14, xmm15, xmm11 vpslld xmm12, xmm13, 14 vshufps xmm15, xmm15, xmm11, 238 vorps xmm13, xmm14, xmm12 vmulps xmm11, xmm15, xmm12 - vmulps xmm15, xmm1, XMMWORD PTR [__svml_sexpm1_ha_data_internal+512] + vmulps xmm15, xmm1, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+512] vmulps xmm12, xmm1, xmm1 - vaddps xmm14, xmm15, XMMWORD PTR [__svml_sexpm1_ha_data_internal+576] - vorps xmm1, xmm0, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1152] + vaddps xmm14, xmm15, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+576] + vorps xmm1, xmm0, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1152] vandps xmm0, xmm3, xmm1 vmulps xmm14, xmm14, xmm12 vsubps xmm3, xmm3, xmm0 vmulps xmm15, xmm13, xmm0 vsubps xmm2, xmm3, xmm2 - vmovups xmm3, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1216] + vmovups xmm3, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1216] vaddps xmm1, xmm2, xmm14 vandps xmm2, xmm13, xmm4 vandps xmm4, xmm3, xmm4 @@ -178,19 +178,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexpm1_ha_cout_rare_internal + call __jsvml_sexpm1_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_expm1f4_ha_e9 ENDP +__jsvml_expm1f4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f4_ha_e9_B1_B3: +_unwind___jsvml_expm1f4_ha_e9_B1_B3: DD 1070081 DD 2413652 DD 1157192 @@ -208,19 +208,19 @@ _unwind___svml_expm1f4_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_expm1f4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm1f4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f4_ha_e9_B6_B10: +_unwind___jsvml_expm1f4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_expm1f4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm1f4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -229,7 +229,7 @@ _unwind___svml_expm1f4_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_expm1f4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_expm1f4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -243,9 +243,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm1f4_ha_ex + PUBLIC __jsvml_expm1f4_ha_ex -__svml_expm1f4_ha_ex PROC EXPORT +__jsvml_expm1f4_ha_ex PROC EXPORT _B2_1:: @@ -267,24 +267,24 @@ L20:: movups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm6, XMMWORD PTR [__svml_sexpm1_ha_data_internal+768] + movups xmm6, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+768] and r13, -64 mulps xmm6, xmm9 movups xmm5, XMMWORD PTR [_2il0floatpacket_29] - movups xmm14, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1280] + movups xmm14, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1280] addps xmm6, xmm5 andps xmm1, xmm14 movaps xmm8, xmm14 - cmpnleps xmm1, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1344] + cmpnleps xmm1, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1344] subps xmm6, xmm5 movmskps edx, xmm1 - movups xmm1, XMMWORD PTR [__svml_sexpm1_ha_data_internal+960] + movups xmm1, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+960] movaps xmm5, xmm9 - movups xmm2, XMMWORD PTR [__svml_sexpm1_ha_data_internal+832] + movups xmm2, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+832] andnps xmm8, xmm9 mulps xmm2, xmm6 addps xmm1, xmm6 - movdqu xmm15, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1024] + movdqu xmm15, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1024] subps xmm5, xmm2 pand xmm15, xmm1 movaps xmm3, xmm5 @@ -294,8 +294,8 @@ L20:: pshufd xmm2, xmm15, 2 pshufd xmm15, xmm15, 3 movd r8d, xmm4 - movups xmm0, XMMWORD PTR [__svml_sexpm1_ha_data_internal+896] - pand xmm1, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1088] + movups xmm0, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+896] + pand xmm1, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1088] movd r9d, xmm2 pslld xmm1, 14 movd r10d, xmm15 @@ -306,25 +306,25 @@ L20:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - movq xmm6, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - movq xmm4, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] - movq xmm2, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] - movq xmm15, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r10] + movq xmm6, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + movq xmm4, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] + movq xmm2, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] + movq xmm15, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r10] unpcklps xmm6, xmm4 unpcklps xmm2, xmm15 movaps xmm4, xmm6 movlhps xmm4, xmm2 shufps xmm6, xmm2, 238 orps xmm4, xmm1 - movups xmm2, XMMWORD PTR [__svml_sexpm1_ha_data_internal+512] + movups xmm2, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+512] mulps xmm2, xmm3 mulps xmm3, xmm3 mulps xmm6, xmm1 - addps xmm2, XMMWORD PTR [__svml_sexpm1_ha_data_internal+576] - orps xmm7, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1152] + addps xmm2, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+576] + orps xmm7, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1152] movaps xmm1, xmm4 andps xmm7, xmm5 - movups xmm15, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1216] + movups xmm15, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1216] subps xmm5, xmm7 mulps xmm2, xmm3 mulps xmm1, xmm7 @@ -414,19 +414,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexpm1_ha_cout_rare_internal + call __jsvml_sexpm1_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_expm1f4_ha_ex ENDP +__jsvml_expm1f4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f4_ha_ex_B1_B3: +_unwind___jsvml_expm1f4_ha_ex_B1_B3: DD 1070593 DD 2413654 DD 1009742 @@ -444,19 +444,19 @@ _unwind___svml_expm1f4_ha_ex_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_expm1f4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_expm1f4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f4_ha_ex_B6_B10: +_unwind___jsvml_expm1f4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_expm1f4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_expm1f4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -465,7 +465,7 @@ _unwind___svml_expm1f4_ha_ex_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_expm1f4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_expm1f4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -479,9 +479,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm1f8_ha_l9 + PUBLIC __jsvml_expm1f8_ha_l9 -__svml_expm1f8_ha_l9 PROC EXPORT +__jsvml_expm1f8_ha_l9 PROC EXPORT _B3_1:: @@ -507,23 +507,23 @@ L39:: lea r13, QWORD PTR [111+rsp] vmovdqa ymm13, ymm0 and r13, -64 - vmulps ymm1, ymm13, YMMWORD PTR [__svml_sexpm1_ha_data_internal+768] - vmovups ymm10, YMMWORD PTR [__svml_sexpm1_ha_data_internal+832] - vmovups ymm11, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1280] + vmulps ymm1, ymm13, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+768] + vmovups ymm10, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+832] + vmovups ymm11, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1280] vroundps ymm6, ymm1, 0 - vaddps ymm2, ymm6, YMMWORD PTR [__svml_sexpm1_ha_data_internal+960] - vmulps ymm9, ymm6, YMMWORD PTR [__svml_sexpm1_ha_data_internal+896] + vaddps ymm2, ymm6, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+960] + vmulps ymm9, ymm6, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+896] vfnmadd213ps ymm10, ymm6, ymm13 - vandps ymm4, ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1024] + vandps ymm4, ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1024] vandps ymm3, ymm13, ymm11 - vcmpnle_uqps ymm5, ymm3, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1344] + vcmpnle_uqps ymm5, ymm3, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1344] vcmpeqps ymm7, ymm10, ymm13 vsubps ymm8, ymm10, ymm9 - vandps ymm2, ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1088] + vandps ymm2, ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1088] vmovmskps edx, ymm5 vpslld ymm2, ymm2, 14 test edx, edx - vorps ymm7, ymm7, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1152] + vorps ymm7, ymm7, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1152] vandnps ymm12, ymm11, ymm13 mov QWORD PTR [536+rsp], r13 vmovd ecx, xmm4 @@ -534,10 +534,10 @@ L39:: movsxd r8, r8d movsxd r9, r9d vmovd r11d, xmm6 - vmovq xmm15, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - vmovq xmm0, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] vpextrd r10d, xmm4, 3 - vmovq xmm14, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] vpextrd ecx, xmm6, 1 vpextrd r8d, xmm6, 2 vpextrd r9d, xmm6, 3 @@ -546,11 +546,11 @@ L39:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovq xmm1, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r10] - vmovq xmm3, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r11] - vmovq xmm4, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] - vmovq xmm6, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r11] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] vunpcklps xmm14, xmm15, xmm14 vunpcklps xmm15, xmm0, xmm1 vunpcklps xmm0, xmm3, xmm5 @@ -561,9 +561,9 @@ L39:: vunpckhps ymm4, ymm3, ymm5 vorps ymm6, ymm6, ymm2 vmulps ymm4, ymm4, ymm2 - vmovups ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+512] - vmovups ymm1, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1216] - vfmadd213ps ymm2, ymm8, YMMWORD PTR [__svml_sexpm1_ha_data_internal+576] + vmovups ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+512] + vmovups ymm1, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1216] + vfmadd213ps ymm2, ymm8, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+576] vmulps ymm8, ymm8, ymm8 vandps ymm15, ymm10, ymm7 vsubps ymm10, ymm10, ymm15 @@ -643,19 +643,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexpm1_ha_cout_rare_internal + call __jsvml_sexpm1_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_expm1f8_ha_l9 ENDP +__jsvml_expm1f8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f8_ha_l9_B1_B3: +_unwind___jsvml_expm1f8_ha_l9_B1_B3: DD 1602561 DD 4379764 DD 2058348 @@ -677,19 +677,19 @@ _unwind___svml_expm1f8_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_expm1f8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm1f8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f8_ha_l9_B6_B10: +_unwind___jsvml_expm1f8_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_expm1f8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm1f8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -698,7 +698,7 @@ _unwind___svml_expm1f8_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_expm1f8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_expm1f8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -712,9 +712,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm1f16_ha_z0 + PUBLIC __jsvml_expm1f16_ha_z0 -__svml_expm1f16_ha_z0 PROC EXPORT +__jsvml_expm1f16_ha_z0 PROC EXPORT _B4_1:: @@ -727,23 +727,23 @@ L66:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm23, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+128] + vmovups zmm23, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+128] and r13, -64 - vmovups zmm22, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+192] - vmovups zmm24, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+384] - vmovups zmm27, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+512] - vmovups zmm25, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+448] - vmovups zmm5, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+256] + vmovups zmm22, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+192] + vmovups zmm24, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+384] + vmovups zmm27, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+512] + vmovups zmm25, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+448] + vmovups zmm5, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+256] vmovaps zmm4, zmm0 vfmadd213ps zmm23, zmm4, zmm22 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+576] + vmovups zmm0, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+576] vcmpps k0, zmm4, zmm5, 21 {sae} - vmovups zmm5, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+640] + vmovups zmm5, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+640] vsubps zmm26, zmm23, zmm22 {rn-sae} - vpermps zmm28, zmm23, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512] - vpermps zmm3, zmm23, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+64] + vpermps zmm28, zmm23, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512] + vpermps zmm3, zmm23, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+64] vfnmadd213ps zmm24, zmm26, zmm4 {rn-sae} - vmovups zmm22, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+768] + vmovups zmm22, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+768] vmaxps zmm29, zmm26, zmm27 {sae} kmovw r8d, k0 vscalefps zmm2, zmm28, zmm29 {rn-sae} @@ -752,13 +752,13 @@ L66:: vsubps zmm31, zmm24, zmm30 {rn-sae} vandps zmm1, zmm30, zmm0 vfnmadd231ps zmm31, zmm25, zmm26 {rn-sae} - vmovups zmm25, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+832] - vmovups zmm26, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+896] + vmovups zmm25, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+832] + vmovups zmm26, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+896] vmulps zmm30, zmm1, zmm1 {rn-sae} vcmpps k1, zmm2, zmm25, 17 {sae} vandps zmm23, zmm31, zmm0 vaddps zmm31, zmm2, zmm26 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+704] + vmovups zmm0, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+704] vblendmps zmm27{k1}, zmm2, zmm26 vblendmps zmm29{k1}, zmm26, zmm2 vaddps zmm24, zmm23, zmm3 {rn-sae} @@ -776,7 +776,7 @@ L66:: vaddps zmm1, zmm2, zmm3 {rn-sae} vaddps zmm0, zmm22, zmm1 {rn-sae} mov QWORD PTR [1328+rsp], r13 - vpternlogd zmm0, zmm4, ZMMWORD PTR [__svml_sexpm1_ha_data_internal_avx512+320], 248 + vpternlogd zmm0, zmm4, ZMMWORD PTR [__jsvml_sexpm1_ha_data_internal_avx512+320], 248 test r8d, r8d jne _B4_3 @@ -908,19 +908,19 @@ _B4_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexpm1_ha_cout_rare_internal + call __jsvml_sexpm1_ha_cout_rare_internal jmp _B4_13 ALIGN 16 _B4_16:: -__svml_expm1f16_ha_z0 ENDP +__jsvml_expm1f16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f16_ha_z0_B1_B9: +_unwind___jsvml_expm1f16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -932,13 +932,13 @@ _unwind___svml_expm1f16_ha_z0_B1_B9: DD imagerel _B4_1 DD imagerel _B4_11 - DD imagerel _unwind___svml_expm1f16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_expm1f16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f16_ha_z0_B11_B15: +_unwind___jsvml_expm1f16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -974,7 +974,7 @@ _unwind___svml_expm1f16_ha_z0_B11_B15: DD imagerel _B4_11 DD imagerel _B4_16 - DD imagerel _unwind___svml_expm1f16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_expm1f16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -988,9 +988,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm1f4_ha_l9 + PUBLIC __jsvml_expm1f4_ha_l9 -__svml_expm1f4_ha_l9 PROC EXPORT +__jsvml_expm1f4_ha_l9 PROC EXPORT _B5_1:: @@ -1011,20 +1011,20 @@ L117:: vmovaps xmm6, xmm0 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm4, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1280] + vmovups xmm4, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1280] and r13, -64 vandps xmm11, xmm6, xmm4 vandnps xmm5, xmm4, xmm6 - vmulps xmm12, xmm6, XMMWORD PTR [__svml_sexpm1_ha_data_internal+768] - vcmpnleps xmm13, xmm11, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1344] + vmulps xmm12, xmm6, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+768] + vcmpnleps xmm13, xmm11, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1344] vroundps xmm12, xmm12, 0 vmovmskps edx, xmm13 - vaddps xmm13, xmm12, XMMWORD PTR [__svml_sexpm1_ha_data_internal+960] - vmulps xmm3, xmm12, XMMWORD PTR [__svml_sexpm1_ha_data_internal+896] - vmovups xmm2, XMMWORD PTR [__svml_sexpm1_ha_data_internal+832] + vaddps xmm13, xmm12, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+960] + vmulps xmm3, xmm12, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+896] + vmovups xmm2, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+832] vfnmadd213ps xmm2, xmm12, xmm6 - vandps xmm12, xmm13, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1024] - vandps xmm13, xmm13, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1088] + vandps xmm12, xmm13, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1024] + vandps xmm13, xmm13, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1088] vmovd ecx, xmm12 vcmpeqps xmm0, xmm2, xmm6 vsubps xmm1, xmm2, xmm3 @@ -1035,10 +1035,10 @@ L117:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovq xmm14, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - vmovq xmm15, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] - vmovq xmm12, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r10] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r10] vunpcklps xmm15, xmm14, xmm15 vunpcklps xmm11, xmm11, xmm12 vmovlhps xmm14, xmm15, xmm11 @@ -1046,15 +1046,15 @@ L117:: vpslld xmm11, xmm13, 14 vorps xmm12, xmm14, xmm11 vmulps xmm11, xmm15, xmm11 - vorps xmm15, xmm0, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1152] + vorps xmm15, xmm0, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1152] vandps xmm15, xmm2, xmm15 - vmovups xmm13, XMMWORD PTR [__svml_sexpm1_ha_data_internal+512] + vmovups xmm13, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+512] vsubps xmm2, xmm2, xmm15 - vfmadd213ps xmm13, xmm1, XMMWORD PTR [__svml_sexpm1_ha_data_internal+576] + vfmadd213ps xmm13, xmm1, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+576] vmulps xmm1, xmm1, xmm1 vmulps xmm14, xmm12, xmm15 vsubps xmm3, xmm2, xmm3 - vmovups xmm0, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1216] + vmovups xmm0, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1216] vfmadd213ps xmm13, xmm1, xmm3 vandps xmm1, xmm12, xmm4 vandps xmm4, xmm0, xmm4 @@ -1126,19 +1126,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexpm1_ha_cout_rare_internal + call __jsvml_sexpm1_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_expm1f4_ha_l9 ENDP +__jsvml_expm1f4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f4_ha_l9_B1_B3: +_unwind___jsvml_expm1f4_ha_l9_B1_B3: DD 1070081 DD 2413652 DD 813128 @@ -1156,19 +1156,19 @@ _unwind___svml_expm1f4_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_expm1f4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm1f4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f4_ha_l9_B6_B10: +_unwind___jsvml_expm1f4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_expm1f4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_expm1f4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1177,7 +1177,7 @@ _unwind___svml_expm1f4_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_expm1f4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_expm1f4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1191,9 +1191,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_expm1f8_ha_e9 + PUBLIC __jsvml_expm1f8_ha_e9 -__svml_expm1f8_ha_e9 PROC EXPORT +__jsvml_expm1f8_ha_e9 PROC EXPORT _B6_1:: @@ -1218,21 +1218,21 @@ L136:: vpxor xmm6, xmm6, xmm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmulps ymm1, ymm0, YMMWORD PTR [__svml_sexpm1_ha_data_internal+768] + vmulps ymm1, ymm0, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+768] and r13, -64 - vmovups ymm14, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1280] + vmovups ymm14, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1280] vmovups YMMWORD PTR [r13], ymm0 vroundps ymm2, ymm1, 0 vandps ymm4, ymm0, ymm14 - vcmpnle_uqps ymm5, ymm4, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1344] - vmulps ymm3, ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+832] - vmulps ymm13, ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+896] + vcmpnle_uqps ymm5, ymm4, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1344] + vmulps ymm3, ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+832] + vmulps ymm13, ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+896] vsubps ymm12, ymm0, ymm3 vcmpeqps ymm10, ymm12, ymm0 vsubps ymm11, ymm12, ymm13 vandnps ymm15, ymm14, ymm0 - vmovups xmm0, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1024] - vorps ymm10, ymm10, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1152] + vmovups xmm0, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1024] + vorps ymm10, ymm10, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1152] vandps ymm10, ymm12, ymm10 vsubps ymm12, ymm12, ymm10 vsubps ymm13, ymm12, ymm13 @@ -1240,7 +1240,7 @@ L136:: vextractf128 xmm9, ymm5, 1 vpackssdw xmm8, xmm5, xmm9 vpacksswb xmm7, xmm8, xmm6 - vaddps ymm8, ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+960] + vaddps ymm8, ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+960] vpmovmskb edx, xmm7 vandps xmm3, xmm8, xmm0 vmovd ecx, xmm3 @@ -1252,10 +1252,10 @@ L136:: movsxd r8, r8d movsxd r9, r9d vmovd r11d, xmm6 - vmovq xmm0, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - vmovq xmm2, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] vpextrd r10d, xmm3, 3 - vmovq xmm1, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] vpextrd ecx, xmm6, 1 vpextrd r8d, xmm6, 2 vpextrd r9d, xmm6, 3 @@ -1264,30 +1264,30 @@ L136:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovq xmm3, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r10] - vmovq xmm4, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r11] - vmovq xmm7, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r8] - vmovq xmm6, QWORD PTR [imagerel(__svml_sexpm1_ha_data_internal)+rax+r9] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r10] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r11] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_sexpm1_ha_data_internal)+rax+r9] vunpcklps xmm0, xmm0, xmm1 vunpcklps xmm2, xmm2, xmm3 vunpcklps xmm1, xmm4, xmm5 vunpcklps xmm4, xmm7, xmm6 - vmulps ymm5, ymm11, YMMWORD PTR [__svml_sexpm1_ha_data_internal+512] + vmulps ymm5, ymm11, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+512] vmulps ymm11, ymm11, ymm11 vinsertf128 ymm7, ymm0, xmm1, 1 vinsertf128 ymm0, ymm2, xmm4, 1 - vmovups xmm2, XMMWORD PTR [__svml_sexpm1_ha_data_internal+1088] + vmovups xmm2, XMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1088] vandps xmm8, xmm8, xmm2 vandps xmm9, xmm9, xmm2 vpslld xmm1, xmm8, 14 vpslld xmm3, xmm9, 14 vunpcklps ymm6, ymm7, ymm0 - vmovups ymm2, YMMWORD PTR [__svml_sexpm1_ha_data_internal+1216] + vmovups ymm2, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+1216] vunpckhps ymm7, ymm7, ymm0 vinsertf128 ymm4, ymm1, xmm3, 1 vorps ymm8, ymm6, ymm4 - vaddps ymm6, ymm5, YMMWORD PTR [__svml_sexpm1_ha_data_internal+576] + vaddps ymm6, ymm5, YMMWORD PTR [__jsvml_sexpm1_ha_data_internal+576] vaddps ymm5, ymm8, ymm2 vmulps ymm12, ymm8, ymm10 vmulps ymm0, ymm6, ymm11 @@ -1371,19 +1371,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_sexpm1_ha_cout_rare_internal + call __jsvml_sexpm1_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_expm1f8_ha_e9 ENDP +__jsvml_expm1f8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f8_ha_e9_B1_B3: +_unwind___jsvml_expm1f8_ha_e9_B1_B3: DD 1603585 DD 4379768 DD 1927276 @@ -1405,19 +1405,19 @@ _unwind___svml_expm1f8_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_expm1f8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm1f8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_expm1f8_ha_e9_B6_B10: +_unwind___jsvml_expm1f8_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_expm1f8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_expm1f8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1426,7 +1426,7 @@ _unwind___svml_expm1f8_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_expm1f8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_expm1f8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1440,9 +1440,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sexpm1_ha_cout_rare_internal + PUBLIC __jsvml_sexpm1_ha_cout_rare_internal -__svml_sexpm1_ha_cout_rare_internal PROC +__jsvml_sexpm1_ha_cout_rare_internal PROC _B7_1:: @@ -1708,13 +1708,13 @@ _B7_22:: _B7_23:: -__svml_sexpm1_ha_cout_rare_internal ENDP +__jsvml_sexpm1_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sexpm1_ha_cout_rare_internal_B1_B22: +_unwind___jsvml_sexpm1_ha_cout_rare_internal_B1_B22: DD 67585 DD 49672 @@ -1725,7 +1725,7 @@ _unwind___svml_sexpm1_ha_cout_rare_internal_B1_B22: DD imagerel _B7_1 DD imagerel _B7_23 - DD imagerel _unwind___svml_sexpm1_ha_cout_rare_internal_B1_B22 + DD imagerel _unwind___jsvml_sexpm1_ha_cout_rare_internal_B1_B22 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1733,8 +1733,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_sexpm1_ha_data_internal_avx512 -__svml_sexpm1_ha_data_internal_avx512 DD 1065353216 + PUBLIC __jsvml_sexpm1_ha_data_internal_avx512 +__jsvml_sexpm1_ha_data_internal_avx512 DD 1065353216 DD 1065724611 DD 1066112450 DD 1066517459 @@ -1974,8 +1974,8 @@ __svml_sexpm1_ha_data_internal_avx512 DD 1065353216 DD 3212836864 DD 3212836864 DD 3212836864 - PUBLIC __svml_sexpm1_ha_data_internal -__svml_sexpm1_ha_data_internal DD 0 + PUBLIC __jsvml_sexpm1_ha_data_internal +__jsvml_sexpm1_ha_data_internal DD 0 DD 0 DD 90112 DD 958021240 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_hypot_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_hypot_windows_x86.S similarity index 90% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_hypot_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_hypot_windows_x86.S index 75d99900827..7f4383f14eb 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_hypot_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_hypot_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypotf8_ha_l9 + PUBLIC __jsvml_hypotf8_ha_l9 -__svml_hypotf8_ha_l9 PROC EXPORT +__jsvml_hypotf8_ha_l9 PROC EXPORT _B1_1:: @@ -56,10 +56,10 @@ L1:: vmovups YMMWORD PTR [464+rsp], ymm8 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [303+rsp] - vmovups ymm2, YMMWORD PTR [__svml_shypot_ha_data_internal+128] + vmovups ymm2, YMMWORD PTR [__jsvml_shypot_ha_data_internal+128] and r13, -64 - vmovups ymm5, YMMWORD PTR [__svml_shypot_ha_data_internal] - vmovups ymm8, YMMWORD PTR [__svml_shypot_ha_data_internal+192] + vmovups ymm5, YMMWORD PTR [__jsvml_shypot_ha_data_internal] + vmovups ymm8, YMMWORD PTR [__jsvml_shypot_ha_data_internal+192] vmovaps ymm14, ymm1 vandps ymm3, ymm0, ymm2 vandps ymm4, ymm14, ymm2 @@ -69,7 +69,7 @@ L1:: vandps ymm3, ymm1, ymm5 vsubps ymm4, ymm1, ymm3 vaddps ymm1, ymm1, ymm3 - vpcmpgtd ymm13, ymm15, YMMWORD PTR [__svml_shypot_ha_data_internal+320] + vpcmpgtd ymm13, ymm15, YMMWORD PTR [__jsvml_shypot_ha_data_internal+320] vandnps ymm5, ymm13, ymm5 vmulps ymm4, ymm4, ymm1 vmulps ymm13, ymm3, ymm3 @@ -77,10 +77,10 @@ L1:: vsubps ymm5, ymm2, ymm15 vfmadd231ps ymm13, ymm15, ymm15 vfmadd231ps ymm4, ymm2, ymm5 - vmovups ymm2, YMMWORD PTR [__svml_shypot_ha_data_internal+384] + vmovups ymm2, YMMWORD PTR [__jsvml_shypot_ha_data_internal+384] vfmadd213ps ymm5, ymm15, ymm4 vaddps ymm15, ymm13, ymm5 - vpcmpgtd ymm1, ymm15, YMMWORD PTR [__svml_shypot_ha_data_internal+448] + vpcmpgtd ymm1, ymm15, YMMWORD PTR [__jsvml_shypot_ha_data_internal+448] vpcmpgtd ymm3, ymm2, ymm15 vpor ymm2, ymm3, ymm1 vrsqrtps ymm3, ymm15 @@ -89,7 +89,7 @@ L1:: vfnmadd231ps ymm8, ymm3, ymm15 vfmadd213ps ymm15, ymm8, ymm15 vfmadd132ps ymm3, ymm3, ymm8 - vandps ymm1, ymm15, YMMWORD PTR [__svml_shypot_ha_data_internal+64] + vandps ymm1, ymm15, YMMWORD PTR [__jsvml_shypot_ha_data_internal+64] vfmsub231ps ymm13, ymm1, ymm1 vsubps ymm8, ymm15, ymm1 vfmadd213ps ymm1, ymm8, ymm13 @@ -163,19 +163,19 @@ _B1_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_shypot_ha_cout_rare_internal + call __jsvml_shypot_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_hypotf8_ha_l9 ENDP +__jsvml_hypotf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf8_ha_l9_B1_B3: +_unwind___jsvml_hypotf8_ha_l9_B1_B3: DD 800513 DD 4903991 DD 1935407 @@ -191,13 +191,13 @@ _unwind___svml_hypotf8_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_hypotf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypotf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf8_ha_l9_B6_B10: +_unwind___jsvml_hypotf8_ha_l9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -209,7 +209,7 @@ _unwind___svml_hypotf8_ha_l9_B6_B10: DD 813067 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_hypotf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypotf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -218,7 +218,7 @@ _unwind___svml_hypotf8_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_hypotf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_hypotf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -232,9 +232,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypotf4_ha_l9 + PUBLIC __jsvml_hypotf4_ha_l9 -__svml_hypotf4_ha_l9 PROC EXPORT +__jsvml_hypotf4_ha_l9 PROC EXPORT _B2_1:: @@ -252,16 +252,16 @@ L28:: vmovups XMMWORD PTR [256+rsp], xmm8 mov QWORD PTR [320+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm2, XMMWORD PTR [__svml_shypot_ha_data_internal+128] + vmovups xmm2, XMMWORD PTR [__jsvml_shypot_ha_data_internal+128] and r13, -64 vandps xmm3, xmm0, xmm2 vandps xmm4, xmm14, xmm2 vmaxps xmm1, xmm3, xmm4 vminps xmm2, xmm4, xmm3 - vmovups xmm8, XMMWORD PTR [__svml_shypot_ha_data_internal] + vmovups xmm8, XMMWORD PTR [__jsvml_shypot_ha_data_internal] vpsubd xmm15, xmm1, xmm2 vandps xmm3, xmm1, xmm8 - vpcmpgtd xmm13, xmm15, XMMWORD PTR [__svml_shypot_ha_data_internal+320] + vpcmpgtd xmm13, xmm15, XMMWORD PTR [__jsvml_shypot_ha_data_internal+320] vsubps xmm4, xmm1, xmm3 vaddps xmm1, xmm1, xmm3 vandnps xmm15, xmm13, xmm8 @@ -270,13 +270,13 @@ L28:: vsubps xmm13, xmm2, xmm15 vmulps xmm8, xmm3, xmm3 vfmadd231ps xmm4, xmm2, xmm13 - vmovups xmm2, XMMWORD PTR [__svml_shypot_ha_data_internal+384] - vmovups xmm5, XMMWORD PTR [__svml_shypot_ha_data_internal+192] + vmovups xmm2, XMMWORD PTR [__jsvml_shypot_ha_data_internal+384] + vmovups xmm5, XMMWORD PTR [__jsvml_shypot_ha_data_internal+192] vfmadd231ps xmm8, xmm15, xmm15 vfmadd213ps xmm13, xmm15, xmm4 mov QWORD PTR [328+rsp], r13 vaddps xmm15, xmm8, xmm13 - vpcmpgtd xmm1, xmm15, XMMWORD PTR [__svml_shypot_ha_data_internal+448] + vpcmpgtd xmm1, xmm15, XMMWORD PTR [__jsvml_shypot_ha_data_internal+448] vpcmpgtd xmm3, xmm2, xmm15 vpor xmm2, xmm3, xmm1 vrsqrtps xmm3, xmm15 @@ -286,7 +286,7 @@ L28:: vfnmadd231ps xmm5, xmm3, xmm15 vfmadd213ps xmm15, xmm5, xmm15 vfmadd132ps xmm3, xmm3, xmm5 - vandps xmm1, xmm15, XMMWORD PTR [__svml_shypot_ha_data_internal+64] + vandps xmm1, xmm15, XMMWORD PTR [__jsvml_shypot_ha_data_internal+64] vfmsub231ps xmm8, xmm1, xmm1 vsubps xmm5, xmm15, xmm1 vfmadd213ps xmm1, xmm5, xmm8 @@ -345,19 +345,19 @@ _B2_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_shypot_ha_cout_rare_internal + call __jsvml_shypot_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_hypotf4_ha_l9 ENDP +__jsvml_hypotf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf4_ha_l9_B1_B3: +_unwind___jsvml_hypotf4_ha_l9_B1_B3: DD 801537 DD 2675771 DD 1083443 @@ -373,19 +373,19 @@ _unwind___svml_hypotf4_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_hypotf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypotf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf4_ha_l9_B6_B10: +_unwind___jsvml_hypotf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_hypotf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_hypotf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -394,7 +394,7 @@ _unwind___svml_hypotf4_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_hypotf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_hypotf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -408,9 +408,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypotf8_ha_e9 + PUBLIC __jsvml_hypotf8_ha_e9 -__svml_hypotf8_ha_e9 PROC EXPORT +__jsvml_hypotf8_ha_e9 PROC EXPORT _B3_1:: @@ -429,16 +429,16 @@ L43:: vmovups YMMWORD PTR [528+rsp], ymm7 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovups ymm2, YMMWORD PTR [__svml_shypot_ha_data_internal+128] + vmovups ymm2, YMMWORD PTR [__jsvml_shypot_ha_data_internal+128] and r13, -64 - vmovups ymm15, YMMWORD PTR [__svml_shypot_ha_data_internal] - vmovups ymm7, YMMWORD PTR [__svml_shypot_ha_data_internal+192] + vmovups ymm15, YMMWORD PTR [__jsvml_shypot_ha_data_internal] + vmovups ymm7, YMMWORD PTR [__jsvml_shypot_ha_data_internal+192] vmovaps ymm9, ymm1 vandps ymm14, ymm0, ymm2 vandps ymm11, ymm9, ymm2 vmaxps ymm4, ymm14, ymm11 vminps ymm1, ymm11, ymm14 - vmovups xmm11, XMMWORD PTR [__svml_shypot_ha_data_internal+320] + vmovups xmm11, XMMWORD PTR [__jsvml_shypot_ha_data_internal+320] vandps ymm2, ymm4, ymm15 vsubps ymm3, ymm4, ymm2 mov QWORD PTR [600+rsp], r13 @@ -452,7 +452,7 @@ L43:: vandnps ymm15, ymm14, ymm15 vandps ymm11, ymm1, ymm15 vsubps ymm5, ymm1, ymm11 - vmovups xmm15, XMMWORD PTR [__svml_shypot_ha_data_internal+448] + vmovups xmm15, XMMWORD PTR [__jsvml_shypot_ha_data_internal+448] vmulps ymm14, ymm2, ymm2 vmulps ymm8, ymm11, ymm11 vmulps ymm11, ymm11, ymm5 @@ -461,7 +461,7 @@ L43:: vmulps ymm4, ymm1, ymm5 vmulps ymm3, ymm3, ymm2 vaddps ymm14, ymm3, ymm4 - vmovups xmm3, XMMWORD PTR [__svml_shypot_ha_data_internal+384] + vmovups xmm3, XMMWORD PTR [__jsvml_shypot_ha_data_internal+384] vaddps ymm5, ymm14, ymm11 vaddps ymm14, ymm8, ymm5 vpcmpgtd xmm2, xmm3, xmm14 @@ -484,7 +484,7 @@ L43:: vmulps ymm7, ymm3, ymm11 vaddps ymm11, ymm15, ymm1 vaddps ymm14, ymm3, ymm7 - vandps ymm3, ymm11, YMMWORD PTR [__svml_shypot_ha_data_internal+64] + vandps ymm3, ymm11, YMMWORD PTR [__jsvml_shypot_ha_data_internal+64] vsubps ymm7, ymm11, ymm3 vmulps ymm2, ymm3, ymm3 vmulps ymm4, ymm3, ymm7 @@ -560,19 +560,19 @@ _B3_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_shypot_ha_cout_rare_internal + call __jsvml_shypot_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_hypotf8_ha_e9 ENDP +__jsvml_hypotf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf8_ha_e9_B1_B3: +_unwind___jsvml_hypotf8_ha_e9_B1_B3: DD 1067265 DD 4904009 DD 2193473 @@ -590,13 +590,13 @@ _unwind___svml_hypotf8_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_hypotf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypotf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf8_ha_e9_B6_B10: +_unwind___jsvml_hypotf8_ha_e9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -606,7 +606,7 @@ _unwind___svml_hypotf8_ha_e9_B6_B10: DD 550923 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_hypotf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypotf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -615,7 +615,7 @@ _unwind___svml_hypotf8_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_hypotf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_hypotf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -629,9 +629,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypotf4_ha_ex + PUBLIC __jsvml_hypotf4_ha_ex -__svml_hypotf4_ha_ex PROC EXPORT +__jsvml_hypotf4_ha_ex PROC EXPORT _B4_1:: @@ -650,7 +650,7 @@ L70:: movups XMMWORD PTR [304+rsp], xmm7 mov QWORD PTR [336+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm5, XMMWORD PTR [__svml_shypot_ha_data_internal+128] + movups xmm5, XMMWORD PTR [__jsvml_shypot_ha_data_internal+128] and r13, -64 andps xmm0, xmm5 andps xmm5, xmm1 @@ -661,8 +661,8 @@ L70:: movaps xmm4, xmm7 psubd xmm3, xmm5 movaps xmm10, xmm7 - movups xmm2, XMMWORD PTR [__svml_shypot_ha_data_internal] - pcmpgtd xmm3, XMMWORD PTR [__svml_shypot_ha_data_internal+320] + movups xmm2, XMMWORD PTR [__jsvml_shypot_ha_data_internal] + pcmpgtd xmm3, XMMWORD PTR [__jsvml_shypot_ha_data_internal+320] andps xmm4, xmm2 andnps xmm3, xmm2 movaps xmm2, xmm5 @@ -681,17 +681,17 @@ L70:: addps xmm10, xmm5 movaps xmm0, xmm8 addps xmm10, xmm3 - movdqu xmm4, XMMWORD PTR [__svml_shypot_ha_data_internal+384] + movdqu xmm4, XMMWORD PTR [__jsvml_shypot_ha_data_internal+384] addps xmm0, xmm10 rsqrtps xmm2, xmm0 - movups xmm14, XMMWORD PTR [__svml_shypot_ha_data_internal+192] + movups xmm14, XMMWORD PTR [__jsvml_shypot_ha_data_internal+192] pcmpgtd xmm4, xmm0 movaps xmm3, xmm0 mulps xmm0, xmm2 mulps xmm2, xmm14 movaps xmm5, xmm0 mulps xmm5, xmm2 - pcmpgtd xmm3, XMMWORD PTR [__svml_shypot_ha_data_internal+448] + pcmpgtd xmm3, XMMWORD PTR [__jsvml_shypot_ha_data_internal+448] subps xmm14, xmm5 por xmm4, xmm3 movaps xmm3, xmm14 @@ -700,7 +700,7 @@ L70:: movmskps eax, xmm4 addps xmm0, xmm14 addps xmm2, xmm3 - movups xmm4, XMMWORD PTR [__svml_shypot_ha_data_internal+64] + movups xmm4, XMMWORD PTR [__jsvml_shypot_ha_data_internal+64] movaps xmm7, xmm0 andps xmm4, xmm0 movaps xmm14, xmm4 @@ -770,19 +770,19 @@ _B4_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_shypot_ha_cout_rare_internal + call __jsvml_shypot_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_hypotf4_ha_ex ENDP +__jsvml_hypotf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf4_ha_ex_B1_B3: +_unwind___jsvml_hypotf4_ha_ex_B1_B3: DD 934657 DD 2806851 DD 1275963 @@ -799,19 +799,19 @@ _unwind___svml_hypotf4_ha_ex_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_hypotf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_hypotf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf4_ha_ex_B6_B10: +_unwind___jsvml_hypotf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_hypotf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_hypotf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -820,7 +820,7 @@ _unwind___svml_hypotf4_ha_ex_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_hypotf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_hypotf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -834,9 +834,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypotf16_ha_z0 + PUBLIC __jsvml_hypotf16_ha_z0 -__svml_hypotf16_ha_z0 PROC EXPORT +__jsvml_hypotf16_ha_z0 PROC EXPORT _B5_1:: @@ -865,12 +865,12 @@ L87:: vfnmadd231ps zmm1, zmm23, zmm23 {rn-sae} mov QWORD PTR [1384+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm3, ZMMWORD PTR [__svml_shypot_ha_data_internal+192] + vmovups zmm3, ZMMWORD PTR [__jsvml_shypot_ha_data_internal+192] and r13, -64 - vandps zmm22, zmm5, ZMMWORD PTR [__svml_shypot_ha_data_internal+128] + vandps zmm22, zmm5, ZMMWORD PTR [__jsvml_shypot_ha_data_internal+128] vmovaps zmm29, zmm2 vfmsub213ps zmm29, zmm2, zmm24 {rn-sae} - vpcmpd k0, zmm22, ZMMWORD PTR [__svml_shypot_ha_data_internal+512], 5 + vpcmpd k0, zmm22, ZMMWORD PTR [__jsvml_shypot_ha_data_internal+512], 5 vmulps zmm22, zmm3, zmm4 {rn-sae} vaddps zmm31, zmm28, zmm29 {rn-sae} kmovw r8d, k0 @@ -1012,19 +1012,19 @@ _B5_15:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_shypot_ha_cout_rare_internal + call __jsvml_shypot_ha_cout_rare_internal jmp _B5_13 ALIGN 16 _B5_16:: -__svml_hypotf16_ha_z0 ENDP +__jsvml_hypotf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf16_ha_z0_B1_B9: +_unwind___jsvml_hypotf16_ha_z0_B1_B9: DD 291585 DD 11392115 DD 11469067 @@ -1036,13 +1036,13 @@ _unwind___svml_hypotf16_ha_z0_B1_B9: DD imagerel _B5_1 DD imagerel _B5_11 - DD imagerel _unwind___svml_hypotf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_hypotf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf16_ha_z0_B11_B15: +_unwind___jsvml_hypotf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -1078,7 +1078,7 @@ _unwind___svml_hypotf16_ha_z0_B11_B15: DD imagerel _B5_11 DD imagerel _B5_16 - DD imagerel _unwind___svml_hypotf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_hypotf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1092,9 +1092,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_hypotf4_ha_e9 + PUBLIC __jsvml_hypotf4_ha_e9 -__svml_hypotf4_ha_e9 PROC EXPORT +__jsvml_hypotf4_ha_e9 PROC EXPORT _B6_1:: @@ -1113,15 +1113,15 @@ L138:: vmovups XMMWORD PTR [272+rsp], xmm6 mov QWORD PTR [336+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm2, XMMWORD PTR [__svml_shypot_ha_data_internal+128] + vmovups xmm2, XMMWORD PTR [__jsvml_shypot_ha_data_internal+128] and r13, -64 vandps xmm6, xmm0, xmm2 vandps xmm4, xmm3, xmm2 vmaxps xmm8, xmm6, xmm4 vminps xmm4, xmm4, xmm6 vpsubd xmm2, xmm8, xmm4 - vmovups xmm5, XMMWORD PTR [__svml_shypot_ha_data_internal] - vpcmpgtd xmm11, xmm2, XMMWORD PTR [__svml_shypot_ha_data_internal+320] + vmovups xmm5, XMMWORD PTR [__jsvml_shypot_ha_data_internal] + vpcmpgtd xmm11, xmm2, XMMWORD PTR [__jsvml_shypot_ha_data_internal+320] vandps xmm6, xmm8, xmm5 vandnps xmm5, xmm11, xmm5 vsubps xmm10, xmm8, xmm6 @@ -1135,12 +1135,12 @@ L138:: vaddps xmm2, xmm5, xmm2 vmulps xmm15, xmm15, xmm11 vaddps xmm8, xmm10, xmm4 - vmovups xmm4, XMMWORD PTR [__svml_shypot_ha_data_internal+384] + vmovups xmm4, XMMWORD PTR [__jsvml_shypot_ha_data_internal+384] vaddps xmm10, xmm8, xmm15 - vmovups xmm1, XMMWORD PTR [__svml_shypot_ha_data_internal+192] + vmovups xmm1, XMMWORD PTR [__jsvml_shypot_ha_data_internal+192] vaddps xmm11, xmm2, xmm10 vrsqrtps xmm15, xmm11 - vpcmpgtd xmm5, xmm11, XMMWORD PTR [__svml_shypot_ha_data_internal+448] + vpcmpgtd xmm5, xmm11, XMMWORD PTR [__jsvml_shypot_ha_data_internal+448] vpcmpgtd xmm6, xmm4, xmm11 vpor xmm8, xmm6, xmm5 vmovmskps edx, xmm8 @@ -1153,7 +1153,7 @@ L138:: vmulps xmm1, xmm6, xmm4 vaddps xmm4, xmm8, xmm5 vaddps xmm6, xmm6, xmm1 - vandps xmm8, xmm4, XMMWORD PTR [__svml_shypot_ha_data_internal+64] + vandps xmm8, xmm4, XMMWORD PTR [__jsvml_shypot_ha_data_internal+64] vmulps xmm1, xmm8, xmm8 vsubps xmm5, xmm4, xmm8 vmulps xmm11, xmm8, xmm5 @@ -1217,19 +1217,19 @@ _B6_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_shypot_ha_cout_rare_internal + call __jsvml_shypot_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_hypotf4_ha_e9 ENDP +__jsvml_hypotf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf4_ha_e9_B1_B3: +_unwind___jsvml_hypotf4_ha_e9_B1_B3: DD 934913 DD 2806852 DD 1140796 @@ -1246,19 +1246,19 @@ _unwind___svml_hypotf4_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_hypotf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypotf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_hypotf4_ha_e9_B6_B10: +_unwind___jsvml_hypotf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_hypotf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_hypotf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1267,7 +1267,7 @@ _unwind___svml_hypotf4_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_hypotf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_hypotf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1281,9 +1281,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_shypot_ha_cout_rare_internal + PUBLIC __jsvml_shypot_ha_cout_rare_internal -__svml_shypot_ha_cout_rare_internal PROC +__jsvml_shypot_ha_cout_rare_internal PROC _B7_1:: @@ -1606,13 +1606,13 @@ _B7_18:: _B7_21:: -__svml_shypot_ha_cout_rare_internal ENDP +__jsvml_shypot_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_shypot_ha_cout_rare_internal_B1_B18: +_unwind___jsvml_shypot_ha_cout_rare_internal_B1_B18: DD 404225 DD 256043 DD 194597 @@ -1625,7 +1625,7 @@ _unwind___svml_shypot_ha_cout_rare_internal_B1_B18: DD imagerel _B7_1 DD imagerel _B7_21 - DD imagerel _unwind___svml_shypot_ha_cout_rare_internal_B1_B18 + DD imagerel _unwind___jsvml_shypot_ha_cout_rare_internal_B1_B18 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1633,8 +1633,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_shypot_ha_data_internal -__svml_shypot_ha_data_internal DD 4294443008 + PUBLIC __jsvml_shypot_ha_data_internal +__jsvml_shypot_ha_data_internal DD 4294443008 DD 4294443008 DD 4294443008 DD 4294443008 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_log10_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log10_windows_x86.S similarity index 81% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_log10_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log10_windows_x86.S index cbeaa4a565a..4ac87fdccfe 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_log10_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log10_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log10f4_ha_e9 + PUBLIC __jsvml_log10f4_ha_e9 -__svml_log10f4_ha_e9 PROC EXPORT +__jsvml_log10f4_ha_e9 PROC EXPORT _B1_1:: @@ -55,19 +55,19 @@ L1:: lea rax, QWORD PTR [__ImageBase] mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm3, xmm5, XMMWORD PTR [__svml_slog10_ha_data_internal+1280] + vandps xmm3, xmm5, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1280] and r13, -64 - vorps xmm8, xmm3, XMMWORD PTR [__svml_slog10_ha_data_internal+1344] + vorps xmm8, xmm3, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1344] vrcpps xmm3, xmm8 - vcmpltps xmm4, xmm5, XMMWORD PTR [__svml_slog10_ha_data_internal+1408] - vcmpnleps xmm2, xmm5, XMMWORD PTR [__svml_slog10_ha_data_internal+1472] - vmovups xmm1, XMMWORD PTR [__svml_slog10_ha_data_internal+1600] + vcmpltps xmm4, xmm5, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1408] + vcmpnleps xmm2, xmm5, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1472] + vmovups xmm1, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1600] vorps xmm4, xmm4, xmm2 vmulps xmm0, xmm3, xmm1 vpsrld xmm3, xmm5, 23 vcvtdq2ps xmm3, xmm3 vmovmskps edx, xmm4 - vandps xmm2, xmm8, XMMWORD PTR [__svml_slog10_ha_data_internal+1536] + vandps xmm2, xmm8, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1536] vroundps xmm0, xmm0, 0 vsubps xmm8, xmm8, xmm2 vmulps xmm4, xmm0, xmm2 @@ -84,23 +84,23 @@ L1:: vpextrd r8d, xmm2, 1 movsxd rcx, ecx movsxd r8, r8d - vmovq xmm1, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] - vmovq xmm2, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r10] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r10] vunpcklps xmm1, xmm1, xmm2 - vmulps xmm2, xmm3, XMMWORD PTR [__svml_slog10_ha_data_internal+1664] - vmulps xmm3, xmm3, XMMWORD PTR [__svml_slog10_ha_data_internal+1728] - vmovq xmm4, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - vmovq xmm0, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] + vmulps xmm2, xmm3, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1664] + vmulps xmm3, xmm3, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1728] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] vunpcklps xmm0, xmm4, xmm0 vmovlhps xmm4, xmm0, xmm1 vshufps xmm0, xmm0, xmm1, 238 vaddps xmm4, xmm4, xmm2 vaddps xmm2, xmm0, xmm3 - vmulps xmm0, xmm8, XMMWORD PTR [__svml_slog10_ha_data_internal+1088] - vaddps xmm3, xmm0, XMMWORD PTR [__svml_slog10_ha_data_internal+1152] + vmulps xmm0, xmm8, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1088] + vaddps xmm3, xmm0, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1152] vmulps xmm1, xmm8, xmm3 vaddps xmm3, xmm8, xmm4 - vaddps xmm1, xmm1, XMMWORD PTR [__svml_slog10_ha_data_internal+1216] + vaddps xmm1, xmm1, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1216] vsubps xmm4, xmm3, xmm4 vsubps xmm4, xmm8, xmm4 vmulps xmm8, xmm8, xmm1 @@ -153,19 +153,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog10_ha_cout_rare_internal + call __jsvml_slog10_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_log10f4_ha_e9 ENDP +__jsvml_log10f4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f4_ha_e9_B1_B3: +_unwind___jsvml_log10f4_ha_e9_B1_B3: DD 403201 DD 1758247 DD 821272 @@ -178,13 +178,13 @@ _unwind___svml_log10f4_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log10f4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log10f4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f4_ha_e9_B6_B10: +_unwind___jsvml_log10f4_ha_e9_B6_B10: DD 658945 DD 287758 DD 340999 @@ -199,7 +199,7 @@ _unwind___svml_log10f4_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_log10f4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log10f4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -213,9 +213,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log10f8_ha_l9 + PUBLIC __jsvml_log10f8_ha_l9 -__svml_log10f8_ha_l9 PROC EXPORT +__jsvml_log10f8_ha_l9 PROC EXPORT _B2_1:: @@ -236,13 +236,13 @@ L10:: lea r13, QWORD PTR [271+rsp] vmovaps ymm4, ymm0 and r13, -64 - vandps ymm2, ymm4, YMMWORD PTR [__svml_slog10_ha_data_internal+1280] - vorps ymm2, ymm2, YMMWORD PTR [__svml_slog10_ha_data_internal+1344] + vandps ymm2, ymm4, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1280] + vorps ymm2, ymm2, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1344] vrcpps ymm3, ymm2 - vmovups ymm9, YMMWORD PTR [__svml_slog10_ha_data_internal+1600] + vmovups ymm9, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1600] vpsrld ymm5, ymm4, 23 - vcmplt_oqps ymm10, ymm4, YMMWORD PTR [__svml_slog10_ha_data_internal+1408] - vcmpnle_uqps ymm13, ymm4, YMMWORD PTR [__svml_slog10_ha_data_internal+1472] + vcmplt_oqps ymm10, ymm4, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1408] + vcmpnle_uqps ymm13, ymm4, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1472] vmulps ymm1, ymm3, ymm9 vcvtdq2ps ymm3, ymm5 vroundps ymm0, ymm1, 0 @@ -259,10 +259,10 @@ L10:: movsxd r8, r8d movsxd r9, r9d vmovd r11d, xmm9 - vmovq xmm10, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - vmovq xmm0, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] vpextrd r10d, xmm5, 3 - vmovq xmm13, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] vpextrd ecx, xmm9, 1 vpextrd r8d, xmm9, 2 vpextrd r9d, xmm9, 3 @@ -271,25 +271,25 @@ L10:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovq xmm1, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r10] - vmovq xmm5, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r11] - vmovq xmm7, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - vmovq xmm8, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] - vmovq xmm9, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r11] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] vunpcklps xmm13, xmm10, xmm13 vunpcklps xmm10, xmm0, xmm1 vunpcklps xmm1, xmm5, xmm8 vunpcklps xmm8, xmm7, xmm9 vinsertf128 ymm0, ymm13, xmm1, 1 vinsertf128 ymm1, ymm10, xmm8, 1 - vmovups ymm10, YMMWORD PTR [__svml_slog10_ha_data_internal+1088] + vmovups ymm10, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1088] vunpcklps ymm7, ymm0, ymm1 - vfmadd213ps ymm10, ymm2, YMMWORD PTR [__svml_slog10_ha_data_internal+1152] - vfmadd231ps ymm7, ymm3, YMMWORD PTR [__svml_slog10_ha_data_internal+1664] - vfmadd213ps ymm10, ymm2, YMMWORD PTR [__svml_slog10_ha_data_internal+1216] + vfmadd213ps ymm10, ymm2, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1152] + vfmadd231ps ymm7, ymm3, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1664] + vfmadd213ps ymm10, ymm2, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1216] vaddps ymm13, ymm2, ymm7 vunpckhps ymm5, ymm0, ymm1 - vfmadd132ps ymm3, ymm5, YMMWORD PTR [__svml_slog10_ha_data_internal+1728] + vfmadd132ps ymm3, ymm5, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1728] vsubps ymm8, ymm13, ymm7 vfmadd213ps ymm10, ymm2, ymm3 vsubps ymm9, ymm2, ymm8 @@ -356,19 +356,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog10_ha_cout_rare_internal + call __jsvml_slog10_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_log10f8_ha_l9 ENDP +__jsvml_log10f8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f8_ha_l9_B1_B3: +_unwind___jsvml_log10f8_ha_l9_B1_B3: DD 935681 DD 4379719 DD 1800255 @@ -385,13 +385,13 @@ _unwind___svml_log10f8_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_log10f8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log10f8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f8_ha_l9_B6_B10: +_unwind___jsvml_log10f8_ha_l9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -402,7 +402,7 @@ _unwind___svml_log10f8_ha_l9_B6_B10: DD 681995 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_log10f8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log10f8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -411,7 +411,7 @@ _unwind___svml_log10f8_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_log10f8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log10f8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -425,9 +425,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log10f4_ha_l9 + PUBLIC __jsvml_log10f4_ha_l9 -__svml_log10f4_ha_l9 PROC EXPORT +__jsvml_log10f4_ha_l9 PROC EXPORT _B3_1:: @@ -443,13 +443,13 @@ L37:: lea rax, QWORD PTR [__ImageBase] mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm2, xmm4, XMMWORD PTR [__svml_slog10_ha_data_internal+1280] + vandps xmm2, xmm4, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1280] and r13, -64 - vorps xmm2, xmm2, XMMWORD PTR [__svml_slog10_ha_data_internal+1344] + vorps xmm2, xmm2, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1344] vrcpps xmm3, xmm2 - vcmpltps xmm5, xmm4, XMMWORD PTR [__svml_slog10_ha_data_internal+1408] - vcmpnleps xmm14, xmm4, XMMWORD PTR [__svml_slog10_ha_data_internal+1472] - vmovups xmm0, XMMWORD PTR [__svml_slog10_ha_data_internal+1600] + vcmpltps xmm5, xmm4, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1408] + vcmpnleps xmm14, xmm4, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1472] + vmovups xmm0, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1600] vorps xmm5, xmm5, xmm14 vmulps xmm1, xmm3, xmm0 vpsrld xmm3, xmm4, 23 @@ -466,20 +466,20 @@ L37:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovq xmm14, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] - vmovq xmm0, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] - vmovq xmm1, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r10] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r10] vunpcklps xmm5, xmm14, xmm5 vunpcklps xmm14, xmm0, xmm1 vmovlhps xmm0, xmm5, xmm14 - vfmadd231ps xmm0, xmm3, XMMWORD PTR [__svml_slog10_ha_data_internal+1664] + vfmadd231ps xmm0, xmm3, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1664] vshufps xmm5, xmm5, xmm14, 238 - vmovups xmm14, XMMWORD PTR [__svml_slog10_ha_data_internal+1088] - vfmadd213ps xmm14, xmm2, XMMWORD PTR [__svml_slog10_ha_data_internal+1152] - vfmadd132ps xmm3, xmm5, XMMWORD PTR [__svml_slog10_ha_data_internal+1728] + vmovups xmm14, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1088] + vfmadd213ps xmm14, xmm2, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1152] + vfmadd132ps xmm3, xmm5, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1728] vaddps xmm5, xmm2, xmm0 - vfmadd213ps xmm14, xmm2, XMMWORD PTR [__svml_slog10_ha_data_internal+1216] + vfmadd213ps xmm14, xmm2, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1216] vsubps xmm0, xmm5, xmm0 vfmadd213ps xmm14, xmm2, xmm3 vsubps xmm0, xmm2, xmm0 @@ -532,19 +532,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog10_ha_cout_rare_internal + call __jsvml_slog10_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_log10f4_ha_l9 ENDP +__jsvml_log10f4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f4_ha_l9_B1_B3: +_unwind___jsvml_log10f4_ha_l9_B1_B3: DD 403201 DD 1758247 DD 845848 @@ -557,13 +557,13 @@ _unwind___svml_log10f4_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_log10f4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log10f4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f4_ha_l9_B6_B10: +_unwind___jsvml_log10f4_ha_l9_B6_B10: DD 658945 DD 287758 DD 340999 @@ -578,7 +578,7 @@ _unwind___svml_log10f4_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_log10f4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log10f4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -592,9 +592,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log10f4_ha_ex + PUBLIC __jsvml_log10f4_ha_ex -__svml_log10f4_ha_ex PROC EXPORT +__jsvml_log10f4_ha_ex PROC EXPORT _B4_1:: @@ -610,21 +610,21 @@ L46:: movaps xmm4, xmm5 mov QWORD PTR [208+rsp], r13 movaps xmm2, xmm5 - movups xmm8, XMMWORD PTR [__svml_slog10_ha_data_internal+1280] + movups xmm8, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1280] lea rax, QWORD PTR [__ImageBase] andps xmm8, xmm5 lea r13, QWORD PTR [111+rsp] - orps xmm8, XMMWORD PTR [__svml_slog10_ha_data_internal+1344] + orps xmm8, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1344] and r13, -64 rcpps xmm0, xmm8 - cmpltps xmm4, XMMWORD PTR [__svml_slog10_ha_data_internal+1408] - cmpnleps xmm2, XMMWORD PTR [__svml_slog10_ha_data_internal+1472] - movups xmm3, XMMWORD PTR [__svml_slog10_ha_data_internal+1600] + cmpltps xmm4, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1408] + cmpnleps xmm2, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1472] + movups xmm3, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1600] orps xmm4, xmm2 mulps xmm0, xmm3 movmskps edx, xmm4 movups xmm1, XMMWORD PTR [_2il0floatpacket_20] - movups xmm4, XMMWORD PTR [__svml_slog10_ha_data_internal+1536] + movups xmm4, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1536] addps xmm0, xmm1 andps xmm4, xmm8 subps xmm0, xmm1 @@ -648,32 +648,32 @@ L46:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - movq xmm4, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - movq xmm3, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] - movq xmm2, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] - movq xmm0, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r10] + movq xmm4, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + movq xmm3, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] + movq xmm2, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] + movq xmm0, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r10] unpcklps xmm4, xmm3 unpcklps xmm2, xmm0 movaps xmm3, xmm4 movlhps xmm3, xmm2 movaps xmm0, xmm8 shufps xmm4, xmm2, 238 - movups xmm2, XMMWORD PTR [__svml_slog10_ha_data_internal+1664] + movups xmm2, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1664] mulps xmm2, xmm1 - mulps xmm1, XMMWORD PTR [__svml_slog10_ha_data_internal+1728] + mulps xmm1, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1728] addps xmm3, xmm2 addps xmm4, xmm1 addps xmm0, xmm3 - movups xmm1, XMMWORD PTR [__svml_slog10_ha_data_internal+1088] + movups xmm1, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1088] movaps xmm2, xmm0 mulps xmm1, xmm8 subps xmm2, xmm3 movaps xmm3, xmm8 - addps xmm1, XMMWORD PTR [__svml_slog10_ha_data_internal+1152] + addps xmm1, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1152] subps xmm3, xmm2 mulps xmm1, xmm8 mov QWORD PTR [216+rsp], r13 - addps xmm1, XMMWORD PTR [__svml_slog10_ha_data_internal+1216] + addps xmm1, XMMWORD PTR [__jsvml_slog10_ha_data_internal+1216] mulps xmm8, xmm1 addps xmm4, xmm8 addps xmm3, xmm4 @@ -727,19 +727,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog10_ha_cout_rare_internal + call __jsvml_slog10_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_log10f4_ha_ex ENDP +__jsvml_log10f4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f4_ha_ex_B1_B3: +_unwind___jsvml_log10f4_ha_ex_B1_B3: DD 401921 DD 1758242 DD 821271 @@ -752,13 +752,13 @@ _unwind___svml_log10f4_ha_ex_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log10f4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log10f4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f4_ha_ex_B6_B10: +_unwind___jsvml_log10f4_ha_ex_B6_B10: DD 658945 DD 287758 DD 340999 @@ -773,7 +773,7 @@ _unwind___svml_log10f4_ha_ex_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_log10f4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_log10f4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -787,9 +787,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log10f16_ha_z0 + PUBLIC __jsvml_log10f16_ha_z0 -__svml_log10f16_ha_z0 PROC EXPORT +__jsvml_log10f16_ha_z0 PROC EXPORT _B5_1:: @@ -805,26 +805,26 @@ L55:: vfpclassps k1, zmm2, 94 vrcp14ps zmm3, zmm4 vrndscaleps zmm5, zmm3, 88 {sae} - vmovups zmm1, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+256] + vmovups zmm1, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+256] vgetexpps zmm24, zmm5 {sae} - vmovups zmm0, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512] - vmovups zmm25, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+640] - vmovups zmm28, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+320] + vmovups zmm0, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512] + vmovups zmm25, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+640] + vmovups zmm28, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+320] vfmsub231ps zmm1, zmm4, zmm5 {rn-sae} - vmovups zmm4, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+384] - vmovups zmm29, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+448] - vmovups zmm31, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+512] - vmovups zmm27, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+128] - vmovups zmm26, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+704] + vmovups zmm4, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+384] + vmovups zmm29, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+448] + vmovups zmm31, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+512] + vmovups zmm27, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+128] + vmovups zmm26, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+704] vfmadd231ps zmm4, zmm28, zmm1 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+576] + vmovups zmm28, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+576] vfmadd231ps zmm31, zmm29, zmm1 {rn-sae} vmulps zmm30, zmm1, zmm1 {rn-sae} vpsrld zmm22, zmm5, 18 vsubps zmm3, zmm23, zmm24 {rn-sae} vfmadd213ps zmm4, zmm30, zmm31 {rn-sae} - vpermt2ps zmm0, zmm22, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+64] - vpermt2ps zmm27, zmm22, ZMMWORD PTR [__svml_slog10_ha_data_internal_avx512+192] + vpermt2ps zmm0, zmm22, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+64] + vpermt2ps zmm27, zmm22, ZMMWORD PTR [__jsvml_slog10_ha_data_internal_avx512+192] vfmadd231ps zmm0, zmm25, zmm3 {rn-sae} vfmadd213ps zmm3, zmm26, zmm27 {rn-sae} vmovaps zmm5, zmm1 @@ -840,7 +840,7 @@ L55:: _B5_2:: -__svml_log10f16_ha_z0 ENDP +__jsvml_log10f16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -854,9 +854,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log10f8_ha_e9 + PUBLIC __jsvml_log10f8_ha_e9 -__svml_log10f8_ha_e9 PROC EXPORT +__jsvml_log10f8_ha_e9 PROC EXPORT _B6_1:: @@ -877,18 +877,18 @@ L56:: lea r13, QWORD PTR [271+rsp] vmovaps ymm13, ymm0 and r13, -64 - vandps ymm2, ymm13, YMMWORD PTR [__svml_slog10_ha_data_internal+1280] - vorps ymm4, ymm2, YMMWORD PTR [__svml_slog10_ha_data_internal+1344] + vandps ymm2, ymm13, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1280] + vorps ymm4, ymm2, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1344] vrcpps ymm9, ymm4 - vmovups ymm3, YMMWORD PTR [__svml_slog10_ha_data_internal+1600] + vmovups ymm3, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1600] vmulps ymm8, ymm9, ymm3 vroundps ymm8, ymm8, 0 - vandps ymm7, ymm4, YMMWORD PTR [__svml_slog10_ha_data_internal+1536] + vandps ymm7, ymm4, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1536] vsubps ymm4, ymm4, ymm7 mov QWORD PTR [536+rsp], r13 vpsrld xmm2, xmm13, 23 - vcmplt_oqps ymm5, ymm13, YMMWORD PTR [__svml_slog10_ha_data_internal+1408] - vcmpnle_uqps ymm1, ymm13, YMMWORD PTR [__svml_slog10_ha_data_internal+1472] + vcmplt_oqps ymm5, ymm13, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1408] + vcmpnle_uqps ymm1, ymm13, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1472] vextractf128 xmm10, ymm13, 1 vorps ymm1, ymm5, ymm1 vpsrld xmm10, xmm10, 23 @@ -913,10 +913,10 @@ L56:: movsxd r8, r8d movsxd r9, r9d vmovd r11d, xmm7 - vmovq xmm0, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - vmovq xmm2, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] vpextrd r10d, xmm3, 3 - vmovq xmm1, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] vpextrd ecx, xmm7, 1 vpextrd r8d, xmm7, 2 vpextrd r9d, xmm7, 3 @@ -925,27 +925,27 @@ L56:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovq xmm3, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r10] - vmovq xmm4, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r11] - vmovq xmm8, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+rcx] - vmovq xmm5, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r8] - vmovq xmm7, QWORD PTR [imagerel(__svml_slog10_ha_data_internal)-136944+rax+r9] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r10] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r11] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+rcx] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r8] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_slog10_ha_data_internal)-136944+rax+r9] vunpcklps xmm2, xmm2, xmm3 vunpcklps xmm0, xmm0, xmm1 vunpcklps xmm1, xmm4, xmm5 vunpcklps xmm4, xmm8, xmm7 vinsertf128 ymm7, ymm2, xmm4, 1 - vmulps ymm2, ymm10, YMMWORD PTR [__svml_slog10_ha_data_internal+1088] - vaddps ymm3, ymm2, YMMWORD PTR [__svml_slog10_ha_data_internal+1152] + vmulps ymm2, ymm10, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1088] + vaddps ymm3, ymm2, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1152] vmulps ymm4, ymm10, ymm3 vinsertf128 ymm5, ymm0, xmm1, 1 - vmulps ymm0, ymm9, YMMWORD PTR [__svml_slog10_ha_data_internal+1664] - vmulps ymm9, ymm9, YMMWORD PTR [__svml_slog10_ha_data_internal+1728] + vmulps ymm0, ymm9, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1664] + vmulps ymm9, ymm9, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1728] vunpcklps ymm8, ymm5, ymm7 vaddps ymm8, ymm8, ymm0 vaddps ymm0, ymm10, ymm8 vunpckhps ymm1, ymm5, ymm7 - vaddps ymm7, ymm4, YMMWORD PTR [__svml_slog10_ha_data_internal+1216] + vaddps ymm7, ymm4, YMMWORD PTR [__jsvml_slog10_ha_data_internal+1216] vsubps ymm5, ymm0, ymm8 vaddps ymm9, ymm1, ymm9 vsubps ymm5, ymm10, ymm5 @@ -1016,19 +1016,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog10_ha_cout_rare_internal + call __jsvml_slog10_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_log10f8_ha_e9 ENDP +__jsvml_log10f8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f8_ha_e9_B1_B3: +_unwind___jsvml_log10f8_ha_e9_B1_B3: DD 935681 DD 4379719 DD 1931327 @@ -1045,13 +1045,13 @@ _unwind___svml_log10f8_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_log10f8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log10f8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log10f8_ha_e9_B6_B10: +_unwind___jsvml_log10f8_ha_e9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -1062,7 +1062,7 @@ _unwind___svml_log10f8_ha_e9_B6_B10: DD 681995 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_log10f8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log10f8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1071,7 +1071,7 @@ _unwind___svml_log10f8_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_log10f8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log10f8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1085,9 +1085,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_slog10_ha_cout_rare_internal + PUBLIC __jsvml_slog10_ha_cout_rare_internal -__svml_slog10_ha_cout_rare_internal PROC +__jsvml_slog10_ha_cout_rare_internal PROC _B7_1:: @@ -1289,13 +1289,13 @@ _B7_15:: _B7_16:: -__svml_slog10_ha_cout_rare_internal ENDP +__jsvml_slog10_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_slog10_ha_cout_rare_internal_B1_B15: +_unwind___jsvml_slog10_ha_cout_rare_internal_B1_B15: DD 67585 DD 25096 @@ -1306,7 +1306,7 @@ _unwind___svml_slog10_ha_cout_rare_internal_B1_B15: DD imagerel _B7_1 DD imagerel _B7_16 - DD imagerel _unwind___svml_slog10_ha_cout_rare_internal_B1_B15 + DD imagerel _unwind___jsvml_slog10_ha_cout_rare_internal_B1_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1314,8 +1314,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_slog10_ha_data_internal_avx512 -__svml_slog10_ha_data_internal_avx512 DD 1050288128 + PUBLIC __jsvml_slog10_ha_data_internal_avx512 +__jsvml_slog10_ha_data_internal_avx512 DD 1050288128 DD 1049839616 DD 1049405440 DD 1048981504 @@ -1555,8 +1555,8 @@ __svml_slog10_ha_data_internal_avx512 DD 1050288128 DD 124 DD 124 DD 124 - PUBLIC __svml_slog10_ha_data_internal -__svml_slog10_ha_data_internal DD 3256334460 + PUBLIC __jsvml_slog10_ha_data_internal +__jsvml_slog10_ha_data_internal DD 3256334460 DD 969394728 DD 3256334974 DD 969699354 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_log1p_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log1p_windows_x86.S similarity index 83% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_log1p_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log1p_windows_x86.S index 3ae80821785..bd71fed047f 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_log1p_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log1p_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1pf4_ha_e9 + PUBLIC __jsvml_log1pf4_ha_e9 -__svml_log1pf4_ha_e9 PROC EXPORT +__jsvml_log1pf4_ha_e9 PROC EXPORT _B1_1:: @@ -58,31 +58,31 @@ L1:: vmovups XMMWORD PTR [240+rsp], xmm9 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1984] + vmovups xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1984] and r13, -64 vmaxps xmm3, xmm2, xmm14 vminps xmm4, xmm2, xmm14 - vmovups xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1088] + vmovups xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1088] vaddps xmm5, xmm3, xmm4 vandps xmm15, xmm14, xmm1 vandnps xmm10, xmm1, xmm14 - vcmpltps xmm9, xmm15, XMMWORD PTR [__svml_slog1p_ha_data_internal+1152] - vorps xmm0, xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1216] + vcmpltps xmm9, xmm15, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1152] + vorps xmm0, xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1216] vandps xmm1, xmm5, xmm0 - vmovups xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1344] + vmovups xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1344] vsubps xmm3, xmm3, xmm1 mov QWORD PTR [264+rsp], r13 vaddps xmm0, xmm4, xmm3 - vandps xmm4, xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1536] - vorps xmm15, xmm4, XMMWORD PTR [__svml_slog1p_ha_data_internal+1600] + vandps xmm4, xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1536] + vorps xmm15, xmm4, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1600] vrcpps xmm5, xmm15 - vcmpnleps xmm4, xmm14, XMMWORD PTR [__svml_slog1p_ha_data_internal+1728] - vandps xmm3, xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1280] + vcmpnleps xmm4, xmm14, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1728] + vandps xmm3, xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1280] vroundps xmm5, xmm5, 0 vpsubd xmm15, xmm9, xmm3 vmulps xmm15, xmm5, xmm15 vpsrld xmm9, xmm1, 23 - vcmpltps xmm3, xmm14, XMMWORD PTR [__svml_slog1p_ha_data_internal+1664] + vcmpltps xmm3, xmm14, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1664] vcvtdq2ps xmm9, xmm9 vmulps xmm1, xmm1, xmm15 vmulps xmm15, xmm0, xmm15 @@ -101,20 +101,20 @@ L1:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovq xmm3, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - vmovq xmm4, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] - vmovq xmm15, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] - vmovq xmm5, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r10] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r10] vunpcklps xmm1, xmm3, xmm4 vunpcklps xmm15, xmm15, xmm5 vmovlhps xmm3, xmm1, xmm15 vshufps xmm15, xmm1, xmm15, 238 - vmulps xmm4, xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1856] - vmulps xmm1, xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1408] - vmulps xmm9, xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1920] + vmulps xmm4, xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1856] + vmulps xmm1, xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1408] + vmulps xmm9, xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1920] vaddps xmm5, xmm3, xmm4 vmulps xmm4, xmm2, xmm2 - vaddps xmm3, xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1472] + vaddps xmm3, xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1472] vaddps xmm9, xmm15, xmm9 vmulps xmm15, xmm3, xmm4 vaddps xmm1, xmm0, xmm15 @@ -174,19 +174,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog1p_ha_cout_rare_internal + call __jsvml_slog1p_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_log1pf4_ha_e9 ENDP +__jsvml_log1pf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf4_ha_e9_B1_B3: +_unwind___jsvml_log1pf4_ha_e9_B1_B3: DD 803329 DD 2151490 DD 1022010 @@ -202,19 +202,19 @@ _unwind___svml_log1pf4_ha_e9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log1pf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1pf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf4_ha_e9_B6_B10: +_unwind___jsvml_log1pf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_log1pf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1pf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -223,7 +223,7 @@ _unwind___svml_log1pf4_ha_e9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_log1pf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log1pf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -237,9 +237,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1pf8_ha_l9 + PUBLIC __jsvml_log1pf8_ha_l9 -__svml_log1pf8_ha_l9 PROC EXPORT +__jsvml_log1pf8_ha_l9 PROC EXPORT _B2_1:: @@ -260,29 +260,29 @@ L16:: vmovups YMMWORD PTR [496+rsp], ymm7 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [207+rsp] - vmovups ymm11, YMMWORD PTR [__svml_slog1p_ha_data_internal+1984] + vmovups ymm11, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1984] and r13, -64 - vmovups ymm4, YMMWORD PTR [__svml_slog1p_ha_data_internal+1088] - vmovups ymm8, YMMWORD PTR [__svml_slog1p_ha_data_internal+1344] + vmovups ymm4, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1088] + vmovups ymm8, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1344] vmovaps ymm7, ymm0 vmaxps ymm14, ymm11, ymm7 vminps ymm15, ymm11, ymm7 vandps ymm1, ymm7, ymm4 vandnps ymm5, ymm4, ymm7 - vcmplt_oqps ymm4, ymm1, YMMWORD PTR [__svml_slog1p_ha_data_internal+1152] + vcmplt_oqps ymm4, ymm1, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1152] vaddps ymm3, ymm14, ymm15 - vorps ymm2, ymm4, YMMWORD PTR [__svml_slog1p_ha_data_internal+1216] + vorps ymm2, ymm4, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1216] vandps ymm2, ymm3, ymm2 - vandps ymm0, ymm2, YMMWORD PTR [__svml_slog1p_ha_data_internal+1536] - vorps ymm1, ymm0, YMMWORD PTR [__svml_slog1p_ha_data_internal+1600] + vandps ymm0, ymm2, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1536] + vorps ymm1, ymm0, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1600] vrcpps ymm4, ymm1 vsubps ymm9, ymm14, ymm2 - vcmplt_oqps ymm0, ymm7, YMMWORD PTR [__svml_slog1p_ha_data_internal+1664] - vcmpnle_uqps ymm1, ymm7, YMMWORD PTR [__svml_slog1p_ha_data_internal+1728] + vcmplt_oqps ymm0, ymm7, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1664] + vcmpnle_uqps ymm1, ymm7, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1728] vaddps ymm3, ymm15, ymm9 vroundps ymm9, ymm4, 0 vpsrld ymm15, ymm2, 23 - vandps ymm10, ymm2, YMMWORD PTR [__svml_slog1p_ha_data_internal+1280] + vandps ymm10, ymm2, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1280] vpsubd ymm14, ymm8, ymm10 vcvtdq2ps ymm4, ymm15 vmulps ymm10, ymm9, ymm14 @@ -303,10 +303,10 @@ L16:: movsxd r8, r8d movsxd r9, r9d vmovd r11d, xmm11 - vmovq xmm14, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - vmovq xmm0, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + vmovq xmm0, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] vpextrd r10d, xmm9, 3 - vmovq xmm15, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] vpextrd ecx, xmm11, 1 vpextrd r8d, xmm11, 2 vpextrd r9d, xmm11, 3 @@ -315,25 +315,25 @@ L16:: movsxd rcx, ecx movsxd r8, r8d movsxd r9, r9d - vmovq xmm1, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r10] - vmovq xmm8, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r11] - vmovq xmm9, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - vmovq xmm10, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] - vmovq xmm11, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] + vmovq xmm1, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r10] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r11] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] vunpcklps xmm15, xmm14, xmm15 vunpcklps xmm14, xmm0, xmm1 vunpcklps xmm0, xmm8, xmm10 vunpcklps xmm1, xmm9, xmm11 vinsertf128 ymm8, ymm15, xmm0, 1 vinsertf128 ymm10, ymm14, xmm1, 1 - vmovups ymm1, YMMWORD PTR [__svml_slog1p_ha_data_internal+1408] + vmovups ymm1, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1408] vunpcklps ymm0, ymm8, ymm10 - vfmadd231ps ymm0, ymm4, YMMWORD PTR [__svml_slog1p_ha_data_internal+1856] - vfmadd213ps ymm1, ymm3, YMMWORD PTR [__svml_slog1p_ha_data_internal+1472] + vfmadd231ps ymm0, ymm4, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1856] + vfmadd213ps ymm1, ymm3, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1472] vaddps ymm9, ymm3, ymm0 vunpckhps ymm8, ymm8, ymm10 vmulps ymm10, ymm3, ymm3 - vfmadd132ps ymm4, ymm8, YMMWORD PTR [__svml_slog1p_ha_data_internal+1920] + vfmadd132ps ymm4, ymm8, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1920] vfmadd213ps ymm1, ymm10, ymm2 vsubps ymm2, ymm9, ymm0 vsubps ymm3, ymm3, ymm2 @@ -400,19 +400,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog1p_ha_cout_rare_internal + call __jsvml_slog1p_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_log1pf8_ha_l9 ENDP +__jsvml_log1pf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf8_ha_l9_B1_B3: +_unwind___jsvml_log1pf8_ha_l9_B1_B3: DD 1202433 DD 4379737 DD 2062417 @@ -431,13 +431,13 @@ _unwind___svml_log1pf8_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_log1pf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1pf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf8_ha_l9_B6_B10: +_unwind___jsvml_log1pf8_ha_l9_B6_B10: DD 665121 DD 1074214 DD 1127452 @@ -446,7 +446,7 @@ _unwind___svml_log1pf8_ha_l9_B6_B10: DD 419848 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_log1pf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1pf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -455,7 +455,7 @@ _unwind___svml_log1pf8_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_log1pf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log1pf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -469,9 +469,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1pf4_ha_l9 + PUBLIC __jsvml_log1pf4_ha_l9 -__svml_log1pf4_ha_l9 PROC EXPORT +__jsvml_log1pf4_ha_l9 PROC EXPORT _B3_1:: @@ -490,27 +490,27 @@ L43:: vmovups XMMWORD PTR [224+rsp], xmm9 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1984] + vmovups xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1984] and r13, -64 vmaxps xmm13, xmm1, xmm15 vminps xmm2, xmm1, xmm15 - vmovups xmm3, XMMWORD PTR [__svml_slog1p_ha_data_internal+1088] + vmovups xmm3, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1088] vaddps xmm5, xmm13, xmm2 vandps xmm9, xmm15, xmm3 vandnps xmm14, xmm3, xmm15 - vcmpltps xmm4, xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1152] - vorps xmm0, xmm4, XMMWORD PTR [__svml_slog1p_ha_data_internal+1216] + vcmpltps xmm4, xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1152] + vorps xmm0, xmm4, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1216] vandps xmm4, xmm5, xmm0 - vandps xmm5, xmm4, XMMWORD PTR [__svml_slog1p_ha_data_internal+1280] + vandps xmm5, xmm4, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1280] vsubps xmm13, xmm13, xmm4 mov QWORD PTR [264+rsp], r13 vaddps xmm0, xmm2, xmm13 - vandps xmm2, xmm4, XMMWORD PTR [__svml_slog1p_ha_data_internal+1536] - vorps xmm3, xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1600] + vandps xmm2, xmm4, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1536] + vorps xmm3, xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1600] vrcpps xmm9, xmm3 - vcmpltps xmm2, xmm15, XMMWORD PTR [__svml_slog1p_ha_data_internal+1664] - vcmpnleps xmm3, xmm15, XMMWORD PTR [__svml_slog1p_ha_data_internal+1728] - vmovups xmm13, XMMWORD PTR [__svml_slog1p_ha_data_internal+1344] + vcmpltps xmm2, xmm15, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1664] + vcmpnleps xmm3, xmm15, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1728] + vmovups xmm13, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1344] vorps xmm2, xmm2, xmm3 vroundps xmm9, xmm9, 0 vpsubd xmm13, xmm13, xmm5 @@ -532,18 +532,18 @@ L43:: movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - vmovq xmm2, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - vmovq xmm3, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] - vmovq xmm9, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] - vmovq xmm4, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r10] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r10] vunpcklps xmm2, xmm2, xmm3 vunpcklps xmm9, xmm9, xmm4 vmovlhps xmm1, xmm2, xmm9 - vfmadd231ps xmm1, xmm13, XMMWORD PTR [__svml_slog1p_ha_data_internal+1856] + vfmadd231ps xmm1, xmm13, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1856] vshufps xmm9, xmm2, xmm9, 238 - vmovups xmm4, XMMWORD PTR [__svml_slog1p_ha_data_internal+1408] - vfmadd213ps xmm4, xmm5, XMMWORD PTR [__svml_slog1p_ha_data_internal+1472] - vfmadd132ps xmm13, xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1920] + vmovups xmm4, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1408] + vfmadd213ps xmm4, xmm5, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1472] + vfmadd132ps xmm13, xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1920] vmulps xmm2, xmm5, xmm5 vaddps xmm9, xmm5, xmm1 vfmadd213ps xmm4, xmm2, xmm0 @@ -602,19 +602,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog1p_ha_cout_rare_internal + call __jsvml_slog1p_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_log1pf4_ha_l9 ENDP +__jsvml_log1pf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf4_ha_l9_B1_B3: +_unwind___jsvml_log1pf4_ha_l9_B1_B3: DD 803329 DD 2151490 DD 956474 @@ -630,19 +630,19 @@ _unwind___svml_log1pf4_ha_l9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_log1pf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1pf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf4_ha_l9_B6_B10: +_unwind___jsvml_log1pf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_log1pf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_log1pf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -651,7 +651,7 @@ _unwind___svml_log1pf4_ha_l9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_log1pf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_log1pf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -665,9 +665,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1pf4_ha_ex + PUBLIC __jsvml_log1pf4_ha_ex -__svml_log1pf4_ha_ex PROC EXPORT +__jsvml_log1pf4_ha_ex PROC EXPORT _B4_1:: @@ -686,40 +686,40 @@ L58:: movaps xmm6, xmm0 mov QWORD PTR [256+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm15, XMMWORD PTR [__svml_slog1p_ha_data_internal+1984] + movups xmm15, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1984] and r13, -64 movaps xmm1, xmm15 movaps xmm4, xmm15 maxps xmm1, xmm6 minps xmm4, xmm6 - movups xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1088] + movups xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1088] movaps xmm0, xmm1 movaps xmm5, xmm2 andps xmm2, xmm6 - cmpltps xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1152] + cmpltps xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1152] addps xmm0, xmm4 - orps xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1216] + orps xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1216] andnps xmm5, xmm6 andps xmm0, xmm2 - movups xmm3, XMMWORD PTR [__svml_slog1p_ha_data_internal+1536] + movups xmm3, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1536] subps xmm1, xmm0 andps xmm3, xmm0 addps xmm4, xmm1 - orps xmm3, XMMWORD PTR [__svml_slog1p_ha_data_internal+1600] + orps xmm3, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1600] rcpps xmm1, xmm3 movups xmm2, XMMWORD PTR [_2il0floatpacket_23] movaps xmm3, xmm6 - movdqu xmm7, XMMWORD PTR [__svml_slog1p_ha_data_internal+1280] + movdqu xmm7, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1280] addps xmm1, xmm2 - cmpltps xmm3, XMMWORD PTR [__svml_slog1p_ha_data_internal+1664] + cmpltps xmm3, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1664] subps xmm1, xmm2 - movdqu xmm9, XMMWORD PTR [__svml_slog1p_ha_data_internal+1344] + movdqu xmm9, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1344] pand xmm7, xmm0 psubd xmm9, xmm7 movaps xmm2, xmm0 mulps xmm9, xmm1 movaps xmm7, xmm6 - cmpnleps xmm7, XMMWORD PTR [__svml_slog1p_ha_data_internal+1728] + cmpnleps xmm7, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1728] mulps xmm0, xmm9 mulps xmm4, xmm9 subps xmm0, xmm15 @@ -739,22 +739,22 @@ L58:: subps xmm15, xmm0 movd r9d, xmm7 movd r10d, xmm1 - movups xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1408] + movups xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1408] subps xmm4, xmm15 mulps xmm1, xmm3 movsxd rcx, ecx - addps xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1472] + addps xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1472] movsxd r8, r8d movsxd r9, r9d movsxd r10, r10d - movq xmm0, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - movq xmm15, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] + movq xmm0, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + movq xmm15, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] unpcklps xmm0, xmm15 - movups xmm15, XMMWORD PTR [__svml_slog1p_ha_data_internal+1856] + movups xmm15, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1856] mulps xmm15, xmm2 - mulps xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1920] - movq xmm9, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] - movq xmm7, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r10] + mulps xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1920] + movq xmm9, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] + movq xmm7, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r10] unpcklps xmm9, xmm7 movaps xmm7, xmm0 shufps xmm0, xmm9, 238 @@ -828,19 +828,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog1p_ha_cout_rare_internal + call __jsvml_slog1p_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_log1pf4_ha_ex ENDP +__jsvml_log1pf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf4_ha_ex_B1_B3: +_unwind___jsvml_log1pf4_ha_ex_B1_B3: DD 802561 DD 2151487 DD 813108 @@ -856,19 +856,19 @@ _unwind___svml_log1pf4_ha_ex_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log1pf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log1pf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf4_ha_ex_B6_B10: +_unwind___jsvml_log1pf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_log1pf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_log1pf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -877,7 +877,7 @@ _unwind___svml_log1pf4_ha_ex_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_log1pf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_log1pf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -891,9 +891,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1pf16_ha_z0 + PUBLIC __jsvml_log1pf16_ha_z0 -__svml_log1pf16_ha_z0 PROC EXPORT +__jsvml_log1pf16_ha_z0 PROC EXPORT _B5_1:: @@ -906,9 +906,9 @@ L73:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm3, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+256] + vmovups zmm3, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+256] and r13, -64 - vmovups zmm4, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+320] + vmovups zmm4, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+320] vmovaps zmm5, zmm0 vmaxps zmm22, zmm3, zmm5 {sae} vminps zmm24, zmm3, zmm5 {sae} @@ -920,27 +920,27 @@ L73:: vsubps zmm27, zmm24, zmm25 {rn-sae} vxorps zmm28, zmm30, zmm4 vrndscaleps zmm22, zmm26, 104 {sae} - vmovups zmm24, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+128] - vmovups zmm26, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+448] + vmovups zmm24, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+128] + vmovups zmm26, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+448] vscalefps zmm29, zmm27, zmm28 {rn-sae} vfmsub213ps zmm2, zmm22, zmm3 {rn-sae} vgetexpps zmm23, zmm22 {sae} - vmovups zmm27, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+576] - vmovups zmm28, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+704] + vmovups zmm27, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+576] + vmovups zmm28, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+704] vmulps zmm31, zmm22, zmm29 {rn-sae} vaddps zmm1, zmm2, zmm31 {rn-sae} vsubps zmm0, zmm1, zmm2 {rn-sae} vsubps zmm2, zmm30, zmm3 {rn-sae} - vmovups zmm3, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+640] + vmovups zmm3, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+640] vmulps zmm30, zmm1, zmm1 {rn-sae} vsubps zmm25, zmm31, zmm0 {rn-sae} vsubps zmm2, zmm2, zmm23 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512] + vmovups zmm0, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512] vpsrld zmm31, zmm22, 18 - vpermt2ps zmm0, zmm31, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+64] - vpermt2ps zmm24, zmm31, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+192] + vpermt2ps zmm0, zmm31, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+64] + vpermt2ps zmm24, zmm31, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+192] vfmadd231ps zmm0, zmm3, zmm2 {rn-sae} - vmovups zmm3, ZMMWORD PTR [__svml_slog1p_ha_data_internal_avx512+512] + vmovups zmm3, ZMMWORD PTR [__jsvml_slog1p_ha_data_internal_avx512+512] vaddps zmm29, zmm24, zmm25 {rn-sae} vaddps zmm22, zmm0, zmm1 {rn-sae} vfmadd231ps zmm3, zmm26, zmm1 {rn-sae} @@ -1086,19 +1086,19 @@ _B5_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog1p_ha_cout_rare_internal + call __jsvml_slog1p_ha_cout_rare_internal jmp _B5_13 ALIGN 16 _B5_16:: -__svml_log1pf16_ha_z0 ENDP +__jsvml_log1pf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf16_ha_z0_B1_B9: +_unwind___jsvml_log1pf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -1110,13 +1110,13 @@ _unwind___svml_log1pf16_ha_z0_B1_B9: DD imagerel _B5_1 DD imagerel _B5_11 - DD imagerel _unwind___svml_log1pf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_log1pf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf16_ha_z0_B11_B15: +_unwind___jsvml_log1pf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -1152,7 +1152,7 @@ _unwind___svml_log1pf16_ha_z0_B11_B15: DD imagerel _B5_11 DD imagerel _B5_16 - DD imagerel _unwind___svml_log1pf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_log1pf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1166,9 +1166,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_log1pf8_ha_e9 + PUBLIC __jsvml_log1pf8_ha_e9 -__svml_log1pf8_ha_e9 PROC EXPORT +__jsvml_log1pf8_ha_e9 PROC EXPORT _B6_1:: @@ -1189,28 +1189,28 @@ L124:: vmovups YMMWORD PTR [368+rsp], ymm7 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [207+rsp] - vmovups ymm8, YMMWORD PTR [__svml_slog1p_ha_data_internal+1984] + vmovups ymm8, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1984] and r13, -64 - vmovups ymm2, YMMWORD PTR [__svml_slog1p_ha_data_internal+1088] + vmovups ymm2, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1088] vmovaps ymm4, ymm0 vmaxps ymm12, ymm8, ymm4 vminps ymm7, ymm8, ymm4 vandps ymm1, ymm4, ymm2 - vcmplt_oqps ymm14, ymm1, YMMWORD PTR [__svml_slog1p_ha_data_internal+1152] + vcmplt_oqps ymm14, ymm1, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1152] vaddps ymm0, ymm12, ymm7 - vmovups xmm1, XMMWORD PTR [__svml_slog1p_ha_data_internal+1344] - vorps ymm13, ymm14, YMMWORD PTR [__svml_slog1p_ha_data_internal+1216] + vmovups xmm1, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1344] + vorps ymm13, ymm14, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1216] vandps ymm5, ymm0, ymm13 - vandps ymm11, ymm5, YMMWORD PTR [__svml_slog1p_ha_data_internal+1536] - vorps ymm14, ymm11, YMMWORD PTR [__svml_slog1p_ha_data_internal+1600] + vandps ymm11, ymm5, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1536] + vorps ymm14, ymm11, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1600] vrcpps ymm0, ymm14 vsubps ymm9, ymm12, ymm5 - vcmplt_oqps ymm11, ymm4, YMMWORD PTR [__svml_slog1p_ha_data_internal+1664] + vcmplt_oqps ymm11, ymm4, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1664] vroundps ymm13, ymm0, 0 vaddps ymm9, ymm7, ymm9 - vcmpnle_uqps ymm12, ymm4, YMMWORD PTR [__svml_slog1p_ha_data_internal+1728] + vcmpnle_uqps ymm12, ymm4, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1728] vandnps ymm3, ymm2, ymm4 - vmovups xmm2, XMMWORD PTR [__svml_slog1p_ha_data_internal+1280] + vmovups xmm2, XMMWORD PTR [__jsvml_slog1p_ha_data_internal+1280] vorps ymm12, ymm11, ymm12 mov QWORD PTR [536+rsp], r13 vpand xmm14, xmm5, xmm2 @@ -1245,36 +1245,36 @@ L124:: movsxd r9, r9d movsxd r8, r8d vmovd r11d, xmm12 - vmovq xmm14, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - vmovq xmm13, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] + vmovq xmm14, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + vmovq xmm13, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] vpextrd r10d, xmm7, 3 vpextrd ecx, xmm12, 1 vpextrd r9d, xmm12, 3 movsxd r10, r10d - vmovq xmm9, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] movsxd rcx, ecx vpextrd r8d, xmm12, 2 movsxd r9, r9d movsxd r11, r11d movsxd r8, r8d - vmovq xmm8, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r10] - vmovq xmm7, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+rcx] - vmovq xmm12, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r9] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r10] + vmovq xmm7, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+rcx] + vmovq xmm12, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r9] vunpcklps xmm13, xmm14, xmm13 vunpcklps xmm14, xmm9, xmm8 - vmovq xmm5, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r11] - vmovq xmm11, QWORD PTR [imagerel(__svml_slog1p_ha_data_internal)-137216+rax+r8] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r11] + vmovq xmm11, QWORD PTR [imagerel(__jsvml_slog1p_ha_data_internal)-137216+rax+r8] vunpcklps xmm8, xmm7, xmm12 vunpcklps xmm5, xmm5, xmm11 vinsertf128 ymm11, ymm14, xmm8, 1 - vmulps ymm8, ymm1, YMMWORD PTR [__svml_slog1p_ha_data_internal+1408] + vmulps ymm8, ymm1, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1408] vinsertf128 ymm9, ymm13, xmm5, 1 - vmulps ymm5, ymm2, YMMWORD PTR [__svml_slog1p_ha_data_internal+1856] - vmulps ymm2, ymm2, YMMWORD PTR [__svml_slog1p_ha_data_internal+1920] + vmulps ymm5, ymm2, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1856] + vmulps ymm2, ymm2, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1920] vunpcklps ymm14, ymm9, ymm11 vunpckhps ymm7, ymm9, ymm11 vmulps ymm11, ymm1, ymm1 - vaddps ymm9, ymm8, YMMWORD PTR [__svml_slog1p_ha_data_internal+1472] + vaddps ymm9, ymm8, YMMWORD PTR [__jsvml_slog1p_ha_data_internal+1472] vaddps ymm14, ymm14, ymm5 vaddps ymm2, ymm7, ymm2 vmulps ymm12, ymm9, ymm11 @@ -1347,19 +1347,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog1p_ha_cout_rare_internal + call __jsvml_slog1p_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_log1pf8_ha_e9 ENDP +__jsvml_log1pf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf8_ha_e9_B1_B3: +_unwind___jsvml_log1pf8_ha_e9_B1_B3: DD 1202433 DD 4379737 DD 1538129 @@ -1378,13 +1378,13 @@ _unwind___svml_log1pf8_ha_e9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_log1pf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1pf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_log1pf8_ha_e9_B6_B10: +_unwind___jsvml_log1pf8_ha_e9_B6_B10: DD 665121 DD 1074214 DD 1127452 @@ -1393,7 +1393,7 @@ _unwind___svml_log1pf8_ha_e9_B6_B10: DD 419848 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_log1pf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_log1pf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1402,7 +1402,7 @@ _unwind___svml_log1pf8_ha_e9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_log1pf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_log1pf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1416,9 +1416,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_slog1p_ha_cout_rare_internal + PUBLIC __jsvml_slog1p_ha_cout_rare_internal -__svml_slog1p_ha_cout_rare_internal PROC +__jsvml_slog1p_ha_cout_rare_internal PROC _B7_1:: @@ -1658,13 +1658,13 @@ _B7_18:: _B7_19:: -__svml_slog1p_ha_cout_rare_internal ENDP +__jsvml_slog1p_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_slog1p_ha_cout_rare_internal_B1_B18: +_unwind___jsvml_slog1p_ha_cout_rare_internal_B1_B18: DD 202241 DD 227350 DD 33288 @@ -1676,7 +1676,7 @@ _unwind___svml_slog1p_ha_cout_rare_internal_B1_B18: DD imagerel _B7_1 DD imagerel _B7_19 - DD imagerel _unwind___svml_slog1p_ha_cout_rare_internal_B1_B18 + DD imagerel _unwind___jsvml_slog1p_ha_cout_rare_internal_B1_B18 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1684,8 +1684,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_slog1p_ha_data_internal_avx512 -__svml_slog1p_ha_data_internal_avx512 DD 1060205056 + PUBLIC __jsvml_slog1p_ha_data_internal_avx512 +__jsvml_slog1p_ha_data_internal_avx512 DD 1060205056 DD 1059688960 DD 1059187712 DD 1058701824 @@ -1877,8 +1877,8 @@ __svml_slog1p_ha_data_internal_avx512 DD 1060205056 DD 901758606 DD 901758606 DD 901758606 - PUBLIC __svml_slog1p_ha_data_internal -__svml_slog1p_ha_data_internal DD 3266227256 + PUBLIC __jsvml_slog1p_ha_data_internal +__jsvml_slog1p_ha_data_internal DD 3266227256 DD 3107766024 DD 3266228276 DD 3107776882 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_log_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log_windows_x86.S similarity index 80% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_log_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log_windows_x86.S index b5bea102c5d..f2fe14a98f6 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_log_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_log_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_logf4_ha_ex + PUBLIC __jsvml_logf4_ha_ex -__svml_logf4_ha_ex PROC EXPORT +__jsvml_logf4_ha_ex PROC EXPORT _B1_1:: @@ -53,43 +53,43 @@ L1:: movaps xmm3, xmm0 mov QWORD PTR [192+rsp], r13 movaps xmm5, xmm3 - movdqu xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+576] + movdqu xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+576] lea r13, QWORD PTR [111+rsp] - movdqu xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+640] + movdqu xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+640] paddd xmm4, xmm3 pcmpgtd xmm2, xmm4 and r13, -64 - movdqu xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+704] - movdqu xmm0, XMMWORD PTR [__svml_slog_ha_data_internal+768] + movdqu xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+704] + movdqu xmm0, XMMWORD PTR [__jsvml_slog_ha_data_internal+768] psubd xmm5, xmm4 pand xmm0, xmm5 psrad xmm5, 23 paddd xmm0, xmm4 movmskps eax, xmm2 - subps xmm0, XMMWORD PTR [__svml_slog_ha_data_internal+832] + subps xmm0, XMMWORD PTR [__jsvml_slog_ha_data_internal+832] cvtdq2ps xmm1, xmm5 - movups xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+512] + movups xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+512] mulps xmm2, xmm0 - movups xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+960] + movups xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+960] mulps xmm4, xmm1 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+448] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+448] mulps xmm2, xmm0 - movups xmm5, XMMWORD PTR [__svml_slog_ha_data_internal+896] + movups xmm5, XMMWORD PTR [__jsvml_slog_ha_data_internal+896] mulps xmm1, xmm5 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+384] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+384] mulps xmm2, xmm0 mov QWORD PTR [200+rsp], r13 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+320] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+320] mulps xmm2, xmm0 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+256] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+256] mulps xmm2, xmm0 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+192] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+192] mulps xmm2, xmm0 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+128] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+128] mulps xmm2, xmm0 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+64] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+64] mulps xmm2, xmm0 - addps xmm2, XMMWORD PTR [__svml_slog_ha_data_internal] + addps xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal] mulps xmm2, xmm0 mulps xmm2, xmm0 addps xmm0, xmm2 @@ -143,19 +143,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog_ha_cout_rare_internal + call __jsvml_slog_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_logf4_ha_ex ENDP +__jsvml_logf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf4_ha_ex_B1_B3: +_unwind___jsvml_logf4_ha_ex_B1_B3: DD 267777 DD 1627158 DD 1769739 @@ -167,13 +167,13 @@ _unwind___svml_logf4_ha_ex_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_logf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_logf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf4_ha_ex_B6_B10: +_unwind___jsvml_logf4_ha_ex_B6_B10: DD 527873 DD 287758 DD 340999 @@ -187,7 +187,7 @@ _unwind___svml_logf4_ha_ex_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_logf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_logf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -201,9 +201,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_logf4_ha_e9 + PUBLIC __jsvml_logf4_ha_e9 -__svml_logf4_ha_e9 PROC EXPORT +__jsvml_logf4_ha_e9 PROC EXPORT _B2_1:: @@ -217,40 +217,40 @@ L8:: vmovaps xmm5, xmm0 mov QWORD PTR [192+rsp], r13 lea r13, QWORD PTR [111+rsp] - vpaddd xmm0, xmm5, XMMWORD PTR [__svml_slog_ha_data_internal+576] + vpaddd xmm0, xmm5, XMMWORD PTR [__jsvml_slog_ha_data_internal+576] and r13, -64 - vmovups xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+640] - vmovups xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+704] + vmovups xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+640] + vmovups xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+704] vpcmpgtd xmm2, xmm1, xmm0 vpsubd xmm1, xmm5, xmm4 - vpand xmm3, xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+768] + vpand xmm3, xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+768] vpsrad xmm0, xmm1, 23 vpaddd xmm3, xmm3, xmm4 vcvtdq2ps xmm1, xmm0 - vsubps xmm0, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+832] + vsubps xmm0, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+832] vmovmskps edx, xmm2 - vmulps xmm2, xmm0, XMMWORD PTR [__svml_slog_ha_data_internal+512] + vmulps xmm2, xmm0, XMMWORD PTR [__jsvml_slog_ha_data_internal+512] mov QWORD PTR [200+rsp], r13 - vaddps xmm4, xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+448] + vaddps xmm4, xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+448] vmulps xmm2, xmm0, xmm4 - vaddps xmm3, xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+384] + vaddps xmm3, xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+384] vmulps xmm4, xmm0, xmm3 - vaddps xmm2, xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+320] + vaddps xmm2, xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+320] vmulps xmm3, xmm0, xmm2 - vaddps xmm4, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+256] + vaddps xmm4, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+256] vmulps xmm2, xmm0, xmm4 - vaddps xmm3, xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+192] + vaddps xmm3, xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+192] vmulps xmm4, xmm0, xmm3 - vaddps xmm2, xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+128] + vaddps xmm2, xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+128] vmulps xmm3, xmm0, xmm2 - vaddps xmm4, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+64] + vaddps xmm4, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+64] vmulps xmm2, xmm0, xmm4 - vaddps xmm3, xmm2, XMMWORD PTR [__svml_slog_ha_data_internal] + vaddps xmm3, xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal] vmulps xmm4, xmm0, xmm3 vmulps xmm2, xmm0, xmm4 vaddps xmm0, xmm0, xmm2 - vmulps xmm2, xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+960] - vmulps xmm1, xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+896] + vmulps xmm2, xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+960] + vmulps xmm1, xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+896] vaddps xmm0, xmm0, xmm2 vaddps xmm0, xmm0, xmm1 test edx, edx @@ -298,19 +298,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog_ha_cout_rare_internal + call __jsvml_slog_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_logf4_ha_e9 ENDP +__jsvml_logf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf4_ha_e9_B1_B3: +_unwind___jsvml_logf4_ha_e9_B1_B3: DD 268033 DD 1627159 DD 1769739 @@ -322,13 +322,13 @@ _unwind___svml_logf4_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_logf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_logf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf4_ha_e9_B6_B10: +_unwind___jsvml_logf4_ha_e9_B6_B10: DD 527873 DD 287758 DD 340999 @@ -342,7 +342,7 @@ _unwind___svml_logf4_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_logf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_logf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -356,9 +356,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_logf16_ha_z0 + PUBLIC __jsvml_logf16_ha_z0 -__svml_logf16_ha_z0 PROC EXPORT +__jsvml_logf16_ha_z0 PROC EXPORT _B3_1:: @@ -370,30 +370,30 @@ L15:: vmovaps zmm23, zmm0 vrcp14ps zmm22, zmm23 - vpaddd zmm4, zmm22, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512] - vmovups zmm1, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+128] - vmovups zmm2, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+256] - vmovups zmm22, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+640] - vmovups zmm3, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+704] - vpandd zmm24, zmm4, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+64] + vpaddd zmm4, zmm22, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512] + vmovups zmm1, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+128] + vmovups zmm2, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+256] + vmovups zmm22, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+640] + vmovups zmm3, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+704] + vpandd zmm24, zmm4, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+64] vpsrld zmm5, zmm24, 18 vgetexpps zmm0, zmm24 {sae} - vmovups zmm4, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+960] - vpermt2ps zmm1, zmm5, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+192] - vpermt2ps zmm2, zmm5, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+320] + vmovups zmm4, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+960] + vpermt2ps zmm1, zmm5, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+192] + vpermt2ps zmm2, zmm5, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+320] vfpclassps k2, zmm24, 255 - vmovups zmm5, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+896] + vmovups zmm5, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+896] vfmsub213ps zmm24, zmm23, zmm22 {rn-sae} kortestw k2, k2 vfnmadd231ps zmm1, zmm5, zmm0 {rn-sae} vfnmadd213ps zmm0, zmm4, zmm2 {rn-sae} - vmovups zmm2, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+768] + vmovups zmm2, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+768] vmulps zmm26, zmm24, zmm24 {rn-sae} vaddps zmm29, zmm1, zmm24 {rn-sae} vmovaps zmm27, zmm24 vfmadd213ps zmm27, zmm3, zmm2 {rn-sae} vsubps zmm25, zmm29, zmm1 {rn-sae} - vmovups zmm1, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+832] + vmovups zmm1, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+832] vsubps zmm28, zmm24, zmm25 {rn-sae} vfmadd213ps zmm27, zmm24, zmm1 {rn-sae} vfmadd213ps zmm27, zmm26, zmm0 {rn-sae} @@ -409,8 +409,8 @@ _B3_3:: vgetmantps zmm25, zmm23, 10 {sae} vgetexpps zmm28, zmm23 {sae} - vmovups zmm31, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+384] - vmovups zmm30, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+512] + vmovups zmm31, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+384] + vmovups zmm30, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+512] vrcp14ps zmm24, zmm25 vfpclassps k1, zmm23, 223 vrndscaleps zmm26, zmm24, 88 {sae} @@ -421,8 +421,8 @@ _B3_3:: vfmadd231ps zmm2, zmm3, zmm22 {rn-sae} vmulps zmm3, zmm22, zmm22 {rn-sae} vfmadd213ps zmm2, zmm22, zmm1 {rn-sae} - vpermt2ps zmm31, zmm27, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+448] - vpermt2ps zmm30, zmm27, ZMMWORD PTR [__svml_slog_ha_data_internal_avx512+576] + vpermt2ps zmm31, zmm27, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+448] + vpermt2ps zmm30, zmm27, ZMMWORD PTR [__jsvml_slog_ha_data_internal_avx512+576] vfmadd231ps zmm31, zmm5, zmm24 {rn-sae} vfmadd213ps zmm24, zmm4, zmm30 {rn-sae} vaddps zmm1, zmm31, zmm22 {rn-sae} @@ -437,7 +437,7 @@ _B3_3:: _B3_4:: -__svml_logf16_ha_z0 ENDP +__jsvml_logf16_ha_z0 ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -451,9 +451,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_logf4_ha_l9 + PUBLIC __jsvml_logf4_ha_l9 -__svml_logf4_ha_l9 PROC EXPORT +__jsvml_logf4_ha_l9 PROC EXPORT _B4_1:: @@ -467,31 +467,31 @@ L16:: vmovaps xmm4, xmm0 mov QWORD PTR [192+rsp], r13 lea r13, QWORD PTR [111+rsp] - vpaddd xmm0, xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+576] + vpaddd xmm0, xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+576] and r13, -64 - vmovups xmm5, XMMWORD PTR [__svml_slog_ha_data_internal+640] - vmovups xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+704] + vmovups xmm5, XMMWORD PTR [__jsvml_slog_ha_data_internal+640] + vmovups xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+704] vpcmpgtd xmm1, xmm5, xmm0 vpsubd xmm5, xmm4, xmm3 - vpand xmm2, xmm5, XMMWORD PTR [__svml_slog_ha_data_internal+768] + vpand xmm2, xmm5, XMMWORD PTR [__jsvml_slog_ha_data_internal+768] vpsrad xmm0, xmm5, 23 vpaddd xmm2, xmm2, xmm3 vmovmskps edx, xmm1 - vsubps xmm3, xmm2, XMMWORD PTR [__svml_slog_ha_data_internal+832] + vsubps xmm3, xmm2, XMMWORD PTR [__jsvml_slog_ha_data_internal+832] vcvtdq2ps xmm0, xmm0 - vmovups xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+512] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+448] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+384] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+320] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+256] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+192] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+128] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+64] - vfmadd213ps xmm1, xmm3, XMMWORD PTR [__svml_slog_ha_data_internal] + vmovups xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+512] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+448] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+384] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+320] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+256] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+192] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+128] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+64] + vfmadd213ps xmm1, xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal] vmulps xmm1, xmm3, xmm1 vfmadd213ps xmm1, xmm3, xmm3 - vfmadd231ps xmm1, xmm0, XMMWORD PTR [__svml_slog_ha_data_internal+960] - vfmadd132ps xmm0, xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+896] + vfmadd231ps xmm1, xmm0, XMMWORD PTR [__jsvml_slog_ha_data_internal+960] + vfmadd132ps xmm0, xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+896] mov QWORD PTR [200+rsp], r13 test edx, edx jne _B4_3 @@ -538,19 +538,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog_ha_cout_rare_internal + call __jsvml_slog_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_logf4_ha_l9 ENDP +__jsvml_logf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf4_ha_l9_B1_B3: +_unwind___jsvml_logf4_ha_l9_B1_B3: DD 268033 DD 1627159 DD 1769739 @@ -562,13 +562,13 @@ _unwind___svml_logf4_ha_l9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_logf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_logf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf4_ha_l9_B6_B10: +_unwind___jsvml_logf4_ha_l9_B6_B10: DD 527873 DD 287758 DD 340999 @@ -582,7 +582,7 @@ _unwind___svml_logf4_ha_l9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_logf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_logf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -596,9 +596,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_logf8_ha_e9 + PUBLIC __jsvml_logf8_ha_e9 -__svml_logf8_ha_e9 PROC EXPORT +__jsvml_logf8_ha_e9 PROC EXPORT _B5_1:: @@ -616,11 +616,11 @@ L23:: vmovaps ymm15, ymm0 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [303+rsp] - vmovups xmm3, XMMWORD PTR [__svml_slog_ha_data_internal+704] + vmovups xmm3, XMMWORD PTR [__jsvml_slog_ha_data_internal+704] and r13, -64 - vmovups xmm4, XMMWORD PTR [__svml_slog_ha_data_internal+768] - vmovups xmm0, XMMWORD PTR [__svml_slog_ha_data_internal+576] - vmovups xmm1, XMMWORD PTR [__svml_slog_ha_data_internal+640] + vmovups xmm4, XMMWORD PTR [__jsvml_slog_ha_data_internal+768] + vmovups xmm0, XMMWORD PTR [__jsvml_slog_ha_data_internal+576] + vmovups xmm1, XMMWORD PTR [__jsvml_slog_ha_data_internal+640] mov QWORD PTR [536+rsp], r13 vpsubd xmm5, xmm15, xmm3 vextractf128 xmm2, ymm15, 1 @@ -638,32 +638,32 @@ L23:: vpcmpgtd xmm1, xmm1, xmm2 vpackssdw xmm0, xmm5, xmm1 vpxor xmm2, xmm2, xmm2 - vsubps ymm1, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+832] + vsubps ymm1, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+832] vpacksswb xmm4, xmm0, xmm2 vpmovmskb edx, xmm4 - vmulps ymm3, ymm1, YMMWORD PTR [__svml_slog_ha_data_internal+512] - vaddps ymm6, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+448] + vmulps ymm3, ymm1, YMMWORD PTR [__jsvml_slog_ha_data_internal+512] + vaddps ymm6, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+448] vinsertf128 ymm14, ymm9, xmm14, 1 vcvtdq2ps ymm9, ymm14 vmulps ymm14, ymm1, ymm6 - vaddps ymm0, ymm14, YMMWORD PTR [__svml_slog_ha_data_internal+384] + vaddps ymm0, ymm14, YMMWORD PTR [__jsvml_slog_ha_data_internal+384] vmulps ymm2, ymm1, ymm0 - vaddps ymm3, ymm2, YMMWORD PTR [__svml_slog_ha_data_internal+320] + vaddps ymm3, ymm2, YMMWORD PTR [__jsvml_slog_ha_data_internal+320] vmulps ymm4, ymm1, ymm3 - vaddps ymm5, ymm4, YMMWORD PTR [__svml_slog_ha_data_internal+256] + vaddps ymm5, ymm4, YMMWORD PTR [__jsvml_slog_ha_data_internal+256] vmulps ymm6, ymm1, ymm5 - vaddps ymm14, ymm6, YMMWORD PTR [__svml_slog_ha_data_internal+192] + vaddps ymm14, ymm6, YMMWORD PTR [__jsvml_slog_ha_data_internal+192] vmulps ymm0, ymm1, ymm14 - vaddps ymm2, ymm0, YMMWORD PTR [__svml_slog_ha_data_internal+128] + vaddps ymm2, ymm0, YMMWORD PTR [__jsvml_slog_ha_data_internal+128] vmulps ymm3, ymm1, ymm2 - vaddps ymm4, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+64] + vaddps ymm4, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+64] vmulps ymm5, ymm1, ymm4 - vaddps ymm6, ymm5, YMMWORD PTR [__svml_slog_ha_data_internal] + vaddps ymm6, ymm5, YMMWORD PTR [__jsvml_slog_ha_data_internal] vmulps ymm14, ymm1, ymm6 vmulps ymm0, ymm1, ymm14 vaddps ymm1, ymm1, ymm0 - vmulps ymm0, ymm9, YMMWORD PTR [__svml_slog_ha_data_internal+960] - vmulps ymm9, ymm9, YMMWORD PTR [__svml_slog_ha_data_internal+896] + vmulps ymm0, ymm9, YMMWORD PTR [__jsvml_slog_ha_data_internal+960] + vmulps ymm9, ymm9, YMMWORD PTR [__jsvml_slog_ha_data_internal+896] vaddps ymm1, ymm1, ymm0 vaddps ymm0, ymm1, ymm9 test dl, dl @@ -730,19 +730,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog_ha_cout_rare_internal + call __jsvml_slog_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_logf8_ha_e9 ENDP +__jsvml_logf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf8_ha_e9_B1_B3: +_unwind___jsvml_logf8_ha_e9_B1_B3: DD 801537 DD 4379707 DD 1665071 @@ -758,13 +758,13 @@ _unwind___svml_logf8_ha_e9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_logf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_logf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf8_ha_e9_B6_B10: +_unwind___jsvml_logf8_ha_e9_B6_B10: DD 1065249 DD 1860673 DD 1913911 @@ -776,7 +776,7 @@ _unwind___svml_logf8_ha_e9_B6_B10: DD 817163 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_logf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_logf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -785,7 +785,7 @@ _unwind___svml_logf8_ha_e9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_logf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_logf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -799,9 +799,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_logf8_ha_l9 + PUBLIC __jsvml_logf8_ha_l9 -__svml_logf8_ha_l9 PROC EXPORT +__jsvml_logf8_ha_l9 PROC EXPORT _B6_1:: @@ -816,30 +816,30 @@ L50:: lea r13, QWORD PTR [431+rsp] vmovaps ymm4, ymm0 and r13, -64 - vmovups ymm5, YMMWORD PTR [__svml_slog_ha_data_internal+640] - vmovups ymm1, YMMWORD PTR [__svml_slog_ha_data_internal+704] - vpaddd ymm0, ymm4, YMMWORD PTR [__svml_slog_ha_data_internal+576] + vmovups ymm5, YMMWORD PTR [__jsvml_slog_ha_data_internal+640] + vmovups ymm1, YMMWORD PTR [__jsvml_slog_ha_data_internal+704] + vpaddd ymm0, ymm4, YMMWORD PTR [__jsvml_slog_ha_data_internal+576] vpcmpgtd ymm2, ymm5, ymm0 vpsubd ymm5, ymm4, ymm1 - vpand ymm3, ymm5, YMMWORD PTR [__svml_slog_ha_data_internal+768] + vpand ymm3, ymm5, YMMWORD PTR [__jsvml_slog_ha_data_internal+768] vpsrad ymm0, ymm5, 23 vpaddd ymm1, ymm3, ymm1 vcvtdq2ps ymm0, ymm0 - vsubps ymm3, ymm1, YMMWORD PTR [__svml_slog_ha_data_internal+832] + vsubps ymm3, ymm1, YMMWORD PTR [__jsvml_slog_ha_data_internal+832] vmovmskps edx, ymm2 - vmovups ymm2, YMMWORD PTR [__svml_slog_ha_data_internal+512] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+448] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+384] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+320] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+256] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+192] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+128] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal+64] - vfmadd213ps ymm2, ymm3, YMMWORD PTR [__svml_slog_ha_data_internal] + vmovups ymm2, YMMWORD PTR [__jsvml_slog_ha_data_internal+512] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+448] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+384] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+320] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+256] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+192] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+128] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal+64] + vfmadd213ps ymm2, ymm3, YMMWORD PTR [__jsvml_slog_ha_data_internal] vmulps ymm1, ymm3, ymm2 vfmadd213ps ymm1, ymm3, ymm3 - vfmadd231ps ymm1, ymm0, YMMWORD PTR [__svml_slog_ha_data_internal+960] - vfmadd132ps ymm0, ymm1, YMMWORD PTR [__svml_slog_ha_data_internal+896] + vfmadd231ps ymm1, ymm0, YMMWORD PTR [__jsvml_slog_ha_data_internal+960] + vfmadd132ps ymm0, ymm1, YMMWORD PTR [__jsvml_slog_ha_data_internal+896] mov QWORD PTR [536+rsp], r13 test edx, edx jne _B6_3 @@ -907,19 +907,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_slog_ha_cout_rare_internal + call __jsvml_slog_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_logf8_ha_l9 ENDP +__jsvml_logf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf8_ha_l9_B1_B3: +_unwind___jsvml_logf8_ha_l9_B1_B3: DD 267009 DD 4379667 DD 4522251 @@ -931,13 +931,13 @@ _unwind___svml_logf8_ha_l9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_logf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_logf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_logf8_ha_l9_B6_B10: +_unwind___jsvml_logf8_ha_l9_B6_B10: DD 1860865 DD 2909285 DD 2962523 @@ -961,7 +961,7 @@ _unwind___svml_logf8_ha_l9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_logf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_logf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -975,9 +975,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_slog_ha_cout_rare_internal + PUBLIC __jsvml_slog_ha_cout_rare_internal -__svml_slog_ha_cout_rare_internal PROC +__jsvml_slog_ha_cout_rare_internal PROC _B7_1:: @@ -1179,13 +1179,13 @@ _B7_15:: _B7_16:: -__svml_slog_ha_cout_rare_internal ENDP +__jsvml_slog_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_slog_ha_cout_rare_internal_B1_B15: +_unwind___jsvml_slog_ha_cout_rare_internal_B1_B15: DD 67585 DD 25096 @@ -1196,7 +1196,7 @@ _unwind___svml_slog_ha_cout_rare_internal_B1_B15: DD imagerel _B7_1 DD imagerel _B7_16 - DD imagerel _unwind___svml_slog_ha_cout_rare_internal_B1_B15 + DD imagerel _unwind___jsvml_slog_ha_cout_rare_internal_B1_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1204,8 +1204,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_slog_ha_data_internal_avx512 -__svml_slog_ha_data_internal_avx512 DD 131072 + PUBLIC __jsvml_slog_ha_data_internal_avx512 +__jsvml_slog_ha_data_internal_avx512 DD 131072 DD 131072 DD 131072 DD 131072 @@ -1685,8 +1685,8 @@ __svml_slog_ha_data_internal_avx512 DD 131072 DD 3204448254 DD 3204448254 DD 3204448254 - PUBLIC __svml_slog_ha_data_internal -__svml_slog_ha_data_internal DD 3204448256 + PUBLIC __jsvml_slog_ha_data_internal +__jsvml_slog_ha_data_internal DD 3204448256 DD 3204448256 DD 3204448256 DD 3204448256 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_pow_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_pow_windows_x86.S similarity index 92% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_pow_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_pow_windows_x86.S index d246e575bb1..691c1050840 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_pow_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_pow_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_powf16_ha_z0 + PUBLIC __jsvml_powf16_ha_z0 -__svml_powf16_ha_z0 PROC EXPORT +__jsvml_powf16_ha_z0 PROC EXPORT _B1_1:: @@ -58,28 +58,28 @@ L1:: vrndscaleps zmm24, zmm23, 88 {sae} mov QWORD PTR [1384+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm26, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+576] + vmovups zmm26, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+576] and r13, -64 - vmovups zmm25, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+512] - vmovups zmm28, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+640] - vmovups zmm29, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+704] - vmovups zmm30, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512] + vmovups zmm25, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+512] + vmovups zmm28, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+640] + vmovups zmm29, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+704] + vmovups zmm30, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512] vfmsub213ps zmm5, zmm24, zmm26 {rn-sae} - vmovups zmm23, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+832] - vmovups zmm4, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+128] + vmovups zmm23, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+832] + vmovups zmm4, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+128] vcmpps k2, zmm24, zmm25, 17 {sae} vmulps zmm3, zmm5, zmm5 {rn-sae} vfmadd231ps zmm29, zmm28, zmm5 {rn-sae} - vmovups zmm25, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+896] - vmovups zmm28, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+1024] + vmovups zmm25, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+896] + vmovups zmm28, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+1024] vpsrld zmm27, zmm24, 18 vaddps zmm31{k2}, zmm31, zmm26 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+960] - vpermt2ps zmm30, zmm27, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+64] - vpermt2ps zmm4, zmm27, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+192] + vmovups zmm26, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+960] + vpermt2ps zmm30, zmm27, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+64] + vpermt2ps zmm4, zmm27, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+192] vaddps zmm24, zmm30, zmm31 {rn-sae} vmovaps zmm22, zmm1 - vmovups zmm1, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+768] + vmovups zmm1, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+768] vfpclassps k1, zmm22, 153 vfmadd231ps zmm1, zmm29, zmm5 {rn-sae} kmovw eax, k1 @@ -92,23 +92,23 @@ L1:: vmovaps zmm27, zmm24 vfmadd231ps zmm27, zmm26, zmm5 {rn-sae} vfmadd231ps zmm2, zmm25, zmm5 {rn-sae} - vmovups zmm25, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+1216] + vmovups zmm25, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+1216] vsubps zmm4, zmm27, zmm24 {rn-sae} vmovaps zmm30, zmm27 vfmadd231ps zmm30, zmm28, zmm3 {rn-sae} vfmsub213ps zmm5, zmm26, zmm4 {rn-sae} - vmovups zmm26, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+1344] + vmovups zmm26, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+1344] vaddps zmm1, zmm30, zmm2 {rn-sae} vsubps zmm29, zmm30, zmm27 {rn-sae} vmulps zmm4, zmm1, zmm22 {rz-sae} vfmsub213ps zmm3, zmm28, zmm29 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+384] - vmovups zmm29, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+256] + vmovups zmm28, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+384] + vmovups zmm29, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+256] vsubps zmm31, zmm1, zmm30 {rn-sae} vaddps zmm3, zmm5, zmm3 {rn-sae} vfmsub213ps zmm1, zmm22, zmm4 {rz-sae} - vmovups zmm5, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+1088] - vmovups zmm30, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+1280] + vmovups zmm5, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+1088] + vmovups zmm30, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+1280] vsubps zmm2, zmm2, zmm31 {rn-sae} vaddps zmm2, zmm2, zmm3 {rn-sae} vfmadd213ps zmm2, zmm22, zmm1 {rz-sae} @@ -117,10 +117,10 @@ L1:: vaddps zmm23, zmm1, zmm5 {rd-sae} vreduceps zmm3, zmm1, 81 {sae} vsubps zmm5, zmm2, zmm4 {rn-sae} - vpermt2ps zmm28, zmm23, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+448] - vpermt2ps zmm29, zmm23, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+320] + vpermt2ps zmm28, zmm23, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+448] + vpermt2ps zmm29, zmm23, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+320] vaddps zmm24, zmm3, zmm5 {rn-sae} - vandps zmm27, zmm24, ZMMWORD PTR [__svml_spow_ha_data_internal_avx512+1152] + vandps zmm27, zmm24, ZMMWORD PTR [__jsvml_spow_ha_data_internal_avx512+1152] vfmadd231ps zmm30, zmm25, zmm27 {rn-sae} vfmadd213ps zmm30, zmm27, zmm26 {rn-sae} vfmadd213ps zmm30, zmm27, zmm28 {rn-sae} @@ -260,19 +260,19 @@ _B1_15:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_spow_ha_cout_rare_internal + call __jsvml_spow_ha_cout_rare_internal jmp _B1_13 ALIGN 16 _B1_16:: -__svml_powf16_ha_z0 ENDP +__jsvml_powf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf16_ha_z0_B1_B9: +_unwind___jsvml_powf16_ha_z0_B1_B9: DD 276481 DD 11392056 DD 11469067 @@ -284,13 +284,13 @@ _unwind___svml_powf16_ha_z0_B1_B9: DD imagerel _B1_1 DD imagerel _B1_11 - DD imagerel _unwind___svml_powf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_powf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf16_ha_z0_B11_B15: +_unwind___jsvml_powf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -326,7 +326,7 @@ _unwind___svml_powf16_ha_z0_B11_B15: DD imagerel _B1_11 DD imagerel _B1_16 - DD imagerel _unwind___svml_powf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_powf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -340,9 +340,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_powf8_ha_l9 + PUBLIC __jsvml_powf8_ha_l9 -__svml_powf8_ha_l9 PROC EXPORT +__jsvml_powf8_ha_l9 PROC EXPORT _B2_1:: @@ -366,14 +366,14 @@ L52:: vmovups YMMWORD PTR [272+rsp], ymm6 mov QWORD PTR [592+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovupd ymm4, YMMWORD PTR [__svml_spow_ha_data_internal+12992] + vmovupd ymm4, YMMWORD PTR [__jsvml_spow_ha_data_internal+12992] and r13, -64 - vmovupd ymm5, YMMWORD PTR [__svml_spow_ha_data_internal+13056] + vmovupd ymm5, YMMWORD PTR [__jsvml_spow_ha_data_internal+13056] vmovups ymm14, YMMWORD PTR [__VPACK_ODD_ind_2742_0_4] vmovaps ymm13, ymm1 mov QWORD PTR [600+rsp], r13 vcvtps2pd ymm7, xmm0 - vpsubd ymm10, ymm0, YMMWORD PTR [__svml_spow_ha_data_internal] + vpsubd ymm10, ymm0, YMMWORD PTR [__jsvml_spow_ha_data_internal] vextractf128 xmm9, ymm0, 1 vcvtps2pd ymm2, xmm9 vandpd ymm8, ymm7, ymm4 @@ -393,7 +393,7 @@ L52:: vpermps ymm6, ymm14, ymm7 vpermps ymm7, ymm14, ymm2 vroundpd ymm14, ymm5, 0 - vmovupd ymm5, YMMWORD PTR [__svml_spow_ha_data_internal+13312] + vmovupd ymm5, YMMWORD PTR [__jsvml_spow_ha_data_internal+13312] vfmsub213pd ymm8, ymm1, ymm5 vfmsub213pd ymm4, ymm14, ymm5 vcvtdq2pd ymm2, xmm6 @@ -403,16 +403,16 @@ L52:: vpextrd ecx, xmm15, 2 movsxd rcx, ecx vcvtdq2pd ymm3, xmm7 - vmovsd xmm5, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] + vmovsd xmm5, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] vextracti128 xmm7, ymm15, 1 - vmovhpd xmm5, xmm5, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] + vmovhpd xmm5, xmm5, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] vmovd r8d, xmm7 movsxd r8, r8d vpextrd r9d, xmm7, 2 movsxd r9, r9d vmovd r10d, xmm6 - vmovsd xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r8] - vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r9] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r8] + vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r9] vpextrd r11d, xmm6, 2 vextracti128 xmm6, ymm6, 1 vmovd eax, xmm6 @@ -421,39 +421,39 @@ L52:: movsxd rax, eax vpextrd ecx, xmm6, 2 movsxd rcx, ecx - vmovsd xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r10] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r10] vinsertf128 ymm5, ymm5, xmm7, 1 - vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r11] - vmovsd xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] - vmovhpd xmm6, xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] - vmovupd ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+13504] + vmovhpd xmm7, xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r11] + vmovsd xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] + vmovhpd xmm6, xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] + vmovupd ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+13504] vcmplt_oqpd ymm1, ymm15, ymm1 vcmplt_oqpd ymm14, ymm15, ymm14 - vmovupd ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+13568] + vmovupd ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+13568] vandpd ymm1, ymm1, ymm15 vandpd ymm14, ymm14, ymm15 - vmovupd ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+13632] + vmovupd ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+13632] vorpd ymm1, ymm1, ymm15 vorpd ymm14, ymm14, ymm15 vsubpd ymm2, ymm2, ymm1 vsubpd ymm3, ymm3, ymm14 - vmovupd ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+12928] + vmovupd ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+12928] vmovapd ymm14, ymm15 vinsertf128 ymm6, ymm7, xmm6, 1 - vmovupd ymm7, YMMWORD PTR [__svml_spow_ha_data_internal+13696] + vmovupd ymm7, YMMWORD PTR [__jsvml_spow_ha_data_internal+13696] vmulpd ymm1, ymm7, ymm2 vmulpd ymm2, ymm7, ymm3 - vmovupd ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+12864] + vmovupd ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+12864] vmulpd ymm7, ymm8, ymm8 vfmadd231pd ymm14, ymm3, ymm8 vfmadd231pd ymm15, ymm3, ymm4 vmulpd ymm3, ymm4, ymm4 vmulpd ymm14, ymm14, ymm7 vmulpd ymm15, ymm15, ymm3 - vmovupd ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+30464] + vmovupd ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+30464] vaddpd ymm8, ymm8, ymm14 vaddpd ymm4, ymm4, ymm15 - vmovups ymm14, YMMWORD PTR [__svml_spow_ha_data_internal+64] + vmovups ymm14, YMMWORD PTR [__jsvml_spow_ha_data_internal+64] vaddpd ymm8, ymm5, ymm8 vaddpd ymm4, ymm6, ymm4 vaddpd ymm1, ymm1, ymm8 @@ -463,12 +463,12 @@ L52:: vextractf128 xmm11, ymm13, 1 vcvtps2pd ymm9, xmm13 vcvtps2pd ymm12, xmm11 - vpand ymm11, ymm13, YMMWORD PTR [__svml_spow_ha_data_internal+192] + vpand ymm11, ymm13, YMMWORD PTR [__jsvml_spow_ha_data_internal+192] vmulpd ymm7, ymm9, ymm1 vmovups ymm1, YMMWORD PTR [__VPACK_ODD_ind_2743_0_4] vmulpd ymm8, ymm12, ymm8 - vmovupd ymm12, YMMWORD PTR [__svml_spow_ha_data_internal+30400] - vmovupd ymm9, YMMWORD PTR [__svml_spow_ha_data_internal+30528] + vmovupd ymm12, YMMWORD PTR [__jsvml_spow_ha_data_internal+30400] + vmovupd ymm9, YMMWORD PTR [__jsvml_spow_ha_data_internal+30528] vmulpd ymm5, ymm12, ymm7 vmulpd ymm4, ymm12, ymm8 vsubpd ymm12, ymm5, ymm9 @@ -479,19 +479,19 @@ L52:: vsubpd ymm3, ymm9, ymm3 vsubpd ymm5, ymm5, ymm2 vsubpd ymm2, ymm4, ymm3 - vmovupd ymm4, YMMWORD PTR [__svml_spow_ha_data_internal+30592] + vmovupd ymm4, YMMWORD PTR [__jsvml_spow_ha_data_internal+30592] vpermps ymm6, ymm1, ymm7 vpermps ymm7, ymm1, ymm8 - vmovups ymm8, YMMWORD PTR [__svml_spow_ha_data_internal+128] + vmovups ymm8, YMMWORD PTR [__jsvml_spow_ha_data_internal+128] vpor ymm1, ymm15, ymm10 vpcmpgtd ymm10, ymm11, ymm8 vpcmpeqd ymm11, ymm11, ymm8 - vmovupd ymm8, YMMWORD PTR [__svml_spow_ha_data_internal+30656] + vmovupd ymm8, YMMWORD PTR [__jsvml_spow_ha_data_internal+30656] vinsertf128 ymm7, ymm6, xmm7, 1 vpor ymm6, ymm10, ymm11 vpor ymm14, ymm1, ymm6 - vandps ymm7, ymm7, YMMWORD PTR [__svml_spow_ha_data_internal+30720] - vpcmpgtd ymm15, ymm7, YMMWORD PTR [__svml_spow_ha_data_internal+30784] + vandps ymm7, ymm7, YMMWORD PTR [__jsvml_spow_ha_data_internal+30720] + vpcmpgtd ymm15, ymm7, YMMWORD PTR [__jsvml_spow_ha_data_internal+30784] vpor ymm11, ymm14, ymm15 vmovmskps eax, ymm11 vandps ymm11, ymm12, ymm8 @@ -505,15 +505,15 @@ L52:: vmovd r8d, xmm11 vmovd r10d, xmm1 shl r8d, 3 - vmovq xmm3, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] vpextrd r9d, xmm11, 2 shl r10d, 3 vpextrd ecx, xmm1, 2 shl r9d, 3 shl ecx, 3 - vmovq xmm2, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r10] - vmovhpd xmm11, xmm3, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r9] - vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] + vmovq xmm2, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r10] + vmovhpd xmm11, xmm3, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r9] + vmovhpd xmm3, xmm2, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] vextracti128 xmm5, ymm10, 1 vmovd r8d, xmm10 vmovd r11d, xmm5 @@ -522,11 +522,11 @@ L52:: shl r11d, 3 vpextrd ecx, xmm5, 2 shl r9d, 3 - vmovq xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] shl ecx, 3 - vmovq xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r11] - vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r9] - vmovhpd xmm5, xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r11] + vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r9] + vmovhpd xmm5, xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] vinsertf128 ymm11, ymm11, xmm3, 1 vfmadd213pd ymm11, ymm8, ymm11 vinsertf128 ymm14, ymm7, xmm5, 1 @@ -596,19 +596,19 @@ _B2_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_spow_ha_cout_rare_internal + call __jsvml_spow_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_powf8_ha_l9 ENDP +__jsvml_powf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf8_ha_l9_B1_B3: +_unwind___jsvml_powf8_ha_l9_B1_B3: DD 1602561 DD 4904052 DD 1140844 @@ -630,19 +630,19 @@ _unwind___svml_powf8_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_powf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_powf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf8_ha_l9_B6_B10: +_unwind___jsvml_powf8_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_powf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_powf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -651,7 +651,7 @@ _unwind___svml_powf8_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_powf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_powf8_ha_l9_B6_B10 .pdata ENDS _RDATA SEGMENT READ PAGE 'DATA' @@ -685,9 +685,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_powf4_ha_e9 + PUBLIC __jsvml_powf4_ha_e9 -__svml_powf4_ha_e9 PROC EXPORT +__jsvml_powf4_ha_e9 PROC EXPORT _B3_1:: @@ -710,17 +710,17 @@ L79:: vmovups XMMWORD PTR [336+rsp], xmm6 mov QWORD PTR [368+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd ymm2, ymm10, YMMWORD PTR [__svml_spow_ha_data_internal+12992] + vandpd ymm2, ymm10, YMMWORD PTR [__jsvml_spow_ha_data_internal+12992] and r13, -64 - vorpd ymm3, ymm2, YMMWORD PTR [__svml_spow_ha_data_internal+13056] + vorpd ymm3, ymm2, YMMWORD PTR [__jsvml_spow_ha_data_internal+13056] vcvtpd2ps xmm13, ymm3 vcvtps2pd ymm4, xmm9 - vmovups xmm6, XMMWORD PTR [__svml_spow_ha_data_internal+64] - vmovups xmm5, XMMWORD PTR [__svml_spow_ha_data_internal+128] - vpand xmm8, xmm9, XMMWORD PTR [__svml_spow_ha_data_internal+192] + vmovups xmm6, XMMWORD PTR [__jsvml_spow_ha_data_internal+64] + vmovups xmm5, XMMWORD PTR [__jsvml_spow_ha_data_internal+128] + vpand xmm8, xmm9, XMMWORD PTR [__jsvml_spow_ha_data_internal+192] vrcpps xmm11, xmm13 vcvtps2pd ymm1, xmm11 - vpsubd xmm7, xmm0, XMMWORD PTR [__svml_spow_ha_data_internal] + vpsubd xmm7, xmm0, XMMWORD PTR [__jsvml_spow_ha_data_internal] mov QWORD PTR [376+rsp], r13 vpsrlq xmm13, xmm10, 20 vextractf128 xmm2, ymm10, 1 @@ -729,7 +729,7 @@ L79:: vshufps xmm13, xmm13, xmm11, 221 vcvtdq2pd ymm1, xmm13 vmulpd ymm3, ymm3, ymm2 - vsubpd ymm3, ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+13312] + vsubpd ymm3, ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+13312] vpsrlq xmm13, xmm2, 40 vextractf128 xmm11, ymm2, 1 vmovd eax, xmm13 @@ -741,19 +741,19 @@ L79:: vpextrd r9d, xmm10, 2 movsxd rcx, ecx movsxd r9, r9d - vmovsd xmm11, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] - vmovsd xmm13, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r8] - vmovhpd xmm11, xmm11, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] - vmovhpd xmm10, xmm13, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r9] + vmovsd xmm11, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] + vmovsd xmm13, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r8] + vmovhpd xmm11, xmm11, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] + vmovhpd xmm10, xmm13, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r9] vinsertf128 ymm13, ymm11, xmm10, 1 - vcmpgt_oqpd ymm11, ymm2, YMMWORD PTR [__svml_spow_ha_data_internal+13504] - vandpd ymm10, ymm11, YMMWORD PTR [__svml_spow_ha_data_internal+13568] - vmulpd ymm11, ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+12864] - vorpd ymm2, ymm10, YMMWORD PTR [__svml_spow_ha_data_internal+13632] + vcmpgt_oqpd ymm11, ymm2, YMMWORD PTR [__jsvml_spow_ha_data_internal+13504] + vandpd ymm10, ymm11, YMMWORD PTR [__jsvml_spow_ha_data_internal+13568] + vmulpd ymm11, ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+12864] + vorpd ymm2, ymm10, YMMWORD PTR [__jsvml_spow_ha_data_internal+13632] vsubpd ymm1, ymm1, ymm2 vmulpd ymm2, ymm3, ymm3 - vmulpd ymm10, ymm1, YMMWORD PTR [__svml_spow_ha_data_internal+13696] - vaddpd ymm1, ymm11, YMMWORD PTR [__svml_spow_ha_data_internal+12928] + vmulpd ymm10, ymm1, YMMWORD PTR [__jsvml_spow_ha_data_internal+13696] + vaddpd ymm1, ymm11, YMMWORD PTR [__jsvml_spow_ha_data_internal+12928] vmulpd ymm11, ymm1, ymm2 vpcmpgtd xmm2, xmm7, xmm6 vpcmpeqd xmm6, xmm7, xmm6 @@ -763,9 +763,9 @@ L79:: vaddpd ymm13, ymm13, ymm3 vaddpd ymm10, ymm10, ymm13 vmulpd ymm13, ymm4, ymm10 - vmovupd ymm10, YMMWORD PTR [__svml_spow_ha_data_internal+30464] - vmulpd ymm3, ymm13, YMMWORD PTR [__svml_spow_ha_data_internal+30400] - vsubpd ymm4, ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+30528] + vmovupd ymm10, YMMWORD PTR [__jsvml_spow_ha_data_internal+30464] + vmulpd ymm3, ymm13, YMMWORD PTR [__jsvml_spow_ha_data_internal+30400] + vsubpd ymm4, ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+30528] vaddpd ymm11, ymm10, ymm4 vsubpd ymm4, ymm11, ymm10 vpor xmm10, xmm2, xmm6 @@ -773,12 +773,12 @@ L79:: vextractf128 xmm1, ymm13, 1 vshufps xmm13, xmm13, xmm1, 221 vpor xmm1, xmm7, xmm5 - vandps xmm13, xmm13, XMMWORD PTR [__svml_spow_ha_data_internal+30720] + vandps xmm13, xmm13, XMMWORD PTR [__jsvml_spow_ha_data_internal+30720] vpor xmm2, xmm10, xmm1 - vpcmpgtd xmm5, xmm13, XMMWORD PTR [__svml_spow_ha_data_internal+30784] - vmovupd xmm7, XMMWORD PTR [__svml_spow_ha_data_internal+30656] + vpcmpgtd xmm5, xmm13, XMMWORD PTR [__jsvml_spow_ha_data_internal+30784] + vmovupd xmm7, XMMWORD PTR [__jsvml_spow_ha_data_internal+30656] vpor xmm6, xmm2, xmm5 - vmulpd ymm1, ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+30592] + vmulpd ymm1, ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+30592] vmovmskps eax, xmm6 vandps xmm8, xmm11, xmm7 vextractf128 xmm13, ymm11, 1 @@ -793,11 +793,11 @@ L79:: shl ecx, 3 vpextrd r8d, xmm10, 2 shl r11d, 3 - vmovq xmm4, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r10] + vmovq xmm4, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r10] shl r8d, 3 - vmovq xmm8, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] - vmovhpd xmm4, xmm4, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r11] - vmovhpd xmm10, xmm8, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + vmovq xmm8, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] + vmovhpd xmm4, xmm4, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r11] + vmovhpd xmm10, xmm8, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] vinsertf128 ymm2, ymm4, xmm10, 1 vmulpd ymm3, ymm2, ymm1 vaddpd ymm5, ymm2, ymm3 @@ -864,19 +864,19 @@ _B3_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_spow_ha_cout_rare_internal + call __jsvml_spow_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_powf4_ha_e9 ENDP +__jsvml_powf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf4_ha_e9_B1_B3: +_unwind___jsvml_powf4_ha_e9_B1_B3: DD 1204481 DD 3069025 DD 1402969 @@ -895,19 +895,19 @@ _unwind___svml_powf4_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_powf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_powf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf4_ha_e9_B6_B10: +_unwind___jsvml_powf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_powf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_powf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -916,7 +916,7 @@ _unwind___svml_powf4_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_powf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_powf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -930,9 +930,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_powf8_ha_e9 + PUBLIC __jsvml_powf8_ha_e9 -__svml_powf8_ha_e9 PROC EXPORT +__jsvml_powf8_ha_e9 PROC EXPORT _B4_1:: @@ -959,11 +959,11 @@ L100:: lea r13, QWORD PTR [111+rsp] and r13, -64 vmovups YMMWORD PTR [32+r13], ymm0 - vmovupd ymm9, YMMWORD PTR [__svml_spow_ha_data_internal+12992] - vmovupd ymm6, YMMWORD PTR [__svml_spow_ha_data_internal+13056] - vmovups xmm2, XMMWORD PTR [__svml_spow_ha_data_internal] + vmovupd ymm9, YMMWORD PTR [__jsvml_spow_ha_data_internal+12992] + vmovupd ymm6, YMMWORD PTR [__jsvml_spow_ha_data_internal+13056] + vmovups xmm2, XMMWORD PTR [__jsvml_spow_ha_data_internal] vcvtps2pd ymm3, xmm11 - vmovups xmm14, XMMWORD PTR [__svml_spow_ha_data_internal+192] + vmovups xmm14, XMMWORD PTR [__jsvml_spow_ha_data_internal+192] vpand xmm8, xmm11, xmm14 vmovdqu XMMWORD PTR [32+rsp], xmm8 vmovups YMMWORD PTR [96+r13], ymm1 @@ -998,7 +998,7 @@ L100:: vpsrlq xmm4, xmm9, 20 vshufps xmm8, xmm13, xmm4, 221 vroundpd ymm13, ymm10, 0 - vmovupd ymm9, YMMWORD PTR [__svml_spow_ha_data_internal+13312] + vmovupd ymm9, YMMWORD PTR [__jsvml_spow_ha_data_internal+13312] vcvtdq2pd ymm12, xmm8 vmulpd ymm4, ymm6, ymm13 vsubpd ymm10, ymm5, ymm9 @@ -1011,16 +1011,16 @@ L100:: vmovd r8d, xmm7 vpextrd ecx, xmm6, 2 movsxd rcx, ecx - vmovsd xmm8, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] + vmovsd xmm8, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] movsxd r8, r8d vpextrd r9d, xmm7, 2 movsxd r9, r9d - vmovhpd xmm8, xmm8, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] - vmovsd xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r8] + vmovhpd xmm8, xmm8, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r8] vpsrlq xmm5, xmm13, 40 vextractf128 xmm4, ymm13, 1 vmovd r10d, xmm5 - vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r9] + vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r9] vpsrlq xmm4, xmm4, 40 vmovd eax, xmm4 movsxd r10, r10d @@ -1029,28 +1029,28 @@ L100:: movsxd rax, eax vpextrd ecx, xmm4, 2 movsxd rcx, ecx - vmovsd xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r10] - vmovhpd xmm5, xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r11] - vmovsd xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] - vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] - vmovupd ymm6, YMMWORD PTR [__svml_spow_ha_data_internal+13504] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r10] + vmovhpd xmm5, xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r11] + vmovsd xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] + vmovhpd xmm4, xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] + vmovupd ymm6, YMMWORD PTR [__jsvml_spow_ha_data_internal+13504] vcmplt_oqpd ymm14, ymm6, ymm14 vcmplt_oqpd ymm6, ymm6, ymm13 vinsertf128 ymm8, ymm8, xmm7, 1 - vmovupd ymm7, YMMWORD PTR [__svml_spow_ha_data_internal+13568] + vmovupd ymm7, YMMWORD PTR [__jsvml_spow_ha_data_internal+13568] vandpd ymm13, ymm14, ymm7 vandpd ymm14, ymm6, ymm7 - vmovupd ymm7, YMMWORD PTR [__svml_spow_ha_data_internal+13632] + vmovupd ymm7, YMMWORD PTR [__jsvml_spow_ha_data_internal+13632] vorpd ymm13, ymm13, ymm7 vorpd ymm14, ymm14, ymm7 vsubpd ymm11, ymm11, ymm13 vsubpd ymm12, ymm12, ymm14 - vmovupd ymm14, YMMWORD PTR [__svml_spow_ha_data_internal+12928] + vmovupd ymm14, YMMWORD PTR [__jsvml_spow_ha_data_internal+12928] vinsertf128 ymm5, ymm5, xmm4, 1 - vmovupd ymm4, YMMWORD PTR [__svml_spow_ha_data_internal+13696] + vmovupd ymm4, YMMWORD PTR [__jsvml_spow_ha_data_internal+13696] vmulpd ymm7, ymm4, ymm11 vmulpd ymm6, ymm4, ymm12 - vmovupd ymm4, YMMWORD PTR [__svml_spow_ha_data_internal+12864] + vmovupd ymm4, YMMWORD PTR [__jsvml_spow_ha_data_internal+12864] vmulpd ymm13, ymm4, ymm10 vmulpd ymm12, ymm4, ymm9 vaddpd ymm11, ymm14, ymm13 @@ -1063,35 +1063,35 @@ L100:: vaddpd ymm13, ymm9, ymm13 vaddpd ymm4, ymm8, ymm10 vaddpd ymm11, ymm5, ymm13 - vmovupd ymm5, YMMWORD PTR [__svml_spow_ha_data_internal+30464] + vmovupd ymm5, YMMWORD PTR [__jsvml_spow_ha_data_internal+30464] vaddpd ymm14, ymm7, ymm4 vaddpd ymm8, ymm6, ymm11 vmulpd ymm14, ymm15, ymm14 vmulpd ymm13, ymm3, ymm8 - vmovupd ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+30400] - vmovupd ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+30528] - vmovups xmm8, XMMWORD PTR [__svml_spow_ha_data_internal+30720] + vmovupd ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+30400] + vmovupd ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+30528] + vmovups xmm8, XMMWORD PTR [__jsvml_spow_ha_data_internal+30720] vmulpd ymm6, ymm3, ymm14 vmulpd ymm3, ymm3, ymm13 vsubpd ymm9, ymm6, ymm15 vsubpd ymm10, ymm3, ymm15 vaddpd ymm11, ymm5, ymm9 vaddpd ymm4, ymm5, ymm10 - vmovups xmm9, XMMWORD PTR [__svml_spow_ha_data_internal+30784] + vmovups xmm9, XMMWORD PTR [__jsvml_spow_ha_data_internal+30784] vsubpd ymm7, ymm11, ymm5 vsubpd ymm5, ymm4, ymm5 vsubpd ymm6, ymm6, ymm7 vsubpd ymm7, ymm3, ymm5 - vmovupd ymm3, YMMWORD PTR [__svml_spow_ha_data_internal+30592] + vmovupd ymm3, YMMWORD PTR [__jsvml_spow_ha_data_internal+30592] vextractf128 xmm12, ymm13, 1 vshufps xmm10, xmm13, xmm12, 221 - vmovups xmm12, XMMWORD PTR [__svml_spow_ha_data_internal+64] + vmovups xmm12, XMMWORD PTR [__jsvml_spow_ha_data_internal+64] vpcmpgtd xmm13, xmm0, xmm12 vpcmpeqd xmm0, xmm0, xmm12 vextractf128 xmm15, ymm14, 1 vshufps xmm15, xmm14, xmm15, 221 vpor xmm14, xmm13, xmm0 - vmovups xmm0, XMMWORD PTR [__svml_spow_ha_data_internal+128] + vmovups xmm0, XMMWORD PTR [__jsvml_spow_ha_data_internal+128] vpcmpgtd xmm13, xmm2, xmm0 vpcmpeqd xmm2, xmm2, xmm0 vpor xmm13, xmm13, xmm2 @@ -1112,7 +1112,7 @@ L100:: vpor xmm0, xmm12, xmm13 vpackssdw xmm2, xmm14, xmm0 vpxor xmm1, xmm1, xmm1 - vmovupd xmm15, XMMWORD PTR [__svml_spow_ha_data_internal+30656] + vmovupd xmm15, XMMWORD PTR [__jsvml_spow_ha_data_internal+30656] vpacksswb xmm14, xmm2, xmm1 vpmovmskb eax, xmm14 vmulpd ymm13, ymm3, ymm6 @@ -1126,15 +1126,15 @@ L100:: vpsrlq xmm1, xmm1, 11 vmovd r10d, xmm9 shl r8d, 3 - vmovq xmm3, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + vmovq xmm3, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] vpextrd r9d, xmm10, 2 shl r10d, 3 vpextrd ecx, xmm9, 2 shl r9d, 3 shl ecx, 3 - vmovq xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r10] - vmovhpd xmm5, xmm3, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r9] - vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] + vmovq xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r10] + vmovhpd xmm5, xmm3, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r9] + vmovhpd xmm7, xmm6, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] vandps xmm8, xmm4, xmm15 vextractf128 xmm0, ymm4, 1 vpsrlq xmm4, xmm4, 11 @@ -1148,11 +1148,11 @@ L100:: shl r11d, 3 vpextrd ecx, xmm2, 2 shl r9d, 3 - vmovq xmm9, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + vmovq xmm9, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] shl ecx, 3 - vmovq xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r11] - vmovhpd xmm8, xmm9, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r9] - vmovhpd xmm2, xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] + vmovq xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r11] + vmovhpd xmm8, xmm9, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r9] + vmovhpd xmm2, xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] vinsertf128 ymm12, ymm5, xmm7, 1 vpsllq xmm7, xmm1, 52 vmulpd ymm13, ymm12, ymm13 @@ -1234,19 +1234,19 @@ _B4_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_spow_ha_cout_rare_internal + call __jsvml_spow_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_powf8_ha_e9 ENDP +__jsvml_powf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf8_ha_e9_B1_B3: +_unwind___jsvml_powf8_ha_e9_B1_B3: DD 1604097 DD 4904058 DD 1796204 @@ -1268,19 +1268,19 @@ _unwind___svml_powf8_ha_e9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_powf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_powf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf8_ha_e9_B6_B10: +_unwind___jsvml_powf8_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_powf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_powf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1289,7 +1289,7 @@ _unwind___svml_powf8_ha_e9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_powf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_powf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1303,9 +1303,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_powf4_ha_l9 + PUBLIC __jsvml_powf4_ha_l9 -__svml_powf4_ha_l9 PROC EXPORT +__jsvml_powf4_ha_l9 PROC EXPORT _B5_1:: @@ -1328,55 +1328,55 @@ L133:: vmovups XMMWORD PTR [304+rsp], xmm7 mov QWORD PTR [368+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandpd ymm11, ymm9, YMMWORD PTR [__svml_spow_ha_data_internal+12992] + vandpd ymm11, ymm9, YMMWORD PTR [__jsvml_spow_ha_data_internal+12992] and r13, -64 - vorpd ymm1, ymm11, YMMWORD PTR [__svml_spow_ha_data_internal+13056] + vorpd ymm1, ymm11, YMMWORD PTR [__jsvml_spow_ha_data_internal+13056] vcvtpd2ps xmm14, ymm1 vpsrlq ymm11, ymm9, 20 vcvtps2pd ymm2, xmm8 - vmovups xmm4, XMMWORD PTR [__svml_spow_ha_data_internal+128] - vpand xmm5, xmm8, XMMWORD PTR [__svml_spow_ha_data_internal+192] - vmovups xmm3, XMMWORD PTR [__svml_spow_ha_data_internal+64] + vmovups xmm4, XMMWORD PTR [__jsvml_spow_ha_data_internal+128] + vpand xmm5, xmm8, XMMWORD PTR [__jsvml_spow_ha_data_internal+192] + vmovups xmm3, XMMWORD PTR [__jsvml_spow_ha_data_internal+64] vrcpps xmm10, xmm14 vcvtps2pd ymm15, xmm10 - vpsubd xmm7, xmm0, XMMWORD PTR [__svml_spow_ha_data_internal] + vpsubd xmm7, xmm0, XMMWORD PTR [__jsvml_spow_ha_data_internal] vroundpd ymm15, ymm15, 0 - vfmsub213pd ymm1, ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+13312] + vfmsub213pd ymm1, ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+13312] mov QWORD PTR [376+rsp], r13 vextracti128 xmm14, ymm11, 1 vshufps xmm10, xmm11, xmm14, 221 vcvtdq2pd ymm9, xmm10 vpsrlq ymm10, ymm15, 40 - vcmpgt_oqpd ymm15, ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+13504] + vcmpgt_oqpd ymm15, ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+13504] vmovd eax, xmm10 movsxd rax, eax vpextrd ecx, xmm10, 2 movsxd rcx, ecx - vmovsd xmm11, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] - vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] + vmovsd xmm11, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] + vmovhpd xmm14, xmm11, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] vextracti128 xmm11, ymm10, 1 vmovd r8d, xmm11 movsxd r8, r8d vpextrd r9d, xmm11, 2 movsxd r9, r9d - vmovsd xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r8] - vmovhpd xmm11, xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r9] + vmovsd xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r8] + vmovhpd xmm11, xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r9] vinsertf128 ymm11, ymm14, xmm11, 1 - vandpd ymm14, ymm15, YMMWORD PTR [__svml_spow_ha_data_internal+13568] - vorpd ymm10, ymm14, YMMWORD PTR [__svml_spow_ha_data_internal+13632] - vmovupd ymm14, YMMWORD PTR [__svml_spow_ha_data_internal+12864] + vandpd ymm14, ymm15, YMMWORD PTR [__jsvml_spow_ha_data_internal+13568] + vorpd ymm10, ymm14, YMMWORD PTR [__jsvml_spow_ha_data_internal+13632] + vmovupd ymm14, YMMWORD PTR [__jsvml_spow_ha_data_internal+12864] vsubpd ymm9, ymm9, ymm10 vmulpd ymm10, ymm1, ymm1 - vfmadd213pd ymm14, ymm1, YMMWORD PTR [__svml_spow_ha_data_internal+12928] - vmulpd ymm15, ymm9, YMMWORD PTR [__svml_spow_ha_data_internal+13696] + vfmadd213pd ymm14, ymm1, YMMWORD PTR [__jsvml_spow_ha_data_internal+12928] + vmulpd ymm15, ymm9, YMMWORD PTR [__jsvml_spow_ha_data_internal+13696] vmulpd ymm9, ymm14, ymm10 - vmovupd ymm10, YMMWORD PTR [__svml_spow_ha_data_internal+30464] + vmovupd ymm10, YMMWORD PTR [__jsvml_spow_ha_data_internal+30464] vaddpd ymm1, ymm1, ymm9 vaddpd ymm11, ymm11, ymm1 vaddpd ymm14, ymm15, ymm11 vmulpd ymm9, ymm2, ymm14 - vmulpd ymm14, ymm9, YMMWORD PTR [__svml_spow_ha_data_internal+30400] - vsubpd ymm2, ymm14, YMMWORD PTR [__svml_spow_ha_data_internal+30528] + vmulpd ymm14, ymm9, YMMWORD PTR [__jsvml_spow_ha_data_internal+30400] + vsubpd ymm2, ymm14, YMMWORD PTR [__jsvml_spow_ha_data_internal+30528] vaddpd ymm11, ymm10, ymm2 vpcmpgtd xmm2, xmm7, xmm3 vpcmpeqd xmm3, xmm7, xmm3 @@ -1388,12 +1388,12 @@ L133:: vpcmpgtd xmm1, xmm5, xmm4 vpcmpeqd xmm4, xmm5, xmm4 vpor xmm5, xmm1, xmm4 - vandps ymm4, ymm11, YMMWORD PTR [__svml_spow_ha_data_internal+30656] + vandps ymm4, ymm11, YMMWORD PTR [__jsvml_spow_ha_data_internal+30656] vpor xmm1, xmm2, xmm5 - vandps xmm9, xmm9, XMMWORD PTR [__svml_spow_ha_data_internal+30720] - vpcmpgtd xmm2, xmm9, XMMWORD PTR [__svml_spow_ha_data_internal+30784] + vandps xmm9, xmm9, XMMWORD PTR [__jsvml_spow_ha_data_internal+30720] + vpcmpgtd xmm2, xmm9, XMMWORD PTR [__jsvml_spow_ha_data_internal+30784] vpor xmm3, xmm1, xmm2 - vmulpd ymm1, ymm10, YMMWORD PTR [__svml_spow_ha_data_internal+30592] + vmulpd ymm1, ymm10, YMMWORD PTR [__jsvml_spow_ha_data_internal+30592] vpsrlq ymm11, ymm11, 11 vmovmskps eax, xmm3 vextracti128 xmm14, ymm4, 1 @@ -1404,11 +1404,11 @@ L133:: shl ecx, 3 vpextrd r8d, xmm14, 2 shl r11d, 3 - vmovq xmm5, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r10] + vmovq xmm5, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r10] shl r8d, 3 - vmovq xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] - vmovhpd xmm7, xmm5, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r11] - vmovhpd xmm4, xmm15, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + vmovq xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] + vmovhpd xmm7, xmm5, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r11] + vmovhpd xmm4, xmm15, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] vinsertf128 ymm2, ymm7, xmm4, 1 vfmadd213pd ymm2, ymm1, ymm2 vpsllq ymm1, ymm11, 52 @@ -1471,19 +1471,19 @@ _B5_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_spow_ha_cout_rare_internal + call __jsvml_spow_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_powf4_ha_l9 ENDP +__jsvml_powf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf4_ha_l9_B1_B3: +_unwind___jsvml_powf4_ha_l9_B1_B3: DD 1204481 DD 3069025 DD 1275993 @@ -1502,19 +1502,19 @@ _unwind___svml_powf4_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_powf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_powf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf4_ha_l9_B6_B10: +_unwind___jsvml_powf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_powf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_powf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1523,7 +1523,7 @@ _unwind___svml_powf4_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_powf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_powf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1537,9 +1537,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_powf4_ha_ex + PUBLIC __jsvml_powf4_ha_ex -__svml_powf4_ha_ex PROC EXPORT +__jsvml_powf4_ha_ex PROC EXPORT _B6_1:: @@ -1573,10 +1573,10 @@ L154:: and r13, -64 cvtps2pd xmm7, xmm5 cvtps2pd xmm8, xmm9 - movups xmm5, XMMWORD PTR [__svml_spow_ha_data_internal+12992] + movups xmm5, XMMWORD PTR [__jsvml_spow_ha_data_internal+12992] movaps xmm3, xmm5 andps xmm5, xmm1 - movups xmm4, XMMWORD PTR [__svml_spow_ha_data_internal+13056] + movups xmm4, XMMWORD PTR [__jsvml_spow_ha_data_internal+13056] andps xmm3, xmm12 orps xmm3, xmm4 orps xmm5, xmm4 @@ -1609,24 +1609,24 @@ L154:: psrlq xmm13, 40 movd ecx, xmm12 pshufd xmm12, xmm13, 2 - movups xmm14, XMMWORD PTR [__svml_spow_ha_data_internal+13568] + movups xmm14, XMMWORD PTR [__jsvml_spow_ha_data_internal+13568] movd r8d, xmm13 - movups xmm13, XMMWORD PTR [__svml_spow_ha_data_internal+13504] + movups xmm13, XMMWORD PTR [__jsvml_spow_ha_data_internal+13504] movups XMMWORD PTR [416+rsp], xmm14 movaps xmm14, xmm13 cmpltpd xmm14, xmm4 cmpltpd xmm13, xmm2 movd r9d, xmm12 - movups xmm10, XMMWORD PTR [__svml_spow_ha_data_internal+13312] + movups xmm10, XMMWORD PTR [__jsvml_spow_ha_data_internal+13312] subpd xmm3, xmm10 subpd xmm5, xmm10 movups xmm2, XMMWORD PTR [416+rsp] - movups xmm4, XMMWORD PTR [__svml_spow_ha_data_internal+13632] + movups xmm4, XMMWORD PTR [__jsvml_spow_ha_data_internal+13632] andps xmm14, xmm2 andps xmm13, xmm2 orps xmm14, xmm4 subpd xmm1, xmm14 - movups xmm14, XMMWORD PTR [__svml_spow_ha_data_internal+12864] + movups xmm14, XMMWORD PTR [__jsvml_spow_ha_data_internal+12864] orps xmm13, xmm4 subpd xmm15, xmm13 movaps xmm2, xmm14 @@ -1634,12 +1634,12 @@ L154:: mulpd xmm2, xmm3 mulpd xmm14, xmm5 mulpd xmm13, xmm5 - movups xmm12, XMMWORD PTR [__svml_spow_ha_data_internal+13696] + movups xmm12, XMMWORD PTR [__jsvml_spow_ha_data_internal+13696] mulpd xmm1, xmm12 mulpd xmm12, xmm15 movaps xmm15, xmm3 mulpd xmm15, xmm3 - movups xmm4, XMMWORD PTR [__svml_spow_ha_data_internal+12928] + movups xmm4, XMMWORD PTR [__jsvml_spow_ha_data_internal+12928] addpd xmm2, xmm4 addpd xmm4, xmm14 mulpd xmm2, xmm15 @@ -1650,26 +1650,26 @@ L154:: movsxd r8, r8d movsxd rcx, ecx movsxd r9, r9d - movsd xmm11, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rax] - movsd xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r8] - movhpd xmm11, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+rcx] - movhpd xmm10, QWORD PTR [imagerel(__svml_spow_ha_data_internal)-4218496+rdx+r9] + movsd xmm11, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rax] + movsd xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r8] + movhpd xmm11, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+rcx] + movhpd xmm10, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)-4218496+rdx+r9] addpd xmm11, xmm3 addpd xmm10, xmm5 addpd xmm1, xmm11 addpd xmm12, xmm10 mulpd xmm8, xmm1 mulpd xmm7, xmm12 - movups xmm13, XMMWORD PTR [__svml_spow_ha_data_internal+30400] + movups xmm13, XMMWORD PTR [__jsvml_spow_ha_data_internal+30400] movaps xmm12, xmm13 mulpd xmm12, xmm8 mulpd xmm13, xmm7 - movups xmm1, XMMWORD PTR [__svml_spow_ha_data_internal+30528] + movups xmm1, XMMWORD PTR [__jsvml_spow_ha_data_internal+30528] movaps xmm14, xmm12 movaps xmm15, xmm13 subpd xmm14, xmm1 subpd xmm15, xmm1 - movups xmm3, XMMWORD PTR [__svml_spow_ha_data_internal+30464] + movups xmm3, XMMWORD PTR [__jsvml_spow_ha_data_internal+30464] addpd xmm14, xmm3 addpd xmm15, xmm3 movaps xmm10, xmm14 @@ -1679,26 +1679,26 @@ L154:: subpd xmm12, xmm10 subpd xmm13, xmm11 movups XMMWORD PTR [32+rsp], xmm0 - psubd xmm0, XMMWORD PTR [__svml_spow_ha_data_internal] - movdqu xmm5, XMMWORD PTR [__svml_spow_ha_data_internal+64] + psubd xmm0, XMMWORD PTR [__jsvml_spow_ha_data_internal] + movdqu xmm5, XMMWORD PTR [__jsvml_spow_ha_data_internal+64] movdqa xmm1, xmm0 - movdqu xmm6, XMMWORD PTR [__svml_spow_ha_data_internal+192] + movdqu xmm6, XMMWORD PTR [__jsvml_spow_ha_data_internal+192] pcmpgtd xmm1, xmm5 pand xmm6, xmm9 pcmpeqd xmm0, xmm5 shufps xmm8, xmm7, 221 por xmm1, xmm0 - movdqu xmm0, XMMWORD PTR [__svml_spow_ha_data_internal+128] + movdqu xmm0, XMMWORD PTR [__jsvml_spow_ha_data_internal+128] movdqa xmm7, xmm6 pcmpgtd xmm7, xmm0 pcmpeqd xmm6, xmm0 - pand xmm8, XMMWORD PTR [__svml_spow_ha_data_internal+30720] + pand xmm8, XMMWORD PTR [__jsvml_spow_ha_data_internal+30720] por xmm7, xmm6 - pcmpgtd xmm8, XMMWORD PTR [__svml_spow_ha_data_internal+30784] + pcmpgtd xmm8, XMMWORD PTR [__jsvml_spow_ha_data_internal+30784] por xmm1, xmm7 - movups xmm0, XMMWORD PTR [__svml_spow_ha_data_internal+30592] + movups xmm0, XMMWORD PTR [__jsvml_spow_ha_data_internal+30592] por xmm1, xmm8 - movups xmm8, XMMWORD PTR [__svml_spow_ha_data_internal+30656] + movups xmm8, XMMWORD PTR [__jsvml_spow_ha_data_internal+30656] movaps xmm6, xmm14 mulpd xmm12, xmm0 mulpd xmm0, xmm13 @@ -1717,10 +1717,10 @@ L154:: shl ecx, 3 shl r11d, 3 shl r8d, 3 - movq xmm1, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r10] - movq xmm2, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+rcx] - movhpd xmm1, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r11] - movhpd xmm2, QWORD PTR [imagerel(__svml_spow_ha_data_internal)+13952+rdx+r8] + movq xmm1, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r10] + movq xmm2, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+rcx] + movhpd xmm1, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r11] + movhpd xmm2, QWORD PTR [imagerel(__jsvml_spow_ha_data_internal)+13952+rdx+r8] mulpd xmm12, xmm1 mulpd xmm0, xmm2 addpd xmm1, xmm12 @@ -1792,19 +1792,19 @@ _B6_10:: lea rdx, QWORD PTR [64+r13+rbx*4] lea r8, QWORD PTR [128+r13+rbx*4] - call __svml_spow_ha_cout_rare_internal + call __jsvml_spow_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_powf4_ha_ex ENDP +__jsvml_powf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf4_ha_ex_B1_B3: +_unwind___jsvml_powf4_ha_ex_B1_B3: DD 1607425 DD 3593351 DD 1534079 @@ -1826,19 +1826,19 @@ _unwind___svml_powf4_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_powf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_powf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_powf4_ha_ex_B6_B10: +_unwind___jsvml_powf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_powf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_powf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1847,7 +1847,7 @@ _unwind___svml_powf4_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_powf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_powf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1861,9 +1861,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_spow_ha_cout_rare_internal + PUBLIC __jsvml_spow_ha_cout_rare_internal -__svml_spow_ha_cout_rare_internal PROC +__jsvml_spow_ha_cout_rare_internal PROC _B7_1:: @@ -2673,13 +2673,13 @@ _B7_64:: _B7_65:: -__svml_spow_ha_cout_rare_internal ENDP +__jsvml_spow_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_spow_ha_cout_rare_internal_B1_B64: +_unwind___jsvml_spow_ha_cout_rare_internal_B1_B64: DD 1065729 DD 354371 DD 292926 @@ -2697,7 +2697,7 @@ _unwind___svml_spow_ha_cout_rare_internal_B1_B64: DD imagerel _B7_1 DD imagerel _B7_65 - DD imagerel _unwind___svml_spow_ha_cout_rare_internal_B1_B64 + DD imagerel _unwind___jsvml_spow_ha_cout_rare_internal_B1_B64 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2705,8 +2705,8 @@ _DATA ENDS _RDATA SEGMENT READ 'DATA' DD 8 DUP (0H) - PUBLIC __svml_spow_ha_data_internal_avx512 -__svml_spow_ha_data_internal_avx512 DD 0 + PUBLIC __jsvml_spow_ha_data_internal_avx512 +__jsvml_spow_ha_data_internal_avx512 DD 0 DD 3174420480 DD 3182632960 DD 3187958784 @@ -3154,8 +3154,8 @@ __svml_spow_ha_data_internal_avx512 DD 0 DD 2139095040 DD 2139095040 DD 2139095040 - PUBLIC __svml_spow_ha_data_internal -__svml_spow_ha_data_internal DD 2155872256 + PUBLIC __jsvml_spow_ha_data_internal +__jsvml_spow_ha_data_internal DD 2155872256 DD 2155872256 DD 2155872256 DD 2155872256 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_sin_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_sin_windows_x86.S similarity index 91% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_sin_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_sin_windows_x86.S index 70b3830855e..a376c404771 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_sin_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_sin_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinf16_ha_z0 + PUBLIC __jsvml_sinf16_ha_z0 -__svml_sinf16_ha_z0 PROC EXPORT +__jsvml_sinf16_ha_z0 PROC EXPORT _B1_1:: @@ -52,16 +52,16 @@ L1:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm4, ZMMWORD PTR [__svml_ssin_ha_data_internal+4096] + vmovups zmm4, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+4096] and r13, -64 - vmovups zmm24, ZMMWORD PTR [__svml_ssin_ha_data_internal+5056] - vmovups zmm25, ZMMWORD PTR [__svml_ssin_ha_data_internal+4544] - vmovups zmm28, ZMMWORD PTR [__svml_ssin_ha_data_internal+5120] - vmovups zmm30, ZMMWORD PTR [__svml_ssin_ha_data_internal+5184] + vmovups zmm24, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5056] + vmovups zmm25, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+4544] + vmovups zmm28, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5120] + vmovups zmm30, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5184] vmovaps zmm22, zmm0 vandps zmm5, zmm22, zmm4 vandnps zmm1, zmm4, zmm22 - vmovups zmm4, ZMMWORD PTR [__svml_ssin_ha_data_internal+5440] + vmovups zmm4, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5440] mov QWORD PTR [1328+rsp], r13 vfmadd213ps zmm24, zmm5, zmm25 {rn-sae} vcvtps2pd zmm29, ymm5 {sae} @@ -69,12 +69,12 @@ L1:: vsubps zmm26, zmm24, zmm25 {rn-sae} vpslld zmm3, zmm24, 31 vcvtps2pd zmm31, ymm23 {sae} - vmovups zmm23, ZMMWORD PTR [__svml_ssin_ha_data_internal+5312] - vmovups zmm24, ZMMWORD PTR [__svml_ssin_ha_data_internal+5248] + vmovups zmm23, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5312] + vmovups zmm24, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5248] vextractf32x8 ymm27, zmm26, 1 vcvtps2pd zmm2, ymm26 {sae} vcvtps2pd zmm0, ymm27 {sae} - vmovups zmm27, ZMMWORD PTR [__svml_ssin_ha_data_internal+5376] + vmovups zmm27, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+5376] vfnmadd231pd zmm29, zmm28, zmm2 {rn-sae} vfnmadd231pd zmm31, zmm28, zmm0 {rn-sae} vfnmadd213pd zmm2, zmm30, zmm29 {rn-sae} @@ -97,7 +97,7 @@ L1:: vinsertf32x8 zmm0, zmm2, ymm0, 1 vpternlogd zmm0, zmm3, zmm1, 150 vpternlogd zmm3, zmm3, zmm3, 255 - vmovups zmm1, ZMMWORD PTR [__svml_ssin_ha_data_internal+4160] + vmovups zmm1, ZMMWORD PTR [__jsvml_ssin_ha_data_internal+4160] vcmpps k1, zmm5, zmm1, 18 {sae} vpandnd zmm3{k1}, zmm5, zmm5 vptestmd k0, zmm3, zmm3 @@ -233,19 +233,19 @@ _B1_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssin_ha_cout_rare_internal + call __jsvml_ssin_ha_cout_rare_internal jmp _B1_13 ALIGN 16 _B1_16:: -__svml_sinf16_ha_z0 ENDP +__jsvml_sinf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf16_ha_z0_B1_B9: +_unwind___jsvml_sinf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -257,13 +257,13 @@ _unwind___svml_sinf16_ha_z0_B1_B9: DD imagerel _B1_1 DD imagerel _B1_11 - DD imagerel _unwind___svml_sinf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_sinf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf16_ha_z0_B11_B15: +_unwind___jsvml_sinf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -299,7 +299,7 @@ _unwind___svml_sinf16_ha_z0_B11_B15: DD imagerel _B1_11 DD imagerel _B1_16 - DD imagerel _unwind___svml_sinf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_sinf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -313,9 +313,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinf8_ha_l9 + PUBLIC __jsvml_sinf8_ha_l9 -__svml_sinf8_ha_l9 PROC EXPORT +__jsvml_sinf8_ha_l9 PROC EXPORT _B2_1:: @@ -333,19 +333,19 @@ L52:: vmovups YMMWORD PTR [432+rsp], ymm6 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovups ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+4096] + vmovups ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+4096] and r13, -64 - vmovups ymm1, YMMWORD PTR [__svml_ssin_ha_data_internal+5056] - vmovupd ymm8, YMMWORD PTR [__svml_ssin_ha_data_internal+5120] - vmovupd ymm9, YMMWORD PTR [__svml_ssin_ha_data_internal+5184] + vmovups ymm1, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5056] + vmovupd ymm8, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5120] + vmovupd ymm9, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5184] vmovdqa ymm4, ymm0 - vmovups ymm0, YMMWORD PTR [__svml_ssin_ha_data_internal+4544] + vmovups ymm0, YMMWORD PTR [__jsvml_ssin_ha_data_internal+4544] vandps ymm3, ymm4, ymm5 mov QWORD PTR [536+rsp], r13 vfmadd213ps ymm1, ymm3, ymm0 vcvtps2pd ymm6, xmm3 vextractf128 xmm2, ymm3, 1 - vcmpnle_uqps ymm3, ymm3, YMMWORD PTR [__svml_ssin_ha_data_internal+4160] + vcmpnle_uqps ymm3, ymm3, YMMWORD PTR [__jsvml_ssin_ha_data_internal+4160] vcvtps2pd ymm15, xmm2 vpslld ymm2, ymm1, 31 vsubps ymm1, ymm1, ymm0 @@ -358,18 +358,18 @@ L52:: vfnmadd231pd ymm15, ymm8, ymm1 vfnmadd213pd ymm0, ymm9, ymm6 vfnmadd213pd ymm1, ymm9, ymm15 - vmovupd ymm15, YMMWORD PTR [__svml_ssin_ha_data_internal+5440] + vmovupd ymm15, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5440] vmulpd ymm9, ymm0, ymm0 vmulpd ymm10, ymm1, ymm1 vandnps ymm6, ymm5, ymm4 - vmovupd ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+5376] + vmovupd ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5376] vmovdqa ymm8, ymm5 vfmadd231pd ymm8, ymm15, ymm9 vfmadd231pd ymm5, ymm15, ymm10 - vmovupd ymm15, YMMWORD PTR [__svml_ssin_ha_data_internal+5312] + vmovupd ymm15, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5312] vfmadd213pd ymm8, ymm9, ymm15 vfmadd213pd ymm5, ymm10, ymm15 - vmovupd ymm15, YMMWORD PTR [__svml_ssin_ha_data_internal+5248] + vmovupd ymm15, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5248] vfmadd213pd ymm8, ymm9, ymm15 vfmadd213pd ymm5, ymm10, ymm15 vmulpd ymm8, ymm9, ymm8 @@ -441,19 +441,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssin_ha_cout_rare_internal + call __jsvml_ssin_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_sinf8_ha_l9 ENDP +__jsvml_sinf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf8_ha_l9_B1_B3: +_unwind___jsvml_sinf8_ha_l9_B1_B3: DD 933889 DD 4379712 DD 1796152 @@ -470,13 +470,13 @@ _unwind___svml_sinf8_ha_l9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_sinf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf8_ha_l9_B6_B10: +_unwind___jsvml_sinf8_ha_l9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -487,7 +487,7 @@ _unwind___svml_sinf8_ha_l9_B6_B10: DD 686091 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_sinf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -496,7 +496,7 @@ _unwind___svml_sinf8_ha_l9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_sinf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_sinf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -510,9 +510,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinf4_ha_e9 + PUBLIC __jsvml_sinf4_ha_e9 -__svml_sinf4_ha_e9 PROC EXPORT +__jsvml_sinf4_ha_e9 PROC EXPORT _B3_1:: @@ -527,30 +527,30 @@ L79:: vmovups XMMWORD PTR [192+rsp], xmm14 mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm0, XMMWORD PTR [__svml_ssin_ha_data_internal+4096] + vmovups xmm0, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4096] and r13, -64 vandps xmm2, xmm3, xmm0 - vmulps xmm1, xmm2, XMMWORD PTR [__svml_ssin_ha_data_internal+5056] + vmulps xmm1, xmm2, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5056] vcvtps2pd ymm14, xmm2 - vcmpnleps xmm2, xmm2, XMMWORD PTR [__svml_ssin_ha_data_internal+4160] - vmovups xmm5, XMMWORD PTR [__svml_ssin_ha_data_internal+4544] + vcmpnleps xmm2, xmm2, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4160] + vmovups xmm5, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4544] vmovmskps edx, xmm2 vaddps xmm4, xmm5, xmm1 vpslld xmm1, xmm4, 31 vsubps xmm5, xmm4, xmm5 vcvtps2pd ymm4, xmm5 - vmulpd ymm5, ymm4, YMMWORD PTR [__svml_ssin_ha_data_internal+5120] - vmulpd ymm4, ymm4, YMMWORD PTR [__svml_ssin_ha_data_internal+5184] + vmulpd ymm5, ymm4, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5120] + vmulpd ymm4, ymm4, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5184] vsubpd ymm14, ymm14, ymm5 vsubpd ymm5, ymm14, ymm4 vandnps xmm4, xmm0, xmm3 vmulpd ymm14, ymm5, ymm5 - vmulpd ymm0, ymm14, YMMWORD PTR [__svml_ssin_ha_data_internal+5440] - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_ssin_ha_data_internal+5376] + vmulpd ymm0, ymm14, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5440] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5376] vmulpd ymm0, ymm14, ymm0 - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_ssin_ha_data_internal+5312] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5312] vmulpd ymm0, ymm14, ymm0 - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_ssin_ha_data_internal+5248] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5248] vmulpd ymm14, ymm14, ymm0 vmulpd ymm0, ymm5, ymm14 vaddpd ymm5, ymm5, ymm0 @@ -606,19 +606,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssin_ha_cout_rare_internal + call __jsvml_ssin_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_sinf4_ha_e9 ENDP +__jsvml_sinf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf4_ha_e9_B1_B3: +_unwind___jsvml_sinf4_ha_e9_B1_B3: DD 401409 DD 1758240 DD 845848 @@ -631,13 +631,13 @@ _unwind___svml_sinf4_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_sinf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf4_ha_e9_B6_B10: +_unwind___jsvml_sinf4_ha_e9_B6_B10: DD 658945 DD 287758 DD 340999 @@ -652,7 +652,7 @@ _unwind___svml_sinf4_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_sinf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_sinf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -666,9 +666,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinf8_ha_e9 + PUBLIC __jsvml_sinf8_ha_e9 -__svml_sinf8_ha_e9 PROC EXPORT +__jsvml_sinf8_ha_e9 PROC EXPORT _B4_1:: @@ -686,18 +686,18 @@ L88:: vmovups YMMWORD PTR [464+rsp], ymm9 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [271+rsp] - vmovups ymm1, YMMWORD PTR [__svml_ssin_ha_data_internal+4096] + vmovups ymm1, YMMWORD PTR [__jsvml_ssin_ha_data_internal+4096] and r13, -64 - vmovups ymm10, YMMWORD PTR [__svml_ssin_ha_data_internal+4544] + vmovups ymm10, YMMWORD PTR [__jsvml_ssin_ha_data_internal+4544] vmovaps ymm4, ymm0 vandps ymm5, ymm4, ymm1 vandnps ymm1, ymm1, ymm4 mov QWORD PTR [536+rsp], r13 - vmulps ymm13, ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+5056] + vmulps ymm13, ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5056] vcvtps2pd ymm0, xmm5 vextractf128 xmm9, ymm5, 1 vaddps ymm13, ymm10, ymm13 - vcmpnle_uqps ymm5, ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+4160] + vcmpnle_uqps ymm5, ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+4160] vcvtps2pd ymm2, xmm9 vpslld xmm15, xmm13, 31 vextractf128 xmm14, ymm13, 1 @@ -705,18 +705,18 @@ L88:: vpslld xmm3, xmm14, 31 vcvtps2pd ymm14, xmm13 vextractf128 xmm10, ymm13, 1 - vmovupd ymm13, YMMWORD PTR [__svml_ssin_ha_data_internal+5120] + vmovupd ymm13, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5120] vinsertf128 ymm9, ymm15, xmm3, 1 vmulpd ymm3, ymm14, ymm13 vcvtps2pd ymm15, xmm10 vsubpd ymm10, ymm0, ymm3 vmulpd ymm0, ymm15, ymm13 - vmovupd ymm3, YMMWORD PTR [__svml_ssin_ha_data_internal+5440] + vmovupd ymm3, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5440] vsubpd ymm13, ymm2, ymm0 - vmovupd ymm2, YMMWORD PTR [__svml_ssin_ha_data_internal+5184] + vmovupd ymm2, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5184] vmulpd ymm14, ymm14, ymm2 vmulpd ymm15, ymm15, ymm2 - vmovupd ymm2, YMMWORD PTR [__svml_ssin_ha_data_internal+5376] + vmovupd ymm2, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5376] vsubpd ymm10, ymm10, ymm14 vsubpd ymm13, ymm13, ymm15 vmulpd ymm14, ymm10, ymm10 @@ -725,12 +725,12 @@ L88:: vmulpd ymm3, ymm3, ymm15 vaddpd ymm0, ymm2, ymm0 vaddpd ymm2, ymm2, ymm3 - vmovupd ymm3, YMMWORD PTR [__svml_ssin_ha_data_internal+5312] + vmovupd ymm3, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5312] vmulpd ymm0, ymm14, ymm0 vmulpd ymm2, ymm15, ymm2 vaddpd ymm0, ymm3, ymm0 vaddpd ymm3, ymm3, ymm2 - vmovupd ymm2, YMMWORD PTR [__svml_ssin_ha_data_internal+5248] + vmovupd ymm2, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5248] vmulpd ymm0, ymm14, ymm0 vmulpd ymm3, ymm15, ymm3 vaddpd ymm0, ymm2, ymm0 @@ -814,19 +814,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssin_ha_cout_rare_internal + call __jsvml_ssin_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_sinf8_ha_e9 ENDP +__jsvml_sinf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf8_ha_e9_B1_B3: +_unwind___jsvml_sinf8_ha_e9_B1_B3: DD 933889 DD 4379712 DD 1939512 @@ -843,13 +843,13 @@ _unwind___svml_sinf8_ha_e9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_sinf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf8_ha_e9_B6_B10: +_unwind___jsvml_sinf8_ha_e9_B6_B10: DD 931873 DD 1598520 DD 1651758 @@ -860,7 +860,7 @@ _unwind___svml_sinf8_ha_e9_B6_B10: DD 681995 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_sinf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -869,7 +869,7 @@ _unwind___svml_sinf8_ha_e9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_sinf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_sinf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -883,9 +883,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinf4_ha_l9 + PUBLIC __jsvml_sinf4_ha_l9 -__svml_sinf4_ha_l9 PROC EXPORT +__jsvml_sinf4_ha_l9 PROC EXPORT _B5_1:: @@ -899,26 +899,26 @@ L115:: vmovups XMMWORD PTR [192+rsp], xmm12 mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm4, XMMWORD PTR [__svml_ssin_ha_data_internal+4096] + vmovups xmm4, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4096] and r13, -64 - vmovups xmm3, XMMWORD PTR [__svml_ssin_ha_data_internal+5056] + vmovups xmm3, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5056] vandps xmm1, xmm0, xmm4 - vmovups xmm5, XMMWORD PTR [__svml_ssin_ha_data_internal+4544] + vmovups xmm5, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4544] vandnps xmm4, xmm4, xmm0 vfmadd213ps xmm3, xmm1, xmm5 vcvtps2pd ymm12, xmm1 - vcmpnleps xmm1, xmm1, XMMWORD PTR [__svml_ssin_ha_data_internal+4160] + vcmpnleps xmm1, xmm1, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4160] vpslld xmm2, xmm3, 31 vsubps xmm3, xmm3, xmm5 vmovmskps edx, xmm1 vcvtps2pd ymm3, xmm3 - vfnmadd231pd ymm12, ymm3, YMMWORD PTR [__svml_ssin_ha_data_internal+5120] - vfnmadd132pd ymm3, ymm12, YMMWORD PTR [__svml_ssin_ha_data_internal+5184] - vmovupd ymm12, YMMWORD PTR [__svml_ssin_ha_data_internal+5440] + vfnmadd231pd ymm12, ymm3, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5120] + vfnmadd132pd ymm3, ymm12, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5184] + vmovupd ymm12, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5440] vmulpd ymm5, ymm3, ymm3 - vfmadd213pd ymm12, ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+5376] - vfmadd213pd ymm12, ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+5312] - vfmadd213pd ymm12, ymm5, YMMWORD PTR [__svml_ssin_ha_data_internal+5248] + vfmadd213pd ymm12, ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5376] + vfmadd213pd ymm12, ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5312] + vfmadd213pd ymm12, ymm5, YMMWORD PTR [__jsvml_ssin_ha_data_internal+5248] vmulpd ymm5, ymm5, ymm12 vfmadd213pd ymm5, ymm3, ymm3 vxorps xmm3, xmm2, xmm4 @@ -974,19 +974,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssin_ha_cout_rare_internal + call __jsvml_ssin_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_sinf4_ha_l9 ENDP +__jsvml_sinf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf4_ha_l9_B1_B3: +_unwind___jsvml_sinf4_ha_l9_B1_B3: DD 400385 DD 1758236 DD 837652 @@ -999,13 +999,13 @@ _unwind___svml_sinf4_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_sinf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf4_ha_l9_B6_B10: +_unwind___jsvml_sinf4_ha_l9_B6_B10: DD 658945 DD 287758 DD 340999 @@ -1020,7 +1020,7 @@ _unwind___svml_sinf4_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_sinf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_sinf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1034,9 +1034,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinf4_ha_ex + PUBLIC __jsvml_sinf4_ha_ex -__svml_sinf4_ha_ex PROC EXPORT +__jsvml_sinf4_ha_ex PROC EXPORT _B6_1:: @@ -1056,23 +1056,23 @@ L124:: movups XMMWORD PTR [208+rsp], xmm7 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm3, XMMWORD PTR [__svml_ssin_ha_data_internal+4096] + movups xmm3, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4096] and r13, -64 - movups xmm12, XMMWORD PTR [__svml_ssin_ha_data_internal+5056] + movups xmm12, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5056] andps xmm4, xmm3 mulps xmm12, xmm4 movaps xmm2, xmm4 cvtps2pd xmm0, xmm4 - movups xmm8, XMMWORD PTR [__svml_ssin_ha_data_internal+4544] + movups xmm8, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4544] andnps xmm3, xmm5 movhlps xmm2, xmm4 addps xmm12, xmm8 cvtps2pd xmm1, xmm2 - cmpnleps xmm4, XMMWORD PTR [__svml_ssin_ha_data_internal+4160] + cmpnleps xmm4, XMMWORD PTR [__jsvml_ssin_ha_data_internal+4160] movaps xmm2, xmm12 subps xmm12, xmm8 movmskps eax, xmm4 - movups xmm14, XMMWORD PTR [__svml_ssin_ha_data_internal+5120] + movups xmm14, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5120] pslld xmm2, 31 cvtps2pd xmm8, xmm12 movhlps xmm12, xmm12 @@ -1082,7 +1082,7 @@ L124:: mulpd xmm14, xmm12 subpd xmm0, xmm13 subpd xmm1, xmm14 - movups xmm7, XMMWORD PTR [__svml_ssin_ha_data_internal+5184] + movups xmm7, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5184] pxor xmm2, xmm3 mulpd xmm8, xmm7 mulpd xmm12, xmm7 @@ -1092,21 +1092,21 @@ L124:: movaps xmm13, xmm1 mulpd xmm12, xmm0 mulpd xmm13, xmm1 - movups xmm7, XMMWORD PTR [__svml_ssin_ha_data_internal+5440] + movups xmm7, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5440] movaps xmm8, xmm7 mulpd xmm8, xmm12 mulpd xmm7, xmm13 - movups xmm14, XMMWORD PTR [__svml_ssin_ha_data_internal+5376] + movups xmm14, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5376] addpd xmm8, xmm14 addpd xmm14, xmm7 mulpd xmm8, xmm12 mulpd xmm14, xmm13 - movups xmm7, XMMWORD PTR [__svml_ssin_ha_data_internal+5312] + movups xmm7, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5312] addpd xmm8, xmm7 addpd xmm7, xmm14 mulpd xmm8, xmm12 mulpd xmm7, xmm13 - movups xmm14, XMMWORD PTR [__svml_ssin_ha_data_internal+5248] + movups xmm14, XMMWORD PTR [__jsvml_ssin_ha_data_internal+5248] addpd xmm8, xmm14 addpd xmm14, xmm7 mulpd xmm12, xmm8 @@ -1173,19 +1173,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssin_ha_cout_rare_internal + call __jsvml_ssin_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_sinf4_ha_ex ENDP +__jsvml_sinf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf4_ha_ex_B1_B3: +_unwind___jsvml_sinf4_ha_ex_B1_B3: DD 935169 DD 2282565 DD 882749 @@ -1202,19 +1202,19 @@ _unwind___svml_sinf4_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_sinf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_sinf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinf4_ha_ex_B6_B10: +_unwind___jsvml_sinf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_sinf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_sinf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1223,7 +1223,7 @@ _unwind___svml_sinf4_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_sinf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_sinf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1237,9 +1237,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_ssin_ha_cout_rare_internal + PUBLIC __jsvml_ssin_ha_cout_rare_internal -__svml_ssin_ha_cout_rare_internal PROC +__jsvml_ssin_ha_cout_rare_internal PROC _B7_1:: @@ -1787,13 +1787,13 @@ _B7_20:: _B7_21:: -__svml_ssin_ha_cout_rare_internal ENDP +__jsvml_ssin_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_ssin_ha_cout_rare_internal_B1_B20: +_unwind___jsvml_ssin_ha_cout_rare_internal_B1_B20: DD 675841 DD 354384 DD 579659 @@ -1808,7 +1808,7 @@ _unwind___svml_ssin_ha_cout_rare_internal_B1_B20: DD imagerel _B7_1 DD imagerel _B7_21 - DD imagerel _unwind___svml_ssin_ha_cout_rare_internal_B1_B20 + DD imagerel _unwind___jsvml_ssin_ha_cout_rare_internal_B1_B20 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1816,8 +1816,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_ssin_ha_data_internal -__svml_ssin_ha_data_internal DD 0 + PUBLIC __jsvml_ssin_ha_data_internal +__jsvml_ssin_ha_data_internal DD 0 DD 0 DD 0 DD 1065353216 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_sinh_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_sinh_windows_x86.S similarity index 80% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_sinh_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_sinh_windows_x86.S index 93b40d568c4..48f7ddf75f5 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_sinh_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_sinh_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinhf4_ha_l9 + PUBLIC __jsvml_sinhf4_ha_l9 -__svml_sinhf4_ha_l9 PROC EXPORT +__jsvml_sinhf4_ha_l9 PROC EXPORT _B1_1:: @@ -59,16 +59,16 @@ L1:: vmovups XMMWORD PTR [240+rsp], xmm6 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm12, xmm13, XMMWORD PTR [__svml_ssinh_ha_data_internal+1152] + vandps xmm12, xmm13, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1152] and r13, -64 - vmovups xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+1280] + vmovups xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1280] vxorps xmm0, xmm12, xmm13 - vmovups xmm2, XMMWORD PTR [__svml_ssinh_ha_data_internal+960] + vmovups xmm2, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+960] vfmadd213ps xmm2, xmm0, xmm3 - vmovups xmm5, XMMWORD PTR [__svml_ssinh_ha_data_internal+1344] - vpcmpgtd xmm4, xmm0, XMMWORD PTR [__svml_ssinh_ha_data_internal+1408] + vmovups xmm5, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1344] + vpcmpgtd xmm4, xmm0, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1408] vmovmskps ecx, xmm4 - vmovups xmm1, XMMWORD PTR [__svml_ssinh_ha_data_internal+1024] + vmovups xmm1, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1024] vxorps xmm6, xmm2, xmm3 vsubps xmm3, xmm2, xmm3 vpsubd xmm15, xmm5, xmm6 @@ -79,37 +79,37 @@ L1:: vfnmadd213ps xmm1, xmm3, xmm0 vpslld xmm2, xmm5, 4 vmovd edx, xmm2 - vfnmadd231ps xmm1, xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+1088] - vmovd xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+rdx] + vfnmadd231ps xmm1, xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1088] + vmovd xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+rdx] vpextrd r8d, xmm2, 2 vpextrd eax, xmm2, 1 vpextrd r9d, xmm2, 3 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+r8] - vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+rax], 1 - vpinsrd xmm4, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+r9], 1 - vmovd xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+rdx] - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+r8] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+r8] + vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+rax], 1 + vpinsrd xmm4, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+r9], 1 + vmovd xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+rdx] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+r8] vunpcklpd xmm14, xmm2, xmm4 - vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+rax], 1 - vpinsrd xmm4, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+r9], 1 - vmovups xmm15, XMMWORD PTR [__svml_ssinh_ha_data_internal+5568] + vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+rax], 1 + vpinsrd xmm4, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+r9], 1 + vmovups xmm15, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+5568] vpunpcklqdq xmm3, xmm2, xmm4 vpcmpgtd xmm2, xmm15, xmm5 vfmadd213ps xmm3, xmm1, xmm14 vaddps xmm4, xmm14, xmm14 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+rdx] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+rdx] vpsubd xmm5, xmm6, xmm5 - vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+rax], 1 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+r8] - vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+r9], 1 + vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+rax], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+r8] + vpinsrd xmm14, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+r9], 1 vpunpcklqdq xmm14, xmm15, xmm14 vandps xmm15, xmm0, xmm2 - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+rdx] + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+rdx] vandnps xmm2, xmm2, xmm4 vfmadd213ps xmm3, xmm1, xmm14 - vpinsrd xmm14, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+rax], 1 - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+r8] - vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+r9], 1 + vpinsrd xmm14, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+rax], 1 + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+r8] + vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+r9], 1 vpunpcklqdq xmm14, xmm14, xmm0 vfmadd213ps xmm3, xmm1, xmm14 vorps xmm1, xmm2, xmm15 @@ -168,19 +168,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssinh_ha_cout_rare_internal + call __jsvml_ssinh_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_sinhf4_ha_l9 ENDP +__jsvml_sinhf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf4_ha_l9_B1_B3: +_unwind___jsvml_sinhf4_ha_l9_B1_B3: DD 936705 DD 2282571 DD 1009731 @@ -197,19 +197,19 @@ _unwind___svml_sinhf4_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_sinhf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinhf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf4_ha_l9_B6_B10: +_unwind___jsvml_sinhf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_sinhf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinhf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -218,7 +218,7 @@ _unwind___svml_sinhf4_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_sinhf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_sinhf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -232,9 +232,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinhf16_ha_z0 + PUBLIC __jsvml_sinhf16_ha_z0 -__svml_sinhf16_ha_z0 PROC EXPORT +__jsvml_sinhf16_ha_z0 PROC EXPORT _B2_1:: @@ -247,47 +247,47 @@ L18:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm26, ZMMWORD PTR [__svml_ssinh_ha_data_internal+1152] + vmovups zmm26, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+1152] and r13, -64 - vmovups zmm25, ZMMWORD PTR [__svml_ssinh_ha_data_internal+960] - vmovups zmm5, ZMMWORD PTR [__svml_ssinh_ha_data_internal+576] - vmovups zmm1, ZMMWORD PTR [__svml_ssinh_ha_data_internal+1024] - vmovups zmm24, ZMMWORD PTR [__svml_ssinh_ha_data_internal+1088] - vmovups zmm28, ZMMWORD PTR [__svml_ssinh_ha_data_internal+896] - vmovups zmm29, ZMMWORD PTR [__svml_ssinh_ha_data_internal+832] + vmovups zmm25, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+960] + vmovups zmm5, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+576] + vmovups zmm1, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+1024] + vmovups zmm24, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+1088] + vmovups zmm28, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+896] + vmovups zmm29, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+832] vpternlogd zmm4, zmm4, zmm4, 255 vmovaps zmm31, zmm0 vandps zmm30, zmm26, zmm31 - vmovups zmm0, ZMMWORD PTR [__svml_ssinh_ha_data_internal+512] + vmovups zmm0, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+512] vxorps zmm27, zmm30, zmm31 vfmadd213ps zmm25, zmm27, zmm0 {rn-sae} - vpcmpd k1, zmm27, ZMMWORD PTR [__svml_ssinh_ha_data_internal+704], 2 + vpcmpd k1, zmm27, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+704], 2 vcmpps k2, zmm5, zmm25, 0 {sae} - vmovups zmm5, ZMMWORD PTR [__svml_ssinh_ha_data_internal+256] + vmovups zmm5, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+256] vblendmps zmm22{k2}, zmm25, zmm0 vsubps zmm3, zmm22, zmm0 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_ssinh_ha_data_internal+128] + vmovups zmm0, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+128] mov QWORD PTR [1328+rsp], r13 vpandnd zmm4{k1}, zmm27, zmm27 vfnmadd231ps zmm27, zmm3, zmm1 {rn-sae} vptestmd k0, zmm4, zmm4 - vmovups zmm4, ZMMWORD PTR [__svml_ssinh_ha_data_internal] + vmovups zmm4, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal] vfnmadd231ps zmm27, zmm3, zmm24 {rn-sae} kmovw r8d, k0 vmulps zmm25, zmm27, zmm27 {rn-sae} vmulps zmm28, zmm28, zmm25 {rn-sae} vfmadd213ps zmm28, zmm27, zmm27 {rn-sae} vmulps zmm27, zmm29, zmm25 {rn-sae} - vpandd zmm23, zmm22, ZMMWORD PTR [__svml_ssinh_ha_data_internal+640] + vpandd zmm23, zmm22, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+640] vpxord zmm2, zmm22, zmm23 vpslld zmm24, zmm2, 18 - vmovups zmm2, ZMMWORD PTR [__svml_ssinh_ha_data_internal+384] - vpermt2ps zmm5, zmm23, ZMMWORD PTR [__svml_ssinh_ha_data_internal+320] - vpermt2ps zmm4, zmm23, ZMMWORD PTR [__svml_ssinh_ha_data_internal+64] - vpermt2ps zmm2, zmm23, ZMMWORD PTR [__svml_ssinh_ha_data_internal+448] + vmovups zmm2, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+384] + vpermt2ps zmm5, zmm23, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+320] + vpermt2ps zmm4, zmm23, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+64] + vpermt2ps zmm2, zmm23, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+448] vpsubd zmm3, zmm5, zmm24 vpaddd zmm22, zmm4, zmm24 - vpermt2ps zmm0, zmm23, ZMMWORD PTR [__svml_ssinh_ha_data_internal+192] + vpermt2ps zmm0, zmm23, ZMMWORD PTR [__jsvml_ssinh_ha_data_internal+192] vandnps zmm23, zmm26, zmm2 vsubps zmm5, zmm22, zmm3 {rn-sae} vpaddd zmm1, zmm0, zmm24 @@ -434,19 +434,19 @@ _B2_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssinh_ha_cout_rare_internal + call __jsvml_ssinh_ha_cout_rare_internal jmp _B2_13 ALIGN 16 _B2_16:: -__svml_sinhf16_ha_z0 ENDP +__jsvml_sinhf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf16_ha_z0_B1_B9: +_unwind___jsvml_sinhf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -458,13 +458,13 @@ _unwind___svml_sinhf16_ha_z0_B1_B9: DD imagerel _B2_1 DD imagerel _B2_11 - DD imagerel _unwind___svml_sinhf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_sinhf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf16_ha_z0_B11_B15: +_unwind___jsvml_sinhf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -500,7 +500,7 @@ _unwind___svml_sinhf16_ha_z0_B11_B15: DD imagerel _B2_11 DD imagerel _B2_16 - DD imagerel _unwind___svml_sinhf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_sinhf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -514,9 +514,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinhf4_ha_e9 + PUBLIC __jsvml_sinhf4_ha_e9 -__svml_sinhf4_ha_e9 PROC EXPORT +__jsvml_sinhf4_ha_e9 PROC EXPORT _B3_1:: @@ -536,21 +536,21 @@ L69:: vmovups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [272+rsp], r13 lea r13, QWORD PTR [111+rsp] - vandps xmm11, xmm12, XMMWORD PTR [__svml_ssinh_ha_data_internal+1152] + vandps xmm11, xmm12, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1152] and r13, -64 vxorps xmm0, xmm11, xmm12 - vmulps xmm6, xmm0, XMMWORD PTR [__svml_ssinh_ha_data_internal+960] - vmovups xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+1280] - vmovups xmm5, XMMWORD PTR [__svml_ssinh_ha_data_internal+1344] + vmulps xmm6, xmm0, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+960] + vmovups xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1280] + vmovups xmm5, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1344] vaddps xmm4, xmm3, xmm6 vxorps xmm6, xmm4, xmm3 vsubps xmm3, xmm4, xmm3 vpsubd xmm15, xmm5, xmm6 vpsrld xmm13, xmm15, 28 - vmulps xmm4, xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+1024] + vmulps xmm4, xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1024] vpslld xmm1, xmm13, 4 - vmulps xmm15, xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+1088] - vpcmpgtd xmm2, xmm0, XMMWORD PTR [__svml_ssinh_ha_data_internal+1408] + vmulps xmm15, xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1088] + vpcmpgtd xmm2, xmm0, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1408] vmovmskps ecx, xmm2 vpor xmm2, xmm1, xmm6 vpand xmm5, xmm2, xmm5 @@ -561,37 +561,37 @@ L69:: vpextrd r8d, xmm3, 2 vpextrd eax, xmm3, 1 vpextrd r9d, xmm3, 3 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+rdx] - vmovd xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+r8] - vpinsrd xmm2, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+rax], 1 - vpinsrd xmm15, xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+r9], 1 - vmovd xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+rdx] - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+r8] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+rdx] + vmovd xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+r8] + vpinsrd xmm2, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+rax], 1 + vpinsrd xmm15, xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+r9], 1 + vmovd xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+rdx] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+r8] vunpcklpd xmm1, xmm2, xmm15 - vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+rax], 1 - vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+r9], 1 + vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+rax], 1 + vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+r9], 1 vaddps xmm13, xmm1, xmm1 - vmovups xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+5568] + vmovups xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+5568] vpcmpgtd xmm3, xmm3, xmm5 vpsubd xmm5, xmm6, xmm5 vpunpcklqdq xmm2, xmm2, xmm15 vmulps xmm15, xmm2, xmm4 - vmovd xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+rdx] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+rdx] vaddps xmm1, xmm1, xmm15 - vpinsrd xmm2, xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+rax], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+r8] - vpinsrd xmm15, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+r9], 1 + vpinsrd xmm2, xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+rax], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+r8] + vpinsrd xmm15, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+r9], 1 vpunpcklqdq xmm15, xmm2, xmm15 vandps xmm2, xmm0, xmm3 vmulps xmm0, xmm4, xmm1 vandnps xmm3, xmm3, xmm13 - vmovd xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+rdx] + vmovd xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+rdx] vorps xmm2, xmm3, xmm2 mov QWORD PTR [280+rsp], r13 vaddps xmm0, xmm15, xmm0 - vpinsrd xmm15, xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+rax], 1 - vmovd xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+r8] - vpinsrd xmm1, xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+r9], 1 + vpinsrd xmm15, xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+rax], 1 + vmovd xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+r8] + vpinsrd xmm1, xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+r9], 1 vmulps xmm4, xmm4, xmm0 vpunpcklqdq xmm15, xmm15, xmm1 vaddps xmm0, xmm15, xmm4 @@ -649,19 +649,19 @@ _B3_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssinh_ha_cout_rare_internal + call __jsvml_ssinh_ha_cout_rare_internal jmp _B3_8 ALIGN 16 _B3_11:: -__svml_sinhf4_ha_e9 ENDP +__jsvml_sinhf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf4_ha_e9_B1_B3: +_unwind___jsvml_sinhf4_ha_e9_B1_B3: DD 936705 DD 2282571 DD 944195 @@ -678,19 +678,19 @@ _unwind___svml_sinhf4_ha_e9_B1_B3: DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_sinhf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinhf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf4_ha_e9_B6_B10: +_unwind___jsvml_sinhf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B3_1 DD imagerel _B3_6 - DD imagerel _unwind___svml_sinhf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinhf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -699,7 +699,7 @@ _unwind___svml_sinhf4_ha_e9_B6_B10: DD imagerel _B3_6 DD imagerel _B3_11 - DD imagerel _unwind___svml_sinhf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_sinhf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -713,9 +713,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinhf8_ha_e9 + PUBLIC __jsvml_sinhf8_ha_e9 -__svml_sinhf8_ha_e9 PROC EXPORT +__jsvml_sinhf8_ha_e9 PROC EXPORT _B4_1:: @@ -743,13 +743,13 @@ L86:: lea r13, QWORD PTR [159+rsp] vmovaps ymm12, ymm0 and r13, -64 - vandps ymm11, ymm12, YMMWORD PTR [__svml_ssinh_ha_data_internal+1152] + vandps ymm11, ymm12, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1152] vxorps ymm1, ymm11, ymm12 - vmovups ymm15, YMMWORD PTR [__svml_ssinh_ha_data_internal+1280] - vmulps ymm5, ymm1, YMMWORD PTR [__svml_ssinh_ha_data_internal+960] - vmovups xmm7, XMMWORD PTR [__svml_ssinh_ha_data_internal+1408] - vmovups xmm6, XMMWORD PTR [__svml_ssinh_ha_data_internal+1344] - vmovups xmm0, XMMWORD PTR [__svml_ssinh_ha_data_internal+5568] + vmovups ymm15, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1280] + vmulps ymm5, ymm1, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+960] + vmovups xmm7, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1408] + vmovups xmm6, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1344] + vmovups xmm0, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+5568] vaddps ymm4, ymm15, ymm5 mov QWORD PTR [520+rsp], r13 vpcmpgtd xmm5, xmm1, xmm7 @@ -760,7 +760,7 @@ L86:: vsubps ymm15, ymm4, ymm15 vpacksswb xmm13, xmm3, xmm14 vpmovmskb esi, xmm13 - vmulps ymm4, ymm15, YMMWORD PTR [__svml_ssinh_ha_data_internal+1024] + vmulps ymm4, ymm15, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1024] vsubps ymm4, ymm1, ymm4 vpsubd xmm5, xmm6, xmm7 vextractf128 xmm10, ymm7, 1 @@ -774,37 +774,37 @@ L86:: vpslld xmm3, xmm5, 4 vpor xmm2, xmm13, xmm10 vpand xmm6, xmm2, xmm6 - vmulps ymm2, ymm15, YMMWORD PTR [__svml_ssinh_ha_data_internal+1088] + vmulps ymm2, ymm15, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1088] vpslld xmm15, xmm6, 4 vmovd r11d, xmm3 vmovd ecx, xmm15 vsubps ymm4, ymm4, ymm2 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+r11] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+r11] vpextrd r9d, xmm3, 2 vpextrd r10d, xmm3, 1 vpextrd r8d, xmm3, 3 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+r9] - vpinsrd xmm2, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+r10], 1 - vpinsrd xmm3, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+r8], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+r9] + vpinsrd xmm2, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+r10], 1 + vpinsrd xmm3, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+r8], 1 vpextrd edx, xmm15, 1 vpextrd eax, xmm15, 2 vpextrd r12d, xmm15, 3 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+rcx] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+rcx] vpunpcklqdq xmm3, xmm2, xmm3 - vpinsrd xmm2, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+rdx], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+rax] - vpinsrd xmm14, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rdi+r12], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+r9] + vpinsrd xmm2, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+rdx], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+rax] + vpinsrd xmm14, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rdi+r12], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+r9] vpunpcklqdq xmm13, xmm2, xmm14 vinsertf128 ymm14, ymm3, xmm13, 1 - vmovd xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+r11] - vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+r10], 1 - vpinsrd xmm3, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+r8], 1 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+rcx] - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+rax] + vmovd xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+r11] + vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+r10], 1 + vpinsrd xmm3, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+r8], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+rcx] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+rax] vpunpcklqdq xmm2, xmm2, xmm3 - vpinsrd xmm3, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+rdx], 1 - vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rdi+r12], 1 + vpinsrd xmm3, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+rdx], 1 + vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rdi+r12], 1 vpunpcklqdq xmm15, xmm3, xmm13 vinsertf128 ymm15, ymm2, xmm15, 1 vpcmpgtd xmm2, xmm0, xmm5 @@ -818,31 +818,31 @@ L86:: vmulps ymm13, ymm4, ymm13 vinsertf128 ymm3, ymm2, xmm0, 1 vaddps ymm2, ymm14, ymm14 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+r11] - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+r9] - vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+r10], 1 - vpinsrd xmm14, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+r8], 1 - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+rcx] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+r11] + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+r9] + vpinsrd xmm15, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+r10], 1 + vpinsrd xmm14, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+r8], 1 + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+rcx] vpunpcklqdq xmm14, xmm15, xmm14 - vpinsrd xmm15, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+rdx], 1 - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+rax] - vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rdi+r12], 1 + vpinsrd xmm15, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+rdx], 1 + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+rax] + vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rdi+r12], 1 vpunpcklqdq xmm15, xmm15, xmm0 vandps ymm1, ymm1, ymm3 vandnps ymm2, ymm3, ymm2 vorps ymm1, ymm2, ymm1 vinsertf128 ymm14, ymm14, xmm15, 1 vaddps ymm15, ymm14, ymm13 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+r11] - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+r9] - vpinsrd xmm0, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+r10], 1 - vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+r8], 1 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+rcx] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+rdx], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+r11] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+r9] + vpinsrd xmm0, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+r10], 1 + vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+r8], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+rcx] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+rdx], 1 vmulps ymm4, ymm4, ymm15 vpunpcklqdq xmm14, xmm0, xmm14 - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+rax] - vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rdi+r12], 1 + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+rax] + vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rdi+r12], 1 vpunpcklqdq xmm13, xmm13, xmm0 vinsertf128 ymm14, ymm14, xmm13, 1 vaddps ymm3, ymm14, ymm4 @@ -909,19 +909,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rdi*4] lea rdx, QWORD PTR [64+r13+rdi*4] - call __svml_ssinh_ha_cout_rare_internal + call __jsvml_ssinh_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_sinhf8_ha_e9 ENDP +__jsvml_sinhf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf8_ha_e9_B1_B3: +_unwind___jsvml_sinhf8_ha_e9_B1_B3: DD 1534721 DD 4248683 DD 1075299 @@ -943,19 +943,19 @@ _unwind___svml_sinhf8_ha_e9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_sinhf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinhf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf8_ha_e9_B6_B10: +_unwind___jsvml_sinhf8_ha_e9_B6_B10: DD 265761 DD 169998 DD 296966 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_sinhf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_sinhf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -964,7 +964,7 @@ _unwind___svml_sinhf8_ha_e9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_sinhf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_sinhf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -978,9 +978,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinhf8_ha_l9 + PUBLIC __jsvml_sinhf8_ha_l9 -__svml_sinhf8_ha_l9 PROC EXPORT +__jsvml_sinhf8_ha_l9 PROC EXPORT _B5_1:: @@ -1003,16 +1003,16 @@ L109:: vmovups YMMWORD PTR [320+rsp], ymm9 mov QWORD PTR [512+rsp], r13 lea r13, QWORD PTR [223+rsp] - vmovups ymm3, YMMWORD PTR [__svml_ssinh_ha_data_internal+1280] + vmovups ymm3, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1280] and r13, -64 - vmovups ymm15, YMMWORD PTR [__svml_ssinh_ha_data_internal+960] - vmovups ymm5, YMMWORD PTR [__svml_ssinh_ha_data_internal+1344] - vmovups ymm1, YMMWORD PTR [__svml_ssinh_ha_data_internal+1024] + vmovups ymm15, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+960] + vmovups ymm5, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1344] + vmovups ymm1, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1024] vmovaps ymm12, ymm0 - vandps ymm11, ymm12, YMMWORD PTR [__svml_ssinh_ha_data_internal+1152] + vandps ymm11, ymm12, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1152] vxorps ymm0, ymm11, ymm12 vfmadd213ps ymm15, ymm0, ymm3 - vpcmpgtd ymm9, ymm0, YMMWORD PTR [__svml_ssinh_ha_data_internal+1408] + vpcmpgtd ymm9, ymm0, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1408] vmovmskps ebx, ymm9 vxorps ymm9, ymm15, ymm3 vpsubd ymm2, ymm5, ymm9 @@ -1020,69 +1020,69 @@ L109:: vpsrld ymm4, ymm2, 28 vfnmadd213ps ymm1, ymm3, ymm0 vpslld ymm2, ymm4, 4 - vfnmadd231ps ymm1, ymm3, YMMWORD PTR [__svml_ssinh_ha_data_internal+1088] + vfnmadd231ps ymm1, ymm3, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+1088] vpor ymm4, ymm2, ymm9 vpand ymm5, ymm4, ymm5 vpslld ymm15, ymm5, 4 mov QWORD PTR [520+rsp], r13 vmovd r10d, xmm15 vextracti128 xmm4, ymm15, 1 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+r10] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+r10] vpextrd r8d, xmm15, 2 vpextrd r9d, xmm15, 1 vpextrd esi, xmm15, 3 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+r8] - vpinsrd xmm3, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+r9], 1 - vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+rsi], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+r8] + vpinsrd xmm3, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+r9], 1 + vpinsrd xmm15, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+rsi], 1 vmovd ecx, xmm4 vpunpcklqdq xmm2, xmm3, xmm15 vpextrd eax, xmm4, 2 vpextrd edx, xmm4, 1 vpextrd r11d, xmm4, 3 - vmovd xmm4, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+rcx] - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+rax] - vpinsrd xmm13, xmm4, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+rdx], 1 - vpinsrd xmm3, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+rbp+r11], 1 - vmovd xmm4, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+r8] + vmovd xmm4, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+rcx] + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+rax] + vpinsrd xmm13, xmm4, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+rdx], 1 + vpinsrd xmm3, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+rbp+r11], 1 + vmovd xmm4, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+r8] vpunpcklqdq xmm15, xmm13, xmm3 - vpinsrd xmm3, xmm4, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+rsi], 1 + vpinsrd xmm3, xmm4, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+rsi], 1 vinsertf128 ymm13, ymm2, xmm15, 1 - vmovd xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+r10] - vpinsrd xmm14, xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+r9], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+rcx] - vmovd xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+rax] - vpinsrd xmm4, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+rdx], 1 + vmovd xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+r10] + vpinsrd xmm14, xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+r9], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+rcx] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+rax] + vpinsrd xmm4, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+rdx], 1 vpunpcklqdq xmm3, xmm14, xmm3 - vpinsrd xmm14, xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+rbp+r11], 1 - vmovups ymm2, YMMWORD PTR [__svml_ssinh_ha_data_internal+5568] + vpinsrd xmm14, xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+rbp+r11], 1 + vmovups ymm2, YMMWORD PTR [__jsvml_ssinh_ha_data_internal+5568] vpunpcklqdq xmm15, xmm4, xmm14 vaddps ymm4, ymm13, ymm13 vpcmpgtd ymm2, ymm2, ymm5 vpsubd ymm5, ymm9, ymm5 vinsertf128 ymm3, ymm3, xmm15, 1 vfmadd213ps ymm3, ymm1, ymm13 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+r10] - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+r8] - vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+r9], 1 - vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+rsi], 1 - vmovd xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+rcx] - vpinsrd xmm15, xmm15, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+rdx], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+r10] + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+r8] + vpinsrd xmm14, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+r9], 1 + vpinsrd xmm13, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+rsi], 1 + vmovd xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+rcx] + vpinsrd xmm15, xmm15, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+rdx], 1 vpunpcklqdq xmm14, xmm14, xmm13 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+rax] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+rbp+r11], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+rax] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+rbp+r11], 1 vpunpcklqdq xmm15, xmm15, xmm13 vinsertf128 ymm14, ymm14, xmm15, 1 vandps ymm15, ymm0, ymm2 - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+r10] + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+r10] vfmadd213ps ymm3, ymm1, ymm14 - vmovd xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+r8] - vpinsrd xmm13, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+r9], 1 - vpinsrd xmm0, xmm14, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+rsi], 1 + vmovd xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+r8] + vpinsrd xmm13, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+r9], 1 + vpinsrd xmm0, xmm14, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+rsi], 1 vpunpcklqdq xmm14, xmm13, xmm0 - vmovd xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+rcx] - vmovd xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+rax] - vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+rdx], 1 - vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+rbp+r11], 1 + vmovd xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+rcx] + vmovd xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+rax] + vpinsrd xmm13, xmm13, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+rdx], 1 + vpinsrd xmm0, xmm0, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+rbp+r11], 1 vpunpcklqdq xmm13, xmm13, xmm0 vandnps ymm2, ymm2, ymm4 vinsertf128 ymm14, ymm14, xmm13, 1 @@ -1149,19 +1149,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbp*4] lea rdx, QWORD PTR [64+r13+rbp*4] - call __svml_ssinh_ha_cout_rare_internal + call __jsvml_ssinh_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_sinhf8_ha_l9 ENDP +__jsvml_sinhf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf8_ha_l9_B1_B3: +_unwind___jsvml_sinhf8_ha_l9_B1_B3: DD 1266433 DD 4248659 DD 1349707 @@ -1181,13 +1181,13 @@ _unwind___svml_sinhf8_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_sinhf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinhf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf8_ha_l9_B6_B10: +_unwind___jsvml_sinhf8_ha_l9_B6_B10: DD 531745 DD 174109 DD 296983 @@ -1195,7 +1195,7 @@ _unwind___svml_sinhf8_ha_l9_B6_B10: DD 550921 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_sinhf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_sinhf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1204,7 +1204,7 @@ _unwind___svml_sinhf8_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_sinhf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_sinhf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1218,9 +1218,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_sinhf4_ha_ex + PUBLIC __jsvml_sinhf4_ha_ex -__svml_sinhf4_ha_ex PROC EXPORT +__jsvml_sinhf4_ha_ex PROC EXPORT _B6_1:: @@ -1241,17 +1241,17 @@ L132:: movups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - movups xmm0, XMMWORD PTR [__svml_ssinh_ha_data_internal+1152] + movups xmm0, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1152] and r13, -64 andps xmm0, xmm12 movaps xmm10, xmm0 - movups xmm5, XMMWORD PTR [__svml_ssinh_ha_data_internal+960] + movups xmm5, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+960] pxor xmm10, xmm12 mulps xmm5, xmm10 movaps xmm2, xmm10 - movups xmm4, XMMWORD PTR [__svml_ssinh_ha_data_internal+1280] + movups xmm4, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1280] movaps xmm7, xmm10 - movdqu xmm3, XMMWORD PTR [__svml_ssinh_ha_data_internal+1344] + movdqu xmm3, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1344] addps xmm5, xmm4 movaps xmm8, xmm5 movdqa xmm9, xmm3 @@ -1259,7 +1259,7 @@ L132:: subps xmm5, xmm4 psubd xmm9, xmm8 psrld xmm9, 28 - movups xmm1, XMMWORD PTR [__svml_ssinh_ha_data_internal+1024] + movups xmm1, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1024] pslld xmm9, 4 mulps xmm1, xmm5 por xmm9, xmm8 @@ -1267,9 +1267,9 @@ L132:: subps xmm7, xmm1 movdqa xmm4, xmm9 psubd xmm8, xmm9 - movups xmm6, XMMWORD PTR [__svml_ssinh_ha_data_internal+1088] + movups xmm6, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1088] pslld xmm4, 4 - pcmpgtd xmm2, XMMWORD PTR [__svml_ssinh_ha_data_internal+1408] + pcmpgtd xmm2, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+1408] pslld xmm8, 19 mulps xmm6, xmm5 movmskps ecx, xmm2 @@ -1281,42 +1281,42 @@ L132:: pshufd xmm1, xmm4, 3 movd r8d, xmm3 movd r9d, xmm1 - movd xmm6, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+rdx] - movd xmm5, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+rax] - movd xmm3, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+r8] - movd xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1480+r10+r9] - movd xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+r9] + movd xmm6, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+rdx] + movd xmm5, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+rax] + movd xmm3, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+r8] + movd xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1480+r10+r9] + movd xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+r9] punpckldq xmm6, xmm5 punpckldq xmm3, xmm2 - movd xmm5, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+rdx] - movd xmm4, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+rax] - movd xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1484+r10+r8] + movd xmm5, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+rdx] + movd xmm4, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+rax] + movd xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1484+r10+r8] punpckldq xmm5, xmm4 punpckldq xmm2, xmm1 punpcklqdq xmm5, xmm2 mulps xmm5, xmm7 unpcklpd xmm6, xmm3 movaps xmm3, xmm6 - movd xmm2, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+rdx] + movd xmm2, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+rdx] addps xmm3, xmm6 addps xmm6, xmm5 mulps xmm6, xmm7 - movd xmm5, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+rax] + movd xmm5, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+rax] punpckldq xmm2, xmm5 - movd xmm5, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+r8] - movd xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1476+r10+r9] + movd xmm5, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+r8] + movd xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1476+r10+r9] punpckldq xmm5, xmm1 punpcklqdq xmm2, xmm5 - movd xmm1, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+rdx] + movd xmm1, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+rdx] addps xmm2, xmm6 mulps xmm7, xmm2 - movd xmm6, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+rax] + movd xmm6, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+rax] punpckldq xmm1, xmm6 - movd xmm6, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+r8] - movd xmm5, DWORD PTR [imagerel(__svml_ssinh_ha_data_internal)+1472+r10+r9] + movd xmm6, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+r8] + movd xmm5, DWORD PTR [imagerel(__jsvml_ssinh_ha_data_internal)+1472+r10+r9] punpckldq xmm6, xmm5 punpcklqdq xmm1, xmm6 - movdqu xmm4, XMMWORD PTR [__svml_ssinh_ha_data_internal+5568] + movdqu xmm4, XMMWORD PTR [__jsvml_ssinh_ha_data_internal+5568] addps xmm1, xmm7 pcmpgtd xmm4, xmm9 andps xmm10, xmm4 @@ -1380,19 +1380,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_ssinh_ha_cout_rare_internal + call __jsvml_ssinh_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_sinhf4_ha_ex ENDP +__jsvml_sinhf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf4_ha_ex_B1_B3: +_unwind___jsvml_sinhf4_ha_ex_B1_B3: DD 1069569 DD 2413650 DD 944202 @@ -1410,19 +1410,19 @@ _unwind___svml_sinhf4_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_sinhf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_sinhf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_sinhf4_ha_ex_B6_B10: +_unwind___jsvml_sinhf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_sinhf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_sinhf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1431,7 +1431,7 @@ _unwind___svml_sinhf4_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_sinhf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_sinhf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1445,9 +1445,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_ssinh_ha_cout_rare_internal + PUBLIC __jsvml_ssinh_ha_cout_rare_internal -__svml_ssinh_ha_cout_rare_internal PROC +__jsvml_ssinh_ha_cout_rare_internal PROC _B7_1:: @@ -1901,13 +1901,13 @@ _B7_17:: _B7_18:: -__svml_ssinh_ha_cout_rare_internal ENDP +__jsvml_ssinh_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_ssinh_ha_cout_rare_internal_B1_B17: +_unwind___jsvml_ssinh_ha_cout_rare_internal_B1_B17: DD 1204225 DD 821344 DD 759895 @@ -1926,7 +1926,7 @@ _unwind___svml_ssinh_ha_cout_rare_internal_B1_B17: DD imagerel _B7_1 DD imagerel _B7_18 - DD imagerel _unwind___svml_ssinh_ha_cout_rare_internal_B1_B17 + DD imagerel _unwind___jsvml_ssinh_ha_cout_rare_internal_B1_B17 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1934,8 +1934,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_ssinh_ha_data_internal -__svml_ssinh_ha_data_internal DD 1056964608 + PUBLIC __jsvml_ssinh_ha_data_internal +__jsvml_ssinh_ha_data_internal DD 1056964608 DD 1057148295 DD 1057336003 DD 1057527823 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_tan_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_tan_windows_x86.S similarity index 91% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_tan_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_tan_windows_x86.S index c0c42d81de8..5fc596140b6 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_tan_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_tan_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanf4_ha_ex + PUBLIC __jsvml_tanf4_ha_ex -__svml_tanf4_ha_ex PROC EXPORT +__jsvml_tanf4_ha_ex PROC EXPORT _B1_1:: @@ -60,21 +60,21 @@ L1:: movaps xmm7, xmm0 mov QWORD PTR [288+rsp], r13 movaps xmm10, xmm7 - movups xmm4, XMMWORD PTR [__svml_stan_ha_data_internal+960] + movups xmm4, XMMWORD PTR [__jsvml_stan_ha_data_internal+960] lea r13, QWORD PTR [111+rsp] andps xmm10, xmm4 andnps xmm4, xmm7 movaps xmm3, xmm10 movaps xmm5, xmm10 cvtps2pd xmm2, xmm10 - cmpnleps xmm5, XMMWORD PTR [__svml_stan_ha_data_internal+1216] + cmpnleps xmm5, XMMWORD PTR [__jsvml_stan_ha_data_internal+1216] movhlps xmm3, xmm10 and r13, -64 - mulps xmm10, XMMWORD PTR [__svml_stan_ha_data_internal+832] + mulps xmm10, XMMWORD PTR [__jsvml_stan_ha_data_internal+832] cvtps2pd xmm0, xmm3 movmskps eax, xmm5 - movups xmm1, XMMWORD PTR [__svml_stan_ha_data_internal+1088] - movups xmm12, XMMWORD PTR [__svml_stan_ha_data_internal+1344] + movups xmm1, XMMWORD PTR [__jsvml_stan_ha_data_internal+1088] + movups xmm12, XMMWORD PTR [__jsvml_stan_ha_data_internal+1344] addps xmm10, xmm1 movaps xmm5, xmm10 subps xmm10, xmm1 @@ -86,7 +86,7 @@ L1:: pxor xmm5, xmm4 pshufd xmm1, xmm14, 80 pshufd xmm3, xmm14, 250 - movups xmm14, XMMWORD PTR [__svml_stan_ha_data_internal+1280] + movups xmm14, XMMWORD PTR [__jsvml_stan_ha_data_internal+1280] movaps xmm13, xmm14 mulpd xmm13, xmm11 mulpd xmm14, xmm10 @@ -96,7 +96,7 @@ L1:: subpd xmm0, xmm14 subpd xmm2, xmm11 subpd xmm0, xmm10 - movups xmm13, XMMWORD PTR [__svml_stan_ha_data_internal+1472] + movups xmm13, XMMWORD PTR [__jsvml_stan_ha_data_internal+1472] movaps xmm10, xmm2 movaps xmm11, xmm13 movaps xmm14, xmm0 @@ -108,16 +108,16 @@ L1:: mulpd xmm13, xmm14 addpd xmm2, xmm11 addpd xmm0, xmm13 - movups xmm11, XMMWORD PTR [__svml_stan_ha_data_internal+1664] + movups xmm11, XMMWORD PTR [__jsvml_stan_ha_data_internal+1664] movaps xmm13, xmm11 mulpd xmm13, xmm10 mulpd xmm11, xmm14 - movups xmm12, XMMWORD PTR [__svml_stan_ha_data_internal+1600] + movups xmm12, XMMWORD PTR [__jsvml_stan_ha_data_internal+1600] addpd xmm13, xmm12 addpd xmm12, xmm11 mulpd xmm10, xmm13 mulpd xmm14, xmm12 - movups xmm11, XMMWORD PTR [__svml_stan_ha_data_internal+1536] + movups xmm11, XMMWORD PTR [__jsvml_stan_ha_data_internal+1536] movdqa xmm12, xmm1 addpd xmm10, xmm11 addpd xmm11, xmm14 @@ -199,19 +199,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stan_ha_cout_rare_internal + call __jsvml_stan_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_tanf4_ha_ex ENDP +__jsvml_tanf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf4_ha_ex_B1_B3: +_unwind___jsvml_tanf4_ha_ex_B1_B3: DD 1069057 DD 2413648 DD 817221 @@ -229,19 +229,19 @@ _unwind___svml_tanf4_ha_ex_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_tanf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_tanf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf4_ha_ex_B6_B10: +_unwind___jsvml_tanf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_tanf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_tanf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -250,7 +250,7 @@ _unwind___svml_tanf4_ha_ex_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_tanf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_tanf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -264,9 +264,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanf4_ha_e9 + PUBLIC __jsvml_tanf4_ha_e9 -__svml_tanf4_ha_e9 PROC EXPORT +__jsvml_tanf4_ha_e9 PROC EXPORT _B2_1:: @@ -281,15 +281,15 @@ L20:: vmovups XMMWORD PTR [192+rsp], xmm14 mov QWORD PTR [208+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm3, XMMWORD PTR [__svml_stan_ha_data_internal+960] + vmovups xmm3, XMMWORD PTR [__jsvml_stan_ha_data_internal+960] and r13, -64 vandps xmm14, xmm5, xmm3 vandnps xmm3, xmm3, xmm5 - vcmpnleps xmm4, xmm14, XMMWORD PTR [__svml_stan_ha_data_internal+1216] + vcmpnleps xmm4, xmm14, XMMWORD PTR [__jsvml_stan_ha_data_internal+1216] vcvtps2pd ymm1, xmm14 - vmovups xmm2, XMMWORD PTR [__svml_stan_ha_data_internal+1088] + vmovups xmm2, XMMWORD PTR [__jsvml_stan_ha_data_internal+1088] vmovmskps edx, xmm4 - vmulps xmm4, xmm14, XMMWORD PTR [__svml_stan_ha_data_internal+832] + vmulps xmm4, xmm14, XMMWORD PTR [__jsvml_stan_ha_data_internal+832] mov QWORD PTR [216+rsp], r13 vaddps xmm0, xmm2, xmm4 vpslld xmm4, xmm0, 31 @@ -301,18 +301,18 @@ L20:: vpshufd xmm14, xmm14, 250 vinsertf128 ymm2, ymm2, xmm14, 1 vcvtps2pd ymm14, xmm0 - vmulpd ymm0, ymm14, YMMWORD PTR [__svml_stan_ha_data_internal+1280] - vmulpd ymm14, ymm14, YMMWORD PTR [__svml_stan_ha_data_internal+1344] + vmulpd ymm0, ymm14, YMMWORD PTR [__jsvml_stan_ha_data_internal+1280] + vmulpd ymm14, ymm14, YMMWORD PTR [__jsvml_stan_ha_data_internal+1344] vsubpd ymm1, ymm1, ymm0 vsubpd ymm14, ymm1, ymm14 vmulpd ymm0, ymm14, ymm14 - vmulpd ymm1, ymm14, YMMWORD PTR [__svml_stan_ha_data_internal+1472] + vmulpd ymm1, ymm14, YMMWORD PTR [__jsvml_stan_ha_data_internal+1472] vmulpd ymm1, ymm0, ymm1 vaddpd ymm1, ymm14, ymm1 - vmulpd ymm14, ymm0, YMMWORD PTR [__svml_stan_ha_data_internal+1664] - vaddpd ymm14, ymm14, YMMWORD PTR [__svml_stan_ha_data_internal+1600] + vmulpd ymm14, ymm0, YMMWORD PTR [__jsvml_stan_ha_data_internal+1664] + vaddpd ymm14, ymm14, YMMWORD PTR [__jsvml_stan_ha_data_internal+1600] vmulpd ymm0, ymm0, ymm14 - vaddpd ymm0, ymm0, YMMWORD PTR [__svml_stan_ha_data_internal+1536] + vaddpd ymm0, ymm0, YMMWORD PTR [__jsvml_stan_ha_data_internal+1536] vblendvpd ymm14, ymm0, ymm1, ymm2 vblendvpd ymm2, ymm1, ymm0, ymm2 vdivpd ymm0, ymm14, ymm2 @@ -366,19 +366,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stan_ha_cout_rare_internal + call __jsvml_stan_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_tanf4_ha_e9 ENDP +__jsvml_tanf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf4_ha_e9_B1_B3: +_unwind___jsvml_tanf4_ha_e9_B1_B3: DD 401409 DD 1758240 DD 845848 @@ -391,13 +391,13 @@ _unwind___svml_tanf4_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_tanf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf4_ha_e9_B6_B10: +_unwind___jsvml_tanf4_ha_e9_B6_B10: DD 658945 DD 287758 DD 340999 @@ -412,7 +412,7 @@ _unwind___svml_tanf4_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_tanf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_tanf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -426,9 +426,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanf16_ha_z0 + PUBLIC __jsvml_tanf16_ha_z0 -__svml_tanf16_ha_z0 PROC EXPORT +__jsvml_tanf16_ha_z0 PROC EXPORT _B3_1:: @@ -441,26 +441,26 @@ L29:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm1, ZMMWORD PTR [__svml_stan_ha_data_internal] + vmovups zmm1, ZMMWORD PTR [__jsvml_stan_ha_data_internal] and r13, -64 - vmovups zmm23, ZMMWORD PTR [__svml_stan_ha_data_internal+1088] - vmovups zmm24, ZMMWORD PTR [__svml_stan_ha_data_internal+64] - vmovups zmm26, ZMMWORD PTR [__svml_stan_ha_data_internal+256] - vmovups zmm27, ZMMWORD PTR [__svml_stan_ha_data_internal+320] - vmovups zmm3, ZMMWORD PTR [__svml_stan_ha_data_internal+768] - vmovups zmm2, ZMMWORD PTR [__svml_stan_ha_data_internal+704] - vmovups zmm4, ZMMWORD PTR [__svml_stan_ha_data_internal+384] + vmovups zmm23, ZMMWORD PTR [__jsvml_stan_ha_data_internal+1088] + vmovups zmm24, ZMMWORD PTR [__jsvml_stan_ha_data_internal+64] + vmovups zmm26, ZMMWORD PTR [__jsvml_stan_ha_data_internal+256] + vmovups zmm27, ZMMWORD PTR [__jsvml_stan_ha_data_internal+320] + vmovups zmm3, ZMMWORD PTR [__jsvml_stan_ha_data_internal+768] + vmovups zmm2, ZMMWORD PTR [__jsvml_stan_ha_data_internal+704] + vmovups zmm4, ZMMWORD PTR [__jsvml_stan_ha_data_internal+384] vmovaps zmm22, zmm0 vfmadd213ps zmm1, zmm22, zmm23 {rn-sae} - vmovups zmm0, ZMMWORD PTR [__svml_stan_ha_data_internal+640] - vandps zmm31, zmm22, ZMMWORD PTR [__svml_stan_ha_data_internal+960] + vmovups zmm0, ZMMWORD PTR [__jsvml_stan_ha_data_internal+640] + vandps zmm31, zmm22, ZMMWORD PTR [__jsvml_stan_ha_data_internal+960] vsubps zmm30, zmm1, zmm23 {rn-sae} - vpermt2ps zmm4, zmm1, ZMMWORD PTR [__svml_stan_ha_data_internal+448] + vpermt2ps zmm4, zmm1, ZMMWORD PTR [__jsvml_stan_ha_data_internal+448] vcmpps k0, zmm31, zmm3, 22 {sae} vfnmadd213ps zmm24, zmm30, zmm22 {rn-sae} - vmovups zmm3, ZMMWORD PTR [__svml_stan_ha_data_internal+512] + vmovups zmm3, ZMMWORD PTR [__jsvml_stan_ha_data_internal+512] kmovw r8d, k0 - vpermt2ps zmm3, zmm1, ZMMWORD PTR [__svml_stan_ha_data_internal+576] + vpermt2ps zmm3, zmm1, ZMMWORD PTR [__jsvml_stan_ha_data_internal+576] vmovaps zmm25, zmm30 vfnmadd213ps zmm25, zmm26, zmm24 {rn-sae} vmovaps zmm5, zmm30 @@ -471,7 +471,7 @@ L29:: vsubps zmm28, zmm5, zmm25 {rn-sae} vfmadd231ps zmm0, zmm2, zmm31 {rn-sae} vfmadd213ps zmm30, zmm27, zmm28 {rn-sae} - vmovups zmm28, ZMMWORD PTR [__svml_stan_ha_data_internal+1152] + vmovups zmm28, ZMMWORD PTR [__jsvml_stan_ha_data_internal+1152] vmulps zmm24, zmm0, zmm5 {rn-sae} vsubps zmm23, zmm29, zmm30 {rn-sae} vfnmsub213ps zmm24, zmm31, zmm23 {rn-sae} @@ -630,19 +630,19 @@ _B3_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stan_ha_cout_rare_internal + call __jsvml_stan_ha_cout_rare_internal jmp _B3_13 ALIGN 16 _B3_16:: -__svml_tanf16_ha_z0 ENDP +__jsvml_tanf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf16_ha_z0_B1_B9: +_unwind___jsvml_tanf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -654,13 +654,13 @@ _unwind___svml_tanf16_ha_z0_B1_B9: DD imagerel _B3_1 DD imagerel _B3_11 - DD imagerel _unwind___svml_tanf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_tanf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf16_ha_z0_B11_B15: +_unwind___jsvml_tanf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -696,7 +696,7 @@ _unwind___svml_tanf16_ha_z0_B11_B15: DD imagerel _B3_11 DD imagerel _B3_16 - DD imagerel _unwind___svml_tanf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_tanf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -710,9 +710,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanf8_ha_e9 + PUBLIC __jsvml_tanf8_ha_e9 -__svml_tanf8_ha_e9 PROC EXPORT +__jsvml_tanf8_ha_e9 PROC EXPORT _B4_1:: @@ -732,18 +732,18 @@ L80:: vmovups YMMWORD PTR [496+rsp], ymm10 mov QWORD PTR [528+rsp], r13 lea r13, QWORD PTR [239+rsp] - vmovups ymm11, YMMWORD PTR [__svml_stan_ha_data_internal+960] + vmovups ymm11, YMMWORD PTR [__jsvml_stan_ha_data_internal+960] and r13, -64 vmovaps ymm13, ymm0 vandps ymm12, ymm13, ymm11 - vcmpnle_uqps ymm3, ymm12, YMMWORD PTR [__svml_stan_ha_data_internal+1216] + vcmpnle_uqps ymm3, ymm12, YMMWORD PTR [__jsvml_stan_ha_data_internal+1216] vandnps ymm11, ymm11, ymm13 mov QWORD PTR [536+rsp], r13 vextractf128 xmm0, ymm12, 1 - vmulps ymm10, ymm12, YMMWORD PTR [__svml_stan_ha_data_internal+832] + vmulps ymm10, ymm12, YMMWORD PTR [__jsvml_stan_ha_data_internal+832] vcvtps2pd ymm15, xmm0 vcvtps2pd ymm14, xmm12 - vmovups ymm0, YMMWORD PTR [__svml_stan_ha_data_internal+1088] + vmovups ymm0, YMMWORD PTR [__jsvml_stan_ha_data_internal+1088] vextractf128 xmm5, ymm3, 1 vpackssdw xmm4, xmm3, xmm5 vaddps ymm3, ymm0, ymm10 @@ -762,7 +762,7 @@ L80:: vpshufd xmm3, xmm0, 250 vxorps ymm11, ymm12, ymm11 vinsertf128 ymm10, ymm1, xmm10, 1 - vmovupd ymm1, YMMWORD PTR [__svml_stan_ha_data_internal+1280] + vmovupd ymm1, YMMWORD PTR [__jsvml_stan_ha_data_internal+1280] vinsertf128 ymm5, ymm2, xmm3, 1 vcvtps2pd ymm3, xmm4 vextractf128 xmm0, ymm4, 1 @@ -771,9 +771,9 @@ L80:: vsubpd ymm0, ymm14, ymm4 vmulpd ymm14, ymm2, ymm1 vsubpd ymm4, ymm15, ymm14 - vmovupd ymm14, YMMWORD PTR [__svml_stan_ha_data_internal+1344] + vmovupd ymm14, YMMWORD PTR [__jsvml_stan_ha_data_internal+1344] vmulpd ymm15, ymm3, ymm14 - vmovupd ymm3, YMMWORD PTR [__svml_stan_ha_data_internal+1472] + vmovupd ymm3, YMMWORD PTR [__jsvml_stan_ha_data_internal+1472] vsubpd ymm1, ymm0, ymm15 vmulpd ymm0, ymm2, ymm14 vmulpd ymm15, ymm1, ymm1 @@ -785,13 +785,13 @@ L80:: vaddpd ymm4, ymm1, ymm4 vmulpd ymm1, ymm0, ymm3 vaddpd ymm3, ymm2, ymm1 - vmovupd ymm2, YMMWORD PTR [__svml_stan_ha_data_internal+1664] - vmovupd ymm1, YMMWORD PTR [__svml_stan_ha_data_internal+1600] + vmovupd ymm2, YMMWORD PTR [__jsvml_stan_ha_data_internal+1664] + vmovupd ymm1, YMMWORD PTR [__jsvml_stan_ha_data_internal+1600] vmulpd ymm14, ymm2, ymm15 vmulpd ymm2, ymm2, ymm0 vaddpd ymm14, ymm1, ymm14 vaddpd ymm1, ymm1, ymm2 - vmovupd ymm2, YMMWORD PTR [__svml_stan_ha_data_internal+1536] + vmovupd ymm2, YMMWORD PTR [__jsvml_stan_ha_data_internal+1536] vmulpd ymm15, ymm15, ymm14 vmulpd ymm0, ymm0, ymm1 vaddpd ymm15, ymm2, ymm15 @@ -868,19 +868,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stan_ha_cout_rare_internal + call __jsvml_stan_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_tanf8_ha_e9 ENDP +__jsvml_tanf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf8_ha_e9_B1_B3: +_unwind___jsvml_tanf8_ha_e9_B1_B3: DD 1068289 DD 4379725 DD 2074693 @@ -898,13 +898,13 @@ _unwind___svml_tanf8_ha_e9_B1_B3: DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_tanf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanf8_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf8_ha_e9_B6_B10: +_unwind___jsvml_tanf8_ha_e9_B6_B10: DD 798497 DD 1336367 DD 1389605 @@ -914,7 +914,7 @@ _unwind___svml_tanf8_ha_e9_B6_B10: DD 550923 DD imagerel _B4_1 DD imagerel _B4_6 - DD imagerel _unwind___svml_tanf8_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanf8_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -923,7 +923,7 @@ _unwind___svml_tanf8_ha_e9_B6_B10: DD imagerel _B4_6 DD imagerel _B4_11 - DD imagerel _unwind___svml_tanf8_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_tanf8_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -937,9 +937,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanf4_ha_l9 + PUBLIC __jsvml_tanf4_ha_l9 -__svml_tanf4_ha_l9 PROC EXPORT +__jsvml_tanf4_ha_l9 PROC EXPORT _B5_1:: @@ -959,14 +959,14 @@ L107:: vmovups XMMWORD PTR [272+rsp], xmm9 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vmovups xmm15, XMMWORD PTR [__svml_stan_ha_data_internal] + vmovups xmm15, XMMWORD PTR [__jsvml_stan_ha_data_internal] and r13, -64 - vmovups xmm3, XMMWORD PTR [__svml_stan_ha_data_internal+1088] + vmovups xmm3, XMMWORD PTR [__jsvml_stan_ha_data_internal+1088] vfmadd213ps xmm15, xmm0, xmm3 - vmovups xmm1, XMMWORD PTR [__svml_stan_ha_data_internal+64] - vandps xmm2, xmm0, XMMWORD PTR [__svml_stan_ha_data_internal+960] - vmovups xmm4, XMMWORD PTR [__svml_stan_ha_data_internal+256] - vcmpnleps xmm12, xmm2, XMMWORD PTR [__svml_stan_ha_data_internal+768] + vmovups xmm1, XMMWORD PTR [__jsvml_stan_ha_data_internal+64] + vandps xmm2, xmm0, XMMWORD PTR [__jsvml_stan_ha_data_internal+960] + vmovups xmm4, XMMWORD PTR [__jsvml_stan_ha_data_internal+256] + vcmpnleps xmm12, xmm2, XMMWORD PTR [__jsvml_stan_ha_data_internal+768] vsubps xmm13, xmm15, xmm3 vmovmskps r8d, xmm12 vmovaps xmm5, xmm13 @@ -974,7 +974,7 @@ L107:: vpand xmm11, xmm12, XMMWORD PTR [_2il0floatpacket_26] vmovaps xmm9, xmm13 vfnmadd213ps xmm1, xmm13, xmm0 - vmovups xmm2, XMMWORD PTR [__svml_stan_ha_data_internal+320] + vmovups xmm2, XMMWORD PTR [__jsvml_stan_ha_data_internal+320] vmovd ecx, xmm11 vfnmadd213ps xmm5, xmm4, xmm1 vpextrd r9d, xmm11, 2 @@ -987,26 +987,26 @@ L107:: movsxd r10, r10d movsxd rcx, ecx vpextrd eax, xmm11, 1 - vmovd xmm4, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+rdx+r9] + vmovd xmm4, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+rdx+r9] movsxd rax, eax - vpinsrd xmm12, xmm4, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+rdx+r10], 1 + vpinsrd xmm12, xmm4, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+rdx+r10], 1 vmulps xmm4, xmm9, xmm9 vfmadd213ps xmm13, xmm2, xmm3 - vmovd xmm5, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+rdx+rcx] - vmovd xmm2, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+rdx+rcx] - vmovd xmm3, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+rdx+r9] - vpinsrd xmm15, xmm5, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+rdx+rax], 1 + vmovd xmm5, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+rdx+rcx] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+rdx+rcx] + vmovd xmm3, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+rdx+r9] + vpinsrd xmm15, xmm5, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+rdx+rax], 1 vsubps xmm14, xmm1, xmm13 - vpinsrd xmm1, xmm2, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+rdx+rax], 1 - vpinsrd xmm11, xmm3, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+rdx+r10], 1 - vmovups xmm5, XMMWORD PTR [__svml_stan_ha_data_internal+704] - vfmadd213ps xmm5, xmm4, XMMWORD PTR [__svml_stan_ha_data_internal+640] + vpinsrd xmm1, xmm2, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+rdx+rax], 1 + vpinsrd xmm11, xmm3, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+rdx+r10], 1 + vmovups xmm5, XMMWORD PTR [__jsvml_stan_ha_data_internal+704] + vfmadd213ps xmm5, xmm4, XMMWORD PTR [__jsvml_stan_ha_data_internal+640] vunpcklpd xmm13, xmm15, xmm12 vpunpcklqdq xmm12, xmm1, xmm11 vmulps xmm2, xmm9, xmm5 vfnmsub213ps xmm2, xmm4, xmm14 vmovapd xmm4, xmm13 - vmovups xmm1, XMMWORD PTR [__svml_stan_ha_data_internal+1152] + vmovups xmm1, XMMWORD PTR [__jsvml_stan_ha_data_internal+1152] mov QWORD PTR [296+rsp], r13 vsubps xmm11, xmm9, xmm2 vsubps xmm9, xmm9, xmm11 @@ -1085,19 +1085,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stan_ha_cout_rare_internal + call __jsvml_stan_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_tanf4_ha_l9 ENDP +__jsvml_tanf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf4_ha_l9_B1_B3: +_unwind___jsvml_tanf4_ha_l9_B1_B3: DD 1069057 DD 2413648 DD 1153096 @@ -1115,19 +1115,19 @@ _unwind___svml_tanf4_ha_l9_B1_B3: DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_tanf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf4_ha_l9_B6_B10: +_unwind___jsvml_tanf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B5_1 DD imagerel _B5_6 - DD imagerel _unwind___svml_tanf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1136,7 +1136,7 @@ _unwind___svml_tanf4_ha_l9_B6_B10: DD imagerel _B5_6 DD imagerel _B5_11 - DD imagerel _unwind___svml_tanf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_tanf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1150,9 +1150,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanf8_ha_l9 + PUBLIC __jsvml_tanf8_ha_l9 -__svml_tanf8_ha_l9 PROC EXPORT +__jsvml_tanf8_ha_l9 PROC EXPORT _B6_1:: @@ -1175,17 +1175,17 @@ L126:: vmovups YMMWORD PTR [480+rsp], ymm10 mov QWORD PTR [512+rsp], r13 lea r13, QWORD PTR [223+rsp] - vmovups ymm15, YMMWORD PTR [__svml_stan_ha_data_internal] + vmovups ymm15, YMMWORD PTR [__jsvml_stan_ha_data_internal] and r13, -64 - vmovups ymm4, YMMWORD PTR [__svml_stan_ha_data_internal+1088] - vmovups ymm2, YMMWORD PTR [__svml_stan_ha_data_internal+64] - vmovups ymm1, YMMWORD PTR [__svml_stan_ha_data_internal+256] + vmovups ymm4, YMMWORD PTR [__jsvml_stan_ha_data_internal+1088] + vmovups ymm2, YMMWORD PTR [__jsvml_stan_ha_data_internal+64] + vmovups ymm1, YMMWORD PTR [__jsvml_stan_ha_data_internal+256] vfmadd213ps ymm15, ymm0, ymm4 vsubps ymm13, ymm15, ymm4 vfnmadd213ps ymm2, ymm13, ymm0 - vandps ymm3, ymm0, YMMWORD PTR [__svml_stan_ha_data_internal+960] - vcmpnle_uqps ymm12, ymm3, YMMWORD PTR [__svml_stan_ha_data_internal+768] - vmovups ymm3, YMMWORD PTR [__svml_stan_ha_data_internal+320] + vandps ymm3, ymm0, YMMWORD PTR [__jsvml_stan_ha_data_internal+960] + vcmpnle_uqps ymm12, ymm3, YMMWORD PTR [__jsvml_stan_ha_data_internal+768] + vmovups ymm3, YMMWORD PTR [__jsvml_stan_ha_data_internal+320] vmovaps ymm5, ymm1 vfnmadd213ps ymm5, ymm13, ymm2 vmovaps ymm10, ymm3 @@ -1216,35 +1216,35 @@ L126:: movsxd rsi, esi movsxd rdx, edx movsxd r15, r15d - vmovd xmm5, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+r11] - vmovd xmm1, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+r8] - vmovd xmm2, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+rcx] - vmovd xmm13, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+rax] - vpinsrd xmm15, xmm5, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+r9], 1 - vpinsrd xmm12, xmm1, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+rsi], 1 - vpinsrd xmm5, xmm2, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+rdx], 1 - vpinsrd xmm1, xmm13, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+384+r10+r15], 1 + vmovd xmm5, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+r11] + vmovd xmm1, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+r8] + vmovd xmm2, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+rcx] + vmovd xmm13, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+rax] + vpinsrd xmm15, xmm5, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+r9], 1 + vpinsrd xmm12, xmm1, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+rsi], 1 + vpinsrd xmm5, xmm2, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+rdx], 1 + vpinsrd xmm1, xmm13, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+384+r10+r15], 1 vpunpcklqdq xmm3, xmm15, xmm12 - vmovd xmm12, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+r11] + vmovd xmm12, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+r11] vpunpcklqdq xmm15, xmm5, xmm1 - vpinsrd xmm4, xmm12, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+r9], 1 - vmovd xmm5, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+rcx] - vmovd xmm1, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+rax] - vpinsrd xmm12, xmm1, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+r15], 1 + vpinsrd xmm4, xmm12, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+r9], 1 + vmovd xmm5, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+rcx] + vmovd xmm1, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+rax] + vpinsrd xmm12, xmm1, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+r15], 1 vinsertf128 ymm13, ymm3, xmm15, 1 - vmovd xmm3, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+r8] - vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+rsi], 1 - vpinsrd xmm15, xmm5, DWORD PTR [imagerel(__svml_stan_ha_data_internal)+512+r10+rdx], 1 + vmovd xmm3, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+r8] + vpinsrd xmm2, xmm3, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+rsi], 1 + vpinsrd xmm15, xmm5, DWORD PTR [imagerel(__jsvml_stan_ha_data_internal)+512+r10+rdx], 1 vpunpcklqdq xmm11, xmm4, xmm2 vmulps ymm2, ymm10, ymm10 - vmovups ymm4, YMMWORD PTR [__svml_stan_ha_data_internal+704] + vmovups ymm4, YMMWORD PTR [__jsvml_stan_ha_data_internal+704] vpunpcklqdq xmm3, xmm15, xmm12 - vfmadd213ps ymm4, ymm2, YMMWORD PTR [__svml_stan_ha_data_internal+640] + vfmadd213ps ymm4, ymm2, YMMWORD PTR [__jsvml_stan_ha_data_internal+640] vmovaps ymm1, ymm13 vinsertf128 ymm12, ymm11, xmm3, 1 vmulps ymm3, ymm10, ymm4 vfnmsub213ps ymm3, ymm2, ymm14 - vmovups ymm2, YMMWORD PTR [__svml_stan_ha_data_internal+1152] + vmovups ymm2, YMMWORD PTR [__jsvml_stan_ha_data_internal+1152] vsubps ymm11, ymm10, ymm3 vsubps ymm10, ymm10, ymm11 vsubps ymm5, ymm10, ymm3 @@ -1328,19 +1328,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rsi*4] lea rdx, QWORD PTR [64+r13+rsi*4] - call __svml_stan_ha_cout_rare_internal + call __jsvml_stan_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_tanf8_ha_l9 ENDP +__jsvml_tanf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf8_ha_l9_B1_B3: +_unwind___jsvml_tanf8_ha_l9_B1_B3: DD 1266689 DD 4248660 DD 2009164 @@ -1360,13 +1360,13 @@ _unwind___svml_tanf8_ha_l9_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_tanf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanf8_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanf8_ha_l9_B6_B10: +_unwind___jsvml_tanf8_ha_l9_B6_B10: DD 531745 DD 170013 DD 296983 @@ -1374,7 +1374,7 @@ _unwind___svml_tanf8_ha_l9_B6_B10: DD 550921 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_tanf8_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanf8_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1383,7 +1383,7 @@ _unwind___svml_tanf8_ha_l9_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_tanf8_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_tanf8_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1397,9 +1397,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_stan_ha_cout_rare_internal + PUBLIC __jsvml_stan_ha_cout_rare_internal -__svml_stan_ha_cout_rare_internal PROC +__jsvml_stan_ha_cout_rare_internal PROC _B7_1:: @@ -2032,13 +2032,13 @@ _B7_20:: _B7_21:: -__svml_stan_ha_cout_rare_internal ENDP +__jsvml_stan_ha_cout_rare_internal ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_stan_ha_cout_rare_internal_B1_B20: +_unwind___jsvml_stan_ha_cout_rare_internal_B1_B20: DD 621498113 DD 497743 DD 649290 @@ -2054,7 +2054,7 @@ _unwind___svml_stan_ha_cout_rare_internal_B1_B20: DD imagerel _B7_1 DD imagerel _B7_21 - DD imagerel _unwind___svml_stan_ha_cout_rare_internal_B1_B20 + DD imagerel _unwind___jsvml_stan_ha_cout_rare_internal_B1_B20 .pdata ENDS _DATA SEGMENT 'DATA' @@ -2062,8 +2062,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_stan_ha_data_internal -__svml_stan_ha_data_internal DD 1092811139 + PUBLIC __jsvml_stan_ha_data_internal +__jsvml_stan_ha_data_internal DD 1092811139 DD 1092811139 DD 1092811139 DD 1092811139 diff --git a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_tanh_windows_x86.S b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_tanh_windows_x86.S similarity index 73% rename from src/jdk.incubator.vector/windows/native/libsvml/svml_s_tanh_windows_x86.S rename to src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_tanh_windows_x86.S index f198779c6ab..ce20a2a440c 100644 --- a/src/jdk.incubator.vector/windows/native/libsvml/svml_s_tanh_windows_x86.S +++ b/src/jdk.incubator.vector/windows/native/libjsvml/jsvml_s_tanh_windows_x86.S @@ -37,9 +37,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanhf4_ha_l9 + PUBLIC __jsvml_tanhf4_ha_l9 -__svml_tanhf4_ha_l9 PROC EXPORT +__jsvml_tanhf4_ha_l9 PROC EXPORT _B1_1:: @@ -61,18 +61,18 @@ L1:: vmovups XMMWORD PTR [272+rsp], xmm10 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vpand xmm4, xmm15, XMMWORD PTR [__svml_stanh_ha_data_internal+3200] + vpand xmm4, xmm15, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3200] and r13, -64 - vpsubd xmm2, xmm4, XMMWORD PTR [__svml_stanh_ha_data_internal+3328] - vmovups xmm11, XMMWORD PTR [__svml_stanh_ha_data_internal+3392] + vpsubd xmm2, xmm4, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3328] + vmovups xmm11, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3392] vpcmpgtd xmm1, xmm2, xmm3 - vpcmpgtd xmm5, xmm4, XMMWORD PTR [__svml_stanh_ha_data_internal+3264] + vpcmpgtd xmm5, xmm4, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3264] vpand xmm12, xmm2, xmm1 vpcmpgtd xmm10, xmm2, xmm11 vmovmskps r8d, xmm5 - vandps xmm13, xmm15, XMMWORD PTR [__svml_stanh_ha_data_internal+3136] + vandps xmm13, xmm15, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3136] vblendvps xmm5, xmm12, xmm11, xmm10 - vandps xmm14, xmm15, XMMWORD PTR [__svml_stanh_ha_data_internal+3072] + vandps xmm14, xmm15, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3072] vpsrld xmm4, xmm5, 15 test r8d, r8d vmovd ecx, xmm4 @@ -84,29 +84,29 @@ L1:: vpextrd r10d, xmm4, 3 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+rcx] - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+rax] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+rax] - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+rcx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+rcx] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+rax] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+rax] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+rcx] mov QWORD PTR [296+rsp], r13 - vinsertf128 ymm1, ymm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+r9], 1 - vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+r10], 1 + vinsertf128 ymm1, ymm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+r9], 1 + vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+r10], 1 vunpcklpd ymm12, ymm1, ymm2 vunpckhpd ymm11, ymm1, ymm2 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+rax] - vinsertf128 ymm4, ymm10, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+r9], 1 - vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+r10], 1 + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+rax] + vinsertf128 ymm4, ymm10, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+r9], 1 + vinsertf128 ymm3, ymm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+r10], 1 vunpcklpd ymm10, ymm4, ymm3 vunpckhpd ymm5, ymm4, ymm3 - vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+r9], 1 - vinsertf128 ymm3, ymm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+r10], 1 + vinsertf128 ymm2, ymm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+r9], 1 + vinsertf128 ymm3, ymm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+r10], 1 vunpcklpd ymm4, ymm2, ymm3 vunpckhpd ymm3, ymm2, ymm3 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+rcx] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+rax] - vinsertf128 ymm1, ymm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+r9], 1 - vinsertf128 ymm2, ymm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+r10], 1 + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+rcx] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+rax] + vinsertf128 ymm1, ymm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+r9], 1 + vinsertf128 ymm2, ymm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+r10], 1 vunpcklpd ymm0, ymm1, ymm2 vunpckhpd ymm1, ymm1, ymm2 vfmadd213pd ymm1, ymm13, ymm0 @@ -170,19 +170,19 @@ _B1_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stanh_ha_cout_rare_internal + call __jsvml_stanh_ha_cout_rare_internal jmp _B1_8 ALIGN 16 _B1_11:: -__svml_tanhf4_ha_l9 ENDP +__jsvml_tanhf4_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf4_ha_l9_B1_B3: +_unwind___jsvml_tanhf4_ha_l9_B1_B3: DD 1071105 DD 2413656 DD 1157200 @@ -200,19 +200,19 @@ _unwind___svml_tanhf4_ha_l9_B1_B3: DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_tanhf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanhf4_ha_l9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf4_ha_l9_B6_B10: +_unwind___jsvml_tanhf4_ha_l9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B1_1 DD imagerel _B1_6 - DD imagerel _unwind___svml_tanhf4_ha_l9_B1_B3 + DD imagerel _unwind___jsvml_tanhf4_ha_l9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -221,7 +221,7 @@ _unwind___svml_tanhf4_ha_l9_B6_B10: DD imagerel _B1_6 DD imagerel _B1_11 - DD imagerel _unwind___svml_tanhf4_ha_l9_B6_B10 + DD imagerel _unwind___jsvml_tanhf4_ha_l9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -235,9 +235,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanhf4_ha_e9 + PUBLIC __jsvml_tanhf4_ha_e9 -__svml_tanhf4_ha_e9 PROC EXPORT +__jsvml_tanhf4_ha_e9 PROC EXPORT _B2_1:: @@ -258,20 +258,20 @@ L20:: vmovups XMMWORD PTR [272+rsp], xmm9 mov QWORD PTR [288+rsp], r13 lea r13, QWORD PTR [111+rsp] - vpand xmm3, xmm0, XMMWORD PTR [__svml_stanh_ha_data_internal+3200] + vpand xmm3, xmm0, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3200] and r13, -64 - vpcmpgtd xmm2, xmm3, XMMWORD PTR [__svml_stanh_ha_data_internal+3264] + vpcmpgtd xmm2, xmm3, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3264] vmovmskps r8d, xmm2 - vpsubd xmm2, xmm3, XMMWORD PTR [__svml_stanh_ha_data_internal+3328] - vmovups xmm9, XMMWORD PTR [__svml_stanh_ha_data_internal+3392] + vpsubd xmm2, xmm3, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3328] + vmovups xmm9, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3392] vpcmpgtd xmm5, xmm2, xmm4 vpand xmm3, xmm2, xmm5 vpcmpgtd xmm4, xmm2, xmm9 vblendvps xmm5, xmm3, xmm9, xmm4 - vandps xmm11, xmm0, XMMWORD PTR [__svml_stanh_ha_data_internal+3136] + vandps xmm11, xmm0, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3136] vpsrld xmm10, xmm5, 15 vmovd ecx, xmm10 - vandps xmm1, xmm0, XMMWORD PTR [__svml_stanh_ha_data_internal+3072] + vandps xmm1, xmm0, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3072] vcvtps2pd ymm11, xmm11 vpextrd eax, xmm10, 1 movsxd rcx, ecx @@ -280,29 +280,29 @@ L20:: vpextrd r10d, xmm10, 3 movsxd r9, r9d movsxd r10, r10d - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+rcx] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+rax] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+rax] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+rcx] + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+rcx] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+rax] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+rax] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+rcx] mov QWORD PTR [296+rsp], r13 - vinsertf128 ymm14, ymm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+r9], 1 - vinsertf128 ymm3, ymm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+r10], 1 - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+rcx] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+rax] + vinsertf128 ymm14, ymm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+r9], 1 + vinsertf128 ymm3, ymm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+r10], 1 + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+rcx] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+rax] vunpcklpd ymm2, ymm14, ymm3 vunpckhpd ymm3, ymm14, ymm3 - vinsertf128 ymm9, ymm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+r9], 1 - vinsertf128 ymm10, ymm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+r10], 1 + vinsertf128 ymm9, ymm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+r9], 1 + vinsertf128 ymm10, ymm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+r10], 1 vunpcklpd ymm4, ymm9, ymm10 vunpckhpd ymm5, ymm9, ymm10 - vinsertf128 ymm14, ymm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+r9], 1 - vinsertf128 ymm10, ymm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+r10], 1 + vinsertf128 ymm14, ymm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+r9], 1 + vinsertf128 ymm10, ymm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+r10], 1 vunpcklpd ymm9, ymm14, ymm10 vunpckhpd ymm10, ymm14, ymm10 - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+rcx] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+rax] - vinsertf128 ymm13, ymm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+r9], 1 - vinsertf128 ymm14, ymm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+r10], 1 + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+rcx] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+rax] + vinsertf128 ymm13, ymm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+r9], 1 + vinsertf128 ymm14, ymm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+r10], 1 vunpcklpd ymm12, ymm13, ymm14 vunpckhpd ymm13, ymm13, ymm14 vmulpd ymm13, ymm11, ymm13 @@ -375,19 +375,19 @@ _B2_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stanh_ha_cout_rare_internal + call __jsvml_stanh_ha_cout_rare_internal jmp _B2_8 ALIGN 16 _B2_11:: -__svml_tanhf4_ha_e9 ENDP +__jsvml_tanhf4_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf4_ha_e9_B1_B3: +_unwind___jsvml_tanhf4_ha_e9_B1_B3: DD 1070081 DD 2413652 DD 1153100 @@ -405,19 +405,19 @@ _unwind___svml_tanhf4_ha_e9_B1_B3: DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_tanhf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanhf4_ha_e9_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf4_ha_e9_B6_B10: +_unwind___jsvml_tanhf4_ha_e9_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B2_1 DD imagerel _B2_6 - DD imagerel _unwind___svml_tanhf4_ha_e9_B1_B3 + DD imagerel _unwind___jsvml_tanhf4_ha_e9_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -426,7 +426,7 @@ _unwind___svml_tanhf4_ha_e9_B6_B10: DD imagerel _B2_6 DD imagerel _B2_11 - DD imagerel _unwind___svml_tanhf4_ha_e9_B6_B10 + DD imagerel _unwind___jsvml_tanhf4_ha_e9_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -440,9 +440,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanhf16_ha_z0 + PUBLIC __jsvml_tanhf16_ha_z0 -__svml_tanhf16_ha_z0 PROC EXPORT +__jsvml_tanhf16_ha_z0 PROC EXPORT _B3_1:: @@ -455,48 +455,48 @@ L39:: sub rsp, 1336 mov QWORD PTR [1320+rsp], r13 lea r13, QWORD PTR [1183+rsp] - vmovups zmm24, ZMMWORD PTR [__svml_stanh_ha_data_internal] + vmovups zmm24, ZMMWORD PTR [__jsvml_stanh_ha_data_internal] and r13, -64 - vmovups zmm25, ZMMWORD PTR [__svml_stanh_ha_data_internal+896] - vmovups zmm30, ZMMWORD PTR [__svml_stanh_ha_data_internal+1024] - vmovups zmm26, ZMMWORD PTR [__svml_stanh_ha_data_internal+768] - vmovups zmm27, ZMMWORD PTR [__svml_stanh_ha_data_internal+640] - vmovups zmm28, ZMMWORD PTR [__svml_stanh_ha_data_internal+512] - vmovups zmm31, ZMMWORD PTR [__svml_stanh_ha_data_internal+256] - vandps zmm23, zmm0, ZMMWORD PTR [__svml_stanh_ha_data_internal+3136] + vmovups zmm25, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+896] + vmovups zmm30, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+1024] + vmovups zmm26, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+768] + vmovups zmm27, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+640] + vmovups zmm28, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+512] + vmovups zmm31, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+256] + vandps zmm23, zmm0, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+3136] vpternlogd zmm1, zmm1, zmm1, 255 mov QWORD PTR [1328+rsp], r13 - vpandd zmm2, zmm0, ZMMWORD PTR [__svml_stanh_ha_data_internal+1152] - vpsubd zmm3, zmm2, ZMMWORD PTR [__svml_stanh_ha_data_internal+1216] - vpcmpd k1, zmm2, ZMMWORD PTR [__svml_stanh_ha_data_internal+3264], 2 + vpandd zmm2, zmm0, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+1152] + vpsubd zmm3, zmm2, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+1216] + vpcmpd k1, zmm2, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+3264], 2 vpxord zmm4, zmm4, zmm4 vpmaxsd zmm5, zmm3, zmm4 - vpminsd zmm22, zmm5, ZMMWORD PTR [__svml_stanh_ha_data_internal+1280] + vpminsd zmm22, zmm5, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+1280] vpsrld zmm29, zmm22, 21 - vmovups zmm3, ZMMWORD PTR [__svml_stanh_ha_data_internal+128] - vpermt2ps zmm24, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+64] - vpermt2ps zmm25, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+960] - vpermt2ps zmm30, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+1088] - vpermt2ps zmm26, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+832] - vpermt2ps zmm27, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+704] - vpermt2ps zmm28, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+576] - vpermt2ps zmm31, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+320] - vpermt2ps zmm3, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+192] + vmovups zmm3, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+128] + vpermt2ps zmm24, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+64] + vpermt2ps zmm25, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+960] + vpermt2ps zmm30, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+1088] + vpermt2ps zmm26, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+832] + vpermt2ps zmm27, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+704] + vpermt2ps zmm28, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+576] + vpermt2ps zmm31, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+320] + vpermt2ps zmm3, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+192] vpandnd zmm1{k1}, zmm2, zmm2 vsubps zmm2, zmm23, zmm24 {rn-sae} vptestmd k0, zmm1, zmm1 - vmovups zmm1, ZMMWORD PTR [__svml_stanh_ha_data_internal+384] + vmovups zmm1, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+384] vfmadd213ps zmm30, zmm2, zmm25 {rn-sae} kmovw r8d, k0 vfmadd213ps zmm30, zmm2, zmm26 {rn-sae} - vpermt2ps zmm1, zmm29, ZMMWORD PTR [__svml_stanh_ha_data_internal+448] + vpermt2ps zmm1, zmm29, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+448] vfmadd213ps zmm30, zmm2, zmm27 {rn-sae} vfmadd213ps zmm30, zmm2, zmm28 {rn-sae} vmulps zmm25, zmm30, zmm2 {rn-sae} vfmadd213ps zmm25, zmm2, zmm31 {rn-sae} vfmadd213ps zmm2, zmm1, zmm25 {rn-sae} vaddps zmm1, zmm2, zmm3 {rn-sae} - vpternlogd zmm1, zmm0, ZMMWORD PTR [__svml_stanh_ha_data_internal+3072], 248 + vpternlogd zmm1, zmm0, ZMMWORD PTR [__jsvml_stanh_ha_data_internal+3072], 248 test r8d, r8d jne _B3_3 @@ -629,19 +629,19 @@ _B3_15:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stanh_ha_cout_rare_internal + call __jsvml_stanh_ha_cout_rare_internal jmp _B3_13 ALIGN 16 _B3_16:: -__svml_tanhf16_ha_z0 ENDP +__jsvml_tanhf16_ha_z0 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf16_ha_z0_B1_B9: +_unwind___jsvml_tanhf16_ha_z0_B1_B9: DD 267009 DD 10867731 DD 10944779 @@ -653,13 +653,13 @@ _unwind___svml_tanhf16_ha_z0_B1_B9: DD imagerel _B3_1 DD imagerel _B3_11 - DD imagerel _unwind___svml_tanhf16_ha_z0_B1_B9 + DD imagerel _unwind___jsvml_tanhf16_ha_z0_B1_B9 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf16_ha_z0_B11_B15: +_unwind___jsvml_tanhf16_ha_z0_B11_B15: DD 3472641 DD 9131261 DD 8942834 @@ -695,7 +695,7 @@ _unwind___svml_tanhf16_ha_z0_B11_B15: DD imagerel _B3_11 DD imagerel _B3_16 - DD imagerel _unwind___svml_tanhf16_ha_z0_B11_B15 + DD imagerel _unwind___jsvml_tanhf16_ha_z0_B11_B15 .pdata ENDS _DATA SEGMENT 'DATA' @@ -709,9 +709,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanhf8_ha_l9 + PUBLIC __jsvml_tanhf8_ha_l9 -__svml_tanhf8_ha_l9 PROC EXPORT +__jsvml_tanhf8_ha_l9 PROC EXPORT _B4_1:: @@ -741,18 +741,18 @@ L90:: lea r13, QWORD PTR [95+rsp] and r13, -64 vmovups YMMWORD PTR [32+r13], ymm0 - vmovups ymm9, YMMWORD PTR [__svml_stanh_ha_data_internal+3392] - vandps ymm12, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3136] - vandps ymm5, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3072] - vpand ymm0, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3200] + vmovups ymm9, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3392] + vandps ymm12, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3136] + vandps ymm5, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3072] + vpand ymm0, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3200] vmovups YMMWORD PTR [r13], ymm5 - vpsubd ymm8, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3328] + vpsubd ymm8, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3328] vpcmpgtd ymm11, ymm8, ymm10 vpand ymm6, ymm8, ymm11 vpcmpgtd ymm7, ymm8, ymm9 vblendvps ymm2, ymm6, ymm9, ymm7 vpsrld ymm4, ymm2, 15 - vpcmpgtd ymm3, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3264] + vpcmpgtd ymm3, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3264] vmovmskps ebx, ymm3 mov QWORD PTR [552+rsp], r13 test ebx, ebx @@ -773,52 +773,52 @@ L90:: vpextrd r11d, xmm5, 3 movsxd rax, eax movsxd r11, r11d - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+r10] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+r8] - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rdx] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rdx] - vmovupd xmm9, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+r10] - vmovupd xmm7, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+r8] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rcx] - vinsertf128 ymm0, ymm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rdi], 1 - vinsertf128 ymm10, ymm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rsi], 1 + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+r10] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+r8] + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rdx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rdx] + vmovupd xmm9, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+r10] + vmovupd xmm7, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+r8] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rcx] + vinsertf128 ymm0, ymm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rdi], 1 + vinsertf128 ymm10, ymm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rsi], 1 vunpcklpd ymm15, ymm0, ymm10 vmovupd YMMWORD PTR [64+r13], ymm15 - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+r8] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+r8] vunpckhpd ymm10, ymm0, ymm10 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rcx] - vinsertf128 ymm8, ymm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rax], 1 - vinsertf128 ymm6, ymm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+r11], 1 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+r10] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rcx] + vinsertf128 ymm8, ymm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rax], 1 + vinsertf128 ymm6, ymm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+r11], 1 + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+r10] vunpcklpd ymm11, ymm8, ymm6 vmovupd YMMWORD PTR [96+r13], ymm11 vunpckhpd ymm11, ymm8, ymm6 - vinsertf128 ymm14, ymm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+r11], 1 - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rdx] - vinsertf128 ymm5, ymm9, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rdi], 1 - vinsertf128 ymm3, ymm7, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rsi], 1 - vinsertf128 ymm13, ymm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rax], 1 + vinsertf128 ymm14, ymm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+r11], 1 + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rdx] + vinsertf128 ymm5, ymm9, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rdi], 1 + vinsertf128 ymm3, ymm7, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rsi], 1 + vinsertf128 ymm13, ymm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rax], 1 vunpcklpd ymm8, ymm5, ymm3 vunpckhpd ymm6, ymm5, ymm3 vunpcklpd ymm9, ymm13, ymm14 vunpckhpd ymm7, ymm13, ymm14 - vinsertf128 ymm2, ymm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rdi], 1 - vinsertf128 ymm5, ymm15, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rsi], 1 - vinsertf128 ymm3, ymm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rax], 1 - vinsertf128 ymm13, ymm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+r11], 1 - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+r8] + vinsertf128 ymm2, ymm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rdi], 1 + vinsertf128 ymm5, ymm15, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rsi], 1 + vinsertf128 ymm3, ymm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rax], 1 + vinsertf128 ymm13, ymm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+r11], 1 + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+r8] vunpcklpd ymm4, ymm2, ymm5 vunpckhpd ymm2, ymm2, ymm5 vunpcklpd ymm5, ymm3, ymm13 vunpckhpd ymm3, ymm3, ymm13 - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+r10] - vmovupd xmm15, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rcx] - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rdx] - vinsertf128 ymm14, ymm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rsi], 1 - vinsertf128 ymm13, ymm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rdi], 1 - vinsertf128 ymm15, ymm15, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rax], 1 - vinsertf128 ymm0, ymm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+r11], 1 + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+r10] + vmovupd xmm15, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rcx] + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rdx] + vinsertf128 ymm14, ymm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rsi], 1 + vinsertf128 ymm13, ymm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rdi], 1 + vinsertf128 ymm15, ymm15, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rax], 1 + vinsertf128 ymm0, ymm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+r11], 1 vunpcklpd ymm1, ymm13, ymm14 vunpckhpd ymm14, ymm13, ymm14 vunpcklpd ymm13, ymm15, ymm0 @@ -897,19 +897,19 @@ _B4_10:: lea rcx, QWORD PTR [r13+rsi*4] lea rdx, QWORD PTR [64+r13+rsi*4] - call __svml_stanh_ha_cout_rare_internal + call __jsvml_stanh_ha_cout_rare_internal jmp _B4_8 ALIGN 16 _B4_11:: -__svml_tanhf8_ha_l9 ENDP +__jsvml_tanhf8_ha_l9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf8_ha_l9_B1_B10: +_unwind___jsvml_tanhf8_ha_l9_B1_B10: DD 1801217 DD 4510844 DD 2123887 @@ -933,7 +933,7 @@ _unwind___svml_tanhf8_ha_l9_B1_B10: DD imagerel _B4_1 DD imagerel _B4_11 - DD imagerel _unwind___svml_tanhf8_ha_l9_B1_B10 + DD imagerel _unwind___jsvml_tanhf8_ha_l9_B1_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -947,9 +947,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanhf8_ha_e9 + PUBLIC __jsvml_tanhf8_ha_e9 -__svml_tanhf8_ha_e9 PROC EXPORT +__jsvml_tanhf8_ha_e9 PROC EXPORT _B5_1:: @@ -979,12 +979,12 @@ L121:: lea r13, QWORD PTR [95+rsp] and r13, -64 vmovups YMMWORD PTR [32+r13], ymm0 - vmovups xmm3, XMMWORD PTR [__svml_stanh_ha_data_internal+3200] - vmovups xmm14, XMMWORD PTR [__svml_stanh_ha_data_internal+3264] - vmovups xmm11, XMMWORD PTR [__svml_stanh_ha_data_internal+3328] - vmovups xmm10, XMMWORD PTR [__svml_stanh_ha_data_internal+3392] - vandps ymm15, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3136] - vandps ymm5, ymm0, YMMWORD PTR [__svml_stanh_ha_data_internal+3072] + vmovups xmm3, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3200] + vmovups xmm14, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3264] + vmovups xmm11, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3328] + vmovups xmm10, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3392] + vandps ymm15, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3136] + vandps ymm5, ymm0, YMMWORD PTR [__jsvml_stanh_ha_data_internal+3072] vmovups YMMWORD PTR [r13], ymm5 mov QWORD PTR [552+rsp], r13 vpand xmm5, xmm0, xmm3 @@ -1023,54 +1023,54 @@ L121:: movsxd rsi, esi movsxd rax, eax movsxd r11, r11d - vmovupd xmm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+r10] - vmovupd xmm11, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+r8] - vmovupd xmm6, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rcx] - vmovupd xmm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rdx] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+r10] - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+r8] - vinsertf128 ymm9, ymm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rdi], 1 - vinsertf128 ymm8, ymm11, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rsi], 1 - vinsertf128 ymm3, ymm6, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+rax], 1 - vinsertf128 ymm1, ymm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+r9+r11], 1 + vmovupd xmm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+r10] + vmovupd xmm11, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+r8] + vmovupd xmm6, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rcx] + vmovupd xmm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rdx] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+r10] + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+r8] + vinsertf128 ymm9, ymm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rdi], 1 + vinsertf128 ymm8, ymm11, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rsi], 1 + vinsertf128 ymm3, ymm6, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+rax], 1 + vinsertf128 ymm1, ymm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+r9+r11], 1 vunpcklpd ymm10, ymm9, ymm8 vunpcklpd ymm4, ymm3, ymm1 vmovupd YMMWORD PTR [64+r13], ymm10 vmovupd YMMWORD PTR [96+r13], ymm4 - vmovupd xmm10, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rcx] - vmovupd xmm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+r10] + vmovupd xmm10, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rcx] + vmovupd xmm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+r10] vunpckhpd ymm11, ymm9, ymm8 vunpckhpd ymm12, ymm3, ymm1 - vmovupd xmm8, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rdx] - vmovupd xmm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+r8] - vinsertf128 ymm0, ymm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rdi], 1 - vinsertf128 ymm14, ymm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rsi], 1 + vmovupd xmm8, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rdx] + vmovupd xmm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+r8] + vinsertf128 ymm0, ymm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rdi], 1 + vinsertf128 ymm14, ymm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rsi], 1 vunpcklpd ymm9, ymm0, ymm14 vunpckhpd ymm7, ymm0, ymm14 - vmovupd xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rcx] - vmovupd xmm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rdx] - vinsertf128 ymm6, ymm10, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+rax], 1 - vinsertf128 ymm5, ymm8, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+r9+r11], 1 - vinsertf128 ymm1, ymm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rdi], 1 - vinsertf128 ymm2, ymm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rsi], 1 + vmovupd xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rcx] + vmovupd xmm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rdx] + vinsertf128 ymm6, ymm10, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+rax], 1 + vinsertf128 ymm5, ymm8, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+r9+r11], 1 + vinsertf128 ymm1, ymm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rdi], 1 + vinsertf128 ymm2, ymm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rsi], 1 vunpcklpd ymm10, ymm6, ymm5 vunpckhpd ymm8, ymm6, ymm5 vunpcklpd ymm5, ymm1, ymm2 vunpckhpd ymm3, ymm1, ymm2 - vmovupd xmm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+r10] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+r8] - vinsertf128 ymm14, ymm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+rax], 1 - vinsertf128 ymm4, ymm0, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+r9+r11], 1 + vmovupd xmm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+r10] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+r8] + vinsertf128 ymm14, ymm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+rax], 1 + vinsertf128 ymm4, ymm0, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+r9+r11], 1 vunpcklpd ymm6, ymm14, ymm4 vunpckhpd ymm4, ymm14, ymm4 - vinsertf128 ymm14, ymm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rdi], 1 - vinsertf128 ymm13, ymm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rsi], 1 + vinsertf128 ymm14, ymm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rdi], 1 + vinsertf128 ymm13, ymm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rsi], 1 vunpcklpd ymm1, ymm14, ymm13 vunpckhpd ymm0, ymm14, ymm13 - vmovupd xmm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rcx] - vmovupd xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rdx] - vinsertf128 ymm14, ymm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+rax], 1 - vinsertf128 ymm13, ymm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+r9+r11], 1 + vmovupd xmm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rcx] + vmovupd xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rdx] + vinsertf128 ymm14, ymm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+rax], 1 + vinsertf128 ymm13, ymm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+r9+r11], 1 vunpcklpd ymm2, ymm14, ymm13 vunpckhpd ymm13, ymm14, ymm13 vcvtps2pd ymm14, xmm15 @@ -1164,19 +1164,19 @@ _B5_10:: lea rcx, QWORD PTR [r13+rsi*4] lea rdx, QWORD PTR [64+r13+rsi*4] - call __svml_stanh_ha_cout_rare_internal + call __jsvml_stanh_ha_cout_rare_internal jmp _B5_8 ALIGN 16 _B5_11:: -__svml_tanhf8_ha_e9 ENDP +__jsvml_tanhf8_ha_e9 ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf8_ha_e9_B1_B10: +_unwind___jsvml_tanhf8_ha_e9_B1_B10: DD 1801217 DD 4510844 DD 1992820 @@ -1200,7 +1200,7 @@ _unwind___svml_tanhf8_ha_e9_B1_B10: DD imagerel _B5_1 DD imagerel _B5_11 - DD imagerel _unwind___svml_tanhf8_ha_e9_B1_B10 + DD imagerel _unwind___jsvml_tanhf8_ha_e9_B1_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1214,9 +1214,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_tanhf4_ha_ex + PUBLIC __jsvml_tanhf4_ha_ex -__svml_tanhf4_ha_ex PROC EXPORT +__jsvml_tanhf4_ha_ex PROC EXPORT _B6_1:: @@ -1242,12 +1242,12 @@ L152:: movups XMMWORD PTR [224+rsp], xmm6 mov QWORD PTR [400+rsp], r13 lea r13, QWORD PTR [111+rsp] - movdqu xmm11, XMMWORD PTR [__svml_stanh_ha_data_internal+3200] + movdqu xmm11, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3200] and r13, -64 pand xmm11, xmm4 movdqa xmm5, xmm11 - psubd xmm11, XMMWORD PTR [__svml_stanh_ha_data_internal+3328] - movdqu xmm7, XMMWORD PTR [__svml_stanh_ha_data_internal+3392] + psubd xmm11, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3328] + movdqu xmm7, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3392] movdqa xmm12, xmm11 movdqa xmm2, xmm11 pcmpgtd xmm12, xmm7 @@ -1258,7 +1258,7 @@ L152:: andnps xmm10, xmm11 orps xmm10, xmm7 psrld xmm10, 15 - movups xmm3, XMMWORD PTR [__svml_stanh_ha_data_internal+3072] + movups xmm3, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3072] movd ecx, xmm10 andps xmm3, xmm4 pshufd xmm8, xmm10, 1 @@ -1268,52 +1268,52 @@ L152:: pshufd xmm3, xmm10, 3 movd r9d, xmm9 movd r10d, xmm3 - movups xmm0, XMMWORD PTR [__svml_stanh_ha_data_internal+3136] - pcmpgtd xmm5, XMMWORD PTR [__svml_stanh_ha_data_internal+3264] + movups xmm0, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3136] + pcmpgtd xmm5, XMMWORD PTR [__jsvml_stanh_ha_data_internal+3264] andps xmm0, xmm4 movsxd rcx, ecx movsxd rax, eax movsxd r9, r9d movsxd r10, r10d - movups xmm11, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+rcx] + movups xmm11, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+rcx] movups XMMWORD PTR [32+rsp], xmm4 movaps xmm4, xmm11 movmskps r8d, xmm5 - movups xmm5, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+rax] - movups xmm12, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+r9] - movups xmm7, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+rcx] + movups xmm5, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+rax] + movups xmm12, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+r9] + movups xmm7, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+rcx] movaps xmm6, xmm12 unpcklpd xmm4, xmm5 movaps xmm9, xmm7 - movups xmm1, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1344+rdx+r10] + movups xmm1, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1344+rdx+r10] movups XMMWORD PTR [368+rsp], xmm4 - movups xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+rax] - movups xmm8, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+r9] - movups xmm4, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+r9] + movups xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+rax] + movups xmm8, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+r9] + movups xmm4, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+r9] movaps xmm10, xmm8 unpcklpd xmm6, xmm1 movups XMMWORD PTR [384+rsp], xmm6 movaps xmm6, xmm4 - movups xmm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1360+rdx+r10] - movups xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+r10] + movups xmm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1360+rdx+r10] + movups xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+r10] unpcklpd xmm9, xmm13 unpckhpd xmm7, xmm13 - movups xmm3, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+rcx] - movups xmm13, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+rcx] + movups xmm3, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+rcx] + movups xmm13, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+rcx] unpckhpd xmm11, xmm5 movaps xmm5, xmm3 unpckhpd xmm12, xmm1 movaps xmm1, xmm13 unpcklpd xmm10, xmm14 unpckhpd xmm8, xmm14 - movups xmm15, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1376+rdx+rax] + movups xmm15, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1376+rdx+rax] unpcklpd xmm6, xmm2 unpckhpd xmm4, xmm2 - movups xmm2, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+rax] - movups xmm14, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+r9] + movups xmm2, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+rax] + movups xmm14, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+r9] unpcklpd xmm5, xmm15 unpckhpd xmm3, xmm15 - movups xmm15, XMMWORD PTR [imagerel(__svml_stanh_ha_data_internal)+1392+rdx+r10] + movups xmm15, XMMWORD PTR [imagerel(__jsvml_stanh_ha_data_internal)+1392+rdx+r10] unpcklpd xmm1, xmm2 unpckhpd xmm13, xmm2 movaps xmm2, xmm14 @@ -1415,19 +1415,19 @@ _B6_10:: lea rcx, QWORD PTR [r13+rbx*4] lea rdx, QWORD PTR [64+r13+rbx*4] - call __svml_stanh_ha_cout_rare_internal + call __jsvml_stanh_ha_cout_rare_internal jmp _B6_8 ALIGN 16 _B6_11:: -__svml_tanhf4_ha_ex ENDP +__jsvml_tanhf4_ha_ex ENDP _TEXT ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf4_ha_ex_B1_B3: +_unwind___jsvml_tanhf4_ha_ex_B1_B3: DD 1603841 DD 3331193 DD 944241 @@ -1449,19 +1449,19 @@ _unwind___svml_tanhf4_ha_ex_B1_B3: DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_tanhf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_tanhf4_ha_ex_B1_B3 .pdata ENDS .xdata SEGMENT DWORD READ '' ALIGN 004H -_unwind___svml_tanhf4_ha_ex_B6_B10: +_unwind___jsvml_tanhf4_ha_ex_B6_B10: DD 265761 DD 287758 DD 340999 DD imagerel _B6_1 DD imagerel _B6_6 - DD imagerel _unwind___svml_tanhf4_ha_ex_B1_B3 + DD imagerel _unwind___jsvml_tanhf4_ha_ex_B1_B3 .xdata ENDS .pdata SEGMENT DWORD READ '' @@ -1470,7 +1470,7 @@ _unwind___svml_tanhf4_ha_ex_B6_B10: DD imagerel _B6_6 DD imagerel _B6_11 - DD imagerel _unwind___svml_tanhf4_ha_ex_B6_B10 + DD imagerel _unwind___jsvml_tanhf4_ha_ex_B6_B10 .pdata ENDS _DATA SEGMENT 'DATA' @@ -1484,9 +1484,9 @@ _TEXT ENDS _TEXT SEGMENT 'CODE' ALIGN 16 - PUBLIC __svml_stanh_ha_cout_rare_internal + PUBLIC __jsvml_stanh_ha_cout_rare_internal -__svml_stanh_ha_cout_rare_internal PROC +__jsvml_stanh_ha_cout_rare_internal PROC _B7_1:: @@ -1531,7 +1531,7 @@ _B7_5:: _B7_6:: -__svml_stanh_ha_cout_rare_internal ENDP +__jsvml_stanh_ha_cout_rare_internal ENDP _TEXT ENDS _DATA SEGMENT 'DATA' @@ -1539,8 +1539,8 @@ _DATA ENDS _RDATA SEGMENT READ PAGE 'DATA' ALIGN 32 - PUBLIC __svml_stanh_ha_data_internal -__svml_stanh_ha_data_internal DD 0 + PUBLIC __jsvml_stanh_ha_data_internal +__jsvml_stanh_ha_data_internal DD 0 DD 1030750208 DD 1032847360 DD 1034944512 diff --git a/test/jdk/jdk/incubator/vector/ImageTest.java b/test/jdk/jdk/incubator/vector/ImageTest.java index 9ae14049c33..656f0a27751 100644 --- a/test/jdk/jdk/incubator/vector/ImageTest.java +++ b/test/jdk/jdk/incubator/vector/ImageTest.java @@ -31,7 +31,7 @@ import java.util.spi.ToolProvider; /** * @test - * @summary Tests that the SVML shared library is present in an image only when jdk.incubator.vector is present + * @summary Tests that the JSVML shared library is present in an image only when jdk.incubator.vector is present * @requires vm.compiler2.enabled * @requires os.arch == "x86_64" | os.arch == "amd64" * @requires os.family == "linux" | os.family == "windows" @@ -46,9 +46,9 @@ public class ImageTest { new RuntimeException("jlink tool not found") ); - static final String SVML_LIBRARY_NAME = Platform.isWindows() - ? "svml.dll" - : "libsvml.so"; + static final String JSVML_LIBRARY_NAME = Platform.isWindows() + ? "jsvml.dll" + : "libjsvml.so"; static void link(String module, Path output) { int e = JLINK_TOOL.run(System.out, System.err, @@ -60,14 +60,14 @@ public class ImageTest { } } - static void checkSVML(Path image, boolean shouldBepresent) { - Path libsvml = Platform.libDir(image).resolve(SVML_LIBRARY_NAME); + static void checkJSVML(Path image, boolean shouldBepresent) { + Path libjsvml = Platform.libDir(image).resolve(JSVML_LIBRARY_NAME); - boolean exists = Files.exists(libsvml); + boolean exists = Files.exists(libjsvml); if (shouldBepresent) { - Assert.assertTrue(exists, libsvml + " should be present"); + Assert.assertTrue(exists, libjsvml + " should be present"); } else { - Assert.assertFalse(exists, libsvml + "should be absent"); + Assert.assertFalse(exists, libjsvml + "should be absent"); } } @@ -76,13 +76,13 @@ public class ImageTest { public void withVectorModule() { Path output = Path.of("withVectorModuleImage"); link("jdk.incubator.vector", output); - checkSVML(output, true); + checkJSVML(output, true); } @Test public void withoutVectorModule() { Path output = Path.of("withoutVectorModuleImage"); link("java.base", output); - checkSVML(output, false); + checkJSVML(output, false); } } diff --git a/test/jdk/jdk/incubator/vector/LoadSvmlTest.java b/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java similarity index 93% rename from test/jdk/jdk/incubator/vector/LoadSvmlTest.java rename to test/jdk/jdk/incubator/vector/LoadJsvmlTest.java index a3cbd3a3c52..355201bfbf3 100644 --- a/test/jdk/jdk/incubator/vector/LoadSvmlTest.java +++ b/test/jdk/jdk/incubator/vector/LoadJsvmlTest.java @@ -24,13 +24,13 @@ /* * @test * @bug 8269335 - * @summary Tests SVML shared library is loaded successfully. + * @summary Tests JSVML shared library is loaded successfully. * @modules jdk.incubator.vector * @requires vm.compiler2.enabled * @requires os.arch == "x86_64" | os.arch == "amd64" * @requires os.family == "linux" | os.family == "windows" * @library /test/lib - * @run main LoadSvmlTest + * @run main LoadJsvmlTest */ import jdk.test.lib.process.ProcessTools; @@ -42,7 +42,7 @@ import jdk.incubator.vector.Vector; import jdk.incubator.vector.VectorSpecies; -public class LoadSvmlTest { +public class LoadJsvmlTest { private static class VectorTest { @@ -67,6 +67,6 @@ public class LoadSvmlTest { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldHaveExitValue(0); - output.shouldMatch("Loaded library .*svml"); + output.shouldMatch("Loaded library .*jsvml"); } } -- GitLab From 396132ff1e56463ad195cac5c9ac8e2eac5a16e8 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Fri, 5 Nov 2021 03:44:45 +0000 Subject: [PATCH 208/890] 8275509: ModuleDescriptor.hashCode isn't reproducible across builds Reviewed-by: alanb, ihse --- .../java/lang/module/ModuleDescriptor.java | 20 ++++- .../module/ModuleDescriptorHashCodeTest.java | 76 +++++++++++++++++++ 2 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java diff --git a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java index a412dd753cc..6388858f72b 100644 --- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java +++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java @@ -327,7 +327,7 @@ public class ModuleDescriptor */ @Override public int hashCode() { - int hash = name.hashCode() * 43 + mods.hashCode(); + int hash = name.hashCode() * 43 + modsHashCode(mods); if (compiledVersion != null) hash = hash * 43 + compiledVersion.hashCode(); if (rawCompiledVersion != null) @@ -505,7 +505,7 @@ public class ModuleDescriptor */ @Override public int hashCode() { - int hash = mods.hashCode(); + int hash = modsHashCode(mods); hash = hash * 43 + source.hashCode(); return hash * 43 + targets.hashCode(); } @@ -708,7 +708,7 @@ public class ModuleDescriptor */ @Override public int hashCode() { - int hash = mods.hashCode(); + int hash = modsHashCode(mods); hash = hash * 43 + source.hashCode(); return hash * 43 + targets.hashCode(); } @@ -2261,7 +2261,7 @@ public class ModuleDescriptor int hc = hash; if (hc == 0) { hc = name.hashCode(); - hc = hc * 43 + Objects.hashCode(modifiers); + hc = hc * 43 + modsHashCode(modifiers); hc = hc * 43 + requires.hashCode(); hc = hc * 43 + Objects.hashCode(packages); hc = hc * 43 + exports.hashCode(); @@ -2546,6 +2546,18 @@ public class ModuleDescriptor .collect(Collectors.joining(" ")); } + /** + * Generates and returns a hashcode for the enum instances. The returned hashcode + * is a value based on the {@link Enum#name() name} of each enum instance. + */ + private static int modsHashCode(Iterable> enums) { + int h = 0; + for (Enum e : enums) { + h = h * 43 + Objects.hashCode(e.name()); + } + return h; + } + private static > int compare(T obj1, T obj2) { if (obj1 != null) { diff --git a/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java b/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java new file mode 100644 index 00000000000..78b124d8701 --- /dev/null +++ b/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021, 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 org.testng.annotations.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.module.ModuleDescriptor; +import java.util.Set; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotSame; + +/** + * @test + * @bug 8275509 + * @run testng ModuleDescriptorHashCodeTest + * @run testng/othervm -Xshare:off ModuleDescriptorHashCodeTest + * @summary Tests the ModuleDescriptor.hashCode() for boot layer modules + */ +public class ModuleDescriptorHashCodeTest { + + /** + * Verifies that the ModuleDescriptor.hashCode() returned by a boot layer module is + * the same as that returned by a ModuleDescriptor constructed from the ModuleDescriptor.Builder + * for the same module. + */ + @Test + public void testBootModuleDescriptor() throws Exception { + Set bootModules = ModuleLayer.boot().modules(); + for (Module bootModule : bootModules) { + System.out.println("Testing module descriptor of boot module " + bootModule); + ModuleDescriptor bootMD = bootModule.getDescriptor(); + ModuleDescriptor mdFromBuilder = fromModuleInfoClass(bootModule); + // verify that this object is indeed a different object instance than the boot module descriptor + // to prevent any artificial passing of the test + assertNotSame(mdFromBuilder, bootMD, "ModuleDescriptor loaded from boot layer and " + + "one created from module-info.class unexpectedly returned the same instance"); + assertEquals(mdFromBuilder.hashCode(), bootMD.hashCode(), + "Unexpected ModuleDescriptor.hashCode() for " + mdFromBuilder); + assertEquals(mdFromBuilder.compareTo(bootMD), 0, + "Unexpected ModuleDescriptor.compareTo() for " + mdFromBuilder); + } + } + + // Returns a ModuleDescriptor parsed out of the module-info.class of the passed Module + private static ModuleDescriptor fromModuleInfoClass(Module module) throws IOException { + try (InputStream moduleInfo = module.getResourceAsStream("module-info.class")) { + if (moduleInfo == null) { + throw new RuntimeException("Could not locate module-info.class in " + module); + } + // internally calls ModuleDescriptor.Builder + return ModuleDescriptor.read(moduleInfo); + } + } +} -- GitLab From 8e17ce00316a765bbedefc34dc5898ba4f3f2144 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Fri, 5 Nov 2021 04:37:01 +0000 Subject: [PATCH 209/890] 8275185: Remove dead code and clean up jvmstat LocalVmManager Reviewed-by: cjplummer, redestad, kevinw --- .../protocol/local/LocalVmManager.java | 135 ++++-------- .../monitor/protocol/local/PerfDataFile.java | 193 +----------------- 2 files changed, 41 insertions(+), 287 deletions(-) diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java index e6d10c871bc..90837d97984 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java @@ -35,101 +35,65 @@ import java.io.*; * Class for managing the LocalMonitoredVm instances on the local system. *

    * This class is responsible for the mechanism that detects the active - * HotSpot Java Virtual Machines on the local host and possibly for a - * specific user. The ability to detect all possible HotSpot Java Virtual + * HotSpot Java Virtual Machines on the local host that can be accessed + * by the current user. The ability to detect all possible HotSpot Java Virtual * Machines on the local host may be limited by the permissions of the - * principal running this JVM. + * current user running this JVM. * * @author Brian Doherty * @since 1.5 */ public class LocalVmManager { - private String userName; // user name for monitored jvm - private Pattern userPattern; - private Matcher userMatcher; - private FilenameFilter userFilter; - private Pattern filePattern; - private Matcher fileMatcher; - private FilenameFilter fileFilter; - private Pattern tmpFilePattern; - private Matcher tmpFileMatcher; - private FilenameFilter tmpFileFilter; + private FilenameFilter userDirFilter; + private FilenameFilter userDirFileFilter; + private FilenameFilter oldtmpFileFilter; /** * Creates a LocalVmManager instance for the local system. *

    - * Manages LocalMonitoredVm instances for which the principal + * Manages LocalMonitoredVm instances for which the current user * has appropriate permissions. */ public LocalVmManager() { - this(null); - } - - /** - * Creates a LocalVmManager instance for the given user. - *

    - * Manages LocalMonitoredVm instances for all JVMs owned by the specified - * user. - * - * @param user the name of the user - */ - public LocalVmManager(String user) { - this.userName = user; - - if (userName == null) { - userPattern = Pattern.compile(PerfDataFile.userDirNamePattern); - userMatcher = userPattern.matcher(""); - - userFilter = new FilenameFilter() { - public boolean accept(File dir, String name) { - userMatcher.reset(name); - return userMatcher.lookingAt(); - } - }; - } - - filePattern = Pattern.compile(PerfDataFile.fileNamePattern); - fileMatcher = filePattern.matcher(""); - - fileFilter = new FilenameFilter() { + // 1.4.2 and later: The files are in {tmpdir}/hsperfdata_{any_user_name}/[0-9]+ + Pattern userDirPattern = Pattern.compile(PerfDataFile.userDirNamePattern); + userDirFilter = new FilenameFilter() { public boolean accept(File dir, String name) { - fileMatcher.reset(name); - return fileMatcher.matches(); + return userDirPattern.matcher(name).lookingAt(); } }; - tmpFilePattern = Pattern.compile(PerfDataFile.tmpFileNamePattern); - tmpFileMatcher = tmpFilePattern.matcher(""); + Pattern userDirFilePattern = Pattern.compile(PerfDataFile.fileNamePattern); + userDirFileFilter = new FilenameFilter() { + public boolean accept(File dir, String name) { + return userDirFilePattern.matcher(name).matches(); + } + }; - tmpFileFilter = new FilenameFilter() { + // 1.4.1 (or earlier?): the files are stored directly under {tmpdir}/ with + // the following pattern. + Pattern oldtmpFilePattern = Pattern.compile(PerfDataFile.tmpFileNamePattern); + oldtmpFileFilter = new FilenameFilter() { public boolean accept(File dir, String name) { - tmpFileMatcher.reset(name); - return tmpFileMatcher.matches(); + return oldtmpFilePattern.matcher(name).matches(); } }; } /** - * Return the current set of monitorable Java Virtual Machines. - *

    - * The set returned by this method depends on the user name passed - * to the constructor. If no user name was specified, then this - * method will return all candidate JVMs on the system. Otherwise, - * only the JVMs for the given user will be returned. This assumes - * that principal associated with this JVM has the appropriate - * permissions to access the target set of JVMs. + * Return the current set of monitorable Java Virtual Machines that + * are accessible by the current user. * * @return Set - the Set of monitorable Java Virtual Machines */ public synchronized Set activeVms() { /* - * This method is synchronized because the Matcher object used by - * fileFilter is not safe for concurrent use, and this method is - * called by multiple threads. Before this method was synchronized, - * we'd see strange file names being matched by the matcher. + * TODO: this method was synchronized due to its thread-unsafe use of the regexp + * Matcher objects. That is not the case anymore, but I am too afraid to change + * it now. Maybe fix this later in a separate RFE. */ Set jvmSet = new HashSet(); - List tmpdirs = PerfDataFile.getTempDirectories(userName, 0); + List tmpdirs = PerfDataFile.getTempDirectories(0); for (String dir : tmpdirs) { File tmpdir = new File(dir); @@ -137,40 +101,17 @@ public class LocalVmManager { continue; } - if (userName == null) { - /* - * get a list of all of the user temporary directories and - * iterate over the list to find any files within those directories. - */ - File[] dirs = tmpdir.listFiles(userFilter); - for (int i = 0 ; i < dirs.length; i ++) { - if (!dirs[i].isDirectory()) { - continue; - } - // get a list of files from the directory - File[] files = dirs[i].listFiles(fileFilter); - if (files != null) { - for (int j = 0; j < files.length; j++) { - if (files[j].isFile() && files[j].canRead()) { - int vmid = PerfDataFile.getLocalVmId(files[j]); - if (vmid != -1) { - jvmSet.add(vmid); - } - } - } - } + // 1.4.2 and later: Look for the files {tmpdir}/hsperfdata_{any_user_name}/[0-9]+ + // that are readable by the current user. + File[] dirs = tmpdir.listFiles(userDirFilter); + for (int i = 0 ; i < dirs.length; i ++) { + if (!dirs[i].isDirectory()) { + continue; } - } else { - /* - * Check if the user directory can be accessed. Any of these - * conditions may have asynchronously changed between subsequent - * calls to this method. - */ - - // get the list of files from the specified user directory - File[] files = tmpdir.listFiles(fileFilter); + // get a list of files from the directory + File[] files = dirs[i].listFiles(userDirFileFilter); if (files != null) { for (int j = 0; j < files.length; j++) { if (files[j].isFile() && files[j].canRead()) { @@ -183,8 +124,8 @@ public class LocalVmManager { } } - // look for any 1.4.1 files - File[] files = tmpdir.listFiles(tmpFileFilter); + // look for any 1.4.1 files that are readable by the current user. + File[] files = tmpdir.listFiles(oldtmpFileFilter); if (files != null) { for (int j = 0; j < files.length; j++) { if (files[j].isFile() && files[j].canRead()) { diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java index 3f7b5917999..7b73f37f5e9 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -84,168 +84,6 @@ public class PerfDataFile { */ private static final PlatformSupport platSupport = PlatformSupport.getInstance(); - /** - * Get a File object for the instrumentation backing store file - * for the JVM identified by the given local Vm Identifier. - *

    - * This method looks for the most up to date backing store file for - * the given {@code lvmid}. It will search all the user specific - * directories in the temporary directory for the host operating - * system, which may be influenced by platform specific environment - * variables. - * - * @param lvmid the local Java Virtual Machine Identifier for the target - * @return File - a File object to the backing store file for the named - * shared memory region of the target JVM. - * @see java.io.File - * @see #getTempDirectories() - */ - public static File getFile(int lvmid) { - if (lvmid == 0) { - /* - * lvmid == 0 is used to indicate the current Java Virtual Machine. - * If the SDK provided an API to get a unique Java Virtual Machine - * identifier, then a filename could be constructed with that - * identifier. In absence of such an api, return null. - */ - return null; - } - - List tmpDirs = getTempDirectories(null, lvmid); - File newest = null; - - for (String dir : tmpDirs) { - /* - * iterate over all files in all directories in this tmpDir that - * match the file name patterns. - */ - File tmpDir = new File(dir); - String[] files = tmpDir.list(new FilenameFilter() { - public boolean accept(File dir, String name) { - if (!name.startsWith(dirNamePrefix)) { - return false; - } - File candidate = new File(dir, name); - return ((candidate.isDirectory() || candidate.isFile()) - && candidate.canRead()); - } - }); - - long newestTime = 0; - - for (String file : files) { - File f = new File(dir + file); - File candidate = null; - - if (f.exists() && f.isDirectory()) { - /* - * found a directory matching the name patterns. This - * is a 1.4.2 hsperfdata_ directory. Check for - * file named in that directory - */ - String name = f.getAbsolutePath() + File.separator + lvmid; - candidate = new File(name); - // Try NameSpace Id if Host Id doesn't exist. - if (!candidate.exists()) { - name = f.getAbsolutePath() + File.separator + - platSupport.getNamespaceVmId(lvmid); - candidate = new File(name); - } - } else if (f.exists() && f.isFile()) { - /* - * found a file matching the name patterns. This - * is a 1.4.1 hsperfdata_ file. - */ - candidate = f; - - } else { - // unexpected - let conditional below filter this one out - candidate = f; - } - - if (candidate.exists() && candidate.isFile() - && candidate.canRead()) { - long modTime = candidate.lastModified(); - if (modTime >= newestTime) { - newestTime = modTime; - newest = candidate; - } - } - } - } - return newest; - } - - /** - * Return the File object for the backing store file for the specified Java - * Virtual Machine. - *

    - * This method looks for the most up to date backing store file for - * the JVM identified by the given user name and lvmid. The directory - * searched is the temporary directory for the host operating system, - * which may be influenced by environment variables. - * - * @param user the user name - * @param lvmid the local Java Virtual Machine Identifier for the target - * @return File - a File object to the backing store file for the named - * shared memory region of the target JVM. - * @see java.io.File - * @see #getTempDirectories() - */ - public static File getFile(String user, int lvmid) { - if (lvmid == 0) { - /* - * lvmid == 0 is used to indicate the current Java Virtual Machine. - * If the SDK provided an API to get a unique Java Virtual Machine - * identifier, then a filename could be constructed with that - * identifier. In absence of such an api, return null. - */ - return null; - } - - // first try for 1.4.2 and later JVMs - List tmpDirs = getTempDirectories(user, lvmid); - String basename; - File f; - - for (String dir : tmpDirs) { - basename = dir + lvmid; - f = new File(basename); - if (f.exists() && f.isFile() && f.canRead()) { - return f; - } - // Try NameSpace Id if Host Id doesn't exist. - basename = dir + platSupport.getNamespaceVmId(lvmid); - f = new File(basename); - if (f.exists() && f.isFile() && f.canRead()) { - return f; - } - } - - // No hit on 1.4.2 JVMs, try 1.4.1 files - long newestTime = 0; - File newest = null; - for (int i = 0; i < 2; i++) { - if (i == 0) { - basename = getTempDirectory() + Integer.toString(lvmid); - } else { - basename = getTempDirectory() + Integer.toString(lvmid) - + Integer.toString(i); - } - - f = new File(basename); - - if (f.exists() && f.isFile() && f.canRead()) { - long modTime = f.lastModified(); - if (modTime >= newestTime) { - newestTime = modTime; - newest = f; - } - } - } - return newest; - } - /** * Method to extract a local Java Virtual Machine Identifier from the * file name of the given File object. @@ -294,22 +132,6 @@ public class PerfDataFile { return PlatformSupport.getTemporaryDirectory(); } - /** - * Return the name of the temporary directory to be searched - * for HotSpot PerfData backing store files for a given user. - *

    - * This method generally returns the name of a subdirectory of - * the directory indicated in the java.io.tmpdir property. However, - * on some platforms it may return a different directory, as the - * JVM implementation may store the PerfData backing store files - * in a different directory for performance reasons. - * - * @return String - the name of the temporary directory. - */ - public static String getTempDirectory(String user) { - return getTempDirectory() + dirNamePrefix + user + File.separator; - } - /** * Return the names of the temporary directories being searched for * HotSpot PerfData backing store files. @@ -319,16 +141,7 @@ public class PerfDataFile { * * @return List - A List of temporary directories to search. */ - public static List getTempDirectories(String userName, int vmid) { - List list = platSupport.getTemporaryDirectories(vmid); - if (userName == null) { - return list; - } - - List nameList = list.stream() - .map(name -> name + dirNamePrefix + userName + File.separator) - .collect(Collectors.toList()); - - return nameList; + public static List getTempDirectories(int vmid) { + return platSupport.getTemporaryDirectories(vmid); } } -- GitLab From 7281861e0662e6c51507066a1f12673a236c7491 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 5 Nov 2021 05:15:53 +0000 Subject: [PATCH 210/890] 8272065: jcmd cannot rely on the old core reflection implementation which will be changed after JEP 416 Reviewed-by: mchung, coleenp, dholmes --- .../classfile/classLoaderHierarchyDCmd.cpp | 11 +- src/hotspot/share/memory/heapInspection.cpp | 7 - .../printMetaspaceInfoKlassClosure.cpp | 8 - .../reflectionAccessorImplKlassHelper.cpp | 165 ------------------ .../reflectionAccessorImplKlassHelper.hpp | 74 -------- .../dcmd/vm/ClassLoaderHierarchyTest.java | 4 - .../dcmd/vm/ClassLoaderStatsTest.java | 1 - .../dcmd/vm/ShowReflectionTargetTest.java | 99 ----------- 8 files changed, 1 insertion(+), 368 deletions(-) delete mode 100644 src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp delete mode 100644 src/hotspot/share/oops/reflectionAccessorImplKlassHelper.hpp delete mode 100644 test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java diff --git a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp index d9081dc13ff..161ae91880c 100644 --- a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp +++ b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp @@ -31,7 +31,6 @@ #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "runtime/safepoint.hpp" -#include "oops/reflectionAccessorImplKlassHelper.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" @@ -172,7 +171,7 @@ class LoaderTreeNode : public ResourceObj { branchtracker.print(st); - // e.g. "+--- jdk.internal.reflect.DelegatingClassLoader" + // e.g. +-- "app", jdk.internal.loader.ClassLoaders$AppClassLoader st->print("+%.*s", BranchTracker::twig_len, "----------"); if (_cld->is_the_null_class_loader_data()) { st->print(" "); @@ -232,14 +231,6 @@ class LoaderTreeNode : public ResourceObj { st->print("%*s ", indentation, ""); } st->print("%s", lci->_klass->external_name()); - - // Special treatment for generated core reflection accessor classes: print invocation target. - if (ReflectionAccessorImplKlassHelper::is_generated_accessor(lci->_klass)) { - st->print(" (invokes: "); - ReflectionAccessorImplKlassHelper::print_invocation_target(st, lci->_klass); - st->print(")"); - } - st->cr(); } branchtracker.print(st); diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp index b024de61589..b4dd596b50f 100644 --- a/src/hotspot/share/memory/heapInspection.cpp +++ b/src/hotspot/share/memory/heapInspection.cpp @@ -34,7 +34,6 @@ #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" -#include "oops/reflectionAccessorImplKlassHelper.hpp" #include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "services/memTracker.hpp" @@ -474,12 +473,6 @@ void KlassHierarchy::print_class(outputStream* st, KlassInfoEntry* cie, bool pri if (klass->is_interface()) { st->print(" (intf)"); } - // Special treatment for generated core reflection accessor classes: print invocation target. - if (ReflectionAccessorImplKlassHelper::is_generated_accessor(klass)) { - st->print(" (invokes: "); - ReflectionAccessorImplKlassHelper::print_invocation_target(st, klass); - st->print(")"); - } st->print("\n"); // Print any interfaces the class has. diff --git a/src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp b/src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp index f852a5782ef..ce975d673f1 100644 --- a/src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp +++ b/src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp @@ -26,7 +26,6 @@ #include "memory/metaspace/printMetaspaceInfoKlassClosure.hpp" #include "memory/resourceArea.hpp" #include "oops/klass.hpp" -#include "oops/reflectionAccessorImplKlassHelper.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" @@ -46,13 +45,6 @@ void PrintMetaspaceInfoKlassClosure::do_klass(Klass* k) { ResourceMark rm; _out->print(" %s", k->external_name()); - - // Special treatment for generated core reflection accessor classes: print invocation target. - if (ReflectionAccessorImplKlassHelper::is_generated_accessor(k)) { - _out->print(" (invokes: "); - ReflectionAccessorImplKlassHelper::print_invocation_target(_out, k); - _out->print(")"); - } } } // namespace metaspace diff --git a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp b/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp deleted file mode 100644 index 64e4e392086..00000000000 --- a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018 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. - * - */ - -#include "precompiled.hpp" -#include "classfile/vmClasses.hpp" -#include "memory/resourceArea.hpp" -#include "oops/instanceKlass.hpp" -#include "oops/constantPool.hpp" -#include "oops/reflectionAccessorImplKlassHelper.hpp" -#include "utilities/constantTag.hpp" -#include "utilities/debug.hpp" -#include "utilities/globalDefinitions.hpp" - -// This code extracts name of target class, method and signature from the constant pool of a class -// assumed to be of type jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX. -// Since this may be affected by bitrot if these classes change, extra care is taken to make the -// release build of this coding robust. - -// We extract target class name, method name and sig from the constant pool of the Accessor class. -// This is an excerpt of the Constant pool (see jdk/internal/reflect/MethodAccessorGenerator.java:) - -// (^ = Only present if generating SerializationConstructorAccessor) -// 1 [UTF-8] [This class's name] -// 2 [CONSTANT_Class_info] for above -// 3 [UTF-8] "jdk/internal/reflect/{MethodAccessorImpl,ConstructorAccessorImpl,SerializationConstructorAccessorImpl}" -// 4 [CONSTANT_Class_info] for above -// 5 [UTF-8] [Target class's name] -// 6 [CONSTANT_Class_info] for above -// 7^ [UTF-8] [Serialization: Class's name in which to invoke constructor] -// 8^ [CONSTANT_Class_info] for above -// 9 [UTF-8] target method or constructor name -// 10 [UTF-8] target method or constructor signature - -// Note that these strings are found at slightly different slots depending on the class type: -// - MethodAccessorImpl, ConstructoreAccessorImpl: slots 5, 7 and 8. -// - SerializationConstructorAccessorImpl: slots 5, 9 and 10. -// Unfortunately SerializationConstructorAccessorImpl is a child of ConstructoreAccessorImpl and there -// is no easy way to tell them apart. So we examine parent class name. - -enum cpi_slots { - cpi_slot_parent_class_name = 3, - cpi_slot_target_class_name = 5, - cpi_slot_target_method_name = 7, - cpi_slot_target_method_name_sca = 9, // SerializationConstructorAccessor case, see above - cpi_slot_target_method_sig = 8, - cpi_slot_target_method_sig_sca = 10 // SerializationConstructorAccessor case, see above -}; - -// Returns a string, resource-area allocated, from an UTF8 slot in the constant pool in the -// given Klass*. -static const char* get_string_from_cp_with_checks(const InstanceKlass* k, int cpi) { - const char* s = NULL; - const ConstantPool* const cp = k->constants(); - - assert(cp != NULL, "No cp?"); - assert(cp->is_within_bounds(cpi), "Unexpected constant pool layout for \"%s\", child class of Generated{Method|Constructor}AccessorImplXXX" - " (cpi %d out of bounds for [0..%d)).", k->external_name(), cpi, cp->length()); - assert(cp->tag_at(cpi).is_utf8(), "Unexpected constant pool layout for \"%s\", child class of Generated{Method|Constructor}AccessorImplXXX" - " (no UTF8 at cpi %d (%u)).", k->external_name(), cpi, cp->tag_at(cpi).value()); - - // Be nice in release: lets not crash, just return NULL. - if (cp != NULL && cp->is_within_bounds(cpi) && cp->tag_at(cpi).is_utf8()) { - s = cp->symbol_at(cpi)->as_C_string(); - } - - return s; -} - -// helper, returns true if class name of given class matches a given prefix -static bool classname_matches_prefix(const Klass* k, const char* prefix) { - const char* classname = k->external_name(); - if (classname != NULL) { - if (::strncmp(classname, prefix, strlen(prefix)) == 0) { - return true; - } - } - return false; -} - -// Returns true if k is of type jdk/internal/reflect/GeneratedMethodAccessorXXX. -bool ReflectionAccessorImplKlassHelper::is_generated_method_accessor(const InstanceKlass* k) { - return k->super() == vmClasses::reflect_MethodAccessorImpl_klass() && - classname_matches_prefix(k, "jdk.internal.reflect.GeneratedMethodAccessor"); -} - -// Returns true if k is of type jdk/internal/reflect/GeneratedConstructorAccessorXXX. -bool ReflectionAccessorImplKlassHelper::is_generated_constructor_accessor(const InstanceKlass* k) { - return k->super() == vmClasses::reflect_ConstructorAccessorImpl_klass() && - classname_matches_prefix(k, "jdk.internal.reflect.GeneratedConstructorAccessor"); -} - -// Returns true if k is of type jdk/internal/reflect/GeneratedSerializationConstructorAccessorXXX. -bool ReflectionAccessorImplKlassHelper::is_generated_method_serialization_constructor_accessor(const InstanceKlass* k) { - // GeneratedSerializationConstructorAccessor is not a direct subclass of ConstructorAccessorImpl - const Klass* sk = k->super(); - if (sk != NULL && sk->super() == vmClasses::reflect_ConstructorAccessorImpl_klass() && - classname_matches_prefix(k, "jdk.internal.reflect.GeneratedSerializationConstructorAccessor")) { - return true; - } - return false; -} - -const char* ReflectionAccessorImplKlassHelper::get_target_class_name(const InstanceKlass* k) { - return get_string_from_cp_with_checks(k, cpi_slot_target_class_name); -} - -const char* ReflectionAccessorImplKlassHelper::get_target_method_name(const InstanceKlass* k) { - const int target_method_name_cpi = - is_generated_method_serialization_constructor_accessor(k) ? cpi_slot_target_method_name_sca : cpi_slot_target_method_name; - return get_string_from_cp_with_checks(k, target_method_name_cpi); -} - -const char* ReflectionAccessorImplKlassHelper::get_target_method_signature(const InstanceKlass* k) { - const int target_method_name_cpi = - is_generated_method_serialization_constructor_accessor(k) ? cpi_slot_target_method_sig_sca : cpi_slot_target_method_sig; - return get_string_from_cp_with_checks(k, target_method_name_cpi); -} - -// Returns true if this is either one of jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX -// and it is safe to call print_invocation_target(k) -bool ReflectionAccessorImplKlassHelper::is_generated_accessor(const Klass* k) { - if (k != NULL && k->is_instance_klass()) { - const InstanceKlass* ik = InstanceKlass::cast(k); - if (ik->is_initialized()) { - return is_generated_method_accessor(ik) || - is_generated_constructor_accessor(ik) || - is_generated_method_serialization_constructor_accessor(ik); - } - } - return false; -} -void ReflectionAccessorImplKlassHelper::print_invocation_target(outputStream* out, Klass* k) { - assert(ReflectionAccessorImplKlassHelper::is_generated_accessor(k), "Invariant"); - InstanceKlass* ik = InstanceKlass::cast(k); - ResourceMark rm; - const char* target_class_name = ReflectionAccessorImplKlassHelper::get_target_class_name(ik); - const char* target_method_name = ReflectionAccessorImplKlassHelper::get_target_method_name(ik); - const char* target_method_signature = ReflectionAccessorImplKlassHelper::get_target_method_signature(ik); - out->print("%s::%s %s", - target_class_name != NULL ? target_class_name : "?", - target_method_name != NULL ? target_method_name : "?", - target_method_signature != NULL ? target_method_signature : "?"); -} diff --git a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.hpp b/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.hpp deleted file mode 100644 index 83725f6dd78..00000000000 --- a/src/hotspot/share/oops/reflectionAccessorImplKlassHelper.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018 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. - * - */ - -#ifndef SHARE_OOPS_REFLECTIONACCESSORIMPLKLASSHELPER_HPP -#define SHARE_OOPS_REFLECTIONACCESSORIMPLKLASSHELPER_HPP - -#include "memory/allocation.hpp" - -class InstanceKlass; - -// Helper for classes derived from jdk/internal/reflect/{Method|Constructor}AccessorImpl: -// offers convenience functions to extract the names of target class/method/signature -// from the constant pool of these classes. -class ReflectionAccessorImplKlassHelper: public AllStatic { - - // Returns true if k is of type jdk/internal/reflect/GeneratedMethodAccessorXXX. - static bool is_generated_method_accessor(const InstanceKlass* k); - - // Returns true if k is of type jdk/internal/reflect/GeneratedConstructorAccessorXXX. - static bool is_generated_constructor_accessor(const InstanceKlass* k); - - // Returns true if k is of type jdk/internal/reflect/GeneratedSerializationConstructorAccessorXXX. - static bool is_generated_method_serialization_constructor_accessor(const InstanceKlass* k); - - // Assuming k is of type jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX, - // the name of the target class as resource-area allocated string. - static const char* get_target_class_name(const InstanceKlass* k); - - // Assuming k is of type jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX, - // the name of the target method as resource-area allocated string. - static const char* get_target_method_name(const InstanceKlass* k); - - // Assuming k is of type jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX, - // the signature of the target method as resource-area allocated string. - static const char* get_target_method_signature(const InstanceKlass* k); - -public: - - // Returns true if k is of type jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX - // and it is safe to call print_invocation_target(k) - static bool is_generated_accessor(const Klass* k); - - // Assuming k is of type jdk/internal/reflect/Generated{SerializationConstructor|Constructor|Method}AccessorXXX, - // print out target class, method, signature in one line. - static void print_invocation_target(outputStream* out, Klass* k); - -}; - - - - -#endif // SHARE_OOPS_REFLECTIONACCESSORIMPLKLASSHELPER_HPP diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java index e3f1a8d9150..b6fcff7f86d 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java @@ -53,10 +53,6 @@ public class ClassLoaderHierarchyTest { // | | // | +-- "app", jdk.internal.loader.ClassLoaders$AppClassLoader // | -// +-- jdk.internal.reflect.DelegatingClassLoader -// | -// +-- "Kevin", ClassLoaderHierarchyTest$TestClassLoader -// | // +-- ClassLoaderHierarchyTest$TestClassLoader // | // +-- "Bill", ClassLoaderHierarchyTest$TestClassLoader diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderStatsTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderStatsTest.java index 8d3a1fe6de4..067158cdea6 100644 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderStatsTest.java +++ b/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderStatsTest.java @@ -62,7 +62,6 @@ public class ClassLoaderStatsTest { // 1 256 131 + hidden classes // 0x0000000000000000 0x0000000000000000 0x00007f00e852d190 1607 4628480 3931216 // 38 124928 85856 + hidden classes - // 0x00000008003b5508 0x0000000000000000 0x00007f001c2d4760 1 6144 4040 jdk.internal.reflect.DelegatingClassLoader // 0x000000080037f468 0x000000080037ee80 0x00007f00e868e3f0 228 1368064 1286672 jdk.internal.loader.ClassLoaders$AppClassLoader // ... diff --git a/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java b/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java deleted file mode 100644 index a6e3fce1d24..00000000000 --- a/test/hotspot/jtreg/serviceability/dcmd/vm/ShowReflectionTargetTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2018 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. - */ - -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -import org.testng.Assert; -import org.testng.annotations.Test; - -import jdk.test.lib.dcmd.CommandExecutor; -import jdk.test.lib.dcmd.JMXExecutor; -import jdk.test.lib.process.OutputAnalyzer; - -/* - * @test - * @summary Test that various diagnostic commands which can show core reflection - * invocation targets do so correctly (See: JDK-8203343). - * @library /test/lib - * @run testng/othervm -Dsun.reflect.noInflation=true -Djdk.reflect.useDirectMethodHandle=false ShowReflectionTargetTest - * @author stuefe - */ - -public class ShowReflectionTargetTest { - - @SuppressWarnings("unused") - private static class Dummy { - int _i; - public Dummy(int i) { _i = i; } - public int get_i() { return _i; } - } - - public void run(CommandExecutor executor) throws Exception { - // Do some reflection; since we set -Dsun.reflect.noInflation=true, this should - // immediately generate Generated{Method|Constructor}Accessor objects. - Class c = Class.forName("ShowReflectionTargetTest$Dummy"); - Constructor ctor = c.getConstructor(int.class); - Method m = c.getMethod("get_i"); - - Object o = ctor.newInstance(17); - int j = ((Integer)m.invoke(o)).intValue(); - Assert.assertEquals(j, 17); - - // Now invoke VM.class_hierarchy and check its output. - // Should show reflection targets, e.g.: - // .... - // |--jdk.internal.reflect.MagicAccessorImpl/null - // | |--jdk.internal.reflect.FieldAccessorImpl/null - // | | |--jdk.internal.reflect.UnsafeFieldAccessorImpl/null - // | | | |--jdk.internal.reflect.UnsafeStaticFieldAccessorImpl/null - // | | | | |--jdk.internal.reflect.UnsafeQualifiedStaticFieldAccessorImpl/null - // | | | | | |--jdk.internal.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl/null - // | |--jdk.internal.reflect.ConstructorAccessorImpl/null - // | | |--jdk.internal.reflect.DelegatingConstructorAccessorImpl/null - // | | |--jdk.internal.reflect.NativeConstructorAccessorImpl/null - // > | | |--jdk.internal.reflect.GeneratedConstructorAccessor1/0x00007f75f04889b0 (invokes: java/lang/management/ManagementPermission:: (Ljava/lang/String;)V) - // > | | |--jdk.internal.reflect.GeneratedConstructorAccessor2/0x00007f75f0494990 (invokes: ShowReflectionTargetTest$Dummy:: (I)V) - // | | |--jdk.internal.reflect.BootstrapConstructorAccessorImpl/null - // | |--jdk.internal.reflect.MethodAccessorImpl/null - // > | | |--jdk.internal.reflect.GeneratedMethodAccessor1/0x00007f75f0494450 (invokes: ShowReflectionTargetTest$Dummy::get_i ()I) - // | | |--jdk.internal.reflect.DelegatingMethodAccessorImpl/null - // ... - - OutputAnalyzer output = executor.execute("VM.class_hierarchy"); - - output.shouldMatch(".*jdk.internal.reflect.GeneratedConstructorAccessor.*invokes.*ShowReflectionTargetTest\\$Dummy::.*"); - output.shouldMatch(".*jdk.internal.reflect.GeneratedMethodAccessor.*invokes.*ShowReflectionTargetTest\\$Dummy::get_i.*"); - - } - - @Test - public void jmx() throws Exception { - run(new JMXExecutor()); - } - -} - - - -- GitLab From 96c396b701e290fc3e1124b1c862b41e02e9c1d9 Mon Sep 17 00:00:00 2001 From: Ningsheng Jian Date: Fri, 5 Nov 2021 07:45:54 +0000 Subject: [PATCH 211/890] 8276151: AArch64: Incorrect result for double to int vector conversion Reviewed-by: aph, psandoz --- src/hotspot/cpu/aarch64/aarch64_neon.ad | 21 ++++-- src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 | 46 +++++++++---- .../vectorapi/VectorCastShape128Test.java | 69 +++++++++++++++++-- .../vectorapi/VectorCastShape64Test.java | 68 ++++++++++++++++-- 4 files changed, 172 insertions(+), 32 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64_neon.ad b/src/hotspot/cpu/aarch64/aarch64_neon.ad index 0b59686238a..b3cb6f5f255 100644 --- a/src/hotspot/cpu/aarch64/aarch64_neon.ad +++ b/src/hotspot/cpu/aarch64/aarch64_neon.ad @@ -506,12 +506,21 @@ instruct vcvt2Dto2I(vecD dst, vecX src) %{ predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); match(Set dst (VectorCastD2X src)); - format %{ "fcvtzs $dst, T2D, $src\n\t" - "xtn $dst, T2S, $dst, T2D\t# convert 2D to 2I vector" - %} - ins_encode %{ - __ fcvtzs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); - __ xtn(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($dst$$reg), __ T2D); + effect(TEMP_DEF dst); + format %{ "ins $dst, D, $src, 0, 1\n\t" + "fcvtzdw rscratch1, $src\n\t" + "fcvtzdw rscratch2, $dst\n\t" + "fmovs $dst, rscratch1\n\t" + "mov $dst, T2S, 1, rscratch2\t#convert 2D to 2I vector" + %} + ins_encode %{ + __ ins(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg), 0, 1); + // We can't use fcvtzs(vector, integer) instruction here because we need + // saturation arithmetic. See JDK-8276151. + __ fcvtzdw(rscratch1, as_FloatRegister($src$$reg)); + __ fcvtzdw(rscratch2, as_FloatRegister($dst$$reg)); + __ fmovs(as_FloatRegister($dst$$reg), rscratch1); + __ mov(as_FloatRegister($dst$$reg), __ T2S, 1, rscratch2); %} ins_pipe(pipe_slow); %} diff --git a/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 index 4d947b8141c..ded6d0fd6d2 100644 --- a/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_neon_ad.m4 @@ -272,25 +272,43 @@ dnl $1 $2 $3 $4 $5 VECTOR_CAST_F2I(2, F, I, D, 2S) VECTOR_CAST_F2I(4, F, I, X, 4S) VECTOR_CAST_F2I(2, D, L, X, 2D) -dnl -define(`VECTOR_CAST_F2I_L', ` -instruct vcvt$1$2to$1$3`'(vec$4 dst, vec$5 src) + +instruct vcvt4Fto4S(vecD dst, vecX src) %{ - predicate(n->as_Vector()->length() == $1 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($3)); - match(Set dst (VectorCast$2`'2X src)); - format %{ "fcvtzs $dst, T$6, $src\n\t" - "xtn $dst, T$7, $dst, T$6\t# convert $1$2 to $1$3 vector" + predicate(n->as_Vector()->length() == 4 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + match(Set dst (VectorCastF2X src)); + format %{ "fcvtzs $dst, T4S, $src\n\t" + "xtn $dst, T4H, $dst, T4S\t# convert 4F to 4S vector" %} ins_encode %{ - __ fcvtzs(as_FloatRegister($dst$$reg), __ T$6, as_FloatRegister($src$$reg)); - __ xtn(as_FloatRegister($dst$$reg), __ T$7, as_FloatRegister($dst$$reg), __ T$6); + __ fcvtzs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); + __ xtn(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($dst$$reg), __ T4S); %} ins_pipe(pipe_slow); -%}')dnl -dnl $1 $2 $3 $4 $5 $6 $7 -VECTOR_CAST_F2I_L(4, F, S, D, X, 4S, 4H) -VECTOR_CAST_F2I_L(2, D, I, D, X, 2D, 2S) -dnl +%} + +instruct vcvt2Dto2I(vecD dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 2 && n->bottom_type()->is_vect()->element_basic_type() == T_INT); + match(Set dst (VectorCastD2X src)); + effect(TEMP_DEF dst); + format %{ "ins $dst, D, $src, 0, 1\n\t" + "fcvtzdw rscratch1, $src\n\t" + "fcvtzdw rscratch2, $dst\n\t" + "fmovs $dst, rscratch1\n\t" + "mov $dst, T2S, 1, rscratch2\t#convert 2D to 2I vector" + %} + ins_encode %{ + __ ins(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg), 0, 1); + // We can't use fcvtzs(vector, integer) instruction here because we need + // saturation arithmetic. See JDK-8276151. + __ fcvtzdw(rscratch1, as_FloatRegister($src$$reg)); + __ fcvtzdw(rscratch2, as_FloatRegister($dst$$reg)); + __ fmovs(as_FloatRegister($dst$$reg), rscratch1); + __ mov(as_FloatRegister($dst$$reg), __ T2S, 1, rscratch2); + %} + ins_pipe(pipe_slow); +%} instruct vcvt4Fto4B(vecD dst, vecX src) %{ diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape128Test.java b/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape128Test.java index dc4eedea3a1..5feef36e531 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape128Test.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape128Test.java @@ -24,6 +24,7 @@ package compiler.vectorapi; import java.util.Random; +import jdk.test.lib.Utils; import jdk.incubator.vector.ByteVector; import jdk.incubator.vector.DoubleVector; @@ -39,9 +40,11 @@ import org.testng.annotations.Test; /** * @test * @bug 8268966 + * @key randomness * @summary AArch64: 'bad AD file' in some vector conversion tests + * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm -XX:-TieredCompilation compiler.vectorapi.VectorCastShape128Test + * @run testng/othervm -XX:-TieredCompilation -XX:CompileThreshold=100 compiler.vectorapi.VectorCastShape128Test */ @@ -54,8 +57,8 @@ public class VectorCastShape128Test { private static final VectorSpecies fspec = FloatVector.SPECIES_128; private static final VectorSpecies dspec = DoubleVector.SPECIES_128; - private static final int NUM_ITER = 50000; - private static final int LENGTH = 512; + private static final int NUM_ITER = 10000; + private static final int LENGTH = 1024; private static int[] ia; private static int[] ib; private static byte[] ba; @@ -69,6 +72,51 @@ public class VectorCastShape128Test { private static float[] fa; private static float[] fb; + public static float [] fspecial = { + 0.0f, + -0.0f, + Float.MAX_VALUE, + Float.MIN_VALUE, + -Float.MAX_VALUE, + -Float.MIN_VALUE, + Float.NaN, + Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY, + Integer.MAX_VALUE, + Integer.MIN_VALUE, + Long.MAX_VALUE, + Long.MIN_VALUE, + }; + + public static double [] dspecial = { + 0.0, + -0.0, + Double.MAX_VALUE, + Double.MIN_VALUE, + -Double.MAX_VALUE, + -Double.MIN_VALUE, + Double.NaN, + Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY, + Integer.MAX_VALUE, + Integer.MIN_VALUE, + Long.MIN_VALUE, + Long.MAX_VALUE, + }; + + public static int [] ispecial = { + 0, + Integer.MAX_VALUE, + Integer.MIN_VALUE, + }; + + public static long [] lspecial = { + 0, + Long.MAX_VALUE, + Long.MIN_VALUE, + }; + + private static void initialize() { ia = new int[LENGTH]; ib = new int[LENGTH]; @@ -82,14 +130,23 @@ public class VectorCastShape128Test { fb = new float[LENGTH]; da = new double[LENGTH]; db = new double[LENGTH]; - Random r = new Random(); + Random r = Utils.getRandomInstance(); for (int i = 0; i < LENGTH; i++) { ia[i] = r.nextInt(); la[i] = r.nextLong(); sa[i] = (short) r.nextInt(); ba[i] = (byte) r.nextInt(); - fa[i] = r.nextFloat(); - da[i] = r.nextDouble(); + fa[i] = ia[i] + r.nextFloat(); + da[i] = la[i] + r.nextDouble(); + } + + // Replicate to make sure the values get tested, as some elements may be + // ignored for some vector conversions. + for (int i = 0; i < 4; i++) { + System.arraycopy(ispecial, 0, ia, ispecial.length * i, ispecial.length); + System.arraycopy(lspecial, 0, la, lspecial.length * i, lspecial.length); + System.arraycopy(fspecial, 0, fa, fspecial.length * i, fspecial.length); + System.arraycopy(dspecial, 0, da, dspecial.length * i, dspecial.length); } } diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape64Test.java b/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape64Test.java index 835573010ba..98f2d64f350 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape64Test.java +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorCastShape64Test.java @@ -24,6 +24,7 @@ package compiler.vectorapi; import java.util.Random; +import jdk.test.lib.Utils; import jdk.incubator.vector.ByteVector; import jdk.incubator.vector.DoubleVector; @@ -39,9 +40,11 @@ import org.testng.annotations.Test; /** * @test * @bug 8268966 + * @key randomness * @summary AArch64: 'bad AD file' in some vector conversion tests + * @library /test/lib * @modules jdk.incubator.vector - * @run testng/othervm -XX:-TieredCompilation compiler.vectorapi.VectorCastShape64Test + * @run testng/othervm -XX:-TieredCompilation -XX:CompileThreshold=100 compiler.vectorapi.VectorCastShape64Test */ @@ -54,8 +57,8 @@ public class VectorCastShape64Test { private static final VectorSpecies fspec = FloatVector.SPECIES_64; private static final VectorSpecies dspec = DoubleVector.SPECIES_64; - private static final int NUM_ITER = 50000; - private static final int LENGTH = 512; + private static final int NUM_ITER = 10000; + private static final int LENGTH = 1024; private static int[] ia; private static int[] ib; private static byte[] ba; @@ -69,6 +72,50 @@ public class VectorCastShape64Test { private static float[] fa; private static float[] fb; + public static float [] fspecial = { + 0.0f, + -0.0f, + Float.MAX_VALUE, + Float.MIN_VALUE, + -Float.MAX_VALUE, + -Float.MIN_VALUE, + Float.NaN, + Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY, + Integer.MAX_VALUE, + Integer.MIN_VALUE, + Long.MAX_VALUE, + Long.MIN_VALUE, + }; + + public static double [] dspecial = { + 0.0, + -0.0, + Double.MAX_VALUE, + Double.MIN_VALUE, + -Double.MAX_VALUE, + -Double.MIN_VALUE, + Double.NaN, + Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY, + Integer.MAX_VALUE, + Integer.MIN_VALUE, + Long.MIN_VALUE, + Long.MAX_VALUE, + }; + + public static int [] ispecial = { + 0, + Integer.MAX_VALUE, + Integer.MIN_VALUE, + }; + + public static long [] lspecial = { + 0, + Long.MAX_VALUE, + Long.MIN_VALUE, + }; + private static void initialize() { ia = new int[LENGTH]; ib = new int[LENGTH]; @@ -82,14 +129,23 @@ public class VectorCastShape64Test { fb = new float[LENGTH]; da = new double[LENGTH]; db = new double[LENGTH]; - Random r = new Random(); + Random r = Utils.getRandomInstance(); for (int i = 0; i < LENGTH; i++) { ia[i] = r.nextInt(); la[i] = r.nextLong(); sa[i] = (short) r.nextInt(); ba[i] = (byte) r.nextInt(); - fa[i] = r.nextFloat(); - da[i] = r.nextDouble(); + fa[i] = ia[i] + r.nextFloat(); + da[i] = la[i] + r.nextDouble(); + } + + // Replicate to make sure the values get tested, as some elements may be + // ignored for some vector conversions. + for (int i = 0; i < 4; i++) { + System.arraycopy(ispecial, 0, ia, ispecial.length * i, ispecial.length); + System.arraycopy(lspecial, 0, la, lspecial.length * i, lspecial.length); + System.arraycopy(fspecial, 0, fa, fspecial.length * i, fspecial.length); + System.arraycopy(dspecial, 0, da, dspecial.length * i, dspecial.length); } } -- GitLab From 323d2017959dc96d25eaa1aad6404586099c237e Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Fri, 5 Nov 2021 09:25:21 +0000 Subject: [PATCH 212/890] 8275506: Rename allocated_on_stack to allocated_on_stack_or_embedded Reviewed-by: stuefe --- src/hotspot/share/asm/codeBuffer.cpp | 2 +- src/hotspot/share/classfile/classFileParser.cpp | 2 +- src/hotspot/share/memory/allocation.cpp | 6 +++--- src/hotspot/share/memory/allocation.hpp | 2 +- src/hotspot/share/utilities/growableArray.cpp | 4 ++-- .../gtest/utilities/test_growableArray.cpp | 16 ++++++++-------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/hotspot/share/asm/codeBuffer.cpp b/src/hotspot/share/asm/codeBuffer.cpp index e8919b6ab38..3659865d86a 100644 --- a/src/hotspot/share/asm/codeBuffer.cpp +++ b/src/hotspot/share/asm/codeBuffer.cpp @@ -140,7 +140,7 @@ CodeBuffer::~CodeBuffer() { NOT_PRODUCT(clear_strings()); - assert(_default_oop_recorder.allocated_on_stack(), "should be embedded object"); + assert(_default_oop_recorder.allocated_on_stack_or_embedded(), "should be embedded object"); } void CodeBuffer::initialize_oop_recorder(OopRecorder* r) { diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index 8827f0542b5..a7ae7bef5c3 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -161,7 +161,7 @@ void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const s const ClassFileStream cfs1 = *stream; const ClassFileStream* const cfs = &cfs1; - assert(cfs->allocated_on_stack(), "should be local"); + assert(cfs->allocated_on_stack_or_embedded(), "should be local"); debug_only(const u1* const old_current = stream->current();) // Used for batching symbol allocations. diff --git a/src/hotspot/share/memory/allocation.cpp b/src/hotspot/share/memory/allocation.cpp index 54c1d97f0e7..ca1c0a45183 100644 --- a/src/hotspot/share/memory/allocation.cpp +++ b/src/hotspot/share/memory/allocation.cpp @@ -191,7 +191,7 @@ void ResourceObj::initialize_allocation_info() { // Operator new() is not called for allocations // on stack and for embedded objects. set_allocation_type((address)this, STACK_OR_EMBEDDED); - } else if (allocated_on_stack()) { // STACK_OR_EMBEDDED + } else if (allocated_on_stack_or_embedded()) { // STACK_OR_EMBEDDED // For some reason we got a value which resembles // an embedded or stack object (operator new() does not // set such type). Keep it since it is valid value @@ -199,7 +199,7 @@ void ResourceObj::initialize_allocation_info() { // Ignore garbage in other fields. } else if (is_type_set()) { // Operator new() was called and type was set. - assert(!allocated_on_stack(), + assert(!allocated_on_stack_or_embedded(), "not embedded or stack, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]); } else { @@ -220,7 +220,7 @@ ResourceObj::ResourceObj(const ResourceObj&) { } ResourceObj& ResourceObj::operator=(const ResourceObj& r) { - assert(allocated_on_stack(), + assert(allocated_on_stack_or_embedded(), "copy only into local, this(" PTR_FORMAT ") type %d a[0]=(" PTR_FORMAT ") a[1]=(" PTR_FORMAT ")", p2i(this), get_allocation_type(), _allocation_t[0], _allocation_t[1]); // Keep current _allocation_t value; diff --git a/src/hotspot/share/memory/allocation.hpp b/src/hotspot/share/memory/allocation.hpp index 8c1597befde..0562a44063d 100644 --- a/src/hotspot/share/memory/allocation.hpp +++ b/src/hotspot/share/memory/allocation.hpp @@ -408,7 +408,7 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC { void initialize_allocation_info(); public: allocation_type get_allocation_type() const; - bool allocated_on_stack() const { return get_allocation_type() == STACK_OR_EMBEDDED; } + bool allocated_on_stack_or_embedded() const { return get_allocation_type() == STACK_OR_EMBEDDED; } bool allocated_on_res_area() const { return get_allocation_type() == RESOURCE_AREA; } bool allocated_on_C_heap() const { return get_allocation_type() == C_HEAP; } bool allocated_on_arena() const { return get_allocation_type() == ARENA; } diff --git a/src/hotspot/share/utilities/growableArray.cpp b/src/hotspot/share/utilities/growableArray.cpp index fc0ab6e117e..adc45f4d845 100644 --- a/src/hotspot/share/utilities/growableArray.cpp +++ b/src/hotspot/share/utilities/growableArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -72,7 +72,7 @@ void GrowableArrayNestingCheck::on_stack_alloc() const { void GrowableArrayMetadata::init_checks(const GrowableArrayBase* array) const { // Stack allocated arrays support all three element allocation locations - if (array->allocated_on_stack()) { + if (array->allocated_on_stack_or_embedded()) { return; } diff --git a/test/hotspot/gtest/utilities/test_growableArray.cpp b/test/hotspot/gtest/utilities/test_growableArray.cpp index 1990b45c413..ae7c0eba030 100644 --- a/test/hotspot/gtest/utilities/test_growableArray.cpp +++ b/test/hotspot/gtest/utilities/test_growableArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -452,14 +452,14 @@ TEST_VM_F(GrowableArrayTest, where) { { ResourceMark rm; GrowableArray a(0); - ASSERT_TRUE(a.allocated_on_stack()); + ASSERT_TRUE(a.allocated_on_stack_or_embedded()); ASSERT_TRUE(elements_on_stack(&a)); } // Stack/CHeap allocated { GrowableArray a(0, mtTest); - ASSERT_TRUE(a.allocated_on_stack()); + ASSERT_TRUE(a.allocated_on_stack_or_embedded()); ASSERT_TRUE(elements_on_C_heap(&a)); } @@ -467,7 +467,7 @@ TEST_VM_F(GrowableArrayTest, where) { { Arena arena(mtTest); GrowableArray a(&arena, 0, 0, 0); - ASSERT_TRUE(a.allocated_on_stack()); + ASSERT_TRUE(a.allocated_on_stack_or_embedded()); ASSERT_TRUE(elements_on_arena(&a)); } @@ -475,14 +475,14 @@ TEST_VM_F(GrowableArrayTest, where) { { ResourceMark rm; WithEmbeddedArray w(0); - ASSERT_TRUE(w._a.allocated_on_stack()); + ASSERT_TRUE(w._a.allocated_on_stack_or_embedded()); ASSERT_TRUE(elements_on_stack(&w._a)); } // Embedded/CHeap allocated { WithEmbeddedArray w(0, mtTest); - ASSERT_TRUE(w._a.allocated_on_stack()); + ASSERT_TRUE(w._a.allocated_on_stack_or_embedded()); ASSERT_TRUE(elements_on_C_heap(&w._a)); } @@ -490,7 +490,7 @@ TEST_VM_F(GrowableArrayTest, where) { { Arena arena(mtTest); WithEmbeddedArray w(&arena, 0); - ASSERT_TRUE(w._a.allocated_on_stack()); + ASSERT_TRUE(w._a.allocated_on_stack_or_embedded()); ASSERT_TRUE(elements_on_arena(&w._a)); } } @@ -518,7 +518,7 @@ TEST(GrowableArrayCHeap, sanity) { { GrowableArrayCHeap a(0); #ifdef ASSERT - ASSERT_TRUE(a.allocated_on_stack()); + ASSERT_TRUE(a.allocated_on_stack_or_embedded()); #endif ASSERT_TRUE(a.is_empty()); -- GitLab From 3c0faa73522bd004b66cb9e477f43e15a29842e6 Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Fri, 5 Nov 2021 09:42:26 +0000 Subject: [PATCH 213/890] 8276173: Clean up and remove unneeded casts in HeapDumper Reviewed-by: coleenp, hseigel --- src/hotspot/share/services/heapDumper.cpp | 84 +++++++++++------------ 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index 348ed2c3746..a594e858447 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -51,8 +51,8 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.hpp" #include "runtime/vframe.hpp" -#include "runtime/vmThread.hpp" #include "runtime/vmOperations.hpp" +#include "runtime/vmThread.hpp" #include "services/heapDumper.hpp" #include "services/heapDumperCompression.hpp" #include "services/threadService.hpp" @@ -68,8 +68,7 @@ * * u4 size of identifiers. Identifiers are used to represent * UTF8 strings, objects, stack traces, etc. They usually - * have the same size as host pointers. For example, on - * Solaris and Win32, the size is 4. + * have the same size as host pointers. * u4 high word * u4 low word number of milliseconds since 0:00 GMT, 1/1/70 * [record]* a sequence of records. @@ -327,7 +326,7 @@ // HPROF tags -typedef enum { +enum hprofTag : u1 { // top-level records HPROF_UTF8 = 0x01, HPROF_LOAD_CLASS = 0x02, @@ -372,7 +371,7 @@ typedef enum { HPROF_GC_INSTANCE_DUMP = 0x21, HPROF_GC_OBJ_ARRAY_DUMP = 0x22, HPROF_GC_PRIM_ARRAY_DUMP = 0x23 -} hprofTag; +}; // Default stack trace ID (used for dummy HPROF_TRACE record) enum { @@ -406,7 +405,7 @@ class AbstractDumpWriter : public StackObj { void set_position(size_t pos) { _pos = pos; } // Can be called if we have enough room in the buffer. - void write_fast(void* s, size_t len); + void write_fast(const void* s, size_t len); // Returns true if we have enough room in the buffer for 'len' bytes. bool can_write_fast(size_t len); @@ -423,7 +422,7 @@ class AbstractDumpWriter : public StackObj { size_t position() const { return _pos; } // writer functions - virtual void write_raw(void* s, size_t len); + virtual void write_raw(const void* s, size_t len); void write_u1(u1 x); void write_u2(u2 x); void write_u4(u4 x); @@ -452,7 +451,7 @@ class AbstractDumpWriter : public StackObj { virtual void deactivate() = 0; }; -void AbstractDumpWriter::write_fast(void* s, size_t len) { +void AbstractDumpWriter::write_fast(const void* s, size_t len) { assert(!_in_dump_segment || (_sub_record_left >= len), "sub-record too large"); assert(buffer_size() - position() >= len, "Must fit"); debug_only(_sub_record_left -= len); @@ -465,7 +464,7 @@ bool AbstractDumpWriter::can_write_fast(size_t len) { } // write raw bytes -void AbstractDumpWriter::write_raw(void* s, size_t len) { +void AbstractDumpWriter::write_raw(const void* s, size_t len) { assert(!_in_dump_segment || (_sub_record_left >= len), "sub-record too large"); debug_only(_sub_record_left -= len); @@ -490,25 +489,25 @@ void AbstractDumpWriter::write_raw(void* s, size_t len) { else write_raw((p), (len)); } while (0) void AbstractDumpWriter::write_u1(u1 x) { - WRITE_KNOWN_TYPE((void*) &x, 1); + WRITE_KNOWN_TYPE(&x, 1); } void AbstractDumpWriter::write_u2(u2 x) { u2 v; Bytes::put_Java_u2((address)&v, x); - WRITE_KNOWN_TYPE((void*)&v, 2); + WRITE_KNOWN_TYPE(&v, 2); } void AbstractDumpWriter::write_u4(u4 x) { u4 v; Bytes::put_Java_u4((address)&v, x); - WRITE_KNOWN_TYPE((void*)&v, 4); + WRITE_KNOWN_TYPE(&v, 4); } void AbstractDumpWriter::write_u8(u8 x) { u8 v; Bytes::put_Java_u8((address)&v, x); - WRITE_KNOWN_TYPE((void*)&v, 8); + WRITE_KNOWN_TYPE(&v, 8); } void AbstractDumpWriter::write_objectID(oop o) { @@ -758,7 +757,7 @@ class ParDumpWriter : public AbstractDumpWriter { } // write raw bytes - virtual void write_raw(void* s, size_t len) { + virtual void write_raw(const void* s, size_t len) { assert(!_in_dump_segment || (_sub_record_left >= len), "sub-record too large"); debug_only(_sub_record_left -= len); assert(!_split_data, "Invalid split data"); @@ -946,7 +945,7 @@ class DumperSupport : AllStatic { // write a header of the given type void DumperSupport:: write_header(AbstractDumpWriter* writer, hprofTag tag, u4 len) { - writer->write_u1((u1)tag); + writer->write_u1(tag); writer->write_u4(0); // current ticks writer->write_u4(len); } @@ -998,33 +997,29 @@ u4 DumperSupport::sig2size(Symbol* sig) { } } +template T bit_cast(F from) { // replace with the real thing when we can use c++20 + T to; + static_assert(sizeof(to) == sizeof(from), "must be of the same size"); + memcpy(&to, &from, sizeof(to)); + return to; +} + // dump a jfloat void DumperSupport::dump_float(AbstractDumpWriter* writer, jfloat f) { if (g_isnan(f)) { - writer->write_u4(0x7fc00000); // collapsing NaNs + writer->write_u4(0x7fc00000); // collapsing NaNs } else { - union { - int i; - float f; - } u; - u.f = (float)f; - writer->write_u4((u4)u.i); + writer->write_u4(bit_cast(f)); } } // dump a jdouble void DumperSupport::dump_double(AbstractDumpWriter* writer, jdouble d) { - union { - jlong l; - double d; - } u; - if (g_isnan(d)) { // collapsing NaNs - u.l = (jlong)(0x7ff80000); - u.l = (u.l << 32); + if (g_isnan(d)) { + writer->write_u8(0x7ff80000ull << 32); // collapsing NaNs } else { - u.d = (double)d; + writer->write_u8(bit_cast(d)); } - writer->write_u8((u8)u.l); } // dumps the raw value of the given field @@ -1046,17 +1041,17 @@ void DumperSupport::dump_field_value(AbstractDumpWriter* writer, char type, oop } case JVM_SIGNATURE_BYTE : { jbyte b = obj->byte_field(offset); - writer->write_u1((u1)b); + writer->write_u1(b); break; } case JVM_SIGNATURE_CHAR : { jchar c = obj->char_field(offset); - writer->write_u2((u2)c); + writer->write_u2(c); break; } case JVM_SIGNATURE_SHORT : { jshort s = obj->short_field(offset); - writer->write_u2((u2)s); + writer->write_u2(s); break; } case JVM_SIGNATURE_FLOAT : { @@ -1071,17 +1066,17 @@ void DumperSupport::dump_field_value(AbstractDumpWriter* writer, char type, oop } case JVM_SIGNATURE_INT : { jint i = obj->int_field(offset); - writer->write_u4((u4)i); + writer->write_u4(i); break; } case JVM_SIGNATURE_LONG : { jlong l = obj->long_field(offset); - writer->write_u8((u8)l); + writer->write_u8(l); break; } case JVM_SIGNATURE_BOOLEAN : { jboolean b = obj->bool_field(offset); - writer->write_u1((u1)b); + writer->write_u1(b); break; } default : { @@ -1464,19 +1459,19 @@ void DumperSupport::dump_prim_array(AbstractDumpWriter* writer, typeArrayOop arr if (Endian::is_Java_byte_ordering_different()) { WRITE_ARRAY(array, int, u4, length); } else { - writer->write_raw((void*)(array->int_at_addr(0)), length_in_bytes); + writer->write_raw(array->int_at_addr(0), length_in_bytes); } break; } case T_BYTE : { - writer->write_raw((void*)(array->byte_at_addr(0)), length_in_bytes); + writer->write_raw(array->byte_at_addr(0), length_in_bytes); break; } case T_CHAR : { if (Endian::is_Java_byte_ordering_different()) { WRITE_ARRAY(array, char, u2, length); } else { - writer->write_raw((void*)(array->char_at_addr(0)), length_in_bytes); + writer->write_raw(array->char_at_addr(0), length_in_bytes); } break; } @@ -1484,7 +1479,7 @@ void DumperSupport::dump_prim_array(AbstractDumpWriter* writer, typeArrayOop arr if (Endian::is_Java_byte_ordering_different()) { WRITE_ARRAY(array, short, u2, length); } else { - writer->write_raw((void*)(array->short_at_addr(0)), length_in_bytes); + writer->write_raw(array->short_at_addr(0), length_in_bytes); } break; } @@ -1492,7 +1487,7 @@ void DumperSupport::dump_prim_array(AbstractDumpWriter* writer, typeArrayOop arr if (Endian::is_Java_byte_ordering_different()) { WRITE_ARRAY(array, bool, u1, length); } else { - writer->write_raw((void*)(array->bool_at_addr(0)), length_in_bytes); + writer->write_raw(array->bool_at_addr(0), length_in_bytes); } break; } @@ -1500,7 +1495,7 @@ void DumperSupport::dump_prim_array(AbstractDumpWriter* writer, typeArrayOop arr if (Endian::is_Java_byte_ordering_different()) { WRITE_ARRAY(array, long, u8, length); } else { - writer->write_raw((void*)(array->long_at_addr(0)), length_in_bytes); + writer->write_raw(array->long_at_addr(0), length_in_bytes); } break; } @@ -2281,8 +2276,7 @@ void VM_HeapDumper::work(uint worker_id) { const char* header = "JAVA PROFILE 1.0.2"; // header is few bytes long - no chance to overflow int - writer()->write_raw((void*)header, (int)strlen(header)); - writer()->write_u1(0); // terminator + writer()->write_raw(header, strlen(header) + 1); // NUL terminated writer()->write_u4(oopSize); // timestamp is current time in ms writer()->write_u8(os::javaTimeMillis()); -- GitLab From d95299a4d751449816ad2a88359f1e48e9608246 Mon Sep 17 00:00:00 2001 From: Patrick Concannon Date: Fri, 5 Nov 2021 10:39:37 +0000 Subject: [PATCH 214/890] 8276634: Remove `usePlainDatagramSocketImpl` option from the test DatagramChannel/SendReceiveMaxSize.java Reviewed-by: dfuchs, alanb, vtewari --- test/jdk/java/nio/channels/DatagramChannel/ChangingAddress.java | 2 +- .../java/nio/channels/DatagramChannel/SendReceiveMaxSize.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/jdk/java/nio/channels/DatagramChannel/ChangingAddress.java b/test/jdk/java/nio/channels/DatagramChannel/ChangingAddress.java index 8b82fe3b969..3efeccbdc46 100644 --- a/test/jdk/java/nio/channels/DatagramChannel/ChangingAddress.java +++ b/test/jdk/java/nio/channels/DatagramChannel/ChangingAddress.java @@ -25,7 +25,7 @@ * @bug 6431343 * @summary Test that DatagramChannel.getLocalAddress returns the right local * address after connect/disconnect. - * @run main/othervm -Djdk.net.usePlainDatagramSocketImpl=false ChangingAddress + * @run main/othervm ChangingAddress */ import java.net.*; import java.nio.channels.DatagramChannel; diff --git a/test/jdk/java/nio/channels/DatagramChannel/SendReceiveMaxSize.java b/test/jdk/java/nio/channels/DatagramChannel/SendReceiveMaxSize.java index 6f20df76deb..f86166c6849 100644 --- a/test/jdk/java/nio/channels/DatagramChannel/SendReceiveMaxSize.java +++ b/test/jdk/java/nio/channels/DatagramChannel/SendReceiveMaxSize.java @@ -31,8 +31,6 @@ * @build jdk.test.lib.net.IPSupport * @run testng/othervm SendReceiveMaxSize * @run testng/othervm -Djava.net.preferIPv4Stack=true SendReceiveMaxSize - * @run testng/othervm -Djdk.net.usePlainDatagramSocketImpl SendReceiveMaxSize - * @run testng/othervm -Djdk.net.usePlainDatagramSocketImpl -Djava.net.preferIPv4Stack=true SendReceiveMaxSize */ import jdk.test.lib.RandomFactory; -- GitLab From 0616d868c7cd5010f017b315fa1cf6cc1617ce29 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 5 Nov 2021 12:05:22 +0000 Subject: [PATCH 215/890] 8276635: Use blessed modifier order in compiler code Reviewed-by: darcy --- .../share/classes/javax/tools/Diagnostic.java | 4 ++-- .../com/sun/tools/javac/code/Symbol.java | 2 +- .../classes/com/sun/tools/javac/code/Type.java | 4 ++-- .../com/sun/tools/javac/code/Types.java | 12 ++++++------ .../classes/com/sun/tools/javac/comp/Flow.java | 2 +- .../com/sun/tools/javac/file/JRTIndex.java | 2 +- .../com/sun/tools/javac/file/Locations.java | 4 ++-- .../com/sun/tools/javac/jvm/StringConcat.java | 4 ++-- .../javac/model/AnnotationProxyMaker.java | 2 +- .../tools/javac/parser/DocCommentParser.java | 2 +- .../sun/tools/javac/parser/JavacParser.java | 2 +- .../com/sun/tools/javac/tree/DCTree.java | 6 +++--- .../com/sun/tools/javac/tree/JCTree.java | 18 +++++++++--------- .../com/sun/tools/javac/util/Dependencies.java | 2 +- .../com/sun/tools/javac/util/GraphUtils.java | 8 ++++---- .../com/sun/tools/javac/util/JCDiagnostic.java | 2 +- .../classes/com/sun/tools/javac/util/Log.java | 2 +- .../classes/com/sun/tools/javac/util/Name.java | 4 ++-- .../classes/sun/tools/jar/GNUStyleOptions.java | 4 ++-- 19 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/java.compiler/share/classes/javax/tools/Diagnostic.java b/src/java.compiler/share/classes/javax/tools/Diagnostic.java index 2440787b626..8c3c2a34c8a 100644 --- a/src/java.compiler/share/classes/javax/tools/Diagnostic.java +++ b/src/java.compiler/share/classes/javax/tools/Diagnostic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -89,7 +89,7 @@ public interface Diagnostic { /** * Used to signal that no position is available. */ - public final static long NOPOS = -1; + public static final long NOPOS = -1; /** * Returns the kind of this diagnostic, for example, error or diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java index 17dc60c1a88..a078fb6e22c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java @@ -794,7 +794,7 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem /** A base class for Symbols representing types. */ - public static abstract class TypeSymbol extends Symbol { + public abstract static class TypeSymbol extends Symbol { public TypeSymbol(Kind kind, long flags, Name name, Type type, Symbol owner) { super(kind, flags, name, type, owner); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java index c559f8c5be5..3cf34052300 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java @@ -241,7 +241,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons * of a given type expression. This mapping returns the original type is no changes occurred * when recursively mapping the original type's subterms. */ - public static abstract class StructuralTypeMapping extends Types.TypeMapping { + public abstract static class StructuralTypeMapping extends Types.TypeMapping { @Override public Type visitClassType(ClassType t, S s) { @@ -1786,7 +1786,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons } } - public static abstract class DelegatedType extends Type { + public abstract static class DelegatedType extends Type { public Type qtype; public TypeTag tag; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java index 9d182a4c076..51926a70529 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java @@ -4896,7 +4896,7 @@ public class Types { * type itself) of the operation implemented by this visitor; use * Void if a second argument is not needed. */ - public static abstract class DefaultTypeVisitor implements Type.Visitor { + public abstract static class DefaultTypeVisitor implements Type.Visitor { public final R visit(Type t, S s) { return t.accept(this, s); } public R visitClassType(ClassType t, S s) { return visitType(t, s); } public R visitWildcardType(WildcardType t, S s) { return visitType(t, s); } @@ -4923,7 +4923,7 @@ public class Types { * symbol itself) of the operation implemented by this visitor; use * Void if a second argument is not needed. */ - public static abstract class DefaultSymbolVisitor implements Symbol.Visitor { + public abstract static class DefaultSymbolVisitor implements Symbol.Visitor { public final R visit(Symbol s, S arg) { return s.accept(this, arg); } public R visitClassSymbol(ClassSymbol s, S arg) { return visitSymbol(s, arg); } public R visitMethodSymbol(MethodSymbol s, S arg) { return visitSymbol(s, arg); } @@ -4946,7 +4946,7 @@ public class Types { * type itself) of the operation implemented by this visitor; use * Void if a second argument is not needed. */ - public static abstract class SimpleVisitor extends DefaultTypeVisitor { + public abstract static class SimpleVisitor extends DefaultTypeVisitor { @Override public R visitCapturedType(CapturedType t, S s) { return visitTypeVar(t, s); @@ -4966,7 +4966,7 @@ public class Types { * form Type × Type → Boolean. * */ - public static abstract class TypeRelation extends SimpleVisitor {} + public abstract static class TypeRelation extends SimpleVisitor {} /** * A convenience visitor for implementing operations that only @@ -4976,7 +4976,7 @@ public class Types { * @param the return type of the operation implemented by this * visitor; use Void if no return type is needed. */ - public static abstract class UnaryVisitor extends SimpleVisitor { + public abstract static class UnaryVisitor extends SimpleVisitor { public final R visit(Type t) { return t.accept(this, null); } } @@ -5041,7 +5041,7 @@ public class Types { // - public static abstract class SignatureGenerator { + public abstract static class SignatureGenerator { public static class InvalidSignatureException extends RuntimeException { private static final long serialVersionUID = 0; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java index d14756759b7..f4ba0f9bb17 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java @@ -341,7 +341,7 @@ public class Flow { * Base visitor class for all visitors implementing dataflow analysis logic. * This class define the shared logic for handling jumps (break/continue statements). */ - static abstract class BaseAnalyzer extends TreeScanner { + abstract static class BaseAnalyzer extends TreeScanner { enum JumpKind { BREAK(JCTree.Tag.BREAK) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java index cc1568ad7da..eb6cd76d788 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JRTIndex.java @@ -56,7 +56,7 @@ import com.sun.tools.javac.util.Context; public class JRTIndex { /** Get a shared instance of the cache. */ private static JRTIndex sharedInstance; - public synchronized static JRTIndex getSharedInstance() { + public static synchronized JRTIndex getSharedInstance() { if (sharedInstance == null) { try { sharedInstance = new JRTIndex(); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java index c539c72d627..f64f19c3054 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java @@ -444,7 +444,7 @@ public class Locations { * @see #initHandlers * @see #getHandler */ - protected static abstract class LocationHandler { + protected abstract static class LocationHandler { /** * @see JavaFileManager#handleOption @@ -513,7 +513,7 @@ public class Locations { /** * A LocationHandler for a given Location, and associated set of options. */ - private static abstract class BasicLocationHandler extends LocationHandler { + private abstract static class BasicLocationHandler extends LocationHandler { final Location location; final Set

  • Specific Build Issues
  • Getting Help
  • +
  • Reproducible Builds
  • Hints and Suggestions for Advanced Users
    • Bash Completion
    • Using Multiple Configurations
    • @@ -884,6 +885,32 @@ spawn failed

      Getting Help

      If none of the suggestions in this document helps you, or if you find what you believe is a bug in the build system, please contact the Build Group by sending a mail to build-dev@openjdk.java.net. Please include the relevant parts of the configure and/or build log.

      If you need general help or advice about developing for the JDK, you can also contact the Adoption Group. See the section on Contributing to OpenJDK for more information.

      +

      Reproducible Builds

      +

      Build reproducibility is the property of getting exactly the same bits out when building, every time, independent on who builds the product, or where. This is for many reasons a harder goal than it initially appears, but it is an important goal, for security reasons and others. Please see Reproducible Builds for more information about the background and reasons for reproducible builds.

      +

      Currently, it is not possible to build OpenJDK fully reproducibly, but getting there is an ongoing effort. There are some things you can do to minimize non-determinism and make a larger part of the build reproducible:

      +
        +
      • Turn on build system support for reproducible builds
      • +
      +

      Add the flag --enable-reproducible-builds to your configure command line. This will turn on support for reproducible builds where it could otherwise be lacking.

      +
        +
      • Do not rely on configure's default adhoc version strings
      • +
      +

      Default adhoc version strings OPT segment include user name, source directory and timestamp. You can either override just the OPT segment using --with-version-opt=<any fixed string>, or you can specify the entire version string using --with-version-string=<your version>.

      +
        +
      • Specify how the build sets SOURCE_DATE_EPOCH
      • +
      +

      The JDK build system will set the SOURCE_DATE_EPOCH environment variable during building, depending on the value of the --with-source-date option for configure. The default value is updated, which means that SOURCE_DATE_EPOCH will be set to the current time each time you are running make.

      +

      The SOURCE_DATE_EPOCH environment variable is an industry standard, that many tools, such as gcc, recognize, and use in place of the current time when generating output.

      +

      For reproducible builds, you need to set this to a fixed value. You can use the special value version which will use the nominal release date for the current JDK version, or a value describing a date, either an epoch based timestamp as an integer, or a valid ISO-8601 date.

      +

      Hint: If your build environment already sets SOURCE_DATE_EPOCH, you can propagate this using --with-source-date=$SOURCE_DATE_EPOCH.

      +
        +
      • Specify a hotspot build time
      • +
      +

      Set a fixed hotspot build time. This will be included in the hotspot library (libjvm.so or jvm.dll) and defaults to the current time when building hotspot. Use --with-hotspot-build-time=<any fixed string> for reproducible builds. It's a string so you don't need to format it specifically, so e.g. n/a will do. Another solution is to use the SOURCE_DATE_EPOCH variable, e.g. --with-hotspot-build-time=$(date --date=@$SOURCE_DATE_EPOCH).

      +
        +
      • Copyright year
      • +
      +

      The copyright year in some generated text files are normally set to the current year. This can be overridden by --with-copyright-year=<year>. For fully reproducible builds, this needs to be set to a fixed value.

      Hints and Suggestions for Advanced Users

      Bash Completion

      The configure and make commands tries to play nice with bash command-line completion (using <tab> or <tab><tab>). To use this functionality, make sure you enable completion in your ~/.bashrc (see instructions for bash in your operating system).

      diff --git a/doc/building.md b/doc/building.md index 4c8cf213465..ac694ef8404 100644 --- a/doc/building.md +++ b/doc/building.md @@ -1503,6 +1503,68 @@ If you need general help or advice about developing for the JDK, you can also contact the Adoption Group. See the section on [Contributing to OpenJDK]( #contributing-to-openjdk) for more information. +## Reproducible Builds + +Build reproducibility is the property of getting exactly the same bits out when +building, every time, independent on who builds the product, or where. This is +for many reasons a harder goal than it initially appears, but it is an important +goal, for security reasons and others. Please see [Reproducible Builds]( +https://reproducible-builds.org) for more information about the background and +reasons for reproducible builds. + +Currently, it is not possible to build OpenJDK fully reproducibly, but getting +there is an ongoing effort. There are some things you can do to minimize +non-determinism and make a larger part of the build reproducible: + + * Turn on build system support for reproducible builds + +Add the flag `--enable-reproducible-builds` to your `configure` command line. +This will turn on support for reproducible builds where it could otherwise be +lacking. + + * Do not rely on `configure`'s default adhoc version strings + +Default adhoc version strings OPT segment include user name, source directory +and timestamp. You can either override just the OPT segment using +`--with-version-opt=`, or you can specify the entire version +string using `--with-version-string=`. + + * Specify how the build sets `SOURCE_DATE_EPOCH` + +The JDK build system will set the `SOURCE_DATE_EPOCH` environment variable +during building, depending on the value of the `--with-source-date` option for +`configure`. The default value is `updated`, which means that +`SOURCE_DATE_EPOCH` will be set to the current time each time you are running +`make`. + +The [`SOURCE_DATE_EPOCH` environment variable]( +https://reproducible-builds.org/docs/source-date-epoch/) is an industry +standard, that many tools, such as gcc, recognize, and use in place of the +current time when generating output. + +For reproducible builds, you need to set this to a fixed value. You can use the +special value `version` which will use the nominal release date for the current +JDK version, or a value describing a date, either an epoch based timestamp as an +integer, or a valid ISO-8601 date. + +**Hint:** If your build environment already sets `SOURCE_DATE_EPOCH`, you can +propagate this using `--with-source-date=$SOURCE_DATE_EPOCH`. + + * Specify a hotspot build time + +Set a fixed hotspot build time. This will be included in the hotspot library +(`libjvm.so` or `jvm.dll`) and defaults to the current time when building +hotspot. Use `--with-hotspot-build-time=` for reproducible +builds. It's a string so you don't need to format it specifically, so e.g. `n/a` +will do. Another solution is to use the `SOURCE_DATE_EPOCH` variable, e.g. +`--with-hotspot-build-time=$(date --date=@$SOURCE_DATE_EPOCH)`. + + * Copyright year + +The copyright year in some generated text files are normally set to the current +year. This can be overridden by `--with-copyright-year=`. For fully +reproducible builds, this needs to be set to a fixed value. + ## Hints and Suggestions for Advanced Users ### Bash Completion -- GitLab From ed7ecca401e5f4c3c07dc98e05a21396c6cdf594 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Fri, 5 Nov 2021 23:24:45 +0000 Subject: [PATCH 225/890] 8254739: G1: Optimize evacuation failure for regions with few failed objects Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 6 + src/hotspot/share/gc/g1/g1CardSetMemory.hpp | 4 +- src/hotspot/share/gc/g1/g1EvacFailure.cpp | 61 ++++---- .../share/gc/g1/g1EvacFailureObjectsSet.cpp | 131 ++++++++++++++++++ .../share/gc/g1/g1EvacFailureObjectsSet.hpp | 81 +++++++++++ .../share/gc/g1/g1ParScanThreadState.cpp | 3 + src/hotspot/share/gc/g1/g1SegmentedArray.hpp | 26 +++- .../share/gc/g1/g1SegmentedArray.inline.hpp | 41 ++++++ src/hotspot/share/gc/g1/heapRegion.cpp | 7 +- src/hotspot/share/gc/g1/heapRegion.hpp | 8 ++ src/hotspot/share/gc/g1/heapRegion.inline.hpp | 5 + .../gtest/gc/g1/test_freeRegionList.cpp | 9 ++ 12 files changed, 344 insertions(+), 38 deletions(-) create mode 100644 src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp create mode 100644 src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index f9ec7161cad..988db3a4a8d 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/g1/g1CardSetMemory.inline.hpp" +#include "gc/g1/g1SegmentedArray.inline.hpp" #include "logging/log.hpp" #include "runtime/atomic.hpp" #include "utilities/formatBuffer.hpp" @@ -46,6 +47,11 @@ G1CardSetAllocator::G1CardSetAllocator(const char* name, assert(elem_size >= sizeof(G1CardSetContainer), "Element instance size %u for allocator %s too small", elem_size, name); } +template +G1CardSetAllocator::~G1CardSetAllocator() { + drop_all(); +} + template bool G1CardSetAllocator::try_transfer_pending() { // Attempt to claim the lock. diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp index 0b79bfee530..4167576f9bb 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp @@ -113,9 +113,7 @@ public: G1CardSetAllocator(const char* name, const G1CardSetAllocOptions* buffer_options, G1CardSetBufferList* free_buffer_list); - ~G1CardSetAllocator() { - drop_all(); - } + ~G1CardSetAllocator(); Elem* allocate(); void free(Elem* elem); diff --git a/src/hotspot/share/gc/g1/g1EvacFailure.cpp b/src/hotspot/share/gc/g1/g1EvacFailure.cpp index 71a7714d120..305db3fdaef 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailure.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailure.cpp @@ -68,40 +68,40 @@ public: // dead too) already. void do_object(oop obj) { HeapWord* obj_addr = cast_from_oop(obj); + assert(_last_forwarded_object_end <= obj_addr, "should iterate in ascending address order"); assert(_hr->is_in(obj_addr), "sanity"); - if (obj->is_forwarded() && obj->forwardee() == obj) { - // The object failed to move. + // The object failed to move. + assert(obj->is_forwarded() && obj->forwardee() == obj, "sanity"); - zap_dead_objects(_last_forwarded_object_end, obj_addr); - // We consider all objects that we find self-forwarded to be - // live. What we'll do is that we'll update the prev marking - // info so that they are all under PTAMS and explicitly marked. - if (!_cm->is_marked_in_prev_bitmap(obj)) { - _cm->mark_in_prev_bitmap(obj); - } - if (_during_concurrent_start) { - // For the next marking info we'll only mark the - // self-forwarded objects explicitly if we are during - // concurrent start (since, normally, we only mark objects pointed - // to by roots if we succeed in copying them). By marking all - // self-forwarded objects we ensure that we mark any that are - // still pointed to be roots. During concurrent marking, and - // after concurrent start, we don't need to mark any objects - // explicitly and all objects in the CSet are considered - // (implicitly) live. So, we won't mark them explicitly and - // we'll leave them over NTAMS. - _cm->mark_in_next_bitmap(_worker_id, _hr, obj); - } - size_t obj_size = obj->size(); + zap_dead_objects(_last_forwarded_object_end, obj_addr); + // We consider all objects that we find self-forwarded to be + // live. What we'll do is that we'll update the prev marking + // info so that they are all under PTAMS and explicitly marked. + if (!_cm->is_marked_in_prev_bitmap(obj)) { + _cm->mark_in_prev_bitmap(obj); + } + if (_during_concurrent_start) { + // For the next marking info we'll only mark the + // self-forwarded objects explicitly if we are during + // concurrent start (since, normally, we only mark objects pointed + // to by roots if we succeed in copying them). By marking all + // self-forwarded objects we ensure that we mark any that are + // still pointed to be roots. During concurrent marking, and + // after concurrent start, we don't need to mark any objects + // explicitly and all objects in the CSet are considered + // (implicitly) live. So, we won't mark them explicitly and + // we'll leave them over NTAMS. + _cm->mark_in_next_bitmap(_worker_id, _hr, obj); + } + size_t obj_size = obj->size(); - _marked_bytes += (obj_size * HeapWordSize); - PreservedMarks::init_forwarded_mark(obj); + _marked_bytes += (obj_size * HeapWordSize); + PreservedMarks::init_forwarded_mark(obj); - HeapWord* obj_end = obj_addr + obj_size; - _last_forwarded_object_end = obj_end; - _hr->alloc_block_in_bot(obj_addr, obj_end); - } + HeapWord* obj_end = obj_addr + obj_size; + _last_forwarded_object_end = obj_end; + _hr->alloc_block_in_bot(obj_addr, obj_end); } // Fill the memory area from start to end with filler objects, and update the BOT @@ -164,7 +164,8 @@ public: RemoveSelfForwardPtrObjClosure rspc(hr, during_concurrent_start, _worker_id); - hr->object_iterate(&rspc); + // Iterates evac failure objs which are recorded during evacuation. + hr->iterate_evac_failure_objs(&rspc); // Need to zap the remainder area of the processed region. rspc.zap_remainder(); diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp new file mode 100644 index 00000000000..ae63cee3cbc --- /dev/null +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2021, Huawei 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/g1EvacFailureObjectsSet.hpp" +#include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1SegmentedArray.inline.hpp" +#include "gc/g1/heapRegion.hpp" +#include "gc/g1/heapRegion.inline.hpp" +#include "utilities/quickSort.hpp" + + +const G1SegmentedArrayAllocOptions G1EvacFailureObjectsSet::_alloc_options = + G1SegmentedArrayAllocOptions((uint)sizeof(OffsetInRegion), BufferLength, UINT_MAX, Alignment); + +G1SegmentedArrayBufferList G1EvacFailureObjectsSet::_free_buffer_list; + +#ifdef ASSERT +void G1EvacFailureObjectsSet::assert_is_valid_offset(size_t offset) const { + const uint max_offset = 1u << (HeapRegion::LogOfHRGrainBytes - LogHeapWordSize); + assert(offset < max_offset, "must be, but is " SIZE_FORMAT, offset); +} +#endif + +oop G1EvacFailureObjectsSet::from_offset(OffsetInRegion offset) const { + assert_is_valid_offset(offset); + return cast_to_oop(_bottom + offset); +} + +G1EvacFailureObjectsSet::OffsetInRegion G1EvacFailureObjectsSet::to_offset(oop obj) const { + const HeapWord* o = cast_from_oop(obj); + size_t offset = pointer_delta(o, _bottom); + assert(obj == from_offset(static_cast(offset)), "must be"); + return static_cast(offset); +} + +G1EvacFailureObjectsSet::G1EvacFailureObjectsSet(uint region_idx, HeapWord* bottom) : + DEBUG_ONLY(_region_idx(region_idx) COMMA) + _bottom(bottom), + _offsets(&_alloc_options, &_free_buffer_list) { + assert(HeapRegion::LogOfHRGrainBytes < 32, "must be"); +} + +void G1EvacFailureObjectsSet::record(oop obj) { + assert(obj != NULL, "must be"); + assert(_region_idx == G1CollectedHeap::heap()->heap_region_containing(obj)->hrm_index(), "must be"); + OffsetInRegion* e = _offsets.allocate(); + *e = to_offset(obj); +} + +// Helper class to join, sort and iterate over the previously collected segmented +// array of objects that failed evacuation. +class G1EvacFailureObjectsIterationHelper { + typedef G1EvacFailureObjectsSet::OffsetInRegion OffsetInRegion; + + G1EvacFailureObjectsSet* _objects_set; + const G1SegmentedArray* _segments; + OffsetInRegion* _offset_array; + uint _array_length; + + static int order_oop(OffsetInRegion a, OffsetInRegion b) { + return static_cast(a-b); + } + + void join_and_sort() { + _segments->iterate_nodes(*this); + + QuickSort::sort(_offset_array, _array_length, order_oop, true); + } + + void iterate_internal(ObjectClosure* closure) { + for (uint i = 0; i < _array_length; i++) { + oop cur = _objects_set->from_offset(_offset_array[i]); + closure->do_object(cur); + } + } + +public: + G1EvacFailureObjectsIterationHelper(G1EvacFailureObjectsSet* collector) : + _objects_set(collector), + _segments(&_objects_set->_offsets), + _offset_array(nullptr), + _array_length(0) { } + + void iterate(ObjectClosure* closure) { + uint num = _segments->num_allocated_nodes(); + _offset_array = NEW_C_HEAP_ARRAY(OffsetInRegion, num, mtGC); + + join_and_sort(); + assert(_array_length == num, "must be %u, %u", _array_length, num); + iterate_internal(closure); + + FREE_C_HEAP_ARRAY(OffsetInRegion, _offset_array); + } + + // Callback of G1SegmentedArray::iterate_nodes + void do_buffer(G1SegmentedArrayBuffer* node, uint length) { + node->copy_to(&_offset_array[_array_length]); + _array_length += length; + } +}; + +void G1EvacFailureObjectsSet::iterate(ObjectClosure* closure) { + assert_at_safepoint(); + + G1EvacFailureObjectsIterationHelper helper(this); + helper.iterate(closure); + + _offsets.drop_all(); +} diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp new file mode 100644 index 00000000000..50e5265c646 --- /dev/null +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021, Huawei 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_GC_G1_G1EVACUATIONFAILUREOBJSINHR_HPP +#define SHARE_GC_G1_G1EVACUATIONFAILUREOBJSINHR_HPP + +#include "gc/g1/g1SegmentedArray.hpp" +#include "memory/iterator.hpp" +#include "oops/oop.hpp" + +class G1EvacFailureObjectsIterationHelper; + +// This class collects addresses of objects that failed evacuation in a specific +// heap region. +// Provides sorted iteration of these elements for processing during the remove +// self forwards phase. +class G1EvacFailureObjectsSet { + friend class G1EvacFailureObjectsIterationHelper; + +public: + // Storage type of an object that failed evacuation within a region. Given + // heap region size and possible object locations within a region, it is + // sufficient to use an uint here to save some space instead of full pointers. + typedef uint OffsetInRegion; + +private: + static const uint BufferLength = 256; + static const uint Alignment = 4; + + static const G1SegmentedArrayAllocOptions _alloc_options; + + // This free list is shared among evacuation failure process in all regions. + static G1SegmentedArrayBufferList _free_buffer_list; + + DEBUG_ONLY(const uint _region_idx;) + + // Region bottom + const HeapWord* _bottom; + + // Offsets within region containing objects that failed evacuation. + G1SegmentedArray _offsets; + + void assert_is_valid_offset(size_t offset) const NOT_DEBUG_RETURN; + // Converts between an offset within a region and an oop address. + oop from_offset(OffsetInRegion offset) const; + OffsetInRegion to_offset(oop obj) const; + +public: + G1EvacFailureObjectsSet(uint region_idx, HeapWord* bottom); + + // Record an object that failed evacuation. + void record(oop obj); + + // Apply the given ObjectClosure to all objects that failed evacuation. Objects + // are passed in increasing address order. + void iterate(ObjectClosure* closure); +}; + + +#endif //SHARE_GC_G1_G1EVACUATIONFAILUREOBJSINHR_HPP diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp index bba90e6a742..f0b376982ae 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp @@ -607,6 +607,9 @@ oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markWord m, siz if (forward_ptr == NULL) { // Forward-to-self succeeded. We are the "owner" of the object. HeapRegion* r = _g1h->heap_region_containing(old); + // Records evac failure objs, this will help speed up iteration + // of these objs later in *remove self forward* phase of post evacuation. + r->record_evac_failure_obj(old); if (_evac_failure_regions->record(r->hrm_index())) { _g1h->hr_printer()->evac_failure(r); diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp index 7eb40719ce7..b1522ae68c1 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp @@ -73,6 +73,17 @@ public: size_t mem_size() const { return sizeof(*this) + (size_t)_num_elems * _elem_size; } + uint length() const { + // _next_allocate might grow larger than _num_elems in multi-thread environments + // due to races. + return MIN2(_next_allocate, _num_elems); + } + + // Copies the (valid) contents of this buffer into the destination. + void copy_to(void* dest) const { + ::memcpy(dest, _buffer, length() * _elem_size); + } + bool is_full() const { return _next_allocate >= _num_elems; } }; @@ -189,19 +200,23 @@ class G1SegmentedArray { private: inline G1SegmentedArrayBuffer* create_new_buffer(G1SegmentedArrayBuffer* const prev); + DEBUG_ONLY(uint calculate_length() const;) + public: const G1SegmentedArrayBuffer* first_array_buffer() const { return Atomic::load(&_first); } uint num_available_nodes() const { return Atomic::load(&_num_available_nodes); } - uint num_allocated_nodes() const { return Atomic::load(&_num_allocated_nodes); } + uint num_allocated_nodes() const { + uint allocated = Atomic::load(&_num_allocated_nodes); + assert(calculate_length() == allocated, "Must be"); + return allocated; + } inline uint elem_size() const; G1SegmentedArray(const G1SegmentedArrayAllocOptions* buffer_options, G1SegmentedArrayBufferList* free_buffer_list); - ~G1SegmentedArray() { - drop_all(); - } + ~G1SegmentedArray(); // Deallocate all buffers to the free buffer list and reset this allocator. Must // be called in a globally synchronized area. @@ -210,6 +225,9 @@ public: inline Elem* allocate(); inline uint num_buffers() const; + + template + void iterate_nodes(BufferClosure& closure) const; }; #endif //SHARE_GC_G1_G1SEGMENTEDARRAY_HPP diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp index 741229bd104..463085602be 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp @@ -167,6 +167,11 @@ G1SegmentedArray::G1SegmentedArray(const G1SegmentedArrayAllocOption assert(_free_buffer_list != nullptr, "precondition!"); } +template +G1SegmentedArray::~G1SegmentedArray() { + drop_all(); +} + template void G1SegmentedArray::drop_all() { G1SegmentedArrayBuffer* cur = Atomic::load_acquire(&_first); @@ -232,4 +237,40 @@ inline uint G1SegmentedArray::num_buffers() const { return Atomic::load(&_num_buffers); } +#ifdef ASSERT +template +class LengthClosure { + uint _total; +public: + LengthClosure() : _total(0) {} + void do_buffer(G1SegmentedArrayBuffer* node, uint limit) { + _total += limit; + } + uint length() const { + return _total; + } +}; + +template +uint G1SegmentedArray::calculate_length() const { + LengthClosure closure; + iterate_nodes(closure); + return closure.length(); +} +#endif + +template +template +void G1SegmentedArray::iterate_nodes(BufferClosure& closure) const { + G1SegmentedArrayBuffer* cur = Atomic::load_acquire(&_first); + + assert((cur != nullptr) == (_last != nullptr), + "If there is at least one element, there must be a last one"); + + while (cur != nullptr) { + closure.do_buffer(cur, cur->length()); + cur = cur->next(); + } +} + #endif //SHARE_GC_G1_G1SEGMENTEDARRAY_INLINE_HPP diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp index 3e10be4741a..ac0d551fc54 100644 --- a/src/hotspot/share/gc/g1/heapRegion.cpp +++ b/src/hotspot/share/gc/g1/heapRegion.cpp @@ -106,6 +106,10 @@ void HeapRegion::handle_evacuation_failure() { _next_marked_bytes = 0; } +void HeapRegion::iterate_evac_failure_objs(ObjectClosure* closure) { + _evac_failure_objs.iterate(closure); +} + void HeapRegion::unlink_from_list() { set_next(NULL); set_prev(NULL); @@ -246,7 +250,8 @@ HeapRegion::HeapRegion(uint hrm_index, _prev_marked_bytes(0), _next_marked_bytes(0), _young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(G1SurvRateGroup::InvalidAgeIndex), _gc_efficiency(-1.0), - _node_index(G1NUMA::UnknownNodeIndex) + _node_index(G1NUMA::UnknownNodeIndex), + _evac_failure_objs(hrm_index, _bottom) { assert(Universe::on_page_boundary(mr.start()) && Universe::on_page_boundary(mr.end()), "invalid space boundaries"); diff --git a/src/hotspot/share/gc/g1/heapRegion.hpp b/src/hotspot/share/gc/g1/heapRegion.hpp index b198396eac6..6939ecd9c0d 100644 --- a/src/hotspot/share/gc/g1/heapRegion.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.hpp @@ -26,6 +26,7 @@ #define SHARE_GC_G1_HEAPREGION_HPP #include "gc/g1/g1BlockOffsetTable.hpp" +#include "gc/g1/g1EvacFailureObjectsSet.hpp" #include "gc/g1/g1HeapRegionTraceType.hpp" #include "gc/g1/g1SurvRateGroup.hpp" #include "gc/g1/heapRegionTracer.hpp" @@ -258,6 +259,8 @@ private: uint _node_index; + G1EvacFailureObjectsSet _evac_failure_objs; + void report_region_type_change(G1HeapRegionTraceType::Type to); // Returns whether the given object address refers to a dead object, and either the @@ -554,6 +557,11 @@ public: // Update the region state after a failed evacuation. void handle_evacuation_failure(); + // Record an object that failed evacuation within this region. + void record_evac_failure_obj(oop obj); + // Applies the given closure to all previously recorded objects + // that failed evacuation in ascending address order. + void iterate_evac_failure_objs(ObjectClosure* closure); // Iterate over the objects overlapping the given memory region, applying cl // to all references in the region. This is a helper for diff --git a/src/hotspot/share/gc/g1/heapRegion.inline.hpp b/src/hotspot/share/gc/g1/heapRegion.inline.hpp index 91ade8a5029..7c5925bef86 100644 --- a/src/hotspot/share/gc/g1/heapRegion.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.inline.hpp @@ -31,6 +31,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp" #include "gc/g1/g1Predictions.hpp" +#include "gc/g1/g1SegmentedArray.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/prefetch.inline.hpp" @@ -450,4 +451,8 @@ inline void HeapRegion::record_surv_words_in_group(size_t words_survived) { _surv_rate_group->record_surviving_words(age_in_group, words_survived); } +inline void HeapRegion::record_evac_failure_obj(oop obj) { + _evac_failure_objs.record(obj); +} + #endif // SHARE_GC_G1_HEAPREGION_INLINE_HPP diff --git a/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp b/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp index e0707ee488b..9a69816558b 100644 --- a/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp +++ b/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp @@ -22,7 +22,16 @@ */ #include "precompiled.hpp" + +#include "gc/g1/g1BlockOffsetTable.inline.hpp" +#include "gc/g1/g1CardSet.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" +#include "gc/g1/g1RegionToSpaceMapper.hpp" +#include "gc/g1/heapRegion.inline.hpp" +#include "gc/g1/heapRegionSet.hpp" +#include "memory/allocation.hpp" +#include "memory/memRegion.hpp" +#include "memory/virtualspace.hpp" #include "unittest.hpp" // @requires UseG1GC -- GitLab From c7095b20d956e154d9863a7928d26285f1a0a0ac Mon Sep 17 00:00:00 2001 From: Anirvan Sarkar Date: Sat, 6 Nov 2021 00:41:44 +0000 Subject: [PATCH 226/890] 8276207: Properties.loadFromXML/storeToXML works incorrectly for supplementary characters Reviewed-by: joehw --- .../jdk/internal/util/xml/impl/Parser.java | 38 +++++++++---------- .../util/xml/impl/XMLStreamWriterImpl.java | 37 +++++++++++++----- .../java/util/Properties/LoadAndStoreXML.java | 31 ++++++++++++++- 3 files changed, 74 insertions(+), 32 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java b/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java index 6a76df32d00..005ad2cb1ea 100644 --- a/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java +++ b/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -1993,20 +1993,18 @@ public abstract class Parser { try { int i = Integer.parseInt( new String(mBuff, idx + 1, mBuffIdx - idx), 10); - if (i >= 0xffff) { - panic(FAULT); + // Restore the buffer offset + mBuffIdx = idx - 1; + for(char character : Character.toChars(i)) { + if (character == ' ' || mInp.next != null) { + bappend(character, flag); + } else { + bappend(character); + } } - ch = (char) i; } catch (NumberFormatException nfe) { panic(FAULT); } - // Restore the buffer offset - mBuffIdx = idx - 1; - if (ch == ' ' || mInp.next != null) { - bappend(ch, flag); - } else { - bappend(ch); - } st = -1; break; @@ -2034,20 +2032,18 @@ public abstract class Parser { try { int i = Integer.parseInt( new String(mBuff, idx + 1, mBuffIdx - idx), 16); - if (i >= 0xffff) { - panic(FAULT); + // Restore the buffer offset + mBuffIdx = idx - 1; + for(char character : Character.toChars(i)) { + if (character == ' ' || mInp.next != null) { + bappend(character, flag); + } else { + bappend(character); + } } - ch = (char) i; } catch (NumberFormatException nfe) { panic(FAULT); } - // Restore the buffer offset - mBuffIdx = idx - 1; - if (ch == ' ' || mInp.next != null) { - bappend(ch, flag); - } else { - bappend(ch); - } st = -1; break; diff --git a/src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java b/src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java index 91a264797d0..d92c238d174 100644 --- a/src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java +++ b/src/java.base/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -360,6 +360,15 @@ public class XMLStreamWriterImpl implements XMLStreamWriter { _doIndent = doIndent; } + /** + * Writes character reference in hex format. + */ + private void writeCharRef(int codePoint) throws XMLStreamException { + _writer.write(ENCODING_PREFIX); + _writer.write(Integer.toHexString(codePoint)); + _writer.write(SEMICOLON); + } + /** * Writes XML content to underlying writer. Escapes characters unless * escaping character feature is turned off. @@ -383,10 +392,15 @@ public class XMLStreamWriterImpl implements XMLStreamWriter { if (!_writer.canEncode(ch)) { _writer.write(content, startWritePos, index - startWritePos); - // Escape this char as underlying encoder cannot handle it - _writer.write(ENCODING_PREFIX); - _writer.write(Integer.toHexString(ch)); - _writer.write(SEMICOLON); + // Check if current and next characters forms a surrogate pair + // and escape it to avoid generation of invalid xml content + if ( index != end - 1 && Character.isSurrogatePair(ch, content[index+1])) { + writeCharRef(Character.toCodePoint(ch, content[index+1])); + index++; + } else { + writeCharRef(ch); + } + startWritePos = index + 1; continue; } @@ -455,10 +469,15 @@ public class XMLStreamWriterImpl implements XMLStreamWriter { if (!_writer.canEncode(ch)) { _writer.write(content, startWritePos, index - startWritePos); - // Escape this char as underlying encoder cannot handle it - _writer.write(ENCODING_PREFIX); - _writer.write(Integer.toHexString(ch)); - _writer.write(SEMICOLON); + // Check if current and next characters forms a surrogate pair + // and escape it to avoid generation of invalid xml content + if ( index != end - 1 && Character.isSurrogatePair(ch, content.charAt(index+1))) { + writeCharRef(Character.toCodePoint(ch, content.charAt(index+1))); + index++; + } else { + writeCharRef(ch); + } + startWritePos = index + 1; continue; } diff --git a/test/jdk/java/util/Properties/LoadAndStoreXML.java b/test/jdk/java/util/Properties/LoadAndStoreXML.java index 943983a5609..e374d01a210 100644 --- a/test/jdk/java/util/Properties/LoadAndStoreXML.java +++ b/test/jdk/java/util/Properties/LoadAndStoreXML.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8000354 8000685 8004371 8043119 + * @bug 8000354 8000685 8004371 8043119 8276207 * @summary Basic test of storeToXML and loadToXML * @run main/othervm -Djava.security.manager=allow LoadAndStoreXML */ @@ -138,6 +138,7 @@ public class LoadAndStoreXML { props.put("k3", "\u0020\u0391\u0392\u0393\u0394\u0395\u0396\u0397"); props.put("k4", "\u7532\u9aa8\u6587"); props.put("k5", "/conf/jaxp.properties"); + props.put("k6", "\uD834\uDD1E"); TestOutputStream out = new TestOutputStream(); props.storeToXML(out, null, encoding); @@ -243,6 +244,31 @@ public class LoadAndStoreXML { } } + /** + * Test loadFromXML with supplementary characters + */ + static void testLoadWithSupplementaryCharacters() throws IOException { + System.out.println("testLoadWithSupplementaryCharacters"); + + Properties expected = new Properties(); + expected.put("\uD834\uDD1E", "\uD834\uDD1E"); + + String s = "" + + "" + + "" + + "𝄞" + + ""; + + ByteArrayInputStream in = new ByteArrayInputStream(s.getBytes("UTF-8")); + Properties props = new Properties(); + props.loadFromXML(in); + + if (!props.equals(expected)) { + System.err.println("loaded: " + props + ", expected: " + expected); + throw new RuntimeException("Test failed"); + } + } + public static void main(String[] args) throws IOException { testLoadAndStore("UTF-8", false); @@ -254,6 +280,7 @@ public class LoadAndStoreXML { testLoadWithoutEncoding(); testLoadWithBadEncoding(); testStoreWithBadEncoding(); + testLoadWithSupplementaryCharacters(); // malformed documents String src = System.getProperty("test.src"); -- GitLab From 2653cfbf0f316183ea23dd234896b44f7dd6eae0 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Sat, 6 Nov 2021 03:36:46 +0000 Subject: [PATCH 227/890] 8276688: Remove JLinkReproducibleXXXTest from ProblemList.txt Reviewed-by: alanb, mchung --- test/jdk/ProblemList.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 064daa35b2a..fddb2b28fac 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -755,8 +755,6 @@ sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java 8265770 macosx-all # core_tools -tools/jlink/JLinkReproducibleTest.java 8217166 windows-all,linux-aarch64 -tools/jlink/JLinkReproducible3Test.java 8253688 linux-aarch64 tools/jlink/plugins/CompressorPluginTest.java 8247407 generic-all ############################################################################ -- GitLab From 884915496f7bfe754279f1644603131c64f192b3 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Sun, 7 Nov 2021 21:38:59 +0000 Subject: [PATCH 228/890] 8275846: read_base_archive_name() could read past the end of buffer Reviewed-by: ccheung, stuefe --- src/hotspot/share/cds/filemap.cpp | 35 +++++++++++-------- .../dynamicArchive/ArchiveConsistency.java | 22 ++++++++++-- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 1651aef99b0..5d77f2016c5 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -1083,24 +1083,29 @@ public: return &_header; } - bool read_base_archive_name(char** target) { + char* read_base_archive_name() { assert(_fd != -1, "Archive should be open"); - size_t name_size = (size_t)_header._base_archive_name_size; + size_t name_size = _header._base_archive_name_size; assert(name_size != 0, "For non-default base archive, name size should be non-zero!"); - *target = NEW_C_HEAP_ARRAY(char, name_size, mtInternal); + char* base_name = NEW_C_HEAP_ARRAY(char, name_size, mtInternal); lseek(_fd, _header._base_archive_path_offset, SEEK_SET); // position to correct offset. - size_t n = os::read(_fd, *target, (unsigned int)name_size); + size_t n = os::read(_fd, base_name, (unsigned int)name_size); if (n != name_size) { log_info(cds)("Unable to read base archive name from archive"); - FREE_C_HEAP_ARRAY(char, *target); - return false; + FREE_C_HEAP_ARRAY(char, base_name); + return nullptr; } - if (!os::file_exists(*target)) { - log_info(cds)("Base archive %s does not exist", *target); - FREE_C_HEAP_ARRAY(char, *target); - return false; + if (base_name[name_size - 1] != '\0' || strlen(base_name) != name_size - 1) { + log_info(cds)("Base archive name is damaged"); + FREE_C_HEAP_ARRAY(char, base_name); + return nullptr; } - return true; + if (!os::file_exists(base_name)) { + log_info(cds)("Base archive %s does not exist", base_name); + FREE_C_HEAP_ARRAY(char, base_name); + return nullptr; + } + return base_name; } }; @@ -1139,8 +1144,8 @@ bool FileMapInfo::check_archive(const char* archive_name, bool is_static) { log_info(cds)(" _header_size = " UINT32_FORMAT, header_size); return false; } - char* base_name = NULL; - if (!file_helper.read_base_archive_name(&base_name)) { + char* base_name = file_helper.read_base_archive_name(); + if (base_name == nullptr) { return false; } FREE_C_HEAP_ARRAY(char, base_name); @@ -1170,8 +1175,8 @@ bool FileMapInfo::get_base_archive_name_from_header(const char* archive_name, *base_archive_name = Arguments::get_default_shared_archive_path(); } else { // read the base archive name - if (!file_helper.read_base_archive_name(base_archive_name)) { - *base_archive_name = NULL; + *base_archive_name = file_helper.read_base_archive_name(); + if (*base_archive_name == nullptr) { return false; } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java index fbecc57d604..d7ba51e509d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java @@ -141,6 +141,7 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { new String[] {"An error has occurred while processing the shared archive file.", "Header checksum verification failed", "Unable to use shared archive"}); + // 5. Make base archive name not terminated with '\0' System.out.println("\n5. Make base archive name not terminated with '\0'"); String wrongBaseName = getNewArchiveName("wrongBaseName"); @@ -152,8 +153,25 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { runTwo(baseArchiveName, wrongBaseName, appJar, mainClass, 1, - new String[] {"Base archive " + baseArchiveName, - " does not exist", + new String[] {"Base archive name is damaged", + "Header checksum verification failed"}); + + // 6. Modify base archive name to a file that doesn't exist. + System.out.println("\n6. Modify base archive name to a file that doesn't exist"); + String wrongBaseName2 = getNewArchiveName("wrongBaseName2"); + copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseName2); + baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa); + baseArchiveNameSize = CDSArchiveUtils.baseArchiveNameSize(copiedJsa); + offset = baseArchivePathOffset + baseArchiveNameSize - 2; // the "a" in ".jsa" + CDSArchiveUtils.writeData(copiedJsa, offset, new byte[] {(byte)'b'}); // .jsa -> .jsb + + // Make sure it doesn't exist + String badName = baseArchiveName.replace(".jsa", ".jsb"); + (new File(badName)).delete(); + + runTwo(baseArchiveName, wrongBaseName2, + appJar, mainClass, 1, + new String[] {"Base archive " + badName + " does not exist", "Header checksum verification failed"}); } } -- GitLab From 44047f849fad157dac5df788aa5a2c1838e4aaf7 Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Mon, 8 Nov 2021 02:18:40 +0000 Subject: [PATCH 229/890] 8274328: C2: Redundant CFG edges fixup in block ordering Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/block.cpp | 54 +++++--------------------------- src/hotspot/share/opto/block.hpp | 7 ++--- 2 files changed, 11 insertions(+), 50 deletions(-) diff --git a/src/hotspot/share/opto/block.cpp b/src/hotspot/share/opto/block.cpp index d4227df0b4f..566dc4f2755 100644 --- a/src/hotspot/share/opto/block.cpp +++ b/src/hotspot/share/opto/block.cpp @@ -905,16 +905,13 @@ void PhaseCFG::fixup_flow() { // to succs[0], so we want the fall-thru case as the next block in // succs[1]. if (bnext == bs0) { - // Fall-thru case in succs[0], so flip targets in succs map + // Fall-thru case in succs[0], should be in succs[1], so flip targets in _succs map Block* tbs0 = block->_succs[0]; Block* tbs1 = block->_succs[1]; block->_succs.map(0, tbs1); block->_succs.map(1, tbs0); // Flip projection for each target - ProjNode* tmp = proj0; - proj0 = proj1; - proj1 = tmp; - + swap(proj0, proj1); } else if(bnext != bs1) { // Need a double-branch // The existing conditional branch need not change. @@ -1648,8 +1645,7 @@ void PhaseBlockLayout::merge_traces(bool fall_thru_only) { } } -// Order the sequence of the traces in some desirable way, and fixup the -// jumps at the end of each block. +// Order the sequence of the traces in some desirable way void PhaseBlockLayout::reorder_traces(int count) { ResourceArea *area = Thread::current()->resource_area(); Trace ** new_traces = NEW_ARENA_ARRAY(area, Trace *, count); @@ -1671,12 +1667,15 @@ void PhaseBlockLayout::reorder_traces(int count) { // Sort the new trace list by frequency qsort(new_traces + 1, new_count - 1, sizeof(new_traces[0]), trace_frequency_order); - // Patch up the successor blocks + // Collect all blocks from existing Traces _cfg.clear_blocks(); for (int i = 0; i < new_count; i++) { Trace *tr = new_traces[i]; if (tr != NULL) { - tr->fixup_blocks(_cfg); + // push blocks onto the CFG list + for (Block* b = tr->first_block(); b != NULL; b = tr->next(b)) { + _cfg.add_block(b); + } } } } @@ -1782,40 +1781,3 @@ bool Trace::backedge(CFGEdge *e) { return loop_rotated; } - -// push blocks onto the CFG list -// ensure that blocks have the correct two-way branch sense -void Trace::fixup_blocks(PhaseCFG &cfg) { - Block *last = last_block(); - for (Block *b = first_block(); b != NULL; b = next(b)) { - cfg.add_block(b); - if (!b->is_connector()) { - int nfallthru = b->num_fall_throughs(); - if (b != last) { - if (nfallthru == 2) { - // Ensure that the sense of the branch is correct - Block *bnext = next(b); - Block *bs0 = b->non_connector_successor(0); - - MachNode *iff = b->get_node(b->number_of_nodes() - 3)->as_Mach(); - ProjNode *proj0 = b->get_node(b->number_of_nodes() - 2)->as_Proj(); - ProjNode *proj1 = b->get_node(b->number_of_nodes() - 1)->as_Proj(); - - if (bnext == bs0) { - // Fall-thru case in succs[0], should be in succs[1] - - // Flip targets in _succs map - Block *tbs0 = b->_succs[0]; - Block *tbs1 = b->_succs[1]; - b->_succs.map( 0, tbs1 ); - b->_succs.map( 1, tbs0 ); - - // Flip projections to match targets - b->map_node(proj1, b->number_of_nodes() - 2); - b->map_node(proj0, b->number_of_nodes() - 1); - } - } - } - } - } -} diff --git a/src/hotspot/share/opto/block.hpp b/src/hotspot/share/opto/block.hpp index c4a41ce2156..67320ddc21b 100644 --- a/src/hotspot/share/opto/block.hpp +++ b/src/hotspot/share/opto/block.hpp @@ -797,8 +797,6 @@ class Trace : public ResourceObj { Block * _first; // First block in the trace Block * _last; // Last block in the trace - // Return the block that follows "b" in the trace. - Block * next(Block *b) const { return _next_list[b->_pre_order]; } void set_next(Block *b, Block *n) const { _next_list[b->_pre_order] = n; } // Return the block that precedes "b" in the trace. @@ -836,6 +834,9 @@ class Trace : public ResourceObj { // Return the last block in the trace Block * last_block() const { return _last; } + // Return the block that follows "b" in the trace. + Block * next(Block *b) const { return _next_list[b->_pre_order]; } + // Insert a trace in the middle of this one after b void insert_after(Block *b, Trace *tr) { set_next(tr->last_block(), next(b)); @@ -869,8 +870,6 @@ class Trace : public ResourceObj { _last = b; } - // Adjust the the blocks in this trace - void fixup_blocks(PhaseCFG &cfg); bool backedge(CFGEdge *e); #ifndef PRODUCT -- GitLab From 3934fe54b4c3e51add6d3fe1f145e5aebfe3b2fc Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 8 Nov 2021 06:40:49 +0000 Subject: [PATCH 230/890] 8275847: Scheduling fails with "too many D-U pinch points" on small method Reviewed-by: thartmann, kvn --- src/hotspot/cpu/x86/vmreg_x86.hpp | 8 ++- src/hotspot/share/opto/buildOopMap.cpp | 18 ++---- src/hotspot/share/opto/output.cpp | 10 ++++ .../c2/irTests/TestScheduleSmallMethod.java | 58 +++++++++++++++++++ 4 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/irTests/TestScheduleSmallMethod.java diff --git a/src/hotspot/cpu/x86/vmreg_x86.hpp b/src/hotspot/cpu/x86/vmreg_x86.hpp index fc0ba718baf..58df28f8491 100644 --- a/src/hotspot/cpu/x86/vmreg_x86.hpp +++ b/src/hotspot/cpu/x86/vmreg_x86.hpp @@ -90,7 +90,13 @@ inline bool is_concrete() { #ifndef AMD64 if (is_Register()) return true; #endif // AMD64 - return is_even(value()); + // Do not use is_XMMRegister() here as it depends on the UseAVX setting. + if (value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm) { + int base = value() - ConcreteRegisterImpl::max_fpr; + return base % XMMRegisterImpl::max_slots_per_register == 0; + } else { + return is_even(value()); // General, float, and K registers are all two slots wide + } } #endif // CPU_X86_VMREG_X86_HPP diff --git a/src/hotspot/share/opto/buildOopMap.cpp b/src/hotspot/share/opto/buildOopMap.cpp index 3add9b22812..8c9d45947eb 100644 --- a/src/hotspot/share/opto/buildOopMap.cpp +++ b/src/hotspot/share/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -231,10 +231,6 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i VMReg r = OptoReg::as_VMReg(OptoReg::Name(reg), framesize, max_inarg_slot); - if (false && r->is_reg() && !r->is_concrete()) { - continue; - } - // See if dead (no reaching def). Node *def = _defs[reg]; // Get reaching def assert( def, "since live better have reaching def" ); @@ -312,14 +308,10 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i set_live_bit(live,breg); // Already missed our turn? if( breg < reg ) { - if (b->is_stack() || b->is_concrete() || true ) { - omap->set_oop( b); - } + omap->set_oop(b); } } - if (b->is_stack() || b->is_concrete() || true ) { - omap->set_derived_oop( r, b); - } + omap->set_derived_oop(r, b); } } else if( t->isa_narrowoop() ) { @@ -347,9 +339,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i assert( dup_check[_callees[reg]]==0, "trying to callee save same reg twice" ); debug_only( dup_check[_callees[reg]]=1; ) VMReg callee = OptoReg::as_VMReg(OptoReg::Name(_callees[reg])); - if ( callee->is_concrete() || true ) { - omap->set_callee_saved( r, callee); - } + omap->set_callee_saved(r, callee); } else { // Other - some reaching non-oop value diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp index b43f81796d3..98f9fdec423 100644 --- a/src/hotspot/share/opto/output.cpp +++ b/src/hotspot/share/opto/output.cpp @@ -2915,6 +2915,16 @@ void Scheduling::anti_do_def( Block *b, Node *def, OptoReg::Name def_reg, int is if( !OptoReg::is_valid(def_reg) ) // Ignore stores & control flow return; + if (OptoReg::is_reg(def_reg)) { + VMReg vmreg = OptoReg::as_VMReg(def_reg); + if (vmreg->is_reg() && !vmreg->is_concrete() && !vmreg->prev()->is_concrete()) { + // This is one of the high slots of a vector register. + // ScheduleAndBundle already checked there are no live wide + // vectors in this method so it can be safely ignored. + return; + } + } + Node *pinch = _reg_node[def_reg]; // Get pinch point if ((pinch == NULL) || _cfg->get_block_for_node(pinch) != b || // No pinch-point yet? is_def ) { // Check for a true def (not a kill) diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestScheduleSmallMethod.java b/test/hotspot/jtreg/compiler/c2/irTests/TestScheduleSmallMethod.java new file mode 100644 index 00000000000..50543e18bc6 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestScheduleSmallMethod.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, Arm Limited. All rights reserved. + * 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.c2.irTests; + +import jdk.test.lib.Asserts; +import compiler.lib.ir_framework.*; + +/* + * @test + * @bug 8275847 + * @requires vm.compiler2.enabled + * @summary Test that small method with runtime calls can be scheduled. + * @library /test/lib / + * @run driver compiler.c2.irTests.TestScheduleSmallMethod + */ +public class TestScheduleSmallMethod { + + public static void main(String[] args) { + TestFramework framework = new TestFramework(); + Scenario schedulerOn = new Scenario(0, "-XX:+OptoScheduling"); + Scenario schedulerOff = new Scenario(1, "-XX:-OptoScheduling"); + framework.addScenarios(schedulerOn, schedulerOff).start(); + } + + @Test + public double testSmallMethodTwoRuntimeCalls(double value) { + // The two intrinsified Math calls below caused the scheduler to + // bail out with "too many D-U pinch points". See bug 8275847. + return Math.log(Math.sin(value)); + } + + @Run(test = "testSmallMethodTwoRuntimeCalls") + public void checkTestSmallMethodTwoRuntimeCalls() throws Throwable { + Asserts.assertLessThan(testSmallMethodTwoRuntimeCalls(Math.PI/2), 0.00001); + } +} -- GitLab From fc0fe256793b33430c1247e0c091150a091da3c4 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 8 Nov 2021 08:09:51 +0000 Subject: [PATCH 231/890] 8273235: tools/launcher/HelpFlagsTest.java Fails on Windows 32bit Reviewed-by: shade --- test/jdk/tools/launcher/HelpFlagsTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/tools/launcher/HelpFlagsTest.java b/test/jdk/tools/launcher/HelpFlagsTest.java index 1c1bf98b804..173074ab905 100644 --- a/test/jdk/tools/launcher/HelpFlagsTest.java +++ b/test/jdk/tools/launcher/HelpFlagsTest.java @@ -47,7 +47,9 @@ public class HelpFlagsTest extends TestHelper { static final String[] TOOLS_NOT_TO_TEST = { "appletviewer", // deprecated, don't test "jaccessinspector", // gui, don't test, win only + "jaccessinspector-32", // gui, don't test, win-32 only "jaccesswalker", // gui, don't test, win only + "jaccesswalker-32", // gui, don't test, win-32 only "jconsole", // gui, don't test "servertool", // none. Shell, don't test. "javaw", // don't test, win only -- GitLab From d8b0dee65e7e074d81eecf451542f79747ea7c78 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Mon, 8 Nov 2021 09:44:44 +0000 Subject: [PATCH 232/890] 8276239: Better tables in java.util.random package summary Reviewed-by: jlaskey --- .../java/util/random/package-info.java | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/java.base/share/classes/java/util/random/package-info.java b/src/java.base/share/classes/java/util/random/package-info.java index ec5f682262e..8efaa0bd4c3 100644 --- a/src/java.base/share/classes/java/util/random/package-info.java +++ b/src/java.base/share/classes/java/util/random/package-info.java @@ -223,7 +223,7 @@ * lifetime of a particular Java SE release. Changing the deprecation status of * an algorithm is not a specification change. * - * + *
      * * * @@ -236,91 +236,91 @@ * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * * * * - * + * * * * @@ -466,7 +466,7 @@ * 1-bit), and equidistribution property for each of the specific LXM algorithms * used in this package. * - *
      Available Algorithms
      L128X1024MixRandomL128X1024MixRandomLXMBigInteger.ONE.shiftLeft(1024).subtract(BigInteger.ONE).shiftLeft(128)11521
      L128X128MixRandomL128X128MixRandomLXMBigInteger.ONE.shiftLeft(128).subtract(BigInteger.ONE).shiftLeft(128)2561
      L128X256MixRandomL128X256MixRandomLXMBigInteger.ONE.shiftLeft(256).subtract(BigInteger.ONE).shiftLeft(128)3841
      L32X64MixRandomL32X64MixRandomLXMBigInteger.ONE.shiftLeft(64).subtract(BigInteger.ONE).shiftLeft(32)961
      L64X1024MixRandomL64X1024MixRandomLXMBigInteger.ONE.shiftLeft(1024).subtract(BigInteger.ONE).shiftLeft(64)108816
      L64X128MixRandomL64X128MixRandomLXMBigInteger.ONE.shiftLeft(128).subtract(BigInteger.ONE).shiftLeft(64)1922
      L64X128StarStarRandomL64X128StarStarRandomLXMBigInteger.ONE.shiftLeft(128).subtract(BigInteger.ONE).shiftLeft(64)1922
      L64X256MixRandomL64X256MixRandomLXMBigInteger.ONE.shiftLeft(256).subtract(BigInteger.ONE).shiftLeft(64)3204
      RandomRandomLegacyBigInteger.ONE.shiftLeft(48)480
      SplittableRandomSplittableRandomLegacyBigInteger.ONE.shiftLeft(64)641
      ThreadLocalRandom *ThreadLocalRandom *LegacyBigInteger.ONE.shiftLeft(64)641
      Xoroshiro128PlusPlusXoroshiro128PlusPlusXoroshiroBigInteger.ONE.shiftLeft(128).subtract(BigInteger.ONE)1281
      Xoshiro256PlusPlusXoshiro256PlusPlusXoshiroBigInteger.ONE.shiftLeft(256).subtract(BigInteger.ONE)256
      + *
      * * * @@ -476,42 +476,42 @@ * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * @@ -575,7 +575,7 @@ * missing 1-bit is handled through special coding of the multiply-add algorithm * used in the LCG.) * - *
      Algorithm Properties
      Implementation{@link RandomGenerator#nextLong nextLong()} values are
      "L32X64MixRandom"
      "L32X64MixRandom"232(264−1)96 bits32 bits
      "L64X128StarStarRandom"
      "L64X128StarStarRandom"264(2128−1)192 bits64 bits2-equidistributed and exactly equidistributed
      "L64X128MixRandom"
      "L64X128MixRandom"264(2128−1)192 bits64 bits2-equidistributed and exactly equidistributed
      "L64X256MixRandom"
      "L64X256MixRandom"264(2256−1)320 bits64 bits4-equidistributed and exactly equidistributed
      "L64X1024MixRandom"
      "L64X1024MixRandom"264(21024−1)1088 bits64 bits16-equidistributed and exactly equidistributed
      "L128X128MixRandom"
      "L128X128MixRandom"2128(2128−1)256 bits128 bitsexactly equidistributed
      "L128X256MixRandom"
      "L128X256MixRandom"2128(2256−1)384 bits128 bitsexactly equidistributed
      "L128X1024MixRandom"
      "L128X1024MixRandom"2128(21024−1)1152 bits128 bits
      + *
      * * * @@ -585,42 +585,42 @@ * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * -- GitLab From 0395e4ef8ced8385cc2c9b3bea4c6f4490c62d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Mon, 8 Nov 2021 11:35:26 +0000 Subject: [PATCH 233/890] 8276768: Snippet copy feature should use button instead of link Reviewed-by: prappo --- .../formats/html/TagletWriterImpl.java | 9 ++-- .../doclets/toolkit/resources/script.js | 19 ++++--- .../doclets/toolkit/resources/stylesheet.css | 54 +++++++++---------- .../doclet/testSnippetTag/TestSnippetTag.java | 54 +++++++++---------- .../lib/javadoc/tester/LinkChecker.java | 4 +- 5 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index b5992daea7e..68506e3140e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -447,13 +447,14 @@ public class TagletWriterImpl extends TagletWriter { String copyText = resources.getText("doclet.Copy_snippet_to_clipboard"); String copiedText = resources.getText("doclet.Copied_snippet_to_clipboard"); HtmlTree snippetContainer = HtmlTree.DIV(HtmlStyle.snippetContainer, - HtmlTree.A("#", new HtmlTree(TagName.IMG) + new HtmlTree(TagName.BUTTON) + .add(HtmlTree.SPAN(Text.of(copyText)) + .put(HtmlAttr.DATA_COPIED, copiedText)) + .add(new HtmlTree(TagName.IMG) .put(HtmlAttr.SRC, htmlWriter.pathToRoot.resolve(DocPaths.CLIPBOARD_SVG).getPath()) .put(HtmlAttr.ALT, copyText)) .addStyle(HtmlStyle.snippetCopy) - .put(HtmlAttr.ONCLICK, "copySnippet(this)") - .put(HtmlAttr.ARIA_LABEL, copyText) - .put(HtmlAttr.DATA_COPIED, copiedText)); + .put(HtmlAttr.ONCLICK, "copySnippet(this)")); return snippetContainer.add(pre.add(code)); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js index 03bdc7e936a..b68c774a44d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js @@ -106,19 +106,24 @@ function indexFilesLoaded() { && tagSearchIndex; } -function copySnippet(link) { +function copySnippet(button) { var textarea = document.createElement("textarea"); textarea.style.height = 0; document.body.appendChild(textarea); - textarea.value = link.nextElementSibling.innerText; + textarea.value = button.nextElementSibling.innerText; textarea.select(); document.execCommand("copy"); document.body.removeChild(textarea); - link.classList.add("copied"); - var parent = link.parentElement; - parent.onmouseleave = parent.ontouchend = function() { - link.classList.remove("copied"); - }; + var span = button.firstElementChild; + var copied = span.getAttribute("data-copied"); + if (span.innerHTML !== copied) { + var initialLabel = span.innerHTML; + span.innerHTML = copied; + var parent = button.parentElement; + parent.onmouseleave = parent.ontouchend = function() { + span.innerHTML = initialLabel; + }; + } } // Workaround for scroll position not being included in browser history (8249133) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index 6bd0892efb5..04eae7801f1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -936,62 +936,56 @@ pre.snippet { div.snippet-container { position: relative; } -a.snippet-copy { +button.snippet-copy { position: absolute; - top: 8px; - right: 8px; + top: 6px; + right: 6px; + height: 1.7em; + opacity: 50%; + transition: opacity 0.2s; + padding: 2px; + border: none; + cursor: pointer; + background: none; } -a.snippet-copy img { +button.snippet-copy img { width: 18px; height: 18px; padding: 0.05em 0; - opacity: 50%; - transition: opacity 0.2s; + background: none; } -div.snippet-container:hover a.snippet-copy img { +div.snippet-container:hover button.snippet-copy { opacity: 80%; } -div.snippet-container a.snippet-copy:hover img { - opacity: 100%; -} -a.snippet-copy:active img { - background: #d3d3d3; +div.snippet-container button.snippet-copy:hover { opacity: 100%; } -a.snippet-copy::before { +button.snippet-copy span { color: #3d3d3d; content: attr(aria-label); font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; font-size: 85%; line-height: 1.2em; padding: 0.2em; - position: absolute; - opacity: 80%; - transition: opacity 0.2s; + position: relative; white-space: nowrap; - top: -0.01em; - right: 1.5em; + top: -0.5em; display: none; } -div.snippet-container:hover a.snippet-copy::before { - display: inherit; +div.snippet-container:hover button.snippet-copy span { + display: inline; } -div.snippet-container a.snippet-copy:hover::before { +button.snippet-copy:active { + background: #d3d3d3; opacity: 100%; } -a.snippet-copy.copied::before { - content: attr(data-copied); -} -a.snippet-copy:active::before { - background-color: #dadada; -} @media screen and (max-width: 800px) { pre.snippet { padding-top: 26px; } - a.snippet-copy { - top: 6px; - right: 6px; + button.snippet-copy { + top: 4px; + right: 4px; } } pre.snippet .italic { diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index 19d36d41e7e..a13f75ddae6 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -224,9 +224,9 @@ public class TestSnippetTag extends JavadocTester { case%s()
      A method. \s -
      Copy +
          Hello, Snippet!
                               
      @@ -948,9 +948,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      Copy +
      %s
      """.formatted(id, t.expectedOutput())); }); @@ -1044,9 +1044,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      Copy +
      %s
      """.formatted(index, expectedOutput)); }); @@ -1605,9 +1605,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      Copy +
      %s
      """.formatted(index, t.expectedOutput())); }); @@ -1722,18 +1722,18 @@ public class TestSnippetTag extends JavadocTester { """ case0()
      -
      \
-                    Copy +
      """); checkOutput("pkg/A.html", true, """ case1()
      -
      \
-                    Copy +
      """); } @@ -1832,9 +1832,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      Copy +
      2
      """.formatted(j)); @@ -1916,9 +1916,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      Copy +
      %s
      """.formatted(index, t.expectedOutput())); }); @@ -2248,9 +2248,9 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      Copy +
      %s
      """.formatted(index, t.expectedOutput())); }); diff --git a/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java b/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java index 2eb3620b85b..2e951eadea7 100644 --- a/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java +++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/LinkChecker.java @@ -351,7 +351,7 @@ public class LinkChecker extends HtmlChecker { void addReference(String name, Path from, int line) { if (checked) { - if (name != null && !name.isEmpty()) { + if (name != null) { ID id = map.get(name); if (id == null || !id.declared) { error(from, line, "id not found: " + this.name + "#" + name); @@ -368,7 +368,7 @@ public class LinkChecker extends HtmlChecker { void check() { map.forEach((name, id) -> { - if (name != null && !name.isEmpty() && !id.declared) { + if (name != null && !id.declared) { //log.error(currFile, 0, "id not declared: " + name); for (Position ref : id.references) { error(ref.path, ref.line, "id not found: " + this.name + "#" + name); -- GitLab From 54481394a3b7d36b2326e22e4aa910a3e8041b5c Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 8 Nov 2021 12:47:58 +0000 Subject: [PATCH 234/890] 8271056: C2: "assert(no_dead_loop) failed: dead loop detected" due to cmoving identity Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/cfgnode.cpp | 7 +- .../c2/TestDeadDataLoopCmoveIdentity.java | 82 +++++++++++++++++++ 2 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestDeadDataLoopCmoveIdentity.java diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index 51e4b9887d0..cad5e835321 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -1366,9 +1366,12 @@ Node* PhiNode::Identity(PhaseGVN* phase) { } int true_path = is_diamond_phi(); - if (true_path != 0) { + // Delay CMove'ing identity if Ideal has not had the chance to handle unsafe cases, yet. + if (true_path != 0 && !(phase->is_IterGVN() && wait_for_region_igvn(phase))) { Node* id = is_cmove_id(phase, true_path); - if (id != NULL) return id; + if (id != NULL) { + return id; + } } // Looking for phis with identical inputs. If we find one that has diff --git a/test/hotspot/jtreg/compiler/c2/TestDeadDataLoopCmoveIdentity.java b/test/hotspot/jtreg/compiler/c2/TestDeadDataLoopCmoveIdentity.java new file mode 100644 index 00000000000..0c88da21216 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestDeadDataLoopCmoveIdentity.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021, 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 + * @key stress randomness + * @bug 8271056 + * @summary A dead data loop is created when applying an unsafe case of Cmov'ing identity. + * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileCommand=compileonly,compiler.c2.TestDeadDataLoopCmoveIdentity::* + * -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=359948366 compiler.c2.TestDeadDataLoopCmoveIdentity + * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileCommand=compileonly,compiler.c2.TestDeadDataLoopCmoveIdentity::* + * -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN compiler.c2.TestDeadDataLoopCmoveIdentity + */ + +package compiler.c2; + +public class TestDeadDataLoopCmoveIdentity { + static boolean bFld; + + public static void main(String[] strArr) { + test(); + test2(); + } + + static void test() { + int i33 = 51925, iArr3[] = new int[10]; + if (bFld) { + ; + } else if (bFld) { + for (int i = 0; i < 100; i++) { } + do { + if (i33 != 0) { + } + int i34 = 1; + do { + switch (0) { + case 122: { } + } + } while (i34 < 1); + i33 += i33 + 3; + } while (i33 < 5); + } + } + + static void test2() { + int i33 = 51925, iArr3[] = new int[10]; + if (bFld) { + ; + } else if (bFld) { + do { + if (i33 != 0) { + } + int i34 = 1; + do { + switch (0) { + case 122: {} + } + } while (i34 < 1); + } while (++i33 < 5); + } + } +} -- GitLab From ff6863c98dbd15c4f3920402eb0991727d1a380c Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 8 Nov 2021 12:59:00 +0000 Subject: [PATCH 235/890] 8276540: Howl Full CardSet container iteration marks too many cards Reviewed-by: ayang, sjohanss --- src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index f5dd4ed60a7..842e52e9ff7 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -330,7 +330,7 @@ inline void G1CardSetHowl::iterate_cardset(CardSetPtr const card_set, uint index if (found.start_iterate(G1GCPhaseTimes::MergeRSHowlFull)) { assert(card_set == G1CardSet::FullCardSet, "Must be"); uint offset = index << config->log2_num_cards_in_howl_bitmap(); - for (uint i = 0; i < config->max_cards_in_region(); i++) { + for (uint i = 0; i < config->num_cards_in_howl_bitmap(); i++) { found((offset | (uint)i)); } } -- GitLab From 4c14eddf41f1d9984417dc5ac6aba6f268b31029 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 8 Nov 2021 13:19:51 +0000 Subject: [PATCH 236/890] 8274734: the method jdk.jshell.SourceCodeAnalysis documentation not working Reviewed-by: vromero --- .../jdk/jshell/SourceCodeAnalysisImpl.java | 3 +- .../jdk/jshell/MultipleDocumentationTest.java | 76 +++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 test/langtools/jdk/jshell/MultipleDocumentationTest.java diff --git a/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java b/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java index 595b42c13bf..3dad15b0831 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java @@ -1381,8 +1381,7 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis { FileSystem zipFO = null; try { - URI uri = URI.create("jar:" + srcZip.toUri()); - zipFO = FileSystems.newFileSystem(uri, Collections.emptyMap()); + zipFO = FileSystems.newFileSystem(srcZip, Collections.emptyMap()); Path root = zipFO.getRootDirectories().iterator().next(); if (Files.exists(root.resolve("java/lang/Object.java".replace("/", zipFO.getSeparator())))) { diff --git a/test/langtools/jdk/jshell/MultipleDocumentationTest.java b/test/langtools/jdk/jshell/MultipleDocumentationTest.java new file mode 100644 index 00000000000..8037381ccc8 --- /dev/null +++ b/test/langtools/jdk/jshell/MultipleDocumentationTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021, 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.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.List; +import java.util.stream.Collectors; +import jdk.jshell.JShell; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +/* + * @test + * @bug 8274734 + * @summary Verify multiple SourceCodeAnalysis instances can concurrently provide documentation. + * @library /tools/lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.jdeps/com.sun.tools.javap + * jdk.jshell/jdk.internal.jshell.tool + * @build Compiler toolbox.ToolBox + * @run testng MultipleDocumentationTest + */ +@Test +public class MultipleDocumentationTest { + + public void testMultipleDocumentation() { + String input = "java.lang.String"; + + try (var state1 = JShell.builder() + .out(new PrintStream(new ByteArrayOutputStream())) + .err(new PrintStream(new ByteArrayOutputStream())) + .build()) { + var sca1 = state1.sourceCodeAnalysis(); + List javadocs1 = + sca1.documentation(input, input.length(), true) + .stream() + .map(d -> d.javadoc()) + .collect(Collectors.toList()); + + try (var state2 = JShell.builder() + .out(new PrintStream(new ByteArrayOutputStream())) + .err(new PrintStream(new ByteArrayOutputStream())) + .build()) { + var sca2 = state2.sourceCodeAnalysis(); + List javadocs2 = sca2.documentation(input, input.length(), true) + .stream() + .map(d -> d.javadoc()) + .collect(Collectors.toList()); + + assertEquals(javadocs2, javadocs1); + } + } + } + +} -- GitLab From fa754b8ffda0ae16cda03d896260870ff8fb6ae9 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 8 Nov 2021 13:20:44 +0000 Subject: [PATCH 237/890] 8276149: jshell throws EOF error when throwing exception inside switch expression Reviewed-by: vromero --- .../share/classes/jdk/jshell/CompletenessAnalyzer.java | 8 +++++--- test/langtools/jdk/jshell/CompletenessTest.java | 10 ++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java index b6a467b7456..ffa83bdd2d4 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java @@ -557,9 +557,11 @@ class CompletenessAnalyzer { break; } // Detect an error if we are at starting position and the last - // token wasn't a terminating one. Special case: within braces, - // comma can proceed semicolon, e.g. the values list in enum - if (ct.kind.isStart() && !prevTK.isOkToTerminate() && prevTK != COMMA) { + // token wasn't a terminating one. Special cases: + // -within braces, comma can procede semicolon, e.g. the values list in enum + // -arrow can be followed by a throw, e.g. in a switch/switch expression + if (ct.kind.isStart() && !prevTK.isOkToTerminate() && prevTK != COMMA && + !(prevTK == ARROW && ct.kind == THROW)) { return new CT(ERROR, current, "No '" + prevTK + "' before '" + ct.kind + "'"); } if (stack.isEmpty() || ct.kind.isError()) { diff --git a/test/langtools/jdk/jshell/CompletenessTest.java b/test/langtools/jdk/jshell/CompletenessTest.java index 97e165abb7a..7748f1ee848 100644 --- a/test/langtools/jdk/jshell/CompletenessTest.java +++ b/test/langtools/jdk/jshell/CompletenessTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8149524 8131024 8165211 8080071 8130454 8167343 8129559 8114842 8182268 8223782 8235474 8246774 + * @bug 8149524 8131024 8165211 8080071 8130454 8167343 8129559 8114842 8182268 8223782 8235474 8246774 8276149 * @summary Test SourceCodeAnalysis * @build KullaTesting TestingInputStream * @run testng CompletenessTest @@ -223,6 +223,12 @@ public class CompletenessTest extends KullaTesting { "static record D(String i, String j)", "static record D(String i) {", "static record D(String i, String j) {", + //JDK-8276149: + "void t(int i) { int v = switch (i) { case 0 -> ", + "void t(int i) { int v = switch (i) { case 0 -> {", + "void t(int i) { int v = switch (i) { case 0 -> a = b;", + "void t(int i) { int v = switch (i) { case 0 -> System.err.println(1);", + "void t(int i) { int v = switch (i) { case 0 -> throw new IllegalStateException();", }; static final String[] unknown = new String[] { -- GitLab From 0c2d00bff7b96cca53820aadfdaf09c840a2a33a Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 8 Nov 2021 13:21:40 +0000 Subject: [PATCH 238/890] 8275097: Wrong span of the 'default' tag Reviewed-by: vromero --- .../sun/tools/javac/parser/JavacParser.java | 3 +- .../tools/javac/parser/JavacParserTest.java | 91 ++++++++++++++++++- .../tools/javac/patterns/SwitchErrors.out | 6 +- 3 files changed, 93 insertions(+), 7 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index 24a8a074050..4b508c4bdf0 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -3031,9 +3031,9 @@ public class JavacParser implements Parser { } case DEFAULT: { nextToken(); + JCCaseLabel defaultPattern = toP(F.at(pos).DefaultCaseLabel()); CaseTree.CaseKind caseKind; JCTree body = null; - int patternPos = token.pos; if (token.kind == ARROW) { checkSourceLevel(Feature.SWITCH_RULE); accept(ARROW); @@ -3049,7 +3049,6 @@ public class JavacParser implements Parser { caseKind = JCCase.STATEMENT; stats = blockStatements(); } - JCCaseLabel defaultPattern = toP(F.at(patternPos).DefaultCaseLabel()); c = F.at(pos).Case(caseKind, List.of(defaultPattern), stats, body); if (stats.isEmpty()) storeEnd(c, S.prevToken().endPos); diff --git a/test/langtools/tools/javac/parser/JavacParserTest.java b/test/langtools/tools/javac/parser/JavacParserTest.java index fa84291a9a6..93a854abadd 100644 --- a/test/langtools/tools/javac/parser/JavacParserTest.java +++ b/test/langtools/tools/javac/parser/JavacParserTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 7073631 7159445 7156633 8028235 8065753 8205418 8205913 8228451 8237041 8253584 8246774 8256411 8256149 8259050 8266436 8267221 8271928 + * @bug 7073631 7159445 7156633 8028235 8065753 8205418 8205913 8228451 8237041 8253584 8246774 8256411 8256149 8259050 8266436 8267221 8271928 8275097 * @summary tests error and diagnostics positions * @author Jan Lahoda * @modules jdk.compiler/com.sun.tools.javac.api @@ -52,7 +52,6 @@ import com.sun.source.tree.WhileLoopTree; import com.sun.source.util.JavacTask; import com.sun.source.util.SourcePositions; import com.sun.source.util.TreePath; -import com.sun.source.util.TreePathScanner; import com.sun.source.util.TreeScanner; import com.sun.source.util.Trees; import com.sun.tools.javac.api.JavacTaskImpl; @@ -83,6 +82,7 @@ import javax.tools.SimpleJavaFileObject; import javax.tools.ToolProvider; import com.sun.source.tree.CaseTree; +import com.sun.source.tree.DefaultCaseLabelTree; import com.sun.source.util.TreePathScanner; import java.util.Objects; @@ -1820,6 +1820,93 @@ public class JavacParserTest extends TestCase { }.scan(cut, null); } + @Test //JDK-8275097 + void testDefaultTagPosition() throws IOException { + String code = """ + package t; + class Test { + private void test1(int i) { + switch (i) { + default: + } + } + private void test2(int i) { + switch (i) { + case default: + } + } + private int test3(int i) { + return switch (i) { + default: yield 0; + } + } + private int test4(int i) { + return switch (i) { + case default: yield 0; + } + } + private void test5(int i) { + switch (i) { + default -> {} + } + } + private void test6(int i) { + switch (i) { + case default -> {} + } + } + private int test5(int i) { + return switch (i) { + default -> { yield 0; } + } + } + private int test6(int i) { + return switch (i) { + case default -> { yield 0; } + } + } + private int test7(int i) { + return switch (i) { + default -> 0; + } + } + private int test8(int i) { + return switch (i) { + case default -> 0; + } + } + } + """; + + JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, fm, null, null, + null, Arrays.asList(new MyFileObject(code))); + CompilationUnitTree cut = ct.parse().iterator().next(); + Trees t = Trees.instance(ct); + SourcePositions sp = t.getSourcePositions(); + new TreeScanner() { + @Override + public Void visitDefaultCaseLabel(DefaultCaseLabelTree tree, Void p) { + int start = (int) sp.getStartPosition(cut, tree); + int end = (int) sp.getEndPosition(cut, tree); + String defaultName = code.substring(start, end); + if (!"default".equals(defaultName)) { + throw new AssertionError("Incorrect span: " + defaultName); + } + return super.visitDefaultCaseLabel(tree, p); + } + + @Override + public Void visitCase(CaseTree node, Void p) { + scan(node.getLabels(), p); + if (node.getCaseKind() == CaseTree.CaseKind.RULE) + scan(node.getBody(), p); + else + scan(node.getStatements(), p); + return null; + } + }.scan(cut, null); + } + void run(String[] args) throws Exception { int passed = 0, failed = 0; final Pattern p = (args != null && args.length > 0) diff --git a/test/langtools/tools/javac/patterns/SwitchErrors.out b/test/langtools/tools/javac/patterns/SwitchErrors.out index ba5f2338d06..9c4a8ff677f 100644 --- a/test/langtools/tools/javac/patterns/SwitchErrors.out +++ b/test/langtools/tools/javac/patterns/SwitchErrors.out @@ -5,13 +5,13 @@ SwitchErrors.java:23:18: compiler.err.prob.found.req: (compiler.misc.inconvertib SwitchErrors.java:28:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.type.null, int) SwitchErrors.java:29:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.String, int) SwitchErrors.java:30:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.CharSequence) -SwitchErrors.java:36:20: compiler.err.total.pattern.and.default +SwitchErrors.java:36:13: compiler.err.total.pattern.and.default SwitchErrors.java:42:18: compiler.err.pattern.dominated SwitchErrors.java:42:24: compiler.err.total.pattern.and.default SwitchErrors.java:48:18: compiler.err.total.pattern.and.default SwitchErrors.java:54:18: compiler.err.duplicate.total.pattern -SwitchErrors.java:60:20: compiler.err.duplicate.default.label -SwitchErrors.java:66:20: compiler.err.duplicate.default.label +SwitchErrors.java:60:13: compiler.err.duplicate.default.label +SwitchErrors.java:66:13: compiler.err.duplicate.default.label SwitchErrors.java:71:27: compiler.err.duplicate.default.label SwitchErrors.java:77:18: compiler.err.duplicate.case.label SwitchErrors.java:82:24: compiler.err.duplicate.case.label -- GitLab From cc2cac130cc28730a30d2e1d76bcb6ec8bc0b580 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Mon, 8 Nov 2021 13:22:37 +0000 Subject: [PATCH 239/890] 8274686: java.util.UUID#hashCode() should use Long.hashCode() Reviewed-by: rriggs --- src/java.base/share/classes/java/util/UUID.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/java.base/share/classes/java/util/UUID.java b/src/java.base/share/classes/java/util/UUID.java index 85fd26b915c..89740905324 100644 --- a/src/java.base/share/classes/java/util/UUID.java +++ b/src/java.base/share/classes/java/util/UUID.java @@ -468,8 +468,7 @@ public final class UUID implements java.io.Serializable, Comparable { */ @Override public int hashCode() { - long hilo = mostSigBits ^ leastSigBits; - return ((int)(hilo >> 32)) ^ (int) hilo; + return Long.hashCode(mostSigBits ^ leastSigBits); } /** -- GitLab From 71c4b195178029f5414fa45d2c5ac70a1d2536e5 Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Mon, 8 Nov 2021 13:45:23 +0000 Subject: [PATCH 240/890] 8276562: Fix to JDK-8263155 left out the help text changes Reviewed-by: asemenyuk, almatvee --- .../share/classes/jdk/jpackage/internal/CLIHelp.java | 5 +++-- .../jpackage/internal/resources/HelpResources.properties | 5 +++++ .../jpackage/internal/resources/HelpResources_ja.properties | 6 ++++++ .../internal/resources/HelpResources_zh_CN.properties | 6 ++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java index d9ee8d81bfd..b477de645df 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java @@ -56,7 +56,7 @@ public class CLIHelp { case MAC: types = "{\"app-image\", \"dmg\", \"pkg\"}"; pLaunchOptions = I18N.getString("MSG_Help_mac_launcher"); - pInstallOptions = ""; + pInstallOptions = I18N.getString("MSG_Help_mac_install"); pInstallDir = I18N.getString("MSG_Help_mac_linux_install_dir"); break; @@ -79,7 +79,8 @@ public class CLIHelp { pLaunchOptions = I18N.getString("MSG_Help_win_launcher") + I18N.getString("MSG_Help_mac_launcher"); pInstallOptions = I18N.getString("MSG_Help_win_install") - + I18N.getString("MSG_Help_linux_install"); + + I18N.getString("MSG_Help_linux_install") + + I18N.getString("MSG_Help_mac_install"); pInstallDir = I18N.getString("MSG_Help_default_install_dir"); break; diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties index e4784751566..27f0a491c2a 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties @@ -233,6 +233,11 @@ MSG_Help_win_install=\ MSG_Help_win_install_dir=\ \Relative sub-path under the default installation location\n\ +MSG_Help_mac_install=\ +\ --mac-dmg-content [,...]\n\ +\ Include all the referenced content in the dmg.\n\ +\ This option can be used multiple times. \n\ + MSG_Help_mac_launcher=\ \ --mac-package-identifier \n\ \ An identifier that uniquely identifies the application for macOS\n\ diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties index 8e88994cb1f..b241ab8403d 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties @@ -225,6 +225,12 @@ MSG_Help_win_install=\ \ UUID associated with upgrades for this package\n\ MSG_Help_win_install_dir=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u5834\u6240\u306E\u4E0B\u306E\u76F8\u5BFE\u30B5\u30D6\u30D1\u30B9\n + +MSG_Help_mac_install=\ +\ --mac-dmg-content [,...]\n\ +\ Include all the referenced content in the dmg.\n\ +\ This option can be used multiple times. \n\ + MSG_Help_mac_launcher=\ --mac-package-identifier \n MacOS\u306E\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u4E00\u610F\u306B\u8B58\u5225\u3059\u308BID\n \u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u540D\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n \u82F1\u6570\u5B57(A-Z\u3001a-z\u30010-9)\u3001\u30CF\u30A4\u30D5\u30F3(-)\n \u304A\u3088\u3073\u30D4\u30EA\u30AA\u30C9(.)\u6587\u5B57\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002\n --mac-package-name \n \u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u540D\u524D\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3068\u306F\u7570\u306A\u308A\u307E\u3059\u3002\n \u3053\u306E\u540D\u524D\u306F16\u6587\u5B57\u672A\u6E80\u306B\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u3001\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC\n \u304A\u3088\u3073\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u60C5\u5831\u30A6\u30A3\u30F3\u30C9\u30A6\u306B\u8868\u793A\u3059\u308B\u306E\u306B\u9069\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u306B\u30C7\u30D5\u30A9\u30EB\u30C8\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n --mac-package-signing-prefix \n \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u30FB\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u7F72\u540D\u3059\u308B\u969B\u3001\u65E2\u5B58\u306E\u30D1\u30C3\u30B1\u30FC\u30B8ID\u306E\u306A\u3044\n \u7F72\u540D\u304C\u5FC5\u8981\u306A\u3059\u3079\u3066\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306B\u3001\n \u3053\u306E\u5024\u304C\u63A5\u982D\u8F9E\u3068\u3057\u3066\u4ED8\u3051\u3089\u308C\u307E\u3059\u3002\n --mac-sign\n \u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u7F72\u540D\u3059\u308B\u3088\u3046\u30EA\u30AF\u30A8\u30B9\u30C8\u3057\u307E\u3059\n \n\ \ --mac-signing-keychain \n\ \ Name of the keychain to search for the signing identity\n\ diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties index 6a18294edbc..09de3241d1b 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties @@ -224,6 +224,12 @@ MSG_Help_win_install=\ \ UUID associated with upgrades for this package\n\ MSG_Help_win_install_dir=\u9ED8\u8BA4\u5B89\u88C5\u4F4D\u7F6E\u4E0B\u9762\u7684\u76F8\u5BF9\u5B50\u8DEF\u5F84\n + +MSG_Help_mac_install=\ +\ --mac-dmg-content [,...]\n\ +\ Include all the referenced content in the dmg.\n\ +\ This option can be used multiple times. \n\ + MSG_Help_mac_launcher=\ --mac-package-identifier \n \u7528\u6765\u552F\u4E00\u5730\u6807\u8BC6 macOS \u5E94\u7528\u7A0B\u5E8F\u7684\u6807\u8BC6\u7B26\n \u9ED8\u8BA4\u4E3A\u4E3B\u7C7B\u540D\u79F0\u3002\n \u53EA\u80FD\u4F7F\u7528\u5B57\u6BCD\u6570\u5B57\uFF08A-Z\u3001a-z\u30010-9\uFF09\u3001\u8FDE\u5B57\u7B26 (-) \u548C\n \u53E5\u70B9 (.) \u5B57\u7B26\u3002\n --mac-package-name \n \u51FA\u73B0\u5728\u83DC\u5355\u680F\u4E2D\u7684\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\n \u8FD9\u53EF\u4EE5\u4E0E\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u4E0D\u540C\u3002\n \u6B64\u540D\u79F0\u7684\u957F\u5EA6\u5FC5\u987B\u5C0F\u4E8E 16 \u4E2A\u5B57\u7B26\uFF0C\u9002\u5408\n \u663E\u793A\u5728\u83DC\u5355\u680F\u4E2D\u548C\u5E94\u7528\u7A0B\u5E8F\u201C\u4FE1\u606F\u201D\u7A97\u53E3\u4E2D\u3002\n \u9ED8\u8BA4\u4E3A\u5E94\u7528\u7A0B\u5E8F\u540D\u79F0\u3002\n --mac-package-signing-prefix \n \u5728\u5BF9\u5E94\u7528\u7A0B\u5E8F\u5305\u7B7E\u540D\u65F6\uFF0C\u4F1A\u5728\u6240\u6709\u9700\u8981\u7B7E\u540D\n \u4F46\u5F53\u524D\u6CA1\u6709\u7A0B\u5E8F\u5305\u6807\u8BC6\u7B26\u7684\u7EC4\u4EF6\u7684\n \u524D\u9762\u52A0\u4E0A\u6B64\u503C\u3002\n --mac-sign\n \u8BF7\u6C42\u5BF9\u7A0B\u5E8F\u5305\u8FDB\u884C\u7B7E\u540D\n\ \ --mac-signing-keychain \n\ \ Name of the keychain to search for the signing identity\n\ -- GitLab From c815c5cbbb0b6a2aebd0a38cb930c74bd665d082 Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Mon, 8 Nov 2021 14:30:54 +0000 Subject: [PATCH 241/890] 8276209: Some call sites doesn't pass the parameter 'size' to SharedRuntime::dtrace_object_alloc(_base) Reviewed-by: dholmes, coleenp --- src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp | 2 +- src/hotspot/cpu/aarch64/templateTable_aarch64.cpp | 2 +- src/hotspot/cpu/arm/templateTable_arm.cpp | 2 +- src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp | 2 +- src/hotspot/cpu/ppc/templateTable_ppc_64.cpp | 2 +- src/hotspot/cpu/s390/c1_Runtime1_s390.cpp | 2 +- src/hotspot/cpu/s390/templateTable_s390.cpp | 2 +- src/hotspot/cpu/x86/c1_Runtime1_x86.cpp | 2 +- src/hotspot/cpu/x86/templateTable_x86.cpp | 2 +- src/hotspot/share/gc/shared/memAllocator.cpp | 2 +- src/hotspot/share/opto/macro.cpp | 3 ++- src/hotspot/share/runtime/sharedRuntime.cpp | 10 +++++++--- src/hotspot/share/runtime/sharedRuntime.hpp | 5 +++-- 13 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp index e02989c1e9f..005f739f0aa 100644 --- a/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp @@ -1091,7 +1091,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments); save_live_registers(sasm); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), c_rarg0); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)), c_rarg0); restore_live_registers(sasm); } diff --git a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp index aff2d284c57..39e99bdd5ed 100644 --- a/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp @@ -3563,7 +3563,7 @@ void TemplateTable::_new() { // Trigger dtrace event for fastpath __ push(atos); // save the return value __ call_VM_leaf( - CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), r0); + CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)), r0); __ pop(atos); // restore the return value } diff --git a/src/hotspot/cpu/arm/templateTable_arm.cpp b/src/hotspot/cpu/arm/templateTable_arm.cpp index 85bf0ce812e..125a82181d9 100644 --- a/src/hotspot/cpu/arm/templateTable_arm.cpp +++ b/src/hotspot/cpu/arm/templateTable_arm.cpp @@ -3985,7 +3985,7 @@ void TemplateTable::_new() { __ cbz(Rtemp, Lcontinue); __ push(atos); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), Robj); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)), Robj); __ pop(atos); __ bind(Lcontinue); diff --git a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp index 469e36c12b1..485ab506597 100644 --- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp @@ -694,7 +694,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // save_live_registers(sasm); // // __ save_thread(L7_thread_cache); -// __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), +// __ call(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)), // relocInfo::runtime_call_type); // __ delayed()->mov(I0, O0); // __ restore_thread(L7_thread_cache); diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp index 124cb66cc5d..71361f983e9 100644 --- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp @@ -3803,7 +3803,7 @@ void TemplateTable::_new() { // Check and trigger dtrace event. SkipIfEqualZero::skip_to_label_if_equal_zero(_masm, Rscratch, &DTraceAllocProbes, Ldone); __ push(atos); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc)); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc))); __ pop(atos); __ b(Ldone); diff --git a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp index 68f4597ee4a..77329cdefd9 100644 --- a/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp +++ b/src/hotspot/cpu/s390/c1_Runtime1_s390.cpp @@ -667,7 +667,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { save_live_registers(sasm, 1); __ NOT_LP64(push(rax)) LP64_ONLY(mov(c_rarg0, rax)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc))); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)))); NOT_LP64(__ pop(rax)); restore_live_registers(sasm); diff --git a/src/hotspot/cpu/s390/templateTable_s390.cpp b/src/hotspot/cpu/s390/templateTable_s390.cpp index 49eab73a198..8b17bfc40ec 100644 --- a/src/hotspot/cpu/s390/templateTable_s390.cpp +++ b/src/hotspot/cpu/s390/templateTable_s390.cpp @@ -3822,7 +3822,7 @@ void TemplateTable::_new() { SkipIfEqual skip(_masm, &DTraceAllocProbes, false, Z_ARG5 /*scratch*/); // Trigger dtrace event for fastpath. __ push(atos); // Save the return value. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), RallocatedObject); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)), RallocatedObject); __ pop(atos); // Restore the return value. } __ z_bru(done); diff --git a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp index d0c356c4626..595e78dc257 100644 --- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp +++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp @@ -1497,7 +1497,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { save_live_registers(sasm, 1); __ NOT_LP64(push(rax)) LP64_ONLY(mov(c_rarg0, rax)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc))); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)))); NOT_LP64(__ pop(rax)); restore_live_registers(sasm); diff --git a/src/hotspot/cpu/x86/templateTable_x86.cpp b/src/hotspot/cpu/x86/templateTable_x86.cpp index d2eaa242769..19530b7c57c 100644 --- a/src/hotspot/cpu/x86/templateTable_x86.cpp +++ b/src/hotspot/cpu/x86/templateTable_x86.cpp @@ -4038,7 +4038,7 @@ void TemplateTable::_new() { // Trigger dtrace event for fastpath __ push(atos); __ call_VM_leaf( - CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax); + CAST_FROM_FN_PTR(address, static_cast(SharedRuntime::dtrace_object_alloc)), rax); __ pop(atos); } diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp index 7a314807af6..1aacb030884 100644 --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -239,7 +239,7 @@ void MemAllocator::Allocation::notify_allocation_dtrace_sampler() { Klass* klass = obj()->klass(); size_t word_size = _allocator._word_size; if (klass != NULL && klass->name() != NULL) { - SharedRuntime::dtrace_object_alloc(obj(), (int)word_size); + SharedRuntime::dtrace_object_alloc(Thread::current(), obj(), word_size); } } } diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp index 630452179eb..f7b6a9ea66b 100644 --- a/src/hotspot/share/opto/macro.cpp +++ b/src/hotspot/share/opto/macro.cpp @@ -1635,7 +1635,8 @@ void PhaseMacroExpand::expand_dtrace_alloc_probe(AllocateNode* alloc, Node* oop, // Slow-path call int size = TypeFunc::Parms + 2; CallLeafNode *call = new CallLeafNode(OptoRuntime::dtrace_object_alloc_Type(), - CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc_base), + CAST_FROM_FN_PTR(address, + static_cast(SharedRuntime::dtrace_object_alloc)), "dtrace_object_alloc", TypeRawPtr::BOTTOM); diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 10ff60d64f4..c4f95bad54e 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -1001,11 +1001,15 @@ jlong SharedRuntime::get_java_tid(Thread* thread) { * it gets turned into a tail-call on sparc, which runs into dtrace bug * 6254741. Once that is fixed we can remove the dummy return value. */ -int SharedRuntime::dtrace_object_alloc(oopDesc* o, int size) { - return dtrace_object_alloc_base(Thread::current(), o, size); +int SharedRuntime::dtrace_object_alloc(oopDesc* o) { + return dtrace_object_alloc(Thread::current(), o, o->size()); } -int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o, int size) { +int SharedRuntime::dtrace_object_alloc(Thread* thread, oopDesc* o) { + return dtrace_object_alloc(thread, o, o->size()); +} + +int SharedRuntime::dtrace_object_alloc(Thread* thread, oopDesc* o, size_t size) { assert(DTraceAllocProbes, "wrong call"); Klass* klass = o->klass(); Symbol* name = klass->name(); diff --git a/src/hotspot/share/runtime/sharedRuntime.hpp b/src/hotspot/share/runtime/sharedRuntime.hpp index aaae54affe1..423e52df6e7 100644 --- a/src/hotspot/share/runtime/sharedRuntime.hpp +++ b/src/hotspot/share/runtime/sharedRuntime.hpp @@ -271,8 +271,9 @@ class SharedRuntime: AllStatic { static void register_finalizer(JavaThread* thread, oopDesc* obj); // dtrace notifications - static int dtrace_object_alloc(oopDesc* o, int size); - static int dtrace_object_alloc_base(Thread* thread, oopDesc* o, int size); + static int dtrace_object_alloc(oopDesc* o); + static int dtrace_object_alloc(Thread* thread, oopDesc* o); + static int dtrace_object_alloc(Thread* thread, oopDesc* o, size_t size); static int dtrace_method_entry(JavaThread* thread, Method* m); static int dtrace_method_exit(JavaThread* thread, Method* m); -- GitLab From ea23e7333e03abb4aca3e9f3854bab418a4b70e2 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Mon, 8 Nov 2021 14:45:04 +0000 Subject: [PATCH 242/890] 8249004: Reduce ThreadsListHandle overhead in relation to direct handshakes Reviewed-by: coleenp, sspitsyn, dholmes, rehn --- src/hotspot/share/prims/jvmtiEnv.cpp | 2 +- .../share/prims/jvmtiEventController.cpp | 14 +++- src/hotspot/share/prims/whitebox.cpp | 35 ++++---- src/hotspot/share/runtime/handshake.cpp | 32 +++++-- src/hotspot/share/runtime/handshake.hpp | 10 +++ src/hotspot/share/runtime/thread.cpp | 83 ++++++++++--------- src/hotspot/share/runtime/thread.hpp | 8 +- 7 files changed, 115 insertions(+), 69 deletions(-) diff --git a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp index 5680e7d1670..84cd940a563 100644 --- a/src/hotspot/share/prims/jvmtiEnv.cpp +++ b/src/hotspot/share/prims/jvmtiEnv.cpp @@ -1560,7 +1560,7 @@ JvmtiEnv::GetThreadListStackTraces(jint thread_count, const jthread* thread_list } GetSingleStackTraceClosure op(this, current_thread, *thread_list, max_frame_count); - Handshake::execute(&op, java_thread); + Handshake::execute(&op, &tlh, java_thread); err = op.result(); if (err == JVMTI_ERROR_NONE) { *stack_info_ptr = op.stack_info(); diff --git a/src/hotspot/share/prims/jvmtiEventController.cpp b/src/hotspot/share/prims/jvmtiEventController.cpp index b085d47dd5f..088642f6736 100644 --- a/src/hotspot/share/prims/jvmtiEventController.cpp +++ b/src/hotspot/share/prims/jvmtiEventController.cpp @@ -616,8 +616,18 @@ JvmtiEventControllerPrivate::recompute_enabled() { } // compute and set thread-filtered events - for (JvmtiThreadState *state = JvmtiThreadState::first(); state != NULL; state = state->next()) { - any_env_thread_enabled |= recompute_thread_enabled(state); + JvmtiThreadState *state = JvmtiThreadState::first(); + if (state != nullptr) { + // If we have a JvmtiThreadState, then we've reached the point where + // threads can exist so create a ThreadsListHandle to protect them. + // The held JvmtiThreadState_lock prevents exiting JavaThreads from + // being removed from the JvmtiThreadState list we're about to walk + // so this ThreadsListHandle exists just to satisfy the lower level sanity + // checks that the target JavaThreads are protected. + ThreadsListHandle tlh; + for (; state != nullptr; state = state->next()) { + any_env_thread_enabled |= recompute_thread_enabled(state); + } } // set universal state (across all envs and threads) diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index e76968cab23..995123c1ef9 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -2070,10 +2070,13 @@ WB_ENTRY(jboolean, WB_HandshakeReadMonitors(JNIEnv* env, jobject wb, jobject thr }; ReadMonitorsClosure rmc; - oop thread_oop = JNIHandles::resolve(thread_handle); - if (thread_oop != NULL) { - JavaThread* target = java_lang_Thread::thread(thread_oop); - Handshake::execute(&rmc, target); + if (thread_handle != NULL) { + ThreadsListHandle tlh; + JavaThread* target = nullptr; + bool is_alive = tlh.cv_internal_thread_to_JavaThread(thread_handle, &target, NULL); + if (is_alive) { + Handshake::execute(&rmc, &tlh, target); + } } return rmc.executed(); WB_END @@ -2101,11 +2104,12 @@ WB_ENTRY(jint, WB_HandshakeWalkStack(JNIEnv* env, jobject wb, jobject thread_han if (all_threads) { Handshake::execute(&tsc); - } else { - oop thread_oop = JNIHandles::resolve(thread_handle); - if (thread_oop != NULL) { - JavaThread* target = java_lang_Thread::thread(thread_oop); - Handshake::execute(&tsc, target); + } else if (thread_handle != NULL) { + ThreadsListHandle tlh; + JavaThread* target = nullptr; + bool is_alive = tlh.cv_internal_thread_to_JavaThread(thread_handle, &target, NULL); + if (is_alive) { + Handshake::execute(&tsc, &tlh, target); } } return tsc.num_threads_completed(); @@ -2129,11 +2133,14 @@ WB_ENTRY(void, WB_AsyncHandshakeWalkStack(JNIEnv* env, jobject wb, jobject threa public: TraceSelfClosure(JavaThread* self_target) : AsyncHandshakeClosure("WB_TraceSelf"), _self(self_target) {} }; - oop thread_oop = JNIHandles::resolve(thread_handle); - if (thread_oop != NULL) { - JavaThread* target = java_lang_Thread::thread(thread_oop); - TraceSelfClosure* tsc = new TraceSelfClosure(target); - Handshake::execute(tsc, target); + if (thread_handle != NULL) { + ThreadsListHandle tlh; + JavaThread* target = nullptr; + bool is_alive = tlh.cv_internal_thread_to_JavaThread(thread_handle, &target, NULL); + if (is_alive) { + TraceSelfClosure* tsc = new TraceSelfClosure(target); + Handshake::execute(tsc, target); + } } WB_END diff --git a/src/hotspot/share/runtime/handshake.cpp b/src/hotspot/share/runtime/handshake.cpp index f4c9c775b02..6d3d4d55bdd 100644 --- a/src/hotspot/share/runtime/handshake.cpp +++ b/src/hotspot/share/runtime/handshake.cpp @@ -342,13 +342,23 @@ void Handshake::execute(HandshakeClosure* hs_cl) { } void Handshake::execute(HandshakeClosure* hs_cl, JavaThread* target) { + // tlh == nullptr means we rely on a ThreadsListHandle somewhere + // in the caller's context (and we sanity check for that). + Handshake::execute(hs_cl, nullptr, target); +} + +void Handshake::execute(HandshakeClosure* hs_cl, ThreadsListHandle* tlh, JavaThread* target) { JavaThread* self = JavaThread::current(); HandshakeOperation op(hs_cl, target, Thread::current()); jlong start_time_ns = os::javaTimeNanos(); - ThreadsListHandle tlh; - if (tlh.includes(target)) { + guarantee(target != nullptr, "must be"); + if (tlh == nullptr) { + guarantee(Thread::is_JavaThread_protected(target, /* checkTLHOnly */ true), + "missing ThreadsListHandle in calling context."); + target->handshake_state()->add_operation(&op); + } else if (tlh->includes(target)) { target->handshake_state()->add_operation(&op); } else { char buf[128]; @@ -396,13 +406,19 @@ void Handshake::execute(AsyncHandshakeClosure* hs_cl, JavaThread* target) { jlong start_time_ns = os::javaTimeNanos(); AsyncHandshakeOperation* op = new AsyncHandshakeOperation(hs_cl, target, start_time_ns); - ThreadsListHandle tlh; - if (tlh.includes(target)) { - target->handshake_state()->add_operation(op); - } else { - log_handshake_info(start_time_ns, op->name(), 0, 0, "(thread dead)"); - delete op; + guarantee(target != nullptr, "must be"); + + Thread* current = Thread::current(); + if (current != target) { + // Another thread is handling the request and it must be protecting + // the target. + guarantee(Thread::is_JavaThread_protected(target, /* checkTLHOnly */ true), + "missing ThreadsListHandle in calling context."); } + // Implied else: + // The target is handling the request itself so it can't be dead. + + target->handshake_state()->add_operation(op); } HandshakeState::HandshakeState(JavaThread* target) : diff --git a/src/hotspot/share/runtime/handshake.hpp b/src/hotspot/share/runtime/handshake.hpp index b0145fee7e5..f66c731cc2d 100644 --- a/src/hotspot/share/runtime/handshake.hpp +++ b/src/hotspot/share/runtime/handshake.hpp @@ -36,6 +36,7 @@ class HandshakeOperation; class JavaThread; class SuspendThreadHandshake; class ThreadSelfSuspensionHandshake; +class ThreadsListHandle; // A handshake closure is a callback that is executed for a JavaThread // while it is in a safepoint/handshake-safe state. Depending on the @@ -64,7 +65,16 @@ class Handshake : public AllStatic { public: // Execution of handshake operation static void execute(HandshakeClosure* hs_cl); + // This version of execute() relies on a ThreadListHandle somewhere in + // the caller's context to protect target (and we sanity check for that). static void execute(HandshakeClosure* hs_cl, JavaThread* target); + // This version of execute() is used when you have a ThreadListHandle in + // hand and are using it to protect target. If tlh == nullptr, then we + // sanity check for a ThreadListHandle somewhere in the caller's context + // to verify that target is protected. + static void execute(HandshakeClosure* hs_cl, ThreadsListHandle* tlh, JavaThread* target); + // This version of execute() relies on a ThreadListHandle somewhere in + // the caller's context to protect target (and we sanity check for that). static void execute(AsyncHandshakeClosure* hs_cl, JavaThread* target); }; diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index a2a41754ede..f570509ecd1 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -435,30 +435,35 @@ void Thread::check_for_dangling_thread_pointer(Thread *thread) { } #endif -// Is the target JavaThread protected by the calling Thread -// or by some other mechanism: -bool Thread::is_JavaThread_protected(const JavaThread* p) { - // Do the simplest check first: - if (SafepointSynchronize::is_at_safepoint()) { - // The target is protected since JavaThreads cannot exit - // while we're at a safepoint. - return true; - } +// Is the target JavaThread protected by the calling Thread or by some other +// mechanism? If checkTLHOnly is true (default is false), then we only check +// if the target JavaThread is protected by a ThreadsList (if any) associated +// with the calling Thread. +// +bool Thread::is_JavaThread_protected(const JavaThread* p, bool checkTLHOnly) { + Thread* current_thread = Thread::current(); + if (!checkTLHOnly) { + // Do the simplest check first: + if (SafepointSynchronize::is_at_safepoint()) { + // The target is protected since JavaThreads cannot exit + // while we're at a safepoint. + return true; + } - // If the target hasn't been started yet then it is trivially - // "protected". We assume the caller is the thread that will do - // the starting. - if (p->osthread() == NULL || p->osthread()->get_state() <= INITIALIZED) { - return true; - } + // If the target hasn't been started yet then it is trivially + // "protected". We assume the caller is the thread that will do + // the starting. + if (p->osthread() == NULL || p->osthread()->get_state() <= INITIALIZED) { + return true; + } - // Now make the simple checks based on who the caller is: - Thread* current_thread = Thread::current(); - if (current_thread == p || Threads_lock->owner() == current_thread) { - // Target JavaThread is self or calling thread owns the Threads_lock. - // Second check is the same as Threads_lock->owner_is_self(), - // but we already have the current thread so check directly. - return true; + // Now make the simple checks based on who the caller is: + if (current_thread == p || Threads_lock->owner() == current_thread) { + // Target JavaThread is self or calling thread owns the Threads_lock. + // Second check is the same as Threads_lock->owner_is_self(), + // but we already have the current thread so check directly. + return true; + } } // Check the ThreadsLists associated with the calling thread (if any) @@ -471,16 +476,18 @@ bool Thread::is_JavaThread_protected(const JavaThread* p) { } } - // Use this debug code with -XX:+UseNewCode to diagnose locations that - // are missing a ThreadsListHandle or other protection mechanism: - // guarantee(!UseNewCode, "current_thread=" INTPTR_FORMAT " is not protecting p=" - // INTPTR_FORMAT, p2i(current_thread), p2i(p)); + if (!checkTLHOnly) { + // Use this debug code with -XX:+UseNewCode to diagnose locations that + // are missing a ThreadsListHandle or other protection mechanism: + // guarantee(!UseNewCode, "current_thread=" INTPTR_FORMAT " is not protecting p=" + // INTPTR_FORMAT, p2i(current_thread), p2i(p)); - // Note: Since 'p' isn't protected by a TLH, the call to - // p->is_handshake_safe_for() may crash, but we have debug bits so - // we'll be able to figure out what protection mechanism is missing. - assert(p->is_handshake_safe_for(current_thread), "JavaThread=" INTPTR_FORMAT - " is not protected and not handshake safe.", p2i(p)); + // Note: Since 'p' isn't protected by a TLH, the call to + // p->is_handshake_safe_for() may crash, but we have debug bits so + // we'll be able to figure out what protection mechanism is missing. + assert(p->is_handshake_safe_for(current_thread), "JavaThread=" INTPTR_FORMAT + " is not protected and not handshake safe.", p2i(p)); + } // The target JavaThread is not protected so it is not safe to query: return false; @@ -1743,20 +1750,14 @@ void JavaThread::send_thread_stop(oop java_throwable) { // - Target thread will not enter any new monitors. // bool JavaThread::java_suspend() { - ThreadsListHandle tlh; - if (!tlh.includes(this)) { - log_trace(thread, suspend)("JavaThread:" INTPTR_FORMAT " not on ThreadsList, no suspension", p2i(this)); - return false; - } + guarantee(Thread::is_JavaThread_protected(this, /* checkTLHOnly */ true), + "missing ThreadsListHandle in calling context."); return this->handshake_state()->suspend(); } bool JavaThread::java_resume() { - ThreadsListHandle tlh; - if (!tlh.includes(this)) { - log_trace(thread, suspend)("JavaThread:" INTPTR_FORMAT " not on ThreadsList, nothing to resume", p2i(this)); - return false; - } + guarantee(Thread::is_JavaThread_protected(this, /* checkTLHOnly */ true), + "missing ThreadsListHandle in calling context."); return this->handshake_state()->resume(); } diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index 9540b7855bb..247943ed8da 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -199,9 +199,11 @@ class Thread: public ThreadShadow { } public: - // Is the target JavaThread protected by the calling Thread - // or by some other mechanism: - static bool is_JavaThread_protected(const JavaThread* p); + // Is the target JavaThread protected by the calling Thread or by some other + // mechanism? If checkTLHOnly is true (default is false), then we only check + // if the target JavaThread is protected by a ThreadsList (if any) associated + // with the calling Thread. + static bool is_JavaThread_protected(const JavaThread* p, bool checkTLHOnly = false); void* operator new(size_t size) throw() { return allocate(size, true); } void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() { -- GitLab From 7320b77b3e451932ee8befa7af4b80593725761e Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 8 Nov 2021 15:00:31 +0000 Subject: [PATCH 243/890] 8276548: Use range based visitor for Howl-Full cards Reviewed-by: ayang, sjohanss --- .../gc/g1/g1CardSetContainers.inline.hpp | 6 ++---- src/hotspot/share/gc/g1/g1RemSet.cpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index 842e52e9ff7..e23386d4040 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -327,12 +327,10 @@ inline void G1CardSetHowl::iterate_cardset(CardSetPtr const card_set, uint index return; } case G1CardSet::CardSetHowl: { // actually FullCardSet + assert(card_set == G1CardSet::FullCardSet, "Must be"); if (found.start_iterate(G1GCPhaseTimes::MergeRSHowlFull)) { - assert(card_set == G1CardSet::FullCardSet, "Must be"); uint offset = index << config->log2_num_cards_in_howl_bitmap(); - for (uint i = 0; i < config->num_cards_in_howl_bitmap(); i++) { - found((offset | (uint)i)); - } + found(offset, config->num_cards_in_howl_bitmap()); } return; } diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index b64a6dcd254..123de75f916 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -123,7 +123,7 @@ class G1RemSetScanState : public CHeapObj { size_t _num_total_scan_chunks; // Total number of elements in _region_scan_chunks. uint8_t _scan_chunks_shift; // For conversion between card index and chunk index. public: - uint scan_chunk_size() const { return (uint)1 << _scan_chunks_shift; } + uint scan_chunk_size_in_cards() const { return (uint)1 << _scan_chunks_shift; } // Returns whether the chunk corresponding to the given region/card in region contain a // dirty card, i.e. actually needs scanning. @@ -368,10 +368,13 @@ public: return _next_dirty_regions->size() * HeapRegion::CardsPerRegion; } - void set_chunk_region_dirty(size_t const region_card_idx) { + void set_chunk_range_dirty(size_t const region_card_idx, size_t const card_length) { size_t chunk_idx = region_card_idx >> _scan_chunks_shift; - for (uint i = 0; i < _scan_chunks_per_region; i++) { - _region_scan_chunks[chunk_idx++] = true; + // Make sure that all chunks that contain the range are marked. Calculate the + // chunk of the last card that is actually marked. + size_t const end_chunk = (region_card_idx + card_length - 1) >> _scan_chunks_shift; + for (; chunk_idx <= end_chunk; chunk_idx++) { + _region_scan_chunks[chunk_idx] = true; } } @@ -751,7 +754,7 @@ public: } uint value() const { return _cur_claim; } - uint size() const { return _scan_state->scan_chunk_size(); } + uint size() const { return _scan_state->scan_chunk_size_in_cards(); } }; // Scans a heap region for dirty cards. @@ -1208,11 +1211,9 @@ class G1MergeHeapRootsTask : public WorkerTask { } void do_card_range(uint const start_card_idx, uint const length) { - assert(start_card_idx == 0, "must be"); - assert(length == HeapRegion::CardsPerRegion, "must be"); - size_t num_dirtied = _ct->mark_range_dirty(_region_base_idx, HeapRegion::CardsPerRegion); + size_t num_dirtied = _ct->mark_range_dirty(_region_base_idx + start_card_idx, length); _stats.inc_cards_dirty(num_dirtied); - _scan_state->set_chunk_region_dirty(_region_base_idx); + _scan_state->set_chunk_range_dirty(_region_base_idx + start_card_idx, length); } // Helper to merge the cards in the card set for the given region onto the card -- GitLab From 75adf54bdcc5e06fb8e8ca499a2f326d70b65f76 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 8 Nov 2021 15:35:27 +0000 Subject: [PATCH 244/890] 8276306: jdk/jshell/CustomInputToolBuilder.java fails intermittently on storage acquisition Reviewed-by: jlahoda --- test/langtools/jdk/jshell/CustomInputToolBuilder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/langtools/jdk/jshell/CustomInputToolBuilder.java b/test/langtools/jdk/jshell/CustomInputToolBuilder.java index a80f58daabe..3b3d5616a94 100644 --- a/test/langtools/jdk/jshell/CustomInputToolBuilder.java +++ b/test/langtools/jdk/jshell/CustomInputToolBuilder.java @@ -35,6 +35,7 @@ import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.PrintStream; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import jdk.jshell.tool.JavaShellToolBuilder; import org.testng.annotations.Test; @@ -88,6 +89,7 @@ public class CustomInputToolBuilder extends KullaTesting { .out(printOut, printOut, printOut) .interactiveTerminal(interactiveTerminal) .promptCapture(true) + .persistence(new HashMap<>()) .start("--no-startup"); String actual = new String(out.toByteArray()); -- GitLab From 7e73bca0b7a34af9fb73780491951539815651b4 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Mon, 8 Nov 2021 16:39:07 +0000 Subject: [PATCH 245/890] 8276408: Deprecate Runtime.exec methods with a single string command line argument Reviewed-by: alanb --- .../share/classes/java/lang/Runtime.java | 21 +++++++++++++++++++ .../jdk/java/lang/ProcessBuilder/Zombies.java | 9 +++++--- .../java/lang/RuntimeTests/exec/BadEnvp.java | 1 + .../lang/RuntimeTests/exec/ExecWithDir.java | 2 +- .../java/lang/RuntimeTests/exec/SetCwd.java | 1 + 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java index 7948ebffb63..2288aca4d11 100644 --- a/src/java.base/share/classes/java/lang/Runtime.java +++ b/src/java.base/share/classes/java/lang/Runtime.java @@ -290,6 +290,12 @@ public class Runtime { * behaves in exactly the same way as the invocation * {@link #exec(String, String[], File) exec}{@code (command, null, null)}. * + * @deprecated This method is error-prone and should not be used, the corresponding method + * {@link #exec(String[])} or {@link ProcessBuilder} should be used instead. + * The command string is broken into tokens using only whitespace characters. + * For an argument with an embedded space, such as a filename, this can cause problems + * as the token does not include the full filename. + * * @param command a specified system command. * * @return A new {@link Process} object for managing the subprocess @@ -311,6 +317,7 @@ public class Runtime { * @see #exec(String[], String[], File) * @see ProcessBuilder */ + @Deprecated(since="18") public Process exec(String command) throws IOException { return exec(command, null, null); } @@ -324,6 +331,12 @@ public class Runtime { * behaves in exactly the same way as the invocation * {@link #exec(String, String[], File) exec}{@code (command, envp, null)}. * + * @deprecated This method is error-prone and should not be used, the corresponding method + * {@link #exec(String[], String[])} or {@link ProcessBuilder} should be used instead. + * The command string is broken into tokens using only whitespace characters. + * For an argument with an embedded space, such as a filename, this can cause problems + * as the token does not include the full filename. + * * @param command a specified system command. * * @param envp array of strings, each element of which @@ -352,6 +365,7 @@ public class Runtime { * @see #exec(String[], String[], File) * @see ProcessBuilder */ + @Deprecated(since="18") public Process exec(String command, String[] envp) throws IOException { return exec(command, envp, null); } @@ -374,6 +388,12 @@ public class Runtime { * produced by the tokenizer are then placed in the new string * array {@code cmdarray}, in the same order. * + * @deprecated This method is error-prone and should not be used, the corresponding method + * {@link #exec(String[], String[], File)} or {@link ProcessBuilder} should be used instead. + * The command string is broken into tokens using only whitespace characters. + * For an argument with an embedded space, such as a filename, this can cause problems + * as the token does not include the full filename. + * * @param command a specified system command. * * @param envp array of strings, each element of which @@ -406,6 +426,7 @@ public class Runtime { * @see ProcessBuilder * @since 1.3 */ + @Deprecated(since="18") public Process exec(String command, String[] envp, File dir) throws IOException { if (command.isEmpty()) diff --git a/test/jdk/java/lang/ProcessBuilder/Zombies.java b/test/jdk/java/lang/ProcessBuilder/Zombies.java index 25299608ea7..5a98250bce7 100644 --- a/test/jdk/java/lang/ProcessBuilder/Zombies.java +++ b/test/jdk/java/lang/ProcessBuilder/Zombies.java @@ -49,17 +49,20 @@ public class Zombies { final Runtime rt = Runtime.getRuntime(); try { - rt.exec("no-such-file"); + String[] cmd = {"no-such-file"}; + rt.exec(cmd); throw new Error("expected IOException not thrown"); } catch (IOException expected) {/* OK */} try { - rt.exec("."); + String[] cmd = {"."}; + rt.exec(cmd); throw new Error("expected IOException not thrown"); } catch (IOException expected) {/* OK */} try { - rt.exec(TrueCommand, null, new File("no-such-dir")); + String[] cmd = {TrueCommand}; + rt.exec(cmd, null, new File("no-such-dir")); throw new Error("expected IOException not thrown"); } catch (IOException expected) {/* OK */} diff --git a/test/jdk/java/lang/RuntimeTests/exec/BadEnvp.java b/test/jdk/java/lang/RuntimeTests/exec/BadEnvp.java index 1a5c9f8c9be..d216b65a840 100644 --- a/test/jdk/java/lang/RuntimeTests/exec/BadEnvp.java +++ b/test/jdk/java/lang/RuntimeTests/exec/BadEnvp.java @@ -29,6 +29,7 @@ public class BadEnvp { + @SuppressWarnings("deprecation") public static void main(String[] args) throws Exception { Runtime r = Runtime.getRuntime(); java.io.File dir = new java.io.File("."); diff --git a/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java b/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java index a52e2221ca8..4f2b723d180 100644 --- a/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java +++ b/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java @@ -41,7 +41,7 @@ public class ExecWithDir { } UnixCommands.ensureCommandsAvailable("true"); - final String trueCmd = UnixCommands.findCommand("true"); + final String[] trueCmd = {UnixCommands.findCommand("true")}; File dir = new File("."); for (int i = 1; i <= N; i++) { System.out.print(i); diff --git a/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java b/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java index 347c4d0eae3..a457b48b5e5 100644 --- a/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java +++ b/test/jdk/java/lang/RuntimeTests/exec/SetCwd.java @@ -62,6 +62,7 @@ public class SetCwd { @Test public void testRuntimeExecWithString() throws Exception { String cmd = String.join(" ", CMD_ARRAY); + @SuppressWarnings("deprecation") Process process = Runtime.getRuntime().exec(cmd, null, new File(TEST_CLASSES)); verifyProcessOutput(process); -- GitLab From e383d263610c7b4d4be2dce599a9043b8f76cd64 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Mon, 8 Nov 2021 19:13:22 +0000 Subject: [PATCH 246/890] 8275199: Bogus warning generated for serializable records Reviewed-by: hannesw --- .../toolkit/builders/ClassBuilder.java | 44 +++++-------- .../testRecordTypes/TestRecordTypes.java | 63 ++++++++++++++++--- .../{jdk11 => jdk17}/element-list | 22 ++++--- 3 files changed, 81 insertions(+), 48 deletions(-) rename test/langtools/jdk/javadoc/doclet/testRecordTypes/{jdk11 => jdk17}/element-list (95%) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java index af529ccc24a..7c2171330e5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java @@ -86,13 +86,8 @@ public class ClassBuilder extends AbstractBuilder { this.writer = writer; this.utils = configuration.utils; switch (typeElement.getKind()) { - case ENUM: - setEnumDocumentation(typeElement); - break; - - case RECORD: - setRecordDocumentation(typeElement); - break; + case ENUM -> setEnumDocumentation(typeElement); + case RECORD -> setRecordDocumentation(typeElement); } } @@ -119,27 +114,15 @@ public class ClassBuilder extends AbstractBuilder { * @throws DocletException if there is a problem while building the documentation */ protected void buildClassDoc() throws DocletException { - String key; - switch (typeElement.getKind()) { - case INTERFACE: - key = "doclet.Interface"; - break; - case ENUM: - key = "doclet.Enum"; - break; - case RECORD: - key = "doclet.RecordClass"; - break; - case ANNOTATION_TYPE: - key = "doclet.AnnotationType"; - break; - case CLASS: - key = "doclet.Class"; - break; - default: - throw new IllegalStateException(typeElement.getKind() + " " + typeElement); - } - Content contentTree = writer.getHeader(resources.getText(key) + " " + String key = switch (typeElement.getKind()) { + case INTERFACE -> "doclet.Interface"; + case ENUM -> "doclet.Enum"; + case RECORD -> "doclet.RecordClass"; + case ANNOTATION_TYPE -> "doclet.AnnotationType"; + case CLASS -> "doclet.Class"; + default -> throw new IllegalStateException(typeElement.getKind() + " " + typeElement); + }; + Content contentTree = writer.getHeader(resources.getText(key) + " " + utils.getSimpleName(typeElement)); Content classContentTree = writer.getClassContentHeader(); @@ -467,7 +450,10 @@ public class ClassBuilder extends AbstractBuilder { } } - for (VariableElement ve : utils.getFields(elem)) { + var fields = utils.isSerializable(elem) + ? utils.getFieldsUnfiltered(elem) + : utils.getFields(elem); + for (VariableElement ve : fields) { // The fields for the record component cannot be declared by the // user and so cannot have any pre-existing comment. Name name = ve.getSimpleName(); diff --git a/test/langtools/jdk/javadoc/doclet/testRecordTypes/TestRecordTypes.java b/test/langtools/jdk/javadoc/doclet/testRecordTypes/TestRecordTypes.java index 01f061ae23a..beaae848b96 100644 --- a/test/langtools/jdk/javadoc/doclet/testRecordTypes/TestRecordTypes.java +++ b/test/langtools/jdk/javadoc/doclet/testRecordTypes/TestRecordTypes.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8225055 8239804 8246774 8258338 8261976 + * @bug 8225055 8239804 8246774 8258338 8261976 8275199 * @summary Record types * @library /tools/lib ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -51,13 +51,11 @@ public class TestRecordTypes extends JavadocTester { private final ToolBox tb = new ToolBox(); - // The following constants are set up for use with -linkoffline - // (but note: JDK 11 does not include java.lang.Record, so expect - // some 404 broken links until we can update this to a stable version.) + // The following constants are set up for use with -linkoffline. private static final String externalDocs = - "https://docs.oracle.com/en/java/javase/11/docs/api"; + "https://docs.oracle.com/en/java/javase/17/docs/api"; private static final String localDocs = - Path.of(testSrc).resolve("jdk11").toUri().toString(); + Path.of(testSrc).resolve("jdk17").toUri().toString(); @Test public void testRecordKeywordUnnamedPackage(Path base) throws IOException { @@ -391,17 +389,17 @@ public class TestRecordTypes extends JavadocTester { } @Test - public void testExamples(Path base) throws IOException { + public void testExamples(Path base) { javadoc("-d", base.resolve("out-no-link").toString(), "-quiet", "-noindex", - "-sourcepath", testSrc.toString(), + "-sourcepath", testSrc, "-linksource", "examples"); checkExit(Exit.OK); javadoc("-d", base.resolve("out-with-link").toString(), "-quiet", "-noindex", - "-sourcepath", testSrc.toString(), + "-sourcepath", testSrc, "-linksource", "-linkoffline", externalDocs, localDocs, "examples"); @@ -560,4 +558,51 @@ public class TestRecordTypes extends JavadocTester {
      """); } + + @Test + public void testSerializableType(Path base) throws IOException { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + /** + * A point, + * @param x the x coord + * @param y the y coord + */ + public record Point(int x, int y) implements java.io.Serializable { }"""); + + javadoc("-d", base.resolve("out").toString(), + "-quiet", "-noindex", "--no-platform-links", + src.resolve("Point.java").toString()); + checkExit(Exit.OK); + + checkOutput(Output.OUT, false, + "warning: no comment"); + + checkOutput("serialized-form.html", true, + """ +
      +

      Record Class Point

      +
      class Point extends java.lang.Record implements java.io.Serializable
      +
        +
      • +
        +

        Serialized Fields

        +
          +
        • +
          x
          +
          int x
          +
          The field for the x record component.
          +
        • +
        • +
          y
          +
          int y
          +
          The field for the y record component.
          +
        • +
        +
        +
      • +
      +
      """); + } } diff --git a/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk11/element-list b/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list similarity index 95% rename from test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk11/element-list rename to test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list index 65e05f809c2..34e3d598edd 100644 --- a/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk11/element-list +++ b/test/langtools/jdk/javadoc/doclet/testRecordTypes/jdk17/element-list @@ -2,10 +2,12 @@ module:java.base java.io java.lang java.lang.annotation +java.lang.constant java.lang.invoke java.lang.module java.lang.ref java.lang.reflect +java.lang.runtime java.math java.net java.net.spi @@ -18,7 +20,6 @@ java.nio.file java.nio.file.attribute java.nio.file.spi java.security -java.security.acl java.security.cert java.security.interfaces java.security.spec @@ -35,6 +36,7 @@ java.util.concurrent.atomic java.util.concurrent.locks java.util.function java.util.jar +java.util.random java.util.regex java.util.spi java.util.stream @@ -131,6 +133,7 @@ javax.naming javax.naming.directory javax.naming.event javax.naming.ldap +javax.naming.ldap.spi javax.naming.spi module:java.net.http java.net.http @@ -138,7 +141,6 @@ module:java.prefs java.util.prefs module:java.rmi java.rmi -java.rmi.activation java.rmi.dgc java.rmi.registry java.rmi.server @@ -219,12 +221,14 @@ module:jdk.hotspot.agent module:jdk.httpserver com.sun.net.httpserver com.sun.net.httpserver.spi +module:jdk.incubator.foreign +jdk.incubator.foreign +module:jdk.incubator.vector +jdk.incubator.vector module:jdk.jartool com.sun.jarsigner jdk.security.jarsigner module:jdk.javadoc -com.sun.javadoc -com.sun.tools.javadoc jdk.javadoc.doclet module:jdk.jcmd module:jdk.jconsole @@ -241,6 +245,7 @@ module:jdk.jfr jdk.jfr jdk.jfr.consumer module:jdk.jlink +module:jdk.jpackage module:jdk.jshell jdk.jshell jdk.jshell.execution @@ -260,10 +265,8 @@ module:jdk.naming.rmi module:jdk.net jdk.net jdk.nio -module:jdk.pack -module:jdk.scripting.nashorn -jdk.nashorn.api.scripting -jdk.nashorn.api.tree +module:jdk.nio.mapmode +jdk.nio.mapmode module:jdk.sctp com.sun.nio.sctp module:jdk.security.auth @@ -278,5 +281,4 @@ org.w3c.dom.css org.w3c.dom.html org.w3c.dom.stylesheets org.w3c.dom.xpath -module:jdk.zipfs - +module:jdk.zipfs \ No newline at end of file -- GitLab From 905e3e88137d46f90de7034e9fc324e97af873a6 Mon Sep 17 00:00:00 2001 From: Eamonn McManus Date: Mon, 8 Nov 2021 19:57:44 +0000 Subject: [PATCH 247/890] 8231490: Ugly racy writes to ZipUtils.defaultBuf Reviewed-by: lancea --- src/java.base/share/classes/java/util/zip/Inflater.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/zip/Inflater.java b/src/java.base/share/classes/java/util/zip/Inflater.java index 18275ea6540..4294981bec6 100644 --- a/src/java.base/share/classes/java/util/zip/Inflater.java +++ b/src/java.base/share/classes/java/util/zip/Inflater.java @@ -419,7 +419,9 @@ public class Inflater { needDict = true; } if (input != null) { - input.position(inputPos + read); + if (read > 0) { + input.position(inputPos + read); + } } else { this.inputPos = inputPos + read; } -- GitLab From 14d66bd438dfa1feeafaca39be8f79a91e2968e9 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Mon, 8 Nov 2021 20:37:24 +0000 Subject: [PATCH 248/890] 8276654: element-list order is non deterministic Reviewed-by: ihse --- make/modules/jdk.javadoc/Gendata.gmk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/make/modules/jdk.javadoc/Gendata.gmk b/make/modules/jdk.javadoc/Gendata.gmk index c648df6e032..50ef87545a4 100644 --- a/make/modules/jdk.javadoc/Gendata.gmk +++ b/make/modules/jdk.javadoc/Gendata.gmk @@ -72,7 +72,9 @@ $(JDK_JAVADOC_DIR)/_element_lists.marker: \ $(MODULE_INFOS) $(call MakeTargetDir) $(call LogInfo, Creating javadoc element lists) - $(RM) -r $(ELEMENT_LISTS_DIR) + $(RM) $(ELEMENT_LISTS_DIR)/element-list-{$(call CommaList, \ + $(call sequence, $(GENERATE_SYMBOLS_FROM_JDK_VERSION), \ + $(JDK_SOURCE_TARGET_VERSION)))}.txt # Generate element-list files for JDK 11 to current-1 $(call ExecuteWithLog, $@_historic, \ $(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \ -- GitLab From a7dedb5f4761a7d0bc4db658d96d369b13b80620 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 8 Nov 2021 22:19:55 +0000 Subject: [PATCH 249/890] 8276772: Refine javax.lang.model docs Reviewed-by: iris, vromero --- .../classes/javax/lang/model/SourceVersion.java | 17 ++++++++++++----- .../lang/model/element/AnnotationMirror.java | 5 +++-- .../javax/lang/model/element/Element.java | 6 ++++-- .../lang/model/element/ElementVisitor.java | 5 +++-- .../model/element/RecordComponentElement.java | 3 ++- .../javax/lang/model/element/TypeElement.java | 1 + .../classes/javax/lang/model/type/NoType.java | 3 ++- .../classes/javax/lang/model/type/NullType.java | 3 ++- .../javax/lang/model/type/PrimitiveType.java | 3 ++- .../classes/javax/lang/model/util/Elements.java | 3 ++- 10 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index c1914b21782..32adcd11fff 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -59,10 +59,15 @@ public enum SourceVersion { * 10: local-variable type inference (var) * 11: local-variable syntax for lambda parameters * 12: no changes (switch expressions in preview) - * 13: no changes (switch expressions and text blocks in preview) + * 13: no changes (text blocks in preview; switch expressions in + * second preview) * 14: switch expressions (pattern matching and records in - * preview, text blocks in preview again) - * 15: text blocks (records and pattern matching in preview again) + * preview; text blocks in second preview) + * 15: text blocks (sealed classes in preview; records and pattern + * matching in second preview) + * 16: records and pattern matching (sealed classes in second preview) + * 17: sealed classes, floating-point always strict + * 18: TBD */ /** @@ -184,6 +189,7 @@ public enum SourceVersion { /** * The version recognized by the Java Platform, Standard Edition * 12. + * No major changes from the prior release. * * @since 12 */ @@ -192,6 +198,7 @@ public enum SourceVersion { /** * The version recognized by the Java Platform, Standard Edition * 13. + * No major changes from the prior release. * * @since 13 */ @@ -221,8 +228,8 @@ public enum SourceVersion { * The version recognized by the Java Platform, Standard Edition * 16. * - * Additions in this release include pattern matching for {@code - * instanceof} and records. + * Additions in this release include records and pattern matching + * for {@code instanceof}. * * @since 16 */ diff --git a/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java b/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java index 1f493cadbb2..e1c3a86883d 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/AnnotationMirror.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -58,7 +58,8 @@ public interface AnnotationMirror { * The order of the map matches the order in which the * values appear in the annotation's source. * - *

      Note that an annotation mirror of a marker annotation type + * @apiNote + * An annotation mirror of a marker annotation type * will by definition have an empty map. * *

      To fill in default values, use {@link diff --git a/src/java.compiler/share/classes/javax/lang/model/element/Element.java b/src/java.compiler/share/classes/javax/lang/model/element/Element.java index ac5840bf7af..0cb49fd985f 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/Element.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/Element.java @@ -117,8 +117,9 @@ public interface Element extends javax.lang.model.AnnotatedConstruct { /** * Returns the modifiers of this element, excluding annotations. - * Implicit modifiers, such as the {@code public} and {@code static} - * modifiers of interface members, are included. + * Implicit modifiers, such as the {@code public} and {@code + * static} modifiers of interface members (JLS section {@jls + * 9.3}), are included. * * @return the modifiers of this element, or an empty set if there are none */ @@ -230,6 +231,7 @@ public interface Element extends javax.lang.model.AnnotatedConstruct { * @see Elements#getAllMembers * @jls 8.8.9 Default Constructor * @jls 8.9 Enum Classes + * @jls 8.10 Record Classes * @revised 9 */ List getEnclosedElements(); diff --git a/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java b/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java index 44635fa62d3..e921a9ba2d6 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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,8 @@ import javax.lang.model.util.*; * *

      Methods to accommodate new language constructs are expected to * be added as default methods to provide strong source compatibility, - * as done for {@link visitModule visitModule}. The implementations of + * as done for {@link visitModule visitModule} and {@link + * visitRecordComponent visitRecordComponent}. The implementations of * the default methods will in turn call {@link visitUnknown * visitUnknown}, behavior that will be overridden in concrete * visitors supporting the source version with the new language diff --git a/src/java.compiler/share/classes/javax/lang/model/element/RecordComponentElement.java b/src/java.compiler/share/classes/javax/lang/model/element/RecordComponentElement.java index 85e71ac2fc5..d7c6009de13 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/RecordComponentElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/RecordComponentElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -28,6 +28,7 @@ package javax.lang.model.element; /** * Represents a record component. * + * @jls 8.10.1 Record Components * @since 16 */ public interface RecordComponentElement extends Element { diff --git a/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java b/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java index 3d73a937b78..ab6221b06d3 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/TypeElement.java @@ -108,6 +108,7 @@ public interface TypeElement extends Element, Parameterizable, QualifiedNameable * * @jls 8.8.9 Default Constructor * @jls 8.9.3 Enum Members + * @jls 8.10.3 Record Members */ @Override List getEnclosedElements(); diff --git a/src/java.compiler/share/classes/javax/lang/model/type/NoType.java b/src/java.compiler/share/classes/javax/lang/model/type/NoType.java index 1114722a601..2be7e4b9b28 100644 --- a/src/java.compiler/share/classes/javax/lang/model/type/NoType.java +++ b/src/java.compiler/share/classes/javax/lang/model/type/NoType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -44,6 +44,7 @@ import javax.lang.model.element.ExecutableElement; * @author Scott Seligman * @author Peter von der Ahé * @see ExecutableElement#getReturnType() + * @see javax.lang.model.util.Types#getNoType(TypeKind) * @since 1.6 */ diff --git a/src/java.compiler/share/classes/javax/lang/model/type/NullType.java b/src/java.compiler/share/classes/javax/lang/model/type/NullType.java index cc41a02990e..a846e07dc2e 100644 --- a/src/java.compiler/share/classes/javax/lang/model/type/NullType.java +++ b/src/java.compiler/share/classes/javax/lang/model/type/NullType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -35,6 +35,7 @@ package javax.lang.model.type; * @author Peter von der Ahé * @jls 3.10.7 The Null Literal * @jls 4.1 The Kinds of Types and Values + * @see javax.lang.model.util.Types#getNullType() * @since 1.6 */ diff --git a/src/java.compiler/share/classes/javax/lang/model/type/PrimitiveType.java b/src/java.compiler/share/classes/javax/lang/model/type/PrimitiveType.java index e91f1ef2998..343f4b61990 100644 --- a/src/java.compiler/share/classes/javax/lang/model/type/PrimitiveType.java +++ b/src/java.compiler/share/classes/javax/lang/model/type/PrimitiveType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -35,6 +35,7 @@ package javax.lang.model.type; * @author Scott Seligman * @author Peter von der Ahé * @jls 4.2 Primitive Types and Values + * @see javax.lang.model.util.Types#getPrimitiveType(TypeKind) * @since 1.6 */ public interface PrimitiveType extends TypeMirror { diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java index 1b856e784a0..f8071dd9844 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java @@ -427,6 +427,7 @@ public interface Elements { * * @jls 8.8.9 Default Constructor * @jls 8.9.3 Enum Members + * @jls 8.10.3 Record Members * @jls 9.6.3 Repeatable Annotation Types * @jls 9.7.5 Multiple Annotations of the Same Interface */ @@ -543,7 +544,7 @@ public interface Elements { * element and therefore {@code null} is returned for those kinds * of elements. * - * A {@link NestingKind#TOP_LEVEL top-level} class or + * A {@linkplain NestingKind#TOP_LEVEL top-level} class or * interface is its own outermost type element. * * @implSpec -- GitLab From 38e6d5d6ed967f68e6ac1bfaa285efa16577c790 Mon Sep 17 00:00:00 2001 From: Bradford Wetmore Date: Tue, 9 Nov 2021 01:11:18 +0000 Subject: [PATCH 250/890] 8276677: Malformed Javadoc inline tags in JDK source in javax/net/ssl Reviewed-by: jnimeh --- src/java.base/share/classes/javax/net/ssl/SSLEngine.java | 2 +- src/java.base/share/classes/javax/net/ssl/SSLSocket.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/javax/net/ssl/SSLEngine.java b/src/java.base/share/classes/javax/net/ssl/SSLEngine.java index fff674ca1fd..b3007b2a9a1 100644 --- a/src/java.base/share/classes/javax/net/ssl/SSLEngine.java +++ b/src/java.base/share/classes/javax/net/ssl/SSLEngine.java @@ -339,7 +339,7 @@ import java.util.function.BiFunction; * The ApplicationProtocol {@code String} values returned by the methods * in this class are in the network byte representation sent by the peer. * The bytes could be directly compared, or converted to its Unicode - * {code String} format for comparison. + * {@code String} format for comparison. * *

        *     String networkString = sslEngine.getHandshakeApplicationProtocol();
      diff --git a/src/java.base/share/classes/javax/net/ssl/SSLSocket.java b/src/java.base/share/classes/javax/net/ssl/SSLSocket.java
      index 7f44a4fe6c5..84e5be716fe 100644
      --- a/src/java.base/share/classes/javax/net/ssl/SSLSocket.java
      +++ b/src/java.base/share/classes/javax/net/ssl/SSLSocket.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 1997, 2021, 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
      @@ -133,7 +133,7 @@ import java.util.function.BiFunction;
        * 

      The ApplicationProtocol {@code String} values returned by the methods * in this class are in the network byte representation sent by the peer. * The bytes could be directly compared, or converted to its Unicode - * {code String} format for comparison. + * {@code String} format for comparison. * *

        *     String networkString = sslSocket.getHandshakeApplicationProtocol();
      -- 
      GitLab
      
      
      From 8747882e4cb3af58062923bf830f9de877bdb03d Mon Sep 17 00:00:00 2001
      From: Ioi Lam 
      Date: Tue, 9 Nov 2021 07:18:06 +0000
      Subject: [PATCH 251/890] 8276790: Rename
       GenericCDSFileMapHeader::_base_archive_path_offset
      
      Reviewed-by: dholmes, ccheung
      ---
       src/hotspot/share/cds/cdsConstants.cpp        |  2 +-
       src/hotspot/share/cds/filemap.cpp             | 42 +++++++++----------
       src/hotspot/share/cds/filemap.hpp             |  6 +--
       src/hotspot/share/include/cds.h               |  4 +-
       .../cds/appcds/SharedArchiveConsistency.java  | 18 ++++----
       .../dynamicArchive/ArchiveConsistency.java    | 34 +++++++--------
       .../lib/jdk/test/lib/cds/CDSArchiveUtils.java | 14 +++----
       7 files changed, 60 insertions(+), 60 deletions(-)
      
      diff --git a/src/hotspot/share/cds/cdsConstants.cpp b/src/hotspot/share/cds/cdsConstants.cpp
      index 5d8948b0ee0..7055b7fe337 100644
      --- a/src/hotspot/share/cds/cdsConstants.cpp
      +++ b/src/hotspot/share/cds/cdsConstants.cpp
      @@ -35,7 +35,7 @@ CDSConst CDSConstants::offsets[] = {
         { "GenericCDSFileMapHeader::_crc",                       offset_of(GenericCDSFileMapHeader, _crc)            },
         { "GenericCDSFileMapHeader::_version",                   offset_of(GenericCDSFileMapHeader, _version)        },
         { "GenericCDSFileMapHeader::_header_size",               offset_of(GenericCDSFileMapHeader, _header_size)    },
      -  { "GenericCDSFileMapHeader::_base_archive_path_offset",  offset_of(GenericCDSFileMapHeader, _base_archive_path_offset) },
      +  { "GenericCDSFileMapHeader::_base_archive_name_offset",  offset_of(GenericCDSFileMapHeader, _base_archive_name_offset) },
         { "GenericCDSFileMapHeader::_base_archive_name_size",    offset_of(GenericCDSFileMapHeader, _base_archive_name_size)   },
         { "CDSFileMapHeaderBase::_space[0]",                     offset_of(CDSFileMapHeaderBase, _space)             },
         { "FileMapHeader::_jvm_ident",                           offset_of(FileMapHeader, _jvm_ident)                },
      diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp
      index 5d77f2016c5..14eaa8a6abb 100644
      --- a/src/hotspot/share/cds/filemap.cpp
      +++ b/src/hotspot/share/cds/filemap.cpp
      @@ -196,7 +196,7 @@ void FileMapInfo::populate_header(size_t core_region_alignment) {
         size_t c_header_size;
         size_t header_size;
         size_t base_archive_name_size = 0;
      -  size_t base_archive_path_offset = 0;
      +  size_t base_archive_name_offset = 0;
         if (is_static()) {
           c_header_size = sizeof(FileMapHeader);
           header_size = c_header_size;
      @@ -207,7 +207,7 @@ void FileMapInfo::populate_header(size_t core_region_alignment) {
           if (!FLAG_IS_DEFAULT(SharedArchiveFile)) {
             base_archive_name_size = strlen(Arguments::GetSharedArchivePath()) + 1;
             header_size += base_archive_name_size;
      -      base_archive_path_offset = c_header_size;
      +      base_archive_name_offset = c_header_size;
           }
         }
         _header = (FileMapHeader*)os::malloc(header_size, mtInternal);
      @@ -216,17 +216,17 @@ void FileMapInfo::populate_header(size_t core_region_alignment) {
                           core_region_alignment,
                           header_size,
                           base_archive_name_size,
      -                    base_archive_path_offset);
      +                    base_archive_name_offset);
       }
       
       void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment,
                                    size_t header_size, size_t base_archive_name_size,
      -                             size_t base_archive_path_offset) {
      +                             size_t base_archive_name_offset) {
         // 1. We require _generic_header._magic to be at the beginning of the file
         // 2. FileMapHeader also assumes that _generic_header is at the beginning of the file
         assert(offset_of(FileMapHeader, _generic_header) == 0, "must be");
         set_header_size((unsigned int)header_size);
      -  set_base_archive_path_offset((unsigned int)base_archive_path_offset);
      +  set_base_archive_name_offset((unsigned int)base_archive_name_offset);
         set_base_archive_name_size((unsigned int)base_archive_name_size);
         set_magic(DynamicDumpSharedSpaces ? CDS_DYNAMIC_ARCHIVE_MAGIC : CDS_ARCHIVE_MAGIC);
         set_version(CURRENT_CDS_ARCHIVE_VERSION);
      @@ -280,9 +280,9 @@ void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment,
       
       void FileMapHeader::copy_base_archive_name(const char* archive) {
         assert(base_archive_name_size() != 0, "_base_archive_name_size not set");
      -  assert(base_archive_path_offset() != 0, "_base_archive_path_offset not set");
      +  assert(base_archive_name_offset() != 0, "_base_archive_name_offset not set");
         assert(header_size() > sizeof(*this), "_base_archive_name_size not included in header size?");
      -  memcpy((char*)this + base_archive_path_offset(), archive, base_archive_name_size());
      +  memcpy((char*)this + base_archive_name_offset(), archive, base_archive_name_size());
       }
       
       void FileMapHeader::print(outputStream* st) {
      @@ -292,7 +292,7 @@ void FileMapHeader::print(outputStream* st) {
         st->print_cr("- crc:                            0x%08x", crc());
         st->print_cr("- version:                        %d", version());
         st->print_cr("- header_size:                    " UINT32_FORMAT, header_size());
      -  st->print_cr("- base_archive_path_offset:       " UINT32_FORMAT, base_archive_path_offset());
      +  st->print_cr("- base_archive_name_offset:       " UINT32_FORMAT, base_archive_name_offset());
         st->print_cr("- base_archive_name_size:         " UINT32_FORMAT, base_archive_name_size());
       
         for (int i = 0; i < NUM_CDS_REGIONS; i++) {
      @@ -1088,7 +1088,7 @@ public:
           size_t name_size = _header._base_archive_name_size;
           assert(name_size != 0, "For non-default base archive, name size should be non-zero!");
           char* base_name = NEW_C_HEAP_ARRAY(char, name_size, mtInternal);
      -    lseek(_fd, _header._base_archive_path_offset, SEEK_SET); // position to correct offset.
      +    lseek(_fd, _header._base_archive_name_offset, SEEK_SET); // position to correct offset.
           size_t n = os::read(_fd, base_name, (unsigned int)name_size);
           if (n != name_size) {
             log_info(cds)("Unable to read base archive name from archive");
      @@ -1124,9 +1124,9 @@ bool FileMapInfo::check_archive(const char* archive_name, bool is_static) {
             vm_exit_during_initialization("Not a base shared archive", archive_name);
             return false;
           }
      -    if (header->_base_archive_path_offset != 0) {
      -      log_info(cds)("_base_archive_path_offset should be 0");
      -      log_info(cds)("_base_archive_path_offset = " UINT32_FORMAT, header->_base_archive_path_offset);
      +    if (header->_base_archive_name_offset != 0) {
      +      log_info(cds)("_base_archive_name_offset should be 0");
      +      log_info(cds)("_base_archive_name_offset = " UINT32_FORMAT, header->_base_archive_name_offset);
             return false;
           }
         } else {
      @@ -1135,12 +1135,12 @@ bool FileMapInfo::check_archive(const char* archive_name, bool is_static) {
             return false;
           }
           unsigned int name_size = header->_base_archive_name_size;
      -    unsigned int path_offset = header->_base_archive_path_offset;
      +    unsigned int name_offset = header->_base_archive_name_offset;
           unsigned int header_size = header->_header_size;
      -    if (path_offset + name_size != header_size) {
      -      log_info(cds)("_header_size should be equal to _base_archive_path_offset plus _base_archive_name_size");
      +    if (name_offset + name_size != header_size) {
      +      log_info(cds)("_header_size should be equal to _base_archive_name_offset plus _base_archive_name_size");
             log_info(cds)("  _base_archive_name_size   = " UINT32_FORMAT, name_size);
      -      log_info(cds)("  _base_archive_path_offset = " UINT32_FORMAT, path_offset);
      +      log_info(cds)("  _base_archive_name_offset = " UINT32_FORMAT, name_offset);
             log_info(cds)("  _header_size              = " UINT32_FORMAT, header_size);
             return false;
           }
      @@ -1165,13 +1165,13 @@ bool FileMapInfo::get_base_archive_name_from_header(const char* archive_name,
           return false;
         }
       
      -  if ((header->_base_archive_name_size == 0 && header->_base_archive_path_offset != 0) ||
      -      (header->_base_archive_name_size != 0 && header->_base_archive_path_offset == 0)) {
      +  if ((header->_base_archive_name_size == 0 && header->_base_archive_name_offset != 0) ||
      +      (header->_base_archive_name_size != 0 && header->_base_archive_name_offset == 0)) {
           fail_continue("Default base archive not set correct");
           return false;
         }
         if (header->_base_archive_name_size == 0 &&
      -      header->_base_archive_path_offset == 0) {
      +      header->_base_archive_name_offset == 0) {
           *base_archive_name = Arguments::get_default_shared_archive_path();
         } else {
           // read the base archive name
      @@ -1217,14 +1217,14 @@ bool FileMapInfo::init_from_file(int fd) {
           return false;
         }
       
      -  unsigned int base_offset = header()->base_archive_path_offset();
      +  unsigned int base_offset = header()->base_archive_name_offset();
         unsigned int name_size = header()->base_archive_name_size();
         unsigned int header_size = header()->header_size();
         if (base_offset != 0 && name_size != 0) {
           if (header_size != base_offset + name_size) {
             log_info(cds)("_header_size: " UINT32_FORMAT, header_size);
             log_info(cds)("base_archive_name_size: " UINT32_FORMAT, name_size);
      -      log_info(cds)("base_archive_path_offset: " UINT32_FORMAT, base_offset);
      +      log_info(cds)("base_archive_name_offset: " UINT32_FORMAT, base_offset);
             FileMapInfo::fail_continue("The shared archive file has an incorrect header size.");
             return false;
           }
      diff --git a/src/hotspot/share/cds/filemap.hpp b/src/hotspot/share/cds/filemap.hpp
      index 7708bbe7fa5..816ac5469dc 100644
      --- a/src/hotspot/share/cds/filemap.hpp
      +++ b/src/hotspot/share/cds/filemap.hpp
      @@ -243,14 +243,14 @@ public:
         int crc()                               const { return _generic_header._crc;      }
         int version()                           const { return _generic_header._version;  }
         unsigned int header_size()              const { return _generic_header._header_size;              }
      -  unsigned int base_archive_path_offset() const { return _generic_header._base_archive_path_offset; }
      +  unsigned int base_archive_name_offset() const { return _generic_header._base_archive_name_offset; }
         unsigned int base_archive_name_size()   const { return _generic_header._base_archive_name_size;   }
       
         void set_magic(unsigned int m)                    { _generic_header._magic = m;       }
         void set_crc(int crc_value)                       { _generic_header._crc = crc_value; }
         void set_version(int v)                           { _generic_header._version = v;     }
         void set_header_size(unsigned int s)              { _generic_header._header_size = s;              }
      -  void set_base_archive_path_offset(unsigned int s) { _generic_header._base_archive_path_offset = s; }
      +  void set_base_archive_name_offset(unsigned int s) { _generic_header._base_archive_name_offset = s; }
         void set_base_archive_name_size(unsigned int s)   { _generic_header._base_archive_name_size = s;   }
       
         size_t core_region_alignment()           const { return _core_region_alignment; }
      @@ -313,7 +313,7 @@ public:
         }
       
         void populate(FileMapInfo *info, size_t core_region_alignment, size_t header_size,
      -                size_t base_archive_name_size, size_t base_archive_path_offset);
      +                size_t base_archive_name_size, size_t base_archive_name_offset);
         static bool is_valid_region(int region) {
           return (0 <= region && region < NUM_CDS_REGIONS);
         }
      diff --git a/src/hotspot/share/include/cds.h b/src/hotspot/share/include/cds.h
      index 69f9758ea28..eeb45ba34c4 100644
      --- a/src/hotspot/share/include/cds.h
      +++ b/src/hotspot/share/include/cds.h
      @@ -67,12 +67,12 @@ typedef struct GenericCDSFileMapHeader {
         int          _crc;                      // header crc checksum
         int          _version;                  // CURRENT_CDS_ARCHIVE_VERSION of the jdk that dumped the this archive
         unsigned int _header_size;              // total size of the header, in bytes
      -  unsigned int _base_archive_path_offset; // offset where the base archive name is stored
      +  unsigned int _base_archive_name_offset; // offset where the base archive name is stored
                                                 //   static archive:  0
                                                 //   dynamic archive:
                                                 //     0 for default base archive
                                                 //     non-zero for non-default base archive
      -                                          //       (char*)this + _base_archive_path_offset
      +                                          //       (char*)this + _base_archive_name_offset
                                                 //       points to a 0-terminated string for the base archive name
         unsigned int _base_archive_name_size;   // size of base archive name including ending '\0'
                                                 //   static:  0
      diff --git a/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java b/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
      index d77ede12a12..57086f343b3 100644
      --- a/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
      +++ b/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java
      @@ -222,15 +222,15 @@ public class SharedArchiveConsistency {
               CDSArchiveUtils.modifyRegionContentRandomly(copiedJsa);
               testAndCheck(verifyExecArgs);
       
      -        // modify _base_archive_path_offet to non-zero
      -        System.out.println("\n8. modify _base_archive_path_offset to non-zero\n");
      -        String baseArchivePathOffsetName = startNewArchive("base-arhive-path-offset");
      -        copiedJsa = CDSArchiveUtils.copyArchiveFile(orgJsaFile, baseArchivePathOffsetName);
      -        int baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa);
      -        System.out.println("    baseArchivePathOffset = " + baseArchivePathOffset);
      -        CDSArchiveUtils.writeData(copiedJsa, CDSArchiveUtils.offsetBaseArchivePathOffset(), 1024);
      -        baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa);
      -        System.out.println("new baseArchivePathOffset = " + baseArchivePathOffset);
      +        // modify _base_archive_name_offet to non-zero
      +        System.out.println("\n8. modify _base_archive_name_offset to non-zero\n");
      +        String baseArchiveNameOffsetName = startNewArchive("base-arhive-path-offset");
      +        copiedJsa = CDSArchiveUtils.copyArchiveFile(orgJsaFile, baseArchiveNameOffsetName);
      +        int baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa);
      +        System.out.println("    baseArchiveNameOffset = " + baseArchiveNameOffset);
      +        CDSArchiveUtils.writeData(copiedJsa, CDSArchiveUtils.offsetBaseArchiveNameOffset(), 1024);
      +        baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa);
      +        System.out.println("new baseArchiveNameOffset = " + baseArchiveNameOffset);
               testAndCheck(verifyExecArgs);
           }
       }
      diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
      index d7ba51e509d..de723e6a13d 100644
      --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
      +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/ArchiveConsistency.java
      @@ -112,31 +112,31 @@ public class ArchiveConsistency extends DynamicArchiveTestBase {
               CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetHeaderSize(),  (int)copiedJsa.length() + 1024);
               runTwo(baseArchiveName, largerHeaderSize,
                      appJar, mainClass, 1,
      -               new String[] {"_header_size should be equal to _base_archive_path_offset plus _base_archive_name_size",
      +               new String[] {"_header_size should be equal to _base_archive_name_offset plus _base_archive_name_size",
                                    "Unable to use shared archive"});
       
               // 3. Make base archive path offset beyond of header size
               System.out.println("\n3. Make base archive path offset beyond of header size.");
      -        String wrongBaseArchivePathOffset = getNewArchiveName("wrongBaseArchivePathOffset");
      -        copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseArchivePathOffset);
      +        String wrongBaseArchiveNameOffset = getNewArchiveName("wrongBaseArchiveNameOffset");
      +        copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseArchiveNameOffset);
               int fileHeaderSize = (int)CDSArchiveUtils.fileHeaderSize(copiedJsa);
      -        int baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa);
      -        CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetBaseArchivePathOffset(), baseArchivePathOffset + 1024);
      -        runTwo(baseArchiveName, wrongBaseArchivePathOffset,
      +        int baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa);
      +        CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetBaseArchiveNameOffset(), baseArchiveNameOffset + 1024);
      +        runTwo(baseArchiveName, wrongBaseArchiveNameOffset,
                      appJar, mainClass, 1,
      -               new String[] {"_header_size should be equal to _base_archive_path_offset plus _base_archive_name_size",
      +               new String[] {"_header_size should be equal to _base_archive_name_offset plus _base_archive_name_size",
                                    "The shared archive file has an incorrect header size",
                                    "Unable to use shared archive"});
       
               // 4. Make base archive path offset points to middle of name size
               System.out.println("\n4. Make base archive path offset points to middle of name size");
      -        String wrongBasePathOffset = getNewArchiveName("wrongBasePathOffset");
      -        copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBasePathOffset);
      +        String wrongBaseNameOffset = getNewArchiveName("wrongBaseNameOffset");
      +        copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseNameOffset);
               int baseArchiveNameSize = CDSArchiveUtils.baseArchiveNameSize(copiedJsa);
      -        baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa);
      -        CDSArchiveUtils.modifyHeaderIntField(copiedJsa, baseArchivePathOffset,
      -                                             baseArchivePathOffset + baseArchiveNameSize/2);
      -        runTwo(baseArchiveName, wrongBasePathOffset,
      +        baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa);
      +        CDSArchiveUtils.modifyHeaderIntField(copiedJsa, baseArchiveNameOffset,
      +                                             baseArchiveNameOffset + baseArchiveNameSize/2);
      +        runTwo(baseArchiveName, wrongBaseNameOffset,
                      appJar, mainClass, 1,
                      new String[] {"An error has occurred while processing the shared archive file.",
                                    "Header checksum verification failed",
      @@ -146,9 +146,9 @@ public class ArchiveConsistency extends DynamicArchiveTestBase {
               System.out.println("\n5. Make base archive name not terminated with '\0'");
               String wrongBaseName = getNewArchiveName("wrongBaseName");
               copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseName);
      -        baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa);
      +        baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa);
               baseArchiveNameSize = CDSArchiveUtils.baseArchiveNameSize(copiedJsa);
      -        long offset = baseArchivePathOffset + baseArchiveNameSize - 1;  // end of line
      +        long offset = baseArchiveNameOffset + baseArchiveNameSize - 1;  // end of line
               CDSArchiveUtils.writeData(copiedJsa, offset, new byte[] {(byte)'X'});
       
               runTwo(baseArchiveName, wrongBaseName,
      @@ -160,9 +160,9 @@ public class ArchiveConsistency extends DynamicArchiveTestBase {
               System.out.println("\n6. Modify base archive name to a file that doesn't exist");
               String wrongBaseName2 = getNewArchiveName("wrongBaseName2");
               copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseName2);
      -        baseArchivePathOffset = CDSArchiveUtils.baseArchivePathOffset(copiedJsa);
      +        baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa);
               baseArchiveNameSize = CDSArchiveUtils.baseArchiveNameSize(copiedJsa);
      -        offset = baseArchivePathOffset + baseArchiveNameSize - 2;  // the "a" in ".jsa"
      +        offset = baseArchiveNameOffset + baseArchiveNameSize - 2;  // the "a" in ".jsa"
               CDSArchiveUtils.writeData(copiedJsa, offset, new byte[] {(byte)'b'}); // .jsa -> .jsb
       
               // Make sure it doesn't exist
      diff --git a/test/lib/jdk/test/lib/cds/CDSArchiveUtils.java b/test/lib/jdk/test/lib/cds/CDSArchiveUtils.java
      index 21f374a1c46..30b919d81c8 100644
      --- a/test/lib/jdk/test/lib/cds/CDSArchiveUtils.java
      +++ b/test/lib/jdk/test/lib/cds/CDSArchiveUtils.java
      @@ -50,7 +50,7 @@ public class CDSArchiveUtils {
           private static int offsetCrc;                  // offset of GenericCDSFileMapHeader::_crc
           private static int offsetVersion;              // offset of GenericCDSFileMapHeader::_version
           private static int offsetHeaderSize;           // offset of GenericCDSFileMapHeader::_header_size
      -    private static int offsetBaseArchivePathOffset;// offset of GenericCDSFileMapHeader::_base_archive_path_offset
      +    private static int offsetBaseArchiveNameOffset;// offset of GenericCDSFileMapHeader::_base_archive_name_offset
           private static int offsetBaseArchiveNameSize;  // offset of GenericCDSFileMapHeader::_base_archive_name_size
           private static int offsetJvmIdent;             // offset of FileMapHeader::_jvm_ident
           private static int spOffsetCrc;                // offset of CDSFileMapRegion::_crc
      @@ -87,7 +87,7 @@ public class CDSArchiveUtils {
                   offsetCrc = wb.getCDSOffsetForName("GenericCDSFileMapHeader::_crc");
                   offsetVersion = wb.getCDSOffsetForName("GenericCDSFileMapHeader::_version");
                   offsetHeaderSize = wb.getCDSOffsetForName("GenericCDSFileMapHeader::_header_size");
      -            offsetBaseArchivePathOffset = wb.getCDSOffsetForName("GenericCDSFileMapHeader::_base_archive_path_offset");
      +            offsetBaseArchiveNameOffset = wb.getCDSOffsetForName("GenericCDSFileMapHeader::_base_archive_name_offset");
                   offsetBaseArchiveNameSize = wb.getCDSOffsetForName("GenericCDSFileMapHeader::_base_archive_name_size");
                   offsetJvmIdent = wb.getCDSOffsetForName("FileMapHeader::_jvm_ident");
                   spOffsetCrc = wb.getCDSOffsetForName("CDSFileMapRegion::_crc");
      @@ -121,7 +121,7 @@ public class CDSArchiveUtils {
           public static int offsetCrc()                   { return offsetCrc;                   }
           public static int offsetVersion()               { return offsetVersion;               }
           public static int offsetHeaderSize()            { return offsetHeaderSize;            }
      -    public static int offsetBaseArchivePathOffset() { return offsetBaseArchivePathOffset; }
      +    public static int offsetBaseArchiveNameOffset() { return offsetBaseArchiveNameOffset; }
           public static int offsetBaseArchiveNameSize()   { return offsetBaseArchiveNameSize;   }
           public static int offsetJvmIdent()              { return offsetJvmIdent;              }
           public static int spOffsetCrc()                 { return spOffsetCrc;                 }
      @@ -148,8 +148,8 @@ public class CDSArchiveUtils {
               return alignUpWithAlignment(size);
           }
       
      -    public static int baseArchivePathOffset(File jsaFile) throws Exception {
      -        return (int)readInt(jsaFile, offsetBaseArchivePathOffset, 4);
      +    public static int baseArchiveNameOffset(File jsaFile) throws Exception {
      +        return (int)readInt(jsaFile, offsetBaseArchiveNameOffset, 4);
           }
       
           public static int baseArchiveNameSize(File jsaFile) throws Exception {
      @@ -158,8 +158,8 @@ public class CDSArchiveUtils {
       
           public static String baseArchiveName(File jsaFile) throws Exception {
               int size = baseArchiveNameSize(jsaFile);
      -        int baseArchivePathOffset = (int)readInt(jsaFile, offsetBaseArchivePathOffset, 4);
      -        return readString(jsaFile, baseArchivePathOffset, size - 1); // exclude terminating '\0'
      +        int baseArchiveNameOffset = (int)readInt(jsaFile, offsetBaseArchiveNameOffset, 4);
      +        return readString(jsaFile, baseArchiveNameOffset, size - 1); // exclude terminating '\0'
           }
       
           private static long alignUpWithAlignment(long l) {
      -- 
      GitLab
      
      
      From 945f4085e5c51f37c2048bb221a1521895ba28c6 Mon Sep 17 00:00:00 2001
      From: Stefan Johansson 
      Date: Tue, 9 Nov 2021 11:11:23 +0000
      Subject: [PATCH 252/890] 8276098: Do precise BOT updates in G1 evacuation
       phase
      
      Reviewed-by: tschatzl, ayang
      ---
       src/hotspot/share/gc/g1/g1AllocRegion.cpp     | 11 +--
       src/hotspot/share/gc/g1/g1AllocRegion.hpp     |  3 -
       .../share/gc/g1/g1AllocRegion.inline.hpp      | 18 ++---
       src/hotspot/share/gc/g1/g1Allocator.cpp       |  7 +-
       src/hotspot/share/gc/g1/g1Allocator.hpp       | 26 +++++++
       .../share/gc/g1/g1Allocator.inline.hpp        | 45 +++++++++++
       .../share/gc/g1/g1BlockOffsetTable.hpp        |  9 +++
       .../share/gc/g1/g1BlockOffsetTable.inline.hpp | 17 +++-
       src/hotspot/share/gc/g1/g1CollectedHeap.cpp   |  6 ++
       src/hotspot/share/gc/g1/g1CollectedHeap.hpp   |  2 +
       .../share/gc/g1/g1ParScanThreadState.cpp      |  5 ++
       src/hotspot/share/gc/g1/heapRegion.cpp        | 10 ++-
       src/hotspot/share/gc/g1/heapRegion.hpp        | 36 +++++----
       src/hotspot/share/gc/g1/heapRegion.inline.hpp | 77 +++++++++----------
       src/hotspot/share/gc/shared/plab.hpp          |  2 +-
       15 files changed, 192 insertions(+), 82 deletions(-)
      
      diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.cpp b/src/hotspot/share/gc/g1/g1AllocRegion.cpp
      index b3834c96c06..239822d6d1d 100644
      --- a/src/hotspot/share/gc/g1/g1AllocRegion.cpp
      +++ b/src/hotspot/share/gc/g1/g1AllocRegion.cpp
      @@ -43,10 +43,7 @@ void G1AllocRegion::setup(G1CollectedHeap* g1h, HeapRegion* dummy_region) {
       
         // Make sure that any allocation attempt on this region will fail
         // and will not trigger any asserts.
      -  assert(dummy_region->allocate_no_bot_updates(1) == NULL, "should fail");
      -  assert(dummy_region->allocate(1) == NULL, "should fail");
         DEBUG_ONLY(size_t assert_tmp);
      -  assert(dummy_region->par_allocate_no_bot_updates(1, 1, &assert_tmp) == NULL, "should fail");
         assert(dummy_region->par_allocate(1, 1, &assert_tmp) == NULL, "should fail");
       
         _g1h = g1h;
      @@ -77,8 +74,9 @@ size_t G1AllocRegion::fill_up_remaining_space(HeapRegion* alloc_region) {
         while (free_word_size >= min_word_size_to_fill) {
           HeapWord* dummy = par_allocate(alloc_region, free_word_size);
           if (dummy != NULL) {
      -      // If the allocation was successful we should fill in the space.
      -      CollectedHeap::fill_with_object(dummy, free_word_size);
      +      // If the allocation was successful we should fill in the space. If the
      +      // allocation was in old any necessary BOT updates will be done.
      +      alloc_region->fill_with_dummy_object(dummy, free_word_size);
             alloc_region->set_pre_dummy_top(dummy);
             result += free_word_size * HeapWordSize;
             break;
      @@ -256,7 +254,6 @@ G1AllocRegion::G1AllocRegion(const char* name,
         : _alloc_region(NULL),
           _count(0),
           _used_bytes_before(0),
      -    _bot_updates(bot_updates),
           _name(name),
           _node_index(node_index)
        { }
      @@ -389,7 +386,7 @@ HeapRegion* OldGCAllocRegion::release() {
             // original problem cannot occur.
             if (to_allocate_words >= G1CollectedHeap::min_fill_size()) {
               HeapWord* dummy = attempt_allocation(to_allocate_words);
      -        CollectedHeap::fill_with_object(dummy, to_allocate_words);
      +        cur->fill_with_dummy_object(dummy, to_allocate_words);
             }
           }
         }
      diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.hpp b/src/hotspot/share/gc/g1/g1AllocRegion.hpp
      index 227fe6a356c..a08649a675e 100644
      --- a/src/hotspot/share/gc/g1/g1AllocRegion.hpp
      +++ b/src/hotspot/share/gc/g1/g1AllocRegion.hpp
      @@ -68,9 +68,6 @@ private:
         // we allocated in it.
         size_t _used_bytes_before;
       
      -  // When true, indicates that allocate calls should do BOT updates.
      -  const bool _bot_updates;
      -
         // Useful for debugging and tracing.
         const char* _name;
       
      diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp b/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp
      index 763be2af103..b1ccc4cefb0 100644
      --- a/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp
      +++ b/src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp
      @@ -31,9 +31,9 @@
       
       #define assert_alloc_region(p, message)                                  \
         do {                                                                   \
      -    assert((p), "[%s] %s c: %u b: %s r: " PTR_FORMAT " u: " SIZE_FORMAT, \
      -           _name, (message), _count, BOOL_TO_STR(_bot_updates),          \
      -           p2i(_alloc_region), _used_bytes_before);                      \
      +    assert((p), "[%s] %s c: %u r: " PTR_FORMAT " u: " SIZE_FORMAT,       \
      +           _name, (message), _count, p2i(_alloc_region),                 \
      +           _used_bytes_before);                                          \
         } while (0)
       
       
      @@ -45,11 +45,7 @@ inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
                                                size_t word_size) {
         assert(alloc_region != NULL, "pre-condition");
       
      -  if (!_bot_updates) {
      -    return alloc_region->allocate_no_bot_updates(word_size);
      -  } else {
      -    return alloc_region->allocate(word_size);
      -  }
      +  return alloc_region->allocate(word_size);
       }
       
       inline HeapWord* G1AllocRegion::par_allocate(HeapRegion* alloc_region, size_t word_size) {
      @@ -64,11 +60,7 @@ inline HeapWord* G1AllocRegion::par_allocate(HeapRegion* alloc_region,
         assert(alloc_region != NULL, "pre-condition");
         assert(!alloc_region->is_empty(), "pre-condition");
       
      -  if (!_bot_updates) {
      -    return alloc_region->par_allocate_no_bot_updates(min_word_size, desired_word_size, actual_word_size);
      -  } else {
      -    return alloc_region->par_allocate(min_word_size, desired_word_size, actual_word_size);
      -  }
      +  return alloc_region->par_allocate(min_word_size, desired_word_size, actual_word_size);
       }
       
       inline HeapWord* G1AllocRegion::attempt_allocation(size_t word_size) {
      diff --git a/src/hotspot/share/gc/g1/g1Allocator.cpp b/src/hotspot/share/gc/g1/g1Allocator.cpp
      index bf38b786f03..7a6cb0a499d 100644
      --- a/src/hotspot/share/gc/g1/g1Allocator.cpp
      +++ b/src/hotspot/share/gc/g1/g1Allocator.cpp
      @@ -299,8 +299,12 @@ G1PLABAllocator::G1PLABAllocator(G1Allocator* allocator) :
           _direct_allocated[state] = 0;
           uint length = alloc_buffers_length(state);
           _alloc_buffers[state] = NEW_C_HEAP_ARRAY(PLAB*, length, mtGC);
      +    size_t word_sz = _g1h->desired_plab_sz(state);
           for (uint node_index = 0; node_index < length; node_index++) {
      -      _alloc_buffers[state][node_index] = new PLAB(_g1h->desired_plab_sz(state));
      +      // Specialized PLABs for old that handle BOT updates for object allocations.
      +      _alloc_buffers[state][node_index] = (state == G1HeapRegionAttr::Old)
      +                                        ? new G1BotUpdatingPLAB(word_sz)
      +                                        : new PLAB(word_sz);
           }
         }
       }
      @@ -360,6 +364,7 @@ HeapWord* G1PLABAllocator::allocate_direct_or_new_plab(G1HeapRegionAttr dest,
         // Try direct allocation.
         HeapWord* result = _allocator->par_allocate_during_gc(dest, word_sz, node_index);
         if (result != NULL) {
      +    update_bot_for_direct_allocation(dest, result, word_sz);
           _direct_allocated[dest.type()] += word_sz;
         }
         return result;
      diff --git a/src/hotspot/share/gc/g1/g1Allocator.hpp b/src/hotspot/share/gc/g1/g1Allocator.hpp
      index 5014442845a..8eea1e0f12b 100644
      --- a/src/hotspot/share/gc/g1/g1Allocator.hpp
      +++ b/src/hotspot/share/gc/g1/g1Allocator.hpp
      @@ -145,6 +145,22 @@ public:
                                          uint node_index);
       };
       
      +// Specialized PLAB for old generation promotions. For old regions the
      +// BOT needs to be updated and the relevant data to do this efficiently
      +// is stored in the PLAB.
      +class G1BotUpdatingPLAB : public PLAB {
      +  // An object spanning this threshold will cause a BOT update.
      +  HeapWord* _next_bot_threshold;
      +  // The region in which the PLAB resides.
      +  HeapRegion* _region;
      +public:
      +  G1BotUpdatingPLAB(size_t word_sz) : PLAB(word_sz) { }
      +  // Sets the new PLAB buffer as well as updates the threshold and region.
      +  void set_buf(HeapWord* buf, size_t word_sz) override;
      +  // Updates the BOT if the last allocation crossed the threshold.
      +  inline void update_bot(size_t word_sz);
      +};
      +
       // Manages the PLABs used during garbage collection. Interface for allocation from PLABs.
       // Needs to handle multiple contexts, extra alignment in any "survivor" area and some
       // statistics.
      @@ -165,11 +181,18 @@ private:
         inline PLAB* alloc_buffer(G1HeapRegionAttr dest, uint node_index) const;
         inline PLAB* alloc_buffer(region_type_t dest, uint node_index) const;
       
      +  // Helpers to do explicit BOT updates for allocations in old generation regions.
      +  void update_bot_for_direct_allocation(G1HeapRegionAttr attr, HeapWord* addr, size_t size);
      +
         // Returns the number of allocation buffers for the given dest.
         // There is only 1 buffer for Old while Young may have multiple buffers depending on
         // active NUMA nodes.
         inline uint alloc_buffers_length(region_type_t dest) const;
       
      +  // Returns if BOT updates are needed for the given destinaion. Currently we only have
      +  // two destinations and BOT updates are only needed for the old generation.
      +  inline bool needs_bot_update(G1HeapRegionAttr dest) const;
      +
         bool may_throw_away_buffer(size_t const allocation_word_sz, size_t const buffer_size) const;
       public:
         G1PLABAllocator(G1Allocator* allocator);
      @@ -198,6 +221,9 @@ public:
                                   bool* refill_failed,
                                   uint node_index);
       
      +  // Update the BOT for the last PLAB allocation.
      +  inline void update_bot_for_plab_allocation(G1HeapRegionAttr dest, size_t word_sz, uint node_index);
      +
         void undo_allocation(G1HeapRegionAttr dest, HeapWord* obj, size_t word_sz, uint node_index);
       };
       
      diff --git a/src/hotspot/share/gc/g1/g1Allocator.inline.hpp b/src/hotspot/share/gc/g1/g1Allocator.inline.hpp
      index 42d6a547257..82223a75ad4 100644
      --- a/src/hotspot/share/gc/g1/g1Allocator.inline.hpp
      +++ b/src/hotspot/share/gc/g1/g1Allocator.inline.hpp
      @@ -133,4 +133,49 @@ inline HeapWord* G1PLABAllocator::allocate(G1HeapRegionAttr dest,
         return allocate_direct_or_new_plab(dest, word_sz, refill_failed, node_index);
       }
       
      +inline bool G1PLABAllocator::needs_bot_update(G1HeapRegionAttr dest) const {
      +  return dest.is_old();
      +}
      +
      +inline void G1PLABAllocator::update_bot_for_direct_allocation(G1HeapRegionAttr attr, HeapWord* addr, size_t size) {
      +  if (!needs_bot_update(attr)) {
      +    return;
      +  }
      +
      +  // Out of PLAB allocations in an old generation region. Update BOT.
      +  HeapRegion* region = _g1h->heap_region_containing(addr);
      +  region->update_bot_at(addr, size);
      +}
      +
      +inline void G1PLABAllocator::update_bot_for_plab_allocation(G1HeapRegionAttr dest, size_t word_sz, uint node_index) {
      +  assert(needs_bot_update(dest), "Wrong destination: %s", dest.get_type_str());
      +  G1BotUpdatingPLAB* plab = static_cast(alloc_buffer(dest, node_index));
      +  plab->update_bot(word_sz);
      +}
      +
      +inline void G1BotUpdatingPLAB::set_buf(HeapWord* buf, size_t word_sz) {
      +  PLAB::set_buf(buf, word_sz);
      +  // Update the region and threshold to allow efficient BOT updates.
      +  _region = G1CollectedHeap::heap()->heap_region_containing(buf);
      +  _next_bot_threshold = _region->bot_threshold_for_addr(buf);
      +}
      +
      +inline void G1BotUpdatingPLAB::update_bot(size_t word_sz) {
      +  // The last object end is at _top, if it did not cross the
      +  // threshold, there is nothing to do.
      +  if (_top <= _next_bot_threshold) {
      +    return;
      +  }
      +
      +  HeapWord* obj_start = _top - word_sz;
      +  assert(contains(obj_start),
      +         "Object start outside PLAB. bottom: " PTR_FORMAT " object: " PTR_FORMAT,
      +         p2i(_bottom), p2i(obj_start));
      +  assert(obj_start <= _next_bot_threshold,
      +         "Object start not below or at threshold. threshold: " PTR_FORMAT " object: " PTR_FORMAT,
      +         p2i(_next_bot_threshold), p2i(obj_start));
      +
      +  _region->update_bot_crossing_threshold(&_next_bot_threshold, obj_start, _top);
      +}
      +
       #endif // SHARE_GC_G1_G1ALLOCATOR_INLINE_HPP
      diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
      index f499789c095..89a91d5bce2 100644
      --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
      +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp
      @@ -108,6 +108,7 @@ public:
       
       class G1BlockOffsetTablePart {
         friend class G1BlockOffsetTable;
      +  friend class HeapRegion;
         friend class VMStructs;
       private:
         // allocation boundary at which offset array must be updated
      @@ -181,6 +182,9 @@ public:
       
         void verify() const;
       
      +  // Given an address calculate where the next threshold needing an update is.
      +  inline HeapWord* threshold_for_addr(const void* addr);
      +
         // Returns the address of the start of the block containing "addr", or
         // else "null" if it is covered by no block.  (May have side effects,
         // namely updating of shared array entries that "point" too far
      @@ -204,6 +208,11 @@ public:
         // updated.
         HeapWord* threshold() const { return _next_offset_threshold; }
       
      +  // Sets the threshold explicitly to keep it consistent with what has been
      +  // updated. This needs to be done when the threshold is not used for updating
      +  // the bot, for example when promoting to old in young collections.
      +  void set_threshold(HeapWord* threshold) { _next_offset_threshold = threshold; }
      +
         // These must be guaranteed to work properly (i.e., do nothing)
         // when "blk_start" ("blk" for second version) is "NULL".  In this
         // implementation, that's true because NULL is represented as 0, and thus
      diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp
      index 47b90985b78..104200eeea2 100644
      --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp
      +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp
      @@ -31,6 +31,20 @@
       #include "gc/shared/memset_with_concurrent_readers.hpp"
       #include "runtime/atomic.hpp"
       
      +inline HeapWord* G1BlockOffsetTablePart::threshold_for_addr(const void* addr) {
      +  assert(addr >= _hr->bottom() && addr < _hr->top(), "invalid address");
      +  size_t index = _bot->index_for(addr);
      +  HeapWord* card_boundary = _bot->address_for_index(index);
      +  // Address at card boundary, use as threshold.
      +  if (card_boundary == addr) {
      +    return card_boundary;
      +  }
      +
      +  // Calculate next threshold.
      +  HeapWord* threshold = card_boundary + BOTConstants::N_words;
      +  return threshold;
      +}
      +
       inline HeapWord* G1BlockOffsetTablePart::block_start(const void* addr) {
         assert(addr >= _hr->bottom() && addr < _hr->top(), "invalid address");
         HeapWord* q = block_at_or_preceding(addr);
      @@ -109,9 +123,6 @@ inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr)
                "Object crossed region boundary, found offset %u instead of 0",
                (uint) _bot->offset_array(_bot->index_for(_hr->bottom())));
       
      -  // We must make sure that the offset table entry we use is valid.
      -  assert(addr < _next_offset_threshold, "Precondition");
      -
         size_t index = _bot->index_for(addr);
       
         HeapWord* q = _bot->address_for_index(index);
      diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
      index ccb0869d6f2..13fce2dd126 100644
      --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
      +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
      @@ -3293,6 +3293,7 @@ void G1CollectedHeap::retire_gc_alloc_region(HeapRegion* alloc_region,
         _bytes_used_during_gc += allocated_bytes;
         if (dest.is_old()) {
           old_set_add(alloc_region);
      +    alloc_region->update_bot_threshold();
         } else {
           assert(dest.is_young(), "Retiring alloc region should be young (%d)", dest.type());
           _survivor.add_used_bytes(allocated_bytes);
      @@ -3445,3 +3446,8 @@ GrowableArray G1CollectedHeap::memory_managers() {
       GrowableArray G1CollectedHeap::memory_pools() {
         return _monitoring_support->memory_pools();
       }
      +
      +void G1CollectedHeap::fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap) {
      +  HeapRegion* region = heap_region_containing(start);
      +  region->fill_with_dummy_object(start, pointer_delta(end, start), zap);
      +}
      diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
      index 80cc82c4af8..2d6cdb45940 100644
      --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
      +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp
      @@ -934,6 +934,8 @@ public:
         virtual GrowableArray memory_managers();
         virtual GrowableArray memory_pools();
       
      +  virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
      +
         // Try to minimize the remembered set.
         void scrub_rem_set();
       
      diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
      index f0b376982ae..a8ffaa20ed5 100644
      --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
      +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
      @@ -498,6 +498,11 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
               obj->incr_age();
             }
             _age_table.add(age, word_sz);
      +    } else {
      +      // Currently we only have two destinations and we only need BOT updates for
      +      // old. If the current allocation was done outside the PLAB this call will
      +      // have no effect since the _top of the PLAB has not changed.
      +      _plab_allocator->update_bot_for_plab_allocation(dest_attr, word_sz, node_index);
           }
       
           // Most objects are not arrays, so do one array check rather than
      diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp
      index ac0d551fc54..11b025845b6 100644
      --- a/src/hotspot/share/gc/g1/heapRegion.cpp
      +++ b/src/hotspot/share/gc/g1/heapRegion.cpp
      @@ -235,7 +235,6 @@ HeapRegion::HeapRegion(uint hrm_index,
         _top(NULL),
         _compaction_top(NULL),
         _bot_part(bot, this),
      -  _par_alloc_lock(Mutex::service-2, "HeapRegionParAlloc_lock"),
         _pre_dummy_top(NULL),
         _rem_set(NULL),
         _hrm_index(hrm_index),
      @@ -818,3 +817,12 @@ void HeapRegion::object_iterate(ObjectClosure* blk) {
           p += block_size(p);
         }
       }
      +
      +void HeapRegion::fill_with_dummy_object(HeapWord* address, size_t word_size, bool zap) {
      +  // Keep the BOT in sync for old generation regions.
      +  if (is_old()) {
      +    update_bot_at(address, word_size);
      +  }
      +  // Fill in the object.
      +  CollectedHeap::fill_with_object(address, word_size, zap);
      +}
      diff --git a/src/hotspot/share/gc/g1/heapRegion.hpp b/src/hotspot/share/gc/g1/heapRegion.hpp
      index 6939ecd9c0d..148b61ecb27 100644
      --- a/src/hotspot/share/gc/g1/heapRegion.hpp
      +++ b/src/hotspot/share/gc/g1/heapRegion.hpp
      @@ -78,7 +78,7 @@ class HeapRegion : public CHeapObj {
         HeapWord* _compaction_top;
       
         G1BlockOffsetTablePart _bot_part;
      -  Mutex _par_alloc_lock;
      +
         // When we need to retire an allocation region, while other threads
         // are also concurrently trying to allocate into it, we typically
         // allocate a dummy object at the end of the region to ensure that
      @@ -153,18 +153,24 @@ public:
       
         void object_iterate(ObjectClosure* blk);
       
      -  // Allocation (return NULL if full).  Assumes the caller has established
      -  // mutually exclusive access to the HeapRegion.
      -  HeapWord* allocate(size_t min_word_size, size_t desired_word_size, size_t* actual_word_size);
      -  // Allocation (return NULL if full).  Enforces mutual exclusion internally.
      -  HeapWord* par_allocate(size_t min_word_size, size_t desired_word_size, size_t* actual_word_size);
      -
      -  HeapWord* allocate(size_t word_size);
      -  HeapWord* par_allocate(size_t word_size);
      -
      -  inline HeapWord* par_allocate_no_bot_updates(size_t min_word_size, size_t desired_word_size, size_t* word_size);
      -  inline HeapWord* allocate_no_bot_updates(size_t word_size);
      -  inline HeapWord* allocate_no_bot_updates(size_t min_word_size, size_t desired_word_size, size_t* actual_size);
      +  // At the given address create an object with the given size. If the region
      +  // is old the BOT will be updated if the object spans a threshold.
      +  void fill_with_dummy_object(HeapWord* address, size_t word_size, bool zap = true);
      +
      +  // All allocations are done without updating the BOT. The BOT
      +  // needs to be kept in sync for old generation regions and
      +  // this is done by explicit updates when crossing thresholds.
      +  inline HeapWord* par_allocate(size_t min_word_size, size_t desired_word_size, size_t* word_size);
      +  inline HeapWord* allocate(size_t word_size);
      +  inline HeapWord* allocate(size_t min_word_size, size_t desired_word_size, size_t* actual_size);
      +
      +  // Update the BOT for the given address if it crosses the next
      +  // BOT threshold at or after obj_start.
      +  inline void update_bot_at(HeapWord* obj_start, size_t obj_size);
      +  // Update BOT at the given threshold for the given object. The
      +  // given object must cross the threshold.
      +  inline void update_bot_crossing_threshold(HeapWord** threshold, HeapWord* obj_start, HeapWord* obj_end);
      +  inline HeapWord* bot_threshold_for_addr(const void* addr);
       
         // Full GC support methods.
       
      @@ -201,6 +207,10 @@ public:
           _bot_part.update();
         }
       
      +  void update_bot_threshold() {
      +    _bot_part.set_threshold(top());
      +  }
      +
       private:
         // The remembered set for this region.
         HeapRegionRemSet* _rem_set;
      diff --git a/src/hotspot/share/gc/g1/heapRegion.inline.hpp b/src/hotspot/share/gc/g1/heapRegion.inline.hpp
      index 7c5925bef86..122c8214c65 100644
      --- a/src/hotspot/share/gc/g1/heapRegion.inline.hpp
      +++ b/src/hotspot/share/gc/g1/heapRegion.inline.hpp
      @@ -79,36 +79,6 @@ inline HeapWord* HeapRegion::par_allocate_impl(size_t min_word_size,
         } while (true);
       }
       
      -inline HeapWord* HeapRegion::allocate(size_t min_word_size,
      -                                      size_t desired_word_size,
      -                                      size_t* actual_size) {
      -  HeapWord* res = allocate_impl(min_word_size, desired_word_size, actual_size);
      -  if (res != NULL) {
      -    _bot_part.alloc_block(res, *actual_size);
      -  }
      -  return res;
      -}
      -
      -inline HeapWord* HeapRegion::allocate(size_t word_size) {
      -  size_t temp;
      -  return allocate(word_size, word_size, &temp);
      -}
      -
      -inline HeapWord* HeapRegion::par_allocate(size_t word_size) {
      -  size_t temp;
      -  return par_allocate(word_size, word_size, &temp);
      -}
      -
      -// Because of the requirement of keeping "_offsets" up to date with the
      -// allocations, we sequentialize these with a lock.  Therefore, best if
      -// this is used for larger LAB allocations only.
      -inline HeapWord* HeapRegion::par_allocate(size_t min_word_size,
      -                                          size_t desired_word_size,
      -                                          size_t* actual_size) {
      -  MutexLocker x(&_par_alloc_lock, Mutex::_no_safepoint_check_flag);
      -  return allocate(min_word_size, desired_word_size, actual_size);
      -}
      -
       inline HeapWord* HeapRegion::block_start(const void* p) {
         return _bot_part.block_start(p);
       }
      @@ -252,25 +222,52 @@ inline void HeapRegion::apply_to_marked_objects(G1CMBitMap* bitmap, ApplyToMarke
         assert(next_addr == limit, "Should stop the scan at the limit.");
       }
       
      -inline HeapWord* HeapRegion::par_allocate_no_bot_updates(size_t min_word_size,
      -                                                         size_t desired_word_size,
      -                                                         size_t* actual_word_size) {
      -  assert(is_young(), "we can only skip BOT updates on young regions");
      +inline HeapWord* HeapRegion::par_allocate(size_t min_word_size,
      +                                          size_t desired_word_size,
      +                                          size_t* actual_word_size) {
         return par_allocate_impl(min_word_size, desired_word_size, actual_word_size);
       }
       
      -inline HeapWord* HeapRegion::allocate_no_bot_updates(size_t word_size) {
      +inline HeapWord* HeapRegion::allocate(size_t word_size) {
         size_t temp;
      -  return allocate_no_bot_updates(word_size, word_size, &temp);
      +  return allocate(word_size, word_size, &temp);
       }
       
      -inline HeapWord* HeapRegion::allocate_no_bot_updates(size_t min_word_size,
      -                                                     size_t desired_word_size,
      -                                                     size_t* actual_word_size) {
      -  assert(is_young(), "we can only skip BOT updates on young regions");
      +inline HeapWord* HeapRegion::allocate(size_t min_word_size,
      +                                      size_t desired_word_size,
      +                                      size_t* actual_word_size) {
         return allocate_impl(min_word_size, desired_word_size, actual_word_size);
       }
       
      +inline HeapWord* HeapRegion::bot_threshold_for_addr(const void* addr) {
      +  HeapWord* threshold = _bot_part.threshold_for_addr(addr);
      +  assert(threshold >= addr,
      +         "threshold must be at or after given address. " PTR_FORMAT " >= " PTR_FORMAT,
      +         p2i(threshold), p2i(addr));
      +  assert(is_old(),
      +         "Should only calculate BOT threshold for old regions. addr: " PTR_FORMAT " region:" HR_FORMAT,
      +         p2i(addr), HR_FORMAT_PARAMS(this));
      +  return threshold;
      +}
      +
      +inline void HeapRegion::update_bot_crossing_threshold(HeapWord** threshold, HeapWord* obj_start, HeapWord* obj_end) {
      +  assert(is_old(), "should only do BOT updates for old regions");
      +  assert(is_in(obj_start), "obj_start must be in this region: " HR_FORMAT
      +         " obj_start " PTR_FORMAT " obj_end " PTR_FORMAT " threshold " PTR_FORMAT,
      +         HR_FORMAT_PARAMS(this),
      +         p2i(obj_start), p2i(obj_end), p2i(*threshold));
      +  _bot_part.alloc_block_work(threshold, obj_start, obj_end);
      +}
      +
      +inline void HeapRegion::update_bot_at(HeapWord* obj_start, size_t obj_size) {
      +  HeapWord* threshold = bot_threshold_for_addr(obj_start);
      +  HeapWord* obj_end = obj_start + obj_size;
      +
      +  if (obj_end > threshold) {
      +    update_bot_crossing_threshold(&threshold, obj_start, obj_end);
      +  }
      +}
      +
       inline void HeapRegion::note_start_of_marking() {
         _next_marked_bytes = 0;
         _next_top_at_mark_start = top();
      diff --git a/src/hotspot/share/gc/shared/plab.hpp b/src/hotspot/share/gc/shared/plab.hpp
      index 6180c635187..b3700a3b9f6 100644
      --- a/src/hotspot/share/gc/shared/plab.hpp
      +++ b/src/hotspot/share/gc/shared/plab.hpp
      @@ -119,7 +119,7 @@ public:
         }
       
         // Sets the space of the buffer to be [buf, space+word_sz()).
      -  void set_buf(HeapWord* buf, size_t new_word_sz) {
      +  virtual void set_buf(HeapWord* buf, size_t new_word_sz) {
           assert(new_word_sz > AlignmentReserve, "Too small");
           _word_sz = new_word_sz;
       
      -- 
      GitLab
      
      
      From 5c7f77c82404976a6ca1d54b40f1969eac10d63b Mon Sep 17 00:00:00 2001
      From: Thomas Schatzl 
      Date: Tue, 9 Nov 2021 13:07:42 +0000
      Subject: [PATCH 253/890] 8276850: Remove outdated comment in
       HeapRegionManager::par_iterate
      
      Reviewed-by: ayang, sjohanss
      ---
       src/hotspot/share/gc/g1/heapRegionManager.cpp | 4 ----
       1 file changed, 4 deletions(-)
      
      diff --git a/src/hotspot/share/gc/g1/heapRegionManager.cpp b/src/hotspot/share/gc/g1/heapRegionManager.cpp
      index 1f5459e15df..4fe62b7f232 100644
      --- a/src/hotspot/share/gc/g1/heapRegionManager.cpp
      +++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp
      @@ -593,10 +593,6 @@ void HeapRegionManager::par_iterate(HeapRegionClosure* blk, HeapRegionClaimer* h
           }
           HeapRegion* r = _regions.get_by_index(index);
           // We'll ignore regions already claimed.
      -    // However, if the iteration is specified as concurrent, the values for
      -    // is_starts_humongous and is_continues_humongous can not be trusted,
      -    // and we should just blindly iterate over regions regardless of their
      -    // humongous status.
           if (hrclaimer->is_region_claimed(index)) {
             continue;
           }
      -- 
      GitLab
      
      
      From 4bd5bfd8e2624715ebfa6e4c49172361389fbc98 Mon Sep 17 00:00:00 2001
      From: Thomas Stuefe 
      Date: Tue, 9 Nov 2021 14:12:40 +0000
      Subject: [PATCH 254/890] 8276731: Metaspace chunks are uncommitted twice
      
      Reviewed-by: shade, coleenp
      ---
       src/hotspot/share/memory/metaspace/chunkManager.cpp | 6 ------
       1 file changed, 6 deletions(-)
      
      diff --git a/src/hotspot/share/memory/metaspace/chunkManager.cpp b/src/hotspot/share/memory/metaspace/chunkManager.cpp
      index c0c163d7b65..b2c4c5bd452 100644
      --- a/src/hotspot/share/memory/metaspace/chunkManager.cpp
      +++ b/src/hotspot/share/memory/metaspace/chunkManager.cpp
      @@ -264,12 +264,6 @@ void ChunkManager::return_chunk_locked(Metachunk* c) {
           c = merged;
         }
       
      -  if (Settings::uncommit_free_chunks() &&
      -      c->word_size() >= Settings::commit_granule_words()) {
      -    UL2(debug, "uncommitting free chunk " METACHUNK_FORMAT ".", METACHUNK_FORMAT_ARGS(c));
      -    c->uncommit_locked();
      -  }
      -
         return_chunk_simple_locked(c);
         DEBUG_ONLY(verify_locked();)
         SOMETIMES(c->vsnode()->verify_locked();)
      -- 
      GitLab
      
      
      From e198594753b0b0653256923586c7f4ec9e3cfac3 Mon Sep 17 00:00:00 2001
      From: Masanori Yano 
      Date: Tue, 9 Nov 2021 14:28:07 +0000
      Subject: [PATCH 255/890] 8250678: ModuleDescriptor.Version parsing treats
       empty segments inconsistently
      
      Reviewed-by: mchung, alanb
      ---
       .../java/lang/module/ModuleDescriptor.java    | 22 +++++++------------
       test/jdk/java/lang/module/VersionTest.java    |  5 ++++-
       2 files changed, 12 insertions(+), 15 deletions(-)
      
      diff --git a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
      index 6388858f72b..86ea7602c60 100644
      --- a/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
      +++ b/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java
      @@ -1033,13 +1033,6 @@ public class ModuleDescriptor
       
                   while (i < n) {
                       c = v.charAt(i);
      -                if (c >= '0' && c <= '9')
      -                    i = takeNumber(v, i, pre);
      -                else
      -                    i = takeString(v, i, pre);
      -                if (i >= n)
      -                    break;
      -                c = v.charAt(i);
                       if (c == '.' || c == '-') {
                           i++;
                           continue;
      @@ -1048,6 +1041,10 @@ public class ModuleDescriptor
                           i++;
                           break;
                       }
      +                if (c >= '0' && c <= '9')
      +                    i = takeNumber(v, i, pre);
      +                else
      +                    i = takeString(v, i, pre);
                   }
       
                   if (c == '+' && i >= n)
      @@ -1055,17 +1052,14 @@ public class ModuleDescriptor
       
                   while (i < n) {
                       c = v.charAt(i);
      -                if (c >= '0' && c <= '9')
      -                    i = takeNumber(v, i, build);
      -                else
      -                    i = takeString(v, i, build);
      -                if (i >= n)
      -                    break;
      -                c = v.charAt(i);
                       if (c == '.' || c == '-' || c == '+') {
                           i++;
                           continue;
                       }
      +                if (c >= '0' && c <= '9')
      +                    i = takeNumber(v, i, build);
      +                else
      +                    i = takeString(v, i, build);
                   }
       
                   this.version = v;
      diff --git a/test/jdk/java/lang/module/VersionTest.java b/test/jdk/java/lang/module/VersionTest.java
      index 41d45306ff4..aae5883b5e6 100644
      --- a/test/jdk/java/lang/module/VersionTest.java
      +++ b/test/jdk/java/lang/module/VersionTest.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2015, 2021, 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
      @@ -148,6 +148,9 @@ public class VersionTest {
                   { "1",             "1.0.0" },
                   { "1.0",           "1.0.0" },
                   { "1.0-beta",      "1.0.0-beta" },
      +            { "1.0-1.1",       "1.0-1..1" },
      +            { "1.0-1+1",       "1.0-1.+1" },
      +            { "1.0-1+1.1",     "1.0-1+1..1" },
       
               };
           }
      -- 
      GitLab
      
      
      From c27afb313b77d19e7ace7101c6f21aa5b2c56505 Mon Sep 17 00:00:00 2001
      From: Weijun Wang 
      Date: Tue, 9 Nov 2021 14:46:32 +0000
      Subject: [PATCH 256/890] 8276863: Remove
       test/jdk/sun/security/ec/ECDSAJavaVerify.java
      
      Reviewed-by: ascarpino
      ---
       test/jdk/sun/security/ec/ECDSAJavaVerify.java | 247 ------------------
       1 file changed, 247 deletions(-)
       delete mode 100644 test/jdk/sun/security/ec/ECDSAJavaVerify.java
      
      diff --git a/test/jdk/sun/security/ec/ECDSAJavaVerify.java b/test/jdk/sun/security/ec/ECDSAJavaVerify.java
      deleted file mode 100644
      index 77aad015b8b..00000000000
      --- a/test/jdk/sun/security/ec/ECDSAJavaVerify.java
      +++ /dev/null
      @@ -1,247 +0,0 @@
      -/*
      - * Copyright (c) 2020, 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 com.sun.jdi.Bootstrap;
      -import com.sun.jdi.VMDisconnectedException;
      -import com.sun.jdi.VirtualMachine;
      -import com.sun.jdi.connect.Connector;
      -import com.sun.jdi.connect.LaunchingConnector;
      -import com.sun.jdi.event.Event;
      -import com.sun.jdi.event.EventSet;
      -import com.sun.jdi.event.MethodEntryEvent;
      -import com.sun.jdi.request.MethodEntryRequest;
      -
      -import java.security.AlgorithmParameters;
      -import java.security.KeyPair;
      -import java.security.KeyPairGenerator;
      -import java.security.SecureRandom;
      -import java.security.Signature;
      -import java.security.SignatureException;
      -import java.security.interfaces.ECPrivateKey;
      -import java.security.interfaces.ECPublicKey;
      -import java.security.spec.ECGenParameterSpec;
      -import java.security.spec.ECParameterSpec;
      -import java.util.Arrays;
      -import java.util.List;
      -import java.util.Map;
      -import java.util.Random;
      -
      -/*
      - * @test
      - * @bug 8237218 8239928
      - * @modules jdk.crypto.ec
      - *          jdk.jdi
      - * @requires os.family != "windows"
      - * @run main ECDSAJavaVerify debug
      - * @summary Support NIST Curves verification in java implementation.
      - *  This test does not run stable on Windows. VMDisconnectedException
      - *  might not be thrown at all.
      - */
      -
      -// ATTENTION: This test depends on method names inside the non-exported
      -// class sun.security.ec.ECDSASignature.
      -public class ECDSAJavaVerify {
      -
      -    static final String[] ALL_ALGS = new String[] {
      -            "SHA1withECDSA", "SHA256withECDSA", "SHA384withECDSA", "SHA512withECDSA"};
      -
      -    static final String[] ALL_CURVES = new String[] {
      -            "secp256r1", "secp384r1", "secp521r1"};
      -
      -    public static void main(String[] args) throws Exception {
      -        if (args.length == 1) {
      -            // Debugging a new process with no arg
      -            debug();
      -        } else if (args.length == 3) {
      -            // If one test case fail, re-run it with first 3 columns
      -            new Test().run(Integer.parseInt(args[0]), args[1], args[2]);
      -        } else {
      -            // Run all test cases
      -            Test t = new Test();
      -            Random r = new Random();
      -
      -            for (String sigAlg : ALL_ALGS) {
      -                for (String curve : ALL_CURVES) {
      -                    t.run(r.nextInt(1000000), sigAlg, curve);
      -                }
      -            }
      -        }
      -    }
      -
      -    static void debug() throws Exception {
      -
      -        LaunchingConnector launchingConnector = Bootstrap
      -                .virtualMachineManager().defaultConnector();
      -
      -        Map arguments
      -                = launchingConnector.defaultArguments();
      -        arguments.get("main").setValue(ECDSAJavaVerify.class.getName());
      -        arguments.get("options").setValue(
      -                "-cp " + System.getProperty("test.classes"));
      -        VirtualMachine vm = launchingConnector.launch(arguments);
      -
      -        MethodEntryRequest req = vm.eventRequestManager()
      -                .createMethodEntryRequest();
      -        req.addClassFilter("sun.security.ec.ECDSASignature");
      -        req.enable();
      -
      -        int numberOfTests = ALL_ALGS.length * ALL_CURVES.length * 2;
      -
      -        // Expected methods to call. 'J' for java impl, 'N' for native impl
      -        char[] expected = new char[numberOfTests];
      -
      -        int pos = 0;
      -        for (String dummy : ALL_ALGS) {
      -            for (String curve : ALL_CURVES) {
      -                char caller = 'J';
      -                // For each case, Signature::verify is called twice
      -                expected[pos++] = caller;
      -                expected[pos++] = caller;
      -            }
      -        }
      -
      -        // Test result
      -        // '.': not run yet
      -        // '-': enter engineVerify
      -        // 'v': expected impl called
      -        // 'x': unexpected impl called
      -        // Note: some error cases fail before any impl called. Ex: if there
      -        // is a DER encoding error.
      -        char[] result = new char[numberOfTests];
      -        Arrays.fill(result, '.');
      -
      -        String stdout, stderr;
      -
      -        try {
      -            EventSet eventSet;
      -            pos = -1; // will become 0 when entering 'engineVerify'
      -            while ((eventSet = vm.eventQueue().remove()) != null) {
      -                for (Event event : eventSet) {
      -                    if (event instanceof MethodEntryEvent) {
      -                        MethodEntryEvent e = (MethodEntryEvent)event;
      -                        switch (e.method().name()) {
      -                            case "engineVerify":
      -                                result[++pos] = '-';
      -                                break;
      -                            case "verifySignedDigestImpl": // the java impl
      -                                result[pos] = expected[pos] != 'J' ? 'x' : 'v';
      -                                break;
      -                        }
      -                    }
      -                    vm.resume();
      -                }
      -            }
      -        } catch (VMDisconnectedException e) {
      -            System.out.println("Virtual Machine is disconnected.");
      -        } finally {
      -            stderr = new String(vm.process().getErrorStream().readAllBytes());
      -            stdout = new String(vm.process().getInputStream().readAllBytes());
      -        }
      -
      -        int exitCode = vm.process().waitFor();
      -        System.out.println("  exit: " + exitCode);
      -        System.out.println("stderr:\n" + stderr);
      -        System.out.println("stdout:\n" + stdout);
      -
      -        String sResult = new String(result);
      -
      -        System.out.println(" Cases: " + new String(expected));
      -        System.out.println("Result: " + sResult);
      -
      -        if (pos != numberOfTests - 1 || sResult.contains("x")
      -                || sResult.contains(".")) {
      -            throw new Exception("Unexpected result");
      -        }
      -
      -        if (stdout.contains("fail") || exitCode != 0) {
      -            throw new Exception("Test failed");
      -        }
      -    }
      -
      -    static class Test {
      -
      -        public boolean run(int seed, String sigAlg, String curve)
      -                throws Exception {
      -
      -            // A determined SecureRandom based on seed. If there is anything
      -            // wrong, we can reproduce the problem using the seed.
      -            Random r = new Random(seed);
      -            SecureRandom rand = new SecureRandom() {
      -                @Override
      -                public void nextBytes(byte[] bytes) {
      -                    r.nextBytes(bytes);
      -                }
      -            };
      -
      -            AlgorithmParameters ap = AlgorithmParameters.getInstance("EC", "SunEC");
      -            ap.init(new ECGenParameterSpec(curve));
      -            ECParameterSpec spec = ap.getParameterSpec(ECParameterSpec.class);
      -
      -            KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", "SunEC");
      -            kpg.initialize(spec, rand);
      -            KeyPair kp = kpg.generateKeyPair();
      -            ECPrivateKey ecPrivateKey = (ECPrivateKey) kp.getPrivate();
      -            ECPublicKey ecPublicKey = (ECPublicKey) kp.getPublic();
      -
      -            Signature s1 = Signature.getInstance(sigAlg, "SunEC");
      -            s1.initSign(ecPrivateKey, rand);
      -            byte[] msg = new byte[1234];
      -            rand.nextBytes(msg);
      -            s1.update(msg);
      -            byte[] sig = s1.sign();
      -
      -            Signature s2 = Signature.getInstance(sigAlg, "SunEC");
      -            s2.initVerify(ecPublicKey);
      -            s2.update(msg);
      -
      -            boolean result1 = s2.verify(sig);
      -
      -            s2.initVerify(ecPublicKey);
      -            // modify the signature in some random manner
      -            if (rand.nextInt(10) < 8) {
      -                sig[rand.nextInt(10000) % sig.length]
      -                        = (byte) rand.nextInt(10000);
      -            } else {
      -                int newLength = rand.nextInt(100);
      -                if (newLength == sig.length) {
      -                    newLength += 1 + rand.nextInt(2);
      -                }
      -                sig = Arrays.copyOf(sig, newLength);
      -            }
      -
      -            boolean result2;
      -            try {
      -                result2 = s2.verify(sig);
      -            } catch (SignatureException se) {
      -                result2 = false;
      -            }
      -
      -            boolean finalResult = result1 && !result2;
      -            System.out.printf("%10d %20s %20s -- %5s %5s -- %s\n",
      -                    seed, sigAlg, curve, result1, result2,
      -                    finalResult ? "succeed" : "fail");
      -
      -            return finalResult;
      -        }
      -    }
      -}
      -- 
      GitLab
      
      
      From f65db88b74911e5896d2ff536c4ac97e7f62d98b Mon Sep 17 00:00:00 2001
      From: Yasumasa Suenaga 
      Date: Tue, 9 Nov 2021 14:54:42 +0000
      Subject: [PATCH 257/890] 8276841: Add support for Visual Studio 2022
      
      Reviewed-by: erikj, ihse
      ---
       make/autoconf/toolchain_microsoft.m4 | 19 +++++++++++++++++--
       1 file changed, 17 insertions(+), 2 deletions(-)
      
      diff --git a/make/autoconf/toolchain_microsoft.m4 b/make/autoconf/toolchain_microsoft.m4
      index 940f73a9d22..2600b431cfb 100644
      --- a/make/autoconf/toolchain_microsoft.m4
      +++ b/make/autoconf/toolchain_microsoft.m4
      @@ -1,5 +1,5 @@
       #
      -# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
      +# Copyright (c) 2011, 2021, 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,7 +25,7 @@
       
       ################################################################################
       # The order of these defines the priority by which we try to find them.
      -VALID_VS_VERSIONS="2019 2017"
      +VALID_VS_VERSIONS="2019 2017 2022"
       
       VS_DESCRIPTION_2017="Microsoft Visual Studio 2017"
       VS_VERSION_INTERNAL_2017=141
      @@ -56,6 +56,21 @@ VS_SDK_PLATFORM_NAME_2019=
       VS_SUPPORTED_2019=true
       VS_TOOLSET_SUPPORTED_2019=true
       
      +VS_DESCRIPTION_2022="Microsoft Visual Studio 2022"
      +VS_VERSION_INTERNAL_2022=143
      +VS_MSVCR_2022=vcruntime140.dll
      +VS_VCRUNTIME_1_2022=vcruntime140_1.dll
      +VS_MSVCP_2022=msvcp140.dll
      +VS_ENVVAR_2022="VS170COMNTOOLS"
      +VS_USE_UCRT_2022="true"
      +VS_VS_INSTALLDIR_2022="Microsoft Visual Studio/2022"
      +VS_EDITIONS_2022="BuildTools Community Professional Enterprise"
      +VS_SDK_INSTALLDIR_2022=
      +VS_VS_PLATFORM_NAME_2022="v143"
      +VS_SDK_PLATFORM_NAME_2022=
      +VS_SUPPORTED_2022=true
      +VS_TOOLSET_SUPPORTED_2022=true
      +
       ################################################################################
       
       AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
      -- 
      GitLab
      
      
      From e35abe3235ab38985a19545e76c58260ec97c718 Mon Sep 17 00:00:00 2001
      From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= 
      Date: Tue, 9 Nov 2021 15:05:07 +0000
      Subject: [PATCH 258/890] 8256208: Javadoc's generated overview does not show
       classes of unnamed package
      
      Reviewed-by: jjg
      ---
       .../formats/html/HtmlConfiguration.java       |  6 ----
       .../formats/html/PackageIndexWriter.java      | 12 ++++----
       .../TestUnnamedPackage.java                   | 28 ++++++++++++++++++
       .../doclet/testUnnamedPackage/src1/pkg/D.java | 29 +++++++++++++++++++
       .../testUnnamedPackage/src1/pkg/package.html  |  5 ++++
       5 files changed, 67 insertions(+), 13 deletions(-)
       create mode 100644 test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/D.java
       create mode 100644 test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/package.html
      
      diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
      index a4596536bc9..9d26192d5a4 100644
      --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
      +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java
      @@ -296,12 +296,6 @@ public class HtmlConfiguration extends BaseConfiguration {
               } else {
                   if (showModules) {
                       topFile = DocPath.empty.resolve(docPaths.moduleSummary(modules.first()));
      -            } else if (packages.size() == 1 && packages.first().isUnnamed()) {
      -                List classes = new ArrayList<>(getIncludedTypeElements());
      -                if (!classes.isEmpty()) {
      -                    TypeElement te = getValidClass(classes);
      -                    topFile = docPaths.forClass(te);
      -                }
                   } else if (!packages.isEmpty()) {
                       topFile = docPaths.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY);
                   }
      diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
      index 61ee3c7507f..11bb4d6def5 100644
      --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
      +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java
      @@ -105,13 +105,11 @@ public class PackageIndexWriter extends AbstractOverviewIndexWriter {
                   }
       
                   for (PackageElement pkg : configuration.packages) {
      -                if (!pkg.isUnnamed()) {
      -                    if (!(options.noDeprecated() && utils.isDeprecated(pkg))) {
      -                        Content packageLinkContent = getPackageLink(pkg, getLocalizedPackageName(pkg));
      -                        Content summaryContent = new ContentBuilder();
      -                        addSummaryComment(pkg, summaryContent);
      -                        table.addRow(pkg, packageLinkContent, summaryContent);
      -                    }
      +                if (!(options.noDeprecated() && utils.isDeprecated(pkg))) {
      +                    Content packageLinkContent = getPackageLink(pkg, getLocalizedPackageName(pkg));
      +                    Content summaryContent = new ContentBuilder();
      +                    addSummaryComment(pkg, summaryContent);
      +                    table.addRow(pkg, packageLinkContent, summaryContent);
                       }
                   }
       
      diff --git a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java
      index a88260f3d56..9f9dce38a64 100644
      --- a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java
      +++ b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java
      @@ -24,6 +24,7 @@
       /*
        * @test
        * @bug      4904075 4774450 5015144 8043698 8196201 8203791 8184205 8260223
      + *           8256208
        * @summary  Reference unnamed package as "Unnamed", not empty string.
        *           Generate a package summary for the unnamed package.
        * @library  ../../lib
      @@ -48,6 +49,12 @@ public class TestUnnamedPackage extends JavadocTester {
                       testSrc("src1/C.java"));
               checkExit(Exit.OK);
       
      +        checkOutput("index.html", true,
      +                """
      +                    
      +                    """);
               checkOutput("package-summary.html", true,
                       """
                           

      Unnamed Package

      """, @@ -156,4 +163,25 @@ public class TestUnnamedPackage extends JavadocTester { eters of type A"""); } + + @Test + public void testMixed() { + javadoc("-d", "out-mixed", + "-sourcepath", testSrc("src1"), + testSrc("src1/C.java"), + "pkg"); + checkExit(Exit.OK); + + checkOutput("index.html", true, + """ + +
      +
      This is a package comment for the unnamed package.
      +
      +
      \ + pkg
      +
      +
      This is a package comment for package pkg.
      """); + } } diff --git a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/D.java b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/D.java new file mode 100644 index 00000000000..9d2e399758d --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/D.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021, 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 pkg; + +/** + * This is class D in the package pkg. + */ +public class D {} diff --git a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/package.html b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/package.html new file mode 100644 index 00000000000..100df50ca6c --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/src1/pkg/package.html @@ -0,0 +1,5 @@ + + + This is a package comment for package pkg. + + -- GitLab From 93692ea0a9bc437309b808f511c771a79dcdfb9a Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 9 Nov 2021 16:58:43 +0000 Subject: [PATCH 259/890] 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat Reviewed-by: cjplummer, amenkov, sspitsyn --- .../sun/jvmstat/monitor/HostIdentifier.java | 10 ++++---- .../sun/jvmstat/monitor/VmIdentifier.java | 10 ++++---- .../perfdata/monitor/PerfDataBufferImpl.java | 13 +++++----- .../protocol/local/LocalMonitoredVm.java | 7 ++---- .../protocol/local/LocalVmManager.java | 24 +++++++++---------- .../protocol/local/MonitoredHostProvider.java | 12 ++++------ .../perfdata/monitor/v2_0/TypeCode.java | 8 +++---- 7 files changed, 38 insertions(+), 46 deletions(-) diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java index 98bbd25c214..b80fccaf52f 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -507,10 +507,10 @@ public class HostIdentifier { String query = getQuery(); if (query != null) { String[] queryArgs = query.split("\\+"); - for (int i = 0; i < queryArgs.length; i++) { - if (queryArgs[i].startsWith("mode=")) { - int index = queryArgs[i].indexOf('='); - return queryArgs[i].substring(index+1); + for (String queryArg : queryArgs) { + if (queryArg.startsWith("mode=")) { + int index = queryArg.indexOf('='); + return queryArg.substring(index + 1); } } } diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java index a37c7998942..6e7f1cc1f77 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -385,10 +385,10 @@ public class VmIdentifier { String query = getQuery(); if (query != null) { String[] queryArgs = query.split("\\+"); - for (int i = 0; i < queryArgs.length; i++) { - if (queryArgs[i].startsWith("mode=")) { - int index = queryArgs[i].indexOf('='); - return queryArgs[i].substring(index+1); + for (String queryArg : queryArgs) { + if (queryArg.startsWith("mode=")) { + int index = queryArg.indexOf('='); + return queryArg.substring(index + 1); } } } diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java index c83b802306d..9337ef4e8b6 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/PerfDataBufferImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -205,9 +205,11 @@ public abstract class PerfDataBufferImpl { if (m == null) { ArrayList al = aliasMap.get(name); if (al != null) { - for (Iterator i = al.iterator(); i.hasNext() && m == null; ) { - String alias = i.next(); + for (String alias : al) { m = monitors.get(alias); + if (m != null) { + break; + } } } } @@ -293,8 +295,7 @@ public abstract class PerfDataBufferImpl { Set> monitorSet = monitors.entrySet(); - for (Iterator> i = monitorSet.iterator(); i.hasNext(); /* empty */) { - Map.Entry me = i.next(); + for (Map.Entry me : monitorSet) { String name = me.getKey(); Monitor m = me.getValue(); @@ -303,7 +304,7 @@ public abstract class PerfDataBufferImpl { // if the pattern matches, then add monitor to list if (matcher.lookingAt()) { - matches.add(me.getValue()); + matches.add(me.getValue()); } } return matches; diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java index ca1b210aaac..a72a5fbcb0b 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalMonitoredVm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,8 +26,6 @@ package sun.jvmstat.perfdata.monitor.protocol.local; import java.util.*; -import java.lang.reflect.*; -import java.io.*; import sun.jvmstat.monitor.*; import sun.jvmstat.monitor.event.*; @@ -152,8 +150,7 @@ public class LocalMonitoredVm extends AbstractMonitoredVm { registered = (ArrayList)listeners.clone(); } - for (Iterator i = registered.iterator(); i.hasNext(); /* empty */) { - VmListener l = i.next(); + for (VmListener l : registered) { // lazily create the event object; if (ev == null) { ev = new MonitorStatusChangeEvent(this, inserted, removed); diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java index 90837d97984..b21c09cd51a 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java @@ -25,8 +25,6 @@ package sun.jvmstat.perfdata.monitor.protocol.local; -import sun.jvmstat.monitor.*; -import sun.jvmstat.monitor.event.*; import java.util.*; import java.util.regex.*; import java.io.*; @@ -105,19 +103,19 @@ public class LocalVmManager { // 1.4.2 and later: Look for the files {tmpdir}/hsperfdata_{any_user_name}/[0-9]+ // that are readable by the current user. File[] dirs = tmpdir.listFiles(userDirFilter); - for (int i = 0 ; i < dirs.length; i ++) { - if (!dirs[i].isDirectory()) { + for (File subDir : dirs) { + if (!subDir.isDirectory()) { continue; } // get a list of files from the directory - File[] files = dirs[i].listFiles(userDirFileFilter); + File[] files = subDir.listFiles(userDirFileFilter); if (files != null) { - for (int j = 0; j < files.length; j++) { - if (files[j].isFile() && files[j].canRead()) { - int vmid = PerfDataFile.getLocalVmId(files[j]); + for (File file : files) { + if (file.isFile() && file.canRead()) { + int vmid = PerfDataFile.getLocalVmId(file); if (vmid != -1) { - jvmSet.add(vmid); + jvmSet.add(vmid); } } } @@ -127,11 +125,11 @@ public class LocalVmManager { // look for any 1.4.1 files that are readable by the current user. File[] files = tmpdir.listFiles(oldtmpFileFilter); if (files != null) { - for (int j = 0; j < files.length; j++) { - if (files[j].isFile() && files[j].canRead()) { - int vmid = PerfDataFile.getLocalVmId(files[j]); + for (File file : files) { + if (file.isFile() && file.canRead()) { + int vmid = PerfDataFile.getLocalVmId(file); if (vmid != -1) { - jvmSet.add(vmid); + jvmSet.add(vmid); } } } diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java index 851cde20b48..742d2ae6892 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/MonitoredHostProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,8 +170,7 @@ public class MonitoredHostProvider extends MonitoredHost { registered = (ArrayList)listeners.clone(); } - for (Iterator i = registered.iterator(); i.hasNext(); /* empty */) { - HostListener l = i.next(); + for (HostListener l : registered) { if (ev == null) { ev = new VmStatusChangeEvent(this, active, started, terminated); } @@ -198,17 +197,14 @@ public class MonitoredHostProvider extends MonitoredHost { Set startedVms = new HashSet<>(); Set terminatedVms = new HashSet<>(); - for (Iterator i = activeVms.iterator(); i.hasNext(); /* empty */) { - Integer vmid = i.next(); + for (Integer vmid : activeVms) { if (!lastActiveVms.contains(vmid)) { // a new file has been detected, add to set startedVms.add(vmid); } } - for (Iterator i = lastActiveVms.iterator(); i.hasNext(); - /* empty */) { - Integer o = i.next(); + for (Integer o : lastActiveVms) { if (!activeVms.contains(o)) { // JVM has terminated, remove it from the active list terminatedVms.add(o); diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v2_0/TypeCode.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v2_0/TypeCode.java index 2770601676c..8d81dc4fbc2 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v2_0/TypeCode.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v2_0/TypeCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,9 +81,9 @@ public class TypeCode { * a valid Java TypeCode. */ public static TypeCode toTypeCode(char c) { - for (int j = 0; j < basicTypes.length; j++) { - if (basicTypes[j].value == c) { - return (basicTypes[j]); + for (TypeCode basicType : basicTypes) { + if (basicType.value == c) { + return basicType; } } throw new IllegalArgumentException(); -- GitLab From daf77ebfc4ca6d537ef55acbd62b908b5575ad08 Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Tue, 9 Nov 2021 17:50:16 +0000 Subject: [PATCH 260/890] 8276337: Use override specifier in HeapDumper Reviewed-by: stuefe, dholmes --- src/hotspot/share/services/heapDumper.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index a594e858447..c3c939c06d0 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -607,23 +607,23 @@ class DumpWriter : public AbstractDumpWriter { private: CompressionBackend _backend; // Does the actual writing. protected: - virtual void flush(bool force = false); + void flush(bool force = false) override; public: // Takes ownership of the writer and compressor. DumpWriter(AbstractWriter* writer, AbstractCompressor* compressor); // total number of bytes written to the disk - virtual julong bytes_written() const { return (julong) _backend.get_written(); } + julong bytes_written() const override { return (julong) _backend.get_written(); } - virtual char const* error() const { return _backend.error(); } + char const* error() const override { return _backend.error(); } // Called by threads used for parallel writing. void writer_loop() { _backend.thread_loop(); } // Called when finish to release the threads. - virtual void deactivate() { flush(); _backend.deactivate(); } + void deactivate() override { flush(); _backend.deactivate(); } // Get the backend pointer, used by parallel dump writer. - CompressionBackend* backend_ptr() { return &_backend; } + CompressionBackend* backend_ptr() { return &_backend; } }; @@ -701,7 +701,7 @@ class ParDumpWriter : public AbstractDumpWriter { bool _split_data; static const uint BackendFlushThreshold = 2; protected: - virtual void flush(bool force = false) { + void flush(bool force = false) override { assert(_pos != 0, "must not be zero"); if (_pos != 0) { refresh_buffer(); @@ -742,8 +742,8 @@ class ParDumpWriter : public AbstractDumpWriter { } // total number of bytes written to the disk - virtual julong bytes_written() const { return (julong) _backend_ptr->get_written(); } - virtual char const* error() const { return _err == NULL ? _backend_ptr->error() : _err; } + julong bytes_written() const override { return (julong) _backend_ptr->get_written(); } + char const* error() const override { return _err == NULL ? _backend_ptr->error() : _err; } static void before_work() { assert(_lock == NULL, "ParDumpWriter lock must be initialized only once"); @@ -757,7 +757,7 @@ class ParDumpWriter : public AbstractDumpWriter { } // write raw bytes - virtual void write_raw(const void* s, size_t len) { + void write_raw(const void* s, size_t len) override { assert(!_in_dump_segment || (_sub_record_left >= len), "sub-record too large"); debug_only(_sub_record_left -= len); assert(!_split_data, "Invalid split data"); @@ -778,7 +778,7 @@ class ParDumpWriter : public AbstractDumpWriter { set_position(position() + len); } - virtual void deactivate() { flush(true); _backend_ptr->deactivate(); } + void deactivate() override { flush(true); _backend_ptr->deactivate(); } private: void allocate_internal_buffer() { -- GitLab From dde959dfcef01897fdf51f820d414402e6309b8d Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 9 Nov 2021 19:17:59 +0000 Subject: [PATCH 261/890] 8276808: java/nio/channels/Channels/TransferTo.java timed out Reviewed-by: lancea, shade --- test/jdk/java/nio/channels/Channels/TransferTo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/nio/channels/Channels/TransferTo.java b/test/jdk/java/nio/channels/Channels/TransferTo.java index 5b706809c95..d1bbb7b0704 100644 --- a/test/jdk/java/nio/channels/Channels/TransferTo.java +++ b/test/jdk/java/nio/channels/Channels/TransferTo.java @@ -52,7 +52,7 @@ import static org.testng.Assert.assertTrue; * @test * @library /test/lib * @build jdk.test.lib.RandomFactory - * @run testng/othervm TransferTo + * @run testng/othervm/timeout=180 TransferTo * @bug 8265891 * @summary tests whether sun.nio.ChannelInputStream.transferTo conforms to the * InputStream.transferTo contract defined in the javadoc -- GitLab From a60e91259ba83d2a525b612b2c7a1fd7934b88a2 Mon Sep 17 00:00:00 2001 From: Pankaj Bansal Date: Tue, 9 Nov 2021 20:10:20 +0000 Subject: [PATCH 262/890] 8198626: java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html fails on mac Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../TypeAhead/TestDialogTypeAhead.java | 57 ++++++++++++++----- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index fddb2b28fac..c726cf5eecc 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -145,7 +145,6 @@ java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java 8144030 macosx-all java/awt/grab/EmbeddedFrameTest1/EmbeddedFrameTest1.java 7080150 macosx-all java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java 8273520 macosx-all -java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java 8198626 macosx-all java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8049405 macosx-all java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java 8159451 linux-all,windows-all,macosx-all diff --git a/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java b/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java index 1a316cfadf6..5772bfd5f58 100644 --- a/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java +++ b/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,14 +26,29 @@ @key headful @bug 4799136 @summary Tests that type-ahead for dialog works and doesn't block program - @library ../../regtesthelpers - @modules java.desktop/sun.awt - @build Util @run main TestDialogTypeAhead */ -import java.awt.*; -import java.awt.event.*; + +import java.awt.AWTEvent; +import java.awt.Button; +import java.awt.Component; +import java.awt.DefaultKeyboardFocusManager; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.KeyboardFocusManager; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.AWTEventListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; import java.lang.reflect.InvocationTargetException; public class TestDialogTypeAhead { @@ -49,8 +64,17 @@ public class TestDialogTypeAhead { public static void main(final String[] args) { TestDialogTypeAhead app = new TestDialogTypeAhead(); - app.init(); - app.start(); + try { + app.init(); + app.start(); + } finally { + if (d != null) { + d.dispose(); + } + if (f != null) { + f.dispose(); + } + } } public void init() @@ -73,13 +97,12 @@ public class TestDialogTypeAhead { ok.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { System.err.println("OK pressed"); - d.dispose(); - f.dispose(); // Typed-ahead key events should only be accepted if // they arrive after FOCUS_GAINED if (gotFocus) { pressSema.raise(); } + } }); ok.addFocusListener(new FocusAdapter() { @@ -112,6 +135,7 @@ public class TestDialogTypeAhead { { try { robot = new Robot(); + robot.setAutoDelay(100); } catch (Exception e) { throw new RuntimeException("Can't create robot:" + e); } @@ -128,6 +152,7 @@ public class TestDialogTypeAhead { robot.keyPress(KeyEvent.VK_SPACE); robot.keyRelease(KeyEvent.VK_SPACE); + try { robotSema.doWait(1000); } catch (InterruptedException ie) { @@ -149,13 +174,13 @@ public class TestDialogTypeAhead { if (!pressSema.getState()) { throw new RuntimeException("Type-ahead doesn't work"); } - }// start() - private void moveMouseOver(Container c) { + private void moveMouseOver(Component c) { Point p = c.getLocationOnScreen(); Dimension d = c.getSize(); - robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2)); + robot.mouseMove(p.x + (int)(d.getWidth()/2), + p.y + (int)(d.getHeight()/2)); } private void waitForIdle() { try { @@ -209,7 +234,10 @@ public class TestDialogTypeAhead { } comp.removeFocusListener(fa); if (!comp.isFocusOwner()) { - throw new RuntimeException("Can't make " + comp + " focused, current owner is " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()); + throw new RuntimeException("Can't make " + comp + " focused," + + "current owner is " + + KeyboardFocusManager + .getCurrentKeyboardFocusManager().getFocusOwner()); } } @@ -257,4 +285,3 @@ public class TestDialogTypeAhead { } } }// class TestDialogTypeAhead - -- GitLab From 055de6f566208b168818be1dc3ad29cdb9caa1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Tue, 9 Nov 2021 20:11:18 +0000 Subject: [PATCH 263/890] 8223358: Incorrect HTML structure in annotation pages Reviewed-by: jjg --- ...va => AnnotationTypeMemberWriterImpl.java} | 103 ++++++++++++---- ...nnotationTypeOptionalMemberWriterImpl.java | 113 ------------------ .../formats/html/HtmlDocletWriter.java | 5 - .../doclets/formats/html/HtmlIds.java | 2 + .../doclets/formats/html/Navigation.java | 22 +--- .../formats/html/SummaryListWriter.java | 3 +- .../formats/html/WriterFactoryImpl.java | 30 +++-- ...r.java => AnnotationTypeMemberWriter.java} | 32 +++-- .../AnnotationTypeOptionalMemberWriter.java | 49 -------- .../doclets/toolkit/WriterFactory.java | 16 ++- .../builders/AbstractMemberBuilder.java | 4 +- ....java => AnnotationTypeMemberBuilder.java} | 56 ++++----- .../AnnotationTypeOptionalMemberBuilder.java | 112 ----------------- .../toolkit/builders/BuilderFactory.java | 26 +--- .../toolkit/builders/ClassBuilder.java | 20 +--- .../toolkit/util/VisibleMemberTable.java | 24 ++-- .../TestAnnotationTypes.java | 91 +++++++++++--- .../pkg/AnnotationType.java | 3 +- 18 files changed, 268 insertions(+), 443 deletions(-) rename src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/{AnnotationTypeRequiredMemberWriterImpl.java => AnnotationTypeMemberWriterImpl.java} (64%) delete mode 100644 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java rename src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/{AnnotationTypeRequiredMemberWriter.java => AnnotationTypeMemberWriter.java} (78%) delete mode 100644 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeOptionalMemberWriter.java rename src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/{AnnotationTypeRequiredMemberBuilder.java => AnnotationTypeMemberBuilder.java} (81%) delete mode 100644 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeMemberWriterImpl.java similarity index 64% rename from src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java rename to src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeMemberWriterImpl.java index eb984e6715d..5ae2ffcf84a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeMemberWriterImpl.java @@ -26,6 +26,7 @@ package jdk.javadoc.internal.doclets.formats.html; import javax.lang.model.SourceVersion; +import javax.lang.model.element.AnnotationValue; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; @@ -36,39 +37,71 @@ import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.Text; -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; +import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeMemberWriter; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; /** - * Writes annotation type required member documentation in HTML format. + * Writes annotation interface member documentation in HTML format. * *

      This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. * This code and its internal interfaces are subject to change or * deletion without notice. */ -public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter - implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter { +public class AnnotationTypeMemberWriterImpl extends AbstractMemberWriter + implements AnnotationTypeMemberWriter, MemberSummaryWriter { /** - * Construct a new AnnotationTypeRequiredMemberWriterImpl. + * We generate separate summaries for required and optional annotation interface members, + * so we need dedicated writer instances for each kind. For the details section, a single + * shared list is generated so a special {@code ANY} value is provided for this case. + */ + enum Kind { + OPTIONAL, + REQUIRED, + ANY + } + + private final Kind kind; + + /** + * Constructs a new AnnotationTypeMemberWriterImpl for any kind of member. + * + * @param writer The writer for the class that the member belongs to. + */ + public AnnotationTypeMemberWriterImpl(SubWriterHolderWriter writer) { + super(writer); + this.kind = Kind.ANY; + } + + /** + * Constructs a new AnnotationTypeMemberWriterImpl for a specific kind of member. * * @param writer the writer that will write the output. * @param annotationType the AnnotationType that holds this member. + * @param kind the kind of annotation interface members to handle. */ - public AnnotationTypeRequiredMemberWriterImpl(SubWriterHolderWriter writer, - TypeElement annotationType) { + public AnnotationTypeMemberWriterImpl(SubWriterHolderWriter writer, + TypeElement annotationType, + Kind kind) { super(writer, annotationType); + this.kind = kind; } @Override public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) { - memberSummaryTree.add(selectComment( - MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY, - MarkerComments.START_OF_ANNOTATION_INTERFACE_REQUIRED_MEMBER_SUMMARY)); + switch (kind) { + case OPTIONAL -> memberSummaryTree.add(selectComment( + MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY, + MarkerComments.START_OF_ANNOTATION_INTERFACE_OPTIONAL_MEMBER_SUMMARY)); + case REQUIRED -> memberSummaryTree.add(selectComment( + MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY, + MarkerComments.START_OF_ANNOTATION_INTERFACE_REQUIRED_MEMBER_SUMMARY)); + case ANY -> throw new UnsupportedOperationException("unsupported member kind"); + } Content memberTree = new ContentBuilder(); writer.addSummaryHeader(this, memberTree); return memberTree; @@ -82,7 +115,12 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter @Override public void addSummary(Content summariesList, Content content) { writer.addSummary(HtmlStyle.memberSummary, - HtmlIds.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY, summariesList, content); + switch (kind) { + case REQUIRED -> HtmlIds.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY; + case OPTIONAL -> HtmlIds.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY; + case ANY -> throw new UnsupportedOperationException("unsupported member kind"); + }, + summariesList, content); } @Override @@ -95,12 +133,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter @Override public Content getAnnotationDetailsTreeHeader() { Content memberDetailsTree = new ContentBuilder(); - if (!writer.printedAnnotationHeading) { - Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, - contents.annotationTypeDetailsLabel); - memberDetailsTree.add(heading); - writer.printedAnnotationHeading = true; - } + Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING, + contents.annotationTypeDetailsLabel); + memberDetailsTree.add(heading); return memberDetailsTree; } @@ -151,7 +186,11 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter @Override public void addSummaryLabel(Content memberTree) { HtmlTree label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, - contents.annotateTypeRequiredMemberSummaryLabel); + switch (kind) { + case REQUIRED -> contents.annotateTypeRequiredMemberSummaryLabel; + case OPTIONAL -> contents.annotateTypeOptionalMemberSummaryLabel; + case ANY -> throw new UnsupportedOperationException("unsupported member kind"); + }); memberTree.add(label); } @@ -159,15 +198,24 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter * Get the caption for the summary table. * @return the caption */ - // Overridden by AnnotationTypeOptionalMemberWriterImpl protected Content getCaption() { - return contents.getContent("doclet.Annotation_Type_Required_Members"); + return contents.getContent( + switch (kind) { + case REQUIRED -> "doclet.Annotation_Type_Required_Members"; + case OPTIONAL -> "doclet.Annotation_Type_Optional_Members"; + case ANY -> throw new UnsupportedOperationException("unsupported member kind"); + }); } @Override public TableHeader getSummaryTableHeader(Element member) { return new TableHeader(contents.modifierAndTypeLabel, - contents.annotationTypeRequiredMemberLabel, contents.descriptionLabel); + switch (kind) { + case REQUIRED -> contents.annotationTypeRequiredMemberLabel; + case OPTIONAL -> contents.annotationTypeOptionalMemberLabel; + case ANY -> throw new UnsupportedOperationException("unsupported member kind"); + }, + contents.descriptionLabel); } @Override @@ -219,4 +267,17 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter ? utils.getReturnType(typeElement, (ExecutableElement) member) : member.asType(); } + + public void addDefaultValueInfo(Element member, Content annotationDocTree) { + if (utils.isAnnotationType(member)) { + ExecutableElement ee = (ExecutableElement) member; + AnnotationValue value = ee.getDefaultValue(); + if (value != null) { + Content dl = HtmlTree.DL(HtmlStyle.notes); + dl.add(HtmlTree.DT(contents.default_)); + dl.add(HtmlTree.DD(Text.of(value.toString()))); + annotationDocTree.add(dl); + } + } + } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java deleted file mode 100644 index 290ae528683..00000000000 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2003, 2021, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.javadoc.internal.doclets.formats.html; - -import javax.lang.model.element.AnnotationValue; -import javax.lang.model.element.Element; -import javax.lang.model.element.ExecutableElement; -import javax.lang.model.element.TypeElement; - -import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; -import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; -import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Text; -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter; -import jdk.javadoc.internal.doclets.toolkit.Content; -import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; - - -/** - * Writes annotation type optional member documentation in HTML format. - * - *

      This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -public class AnnotationTypeOptionalMemberWriterImpl extends - AnnotationTypeRequiredMemberWriterImpl - implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter { - - /** - * Construct a new AnnotationTypeOptionalMemberWriterImpl. - * - * @param writer the writer that will write the output. - * @param annotationType the AnnotationType that holds this member. - */ - public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer, - TypeElement annotationType) { - super(writer, annotationType); - } - - @Override - public Content getMemberSummaryHeader(TypeElement typeElement, - Content memberSummaryTree) { - memberSummaryTree.add(selectComment( - MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY, - MarkerComments.START_OF_ANNOTATION_INTERFACE_OPTIONAL_MEMBER_SUMMARY)); - Content memberTree = new ContentBuilder(); - writer.addSummaryHeader(this, memberTree); - return memberTree; - } - - @Override - public void addSummary(Content summariesList, Content content) { - writer.addSummary(HtmlStyle.memberSummary, - HtmlIds.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY, summariesList, content); - } - - @Override - public void addDefaultValueInfo(Element member, Content annotationDocTree) { - if (utils.isAnnotationType(member)) { - ExecutableElement ee = (ExecutableElement) member; - AnnotationValue value = ee.getDefaultValue(); - if (value != null) { - Content dl = HtmlTree.DL(HtmlStyle.notes); - dl.add(HtmlTree.DT(contents.default_)); - dl.add(HtmlTree.DD(Text.of(value.toString()))); - annotationDocTree.add(dl); - } - } - } - - @Override - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, - contents.annotateTypeOptionalMemberSummaryLabel); - memberTree.add(label); - } - - @Override - protected Content getCaption() { - return contents.getContent("doclet.Annotation_Type_Optional_Members"); - } - - @Override - public TableHeader getSummaryTableHeader(Element member) { - return new TableHeader(contents.modifierAndTypeLabel, - contents.annotationTypeOptionalMemberLabel, contents.descriptionLabel); - } -} diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index c3da4f5a81e..6014745a2e5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -177,11 +177,6 @@ public class HtmlDocletWriter { protected final HtmlIds htmlIds; - /** - * To check whether annotation heading is printed or not. - */ - protected boolean printedAnnotationHeading = false; - /** * To check whether the repeated annotations is documented or not. */ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java index 29831d836b7..3357b7c42ab 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java @@ -442,6 +442,8 @@ public class HtmlIds { case FIELDS -> FIELD_SUMMARY; case CONSTRUCTORS -> CONSTRUCTOR_SUMMARY; case METHODS -> METHOD_SUMMARY; + // We generate separate summaries for optional and required annotation members + case ANNOTATION_TYPE_MEMBER -> throw new IllegalArgumentException("unsupported member kind"); case ANNOTATION_TYPE_MEMBER_OPTIONAL -> ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY; case ANNOTATION_TYPE_MEMBER_REQUIRED -> ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY; case PROPERTIES -> PROPERTY_SUMMARY; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java index 7ecbad9d6fd..4ebd0c3f5c0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java @@ -389,19 +389,9 @@ public class Navigation { if (documentedPage == PageMode.CLASS) { List listContents = new ArrayList<>(); VisibleMemberTable vmt = configuration.getVisibleMemberTable((TypeElement) element); - if (element.getKind() == ElementKind.ANNOTATION_TYPE) { - // Handle annotation interfaces separately as required and optional elements - // share a combined details section. - addTypeDetailLink(FIELDS, !vmt.getVisibleMembers(FIELDS).isEmpty(), listContents); - boolean hasAnnotationElements = - !vmt.getVisibleMembers(ANNOTATION_TYPE_MEMBER_OPTIONAL).isEmpty() - || !vmt.getVisibleMembers(ANNOTATION_TYPE_MEMBER_REQUIRED).isEmpty(); - addTypeDetailLink(ANNOTATION_TYPE_MEMBER_REQUIRED, hasAnnotationElements, listContents); - } else { - Set detailSet = VisibleMemberTable.Kind.forDetailsOf(element.getKind()); - for (VisibleMemberTable.Kind kind : detailSet) { - addTypeDetailLink(kind, !vmt.getVisibleMembers(kind).isEmpty(), listContents); - } + Set detailSet = VisibleMemberTable.Kind.forDetailsOf(element.getKind()); + for (VisibleMemberTable.Kind kind : detailSet) { + addTypeDetailLink(kind, !vmt.getVisibleMembers(kind).isEmpty(), listContents); } if (!listContents.isEmpty()) { if (nested) { @@ -432,10 +422,8 @@ public class Navigation { case FIELDS -> links.createLink(HtmlIds.FIELD_DETAIL, contents.navField, link); case METHODS -> links.createLink(HtmlIds.METHOD_DETAIL, contents.navMethod, link); case PROPERTIES -> links.createLink(HtmlIds.PROPERTY_DETAIL, contents.navProperty, link); - case ANNOTATION_TYPE_MEMBER_REQUIRED, - ANNOTATION_TYPE_MEMBER_OPTIONAL -> - links.createLink(HtmlIds.ANNOTATION_TYPE_ELEMENT_DETAIL, - contents.navAnnotationTypeMember, link); + case ANNOTATION_TYPE_MEMBER -> links.createLink(HtmlIds.ANNOTATION_TYPE_ELEMENT_DETAIL, + contents.navAnnotationTypeMember, link); default -> Text.EMPTY; }); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java index 1b0eea44f1c..56bf9b59fe4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SummaryListWriter.java @@ -254,7 +254,8 @@ public class SummaryListWriter extends SubWrite case ENUM_CONSTANT -> new EnumConstantWriterImpl(this); case RECORD_COMPONENT -> throw new AssertionError("Record components are not supported by SummaryListWriter!"); - default -> new AnnotationTypeOptionalMemberWriterImpl(this, null); + default -> + throw new UnsupportedOperationException("Unsupported element kind: " + e.getKind()); }; return writer.getSummaryLink(e); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java index f1ad334c09b..fca9b29a3bb 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -31,8 +31,6 @@ import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter; -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; import jdk.javadoc.internal.doclets.toolkit.ClassWriter; import jdk.javadoc.internal.doclets.toolkit.ConstantsSummaryWriter; import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler; @@ -80,19 +78,27 @@ public class WriterFactoryImpl implements WriterFactory { } @Override - public AnnotationTypeOptionalMemberWriter getAnnotationTypeOptionalMemberWriter( + public AnnotationTypeMemberWriterImpl getAnnotationTypeMemberWriter( ClassWriter classWriter) { TypeElement te = classWriter.getTypeElement(); - return new AnnotationTypeOptionalMemberWriterImpl( - (ClassWriterImpl) classWriter, te); + return new AnnotationTypeMemberWriterImpl( + (ClassWriterImpl) classWriter, te, AnnotationTypeMemberWriterImpl.Kind.ANY); } @Override - public AnnotationTypeRequiredMemberWriter getAnnotationTypeRequiredMemberWriter( + public AnnotationTypeMemberWriterImpl getAnnotationTypeOptionalMemberWriter( ClassWriter classWriter) { TypeElement te = classWriter.getTypeElement(); - return new AnnotationTypeRequiredMemberWriterImpl( - (ClassWriterImpl) classWriter, te); + return new AnnotationTypeMemberWriterImpl( + (ClassWriterImpl) classWriter, te, AnnotationTypeMemberWriterImpl.Kind.OPTIONAL); + } + + @Override + public AnnotationTypeMemberWriterImpl getAnnotationTypeRequiredMemberWriter( + ClassWriter classWriter) { + TypeElement te = classWriter.getTypeElement(); + return new AnnotationTypeMemberWriterImpl( + (ClassWriterImpl) classWriter, te, AnnotationTypeMemberWriterImpl.Kind.REQUIRED); } @Override @@ -132,11 +138,9 @@ public class WriterFactoryImpl implements WriterFactory { case ENUM_CONSTANTS: return getEnumConstantWriter(classWriter); case ANNOTATION_TYPE_MEMBER_OPTIONAL: - return (AnnotationTypeOptionalMemberWriterImpl) - getAnnotationTypeOptionalMemberWriter(classWriter); + return getAnnotationTypeOptionalMemberWriter(classWriter); case ANNOTATION_TYPE_MEMBER_REQUIRED: - return (AnnotationTypeRequiredMemberWriterImpl) - getAnnotationTypeRequiredMemberWriter(classWriter); + return getAnnotationTypeRequiredMemberWriter(classWriter); case FIELDS: return getFieldWriter(classWriter); case PROPERTIES: diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeMemberWriter.java similarity index 78% rename from src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java rename to src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeMemberWriter.java index 4d1d0e32841..5392360eab2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeMemberWriter.java @@ -36,31 +36,31 @@ import javax.lang.model.element.Element; * deletion without notice. */ -public interface AnnotationTypeRequiredMemberWriter extends MemberWriter { +public interface AnnotationTypeMemberWriter extends MemberWriter { /** - * Add the annotation type member tree header. + * Adds the annotation type member tree header. * * @return content tree for the member tree header */ Content getMemberTreeHeader(); /** - * Add the annotation type details marker. + * Adds the annotation type details marker. * * @param memberDetails the content tree representing details marker */ void addAnnotationDetailsMarker(Content memberDetails); /** - * Add the annotation type details tree header. + * Adds the annotation type details tree header. * * @return content tree for the annotation details header */ Content getAnnotationDetailsTreeHeader(); /** - * Get the annotation type documentation tree header. + * Gets the annotation type documentation tree header. * * @param member the annotation type being documented * @return content tree for the annotation type documentation header @@ -68,7 +68,7 @@ public interface AnnotationTypeRequiredMemberWriter extends MemberWriter { Content getAnnotationDocTreeHeader(Element member); /** - * Get the annotation type details tree. + * Gets the annotation type details tree. * * @param annotationDetailsTreeHeader the content tree representing annotation type details header * @param annotationDetailsTree the content tree representing annotation type details @@ -77,7 +77,7 @@ public interface AnnotationTypeRequiredMemberWriter extends MemberWriter { Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree); /** - * Get the signature for the given member. + * Gets the signature for the given member. * * @param member the member being documented * @return content tree for the annotation type signature @@ -85,7 +85,7 @@ public interface AnnotationTypeRequiredMemberWriter extends MemberWriter { Content getSignature(Element member); /** - * Add the deprecated output for the given member. + * Adds the deprecated output for the given member. * * @param member the member being documented * @param annotationDocTree content tree to which the deprecated information will be added @@ -93,15 +93,15 @@ public interface AnnotationTypeRequiredMemberWriter extends MemberWriter { void addDeprecated(Element member, Content annotationDocTree); /** - * Add the preview output for the given member. + * Adds the preview output for the given member. * * @param member the member being documented - * @param annotationDocTree content tree to which the preview information will be added + * @param contentTree content tree to which the preview information will be added */ void addPreview(Element member, Content contentTree); /** - * Add the comments for the given member. + * Adds the comments for the given member. * * @param member the member being documented * @param annotationDocTree the content tree to which the comments will be added @@ -109,10 +109,18 @@ public interface AnnotationTypeRequiredMemberWriter extends MemberWriter { void addComments(Element member, Content annotationDocTree); /** - * Add the tags for the given member. + * Adds the tags for the given member. * * @param member the member being documented * @param annotationDocTree the content tree to which the tags will be added */ void addTags(Element member, Content annotationDocTree); + + /** + * Adds the default value documentation if the member has one. + * + * @param member the member being documented + * @param annotationDocTree content tree to which the default value will be added + */ + void addDefaultValueInfo(Element member, Content annotationDocTree); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeOptionalMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeOptionalMemberWriter.java deleted file mode 100644 index 60eb2ac9bdf..00000000000 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeOptionalMemberWriter.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2003, 2019, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.javadoc.internal.doclets.toolkit; - -import javax.lang.model.element.Element; - -/** - * The interface for writing annotation type optional member output. - * - *

      This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ - -public interface AnnotationTypeOptionalMemberWriter extends - AnnotationTypeRequiredMemberWriter { - - /** - * Add the the default value documentation. - * - * @param member the member being documented - * @param annotationDocTree content tree to which the default value will be added - */ - void addDefaultValueInfo(Element member, Content annotationDocTree); -} diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java index fe685fa49e3..d54ff4d4587 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WriterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -89,6 +89,16 @@ public interface WriterFactory { */ MethodWriter getMethodWriter(ClassWriter classWriter); + /** + * Return the annotation type member writer for a given annotation + * type, or null if this writer is not supported by the doclet. + * + * @param classWriter the writer for the annotation type being documented + * @return the member writer + */ + AnnotationTypeMemberWriter getAnnotationTypeMemberWriter( + ClassWriter classWriter); + /** * Return the annotation type optional member writer for a given annotation * type, or null if this writer is not supported by the doclet. @@ -96,7 +106,7 @@ public interface WriterFactory { * @param classWriter the writer for the annotation type being documented * @return the member writer */ - AnnotationTypeOptionalMemberWriter getAnnotationTypeOptionalMemberWriter( + AnnotationTypeMemberWriter getAnnotationTypeOptionalMemberWriter( ClassWriter classWriter); /** @@ -106,7 +116,7 @@ public interface WriterFactory { * @param classWriter the writer for the annotation type being documented * @return the member writer */ - AnnotationTypeRequiredMemberWriter getAnnotationTypeRequiredMemberWriter( + AnnotationTypeMemberWriter getAnnotationTypeRequiredMemberWriter( ClassWriter classWriter); /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java index aa191b84c30..7a8d5102592 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractMemberBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -94,7 +94,7 @@ public abstract class AbstractMemberBuilder extends AbstractBuilder { * @param kind of members * @return a list of members */ - protected List getVisibleMembers(Kind kind) { + protected List getVisibleMembers(Kind kind) { return visibleMemberTable.getVisibleMembers(kind); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeMemberBuilder.java similarity index 81% rename from src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java rename to src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeMemberBuilder.java index 6fb8775e373..ca2804c0d08 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeMemberBuilder.java @@ -29,13 +29,11 @@ import java.util.*; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; -import jdk.javadoc.internal.doclets.formats.html.AbstractMemberWriter; -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; +import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeMemberWriter; import jdk.javadoc.internal.doclets.toolkit.BaseOptions; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.DocletException; -import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable; import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*; @@ -47,18 +45,17 @@ import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind. * This code and its internal interfaces are subject to change or * deletion without notice. */ -public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { - +public class AnnotationTypeMemberBuilder extends AbstractMemberBuilder { /** * The writer to output the member documentation. */ - protected AnnotationTypeRequiredMemberWriter writer; + protected AnnotationTypeMemberWriter writer; /** * The list of members being documented. */ - protected List members; + protected List members; /** * The index of the current member that is being documented at this point @@ -72,15 +69,15 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { * @param context the build context. * @param typeElement the class whose members are being documented. * @param writer the doclet specific writer. - * @param memberType the kind of member this builder processes. */ - protected AnnotationTypeRequiredMemberBuilder(Context context, - TypeElement typeElement, - AnnotationTypeRequiredMemberWriter writer, - VisibleMemberTable.Kind memberType) { + protected AnnotationTypeMemberBuilder(Context context, + TypeElement typeElement, + AnnotationTypeMemberWriter writer) { super(context, typeElement); this.writer = Objects.requireNonNull(writer); - this.members = getVisibleMembers(memberType); + // In contrast to the annotation interface member summaries the details generated + // by this builder share a single list for both required and optional members. + this.members = getVisibleMembers(ANNOTATION_TYPE_MEMBER); } @@ -92,11 +89,11 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { * @param writer the doclet specific writer. * @return an instance of this object */ - public static AnnotationTypeRequiredMemberBuilder getInstance( + public static AnnotationTypeMemberBuilder getInstance( Context context, TypeElement typeElement, - AnnotationTypeRequiredMemberWriter writer) { - return new AnnotationTypeRequiredMemberBuilder(context, typeElement, - writer, ANNOTATION_TYPE_MEMBER_REQUIRED); + AnnotationTypeMemberWriter writer) { + return new AnnotationTypeMemberBuilder(context, typeElement, + writer); } /** @@ -110,18 +107,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { @Override public void build(Content contentTree) throws DocletException { - buildAnnotationTypeRequiredMember(contentTree); - } - - /** - * Build the annotation type required member documentation. - * - * @param memberDetailsTree the content tree to which the documentation will be added - * @throws DocletException if there is a problem while building the documentation - */ - protected void buildAnnotationTypeRequiredMember(Content memberDetailsTree) - throws DocletException { - buildAnnotationTypeMember(memberDetailsTree); + buildAnnotationTypeMember(contentTree); } /** @@ -156,6 +142,7 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { buildPreviewInfo(annotationDocTree); buildMemberComments(annotationDocTree); buildTagInfo(annotationDocTree); + buildDefaultValueInfo(annotationDocTree); } /** @@ -206,13 +193,22 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { writer.addTags(currentMember, annotationDocTree); } + /** + * Build the default value for this optional member. + * + * @param annotationDocTree the content tree to which the documentation will be added + */ + protected void buildDefaultValueInfo(Content annotationDocTree) { + writer.addDefaultValueInfo(currentMember, annotationDocTree); + } + /** * Return the annotation type required member writer for this builder. * * @return the annotation type required member constant writer for this * builder. */ - public AnnotationTypeRequiredMemberWriter getWriter() { + public AnnotationTypeMemberWriter getWriter() { return writer; } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java deleted file mode 100644 index cd33482527c..00000000000 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2003, 2020, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.javadoc.internal.doclets.toolkit.builders; - -import javax.lang.model.element.TypeElement; - -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter; -import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter; -import jdk.javadoc.internal.doclets.toolkit.Content; -import jdk.javadoc.internal.doclets.toolkit.DocletException; - -import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*; - -/** - * Builds documentation for optional annotation type members. - * - *

      This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -public class AnnotationTypeOptionalMemberBuilder extends AnnotationTypeRequiredMemberBuilder { - - /** - * Construct a new AnnotationTypeMemberBuilder. - * - * @param context the build context. - * @param typeElement the class whose members are being documented. - * @param writer the doclet specific writer. - */ - private AnnotationTypeOptionalMemberBuilder(Context context, - TypeElement typeElement, - AnnotationTypeOptionalMemberWriter writer) { - super(context, typeElement, writer, ANNOTATION_TYPE_MEMBER_OPTIONAL); - } - - - /** - * Construct a new AnnotationTypeMemberBuilder. - * - * @param context the build context. - * @param typeElement the class whose members are being documented. - * @param writer the doclet specific writer. - * @return the new AnnotationTypeMemberBuilder - */ - public static AnnotationTypeOptionalMemberBuilder getInstance( - Context context, TypeElement typeElement, - AnnotationTypeOptionalMemberWriter writer) { - return new AnnotationTypeOptionalMemberBuilder(context, - typeElement, writer); - } - - @Override - public void build(Content contentTree) throws DocletException { - buildAnnotationTypeOptionalMember(contentTree); - } - - /** - * Build the annotation type optional member documentation. - * - * @param memberDetailsTree the content tree to which the documentation will be added - * @throws DocletException if there is a problem while building the documentation - */ - protected void buildAnnotationTypeOptionalMember(Content memberDetailsTree) - throws DocletException { - buildAnnotationTypeMember(memberDetailsTree); - } - - @Override - protected void buildAnnotationTypeMemberChildren(Content annotationDocTree) { - super.buildAnnotationTypeMemberChildren(annotationDocTree); - buildDefaultValueInfo(annotationDocTree); - } - - /** - * Build the default value for this optional member. - * - * @param annotationDocTree the content tree to which the documentation will be added - */ - protected void buildDefaultValueInfo(Content annotationDocTree) { - ((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo(currentMember, - annotationDocTree); - } - - @Override - public AnnotationTypeRequiredMemberWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java index b93decbb424..304c21ccd1e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -38,9 +38,6 @@ import jdk.javadoc.internal.doclets.toolkit.PropertyWriter; import jdk.javadoc.internal.doclets.toolkit.WriterFactory; import jdk.javadoc.internal.doclets.toolkit.util.ClassTree; - - - /** * The factory for constructing builders. * @@ -133,26 +130,11 @@ public class BuilderFactory { * @return an instance of the annotation type member builder for the given * annotation type. */ - public AbstractMemberBuilder getAnnotationTypeOptionalMemberBuilder( - ClassWriter classWriter) { - return AnnotationTypeOptionalMemberBuilder.getInstance(context, - classWriter.getTypeElement(), - writerFactory.getAnnotationTypeOptionalMemberWriter(classWriter)); - } - - /** - * Return an instance of the annotation type member builder for the given - * class. - * - * @param classWriter the writer for the enclosing annotation type - * @return an instance of the annotation type member builder for the given - * annotation type. - */ - public AbstractMemberBuilder getAnnotationTypeRequiredMemberBuilder( + public AbstractMemberBuilder getAnnotationTypeMemberBuilder( ClassWriter classWriter) { - return AnnotationTypeRequiredMemberBuilder.getInstance(context, + return AnnotationTypeMemberBuilder.getInstance(context, classWriter.getTypeElement(), - writerFactory.getAnnotationTypeRequiredMemberWriter(classWriter)); + writerFactory.getAnnotationTypeMemberWriter(classWriter)); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java index 7c2171330e5..5642ebaad75 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -324,8 +324,7 @@ public class ClassBuilder extends AbstractBuilder { buildPropertyDetails(detailsList); buildFieldDetails(detailsList); buildConstructorDetails(detailsList); - buildAnnotationTypeRequiredMemberDetails(detailsList); - buildAnnotationTypeOptionalMemberDetails(detailsList); + buildAnnotationTypeMemberDetails(detailsList); buildMethodDetails(detailsList); classContentTree.add(writer.getMemberDetailsTree(detailsList)); @@ -387,20 +386,9 @@ public class ClassBuilder extends AbstractBuilder { * @param memberDetailsTree the content tree to which the documentation will be added * @throws DocletException if there is a problem building the documentation */ - protected void buildAnnotationTypeOptionalMemberDetails(Content memberDetailsTree) + protected void buildAnnotationTypeMemberDetails(Content memberDetailsTree) throws DocletException { - builderFactory.getAnnotationTypeOptionalMemberBuilder(writer).build(memberDetailsTree); - } - - /** - * Build the annotation type required member documentation. - * - * @param memberDetailsTree the content tree to which the documentation will be added - * @throws DocletException if there is a problem building the documentation - */ - protected void buildAnnotationTypeRequiredMemberDetails(Content memberDetailsTree) - throws DocletException { - builderFactory.getAnnotationTypeRequiredMemberBuilder(writer).build(memberDetailsTree); + builderFactory.getAnnotationTypeMemberBuilder(writer).build(memberDetailsTree); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java index 68d2f027113..096b23a2e12 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/VisibleMemberTable.java @@ -103,8 +103,9 @@ public class VisibleMemberTable { FIELDS, CONSTRUCTORS, METHODS, - ANNOTATION_TYPE_MEMBER_OPTIONAL, + ANNOTATION_TYPE_MEMBER, ANNOTATION_TYPE_MEMBER_REQUIRED, + ANNOTATION_TYPE_MEMBER_OPTIONAL, PROPERTIES; private static final EnumSet defaultSummarySet = EnumSet.of( @@ -112,11 +113,13 @@ public class VisibleMemberTable { private static final EnumSet enumSummarySet = EnumSet.of( NESTED_CLASSES, ENUM_CONSTANTS, FIELDS, METHODS); private static final EnumSet annotationSummarySet = EnumSet.of( - FIELDS, ANNOTATION_TYPE_MEMBER_OPTIONAL, ANNOTATION_TYPE_MEMBER_REQUIRED); + FIELDS, ANNOTATION_TYPE_MEMBER_REQUIRED, ANNOTATION_TYPE_MEMBER_OPTIONAL); private static final EnumSet defaultDetailSet = EnumSet.of( FIELDS, CONSTRUCTORS, METHODS); private static final EnumSet enumDetailSet = EnumSet.of( ENUM_CONSTANTS, FIELDS, METHODS); + private static final EnumSet annotationDetailSet = EnumSet.of( + FIELDS, ANNOTATION_TYPE_MEMBER); /** * {@return the set of possible member kinds for the summaries section of a type element} @@ -135,9 +138,11 @@ public class VisibleMemberTable { * @param kind the kind of type element being documented */ public static Set forDetailsOf(ElementKind kind) { - return kind == ElementKind.ENUM - ? enumDetailSet - : defaultDetailSet; + return switch (kind) { + case ANNOTATION_TYPE -> annotationDetailSet; + case ENUM -> enumDetailSet; + default -> defaultDetailSet; + }; } } @@ -213,7 +218,7 @@ public class VisibleMemberTable { * @param kind the member kind * @return a list of all visible members */ - public List getAllVisibleMembers(Kind kind) { + public List getAllVisibleMembers(Kind kind) { ensureInitialized(); return visibleMembers.getOrDefault(kind, Collections.emptyList()); } @@ -225,7 +230,7 @@ public class VisibleMemberTable { * @param p the predicate used to filter the output * @return a list of visible enclosed members */ - public List getVisibleMembers(Kind kind, Predicate p) { + public List getVisibleMembers(Kind kind, Predicate p) { ensureInitialized(); return visibleMembers.getOrDefault(kind, Collections.emptyList()).stream() @@ -240,7 +245,7 @@ public class VisibleMemberTable { * @param kind the member kind * @return a list of visible enclosed members */ - public List getVisibleMembers(Kind kind) { + public List getVisibleMembers(Kind kind) { Predicate declaredAndLeafMembers = e -> { TypeElement encl = utils.getEnclosingTypeElement(e); return encl == te || utils.isUndocumentedEnclosure(encl); @@ -255,7 +260,7 @@ public class VisibleMemberTable { * * @return a list of visible enclosed members in this type */ - public List getMembers(Kind kind) { + public List getMembers(Kind kind) { Predicate onlyLocallyDeclaredMembers = e -> utils.getEnclosingTypeElement(e) == te; return getVisibleMembers(kind, onlyLocallyDeclaredMembers); } @@ -777,6 +782,7 @@ public class VisibleMemberTable { case METHOD: if (utils.isAnnotationType(te)) { ExecutableElement ee = (ExecutableElement) e; + addMember(e, Kind.ANNOTATION_TYPE_MEMBER); addMember(e, ee.getDefaultValue() == null ? Kind.ANNOTATION_TYPE_MEMBER_REQUIRED : Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL); diff --git a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java index 8ad39de828c..b8311627d10 100644 --- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java +++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java @@ -24,7 +24,7 @@ /* * @test * @bug 4973609 8015249 8025633 8026567 6469561 8071982 8162363 8182765 8223364 - 8242056 8261976 + 8242056 8261976 8223358 * @summary Make sure that annotation types with 0 members does not have * extra HR tags. * @library ../../lib @@ -72,27 +72,84 @@ public class TestAnnotationTypes extends JavadocTester { checkOutput("pkg/AnnotationType.html", true, """ +

      """, """ + """); checkOutput("pkg/AnnotationType.html", true, - "", - "
        ", - "
      • ", - """ -
        """, - "

        Element Details

        ", - "", - "
          ", - "
        • ", - """ -
          """, - "

          value

          \n", - """ -
          int value
          """); + """ +
          +
            + +
          • +
            +

            Required Element Summary

            +
            Required Elements
            +
            +
            Modifier and Type
            +
            Required Element
            +
            Description
            +
            int
            + +
             
            +
            +
            +
          • + +
          • +
            +

            Optional Element Summary

            +
            Optional Elements
            +
            +
            Modifier and Type
            +
            Optional Element
            +
            Description
            +
            java.lang.String
            + +
             
            +
            +
            +
          • +
          +
          """, + """ +
          +
            + +
          • +
            +

            Element Details

            +
              +
            • +
              +

              value

              +
              int value
              +
              +
            • +
            • +
              +

              optional

              +
              java.lang.String optional
              +
              +
              Default:
              +
              ""
              +
              +
              +
            • +
            +
            +
          • +
          +
          """); checkOutput("pkg/AnnotationType.html", false, """ diff --git a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/pkg/AnnotationType.java b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/pkg/AnnotationType.java index 91f3bf117f6..0d21f3c28af 100644 --- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/pkg/AnnotationType.java +++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/pkg/AnnotationType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,4 +30,5 @@ import java.lang.annotation.*; */ @Documented public @interface AnnotationType { int value(); + String optional() default ""; } -- GitLab From f9024d0606e39863b590f0d7c949d569f8bf8abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Tue, 9 Nov 2021 20:17:25 +0000 Subject: [PATCH 264/890] 8230130: javadoc search result dialog shows cut off headers for long results Reviewed-by: jjg --- .../javadoc/internal/doclets/toolkit/resources/stylesheet.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index 04eae7801f1..d61caef2a0e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -586,10 +586,10 @@ ul.ui-autocomplete { position:fixed; z-index:999999; } -ul.ui-autocomplete li { +ul.ui-autocomplete li { float:left; clear:both; - width:100%; + min-width:100%; } .result-highlight { font-weight:bold; -- GitLab From d7012fbd604fc1a54a2d7364a6ca4a32f47ffc7c Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 9 Nov 2021 20:43:51 +0000 Subject: [PATCH 265/890] 8276880: Remove java/lang/RuntimeTests/exec/ExecWithDir as unnecessary Reviewed-by: alanb --- .../lang/RuntimeTests/exec/ExecWithDir.java | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java diff --git a/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java b/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java deleted file mode 100644 index 4f2b723d180..00000000000 --- a/test/jdk/java/lang/RuntimeTests/exec/ExecWithDir.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2002, 2019, 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 4750978 - * @run main/othervm/timeout=300 ExecWithDir - * @summary Ensure that we can fork-and-exec repeatedly when a new working - * directory is specified - */ - -import java.io.File; - -public class ExecWithDir { - - private static final int N = 500; - - public static void main(String args[]) throws Exception { - if (! UnixCommands.isUnix) { - System.out.println("For UNIX only"); - return; - } - UnixCommands.ensureCommandsAvailable("true"); - - final String[] trueCmd = {UnixCommands.findCommand("true")}; - File dir = new File("."); - for (int i = 1; i <= N; i++) { - System.out.print(i); - System.out.print(" e"); - Process p = Runtime.getRuntime().exec(trueCmd, null, dir); - System.out.print('w'); - int s = p.waitFor(); - System.out.println("x " + s); - if (s != 0) throw new Error("Unexpected return code " + s); - - // Avoid "Too many open files" - p.getInputStream().close(); - p.getOutputStream().close(); - p.getErrorStream().close(); - } - } -} -- GitLab From 0699220830a457959b784b35af125b70f43fa3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rickard=20B=C3=A4ckman?= Date: Tue, 9 Nov 2021 21:38:12 +0000 Subject: [PATCH 266/890] 8268882: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc Reviewed-by: neliasso, chagedorn, kvn --- src/hotspot/share/opto/postaloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/postaloc.cpp b/src/hotspot/share/opto/postaloc.cpp index ad1f0cf8aa5..aa9ae37a78a 100644 --- a/src/hotspot/share/opto/postaloc.cpp +++ b/src/hotspot/share/opto/postaloc.cpp @@ -611,7 +611,7 @@ void PhaseChaitin::post_allocate_copy_removal() { if( phi != x && u != x ) // Found a different input u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input } - if (u != NodeSentinel) { // Junk Phi. Remove + if (u != NodeSentinel || phi->outcnt() == 0) { // Junk Phi. Remove phi->replace_by(u); j -= yank_if_dead(phi, block, &value, ®nd); phi_dex--; -- GitLab From c8b0ee6b8a0c1bca8f8357e786f24c8cb6dd7310 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 10 Nov 2021 01:12:43 +0000 Subject: [PATCH 267/890] 8276833: G1: Make G1EvacFailureRegions::par_iterate const Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp | 2 +- src/hotspot/share/gc/g1/g1EvacFailureRegions.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp b/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp index 243903f811d..855c549cd04 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp @@ -56,7 +56,7 @@ void G1EvacFailureRegions::post_collection() { void G1EvacFailureRegions::par_iterate(HeapRegionClosure* closure, HeapRegionClaimer* _hrclaimer, - uint worker_id) { + uint worker_id) const { G1CollectedHeap::heap()->par_iterate_regions_array(closure, _hrclaimer, _evac_failure_regions, diff --git a/src/hotspot/share/gc/g1/g1EvacFailureRegions.hpp b/src/hotspot/share/gc/g1/g1EvacFailureRegions.hpp index d4aa8346199..b524ffaa58f 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureRegions.hpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureRegions.hpp @@ -56,7 +56,7 @@ public: bool contains(uint region_idx) const; void par_iterate(HeapRegionClosure* closure, HeapRegionClaimer* _hrclaimer, - uint worker_id); + uint worker_id) const; uint num_regions_failed_evacuation() const { return Atomic::load(&_evac_failure_regions_cur_length); -- GitLab From c1e41fe38bbbae12e1f73d2cd63c7afffc19475b Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 10 Nov 2021 01:13:30 +0000 Subject: [PATCH 268/890] 8276842: G1: Only calculate size in bytes from words when needed Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1EvacFailure.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1EvacFailure.cpp b/src/hotspot/share/gc/g1/g1EvacFailure.cpp index 305db3fdaef..726795a2081 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailure.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailure.cpp @@ -41,7 +41,7 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure { G1CollectedHeap* _g1h; G1ConcurrentMark* _cm; HeapRegion* _hr; - size_t _marked_bytes; + size_t _marked_words; bool _during_concurrent_start; uint _worker_id; HeapWord* _last_forwarded_object_end; @@ -53,12 +53,12 @@ public: _g1h(G1CollectedHeap::heap()), _cm(_g1h->concurrent_mark()), _hr(hr), - _marked_bytes(0), + _marked_words(0), _during_concurrent_start(during_concurrent_start), _worker_id(worker_id), _last_forwarded_object_end(hr->bottom()) { } - size_t marked_bytes() { return _marked_bytes; } + size_t marked_bytes() { return _marked_words * HeapWordSize; } // Iterate over the live objects in the region to find self-forwarded objects // that need to be kept live. We need to update the remembered sets of these @@ -96,7 +96,7 @@ public: } size_t obj_size = obj->size(); - _marked_bytes += (obj_size * HeapWordSize); + _marked_words += obj_size; PreservedMarks::init_forwarded_mark(obj); HeapWord* obj_end = obj_addr + obj_size; -- GitLab From 8822d41fdcc2c2d568badd72635dc587d21dbd63 Mon Sep 17 00:00:00 2001 From: Jamil Nimeh Date: Wed, 10 Nov 2021 01:24:33 +0000 Subject: [PATCH 269/890] 8274736: Concurrent read/close of SSLSockets causes SSLSessions to be invalidated unnecessarily Reviewed-by: xuelei, wetmore --- .../sun/security/ssl/TransportContext.java | 8 +- .../net/ssl/templates/SSLSocketTemplate.java | 14 +- .../NoInvalidateSocketException.java | 411 ++++++++++++++++++ 3 files changed, 429 insertions(+), 4 deletions(-) create mode 100644 test/jdk/sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java diff --git a/src/java.base/share/classes/sun/security/ssl/TransportContext.java b/src/java.base/share/classes/sun/security/ssl/TransportContext.java index ecffb0a7ffb..c087514c5e2 100644 --- a/src/java.base/share/classes/sun/security/ssl/TransportContext.java +++ b/src/java.base/share/classes/sun/security/ssl/TransportContext.java @@ -26,6 +26,7 @@ package sun.security.ssl; import java.io.IOException; +import java.net.SocketException; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; @@ -383,7 +384,12 @@ final class TransportContext implements ConnectionContext { // invalidate the session if (conSession != null) { - conSession.invalidate(); + // In the case of a low-layer transport error, we want to prevent + // the session from being invalidated since this is not a TLS-level + // error event. + if (!(cause instanceof SocketException)) { + conSession.invalidate(); + } } if (handshakeContext != null && diff --git a/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java b/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java index 7b72d42849d..ce2e3ee121b 100644 --- a/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java +++ b/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java @@ -210,12 +210,12 @@ public class SSLSocketTemplate { /* * Is the server ready to serve? */ - private final CountDownLatch serverCondition = new CountDownLatch(1); + protected final CountDownLatch serverCondition = new CountDownLatch(1); /* * Is the client ready to handshake? */ - private final CountDownLatch clientCondition = new CountDownLatch(1); + protected final CountDownLatch clientCondition = new CountDownLatch(1); /* * What's the server port? Use any free port by default @@ -482,7 +482,15 @@ public class SSLSocketTemplate { * Both sides can throw exceptions, but do you have a preference * as to which side should be the main thread. */ - private static final boolean separateServerThread = false; + private final boolean separateServerThread; + + public SSLSocketTemplate() { + this(false); + } + + public SSLSocketTemplate(boolean sepSrvThread) { + this.separateServerThread = sepSrvThread; + } /* * Boot up the testing, used to drive remainder of the test. diff --git a/test/jdk/sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java b/test/jdk/sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java new file mode 100644 index 00000000000..2b60fdd7a44 --- /dev/null +++ b/test/jdk/sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java @@ -0,0 +1,411 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ + +// +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. +// + +/* + * @test + * @bug 8274736 + * @summary Concurrent read/close of SSLSockets causes SSLSessions to be + * invalidated unnecessarily + * @library /javax/net/ssl/templates + * @run main/othervm NoInvalidateSocketException TLSv1.3 + * @run main/othervm NoInvalidateSocketException TLSv1.2 + * @run main/othervm -Djdk.tls.client.enableSessionTicketExtension=false + * NoInvalidateSocketException TLSv1.2 + */ + + + +import java.io.*; +import javax.net.ssl.*; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +public class NoInvalidateSocketException extends SSLSocketTemplate { + private static final int ITERATIONS = 10; + + // This controls how long the main thread waits before closing the socket. + // This may need tweaking for different environments to get the timing + // right. + private static final int CLOSE_DELAY = 10; + + private static SSLContext clientSSLCtx; + private static SSLSocket theSSLSocket; + private static SSLSession theSSLSession; + private static InputStream theInputStream; + private static String theSSLSocketHashCode; + private static SSLSession lastSSLSession; + private static final List serverCleanupList = new ArrayList<>(); + private static String tlsVersion = null; + + private static int invalidSessCount = 0; + private static volatile boolean readFromSocket = false; + private static volatile boolean finished = false; + + public static void main(String[] args) throws Exception { + if (System.getProperty("javax.net.debug") == null) { + System.setProperty("javax.net.debug", "session"); + } + + if (args != null && args.length >= 1) { + tlsVersion = args[0]; + } + + new NoInvalidateSocketException(true).run(); + if (invalidSessCount > 0) { + throw new RuntimeException("One or more sessions were improperly " + + "invalidated."); + } + } + + public NoInvalidateSocketException(boolean sepSrvThread) { + super(sepSrvThread); + } + + @Override + public boolean isCustomizedClientConnection() { + return true; + } + + @Override + public void runClientApplication(int serverPort) { + Thread.currentThread().setName("Main Client Thread"); + + // Create the SSLContext we'll use for client sockets for the + // duration of the test. + try { + clientSSLCtx = createClientSSLContext(); + } catch (Exception e) { + throw new RuntimeException("Failed to create client ctx", e); + } + + // Create the reader thread + ReaderThread readerThread = new ReaderThread(); + readerThread.setName("Client Reader Thread"); + readerThread.start(); + + try { + for (int i = 0; i < ITERATIONS; i++) { + openSSLSocket(); + doHandshake(); + getInputStream(); + getAndCompareSession(); + + // Perform the Close/Read MT collision + readCloseMultiThreaded(); + + // Check to make sure that the initially negotiated session + // remains intact. + isSessionValid(); + + lastSSLSession = theSSLSession; + + // Insert a short gap between iterations + Thread.sleep(1000); + System.out.println(); + } + } catch (Exception e) { + logToConsole("Unexpected Exception: " + e); + } finally { + // Tell the reader thread to finish + finished = true; + } + } + + private void readCloseMultiThreaded() throws IOException, + InterruptedException { + // Tell the reader thread to start trying to read from this + // socket + readFromSocket = true; + + // Short pause to give the reader thread time to start + // reading. + if (CLOSE_DELAY > 0) { + Thread.sleep(CLOSE_DELAY); + } + + // The problem happens when the reader thread tries to read + // from the socket while this thread is in the close() call + closeSSLSocket(); + + // Pause to give the reader thread time to discover that the + // socket is closed and throw a SocketException + Thread.sleep(500); + } + + private class ReaderThread extends Thread { + public void run() { + // This thread runs in a tight loop until + // readFromSocket == true + while (!finished) { + if (readFromSocket) { + int result = 0; + try { + // If the timing is just + // right, this will throw a SocketException + // and the SSLSession will be + // invalidated. + result = readFromSSLSocket(); + } catch (Exception e) { + logToConsole("Exception reading from SSLSocket@" + + theSSLSocketHashCode + ": " + e); + e.printStackTrace(System.out); + + // Stop trying to read from + // the socket now + readFromSocket = false; + } + + if (result == -1) { + logToConsole("Reached end of stream reading from " + + "SSLSocket@" + theSSLSocketHashCode); + + // Stop trying to read from + // the socket now + readFromSocket = false; + } + } + } + } + } + + private void openSSLSocket() throws IOException { + theSSLSocket = (SSLSocket)clientSSLCtx.getSocketFactory(). + createSocket(serverAddress, serverPort); + if (tlsVersion != null) { + theSSLSocket.setEnabledProtocols(new String[] { tlsVersion }); + } + theSSLSocketHashCode = String.format("%08x", theSSLSocket.hashCode()); + logToConsole("Opened SSLSocket@" + theSSLSocketHashCode); + } + + private void doHandshake() throws IOException { + logToConsole("Started handshake on SSLSocket@" + + theSSLSocketHashCode); + theSSLSocket.startHandshake(); + logToConsole("Finished handshake on SSLSocket@" + + theSSLSocketHashCode); + } + + private void getInputStream() throws IOException { + theInputStream = theSSLSocket.getInputStream(); + } + + private void getAndCompareSession() { + theSSLSession = theSSLSocket.getSession(); + + // Have we opened a new session or re-used the last one? + if (lastSSLSession == null || + !theSSLSession.equals(lastSSLSession)) { + logToConsole("*** OPENED NEW SESSION ***: " + + theSSLSession); + } else { + logToConsole("*** RE-USING PREVIOUS SESSION ***: " + + theSSLSession + ")"); + } + } + + private void closeSSLSocket() throws IOException { + logToConsole("Closing SSLSocket@" + theSSLSocketHashCode); + theSSLSocket.close(); + logToConsole("Closed SSLSocket@" + theSSLSocketHashCode); + } + + private int readFromSSLSocket() throws Exception { + logToConsole("Started reading from SSLSocket@" + + theSSLSocketHashCode); + int result = theInputStream.read(); + logToConsole("Finished reading from SSLSocket@" + + theSSLSocketHashCode + ": result = " + result); + return result; + } + + private void isSessionValid() { + // Is the session still valid? + if (theSSLSession.isValid()) { + logToConsole("*** " + theSSLSession + " IS VALID ***"); + } else { + logToConsole("*** " + theSSLSession + " IS INVALID ***"); + invalidSessCount++; + } + } + + private static void logToConsole(String s) { + System.out.println(System.nanoTime() + ": " + + Thread.currentThread().getName() + ": " + s); + } + + @Override + public void doServerSide() throws Exception { + Thread.currentThread().setName("Server Listener Thread"); + SSLContext context = createServerSSLContext(); + SSLServerSocketFactory sslssf = context.getServerSocketFactory(); + InetAddress serverAddress = this.serverAddress; + SSLServerSocket sslServerSocket = serverAddress == null ? + (SSLServerSocket)sslssf.createServerSocket(serverPort) + : (SSLServerSocket)sslssf.createServerSocket(); + if (serverAddress != null) { + sslServerSocket.bind(new InetSocketAddress(serverAddress, + serverPort)); + } + configureServerSocket(sslServerSocket); + serverPort = sslServerSocket.getLocalPort(); + logToConsole("Listening on " + sslServerSocket.getLocalSocketAddress()); + + // Signal the client, the server is ready to accept connection. + serverCondition.countDown(); + + // Try to accept a connection in 5 seconds. + // We will do this in a loop until the client flips the + // finished variable to true + SSLSocket sslSocket; + + int timeoutCount = 0; + try { + do { + try { + sslSocket = (SSLSocket) sslServerSocket.accept(); + timeoutCount = 0; // Reset the timeout counter; + logToConsole("Accepted connection from " + + sslSocket.getRemoteSocketAddress()); + + // Add the socket to the cleanup list so it can get + // closed at the end of the test + serverCleanupList.add(sslSocket); + + boolean clientIsReady = + clientCondition.await(30L, TimeUnit.SECONDS); + if (clientIsReady) { + // Handle the connection in a new thread + ServerHandlerThread sht = null; + try { + sht = new ServerHandlerThread(sslSocket); + sht.start(); + } finally { + if (sht != null) { + sht.join(); + } + } + } + } catch (SocketTimeoutException ste) { + timeoutCount++; + // If we are finished then we can return, otherwise + // check if we've timed out too many times (an exception + // case). One way or the other we will exit eventually. + if (finished) { + return; + } else if (timeoutCount >= 3) { + logToConsole("Server accept timeout exceeded"); + throw ste; + } + } + } while (!finished); + } finally { + sslServerSocket.close(); + // run through the server cleanup list and close those sockets + // as well. + for (SSLSocket sock : serverCleanupList) { + try { + if (sock != null) { + sock.close(); + } + } catch (IOException ioe) { + // Swallow these close failures as the server itself + // is shutting down anyway. + } + } + } + } + + @Override + public void configureServerSocket(SSLServerSocket socket) { + try { + socket.setReuseAddress(true); + socket.setSoTimeout(5000); + } catch (SocketException se) { + // Rethrow as unchecked to satisfy the override signature + throw new RuntimeException(se); + } + } + + @Override + public void runServerApplication(SSLSocket sslSocket) { + Thread.currentThread().setName("Server Reader Thread"); + SSLSocket sock = null; + sock = sslSocket; + try { + BufferedReader is = new BufferedReader( + new InputStreamReader(sock.getInputStream())); + PrintWriter os = new PrintWriter(new BufferedWriter( + new OutputStreamWriter(sock.getOutputStream()))); + + // Only handle a single burst of data + char[] buf = new char[1024]; + int dataRead = is.read(buf); + logToConsole(String.format("Received: %d bytes of data\n", + dataRead)); + + os.println("Received connection from client"); + os.flush(); + } catch (IOException ioe) { + // Swallow these exceptions for this test + } + } + + private class ServerHandlerThread extends Thread { + SSLSocket sock; + ServerHandlerThread(SSLSocket socket) { + this.sock = Objects.requireNonNull(socket, "Illegal null socket"); + } + + @Override + public void run() { + try { + runServerApplication(sock); + } catch (Exception exc) { + // Wrap inside an unchecked exception to satisfy Runnable + throw new RuntimeException(exc); + } + } + + void close() { + try { + sock.close(); + } catch (IOException e) { + // swallow this exception + } + } + } +} -- GitLab From e91e9d853272ea8f5ce490f2f0c971fd40795d74 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 10 Nov 2021 01:26:35 +0000 Subject: [PATCH 270/890] 8276721: G1: Refine G1EvacFailureObjectsSet::iterate Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1EvacFailure.cpp | 2 +- src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp | 10 +++++----- src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp | 7 ++++--- src/hotspot/share/gc/g1/heapRegion.cpp | 4 ++-- src/hotspot/share/gc/g1/heapRegion.hpp | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1EvacFailure.cpp b/src/hotspot/share/gc/g1/g1EvacFailure.cpp index 726795a2081..10e26706971 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailure.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailure.cpp @@ -165,7 +165,7 @@ public: during_concurrent_start, _worker_id); // Iterates evac failure objs which are recorded during evacuation. - hr->iterate_evac_failure_objs(&rspc); + hr->process_and_drop_evac_failure_objs(&rspc); // Need to zap the remainder area of the processed region. rspc.zap_remainder(); diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp index ae63cee3cbc..d90b8a00540 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp @@ -89,7 +89,7 @@ class G1EvacFailureObjectsIterationHelper { QuickSort::sort(_offset_array, _array_length, order_oop, true); } - void iterate_internal(ObjectClosure* closure) { + void iterate(ObjectClosure* closure) { for (uint i = 0; i < _array_length; i++) { oop cur = _objects_set->from_offset(_offset_array[i]); closure->do_object(cur); @@ -103,13 +103,13 @@ public: _offset_array(nullptr), _array_length(0) { } - void iterate(ObjectClosure* closure) { + void process_and_drop(ObjectClosure* closure) { uint num = _segments->num_allocated_nodes(); _offset_array = NEW_C_HEAP_ARRAY(OffsetInRegion, num, mtGC); join_and_sort(); assert(_array_length == num, "must be %u, %u", _array_length, num); - iterate_internal(closure); + iterate(closure); FREE_C_HEAP_ARRAY(OffsetInRegion, _offset_array); } @@ -121,11 +121,11 @@ public: } }; -void G1EvacFailureObjectsSet::iterate(ObjectClosure* closure) { +void G1EvacFailureObjectsSet::process_and_drop(ObjectClosure* closure) { assert_at_safepoint(); G1EvacFailureObjectsIterationHelper helper(this); - helper.iterate(closure); + helper.process_and_drop(closure); _offsets.drop_all(); } diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp index 50e5265c646..c9b0f75d529 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp @@ -72,9 +72,10 @@ public: // Record an object that failed evacuation. void record(oop obj); - // Apply the given ObjectClosure to all objects that failed evacuation. Objects - // are passed in increasing address order. - void iterate(ObjectClosure* closure); + // Apply the given ObjectClosure to all objects that failed evacuation and + // empties the list after processing. + // Objects are passed in increasing address order. + void process_and_drop(ObjectClosure* closure); }; diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp index 11b025845b6..baf618c2cc4 100644 --- a/src/hotspot/share/gc/g1/heapRegion.cpp +++ b/src/hotspot/share/gc/g1/heapRegion.cpp @@ -106,8 +106,8 @@ void HeapRegion::handle_evacuation_failure() { _next_marked_bytes = 0; } -void HeapRegion::iterate_evac_failure_objs(ObjectClosure* closure) { - _evac_failure_objs.iterate(closure); +void HeapRegion::process_and_drop_evac_failure_objs(ObjectClosure* closure) { + _evac_failure_objs.process_and_drop(closure); } void HeapRegion::unlink_from_list() { diff --git a/src/hotspot/share/gc/g1/heapRegion.hpp b/src/hotspot/share/gc/g1/heapRegion.hpp index 148b61ecb27..2317861388a 100644 --- a/src/hotspot/share/gc/g1/heapRegion.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.hpp @@ -571,7 +571,7 @@ public: void record_evac_failure_obj(oop obj); // Applies the given closure to all previously recorded objects // that failed evacuation in ascending address order. - void iterate_evac_failure_objs(ObjectClosure* closure); + void process_and_drop_evac_failure_objs(ObjectClosure* closure); // Iterate over the objects overlapping the given memory region, applying cl // to all references in the region. This is a helper for -- GitLab From 403f3185f0988dcf6ef4e857d6659533bfa2943f Mon Sep 17 00:00:00 2001 From: Anirvan Sarkar Date: Wed, 10 Nov 2021 05:51:39 +0000 Subject: [PATCH 271/890] 8276854: Windows GHA builds fail due to broken Cygwin Reviewed-by: clanger --- .github/workflows/submit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 99041df6e3b..9d19715a986 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -884,7 +884,7 @@ jobs: run: | New-Item -Force -ItemType directory -Path "$HOME\cygwin" & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe" - Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow + Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.2.0-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow - name: Checkout the source uses: actions/checkout@v2 @@ -973,7 +973,7 @@ jobs: run: | New-Item -Force -ItemType directory -Path "$HOME\cygwin" & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe" - Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow + Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.2.0-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow - name: Checkout the source uses: actions/checkout@v2 @@ -1145,7 +1145,7 @@ jobs: run: | New-Item -Force -ItemType directory -Path "$HOME\cygwin" & curl -L "https://www.cygwin.com/setup-x86_64.exe" -o "$HOME/cygwin/setup-x86_64.exe" - Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow + Start-Process -FilePath "$HOME\cygwin\setup-x86_64.exe" -ArgumentList "--quiet-mode --packages cygwin=3.2.0-1,autoconf,make,zip,unzip --root $HOME\cygwin\cygwin64 --local-package-dir $HOME\cygwin\packages --site http://mirrors.kernel.org/sourceware/cygwin --no-desktop --no-shortcuts --no-startmenu --no-admin" -Wait -NoNewWindow - name: Restore jtreg artifact id: jtreg_restore -- GitLab From fd0a25e62b2c8abc3a419c2e80abbcf11c9e882f Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 10 Nov 2021 07:59:01 +0000 Subject: [PATCH 272/890] 8276805: java/awt/print/PrinterJob/CheckPrivilege.java fails due to disabled SecurityManager Reviewed-by: serb, aivanov --- test/jdk/java/awt/print/PrinterJob/CheckPrivilege.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/java/awt/print/PrinterJob/CheckPrivilege.java b/test/jdk/java/awt/print/PrinterJob/CheckPrivilege.java index de32d587ade..533516664ed 100644 --- a/test/jdk/java/awt/print/PrinterJob/CheckPrivilege.java +++ b/test/jdk/java/awt/print/PrinterJob/CheckPrivilege.java @@ -27,6 +27,7 @@ * @bug 4151151 * @summary Confirm that low-level print code does doPrivilege. * @author Graham Hamilton + * @run main/othervm -Djava.security.manager=allow CheckPrivilege */ import java.awt.print.*; -- GitLab From e01d6d00bc4ab5ca0d38f8894a78e6d911e0fe93 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Wed, 10 Nov 2021 08:34:07 +0000 Subject: [PATCH 273/890] 8276679: Malformed Javadoc inline tags in JDK source in javax/swing Reviewed-by: aivanov, pbansal --- src/java.desktop/share/classes/javax/swing/JTree.java | 2 +- .../share/classes/javax/swing/SwingUtilities.java | 4 ++-- .../share/classes/javax/swing/event/HyperlinkEvent.java | 2 +- .../share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java.desktop/share/classes/javax/swing/JTree.java b/src/java.desktop/share/classes/javax/swing/JTree.java index e48c1b29333..06b76b0d3da 100644 --- a/src/java.desktop/share/classes/javax/swing/JTree.java +++ b/src/java.desktop/share/classes/javax/swing/JTree.java @@ -3675,7 +3675,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * This will fail if a TreeWillExpandListener vetos it. * * @param path a {@code TreePath} identifying a node - * @param state if {@code true}, all parents of @{code path} and path are marked as expanded. + * @param state if {@code true}, all parents of {@code path} and path are marked as expanded. * Otherwise, all parents of {@code path} are marked EXPANDED, * but {@code path} itself is marked collapsed. */ diff --git a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java index 35260056d7e..e15347ec06a 100644 --- a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java +++ b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java @@ -106,12 +106,12 @@ public class SwingUtilities implements SwingConstants } /** - * Return {@code true} if @{code a} contains {@code b} + * Return {@code true} if {@code a} contains {@code b} * * @param a the first rectangle * @param b the second rectangle * - * @return {@code true} if @{code a} contains {@code b} + * @return {@code true} if {@code a} contains {@code b} */ public static final boolean isRectangleContainingRectangle(Rectangle a,Rectangle b) { return b.x >= a.x && (b.x + b.width) <= (a.x + a.width) && diff --git a/src/java.desktop/share/classes/javax/swing/event/HyperlinkEvent.java b/src/java.desktop/share/classes/javax/swing/event/HyperlinkEvent.java index 57e11a4fbd8..c456f9c4f14 100644 --- a/src/java.desktop/share/classes/javax/swing/event/HyperlinkEvent.java +++ b/src/java.desktop/share/classes/javax/swing/event/HyperlinkEvent.java @@ -175,7 +175,7 @@ public class HyperlinkEvent extends EventObject { /** * Returns the {@code InputEvent} that triggered the hyperlink event. * This will typically be a {@code MouseEvent}. If a constructor is used - * that does not specify an {@code InputEvent}, or @{code null} + * that does not specify an {@code InputEvent}, or {@code null} * was specified as the {@code InputEvent}, this returns {@code null}. * * @return InputEvent that triggered the hyperlink event, or null diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index ff3a1596fbd..ccb4272eef4 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -95,7 +95,7 @@ public class BasicComboBoxUI extends ComboBoxUI { protected ComboPopup popup; /** - * The Component that the @{code ComboBoxEditor} uses for editing. + * The Component that the {@code ComboBoxEditor} uses for editing. */ protected Component editor; -- GitLab From 0f463a7bf73791eda9404882ff63daf9040399bb Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 10 Nov 2021 09:50:27 +0000 Subject: [PATCH 274/890] 8276845: (fs) java/nio/file/spi/SetDefaultProvider.java fails on x86_32 Reviewed-by: alanb --- test/jdk/java/nio/file/spi/TestProvider.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/jdk/java/nio/file/spi/TestProvider.java b/test/jdk/java/nio/file/spi/TestProvider.java index 6832e86d20f..e35f88b1060 100644 --- a/test/jdk/java/nio/file/spi/TestProvider.java +++ b/test/jdk/java/nio/file/spi/TestProvider.java @@ -28,6 +28,7 @@ import java.nio.file.attribute.FileAttribute; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.UserPrincipalLookupService; import java.nio.file.spi.FileSystemProvider; +import java.nio.channels.FileChannel; import java.nio.channels.SeekableByteChannel; import java.net.URI; import java.io.IOException; @@ -173,6 +174,16 @@ public class TestProvider extends FileSystemProvider { return defaultProvider.newByteChannel(delegate, options, attrs); } + @Override + public FileChannel newFileChannel(Path file, + Set options, + FileAttribute... attrs) + throws IOException + { + Path delegate = theFileSystem.unwrap(file); + return defaultProvider.newFileChannel(delegate, options, attrs); + } + @Override public boolean isHidden(Path file) throws IOException { throw new ReadOnlyFileSystemException(); -- GitLab From a3f710efbe7dcef18477a96fd306bec19f181f8b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 10 Nov 2021 10:45:51 +0000 Subject: [PATCH 275/890] 8276215: Intrinsics matchers should handle native method flags better Reviewed-by: dholmes, kvn --- src/hotspot/share/classfile/vmIntrinsics.cpp | 6 +- src/hotspot/share/classfile/vmIntrinsics.hpp | 102 ++++++++++++++----- 2 files changed, 79 insertions(+), 29 deletions(-) diff --git a/src/hotspot/share/classfile/vmIntrinsics.cpp b/src/hotspot/share/classfile/vmIntrinsics.cpp index 88f38f406ad..cc3dc1ebdcc 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.cpp +++ b/src/hotspot/share/classfile/vmIntrinsics.cpp @@ -33,13 +33,13 @@ // These are flag-matching functions: inline bool match_F_R(jshort flags) { const int req = 0; - const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED; + const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED | JVM_ACC_NATIVE; return (flags & (req | neg)) == req; } inline bool match_F_Y(jshort flags) { const int req = JVM_ACC_SYNCHRONIZED; - const int neg = JVM_ACC_STATIC; + const int neg = JVM_ACC_STATIC | JVM_ACC_NATIVE; return (flags & (req | neg)) == req; } @@ -51,7 +51,7 @@ inline bool match_F_RN(jshort flags) { inline bool match_F_S(jshort flags) { const int req = JVM_ACC_STATIC; - const int neg = JVM_ACC_SYNCHRONIZED; + const int neg = JVM_ACC_SYNCHRONIZED | JVM_ACC_NATIVE; return (flags & (req | neg)) == req; } diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index 5c79db8a41c..c9d4803b50d 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -107,15 +107,15 @@ class methodHandle; // add the declaration of the intrinsic to the approriate section of the list. #define VM_INTRINSICS_DO(do_intrinsic, do_class, do_name, do_signature, do_alias) \ /* (1) Library intrinsics */ \ - do_intrinsic(_hashCode, java_lang_Object, hashCode_name, void_int_signature, F_R) \ + do_intrinsic(_hashCode, java_lang_Object, hashCode_name, void_int_signature, F_RN) \ do_name( hashCode_name, "hashCode") \ - do_intrinsic(_getClass, java_lang_Object, getClass_name, void_class_signature, F_R) \ + do_intrinsic(_getClass, java_lang_Object, getClass_name, void_class_signature, F_RN) \ do_name( getClass_name, "getClass") \ - do_intrinsic(_clone, java_lang_Object, clone_name, void_object_signature, F_R) \ + do_intrinsic(_clone, java_lang_Object, clone_name, void_object_signature, F_RN) \ do_name( clone_name, "clone") \ - do_intrinsic(_notify, java_lang_Object, notify_name, void_method_signature, F_R) \ + do_intrinsic(_notify, java_lang_Object, notify_name, void_method_signature, F_RN) \ do_name( notify_name, "notify") \ - do_intrinsic(_notifyAll, java_lang_Object, notifyAll_name, void_method_signature, F_R) \ + do_intrinsic(_notifyAll, java_lang_Object, notifyAll_name, void_method_signature, F_RN) \ do_name( notifyAll_name, "notifyAll") \ \ /* Math & StrictMath intrinsics are defined in terms of just a few signatures: */ \ @@ -200,17 +200,17 @@ class methodHandle; /* Special flavor of dsqrt intrinsic to handle the "native" method in StrictMath. Otherwise the same as in Math. */ \ do_intrinsic(_dsqrt_strict, java_lang_StrictMath, sqrt_name, double_double_signature, F_SN) \ \ - do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \ + do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_SN) \ do_name( floatToRawIntBits_name, "floatToRawIntBits") \ do_intrinsic(_floatToIntBits, java_lang_Float, floatToIntBits_name, float_int_signature, F_S) \ do_name( floatToIntBits_name, "floatToIntBits") \ - do_intrinsic(_intBitsToFloat, java_lang_Float, intBitsToFloat_name, int_float_signature, F_S) \ + do_intrinsic(_intBitsToFloat, java_lang_Float, intBitsToFloat_name, int_float_signature, F_SN) \ do_name( intBitsToFloat_name, "intBitsToFloat") \ - do_intrinsic(_doubleToRawLongBits, java_lang_Double, doubleToRawLongBits_name, double_long_signature, F_S) \ + do_intrinsic(_doubleToRawLongBits, java_lang_Double, doubleToRawLongBits_name, double_long_signature, F_SN)\ do_name( doubleToRawLongBits_name, "doubleToRawLongBits") \ do_intrinsic(_doubleToLongBits, java_lang_Double, doubleToLongBits_name, double_long_signature, F_S) \ do_name( doubleToLongBits_name, "doubleToLongBits") \ - do_intrinsic(_longBitsToDouble, java_lang_Double, longBitsToDouble_name, long_double_signature, F_S) \ + do_intrinsic(_longBitsToDouble, java_lang_Double, longBitsToDouble_name, long_double_signature, F_SN)\ do_name( longBitsToDouble_name, "longBitsToDouble") \ \ do_intrinsic(_numberOfLeadingZeros_i, java_lang_Integer, numberOfLeadingZeros_name,int_int_signature, F_S) \ @@ -231,20 +231,20 @@ class methodHandle; do_intrinsic(_reverseBytes_s, java_lang_Short, reverseBytes_name, short_short_signature, F_S) \ /* (symbol reverseBytes_name defined above) */ \ \ - do_intrinsic(_identityHashCode, java_lang_System, identityHashCode_name, object_int_signature, F_S) \ + do_intrinsic(_identityHashCode, java_lang_System, identityHashCode_name, object_int_signature, F_SN) \ do_name( identityHashCode_name, "identityHashCode") \ - do_intrinsic(_currentTimeMillis, java_lang_System, currentTimeMillis_name, void_long_signature, F_S) \ + do_intrinsic(_currentTimeMillis, java_lang_System, currentTimeMillis_name, void_long_signature, F_SN) \ \ do_name( currentTimeMillis_name, "currentTimeMillis") \ - do_intrinsic(_nanoTime, java_lang_System, nanoTime_name, void_long_signature, F_S) \ + do_intrinsic(_nanoTime, java_lang_System, nanoTime_name, void_long_signature, F_SN) \ do_name( nanoTime_name, "nanoTime") \ \ JFR_INTRINSICS(do_intrinsic, do_class, do_name, do_signature, do_alias) \ \ - do_intrinsic(_arraycopy, java_lang_System, arraycopy_name, arraycopy_signature, F_S) \ + do_intrinsic(_arraycopy, java_lang_System, arraycopy_name, arraycopy_signature, F_SN) \ do_name( arraycopy_name, "arraycopy") \ do_signature(arraycopy_signature, "(Ljava/lang/Object;ILjava/lang/Object;II)V") \ - do_intrinsic(_currentThread, java_lang_Thread, currentThread_name, currentThread_signature, F_S) \ + do_intrinsic(_currentThread, java_lang_Thread, currentThread_name, currentThread_signature, F_SN) \ do_name( currentThread_name, "currentThread") \ do_signature(currentThread_signature, "()Ljava/lang/Thread;") \ \ @@ -401,9 +401,9 @@ class methodHandle; 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) \ - do_intrinsic(_Reference_refersTo0, java_lang_ref_Reference, refersTo0_name, object_boolean_signature, F_R) \ - do_intrinsic(_PhantomReference_refersTo0, java_lang_ref_PhantomReference, refersTo0_name, object_boolean_signature, F_R) \ + do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \ + do_intrinsic(_Reference_refersTo0, java_lang_ref_Reference, refersTo0_name, object_boolean_signature, F_RN) \ + do_intrinsic(_PhantomReference_refersTo0, java_lang_ref_PhantomReference, refersTo0_name, object_boolean_signature, F_RN) \ \ /* support for com.sun.crypto.provider.AESCrypt and some of its callers */ \ do_class(com_sun_crypto_provider_aescrypt, "com/sun/crypto/provider/AESCrypt") \ @@ -951,10 +951,10 @@ class methodHandle; \ /* (2) Bytecode intrinsics */ \ \ - do_intrinsic(_park, jdk_internal_misc_Unsafe, park_name, park_signature, F_R) \ + do_intrinsic(_park, jdk_internal_misc_Unsafe, park_name, park_signature, F_RN) \ do_name( park_name, "park") \ do_signature(park_signature, "(ZJ)V") \ - do_intrinsic(_unpark, jdk_internal_misc_Unsafe, unpark_name, unpark_signature, F_R) \ + do_intrinsic(_unpark, jdk_internal_misc_Unsafe, unpark_name, unpark_signature, F_RN) \ do_name( unpark_name, "unpark") \ do_alias( unpark_signature, /*(LObject;)V*/ object_void_signature) \ \ @@ -1090,9 +1090,9 @@ class vmIntrinsics : AllStatic { enum Flags { // AccessFlags syndromes relevant to intrinsics. F_none = 0, - F_R, // !static ?native !synchronized (R="regular") - F_S, // static ?native !synchronized - F_Y, // !static ?native synchronized + F_R, // !static !native !synchronized (R="regular") + F_S, // static !native !synchronized + F_Y, // !static !native synchronized F_RN, // !static native !synchronized F_SN, // static native !synchronized @@ -1102,6 +1102,50 @@ class vmIntrinsics : AllStatic { log2_FLAG_LIMIT = 3 // checked by an assert at start-up }; + static constexpr bool is_flag_static(Flags flags) { + switch (flags) { + case F_S: + case F_SN: + return true; + case F_R: + case F_Y: + case F_RN: + return false; + default: + ShouldNotReachHere(); + return false; + } + } + + static constexpr bool is_flag_synchronized(Flags flags) { + switch (flags) { + case F_Y: + return true; + case F_RN: + case F_SN: + case F_S: + case F_R: + return false; + default: + ShouldNotReachHere(); + return false; + } + } + + static constexpr bool is_flag_native(Flags flags) { + switch (flags) { + case F_RN: + case F_SN: + return true; + case F_S: + case F_R: + case F_Y: + return false; + default: + ShouldNotReachHere(); + return false; + } + } // Convert an arbitrary vmIntrinsicID to int (checks validity): // vmIntrinsicID x = ...; int n = vmIntrinsics::as_int(x); @@ -1153,9 +1197,15 @@ public: // ID _none does not hold the following asserts. if (id == _none) return id; #endif - assert( class_for(id) == holder, "correct id"); - assert( name_for(id) == name, "correct id"); - assert(signature_for(id) == sig, "correct id"); + assert( class_for(id) == holder, "correct class: %s", name_at(id)); + assert( name_for(id) == name, "correct name: %s", name_at(id)); + assert(signature_for(id) == sig, "correct signature: %s", name_at(id)); + assert( is_flag_static(flags_for(id)) == ((flags & JVM_ACC_STATIC) != 0), + "correct static flag: %s", name_at(id)); + assert(is_flag_synchronized(flags_for(id)) == ((flags & JVM_ACC_SYNCHRONIZED) != 0), + "correct synchronized flag: %s", name_at(id)); + assert( is_flag_native(flags_for(id)) == ((flags & JVM_ACC_NATIVE) != 0), + "correct native flag: %s", name_at(id)); return id; } @@ -1164,7 +1214,7 @@ public: static vmSymbolID class_for(ID id); static vmSymbolID name_for(ID id); static vmSymbolID signature_for(ID id); - static Flags flags_for(ID id); + static Flags flags_for(ID id); #endif static bool class_has_intrinsics(vmSymbolID holder); -- GitLab From a0b84453b087ff368a32b93729c5b30fda22ed48 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 10 Nov 2021 11:27:13 +0000 Subject: [PATCH 276/890] 8276846: JDK-8273416 is incomplete for UseSSE=1 Reviewed-by: neliasso, kvn --- src/hotspot/cpu/x86/x86_32.ad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index e4738af4321..4475f053fd0 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -7204,7 +7204,7 @@ instruct castLL( eRegL dst ) %{ %} instruct castFF( regF dst ) %{ - predicate(UseSSE >= 2); + predicate(UseSSE >= 1); match(Set dst (CastFF dst)); format %{ "#castFF of $dst" %} ins_encode( /*empty encoding*/ ); @@ -7222,7 +7222,7 @@ instruct castDD( regD dst ) %{ %} instruct castFF_PR( regFPR dst ) %{ - predicate(UseSSE < 2); + predicate(UseSSE < 1); match(Set dst (CastFF dst)); format %{ "#castFF of $dst" %} ins_encode( /*empty encoding*/ ); -- GitLab From 0f23c6a9feb3657eb20ff5988a9e2ffca2108af1 Mon Sep 17 00:00:00 2001 From: Sergey Tsypanov Date: Wed, 10 Nov 2021 12:46:30 +0000 Subject: [PATCH 277/890] 8276926: Use String.valueOf() when initializing File.separator and File.pathSeparator Reviewed-by: redestad, jlaskey --- src/java.base/share/classes/java/io/File.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/classes/java/io/File.java b/src/java.base/share/classes/java/io/File.java index d809ec5edc9..3f7cd86cf70 100644 --- a/src/java.base/share/classes/java/io/File.java +++ b/src/java.base/share/classes/java/io/File.java @@ -220,7 +220,7 @@ public class File * string for convenience. This string contains a single character, namely * {@link #separatorChar}. */ - public static final String separator = "" + separatorChar; + public static final String separator = String.valueOf(separatorChar); /** * The system-dependent path-separator character. This field is @@ -239,7 +239,7 @@ public class File * for convenience. This string contains a single character, namely * {@link #pathSeparatorChar}. */ - public static final String pathSeparator = "" + pathSeparatorChar; + public static final String pathSeparator = String.valueOf(pathSeparatorChar); /* -- Constructors -- */ -- GitLab From 55b36c6f3bb7eb066daaf41f9eba46633afedf08 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 10 Nov 2021 13:11:16 +0000 Subject: [PATCH 278/890] 8276825: hotspot/runtime/SelectionResolution test errors Reviewed-by: dholmes, shade --- .../classes/selectionresolution/ClassBuilder.java | 4 ++-- .../classes/selectionresolution/Clazz.java | 4 ++-- .../classes/selectionresolution/TestBuilder.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/ClassBuilder.java b/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/ClassBuilder.java index 445a137e0f4..b453c64de12 100644 --- a/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/ClassBuilder.java +++ b/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/ClassBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -112,7 +112,7 @@ public class ClassBuilder extends Builder { int packageId = classdata.get(classId).packageId.ordinal(); Clazz C = helpers[packageId]; if (C == null) { - C = new Clazz(getPackageName(packageId) + "Helper", -1, ACC_PUBLIC); + C = new Clazz(getPackageName(packageId) + "Helper", ACC_PUBLIC, -1); helpers[packageId] = C; classes.add(C); } diff --git a/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Clazz.java b/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Clazz.java index 45c2d6d1b92..141e5743595 100644 --- a/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Clazz.java +++ b/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Clazz.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -69,7 +69,7 @@ class Clazz extends ClassConstruct { * @param implementing Interfaces implemented */ public Clazz(String name, String extending, int access, int classFileVersion, int index, String... implementing) { - super(name, extending == null ? "java/lang/Object" : extending, access + ACC_SUPER, classFileVersion, index, implementing); + super(name, extending == null ? "java/lang/Object" : extending, access | ACC_SUPER, classFileVersion, index, implementing); // Add the default constructor addMethod("", "()V", ACC_PUBLIC).makeConstructor(extending, false); } diff --git a/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java b/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java index 8fdf98bfe45..47eea703f76 100644 --- a/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java +++ b/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -36,7 +36,7 @@ class TestBuilder extends Builder { super(testcase); // Make a public class Test that contains all our test methods - testClass = new Clazz("Test", null, -1, ACC_PUBLIC); + testClass = new Clazz("Test", null, ACC_PUBLIC, -1); // Add a main method mainMethod = testClass.addMethod("main", "([Ljava/lang/String;)V", ACC_PUBLIC + ACC_STATIC); -- GitLab From 38ec3a16d722d740d0b2128c6f6c2d1eab7a7c08 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Wed, 10 Nov 2021 14:33:02 +0000 Subject: [PATCH 279/890] 8276672: Cannot build hsdis on WSL Co-authored-by: Magnus Ihse Bursie Co-authored-by: Yasumasa Suenaga Reviewed-by: ihse, erikj --- make/Hsdis.gmk | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/make/Hsdis.gmk b/make/Hsdis.gmk index 2253da90679..02f09b320f0 100644 --- a/make/Hsdis.gmk +++ b/make/Hsdis.gmk @@ -44,15 +44,44 @@ ifeq ($(call isTargetOs, windows), true) MINGW_BASE := x86_64-w64-mingw32 + MINGW_SYSROOT = $(shell $(MINGW_BASE)-gcc -print-sysroot) + ifeq ($(wildcard $(MINGW_SYSROOT)), ) + # Use fallback path + MINGW_SYSROOT := /usr/$(MINGW_BASE) + ifeq ($(wildcard $(MINGW_SYSROOT)), ) + $(error mingw sysroot not found) + endif + endif + $(eval $(call DefineNativeToolchain, TOOLCHAIN_MINGW, \ CC := $(MINGW_BASE)-gcc, \ LD := $(MINGW_BASE)-ld, \ OBJCOPY := $(MINGW_BASE)-objcopy, \ RC := $(RC), \ - SYSROOT_CFLAGS := --sysroot=/usr/$(MINGW_BASE)/sys-root, \ - SYSROOT_LDFLAGS := --sysroot=/usr/$(MINGW_BASE)/sys-root, \ + SYSROOT_CFLAGS := --sysroot=$(MINGW_SYSROOT), \ + SYSROOT_LDFLAGS := --sysroot=$(MINGW_SYSROOT), \ )) + MINGW_SYSROOT_LIB_PATH := $(MINGW_SYSROOT)/mingw/lib + ifeq ($(wildcard $(MINGW_SYSROOT_LIB_PATH)), ) + # Try without mingw + MINGW_SYSROOT_LIB_PATH := $(MINGW_SYSROOT)/lib + ifeq ($(wildcard $(MINGW_SYSROOT_LIB_PATH)), ) + $(error mingw sysroot lib path not found) + endif + endif + + MINGW_VERSION = $(shell $(MINGW_BASE)-gcc -v 2>&1 | $(GREP) "gcc version" | $(CUT) -d " " -f 3) + MINGW_GCC_LIB_PATH := /usr/lib/gcc/$(MINGW_BASE)/$(MINGW_VERSION) + ifeq ($(wildcard $(MINGW_GCC_LIB_PATH)), ) + # Try using only major version number + MINGW_VERSION_MAJOR := $(firstword $(subst ., , $(MINGW_VERSION))) + MINGW_GCC_LIB_PATH := /usr/lib/gcc/$(MINGW_BASE)/$(MINGW_VERSION_MAJOR) + ifeq ($(wildcard $(MINGW_GCC_LIB_PATH)), ) + $(error mingw gcc lib path not found) + endif + endif + TOOLCHAIN_TYPE := gcc OPENJDK_TARGET_OS := linux CC_OUT_OPTION := -o$(SPACE) @@ -66,9 +95,8 @@ ifeq ($(call isTargetOs, windows), true) HSDIS_TOOLCHAIN := TOOLCHAIN_MINGW HSDIS_TOOLCHAIN_CFLAGS := - HSDIS_TOOLCHAIN_LDFLAGS := -L/usr/lib/gcc/$(MINGW_BASE)/9.2.0 \ - -L/usr/$(MINGW_BASE)/sys-root/mingw/lib - MINGW_DLLCRT := /usr/$(MINGW_BASE)/sys-root/mingw/lib/dllcrt2.o + HSDIS_TOOLCHAIN_LDFLAGS := -L$(MINGW_GCC_LIB_PATH) -L$(MINGW_SYSROOT_LIB_PATH) + MINGW_DLLCRT := $(MINGW_SYSROOT_LIB_PATH)/dllcrt2.o HSDIS_TOOLCHAIN_LIBS := $(MINGW_DLLCRT) -lmingw32 -lgcc -lgcc_eh -lmoldname \ -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 else -- GitLab From f561d3c1942ce901fa77c907839032f76feb6998 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 10 Nov 2021 14:41:33 +0000 Subject: [PATCH 280/890] 8276864: Update boot JDKs to 17.0.1 in GHA Reviewed-by: erikj, ihse --- make/conf/test-dependencies | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/make/conf/test-dependencies b/make/conf/test-dependencies index 1e53b8f10f1..b45de4180f9 100644 --- a/make/conf/test-dependencies +++ b/make/conf/test-dependencies @@ -30,14 +30,14 @@ JTREG_VERSION=6.1 JTREG_BUILD=1 GTEST_VERSION=1.8.1 -LINUX_X64_BOOT_JDK_FILENAME=openjdk-17_linux-x64_bin.tar.gz -LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz -LINUX_X64_BOOT_JDK_SHA256=aef49cc7aa606de2044302e757fa94c8e144818e93487081c4fd319ca858134b +LINUX_X64_BOOT_JDK_FILENAME=openjdk-17.0.1_linux-x64_bin.tar.gz +LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_linux-x64_bin.tar.gz +LINUX_X64_BOOT_JDK_SHA256=1c0a73cbb863aad579b967316bf17673b8f98a9bb938602a140ba2e5c38f880a -WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-17_windows-x64_bin.zip -WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_windows-x64_bin.zip -WINDOWS_X64_BOOT_JDK_SHA256=e88b0df00021c9d266bb435c9a95fdc67d1948cce4518daf85c234907bd393c5 +WINDOWS_X64_BOOT_JDK_FILENAME=openjdk-17.0.1_windows-x64_bin.zip +WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_windows-x64_bin.zip +WINDOWS_X64_BOOT_JDK_SHA256=329900a6673b237b502bdcf77bc334da34bc91355c5fd2d457fc00f53fd71ef1 -MACOS_X64_BOOT_JDK_FILENAME=openjdk-17_macos-x64_bin.tar.gz -MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_macos-x64_bin.tar.gz -MACOS_X64_BOOT_JDK_SHA256=18e11cf9bbc6f584031e801b11ae05a233c32086f8e1b84eb8a1e9bb8e1f5d90 +MACOS_X64_BOOT_JDK_FILENAME=openjdk-17.0.1_macos-x64_bin.tar.gz +MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk17.0.1/2a2082e5a09d4267845be086888add4f/12/GPL/openjdk-17.0.1_macos-x64_bin.tar.gz +MACOS_X64_BOOT_JDK_SHA256=6ccb35800e723cabe15af60e67099d1a07c111d2d3208aa75523614dde68bee1 -- GitLab From ce3ed65ac3411a533052a8c01231f7e540803afb Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Wed, 10 Nov 2021 15:24:27 +0000 Subject: [PATCH 281/890] 8273154: Provide a JavadocTester method for non-overlapping, unordered output matching Reviewed-by: prappo --- .../lib/javadoc/tester/JavadocTester.java | 698 ++++++++++++++---- .../testJavadocTester/TestJavadocTester.java | 438 +++++++++++ 2 files changed, 982 insertions(+), 154 deletions(-) create mode 100644 test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java diff --git a/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java b/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java index 79b20ff7e9e..ff84f37c56b 100644 --- a/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java +++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java @@ -23,7 +23,6 @@ package javadoc.tester; -import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -39,12 +38,10 @@ import java.lang.reflect.Method; import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; import java.nio.file.DirectoryStream; -import java.nio.file.FileVisitResult; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -53,11 +50,14 @@ import java.util.Comparator; import java.util.EnumMap; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.function.BiFunction; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; /** @@ -183,6 +183,7 @@ public abstract class JavadocTester { /** * Get the path for a source file in the test source directory. + * * @param path the path of a file or directory in the source directory * @return the full path of the specified file */ @@ -264,6 +265,7 @@ public abstract class JavadocTester { /** * Run all methods annotated with @Test, followed by printSummary. * Typically called on a tester object in main() + * * @throws Exception if any errors occurred */ public void runTests() throws Exception { @@ -273,6 +275,7 @@ public abstract class JavadocTester { /** * Runs all methods annotated with @Test, followed by printSummary. * Typically called on a tester object in main() + * * @param f a function which will be used to provide arguments to each * invoked method * @throws Exception if any errors occurred @@ -302,12 +305,12 @@ public abstract class JavadocTester { * put each option and the arguments it takes on a separate line. * * Example: - *
          
          +     * {@snippet :
                *  javadoc("-d", "out",
                *          "-sourcepath", testSrc,
                *          "-notimestamp",
                *          "pkg1", "pkg2", "pkg3/C.java");
          -     * 
          + * } * * @param args the arguments to pass to javadoc */ @@ -401,6 +404,7 @@ public abstract class JavadocTester { * Sets the kind of check for the initial contents of the output directory * before javadoc is run. * The filter should return true for files that should not appear. + * * @param c the kind of check to perform */ public void setOutputDirectoryCheck(DirectoryCheck c) { @@ -464,8 +468,7 @@ public abstract class JavadocTester { /** * Checks the exit code of the most recent call of javadoc. * - * @param expected the exit code that is required for the test - * to pass. + * @param expected the exit code that is required for the test to pass */ public void checkExit(Exit expected) { checking("check exit code"); @@ -480,12 +483,13 @@ public abstract class JavadocTester { * Checks for content in (or not in) the generated output. * Within the search strings, the newline character \n * will be translated to the platform newline character sequence. - * @param path a path within the most recent output directory - * or the name of one of the output buffers, identifying - * where to look for the search strings. + * + * @param path a path within the most recent output directory + * or the name of one of the output buffers, identifying + * where to look for the search strings. * @param expectedFound true if all of the search strings are expected - * to be found, or false if the file is not expected to be found - * @param strings the strings to be searched for + * to be found, or false if the file is not expected to be found + * @param strings the strings to be searched for */ public void checkFileAndOutput(String path, boolean expectedFound, String... strings) { if (expectedFound) { @@ -499,97 +503,81 @@ public abstract class JavadocTester { * Checks for content in (or not in) the generated output. * Within the search strings, the newline character \n * will be translated to the platform newline character sequence. - * @param path a path within the most recent output directory, identifying - * where to look for the search strings. + * + * @param path a path within the most recent output directory, identifying + * where to look for the search strings. * @param expectedFound true if all of the search strings are expected - * to be found, or false if all of the strings are expected to be - * not found - * @param strings the strings to be searched for + * to be found, or false if all of the strings are expected to be + * not found + * @param strings the strings to be searched for + * + * @see OutputChecker#check(String...) */ public void checkOutput(String path, boolean expectedFound, String... strings) { - // Read contents of file - try { - String fileString = readFile(outputDir, Path.of(path)); - checkOutput(outputDir.resolve(path).toString(), fileString, expectedFound, strings); - } catch (Error e) { - checking("Read file"); - failed("Error reading file: " + e); - } + new OutputChecker(path) + .setExpectFound(expectedFound) + .setExpectOrdered(false) // TODO, fix tests (32 failures) and change to true + .check(strings); } /** * Checks for content in (or not in) the one of the output streams written by * javadoc. Within the search strings, the newline character \n * will be translated to the platform newline character sequence. - * @param output the output stream to check + * + * @param output the output stream to check * @param expectedFound true if all of the search strings are expected - * to be found, or false if all of the strings are expected to be - * not found - * @param strings the strings to be searched for + * to be found, or false if all of the strings are expected to be + * not found + * @param strings the strings to be searched for + * + * @see OutputChecker#check(String...) */ public void checkOutput(Output output, boolean expectedFound, String... strings) { - checkOutput(output.toString(), outputMap.get(output), expectedFound, strings); - } - - // NOTE: path may be the name of an Output stream as well as a file path - private void checkOutput(String path, String fileString, boolean expectedFound, String... strings) { - for (String stringToFind : strings) { -// log.logCheckOutput(path, expectedFound, stringToFind); - checking("checkOutput"); - // Find string in file's contents - boolean isFound = findString(fileString, stringToFind); - if (isFound == expectedFound) { - passed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n" - + stringToFind); - } else { - failed(path + ": following text " + (isFound ? "found:" : "not found:") + "\n" - + stringToFind + '\n' + - "found \n" + - fileString); - } - } + new OutputChecker(output) + .setExpectFound(expectedFound) + .setExpectOrdered(false) // TODO, fix tests (6 failures) and change to true + .check(strings); } /** * Checks that there are no duplicate lines in one of the streams written by javadoc. + * * @param output the output stream to check + * + * @see OutputChecker#checkUnique() */ public void checkUnique(Output output) { checkUnique(output, ".*", true); } /** - * Checks that there are no duplicate lines that either match or don't match a given patter, + * Checks that there are no duplicate lines that either match or don't match a given pattern, * in one of the streams written by javadoc. - * @param output the output stream to check + * + * @param output the output stream to check * @param pattern a pattern to filter the lines to be checked - * @param select if {@code true}, lines that match the pattern will be checked for uniqueness; - * if {@code false}, lines that do not match the pattern will be checked + * @param select if {@code true}, lines that match the pattern will be checked for uniqueness; + * if {@code false}, lines that do not match the pattern will be checked + * + * @see OutputChecker#checkUnique(Pattern, boolean) */ public void checkUnique(Output output, String pattern, boolean select) { - checking("checkUnique"); - Pattern filter = Pattern.compile(pattern); - Matcher m = filter.matcher(""); - Map linesSofar = new HashMap<>(); - int lineNumber = 0; - int duplicates = 0; - for (String line : getOutputLines(output)) { - m.reset(line); - if (m.find() == select) { - Integer prev = linesSofar.putIfAbsent(line, ++lineNumber); - if (prev != null) { - out.println("duplicate line detected on line " + lineNumber - + "; first occurrence on line " + prev); - out.println("line: " + line); - duplicates++; - } - } - } - if (duplicates == 0) { - passed("All lines are unique"); - } else { - failed(duplicates + " duplicate lines found"); - } + new OutputChecker(output).checkUnique(Pattern.compile(pattern), select); + } + + /** + * Ensures that a series of strings appear only once, in the generated output. + * Note: this test does not exhaustively check for all other possible + * duplicates once one is found. + * + * @param path the file to check + * @param strings the strings + * + * @see OutputChecker#checkUnique(String...) + */ + public void checkUnique(String path, String... strings) { + new OutputChecker(path).checkUnique(strings); } /** @@ -658,7 +646,8 @@ public abstract class JavadocTester { } /** - * Gets the content of the one of the output streams written by javadoc. + * Returns the content of one of the output streams written by javadoc. + * * @param output the name of the output stream * @return the content of the output stream */ @@ -667,7 +656,8 @@ public abstract class JavadocTester { } /** - * Gets the content of the one of the output streams written by javadoc. + * Returns the content of one of the output streams written by javadoc. + * * @param output the name of the output stream * @return the content of the output stream, as a line of lines */ @@ -678,22 +668,23 @@ public abstract class JavadocTester { /** * Checks for files in (or not in) the generated output. + * * @param expectedFound true if all of the files are expected - * to be found, or false if all of the files are expected to be - * not found - * @param paths the files to check, within the most recent output directory. - * */ + * to be found, or false if all of the files are expected to be + * not found + * @param paths the files to check, within the most recent output directory. + */ public void checkFiles(boolean expectedFound, String... paths) { checkFiles(expectedFound, Arrays.asList(paths)); } /** * Checks for files in (or not in) the generated output. - * @param expectedFound true if all of the files are expected - * to be found, or false if all of the files are expected to be - * not found - * @param paths the files to check, within the most recent output directory. - * */ + * + * @param expectedFound true if all of the files are expected to be found, + * or false if all of the files are expected to be not found + * @param paths the files to check, within the most recent output directory. + */ public void checkFiles(boolean expectedFound, Collection paths) { for (String path: paths) { // log.logCheckFile(path, expectedFound); @@ -711,54 +702,16 @@ public abstract class JavadocTester { /** * Checks that a series of strings are found in order in a file in * the generated output. - * @param path the file to check - * @param strings the strings whose order to check + * + * @param path the file to check + * @param strings the strings whose order to check + * + * @see OutputChecker#check(String...) */ public void checkOrder(String path, String... strings) { - Path file = outputDir.resolve(path); - String fileString = readOutputFile(path); - int prevIndex = -1; - for (String s : strings) { - s = s.replace("\n", NL); // normalize new lines - int currentIndex = fileString.indexOf(s, prevIndex + 1); - checking("file: " + file + ": " + s + " at index " + currentIndex); - if (currentIndex == -1) { - failed(file, s + " not found."); - continue; - } - if (currentIndex > prevIndex) { - passed(file, s + " is in the correct order"); - } else { - failed(file, s + " is in the wrong order."); - } - prevIndex = currentIndex; - } - } - - /** - * Ensures that a series of strings appear only once, in the generated output, - * noting that, this test does not exhaustively check for all other possible - * duplicates once one is found. - * @param path the file to check - * @param strings ensure each are unique - */ - public void checkUnique(String path, String... strings) { - Path file = outputDir.resolve(path); - String fileString = readOutputFile(path); - for (String s : strings) { - int currentIndex = fileString.indexOf(s); - checking(s + " at index " + currentIndex); - if (currentIndex == -1) { - failed(file, s + " not found."); - continue; - } - int nextindex = fileString.indexOf(s, currentIndex + s.length()); - if (nextindex == -1) { - passed(file, s + " is unique"); - } else { - failed(file, s + " is not unique, found at " + nextindex); - } - } + new OutputChecker(path) + .setExpectOrdered(true) // be explicit + .check(strings); } /** @@ -766,7 +719,7 @@ public abstract class JavadocTester { * * @param baseDir1 the directory containing the first set of files * @param baseDir2 the directory containing the second set of files - * @param files the set of files to be compared + * @param files the set of files to be compared */ public void diff(String baseDir1, String baseDir2, String... files) { Path bd1 = Path.of(baseDir1); @@ -830,10 +783,10 @@ public abstract class JavadocTester { content = new String(Files.readAllBytes(file), charset); fileContentCache.put(file, new SoftReference<>(content)); return content; - } catch (FileNotFoundException e) { - throw new Error("File not found: " + fileName + ": " + e); + } catch (FileNotFoundException | NoSuchFileException e) { + throw new Error("File not found: " + fileName + ": " + e, e); } catch (IOException e) { - throw new Error("Error reading file: " + fileName + ": " + e); + throw new Error("Error reading file: " + fileName + ": " + e, e); } } @@ -941,22 +894,6 @@ public abstract class JavadocTester { } } - /** - * Searches for the string in the given file and return true - * if the string was found. - * - * @param fileString the contents of the file to search through - * @param stringToFind the string to search for - * @return true if the string was found - */ - private boolean findString(String fileString, String stringToFind) { - // javadoc (should) always use the platform newline sequence, - // but in the strings to find it is more convenient to use the Java - // newline character. So we translate \n to NL before we search. - stringToFind = stringToFind.replace("\n", NL); - return fileString.contains(stringToFind); - } - /** * Compares the two given files. * @@ -975,6 +912,459 @@ public abstract class JavadocTester { } } + /** + * A flexible checker for checking the content of generated files and output streams. + * + * Configuration can be done with a series of chained method calls. + * Checks can be specified as either literal strings or regular expressions. + */ + public class OutputChecker { + private final String name; + private final String content; + private boolean allowOverlaps = false; + private boolean expectFound = true; + private boolean expectOrdered = true; + private List matches = new ArrayList<>(); + private Range lastMatch; + + private enum SearchKind { + TEXT, PATTERN; + @Override + public String toString() { + return name().toLowerCase(Locale.ROOT); + } + } + + /** A half-open interval {@code [start, end)} to record the position of a match. */ + record Range(int start, int end) { + static Range of(int start, int end) { + return new Range(start, end); + } + boolean overlaps(Range other) { + // Intervals do not overlap if one interval is completely before or completely after the other: + // that is, other.end <= start || end <= other.start + // Invert that for when intervals do overlap, and simplify to the following expression: + return other.end > start && end > other.start; + } + String toIntervalString() { + return "[" + start + "," + end + ")"; + } + } + + /** + * Creates an output checker for a file written by the most recent run of javadoc. + * If the file cannot be found or there is any other error while reading the file, + * an error will be reported and all subsequent {@code check...} methods will be skipped + * + * @param file the file + */ + public OutputChecker(String file) { + String c = null; + try { + c = readFile(file); + } catch (Error e) { + JavadocTester.this.checking("Read file " + file); + if (e.getCause() instanceof IOException) { + // exception probably thrown (with known message) by readFile + failed(e.getMessage()); + } else { + failed("Error reading file: " + e); + } + } + + if (c == null) { + name = null; + content = null; + } else { + name = file; + content = c; + } + } + + /** + * Creates an output checker for an output stream written by the most recent run of javadoc. + * + * @param output the output + */ + public OutputChecker(Output output) { + name = output.name(); + content = getOutput(output); + } + + /** + * Specifies whether matches are expected to be found or not. + * The default is {@code true}. + * + * @param expectFound whether matches are expected to be found + * @return this object + */ + public OutputChecker setExpectFound(boolean expectFound) { + this.expectFound = expectFound; + return this; + } + + /** + * Specifies whether matches are expected to be found in order or not. + * The default is {@code true}. + * + * @param expectOrdered whether matches should be ordered + * @return this object + */ + public OutputChecker setExpectOrdered(boolean expectOrdered) { + this.expectOrdered = expectOrdered; + return this; + } + + /** + * Specifies whether matches are allowed to overlap. + * The default is {@code false}. + * + * @param allowOverlaps whether matches may overlap + * @return this object + */ + public OutputChecker setAllowOverlaps(boolean allowOverlaps) { + this.allowOverlaps = allowOverlaps; + return this; + } + + /** + * Checks for the presence (or absence) of a series of strings. + * Within the search strings, the newline character {@code \n} + * will be translated to the platform newline character sequence. + * + * @param strings the strings to be searched for + */ + public OutputChecker check(String... strings) { + if (name == null) { + out.println("Skipping checks for:" + NL + + List.of(strings).stream() + .map(s -> " " + toShortString(s)) + .collect(Collectors.joining(NL))); + return this; + } + + for (String stringToFind : strings) { + check(startPos -> findString(stringToFind, startPos), SearchKind.TEXT, stringToFind); + } + return this; + } + + /** + * Checks for the presence (or absence) of a series of regular expressions. + * Unlike {@link #check(String...)}, there is no special handling for + * newline characters. Use {@code \R} to match the platform newline sequence. + * + * @param patterns the regular expressions to be searched for + */ + public OutputChecker check(Pattern... patterns) { + if (name == null) { + out.println("Skipping checks for:" + NL + + List.of(patterns).stream() + .map(p -> " " + toShortString(p.pattern())) + .collect(Collectors.joining(NL))); + return this; + } + for (Pattern pattern : patterns) { + check(startPos -> findPattern(pattern, startPos), SearchKind.PATTERN, pattern.pattern()); + } + return this; + } + + /** + * Checks for the presence (or absence) of an item. + * + * @param finder a function to find the next occurrence of an item starting at a given position + * @param kind the kind of the item ({@code "text"} or {@code "pattern:} to include in messages + * @param s a string for the item, to be included in messages + */ + private void check(Function finder, SearchKind kind, String s) { + checking("checkOutput", kind); + int start = getStart(); + Range r = finder.apply(start); + boolean isFound = r != null; + if (isFound == expectFound) { + matches.add(lastMatch = r); + passed(name + ": following " + kind + " " + (isFound ? "found:" : "not found:") + "\n" + + s); + } else { + // item not found in order, so check if the item is found out of order, to determine the best message + if (expectFound && expectOrdered && start > 0) { + Range r2 = finder.apply(0); + if (r2 != null) { + failed(name + ": following " + kind + " was found on line " + + getLineNumber(r2.start) + + ", but not in order as expected, on or after line " + + getLineNumber(start) + + ":\n" + + s); + return; + } + } + failed(name + ": following " + kind + " " + + (isFound ? "found:" : "not found:") + "\n" + + s + '\n' + "found \n" + content); + } + + } + + /** + * Checks that there are no duplicate lines in the content. + */ + public OutputChecker checkUnique() { + checkUnique(Pattern.compile(".*"), true); + return this; + } + + /** + * Checks that there are no duplicate lines that either match or don't match a given pattern, + * in one of the streams written by javadoc. + * + * @param pattern a pattern to filter the lines to be checked + * @param select if {@code true}, lines that match the pattern will be checked for uniqueness; + * if {@code false}, lines that do not match the pattern will be checked + */ + public OutputChecker checkUnique(Pattern pattern, boolean select ) { + if (name == null) { + out.println("Skipping checkUnique"); + return this; + } + + checking("checkUnique", SearchKind.PATTERN); + Matcher m = pattern.matcher(""); + Map linesSofar = new HashMap<>(); + int lineNumber = 0; + int duplicates = 0; + for (String line : content.split(NL)) { + m.reset(line); + if (m.find() == select) { + Integer prev = linesSofar.putIfAbsent(line, ++lineNumber); + if (prev != null) { + out.println("duplicate line detected on line " + lineNumber + + "; first occurrence on line " + prev); + out.println("line: " + line); + duplicates++; + } + } + } + if (duplicates == 0) { + passed("All lines are unique"); + } else { + failed(duplicates + " duplicate lines found"); + } + return this; + } + + /** + * Checks that each of a series of strings appears only once in the generated output. + * Note: this test does not exhaustively check for all other possible duplicates once one is found. + * + * @param strings the strings + */ + public OutputChecker checkUnique(String... strings) { + return checkUnique(SearchKind.TEXT, List.of(strings), this::findString); + } + + /** + * Checks that each of a series of pattern matches appears only once in the generated output. + * Note: this test does not exhaustively check for all other possible duplicates once one is found. + * + * @param patterns the patterns + */ + public OutputChecker checkUnique(Pattern... patterns) { + return checkUnique(SearchKind.PATTERN, List.of(patterns), this::findPattern); + } + + private OutputChecker checkUnique(SearchKind kind, List items, BiFunction finder) { + if (name == null) { + out.println("Skipping checkUnique"); + return this; + } + + Range latest = null; + for (T item : items) { + int start = getStart(); + Range r = finder.apply(item, start); + checking("checkUnique at index " + start, SearchKind.TEXT); + if (r == null) { + failed(name + ": " + item + " not found."); + continue; + } + // only update lastMatch for the initial match of each item + if (lastMatch == null) { + lastMatch = r; + } + Range next = finder.apply(item, r.end); + if (next == null) { + passed(name + ": " + item + " is unique"); + } else { + failed(name + ": " + item + " is not unique, found at " + next.start); + } + } + if (latest != null) { + lastMatch = latest; + } + return this; + } + + /** + * Checks that all the output has been matched by preceding checks with this object. + * It does not matter whether the checks were ordered or not. + * The results of the matches are sorted and then checked to be adjacent and to + * cover the entire content. + * + * @apiNote This is probably most useful for checking diagnostic output, + * in which case care must be taken to allow for platform differences + * in the output, such as file separators and newline sequences. + */ + public OutputChecker checkComplete() { + if (name == null) { + out.println("Skipping checkComplete"); + return this; + } + + JavadocTester.this.checking("checking for complete coverage of output"); + List uncovered = new ArrayList<>(); + List list = new ArrayList<>(matches); + list.sort(Comparator.comparing(Range::start)); + int prev = 0; + for (Range r : list) { + if (r.start != prev) { + uncovered.add(new Range(prev, r.start)); + } + prev = r.end; + } + if (prev != content.length()) { + uncovered.add(new Range(prev, content.length())); + } + if (uncovered.isEmpty()) { + passed("All output matched"); + } else { + failed("The following output was not matched: " + + uncovered.stream() + .map(Range::toIntervalString) + .collect(Collectors.joining(", "))); + } + return this; + } + + /** + * Checks that no output is present. + */ + public OutputChecker checkEmpty() { + if (name == null) { + out.println("Skipping checkEmpty"); + return this; + } + + JavadocTester.this.checking("empty"); + if (content == null || content.isEmpty()) { + passed(name + " is empty, as expected"); + } else { + failed(name + " is not empty; contains:\n" + + content); + } + return this; + } + + /** + * Checks that at least of a set of alternatives is found. + */ + public OutputChecker checkAnyOf(String... strings) { + return checkAnyOf(SearchKind.TEXT, List.of(strings), this::findString); + } + + /** + * Checks that at least of a set of alternatives is found. + */ + public OutputChecker checkAnyOf(Pattern... patterns) { + return checkAnyOf(SearchKind.PATTERN, List.of(patterns), this::findPattern); + } + + /** + * Checks that at least of a set of alternatives is found. + * + */ + private OutputChecker checkAnyOf(SearchKind kind, List items, BiFunction finder) { + if (name == null) { + out.println("Skipping checkAnyOf"); + return this; + } + + checking("checkAnyOf", kind); + Range earliest = null; + int start = getStart(); + int count = 0; + for (T item : items) { + Range r = finder.apply(item, start); + if (r != null) { + count++; + if (earliest == null || rangeComparator.compare(earliest, r) > 0) { + earliest = r; + } + } + } + if (earliest != null) { + lastMatch = earliest; + } + if (count == 0) { + failed("no match found for any " + kind); + } else { + passed(count + " matches found; earliest is " + earliest.toIntervalString()); + } + return this; + } + + Comparator rangeComparator = Comparator.comparing(Range::start).thenComparing(Range::end); + + private void checking(String name, SearchKind kind) { + JavadocTester.this.checking(name + " " + kind.name() + + " allowOverlaps:" + allowOverlaps + + " expectFound:" + expectFound + + " expectOrdered:" + expectOrdered); + } + + private Range findString(String stringToFind, int start) { + // javadoc (should) always use the platform newline sequence, + // but in the strings to find it is more convenient to use the Java + // newline character. So we translate \n to NL before we search. + stringToFind = stringToFind.replace("\n", NL); + int i = content.indexOf(stringToFind, start); + return i >= 0 ? Range.of(i, i + stringToFind.length()) : null; + } + + private Range findPattern(Pattern p, int start) { + Matcher m = p.matcher(content); + return m.find(start) ? Range.of(m.start(), m.end()) : null; + } + private int getStart() { + if (lastMatch == null || !expectOrdered) { + return 0; + } + return allowOverlaps ? lastMatch.start + 1 : lastMatch.end; + } + + private int getLineNumber(int pos) { + Pattern p = Pattern.compile("\\R"); + Matcher m = p.matcher(content); + int line = 1; + int start = 0; + while (m.find(start) && m.start() < pos) { + line++; + start = m.start() + 1; + } + return line; + } + + private String toShortString(String s) { + final int MAX = 64; + s = s.replaceAll("\\s+", " "); + if (s.length() > MAX) { + s = s.substring(0, MAX / 2 - 2) + " ... " + s.substring(s.length() - MAX / 2 - 2); + } + return s; + } + } + /** * Utility class to simplify the handling of temporarily setting a * new stream for System.out or System.err. diff --git a/test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java b/test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java new file mode 100644 index 00000000000..5f0ab271e19 --- /dev/null +++ b/test/langtools/jdk/javadoc/testJavadocTester/TestJavadocTester.java @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2021, 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 8273154 + * @summary Provide a JavadocTester method for non-overlapping, unordered output matching + * @library /tools/lib/ ../lib + * @modules jdk.javadoc/jdk.javadoc.internal.tool + * @build toolbox.ToolBox javadoc.tester.* + * @run main TestJavadocTester + */ + +import javadoc.tester.JavadocTester; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import toolbox.ToolBox; + +/** + * Tests basic mechanisms in the {@code JavadocTester} class. + * + * It is not a direct test of the javadoc tool or the output generated by the + * Standard Doclet, although both are indirectly used as part of this test. + * + * The test works by exercising the {@code JavadocTester} API with a series of + * positive and negative tests. The {@code passed} and {@code failed} methods + * are overridden to record the messages reported by the underlying instance, so + * that the messages can subsequently be verified. Also, {@code printSummary} + * is overridden to suppress the default action to throw {@code Error} when + * tests have failed. + */ +public class TestJavadocTester extends JavadocTester { + public static void main(String... args) throws Exception { + TestJavadocTester tester = new TestJavadocTester(); + tester.setup().runTests(); + } + + private final List messages = new ArrayList<>(); + private int testErrors = 0; + + /** + * Overrides the default implementation of {@code passed} to record the argument. + * {@inheritDoc} + * + * @param message a short description of the outcome + */ + @Override + public void passed(String message) { + super.passed(message); + messages.add("Passed: " + message); + } + + /** + * Overrides the default implementation of {@code failed} to record the argument. + * {@inheritDoc} + * + * @param message a short description of the outcome + */ + @Override + public void failed(String message) { + super.failed(message); + messages.add("FAILED: " + message); + } + + /** + * Overrides the default implementation of {@code printSummary} to suppress + * the error thrown as a result of errors reported by {@code JavadocTester}. + * Instead, an error is thrown if any errors are found by the tests in this class. + */ + @Override + public void printSummary() { + try { + super.printSummary(); + } catch (Error e) { + if (e.getClass() != Error.class) { + throw e; + } + report("Suppressed: " + e); + } + + if (testErrors > 0) { + report(testErrors + " errors found"); + throw new Error(testErrors + " errors found"); + } + } + + /** + * Checks the content of messages reported by the {@code passed} and {@code failed} + * methods in {@code JavadocTester}. The messages are saved by the local overloads + * of those methods in this class. + * + * Because some of the messages are very long, it is enough to pass in + * initial substrings of the expected messages. + * + * Note that messages reported by {@code JavadocTester} use filenames as given + * to the various {@code check...} calls. By convention, these always use {@code /} + * as the file separator, and not the platform file separator. + * + * @param expect initial substrings of expected messages + */ + void checkMessages(String... expect) { + for (String e : expect) { + Optional match = messages.stream() + .filter(m -> m.startsWith(e)) + .findFirst(); + if (match.isPresent()) { + report("found '" + e + "'"); + } else { + report("ERROR: no message found for '" + e + "'"); + testErrors++; + } + } + } + + /** + * Reports a message, preceded by {@code >>> }. + * + * It is helpful/important to distinguish the messages written as a side-effect + * of the underlying tests from the messages used to report the outcome of the + * tests that verify those messages. Instead of interposing to mark the messages + * written as a side effect of the underlying tests, we leave those messages + * unchanged, and instead, mark the messages reporting whether those messages + * are as expected or not. + * + * @param message the message to be reported. + */ + private void report(String message) { + message.lines().forEachOrdered(l -> out.println(">>> " + l)); + } + + //------------------------------------------------- + + private final ToolBox tb = new ToolBox(); + + TestJavadocTester setup() throws IOException { + Path src = Path.of("src"); + tb.writeJavaFiles(src, """ + package p; + /** + * First sentence abc. + * Second sentence. + * abc123 + * def456 + * ghi789 + * abc123 + * def456 + * ghi789 + */ + public class C { + private C() { } + /** m3 comment. */ + public void m3() { } + /** m2 comment. */ + public void m2() { } + /** m1 comment. */ + public void m1() { } + } + """); + + javadoc("-d", "out", + "-sourcepath", src.toString(), + "-noindex", "-nohelp", + "p"); + return this; + } + + @Test + public void testSimpleStringCheck() { + messages.clear(); + new OutputChecker("p/C.html") + .check("Second sentence", + "abc123", + "def456"); + messages.forEach(this::report); + checkMessages( + """ + Passed: p/C.html: following text found: + Second sentence""", + """ + Passed: p/C.html: following text found: + abc123""", + """ + Passed: p/C.html: following text found: + def456"""); + } + + @Test + public void testSimpleNegativeStringCheck_expected() { + messages.clear(); + new OutputChecker("p/C.html") + .setExpectFound(false) + .check("Third sentence."); + checkMessages( + """ + Passed: p/C.html: following text not found: + Third sentence"""); + } + + @Test + public void testSimpleNegativeStringCheck_unexpected() { + messages.clear(); + new OutputChecker("p/C.html") + .check("Third sentence."); + checkMessages( + """ + FAILED: p/C.html: following text not found: + Third sentence"""); + } + + @Test + public void testSimpleRegexCheck() { + messages.clear(); + new OutputChecker("p/C.html") + .check(Pattern.compile("S.cond s.nt.nc."), + Pattern.compile("[abc]{3}[123]{3}"), + Pattern.compile("d.f4.6")); + checkMessages( + """ + Passed: p/C.html: following pattern found: + S.cond s.nt.nc.""", + """ + Passed: p/C.html: following pattern found: + [abc]{3}[123]{3}""", + """ + Passed: p/C.html: following pattern found: + d.f4.6"""); + } + + @Test + public void testOrdered() { + messages.clear(); + // methods are listed alphabetically in the Summary table, + // but in source-code order in the Details section. + new OutputChecker("p/C.html") + .check("

          Method Summary

          ", + "m1", + "m2", + "m3") + .check("

          Method Details

          ", + "
          \n", + "
          \n", + "
          \n"); + + checkMessages( + """ + Passed: p/C.html: following text found: +

          Method Summary

          """, + """ + Passed: p/C.html: following text found: + m1""", + """ + Passed: p/C.html: following text found: + m2""", + """ + Passed: p/C.html: following text found: + m3""", + """ + Passed: p/C.html: following text found: +

          Method Details

          """, + """ + Passed: p/C.html: following text found: +
          """, + """ + Passed: p/C.html: following text found: +
          """, + """ + Passed: p/C.html: following text found: +
          """ + ); + } + + @Test + public void testUnordered_expected() { + messages.clear(); + new OutputChecker("p/C.html") + .setExpectOrdered(false) + .check("Second sentence", + "First sentence"); + checkMessages( + """ + Passed: p/C.html: following text found: + Second sentence""", + """ + Passed: p/C.html: following text found: + First sentence"""); + } + + @Test + public void testUnordered_unexpected() { + messages.clear(); + new OutputChecker("p/C.html") + .check("Second sentence", + "First sentence"); + checkMessages( + """ + Passed: p/C.html: following text found: + Second sentence""", + """ + FAILED: p/C.html: following text was found on line"""); + } + + @Test + public void testComplete_Ordered() { + messages.clear(); + // In the following calls, the strings are specified in the expected order. + // File separators are made platform-specific by calling 'fix'. + // Newlines are handled automatically by the 'check' method. + new OutputChecker(Output.OUT) + .check("Loading source files for package p...\n", + "Constructing Javadoc information...\n", + fix("Creating destination directory: \"out/\"\n")) + .check(Pattern.compile("Standard Doclet .*\\R")) + .check("Building tree for all the packages and classes...\n", + fix("Generating out/p/C.html...\n"), + fix("Generating out/p/package-summary.html...\n"), + fix("Generating out/p/package-tree.html...\n"), + fix("Generating out/overview-tree.html...\n"), + fix("Generating out/index.html...\n")) + .checkComplete(); + checkMessages("Passed: All output matched"); + } + + @Test + public void testComplete_Unordered() { + messages.clear(); + // In the following calls, the strings are deliberately specified out of the expected order. + // File separators are made platform-specific by calling 'fix'. + // Newlines are handled automatically by the 'check' method. + new OutputChecker(Output.OUT) + .setExpectOrdered(false) + .check("Loading source files for package p...\n", + "Constructing Javadoc information...\n", + "Building tree for all the packages and classes...\n") + .check(fix("Creating destination directory: \"out/\"\n", + "Generating out/index.html...\n", + "Generating out/overview-tree.html...\n", + "Generating out/p/package-tree.html...\n", + "Generating out/p/package-summary.html...\n", + "Generating out/p/C.html...\n")) + .check(Pattern.compile("Standard Doclet .*\\R")) + .checkComplete(); + checkMessages("Passed: All output matched"); + } + + @Test + public void testEmpty() { + messages.clear(); + new OutputChecker(Output.STDERR) + .checkEmpty(); + checkMessages("Passed: STDERR is empty, as expected"); + } + + @Test + public void testBadFile() { + messages.clear(); + new OutputChecker("does-not-exist.html") + .check("abcdef", + "very long string ".repeat(10)) + .check(Pattern.quote("abcdef"), + Pattern.quote("very long string".repeat(10))); + checkMessages("FAILED: File not found: does-not-exist.html"); + } + + @Test + public void testAnyOf() { + messages.clear(); + new OutputChecker("p/C.html") + .checkAnyOf("m1()", "m2()", "m3()") // expect all found + .checkAnyOf("m1()", "m2()", "M3()") // expect some found + .checkAnyOf("M1()", "M2()", "M3()"); // expect none found + checkMessages("Passed: 3 matches found", + "Passed: 2 matches found", + "FAILED: no match found for any text"); + } + + @Test + public void testUnique() { + messages.clear(); + new OutputChecker("p/C.html") + .setExpectOrdered(false) + .checkUnique("id=\"m1()\"", "id=\"m2()\"", "id=\"m3()\"") // expect unique + .checkUnique("m1()", "m2()", "m3()"); // expect not unique + checkMessages("Passed: p/C.html: id=\"m1()\" is unique", + "Passed: p/C.html: id=\"m2()\" is unique", + "Passed: p/C.html: id=\"m3()\" is unique", + "FAILED: p/C.html: m1() is not unique", + "FAILED: p/C.html: m2() is not unique", + "FAILED: p/C.html: m3() is not unique"); + } + + /** + * {@return a string with {@code /} replaced by the platform file separator} + * + * @param item the string + */ + private String fix(String item) { + return item.replace("/", FS); + } + + /** + * {@return an array of strings with {@code /} replaced by the platform file separator} + * + * @param items the strings + */ + private String[] fix(String... items) { + return Stream.of(items) + .map(this::fix) + .toArray(String[]::new); + } +} -- GitLab From a5c160c711a3f66db18c75973f4efdea63332863 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 10 Nov 2021 19:35:17 +0000 Subject: [PATCH 282/890] 8267108: Alternate Subject.getSubject and doAs APIs that do not depend on Security Manager APIs Reviewed-by: mullan --- .../classes/javax/security/auth/Subject.java | 152 ++++++++++++++++-- .../classes/sun/security/jgss/GSSUtil.java | 11 +- .../jgss/krb5/Krb5AcceptCredential.java | 7 +- .../sun/security/jgss/krb5/Krb5Context.java | 14 +- .../jgss/krb5/Krb5InitCredential.java | 8 +- .../sun/security/jgss/krb5/Krb5Util.java | 32 ++-- .../sun/security/sasl/gsskerb/AuthOnly.java | 33 ++-- .../sasl/gsskerb/ConfSecurityLayer.java | 41 ++--- .../sasl/gsskerb/NoSecurityLayer.java | 46 ++---- .../AccessController/PreserveCombiner.java | 20 ++- .../security/auth/Subject/CurrentSubject.java | 149 +++++++++++++++++ .../jdk/javax/security/auth/Subject/DoAs.java | 11 +- .../security/auth/Subject/Exceptions.java | 99 ++++++++++++ .../javax/security/auth/Subject/FromACC.java | 63 ++++++++ .../javax/security/auth/Subject/Synch.java | 16 +- test/jdk/sun/security/krb5/KrbCredSubKey.java | 8 +- .../krb5/ServiceCredsCombination.java | 14 +- test/jdk/sun/security/krb5/auto/Context.java | 30 ++-- .../krb5/auto/HttpNegotiateServer.java | 25 ++- test/jdk/sun/security/krb5/auto/LongLife.java | 6 +- 20 files changed, 569 insertions(+), 216 deletions(-) create mode 100644 test/jdk/javax/security/auth/Subject/CurrentSubject.java create mode 100644 test/jdk/javax/security/auth/Subject/Exceptions.java create mode 100644 test/jdk/javax/security/auth/Subject/FromACC.java diff --git a/src/java.base/share/classes/javax/security/auth/Subject.java b/src/java.base/share/classes/javax/security/auth/Subject.java index f4a6a333025..8e30f84ff44 100644 --- a/src/java.base/share/classes/javax/security/auth/Subject.java +++ b/src/java.base/share/classes/javax/security/auth/Subject.java @@ -27,18 +27,18 @@ package javax.security.auth; import java.util.*; import java.io.*; -import java.lang.reflect.*; import java.text.MessageFormat; import java.security.AccessController; import java.security.AccessControlContext; import java.security.DomainCombiner; -import java.security.Permission; -import java.security.PermissionCollection; import java.security.Principal; -import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; import java.security.ProtectionDomain; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; + +import sun.security.action.GetBooleanAction; import sun.security.util.ResourcesMgr; /** @@ -289,9 +289,10 @@ public final class Subject implements java.io.Serializable { * @deprecated This method depends on {@link AccessControlContext} * which, in conjunction with * {@linkplain SecurityManager the Security Manager}, is deprecated - * and subject to removal in a future release. However, obtaining a - * Subject is useful independent of the Security Manager, so a - * replacement for this method may be added in a future release. + * and subject to removal in a future release. However, + * obtaining a Subject is useful independent of the Security Manager. + * Thus, a replacement API named {@link #current()} has been added + * which can be used to obtain the current subject. */ @SuppressWarnings("removal") @Deprecated(since="17", forRemoval=true) @@ -319,6 +320,112 @@ public final class Subject implements java.io.Serializable { }); } + // Store the current subject in a ThreadLocal when a system property is set. + private static final boolean USE_TL = GetBooleanAction + .privilegedGetProperty("jdk.security.auth.subject.useTL"); + + private static final InheritableThreadLocal SUBJECT_THREAD_LOCAL = + USE_TL ? + new InheritableThreadLocal<>() { + @Override protected Subject initialValue() { + return null; + } + } : null; + + /** + * Returns the current subject. + *

          + * The current subject is installed by the {@link #callAs} method. + * When {@code callAs(subject, action)} is called, {@code action} is + * executed with {@code subject} as its current subject which can be + * retrieved by this method. After {@code action} is finished, the current + * subject is reset to its previous value. The current + * subject is {@code null} before the first call of {@code callAs()}. + *

          + * When a new thread is created, its current subject is the same as + * the one of its parent thread, and will not change even if + * its parent thread's current subject is changed to another value. + * + * @implNote + * By default, this method returns the same value as + * {@code Subject.getSubject(AccessController.getContext())}. This + * preserves compatibility with code that may still be calling {@code doAs} + * which installs the subject in an {@code AccessControlContext}. However, + * if the system property {@systemProperty jdk.security.auth.subject.useTL} + * is set to {@code true}, the subject is retrieved from an inheritable + * {@code ThreadLocal} object. This behavior is subject to + * change in a future version. + * + * @return the current subject, or {@code null} if a current subject is + * not installed or the current subject is set to {@code null}. + * @see #callAs(Subject, Callable) + * @since 18 + */ + @SuppressWarnings("removal") + public static Subject current() { + return USE_TL + ? SUBJECT_THREAD_LOCAL.get() + : getSubject(AccessController.getContext()); + } + + /** + * Executes a {@code Callable} with {@code subject} as the + * current subject. + * + * @implNote + * By default, this method calls {@link #doAs(Subject, PrivilegedExceptionAction) + * Subject.doAs(subject, altAction)} which stores the subject in + * a new {@code AccessControlContext}, where {@code altAction.run()} + * is equivalent to {@code action.call()} and the exception thrown is + * modified to match the specification of this method. This preserves + * compatibility with code that may still be calling + * {@code getSubject(AccessControlContext)} which retrieves the subject + * from an {@code AccessControlContext}. However, + * if the system property {@code jdk.security.auth.subject.useTL} + * is set to {@code true}, the current subject will be stored in an inheritable + * {@code ThreadLocal} object. This behavior is subject to change in a + * future version. + * + * @param subject the {@code Subject} that the specified {@code action} + * will run as. This parameter may be {@code null}. + * @param action the code to be run with {@code subject} as its current + * subject. Must not be {@code null}. + * @param the type of value returned by the {@code call} method + * of {@code action} + * @return the value returned by the {@code call} method of {@code action} + * @throws NullPointerException if {@code action} is {@code null} + * @throws CompletionException if {@code action.call()} throws an exception. + * The cause of the {@code CompletionException} is set to the exception + * thrown by {@code action.call()}. + * @see #current() + * @since 18 + */ + public static T callAs(final Subject subject, + final Callable action) throws CompletionException { + if (USE_TL) { + Subject oldSubject = SUBJECT_THREAD_LOCAL.get(); + SUBJECT_THREAD_LOCAL.set(subject); + try { + return action.call(); + } catch (Exception e) { + throw new CompletionException(e); + } finally { + SUBJECT_THREAD_LOCAL.set(oldSubject); + } + } else { + try { + PrivilegedExceptionAction pa = () -> action.call(); + @SuppressWarnings("removal") + var result = doAs(subject, pa); + return result; + } catch (PrivilegedActionException e) { + throw new CompletionException(e.getCause()); + } catch (Exception e) { + throw new CompletionException(e); + } + } + } + /** * Perform work as a particular {@code Subject}. * @@ -354,8 +461,17 @@ public final class Subject implements java.io.Serializable { * {@link AuthPermission#AuthPermission(String) * AuthPermission("doAs")} permission to invoke this * method. + * + * @deprecated This method depends on {@link AccessControlContext} + * which, in conjunction with + * {@linkplain SecurityManager the Security Manager}, is deprecated + * and subject to removal in a future release. However, performing + * work as a Subject is useful independent of the Security Manager. + * Thus, a replacement API named {@link #callAs} has been added + * which can be used to perform the same work. */ @SuppressWarnings("removal") + @Deprecated(since="18", forRemoval=true) public static T doAs(final Subject subject, final java.security.PrivilegedAction action) { @@ -417,8 +533,17 @@ public final class Subject implements java.io.Serializable { * {@link AuthPermission#AuthPermission(String) * AuthPermission("doAs")} permission to invoke this * method. + * + * @deprecated This method depends on {@link AccessControlContext} + * which, in conjunction with + * {@linkplain SecurityManager the Security Manager}, is deprecated + * and subject to removal in a future release. However, performing + * work as a Subject is useful independent of the Security Manager. + * Thus, a replacement API named {@link #callAs} has been added + * which can be used to perform the same work. */ @SuppressWarnings("removal") + @Deprecated(since="18", forRemoval=true) public static T doAs(final Subject subject, final java.security.PrivilegedExceptionAction action) throws java.security.PrivilegedActionException { @@ -857,10 +982,7 @@ public final class Subject implements java.io.Serializable { // avoid deadlock from dual locks thatPrivCredentials = new HashSet<>(that.privCredentials); } - if (!privCredentials.equals(thatPrivCredentials)) { - return false; - } - return true; + return privCredentials.equals(thatPrivCredentials); } return false; } @@ -933,7 +1055,7 @@ public final class Subject implements java.io.Serializable { @Override public int hashCode() { - /** + /* * The hashcode is derived exclusive or-ing the * hashcodes of this Subject's Principals and credentials. * @@ -1244,7 +1366,7 @@ public final class Subject implements java.io.Serializable { } else { // For private credentials: - // If the caller does not have read permission for + // If the caller does not have read permission // for o.getClass(), we throw a SecurityException. // Otherwise we check the private cred set to see whether // it contains the Object @@ -1316,7 +1438,7 @@ public final class Subject implements java.io.Serializable { c = collectionNullClean(c); for (Object item : c) { - if (this.contains(item) == false) { + if (!this.contains(item)) { return false; } } @@ -1534,7 +1656,7 @@ public final class Subject implements java.io.Serializable { break; } - // Check whether the caller has permisson to get + // Check whether the caller has permission to get // credentials of Class c while (iterator.hasNext()) { diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java b/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java index 9f21ac5e84d..482bb8533e8 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/GSSUtil.java @@ -40,7 +40,6 @@ import java.util.HashSet; import java.util.Vector; import java.util.Iterator; import java.security.AccessController; -import java.security.AccessControlContext; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; import javax.security.auth.callback.CallbackHandler; @@ -313,20 +312,18 @@ public class GSSUtil { (initiate? " INIT" : " ACCEPT") + " cred (" + (name == null? "<>" : name.toString()) + ", " + credCls.getName() + ")"); - @SuppressWarnings("removal") - final AccessControlContext acc = AccessController.getContext(); try { @SuppressWarnings("removal") Vector creds = - AccessController.doPrivileged + AccessController.doPrivilegedWithCombiner (new PrivilegedExceptionAction>() { public Vector run() throws Exception { - Subject accSubj = Subject.getSubject(acc); + Subject currSubj = Subject.current(); Vector result = null; - if (accSubj != null) { + if (currSubj != null) { result = new Vector(); Iterator iterator = - accSubj.getPrivateCredentials + currSubj.getPrivateCredentials (GSSCredentialImpl.class).iterator(); while (iterator.hasNext()) { GSSCredentialImpl cred = iterator.next(); diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java index 10bb08c37ad..272a0794014 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5AcceptCredential.java @@ -25,7 +25,6 @@ package sun.security.jgss.krb5; -import java.io.IOException; import org.ietf.jgss.*; import sun.security.jgss.GSSCaller; import sun.security.jgss.spi.*; @@ -33,7 +32,6 @@ import sun.security.krb5.*; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.security.AccessController; -import java.security.AccessControlContext; import javax.security.auth.DestroyFailedException; /** @@ -65,16 +63,15 @@ public class Krb5AcceptCredential final String serverPrinc = (name == null? null: name.getKrb5PrincipalName().getName()); - final AccessControlContext acc = AccessController.getContext(); ServiceCreds creds = null; try { - creds = AccessController.doPrivileged( + creds = AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction() { public ServiceCreds run() throws Exception { return Krb5Util.getServiceCreds( caller == GSSCaller.CALLER_UNKNOWN ? GSSCaller.CALLER_ACCEPT: caller, - serverPrinc, acc); + serverPrinc); }}); } catch (PrivilegedActionException e) { GSSException ge = diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java index 3cb0bf46cb8..8a9ab5f8488 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java @@ -37,7 +37,6 @@ import java.io.OutputStream; import java.io.IOException; import java.security.Provider; import java.security.AccessController; -import java.security.AccessControlContext; import java.security.Key; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; @@ -641,16 +640,12 @@ class Krb5Context implements GSSContextSpi { * for this service in the Subject and reuse it */ - @SuppressWarnings("removal") - final AccessControlContext acc = - AccessController.getContext(); - if (GSSUtil.useSubjectCredsOnly(caller)) { KerberosTicket kerbTicket = null; try { // get service ticket from caller's subject @SuppressWarnings("removal") - var tmp = AccessController.doPrivileged( + var tmp = AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction() { public KerberosTicket run() throws Exception { // XXX to be cleaned @@ -665,8 +660,7 @@ class Krb5Context implements GSSContextSpi { second == null ? myName.getKrb5PrincipalName().getName(): second.getName().getKrb5PrincipalName().getName(), - peerName.getKrb5PrincipalName().getName(), - acc); + peerName.getKrb5PrincipalName().getName()); }}); kerbTicket = tmp; } catch (PrivilegedActionException e) { @@ -710,10 +704,10 @@ class Krb5Context implements GSSContextSpi { if (GSSUtil.useSubjectCredsOnly(caller)) { @SuppressWarnings("removal") final Subject subject = - AccessController.doPrivileged( + AccessController.doPrivilegedWithCombiner( new java.security.PrivilegedAction() { public Subject run() { - return (Subject.getSubject(acc)); + return (Subject.current()); } }); if (subject != null && diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java index 3e168cd718e..5bd5652f699 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java @@ -35,7 +35,6 @@ import java.net.InetAddress; import java.io.IOException; import java.util.Date; import java.security.AccessController; -import java.security.AccessControlContext; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; @@ -365,20 +364,17 @@ public class Krb5InitCredential clientPrincipal = null; } - final AccessControlContext acc = AccessController.getContext(); - try { final GSSCaller realCaller = (caller == GSSCaller.CALLER_UNKNOWN) ? GSSCaller.CALLER_INITIATE : caller; - return AccessController.doPrivileged( + return AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction() { public KerberosTicket run() throws Exception { // It's OK to use null as serverPrincipal. TGT is almost // the first ticket for a principal and we use list. return Krb5Util.getInitialTicket( - realCaller, - clientPrincipal, acc); + realCaller, clientPrincipal); }}); } catch (PrivilegedActionException e) { GSSException ge = diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Util.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Util.java index 24353cceeca..bf2bc82ffaf 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Util.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Util.java @@ -30,7 +30,6 @@ import javax.security.auth.kerberos.KerberosPrincipal; import javax.security.auth.kerberos.KeyTab; import javax.security.auth.Subject; import javax.security.auth.login.LoginException; -import java.security.AccessControlContext; import sun.security.action.GetBooleanAction; import sun.security.jgss.GSSUtil; @@ -62,14 +61,12 @@ public class Krb5Util { * pair from the Subject in the specified AccessControlContext. */ static KerberosTicket getServiceTicket(GSSCaller caller, - String clientPrincipal, String serverPrincipal, - @SuppressWarnings("removal") AccessControlContext acc) throws LoginException { - - // Try to get ticket from acc's Subject + String clientPrincipal, String serverPrincipal) { + // Try to get ticket from current Subject @SuppressWarnings("removal") - Subject accSubj = Subject.getSubject(acc); + Subject currSubj = Subject.current(); KerberosTicket ticket = - SubjectComber.find(accSubj, serverPrincipal, clientPrincipal, + SubjectComber.find(currSubj, serverPrincipal, clientPrincipal, KerberosTicket.class); return ticket; @@ -83,14 +80,11 @@ public class Krb5Util { * a LoginContext. */ static KerberosTicket getInitialTicket(GSSCaller caller, - String clientPrincipal, - @SuppressWarnings("removal") AccessControlContext acc) throws LoginException { + String clientPrincipal) throws LoginException { - // Try to get ticket from acc's Subject - @SuppressWarnings("removal") - Subject accSubj = Subject.getSubject(acc); + Subject currSubj = Subject.current(); KerberosTicket ticket = - SubjectComber.find(accSubj, null, clientPrincipal, + SubjectComber.find(currSubj, null, clientPrincipal, KerberosTicket.class); // Try to get ticket from Subject obtained from GSSUtil @@ -106,18 +100,14 @@ public class Krb5Util { * Retrieves the ServiceCreds for the specified server principal from * the Subject in the specified AccessControlContext. If not found, and if * useSubjectCredsOnly is false, then obtain from a LoginContext. - * - * NOTE: This method is also used by JSSE Kerberos Cipher Suites */ public static ServiceCreds getServiceCreds(GSSCaller caller, - String serverPrincipal, @SuppressWarnings("removal") AccessControlContext acc) - throws LoginException { + String serverPrincipal) throws LoginException { - @SuppressWarnings("removal") - Subject accSubj = Subject.getSubject(acc); + Subject currSubj = Subject.current(); ServiceCreds sc = null; - if (accSubj != null) { - sc = ServiceCreds.getInstance(accSubj, serverPrincipal); + if (currSubj != null) { + sc = ServiceCreds.getInstance(currSubj, serverPrincipal); } if (sc == null && !GSSUtil.useSubjectCredsOnly(caller)) { Subject subject = GSSUtil.login(caller, GSSUtil.GSS_KRB5_MECH_OID); diff --git a/test/jdk/com/sun/security/sasl/gsskerb/AuthOnly.java b/test/jdk/com/sun/security/sasl/gsskerb/AuthOnly.java index fa8105a69bb..c8e906d0ac1 100644 --- a/test/jdk/com/sun/security/sasl/gsskerb/AuthOnly.java +++ b/test/jdk/com/sun/security/sasl/gsskerb/AuthOnly.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -35,11 +35,11 @@ import javax.security.sasl.*; import javax.security.auth.callback.*; -import java.security.*; import javax.security.auth.Subject; import javax.security.auth.login.*; import com.sun.security.auth.callback.*; import java.util.HashMap; +import java.util.concurrent.Callable; public class AuthOnly { private static final String MECH = "GSSAPI"; @@ -84,8 +84,8 @@ public class AuthOnly { srvprops.put(Sasl.QOP, "auth,auth-int,auth-conf"); final SaslClient clnt = (SaslClient) - Subject.doAs(clntSubj, new PrivilegedExceptionAction() { - public Object run() throws Exception { + Subject.callAs(clntSubj, new Callable<>() { + public Object call() throws Exception { return Sasl.createSaslClient( new String[]{MECH}, null, PROTOCOL, SERVER_FQDN, clntprops, null); @@ -97,8 +97,8 @@ public class AuthOnly { System.out.println(srvSubj); } final SaslServer srv = (SaslServer) - Subject.doAs(srvSubj, new PrivilegedExceptionAction() { - public Object run() throws Exception { + Subject.callAs(srvSubj, new Callable() { + public Object call() throws Exception { return Sasl.createSaslServer(MECH, PROTOCOL, SERVER_FQDN, srvprops, srvCbh); } @@ -117,27 +117,18 @@ public class AuthOnly { byte[] response; byte[] challenge; - response = (byte[]) Subject.doAs(clntSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return (clnt.hasInitialResponse()? clnt.evaluateChallenge(EMPTY) : EMPTY); - }}); + response = (byte[]) Subject.callAs(clntSubj, + () -> (clnt.hasInitialResponse()? clnt.evaluateChallenge(EMPTY) : EMPTY)); while (!clnt.isComplete() || !srv.isComplete()) { final byte[] responseCopy = response; - challenge = (byte[]) Subject.doAs(srvSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return srv.evaluateResponse(responseCopy); - }}); + challenge = (byte[]) Subject.callAs(srvSubj, + () -> srv.evaluateResponse(responseCopy)); if (challenge != null) { final byte[] challengeCopy = challenge; - response = (byte[]) Subject.doAs(clntSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return clnt.evaluateChallenge(challengeCopy); - }}); + response = (byte[]) Subject.callAs(clntSubj, + () -> clnt.evaluateChallenge(challengeCopy)); } } diff --git a/test/jdk/com/sun/security/sasl/gsskerb/ConfSecurityLayer.java b/test/jdk/com/sun/security/sasl/gsskerb/ConfSecurityLayer.java index 88df3482d12..8a699a5920d 100644 --- a/test/jdk/com/sun/security/sasl/gsskerb/ConfSecurityLayer.java +++ b/test/jdk/com/sun/security/sasl/gsskerb/ConfSecurityLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -36,7 +36,6 @@ import javax.security.sasl.*; import javax.security.auth.callback.*; -import java.security.*; import javax.security.auth.Subject; import javax.security.auth.login.*; import com.sun.security.auth.callback.*; @@ -85,25 +84,18 @@ public class ConfSecurityLayer { srvprops.put(Sasl.QOP, "auth,auth-int,auth-conf"); final SaslClient clnt = (SaslClient) - Subject.doAs(clntSubj, new PrivilegedExceptionAction() { - public Object run() throws Exception { - return Sasl.createSaslClient( + Subject.callAs(clntSubj, () ->Sasl.createSaslClient( new String[]{MECH}, null, PROTOCOL, SERVER_FQDN, - clntprops, null); - } - }); + clntprops, null)); if (verbose) { System.out.println(clntSubj); System.out.println(srvSubj); } final SaslServer srv = (SaslServer) - Subject.doAs(srvSubj, new PrivilegedExceptionAction() { - public Object run() throws Exception { - return Sasl.createSaslServer(MECH, PROTOCOL, SERVER_FQDN, - srvprops, srvCbh); - } - }); + Subject.callAs(srvSubj, () -> + Sasl.createSaslServer(MECH, PROTOCOL, SERVER_FQDN, + srvprops, srvCbh)); if (clnt == null) { @@ -118,27 +110,18 @@ public class ConfSecurityLayer { byte[] response; byte[] challenge; - response = (byte[]) Subject.doAs(clntSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return (clnt.hasInitialResponse()? clnt.evaluateChallenge(EMPTY) : EMPTY); - }}); + response = Subject.callAs(clntSubj, + () -> (clnt.hasInitialResponse()? clnt.evaluateChallenge(EMPTY) : EMPTY)); while (!clnt.isComplete() || !srv.isComplete()) { final byte[] responseCopy = response; - challenge = (byte[]) Subject.doAs(srvSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return srv.evaluateResponse(responseCopy); - }}); + challenge = Subject.callAs(srvSubj, + () -> srv.evaluateResponse(responseCopy)); if (challenge != null) { final byte[] challengeCopy = challenge; - response = (byte[]) Subject.doAs(clntSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return clnt.evaluateChallenge(challengeCopy); - }}); + response = Subject.callAs(clntSubj, + () -> clnt.evaluateChallenge(challengeCopy)); } } diff --git a/test/jdk/com/sun/security/sasl/gsskerb/NoSecurityLayer.java b/test/jdk/com/sun/security/sasl/gsskerb/NoSecurityLayer.java index 63a759d778c..45d7d1fc1fb 100644 --- a/test/jdk/com/sun/security/sasl/gsskerb/NoSecurityLayer.java +++ b/test/jdk/com/sun/security/sasl/gsskerb/NoSecurityLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -36,7 +36,6 @@ import javax.security.sasl.*; import javax.security.auth.callback.*; -import java.security.*; import javax.security.auth.Subject; import javax.security.auth.login.*; import com.sun.security.auth.callback.*; @@ -84,26 +83,20 @@ public class NoSecurityLayer { clntprops.put(Sasl.QOP, "auth"); srvprops.put(Sasl.QOP, "auth,auth-int,auth-conf"); - final SaslClient clnt = (SaslClient) - Subject.doAs(clntSubj, new PrivilegedExceptionAction() { - public Object run() throws Exception { - return Sasl.createSaslClient( + final SaslClient clnt = + Subject.callAs(clntSubj, () -> + Sasl.createSaslClient( new String[]{MECH}, null, PROTOCOL, SERVER_FQDN, - clntprops, null); - } - }); + clntprops, null)); if (verbose) { System.out.println(clntSubj); System.out.println(srvSubj); } - final SaslServer srv = (SaslServer) - Subject.doAs(srvSubj, new PrivilegedExceptionAction() { - public Object run() throws Exception { - return Sasl.createSaslServer(MECH, PROTOCOL, SERVER_FQDN, - srvprops, srvCbh); - } - }); + final SaslServer srv = + Subject.callAs(srvSubj, () -> + Sasl.createSaslServer(MECH, PROTOCOL, SERVER_FQDN, + srvprops, srvCbh)); if (clnt == null) { @@ -118,27 +111,18 @@ public class NoSecurityLayer { byte[] response; byte[] challenge; - response = (byte[]) Subject.doAs(clntSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return (clnt.hasInitialResponse()? clnt.evaluateChallenge(EMPTY) : EMPTY); - }}); + response = Subject.callAs(clntSubj, + () -> (clnt.hasInitialResponse()? clnt.evaluateChallenge(EMPTY) : EMPTY)); while (!clnt.isComplete() || !srv.isComplete()) { final byte[] responseCopy = response; - challenge = (byte[]) Subject.doAs(srvSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return srv.evaluateResponse(responseCopy); - }}); + challenge = Subject.callAs(srvSubj, + () -> srv.evaluateResponse(responseCopy)); if (challenge != null) { final byte[] challengeCopy = challenge; - response = (byte[]) Subject.doAs(clntSubj, - new PrivilegedExceptionAction() { - public Object run() throws Exception { - return clnt.evaluateChallenge(challengeCopy); - }}); + response = Subject.callAs(clntSubj, + () -> clnt.evaluateChallenge(challengeCopy)); } } diff --git a/test/jdk/java/security/AccessController/PreserveCombiner.java b/test/jdk/java/security/AccessController/PreserveCombiner.java index a2019fddb6c..c6c73b1e13d 100644 --- a/test/jdk/java/security/AccessController/PreserveCombiner.java +++ b/test/jdk/java/security/AccessController/PreserveCombiner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -28,6 +28,7 @@ */ import java.security.*; +import java.util.concurrent.Callable; import javax.security.auth.Subject; import javax.security.auth.x500.X500Principal; @@ -38,16 +39,15 @@ public class PreserveCombiner { Subject s = new Subject(); s.getPrincipals().add(new X500Principal("cn=duke")); - String result = (String)Subject.doAs(s, new PrivilegedAction() { - public Object run() { + String result = Subject.callAs(s, new Callable() { + public String call() { // get subject from current ACC - this always worked - Subject doAsSubject = - Subject.getSubject(AccessController.getContext()); - if (doAsSubject == null) { + Subject callAsSubject = Subject.current(); + if (callAsSubject == null) { return "test 1 failed"; } else { - System.out.println(doAsSubject); + System.out.println(callAsSubject); System.out.println("test 1 passed"); } @@ -56,8 +56,7 @@ public class PreserveCombiner { (new PrivilegedAction() { public String run() { // get subject after doPriv - Subject doPrivSubject = - Subject.getSubject(AccessController.getContext()); + Subject doPrivSubject = Subject.current(); if (doPrivSubject == null) { return "test 2 failed"; } else { @@ -79,8 +78,7 @@ public class PreserveCombiner { (new PrivilegedExceptionAction() { public String run() throws PrivilegedActionException { // get subject after doPriv - Subject doPrivSubject = Subject.getSubject - (AccessController.getContext()); + Subject doPrivSubject = Subject.current(); if (doPrivSubject == null) { return "test 3 failed"; } else { diff --git a/test/jdk/javax/security/auth/Subject/CurrentSubject.java b/test/jdk/javax/security/auth/Subject/CurrentSubject.java new file mode 100644 index 00000000000..5cf711b8084 --- /dev/null +++ b/test/jdk/javax/security/auth/Subject/CurrentSubject.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 javax.security.auth.Subject; +import java.security.AccessController; +import java.security.Principal; +import java.security.PrivilegedAction; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicInteger; + +/* + * @test + * @bug 8267108 + * @summary confirm current subject specification + * @run main/othervm + * -Djdk.security.auth.subject.useTL=false -Dtest=both CurrentSubject + * @run main/othervm + * -Djdk.security.auth.subject.useTL=true -Dtest=old CurrentSubject + * @run main/othervm + * -Djdk.security.auth.subject.useTL=true -Dtest=new CurrentSubject + */ +public class CurrentSubject { + + static final boolean TEST_NEW = !System.getProperty("test").equals("old"); + static final boolean TEST_OLD = !System.getProperty("test").equals("new"); + + static transient boolean failed = false; + static CountDownLatch cl = new CountDownLatch(1); + static AtomicInteger count = new AtomicInteger(); + + public static void main(String[] args) throws Exception { + // At the beginning, current subject is null + test("", null); + cl.await(); + if (failed) { + throw new Exception("Failed"); + } + } + + /** + * Ensure the current subject is the expected Subject object. + * + * @param label label to print out + * @param expected the expected Subject + */ + synchronized static void check(String label, Subject expected) { + Subject cas = Subject.current(); + Subject accs = Subject.getSubject(AccessController.getContext()); + if (TEST_NEW && TEST_OLD && cas != accs) { + failed = true; + System.out.println(label + ": current " + s2s(cas) + + " but getSubject is " + s2s(accs)); + } + Subject interested = TEST_NEW ? cas : accs; + if (interested != expected) { + failed = true; + System.out.println(label + ": expected " + s2s(expected) + + " but see " + s2s(interested)); + } else { + System.out.println(label + ": " + s2s(expected)); + } + } + + /** + * Recursively testing on current subject with getAs() and thread creations. + * + * @param name the current label + * @param expected the expected Subject + */ + static Void test(String name, Subject expected) { + // Now it's the expected current subject + check(" ".repeat(name.length()) + "-> " + name, expected); + // Recursively check, do not go infinity + if (name.length() < 4) { + Subject another = new Subject(); + another.getPrincipals().add(new RawPrincipal(name + "d")); + // run with a new subject, inside current subject will be the new subject + if (TEST_NEW) Subject.callAs(another, () -> test(name + 'c', another)); + if (TEST_OLD) Subject.doAs(another, (PrivilegedAction) () -> test(name + 'd', another)); + // run with null, inside current subject will be null + if (TEST_NEW) Subject.callAs(null, () -> test(name + 'C', null)); + if (TEST_OLD) Subject.doAs(null, (PrivilegedAction) () -> test(name + 'D', null)); + // new thread, inside current subject is unchanged + count.incrementAndGet(); + new Thread(() -> { + try { + test(name + 't', expected); + try { + Thread.sleep(500); + } catch (Exception e) { + throw new AssertionError(e); + } + // by this time, parent thread should have exited the + // action and current subject reset, but here + // current subject unchanged. + test(name + 'T', expected); + } finally { + var n = count.decrementAndGet(); + if (n == 0) { + cl.countDown(); + } + assert n >= 0; + } + }).start(); + } + // Now it's reset to original + check(" ".repeat(name.length()) + "<- " + name, expected); + return null; + } + + static class RawPrincipal implements Principal { + + String name; + RawPrincipal(String name) { + this.name = name; + } + @Override + public String getName() { + return name; + } + } + + static String s2s(Subject s) { + return s == null ? null + : s.getPrincipals().iterator().next().getName(); + } +} diff --git a/test/jdk/javax/security/auth/Subject/DoAs.java b/test/jdk/javax/security/auth/Subject/DoAs.java index 7f378be80a0..db89c8936cd 100644 --- a/test/jdk/javax/security/auth/Subject/DoAs.java +++ b/test/jdk/javax/security/auth/Subject/DoAs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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,10 +26,6 @@ * @bug 8214583 * @summary Check that getSubject works after JIT compiler escape analysis. */ -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -44,9 +40,8 @@ public class DoAs { for (int i = 0; i < 100_000; ++i) { final int index = i; - Subject.doAs(subject, (PrivilegedExceptionAction)() -> { - AccessControlContext c1 = AccessController.getContext(); - Subject s = Subject.getSubject(c1); + Subject.callAs(subject, () -> { + Subject s = Subject.current(); if (s != subject) { throw new AssertionError("outer Oops! " + "iteration " + index + " " + s + " != " + subject); } diff --git a/test/jdk/javax/security/auth/Subject/Exceptions.java b/test/jdk/javax/security/auth/Subject/Exceptions.java new file mode 100644 index 00000000000..e91cd4c3b13 --- /dev/null +++ b/test/jdk/javax/security/auth/Subject/Exceptions.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021, 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 8267108 + * @library /test/lib + * @summary Check that callAs and doAs throw the specified exceptions + * @run main/othervm -Djava.security.manager=allow -Djdk.security.auth.subject.useTL=true Exceptions + * @run main/othervm -Djava.security.manager=allow -Djdk.security.auth.subject.useTL=false Exceptions + */ +import jdk.test.lib.Asserts; + +import javax.security.auth.Subject; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; + +public class Exceptions { + + public static void main(String[] args) throws Exception { + + // Checked exceptions are always wrapped + new TestCase(() -> { throw new Exception("Hi"); }) + .testDoAs(PrivilegedActionException.class, Exception.class) + .testCallAs(CompletionException.class, Exception.class); + // PrivilegedActionException itself is checked + new TestCase(() -> { throw new PrivilegedActionException(new Exception("Hi")); }) + .testDoAs(PrivilegedActionException.class, PrivilegedActionException.class, Exception.class) + .testCallAs(CompletionException.class, PrivilegedActionException.class, Exception.class); + + // Unchecked exception: rethrown by doAs(), wrapped by callAs() + new TestCase(() -> { throw new RuntimeException("Hi"); }) + .testDoAs(RuntimeException.class) + .testCallAs(CompletionException.class, RuntimeException.class); + // CompletionException itself is unchecked + new TestCase(() -> { throw new CompletionException(new Exception("Hi")); }) + .testDoAs(CompletionException.class, Exception.class) + .testCallAs(CompletionException.class, CompletionException.class, Exception.class); + } + + static class TestCase { + + final Callable action; + TestCase(Callable action) { + this.action = action; + } + + TestCase testDoAs(Class... exceptions) { + return test(true, exceptions); + } + + TestCase testCallAs(Class... exceptions) { + return test(false, exceptions); + } + + // Perform the action in doAs() or callAs() and inspect + // the exception (and its causes, recursively) it throws + private TestCase test(boolean doAs, Class... exceptions) { + int pos = 0; + try { + if (doAs) { + Subject.doAs(null, (PrivilegedExceptionAction) action::call); + } else { + Subject.callAs(null, action::call); + } + } catch (Exception e) { + while (e != null) { + Asserts.assertEQ(e.getClass(), exceptions[pos++]); + e = (Exception) e.getCause(); + } + } + // Make sure the list is the exact size + Asserts.assertTrue(pos == exceptions.length); + return this; + } + } +} diff --git a/test/jdk/javax/security/auth/Subject/FromACC.java b/test/jdk/javax/security/auth/Subject/FromACC.java new file mode 100644 index 00000000000..07216cb228b --- /dev/null +++ b/test/jdk/javax/security/auth/Subject/FromACC.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021, 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 javax.security.auth.Subject; +import javax.security.auth.x500.X500Principal; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedAction; + +/* + * @test + * @bug 8267108 + * @summary confirm current installed subject specification + * @run main/othervm -Djava.security.manager=allow FromACC + * @run main/othervm -Djava.security.manager=disallow FromACC + */ +public class FromACC { + public static void main(String[] args) throws Exception { + var n = Subject.doAs(from("a"), (PrivilegedAction) + () -> AccessController.getContext()); + if (!get(Subject.getSubject(n)).equals("CN=a")) { + throw new RuntimeException(); + } + } + + static Subject from(String name) { + Subject s = new Subject(); + s.getPrincipals().add(new X500Principal("CN=" + name)); + return s; + } + + static String get(Subject s) { + if (s == null) { + return "none"; + } + var v = s.getPrincipals(X500Principal.class); + if (v == null || v.isEmpty()) { + return "none"; + } else { + return v.iterator().next().getName(); + } + } +} diff --git a/test/jdk/javax/security/auth/Subject/Synch.java b/test/jdk/javax/security/auth/Subject/Synch.java index 8c392a31d0b..85bf43cfde7 100644 --- a/test/jdk/javax/security/auth/Subject/Synch.java +++ b/test/jdk/javax/security/auth/Subject/Synch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -28,9 +28,9 @@ */ import java.security.Principal; -import java.security.PrivilegedAction; import java.util.Collections; import java.util.Set; +import java.util.concurrent.Callable; import javax.security.auth.Subject; import javax.security.auth.x500.X500Principal; @@ -52,18 +52,18 @@ public class Synch { } }.start(); for (int i = 0; i < 1000; i++) { - Subject.doAs( + Subject.callAs( subject, - new PrivilegedAction() { - public Object run() { - return Subject.doAs( + new Callable() { + public Object call() { + return Subject.callAs( new Subject(true, Collections.singleton( new X500Principal("CN=Claire")), Collections.EMPTY_SET, Collections.EMPTY_SET), - new PrivilegedAction() { - public Object run() { + new Callable() { + public Object call() { return null; } }); diff --git a/test/jdk/sun/security/krb5/KrbCredSubKey.java b/test/jdk/sun/security/krb5/KrbCredSubKey.java index 0b68fceeb53..a7babbfcafa 100644 --- a/test/jdk/sun/security/krb5/KrbCredSubKey.java +++ b/test/jdk/sun/security/krb5/KrbCredSubKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -31,7 +31,7 @@ */ import java.io.FileOutputStream; -import java.security.PrivilegedExceptionAction; +import java.util.concurrent.Callable; import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosKey; import javax.security.auth.kerberos.KerberosPrincipal; @@ -59,8 +59,8 @@ public class KrbCredSubKey { subj.getPrincipals().add(kp); subj.getPrivateCredentials().add(kk); - Subject.doAs(subj, new PrivilegedExceptionAction() { - public Object run() throws Exception { + Subject.callAs(subj, new Callable<>() { + public Object call() throws Exception { GSSManager man = GSSManager.getInstance(); GSSContext ctxt = man.createContext(man.createCredential( null, GSSCredential.INDEFINITE_LIFETIME, diff --git a/test/jdk/sun/security/krb5/ServiceCredsCombination.java b/test/jdk/sun/security/krb5/ServiceCredsCombination.java index 3876743e516..5c366577baa 100644 --- a/test/jdk/sun/security/krb5/ServiceCredsCombination.java +++ b/test/jdk/sun/security/krb5/ServiceCredsCombination.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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,9 +29,9 @@ * @summary default principal can act as anyone */ -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.Objects; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosKey; import javax.security.auth.kerberos.KerberosPrincipal; @@ -122,10 +122,10 @@ public class ServiceCredsCombination { } final GSSManager man = GSSManager.getInstance(); try { - String result = Subject.doAs( - subj, new PrivilegedExceptionAction() { + String result = Subject.callAs( + subj, new Callable() { @Override - public String run() throws GSSException { + public String call() throws GSSException { GSSCredential cred = man.createCredential( a == null ? null : man.createName(r(a), null), GSSCredential.INDEFINITE_LIFETIME, @@ -139,7 +139,7 @@ public class ServiceCredsCombination { throw new Exception("Check failed: getInstance(" + a + ") has name " + result + ", not " + b); } - } catch (PrivilegedActionException e) { + } catch (CompletionException e) { if (!"NOCRED".equals(b)) { throw new Exception("Check failed: getInstance(" + a + ") is null " + ", but not one with name " + b); diff --git a/test/jdk/sun/security/krb5/auto/Context.java b/test/jdk/sun/security/krb5/auto/Context.java index 24c085392cd..ed8bab0e3d6 100644 --- a/test/jdk/sun/security/krb5/auto/Context.java +++ b/test/jdk/sun/security/krb5/auto/Context.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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,8 +26,6 @@ import com.sun.security.auth.module.Krb5LoginModule; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -55,6 +53,8 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.security.Principal; import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; /** * Context of a JGSS subject, encapsulating Subject and GSSContext. @@ -100,9 +100,9 @@ public class Context { Context out = new Context(); out.s = s; try { - out.cred = Subject.doAs(s, new PrivilegedExceptionAction() { + out.cred = Subject.callAs(s, new Callable() { @Override - public GSSCredential run() throws Exception { + public GSSCredential call() throws Exception { GSSCredential cred = x.getDelegCred(); if (cred == null && x.getCredDelegState() || cred != null && !x.getCredDelegState()) { @@ -111,8 +111,8 @@ public class Context { return cred; } }); - } catch (PrivilegedActionException pae) { - throw pae.getException(); + } catch (CompletionException ce) { + throw (Exception) ce.getCause(); } out.name = name + " as " + out.cred.getName().toString(); return out; @@ -339,15 +339,15 @@ public class Context { */ public byte[] doAs(final Action action, final byte[] in) throws Exception { try { - return Subject.doAs(s, new PrivilegedExceptionAction() { + return Subject.callAs(s, new Callable() { @Override - public byte[] run() throws Exception { + public byte[] call() throws Exception { return action.run(Context.this, in); } }); - } catch (PrivilegedActionException pae) { - throw pae.getException(); + } catch (CompletionException ce) { + throw (Exception) ce.getCause(); } } @@ -612,9 +612,9 @@ public class Context { public Context impersonate(final String someone) throws Exception { try { - GSSCredential creds = Subject.doAs(s, new PrivilegedExceptionAction() { + GSSCredential creds = Subject.callAs(s, new Callable() { @Override - public GSSCredential run() throws Exception { + public GSSCredential call() throws Exception { GSSManager m = GSSManager.getInstance(); GSSName other = m.createName(someone, GSSName.NT_USER_NAME); if (Context.this.cred == null) { @@ -631,8 +631,8 @@ public class Context { out.cred = creds; out.name = name + " as " + out.cred.getName().toString(); return out; - } catch (PrivilegedActionException pae) { - Exception e = pae.getException(); + } catch (CompletionException ce) { + Exception e = (Exception) ce.getCause(); if (e instanceof InvocationTargetException) { throw (Exception)((InvocationTargetException) e).getTargetException(); } else { diff --git a/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java b/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java index fc5d1380a5c..979f87e6a4a 100644 --- a/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java +++ b/test/jdk/sun/security/krb5/auto/HttpNegotiateServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -83,6 +83,8 @@ import org.ietf.jgss.GSSManager; import sun.security.jgss.GSSUtil; import sun.security.krb5.Config; import java.util.Base64; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletionException; /** * Basic JGSS/krb5 test with 3 parties: client, server, backend server. Each @@ -375,9 +377,9 @@ public class HttpNegotiateServer { Subject subject = context.getSubject(); - final PrivilegedExceptionAction test_action - = new PrivilegedExceptionAction() { - public Object run() throws Exception { + final Callable test_action + = new Callable() { + public Object call() throws Exception { testConnect(); return null; } @@ -387,10 +389,10 @@ public class HttpNegotiateServer { "with the the logged in subject."); try { - Subject.doAs(subject, test_action); + Subject.callAs(subject, test_action); System.err.println("\n\nConnection succeed when executing " + "with the the logged in subject."); - } catch (PrivilegedActionException e) { + } catch (CompletionException e) { System.err.println("\n\nFailure unexpected when executing " + "with the the logged in subject."); e.printStackTrace(); @@ -466,9 +468,9 @@ public class HttpNegotiateServer { krb5.login(); krb5.commit(); m = GSSManager.getInstance(); - cred = Subject.doAs(s, new PrivilegedExceptionAction() { + cred = Subject.callAs(s, new Callable() { @Override - public GSSCredential run() throws Exception { + public GSSCredential call() throws Exception { System.err.println("Creating GSSCredential"); return m.createCredential( null, @@ -494,12 +496,7 @@ public class HttpNegotiateServer { if (auth == null) { // First request Headers map = exch.getResponseHeaders(); map.set (reqHdr, scheme); // Challenge! - c = Subject.doAs(s, new PrivilegedExceptionAction() { - @Override - public GSSContext run() throws Exception { - return m.createContext(cred); - } - }); + c = Subject.callAs(s, () -> m.createContext(cred)); exch.getHttpContext().getAttributes().put("GSSContext", c); return new com.sun.net.httpserver.Authenticator.Retry(err); } else { // Later requests diff --git a/test/jdk/sun/security/krb5/auto/LongLife.java b/test/jdk/sun/security/krb5/auto/LongLife.java index 22c39a6d258..319f97bbdb5 100644 --- a/test/jdk/sun/security/krb5/auto/LongLife.java +++ b/test/jdk/sun/security/krb5/auto/LongLife.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -36,7 +36,6 @@ import org.ietf.jgss.GSSManager; import sun.security.krb5.Config; import javax.security.auth.Subject; import javax.security.auth.kerberos.KerberosTicket; -import java.security.PrivilegedExceptionAction; public class LongLife { @@ -72,8 +71,7 @@ public class LongLife { Context c = Context.fromJAAS("client"); - GSSCredential cred = Subject.doAs(c.s(), - (PrivilegedExceptionAction) + GSSCredential cred = Subject.callAs(c.s(), ()-> { GSSManager m = GSSManager.getInstance(); return m.createCredential(GSSCredential.INITIATE_ONLY); -- GitLab From 67c2714ba2c9658e07153a6f50391c896e4caebc Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 10 Nov 2021 19:45:09 +0000 Subject: [PATCH 283/890] 8276889: Improve compatibility discussion in instanceKlass.cpp Reviewed-by: hseigel --- src/hotspot/share/oops/instanceKlass.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 6c83b0bd7da..aabb84d9225 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -728,7 +728,6 @@ oop InstanceKlass::protection_domain() const { return java_lang_Class::protection_domain(java_mirror()); } -// To remove these from requires an incompatible change and CSR review. objArrayOop InstanceKlass::signers() const { // return the signers from the mirror return java_lang_Class::signers(java_mirror()); -- GitLab From 2374abda19213d615a72c83f584ea61d5bbba4a3 Mon Sep 17 00:00:00 2001 From: Alisen Chung Date: Wed, 10 Nov 2021 20:08:13 +0000 Subject: [PATCH 284/890] 8276678: Malformed Javadoc inline tags in JDK source in com/sun/beans/decoder/DocumentHandler.java Reviewed-by: serb, aivanov --- .../share/classes/com/sun/beans/decoder/DocumentHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java b/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java index dd67059287d..2e4fbe5b217 100644 --- a/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java +++ b/src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java @@ -199,8 +199,8 @@ public final class DocumentHandler extends DefaultHandler { * Indicates whether the variable with specified identifier is defined. * * @param id the identifier - * @return @{code true} if the variable is defined; - * @{code false} otherwise + * @return {@code true} if the variable is defined; + * {@code false} otherwise */ public boolean hasVariable(String id) { return this.environment.containsKey(id); -- GitLab From df02daa6f9df801a7e0b6203fd6411d8a62bb277 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Wed, 10 Nov 2021 20:22:41 +0000 Subject: [PATCH 285/890] 8269986: Remove +3 from Symbol::identity_hash() Reviewed-by: coleenp --- src/hotspot/share/oops/symbol.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/oops/symbol.hpp b/src/hotspot/share/oops/symbol.hpp index 8653811ce15..703797a88fb 100644 --- a/src/hotspot/share/oops/symbol.hpp +++ b/src/hotspot/share/oops/symbol.hpp @@ -155,7 +155,7 @@ class Symbol : public MetaspaceObj { // Returns the largest size symbol we can safely hold. static int max_length() { return max_symbol_length; } unsigned identity_hash() const { - unsigned addr_bits = (unsigned)((uintptr_t)this >> (LogBytesPerWord + 3)); + unsigned addr_bits = (unsigned)((uintptr_t)this >> LogBytesPerWord); return ((unsigned)extract_hash(_hash_and_refcount) & 0xffff) | ((addr_bits ^ (length() << 8) ^ (( _body[0] << 8) | _body[1])) << 16); } -- GitLab From 0c409cac789f1b1d21e09a65db36bb6c72c569db Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 10 Nov 2021 20:52:11 +0000 Subject: [PATCH 286/890] 8276186: Require getAvailableLocales() methods to include Locale.ROOT Reviewed-by: prappo, smarks, iris --- .../classes/java/text/BreakIterator.java | 7 +- .../share/classes/java/text/Collator.java | 5 +- .../share/classes/java/text/DateFormat.java | 5 +- .../classes/java/text/DateFormatSymbols.java | 7 +- .../java/text/DecimalFormatSymbols.java | 7 +- .../share/classes/java/text/NumberFormat.java | 7 +- .../java/time/format/DecimalStyle.java | 6 +- .../share/classes/java/util/Calendar.java | 5 +- .../share/classes/java/util/Locale.java | 5 +- .../Locale/RequiredAvailableLocalesTest.java | 76 +++++++++++++++++++ 10 files changed, 108 insertions(+), 22 deletions(-) create mode 100644 test/jdk/java/util/Locale/RequiredAvailableLocalesTest.java diff --git a/src/java.base/share/classes/java/text/BreakIterator.java b/src/java.base/share/classes/java/text/BreakIterator.java index e18039ca4f2..04849eed3d5 100644 --- a/src/java.base/share/classes/java/text/BreakIterator.java +++ b/src/java.base/share/classes/java/text/BreakIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -576,8 +576,9 @@ public abstract class BreakIterator implements Cloneable * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.BreakIteratorProvider BreakIteratorProvider} implementations. - * It must contain at least a {@code Locale} - * instance equal to {@link java.util.Locale#US Locale.US}. + * At a minimum, the returned array must contain a {@code Locale} instance equal to + * {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to + * {@link Locale#US Locale.US}. * * @return An array of locales for which localized * {@code BreakIterator} instances are available. diff --git a/src/java.base/share/classes/java/text/Collator.java b/src/java.base/share/classes/java/text/Collator.java index cc0ad518045..f011dbdccf3 100644 --- a/src/java.base/share/classes/java/text/Collator.java +++ b/src/java.base/share/classes/java/text/Collator.java @@ -421,8 +421,9 @@ public abstract class Collator * The returned array represents the union of locales supported * by the Java runtime and by installed * {@link java.text.spi.CollatorProvider CollatorProvider} implementations. - * It must contain at least a Locale instance equal to - * {@link java.util.Locale#US Locale.US}. + * At a minimum, the returned array must contain a {@code Locale} instance equal to + * {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to + * {@link Locale#US Locale.US}. * * @return An array of locales for which localized * {@code Collator} instances are available. diff --git a/src/java.base/share/classes/java/text/DateFormat.java b/src/java.base/share/classes/java/text/DateFormat.java index bf40a911cd4..2750e266729 100644 --- a/src/java.base/share/classes/java/text/DateFormat.java +++ b/src/java.base/share/classes/java/text/DateFormat.java @@ -636,8 +636,9 @@ public abstract class DateFormat extends Format { * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.DateFormatProvider DateFormatProvider} implementations. - * It must contain at least a {@code Locale} instance equal to - * {@link java.util.Locale#US Locale.US}. + * At a minimum, the returned array must contain a {@code Locale} instance equal to + * {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to + * {@link Locale#US Locale.US}. * * @return An array of locales for which localized * {@code DateFormat} instances are available. diff --git a/src/java.base/share/classes/java/text/DateFormatSymbols.java b/src/java.base/share/classes/java/text/DateFormatSymbols.java index e7919e33e69..a76c7cb44f4 100644 --- a/src/java.base/share/classes/java/text/DateFormatSymbols.java +++ b/src/java.base/share/classes/java/text/DateFormatSymbols.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -299,8 +299,9 @@ public class DateFormatSymbols implements Serializable, Cloneable { * The returned array represents the union of locales supported by the * Java runtime and by installed * {@link java.text.spi.DateFormatSymbolsProvider DateFormatSymbolsProvider} - * implementations. It must contain at least a {@code Locale} - * instance equal to {@link java.util.Locale#US Locale.US}. + * implementations. At a minimum, the returned array must contain a + * {@code Locale} instance equal to {@link Locale#ROOT Locale.ROOT} and + * a {@code Locale} instance equal to {@link Locale#US Locale.US}. * * @return An array of locales for which localized * {@code DateFormatSymbols} instances are available. diff --git a/src/java.base/share/classes/java/text/DecimalFormatSymbols.java b/src/java.base/share/classes/java/text/DecimalFormatSymbols.java index 6741fd52667..11fd24573ef 100644 --- a/src/java.base/share/classes/java/text/DecimalFormatSymbols.java +++ b/src/java.base/share/classes/java/text/DecimalFormatSymbols.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -122,8 +122,9 @@ public class DecimalFormatSymbols implements Cloneable, Serializable { * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.DecimalFormatSymbolsProvider DecimalFormatSymbolsProvider} - * implementations. It must contain at least a {@code Locale} - * instance equal to {@link java.util.Locale#US Locale.US}. + * implementations. At a minimum, the returned array must contain a + * {@code Locale} instance equal to {@link Locale#ROOT Locale.ROOT} and + * a {@code Locale} instance equal to {@link Locale#US Locale.US}. * * @return an array of locales for which localized * {@code DecimalFormatSymbols} instances are available. diff --git a/src/java.base/share/classes/java/text/NumberFormat.java b/src/java.base/share/classes/java/text/NumberFormat.java index f7c40284611..18c078f1a4e 100644 --- a/src/java.base/share/classes/java/text/NumberFormat.java +++ b/src/java.base/share/classes/java/text/NumberFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -682,8 +682,9 @@ public abstract class NumberFormat extends Format { * The returned array represents the union of locales supported by the Java * runtime and by installed * {@link java.text.spi.NumberFormatProvider NumberFormatProvider} implementations. - * It must contain at least a {@code Locale} instance equal to - * {@link java.util.Locale#US Locale.US}. + * At a minimum, the returned array must contain a {@code Locale} instance equal to + * {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to + * {@link Locale#US Locale.US}. * * @return An array of locales for which localized * {@code NumberFormat} instances are available. diff --git a/src/java.base/share/classes/java/time/format/DecimalStyle.java b/src/java.base/share/classes/java/time/format/DecimalStyle.java index 590904fb66e..384da33243b 100644 --- a/src/java.base/share/classes/java/time/format/DecimalStyle.java +++ b/src/java.base/share/classes/java/time/format/DecimalStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -115,7 +115,9 @@ public final class DecimalStyle { /** * Lists all the locales that are supported. *

          - * The locale 'en_US' will always be present. + * At a minimum, the returned {@code Set} must contain a {@code Locale} instance equal to + * {@link Locale#ROOT Locale.ROOT} and a {@code Locale} instance equal to + * {@link Locale#US Locale.US}. * * @return a Set of Locales for which localization is supported */ diff --git a/src/java.base/share/classes/java/util/Calendar.java b/src/java.base/share/classes/java/util/Calendar.java index 140634ec419..08954ac0104 100644 --- a/src/java.base/share/classes/java/util/Calendar.java +++ b/src/java.base/share/classes/java/util/Calendar.java @@ -1730,8 +1730,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable REQUIRED_LOCALES = Set.of(Locale.ROOT, Locale.US); + private static final MethodType ARRAY_RETURN_TYPE = MethodType.methodType(Locale.class.arrayType()); + private static final MethodType SET_RETURN_TYPE = MethodType.methodType(Set.class); + + @DataProvider + public Object[][] availableLocalesClasses() { + return new Object[][] { + {BreakIterator.class, ARRAY_RETURN_TYPE}, + {Calendar.class, ARRAY_RETURN_TYPE}, + {Collator.class, ARRAY_RETURN_TYPE}, + {DateFormat.class, ARRAY_RETURN_TYPE}, + {DateFormatSymbols.class, ARRAY_RETURN_TYPE}, + {DecimalFormatSymbols.class, ARRAY_RETURN_TYPE}, + {DecimalStyle.class, SET_RETURN_TYPE}, + {Locale.class, ARRAY_RETURN_TYPE}, + {NumberFormat.class, ARRAY_RETURN_TYPE}, + }; + } + + @Test (dataProvider = "availableLocalesClasses") + public void checkRequiredLocales(Class c, MethodType mt) throws Throwable { + var ret = MethodHandles.lookup().findStatic(c, "getAvailableLocales", mt).invoke(); + + if (ret instanceof Locale[] a) { + assertTrue(Arrays.asList(a).containsAll(REQUIRED_LOCALES)); + } else if (ret instanceof Set s) { + assertTrue(s.containsAll(REQUIRED_LOCALES)); + } else { + throw new RuntimeException("return type mismatch"); + } + } +} -- GitLab From bce35ac1d6c4115148468a3240ad459074e0b79e Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 10 Nov 2021 20:53:23 +0000 Subject: [PATCH 287/890] 8276775: ZonedDateTime/OffsetDateTime.toString return invalid ISO-8601 for years <= 1893 Reviewed-by: lancea, iris, bpb, scolebourne, rriggs --- src/java.base/share/classes/java/time/OffsetDateTime.java | 7 ++++--- src/java.base/share/classes/java/time/ZonedDateTime.java | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/java/time/OffsetDateTime.java b/src/java.base/share/classes/java/time/OffsetDateTime.java index 6587ba33d13..79131fc6990 100644 --- a/src/java.base/share/classes/java/time/OffsetDateTime.java +++ b/src/java.base/share/classes/java/time/OffsetDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -1897,7 +1897,7 @@ public final class OffsetDateTime /** * Outputs this date-time as a {@code String}, such as {@code 2007-12-03T10:15:30+01:00}. *

          - * The output will be one of the following ISO-8601 formats: + * The output will be one of the following formats: *

            *
          • {@code uuuu-MM-dd'T'HH:mmXXXXX}
          • *
          • {@code uuuu-MM-dd'T'HH:mm:ssXXXXX}
          • @@ -1906,7 +1906,8 @@ public final class OffsetDateTime *
          • {@code uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSXXXXX}
          • *
          * The format used will be the shortest that outputs the full value of - * the time where the omitted parts are implied to be zero. + * the time where the omitted parts are implied to be zero. The output + * is compatible with ISO 8601 if the seconds in the offset are zero. * * @return a string representation of this date-time, not null */ diff --git a/src/java.base/share/classes/java/time/ZonedDateTime.java b/src/java.base/share/classes/java/time/ZonedDateTime.java index e7bf2e32b0d..acd68706b1c 100644 --- a/src/java.base/share/classes/java/time/ZonedDateTime.java +++ b/src/java.base/share/classes/java/time/ZonedDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -2207,7 +2207,8 @@ public final class ZonedDateTime *

          * The format consists of the {@code LocalDateTime} followed by the {@code ZoneOffset}. * If the {@code ZoneId} is not the same as the offset, then the ID is output. - * The output is compatible with ISO-8601 if the offset and ID are the same. + * The output is compatible with ISO-8601 if the offset and ID are the same, + * and the seconds in the offset are zero. * * @return a string representation of this date-time, not null */ -- GitLab From 73e6d7d74d2ddd27f11775944c6fc4fb5268106d Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Thu, 11 Nov 2021 00:14:52 +0000 Subject: [PATCH 288/890] 8276801: gc/stress/CriticalNativeStress.java fails intermittently with Shenandoah Reviewed-by: shade --- src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp | 4 ++-- src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp index 197eeec5856..4d97c7c0e7e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp @@ -111,7 +111,7 @@ void ShenandoahCodeRoots::initialize() { } void ShenandoahCodeRoots::register_nmethod(nmethod* nm) { - assert_locked_or_safepoint(CodeCache_lock); + assert(CodeCache_lock->owned_by_self(), "Must have CodeCache_lock held"); _nmethod_table->register_nmethod(nm); } @@ -121,7 +121,7 @@ void ShenandoahCodeRoots::unregister_nmethod(nmethod* nm) { } void ShenandoahCodeRoots::flush_nmethod(nmethod* nm) { - assert_locked_or_safepoint(CodeCache_lock); + assert(CodeCache_lock->owned_by_self(), "Must have CodeCache_lock held"); _nmethod_table->flush_nmethod(nm); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp index 755e29ce57e..e0f5b9ee71b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahNMethod.cpp @@ -271,13 +271,17 @@ void ShenandoahNMethodTable::register_nmethod(nmethod* nm) { assert(_index >= 0 && _index <= _list->size(), "Sanity"); ShenandoahNMethod* data = ShenandoahNMethod::gc_data(nm); - ShenandoahReentrantLocker data_locker(data != NULL ? data->lock() : NULL); if (data != NULL) { assert(contain(nm), "Must have been registered"); assert(nm == data->nm(), "Must be same nmethod"); + // Prevent updating a nmethod while concurrent iteration is in progress. + wait_until_concurrent_iteration_done(); + ShenandoahReentrantLocker data_locker(data->lock()); data->update(); } else { + // For a new nmethod, we can safely append it to the list, because + // concurrent iteration will not touch it. data = ShenandoahNMethod::for_nmethod(nm); assert(data != NULL, "Sanity"); ShenandoahNMethod::attach_gc_data(nm, data); @@ -382,11 +386,13 @@ void ShenandoahNMethodTable::rebuild(int size) { } ShenandoahNMethodTableSnapshot* ShenandoahNMethodTable::snapshot_for_iteration() { + assert(CodeCache_lock->owned_by_self(), "Must have CodeCache_lock held"); _itr_cnt++; return new ShenandoahNMethodTableSnapshot(this); } void ShenandoahNMethodTable::finish_iteration(ShenandoahNMethodTableSnapshot* snapshot) { + assert(CodeCache_lock->owned_by_self(), "Must have CodeCache_lock held"); assert(iteration_in_progress(), "Why we here?"); assert(snapshot != NULL, "No snapshot"); _itr_cnt--; -- GitLab From e27a67a91647e584411a9ef57c0a028ab37af19b Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 11 Nov 2021 01:14:30 +0000 Subject: [PATCH 289/890] 8276930: Update ProblemList Reviewed-by: kevinw, dholmes --- test/jdk/ProblemList.txt | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index c726cf5eecc..13c38f897ac 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -121,7 +121,7 @@ java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 gen java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 6848407 generic-all java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java 8239801 macosx-all java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all -java/awt/Frame/FrameLocation/FrameLocation.java 8233703 linux-all +java/awt/Frame/FrameLocation/FrameLocation.java 8238436 linux-all java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all @@ -188,7 +188,7 @@ java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all java/awt/Toolkit/RealSync/Test.java 6849383 linux-all java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all -java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8203047 macosx-all +java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8072110 macosx-all java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java 8073636 macosx-all java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055,8266245 windows-all,linux-all,macosx-aarch64 java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all @@ -203,7 +203,7 @@ java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTes java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all -java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java 8000171 windows-all +java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java 8196100 windows-all java/awt/Scrollbar/ScrollbarMouseWheelTest/ScrollbarMouseWheelTest.java 8196018 windows-all,linux-all java/awt/TrayIcon/ActionCommand/ActionCommand.java 8150540 windows-all java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8150540 windows-all @@ -250,11 +250,11 @@ sun/java2d/SunGraphics2D/SimplePrimQuality.java 6992007 generic-all sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java 8196185 generic-all sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.sh 8221451 linux-all -java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469,8273618 windows-all,macosx-aarch64 +java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469,8273617 windows-all,macosx-aarch64 java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java 8273617 macosx-all java/awt/print/PrinterJob/PSQuestionMark.java 7003378 generic-all java/awt/print/PrinterJob/GlyphPositions.java 7003378 generic-all -java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,linux-all +java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 6849371 macosx-all,linux-all java/awt/Component/GetScreenLocTest/GetScreenLocTest.java 4753654 generic-all java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java 8165863 macosx-all java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 8017454 macosx-all @@ -550,11 +550,6 @@ java/lang/invoke/RicochetTest.java 8251969 generic- java/lang/instrument/RedefineBigClass.sh 8065756 generic-all java/lang/instrument/RetransformBigClass.sh 8065756 generic-all -java/lang/management/MemoryMXBean/Pending.java 8158837 generic-all -java/lang/management/MemoryMXBean/PendingAllGC.sh 8158837 generic-all - -javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-all - ############################################################################ # jdk_io @@ -569,6 +564,8 @@ java/io/File/createTempFile/SpecialTempFile.java 8274122 windows1 com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java 8030957 aix-all +java/lang/management/MemoryMXBean/Pending.java 8158837 generic-all +java/lang/management/MemoryMXBean/PendingAllGC.sh 8158837 generic-all java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java 8247426 generic-all sun/management/jdp/JdpDefaultsTest.java 8241865 linux-aarch64,macosx-all @@ -581,6 +578,8 @@ sun/management/jdp/JdpSpecificAddressTest.java 8241865 macosx-a javax/management/MBeanServer/OldMBeanServerTest.java 8030957 aix-all +javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-all + javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java 8042215 generic-all javax/management/remote/mandatory/connection/RMIConnector_NPETest.java 8267887 generic-all @@ -787,7 +786,7 @@ sun/util/locale/provider/CalendarDataRegression.java 8268379 macosx-x # svc_tools -sun/tools/jhsdb/BasicLauncherTest.java 8211767 linux-ppc64,linux-ppc64le +sun/tools/jhsdb/BasicLauncherTest.java 8228649 linux-ppc64,linux-ppc64le sun/tools/jstatd/TestJstatdDefaults.java 8081569,8226420 windows-all sun/tools/jstatd/TestJstatdRmiPort.java 8226420,8251259 windows-all @@ -810,8 +809,8 @@ javax/script/Test7.java 8239361 generic- # jdk_jfr -jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 8228990,8229370 generic-all -jdk/jfr/event/compiler/TestCodeSweeper.java 8225209 generic-all +jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 8228990 generic-all +jdk/jfr/event/compiler/TestCodeSweeper.java 8225209 generic-all jdk/jfr/event/os/TestThreadContextSwitches.java 8247776 windows-all jdk/jfr/startupargs/TestStartName.java 8214685 windows-x64 jdk/jfr/startupargs/TestStartDuration.java 8214685 windows-x64 -- GitLab From ad3be04d2ac84836e393d696ff03ddfe72779094 Mon Sep 17 00:00:00 2001 From: Yoshiki Sato Date: Thu, 11 Nov 2021 01:39:06 +0000 Subject: [PATCH 290/890] 8276536: Update TimeZoneNames files to follow the changes made by JDK-8275766 Reviewed-by: naoto, coffeys --- .../classes/sun/util/resources/TimeZoneNames.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_de.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_es.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_fr.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_it.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_ja.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_ko.java | 14 ++++++++------ .../util/resources/ext/TimeZoneNames_pt_BR.java | 14 ++++++++------ .../sun/util/resources/ext/TimeZoneNames_sv.java | 14 ++++++++------ .../util/resources/ext/TimeZoneNames_zh_CN.java | 14 ++++++++------ .../util/resources/ext/TimeZoneNames_zh_TW.java | 14 ++++++++------ 11 files changed, 88 insertions(+), 66 deletions(-) diff --git a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java index ca635af8d17..8759aab3995 100644 --- a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java +++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -353,7 +353,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -380,7 +380,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -569,9 +571,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville Time", "DDUT", "Dumont-d'Urville Summer Time", "DDUST", "Dumont-d'Urville Time", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Macquarie Island Standard Time", "MIST", - "Macquarie Island Daylight Time", "MIDT", - "Macquarie Island Time", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Mawson Time", "MAWT", "Mawson Summer Time", "MAWST", "Mawson Time", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java index afce65470ed..f007c1a8d3b 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville Zeit", "DDUT", "Dumont-d'Urville Sommerzeit", "DDUST", "Dumont-d'Urville Zeit", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Macquarieinsel Zeit", "MIST", - "Macquarieinsel Sommerzeit", "MIST", - "Macquarieinsel Zeit", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Mawson Zeit", "MAWT", "Mawson Sommerzeit", "MAWST", "Mawson Zeit", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java index 3fc715a3c3a..386414e16e6 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Hora de Dumont-d'Urville", "DDUT", "Hora de verano de Dumont-d'Urville", "DDUST", "Hora de Dumont-d'Urville", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Hora de Isla Macquarie", "MIST", - "Hora de verano de Isla Macquarie", "MIST", - "Hora de Isla Macquarie", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Hora de Mawson", "MAWT", "Hora de verano de Mawson", "MAWST", "Hora de Mawson", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java index cd1af3aa407..d23f5fd49e6 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Heure de Dumont-d'Urville", "DDUT", "Heure d'\u00e9t\u00e9 de Dumont-d'Urville", "DDUST", "Heure de Dumont-d'Urville", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Heure de l'Ile Macquarie", "MIST", - "Heure d'\u00E9t\u00E9 de l'Ile Macquarie", "MIST", - "Heure de l'Ile Macquarie", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Heure de Mawson", "MAWT", "Heure d'\u00e9t\u00e9 de Mawson", "MAWST", "Heure de Mawson", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java index 9b9dea971d0..b4f57d4568c 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Ora di Dumont-d'Urville", "DDUT", "Ora estiva di Dumont-d'Urville", "DDUST", "Ora di Dumont-d'Urville", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Ora dell'Isola Macquarie", "MIST", - "Ora estiva dell'Isola Macquarie", "MIST", - "Ora dell'Isola Macquarie", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Ora di Mawson", "MAWT", "Ora estiva di Mawson", "MAWST", "Ora di Mawson", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java index 20ac642d83b..1a10a9f96dc 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"\u30c7\u30e5\u30e2\u30f3\u30c7\u30e5\u30eb\u30f4\u30a3\u30eb\u6642\u9593", "DDUT", "\u30c7\u30e5\u30e2\u30f3\u30c7\u30e5\u30eb\u30f4\u30a3\u30eb\u590f\u6642\u9593", "DDUST", "\u30C7\u30E5\u30E2\u30F3\u30FB\u30C7\u30E5\u30EB\u30D3\u30EB\u6642\u9593", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u6642\u9593", "MIST", - "\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u590F\u6642\u9593", "MIST", - "\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u6642\u9593", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"\u30e2\u30fc\u30bd\u30f3\u6642\u9593", "MAWT", "\u30e2\u30fc\u30bd\u30f3\u590f\u6642\u9593", "MAWST", "\u30E2\u30FC\u30BD\u30F3\u6642\u9593", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java index 849d155b4a3..9a2d9e5c57c 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"\ub4a4\ubabd \ub4a4\ub974\ube4c \uc2dc\uac04", "DDUT", "\ub4a4\ubabd \ub4a4\ub974\ube4c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "DDUST", "\uB450\uBAAC\uD2B8\uC6B0\uB974\uBE4C \uD45C\uC900\uC2DC", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"\uB9E4\uCF70\uB9AC \uC12C \uD45C\uC900\uC2DC", "MIST", - "\uB9E4\uCF70\uB9AC \uC12C \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "MIST", - "\uB9E4\uCF70\uB9AC \uC12C \uD45C\uC900\uC2DC", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"\ubaa8\uc2a8 \uc2dc\uac04", "MAWT", "\ubaa8\uc2a8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MAWST", "\uB9C8\uC2A8 \uD45C\uC900\uC2DC", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java index e5d7bc0beeb..de5e5c82daa 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Fuso hor\u00e1rio de Dumont-d'Urville", "DDUT", "Fuso hor\u00e1rio de ver\u00e3o de Dumont-d'Urville", "DDUST", "Fuso Hor\u00E1rio de Dumont-d'Urville", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Fuso Hor\u00E1rio da Ilha de Macquarie", "MIST", - "Fuso Hor\u00E1rio de Ver\u00E3o da Ilha de Macquarie", "MIST", - "Fuso Hor\u00E1rio da Ilha de Macquarie", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Fuso hor\u00e1rio de Mawson", "MAWT", "Fuso hor\u00e1rio de ver\u00e3o de Mawson", "MAWST", "Hor\u00E1rio de Mawson", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java index 4cedccb1b38..b53de4d8c89 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville, normaltid", "DDUT", "Dumont-d'Urville, sommartid", "DDUST", "Dumont-d'Urville-tid", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"Macquarie\u00F6n, normaltid", "MIST", - "Macquarie\u00F6n, sommartid", "MIST", - "Macquarie\u00F6n, normaltid", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"Mawson, normaltid", "MAWT", "Mawson, sommartid", "MAWST", "Mawson-tid", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java index 464dd677b4b..7797cda19d5 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville \u65f6\u95f4", "DDUT", "Dumont-d'Urville \u590f\u4ee4\u65f6", "DDUST", "Dumont-d'Urville \u65F6\u95F4", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"\u9EA6\u5938\u91CC\u5C9B\u65F6\u95F4", "MIST", - "\u9EA6\u5938\u91CC\u5C9B\u590F\u4EE4\u65F6", "MIST", - "\u9EA6\u5938\u91CC\u5C9B\u65F6\u95F4", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"\u83ab\u68ee\u65f6\u95f4", "MAWT", "\u83ab\u68ee\u590f\u4ee4\u65f6", "MAWST", "\u83AB\u68EE\u65F6\u95F4", "MAWT"}}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java index 9dafdf5254e..2cd10554853 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -351,7 +351,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Africa/Gaborone", CAT}, {"Africa/Harare", CAT}, {"Africa/Johannesburg", SAST}, - {"Africa/Juba", EAT}, + {"Africa/Juba", CAT}, {"Africa/Kampala", EAT}, {"Africa/Khartoum", CAT}, {"Africa/Kigali", CAT}, @@ -378,7 +378,9 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Africa/Timbuktu", GMT}, {"Africa/Tripoli", EET}, {"Africa/Tunis", CET}, - {"Africa/Windhoek", CAT}, + {"Africa/Windhoek", new String[] {"Central African Time", "CAT", + "Western African Time", "WAT", + "Central African Time", "CAT"}}, {"America/Adak", HST}, {"America/Anguilla", AST}, {"America/Antigua", AST}, @@ -564,9 +566,9 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville \u6642\u9593", "DDUT", "Dumont-d'Urville \u590f\u4ee4\u6642\u9593", "DDUST", "Dumont-d'Urville \u6642\u9593", "DDUT"}}, - {"Antarctica/Macquarie", new String[] {"\u9EA5\u5938\u5229\u5CF6\u6642\u9593", "MIST", - "\u9EA5\u5938\u5229\u5CF6\u590F\u4EE4\u6642\u9593", "MIST", - "\u9EA5\u5938\u5229\u5CF6\u6642\u9593", "MIST"}}, + {"Antarctica/Macquarie", new String[] {"Australian Eastern Standard Time (Macquarie)", "AEST", + "Australian Eastern Daylight Time (Macquarie)", "AEDT", + "Australian Eastern Time (Macquarie)", "AET"}}, {"Antarctica/Mawson", new String[] {"\u83ab\u68ee\u6642\u9593", "MAWT", "\u83ab\u68ee\u590f\u4ee4\u6642\u9593", "MAWST", "\u83AB\u68EE\u6642\u9593", "MAWT"}}, -- GitLab From 08e0fd6757ef15b71df0e86afd01211a6e48bd09 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Thu, 11 Nov 2021 05:52:58 +0000 Subject: [PATCH 291/890] 8276835: G1: make G1EvacFailureObjectsSet::record inline Reviewed-by: tschatzl, ayang --- .../share/gc/g1/g1EvacFailureObjectsSet.cpp | 8 ---- .../share/gc/g1/g1EvacFailureObjectsSet.hpp | 2 +- .../gc/g1/g1EvacFailureObjectsSet.inline.hpp | 40 +++++++++++++++++++ src/hotspot/share/gc/g1/heapRegion.inline.hpp | 1 + 4 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.inline.hpp diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp index d90b8a00540..deabc897ed8 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp @@ -26,7 +26,6 @@ #include "gc/g1/g1EvacFailureObjectsSet.hpp" #include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1SegmentedArray.inline.hpp" -#include "gc/g1/heapRegion.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "utilities/quickSort.hpp" @@ -62,13 +61,6 @@ G1EvacFailureObjectsSet::G1EvacFailureObjectsSet(uint region_idx, HeapWord* bott assert(HeapRegion::LogOfHRGrainBytes < 32, "must be"); } -void G1EvacFailureObjectsSet::record(oop obj) { - assert(obj != NULL, "must be"); - assert(_region_idx == G1CollectedHeap::heap()->heap_region_containing(obj)->hrm_index(), "must be"); - OffsetInRegion* e = _offsets.allocate(); - *e = to_offset(obj); -} - // Helper class to join, sort and iterate over the previously collected segmented // array of objects that failed evacuation. class G1EvacFailureObjectsIterationHelper { diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp index c9b0f75d529..a34e46dc96c 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp @@ -70,7 +70,7 @@ public: G1EvacFailureObjectsSet(uint region_idx, HeapWord* bottom); // Record an object that failed evacuation. - void record(oop obj); + inline void record(oop obj); // Apply the given ObjectClosure to all objects that failed evacuation and // empties the list after processing. diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.inline.hpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.inline.hpp new file mode 100644 index 00000000000..86ed1adada2 --- /dev/null +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.inline.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021, Huawei 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_GC_G1_G1EVACFAILUREOBJECTSSET_INLINE_HPP +#define SHARE_GC_G1_G1EVACFAILUREOBJECTSSET_INLINE_HPP + +#include "gc/g1/g1EvacFailureObjectsSet.hpp" +#include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1SegmentedArray.inline.hpp" +#include "gc/g1/heapRegion.inline.hpp" + +void G1EvacFailureObjectsSet::record(oop obj) { + assert(obj != NULL, "must be"); + assert(_region_idx == G1CollectedHeap::heap()->heap_region_containing(obj)->hrm_index(), "must be"); + OffsetInRegion* e = _offsets.allocate(); + *e = to_offset(obj); +} + +#endif //SHARE_GC_G1_G1EVACFAILUREOBJECTSSET_INLINE_HPP diff --git a/src/hotspot/share/gc/g1/heapRegion.inline.hpp b/src/hotspot/share/gc/g1/heapRegion.inline.hpp index 122c8214c65..3d07d61fe24 100644 --- a/src/hotspot/share/gc/g1/heapRegion.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.inline.hpp @@ -30,6 +30,7 @@ #include "gc/g1/g1BlockOffsetTable.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp" +#include "gc/g1/g1EvacFailureObjectsSet.inline.hpp" #include "gc/g1/g1Predictions.hpp" #include "gc/g1/g1SegmentedArray.inline.hpp" #include "oops/oop.inline.hpp" -- GitLab From 91bb0d658bce010e74b248b56f0fa5b8a79e8802 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 11 Nov 2021 07:07:58 +0000 Subject: [PATCH 292/890] 8276796: gc/TestSystemGC.java large pages subtest fails with ZGC Reviewed-by: pliden, stefank --- test/hotspot/jtreg/gc/TestSystemGC.java | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/test/hotspot/jtreg/gc/TestSystemGC.java b/test/hotspot/jtreg/gc/TestSystemGC.java index 9aff5a3b181..9cef6bbdb01 100644 --- a/test/hotspot/jtreg/gc/TestSystemGC.java +++ b/test/hotspot/jtreg/gc/TestSystemGC.java @@ -24,39 +24,46 @@ package gc; /* - * @test TestSystemGCSerial + * @test id=Serial * @requires vm.gc.Serial * @summary Runs System.gc() with different flags. * @run main/othervm -XX:+UseSerialGC gc.TestSystemGC + * @run main/othervm -XX:+UseSerialGC -XX:+UseLargePages gc.TestSystemGC */ /* - * @test TestSystemGCParallel + * @test id=Parallel * @requires vm.gc.Parallel * @summary Runs System.gc() with different flags. * @run main/othervm -XX:+UseParallelGC gc.TestSystemGC + * @run main/othervm -XX:+UseParallelGC -XX:+UseLargePages gc.TestSystemGC */ /* - * @test TestSystemGCG1 + * @test id=G1 * @requires vm.gc.G1 * @summary Runs System.gc() with different flags. * @run main/othervm -XX:+UseG1GC gc.TestSystemGC * @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC + * @run main/othervm -XX:+UseG1GC -XX:+UseLargePages gc.TestSystemGC */ /* - * @test TestSystemGCShenandoah + * @test id=Shenandoah * @requires vm.gc.Shenandoah * @summary Runs System.gc() with different flags. - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.TestSystemGC - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC + * @run main/othervm -XX:+UseShenandoahGC gc.TestSystemGC + * @run main/othervm -XX:+UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC + * @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages gc.TestSystemGC */ /* - * @test TestSystemGCLargePages + * @test id=Z + * @requires vm.gc.Z + * @comment ZGC will not start when LargePages cannot be allocated, therefore + * we do not run such configuration. * @summary Runs System.gc() with different flags. - * @run main/othervm -XX:+UseLargePages gc.TestSystemGC + * @run main/othervm -XX:+UseZGC gc.TestSystemGC */ public class TestSystemGC { -- GitLab From 7a140af25362556ebe86147dcd74413e0044edc0 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Thu, 11 Nov 2021 08:03:01 +0000 Subject: [PATCH 293/890] 8276546: [IR Framework] Whitelist and ignore CompileThreshold Reviewed-by: kvn, neliasso --- .../lib/ir_framework/TestFramework.java | 1 + .../ir_framework/driver/TestVMProcess.java | 8 +- .../tests/TestCompileThreshold.java | 103 ++++++++++++++++++ 3 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompileThreshold.java diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java b/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java index 2b40ba73a52..e669c674b78 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java @@ -122,6 +122,7 @@ public class TestFramework { "BackgroundCompilation", "Xbatch", "TieredCompilation", + "CompileThreshold", "Xmixed", "server", "Xlog", diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java index 168dc54707c..0bec4c0e5da 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/driver/TestVMProcess.java @@ -37,6 +37,7 @@ import jdk.test.lib.process.ProcessTools; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; /** * This class prepares, creates, and runs the "test" VM with verification of proper termination. The class also stores @@ -97,9 +98,10 @@ public class TestVMProcess { cmds.add("-Xbootclasspath/a:."); cmds.add("-XX:+UnlockDiagnosticVMOptions"); cmds.add("-XX:+WhiteBoxAPI"); - String[] jtregVMFlags = Utils.getTestJavaOpts(); + // Ignore CompileCommand flags which have an impact on the profiling information. + List jtregVMFlags = Arrays.stream(Utils.getTestJavaOpts()).filter(s -> !s.contains("CompileThreshold")).collect(Collectors.toList()); if (!PREFER_COMMAND_LINE_FLAGS) { - cmds.addAll(Arrays.asList(jtregVMFlags)); + cmds.addAll(jtregVMFlags); } // Add server property flag that enables test VM to print encoding for IR verification last and debug messages. cmds.add(socket.getPortPropertyFlag()); @@ -111,7 +113,7 @@ public class TestVMProcess { if (PREFER_COMMAND_LINE_FLAGS) { // Prefer flags set via the command line over the ones set by scenarios. - cmds.addAll(Arrays.asList(jtregVMFlags)); + cmds.addAll(jtregVMFlags); } if (WARMUP_ITERATIONS < 0 && defaultWarmup != -1) { diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompileThreshold.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompileThreshold.java new file mode 100644 index 00000000000..76090b94efc --- /dev/null +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestCompileThreshold.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2021, 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 ir_framework.tests; + +import compiler.lib.ir_framework.*; +import compiler.lib.ir_framework.driver.IRViolationException; +import jdk.test.lib.Asserts; + +/* + * @test + * @bug 8276546 + * @requires vm.debug == true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.compiler1.enabled & vm.compiler2.enabled & vm.flagless + * @summary Test that CompileThreshold flag is ignored when passed as Java/VM option to the framework. + * Normally, the framework should be called with driver. + * @library /test/lib /testlibrary_tests / + * @run main/othervm -XX:CompileThreshold=12 -XX:+UseG1GC ir_framework.tests.TestCompileThreshold + */ + +public class TestCompileThreshold { + public int iFld = 0; + + public static void main(String[] args) throws Exception { + try { + // CompileThreshold=12 passed to the JTreg test is ignored even though we prefer command line flags. + // CompileThreshold=10 is user defined and passed directly to the framework and thus not ignored. + // InterpreterProfilePercentage=0 ensures that we compile exactly after 10 invocations. + TestFramework.runWithFlags("-XX:CompileThreshold=10", "-XX:InterpreterProfilePercentage=0", + "-XX:-TieredCompilation", "-DTest=testWithCompileThreshold", + "-DPreferCommandLineFlags=true"); + } catch (IRViolationException e) { + Asserts.assertTrue(e.getExceptionInfo().contains("Failed IR Rules (1)"), "exactly one rule failed"); + Asserts.assertTrue(e.getExceptionInfo().contains("testWithCompileThreshold()"), + "testWithCompileThreshold() failed"); + } + + try { + TestFramework.runWithFlags("-XX:InterpreterProfilePercentage=0", "-XX:-TieredCompilation", + "-DTest=testWithoutCompileThreshold"); + } catch (IRViolationException e) { + Asserts.assertTrue(e.getExceptionInfo().contains("Failed IR Rules (1)"), "exactly one rule failed"); + Asserts.assertTrue(e.getExceptionInfo().contains("testWithoutCompileThreshold()"), + "testWithoutCompileThreshold() failed"); + } + } + + @Test + @IR(counts = {IRNode.CALL, "1"}) // fails + public void testWithCompileThreshold() { + iFld++; + } + + @Run(test = "testWithCompileThreshold") + @Warmup(20) + public void runTestWithCompileThreshold(RunInfo info) { + if (iFld == 10) { + TestFramework.assertNotCompiled(info.getTest()); + } else if (iFld == 11) { + // CompileThreshold=10 is passed directly as a flag to the framework. + // Therefore, testWithCompileThreshold() must be compiled by now. + TestFramework.assertCompiled(info.getTest()); + } + testWithCompileThreshold(); + } + + + @Test + @IR(counts = {IRNode.CALL, "1"}) // fails + public void testWithoutCompileThreshold() { + iFld++; + } + + @Run(test = "testWithoutCompileThreshold") + @Warmup(20) + public void runTestWithoutCompileThreshold(RunInfo info) { + testWithCompileThreshold(); + if (info.isWarmUp()) { + // CompileThreshold=12 is passed to the JTreg test but not directly to the framework. + // Therefore, it is ignored and we do not trigger a compilation until the framework does. + TestFramework.assertNotCompiled(info.getTest()); + } + } +} -- GitLab From 9862cd07c162fcc9cd5cbdd0aab564f446f9256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 11 Nov 2021 09:13:49 +0000 Subject: [PATCH 294/890] 8275786: New javadoc option to add script files to generated documentation Reviewed-by: jjg --- .../formats/html/HtmlConfiguration.java | 7 ++++ .../doclets/formats/html/HtmlDoclet.java | 27 ++++++++------ .../formats/html/HtmlDocletWriter.java | 1 + .../doclets/formats/html/HtmlOptions.java | 31 +++++++++++++++- .../doclets/formats/html/markup/Head.java | 32 ++++++++++++---- .../html/resources/standard.properties | 6 ++- .../doclets/toolkit/util/DocPaths.java | 10 ++--- .../doclet/testHelpOption/TestHelpOption.java | 1 + .../doclet/testOptions/TestOptions.java | 37 ++++++++++++++++++- .../doclet/testOptions/additional-script-1.js | 3 ++ .../doclet/testOptions/additional-script-2.js | 3 ++ .../jdk/javadoc/tool/CheckManPageOptions.java | 1 + 12 files changed, 130 insertions(+), 29 deletions(-) create mode 100644 test/langtools/jdk/javadoc/doclet/testOptions/additional-script-1.js create mode 100644 test/langtools/jdk/javadoc/doclet/testOptions/additional-script-2.js diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java index 9d26192d5a4..100ad33940b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java @@ -379,6 +379,13 @@ public class HtmlConfiguration extends BaseConfiguration { .collect(Collectors.toCollection(ArrayList::new)); } + public List getAdditionalScripts() { + return options.additionalScripts().stream() + .map(sf -> DocFile.createFileForInput(this, sf)) + .map(file -> DocPath.create(file.getName())) + .collect(Collectors.toCollection(ArrayList::new)); + } + @Override public JavaFileManager getFileManager() { return docEnv.getJavaFileManager(); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java index 2e5d966cff1..b33c3900544 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java @@ -26,8 +26,6 @@ package jdk.javadoc.internal.doclets.formats.html; import java.io.IOException; -import java.io.OutputStream; -import java.io.Writer; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.InvalidPathException; @@ -215,7 +213,7 @@ public class HtmlDoclet extends AbstractDoclet { super.generateOtherFiles(classtree); HtmlOptions options = configuration.getOptions(); if (options.linkSource()) { - SourceToHTMLConverter.convertRoot(configuration,DocPaths.SOURCE_OUTPUT); + SourceToHTMLConverter.convertRoot(configuration, DocPaths.SOURCE_OUTPUT); } // Modules with no documented classes may be specified on the // command line to specify a service provider, allow these. @@ -225,10 +223,13 @@ public class HtmlDoclet extends AbstractDoclet { return; } boolean nodeprecated = options.noDeprecated(); - performCopy(options.helpFile()); - performCopy(options.stylesheetFile()); + performCopy(options.helpFile(), DocPath.empty); + performCopy(options.stylesheetFile(), DocPath.empty); for (String stylesheet : options.additionalStylesheets()) { - performCopy(stylesheet); + performCopy(stylesheet, DocPath.empty); + } + for (String script : options.additionalScripts()) { + performCopy(script, DocPaths.SCRIPT_DIR); } // do early to reduce memory footprint if (options.classUse()) { @@ -329,7 +330,7 @@ public class HtmlDoclet extends AbstractDoclet { "images/ui-bg_glass_75_e6e6e6_1x400.png"); DocFile f; for (String file : files) { - DocPath filePath = DocPaths.JQUERY_FILES.resolve(file); + DocPath filePath = DocPaths.SCRIPT_DIR.resolve(file); f = DocFile.createFileForOutput(configuration, filePath); f.copyResource(DOCLET_RESOURCES.resolve(filePath), true, false); } @@ -428,18 +429,20 @@ public class HtmlDoclet extends AbstractDoclet { return configuration.getOptions().getSupportedOptions(); } - private void performCopy(String filename) throws DocFileIOException { - if (filename.isEmpty()) + private void performCopy(String filename, DocPath targetPath) throws DocFileIOException { + if (filename.isEmpty()) { return; + } DocFile fromfile = DocFile.createFileForInput(configuration, filename); - DocPath path = DocPath.create(fromfile.getName()); + DocPath path = targetPath.resolve(fromfile.getName()); DocFile toFile = DocFile.createFileForOutput(configuration, path); - if (toFile.isSameFile(fromfile)) + if (toFile.isSameFile(fromfile)) { return; + } messages.notice("doclet.Copying_File_0_To_File_1", - fromfile.toString(), path.getPath()); + fromfile.getPath(), path.getPath()); toFile.copyFile(fromfile); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index 6014745a2e5..76709124ff2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -459,6 +459,7 @@ public class HtmlDocletWriter { .setCharset(options.charset()) .addKeywords(metakeywords) .setStylesheets(configuration.getMainStylesheet(), additionalStylesheets) + .setAdditionalScripts(configuration.getAdditionalScripts()) .setIndex(options.createIndex(), mainBodyScript) .addContent(extraHeadContent); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java index 30760a6c8f7..ca1602a45e7 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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,6 +59,11 @@ public class HtmlOptions extends BaseOptions { */ private List additionalStylesheets = new ArrayList<>(); + /** + * Argument for command-line option {@code --add-script}. + */ + private List additionalScripts = new ArrayList<>(); + /** * Argument for command-line option {@code -bottom}. */ @@ -199,6 +204,14 @@ public class HtmlOptions extends BaseOptions { Resources resources = messages.getResources(); List

      * + * + * + * + * + * + * * *
      LXM Multipliers
      ImplementationMixing function
      "L32X64MixRandom"
      "L32X64MixRandom"{@code 0xadb4a92d}{@code xoroshiro64}, version 1.0{@code (26, 9, 13)}mixLea32{@code (s+x0)}
      "L64X128StarStarRandom"
      "L64X128StarStarRandom" {@code 0xd1342543de82ef95L}{@code xoroshiro128}, version 1.0{@code (24, 16, 37)}{@code Long.rotateLeft((s+x0)* 5, 7) * 9}
      "L64X128MixRandom"
      "L64X128MixRandom"{@code 0xd1342543de82ef95L}{@code xoroshiro128}, version 1.0{@code (24, 16, 37)}mixLea64{@code (s+x0)}
      "L64X256MixRandom"
      "L64X256MixRandom"{@code 0xd1342543de82ef95L}{@code xoshiro256}, version 1.0{@code (17, 45)}mixLea64{@code (s+x0)}
      "L64X1024MixRandom"
      "L64X1024MixRandom"{@code 0xd1342543de82ef95L}{@code xoroshiro1024}, version 1.0{@code (25, 27, 36)}mixLea64{@code (s+x0)}
      "L128X128MixRandom"
      "L128X128MixRandom"{@code 0x1d605bbb58c8abbfdL}{@code xoroshiro128}, version 1.0{@code (24, 16, 37)}mixLea64{@code (sh+x0)}
      "L128X256MixRandom"
      "L128X256MixRandom"{@code 0x1d605bbb58c8abbfdL}{@code xoshiro256}, version 1.0{@code (17, 45)}mixLea64{@code (sh+x0)}
      "L128X1024MixRandom"
      "L128X1024MixRandom"{@code 0x1d605bbb58c8abbfdL}{@code xoroshiro1024}, version 1.0{@code (25, 27, 36)}
      inetAddressResolverProviderThis {@code RuntimePermission} is required to be granted to + * classes which subclass and implement {@code java.net.spi.InetAddressResolverProvider}. + * The permission is checked during invocation of the abstract base class constructor. + * This permission ensures trust in classes which provide resolvers used by + * {@link java.net.InetAddress} hostname and address resolution methods.See {@link java.net.spi.InetAddressResolverProvider} for more information.
      * diff --git a/src/java.base/share/classes/java/net/Inet4AddressImpl.java b/src/java.base/share/classes/java/net/Inet4AddressImpl.java index 4cbe28f998b..c7feaf4c195 100644 --- a/src/java.base/share/classes/java/net/Inet4AddressImpl.java +++ b/src/java.base/share/classes/java/net/Inet4AddressImpl.java @@ -24,6 +24,9 @@ */ package java.net; import java.io.IOException; +import java.net.spi.InetAddressResolver.LookupPolicy; + +import static java.net.spi.InetAddressResolver.LookupPolicy.IPV4; /* * Package private implementation of InetAddressImpl for IPv4. @@ -32,8 +35,14 @@ import java.io.IOException; */ final class Inet4AddressImpl implements InetAddressImpl { public native String getLocalHostName() throws UnknownHostException; - public native InetAddress[] - lookupAllHostAddr(String hostname) throws UnknownHostException; + public InetAddress[] lookupAllHostAddr(String hostname, LookupPolicy lookupPolicy) + throws UnknownHostException { + if ((lookupPolicy.characteristics() & IPV4) == 0) { + throw new UnknownHostException(hostname); + } + return lookupAllHostAddr(hostname); + } + private native InetAddress[] lookupAllHostAddr(String hostname) throws UnknownHostException; public native String getHostByAddr(byte[] addr) throws UnknownHostException; private native boolean isReachable0(byte[] addr, int timeout, byte[] ifaddr, int ttl) throws IOException; diff --git a/src/java.base/share/classes/java/net/Inet6AddressImpl.java b/src/java.base/share/classes/java/net/Inet6AddressImpl.java index f956a50e311..87fefbe37ba 100644 --- a/src/java.base/share/classes/java/net/Inet6AddressImpl.java +++ b/src/java.base/share/classes/java/net/Inet6AddressImpl.java @@ -25,10 +25,9 @@ package java.net; import java.io.IOException; +import java.net.spi.InetAddressResolver.LookupPolicy; -import static java.net.InetAddress.IPv6; -import static java.net.InetAddress.PREFER_IPV6_VALUE; -import static java.net.InetAddress.PREFER_SYSTEM_VALUE; +import static java.net.InetAddress.PLATFORM_LOOKUP_POLICY; /* * Package private implementation of InetAddressImpl for dual @@ -48,8 +47,13 @@ final class Inet6AddressImpl implements InetAddressImpl { public native String getLocalHostName() throws UnknownHostException; - public native InetAddress[] lookupAllHostAddr(String hostname) - throws UnknownHostException; + public InetAddress[] lookupAllHostAddr(String hostname, LookupPolicy lookupPolicy) + throws UnknownHostException { + return lookupAllHostAddr(hostname, lookupPolicy.characteristics()); + } + + private native InetAddress[] lookupAllHostAddr(String hostname, int characteristics) + throws UnknownHostException; public native String getHostByAddr(byte[] addr) throws UnknownHostException; @@ -96,8 +100,9 @@ final class Inet6AddressImpl implements InetAddressImpl { public synchronized InetAddress anyLocalAddress() { if (anyLocalAddress == null) { - if (InetAddress.preferIPv6Address == PREFER_IPV6_VALUE || - InetAddress.preferIPv6Address == PREFER_SYSTEM_VALUE) { + int flags = PLATFORM_LOOKUP_POLICY.characteristics(); + if (InetAddress.ipv6AddressesFirst(flags) || + InetAddress.systemAddressesOrder(flags)) { anyLocalAddress = new Inet6Address(); anyLocalAddress.holder().hostName = "::"; } else { @@ -109,9 +114,9 @@ final class Inet6AddressImpl implements InetAddressImpl { public synchronized InetAddress loopbackAddress() { if (loopbackAddress == null) { - boolean preferIPv6Address = - InetAddress.preferIPv6Address == PREFER_IPV6_VALUE || - InetAddress.preferIPv6Address == PREFER_SYSTEM_VALUE; + int flags = PLATFORM_LOOKUP_POLICY.characteristics(); + boolean preferIPv6Address = InetAddress.ipv6AddressesFirst(flags) || + InetAddress.systemAddressesOrder(flags); for (int i = 0; i < 2; i++) { InetAddress address; diff --git a/src/java.base/share/classes/java/net/InetAddress.java b/src/java.base/share/classes/java/net/InetAddress.java index 38e7fc62921..3875216768b 100644 --- a/src/java.base/share/classes/java/net/InetAddress.java +++ b/src/java.base/share/classes/java/net/InetAddress.java @@ -25,6 +25,11 @@ package java.net; +import java.net.spi.InetAddressResolver; +import java.net.spi.InetAddressResolverProvider; +import java.net.spi.InetAddressResolver.LookupPolicy; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.List; import java.util.NavigableSet; import java.util.ArrayList; @@ -40,19 +45,31 @@ import java.io.ObjectInputStream.GetField; import java.io.ObjectOutputStream; import java.io.ObjectOutputStream.PutField; import java.lang.annotation.Native; +import java.util.ServiceLoader; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentSkipListSet; import java.util.concurrent.atomic.AtomicLong; import java.util.Arrays; +import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Stream; + +import jdk.internal.misc.VM; import jdk.internal.access.JavaNetInetAddressAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.vm.annotation.Stable; +import sun.net.ResolverProviderConfiguration; import sun.security.action.*; import sun.net.InetAddressCachePolicy; import sun.net.util.IPAddressUtil; import sun.nio.cs.UTF_8; +import static java.net.spi.InetAddressResolver.LookupPolicy.IPV4; +import static java.net.spi.InetAddressResolver.LookupPolicy.IPV4_FIRST; +import static java.net.spi.InetAddressResolver.LookupPolicy.IPV6; +import static java.net.spi.InetAddressResolver.LookupPolicy.IPV6_FIRST; + /** * This class represents an Internet Protocol (IP) address. * @@ -128,25 +145,35 @@ import sun.nio.cs.UTF_8; * address format, please refer to Inet6Address#format. * - *

      There is a couple of - * System Properties affecting how IPv4 and IPv6 addresses are used.

      + *

      There is a couple of + * System Properties affecting how IPv4 and IPv6 addresses are used. * - *

      Host Name Resolution

      + *

      Host Name Resolution

      + * + *

      The InetAddress class provides methods to resolve host names to + * their IP addresses and vice versa. The actual resolution is delegated to an + * {@linkplain InetAddressResolver InetAddress resolver}. * - * Host name-to-IP address resolution is accomplished through - * the use of a combination of local machine configuration information - * and network naming services such as the Domain Name System (DNS) - * and Network Information Service(NIS). The particular naming - * services(s) being used is by default the local machine configured - * one. For any host name, its corresponding IP address is returned. + *

      Host name-to-IP address resolution maps a host name to an IP address. + * For any host name, its corresponding IP address is returned. * *

      Reverse name resolution means that for any IP address, * the host associated with the IP address is returned. * - *

      The InetAddress class provides methods to resolve host names to - * their IP addresses and vice versa. + *

      The built-in InetAddress resolver implementation does + * host name-to-IP address resolution and vice versa through the use of + * a combination of local machine configuration information and network + * naming services such as the Domain Name System (DNS) and the Lightweight Directory + * Access Protocol (LDAP). + * The particular naming services that the built-in resolver uses by default + * depends on the configuration of the local machine. + * + *

      {@code InetAddress} has a service provider mechanism for InetAddress resolvers + * that allows a custom InetAddress resolver to be used instead of the built-in implementation. + * {@link InetAddressResolverProvider} is the service provider class. Its API docs provide all the + * details on this mechanism. * - *

      InetAddress Caching

      + *

      InetAddress Caching

      * * The InetAddress class has a cache to store successful as well as * unsuccessful host name resolutions. @@ -198,10 +225,6 @@ import sun.nio.cs.UTF_8; */ public class InetAddress implements java.io.Serializable { - @Native static final int PREFER_IPV4_VALUE = 0; - @Native static final int PREFER_IPV6_VALUE = 1; - @Native static final int PREFER_SYSTEM_VALUE = 2; - /** * Specify the address family: Internet Protocol, Version 4 * @since 1.4 @@ -214,9 +237,6 @@ public class InetAddress implements java.io.Serializable { */ @Native static final int IPv6 = 2; - /* Specify address family preference */ - static final transient int preferIPv6Address; - static class InetAddressHolder { /** * Reserve the original application specified hostname. @@ -288,8 +308,11 @@ public class InetAddress implements java.io.Serializable { return holder; } - /* Used to store the name service provider */ - private static transient NameService nameService; + /* Used to store the system-wide resolver */ + @Stable + private static volatile InetAddressResolver resolver; + + private static final InetAddressResolver BUILTIN_RESOLVER; /** * Used to store the best available hostname. @@ -301,22 +324,25 @@ public class InetAddress implements java.io.Serializable { @java.io.Serial private static final long serialVersionUID = 3286316764910316507L; + // "java.net.preferIPv4Stack" system property value + private static final String PREFER_IPV4_STACK_VALUE; + + // "java.net.preferIPv6Addresses" system property value + private static final String PREFER_IPV6_ADDRESSES_VALUE; + + // "jdk.net.hosts.file" system property value + private static final String HOSTS_FILE_NAME; + /* * Load net library into runtime, and perform initializations. */ static { - String str = GetPropertyAction.privilegedGetProperty("java.net.preferIPv6Addresses"); - if (str == null) { - preferIPv6Address = PREFER_IPV4_VALUE; - } else if (str.equalsIgnoreCase("true")) { - preferIPv6Address = PREFER_IPV6_VALUE; - } else if (str.equalsIgnoreCase("false")) { - preferIPv6Address = PREFER_IPV4_VALUE; - } else if (str.equalsIgnoreCase("system")) { - preferIPv6Address = PREFER_SYSTEM_VALUE; - } else { - preferIPv6Address = PREFER_IPV4_VALUE; - } + PREFER_IPV4_STACK_VALUE = + GetPropertyAction.privilegedGetProperty("java.net.preferIPv4Stack"); + PREFER_IPV6_ADDRESSES_VALUE = + GetPropertyAction.privilegedGetProperty("java.net.preferIPv6Addresses"); + HOSTS_FILE_NAME = + GetPropertyAction.privilegedGetProperty("jdk.net.hosts.file"); jdk.internal.loader.BootLoader.loadLibrary("net"); SharedSecrets.setJavaNetInetAddressAccess( new JavaNetInetAddressAccess() { @@ -324,13 +350,6 @@ public class InetAddress implements java.io.Serializable { return ia.holder.getOriginalHostName(); } - public InetAddress getByName(String hostName, - InetAddress hostAddress) - throws UnknownHostException - { - return InetAddress.getByName(hostName, hostAddress); - } - public int addressValue(Inet4Address inet4Address) { return inet4Address.addressValue(); } @@ -343,6 +362,131 @@ public class InetAddress implements java.io.Serializable { init(); } + /** + * Creates an address lookup policy from {@code "java.net.preferIPv4Stack"}, + * {@code "java.net.preferIPv6Addresses"} system property values, and O/S configuration. + */ + private static final LookupPolicy initializePlatformLookupPolicy() { + // Calculate AddressFamily value first + boolean ipv4Available = isIPv4Available(); + if ("true".equals(PREFER_IPV4_STACK_VALUE) && ipv4Available) { + return LookupPolicy.of(IPV4); + } + // Check if IPv6 is not supported + if (InetAddress.impl instanceof Inet4AddressImpl) { + return LookupPolicy.of(IPV4); + } + // Check if system supports IPv4, if not use IPv6 + if (!ipv4Available) { + return LookupPolicy.of(IPV6); + } + // If both address families are needed - check preferIPv6Addresses value + if (PREFER_IPV6_ADDRESSES_VALUE != null) { + if (PREFER_IPV6_ADDRESSES_VALUE.equalsIgnoreCase("true")) { + return LookupPolicy.of(IPV4 | IPV6 | IPV6_FIRST); + } + if (PREFER_IPV6_ADDRESSES_VALUE.equalsIgnoreCase("false")) { + return LookupPolicy.of(IPV4 | IPV6 | IPV4_FIRST); + } + if (PREFER_IPV6_ADDRESSES_VALUE.equalsIgnoreCase("system")) { + return LookupPolicy.of(IPV4 | IPV6); + } + } + // Default value with both address families needed - IPv4 addresses come first + return LookupPolicy.of(IPV4 | IPV6 | IPV4_FIRST); + } + + static boolean systemAddressesOrder(int lookupCharacteristics) { + return (lookupCharacteristics & (IPV4_FIRST | IPV6_FIRST)) == 0; + } + + static boolean ipv4AddressesFirst(int lookupCharacteristics) { + return (lookupCharacteristics & IPV4_FIRST) != 0; + } + + static boolean ipv6AddressesFirst(int lookupCharacteristics) { + return (lookupCharacteristics & IPV6_FIRST) != 0; + } + + // Native method to check if IPv4 is available + private static native boolean isIPv4Available(); + + /** + * The {@code RuntimePermission("inetAddressResolverProvider")} is + * necessary to subclass and instantiate the {@code InetAddressResolverProvider} + * class, as well as to obtain resolver from an instance of that class, + * and it is also required to obtain the operating system name resolution configurations. + */ + private static final RuntimePermission INET_ADDRESS_RESOLVER_PERMISSION = + new RuntimePermission("inetAddressResolverProvider"); + + private static final ReentrantLock RESOLVER_LOCK = new ReentrantLock(); + private static volatile InetAddressResolver bootstrapResolver; + + @SuppressWarnings("removal") + private static InetAddressResolver resolver() { + InetAddressResolver cns = resolver; + if (cns != null) { + return cns; + } + if (VM.isBooted()) { + RESOLVER_LOCK.lock(); + boolean bootstrapSet = false; + try { + cns = resolver; + if (cns != null) { + return cns; + } + // Protection against provider calling InetAddress APIs during initialization + if (bootstrapResolver != null) { + return bootstrapResolver; + } + bootstrapResolver = BUILTIN_RESOLVER; + bootstrapSet = true; + + if (HOSTS_FILE_NAME != null) { + // The default resolver service is already host file resolver + cns = BUILTIN_RESOLVER; + } else if (System.getSecurityManager() != null) { + PrivilegedAction pa = InetAddress::loadResolver; + cns = AccessController.doPrivileged( + pa, null, INET_ADDRESS_RESOLVER_PERMISSION); + } else { + cns = loadResolver(); + } + + InetAddress.resolver = cns; + return cns; + } finally { + // We want to clear bootstrap resolver reference only after an attempt to + // instantiate a resolver has been completed. + if (bootstrapSet) { + bootstrapResolver = null; + } + RESOLVER_LOCK.unlock(); + } + } else { + return BUILTIN_RESOLVER; + } + } + + private static InetAddressResolver loadResolver() { + return ServiceLoader.load(InetAddressResolverProvider.class) + .findFirst() + .map(nsp -> nsp.get(builtinConfiguration())) + .orElse(BUILTIN_RESOLVER); + } + + private static InetAddressResolverProvider.Configuration builtinConfiguration() { + return new ResolverProviderConfiguration(BUILTIN_RESOLVER, () -> { + try { + return impl.getLocalHostName(); + } catch (UnknownHostException unknownHostException) { + return "localhost"; + } + }); + } + /** * Constructor for the Socket.accept() method. * This creates an empty InetAddress, which is filled in by @@ -555,7 +699,7 @@ public class InetAddress implements java.io.Serializable { * this host name will be remembered and returned; * otherwise, a reverse name lookup will be performed * and the result will be returned based on the system - * configured name lookup service. If a lookup of the name service + * configured resolver. If a lookup of the name service * is required, call * {@link #getCanonicalHostName() getCanonicalHostName}. * @@ -656,10 +800,11 @@ public class InetAddress implements java.io.Serializable { * @see SecurityManager#checkConnect */ private static String getHostFromNameService(InetAddress addr, boolean check) { - String host = null; + String host; + var resolver = resolver(); try { // first lookup the hostname - host = nameService.getHostByAddr(addr.getAddress()); + host = resolver.lookupByAddress(addr.getAddress()); /* check to see if calling code is allowed to know * the hostname for this IP address, ie, connect to the host @@ -691,11 +836,12 @@ public class InetAddress implements java.io.Serializable { host = addr.getHostAddress(); return host; } - } catch (SecurityException e) { + } catch (RuntimeException | UnknownHostException e) { + // 'resolver.lookupByAddress' and 'InetAddress.getAllByName0' delegate to + // the system-wide resolver, which could be a custom one. At that point we + // treat any unexpected RuntimeException thrown by the resolver as we would + // treat an UnknownHostException or an unmatched host name. host = addr.getHostAddress(); - } catch (UnknownHostException e) { - host = addr.getHostAddress(); - // let next provider resolve the hostname } return host; } @@ -755,8 +901,9 @@ public class InetAddress implements java.io.Serializable { * string returned is of the form: hostname / literal IP * address. * - * If the host name is unresolved, no reverse name service lookup - * is performed. The hostname part will be represented by an empty string. + * If the host name is unresolved, no reverse lookup + * is performed. The hostname part will be represented + * by an empty string. * * @return a string representation of this IP address. */ @@ -821,11 +968,9 @@ public class InetAddress implements java.io.Serializable { // in cache when the result is obtained private static final class NameServiceAddresses implements Addresses { private final String host; - private final InetAddress reqAddr; - NameServiceAddresses(String host, InetAddress reqAddr) { + NameServiceAddresses(String host) { this.host = host; - this.reqAddr = reqAddr; } @Override @@ -849,7 +994,7 @@ public class InetAddress implements java.io.Serializable { UnknownHostException ex; int cachePolicy; try { - inetAddresses = getAddressesFromNameService(host, reqAddr); + inetAddresses = getAddressesFromNameService(host); ex = null; cachePolicy = InetAddressCachePolicy.get(); } catch (UnknownHostException uhe) { @@ -875,7 +1020,7 @@ public class InetAddress implements java.io.Serializable { expirySet.add(cachedAddresses); } } - if (inetAddresses == null) { + if (inetAddresses == null || inetAddresses.length == 0) { throw ex == null ? new UnknownHostException(host) : ex; } return inetAddresses; @@ -889,81 +1034,48 @@ public class InetAddress implements java.io.Serializable { } /** - * NameService provides host and address lookup service - * - * @since 9 - */ - private interface NameService { - - /** - * Lookup a host mapping by name. Retrieve the IP addresses - * associated with a host - * - * @param host the specified hostname - * @return array of IP addresses for the requested host - * @throws UnknownHostException - * if no IP address for the {@code host} could be found - */ - InetAddress[] lookupAllHostAddr(String host) - throws UnknownHostException; - - /** - * Lookup the host corresponding to the IP address provided - * - * @param addr byte array representing an IP address - * @return {@code String} representing the host name mapping - * @throws UnknownHostException - * if no host found for the specified IP address - */ - String getHostByAddr(byte[] addr) throws UnknownHostException; - - } - - /** - * The default NameService implementation, which delegates to the underlying + * The default InetAddressResolver implementation, which delegates to the underlying * OS network libraries to resolve host address mappings. * * @since 9 */ - private static final class PlatformNameService implements NameService { + private static final class PlatformResolver implements InetAddressResolver { - public InetAddress[] lookupAllHostAddr(String host) - throws UnknownHostException - { - return impl.lookupAllHostAddr(host); + public Stream lookupByName(String host, LookupPolicy policy) + throws UnknownHostException { + Objects.requireNonNull(host); + Objects.requireNonNull(policy); + return Arrays.stream(impl.lookupAllHostAddr(host, policy)); } - public String getHostByAddr(byte[] addr) - throws UnknownHostException - { + public String lookupByAddress(byte[] addr) + throws UnknownHostException { + Objects.requireNonNull(addr); + if (addr.length != Inet4Address.INADDRSZ && addr.length != Inet6Address.INADDRSZ) { + throw new IllegalArgumentException("Invalid address length"); + } return impl.getHostByAddr(addr); } } /** - * The HostsFileNameService provides host address mapping + * The HostsFileResolver provides host address mapping * by reading the entries in a hosts file, which is specified by * {@code jdk.net.hosts.file} system property * *

      The file format is that which corresponds with the /etc/hosts file * IP Address host alias list. * - *

      When the file lookup is enabled it replaces the default NameService + *

      When the file lookup is enabled it replaces the default InetAddressResolver * implementation * * @since 9 */ - private static final class HostsFileNameService implements NameService { - - private static final InetAddress[] EMPTY_ARRAY = new InetAddress[0]; - - // Specify if only IPv4 addresses should be returned by HostsFileService implementation - private static final boolean preferIPv4Stack = Boolean.parseBoolean( - GetPropertyAction.privilegedGetProperty("java.net.preferIPv4Stack")); + private static final class HostsFileResolver implements InetAddressResolver { private final String hostsFile; - public HostsFileNameService(String hostsFileName) { + public HostsFileResolver(String hostsFileName) { this.hostsFile = hostsFileName; } @@ -974,17 +1086,22 @@ public class InetAddress implements java.io.Serializable { * * @param addr byte array representing an IP address * @return {@code String} representing the host name mapping - * @throws UnknownHostException - * if no host found for the specified IP address + * @throws UnknownHostException if no host found for the specified IP address + * @throws IllegalArgumentException if IP address is of illegal length + * @throws NullPointerException if addr is {@code null} */ @Override - public String getHostByAddr(byte[] addr) throws UnknownHostException { + public String lookupByAddress(byte[] addr) throws UnknownHostException { String hostEntry; String host = null; + Objects.requireNonNull(addr); + // Check the length of the address array + if (addr.length != Inet4Address.INADDRSZ && addr.length != Inet6Address.INADDRSZ) { + throw new IllegalArgumentException("Invalid address length"); + } try (Scanner hostsFileScanner = new Scanner(new File(hostsFile), - UTF_8.INSTANCE)) - { + UTF_8.INSTANCE)) { while (hostsFileScanner.hasNextLine()) { hostEntry = hostsFileScanner.nextLine(); if (!hostEntry.startsWith("#")) { @@ -1020,22 +1137,31 @@ public class InetAddress implements java.io.Serializable { * with the specified host name. * * @param host the specified hostname - * @return array of IP addresses for the requested host + * @param lookupPolicy IP addresses lookup policy which specifies addresses + * family and their order + * @return stream of IP addresses for the requested host + * @throws NullPointerException if either parameter is {@code null} * @throws UnknownHostException * if no IP address for the {@code host} could be found */ - public InetAddress[] lookupAllHostAddr(String host) + public Stream lookupByName(String host, LookupPolicy lookupPolicy) throws UnknownHostException { String hostEntry; String addrStr; byte addr[]; + + Objects.requireNonNull(host); + Objects.requireNonNull(lookupPolicy); List inetAddresses = new ArrayList<>(); List inet4Addresses = new ArrayList<>(); List inet6Addresses = new ArrayList<>(); + int flags = lookupPolicy.characteristics(); + boolean needIPv4 = (flags & IPv4) != 0; + boolean needIPv6 = (flags & IPv6) != 0; // lookup the file and create a list InetAddress for the specified host try (Scanner hostsFileScanner = new Scanner(new File(hostsFile), - UTF_8.INSTANCE)) { + UTF_8.INSTANCE)) { while (hostsFileScanner.hasNextLine()) { hostEntry = hostsFileScanner.nextLine(); if (!hostEntry.startsWith("#")) { @@ -1047,10 +1173,10 @@ public class InetAddress implements java.io.Serializable { if (addr != null) { InetAddress address = InetAddress.getByAddress(host, addr); inetAddresses.add(address); - if (address instanceof Inet4Address) { + if (address instanceof Inet4Address && needIPv4) { inet4Addresses.add(address); } - if (address instanceof Inet6Address) { + if (address instanceof Inet6Address && needIPv6) { inet6Addresses.add(address); } } @@ -1062,33 +1188,38 @@ public class InetAddress implements java.io.Serializable { throw new UnknownHostException("Unable to resolve host " + host + " as hosts file " + hostsFile + " not found "); } - - List res; - // If "preferIPv4Stack" system property is set to "true" then return - // only IPv4 addresses - if (preferIPv4Stack) { - res = inet4Addresses; - } else { - // Otherwise, analyse "preferIPv6Addresses" value - res = switch (preferIPv6Address) { - case PREFER_IPV4_VALUE -> concatAddresses(inet4Addresses, inet6Addresses); - case PREFER_IPV6_VALUE -> concatAddresses(inet6Addresses, inet4Addresses); - default -> inetAddresses; - }; + // Check if only IPv4 addresses are requested + if (needIPv4 && !needIPv6) { + checkResultsList(inet4Addresses, host); + return inet4Addresses.stream(); } - - if (res.isEmpty()) { - throw new UnknownHostException("Unable to resolve host " + host - + " in hosts file " + hostsFile); + // Check if only IPv6 addresses are requested + if (!needIPv4 && needIPv6) { + checkResultsList(inet6Addresses, host); + return inet6Addresses.stream(); } - return res.toArray(EMPTY_ARRAY); + // If both type of addresses are requested: + // First, check if there is any results. Then arrange + // addresses according to LookupPolicy value. + checkResultsList(inetAddresses, host); + if (ipv6AddressesFirst(flags)) { + return Stream.concat(inet6Addresses.stream(), inet4Addresses.stream()); + } else if (ipv4AddressesFirst(flags)) { + return Stream.concat(inet4Addresses.stream(), inet6Addresses.stream()); + } + // Only "system" addresses order is possible at this stage + assert systemAddressesOrder(flags); + return inetAddresses.stream(); } - private static List concatAddresses(List firstPart, - List secondPart) { - List result = new ArrayList<>(firstPart); - result.addAll(secondPart); - return result; + // Checks if result list with addresses is not empty. + // If it is empty throw an UnknownHostException. + private void checkResultsList(List addressesList, String hostName) + throws UnknownHostException { + if (addressesList.isEmpty()) { + throw new UnknownHostException("Unable to resolve host " + hostName + + " in hosts file " + hostsFile); + } } private String removeComments(String hostsEntry) { @@ -1130,45 +1261,52 @@ public class InetAddress implements java.io.Serializable { static final InetAddressImpl impl; + /** + * Platform-wide {@code LookupPolicy} initialized from {@code "java.net.preferIPv4Stack"}, + * {@code "java.net.preferIPv6Addresses"} system properties. + */ + static final LookupPolicy PLATFORM_LOOKUP_POLICY; + static { // create the impl impl = InetAddressImplFactory.create(); - // create name service - nameService = createNameService(); + // impl must be initialized before calling this method + PLATFORM_LOOKUP_POLICY = initializePlatformLookupPolicy(); + + // create built-in resolver + BUILTIN_RESOLVER = createBuiltinInetAddressResolver(); } /** - * Create an instance of the NameService interface based on + * Create an instance of the InetAddressResolver interface based on * the setting of the {@code jdk.net.hosts.file} system property. * - *

      The default NameService is the PlatformNameService, which typically + *

      The default InetAddressResolver is the PlatformResolver, which typically * delegates name and address resolution calls to the underlying * OS network libraries. * - *

      A HostsFileNameService is created if the {@code jdk.net.hosts.file} + *

      A HostsFileResolver is created if the {@code jdk.net.hosts.file} * system property is set. If the specified file doesn't exist, the name or * address lookup will result in an UnknownHostException. Thus, non existent * hosts file is handled as if the file is empty. * - * @return a NameService + * @return an InetAddressResolver */ - private static NameService createNameService() { - - String hostsFileName = - GetPropertyAction.privilegedGetProperty("jdk.net.hosts.file"); - NameService theNameService; - if (hostsFileName != null) { - theNameService = new HostsFileNameService(hostsFileName); + private static InetAddressResolver createBuiltinInetAddressResolver() { + InetAddressResolver theResolver; + if (HOSTS_FILE_NAME != null) { + theResolver = new HostsFileResolver(HOSTS_FILE_NAME); } else { - theNameService = new PlatformNameService(); + theResolver = new PlatformResolver(); } - return theNameService; + return theResolver; } /** * Creates an InetAddress based on the provided host name and IP address. - * No name service is checked for the validity of the address. + * The system-wide {@linkplain InetAddressResolver resolver} is not used to check + * the validity of the address. * *

      The host name can either be a machine name, such as * "{@code www.example.com}", or a textual representation of its IP @@ -1251,15 +1389,9 @@ public class InetAddress implements java.io.Serializable { return InetAddress.getAllByName(host)[0]; } - // called from deployment cache manager - private static InetAddress getByName(String host, InetAddress reqAddr) - throws UnknownHostException { - return InetAddress.getAllByName(host, reqAddr)[0]; - } - /** * Given the name of a host, returns an array of its IP addresses, - * based on the configured name service on the system. + * based on the configured system {@linkplain InetAddressResolver resolver}. * *

      The host name can either be a machine name, such as * "{@code www.example.com}", or a textual representation of its IP @@ -1298,11 +1430,6 @@ public class InetAddress implements java.io.Serializable { */ public static InetAddress[] getAllByName(String host) throws UnknownHostException { - return getAllByName(host, null); - } - - private static InetAddress[] getAllByName(String host, InetAddress reqAddr) - throws UnknownHostException { if (host == null || host.isEmpty()) { InetAddress[] ret = new InetAddress[1]; @@ -1364,7 +1491,7 @@ public class InetAddress implements java.io.Serializable { // We were expecting an IPv6 Literal, but got something else throw new UnknownHostException("["+host+"]"); } - return getAllByName0(host, reqAddr, true, true); + return getAllByName0(host, true, true); } /** @@ -1414,25 +1541,18 @@ public class InetAddress implements java.io.Serializable { return zone; } - private static InetAddress[] getAllByName0 (String host) - throws UnknownHostException - { - return getAllByName0(host, true); - } - /** * package private so SocketPermission can call it */ static InetAddress[] getAllByName0 (String host, boolean check) throws UnknownHostException { - return getAllByName0 (host, null, check, true); + return getAllByName0(host, check, true); } /** * Designated lookup method. * * @param host host name to look up - * @param reqAddr requested address to be the 1st in returned array * @param check perform security check * @param useCache use cached value if not expired else always * perform name service lookup (and cache the result) @@ -1440,7 +1560,6 @@ public class InetAddress implements java.io.Serializable { * @throws UnknownHostException if host name is not found */ private static InetAddress[] getAllByName0(String host, - InetAddress reqAddr, boolean check, boolean useCache) throws UnknownHostException { @@ -1498,7 +1617,7 @@ public class InetAddress implements java.io.Serializable { // the name service and install it within cache... Addresses oldAddrs = cache.putIfAbsent( host, - addrs = new NameServiceAddresses(host, reqAddr) + addrs = new NameServiceAddresses(host) ); if (oldAddrs != null) { // lost putIfAbsent race addrs = oldAddrs; @@ -1509,47 +1628,30 @@ public class InetAddress implements java.io.Serializable { return addrs.get().clone(); } - static InetAddress[] getAddressesFromNameService(String host, InetAddress reqAddr) + static InetAddress[] getAddressesFromNameService(String host) throws UnknownHostException { - InetAddress[] addresses = null; + Stream addresses = null; UnknownHostException ex = null; + var resolver = resolver(); try { - addresses = nameService.lookupAllHostAddr(host); - } catch (UnknownHostException uhe) { + addresses = resolver.lookupByName(host, PLATFORM_LOOKUP_POLICY); + } catch (RuntimeException | UnknownHostException x) { if (host.equalsIgnoreCase("localhost")) { - addresses = new InetAddress[]{impl.loopbackAddress()}; - } else { + addresses = Stream.of(impl.loopbackAddress()); + } else if (x instanceof UnknownHostException uhe) { ex = uhe; + } else { + ex = new UnknownHostException(); + ex.initCause(x); } } - - if (addresses == null) { + InetAddress[] result = addresses == null ? null + : addresses.toArray(InetAddress[]::new); + if (result == null || result.length == 0) { throw ex == null ? new UnknownHostException(host) : ex; } - - // More to do? - if (reqAddr != null && addresses.length > 1 && !addresses[0].equals(reqAddr)) { - // Find it? - int i = 1; - for (; i < addresses.length; i++) { - if (addresses[i].equals(reqAddr)) { - break; - } - } - // Rotate - if (i < addresses.length) { - InetAddress tmp, tmp2 = reqAddr; - for (int j = 0; j < i; j++) { - tmp = addresses[j]; - addresses[j] = tmp2; - tmp2 = tmp; - } - addresses[i] = tmp2; - } - } - - return addresses; + return result; } /** @@ -1557,8 +1659,7 @@ public class InetAddress implements java.io.Serializable { * The argument is in network byte order: the highest order * byte of the address is in {@code getAddress()[0]}. * - *

      This method doesn't block, i.e. no reverse name service lookup - * is performed. + *

      This method doesn't block, i.e. no reverse lookup is performed. * *

      IPv4 address byte array must be 4 bytes long and IPv6 byte array * must be 16 bytes long @@ -1637,7 +1738,7 @@ public class InetAddress implements java.io.Serializable { // call getAllByName0 without security checks and // without using cached data try { - localAddr = getAllByName0(local, null, false, false)[0]; + localAddr = getAllByName0(local, false, false)[0]; } catch (UnknownHostException uhe) { // Rethrow with a more informative error message. UnknownHostException uhe2 = diff --git a/src/java.base/share/classes/java/net/InetAddressImpl.java b/src/java.base/share/classes/java/net/InetAddressImpl.java index a2f8ea01052..f0364ffaedf 100644 --- a/src/java.base/share/classes/java/net/InetAddressImpl.java +++ b/src/java.base/share/classes/java/net/InetAddressImpl.java @@ -24,7 +24,10 @@ */ package java.net; + import java.io.IOException; +import java.net.spi.InetAddressResolver.LookupPolicy; + /* * Package private interface to "implementation" used by * {@link InetAddress}. @@ -38,7 +41,7 @@ sealed interface InetAddressImpl permits Inet4AddressImpl, Inet6AddressImpl { String getLocalHostName() throws UnknownHostException; InetAddress[] - lookupAllHostAddr(String hostname) throws UnknownHostException; + lookupAllHostAddr(String hostname, LookupPolicy lookupPolicy) throws UnknownHostException; String getHostByAddr(byte[] addr) throws UnknownHostException; InetAddress anyLocalAddress(); diff --git a/src/java.base/share/classes/java/net/doc-files/net-properties.html b/src/java.base/share/classes/java/net/doc-files/net-properties.html index ea0311b7161..0c2d3e232da 100644 --- a/src/java.base/share/classes/java/net/doc-files/net-properties.html +++ b/src/java.base/share/classes/java/net/doc-files/net-properties.html @@ -1,6 +1,6 @@ fpr load __ unspill(as_FloatRegister(Matcher::_regEncode[dst_lo]), is64 ? __ D : __ S, src_offset); + } else if (dst_lo_rc == rc_predicate) { + __ unspill_sve_predicate(as_PRegister(Matcher::_regEncode[dst_lo]), ra_->reg2offset(src_lo), + Matcher::scalable_vector_reg_size(T_BYTE) >> 3); } else { // stack --> stack copy assert(dst_lo_rc == rc_stack, "spill to bad register class"); - __ unspill(rscratch1, is64, src_offset); - __ spill(rscratch1, is64, dst_offset); + if (ideal_reg() == Op_RegVectMask) { + __ spill_copy_sve_predicate_stack_to_stack(src_offset, dst_offset, + Matcher::scalable_vector_reg_size(T_BYTE) >> 3); + } else { + __ unspill(rscratch1, is64, src_offset); + __ spill(rscratch1, is64, dst_offset); + } + } + break; + case rc_predicate: + if (dst_lo_rc == rc_predicate) { + __ sve_mov(as_PRegister(Matcher::_regEncode[dst_lo]), as_PRegister(Matcher::_regEncode[src_lo])); + } else if (dst_lo_rc == rc_stack) { + __ spill_sve_predicate(as_PRegister(Matcher::_regEncode[src_lo]), ra_->reg2offset(dst_lo), + Matcher::scalable_vector_reg_size(T_BYTE) >> 3); + } else { + assert(false, "bad src and dst rc_class combination."); + ShouldNotReachHere(); } break; default: @@ -2204,7 +2223,7 @@ uint MachSpillCopyNode::implementation(CodeBuffer *cbuf, PhaseRegAlloc *ra_, boo } else { st->print("%s", Matcher::regName[dst_lo]); } - if (bottom_type()->isa_vect() != NULL) { + if (bottom_type()->isa_vect() && !bottom_type()->isa_vectmask()) { int vsize = 0; switch (ideal_reg()) { case Op_VecD: @@ -2221,6 +2240,10 @@ uint MachSpillCopyNode::implementation(CodeBuffer *cbuf, PhaseRegAlloc *ra_, boo ShouldNotReachHere(); } st->print("\t# vector spill size = %d", vsize); + } else if (ideal_reg() == Op_RegVectMask) { + assert(Matcher::supports_scalable_vector(), "bad register type for spill"); + int vsize = Matcher::scalable_predicate_reg_slots() * 32; + st->print("\t# predicate spill size = %d", vsize); } else { st->print("\t# spill size = %d", is64 ? 64 : 32); } @@ -2382,6 +2405,18 @@ const bool Matcher::match_rule_supported(int opcode) { ret_value = false; } break; + case Op_LoadVectorMasked: + case Op_StoreVectorMasked: + case Op_LoadVectorGatherMasked: + case Op_StoreVectorScatterMasked: + case Op_MaskAll: + case Op_AndVMask: + case Op_OrVMask: + case Op_XorVMask: + if (UseSVE == 0) { + ret_value = false; + } + break; } return ret_value; // Per default match rules are supported. @@ -2430,6 +2465,15 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return vector_size_supported(bt, vlen); } +const bool Matcher::match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt) { + // Only SVE supports masked operations. + if (UseSVE == 0) { + return false; + } + return match_rule_supported(opcode) && + masked_op_sve_supported(opcode, vlen, bt); +} + const RegMask* Matcher::predicate_reg_mask(void) { return &_PR_REG_mask; } @@ -2643,10 +2687,14 @@ bool size_fits_all_mem_uses(AddPNode* addp, int shift) { // Should the matcher clone input 'm' of node 'n'? bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { - if (is_vshift_con_pattern(n, m)) { // ShiftV src (ShiftCntV con) - mstack.push(m, Visit); // m = ShiftCntV + // ShiftV src (ShiftCntV con) + // StoreVector (VectorStoreMask src) + if (is_vshift_con_pattern(n, m) || + (UseSVE > 0 && m->Opcode() == Op_VectorStoreMask && n->Opcode() == Op_StoreVector)) { + mstack.push(m, Visit); return true; } + return false; } @@ -5505,6 +5553,7 @@ operand pReg() %{ constraint(ALLOC_IN_RC(pr_reg)); match(RegVectMask); + match(pRegGov); op_cost(0); format %{ %} interface(REG_INTER); @@ -8854,6 +8903,17 @@ instruct castVV(vReg dst) ins_pipe(pipe_class_empty); %} +instruct castVVMask(pRegGov dst) +%{ + match(Set dst (CastVV dst)); + + size(0); + format %{ "# castVV of $dst" %} + ins_encode(/* empty encoding */); + ins_cost(0); + ins_pipe(pipe_class_empty); +%} + // ============================================================================ // Atomic operation instructions // diff --git a/src/hotspot/cpu/aarch64/aarch64_sve.ad b/src/hotspot/cpu/aarch64/aarch64_sve.ad index 1910ef42b25..78c09b65708 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve.ad +++ b/src/hotspot/cpu/aarch64/aarch64_sve.ad @@ -88,6 +88,7 @@ opclass vmemA(indirect, vmemA_indOffI4, vmemA_indOffL4); source_hpp %{ bool op_sve_supported(int opcode, int vlen, BasicType bt); + bool masked_op_sve_supported(int opcode, int vlen, BasicType bt); %} source %{ @@ -144,11 +145,7 @@ source %{ // Vector API specific case Op_VectorLoadShuffle: case Op_VectorRearrange: - if (vlen < 4 || length_in_bytes > MaxVectorSize) { - return false; - } else { - return true; - } + return vlen >= 4 && length_in_bytes <= MaxVectorSize; case Op_LoadVector: case Op_StoreVector: return Matcher::vector_size_supported(bt, vlen); @@ -158,6 +155,14 @@ source %{ // By default, we only support vector operations with no less than 8 bytes and 2 elements. return 8 <= length_in_bytes && length_in_bytes <= MaxVectorSize && vlen >= 2; } + + bool masked_op_sve_supported(int opcode, int vlen, BasicType bt) { + if (opcode == Op_VectorRearrange) { + return false; + } + return op_sve_supported(opcode, vlen, bt); + } + %} definitions %{ @@ -294,46 +299,252 @@ instruct storeV16_vreg(vReg src, vmem16 mem) // Only load/store values in the range of the memory_size. This is needed // when the memory_size is lower than the hardware supported max vector size. // And this might happen for Vector API mask vector load/store. -instruct loadV_partial(vReg dst, vmemA mem, pRegGov pTmp, rFlagsReg cr) %{ +instruct loadV_partial(vReg dst, vmemA mem, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_LoadVector()->memory_size() > 16 && n->as_LoadVector()->memory_size() < MaxVectorSize); match(Set dst (LoadVector mem)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(6 * SVE_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_ldr $dst, $pTmp, $mem\t# load vector predicated" %} + format %{ "sve_whilelo_zr_imm $pgtmp, vector_length\n\t" + "sve_ldr $dst, $pgtmp, $mem\t# load vector partial" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ elemType_to_regVariant(bt), + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), Matcher::vector_length(this)); FloatRegister dst_reg = as_FloatRegister($dst$$reg); loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, dst_reg, - as_PRegister($pTmp$$reg), bt, bt, $mem->opcode(), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); %} ins_pipe(pipe_slow); %} -instruct storeV_partial(vReg src, vmemA mem, pRegGov pTmp, rFlagsReg cr) %{ +instruct storeV_partial(vReg src, vmemA mem, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_StoreVector()->memory_size() > 16 && n->as_StoreVector()->memory_size() < MaxVectorSize); match(Set mem (StoreVector mem src)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(5 * SVE_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_str $src, $pTmp, $mem\t# store vector predicated" %} + format %{ "sve_whilelo_zr_imm $pgtmp, vector_length\n\t" + "sve_str $src, $pgtmp, $mem\t# store vector partial" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ elemType_to_regVariant(bt), + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), Matcher::vector_length(this, $src)); FloatRegister src_reg = as_FloatRegister($src$$reg); loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, src_reg, - as_PRegister($pTmp$$reg), bt, bt, $mem->opcode(), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +// vector load/store - predicated + +instruct loadV_masked(vReg dst, vmemA mem, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() == MaxVectorSize); + match(Set dst (LoadVectorMasked mem pg)); + ins_cost(4 * SVE_COST); + format %{ "sve_ldr $dst, $pg, $mem\t# load vector predicated (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($dst$$reg), + as_PRegister($pg$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +instruct loadV_masked_partial(vReg dst, vmemA mem, pRegGov pg, pRegGov pgtmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() < MaxVectorSize); + match(Set dst (LoadVectorMasked mem pg)); + effect(TEMP pgtmp, KILL cr); + ins_cost(6 * SVE_COST); + format %{ "sve_ldr $dst, $pg, $mem\t# load vector predicated partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), + Matcher::vector_length(this)); + __ sve_and(as_PRegister($pgtmp$$reg), as_PRegister($pgtmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($dst$$reg), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +instruct storeV_masked(vReg src, vmemA mem, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() == MaxVectorSize); + match(Set mem (StoreVectorMasked mem (Binary src pg))); + ins_cost(4 * SVE_COST); + format %{ "sve_str $mem, $pg, $src\t# store vector predicated (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($src$$reg), + as_PRegister($pg$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +instruct storeV_masked_partial(vReg src, vmemA mem, pRegGov pg, pRegGov pgtmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() < MaxVectorSize); + match(Set mem (StoreVectorMasked mem (Binary src pg))); + effect(TEMP pgtmp, KILL cr); + ins_cost(6 * SVE_COST); + format %{ "sve_str $mem, $pg, $src\t# store vector predicated partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), + Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($pgtmp$$reg), as_PRegister($pgtmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($src$$reg), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); %} ins_pipe(pipe_slow); %} +// maskAll + +instruct vmaskAll_immI(pRegGov dst, immI src) %{ + predicate(UseSVE > 0); + match(Set dst (MaskAll src)); + ins_cost(SVE_COST); + format %{ "sve_ptrue/sve_pfalse $dst\t# mask all (sve) (B/H/S)" %} + ins_encode %{ + int con = (int)$src$$constant; + if (con == 0) { + __ sve_pfalse(as_PRegister($dst$$reg)); + } else { + assert(con == -1, "invalid constant value for mask"); + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_ptrue(as_PRegister($dst$$reg), __ elemType_to_regVariant(bt)); + } + %} + ins_pipe(pipe_slow); +%} + +instruct vmaskAllI(pRegGov dst, iRegIorL2I src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0); + match(Set dst (MaskAll src)); + effect(TEMP tmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_dup $tmp, $src\n\t" + "sve_cmpne $dst, $tmp, 0\t# mask all (sve) (B/H/S)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_dup(as_FloatRegister($tmp$$reg), size, as_Register($src$$reg)); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($tmp$$reg), 0); + %} + ins_pipe(pipe_slow); +%} + +instruct vmaskAll_immL(pRegGov dst, immL src) %{ + predicate(UseSVE > 0); + match(Set dst (MaskAll src)); + ins_cost(SVE_COST); + format %{ "sve_ptrue/sve_pfalse $dst\t# mask all (sve) (D)" %} + ins_encode %{ + long con = (long)$src$$constant; + if (con == 0) { + __ sve_pfalse(as_PRegister($dst$$reg)); + } else { + assert(con == -1, "invalid constant value for mask"); + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_ptrue(as_PRegister($dst$$reg), __ elemType_to_regVariant(bt)); + } + %} + ins_pipe(pipe_slow); +%} + +instruct vmaskAllL(pRegGov dst, iRegL src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0); + match(Set dst (MaskAll src)); + effect(TEMP tmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_dup $tmp, $src\n\t" + "sve_cmpne $dst, $tmp, 0\t# mask all (sve) (D)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_dup(as_FloatRegister($tmp$$reg), size, as_Register($src$$reg)); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($tmp$$reg), 0); + %} + ins_pipe(pipe_slow); +%} + +// mask logical and/or/xor + +instruct vmask_and(pRegGov pd, pRegGov pn, pRegGov pm) %{ + predicate(UseSVE > 0); + match(Set pd (AndVMask pn pm)); + ins_cost(SVE_COST); + format %{ "sve_and $pd, $pn, $pm\t# predicate (sve)" %} + ins_encode %{ + __ sve_and(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmask_or(pRegGov pd, pRegGov pn, pRegGov pm) %{ + predicate(UseSVE > 0); + match(Set pd (OrVMask pn pm)); + ins_cost(SVE_COST); + format %{ "sve_orr $pd, $pn, $pm\t# predicate (sve)" %} + ins_encode %{ + __ sve_orr(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmask_xor(pRegGov pd, pRegGov pn, pRegGov pm) %{ + predicate(UseSVE > 0); + match(Set pd (XorVMask pn pm)); + ins_cost(SVE_COST); + format %{ "sve_eor $pd, $pn, $pm\t# predicate (sve)" %} + ins_encode %{ + __ sve_eor(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// mask logical and_not + +instruct vmask_and_notI(pRegGov pd, pRegGov pn, pRegGov pm, immI_M1 m1) %{ + predicate(UseSVE > 0); + match(Set pd (AndVMask pn (XorVMask pm (MaskAll m1)))); + ins_cost(SVE_COST); + format %{ "sve_bic $pd, $pn, $pm\t# predciate (sve) (B/H/S)" %} + ins_encode %{ + __ sve_bic(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmask_and_notL(pRegGov pd, pRegGov pn, pRegGov pm, immL_M1 m1) %{ + predicate(UseSVE > 0); + match(Set pd (AndVMask pn (XorVMask pm (MaskAll m1)))); + ins_cost(SVE_COST); + format %{ "sve_bic $pd, $pn, $pm\t# predciate (sve) (D)" %} + ins_encode %{ + __ sve_bic(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector reinterpret instruct reinterpret(vReg dst) %{ @@ -348,11 +559,11 @@ instruct reinterpret(vReg dst) %{ ins_pipe(pipe_class_empty); %} -instruct reinterpretResize(vReg dst, vReg src, pRegGov pTmp, rFlagsReg cr) %{ +instruct reinterpretResize(vReg dst, vReg src, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length_in_bytes() != n->in(1)->bottom_type()->is_vect()->length_in_bytes()); // src != dst match(Set dst (VectorReinterpret src)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(3 * SVE_COST); format %{ "reinterpretResize $dst, $src\t# vector (sve)" %} ins_encode %{ @@ -362,19 +573,53 @@ instruct reinterpretResize(vReg dst, vReg src, pRegGov pTmp, rFlagsReg cr) %{ length_in_bytes_src : length_in_bytes_dst; assert(length_in_bytes_src <= MaxVectorSize && length_in_bytes_dst <= MaxVectorSize, "invalid vector length"); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ B, length_in_bytes_resize); + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ B, length_in_bytes_resize); __ sve_dup(as_FloatRegister($dst$$reg), __ B, 0); - __ sve_sel(as_FloatRegister($dst$$reg), __ B, as_PRegister($pTmp$$reg), + __ sve_sel(as_FloatRegister($dst$$reg), __ B, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), as_FloatRegister($dst$$reg)); %} ins_pipe(pipe_slow); %} +// vector mask reinterpret + +instruct vmask_reinterpret_same_esize(pRegGov dst_src) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length() == n->in(1)->bottom_type()->is_vect()->length() && + n->as_Vector()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); + match(Set dst_src (VectorReinterpret dst_src)); + ins_cost(0); + format %{ "# vmask_reinterpret $dst_src\t# do nothing" %} + ins_encode %{ + // empty + %} + ins_pipe(pipe_class_empty); +%} + +instruct vmask_reinterpret_diff_esize(pRegGov dst, pRegGov src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length() != n->in(1)->bottom_type()->is_vect()->length() && + n->as_Vector()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); + match(Set dst (VectorReinterpret src)); + effect(TEMP tmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "# vmask_reinterpret $dst, $src\t# vector (sve)" %} + ins_encode %{ + BasicType from_bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant from_size = __ elemType_to_regVariant(from_bt); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_cpy(as_FloatRegister($tmp$$reg), from_size, as_PRegister($src$$reg), -1, false); + __ sve_cmp(Assembler::EQ, as_PRegister($dst$$reg), to_size, ptrue, as_FloatRegister($tmp$$reg), -1); + %} + ins_pipe(pipe_slow); +%} + // vector abs instruct vabsB(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + !n->as_Vector()->is_predicated_vector()); match(Set dst (AbsVB src)); ins_cost(SVE_COST); format %{ "sve_abs $dst, $src\t# vector (sve) (B)" %} @@ -387,7 +632,7 @@ instruct vabsB(vReg dst, vReg src) %{ instruct vabsS(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + !n->as_Vector()->is_predicated_vector()); match(Set dst (AbsVS src)); ins_cost(SVE_COST); format %{ "sve_abs $dst, $src\t# vector (sve) (H)" %} @@ -400,7 +645,7 @@ instruct vabsS(vReg dst, vReg src) %{ instruct vabsI(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_INT); + !n->as_Vector()->is_predicated_vector()); match(Set dst (AbsVI src)); ins_cost(SVE_COST); format %{ "sve_abs $dst, $src\t# vector (sve) (S)" %} @@ -413,7 +658,7 @@ instruct vabsI(vReg dst, vReg src) %{ instruct vabsL(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_LONG); + !n->as_Vector()->is_predicated_vector()); match(Set dst (AbsVL src)); ins_cost(SVE_COST); format %{ "sve_abs $dst, $src\t# vector (sve) (D)" %} @@ -426,7 +671,7 @@ instruct vabsL(vReg dst, vReg src) %{ instruct vabsF(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + !n->as_Vector()->is_predicated_vector()); match(Set dst (AbsVF src)); ins_cost(SVE_COST); format %{ "sve_fabs $dst, $src\t# vector (sve) (S)" %} @@ -439,7 +684,7 @@ instruct vabsF(vReg dst, vReg src) %{ instruct vabsD(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); + !n->as_Vector()->is_predicated_vector()); match(Set dst (AbsVD src)); ins_cost(SVE_COST); format %{ "sve_fabs $dst, $src\t# vector (sve) (D)" %} @@ -450,6 +695,86 @@ instruct vabsD(vReg dst, vReg src) %{ ins_pipe(pipe_slow); %} +// vector abs - predicated + +instruct vabsB_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (AbsVB dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_abs $dst_src, $pg, $dst_src\t# vector (sve) (B)" %} + ins_encode %{ + __ sve_abs(as_FloatRegister($dst_src$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vabsS_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (AbsVS dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_abs $dst_src, $pg, $dst_src\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_abs(as_FloatRegister($dst_src$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vabsI_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (AbsVI dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_abs $dst_src, $pg, $dst_src\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_abs(as_FloatRegister($dst_src$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vabsL_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (AbsVL dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_abs $dst_src, $pg, $dst_src\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_abs(as_FloatRegister($dst_src$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vabsF_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (AbsVF dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_fabs $dst_src, $pg, $dst_src\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fabs(as_FloatRegister($dst_src$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vabsD_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (AbsVD dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_fabs $dst_src, $pg, $dst_src\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fabs(as_FloatRegister($dst_src$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector add instruct vaddB(vReg dst, vReg src1, vReg src2) %{ @@ -530,6 +855,86 @@ instruct vaddD(vReg dst, vReg src1, vReg src2) %{ ins_pipe(pipe_slow); %} +// vector add - predicated + +instruct vaddB_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (AddVB (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (B)" %} + ins_encode %{ + __ sve_add(as_FloatRegister($dst_src1$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vaddS_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (AddVS (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_add(as_FloatRegister($dst_src1$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vaddI_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (AddVI (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_add(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vaddL_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (AddVL (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_add(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vaddF_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (AddVF (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fadd $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fadd(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vaddD_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (AddVD (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fadd $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fadd(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector and instruct vand(vReg dst, vReg src1, vReg src2) %{ @@ -575,44 +980,94 @@ instruct vxor(vReg dst, vReg src1, vReg src2) %{ ins_pipe(pipe_slow); %} -// vector not +// vector and - predicated -instruct vnotI(vReg dst, vReg src, immI_M1 m1) %{ +instruct vand_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (XorV src (ReplicateB m1))); - match(Set dst (XorV src (ReplicateS m1))); - match(Set dst (XorV src (ReplicateI m1))); + match(Set dst_src1 (AndV (Binary dst_src1 src2) pg)); ins_cost(SVE_COST); - format %{ "sve_not $dst, $src\t# vector (sve) B/H/S" %} + format %{ "sve_and $dst_src1, $pg, $dst_src1, $src2\t # vector (sve)" %} ins_encode %{ - __ sve_not(as_FloatRegister($dst$$reg), __ D, - ptrue, as_FloatRegister($src$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_and(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct vnotL(vReg dst, vReg src, immL_M1 m1) %{ +// vector or - predicated + +instruct vor_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (XorV src (ReplicateL m1))); + match(Set dst_src1 (OrV (Binary dst_src1 src2) pg)); ins_cost(SVE_COST); - format %{ "sve_not $dst, $src\t# vector (sve) D" %} + format %{ "sve_orr $dst_src1, $pg, $dst_src1, $src2\t # vector (sve)" %} ins_encode %{ - __ sve_not(as_FloatRegister($dst$$reg), __ D, - ptrue, as_FloatRegister($src$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_orr(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} +// vector xor - predicated -// vector and_not - -instruct vand_notI(vReg dst, vReg src1, vReg src2, immI_M1 m1) %{ +instruct vxor_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (AndV src1 (XorV src2 (ReplicateB m1)))); - match(Set dst (AndV src1 (XorV src2 (ReplicateS m1)))); - match(Set dst (AndV src1 (XorV src2 (ReplicateI m1)))); + match(Set dst_src1 (XorV (Binary dst_src1 src2) pg)); ins_cost(SVE_COST); - format %{ "sve_bic $dst, $src1, $src2\t# vector (sve) B/H/S" %} + format %{ "sve_eor $dst_src1, $pg, $dst_src1, $src2\t # vector (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_eor(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector not + +instruct vnotI(vReg dst, vReg src, immI_M1 m1) %{ + predicate(UseSVE > 0); + match(Set dst (XorV src (ReplicateB m1))); + match(Set dst (XorV src (ReplicateS m1))); + match(Set dst (XorV src (ReplicateI m1))); + ins_cost(SVE_COST); + format %{ "sve_not $dst, $src\t# vector (sve) B/H/S" %} + ins_encode %{ + __ sve_not(as_FloatRegister($dst$$reg), __ D, + ptrue, as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vnotL(vReg dst, vReg src, immL_M1 m1) %{ + predicate(UseSVE > 0); + match(Set dst (XorV src (ReplicateL m1))); + ins_cost(SVE_COST); + format %{ "sve_not $dst, $src\t# vector (sve) D" %} + ins_encode %{ + __ sve_not(as_FloatRegister($dst$$reg), __ D, + ptrue, as_FloatRegister($src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector and_not + +instruct vand_notI(vReg dst, vReg src1, vReg src2, immI_M1 m1) %{ + predicate(UseSVE > 0); + match(Set dst (AndV src1 (XorV src2 (ReplicateB m1)))); + match(Set dst (AndV src1 (XorV src2 (ReplicateS m1)))); + match(Set dst (AndV src1 (XorV src2 (ReplicateI m1)))); + ins_cost(SVE_COST); + format %{ "sve_bic $dst, $src1, $src2\t# vector (sve) B/H/S" %} ins_encode %{ __ sve_bic(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), @@ -634,7 +1089,6 @@ instruct vand_notL(vReg dst, vReg src1, vReg src2, immL_M1 m1) %{ ins_pipe(pipe_slow); %} - // vector float div instruct vdivF(vReg dst_src1, vReg src2) %{ @@ -661,6 +1115,34 @@ instruct vdivD(vReg dst_src1, vReg src2) %{ ins_pipe(pipe_slow); %} +// vector float div - predicated + +instruct vfdivF_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (DivVF (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fdiv $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fdiv(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vfdivD_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (DivVD (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fdiv $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fdiv(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector min/max instruct vmin(vReg dst_src1, vReg src2) %{ @@ -675,7 +1157,7 @@ instruct vmin(vReg dst_src1, vReg src2) %{ __ sve_fmin(as_FloatRegister($dst_src1$$reg), size, ptrue, as_FloatRegister($src2$$reg)); } else { - assert(is_integral_type(bt), "Unsupported type"); + assert(is_integral_type(bt), "unsupported type"); __ sve_smin(as_FloatRegister($dst_src1$$reg), size, ptrue, as_FloatRegister($src2$$reg)); } @@ -695,7 +1177,7 @@ instruct vmax(vReg dst_src1, vReg src2) %{ __ sve_fmax(as_FloatRegister($dst_src1$$reg), size, ptrue, as_FloatRegister($src2$$reg)); } else { - assert(is_integral_type(bt), "Unsupported type"); + assert(is_integral_type(bt), "unsupported type"); __ sve_smax(as_FloatRegister($dst_src1$$reg), size, ptrue, as_FloatRegister($src2$$reg)); } @@ -703,6 +1185,48 @@ instruct vmax(vReg dst_src1, vReg src2) %{ ins_pipe(pipe_slow); %} +// vector min/max - predicated + +instruct vmin_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MinV (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_min $dst_src1, $pg, $dst_src1, $src2\t# vector (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + if (is_floating_point_type(bt)) { + __ sve_fmin(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + } else { + assert(is_integral_type(bt), "unsupported type"); + __ sve_smin(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + } + %} + ins_pipe(pipe_slow); +%} + +instruct vmax_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MaxV (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_max $dst_src1, $pg, $dst_src1, $src2\t# vector (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + if (is_floating_point_type(bt)) { + __ sve_fmax(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + } else { + assert(is_integral_type(bt), "unsupported type"); + __ sve_smax(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + } + %} + ins_pipe(pipe_slow); +%} + // vector fmla // dst_src1 = dst_src1 + src2 * src3 @@ -731,6 +1255,34 @@ instruct vfmlaD(vReg dst_src1, vReg src2, vReg src3) %{ ins_pipe(pipe_slow); %} +// vector fmla - predicated + +// dst_src1 = dst_src1 * src2 + src3 +instruct vfmlaF_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ + predicate(UseFMA && UseSVE > 0); + match(Set dst_src1 (FmaVF (Binary dst_src1 src2) (Binary src3 pg))); + ins_cost(SVE_COST); + format %{ "sve_fmad $dst_src1, $pg, $src2, $src3\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fmad(as_FloatRegister($dst_src1$$reg), __ S, as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg), as_FloatRegister($src3$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// dst_src1 = dst_src1 * src2 + src3 +instruct vfmlaD_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ + predicate(UseFMA && UseSVE > 0); + match(Set dst_src1 (FmaVD (Binary dst_src1 src2) (Binary src3 pg))); + ins_cost(SVE_COST); + format %{ "sve_fmad $dst_src1, $pg, $src2, $src3\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fmad(as_FloatRegister($dst_src1$$reg), __ D, as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg), as_FloatRegister($src3$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector fmls // dst_src1 = dst_src1 + -src2 * src3 @@ -939,7 +1491,6 @@ instruct vmlsL(vReg dst_src1, vReg src2, vReg src3) ins_pipe(pipe_slow); %} - // vector mul instruct vmulB(vReg dst_src1, vReg src2) %{ @@ -1016,10 +1567,91 @@ instruct vmulD(vReg dst, vReg src1, vReg src2) %{ ins_pipe(pipe_slow); %} +// vector mul - predicated + +instruct vmulB_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MulVB (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_mul $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (B)" %} + ins_encode %{ + __ sve_mul(as_FloatRegister($dst_src1$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmulS_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MulVS (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_mul $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_mul(as_FloatRegister($dst_src1$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmulI_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MulVI (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_mul $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_mul(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmulL_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MulVL (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_mul $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_mul(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmulF_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MulVF (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fmul $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fmul(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmulD_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (MulVD (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fmul $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fmul(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector fneg instruct vnegF(vReg dst, vReg src) %{ - predicate(UseSVE > 0); + predicate(UseSVE > 0 && + !n->as_Vector()->is_predicated_vector()); match(Set dst (NegVF src)); ins_cost(SVE_COST); format %{ "sve_fneg $dst, $src\t# vector (sve) (S)" %} @@ -1031,7 +1663,8 @@ instruct vnegF(vReg dst, vReg src) %{ %} instruct vnegD(vReg dst, vReg src) %{ - predicate(UseSVE > 0); + predicate(UseSVE > 0 && + !n->as_Vector()->is_predicated_vector()); match(Set dst (NegVD src)); ins_cost(SVE_COST); format %{ "sve_fneg $dst, $src\t# vector (sve) (D)" %} @@ -1042,6 +1675,34 @@ instruct vnegD(vReg dst, vReg src) %{ ins_pipe(pipe_slow); %} +// vector fneg - predicated + +instruct vnegF_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (NegVF dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_fneg $dst_src, $pg, $dst_src\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fneg(as_FloatRegister($dst_src$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vnegD_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (NegVD dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_fneg $dst_src, $pg, $dst_src\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fneg(as_FloatRegister($dst_src$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + // popcount vector instruct vpopcountI(vReg dst, vReg src) %{ @@ -1056,260 +1717,171 @@ instruct vpopcountI(vReg dst, vReg src) %{ // vector mask compare -instruct vmaskcmp(vReg dst, vReg src1, vReg src2, immI cond, pRegGov pTmp, rFlagsReg cr) %{ +instruct vmaskcmp(pRegGov dst, vReg src1, vReg src2, immI cond, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); - effect(TEMP pTmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "sve_cmp $pTmp, $src1, $src2\n\t" - "sve_cpy $dst, $pTmp, -1\t# vector mask cmp (sve)" %} + effect(KILL cr); + ins_cost(SVE_COST); + format %{ "sve_cmp $dst, $src1, $src2\t# vector mask cmp (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_compare(as_PRegister($pTmp$$reg), bt, ptrue, as_FloatRegister($src1$$reg), + __ sve_compare(as_PRegister($dst$$reg), bt, ptrue, as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), (int)$cond$$constant); - __ sve_cpy(as_FloatRegister($dst$$reg), __ elemType_to_regVariant(bt), - as_PRegister($pTmp$$reg), -1, false); %} ins_pipe(pipe_slow); %} -// vector blend - -instruct vblend(vReg dst, vReg src1, vReg src2, vReg src3, pRegGov pTmp, rFlagsReg cr) %{ +instruct vmaskcmp_masked(pRegGov dst, vReg src1, vReg src2, immI cond, pRegGov pg, rFlagsReg cr) %{ predicate(UseSVE > 0); - match(Set dst (VectorBlend (Binary src1 src2) src3)); - effect(TEMP pTmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "sve_cmpeq $pTmp, $src3, -1\n\t" - "sve_sel $dst, $pTmp, $src2, $src1\t# vector blend (sve)" %} + match(Set dst (VectorMaskCmp (Binary src1 src2) (Binary cond pg))); + effect(KILL cr); + ins_cost(SVE_COST); + format %{ "sve_cmp $dst, $pg, $src1, $src2\t# vector mask cmp (sve)" %} ins_encode %{ - Assembler::SIMD_RegVariant size = - __ elemType_to_regVariant(Matcher::vector_element_basic_type(this)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - ptrue, as_FloatRegister($src3$$reg), -1); - __ sve_sel(as_FloatRegister($dst$$reg), size, as_PRegister($pTmp$$reg), - as_FloatRegister($src2$$reg), as_FloatRegister($src1$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_compare(as_PRegister($dst$$reg), bt, as_PRegister($pg$$reg), as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg), (int)$cond$$constant); %} ins_pipe(pipe_slow); %} -// vector blend with compare +// vector blend -instruct vblend_maskcmp(vReg dst, vReg src1, vReg src2, vReg src3, - vReg src4, pRegGov pTmp, immI cond, rFlagsReg cr) %{ +instruct vblend(vReg dst, vReg src1, vReg src2, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (VectorBlend (Binary src1 src2) (VectorMaskCmp (Binary src3 src4) cond))); - effect(TEMP pTmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "sve_cmp $pTmp, $src3, $src4\t# vector cmp (sve)\n\t" - "sve_sel $dst, $pTmp, $src2, $src1\t# vector blend (sve)" %} + match(Set dst (VectorBlend (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_sel $dst, $pg, $src2, $src1\t# vector blend (sve)" %} ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_compare(as_PRegister($pTmp$$reg), bt, ptrue, as_FloatRegister($src3$$reg), - as_FloatRegister($src4$$reg), (int)$cond$$constant); - __ sve_sel(as_FloatRegister($dst$$reg), __ elemType_to_regVariant(bt), - as_PRegister($pTmp$$reg), as_FloatRegister($src2$$reg), - as_FloatRegister($src1$$reg)); + Assembler::SIMD_RegVariant size = + __ elemType_to_regVariant(Matcher::vector_element_basic_type(this)); + __ sve_sel(as_FloatRegister($dst$$reg), size, as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %} // vector load mask -instruct vloadmaskB(vReg dst, vReg src) %{ +instruct vloadmaskB(pRegGov dst, vReg src, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); match(Set dst (VectorLoadMask src)); + effect(KILL cr); ins_cost(SVE_COST); - format %{ "sve_neg $dst, $src\t# vector load mask (B)" %} - ins_encode %{ - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, as_FloatRegister($src$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vloadmaskS(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorLoadMask src)); - ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_neg $dst, $dst\t# vector load mask (B to H)" %} + format %{ "vloadmaskB $dst, $src\t# vector load mask (sve) (B)" %} ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ H, ptrue, as_FloatRegister($dst$$reg)); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), __ B, + ptrue, as_FloatRegister($src$$reg), 0); %} ins_pipe(pipe_slow); %} -instruct vloadmaskI(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_INT || - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); +instruct vloadmask_extend(pRegGov dst, vReg src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() != T_BYTE); match(Set dst (VectorLoadMask src)); + effect(TEMP tmp, KILL cr); ins_cost(3 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\n\t" - "sve_neg $dst, $dst\t# vector load mask (B to S)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vloadmaskL(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); - match(Set dst (VectorLoadMask src)); - ins_cost(4 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\n\t" - "sve_uunpklo $dst, D, $dst\n\t" - "sve_neg $dst, $dst\t# vector load mask (B to D)" %} + format %{ "vloadmask $dst, $src\t# vector load mask (sve) (H/S/D)" %} ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_vector_extend(as_FloatRegister($tmp$$reg), size, as_FloatRegister($src$$reg), __ B); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($tmp$$reg), 0); %} ins_pipe(pipe_slow); %} // vector store mask -instruct vstoremaskB(vReg dst, vReg src, immI_1 size) %{ +instruct vstoremaskB(vReg dst, pRegGov src, immI_1 size) %{ predicate(UseSVE > 0); match(Set dst (VectorStoreMask src size)); ins_cost(SVE_COST); - format %{ "sve_neg $dst, $src\t# vector store mask (B)" %} + format %{ "vstoremask $dst, $src\t# vector store mask (sve) (B)" %} ins_encode %{ - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($src$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ B, as_PRegister($src$$reg), 1, false); %} ins_pipe(pipe_slow); %} -instruct vstoremaskS(vReg dst, vReg src, vReg tmp, immI_2 size) %{ +instruct vstoremask_narrow(vReg dst, pRegGov src, vReg tmp, immI_gt_1 size) %{ predicate(UseSVE > 0); match(Set dst (VectorStoreMask src size)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_dup $tmp, H, 0\n\t" - "sve_uzp1 $dst, B, $src, $tmp\n\t" - "sve_neg $dst, B, $dst\t# vector store mask (sve) (H to B)" %} - ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ H, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($dst$$reg)); - - %} - ins_pipe(pipe_slow); -%} - -instruct vstoremaskI(vReg dst, vReg src, vReg tmp, immI_4 size) %{ - predicate(UseSVE > 0); - match(Set dst (VectorStoreMask src size)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, H, $src, $tmp\n\t" - "sve_uzp1 $dst, B, $dst, $tmp\n\t" - "sve_neg $dst, B, $dst\t# vector store mask (sve) (S to B)" %} + format %{ "vstoremask $dst, $src\t# vector store mask (sve) (H/S/D)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, - as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($dst$$reg)); + Assembler::SIMD_RegVariant size = __ elemBytes_to_regVariant((int)$size$$constant); + __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($src$$reg), 1, false); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($dst$$reg), size, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct vstoremaskL(vReg dst, vReg src, vReg tmp, immI_8 size) %{ - predicate(UseSVE > 0); - match(Set dst (VectorStoreMask src size)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_dup $tmp, D, 0\n\t" - "sve_uzp1 $dst, S, $src, $tmp\n\t" - "sve_uzp1 $dst, H, $dst, $tmp\n\t" - "sve_uzp1 $dst, B, $dst, $tmp\n\t" - "sve_neg $dst, B, $dst\t# vector store mask (sve) (D to B)" %} - ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ D, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, - as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, - as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} +// Combine LoadVector+VectorLoadMask when the vector element type is not T_BYTE -// load/store mask vector - -instruct vloadmask_loadV_byte(vReg dst, vmemA mem) %{ - predicate(UseSVE > 0 && n->as_Vector()->length_in_bytes() == MaxVectorSize && - type2aelembytes(n->bottom_type()->is_vect()->element_basic_type()) == 1); +instruct vloadmask_loadV(pRegGov dst, indirect mem, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length_in_bytes() == MaxVectorSize && + type2aelembytes(n->bottom_type()->is_vect()->element_basic_type()) > 1); match(Set dst (VectorLoadMask (LoadVector mem))); - ins_cost(5 * SVE_COST); - format %{ "sve_ld1b $dst, $mem\n\t" - "sve_neg $dst, $dst\t# load vector mask (sve)" %} + effect(TEMP tmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_ld1b $tmp, $mem\n\t" + "sve_cmpne $dst, $tmp, 0\t# load vector mask (sve) (H/S/D)" %} ins_encode %{ - FloatRegister dst_reg = as_FloatRegister($dst$$reg); + // Load mask values which are boolean type, and extend them to the + // expected vector element type. Convert the vector to predicate. BasicType to_vect_bt = Matcher::vector_element_basic_type(this); - Assembler::SIMD_RegVariant to_vect_variant = __ elemType_to_regVariant(to_vect_bt); - loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, dst_reg, ptrue, - T_BOOLEAN, to_vect_bt, $mem->opcode(), + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($tmp$$reg), + ptrue, T_BOOLEAN, to_vect_bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); - __ sve_neg(dst_reg, to_vect_variant, ptrue, dst_reg); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), __ elemType_to_regVariant(to_vect_bt), + ptrue, as_FloatRegister($tmp$$reg), 0); %} ins_pipe(pipe_slow); %} -instruct vloadmask_loadV_non_byte(vReg dst, indirect mem) %{ - predicate(UseSVE > 0 && n->as_Vector()->length_in_bytes() == MaxVectorSize && +instruct vloadmask_loadV_partial(pRegGov dst, indirect mem, vReg vtmp, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length_in_bytes() > 16 && + n->as_Vector()->length_in_bytes() < MaxVectorSize && type2aelembytes(n->bottom_type()->is_vect()->element_basic_type()) > 1); match(Set dst (VectorLoadMask (LoadVector mem))); - ins_cost(5 * SVE_COST); - format %{ "sve_ld1b $dst, $mem\n\t" - "sve_neg $dst, $dst\t# load vector mask (sve)" %} + effect(TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(6 * SVE_COST); + format %{ "vloadmask_loadV $dst, $mem\t# load vector mask partial (sve) (H/S/D)" %} ins_encode %{ - FloatRegister dst_reg = as_FloatRegister($dst$$reg); + // Load valid mask values which are boolean type, and extend them to the + // expected vector element type. Convert the vector to predicate. BasicType to_vect_bt = Matcher::vector_element_basic_type(this); - Assembler::SIMD_RegVariant to_vect_variant = __ elemType_to_regVariant(to_vect_bt); - loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, dst_reg, ptrue, - T_BOOLEAN, to_vect_bt, $mem->opcode(), + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(to_vect_bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($vtmp$$reg), + as_PRegister($ptmp$$reg), T_BOOLEAN, to_vect_bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); - __ sve_neg(dst_reg, to_vect_variant, ptrue, dst_reg); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($vtmp$$reg), 0); %} ins_pipe(pipe_slow); %} -instruct storeV_vstoremask_byte(vmemA mem, vReg src, vReg tmp, immI_1 esize) %{ - predicate(UseSVE > 0 && n->as_StoreVector()->memory_size() * - n->as_StoreVector()->in(MemNode::ValueIn)->in(2)->get_int() == MaxVectorSize); +// Combine VectorStoreMask+StoreVector when the vector element type is not T_BYTE + +instruct storeV_vstoremask(indirect mem, pRegGov src, vReg tmp, immI_gt_1 esize) %{ + predicate(UseSVE > 0 && + Matcher::vector_length_in_bytes(n->as_StoreVector()->in(MemNode::ValueIn)->in(1)) == MaxVectorSize); match(Set mem (StoreVector mem (VectorStoreMask src esize))); effect(TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_neg $tmp, $src\n\t" - "sve_st1b $tmp, $mem\t# store vector mask (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_cpy $tmp, $src, 1\n\t" + "sve_st1b $tmp, $mem\t# store vector mask (sve) (H/S/D)" %} ins_encode %{ BasicType from_vect_bt = Matcher::vector_element_basic_type(this, $src); assert(type2aelembytes(from_vect_bt) == (int)$esize$$constant, "unsupported type."); - Assembler::SIMD_RegVariant from_vect_variant = __ elemBytes_to_regVariant($esize$$constant); - __ sve_neg(as_FloatRegister($tmp$$reg), from_vect_variant, ptrue, - as_FloatRegister($src$$reg)); + Assembler::SIMD_RegVariant size = __ elemBytes_to_regVariant($esize$$constant); + __ sve_cpy(as_FloatRegister($tmp$$reg), size, as_PRegister($src$$reg), 1, false); loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($tmp$$reg), ptrue, T_BOOLEAN, from_vect_bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); @@ -1317,22 +1889,25 @@ instruct storeV_vstoremask_byte(vmemA mem, vReg src, vReg tmp, immI_1 esize) %{ ins_pipe(pipe_slow); %} -instruct storeV_vstoremask_non_byte(indirect mem, vReg src, vReg tmp, immI_gt_1 esize) %{ - predicate(UseSVE > 0 && n->as_StoreVector()->memory_size() * - n->as_StoreVector()->in(MemNode::ValueIn)->in(2)->get_int() == MaxVectorSize); +instruct storeV_vstoremask_partial(indirect mem, pRegGov src, vReg vtmp, + immI_gt_1 esize, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() > 16 && + type2aelembytes(n->as_StoreVector()->vect_type()->element_basic_type()) > 1 && + Matcher::vector_length_in_bytes(n->as_StoreVector()->in(MemNode::ValueIn)->in(1)) < MaxVectorSize); match(Set mem (StoreVector mem (VectorStoreMask src esize))); - effect(TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_neg $tmp, $src\n\t" - "sve_st1b $tmp, $mem\t# store vector mask (sve)" %} + effect(TEMP vtmp, TEMP ptmp, KILL cr); + format %{ "storeV_vstoremask $src, $mem\t# store vector mask partial (sve) (H/S/D)" %} + ins_cost(6 * SVE_COST); ins_encode %{ + // Convert the valid src predicate to vector, and store the vector + // elements as boolean values. BasicType from_vect_bt = Matcher::vector_element_basic_type(this, $src); - assert(type2aelembytes(from_vect_bt) == (int)$esize$$constant, "unsupported type."); - Assembler::SIMD_RegVariant from_vect_variant = __ elemBytes_to_regVariant($esize$$constant); - __ sve_neg(as_FloatRegister($tmp$$reg), from_vect_variant, ptrue, - as_FloatRegister($src$$reg)); - loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($tmp$$reg), - ptrue, T_BOOLEAN, from_vect_bt, $mem->opcode(), + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(from_vect_bt); + __ sve_cpy(as_FloatRegister($vtmp$$reg), size, as_PRegister($src$$reg), 1, false); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($vtmp$$reg), + as_PRegister($ptmp$$reg), T_BOOLEAN, from_vect_bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); %} ins_pipe(pipe_slow); @@ -1340,137 +1915,264 @@ instruct storeV_vstoremask_non_byte(indirect mem, vReg src, vReg tmp, immI_gt_1 // vector add reduction -instruct reduce_addI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); +instruct reduce_addI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (AddReductionVI src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_addI $dst, $src1, $src2\t# addB/S/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_addI $dst, $src1, $src2\t# addI reduction (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_uaddv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ addw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (AddReductionVL src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_addL $dst, $src1, $src2\t# addL reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addF(vRegF src1_dst, vReg src2) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set src1_dst (AddReductionVF src1_dst src2)); + ins_cost(SVE_COST); + format %{ "sve_fadda $src1_dst, $src1_dst, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ S, + ptrue, as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addD(vRegD src1_dst, vReg src2) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set src1_dst (AddReductionVD src1_dst src2)); + ins_cost(SVE_COST); + format %{ "sve_fadda $src1_dst, $src1_dst, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ D, + ptrue, as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_addI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (AddReductionVI src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); + ins_cost(2 * SVE_COST); format %{ "sve_reduce_addI $dst, $src1, $src2\t# addI reduction partial (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_uaddv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ addw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_addL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); +instruct reduce_addL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (AddReductionVL src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_addL $dst, $src1, $src2\t# addL reduction partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addF_partial(vRegF src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set src1_dst (AddReductionVF src1_dst src2)); ins_cost(SVE_COST); - format %{ "sve_reduce_addL $dst, $src1, $src2\t# addL reduction (sve)" %} + effect(TEMP ptmp, KILL cr); + format %{ "sve_reduce_addF $src1_dst, $src1_dst, $src2\t# addF reduction partial (sve) (S)" %} ins_encode %{ - __ sve_uaddv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ add($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, + Matcher::vector_length(this, $src2)); + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ S, + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_addL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (AddReductionVL src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); +instruct reduce_addD_partial(vRegD src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set src1_dst (AddReductionVD src1_dst src2)); ins_cost(SVE_COST); - format %{ "sve_reduce_addL $dst, $src1, $src2\t# addL reduction partial (sve)" %} + effect(TEMP ptmp, KILL cr); + format %{ "sve_reduce_addD $src1_dst, $src1_dst, $src2\t# addD reduction partial (sve) (D)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_uaddv(as_FloatRegister($vtmp$$reg), __ D, + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ D, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ add($dst$$Register, $dst$$Register, $src1$$Register); %} ins_pipe(pipe_slow); %} +// vector add reduction - predicated -instruct reduce_addF(vRegF src1_dst, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set src1_dst (AddReductionVF src1_dst src2)); +instruct reduce_addI_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (AddReductionVI (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_fadda $src1_dst, $src1_dst, $src2\t# vector (sve) (S)" %} + format %{ "sve_reduce_addI $dst, $src1, $pg, $src2\t# addI reduction predicated (sve) (may extend)" %} ins_encode %{ - __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ S, - ptrue, as_FloatRegister($src2$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_addF_partial(vRegF src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set src1_dst (AddReductionVF src1_dst src2)); +instruct reduce_addL_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (AddReductionVL (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - effect(TEMP ptmp, KILL cr); - format %{ "sve_reduce_addF $src1_dst, $src1_dst, $src2\t# addF reduction partial (sve) (S)" %} + format %{ "sve_reduce_addL $dst, $src1, $pg, $src2\t# addL reduction predicated (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addF_masked(vRegF src1_dst, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set src1_dst (AddReductionVF (Binary src1_dst src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_reduce_addF $src1_dst, $pg, $src2\t# addF reduction predicated (sve)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, - Matcher::vector_length(this, $src2)); __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ S, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_addD(vRegD src1_dst, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set src1_dst (AddReductionVD src1_dst src2)); +instruct reduce_addD_masked(vRegD src1_dst, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set src1_dst (AddReductionVD (Binary src1_dst src2) pg)); ins_cost(SVE_COST); - format %{ "sve_fadda $src1_dst, $src1_dst, $src2\t# vector (sve) (D)" %} + format %{ "sve_reduce_addD $src1_dst, $pg, $src2\t# addD reduction predicated (sve)" %} ins_encode %{ __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ D, - ptrue, as_FloatRegister($src2$$reg)); + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_addD_partial(vRegD src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set src1_dst (AddReductionVD src1_dst src2)); +instruct reduce_addI_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (AddReductionVI (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_addI $dst, $src1, $pg, $src2\t# addI reduction predicated partial (sve) (may extend)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addL_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (AddReductionVL (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_addL $dst, $src1, $pg, $src2\t# addL reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addF_masked_partial(vRegF src1_dst, vReg src2, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set src1_dst (AddReductionVF (Binary src1_dst src2) pg)); + effect(TEMP ptmp, KILL cr); ins_cost(SVE_COST); + format %{ "sve_reduce_addF $src1_dst, $pg, $src2\t# addF reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ S, + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_addD_masked_partial(vRegD src1_dst, vReg src2, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set src1_dst (AddReductionVD (Binary src1_dst src2) pg)); effect(TEMP ptmp, KILL cr); - format %{ "sve_reduce_addD $src1_dst, $src1_dst, $src2\t# addD reduction partial (sve) (D)" %} + ins_cost(SVE_COST); + format %{ "sve_reduce_addD $src1_dst, $pg, $src2\t# addD reduction predicated partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ D, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); %} @@ -1479,362 +2181,553 @@ instruct reduce_addD_partial(vRegD src1_dst, vReg src2, pRegGov ptmp, rFlagsReg // vector and reduction -instruct reduce_andI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && +instruct reduce_andI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (AndReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_andI $dst, $src1, $src2\t# andB/S/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_andI $dst, $src1, $src2\t# andI reduction (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_andv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ andw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_andL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (AndReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_andL $dst, $src1, $src2\t# andL reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_andI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (AndReductionV src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); + ins_cost(2 * SVE_COST); format %{ "sve_reduce_andI $dst, $src1, $src2\t# andI reduction partial (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_andv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ andw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_andL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); +instruct reduce_andL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (AndReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_andL $dst, $src1, $src2\t# andL reduction partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector and reduction - predicated + +instruct reduce_andI_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (AndReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_andL $dst, $src1, $src2\t# andL reduction (sve)" %} + format %{ "sve_reduce_andI $dst, $src1, $pg, $src2\t# andI reduction predicated (sve) (may extend)" %} ins_encode %{ - __ sve_andv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ andr($dst$$Register, $dst$$Register, $src1$$Register); + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_andL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (AndReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); +instruct reduce_andL_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (AndReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_andL $dst, $src1, $src2\t# andL reduction partial (sve)" %} + format %{ "sve_reduce_andL $dst, $src1, $pg, $src2\t# andL reduction predicated (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_andI_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (AndReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_andI $dst, $src1, $pg, $src2\t# andI reduction predicated partial (sve) (may extend)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_andL_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (AndReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_andL $dst, $src1, $pg, $src2\t# andL reduction predicated partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_andv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ andr($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} // vector or reduction -instruct reduce_orI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && +instruct reduce_orI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (OrReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_orI $dst, $src1, $src2\t# orB/S/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_orI $dst, $src1, $src2\t# orI reduction (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_orv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ orrw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_orL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (OrReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_orL $dst, $src1, $src2\t# orL reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_orI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (OrReductionV src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); + ins_cost(2 * SVE_COST); format %{ "sve_reduce_orI $dst, $src1, $src2\t# orI reduction partial (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_orv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ orrw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_orL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); +instruct reduce_orL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (OrReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_orL $dst, $src1, $src2\t# orL reduction partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector or reduction - predicated + +instruct reduce_orI_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (OrReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_orL $dst, $src1, $src2\t# orL reduction (sve)" %} + format %{ "sve_reduce_orI $dst, $src1, $pg, $src2\t# orI reduction predicated (sve) (may extend)" %} ins_encode %{ - __ sve_orv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ orr($dst$$Register, $dst$$Register, $src1$$Register); + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_orL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, +instruct reduce_orL_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (OrReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_orL $dst, $src1, $pg, $src2\t# orL reduction predicated (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_orI_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (OrReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_orI $dst, $src1, $pg, $src2\t# orI reduction predicated partial (sve) (may extend)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_orL_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (OrReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_orL $dst, $src1, $pg, $src2\t# orL reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector xor reduction + +instruct reduce_eorI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (XorReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_eorI $dst, $src1, $src2\t# eorI reduction (sve) (may extend)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_eorL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (XorReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_eorL $dst, $src1, $src2\t# eorL reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_eorI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (OrReductionV src1 src2)); + match(Set dst (XorReductionV src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_orL $dst, $src1, $src2\t# orL reduction partial (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_eorI $dst, $src1, $src2\t# eorI reduction partial (sve) (may extend)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_eorL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (XorReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_eorL $dst, $src1, $src2\t# eorL reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_orv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ orr($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} -// vector xor reduction +// vector xor reduction - predicated + +instruct reduce_eorI_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (XorReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_eorI $dst, $src1, $pg, $src2\t# eorI reduction predicated (sve) (may extend)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} -instruct reduce_eorI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +instruct reduce_eorL_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (XorReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_eorI $dst, $src1, $src2\t# xorB/H/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_eorL $dst, $src1, $pg, $src2\t# eorL reduction predicated (sve)" %} ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_eorv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ eorw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_eorI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); +instruct reduce_eorI_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (XorReductionV (Binary src1 src2) pg)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_eorI $dst, $src1, $src2\t# xorI reduction partial (sve) (may extend)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_eorI $dst, $src1, $pg, $src2\t# eorI reduction predicated partial (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_eorv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ eorw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } - %} - ins_pipe(pipe_slow); -%} - -instruct reduce_eorL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); - ins_cost(SVE_COST); - format %{ "sve_reduce_eorL $dst, $src1, $src2\t# xorL reduction (sve)" %} - ins_encode %{ - __ sve_eorv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ eor($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_eorL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); +instruct reduce_eorL_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (XorReductionV (Binary src1 src2) pg)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_eorL $dst, $src1, $src2\t# xorL reduction partial (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_eorL $dst, $src1, $pg, $src2\t# eorL reduction predicated partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_eorv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ eor($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} - // vector max reduction -instruct reduce_maxI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && - (n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT)); +instruct reduce_maxI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(2)->bottom_type()->is_vect()->element_basic_type())); match(Set dst (MaxReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_maxI $dst, $src1, $src2\t# reduce maxB/S/I (sve)" %} + format %{ "sve_reduce_maxI $dst, $src1, $src2\t# maxI reduction (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_smaxv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ cmpw($dst$$Register, $src1$$Register); - __ cselw(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::GT); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_maxI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && - (n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT)); +instruct reduce_maxL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (MaxReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_maxI $dst, $src1, $src2\t# reduce maxI partial (sve)" %} + format %{ "sve_reduce_maxL $dst, $src1, $src2\t# maxL reduction (sve)" %} ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, - Matcher::vector_length(this, $src2)); - __ sve_smaxv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ cmpw($dst$$Register, $src1$$Register); - __ cselw(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::GT); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_maxL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); +instruct reduce_maxI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(2)->bottom_type()->is_vect()->element_basic_type())); match(Set dst (MaxReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); - ins_cost(SVE_COST); - format %{ "sve_reduce_maxL $dst, $src1, $src2\t# reduce maxL partial (sve)" %} + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_maxI $dst, $src1, $src2\t# maxI reduction partial (sve)" %} ins_encode %{ - __ sve_smaxv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ cmp($dst$$Register, $src1$$Register); - __ csel(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::GT); + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_maxL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (MaxReductionV src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_maxL $dst, $src1, $src2\t# reduce maxL partial (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_maxL $dst, $src1, $src2\t# maxL reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_smaxv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ cmp($dst$$Register, $src1$$Register); - __ csel(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::GT); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_maxF(vRegF dst, vRegF src1, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (MaxReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst); - format %{ "sve_fmaxv $dst, $src2 # vector (sve) (S)\n\t" - "fmaxs $dst, $dst, $src1\t# max reduction F" %} + format %{ "sve_reduce_maxF $dst, $src1, $src2\t# maxF reduction (sve)" %} ins_encode %{ - __ sve_fmaxv(as_FloatRegister($dst$$reg), __ S, - ptrue, as_FloatRegister($src2$$reg)); + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src2$$reg)); __ fmaxs(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); @@ -1842,33 +2735,32 @@ instruct reduce_maxF(vRegF dst, vRegF src1, vReg src2) %{ instruct reduce_maxF_partial(vRegF dst, vRegF src1, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (MaxReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst, TEMP ptmp, KILL cr); - format %{ "sve_reduce_maxF $dst, $src1, $src2\t# reduce max S partial (sve)" %} + format %{ "sve_reduce_maxF $dst, $src1, $src2\t# maxF reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this, $src2)); - __ sve_fmaxv(as_FloatRegister($dst$$reg), __ S, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ S, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); __ fmaxs(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_maxD(vRegD dst, vRegD src1, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (MaxReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst); - format %{ "sve_fmaxv $dst, $src2 # vector (sve) (D)\n\t" - "fmaxs $dst, $dst, $src1\t# max reduction D" %} + format %{ "sve_reduce_maxD $dst, $src1, $src2\t# maxD reduction (sve)" %} ins_encode %{ - __ sve_fmaxv(as_FloatRegister($dst$$reg), __ D, - ptrue, as_FloatRegister($src2$$reg)); + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); __ fmaxd(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); @@ -1876,115 +2768,262 @@ instruct reduce_maxD(vRegD dst, vRegD src1, vReg src2) %{ instruct reduce_maxD_partial(vRegD dst, vRegD src1, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (MaxReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst, TEMP ptmp, KILL cr); - format %{ "sve_reduce_maxD $dst, $src1, $src2\t# reduce max D partial (sve)" %} + format %{ "sve_reduce_maxD $dst, $src1, $src2\t# maxD reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_fmaxv(as_FloatRegister($dst$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ D, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); __ fmaxd(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %} -// vector min reduction +// vector max reduction - predicated -instruct reduce_minI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && - (n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT)); - match(Set dst (MinReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +instruct reduce_maxI_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, + pRegGov pg, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_minI $dst, $src1, $src2\t# reduce minB/S/I (sve)" %} + format %{ "sve_reduce_maxI $dst, $src1, $pg, $src2\t# maxI reduction predicated (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_sminv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ cmpw($dst$$Register, $src1$$Register); - __ cselw(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::LT); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_minI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && - (n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT)); - match(Set dst (MinReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); +instruct reduce_maxL_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, + pRegGov pg, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_minI $dst, $src1, $src2\t# reduce minI partial (sve)" %} + format %{ "sve_reduce_maxL $dst, $src1, $pg, $src2\t# maxL reduction predicated (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_maxI_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_maxI $dst, $src1, $pg, $src2\t# maxI reduction predicated partial (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_sminv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ cmpw($dst$$Register, $src1$$Register); - __ cselw(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::LT); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_maxL_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_maxL $dst, $src1, $pg, $src2\t# maxL reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_maxF_masked(vRegF dst, vRegF src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_reduce_maxF $dst, $src1, $pg, $src2\t# maxF reduction predicated (sve)" %} + ins_encode %{ + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ S, as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + __ fmaxs(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_maxD_masked(vRegD dst, vRegD src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_reduce_maxD $dst, $src1, $pg, $src2\t# maxD reduction predicated (sve)" %} + ins_encode %{ + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ D, as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + __ fmaxd(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_maxF_masked_partial(vRegF dst, vRegF src1, vReg src2, pRegGov pg, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_maxF $dst, $src1, $pg, $src2\t# maxF reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ S, + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ fmaxs(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_maxD_masked_partial(vRegD dst, vRegD src1, vReg src2, pRegGov pg, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (MaxReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_maxD $dst, $src1, $pg, $src2\t# maxD reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_fmaxv(as_FloatRegister($dst$$reg), __ D, + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ fmaxd(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector min reduction + +instruct reduce_minI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst (MinReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); + ins_cost(SVE_COST); + format %{ "sve_reduce_minI $dst, $src1, $src2\t# minI reduction (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_minL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && +instruct reduce_minL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (MinReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_minL $dst, $src1, $src2\t# reduce minL partial (sve)" %} + format %{ "sve_reduce_minL $dst, $src1, $src2\t# minL reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst (MinReductionV src1 src2)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_minI $dst, $src1, $src2\t# minI reduction partial (sve)" %} ins_encode %{ - __ sve_sminv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ cmp($dst$$Register, $src1$$Register); - __ csel(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::LT); + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_minL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (MinReductionV src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_minL $dst, $src1, $src2\t# reduce minL partial (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_minL $dst, $src1, $src2\t# minL reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_sminv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ cmp($dst$$Register, $src1$$Register); - __ csel(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::LT); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_minF(vRegF dst, vRegF src1, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (MinReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst); - format %{ "sve_fminv $dst, $src2 # vector (sve) (S)\n\t" - "fmins $dst, $dst, $src1\t# min reduction F" %} + format %{ "sve_reduce_minF $dst, $src1, $src2\t# minF reduction (sve)" %} ins_encode %{ - __ sve_fminv(as_FloatRegister($dst$$reg), __ S, - ptrue, as_FloatRegister($src2$$reg)); + __ sve_fminv(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src2$$reg)); __ fmins(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); @@ -1992,51 +3031,203 @@ instruct reduce_minF(vRegF dst, vRegF src1, vReg src2) %{ instruct reduce_minF_partial(vRegF dst, vRegF src1, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (MinReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst, TEMP ptmp, KILL cr); - format %{ "sve_reduce_minF $dst, $src1, $src2\t# reduce min S partial (sve)" %} + format %{ "sve_reduce_minF $dst, $src1, $src2\t# minF reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this, $src2)); - __ sve_fminv(as_FloatRegister($dst$$reg), __ S, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ sve_fminv(as_FloatRegister($dst$$reg), __ S, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); __ fmins(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %} instruct reduce_minD(vRegD dst, vRegD src1, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (MinReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst); - format %{ "sve_fminv $dst, $src2 # vector (sve) (D)\n\t" - "fmins $dst, $dst, $src1\t# min reduction D" %} + format %{ "sve_reduce_minD $dst, $src1, $src2\t# minD reduction (sve)" %} ins_encode %{ - __ sve_fminv(as_FloatRegister($dst$$reg), __ D, - ptrue, as_FloatRegister($src2$$reg)); + __ sve_fminv(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); + __ fmind(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minD_partial(vRegD dst, vRegD src1, vReg src2, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (MinReductionV src1 src2)); + ins_cost(INSN_COST); + effect(TEMP_DEF dst, TEMP ptmp, KILL cr); + format %{ "sve_reduce_minD $dst, $src1, $src2\t# minD reduction partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_fminv(as_FloatRegister($dst$$reg), __ D, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ fmind(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector min reduction - predicated + +instruct reduce_minI_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, + pRegGov pg, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); + ins_cost(SVE_COST); + format %{ "sve_reduce_minI $dst, $src1, $pg, $src2\t# minI reduction predicated (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minL_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, + pRegGov pg, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); + ins_cost(SVE_COST); + format %{ "sve_reduce_minL $dst, $src1, $pg, $src2\t# minL reduction predicated (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minI_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_minI $dst, $src1, $pg, $src2\t# minI reduction predicated partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src2); + Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minL_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_minL $dst, $src1, $pg, $src2\t# minL reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minF_masked(vRegF dst, vRegF src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_reduce_minF $dst, $src1, $pg, $src2\t# minF reduction predicated (sve)" %} + ins_encode %{ + __ sve_fminv(as_FloatRegister($dst$$reg), __ S, as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + __ fmins(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minD_masked(vRegD dst, vRegD src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_reduce_minD $dst, $src1, $pg, $src2\t# minD reduction predicated (sve)" %} + ins_encode %{ + __ sve_fminv(as_FloatRegister($dst$$reg), __ D, as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); __ fmind(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %} -instruct reduce_minD_partial(vRegD dst, vRegD src1, vReg src2, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (MinReductionV src1 src2)); - ins_cost(INSN_COST); +instruct reduce_minF_masked_partial(vRegF dst, vRegF src1, vReg src2, pRegGov pg, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (MinReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_minF $dst, $src1, $pg, $src2\t# minF reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_fminv(as_FloatRegister($dst$$reg), __ S, + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ fmins(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct reduce_minD_masked_partial(vRegD dst, vRegD src1, vReg src2, pRegGov pg, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (MinReductionV (Binary src1 src2) pg)); effect(TEMP_DEF dst, TEMP ptmp, KILL cr); - format %{ "sve_reduce_minD $dst, $src1, $src2\t# reduce min D partial (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_minD $dst, $src1, $pg, $src2\t# minD reduction predicated partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); __ sve_fminv(as_FloatRegister($dst$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); __ fmind(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); @@ -2448,149 +3639,463 @@ instruct vlsrS_imm(vReg dst, vReg src, immI shift) %{ ins_pipe(pipe_slow); %} -instruct vlsrI_imm(vReg dst, vReg src, immI shift) %{ +instruct vlsrI_imm(vReg dst, vReg src, immI shift) %{ + predicate(UseSVE > 0); + match(Set dst (URShiftVI src (RShiftCntV shift))); + ins_cost(SVE_COST); + format %{ "sve_lsr $dst, $src, $shift\t# vector (sve) (S)" %} + ins_encode %{ + int con = (int)$shift$$constant; + if (con == 0) { + __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); + return; + } + __ sve_lsr(as_FloatRegister($dst$$reg), __ S, + as_FloatRegister($src$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vlsrL_imm(vReg dst, vReg src, immI shift) %{ + predicate(UseSVE > 0); + match(Set dst (URShiftVL src (RShiftCntV shift))); + ins_cost(SVE_COST); + format %{ "sve_lsr $dst, $src, $shift\t# vector (sve) (D)" %} + ins_encode %{ + int con = (int)$shift$$constant; + if (con == 0) { + __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); + return; + } + __ sve_lsr(as_FloatRegister($dst$$reg), __ D, + as_FloatRegister($src$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslB_imm(vReg dst, vReg src, immI shift) %{ + predicate(UseSVE > 0); + match(Set dst (LShiftVB src (LShiftCntV shift))); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (B)" %} + ins_encode %{ + int con = (int)$shift$$constant; + if (con >= 8) { + __ sve_eor(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); + return; + } + __ sve_lsl(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($src$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslS_imm(vReg dst, vReg src, immI shift) %{ + predicate(UseSVE > 0); + match(Set dst (LShiftVS src (LShiftCntV shift))); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (H)" %} + ins_encode %{ + int con = (int)$shift$$constant; + if (con >= 16) { + __ sve_eor(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); + return; + } + __ sve_lsl(as_FloatRegister($dst$$reg), __ H, + as_FloatRegister($src$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslI_imm(vReg dst, vReg src, immI shift) %{ + predicate(UseSVE > 0); + match(Set dst (LShiftVI src (LShiftCntV shift))); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (S)" %} + ins_encode %{ + int con = (int)$shift$$constant; + __ sve_lsl(as_FloatRegister($dst$$reg), __ S, + as_FloatRegister($src$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslL_imm(vReg dst, vReg src, immI shift) %{ + predicate(UseSVE > 0); + match(Set dst (LShiftVL src (LShiftCntV shift))); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (D)" %} + ins_encode %{ + int con = (int)$shift$$constant; + __ sve_lsl(as_FloatRegister($dst$$reg), __ D, + as_FloatRegister($src$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vshiftcntB(vReg dst, iRegIorL2I cnt) %{ + predicate(UseSVE > 0 && + (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE)); + match(Set dst (LShiftCntV cnt)); + match(Set dst (RShiftCntV cnt)); + format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (B)" %} + ins_encode %{ + __ sve_dup(as_FloatRegister($dst$$reg), __ B, as_Register($cnt$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vshiftcntS(vReg dst, iRegIorL2I cnt) %{ + predicate(UseSVE > 0 && + (n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || + (n->bottom_type()->is_vect()->element_basic_type() == T_CHAR))); + match(Set dst (LShiftCntV cnt)); + match(Set dst (RShiftCntV cnt)); + format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (H)" %} + ins_encode %{ + __ sve_dup(as_FloatRegister($dst$$reg), __ H, as_Register($cnt$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vshiftcntI(vReg dst, iRegIorL2I cnt) %{ + predicate(UseSVE > 0 && + (n->bottom_type()->is_vect()->element_basic_type() == T_INT)); + match(Set dst (LShiftCntV cnt)); + match(Set dst (RShiftCntV cnt)); + format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (S)" %} + ins_encode %{ + __ sve_dup(as_FloatRegister($dst$$reg), __ S, as_Register($cnt$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vshiftcntL(vReg dst, iRegIorL2I cnt) %{ + predicate(UseSVE > 0 && + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG)); + match(Set dst (LShiftCntV cnt)); + match(Set dst (RShiftCntV cnt)); + format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (D)" %} + ins_encode %{ + __ sve_dup(as_FloatRegister($dst$$reg), __ D, as_Register($cnt$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// vector shift - predicated + +instruct vasrB_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (RShiftVB (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_asr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (B)" %} + ins_encode %{ + __ sve_asr(as_FloatRegister($dst_src1$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vasrS_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (RShiftVS (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_asr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_asr(as_FloatRegister($dst_src1$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vasrI_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (RShiftVI (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_asr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_asr(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vasrL_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (RShiftVL (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_asr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_asr(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslB_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (LShiftVB (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (B)" %} + ins_encode %{ + __ sve_lsl(as_FloatRegister($dst_src1$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslS_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (LShiftVS (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_lsl(as_FloatRegister($dst_src1$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslI_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (LShiftVI (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_lsl(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlslL_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (LShiftVL (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_lsl(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlsrB_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (URShiftVB (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (B)" %} + ins_encode %{ + __ sve_lsr(as_FloatRegister($dst_src1$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlsrS_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (URShiftVS (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_lsr(as_FloatRegister($dst_src1$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlsrI_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (URShiftVI (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_lsr(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vlsrL_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (URShiftVL (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsr $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_lsr(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vasrB_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (RShiftVB (Binary dst_src (RShiftCntV shift)) pg)); + ins_cost(SVE_COST); + format %{ "sve_asr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (B)" %} + ins_encode %{ + int con = (int)$shift$$constant; + assert(con > 0 && con < 8, "invalid shift immediate"); + __ sve_asr(as_FloatRegister($dst_src$$reg), __ B, as_PRegister($pg$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vasrS_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (RShiftVS (Binary dst_src (RShiftCntV shift)) pg)); + ins_cost(SVE_COST); + format %{ "sve_asr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (H)" %} + ins_encode %{ + int con = (int)$shift$$constant; + assert(con > 0 && con < 16, "invalid shift immediate"); + __ sve_asr(as_FloatRegister($dst_src$$reg), __ H, as_PRegister($pg$$reg), con); + %} + ins_pipe(pipe_slow); +%} + +instruct vasrI_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (URShiftVI src (RShiftCntV shift))); + match(Set dst_src (RShiftVI (Binary dst_src (RShiftCntV shift)) pg)); ins_cost(SVE_COST); - format %{ "sve_lsr $dst, $src, $shift\t# vector (sve) (S)" %} + format %{ "sve_asr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (S)" %} ins_encode %{ int con = (int)$shift$$constant; - if (con == 0) { - __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); - return; - } - __ sve_lsr(as_FloatRegister($dst$$reg), __ S, - as_FloatRegister($src$$reg), con); + assert(con > 0 && con < 32, "invalid shift immediate"); + __ sve_asr(as_FloatRegister($dst_src$$reg), __ S, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vlsrL_imm(vReg dst, vReg src, immI shift) %{ +instruct vasrL_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (URShiftVL src (RShiftCntV shift))); + match(Set dst_src (RShiftVL (Binary dst_src (RShiftCntV shift)) pg)); ins_cost(SVE_COST); - format %{ "sve_lsr $dst, $src, $shift\t# vector (sve) (D)" %} + format %{ "sve_asr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (D)" %} ins_encode %{ int con = (int)$shift$$constant; - if (con == 0) { - __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); - return; - } - __ sve_lsr(as_FloatRegister($dst$$reg), __ D, - as_FloatRegister($src$$reg), con); + assert(con > 0 && con < 64, "invalid shift immediate"); + __ sve_asr(as_FloatRegister($dst_src$$reg), __ D, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vlslB_imm(vReg dst, vReg src, immI shift) %{ +instruct vlsrB_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (LShiftVB src (LShiftCntV shift))); + match(Set dst_src (URShiftVB (Binary dst_src (RShiftCntV shift)) pg)); ins_cost(SVE_COST); - format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (B)" %} + format %{ "sve_lsr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (B)" %} ins_encode %{ int con = (int)$shift$$constant; - if (con >= 8) { - __ sve_eor(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); - return; - } - __ sve_lsl(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($src$$reg), con); + assert(con > 0 && con < 8, "invalid shift immediate"); + __ sve_lsr(as_FloatRegister($dst_src$$reg), __ B, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vlslS_imm(vReg dst, vReg src, immI shift) %{ +instruct vlsrS_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (LShiftVS src (LShiftCntV shift))); + match(Set dst_src (URShiftVS (Binary dst_src (RShiftCntV shift)) pg)); ins_cost(SVE_COST); - format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (H)" %} + format %{ "sve_lsr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (H)" %} ins_encode %{ int con = (int)$shift$$constant; - if (con >= 16) { - __ sve_eor(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); - return; - } - __ sve_lsl(as_FloatRegister($dst$$reg), __ H, - as_FloatRegister($src$$reg), con); + assert(con > 0 && con < 16, "invalid shift immediate"); + __ sve_lsr(as_FloatRegister($dst_src$$reg), __ H, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vlslI_imm(vReg dst, vReg src, immI shift) %{ +instruct vlsrI_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (LShiftVI src (LShiftCntV shift))); + match(Set dst_src (URShiftVI (Binary dst_src (RShiftCntV shift)) pg)); ins_cost(SVE_COST); - format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (S)" %} + format %{ "sve_lsr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (S)" %} ins_encode %{ int con = (int)$shift$$constant; - __ sve_lsl(as_FloatRegister($dst$$reg), __ S, - as_FloatRegister($src$$reg), con); + assert(con > 0 && con < 32, "invalid shift immediate"); + __ sve_lsr(as_FloatRegister($dst_src$$reg), __ S, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vlslL_imm(vReg dst, vReg src, immI shift) %{ +instruct vlsrL_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (LShiftVL src (LShiftCntV shift))); + match(Set dst_src (URShiftVL (Binary dst_src (RShiftCntV shift)) pg)); ins_cost(SVE_COST); - format %{ "sve_lsl $dst, $src, $shift\t# vector (sve) (D)" %} + format %{ "sve_lsr $dst_src, $pg, $dst_src, $shift\t# vector (sve) (D)" %} ins_encode %{ int con = (int)$shift$$constant; - __ sve_lsl(as_FloatRegister($dst$$reg), __ D, - as_FloatRegister($src$$reg), con); + assert(con > 0 && con < 64, "invalid shift immediate"); + __ sve_lsr(as_FloatRegister($dst_src$$reg), __ D, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vshiftcntB(vReg dst, iRegIorL2I cnt) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE)); - match(Set dst (LShiftCntV cnt)); - match(Set dst (RShiftCntV cnt)); - format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (B)" %} +instruct vlslB_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (LShiftVB (Binary dst_src (LShiftCntV shift)) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src, $pg, $dst_src, $shift\t# vector (sve) (B)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($dst$$reg), __ B, as_Register($cnt$$reg)); + int con = (int)$shift$$constant; + assert(con >= 0 && con < 8, "invalid shift immediate"); + __ sve_lsl(as_FloatRegister($dst_src$$reg), __ B, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vshiftcntS(vReg dst, iRegIorL2I cnt) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - (n->bottom_type()->is_vect()->element_basic_type() == T_CHAR))); - match(Set dst (LShiftCntV cnt)); - match(Set dst (RShiftCntV cnt)); - format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (H)" %} +instruct vlslS_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (LShiftVS (Binary dst_src (LShiftCntV shift)) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src, $pg, $dst_src, $shift\t# vector (sve) (H)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($dst$$reg), __ H, as_Register($cnt$$reg)); + int con = (int)$shift$$constant; + assert(con >= 0 && con < 16, "invalid shift immediate"); + __ sve_lsl(as_FloatRegister($dst_src$$reg), __ H, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vshiftcntI(vReg dst, iRegIorL2I cnt) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_INT)); - match(Set dst (LShiftCntV cnt)); - match(Set dst (RShiftCntV cnt)); - format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (S)" %} +instruct vlslI_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (LShiftVI (Binary dst_src (LShiftCntV shift)) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src, $pg, $dst_src, $shift\t# vector (sve) (S)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($dst$$reg), __ S, as_Register($cnt$$reg)); + int con = (int)$shift$$constant; + assert(con >= 0 && con < 32, "invalid shift immediate"); + __ sve_lsl(as_FloatRegister($dst_src$$reg), __ S, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} -instruct vshiftcntL(vReg dst, iRegIorL2I cnt) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_LONG)); - match(Set dst (LShiftCntV cnt)); - match(Set dst (RShiftCntV cnt)); - format %{ "sve_dup $dst, $cnt\t# vector shift count (sve) (D)" %} +instruct vlslL_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (LShiftVL (Binary dst_src (LShiftCntV shift)) pg)); + ins_cost(SVE_COST); + format %{ "sve_lsl $dst_src, $pg, $dst_src, $shift\t# vector (sve) (D)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($dst$$reg), __ D, as_Register($cnt$$reg)); + int con = (int)$shift$$constant; + assert(con >= 0 && con < 64, "invalid shift immediate"); + __ sve_lsl(as_FloatRegister($dst_src$$reg), __ D, as_PRegister($pg$$reg), con); %} ins_pipe(pipe_slow); %} @@ -2598,7 +4103,8 @@ instruct vshiftcntL(vReg dst, iRegIorL2I cnt) %{ // vector sqrt instruct vsqrtF(vReg dst, vReg src) %{ - predicate(UseSVE > 0); + predicate(UseSVE > 0 && + !n->as_Vector()->is_predicated_vector()); match(Set dst (SqrtVF src)); ins_cost(SVE_COST); format %{ "sve_fsqrt $dst, $src\t# vector (sve) (S)" %} @@ -2610,7 +4116,8 @@ instruct vsqrtF(vReg dst, vReg src) %{ %} instruct vsqrtD(vReg dst, vReg src) %{ - predicate(UseSVE > 0); + predicate(UseSVE > 0 && + !n->as_Vector()->is_predicated_vector()); match(Set dst (SqrtVD src)); ins_cost(SVE_COST); format %{ "sve_fsqrt $dst, $src\t# vector (sve) (D)" %} @@ -2621,6 +4128,34 @@ instruct vsqrtD(vReg dst, vReg src) %{ ins_pipe(pipe_slow); %} +// vector sqrt - predicated + +instruct vsqrtF_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (SqrtVF dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_fsqrt $dst_src, $pg, $dst_src\t# vector (sve) (S)" %} + ins_encode %{ + __ sve_fsqrt(as_FloatRegister($dst_src$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vsqrtD_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src (SqrtVD dst_src pg)); + ins_cost(SVE_COST); + format %{ "sve_fsqrt $dst_src, $pg, $dst_src\t# vector (sve) (D)" %} + ins_encode %{ + __ sve_fsqrt(as_FloatRegister($dst_src$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%} + // vector sub instruct vsubB(vReg dst, vReg src1, vReg src2) %{ @@ -2701,175 +4236,181 @@ instruct vsubD(vReg dst, vReg src1, vReg src2) %{ ins_pipe(pipe_slow); %} -// vector mask cast +// vector sub - predicated -instruct vmaskcast(vReg dst) %{ - predicate(UseSVE > 0 && n->bottom_type()->is_vect()->length() == n->in(1)->bottom_type()->is_vect()->length() && - n->bottom_type()->is_vect()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); - match(Set dst (VectorMaskCast dst)); - ins_cost(0); - format %{ "vmaskcast $dst\t# empty (sve)" %} +instruct vsubB_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (SubVB (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_sub $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (B)" %} ins_encode %{ - // empty + __ sve_sub(as_FloatRegister($dst_src1$$reg), __ B, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_empty); + ins_pipe(pipe_slow); %} -// ------------------------------ Vector cast ------------------------------- +instruct vsubS_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (SubVS (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_sub $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (H)" %} + ins_encode %{ + __ sve_sub(as_FloatRegister($dst_src1$$reg), __ H, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%} -instruct vcvtBtoS(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorCastB2X src)); +instruct vsubI_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (SubVI (Binary dst_src1 src2) pg)); ins_cost(SVE_COST); - format %{ "sve_sunpklo $dst, H, $src\t# convert B to S vector" %} + format %{ "sve_sub $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); + __ sve_sub(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct vcvtBtoI(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_INT); - match(Set dst (VectorCastB2X src)); - ins_cost(2 * SVE_COST); - format %{ "sve_sunpklo $dst, H, $src\n\t" - "sve_sunpklo $dst, S, $dst\t# convert B to I vector" %} +instruct vsubL_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (SubVL (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_sub $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); + __ sve_sub(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct vcvtBtoL(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_LONG); - match(Set dst (VectorCastB2X src)); - ins_cost(3 * SVE_COST); - format %{ "sve_sunpklo $dst, H, $src\n\t" - "sve_sunpklo $dst, S, $dst\n\t" - "sve_sunpklo $dst, D, $dst\t# convert B to L vector" %} +instruct vsubF_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (SubVF (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fsub $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (S)" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); + __ sve_fsub(as_FloatRegister($dst_src1$$reg), __ S, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct vcvtBtoF(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); - match(Set dst (VectorCastB2X src)); - ins_cost(3 * SVE_COST); - format %{ "sve_sunpklo $dst, H, $src\n\t" - "sve_sunpklo $dst, S, $dst\n\t" - "sve_scvtf $dst, S, $dst, S\t# convert B to F vector" %} +instruct vsubD_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 (SubVD (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_fsub $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) (D)" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($dst$$reg), __ S); + __ sve_fsub(as_FloatRegister($dst_src1$$reg), __ D, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %} -instruct vcvtBtoD(vReg dst, vReg src) -%{ +// ------------------------------ Vector mask cast -------------------------- + +instruct vmaskcast(pRegGov dst_src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); - match(Set dst (VectorCastB2X src)); - ins_cost(4 * SVE_COST); - format %{ "sve_sunpklo $dst, H, $src\n\t" - "sve_sunpklo $dst, S, $dst\n\t" - "sve_sunpklo $dst, D, $dst\n\t" - "sve_scvtf $dst, D, $dst, D\t# convert B to D vector" %} - ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - __ sve_scvtf(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ D); + n->bottom_type()->is_vect()->length() == n->in(1)->bottom_type()->is_vect()->length() && + n->bottom_type()->is_vect()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); + match(Set dst_src (VectorMaskCast dst_src)); + ins_cost(0); + format %{ "vmaskcast $dst_src\t# empty (sve)" %} + ins_encode %{ + // empty %} - ins_pipe(pipe_slow); + ins_pipe(pipe_class_empty); %} -instruct vcvtStoB(vReg dst, vReg src, vReg tmp) +instruct vmaskcast_extend(pRegGov dst, pReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); - match(Set dst (VectorCastS2X src)); - effect(TEMP tmp); - ins_cost(2 * SVE_COST); - format %{ "sve_dup $tmp, B, 0\n\t" - "sve_uzp1 $dst, B, $src, tmp\t# convert S to B vector" %} + (Matcher::vector_length_in_bytes(n) == 2 * Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) == 4 * Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) == 8 * Matcher::vector_length_in_bytes(n->in(1)))); + match(Set dst (VectorMaskCast src)); + ins_cost(SVE_COST * 3); + format %{ "sve_vmaskcast_extend $dst, $src\t# extend predicate $src" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ B, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vmaskcast_extend(as_PRegister($dst$$reg), as_PRegister($src$$reg), + Matcher::vector_length_in_bytes(this), Matcher::vector_length_in_bytes(this, $src)); %} ins_pipe(pipe_slow); %} -instruct vcvtStoI(vReg dst, vReg src) +instruct vmaskcast_narrow(pRegGov dst, pReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_INT); - match(Set dst (VectorCastS2X src)); - ins_cost(SVE_COST); - format %{ "sve_sunpklo $dst, S, $src\t# convert S to I vector" %} + (Matcher::vector_length_in_bytes(n) * 2 == Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) * 4 == Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) * 8 == Matcher::vector_length_in_bytes(n->in(1)))); + match(Set dst (VectorMaskCast src)); + ins_cost(SVE_COST * 3); + format %{ "sve_vmaskcast_narrow $dst, $src\t# narrow predicate $src" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); + __ sve_vmaskcast_narrow(as_PRegister($dst$$reg), as_PRegister($src$$reg), + Matcher::vector_length_in_bytes(this), Matcher::vector_length_in_bytes(this, $src)); %} ins_pipe(pipe_slow); %} -instruct vcvtStoL(vReg dst, vReg src) +// ------------------------------ Vector cast ------------------------------- + +instruct vcvtBtoX_extend(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_LONG); - match(Set dst (VectorCastS2X src)); + predicate(UseSVE > 0); + match(Set dst (VectorCastB2X src)); ins_cost(2 * SVE_COST); - format %{ "sve_sunpklo $dst, S, $src\n\t" - "sve_sunpklo $dst, D, $dst\t# convert S to L vector" %} + format %{ "sve_vectorcast_b2x $dst, $src\t# convert B to X vector (extend)" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_vector_extend(as_FloatRegister($dst$$reg), to_size, as_FloatRegister($src$$reg), __ B); + if (to_bt == T_FLOAT || to_bt == T_DOUBLE) { + __ sve_scvtf(as_FloatRegister($dst$$reg), to_size, ptrue, as_FloatRegister($dst$$reg), to_size); + } %} ins_pipe(pipe_slow); %} -instruct vcvtStoF(vReg dst, vReg src) +instruct vcvtStoB(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); match(Set dst (VectorCastS2X src)); + effect(TEMP tmp); ins_cost(2 * SVE_COST); - format %{ "sve_sunpklo $dst, S, $src\n\t" - "sve_scvtf $dst, S, $dst, S\t# convert S to F vector" %} + format %{ "sve_vectorcast_s2b $dst, $src\t# convert H to B vector" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); - __ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($dst$$reg), __ S); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($src$$reg), __ H, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct vcvtStoD(vReg dst, vReg src) +instruct vcvtStoX_extend(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); + type2aelembytes(Matcher::vector_element_basic_type(n)) > 2); match(Set dst (VectorCastS2X src)); - ins_cost(3 * SVE_COST); - format %{ "sve_sunpklo $dst, S, $src\n\t" - "sve_sunpklo $dst, D, $dst\n\t" - "sve_scvtf $dst, D, $dst, D\t# convert S to D vector" %} + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_s2x $dst, $src\t# convert H to X vector (extend)" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg)); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - __ sve_scvtf(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ D); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_vector_extend(as_FloatRegister($dst$$reg), to_size, as_FloatRegister($src$$reg), __ H); + if (to_bt == T_FLOAT || to_bt == T_DOUBLE) { + __ sve_scvtf(as_FloatRegister($dst$$reg), to_size, ptrue, as_FloatRegister($dst$$reg), to_size); + } %} ins_pipe(pipe_slow); %} @@ -2881,13 +4422,10 @@ instruct vcvtItoB(vReg dst, vReg src, vReg tmp) match(Set dst (VectorCastI2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_dup $tmp, H, 0\n\t" - "sve_uzp1 $dst, H, $src, tmp\n\t" - "sve_uzp1 $dst, B, $dst, tmp\n\t# convert I to B vector" %} + format %{ "sve_vectorcast_i2b $dst, $src\t# convert I to B vector" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ H, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($src$$reg), __ S, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} @@ -2899,11 +4437,10 @@ instruct vcvtItoS(vReg dst, vReg src, vReg tmp) match(Set dst (VectorCastI2X src)); effect(TEMP tmp); ins_cost(2 * SVE_COST); - format %{ "sve_dup $tmp, H, 0\n\t" - "sve_uzp1 $dst, H, $src, tmp\t# convert I to S vector" %} + format %{ "sve_vectorcast_i2s $dst, $src\t# convert I to H vector" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ H, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ H, + as_FloatRegister($src$$reg), __ S, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} @@ -2914,9 +4451,9 @@ instruct vcvtItoL(vReg dst, vReg src) n->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (VectorCastI2X src)); ins_cost(SVE_COST); - format %{ "sve_sunpklo $dst, D, $src\t# convert I to L vector" %} + format %{ "sve_vectorcast_i2l $dst, $src\t# convert I to L vector" %} ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg)); + __ sve_vector_extend(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg), __ S); %} ins_pipe(pipe_slow); %} @@ -2927,7 +4464,7 @@ instruct vcvtItoF(vReg dst, vReg src) n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); match(Set dst (VectorCastI2X src)); ins_cost(SVE_COST); - format %{ "sve_scvtf $dst, S, $src, S\t# convert I to F vector" %} + format %{ "sve_vectorcast_i2f $dst, $src\t# convert I to F vector" %} ins_encode %{ __ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); %} @@ -2940,8 +4477,7 @@ instruct vcvtItoD(vReg dst, vReg src) n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); match(Set dst (VectorCastI2X src)); ins_cost(2 * SVE_COST); - format %{ "sve_sunpklo $dst, D, $src\n\t" - "sve_scvtf $dst, D, $dst, D\t# convert I to D vector" %} + format %{ "sve_vectorcast_i2d $dst, $src\t# convert I to D vector" %} ins_encode %{ __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg)); __ sve_scvtf(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ D); @@ -2949,56 +4485,18 @@ instruct vcvtItoD(vReg dst, vReg src) ins_pipe(pipe_slow); %} -instruct vcvtLtoB(vReg dst, vReg src, vReg tmp) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); - match(Set dst (VectorCastL2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $src, tmp\n\t" - "sve_uzp1 $dst, H, $dst, tmp\n\t" - "sve_uzp1 $dst, B, $dst, tmp\n\t# convert L to B vector" %} - ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vcvtLtoS(vReg dst, vReg src, vReg tmp) +instruct vcvtLtoX_narrow(vReg dst, vReg src, vReg tmp) %{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + predicate(UseSVE > 0 && is_integral_type(Matcher::vector_element_basic_type(n))); match(Set dst (VectorCastL2X src)); effect(TEMP_DEF dst, TEMP tmp); - ins_cost(3 * SVE_COST); - format %{ "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $src, tmp\n\t" - "sve_uzp1 $dst, H, $dst, tmp\n\t# convert L to S vector" %} - ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vcvtLtoI(vReg dst, vReg src, vReg tmp) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_INT); - match(Set dst (VectorCastL2X src)); - effect(TEMP tmp); ins_cost(2 * SVE_COST); - format %{ "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $src, tmp\t# convert L to I vector" %} + format %{ "sve_vectorcast_l2x $dst, $src\t# convert L to B/H/S vector (narrow)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), to_size, + as_FloatRegister($src$$reg), __ D, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} @@ -3010,13 +4508,12 @@ instruct vcvtLtoF(vReg dst, vReg src, vReg tmp) match(Set dst (VectorCastL2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_scvtf $dst, S, $src, D\n\t" - "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $dst, $tmp\t# convert L to F vector" %} + format %{ "sve_vectorcast_l2f $dst, $src\t# convert L to F vector" %} ins_encode %{ __ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D); - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ S, + as_FloatRegister($dst$$reg), __ D, as_FloatRegister($tmp$$reg)); + %} ins_pipe(pipe_slow); %} @@ -3027,47 +4524,28 @@ instruct vcvtLtoD(vReg dst, vReg src) n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); match(Set dst (VectorCastL2X src)); ins_cost(SVE_COST); - format %{ "sve_scvtf $dst, D, $src, D\t# convert L to D vector" %} + format %{ "sve_vectorcast_l2d $dst, $src\t# convert L to D vector" %} ins_encode %{ __ sve_scvtf(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src$$reg), __ D); %} ins_pipe(pipe_slow); %} -instruct vcvtFtoB(vReg dst, vReg src, vReg tmp) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); - match(Set dst (VectorCastF2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_fcvtzs $dst, S, $src, S\n\t" - "sve_dup $tmp, H, 0\n\t" - "sve_uzp1 $dst, H, $dst, tmp\n\t" - "sve_uzp1 $dst, B, $dst, tmp\n\t# convert F to B vector" %} - ins_encode %{ - __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); - __ sve_dup(as_FloatRegister($tmp$$reg), __ H, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vcvtFtoS(vReg dst, vReg src, vReg tmp) +instruct vcvtFtoX_narrow(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || + n->bottom_type()->is_vect()->element_basic_type() == T_SHORT)); match(Set dst (VectorCastF2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_fcvtzs $dst, S, $src, S\n\t" - "sve_dup $tmp, H, 0\n\t" - "sve_uzp1 $dst, H, $dst, tmp\t# convert F to S vector" %} + format %{ "sve_vectorcast_f2x $dst, $src\t# convert F to B/H vector" %} ins_encode %{ + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); - __ sve_dup(as_FloatRegister($tmp$$reg), __ H, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), to_size, + as_FloatRegister($dst$$reg), __ S, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} @@ -3075,10 +4553,10 @@ instruct vcvtFtoS(vReg dst, vReg src, vReg tmp) instruct vcvtFtoI(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_INT); + (n->bottom_type()->is_vect()->element_basic_type() == T_INT)); match(Set dst (VectorCastF2X src)); ins_cost(SVE_COST); - format %{ "sve_fcvtzs $dst, S, $src, S\t# convert F to I vector" %} + format %{ "sve_vectorcast_f2x $dst, $src\t# convert F to I vector" %} ins_encode %{ __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); %} @@ -3088,89 +4566,47 @@ instruct vcvtFtoI(vReg dst, vReg src) instruct vcvtFtoL(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_LONG); - match(Set dst (VectorCastF2X src)); - ins_cost(2 * SVE_COST); - format %{ "sve_fcvtzs $dst, S, $src, S\n\t" - "sve_sunpklo $dst, D, $dst\t# convert F to L vector" %} - ins_encode %{ - __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vcvtFtoD(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); - match(Set dst (VectorCastF2X src)); - ins_cost(2 * SVE_COST); - format %{ "sve_sunpklo $dst, D, $src\n\t" - "sve_fcvt $dst, D, $dst, S\t# convert F to D vector" %} - ins_encode %{ - __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg)); - __ sve_fcvt(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ S); - %} - ins_pipe(pipe_slow); -%} - -instruct vcvtDtoB(vReg dst, vReg src, vReg tmp) -%{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); - match(Set dst (VectorCastD2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_fcvtzs $dst, D, $src, D\n\t" - "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $dst, tmp\n\t" - "sve_uzp1 $dst, H, $dst, tmp\n\t" - "sve_uzp1 $dst, B, $dst, tmp\n\t# convert D to B vector" %} + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG)); + match(Set dst (VectorCastF2X src)); + ins_cost(SVE_COST * 2); + format %{ "sve_vectorcast_f2x $dst, $src\t# convert F to L vector" %} ins_encode %{ - __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src$$reg), __ D); - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg)); + __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ S); %} ins_pipe(pipe_slow); %} -instruct vcvtDtoS(vReg dst, vReg src, vReg tmp) +instruct vcvtFtoD(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorCastD2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_fcvtzs $dst, D, $src, D\n\t" - "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $dst, tmp\n\t" - "sve_uzp1 $dst, H, $dst, tmp\n\t# convert D to S vector" %} + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); + match(Set dst (VectorCastF2X src)); + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_f2d $dst, $dst\t# convert F to D vector" %} ins_encode %{ - __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src$$reg), __ D); - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_extend(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg), __ S); + __ sve_fcvt(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ S); %} ins_pipe(pipe_slow); %} -instruct vcvtDtoI(vReg dst, vReg src, vReg tmp) +instruct vcvtDtoX_narrow(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_INT); + (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || + n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || + n->bottom_type()->is_vect()->element_basic_type() == T_INT)); match(Set dst (VectorCastD2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_fcvtzs $dst, D, $src, D\n\t" - "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $dst, tmp\t# convert D to I vector" %} + format %{ "sve_vectorcast_d2x $dst, $src\t# convert D to X vector (narrow)" %} ins_encode %{ - __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src$$reg), __ D); - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), to_size, + as_FloatRegister($dst$$reg), __ D, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} @@ -3181,7 +4617,7 @@ instruct vcvtDtoL(vReg dst, vReg src) n->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (VectorCastD2X src)); ins_cost(SVE_COST); - format %{ "sve_fcvtzs $dst, D, $src, D\t# convert D to L vector" %} + format %{ "sve_vectorcast_d2l $dst, $src\t# convert D to L vector" %} ins_encode %{ __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($src$$reg), __ D); %} @@ -3195,44 +4631,43 @@ instruct vcvtDtoF(vReg dst, vReg src, vReg tmp) match(Set dst (VectorCastD2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_fcvt $dst, S, $src, D\n\t" - "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, S, $dst, $tmp\t# convert D to F vector" %} + format %{ "sve_vectorcast_d2f $dst, S, $dst\t# convert D to F vector" %} ins_encode %{ __ sve_fcvt(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D); - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ S, + as_FloatRegister($dst$$reg), __ D, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} + // ------------------------------ Vector extract --------------------------------- -instruct extractB(iRegINoSp dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extractB(iRegINoSp dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (ExtractB src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, B, $pTmp, $src, $idx\n\t" + format %{ "sve_extract $dst, B, $pgtmp, $src, $idx\n\t" "sbfmw $dst, $dst, 0U, 7U\t# extract from vector(B)" %} ins_encode %{ - __ sve_extract(as_Register($dst$$reg), __ B, as_PRegister($pTmp$$reg), + __ sve_extract(as_Register($dst$$reg), __ B, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); __ sbfmw(as_Register($dst$$reg), as_Register($dst$$reg), 0U, 7U); %} ins_pipe(pipe_slow); %} -instruct extractS(iRegINoSp dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extractS(iRegINoSp dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (ExtractS src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, H, $pTmp, $src, $idx\n\t" + format %{ "sve_extract $dst, H, $pgtmp, $src, $idx\n\t" "sbfmw $dst, $dst, 0U, 15U\t# extract from vector(S)" %} ins_encode %{ - __ sve_extract(as_Register($dst$$reg), __ H, as_PRegister($pTmp$$reg), + __ sve_extract(as_Register($dst$$reg), __ H, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); __ sbfmw(as_Register($dst$$reg), as_Register($dst$$reg), 0U, 15U); %} @@ -3240,57 +4675,57 @@ instruct extractS(iRegINoSp dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) %} -instruct extractI(iRegINoSp dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extractI(iRegINoSp dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (ExtractI src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, S, $pTmp, $src, $idx\t# extract from vector(I)" %} + format %{ "sve_extract $dst, S, $pgtmp, $src, $idx\t# extract from vector(I)" %} ins_encode %{ - __ sve_extract(as_Register($dst$$reg), __ S, as_PRegister($pTmp$$reg), + __ sve_extract(as_Register($dst$$reg), __ S, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); %} ins_pipe(pipe_slow); %} -instruct extractL(iRegLNoSp dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extractL(iRegLNoSp dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (ExtractL src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, D, $pTmp, $src, $idx\t# extract from vector(L)" %} + format %{ "sve_extract $dst, D, $pgtmp, $src, $idx\t# extract from vector(L)" %} ins_encode %{ - __ sve_extract(as_Register($dst$$reg), __ D, as_PRegister($pTmp$$reg), + __ sve_extract(as_Register($dst$$reg), __ D, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); %} ins_pipe(pipe_slow); %} -instruct extractF(vRegF dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extractF(vRegF dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (ExtractF src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, S, $pTmp, $src, $idx\t# extract from vector(F)" %} + format %{ "sve_extract $dst, S, $pgtmp, $src, $idx\t# extract from vector(F)" %} ins_encode %{ - __ sve_extract(as_FloatRegister($dst$$reg), __ S, as_PRegister($pTmp$$reg), + __ sve_extract(as_FloatRegister($dst$$reg), __ S, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); %} ins_pipe(pipe_slow); %} -instruct extractD(vRegD dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extractD(vRegD dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (ExtractD src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, D, $pTmp, $src, $idx\t# extract from vector(D)" %} + format %{ "sve_extract $dst, D, $pgtmp, $src, $idx\t# extract from vector(D)" %} ins_encode %{ - __ sve_extract(as_FloatRegister($dst$$reg), __ D, as_PRegister($pTmp$$reg), + __ sve_extract(as_FloatRegister($dst$$reg), __ D, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); %} ins_pipe(pipe_slow); @@ -3298,83 +4733,79 @@ instruct extractD(vRegD dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) // ------------------------------- VectorTest ---------------------------------- -instruct vtest_alltrue(iRegINoSp dst, vReg src1, vReg src2, pReg pTmp, rFlagsReg cr) +instruct vtest_alltrue(iRegINoSp dst, pRegGov src1, pRegGov src2, pReg ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && static_cast(n)->get_predicate() == BoolTest::overflow); match(Set dst (VectorTest src1 src2)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_cmpeq $pTmp, $src1, 0\n\t" + format %{ "sve_eors $ptmp, $src1, $src2\t# $src2 is all true mask\n" "csetw $dst, EQ\t# VectorTest (sve) - alltrue" %} ins_encode %{ - // "src2" is not used for sve. - BasicType bt = Matcher::vector_element_basic_type(this, $src1); - Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - ptrue, as_FloatRegister($src1$$reg), 0); + __ sve_eors(as_PRegister($ptmp$$reg), ptrue, + as_PRegister($src1$$reg), as_PRegister($src2$$reg)); __ csetw(as_Register($dst$$reg), Assembler::EQ); %} ins_pipe(pipe_slow); %} -instruct vtest_anytrue(iRegINoSp dst, vReg src1, vReg src2, pReg pTmp, rFlagsReg cr) +instruct vtest_anytrue(iRegINoSp dst, pRegGov src1, pRegGov src2, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && static_cast(n)->get_predicate() == BoolTest::ne); match(Set dst (VectorTest src1 src2)); - effect(TEMP pTmp, KILL cr); + effect(KILL cr); ins_cost(SVE_COST); - format %{ "sve_cmpeq $pTmp, $src1, -1\n\t" + format %{ "sve_ptest $src1\n\t" "csetw $dst, NE\t# VectorTest (sve) - anytrue" %} ins_encode %{ // "src2" is not used for sve. - BasicType bt = Matcher::vector_element_basic_type(this, $src1); - Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - ptrue, as_FloatRegister($src1$$reg), -1); + __ sve_ptest(ptrue, as_PRegister($src1$$reg)); __ csetw(as_Register($dst$$reg), Assembler::NE); %} ins_pipe(pipe_slow); %} -instruct vtest_alltrue_partial(iRegINoSp dst, vReg src1, vReg src2, pRegGov pTmp, rFlagsReg cr) +instruct vtest_alltrue_partial(iRegINoSp dst, pRegGov src1, pRegGov src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && static_cast(n)->get_predicate() == BoolTest::overflow); match(Set dst (VectorTest src1 src2)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(SVE_COST); format %{ "vtest_alltrue_partial $dst, $src1, $src2\t# VectorTest partial (sve) - alltrue" %} ins_encode %{ - // "src2" is not used for sve. BasicType bt = Matcher::vector_element_basic_type(this, $src1); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), size, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src1)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - as_PRegister($pTmp$$reg), as_FloatRegister($src1$$reg), 0); + __ sve_eors(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($src1$$reg), as_PRegister($src2$$reg)); __ csetw(as_Register($dst$$reg), Assembler::EQ); %} ins_pipe(pipe_slow); %} -instruct vtest_anytrue_partial(iRegINoSp dst, vReg src1, vReg src2, pRegGov pTmp, rFlagsReg cr) +instruct vtest_anytrue_partial(iRegINoSp dst, pRegGov src1, pRegGov src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && static_cast(n)->get_predicate() == BoolTest::ne); match(Set dst (VectorTest src1 src2)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(SVE_COST); format %{ "vtest_anytrue_partial $dst, $src1, $src2\t# VectorTest partial (sve) - anytrue" %} ins_encode %{ - // "src2" is not used for sve. BasicType bt = Matcher::vector_element_basic_type(this, $src1); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), size, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src1)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - as_PRegister($pTmp$$reg), as_FloatRegister($src1$$reg), -1); + __ sve_ands(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($src1$$reg), as_PRegister($src2$$reg)); __ csetw(as_Register($dst$$reg), Assembler::NE); %} ins_pipe(pipe_slow); @@ -3382,211 +4813,169 @@ instruct vtest_anytrue_partial(iRegINoSp dst, vReg src1, vReg src2, pRegGov pTmp // ------------------------------ Vector insert --------------------------------- -instruct insertI_small(vReg dst, vReg src, iRegIorL2I val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insertI_small(vReg dst, vReg src, iRegIorL2I val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() <= 32 && (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || n->bottom_type()->is_vect()->element_basic_type() == T_INT)); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); - format %{ "sve_index $dst, -16, 1\t# (B/S/I)\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + format %{ "sve_index $dst, -16, 1\t# (B/H/S)\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (B/S/I)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (B/H/S)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); __ sve_index(as_FloatRegister($dst$$reg), size, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), size, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pTmp$$reg), as_Register($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pgtmp$$reg), as_Register($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertF_small(vReg dst, vReg src, vRegF val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insertF_small(vReg dst, vReg src, vRegF val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() <= 32 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); format %{ "sve_index $dst, S, -16, 1\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (F)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (F)" %} ins_encode %{ __ sve_index(as_FloatRegister($dst$$reg), __ S, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ S, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ S, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), __ S, as_PRegister($pTmp$$reg), as_FloatRegister($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ S, as_PRegister($pgtmp$$reg), as_FloatRegister($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertI(vReg dst, vReg src, iRegIorL2I val, immI idx, vReg tmp1, pRegGov pTmp, rFlagsReg cr) +instruct insertI(vReg dst, vReg src, iRegIorL2I val, immI idx, vReg tmp1, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() > 32 && (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || n->bottom_type()->is_vect()->element_basic_type() == T_INT)); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP tmp1, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP tmp1, TEMP pgtmp, KILL cr); ins_cost(5 * SVE_COST); - format %{ "sve_index $tmp1, 0, 1\t# (B/S/I)\n\t" - "sve_dup $dst, $idx\t# (B/S/I)\n\t" - "sve_cmpeq $pTmp, $tmp1, $dst\n\t" + format %{ "sve_index $tmp1, 0, 1\t# (B/H/S)\n\t" + "sve_dup $dst, $idx\t# (B/H/S)\n\t" + "sve_cmpeq $pgtmp, $tmp1, $dst\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (B/S/I)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (B/H/S)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); __ sve_index(as_FloatRegister($tmp1$$reg), size, 0, 1); __ sve_dup(as_FloatRegister($dst$$reg), size, (int)($idx$$constant)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), size, ptrue, as_FloatRegister($tmp1$$reg), as_FloatRegister($dst$$reg)); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pTmp$$reg), as_Register($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pgtmp$$reg), as_Register($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertL(vReg dst, vReg src, iRegL val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insertL(vReg dst, vReg src, iRegL val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_LONG); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); format %{ "sve_index $dst, D, -16, 1\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (L)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (L)" %} ins_encode %{ __ sve_index(as_FloatRegister($dst$$reg), __ D, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ D, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), __ D, as_PRegister($pTmp$$reg), as_Register($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ D, as_PRegister($pgtmp$$reg), as_Register($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertD(vReg dst, vReg src, vRegD val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insertD(vReg dst, vReg src, vRegD val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); format %{ "sve_index $dst, D, -16, 1\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (D)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (D)" %} ins_encode %{ __ sve_index(as_FloatRegister($dst$$reg), __ D, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ D, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), __ D, as_PRegister($pTmp$$reg), as_FloatRegister($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ D, as_PRegister($pgtmp$$reg), as_FloatRegister($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertF(vReg dst, vReg src, vRegF val, immI idx, vReg tmp1, pRegGov pTmp, rFlagsReg cr) +instruct insertF(vReg dst, vReg src, vRegF val, immI idx, vReg tmp1, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() > 32 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP tmp1, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP tmp1, TEMP pgtmp, KILL cr); ins_cost(5 * SVE_COST); format %{ "sve_index $tmp1, S, 0, 1\n\t" "sve_dup $dst, S, $idx\n\t" - "sve_cmpeq $pTmp, $tmp1, $dst\n\t" + "sve_cmpeq $pgtmp, $tmp1, $dst\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (F)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (F)" %} ins_encode %{ __ sve_index(as_FloatRegister($tmp1$$reg), __ S, 0, 1); __ sve_dup(as_FloatRegister($dst$$reg), __ S, (int)($idx$$constant)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ S, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ S, ptrue, as_FloatRegister($tmp1$$reg), as_FloatRegister($dst$$reg)); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); __ sve_cpy(as_FloatRegister($dst$$reg), __ S, - as_PRegister($pTmp$$reg), as_FloatRegister($val$$reg)); + as_PRegister($pgtmp$$reg), as_FloatRegister($val$$reg)); %} ins_pipe(pipe_slow); %} // ------------------------------ Vector shuffle ------------------------------- -instruct loadshuffleB(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); +instruct loadshuffle(vReg dst, vReg src) %{ + predicate(UseSVE > 0); match(Set dst (VectorLoadShuffle src)); ins_cost(SVE_COST); - format %{ "sve_orr $dst, $src, $src\t# vector load shuffle (B)" %} + format %{ "sve_loadshuffle $dst, $src\t# vector load shuffle (B/H/S/D)" %} ins_encode %{ - if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { - __ sve_orr(as_FloatRegister($dst$$reg), - as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + if (bt == T_BYTE) { + if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { + __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); + } + } else { + __ sve_vector_extend(as_FloatRegister($dst$$reg), __ elemType_to_regVariant(bt), + as_FloatRegister($src$$reg), __ B); } %} ins_pipe(pipe_slow); %} -instruct loadshuffleS(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorLoadShuffle src)); - ins_cost(SVE_COST); - format %{ "sve_uunpklo $dst, $src\t# vector load shuffle (B to H)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct loadshuffleI(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_INT || - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); - match(Set dst (VectorLoadShuffle src)); - ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\t# vector load shuffle (B to S)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct loadshuffleL(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); - match(Set dst (VectorLoadShuffle src)); - ins_cost(3 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\n\t" - "sve_uunpklo $dst, D, $dst\t# vector load shuffle (B to D)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - // ------------------------------ Vector rearrange ------------------------------- instruct rearrange(vReg dst, vReg src, vReg shuffle) @@ -3613,7 +5002,7 @@ instruct gatherI(vReg dst, indirect mem, vReg idx) %{ n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set dst (LoadVectorGather mem idx)); ins_cost(SVE_COST); - format %{ "load_vector_gather $dst, $mem, $idx\t# vector load gather (I/F)" %} + format %{ "load_vector_gather $dst, $mem, $idx\t# vector load gather (S)" %} ins_encode %{ __ sve_ld1w_gather(as_FloatRegister($dst$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); @@ -3628,52 +5017,123 @@ instruct gatherL(vReg dst, indirect mem, vReg idx) %{ n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set dst (LoadVectorGather mem idx)); ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $idx, $idx\n\t" - "load_vector_gather $dst, $mem, $idx\t# vector load gather (L/D)" %} + format %{ "load_vector_gather $dst, $mem, $idx\t# vector load gather (D)" %} ins_encode %{ __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); - __ sve_ld1d_gather(as_FloatRegister($dst$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), ptrue, as_Register($mem$$base), + as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} // ------------------------------ Vector Load Gather Partial------------------------------- -instruct gatherI_partial(vReg dst, indirect mem, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct gatherI_partial(vReg dst, indirect mem, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_LoadVectorGather()->memory_size() < MaxVectorSize && (n->bottom_type()->is_vect()->element_basic_type() == T_INT || n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set dst (LoadVectorGather mem idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(2 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "load_vector_gather $dst, $pTmp, $mem, $idx\t# vector load gather partial (I/F)" %} + format %{ "load_vector_gather $dst, $ptmp, $mem, $idx\t# vector load gather partial (S)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ S, - Matcher::vector_length(this)); - __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($pTmp$$reg), + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this)); + __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} -instruct gatherL_partial(vReg dst, indirect mem, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct gatherL_partial(vReg dst, indirect mem, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_LoadVectorGather()->memory_size() < MaxVectorSize && (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set dst (LoadVectorGather mem idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(3 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_uunpklo $idx, $idx\n\t" - "load_vector_gather $dst, $pTmp, $mem, $idx\t# vector load gather partial (L/D)" %} + format %{ "load_vector_gather $dst, $ptmp, $mem, $idx\t# vector load gather partial (D)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this)); + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Load Gather Predicated ------------------------------- + +instruct gatherI_masked(vReg dst, indirect mem, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() == MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + ins_cost(SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated (S)" %} + ins_encode %{ + __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct gatherL_masked(vReg dst, indirect mem, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() == MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + ins_cost(2 * SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated (D)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ D, + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Load Gather Predicated Partial ------------------------------- + +instruct gatherI_masked_partial(vReg dst, indirect mem, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() < MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + effect(TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated partial (S)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct gatherL_masked_partial(vReg dst, indirect mem, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() < MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + effect(TEMP ptmp, KILL cr); + ins_cost(4 * SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated partial (D)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); - __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($pTmp$$reg), + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); @@ -3688,7 +5148,7 @@ instruct scatterI(indirect mem, vReg src, vReg idx) %{ n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set mem (StoreVectorScatter mem (Binary src idx))); ins_cost(SVE_COST); - format %{ "store_vector_scatter $mem, $idx, $src\t# vector store scatter (I/F)" %} + format %{ "store_vector_scatter $mem, $idx, $src\t# vector store scatter (S)" %} ins_encode %{ __ sve_st1w_scatter(as_FloatRegister($src$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); @@ -3703,59 +5163,129 @@ instruct scatterL(indirect mem, vReg src, vReg idx) %{ n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set mem (StoreVectorScatter mem (Binary src idx))); ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $idx, $idx\n\t" - "store_vector_scatter $mem, $idx, $src\t# vector store scatter (L/D)" %} + format %{ "store_vector_scatter $mem, $idx, $src\t# vector store scatter (D)" %} ins_encode %{ - __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, - as_FloatRegister($idx$$reg)); + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); __ sve_st1d_scatter(as_FloatRegister($src$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} -// ------------------------------ Vector Store Scatter Partial------------------------------- +// ------------------------------ Vector Store Scatter Partial ------------------------------- -instruct scatterI_partial(indirect mem, vReg src, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct scatterI_partial(indirect mem, vReg src, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_StoreVectorScatter()->memory_size() < MaxVectorSize && (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_INT || n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set mem (StoreVectorScatter mem (Binary src idx))); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(2 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "store_vector_scatter $mem, $pTmp, $idx, $src\t# vector store scatter partial (I/F)" %} + format %{ "store_vector_scatter $mem, $ptmp, $idx, $src\t# vector store scatter partial (S)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ S, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this, $src)); - __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($pTmp$$reg), + __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} -instruct scatterL_partial(indirect mem, vReg src, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct scatterL_partial(indirect mem, vReg src, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_StoreVectorScatter()->memory_size() < MaxVectorSize && (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_LONG || n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set mem (StoreVectorScatter mem (Binary src idx))); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(3 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_uunpklo $idx, $idx\n\t" - "store_vector_scatter $mem, $pTmp, $idx, $src\t# vector store scatter partial (L/D)" %} + format %{ "store_vector_scatter $mem, $ptmp, $idx, $src\t# vector store scatter partial (D)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ D, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src)); __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); - __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($pTmp$$reg), + __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Store Scatter Predicated ------------------------------- + +instruct scatterI_masked(indirect mem, vReg src, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() == MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + ins_cost(SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicate (S)" %} + ins_encode %{ + __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct scatterL_masked(indirect mem, vReg src, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() == MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + ins_cost(2 * SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicated (D)" %} + ins_encode %{ + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Store Scatter Predicated Partial ------------------------------- + +instruct scatterI_masked_partial(indirect mem, vReg src, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() < MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + effect(TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicated partial (S)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, + Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} +instruct scatterL_masked_partial(indirect mem, vReg src, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() < MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + effect(TEMP ptmp, KILL cr); + ins_cost(4 * SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicated partial (D)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} // ------------------------------ Vector Load Const ------------------------------- @@ -3811,203 +5341,97 @@ instruct stringU_indexof_char_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch, %} // ---------------------------- Vector mask reductions --------------------------- - -instruct vmask_truecount(iRegINoSp dst, vReg src, pReg ptmp, rFlagsReg cr) %{ +instruct vmask_truecount(iRegINoSp dst, pReg src) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (VectorMaskTrueCount src)); - effect(TEMP ptmp, KILL cr); - ins_cost(2 * SVE_COST); + ins_cost(SVE_COST); format %{ "vmask_truecount $dst, $src\t# vector mask truecount (sve)" %} ins_encode %{ - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, - as_FloatRegister($src$$reg), ptrue, as_PRegister($ptmp$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_cntp($dst$$Register, size, ptrue, as_PRegister($src$$reg)); %} ins_pipe(pipe_slow); %} -instruct vmask_firsttrue(iRegINoSp dst, vReg src, pReg ptmp, rFlagsReg cr) %{ +instruct vmask_firsttrue(iRegINoSp dst, pReg src, pReg ptmp) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (VectorMaskFirstTrue src)); - effect(TEMP ptmp, KILL cr); - ins_cost(3 * SVE_COST); + effect(TEMP ptmp); + ins_cost(2 * SVE_COST); format %{ "vmask_firsttrue $dst, $src\t# vector mask firsttrue (sve)" %} ins_encode %{ - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, - as_FloatRegister($src$$reg), ptrue, as_PRegister($ptmp$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_brkb(as_PRegister($ptmp$$reg), ptrue, as_PRegister($src$$reg), false); + __ sve_cntp($dst$$Register, size, ptrue, as_PRegister($ptmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct vmask_lasttrue(iRegINoSp dst, vReg src, pReg ptmp, rFlagsReg cr) %{ +instruct vmask_lasttrue(iRegINoSp dst, pReg src, pReg ptmp) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (VectorMaskLastTrue src)); - effect(TEMP ptmp, KILL cr); - ins_cost(4 * SVE_COST); + effect(TEMP ptmp); + ins_cost(3 * SVE_COST); format %{ "vmask_lasttrue $dst, $src\t# vector mask lasttrue (sve)" %} ins_encode %{ - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, - as_FloatRegister($src$$reg), ptrue, as_PRegister($ptmp$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + __ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($src$$reg), as_PRegister($ptmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct vmask_truecount_partial(iRegINoSp dst, vReg src, pRegGov ptmp, rFlagsReg cr) %{ +instruct vmask_truecount_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (VectorMaskTrueCount src)); effect(TEMP ptmp, KILL cr); - ins_cost(3 * SVE_COST); - format %{ "vmask_truecount $dst, $src\t# vector mask truecount partial (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "vmask_truecount_partial $dst, $src\t# vector mask truecount partial (sve)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ B, - Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, as_FloatRegister($src$$reg), - as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src)); + __ sve_cntp($dst$$Register, size, as_PRegister($ptmp$$reg), as_PRegister($src$$reg)); %} ins_pipe(pipe_slow); %} -instruct vmask_firsttrue_partial(iRegINoSp dst, vReg src, pRegGov pgtmp, pReg ptmp, rFlagsReg cr) %{ +instruct vmask_firsttrue_partial(iRegINoSp dst, pReg src, pReg ptmp1, pReg ptmp2, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (VectorMaskFirstTrue src)); - effect(TEMP pgtmp, TEMP ptmp, KILL cr); - ins_cost(4 * SVE_COST); - format %{ "vmask_firsttrue $dst, $src\t# vector mask firsttrue partial (sve)" %} + effect(TEMP ptmp1, TEMP ptmp2, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "vmask_firsttrue_partial $dst, $src\t# vector mask firsttrue partial (sve)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ B, + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp1$$reg), size, Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, as_FloatRegister($src$$reg), - as_PRegister($pgtmp$$reg), as_PRegister($ptmp$$reg)); + __ sve_brkb(as_PRegister($ptmp2$$reg), as_PRegister($ptmp1$$reg), as_PRegister($src$$reg), false); + __ sve_cntp($dst$$Register, size, as_PRegister($ptmp1$$reg), as_PRegister($ptmp2$$reg)); %} ins_pipe(pipe_slow); %} -instruct vmask_lasttrue_partial(iRegINoSp dst, vReg src, pRegGov ptmp, rFlagsReg cr) %{ +instruct vmask_lasttrue_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (VectorMaskLastTrue src)); effect(TEMP ptmp, KILL cr); ins_cost(5 * SVE_COST); - format %{ "vmask_lasttrue $dst, $src\t# vector mask lasttrue partial (sve)" %} - ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ B, - Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, as_FloatRegister($src$$reg), - as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg)); - %} - ins_pipe(pipe_slow); -%} - -// ----------------- Vector mask reductions combined with VectorMaskStore --------------- - -instruct vstoremask_truecount(iRegINoSp dst, vReg src, immI esize, pReg ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (VectorMaskTrueCount (VectorStoreMask src esize))); - effect(TEMP ptmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "vstoremask_truecount $dst, $src\t# vector mask truecount (sve)" %} - ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - ptrue, as_PRegister($ptmp$$reg), Matcher::vector_length(this, $src)); - %} - ins_pipe(pipe_slow); -%} - -instruct vstoremask_firsttrue(iRegINoSp dst, vReg src, immI esize, pReg ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (VectorMaskFirstTrue (VectorStoreMask src esize))); - effect(TEMP ptmp, KILL cr); - ins_cost(3 * SVE_COST); - format %{ "vstoremask_firsttrue $dst, $src\t# vector mask firsttrue (sve)" %} - ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - ptrue, as_PRegister($ptmp$$reg), Matcher::vector_length(this, $src)); - %} - ins_pipe(pipe_slow); -%} - -instruct vstoremask_lasttrue(iRegINoSp dst, vReg src, immI esize, pReg ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (VectorMaskLastTrue (VectorStoreMask src esize))); - effect(TEMP ptmp, KILL cr); - ins_cost(4 * SVE_COST); - format %{ "vstoremask_lasttrue $dst, $src\t# vector mask lasttrue (sve)" %} - ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - ptrue, as_PRegister($ptmp$$reg), Matcher::vector_length(this, $src)); - %} - ins_pipe(pipe_slow); -%} - -instruct vstoremask_truecount_partial(iRegINoSp dst, vReg src, immI esize, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (VectorMaskTrueCount (VectorStoreMask src esize))); - effect(TEMP ptmp, KILL cr); - ins_cost(3 * SVE_COST); - format %{ "vstoremask_truecount $dst, $src\t# vector mask truecount partial (sve)" %} - ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, - Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), MaxVectorSize / size); - %} - ins_pipe(pipe_slow); -%} - -instruct vstoremask_firsttrue_partial(iRegINoSp dst, vReg src, immI esize, pRegGov pgtmp, pReg ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (VectorMaskFirstTrue (VectorStoreMask src esize))); - effect(TEMP pgtmp, TEMP ptmp, KILL cr); - ins_cost(4 * SVE_COST); - format %{ "vstoremask_firsttrue $dst, $src\t# vector mask firsttrue partial (sve)" %} - ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), variant, - Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - as_PRegister($pgtmp$$reg), as_PRegister($ptmp$$reg), MaxVectorSize / size); - %} - ins_pipe(pipe_slow); -%} - -instruct vstoremask_lasttrue_partial(iRegINoSp dst, vReg src, immI esize, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (VectorMaskLastTrue (VectorStoreMask src esize))); - effect(TEMP ptmp, KILL cr); - ins_cost(5 * SVE_COST); - format %{ "vstoremask_lasttrue $dst, $src\t# vector mask lasttrue partial (sve)" %} + format %{ "vmask_lasttrue_partial $dst, $src\t# vector mask lasttrue partial (sve)" %} ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, - Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), MaxVectorSize / size); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($ptmp$$reg), ptrue, as_PRegister($ptmp$$reg), as_PRegister($src$$reg)); + __ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg)); %} ins_pipe(pipe_slow); -%} +%} \ No newline at end of file diff --git a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 index dfdc6a2fda9..91a7a8b21d5 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 @@ -83,6 +83,7 @@ opclass vmemA(indirect, vmemA_indOffI4, vmemA_indOffL4); source_hpp %{ bool op_sve_supported(int opcode, int vlen, BasicType bt); + bool masked_op_sve_supported(int opcode, int vlen, BasicType bt); %} source %{ @@ -139,11 +140,7 @@ source %{ // Vector API specific case Op_VectorLoadShuffle: case Op_VectorRearrange: - if (vlen < 4 || length_in_bytes > MaxVectorSize) { - return false; - } else { - return true; - } + return vlen >= 4 && length_in_bytes <= MaxVectorSize; case Op_LoadVector: case Op_StoreVector: return Matcher::vector_size_supported(bt, vlen); @@ -153,6 +150,14 @@ source %{ // By default, we only support vector operations with no less than 8 bytes and 2 elements. return 8 <= length_in_bytes && length_in_bytes <= MaxVectorSize && vlen >= 2; } + + bool masked_op_sve_supported(int opcode, int vlen, BasicType bt) { + if (opcode == Op_VectorRearrange) { + return false; + } + return op_sve_supported(opcode, vlen, bt); + } + %} definitions %{ @@ -231,46 +236,205 @@ VLoadStore(strq, Q, store, 16, X, 128, src) // Only load/store values in the range of the memory_size. This is needed // when the memory_size is lower than the hardware supported max vector size. // And this might happen for Vector API mask vector load/store. -instruct loadV_partial(vReg dst, vmemA mem, pRegGov pTmp, rFlagsReg cr) %{ +instruct loadV_partial(vReg dst, vmemA mem, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_LoadVector()->memory_size() > 16 && n->as_LoadVector()->memory_size() < MaxVectorSize); match(Set dst (LoadVector mem)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(6 * SVE_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_ldr $dst, $pTmp, $mem\t# load vector predicated" %} + format %{ "sve_whilelo_zr_imm $pgtmp, vector_length\n\t" + "sve_ldr $dst, $pgtmp, $mem\t# load vector partial" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ elemType_to_regVariant(bt), + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), Matcher::vector_length(this)); FloatRegister dst_reg = as_FloatRegister($dst$$reg); loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, dst_reg, - as_PRegister($pTmp$$reg), bt, bt, $mem->opcode(), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); %} ins_pipe(pipe_slow); %} -instruct storeV_partial(vReg src, vmemA mem, pRegGov pTmp, rFlagsReg cr) %{ +instruct storeV_partial(vReg src, vmemA mem, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_StoreVector()->memory_size() > 16 && n->as_StoreVector()->memory_size() < MaxVectorSize); match(Set mem (StoreVector mem src)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(5 * SVE_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_str $src, $pTmp, $mem\t# store vector predicated" %} + format %{ "sve_whilelo_zr_imm $pgtmp, vector_length\n\t" + "sve_str $src, $pgtmp, $mem\t# store vector partial" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ elemType_to_regVariant(bt), + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), Matcher::vector_length(this, $src)); FloatRegister src_reg = as_FloatRegister($src$$reg); loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, src_reg, - as_PRegister($pTmp$$reg), bt, bt, $mem->opcode(), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); %} ins_pipe(pipe_slow); -%}dnl +%} + +// vector load/store - predicated + +instruct loadV_masked(vReg dst, vmemA mem, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() == MaxVectorSize); + match(Set dst (LoadVectorMasked mem pg)); + ins_cost(4 * SVE_COST); + format %{ "sve_ldr $dst, $pg, $mem\t# load vector predicated (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($dst$$reg), + as_PRegister($pg$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +instruct loadV_masked_partial(vReg dst, vmemA mem, pRegGov pg, pRegGov pgtmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() < MaxVectorSize); + match(Set dst (LoadVectorMasked mem pg)); + effect(TEMP pgtmp, KILL cr); + ins_cost(6 * SVE_COST); + format %{ "sve_ldr $dst, $pg, $mem\t# load vector predicated partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), + Matcher::vector_length(this)); + __ sve_and(as_PRegister($pgtmp$$reg), as_PRegister($pgtmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($dst$$reg), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +instruct storeV_masked(vReg src, vmemA mem, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() == MaxVectorSize); + match(Set mem (StoreVectorMasked mem (Binary src pg))); + ins_cost(4 * SVE_COST); + format %{ "sve_str $mem, $pg, $src\t# store vector predicated (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($src$$reg), + as_PRegister($pg$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +instruct storeV_masked_partial(vReg src, vmemA mem, pRegGov pg, pRegGov pgtmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() < MaxVectorSize); + match(Set mem (StoreVectorMasked mem (Binary src pg))); + effect(TEMP pgtmp, KILL cr); + ins_cost(6 * SVE_COST); + format %{ "sve_str $mem, $pg, $src\t# store vector predicated partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ elemType_to_regVariant(bt), + Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($pgtmp$$reg), as_PRegister($pgtmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($src$$reg), + as_PRegister($pgtmp$$reg), bt, bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} + +dnl +dnl MASKALL_IMM($1, $2 ) +dnl MASKALL_IMM(type, size) +define(`MASKALL_IMM', ` +instruct vmaskAll_imm$1(pRegGov dst, imm$1 src) %{ + predicate(UseSVE > 0); + match(Set dst (MaskAll src)); + ins_cost(SVE_COST); + format %{ "sve_ptrue/sve_pfalse $dst\t# mask all (sve) ($2)" %} + ins_encode %{ + ifelse($1, `I', int, long) con = (ifelse($1, `I', int, long))$src$$constant; + if (con == 0) { + __ sve_pfalse(as_PRegister($dst$$reg)); + } else { + assert(con == -1, "invalid constant value for mask"); + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_ptrue(as_PRegister($dst$$reg), __ elemType_to_regVariant(bt)); + } + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +dnl MASKALL($1, $2 ) +dnl MASKALL(type, size) +define(`MASKALL', ` +instruct vmaskAll$1(pRegGov dst, ifelse($1, `I', iRegIorL2I, iRegL) src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0); + match(Set dst (MaskAll src)); + effect(TEMP tmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "sve_dup $tmp, $src\n\t" + "sve_cmpne $dst, $tmp, 0\t# mask all (sve) ($2)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_dup(as_FloatRegister($tmp$$reg), size, as_Register($src$$reg)); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($tmp$$reg), 0); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +// maskAll +MASKALL_IMM(I, B/H/S) +MASKALL(I, B/H/S) +MASKALL_IMM(L, D) +MASKALL(L, D) + +dnl +dnl MASK_LOGICAL_OP($1, $2, $3 ) +dnl MASK_LOGICAL_OP(insn_name, op_name, insn) +define(`MASK_LOGICAL_OP', ` +instruct vmask_$1(pRegGov pd, pRegGov pn, pRegGov pm) %{ + predicate(UseSVE > 0); + match(Set pd ($2 pn pm)); + ins_cost(SVE_COST); + format %{ "$3 $pd, $pn, $pm\t# predicate (sve)" %} + ins_encode %{ + __ $3(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +// mask logical and/or/xor +MASK_LOGICAL_OP(and, AndVMask, sve_and) +MASK_LOGICAL_OP(or, OrVMask, sve_orr) +MASK_LOGICAL_OP(xor, XorVMask, sve_eor) +dnl +dnl MASK_LOGICAL_AND_NOT($1, $2 ) +dnl MASK_LOGICAL_AND_NOT(type, size) +define(`MASK_LOGICAL_AND_NOT', ` +instruct vmask_and_not$1(pRegGov pd, pRegGov pn, pRegGov pm, imm$1_M1 m1) %{ + predicate(UseSVE > 0); + match(Set pd (AndVMask pn (XorVMask pm (MaskAll m1)))); + ins_cost(SVE_COST); + format %{ "sve_bic $pd, $pn, $pm\t# predciate (sve) ($2)" %} + ins_encode %{ + __ sve_bic(as_PRegister($pd$$reg), ptrue, + as_PRegister($pn$$reg), as_PRegister($pm$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +// mask logical and_not +MASK_LOGICAL_AND_NOT(I, B/H/S) +MASK_LOGICAL_AND_NOT(L, D) // vector reinterpret @@ -286,11 +450,11 @@ instruct reinterpret(vReg dst) %{ ins_pipe(pipe_class_empty); %} -instruct reinterpretResize(vReg dst, vReg src, pRegGov pTmp, rFlagsReg cr) %{ +instruct reinterpretResize(vReg dst, vReg src, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length_in_bytes() != n->in(1)->bottom_type()->is_vect()->length_in_bytes()); // src != dst match(Set dst (VectorReinterpret src)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(3 * SVE_COST); format %{ "reinterpretResize $dst, $src\t# vector (sve)" %} ins_encode %{ @@ -300,25 +464,59 @@ instruct reinterpretResize(vReg dst, vReg src, pRegGov pTmp, rFlagsReg cr) %{ length_in_bytes_src : length_in_bytes_dst; assert(length_in_bytes_src <= MaxVectorSize && length_in_bytes_dst <= MaxVectorSize, "invalid vector length"); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ B, length_in_bytes_resize); + __ sve_whilelo_zr_imm(as_PRegister($pgtmp$$reg), __ B, length_in_bytes_resize); __ sve_dup(as_FloatRegister($dst$$reg), __ B, 0); - __ sve_sel(as_FloatRegister($dst$$reg), __ B, as_PRegister($pTmp$$reg), + __ sve_sel(as_FloatRegister($dst$$reg), __ B, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), as_FloatRegister($dst$$reg)); %} ins_pipe(pipe_slow); %} + +// vector mask reinterpret + +instruct vmask_reinterpret_same_esize(pRegGov dst_src) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length() == n->in(1)->bottom_type()->is_vect()->length() && + n->as_Vector()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); + match(Set dst_src (VectorReinterpret dst_src)); + ins_cost(0); + format %{ "# vmask_reinterpret $dst_src\t# do nothing" %} + ins_encode %{ + // empty + %} + ins_pipe(pipe_class_empty); +%} + +instruct vmask_reinterpret_diff_esize(pRegGov dst, pRegGov src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length() != n->in(1)->bottom_type()->is_vect()->length() && + n->as_Vector()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); + match(Set dst (VectorReinterpret src)); + effect(TEMP tmp, KILL cr); + ins_cost(2 * SVE_COST); + format %{ "# vmask_reinterpret $dst, $src\t# vector (sve)" %} + ins_encode %{ + BasicType from_bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant from_size = __ elemType_to_regVariant(from_bt); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_cpy(as_FloatRegister($tmp$$reg), from_size, as_PRegister($src$$reg), -1, false); + __ sve_cmp(Assembler::EQ, as_PRegister($dst$$reg), to_size, ptrue, as_FloatRegister($tmp$$reg), -1); + %} + ins_pipe(pipe_slow); +%} dnl -dnl UNARY_OP_TRUE_PREDICATE_ETYPE($1, $2, $3, $4, $5, %6 ) -dnl UNARY_OP_TRUE_PREDICATE_ETYPE(insn_name, op_name, element_type, size, min_vec_len, insn) -define(`UNARY_OP_TRUE_PREDICATE_ETYPE', ` +dnl UNARY_OP_TRUE_PREDICATE($1, $2, $3, $4 ) +dnl UNARY_OP_TRUE_PREDICATE(insn_name, op_name, size, insn) +define(`UNARY_OP_TRUE_PREDICATE', ` instruct $1(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == $3); + !n->as_Vector()->is_predicated_vector()); match(Set dst ($2 src)); ins_cost(SVE_COST); - format %{ "$6 $dst, $src\t# vector (sve) ($4)" %} + format %{ "$4 $dst, $src\t# vector (sve) ($3)" %} ins_encode %{ - __ $6(as_FloatRegister($dst$$reg), __ $4, + __ $4(as_FloatRegister($dst$$reg), __ $3, ptrue, as_FloatRegister($src$$reg)); %} ins_pipe(pipe_slow); @@ -326,16 +524,40 @@ instruct $1(vReg dst, vReg src) %{ dnl // vector abs -UNARY_OP_TRUE_PREDICATE_ETYPE(vabsB, AbsVB, T_BYTE, B, 16, sve_abs) -UNARY_OP_TRUE_PREDICATE_ETYPE(vabsS, AbsVS, T_SHORT, H, 8, sve_abs) -UNARY_OP_TRUE_PREDICATE_ETYPE(vabsI, AbsVI, T_INT, S, 4, sve_abs) -UNARY_OP_TRUE_PREDICATE_ETYPE(vabsL, AbsVL, T_LONG, D, 2, sve_abs) -UNARY_OP_TRUE_PREDICATE_ETYPE(vabsF, AbsVF, T_FLOAT, S, 4, sve_fabs) -UNARY_OP_TRUE_PREDICATE_ETYPE(vabsD, AbsVD, T_DOUBLE, D, 2, sve_fabs) -dnl -dnl BINARY_OP_UNPREDICATED($1, $2 $3, $4 $5 ) -dnl BINARY_OP_UNPREDICATED(insn_name, op_name, size, min_vec_len, insn) -define(`BINARY_OP_UNPREDICATED', ` +UNARY_OP_TRUE_PREDICATE(vabsB, AbsVB, B, sve_abs) +UNARY_OP_TRUE_PREDICATE(vabsS, AbsVS, H, sve_abs) +UNARY_OP_TRUE_PREDICATE(vabsI, AbsVI, S, sve_abs) +UNARY_OP_TRUE_PREDICATE(vabsL, AbsVL, D, sve_abs) +UNARY_OP_TRUE_PREDICATE(vabsF, AbsVF, S, sve_fabs) +UNARY_OP_TRUE_PREDICATE(vabsD, AbsVD, D, sve_fabs) + +dnl UNARY_OP_PREDICATE($1, $2, $3, $4 ) +dnl UNARY_OP_PREDICATE(insn_name, op_name, size, insn) +define(`UNARY_OP_PREDICATE', ` +instruct $1_masked(vReg dst_src, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src ($2 dst_src pg)); + ins_cost(SVE_COST); + format %{ "$4 $dst_src, $pg, $dst_src\t# vector (sve) ($3)" %} + ins_encode %{ + __ $4(as_FloatRegister($dst_src$$reg), __ $3, + as_PRegister($pg$$reg), + as_FloatRegister($dst_src$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +// vector abs - predicated +UNARY_OP_PREDICATE(vabsB, AbsVB, B, sve_abs) +UNARY_OP_PREDICATE(vabsS, AbsVS, H, sve_abs) +UNARY_OP_PREDICATE(vabsI, AbsVI, S, sve_abs) +UNARY_OP_PREDICATE(vabsL, AbsVL, D, sve_abs) +UNARY_OP_PREDICATE(vabsF, AbsVF, S, sve_fabs) +UNARY_OP_PREDICATE(vabsD, AbsVD, D, sve_fabs) + +dnl +dnl BINARY_OP_UNPREDICATE($1, $2 $3, $4 $5 ) +dnl BINARY_OP_UNPREDICATE(insn_name, op_name, size, min_vec_len, insn) +define(`BINARY_OP_UNPREDICATE', ` instruct $1(vReg dst, vReg src1, vReg src2) %{ predicate(UseSVE > 0); match(Set dst ($2 src1 src2)); @@ -348,39 +570,92 @@ instruct $1(vReg dst, vReg src1, vReg src2) %{ %} ins_pipe(pipe_slow); %}')dnl - +dnl +dnl +dnl BINARY_OP_PREDICATE($1, $2, $3, $4 ) +dnl BINARY_OP_PREDICATE(insn_name, op_name, size, insn) +define(`BINARY_OP_PREDICATE', ` +instruct $1_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 ($2 (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "$4 $dst_src1, $pg, $dst_src1, $src2\t# vector (sve) ($3)" %} + ins_encode %{ + __ $4(as_FloatRegister($dst_src1$$reg), __ $3, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl // vector add -BINARY_OP_UNPREDICATED(vaddB, AddVB, B, 16, sve_add) -BINARY_OP_UNPREDICATED(vaddS, AddVS, H, 8, sve_add) -BINARY_OP_UNPREDICATED(vaddI, AddVI, S, 4, sve_add) -BINARY_OP_UNPREDICATED(vaddL, AddVL, D, 2, sve_add) -BINARY_OP_UNPREDICATED(vaddF, AddVF, S, 4, sve_fadd) -BINARY_OP_UNPREDICATED(vaddD, AddVD, D, 2, sve_fadd) -dnl -dnl BINARY_OP_UNSIZED($1, $2, $3, $4 ) -dnl BINARY_OP_UNSIZED(insn_name, op_name, min_vec_len, insn) +BINARY_OP_UNPREDICATE(vaddB, AddVB, B, 16, sve_add) +BINARY_OP_UNPREDICATE(vaddS, AddVS, H, 8, sve_add) +BINARY_OP_UNPREDICATE(vaddI, AddVI, S, 4, sve_add) +BINARY_OP_UNPREDICATE(vaddL, AddVL, D, 2, sve_add) +BINARY_OP_UNPREDICATE(vaddF, AddVF, S, 4, sve_fadd) +BINARY_OP_UNPREDICATE(vaddD, AddVD, D, 2, sve_fadd) + +// vector add - predicated +BINARY_OP_PREDICATE(vaddB, AddVB, B, sve_add) +BINARY_OP_PREDICATE(vaddS, AddVS, H, sve_add) +BINARY_OP_PREDICATE(vaddI, AddVI, S, sve_add) +BINARY_OP_PREDICATE(vaddL, AddVL, D, sve_add) +BINARY_OP_PREDICATE(vaddF, AddVF, S, sve_fadd) +BINARY_OP_PREDICATE(vaddD, AddVD, D, sve_fadd) + +dnl +dnl BINARY_OP_UNSIZED($1, $2, $3 ) +dnl BINARY_OP_UNSIZED(insn_name, op_name, insn) define(`BINARY_OP_UNSIZED', ` instruct $1(vReg dst, vReg src1, vReg src2) %{ predicate(UseSVE > 0); match(Set dst ($2 src1 src2)); ins_cost(SVE_COST); - format %{ "$4 $dst, $src1, $src2\t# vector (sve)" %} + format %{ "$3 $dst, $src1, $src2\t# vector (sve)" %} ins_encode %{ - __ $4(as_FloatRegister($dst$$reg), + __ $3(as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); %}')dnl - +dnl // vector and -BINARY_OP_UNSIZED(vand, AndV, 16, sve_and) +BINARY_OP_UNSIZED(vand, AndV, sve_and) // vector or -BINARY_OP_UNSIZED(vor, OrV, 16, sve_orr) +BINARY_OP_UNSIZED(vor, OrV, sve_orr) // vector xor -BINARY_OP_UNSIZED(vxor, XorV, 16, sve_eor) +BINARY_OP_UNSIZED(vxor, XorV, sve_eor) + +dnl BINARY_LOGIC_OP_PREDICATE($1, $2, $3 ) +dnl BINARY_LOGIC_OP_PREDICATE(insn_name, op_name, insn) +define(`BINARY_LOGIC_OP_PREDICATE', ` +instruct $1_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src1 ($2 (Binary dst_src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "$3 $dst_src1, $pg, $dst_src1, $src2\t # vector (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ $3(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +// vector and - predicated +BINARY_LOGIC_OP_PREDICATE(vand, AndV, sve_and) + +// vector or - predicated +BINARY_LOGIC_OP_PREDICATE(vor, OrV, sve_orr) + +// vector xor - predicated +BINARY_LOGIC_OP_PREDICATE(vxor, XorV, sve_eor) // vector not dnl @@ -406,7 +681,7 @@ dnl $1,$2 VECTOR_NOT(I, B/H/S) VECTOR_NOT(L, D) undefine(MATCH_RULE) - +dnl // vector and_not dnl define(`MATCH_RULE', `ifelse($1, I, @@ -447,52 +722,70 @@ instruct vdiv$1(vReg dst_src1, vReg src2) %{ %} ins_pipe(pipe_slow); %}')dnl - +dnl // vector float div VDIVF(F, S, 4) VDIVF(D, D, 2) -// vector min/max +// vector float div - predicated +BINARY_OP_PREDICATE(vfdivF, DivVF, S, sve_fdiv) +BINARY_OP_PREDICATE(vfdivD, DivVD, D, sve_fdiv) -instruct vmin(vReg dst_src1, vReg src2) %{ +dnl +dnl VMINMAX($1 , $2, $3 , $4 ) +dnl VMINMAX(op_name, op, finsn, insn) +define(`VMINMAX', ` +instruct v$1(vReg dst_src1, vReg src2) %{ predicate(UseSVE > 0); - match(Set dst_src1 (MinV dst_src1 src2)); + match(Set dst_src1 ($2 dst_src1 src2)); ins_cost(SVE_COST); - format %{ "sve_min $dst_src1, $dst_src1, $src2\t # vector (sve)" %} + format %{ "sve_$1 $dst_src1, $dst_src1, $src2\t # vector (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); if (is_floating_point_type(bt)) { - __ sve_fmin(as_FloatRegister($dst_src1$$reg), size, + __ $3(as_FloatRegister($dst_src1$$reg), size, ptrue, as_FloatRegister($src2$$reg)); } else { - assert(is_integral_type(bt), "Unsupported type"); - __ sve_smin(as_FloatRegister($dst_src1$$reg), size, + assert(is_integral_type(bt), "unsupported type"); + __ $4(as_FloatRegister($dst_src1$$reg), size, ptrue, as_FloatRegister($src2$$reg)); } %} ins_pipe(pipe_slow); -%} +%}')dnl +dnl +// vector min/max +VMINMAX(min, MinV, sve_fmin, sve_smin) +VMINMAX(max, MaxV, sve_fmax, sve_smax) -instruct vmax(vReg dst_src1, vReg src2) %{ +dnl +dnl VMINMAX_PREDICATE($1 , $2, $3 , $4 ) +dnl VMINMAX_PREDICATE(op_name, op, finsn, insn) +define(`VMINMAX_PREDICATE', ` +instruct v$1_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst_src1 (MaxV dst_src1 src2)); + match(Set dst_src1 ($2 (Binary dst_src1 src2) pg)); ins_cost(SVE_COST); - format %{ "sve_max $dst_src1, $dst_src1, $src2\t # vector (sve)" %} + format %{ "sve_$1 $dst_src1, $pg, $dst_src1, $src2\t# vector (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); if (is_floating_point_type(bt)) { - __ sve_fmax(as_FloatRegister($dst_src1$$reg), size, - ptrue, as_FloatRegister($src2$$reg)); + __ $3(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); } else { - assert(is_integral_type(bt), "Unsupported type"); - __ sve_smax(as_FloatRegister($dst_src1$$reg), size, - ptrue, as_FloatRegister($src2$$reg)); + assert(is_integral_type(bt), "unsupported type"); + __ $4(as_FloatRegister($dst_src1$$reg), size, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); } %} ins_pipe(pipe_slow); -%} +%}')dnl +dnl +// vector min/max - predicated +VMINMAX_PREDICATE(min, MinV, sve_fmin, sve_smin) +VMINMAX_PREDICATE(max, MaxV, sve_fmax, sve_smax) dnl dnl VFMLA($1 $2 $3 ) @@ -515,6 +808,27 @@ dnl VFMLA(F, S, 4) VFMLA(D, D, 2) +dnl +dnl VFMLA_PREDICATE($1, $2 ) +dnl VFMLA_PREDICATE(type, size) +define(`VFMLA_PREDICATE', ` +// dst_src1 = dst_src1 * src2 + src3 +instruct vfmla$1_masked(vReg dst_src1, vReg src2, vReg src3, pRegGov pg) %{ + predicate(UseFMA && UseSVE > 0); + match(Set dst_src1 (FmaV$1 (Binary dst_src1 src2) (Binary src3 pg))); + ins_cost(SVE_COST); + format %{ "sve_fmad $dst_src1, $pg, $src2, $src3\t# vector (sve) ($2)" %} + ins_encode %{ + __ sve_fmad(as_FloatRegister($dst_src1$$reg), __ $2, as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg), as_FloatRegister($src3$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +// vector fmla - predicated +VFMLA_PREDICATE(F, S) +VFMLA_PREDICATE(D, D) + dnl dnl VFMLS($1 $2 $3 ) dnl VFMLS(name_suffix, size, min_vec_len) @@ -645,34 +959,30 @@ instruct $1(vReg dst_src1, vReg src2) %{ %} ins_pipe(pipe_slow); %}')dnl - +dnl // vector mul BINARY_OP_TRUE_PREDICATE(vmulB, MulVB, B, 16, sve_mul) BINARY_OP_TRUE_PREDICATE(vmulS, MulVS, H, 8, sve_mul) BINARY_OP_TRUE_PREDICATE(vmulI, MulVI, S, 4, sve_mul) BINARY_OP_TRUE_PREDICATE(vmulL, MulVL, D, 2, sve_mul) -BINARY_OP_UNPREDICATED(vmulF, MulVF, S, 4, sve_fmul) -BINARY_OP_UNPREDICATED(vmulD, MulVD, D, 2, sve_fmul) +BINARY_OP_UNPREDICATE(vmulF, MulVF, S, 4, sve_fmul) +BINARY_OP_UNPREDICATE(vmulD, MulVD, D, 2, sve_fmul) + +// vector mul - predicated +BINARY_OP_PREDICATE(vmulB, MulVB, B, sve_mul) +BINARY_OP_PREDICATE(vmulS, MulVS, H, sve_mul) +BINARY_OP_PREDICATE(vmulI, MulVI, S, sve_mul) +BINARY_OP_PREDICATE(vmulL, MulVL, D, sve_mul) +BINARY_OP_PREDICATE(vmulF, MulVF, S, sve_fmul) +BINARY_OP_PREDICATE(vmulD, MulVD, D, sve_fmul) -dnl -dnl UNARY_OP_TRUE_PREDICATE($1, $2, $3, $4, $5 ) -dnl UNARY_OP_TRUE_PREDICATE(insn_name, op_name, size, min_vec_bytes, insn) -define(`UNARY_OP_TRUE_PREDICATE', ` -instruct $1(vReg dst, vReg src) %{ - predicate(UseSVE > 0); - match(Set dst ($2 src)); - ins_cost(SVE_COST); - format %{ "$5 $dst, $src\t# vector (sve) ($3)" %} - ins_encode %{ - __ $5(as_FloatRegister($dst$$reg), __ $3, - ptrue, as_FloatRegister($src$$reg)); - %} - ins_pipe(pipe_slow); -%}')dnl -dnl // vector fneg -UNARY_OP_TRUE_PREDICATE(vnegF, NegVF, S, 16, sve_fneg) -UNARY_OP_TRUE_PREDICATE(vnegD, NegVD, D, 16, sve_fneg) +UNARY_OP_TRUE_PREDICATE(vnegF, NegVF, S, sve_fneg) +UNARY_OP_TRUE_PREDICATE(vnegD, NegVD, D, sve_fneg) + +// vector fneg - predicated +UNARY_OP_PREDICATE(vnegF, NegVF, S, sve_fneg) +UNARY_OP_PREDICATE(vnegD, NegVD, D, sve_fneg) // popcount vector @@ -688,354 +998,307 @@ instruct vpopcountI(vReg dst, vReg src) %{ // vector mask compare -instruct vmaskcmp(vReg dst, vReg src1, vReg src2, immI cond, pRegGov pTmp, rFlagsReg cr) %{ +instruct vmaskcmp(pRegGov dst, vReg src1, vReg src2, immI cond, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); - effect(TEMP pTmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "sve_cmp $pTmp, $src1, $src2\n\t" - "sve_cpy $dst, $pTmp, -1\t# vector mask cmp (sve)" %} + effect(KILL cr); + ins_cost(SVE_COST); + format %{ "sve_cmp $dst, $src1, $src2\t# vector mask cmp (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_compare(as_PRegister($pTmp$$reg), bt, ptrue, as_FloatRegister($src1$$reg), + __ sve_compare(as_PRegister($dst$$reg), bt, ptrue, as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg), (int)$cond$$constant); - __ sve_cpy(as_FloatRegister($dst$$reg), __ elemType_to_regVariant(bt), - as_PRegister($pTmp$$reg), -1, false); %} ins_pipe(pipe_slow); %} -// vector blend - -instruct vblend(vReg dst, vReg src1, vReg src2, vReg src3, pRegGov pTmp, rFlagsReg cr) %{ +instruct vmaskcmp_masked(pRegGov dst, vReg src1, vReg src2, immI cond, pRegGov pg, rFlagsReg cr) %{ predicate(UseSVE > 0); - match(Set dst (VectorBlend (Binary src1 src2) src3)); - effect(TEMP pTmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "sve_cmpeq $pTmp, $src3, -1\n\t" - "sve_sel $dst, $pTmp, $src2, $src1\t# vector blend (sve)" %} + match(Set dst (VectorMaskCmp (Binary src1 src2) (Binary cond pg))); + effect(KILL cr); + ins_cost(SVE_COST); + format %{ "sve_cmp $dst, $pg, $src1, $src2\t# vector mask cmp (sve)" %} ins_encode %{ - Assembler::SIMD_RegVariant size = - __ elemType_to_regVariant(Matcher::vector_element_basic_type(this)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - ptrue, as_FloatRegister($src3$$reg), -1); - __ sve_sel(as_FloatRegister($dst$$reg), size, as_PRegister($pTmp$$reg), - as_FloatRegister($src2$$reg), as_FloatRegister($src1$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + __ sve_compare(as_PRegister($dst$$reg), bt, as_PRegister($pg$$reg), as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg), (int)$cond$$constant); %} ins_pipe(pipe_slow); %} -// vector blend with compare +// vector blend -instruct vblend_maskcmp(vReg dst, vReg src1, vReg src2, vReg src3, - vReg src4, pRegGov pTmp, immI cond, rFlagsReg cr) %{ +instruct vblend(vReg dst, vReg src1, vReg src2, pRegGov pg) %{ predicate(UseSVE > 0); - match(Set dst (VectorBlend (Binary src1 src2) (VectorMaskCmp (Binary src3 src4) cond))); - effect(TEMP pTmp, KILL cr); - ins_cost(2 * SVE_COST); - format %{ "sve_cmp $pTmp, $src3, $src4\t# vector cmp (sve)\n\t" - "sve_sel $dst, $pTmp, $src2, $src1\t# vector blend (sve)" %} + match(Set dst (VectorBlend (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_sel $dst, $pg, $src2, $src1\t# vector blend (sve)" %} ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this); - __ sve_compare(as_PRegister($pTmp$$reg), bt, ptrue, as_FloatRegister($src3$$reg), - as_FloatRegister($src4$$reg), (int)$cond$$constant); - __ sve_sel(as_FloatRegister($dst$$reg), __ elemType_to_regVariant(bt), - as_PRegister($pTmp$$reg), as_FloatRegister($src2$$reg), - as_FloatRegister($src1$$reg)); + Assembler::SIMD_RegVariant size = + __ elemType_to_regVariant(Matcher::vector_element_basic_type(this)); + __ sve_sel(as_FloatRegister($dst$$reg), size, as_PRegister($pg$$reg), + as_FloatRegister($src2$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %} // vector load mask -instruct vloadmaskB(vReg dst, vReg src) %{ +instruct vloadmaskB(pRegGov dst, vReg src, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); match(Set dst (VectorLoadMask src)); + effect(KILL cr); ins_cost(SVE_COST); - format %{ "sve_neg $dst, $src\t# vector load mask (B)" %} - ins_encode %{ - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, as_FloatRegister($src$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vloadmaskS(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorLoadMask src)); - ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_neg $dst, $dst\t# vector load mask (B to H)" %} + format %{ "vloadmaskB $dst, $src\t# vector load mask (sve) (B)" %} ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ H, ptrue, as_FloatRegister($dst$$reg)); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), __ B, + ptrue, as_FloatRegister($src$$reg), 0); %} ins_pipe(pipe_slow); %} -instruct vloadmaskI(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_INT || - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); +instruct vloadmask_extend(pRegGov dst, vReg src, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() != T_BYTE); match(Set dst (VectorLoadMask src)); + effect(TEMP tmp, KILL cr); ins_cost(3 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\n\t" - "sve_neg $dst, $dst\t# vector load mask (B to S)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct vloadmaskL(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); - match(Set dst (VectorLoadMask src)); - ins_cost(4 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\n\t" - "sve_uunpklo $dst, D, $dst\n\t" - "sve_neg $dst, $dst\t# vector load mask (B to D)" %} + format %{ "vloadmask $dst, $src\t# vector load mask (sve) (H/S/D)" %} ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_vector_extend(as_FloatRegister($tmp$$reg), size, as_FloatRegister($src$$reg), __ B); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($tmp$$reg), 0); %} ins_pipe(pipe_slow); %} // vector store mask -instruct vstoremaskB(vReg dst, vReg src, immI_1 size) %{ +instruct vstoremaskB(vReg dst, pRegGov src, immI_1 size) %{ predicate(UseSVE > 0); match(Set dst (VectorStoreMask src size)); ins_cost(SVE_COST); - format %{ "sve_neg $dst, $src\t# vector store mask (B)" %} + format %{ "vstoremask $dst, $src\t# vector store mask (sve) (B)" %} ins_encode %{ - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($src$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ B, as_PRegister($src$$reg), 1, false); %} ins_pipe(pipe_slow); %} -instruct vstoremaskS(vReg dst, vReg src, vReg tmp, immI_2 size) %{ +instruct vstoremask_narrow(vReg dst, pRegGov src, vReg tmp, immI_gt_1 size) %{ predicate(UseSVE > 0); match(Set dst (VectorStoreMask src size)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_dup $tmp, H, 0\n\t" - "sve_uzp1 $dst, B, $src, $tmp\n\t" - "sve_neg $dst, B, $dst\t# vector store mask (sve) (H to B)" %} + format %{ "vstoremask $dst, $src\t# vector store mask (sve) (H/S/D)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ H, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($dst$$reg)); - + Assembler::SIMD_RegVariant size = __ elemBytes_to_regVariant((int)$size$$constant); + __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($src$$reg), 1, false); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($dst$$reg), size, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %} -instruct vstoremaskI(vReg dst, vReg src, vReg tmp, immI_4 size) %{ - predicate(UseSVE > 0); - match(Set dst (VectorStoreMask src size)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_dup $tmp, S, 0\n\t" - "sve_uzp1 $dst, H, $src, $tmp\n\t" - "sve_uzp1 $dst, B, $dst, $tmp\n\t" - "sve_neg $dst, B, $dst\t# vector store mask (sve) (S to B)" %} - ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ S, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, - as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} +// Combine LoadVector+VectorLoadMask when the vector element type is not T_BYTE -instruct vstoremaskL(vReg dst, vReg src, vReg tmp, immI_8 size) %{ - predicate(UseSVE > 0); - match(Set dst (VectorStoreMask src size)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_dup $tmp, D, 0\n\t" - "sve_uzp1 $dst, S, $src, $tmp\n\t" - "sve_uzp1 $dst, H, $dst, $tmp\n\t" - "sve_uzp1 $dst, B, $dst, $tmp\n\t" - "sve_neg $dst, B, $dst\t# vector store mask (sve) (D to B)" %} +instruct vloadmask_loadV(pRegGov dst, indirect mem, vReg tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length_in_bytes() == MaxVectorSize && + type2aelembytes(n->bottom_type()->is_vect()->element_basic_type()) > 1); + match(Set dst (VectorLoadMask (LoadVector mem))); + effect(TEMP tmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_ld1b $tmp, $mem\n\t" + "sve_cmpne $dst, $tmp, 0\t# load vector mask (sve) (H/S/D)" %} ins_encode %{ - __ sve_dup(as_FloatRegister($tmp$$reg), __ D, 0); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ S, - as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ H, - as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_uzp1(as_FloatRegister($dst$$reg), __ B, - as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_neg(as_FloatRegister($dst$$reg), __ B, ptrue, - as_FloatRegister($dst$$reg)); + // Load mask values which are boolean type, and extend them to the + // expected vector element type. Convert the vector to predicate. + BasicType to_vect_bt = Matcher::vector_element_basic_type(this); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($tmp$$reg), + ptrue, T_BOOLEAN, to_vect_bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), __ elemType_to_regVariant(to_vect_bt), + ptrue, as_FloatRegister($tmp$$reg), 0); %} ins_pipe(pipe_slow); %} -dnl -dnl -dnl VLOADMASK_LOADV($1, $2 ) -dnl VLOADMASK_LOADV(esize, cond) -define(`VLOADMASK_LOADV', ` -instruct vloadmask_loadV_$1(vReg dst, ifelse($1, `byte', vmemA, indirect) mem) %{ - predicate(UseSVE > 0 && n->as_Vector()->length_in_bytes() == MaxVectorSize && - type2aelembytes(n->bottom_type()->is_vect()->element_basic_type()) $2); + +instruct vloadmask_loadV_partial(pRegGov dst, indirect mem, vReg vtmp, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_Vector()->length_in_bytes() > 16 && + n->as_Vector()->length_in_bytes() < MaxVectorSize && + type2aelembytes(n->bottom_type()->is_vect()->element_basic_type()) > 1); match(Set dst (VectorLoadMask (LoadVector mem))); - ins_cost(5 * SVE_COST); - format %{ "sve_ld1b $dst, $mem\n\t" - "sve_neg $dst, $dst\t# load vector mask (sve)" %} + effect(TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(6 * SVE_COST); + format %{ "vloadmask_loadV $dst, $mem\t# load vector mask partial (sve) (H/S/D)" %} ins_encode %{ - FloatRegister dst_reg = as_FloatRegister($dst$$reg); + // Load valid mask values which are boolean type, and extend them to the + // expected vector element type. Convert the vector to predicate. BasicType to_vect_bt = Matcher::vector_element_basic_type(this); - Assembler::SIMD_RegVariant to_vect_variant = __ elemType_to_regVariant(to_vect_bt); - loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, dst_reg, ptrue, - T_BOOLEAN, to_vect_bt, $mem->opcode(), + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(to_vect_bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), false, as_FloatRegister($vtmp$$reg), + as_PRegister($ptmp$$reg), T_BOOLEAN, to_vect_bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); - __ sve_neg(dst_reg, to_vect_variant, ptrue, dst_reg); + __ sve_cmp(Assembler::NE, as_PRegister($dst$$reg), size, ptrue, as_FloatRegister($vtmp$$reg), 0); %} ins_pipe(pipe_slow); -%}')dnl -dnl -define(`ARGLIST', -`ifelse($1, `byte', vmemA, indirect) mem, vReg src, vReg tmp, ifelse($1, `byte', immI_1, immI_gt_1) esize') -dnl -dnl STOREV_VSTOREMASK($1, ) -dnl STOREV_VSTOREMASK(esize) -define(`STOREV_VSTOREMASK', ` -instruct storeV_vstoremask_$1(ARGLIST($1)) %{ - predicate(UseSVE > 0 && n->as_StoreVector()->memory_size() * - n->as_StoreVector()->in(MemNode::ValueIn)->in(2)->get_int() == MaxVectorSize); +%} + +// Combine VectorStoreMask+StoreVector when the vector element type is not T_BYTE + +instruct storeV_vstoremask(indirect mem, pRegGov src, vReg tmp, immI_gt_1 esize) %{ + predicate(UseSVE > 0 && + Matcher::vector_length_in_bytes(n->as_StoreVector()->in(MemNode::ValueIn)->in(1)) == MaxVectorSize); match(Set mem (StoreVector mem (VectorStoreMask src esize))); effect(TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_neg $tmp, $src\n\t" - "sve_st1b $tmp, $mem\t# store vector mask (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_cpy $tmp, $src, 1\n\t" + "sve_st1b $tmp, $mem\t# store vector mask (sve) (H/S/D)" %} ins_encode %{ BasicType from_vect_bt = Matcher::vector_element_basic_type(this, $src); assert(type2aelembytes(from_vect_bt) == (int)$esize$$constant, "unsupported type."); - Assembler::SIMD_RegVariant from_vect_variant = __ elemBytes_to_regVariant($esize$$constant); - __ sve_neg(as_FloatRegister($tmp$$reg), from_vect_variant, ptrue, - as_FloatRegister($src$$reg)); + Assembler::SIMD_RegVariant size = __ elemBytes_to_regVariant($esize$$constant); + __ sve_cpy(as_FloatRegister($tmp$$reg), size, as_PRegister($src$$reg), 1, false); loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($tmp$$reg), ptrue, T_BOOLEAN, from_vect_bt, $mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); %} ins_pipe(pipe_slow); -%}')dnl -undefine(ARGLIST)dnl -dnl -// load/store mask vector -VLOADMASK_LOADV(byte, == 1) -VLOADMASK_LOADV(non_byte, > 1) -STOREV_VSTOREMASK(byte) -STOREV_VSTOREMASK(non_byte) - -// vector add reduction +%} -instruct reduce_addI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (AddReductionVI src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +instruct storeV_vstoremask_partial(indirect mem, pRegGov src, vReg vtmp, + immI_gt_1 esize, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() > 16 && + type2aelembytes(n->as_StoreVector()->vect_type()->element_basic_type()) > 1 && + Matcher::vector_length_in_bytes(n->as_StoreVector()->in(MemNode::ValueIn)->in(1)) < MaxVectorSize); + match(Set mem (StoreVector mem (VectorStoreMask src esize))); + effect(TEMP vtmp, TEMP ptmp, KILL cr); + format %{ "storeV_vstoremask $src, $mem\t# store vector mask partial (sve) (H/S/D)" %} + ins_cost(6 * SVE_COST); + ins_encode %{ + // Convert the valid src predicate to vector, and store the vector + // elements as boolean values. + BasicType from_vect_bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(from_vect_bt); + __ sve_cpy(as_FloatRegister($vtmp$$reg), size, as_PRegister($src$$reg), 1, false); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src)); + loadStoreA_predicated(C2_MacroAssembler(&cbuf), true, as_FloatRegister($vtmp$$reg), + as_PRegister($ptmp$$reg), T_BOOLEAN, from_vect_bt, $mem->opcode(), + as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp); + %} + ins_pipe(pipe_slow); +%} +dnl +dnl REDUCE_I($1, $2 ) +dnl REDUCE_I(insn_name, op_name) +define(`REDUCE_I', ` +instruct reduce_$1I(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp) %{ + ifelse($2, AddReductionVI, + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);') + match(Set dst ($2 src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_addI $dst, $src1, $src2\t# addB/S/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_$1I $dst, $src1, $src2\t# $1I reduction (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_uaddv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ addw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_addI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, +%}')dnl +dnl +dnl +dnl REDUCE_L($1, $2 ) +dnl REDUCE_L(insn_name, op_name) +define(`REDUCE_L', ` +instruct reduce_$1L(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp) %{ + ifelse($2, AddReductionVL, + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);') + match(Set dst ($2 src1 src2)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(SVE_COST); + format %{ "sve_reduce_$1L $dst, $src1, $src2\t# $1L reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +dnl REDUCE_I_PARTIAL($1, $2 ) +dnl REDUCE_I_PARTIAL(insn_name, op_name) +define(`REDUCE_I_PARTIAL', ` +instruct reduce_$1I_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (AddReductionVI src1 src2)); + ifelse($2, AddReductionVI, + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);') + match(Set dst ($2 src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_addI $dst, $src1, $src2\t# addI reduction partial (sve) (may extend)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_$1I $dst, $src1, $src2\t# $1I reduction partial (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_uaddv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ addw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } - %} - ins_pipe(pipe_slow); -%} - -instruct reduce_addL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (AddReductionVL src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); - ins_cost(SVE_COST); - format %{ "sve_reduce_addL $dst, $src1, $src2\t# addL reduction (sve)" %} - ins_encode %{ - __ sve_uaddv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ add($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_addL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, +%}')dnl +dnl +dnl REDUCE_L_PARTIAL($1, $2 ) +dnl REDUCE_L_PARTIAL(insn_name, op_name) +define(`REDUCE_L_PARTIAL', ` +instruct reduce_$1L_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (AddReductionVL src1 src2)); + ifelse($2, AddReductionVL, + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);') + match(Set dst ($2 src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_addL $dst, $src1, $src2\t# addL reduction partial (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_$1L $dst, $src1, $src2\t# $1L reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_uaddv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ add($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); -%} - +%}')dnl dnl dnl REDUCE_ADDF($1, $2, $3, $4 ) dnl REDUCE_ADDF(insn_name, op_name, reg_dst, size) define(`REDUCE_ADDF', ` -instruct $1($3 src1_dst, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set src1_dst (AddReductionV$2 src1_dst src2)); +instruct reduce_$1($3 src1_dst, vReg src2) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set src1_dst ($2 src1_dst src2)); ins_cost(SVE_COST); format %{ "sve_fadda $src1_dst, $src1_dst, $src2\t# vector (sve) ($4)" %} ins_encode %{ @@ -1049,12 +1312,13 @@ dnl dnl REDUCE_ADDF_PARTIAL($1, $2, $3, $4 ) dnl REDUCE_ADDF_PARTIAL(insn_name, suffix, reg_dst, size) define(`REDUCE_ADDF_PARTIAL', ` -instruct $1($3 src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set src1_dst (AddReductionV$2 src1_dst src2)); +instruct reduce_$1_partial($3 src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set src1_dst ($2 src1_dst src2)); ins_cost(SVE_COST); effect(TEMP ptmp, KILL cr); - format %{ "sve_reduce_add$2 $src1_dst, $src1_dst, $src2\t# add$2 reduction partial (sve) ($4)" %} + format %{ "sve_reduce_$1 $src1_dst, $src1_dst, $src2\t# $1 reduction partial (sve) ($4)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ $4, Matcher::vector_length(this, $src2)); @@ -1064,364 +1328,379 @@ instruct $1($3 src1_dst, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ ins_pipe(pipe_slow); %}')dnl dnl -REDUCE_ADDF(reduce_addF, F, vRegF, S) -REDUCE_ADDF_PARTIAL(reduce_addF_partial, F, vRegF, S) -REDUCE_ADDF(reduce_addD, D, vRegD, D) -REDUCE_ADDF_PARTIAL(reduce_addD_partial, D, vRegD, D) - -// vector and reduction - -instruct reduce_andI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (AndReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +dnl +dnl REDUCE_I_PREDICATE($1, $2 ) +dnl REDUCE_I_PREDICATE(insn_name, op_name) +define(`REDUCE_I_PREDICATE', ` +instruct reduce_$1I_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, pRegGov pg) %{ + ifelse($2, AddReductionVI, + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);') + match(Set dst ($2 (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_andI $dst, $src1, $src2\t# andB/S/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_$1I $dst, $src1, $pg, $src2\t# $1I reduction predicated (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_andv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ andw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_andI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (AndReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); +%}')dnl +dnl +dnl REDUCE_L_PREDICATE($1, $2 ) +dnl REDUCE_L_PREDICATE(insn_name, op_name) +define(`REDUCE_L_PREDICATE', ` +instruct reduce_$1L_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, pRegGov pg) %{ + ifelse($2, AddReductionVL, + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize);') + match(Set dst ($2 (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp); ins_cost(SVE_COST); - format %{ "sve_reduce_andI $dst, $src1, $src2\t# andI reduction partial (sve) (may extend)" %} + format %{ "sve_reduce_$1L $dst, $src1, $pg, $src2\t# $1L reduction predicated (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +dnl REDUCE_I_PREDICATE_PARTIAL($1, $2 ) +dnl REDUCE_I_PREDICATE_PARTIAL(insn_name, op_name) +define(`REDUCE_I_PREDICATE_PARTIAL', ` +instruct reduce_$1I_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + ifelse($2, AddReductionVI, + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);') + match(Set dst ($2 (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_$1I $dst, $src1, $pg, $src2\t# $1I reduction predicated partial (sve) (may extend)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_andv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ andw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } - %} - ins_pipe(pipe_slow); -%} - -instruct reduce_andL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (AndReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); - ins_cost(SVE_COST); - format %{ "sve_reduce_andL $dst, $src1, $src2\t# andL reduction (sve)" %} - ins_encode %{ - __ sve_andv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ andr($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_andL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (AndReductionV src1 src2)); +%}')dnl +dnl +dnl REDUCE_L_PREDICATE_PARTIAL($1, $2 ) +dnl REDUCE_L_PREDICATE_PARTIAL(insn_name, op_name) +define(`REDUCE_L_PREDICATE_PARTIAL', ` +instruct reduce_$1L_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + ifelse($2, AddReductionVL, + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);', + `predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize);') + match(Set dst ($2 (Binary src1 src2) pg)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_andL $dst, $src1, $src2\t# andL reduction partial (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_$1L $dst, $src1, $pg, $src2\t# $1L reduction predicated partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_andv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ andr($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); -%} - -// vector or reduction - -instruct reduce_orI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (OrReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +%}')dnl +dnl +dnl REDUCE_ADDF_PREDICATE($1, $2, $3, $4 ) +dnl REDUCE_ADDF_PREDICATE(insn_name, op_name, reg_dst, size) +define(`REDUCE_ADDF_PREDICATE', ` +instruct reduce_$1_masked($3 src1_dst, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set src1_dst ($2 (Binary src1_dst src2) pg)); ins_cost(SVE_COST); - format %{ "sve_reduce_orI $dst, $src1, $src2\t# orB/S/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_$1 $src1_dst, $pg, $src2\t# $1 reduction predicated (sve)" %} ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_orv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ orrw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ $4, + as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_orI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (OrReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); +%}')dnl +dnl +dnl REDUCE_ADDF_PREDICATE_PARTIAL($1, $2, $3, $4 ) +dnl REDUCE_ADDF_PREDICATE_PARTIAL(insn_name, op_name, reg_dst, size) +define(`REDUCE_ADDF_PREDICATE_PARTIAL', ` +instruct reduce_$1_masked_partial($3 src1_dst, vReg src2, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set src1_dst ($2 (Binary src1_dst src2) pg)); + effect(TEMP ptmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_orI $dst, $src1, $src2\t# orI reduction partial (sve) (may extend)" %} + format %{ "sve_reduce_$1 $src1_dst, $pg, $src2\t# $1 reduction predicated partial (sve)" %} ins_encode %{ - BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ $4, Matcher::vector_length(this, $src2)); - __ sve_orv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ orrw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_fadda(as_FloatRegister($src1_dst$$reg), __ $4, + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); %} ins_pipe(pipe_slow); -%} +%}')dnl +dnl -instruct reduce_orL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (OrReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); - ins_cost(SVE_COST); - format %{ "sve_reduce_orL $dst, $src1, $src2\t# orL reduction (sve)" %} - ins_encode %{ - __ sve_orv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ orr($dst$$Register, $dst$$Register, $src1$$Register); - %} - ins_pipe(pipe_slow); -%} +// vector add reduction +REDUCE_I(add, AddReductionVI) +REDUCE_L(add, AddReductionVL) +REDUCE_ADDF(addF, AddReductionVF, vRegF, S) +REDUCE_ADDF(addD, AddReductionVD, vRegD, D) +REDUCE_I_PARTIAL(add, AddReductionVI) +REDUCE_L_PARTIAL(add, AddReductionVL) +REDUCE_ADDF_PARTIAL(addF, AddReductionVF, vRegF, S) +REDUCE_ADDF_PARTIAL(addD, AddReductionVD, vRegD, D) + +// vector add reduction - predicated +REDUCE_I_PREDICATE(add, AddReductionVI) +REDUCE_L_PREDICATE(add, AddReductionVL) +REDUCE_ADDF_PREDICATE(addF, AddReductionVF, vRegF, S) +REDUCE_ADDF_PREDICATE(addD, AddReductionVD, vRegD, D) +REDUCE_I_PREDICATE_PARTIAL(add, AddReductionVI) +REDUCE_L_PREDICATE_PARTIAL(add, AddReductionVL) +REDUCE_ADDF_PREDICATE_PARTIAL(addF, AddReductionVF, vRegF, S) +REDUCE_ADDF_PREDICATE_PARTIAL(addD, AddReductionVD, vRegD, D) -instruct reduce_orL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (OrReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_orL $dst, $src1, $src2\t# orL reduction partial (sve)" %} - ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, - Matcher::vector_length(this, $src2)); - __ sve_orv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ orr($dst$$Register, $dst$$Register, $src1$$Register); - %} - ins_pipe(pipe_slow); -%} +// vector and reduction +REDUCE_I(and, AndReductionV) +REDUCE_L(and, AndReductionV) +REDUCE_I_PARTIAL(and, AndReductionV) +REDUCE_L_PARTIAL(and, AndReductionV) + +// vector and reduction - predicated +REDUCE_I_PREDICATE(and, AndReductionV) +REDUCE_L_PREDICATE(and, AndReductionV) +REDUCE_I_PREDICATE_PARTIAL(and, AndReductionV) +REDUCE_L_PREDICATE_PARTIAL(and, AndReductionV) + +// vector or reduction +REDUCE_I(or, OrReductionV) +REDUCE_L(or, OrReductionV) +REDUCE_I_PARTIAL(or, OrReductionV) +REDUCE_L_PARTIAL(or, OrReductionV) + +// vector or reduction - predicated +REDUCE_I_PREDICATE(or, OrReductionV) +REDUCE_L_PREDICATE(or, OrReductionV) +REDUCE_I_PREDICATE_PARTIAL(or, OrReductionV) +REDUCE_L_PREDICATE_PARTIAL(or, OrReductionV) // vector xor reduction +REDUCE_I(eor, XorReductionV) +REDUCE_L(eor, XorReductionV) +REDUCE_I_PARTIAL(eor, XorReductionV) +REDUCE_L_PARTIAL(eor, XorReductionV) -instruct reduce_eorI(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +// vector xor reduction - predicated +REDUCE_I_PREDICATE(eor, XorReductionV) +REDUCE_L_PREDICATE(eor, XorReductionV) +REDUCE_I_PREDICATE_PARTIAL(eor, XorReductionV) +REDUCE_L_PREDICATE_PARTIAL(eor, XorReductionV) + +dnl +dnl REDUCE_MAXMIN_I($1, $2 ) +dnl REDUCE_MAXMIN_I(insn_name, op_name) +define(`REDUCE_MAXMIN_I', ` +instruct reduce_$1I(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst ($2 src1 src2)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_eorI $dst, $src1, $src2\t# xorB/H/I reduction (sve) (may extend)" %} + format %{ "sve_reduce_$1I $dst, $src1, $src2\t# $1I reduction (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_eorv(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ eorw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_eorI_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, +%}')dnl +dnl +dnl REDUCE_MAXMIN_L($1, $2 ) +dnl REDUCE_MAXMIN_L(insn_name, op_name) +define(`REDUCE_MAXMIN_L', ` +instruct reduce_$1L(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst ($2 src1 src2)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); + ins_cost(SVE_COST); + format %{ "sve_reduce_$1L $dst, $src1, $src2\t# $1L reduction (sve)" %} + ins_encode %{ + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + ptrue, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +dnl REDUCE_MAXMIN_I_PARTIAL($1 , $2 ) +dnl REDUCE_MAXMIN_I_PARTIAL(min_max, op_name) +define(`REDUCE_MAXMIN_I_PARTIAL', ` +instruct reduce_$1I_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst ($2 src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_eorI $dst, $src1, $src2\t# xorI reduction partial (sve) (may extend)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_$1I $dst, $src1, $src2\t# $1I reduction partial (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_eorv(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ eorw($dst$$Register, $dst$$Register, $src1$$Register); - if (bt == T_BYTE) { - __ sxtb($dst$$Register, $dst$$Register); - } else if (bt == T_SHORT) { - __ sxth($dst$$Register, $dst$$Register); - } else { - assert(bt == T_INT, "unsupported type"); - } + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); -%} - -instruct reduce_eorL(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); - ins_cost(SVE_COST); - format %{ "sve_reduce_eorL $dst, $src1, $src2\t# xorL reduction (sve)" %} - ins_encode %{ - __ sve_eorv(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ eor($dst$$Register, $dst$$Register, $src1$$Register); - %} - ins_pipe(pipe_slow); -%} - -instruct reduce_eorL_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, +%}')dnl +dnl +dnl REDUCE_MAXMIN_L_PARTIAL($1 , $2 ) +dnl REDUCE_MAXMIN_L_PARTIAL(min_max, op_name) +define(`REDUCE_MAXMIN_L_PARTIAL', ` +instruct reduce_$1L_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG && - n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst (XorReductionV src1 src2)); + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst ($2 src1 src2)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_eorL $dst, $src1, $src2\t# xorL reduction partial (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "sve_reduce_$1L $dst, $src1, $src2\t# $1L reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_eorv(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ eor($dst$$Register, $dst$$Register, $src1$$Register); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); -%} - +%}')dnl dnl -dnl REDUCE_MAXMIN_I($1, $2, $3 ) -dnl REDUCE_MAXMIN_I(min_max, op_mame, cmp) -define(`REDUCE_MAXMIN_I', ` -instruct reduce_$1I(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && - (n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT)); - match(Set dst ($2 src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +dnl REDUCE_MAXMIN_I_PREDICATE($1 , $2 ) +dnl REDUCE_MAXMIN_I_PREDICATE(min_max, op_name) +define(`REDUCE_MAXMIN_I_PREDICATE', ` +instruct reduce_$1I_masked(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD tmp, + pRegGov pg, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst ($2 (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_$1I $dst, $src1, $src2\t# reduce $1B/S/I (sve)" %} + format %{ "sve_reduce_$1I $dst, $src1, $pg, $src2\t# $1I reduction predicated (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); - Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); - __ sve_s$1v(as_FloatRegister($vtmp$$reg), variant, ptrue, as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ cmpw($dst$$Register, $src1$$Register); - __ cselw(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::$3); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %}')dnl dnl -dnl REDUCE_MAXMIN_L($1, $2, $3 ) -dnl REDUCE_MAXMIN_L(min_max, op_name, cmp) -define(`REDUCE_MAXMIN_L', ` -instruct reduce_$1L(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); - match(Set dst ($2 src1 src2)); - effect(TEMP_DEF dst, TEMP vtmp); +dnl REDUCE_MAXMIN_L_PREDICATE($1 , $2 ) +dnl REDUCE_MAXMIN_L_PREDICATE(min_max, op_name) +define(`REDUCE_MAXMIN_L_PREDICATE', ` +instruct reduce_$1L_masked(iRegLNoSp dst, iRegL src1, vReg src2, vRegD tmp, + pRegGov pg, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst ($2 (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); ins_cost(SVE_COST); - format %{ "sve_reduce_$1L $dst, $src1, $src2\t# reduce $1L partial (sve)" %} + format %{ "sve_reduce_$1L $dst, $src1, $pg, $src2\t# $1L reduction predicated (sve)" %} ins_encode %{ - __ sve_s$1v(as_FloatRegister($vtmp$$reg), __ D, ptrue, as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ cmp($dst$$Register, $src1$$Register); - __ csel(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::$3); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($pg$$reg), as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); %}')dnl dnl -dnl REDUCE_MAXMIN_I_PARTIAL($1, $2, $3 ) -dnl REDUCE_MAXMIN_I_PARTIAL(min_max, op_mame, cmp) -define(`REDUCE_MAXMIN_I_PARTIAL', ` -instruct reduce_$1I_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && - (n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_BYTE || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_SHORT || - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_INT)); - match(Set dst ($2 src1 src2)); +dnl REDUCE_MAXMIN_I_PREDICATE_PARTIAL($1 , $2 ) +dnl REDUCE_MAXMIN_I_PREDICATE_PARTIAL(min_max, op_name) +define(`REDUCE_MAXMIN_I_PREDICATE_PARTIAL', ` +instruct reduce_$1I_masked_partial(iRegINoSp dst, iRegIorL2I src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() != T_LONG && + is_integral_type(n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type())); + match(Set dst ($2 (Binary src1 src2) pg)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_$1I $dst, $src1, $src2\t# reduce $1I partial (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_$1I $dst, $src1, $pg, $src2\t# $1I reduction predicated partial (sve)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src2); Assembler::SIMD_RegVariant variant = __ elemType_to_regVariant(bt); __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), variant, Matcher::vector_length(this, $src2)); - __ sve_s$1v(as_FloatRegister($vtmp$$reg), variant, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ smov($dst$$Register, as_FloatRegister($vtmp$$reg), variant, 0); - __ cmpw($dst$$Register, $src1$$Register); - __ cselw(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::$3); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %}')dnl dnl -dnl REDUCE_MAXMIN_L_PARTIAL($1, $2, $3 ) -dnl REDUCE_MAXMIN_L_PARTIAL(min_max, op_name, cmp) -define(`REDUCE_MAXMIN_L_PARTIAL', ` -instruct reduce_$1L_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, - pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && - n->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); - match(Set dst ($2 src1 src2)); +dnl REDUCE_MAXMIN_L_PREDICATE_PARTIAL($1 , $2 ) +dnl REDUCE_MAXMIN_L_PREDICATE_PARTIAL(min_max, op_name) +define(`REDUCE_MAXMIN_L_PREDICATE_PARTIAL', ` +instruct reduce_$1L_masked_partial(iRegLNoSp dst, iRegL src1, vReg src2, vRegD vtmp, + pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst ($2 (Binary src1 src2) pg)); effect(TEMP_DEF dst, TEMP vtmp, TEMP ptmp, KILL cr); - ins_cost(SVE_COST); - format %{ "sve_reduce_$1L $dst, $src1, $src2\t# reduce $1L partial (sve)" %} + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_$1L $dst, $src1, $pg, $src2\t# $1L reduction predicated partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src2)); - __ sve_s$1v(as_FloatRegister($vtmp$$reg), __ D, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); - __ umov($dst$$Register, as_FloatRegister($vtmp$$reg), __ D, 0); - __ cmp($dst$$Register, $src1$$Register); - __ csel(as_Register($dst$$reg), as_Register($dst$$reg), as_Register($src1$$reg), Assembler::$3); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG, + $src1$$Register, as_FloatRegister($src2$$reg), + as_PRegister($ptmp$$reg), as_FloatRegister($vtmp$$reg)); %} ins_pipe(pipe_slow); %}')dnl @@ -1430,63 +1709,121 @@ dnl REDUCE_FMINMAX($1, $2, $3, $4, $5 ) dnl REDUCE_FMINMAX(min_max, name_suffix, element_type, size, reg_src_dst) define(`REDUCE_FMINMAX', ` instruct reduce_$1$2($5 dst, $5 src1, vReg src2) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == $3 && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == $3 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); match(Set dst (translit($1, `m', `M')ReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst); - format %{ "sve_f$1v $dst, $src2 # vector (sve) ($4)\n\t" - "f$1s $dst, $dst, $src1\t# $1 reduction $2" %} + format %{ "sve_reduce_$1$2 $dst, $src1, $src2\t# $1$2 reduction (sve)" %} ins_encode %{ - __ sve_f$1v(as_FloatRegister($dst$$reg), __ $4, - ptrue, as_FloatRegister($src2$$reg)); + __ sve_f$1v(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src2$$reg)); __ f`$1'translit($4, `SD', `sd')(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %}')dnl dnl -dnl dnl REDUCE_FMINMAX_PARTIAL($1, $2, $3, $4, $5 ) dnl REDUCE_FMINMAX_PARTIAL(min_max, name_suffix, element_type, size, reg_src_dst) define(`REDUCE_FMINMAX_PARTIAL', ` instruct reduce_$1$2_partial($5 dst, $5 src1, vReg src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(2)->bottom_type()->is_vect()->element_basic_type() == $3 && + predicate(UseSVE > 0 && + n->in(2)->bottom_type()->is_vect()->element_basic_type() == $3 && n->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); match(Set dst (translit($1, `m', `M')ReductionV src1 src2)); ins_cost(INSN_COST); effect(TEMP_DEF dst, TEMP ptmp, KILL cr); - format %{ "sve_reduce_$1$2 $dst, $src1, $src2\t# reduce $1 $4 partial (sve)" %} + format %{ "sve_reduce_$1$2 $dst, $src1, $src2\t# $1$2 reduction partial (sve)" %} ins_encode %{ __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ $4, Matcher::vector_length(this, $src2)); + __ sve_f$1v(as_FloatRegister($dst$$reg), __ $4, as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + __ f`$1'translit($4, `SD', `sd')(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +dnl REDUCE_FMINMAX_PREDICATE($1, $2, $3, $4, $5 ) +dnl REDUCE_FMINMAX_PREDICATE(min_max, name_suffix, element_type, size, reg_src_dst) +define(`REDUCE_FMINMAX_PREDICATE', ` +instruct reduce_$1$2_masked($5 dst, $5 src1, vReg src2, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == $3 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (translit($1, `m', `M')ReductionV (Binary src1 src2) pg)); + ins_cost(SVE_COST); + format %{ "sve_reduce_$1$2 $dst, $src1, $pg, $src2\t# $1$2 reduction predicated (sve)" %} + ins_encode %{ + __ sve_f$1v(as_FloatRegister($dst$$reg), __ $4, as_PRegister($pg$$reg), as_FloatRegister($src2$$reg)); + __ f`$1'translit($4, `SD', `sd')(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +dnl REDUCE_FMINMAX_PREDICATE_PARTIAL($1, $2, $3, $4, $5 ) +dnl REDUCE_FMINMAX_PREDICATE_PARTIAL(min_max, name_suffix, element_type, size, reg_src_dst) +define(`REDUCE_FMINMAX_PREDICATE_PARTIAL', ` +instruct reduce_$1$2_masked_partial($5 dst, $5 src1, vReg src2, pRegGov pg, + pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->in(2)->bottom_type()->is_vect()->element_basic_type() == $3 && + n->in(1)->in(2)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (translit($1, `m', `M')ReductionV (Binary src1 src2) pg)); + effect(TEMP_DEF dst, TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "sve_reduce_$1$2 $dst, $src1, $pg, $src2\t# $1$2 reduction predicated partial (sve)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ $4, + Matcher::vector_length(this, $src2)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); __ sve_f$1v(as_FloatRegister($dst$$reg), __ $4, - as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); + as_PRegister($ptmp$$reg), as_FloatRegister($src2$$reg)); __ f`$1'translit($4, `SD', `sd')(as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg), as_FloatRegister($src1$$reg)); %} ins_pipe(pipe_slow); %}')dnl - // vector max reduction -REDUCE_MAXMIN_I(max, MaxReductionV, GT) -REDUCE_MAXMIN_I_PARTIAL(max, MaxReductionV, GT) -REDUCE_MAXMIN_L(max, MaxReductionV, GT) -REDUCE_MAXMIN_L_PARTIAL(max, MaxReductionV, GT) +REDUCE_MAXMIN_I(max, MaxReductionV) +REDUCE_MAXMIN_L(max, MaxReductionV) +REDUCE_MAXMIN_I_PARTIAL(max, MaxReductionV) +REDUCE_MAXMIN_L_PARTIAL(max, MaxReductionV) REDUCE_FMINMAX(max, F, T_FLOAT, S, vRegF) REDUCE_FMINMAX_PARTIAL(max, F, T_FLOAT, S, vRegF) REDUCE_FMINMAX(max, D, T_DOUBLE, D, vRegD) REDUCE_FMINMAX_PARTIAL(max, D, T_DOUBLE, D, vRegD) +// vector max reduction - predicated +REDUCE_MAXMIN_I_PREDICATE(max, MaxReductionV) +REDUCE_MAXMIN_L_PREDICATE(max, MaxReductionV) +REDUCE_MAXMIN_I_PREDICATE_PARTIAL(max, MaxReductionV) +REDUCE_MAXMIN_L_PREDICATE_PARTIAL(max, MaxReductionV) +REDUCE_FMINMAX_PREDICATE(max, F, T_FLOAT, S, vRegF) +REDUCE_FMINMAX_PREDICATE(max, D, T_DOUBLE, D, vRegD) +REDUCE_FMINMAX_PREDICATE_PARTIAL(max, F, T_FLOAT, S, vRegF) +REDUCE_FMINMAX_PREDICATE_PARTIAL(max, D, T_DOUBLE, D, vRegD) + // vector min reduction -REDUCE_MAXMIN_I(min, MinReductionV, LT) -REDUCE_MAXMIN_I_PARTIAL(min, MinReductionV, LT) -REDUCE_MAXMIN_L(min, MinReductionV, LT) -REDUCE_MAXMIN_L_PARTIAL(min, MinReductionV, LT) +REDUCE_MAXMIN_I(min, MinReductionV) +REDUCE_MAXMIN_L(min, MinReductionV) +REDUCE_MAXMIN_I_PARTIAL(min, MinReductionV) +REDUCE_MAXMIN_L_PARTIAL(min, MinReductionV) REDUCE_FMINMAX(min, F, T_FLOAT, S, vRegF) REDUCE_FMINMAX_PARTIAL(min, F, T_FLOAT, S, vRegF) REDUCE_FMINMAX(min, D, T_DOUBLE, D, vRegD) REDUCE_FMINMAX_PARTIAL(min, D, T_DOUBLE, D, vRegD) +// vector min reduction - predicated +REDUCE_MAXMIN_I_PREDICATE(min, MinReductionV) +REDUCE_MAXMIN_L_PREDICATE(min, MinReductionV) +REDUCE_MAXMIN_I_PREDICATE_PARTIAL(min, MinReductionV) +REDUCE_MAXMIN_L_PREDICATE_PARTIAL(min, MinReductionV) +REDUCE_FMINMAX_PREDICATE(min, F, T_FLOAT, S, vRegF) +REDUCE_FMINMAX_PREDICATE(min, D, T_DOUBLE, D, vRegD) +REDUCE_FMINMAX_PREDICATE_PARTIAL(min, F, T_FLOAT, S, vRegF) +REDUCE_FMINMAX_PREDICATE_PARTIAL(min, D, T_DOUBLE, D, vRegD) + // vector Math.rint, floor, ceil instruct vroundD(vReg dst, vReg src, immI rmode) %{ @@ -1664,369 +2001,400 @@ VSHIFT_COUNT(vshiftcntS, H, 8, T_SHORT) VSHIFT_COUNT(vshiftcntI, S, 4, T_INT) VSHIFT_COUNT(vshiftcntL, D, 2, T_LONG) -// vector sqrt -UNARY_OP_TRUE_PREDICATE(vsqrtF, SqrtVF, S, 16, sve_fsqrt) -UNARY_OP_TRUE_PREDICATE(vsqrtD, SqrtVD, D, 16, sve_fsqrt) +// vector shift - predicated +BINARY_OP_PREDICATE(vasrB, RShiftVB, B, sve_asr) +BINARY_OP_PREDICATE(vasrS, RShiftVS, H, sve_asr) +BINARY_OP_PREDICATE(vasrI, RShiftVI, S, sve_asr) +BINARY_OP_PREDICATE(vasrL, RShiftVL, D, sve_asr) +BINARY_OP_PREDICATE(vlslB, LShiftVB, B, sve_lsl) +BINARY_OP_PREDICATE(vlslS, LShiftVS, H, sve_lsl) +BINARY_OP_PREDICATE(vlslI, LShiftVI, S, sve_lsl) +BINARY_OP_PREDICATE(vlslL, LShiftVL, D, sve_lsl) +BINARY_OP_PREDICATE(vlsrB, URShiftVB, B, sve_lsr) +BINARY_OP_PREDICATE(vlsrS, URShiftVS, H, sve_lsr) +BINARY_OP_PREDICATE(vlsrI, URShiftVI, S, sve_lsr) +BINARY_OP_PREDICATE(vlsrL, URShiftVL, D, sve_lsr) +dnl +dnl VSHIFT_IMM_PREDICATED($1, $2, $3, $4, $5, $6 ) +dnl VSHIFT_IMM_PREDICATED(insn_name, op_name, op_name2, type, size, insn) +define(`VSHIFT_IMM_PREDICATED', ` +instruct $1_imm_masked(vReg dst_src, immI shift, pRegGov pg) %{ + predicate(UseSVE > 0); + match(Set dst_src ($2 (Binary dst_src ($3 shift)) pg)); + ins_cost(SVE_COST); + format %{ "$6 $dst_src, $pg, $dst_src, $shift\t# vector (sve) ($4)" %} + ins_encode %{ + int con = (int)$shift$$constant; + assert(con ifelse(index(`$1', `vlsl'), 0, `>=', `>') 0 && con < $5, "invalid shift immediate"); + __ $6(as_FloatRegister($dst_src$$reg), __ $4, as_PRegister($pg$$reg), con); + %} + ins_pipe(pipe_slow); +%}')dnl +dnl +VSHIFT_IMM_PREDICATED(vasrB, RShiftVB, RShiftCntV, B, 8, sve_asr) +VSHIFT_IMM_PREDICATED(vasrS, RShiftVS, RShiftCntV, H, 16, sve_asr) +VSHIFT_IMM_PREDICATED(vasrI, RShiftVI, RShiftCntV, S, 32, sve_asr) +VSHIFT_IMM_PREDICATED(vasrL, RShiftVL, RShiftCntV, D, 64, sve_asr) +VSHIFT_IMM_PREDICATED(vlsrB, URShiftVB, RShiftCntV, B, 8, sve_lsr) +VSHIFT_IMM_PREDICATED(vlsrS, URShiftVS, RShiftCntV, H, 16, sve_lsr) +VSHIFT_IMM_PREDICATED(vlsrI, URShiftVI, RShiftCntV, S, 32, sve_lsr) +VSHIFT_IMM_PREDICATED(vlsrL, URShiftVL, RShiftCntV, D, 64, sve_lsr) +VSHIFT_IMM_PREDICATED(vlslB, LShiftVB, LShiftCntV, B, 8, sve_lsl) +VSHIFT_IMM_PREDICATED(vlslS, LShiftVS, LShiftCntV, H, 16, sve_lsl) +VSHIFT_IMM_PREDICATED(vlslI, LShiftVI, LShiftCntV, S, 32, sve_lsl) +VSHIFT_IMM_PREDICATED(vlslL, LShiftVL, LShiftCntV, D, 64, sve_lsl) -// vector sub -BINARY_OP_UNPREDICATED(vsubB, SubVB, B, 16, sve_sub) -BINARY_OP_UNPREDICATED(vsubS, SubVS, H, 8, sve_sub) -BINARY_OP_UNPREDICATED(vsubI, SubVI, S, 4, sve_sub) -BINARY_OP_UNPREDICATED(vsubL, SubVL, D, 2, sve_sub) -BINARY_OP_UNPREDICATED(vsubF, SubVF, S, 4, sve_fsub) -BINARY_OP_UNPREDICATED(vsubD, SubVD, D, 2, sve_fsub) +// vector sqrt +UNARY_OP_TRUE_PREDICATE(vsqrtF, SqrtVF, S, sve_fsqrt) +UNARY_OP_TRUE_PREDICATE(vsqrtD, SqrtVD, D, sve_fsqrt) -// vector mask cast +// vector sqrt - predicated +UNARY_OP_PREDICATE(vsqrtF, SqrtVF, S, sve_fsqrt) +UNARY_OP_PREDICATE(vsqrtD, SqrtVD, D, sve_fsqrt) -instruct vmaskcast(vReg dst) %{ - predicate(UseSVE > 0 && n->bottom_type()->is_vect()->length() == n->in(1)->bottom_type()->is_vect()->length() && +// vector sub +BINARY_OP_UNPREDICATE(vsubB, SubVB, B, 16, sve_sub) +BINARY_OP_UNPREDICATE(vsubS, SubVS, H, 8, sve_sub) +BINARY_OP_UNPREDICATE(vsubI, SubVI, S, 4, sve_sub) +BINARY_OP_UNPREDICATE(vsubL, SubVL, D, 2, sve_sub) +BINARY_OP_UNPREDICATE(vsubF, SubVF, S, 4, sve_fsub) +BINARY_OP_UNPREDICATE(vsubD, SubVD, D, 2, sve_fsub) + +// vector sub - predicated +BINARY_OP_PREDICATE(vsubB, SubVB, B, sve_sub) +BINARY_OP_PREDICATE(vsubS, SubVS, H, sve_sub) +BINARY_OP_PREDICATE(vsubI, SubVI, S, sve_sub) +BINARY_OP_PREDICATE(vsubL, SubVL, D, sve_sub) +BINARY_OP_PREDICATE(vsubF, SubVF, S, sve_fsub) +BINARY_OP_PREDICATE(vsubD, SubVD, D, sve_fsub) + +// ------------------------------ Vector mask cast -------------------------- + +instruct vmaskcast(pRegGov dst_src) %{ + predicate(UseSVE > 0 && + n->bottom_type()->is_vect()->length() == n->in(1)->bottom_type()->is_vect()->length() && n->bottom_type()->is_vect()->length_in_bytes() == n->in(1)->bottom_type()->is_vect()->length_in_bytes()); - match(Set dst (VectorMaskCast dst)); + match(Set dst_src (VectorMaskCast dst_src)); ins_cost(0); - format %{ "vmaskcast $dst\t# empty (sve)" %} + format %{ "vmaskcast $dst_src\t# empty (sve)" %} ins_encode %{ // empty %} ins_pipe(pipe_class_empty); %} +instruct vmaskcast_extend(pRegGov dst, pReg src) +%{ + predicate(UseSVE > 0 && + (Matcher::vector_length_in_bytes(n) == 2 * Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) == 4 * Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) == 8 * Matcher::vector_length_in_bytes(n->in(1)))); + match(Set dst (VectorMaskCast src)); + ins_cost(SVE_COST * 3); + format %{ "sve_vmaskcast_extend $dst, $src\t# extend predicate $src" %} + ins_encode %{ + __ sve_vmaskcast_extend(as_PRegister($dst$$reg), as_PRegister($src$$reg), + Matcher::vector_length_in_bytes(this), Matcher::vector_length_in_bytes(this, $src)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmaskcast_narrow(pRegGov dst, pReg src) +%{ + predicate(UseSVE > 0 && + (Matcher::vector_length_in_bytes(n) * 2 == Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) * 4 == Matcher::vector_length_in_bytes(n->in(1)) || + Matcher::vector_length_in_bytes(n) * 8 == Matcher::vector_length_in_bytes(n->in(1)))); + match(Set dst (VectorMaskCast src)); + ins_cost(SVE_COST * 3); + format %{ "sve_vmaskcast_narrow $dst, $src\t# narrow predicate $src" %} + ins_encode %{ + __ sve_vmaskcast_narrow(as_PRegister($dst$$reg), as_PRegister($src$$reg), + Matcher::vector_length_in_bytes(this), Matcher::vector_length_in_bytes(this, $src)); + %} + ins_pipe(pipe_slow); +%} +dnl + // ------------------------------ Vector cast ------------------------------- dnl dnl -define(`VECTOR_CAST_EXTEND1', ` +define(`VECTOR_CAST_X2X', ` instruct vcvt$1to$2`'(vReg dst, vReg src) %{ predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); match(Set dst (VectorCast$1`'2X src)); ins_cost(SVE_COST); - format %{ "sve_$3 $dst, $4, $src\t# convert $1 to $2 vector" %} + format %{ "sve_vectorcast_$5 $dst, $src\t# convert $1 to $2 vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg)); + __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $4); %} ins_pipe(pipe_slow); %}')dnl + dnl +dnl Start of vector cast rules dnl -define(`VECTOR_CAST_EXTEND2', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +instruct vcvtBtoX_extend(vReg dst, vReg src) %{ - predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); + predicate(UseSVE > 0); + match(Set dst (VectorCastB2X src)); ins_cost(2 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src\n\t" - "sve_$3 $dst, $5, $dst\t# convert $1 to $2 vector" %} + format %{ "sve_vectorcast_b2x $dst, $src\t# convert B to X vector (extend)" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg)); - __ sve_$3(as_FloatRegister($dst$$reg), __ $5, as_FloatRegister($dst$$reg)); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_vector_extend(as_FloatRegister($dst$$reg), to_size, as_FloatRegister($src$$reg), __ B); + if (to_bt == T_FLOAT || to_bt == T_DOUBLE) { + __ sve_scvtf(as_FloatRegister($dst$$reg), to_size, ptrue, as_FloatRegister($dst$$reg), to_size); + } %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_EXTEND3', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +%} + +instruct vcvtStoB(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - ins_cost(3 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src\n\t" - "sve_$3 $dst, $5, $dst\n\t" - "sve_$3 $dst, $6, $dst\t# convert $1 to $2 vector" %} + n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + match(Set dst (VectorCastS2X src)); + effect(TEMP tmp); + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_s2b $dst, $src\t# convert H to B vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg)); - __ sve_$3(as_FloatRegister($dst$$reg), __ $5, as_FloatRegister($dst$$reg)); - __ sve_$3(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($src$$reg), __ H, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_NARROW1', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +%} + +instruct vcvtStoX_extend(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - effect(TEMP tmp); + type2aelembytes(Matcher::vector_element_basic_type(n)) > 2); + match(Set dst (VectorCastS2X src)); ins_cost(2 * SVE_COST); - format %{ "sve_$3 $tmp, $4, 0\n\t" - "sve_$5 $dst, $4, $src, tmp\t# convert $1 to $2 vector" %} + format %{ "sve_vectorcast_s2x $dst, $src\t# convert H to X vector (extend)" %} ins_encode %{ - __ sve_$3(as_FloatRegister($tmp$$reg), __ $4, 0); - __ sve_$5(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_vector_extend(as_FloatRegister($dst$$reg), to_size, as_FloatRegister($src$$reg), __ H); + if (to_bt == T_FLOAT || to_bt == T_DOUBLE) { + __ sve_scvtf(as_FloatRegister($dst$$reg), to_size, ptrue, as_FloatRegister($dst$$reg), to_size); + } %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_NARROW2', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +%} + +instruct vcvtItoB(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); + n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); + match(Set dst (VectorCastI2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_$3 $tmp, $4, 0\n\t" - "sve_$5 $dst, $4, $src, tmp\n\t" - "sve_$5 $dst, $6, $dst, tmp\n\t# convert $1 to $2 vector" %} + format %{ "sve_vectorcast_i2b $dst, $src\t# convert I to B vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($tmp$$reg), __ $4, 0); - __ sve_$5(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_$5(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ B, + as_FloatRegister($src$$reg), __ S, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_NARROW3', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +%} + +instruct vcvtItoS(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_$3 $tmp, $4, 0\n\t" - "sve_$5 $dst, $4, $src, tmp\n\t" - "sve_$5 $dst, $6, $dst, tmp\n\t" - "sve_$5 $dst, $7, $dst, tmp\n\t# convert $1 to $2 vector" %} + n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); + match(Set dst (VectorCastI2X src)); + effect(TEMP tmp); + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_i2s $dst, $src\t# convert I to H vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($tmp$$reg), __ $4, 0); - __ sve_$5(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg), as_FloatRegister($tmp$$reg)); - __ sve_$5(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_$5(as_FloatRegister($dst$$reg), __ $7, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ H, + as_FloatRegister($src$$reg), __ S, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_I2F_EXTEND2', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +%} + +instruct vcvtItoL(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - ins_cost(3 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src\n\t" - "sve_$3 $dst, $5, $dst\n\t" - "sve_$6 $dst, $5, $dst, $5\t# convert $1 to $2 vector" %} + n->bottom_type()->is_vect()->element_basic_type() == T_LONG); + match(Set dst (VectorCastI2X src)); + ins_cost(SVE_COST); + format %{ "sve_vectorcast_i2l $dst, $src\t# convert I to L vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg)); - __ sve_$3(as_FloatRegister($dst$$reg), __ $5, as_FloatRegister($dst$$reg)); - __ sve_$6(as_FloatRegister($dst$$reg), __ $5, ptrue, as_FloatRegister($dst$$reg), __ $5); + __ sve_vector_extend(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg), __ S); %} ins_pipe(pipe_slow); -%}')dnl -dnl +%} dnl -define(`VECTOR_CAST_I2F_EXTEND3', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +dnl vcvtItoF +VECTOR_CAST_X2X(I, F, scvtf, S, i2f) + +instruct vcvtItoD(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - ins_cost(4 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src\n\t" - "sve_$3 $dst, $5, $dst\n\t" - "sve_$3 $dst, $6, $dst\n\t" - "sve_$7 $dst, $6, $dst, $6\t# convert $1 to $2 vector" %} + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); + match(Set dst (VectorCastI2X src)); + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_i2d $dst, $src\t# convert I to D vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg)); - __ sve_$3(as_FloatRegister($dst$$reg), __ $5, as_FloatRegister($dst$$reg)); - __ sve_$3(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg)); - __ sve_$7(as_FloatRegister($dst$$reg), __ $6, ptrue, as_FloatRegister($dst$$reg), __ $6); + __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg)); + __ sve_scvtf(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ D); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_X2F_NARROW1', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +%} + +instruct vcvtLtoX_narrow(vReg dst, vReg src, vReg tmp) +%{ + predicate(UseSVE > 0 && is_integral_type(Matcher::vector_element_basic_type(n))); + match(Set dst (VectorCastL2X src)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_l2x $dst, $src\t# convert L to B/H/S vector (narrow)" %} + ins_encode %{ + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), to_size, + as_FloatRegister($src$$reg), __ D, as_FloatRegister($tmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vcvtLtoF(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); + n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + match(Set dst (VectorCastL2X src)); effect(TEMP_DEF dst, TEMP tmp); ins_cost(3 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src, $5\n\t" - "sve_$6 $tmp, $7, 0\n\t" - "sve_$8 $dst, $7, $dst, $tmp\t# convert $1 to $2 vector" %} + format %{ "sve_vectorcast_l2f $dst, $src\t# convert L to F vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $5); - __ sve_$6(as_FloatRegister($tmp$$reg), __ $7, 0); - __ sve_$8(as_FloatRegister($dst$$reg), __ $7, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_scvtf(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ S, + as_FloatRegister($dst$$reg), __ D, as_FloatRegister($tmp$$reg)); + %} ins_pipe(pipe_slow); -%}')dnl -dnl +%} dnl -define(`VECTOR_CAST_X2X', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +dnl vcvtLtoD +VECTOR_CAST_X2X(L, D, scvtf, D, l2d) + +instruct vcvtFtoX_narrow(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - ins_cost(SVE_COST); - format %{ "sve_$3 $dst, $4, $src, $4\t# convert $1 to $2 vector" %} + (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || + n->bottom_type()->is_vect()->element_basic_type() == T_SHORT)); + match(Set dst (VectorCastF2X src)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(3 * SVE_COST); + format %{ "sve_vectorcast_f2x $dst, $src\t# convert F to B/H vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $4); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), to_size, + as_FloatRegister($dst$$reg), __ S, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_X2F_EXTEND1', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +%} + +instruct vcvtFtoI(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - ins_cost(2 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src\n\t" - "sve_$5 $dst, $4, $dst, $6\t# convert $1 to $2 vector" %} + (n->bottom_type()->is_vect()->element_basic_type() == T_INT)); + match(Set dst (VectorCastF2X src)); + ins_cost(SVE_COST); + format %{ "sve_vectorcast_f2x $dst, $src\t# convert F to I vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, as_FloatRegister($src$$reg)); - __ sve_$5(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($dst$$reg), __ $6); + __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ S); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_F2X_NARROW1', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +%} + +instruct vcvtFtoL(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(3 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src, $4\n\t" - "sve_$5 $tmp, $6, 0\n\t" - "sve_$7 $dst, $6, $dst, tmp\t# convert $1 to $2 vector" %} + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG)); + match(Set dst (VectorCastF2X src)); + ins_cost(SVE_COST * 2); + format %{ "sve_vectorcast_f2x $dst, $src\t# convert F to L vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $4); - __ sve_$5(as_FloatRegister($tmp$$reg), __ $6, 0); - __ sve_$7(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_sunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg)); + __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ S); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_F2X_NARROW2', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +%} + +instruct vcvtFtoD(vReg dst, vReg src) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - effect(TEMP_DEF dst, TEMP tmp); - ins_cost(4 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src, $4\n\t" - "sve_$5 $tmp, $6, 0\n\t" - "sve_$7 $dst, $6, $dst, tmp\n\t" - "sve_$7 $dst, $8, $dst, tmp\n\t# convert $1 to $2 vector" %} + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE); + match(Set dst (VectorCastF2X src)); + ins_cost(2 * SVE_COST); + format %{ "sve_vectorcast_f2d $dst, $dst\t# convert F to D vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $4); - __ sve_$5(as_FloatRegister($tmp$$reg), __ $6, 0); - __ sve_$7(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_$7(as_FloatRegister($dst$$reg), __ $8, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_vector_extend(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($src$$reg), __ S); + __ sve_fcvt(as_FloatRegister($dst$$reg), __ D, ptrue, as_FloatRegister($dst$$reg), __ S); %} ins_pipe(pipe_slow); -%}')dnl -dnl -dnl -define(`VECTOR_CAST_F2X_EXTEND1', ` -instruct vcvt$1to$2`'(vReg dst, vReg src) +%} + +instruct vcvtDtoX_narrow(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); - ins_cost(2 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src, $4\n\t" - "sve_$5 $dst, $6, $dst\t# convert $1 to $2 vector" %} + (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || + n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || + n->bottom_type()->is_vect()->element_basic_type() == T_INT)); + match(Set dst (VectorCastD2X src)); + effect(TEMP_DEF dst, TEMP tmp); + ins_cost(3 * SVE_COST); + format %{ "sve_vectorcast_d2x $dst, $src\t# convert D to X vector (narrow)" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $4); - __ sve_$5(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg)); + BasicType to_bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant to_size = __ elemType_to_regVariant(to_bt); + __ sve_fcvtzs(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), to_size, + as_FloatRegister($dst$$reg), __ D, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl +%} dnl -define(`VECTOR_CAST_F2X_NARROW3', ` -instruct vcvt$1to$2`'(vReg dst, vReg src, vReg tmp) +dnl vcvtDtoL +VECTOR_CAST_X2X(D, L, fcvtzs, D, d2l) + +instruct vcvtDtoF(vReg dst, vReg src, vReg tmp) %{ predicate(UseSVE > 0 && - n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($2)); - match(Set dst (VectorCast$1`'2X src)); + n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); + match(Set dst (VectorCastD2X src)); effect(TEMP_DEF dst, TEMP tmp); - ins_cost(5 * SVE_COST); - format %{ "sve_$3 $dst, $4, $src, $4\n\t" - "sve_$5 $tmp, $6, 0\n\t" - "sve_$7 $dst, $6, $dst, tmp\n\t" - "sve_$7 $dst, $8, $dst, tmp\n\t" - "sve_$7 $dst, $9, $dst, tmp\n\t# convert $1 to $2 vector" %} + ins_cost(3 * SVE_COST); + format %{ "sve_vectorcast_d2f $dst, S, $dst\t# convert D to F vector" %} ins_encode %{ - __ sve_$3(as_FloatRegister($dst$$reg), __ $4, ptrue, as_FloatRegister($src$$reg), __ $4); - __ sve_$5(as_FloatRegister($tmp$$reg), __ $6, 0); - __ sve_$7(as_FloatRegister($dst$$reg), __ $6, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_$7(as_FloatRegister($dst$$reg), __ $8, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); - __ sve_$7(as_FloatRegister($dst$$reg), __ $9, as_FloatRegister($dst$$reg), as_FloatRegister($tmp$$reg)); + __ sve_fcvt(as_FloatRegister($dst$$reg), __ S, ptrue, as_FloatRegister($src$$reg), __ D); + __ sve_vector_narrow(as_FloatRegister($dst$$reg), __ S, + as_FloatRegister($dst$$reg), __ D, as_FloatRegister($tmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -VECTOR_CAST_EXTEND1(B, S, sunpklo, H) -VECTOR_CAST_EXTEND2(B, I, sunpklo, H, S) -VECTOR_CAST_EXTEND3(B, L, sunpklo, H, S, D) -VECTOR_CAST_I2F_EXTEND2(B, F, sunpklo, H, S, scvtf) -VECTOR_CAST_I2F_EXTEND3(B, D, sunpklo, H, S, D, scvtf) -dnl -VECTOR_CAST_NARROW1(S, B, dup, B, uzp1) -VECTOR_CAST_EXTEND1(S, I, sunpklo, S) -VECTOR_CAST_EXTEND2(S, L, sunpklo, S, D) -VECTOR_CAST_X2F_EXTEND1(S, F, sunpklo, S, scvtf, S) -VECTOR_CAST_I2F_EXTEND2(S, D, sunpklo, S, D, scvtf) -dnl -VECTOR_CAST_NARROW2(I, B, dup, H, uzp1, B) -VECTOR_CAST_NARROW1(I, S, dup, H, uzp1) -VECTOR_CAST_EXTEND1(I, L, sunpklo, D) -VECTOR_CAST_X2X(I, F, scvtf, S) -VECTOR_CAST_X2F_EXTEND1(I, D, sunpklo, D, scvtf, D) -dnl -VECTOR_CAST_NARROW3(L, B, dup, S, uzp1, H, B) -VECTOR_CAST_NARROW2(L, S, dup, S, uzp1, H) -VECTOR_CAST_NARROW1(L, I, dup, S, uzp1) -VECTOR_CAST_X2F_NARROW1(L, F, scvtf, S, D, dup, S, uzp1) -VECTOR_CAST_X2X(L, D, scvtf, D) -dnl -VECTOR_CAST_F2X_NARROW2(F, B, fcvtzs, S, dup, H, uzp1, B) -VECTOR_CAST_F2X_NARROW1(F, S, fcvtzs, S, dup, H, uzp1) -VECTOR_CAST_X2X(F, I, fcvtzs, S) -VECTOR_CAST_F2X_EXTEND1(F, L, fcvtzs, S, sunpklo, D) -VECTOR_CAST_X2F_EXTEND1(F, D, sunpklo, D, fcvt, S) -dnl -VECTOR_CAST_F2X_NARROW3(D, B, fcvtzs, D, dup, S, uzp1, H, B) -VECTOR_CAST_F2X_NARROW2(D, S, fcvtzs, D, dup, S, uzp1, H) -VECTOR_CAST_F2X_NARROW1(D, I, fcvtzs, D, dup, S, uzp1) -VECTOR_CAST_X2X(D, L, fcvtzs, D) -VECTOR_CAST_X2F_NARROW1(D, F, fcvt, S, D, dup, S, uzp1) +%} + dnl dnl // ------------------------------ Vector extract --------------------------------- define(`VECTOR_EXTRACT_SXT', ` -instruct extract$1`'($2 dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extract$1`'($2 dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (Extract$1 src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, $3, $pTmp, $src, $idx\n\t" + format %{ "sve_extract $dst, $3, $pgtmp, $src, $idx\n\t" "sbfmw $dst, $dst, 0U, $5\t# extract from vector($1)" %} ins_encode %{ - __ sve_extract(as_$4($dst$$reg), __ $3, as_PRegister($pTmp$$reg), + __ sve_extract(as_$4($dst$$reg), __ $3, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); __ sbfmw(as_$4($dst$$reg), as_$4($dst$$reg), 0U, $5); %} @@ -2038,15 +2406,15 @@ VECTOR_EXTRACT_SXT(S, iRegINoSp, H, Register, 15U) dnl define(`VECTOR_EXTRACT', ` -instruct extract$1`'($2 dst, vReg src, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct extract$1`'($2 dst, vReg src, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0); match(Set dst (Extract$1 src idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP pgtmp, KILL cr); ins_cost(2 * SVE_COST); - format %{ "sve_extract $dst, $3, $pTmp, $src, $idx\t# extract from vector($1)" %} + format %{ "sve_extract $dst, $3, $pgtmp, $src, $idx\t# extract from vector($1)" %} ins_encode %{ - __ sve_extract(as_$4($dst$$reg), __ $3, as_PRegister($pTmp$$reg), + __ sve_extract(as_$4($dst$$reg), __ $3, as_PRegister($pgtmp$$reg), as_FloatRegister($src$$reg), (int)($idx$$constant)); %} ins_pipe(pipe_slow); @@ -2058,155 +2426,165 @@ VECTOR_EXTRACT(F, vRegF, S, FloatRegister) VECTOR_EXTRACT(D, vRegD, D, FloatRegister) // ------------------------------- VectorTest ---------------------------------- -dnl -dnl VTEST($1, $2, $3, $4 ) -dnl VTEST(op_name, pred, imm, cond) -define(`VTEST', ` -instruct vtest_$1`'(iRegINoSp dst, vReg src1, vReg src2, pReg pTmp, rFlagsReg cr) + +instruct vtest_alltrue(iRegINoSp dst, pRegGov src1, pRegGov src2, pReg ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && - static_cast(n)->get_predicate() == BoolTest::$2); + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + static_cast(n)->get_predicate() == BoolTest::overflow); + match(Set dst (VectorTest src1 src2)); + effect(TEMP ptmp, KILL cr); + ins_cost(SVE_COST); + format %{ "sve_eors $ptmp, $src1, $src2\t# $src2 is all true mask\n" + "csetw $dst, EQ\t# VectorTest (sve) - alltrue" %} + ins_encode %{ + __ sve_eors(as_PRegister($ptmp$$reg), ptrue, + as_PRegister($src1$$reg), as_PRegister($src2$$reg)); + __ csetw(as_Register($dst$$reg), Assembler::EQ); + %} + ins_pipe(pipe_slow); +%} + +instruct vtest_anytrue(iRegINoSp dst, pRegGov src1, pRegGov src2, rFlagsReg cr) +%{ + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize && + static_cast(n)->get_predicate() == BoolTest::ne); match(Set dst (VectorTest src1 src2)); - effect(TEMP pTmp, KILL cr); + effect(KILL cr); ins_cost(SVE_COST); - format %{ "sve_cmpeq $pTmp, $src1, $3\n\t" - "csetw $dst, $4\t# VectorTest (sve) - $1" %} + format %{ "sve_ptest $src1\n\t" + "csetw $dst, NE\t# VectorTest (sve) - anytrue" %} ins_encode %{ // "src2" is not used for sve. - BasicType bt = Matcher::vector_element_basic_type(this, $src1); - Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - ptrue, as_FloatRegister($src1$$reg), $3); - __ csetw(as_Register($dst$$reg), Assembler::$4); + __ sve_ptest(ptrue, as_PRegister($src1$$reg)); + __ csetw(as_Register($dst$$reg), Assembler::NE); %} ins_pipe(pipe_slow); -%}')dnl -dnl -VTEST(alltrue, overflow, 0, EQ) -VTEST(anytrue, ne, -1, NE) +%} dnl dnl -dnl VTEST_PARTIAL($1, $2, $3, $4 ) -dnl VTEST_PARTIAL(op_name, pred, imm, cond) +dnl VTEST_PARTIAL($1, $2, $3, $4 ) +dnl VTEST_PARTIAL(op_name, pred, inst, cond) define(`VTEST_PARTIAL', ` -instruct vtest_$1_partial`'(iRegINoSp dst, vReg src1, vReg src2, pRegGov pTmp, rFlagsReg cr) +instruct vtest_$1_partial`'(iRegINoSp dst, pRegGov src1, pRegGov src2, pRegGov ptmp, rFlagsReg cr) %{ - predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize && static_cast(n)->get_predicate() == BoolTest::$2); match(Set dst (VectorTest src1 src2)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(SVE_COST); format %{ "vtest_$1_partial $dst, $src1, $src2\t# VectorTest partial (sve) - $1" %} ins_encode %{ - // "src2" is not used for sve. BasicType bt = Matcher::vector_element_basic_type(this, $src1); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), size, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src1)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, - as_PRegister($pTmp$$reg), as_FloatRegister($src1$$reg), $3); + __ $3(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($src1$$reg), as_PRegister($src2$$reg)); __ csetw(as_Register($dst$$reg), Assembler::$4); %} ins_pipe(pipe_slow); %}')dnl dnl -VTEST_PARTIAL(alltrue, overflow, 0, EQ) -VTEST_PARTIAL(anytrue, ne, -1, NE) +VTEST_PARTIAL(alltrue, overflow, sve_eors, EQ) +VTEST_PARTIAL(anytrue, ne, sve_ands, NE) // ------------------------------ Vector insert --------------------------------- -instruct insertI_small(vReg dst, vReg src, iRegIorL2I val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insertI_small(vReg dst, vReg src, iRegIorL2I val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() <= 32 && (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || n->bottom_type()->is_vect()->element_basic_type() == T_INT)); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); - format %{ "sve_index $dst, -16, 1\t# (B/S/I)\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + format %{ "sve_index $dst, -16, 1\t# (B/H/S)\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (B/S/I)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (B/H/S)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); __ sve_index(as_FloatRegister($dst$$reg), size, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), size, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pTmp$$reg), as_Register($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pgtmp$$reg), as_Register($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertF_small(vReg dst, vReg src, vRegF val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insertF_small(vReg dst, vReg src, vRegF val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() <= 32 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); format %{ "sve_index $dst, S, -16, 1\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (F)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (F)" %} ins_encode %{ __ sve_index(as_FloatRegister($dst$$reg), __ S, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ S, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ S, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), __ S, as_PRegister($pTmp$$reg), as_FloatRegister($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ S, as_PRegister($pgtmp$$reg), as_FloatRegister($val$$reg)); %} ins_pipe(pipe_slow); %} -instruct insertI(vReg dst, vReg src, iRegIorL2I val, immI idx, vReg tmp1, pRegGov pTmp, rFlagsReg cr) +instruct insertI(vReg dst, vReg src, iRegIorL2I val, immI idx, vReg tmp1, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() > 32 && (n->bottom_type()->is_vect()->element_basic_type() == T_BYTE || n->bottom_type()->is_vect()->element_basic_type() == T_SHORT || n->bottom_type()->is_vect()->element_basic_type() == T_INT)); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP tmp1, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP tmp1, TEMP pgtmp, KILL cr); ins_cost(5 * SVE_COST); - format %{ "sve_index $tmp1, 0, 1\t# (B/S/I)\n\t" - "sve_dup $dst, $idx\t# (B/S/I)\n\t" - "sve_cmpeq $pTmp, $tmp1, $dst\n\t" + format %{ "sve_index $tmp1, 0, 1\t# (B/H/S)\n\t" + "sve_dup $dst, $idx\t# (B/H/S)\n\t" + "sve_cmpeq $pgtmp, $tmp1, $dst\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (B/S/I)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (B/H/S)" %} ins_encode %{ BasicType bt = Matcher::vector_element_basic_type(this, $src); Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); __ sve_index(as_FloatRegister($tmp1$$reg), size, 0, 1); __ sve_dup(as_FloatRegister($dst$$reg), size, (int)($idx$$constant)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), size, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), size, ptrue, as_FloatRegister($tmp1$$reg), as_FloatRegister($dst$$reg)); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pTmp$$reg), as_Register($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), size, as_PRegister($pgtmp$$reg), as_Register($val$$reg)); %} ins_pipe(pipe_slow); %} dnl dnl define(`VECTOR_INSERT_D', ` -instruct insert$1`'(vReg dst, vReg src, $2 val, immI idx, pRegGov pTmp, rFlagsReg cr) +instruct insert$1`'(vReg dst, vReg src, $2 val, immI idx, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_`'TYPE2DATATYPE($1)); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP pgtmp, KILL cr); ins_cost(4 * SVE_COST); format %{ "sve_index $dst, $3, -16, 1\n\t" - "sve_cmpeq $pTmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" + "sve_cmpeq $pgtmp, $dst, ($idx-#16) # shift from [0, 31] to [-16, 15]\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector ($1)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector ($1)" %} ins_encode %{ __ sve_index(as_FloatRegister($dst$$reg), __ $3, -16, 1); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ $3, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ $3, ptrue, as_FloatRegister($dst$$reg), (int)($idx$$constant) - 16); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); - __ sve_cpy(as_FloatRegister($dst$$reg), __ $3, as_PRegister($pTmp$$reg), as_$4($val$$reg)); + __ sve_cpy(as_FloatRegister($dst$$reg), __ $3, as_PRegister($pgtmp$$reg), as_$4($val$$reg)); %} ins_pipe(pipe_slow); %}')dnl @@ -2214,96 +2592,54 @@ dnl $1 $2 $3 $4 VECTOR_INSERT_D(L, iRegL, D, Register) VECTOR_INSERT_D(D, vRegD, D, FloatRegister) -instruct insertF(vReg dst, vReg src, vRegF val, immI idx, vReg tmp1, pRegGov pTmp, rFlagsReg cr) +instruct insertF(vReg dst, vReg src, vRegF val, immI idx, vReg tmp1, pRegGov pgtmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_Vector()->length() > 32 && n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT); match(Set dst (VectorInsert (Binary src val) idx)); - effect(TEMP_DEF dst, TEMP tmp1, TEMP pTmp, KILL cr); + effect(TEMP_DEF dst, TEMP tmp1, TEMP pgtmp, KILL cr); ins_cost(5 * SVE_COST); format %{ "sve_index $tmp1, S, 0, 1\n\t" "sve_dup $dst, S, $idx\n\t" - "sve_cmpeq $pTmp, $tmp1, $dst\n\t" + "sve_cmpeq $pgtmp, $tmp1, $dst\n\t" "sve_orr $dst, $src, $src\n\t" - "sve_cpy $dst, $pTmp, $val\t# insert into vector (F)" %} + "sve_cpy $dst, $pgtmp, $val\t# insert into vector (F)" %} ins_encode %{ __ sve_index(as_FloatRegister($tmp1$$reg), __ S, 0, 1); __ sve_dup(as_FloatRegister($dst$$reg), __ S, (int)($idx$$constant)); - __ sve_cmp(Assembler::EQ, as_PRegister($pTmp$$reg), __ S, ptrue, + __ sve_cmp(Assembler::EQ, as_PRegister($pgtmp$$reg), __ S, ptrue, as_FloatRegister($tmp1$$reg), as_FloatRegister($dst$$reg)); __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), as_FloatRegister($src$$reg)); __ sve_cpy(as_FloatRegister($dst$$reg), __ S, - as_PRegister($pTmp$$reg), as_FloatRegister($val$$reg)); + as_PRegister($pgtmp$$reg), as_FloatRegister($val$$reg)); %} ins_pipe(pipe_slow); %} // ------------------------------ Vector shuffle ------------------------------- -instruct loadshuffleB(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_BYTE); +instruct loadshuffle(vReg dst, vReg src) %{ + predicate(UseSVE > 0); match(Set dst (VectorLoadShuffle src)); ins_cost(SVE_COST); - format %{ "sve_orr $dst, $src, $src\t# vector load shuffle (B)" %} + format %{ "sve_loadshuffle $dst, $src\t# vector load shuffle (B/H/S/D)" %} ins_encode %{ - if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { - __ sve_orr(as_FloatRegister($dst$$reg), - as_FloatRegister($src$$reg), - as_FloatRegister($src$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this); + if (bt == T_BYTE) { + if (as_FloatRegister($dst$$reg) != as_FloatRegister($src$$reg)) { + __ sve_orr(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg), + as_FloatRegister($src$$reg)); + } + } else { + __ sve_vector_extend(as_FloatRegister($dst$$reg), __ elemType_to_regVariant(bt), + as_FloatRegister($src$$reg), __ B); } %} ins_pipe(pipe_slow); %} -instruct loadshuffleS(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && n->bottom_type()->is_vect()->element_basic_type() == T_SHORT); - match(Set dst (VectorLoadShuffle src)); - ins_cost(SVE_COST); - format %{ "sve_uunpklo $dst, $src\t# vector load shuffle (B to H)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct loadshuffleI(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_INT || - n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); - match(Set dst (VectorLoadShuffle src)); - ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\t# vector load shuffle (B to S)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - -instruct loadshuffleL(vReg dst, vReg src) -%{ - predicate(UseSVE > 0 && - (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || - n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); - match(Set dst (VectorLoadShuffle src)); - ins_cost(3 * SVE_COST); - format %{ "sve_uunpklo $dst, H, $src\n\t" - "sve_uunpklo $dst, S, $dst\n\t" - "sve_uunpklo $dst, D, $dst\t# vector load shuffle (B to D)" %} - ins_encode %{ - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ H, as_FloatRegister($src$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ S, as_FloatRegister($dst$$reg)); - __ sve_uunpklo(as_FloatRegister($dst$$reg), __ D, as_FloatRegister($dst$$reg)); - %} - ins_pipe(pipe_slow); -%} - // ------------------------------ Vector rearrange ------------------------------- instruct rearrange(vReg dst, vReg src, vReg shuffle) @@ -2330,7 +2666,7 @@ instruct gatherI(vReg dst, indirect mem, vReg idx) %{ n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set dst (LoadVectorGather mem idx)); ins_cost(SVE_COST); - format %{ "load_vector_gather $dst, $mem, $idx\t# vector load gather (I/F)" %} + format %{ "load_vector_gather $dst, $mem, $idx\t# vector load gather (S)" %} ins_encode %{ __ sve_ld1w_gather(as_FloatRegister($dst$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); @@ -2345,52 +2681,123 @@ instruct gatherL(vReg dst, indirect mem, vReg idx) %{ n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set dst (LoadVectorGather mem idx)); ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $idx, $idx\n\t" - "load_vector_gather $dst, $mem, $idx\t# vector load gather (L/D)" %} + format %{ "load_vector_gather $dst, $mem, $idx\t# vector load gather (D)" %} ins_encode %{ __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); - __ sve_ld1d_gather(as_FloatRegister($dst$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), ptrue, as_Register($mem$$base), + as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} // ------------------------------ Vector Load Gather Partial------------------------------- -instruct gatherI_partial(vReg dst, indirect mem, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct gatherI_partial(vReg dst, indirect mem, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_LoadVectorGather()->memory_size() < MaxVectorSize && (n->bottom_type()->is_vect()->element_basic_type() == T_INT || n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set dst (LoadVectorGather mem idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(2 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "load_vector_gather $dst, $pTmp, $mem, $idx\t# vector load gather partial (I/F)" %} + format %{ "load_vector_gather $dst, $ptmp, $mem, $idx\t# vector load gather partial (S)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ S, - Matcher::vector_length(this)); - __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($pTmp$$reg), + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this)); + __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} -instruct gatherL_partial(vReg dst, indirect mem, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct gatherL_partial(vReg dst, indirect mem, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_LoadVectorGather()->memory_size() < MaxVectorSize && (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set dst (LoadVectorGather mem idx)); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(3 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_uunpklo $idx, $idx\n\t" - "load_vector_gather $dst, $pTmp, $mem, $idx\t# vector load gather partial (L/D)" %} + format %{ "load_vector_gather $dst, $ptmp, $mem, $idx\t# vector load gather partial (D)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this)); + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Load Gather Predicated ------------------------------- + +instruct gatherI_masked(vReg dst, indirect mem, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() == MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + ins_cost(SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated (S)" %} + ins_encode %{ + __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct gatherL_masked(vReg dst, indirect mem, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() == MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + ins_cost(2 * SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated (D)" %} + ins_encode %{ + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Load Gather Predicated Partial ------------------------------- + +instruct gatherI_masked_partial(vReg dst, indirect mem, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() < MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + effect(TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated partial (S)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ D, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_ld1w_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct gatherL_masked_partial(vReg dst, indirect mem, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_LoadVector()->memory_size() < MaxVectorSize && + (n->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set dst (LoadVectorGatherMasked mem (Binary idx pg))); + effect(TEMP ptmp, KILL cr); + ins_cost(4 * SVE_COST); + format %{ "load_vector_gather $dst, $pg, $mem, $idx\t# vector load gather predicated partial (D)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); - __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($pTmp$$reg), + __ sve_ld1d_gather(as_FloatRegister($dst$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); @@ -2405,7 +2812,7 @@ instruct scatterI(indirect mem, vReg src, vReg idx) %{ n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set mem (StoreVectorScatter mem (Binary src idx))); ins_cost(SVE_COST); - format %{ "store_vector_scatter $mem, $idx, $src\t# vector store scatter (I/F)" %} + format %{ "store_vector_scatter $mem, $idx, $src\t# vector store scatter (S)" %} ins_encode %{ __ sve_st1w_scatter(as_FloatRegister($src$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); @@ -2420,59 +2827,129 @@ instruct scatterL(indirect mem, vReg src, vReg idx) %{ n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set mem (StoreVectorScatter mem (Binary src idx))); ins_cost(2 * SVE_COST); - format %{ "sve_uunpklo $idx, $idx\n\t" - "store_vector_scatter $mem, $idx, $src\t# vector store scatter (L/D)" %} + format %{ "store_vector_scatter $mem, $idx, $src\t# vector store scatter (D)" %} ins_encode %{ - __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, - as_FloatRegister($idx$$reg)); + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); __ sve_st1d_scatter(as_FloatRegister($src$$reg), ptrue, as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} -// ------------------------------ Vector Store Scatter Partial------------------------------- +// ------------------------------ Vector Store Scatter Partial ------------------------------- -instruct scatterI_partial(indirect mem, vReg src, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct scatterI_partial(indirect mem, vReg src, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_StoreVectorScatter()->memory_size() < MaxVectorSize && (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_INT || n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); match(Set mem (StoreVectorScatter mem (Binary src idx))); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(2 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "store_vector_scatter $mem, $pTmp, $idx, $src\t# vector store scatter partial (I/F)" %} + format %{ "store_vector_scatter $mem, $ptmp, $idx, $src\t# vector store scatter partial (S)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ S, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, Matcher::vector_length(this, $src)); - __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($pTmp$$reg), + __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} -instruct scatterL_partial(indirect mem, vReg src, vReg idx, pRegGov pTmp, rFlagsReg cr) %{ +instruct scatterL_partial(indirect mem, vReg src, vReg idx, pRegGov ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && n->as_StoreVectorScatter()->memory_size() < MaxVectorSize && (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_LONG || n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); match(Set mem (StoreVectorScatter mem (Binary src idx))); - effect(TEMP pTmp, KILL cr); + effect(TEMP ptmp, KILL cr); ins_cost(3 * SVE_COST + INSN_COST); - format %{ "sve_whilelo_zr_imm $pTmp, vector_length\n\t" - "sve_uunpklo $idx, $idx\n\t" - "store_vector_scatter $mem, $pTmp, $idx, $src\t# vector store scatter partial (L/D)" %} + format %{ "store_vector_scatter $mem, $ptmp, $idx, $src\t# vector store scatter partial (D)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister($pTmp$$reg), __ D, + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, Matcher::vector_length(this, $src)); __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); - __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($pTmp$$reg), + __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Store Scatter Predicated ------------------------------- + +instruct scatterI_masked(indirect mem, vReg src, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() == MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + ins_cost(SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicate (S)" %} + ins_encode %{ + __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct scatterL_masked(indirect mem, vReg src, vReg idx, pRegGov pg) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() == MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + ins_cost(2 * SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicated (D)" %} + ins_encode %{ + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($pg$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} + +// ------------------------------ Vector Store Scatter Predicated Partial ------------------------------- + +instruct scatterI_masked_partial(indirect mem, vReg src, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() < MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_INT || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_FLOAT)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + effect(TEMP ptmp, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicated partial (S)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ S, + Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_st1w_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), as_Register($mem$$base), as_FloatRegister($idx$$reg)); %} ins_pipe(pipe_slow); %} +instruct scatterL_masked_partial(indirect mem, vReg src, vReg idx, pRegGov pg, pRegGov ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->as_StoreVector()->memory_size() < MaxVectorSize && + (n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_LONG || + n->in(3)->in(1)->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE)); + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx pg)))); + effect(TEMP ptmp, KILL cr); + ins_cost(4 * SVE_COST); + format %{ "store_vector_scatter $mem, $pg, $idx, $src\t# vector store scatter predicated partial (D)" %} + ins_encode %{ + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), __ D, + Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg), + as_PRegister($pg$$reg), as_PRegister($pg$$reg)); + __ sve_uunpklo(as_FloatRegister($idx$$reg), __ D, as_FloatRegister($idx$$reg)); + __ sve_st1d_scatter(as_FloatRegister($src$$reg), as_PRegister($ptmp$$reg), + as_Register($mem$$base), as_FloatRegister($idx$$reg)); + %} + ins_pipe(pipe_slow); +%} // ------------------------------ Vector Load Const ------------------------------- @@ -2513,100 +2990,98 @@ dnl $1 $2 $3 STRING_INDEXOF_CHAR(L, Latin1, true) STRING_INDEXOF_CHAR(U, UTF16, false) -dnl -dnl VMASK_REDUCTION($1, $2, $3 ) -dnl VMASK_REDUCTION(suffix, op_name, cost) -define(`VMASK_REDUCTION', ` -instruct vmask_$1(iRegINoSp dst, vReg src, pReg ptmp, rFlagsReg cr) %{ +// ---------------------------- Vector mask reductions --------------------------- +instruct vmask_truecount(iRegINoSp dst, pReg src) %{ predicate(UseSVE > 0 && n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst ($2 src)); - effect(TEMP ptmp, KILL cr); - ins_cost($3 * SVE_COST); - format %{ "vmask_$1 $dst, $src\t# vector mask $1 (sve)" %} + match(Set dst (VectorMaskTrueCount src)); + ins_cost(SVE_COST); + format %{ "vmask_truecount $dst, $src\t# vector mask truecount (sve)" %} ins_encode %{ - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, - as_FloatRegister($src$$reg), ptrue, as_PRegister($ptmp$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_cntp($dst$$Register, size, ptrue, as_PRegister($src$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -// ---------------------------- Vector mask reductions --------------------------- -VMASK_REDUCTION(truecount, VectorMaskTrueCount, 2) -VMASK_REDUCTION(firsttrue, VectorMaskFirstTrue, 3) -VMASK_REDUCTION(lasttrue, VectorMaskLastTrue, 4) -dnl -dnl VMASK_REDUCTION_PARTIAL($1, $2, $3 ) -dnl VMASK_REDUCTION_PARTIAL(suffix, op_name, cost) -define(`VMASK_REDUCTION_PARTIAL', ` -instruct vmask_$1_partial(iRegINoSp dst, vReg src, pRegGov ifelse($1, `firsttrue', `pgtmp, pReg ptmp', `ptmp'), rFlagsReg cr) %{ +%} + +instruct vmask_firsttrue(iRegINoSp dst, pReg src, pReg ptmp) %{ predicate(UseSVE > 0 && - n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst ($2 src)); - effect(TEMP ifelse($1, `firsttrue', `pgtmp, TEMP ptmp', `ptmp'), KILL cr); - ins_cost($3 * SVE_COST); - format %{ "vmask_$1 $dst, $src\t# vector mask $1 partial (sve)" %} + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (VectorMaskFirstTrue src)); + effect(TEMP ptmp); + ins_cost(2 * SVE_COST); + format %{ "vmask_firsttrue $dst, $src\t# vector mask firsttrue (sve)" %} ins_encode %{ - __ sve_whilelo_zr_imm(as_PRegister(ifelse($1, `firsttrue', `$pgtmp', `$ptmp')$$reg), __ B, - Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, __ B, as_FloatRegister($src$$reg), - as_PRegister(ifelse($1, `firsttrue', `$pgtmp', `$ptmp')$$reg), as_PRegister($ptmp$$reg)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_brkb(as_PRegister($ptmp$$reg), ptrue, as_PRegister($src$$reg), false); + __ sve_cntp($dst$$Register, size, ptrue, as_PRegister($ptmp$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -VMASK_REDUCTION_PARTIAL(truecount, VectorMaskTrueCount, 3) -VMASK_REDUCTION_PARTIAL(firsttrue, VectorMaskFirstTrue, 4) -VMASK_REDUCTION_PARTIAL(lasttrue, VectorMaskLastTrue, 5) +%} -dnl -dnl VSTOREMASK_REDUCTION($1, $2, $3 ) -dnl VSTOREMASK_REDUCTION(suffix, op_name, cost) -define(`VSTOREMASK_REDUCTION', ` -instruct vstoremask_$1(iRegINoSp dst, vReg src, immI esize, pReg ptmp, rFlagsReg cr) %{ +instruct vmask_lasttrue(iRegINoSp dst, pReg src, pReg ptmp) %{ + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); + match(Set dst (VectorMaskLastTrue src)); + effect(TEMP ptmp); + ins_cost(3 * SVE_COST); + format %{ "vmask_lasttrue $dst, $src\t# vector mask lasttrue (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + __ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($src$$reg), as_PRegister($ptmp$$reg)); + %} + ins_pipe(pipe_slow); +%} + +instruct vmask_truecount_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr) %{ predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() == MaxVectorSize); - match(Set dst ($2 (VectorStoreMask src esize))); + n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (VectorMaskTrueCount src)); effect(TEMP ptmp, KILL cr); - ins_cost($3 * SVE_COST); - format %{ "vstoremask_$1 $dst, $src\t# vector mask $1 (sve)" %} + ins_cost(2 * SVE_COST); + format %{ "vmask_truecount_partial $dst, $src\t# vector mask truecount partial (sve)" %} ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - ptrue, as_PRegister($ptmp$$reg), Matcher::vector_length(this, $src)); + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src)); + __ sve_cntp($dst$$Register, size, as_PRegister($ptmp$$reg), as_PRegister($src$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -// ----------------- Vector mask reductions combined with VectorMaskStore --------------- -VSTOREMASK_REDUCTION(truecount, VectorMaskTrueCount, 2) -VSTOREMASK_REDUCTION(firsttrue, VectorMaskFirstTrue, 3) -VSTOREMASK_REDUCTION(lasttrue, VectorMaskLastTrue, 4) -dnl -dnl VSTOREMASK_REDUCTION_PARTIAL($1, $2, $3 ) -dnl VSTOREMASK_REDUCTION_PARTIAL(suffix, op_name, cost) -define(`VSTOREMASK_REDUCTION_PARTIAL', ` -instruct vstoremask_$1_partial(iRegINoSp dst, vReg src, immI esize, pRegGov ifelse($1, `firsttrue', `pgtmp, pReg ptmp', `ptmp'), rFlagsReg cr) %{ - predicate(UseSVE > 0 && - n->in(1)->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); - match(Set dst ($2 (VectorStoreMask src esize))); - effect(TEMP ifelse($1, `firsttrue', `pgtmp, TEMP ptmp', `ptmp'), KILL cr); - ins_cost($3 * SVE_COST); - format %{ "vstoremask_$1 $dst, $src\t# vector mask $1 partial (sve)" %} - ins_encode %{ - unsigned size = $esize$$constant; - assert(size == 1 || size == 2 || size == 4 || size == 8, "unsupported element size"); - Assembler::SIMD_RegVariant variant = __ elemBytes_to_regVariant(size); - __ sve_whilelo_zr_imm(as_PRegister(ifelse($1, `firsttrue', `$pgtmp', `$ptmp')$$reg), variant, +%} + +instruct vmask_firsttrue_partial(iRegINoSp dst, pReg src, pReg ptmp1, pReg ptmp2, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (VectorMaskFirstTrue src)); + effect(TEMP ptmp1, TEMP ptmp2, KILL cr); + ins_cost(3 * SVE_COST); + format %{ "vmask_firsttrue_partial $dst, $src\t# vector mask firsttrue partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp1$$reg), size, Matcher::vector_length(this, $src)); - __ sve_vmask_reduction(this->ideal_Opcode(), $dst$$Register, variant, as_FloatRegister($src$$reg), - as_PRegister(ifelse($1, `firsttrue', `$pgtmp', `$ptmp')$$reg), as_PRegister($ptmp$$reg), MaxVectorSize / size); + __ sve_brkb(as_PRegister($ptmp2$$reg), as_PRegister($ptmp1$$reg), as_PRegister($src$$reg), false); + __ sve_cntp($dst$$Register, size, as_PRegister($ptmp1$$reg), as_PRegister($ptmp2$$reg)); %} ins_pipe(pipe_slow); -%}')dnl -dnl -VSTOREMASK_REDUCTION_PARTIAL(truecount, VectorMaskTrueCount, 3) -VSTOREMASK_REDUCTION_PARTIAL(firsttrue, VectorMaskFirstTrue, 4) -VSTOREMASK_REDUCTION_PARTIAL(lasttrue, VectorMaskLastTrue, 5) +%} + +instruct vmask_lasttrue_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr) %{ + predicate(UseSVE > 0 && + n->in(1)->bottom_type()->is_vect()->length_in_bytes() < MaxVectorSize); + match(Set dst (VectorMaskLastTrue src)); + effect(TEMP ptmp, KILL cr); + ins_cost(5 * SVE_COST); + format %{ "vmask_lasttrue_partial $dst, $src\t# vector mask lasttrue partial (sve)" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this, $src); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo_zr_imm(as_PRegister($ptmp$$reg), size, Matcher::vector_length(this, $src)); + __ sve_and(as_PRegister($ptmp$$reg), ptrue, as_PRegister($ptmp$$reg), as_PRegister($src$$reg)); + __ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg)); + %} + ins_pipe(pipe_slow); +%}dnl diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index c5f65f2bc5a..9858eccb8a7 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -583,7 +583,7 @@ class Address { static bool offset_ok_for_immed(int64_t offset, uint shift); - static bool offset_ok_for_sve_immed(long offset, int shift, int vl /* sve vector length */) { + static bool offset_ok_for_sve_immed(int64_t offset, int shift, int vl /* sve vector length */) { if (offset % vl == 0) { // Convert address offset into sve imm offset (MUL VL). int sve_offset = offset / vl; @@ -2976,6 +2976,32 @@ private: pgrf(Pg, 10), rf(Zn_or_Vn, 5), rf(Zd_or_Vd, 0); } + void sve_shift_imm_encoding(SIMD_RegVariant T, int shift, bool isSHR, + int& tszh, int& tszl_imm) { + /* The encodings for the tszh:tszl:imm3 fields + * for shift right is calculated as: + * 0001 xxx B, shift = 16 - UInt(tszh:tszl:imm3) + * 001x xxx H, shift = 32 - UInt(tszh:tszl:imm3) + * 01xx xxx S, shift = 64 - UInt(tszh:tszl:imm3) + * 1xxx xxx D, shift = 128 - UInt(tszh:tszl:imm3) + * for shift left is calculated as: + * 0001 xxx B, shift = UInt(tszh:tszl:imm3) - 8 + * 001x xxx H, shift = UInt(tszh:tszl:imm3) - 16 + * 01xx xxx S, shift = UInt(tszh:tszl:imm3) - 32 + * 1xxx xxx D, shift = UInt(tszh:tszl:imm3) - 64 + */ + assert(T != Q, "Invalid register variant"); + if (isSHR) { + assert(((1 << (T + 3)) >= shift) && (shift > 0) , "Invalid shift value"); + } else { + assert(((1 << (T + 3)) > shift) && (shift >= 0) , "Invalid shift value"); + } + int cVal = (1 << ((T + 3) + (isSHR ? 1 : 0))); + int encodedShift = isSHR ? cVal - shift : cVal + shift; + tszh = encodedShift >> 5; + tszl_imm = encodedShift & 0x1f; + } + public: // SVE integer arithmetic - predicate @@ -2987,16 +3013,19 @@ public: INSN(sve_abs, 0b00000100, 0b010110101); // vector abs, unary INSN(sve_add, 0b00000100, 0b000000000); // vector add + INSN(sve_and, 0b00000100, 0b011010000); // vector and INSN(sve_andv, 0b00000100, 0b011010001); // bitwise and reduction to scalar INSN(sve_asr, 0b00000100, 0b010000100); // vector arithmetic shift right - INSN(sve_cnt, 0b00000100, 0b011010101) // count non-zero bits + INSN(sve_cnt, 0b00000100, 0b011010101); // count non-zero bits INSN(sve_cpy, 0b00000101, 0b100000100); // copy scalar to each active vector element + INSN(sve_eor, 0b00000100, 0b011001000); // vector eor INSN(sve_eorv, 0b00000100, 0b011001001); // bitwise xor reduction to scalar INSN(sve_lsl, 0b00000100, 0b010011100); // vector logical shift left INSN(sve_lsr, 0b00000100, 0b010001100); // vector logical shift right INSN(sve_mul, 0b00000100, 0b010000000); // vector mul INSN(sve_neg, 0b00000100, 0b010111101); // vector neg, unary INSN(sve_not, 0b00000100, 0b011110101); // bitwise invert vector, unary + INSN(sve_orr, 0b00000100, 0b011000000); // vector or INSN(sve_orv, 0b00000100, 0b011000001); // bitwise or reduction to scalar INSN(sve_smax, 0b00000100, 0b001000000); // signed maximum vectors INSN(sve_smaxv, 0b00000100, 0b001000001); // signed maximum reduction to scalar @@ -3039,10 +3068,11 @@ public: f(op2, 15, 13), pgrf(Pg, 10), rf(Zn, 5), rf(Zda, 0); \ } - INSN(sve_fmla, 0b01100101, 1, 0b000); // floating-point fused multiply-add: Zda = Zda + Zn * Zm + INSN(sve_fmla, 0b01100101, 1, 0b000); // floating-point fused multiply-add, writing addend: Zda = Zda + Zn * Zm INSN(sve_fmls, 0b01100101, 1, 0b001); // floating-point fused multiply-subtract: Zda = Zda + -Zn * Zm INSN(sve_fnmla, 0b01100101, 1, 0b010); // floating-point negated fused multiply-add: Zda = -Zda + -Zn * Zm INSN(sve_fnmls, 0b01100101, 1, 0b011); // floating-point negated fused multiply-subtract: Zda = -Zda + Zn * Zm + INSN(sve_fmad, 0b01100101, 1, 0b100); // floating-point fused multiply-add, writing multiplicand: Zda = Zm + Zda * Zn INSN(sve_mla, 0b00000100, 0, 0b010); // multiply-add: Zda = Zda + Zn*Zm INSN(sve_mls, 0b00000100, 0, 0b011); // multiply-subtract: Zda = Zda + -Zn*Zm #undef INSN @@ -3064,28 +3094,8 @@ public: #define INSN(NAME, opc, isSHR) \ void NAME(FloatRegister Zd, SIMD_RegVariant T, FloatRegister Zn, int shift) { \ starti; \ - /* The encodings for the tszh:tszl:imm3 fields (bits 23:22 20:19 18:16) \ - * for shift right is calculated as: \ - * 0001 xxx B, shift = 16 - UInt(tszh:tszl:imm3) \ - * 001x xxx H, shift = 32 - UInt(tszh:tszl:imm3) \ - * 01xx xxx S, shift = 64 - UInt(tszh:tszl:imm3) \ - * 1xxx xxx D, shift = 128 - UInt(tszh:tszl:imm3) \ - * for shift left is calculated as: \ - * 0001 xxx B, shift = UInt(tszh:tszl:imm3) - 8 \ - * 001x xxx H, shift = UInt(tszh:tszl:imm3) - 16 \ - * 01xx xxx S, shift = UInt(tszh:tszl:imm3) - 32 \ - * 1xxx xxx D, shift = UInt(tszh:tszl:imm3) - 64 \ - */ \ - assert(T != Q, "Invalid register variant"); \ - if (isSHR) { \ - assert(((1 << (T + 3)) >= shift) && (shift > 0) , "Invalid shift value"); \ - } else { \ - assert(((1 << (T + 3)) > shift) && (shift >= 0) , "Invalid shift value"); \ - } \ - int cVal = (1 << ((T + 3) + (isSHR ? 1 : 0))); \ - int encodedShift = isSHR ? cVal - shift : cVal + shift; \ - int tszh = encodedShift >> 5; \ - int tszl_imm = encodedShift & 0x1f; \ + int tszh, tszl_imm; \ + sve_shift_imm_encoding(T, shift, isSHR, tszh, tszl_imm); \ f(0b00000100, 31, 24); \ f(tszh, 23, 22), f(1,21), f(tszl_imm, 20, 16); \ f(0b100, 15, 13), f(opc, 12, 10), rf(Zn, 5), rf(Zd, 0); \ @@ -3096,6 +3106,21 @@ public: INSN(sve_lsr, 0b101, /* isSHR = */ true); #undef INSN +// SVE bitwise shift by immediate (predicated) +#define INSN(NAME, opc, isSHR) \ + void NAME(FloatRegister Zdn, SIMD_RegVariant T, PRegister Pg, int shift) { \ + starti; \ + int tszh, tszl_imm; \ + sve_shift_imm_encoding(T, shift, isSHR, tszh, tszl_imm); \ + f(0b00000100, 31, 24), f(tszh, 23, 22), f(0b00, 21, 20), f(opc, 19, 16); \ + f(0b100, 15, 13), pgrf(Pg, 10), f(tszl_imm, 9, 5), rf(Zdn, 0); \ + } + + INSN(sve_asr, 0b0000, /* isSHR = */ true); + INSN(sve_lsl, 0b0011, /* isSHR = */ false); + INSN(sve_lsr, 0b0001, /* isSHR = */ true); +#undef INSN + private: // Scalar base + immediate index @@ -3207,6 +3232,24 @@ public: INSN(sve_dec, 1); #undef INSN +// SVE predicate logical operations +#define INSN(NAME, op1, op2, op3) \ + void NAME(PRegister Pd, PRegister Pg, PRegister Pn, PRegister Pm) { \ + starti; \ + f(0b00100101, 31, 24), f(op1, 23, 22), f(0b00, 21, 20); \ + prf(Pm, 16), f(0b01, 15, 14), prf(Pg, 10), f(op2, 9); \ + prf(Pn, 5), f(op3, 4), prf(Pd, 0); \ + } + + INSN(sve_and, 0b00, 0b0, 0b0); + INSN(sve_ands, 0b01, 0b0, 0b0); + INSN(sve_eor, 0b00, 0b1, 0b0); + INSN(sve_eors, 0b01, 0b1, 0b0); + INSN(sve_orr, 0b10, 0b0, 0b0); + INSN(sve_orrs, 0b11, 0b0, 0b0); + INSN(sve_bic, 0b00, 0b0, 0b1); +#undef INSN + // SVE increment register by predicate count void sve_incp(const Register rd, SIMD_RegVariant T, PRegister pg) { starti; @@ -3240,12 +3283,47 @@ public: f(sh, 13), sf(imm8, 12, 5), rf(Zd, 0); } + // SVE predicate test + void sve_ptest(PRegister Pg, PRegister Pn) { + starti; + f(0b001001010101000011, 31, 14), prf(Pg, 10), f(0, 9), prf(Pn, 5), f(0, 4, 0); + } + + // SVE predicate initialize void sve_ptrue(PRegister pd, SIMD_RegVariant esize, int pattern = 0b11111) { starti; f(0b00100101, 31, 24), f(esize, 23, 22), f(0b011000111000, 21, 10); f(pattern, 9, 5), f(0b0, 4), prf(pd, 0); } + // SVE predicate zero + void sve_pfalse(PRegister pd) { + starti; + f(0b00100101, 31, 24), f(0b00, 23, 22), f(0b011000111001, 21, 10); + f(0b000000, 9, 4), prf(pd, 0); + } + +// SVE load/store predicate register +#define INSN(NAME, op1) \ + void NAME(PRegister Pt, const Address &a) { \ + starti; \ + assert(a.index() == noreg, "invalid address variant"); \ + f(op1, 31, 29), f(0b0010110, 28, 22), sf(a.offset() >> 3, 21, 16), \ + f(0b000, 15, 13), f(a.offset() & 0x7, 12, 10), srf(a.base(), 5), \ + f(0, 4), prf(Pt, 0); \ + } + + INSN(sve_ldr, 0b100); // LDR (predicate) + INSN(sve_str, 0b111); // STR (predicate) +#undef INSN + + // SVE move predicate register + void sve_mov(PRegister Pd, PRegister Pn) { + starti; + f(0b001001011000, 31, 20), prf(Pn, 16), f(0b01, 15, 14), prf(Pn, 10); + f(0, 9), prf(Pn, 5), f(0, 4), prf(Pd, 0); + } + // SVE copy general-purpose register to vector elements (predicated) void sve_cpy(FloatRegister Zd, SIMD_RegVariant T, PRegister Pg, Register Rn) { starti; @@ -3348,6 +3426,18 @@ void sve_cmp(Condition cond, PRegister Pd, SIMD_RegVariant T, INSN(sve_sunpklo, 0b00); // Unsigned unpack and extend half of vector - low half #undef INSN +// SVE unpack predicate elements +#define INSN(NAME, op) \ + void NAME(PRegister Pd, PRegister Pn) { \ + starti; \ + f(0b000001010011000, 31, 17), f(op, 16), f(0b0100000, 15, 9); \ + prf(Pn, 5), f(0b0, 4), prf(Pd, 0); \ + } + + INSN(sve_punpkhi, 0b1); // Unpack and widen high half of predicate + INSN(sve_punpklo, 0b0); // Unpack and widen low half of predicate +#undef INSN + // SVE permute vector elements #define INSN(NAME, op) \ void NAME(FloatRegister Zd, SIMD_RegVariant T, FloatRegister Zn, FloatRegister Zm) { \ @@ -3361,6 +3451,19 @@ void sve_cmp(Condition cond, PRegister Pd, SIMD_RegVariant T, INSN(sve_uzp2, 0b1); // Concatenate odd elements from two vectors #undef INSN +// SVE permute predicate elements +#define INSN(NAME, op) \ + void NAME(PRegister Pd, SIMD_RegVariant T, PRegister Pn, PRegister Pm) { \ + starti; \ + assert(T != Q, "invalid size"); \ + f(0b00000101, 31, 24), f(T, 23, 22), f(0b10, 21, 20), prf(Pm, 16); \ + f(0b01001, 15, 11), f(op, 10), f(0b0, 9), prf(Pn, 5), f(0b0, 4), prf(Pd, 0); \ + } + + INSN(sve_uzp1, 0b0); // Concatenate even elements from two predicates + INSN(sve_uzp2, 0b1); // Concatenate odd elements from two predicates +#undef INSN + // Predicate counted loop (SVE) (32-bit variants are not included) #define INSN(NAME, decode) \ void NAME(PRegister Pd, SIMD_RegVariant T, Register Rn, Register Rm) { \ diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp index 2713576bf4c..5ba1026415f 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp @@ -972,28 +972,219 @@ void C2_MacroAssembler::sve_compare(PRegister pd, BasicType bt, PRegister pg, } } -void C2_MacroAssembler::sve_vmask_reduction(int opc, Register dst, SIMD_RegVariant size, FloatRegister src, - PRegister pg, PRegister pn, int length) { +// Get index of the last mask lane that is set +void C2_MacroAssembler::sve_vmask_lasttrue(Register dst, BasicType bt, PRegister src, PRegister ptmp) { + SIMD_RegVariant size = elemType_to_regVariant(bt); + sve_rev(ptmp, size, src); + sve_brkb(ptmp, ptrue, ptmp, false); + sve_cntp(dst, size, ptrue, ptmp); + movw(rscratch1, MaxVectorSize / type2aelembytes(bt) - 1); + subw(dst, rscratch1, dst); +} + +void C2_MacroAssembler::sve_vector_extend(FloatRegister dst, SIMD_RegVariant dst_size, + FloatRegister src, SIMD_RegVariant src_size) { + assert(dst_size > src_size && dst_size <= D && src_size <= S, "invalid element size"); + if (src_size == B) { + switch (dst_size) { + case H: + sve_sunpklo(dst, H, src); + break; + case S: + sve_sunpklo(dst, H, src); + sve_sunpklo(dst, S, dst); + break; + case D: + sve_sunpklo(dst, H, src); + sve_sunpklo(dst, S, dst); + sve_sunpklo(dst, D, dst); + break; + default: + ShouldNotReachHere(); + } + } else if (src_size == H) { + if (dst_size == S) { + sve_sunpklo(dst, S, src); + } else { // D + sve_sunpklo(dst, S, src); + sve_sunpklo(dst, D, dst); + } + } else if (src_size == S) { + sve_sunpklo(dst, D, src); + } +} + +// Vector narrow from src to dst with specified element sizes. +// High part of dst vector will be filled with zero. +void C2_MacroAssembler::sve_vector_narrow(FloatRegister dst, SIMD_RegVariant dst_size, + FloatRegister src, SIMD_RegVariant src_size, + FloatRegister tmp) { + assert(dst_size < src_size && dst_size <= S && src_size <= D, "invalid element size"); + sve_dup(tmp, src_size, 0); + if (src_size == D) { + switch (dst_size) { + case S: + sve_uzp1(dst, S, src, tmp); + break; + case H: + sve_uzp1(dst, S, src, tmp); + sve_uzp1(dst, H, dst, tmp); + break; + case B: + sve_uzp1(dst, S, src, tmp); + sve_uzp1(dst, H, dst, tmp); + sve_uzp1(dst, B, dst, tmp); + break; + default: + ShouldNotReachHere(); + } + } else if (src_size == S) { + if (dst_size == H) { + sve_uzp1(dst, H, src, tmp); + } else { // B + sve_uzp1(dst, H, src, tmp); + sve_uzp1(dst, B, dst, tmp); + } + } else if (src_size == H) { + sve_uzp1(dst, B, src, tmp); + } +} + +// Extend src predicate to dst predicate with the same lane count but larger +// element size, e.g. 64Byte -> 512Long +void C2_MacroAssembler::sve_vmaskcast_extend(PRegister dst, PRegister src, + uint dst_element_length_in_bytes, + uint src_element_length_in_bytes) { + if (dst_element_length_in_bytes == 2 * src_element_length_in_bytes) { + sve_punpklo(dst, src); + } else if (dst_element_length_in_bytes == 4 * src_element_length_in_bytes) { + sve_punpklo(dst, src); + sve_punpklo(dst, dst); + } else if (dst_element_length_in_bytes == 8 * src_element_length_in_bytes) { + sve_punpklo(dst, src); + sve_punpklo(dst, dst); + sve_punpklo(dst, dst); + } else { + assert(false, "unsupported"); + ShouldNotReachHere(); + } +} + +// Narrow src predicate to dst predicate with the same lane count but +// smaller element size, e.g. 512Long -> 64Byte +void C2_MacroAssembler::sve_vmaskcast_narrow(PRegister dst, PRegister src, + uint dst_element_length_in_bytes, uint src_element_length_in_bytes) { + // The insignificant bits in src predicate are expected to be zero. + if (dst_element_length_in_bytes * 2 == src_element_length_in_bytes) { + sve_uzp1(dst, B, src, src); + } else if (dst_element_length_in_bytes * 4 == src_element_length_in_bytes) { + sve_uzp1(dst, H, src, src); + sve_uzp1(dst, B, dst, dst); + } else if (dst_element_length_in_bytes * 8 == src_element_length_in_bytes) { + sve_uzp1(dst, S, src, src); + sve_uzp1(dst, H, dst, dst); + sve_uzp1(dst, B, dst, dst); + } else { + assert(false, "unsupported"); + ShouldNotReachHere(); + } +} + +void C2_MacroAssembler::sve_reduce_integral(int opc, Register dst, BasicType bt, Register src1, + FloatRegister src2, PRegister pg, FloatRegister tmp) { + assert(bt == T_BYTE || bt == T_SHORT || bt == T_INT || bt == T_LONG, "unsupported element type"); assert(pg->is_governing(), "This register has to be a governing predicate register"); - // The conditional flags will be clobbered by this function - sve_cmp(Assembler::NE, pn, size, pg, src, 0); + assert_different_registers(src1, dst); + // Register "dst" and "tmp" are to be clobbered, and "src1" and "src2" should be preserved. + Assembler::SIMD_RegVariant size = elemType_to_regVariant(bt); switch (opc) { - case Op_VectorMaskTrueCount: - sve_cntp(dst, size, ptrue, pn); + case Op_AddReductionVI: { + sve_uaddv(tmp, size, pg, src2); + smov(dst, tmp, size, 0); + if (bt == T_BYTE) { + addw(dst, src1, dst, ext::sxtb); + } else if (bt == T_SHORT) { + addw(dst, src1, dst, ext::sxth); + } else { + addw(dst, dst, src1); + } + break; + } + case Op_AddReductionVL: { + sve_uaddv(tmp, size, pg, src2); + umov(dst, tmp, size, 0); + add(dst, dst, src1); + break; + } + case Op_AndReductionV: { + sve_andv(tmp, size, pg, src2); + if (bt == T_LONG) { + umov(dst, tmp, size, 0); + andr(dst, dst, src1); + } else { + smov(dst, tmp, size, 0); + andw(dst, dst, src1); + } + break; + } + case Op_OrReductionV: { + sve_orv(tmp, size, pg, src2); + if (bt == T_LONG) { + umov(dst, tmp, size, 0); + orr(dst, dst, src1); + } else { + smov(dst, tmp, size, 0); + orrw(dst, dst, src1); + } break; - case Op_VectorMaskFirstTrue: - sve_brkb(pn, pg, pn, false); - sve_cntp(dst, size, ptrue, pn); + } + case Op_XorReductionV: { + sve_eorv(tmp, size, pg, src2); + if (bt == T_LONG) { + umov(dst, tmp, size, 0); + eor(dst, dst, src1); + } else { + smov(dst, tmp, size, 0); + eorw(dst, dst, src1); + } + break; + } + case Op_MaxReductionV: { + sve_smaxv(tmp, size, pg, src2); + if (bt == T_LONG) { + umov(dst, tmp, size, 0); + cmp(dst, src1); + csel(dst, dst, src1, Assembler::GT); + } else { + smov(dst, tmp, size, 0); + cmpw(dst, src1); + cselw(dst, dst, src1, Assembler::GT); + } break; - case Op_VectorMaskLastTrue: - sve_rev(pn, size, pn); - sve_brkb(pn, ptrue, pn, false); - sve_cntp(dst, size, ptrue, pn); - movw(rscratch1, length - 1); - subw(dst, rscratch1, dst); + } + case Op_MinReductionV: { + sve_sminv(tmp, size, pg, src2); + if (bt == T_LONG) { + umov(dst, tmp, size, 0); + cmp(dst, src1); + csel(dst, dst, src1, Assembler::LT); + } else { + smov(dst, tmp, size, 0); + cmpw(dst, src1); + cselw(dst, dst, src1, Assembler::LT); + } break; + } default: assert(false, "unsupported"); ShouldNotReachHere(); } + + if (opc == Op_AndReductionV || opc == Op_OrReductionV || opc == Op_XorReductionV) { + if (bt == T_BYTE) { + sxtb(dst, dst); + } else if (bt == T_SHORT) { + sxth(dst, dst); + } + } } diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp index fb0fbabea9e..81d9799f5ad 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp @@ -61,8 +61,22 @@ void sve_compare(PRegister pd, BasicType bt, PRegister pg, FloatRegister zn, FloatRegister zm, int cond); - void sve_vmask_reduction(int opc, Register dst, SIMD_RegVariant size, FloatRegister src, - PRegister pg, PRegister pn, int length = MaxVectorSize); + void sve_vmask_lasttrue(Register dst, BasicType bt, PRegister src, PRegister ptmp); + + void sve_vector_extend(FloatRegister dst, SIMD_RegVariant dst_size, + FloatRegister src, SIMD_RegVariant src_size); + + void sve_vector_narrow(FloatRegister dst, SIMD_RegVariant dst_size, + FloatRegister src, SIMD_RegVariant src_size, FloatRegister tmp); + + void sve_vmaskcast_extend(PRegister dst, PRegister src, + uint dst_element_length_in_bytes, uint src_element_lenght_in_bytes); + + void sve_vmaskcast_narrow(PRegister dst, PRegister src, + uint dst_element_length_in_bytes, uint src_element_lenght_in_bytes); + + void sve_reduce_integral(int opc, Register dst, BasicType bt, Register src1, + FloatRegister src2, PRegister pg, FloatRegister tmp); // Generate predicate through whilelo, by comparing ZR with an unsigned // immediate. rscratch1 will be clobbered. diff --git a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp index 6b42982ed90..10b1cf20ef9 100644 --- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp @@ -315,6 +315,7 @@ private: MacroAssembler* const _masm; RegSet _gp_regs; FloatRegSet _fp_regs; + PRegSet _p_regs; public: void initialize(ZLoadBarrierStubC2* stub) { @@ -328,6 +329,8 @@ public: _gp_regs += RegSet::of(vm_reg->as_Register()); } else if (vm_reg->is_FloatRegister()) { _fp_regs += FloatRegSet::of(vm_reg->as_FloatRegister()); + } else if (vm_reg->is_PRegister()) { + _p_regs += PRegSet::of(vm_reg->as_PRegister()); } else { fatal("Unknown register type"); } @@ -341,7 +344,8 @@ public: ZSaveLiveRegisters(MacroAssembler* masm, ZLoadBarrierStubC2* stub) : _masm(masm), _gp_regs(), - _fp_regs() { + _fp_regs(), + _p_regs() { // Figure out what registers to save/restore initialize(stub); @@ -349,10 +353,12 @@ public: // Save registers __ push(_gp_regs, sp); __ push_fp(_fp_regs, sp); + __ push_p(_p_regs, sp); } ~ZSaveLiveRegisters() { // Restore registers + __ pop_p(_p_regs, sp); __ pop_fp(_fp_regs, sp); // External runtime call may clobber ptrue reg diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 7502f199189..07e3fdad17b 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -1978,7 +1978,7 @@ int MacroAssembler::push_fp(unsigned int bitset, Register stack) { return count * 2; } -// Return the number of dwords poped +// Return the number of dwords popped int MacroAssembler::pop_fp(unsigned int bitset, Register stack) { int words_pushed = 0; bool use_sve = false; @@ -2037,6 +2037,80 @@ int MacroAssembler::pop_fp(unsigned int bitset, Register stack) { return count * 2; } +// Return the number of dwords pushed +int MacroAssembler::push_p(unsigned int bitset, Register stack) { + bool use_sve = false; + int sve_predicate_size_in_slots = 0; + +#ifdef COMPILER2 + use_sve = Matcher::supports_scalable_vector(); + if (use_sve) { + sve_predicate_size_in_slots = Matcher::scalable_predicate_reg_slots(); + } +#endif + + if (!use_sve) { + return 0; + } + + unsigned char regs[PRegisterImpl::number_of_saved_registers]; + int count = 0; + for (int reg = 0; reg < PRegisterImpl::number_of_saved_registers; reg++) { + if (1 & bitset) + regs[count++] = reg; + bitset >>= 1; + } + + if (count == 0) { + return 0; + } + + int total_push_bytes = align_up(sve_predicate_size_in_slots * + VMRegImpl::stack_slot_size * count, 16); + sub(stack, stack, total_push_bytes); + for (int i = 0; i < count; i++) { + sve_str(as_PRegister(regs[i]), Address(stack, i)); + } + return total_push_bytes / 8; +} + +// Return the number of dwords popped +int MacroAssembler::pop_p(unsigned int bitset, Register stack) { + bool use_sve = false; + int sve_predicate_size_in_slots = 0; + +#ifdef COMPILER2 + use_sve = Matcher::supports_scalable_vector(); + if (use_sve) { + sve_predicate_size_in_slots = Matcher::scalable_predicate_reg_slots(); + } +#endif + + if (!use_sve) { + return 0; + } + + unsigned char regs[PRegisterImpl::number_of_saved_registers]; + int count = 0; + for (int reg = 0; reg < PRegisterImpl::number_of_saved_registers; reg++) { + if (1 & bitset) + regs[count++] = reg; + bitset >>= 1; + } + + if (count == 0) { + return 0; + } + + int total_pop_bytes = align_up(sve_predicate_size_in_slots * + VMRegImpl::stack_slot_size * count, 16); + for (int i = count - 1; i >= 0; i--) { + sve_ldr(as_PRegister(regs[i]), Address(stack, i)); + } + add(stack, stack, total_pop_bytes); + return total_pop_bytes / 8; +} + #ifdef ASSERT void MacroAssembler::verify_heapbase(const char* msg) { #if 0 @@ -2495,7 +2569,7 @@ void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) { } void MacroAssembler::push_CPU_state(bool save_vectors, bool use_sve, - int sve_vector_size_in_bytes) { + int sve_vector_size_in_bytes, int total_predicate_in_bytes) { push(RegSet::range(r0, r29), sp); // integer registers except lr & sp if (save_vectors && use_sve && sve_vector_size_in_bytes > 16) { sub(sp, sp, sve_vector_size_in_bytes * FloatRegisterImpl::number_of_registers); @@ -2512,10 +2586,22 @@ void MacroAssembler::push_CPU_state(bool save_vectors, bool use_sve, } st1(v0, v1, v2, v3, save_vectors ? T2D : T1D, sp); } + if (save_vectors && use_sve && total_predicate_in_bytes > 0) { + sub(sp, sp, total_predicate_in_bytes); + for (int i = 0; i < PRegisterImpl::number_of_saved_registers; i++) { + sve_str(as_PRegister(i), Address(sp, i)); + } + } } void MacroAssembler::pop_CPU_state(bool restore_vectors, bool use_sve, - int sve_vector_size_in_bytes) { + int sve_vector_size_in_bytes, int total_predicate_in_bytes) { + if (restore_vectors && use_sve && total_predicate_in_bytes > 0) { + for (int i = PRegisterImpl::number_of_saved_registers - 1; i >= 0; i--) { + sve_ldr(as_PRegister(i), Address(sp, i)); + } + add(sp, sp, total_predicate_in_bytes); + } if (restore_vectors && use_sve && sve_vector_size_in_bytes > 16) { for (int i = FloatRegisterImpl::number_of_registers - 1; i >= 0; i--) { sve_ldr(as_FloatRegister(i), Address(sp, i)); diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index c7f6b12a013..a9ebc8bdc69 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -455,6 +455,9 @@ private: int push_fp(unsigned int bitset, Register stack); int pop_fp(unsigned int bitset, Register stack); + int push_p(unsigned int bitset, Register stack); + int pop_p(unsigned int bitset, Register stack); + void mov(Register dst, Address a); public: @@ -466,6 +469,9 @@ public: static RegSet call_clobbered_registers(); + void push_p(PRegSet regs, Register stack) { if (regs.bits()) push_p(regs.bits(), stack); } + void pop_p(PRegSet regs, Register stack) { if (regs.bits()) pop_p(regs.bits(), stack); } + // Push and pop everything that might be clobbered by a native // runtime call except rscratch1 and rscratch2. (They are always // scratch, so we don't have to protect them.) Only save the lower @@ -865,9 +871,9 @@ public: DEBUG_ONLY(void verify_heapbase(const char* msg);) void push_CPU_state(bool save_vectors = false, bool use_sve = false, - int sve_vector_size_in_bytes = 0); + int sve_vector_size_in_bytes = 0, int total_predicate_in_bytes = 0); void pop_CPU_state(bool restore_vectors = false, bool use_sve = false, - int sve_vector_size_in_bytes = 0); + int sve_vector_size_in_bytes = 0, int total_predicate_in_bytes = 0); // Round up to a power of two void round_to(Register reg, int modulus); @@ -1361,9 +1367,14 @@ public: void spill(FloatRegister Vx, SIMD_RegVariant T, int offset) { str(Vx, T, spill_address(1 << (int)T, offset)); } + void spill_sve_vector(FloatRegister Zx, int offset, int vector_reg_size_in_bytes) { sve_str(Zx, sve_spill_address(vector_reg_size_in_bytes, offset)); } + void spill_sve_predicate(PRegister pr, int offset, int predicate_reg_size_in_bytes) { + sve_str(pr, sve_spill_address(predicate_reg_size_in_bytes, offset)); + } + void unspill(Register Rx, bool is64, int offset) { if (is64) { ldr(Rx, spill_address(8, offset)); @@ -1374,9 +1385,14 @@ public: void unspill(FloatRegister Vx, SIMD_RegVariant T, int offset) { ldr(Vx, T, spill_address(1 << (int)T, offset)); } + void unspill_sve_vector(FloatRegister Zx, int offset, int vector_reg_size_in_bytes) { sve_ldr(Zx, sve_spill_address(vector_reg_size_in_bytes, offset)); } + void unspill_sve_predicate(PRegister pr, int offset, int predicate_reg_size_in_bytes) { + sve_ldr(pr, sve_spill_address(predicate_reg_size_in_bytes, offset)); + } + void spill_copy128(int src_offset, int dst_offset, Register tmp1=rscratch1, Register tmp2=rscratch2) { if (src_offset < 512 && (src_offset & 7) == 0 && @@ -1399,6 +1415,12 @@ public: dst_offset += 16; } } + void spill_copy_sve_predicate_stack_to_stack(int src_offset, int dst_offset, + int sve_predicate_reg_size_in_bytes) { + sve_ldr(ptrue, sve_spill_address(sve_predicate_reg_size_in_bytes, src_offset)); + sve_str(ptrue, sve_spill_address(sve_predicate_reg_size_in_bytes, dst_offset)); + reinitialize_ptrue(); + } void cache_wb(Address line); void cache_wbsync(bool is_pre); diff --git a/src/hotspot/cpu/aarch64/register_aarch64.cpp b/src/hotspot/cpu/aarch64/register_aarch64.cpp index 24c3f32c2b6..b785457ae29 100644 --- a/src/hotspot/cpu/aarch64/register_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/register_aarch64.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -34,7 +34,8 @@ const int ConcreteRegisterImpl::max_fpr FloatRegisterImpl::number_of_registers * FloatRegisterImpl::max_slots_per_register; const int ConcreteRegisterImpl::max_pr - = ConcreteRegisterImpl::max_fpr + PRegisterImpl::number_of_registers; + = ConcreteRegisterImpl::max_fpr + + PRegisterImpl::number_of_registers * PRegisterImpl::max_slots_per_register; const char* RegisterImpl::name() const { const char* names[number_of_registers] = { diff --git a/src/hotspot/cpu/aarch64/register_aarch64.hpp b/src/hotspot/cpu/aarch64/register_aarch64.hpp index 479bd1f37c4..69a0a7eb535 100644 --- a/src/hotspot/cpu/aarch64/register_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/register_aarch64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -243,6 +243,11 @@ class PRegisterImpl: public AbstractRegisterImpl { enum { number_of_registers = 16, number_of_governing_registers = 8, + // p0-p7 are governing predicates for load/store and arithmetic, but p7 is + // preserved as an all-true predicate in OpenJDK. And since we don't support + // non-governing predicate registers allocation for non-temp register, the + // predicate registers to be saved are p0-p6. + number_of_saved_registers = number_of_governing_registers - 1, max_slots_per_register = 1 }; @@ -377,6 +382,7 @@ public: typedef AbstractRegSet RegSet; typedef AbstractRegSet FloatRegSet; +typedef AbstractRegSet PRegSet; template class RegSetIterator { diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index fcee61756f9..5c80566aead 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -101,7 +101,10 @@ class RegisterSaver { int reg_offset_in_bytes(Register r); int r0_offset_in_bytes() { return reg_offset_in_bytes(r0); } int rscratch1_offset_in_bytes() { return reg_offset_in_bytes(rscratch1); } - int v0_offset_in_bytes(void) { return 0; } + int v0_offset_in_bytes(); + + // Total stack size in bytes for saving sve predicate registers. + int total_sve_predicate_in_bytes(); // Capture info about frame layout // Note this is only correct when not saving full vectors. @@ -139,24 +142,49 @@ int RegisterSaver::reg_offset_in_bytes(Register r) { } #endif - int r0_offset = (slots_per_vect * FloatRegisterImpl::number_of_registers) * BytesPerInt; + int r0_offset = v0_offset_in_bytes() + (slots_per_vect * FloatRegisterImpl::number_of_registers) * BytesPerInt; return r0_offset + r->encoding() * wordSize; } +int RegisterSaver::v0_offset_in_bytes() { + // The floating point registers are located above the predicate registers if + // they are present in the stack frame pushed by save_live_registers(). So the + // offset depends on the saved total predicate vectors in the stack frame. + return (total_sve_predicate_in_bytes() / VMRegImpl::stack_slot_size) * BytesPerInt; +} + +int RegisterSaver::total_sve_predicate_in_bytes() { +#ifdef COMPILER2 + if (_save_vectors && Matcher::supports_scalable_vector()) { + // The number of total predicate bytes is unlikely to be a multiple + // of 16 bytes so we manually align it up. + return align_up(Matcher::scalable_predicate_reg_slots() * + VMRegImpl::stack_slot_size * + PRegisterImpl::number_of_saved_registers, 16); + } +#endif + return 0; +} + OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words) { bool use_sve = false; int sve_vector_size_in_bytes = 0; int sve_vector_size_in_slots = 0; + int sve_predicate_size_in_slots = 0; + int total_predicate_in_bytes = total_sve_predicate_in_bytes(); + int total_predicate_in_slots = total_predicate_in_bytes / VMRegImpl::stack_slot_size; #ifdef COMPILER2 use_sve = Matcher::supports_scalable_vector(); - sve_vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE); - sve_vector_size_in_slots = Matcher::scalable_vector_reg_size(T_FLOAT); + if (use_sve) { + sve_vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE); + sve_vector_size_in_slots = Matcher::scalable_vector_reg_size(T_FLOAT); + sve_predicate_size_in_slots = Matcher::scalable_predicate_reg_slots(); + } #endif #if COMPILER2_OR_JVMCI if (_save_vectors) { - int vect_words = 0; int extra_save_slots_per_register = 0; // Save upper half of vector registers if (use_sve) { @@ -164,9 +192,10 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ } else { extra_save_slots_per_register = FloatRegisterImpl::extra_save_slots_per_neon_register; } - vect_words = FloatRegisterImpl::number_of_registers * extra_save_slots_per_register / - VMRegImpl::slots_per_word; - additional_frame_words += vect_words; + int extra_vector_bytes = extra_save_slots_per_register * + VMRegImpl::stack_slot_size * + FloatRegisterImpl::number_of_registers; + additional_frame_words += ((extra_vector_bytes + total_predicate_in_bytes) / wordSize); } #else assert(!_save_vectors, "vectors are generated only by C2 and JVMCI"); @@ -184,7 +213,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ // Save Integer and Float registers. __ enter(); - __ push_CPU_state(_save_vectors, use_sve, sve_vector_size_in_bytes); + __ push_CPU_state(_save_vectors, use_sve, sve_vector_size_in_bytes, total_predicate_in_bytes); // Set an oopmap for the call site. This oopmap will map all // oop-registers and debug-info registers as callee-saved. This @@ -201,8 +230,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ // Register slots are 8 bytes wide, 32 floating-point registers. int sp_offset = RegisterImpl::max_slots_per_register * i + FloatRegisterImpl::save_slots_per_register * FloatRegisterImpl::number_of_registers; - oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset + additional_frame_slots), - r->as_VMReg()); + oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset + additional_frame_slots), r->as_VMReg()); } } @@ -210,13 +238,20 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ FloatRegister r = as_FloatRegister(i); int sp_offset = 0; if (_save_vectors) { - sp_offset = use_sve ? (sve_vector_size_in_slots * i) : + sp_offset = use_sve ? (total_predicate_in_slots + sve_vector_size_in_slots * i) : (FloatRegisterImpl::slots_per_neon_register * i); } else { sp_offset = FloatRegisterImpl::save_slots_per_register * i; } - oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset), - r->as_VMReg()); + oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset), r->as_VMReg()); + } + + if (_save_vectors && use_sve) { + for (int i = 0; i < PRegisterImpl::number_of_saved_registers; i++) { + PRegister r = as_PRegister(i); + int sp_offset = sve_predicate_size_in_slots * i; + oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset), r->as_VMReg()); + } } return oop_map; @@ -225,7 +260,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ void RegisterSaver::restore_live_registers(MacroAssembler* masm) { #ifdef COMPILER2 __ pop_CPU_state(_save_vectors, Matcher::supports_scalable_vector(), - Matcher::scalable_vector_reg_size(T_BYTE)); + Matcher::scalable_vector_reg_size(T_BYTE), total_sve_predicate_in_bytes()); #else #if !INCLUDE_JVMCI assert(!_save_vectors, "vectors are generated only by C2 and JVMCI"); @@ -238,8 +273,10 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm) { // Is vector's size (in bytes) bigger than a size saved by default? // 8 bytes vector registers are saved by default on AArch64. +// The SVE supported min vector size is 8 bytes and we need to save +// predicate registers when the vector size is 8 bytes as well. bool SharedRuntime::is_wide_vector(int size) { - return size > 8; + return size > 8 || (UseSVE > 0 && size >= 8); } // The java_calling_convention describes stack locations as ideal slots on diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad index e9fc3d75bf9..9e76f430054 100644 --- a/src/hotspot/cpu/arm/arm.ad +++ b/src/hotspot/cpu/arm/arm.ad @@ -983,6 +983,10 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return ret_value; // Per default match rules are supported. } +const bool Matcher::match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt) { + return false; +} + const RegMask* Matcher::predicate_reg_mask(void) { return NULL; } diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index f9aa60ca15a..958059e1ca2 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -2177,6 +2177,10 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return true; // Per default match rules are supported. } +const bool Matcher::match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt) { + return false; +} + const RegMask* Matcher::predicate_reg_mask(void) { return NULL; } diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 8a2dde76202..60c27c61a51 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -1536,6 +1536,10 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return true; // Per default match rules are supported. } +const bool Matcher::match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt) { + return false; +} + const RegMask* Matcher::predicate_reg_mask(void) { return NULL; } diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index aee326133e0..2119c0797a6 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -2458,6 +2458,13 @@ void Assembler::movddup(XMMRegister dst, XMMRegister src) { emit_int16(0x12, 0xC0 | encode); } +void Assembler::kmovbl(KRegister 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_int16((unsigned char)0x90, (0xC0 | encode)); +} + 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); @@ -2505,7 +2512,7 @@ void Assembler::kmovwl(Address dst, KRegister src) { } void Assembler::kmovwl(KRegister dst, KRegister src) { - assert(VM_Version::supports_avx512bw(), ""); + 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_int16((unsigned char)0x90, (0xC0 | encode)); @@ -2571,6 +2578,104 @@ void Assembler::knotwl(KRegister dst, KRegister src) { emit_int16(0x44, (0xC0 | encode)); } +void Assembler::knotbl(KRegister 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_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x44, (0xC0 | encode)); +} + +void Assembler::korbl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x45, (0xC0 | encode)); +} + +void Assembler::korwl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x45, (0xC0 | encode)); +} + +void Assembler::kordl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x45, (0xC0 | encode)); +} + +void Assembler::korql(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x45, (0xC0 | encode)); +} + +void Assembler::kxorbl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x47, (0xC0 | encode)); +} + +void Assembler::kxorwl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x47, (0xC0 | encode)); +} + +void Assembler::kxordl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x47, (0xC0 | encode)); +} + +void Assembler::kxorql(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x47, (0xC0 | encode)); +} + +void Assembler::kandbl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x41, (0xC0 | encode)); +} + +void Assembler::kandwl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x41, (0xC0 | encode)); +} + +void Assembler::kanddl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x41, (0xC0 | encode)); +} + +void Assembler::kandql(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x41, (0xC0 | encode)); +} + +void Assembler::knotdl(KRegister 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_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x44, (0xC0 | encode)); +} + void Assembler::knotql(KRegister 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); @@ -2618,6 +2723,27 @@ void Assembler::ktestql(KRegister src1, KRegister src2) { emit_int16((unsigned char)0x99, (0xC0 | encode)); } +void Assembler::ktestdl(KRegister src1, KRegister src2) { + 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(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0x99, (0xC0 | encode)); +} + +void Assembler::ktestwl(KRegister src1, KRegister src2) { + 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(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0x99, (0xC0 | encode)); +} + +void Assembler::ktestbl(KRegister src1, KRegister src2) { + 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(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0x99, (0xC0 | encode)); +} + void Assembler::ktestq(KRegister src1, KRegister src2) { assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); @@ -2632,6 +2758,52 @@ void Assembler::ktestd(KRegister src1, KRegister src2) { emit_int16((unsigned char)0x99, (0xC0 | encode)); } +void Assembler::kxnorbl(KRegister dst, KRegister src1, KRegister src2) { + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x46, (0xC0 | encode)); +} + +void Assembler::kshiftlbl(KRegister dst, KRegister src, int imm8) { + 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_3A, &attributes); + emit_int16(0x32, (0xC0 | encode)); + emit_int8(imm8); +} + +void Assembler::kshiftrbl(KRegister dst, KRegister src, int imm8) { + 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_3A, &attributes); + emit_int16(0x30, (0xC0 | encode)); +} + +void Assembler::kshiftrwl(KRegister dst, KRegister src, int imm8) { + assert(VM_Version::supports_evex(), ""); + 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_66, VEX_OPCODE_0F_3A, &attributes); + emit_int16(0x30, (0xC0 | encode)); + emit_int8(imm8); +} + +void Assembler::kshiftrdl(KRegister dst, KRegister src, int imm8) { + 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_66, VEX_OPCODE_0F_3A, &attributes); + emit_int16(0x31, (0xC0 | encode)); + emit_int8(imm8); +} + +void Assembler::kshiftrql(KRegister dst, KRegister src, int imm8) { + 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_66, VEX_OPCODE_0F_3A, &attributes); + emit_int16(0x31, (0xC0 | encode)); + emit_int8(imm8); +} + void Assembler::movb(Address dst, int imm8) { InstructionMark im(this); prefix(dst); @@ -4112,24 +4284,6 @@ void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, Address src, int vect emit_operand(as_Register(dst_enc), src); } -void Assembler::evpmovd2m(KRegister kdst, XMMRegister src, int vector_len) { - assert(UseAVX > 2 && VM_Version::supports_avx512dq(), ""); - assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); - attributes.set_is_evex_instruction(); - int encode = vex_prefix_and_encode(kdst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); - emit_int16(0x39, (0xC0 | encode)); -} - -void Assembler::evpmovq2m(KRegister kdst, XMMRegister src, int vector_len) { - assert(UseAVX > 2 && VM_Version::supports_avx512dq(), ""); - assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); - InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); - attributes.set_is_evex_instruction(); - int encode = vex_prefix_and_encode(kdst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); - emit_int16(0x39, (0xC0 | encode)); -} - void Assembler::pcmpgtq(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); @@ -7419,8 +7573,8 @@ void Assembler::vpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve } void Assembler::evpxord(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { - assert(VM_Version::supports_evex(), ""); // Encoding: EVEX.NDS.XXX.66.0F.W0 EF /r + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); attributes.set_is_evex_instruction(); attributes.set_embedded_opmask_register_specifier(mask); @@ -7431,6 +7585,118 @@ void Assembler::evpxord(XMMRegister dst, KRegister mask, XMMRegister nds, XMMReg emit_int16((unsigned char)0xEF, (0xC0 | encode)); } +void Assembler::evpxord(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xEF); + emit_operand(dst, src); +} + +void Assembler::evpxorq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + // Encoding: EVEX.NDS.XXX.66.0F.W1 EF /r + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xEF, (0xC0 | encode)); +} + +void Assembler::evpxorq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xEF); + emit_operand(dst, src); +} + +void Assembler::evpandd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xDB); + emit_operand(dst, src); +} + +void Assembler::evpandq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xDB, (0xC0 | encode)); +} + +void Assembler::evpandq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xDB); + emit_operand(dst, src); +} + +void Assembler::evporq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xEB, (0xC0 | encode)); +} + +void Assembler::evporq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xEB); + emit_operand(dst, src); +} + void Assembler::evpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), "requires EVEX support"); InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); @@ -7975,29 +8241,1468 @@ void Assembler::vpbroadcastw(XMMRegister dst, Address src, int vector_len) { // xmm/mem sourced byte/word/dword/qword replicate -// duplicate 4-byte integer data from src into programmed locations in dest : requires AVX512VL -void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src, int vector_len) { - assert(UseAVX >= 2, ""); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* 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_int16(0x58, (0xC0 | encode)); +void Assembler::evpaddb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xFC, (0xC0 | encode)); } -void Assembler::vpbroadcastd(XMMRegister dst, Address src, int vector_len) { - assert(VM_Version::supports_avx2(), ""); - assert(dst != xnoreg, "sanity"); +void Assembler::evpaddb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); - attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); - // swap src<->dst for encoding - vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); - emit_int8(0x58); - emit_operand(dst, src); -} - -// duplicate 8-byte integer data from src into programmed locations in dest : requires AVX512VL -void Assembler::vpbroadcastq(XMMRegister dst, XMMRegister src, int vector_len) { - assert(VM_Version::supports_avx2(), ""); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xFC); + emit_operand(dst, src); +} + +void Assembler::evpaddw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xFD, (0xC0 | encode)); +} + +void Assembler::evpaddw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xFD); + emit_operand(dst, src); +} + +void Assembler::evpaddd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xFE, (0xC0 | encode)); +} + +void Assembler::evpaddd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xFE); + emit_operand(dst, src); +} + +void Assembler::evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xD4, (0xC0 | encode)); +} + +void Assembler::evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xD4); + emit_operand(dst, src); +} + +void Assembler::evaddps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x58, (0xC0 | encode)); +} + +void Assembler::evaddps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8(0x58); + emit_operand(dst, src); +} + +void Assembler::evaddpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x58, (0xC0 | encode)); +} + +void Assembler::evaddpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x58); + emit_operand(dst, src); +} + +void Assembler::evpsubb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xF8, (0xC0 | encode)); +} + +void Assembler::evpsubb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xF8); + emit_operand(dst, src); +} + +void Assembler::evpsubw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xF9, (0xC0 | encode)); +} + +void Assembler::evpsubw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xF9); + emit_operand(dst, src); +} + +void Assembler::evpsubd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xFA, (0xC0 | encode)); +} + +void Assembler::evpsubd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xFA); + emit_operand(dst, src); +} + +void Assembler::evpsubq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xFB, (0xC0 | encode)); +} + +void Assembler::evpsubq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xFB); + emit_operand(dst, src); +} + +void Assembler::evsubps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x5C, (0xC0 | encode)); +} + +void Assembler::evsubps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8(0x5C); + emit_operand(dst, src); +} + +void Assembler::evsubpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x5C, (0xC0 | encode)); +} + +void Assembler::evsubpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x5C); + emit_operand(dst, src); +} + +void Assembler::evpmullw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xD5, (0xC0 | encode)); +} + +void Assembler::evpmullw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xD5); + emit_operand(dst, src); +} + +void Assembler::evpmulld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x40, (0xC0 | encode)); +} + +void Assembler::evpmulld(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x40); + emit_operand(dst, src); +} + +void Assembler::evpmullq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512dq() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x40, (0xC0 | encode)); +} + +void Assembler::evpmullq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512dq() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x40); + emit_operand(dst, src); +} + +void Assembler::evmulps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x59, (0xC0 | encode)); +} + +void Assembler::evmulps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8(0x59); + emit_operand(dst, src); +} + +void Assembler::evmulpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x59, (0xC0 | encode)); +} + +void Assembler::evmulpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x59); + emit_operand(dst, src); +} + +void Assembler::evsqrtps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len,/* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x51, (0xC0 | encode)); +} + +void Assembler::evsqrtps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8(0x51); + emit_operand(dst, src); +} + +void Assembler::evsqrtpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len,/* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x51, (0xC0 | encode)); +} + +void Assembler::evsqrtpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x51); + emit_operand(dst, src); +} + + +void Assembler::evdivps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len,/* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int16(0x5E, (0xC0 | encode)); +} + +void Assembler::evdivps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8(0x5E); + emit_operand(dst, src); +} + +void Assembler::evdivpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len,/* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x5E, (0xC0 | encode)); +} + +void Assembler::evdivpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x5E); + emit_operand(dst, src); +} + +void Assembler::evpabsb(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x1C, (0xC0 | encode)); +} + + +void Assembler::evpabsb(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x1C); + emit_operand(dst, src); +} + +void Assembler::evpabsw(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x1D, (0xC0 | encode)); +} + + +void Assembler::evpabsw(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x1D); + emit_operand(dst, src); +} + +void Assembler::evpabsd(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x1E, (0xC0 | encode)); +} + + +void Assembler::evpabsd(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x1E); + emit_operand(dst, src); +} + +void Assembler::evpabsq(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x1F, (0xC0 | encode)); +} + + +void Assembler::evpabsq(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x1F); + emit_operand(dst, src); +} + +void Assembler::evpfma213ps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16((unsigned char)0xA8, (0xC0 | encode)); +} + +void Assembler::evpfma213ps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_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); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0xA8); + emit_operand(dst, src); +} + +void Assembler::evpfma213pd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16((unsigned char)0xA8, (0xC0 | encode)); +} + +void Assembler::evpfma213pd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + InstructionMark im(this); + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true,/* legacy_mode */ false, /* no_mask_reg */ false,/* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV,/* input_size_in_bits */ EVEX_32bit); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0xA8); + emit_operand(dst, src); +} + +void Assembler::evpermb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512_vbmi() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16((unsigned char)0x8D, (0xC0 | encode)); +} + +void Assembler::evpermb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512_vbmi() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0x8D); + emit_operand(dst, src); +} + +void Assembler::evpermw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16((unsigned char)0x8D, (0xC0 | encode)); +} + +void Assembler::evpermw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0x8D); + emit_operand(dst, src); +} + +void Assembler::evpermd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex() && vector_len > AVX_128bit, ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x36, (0xC0 | encode)); +} + +void Assembler::evpermd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_evex() && vector_len > AVX_128bit, ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x36); + emit_operand(dst, src); +} + +void Assembler::evpermq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex() && vector_len > AVX_128bit, ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x36, (0xC0 | encode)); +} + +void Assembler::evpermq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_evex() && vector_len > AVX_128bit, ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x36); + emit_operand(dst, src); +} + +void Assembler::evpsllw(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x71, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpslld(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsllq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x73, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsrlw(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x71, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsrld(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsrlq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x73, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsraw(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x71, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsrad(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsraq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x73, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evpsllw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xF1, (0xC0 | encode)); +} + +void Assembler::evpslld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xF2, (0xC0 | encode)); +} + +void Assembler::evpsllq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xF3, (0xC0 | encode)); +} + +void Assembler::evpsrlw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xD1, (0xC0 | encode)); +} + +void Assembler::evpsrld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xD2, (0xC0 | encode)); +} + +void Assembler::evpsrlq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xD3, (0xC0 | encode)); +} + +void Assembler::evpsraw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xE1, (0xC0 | encode)); +} + +void Assembler::evpsrad(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xE2, (0xC0 | encode)); +} + +void Assembler::evpsraq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xE2, (0xC0 | encode)); +} + +void Assembler::evpsllvw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x12, (0xC0 | encode)); +} + +void Assembler::evpsllvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x47, (0xC0 | encode)); +} + +void Assembler::evpsllvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x47, (0xC0 | encode)); +} + +void Assembler::evpsrlvw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x10, (0xC0 | encode)); +} + +void Assembler::evpsrlvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x45, (0xC0 | encode)); +} + +void Assembler::evpsrlvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x45, (0xC0 | encode)); +} + +void Assembler::evpsravw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x11, (0xC0 | encode)); +} + +void Assembler::evpsravd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x46, (0xC0 | encode)); +} + +void Assembler::evpsravq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x46, (0xC0 | encode)); +} + +void Assembler::evpminsb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x38, (0xC0 | encode)); +} + +void Assembler::evpminsb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x38); + emit_operand(dst, src); +} + +void Assembler::evpminsw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xEA, (0xC0 | encode)); +} + +void Assembler::evpminsw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xEA); + emit_operand(dst, src); +} + +void Assembler::evpminsd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x39, (0xC0 | encode)); +} + +void Assembler::evpminsd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x39); + emit_operand(dst, src); +} + +void Assembler::evpminsq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x39, (0xC0 | encode)); +} + +void Assembler::evpminsq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x39); + emit_operand(dst, src); +} + + +void Assembler::evpmaxsb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x3C, (0xC0 | encode)); +} + +void Assembler::evpmaxsb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x3C); + emit_operand(dst, src); +} + +void Assembler::evpmaxsw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16((unsigned char)0xEE, (0xC0 | encode)); +} + +void Assembler::evpmaxsw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_avx512bw() && (vector_len == AVX_512bit || VM_Version::supports_avx512vl()), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xEE); + emit_operand(dst, src); +} + +void Assembler::evpmaxsd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x3D, (0xC0 | encode)); +} + +void Assembler::evpmaxsd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x3D); + emit_operand(dst, src); +} + +void Assembler::evpmaxsq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x3D, (0xC0 | encode)); +} + +void Assembler::evpmaxsq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x3D); + emit_operand(dst, src); +} + +// duplicate 4-byte integer data from src into programmed locations in dest : requires AVX512VL +void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src, int vector_len) { + assert(UseAVX >= 2, ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* 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_int16(0x58, (0xC0 | encode)); +} + +void Assembler::vpbroadcastd(XMMRegister dst, Address src, int vector_len) { + assert(VM_Version::supports_avx2(), ""); + assert(dst != xnoreg, "sanity"); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); + // swap src<->dst for encoding + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x58); + emit_operand(dst, src); +} + +// duplicate 8-byte integer data from src into programmed locations in dest : requires AVX512VL +void Assembler::vpbroadcastq(XMMRegister dst, XMMRegister src, int vector_len) { + assert(VM_Version::supports_avx2(), ""); InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_rex_vex_w_reverted(); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); @@ -9367,6 +11072,102 @@ void Assembler::evpcmpw(KRegister kdst, KRegister mask, XMMRegister nds, Address emit_int8((unsigned char)comparison); } +void Assembler::evprord(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm0->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evprorq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm0->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evprorvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x14, (0xC0 | encode)); +} + +void Assembler::evprorvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x14, (0xC0 | encode)); +} + +void Assembler::evprold(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm1->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evprolq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(xmm1->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int24(0x72, (0xC0 | encode), shift & 0xFF); +} + +void Assembler::evprolvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x15, (0xC0 | encode)); +} + +void Assembler::evprolvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + assert(vector_len == AVX_512bit || VM_Version::supports_avx512vl(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + attributes.set_embedded_opmask_register_specifier(mask); + if (merge) { + attributes.reset_is_clear_context(); + } + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x15, (0xC0 | encode)); +} + void Assembler::vpblendvb(XMMRegister dst, XMMRegister nds, XMMRegister src, XMMRegister mask, int vector_len) { assert(VM_Version::supports_avx(), ""); InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); @@ -9490,6 +11291,30 @@ void Assembler::shrxq(Register dst, Register src1, Register src2) { emit_int16((unsigned char)0xF7, (0xC0 | encode)); } +void Assembler::evpmovq2m(KRegister dst, XMMRegister src, int vector_len) { + assert(VM_Version::supports_avx512vldq(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x39, (0xC0 | encode)); +} + +void Assembler::evpmovd2m(KRegister dst, XMMRegister src, int vector_len) { + assert(VM_Version::supports_avx512vldq(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x39, (0xC0 | encode)); +} + +void Assembler::evpmovw2m(KRegister dst, XMMRegister src, int vector_len) { + assert(VM_Version::supports_avx512vlbw(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x29, (0xC0 | encode)); +} + void Assembler::evpmovb2m(KRegister dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_avx512vlbw(), ""); InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); @@ -9498,6 +11323,37 @@ void Assembler::evpmovb2m(KRegister dst, XMMRegister src, int vector_len) { emit_int16(0x29, (0xC0 | encode)); } +void Assembler::evpmovm2q(XMMRegister dst, KRegister src, int vector_len) { + assert(VM_Version::supports_avx512vldq(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x38, (0xC0 | encode)); +} + +void Assembler::evpmovm2d(XMMRegister dst, KRegister src, int vector_len) { + assert(VM_Version::supports_avx512vldq(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x38, (0xC0 | encode)); +} + +void Assembler::evpmovm2w(XMMRegister dst, KRegister src, int vector_len) { + assert(VM_Version::supports_avx512vlbw(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x28, (0xC0 | encode)); +} + +void Assembler::evpmovm2b(XMMRegister dst, KRegister src, int vector_len) { + assert(VM_Version::supports_avx512vlbw(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int16(0x28, (0xC0 | encode)); +} #ifndef _LP64 void Assembler::incl(Register dst) { diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 5976597019b..09b2a392d30 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1462,8 +1462,23 @@ private: void movddup(XMMRegister dst, XMMRegister src); + void kandbl(KRegister dst, KRegister src1, KRegister src2); + void kandwl(KRegister dst, KRegister src1, KRegister src2); + void kanddl(KRegister dst, KRegister src1, KRegister src2); + void kandql(KRegister dst, KRegister src1, KRegister src2); + + void korbl(KRegister dst, KRegister src1, KRegister src2); + void korwl(KRegister dst, KRegister src1, KRegister src2); + void kordl(KRegister dst, KRegister src1, KRegister src2); + void korql(KRegister dst, KRegister src1, KRegister src2); + + void kxorbl(KRegister dst, KRegister src1, KRegister src2); + void kxorwl(KRegister dst, KRegister src1, KRegister src2); + void kxordl(KRegister dst, KRegister src1, KRegister src2); + void kxorql(KRegister dst, KRegister src1, KRegister src2); void kmovbl(KRegister dst, Register src); void kmovbl(Register dst, KRegister src); + void kmovbl(KRegister dst, KRegister src); void kmovwl(KRegister dst, Register src); void kmovwl(KRegister dst, Address src); void kmovwl(Register dst, KRegister src); @@ -1477,7 +1492,9 @@ private: void kmovql(KRegister dst, Register src); void kmovql(Register dst, KRegister src); + void knotbl(KRegister dst, KRegister src); void knotwl(KRegister dst, KRegister src); + void knotdl(KRegister dst, KRegister src); void knotql(KRegister dst, KRegister src); void kortestbl(KRegister dst, KRegister src); @@ -1485,10 +1502,19 @@ private: void kortestdl(KRegister dst, KRegister src); void kortestql(KRegister dst, KRegister src); + void kxnorbl(KRegister dst, KRegister src1, KRegister src2); + void kshiftlbl(KRegister dst, KRegister src, int imm8); + void kshiftrbl(KRegister dst, KRegister src, int imm8); + void kshiftrwl(KRegister dst, KRegister src, int imm8); + void kshiftrdl(KRegister dst, KRegister src, int imm8); + void kshiftrql(KRegister dst, KRegister src, int imm8); void ktestq(KRegister src1, KRegister src2); void ktestd(KRegister src1, KRegister src2); void ktestql(KRegister dst, KRegister src); + void ktestdl(KRegister dst, KRegister src); + void ktestwl(KRegister dst, KRegister src); + void ktestbl(KRegister dst, KRegister src); void movdl(XMMRegister dst, Register src); void movdl(Register dst, XMMRegister src); @@ -2152,9 +2178,6 @@ private: void bzhiq(Register dst, Register src1, Register src2); //====================VECTOR ARITHMETIC===================================== - void evpmovd2m(KRegister kdst, XMMRegister src, int vector_len); - void evpmovq2m(KRegister kdst, XMMRegister src, int vector_len); - // Add Packed Floating-Point Values void addpd(XMMRegister dst, XMMRegister src); void addpd(XMMRegister dst, Address src); @@ -2246,6 +2269,136 @@ private: void vpaddd(XMMRegister dst, XMMRegister nds, Address src, int vector_len); void vpaddq(XMMRegister dst, XMMRegister nds, Address src, int vector_len); + // Leaf level assembler routines for masked operations. + void evpaddb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpaddb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpaddw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpaddw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpaddd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpaddd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpaddq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evaddps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evaddps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evaddpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evaddpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpsubb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsubb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpsubw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsubw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpsubd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsubd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpsubq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsubq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evsubps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evsubps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evsubpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evsubpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmullw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmullw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmulld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmulld(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmullq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmullq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evmulps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evmulps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evmulpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evmulpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evdivps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evdivps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evdivpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evdivpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpabsb(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len); + void evpabsb(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len); + void evpabsw(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len); + void evpabsw(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len); + void evpabsd(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len); + void evpabsd(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len); + void evpabsq(XMMRegister dst, KRegister mask, XMMRegister src, bool merge, int vector_len); + void evpabsq(XMMRegister dst, KRegister mask, Address src, bool merge, int vector_len); + void evpfma213ps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpfma213ps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpfma213pd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpfma213pd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpermb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpermb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpermw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpermw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpermd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpermd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpermq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpermq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpsllw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpslld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsllq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrlw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrlq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsraw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrad(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsraq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evsqrtps(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evsqrtps(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evsqrtpd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evsqrtpd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + + void evpsllw(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpslld(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsllq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsrlw(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsrld(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsrlq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsraw(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsrad(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evpsraq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + + void evpsllvw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsllvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsllvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrlvw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrlvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsrlvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsravw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsravd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpsravq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmaxsb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmaxsw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmaxsd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmaxsq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpminsb(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpminsw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpminsd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpminsq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmaxsb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmaxsw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmaxsd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmaxsq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpminsb(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpminsw(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpminsd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpminsq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpord(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpord(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evporq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evporq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpandd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpandd(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpandq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpandq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpxord(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpxord(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpxorq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpxorq(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + + void evprold(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evprolq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evprolvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evprolvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evprord(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evprorq(XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vector_len); + void evprorvd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evprorvq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + // Sub packed integers void psubb(XMMRegister dst, XMMRegister src); void psubw(XMMRegister dst, XMMRegister src); @@ -2364,7 +2517,6 @@ private: void pand(XMMRegister dst, XMMRegister src); void vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vpand(XMMRegister dst, XMMRegister nds, Address src, int vector_len); - void evpandd(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); void vpandq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); // Andn packed integers @@ -2377,15 +2529,11 @@ private: void vpor(XMMRegister dst, XMMRegister nds, Address src, int vector_len); void vporq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); - void evpord(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); - void evpord(XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); - // Xor packed integers void pxor(XMMRegister dst, XMMRegister src); void vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vpxor(XMMRegister dst, XMMRegister nds, Address src, int vector_len); void vpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); - void evpxord(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); void evpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpxorq(XMMRegister dst, XMMRegister nds, Address src, int vector_len); @@ -2527,6 +2675,13 @@ private: int comparison, bool is_signed, int vector_len); void evpmovb2m(KRegister dst, XMMRegister src, int vector_len); + void evpmovw2m(KRegister dst, XMMRegister src, int vector_len); + void evpmovd2m(KRegister dst, XMMRegister src, int vector_len); + void evpmovq2m(KRegister dst, XMMRegister src, int vector_len); + void evpmovm2b(XMMRegister dst, KRegister src, int vector_len); + void evpmovm2w(XMMRegister dst, KRegister src, int vector_len); + void evpmovm2d(XMMRegister dst, KRegister src, int vector_len); + void evpmovm2q(XMMRegister dst, KRegister src, int vector_len); // Vector blends void blendvps(XMMRegister dst, XMMRegister src); diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index 9b891ed727b..df3501974c4 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -1461,6 +1461,19 @@ void C2_MacroAssembler::load_vector_mask(XMMRegister dst, XMMRegister src, int v } } +void C2_MacroAssembler::load_vector_mask(KRegister dst, XMMRegister src, XMMRegister xtmp, + Register tmp, bool novlbwdq, int vlen_enc) { + if (novlbwdq) { + vpmovsxbd(xtmp, src, vlen_enc); + evpcmpd(dst, k0, xtmp, ExternalAddress(StubRoutines::x86::vector_int_mask_cmp_bits()), + Assembler::eq, true, vlen_enc, tmp); + } else { + vpxor(xtmp, xtmp, xtmp, vlen_enc); + vpsubb(xtmp, xtmp, src, vlen_enc); + evpmovb2m(dst, xtmp, vlen_enc); + } +} + void C2_MacroAssembler::load_iota_indices(XMMRegister dst, Register scratch, int vlen_in_bytes) { ExternalAddress addr(StubRoutines::x86::vector_iota_indices()); if (vlen_in_bytes == 4) { @@ -3827,14 +3840,231 @@ void C2_MacroAssembler::arrays_equals(bool is_array_equ, Register ary1, Register } } +void C2_MacroAssembler::evmasked_op(int ideal_opc, BasicType eType, KRegister mask, XMMRegister dst, + XMMRegister src1, int imm8, bool merge, int vlen_enc) { + switch(ideal_opc) { + case Op_LShiftVS: + Assembler::evpsllw(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_LShiftVI: + Assembler::evpslld(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_LShiftVL: + Assembler::evpsllq(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_RShiftVS: + Assembler::evpsraw(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_RShiftVI: + Assembler::evpsrad(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_RShiftVL: + Assembler::evpsraq(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_URShiftVS: + Assembler::evpsrlw(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_URShiftVI: + Assembler::evpsrld(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_URShiftVL: + Assembler::evpsrlq(dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_RotateRightV: + evrord(eType, dst, mask, src1, imm8, merge, vlen_enc); break; + case Op_RotateLeftV: + evrold(eType, dst, mask, src1, imm8, merge, vlen_enc); break; + default: + fatal("Unsupported masked operation"); break; + } +} + +void C2_MacroAssembler::evmasked_op(int ideal_opc, BasicType eType, KRegister mask, XMMRegister dst, + XMMRegister src1, XMMRegister src2, bool merge, int vlen_enc, + bool is_varshift) { + switch (ideal_opc) { + case Op_AddVB: + evpaddb(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVS: + evpaddw(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVI: + evpaddd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVL: + evpaddq(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVF: + evaddps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVD: + evaddpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVB: + evpsubb(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVS: + evpsubw(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVI: + evpsubd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVL: + evpsubq(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVF: + evsubps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVD: + evsubpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVS: + evpmullw(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVI: + evpmulld(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVL: + evpmullq(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVF: + evmulps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVD: + evmulpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_DivVF: + evdivps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_DivVD: + evdivpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SqrtVF: + evsqrtps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SqrtVD: + evsqrtpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AbsVB: + evpabsb(dst, mask, src2, merge, vlen_enc); break; + case Op_AbsVS: + evpabsw(dst, mask, src2, merge, vlen_enc); break; + case Op_AbsVI: + evpabsd(dst, mask, src2, merge, vlen_enc); break; + case Op_AbsVL: + evpabsq(dst, mask, src2, merge, vlen_enc); break; + case Op_FmaVF: + evpfma213ps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_FmaVD: + evpfma213pd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_VectorRearrange: + evperm(eType, dst, mask, src2, src1, merge, vlen_enc); break; + case Op_LShiftVS: + evpsllw(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_LShiftVI: + evpslld(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_LShiftVL: + evpsllq(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_RShiftVS: + evpsraw(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_RShiftVI: + evpsrad(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_RShiftVL: + evpsraq(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_URShiftVS: + evpsrlw(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_URShiftVI: + evpsrld(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_URShiftVL: + evpsrlq(dst, mask, src1, src2, merge, vlen_enc, is_varshift); break; + case Op_RotateLeftV: + evrold(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_RotateRightV: + evrord(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MaxV: + evpmaxs(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MinV: + evpmins(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_XorV: + evxor(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_OrV: + evor(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AndV: + evand(eType, dst, mask, src1, src2, merge, vlen_enc); break; + default: + fatal("Unsupported masked operation"); break; + } +} + +void C2_MacroAssembler::evmasked_op(int ideal_opc, BasicType eType, KRegister mask, XMMRegister dst, + XMMRegister src1, Address src2, bool merge, int vlen_enc) { + switch (ideal_opc) { + case Op_AddVB: + evpaddb(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVS: + evpaddw(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVI: + evpaddd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVL: + evpaddq(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVF: + evaddps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AddVD: + evaddpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVB: + evpsubb(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVS: + evpsubw(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVI: + evpsubd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVL: + evpsubq(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVF: + evsubps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_SubVD: + evsubpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVS: + evpmullw(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVI: + evpmulld(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVL: + evpmullq(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVF: + evmulps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MulVD: + evmulpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_DivVF: + evdivps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_DivVD: + evdivpd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_FmaVF: + evpfma213ps(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_FmaVD: + evpfma213pd(dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MaxV: + evpmaxs(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_MinV: + evpmins(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_XorV: + evxor(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_OrV: + evor(eType, dst, mask, src1, src2, merge, vlen_enc); break; + case Op_AndV: + evand(eType, dst, mask, src1, src2, merge, vlen_enc); break; + default: + fatal("Unsupported masked operation"); break; + } +} + +void C2_MacroAssembler::masked_op(int ideal_opc, int mask_len, KRegister dst, + KRegister src1, KRegister src2) { + BasicType etype = T_ILLEGAL; + switch(mask_len) { + case 2: + case 4: + case 8: etype = T_BYTE; break; + case 16: etype = T_SHORT; break; + case 32: etype = T_INT; break; + case 64: etype = T_LONG; break; + default: fatal("Unsupported type"); break; + } + assert(etype != T_ILLEGAL, ""); + switch(ideal_opc) { + case Op_AndVMask: + kand(etype, dst, src1, src2); break; + case Op_OrVMask: + kor(etype, dst, src1, src2); break; + case Op_XorVMask: + kxor(etype, dst, src1, src2); break; + default: + fatal("Unsupported masked operation"); break; + } +} + #ifdef _LP64 -void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, - Register tmp, KRegister ktmp, int masklen, int vec_enc) { - assert(VM_Version::supports_avx512vlbw(), ""); - vpxor(xtmp, xtmp, xtmp, vec_enc); - vpsubb(xtmp, xtmp, mask, vec_enc); - evpmovb2m(ktmp, xtmp, vec_enc); - kmovql(tmp, ktmp); +void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, KRegister mask, + Register tmp, int masklen, int masksize, + int vec_enc) { + if(VM_Version::supports_avx512bw()) { + kmovql(tmp, mask); + } else { + assert(masklen <= 16, ""); + kmovwl(tmp, mask); + } + if (masksize < 16) { + andq(tmp, (((jlong)1 << masklen) - 1)); + } switch(opc) { case Op_VectorMaskTrueCount: popcntq(dst, tmp); @@ -3854,12 +4084,13 @@ void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister } void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, - XMMRegister xtmp1, Register tmp, int masklen, int vec_enc) { + XMMRegister xtmp1, Register tmp, int masklen, int masksize, + int vec_enc) { assert(VM_Version::supports_avx(), ""); vpxor(xtmp, xtmp, xtmp, vec_enc); vpsubb(xtmp, xtmp, mask, vec_enc); vpmovmskb(tmp, xtmp, vec_enc); - if (masklen < 64) { + if (masksize < 16) { andq(tmp, (((jlong)1 << masklen) - 1)); } switch(opc) { diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp index 2ef8e27cadc..8efa36a8101 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp @@ -142,6 +142,8 @@ public: void evpblend(BasicType typ, XMMRegister dst, KRegister kmask, XMMRegister src1, XMMRegister src2, bool merge, int vector_len); void load_vector_mask(XMMRegister dst, XMMRegister src, int vlen_in_bytes, BasicType elem_bt, bool is_legacy); + void load_vector_mask(KRegister dst, XMMRegister src, XMMRegister xtmp, Register tmp, bool novlbwdq, int vlen_enc); + void load_iota_indices(XMMRegister dst, Register scratch, int vlen_in_bytes); // vector compare @@ -222,11 +224,10 @@ public: public: #ifdef _LP64 - void vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, Register tmp, - KRegister ktmp, int masklen, int vec_enc); + void vector_mask_operation(int opc, Register dst, KRegister mask, Register tmp, int masklen, int masksize, int vec_enc); void vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, XMMRegister xtmp1, - Register tmp, int masklen, int vec_enc); + Register tmp, int masklen, int masksize, int vec_enc); #endif void string_indexof_char(Register str1, Register cnt1, Register ch, Register result, XMMRegister vec1, XMMRegister vec2, XMMRegister vec3, Register tmp); @@ -273,4 +274,18 @@ public: Register limit, Register result, Register chr, XMMRegister vec1, XMMRegister vec2, bool is_char, KRegister mask = knoreg); + + void evmasked_op(int ideal_opc, BasicType eType, KRegister mask, + XMMRegister dst, XMMRegister src1, XMMRegister src2, + bool merge, int vlen_enc, bool is_varshift = false); + + void evmasked_op(int ideal_opc, BasicType eType, KRegister mask, + XMMRegister dst, XMMRegister src1, Address src2, + bool merge, int vlen_enc); + + void evmasked_op(int ideal_opc, BasicType eType, KRegister mask, XMMRegister dst, + XMMRegister src1, int imm8, bool merge, int vlen_enc); + + void masked_op(int ideal_opc, int mask_len, KRegister dst, + KRegister src1, KRegister src2); #endif // CPU_X86_C2_MACROASSEMBLER_X86_HPP diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 30056be9a65..6a7f671c351 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -8267,6 +8267,379 @@ void MacroAssembler::evmovdqu(BasicType type, KRegister kmask, Address dst, XMMR } } +void MacroAssembler::knot(uint masklen, KRegister dst, KRegister src, KRegister ktmp, Register rtmp) { + switch(masklen) { + case 2: + knotbl(dst, src); + movl(rtmp, 3); + kmovbl(ktmp, rtmp); + kandbl(dst, ktmp, dst); + break; + case 4: + knotbl(dst, src); + movl(rtmp, 15); + kmovbl(ktmp, rtmp); + kandbl(dst, ktmp, dst); + break; + case 8: + knotbl(dst, src); + break; + case 16: + knotwl(dst, src); + break; + case 32: + knotdl(dst, src); + break; + case 64: + knotql(dst, src); + break; + default: + fatal("Unexpected vector length %d", masklen); + break; + } +} + +void MacroAssembler::kand(BasicType type, KRegister dst, KRegister src1, KRegister src2) { + switch(type) { + case T_BOOLEAN: + case T_BYTE: + kandbl(dst, src1, src2); + break; + case T_CHAR: + case T_SHORT: + kandwl(dst, src1, src2); + break; + case T_INT: + case T_FLOAT: + kanddl(dst, src1, src2); + break; + case T_LONG: + case T_DOUBLE: + kandql(dst, src1, src2); + break; + default: + fatal("Unexpected type argument %s", type2name(type)); + break; + } +} + +void MacroAssembler::kor(BasicType type, KRegister dst, KRegister src1, KRegister src2) { + switch(type) { + case T_BOOLEAN: + case T_BYTE: + korbl(dst, src1, src2); + break; + case T_CHAR: + case T_SHORT: + korwl(dst, src1, src2); + break; + case T_INT: + case T_FLOAT: + kordl(dst, src1, src2); + break; + case T_LONG: + case T_DOUBLE: + korql(dst, src1, src2); + break; + default: + fatal("Unexpected type argument %s", type2name(type)); + break; + } +} + +void MacroAssembler::kxor(BasicType type, KRegister dst, KRegister src1, KRegister src2) { + switch(type) { + case T_BOOLEAN: + case T_BYTE: + kxorbl(dst, src1, src2); + break; + case T_CHAR: + case T_SHORT: + kxorwl(dst, src1, src2); + break; + case T_INT: + case T_FLOAT: + kxordl(dst, src1, src2); + break; + case T_LONG: + case T_DOUBLE: + kxorql(dst, src1, src2); + break; + default: + fatal("Unexpected type argument %s", type2name(type)); + break; + } +} + +void MacroAssembler::evperm(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + switch(type) { + case T_BOOLEAN: + case T_BYTE: + evpermb(dst, mask, nds, src, merge, vector_len); break; + case T_CHAR: + case T_SHORT: + evpermw(dst, mask, nds, src, merge, vector_len); break; + case T_INT: + case T_FLOAT: + evpermd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + case T_DOUBLE: + evpermq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evperm(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + switch(type) { + case T_BOOLEAN: + case T_BYTE: + evpermb(dst, mask, nds, src, merge, vector_len); break; + case T_CHAR: + case T_SHORT: + evpermw(dst, mask, nds, src, merge, vector_len); break; + case T_INT: + case T_FLOAT: + evpermd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + case T_DOUBLE: + evpermq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evpmins(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + switch(type) { + case T_BYTE: + evpminsb(dst, mask, nds, src, merge, vector_len); break; + case T_SHORT: + evpminsw(dst, mask, nds, src, merge, vector_len); break; + case T_INT: + evpminsd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpminsq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evpmaxs(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + switch(type) { + case T_BYTE: + evpmaxsb(dst, mask, nds, src, merge, vector_len); break; + case T_SHORT: + evpmaxsw(dst, mask, nds, src, merge, vector_len); break; + case T_INT: + evpmaxsd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpmaxsq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evpmins(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + switch(type) { + case T_BYTE: + evpminsb(dst, mask, nds, src, merge, vector_len); break; + case T_SHORT: + evpminsw(dst, mask, nds, src, merge, vector_len); break; + case T_INT: + evpminsd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpminsq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evpmaxs(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + switch(type) { + case T_BYTE: + evpmaxsb(dst, mask, nds, src, merge, vector_len); break; + case T_SHORT: + evpmaxsw(dst, mask, nds, src, merge, vector_len); break; + case T_INT: + evpmaxsd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpmaxsq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evxor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + switch(type) { + case T_INT: + evpxord(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpxorq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evxor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + switch(type) { + case T_INT: + evpxord(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpxorq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + switch(type) { + case T_INT: + Assembler::evpord(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evporq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + switch(type) { + case T_INT: + Assembler::evpord(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evporq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evand(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len) { + switch(type) { + case T_INT: + evpandd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpandq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evand(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len) { + switch(type) { + case T_INT: + evpandd(dst, mask, nds, src, merge, vector_len); break; + case T_LONG: + evpandq(dst, mask, nds, src, merge, vector_len); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::anytrue(Register dst, uint masklen, KRegister src1, KRegister src2) { + masklen = masklen < 8 ? 8 : masklen; + ktest(masklen, src1, src2); + setb(Assembler::notZero, dst); + movzbl(dst, dst); +} + +void MacroAssembler::alltrue(Register dst, uint masklen, KRegister src1, KRegister src2, KRegister kscratch) { + if (masklen < 8) { + knotbl(kscratch, src2); + kortestbl(src1, kscratch); + setb(Assembler::carrySet, dst); + movzbl(dst, dst); + } else { + ktest(masklen, src1, src2); + setb(Assembler::carrySet, dst); + movzbl(dst, dst); + } +} + +void MacroAssembler::kortest(uint masklen, KRegister src1, KRegister src2) { + switch(masklen) { + case 8: + kortestbl(src1, src2); + break; + case 16: + kortestwl(src1, src2); + break; + case 32: + kortestdl(src1, src2); + break; + case 64: + kortestql(src1, src2); + break; + default: + fatal("Unexpected mask length %d", masklen); + break; + } +} + + +void MacroAssembler::ktest(uint masklen, KRegister src1, KRegister src2) { + switch(masklen) { + case 8: + ktestbl(src1, src2); + break; + case 16: + ktestwl(src1, src2); + break; + case 32: + ktestdl(src1, src2); + break; + case 64: + ktestql(src1, src2); + break; + default: + fatal("Unexpected mask length %d", masklen); + break; + } +} + +void MacroAssembler::evrold(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vlen_enc) { + switch(type) { + case T_INT: + evprold(dst, mask, src, shift, merge, vlen_enc); break; + case T_LONG: + evprolq(dst, mask, src, shift, merge, vlen_enc); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + break; + } +} + +void MacroAssembler::evrord(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vlen_enc) { + switch(type) { + case T_INT: + evprord(dst, mask, src, shift, merge, vlen_enc); break; + case T_LONG: + evprorq(dst, mask, src, shift, merge, vlen_enc); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evrold(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src1, XMMRegister src2, bool merge, int vlen_enc) { + switch(type) { + case T_INT: + evprolvd(dst, mask, src1, src2, merge, vlen_enc); break; + case T_LONG: + evprolvq(dst, mask, src1, src2, merge, vlen_enc); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} + +void MacroAssembler::evrord(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src1, XMMRegister src2, bool merge, int vlen_enc) { + switch(type) { + case T_INT: + evprorvd(dst, mask, src1, src2, merge, vlen_enc); break; + case T_LONG: + evprorvq(dst, mask, src1, src2, merge, vlen_enc); break; + default: + fatal("Unexpected type argument %s", type2name(type)); break; + } +} #if COMPILER2_OR_JVMCI void MacroAssembler::fill_masked(BasicType bt, Address dst, XMMRegister xmm, KRegister mask, diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 415223253c7..392ff61d87f 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -1338,6 +1338,75 @@ public: void evpsraq(XMMRegister dst, XMMRegister nds, XMMRegister shift, int vector_len); void evpsraq(XMMRegister dst, XMMRegister nds, int shift, int vector_len); + void evpsllw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsllw(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsllvw(dst, mask, nds, src, merge, vector_len); + } + } + void evpslld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpslld(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsllvd(dst, mask, nds, src, merge, vector_len); + } + } + void evpsllq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsllq(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsllvq(dst, mask, nds, src, merge, vector_len); + } + } + void evpsrlw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsrlw(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsrlvw(dst, mask, nds, src, merge, vector_len); + } + } + void evpsrld(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsrld(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsrlvd(dst, mask, nds, src, merge, vector_len); + } + } + void evpsrlq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsrlq(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsrlvq(dst, mask, nds, src, merge, vector_len); + } + } + void evpsraw(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsraw(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsravw(dst, mask, nds, src, merge, vector_len); + } + } + void evpsrad(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsrad(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsravd(dst, mask, nds, src, merge, vector_len); + } + } + void evpsraq(XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len, bool is_varshift) { + if (!is_varshift) { + Assembler::evpsraq(dst, mask, nds, src, merge, vector_len); + } else { + Assembler::evpsravq(dst, mask, nds, src, merge, vector_len); + } + } + + void evpmins(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmaxs(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evpmins(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void evpmaxs(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + void vpsrlw(XMMRegister dst, XMMRegister nds, XMMRegister shift, int vector_len); void vpsrlw(XMMRegister dst, XMMRegister nds, int shift, int vector_len); @@ -1627,7 +1696,33 @@ public: Assembler::evpclmulqdq(dst, nds, src, 0x11, vector_len); } - // Data + // AVX-512 mask operations. + void kand(BasicType etype, KRegister dst, KRegister src1, KRegister src2); + void kor(BasicType type, KRegister dst, KRegister src1, KRegister src2); + void knot(uint masklen, KRegister dst, KRegister src, KRegister ktmp = knoreg, Register rtmp = noreg); + void kxor(BasicType type, KRegister dst, KRegister src1, KRegister src2); + void kortest(uint masklen, KRegister src1, KRegister src2); + void ktest(uint masklen, KRegister src1, KRegister src2); + + void evperm(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evperm(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + + void evor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + + void evand(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evand(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + + void evxor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, XMMRegister src, bool merge, int vector_len); + void evxor(BasicType type, XMMRegister dst, KRegister mask, XMMRegister nds, Address src, bool merge, int vector_len); + + void evrold(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vlen_enc); + void evrold(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src1, XMMRegister src2, bool merge, int vlen_enc); + void evrord(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src, int shift, bool merge, int vlen_enc); + void evrord(BasicType type, XMMRegister dst, KRegister mask, XMMRegister src1, XMMRegister src2, bool merge, int vlen_enc); + + void alltrue(Register dst, uint masklen, KRegister src1, KRegister src2, KRegister kscratch); + void anytrue(Register dst, uint masklen, KRegister src, KRegister kscratch); void cmov32( Condition cc, Register dst, Address src); void cmov32( Condition cc, Register dst, Register src); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp index 654066ac872..1525d10e5b5 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp @@ -4001,6 +4001,7 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::x86::_vector_byte_perm_mask = generate_vector_byte_perm_mask("vector_byte_perm_mask"); StubRoutines::x86::_vector_long_sign_mask = generate_vector_mask_long_double("vector_long_sign_mask", 0x80000000, 0x00000000); StubRoutines::x86::_vector_all_bits_set = generate_vector_mask("vector_all_bits_set", 0xFFFFFFFF); + StubRoutines::x86::_vector_int_mask_cmp_bits = generate_vector_mask("vector_int_mask_cmp_bits", 0x00000001); StubRoutines::x86::_vector_iota_indices = generate_iota_indices("iota_indices"); // support for verify_oop (must happen after universe_init) diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 24509e694a6..f5ef24ddf4c 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -7676,6 +7676,7 @@ address generate_avx_ghash_processBlocks() { StubRoutines::x86::_vector_double_sign_mask = generate_vector_mask("vector_double_sign_mask", 0x7FFFFFFFFFFFFFFF); StubRoutines::x86::_vector_double_sign_flip = generate_vector_mask("vector_double_sign_flip", 0x8000000000000000); StubRoutines::x86::_vector_all_bits_set = generate_vector_mask("vector_all_bits_set", 0xFFFFFFFFFFFFFFFF); + StubRoutines::x86::_vector_int_mask_cmp_bits = generate_vector_mask("vector_int_mask_cmp_bits", 0x0000000100000001); StubRoutines::x86::_vector_short_to_byte_mask = generate_vector_mask("vector_short_to_byte_mask", 0x00ff00ff00ff00ff); StubRoutines::x86::_vector_byte_perm_mask = generate_vector_byte_perm_mask("vector_byte_perm_mask"); StubRoutines::x86::_vector_int_to_byte_mask = generate_vector_mask("vector_int_to_byte_mask", 0x000000ff000000ff); diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.cpp b/src/hotspot/cpu/x86/stubRoutines_x86.cpp index 9a4523cd06f..ec5a5d0f143 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.cpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.cpp @@ -48,6 +48,7 @@ address StubRoutines::x86::_vector_int_to_byte_mask = NULL; address StubRoutines::x86::_vector_int_to_short_mask = NULL; address StubRoutines::x86::_vector_all_bits_set = NULL; address StubRoutines::x86::_vector_byte_shuffle_mask = NULL; +address StubRoutines::x86::_vector_int_mask_cmp_bits = NULL; address StubRoutines::x86::_vector_short_shuffle_mask = NULL; address StubRoutines::x86::_vector_int_shuffle_mask = NULL; address StubRoutines::x86::_vector_long_shuffle_mask = NULL; diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.hpp b/src/hotspot/cpu/x86/stubRoutines_x86.hpp index 4134990dcbb..1ef8377dfc2 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp @@ -165,6 +165,7 @@ class x86 { static address _vector_double_sign_flip; static address _vector_long_sign_mask; static address _vector_all_bits_set; + static address _vector_int_mask_cmp_bits; static address _vector_byte_perm_mask; static address _vector_int_to_byte_mask; static address _vector_int_to_short_mask; @@ -289,6 +290,10 @@ class x86 { return _vector_all_bits_set; } + static address vector_int_mask_cmp_bits() { + return _vector_int_mask_cmp_bits; + } + static address vector_byte_perm_mask() { return _vector_byte_perm_mask; } diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index ec82ecd81c7..6feb3b8c1a0 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -884,6 +884,7 @@ public: static bool supports_avx512bw() { return (_features & CPU_AVX512BW) != 0; } static bool supports_avx512vl() { return (_features & CPU_AVX512VL) != 0; } static bool supports_avx512vlbw() { return (supports_evex() && supports_avx512bw() && supports_avx512vl()); } + static bool supports_avx512bwdq() { return (supports_evex() && supports_avx512bw() && supports_avx512dq()); } static bool supports_avx512vldq() { return (supports_evex() && supports_avx512dq() && supports_avx512vl()); } static bool supports_avx512vlbwdq() { return (supports_evex() && supports_avx512vl() && supports_avx512bw() && supports_avx512dq()); } diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 1ea22eee800..5a8569dc6e0 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -1374,6 +1374,7 @@ Assembler::Width widthForType(BasicType bt) { static address vector_byte_perm_mask() { return StubRoutines::x86::vector_byte_perm_mask(); } static address vector_long_sign_mask() { return StubRoutines::x86::vector_long_sign_mask(); } static address vector_all_bits_set() { return StubRoutines::x86::vector_all_bits_set(); } + static address vector_int_mask_cmp_bits() { return StubRoutines::x86::vector_int_mask_cmp_bits(); } static address vector_int_to_short_mask() { return StubRoutines::x86::vector_int_to_short_mask(); } static address vector_byte_shufflemask() { return StubRoutines::x86::vector_byte_shuffle_mask(); } static address vector_short_shufflemask() { return StubRoutines::x86::vector_short_shuffle_mask(); } @@ -1556,6 +1557,7 @@ const bool Matcher::match_rule_supported(int opcode) { case Op_VectorMaskFirstTrue: case Op_VectorMaskLastTrue: case Op_VectorMaskTrueCount: + case Op_VectorMaskToLong: if (!is_LP64 || UseAVX < 1) { return false; } @@ -1802,8 +1804,10 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return false; } break; + case Op_LoadVectorGatherMasked: + case Op_StoreVectorScatterMasked: case Op_StoreVectorScatter: - if(bt == T_BYTE || bt == T_SHORT) { + if(is_subword_type(bt)) { return false; } else if (size_in_bits < 512 && !VM_Version::supports_avx512vl()) { return false; @@ -1814,6 +1818,17 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return false; } break; + case Op_MaskAll: + if (!is_LP64 || !VM_Version::supports_evex()) { + return false; + } + if ((vlen > 16 || is_subword_type(bt)) && !VM_Version::supports_avx512bw()) { + return false; + } + if (size_in_bits < 512 && !VM_Version::supports_avx512vl()) { + return false; + } + break; case Op_VectorMaskCmp: if (vlen < 2 || size_in_bits < 32) { return false; @@ -1823,6 +1838,148 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return true; // Per default match rules are supported. } +const bool Matcher::match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt) { + // ADLC based match_rule_supported routine checks for the existence of pattern based + // on IR opcode. Most of the unary/binary/ternary masked operation share the IR nodes + // of their non-masked counterpart with mask edge being the differentiator. + // This routine does a strict check on the existence of masked operation patterns + // by returning a default false value for all the other opcodes apart from the + // ones whose masked instruction patterns are defined in this file. + if (!match_rule_supported_vector(opcode, vlen, bt)) { + return false; + } + + const bool is_LP64 = LP64_ONLY(true) NOT_LP64(false); + int size_in_bits = vlen * type2aelembytes(bt) * BitsPerByte; + if (size_in_bits != 512 && !VM_Version::supports_avx512vl()) { + return false; + } + switch(opcode) { + // Unary masked operations + case Op_AbsVB: + case Op_AbsVS: + if(!VM_Version::supports_avx512bw()) { + return false; // Implementation limitation + } + case Op_AbsVI: + case Op_AbsVL: + return true; + + // Ternary masked operations + case Op_FmaVF: + case Op_FmaVD: + return true; + + // Binary masked operations + case Op_AddVB: + case Op_AddVS: + case Op_SubVB: + case Op_SubVS: + case Op_MulVS: + case Op_LShiftVS: + case Op_RShiftVS: + case Op_URShiftVS: + assert(size_in_bits == 512 || VM_Version::supports_avx512vl(), ""); + if (!VM_Version::supports_avx512bw()) { + return false; // Implementation limitation + } + return true; + + case Op_MulVL: + assert(size_in_bits == 512 || VM_Version::supports_avx512vl(), ""); + if (!VM_Version::supports_avx512dq()) { + return false; // Implementation limitation + } + return true; + + case Op_AndV: + case Op_OrV: + case Op_XorV: + case Op_RotateRightV: + case Op_RotateLeftV: + if (bt != T_INT && bt != T_LONG) { + return false; // Implementation limitation + } + return true; + + case Op_VectorLoadMask: + assert(size_in_bits == 512 || VM_Version::supports_avx512vl(), ""); + if (is_subword_type(bt) && !VM_Version::supports_avx512bw()) { + return false; + } + return true; + + case Op_AddVI: + case Op_AddVL: + case Op_AddVF: + case Op_AddVD: + case Op_SubVI: + case Op_SubVL: + case Op_SubVF: + case Op_SubVD: + case Op_MulVI: + case Op_MulVF: + case Op_MulVD: + case Op_DivVF: + case Op_DivVD: + case Op_SqrtVF: + case Op_SqrtVD: + case Op_LShiftVI: + case Op_LShiftVL: + case Op_RShiftVI: + case Op_RShiftVL: + case Op_URShiftVI: + case Op_URShiftVL: + case Op_LoadVectorMasked: + case Op_StoreVectorMasked: + case Op_LoadVectorGatherMasked: + case Op_StoreVectorScatterMasked: + return true; + + case Op_MaxV: + case Op_MinV: + if (is_subword_type(bt) && !VM_Version::supports_avx512bw()) { + return false; // Implementation limitation + } + if (is_floating_point_type(bt)) { + return false; // Implementation limitation + } + return true; + + case Op_VectorMaskCmp: + if (is_subword_type(bt) && !VM_Version::supports_avx512bw()) { + return false; // Implementation limitation + } + return true; + + case Op_VectorRearrange: + if (bt == T_SHORT && !VM_Version::supports_avx512bw()) { + return false; // Implementation limitation + } + if (bt == T_BYTE && !VM_Version::supports_avx512_vbmi()) { + return false; // Implementation limitation + } else if ((bt == T_INT || bt == T_FLOAT) && size_in_bits < 256) { + return false; // Implementation limitation + } + return true; + + // Binary Logical operations + case Op_AndVMask: + case Op_OrVMask: + case Op_XorVMask: + if (vlen > 16 && !VM_Version::supports_avx512bw()) { + return false; // Implementation limitation + } + return true; + + case Op_MaskAll: + return true; + + default: + return false; + } +} + MachOper* Matcher::pd_specialize_generic_vector_operand(MachOper* generic_opnd, uint ideal_reg, bool is_temp) { assert(Matcher::is_generic_vector(generic_opnd), "not generic"); bool legacy = (generic_opnd->opcode() == LEGVEC); @@ -1887,7 +2044,7 @@ const RegMask* Matcher::predicate_reg_mask(void) { } const TypeVect* Matcher::predicate_reg_type(const Type* elemTy, int length) { - return new TypeVectMask(TypeInt::BOOL, length); + return new TypeVectMask(elemTy, length); } // Max vector size in bytes. 0 if not supported. @@ -3310,10 +3467,85 @@ instruct sqrtD_reg(regD dst) %{ ins_pipe(pipe_slow); %} + // ---------------------------------------- VectorReinterpret ------------------------------------ +instruct reinterpret_mask(kReg dst) %{ + predicate(n->bottom_type()->isa_vectmask() && + Matcher::vector_length(n) == Matcher::vector_length(n->in(1))); // dst == src + match(Set dst (VectorReinterpret dst)); + ins_cost(125); + format %{ "vector_reinterpret $dst\t!" %} + ins_encode %{ + // empty + %} + ins_pipe( pipe_slow ); +%} + +instruct reinterpret_mask_W2B(kReg dst, kReg src, vec xtmp) %{ + predicate(UseAVX > 2 && Matcher::vector_length(n) != Matcher::vector_length(n->in(1)) && + n->bottom_type()->isa_vectmask() && + n->in(1)->bottom_type()->isa_vectmask() && + n->in(1)->bottom_type()->is_vectmask()->element_basic_type() == T_SHORT && + n->bottom_type()->is_vectmask()->element_basic_type() == T_BYTE); // dst == src + match(Set dst (VectorReinterpret src)); + effect(TEMP xtmp); + format %{ "vector_mask_reinterpret_W2B $dst $src\t!" %} + ins_encode %{ + int src_sz = Matcher::vector_length(this, $src)*type2aelembytes(T_SHORT); + int dst_sz = Matcher::vector_length(this)*type2aelembytes(T_BYTE); + assert(src_sz == dst_sz , "src and dst size mismatch"); + int vlen_enc = vector_length_encoding(src_sz); + __ evpmovm2w($xtmp$$XMMRegister, $src$$KRegister, vlen_enc); + __ evpmovb2m($dst$$KRegister, $xtmp$$XMMRegister, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct reinterpret_mask_D2B(kReg dst, kReg src, vec xtmp) %{ + predicate(UseAVX > 2 && Matcher::vector_length(n) != Matcher::vector_length(n->in(1)) && + n->bottom_type()->isa_vectmask() && + n->in(1)->bottom_type()->isa_vectmask() && + (n->in(1)->bottom_type()->is_vectmask()->element_basic_type() == T_INT || + n->in(1)->bottom_type()->is_vectmask()->element_basic_type() == T_FLOAT) && + n->bottom_type()->is_vectmask()->element_basic_type() == T_BYTE); // dst == src + match(Set dst (VectorReinterpret src)); + effect(TEMP xtmp); + format %{ "vector_mask_reinterpret_D2B $dst $src\t!" %} + ins_encode %{ + int src_sz = Matcher::vector_length(this, $src)*type2aelembytes(T_INT); + int dst_sz = Matcher::vector_length(this)*type2aelembytes(T_BYTE); + assert(src_sz == dst_sz , "src and dst size mismatch"); + int vlen_enc = vector_length_encoding(src_sz); + __ evpmovm2d($xtmp$$XMMRegister, $src$$KRegister, vlen_enc); + __ evpmovb2m($dst$$KRegister, $xtmp$$XMMRegister, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct reinterpret_mask_Q2B(kReg dst, kReg src, vec xtmp) %{ + predicate(UseAVX > 2 && Matcher::vector_length(n) != Matcher::vector_length(n->in(1)) && + n->bottom_type()->isa_vectmask() && + n->in(1)->bottom_type()->isa_vectmask() && + (n->in(1)->bottom_type()->is_vectmask()->element_basic_type() == T_LONG || + n->in(1)->bottom_type()->is_vectmask()->element_basic_type() == T_DOUBLE) && + n->bottom_type()->is_vectmask()->element_basic_type() == T_BYTE); // dst == src + match(Set dst (VectorReinterpret src)); + effect(TEMP xtmp); + format %{ "vector_mask_reinterpret_Q2B $dst $src\t!" %} + ins_encode %{ + int src_sz = Matcher::vector_length(this, $src)*type2aelembytes(T_LONG); + int dst_sz = Matcher::vector_length(this)*type2aelembytes(T_BYTE); + assert(src_sz == dst_sz , "src and dst size mismatch"); + int vlen_enc = vector_length_encoding(src_sz); + __ evpmovm2q($xtmp$$XMMRegister, $src$$KRegister, vlen_enc); + __ evpmovb2m($dst$$KRegister, $xtmp$$XMMRegister, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} instruct reinterpret(vec dst) %{ - predicate(Matcher::vector_length_in_bytes(n) == Matcher::vector_length_in_bytes(n->in(1))); // dst == src + predicate(!n->bottom_type()->isa_vectmask() && + Matcher::vector_length_in_bytes(n) == Matcher::vector_length_in_bytes(n->in(1))); // dst == src match(Set dst (VectorReinterpret dst)); ins_cost(125); format %{ "vector_reinterpret $dst\t!" %} @@ -3348,6 +3580,7 @@ instruct reinterpret_expand(vec dst, vec src, rRegP scratch) %{ instruct vreinterpret_expand4(legVec dst, vec src, rRegP scratch) %{ predicate(UseAVX > 0 && + !n->bottom_type()->isa_vectmask() && (Matcher::vector_length_in_bytes(n->in(1)) == 4) && // src (Matcher::vector_length_in_bytes(n->in(1)) < Matcher::vector_length_in_bytes(n))); // src < dst match(Set dst (VectorReinterpret src)); @@ -3363,6 +3596,7 @@ instruct vreinterpret_expand4(legVec dst, vec src, rRegP scratch) %{ instruct vreinterpret_expand(legVec dst, vec src) %{ predicate(UseAVX > 0 && + !n->bottom_type()->isa_vectmask() && (Matcher::vector_length_in_bytes(n->in(1)) > 4) && // src (Matcher::vector_length_in_bytes(n->in(1)) < Matcher::vector_length_in_bytes(n))); // src < dst match(Set dst (VectorReinterpret src)); @@ -3380,7 +3614,8 @@ instruct vreinterpret_expand(legVec dst, vec src) %{ %} instruct reinterpret_shrink(vec dst, legVec src) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) > Matcher::vector_length_in_bytes(n)); // src > dst + predicate(!n->bottom_type()->isa_vectmask() && + Matcher::vector_length_in_bytes(n->in(1)) > Matcher::vector_length_in_bytes(n)); // src > dst match(Set dst (VectorReinterpret src)); ins_cost(125); format %{ "vector_reinterpret_shrink $dst,$src\t!" %} @@ -3582,7 +3817,7 @@ instruct storeV(memory mem, vec src) %{ // Gather INT, LONG, FLOAT, DOUBLE instruct gather(legVec dst, memory mem, legVec idx, rRegP tmp, legVec mask) %{ - predicate(Matcher::vector_length_in_bytes(n) <= 32); + predicate(!VM_Version::supports_avx512vl() && Matcher::vector_length_in_bytes(n) <= 32); match(Set dst (LoadVectorGather mem idx)); effect(TEMP dst, TEMP tmp, TEMP mask); format %{ "load_vector_gather $dst, $mem, $idx\t! using $tmp and $mask as TEMP" %} @@ -3607,10 +3842,10 @@ instruct gather(legVec dst, memory mem, legVec idx, rRegP tmp, legVec mask) %{ %} instruct evgather(vec dst, memory mem, vec idx, rRegP tmp, kReg ktmp) %{ - predicate(Matcher::vector_length_in_bytes(n) == 64); + predicate(VM_Version::supports_avx512vl() || Matcher::vector_length_in_bytes(n) == 64); match(Set dst (LoadVectorGather mem idx)); effect(TEMP dst, TEMP tmp, TEMP ktmp); - format %{ "load_vector_gather $dst, $mem, $idx\t! using $tmp and k2 as TEMP" %} + format %{ "load_vector_gather $dst, $mem, $idx\t! using $tmp and ktmp as TEMP" %} ins_encode %{ assert(UseAVX > 2, "sanity"); @@ -3626,6 +3861,24 @@ instruct evgather(vec dst, memory mem, vec idx, rRegP tmp, kReg ktmp) %{ ins_pipe( pipe_slow ); %} +instruct evgather_masked(vec dst, memory mem, vec idx, kReg mask, kReg ktmp, rRegP tmp) %{ + match(Set dst (LoadVectorGatherMasked mem (Binary idx mask))); + effect(TEMP_DEF dst, TEMP tmp, TEMP ktmp); + format %{ "load_vector_gather_masked $dst, $mem, $idx, $mask\t! using $tmp and ktmp as TEMP" %} + ins_encode %{ + assert(UseAVX > 2, "sanity"); + int vlen_enc = vector_length_encoding(this); + BasicType elem_bt = Matcher::vector_element_basic_type(this); + assert(!is_subword_type(elem_bt), "sanity"); // T_INT, T_LONG, T_FLOAT, T_DOUBLE + // Note: Since gather instruction partially updates the opmask register used + // for predication hense moving mask operand to a temporary. + __ kmovwl($ktmp$$KRegister, $mask$$KRegister); + __ vpxor($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); + __ lea($tmp$$Register, $mem$$Address); + __ evgather(elem_bt, $dst$$XMMRegister, $ktmp$$KRegister, $tmp$$Register, $idx$$XMMRegister, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} // ====================Scatter======================================= // Scatter INT, LONG, FLOAT, DOUBLE @@ -3649,6 +3902,24 @@ instruct scatter(memory mem, vec src, vec idx, rRegP tmp, kReg ktmp) %{ ins_pipe( pipe_slow ); %} +instruct scatter_masked(memory mem, vec src, vec idx, kReg mask, kReg ktmp, rRegP tmp) %{ + match(Set mem (StoreVectorScatterMasked mem (Binary src (Binary idx mask)))); + effect(TEMP tmp, TEMP ktmp); + format %{ "store_vector_scatter_masked $mem, $idx, $src, $mask\t!" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this, $src); + BasicType elem_bt = Matcher::vector_element_basic_type(this, $src); + assert(Matcher::vector_length_in_bytes(this, $src) >= 16, "sanity"); + assert(!is_subword_type(elem_bt), "sanity"); // T_INT, T_LONG, T_FLOAT, T_DOUBLE + // Note: Since scatter instruction partially updates the opmask register used + // for predication hense moving mask operand to a temporary. + __ kmovwl($ktmp$$KRegister, $mask$$KRegister); + __ lea($tmp$$Register, $mem$$Address); + __ evscatter(elem_bt, $tmp$$Register, $idx$$XMMRegister, $ktmp$$KRegister, $src$$XMMRegister, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + // ====================REPLICATE======================================= // Replicate byte scalar to be vector @@ -3894,7 +4165,7 @@ instruct ReplI_zero(vec dst, immI_0 zero) %{ %} instruct ReplI_M1(vec dst, immI_M1 con) %{ - predicate(UseAVX > 0); + predicate(UseAVX > 0 && Matcher::vector_length_in_bytes(n) >= 16); match(Set dst (ReplicateB con)); match(Set dst (ReplicateS con)); match(Set dst (ReplicateI con)); @@ -5860,6 +6131,7 @@ instruct copySignD_imm(regD dst, regD src, regD tmp1, rRegL tmp2, immD zero) %{ instruct vsqrtF_reg(vec dst, vec src) %{ match(Set dst (SqrtVF src)); + ins_cost(400); format %{ "vsqrtps $dst,$src\t! sqrt packedF" %} ins_encode %{ assert(UseAVX > 0, "required"); @@ -5872,6 +6144,7 @@ instruct vsqrtF_reg(vec dst, vec src) %{ instruct vsqrtF_mem(vec dst, memory mem) %{ predicate(Matcher::vector_length_in_bytes(n->in(1)) > 8); match(Set dst (SqrtVF (LoadVector mem))); + ins_cost(400); format %{ "vsqrtps $dst,$mem\t! sqrt packedF" %} ins_encode %{ assert(UseAVX > 0, "required"); @@ -5884,6 +6157,7 @@ instruct vsqrtF_mem(vec dst, memory mem) %{ // Floating point vector sqrt instruct vsqrtD_reg(vec dst, vec src) %{ match(Set dst (SqrtVD src)); + ins_cost(400); format %{ "vsqrtpd $dst,$src\t! sqrt packedD" %} ins_encode %{ assert(UseAVX > 0, "required"); @@ -5896,6 +6170,7 @@ instruct vsqrtD_reg(vec dst, vec src) %{ instruct vsqrtD_mem(vec dst, memory mem) %{ predicate(Matcher::vector_length_in_bytes(n->in(1)) > 8); match(Set dst (SqrtVD (LoadVector mem))); + ins_cost(400); format %{ "vsqrtpd $dst,$mem\t! sqrt packedD" %} ins_encode %{ assert(UseAVX > 0, "required"); @@ -6904,7 +7179,8 @@ instruct vcastDtoF_reg(vec dst, vec src) %{ // --------------------------------- VectorMaskCmp -------------------------------------- instruct vcmpFD(legVec dst, legVec src1, legVec src2, immI8 cond) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 8 && // src1 + predicate(n->bottom_type()->isa_vectmask() == NULL && + Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 8 && // src1 Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 32 && // src1 is_floating_point_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 T_FLOAT, T_DOUBLE match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); @@ -6921,8 +7197,9 @@ instruct vcmpFD(legVec dst, legVec src1, legVec src2, immI8 cond) %{ ins_pipe( pipe_slow ); %} -instruct evcmpFD(vec dst, vec src1, vec src2, immI8 cond, rRegP scratch, kReg ktmp) %{ +instruct evcmpFD64(vec dst, vec src1, vec src2, immI8 cond, rRegP scratch, kReg ktmp) %{ predicate(Matcher::vector_length_in_bytes(n->in(1)->in(1)) == 64 && // src1 + n->bottom_type()->isa_vectmask() == NULL && is_floating_point_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 T_FLOAT, T_DOUBLE match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); effect(TEMP scratch, TEMP ktmp); @@ -6942,8 +7219,27 @@ instruct evcmpFD(vec dst, vec src1, vec src2, immI8 cond, rRegP scratch, kReg kt ins_pipe( pipe_slow ); %} +instruct evcmpFD(kReg dst, vec src1, vec src2, immI8 cond) %{ + predicate(n->bottom_type()->isa_vectmask() && + is_floating_point_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 T_FLOAT, T_DOUBLE + match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); + format %{ "vector_compare_evex $dst,$src1,$src2,$cond\t!" %} + ins_encode %{ + assert(bottom_type()->isa_vectmask(), "TypeVectMask expected"); + int vlen_enc = vector_length_encoding(this, $src1); + Assembler::ComparisonPredicateFP cmp = booltest_pred_to_comparison_pred_fp($cond$$constant); + KRegister mask = k0; // The comparison itself is not being masked. + if (Matcher::vector_element_basic_type(this, $src1) == T_FLOAT) { + __ evcmpps($dst$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, vlen_enc); + } else { + __ evcmppd($dst$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, vlen_enc); + } + %} + ins_pipe( pipe_slow ); +%} + instruct vcmp(legVec dst, legVec src1, legVec src2, immI8 cond, rRegP scratch) %{ - predicate((UseAVX <= 2 || !VM_Version::supports_avx512vl()) && + predicate(n->bottom_type()->isa_vectmask() == NULL && !is_unsigned_booltest_pred(n->in(2)->get_int()) && Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 4 && // src1 Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 32 && // src1 @@ -6961,7 +7257,7 @@ instruct vcmp(legVec dst, legVec src1, legVec src2, immI8 cond, rRegP scratch) % %} instruct vcmpu(legVec dst, legVec src1, legVec src2, immI8 cond, legVec vtmp1, legVec vtmp2, rRegP scratch) %{ - predicate((UseAVX == 2 || !VM_Version::supports_avx512vl()) && + predicate(n->bottom_type()->isa_vectmask() == NULL && is_unsigned_booltest_pred(n->in(2)->get_int()) && Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 8 && // src1 Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 16 && // src1 @@ -6980,7 +7276,7 @@ instruct vcmpu(legVec dst, legVec src1, legVec src2, immI8 cond, legVec vtmp1, l %} instruct vcmpu32(legVec dst, legVec src1, legVec src2, immI8 cond, legVec vtmp1, legVec vtmp2, legVec vtmp3, rRegP scratch) %{ - predicate((UseAVX == 2 || !VM_Version::supports_avx512vl()) && + predicate(n->bottom_type()->isa_vectmask() == NULL && is_unsigned_booltest_pred(n->in(2)->get_int()) && Matcher::vector_length_in_bytes(n->in(1)->in(1)) == 32 && // src1 is_integral_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 @@ -6997,9 +7293,8 @@ instruct vcmpu32(legVec dst, legVec src1, legVec src2, immI8 cond, legVec vtmp1, ins_pipe( pipe_slow ); %} -instruct evcmp(vec dst, vec src1, vec src2, immI8 cond, rRegP scratch, kReg ktmp) %{ - predicate(UseAVX > 2 && - (VM_Version::supports_avx512vl() || +instruct vcmpu64(vec dst, vec src1, vec src2, immI8 cond, rRegP scratch, kReg ktmp) %{ + predicate((n->bottom_type()->isa_vectmask() == NULL && Matcher::vector_length_in_bytes(n->in(1)->in(1)) == 64) && // src1 is_integral_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); @@ -7015,25 +7310,54 @@ instruct evcmp(vec dst, vec src1, vec src2, immI8 cond, rRegP scratch, kReg ktmp bool merge = false; BasicType src1_elem_bt = Matcher::vector_element_basic_type(this, $src1); + switch (src1_elem_bt) { + case T_INT: { + __ evpcmpd($ktmp$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); + __ evmovdqul($dst$$XMMRegister, $ktmp$$KRegister, ExternalAddress(vector_all_bits_set()), merge, vlen_enc, $scratch$$Register); + break; + } + case T_LONG: { + __ evpcmpq($ktmp$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); + __ evmovdquq($dst$$XMMRegister, $ktmp$$KRegister, ExternalAddress(vector_all_bits_set()), merge, vlen_enc, $scratch$$Register); + break; + } + default: assert(false, "%s", type2name(src1_elem_bt)); + } + %} + ins_pipe( pipe_slow ); +%} + + +instruct evcmp(kReg dst, vec src1, vec src2, immI8 cond) %{ + predicate(n->bottom_type()->isa_vectmask() && + is_integral_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 + match(Set dst (VectorMaskCmp (Binary src1 src2) cond)); + format %{ "vector_compared_evex $dst,$src1,$src2,$cond\t!" %} + ins_encode %{ + assert(UseAVX > 2, "required"); + assert(bottom_type()->isa_vectmask(), "TypeVectMask expected"); + + int vlen_enc = vector_length_encoding(this, $src1); + Assembler::ComparisonPredicate cmp = booltest_pred_to_comparison_pred($cond$$constant); + bool is_unsigned = is_unsigned_booltest_pred($cond$$constant); + BasicType src1_elem_bt = Matcher::vector_element_basic_type(this, $src1); + + // Comparison i switch (src1_elem_bt) { case T_BYTE: { - __ evpcmpb($ktmp$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); - __ evmovdqub($dst$$XMMRegister, $ktmp$$KRegister, ExternalAddress(vector_all_bits_set()), merge, vlen_enc, $scratch$$Register); + __ evpcmpb($dst$$KRegister, k0, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); break; } case T_SHORT: { - __ evpcmpw($ktmp$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); - __ evmovdquw($dst$$XMMRegister, $ktmp$$KRegister, ExternalAddress(vector_all_bits_set()), merge, vlen_enc, $scratch$$Register); + __ evpcmpw($dst$$KRegister, k0, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); break; } case T_INT: { - __ evpcmpd($ktmp$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); - __ evmovdqul($dst$$XMMRegister, $ktmp$$KRegister, ExternalAddress(vector_all_bits_set()), merge, vlen_enc, $scratch$$Register); + __ evpcmpd($dst$$KRegister, k0, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); break; } case T_LONG: { - __ evpcmpq($ktmp$$KRegister, mask, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); - __ evmovdquq($dst$$XMMRegister, $ktmp$$KRegister, ExternalAddress(vector_all_bits_set()), merge, vlen_enc, $scratch$$Register); + __ evpcmpq($dst$$KRegister, k0, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); break; } default: assert(false, "%s", type2name(src1_elem_bt)); @@ -7186,6 +7510,7 @@ instruct blendvp(vec dst, vec src, vec mask, rxmm0 tmp) %{ instruct vblendvpI(legVec dst, legVec src1, legVec src2, legVec mask) %{ predicate(UseAVX > 0 && + n->in(2)->bottom_type()->isa_vectmask() == NULL && Matcher::vector_length_in_bytes(n) <= 32 && is_integral_type(Matcher::vector_element_basic_type(n))); match(Set dst (VectorBlend (Binary src1 src2) mask)); @@ -7199,6 +7524,7 @@ instruct vblendvpI(legVec dst, legVec src1, legVec src2, legVec mask) %{ instruct vblendvpFD(legVec dst, legVec src1, legVec src2, legVec mask) %{ predicate(UseAVX > 0 && + n->in(2)->bottom_type()->isa_vectmask() == NULL && Matcher::vector_length_in_bytes(n) <= 32 && !is_integral_type(Matcher::vector_element_basic_type(n))); match(Set dst (VectorBlend (Binary src1 src2) mask)); @@ -7211,7 +7537,8 @@ instruct vblendvpFD(legVec dst, legVec src1, legVec src2, legVec mask) %{ %} instruct evblendvp64(vec dst, vec src1, vec src2, vec mask, rRegP scratch, kReg ktmp) %{ - predicate(Matcher::vector_length_in_bytes(n) == 64); + predicate(Matcher::vector_length_in_bytes(n) == 64 && + n->in(2)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorBlend (Binary src1 src2) mask)); format %{ "vector_blend $dst,$src1,$src2,$mask\t! using $scratch and k2 as TEMP" %} effect(TEMP scratch, TEMP ktmp); @@ -7224,10 +7551,27 @@ instruct evblendvp64(vec dst, vec src1, vec src2, vec mask, rRegP scratch, kReg ins_pipe( pipe_slow ); %} + +instruct evblendvp64_masked(vec dst, vec src1, vec src2, kReg mask, rRegP scratch) %{ + predicate(n->in(2)->bottom_type()->isa_vectmask() && + (!is_subword_type(Matcher::vector_element_basic_type(n)) || + VM_Version::supports_avx512bw())); + match(Set dst (VectorBlend (Binary src1 src2) mask)); + format %{ "vector_blend $dst,$src1,$src2,$mask\t! using $scratch and k2 as TEMP" %} + effect(TEMP scratch); + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType elem_bt = Matcher::vector_element_basic_type(this); + __ evpblend(elem_bt, $dst$$XMMRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + // --------------------------------- ABS -------------------------------------- // a = |a| instruct vabsB_reg(vec dst, vec src) %{ match(Set dst (AbsVB src)); + ins_cost(450); format %{ "vabsb $dst,$src\t# $dst = |$src| abs packedB" %} ins_encode %{ uint vlen = Matcher::vector_length(this); @@ -7243,6 +7587,7 @@ instruct vabsB_reg(vec dst, vec src) %{ instruct vabsS_reg(vec dst, vec src) %{ match(Set dst (AbsVS src)); + ins_cost(450); format %{ "vabsw $dst,$src\t# $dst = |$src| abs packedS" %} ins_encode %{ uint vlen = Matcher::vector_length(this); @@ -7259,6 +7604,7 @@ instruct vabsS_reg(vec dst, vec src) %{ instruct vabsI_reg(vec dst, vec src) %{ match(Set dst (AbsVI src)); format %{ "pabsd $dst,$src\t# $dst = |$src| abs packedI" %} + ins_cost(250); ins_encode %{ uint vlen = Matcher::vector_length(this); if (vlen <= 4) { @@ -7273,6 +7619,7 @@ instruct vabsI_reg(vec dst, vec src) %{ instruct vabsL_reg(vec dst, vec src) %{ match(Set dst (AbsVL src)); + ins_cost(450); format %{ "evpabsq $dst,$src\t# $dst = |$src| abs packedL" %} ins_encode %{ assert(UseAVX > 2, "required"); @@ -7345,12 +7692,13 @@ instruct vabsnegD(vec dst, vec src, rRegI scratch) %{ #ifdef _LP64 instruct vptest_alltrue_lt16(rRegI dst, legVec src1, legVec src2, legVec vtmp1, legVec vtmp2, rFlagsReg cr) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) >= 4 && + predicate(!VM_Version::supports_avx512bwdq() && + Matcher::vector_length_in_bytes(n->in(1)) >= 4 && Matcher::vector_length_in_bytes(n->in(1)) < 16 && static_cast(n)->get_predicate() == BoolTest::overflow); match(Set dst (VectorTest src1 src2 )); effect(TEMP vtmp1, TEMP vtmp2, KILL cr); - format %{ "vector_test $dst,$src1, $src2\t! using $vtmp1, $vtmp2 and $cr as TEMP" %} + format %{ "vptest_alltrue_lt16 $dst,$src1, $src2\t! using $vtmp1, $vtmp2 and $cr as TEMP" %} ins_encode %{ int vlen = Matcher::vector_length_in_bytes(this, $src1); __ vectortest(BoolTest::overflow, vlen, $src1$$XMMRegister, $src2$$XMMRegister, $vtmp1$$XMMRegister, $vtmp2$$XMMRegister); @@ -7360,13 +7708,14 @@ instruct vptest_alltrue_lt16(rRegI dst, legVec src1, legVec src2, legVec vtmp1, ins_pipe( pipe_slow ); %} -instruct vptest_alltrue(rRegI dst, legVec src1, legVec src2, rFlagsReg cr) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) >= 16 && +instruct vptest_alltrue_ge16(rRegI dst, legVec src1, legVec src2, rFlagsReg cr) %{ + predicate(!VM_Version::supports_avx512bwdq() && + Matcher::vector_length_in_bytes(n->in(1)) >= 16 && Matcher::vector_length_in_bytes(n->in(1)) < 64 && static_cast(n)->get_predicate() == BoolTest::overflow); match(Set dst (VectorTest src1 src2 )); effect(KILL cr); - format %{ "vector_test $dst,$src1, $src2\t! using $cr as TEMP" %} + format %{ "vptest_alltrue_ge16 $dst,$src1, $src2\t! using $cr as TEMP" %} ins_encode %{ int vlen = Matcher::vector_length_in_bytes(this, $src1); __ vectortest(BoolTest::overflow, vlen, $src1$$XMMRegister, $src2$$XMMRegister, xnoreg, xnoreg, knoreg); @@ -7376,28 +7725,52 @@ instruct vptest_alltrue(rRegI dst, legVec src1, legVec src2, rFlagsReg cr) %{ ins_pipe( pipe_slow ); %} -instruct vptest_alltrue_evex(rRegI dst, legVec src1, legVec src2, kReg ktmp, rFlagsReg cr) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) == 64 && - static_cast(n)->get_predicate() == BoolTest::overflow); - match(Set dst (VectorTest src1 src2 )); - effect(KILL cr, TEMP ktmp); - format %{ "vector_test $dst,$src1, $src2\t! using $cr as TEMP" %} +instruct vptest_alltrue_lt8_evex(rRegI dst, kReg src1, kReg src2, kReg kscratch, rFlagsReg cr) %{ + predicate(VM_Version::supports_avx512bwdq() && + static_cast(n)->get_predicate() == BoolTest::overflow && + n->in(1)->bottom_type()->isa_vectmask() && + Matcher::vector_length(n->in(1)) < 8); + match(Set dst (VectorTest src1 src2)); + effect(KILL cr, TEMP kscratch); + format %{ "vptest_alltrue_lt8_evex $dst,$src1,$src2\t! using $cr as TEMP" %} ins_encode %{ - int vlen = Matcher::vector_length_in_bytes(this, $src1); - __ vectortest(BoolTest::overflow, vlen, $src1$$XMMRegister, $src2$$XMMRegister, xnoreg, xnoreg, $ktmp$$KRegister); - __ setb(Assembler::carrySet, $dst$$Register); - __ movzbl($dst$$Register, $dst$$Register); + const MachNode* mask1 = static_cast(this->in(this->operand_index($src1))); + const MachNode* mask2 = static_cast(this->in(this->operand_index($src2))); + assert(0 == Type::cmp(mask1->bottom_type(), mask2->bottom_type()), ""); + uint masklen = Matcher::vector_length(this, $src1); + __ alltrue($dst$$Register, masklen, $src1$$KRegister, $src2$$KRegister, $kscratch$$KRegister); + %} + ins_pipe( pipe_slow ); +%} + + +instruct vptest_alltrue_ge8_evex(rRegI dst, kReg src1, kReg src2, rFlagsReg cr) %{ + predicate(VM_Version::supports_avx512bwdq() && + static_cast(n)->get_predicate() == BoolTest::overflow && + n->in(1)->bottom_type()->isa_vectmask() && + Matcher::vector_length(n->in(1)) >= 8); + match(Set dst (VectorTest src1 src2)); + effect(KILL cr); + format %{ "vptest_alltrue_ge8_evex $dst,$src1,$src2\t! using $cr as TEMP" %} + ins_encode %{ + const MachNode* mask1 = static_cast(this->in(this->operand_index($src1))); + const MachNode* mask2 = static_cast(this->in(this->operand_index($src2))); + assert(0 == Type::cmp(mask1->bottom_type(), mask2->bottom_type()), ""); + uint masklen = Matcher::vector_length(this, $src1); + __ alltrue($dst$$Register, masklen, $src1$$KRegister, $src2$$KRegister, knoreg); %} ins_pipe( pipe_slow ); %} + instruct vptest_anytrue_lt16(rRegI dst, legVec src1, legVec src2, legVec vtmp, rFlagsReg cr) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) >= 4 && + predicate(!VM_Version::supports_avx512bwdq() && + Matcher::vector_length_in_bytes(n->in(1)) >= 4 && Matcher::vector_length_in_bytes(n->in(1)) < 16 && static_cast(n)->get_predicate() == BoolTest::ne); match(Set dst (VectorTest src1 src2 )); effect(TEMP vtmp, KILL cr); - format %{ "vector_test_any_true $dst,$src1,$src2\t! using $vtmp, $cr as TEMP" %} + format %{ "vptest_anytrue_lt16 $dst,$src1,$src2\t! using $vtmp, $cr as TEMP" %} ins_encode %{ int vlen = Matcher::vector_length_in_bytes(this, $src1); __ vectortest(BoolTest::ne, vlen, $src1$$XMMRegister, $src2$$XMMRegister, $vtmp$$XMMRegister); @@ -7407,13 +7780,14 @@ instruct vptest_anytrue_lt16(rRegI dst, legVec src1, legVec src2, legVec vtmp, r ins_pipe( pipe_slow ); %} -instruct vptest_anytrue(rRegI dst, legVec src1, legVec src2, rFlagsReg cr) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) >= 16 && +instruct vptest_anytrue_ge16(rRegI dst, legVec src1, legVec src2, rFlagsReg cr) %{ + predicate(!VM_Version::supports_avx512bwdq() && + Matcher::vector_length_in_bytes(n->in(1)) >= 16 && Matcher::vector_length_in_bytes(n->in(1)) < 64 && static_cast(n)->get_predicate() == BoolTest::ne); match(Set dst (VectorTest src1 src2 )); effect(KILL cr); - format %{ "vector_test_any_true $dst,$src1,$src2\t! using $cr as TEMP" %} + format %{ "vptest_anytrue_ge16 $dst,$src1,$src2\t! using $cr as TEMP" %} ins_encode %{ int vlen = Matcher::vector_length_in_bytes(this, $src1); __ vectortest(BoolTest::ne, vlen, $src1$$XMMRegister, $src2$$XMMRegister, xnoreg, xnoreg, knoreg); @@ -7423,28 +7797,30 @@ instruct vptest_anytrue(rRegI dst, legVec src1, legVec src2, rFlagsReg cr) %{ ins_pipe( pipe_slow ); %} -instruct vptest_anytrue_evex(rRegI dst, legVec src1, legVec src2, kReg ktmp, rFlagsReg cr) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)) == 64 && +instruct vptest_anytrue_evex(rRegI dst, kReg src1, kReg src2, rFlagsReg cr) %{ + predicate(VM_Version::supports_avx512bwdq() && static_cast(n)->get_predicate() == BoolTest::ne); - match(Set dst (VectorTest src1 src2 )); - effect(KILL cr, TEMP ktmp); - format %{ "vector_test_any_true $dst,$src1,$src2\t! using $cr as TEMP" %} + match(Set dst (VectorTest src1 src2)); + effect(KILL cr); + format %{ "vptest_anytrue_lt8_evex $dst,$src1,$src2\t! using $cr as TEMP" %} ins_encode %{ - int vlen = Matcher::vector_length_in_bytes(this, $src1); - __ vectortest(BoolTest::ne, vlen, $src1$$XMMRegister, $src2$$XMMRegister, xnoreg, xnoreg, $ktmp$$KRegister); - __ setb(Assembler::notZero, $dst$$Register); - __ movzbl($dst$$Register, $dst$$Register); + const MachNode* mask1 = static_cast(this->in(this->operand_index($src1))); + const MachNode* mask2 = static_cast(this->in(this->operand_index($src2))); + assert(0 == Type::cmp(mask1->bottom_type(), mask2->bottom_type()), ""); + uint masklen = Matcher::vector_length(this, $src1); + __ anytrue($dst$$Register, masklen, $src1$$KRegister, $src2$$KRegister); %} ins_pipe( pipe_slow ); %} instruct cmpvptest_anytrue_lt16(rFlagsReg cr, legVec src1, legVec src2, immI_0 zero, legVec vtmp) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 4 && + predicate(!VM_Version::supports_avx512bwdq() && + Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 4 && Matcher::vector_length_in_bytes(n->in(1)->in(1)) < 16 && static_cast(n->in(1))->get_predicate() == BoolTest::ne); match(Set cr (CmpI (VectorTest src1 src2) zero)); effect(TEMP vtmp); - format %{ "cmp_vector_test_any_true $src1,$src2\t! using $vtmp as TEMP" %} + format %{ "cmpvptest_anytrue_lt16 $src1,$src2\t! using $vtmp as TEMP" %} ins_encode %{ int vlen = Matcher::vector_length_in_bytes(this, $src1); __ vectortest(BoolTest::ne, vlen, $src1$$XMMRegister, $src2$$XMMRegister, $vtmp$$XMMRegister); @@ -7452,12 +7828,13 @@ instruct cmpvptest_anytrue_lt16(rFlagsReg cr, legVec src1, legVec src2, immI_0 z ins_pipe( pipe_slow ); %} -instruct cmpvptest_anytrue(rFlagsReg cr, legVec src1, legVec src2, immI_0 zero) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 16 && +instruct cmpvptest_anytrue_ge16(rFlagsReg cr, legVec src1, legVec src2, immI_0 zero) %{ + predicate(!VM_Version::supports_avx512bwdq() && + Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 16 && Matcher::vector_length_in_bytes(n->in(1)->in(1)) < 64 && static_cast(n->in(1))->get_predicate() == BoolTest::ne); match(Set cr (CmpI (VectorTest src1 src2) zero)); - format %{ "cmp_vector_test_any_true $src1,$src2\t!" %} + format %{ "cmpvptest_anytrue_ge16 $src1,$src2\t!" %} ins_encode %{ int vlen = Matcher::vector_length_in_bytes(this, $src1); __ vectortest(BoolTest::ne, vlen, $src1$$XMMRegister, $src2$$XMMRegister, xnoreg, xnoreg, knoreg); @@ -7465,15 +7842,18 @@ instruct cmpvptest_anytrue(rFlagsReg cr, legVec src1, legVec src2, immI_0 zero) ins_pipe( pipe_slow ); %} -instruct cmpvptest_anytrue_evex(rFlagsReg cr, legVec src1, legVec src2, immI_0 zero, kReg ktmp) %{ - predicate(Matcher::vector_length_in_bytes(n->in(1)->in(1)) == 64 && +instruct cmpvptest_anytrue_evex(rFlagsReg cr, kReg src1, kReg src2, immI_0 zero) %{ + predicate(VM_Version::supports_avx512bwdq() && static_cast(n->in(1))->get_predicate() == BoolTest::ne); match(Set cr (CmpI (VectorTest src1 src2) zero)); - effect(TEMP ktmp); - format %{ "cmp_vector_test_any_true $src1,$src2\t!" %} + format %{ "cmpvptest_anytrue_evex $src1,$src2\t!" %} ins_encode %{ - int vlen = Matcher::vector_length_in_bytes(this, $src1); - __ vectortest(BoolTest::ne, vlen, $src1$$XMMRegister, $src2$$XMMRegister, xnoreg, xnoreg, $ktmp$$KRegister); + uint masklen = Matcher::vector_length(this, $src1); + const MachNode* mask1 = static_cast(this->in(this->operand_index($src1))); + const MachNode* mask2 = static_cast(this->in(this->operand_index($src2))); + assert(0 == Type::cmp(mask1->bottom_type(), mask2->bottom_type()), ""); + masklen = masklen < 8 ? 8 : masklen; + __ ktest(masklen, $src1$$KRegister, $src2$$KRegister); %} ins_pipe( pipe_slow ); %} @@ -7482,45 +7862,56 @@ instruct cmpvptest_anytrue_evex(rFlagsReg cr, legVec src1, legVec src2, immI_0 z //------------------------------------- LoadMask -------------------------------------------- instruct loadMask(legVec dst, legVec src) %{ - predicate(!VM_Version::supports_avx512vlbw()); + predicate(n->bottom_type()->isa_vectmask() == NULL && !VM_Version::supports_avx512vlbw()); match(Set dst (VectorLoadMask src)); effect(TEMP dst); - format %{ "vector_loadmask_byte $dst,$src\n\t" %} + format %{ "vector_loadmask_byte $dst, $src\n\t" %} ins_encode %{ int vlen_in_bytes = Matcher::vector_length_in_bytes(this); BasicType elem_bt = Matcher::vector_element_basic_type(this); - __ load_vector_mask($dst$$XMMRegister, $src$$XMMRegister, vlen_in_bytes, elem_bt, true); %} ins_pipe( pipe_slow ); %} -instruct loadMask_evex(vec dst, vec src) %{ - predicate(VM_Version::supports_avx512vlbw()); +instruct loadMask64(kReg dst, vec src, vec xtmp, rRegI tmp) %{ + predicate(n->bottom_type()->isa_vectmask() && !VM_Version::supports_avx512vlbw()); match(Set dst (VectorLoadMask src)); - effect(TEMP dst); - format %{ "vector_loadmask_byte $dst,$src\n\t" %} + effect(TEMP xtmp, TEMP tmp); + format %{ "vector_loadmask_64byte $dst, $src\t! using $xtmp and $tmp as TEMP" %} ins_encode %{ - int vlen_in_bytes = Matcher::vector_length_in_bytes(this); - BasicType elem_bt = Matcher::vector_element_basic_type(this); + __ load_vector_mask($dst$$KRegister, $src$$XMMRegister, $xtmp$$XMMRegister, + $tmp$$Register, true, Assembler::AVX_512bit); + %} + ins_pipe( pipe_slow ); +%} - __ load_vector_mask($dst$$XMMRegister, $src$$XMMRegister, vlen_in_bytes, elem_bt, false); +instruct loadMask_evex(kReg dst, vec src, vec xtmp) %{ + predicate(n->bottom_type()->isa_vectmask() && VM_Version::supports_avx512vlbw()); + match(Set dst (VectorLoadMask src)); + effect(TEMP xtmp); + format %{ "vector_loadmask_byte $dst, $src\t! using $xtmp as TEMP" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(in(1)); + __ load_vector_mask($dst$$KRegister, $src$$XMMRegister, $xtmp$$XMMRegister, + noreg, false, vlen_enc); %} ins_pipe( pipe_slow ); %} //------------------------------------- StoreMask -------------------------------------------- -instruct storeMask1B(vec dst, vec src, immI_1 size) %{ - predicate(Matcher::vector_length(n) < 64 || VM_Version::supports_avx512vlbw()); +instruct vstoreMask1B(vec dst, vec src, immI_1 size) %{ + predicate(Matcher::vector_length(n) < 64 && n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %} ins_encode %{ - assert(UseSSE >= 3, "required"); - if (Matcher::vector_length_in_bytes(this) <= 16) { + int vlen = Matcher::vector_length(this); + if (vlen <= 16 && UseAVX <= 2) { + assert(UseSSE >= 3, "required"); __ pabsb($dst$$XMMRegister, $src$$XMMRegister); } else { - assert(UseAVX >= 2, "required"); + assert(UseAVX > 0, "required"); int src_vlen_enc = vector_length_encoding(this, $src); __ vpabsb($dst$$XMMRegister, $src$$XMMRegister, src_vlen_enc); } @@ -7528,77 +7919,93 @@ instruct storeMask1B(vec dst, vec src, immI_1 size) %{ ins_pipe( pipe_slow ); %} -instruct storeMask2B(vec dst, vec src, immI_2 size) %{ - predicate(Matcher::vector_length(n) <= 8); +instruct vstoreMask2B(vec dst, vec src, vec xtmp, immI_2 size) %{ + predicate(Matcher::vector_length(n) <= 16 && n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\n\t" %} - ins_encode %{ - assert(UseSSE >= 3, "required"); - __ pabsw($dst$$XMMRegister, $src$$XMMRegister); - __ packsswb($dst$$XMMRegister, $dst$$XMMRegister); - %} - ins_pipe( pipe_slow ); -%} - -instruct vstoreMask2B(vec dst, vec src, immI_2 size) %{ - predicate(Matcher::vector_length(n) == 16 && !VM_Version::supports_avx512bw()); - match(Set dst (VectorStoreMask src size)); - effect(TEMP dst); - format %{ "vector_store_mask $dst,$src\t!" %} + effect(TEMP_DEF dst, TEMP xtmp); + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %} ins_encode %{ int vlen_enc = Assembler::AVX_128bit; - __ vextracti128($dst$$XMMRegister, $src$$XMMRegister, 0x1); - __ vpacksswb($dst$$XMMRegister, $src$$XMMRegister, $dst$$XMMRegister,vlen_enc); - __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); + int vlen = Matcher::vector_length(this); + if (vlen <= 8) { + assert(UseSSE >= 3, "required"); + __ pxor($xtmp$$XMMRegister, $xtmp$$XMMRegister); + __ pabsw($dst$$XMMRegister, $src$$XMMRegister); + __ packuswb($dst$$XMMRegister, $xtmp$$XMMRegister); + } else { + assert(UseAVX > 0, "required"); + __ vextracti128($dst$$XMMRegister, $src$$XMMRegister, 0x1); + __ vpacksswb($dst$$XMMRegister, $src$$XMMRegister, $dst$$XMMRegister, vlen_enc); + __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); + } %} ins_pipe( pipe_slow ); %} -instruct vstoreMask2B_evex(vec dst, vec src, immI_2 size) %{ - predicate(VM_Version::supports_avx512bw()); +instruct vstoreMask4B(vec dst, vec src, vec xtmp, immI_4 size) %{ + predicate(UseAVX <= 2 && Matcher::vector_length(n) <= 8 && n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %} + effect(TEMP_DEF dst, TEMP xtmp); ins_encode %{ - int src_vlen_enc = vector_length_encoding(this, $src); - int dst_vlen_enc = vector_length_encoding(this); - __ evpmovwb($dst$$XMMRegister, $src$$XMMRegister, src_vlen_enc); - __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, dst_vlen_enc); + int vlen_enc = Assembler::AVX_128bit; + int vlen = Matcher::vector_length(this); + if (vlen <= 4) { + assert(UseSSE >= 3, "required"); + __ pxor($xtmp$$XMMRegister, $xtmp$$XMMRegister); + __ pabsd($dst$$XMMRegister, $src$$XMMRegister); + __ packusdw($dst$$XMMRegister, $xtmp$$XMMRegister); + __ packuswb($dst$$XMMRegister, $xtmp$$XMMRegister); + } else { + assert(UseAVX > 0, "required"); + __ vpxor($xtmp$$XMMRegister, $xtmp$$XMMRegister, $xtmp$$XMMRegister, vlen_enc); + __ vextracti128($dst$$XMMRegister, $src$$XMMRegister, 0x1); + __ vpackssdw($dst$$XMMRegister, $src$$XMMRegister, $dst$$XMMRegister, vlen_enc); + __ vpacksswb($dst$$XMMRegister, $dst$$XMMRegister, $xtmp$$XMMRegister, vlen_enc); + __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); + } %} ins_pipe( pipe_slow ); %} -instruct storeMask4B(vec dst, vec src, immI_4 size) %{ - predicate(Matcher::vector_length(n) <= 4 && UseAVX <= 2); +instruct storeMask8B(vec dst, vec src, vec xtmp, immI_8 size) %{ + predicate(UseAVX <= 2 && Matcher::vector_length(n) == 2); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} + effect(TEMP_DEF dst, TEMP xtmp); + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %} ins_encode %{ assert(UseSSE >= 3, "required"); - __ pabsd($dst$$XMMRegister, $src$$XMMRegister); - __ packssdw($dst$$XMMRegister, $dst$$XMMRegister); - __ packsswb($dst$$XMMRegister, $dst$$XMMRegister); + __ pxor($xtmp$$XMMRegister, $xtmp$$XMMRegister); + __ pshufd($dst$$XMMRegister, $src$$XMMRegister, 0x8); + __ pabsd($dst$$XMMRegister, $dst$$XMMRegister); + __ packusdw($dst$$XMMRegister, $xtmp$$XMMRegister); + __ packuswb($dst$$XMMRegister, $xtmp$$XMMRegister); %} ins_pipe( pipe_slow ); %} -instruct vstoreMask4B(vec dst, vec src, immI_4 size) %{ - predicate(Matcher::vector_length(n) == 8 && UseAVX <= 2); +instruct storeMask8B_avx(vec dst, vec src, immI_8 size, vec vtmp) %{ + predicate(UseAVX <= 2 && Matcher::vector_length(n) == 4); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} - effect(TEMP dst); + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s], using $vtmp as TEMP" %} + effect(TEMP_DEF dst, TEMP vtmp); ins_encode %{ int vlen_enc = Assembler::AVX_128bit; - __ vextracti128($dst$$XMMRegister, $src$$XMMRegister, 0x1); - __ vpackssdw($dst$$XMMRegister, $src$$XMMRegister, $dst$$XMMRegister, vlen_enc); - __ vpacksswb($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); + __ vpshufps($dst$$XMMRegister, $src$$XMMRegister, $src$$XMMRegister, 0x88, Assembler::AVX_256bit); + __ vextracti128($vtmp$$XMMRegister, $dst$$XMMRegister, 0x1); + __ vblendps($dst$$XMMRegister, $dst$$XMMRegister, $vtmp$$XMMRegister, 0xC, vlen_enc); + __ vpxor($vtmp$$XMMRegister, $vtmp$$XMMRegister, $vtmp$$XMMRegister, vlen_enc); + __ vpackssdw($dst$$XMMRegister, $dst$$XMMRegister, $vtmp$$XMMRegister, vlen_enc); + __ vpacksswb($dst$$XMMRegister, $dst$$XMMRegister, $vtmp$$XMMRegister, vlen_enc); __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); %} ins_pipe( pipe_slow ); %} -instruct vstoreMask4B_evex(vec dst, vec src, immI_4 size) %{ - predicate(UseAVX > 2); +instruct vstoreMask4B_evex_novectmask(vec dst, vec src, immI_4 size) %{ + predicate(UseAVX > 2 && n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %} ins_encode %{ int src_vlen_enc = vector_length_encoding(this, $src); int dst_vlen_enc = vector_length_encoding(this); @@ -7611,53 +8018,60 @@ instruct vstoreMask4B_evex(vec dst, vec src, immI_4 size) %{ ins_pipe( pipe_slow ); %} -instruct storeMask8B(vec dst, vec src, immI_8 size) %{ - predicate(Matcher::vector_length(n) == 2 && UseAVX <= 2); +instruct vstoreMask8B_evex_novectmask(vec dst, vec src, immI_8 size) %{ + predicate(UseAVX > 2 && n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} + format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %} ins_encode %{ - assert(UseSSE >= 3, "required"); - __ pshufd($dst$$XMMRegister, $src$$XMMRegister, 0x8); - __ packssdw($dst$$XMMRegister, $dst$$XMMRegister); - __ packsswb($dst$$XMMRegister, $dst$$XMMRegister); - __ pabsb($dst$$XMMRegister, $dst$$XMMRegister); - %} + int src_vlen_enc = vector_length_encoding(this, $src); + int dst_vlen_enc = vector_length_encoding(this); + if (!VM_Version::supports_avx512vl()) { + src_vlen_enc = Assembler::AVX_512bit; + } + __ evpmovqb($dst$$XMMRegister, $src$$XMMRegister, src_vlen_enc); + __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, dst_vlen_enc); + %} ins_pipe( pipe_slow ); %} -instruct storeMask8B_avx(vec dst, vec src, immI_8 size, legVec vtmp) %{ - predicate(Matcher::vector_length(n) == 4 && UseAVX <= 2); - match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t! using $vtmp as TEMP" %} - effect(TEMP dst, TEMP vtmp); +instruct vstoreMask_evex_vectmask(vec dst, kReg mask, immI size, rRegI tmp) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask() && !VM_Version::supports_avx512vlbw()); + match(Set dst (VectorStoreMask mask size)); + effect(TEMP_DEF dst, TEMP tmp); + format %{ "vector_store_mask $dst, $mask \t! elem size is $size byte[s]" %} ins_encode %{ - int vlen_enc = Assembler::AVX_128bit; - __ vpshufps($dst$$XMMRegister, $src$$XMMRegister, $src$$XMMRegister, 0x88, Assembler::AVX_256bit); - __ vextracti128($vtmp$$XMMRegister, $dst$$XMMRegister, 0x1); - __ vblendps($dst$$XMMRegister, $dst$$XMMRegister, $vtmp$$XMMRegister, 0xC, vlen_enc); - __ vpackssdw($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); - __ vpacksswb($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); - __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc); + assert(Matcher::vector_length_in_bytes(this, $mask) == 64, ""); + __ evmovdqul($dst$$XMMRegister, $mask$$KRegister, ExternalAddress(vector_int_mask_cmp_bits()), + false, Assembler::AVX_512bit, $tmp$$Register); + __ evpmovdb($dst$$XMMRegister, $dst$$XMMRegister, Assembler::AVX_512bit); %} ins_pipe( pipe_slow ); %} -instruct vstoreMask8B_evex(vec dst, vec src, immI_8 size) %{ - predicate(UseAVX > 2); - match(Set dst (VectorStoreMask src size)); - format %{ "vector_store_mask $dst,$src\t!" %} +instruct vstoreMask_evex(vec dst, kReg mask, immI size) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask() && VM_Version::supports_avx512vlbw()); + match(Set dst (VectorStoreMask mask size)); + effect(TEMP_DEF dst); + format %{ "vector_store_mask $dst, $mask \t! elem size is $size byte[s]" %} ins_encode %{ - int src_vlen_enc = vector_length_encoding(this, $src); int dst_vlen_enc = vector_length_encoding(this); - if (!VM_Version::supports_avx512vl()) { - src_vlen_enc = Assembler::AVX_512bit; - } - __ evpmovqb($dst$$XMMRegister, $src$$XMMRegister, src_vlen_enc); + __ evpmovm2b($dst$$XMMRegister, $mask$$KRegister, dst_vlen_enc); __ vpabsb($dst$$XMMRegister, $dst$$XMMRegister, dst_vlen_enc); %} ins_pipe( pipe_slow ); %} +instruct vmaskcast_evex(kReg dst) %{ + predicate(Matcher::vector_length(n) == Matcher::vector_length(n->in(1))); + match(Set dst (VectorMaskCast dst)); + ins_cost(0); + format %{ "vector_mask_cast $dst" %} + ins_encode %{ + // empty + %} + ins_pipe(empty); +%} + instruct vmaskcast(vec dst) %{ predicate((Matcher::vector_length(n) == Matcher::vector_length(n->in(1))) && (Matcher::vector_length_in_bytes(n) == Matcher::vector_length_in_bytes(n->in(1)))); @@ -8227,69 +8641,793 @@ instruct vmasked_store64(memory mem, vec src, kReg mask) %{ ins_pipe( pipe_slow ); %} -instruct vmask_truecount_evex(rRegI dst, vec mask, rRegL tmp, kReg ktmp, vec xtmp) %{ - predicate(VM_Version::supports_avx512vlbw()); +instruct vmask_tolong_evex(rRegL dst, kReg mask, rFlagsReg cr) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask()); + match(Set dst (VectorMaskToLong mask)); + effect(TEMP dst, KILL cr); + format %{ "vector_tolong_evex $dst, $mask \t! vector mask tolong" %} + ins_encode %{ + int mask_len = Matcher::vector_length(this, $mask); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); + if (VM_Version::supports_avx512vlbw()) { + __ kmovql($dst$$Register, $mask$$KRegister); + } else { + assert(mask_len <= 16, ""); + __ kmovwl($dst$$Register, $mask$$KRegister); + } + // Mask generated out of partial vector comparisons/replicate/mask manipulation + // operations needs to be clipped. + int mask_size = mask_len * type2aelembytes(mbt); + if (mask_size < 16) { + __ andq($dst$$Register, (((jlong)1 << mask_len) - 1)); + } + %} + ins_pipe( pipe_slow ); +%} + +instruct vmask_tolong_avx(rRegL dst, vec mask, vec xtmp, rFlagsReg cr) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL && + n->in(1)->bottom_type()->is_vect()->element_basic_type() == T_BOOLEAN); + match(Set dst (VectorMaskToLong mask)); + format %{ "vector_tolong_avx $dst, $mask \t! using $xtmp as TEMP" %} + effect(TEMP_DEF dst, TEMP xtmp, KILL cr); + ins_encode %{ + int mask_len = Matcher::vector_length(this, $mask); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); + int vlen_enc = vector_length_encoding(this, $mask); + __ vpxor($xtmp$$XMMRegister, $xtmp$$XMMRegister, $xtmp$$XMMRegister, vlen_enc); + __ vpsubb($xtmp$$XMMRegister, $xtmp$$XMMRegister, $mask$$XMMRegister, vlen_enc); + __ vpmovmskb($dst$$Register, $xtmp$$XMMRegister, vlen_enc); + // Mask generated out of partial vector comparisons/replicate/mask manipulation + // operations needs to be clipped. + int mask_size = mask_len * type2aelembytes(mbt); + if (mask_size < 16) { + __ andq($dst$$Register, (((jlong)1 << mask_len) - 1)); + } + %} + ins_pipe( pipe_slow ); +%} + +instruct vmask_truecount_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsReg cr) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask()); match(Set dst (VectorMaskTrueCount mask)); - effect(TEMP_DEF dst, TEMP tmp, TEMP ktmp, TEMP xtmp); - format %{ "vector_truecount_evex $mask \t! vector mask true count" %} + effect(TEMP_DEF dst, TEMP tmp, KILL cr); + format %{ "vector_truecount_evex $dst, $mask \t! using $tmp as TEMP" %} ins_encode %{ int opcode = this->ideal_Opcode(); - int vlen_enc = vector_length_encoding(this, $mask); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); - __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, - $tmp$$Register, $ktmp$$KRegister, mask_len, vlen_enc); + int mask_size = mask_len * type2aelembytes(mbt); + int vlen_enc = vector_length_encoding(this, $mask); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, $tmp$$Register, + mask_len, mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} -instruct vmask_first_or_last_true_evex(rRegI dst, vec mask, rRegL tmp, kReg ktmp, vec xtmp, rFlagsReg cr) %{ - predicate(VM_Version::supports_avx512vlbw()); - match(Set dst (VectorMaskFirstTrue mask)); - match(Set dst (VectorMaskLastTrue mask)); - effect(TEMP_DEF dst, TEMP tmp, TEMP ktmp, TEMP xtmp, KILL cr); - format %{ "vector_mask_first_or_last_true_evex $mask \t! vector first/last true location" %} +instruct vmask_truecount_avx(rRegI dst, vec mask, rRegL tmp, vec xtmp, vec xtmp1, rFlagsReg cr) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL); + match(Set dst (VectorMaskTrueCount mask)); + effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, TEMP xtmp1, KILL cr); + format %{ "vector_truecount_avx $dst, $mask \t! using $tmp, $xtmp and $xtmp1 as TEMP" %} ins_encode %{ int opcode = this->ideal_Opcode(); - int vlen_enc = vector_length_encoding(this, $mask); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); + int mask_size = mask_len * type2aelembytes(mbt); + int vlen_enc = vector_length_encoding(this, $mask); __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, - $tmp$$Register, $ktmp$$KRegister, mask_len, vlen_enc); + $xtmp1$$XMMRegister, $tmp$$Register, mask_len, mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} -instruct vmask_truecount_avx(rRegI dst, vec mask, rRegL tmp, vec xtmp, vec xtmp1) %{ - predicate(!VM_Version::supports_avx512vlbw()); - match(Set dst (VectorMaskTrueCount mask)); - effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, TEMP xtmp1); - format %{ "vector_truecount_avx $mask \t! vector mask true count" %} +instruct vmask_first_or_last_true_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsReg cr) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask()); + match(Set dst (VectorMaskFirstTrue mask)); + match(Set dst (VectorMaskLastTrue mask)); + effect(TEMP_DEF dst, TEMP tmp, KILL cr); + format %{ "vector_mask_first_or_last_true_evex $dst, $mask \t! using $tmp as TEMP" %} ins_encode %{ int opcode = this->ideal_Opcode(); - int vlen_enc = vector_length_encoding(this, $mask); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); - __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, - $xtmp1$$XMMRegister, $tmp$$Register, mask_len, vlen_enc); + int mask_size = mask_len * type2aelembytes(mbt); + int vlen_enc = vector_length_encoding(this, $mask); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, $tmp$$Register, mask_len, + mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} instruct vmask_first_or_last_true_avx(rRegI dst, vec mask, rRegL tmp, vec xtmp, vec xtmp1, rFlagsReg cr) %{ - predicate(!VM_Version::supports_avx512vlbw()); + predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorMaskFirstTrue mask)); match(Set dst (VectorMaskLastTrue mask)); effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, TEMP xtmp1, KILL cr); - format %{ "vector_mask_first_or_last_true_avx $mask \t! vector first/last true location" %} + format %{ "vector_mask_first_or_last_true_avx $dst, $mask \t! using $tmp, $xtmp and $xtmp1 as TEMP" %} ins_encode %{ int opcode = this->ideal_Opcode(); - int vlen_enc = vector_length_encoding(this, $mask); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); + int mask_size = mask_len * type2aelembytes(mbt); + int vlen_enc = vector_length_encoding(this, $mask); __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, - $xtmp1$$XMMRegister, $tmp$$Register, mask_len, vlen_enc); + $xtmp1$$XMMRegister, $tmp$$Register, mask_len, mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} #endif // _LP64 +// ---------------------------------- Vector Masked Operations ------------------------------------ + +instruct vadd_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (AddVB (Binary dst src2) mask)); + match(Set dst (AddVS (Binary dst src2) mask)); + match(Set dst (AddVI (Binary dst src2) mask)); + match(Set dst (AddVL (Binary dst src2) mask)); + match(Set dst (AddVF (Binary dst src2) mask)); + match(Set dst (AddVD (Binary dst src2) mask)); + format %{ "vpadd_masked $dst, $dst, $src2, $mask\t! add masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vadd_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (AddVB (Binary dst (LoadVector src2)) mask)); + match(Set dst (AddVS (Binary dst (LoadVector src2)) mask)); + match(Set dst (AddVI (Binary dst (LoadVector src2)) mask)); + match(Set dst (AddVL (Binary dst (LoadVector src2)) mask)); + match(Set dst (AddVF (Binary dst (LoadVector src2)) mask)); + match(Set dst (AddVD (Binary dst (LoadVector src2)) mask)); + format %{ "vpadd_masked $dst, $dst, $src2, $mask\t! add masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vxor_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (XorV (Binary dst src2) mask)); + format %{ "vxor_masked $dst, $dst, $src2, $mask\t! xor masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vxor_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (XorV (Binary dst (LoadVector src2)) mask)); + format %{ "vxor_masked $dst, $dst, $src2, $mask\t! xor masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vor_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (OrV (Binary dst src2) mask)); + format %{ "vor_masked $dst, $dst, $src2, $mask\t! or masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vor_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (OrV (Binary dst (LoadVector src2)) mask)); + format %{ "vor_masked $dst, $dst, $src2, $mask\t! or masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vand_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (AndV (Binary dst src2) mask)); + format %{ "vand_masked $dst, $dst, $src2, $mask\t! and masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vand_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (AndV (Binary dst (LoadVector src2)) mask)); + format %{ "vand_masked $dst, $dst, $src2, $mask\t! and masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vsub_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (SubVB (Binary dst src2) mask)); + match(Set dst (SubVS (Binary dst src2) mask)); + match(Set dst (SubVI (Binary dst src2) mask)); + match(Set dst (SubVL (Binary dst src2) mask)); + match(Set dst (SubVF (Binary dst src2) mask)); + match(Set dst (SubVD (Binary dst src2) mask)); + format %{ "vpsub_masked $dst, $dst, $src2, $mask\t! sub masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vsub_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (SubVB (Binary dst (LoadVector src2)) mask)); + match(Set dst (SubVS (Binary dst (LoadVector src2)) mask)); + match(Set dst (SubVI (Binary dst (LoadVector src2)) mask)); + match(Set dst (SubVL (Binary dst (LoadVector src2)) mask)); + match(Set dst (SubVF (Binary dst (LoadVector src2)) mask)); + match(Set dst (SubVD (Binary dst (LoadVector src2)) mask)); + format %{ "vpsub_masked $dst, $dst, $src2, $mask\t! sub masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmul_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (MulVS (Binary dst src2) mask)); + match(Set dst (MulVI (Binary dst src2) mask)); + match(Set dst (MulVL (Binary dst src2) mask)); + match(Set dst (MulVF (Binary dst src2) mask)); + match(Set dst (MulVD (Binary dst src2) mask)); + format %{ "vpmul_masked $dst, $dst, $src2, $mask\t! mul masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmul_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (MulVS (Binary dst (LoadVector src2)) mask)); + match(Set dst (MulVI (Binary dst (LoadVector src2)) mask)); + match(Set dst (MulVL (Binary dst (LoadVector src2)) mask)); + match(Set dst (MulVF (Binary dst (LoadVector src2)) mask)); + match(Set dst (MulVD (Binary dst (LoadVector src2)) mask)); + format %{ "vpmul_masked $dst, $dst, $src2, $mask\t! mul masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vsqrt_reg_masked(vec dst, kReg mask) %{ + match(Set dst (SqrtVF dst mask)); + match(Set dst (SqrtVD dst mask)); + ins_cost(100); + format %{ "vpsqrt_masked $dst, $mask\t! sqrt masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $dst$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vdiv_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (DivVF (Binary dst src2) mask)); + match(Set dst (DivVD (Binary dst src2) mask)); + format %{ "vpdiv_masked $dst, $dst, $src2, $mask\t! div masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vdiv_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (DivVF (Binary dst (LoadVector src2)) mask)); + match(Set dst (DivVD (Binary dst (LoadVector src2)) mask)); + format %{ "vpdiv_masked $dst, $dst, $src2, $mask\t! div masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + + +instruct vrol_imm_masked(vec dst, immI8 shift, kReg mask) %{ + match(Set dst (RotateLeftV (Binary dst shift) mask)); + match(Set dst (RotateRightV (Binary dst shift) mask)); + format %{ "vprotate_imm_masked $dst, $dst, $shift, $mask\t! rotate masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $shift$$constant, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vrol_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (RotateLeftV (Binary dst src2) mask)); + match(Set dst (RotateRightV (Binary dst src2) mask)); + format %{ "vrotate_masked $dst, $dst, $src2, $mask\t! rotate masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vlshift_imm_masked(vec dst, immI8 shift, kReg mask) %{ + match(Set dst (LShiftVS (Binary dst (LShiftCntV shift)) mask)); + match(Set dst (LShiftVI (Binary dst (LShiftCntV shift)) mask)); + match(Set dst (LShiftVL (Binary dst (LShiftCntV shift)) mask)); + format %{ "vplshift_imm_masked $dst, $dst, $shift, $mask\t! lshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $shift$$constant, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vlshift_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (LShiftVS (Binary dst src2) mask)); + match(Set dst (LShiftVI (Binary dst src2) mask)); + match(Set dst (LShiftVL (Binary dst src2) mask)); + format %{ "vplshift_masked $dst, $dst, $src2, $mask\t! lshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode()); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift); + %} + ins_pipe( pipe_slow ); +%} + +instruct vlshift_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (LShiftVS (Binary dst (LoadVector src2)) mask)); + match(Set dst (LShiftVI (Binary dst (LoadVector src2)) mask)); + match(Set dst (LShiftVL (Binary dst (LoadVector src2)) mask)); + format %{ "vplshift_masked $dst, $dst, $src2, $mask\t! lshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vrshift_imm_masked(vec dst, immI8 shift, kReg mask) %{ + match(Set dst (RShiftVS (Binary dst (RShiftCntV shift)) mask)); + match(Set dst (RShiftVI (Binary dst (RShiftCntV shift)) mask)); + match(Set dst (RShiftVL (Binary dst (RShiftCntV shift)) mask)); + format %{ "vprshift_imm_masked $dst, $dst, $shift, $mask\t! rshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $shift$$constant, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vrshift_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (RShiftVS (Binary dst src2) mask)); + match(Set dst (RShiftVI (Binary dst src2) mask)); + match(Set dst (RShiftVL (Binary dst src2) mask)); + format %{ "vprshift_masked $dst, $dst, $src2, $mask\t! rshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode()); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift); + %} + ins_pipe( pipe_slow ); +%} + +instruct vrshift_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (RShiftVS (Binary dst (LoadVector src2)) mask)); + match(Set dst (RShiftVI (Binary dst (LoadVector src2)) mask)); + match(Set dst (RShiftVL (Binary dst (LoadVector src2)) mask)); + format %{ "vprshift_masked $dst, $dst, $src2, $mask\t! rshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vurshift_imm_masked(vec dst, immI8 shift, kReg mask) %{ + match(Set dst (URShiftVS (Binary dst (RShiftCntV shift)) mask)); + match(Set dst (URShiftVI (Binary dst (RShiftCntV shift)) mask)); + match(Set dst (URShiftVL (Binary dst (RShiftCntV shift)) mask)); + format %{ "vpurshift_imm_masked $dst, $dst, $shift, $mask\t! urshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $shift$$constant, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vurshift_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (URShiftVS (Binary dst src2) mask)); + match(Set dst (URShiftVI (Binary dst src2) mask)); + match(Set dst (URShiftVL (Binary dst src2) mask)); + format %{ "vpurshift_masked $dst, $dst, $src2, $mask\t! urshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode()); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift); + %} + ins_pipe( pipe_slow ); +%} + +instruct vurshift_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (URShiftVS (Binary dst (LoadVector src2)) mask)); + match(Set dst (URShiftVI (Binary dst (LoadVector src2)) mask)); + match(Set dst (URShiftVL (Binary dst (LoadVector src2)) mask)); + format %{ "vpurshift_masked $dst, $dst, $src2, $mask\t! urshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmaxv_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (MaxV (Binary dst src2) mask)); + format %{ "vpmax_masked $dst, $dst, $src2, $mask\t! max masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmaxv_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (MaxV (Binary dst (LoadVector src2)) mask)); + format %{ "vpmax_masked $dst, $dst, $src2, $mask\t! max masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vminv_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (MinV (Binary dst src2) mask)); + format %{ "vpmin_masked $dst, $dst, $src2, $mask\t! min masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vminv_mem_masked(vec dst, memory src2, kReg mask) %{ + match(Set dst (MinV (Binary dst (LoadVector src2)) mask)); + format %{ "vpmin_masked $dst, $dst, $src2, $mask\t! min masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vrearrangev_reg_masked(vec dst, vec src2, kReg mask) %{ + match(Set dst (VectorRearrange (Binary dst src2) mask)); + format %{ "vprearrange_masked $dst, $dst, $src2, $mask\t! rearrange masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, false, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vabs_masked(vec dst, kReg mask) %{ + match(Set dst (AbsVB dst mask)); + match(Set dst (AbsVS dst mask)); + match(Set dst (AbsVI dst mask)); + match(Set dst (AbsVL dst mask)); + format %{ "vabs_masked $dst, $mask \t! vabs masked operation" %} + ins_cost(100); + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $dst$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vfma_reg_masked(vec dst, vec src2, vec src3, kReg mask) %{ + match(Set dst (FmaVF (Binary dst src2) (Binary src3 mask))); + match(Set dst (FmaVD (Binary dst src2) (Binary src3 mask))); + format %{ "vfma_masked $dst, $src2, $src3, $mask \t! vfma masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $src2$$XMMRegister, $src3$$XMMRegister, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vfma_mem_masked(vec dst, vec src2, memory src3, kReg mask) %{ + match(Set dst (FmaVF (Binary dst src2) (Binary (LoadVector src3) mask))); + match(Set dst (FmaVD (Binary dst src2) (Binary (LoadVector src3) mask))); + format %{ "vfma_masked $dst, $src2, $src3, $mask \t! vfma masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $src2$$XMMRegister, $src3$$Address, true, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct evcmp_masked(kReg dst, vec src1, vec src2, immI8 cond, kReg mask, rRegP scratch) %{ + match(Set dst (VectorMaskCmp (Binary src1 src2) (Binary cond mask))); + effect(TEMP scratch); + format %{ "vcmp_masked $dst, $src1, $src2, $cond, $mask\t! using $scratch as TEMP" %} + ins_encode %{ + assert(bottom_type()->isa_vectmask(), "TypeVectMask expected"); + int vlen_enc = vector_length_encoding(this, $src1); + BasicType src1_elem_bt = Matcher::vector_element_basic_type(this, $src1); + + // Comparison i + switch (src1_elem_bt) { + case T_BYTE: { + bool is_unsigned = is_unsigned_booltest_pred($cond$$constant); + Assembler::ComparisonPredicate cmp = booltest_pred_to_comparison_pred($cond$$constant); + __ evpcmpb($dst$$KRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); + break; + } + case T_SHORT: { + bool is_unsigned = is_unsigned_booltest_pred($cond$$constant); + Assembler::ComparisonPredicate cmp = booltest_pred_to_comparison_pred($cond$$constant); + __ evpcmpw($dst$$KRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); + break; + } + case T_INT: { + bool is_unsigned = is_unsigned_booltest_pred($cond$$constant); + Assembler::ComparisonPredicate cmp = booltest_pred_to_comparison_pred($cond$$constant); + __ evpcmpd($dst$$KRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); + break; + } + case T_LONG: { + bool is_unsigned = is_unsigned_booltest_pred($cond$$constant); + Assembler::ComparisonPredicate cmp = booltest_pred_to_comparison_pred($cond$$constant); + __ evpcmpq($dst$$KRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, cmp, !is_unsigned, vlen_enc); + break; + } + case T_FLOAT: { + Assembler::ComparisonPredicateFP cmp = booltest_pred_to_comparison_pred_fp($cond$$constant); + __ evcmpps($dst$$KRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, cmp, vlen_enc); + break; + } + case T_DOUBLE: { + Assembler::ComparisonPredicateFP cmp = booltest_pred_to_comparison_pred_fp($cond$$constant); + __ evcmppd($dst$$KRegister, $mask$$KRegister, $src1$$XMMRegister, $src2$$XMMRegister, cmp, vlen_enc); + break; + } + default: assert(false, "%s", type2name(src1_elem_bt)); break; + } + %} + ins_pipe( pipe_slow ); +%} + +#ifdef _LP64 +instruct mask_all_evexI_imm(kReg dst, immI cnt, rRegL tmp) %{ + match(Set dst (MaskAll cnt)); + effect(TEMP_DEF dst, TEMP tmp); + format %{ "mask_all_evexI $dst, $cnt \t! using $tmp as TEMP" %} + ins_encode %{ + int vec_len = Matcher::vector_length(this); + if (VM_Version::supports_avx512bw()) { + __ movq($tmp$$Register, $cnt$$constant); + __ kmovql($dst$$KRegister, $tmp$$Register); + __ kshiftrql($dst$$KRegister, $dst$$KRegister, 64 - vec_len); + } else { + assert(vec_len <= 16, ""); + __ movq($tmp$$Register, $cnt$$constant); + __ kmovwl($dst$$KRegister, $tmp$$Register); + __ kshiftrwl($dst$$KRegister, $dst$$KRegister, 16 - vec_len); + } + %} + ins_pipe( pipe_slow ); +%} + +instruct mask_all_evexI(kReg dst, rRegI src, rRegL tmp) %{ + match(Set dst (MaskAll src)); + effect(TEMP_DEF dst, TEMP tmp); + format %{ "mask_all_evexI $dst, $src \t! using $tmp as TEMP" %} + ins_encode %{ + int vec_len = Matcher::vector_length(this); + if (VM_Version::supports_avx512bw()) { + __ movslq($tmp$$Register, $src$$Register); + __ kmovql($dst$$KRegister, $tmp$$Register); + __ kshiftrql($dst$$KRegister, $dst$$KRegister, 64 - vec_len); + } else { + assert(vec_len <= 16, ""); + __ kmovwl($dst$$KRegister, $src$$Register); + __ kshiftrwl($dst$$KRegister, $dst$$KRegister, 16 - vec_len); + } + %} + ins_pipe( pipe_slow ); +%} + +instruct mask_all_evexL(kReg dst, rRegL src) %{ + match(Set dst (MaskAll src)); + effect(TEMP_DEF dst); + format %{ "mask_all_evexL $dst, $src \t! mask all operation" %} + ins_encode %{ + int vec_len = Matcher::vector_length(this); + if (VM_Version::supports_avx512bw()) { + __ kmovql($dst$$KRegister, $src$$Register); + __ kshiftrql($dst$$KRegister, $dst$$KRegister, 64 - vec_len); + } else { + assert(vec_len <= 16, ""); + __ kmovwl($dst$$KRegister, $src$$Register); + __ kshiftrwl($dst$$KRegister, $dst$$KRegister, 16 - vec_len); + } + %} + ins_pipe( pipe_slow ); +%} + +instruct mask_not_immLT8(kReg dst, kReg src, rRegI rtmp, kReg ktmp, immI_M1 cnt) %{ + predicate(Matcher::vector_length(n) < 8 && VM_Version::supports_avx512dq()); + match(Set dst (XorVMask src (MaskAll cnt))); + effect(TEMP_DEF dst, TEMP rtmp, TEMP ktmp); + format %{ "mask_not_LT8 $dst, $src, $cnt \t!using $ktmp and $rtmp as TEMP" %} + ins_encode %{ + uint masklen = Matcher::vector_length(this); + __ knot(masklen, $dst$$KRegister, $src$$KRegister, $ktmp$$KRegister, $rtmp$$Register); + %} + ins_pipe( pipe_slow ); +%} + +instruct mask_not_imm(kReg dst, kReg src, immI_M1 cnt) %{ + predicate((Matcher::vector_length(n) == 8 && VM_Version::supports_avx512dq()) || + (Matcher::vector_length(n) == 16) || + (Matcher::vector_length(n) > 16 && VM_Version::supports_avx512bw())); + match(Set dst (XorVMask src (MaskAll cnt))); + format %{ "mask_not $dst, $src, $cnt \t! mask not operation" %} + ins_encode %{ + uint masklen = Matcher::vector_length(this); + __ knot(masklen, $dst$$KRegister, $src$$KRegister); + %} + ins_pipe( pipe_slow ); +%} +#endif + +instruct mask_opers_evex(kReg dst, kReg src1, kReg src2, kReg kscratch) %{ + match(Set dst (AndVMask src1 src2)); + match(Set dst (OrVMask src1 src2)); + match(Set dst (XorVMask src1 src2)); + effect(TEMP kscratch); + format %{ "mask_opers_evex $dst, $src1, $src2\t! using $kscratch as TEMP" %} + ins_encode %{ + const MachNode* mask1 = static_cast(this->in(this->operand_index($src1))); + const MachNode* mask2 = static_cast(this->in(this->operand_index($src2))); + assert(0 == Type::cmp(mask1->bottom_type(), mask2->bottom_type()), ""); + uint masklen = Matcher::vector_length(this); + masklen = (masklen < 16 && !VM_Version::supports_avx512dq()) ? 16 : masklen; + __ masked_op(this->ideal_Opcode(), masklen, $dst$$KRegister, $src1$$KRegister, $src2$$KRegister); + %} + ins_pipe( pipe_slow ); +%} + +instruct castMM(kReg dst) +%{ + match(Set dst (CastVV dst)); + + size(0); + format %{ "# castVV of $dst" %} + ins_encode(/* empty encoding */); + ins_cost(0); + ins_pipe(empty); +%} + instruct castVV(vec dst) %{ match(Set dst (CastVV dst)); diff --git a/src/hotspot/share/adlc/forms.cpp b/src/hotspot/share/adlc/forms.cpp index cdd053f25b5..3a246285b3a 100644 --- a/src/hotspot/share/adlc/forms.cpp +++ b/src/hotspot/share/adlc/forms.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -269,6 +269,7 @@ Form::DataType Form::is_load_from_memory(const char *opType) const { if( strcmp(opType,"LoadS")==0 ) return Form::idealS; if( strcmp(opType,"LoadVector")==0 ) return Form::idealV; if( strcmp(opType,"LoadVectorGather")==0 ) return Form::idealV; + if( strcmp(opType,"LoadVectorGatherMasked")==0 ) return Form::idealV; if( strcmp(opType,"LoadVectorMasked")==0 ) return Form::idealV; assert( strcmp(opType,"Load") != 0, "Must type Loads" ); return Form::none; @@ -287,6 +288,7 @@ Form::DataType Form::is_store_to_memory(const char *opType) const { if( strcmp(opType,"StoreNKlass")==0) return Form::idealNKlass; if( strcmp(opType,"StoreVector")==0 ) return Form::idealV; if( strcmp(opType,"StoreVectorScatter")==0 ) return Form::idealV; + if( strcmp(opType,"StoreVectorScatterMasked")==0 ) return Form::idealV; if( strcmp(opType,"StoreVectorMasked")==0 ) return Form::idealV; assert( strcmp(opType,"Store") != 0, "Must type Stores" ); return Form::none; diff --git a/src/hotspot/share/adlc/formssel.cpp b/src/hotspot/share/adlc/formssel.cpp index 10886e233a2..651511f3751 100644 --- a/src/hotspot/share/adlc/formssel.cpp +++ b/src/hotspot/share/adlc/formssel.cpp @@ -2281,6 +2281,7 @@ bool OperandForm::is_bound_register() const { if (strcmp(name, "RegD") == 0) size = 2; if (strcmp(name, "RegL") == 0) size = 2; if (strcmp(name, "RegN") == 0) size = 1; + if (strcmp(name, "RegVectMask") == 0) size = globalAD->get_preproc_def("AARCH64") ? 1 : 2; if (strcmp(name, "VecX") == 0) size = 4; if (strcmp(name, "VecY") == 0) size = 8; if (strcmp(name, "VecZ") == 0) size = 16; @@ -3514,7 +3515,8 @@ int MatchNode::needs_ideal_memory_edge(FormDict &globals) const { "StoreB","StoreC","Store" ,"StoreFP", "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" , "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" , - "StoreVector", "LoadVector", "LoadVectorGather", "StoreVectorScatter", "LoadVectorMasked", "StoreVectorMasked", + "StoreVector", "LoadVector", "LoadVectorMasked", "StoreVectorMasked", + "LoadVectorGather", "StoreVectorScatter", "LoadVectorGatherMasked", "StoreVectorScatterMasked", "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned", "LoadPLocked", "StorePConditional", "StoreIConditional", "StoreLConditional", @@ -3818,51 +3820,77 @@ bool MatchNode::equivalent(FormDict &globals, MatchNode *mNode2) { return true; } -//-------------------------- has_commutative_op ------------------------------- +//-------------------------- count_commutative_op ------------------------------- // Recursively check for commutative operations with subtree operands // which could be swapped. void MatchNode::count_commutative_op(int& count) { static const char *commut_op_list[] = { "AddI","AddL","AddF","AddD", - "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD", "AndI","AndL", - "AndV", "MaxI","MinI","MaxF","MinF","MaxD","MinD", - "MaxV", "MinV", "MulI","MulL","MulF","MulD", - "MulVB","MulVS","MulVI","MulVL","MulVF","MulVD", "OrI","OrL", - "OrV", - "XorI","XorL", - "XorV" + "XorI","XorL" }; - int cnt = sizeof(commut_op_list)/sizeof(char*); - if( _lChild && _rChild && (_lChild->_lChild || _rChild->_lChild) ) { + static const char *commut_vector_op_list[] = { + "AddVB", "AddVS", "AddVI", "AddVL", "AddVF", "AddVD", + "MulVB", "MulVS", "MulVI", "MulVL", "MulVF", "MulVD", + "AndV", "OrV", "XorV", + "MaxV", "MinV" + }; + + if (_lChild && _rChild && (_lChild->_lChild || _rChild->_lChild)) { // Don't swap if right operand is an immediate constant. bool is_const = false; - if( _rChild->_lChild == NULL && _rChild->_rChild == NULL ) { + if (_rChild->_lChild == NULL && _rChild->_rChild == NULL) { FormDict &globals = _AD.globalNames(); const Form *form = globals[_rChild->_opType]; - if ( form ) { - OperandForm *oper = form->is_operand(); - if( oper && oper->interface_type(globals) == Form::constant_interface ) + if (form) { + OperandForm *oper = form->is_operand(); + if (oper && oper->interface_type(globals) == Form::constant_interface) is_const = true; } } - if( !is_const ) { - for( int i=0; i 0 + + if (!is_const) { + int scalar_cnt = sizeof(commut_op_list)/sizeof(char*); + int vector_cnt = sizeof(commut_vector_op_list)/sizeof(char*); + bool matched = false; + + // Check the commutative vector op first. It's noncommutative if + // the current node is a masked vector op, since a mask value + // is added to the original vector node's input list and the original + // first two inputs are packed into one BinaryNode. So don't swap + // if one of the operands is a BinaryNode. + for (int i = 0; i < vector_cnt; i++) { + if (strcmp(_opType, commut_vector_op_list[i]) == 0) { + if (strcmp(_lChild->_opType, "Binary") != 0 && + strcmp(_rChild->_opType, "Binary") != 0) { + count++; + _commutative_id = count; // id should be > 0 + } + matched = true; break; } } + + // Then check the scalar op if the current op is not in + // the commut_vector_op_list. + if (!matched) { + for (int i = 0; i < scalar_cnt; i++) { + if (strcmp(_opType, commut_op_list[i]) == 0) { + count++; + _commutative_id = count; // id should be > 0 + break; + } + } + } } } - if( _lChild ) + if (_lChild) _lChild->count_commutative_op(count); - if( _rChild ) + if (_rChild) _rChild->count_commutative_op(count); } @@ -4088,6 +4116,7 @@ int MatchRule::is_expensive() const { strcmp(opType,"AndReductionV")==0 || strcmp(opType,"OrReductionV")==0 || strcmp(opType,"XorReductionV")==0 || + strcmp(opType,"MaskAll")==0 || 0 /* 0 to line up columns nicely */ ) return 1; } @@ -4200,17 +4229,18 @@ bool MatchRule::is_vector() const { "URShiftVB","URShiftVS","URShiftVI","URShiftVL", "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD", "RoundDoubleModeV","RotateLeftV" , "RotateRightV", "LoadVector","StoreVector", - "LoadVectorGather", "StoreVectorScatter", + "LoadVectorGather", "StoreVectorScatter", "LoadVectorGatherMasked", "StoreVectorScatterMasked", "VectorTest", "VectorLoadMask", "VectorStoreMask", "VectorBlend", "VectorInsert", "VectorRearrange","VectorLoadShuffle", "VectorLoadConst", "VectorCastB2X", "VectorCastS2X", "VectorCastI2X", "VectorCastL2X", "VectorCastF2X", "VectorCastD2X", "VectorMaskWrapper", "VectorMaskCmp", "VectorReinterpret","LoadVectorMasked","StoreVectorMasked", "FmaVD", "FmaVF","PopCountVI", + // Next are vector mask ops. + "MaskAll", "AndVMask", "OrVMask", "XorVMask", "VectorMaskCast", // Next are not supported currently. "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D", - "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD", - "VectorMaskCast" + "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD" }; int cnt = sizeof(vector_list)/sizeof(char*); if (_rChild) { diff --git a/src/hotspot/share/classfile/vmIntrinsics.hpp b/src/hotspot/share/classfile/vmIntrinsics.hpp index c9d4803b50d..08cc2bec0e6 100644 --- a/src/hotspot/share/classfile/vmIntrinsics.hpp +++ b/src/hotspot/share/classfile/vmIntrinsics.hpp @@ -832,121 +832,278 @@ class methodHandle; /* Vector API intrinsification support */ \ \ do_intrinsic(_VectorUnaryOp, jdk_internal_vm_vector_VectorSupport, vector_unary_op_name, vector_unary_op_sig, F_S) \ - do_signature(vector_unary_op_sig, "(ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;") \ + do_signature(vector_unary_op_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$UnaryOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_unary_op_name, "unaryOp") \ \ do_intrinsic(_VectorBinaryOp, jdk_internal_vm_vector_VectorSupport, vector_binary_op_name, vector_binary_op_sig, F_S) \ - do_signature(vector_binary_op_sig, "(ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/lang/Object;" \ - "Ljava/util/function/BiFunction;)Ljava/lang/Object;") \ + do_signature(vector_binary_op_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$BinaryOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;") \ do_name(vector_binary_op_name, "binaryOp") \ \ do_intrinsic(_VectorTernaryOp, jdk_internal_vm_vector_VectorSupport, vector_ternary_op_name, vector_ternary_op_sig, F_S) \ - do_signature(vector_ternary_op_sig, "(ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/lang/Object;" \ - "Ljava/lang/Object;Ljdk/internal/vm/vector/VectorSupport$TernaryOperation;)Ljava/lang/Object;") \ + do_signature(vector_ternary_op_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$TernaryOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_ternary_op_name, "ternaryOp") \ \ do_intrinsic(_VectorBroadcastCoerced, jdk_internal_vm_vector_VectorSupport, vector_broadcast_coerced_name, vector_broadcast_coerced_sig, F_S)\ - do_signature(vector_broadcast_coerced_sig, "(Ljava/lang/Class;Ljava/lang/Class;IJLjdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ - "Ljdk/internal/vm/vector/VectorSupport$BroadcastOperation;)Ljava/lang/Object;") \ + do_signature(vector_broadcast_coerced_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "J" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ + "Ljdk/internal/vm/vector/VectorSupport$BroadcastOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;") \ do_name(vector_broadcast_coerced_name, "broadcastCoerced") \ \ do_intrinsic(_VectorShuffleIota, jdk_internal_vm_vector_VectorSupport, vector_shuffle_step_iota_name, vector_shuffle_step_iota_sig, F_S) \ - do_signature(vector_shuffle_step_iota_sig, "(Ljava/lang/Class;Ljava/lang/Class;Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ - "IIIILjdk/internal/vm/vector/VectorSupport$ShuffleIotaOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;") \ + do_signature(vector_shuffle_step_iota_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ + "IIII" \ + "Ljdk/internal/vm/vector/VectorSupport$ShuffleIotaOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;") \ do_name(vector_shuffle_step_iota_name, "shuffleIota") \ \ do_intrinsic(_VectorShuffleToVector, jdk_internal_vm_vector_VectorSupport, vector_shuffle_to_vector_name, vector_shuffle_to_vector_sig, F_S) \ - do_signature(vector_shuffle_to_vector_sig, "(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;" \ - "ILjdk/internal/vm/vector/VectorSupport$ShuffleToVectorOperation;)Ljava/lang/Object;") \ + do_signature(vector_shuffle_to_vector_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;" \ + "ILjdk/internal/vm/vector/VectorSupport$ShuffleToVectorOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_shuffle_to_vector_name, "shuffleToVector") \ \ do_intrinsic(_VectorLoadOp, jdk_internal_vm_vector_VectorSupport, vector_load_op_name, vector_load_op_sig, F_S) \ - do_signature(vector_load_op_sig, "(Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;JLjava/lang/Object;" \ - "ILjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$LoadOperation;)Ljava/lang/Object;") \ + do_signature(vector_load_op_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Object;" \ + "J" \ + "Ljava/lang/Object;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ + "Ljdk/internal/vm/vector/VectorSupport$LoadOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;") \ do_name(vector_load_op_name, "load") \ \ + do_intrinsic(_VectorLoadMaskedOp, jdk_internal_vm_vector_VectorSupport, vector_load_masked_op_name, vector_load_masked_op_sig, F_S) \ + do_signature(vector_load_masked_op_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Object;" \ + "J" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljava/lang/Object;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ + "Ljdk/internal/vm/vector/VectorSupport$LoadVectorMaskedOperation;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ + do_name(vector_load_masked_op_name, "loadMasked") \ + \ do_intrinsic(_VectorStoreOp, jdk_internal_vm_vector_VectorSupport, vector_store_op_name, vector_store_op_sig, F_S) \ - do_signature(vector_store_op_sig, "(Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;JLjdk/internal/vm/vector/VectorSupport$Vector;" \ - "Ljava/lang/Object;ILjdk/internal/vm/vector/VectorSupport$StoreVectorOperation;)V") \ + do_signature(vector_store_op_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Object;" \ + "J" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljava/lang/Object;ILjdk/internal/vm/vector/VectorSupport$StoreVectorOperation;)" \ + "V") \ do_name(vector_store_op_name, "store") \ \ - do_intrinsic(_VectorReductionCoerced, jdk_internal_vm_vector_VectorSupport, vector_reduction_coerced_name, vector_reduction_coerced_sig, F_S) \ - do_signature(vector_reduction_coerced_sig, "(ILjava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljava/util/function/Function;)J") \ + do_intrinsic(_VectorStoreMaskedOp, jdk_internal_vm_vector_VectorSupport, vector_store_masked_op_name, vector_store_masked_op_sig, F_S) \ + do_signature(vector_store_masked_op_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Object;" \ + "J" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljava/lang/Object;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$StoreVectorMaskedOperation;)" \ + "V") \ + do_name(vector_store_masked_op_name, "storeMasked") \ + \ + do_intrinsic(_VectorReductionCoerced, jdk_internal_vm_vector_VectorSupport, vector_reduction_coerced_name, vector_reduction_coerced_sig, F_S)\ + do_signature(vector_reduction_coerced_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$ReductionOperation;)" \ + "J") \ do_name(vector_reduction_coerced_name, "reductionCoerced") \ \ do_intrinsic(_VectorTest, jdk_internal_vm_vector_VectorSupport, vector_test_name, vector_test_sig, F_S) \ - do_signature(vector_test_sig, "(ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Z") \ + do_signature(vector_test_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljava/util/function/BiFunction;)" \ + "Z") \ do_name(vector_test_name, "test") \ \ do_intrinsic(_VectorBlend, jdk_internal_vm_vector_VectorSupport, vector_blend_name, vector_blend_sig, F_S) \ - do_signature(vector_blend_sig, "(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;I" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ - "Ljdk/internal/vm/vector/VectorSupport$VectorBlendOp;)Ljdk/internal/vm/vector/VectorSupport$Vector;") \ + do_signature(vector_blend_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorBlendOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_blend_name, "blend") \ \ do_intrinsic(_VectorCompare, jdk_internal_vm_vector_VectorSupport, vector_compare_name, vector_compare_sig, F_S) \ - do_signature(vector_compare_sig, "(ILjava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;I" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;" "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ - "Ljdk/internal/vm/vector/VectorSupport$VectorCompareOp;" ")" "Ljdk/internal/vm/vector/VectorSupport$VectorMask;") \ + do_signature(vector_compare_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorCompareOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;") \ do_name(vector_compare_name, "compare") \ \ do_intrinsic(_VectorRearrange, jdk_internal_vm_vector_VectorSupport, vector_rearrange_name, vector_rearrange_sig, F_S) \ - do_signature(vector_rearrange_sig, "(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;I" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;" \ - "Ljdk/internal/vm/vector/VectorSupport$VectorRearrangeOp;)Ljdk/internal/vm/vector/VectorSupport$Vector;") \ + do_signature(vector_rearrange_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorRearrangeOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_rearrange_name, "rearrangeOp") \ \ do_intrinsic(_VectorExtract, jdk_internal_vm_vector_VectorSupport, vector_extract_name, vector_extract_sig, F_S) \ - do_signature(vector_extract_sig, "(Ljava/lang/Class;Ljava/lang/Class;I" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;I" \ - "Ljdk/internal/vm/vector/VectorSupport$VecExtractOp;)J") \ + do_signature(vector_extract_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VecExtractOp;)" \ + "J") \ do_name(vector_extract_name, "extract") \ \ do_intrinsic(_VectorInsert, jdk_internal_vm_vector_VectorSupport, vector_insert_name, vector_insert_sig, F_S) \ - do_signature(vector_insert_sig, "(Ljava/lang/Class;Ljava/lang/Class;I" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;IJ" \ - "Ljdk/internal/vm/vector/VectorSupport$VecInsertOp;)Ljdk/internal/vm/vector/VectorSupport$Vector;") \ + do_signature(vector_insert_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "IJ" \ + "Ljdk/internal/vm/vector/VectorSupport$VecInsertOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_insert_name, "insert") \ \ do_intrinsic(_VectorBroadcastInt, jdk_internal_vm_vector_VectorSupport, vector_broadcast_int_name, vector_broadcast_int_sig, F_S) \ - do_signature(vector_broadcast_int_sig, "(ILjava/lang/Class;Ljava/lang/Class;I" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;I" \ - "Ljdk/internal/vm/vector/VectorSupport$VectorBroadcastIntOp;)Ljdk/internal/vm/vector/VectorSupport$Vector;") \ + do_signature(vector_broadcast_int_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorBroadcastIntOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_broadcast_int_name, "broadcastInt") \ \ do_intrinsic(_VectorConvert, jdk_internal_vm_vector_VectorSupport, vector_convert_name, vector_convert_sig, F_S) \ - do_signature(vector_convert_sig, "(ILjava/lang/Class;Ljava/lang/Class;I" \ - "Ljava/lang/Class;Ljava/lang/Class;I" \ + do_signature(vector_convert_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;" \ "Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ - "Ljdk/internal/vm/vector/VectorSupport$VectorConvertOp;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload;") \ + "Ljdk/internal/vm/vector/VectorSupport$VectorConvertOp;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;") \ do_name(vector_convert_name, "convert") \ \ do_intrinsic(_VectorGatherOp, jdk_internal_vm_vector_VectorSupport, vector_gather_name, vector_gather_sig, F_S) \ - do_signature(vector_gather_sig, "(Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Class;" \ - "Ljava/lang/Object;J" \ + do_signature(vector_gather_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Object;" \ + "J" \ "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ - "Ljava/lang/Object;I[II" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljava/lang/Object;" \ + "I[II" \ "Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;" \ "Ljdk/internal/vm/vector/VectorSupport$LoadVectorOperationWithMap;)" \ "Ljdk/internal/vm/vector/VectorSupport$Vector;") \ do_name(vector_gather_name, "loadWithMap") \ \ do_intrinsic(_VectorScatterOp, jdk_internal_vm_vector_VectorSupport, vector_scatter_name, vector_scatter_sig, F_S) \ - do_signature(vector_scatter_sig, "(Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Class;" \ - "Ljava/lang/Object;J" \ - "Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;" \ - "Ljava/lang/Object;I[II" \ - "Ljdk/internal/vm/vector/VectorSupport$StoreVectorOperationWithMap;)V") \ + do_signature(vector_scatter_sig, "(Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Object;" \ + "J" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$Vector;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljava/lang/Object;" \ + "I[II" \ + "Ljdk/internal/vm/vector/VectorSupport$StoreVectorOperationWithMap;)" \ + "V") \ do_name(vector_scatter_name, "storeWithMap") \ \ do_intrinsic(_VectorRebox, jdk_internal_vm_vector_VectorSupport, vector_rebox_name, vector_rebox_sig, F_S) \ - do_alias(vector_rebox_sig, object_object_signature) \ + do_signature(vector_rebox_sig, "(Ljdk/internal/vm/vector/VectorSupport$VectorPayload;)" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorPayload;") \ do_name(vector_rebox_name, "maybeRebox") \ \ do_intrinsic(_VectorMaskOp, jdk_internal_vm_vector_VectorSupport, vector_mask_oper_name, vector_mask_oper_sig, F_S) \ - do_signature(vector_mask_oper_sig, "(ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;" \ - "Ljdk/internal/vm/vector/VectorSupport$VectorMaskOp;)I") \ + do_signature(vector_mask_oper_sig, "(I" \ + "Ljava/lang/Class;" \ + "Ljava/lang/Class;" \ + "I" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMask;" \ + "Ljdk/internal/vm/vector/VectorSupport$VectorMaskOp;)" \ + "J") \ do_name(vector_mask_oper_name, "maskReductionCoerced") \ \ /* (2) Bytecode intrinsics */ \ diff --git a/src/hotspot/share/opto/c2compiler.cpp b/src/hotspot/share/opto/c2compiler.cpp index acb36f05658..56b6c13176b 100644 --- a/src/hotspot/share/opto/c2compiler.cpp +++ b/src/hotspot/share/opto/c2compiler.cpp @@ -694,7 +694,9 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_VectorShuffleIota: case vmIntrinsics::_VectorShuffleToVector: case vmIntrinsics::_VectorLoadOp: + case vmIntrinsics::_VectorLoadMaskedOp: case vmIntrinsics::_VectorStoreOp: + case vmIntrinsics::_VectorStoreMaskedOp: case vmIntrinsics::_VectorGatherOp: case vmIntrinsics::_VectorScatterOp: case vmIntrinsics::_VectorReductionCoerced: diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index cad5e835321..21526a6246a 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -2398,47 +2398,103 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { #endif // Phi (VB ... VB) => VB (Phi ...) (Phi ...) - if (EnableVectorReboxing && can_reshape && progress == NULL) { - PhaseIterGVN* igvn = phase->is_IterGVN(); - - bool all_inputs_are_equiv_vboxes = true; - for (uint i = 1; i < req(); ++i) { - Node* n = in(i); - if (in(i)->Opcode() != Op_VectorBox) { - all_inputs_are_equiv_vboxes = false; - break; - } - // Check that vector type of vboxes is equivalent - if (i != 1) { - if (Type::cmp(in(i-0)->in(VectorBoxNode::Value)->bottom_type(), - in(i-1)->in(VectorBoxNode::Value)->bottom_type()) != 0) { - all_inputs_are_equiv_vboxes = false; - break; - } - if (Type::cmp(in(i-0)->in(VectorBoxNode::Box)->bottom_type(), - in(i-1)->in(VectorBoxNode::Box)->bottom_type()) != 0) { - all_inputs_are_equiv_vboxes = false; - break; + if (EnableVectorReboxing && can_reshape && progress == NULL && type()->isa_oopptr()) { + progress = merge_through_phi(this, phase->is_IterGVN()); + } + + return progress; // Return any progress +} + +Node* PhiNode::clone_through_phi(Node* root_phi, const Type* t, uint c, PhaseIterGVN* igvn) { + Node_Stack stack(1); + VectorSet visited; + Node_List node_map; + + stack.push(root_phi, 1); // ignore control + visited.set(root_phi->_idx); + + Node* new_phi = new PhiNode(root_phi->in(0), t); + node_map.map(root_phi->_idx, new_phi); + + while (stack.is_nonempty()) { + Node* n = stack.node(); + uint idx = stack.index(); + assert(n->is_Phi(), "not a phi"); + if (idx < n->req()) { + stack.set_index(idx + 1); + Node* def = n->in(idx); + if (def == NULL) { + continue; // ignore dead path + } else if (def->is_Phi()) { // inner node + Node* new_phi = node_map[n->_idx]; + if (!visited.test_set(def->_idx)) { // not visited yet + node_map.map(def->_idx, new PhiNode(def->in(0), t)); + stack.push(def, 1); // ignore control } + Node* new_in = node_map[def->_idx]; + new_phi->set_req(idx, new_in); + } else if (def->Opcode() == Op_VectorBox) { // leaf + assert(n->is_Phi(), "not a phi"); + Node* new_phi = node_map[n->_idx]; + new_phi->set_req(idx, def->in(c)); + } else { + assert(false, "not optimizeable"); + return NULL; } + } else { + Node* new_phi = node_map[n->_idx]; + igvn->register_new_node_with_optimizer(new_phi, n); + stack.pop(); } + } + return new_phi; +} - if (all_inputs_are_equiv_vboxes) { - VectorBoxNode* vbox = static_cast(in(1)); - PhiNode* new_vbox_phi = new PhiNode(r, vbox->box_type()); - PhiNode* new_vect_phi = new PhiNode(r, vbox->vec_type()); - for (uint i = 1; i < req(); ++i) { - VectorBoxNode* old_vbox = static_cast(in(i)); - new_vbox_phi->set_req(i, old_vbox->in(VectorBoxNode::Box)); - new_vect_phi->set_req(i, old_vbox->in(VectorBoxNode::Value)); +Node* PhiNode::merge_through_phi(Node* root_phi, PhaseIterGVN* igvn) { + Node_Stack stack(1); + VectorSet visited; + + stack.push(root_phi, 1); // ignore control + visited.set(root_phi->_idx); + + VectorBoxNode* cached_vbox = NULL; + while (stack.is_nonempty()) { + Node* n = stack.node(); + uint idx = stack.index(); + if (idx < n->req()) { + stack.set_index(idx + 1); + Node* in = n->in(idx); + if (in == NULL) { + continue; // ignore dead path + } else if (in->isa_Phi()) { + if (!visited.test_set(in->_idx)) { + stack.push(in, 1); // ignore control + } + } else if (in->Opcode() == Op_VectorBox) { + VectorBoxNode* vbox = static_cast(in); + if (cached_vbox == NULL) { + cached_vbox = vbox; + } else if (vbox->vec_type() != cached_vbox->vec_type()) { + // TODO: vector type mismatch can be handled with additional reinterpret casts + assert(Type::cmp(vbox->vec_type(), cached_vbox->vec_type()) != 0, "inconsistent"); + return NULL; // not optimizable: vector type mismatch + } else if (vbox->box_type() != cached_vbox->box_type()) { + assert(Type::cmp(vbox->box_type(), cached_vbox->box_type()) != 0, "inconsistent"); + return NULL; // not optimizable: box type mismatch + } + } else { + return NULL; // not optimizable: neither Phi nor VectorBox } - igvn->register_new_node_with_optimizer(new_vbox_phi, this); - igvn->register_new_node_with_optimizer(new_vect_phi, this); - progress = new VectorBoxNode(igvn->C, new_vbox_phi, new_vect_phi, vbox->box_type(), vbox->vec_type()); + } else { + stack.pop(); } } - - return progress; // Return any progress + assert(cached_vbox != NULL, "sanity"); + const TypeInstPtr* btype = cached_vbox->box_type(); + const TypeVect* vtype = cached_vbox->vec_type(); + Node* new_vbox_phi = clone_through_phi(root_phi, btype, VectorBoxNode::Box, igvn); + Node* new_vect_phi = clone_through_phi(root_phi, vtype, VectorBoxNode::Value, igvn); + return new VectorBoxNode(igvn->C, new_vbox_phi, new_vect_phi, btype, vtype); } bool PhiNode::is_data_loop(RegionNode* r, Node* uin, const PhaseGVN* phase) { diff --git a/src/hotspot/share/opto/cfgnode.hpp b/src/hotspot/share/opto/cfgnode.hpp index d0a22b78b6e..3672eaa2ed3 100644 --- a/src/hotspot/share/opto/cfgnode.hpp +++ b/src/hotspot/share/opto/cfgnode.hpp @@ -143,6 +143,9 @@ class PhiNode : public TypeNode { bool wait_for_region_igvn(PhaseGVN* phase); bool is_data_loop(RegionNode* r, Node* uin, const PhaseGVN* phase); + static Node* clone_through_phi(Node* root_phi, const Type* t, uint c, PhaseIterGVN* igvn); + static Node* merge_through_phi(Node* root_phi, PhaseIterGVN* igvn); + public: // Node layout (parallels RegionNode): enum { Region, // Control input is the Phi's region. diff --git a/src/hotspot/share/opto/chaitin.cpp b/src/hotspot/share/opto/chaitin.cpp index 41917c2b7b1..fe3c7983c63 100644 --- a/src/hotspot/share/opto/chaitin.cpp +++ b/src/hotspot/share/opto/chaitin.cpp @@ -77,6 +77,7 @@ void LRG::dump() const { if( _is_oop ) tty->print("Oop "); if( _is_float ) tty->print("Float "); if( _is_vector ) tty->print("Vector "); + if( _is_predicate ) tty->print("Predicate "); if( _is_scalable ) tty->print("Scalable "); if( _was_spilled1 ) tty->print("Spilled "); if( _was_spilled2 ) tty->print("Spilled2 "); @@ -638,7 +639,8 @@ void PhaseChaitin::Register_Allocate() { LRG &lrg = lrgs(_lrg_map.live_range_id(i)); if (!lrg.alive()) { set_bad(i); - } else if (lrg.num_regs() == 1) { + } else if ((lrg.num_regs() == 1 && !lrg.is_scalable()) || + (lrg.is_scalable() && lrg.scalable_reg_slots() == 1)) { set1(i, lrg.reg()); } else { // Must be a register-set if (!lrg._fat_proj) { // Must be aligned adjacent register set @@ -653,15 +655,19 @@ void PhaseChaitin::Register_Allocate() { // num_regs, which reflects the physical length of scalable registers. num_regs = lrg.scalable_reg_slots(); } - OptoReg::Name lo = OptoReg::add(hi, (1-num_regs)); // Find lo - // We have to use pair [lo,lo+1] even for wide vectors because - // the rest of code generation works only with pairs. It is safe - // since for registers encoding only 'lo' is used. - // Second reg from pair is used in ScheduleAndBundle on SPARC where - // vector max size is 8 which corresponds to registers pair. - // It is also used in BuildOopMaps but oop operations are not - // vectorized. - set2(i, lo); + if (num_regs == 1) { + set1(i, hi); + } else { + OptoReg::Name lo = OptoReg::add(hi, (1 - num_regs)); // Find lo + // We have to use pair [lo,lo+1] even for wide vectors/vmasks because + // the rest of code generation works only with pairs. It is safe + // since for registers encoding only 'lo' is used. + // Second reg from pair is used in ScheduleAndBundle with vector max + // size 8 which corresponds to registers pair. + // It is also used in BuildOopMaps but oop operations are not + // vectorized. + set2(i, lo); + } } else { // Misaligned; extract 2 bits OptoReg::Name hi = lrg.reg(); // Get hi register lrg.Remove(hi); // Yank from mask @@ -824,8 +830,22 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) { lrg.set_scalable_reg_slots(Matcher::scalable_vector_reg_size(T_FLOAT)); } } + + if (ireg == Op_RegVectMask) { + assert(Matcher::has_predicated_vectors(), "predicated vector should be supported"); + lrg._is_predicate = 1; + if (Matcher::supports_scalable_vector()) { + lrg._is_scalable = 1; + // For scalable predicate, when it is allocated in physical register, + // num_regs is RegMask::SlotsPerRegVectMask for reg mask, + // which may not be the actual physical register size. + // If it is allocated in stack, we need to get the actual + // physical length of scalable predicate register. + lrg.set_scalable_reg_slots(Matcher::scalable_predicate_reg_slots()); + } + } assert(n_type->isa_vect() == NULL || lrg._is_vector || - ireg == Op_RegD || ireg == Op_RegL || ireg == Op_RegVectMask, + ireg == Op_RegD || ireg == Op_RegL || ireg == Op_RegVectMask, "vector must be in vector registers"); // Check for bound register masks @@ -919,6 +939,8 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) { } break; case Op_RegVectMask: + assert(Matcher::has_predicated_vectors(), "sanity"); + assert(RegMask::num_registers(Op_RegVectMask) == RegMask::SlotsPerRegVectMask, "sanity"); lrg.set_num_regs(RegMask::SlotsPerRegVectMask); lrg.set_reg_pressure(1); break; @@ -1371,6 +1393,11 @@ static OptoReg::Name find_first_set(LRG &lrg, RegMask mask, int chunk) { } } return OptoReg::Bad; // will cause chunk change, and retry next chunk + } else if (lrg._is_predicate) { + assert(num_regs == RegMask::SlotsPerRegVectMask, "scalable predicate register"); + num_regs = lrg.scalable_reg_slots(); + mask.clear_to_sets(num_regs); + return mask.find_first_set(lrg, num_regs); } } @@ -1417,7 +1444,7 @@ OptoReg::Name PhaseChaitin::bias_color( LRG &lrg, int chunk ) { } // If no bias info exists, just go with the register selection ordering - if (lrg._is_vector || lrg.num_regs() == 2) { + if (lrg._is_vector || lrg.num_regs() == 2 || lrg.is_scalable()) { // Find an aligned set return OptoReg::add(find_first_set(lrg, lrg.mask(), chunk), chunk); } diff --git a/src/hotspot/share/opto/chaitin.hpp b/src/hotspot/share/opto/chaitin.hpp index 842d5c652d4..2e9213b4bab 100644 --- a/src/hotspot/share/opto/chaitin.hpp +++ b/src/hotspot/share/opto/chaitin.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -163,8 +163,8 @@ public: bool is_scalable() { #ifdef ASSERT if (_is_scalable) { - // Should only be a vector for now, but it could also be a RegVectMask in future. - assert(_is_vector && (_num_regs == RegMask::SlotsPerVecA), "unexpected scalable reg"); + assert(_is_vector && (_num_regs == RegMask::SlotsPerVecA) || + _is_predicate && (_num_regs == RegMask::SlotsPerRegVectMask), "unexpected scalable reg"); } #endif return Matcher::implements_scalable_vector && _is_scalable; @@ -195,6 +195,7 @@ public: uint _is_oop:1, // Live-range holds an oop _is_float:1, // True if in float registers _is_vector:1, // True if in vector registers + _is_predicate:1, // True if in mask/predicate registers _is_scalable:1, // True if register size is scalable // e.g. Arm SVE vector/predicate registers. _was_spilled1:1, // True if prior spilling on def diff --git a/src/hotspot/share/opto/classes.hpp b/src/hotspot/share/opto/classes.hpp index 3b9697ecb4b..da5faa5d4a1 100644 --- a/src/hotspot/share/opto/classes.hpp +++ b/src/hotspot/share/opto/classes.hpp @@ -415,8 +415,10 @@ macro(MinReductionV) macro(MaxReductionV) macro(LoadVector) macro(LoadVectorGather) +macro(LoadVectorGatherMasked) macro(StoreVector) macro(StoreVectorScatter) +macro(StoreVectorScatterMasked) macro(LoadVectorMasked) macro(StoreVectorMasked) macro(VectorCmpMasked) @@ -425,6 +427,7 @@ macro(VectorMaskOp) macro(VectorMaskTrueCount) macro(VectorMaskFirstTrue) macro(VectorMaskLastTrue) +macro(VectorMaskToLong) macro(Pack) macro(PackB) macro(PackS) @@ -475,3 +478,7 @@ macro(VectorCastL2X) macro(VectorCastF2X) macro(VectorCastD2X) macro(VectorInsert) +macro(MaskAll) +macro(AndVMask) +macro(OrVMask) +macro(XorVMask) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index c5affe1a2b8..b2f5dd55788 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -2134,7 +2134,8 @@ void Compile::Optimize() { if (!failing() && RenumberLiveNodes && live_nodes() + NodeLimitFudgeFactor < unique()) { Compile::TracePhase tp("", &timers[_t_renumberLive]); initial_gvn()->replace_with(&igvn); - for_igvn()->clear(); + Unique_Node_List* old_worklist = for_igvn(); + old_worklist->clear(); Unique_Node_List new_worklist(C->comp_arena()); { ResourceMark rm; @@ -2144,7 +2145,7 @@ void Compile::Optimize() { set_for_igvn(&new_worklist); igvn = PhaseIterGVN(initial_gvn()); igvn.optimize(); - set_for_igvn(save_for_igvn); + set_for_igvn(old_worklist); // new_worklist is dead beyond this point } // Now that all inlining is over and no PhaseRemoveUseless will run, cut edge from root to loop @@ -2358,6 +2359,7 @@ bool Compile::has_vbox_nodes() { static bool is_vector_unary_bitwise_op(Node* n) { return n->Opcode() == Op_XorV && + n->req() == 2 && VectorNode::is_vector_bitwise_not_pattern(n); } @@ -2365,7 +2367,7 @@ static bool is_vector_binary_bitwise_op(Node* n) { switch (n->Opcode()) { case Op_AndV: case Op_OrV: - return true; + return n->req() == 2; case Op_XorV: return !is_vector_unary_bitwise_op(n); @@ -3424,6 +3426,8 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f case Op_StoreVector: case Op_LoadVectorGather: case Op_StoreVectorScatter: + case Op_LoadVectorGatherMasked: + case Op_StoreVectorScatterMasked: case Op_VectorCmpMasked: case Op_VectorMaskGen: case Op_LoadVectorMasked: diff --git a/src/hotspot/share/opto/lcm.cpp b/src/hotspot/share/opto/lcm.cpp index 7197f1f3c22..fe799dd9847 100644 --- a/src/hotspot/share/opto/lcm.cpp +++ b/src/hotspot/share/opto/lcm.cpp @@ -702,8 +702,9 @@ void PhaseCFG::adjust_register_pressure(Node* n, Block* block, intptr_t* recalc_ case Op_StoreP: case Op_StoreN: case Op_StoreVector: - case Op_StoreVectorScatter: case Op_StoreVectorMasked: + case Op_StoreVectorScatter: + case Op_StoreVectorScatterMasked: case Op_StoreNKlass: for (uint k = 1; k < m->req(); k++) { Node *in = m->in(k); diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index da9e357ac47..0270b1ac01a 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -662,8 +662,12 @@ bool LibraryCallKit::try_to_inline(int predicate) { return inline_vector_shuffle_to_vector(); case vmIntrinsics::_VectorLoadOp: return inline_vector_mem_operation(/*is_store=*/false); + case vmIntrinsics::_VectorLoadMaskedOp: + return inline_vector_mem_masked_operation(/*is_store*/false); case vmIntrinsics::_VectorStoreOp: return inline_vector_mem_operation(/*is_store=*/true); + case vmIntrinsics::_VectorStoreMaskedOp: + return inline_vector_mem_masked_operation(/*is_store=*/true); case vmIntrinsics::_VectorGatherOp: return inline_vector_gather_scatter(/*is_scatter*/ false); case vmIntrinsics::_VectorScatterOp: diff --git a/src/hotspot/share/opto/library_call.hpp b/src/hotspot/share/opto/library_call.hpp index dfbad65a7b2..197f5d80db8 100644 --- a/src/hotspot/share/opto/library_call.hpp +++ b/src/hotspot/share/opto/library_call.hpp @@ -319,6 +319,7 @@ class LibraryCallKit : public GraphKit { bool inline_vector_shuffle_iota(); bool inline_vector_mask_operation(); bool inline_vector_mem_operation(bool is_store); + bool inline_vector_mem_masked_operation(bool is_store); bool inline_vector_gather_scatter(bool is_scatter); bool inline_vector_reduction(); bool inline_vector_test(); @@ -332,14 +333,15 @@ class LibraryCallKit : public GraphKit { Node* gen_call_to_svml(int vector_api_op_id, BasicType bt, int num_elem, Node* opd1, Node* opd2); enum VectorMaskUseType { - VecMaskUseLoad, - VecMaskUseStore, - VecMaskUseAll, - VecMaskNotUsed + VecMaskUseLoad = 1 << 0, + VecMaskUseStore = 1 << 1, + VecMaskUseAll = VecMaskUseLoad | VecMaskUseStore, + VecMaskUsePred = 1 << 2, + VecMaskNotUsed = 1 << 3 }; bool arch_supports_vector(int op, int num_elem, BasicType type, VectorMaskUseType mask_use_type, bool has_scalar_args = false); - bool arch_supports_vector_rotate(int opc, int num_elem, BasicType elem_bt, bool has_scalar_args = false); + bool arch_supports_vector_rotate(int opc, int num_elem, BasicType elem_bt, VectorMaskUseType mask_use_type, bool has_scalar_args = false); void clear_upper_avx() { #ifdef X86 diff --git a/src/hotspot/share/opto/matcher.cpp b/src/hotspot/share/opto/matcher.cpp index 5b8fcb8ab60..fadfd11f2bf 100644 --- a/src/hotspot/share/opto/matcher.cpp +++ b/src/hotspot/share/opto/matcher.cpp @@ -434,6 +434,24 @@ static RegMask *init_input_masks( uint size, RegMask &ret_adr, RegMask &fp ) { return rms; } +const int Matcher::scalable_predicate_reg_slots() { + assert(Matcher::has_predicated_vectors() && Matcher::supports_scalable_vector(), + "scalable predicate vector should be supported"); + int vector_reg_bit_size = Matcher::scalable_vector_reg_size(T_BYTE) << LogBitsPerByte; + // We assume each predicate register is one-eighth of the size of + // scalable vector register, one mask bit per vector byte. + int predicate_reg_bit_size = vector_reg_bit_size >> 3; + // Compute number of slots which is required when scalable predicate + // register is spilled. E.g. if scalable vector register is 640 bits, + // predicate register is 80 bits, which is 2.5 * slots. + // We will round up the slot number to power of 2, which is required + // by find_first_set(). + int slots = predicate_reg_bit_size & (BitsPerInt - 1) + ? (predicate_reg_bit_size >> LogBitsPerInt) + 1 + : predicate_reg_bit_size >> LogBitsPerInt; + return round_up_power_of_2(slots); +} + #define NOF_STACK_MASKS (3*13) // Create the initial stack mask used by values spilling to the stack. @@ -542,6 +560,8 @@ void Matcher::init_first_stack_mask() { if (Matcher::has_predicated_vectors()) { *idealreg2spillmask[Op_RegVectMask] = *idealreg2regmask[Op_RegVectMask]; idealreg2spillmask[Op_RegVectMask]->OR(aligned_stack_mask); + } else { + *idealreg2spillmask[Op_RegVectMask] = RegMask::Empty; } if (Matcher::vector_size_supported(T_BYTE,4)) { @@ -614,6 +634,19 @@ void Matcher::init_first_stack_mask() { if (Matcher::supports_scalable_vector()) { int k = 1; OptoReg::Name in = OptoReg::add(_in_arg_limit, -1); + // Exclude last input arg stack slots to avoid spilling vector register there, + // otherwise RegVectMask spills could stomp over stack slots in caller frame. + for (; (in >= init_in) && (k < scalable_predicate_reg_slots()); k++) { + scalable_stack_mask.Remove(in); + in = OptoReg::add(in, -1); + } + + // For RegVectMask + scalable_stack_mask.clear_to_sets(scalable_predicate_reg_slots()); + assert(scalable_stack_mask.is_AllStack(), "should be infinite stack"); + *idealreg2spillmask[Op_RegVectMask] = *idealreg2regmask[Op_RegVectMask]; + idealreg2spillmask[Op_RegVectMask]->OR(scalable_stack_mask); + // Exclude last input arg stack slots to avoid spilling vector register there, // otherwise vector spills could stomp over stack slots in caller frame. for (; (in >= init_in) && (k < scalable_vector_reg_size(T_FLOAT)); k++) { @@ -2228,6 +2261,7 @@ bool Matcher::find_shared_visit(MStack& mstack, Node* n, uint opcode, bool& mem_ case Op_MacroLogicV: case Op_LoadVectorMasked: case Op_VectorCmpMasked: + case Op_VectorLoadMask: set_shared(n); // Force result into register (it will be anyways) break; case Op_ConP: { // Convert pointers above the centerline to NUL @@ -2273,6 +2307,21 @@ bool Matcher::find_shared_visit(MStack& mstack, Node* n, uint opcode, bool& mem_ } void Matcher::find_shared_post_visit(Node* n, uint opcode) { + if (n->is_predicated_vector()) { + // Restructure into binary trees for Matching. + if (n->req() == 4) { + n->set_req(1, new BinaryNode(n->in(1), n->in(2))); + n->set_req(2, n->in(3)); + n->del_req(3); + } else if (n->req() == 5) { + n->set_req(1, new BinaryNode(n->in(1), n->in(2))); + n->set_req(2, new BinaryNode(n->in(3), n->in(4))); + n->del_req(4); + n->del_req(3); + } + return; + } + switch(opcode) { // Handle some opcodes special case Op_StorePConditional: case Op_StoreIConditional: @@ -2412,12 +2461,22 @@ void Matcher::find_shared_post_visit(Node* n, uint opcode) { n->del_req(3); break; } + case Op_LoadVectorGatherMasked: case Op_StoreVectorScatter: { Node* pair = new BinaryNode(n->in(MemNode::ValueIn), n->in(MemNode::ValueIn+1)); n->set_req(MemNode::ValueIn, pair); n->del_req(MemNode::ValueIn+1); break; } + case Op_StoreVectorScatterMasked: { + Node* pair = new BinaryNode(n->in(MemNode::ValueIn+1), n->in(MemNode::ValueIn+2)); + n->set_req(MemNode::ValueIn+1, pair); + n->del_req(MemNode::ValueIn+2); + pair = new BinaryNode(n->in(MemNode::ValueIn), n->in(MemNode::ValueIn+1)); + n->set_req(MemNode::ValueIn, pair); + n->del_req(MemNode::ValueIn+1); + break; + } case Op_VectorMaskCmp: { n->set_req(1, new BinaryNode(n->in(1), n->in(2))); n->set_req(2, n->in(3)); diff --git a/src/hotspot/share/opto/matcher.hpp b/src/hotspot/share/opto/matcher.hpp index cae441a0a4d..446fb259ee5 100644 --- a/src/hotspot/share/opto/matcher.hpp +++ b/src/hotspot/share/opto/matcher.hpp @@ -329,6 +329,8 @@ public: // e.g. Op_ vector nodes and other intrinsics while guarding with vlen static const bool match_rule_supported_vector(int opcode, int vlen, BasicType bt); + static const bool match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt); + static const RegMask* predicate_reg_mask(void); static const TypeVect* predicate_reg_type(const Type* elemTy, int length); @@ -345,6 +347,8 @@ public: // Actual max scalable vector register length. static const int scalable_vector_reg_size(const BasicType bt); + // Actual max scalable predicate register length. + static const int scalable_predicate_reg_slots(); // Vector ideal reg static const uint vector_ideal_reg(int len); diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index f0f78bd9946..8577d1f6a94 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -1136,7 +1136,7 @@ Node* MemNode::can_see_stored_value(Node* st, PhaseTransform* phase) const { return NULL; } // LoadVector/StoreVector needs additional check to ensure the types match. - if (store_Opcode() == Op_StoreVector) { + if (st->is_StoreVector()) { const TypeVect* in_vt = st->as_StoreVector()->vect_type(); const TypeVect* out_vt = as_LoadVector()->vect_type(); if (in_vt != out_vt) { diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 078cbd03423..1c226cbf2a4 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -172,7 +172,9 @@ class LoadVectorGatherNode; class StoreVectorNode; class StoreVectorScatterNode; class VectorMaskCmpNode; +class VectorUnboxNode; class VectorSet; +class VectorReinterpretNode; // The type of all node counts and indexes. // It must hold at least 16 bits, but must also be fast to load and store. @@ -707,6 +709,8 @@ public: DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1) DEFINE_CLASS_ID(Vector, Type, 7) DEFINE_CLASS_ID(VectorMaskCmp, Vector, 0) + DEFINE_CLASS_ID(VectorUnbox, Vector, 1) + DEFINE_CLASS_ID(VectorReinterpret, Vector, 2) DEFINE_CLASS_ID(Proj, Node, 3) DEFINE_CLASS_ID(CatchProj, Proj, 0) @@ -778,7 +782,8 @@ public: Flag_is_scheduled = 1 << 12, Flag_has_vector_mask_set = 1 << 13, Flag_is_expensive = 1 << 14, - Flag_for_post_loop_opts_igvn = 1 << 15, + Flag_is_predicated_vector = 1 << 15, + Flag_for_post_loop_opts_igvn = 1 << 16, _last_flag = Flag_for_post_loop_opts_igvn }; @@ -933,11 +938,13 @@ public: DEFINE_CLASS_QUERY(SubTypeCheck) DEFINE_CLASS_QUERY(Type) DEFINE_CLASS_QUERY(Vector) + DEFINE_CLASS_QUERY(VectorMaskCmp) + DEFINE_CLASS_QUERY(VectorUnbox) + DEFINE_CLASS_QUERY(VectorReinterpret); DEFINE_CLASS_QUERY(LoadVector) DEFINE_CLASS_QUERY(LoadVectorGather) DEFINE_CLASS_QUERY(StoreVector) DEFINE_CLASS_QUERY(StoreVectorScatter) - DEFINE_CLASS_QUERY(VectorMaskCmp) DEFINE_CLASS_QUERY(Unlock) #undef DEFINE_CLASS_QUERY @@ -988,6 +995,8 @@ public: // It must have the loop's phi as input and provide a def to the phi. bool is_reduction() const { return (_flags & Flag_is_reduction) != 0; } + bool is_predicated_vector() const { return (_flags & Flag_is_predicated_vector) != 0; } + // The node is a CountedLoopEnd with a mask annotation so as to emit a restore context bool has_vector_mask_set() const { return (_flags & Flag_has_vector_mask_set) != 0; } diff --git a/src/hotspot/share/opto/postaloc.cpp b/src/hotspot/share/opto/postaloc.cpp index aa9ae37a78a..96c30a122bb 100644 --- a/src/hotspot/share/opto/postaloc.cpp +++ b/src/hotspot/share/opto/postaloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -309,17 +309,16 @@ int PhaseChaitin::elide_copy( Node *n, int k, Block *current_block, Node_List &v // "val_reg" and "reg". For example, when "val" resides in register // but "reg" is located in stack. if (lrgs(val_idx).is_scalable()) { - assert(val->ideal_reg() == Op_VecA, "scalable vector register"); + assert(val->ideal_reg() == Op_VecA || val->ideal_reg() == Op_RegVectMask, "scalable register"); if (OptoReg::is_stack(reg)) { n_regs = lrgs(val_idx).scalable_reg_slots(); } else { - n_regs = RegMask::SlotsPerVecA; + n_regs = lrgs(val_idx)._is_predicate ? RegMask::SlotsPerRegVectMask : RegMask::SlotsPerVecA; } } if (n_regs > 1) { // Doubles and vectors check for aligned-adjacent set uint last; - if (lrgs(val_idx).is_scalable()) { - assert(val->ideal_reg() == Op_VecA, "scalable vector register"); + if (lrgs(val_idx).is_scalable() && val->ideal_reg() == Op_VecA) { // For scalable vector register, regmask is always SlotsPerVecA bits aligned last = RegMask::SlotsPerVecA - 1; } else { diff --git a/src/hotspot/share/opto/regmask.cpp b/src/hotspot/share/opto/regmask.cpp index df7f8f4db42..a1f1904bfa4 100644 --- a/src/hotspot/share/opto/regmask.cpp +++ b/src/hotspot/share/opto/regmask.cpp @@ -237,7 +237,7 @@ bool RegMask::is_valid_reg(OptoReg::Name reg, const int size) const { // HIGHEST register number in the set, or BAD if no sets. // Works also for size 1. OptoReg::Name RegMask::find_first_set(LRG &lrg, const int size) const { - if (lrg.is_scalable()) { + if (lrg.is_scalable() && lrg._is_vector) { // For scalable vector register, regmask is SlotsPerVecA bits aligned. assert(is_aligned_sets(SlotsPerVecA), "mask is not aligned, adjacent sets"); } else { diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index 459cbef03b7..2cd8925002a 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -997,7 +997,6 @@ const Type *Type::filter_helper(const Type *kills, bool include_speculative) con } //------------------------------xdual------------------------------------------ - const Type *Type::xdual() const { // Note: the base() accessor asserts the sanity of _base. assert(_type_info[base()].dual_type != Bad, "implement with v-call"); @@ -2359,7 +2358,10 @@ const TypeVect *TypeVect::VECTZ = NULL; // 512-bit vectors const TypeVect *TypeVect::VECTMASK = NULL; // predicate/mask vector //------------------------------make------------------------------------------- -const TypeVect* TypeVect::make(const Type *elem, uint length) { +const TypeVect* TypeVect::make(const Type *elem, uint length, bool is_mask) { + if (is_mask) { + return makemask(elem, length); + } BasicType elem_bt = elem->array_element_basic_type(); assert(is_java_primitive(elem_bt), "only primitive types in vector"); assert(Matcher::vector_size_supported(elem_bt, length), "length in range"); @@ -2385,7 +2387,9 @@ const TypeVect* TypeVect::make(const Type *elem, uint length) { } const TypeVect *TypeVect::makemask(const Type* elem, uint length) { - if (Matcher::has_predicated_vectors()) { + BasicType elem_bt = elem->array_element_basic_type(); + if (Matcher::has_predicated_vectors() && + Matcher::match_rule_supported_vector_masked(Op_VectorLoadMask, length, elem_bt)) { const TypeVect* mtype = Matcher::predicate_reg_type(elem, length); return (TypeVect*)(const_cast(mtype))->hashcons(); } else { diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index dc9a5d8156b..6a927ee49a7 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -804,12 +804,12 @@ public: virtual bool singleton(void) const; // TRUE if type is a singleton virtual bool empty(void) const; // TRUE if type is vacuous - static const TypeVect *make(const BasicType elem_bt, uint length) { + static const TypeVect *make(const BasicType elem_bt, uint length, bool is_mask = false) { // Use bottom primitive type. - return make(get_const_basic_type(elem_bt), length); + return make(get_const_basic_type(elem_bt), length, is_mask); } // Used directly by Replicate nodes to construct singleton vector. - static const TypeVect *make(const Type* elem, uint length); + static const TypeVect *make(const Type* elem, uint length, bool is_mask = false); static const TypeVect *makemask(const BasicType elem_bt, uint length) { // Use bottom primitive type. diff --git a/src/hotspot/share/opto/vector.cpp b/src/hotspot/share/opto/vector.cpp index 65f32178865..a1e324363db 100644 --- a/src/hotspot/share/opto/vector.cpp +++ b/src/hotspot/share/opto/vector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -353,7 +353,10 @@ Node* PhaseVector::expand_vbox_alloc_node(VectorBoxAllocateNode* vbox_alloc, int num_elem = vect_type->length(); bool is_mask = is_vector_mask(box_klass); - if (is_mask && bt != T_BOOLEAN) { + // If boxed mask value is present in a predicate register, it must be + // spilled to a vector though a VectorStoreMaskOperation before actual StoreVector + // operation to vector payload field. + if (is_mask && (value->bottom_type()->isa_vectmask() || bt != T_BOOLEAN)) { value = gvn.transform(VectorStoreMaskNode::make(gvn, value, bt, num_elem)); // Although type of mask depends on its definition, in terms of storage everything is stored in boolean array. bt = T_BOOLEAN; @@ -469,7 +472,7 @@ void PhaseVector::expand_vunbox_node(VectorUnboxNode* vec_unbox) { C->set_max_vector_size(MAX2(C->max_vector_size(), vt->length_in_bytes())); if (is_vector_mask(from_kls)) { - vec_val_load = gvn.transform(new VectorLoadMaskNode(vec_val_load, TypeVect::make(masktype, num_elem))); + vec_val_load = gvn.transform(new VectorLoadMaskNode(vec_val_load, TypeVect::makemask(masktype, num_elem))); } else if (is_vector_shuffle(from_kls) && !vec_unbox->is_shuffle_to_vector()) { assert(vec_unbox->bottom_type()->is_vect()->element_basic_type() == masktype, "expect shuffle type consistency"); vec_val_load = gvn.transform(new VectorLoadShuffleNode(vec_val_load, TypeVect::make(masktype, num_elem))); diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp index ae700ad7314..95ca0ae6d2b 100644 --- a/src/hotspot/share/opto/vectorIntrinsics.cpp +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp @@ -59,46 +59,84 @@ static bool check_vbox(const TypeInstPtr* vbox_type) { } #endif -bool LibraryCallKit::arch_supports_vector_rotate(int opc, int num_elem, BasicType elem_bt, bool has_scalar_args) { - bool is_supported = true; - // has_scalar_args flag is true only for non-constant scalar shift count, - // since in this case shift needs to be broadcasted. - if (!Matcher::match_rule_supported_vector(opc, num_elem, elem_bt) || - (has_scalar_args && - !arch_supports_vector(VectorNode::replicate_opcode(elem_bt), num_elem, elem_bt, VecMaskNotUsed))) { - is_supported = false; - } - - int lshiftopc, rshiftopc; - switch(elem_bt) { - case T_BYTE: - lshiftopc = Op_LShiftI; - rshiftopc = Op_URShiftB; - break; - case T_SHORT: - lshiftopc = Op_LShiftI; - rshiftopc = Op_URShiftS; - break; - case T_INT: - lshiftopc = Op_LShiftI; - rshiftopc = Op_URShiftI; - break; - case T_LONG: - lshiftopc = Op_LShiftL; - rshiftopc = Op_URShiftL; - break; - default: - assert(false, "Unexpected type"); - } - int lshiftvopc = VectorNode::opcode(lshiftopc, elem_bt); - int rshiftvopc = VectorNode::opcode(rshiftopc, elem_bt); - if (!is_supported && - arch_supports_vector(lshiftvopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args) && - arch_supports_vector(rshiftvopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args) && - arch_supports_vector(Op_OrV, num_elem, elem_bt, VecMaskNotUsed)) { - is_supported = true; - } - return is_supported; +static bool is_vector_mask(ciKlass* klass) { + return klass->is_subclass_of(ciEnv::current()->vector_VectorMask_klass()); +} + +static bool is_vector_shuffle(ciKlass* klass) { + return klass->is_subclass_of(ciEnv::current()->vector_VectorShuffle_klass()); +} + +bool LibraryCallKit::arch_supports_vector_rotate(int opc, int num_elem, BasicType elem_bt, + VectorMaskUseType mask_use_type, bool has_scalar_args) { + bool is_supported = true; + + // has_scalar_args flag is true only for non-constant scalar shift count, + // since in this case shift needs to be broadcasted. + if (!Matcher::match_rule_supported_vector(opc, num_elem, elem_bt) || + (has_scalar_args && + !arch_supports_vector(VectorNode::replicate_opcode(elem_bt), num_elem, elem_bt, VecMaskNotUsed))) { + is_supported = false; + } + + if (is_supported) { + // Check whether mask unboxing is supported. + if ((mask_use_type & VecMaskUseLoad) != 0) { + if (!Matcher::match_rule_supported_vector(Op_VectorLoadMask, num_elem, elem_bt)) { + #ifndef PRODUCT + if (C->print_intrinsics()) { + tty->print_cr(" ** Rejected vector mask loading (%s,%s,%d) because architecture does not support it", + NodeClassNames[Op_VectorLoadMask], type2name(elem_bt), num_elem); + } + #endif + return false; + } + } + + if ((mask_use_type & VecMaskUsePred) != 0) { + if (!Matcher::has_predicated_vectors() || + !Matcher::match_rule_supported_vector_masked(opc, num_elem, elem_bt)) { + #ifndef PRODUCT + if (C->print_intrinsics()) { + tty->print_cr("Rejected vector mask predicate using (%s,%s,%d) because architecture does not support it", + NodeClassNames[opc], type2name(elem_bt), num_elem); + } + #endif + return false; + } + } + } + + int lshiftopc, rshiftopc; + switch(elem_bt) { + case T_BYTE: + lshiftopc = Op_LShiftI; + rshiftopc = Op_URShiftB; + break; + case T_SHORT: + lshiftopc = Op_LShiftI; + rshiftopc = Op_URShiftS; + break; + case T_INT: + lshiftopc = Op_LShiftI; + rshiftopc = Op_URShiftI; + break; + case T_LONG: + lshiftopc = Op_LShiftL; + rshiftopc = Op_URShiftL; + break; + default: + assert(false, "Unexpected type"); + } + int lshiftvopc = VectorNode::opcode(lshiftopc, elem_bt); + int rshiftvopc = VectorNode::opcode(rshiftopc, elem_bt); + if (!is_supported && + arch_supports_vector(lshiftvopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args) && + arch_supports_vector(rshiftvopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args) && + arch_supports_vector(Op_OrV, num_elem, elem_bt, VecMaskNotUsed)) { + is_supported = true; + } + return is_supported; } Node* GraphKit::box_vector(Node* vector, const TypeInstPtr* vbox_type, BasicType elem_bt, int num_elem, bool deoptimize_on_exception) { @@ -115,7 +153,7 @@ Node* GraphKit::box_vector(Node* vector, const TypeInstPtr* vbox_type, BasicType Node* ret = gvn().transform(new ProjNode(alloc, TypeFunc::Parms)); assert(check_vbox(vbox_type), ""); - const TypeVect* vt = TypeVect::make(elem_bt, num_elem); + const TypeVect* vt = TypeVect::make(elem_bt, num_elem, is_vector_mask(vbox_type->klass())); VectorBoxNode* vbox = new VectorBoxNode(C, ret, vector, vbox_type, vt); return gvn().transform(vbox); } @@ -130,7 +168,7 @@ Node* GraphKit::unbox_vector(Node* v, const TypeInstPtr* vbox_type, BasicType el return NULL; // no nulls are allowed } assert(check_vbox(vbox_type), ""); - const TypeVect* vt = TypeVect::make(elem_bt, num_elem); + const TypeVect* vt = TypeVect::make(elem_bt, num_elem, is_vector_mask(vbox_type->klass())); Node* unbox = gvn().transform(new VectorUnboxNode(C, vt, v, merged_memory(), shuffle_to_vector)); return unbox; } @@ -155,7 +193,7 @@ bool LibraryCallKit::arch_supports_vector(int sopc, int num_elem, BasicType type } if (VectorNode::is_vector_rotate(sopc)) { - if(!arch_supports_vector_rotate(sopc, num_elem, type, has_scalar_args)) { + if(!arch_supports_vector_rotate(sopc, num_elem, type, mask_use_type, has_scalar_args)) { #ifndef PRODUCT if (C->print_intrinsics()) { tty->print_cr(" ** Rejected vector op (%s,%s,%d) because architecture does not support variable vector shifts", @@ -213,7 +251,7 @@ bool LibraryCallKit::arch_supports_vector(int sopc, int num_elem, BasicType type } // Check whether mask unboxing is supported. - if (mask_use_type == VecMaskUseAll || mask_use_type == VecMaskUseLoad) { + if ((mask_use_type & VecMaskUseLoad) != 0) { if (!Matcher::match_rule_supported_vector(Op_VectorLoadMask, num_elem, type)) { #ifndef PRODUCT if (C->print_intrinsics()) { @@ -226,7 +264,7 @@ bool LibraryCallKit::arch_supports_vector(int sopc, int num_elem, BasicType type } // Check whether mask boxing is supported. - if (mask_use_type == VecMaskUseAll || mask_use_type == VecMaskUseStore) { + if ((mask_use_type & VecMaskUseStore) != 0) { if (!Matcher::match_rule_supported_vector(Op_VectorStoreMask, num_elem, type)) { #ifndef PRODUCT if (C->print_intrinsics()) { @@ -238,15 +276,20 @@ bool LibraryCallKit::arch_supports_vector(int sopc, int num_elem, BasicType type } } - return true; -} - -static bool is_vector_mask(ciKlass* klass) { - return klass->is_subclass_of(ciEnv::current()->vector_VectorMask_klass()); -} + if ((mask_use_type & VecMaskUsePred) != 0) { + if (!Matcher::has_predicated_vectors() || + !Matcher::match_rule_supported_vector_masked(sopc, num_elem, type)) { + #ifndef PRODUCT + if (C->print_intrinsics()) { + tty->print_cr("Rejected vector mask predicate using (%s,%s,%d) because architecture does not support it", + NodeClassNames[sopc], type2name(type), num_elem); + } + #endif + return false; + } + } -static bool is_vector_shuffle(ciKlass* klass) { - return klass->is_subclass_of(ciEnv::current()->vector_VectorShuffle_klass()); + return true; } static bool is_klass_initialized(const TypeInstPtr* vec_klass) { @@ -259,28 +302,35 @@ static bool is_klass_initialized(const TypeInstPtr* vec_klass) { } // public static -// -// VM unaryOp(int oprId, Class vmClass, Class elementType, int length, -// VM vm, -// Function defaultImpl) { +// , +// M extends VectorMask, +// E> +// V unaryOp(int oprId, Class vmClass, Class maskClass, Class elementType, +// int length, V v, M m, +// UnaryOperation defaultImpl) // // public static -// -// VM binaryOp(int oprId, Class vmClass, Class elementType, int length, -// VM vm1, VM vm2, -// BiFunction defaultImpl) { +// , +// E> +// V binaryOp(int oprId, Class vmClass, Class maskClass, Class elementType, +// int length, V v1, V v2, M m, +// BinaryOperation defaultImpl) // // public static -// -// VM ternaryOp(int oprId, Class vmClass, Class elementType, int length, -// VM vm1, VM vm2, VM vm3, -// TernaryOperation defaultImpl) { +// , +// M extends VectorMask, +// E> +// V ternaryOp(int oprId, Class vmClass, Class maskClass, Class elementType, +// int length, V v1, V v2, V v3, M m, +// TernaryOperation defaultImpl) // bool LibraryCallKit::inline_vector_nary_operation(int n) { const TypeInt* opr = gvn().type(argument(0))->isa_int(); const TypeInstPtr* vector_klass = gvn().type(argument(1))->isa_instptr(); - const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); - const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + const TypeInstPtr* mask_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(3))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(4))->isa_int(); if (opr == NULL || vector_klass == NULL || elem_klass == NULL || vlen == NULL || !opr->is_con() || vector_klass->const_oop() == NULL || elem_klass->const_oop() == NULL || !vlen->is_con()) { @@ -288,11 +338,12 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { tty->print_cr(" ** missing constant: opr=%s vclass=%s etype=%s vlen=%s", NodeClassNames[argument(0)->Opcode()], NodeClassNames[argument(1)->Opcode()], - NodeClassNames[argument(2)->Opcode()], - NodeClassNames[argument(3)->Opcode()]); + NodeClassNames[argument(3)->Opcode()], + NodeClassNames[argument(4)->Opcode()]); } return false; // not enough info for intrinsification } + ciType* elem_type = elem_klass->const_oop()->as_instance()->java_mirror_type(); if (!elem_type->is_primitive_type()) { if (C->print_intrinsics()) { @@ -306,6 +357,34 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { } return false; } + + // "argument(n + 5)" should be the mask object. We assume it is "null" when no mask + // is used to control this operation. + const Type* vmask_type = gvn().type(argument(n + 5)); + bool is_masked_op = vmask_type != TypePtr::NULL_PTR; + if (is_masked_op) { + if (mask_klass == NULL || mask_klass->const_oop() == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** missing constant: maskclass=%s", NodeClassNames[argument(2)->Opcode()]); + } + return false; // not enough info for intrinsification + } + + if (!is_klass_initialized(mask_klass)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** mask klass argument not initialized"); + } + return false; + } + + if (vmask_type->maybe_null()) { + if (C->print_intrinsics()) { + tty->print_cr(" ** null mask values are not allowed for masked op"); + } + return false; + } + } + BasicType elem_bt = elem_type->basic_type(); int num_elem = vlen->get_con(); int opc = VectorSupport::vop2ideal(opr->get_con(), elem_bt); @@ -328,6 +407,10 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); + if (is_vector_mask(vbox_klass)) { + assert(!is_masked_op, "mask operations do not need mask to control"); + } + if (opc == Op_CallLeafVector) { if (!UseVectorStubs) { if (C->print_intrinsics()) { @@ -350,47 +433,58 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { } } - // TODO When mask usage is supported, VecMaskNotUsed needs to be VecMaskUseLoad. - if ((sopc != 0) && - !arch_supports_vector(sopc, num_elem, elem_bt, is_vector_mask(vbox_klass) ? VecMaskUseAll : VecMaskNotUsed)) { + // When using mask, mask use type needs to be VecMaskUseLoad. + VectorMaskUseType mask_use_type = is_vector_mask(vbox_klass) ? VecMaskUseAll + : is_masked_op ? VecMaskUseLoad : VecMaskNotUsed; + if ((sopc != 0) && !arch_supports_vector(sopc, num_elem, elem_bt, mask_use_type)) { if (C->print_intrinsics()) { - tty->print_cr(" ** not supported: arity=%d opc=%d vlen=%d etype=%s ismask=%d", + tty->print_cr(" ** not supported: arity=%d opc=%d vlen=%d etype=%s ismask=%d is_masked_op=%d", n, sopc, num_elem, type2name(elem_bt), - is_vector_mask(vbox_klass) ? 1 : 0); + is_vector_mask(vbox_klass) ? 1 : 0, is_masked_op ? 1 : 0); } return false; // not supported } + // Return true if current platform has implemented the masked operation with predicate feature. + bool use_predicate = is_masked_op && sopc != 0 && arch_supports_vector(sopc, num_elem, elem_bt, VecMaskUsePred); + if (is_masked_op && !use_predicate && !arch_supports_vector(Op_VectorBlend, num_elem, elem_bt, VecMaskUseLoad)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=%d opc=%d vlen=%d etype=%s ismask=0 is_masked_op=1", + n, sopc, num_elem, type2name(elem_bt)); + } + return false; + } + Node* opd1 = NULL; Node* opd2 = NULL; Node* opd3 = NULL; switch (n) { case 3: { - opd3 = unbox_vector(argument(6), vbox_type, elem_bt, num_elem); + opd3 = unbox_vector(argument(7), vbox_type, elem_bt, num_elem); if (opd3 == NULL) { if (C->print_intrinsics()) { tty->print_cr(" ** unbox failed v3=%s", - NodeClassNames[argument(6)->Opcode()]); + NodeClassNames[argument(7)->Opcode()]); } return false; } // fall-through } case 2: { - opd2 = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); + opd2 = unbox_vector(argument(6), vbox_type, elem_bt, num_elem); if (opd2 == NULL) { if (C->print_intrinsics()) { tty->print_cr(" ** unbox failed v2=%s", - NodeClassNames[argument(5)->Opcode()]); + NodeClassNames[argument(6)->Opcode()]); } return false; } // fall-through } case 1: { - opd1 = unbox_vector(argument(4), vbox_type, elem_bt, num_elem); + opd1 = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); if (opd1 == NULL) { if (C->print_intrinsics()) { tty->print_cr(" ** unbox failed v1=%s", - NodeClassNames[argument(4)->Opcode()]); + NodeClassNames[argument(5)->Opcode()]); } return false; } @@ -399,6 +493,21 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { default: fatal("unsupported arity: %d", n); } + Node* mask = NULL; + if (is_masked_op) { + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + assert(is_vector_mask(mbox_klass), "argument(2) should be a mask class"); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + mask = unbox_vector(argument(n + 5), mbox_type, elem_bt, num_elem); + if (mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed mask=%s", + NodeClassNames[argument(n + 5)->Opcode()]); + } + return false; + } + } + Node* operation = NULL; if (opc == Op_CallLeafVector) { assert(UseVectorStubs, "sanity"); @@ -413,20 +522,32 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { return false; } } else { - const TypeVect* vt = TypeVect::make(elem_bt, num_elem); + const TypeVect* vt = TypeVect::make(elem_bt, num_elem, is_vector_mask(vbox_klass)); switch (n) { case 1: case 2: { - operation = gvn().transform(VectorNode::make(sopc, opd1, opd2, vt)); + operation = VectorNode::make(sopc, opd1, opd2, vt, is_vector_mask(vbox_klass)); break; } case 3: { - operation = gvn().transform(VectorNode::make(sopc, opd1, opd2, opd3, vt)); + operation = VectorNode::make(sopc, opd1, opd2, opd3, vt); break; } default: fatal("unsupported arity: %d", n); } } + + if (is_masked_op && mask != NULL) { + if (use_predicate) { + operation->add_req(mask); + operation->add_flag(Node::Flag_is_predicated_vector); + } else { + operation = gvn().transform(operation); + operation = new VectorBlendNode(opd1, operation, mask); + } + } + operation = gvn().transform(operation); + // Wrap it up in VectorBox to keep object type information. Node* vbox = box_vector(operation, vbox_type, elem_bt, num_elem); set_result(vbox); @@ -435,7 +556,7 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { } // , E> -// Sh ShuffleIota(Class E, Class ShuffleClass, Vector.Species s, int length, +// Sh ShuffleIota(Class E, Class shuffleClass, Vector.Species s, int length, // int start, int step, int wrap, ShuffleIotaOperation defaultImpl) bool LibraryCallKit::inline_vector_shuffle_iota() { const TypeInstPtr* shuffle_klass = gvn().type(argument(1))->isa_instptr(); @@ -509,10 +630,11 @@ bool LibraryCallKit::inline_vector_shuffle_iota() { // Wrap the indices greater than lane count. res = gvn().transform(VectorNode::make(Op_AndI, res, bcast_mod, num_elem, elem_bt)); } else { - ConINode* pred_node = (ConINode*)gvn().makecon(TypeInt::make(1)); + ConINode* pred_node = (ConINode*)gvn().makecon(TypeInt::make(BoolTest::ge)); Node * lane_cnt = gvn().makecon(TypeInt::make(num_elem)); Node * bcast_lane_cnt = gvn().transform(VectorNode::scalar2vector(lane_cnt, num_elem, type_bt)); - Node* mask = gvn().transform(new VectorMaskCmpNode(BoolTest::ge, bcast_lane_cnt, res, pred_node, vt)); + const TypeVect* vmask_type = TypeVect::makemask(elem_bt, num_elem); + Node* mask = gvn().transform(new VectorMaskCmpNode(BoolTest::ge, bcast_lane_cnt, res, pred_node, vmask_type)); // Make the indices greater than lane count as -ve values. This matches the java side implementation. res = gvn().transform(VectorNode::make(Op_AndI, res, bcast_mod, num_elem, elem_bt)); @@ -531,7 +653,7 @@ bool LibraryCallKit::inline_vector_shuffle_iota() { } // -// int maskReductionCoerced(int oper, Class maskClass, Class elemClass, +// long maskReductionCoerced(int oper, Class maskClass, Class elemClass, // int length, M m, VectorMaskOp defaultImpl) bool LibraryCallKit::inline_vector_mask_operation() { const TypeInt* oper = gvn().type(argument(0))->isa_int(); @@ -576,17 +698,35 @@ bool LibraryCallKit::inline_vector_mask_operation() { ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* mask_box_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); Node* mask_vec = unbox_vector(mask, mask_box_type, elem_bt, num_elem, true); - Node* store_mask = gvn().transform(VectorStoreMaskNode::make(gvn(), mask_vec, elem_bt, num_elem)); - Node* maskoper = gvn().transform(VectorMaskOpNode::make(store_mask, TypeInt::INT, mopc)); + if (mask_vec == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed mask=%s", + NodeClassNames[argument(4)->Opcode()]); + } + return false; + } + + if (mask_vec->bottom_type()->isa_vectmask() == NULL) { + mask_vec = gvn().transform(VectorStoreMaskNode::make(gvn(), mask_vec, elem_bt, num_elem)); + } + const Type* maskoper_ty = mopc == Op_VectorMaskToLong ? (const Type*)TypeLong::LONG : (const Type*)TypeInt::INT; + Node* maskoper = gvn().transform(VectorMaskOpNode::make(mask_vec, maskoper_ty, mopc)); + if (mopc != Op_VectorMaskToLong) { + maskoper = ConvI2L(maskoper); + } set_result(maskoper); C->set_max_vector_size(MAX2(C->max_vector_size(), (uint)(num_elem * type2aelembytes(elem_bt)))); return true; } -// , E> -// VM shuffleToVector(Class VecClass, ClassE , Class ShuffleClass, Sh s, int length, -// ShuffleToVectorOperation defaultImpl) +// public static +// , +// E> +// V shuffleToVector(Class> vclass, Class elementType, +// Class shuffleClass, Sh s, int length, +// ShuffleToVectorOperation defaultImpl) bool LibraryCallKit::inline_vector_shuffle_to_vector() { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); const TypeInstPtr* elem_klass = gvn().type(argument(1))->isa_instptr(); @@ -645,10 +785,13 @@ bool LibraryCallKit::inline_vector_shuffle_to_vector() { return true; } -// > -// V broadcastCoerced(Class vectorClass, Class elementType, int vlen, -// long bits, -// LongFunction defaultImpl) +// public static +// , +// E> +// M broadcastCoerced(Class vmClass, Class elementType, int length, +// long bits, S s, +// BroadcastOperation defaultImpl) bool LibraryCallKit::inline_vector_broadcast_coerced() { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); const TypeInstPtr* elem_klass = gvn().type(argument(1))->isa_instptr(); @@ -695,7 +838,6 @@ bool LibraryCallKit::inline_vector_broadcast_coerced() { } Node* bits = argument(3); // long - Node* elem = NULL; switch (elem_bt) { case T_BOOLEAN: // fall-through @@ -722,7 +864,7 @@ bool LibraryCallKit::inline_vector_broadcast_coerced() { default: fatal("%s", type2name(elem_bt)); } - Node* broadcast = VectorNode::scalar2vector(elem, num_elem, Type::get_const_basic_type(elem_bt)); + Node* broadcast = VectorNode::scalar2vector(elem, num_elem, Type::get_const_basic_type(elem_bt), is_vector_mask(vbox_klass)); broadcast = gvn().transform(broadcast); Node* box = box_vector(broadcast, vbox_type, elem_bt, num_elem); @@ -747,19 +889,24 @@ static bool elem_consistent_with_arr(BasicType elem_bt, const TypeAryPtr* arr_ty } } -// > -// V load(Class vectorClass, Class elementType, int vlen, -// Object base, long offset, -// /* Vector.Mask m*/ -// Object container, int index, -// LoadOperation defaultImpl) { +// public static +// > +// VM load(Class vmClass, Class elementType, int length, +// Object base, long offset, // Unsafe addressing +// C container, int index, S s, // Arguments for default implementation +// LoadOperation defaultImpl) // -// > -// void store(Class vectorClass, Class elementType, int vlen, -// Object base, long offset, -// V v, /*Vector.Mask m*/ -// Object container, int index, -// StoreVectorOperation defaultImpl) { +// public static +// > +// void store(Class vectorClass, Class elementType, int length, +// Object base, long offset, // Unsafe addressing +// V v, +// C container, int index, // Arguments for default implementation +// StoreVectorOperation defaultImpl) bool LibraryCallKit::inline_vector_mem_operation(bool is_store) { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); @@ -814,12 +961,23 @@ bool LibraryCallKit::inline_vector_mem_operation(bool is_store) { SafePointNode* old_map = clone_map(); Node* addr = make_unsafe_address(base, offset, (is_mask ? T_BOOLEAN : elem_bt), true); - // Can base be NULL? Otherwise, always on-heap access. - bool can_access_non_heap = TypePtr::NULL_PTR->higher_equal(gvn().type(base)); + + // The memory barrier checks are based on ones for unsafe access. + // This is not 1-1 implementation. + const Type *const base_type = gvn().type(base); const TypePtr *addr_type = gvn().type(addr)->isa_ptr(); const TypeAryPtr* arr_type = addr_type->isa_aryptr(); + const bool in_native = TypePtr::NULL_PTR == base_type; // base always null + const bool in_heap = !TypePtr::NULL_PTR->higher_equal(base_type); // base never null + + const bool is_mixed_access = !in_heap && !in_native; + + const bool is_mismatched_access = in_heap && (addr_type->isa_aryptr() == NULL); + + const bool needs_cpu_membar = is_mixed_access || is_mismatched_access; + // Now handle special case where load/store happens from/to byte array but element type is not byte. bool using_byte_array = arr_type != NULL && arr_type->elem()->array_element_basic_type() == T_BYTE && elem_bt != T_BYTE; // Handle loading masks. @@ -877,7 +1035,7 @@ bool LibraryCallKit::inline_vector_mem_operation(bool is_store) { const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); - if (can_access_non_heap) { + if (needs_cpu_membar) { insert_mem_bar(Op_MemBarCPUOrder); } @@ -912,8 +1070,7 @@ bool LibraryCallKit::inline_vector_mem_operation(bool is_store) { // Special handle for masks if (is_mask) { vload = gvn().transform(LoadVectorNode::make(0, control(), memory(addr), addr, addr_type, num_elem, T_BOOLEAN)); - const TypeVect* to_vect_type = TypeVect::make(elem_bt, num_elem); - vload = gvn().transform(new VectorLoadMaskNode(vload, to_vect_type)); + vload = gvn().transform(new VectorLoadMaskNode(vload, TypeVect::makemask(elem_bt, num_elem))); } else { vload = gvn().transform(LoadVectorNode::make(0, control(), memory(addr), addr, addr_type, num_elem, elem_bt)); } @@ -924,6 +1081,243 @@ bool LibraryCallKit::inline_vector_mem_operation(bool is_store) { old_map->destruct(&_gvn); + if (needs_cpu_membar) { + insert_mem_bar(Op_MemBarCPUOrder); + } + + C->set_max_vector_size(MAX2(C->max_vector_size(), (uint)(num_elem * type2aelembytes(elem_bt)))); + return true; +} + +// public static +// , +// E, +// S extends VectorSpecies, +// M extends VectorMask> +// V loadMasked(Class vectorClass, Class maskClass, Class elementType, +// int length, Object base, long offset, M m, +// C container, int index, S s, // Arguments for default implementation +// LoadVectorMaskedOperation defaultImpl) { +// +// public static +// , +// M extends VectorMask, +// E> +// void storeMasked(Class vectorClass, Class maskClass, Class elementType, +// int length, Object base, long offset, +// V v, M m, +// C container, int index, // Arguments for default implementation +// StoreVectorMaskedOperation defaultImpl) { +// +bool LibraryCallKit::inline_vector_mem_masked_operation(bool is_store) { + const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); + const TypeInstPtr* mask_klass = gvn().type(argument(1))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + + if (vector_klass == NULL || mask_klass == NULL || elem_klass == NULL || vlen == NULL || + vector_klass->const_oop() == NULL || mask_klass->const_oop() == NULL || + elem_klass->const_oop() == NULL || !vlen->is_con()) { + if (C->print_intrinsics()) { + tty->print_cr(" ** missing constant: vclass=%s mclass=%s etype=%s vlen=%s", + NodeClassNames[argument(0)->Opcode()], + NodeClassNames[argument(1)->Opcode()], + NodeClassNames[argument(2)->Opcode()], + NodeClassNames[argument(3)->Opcode()]); + } + return false; // not enough info for intrinsification + } + if (!is_klass_initialized(vector_klass)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** klass argument not initialized"); + } + return false; + } + + if (!is_klass_initialized(mask_klass)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** mask klass argument not initialized"); + } + return false; + } + + ciType* elem_type = elem_klass->const_oop()->as_instance()->java_mirror_type(); + if (!elem_type->is_primitive_type()) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not a primitive bt=%d", elem_type->basic_type()); + } + return false; // should be primitive type + } + + BasicType elem_bt = elem_type->basic_type(); + int num_elem = vlen->get_con(); + + Node* base = argument(4); + Node* offset = ConvL2X(argument(5)); + + // Save state and restore on bailout + uint old_sp = sp(); + SafePointNode* old_map = clone_map(); + + Node* addr = make_unsafe_address(base, offset, elem_bt, true); + const TypePtr *addr_type = gvn().type(addr)->isa_ptr(); + const TypeAryPtr* arr_type = addr_type->isa_aryptr(); + + // Now handle special case where load/store happens from/to byte array but element type is not byte. + bool using_byte_array = arr_type != NULL && arr_type->elem()->array_element_basic_type() == T_BYTE && elem_bt != T_BYTE; + // If there is no consistency between array and vector element types, it must be special byte array case + if (arr_type != NULL && !using_byte_array && !elem_consistent_with_arr(elem_bt, arr_type)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=%d op=%s vlen=%d etype=%s atype=%s", + is_store, is_store ? "storeMasked" : "loadMasked", + num_elem, type2name(elem_bt), type2name(arr_type->elem()->array_element_basic_type())); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + + int mem_num_elem = using_byte_array ? num_elem * type2aelembytes(elem_bt) : num_elem; + BasicType mem_elem_bt = using_byte_array ? T_BYTE : elem_bt; + bool use_predicate = arch_supports_vector(is_store ? Op_StoreVectorMasked : Op_LoadVectorMasked, + mem_num_elem, mem_elem_bt, + (VectorMaskUseType) (VecMaskUseLoad | VecMaskUsePred)); + // Masked vector store operation needs the architecture predicate feature. We need to check + // whether the predicated vector operation is supported by backend. + if (is_store && !use_predicate) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: op=storeMasked vlen=%d etype=%s using_byte_array=%d", + num_elem, type2name(elem_bt), using_byte_array ? 1 : 0); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + + // This only happens for masked vector load. If predicate is not supported, then check whether + // the normal vector load and blend operations are supported by backend. + if (!use_predicate && (!arch_supports_vector(Op_LoadVector, mem_num_elem, mem_elem_bt, VecMaskNotUsed) || + !arch_supports_vector(Op_VectorBlend, mem_num_elem, mem_elem_bt, VecMaskUseLoad))) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: op=loadMasked vlen=%d etype=%s using_byte_array=%d", + num_elem, type2name(elem_bt), using_byte_array ? 1 : 0); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + + // Since we are using byte array, we need to double check that the vector reinterpret operation + // with byte type is supported by backend. + if (using_byte_array) { + if (!arch_supports_vector(Op_VectorReinterpret, mem_num_elem, T_BYTE, VecMaskNotUsed)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=%d op=%s vlen=%d etype=%s using_byte_array=1", + is_store, is_store ? "storeMasked" : "loadMasked", + num_elem, type2name(elem_bt)); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + } + + // Since it needs to unbox the mask, we need to double check that the related load operations + // for mask are supported by backend. + if (!arch_supports_vector(Op_LoadVector, num_elem, elem_bt, VecMaskUseLoad)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=%d op=%s vlen=%d etype=%s", + is_store, is_store ? "storeMasked" : "loadMasked", + num_elem, type2name(elem_bt)); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + + // Can base be NULL? Otherwise, always on-heap access. + bool can_access_non_heap = TypePtr::NULL_PTR->higher_equal(gvn().type(base)); + if (can_access_non_heap) { + insert_mem_bar(Op_MemBarCPUOrder); + } + + ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + assert(!is_vector_mask(vbox_klass) && is_vector_mask(mbox_klass), "Invalid class type"); + const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + + Node* mask = unbox_vector(is_store ? argument(8) : argument(7), mbox_type, elem_bt, num_elem); + if (mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed mask=%s", + is_store ? NodeClassNames[argument(8)->Opcode()] + : NodeClassNames[argument(7)->Opcode()]); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + + if (is_store) { + Node* val = unbox_vector(argument(7), vbox_type, elem_bt, num_elem); + if (val == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed vector=%s", + NodeClassNames[argument(7)->Opcode()]); + } + set_map(old_map); + set_sp(old_sp); + return false; // operand unboxing failed + } + set_all_memory(reset_memory()); + + if (using_byte_array) { + // Reinterpret the incoming vector to byte vector. + const TypeVect* to_vect_type = TypeVect::make(mem_elem_bt, mem_num_elem); + val = gvn().transform(new VectorReinterpretNode(val, val->bottom_type()->is_vect(), to_vect_type)); + // Reinterpret the vector mask to byte type. + const TypeVect* from_mask_type = TypeVect::makemask(elem_bt, num_elem); + const TypeVect* to_mask_type = TypeVect::makemask(mem_elem_bt, mem_num_elem); + mask = gvn().transform(new VectorReinterpretNode(mask, from_mask_type, to_mask_type)); + } + Node* vstore = gvn().transform(new StoreVectorMaskedNode(control(), memory(addr), addr, val, addr_type, mask)); + set_memory(vstore, addr_type); + } else { + Node* vload = NULL; + + if (using_byte_array) { + // Reinterpret the vector mask to byte type. + const TypeVect* from_mask_type = TypeVect::makemask(elem_bt, num_elem); + const TypeVect* to_mask_type = TypeVect::makemask(mem_elem_bt, mem_num_elem); + mask = gvn().transform(new VectorReinterpretNode(mask, from_mask_type, to_mask_type)); + } + + if (use_predicate) { + // Generate masked load vector node if predicate feature is supported. + const TypeVect* vt = TypeVect::make(mem_elem_bt, mem_num_elem); + vload = gvn().transform(new LoadVectorMaskedNode(control(), memory(addr), addr, addr_type, vt, mask)); + } else { + // Use the vector blend to implement the masked load vector. The biased elements are zeros. + Node* zero = gvn().transform(gvn().zerocon(mem_elem_bt)); + zero = gvn().transform(VectorNode::scalar2vector(zero, mem_num_elem, Type::get_const_basic_type(mem_elem_bt))); + vload = gvn().transform(LoadVectorNode::make(0, control(), memory(addr), addr, addr_type, mem_num_elem, mem_elem_bt)); + vload = gvn().transform(new VectorBlendNode(zero, vload, mask)); + } + + if (using_byte_array) { + const TypeVect* to_vect_type = TypeVect::make(elem_bt, num_elem); + vload = gvn().transform(new VectorReinterpretNode(vload, vload->bottom_type()->is_vect(), to_vect_type)); + } + + Node* box = box_vector(vload, vbox_type, elem_bt, num_elem); + set_result(box); + } + + old_map->destruct(&_gvn); + if (can_access_non_heap) { insert_mem_bar(Op_MemBarCPUOrder); } @@ -932,34 +1326,45 @@ bool LibraryCallKit::inline_vector_mem_operation(bool is_store) { return true; } -// , W extends IntVector, E, S extends VectorSpecies> -// void loadWithMap(Class vectorClass, Class E, int length, Class vectorIndexClass, -// Object base, long offset, // Unsafe addressing -// W index_vector, -// C container, int index, int[] indexMap, int indexM, S s, // Arguments for default implementation -// LoadVectorOperationWithMap defaultImpl) +// , +// W extends Vector, +// S extends VectorSpecies, +// M extends VectorMask, +// E> +// V loadWithMap(Class vectorClass, Class maskClass, Class elementType, int length, +// Class> vectorIndexClass, +// Object base, long offset, // Unsafe addressing +// W index_vector, M m, +// C container, int index, int[] indexMap, int indexM, S s, // Arguments for default implementation +// LoadVectorOperationWithMap defaultImpl) // -// , W extends IntVector> -// void storeWithMap(Class vectorClass, Class elementType, int length, Class vectorIndexClass, -// Object base, long offset, // Unsafe addressing -// W index_vector, V v, -// C container, int index, int[] indexMap, int indexM, // Arguments for default implementation -// StoreVectorOperationWithMap defaultImpl) { +// , +// W extends Vector, +// M extends VectorMask, +// E> +// void storeWithMap(Class vectorClass, Class maskClass, Class elementType, +// int length, Class> vectorIndexClass, Object base, long offset, // Unsafe addressing +// W index_vector, V v, M m, +// C container, int index, int[] indexMap, int indexM, // Arguments for default implementation +// StoreVectorOperationWithMap defaultImpl) // bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); - const TypeInstPtr* elem_klass = gvn().type(argument(1))->isa_instptr(); - const TypeInt* vlen = gvn().type(argument(2))->isa_int(); - const TypeInstPtr* vector_idx_klass = gvn().type(argument(3))->isa_instptr(); + const TypeInstPtr* mask_klass = gvn().type(argument(1))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + const TypeInstPtr* vector_idx_klass = gvn().type(argument(4))->isa_instptr(); if (vector_klass == NULL || elem_klass == NULL || vector_idx_klass == NULL || vlen == NULL || vector_klass->const_oop() == NULL || elem_klass->const_oop() == NULL || vector_idx_klass->const_oop() == NULL || !vlen->is_con()) { if (C->print_intrinsics()) { tty->print_cr(" ** missing constant: vclass=%s etype=%s vlen=%s viclass=%s", NodeClassNames[argument(0)->Opcode()], - NodeClassNames[argument(1)->Opcode()], NodeClassNames[argument(2)->Opcode()], - NodeClassNames[argument(3)->Opcode()]); + NodeClassNames[argument(3)->Opcode()], + NodeClassNames[argument(4)->Opcode()]); } return false; // not enough info for intrinsification } @@ -970,6 +1375,7 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { } return false; } + ciType* elem_type = elem_klass->const_oop()->as_instance()->java_mirror_type(); if (!elem_type->is_primitive_type()) { if (C->print_intrinsics()) { @@ -977,30 +1383,68 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { } return false; // should be primitive type } + BasicType elem_bt = elem_type->basic_type(); int num_elem = vlen->get_con(); - if (!arch_supports_vector(is_scatter ? Op_StoreVectorScatter : Op_LoadVectorGather, num_elem, elem_bt, VecMaskNotUsed)) { - if (C->print_intrinsics()) { - tty->print_cr(" ** not supported: arity=%d op=%s vlen=%d etype=%s ismask=no", - is_scatter, is_scatter ? "scatter" : "gather", - num_elem, type2name(elem_bt)); + const Type* vmask_type = gvn().type(is_scatter ? argument(10) : argument(9)); + bool is_masked_op = vmask_type != TypePtr::NULL_PTR; + if (is_masked_op) { + if (mask_klass == NULL || mask_klass->const_oop() == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** missing constant: maskclass=%s", NodeClassNames[argument(1)->Opcode()]); + } + return false; // not enough info for intrinsification + } + + if (!is_klass_initialized(mask_klass)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** mask klass argument not initialized"); + } + return false; + } + + if (vmask_type->maybe_null()) { + if (C->print_intrinsics()) { + tty->print_cr(" ** null mask values are not allowed for masked op"); + } + return false; + } + + // Check whether the predicated gather/scatter node is supported by architecture. + if (!arch_supports_vector(is_scatter ? Op_StoreVectorScatterMasked : Op_LoadVectorGatherMasked, num_elem, elem_bt, + (VectorMaskUseType) (VecMaskUseLoad | VecMaskUsePred))) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=%d op=%s vlen=%d etype=%s is_masked_op=1", + is_scatter, is_scatter ? "scatterMasked" : "gatherMasked", + num_elem, type2name(elem_bt)); + } + return false; // not supported + } + } else { + // Check whether the normal gather/scatter node is supported for non-masked operation. + if (!arch_supports_vector(is_scatter ? Op_StoreVectorScatter : Op_LoadVectorGather, num_elem, elem_bt, VecMaskNotUsed)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=%d op=%s vlen=%d etype=%s is_masked_op=0", + is_scatter, is_scatter ? "scatter" : "gather", + num_elem, type2name(elem_bt)); + } + return false; // not supported } - return false; // not supported } // Check that the vector holding indices is supported by architecture if (!arch_supports_vector(Op_LoadVector, num_elem, T_INT, VecMaskNotUsed)) { if (C->print_intrinsics()) { - tty->print_cr(" ** not supported: arity=%d op=%s/loadindex vlen=%d etype=int ismask=no", + tty->print_cr(" ** not supported: arity=%d op=%s/loadindex vlen=%d etype=int is_masked_op=%d", is_scatter, is_scatter ? "scatter" : "gather", - num_elem); + num_elem, is_masked_op ? 1 : 0); } return false; // not supported - } + } - Node* base = argument(4); - Node* offset = ConvL2X(argument(5)); + Node* base = argument(5); + Node* offset = ConvL2X(argument(6)); // Save state and restore on bailout uint old_sp = sp(); @@ -1022,11 +1466,10 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { set_sp(old_sp); return false; } + ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); - ciKlass* vbox_idx_klass = vector_idx_klass->const_oop()->as_instance()->java_lang_Class_klass(); - if (vbox_idx_klass == NULL) { set_map(old_map); set_sp(old_sp); @@ -1034,16 +1477,33 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { } const TypeInstPtr* vbox_idx_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_idx_klass); - - Node* index_vect = unbox_vector(argument(7), vbox_idx_type, T_INT, num_elem); + Node* index_vect = unbox_vector(argument(8), vbox_idx_type, T_INT, num_elem); if (index_vect == NULL) { set_map(old_map); set_sp(old_sp); return false; } + + Node* mask = NULL; + if (is_masked_op) { + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + mask = unbox_vector(is_scatter ? argument(10) : argument(9), mbox_type, elem_bt, num_elem); + if (mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed mask=%s", + is_scatter ? NodeClassNames[argument(10)->Opcode()] + : NodeClassNames[argument(9)->Opcode()]); + } + set_map(old_map); + set_sp(old_sp); + return false; + } + } + const TypeVect* vector_type = TypeVect::make(elem_bt, num_elem); if (is_scatter) { - Node* val = unbox_vector(argument(8), vbox_type, elem_bt, num_elem); + Node* val = unbox_vector(argument(9), vbox_type, elem_bt, num_elem); if (val == NULL) { set_map(old_map); set_sp(old_sp); @@ -1051,11 +1511,20 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { } set_all_memory(reset_memory()); - Node* vstore = gvn().transform(new StoreVectorScatterNode(control(), memory(addr), addr, addr_type, val, index_vect)); + Node* vstore = NULL; + if (mask != NULL) { + vstore = gvn().transform(new StoreVectorScatterMaskedNode(control(), memory(addr), addr, addr_type, val, index_vect, mask)); + } else { + vstore = gvn().transform(new StoreVectorScatterNode(control(), memory(addr), addr, addr_type, val, index_vect)); + } set_memory(vstore, addr_type); } else { - Node* vload = gvn().transform(new LoadVectorGatherNode(control(), memory(addr), addr, addr_type, vector_type, index_vect)); - + Node* vload = NULL; + if (mask != NULL) { + vload = gvn().transform(new LoadVectorGatherMaskedNode(control(), memory(addr), addr, addr_type, vector_type, index_vect, mask)); + } else { + vload = gvn().transform(new LoadVectorGatherNode(control(), memory(addr), addr, addr_type, vector_type, index_vect)); + } Node* box = box_vector(vload, vbox_type, elem_bt, num_elem); set_result(box); } @@ -1066,16 +1535,19 @@ bool LibraryCallKit::inline_vector_gather_scatter(bool is_scatter) { return true; } -// > -// long reductionCoerced(int oprId, Class vectorClass, Class elementType, int vlen, -// V v, -// Function defaultImpl) - +// public static +// , +// M extends VectorMask, +// E> +// long reductionCoerced(int oprId, Class vectorClass, Class maskClass, +// Class elementType, int length, V v, M m, +// ReductionOperation defaultImpl) bool LibraryCallKit::inline_vector_reduction() { const TypeInt* opr = gvn().type(argument(0))->isa_int(); const TypeInstPtr* vector_klass = gvn().type(argument(1))->isa_instptr(); - const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); - const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + const TypeInstPtr* mask_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(3))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(4))->isa_int(); if (opr == NULL || vector_klass == NULL || elem_klass == NULL || vlen == NULL || !opr->is_con() || vector_klass->const_oop() == NULL || elem_klass->const_oop() == NULL || !vlen->is_con()) { @@ -1083,8 +1555,8 @@ bool LibraryCallKit::inline_vector_reduction() { tty->print_cr(" ** missing constant: opr=%s vclass=%s etype=%s vlen=%s", NodeClassNames[argument(0)->Opcode()], NodeClassNames[argument(1)->Opcode()], - NodeClassNames[argument(2)->Opcode()], - NodeClassNames[argument(3)->Opcode()]); + NodeClassNames[argument(3)->Opcode()], + NodeClassNames[argument(4)->Opcode()]); } return false; // not enough info for intrinsification } @@ -1101,16 +1573,51 @@ bool LibraryCallKit::inline_vector_reduction() { } return false; // should be primitive type } + + const Type* vmask_type = gvn().type(argument(6)); + bool is_masked_op = vmask_type != TypePtr::NULL_PTR; + if (is_masked_op) { + if (mask_klass == NULL || mask_klass->const_oop() == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** missing constant: maskclass=%s", NodeClassNames[argument(2)->Opcode()]); + } + return false; // not enough info for intrinsification + } + + if (!is_klass_initialized(mask_klass)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** mask klass argument not initialized"); + } + return false; + } + + if (vmask_type->maybe_null()) { + if (C->print_intrinsics()) { + tty->print_cr(" ** null mask values are not allowed for masked op"); + } + return false; + } + } + BasicType elem_bt = elem_type->basic_type(); int num_elem = vlen->get_con(); - int opc = VectorSupport::vop2ideal(opr->get_con(), elem_bt); int sopc = ReductionNode::opcode(opc, elem_bt); - // TODO When mask usage is supported, VecMaskNotUsed needs to be VecMaskUseLoad. - if (!arch_supports_vector(sopc, num_elem, elem_bt, VecMaskNotUsed)) { + // When using mask, mask use type needs to be VecMaskUseLoad. + if (!arch_supports_vector(sopc, num_elem, elem_bt, is_masked_op ? VecMaskUseLoad : VecMaskNotUsed)) { if (C->print_intrinsics()) { - tty->print_cr(" ** not supported: arity=1 op=%d/reduce vlen=%d etype=%s ismask=no", + tty->print_cr(" ** not supported: arity=1 op=%d/reduce vlen=%d etype=%s is_masked_op=%d", + sopc, num_elem, type2name(elem_bt), is_masked_op ? 1 : 0); + } + return false; + } + + // Return true if current platform has implemented the masked operation with predicate feature. + bool use_predicate = is_masked_op && arch_supports_vector(sopc, num_elem, elem_bt, VecMaskUsePred); + if (is_masked_op && !use_predicate && !arch_supports_vector(Op_VectorBlend, num_elem, elem_bt, VecMaskUseLoad)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=1 op=%d/reduce vlen=%d etype=%s is_masked_op=1", sopc, num_elem, type2name(elem_bt)); } return false; @@ -1119,33 +1626,63 @@ bool LibraryCallKit::inline_vector_reduction() { ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); - Node* opd = unbox_vector(argument(4), vbox_type, elem_bt, num_elem); + Node* opd = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); if (opd == NULL) { return false; // operand unboxing failed } + Node* mask = NULL; + if (is_masked_op) { + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + assert(is_vector_mask(mbox_klass), "argument(2) should be a mask class"); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + mask = unbox_vector(argument(6), mbox_type, elem_bt, num_elem); + if (mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed mask=%s", + NodeClassNames[argument(6)->Opcode()]); + } + return false; + } + } + Node* init = ReductionNode::make_reduction_input(gvn(), opc, elem_bt); - Node* rn = gvn().transform(ReductionNode::make(opc, NULL, init, opd, elem_bt)); + Node* value = NULL; + if (mask == NULL) { + assert(!is_masked_op, "Masked op needs the mask value never null"); + value = ReductionNode::make(opc, NULL, init, opd, elem_bt); + } else { + if (use_predicate) { + value = ReductionNode::make(opc, NULL, init, opd, elem_bt); + value->add_req(mask); + value->add_flag(Node::Flag_is_predicated_vector); + } else { + Node* reduce_identity = gvn().transform(VectorNode::scalar2vector(init, num_elem, Type::get_const_basic_type(elem_bt))); + value = gvn().transform(new VectorBlendNode(reduce_identity, opd, mask)); + value = ReductionNode::make(opc, NULL, init, value, elem_bt); + } + } + value = gvn().transform(value); Node* bits = NULL; switch (elem_bt) { case T_BYTE: case T_SHORT: case T_INT: { - bits = gvn().transform(new ConvI2LNode(rn)); + bits = gvn().transform(new ConvI2LNode(value)); break; } case T_FLOAT: { - rn = gvn().transform(new MoveF2INode(rn)); - bits = gvn().transform(new ConvI2LNode(rn)); + value = gvn().transform(new MoveF2INode(value)); + bits = gvn().transform(new ConvI2LNode(value)); break; } case T_DOUBLE: { - bits = gvn().transform(new MoveD2LNode(rn)); + bits = gvn().transform(new MoveD2LNode(value)); break; } case T_LONG: { - bits = rn; // no conversion needed + bits = value; // no conversion needed break; } default: fatal("%s", type2name(elem_bt)); @@ -1157,7 +1694,7 @@ bool LibraryCallKit::inline_vector_reduction() { // public static boolean test(int cond, Class vectorClass, Class elementType, int vlen, // V v1, V v2, -// BiFunction defaultImpl) { +// BiFunction defaultImpl) // bool LibraryCallKit::inline_vector_test() { const TypeInt* cond = gvn().type(argument(0))->isa_int(); @@ -1218,11 +1755,12 @@ bool LibraryCallKit::inline_vector_test() { } // public static -// -// V blend(Class vectorClass, Class maskClass, Class elementType, int vlen, +// , +// M extends VectorMask, +// E> +// V blend(Class vectorClass, Class maskClass, Class elementType, int vlen, // V v1, V v2, M m, -// VectorBlendOp defaultImpl) { ... -// +// VectorBlendOp defaultImpl) bool LibraryCallKit::inline_vector_blend() { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); const TypeInstPtr* mask_klass = gvn().type(argument(1))->isa_instptr(); @@ -1289,13 +1827,13 @@ bool LibraryCallKit::inline_vector_blend() { return true; } -// public static , -// M extends Vector.Mask, -// S extends Vector.Shape, E> -// M compare(int cond, Class vectorClass, Class maskClass, Class elementType, int vlen, -// V v1, V v2, -// VectorCompareOp defaultImpl) { ... -// +// public static +// , +// M extends VectorMask, +// E> +// M compare(int cond, Class vectorClass, Class maskClass, Class elementType, int vlen, +// V v1, V v2, M m, +// VectorCompareOp defaultImpl) bool LibraryCallKit::inline_vector_compare() { const TypeInt* cond = gvn().type(argument(0))->isa_int(); const TypeInstPtr* vector_klass = gvn().type(argument(1))->isa_instptr(); @@ -1363,14 +1901,45 @@ bool LibraryCallKit::inline_vector_compare() { Node* v1 = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); Node* v2 = unbox_vector(argument(6), vbox_type, elem_bt, num_elem); + bool is_masked_op = argument(7)->bottom_type() != TypePtr::NULL_PTR; + Node* mask = is_masked_op ? unbox_vector(argument(7), mbox_type, elem_bt, num_elem) : NULL; + if (is_masked_op && mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: mask = null arity=2 op=comp/%d vlen=%d etype=%s ismask=usestore is_masked_op=1", + cond->get_con(), num_elem, type2name(elem_bt)); + } + return false; + } + + bool use_predicate = is_masked_op && arch_supports_vector(Op_VectorMaskCmp, num_elem, elem_bt, VecMaskUsePred); + if (is_masked_op && !use_predicate && !arch_supports_vector(Op_AndV, num_elem, elem_bt, VecMaskUseLoad)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=2 op=comp/%d vlen=%d etype=%s ismask=usestore is_masked_op=1", + cond->get_con(), num_elem, type2name(elem_bt)); + } + return false; + } + if (v1 == NULL || v2 == NULL) { return false; // operand unboxing failed } BoolTest::mask pred = (BoolTest::mask)cond->get_con(); ConINode* pred_node = (ConINode*)gvn().makecon(cond); - const TypeVect* vt = TypeVect::make(mask_bt, num_elem); - Node* operation = gvn().transform(new VectorMaskCmpNode(pred, v1, v2, pred_node, vt)); + const TypeVect* vmask_type = TypeVect::makemask(mask_bt, num_elem); + Node* operation = new VectorMaskCmpNode(pred, v1, v2, pred_node, vmask_type); + + if (is_masked_op) { + if (use_predicate) { + operation->add_req(mask); + operation->add_flag(Node::Flag_is_predicated_vector); + } else { + operation = gvn().transform(operation); + operation = VectorNode::make(Op_AndV, operation, mask, vmask_type); + } + } + + operation = gvn().transform(operation); Node* box = box_vector(operation, mbox_type, mask_bt, num_elem); set_result(box); @@ -1379,32 +1948,38 @@ bool LibraryCallKit::inline_vector_compare() { } // public static -// -// V rearrangeOp(Class vectorClass, Class shuffleClass, Class< ? > elementType, int vlen, -// V v1, Sh sh, -// VectorSwizzleOp defaultImpl) { ... - +// , +// Sh extends VectorShuffle, +// M extends VectorMask, +// E> +// V rearrangeOp(Class vectorClass, Class shuffleClass, Class maskClass, Class elementType, int vlen, +// V v1, Sh sh, M m, +// VectorRearrangeOp defaultImpl) bool LibraryCallKit::inline_vector_rearrange() { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); const TypeInstPtr* shuffle_klass = gvn().type(argument(1))->isa_instptr(); - const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); - const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + const TypeInstPtr* mask_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(3))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(4))->isa_int(); - if (vector_klass == NULL || shuffle_klass == NULL || elem_klass == NULL || vlen == NULL) { + if (vector_klass == NULL || shuffle_klass == NULL || elem_klass == NULL || vlen == NULL) { return false; // dead code } - if (shuffle_klass->const_oop() == NULL || vector_klass->const_oop() == NULL || - elem_klass->const_oop() == NULL || !vlen->is_con()) { + if (shuffle_klass->const_oop() == NULL || + vector_klass->const_oop() == NULL || + elem_klass->const_oop() == NULL || + !vlen->is_con()) { if (C->print_intrinsics()) { tty->print_cr(" ** missing constant: vclass=%s sclass=%s etype=%s vlen=%s", NodeClassNames[argument(0)->Opcode()], NodeClassNames[argument(1)->Opcode()], - NodeClassNames[argument(2)->Opcode()], - NodeClassNames[argument(3)->Opcode()]); + NodeClassNames[argument(3)->Opcode()], + NodeClassNames[argument(4)->Opcode()]); } return false; // not enough info for intrinsification } - if (!is_klass_initialized(vector_klass) || !is_klass_initialized(shuffle_klass)) { + if (!is_klass_initialized(vector_klass) || + !is_klass_initialized(shuffle_klass)) { if (C->print_intrinsics()) { tty->print_cr(" ** klass argument not initialized"); } @@ -1428,12 +2003,30 @@ bool LibraryCallKit::inline_vector_rearrange() { } return false; // not supported } - if (!arch_supports_vector(Op_VectorRearrange, num_elem, elem_bt, VecMaskNotUsed)) { + + bool is_masked_op = argument(7)->bottom_type() != TypePtr::NULL_PTR; + bool use_predicate = is_masked_op; + if (is_masked_op && + (mask_klass == NULL || + mask_klass->const_oop() == NULL || + !is_klass_initialized(mask_klass))) { if (C->print_intrinsics()) { - tty->print_cr(" ** not supported: arity=2 op=shuffle/rearrange vlen=%d etype=%s ismask=no", - num_elem, type2name(elem_bt)); + tty->print_cr(" ** mask_klass argument not initialized"); + } + } + VectorMaskUseType checkFlags = (VectorMaskUseType)(is_masked_op ? (VecMaskUseLoad | VecMaskUsePred) : VecMaskNotUsed); + if (!arch_supports_vector(Op_VectorRearrange, num_elem, elem_bt, checkFlags)) { + use_predicate = false; + if(!is_masked_op || + (!arch_supports_vector(Op_VectorRearrange, num_elem, elem_bt, VecMaskNotUsed) || + !arch_supports_vector(Op_VectorBlend, num_elem, elem_bt, VecMaskUseLoad) || + !arch_supports_vector(VectorNode::replicate_opcode(elem_bt), num_elem, elem_bt, VecMaskNotUsed))) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=2 op=shuffle/rearrange vlen=%d etype=%s ismask=no", + num_elem, type2name(elem_bt)); + } + return false; // not supported } - return false; // not supported } ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); @@ -1441,14 +2034,41 @@ bool LibraryCallKit::inline_vector_rearrange() { ciKlass* shbox_klass = shuffle_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* shbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, shbox_klass); - Node* v1 = unbox_vector(argument(4), vbox_type, elem_bt, num_elem); - Node* shuffle = unbox_vector(argument(5), shbox_type, shuffle_bt, num_elem); + Node* v1 = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); + Node* shuffle = unbox_vector(argument(6), shbox_type, shuffle_bt, num_elem); if (v1 == NULL || shuffle == NULL) { return false; // operand unboxing failed } - Node* rearrange = gvn().transform(new VectorRearrangeNode(v1, shuffle)); + Node* mask = NULL; + if (is_masked_op) { + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + mask = unbox_vector(argument(7), mbox_type, elem_bt, num_elem); + if (mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=3 op=shuffle/rearrange vlen=%d etype=%s ismask=useload is_masked_op=1", + num_elem, type2name(elem_bt)); + } + return false; + } + } + + Node* rearrange = new VectorRearrangeNode(v1, shuffle); + if (is_masked_op) { + if (use_predicate) { + rearrange->add_req(mask); + rearrange->add_flag(Node::Flag_is_predicated_vector); + } else { + const TypeVect* vt = v1->bottom_type()->is_vect(); + rearrange = gvn().transform(rearrange); + Node* zero = gvn().makecon(Type::get_zero_type(elem_bt)); + Node* zerovec = gvn().transform(VectorNode::scalar2vector(zero, num_elem, Type::get_const_basic_type(elem_bt))); + rearrange = new VectorBlendNode(zerovec, rearrange, mask); + } + } + rearrange = gvn().transform(rearrange); Node* box = box_vector(rearrange, vbox_type, elem_bt, num_elem); set_result(box); @@ -1514,16 +2134,19 @@ Node* LibraryCallKit::gen_call_to_svml(int vector_api_op_id, BasicType bt, int n } // public static -// > -// V broadcastInt(int opr, Class vectorClass, Class elementType, int vlen, -// V v, int i, -// VectorBroadcastIntOp defaultImpl) { -// +// , +// M extends VectorMask, +// E> +// V broadcastInt(int opr, Class vectorClass, Class maskClass, +// Class elementType, int length, +// V v, int n, M m, +// VectorBroadcastIntOp defaultImpl) bool LibraryCallKit::inline_vector_broadcast_int() { const TypeInt* opr = gvn().type(argument(0))->isa_int(); const TypeInstPtr* vector_klass = gvn().type(argument(1))->isa_instptr(); - const TypeInstPtr* elem_klass = gvn().type(argument(2))->isa_instptr(); - const TypeInt* vlen = gvn().type(argument(3))->isa_int(); + const TypeInstPtr* mask_klass = gvn().type(argument(2))->isa_instptr(); + const TypeInstPtr* elem_klass = gvn().type(argument(3))->isa_instptr(); + const TypeInt* vlen = gvn().type(argument(4))->isa_int(); if (opr == NULL || vector_klass == NULL || elem_klass == NULL || vlen == NULL) { return false; // dead code @@ -1533,8 +2156,8 @@ bool LibraryCallKit::inline_vector_broadcast_int() { tty->print_cr(" ** missing constant: opr=%s vclass=%s etype=%s vlen=%s", NodeClassNames[argument(0)->Opcode()], NodeClassNames[argument(1)->Opcode()], - NodeClassNames[argument(2)->Opcode()], - NodeClassNames[argument(3)->Opcode()]); + NodeClassNames[argument(3)->Opcode()], + NodeClassNames[argument(4)->Opcode()]); } return false; // not enough info for intrinsification } @@ -1544,6 +2167,32 @@ bool LibraryCallKit::inline_vector_broadcast_int() { } return false; } + + const Type* vmask_type = gvn().type(argument(7)); + bool is_masked_op = vmask_type != TypePtr::NULL_PTR; + if (is_masked_op) { + if (mask_klass == NULL || mask_klass->const_oop() == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** missing constant: maskclass=%s", NodeClassNames[argument(2)->Opcode()]); + } + return false; // not enough info for intrinsification + } + + if (!is_klass_initialized(mask_klass)) { + if (C->print_intrinsics()) { + tty->print_cr(" ** mask klass argument not initialized"); + } + return false; + } + + if (vmask_type->maybe_null()) { + if (C->print_intrinsics()) { + tty->print_cr(" ** null mask values are not allowed for masked op"); + } + return false; + } + } + ciType* elem_type = elem_klass->const_oop()->as_instance()->java_mirror_type(); if (!elem_type->is_primitive_type()) { if (C->print_intrinsics()) { @@ -1551,17 +2200,21 @@ bool LibraryCallKit::inline_vector_broadcast_int() { } return false; // should be primitive type } - BasicType elem_bt = elem_type->basic_type(); + int num_elem = vlen->get_con(); + BasicType elem_bt = elem_type->basic_type(); int opc = VectorSupport::vop2ideal(opr->get_con(), elem_bt); + bool is_shift = VectorNode::is_shift_opcode(opc); bool is_rotate = VectorNode::is_rotate_opcode(opc); + if (opc == 0 || (!is_shift && !is_rotate)) { if (C->print_intrinsics()) { tty->print_cr(" ** operation not supported: op=%d bt=%s", opr->get_con(), type2name(elem_bt)); } return false; // operation not supported } + int sopc = VectorNode::opcode(opc, elem_bt); if (sopc == 0) { if (C->print_intrinsics()) { @@ -1569,7 +2222,8 @@ bool LibraryCallKit::inline_vector_broadcast_int() { } return false; // operation not supported } - Node* cnt = argument(5); + + Node* cnt = argument(6); ciKlass* vbox_klass = vector_klass->const_oop()->as_instance()->java_lang_Class_klass(); const TypeInstPtr* vbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, vbox_klass); const TypeInt* cnt_type = cnt->bottom_type()->isa_int(); @@ -1578,14 +2232,25 @@ bool LibraryCallKit::inline_vector_broadcast_int() { bool is_const_rotate = is_rotate && cnt_type && cnt_type->is_con() && Matcher::supports_vector_constant_rotates(cnt_type->get_con()); bool has_scalar_args = is_rotate ? !is_const_rotate : true; - if (!arch_supports_vector(sopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args)) { - if (C->print_intrinsics()) { - tty->print_cr(" ** not supported: arity=0 op=int/%d vlen=%d etype=%s ismask=no", - sopc, num_elem, type2name(elem_bt)); + + VectorMaskUseType checkFlags = (VectorMaskUseType)(is_masked_op ? (VecMaskUseLoad | VecMaskUsePred) : VecMaskNotUsed); + bool use_predicate = is_masked_op; + + if (!arch_supports_vector(sopc, num_elem, elem_bt, checkFlags, has_scalar_args)) { + use_predicate = false; + if (!is_masked_op || + (!arch_supports_vector(sopc, num_elem, elem_bt, VecMaskNotUsed, has_scalar_args) || + !arch_supports_vector(Op_VectorBlend, num_elem, elem_bt, VecMaskUseLoad))) { + + if (C->print_intrinsics()) { + tty->print_cr(" ** not supported: arity=0 op=int/%d vlen=%d etype=%s is_masked_op=%d", + sopc, num_elem, type2name(elem_bt), is_masked_op ? 1 : 0); + } + return false; // not supported } - return false; // not supported } - Node* opd1 = unbox_vector(argument(4), vbox_type, elem_bt, num_elem); + + Node* opd1 = unbox_vector(argument(5), vbox_type, elem_bt, num_elem); Node* opd2 = NULL; if (is_shift) { opd2 = vector_shift_count(cnt, opc, elem_bt, num_elem); @@ -1600,11 +2265,35 @@ bool LibraryCallKit::inline_vector_broadcast_int() { opd2 = cnt; } } + if (opd1 == NULL || opd2 == NULL) { return false; } - Node* operation = gvn().transform(VectorNode::make(opc, opd1, opd2, num_elem, elem_bt)); + Node* mask = NULL; + if (is_masked_op) { + ciKlass* mbox_klass = mask_klass->const_oop()->as_instance()->java_lang_Class_klass(); + const TypeInstPtr* mbox_type = TypeInstPtr::make_exact(TypePtr::NotNull, mbox_klass); + mask = unbox_vector(argument(7), mbox_type, elem_bt, num_elem); + if (mask == NULL) { + if (C->print_intrinsics()) { + tty->print_cr(" ** unbox failed mask=%s", NodeClassNames[argument(7)->Opcode()]); + } + return false; + } + } + + Node* operation = VectorNode::make(opc, opd1, opd2, num_elem, elem_bt); + if (is_masked_op && mask != NULL) { + if (use_predicate) { + operation->add_req(mask); + operation->add_flag(Node::Flag_is_predicated_vector); + } else { + operation = gvn().transform(operation); + operation = new VectorBlendNode(opd1, operation, mask); + } + } + operation = gvn().transform(operation); Node* vbox = box_vector(operation, vbox_type, elem_bt, num_elem); set_result(vbox); C->set_max_vector_size(MAX2(C->max_vector_size(), (uint)(num_elem * type2aelembytes(elem_bt)))); @@ -1618,7 +2307,7 @@ bool LibraryCallKit::inline_vector_broadcast_int() { // Class fromVectorClass, Class fromElementType, int fromVLen, // Class toVectorClass, Class toElementType, int toVLen, // VIN v, S s, -// VectorConvertOp defaultImpl) { +// VectorConvertOp defaultImpl) // bool LibraryCallKit::inline_vector_convert() { const TypeInt* opr = gvn().type(argument(0))->isa_int(); @@ -1679,9 +2368,6 @@ bool LibraryCallKit::inline_vector_convert() { return false; // should be primitive type } BasicType elem_bt_to = elem_type_to->basic_type(); - if (is_mask && (type2aelembytes(elem_bt_from) != type2aelembytes(elem_bt_to))) { - return false; // elem size mismatch - } int num_elem_from = vlen_from->get_con(); int num_elem_to = vlen_to->get_con(); @@ -1727,13 +2413,28 @@ bool LibraryCallKit::inline_vector_convert() { return false; } - const TypeVect* src_type = TypeVect::make(elem_bt_from, num_elem_from); - const TypeVect* dst_type = TypeVect::make(elem_bt_to, num_elem_to); + const TypeVect* src_type = TypeVect::make(elem_bt_from, num_elem_from, is_mask); + const TypeVect* dst_type = TypeVect::make(elem_bt_to, num_elem_to, is_mask); + + // Safety check to prevent casting if source mask is of type vector + // and destination mask of type predicate vector and vice-versa. + // From X86 standpoint, this case will only arise over KNL target, + // where certain masks (depending on the species) are either propagated + // through a vector or predicate register. + if (is_mask && + ((src_type->isa_vectmask() == NULL && dst_type->isa_vectmask()) || + (dst_type->isa_vectmask() == NULL && src_type->isa_vectmask()))) { + return false; + } Node* op = opd1; if (is_cast) { - assert(!is_mask, "masks cannot be casted"); - int cast_vopc = VectorCastNode::opcode(elem_bt_from); + BasicType new_elem_bt_to = elem_bt_to; + BasicType new_elem_bt_from = elem_bt_from; + if (is_mask && is_floating_point_type(elem_bt_from)) { + new_elem_bt_from = elem_bt_from == T_FLOAT ? T_INT : T_LONG; + } + int cast_vopc = VectorCastNode::opcode(new_elem_bt_from); // Make sure that cast is implemented to particular type/size combination. if (!arch_supports_vector(cast_vopc, num_elem_to, elem_bt_to, VecMaskNotUsed)) { if (C->print_intrinsics()) { @@ -1787,9 +2488,32 @@ bool LibraryCallKit::inline_vector_convert() { num_elem_for_resize))); op = gvn().transform(VectorCastNode::make(cast_vopc, op, elem_bt_to, num_elem_to)); } else { - // Since input and output number of elements match, and since we know this vector size is - // supported, simply do a cast with no resize needed. - op = gvn().transform(VectorCastNode::make(cast_vopc, op, elem_bt_to, num_elem_to)); + if (is_mask) { + if ((dst_type->isa_vectmask() && src_type->isa_vectmask()) || + (type2aelembytes(elem_bt_from) == type2aelembytes(elem_bt_to))) { + op = gvn().transform(new VectorMaskCastNode(op, dst_type)); + } else { + // Special handling for casting operation involving floating point types. + // Case A) F -> X := F -> VectorMaskCast (F->I/L [NOP]) -> VectorCast[I/L]2X + // Case B) X -> F := X -> VectorCastX2[I/L] -> VectorMaskCast ([I/L]->F [NOP]) + // Case C) F -> F := VectorMaskCast (F->I/L [NOP]) -> VectorCast[I/L]2[L/I] -> VectotMaskCast (L/I->F [NOP]) + if (is_floating_point_type(elem_bt_from)) { + const TypeVect* new_src_type = TypeVect::make(new_elem_bt_from, num_elem_to, is_mask); + op = gvn().transform(new VectorMaskCastNode(op, new_src_type)); + } + if (is_floating_point_type(elem_bt_to)) { + new_elem_bt_to = elem_bt_to == T_FLOAT ? T_INT : T_LONG; + } + op = gvn().transform(VectorCastNode::make(cast_vopc, op, new_elem_bt_to, num_elem_to)); + if (new_elem_bt_to != elem_bt_to) { + op = gvn().transform(new VectorMaskCastNode(op, dst_type)); + } + } + } else { + // Since input and output number of elements match, and since we know this vector size is + // supported, simply do a cast with no resize needed. + op = gvn().transform(VectorCastNode::make(cast_vopc, op, elem_bt_to, num_elem_to)); + } } } else if (Type::cmp(src_type, dst_type) != 0) { assert(!is_cast, "must be reinterpret"); @@ -1804,11 +2528,11 @@ bool LibraryCallKit::inline_vector_convert() { } // public static -// > -// V insert(Class vectorClass, Class elementType, int vlen, +// , +// E> +// V insert(Class vectorClass, Class elementType, int vlen, // V vec, int ix, long val, -// VecInsertOp defaultImpl) { -// +// VecInsertOp defaultImpl) bool LibraryCallKit::inline_vector_insert() { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); const TypeInstPtr* elem_klass = gvn().type(argument(1))->isa_instptr(); @@ -1897,11 +2621,11 @@ bool LibraryCallKit::inline_vector_insert() { } // public static -// > -// long extract(Class vectorClass, Class elementType, int vlen, +// , +// E> +// long extract(Class vectorClass, Class elementType, int vlen, // V vec, int ix, -// VecExtractOp defaultImpl) { -// +// VecExtractOp defaultImpl) bool LibraryCallKit::inline_vector_extract() { const TypeInstPtr* vector_klass = gvn().type(argument(0))->isa_instptr(); const TypeInstPtr* elem_klass = gvn().type(argument(1))->isa_instptr(); diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index e9193d784ad..6a5b0b9b014 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -366,8 +366,8 @@ bool VectorNode::is_scalar_rotate(Node* n) { return false; } -bool VectorNode::is_vshift_cnt(Node* n) { - switch (n->Opcode()) { +bool VectorNode::is_vshift_cnt_opcode(int opc) { + switch (opc) { case Op_LShiftCntV: case Op_RShiftCntV: return true; @@ -376,6 +376,10 @@ bool VectorNode::is_vshift_cnt(Node* n) { } } +bool VectorNode::is_vshift_cnt(Node* n) { + return is_vshift_cnt_opcode(n->Opcode()); +} + // Check if input is loop invariant vector. bool VectorNode::is_invariant_vector(Node* n) { // Only Replicate vector nodes are loop invariant for now. @@ -442,10 +446,40 @@ void VectorNode::vector_operands(Node* n, uint* start, uint* end) { } } +VectorNode* VectorNode::make_mask_node(int vopc, Node* n1, Node* n2, uint vlen, BasicType bt) { + guarantee(vopc > 0, "vopc must be > 0"); + const TypeVect* vmask_type = TypeVect::makemask(bt, vlen); + switch (vopc) { + case Op_AndV: + if (Matcher::match_rule_supported_vector_masked(Op_AndVMask, vlen, bt)) { + return new AndVMaskNode(n1, n2, vmask_type); + } + return new AndVNode(n1, n2, vmask_type); + case Op_OrV: + if (Matcher::match_rule_supported_vector_masked(Op_OrVMask, vlen, bt)) { + return new OrVMaskNode(n1, n2, vmask_type); + } + return new OrVNode(n1, n2, vmask_type); + case Op_XorV: + if (Matcher::match_rule_supported_vector_masked(Op_XorVMask, vlen, bt)) { + return new XorVMaskNode(n1, n2, vmask_type); + } + return new XorVNode(n1, n2, vmask_type); + default: + fatal("Unsupported mask vector creation for '%s'", NodeClassNames[vopc]); + return NULL; + } +} + // Make a vector node for binary operation -VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt) { +VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask) { // This method should not be called for unimplemented vectors. guarantee(vopc > 0, "vopc must be > 0"); + + if (is_mask) { + return make_mask_node(vopc, n1, n2, vt->length(), vt->element_basic_type()); + } + switch (vopc) { case Op_AddVB: return new AddVBNode(n1, n2, vt); case Op_AddVS: return new AddVSNode(n1, n2, vt); @@ -552,10 +586,15 @@ VectorNode* VectorNode::make(int opc, Node* n1, Node* n2, Node* n3, uint vlen, B } // Scalar promotion -VectorNode* VectorNode::scalar2vector(Node* s, uint vlen, const Type* opd_t) { +VectorNode* VectorNode::scalar2vector(Node* s, uint vlen, const Type* opd_t, bool is_mask) { BasicType bt = opd_t->array_element_basic_type(); - const TypeVect* vt = opd_t->singleton() ? TypeVect::make(opd_t, vlen) - : TypeVect::make(bt, vlen); + const TypeVect* vt = opd_t->singleton() ? TypeVect::make(opd_t, vlen, is_mask) + : TypeVect::make(bt, vlen, is_mask); + + if (is_mask && Matcher::match_rule_supported_vector(Op_MaskAll, vlen, bt)) { + return new MaskAllNode(s, vt); + } + switch (bt) { case T_BOOLEAN: case T_BYTE: @@ -1006,9 +1045,10 @@ ReductionNode* ReductionNode::make(int opc, Node *ctrl, Node* n1, Node* n2, Basi Node* VectorLoadMaskNode::Identity(PhaseGVN* phase) { BasicType out_bt = type()->is_vect()->element_basic_type(); - if (out_bt == T_BOOLEAN) { + if (!Matcher::has_predicated_vectors() && out_bt == T_BOOLEAN) { return in(1); // redundant conversion } + return this; } @@ -1105,7 +1145,9 @@ Node* ReductionNode::make_reduction_input(PhaseGVN& gvn, int opc, BasicType bt) case Op_MinReductionV: switch (bt) { case T_BYTE: + return gvn.makecon(TypeInt::make(max_jbyte)); case T_SHORT: + return gvn.makecon(TypeInt::make(max_jshort)); case T_INT: return gvn.makecon(TypeInt::MAX); case T_LONG: @@ -1120,7 +1162,9 @@ Node* ReductionNode::make_reduction_input(PhaseGVN& gvn, int opc, BasicType bt) case Op_MaxReductionV: switch (bt) { case T_BYTE: + return gvn.makecon(TypeInt::make(min_jbyte)); case T_SHORT: + return gvn.makecon(TypeInt::make(min_jshort)); case T_INT: return gvn.makecon(TypeInt::MIN); case T_LONG: @@ -1313,16 +1357,17 @@ Node* VectorUnboxNode::Ideal(PhaseGVN* phase, bool can_reshape) { bool is_vector_mask = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorMask_klass()); bool is_vector_shuffle = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorShuffle_klass()); if (is_vector_mask) { + const TypeVect* vmask_type = TypeVect::makemask(out_vt->element_basic_type(), out_vt->length()); if (in_vt->length_in_bytes() == out_vt->length_in_bytes() && Matcher::match_rule_supported_vector(Op_VectorMaskCast, out_vt->length(), out_vt->element_basic_type())) { // Apply "VectorUnbox (VectorBox vmask) ==> VectorMaskCast (vmask)" // directly. This could avoid the transformation ordering issue from // "VectorStoreMask (VectorLoadMask vmask) => vmask". - return new VectorMaskCastNode(value, out_vt); + return new VectorMaskCastNode(value, vmask_type); } // VectorUnbox (VectorBox vmask) ==> VectorLoadMask (VectorStoreMask vmask) value = phase->transform(VectorStoreMaskNode::make(*phase, value, in_vt->element_basic_type(), in_vt->length())); - return new VectorLoadMaskNode(value, out_vt); + return new VectorLoadMaskNode(value, vmask_type); } else if (is_vector_shuffle) { if (!is_shuffle_to_vector()) { // VectorUnbox (VectorBox vshuffle) ==> VectorLoadShuffle vshuffle @@ -1380,13 +1425,14 @@ Node* VectorMaskOpNode::make(Node* mask, const Type* ty, int mopc) { return new VectorMaskLastTrueNode(mask, ty); case Op_VectorMaskFirstTrue: return new VectorMaskFirstTrueNode(mask, ty); + case Op_VectorMaskToLong: + return new VectorMaskToLongNode(mask, ty); default: assert(false, "Unhandled operation"); } return NULL; } - #ifndef PRODUCT void VectorBoxAllocateNode::dump_spec(outputStream *st) const { CallStaticJavaNode::dump_spec(st); diff --git a/src/hotspot/share/opto/vectornode.hpp b/src/hotspot/share/opto/vectornode.hpp index e3ba3dd91ef..0b04a053f99 100644 --- a/src/hotspot/share/opto/vectornode.hpp +++ b/src/hotspot/share/opto/vectornode.hpp @@ -66,16 +66,22 @@ class VectorNode : public TypeNode { virtual int Opcode() const; - virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); } + virtual uint ideal_reg() const { + return type()->ideal_reg(); + } - static VectorNode* scalar2vector(Node* s, uint vlen, const Type* opd_t); + static VectorNode* scalar2vector(Node* s, uint vlen, const Type* opd_t, bool is_mask = false); static VectorNode* shift_count(int opc, Node* cnt, uint vlen, BasicType bt); static VectorNode* make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt); - static VectorNode* make(int vopc, Node* n1, Node* n2, const TypeVect* vt); + static VectorNode* make(int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask = false); static VectorNode* make(int opc, Node* n1, Node* n2, Node* n3, uint vlen, BasicType bt); static VectorNode* make(int vopc, Node* n1, Node* n2, Node* n3, const TypeVect* vt); + static VectorNode* make_mask_node(int vopc, Node* n1, Node* n2, uint vlen, BasicType bt); static bool is_shift_opcode(int opc); + + static bool is_vshift_cnt_opcode(int opc); + static bool is_rotate_opcode(int opc); static int opcode(int opc, BasicType bt); @@ -798,8 +804,8 @@ class StoreVectorNode : public StoreNode { } virtual int Opcode() const; virtual uint match_edge(uint idx) const { return idx == MemNode::Address || - idx == MemNode::ValueIn || - idx == MemNode::ValueIn + 1; } + idx == MemNode::ValueIn || + idx == MemNode::ValueIn + 1; } }; //------------------------------StoreVectorMaskedNode-------------------------------- @@ -808,7 +814,7 @@ class StoreVectorMaskedNode : public StoreVectorNode { public: StoreVectorMaskedNode(Node* c, Node* mem, Node* dst, Node* src, const TypePtr* at, Node* mask) : StoreVectorNode(c, mem, dst, at, src) { - assert(mask->bottom_type()->is_vectmask(), "sanity"); + assert(mask->bottom_type()->isa_vectmask(), "sanity"); init_class_id(Class_StoreVector); set_mismatched_access(); add_req(mask); @@ -828,7 +834,7 @@ class LoadVectorMaskedNode : public LoadVectorNode { public: LoadVectorMaskedNode(Node* c, Node* mem, Node* src, const TypePtr* at, const TypeVect* vt, Node* mask) : LoadVectorNode(c, mem, src, at, vt) { - assert(mask->bottom_type()->is_vectmask(), "sanity"); + assert(mask->bottom_type()->isa_vectmask(), "sanity"); init_class_id(Class_LoadVector); set_mismatched_access(); add_req(mask); @@ -842,6 +848,45 @@ class LoadVectorMaskedNode : public LoadVectorNode { Node* Ideal(PhaseGVN* phase, bool can_reshape); }; +//-------------------------------LoadVectorGatherMaskedNode--------------------------------- +// Load Vector from memory via index map under the influence of a predicate register(mask). +class LoadVectorGatherMaskedNode : public LoadVectorNode { + public: + LoadVectorGatherMaskedNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt, Node* indices, Node* mask) + : LoadVectorNode(c, mem, adr, at, vt) { + init_class_id(Class_LoadVector); + assert(indices->bottom_type()->is_vect(), "indices must be in vector"); + assert(mask->bottom_type()->isa_vectmask(), "sanity"); + add_req(indices); + add_req(mask); + assert(req() == MemNode::ValueIn + 2, "match_edge expects that last input is in MemNode::ValueIn+1"); + } + + virtual int Opcode() const; + virtual uint match_edge(uint idx) const { return idx == MemNode::Address || + idx == MemNode::ValueIn || + idx == MemNode::ValueIn + 1; } +}; + +//------------------------------StoreVectorScatterMaskedNode-------------------------------- +// Store Vector into memory via index map under the influence of a predicate register(mask). +class StoreVectorScatterMaskedNode : public StoreVectorNode { + public: + StoreVectorScatterMaskedNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val, Node* indices, Node* mask) + : StoreVectorNode(c, mem, adr, at, val) { + init_class_id(Class_StoreVector); + assert(indices->bottom_type()->is_vect(), "indices must be in vector"); + assert(mask->bottom_type()->isa_vectmask(), "sanity"); + add_req(indices); + add_req(mask); + assert(req() == MemNode::ValueIn + 3, "match_edge expects that last input is in MemNode::ValueIn+2"); + } + virtual int Opcode() const; + virtual uint match_edge(uint idx) const { return idx == MemNode::Address || + idx == MemNode::ValueIn || + idx == MemNode::ValueIn + 1 || + idx == MemNode::ValueIn + 2; } +}; //------------------------------VectorCmpMaskedNode-------------------------------- // Vector Comparison under the influence of a predicate register(mask). @@ -856,7 +901,6 @@ class VectorCmpMaskedNode : public TypeNode { virtual int Opcode() const; }; - class VectorMaskGenNode : public TypeNode { public: VectorMaskGenNode(Node* length, const Type* ty, BasicType ety): TypeNode(ty, 2), _elemType(ety) { @@ -878,7 +922,7 @@ class VectorMaskOpNode : public TypeNode { public: VectorMaskOpNode(Node* mask, const Type* ty, int mopc): TypeNode(ty, 2), _mopc(mopc) { - assert(mask->bottom_type()->is_vect()->element_basic_type() == T_BOOLEAN, ""); + assert(Matcher::has_predicated_vectors() || mask->bottom_type()->is_vect()->element_basic_type() == T_BOOLEAN, ""); init_req(1, mask); } @@ -913,6 +957,42 @@ class VectorMaskLastTrueNode : public VectorMaskOpNode { virtual int Opcode() const; }; +class VectorMaskToLongNode : public VectorMaskOpNode { + public: + VectorMaskToLongNode(Node* mask, const Type* ty): + VectorMaskOpNode(mask, ty, Op_VectorMaskToLong) {} + virtual int Opcode() const; + virtual uint ideal_reg() const { return Op_RegL; } +}; + +//-------------------------- Vector mask broadcast ----------------------------------- +class MaskAllNode : public VectorNode { + public: + MaskAllNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {} + virtual int Opcode() const; +}; + +//--------------------------- Vector mask logical and -------------------------------- +class AndVMaskNode : public VectorNode { + public: + AndVMaskNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} + virtual int Opcode() const; +}; + +//--------------------------- Vector mask logical or --------------------------------- +class OrVMaskNode : public VectorNode { + public: + OrVMaskNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} + virtual int Opcode() const; +}; + +//--------------------------- Vector mask logical xor -------------------------------- +class XorVMaskNode : public VectorNode { + public: + XorVMaskNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} + virtual int Opcode() const; +}; + //=========================Promote_Scalar_to_Vector============================ //------------------------------ReplicateBNode--------------------------------- @@ -1184,7 +1264,7 @@ class VectorMaskCmpNode : public VectorNode { BoolTest::mask _predicate; protected: - uint size_of() const { return sizeof(*this); } + virtual uint size_of() const { return sizeof(VectorMaskCmpNode); } public: VectorMaskCmpNode(BoolTest::mask predicate, Node* in1, Node* in2, ConINode* predicate_node, const TypeVect* vt) : @@ -1194,6 +1274,7 @@ class VectorMaskCmpNode : public VectorNode { "VectorMaskCmp inputs must have same type for elements"); assert(in1->bottom_type()->is_vect()->length() == in2->bottom_type()->is_vect()->length(), "VectorMaskCmp inputs must have same number of elements"); + assert((BoolTest::mask)predicate_node->get_int() == predicate, "Unmatched predicates"); init_class_id(Class_VectorMaskCmp); } @@ -1305,7 +1386,6 @@ class VectorMaskCastNode : public VectorNode { VectorMaskCastNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) { const TypeVect* in_vt = in->bottom_type()->is_vect(); assert(in_vt->length() == vt->length(), "vector length must match"); - assert(type2aelembytes(in_vt->element_basic_type()) == type2aelembytes(vt->element_basic_type()), "element size must match"); } virtual int Opcode() const; @@ -1315,12 +1395,19 @@ class VectorMaskCastNode : public VectorNode { class VectorReinterpretNode : public VectorNode { private: const TypeVect* _src_vt; + protected: - uint size_of() const { return sizeof(*this); } + uint size_of() const { return sizeof(VectorReinterpretNode); } public: VectorReinterpretNode(Node* in, const TypeVect* src_vt, const TypeVect* dst_vt) - : VectorNode(in, dst_vt), _src_vt(src_vt) { } + : VectorNode(in, dst_vt), _src_vt(src_vt) { + assert((!dst_vt->isa_vectmask() && !src_vt->isa_vectmask()) || + (type2aelembytes(src_vt->element_basic_type()) >= type2aelembytes(dst_vt->element_basic_type())), + "unsupported mask widening reinterpretation"); + init_class_id(Class_VectorReinterpret); + } + const TypeVect* src_type() { return _src_vt; } virtual uint hash() const { return VectorNode::hash() + _src_vt->hash(); } virtual bool cmp( const Node &n ) const { return VectorNode::cmp(n) && !Type::cmp(_src_vt,((VectorReinterpretNode&)n)._src_vt); @@ -1453,6 +1540,7 @@ class VectorUnboxNode : public VectorNode { VectorUnboxNode(Compile* C, const TypeVect* vec_type, Node* obj, Node* mem, bool shuffle_to_vector) : VectorNode(mem, obj, vec_type) { _shuffle_to_vector = shuffle_to_vector; + init_class_id(Class_VectorUnbox); init_flags(Flag_is_macro); C->add_macro_node(this); } @@ -1482,5 +1570,4 @@ public: virtual int Opcode() const; Node* Ideal(PhaseGVN* phase, bool can_reshape); }; - #endif // SHARE_OPTO_VECTORNODE_HPP diff --git a/src/hotspot/share/prims/vectorSupport.cpp b/src/hotspot/share/prims/vectorSupport.cpp index 0b59f632408..cc5a37678a4 100644 --- a/src/hotspot/share/prims/vectorSupport.cpp +++ b/src/hotspot/share/prims/vectorSupport.cpp @@ -430,6 +430,18 @@ int VectorSupport::vop2ideal(jint id, BasicType bt) { } break; } + case VECTOR_OP_MASK_TOLONG: { + switch (bt) { + case T_BYTE: // fall-through + case T_SHORT: // fall-through + case T_INT: // fall-through + case T_LONG: // fall-through + case T_FLOAT: // fall-through + case T_DOUBLE: return Op_VectorMaskToLong; + default: fatal("MASK_TOLONG: %s", type2name(bt)); + } + break; + } case VECTOR_OP_TAN: case VECTOR_OP_TANH: case VECTOR_OP_SIN: diff --git a/src/hotspot/share/prims/vectorSupport.hpp b/src/hotspot/share/prims/vectorSupport.hpp index ac436a87976..ccebddb3d22 100644 --- a/src/hotspot/share/prims/vectorSupport.hpp +++ b/src/hotspot/share/prims/vectorSupport.hpp @@ -82,10 +82,11 @@ class VectorSupport : AllStatic { VECTOR_OP_MASK_TRUECOUNT = 19, VECTOR_OP_MASK_FIRSTTRUE = 20, VECTOR_OP_MASK_LASTTRUE = 21, + VECTOR_OP_MASK_TOLONG = 22, // Rotate operations - VECTOR_OP_LROTATE = 22, - VECTOR_OP_RROTATE = 23, + VECTOR_OP_LROTATE = 23, + VECTOR_OP_RROTATE = 24, // Vector Math Library VECTOR_OP_TAN = 101, diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 848b24eecdf..89abff4a0a8 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -1849,6 +1849,10 @@ declare_c2_type(VectorUnboxNode, VectorNode) \ declare_c2_type(VectorReinterpretNode, VectorNode) \ declare_c2_type(VectorMaskCastNode, VectorNode) \ + declare_c2_type(MaskAllNode, VectorNode) \ + declare_c2_type(AndVMaskNode, VectorNode) \ + declare_c2_type(OrVMaskNode, VectorNode) \ + declare_c2_type(XorVMaskNode, VectorNode) \ declare_c2_type(VectorBoxNode, Node) \ declare_c2_type(VectorBoxAllocateNode, CallStaticJavaNode) \ declare_c2_type(VectorTestNode, Node) \ diff --git a/src/hotspot/share/utilities/growableArray.hpp b/src/hotspot/share/utilities/growableArray.hpp index 8ab6f6f4af6..e333388f11c 100644 --- a/src/hotspot/share/utilities/growableArray.hpp +++ b/src/hotspot/share/utilities/growableArray.hpp @@ -320,6 +320,17 @@ public: return min; } + void truncate_to(int idx) { + for (int i = 0, j = idx; j < length(); i++, j++) { + at_put(i, at(j)); + } + trunc_to(length() - idx); + } + + void truncate_from(int idx) { + trunc_to(idx); + } + size_t data_size_in_bytes() const { return _len * sizeof(E); } diff --git a/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template index e478a9c38a0..e4cf2f5b2ed 100644 --- a/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template +++ b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template @@ -353,6 +353,9 @@ public class ScopedMemoryAccess { static final long BYTE_BUFFER_HB = UNSAFE.objectFieldOffset(ByteBuffer.class, "hb"); + static final long BYTE_BUFFER_IS_READ_ONLY + = UNSAFE.objectFieldOffset(ByteBuffer.class, "isReadOnly"); + @ForceInline static Object bufferBase(ByteBuffer bb) { return UNSAFE.getReference(bb, BYTE_BUFFER_HB); @@ -373,13 +376,18 @@ public class ScopedMemoryAccess { } } + @ForceInline + public static boolean isReadOnly(ByteBuffer bb) { + return UNSAFE.getBoolean(bb, BufferAccess.BYTE_BUFFER_IS_READ_ONLY); + } + @ForceInline public static , E, S extends VectorSupport.VectorSpecies> V loadFromByteBuffer(Class vmClass, Class e, int length, ByteBuffer bb, int offset, S s, - VectorSupport.LoadOperation defaultImpl) { + VectorSupport.LoadOperation defaultImpl) { try { return loadFromByteBufferScoped( BufferAccess.scope(bb), @@ -400,14 +408,59 @@ public class ScopedMemoryAccess { Class vmClass, Class e, int length, ByteBuffer bb, int offset, S s, - VectorSupport.LoadOperation defaultImpl) { + VectorSupport.LoadOperation defaultImpl) { try { if (scope != null) { scope.checkValidState(); } + final byte[] base = (byte[]) BufferAccess.bufferBase(bb); + return VectorSupport.load(vmClass, e, length, - BufferAccess.bufferBase(bb), BufferAccess.bufferAddress(bb, offset), + base, BufferAccess.bufferAddress(bb, offset), + bb, offset, s, + defaultImpl); + } finally { + Reference.reachabilityFence(scope); + } + } + + @ForceInline + public static + , E, S extends VectorSupport.VectorSpecies, + M extends VectorSupport.VectorMask> + V loadFromByteBufferMasked(Class vmClass, Class maskClass, Class e, + int length, ByteBuffer bb, int offset, M m, S s, + VectorSupport.LoadVectorMaskedOperation defaultImpl) { + try { + return loadFromByteBufferMaskedScoped( + BufferAccess.scope(bb), + vmClass, maskClass, e, length, + bb, offset, m, + s, + defaultImpl); + } catch (ScopedMemoryAccess.Scope.ScopedAccessError ex) { + throw new IllegalStateException("This segment is already closed"); + } + } + + @Scoped + @ForceInline + private static + , E, S extends VectorSupport.VectorSpecies, + M extends VectorSupport.VectorMask> + V loadFromByteBufferMaskedScoped(ScopedMemoryAccess.Scope scope, Class vmClass, + Class maskClass, Class e, int length, + ByteBuffer bb, int offset, M m, + S s, + VectorSupport.LoadVectorMaskedOperation defaultImpl) { + try { + if (scope != null) { + scope.checkValidState(); + } + + return VectorSupport.loadMasked(vmClass, maskClass, e, length, + BufferAccess.bufferBase(bb), BufferAccess.bufferAddress(bb, offset), m, bb, offset, s, defaultImpl); } finally { @@ -448,9 +501,54 @@ public class ScopedMemoryAccess { scope.checkValidState(); } + final byte[] base = (byte[]) BufferAccess.bufferBase(bb); + VectorSupport.store(vmClass, e, length, + base, BufferAccess.bufferAddress(bb, offset), + v, + bb, offset, + defaultImpl); + } finally { + Reference.reachabilityFence(scope); + } + } + + @ForceInline + public static + , E, M extends VectorSupport.VectorMask> + void storeIntoByteBufferMasked(Class vmClass, Class maskClass, Class e, + int length, V v, M m, + ByteBuffer bb, int offset, + VectorSupport.StoreVectorMaskedOperation defaultImpl) { + try { + storeIntoByteBufferMaskedScoped( + BufferAccess.scope(bb), + vmClass, maskClass, e, length, + v, m, + bb, offset, + defaultImpl); + } catch (ScopedMemoryAccess.Scope.ScopedAccessError ex) { + throw new IllegalStateException("This segment is already closed"); + } + } + + @Scoped + @ForceInline + private static + , E, M extends VectorSupport.VectorMask> + void storeIntoByteBufferMaskedScoped(ScopedMemoryAccess.Scope scope, + Class vmClass, Class maskClass, + Class e, int length, V v, M m, + ByteBuffer bb, int offset, + VectorSupport.StoreVectorMaskedOperation defaultImpl) { + try { + if (scope != null) { + scope.checkValidState(); + } + + VectorSupport.storeMasked(vmClass, maskClass, e, length, BufferAccess.bufferBase(bb), BufferAccess.bufferAddress(bb, offset), - v, + v, m, bb, offset, defaultImpl); } finally { @@ -458,7 +556,6 @@ public class ScopedMemoryAccess { } } - // typed-ops here // Note: all the accessor methods defined below take advantage of argument type profiling diff --git a/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java b/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java index 2c984ef427c..63e00765792 100644 --- a/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java +++ b/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java @@ -69,10 +69,11 @@ public class VectorSupport { public static final int VECTOR_OP_MASK_TRUECOUNT = 19; public static final int VECTOR_OP_MASK_FIRSTTRUE = 20; public static final int VECTOR_OP_MASK_LASTTRUE = 21; + public static final int VECTOR_OP_MASK_TOLONG = 22; // Rotate operations - public static final int VECTOR_OP_LROTATE = 22; - public static final int VECTOR_OP_RROTATE = 23; + public static final int VECTOR_OP_LROTATE = 23; + public static final int VECTOR_OP_RROTATE = 24; // Math routines public static final int VECTOR_OP_TAN = 101; @@ -156,274 +157,407 @@ public class VectorSupport { } /* ============================================================================ */ - public interface BroadcastOperation> { + public interface BroadcastOperation> { VM broadcast(long l, S s); } @IntrinsicCandidate public static - > - VM broadcastCoerced(Class vmClass, Class E, int length, - long bits, S s, - BroadcastOperation defaultImpl) { + , + E> + VM broadcastCoerced(Class vmClass, Class eClass, + int length, + long bits, S s, + BroadcastOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; return defaultImpl.broadcast(bits, s); } /* ============================================================================ */ - public interface ShuffleIotaOperation> { - VectorShuffle apply(int length, int start, int step, S s); + public interface ShuffleIotaOperation, + SH extends VectorShuffle> { + SH apply(int length, int start, int step, S s); } @IntrinsicCandidate public static - > - VectorShuffle shuffleIota(Class E, Class ShuffleClass, S s, int length, - int start, int step, int wrap, ShuffleIotaOperation defaultImpl) { + , + SH extends VectorShuffle> + SH shuffleIota(Class eClass, Class shClass, S s, + int length, + int start, int step, int wrap, + ShuffleIotaOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; return defaultImpl.apply(length, start, step, s); } - public interface ShuffleToVectorOperation { - VM apply(Sh s); + public interface ShuffleToVectorOperation, + SH extends VectorShuffle> { + V apply(SH sh); } @IntrinsicCandidate public static - , E> - VM shuffleToVector(Class VM, ClassE , Class ShuffleClass, Sh s, int length, - ShuffleToVectorOperation defaultImpl) { + , + SH extends VectorShuffle, + E> + V shuffleToVector(Class> vClass, Class eClass, Class shClass, SH sh, + int length, + ShuffleToVectorOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(s); + return defaultImpl.apply(sh); } /* ============================================================================ */ - public interface IndexOperation, E, S extends VectorSpecies> { + public interface IndexOperation, + S extends VectorSpecies> { V index(V v, int step, S s); } //FIXME @IntrinsicCandidate public static - , E, S extends VectorSpecies> - V indexVector(Class vClass, Class E, int length, + , + E, + S extends VectorSpecies> + V indexVector(Class vClass, Class eClass, + int length, V v, int step, S s, - IndexOperation defaultImpl) { + IndexOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; return defaultImpl.index(v, step, s); } /* ============================================================================ */ + public interface ReductionOperation, + M extends VectorMask> { + long apply(V v, M m); + } + @IntrinsicCandidate public static - > - long reductionCoerced(int oprId, Class vectorClass, Class elementType, int length, - V v, - Function defaultImpl) { + , + M extends VectorMask, + E> + long reductionCoerced(int oprId, + Class vClass, Class mClass, Class eClass, + int length, + V v, M m, + ReductionOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(v); + return defaultImpl.apply(v, m); } + /* ============================================================================ */ - public interface VecExtractOp { - long apply(V v1, int idx); + public interface VecExtractOp> { + long apply(V v, int i); } @IntrinsicCandidate public static - > - long extract(Class vectorClass, Class elementType, int vlen, - V vec, int ix, + , + E> + long extract(Class vClass, Class eClass, + int length, + V v, int i, VecExtractOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(vec, ix); + return defaultImpl.apply(v, i); } /* ============================================================================ */ - public interface VecInsertOp { - V apply(V v1, int idx, long val); + public interface VecInsertOp> { + V apply(V v, int i, long val); } @IntrinsicCandidate public static - > - V insert(Class vectorClass, Class elementType, int vlen, - V vec, int ix, long val, + , + E> + V insert(Class vClass, Class eClass, + int length, + V v, int i, long val, VecInsertOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(vec, ix, val); + return defaultImpl.apply(v, i, val); } /* ============================================================================ */ + public interface UnaryOperation, + M extends VectorMask> { + V apply(V v, M m); + } + @IntrinsicCandidate public static - - VM unaryOp(int oprId, Class vmClass, Class elementType, int length, - VM vm, - Function defaultImpl) { + , + M extends VectorMask, + E> + V unaryOp(int oprId, + Class vClass, Class mClass, Class eClass, + int length, + V v, M m, + UnaryOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(vm); + return defaultImpl.apply(v, m); } /* ============================================================================ */ + public interface BinaryOperation> { + VM apply(VM v1, VM v2, M m); + } + @IntrinsicCandidate public static - - VM binaryOp(int oprId, Class vmClass, Class elementType, int length, - VM vm1, VM vm2, - BiFunction defaultImpl) { + , + E> + VM binaryOp(int oprId, + Class vmClass, Class mClass, Class eClass, + int length, + VM v1, VM v2, M m, + BinaryOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(vm1, vm2); + return defaultImpl.apply(v1, v2, m); } /* ============================================================================ */ - public interface TernaryOperation { - V apply(V v1, V v2, V v3); + public interface TernaryOperation, + M extends VectorMask> { + V apply(V v1, V v2, V v3, M m); } @IntrinsicCandidate public static - - VM ternaryOp(int oprId, Class vmClass, Class elementType, int length, - VM vm1, VM vm2, VM vm3, - TernaryOperation defaultImpl) { + , + M extends VectorMask, + E> + V ternaryOp(int oprId, + Class vClass, Class mClass, Class eClass, + int length, + V v1, V v2, V v3, M m, + TernaryOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(vm1, vm2, vm3); + return defaultImpl.apply(v1, v2, v3, m); } /* ============================================================================ */ // Memory operations - public interface LoadOperation> { - V load(C container, int index, S s); + public interface LoadOperation> { + VM load(C container, int index, S s); } @IntrinsicCandidate public static - > - VM load(Class vmClass, Class E, int length, - Object base, long offset, // Unsafe addressing - C container, int index, S s, // Arguments for default implementation - LoadOperation defaultImpl) { + > + VM load(Class vmClass, Class eClass, + int length, + Object base, long offset, + C container, int index, S s, + LoadOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; return defaultImpl.load(container, index, s); } /* ============================================================================ */ - public interface LoadVectorOperationWithMap, E, S extends VectorSpecies> { - V loadWithMap(C container, int index, int[] indexMap, int indexM, S s); + public interface LoadVectorMaskedOperation, + S extends VectorSpecies, + M extends VectorMask> { + V load(C container, int index, S s, M m); } @IntrinsicCandidate public static - , W extends Vector, E, S extends VectorSpecies> - V loadWithMap(Class vectorClass, Class E, int length, Class vectorIndexClass, - Object base, long offset, // Unsafe addressing + , + E, + S extends VectorSpecies, + M extends VectorMask> + V loadMasked(Class vClass, Class mClass, Class eClass, + int length, + Object base, long offset, + M m, C container, int index, S s, + LoadVectorMaskedOperation defaultImpl) { + assert isNonCapturingLambda(defaultImpl) : defaultImpl; + return defaultImpl.load(container, index, s, m); + } + + /* ============================================================================ */ + + public interface LoadVectorOperationWithMap, + S extends VectorSpecies, + M extends VectorMask> { + V loadWithMap(C container, int index, int[] indexMap, int indexM, S s, M m); + } + + @IntrinsicCandidate + public static + , + W extends Vector, + S extends VectorSpecies, + M extends VectorMask, + E> + V loadWithMap(Class vClass, Class mClass, Class eClass, + int length, + Class> vectorIndexClass, + Object base, long offset, W index_vector, - C container, int index, int[] indexMap, int indexM, S s, // Arguments for default implementation - LoadVectorOperationWithMap defaultImpl) { + M m, C container, int index, int[] indexMap, int indexM, S s, + LoadVectorOperationWithMap defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.loadWithMap(container, index, indexMap, indexM, s); + return defaultImpl.loadWithMap(container, index, indexMap, indexM, s, m); } /* ============================================================================ */ - public interface StoreVectorOperation> { + public interface StoreVectorOperation> { void store(C container, int index, V v); } @IntrinsicCandidate public static - > - void store(Class vectorClass, Class elementType, int length, - Object base, long offset, // Unsafe addressing - V v, - C container, int index, // Arguments for default implementation + > + void store(Class vClass, Class eClass, + int length, + Object base, long offset, + V v, C container, int index, StoreVectorOperation defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; defaultImpl.store(container, index, v); } + public interface StoreVectorMaskedOperation, + M extends VectorMask> { + void store(C container, int index, V v, M m); + } + + @IntrinsicCandidate + public static + , + M extends VectorMask, + E> + void storeMasked(Class vClass, Class mClass, Class eClass, + int length, + Object base, long offset, + V v, M m, C container, int index, + StoreVectorMaskedOperation defaultImpl) { + assert isNonCapturingLambda(defaultImpl) : defaultImpl; + defaultImpl.store(container, index, v, m); + } + /* ============================================================================ */ - public interface StoreVectorOperationWithMap> { - void storeWithMap(C container, int index, V v, int[] indexMap, int indexM); + public interface StoreVectorOperationWithMap, + M extends VectorMask> { + void storeWithMap(C container, int index, V v, int[] indexMap, int indexM, M m); } @IntrinsicCandidate public static - , W extends Vector> - void storeWithMap(Class vectorClass, Class elementType, int length, Class vectorIndexClass, - Object base, long offset, // Unsafe addressing - W index_vector, V v, - C container, int index, int[] indexMap, int indexM, // Arguments for default implementation - StoreVectorOperationWithMap defaultImpl) { + , + W extends Vector, + M extends VectorMask, + E> + void storeWithMap(Class vClass, Class mClass, Class eClass, + int length, + Class> vectorIndexClass, + Object base, long offset, + W index_vector, + V v, M m, C container, int index, int[] indexMap, int indexM, + StoreVectorOperationWithMap defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - defaultImpl.storeWithMap(container, index, v, indexMap, indexM); + defaultImpl.storeWithMap(container, index, v, indexMap, indexM, m); } /* ============================================================================ */ @IntrinsicCandidate public static - - boolean test(int cond, Class vmClass, Class elementType, int length, - VM vm1, VM vm2, - BiFunction defaultImpl) { + , + E> + boolean test(int cond, + Class mClass, Class eClass, + int length, + M m1, M m2, + BiFunction defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(vm1, vm2); + return defaultImpl.apply(m1, m2); } /* ============================================================================ */ - public interface VectorCompareOp { - M apply(int cond, V v1, V v2); + public interface VectorCompareOp, + M extends VectorMask> { + M apply(int cond, V v1, V v2, M m); } @IntrinsicCandidate - public static , - M extends VectorMask, - E> - M compare(int cond, Class vectorClass, Class maskClass, Class elementType, int length, - V v1, V v2, - VectorCompareOp defaultImpl) { + public static + , + M extends VectorMask, + E> + M compare(int cond, + Class vectorClass, Class mClass, Class eClass, + int length, + V v1, V v2, M m, + VectorCompareOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(cond, v1, v2); + return defaultImpl.apply(cond, v1, v2, m); } /* ============================================================================ */ - - public interface VectorRearrangeOp, - Sh extends VectorShuffle, - E> { - V apply(V v1, Sh shuffle); + public interface VectorRearrangeOp, + SH extends VectorShuffle, + M extends VectorMask> { + V apply(V v, SH sh, M m); } @IntrinsicCandidate public static , - Sh extends VectorShuffle, - E> - V rearrangeOp(Class vectorClass, Class shuffleClass, Class elementType, int vlen, - V v1, Sh sh, - VectorRearrangeOp defaultImpl) { + SH extends VectorShuffle, + M extends VectorMask, + E> + V rearrangeOp(Class vClass, Class shClass, Class mClass, Class eClass, + int length, + V v, SH sh, M m, + VectorRearrangeOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(v1, sh); + return defaultImpl.apply(v, sh, m); } /* ============================================================================ */ - public interface VectorBlendOp, - M extends VectorMask, - E> { - V apply(V v1, V v2, M mask); + public interface VectorBlendOp, + M extends VectorMask> { + V apply(V v1, V v2, M m); } @IntrinsicCandidate @@ -431,33 +565,41 @@ public class VectorSupport { , M extends VectorMask, E> - V blend(Class vectorClass, Class maskClass, Class elementType, int length, + V blend(Class vClass, Class mClass, Class eClass, + int length, V v1, V v2, M m, - VectorBlendOp defaultImpl) { + VectorBlendOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; return defaultImpl.apply(v1, v2, m); } /* ============================================================================ */ - public interface VectorBroadcastIntOp> { - V apply(V v, int n); + public interface VectorBroadcastIntOp, + M extends VectorMask> { + V apply(V v, int n, M m); } @IntrinsicCandidate public static - > - V broadcastInt(int opr, Class vectorClass, Class elementType, int length, - V v, int n, - VectorBroadcastIntOp defaultImpl) { + , + M extends VectorMask, + E> + V broadcastInt(int opr, + Class vClass, Class mClass, Class eClass, + int length, + V v, int n, M m, + VectorBroadcastIntOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; - return defaultImpl.apply(v, n); + return defaultImpl.apply(v, n, m); } /* ============================================================================ */ - public interface VectorConvertOp { - VOUT apply(VIN v, S species); + public interface VectorConvertOp> { + VOUT apply(VIN v, S s); } // Users of this intrinsic assume that it respects @@ -469,8 +611,8 @@ public class VectorSupport { VIN extends VectorPayload, S extends VectorSpecies> VOUT convert(int oprId, - Class fromVectorClass, Class fromElementType, int fromVLen, - Class toVectorClass, Class toElementType, int toVLen, + Class fromVectorClass, Class fromeClass, int fromVLen, + Class toVectorClass, Class toeClass, int toVLen, VIN v, S s, VectorConvertOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; @@ -480,7 +622,9 @@ public class VectorSupport { /* ============================================================================ */ @IntrinsicCandidate - public static V maybeRebox(V v) { + public static + + VP maybeRebox(VP v) { // The fence is added here to avoid memory aliasing problems in C2 between scalar & vector accesses. // TODO: move the fence generation into C2. Generate only when reboxing is taking place. U.loadFence(); @@ -488,15 +632,19 @@ public class VectorSupport { } /* ============================================================================ */ - public interface VectorMaskOp { - int apply(M m); + public interface VectorMaskOp> { + long apply(M m); } @IntrinsicCandidate public static - - int maskReductionCoerced(int oper, Class maskClass, Class elemClass, int length, M m, - VectorMaskOp defaultImpl) { + , + E> + long maskReductionCoerced(int oper, + Class mClass, Class eClass, + int length, + M m, + VectorMaskOp defaultImpl) { assert isNonCapturingLambda(defaultImpl) : defaultImpl; return defaultImpl.apply(m); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java index 81855a4af7d..f12778abf83 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractMask.java @@ -24,6 +24,8 @@ */ package jdk.incubator.vector; +import java.util.Objects; + import jdk.internal.vm.annotation.ForceInline; import static jdk.incubator.vector.VectorOperators.*; @@ -62,24 +64,15 @@ abstract class AbstractMask extends VectorMask { } @Override + @ForceInline public boolean laneIsSet(int i) { - return getBits()[i]; - } - - @Override - public long toLong() { - // FIXME: This should be an intrinsic. - if (length() > Long.SIZE) { - throw new UnsupportedOperationException("too many lanes for one long"); - } - long res = 0; - long set = 1; - boolean[] bits = getBits(); - for (int i = 0; i < bits.length; i++) { - res = bits[i] ? res | set : res; - set = set << 1; + int length = length(); + Objects.checkIndex(i, length); + if (length <= Long.SIZE) { + return ((toLong() >>> i) & 1L) == 1; + } else { + return getBits()[i]; } - return res; } @Override @@ -114,6 +107,23 @@ abstract class AbstractMask extends VectorMask { return (VectorMask) this; } + @Override + @ForceInline + @SuppressWarnings("unchecked") + VectorMask check(Class> maskClass, Vector vector) { + if (!sameSpecies(maskClass, vector)) { + throw AbstractSpecies.checkFailed(this, vector); + } + return (VectorMask) this; + } + + @ForceInline + private boolean sameSpecies(Class> maskClass, Vector vector) { + boolean same = getClass() == maskClass; + assert (same == (vectorSpecies() == vector.species())) : same; + return same; + } + @Override public VectorMask andNot(VectorMask m) { return and(m.not()); @@ -162,6 +172,17 @@ abstract class AbstractMask extends VectorMask { return -1; } + /*package-private*/ + static long toLongHelper(boolean[] bits) { + long res = 0; + long set = 1; + for (int i = 0; i < bits.length; i++) { + res = bits[i] ? res | set : res; + set = set << 1; + } + return res; + } + @Override @ForceInline public VectorMask indexInRange(int offset, int limit) { @@ -215,14 +236,10 @@ abstract class AbstractMask extends VectorMask { int elemCount = Math.min(vlength, (alength - offset) / esize); badMask = checkIndex0(0, elemCount, iota, vlength); } else { - // This requires a split test. int clipOffset = Math.max(offset, -(vlength * esize)); - int elemCount = Math.min(vlength, (alength - clipOffset) / esize); - badMask = checkIndex0(0, elemCount, iota, vlength); - clipOffset &= (esize - 1); // power of two, so OK - VectorMask badMask2 = checkIndex0(clipOffset / esize, vlength, - iota, vlength); - badMask = badMask.or(badMask2); + badMask = checkIndex0(clipOffset, alength, + iota.lanewise(VectorOperators.MUL, esize), + vlength * esize); } badMask = badMask.and(this); if (badMask.anyTrue()) { diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java index 0aedddec2f4..3a2620583bf 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java @@ -236,8 +236,8 @@ final class Byte128Vector extends ByteVector { @ForceInline final @Override - byte rOp(byte v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + byte rOp(byte v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Byte128Vector extends ByteVector { return (Byte128Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Byte128Vector lanewise(Unary op, VectorMask m) { + return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialize + } + @Override @ForceInline public Byte128Vector lanewise(Binary op, Vector v) { return (Byte128Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Byte128Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, v, (Byte128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Byte128Vector @@ -286,15 +298,30 @@ final class Byte128Vector extends ByteVector { return (Byte128Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Byte128Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Byte128Vector) super.lanewiseShiftTemplate(op, Byte128Mask.class, e, (Byte128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Byte128Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Byte128Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Byte128Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Byte128Vector) super.lanewiseTemplate(op, Byte128Mask.class, v1, v2, (Byte128Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Byte128Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Byte128Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Byte128Mask.class, (Byte128Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Byte128Vector extends ByteVector { return super.compareTemplate(Byte128Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Byte128Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Byte128Mask.class, op, v, (Byte128Mask) m); + } + + @Override @ForceInline public Byte128Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Byte128Vector extends ByteVector { VectorMask m) { return (Byte128Vector) super.rearrangeTemplate(Byte128Shuffle.class, + Byte128Mask.class, (Byte128Shuffle) shuffle, (Byte128Mask) m); // specialize } @@ -612,16 +647,12 @@ final class Byte128Vector extends ByteVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Byte128Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -647,9 +678,9 @@ final class Byte128Vector extends ByteVector { public Byte128Mask and(VectorMask mask) { Objects.requireNonNull(mask); Byte128Mask m = (Byte128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte128Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Byte128Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -657,9 +688,9 @@ final class Byte128Vector extends ByteVector { public Byte128Mask or(VectorMask mask) { Objects.requireNonNull(mask); Byte128Mask m = (Byte128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte128Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Byte128Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -667,9 +698,9 @@ final class Byte128Vector extends ByteVector { Byte128Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Byte128Mask m = (Byte128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte128Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte128Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -677,22 +708,32 @@ final class Byte128Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte128Mask.class, byte.class, VLENGTH, this, - (m) -> trueCountHelper(((Byte128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte128Mask.class, byte.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte128Mask.class, byte.class, VLENGTH, this, - (m) -> firstTrueHelper(((Byte128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte128Mask.class, byte.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte128Mask.class, byte.class, VLENGTH, this, - (m) -> lastTrueHelper(((Byte128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte128Mask.class, byte.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte128Mask.class, byte.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -803,6 +844,14 @@ final class Byte128Vector extends ByteVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromArray0(byte[] a, int offset, VectorMask m) { + return super.fromArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize + } + + @ForceInline @Override @@ -811,6 +860,13 @@ final class Byte128Vector extends ByteVector { return super.fromBooleanArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m) { + return super.fromBooleanArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize + } + @ForceInline @Override final @@ -818,6 +874,13 @@ final class Byte128Vector extends ByteVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize + } + @ForceInline @Override final @@ -825,6 +888,13 @@ final class Byte128Vector extends ByteVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Byte128Mask.class, bb, offset, (Byte128Mask) m); // specialize + } + @ForceInline @Override final @@ -832,6 +902,21 @@ final class Byte128Vector extends ByteVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(byte[] a, int offset, VectorMask m) { + super.intoArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); + } + + + @ForceInline + @Override + final + void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { + super.intoBooleanArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); + } + @ForceInline @Override final @@ -839,6 +924,21 @@ final class Byte128Vector extends ByteVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Byte128Mask.class, a, offset, (Byte128Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Byte128Mask.class, bb, offset, (Byte128Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java index 0cb6ec581fa..6fbe00dfdea 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java @@ -236,8 +236,8 @@ final class Byte256Vector extends ByteVector { @ForceInline final @Override - byte rOp(byte v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + byte rOp(byte v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Byte256Vector extends ByteVector { return (Byte256Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Byte256Vector lanewise(Unary op, VectorMask m) { + return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialize + } + @Override @ForceInline public Byte256Vector lanewise(Binary op, Vector v) { return (Byte256Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Byte256Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v, (Byte256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Byte256Vector @@ -286,15 +298,30 @@ final class Byte256Vector extends ByteVector { return (Byte256Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Byte256Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Byte256Vector) super.lanewiseShiftTemplate(op, Byte256Mask.class, e, (Byte256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Byte256Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Byte256Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Byte256Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Byte256Vector) super.lanewiseTemplate(op, Byte256Mask.class, v1, v2, (Byte256Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Byte256Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Byte256Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Byte256Mask.class, (Byte256Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Byte256Vector extends ByteVector { return super.compareTemplate(Byte256Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Byte256Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Byte256Mask.class, op, v, (Byte256Mask) m); + } + + @Override @ForceInline public Byte256Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Byte256Vector extends ByteVector { VectorMask m) { return (Byte256Vector) super.rearrangeTemplate(Byte256Shuffle.class, + Byte256Mask.class, (Byte256Shuffle) shuffle, (Byte256Mask) m); // specialize } @@ -644,16 +679,12 @@ final class Byte256Vector extends ByteVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Byte256Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -679,9 +710,9 @@ final class Byte256Vector extends ByteVector { public Byte256Mask and(VectorMask mask) { Objects.requireNonNull(mask); Byte256Mask m = (Byte256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Byte256Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -689,9 +720,9 @@ final class Byte256Vector extends ByteVector { public Byte256Mask or(VectorMask mask) { Objects.requireNonNull(mask); Byte256Mask m = (Byte256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Byte256Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -699,9 +730,9 @@ final class Byte256Vector extends ByteVector { Byte256Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Byte256Mask m = (Byte256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte256Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -709,22 +740,32 @@ final class Byte256Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte256Mask.class, byte.class, VLENGTH, this, - (m) -> trueCountHelper(((Byte256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte256Mask.class, byte.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, byte.class, VLENGTH, this, - (m) -> firstTrueHelper(((Byte256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte256Mask.class, byte.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.class, byte.class, VLENGTH, this, - (m) -> lastTrueHelper(((Byte256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte256Mask.class, byte.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte256Mask.class, byte.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -835,6 +876,14 @@ final class Byte256Vector extends ByteVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromArray0(byte[] a, int offset, VectorMask m) { + return super.fromArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize + } + + @ForceInline @Override @@ -843,6 +892,13 @@ final class Byte256Vector extends ByteVector { return super.fromBooleanArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m) { + return super.fromBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize + } + @ForceInline @Override final @@ -850,6 +906,13 @@ final class Byte256Vector extends ByteVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize + } + @ForceInline @Override final @@ -857,6 +920,13 @@ final class Byte256Vector extends ByteVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m); // specialize + } + @ForceInline @Override final @@ -864,6 +934,21 @@ final class Byte256Vector extends ByteVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(byte[] a, int offset, VectorMask m) { + super.intoArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); + } + + + @ForceInline + @Override + final + void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { + super.intoBooleanArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); + } + @ForceInline @Override final @@ -871,6 +956,21 @@ final class Byte256Vector extends ByteVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Byte256Mask.class, a, offset, (Byte256Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Byte256Mask.class, bb, offset, (Byte256Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java index c4577c816e8..fd6117a7884 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java @@ -236,8 +236,8 @@ final class Byte512Vector extends ByteVector { @ForceInline final @Override - byte rOp(byte v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + byte rOp(byte v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Byte512Vector extends ByteVector { return (Byte512Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Byte512Vector lanewise(Unary op, VectorMask m) { + return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialize + } + @Override @ForceInline public Byte512Vector lanewise(Binary op, Vector v) { return (Byte512Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Byte512Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, v, (Byte512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Byte512Vector @@ -286,15 +298,30 @@ final class Byte512Vector extends ByteVector { return (Byte512Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Byte512Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Byte512Vector) super.lanewiseShiftTemplate(op, Byte512Mask.class, e, (Byte512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Byte512Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Byte512Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Byte512Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Byte512Vector) super.lanewiseTemplate(op, Byte512Mask.class, v1, v2, (Byte512Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Byte512Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Byte512Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Byte512Mask.class, (Byte512Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Byte512Vector extends ByteVector { return super.compareTemplate(Byte512Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Byte512Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Byte512Mask.class, op, v, (Byte512Mask) m); + } + + @Override @ForceInline public Byte512Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Byte512Vector extends ByteVector { VectorMask m) { return (Byte512Vector) super.rearrangeTemplate(Byte512Shuffle.class, + Byte512Mask.class, (Byte512Shuffle) shuffle, (Byte512Mask) m); // specialize } @@ -708,16 +743,12 @@ final class Byte512Vector extends ByteVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Byte512Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -743,9 +774,9 @@ final class Byte512Vector extends ByteVector { public Byte512Mask and(VectorMask mask) { Objects.requireNonNull(mask); Byte512Mask m = (Byte512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Byte512Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -753,9 +784,9 @@ final class Byte512Vector extends ByteVector { public Byte512Mask or(VectorMask mask) { Objects.requireNonNull(mask); Byte512Mask m = (Byte512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Byte512Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -763,9 +794,9 @@ final class Byte512Vector extends ByteVector { Byte512Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Byte512Mask m = (Byte512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte512Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -773,22 +804,32 @@ final class Byte512Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, byte.class, VLENGTH, this, - (m) -> trueCountHelper(((Byte512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte512Mask.class, byte.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, byte.class, VLENGTH, this, - (m) -> firstTrueHelper(((Byte512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte512Mask.class, byte.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, byte.class, VLENGTH, this, - (m) -> lastTrueHelper(((Byte512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte512Mask.class, byte.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte512Mask.class, byte.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -899,6 +940,14 @@ final class Byte512Vector extends ByteVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromArray0(byte[] a, int offset, VectorMask m) { + return super.fromArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize + } + + @ForceInline @Override @@ -907,6 +956,13 @@ final class Byte512Vector extends ByteVector { return super.fromBooleanArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m) { + return super.fromBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize + } + @ForceInline @Override final @@ -914,6 +970,13 @@ final class Byte512Vector extends ByteVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize + } + @ForceInline @Override final @@ -921,6 +984,13 @@ final class Byte512Vector extends ByteVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Byte512Mask.class, bb, offset, (Byte512Mask) m); // specialize + } + @ForceInline @Override final @@ -928,6 +998,21 @@ final class Byte512Vector extends ByteVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(byte[] a, int offset, VectorMask m) { + super.intoArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); + } + + + @ForceInline + @Override + final + void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { + super.intoBooleanArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); + } + @ForceInline @Override final @@ -935,6 +1020,21 @@ final class Byte512Vector extends ByteVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Byte512Mask.class, a, offset, (Byte512Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Byte512Mask.class, bb, offset, (Byte512Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java index 49df959154d..309f54eaf76 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java @@ -236,8 +236,8 @@ final class Byte64Vector extends ByteVector { @ForceInline final @Override - byte rOp(byte v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + byte rOp(byte v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Byte64Vector extends ByteVector { return (Byte64Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Byte64Vector lanewise(Unary op, VectorMask m) { + return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialize + } + @Override @ForceInline public Byte64Vector lanewise(Binary op, Vector v) { return (Byte64Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Byte64Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v, (Byte64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Byte64Vector @@ -286,15 +298,30 @@ final class Byte64Vector extends ByteVector { return (Byte64Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Byte64Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Byte64Vector) super.lanewiseShiftTemplate(op, Byte64Mask.class, e, (Byte64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Byte64Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Byte64Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Byte64Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Byte64Vector) super.lanewiseTemplate(op, Byte64Mask.class, v1, v2, (Byte64Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Byte64Vector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Byte64Vector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Byte64Mask.class, (Byte64Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Byte64Vector extends ByteVector { return super.compareTemplate(Byte64Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Byte64Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Byte64Mask.class, op, v, (Byte64Mask) m); + } + + @Override @ForceInline public Byte64Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Byte64Vector extends ByteVector { VectorMask m) { return (Byte64Vector) super.rearrangeTemplate(Byte64Shuffle.class, + Byte64Mask.class, (Byte64Shuffle) shuffle, (Byte64Mask) m); // specialize } @@ -596,16 +631,12 @@ final class Byte64Vector extends ByteVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Byte64Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -631,9 +662,9 @@ final class Byte64Vector extends ByteVector { public Byte64Mask and(VectorMask mask) { Objects.requireNonNull(mask); Byte64Mask m = (Byte64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Byte64Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -641,9 +672,9 @@ final class Byte64Vector extends ByteVector { public Byte64Mask or(VectorMask mask) { Objects.requireNonNull(mask); Byte64Mask m = (Byte64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Byte64Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -651,9 +682,9 @@ final class Byte64Vector extends ByteVector { Byte64Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Byte64Mask m = (Byte64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Byte64Mask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -661,22 +692,32 @@ final class Byte64Vector extends ByteVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, byte.class, VLENGTH, this, - (m) -> trueCountHelper(((Byte64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Byte64Mask.class, byte.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, byte.class, VLENGTH, this, - (m) -> firstTrueHelper(((Byte64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Byte64Mask.class, byte.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, byte.class, VLENGTH, this, - (m) -> lastTrueHelper(((Byte64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Byte64Mask.class, byte.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Byte64Mask.class, byte.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -787,6 +828,14 @@ final class Byte64Vector extends ByteVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromArray0(byte[] a, int offset, VectorMask m) { + return super.fromArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize + } + + @ForceInline @Override @@ -795,6 +844,13 @@ final class Byte64Vector extends ByteVector { return super.fromBooleanArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m) { + return super.fromBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize + } + @ForceInline @Override final @@ -802,6 +858,13 @@ final class Byte64Vector extends ByteVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize + } + @ForceInline @Override final @@ -809,6 +872,13 @@ final class Byte64Vector extends ByteVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Byte64Mask.class, bb, offset, (Byte64Mask) m); // specialize + } + @ForceInline @Override final @@ -816,6 +886,21 @@ final class Byte64Vector extends ByteVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(byte[] a, int offset, VectorMask m) { + super.intoArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); + } + + + @ForceInline + @Override + final + void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { + super.intoBooleanArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); + } + @ForceInline @Override final @@ -823,6 +908,21 @@ final class Byte64Vector extends ByteVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Byte64Mask.class, a, offset, (Byte64Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Byte64Mask.class, bb, offset, (Byte64Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java index 696c000a8f0..e27775d61c3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteMaxVector.java @@ -236,8 +236,8 @@ final class ByteMaxVector extends ByteVector { @ForceInline final @Override - byte rOp(byte v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + byte rOp(byte v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class ByteMaxVector extends ByteVector { return (ByteMaxVector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public ByteMaxVector lanewise(Unary op, VectorMask m) { + return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialize + } + @Override @ForceInline public ByteMaxVector lanewise(Binary op, Vector v) { return (ByteMaxVector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public ByteMaxVector lanewise(Binary op, Vector v, VectorMask m) { + return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, v, (ByteMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline ByteMaxVector @@ -286,15 +298,30 @@ final class ByteMaxVector extends ByteVector { return (ByteMaxVector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline ByteMaxVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (ByteMaxVector) super.lanewiseShiftTemplate(op, ByteMaxMask.class, e, (ByteMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final ByteMaxVector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (ByteMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + ByteMaxVector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (ByteMaxVector) super.lanewiseTemplate(op, ByteMaxMask.class, v1, v2, (ByteMaxMask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class ByteMaxVector extends ByteVector { @ForceInline public final byte reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class ByteMaxVector extends ByteVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, ByteMaxMask.class, (ByteMaxMask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class ByteMaxVector extends ByteVector { return super.compareTemplate(ByteMaxMask.class, op, s); // specialize } + @Override + @ForceInline + public final ByteMaxMask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ByteMaxMask.class, op, v, (ByteMaxMask) m); + } + + @Override @ForceInline public ByteMaxVector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class ByteMaxVector extends ByteVector { VectorMask m) { return (ByteMaxVector) super.rearrangeTemplate(ByteMaxShuffle.class, + ByteMaxMask.class, (ByteMaxShuffle) shuffle, (ByteMaxMask) m); // specialize } @@ -582,16 +617,12 @@ final class ByteMaxVector extends ByteVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - ByteMaxMask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -617,9 +648,9 @@ final class ByteMaxVector extends ByteVector { public ByteMaxMask and(VectorMask mask) { Objects.requireNonNull(mask); ByteMaxMask m = (ByteMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, ByteMaxMask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -627,9 +658,9 @@ final class ByteMaxVector extends ByteVector { public ByteMaxMask or(VectorMask mask) { Objects.requireNonNull(mask); ByteMaxMask m = (ByteMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, ByteMaxMask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -637,9 +668,9 @@ final class ByteMaxVector extends ByteVector { ByteMaxMask xor(VectorMask mask) { Objects.requireNonNull(mask); ByteMaxMask m = (ByteMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMaxMask.class, byte.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, ByteMaxMask.class, null, byte.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -647,22 +678,32 @@ final class ByteMaxVector extends ByteVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMaxMask.class, byte.class, VLENGTH, this, - (m) -> trueCountHelper(((ByteMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ByteMaxMask.class, byte.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this, - (m) -> firstTrueHelper(((ByteMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this, - (m) -> lastTrueHelper(((ByteMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ByteMaxMask.class, byte.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ByteMaxMask.class, byte.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -773,6 +814,14 @@ final class ByteMaxVector extends ByteVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromArray0(byte[] a, int offset, VectorMask m) { + return super.fromArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize + } + + @ForceInline @Override @@ -781,6 +830,13 @@ final class ByteMaxVector extends ByteVector { return super.fromBooleanArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m) { + return super.fromBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize + } + @ForceInline @Override final @@ -788,6 +844,13 @@ final class ByteMaxVector extends ByteVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize + } + @ForceInline @Override final @@ -795,6 +858,13 @@ final class ByteMaxVector extends ByteVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(ByteMaxMask.class, bb, offset, (ByteMaxMask) m); // specialize + } + @ForceInline @Override final @@ -802,6 +872,21 @@ final class ByteMaxVector extends ByteVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(byte[] a, int offset, VectorMask m) { + super.intoArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); + } + + + @ForceInline + @Override + final + void intoBooleanArray0(boolean[] a, int offset, VectorMask m) { + super.intoBooleanArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); + } + @ForceInline @Override final @@ -809,6 +894,21 @@ final class ByteMaxVector extends ByteVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(ByteMaxMask.class, a, offset, (ByteMaxMask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(ByteMaxMask.class, bb, offset, (ByteMaxMask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java index 7f42edf8623..32b84aef14b 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -173,6 +172,9 @@ public abstract class ByteVector extends AbstractVector { final ByteVector uOpTemplate(VectorMask m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } byte[] vec = vec(); byte[] res = new byte[length()]; boolean[] mbits = ((AbstractMask)m).getBits(); @@ -216,6 +218,9 @@ public abstract class ByteVector extends AbstractVector { ByteVector bOpTemplate(Vector o, VectorMask m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } byte[] res = new byte[length()]; byte[] vec1 = this.vec(); byte[] vec2 = ((ByteVector)o).vec(); @@ -265,6 +270,9 @@ public abstract class ByteVector extends AbstractVector { Vector o2, VectorMask m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } byte[] res = new byte[length()]; byte[] vec1 = this.vec(); byte[] vec2 = ((ByteVector)o1).vec(); @@ -280,7 +288,22 @@ public abstract class ByteVector extends AbstractVector { /*package-private*/ abstract - byte rOp(byte v, FBinOp f); + byte rOp(byte v, VectorMask m, FBinOp f); + + @ForceInline + final + byte rOpTemplate(byte v, VectorMask m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + byte[] vec = vec(); + boolean[] mbits = ((AbstractMask)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final byte rOpTemplate(byte v, FBinOp f) { @@ -549,37 +572,61 @@ public abstract class ByteVector extends AbstractVector { return blend(broadcast(-1), compare(NE, 0)); } if (op == NOT) { - return broadcast(-1).lanewiseTemplate(XOR, this); + return broadcast(-1).lanewise(XOR, this); } else if (op == NEG) { // FIXME: Support this in the JIT. - return broadcast(0).lanewiseTemplate(SUB, this); + return broadcast(0).lanewise(SUB, this); } } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), byte.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> (byte) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> (byte) Math.abs(a)); - default: return null; - }})); + opc, getClass(), null, byte.class, length(), + this, null, + UN_IMPL.find(op, opc, ByteVector::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, ByteVector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract ByteVector lanewise(VectorOperators.Unary op, - VectorMask m) { - return blend(lanewise(op), m); + VectorMask m); + @ForceInline + final + ByteVector lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } + if (op == NOT) { + return lanewise(XOR, broadcast(-1), m); + } else if (op == NEG) { + return lanewise(NOT, m).lanewise(ADD, broadcast(1), m); + } + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, byte.class, length(), + this, m, + UN_IMPL.find(op, opc, ByteVector::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, ByteVector.class); + + private static UnaryOperation> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> (byte) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> (byte) Math.abs(a)); + default: return null; + } } // Binary lanewise support @@ -599,6 +646,7 @@ public abstract class ByteVector extends AbstractVector { Vector v) { ByteVector that = (ByteVector) v; that.check(this); + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -617,74 +665,110 @@ public abstract class ByteVector extends AbstractVector { that = that.lanewise(NOT); op = AND; } else if (op == DIV) { - VectorMask eqz = that.eq((byte)0); + VectorMask eqz = that.eq((byte) 0); if (eqz.anyTrue()) { throw that.divZeroException(); } } } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), byte.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)Math.min(a, b)); - case VECTOR_OP_AND: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a & b)); - case VECTOR_OP_OR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a | b)); - case VECTOR_OP_XOR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (byte)(a ^ b)); - case VECTOR_OP_LSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (byte)(a << n)); - case VECTOR_OP_RSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (byte)(a >> n)); - case VECTOR_OP_URSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (byte)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, byte.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, ByteVector::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, ByteVector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,byte,VectorMask) */ - @ForceInline - public final + @Override + public abstract ByteVector lanewise(VectorOperators.Binary op, Vector v, - VectorMask m) { + VectorMask m); + @ForceInline + final + ByteVector lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector v, VectorMask m) { ByteVector that = (ByteVector) v; - if (op == DIV) { - VectorMask eqz = that.eq((byte)0); - if (eqz.and(m).anyTrue()) { - throw that.divZeroException(); + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { + if (op == FIRST_NONZERO) { + // FIXME: Support this in the JIT. + VectorMask thisNZ + = this.viewAsIntegralLanes().compare(NE, (byte) 0); + that = that.blend((byte) 0, thisNZ.cast(vspecies())); + op = OR_UNCHECKED; + } + if (opKind(op, VO_SHIFT)) { + // As per shift specification for Java, mask the shift count. + // This allows the JIT to ignore some ISA details. + that = that.lanewise(AND, SHIFT_MASK); + } + if (op == AND_NOT) { + // FIXME: Support this in the JIT. + that = that.lanewise(NOT); + op = AND; + } else if (op == DIV) { + VectorMask eqz = that.eq((byte)0); + if (eqz.and(m).anyTrue()) { + throw that.divZeroException(); + } + // suppress div/0 exceptions in unset lanes + that = that.lanewise(NOT, eqz); } - // suppress div/0 exceptions in unset lanes - that = that.lanewise(NOT, eqz); - return blend(lanewise(DIV, that), m); } - return blend(lanewise(op, v), m); + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, byte.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, ByteVector::binaryOperations)); + } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, ByteVector.class); + + private static BinaryOperation> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)Math.min(a, b)); + case VECTOR_OP_AND: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a & b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a | b)); + case VECTOR_OP_XOR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (byte)(a ^ b)); + case VECTOR_OP_LSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (byte)(a << n)); + case VECTOR_OP_RSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (byte)(a >> n)); + case VECTOR_OP_URSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (byte)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateRight(a, (int)n)); + default: return null; + } } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -747,7 +831,13 @@ public abstract class ByteVector extends AbstractVector { ByteVector lanewise(VectorOperators.Binary op, byte e, VectorMask m) { - return blend(lanewise(op, e), m); + if (opKind(op, VO_SHIFT) && (byte)(int)e == e) { + return lanewiseShift(op, (int) e, m); + } + if (op == AND_NOT) { + op = AND; e = (byte) ~e; + } + return lanewise(op, broadcast(e), m); } /** @@ -767,8 +857,7 @@ public abstract class ByteVector extends AbstractVector { byte e1 = (byte) e; if ((long)e1 != e // allow shift ops to clip down their int parameters - && !(opKind(op, VO_SHIFT) && (int)e1 == e) - ) { + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { vspecies().checkValue(e); // for exception } return lanewise(op, e1); @@ -788,7 +877,13 @@ public abstract class ByteVector extends AbstractVector { public final ByteVector lanewise(VectorOperators.Binary op, long e, VectorMask m) { - return blend(lanewise(op, e), m); + byte e1 = (byte) e; + if ((long)e1 != e + // allow shift ops to clip down their int parameters + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { + vspecies().checkValue(e); // for exception + } + return lanewise(op, e1, m); } /*package-private*/ @@ -805,27 +900,52 @@ public abstract class ByteVector extends AbstractVector { e &= SHIFT_MASK; int opc = opCode(op); return VectorSupport.broadcastInt( - opc, getClass(), byte.class, length(), - this, e, - BIN_INT_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_LSHIFT: return (v, n) -> - v.uOp((i, a) -> (byte)(a << n)); - case VECTOR_OP_RSHIFT: return (v, n) -> - v.uOp((i, a) -> (byte)(a >> n)); - case VECTOR_OP_URSHIFT: return (v, n) -> - v.uOp((i, a) -> (byte)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v, n) -> - v.uOp((i, a) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v, n) -> - v.uOp((i, a) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, byte.class, length(), + this, e, null, + BIN_INT_IMPL.find(op, opc, ByteVector::broadcastIntOperations)); } + + /*package-private*/ + abstract ByteVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m); + + /*package-private*/ + @ForceInline + final ByteVector + lanewiseShiftTemplate(VectorOperators.Binary op, + Class> maskClass, + int e, VectorMask m) { + m.check(maskClass, this); + assert(opKind(op, VO_SHIFT)); + // As per shift specification for Java, mask the shift count. + e &= SHIFT_MASK; + int opc = opCode(op); + return VectorSupport.broadcastInt( + opc, getClass(), maskClass, byte.class, length(), + this, e, m, + BIN_INT_IMPL.find(op, opc, ByteVector::broadcastIntOperations)); + } + private static final - ImplCache> BIN_INT_IMPL + ImplCache>> BIN_INT_IMPL = new ImplCache<>(Binary.class, ByteVector.class); + private static VectorBroadcastIntOp> broadcastIntOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_LSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (byte)(a << n)); + case VECTOR_OP_RSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (byte)(a >> n)); + case VECTOR_OP_URSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (byte)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateRight(a, (int)n)); + default: return null; + } + } + // As per shift specification for Java, mask the shift count. // We mask 0X3F (long), 0X1F (int), 0x0F (short), 0x7 (byte). // The latter two maskings go beyond the JLS, but seem reasonable @@ -878,16 +998,10 @@ public abstract class ByteVector extends AbstractVector { } int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), byte.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - default: return null; - }})); + opc, getClass(), null, byte.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, ByteVector::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, ByteVector.class); /** * {@inheritDoc} @@ -895,13 +1009,48 @@ public abstract class ByteVector extends AbstractVector { * @see #lanewise(VectorOperators.Ternary,Vector,byte,VectorMask) * @see #lanewise(VectorOperators.Ternary,byte,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract ByteVector lanewise(VectorOperators.Ternary op, Vector v1, Vector v2, - VectorMask m) { - return blend(lanewise(op, v1, v2), m); + VectorMask m); + @ForceInline + final + ByteVector lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector v1, + Vector v2, + VectorMask m) { + ByteVector that = (ByteVector) v1; + ByteVector tother = (ByteVector) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + + if (op == BITWISE_BLEND) { + // FIXME: Support this in the JIT. + that = this.lanewise(XOR, that).lanewise(AND, tother); + return this.lanewise(XOR, that, m); + } + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, byte.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, ByteVector::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, ByteVector.class); + + private static TernaryOperation> ternaryOperations(int opc_) { + switch (opc_) { + default: return null; + } } /** @@ -958,7 +1107,7 @@ public abstract class ByteVector extends AbstractVector { byte e1, byte e2, VectorMask m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -1016,7 +1165,7 @@ public abstract class ByteVector extends AbstractVector { Vector v1, byte e2, VectorMask m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -1073,7 +1222,7 @@ public abstract class ByteVector extends AbstractVector { byte e1, Vector v2, VectorMask m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -1745,15 +1894,13 @@ public abstract class ByteVector extends AbstractVector { final > M compareTemplate(Class maskType, Comparison op, Vector v) { - Objects.requireNonNull(v); - ByteSpecies vsp = vspecies(); ByteVector that = (ByteVector) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, byte.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -1763,6 +1910,28 @@ public abstract class ByteVector extends AbstractVector { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector v, M m) { + ByteVector that = (ByteVector) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, byte.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, byte a, byte b) { return switch (cond) { @@ -1780,18 +1949,6 @@ public abstract class ByteVector extends AbstractVector { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask compare(VectorOperators.Comparison op, - Vector v, - VectorMask m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -1850,7 +2007,7 @@ public abstract class ByteVector extends AbstractVector { public final VectorMask compare(VectorOperators.Comparison op, byte e, VectorMask m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } /** @@ -2101,9 +2258,9 @@ public abstract class ByteVector extends AbstractVector { ByteVector rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, byte.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, byte.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2120,24 +2277,25 @@ public abstract class ByteVector extends AbstractVector { /*package-private*/ @ForceInline final - > + , M extends VectorMask> ByteVector rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask m) { - ByteVector unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, byte.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast((byte)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, byte.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2160,17 +2318,17 @@ public abstract class ByteVector extends AbstractVector { S ws = (S) shuffle.wrapIndexes(); ByteVector r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, byte.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, byte.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); ByteVector r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, byte.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, byte.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2433,9 +2591,18 @@ public abstract class ByteVector extends AbstractVector { @ForceInline final byte reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask m) { - ByteVector v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + ByteVector v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, byte.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, ByteVector::reductionOperations))); } /*package-private*/ @@ -2450,30 +2617,34 @@ public abstract class ByteVector extends AbstractVector { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), byte.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp((byte)0, (i, a, b) -> (byte)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp((byte)1, (i, a, b) -> (byte)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (byte) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (byte) Math.max(a, b))); - case VECTOR_OP_AND: return v -> - toBits(v.rOp((byte)-1, (i, a, b) -> (byte)(a & b))); - case VECTOR_OP_OR: return v -> - toBits(v.rOp((byte)0, (i, a, b) -> (byte)(a | b))); - case VECTOR_OP_XOR: return v -> - toBits(v.rOp((byte)0, (i, a, b) -> (byte)(a ^ b))); - default: return null; - }}))); + opc, getClass(), null, byte.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, ByteVector::reductionOperations))); } + private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, ByteVector.class); + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, ByteVector.class); + + private static ReductionOperation> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp((byte)0, m, (i, a, b) -> (byte)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp((byte)1, m, (i, a, b) -> (byte)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (byte) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (byte) Math.max(a, b))); + case VECTOR_OP_AND: return (v, m) -> + toBits(v.rOp((byte)-1, m, (i, a, b) -> (byte)(a & b))); + case VECTOR_OP_OR: return (v, m) -> + toBits(v.rOp((byte)0, m, (i, a, b) -> (byte)(a | b))); + case VECTOR_OP_XOR: return (v, m) -> + toBits(v.rOp((byte)0, m, (i, a, b) -> (byte)(a ^ b))); + default: return null; + } + } private @ForceInline @@ -2699,9 +2870,7 @@ public abstract class ByteVector extends AbstractVector { VectorMask m) { ByteSpecies vsp = (ByteSpecies) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - ByteVector zero = vsp.zero(); - ByteVector v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2763,8 +2932,7 @@ public abstract class ByteVector extends AbstractVector { VectorMask m) { ByteSpecies vsp = (ByteSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - ByteVector zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -2921,7 +3089,7 @@ public abstract class ByteVector extends AbstractVector { ByteSpecies vsp = (ByteSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { ByteVector zero = vsp.zero(); - return zero.blend(zero.fromBooleanArray0(a, offset), m); + return vsp.dummyVector().fromBooleanArray0(a, offset, m); } // FIXME: optimize @@ -3099,9 +3267,7 @@ public abstract class ByteVector extends AbstractVector { VectorMask m) { ByteSpecies vsp = (ByteSpecies) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - ByteVector zero = vsp.zero(); - ByteVector v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -3173,10 +3339,9 @@ public abstract class ByteVector extends AbstractVector { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize ByteSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -3329,10 +3494,9 @@ public abstract class ByteVector extends AbstractVector { if (m.allTrue()) { intoBooleanArray(a, offset); } else { - // FIXME: optimize ByteSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, e) -> arr[off+i] = (e & 1) != 0); + intoBooleanArray0(a, offset, m); } } @@ -3451,12 +3615,9 @@ public abstract class ByteVector extends AbstractVector { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize ByteSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.put(o + i * 1, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -3468,7 +3629,7 @@ public abstract class ByteVector extends AbstractVector { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -3487,15 +3648,12 @@ public abstract class ByteVector extends AbstractVector { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } ByteSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.put(o + i * 1, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -3533,6 +3691,24 @@ public abstract class ByteVector extends AbstractVector { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + ByteVector fromArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + ByteVector fromArray0Template(Class maskClass, byte[] a, int offset, M m) { + m.check(species()); + ByteSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + + /*package-private*/ abstract @@ -3549,6 +3725,23 @@ public abstract class ByteVector extends AbstractVector { (arr_, off_, i) -> (byte) (arr_[off_ + i] ? 1 : 0))); } + /*package-private*/ + abstract + ByteVector fromBooleanArray0(boolean[] a, int offset, VectorMask m); + @ForceInline + final + > + ByteVector fromBooleanArray0Template(Class maskClass, boolean[] a, int offset, M m) { + m.check(species()); + ByteSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, booleanArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> (byte) (arr_[off_ + i] ? 1 : 0))); + } + @Override abstract ByteVector fromByteArray0(byte[] a, int offset); @@ -3567,6 +3760,25 @@ public abstract class ByteVector extends AbstractVector { }); } + abstract + ByteVector fromByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + ByteVector fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + ByteSpecies vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.get(o + i * 1)); + }); + } + abstract ByteVector fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -3583,6 +3795,24 @@ public abstract class ByteVector extends AbstractVector { }); } + abstract + ByteVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + ByteVector fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + ByteSpecies vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.get(o + i * 1)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -3602,6 +3832,42 @@ public abstract class ByteVector extends AbstractVector { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, byte[] a, int offset, M m) { + m.check(species()); + ByteSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + + + abstract + void intoBooleanArray0(boolean[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoBooleanArray0Template(Class maskClass, boolean[] a, int offset, M m) { + m.check(species()); + ByteSpecies vsp = vspecies(); + ByteVector normalized = this.and((byte) 1); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, booleanArrayAddress(a, offset), + normalized, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = (e & 1) != 0)); + } + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -3619,6 +3885,25 @@ public abstract class ByteVector extends AbstractVector { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + ByteSpecies vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.put(o + i * 1, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -3633,6 +3918,25 @@ public abstract class ByteVector extends AbstractVector { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + ByteSpecies vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.put(o + i * 1, e)); + }); + } + + // End of low-level memory operations. private static @@ -3959,7 +4263,7 @@ public abstract class ByteVector extends AbstractVector { /*package-private*/ @ForceInline ByteVector ldOp(M memory, int offset, - AbstractMask m, + VectorMask m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java index 6ac3f40f80b..62f2eb5eff5 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java @@ -236,8 +236,8 @@ final class Double128Vector extends DoubleVector { @ForceInline final @Override - double rOp(double v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + double rOp(double v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Double128Vector extends DoubleVector { return (Double128Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Double128Vector lanewise(Unary op, VectorMask m) { + return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, (Double128Mask) m); // specialize + } + @Override @ForceInline public Double128Vector lanewise(Binary op, Vector v) { return (Double128Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Double128Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, v, (Double128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Double128Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Double128Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Double128Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Double128Vector) super.lanewiseTemplate(op, Double128Mask.class, v1, v2, (Double128Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Double128Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Double128Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Double128Mask.class, (Double128Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Double128Vector extends DoubleVector { return super.compareTemplate(Double128Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Double128Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Double128Mask.class, op, v, (Double128Mask) m); + } + + @Override @ForceInline public Double128Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Double128Vector extends DoubleVector { VectorMask m) { return (Double128Vector) super.rearrangeTemplate(Double128Shuffle.class, + Double128Mask.class, (Double128Shuffle) shuffle, (Double128Mask) m); // specialize } @@ -580,16 +608,12 @@ final class Double128Vector extends DoubleVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Double128Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -615,9 +639,9 @@ final class Double128Vector extends DoubleVector { public Double128Mask and(VectorMask mask) { Objects.requireNonNull(mask); Double128Mask m = (Double128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double128Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Double128Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -625,9 +649,9 @@ final class Double128Vector extends DoubleVector { public Double128Mask or(VectorMask mask) { Objects.requireNonNull(mask); Double128Mask m = (Double128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double128Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Double128Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -635,9 +659,9 @@ final class Double128Vector extends DoubleVector { Double128Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Double128Mask m = (Double128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double128Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Double128Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -645,22 +669,32 @@ final class Double128Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double128Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Double128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double128Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double128Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Double128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double128Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double128Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Double128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double128Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double128Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -771,6 +805,20 @@ final class Double128Vector extends DoubleVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, VectorMask m) { + return super.fromArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); // specialize + } + + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Double128Mask.class, a, offset, indexMap, mapOffset, (Double128Mask) m); + } + @ForceInline @@ -780,6 +828,13 @@ final class Double128Vector extends DoubleVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); // specialize + } + @ForceInline @Override final @@ -787,6 +842,13 @@ final class Double128Vector extends DoubleVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Double128Mask.class, bb, offset, (Double128Mask) m); // specialize + } + @ForceInline @Override final @@ -794,6 +856,21 @@ final class Double128Vector extends DoubleVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, VectorMask m) { + super.intoArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Double128Mask.class, a, offset, indexMap, mapOffset, (Double128Mask) m); + } + + @ForceInline @Override final @@ -801,6 +878,21 @@ final class Double128Vector extends DoubleVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Double128Mask.class, a, offset, (Double128Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Double128Mask.class, bb, offset, (Double128Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java index 194668361aa..547684af87d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java @@ -236,8 +236,8 @@ final class Double256Vector extends DoubleVector { @ForceInline final @Override - double rOp(double v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + double rOp(double v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Double256Vector extends DoubleVector { return (Double256Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Double256Vector lanewise(Unary op, VectorMask m) { + return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, (Double256Mask) m); // specialize + } + @Override @ForceInline public Double256Vector lanewise(Binary op, Vector v) { return (Double256Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Double256Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, v, (Double256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Double256Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Double256Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Double256Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Double256Vector) super.lanewiseTemplate(op, Double256Mask.class, v1, v2, (Double256Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Double256Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Double256Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Double256Mask.class, (Double256Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Double256Vector extends DoubleVector { return super.compareTemplate(Double256Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Double256Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Double256Mask.class, op, v, (Double256Mask) m); + } + + @Override @ForceInline public Double256Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Double256Vector extends DoubleVector { VectorMask m) { return (Double256Vector) super.rearrangeTemplate(Double256Shuffle.class, + Double256Mask.class, (Double256Shuffle) shuffle, (Double256Mask) m); // specialize } @@ -584,16 +612,12 @@ final class Double256Vector extends DoubleVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Double256Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -619,9 +643,9 @@ final class Double256Vector extends DoubleVector { public Double256Mask and(VectorMask mask) { Objects.requireNonNull(mask); Double256Mask m = (Double256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double256Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Double256Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -629,9 +653,9 @@ final class Double256Vector extends DoubleVector { public Double256Mask or(VectorMask mask) { Objects.requireNonNull(mask); Double256Mask m = (Double256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double256Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Double256Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -639,9 +663,9 @@ final class Double256Vector extends DoubleVector { Double256Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Double256Mask m = (Double256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double256Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Double256Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -649,22 +673,32 @@ final class Double256Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double256Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Double256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double256Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double256Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Double256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double256Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double256Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Double256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double256Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double256Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -775,6 +809,20 @@ final class Double256Vector extends DoubleVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, VectorMask m) { + return super.fromArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); // specialize + } + + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Double256Mask.class, a, offset, indexMap, mapOffset, (Double256Mask) m); + } + @ForceInline @@ -784,6 +832,13 @@ final class Double256Vector extends DoubleVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); // specialize + } + @ForceInline @Override final @@ -791,6 +846,13 @@ final class Double256Vector extends DoubleVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Double256Mask.class, bb, offset, (Double256Mask) m); // specialize + } + @ForceInline @Override final @@ -798,6 +860,21 @@ final class Double256Vector extends DoubleVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, VectorMask m) { + super.intoArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Double256Mask.class, a, offset, indexMap, mapOffset, (Double256Mask) m); + } + + @ForceInline @Override final @@ -805,6 +882,21 @@ final class Double256Vector extends DoubleVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Double256Mask.class, a, offset, (Double256Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Double256Mask.class, bb, offset, (Double256Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java index 2b090b9cefd..bacc0cde088 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java @@ -236,8 +236,8 @@ final class Double512Vector extends DoubleVector { @ForceInline final @Override - double rOp(double v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + double rOp(double v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Double512Vector extends DoubleVector { return (Double512Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Double512Vector lanewise(Unary op, VectorMask m) { + return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, (Double512Mask) m); // specialize + } + @Override @ForceInline public Double512Vector lanewise(Binary op, Vector v) { return (Double512Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Double512Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, v, (Double512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Double512Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Double512Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Double512Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Double512Vector) super.lanewiseTemplate(op, Double512Mask.class, v1, v2, (Double512Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Double512Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Double512Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Double512Mask.class, (Double512Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Double512Vector extends DoubleVector { return super.compareTemplate(Double512Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Double512Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Double512Mask.class, op, v, (Double512Mask) m); + } + + @Override @ForceInline public Double512Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Double512Vector extends DoubleVector { VectorMask m) { return (Double512Vector) super.rearrangeTemplate(Double512Shuffle.class, + Double512Mask.class, (Double512Shuffle) shuffle, (Double512Mask) m); // specialize } @@ -592,16 +620,12 @@ final class Double512Vector extends DoubleVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Double512Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -627,9 +651,9 @@ final class Double512Vector extends DoubleVector { public Double512Mask and(VectorMask mask) { Objects.requireNonNull(mask); Double512Mask m = (Double512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double512Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Double512Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -637,9 +661,9 @@ final class Double512Vector extends DoubleVector { public Double512Mask or(VectorMask mask) { Objects.requireNonNull(mask); Double512Mask m = (Double512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double512Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Double512Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -647,9 +671,9 @@ final class Double512Vector extends DoubleVector { Double512Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Double512Mask m = (Double512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double512Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Double512Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -657,22 +681,32 @@ final class Double512Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double512Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Double512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double512Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double512Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Double512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double512Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double512Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Double512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double512Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double512Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -783,6 +817,20 @@ final class Double512Vector extends DoubleVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, VectorMask m) { + return super.fromArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); // specialize + } + + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Double512Mask.class, a, offset, indexMap, mapOffset, (Double512Mask) m); + } + @ForceInline @@ -792,6 +840,13 @@ final class Double512Vector extends DoubleVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); // specialize + } + @ForceInline @Override final @@ -799,6 +854,13 @@ final class Double512Vector extends DoubleVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Double512Mask.class, bb, offset, (Double512Mask) m); // specialize + } + @ForceInline @Override final @@ -806,6 +868,21 @@ final class Double512Vector extends DoubleVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, VectorMask m) { + super.intoArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Double512Mask.class, a, offset, indexMap, mapOffset, (Double512Mask) m); + } + + @ForceInline @Override final @@ -813,6 +890,21 @@ final class Double512Vector extends DoubleVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Double512Mask.class, a, offset, (Double512Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Double512Mask.class, bb, offset, (Double512Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java index 48b6d3e63ea..29977c72c6a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java @@ -236,8 +236,8 @@ final class Double64Vector extends DoubleVector { @ForceInline final @Override - double rOp(double v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + double rOp(double v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Double64Vector extends DoubleVector { return (Double64Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Double64Vector lanewise(Unary op, VectorMask m) { + return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, (Double64Mask) m); // specialize + } + @Override @ForceInline public Double64Vector lanewise(Binary op, Vector v) { return (Double64Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Double64Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, v, (Double64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Double64Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Double64Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Double64Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Double64Vector) super.lanewiseTemplate(op, Double64Mask.class, v1, v2, (Double64Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Double64Vector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Double64Vector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Double64Mask.class, (Double64Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Double64Vector extends DoubleVector { return super.compareTemplate(Double64Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Double64Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Double64Mask.class, op, v, (Double64Mask) m); + } + + @Override @ForceInline public Double64Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Double64Vector extends DoubleVector { VectorMask m) { return (Double64Vector) super.rearrangeTemplate(Double64Shuffle.class, + Double64Mask.class, (Double64Shuffle) shuffle, (Double64Mask) m); // specialize } @@ -578,16 +606,12 @@ final class Double64Vector extends DoubleVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Double64Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -613,9 +637,9 @@ final class Double64Vector extends DoubleVector { public Double64Mask and(VectorMask mask) { Objects.requireNonNull(mask); Double64Mask m = (Double64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Double64Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Double64Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -623,9 +647,9 @@ final class Double64Vector extends DoubleVector { public Double64Mask or(VectorMask mask) { Objects.requireNonNull(mask); Double64Mask m = (Double64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Double64Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Double64Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -633,9 +657,9 @@ final class Double64Vector extends DoubleVector { Double64Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Double64Mask m = (Double64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Double64Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Double64Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -643,22 +667,32 @@ final class Double64Vector extends DoubleVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double64Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Double64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Double64Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double64Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Double64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Double64Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double64Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Double64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Double64Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Double64Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -769,6 +803,20 @@ final class Double64Vector extends DoubleVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, VectorMask m) { + return super.fromArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); // specialize + } + + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Double64Mask.class, a, offset, indexMap, mapOffset, (Double64Mask) m); + } + @ForceInline @@ -778,6 +826,13 @@ final class Double64Vector extends DoubleVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); // specialize + } + @ForceInline @Override final @@ -785,6 +840,13 @@ final class Double64Vector extends DoubleVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Double64Mask.class, bb, offset, (Double64Mask) m); // specialize + } + @ForceInline @Override final @@ -792,6 +854,21 @@ final class Double64Vector extends DoubleVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, VectorMask m) { + super.intoArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Double64Mask.class, a, offset, indexMap, mapOffset, (Double64Mask) m); + } + + @ForceInline @Override final @@ -799,6 +876,21 @@ final class Double64Vector extends DoubleVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Double64Mask.class, a, offset, (Double64Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Double64Mask.class, bb, offset, (Double64Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java index b12021a123d..c9db9f93b40 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleMaxVector.java @@ -236,8 +236,8 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline final @Override - double rOp(double v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + double rOp(double v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class DoubleMaxVector extends DoubleVector { return (DoubleMaxVector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public DoubleMaxVector lanewise(Unary op, VectorMask m) { + return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialize + } + @Override @ForceInline public DoubleMaxVector lanewise(Binary op, Vector v) { return (DoubleMaxVector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public DoubleMaxVector lanewise(Binary op, Vector v, VectorMask m) { + return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, v, (DoubleMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final DoubleMaxVector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (DoubleMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + DoubleMaxVector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (DoubleMaxVector) super.lanewiseTemplate(op, DoubleMaxMask.class, v1, v2, (DoubleMaxMask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline public final double reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class DoubleMaxVector extends DoubleVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, DoubleMaxMask.class, (DoubleMaxMask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class DoubleMaxVector extends DoubleVector { return super.compareTemplate(DoubleMaxMask.class, op, s); // specialize } + @Override + @ForceInline + public final DoubleMaxMask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(DoubleMaxMask.class, op, v, (DoubleMaxMask) m); + } + + @Override @ForceInline public DoubleMaxVector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class DoubleMaxVector extends DoubleVector { VectorMask m) { return (DoubleMaxVector) super.rearrangeTemplate(DoubleMaxShuffle.class, + DoubleMaxMask.class, (DoubleMaxShuffle) shuffle, (DoubleMaxMask) m); // specialize } @@ -577,16 +605,12 @@ final class DoubleMaxVector extends DoubleVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - DoubleMaxMask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -612,9 +636,9 @@ final class DoubleMaxVector extends DoubleVector { public DoubleMaxMask and(VectorMask mask) { Objects.requireNonNull(mask); DoubleMaxMask m = (DoubleMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMaxMask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, DoubleMaxMask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -622,9 +646,9 @@ final class DoubleMaxVector extends DoubleVector { public DoubleMaxMask or(VectorMask mask) { Objects.requireNonNull(mask); DoubleMaxMask m = (DoubleMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMaxMask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, DoubleMaxMask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -632,9 +656,9 @@ final class DoubleMaxVector extends DoubleVector { DoubleMaxMask xor(VectorMask mask) { Objects.requireNonNull(mask); DoubleMaxMask m = (DoubleMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMaxMask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, DoubleMaxMask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -642,22 +666,32 @@ final class DoubleMaxVector extends DoubleVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMaxMask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((DoubleMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, DoubleMaxMask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((DoubleMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((DoubleMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, DoubleMaxMask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, DoubleMaxMask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -768,6 +802,20 @@ final class DoubleMaxVector extends DoubleVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, VectorMask m) { + return super.fromArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); // specialize + } + + @ForceInline + @Override + final + DoubleVector fromArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(DoubleMaxMask.class, a, offset, indexMap, mapOffset, (DoubleMaxMask) m); + } + @ForceInline @@ -777,6 +825,13 @@ final class DoubleMaxVector extends DoubleVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); // specialize + } + @ForceInline @Override final @@ -784,6 +839,13 @@ final class DoubleMaxVector extends DoubleVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(DoubleMaxMask.class, bb, offset, (DoubleMaxMask) m); // specialize + } + @ForceInline @Override final @@ -791,6 +853,21 @@ final class DoubleMaxVector extends DoubleVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, VectorMask m) { + super.intoArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); + } + + @ForceInline + @Override + final + void intoArray0(double[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(DoubleMaxMask.class, a, offset, indexMap, mapOffset, (DoubleMaxMask) m); + } + + @ForceInline @Override final @@ -798,6 +875,21 @@ final class DoubleMaxVector extends DoubleVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(DoubleMaxMask.class, a, offset, (DoubleMaxMask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(DoubleMaxMask.class, bb, offset, (DoubleMaxMask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java index 4c3746b745f..691a4def745 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -173,6 +172,9 @@ public abstract class DoubleVector extends AbstractVector { final DoubleVector uOpTemplate(VectorMask m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } double[] vec = vec(); double[] res = new double[length()]; boolean[] mbits = ((AbstractMask)m).getBits(); @@ -216,6 +218,9 @@ public abstract class DoubleVector extends AbstractVector { DoubleVector bOpTemplate(Vector o, VectorMask m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } double[] res = new double[length()]; double[] vec1 = this.vec(); double[] vec2 = ((DoubleVector)o).vec(); @@ -265,6 +270,9 @@ public abstract class DoubleVector extends AbstractVector { Vector o2, VectorMask m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } double[] res = new double[length()]; double[] vec1 = this.vec(); double[] vec2 = ((DoubleVector)o1).vec(); @@ -280,7 +288,22 @@ public abstract class DoubleVector extends AbstractVector { /*package-private*/ abstract - double rOp(double v, FBinOp f); + double rOp(double v, VectorMask m, FBinOp f); + + @ForceInline + final + double rOpTemplate(double v, VectorMask m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + double[] vec = vec(); + boolean[] mbits = ((AbstractMask)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final double rOpTemplate(double v, FBinOp f) { @@ -540,61 +563,80 @@ public abstract class DoubleVector extends AbstractVector { } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), double.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> (double) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> (double) Math.abs(a)); - case VECTOR_OP_SIN: return v0 -> - v0.uOp((i, a) -> (double) Math.sin(a)); - case VECTOR_OP_COS: return v0 -> - v0.uOp((i, a) -> (double) Math.cos(a)); - case VECTOR_OP_TAN: return v0 -> - v0.uOp((i, a) -> (double) Math.tan(a)); - case VECTOR_OP_ASIN: return v0 -> - v0.uOp((i, a) -> (double) Math.asin(a)); - case VECTOR_OP_ACOS: return v0 -> - v0.uOp((i, a) -> (double) Math.acos(a)); - case VECTOR_OP_ATAN: return v0 -> - v0.uOp((i, a) -> (double) Math.atan(a)); - case VECTOR_OP_EXP: return v0 -> - v0.uOp((i, a) -> (double) Math.exp(a)); - case VECTOR_OP_LOG: return v0 -> - v0.uOp((i, a) -> (double) Math.log(a)); - case VECTOR_OP_LOG10: return v0 -> - v0.uOp((i, a) -> (double) Math.log10(a)); - case VECTOR_OP_SQRT: return v0 -> - v0.uOp((i, a) -> (double) Math.sqrt(a)); - case VECTOR_OP_CBRT: return v0 -> - v0.uOp((i, a) -> (double) Math.cbrt(a)); - case VECTOR_OP_SINH: return v0 -> - v0.uOp((i, a) -> (double) Math.sinh(a)); - case VECTOR_OP_COSH: return v0 -> - v0.uOp((i, a) -> (double) Math.cosh(a)); - case VECTOR_OP_TANH: return v0 -> - v0.uOp((i, a) -> (double) Math.tanh(a)); - case VECTOR_OP_EXPM1: return v0 -> - v0.uOp((i, a) -> (double) Math.expm1(a)); - case VECTOR_OP_LOG1P: return v0 -> - v0.uOp((i, a) -> (double) Math.log1p(a)); - default: return null; - }})); + opc, getClass(), null, double.class, length(), + this, null, + UN_IMPL.find(op, opc, DoubleVector::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, DoubleVector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract DoubleVector lanewise(VectorOperators.Unary op, - VectorMask m) { - return blend(lanewise(op), m); + VectorMask m); + @ForceInline + final + DoubleVector lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, double.class, length(), + this, m, + UN_IMPL.find(op, opc, DoubleVector::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, DoubleVector.class); + + private static UnaryOperation> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.abs(a)); + case VECTOR_OP_SIN: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.sin(a)); + case VECTOR_OP_COS: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.cos(a)); + case VECTOR_OP_TAN: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.tan(a)); + case VECTOR_OP_ASIN: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.asin(a)); + case VECTOR_OP_ACOS: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.acos(a)); + case VECTOR_OP_ATAN: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.atan(a)); + case VECTOR_OP_EXP: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.exp(a)); + case VECTOR_OP_LOG: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.log(a)); + case VECTOR_OP_LOG10: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.log10(a)); + case VECTOR_OP_SQRT: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.sqrt(a)); + case VECTOR_OP_CBRT: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.cbrt(a)); + case VECTOR_OP_SINH: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.sinh(a)); + case VECTOR_OP_COSH: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.cosh(a)); + case VECTOR_OP_TANH: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.tanh(a)); + case VECTOR_OP_EXPM1: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.expm1(a)); + case VECTOR_OP_LOG1P: return (v0, m) -> + v0.uOp(m, (i, a) -> (double) Math.log1p(a)); + default: return null; + } } // Binary lanewise support @@ -614,6 +656,7 @@ public abstract class DoubleVector extends AbstractVector { Vector v) { DoubleVector that = (DoubleVector) v; that.check(this); + if (opKind(op, VO_SPECIAL )) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -627,48 +670,75 @@ public abstract class DoubleVector extends AbstractVector { .viewAsFloatingLanes(); } } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), double.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double)Math.min(a, b)); - case VECTOR_OP_ATAN2: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double) Math.atan2(a, b)); - case VECTOR_OP_POW: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double) Math.pow(a, b)); - case VECTOR_OP_HYPOT: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (double) Math.hypot(a, b)); - default: return null; - }})); + opc, getClass(), null, double.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, DoubleVector::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, DoubleVector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,double,VectorMask) */ - @ForceInline - public final + @Override + public abstract DoubleVector lanewise(VectorOperators.Binary op, Vector v, - VectorMask m) { - return blend(lanewise(op, v), m); + VectorMask m); + @ForceInline + final + DoubleVector lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector v, VectorMask m) { + DoubleVector that = (DoubleVector) v; + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL )) { + if (op == FIRST_NONZERO) { + return blend(lanewise(op, v), m); + } + } + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, double.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, DoubleVector::binaryOperations)); } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, DoubleVector.class); + + private static BinaryOperation> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double)Math.min(a, b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> fromBits(toBits(a) | toBits(b))); + case VECTOR_OP_ATAN2: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double) Math.atan2(a, b)); + case VECTOR_OP_POW: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double) Math.pow(a, b)); + case VECTOR_OP_HYPOT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (double) Math.hypot(a, b)); + default: return null; + } + } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -725,7 +795,7 @@ public abstract class DoubleVector extends AbstractVector { DoubleVector lanewise(VectorOperators.Binary op, double e, VectorMask m) { - return blend(lanewise(op, e), m); + return lanewise(op, broadcast(e), m); } /** @@ -743,8 +813,7 @@ public abstract class DoubleVector extends AbstractVector { DoubleVector lanewise(VectorOperators.Binary op, long e) { double e1 = (double) e; - if ((long)e1 != e - ) { + if ((long)e1 != e) { vspecies().checkValue(e); // for exception } return lanewise(op, e1); @@ -764,7 +833,11 @@ public abstract class DoubleVector extends AbstractVector { public final DoubleVector lanewise(VectorOperators.Binary op, long e, VectorMask m) { - return blend(lanewise(op, e), m); + double e1 = (double) e; + if ((long)e1 != e) { + vspecies().checkValue(e); // for exception + } + return lanewise(op, e1, m); } @@ -806,18 +879,10 @@ public abstract class DoubleVector extends AbstractVector { tother.check(this); int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), double.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_FMA: return (v0, v1_, v2_) -> - v0.tOp(v1_, v2_, (i, a, b, c) -> Math.fma(a, b, c)); - default: return null; - }})); + opc, getClass(), null, double.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, DoubleVector::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, DoubleVector.class); /** * {@inheritDoc} @@ -825,13 +890,45 @@ public abstract class DoubleVector extends AbstractVector { * @see #lanewise(VectorOperators.Ternary,Vector,double,VectorMask) * @see #lanewise(VectorOperators.Ternary,double,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract DoubleVector lanewise(VectorOperators.Ternary op, Vector v1, Vector v2, - VectorMask m) { - return blend(lanewise(op, v1, v2), m); + VectorMask m); + @ForceInline + final + DoubleVector lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector v1, + Vector v2, + VectorMask m) { + DoubleVector that = (DoubleVector) v1; + DoubleVector tother = (DoubleVector) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, double.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, DoubleVector::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, DoubleVector.class); + + private static TernaryOperation> ternaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_FMA: return (v0, v1_, v2_, m) -> + v0.tOp(v1_, v2_, m, (i, a, b, c) -> Math.fma(a, b, c)); + default: return null; + } } /** @@ -888,7 +985,7 @@ public abstract class DoubleVector extends AbstractVector { double e1, double e2, VectorMask m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -946,7 +1043,7 @@ public abstract class DoubleVector extends AbstractVector { Vector v1, double e2, VectorMask m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -1003,7 +1100,7 @@ public abstract class DoubleVector extends AbstractVector { double e1, Vector v2, VectorMask m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -1647,15 +1744,13 @@ public abstract class DoubleVector extends AbstractVector { final > M compareTemplate(Class maskType, Comparison op, Vector v) { - Objects.requireNonNull(v); - DoubleSpecies vsp = vspecies(); DoubleVector that = (DoubleVector) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, double.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -1665,6 +1760,28 @@ public abstract class DoubleVector extends AbstractVector { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector v, M m) { + DoubleVector that = (DoubleVector) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, double.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, double a, double b) { return switch (cond) { @@ -1678,18 +1795,6 @@ public abstract class DoubleVector extends AbstractVector { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask compare(VectorOperators.Comparison op, - Vector v, - VectorMask m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -1748,7 +1853,7 @@ public abstract class DoubleVector extends AbstractVector { public final VectorMask compare(VectorOperators.Comparison op, double e, VectorMask m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } /** @@ -1999,9 +2104,9 @@ public abstract class DoubleVector extends AbstractVector { DoubleVector rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, double.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, double.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2018,24 +2123,25 @@ public abstract class DoubleVector extends AbstractVector { /*package-private*/ @ForceInline final - > + , M extends VectorMask> DoubleVector rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask m) { - DoubleVector unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, double.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast((double)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, double.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2058,17 +2164,17 @@ public abstract class DoubleVector extends AbstractVector { S ws = (S) shuffle.wrapIndexes(); DoubleVector r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, double.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, double.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); DoubleVector r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, double.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, double.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2309,9 +2415,18 @@ public abstract class DoubleVector extends AbstractVector { @ForceInline final double reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask m) { - DoubleVector v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + DoubleVector v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, double.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, DoubleVector::reductionOperations))); } /*package-private*/ @@ -2326,24 +2441,28 @@ public abstract class DoubleVector extends AbstractVector { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), double.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp((double)0, (i, a, b) -> (double)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp((double)1, (i, a, b) -> (double)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (double) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (double) Math.max(a, b))); - default: return null; - }}))); + opc, getClass(), null, double.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, DoubleVector::reductionOperations))); } + private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, DoubleVector.class); + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, DoubleVector.class); + + private static ReductionOperation> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp((double)0, m, (i, a, b) -> (double)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp((double)1, m, (i, a, b) -> (double)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (double) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (double) Math.max(a, b))); + default: return null; + } + } private @ForceInline @@ -2549,9 +2668,7 @@ public abstract class DoubleVector extends AbstractVector { VectorMask m) { DoubleSpecies vsp = (DoubleSpecies) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - DoubleVector zero = vsp.zero(); - DoubleVector v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2613,8 +2730,7 @@ public abstract class DoubleVector extends AbstractVector { VectorMask m) { DoubleSpecies vsp = (DoubleSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - DoubleVector zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -2690,13 +2806,13 @@ public abstract class DoubleVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorSupport.loadWithMap( - vectorType, double.class, vsp.laneCount(), - IntVector.species(vsp.indexShape()).vectorType(), - a, ARRAY_BASE, vix, + vectorType, null, double.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, null, a, offset, indexMap, mapOffset, vsp, - (double[] c, int idx, int[] iMap, int idy, DoubleSpecies s) -> + (c, idx, iMap, idy, s, vm) -> s.vOp(n -> c[idx + iMap[idy+n]])); - } + } /** * Gathers a new vector composed of elements from an array of type @@ -2744,9 +2860,8 @@ public abstract class DoubleVector extends AbstractVector { return fromArray(species, a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. DoubleSpecies vsp = (DoubleSpecies) species; - return vsp.vOp(m, n -> a[offset + indexMap[mapOffset + n]]); + return vsp.dummyVector().fromArray0(a, offset, indexMap, mapOffset, m); } } @@ -2840,9 +2955,7 @@ public abstract class DoubleVector extends AbstractVector { VectorMask m) { DoubleSpecies vsp = (DoubleSpecies) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - DoubleVector zero = vsp.zero(); - DoubleVector v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2914,10 +3027,9 @@ public abstract class DoubleVector extends AbstractVector { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize DoubleSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -2980,12 +3092,12 @@ public abstract class DoubleVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); VectorSupport.storeWithMap( - vsp.vectorType(), vsp.elementType(), vsp.laneCount(), + vsp.vectorType(), null, vsp.elementType(), vsp.laneCount(), isp.vectorType(), a, arrayAddress(a, 0), vix, - this, + this, null, a, offset, indexMap, mapOffset, - (arr, off, v, map, mo) + (arr, off, v, map, mo, vm) -> v.stOp(arr, off, (arr_, off_, i, e) -> { int j = map[mo + i]; @@ -3032,12 +3144,7 @@ public abstract class DoubleVector extends AbstractVector { intoArray(a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. - stOp(a, offset, m, - (arr, off, i, e) -> { - int j = indexMap[mapOffset + i]; - arr[off + j] = e; - }); + intoArray0(a, offset, indexMap, mapOffset, m); } } @@ -3067,12 +3174,9 @@ public abstract class DoubleVector extends AbstractVector { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize DoubleSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 8, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putDouble(o + i * 8, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -3084,7 +3188,7 @@ public abstract class DoubleVector extends AbstractVector { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -3103,15 +3207,12 @@ public abstract class DoubleVector extends AbstractVector { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } DoubleSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 8, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putDouble(o + i * 8, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -3149,6 +3250,75 @@ public abstract class DoubleVector extends AbstractVector { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + DoubleVector fromArray0(double[] a, int offset, VectorMask m); + @ForceInline + final + > + DoubleVector fromArray0Template(Class maskClass, double[] a, int offset, M m) { + m.check(species()); + DoubleSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + + /*package-private*/ + abstract + DoubleVector fromArray0(double[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + DoubleVector fromArray0Template(Class maskClass, double[] a, int offset, + int[] indexMap, int mapOffset, M m) { + DoubleSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + Objects.requireNonNull(a); + Objects.requireNonNull(indexMap); + m.check(vsp); + Class vectorType = vsp.vectorType(); + + if (vsp.laneCount() == 1) { + return DoubleVector.fromArray(vsp, a, offset + indexMap[mapOffset], m); + } + + // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] + IntVector vix; + if (isp.laneCount() != vsp.laneCount()) { + // For DoubleMaxVector, if vector length is non-power-of-two or + // 2048 bits, indexShape of Double species is S_MAX_BIT. + // Assume that vector length is 2048, then the lane count of Double + // vector is 32. When converting Double species to int species, + // indexShape is still S_MAX_BIT, but the lane count of int vector + // is 64. So when loading index vector (IntVector), only lower half + // of index data is needed. + vix = IntVector + .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .add(offset); + } else { + vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + } + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + return VectorSupport.loadWithMap( + vectorType, maskClass, double.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, m, + a, offset, indexMap, mapOffset, vsp, + (c, idx, iMap, idy, s, vm) -> + s.vOp(vm, n -> c[idx + iMap[idy+n]])); + } + @Override @@ -3169,6 +3339,25 @@ public abstract class DoubleVector extends AbstractVector { }); } + abstract + DoubleVector fromByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + DoubleVector fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + DoubleSpecies vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getDouble(o + i * 8)); + }); + } + abstract DoubleVector fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -3185,6 +3374,24 @@ public abstract class DoubleVector extends AbstractVector { }); } + abstract + DoubleVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + DoubleVector fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + DoubleSpecies vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getDouble(o + i * 8)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -3204,6 +3411,77 @@ public abstract class DoubleVector extends AbstractVector { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0(double[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, double[] a, int offset, M m) { + m.check(species()); + DoubleSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + + abstract + void intoArray0(double[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, double[] a, int offset, + int[] indexMap, int mapOffset, M m) { + m.check(species()); + DoubleSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + if (vsp.laneCount() == 1) { + intoArray(a, offset + indexMap[mapOffset], m); + return; + } + + // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] + IntVector vix; + if (isp.laneCount() != vsp.laneCount()) { + // For DoubleMaxVector, if vector length is 2048 bits, indexShape + // of Double species is S_MAX_BIT. and the lane count of Double + // vector is 32. When converting Double species to int species, + // indexShape is still S_MAX_BIT, but the lane count of int vector + // is 64. So when loading index vector (IntVector), only lower half + // of index data is needed. + vix = IntVector + .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .add(offset); + } else { + vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + } + + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + VectorSupport.storeWithMap( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + isp.vectorType(), + a, arrayAddress(a, 0), vix, + this, m, + a, offset, indexMap, mapOffset, + (arr, off, v, map, mo, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> { + int j = map[mo + i]; + arr[off + j] = e; + })); + } + + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -3221,6 +3499,25 @@ public abstract class DoubleVector extends AbstractVector { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + DoubleSpecies vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.putDouble(o + i * 8, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -3235,6 +3532,25 @@ public abstract class DoubleVector extends AbstractVector { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + DoubleSpecies vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.putDouble(o + i * 8, e)); + }); + } + + // End of low-level memory operations. private static @@ -3552,7 +3868,7 @@ public abstract class DoubleVector extends AbstractVector { /*package-private*/ @ForceInline DoubleVector ldOp(M memory, int offset, - AbstractMask m, + VectorMask m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java index 29b8052cb16..4e0dd018d26 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java @@ -236,8 +236,8 @@ final class Float128Vector extends FloatVector { @ForceInline final @Override - float rOp(float v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + float rOp(float v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Float128Vector extends FloatVector { return (Float128Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Float128Vector lanewise(Unary op, VectorMask m) { + return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, (Float128Mask) m); // specialize + } + @Override @ForceInline public Float128Vector lanewise(Binary op, Vector v) { return (Float128Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Float128Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, v, (Float128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Float128Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Float128Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Float128Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Float128Vector) super.lanewiseTemplate(op, Float128Mask.class, v1, v2, (Float128Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Float128Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Float128Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Float128Mask.class, (Float128Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Float128Vector extends FloatVector { return super.compareTemplate(Float128Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Float128Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Float128Mask.class, op, v, (Float128Mask) m); + } + + @Override @ForceInline public Float128Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Float128Vector extends FloatVector { VectorMask m) { return (Float128Vector) super.rearrangeTemplate(Float128Shuffle.class, + Float128Mask.class, (Float128Shuffle) shuffle, (Float128Mask) m); // specialize } @@ -584,16 +612,12 @@ final class Float128Vector extends FloatVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Float128Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -619,9 +643,9 @@ final class Float128Vector extends FloatVector { public Float128Mask and(VectorMask mask) { Objects.requireNonNull(mask); Float128Mask m = (Float128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float128Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Float128Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -629,9 +653,9 @@ final class Float128Vector extends FloatVector { public Float128Mask or(VectorMask mask) { Objects.requireNonNull(mask); Float128Mask m = (Float128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float128Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Float128Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -639,9 +663,9 @@ final class Float128Vector extends FloatVector { Float128Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Float128Mask m = (Float128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float128Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Float128Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -649,22 +673,32 @@ final class Float128Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float128Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Float128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float128Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float128Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Float128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float128Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float128Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Float128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float128Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float128Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -775,6 +809,20 @@ final class Float128Vector extends FloatVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, VectorMask m) { + return super.fromArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); // specialize + } + + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Float128Mask.class, a, offset, indexMap, mapOffset, (Float128Mask) m); + } + @ForceInline @@ -784,6 +832,13 @@ final class Float128Vector extends FloatVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); // specialize + } + @ForceInline @Override final @@ -791,6 +846,13 @@ final class Float128Vector extends FloatVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Float128Mask.class, bb, offset, (Float128Mask) m); // specialize + } + @ForceInline @Override final @@ -798,6 +860,21 @@ final class Float128Vector extends FloatVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, VectorMask m) { + super.intoArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Float128Mask.class, a, offset, indexMap, mapOffset, (Float128Mask) m); + } + + @ForceInline @Override final @@ -805,6 +882,21 @@ final class Float128Vector extends FloatVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Float128Mask.class, a, offset, (Float128Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Float128Mask.class, bb, offset, (Float128Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java index 9e8bb030c15..7812876f4eb 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java @@ -236,8 +236,8 @@ final class Float256Vector extends FloatVector { @ForceInline final @Override - float rOp(float v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + float rOp(float v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Float256Vector extends FloatVector { return (Float256Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Float256Vector lanewise(Unary op, VectorMask m) { + return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, (Float256Mask) m); // specialize + } + @Override @ForceInline public Float256Vector lanewise(Binary op, Vector v) { return (Float256Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Float256Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v, (Float256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Float256Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Float256Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Float256Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Float256Vector) super.lanewiseTemplate(op, Float256Mask.class, v1, v2, (Float256Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Float256Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Float256Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Float256Mask.class, (Float256Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Float256Vector extends FloatVector { return super.compareTemplate(Float256Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Float256Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Float256Mask.class, op, v, (Float256Mask) m); + } + + @Override @ForceInline public Float256Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Float256Vector extends FloatVector { VectorMask m) { return (Float256Vector) super.rearrangeTemplate(Float256Shuffle.class, + Float256Mask.class, (Float256Shuffle) shuffle, (Float256Mask) m); // specialize } @@ -592,16 +620,12 @@ final class Float256Vector extends FloatVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Float256Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -627,9 +651,9 @@ final class Float256Vector extends FloatVector { public Float256Mask and(VectorMask mask) { Objects.requireNonNull(mask); Float256Mask m = (Float256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float256Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Float256Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -637,9 +661,9 @@ final class Float256Vector extends FloatVector { public Float256Mask or(VectorMask mask) { Objects.requireNonNull(mask); Float256Mask m = (Float256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float256Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Float256Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -647,9 +671,9 @@ final class Float256Vector extends FloatVector { Float256Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Float256Mask m = (Float256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float256Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Float256Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -657,22 +681,32 @@ final class Float256Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float256Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Float256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float256Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float256Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Float256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float256Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float256Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Float256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float256Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float256Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -783,6 +817,20 @@ final class Float256Vector extends FloatVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, VectorMask m) { + return super.fromArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); // specialize + } + + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m); + } + @ForceInline @@ -792,6 +840,13 @@ final class Float256Vector extends FloatVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); // specialize + } + @ForceInline @Override final @@ -799,6 +854,13 @@ final class Float256Vector extends FloatVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Float256Mask.class, bb, offset, (Float256Mask) m); // specialize + } + @ForceInline @Override final @@ -806,6 +868,21 @@ final class Float256Vector extends FloatVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, VectorMask m) { + super.intoArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Float256Mask.class, a, offset, indexMap, mapOffset, (Float256Mask) m); + } + + @ForceInline @Override final @@ -813,6 +890,21 @@ final class Float256Vector extends FloatVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Float256Mask.class, a, offset, (Float256Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Float256Mask.class, bb, offset, (Float256Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java index ec85efe1b7e..a8936709baa 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java @@ -236,8 +236,8 @@ final class Float512Vector extends FloatVector { @ForceInline final @Override - float rOp(float v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + float rOp(float v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Float512Vector extends FloatVector { return (Float512Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Float512Vector lanewise(Unary op, VectorMask m) { + return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, (Float512Mask) m); // specialize + } + @Override @ForceInline public Float512Vector lanewise(Binary op, Vector v) { return (Float512Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Float512Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, v, (Float512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Float512Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Float512Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Float512Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Float512Vector) super.lanewiseTemplate(op, Float512Mask.class, v1, v2, (Float512Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Float512Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Float512Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Float512Mask.class, (Float512Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Float512Vector extends FloatVector { return super.compareTemplate(Float512Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Float512Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Float512Mask.class, op, v, (Float512Mask) m); + } + + @Override @ForceInline public Float512Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Float512Vector extends FloatVector { VectorMask m) { return (Float512Vector) super.rearrangeTemplate(Float512Shuffle.class, + Float512Mask.class, (Float512Shuffle) shuffle, (Float512Mask) m); // specialize } @@ -608,16 +636,12 @@ final class Float512Vector extends FloatVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Float512Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -643,9 +667,9 @@ final class Float512Vector extends FloatVector { public Float512Mask and(VectorMask mask) { Objects.requireNonNull(mask); Float512Mask m = (Float512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float512Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Float512Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -653,9 +677,9 @@ final class Float512Vector extends FloatVector { public Float512Mask or(VectorMask mask) { Objects.requireNonNull(mask); Float512Mask m = (Float512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float512Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Float512Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -663,9 +687,9 @@ final class Float512Vector extends FloatVector { Float512Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Float512Mask m = (Float512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float512Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Float512Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -673,22 +697,32 @@ final class Float512Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float512Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Float512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float512Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float512Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Float512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float512Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float512Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Float512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float512Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float512Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -799,6 +833,20 @@ final class Float512Vector extends FloatVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, VectorMask m) { + return super.fromArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); // specialize + } + + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Float512Mask.class, a, offset, indexMap, mapOffset, (Float512Mask) m); + } + @ForceInline @@ -808,6 +856,13 @@ final class Float512Vector extends FloatVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); // specialize + } + @ForceInline @Override final @@ -815,6 +870,13 @@ final class Float512Vector extends FloatVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Float512Mask.class, bb, offset, (Float512Mask) m); // specialize + } + @ForceInline @Override final @@ -822,6 +884,21 @@ final class Float512Vector extends FloatVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, VectorMask m) { + super.intoArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Float512Mask.class, a, offset, indexMap, mapOffset, (Float512Mask) m); + } + + @ForceInline @Override final @@ -829,6 +906,21 @@ final class Float512Vector extends FloatVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Float512Mask.class, a, offset, (Float512Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Float512Mask.class, bb, offset, (Float512Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java index a1e3ba216e9..0c91d46e64e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java @@ -236,8 +236,8 @@ final class Float64Vector extends FloatVector { @ForceInline final @Override - float rOp(float v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + float rOp(float v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class Float64Vector extends FloatVector { return (Float64Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Float64Vector lanewise(Unary op, VectorMask m) { + return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, (Float64Mask) m); // specialize + } + @Override @ForceInline public Float64Vector lanewise(Binary op, Vector v) { return (Float64Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Float64Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, v, (Float64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Float64Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Float64Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Float64Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Float64Vector) super.lanewiseTemplate(op, Float64Mask.class, v1, v2, (Float64Mask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class Float64Vector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class Float64Vector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Float64Mask.class, (Float64Mask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class Float64Vector extends FloatVector { return super.compareTemplate(Float64Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Float64Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Float64Mask.class, op, v, (Float64Mask) m); + } + + @Override @ForceInline public Float64Vector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class Float64Vector extends FloatVector { VectorMask m) { return (Float64Vector) super.rearrangeTemplate(Float64Shuffle.class, + Float64Mask.class, (Float64Shuffle) shuffle, (Float64Mask) m); // specialize } @@ -580,16 +608,12 @@ final class Float64Vector extends FloatVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Float64Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -615,9 +639,9 @@ final class Float64Vector extends FloatVector { public Float64Mask and(VectorMask mask) { Objects.requireNonNull(mask); Float64Mask m = (Float64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Float64Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Float64Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -625,9 +649,9 @@ final class Float64Vector extends FloatVector { public Float64Mask or(VectorMask mask) { Objects.requireNonNull(mask); Float64Mask m = (Float64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Float64Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Float64Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -635,9 +659,9 @@ final class Float64Vector extends FloatVector { Float64Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Float64Mask m = (Float64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Float64Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Float64Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -645,22 +669,32 @@ final class Float64Vector extends FloatVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float64Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Float64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Float64Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float64Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Float64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Float64Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float64Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Float64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Float64Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Float64Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -771,6 +805,20 @@ final class Float64Vector extends FloatVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, VectorMask m) { + return super.fromArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); // specialize + } + + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Float64Mask.class, a, offset, indexMap, mapOffset, (Float64Mask) m); + } + @ForceInline @@ -780,6 +828,13 @@ final class Float64Vector extends FloatVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); // specialize + } + @ForceInline @Override final @@ -787,6 +842,13 @@ final class Float64Vector extends FloatVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Float64Mask.class, bb, offset, (Float64Mask) m); // specialize + } + @ForceInline @Override final @@ -794,6 +856,21 @@ final class Float64Vector extends FloatVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, VectorMask m) { + super.intoArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Float64Mask.class, a, offset, indexMap, mapOffset, (Float64Mask) m); + } + + @ForceInline @Override final @@ -801,6 +878,21 @@ final class Float64Vector extends FloatVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Float64Mask.class, a, offset, (Float64Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Float64Mask.class, bb, offset, (Float64Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java index 71d6ac05b69..f2e1bd05c13 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatMaxVector.java @@ -236,8 +236,8 @@ final class FloatMaxVector extends FloatVector { @ForceInline final @Override - float rOp(float v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + float rOp(float v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,22 +273,42 @@ final class FloatMaxVector extends FloatVector { return (FloatMaxVector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public FloatMaxVector lanewise(Unary op, VectorMask m) { + return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialize + } + @Override @ForceInline public FloatMaxVector lanewise(Binary op, Vector v) { return (FloatMaxVector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public FloatMaxVector lanewise(Binary op, Vector v, VectorMask m) { + return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, v, (FloatMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final FloatMaxVector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (FloatMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + FloatMaxVector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (FloatMaxVector) super.lanewiseTemplate(op, FloatMaxMask.class, v1, v2, (FloatMaxMask) m); // specialize + } + @Override @ForceInline public final @@ -308,7 +328,7 @@ final class FloatMaxVector extends FloatVector { @ForceInline public final float reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized } @Override @@ -321,7 +341,7 @@ final class FloatMaxVector extends FloatVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, FloatMaxMask.class, (FloatMaxMask) m); // specialized } @ForceInline @@ -357,6 +377,13 @@ final class FloatMaxVector extends FloatVector { return super.compareTemplate(FloatMaxMask.class, op, s); // specialize } + @Override + @ForceInline + public final FloatMaxMask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(FloatMaxMask.class, op, v, (FloatMaxMask) m); + } + + @Override @ForceInline public FloatMaxVector blend(Vector v, VectorMask m) { @@ -413,6 +440,7 @@ final class FloatMaxVector extends FloatVector { VectorMask m) { return (FloatMaxVector) super.rearrangeTemplate(FloatMaxShuffle.class, + FloatMaxMask.class, (FloatMaxShuffle) shuffle, (FloatMaxMask) m); // specialize } @@ -577,16 +605,12 @@ final class FloatMaxVector extends FloatVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - FloatMaxMask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -612,9 +636,9 @@ final class FloatMaxVector extends FloatVector { public FloatMaxMask and(VectorMask mask) { Objects.requireNonNull(mask); FloatMaxMask m = (FloatMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMaxMask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, FloatMaxMask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -622,9 +646,9 @@ final class FloatMaxVector extends FloatVector { public FloatMaxMask or(VectorMask mask) { Objects.requireNonNull(mask); FloatMaxMask m = (FloatMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMaxMask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, FloatMaxMask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -632,9 +656,9 @@ final class FloatMaxVector extends FloatVector { FloatMaxMask xor(VectorMask mask) { Objects.requireNonNull(mask); FloatMaxMask m = (FloatMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMaxMask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, FloatMaxMask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -642,22 +666,32 @@ final class FloatMaxVector extends FloatVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMaxMask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((FloatMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, FloatMaxMask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMaxMask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((FloatMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, FloatMaxMask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMaxMask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((FloatMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, FloatMaxMask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, FloatMaxMask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -768,6 +802,20 @@ final class FloatMaxVector extends FloatVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, VectorMask m) { + return super.fromArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); // specialize + } + + @ForceInline + @Override + final + FloatVector fromArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(FloatMaxMask.class, a, offset, indexMap, mapOffset, (FloatMaxMask) m); + } + @ForceInline @@ -777,6 +825,13 @@ final class FloatMaxVector extends FloatVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); // specialize + } + @ForceInline @Override final @@ -784,6 +839,13 @@ final class FloatMaxVector extends FloatVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(FloatMaxMask.class, bb, offset, (FloatMaxMask) m); // specialize + } + @ForceInline @Override final @@ -791,6 +853,21 @@ final class FloatMaxVector extends FloatVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, VectorMask m) { + super.intoArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); + } + + @ForceInline + @Override + final + void intoArray0(float[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(FloatMaxMask.class, a, offset, indexMap, mapOffset, (FloatMaxMask) m); + } + + @ForceInline @Override final @@ -798,6 +875,21 @@ final class FloatMaxVector extends FloatVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(FloatMaxMask.class, a, offset, (FloatMaxMask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(FloatMaxMask.class, bb, offset, (FloatMaxMask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java index 7a741cd2e5e..d5dbc2f9efa 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -173,6 +172,9 @@ public abstract class FloatVector extends AbstractVector { final FloatVector uOpTemplate(VectorMask m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } float[] vec = vec(); float[] res = new float[length()]; boolean[] mbits = ((AbstractMask)m).getBits(); @@ -216,6 +218,9 @@ public abstract class FloatVector extends AbstractVector { FloatVector bOpTemplate(Vector o, VectorMask m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } float[] res = new float[length()]; float[] vec1 = this.vec(); float[] vec2 = ((FloatVector)o).vec(); @@ -265,6 +270,9 @@ public abstract class FloatVector extends AbstractVector { Vector o2, VectorMask m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } float[] res = new float[length()]; float[] vec1 = this.vec(); float[] vec2 = ((FloatVector)o1).vec(); @@ -280,7 +288,22 @@ public abstract class FloatVector extends AbstractVector { /*package-private*/ abstract - float rOp(float v, FBinOp f); + float rOp(float v, VectorMask m, FBinOp f); + + @ForceInline + final + float rOpTemplate(float v, VectorMask m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + float[] vec = vec(); + boolean[] mbits = ((AbstractMask)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final float rOpTemplate(float v, FBinOp f) { @@ -540,61 +563,80 @@ public abstract class FloatVector extends AbstractVector { } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), float.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> (float) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> (float) Math.abs(a)); - case VECTOR_OP_SIN: return v0 -> - v0.uOp((i, a) -> (float) Math.sin(a)); - case VECTOR_OP_COS: return v0 -> - v0.uOp((i, a) -> (float) Math.cos(a)); - case VECTOR_OP_TAN: return v0 -> - v0.uOp((i, a) -> (float) Math.tan(a)); - case VECTOR_OP_ASIN: return v0 -> - v0.uOp((i, a) -> (float) Math.asin(a)); - case VECTOR_OP_ACOS: return v0 -> - v0.uOp((i, a) -> (float) Math.acos(a)); - case VECTOR_OP_ATAN: return v0 -> - v0.uOp((i, a) -> (float) Math.atan(a)); - case VECTOR_OP_EXP: return v0 -> - v0.uOp((i, a) -> (float) Math.exp(a)); - case VECTOR_OP_LOG: return v0 -> - v0.uOp((i, a) -> (float) Math.log(a)); - case VECTOR_OP_LOG10: return v0 -> - v0.uOp((i, a) -> (float) Math.log10(a)); - case VECTOR_OP_SQRT: return v0 -> - v0.uOp((i, a) -> (float) Math.sqrt(a)); - case VECTOR_OP_CBRT: return v0 -> - v0.uOp((i, a) -> (float) Math.cbrt(a)); - case VECTOR_OP_SINH: return v0 -> - v0.uOp((i, a) -> (float) Math.sinh(a)); - case VECTOR_OP_COSH: return v0 -> - v0.uOp((i, a) -> (float) Math.cosh(a)); - case VECTOR_OP_TANH: return v0 -> - v0.uOp((i, a) -> (float) Math.tanh(a)); - case VECTOR_OP_EXPM1: return v0 -> - v0.uOp((i, a) -> (float) Math.expm1(a)); - case VECTOR_OP_LOG1P: return v0 -> - v0.uOp((i, a) -> (float) Math.log1p(a)); - default: return null; - }})); + opc, getClass(), null, float.class, length(), + this, null, + UN_IMPL.find(op, opc, FloatVector::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, FloatVector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract FloatVector lanewise(VectorOperators.Unary op, - VectorMask m) { - return blend(lanewise(op), m); + VectorMask m); + @ForceInline + final + FloatVector lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, float.class, length(), + this, m, + UN_IMPL.find(op, opc, FloatVector::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, FloatVector.class); + + private static UnaryOperation> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.abs(a)); + case VECTOR_OP_SIN: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.sin(a)); + case VECTOR_OP_COS: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.cos(a)); + case VECTOR_OP_TAN: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.tan(a)); + case VECTOR_OP_ASIN: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.asin(a)); + case VECTOR_OP_ACOS: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.acos(a)); + case VECTOR_OP_ATAN: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.atan(a)); + case VECTOR_OP_EXP: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.exp(a)); + case VECTOR_OP_LOG: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.log(a)); + case VECTOR_OP_LOG10: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.log10(a)); + case VECTOR_OP_SQRT: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.sqrt(a)); + case VECTOR_OP_CBRT: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.cbrt(a)); + case VECTOR_OP_SINH: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.sinh(a)); + case VECTOR_OP_COSH: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.cosh(a)); + case VECTOR_OP_TANH: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.tanh(a)); + case VECTOR_OP_EXPM1: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.expm1(a)); + case VECTOR_OP_LOG1P: return (v0, m) -> + v0.uOp(m, (i, a) -> (float) Math.log1p(a)); + default: return null; + } } // Binary lanewise support @@ -614,6 +656,7 @@ public abstract class FloatVector extends AbstractVector { Vector v) { FloatVector that = (FloatVector) v; that.check(this); + if (opKind(op, VO_SPECIAL )) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -627,48 +670,75 @@ public abstract class FloatVector extends AbstractVector { .viewAsFloatingLanes(); } } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), float.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float)Math.min(a, b)); - case VECTOR_OP_ATAN2: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float) Math.atan2(a, b)); - case VECTOR_OP_POW: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float) Math.pow(a, b)); - case VECTOR_OP_HYPOT: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (float) Math.hypot(a, b)); - default: return null; - }})); + opc, getClass(), null, float.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, FloatVector::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, FloatVector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,float,VectorMask) */ - @ForceInline - public final + @Override + public abstract FloatVector lanewise(VectorOperators.Binary op, Vector v, - VectorMask m) { - return blend(lanewise(op, v), m); + VectorMask m); + @ForceInline + final + FloatVector lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector v, VectorMask m) { + FloatVector that = (FloatVector) v; + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL )) { + if (op == FIRST_NONZERO) { + return blend(lanewise(op, v), m); + } + } + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, float.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, FloatVector::binaryOperations)); } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, FloatVector.class); + + private static BinaryOperation> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float)Math.min(a, b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> fromBits(toBits(a) | toBits(b))); + case VECTOR_OP_ATAN2: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float) Math.atan2(a, b)); + case VECTOR_OP_POW: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float) Math.pow(a, b)); + case VECTOR_OP_HYPOT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (float) Math.hypot(a, b)); + default: return null; + } + } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -725,7 +795,7 @@ public abstract class FloatVector extends AbstractVector { FloatVector lanewise(VectorOperators.Binary op, float e, VectorMask m) { - return blend(lanewise(op, e), m); + return lanewise(op, broadcast(e), m); } /** @@ -743,8 +813,7 @@ public abstract class FloatVector extends AbstractVector { FloatVector lanewise(VectorOperators.Binary op, long e) { float e1 = (float) e; - if ((long)e1 != e - ) { + if ((long)e1 != e) { vspecies().checkValue(e); // for exception } return lanewise(op, e1); @@ -764,7 +833,11 @@ public abstract class FloatVector extends AbstractVector { public final FloatVector lanewise(VectorOperators.Binary op, long e, VectorMask m) { - return blend(lanewise(op, e), m); + float e1 = (float) e; + if ((long)e1 != e) { + vspecies().checkValue(e); // for exception + } + return lanewise(op, e1, m); } @@ -806,18 +879,10 @@ public abstract class FloatVector extends AbstractVector { tother.check(this); int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), float.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_FMA: return (v0, v1_, v2_) -> - v0.tOp(v1_, v2_, (i, a, b, c) -> Math.fma(a, b, c)); - default: return null; - }})); + opc, getClass(), null, float.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, FloatVector::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, FloatVector.class); /** * {@inheritDoc} @@ -825,13 +890,45 @@ public abstract class FloatVector extends AbstractVector { * @see #lanewise(VectorOperators.Ternary,Vector,float,VectorMask) * @see #lanewise(VectorOperators.Ternary,float,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract FloatVector lanewise(VectorOperators.Ternary op, Vector v1, Vector v2, - VectorMask m) { - return blend(lanewise(op, v1, v2), m); + VectorMask m); + @ForceInline + final + FloatVector lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector v1, + Vector v2, + VectorMask m) { + FloatVector that = (FloatVector) v1; + FloatVector tother = (FloatVector) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, float.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, FloatVector::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, FloatVector.class); + + private static TernaryOperation> ternaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_FMA: return (v0, v1_, v2_, m) -> + v0.tOp(v1_, v2_, m, (i, a, b, c) -> Math.fma(a, b, c)); + default: return null; + } } /** @@ -888,7 +985,7 @@ public abstract class FloatVector extends AbstractVector { float e1, float e2, VectorMask m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -946,7 +1043,7 @@ public abstract class FloatVector extends AbstractVector { Vector v1, float e2, VectorMask m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -1003,7 +1100,7 @@ public abstract class FloatVector extends AbstractVector { float e1, Vector v2, VectorMask m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -1659,15 +1756,13 @@ public abstract class FloatVector extends AbstractVector { final > M compareTemplate(Class maskType, Comparison op, Vector v) { - Objects.requireNonNull(v); - FloatSpecies vsp = vspecies(); FloatVector that = (FloatVector) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, float.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -1677,6 +1772,28 @@ public abstract class FloatVector extends AbstractVector { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector v, M m) { + FloatVector that = (FloatVector) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, float.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, float a, float b) { return switch (cond) { @@ -1690,18 +1807,6 @@ public abstract class FloatVector extends AbstractVector { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask compare(VectorOperators.Comparison op, - Vector v, - VectorMask m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -1760,7 +1865,7 @@ public abstract class FloatVector extends AbstractVector { public final VectorMask compare(VectorOperators.Comparison op, float e, VectorMask m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } /** @@ -2011,9 +2116,9 @@ public abstract class FloatVector extends AbstractVector { FloatVector rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, float.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, float.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2030,24 +2135,25 @@ public abstract class FloatVector extends AbstractVector { /*package-private*/ @ForceInline final - > + , M extends VectorMask> FloatVector rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask m) { - FloatVector unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, float.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast((float)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, float.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2070,17 +2176,17 @@ public abstract class FloatVector extends AbstractVector { S ws = (S) shuffle.wrapIndexes(); FloatVector r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, float.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, float.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); FloatVector r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, float.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, float.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2329,9 +2435,18 @@ public abstract class FloatVector extends AbstractVector { @ForceInline final float reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask m) { - FloatVector v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + FloatVector v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, float.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, FloatVector::reductionOperations))); } /*package-private*/ @@ -2346,24 +2461,28 @@ public abstract class FloatVector extends AbstractVector { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), float.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp((float)0, (i, a, b) -> (float)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp((float)1, (i, a, b) -> (float)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (float) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (float) Math.max(a, b))); - default: return null; - }}))); + opc, getClass(), null, float.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, FloatVector::reductionOperations))); } + private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, FloatVector.class); + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, FloatVector.class); + + private static ReductionOperation> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp((float)0, m, (i, a, b) -> (float)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp((float)1, m, (i, a, b) -> (float)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (float) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (float) Math.max(a, b))); + default: return null; + } + } private @ForceInline @@ -2573,9 +2692,7 @@ public abstract class FloatVector extends AbstractVector { VectorMask m) { FloatSpecies vsp = (FloatSpecies) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - FloatVector zero = vsp.zero(); - FloatVector v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2637,8 +2754,7 @@ public abstract class FloatVector extends AbstractVector { VectorMask m) { FloatSpecies vsp = (FloatSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - FloatVector zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -2696,13 +2812,13 @@ public abstract class FloatVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorSupport.loadWithMap( - vectorType, float.class, vsp.laneCount(), - IntVector.species(vsp.indexShape()).vectorType(), - a, ARRAY_BASE, vix, + vectorType, null, float.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, null, a, offset, indexMap, mapOffset, vsp, - (float[] c, int idx, int[] iMap, int idy, FloatSpecies s) -> + (c, idx, iMap, idy, s, vm) -> s.vOp(n -> c[idx + iMap[idy+n]])); - } + } /** * Gathers a new vector composed of elements from an array of type @@ -2750,9 +2866,8 @@ public abstract class FloatVector extends AbstractVector { return fromArray(species, a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. FloatSpecies vsp = (FloatSpecies) species; - return vsp.vOp(m, n -> a[offset + indexMap[mapOffset + n]]); + return vsp.dummyVector().fromArray0(a, offset, indexMap, mapOffset, m); } } @@ -2846,9 +2961,7 @@ public abstract class FloatVector extends AbstractVector { VectorMask m) { FloatSpecies vsp = (FloatSpecies) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - FloatVector zero = vsp.zero(); - FloatVector v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2920,10 +3033,9 @@ public abstract class FloatVector extends AbstractVector { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize FloatSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -2967,12 +3079,12 @@ public abstract class FloatVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); VectorSupport.storeWithMap( - vsp.vectorType(), vsp.elementType(), vsp.laneCount(), + vsp.vectorType(), null, vsp.elementType(), vsp.laneCount(), isp.vectorType(), a, arrayAddress(a, 0), vix, - this, + this, null, a, offset, indexMap, mapOffset, - (arr, off, v, map, mo) + (arr, off, v, map, mo, vm) -> v.stOp(arr, off, (arr_, off_, i, e) -> { int j = map[mo + i]; @@ -3019,12 +3131,7 @@ public abstract class FloatVector extends AbstractVector { intoArray(a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. - stOp(a, offset, m, - (arr, off, i, e) -> { - int j = indexMap[mapOffset + i]; - arr[off + j] = e; - }); + intoArray0(a, offset, indexMap, mapOffset, m); } } @@ -3054,12 +3161,9 @@ public abstract class FloatVector extends AbstractVector { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize FloatSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 4, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putFloat(o + i * 4, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -3071,7 +3175,7 @@ public abstract class FloatVector extends AbstractVector { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -3090,15 +3194,12 @@ public abstract class FloatVector extends AbstractVector { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } FloatSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 4, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putFloat(o + i * 4, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -3136,6 +3237,57 @@ public abstract class FloatVector extends AbstractVector { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + FloatVector fromArray0(float[] a, int offset, VectorMask m); + @ForceInline + final + > + FloatVector fromArray0Template(Class maskClass, float[] a, int offset, M m) { + m.check(species()); + FloatSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + + /*package-private*/ + abstract + FloatVector fromArray0(float[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + FloatVector fromArray0Template(Class maskClass, float[] a, int offset, + int[] indexMap, int mapOffset, M m) { + FloatSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + Objects.requireNonNull(a); + Objects.requireNonNull(indexMap); + m.check(vsp); + Class vectorType = vsp.vectorType(); + + // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] + IntVector vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + return VectorSupport.loadWithMap( + vectorType, maskClass, float.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, m, + a, offset, indexMap, mapOffset, vsp, + (c, idx, iMap, idy, s, vm) -> + s.vOp(vm, n -> c[idx + iMap[idy+n]])); + } + @Override @@ -3156,6 +3308,25 @@ public abstract class FloatVector extends AbstractVector { }); } + abstract + FloatVector fromByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + FloatVector fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + FloatSpecies vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getFloat(o + i * 4)); + }); + } + abstract FloatVector fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -3172,6 +3343,24 @@ public abstract class FloatVector extends AbstractVector { }); } + abstract + FloatVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + FloatVector fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + FloatSpecies vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getFloat(o + i * 4)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -3191,6 +3380,58 @@ public abstract class FloatVector extends AbstractVector { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0(float[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, float[] a, int offset, M m) { + m.check(species()); + FloatSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + + abstract + void intoArray0(float[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, float[] a, int offset, + int[] indexMap, int mapOffset, M m) { + m.check(species()); + FloatSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] + IntVector vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + VectorSupport.storeWithMap( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + isp.vectorType(), + a, arrayAddress(a, 0), vix, + this, m, + a, offset, indexMap, mapOffset, + (arr, off, v, map, mo, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> { + int j = map[mo + i]; + arr[off + j] = e; + })); + } + + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -3208,6 +3449,25 @@ public abstract class FloatVector extends AbstractVector { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + FloatSpecies vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.putFloat(o + i * 4, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -3222,6 +3482,25 @@ public abstract class FloatVector extends AbstractVector { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + FloatSpecies vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.putFloat(o + i * 4, e)); + }); + } + + // End of low-level memory operations. private static @@ -3539,7 +3818,7 @@ public abstract class FloatVector extends AbstractVector { /*package-private*/ @ForceInline FloatVector ldOp(M memory, int offset, - AbstractMask m, + VectorMask m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java index 3b9461cc55a..f5404215969 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java @@ -236,8 +236,8 @@ final class Int128Vector extends IntVector { @ForceInline final @Override - int rOp(int v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + int rOp(int v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Int128Vector extends IntVector { return (Int128Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Int128Vector lanewise(Unary op, VectorMask m) { + return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, (Int128Mask) m); // specialize + } + @Override @ForceInline public Int128Vector lanewise(Binary op, Vector v) { return (Int128Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Int128Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v, (Int128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Int128Vector @@ -286,15 +298,30 @@ final class Int128Vector extends IntVector { return (Int128Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Int128Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Int128Vector) super.lanewiseShiftTemplate(op, Int128Mask.class, e, (Int128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Int128Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Int128Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Int128Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Int128Vector) super.lanewiseTemplate(op, Int128Mask.class, v1, v2, (Int128Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Int128Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Int128Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Int128Mask.class, (Int128Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Int128Vector extends IntVector { return super.compareTemplate(Int128Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Int128Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Int128Mask.class, op, v, (Int128Mask) m); + } + + @Override @ForceInline public Int128Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Int128Vector extends IntVector { VectorMask m) { return (Int128Vector) super.rearrangeTemplate(Int128Shuffle.class, + Int128Mask.class, (Int128Shuffle) shuffle, (Int128Mask) m); // specialize } @@ -588,16 +623,12 @@ final class Int128Vector extends IntVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Int128Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -623,9 +654,9 @@ final class Int128Vector extends IntVector { public Int128Mask and(VectorMask mask) { Objects.requireNonNull(mask); Int128Mask m = (Int128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Int128Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -633,9 +664,9 @@ final class Int128Vector extends IntVector { public Int128Mask or(VectorMask mask) { Objects.requireNonNull(mask); Int128Mask m = (Int128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Int128Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -643,9 +674,9 @@ final class Int128Vector extends IntVector { Int128Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Int128Mask m = (Int128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Int128Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -653,22 +684,32 @@ final class Int128Vector extends IntVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Int128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int128Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Int128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int128Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Int128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int128Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int128Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -779,6 +820,20 @@ final class Int128Vector extends IntVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, VectorMask m) { + return super.fromArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); // specialize + } + + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m); + } + @ForceInline @@ -788,6 +843,13 @@ final class Int128Vector extends IntVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); // specialize + } + @ForceInline @Override final @@ -795,6 +857,13 @@ final class Int128Vector extends IntVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Int128Mask.class, bb, offset, (Int128Mask) m); // specialize + } + @ForceInline @Override final @@ -802,6 +871,21 @@ final class Int128Vector extends IntVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, VectorMask m) { + super.intoArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Int128Mask.class, a, offset, indexMap, mapOffset, (Int128Mask) m); + } + + @ForceInline @Override final @@ -809,6 +893,21 @@ final class Int128Vector extends IntVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Int128Mask.class, a, offset, (Int128Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Int128Mask.class, bb, offset, (Int128Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java index 7cfad269b9c..f5ed7ce09b8 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java @@ -236,8 +236,8 @@ final class Int256Vector extends IntVector { @ForceInline final @Override - int rOp(int v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + int rOp(int v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Int256Vector extends IntVector { return (Int256Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Int256Vector lanewise(Unary op, VectorMask m) { + return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, (Int256Mask) m); // specialize + } + @Override @ForceInline public Int256Vector lanewise(Binary op, Vector v) { return (Int256Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Int256Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, v, (Int256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Int256Vector @@ -286,15 +298,30 @@ final class Int256Vector extends IntVector { return (Int256Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Int256Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Int256Vector) super.lanewiseShiftTemplate(op, Int256Mask.class, e, (Int256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Int256Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Int256Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Int256Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Int256Vector) super.lanewiseTemplate(op, Int256Mask.class, v1, v2, (Int256Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Int256Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Int256Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Int256Mask.class, (Int256Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Int256Vector extends IntVector { return super.compareTemplate(Int256Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Int256Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Int256Mask.class, op, v, (Int256Mask) m); + } + + @Override @ForceInline public Int256Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Int256Vector extends IntVector { VectorMask m) { return (Int256Vector) super.rearrangeTemplate(Int256Shuffle.class, + Int256Mask.class, (Int256Shuffle) shuffle, (Int256Mask) m); // specialize } @@ -596,16 +631,12 @@ final class Int256Vector extends IntVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Int256Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -631,9 +662,9 @@ final class Int256Vector extends IntVector { public Int256Mask and(VectorMask mask) { Objects.requireNonNull(mask); Int256Mask m = (Int256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int256Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Int256Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -641,9 +672,9 @@ final class Int256Vector extends IntVector { public Int256Mask or(VectorMask mask) { Objects.requireNonNull(mask); Int256Mask m = (Int256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int256Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Int256Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -651,9 +682,9 @@ final class Int256Vector extends IntVector { Int256Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Int256Mask m = (Int256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int256Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Int256Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -661,22 +692,32 @@ final class Int256Vector extends IntVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int256Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Int256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int256Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int256Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Int256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int256Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int256Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Int256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int256Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int256Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -787,6 +828,20 @@ final class Int256Vector extends IntVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, VectorMask m) { + return super.fromArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); // specialize + } + + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Int256Mask.class, a, offset, indexMap, mapOffset, (Int256Mask) m); + } + @ForceInline @@ -796,6 +851,13 @@ final class Int256Vector extends IntVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); // specialize + } + @ForceInline @Override final @@ -803,6 +865,13 @@ final class Int256Vector extends IntVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Int256Mask.class, bb, offset, (Int256Mask) m); // specialize + } + @ForceInline @Override final @@ -810,6 +879,21 @@ final class Int256Vector extends IntVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, VectorMask m) { + super.intoArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Int256Mask.class, a, offset, indexMap, mapOffset, (Int256Mask) m); + } + + @ForceInline @Override final @@ -817,6 +901,21 @@ final class Int256Vector extends IntVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Int256Mask.class, a, offset, (Int256Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Int256Mask.class, bb, offset, (Int256Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java index cf519221a0e..6da5f59d602 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java @@ -236,8 +236,8 @@ final class Int512Vector extends IntVector { @ForceInline final @Override - int rOp(int v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + int rOp(int v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Int512Vector extends IntVector { return (Int512Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Int512Vector lanewise(Unary op, VectorMask m) { + return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, (Int512Mask) m); // specialize + } + @Override @ForceInline public Int512Vector lanewise(Binary op, Vector v) { return (Int512Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Int512Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, v, (Int512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Int512Vector @@ -286,15 +298,30 @@ final class Int512Vector extends IntVector { return (Int512Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Int512Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Int512Vector) super.lanewiseShiftTemplate(op, Int512Mask.class, e, (Int512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Int512Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Int512Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Int512Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Int512Vector) super.lanewiseTemplate(op, Int512Mask.class, v1, v2, (Int512Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Int512Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Int512Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Int512Mask.class, (Int512Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Int512Vector extends IntVector { return super.compareTemplate(Int512Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Int512Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Int512Mask.class, op, v, (Int512Mask) m); + } + + @Override @ForceInline public Int512Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Int512Vector extends IntVector { VectorMask m) { return (Int512Vector) super.rearrangeTemplate(Int512Shuffle.class, + Int512Mask.class, (Int512Shuffle) shuffle, (Int512Mask) m); // specialize } @@ -612,16 +647,12 @@ final class Int512Vector extends IntVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Int512Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -647,9 +678,9 @@ final class Int512Vector extends IntVector { public Int512Mask and(VectorMask mask) { Objects.requireNonNull(mask); Int512Mask m = (Int512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int512Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Int512Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -657,9 +688,9 @@ final class Int512Vector extends IntVector { public Int512Mask or(VectorMask mask) { Objects.requireNonNull(mask); Int512Mask m = (Int512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int512Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Int512Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -667,9 +698,9 @@ final class Int512Vector extends IntVector { Int512Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Int512Mask m = (Int512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int512Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Int512Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -677,22 +708,32 @@ final class Int512Vector extends IntVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int512Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Int512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int512Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int512Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Int512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int512Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int512Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Int512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int512Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int512Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -803,6 +844,20 @@ final class Int512Vector extends IntVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, VectorMask m) { + return super.fromArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); // specialize + } + + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Int512Mask.class, a, offset, indexMap, mapOffset, (Int512Mask) m); + } + @ForceInline @@ -812,6 +867,13 @@ final class Int512Vector extends IntVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); // specialize + } + @ForceInline @Override final @@ -819,6 +881,13 @@ final class Int512Vector extends IntVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Int512Mask.class, bb, offset, (Int512Mask) m); // specialize + } + @ForceInline @Override final @@ -826,6 +895,21 @@ final class Int512Vector extends IntVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, VectorMask m) { + super.intoArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Int512Mask.class, a, offset, indexMap, mapOffset, (Int512Mask) m); + } + + @ForceInline @Override final @@ -833,6 +917,21 @@ final class Int512Vector extends IntVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Int512Mask.class, a, offset, (Int512Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Int512Mask.class, bb, offset, (Int512Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java index 2775b168328..c9b1afb21b7 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java @@ -236,8 +236,8 @@ final class Int64Vector extends IntVector { @ForceInline final @Override - int rOp(int v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + int rOp(int v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Int64Vector extends IntVector { return (Int64Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Int64Vector lanewise(Unary op, VectorMask m) { + return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, (Int64Mask) m); // specialize + } + @Override @ForceInline public Int64Vector lanewise(Binary op, Vector v) { return (Int64Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Int64Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, v, (Int64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Int64Vector @@ -286,15 +298,30 @@ final class Int64Vector extends IntVector { return (Int64Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Int64Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Int64Vector) super.lanewiseShiftTemplate(op, Int64Mask.class, e, (Int64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Int64Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Int64Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Int64Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Int64Vector) super.lanewiseTemplate(op, Int64Mask.class, v1, v2, (Int64Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Int64Vector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Int64Vector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Int64Mask.class, (Int64Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Int64Vector extends IntVector { return super.compareTemplate(Int64Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Int64Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Int64Mask.class, op, v, (Int64Mask) m); + } + + @Override @ForceInline public Int64Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Int64Vector extends IntVector { VectorMask m) { return (Int64Vector) super.rearrangeTemplate(Int64Shuffle.class, + Int64Mask.class, (Int64Shuffle) shuffle, (Int64Mask) m); // specialize } @@ -584,16 +619,12 @@ final class Int64Vector extends IntVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Int64Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -619,9 +650,9 @@ final class Int64Vector extends IntVector { public Int64Mask and(VectorMask mask) { Objects.requireNonNull(mask); Int64Mask m = (Int64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Int64Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Int64Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -629,9 +660,9 @@ final class Int64Vector extends IntVector { public Int64Mask or(VectorMask mask) { Objects.requireNonNull(mask); Int64Mask m = (Int64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Int64Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Int64Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -639,9 +670,9 @@ final class Int64Vector extends IntVector { Int64Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Int64Mask m = (Int64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Int64Mask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Int64Mask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -649,22 +680,32 @@ final class Int64Vector extends IntVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int64Mask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((Int64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Int64Mask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int64Mask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((Int64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Int64Mask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int64Mask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((Int64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Int64Mask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Int64Mask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -775,6 +816,20 @@ final class Int64Vector extends IntVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, VectorMask m) { + return super.fromArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); // specialize + } + + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Int64Mask.class, a, offset, indexMap, mapOffset, (Int64Mask) m); + } + @ForceInline @@ -784,6 +839,13 @@ final class Int64Vector extends IntVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); // specialize + } + @ForceInline @Override final @@ -791,6 +853,13 @@ final class Int64Vector extends IntVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Int64Mask.class, bb, offset, (Int64Mask) m); // specialize + } + @ForceInline @Override final @@ -798,6 +867,21 @@ final class Int64Vector extends IntVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, VectorMask m) { + super.intoArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Int64Mask.class, a, offset, indexMap, mapOffset, (Int64Mask) m); + } + + @ForceInline @Override final @@ -805,6 +889,21 @@ final class Int64Vector extends IntVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Int64Mask.class, a, offset, (Int64Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Int64Mask.class, bb, offset, (Int64Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java index 2492e5d23e1..7b28a5947b0 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntMaxVector.java @@ -236,8 +236,8 @@ final class IntMaxVector extends IntVector { @ForceInline final @Override - int rOp(int v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + int rOp(int v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class IntMaxVector extends IntVector { return (IntMaxVector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public IntMaxVector lanewise(Unary op, VectorMask m) { + return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialize + } + @Override @ForceInline public IntMaxVector lanewise(Binary op, Vector v) { return (IntMaxVector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public IntMaxVector lanewise(Binary op, Vector v, VectorMask m) { + return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, v, (IntMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline IntMaxVector @@ -286,15 +298,30 @@ final class IntMaxVector extends IntVector { return (IntMaxVector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline IntMaxVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (IntMaxVector) super.lanewiseShiftTemplate(op, IntMaxMask.class, e, (IntMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final IntMaxVector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (IntMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + IntMaxVector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (IntMaxVector) super.lanewiseTemplate(op, IntMaxMask.class, v1, v2, (IntMaxMask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class IntMaxVector extends IntVector { @ForceInline public final int reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class IntMaxVector extends IntVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, IntMaxMask.class, (IntMaxMask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class IntMaxVector extends IntVector { return super.compareTemplate(IntMaxMask.class, op, s); // specialize } + @Override + @ForceInline + public final IntMaxMask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(IntMaxMask.class, op, v, (IntMaxMask) m); + } + + @Override @ForceInline public IntMaxVector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class IntMaxVector extends IntVector { VectorMask m) { return (IntMaxVector) super.rearrangeTemplate(IntMaxShuffle.class, + IntMaxMask.class, (IntMaxShuffle) shuffle, (IntMaxMask) m); // specialize } @@ -582,16 +617,12 @@ final class IntMaxVector extends IntVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - IntMaxMask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -617,9 +648,9 @@ final class IntMaxVector extends IntVector { public IntMaxMask and(VectorMask mask) { Objects.requireNonNull(mask); IntMaxMask m = (IntMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, IntMaxMask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, IntMaxMask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -627,9 +658,9 @@ final class IntMaxVector extends IntVector { public IntMaxMask or(VectorMask mask) { Objects.requireNonNull(mask); IntMaxMask m = (IntMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, IntMaxMask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, IntMaxMask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -637,9 +668,9 @@ final class IntMaxVector extends IntVector { IntMaxMask xor(VectorMask mask) { Objects.requireNonNull(mask); IntMaxMask m = (IntMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMaxMask.class, int.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, IntMaxMask.class, null, int.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -647,22 +678,32 @@ final class IntMaxVector extends IntVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMaxMask.class, int.class, VLENGTH, this, - (m) -> trueCountHelper(((IntMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, IntMaxMask.class, int.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMaxMask.class, int.class, VLENGTH, this, - (m) -> firstTrueHelper(((IntMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, IntMaxMask.class, int.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMaxMask.class, int.class, VLENGTH, this, - (m) -> lastTrueHelper(((IntMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, IntMaxMask.class, int.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, IntMaxMask.class, int.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -784,6 +825,20 @@ final class IntMaxVector extends IntVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, VectorMask m) { + return super.fromArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); // specialize + } + + @ForceInline + @Override + final + IntVector fromArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(IntMaxMask.class, a, offset, indexMap, mapOffset, (IntMaxMask) m); + } + @ForceInline @@ -793,6 +848,13 @@ final class IntMaxVector extends IntVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); // specialize + } + @ForceInline @Override final @@ -800,6 +862,13 @@ final class IntMaxVector extends IntVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(IntMaxMask.class, bb, offset, (IntMaxMask) m); // specialize + } + @ForceInline @Override final @@ -807,6 +876,21 @@ final class IntMaxVector extends IntVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, VectorMask m) { + super.intoArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); + } + + @ForceInline + @Override + final + void intoArray0(int[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(IntMaxMask.class, a, offset, indexMap, mapOffset, (IntMaxMask) m); + } + + @ForceInline @Override final @@ -814,6 +898,21 @@ final class IntMaxVector extends IntVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(IntMaxMask.class, a, offset, (IntMaxMask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(IntMaxMask.class, bb, offset, (IntMaxMask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java index 6fdf612a255..3deb61e9904 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -173,6 +172,9 @@ public abstract class IntVector extends AbstractVector { final IntVector uOpTemplate(VectorMask m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } int[] vec = vec(); int[] res = new int[length()]; boolean[] mbits = ((AbstractMask)m).getBits(); @@ -216,6 +218,9 @@ public abstract class IntVector extends AbstractVector { IntVector bOpTemplate(Vector o, VectorMask m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } int[] res = new int[length()]; int[] vec1 = this.vec(); int[] vec2 = ((IntVector)o).vec(); @@ -265,6 +270,9 @@ public abstract class IntVector extends AbstractVector { Vector o2, VectorMask m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } int[] res = new int[length()]; int[] vec1 = this.vec(); int[] vec2 = ((IntVector)o1).vec(); @@ -280,7 +288,22 @@ public abstract class IntVector extends AbstractVector { /*package-private*/ abstract - int rOp(int v, FBinOp f); + int rOp(int v, VectorMask m, FBinOp f); + + @ForceInline + final + int rOpTemplate(int v, VectorMask m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + int[] vec = vec(); + boolean[] mbits = ((AbstractMask)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final int rOpTemplate(int v, FBinOp f) { @@ -549,37 +572,61 @@ public abstract class IntVector extends AbstractVector { return blend(broadcast(-1), compare(NE, 0)); } if (op == NOT) { - return broadcast(-1).lanewiseTemplate(XOR, this); + return broadcast(-1).lanewise(XOR, this); } else if (op == NEG) { // FIXME: Support this in the JIT. - return broadcast(0).lanewiseTemplate(SUB, this); + return broadcast(0).lanewise(SUB, this); } } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), int.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> (int) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> (int) Math.abs(a)); - default: return null; - }})); + opc, getClass(), null, int.class, length(), + this, null, + UN_IMPL.find(op, opc, IntVector::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, IntVector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract IntVector lanewise(VectorOperators.Unary op, - VectorMask m) { - return blend(lanewise(op), m); + VectorMask m); + @ForceInline + final + IntVector lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } + if (op == NOT) { + return lanewise(XOR, broadcast(-1), m); + } else if (op == NEG) { + return lanewise(NOT, m).lanewise(ADD, broadcast(1), m); + } + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, int.class, length(), + this, m, + UN_IMPL.find(op, opc, IntVector::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, IntVector.class); + + private static UnaryOperation> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> (int) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> (int) Math.abs(a)); + default: return null; + } } // Binary lanewise support @@ -599,6 +646,7 @@ public abstract class IntVector extends AbstractVector { Vector v) { IntVector that = (IntVector) v; that.check(this); + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -617,74 +665,110 @@ public abstract class IntVector extends AbstractVector { that = that.lanewise(NOT); op = AND; } else if (op == DIV) { - VectorMask eqz = that.eq((int)0); + VectorMask eqz = that.eq((int) 0); if (eqz.anyTrue()) { throw that.divZeroException(); } } } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), int.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)Math.min(a, b)); - case VECTOR_OP_AND: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a & b)); - case VECTOR_OP_OR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a | b)); - case VECTOR_OP_XOR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (int)(a ^ b)); - case VECTOR_OP_LSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (int)(a << n)); - case VECTOR_OP_RSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (int)(a >> n)); - case VECTOR_OP_URSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (int)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, int.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, IntVector::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, IntVector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,int,VectorMask) */ - @ForceInline - public final + @Override + public abstract IntVector lanewise(VectorOperators.Binary op, Vector v, - VectorMask m) { + VectorMask m); + @ForceInline + final + IntVector lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector v, VectorMask m) { IntVector that = (IntVector) v; - if (op == DIV) { - VectorMask eqz = that.eq((int)0); - if (eqz.and(m).anyTrue()) { - throw that.divZeroException(); + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { + if (op == FIRST_NONZERO) { + // FIXME: Support this in the JIT. + VectorMask thisNZ + = this.viewAsIntegralLanes().compare(NE, (int) 0); + that = that.blend((int) 0, thisNZ.cast(vspecies())); + op = OR_UNCHECKED; + } + if (opKind(op, VO_SHIFT)) { + // As per shift specification for Java, mask the shift count. + // This allows the JIT to ignore some ISA details. + that = that.lanewise(AND, SHIFT_MASK); + } + if (op == AND_NOT) { + // FIXME: Support this in the JIT. + that = that.lanewise(NOT); + op = AND; + } else if (op == DIV) { + VectorMask eqz = that.eq((int)0); + if (eqz.and(m).anyTrue()) { + throw that.divZeroException(); + } + // suppress div/0 exceptions in unset lanes + that = that.lanewise(NOT, eqz); } - // suppress div/0 exceptions in unset lanes - that = that.lanewise(NOT, eqz); - return blend(lanewise(DIV, that), m); } - return blend(lanewise(op, v), m); + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, int.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, IntVector::binaryOperations)); + } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, IntVector.class); + + private static BinaryOperation> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)Math.min(a, b)); + case VECTOR_OP_AND: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a & b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a | b)); + case VECTOR_OP_XOR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (int)(a ^ b)); + case VECTOR_OP_LSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (int)(a << n)); + case VECTOR_OP_RSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (int)(a >> n)); + case VECTOR_OP_URSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (int)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateRight(a, (int)n)); + default: return null; + } } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -747,7 +831,13 @@ public abstract class IntVector extends AbstractVector { IntVector lanewise(VectorOperators.Binary op, int e, VectorMask m) { - return blend(lanewise(op, e), m); + if (opKind(op, VO_SHIFT) && (int)(int)e == e) { + return lanewiseShift(op, (int) e, m); + } + if (op == AND_NOT) { + op = AND; e = (int) ~e; + } + return lanewise(op, broadcast(e), m); } /** @@ -767,8 +857,7 @@ public abstract class IntVector extends AbstractVector { int e1 = (int) e; if ((long)e1 != e // allow shift ops to clip down their int parameters - && !(opKind(op, VO_SHIFT) && (int)e1 == e) - ) { + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { vspecies().checkValue(e); // for exception } return lanewise(op, e1); @@ -788,7 +877,13 @@ public abstract class IntVector extends AbstractVector { public final IntVector lanewise(VectorOperators.Binary op, long e, VectorMask m) { - return blend(lanewise(op, e), m); + int e1 = (int) e; + if ((long)e1 != e + // allow shift ops to clip down their int parameters + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { + vspecies().checkValue(e); // for exception + } + return lanewise(op, e1, m); } /*package-private*/ @@ -805,27 +900,52 @@ public abstract class IntVector extends AbstractVector { e &= SHIFT_MASK; int opc = opCode(op); return VectorSupport.broadcastInt( - opc, getClass(), int.class, length(), - this, e, - BIN_INT_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_LSHIFT: return (v, n) -> - v.uOp((i, a) -> (int)(a << n)); - case VECTOR_OP_RSHIFT: return (v, n) -> - v.uOp((i, a) -> (int)(a >> n)); - case VECTOR_OP_URSHIFT: return (v, n) -> - v.uOp((i, a) -> (int)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v, n) -> - v.uOp((i, a) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v, n) -> - v.uOp((i, a) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, int.class, length(), + this, e, null, + BIN_INT_IMPL.find(op, opc, IntVector::broadcastIntOperations)); } + + /*package-private*/ + abstract IntVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m); + + /*package-private*/ + @ForceInline + final IntVector + lanewiseShiftTemplate(VectorOperators.Binary op, + Class> maskClass, + int e, VectorMask m) { + m.check(maskClass, this); + assert(opKind(op, VO_SHIFT)); + // As per shift specification for Java, mask the shift count. + e &= SHIFT_MASK; + int opc = opCode(op); + return VectorSupport.broadcastInt( + opc, getClass(), maskClass, int.class, length(), + this, e, m, + BIN_INT_IMPL.find(op, opc, IntVector::broadcastIntOperations)); + } + private static final - ImplCache> BIN_INT_IMPL + ImplCache>> BIN_INT_IMPL = new ImplCache<>(Binary.class, IntVector.class); + private static VectorBroadcastIntOp> broadcastIntOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_LSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (int)(a << n)); + case VECTOR_OP_RSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (int)(a >> n)); + case VECTOR_OP_URSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (int)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateRight(a, (int)n)); + default: return null; + } + } + // As per shift specification for Java, mask the shift count. // We mask 0X3F (long), 0X1F (int), 0x0F (short), 0x7 (byte). // The latter two maskings go beyond the JLS, but seem reasonable @@ -877,16 +997,10 @@ public abstract class IntVector extends AbstractVector { } int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), int.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - default: return null; - }})); + opc, getClass(), null, int.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, IntVector::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, IntVector.class); /** * {@inheritDoc} @@ -894,13 +1008,48 @@ public abstract class IntVector extends AbstractVector { * @see #lanewise(VectorOperators.Ternary,Vector,int,VectorMask) * @see #lanewise(VectorOperators.Ternary,int,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract IntVector lanewise(VectorOperators.Ternary op, Vector v1, Vector v2, - VectorMask m) { - return blend(lanewise(op, v1, v2), m); + VectorMask m); + @ForceInline + final + IntVector lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector v1, + Vector v2, + VectorMask m) { + IntVector that = (IntVector) v1; + IntVector tother = (IntVector) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + + if (op == BITWISE_BLEND) { + // FIXME: Support this in the JIT. + that = this.lanewise(XOR, that).lanewise(AND, tother); + return this.lanewise(XOR, that, m); + } + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, int.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, IntVector::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, IntVector.class); + + private static TernaryOperation> ternaryOperations(int opc_) { + switch (opc_) { + default: return null; + } } /** @@ -957,7 +1106,7 @@ public abstract class IntVector extends AbstractVector { int e1, int e2, VectorMask m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -1015,7 +1164,7 @@ public abstract class IntVector extends AbstractVector { Vector v1, int e2, VectorMask m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -1072,7 +1221,7 @@ public abstract class IntVector extends AbstractVector { int e1, Vector v2, VectorMask m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -1744,15 +1893,13 @@ public abstract class IntVector extends AbstractVector { final > M compareTemplate(Class maskType, Comparison op, Vector v) { - Objects.requireNonNull(v); - IntSpecies vsp = vspecies(); IntVector that = (IntVector) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, int.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -1762,6 +1909,28 @@ public abstract class IntVector extends AbstractVector { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector v, M m) { + IntVector that = (IntVector) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, int.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, int a, int b) { return switch (cond) { @@ -1779,18 +1948,6 @@ public abstract class IntVector extends AbstractVector { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask compare(VectorOperators.Comparison op, - Vector v, - VectorMask m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -1849,7 +2006,7 @@ public abstract class IntVector extends AbstractVector { public final VectorMask compare(VectorOperators.Comparison op, int e, VectorMask m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } /** @@ -2100,9 +2257,9 @@ public abstract class IntVector extends AbstractVector { IntVector rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, int.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, int.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2119,24 +2276,25 @@ public abstract class IntVector extends AbstractVector { /*package-private*/ @ForceInline final - > + , M extends VectorMask> IntVector rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask m) { - IntVector unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, int.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast((int)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, int.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2159,17 +2317,17 @@ public abstract class IntVector extends AbstractVector { S ws = (S) shuffle.wrapIndexes(); IntVector r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, int.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, int.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); IntVector r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, int.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, int.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2432,9 +2590,18 @@ public abstract class IntVector extends AbstractVector { @ForceInline final int reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask m) { - IntVector v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + IntVector v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, int.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, IntVector::reductionOperations))); } /*package-private*/ @@ -2449,30 +2616,34 @@ public abstract class IntVector extends AbstractVector { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), int.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp((int)0, (i, a, b) -> (int)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp((int)1, (i, a, b) -> (int)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (int) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (int) Math.max(a, b))); - case VECTOR_OP_AND: return v -> - toBits(v.rOp((int)-1, (i, a, b) -> (int)(a & b))); - case VECTOR_OP_OR: return v -> - toBits(v.rOp((int)0, (i, a, b) -> (int)(a | b))); - case VECTOR_OP_XOR: return v -> - toBits(v.rOp((int)0, (i, a, b) -> (int)(a ^ b))); - default: return null; - }}))); + opc, getClass(), null, int.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, IntVector::reductionOperations))); } + private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, IntVector.class); + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, IntVector.class); + + private static ReductionOperation> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp((int)0, m, (i, a, b) -> (int)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp((int)1, m, (i, a, b) -> (int)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (int) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (int) Math.max(a, b))); + case VECTOR_OP_AND: return (v, m) -> + toBits(v.rOp((int)-1, m, (i, a, b) -> (int)(a & b))); + case VECTOR_OP_OR: return (v, m) -> + toBits(v.rOp((int)0, m, (i, a, b) -> (int)(a | b))); + case VECTOR_OP_XOR: return (v, m) -> + toBits(v.rOp((int)0, m, (i, a, b) -> (int)(a ^ b))); + default: return null; + } + } private @ForceInline @@ -2691,9 +2862,7 @@ public abstract class IntVector extends AbstractVector { VectorMask m) { IntSpecies vsp = (IntSpecies) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - IntVector zero = vsp.zero(); - IntVector v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2755,8 +2924,7 @@ public abstract class IntVector extends AbstractVector { VectorMask m) { IntSpecies vsp = (IntSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - IntVector zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -2814,13 +2982,13 @@ public abstract class IntVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorSupport.loadWithMap( - vectorType, int.class, vsp.laneCount(), - IntVector.species(vsp.indexShape()).vectorType(), - a, ARRAY_BASE, vix, + vectorType, null, int.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, null, a, offset, indexMap, mapOffset, vsp, - (int[] c, int idx, int[] iMap, int idy, IntSpecies s) -> + (c, idx, iMap, idy, s, vm) -> s.vOp(n -> c[idx + iMap[idy+n]])); - } + } /** * Gathers a new vector composed of elements from an array of type @@ -2868,9 +3036,8 @@ public abstract class IntVector extends AbstractVector { return fromArray(species, a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. IntSpecies vsp = (IntSpecies) species; - return vsp.vOp(m, n -> a[offset + indexMap[mapOffset + n]]); + return vsp.dummyVector().fromArray0(a, offset, indexMap, mapOffset, m); } } @@ -2964,9 +3131,7 @@ public abstract class IntVector extends AbstractVector { VectorMask m) { IntSpecies vsp = (IntSpecies) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - IntVector zero = vsp.zero(); - IntVector v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -3038,10 +3203,9 @@ public abstract class IntVector extends AbstractVector { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize IntSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -3085,12 +3249,12 @@ public abstract class IntVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); VectorSupport.storeWithMap( - vsp.vectorType(), vsp.elementType(), vsp.laneCount(), + vsp.vectorType(), null, vsp.elementType(), vsp.laneCount(), isp.vectorType(), a, arrayAddress(a, 0), vix, - this, + this, null, a, offset, indexMap, mapOffset, - (arr, off, v, map, mo) + (arr, off, v, map, mo, vm) -> v.stOp(arr, off, (arr_, off_, i, e) -> { int j = map[mo + i]; @@ -3137,12 +3301,7 @@ public abstract class IntVector extends AbstractVector { intoArray(a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. - stOp(a, offset, m, - (arr, off, i, e) -> { - int j = indexMap[mapOffset + i]; - arr[off + j] = e; - }); + intoArray0(a, offset, indexMap, mapOffset, m); } } @@ -3172,12 +3331,9 @@ public abstract class IntVector extends AbstractVector { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize IntSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 4, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putInt(o + i * 4, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -3189,7 +3345,7 @@ public abstract class IntVector extends AbstractVector { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -3208,15 +3364,12 @@ public abstract class IntVector extends AbstractVector { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } IntSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 4, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putInt(o + i * 4, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -3254,6 +3407,57 @@ public abstract class IntVector extends AbstractVector { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + IntVector fromArray0(int[] a, int offset, VectorMask m); + @ForceInline + final + > + IntVector fromArray0Template(Class maskClass, int[] a, int offset, M m) { + m.check(species()); + IntSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + + /*package-private*/ + abstract + IntVector fromArray0(int[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + IntVector fromArray0Template(Class maskClass, int[] a, int offset, + int[] indexMap, int mapOffset, M m) { + IntSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + Objects.requireNonNull(a); + Objects.requireNonNull(indexMap); + m.check(vsp); + Class vectorType = vsp.vectorType(); + + // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] + IntVector vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + return VectorSupport.loadWithMap( + vectorType, maskClass, int.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, m, + a, offset, indexMap, mapOffset, vsp, + (c, idx, iMap, idy, s, vm) -> + s.vOp(vm, n -> c[idx + iMap[idy+n]])); + } + @Override @@ -3274,6 +3478,25 @@ public abstract class IntVector extends AbstractVector { }); } + abstract + IntVector fromByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + IntVector fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + IntSpecies vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getInt(o + i * 4)); + }); + } + abstract IntVector fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -3290,6 +3513,24 @@ public abstract class IntVector extends AbstractVector { }); } + abstract + IntVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + IntVector fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + IntSpecies vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getInt(o + i * 4)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -3309,6 +3550,58 @@ public abstract class IntVector extends AbstractVector { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0(int[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, int[] a, int offset, M m) { + m.check(species()); + IntSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + + abstract + void intoArray0(int[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, int[] a, int offset, + int[] indexMap, int mapOffset, M m) { + m.check(species()); + IntSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] + IntVector vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + VectorSupport.storeWithMap( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + isp.vectorType(), + a, arrayAddress(a, 0), vix, + this, m, + a, offset, indexMap, mapOffset, + (arr, off, v, map, mo, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> { + int j = map[mo + i]; + arr[off + j] = e; + })); + } + + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -3326,6 +3619,25 @@ public abstract class IntVector extends AbstractVector { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + IntSpecies vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.putInt(o + i * 4, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -3340,6 +3652,25 @@ public abstract class IntVector extends AbstractVector { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + IntSpecies vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.putInt(o + i * 4, e)); + }); + } + + // End of low-level memory operations. private static @@ -3657,7 +3988,7 @@ public abstract class IntVector extends AbstractVector { /*package-private*/ @ForceInline IntVector ldOp(M memory, int offset, - AbstractMask m, + VectorMask m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java index 76e132522c9..81dbb215f0d 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java @@ -231,8 +231,8 @@ final class Long128Vector extends LongVector { @ForceInline final @Override - long rOp(long v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + long rOp(long v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -268,12 +268,24 @@ final class Long128Vector extends LongVector { return (Long128Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Long128Vector lanewise(Unary op, VectorMask m) { + return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, (Long128Mask) m); // specialize + } + @Override @ForceInline public Long128Vector lanewise(Binary op, Vector v) { return (Long128Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Long128Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, v, (Long128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Long128Vector @@ -281,15 +293,30 @@ final class Long128Vector extends LongVector { return (Long128Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Long128Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Long128Vector) super.lanewiseShiftTemplate(op, Long128Mask.class, e, (Long128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Long128Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Long128Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Long128Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Long128Vector) super.lanewiseTemplate(op, Long128Mask.class, v1, v2, (Long128Mask) m); // specialize + } + @Override @ForceInline public final @@ -309,7 +336,7 @@ final class Long128Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized } @Override @@ -322,7 +349,7 @@ final class Long128Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Long128Mask.class, (Long128Mask) m); // specialized } @ForceInline @@ -353,6 +380,13 @@ final class Long128Vector extends LongVector { } + @Override + @ForceInline + public final Long128Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Long128Mask.class, op, v, (Long128Mask) m); + } + + @Override @ForceInline public Long128Vector blend(Vector v, VectorMask m) { @@ -409,6 +443,7 @@ final class Long128Vector extends LongVector { VectorMask m) { return (Long128Vector) super.rearrangeTemplate(Long128Shuffle.class, + Long128Mask.class, (Long128Shuffle) shuffle, (Long128Mask) m); // specialize } @@ -574,16 +609,12 @@ final class Long128Vector extends LongVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Long128Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -609,9 +640,9 @@ final class Long128Vector extends LongVector { public Long128Mask and(VectorMask mask) { Objects.requireNonNull(mask); Long128Mask m = (Long128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long128Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Long128Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -619,9 +650,9 @@ final class Long128Vector extends LongVector { public Long128Mask or(VectorMask mask) { Objects.requireNonNull(mask); Long128Mask m = (Long128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long128Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Long128Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -629,9 +660,9 @@ final class Long128Vector extends LongVector { Long128Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Long128Mask m = (Long128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long128Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Long128Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -639,22 +670,32 @@ final class Long128Vector extends LongVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long128Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Long128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long128Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long128Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Long128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long128Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long128Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Long128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long128Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long128Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -765,6 +806,20 @@ final class Long128Vector extends LongVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, VectorMask m) { + return super.fromArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); // specialize + } + + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m); + } + @ForceInline @@ -774,6 +829,13 @@ final class Long128Vector extends LongVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); // specialize + } + @ForceInline @Override final @@ -781,6 +843,13 @@ final class Long128Vector extends LongVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Long128Mask.class, bb, offset, (Long128Mask) m); // specialize + } + @ForceInline @Override final @@ -788,6 +857,21 @@ final class Long128Vector extends LongVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, VectorMask m) { + super.intoArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Long128Mask.class, a, offset, indexMap, mapOffset, (Long128Mask) m); + } + + @ForceInline @Override final @@ -795,6 +879,21 @@ final class Long128Vector extends LongVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Long128Mask.class, a, offset, (Long128Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Long128Mask.class, bb, offset, (Long128Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java index a3ba9be431c..569bd91eafa 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java @@ -231,8 +231,8 @@ final class Long256Vector extends LongVector { @ForceInline final @Override - long rOp(long v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + long rOp(long v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -268,12 +268,24 @@ final class Long256Vector extends LongVector { return (Long256Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Long256Vector lanewise(Unary op, VectorMask m) { + return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, (Long256Mask) m); // specialize + } + @Override @ForceInline public Long256Vector lanewise(Binary op, Vector v) { return (Long256Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Long256Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, v, (Long256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Long256Vector @@ -281,15 +293,30 @@ final class Long256Vector extends LongVector { return (Long256Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Long256Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Long256Vector) super.lanewiseShiftTemplate(op, Long256Mask.class, e, (Long256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Long256Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Long256Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Long256Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Long256Vector) super.lanewiseTemplate(op, Long256Mask.class, v1, v2, (Long256Mask) m); // specialize + } + @Override @ForceInline public final @@ -309,7 +336,7 @@ final class Long256Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized } @Override @@ -322,7 +349,7 @@ final class Long256Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Long256Mask.class, (Long256Mask) m); // specialized } @ForceInline @@ -353,6 +380,13 @@ final class Long256Vector extends LongVector { } + @Override + @ForceInline + public final Long256Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Long256Mask.class, op, v, (Long256Mask) m); + } + + @Override @ForceInline public Long256Vector blend(Vector v, VectorMask m) { @@ -409,6 +443,7 @@ final class Long256Vector extends LongVector { VectorMask m) { return (Long256Vector) super.rearrangeTemplate(Long256Shuffle.class, + Long256Mask.class, (Long256Shuffle) shuffle, (Long256Mask) m); // specialize } @@ -578,16 +613,12 @@ final class Long256Vector extends LongVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Long256Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -613,9 +644,9 @@ final class Long256Vector extends LongVector { public Long256Mask and(VectorMask mask) { Objects.requireNonNull(mask); Long256Mask m = (Long256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long256Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Long256Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -623,9 +654,9 @@ final class Long256Vector extends LongVector { public Long256Mask or(VectorMask mask) { Objects.requireNonNull(mask); Long256Mask m = (Long256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long256Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Long256Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -633,9 +664,9 @@ final class Long256Vector extends LongVector { Long256Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Long256Mask m = (Long256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long256Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Long256Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -643,22 +674,32 @@ final class Long256Vector extends LongVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long256Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Long256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long256Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long256Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Long256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long256Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long256Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Long256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long256Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long256Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -769,6 +810,20 @@ final class Long256Vector extends LongVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, VectorMask m) { + return super.fromArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); // specialize + } + + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Long256Mask.class, a, offset, indexMap, mapOffset, (Long256Mask) m); + } + @ForceInline @@ -778,6 +833,13 @@ final class Long256Vector extends LongVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); // specialize + } + @ForceInline @Override final @@ -785,6 +847,13 @@ final class Long256Vector extends LongVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Long256Mask.class, bb, offset, (Long256Mask) m); // specialize + } + @ForceInline @Override final @@ -792,6 +861,21 @@ final class Long256Vector extends LongVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, VectorMask m) { + super.intoArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Long256Mask.class, a, offset, indexMap, mapOffset, (Long256Mask) m); + } + + @ForceInline @Override final @@ -799,6 +883,21 @@ final class Long256Vector extends LongVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Long256Mask.class, a, offset, (Long256Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Long256Mask.class, bb, offset, (Long256Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java index 5a222ffc539..543baf97d47 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java @@ -231,8 +231,8 @@ final class Long512Vector extends LongVector { @ForceInline final @Override - long rOp(long v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + long rOp(long v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -268,12 +268,24 @@ final class Long512Vector extends LongVector { return (Long512Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Long512Vector lanewise(Unary op, VectorMask m) { + return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, (Long512Mask) m); // specialize + } + @Override @ForceInline public Long512Vector lanewise(Binary op, Vector v) { return (Long512Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Long512Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, v, (Long512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Long512Vector @@ -281,15 +293,30 @@ final class Long512Vector extends LongVector { return (Long512Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Long512Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Long512Vector) super.lanewiseShiftTemplate(op, Long512Mask.class, e, (Long512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Long512Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Long512Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Long512Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Long512Vector) super.lanewiseTemplate(op, Long512Mask.class, v1, v2, (Long512Mask) m); // specialize + } + @Override @ForceInline public final @@ -309,7 +336,7 @@ final class Long512Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized } @Override @@ -322,7 +349,7 @@ final class Long512Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Long512Mask.class, (Long512Mask) m); // specialized } @ForceInline @@ -353,6 +380,13 @@ final class Long512Vector extends LongVector { } + @Override + @ForceInline + public final Long512Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Long512Mask.class, op, v, (Long512Mask) m); + } + + @Override @ForceInline public Long512Vector blend(Vector v, VectorMask m) { @@ -409,6 +443,7 @@ final class Long512Vector extends LongVector { VectorMask m) { return (Long512Vector) super.rearrangeTemplate(Long512Shuffle.class, + Long512Mask.class, (Long512Shuffle) shuffle, (Long512Mask) m); // specialize } @@ -586,16 +621,12 @@ final class Long512Vector extends LongVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Long512Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -621,9 +652,9 @@ final class Long512Vector extends LongVector { public Long512Mask and(VectorMask mask) { Objects.requireNonNull(mask); Long512Mask m = (Long512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long512Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Long512Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -631,9 +662,9 @@ final class Long512Vector extends LongVector { public Long512Mask or(VectorMask mask) { Objects.requireNonNull(mask); Long512Mask m = (Long512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long512Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Long512Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -641,9 +672,9 @@ final class Long512Vector extends LongVector { Long512Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Long512Mask m = (Long512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long512Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Long512Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -651,22 +682,32 @@ final class Long512Vector extends LongVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long512Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Long512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long512Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long512Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Long512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long512Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long512Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Long512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long512Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long512Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -777,6 +818,20 @@ final class Long512Vector extends LongVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, VectorMask m) { + return super.fromArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); // specialize + } + + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Long512Mask.class, a, offset, indexMap, mapOffset, (Long512Mask) m); + } + @ForceInline @@ -786,6 +841,13 @@ final class Long512Vector extends LongVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); // specialize + } + @ForceInline @Override final @@ -793,6 +855,13 @@ final class Long512Vector extends LongVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Long512Mask.class, bb, offset, (Long512Mask) m); // specialize + } + @ForceInline @Override final @@ -800,6 +869,21 @@ final class Long512Vector extends LongVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, VectorMask m) { + super.intoArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Long512Mask.class, a, offset, indexMap, mapOffset, (Long512Mask) m); + } + + @ForceInline @Override final @@ -807,6 +891,21 @@ final class Long512Vector extends LongVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Long512Mask.class, a, offset, (Long512Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Long512Mask.class, bb, offset, (Long512Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java index af3cb85811e..328b399d59e 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java @@ -231,8 +231,8 @@ final class Long64Vector extends LongVector { @ForceInline final @Override - long rOp(long v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + long rOp(long v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -268,12 +268,24 @@ final class Long64Vector extends LongVector { return (Long64Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Long64Vector lanewise(Unary op, VectorMask m) { + return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, (Long64Mask) m); // specialize + } + @Override @ForceInline public Long64Vector lanewise(Binary op, Vector v) { return (Long64Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Long64Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, v, (Long64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Long64Vector @@ -281,15 +293,30 @@ final class Long64Vector extends LongVector { return (Long64Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Long64Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Long64Vector) super.lanewiseShiftTemplate(op, Long64Mask.class, e, (Long64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Long64Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Long64Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Long64Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Long64Vector) super.lanewiseTemplate(op, Long64Mask.class, v1, v2, (Long64Mask) m); // specialize + } + @Override @ForceInline public final @@ -309,7 +336,7 @@ final class Long64Vector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized } @Override @@ -322,7 +349,7 @@ final class Long64Vector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Long64Mask.class, (Long64Mask) m); // specialized } @ForceInline @@ -353,6 +380,13 @@ final class Long64Vector extends LongVector { } + @Override + @ForceInline + public final Long64Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Long64Mask.class, op, v, (Long64Mask) m); + } + + @Override @ForceInline public Long64Vector blend(Vector v, VectorMask m) { @@ -409,6 +443,7 @@ final class Long64Vector extends LongVector { VectorMask m) { return (Long64Vector) super.rearrangeTemplate(Long64Shuffle.class, + Long64Mask.class, (Long64Shuffle) shuffle, (Long64Mask) m); // specialize } @@ -572,16 +607,12 @@ final class Long64Vector extends LongVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Long64Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -607,9 +638,9 @@ final class Long64Vector extends LongVector { public Long64Mask and(VectorMask mask) { Objects.requireNonNull(mask); Long64Mask m = (Long64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Long64Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Long64Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -617,9 +648,9 @@ final class Long64Vector extends LongVector { public Long64Mask or(VectorMask mask) { Objects.requireNonNull(mask); Long64Mask m = (Long64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Long64Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Long64Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -627,9 +658,9 @@ final class Long64Vector extends LongVector { Long64Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Long64Mask m = (Long64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Long64Mask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Long64Mask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -637,22 +668,32 @@ final class Long64Vector extends LongVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long64Mask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((Long64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Long64Mask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long64Mask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((Long64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Long64Mask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long64Mask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((Long64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Long64Mask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Long64Mask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -763,6 +804,20 @@ final class Long64Vector extends LongVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, VectorMask m) { + return super.fromArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); // specialize + } + + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(Long64Mask.class, a, offset, indexMap, mapOffset, (Long64Mask) m); + } + @ForceInline @@ -772,6 +827,13 @@ final class Long64Vector extends LongVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); // specialize + } + @ForceInline @Override final @@ -779,6 +841,13 @@ final class Long64Vector extends LongVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Long64Mask.class, bb, offset, (Long64Mask) m); // specialize + } + @ForceInline @Override final @@ -786,6 +855,21 @@ final class Long64Vector extends LongVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, VectorMask m) { + super.intoArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); + } + + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(Long64Mask.class, a, offset, indexMap, mapOffset, (Long64Mask) m); + } + + @ForceInline @Override final @@ -793,6 +877,21 @@ final class Long64Vector extends LongVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Long64Mask.class, a, offset, (Long64Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Long64Mask.class, bb, offset, (Long64Mask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java index a38386c4984..23e9d9f3fb6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongMaxVector.java @@ -231,8 +231,8 @@ final class LongMaxVector extends LongVector { @ForceInline final @Override - long rOp(long v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + long rOp(long v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -268,12 +268,24 @@ final class LongMaxVector extends LongVector { return (LongMaxVector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public LongMaxVector lanewise(Unary op, VectorMask m) { + return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialize + } + @Override @ForceInline public LongMaxVector lanewise(Binary op, Vector v) { return (LongMaxVector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public LongMaxVector lanewise(Binary op, Vector v, VectorMask m) { + return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, v, (LongMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline LongMaxVector @@ -281,15 +293,30 @@ final class LongMaxVector extends LongVector { return (LongMaxVector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline LongMaxVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (LongMaxVector) super.lanewiseShiftTemplate(op, LongMaxMask.class, e, (LongMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final LongMaxVector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (LongMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + LongMaxVector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (LongMaxVector) super.lanewiseTemplate(op, LongMaxMask.class, v1, v2, (LongMaxMask) m); // specialize + } + @Override @ForceInline public final @@ -309,7 +336,7 @@ final class LongMaxVector extends LongVector { @ForceInline public final long reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized } @Override @@ -322,7 +349,7 @@ final class LongMaxVector extends LongVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, LongMaxMask.class, (LongMaxMask) m); // specialized } @ForceInline @@ -353,6 +380,13 @@ final class LongMaxVector extends LongVector { } + @Override + @ForceInline + public final LongMaxMask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(LongMaxMask.class, op, v, (LongMaxMask) m); + } + + @Override @ForceInline public LongMaxVector blend(Vector v, VectorMask m) { @@ -409,6 +443,7 @@ final class LongMaxVector extends LongVector { VectorMask m) { return (LongMaxVector) super.rearrangeTemplate(LongMaxShuffle.class, + LongMaxMask.class, (LongMaxShuffle) shuffle, (LongMaxMask) m); // specialize } @@ -572,16 +607,12 @@ final class LongMaxVector extends LongVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - LongMaxMask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -607,9 +638,9 @@ final class LongMaxVector extends LongVector { public LongMaxMask and(VectorMask mask) { Objects.requireNonNull(mask); LongMaxMask m = (LongMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, LongMaxMask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, LongMaxMask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -617,9 +648,9 @@ final class LongMaxVector extends LongVector { public LongMaxMask or(VectorMask mask) { Objects.requireNonNull(mask); LongMaxMask m = (LongMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, LongMaxMask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, LongMaxMask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -627,9 +658,9 @@ final class LongMaxVector extends LongVector { LongMaxMask xor(VectorMask mask) { Objects.requireNonNull(mask); LongMaxMask m = (LongMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMaxMask.class, long.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, LongMaxMask.class, null, long.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -637,22 +668,32 @@ final class LongMaxVector extends LongVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMaxMask.class, long.class, VLENGTH, this, - (m) -> trueCountHelper(((LongMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, LongMaxMask.class, long.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMaxMask.class, long.class, VLENGTH, this, - (m) -> firstTrueHelper(((LongMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, LongMaxMask.class, long.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMaxMask.class, long.class, VLENGTH, this, - (m) -> lastTrueHelper(((LongMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, LongMaxMask.class, long.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, LongMaxMask.class, long.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -763,6 +804,20 @@ final class LongMaxVector extends LongVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, VectorMask m) { + return super.fromArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); // specialize + } + + @ForceInline + @Override + final + LongVector fromArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + return super.fromArray0Template(LongMaxMask.class, a, offset, indexMap, mapOffset, (LongMaxMask) m); + } + @ForceInline @@ -772,6 +827,13 @@ final class LongMaxVector extends LongVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); // specialize + } + @ForceInline @Override final @@ -779,6 +841,13 @@ final class LongMaxVector extends LongVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(LongMaxMask.class, bb, offset, (LongMaxMask) m); // specialize + } + @ForceInline @Override final @@ -786,6 +855,21 @@ final class LongMaxVector extends LongVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, VectorMask m) { + super.intoArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); + } + + @ForceInline + @Override + final + void intoArray0(long[] a, int offset, int[] indexMap, int mapOffset, VectorMask m) { + super.intoArray0Template(LongMaxMask.class, a, offset, indexMap, mapOffset, (LongMaxMask) m); + } + + @ForceInline @Override final @@ -793,6 +877,21 @@ final class LongMaxVector extends LongVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(LongMaxMask.class, a, offset, (LongMaxMask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(LongMaxMask.class, bb, offset, (LongMaxMask) m); + } + + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java index f5069826d44..b48778f5ec3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -173,6 +172,9 @@ public abstract class LongVector extends AbstractVector { final LongVector uOpTemplate(VectorMask m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } long[] vec = vec(); long[] res = new long[length()]; boolean[] mbits = ((AbstractMask)m).getBits(); @@ -216,6 +218,9 @@ public abstract class LongVector extends AbstractVector { LongVector bOpTemplate(Vector o, VectorMask m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } long[] res = new long[length()]; long[] vec1 = this.vec(); long[] vec2 = ((LongVector)o).vec(); @@ -265,6 +270,9 @@ public abstract class LongVector extends AbstractVector { Vector o2, VectorMask m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } long[] res = new long[length()]; long[] vec1 = this.vec(); long[] vec2 = ((LongVector)o1).vec(); @@ -280,7 +288,22 @@ public abstract class LongVector extends AbstractVector { /*package-private*/ abstract - long rOp(long v, FBinOp f); + long rOp(long v, VectorMask m, FBinOp f); + + @ForceInline + final + long rOpTemplate(long v, VectorMask m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + long[] vec = vec(); + boolean[] mbits = ((AbstractMask)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final long rOpTemplate(long v, FBinOp f) { @@ -507,37 +530,61 @@ public abstract class LongVector extends AbstractVector { return blend(broadcast(-1), compare(NE, 0)); } if (op == NOT) { - return broadcast(-1).lanewiseTemplate(XOR, this); + return broadcast(-1).lanewise(XOR, this); } else if (op == NEG) { // FIXME: Support this in the JIT. - return broadcast(0).lanewiseTemplate(SUB, this); + return broadcast(0).lanewise(SUB, this); } } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), long.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> (long) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> (long) Math.abs(a)); - default: return null; - }})); + opc, getClass(), null, long.class, length(), + this, null, + UN_IMPL.find(op, opc, LongVector::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, LongVector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract LongVector lanewise(VectorOperators.Unary op, - VectorMask m) { - return blend(lanewise(op), m); + VectorMask m); + @ForceInline + final + LongVector lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } + if (op == NOT) { + return lanewise(XOR, broadcast(-1), m); + } else if (op == NEG) { + return lanewise(NOT, m).lanewise(ADD, broadcast(1), m); + } + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, long.class, length(), + this, m, + UN_IMPL.find(op, opc, LongVector::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, LongVector.class); + + private static UnaryOperation> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> (long) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> (long) Math.abs(a)); + default: return null; + } } // Binary lanewise support @@ -557,6 +604,7 @@ public abstract class LongVector extends AbstractVector { Vector v) { LongVector that = (LongVector) v; that.check(this); + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -575,74 +623,110 @@ public abstract class LongVector extends AbstractVector { that = that.lanewise(NOT); op = AND; } else if (op == DIV) { - VectorMask eqz = that.eq((long)0); + VectorMask eqz = that.eq((long) 0); if (eqz.anyTrue()) { throw that.divZeroException(); } } } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), long.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)Math.min(a, b)); - case VECTOR_OP_AND: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a & b)); - case VECTOR_OP_OR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a | b)); - case VECTOR_OP_XOR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (long)(a ^ b)); - case VECTOR_OP_LSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (long)(a << n)); - case VECTOR_OP_RSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (long)(a >> n)); - case VECTOR_OP_URSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (long)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, long.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, LongVector::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, LongVector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,long,VectorMask) */ - @ForceInline - public final + @Override + public abstract LongVector lanewise(VectorOperators.Binary op, Vector v, - VectorMask m) { + VectorMask m); + @ForceInline + final + LongVector lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector v, VectorMask m) { LongVector that = (LongVector) v; - if (op == DIV) { - VectorMask eqz = that.eq((long)0); - if (eqz.and(m).anyTrue()) { - throw that.divZeroException(); + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { + if (op == FIRST_NONZERO) { + // FIXME: Support this in the JIT. + VectorMask thisNZ + = this.viewAsIntegralLanes().compare(NE, (long) 0); + that = that.blend((long) 0, thisNZ.cast(vspecies())); + op = OR_UNCHECKED; } - // suppress div/0 exceptions in unset lanes - that = that.lanewise(NOT, eqz); - return blend(lanewise(DIV, that), m); + if (opKind(op, VO_SHIFT)) { + // As per shift specification for Java, mask the shift count. + // This allows the JIT to ignore some ISA details. + that = that.lanewise(AND, SHIFT_MASK); + } + if (op == AND_NOT) { + // FIXME: Support this in the JIT. + that = that.lanewise(NOT); + op = AND; + } else if (op == DIV) { + VectorMask eqz = that.eq((long)0); + if (eqz.and(m).anyTrue()) { + throw that.divZeroException(); + } + // suppress div/0 exceptions in unset lanes + that = that.lanewise(NOT, eqz); + } + } + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, long.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, LongVector::binaryOperations)); + } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, LongVector.class); + + private static BinaryOperation> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)Math.min(a, b)); + case VECTOR_OP_AND: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a & b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a | b)); + case VECTOR_OP_XOR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (long)(a ^ b)); + case VECTOR_OP_LSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (long)(a << n)); + case VECTOR_OP_RSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (long)(a >> n)); + case VECTOR_OP_URSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (long)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateRight(a, (int)n)); + default: return null; } - return blend(lanewise(op, v), m); } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -705,7 +789,13 @@ public abstract class LongVector extends AbstractVector { LongVector lanewise(VectorOperators.Binary op, long e, VectorMask m) { - return blend(lanewise(op, e), m); + if (opKind(op, VO_SHIFT) && (long)(int)e == e) { + return lanewiseShift(op, (int) e, m); + } + if (op == AND_NOT) { + op = AND; e = (long) ~e; + } + return lanewise(op, broadcast(e), m); } @@ -723,27 +813,52 @@ public abstract class LongVector extends AbstractVector { e &= SHIFT_MASK; int opc = opCode(op); return VectorSupport.broadcastInt( - opc, getClass(), long.class, length(), - this, e, - BIN_INT_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_LSHIFT: return (v, n) -> - v.uOp((i, a) -> (long)(a << n)); - case VECTOR_OP_RSHIFT: return (v, n) -> - v.uOp((i, a) -> (long)(a >> n)); - case VECTOR_OP_URSHIFT: return (v, n) -> - v.uOp((i, a) -> (long)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v, n) -> - v.uOp((i, a) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v, n) -> - v.uOp((i, a) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, long.class, length(), + this, e, null, + BIN_INT_IMPL.find(op, opc, LongVector::broadcastIntOperations)); + } + + /*package-private*/ + abstract LongVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m); + + /*package-private*/ + @ForceInline + final LongVector + lanewiseShiftTemplate(VectorOperators.Binary op, + Class> maskClass, + int e, VectorMask m) { + m.check(maskClass, this); + assert(opKind(op, VO_SHIFT)); + // As per shift specification for Java, mask the shift count. + e &= SHIFT_MASK; + int opc = opCode(op); + return VectorSupport.broadcastInt( + opc, getClass(), maskClass, long.class, length(), + this, e, m, + BIN_INT_IMPL.find(op, opc, LongVector::broadcastIntOperations)); } + private static final - ImplCache> BIN_INT_IMPL + ImplCache>> BIN_INT_IMPL = new ImplCache<>(Binary.class, LongVector.class); + private static VectorBroadcastIntOp> broadcastIntOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_LSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (long)(a << n)); + case VECTOR_OP_RSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (long)(a >> n)); + case VECTOR_OP_URSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (long)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateRight(a, (int)n)); + default: return null; + } + } + // As per shift specification for Java, mask the shift count. // We mask 0X3F (long), 0X1F (int), 0x0F (short), 0x7 (byte). // The latter two maskings go beyond the JLS, but seem reasonable @@ -795,16 +910,10 @@ public abstract class LongVector extends AbstractVector { } int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), long.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - default: return null; - }})); + opc, getClass(), null, long.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, LongVector::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, LongVector.class); /** * {@inheritDoc} @@ -812,13 +921,48 @@ public abstract class LongVector extends AbstractVector { * @see #lanewise(VectorOperators.Ternary,Vector,long,VectorMask) * @see #lanewise(VectorOperators.Ternary,long,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract LongVector lanewise(VectorOperators.Ternary op, Vector v1, Vector v2, - VectorMask m) { - return blend(lanewise(op, v1, v2), m); + VectorMask m); + @ForceInline + final + LongVector lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector v1, + Vector v2, + VectorMask m) { + LongVector that = (LongVector) v1; + LongVector tother = (LongVector) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + + if (op == BITWISE_BLEND) { + // FIXME: Support this in the JIT. + that = this.lanewise(XOR, that).lanewise(AND, tother); + return this.lanewise(XOR, that, m); + } + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, long.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, LongVector::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, LongVector.class); + + private static TernaryOperation> ternaryOperations(int opc_) { + switch (opc_) { + default: return null; + } } /** @@ -875,7 +1019,7 @@ public abstract class LongVector extends AbstractVector { long e1, long e2, VectorMask m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -933,7 +1077,7 @@ public abstract class LongVector extends AbstractVector { Vector v1, long e2, VectorMask m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -990,7 +1134,7 @@ public abstract class LongVector extends AbstractVector { long e1, Vector v2, VectorMask m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -1662,15 +1806,13 @@ public abstract class LongVector extends AbstractVector { final > M compareTemplate(Class maskType, Comparison op, Vector v) { - Objects.requireNonNull(v); - LongSpecies vsp = vspecies(); LongVector that = (LongVector) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, long.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -1680,6 +1822,28 @@ public abstract class LongVector extends AbstractVector { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector v, M m) { + LongVector that = (LongVector) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, long.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, long a, long b) { return switch (cond) { @@ -1697,18 +1861,6 @@ public abstract class LongVector extends AbstractVector { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask compare(VectorOperators.Comparison op, - Vector v, - VectorMask m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -1767,7 +1919,7 @@ public abstract class LongVector extends AbstractVector { public final VectorMask compare(VectorOperators.Comparison op, long e, VectorMask m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } @@ -1971,9 +2123,9 @@ public abstract class LongVector extends AbstractVector { LongVector rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, long.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, long.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -1990,24 +2142,25 @@ public abstract class LongVector extends AbstractVector { /*package-private*/ @ForceInline final - > + , M extends VectorMask> LongVector rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask m) { - LongVector unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, long.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast((long)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, long.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2030,17 +2183,17 @@ public abstract class LongVector extends AbstractVector { S ws = (S) shuffle.wrapIndexes(); LongVector r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, long.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, long.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); LongVector r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, long.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, long.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2303,9 +2456,18 @@ public abstract class LongVector extends AbstractVector { @ForceInline final long reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask m) { - LongVector v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + LongVector v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, long.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, LongVector::reductionOperations))); } /*package-private*/ @@ -2320,30 +2482,34 @@ public abstract class LongVector extends AbstractVector { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), long.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp((long)0, (i, a, b) -> (long)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp((long)1, (i, a, b) -> (long)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (long) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (long) Math.max(a, b))); - case VECTOR_OP_AND: return v -> - toBits(v.rOp((long)-1, (i, a, b) -> (long)(a & b))); - case VECTOR_OP_OR: return v -> - toBits(v.rOp((long)0, (i, a, b) -> (long)(a | b))); - case VECTOR_OP_XOR: return v -> - toBits(v.rOp((long)0, (i, a, b) -> (long)(a ^ b))); - default: return null; - }}))); + opc, getClass(), null, long.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, LongVector::reductionOperations))); } + private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, LongVector.class); + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, LongVector.class); + + private static ReductionOperation> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp((long)0, m, (i, a, b) -> (long)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp((long)1, m, (i, a, b) -> (long)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (long) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (long) Math.max(a, b))); + case VECTOR_OP_AND: return (v, m) -> + toBits(v.rOp((long)-1, m, (i, a, b) -> (long)(a & b))); + case VECTOR_OP_OR: return (v, m) -> + toBits(v.rOp((long)0, m, (i, a, b) -> (long)(a | b))); + case VECTOR_OP_XOR: return (v, m) -> + toBits(v.rOp((long)0, m, (i, a, b) -> (long)(a ^ b))); + default: return null; + } + } private @ForceInline @@ -2557,9 +2723,7 @@ public abstract class LongVector extends AbstractVector { VectorMask m) { LongSpecies vsp = (LongSpecies) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - LongVector zero = vsp.zero(); - LongVector v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2621,8 +2785,7 @@ public abstract class LongVector extends AbstractVector { VectorMask m) { LongSpecies vsp = (LongSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - LongVector zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -2698,13 +2861,13 @@ public abstract class LongVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorSupport.loadWithMap( - vectorType, long.class, vsp.laneCount(), - IntVector.species(vsp.indexShape()).vectorType(), - a, ARRAY_BASE, vix, + vectorType, null, long.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, null, a, offset, indexMap, mapOffset, vsp, - (long[] c, int idx, int[] iMap, int idy, LongSpecies s) -> + (c, idx, iMap, idy, s, vm) -> s.vOp(n -> c[idx + iMap[idy+n]])); - } + } /** * Gathers a new vector composed of elements from an array of type @@ -2752,9 +2915,8 @@ public abstract class LongVector extends AbstractVector { return fromArray(species, a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. LongSpecies vsp = (LongSpecies) species; - return vsp.vOp(m, n -> a[offset + indexMap[mapOffset + n]]); + return vsp.dummyVector().fromArray0(a, offset, indexMap, mapOffset, m); } } @@ -2848,9 +3010,7 @@ public abstract class LongVector extends AbstractVector { VectorMask m) { LongSpecies vsp = (LongSpecies) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - LongVector zero = vsp.zero(); - LongVector v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2922,10 +3082,9 @@ public abstract class LongVector extends AbstractVector { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize LongSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -2988,12 +3147,12 @@ public abstract class LongVector extends AbstractVector { vix = VectorIntrinsics.checkIndex(vix, a.length); VectorSupport.storeWithMap( - vsp.vectorType(), vsp.elementType(), vsp.laneCount(), + vsp.vectorType(), null, vsp.elementType(), vsp.laneCount(), isp.vectorType(), a, arrayAddress(a, 0), vix, - this, + this, null, a, offset, indexMap, mapOffset, - (arr, off, v, map, mo) + (arr, off, v, map, mo, vm) -> v.stOp(arr, off, (arr_, off_, i, e) -> { int j = map[mo + i]; @@ -3040,12 +3199,7 @@ public abstract class LongVector extends AbstractVector { intoArray(a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. - stOp(a, offset, m, - (arr, off, i, e) -> { - int j = indexMap[mapOffset + i]; - arr[off + j] = e; - }); + intoArray0(a, offset, indexMap, mapOffset, m); } } @@ -3075,12 +3229,9 @@ public abstract class LongVector extends AbstractVector { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize LongSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 8, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putLong(o + i * 8, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -3092,7 +3243,7 @@ public abstract class LongVector extends AbstractVector { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -3111,15 +3262,12 @@ public abstract class LongVector extends AbstractVector { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } LongSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 8, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putLong(o + i * 8, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -3157,6 +3305,75 @@ public abstract class LongVector extends AbstractVector { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + LongVector fromArray0(long[] a, int offset, VectorMask m); + @ForceInline + final + > + LongVector fromArray0Template(Class maskClass, long[] a, int offset, M m) { + m.check(species()); + LongSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + + /*package-private*/ + abstract + LongVector fromArray0(long[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + LongVector fromArray0Template(Class maskClass, long[] a, int offset, + int[] indexMap, int mapOffset, M m) { + LongSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + Objects.requireNonNull(a); + Objects.requireNonNull(indexMap); + m.check(vsp); + Class vectorType = vsp.vectorType(); + + if (vsp.laneCount() == 1) { + return LongVector.fromArray(vsp, a, offset + indexMap[mapOffset], m); + } + + // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] + IntVector vix; + if (isp.laneCount() != vsp.laneCount()) { + // For LongMaxVector, if vector length is non-power-of-two or + // 2048 bits, indexShape of Long species is S_MAX_BIT. + // Assume that vector length is 2048, then the lane count of Long + // vector is 32. When converting Long species to int species, + // indexShape is still S_MAX_BIT, but the lane count of int vector + // is 64. So when loading index vector (IntVector), only lower half + // of index data is needed. + vix = IntVector + .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .add(offset); + } else { + vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + } + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + return VectorSupport.loadWithMap( + vectorType, maskClass, long.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, m, + a, offset, indexMap, mapOffset, vsp, + (c, idx, iMap, idy, s, vm) -> + s.vOp(vm, n -> c[idx + iMap[idy+n]])); + } + @Override @@ -3177,6 +3394,25 @@ public abstract class LongVector extends AbstractVector { }); } + abstract + LongVector fromByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + LongVector fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + LongSpecies vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getLong(o + i * 8)); + }); + } + abstract LongVector fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -3193,6 +3429,24 @@ public abstract class LongVector extends AbstractVector { }); } + abstract + LongVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + LongVector fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + LongSpecies vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getLong(o + i * 8)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -3212,6 +3466,77 @@ public abstract class LongVector extends AbstractVector { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0(long[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, long[] a, int offset, M m) { + m.check(species()); + LongSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + + abstract + void intoArray0(long[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, long[] a, int offset, + int[] indexMap, int mapOffset, M m) { + m.check(species()); + LongSpecies vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + if (vsp.laneCount() == 1) { + intoArray(a, offset + indexMap[mapOffset], m); + return; + } + + // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] + IntVector vix; + if (isp.laneCount() != vsp.laneCount()) { + // For LongMaxVector, if vector length is 2048 bits, indexShape + // of Long species is S_MAX_BIT. and the lane count of Long + // vector is 32. When converting Long species to int species, + // indexShape is still S_MAX_BIT, but the lane count of int vector + // is 64. So when loading index vector (IntVector), only lower half + // of index data is needed. + vix = IntVector + .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .add(offset); + } else { + vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + } + + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + VectorSupport.storeWithMap( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + isp.vectorType(), + a, arrayAddress(a, 0), vix, + this, m, + a, offset, indexMap, mapOffset, + (arr, off, v, map, mo, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> { + int j = map[mo + i]; + arr[off + j] = e; + })); + } + + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -3229,6 +3554,25 @@ public abstract class LongVector extends AbstractVector { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + LongSpecies vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.putLong(o + i * 8, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -3243,6 +3587,25 @@ public abstract class LongVector extends AbstractVector { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + LongSpecies vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.putLong(o + i * 8, e)); + }); + } + + // End of low-level memory operations. private static @@ -3551,7 +3914,7 @@ public abstract class LongVector extends AbstractVector { /*package-private*/ @ForceInline LongVector ldOp(M memory, int offset, - AbstractMask m, + VectorMask m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java index 6292160a52b..cd52dc003b6 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java @@ -236,8 +236,8 @@ final class Short128Vector extends ShortVector { @ForceInline final @Override - short rOp(short v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + short rOp(short v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Short128Vector extends ShortVector { return (Short128Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Short128Vector lanewise(Unary op, VectorMask m) { + return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, (Short128Mask) m); // specialize + } + @Override @ForceInline public Short128Vector lanewise(Binary op, Vector v) { return (Short128Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Short128Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v, (Short128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Short128Vector @@ -286,15 +298,30 @@ final class Short128Vector extends ShortVector { return (Short128Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Short128Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Short128Vector) super.lanewiseShiftTemplate(op, Short128Mask.class, e, (Short128Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Short128Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Short128Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Short128Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Short128Vector) super.lanewiseTemplate(op, Short128Mask.class, v1, v2, (Short128Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Short128Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Short128Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Short128Mask.class, (Short128Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Short128Vector extends ShortVector { return super.compareTemplate(Short128Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Short128Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Short128Mask.class, op, v, (Short128Mask) m); + } + + @Override @ForceInline public Short128Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Short128Vector extends ShortVector { VectorMask m) { return (Short128Vector) super.rearrangeTemplate(Short128Shuffle.class, + Short128Mask.class, (Short128Shuffle) shuffle, (Short128Mask) m); // specialize } @@ -596,16 +631,12 @@ final class Short128Vector extends ShortVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Short128Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -631,9 +662,9 @@ final class Short128Vector extends ShortVector { public Short128Mask and(VectorMask mask) { Objects.requireNonNull(mask); Short128Mask m = (Short128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Short128Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -641,9 +672,9 @@ final class Short128Vector extends ShortVector { public Short128Mask or(VectorMask mask) { Objects.requireNonNull(mask); Short128Mask m = (Short128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Short128Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -651,9 +682,9 @@ final class Short128Vector extends ShortVector { Short128Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Short128Mask m = (Short128Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short128Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Short128Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -661,22 +692,32 @@ final class Short128Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short128Mask.class, short.class, VLENGTH, this, - (m) -> trueCountHelper(((Short128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short128Mask.class, short.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short128Mask.class, short.class, VLENGTH, this, - (m) -> firstTrueHelper(((Short128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short128Mask.class, short.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short128Mask.class, short.class, VLENGTH, this, - (m) -> lastTrueHelper(((Short128Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short128Mask.class, short.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short128Mask.class, short.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -787,6 +828,14 @@ final class Short128Vector extends ShortVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromArray0(short[] a, int offset, VectorMask m) { + return super.fromArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize + } + + @ForceInline @Override final @@ -794,6 +843,13 @@ final class Short128Vector extends ShortVector { return super.fromCharArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromCharArray0(char[] a, int offset, VectorMask m) { + return super.fromCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize + } + @ForceInline @Override @@ -802,6 +858,13 @@ final class Short128Vector extends ShortVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize + } + @ForceInline @Override final @@ -809,6 +872,13 @@ final class Short128Vector extends ShortVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m); // specialize + } + @ForceInline @Override final @@ -816,6 +886,15 @@ final class Short128Vector extends ShortVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(short[] a, int offset, VectorMask m) { + super.intoArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); + } + + + @ForceInline @Override final @@ -823,6 +902,27 @@ final class Short128Vector extends ShortVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Short128Mask.class, bb, offset, (Short128Mask) m); + } + + @ForceInline + @Override + final + void intoCharArray0(char[] a, int offset, VectorMask m) { + super.intoCharArray0Template(Short128Mask.class, a, offset, (Short128Mask) m); + } + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java index 8cc621259a5..66f6d409e6a 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java @@ -236,8 +236,8 @@ final class Short256Vector extends ShortVector { @ForceInline final @Override - short rOp(short v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + short rOp(short v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Short256Vector extends ShortVector { return (Short256Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Short256Vector lanewise(Unary op, VectorMask m) { + return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, (Short256Mask) m); // specialize + } + @Override @ForceInline public Short256Vector lanewise(Binary op, Vector v) { return (Short256Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Short256Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, v, (Short256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Short256Vector @@ -286,15 +298,30 @@ final class Short256Vector extends ShortVector { return (Short256Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Short256Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Short256Vector) super.lanewiseShiftTemplate(op, Short256Mask.class, e, (Short256Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Short256Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Short256Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Short256Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Short256Vector) super.lanewiseTemplate(op, Short256Mask.class, v1, v2, (Short256Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Short256Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Short256Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Short256Mask.class, (Short256Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Short256Vector extends ShortVector { return super.compareTemplate(Short256Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Short256Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Short256Mask.class, op, v, (Short256Mask) m); + } + + @Override @ForceInline public Short256Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Short256Vector extends ShortVector { VectorMask m) { return (Short256Vector) super.rearrangeTemplate(Short256Shuffle.class, + Short256Mask.class, (Short256Shuffle) shuffle, (Short256Mask) m); // specialize } @@ -612,16 +647,12 @@ final class Short256Vector extends ShortVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Short256Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -647,9 +678,9 @@ final class Short256Vector extends ShortVector { public Short256Mask and(VectorMask mask) { Objects.requireNonNull(mask); Short256Mask m = (Short256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short256Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Short256Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -657,9 +688,9 @@ final class Short256Vector extends ShortVector { public Short256Mask or(VectorMask mask) { Objects.requireNonNull(mask); Short256Mask m = (Short256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short256Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Short256Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -667,9 +698,9 @@ final class Short256Vector extends ShortVector { Short256Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Short256Mask m = (Short256Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short256Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Short256Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -677,22 +708,32 @@ final class Short256Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short256Mask.class, short.class, VLENGTH, this, - (m) -> trueCountHelper(((Short256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short256Mask.class, short.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short256Mask.class, short.class, VLENGTH, this, - (m) -> firstTrueHelper(((Short256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short256Mask.class, short.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short256Mask.class, short.class, VLENGTH, this, - (m) -> lastTrueHelper(((Short256Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short256Mask.class, short.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short256Mask.class, short.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -803,6 +844,14 @@ final class Short256Vector extends ShortVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromArray0(short[] a, int offset, VectorMask m) { + return super.fromArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize + } + + @ForceInline @Override final @@ -810,6 +859,13 @@ final class Short256Vector extends ShortVector { return super.fromCharArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromCharArray0(char[] a, int offset, VectorMask m) { + return super.fromCharArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize + } + @ForceInline @Override @@ -818,6 +874,13 @@ final class Short256Vector extends ShortVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize + } + @ForceInline @Override final @@ -825,6 +888,13 @@ final class Short256Vector extends ShortVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Short256Mask.class, bb, offset, (Short256Mask) m); // specialize + } + @ForceInline @Override final @@ -832,6 +902,15 @@ final class Short256Vector extends ShortVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(short[] a, int offset, VectorMask m) { + super.intoArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); + } + + + @ForceInline @Override final @@ -839,6 +918,27 @@ final class Short256Vector extends ShortVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Short256Mask.class, bb, offset, (Short256Mask) m); + } + + @ForceInline + @Override + final + void intoCharArray0(char[] a, int offset, VectorMask m) { + super.intoCharArray0Template(Short256Mask.class, a, offset, (Short256Mask) m); + } + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java index b19019084b4..a2a8a07ddd3 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java @@ -236,8 +236,8 @@ final class Short512Vector extends ShortVector { @ForceInline final @Override - short rOp(short v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + short rOp(short v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Short512Vector extends ShortVector { return (Short512Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Short512Vector lanewise(Unary op, VectorMask m) { + return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, (Short512Mask) m); // specialize + } + @Override @ForceInline public Short512Vector lanewise(Binary op, Vector v) { return (Short512Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Short512Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, v, (Short512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Short512Vector @@ -286,15 +298,30 @@ final class Short512Vector extends ShortVector { return (Short512Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Short512Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Short512Vector) super.lanewiseShiftTemplate(op, Short512Mask.class, e, (Short512Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Short512Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Short512Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Short512Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Short512Vector) super.lanewiseTemplate(op, Short512Mask.class, v1, v2, (Short512Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Short512Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Short512Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Short512Mask.class, (Short512Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Short512Vector extends ShortVector { return super.compareTemplate(Short512Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Short512Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Short512Mask.class, op, v, (Short512Mask) m); + } + + @Override @ForceInline public Short512Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Short512Vector extends ShortVector { VectorMask m) { return (Short512Vector) super.rearrangeTemplate(Short512Shuffle.class, + Short512Mask.class, (Short512Shuffle) shuffle, (Short512Mask) m); // specialize } @@ -644,16 +679,12 @@ final class Short512Vector extends ShortVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Short512Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -679,9 +710,9 @@ final class Short512Vector extends ShortVector { public Short512Mask and(VectorMask mask) { Objects.requireNonNull(mask); Short512Mask m = (Short512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Short512Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -689,9 +720,9 @@ final class Short512Vector extends ShortVector { public Short512Mask or(VectorMask mask) { Objects.requireNonNull(mask); Short512Mask m = (Short512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Short512Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -699,9 +730,9 @@ final class Short512Vector extends ShortVector { Short512Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Short512Mask m = (Short512Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Short512Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -709,22 +740,32 @@ final class Short512Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, short.class, VLENGTH, this, - (m) -> trueCountHelper(((Short512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short512Mask.class, short.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, short.class, VLENGTH, this, - (m) -> firstTrueHelper(((Short512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short512Mask.class, short.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, short.class, VLENGTH, this, - (m) -> lastTrueHelper(((Short512Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short512Mask.class, short.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short512Mask.class, short.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -835,6 +876,14 @@ final class Short512Vector extends ShortVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromArray0(short[] a, int offset, VectorMask m) { + return super.fromArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize + } + + @ForceInline @Override final @@ -842,6 +891,13 @@ final class Short512Vector extends ShortVector { return super.fromCharArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromCharArray0(char[] a, int offset, VectorMask m) { + return super.fromCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize + } + @ForceInline @Override @@ -850,6 +906,13 @@ final class Short512Vector extends ShortVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize + } + @ForceInline @Override final @@ -857,6 +920,13 @@ final class Short512Vector extends ShortVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Short512Mask.class, bb, offset, (Short512Mask) m); // specialize + } + @ForceInline @Override final @@ -864,6 +934,15 @@ final class Short512Vector extends ShortVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(short[] a, int offset, VectorMask m) { + super.intoArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); + } + + + @ForceInline @Override final @@ -871,6 +950,27 @@ final class Short512Vector extends ShortVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Short512Mask.class, bb, offset, (Short512Mask) m); + } + + @ForceInline + @Override + final + void intoCharArray0(char[] a, int offset, VectorMask m) { + super.intoCharArray0Template(Short512Mask.class, a, offset, (Short512Mask) m); + } + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java index 17230435481..ff2b2d7e063 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java @@ -236,8 +236,8 @@ final class Short64Vector extends ShortVector { @ForceInline final @Override - short rOp(short v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + short rOp(short v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class Short64Vector extends ShortVector { return (Short64Vector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public Short64Vector lanewise(Unary op, VectorMask m) { + return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, (Short64Mask) m); // specialize + } + @Override @ForceInline public Short64Vector lanewise(Binary op, Vector v) { return (Short64Vector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public Short64Vector lanewise(Binary op, Vector v, VectorMask m) { + return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, v, (Short64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline Short64Vector @@ -286,15 +298,30 @@ final class Short64Vector extends ShortVector { return (Short64Vector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline Short64Vector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (Short64Vector) super.lanewiseShiftTemplate(op, Short64Mask.class, e, (Short64Mask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final Short64Vector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (Short64Vector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + Short64Vector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (Short64Vector) super.lanewiseTemplate(op, Short64Mask.class, v1, v2, (Short64Mask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class Short64Vector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class Short64Vector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, Short64Mask.class, (Short64Mask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class Short64Vector extends ShortVector { return super.compareTemplate(Short64Mask.class, op, s); // specialize } + @Override + @ForceInline + public final Short64Mask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(Short64Mask.class, op, v, (Short64Mask) m); + } + + @Override @ForceInline public Short64Vector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class Short64Vector extends ShortVector { VectorMask m) { return (Short64Vector) super.rearrangeTemplate(Short64Shuffle.class, + Short64Mask.class, (Short64Shuffle) shuffle, (Short64Mask) m); // specialize } @@ -588,16 +623,12 @@ final class Short64Vector extends ShortVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - Short64Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -623,9 +654,9 @@ final class Short64Vector extends ShortVector { public Short64Mask and(VectorMask mask) { Objects.requireNonNull(mask); Short64Mask m = (Short64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, Short64Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -633,9 +664,9 @@ final class Short64Vector extends ShortVector { public Short64Mask or(VectorMask mask) { Objects.requireNonNull(mask); Short64Mask m = (Short64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, Short64Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -643,9 +674,9 @@ final class Short64Vector extends ShortVector { Short64Mask xor(VectorMask mask) { Objects.requireNonNull(mask); Short64Mask m = (Short64Mask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, Short64Mask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -653,22 +684,32 @@ final class Short64Vector extends ShortVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short64Mask.class, short.class, VLENGTH, this, - (m) -> trueCountHelper(((Short64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, Short64Mask.class, short.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short64Mask.class, short.class, VLENGTH, this, - (m) -> firstTrueHelper(((Short64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, Short64Mask.class, short.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short64Mask.class, short.class, VLENGTH, this, - (m) -> lastTrueHelper(((Short64Mask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, Short64Mask.class, short.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, Short64Mask.class, short.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -779,6 +820,14 @@ final class Short64Vector extends ShortVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromArray0(short[] a, int offset, VectorMask m) { + return super.fromArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize + } + + @ForceInline @Override final @@ -786,6 +835,13 @@ final class Short64Vector extends ShortVector { return super.fromCharArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromCharArray0(char[] a, int offset, VectorMask m) { + return super.fromCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize + } + @ForceInline @Override @@ -794,6 +850,13 @@ final class Short64Vector extends ShortVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize + } + @ForceInline @Override final @@ -801,6 +864,13 @@ final class Short64Vector extends ShortVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(Short64Mask.class, bb, offset, (Short64Mask) m); // specialize + } + @ForceInline @Override final @@ -808,6 +878,15 @@ final class Short64Vector extends ShortVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(short[] a, int offset, VectorMask m) { + super.intoArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); + } + + + @ForceInline @Override final @@ -815,6 +894,27 @@ final class Short64Vector extends ShortVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(Short64Mask.class, bb, offset, (Short64Mask) m); + } + + @ForceInline + @Override + final + void intoCharArray0(char[] a, int offset, VectorMask m) { + super.intoCharArray0Template(Short64Mask.class, a, offset, (Short64Mask) m); + } + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java index 7e5d1e5570f..7aa01264a73 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortMaxVector.java @@ -236,8 +236,8 @@ final class ShortMaxVector extends ShortVector { @ForceInline final @Override - short rOp(short v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + short rOp(short v, VectorMask m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -273,12 +273,24 @@ final class ShortMaxVector extends ShortVector { return (ShortMaxVector) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public ShortMaxVector lanewise(Unary op, VectorMask m) { + return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialize + } + @Override @ForceInline public ShortMaxVector lanewise(Binary op, Vector v) { return (ShortMaxVector) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public ShortMaxVector lanewise(Binary op, Vector v, VectorMask m) { + return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, v, (ShortMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline ShortMaxVector @@ -286,15 +298,30 @@ final class ShortMaxVector extends ShortVector { return (ShortMaxVector) super.lanewiseShiftTemplate(op, e); // specialize } + /*package-private*/ + @Override + @ForceInline ShortMaxVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m) { + return (ShortMaxVector) super.lanewiseShiftTemplate(op, ShortMaxMask.class, e, (ShortMaxMask) m); // specialize + } + /*package-private*/ @Override @ForceInline public final ShortMaxVector - lanewise(VectorOperators.Ternary op, Vector v1, Vector v2) { + lanewise(Ternary op, Vector v1, Vector v2) { return (ShortMaxVector) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + ShortMaxVector + lanewise(Ternary op, Vector v1, Vector v2, VectorMask m) { + return (ShortMaxVector) super.lanewiseTemplate(op, ShortMaxMask.class, v1, v2, (ShortMaxMask) m); // specialize + } + @Override @ForceInline public final @@ -314,7 +341,7 @@ final class ShortMaxVector extends ShortVector { @ForceInline public final short reduceLanes(VectorOperators.Associative op, VectorMask m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized } @Override @@ -327,7 +354,7 @@ final class ShortMaxVector extends ShortVector { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, ShortMaxMask.class, (ShortMaxMask) m); // specialized } @ForceInline @@ -363,6 +390,13 @@ final class ShortMaxVector extends ShortVector { return super.compareTemplate(ShortMaxMask.class, op, s); // specialize } + @Override + @ForceInline + public final ShortMaxMask compare(Comparison op, Vector v, VectorMask m) { + return super.compareTemplate(ShortMaxMask.class, op, v, (ShortMaxMask) m); + } + + @Override @ForceInline public ShortMaxVector blend(Vector v, VectorMask m) { @@ -419,6 +453,7 @@ final class ShortMaxVector extends ShortVector { VectorMask m) { return (ShortMaxVector) super.rearrangeTemplate(ShortMaxShuffle.class, + ShortMaxMask.class, (ShortMaxShuffle) shuffle, (ShortMaxMask) m); // specialize } @@ -582,16 +617,12 @@ final class ShortMaxVector extends ShortVector { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - ShortMaxMask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -617,9 +648,9 @@ final class ShortMaxVector extends ShortVector { public ShortMaxMask and(VectorMask mask) { Objects.requireNonNull(mask); ShortMaxMask m = (ShortMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMaxMask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, ShortMaxMask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -627,9 +658,9 @@ final class ShortMaxVector extends ShortVector { public ShortMaxMask or(VectorMask mask) { Objects.requireNonNull(mask); ShortMaxMask m = (ShortMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMaxMask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, ShortMaxMask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -637,9 +668,9 @@ final class ShortMaxVector extends ShortVector { ShortMaxMask xor(VectorMask mask) { Objects.requireNonNull(mask); ShortMaxMask m = (ShortMaxMask)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMaxMask.class, short.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, ShortMaxMask.class, null, short.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -647,22 +678,32 @@ final class ShortMaxVector extends ShortVector { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMaxMask.class, short.class, VLENGTH, this, - (m) -> trueCountHelper(((ShortMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, ShortMaxMask.class, short.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMaxMask.class, short.class, VLENGTH, this, - (m) -> firstTrueHelper(((ShortMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, ShortMaxMask.class, short.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMaxMask.class, short.class, VLENGTH, this, - (m) -> lastTrueHelper(((ShortMaxMask)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, ShortMaxMask.class, short.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, ShortMaxMask.class, short.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -773,6 +814,14 @@ final class ShortMaxVector extends ShortVector { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromArray0(short[] a, int offset, VectorMask m) { + return super.fromArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize + } + + @ForceInline @Override final @@ -780,6 +829,13 @@ final class ShortMaxVector extends ShortVector { return super.fromCharArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromCharArray0(char[] a, int offset, VectorMask m) { + return super.fromCharArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize + } + @ForceInline @Override @@ -788,6 +844,13 @@ final class ShortMaxVector extends ShortVector { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteArray0(byte[] a, int offset, VectorMask m) { + return super.fromByteArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize + } + @ForceInline @Override final @@ -795,6 +858,13 @@ final class ShortMaxVector extends ShortVector { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + return super.fromByteBuffer0Template(ShortMaxMask.class, bb, offset, (ShortMaxMask) m); // specialize + } + @ForceInline @Override final @@ -802,6 +872,15 @@ final class ShortMaxVector extends ShortVector { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0(short[] a, int offset, VectorMask m) { + super.intoArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); + } + + + @ForceInline @Override final @@ -809,6 +888,27 @@ final class ShortMaxVector extends ShortVector { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask m) { + super.intoByteArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m) { + super.intoByteBuffer0Template(ShortMaxMask.class, bb, offset, (ShortMaxMask) m); + } + + @ForceInline + @Override + final + void intoCharArray0(char[] a, int offset, VectorMask m) { + super.intoCharArray0Template(ShortMaxMask.class, a, offset, (ShortMaxMask) m); + } + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java index a02e981e809..e1cada48f17 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -173,6 +172,9 @@ public abstract class ShortVector extends AbstractVector { final ShortVector uOpTemplate(VectorMask m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } short[] vec = vec(); short[] res = new short[length()]; boolean[] mbits = ((AbstractMask)m).getBits(); @@ -216,6 +218,9 @@ public abstract class ShortVector extends AbstractVector { ShortVector bOpTemplate(Vector o, VectorMask m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } short[] res = new short[length()]; short[] vec1 = this.vec(); short[] vec2 = ((ShortVector)o).vec(); @@ -265,6 +270,9 @@ public abstract class ShortVector extends AbstractVector { Vector o2, VectorMask m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } short[] res = new short[length()]; short[] vec1 = this.vec(); short[] vec2 = ((ShortVector)o1).vec(); @@ -280,7 +288,22 @@ public abstract class ShortVector extends AbstractVector { /*package-private*/ abstract - short rOp(short v, FBinOp f); + short rOp(short v, VectorMask m, FBinOp f); + + @ForceInline + final + short rOpTemplate(short v, VectorMask m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + short[] vec = vec(); + boolean[] mbits = ((AbstractMask)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final short rOpTemplate(short v, FBinOp f) { @@ -549,37 +572,61 @@ public abstract class ShortVector extends AbstractVector { return blend(broadcast(-1), compare(NE, 0)); } if (op == NOT) { - return broadcast(-1).lanewiseTemplate(XOR, this); + return broadcast(-1).lanewise(XOR, this); } else if (op == NEG) { // FIXME: Support this in the JIT. - return broadcast(0).lanewiseTemplate(SUB, this); + return broadcast(0).lanewise(SUB, this); } } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), short.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> (short) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> (short) Math.abs(a)); - default: return null; - }})); + opc, getClass(), null, short.class, length(), + this, null, + UN_IMPL.find(op, opc, ShortVector::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, ShortVector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract ShortVector lanewise(VectorOperators.Unary op, - VectorMask m) { - return blend(lanewise(op), m); + VectorMask m); + @ForceInline + final + ShortVector lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } + if (op == NOT) { + return lanewise(XOR, broadcast(-1), m); + } else if (op == NEG) { + return lanewise(NOT, m).lanewise(ADD, broadcast(1), m); + } + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, short.class, length(), + this, m, + UN_IMPL.find(op, opc, ShortVector::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, ShortVector.class); + + private static UnaryOperation> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> (short) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> (short) Math.abs(a)); + default: return null; + } } // Binary lanewise support @@ -599,6 +646,7 @@ public abstract class ShortVector extends AbstractVector { Vector v) { ShortVector that = (ShortVector) v; that.check(this); + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -617,74 +665,110 @@ public abstract class ShortVector extends AbstractVector { that = that.lanewise(NOT); op = AND; } else if (op == DIV) { - VectorMask eqz = that.eq((short)0); + VectorMask eqz = that.eq((short) 0); if (eqz.anyTrue()) { throw that.divZeroException(); } } } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), short.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)Math.min(a, b)); - case VECTOR_OP_AND: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a & b)); - case VECTOR_OP_OR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a | b)); - case VECTOR_OP_XOR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> (short)(a ^ b)); - case VECTOR_OP_LSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (short)(a << n)); - case VECTOR_OP_RSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (short)(a >> n)); - case VECTOR_OP_URSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> (short)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, short.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, ShortVector::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, ShortVector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,short,VectorMask) */ - @ForceInline - public final + @Override + public abstract ShortVector lanewise(VectorOperators.Binary op, Vector v, - VectorMask m) { + VectorMask m); + @ForceInline + final + ShortVector lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector v, VectorMask m) { ShortVector that = (ShortVector) v; - if (op == DIV) { - VectorMask eqz = that.eq((short)0); - if (eqz.and(m).anyTrue()) { - throw that.divZeroException(); + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL | VO_SHIFT)) { + if (op == FIRST_NONZERO) { + // FIXME: Support this in the JIT. + VectorMask thisNZ + = this.viewAsIntegralLanes().compare(NE, (short) 0); + that = that.blend((short) 0, thisNZ.cast(vspecies())); + op = OR_UNCHECKED; + } + if (opKind(op, VO_SHIFT)) { + // As per shift specification for Java, mask the shift count. + // This allows the JIT to ignore some ISA details. + that = that.lanewise(AND, SHIFT_MASK); + } + if (op == AND_NOT) { + // FIXME: Support this in the JIT. + that = that.lanewise(NOT); + op = AND; + } else if (op == DIV) { + VectorMask eqz = that.eq((short)0); + if (eqz.and(m).anyTrue()) { + throw that.divZeroException(); + } + // suppress div/0 exceptions in unset lanes + that = that.lanewise(NOT, eqz); } - // suppress div/0 exceptions in unset lanes - that = that.lanewise(NOT, eqz); - return blend(lanewise(DIV, that), m); } - return blend(lanewise(op, v), m); + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, short.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, ShortVector::binaryOperations)); + } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, ShortVector.class); + + private static BinaryOperation> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)Math.min(a, b)); + case VECTOR_OP_AND: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a & b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a | b)); + case VECTOR_OP_XOR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> (short)(a ^ b)); + case VECTOR_OP_LSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (short)(a << n)); + case VECTOR_OP_RSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (short)(a >> n)); + case VECTOR_OP_URSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> (short)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateRight(a, (int)n)); + default: return null; + } } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -747,7 +831,13 @@ public abstract class ShortVector extends AbstractVector { ShortVector lanewise(VectorOperators.Binary op, short e, VectorMask m) { - return blend(lanewise(op, e), m); + if (opKind(op, VO_SHIFT) && (short)(int)e == e) { + return lanewiseShift(op, (int) e, m); + } + if (op == AND_NOT) { + op = AND; e = (short) ~e; + } + return lanewise(op, broadcast(e), m); } /** @@ -767,8 +857,7 @@ public abstract class ShortVector extends AbstractVector { short e1 = (short) e; if ((long)e1 != e // allow shift ops to clip down their int parameters - && !(opKind(op, VO_SHIFT) && (int)e1 == e) - ) { + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { vspecies().checkValue(e); // for exception } return lanewise(op, e1); @@ -788,7 +877,13 @@ public abstract class ShortVector extends AbstractVector { public final ShortVector lanewise(VectorOperators.Binary op, long e, VectorMask m) { - return blend(lanewise(op, e), m); + short e1 = (short) e; + if ((long)e1 != e + // allow shift ops to clip down their int parameters + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { + vspecies().checkValue(e); // for exception + } + return lanewise(op, e1, m); } /*package-private*/ @@ -805,27 +900,52 @@ public abstract class ShortVector extends AbstractVector { e &= SHIFT_MASK; int opc = opCode(op); return VectorSupport.broadcastInt( - opc, getClass(), short.class, length(), - this, e, - BIN_INT_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_LSHIFT: return (v, n) -> - v.uOp((i, a) -> (short)(a << n)); - case VECTOR_OP_RSHIFT: return (v, n) -> - v.uOp((i, a) -> (short)(a >> n)); - case VECTOR_OP_URSHIFT: return (v, n) -> - v.uOp((i, a) -> (short)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v, n) -> - v.uOp((i, a) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v, n) -> - v.uOp((i, a) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, short.class, length(), + this, e, null, + BIN_INT_IMPL.find(op, opc, ShortVector::broadcastIntOperations)); + } + + /*package-private*/ + abstract ShortVector + lanewiseShift(VectorOperators.Binary op, int e, VectorMask m); + + /*package-private*/ + @ForceInline + final ShortVector + lanewiseShiftTemplate(VectorOperators.Binary op, + Class> maskClass, + int e, VectorMask m) { + m.check(maskClass, this); + assert(opKind(op, VO_SHIFT)); + // As per shift specification for Java, mask the shift count. + e &= SHIFT_MASK; + int opc = opCode(op); + return VectorSupport.broadcastInt( + opc, getClass(), maskClass, short.class, length(), + this, e, m, + BIN_INT_IMPL.find(op, opc, ShortVector::broadcastIntOperations)); } + private static final - ImplCache> BIN_INT_IMPL + ImplCache>> BIN_INT_IMPL = new ImplCache<>(Binary.class, ShortVector.class); + private static VectorBroadcastIntOp> broadcastIntOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_LSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (short)(a << n)); + case VECTOR_OP_RSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (short)(a >> n)); + case VECTOR_OP_URSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> (short)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateRight(a, (int)n)); + default: return null; + } + } + // As per shift specification for Java, mask the shift count. // We mask 0X3F (long), 0X1F (int), 0x0F (short), 0x7 (byte). // The latter two maskings go beyond the JLS, but seem reasonable @@ -878,16 +998,10 @@ public abstract class ShortVector extends AbstractVector { } int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), short.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - default: return null; - }})); + opc, getClass(), null, short.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, ShortVector::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, ShortVector.class); /** * {@inheritDoc} @@ -895,13 +1009,48 @@ public abstract class ShortVector extends AbstractVector { * @see #lanewise(VectorOperators.Ternary,Vector,short,VectorMask) * @see #lanewise(VectorOperators.Ternary,short,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract ShortVector lanewise(VectorOperators.Ternary op, Vector v1, Vector v2, - VectorMask m) { - return blend(lanewise(op, v1, v2), m); + VectorMask m); + @ForceInline + final + ShortVector lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector v1, + Vector v2, + VectorMask m) { + ShortVector that = (ShortVector) v1; + ShortVector tother = (ShortVector) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + + if (op == BITWISE_BLEND) { + // FIXME: Support this in the JIT. + that = this.lanewise(XOR, that).lanewise(AND, tother); + return this.lanewise(XOR, that, m); + } + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, short.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, ShortVector::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, ShortVector.class); + + private static TernaryOperation> ternaryOperations(int opc_) { + switch (opc_) { + default: return null; + } } /** @@ -958,7 +1107,7 @@ public abstract class ShortVector extends AbstractVector { short e1, short e2, VectorMask m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -1016,7 +1165,7 @@ public abstract class ShortVector extends AbstractVector { Vector v1, short e2, VectorMask m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -1073,7 +1222,7 @@ public abstract class ShortVector extends AbstractVector { short e1, Vector v2, VectorMask m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -1745,15 +1894,13 @@ public abstract class ShortVector extends AbstractVector { final > M compareTemplate(Class maskType, Comparison op, Vector v) { - Objects.requireNonNull(v); - ShortSpecies vsp = vspecies(); ShortVector that = (ShortVector) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, short.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -1763,6 +1910,28 @@ public abstract class ShortVector extends AbstractVector { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector v, M m) { + ShortVector that = (ShortVector) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, short.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, short a, short b) { return switch (cond) { @@ -1780,18 +1949,6 @@ public abstract class ShortVector extends AbstractVector { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask compare(VectorOperators.Comparison op, - Vector v, - VectorMask m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -1850,7 +2007,7 @@ public abstract class ShortVector extends AbstractVector { public final VectorMask compare(VectorOperators.Comparison op, short e, VectorMask m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } /** @@ -2101,9 +2258,9 @@ public abstract class ShortVector extends AbstractVector { ShortVector rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, short.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, short.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2120,24 +2277,25 @@ public abstract class ShortVector extends AbstractVector { /*package-private*/ @ForceInline final - > + , M extends VectorMask> ShortVector rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask m) { - ShortVector unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, short.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast((short)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, short.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2160,17 +2318,17 @@ public abstract class ShortVector extends AbstractVector { S ws = (S) shuffle.wrapIndexes(); ShortVector r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, short.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, short.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); ShortVector r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, short.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, short.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2433,9 +2591,18 @@ public abstract class ShortVector extends AbstractVector { @ForceInline final short reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask m) { - ShortVector v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + ShortVector v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, short.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, ShortVector::reductionOperations))); } /*package-private*/ @@ -2450,30 +2617,34 @@ public abstract class ShortVector extends AbstractVector { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), short.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp((short)0, (i, a, b) -> (short)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp((short)1, (i, a, b) -> (short)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> (short) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> (short) Math.max(a, b))); - case VECTOR_OP_AND: return v -> - toBits(v.rOp((short)-1, (i, a, b) -> (short)(a & b))); - case VECTOR_OP_OR: return v -> - toBits(v.rOp((short)0, (i, a, b) -> (short)(a | b))); - case VECTOR_OP_XOR: return v -> - toBits(v.rOp((short)0, (i, a, b) -> (short)(a ^ b))); - default: return null; - }}))); + opc, getClass(), null, short.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, ShortVector::reductionOperations))); } + private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, ShortVector.class); + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, ShortVector.class); + + private static ReductionOperation> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp((short)0, m, (i, a, b) -> (short)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp((short)1, m, (i, a, b) -> (short)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (short) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (short) Math.max(a, b))); + case VECTOR_OP_AND: return (v, m) -> + toBits(v.rOp((short)-1, m, (i, a, b) -> (short)(a & b))); + case VECTOR_OP_OR: return (v, m) -> + toBits(v.rOp((short)0, m, (i, a, b) -> (short)(a | b))); + case VECTOR_OP_XOR: return (v, m) -> + toBits(v.rOp((short)0, m, (i, a, b) -> (short)(a ^ b))); + default: return null; + } + } private @ForceInline @@ -2699,9 +2870,7 @@ public abstract class ShortVector extends AbstractVector { VectorMask m) { ShortSpecies vsp = (ShortSpecies) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - ShortVector zero = vsp.zero(); - ShortVector v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -2763,8 +2932,7 @@ public abstract class ShortVector extends AbstractVector { VectorMask m) { ShortSpecies vsp = (ShortSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - ShortVector zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -2913,8 +3081,7 @@ public abstract class ShortVector extends AbstractVector { VectorMask m) { ShortSpecies vsp = (ShortSpecies) species; if (offset >= 0 && offset <= (a.length - species.length())) { - ShortVector zero = vsp.zero(); - return zero.blend(zero.fromCharArray0(a, offset), m); + return vsp.dummyVector().fromCharArray0(a, offset, m); } // FIXME: optimize @@ -3099,9 +3266,7 @@ public abstract class ShortVector extends AbstractVector { VectorMask m) { ShortSpecies vsp = (ShortSpecies) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - ShortVector zero = vsp.zero(); - ShortVector v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -3173,10 +3338,9 @@ public abstract class ShortVector extends AbstractVector { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize ShortSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -3321,10 +3485,9 @@ public abstract class ShortVector extends AbstractVector { if (m.allTrue()) { intoCharArray(a, offset); } else { - // FIXME: optimize ShortSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = (char) v); + intoCharArray0(a, offset, m); } } @@ -3438,12 +3601,9 @@ public abstract class ShortVector extends AbstractVector { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize ShortSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 2, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putShort(o + i * 2, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -3455,7 +3615,7 @@ public abstract class ShortVector extends AbstractVector { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -3474,15 +3634,12 @@ public abstract class ShortVector extends AbstractVector { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } ShortSpecies vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 2, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.putShort(o + i * 2, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -3520,6 +3677,24 @@ public abstract class ShortVector extends AbstractVector { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + ShortVector fromArray0(short[] a, int offset, VectorMask m); + @ForceInline + final + > + ShortVector fromArray0Template(Class maskClass, short[] a, int offset, M m) { + m.check(species()); + ShortSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + + /*package-private*/ abstract ShortVector fromCharArray0(char[] a, int offset); @@ -3535,6 +3710,23 @@ public abstract class ShortVector extends AbstractVector { (arr_, off_, i) -> (short) arr_[off_ + i])); } + /*package-private*/ + abstract + ShortVector fromCharArray0(char[] a, int offset, VectorMask m); + @ForceInline + final + > + ShortVector fromCharArray0Template(Class maskClass, char[] a, int offset, M m) { + m.check(species()); + ShortSpecies vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, charArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> (short) arr_[off_ + i])); + } + @Override abstract @@ -3554,6 +3746,25 @@ public abstract class ShortVector extends AbstractVector { }); } + abstract + ShortVector fromByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + ShortVector fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + ShortSpecies vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getShort(o + i * 2)); + }); + } + abstract ShortVector fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -3570,6 +3781,24 @@ public abstract class ShortVector extends AbstractVector { }); } + abstract + ShortVector fromByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + ShortVector fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + ShortSpecies vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.getShort(o + i * 2)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -3589,6 +3818,25 @@ public abstract class ShortVector extends AbstractVector { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0(short[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, short[] a, int offset, M m) { + m.check(species()); + ShortSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + + + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -3606,6 +3854,25 @@ public abstract class ShortVector extends AbstractVector { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + ShortSpecies vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.putShort(o + i * 2, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -3620,6 +3887,42 @@ public abstract class ShortVector extends AbstractVector { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + ShortSpecies vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.putShort(o + i * 2, e)); + }); + } + + /*package-private*/ + abstract + void intoCharArray0(char[] a, int offset, VectorMask m); + @ForceInline + final + > + void intoCharArray0Template(Class maskClass, char[] a, int offset, M m) { + m.check(species()); + ShortSpecies vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, charArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = (char) e)); + } + // End of low-level memory operations. private static @@ -3954,7 +4257,7 @@ public abstract class ShortVector extends AbstractVector { /*package-private*/ @ForceInline ShortVector ldOp(M memory, int offset, - AbstractMask m, + VectorMask m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java index 127ec94ad82..b57a2abbb1f 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -516,6 +516,8 @@ public abstract class VectorMask extends jdk.internal.vm.vector.VectorSupport * @param i the lane index * * @return true if the lane at index {@code i} is set, otherwise false + * @throws IndexOutOfBoundsException if the index is out of range + * ({@code < 0 || >= length()}) */ public abstract boolean laneIsSet(int i); @@ -553,6 +555,24 @@ public abstract class VectorMask extends jdk.internal.vm.vector.VectorSupport */ public abstract VectorMask check(VectorSpecies species); + /** + * Checks that this mask has the same class with the given mask class, + * and it has the same species with given vector's species, + * and returns this mask unchanged. + * The effect is similar to this pseudocode: + * {@code getClass() == maskClass && + * vectorSpecies() == vector.species() + * ? this + * : throw new ClassCastException()}. + * + * @param maskClass the class required for this mask + * @param vector its species required for this mask + * @param the boxed element type of the required species + * @return the same mask + * @throws ClassCastException if the species is wrong + */ + abstract VectorMask check(Class> maskClass, Vector vector); + /** * Returns a string representation of this mask, of the form * {@code "Mask[T.TT...]"}, reporting the mask bit diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template index 860ef572d67..45c2cf9267c 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template @@ -29,7 +29,6 @@ import java.nio.ByteOrder; import java.nio.ReadOnlyBufferException; import java.util.Arrays; import java.util.Objects; -import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.UnaryOperator; @@ -177,6 +176,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { final $abstractvectortype$ uOpTemplate(VectorMask<$Boxtype$> m, FUnOp f) { + if (m == null) { + return uOpTemplate(f); + } $type$[] vec = vec(); $type$[] res = new $type$[length()]; boolean[] mbits = ((AbstractMask<$Boxtype$>)m).getBits(); @@ -220,6 +222,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ bOpTemplate(Vector<$Boxtype$> o, VectorMask<$Boxtype$> m, FBinOp f) { + if (m == null) { + return bOpTemplate(o, f); + } $type$[] res = new $type$[length()]; $type$[] vec1 = this.vec(); $type$[] vec2 = (($abstractvectortype$)o).vec(); @@ -269,6 +274,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { Vector<$Boxtype$> o2, VectorMask<$Boxtype$> m, FTriOp f) { + if (m == null) { + return tOpTemplate(o1, o2, f); + } $type$[] res = new $type$[length()]; $type$[] vec1 = this.vec(); $type$[] vec2 = (($abstractvectortype$)o1).vec(); @@ -284,7 +292,22 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { /*package-private*/ abstract - $type$ rOp($type$ v, FBinOp f); + $type$ rOp($type$ v, VectorMask<$Boxtype$> m, FBinOp f); + + @ForceInline + final + $type$ rOpTemplate($type$ v, VectorMask<$Boxtype$> m, FBinOp f) { + if (m == null) { + return rOpTemplate(v, f); + } + $type$[] vec = vec(); + boolean[] mbits = ((AbstractMask<$Boxtype$>)m).getBits(); + for (int i = 0; i < vec.length; i++) { + v = mbits[i] ? f.apply(i, v, vec[i]) : v; + } + return v; + } + @ForceInline final $type$ rOpTemplate($type$ v, FBinOp f) { @@ -572,72 +595,98 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { } #if[BITWISE] if (op == NOT) { - return broadcast(-1).lanewiseTemplate(XOR, this); + return broadcast(-1).lanewise(XOR, this); } else if (op == NEG) { // FIXME: Support this in the JIT. - return broadcast(0).lanewiseTemplate(SUB, this); + return broadcast(0).lanewise(SUB, this); } #end[BITWISE] } int opc = opCode(op); return VectorSupport.unaryOp( - opc, getClass(), $type$.class, length(), - this, - UN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_NEG: return v0 -> - v0.uOp((i, a) -> ($type$) -a); - case VECTOR_OP_ABS: return v0 -> - v0.uOp((i, a) -> ($type$) Math.abs(a)); -#if[FP] - case VECTOR_OP_SIN: return v0 -> - v0.uOp((i, a) -> ($type$) Math.sin(a)); - case VECTOR_OP_COS: return v0 -> - v0.uOp((i, a) -> ($type$) Math.cos(a)); - case VECTOR_OP_TAN: return v0 -> - v0.uOp((i, a) -> ($type$) Math.tan(a)); - case VECTOR_OP_ASIN: return v0 -> - v0.uOp((i, a) -> ($type$) Math.asin(a)); - case VECTOR_OP_ACOS: return v0 -> - v0.uOp((i, a) -> ($type$) Math.acos(a)); - case VECTOR_OP_ATAN: return v0 -> - v0.uOp((i, a) -> ($type$) Math.atan(a)); - case VECTOR_OP_EXP: return v0 -> - v0.uOp((i, a) -> ($type$) Math.exp(a)); - case VECTOR_OP_LOG: return v0 -> - v0.uOp((i, a) -> ($type$) Math.log(a)); - case VECTOR_OP_LOG10: return v0 -> - v0.uOp((i, a) -> ($type$) Math.log10(a)); - case VECTOR_OP_SQRT: return v0 -> - v0.uOp((i, a) -> ($type$) Math.sqrt(a)); - case VECTOR_OP_CBRT: return v0 -> - v0.uOp((i, a) -> ($type$) Math.cbrt(a)); - case VECTOR_OP_SINH: return v0 -> - v0.uOp((i, a) -> ($type$) Math.sinh(a)); - case VECTOR_OP_COSH: return v0 -> - v0.uOp((i, a) -> ($type$) Math.cosh(a)); - case VECTOR_OP_TANH: return v0 -> - v0.uOp((i, a) -> ($type$) Math.tanh(a)); - case VECTOR_OP_EXPM1: return v0 -> - v0.uOp((i, a) -> ($type$) Math.expm1(a)); - case VECTOR_OP_LOG1P: return v0 -> - v0.uOp((i, a) -> ($type$) Math.log1p(a)); -#end[FP] - default: return null; - }})); + opc, getClass(), null, $type$.class, length(), + this, null, + UN_IMPL.find(op, opc, $abstractvectortype$::unaryOperations)); } - private static final - ImplCache> UN_IMPL - = new ImplCache<>(Unary.class, $Type$Vector.class); /** * {@inheritDoc} */ - @ForceInline - public final + @Override + public abstract $abstractvectortype$ lanewise(VectorOperators.Unary op, - VectorMask<$Boxtype$> m) { - return blend(lanewise(op), m); + VectorMask<$Boxtype$> m); + @ForceInline + final + $abstractvectortype$ lanewiseTemplate(VectorOperators.Unary op, + Class> maskClass, + VectorMask<$Boxtype$> m) { + m.check(maskClass, this); + if (opKind(op, VO_SPECIAL)) { + if (op == ZOMO) { + return blend(broadcast(-1), compare(NE, 0, m)); + } +#if[BITWISE] + if (op == NOT) { + return lanewise(XOR, broadcast(-1), m); + } else if (op == NEG) { + return lanewise(NOT, m).lanewise(ADD, broadcast(1), m); + } +#end[BITWISE] + } + int opc = opCode(op); + return VectorSupport.unaryOp( + opc, getClass(), maskClass, $type$.class, length(), + this, m, + UN_IMPL.find(op, opc, $abstractvectortype$::unaryOperations)); + } + + private static final + ImplCache>> + UN_IMPL = new ImplCache<>(Unary.class, $Type$Vector.class); + + private static UnaryOperation<$abstractvectortype$, VectorMask<$Boxtype$>> unaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_NEG: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) -a); + case VECTOR_OP_ABS: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.abs(a)); +#if[FP] + case VECTOR_OP_SIN: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.sin(a)); + case VECTOR_OP_COS: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.cos(a)); + case VECTOR_OP_TAN: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.tan(a)); + case VECTOR_OP_ASIN: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.asin(a)); + case VECTOR_OP_ACOS: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.acos(a)); + case VECTOR_OP_ATAN: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.atan(a)); + case VECTOR_OP_EXP: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.exp(a)); + case VECTOR_OP_LOG: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.log(a)); + case VECTOR_OP_LOG10: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.log10(a)); + case VECTOR_OP_SQRT: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.sqrt(a)); + case VECTOR_OP_CBRT: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.cbrt(a)); + case VECTOR_OP_SINH: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.sinh(a)); + case VECTOR_OP_COSH: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.cosh(a)); + case VECTOR_OP_TANH: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.tanh(a)); + case VECTOR_OP_EXPM1: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.expm1(a)); + case VECTOR_OP_LOG1P: return (v0, m) -> + v0.uOp(m, (i, a) -> ($type$) Math.log1p(a)); +#end[FP] + default: return null; + } } // Binary lanewise support @@ -657,6 +706,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { Vector<$Boxtype$> v) { $abstractvectortype$ that = ($abstractvectortype$) v; that.check(this); + if (opKind(op, VO_SPECIAL {#if[!FP]? | VO_SHIFT})) { if (op == FIRST_NONZERO) { // FIXME: Support this in the JIT. @@ -684,87 +734,131 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { that = that.lanewise(NOT); op = AND; } else if (op == DIV) { - VectorMask<$Boxtype$> eqz = that.eq(($type$)0); + VectorMask<$Boxtype$> eqz = that.eq(($type$) 0); if (eqz.anyTrue()) { throw that.divZeroException(); } } #end[BITWISE] } + int opc = opCode(op); return VectorSupport.binaryOp( - opc, getClass(), $type$.class, length(), - this, that, - BIN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a + b)); - case VECTOR_OP_SUB: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a - b)); - case VECTOR_OP_MUL: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a * b)); - case VECTOR_OP_DIV: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a / b)); - case VECTOR_OP_MAX: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)Math.max(a, b)); - case VECTOR_OP_MIN: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)Math.min(a, b)); -#if[BITWISE] - case VECTOR_OP_AND: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a & b)); - case VECTOR_OP_OR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a | b)); - case VECTOR_OP_XOR: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$)(a ^ b)); - case VECTOR_OP_LSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> ($type$)(a << n)); - case VECTOR_OP_RSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> ($type$)(a >> n)); - case VECTOR_OP_URSHIFT: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> ($type$)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v0, v1) -> - v0.bOp(v1, (i, a, n) -> rotateRight(a, (int)n)); -#end[BITWISE] -#if[FP] - case VECTOR_OP_ATAN2: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$) Math.atan2(a, b)); - case VECTOR_OP_POW: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$) Math.pow(a, b)); - case VECTOR_OP_HYPOT: return (v0, v1) -> - v0.bOp(v1, (i, a, b) -> ($type$) Math.hypot(a, b)); -#end[FP] - default: return null; - }})); + opc, getClass(), null, $type$.class, length(), + this, that, null, + BIN_IMPL.find(op, opc, $abstractvectortype$::binaryOperations)); } - private static final - ImplCache> BIN_IMPL - = new ImplCache<>(Binary.class, $Type$Vector.class); /** * {@inheritDoc} * @see #lanewise(VectorOperators.Binary,$type$,VectorMask) */ - @ForceInline - public final + @Override + public abstract $abstractvectortype$ lanewise(VectorOperators.Binary op, Vector<$Boxtype$> v, - VectorMask<$Boxtype$> m) { -#if[BITWISE] + VectorMask<$Boxtype$> m); + @ForceInline + final + $abstractvectortype$ lanewiseTemplate(VectorOperators.Binary op, + Class> maskClass, + Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { $abstractvectortype$ that = ($abstractvectortype$) v; - if (op == DIV) { - VectorMask<$Boxtype$> eqz = that.eq(($type$)0); - if (eqz.and(m).anyTrue()) { - throw that.divZeroException(); + that.check(this); + m.check(maskClass, this); + + if (opKind(op, VO_SPECIAL {#if[!FP]? | VO_SHIFT})) { + if (op == FIRST_NONZERO) { +#if[FP] + return blend(lanewise(op, v), m); +#else[FP] + // FIXME: Support this in the JIT. + VectorMask<$Boxbitstype$> thisNZ + = this.viewAsIntegralLanes().compare(NE, ($bitstype$) 0); + that = that.blend(($type$) 0, thisNZ.cast(vspecies())); + op = OR_UNCHECKED; +#end[FP] + } +#if[BITWISE] +#if[!FP] + if (opKind(op, VO_SHIFT)) { + // As per shift specification for Java, mask the shift count. + // This allows the JIT to ignore some ISA details. + that = that.lanewise(AND, SHIFT_MASK); + } +#end[!FP] + if (op == AND_NOT) { + // FIXME: Support this in the JIT. + that = that.lanewise(NOT); + op = AND; + } else if (op == DIV) { + VectorMask<$Boxtype$> eqz = that.eq(($type$)0); + if (eqz.and(m).anyTrue()) { + throw that.divZeroException(); + } + // suppress div/0 exceptions in unset lanes + that = that.lanewise(NOT, eqz); } - // suppress div/0 exceptions in unset lanes - that = that.lanewise(NOT, eqz); - return blend(lanewise(DIV, that), m); +#end[BITWISE] } + + int opc = opCode(op); + return VectorSupport.binaryOp( + opc, getClass(), maskClass, $type$.class, length(), + this, that, m, + BIN_IMPL.find(op, opc, $abstractvectortype$::binaryOperations)); + } + + private static final + ImplCache>> + BIN_IMPL = new ImplCache<>(Binary.class, $Type$Vector.class); + + private static BinaryOperation<$abstractvectortype$, VectorMask<$Boxtype$>> binaryOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a + b)); + case VECTOR_OP_SUB: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a - b)); + case VECTOR_OP_MUL: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a * b)); + case VECTOR_OP_DIV: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a / b)); + case VECTOR_OP_MAX: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)Math.max(a, b)); + case VECTOR_OP_MIN: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)Math.min(a, b)); +#if[BITWISE] + case VECTOR_OP_AND: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a & b)); + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a | b)); + case VECTOR_OP_XOR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$)(a ^ b)); + case VECTOR_OP_LSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> ($type$)(a << n)); + case VECTOR_OP_RSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> ($type$)(a >> n)); + case VECTOR_OP_URSHIFT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> ($type$)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, n) -> rotateRight(a, (int)n)); #end[BITWISE] - return blend(lanewise(op, v), m); +#if[FP] + case VECTOR_OP_OR: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> fromBits(toBits(a) | toBits(b))); + case VECTOR_OP_ATAN2: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$) Math.atan2(a, b)); + case VECTOR_OP_POW: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$) Math.pow(a, b)); + case VECTOR_OP_HYPOT: return (v0, v1, vm) -> + v0.bOp(v1, vm, (i, a, b) -> ($type$) Math.hypot(a, b)); +#end[FP] + default: return null; + } } + // FIXME: Maybe all of the public final methods in this file (the // simple ones that just call lanewise) should be pushed down to // the X-VectorBits template. They can't optimize properly at @@ -829,7 +923,15 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ lanewise(VectorOperators.Binary op, $type$ e, VectorMask<$Boxtype$> m) { - return blend(lanewise(op, e), m); +#if[BITWISE] + if (opKind(op, VO_SHIFT) && ($type$)(int)e == e) { + return lanewiseShift(op, (int) e, m); + } + if (op == AND_NOT) { + op = AND; e = ($type$) ~e; + } +#end[BITWISE] + return lanewise(op, broadcast(e), m); } #if[!long] @@ -848,12 +950,13 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ lanewise(VectorOperators.Binary op, long e) { $type$ e1 = ($type$) e; - if ((long)e1 != e #if[BITWISE] + if ((long)e1 != e // allow shift ops to clip down their int parameters - && !(opKind(op, VO_SHIFT) && (int)e1 == e) + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { +#else[BITWISE] + if ((long)e1 != e) { #end[BITWISE] - ) { vspecies().checkValue(e); // for exception } return lanewise(op, e1); @@ -873,7 +976,17 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { public final $abstractvectortype$ lanewise(VectorOperators.Binary op, long e, VectorMask<$Boxtype$> m) { - return blend(lanewise(op, e), m); + $type$ e1 = ($type$) e; +#if[BITWISE] + if ((long)e1 != e + // allow shift ops to clip down their int parameters + && !(opKind(op, VO_SHIFT) && (int)e1 == e)) { +#else[BITWISE] + if ((long)e1 != e) { +#end[BITWISE] + vspecies().checkValue(e); // for exception + } + return lanewise(op, e1, m); } #end[!long] @@ -892,27 +1005,52 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { e &= SHIFT_MASK; int opc = opCode(op); return VectorSupport.broadcastInt( - opc, getClass(), $type$.class, length(), - this, e, - BIN_INT_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_LSHIFT: return (v, n) -> - v.uOp((i, a) -> ($type$)(a << n)); - case VECTOR_OP_RSHIFT: return (v, n) -> - v.uOp((i, a) -> ($type$)(a >> n)); - case VECTOR_OP_URSHIFT: return (v, n) -> - v.uOp((i, a) -> ($type$)((a & LSHR_SETUP_MASK) >>> n)); - case VECTOR_OP_LROTATE: return (v, n) -> - v.uOp((i, a) -> rotateLeft(a, (int)n)); - case VECTOR_OP_RROTATE: return (v, n) -> - v.uOp((i, a) -> rotateRight(a, (int)n)); - default: return null; - }})); + opc, getClass(), null, $type$.class, length(), + this, e, null, + BIN_INT_IMPL.find(op, opc, $abstractvectortype$::broadcastIntOperations)); + } + + /*package-private*/ + abstract $abstractvectortype$ + lanewiseShift(VectorOperators.Binary op, int e, VectorMask<$Boxtype$> m); + + /*package-private*/ + @ForceInline + final $abstractvectortype$ + lanewiseShiftTemplate(VectorOperators.Binary op, + Class> maskClass, + int e, VectorMask<$Boxtype$> m) { + m.check(maskClass, this); + assert(opKind(op, VO_SHIFT)); + // As per shift specification for Java, mask the shift count. + e &= SHIFT_MASK; + int opc = opCode(op); + return VectorSupport.broadcastInt( + opc, getClass(), maskClass, $type$.class, length(), + this, e, m, + BIN_INT_IMPL.find(op, opc, $abstractvectortype$::broadcastIntOperations)); } + private static final - ImplCache> BIN_INT_IMPL + ImplCache>> BIN_INT_IMPL = new ImplCache<>(Binary.class, $Type$Vector.class); + private static VectorBroadcastIntOp<$abstractvectortype$, VectorMask<$Boxtype$>> broadcastIntOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_LSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> ($type$)(a << n)); + case VECTOR_OP_RSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> ($type$)(a >> n)); + case VECTOR_OP_URSHIFT: return (v, n, m) -> + v.uOp(m, (i, a) -> ($type$)((a & LSHR_SETUP_MASK) >>> n)); + case VECTOR_OP_LROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateLeft(a, (int)n)); + case VECTOR_OP_RROTATE: return (v, n, m) -> + v.uOp(m, (i, a) -> rotateRight(a, (int)n)); + default: return null; + } + } + // As per shift specification for Java, mask the shift count. // We mask 0X3F (long), 0X1F (int), 0x0F (short), 0x7 (byte). // The latter two maskings go beyond the JLS, but seem reasonable @@ -972,20 +1110,10 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { #end[BITWISE] int opc = opCode(op); return VectorSupport.ternaryOp( - opc, getClass(), $type$.class, length(), - this, that, tother, - TERN_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { -#if[FP] - case VECTOR_OP_FMA: return (v0, v1_, v2_) -> - v0.tOp(v1_, v2_, (i, a, b, c) -> Math.fma(a, b, c)); -#end[FP] - default: return null; - }})); + opc, getClass(), null, $type$.class, length(), + this, that, tother, null, + TERN_IMPL.find(op, opc, $abstractvectortype$::ternaryOperations)); } - private static final - ImplCache> TERN_IMPL - = new ImplCache<>(Ternary.class, $Type$Vector.class); /** * {@inheritDoc} @@ -993,13 +1121,54 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { * @see #lanewise(VectorOperators.Ternary,Vector,$type$,VectorMask) * @see #lanewise(VectorOperators.Ternary,$type$,Vector,VectorMask) */ - @ForceInline - public final + @Override + public abstract $abstractvectortype$ lanewise(VectorOperators.Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2, - VectorMask<$Boxtype$> m) { - return blend(lanewise(op, v1, v2), m); + VectorMask<$Boxtype$> m); + @ForceInline + final + $abstractvectortype$ lanewiseTemplate(VectorOperators.Ternary op, + Class> maskClass, + Vector<$Boxtype$> v1, + Vector<$Boxtype$> v2, + VectorMask<$Boxtype$> m) { + $abstractvectortype$ that = ($abstractvectortype$) v1; + $abstractvectortype$ tother = ($abstractvectortype$) v2; + // It's a word: https://www.dictionary.com/browse/tother + // See also Chapter 11 of Dickens, Our Mutual Friend: + // "Totherest Governor," replied Mr Riderhood... + that.check(this); + tother.check(this); + m.check(maskClass, this); + +#if[BITWISE] + if (op == BITWISE_BLEND) { + // FIXME: Support this in the JIT. + that = this.lanewise(XOR, that).lanewise(AND, tother); + return this.lanewise(XOR, that, m); + } +#end[BITWISE] + int opc = opCode(op); + return VectorSupport.ternaryOp( + opc, getClass(), maskClass, $type$.class, length(), + this, that, tother, m, + TERN_IMPL.find(op, opc, $abstractvectortype$::ternaryOperations)); + } + + private static final + ImplCache>> + TERN_IMPL = new ImplCache<>(Ternary.class, $Type$Vector.class); + + private static TernaryOperation<$abstractvectortype$, VectorMask<$Boxtype$>> ternaryOperations(int opc_) { + switch (opc_) { +#if[FP] + case VECTOR_OP_FMA: return (v0, v1_, v2_, m) -> + v0.tOp(v1_, v2_, m, (i, a, b, c) -> Math.fma(a, b, c)); +#end[FP] + default: return null; + } } /** @@ -1056,7 +1225,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $type$ e1, $type$ e2, VectorMask<$Boxtype$> m) { - return blend(lanewise(op, e1, e2), m); + return lanewise(op, broadcast(e1), broadcast(e2), m); } /** @@ -1114,7 +1283,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { Vector<$Boxtype$> v1, $type$ e2, VectorMask<$Boxtype$> m) { - return blend(lanewise(op, v1, e2), m); + return lanewise(op, v1, broadcast(e2), m); } /** @@ -1171,7 +1340,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $type$ e1, Vector<$Boxtype$> v2, VectorMask<$Boxtype$> m) { - return blend(lanewise(op, e1, v2), m); + return lanewise(op, broadcast(e1), v2, m); } // (Thus endeth the Great and Mighty Ternary Ogdoad.) @@ -2016,15 +2185,13 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { final > M compareTemplate(Class maskType, Comparison op, Vector<$Boxtype$> v) { - Objects.requireNonNull(v); - $Type$Species vsp = vspecies(); $abstractvectortype$ that = ($abstractvectortype$) v; that.check(this); int opc = opCode(op); return VectorSupport.compare( opc, getClass(), maskType, $type$.class, length(), - this, that, - (cond, v0, v1) -> { + this, that, null, + (cond, v0, v1, m1) -> { AbstractMask<$Boxtype$> m = v0.bTest(cond, v1, (cond_, i, a, b) -> compareWithOp(cond, a, b)); @@ -2034,6 +2201,28 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { }); } + /*package-private*/ + @ForceInline + final + > + M compareTemplate(Class maskType, Comparison op, Vector<$Boxtype$> v, M m) { + $abstractvectortype$ that = ($abstractvectortype$) v; + that.check(this); + m.check(maskType, this); + int opc = opCode(op); + return VectorSupport.compare( + opc, getClass(), maskType, $type$.class, length(), + this, that, m, + (cond, v0, v1, m1) -> { + AbstractMask<$Boxtype$> cmpM + = v0.bTest(cond, v1, (cond_, i, a, b) + -> compareWithOp(cond, a, b)); + @SuppressWarnings("unchecked") + M m2 = (M) cmpM.and(m1); + return m2; + }); + } + @ForceInline private static boolean compareWithOp(int cond, $type$ a, $type$ b) { return switch (cond) { @@ -2053,18 +2242,6 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { }; } - /** - * {@inheritDoc} - */ - @Override - @ForceInline - public final - VectorMask<$Boxtype$> compare(VectorOperators.Comparison op, - Vector<$Boxtype$> v, - VectorMask<$Boxtype$> m) { - return compare(op, v).and(m); - } - /** * Tests this vector by comparing it with an input scalar, * according to the given comparison operation. @@ -2123,7 +2300,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { public final VectorMask<$Boxtype$> compare(VectorOperators.Comparison op, $type$ e, VectorMask<$Boxtype$> m) { - return compare(op, e).and(m); + return compare(op, broadcast(e), m); } #if[!long] @@ -2378,9 +2555,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $abstractvectortype$ rearrangeTemplate(Class shuffletype, S shuffle) { shuffle.checkIndexes(); return VectorSupport.rearrangeOp( - getClass(), shuffletype, $type$.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, $type$.class, length(), + this, shuffle, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2397,24 +2574,25 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { /*package-private*/ @ForceInline final - > + , M extends VectorMask<$Boxtype$>> $abstractvectortype$ rearrangeTemplate(Class shuffletype, + Class masktype, S shuffle, - VectorMask<$Boxtype$> m) { - $abstractvectortype$ unmasked = - VectorSupport.rearrangeOp( - getClass(), shuffletype, $type$.class, length(), - this, shuffle, - (v1, s_) -> v1.uOp((i, a) -> { - int ei = s_.laneSource(i); - return ei < 0 ? 0 : v1.lane(ei); - })); + M m) { + + m.check(masktype, this); VectorMask<$Boxtype$> valid = shuffle.laneIsValid(); if (m.andNot(valid).anyTrue()) { shuffle.checkIndexes(); throw new AssertionError(); } - return broadcast(($type$)0).blend(unmasked, m); + return VectorSupport.rearrangeOp( + getClass(), shuffletype, masktype, $type$.class, length(), + this, shuffle, m, + (v1, s_, m_) -> v1.uOp((i, a) -> { + int ei = s_.laneSource(i); + return ei < 0 || !m_.laneIsSet(i) ? 0 : v1.lane(ei); + })); } /** @@ -2437,17 +2615,17 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { S ws = (S) shuffle.wrapIndexes(); $abstractvectortype$ r0 = VectorSupport.rearrangeOp( - getClass(), shuffletype, $type$.class, length(), - this, ws, - (v0, s_) -> v0.uOp((i, a) -> { + getClass(), shuffletype, null, $type$.class, length(), + this, ws, null, + (v0, s_, m_) -> v0.uOp((i, a) -> { int ei = s_.laneSource(i); return v0.lane(ei); })); $abstractvectortype$ r1 = VectorSupport.rearrangeOp( - getClass(), shuffletype, $type$.class, length(), - v, ws, - (v1, s_) -> v1.uOp((i, a) -> { + getClass(), shuffletype, null, $type$.class, length(), + v, ws, null, + (v1, s_, m_) -> v1.uOp((i, a) -> { int ei = s_.laneSource(i); return v1.lane(ei); })); @@ -2839,9 +3017,18 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { @ForceInline final $type$ reduceLanesTemplate(VectorOperators.Associative op, + Class> maskClass, VectorMask<$Boxtype$> m) { - $abstractvectortype$ v = reduceIdentityVector(op).blend(this, m); - return v.reduceLanesTemplate(op); + m.check(maskClass, this); + if (op == FIRST_NONZERO) { + $abstractvectortype$ v = reduceIdentityVector(op).blend(this, m); + return v.reduceLanesTemplate(op); + } + int opc = opCode(op); + return fromBits(VectorSupport.reductionCoerced( + opc, getClass(), maskClass, $type$.class, length(), + this, m, + REDUCE_IMPL.find(op, opc, $abstractvectortype$::reductionOperations))); } /*package-private*/ @@ -2856,32 +3043,36 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { } int opc = opCode(op); return fromBits(VectorSupport.reductionCoerced( - opc, getClass(), $type$.class, length(), - this, - REDUCE_IMPL.find(op, opc, (opc_) -> { - switch (opc_) { - case VECTOR_OP_ADD: return v -> - toBits(v.rOp(($type$)0, (i, a, b) -> ($type$)(a + b))); - case VECTOR_OP_MUL: return v -> - toBits(v.rOp(($type$)1, (i, a, b) -> ($type$)(a * b))); - case VECTOR_OP_MIN: return v -> - toBits(v.rOp(MAX_OR_INF, (i, a, b) -> ($type$) Math.min(a, b))); - case VECTOR_OP_MAX: return v -> - toBits(v.rOp(MIN_OR_INF, (i, a, b) -> ($type$) Math.max(a, b))); + opc, getClass(), null, $type$.class, length(), + this, null, + REDUCE_IMPL.find(op, opc, $abstractvectortype$::reductionOperations))); + } + + private static final + ImplCache>> + REDUCE_IMPL = new ImplCache<>(Associative.class, $Type$Vector.class); + + private static ReductionOperation<$abstractvectortype$, VectorMask<$Boxtype$>> reductionOperations(int opc_) { + switch (opc_) { + case VECTOR_OP_ADD: return (v, m) -> + toBits(v.rOp(($type$)0, m, (i, a, b) -> ($type$)(a + b))); + case VECTOR_OP_MUL: return (v, m) -> + toBits(v.rOp(($type$)1, m, (i, a, b) -> ($type$)(a * b))); + case VECTOR_OP_MIN: return (v, m) -> + toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> ($type$) Math.min(a, b))); + case VECTOR_OP_MAX: return (v, m) -> + toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> ($type$) Math.max(a, b))); #if[BITWISE] - case VECTOR_OP_AND: return v -> - toBits(v.rOp(($type$)-1, (i, a, b) -> ($type$)(a & b))); - case VECTOR_OP_OR: return v -> - toBits(v.rOp(($type$)0, (i, a, b) -> ($type$)(a | b))); - case VECTOR_OP_XOR: return v -> - toBits(v.rOp(($type$)0, (i, a, b) -> ($type$)(a ^ b))); + case VECTOR_OP_AND: return (v, m) -> + toBits(v.rOp(($type$)-1, m, (i, a, b) -> ($type$)(a & b))); + case VECTOR_OP_OR: return (v, m) -> + toBits(v.rOp(($type$)0, m, (i, a, b) -> ($type$)(a | b))); + case VECTOR_OP_XOR: return (v, m) -> + toBits(v.rOp(($type$)0, m, (i, a, b) -> ($type$)(a ^ b))); #end[BITWISE] - default: return null; - }}))); + default: return null; + } } - private static final - ImplCache> REDUCE_IMPL - = new ImplCache<>(Associative.class, $Type$Vector.class); private @ForceInline @@ -3175,9 +3366,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { VectorMask<$Boxtype$> m) { $Type$Species vsp = ($Type$Species) species; if (offset >= 0 && offset <= (a.length - species.vectorByteSize())) { - $abstractvectortype$ zero = vsp.zero(); - $abstractvectortype$ v = zero.fromByteArray0(a, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteArray0(a, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -3239,8 +3428,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { VectorMask<$Boxtype$> m) { $Type$Species vsp = ($Type$Species) species; if (offset >= 0 && offset <= (a.length - species.length())) { - $abstractvectortype$ zero = vsp.zero(); - return zero.blend(zero.fromArray0(a, offset), m); + return vsp.dummyVector().fromArray0(a, offset, m); } // FIXME: optimize @@ -3333,13 +3521,13 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { vix = VectorIntrinsics.checkIndex(vix, a.length); return VectorSupport.loadWithMap( - vectorType, $type$.class, vsp.laneCount(), - IntVector.species(vsp.indexShape()).vectorType(), - a, ARRAY_BASE, vix, + vectorType, null, $type$.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, null, a, offset, indexMap, mapOffset, vsp, - ($type$[] c, int idx, int[] iMap, int idy, $Type$Species s) -> + (c, idx, iMap, idy, s, vm) -> s.vOp(n -> c[idx + iMap[idy+n]])); - } + } #end[byteOrShort] /** @@ -3399,9 +3587,8 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { return fromArray(species, a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. $Type$Species vsp = ($Type$Species) species; - return vsp.vOp(m, n -> a[offset + indexMap[mapOffset + n]]); + return vsp.dummyVector().fromArray0(a, offset, indexMap, mapOffset, m); } } #end[byteOrShort] @@ -3462,8 +3649,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { VectorMask<$Boxtype$> m) { $Type$Species vsp = ($Type$Species) species; if (offset >= 0 && offset <= (a.length - species.length())) { - $abstractvectortype$ zero = vsp.zero(); - return zero.blend(zero.fromCharArray0(a, offset), m); + return vsp.dummyVector().fromCharArray0(a, offset, m); } // FIXME: optimize @@ -3623,7 +3809,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { $Type$Species vsp = ($Type$Species) species; if (offset >= 0 && offset <= (a.length - species.length())) { $abstractvectortype$ zero = vsp.zero(); - return zero.blend(zero.fromBooleanArray0(a, offset), m); + return vsp.dummyVector().fromBooleanArray0(a, offset, m); } // FIXME: optimize @@ -3814,9 +4000,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { VectorMask<$Boxtype$> m) { $Type$Species vsp = ($Type$Species) species; if (offset >= 0 && offset <= (bb.limit() - species.vectorByteSize())) { - $abstractvectortype$ zero = vsp.zero(); - $abstractvectortype$ v = zero.fromByteBuffer0(bb, offset); - return zero.blend(v.maybeSwap(bo), m); + return vsp.dummyVector().fromByteBuffer0(bb, offset, m).maybeSwap(bo); } // FIXME: optimize @@ -3888,10 +4072,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { if (m.allTrue()) { intoArray(a, offset); } else { - // FIXME: optimize $Type$Species vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = v); + intoArray0(a, offset, m); } } @@ -3973,12 +4156,12 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { vix = VectorIntrinsics.checkIndex(vix, a.length); VectorSupport.storeWithMap( - vsp.vectorType(), vsp.elementType(), vsp.laneCount(), + vsp.vectorType(), null, vsp.elementType(), vsp.laneCount(), isp.vectorType(), a, arrayAddress(a, 0), vix, - this, + this, null, a, offset, indexMap, mapOffset, - (arr, off, v, map, mo) + (arr, off, v, map, mo, vm) -> v.stOp(arr, off, (arr_, off_, i, e) -> { int j = map[mo + i]; @@ -4039,12 +4222,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { intoArray(a, offset, indexMap, mapOffset); } else { - // FIXME: Cannot vectorize yet, if there's a mask. - stOp(a, offset, m, - (arr, off, i, e) -> { - int j = indexMap[mapOffset + i]; - arr[off + j] = e; - }); + intoArray0(a, offset, indexMap, mapOffset, m); } } #end[byteOrShort] @@ -4112,10 +4290,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { if (m.allTrue()) { intoCharArray(a, offset); } else { - // FIXME: optimize $Type$Species vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, v) -> arr[off+i] = (char) v); + intoCharArray0(a, offset, m); } } @@ -4275,10 +4452,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { if (m.allTrue()) { intoBooleanArray(a, offset); } else { - // FIXME: optimize $Type$Species vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, 1, a.length); - stOp(a, offset, m, (arr, off, i, e) -> arr[off+i] = (e & 1) != 0); + intoBooleanArray0(a, offset, m); } } @@ -4398,12 +4574,9 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { if (m.allTrue()) { intoByteArray(a, offset, bo); } else { - // FIXME: optimize $Type$Species vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, $sizeInBytes$, a.length); - ByteBuffer wb = wrapper(a, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.put{#if[byte]?(:$Type$(}o + i * $sizeInBytes$, e)); + maybeSwap(bo).intoByteArray0(a, offset, m); } } @@ -4415,7 +4588,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { public final void intoByteBuffer(ByteBuffer bb, int offset, ByteOrder bo) { - if (bb.isReadOnly()) { + if (ScopedMemoryAccess.isReadOnly(bb)) { throw new ReadOnlyBufferException(); } offset = checkFromIndexSize(offset, byteSize(), bb.limit()); @@ -4434,15 +4607,12 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { if (m.allTrue()) { intoByteBuffer(bb, offset, bo); } else { - // FIXME: optimize if (bb.isReadOnly()) { throw new ReadOnlyBufferException(); } $Type$Species vsp = vspecies(); checkMaskFromIndexSize(offset, vsp, m, $sizeInBytes$, bb.limit()); - ByteBuffer wb = wrapper(bb, bo); - this.stOp(wb, offset, m, - (wb_, o, i, e) -> wb_.put{#if[byte]?(:$Type$(}o + i * $sizeInBytes$, e)); + maybeSwap(bo).intoByteBuffer0(bb, offset, m); } } @@ -4480,6 +4650,84 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { (arr_, off_, i) -> arr_[off_ + i])); } + /*package-private*/ + abstract + $abstractvectortype$ fromArray0($type$[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + $abstractvectortype$ fromArray0Template(Class maskClass, $type$[] a, int offset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> arr_[off_ + i])); + } + +#if[!byteOrShort] + /*package-private*/ + abstract + $abstractvectortype$ fromArray0($type$[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask<$Boxtype$> m); + @ForceInline + final + > + $abstractvectortype$ fromArray0Template(Class maskClass, $type$[] a, int offset, + int[] indexMap, int mapOffset, M m) { + $Type$Species vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); + Objects.requireNonNull(a); + Objects.requireNonNull(indexMap); + m.check(vsp); + Class vectorType = vsp.vectorType(); + +#if[longOrDouble] + if (vsp.laneCount() == 1) { + return $abstractvectortype$.fromArray(vsp, a, offset + indexMap[mapOffset], m); + } + + // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] + IntVector vix; + if (isp.laneCount() != vsp.laneCount()) { + // For $Type$MaxVector, if vector length is non-power-of-two or + // 2048 bits, indexShape of $Type$ species is S_MAX_BIT. + // Assume that vector length is 2048, then the lane count of $Type$ + // vector is 32. When converting $Type$ species to int species, + // indexShape is still S_MAX_BIT, but the lane count of int vector + // is 64. So when loading index vector (IntVector), only lower half + // of index data is needed. + vix = IntVector + .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .add(offset); + } else { + vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + } +#else[longOrDouble] + // Index vector: vix[0:n] = k -> offset + indexMap[mapOffset + k] + IntVector vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); +#end[longOrDouble] + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + return VectorSupport.loadWithMap( + vectorType, maskClass, $type$.class, vsp.laneCount(), + isp.vectorType(), + a, ARRAY_BASE, vix, m, + a, offset, indexMap, mapOffset, vsp, + (c, idx, iMap, idy, s, vm) -> + s.vOp(vm, n -> c[idx + iMap[idy+n]])); + } +#end[!byteOrShort] + #if[short] /*package-private*/ abstract @@ -4495,6 +4743,23 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { (arr, off, s) -> s.ldOp(arr, off, (arr_, off_, i) -> (short) arr_[off_ + i])); } + + /*package-private*/ + abstract + $abstractvectortype$ fromCharArray0(char[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + $abstractvectortype$ fromCharArray0Template(Class maskClass, char[] a, int offset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, charArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> (short) arr_[off_ + i])); + } #end[short] #if[byte] @@ -4512,6 +4777,23 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { (arr, off, s) -> s.ldOp(arr, off, (arr_, off_, i) -> (byte) (arr_[off_ + i] ? 1 : 0))); } + + /*package-private*/ + abstract + $abstractvectortype$ fromBooleanArray0(boolean[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + $abstractvectortype$ fromBooleanArray0Template(Class maskClass, boolean[] a, int offset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, booleanArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> s.ldOp(arr, off, vm, + (arr_, off_, i) -> (byte) (arr_[off_ + i] ? 1 : 0))); + } #end[byte] @Override @@ -4532,6 +4814,25 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { }); } + abstract + $abstractvectortype$ fromByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + $abstractvectortype$ fromByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + $Type$Species vsp = vspecies(); + m.check(vsp); + return VectorSupport.loadMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), m, + a, offset, vsp, + (arr, off, s, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.get{#if[byte]?(:$Type$(}o + i * $sizeInBytes$)); + }); + } + abstract $abstractvectortype$ fromByteBuffer0(ByteBuffer bb, int offset); @ForceInline @@ -4548,6 +4849,24 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { }); } + abstract + $abstractvectortype$ fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + $abstractvectortype$ fromByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + $Type$Species vsp = vspecies(); + m.check(vsp); + return ScopedMemoryAccess.loadFromByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + bb, offset, m, vsp, + (buf, off, s, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + return s.ldOp(wb, off, vm, + (wb_, o, i) -> wb_.get{#if[byte]?(:$Type$(}o + i * $sizeInBytes$)); + }); + } + // Unchecked storing operations in native byte order. // Caller is responsible for applying index checks, masking, and // byte swapping. @@ -4567,6 +4886,105 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { (arr_, off_, i, e) -> arr_[off_+i] = e)); } + abstract + void intoArray0($type$[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, $type$[] a, int offset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, arrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = e)); + } + +#if[!byteOrShort] + abstract + void intoArray0($type$[] a, int offset, + int[] indexMap, int mapOffset, + VectorMask<$Boxtype$> m); + @ForceInline + final + > + void intoArray0Template(Class maskClass, $type$[] a, int offset, + int[] indexMap, int mapOffset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + IntVector.IntSpecies isp = IntVector.species(vsp.indexShape()); +#if[longOrDouble] + if (vsp.laneCount() == 1) { + intoArray(a, offset + indexMap[mapOffset], m); + return; + } + + // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] + IntVector vix; + if (isp.laneCount() != vsp.laneCount()) { + // For $Type$MaxVector, if vector length is 2048 bits, indexShape + // of $Type$ species is S_MAX_BIT. and the lane count of $Type$ + // vector is 32. When converting $Type$ species to int species, + // indexShape is still S_MAX_BIT, but the lane count of int vector + // is 64. So when loading index vector (IntVector), only lower half + // of index data is needed. + vix = IntVector + .fromArray(isp, indexMap, mapOffset, IntMaxVector.IntMaxMask.LOWER_HALF_TRUE_MASK) + .add(offset); + } else { + vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); + } + +#else[longOrDouble] + // Index vector: vix[0:n] = i -> offset + indexMap[mo + i] + IntVector vix = IntVector + .fromArray(isp, indexMap, mapOffset) + .add(offset); +#end[longOrDouble] + + // FIXME: Check index under mask controlling. + vix = VectorIntrinsics.checkIndex(vix, a.length); + + VectorSupport.storeWithMap( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + isp.vectorType(), + a, arrayAddress(a, 0), vix, + this, m, + a, offset, indexMap, mapOffset, + (arr, off, v, map, mo, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> { + int j = map[mo + i]; + arr[off + j] = e; + })); + } +#end[!byteOrShort] + +#if[byte] + abstract + void intoBooleanArray0(boolean[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + void intoBooleanArray0Template(Class maskClass, boolean[] a, int offset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + ByteVector normalized = this.and((byte) 1); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, booleanArrayAddress(a, offset), + normalized, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = (e & 1) != 0)); + } +#end[byte] + abstract void intoByteArray0(byte[] a, int offset); @ForceInline @@ -4584,6 +5002,25 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { }); } + abstract + void intoByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + void intoByteArray0Template(Class maskClass, byte[] a, int offset, M m) { + $Type$Species vsp = vspecies(); + m.check(vsp); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, byteArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) -> { + ByteBuffer wb = wrapper(arr, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (tb_, o, i, e) -> tb_.put{#if[byte]?(:$Type$(}o + i * $sizeInBytes$, e)); + }); + } + @ForceInline final void intoByteBuffer0(ByteBuffer bb, int offset) { @@ -4598,6 +5035,44 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { }); } + abstract + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + void intoByteBuffer0Template(Class maskClass, ByteBuffer bb, int offset, M m) { + $Type$Species vsp = vspecies(); + m.check(vsp); + ScopedMemoryAccess.storeIntoByteBufferMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + this, m, bb, offset, + (buf, off, v, vm) -> { + ByteBuffer wb = wrapper(buf, NATIVE_ENDIAN); + v.stOp(wb, off, vm, + (wb_, o, i, e) -> wb_.put{#if[byte]?(:$Type$(}o + i * $sizeInBytes$, e)); + }); + } + +#if[short] + /*package-private*/ + abstract + void intoCharArray0(char[] a, int offset, VectorMask<$Boxtype$> m); + @ForceInline + final + > + void intoCharArray0Template(Class maskClass, char[] a, int offset, M m) { + m.check(species()); + $Type$Species vsp = vspecies(); + VectorSupport.storeMasked( + vsp.vectorType(), maskClass, vsp.elementType(), vsp.laneCount(), + a, charArrayAddress(a, offset), + this, m, a, offset, + (arr, off, v, vm) + -> v.stOp(arr, off, vm, + (arr_, off_, i, e) -> arr_[off_ + i] = (char) e)); + } +#end[short] + // End of low-level memory operations. private static @@ -4973,7 +5448,7 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> { /*package-private*/ @ForceInline $abstractvectortype$ ldOp(M memory, int offset, - AbstractMask<$Boxtype$> m, + VectorMask<$Boxtype$> m, FLdOp f) { return dummyVector().ldOp(memory, offset, m, f); } diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template index 225d0e5dd77..df15c85fccc 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template @@ -238,8 +238,8 @@ final class $vectortype$ extends $abstractvectortype$ { @ForceInline final @Override - $type$ rOp($type$ v, FBinOp f) { - return super.rOpTemplate(v, f); // specialize + $type$ rOp($type$ v, VectorMask<$Boxtype$> m, FBinOp f) { + return super.rOpTemplate(v, m, f); // specialize } @Override @@ -275,12 +275,24 @@ final class $vectortype$ extends $abstractvectortype$ { return ($vectortype$) super.lanewiseTemplate(op); // specialize } + @Override + @ForceInline + public $vectortype$ lanewise(Unary op, VectorMask<$Boxtype$> m) { + return ($vectortype$) super.lanewiseTemplate(op, $masktype$.class, ($masktype$) m); // specialize + } + @Override @ForceInline public $vectortype$ lanewise(Binary op, Vector<$Boxtype$> v) { return ($vectortype$) super.lanewiseTemplate(op, v); // specialize } + @Override + @ForceInline + public $vectortype$ lanewise(Binary op, Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return ($vectortype$) super.lanewiseTemplate(op, $masktype$.class, v, ($masktype$) m); // specialize + } + #if[!FP] /*package-private*/ @Override @@ -288,6 +300,13 @@ final class $vectortype$ extends $abstractvectortype$ { lanewiseShift(VectorOperators.Binary op, int e) { return ($vectortype$) super.lanewiseShiftTemplate(op, e); // specialize } + + /*package-private*/ + @Override + @ForceInline $vectortype$ + lanewiseShift(VectorOperators.Binary op, int e, VectorMask<$Boxtype$> m) { + return ($vectortype$) super.lanewiseShiftTemplate(op, $masktype$.class, e, ($masktype$) m); // specialize + } #end[!FP] /*package-private*/ @@ -295,10 +314,18 @@ final class $vectortype$ extends $abstractvectortype$ { @ForceInline public final $vectortype$ - lanewise(VectorOperators.Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2) { + lanewise(Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2) { return ($vectortype$) super.lanewiseTemplate(op, v1, v2); // specialize } + @Override + @ForceInline + public final + $vectortype$ + lanewise(Ternary op, Vector<$Boxtype$> v1, Vector<$Boxtype$> v2, VectorMask<$Boxtype$> m) { + return ($vectortype$) super.lanewiseTemplate(op, $masktype$.class, v1, v2, ($masktype$) m); // specialize + } + @Override @ForceInline public final @@ -318,7 +345,7 @@ final class $vectortype$ extends $abstractvectortype$ { @ForceInline public final $type$ reduceLanes(VectorOperators.Associative op, VectorMask<$Boxtype$> m) { - return super.reduceLanesTemplate(op, m); // specialized + return super.reduceLanesTemplate(op, $masktype$.class, ($masktype$) m); // specialized } @Override @@ -331,7 +358,7 @@ final class $vectortype$ extends $abstractvectortype$ { @ForceInline public final long reduceLanesToLong(VectorOperators.Associative op, VectorMask<$Boxtype$> m) { - return (long) super.reduceLanesTemplate(op, m); // specialized + return (long) super.reduceLanesTemplate(op, $masktype$.class, ($masktype$) m); // specialized } @ForceInline @@ -369,6 +396,13 @@ final class $vectortype$ extends $abstractvectortype$ { } #end[!long] + @Override + @ForceInline + public final $masktype$ compare(Comparison op, Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { + return super.compareTemplate($masktype$.class, op, v, ($masktype$) m); + } + + @Override @ForceInline public $vectortype$ blend(Vector<$Boxtype$> v, VectorMask<$Boxtype$> m) { @@ -425,6 +459,7 @@ final class $vectortype$ extends $abstractvectortype$ { VectorMask<$Boxtype$> m) { return ($vectortype$) super.rearrangeTemplate($shuffletype$.class, + $masktype$.class, ($shuffletype$) shuffle, ($masktype$) m); // specialize } @@ -855,16 +890,12 @@ final class $vectortype$ extends $abstractvectortype$ { AbstractSpecies species = (AbstractSpecies) dsp; if (length() != species.laneCount()) throw new IllegalArgumentException("VectorMask length and species length differ"); - if (VSIZE == species.vectorBitSize()) { - Class dtype = species.elementType(); - Class dmtype = species.maskType(); - return VectorSupport.convert(VectorSupport.VECTOR_OP_REINTERPRET, - this.getClass(), ETYPE, VLENGTH, - dmtype, dtype, VLENGTH, - this, species, - $Type$$bits$Mask::defaultMaskCast); - } - return this.defaultMaskCast(species); + + return VectorSupport.convert(VectorSupport.VECTOR_OP_CAST, + this.getClass(), ETYPE, VLENGTH, + species.maskType(), species.elementType(), VLENGTH, + this, species, + (m, s) -> s.maskFactory(m.toArray()).check(s)); } @Override @@ -890,9 +921,9 @@ final class $vectortype$ extends $abstractvectortype$ { public $masktype$ and(VectorMask<$Boxtype$> mask) { Objects.requireNonNull(mask); $masktype$ m = ($masktype$)mask; - return VectorSupport.binaryOp(VECTOR_OP_AND, $masktype$.class, $bitstype$.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a & b)); + return VectorSupport.binaryOp(VECTOR_OP_AND, $masktype$.class, null, $bitstype$.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a & b)); } @Override @@ -900,9 +931,9 @@ final class $vectortype$ extends $abstractvectortype$ { public $masktype$ or(VectorMask<$Boxtype$> mask) { Objects.requireNonNull(mask); $masktype$ m = ($masktype$)mask; - return VectorSupport.binaryOp(VECTOR_OP_OR, $masktype$.class, $bitstype$.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a | b)); + return VectorSupport.binaryOp(VECTOR_OP_OR, $masktype$.class, null, $bitstype$.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a | b)); } @ForceInline @@ -910,9 +941,9 @@ final class $vectortype$ extends $abstractvectortype$ { $masktype$ xor(VectorMask<$Boxtype$> mask) { Objects.requireNonNull(mask); $masktype$ m = ($masktype$)mask; - return VectorSupport.binaryOp(VECTOR_OP_XOR, $masktype$.class, $bitstype$.class, VLENGTH, - this, m, - (m1, m2) -> m1.bOp(m2, (i, a, b) -> a ^ b)); + return VectorSupport.binaryOp(VECTOR_OP_XOR, $masktype$.class, null, $bitstype$.class, VLENGTH, + this, m, null, + (m1, m2, vm) -> m1.bOp(m2, (i, a, b) -> a ^ b)); } // Mask Query operations @@ -920,22 +951,32 @@ final class $vectortype$ extends $abstractvectortype$ { @Override @ForceInline public int trueCount() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, $masktype$.class, $bitstype$.class, VLENGTH, this, - (m) -> trueCountHelper((($masktype$)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TRUECOUNT, $masktype$.class, $bitstype$.class, VLENGTH, this, + (m) -> trueCountHelper(m.getBits())); } @Override @ForceInline public int firstTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this, - (m) -> firstTrueHelper((($masktype$)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_FIRSTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this, + (m) -> firstTrueHelper(m.getBits())); } @Override @ForceInline public int lastTrue() { - return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this, - (m) -> lastTrueHelper((($masktype$)m).getBits())); + return (int) VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_LASTTRUE, $masktype$.class, $bitstype$.class, VLENGTH, this, + (m) -> lastTrueHelper(m.getBits())); + } + + @Override + @ForceInline + public long toLong() { + if (length() > Long.SIZE) { + throw new UnsupportedOperationException("too many lanes for one long"); + } + return VectorSupport.maskReductionCoerced(VECTOR_OP_MASK_TOLONG, $masktype$.class, $bitstype$.class, VLENGTH, this, + (m) -> toLongHelper(m.getBits())); } // Reductions @@ -1061,6 +1102,22 @@ final class $vectortype$ extends $abstractvectortype$ { return super.fromArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + $abstractvectortype$ fromArray0($type$[] a, int offset, VectorMask<$Boxtype$> m) { + return super.fromArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize + } + +#if[!byteOrShort] + @ForceInline + @Override + final + $abstractvectortype$ fromArray0($type$[] a, int offset, int[] indexMap, int mapOffset, VectorMask<$Boxtype$> m) { + return super.fromArray0Template($masktype$.class, a, offset, indexMap, mapOffset, ($masktype$) m); + } +#end[!byteOrShort] + #if[short] @ForceInline @Override @@ -1068,6 +1125,13 @@ final class $vectortype$ extends $abstractvectortype$ { $abstractvectortype$ fromCharArray0(char[] a, int offset) { return super.fromCharArray0Template(a, offset); // specialize } + + @ForceInline + @Override + final + $abstractvectortype$ fromCharArray0(char[] a, int offset, VectorMask<$Boxtype$> m) { + return super.fromCharArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize + } #end[short] #if[byte] @@ -1077,6 +1141,13 @@ final class $vectortype$ extends $abstractvectortype$ { $abstractvectortype$ fromBooleanArray0(boolean[] a, int offset) { return super.fromBooleanArray0Template(a, offset); // specialize } + + @ForceInline + @Override + final + $abstractvectortype$ fromBooleanArray0(boolean[] a, int offset, VectorMask<$Boxtype$> m) { + return super.fromBooleanArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize + } #end[byte] @ForceInline @@ -1086,6 +1157,13 @@ final class $vectortype$ extends $abstractvectortype$ { return super.fromByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + $abstractvectortype$ fromByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m) { + return super.fromByteArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize + } + @ForceInline @Override final @@ -1093,6 +1171,13 @@ final class $vectortype$ extends $abstractvectortype$ { return super.fromByteBuffer0Template(bb, offset); // specialize } + @ForceInline + @Override + final + $abstractvectortype$ fromByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m) { + return super.fromByteBuffer0Template($masktype$.class, bb, offset, ($masktype$) m); // specialize + } + @ForceInline @Override final @@ -1100,6 +1185,31 @@ final class $vectortype$ extends $abstractvectortype$ { super.intoArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoArray0($type$[] a, int offset, VectorMask<$Boxtype$> m) { + super.intoArray0Template($masktype$.class, a, offset, ($masktype$) m); + } + +#if[!byteOrShort] + @ForceInline + @Override + final + void intoArray0($type$[] a, int offset, int[] indexMap, int mapOffset, VectorMask<$Boxtype$> m) { + super.intoArray0Template($masktype$.class, a, offset, indexMap, mapOffset, ($masktype$) m); + } +#end[!byteOrShort] + +#if[byte] + @ForceInline + @Override + final + void intoBooleanArray0(boolean[] a, int offset, VectorMask<$Boxtype$> m) { + super.intoBooleanArray0Template($masktype$.class, a, offset, ($masktype$) m); + } +#end[byte] + @ForceInline @Override final @@ -1107,6 +1217,29 @@ final class $vectortype$ extends $abstractvectortype$ { super.intoByteArray0Template(a, offset); // specialize } + @ForceInline + @Override + final + void intoByteArray0(byte[] a, int offset, VectorMask<$Boxtype$> m) { + super.intoByteArray0Template($masktype$.class, a, offset, ($masktype$) m); // specialize + } + + @ForceInline + @Override + final + void intoByteBuffer0(ByteBuffer bb, int offset, VectorMask<$Boxtype$> m) { + super.intoByteBuffer0Template($masktype$.class, bb, offset, ($masktype$) m); + } + +#if[short] + @ForceInline + @Override + final + void intoCharArray0(char[] a, int offset, VectorMask<$Boxtype$> m) { + super.intoCharArray0Template($masktype$.class, a, offset, ($masktype$) m); + } +#end[short] + // End of specialized low-level memory operations. // ================================================ diff --git a/src/jdk.incubator.vector/windows/native/libjsvml/globals_vectorApiSupport_windows.S.inc b/src/jdk.incubator.vector/windows/native/libjsvml/globals_vectorApiSupport_windows.S.inc index 837e0cc405d..f1d830b1e8c 100644 --- a/src/jdk.incubator.vector/windows/native/libjsvml/globals_vectorApiSupport_windows.S.inc +++ b/src/jdk.incubator.vector/windows/native/libjsvml/globals_vectorApiSupport_windows.S.inc @@ -19,9 +19,6 @@ ; or visit www.oracle.com if you need additional information or have any ; questions. -; This file contains duplicate entries as globalDefinitions_vecApi.hpp -; It is intended for inclusion in .s files compiled with masm - ; Used to check whether building on x86_64 architecture. Equivalent to checking in regular hpp file for #ifdef _WIN64 IFDEF RAX diff --git a/test/hotspot/gtest/aarch64/aarch64-asmtest.py b/test/hotspot/gtest/aarch64/aarch64-asmtest.py index daaa33d454f..a7df17b2129 100644 --- a/test/hotspot/gtest/aarch64/aarch64-asmtest.py +++ b/test/hotspot/gtest/aarch64/aarch64-asmtest.py @@ -1555,6 +1555,23 @@ generate(SpecialCases, [["ccmn", "__ ccmn(zr, zr, 3u, Assembler::LE);", ["asr", "__ sve_asr(z0, __ H, z11, 15);", "asr\tz0.h, z11.h, #15"], ["lsr", "__ sve_lsr(z30, __ S, z1, 31);", "lsr\tz30.s, z1.s, #31"], ["asr", "__ sve_asr(z0, __ D, z1, 63);", "asr\tz0.d, z1.d, #63"], + ["lsl", "__ sve_lsl(z0, __ B, p0, 0);", "lsl\tz0.b, p0/m, z0.b, #0"], + ["lsl", "__ sve_lsl(z0, __ B, p0, 5);", "lsl\tz0.b, p0/m, z0.b, #5"], + ["lsl", "__ sve_lsl(z1, __ H, p1, 15);", "lsl\tz1.h, p1/m, z1.h, #15"], + ["lsl", "__ sve_lsl(z2, __ S, p2, 31);", "lsl\tz2.s, p2/m, z2.s, #31"], + ["lsl", "__ sve_lsl(z3, __ D, p3, 63);", "lsl\tz3.d, p3/m, z3.d, #63"], + ["lsr", "__ sve_lsr(z0, __ B, p0, 1);", "lsr\tz0.b, p0/m, z0.b, #1"], + ["lsr", "__ sve_lsr(z0, __ B, p0, 8);", "lsr\tz0.b, p0/m, z0.b, #8"], + ["lsr", "__ sve_lsr(z1, __ H, p1, 15);", "lsr\tz1.h, p1/m, z1.h, #15"], + ["lsr", "__ sve_lsr(z2, __ S, p2, 7);", "lsr\tz2.s, p2/m, z2.s, #7"], + ["lsr", "__ sve_lsr(z2, __ S, p2, 31);", "lsr\tz2.s, p2/m, z2.s, #31"], + ["lsr", "__ sve_lsr(z3, __ D, p3, 63);", "lsr\tz3.d, p3/m, z3.d, #63"], + ["asr", "__ sve_asr(z0, __ B, p0, 1);", "asr\tz0.b, p0/m, z0.b, #1"], + ["asr", "__ sve_asr(z0, __ B, p0, 7);", "asr\tz0.b, p0/m, z0.b, #7"], + ["asr", "__ sve_asr(z1, __ H, p1, 5);", "asr\tz1.h, p1/m, z1.h, #5"], + ["asr", "__ sve_asr(z1, __ H, p1, 15);", "asr\tz1.h, p1/m, z1.h, #15"], + ["asr", "__ sve_asr(z2, __ S, p2, 31);", "asr\tz2.s, p2/m, z2.s, #31"], + ["asr", "__ sve_asr(z3, __ D, p3, 63);", "asr\tz3.d, p3/m, z3.d, #63"], ["addvl", "__ sve_addvl(sp, r0, 31);", "addvl\tsp, x0, #31"], ["addpl", "__ sve_addpl(r1, sp, -32);", "addpl\tx1, sp, -32"], ["cntp", "__ sve_cntp(r8, __ B, p0, p1);", "cntp\tx8, p0, p1.b"], @@ -1649,6 +1666,29 @@ generate(SpecialCases, [["ccmn", "__ ccmn(zr, zr, 3u, Assembler::LE);", ["ld1d", "__ sve_ld1d_gather(z15, p0, r5, z16);", "ld1d\t{z15.d}, p0/z, [x5, z16.d, uxtw #3]"], ["st1w", "__ sve_st1w_scatter(z15, p0, r5, z16);", "st1w\t{z15.s}, p0, [x5, z16.s, uxtw #2]"], ["st1d", "__ sve_st1d_scatter(z15, p0, r5, z16);", "st1d\t{z15.d}, p0, [x5, z16.d, uxtw #3]"], + ["and", "__ sve_and(p0, p1, p2, p3);", "and\tp0.b, p1/z, p2.b, p3.b"], + ["ands", "__ sve_ands(p4, p5, p6, p0);", "ands\tp4.b, p5/z, p6.b, p0.b"], + ["eor", "__ sve_eor(p0, p1, p2, p3);", "eor\tp0.b, p1/z, p2.b, p3.b"], + ["eors", "__ sve_eors(p5, p6, p0, p1);", "eors\tp5.b, p6/z, p0.b, p1.b"], + ["orr", "__ sve_orr(p0, p1, p2, p3);", "orr\tp0.b, p1/z, p2.b, p3.b"], + ["orrs", "__ sve_orrs(p9, p1, p4, p5);", "orrs\tp9.b, p1/z, p4.b, p5.b"], + ["bic", "__ sve_bic(p10, p7, p9, p11);", "bic\tp10.b, p7/z, p9.b, p11.b"], + ["ptest", "__ sve_ptest(p7, p1);", "ptest\tp7, p1.b"], + ["ptrue", "__ sve_ptrue(p1, __ B);", "ptrue\tp1.b"], + ["ptrue", "__ sve_ptrue(p2, __ H);", "ptrue\tp2.h"], + ["ptrue", "__ sve_ptrue(p3, __ S);", "ptrue\tp3.s"], + ["ptrue", "__ sve_ptrue(p4, __ D);", "ptrue\tp4.d"], + ["pfalse", "__ sve_pfalse(p7);", "pfalse\tp7.b"], + ["uzp1", "__ sve_uzp1(p0, __ B, p0, p1);", "uzp1\tp0.b, p0.b, p1.b"], + ["uzp1", "__ sve_uzp1(p0, __ H, p0, p1);", "uzp1\tp0.h, p0.h, p1.h"], + ["uzp1", "__ sve_uzp1(p0, __ S, p0, p1);", "uzp1\tp0.s, p0.s, p1.s"], + ["uzp1", "__ sve_uzp1(p0, __ D, p0, p1);", "uzp1\tp0.d, p0.d, p1.d"], + ["uzp2", "__ sve_uzp2(p0, __ B, p0, p1);", "uzp2\tp0.b, p0.b, p1.b"], + ["uzp2", "__ sve_uzp2(p0, __ H, p0, p1);", "uzp2\tp0.h, p0.h, p1.h"], + ["uzp2", "__ sve_uzp2(p0, __ S, p0, p1);", "uzp2\tp0.s, p0.s, p1.s"], + ["uzp2", "__ sve_uzp2(p0, __ D, p0, p1);", "uzp2\tp0.d, p0.d, p1.d"], + ["punpklo", "__ sve_punpklo(p1, p0);", "punpklo\tp1.h, p0.b"], + ["punpkhi", "__ sve_punpkhi(p1, p0);", "punpkhi\tp1.h, p0.b"], ]) print "\n// FloatImmediateOp" @@ -1686,13 +1726,16 @@ generate(SVEVectorOp, [["add", "ZZZ"], ["fsub", "ZZZ"], ["abs", "ZPZ", "m"], ["add", "ZPZ", "m", "dn"], + ["and", "ZPZ", "m", "dn"], ["asr", "ZPZ", "m", "dn"], ["cnt", "ZPZ", "m"], + ["eor", "ZPZ", "m", "dn"], ["lsl", "ZPZ", "m", "dn"], ["lsr", "ZPZ", "m", "dn"], ["mul", "ZPZ", "m", "dn"], ["neg", "ZPZ", "m"], ["not", "ZPZ", "m"], + ["orr", "ZPZ", "m", "dn"], ["smax", "ZPZ", "m", "dn"], ["smin", "ZPZ", "m", "dn"], ["sub", "ZPZ", "m", "dn"], @@ -1708,6 +1751,7 @@ generate(SVEVectorOp, [["add", "ZZZ"], ["frintp", "ZPZ", "m"], ["fsqrt", "ZPZ", "m"], ["fsub", "ZPZ", "m", "dn"], + ["fmad", "ZPZZ", "m"], ["fmla", "ZPZZ", "m"], ["fmls", "ZPZZ", "m"], ["fnmla", "ZPZZ", "m"], diff --git a/test/hotspot/gtest/aarch64/asmtest.out.h b/test/hotspot/gtest/aarch64/asmtest.out.h index 2ddb3da5edc..85aca7268f4 100644 --- a/test/hotspot/gtest/aarch64/asmtest.out.h +++ b/test/hotspot/gtest/aarch64/asmtest.out.h @@ -744,6 +744,23 @@ __ sve_asr(z0, __ H, z11, 15); // asr z0.h, z11.h, #15 __ sve_lsr(z30, __ S, z1, 31); // lsr z30.s, z1.s, #31 __ sve_asr(z0, __ D, z1, 63); // asr z0.d, z1.d, #63 + __ sve_lsl(z0, __ B, p0, 0); // lsl z0.b, p0/m, z0.b, #0 + __ sve_lsl(z0, __ B, p0, 5); // lsl z0.b, p0/m, z0.b, #5 + __ sve_lsl(z1, __ H, p1, 15); // lsl z1.h, p1/m, z1.h, #15 + __ sve_lsl(z2, __ S, p2, 31); // lsl z2.s, p2/m, z2.s, #31 + __ sve_lsl(z3, __ D, p3, 63); // lsl z3.d, p3/m, z3.d, #63 + __ sve_lsr(z0, __ B, p0, 1); // lsr z0.b, p0/m, z0.b, #1 + __ sve_lsr(z0, __ B, p0, 8); // lsr z0.b, p0/m, z0.b, #8 + __ sve_lsr(z1, __ H, p1, 15); // lsr z1.h, p1/m, z1.h, #15 + __ sve_lsr(z2, __ S, p2, 7); // lsr z2.s, p2/m, z2.s, #7 + __ sve_lsr(z2, __ S, p2, 31); // lsr z2.s, p2/m, z2.s, #31 + __ sve_lsr(z3, __ D, p3, 63); // lsr z3.d, p3/m, z3.d, #63 + __ sve_asr(z0, __ B, p0, 1); // asr z0.b, p0/m, z0.b, #1 + __ sve_asr(z0, __ B, p0, 7); // asr z0.b, p0/m, z0.b, #7 + __ sve_asr(z1, __ H, p1, 5); // asr z1.h, p1/m, z1.h, #5 + __ sve_asr(z1, __ H, p1, 15); // asr z1.h, p1/m, z1.h, #15 + __ sve_asr(z2, __ S, p2, 31); // asr z2.s, p2/m, z2.s, #31 + __ sve_asr(z3, __ D, p3, 63); // asr z3.d, p3/m, z3.d, #63 __ sve_addvl(sp, r0, 31); // addvl sp, x0, #31 __ sve_addpl(r1, sp, -32); // addpl x1, sp, -32 __ sve_cntp(r8, __ B, p0, p1); // cntp x8, p0, p1.b @@ -838,6 +855,29 @@ __ sve_ld1d_gather(z15, p0, r5, z16); // ld1d {z15.d}, p0/z, [x5, z16.d, uxtw #3] __ sve_st1w_scatter(z15, p0, r5, z16); // st1w {z15.s}, p0, [x5, z16.s, uxtw #2] __ sve_st1d_scatter(z15, p0, r5, z16); // st1d {z15.d}, p0, [x5, z16.d, uxtw #3] + __ sve_and(p0, p1, p2, p3); // and p0.b, p1/z, p2.b, p3.b + __ sve_ands(p4, p5, p6, p0); // ands p4.b, p5/z, p6.b, p0.b + __ sve_eor(p0, p1, p2, p3); // eor p0.b, p1/z, p2.b, p3.b + __ sve_eors(p5, p6, p0, p1); // eors p5.b, p6/z, p0.b, p1.b + __ sve_orr(p0, p1, p2, p3); // orr p0.b, p1/z, p2.b, p3.b + __ sve_orrs(p9, p1, p4, p5); // orrs p9.b, p1/z, p4.b, p5.b + __ sve_bic(p10, p7, p9, p11); // bic p10.b, p7/z, p9.b, p11.b + __ sve_ptest(p7, p1); // ptest p7, p1.b + __ sve_ptrue(p1, __ B); // ptrue p1.b + __ sve_ptrue(p2, __ H); // ptrue p2.h + __ sve_ptrue(p3, __ S); // ptrue p3.s + __ sve_ptrue(p4, __ D); // ptrue p4.d + __ sve_pfalse(p7); // pfalse p7.b + __ sve_uzp1(p0, __ B, p0, p1); // uzp1 p0.b, p0.b, p1.b + __ sve_uzp1(p0, __ H, p0, p1); // uzp1 p0.h, p0.h, p1.h + __ sve_uzp1(p0, __ S, p0, p1); // uzp1 p0.s, p0.s, p1.s + __ sve_uzp1(p0, __ D, p0, p1); // uzp1 p0.d, p0.d, p1.d + __ sve_uzp2(p0, __ B, p0, p1); // uzp2 p0.b, p0.b, p1.b + __ sve_uzp2(p0, __ H, p0, p1); // uzp2 p0.h, p0.h, p1.h + __ sve_uzp2(p0, __ S, p0, p1); // uzp2 p0.s, p0.s, p1.s + __ sve_uzp2(p0, __ D, p0, p1); // uzp2 p0.d, p0.d, p1.d + __ sve_punpklo(p1, p0); // punpklo p1.h, p0.b + __ sve_punpkhi(p1, p0); // punpkhi p1.h, p0.b // FloatImmediateOp __ fmovd(v0, 2.0); // fmov d0, #2.0 @@ -981,51 +1021,55 @@ __ sve_fsub(z5, __ D, z10, z8); // fsub z5.d, z10.d, z8.d __ sve_abs(z30, __ B, p1, z17); // abs z30.b, p1/m, z17.b __ sve_add(z11, __ B, p7, z28); // add z11.b, p7/m, z11.b, z28.b - __ sve_asr(z26, __ H, p5, z28); // asr z26.h, p5/m, z26.h, z28.h - __ sve_cnt(z13, __ D, p7, z16); // cnt z13.d, p7/m, z16.d - __ sve_lsl(z5, __ H, p0, z13); // lsl z5.h, p0/m, z5.h, z13.h - __ sve_lsr(z15, __ S, p2, z26); // lsr z15.s, p2/m, z15.s, z26.s - __ sve_mul(z11, __ S, p1, z22); // mul z11.s, p1/m, z11.s, z22.s - __ sve_neg(z4, __ S, p0, z19); // neg z4.s, p0/m, z19.s - __ sve_not(z17, __ H, p3, z14); // not z17.h, p3/m, z14.h - __ sve_smax(z2, __ S, p4, z3); // smax z2.s, p4/m, z2.s, z3.s - __ sve_smin(z23, __ B, p1, z6); // smin z23.b, p1/m, z23.b, z6.b - __ sve_sub(z17, __ S, p3, z27); // sub z17.s, p3/m, z17.s, z27.s - __ sve_fabs(z16, __ D, p1, z2); // fabs z16.d, p1/m, z2.d - __ sve_fadd(z3, __ D, p1, z6); // fadd z3.d, p1/m, z3.d, z6.d - __ sve_fdiv(z19, __ D, p3, z12); // fdiv z19.d, p3/m, z19.d, z12.d - __ sve_fmax(z8, __ D, p6, z19); // fmax z8.d, p6/m, z8.d, z19.d - __ sve_fmin(z0, __ S, p2, z23); // fmin z0.s, p2/m, z0.s, z23.s - __ sve_fmul(z19, __ D, p7, z13); // fmul z19.d, p7/m, z19.d, z13.d - __ sve_fneg(z6, __ S, p0, z7); // fneg z6.s, p0/m, z7.s - __ sve_frintm(z17, __ S, p6, z8); // frintm z17.s, p6/m, z8.s - __ sve_frintn(z22, __ D, p5, z22); // frintn z22.d, p5/m, z22.d - __ sve_frintp(z2, __ D, p0, z15); // frintp z2.d, p0/m, z15.d - __ sve_fsqrt(z20, __ D, p1, z4); // fsqrt z20.d, p1/m, z4.d - __ sve_fsub(z7, __ D, p0, z8); // fsub z7.d, p0/m, z7.d, z8.d - __ sve_fmla(z19, __ S, p5, z4, z15); // fmla z19.s, p5/m, z4.s, z15.s - __ sve_fmls(z22, __ D, p2, z25, z5); // fmls z22.d, p2/m, z25.d, z5.d - __ sve_fnmla(z16, __ S, p3, z22, z11); // fnmla z16.s, p3/m, z22.s, z11.s - __ sve_fnmls(z13, __ D, p2, z20, z16); // fnmls z13.d, p2/m, z20.d, z16.d - __ sve_mla(z15, __ H, p1, z4, z17); // mla z15.h, p1/m, z4.h, z17.h - __ sve_mls(z6, __ S, p7, z4, z28); // mls z6.s, p7/m, z4.s, z28.s - __ sve_and(z29, z26, z9); // and z29.d, z26.d, z9.d - __ sve_eor(z2, z11, z28); // eor z2.d, z11.d, z28.d - __ sve_orr(z7, z1, z26); // orr z7.d, z1.d, z26.d - __ sve_bic(z17, z14, z8); // bic z17.d, z14.d, z8.d - __ sve_uzp1(z21, __ S, z24, z5); // uzp1 z21.s, z24.s, z5.s - __ sve_uzp2(z21, __ S, z17, z22); // uzp2 z21.s, z17.s, z22.s + __ sve_and(z26, __ H, p5, z28); // and z26.h, p5/m, z26.h, z28.h + __ sve_asr(z13, __ D, p7, z16); // asr z13.d, p7/m, z13.d, z16.d + __ sve_cnt(z5, __ H, p0, z13); // cnt z5.h, p0/m, z13.h + __ sve_eor(z15, __ S, p2, z26); // eor z15.s, p2/m, z15.s, z26.s + __ sve_lsl(z11, __ S, p1, z22); // lsl z11.s, p1/m, z11.s, z22.s + __ sve_lsr(z4, __ S, p0, z19); // lsr z4.s, p0/m, z4.s, z19.s + __ sve_mul(z17, __ H, p3, z14); // mul z17.h, p3/m, z17.h, z14.h + __ sve_neg(z2, __ S, p4, z3); // neg z2.s, p4/m, z3.s + __ sve_not(z23, __ B, p1, z6); // not z23.b, p1/m, z6.b + __ sve_orr(z17, __ S, p3, z27); // orr z17.s, p3/m, z17.s, z27.s + __ sve_smax(z16, __ D, p1, z2); // smax z16.d, p1/m, z16.d, z2.d + __ sve_smin(z3, __ S, p1, z6); // smin z3.s, p1/m, z3.s, z6.s + __ sve_sub(z19, __ S, p3, z12); // sub z19.s, p3/m, z19.s, z12.s + __ sve_fabs(z8, __ D, p6, z19); // fabs z8.d, p6/m, z19.d + __ sve_fadd(z0, __ S, p2, z23); // fadd z0.s, p2/m, z0.s, z23.s + __ sve_fdiv(z19, __ D, p7, z13); // fdiv z19.d, p7/m, z19.d, z13.d + __ sve_fmax(z6, __ S, p0, z7); // fmax z6.s, p0/m, z6.s, z7.s + __ sve_fmin(z17, __ S, p6, z8); // fmin z17.s, p6/m, z17.s, z8.s + __ sve_fmul(z22, __ D, p5, z22); // fmul z22.d, p5/m, z22.d, z22.d + __ sve_fneg(z2, __ D, p0, z15); // fneg z2.d, p0/m, z15.d + __ sve_frintm(z20, __ D, p1, z4); // frintm z20.d, p1/m, z4.d + __ sve_frintn(z7, __ D, p0, z8); // frintn z7.d, p0/m, z8.d + __ sve_frintp(z19, __ D, p5, z4); // frintp z19.d, p5/m, z4.d + __ sve_fsqrt(z9, __ D, p5, z11); // fsqrt z9.d, p5/m, z11.d + __ sve_fsub(z5, __ S, p7, z16); // fsub z5.s, p7/m, z5.s, z16.s + __ sve_fmad(z22, __ S, p3, z1, z13); // fmad z22.s, p3/m, z1.s, z13.s + __ sve_fmla(z20, __ S, p4, z25, z15); // fmla z20.s, p4/m, z25.s, z15.s + __ sve_fmls(z4, __ D, p4, z8, z6); // fmls z4.d, p4/m, z8.d, z6.d + __ sve_fnmla(z4, __ D, p7, z16, z29); // fnmla z4.d, p7/m, z16.d, z29.d + __ sve_fnmls(z9, __ D, p3, z2, z11); // fnmls z9.d, p3/m, z2.d, z11.d + __ sve_mla(z3, __ S, p1, z1, z26); // mla z3.s, p1/m, z1.s, z26.s + __ sve_mls(z17, __ S, p3, z8, z17); // mls z17.s, p3/m, z8.s, z17.s + __ sve_and(z24, z5, z19); // and z24.d, z5.d, z19.d + __ sve_eor(z17, z22, z16); // eor z17.d, z22.d, z16.d + __ sve_orr(z20, z19, z0); // orr z20.d, z19.d, z0.d + __ sve_bic(z17, z23, z4); // bic z17.d, z23.d, z4.d + __ sve_uzp1(z4, __ S, z23, z25); // uzp1 z4.s, z23.s, z25.s + __ sve_uzp2(z2, __ H, z8, z8); // uzp2 z2.h, z8.h, z8.h // SVEReductionOp - __ sve_andv(v29, __ B, p5, z19); // andv b29, p5, z19.b - __ sve_orv(v4, __ B, p4, z23); // orv b4, p4, z23.b - __ sve_eorv(v19, __ D, p1, z23); // eorv d19, p1, z23.d - __ sve_smaxv(v19, __ H, p0, z8); // smaxv h19, p0, z8.h - __ sve_sminv(v14, __ D, p6, z17); // sminv d14, p6, z17.d - __ sve_fminv(v21, __ S, p1, z30); // fminv s21, p1, z30.s - __ sve_fmaxv(v10, __ S, p5, z12); // fmaxv s10, p5, z12.s - __ sve_fadda(v9, __ D, p1, z24); // fadda d9, p1, d9, z24.d - __ sve_uaddv(v4, __ H, p6, z6); // uaddv d4, p6, z6.h + __ sve_andv(v24, __ S, p4, z30); // andv s24, p4, z30.s + __ sve_orv(v4, __ H, p7, z1); // orv h4, p7, z1.h + __ sve_eorv(v19, __ H, p3, z0); // eorv h19, p3, z0.h + __ sve_smaxv(v7, __ B, p6, z17); // smaxv b7, p6, z17.b + __ sve_sminv(v27, __ D, p1, z9); // sminv d27, p1, z9.d + __ sve_fminv(v23, __ D, p3, z16); // fminv d23, p3, z16.d + __ sve_fmaxv(v22, __ D, p5, z20); // fmaxv d22, p5, z20.d + __ sve_fadda(v28, __ D, p2, z13); // fadda d28, p2, d28, z13.d + __ sve_uaddv(v7, __ H, p5, z28); // uaddv d7, p5, z28.h __ bind(forth); @@ -1044,30 +1088,30 @@ 0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061, 0x120cb166, 0x321764bc, 0x52174681, 0x720c0227, 0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01, - 0x14000000, 0x17ffffd7, 0x1400034e, 0x94000000, - 0x97ffffd4, 0x9400034b, 0x3400000a, 0x34fffa2a, - 0x3400690a, 0x35000008, 0x35fff9c8, 0x350068a8, - 0xb400000b, 0xb4fff96b, 0xb400684b, 0xb500001d, - 0xb5fff91d, 0xb50067fd, 0x10000013, 0x10fff8b3, - 0x10006793, 0x90000013, 0x36300016, 0x3637f836, - 0x36306716, 0x3758000c, 0x375ff7cc, 0x375866ac, + 0x14000000, 0x17ffffd7, 0x1400037a, 0x94000000, + 0x97ffffd4, 0x94000377, 0x3400000a, 0x34fffa2a, + 0x34006e8a, 0x35000008, 0x35fff9c8, 0x35006e28, + 0xb400000b, 0xb4fff96b, 0xb4006dcb, 0xb500001d, + 0xb5fff91d, 0xb5006d7d, 0x10000013, 0x10fff8b3, + 0x10006d13, 0x90000013, 0x36300016, 0x3637f836, + 0x36306c96, 0x3758000c, 0x375ff7cc, 0x37586c2c, 0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc, 0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f, 0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016, 0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0, - 0x54006480, 0x54000001, 0x54fff541, 0x54006421, - 0x54000002, 0x54fff4e2, 0x540063c2, 0x54000002, - 0x54fff482, 0x54006362, 0x54000003, 0x54fff423, - 0x54006303, 0x54000003, 0x54fff3c3, 0x540062a3, - 0x54000004, 0x54fff364, 0x54006244, 0x54000005, - 0x54fff305, 0x540061e5, 0x54000006, 0x54fff2a6, - 0x54006186, 0x54000007, 0x54fff247, 0x54006127, - 0x54000008, 0x54fff1e8, 0x540060c8, 0x54000009, - 0x54fff189, 0x54006069, 0x5400000a, 0x54fff12a, - 0x5400600a, 0x5400000b, 0x54fff0cb, 0x54005fab, - 0x5400000c, 0x54fff06c, 0x54005f4c, 0x5400000d, - 0x54fff00d, 0x54005eed, 0x5400000e, 0x54ffefae, - 0x54005e8e, 0x5400000f, 0x54ffef4f, 0x54005e2f, + 0x54006a00, 0x54000001, 0x54fff541, 0x540069a1, + 0x54000002, 0x54fff4e2, 0x54006942, 0x54000002, + 0x54fff482, 0x540068e2, 0x54000003, 0x54fff423, + 0x54006883, 0x54000003, 0x54fff3c3, 0x54006823, + 0x54000004, 0x54fff364, 0x540067c4, 0x54000005, + 0x54fff305, 0x54006765, 0x54000006, 0x54fff2a6, + 0x54006706, 0x54000007, 0x54fff247, 0x540066a7, + 0x54000008, 0x54fff1e8, 0x54006648, 0x54000009, + 0x54fff189, 0x540065e9, 0x5400000a, 0x54fff12a, + 0x5400658a, 0x5400000b, 0x54fff0cb, 0x5400652b, + 0x5400000c, 0x54fff06c, 0x540064cc, 0x5400000d, + 0x54fff00d, 0x5400646d, 0x5400000e, 0x54ffefae, + 0x5400640e, 0x5400000f, 0x54ffef4f, 0x540063af, 0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60, 0xd44cad80, 0xd503201f, 0xd69f03e0, 0xd6bf03e0, 0xd5033fdf, 0xd5033e9f, 0xd50332bf, 0xd61f0200, @@ -1099,7 +1143,7 @@ 0x791f226d, 0xf95aa2f3, 0xb9587bb7, 0x395f7176, 0x795d9143, 0x399e7e08, 0x799a2697, 0x79df3422, 0xb99c2624, 0xfd5c2374, 0xbd5fa1d9, 0xfd1d595a, - 0xbd1b1869, 0x58004e7b, 0x1800000b, 0xf8945060, + 0xbd1b1869, 0x580053fb, 0x1800000b, 0xf8945060, 0xd8000000, 0xf8ae6ba0, 0xf99a0080, 0x1a070035, 0x3a0700a8, 0x5a0e0367, 0x7a11009b, 0x9a000380, 0xba1e030c, 0xda0f0320, 0xfa030301, 0x0b340b11, @@ -1192,30 +1236,40 @@ 0x05101fea, 0x05901feb, 0x04b0e3e0, 0x0470e7e1, 0x042f9c20, 0x043f9c35, 0x047f9c20, 0x04ff9c20, 0x04299420, 0x04319160, 0x0461943e, 0x04a19020, - 0x042053ff, 0x047f5401, 0x25208028, 0x2538cfe0, - 0x2578d001, 0x25b8efe2, 0x25f8f007, 0x2538dfea, - 0x25b8dfeb, 0xa400a3e0, 0xa420a7e0, 0xa4484be0, - 0xa467afe0, 0xa4a8a7ea, 0xa547a814, 0xa4084ffe, - 0xa55c53e0, 0xa5e1540b, 0xe400fbf6, 0xe408ffff, - 0xe420e7e0, 0xe4484be0, 0xe460efe0, 0xe547e400, - 0xe4014be0, 0xe4a84fe0, 0xe5f15000, 0x858043e0, - 0x85a043ff, 0xe59f5d08, 0x0420e3e9, 0x0460e3ea, - 0x04a0e3eb, 0x04e0e3ec, 0x25104042, 0x25104871, - 0x25904861, 0x25904c92, 0x05344020, 0x05744041, - 0x05b44062, 0x05f44083, 0x252c8840, 0x253c1420, - 0x25681572, 0x25a21ce3, 0x25ea1e34, 0x0522c020, - 0x05e6c0a4, 0x2401a001, 0x2443a051, 0x24858881, - 0x24c78cd1, 0x24850891, 0x24c70cc1, 0x250f9001, - 0x25508051, 0x25802491, 0x25df28c1, 0x25850c81, - 0x251e10d1, 0x65816001, 0x65c36051, 0x65854891, - 0x65c74cc1, 0x05733820, 0x05b238a4, 0x05f138e6, - 0x0570396a, 0x65d0a001, 0x65d6a443, 0x65d4a826, - 0x6594ac26, 0x6554ac26, 0x6556ac26, 0x6552ac26, - 0x65cbac85, 0x65caac01, 0x65dea833, 0x659ca509, - 0x65d8a801, 0x65dcac01, 0x655cb241, 0x0520a1e0, - 0x0521a601, 0x052281e0, 0x05238601, 0x04a14026, - 0x0568aca7, 0x05b23230, 0x853040af, 0xc5b040af, - 0xe57080af, 0xe5b080af, 0x1e601000, 0x1e603000, + 0x04038100, 0x040381a0, 0x040387e1, 0x04438be2, + 0x04c38fe3, 0x040181e0, 0x04018100, 0x04018621, + 0x04418b22, 0x04418822, 0x04818c23, 0x040081e0, + 0x04008120, 0x04008761, 0x04008621, 0x04408822, + 0x04808c23, 0x042053ff, 0x047f5401, 0x25208028, + 0x2538cfe0, 0x2578d001, 0x25b8efe2, 0x25f8f007, + 0x2538dfea, 0x25b8dfeb, 0xa400a3e0, 0xa420a7e0, + 0xa4484be0, 0xa467afe0, 0xa4a8a7ea, 0xa547a814, + 0xa4084ffe, 0xa55c53e0, 0xa5e1540b, 0xe400fbf6, + 0xe408ffff, 0xe420e7e0, 0xe4484be0, 0xe460efe0, + 0xe547e400, 0xe4014be0, 0xe4a84fe0, 0xe5f15000, + 0x858043e0, 0x85a043ff, 0xe59f5d08, 0x0420e3e9, + 0x0460e3ea, 0x04a0e3eb, 0x04e0e3ec, 0x25104042, + 0x25104871, 0x25904861, 0x25904c92, 0x05344020, + 0x05744041, 0x05b44062, 0x05f44083, 0x252c8840, + 0x253c1420, 0x25681572, 0x25a21ce3, 0x25ea1e34, + 0x0522c020, 0x05e6c0a4, 0x2401a001, 0x2443a051, + 0x24858881, 0x24c78cd1, 0x24850891, 0x24c70cc1, + 0x250f9001, 0x25508051, 0x25802491, 0x25df28c1, + 0x25850c81, 0x251e10d1, 0x65816001, 0x65c36051, + 0x65854891, 0x65c74cc1, 0x05733820, 0x05b238a4, + 0x05f138e6, 0x0570396a, 0x65d0a001, 0x65d6a443, + 0x65d4a826, 0x6594ac26, 0x6554ac26, 0x6556ac26, + 0x6552ac26, 0x65cbac85, 0x65caac01, 0x65dea833, + 0x659ca509, 0x65d8a801, 0x65dcac01, 0x655cb241, + 0x0520a1e0, 0x0521a601, 0x052281e0, 0x05238601, + 0x04a14026, 0x0568aca7, 0x05b23230, 0x853040af, + 0xc5b040af, 0xe57080af, 0xe5b080af, 0x25034440, + 0x254054c4, 0x25034640, 0x25415a05, 0x25834440, + 0x25c54489, 0x250b5d3a, 0x2550dc20, 0x2518e3e1, + 0x2558e3e2, 0x2598e3e3, 0x25d8e3e4, 0x2518e407, + 0x05214800, 0x05614800, 0x05a14800, 0x05e14800, + 0x05214c00, 0x05614c00, 0x05a14c00, 0x05e14c00, + 0x05304001, 0x05314001, 0x1e601000, 0x1e603000, 0x1e621000, 0x1e623000, 0x1e641000, 0x1e643000, 0x1e661000, 0x1e663000, 0x1e681000, 0x1e683000, 0x1e6a1000, 0x1e6a3000, 0x1e6c1000, 0x1e6c3000, @@ -1245,17 +1299,18 @@ 0xce7e8e9b, 0xce808b45, 0xce79806e, 0xce758768, 0xcec0835a, 0xce608ad8, 0x043100c4, 0x046105e3, 0x65c900a6, 0x65d60a87, 0x65c80545, 0x0416a63e, - 0x04001f8b, 0x0450979a, 0x04dabe0d, 0x045381a5, - 0x04918b4f, 0x049006cb, 0x0497a264, 0x045eadd1, - 0x04881062, 0x040a04d7, 0x04810f71, 0x04dca450, - 0x65c084c3, 0x65cd8d93, 0x65c69a68, 0x65878ae0, - 0x65c29db3, 0x049da0e6, 0x6582b911, 0x65c0b6d6, - 0x65c1a1e2, 0x65cda494, 0x65c18107, 0x65af1493, - 0x65e52b36, 0x65ab4ed0, 0x65f06a8d, 0x0451448f, - 0x049c7c86, 0x0429335d, 0x04bc3162, 0x047a3027, - 0x04e831d1, 0x05a56b15, 0x05b66e35, 0x041a367d, - 0x041832e4, 0x04d926f3, 0x04482113, 0x04ca3a2e, - 0x658727d5, 0x6586358a, 0x65d82709, 0x044138c4, + 0x04001f8b, 0x045a179a, 0x04d09e0d, 0x045aa1a5, + 0x04990b4f, 0x049386cb, 0x04918264, 0x04500dd1, + 0x0497b062, 0x041ea4d7, 0x04980f71, 0x04c80450, + 0x048a04c3, 0x04810d93, 0x04dcba68, 0x65808ae0, + 0x65cd9db3, 0x658680e6, 0x65879911, 0x65c296d6, + 0x04dda1e2, 0x65c2a494, 0x65c0a107, 0x65c1b493, + 0x65cdb569, 0x65819e05, 0x65ad8c36, 0x65af1334, + 0x65e63104, 0x65fd5e04, 0x65eb6c49, 0x049a4423, + 0x04916d11, 0x043330b8, 0x04b032d1, 0x04603274, + 0x04e432f1, 0x05b96ae4, 0x05686d02, 0x049a33d8, + 0x04583c24, 0x04592c13, 0x04083a27, 0x04ca253b, + 0x65c72e17, 0x65c63696, 0x65d829bc, 0x04413787, }; // END Generated code -- do not edit diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorMaskCastTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorMaskCastTest.java new file mode 100644 index 00000000000..e60d1ebf7f3 --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorMaskCastTest.java @@ -0,0 +1,468 @@ +/* + * Copyright (c) 2021, Arm Limited. All rights reserved. + * 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.vectorapi; + +import java.util.Random; + +import jdk.incubator.vector.ByteVector; +import jdk.incubator.vector.DoubleVector; +import jdk.incubator.vector.FloatVector; +import jdk.incubator.vector.IntVector; +import jdk.incubator.vector.LongVector; +import jdk.incubator.vector.ShortVector; +import jdk.incubator.vector.VectorMask; +import jdk.test.lib.Utils; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @test + * @bug 8273264 + * @key randomness + * @library /test/lib + * @summary AArch64: [vector] Add missing rules for VectorMaskCast + * @modules jdk.incubator.vector + * + * @run testng/othervm -XX:-TieredCompilation -XX:CompileThreshold=100 compiler.vectorapi.VectorMaskCastTest + */ + + +// Current vector mask cast test cases at test/jdk/jdk/incubator/vector/*ConversionTests.java +// could not be intrinsfied, hence not able to verify compiler codegen, see [1]. As a +// supplement, we add more tests for vector mask cast operations, which could be intrinsified +// by c2 compiler to generate vector/mask instructions on supported targets. +// +// [1] https://bugs.openjdk.java.net/browse/JDK-8259610 + +public class VectorMaskCastTest{ + + private static final int NUM_ITER = 5000; + private static final Random rd = Utils.getRandomInstance(); + + public static boolean[] genMask() { + boolean[] mask = new boolean[64]; + for (int i = 0; i < 64; i ++) { + mask[i] = rd.nextBoolean(); + } + return mask; + } + + // Byte + private static void testByte64ToShort128(boolean[] mask_arr) { + VectorMask mByte64 = VectorMask.fromArray(ByteVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mByte64.cast(ShortVector.SPECIES_128).toString(), mByte64.toString()); + } + + private static void testByte64ToInt256(boolean[] mask_arr) { + VectorMask mByte64 = VectorMask.fromArray(ByteVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mByte64.cast(IntVector.SPECIES_256).toString(), mByte64.toString()); + } + + private static void testByte64ToFloat256(boolean[] mask_arr) { + VectorMask mByte64 = VectorMask.fromArray(ByteVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mByte64.cast(FloatVector.SPECIES_256).toString(), mByte64.toString()); + } + + private static void testByte64ToLong512(boolean[] mask_arr) { + VectorMask mByte64 = VectorMask.fromArray(ByteVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mByte64.cast(LongVector.SPECIES_512).toString(), mByte64.toString()); + } + + private static void testByte64ToDouble512(boolean[] mask_arr) { + VectorMask mByte64 = VectorMask.fromArray(ByteVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mByte64.cast(DoubleVector.SPECIES_512).toString(), mByte64.toString()); + } + + private static void testByte128ToShort256(boolean[] mask_arr) { + VectorMask mByte128 = VectorMask.fromArray(ByteVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mByte128.cast(ShortVector.SPECIES_256).toString(), mByte128.toString()); + } + + private static void testByte128ToInt512(boolean[] mask_arr) { + VectorMask mByte128 = VectorMask.fromArray(ByteVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mByte128.cast(IntVector.SPECIES_512).toString(), mByte128.toString()); + } + + private static void testByte128ToFloat512(boolean[] mask_arr) { + VectorMask mByte128 = VectorMask.fromArray(ByteVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mByte128.cast(FloatVector.SPECIES_512).toString(), mByte128.toString()); + } + + private static void testByte256ToShort512(boolean[] mask_arr) { + VectorMask mByte256 = VectorMask.fromArray(ByteVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mByte256.cast(ShortVector.SPECIES_512).toString(), mByte256.toString()); + } + + // Short + private static void testShort64ToInt128(boolean[] mask_arr) { + VectorMask mShort64 = VectorMask.fromArray(ShortVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mShort64.cast(IntVector.SPECIES_128).toString(), mShort64.toString()); + } + + private static void testShort64ToFloat128(boolean[] mask_arr) { + VectorMask mShort64 = VectorMask.fromArray(ShortVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mShort64.cast(FloatVector.SPECIES_128).toString(), mShort64.toString()); + } + + private static void testShort64ToLong256(boolean[] mask_arr) { + VectorMask mShort64 = VectorMask.fromArray(ShortVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mShort64.cast(LongVector.SPECIES_256).toString(), mShort64.toString()); + } + + private static void testShort64ToDouble256(boolean[] mask_arr) { + VectorMask mShort64 = VectorMask.fromArray(ShortVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mShort64.cast(DoubleVector.SPECIES_256).toString(), mShort64.toString()); + } + + private static void testShort128ToByte64(boolean[] mask_arr) { + VectorMask mShort128 = VectorMask.fromArray(ShortVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mShort128.cast(ByteVector.SPECIES_64).toString(), mShort128.toString()); + } + + private static void testShort128ToInt256(boolean[] mask_arr) { + VectorMask mShort128 = VectorMask.fromArray(ShortVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mShort128.cast(IntVector.SPECIES_256).toString(), mShort128.toString()); + } + + private static void testShort128ToFloat256(boolean[] mask_arr) { + VectorMask mShort128 = VectorMask.fromArray(ShortVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mShort128.cast(FloatVector.SPECIES_256).toString(), mShort128.toString()); + } + + private static void testShort128ToLong512(boolean[] mask_arr) { + VectorMask mShort128 = VectorMask.fromArray(ShortVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mShort128.cast(LongVector.SPECIES_512).toString(), mShort128.toString()); + } + + private static void testShort128ToDouble512(boolean[] mask_arr) { + VectorMask mShort128 = VectorMask.fromArray(ShortVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mShort128.cast(DoubleVector.SPECIES_512).toString(), mShort128.toString()); + } + + private static void testShort256ToByte128(boolean[] mask_arr) { + VectorMask mShort256 = VectorMask.fromArray(ShortVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mShort256.cast(ByteVector.SPECIES_128).toString(), mShort256.toString()); + } + + private static void testShort256ToInt512(boolean[] mask_arr) { + VectorMask mShort256 = VectorMask.fromArray(ShortVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mShort256.cast(IntVector.SPECIES_512).toString(), mShort256.toString()); + } + + private static void testShort256ToFloat512(boolean[] mask_arr) { + VectorMask mShort256 = VectorMask.fromArray(ShortVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mShort256.cast(FloatVector.SPECIES_512).toString(), mShort256.toString()); + } + + private static void testShort512ToByte256(boolean[] mask_arr) { + VectorMask mShort512 = VectorMask.fromArray(ShortVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mShort512.cast(ByteVector.SPECIES_256).toString(), mShort512.toString()); + } + + // Int + private static void testInt64ToLong128(boolean[] mask_arr) { + VectorMask mInt64 = VectorMask.fromArray(IntVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mInt64.cast(LongVector.SPECIES_128).toString(), mInt64.toString()); + } + + private static void testInt64ToDouble128(boolean[] mask_arr) { + VectorMask mInt64 = VectorMask.fromArray(IntVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mInt64.cast(DoubleVector.SPECIES_128).toString(), mInt64.toString()); + } + + private static void testInt128ToShort64(boolean[] mask_arr) { + VectorMask mInt128 = VectorMask.fromArray(IntVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mInt128.cast(ShortVector.SPECIES_64).toString(), mInt128.toString()); + } + + private static void testInt128ToLong256(boolean[] mask_arr) { + VectorMask mInt128 = VectorMask.fromArray(IntVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mInt128.cast(LongVector.SPECIES_256).toString(), mInt128.toString()); + } + + private static void testInt128ToDouble256(boolean[] mask_arr) { + VectorMask mInt128 = VectorMask.fromArray(IntVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mInt128.cast(DoubleVector.SPECIES_256).toString(), mInt128.toString()); + } + + private static void testInt256ToShort128(boolean[] mask_arr) { + VectorMask mInt256 = VectorMask.fromArray(IntVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mInt256.cast(ShortVector.SPECIES_128).toString(), mInt256.toString()); + } + + private static void testInt256ToByte64(boolean[] mask_arr) { + VectorMask mInt256 = VectorMask.fromArray(IntVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mInt256.cast(ByteVector.SPECIES_64).toString(), mInt256.toString()); + } + + private static void testInt256ToLong512(boolean[] mask_arr) { + VectorMask mInt256 = VectorMask.fromArray(IntVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mInt256.cast(LongVector.SPECIES_512).toString(), mInt256.toString()); + } + + private static void testInt256ToDouble512(boolean[] mask_arr) { + VectorMask mInt256 = VectorMask.fromArray(IntVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mInt256.cast(DoubleVector.SPECIES_512).toString(), mInt256.toString()); + } + + private static void testInt512ToShort256(boolean[] mask_arr) { + VectorMask mInt512 = VectorMask.fromArray(IntVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mInt512.cast(ShortVector.SPECIES_256).toString(), mInt512.toString()); + } + + private static void testInt512ToByte128(boolean[] mask_arr) { + VectorMask mInt512 = VectorMask.fromArray(IntVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mInt512.cast(ByteVector.SPECIES_128).toString(), mInt512.toString()); + } + + // Float + private static void testFloat64ToLong128(boolean[] mask_arr) { + VectorMask mFloat64 = VectorMask.fromArray(FloatVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mFloat64.cast(LongVector.SPECIES_128).toString(), mFloat64.toString()); + } + + private static void testFloat64ToDouble128(boolean[] mask_arr) { + VectorMask mFloat64 = VectorMask.fromArray(FloatVector.SPECIES_64, mask_arr, 0); + Assert.assertEquals(mFloat64.cast(DoubleVector.SPECIES_128).toString(), mFloat64.toString()); + } + + private static void testFloat128ToShort64(boolean[] mask_arr) { + VectorMask mFloat128 = VectorMask.fromArray(FloatVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mFloat128.cast(ShortVector.SPECIES_64).toString(), mFloat128.toString()); + } + + private static void testFloat128ToLong256(boolean[] mask_arr) { + VectorMask mFloat128 = VectorMask.fromArray(FloatVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mFloat128.cast(LongVector.SPECIES_256).toString(), mFloat128.toString()); + } + + private static void testFloat128ToDouble256(boolean[] mask_arr) { + VectorMask mFloat128 = VectorMask.fromArray(FloatVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mFloat128.cast(DoubleVector.SPECIES_256).toString(), mFloat128.toString()); + } + + private static void testFloat256ToShort128(boolean[] mask_arr) { + VectorMask mFloat256 = VectorMask.fromArray(FloatVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mFloat256.cast(ShortVector.SPECIES_128).toString(), mFloat256.toString()); + } + + private static void testFloat256ToByte64(boolean[] mask_arr) { + VectorMask mFloat256 = VectorMask.fromArray(FloatVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mFloat256.cast(ByteVector.SPECIES_64).toString(), mFloat256.toString()); + } + + private static void testFloat256ToLong512(boolean[] mask_arr) { + VectorMask mFloat256 = VectorMask.fromArray(FloatVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mFloat256.cast(LongVector.SPECIES_512).toString(), mFloat256.toString()); + } + + private static void testFloat256ToDouble512(boolean[] mask_arr) { + VectorMask mFloat256 = VectorMask.fromArray(FloatVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mFloat256.cast(DoubleVector.SPECIES_512).toString(), mFloat256.toString()); + } + + private static void testFloat512ToShort256(boolean[] mask_arr) { + VectorMask mFloat512 = VectorMask.fromArray(FloatVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mFloat512.cast(ShortVector.SPECIES_256).toString(), mFloat512.toString()); + } + + private static void testFloat512ToByte128(boolean[] mask_arr) { + VectorMask mFloat512 = VectorMask.fromArray(FloatVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mFloat512.cast(ByteVector.SPECIES_128).toString(), mFloat512.toString()); + } + + // Long + private static void testLong128ToInt64(boolean[] mask_arr) { + VectorMask mLong128 = VectorMask.fromArray(LongVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mLong128.cast(IntVector.SPECIES_64).toString(), mLong128.toString()); + } + + private static void testLong128ToFloat64(boolean[] mask_arr) { + VectorMask mLong128 = VectorMask.fromArray(LongVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mLong128.cast(FloatVector.SPECIES_64).toString(), mLong128.toString()); + } + + private static void testLong256ToInt128(boolean[] mask_arr) { + VectorMask mLong256 = VectorMask.fromArray(LongVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mLong256.cast(IntVector.SPECIES_128).toString(), mLong256.toString()); + } + + private static void testLong256ToFloat128(boolean[] mask_arr) { + VectorMask mLong256 = VectorMask.fromArray(LongVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mLong256.cast(FloatVector.SPECIES_128).toString(), mLong256.toString()); + } + + private static void testLong256ToShort64(boolean[] mask_arr) { + VectorMask mLong256 = VectorMask.fromArray(LongVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mLong256.cast(ShortVector.SPECIES_64).toString(), mLong256.toString()); + } + + private static void testLong512ToInt256(boolean[] mask_arr) { + VectorMask mLong512 = VectorMask.fromArray(LongVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mLong512.cast(IntVector.SPECIES_256).toString(), mLong512.toString()); + } + + private static void testLong512ToFloat256(boolean[] mask_arr) { + VectorMask mLong512 = VectorMask.fromArray(LongVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mLong512.cast(FloatVector.SPECIES_256).toString(), mLong512.toString()); + } + + private static void testLong512ToShort128(boolean[] mask_arr) { + VectorMask mLong512 = VectorMask.fromArray(LongVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mLong512.cast(ShortVector.SPECIES_128).toString(), mLong512.toString()); + } + + private static void testLong512ToByte64(boolean[] mask_arr) { + VectorMask mLong512 = VectorMask.fromArray(LongVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mLong512.cast(ByteVector.SPECIES_64).toString(), mLong512.toString()); + } + + // Double + private static void testDouble128ToInt64(boolean[] mask_arr) { + VectorMask mDouble128 = VectorMask.fromArray(DoubleVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mDouble128.cast(IntVector.SPECIES_64).toString(), mDouble128.toString()); + } + + private static void testDouble128ToFloat64(boolean[] mask_arr) { + VectorMask mDouble128 = VectorMask.fromArray(DoubleVector.SPECIES_128, mask_arr, 0); + Assert.assertEquals(mDouble128.cast(FloatVector.SPECIES_64).toString(), mDouble128.toString()); + } + + private static void testDouble256ToInt128(boolean[] mask_arr) { + VectorMask mDouble256 = VectorMask.fromArray(DoubleVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mDouble256.cast(IntVector.SPECIES_128).toString(), mDouble256.toString()); + } + + private static void testDouble256ToFloat128(boolean[] mask_arr) { + VectorMask mDouble256 = VectorMask.fromArray(DoubleVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mDouble256.cast(FloatVector.SPECIES_128).toString(), mDouble256.toString()); + } + + private static void testDouble256ToShort64(boolean[] mask_arr) { + VectorMask mDouble256 = VectorMask.fromArray(DoubleVector.SPECIES_256, mask_arr, 0); + Assert.assertEquals(mDouble256.cast(ShortVector.SPECIES_64).toString(), mDouble256.toString()); + }; + + private static void testDouble512ToInt256(boolean[] mask_arr) { + VectorMask mDouble512 = VectorMask.fromArray(DoubleVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mDouble512.cast(IntVector.SPECIES_256).toString(), mDouble512.toString()); + } + + private static void testDouble512ToFloat256(boolean[] mask_arr) { + VectorMask mDouble512 = VectorMask.fromArray(DoubleVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mDouble512.cast(FloatVector.SPECIES_256).toString(), mDouble512.toString()); + } + + private static void testDouble512ToShort128(boolean[] mask_arr) { + VectorMask mDouble512 = VectorMask.fromArray(DoubleVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mDouble512.cast(ShortVector.SPECIES_128).toString(), mDouble512.toString()); + } + + private static void testDouble512ToByte64(boolean[] mask_arr) { + VectorMask mDouble512 = VectorMask.fromArray(DoubleVector.SPECIES_512, mask_arr, 0); + Assert.assertEquals(mDouble512.cast(ByteVector.SPECIES_64).toString(), mDouble512.toString()); + } + + + @Test + public static void testMaskCast() { + for (int i = 0; i < NUM_ITER; i++) { + boolean[] mask = genMask(); + // Byte + testByte64ToShort128(mask); + testByte64ToInt256(mask); + testByte64ToFloat256(mask); + testByte64ToLong512(mask); + testByte64ToDouble512(mask); + testByte128ToShort256(mask); + testByte128ToInt512(mask); + testByte128ToFloat512(mask); + testByte256ToShort512(mask); + + // Short + testShort64ToInt128(mask); + testShort64ToFloat128(mask); + testShort64ToLong256(mask); + testShort64ToDouble256(mask); + testShort128ToByte64(mask); + testShort128ToInt256(mask); + testShort128ToFloat256(mask); + testShort128ToLong512(mask); + testShort128ToDouble512(mask); + testShort256ToByte128(mask); + testShort256ToInt512(mask); + testShort256ToFloat512(mask); + testShort512ToByte256(mask); + + // Int + testInt64ToLong128(mask); + testInt64ToDouble128(mask); + testInt128ToShort64(mask); + testInt128ToLong256(mask); + testInt128ToDouble256(mask); + testInt256ToShort128(mask); + testInt256ToByte64(mask); + testInt256ToLong512(mask); + testInt256ToDouble512(mask); + testInt512ToShort256(mask); + testInt512ToByte128(mask); + + // Float + testFloat64ToLong128(mask); + testFloat64ToDouble128(mask); + testFloat128ToShort64(mask); + testFloat128ToLong256(mask); + testFloat128ToDouble256(mask); + testFloat256ToShort128(mask); + testFloat256ToByte64(mask); + testFloat256ToLong512(mask); + testFloat256ToDouble512(mask); + testFloat512ToShort256(mask); + testFloat512ToByte128(mask); + + // Long + testLong128ToInt64(mask); + testLong128ToFloat64(mask); + testLong256ToInt128(mask); + testLong256ToFloat128(mask); + testLong256ToShort64(mask); + testLong512ToInt256(mask); + testLong512ToFloat256(mask); + testLong512ToShort128(mask); + testLong512ToByte64(mask); + + // Double + testDouble128ToInt64(mask); + testDouble128ToFloat64(mask); + testDouble256ToInt128(mask); + testDouble256ToFloat128(mask); + testDouble256ToShort64(mask); + testDouble512ToInt256(mask); + testDouble512ToFloat256(mask); + testDouble512ToShort128(mask); + testDouble512ToByte64(mask); + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorMaskLoadStoreTest.java b/test/hotspot/jtreg/compiler/vectorapi/VectorMaskLoadStoreTest.java new file mode 100644 index 00000000000..669608b824b --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorMaskLoadStoreTest.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2021, 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.vectorapi; + +import java.util.Random; + +import jdk.incubator.vector.VectorSpecies; +import jdk.incubator.vector.ByteVector; +import jdk.incubator.vector.DoubleVector; +import jdk.incubator.vector.FloatVector; +import jdk.incubator.vector.IntVector; +import jdk.incubator.vector.LongVector; +import jdk.incubator.vector.ShortVector; +import jdk.incubator.vector.VectorMask; +import jdk.test.lib.Utils; + +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @test + * @bug 8274569 + * @key randomness + * @library /test/lib + * @summary Tests X86 backend related incorrectness issues in legacy storemask patterns + * @modules jdk.incubator.vector + * + * @run testng/othervm -XX:-TieredCompilation -XX:CompileThreshold=100 compiler.vectorapi.VectorMaskLoadStoreTest + */ + + +public class VectorMaskLoadStoreTest{ + + private static final int NUM_ITER = 5000; + private static final Random rd = Utils.getRandomInstance(); + + public static void testByte64(long val) { + VectorSpecies SPECIES = ByteVector.SPECIES_64; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFL); + } + + public static void testByte128(long val) { + VectorSpecies SPECIES = ByteVector.SPECIES_128; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFFFL); + } + + public static void testByte256(long val) { + VectorSpecies SPECIES = ByteVector.SPECIES_256; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFFFFFFFL); + } + + public static void testByte512(long val) { + VectorSpecies SPECIES = ByteVector.SPECIES_512; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & -1L); + } + + public static void testShort64(long val) { + VectorSpecies SPECIES = ShortVector.SPECIES_64; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFL); + } + + public static void testShort128(long val) { + VectorSpecies SPECIES = ShortVector.SPECIES_128; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFL); + } + + public static void testShort256(long val) { + VectorSpecies SPECIES = ShortVector.SPECIES_256; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFFFL); + } + + public static void testShort512(long val) { + VectorSpecies SPECIES = ShortVector.SPECIES_512; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFFFFFFFL); + } + + public static void testInteger64(long val) { + VectorSpecies SPECIES = IntVector.SPECIES_64; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0x3L); + } + + public static void testInteger128(long val) { + VectorSpecies SPECIES = IntVector.SPECIES_128; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFL); + } + + public static void testInteger256(long val) { + VectorSpecies SPECIES = IntVector.SPECIES_256; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFL); + } + + public static void testInteger512(long val) { + VectorSpecies SPECIES = IntVector.SPECIES_512; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFFFL); + } + + public static void testLong64(long val) { + VectorSpecies SPECIES = LongVector.SPECIES_64; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0x1L); + } + + public static void testLong128(long val) { + VectorSpecies SPECIES = LongVector.SPECIES_128; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0x3L); + } + + public static void testLong256(long val) { + VectorSpecies SPECIES = LongVector.SPECIES_256; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFL); + } + + public static void testLong512(long val) { + VectorSpecies SPECIES = LongVector.SPECIES_512; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFL); + } + + public static void testFloat64(long val) { + VectorSpecies SPECIES = FloatVector.SPECIES_64; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0x3L); + } + + public static void testFloat128(long val) { + VectorSpecies SPECIES = FloatVector.SPECIES_128; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFL); + } + + public static void testFloat256(long val) { + VectorSpecies SPECIES = FloatVector.SPECIES_256; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFL); + } + + public static void testFloat512(long val) { + VectorSpecies SPECIES = FloatVector.SPECIES_512; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFFFL); + } + + public static void testDouble64(long val) { + VectorSpecies SPECIES = DoubleVector.SPECIES_64; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0x1L); + } + + public static void testDouble128(long val) { + VectorSpecies SPECIES = DoubleVector.SPECIES_128; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0x3L); + } + + public static void testDouble256(long val) { + VectorSpecies SPECIES = DoubleVector.SPECIES_256; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFL); + } + + public static void testDouble512(long val) { + VectorSpecies SPECIES = DoubleVector.SPECIES_512; + VectorMask mask = VectorMask.fromLong(SPECIES, val); + Assert.assertEquals(mask.toLong(), val & 0xFFL); + } + + @Test + public static void testMaskCast() { + long [] vals = {-1L, 0, rd.nextLong(), rd.nextLong()}; + for(int i = 0; i < vals.length; i++) { + long val = vals[i]; + for (int ctr = 0; ctr < NUM_ITER; ctr++) { + testByte64(val); + testByte128(val); + testByte256(val); + testByte512(val); + testShort64(val); + testShort128(val); + testShort256(val); + testShort512(val); + testInteger64(val); + testInteger128(val); + testInteger256(val); + testInteger512(val); + testLong64(val); + testLong128(val); + testLong256(val); + testLong512(val); + testFloat64(val); + testFloat128(val); + testFloat256(val); + testFloat512(val); + testDouble64(val); + testDouble128(val); + testDouble256(val); + testDouble512(val); + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/vectorapi/VectorMemoryAlias.java b/test/hotspot/jtreg/compiler/vectorapi/VectorMemoryAlias.java new file mode 100644 index 00000000000..54637eb6e2e --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorapi/VectorMemoryAlias.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, Rado Smogura. All rights reserved. + * + * 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 if memory ordering is preserved + * + * @run main/othervm -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure + * -XX:CompileThreshold=100 -XX:CompileCommand=dontinline,compiler.vectorapi.VectorMemoryAlias::test + * compiler.vectorapi.VectorMemoryAlias + * @modules jdk.incubator.vector + */ + +package compiler.vectorapi; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import jdk.incubator.vector.ByteVector; +import jdk.incubator.vector.VectorSpecies; + +public class VectorMemoryAlias { + public static final VectorSpecies SPECIES = VectorSpecies.ofLargestShape(byte.class); + public static void main(String[] args) { + for (int i=0; i < 30000; i++) { + if (test() != 1) { + throw new AssertionError(); + } + } + } + + public static int test() { + byte arr[] = new byte[256]; + final var bb = ByteBuffer.wrap(arr); + final var ones = ByteVector.broadcast(SPECIES, 1); + var res = ByteVector.zero(SPECIES); + + int result = 0; + result += arr[2]; + res.add(ones).intoByteBuffer(bb, 0, ByteOrder.nativeOrder()); + result += arr[2]; + + return result; + } +} -- GitLab From bd92674be563ad291990216b7cdf061c498f5dd3 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Tue, 16 Nov 2021 02:34:36 +0000 Subject: [PATCH 333/890] 8276184: Exclude lambda proxy class from the CDS archive if its caller class is excluded Reviewed-by: iklam, dholmes --- src/hotspot/share/cds/dynamicArchive.cpp | 1 - src/hotspot/share/cds/metaspaceShared.cpp | 1 - .../classfile/systemDictionaryShared.cpp | 25 +++- .../classfile/systemDictionaryShared.hpp | 4 +- src/hotspot/share/oops/instanceKlass.cpp | 5 + .../cds/appcds/LambdaContainsOldInf.java | 53 +++++---- .../jtreg/runtime/cds/appcds/SignedJar.java | 51 ++++++--- .../dynamicArchive/LambdaContainsOldInf.java | 49 ++++---- .../LambdaForOldInfInBaseArchive.java | 97 ++++++++++++++++ .../dynamicArchive/OldClassInBaseArchive.java | 103 +++++++++++++++++ .../RedefineCallerClassTest.java | 107 ++++++++++++++++++ .../test-classes/RedefineCallerClass.java | 65 +++++++++++ .../cds/appcds/test-classes/Hello.java | 9 +- .../test-classes/LambdaContainsOldInfApp.java | 9 ++ 14 files changed, 511 insertions(+), 68 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaForOldInfInBaseArchive.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/OldClassInBaseArchive.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/RedefineCallerClassTest.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/RedefineCallerClass.java diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index 33da23e10fe..b3c18e318a8 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -112,7 +112,6 @@ public: // Block concurrent class unloading from changing the _dumptime_table MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag); SystemDictionaryShared::check_excluded_classes(); - SystemDictionaryShared::cleanup_lambda_proxy_class_dictionary(); // save dumptime tables SystemDictionaryShared::clone_dumptime_tables(); diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index 5dd296410c7..17e27a5372f 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -521,7 +521,6 @@ void VM_PopulateDumpSharedSpace::doit() { // Block concurrent class unloading from changing the _dumptime_table MutexLocker ml(DumpTimeTable_lock, Mutex::_no_safepoint_check_flag); SystemDictionaryShared::check_excluded_classes(); - SystemDictionaryShared::cleanup_lambda_proxy_class_dictionary(); StaticArchiveBuilder builder; builder.gather_source_objs(); diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index 48f8147b6ee..3e4bd3cfb34 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -245,6 +245,14 @@ bool SystemDictionaryShared::is_registered_lambda_proxy_class(InstanceKlass* ik) return (info != NULL) ? info->_is_archived_lambda_proxy : false; } +void SystemDictionaryShared::reset_registered_lambda_proxy_class(InstanceKlass* ik) { + DumpTimeClassInfo* info = _dumptime_table->get(ik); + if (info != NULL) { + info->_is_archived_lambda_proxy = false; + info->set_excluded(); + } +} + bool SystemDictionaryShared::is_early_klass(InstanceKlass* ik) { DumpTimeClassInfo* info = _dumptime_table->get(ik); return (info != NULL) ? info->is_early_klass() : false; @@ -325,6 +333,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) { for (int i = 0; i < len; i++) { InstanceKlass* intf = interfaces->at(i); if (check_for_exclusion(intf, NULL)) { + ResourceMark rm; log_warning(cds)("Skipping %s: interface %s is excluded", k->name()->as_C_string(), intf->name()->as_C_string()); return true; } @@ -663,6 +672,8 @@ void SystemDictionaryShared::check_excluded_classes() { ExcludeDumpTimeSharedClasses excl; _dumptime_table->iterate(&excl); _dumptime_table->update_counts(); + + cleanup_lambda_proxy_class_dictionary(); } bool SystemDictionaryShared::is_excluded_class(InstanceKlass* k) { @@ -1602,9 +1613,19 @@ class CleanupDumpTimeLambdaProxyClassTable: StackObj { public: bool do_entry(LambdaProxyClassKey& key, DumpTimeLambdaProxyClassInfo& info) { assert_lock_strong(DumpTimeTable_lock); - for (int i = 0; i < info._proxy_klasses->length(); i++) { + InstanceKlass* caller_ik = key.caller_ik(); + if (SystemDictionaryShared::check_for_exclusion(caller_ik, NULL)) { + // If the caller class is excluded, unregister all the associated lambda proxy classes + // so that they will not be included in the CDS archive. + for (int i = info._proxy_klasses->length() - 1; i >= 0; i--) { + SystemDictionaryShared::reset_registered_lambda_proxy_class(info._proxy_klasses->at(i)); + info._proxy_klasses->remove_at(i); + } + } + for (int i = info._proxy_klasses->length() - 1; i >= 0; i--) { InstanceKlass* ik = info._proxy_klasses->at(i); - if (!ik->can_be_verified_at_dumptime()) { + if (SystemDictionaryShared::check_for_exclusion(ik, NULL)) { + SystemDictionaryShared::reset_registered_lambda_proxy_class(ik); info._proxy_klasses->remove_at(i); } } diff --git a/src/hotspot/share/classfile/systemDictionaryShared.hpp b/src/hotspot/share/classfile/systemDictionaryShared.hpp index 039b9d01e9a..bbd76c8d7b7 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.hpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp @@ -136,6 +136,7 @@ class SharedClassLoadingMark { class SystemDictionaryShared: public SystemDictionary { friend class ExcludeDumpTimeSharedClasses; + friend class CleanupDumpTimeLambdaProxyClassTable; public: enum { FROM_FIELD_IS_PROTECTED = 1 << 0, @@ -173,6 +174,8 @@ private: static void write_dictionary(RunTimeSharedDictionary* dictionary, bool is_builtin); static void write_lambda_proxy_class_dictionary(LambdaProxyClassDictionary* dictionary); + static void cleanup_lambda_proxy_class_dictionary(); + static void reset_registered_lambda_proxy_class(InstanceKlass* ik); static bool is_jfr_event_class(InstanceKlass *k); static bool is_registered_lambda_proxy_class(InstanceKlass* ik); static bool check_for_exclusion_impl(InstanceKlass* k); @@ -288,7 +291,6 @@ public: static size_t estimate_size_for_archive(); static void write_to_archive(bool is_static_archive = true); static void adjust_lambda_proxy_class_dictionary(); - static void cleanup_lambda_proxy_class_dictionary(); static void serialize_dictionary_headers(class SerializeClosure* soc, bool is_static_archive = true); static void serialize_vm_classes(class SerializeClosure* soc); diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index aabb84d9225..1e237de66ec 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -2598,6 +2598,11 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl // retrieved during dump time. // Verification of archived old classes will be performed during run time. bool InstanceKlass::can_be_verified_at_dumptime() const { + if (MetaspaceShared::is_in_shared_metaspace(this)) { + // This is a class that was dumped into the base archive, so we know + // it was verified at dump time. + return true; + } if (major_version() < 50 /*JAVA_6_VERSION*/) { return false; } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java b/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java index a2c85542244..296fc32e2d9 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/LambdaContainsOldInf.java @@ -24,7 +24,7 @@ /* * @test - * @bug 8274944 + * @bug 8274944 8276184 * @summary VM should not crash during CDS dump when a lambda proxy class * contains an old version of interface. * @requires vm.cds @@ -49,30 +49,35 @@ public class LambdaContainsOldInf { String classList = namePrefix + ".list"; String archiveName = namePrefix + ".jsa"; - // dump class list - CDSTestUtils.dumpClassList(classList, "-cp", appJar, mainClass); + String[] mainArgs = { "dummy", "addLambda" }; - // create archive with the class list - CDSOptions opts = (new CDSOptions()) - .addPrefix("-XX:ExtraSharedClassListFile=" + classList, - "-cp", appJar, - "-Xlog:class+load,cds") - .setArchiveName(archiveName); - OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts); - TestCommon.checkExecReturn(output, 0, true, - "Skipping OldProvider: Old class has been linked"); - output.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked"); + for (String mainArg : mainArgs) { + // dump class list + CDSTestUtils.dumpClassList(classList, "-cp", appJar, mainClass, mainArg); - // run with archive - CDSOptions runOpts = (new CDSOptions()) - .addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug") - .setArchiveName(archiveName) - .setUseVersion(false) - .addSuffix(mainClass); - output = CDSTestUtils.runWithArchive(runOpts); - TestCommon.checkExecReturn(output, 0, true, - "[class,load] LambdaContainsOldInfApp source: shared objects file"); - output.shouldMatch(".class.load. OldProvider.source:.*lambdacontainsoldinf.jar") - .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf"); + // create archive with the class list + CDSOptions opts = (new CDSOptions()) + .addPrefix("-XX:ExtraSharedClassListFile=" + classList, + "-cp", appJar, + "-Xlog:class+load,cds") + .setArchiveName(archiveName); + OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts); + TestCommon.checkExecReturn(output, 0, true, + "Skipping OldProvider: Old class has been linked"); + output.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked"); + + // run with archive + CDSOptions runOpts = (new CDSOptions()) + .addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug") + .setArchiveName(archiveName) + .setUseVersion(false) + .addSuffix(mainClass) + .addSuffix(mainArg); + output = CDSTestUtils.runWithArchive(runOpts); + TestCommon.checkExecReturn(output, 0, true, + "[class,load] LambdaContainsOldInfApp source: shared objects file"); + output.shouldMatch(".class.load. OldProvider.source:.*lambdacontainsoldinf.jar") + .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf"); + } } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java b/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java index 4bc90bb6faa..b2fe7cad903 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/SignedJar.java @@ -24,6 +24,7 @@ /* * @test + * @bug 8276184 * @summary AppCDS handling of signed JAR. * @requires vm.cds * @library /test/lib @@ -42,24 +43,42 @@ public class SignedJar { // Test class exists in signed JAR String signedJar = TestCommon.getTestJar("signed_hello.jar"); OutputAnalyzer output; - output = TestCommon.dump(signedJar, TestCommon.list("Hello")); - TestCommon.checkDump(output, "Skipping Hello: Signed JAR"); - // At runtime, the Hello class should be loaded from the jar file - // instead of from the shared archive since a class from a signed - // jar shouldn't be dumped into the archive. - output = TestCommon.exec(signedJar, "-verbose:class", "Hello"); - String expectedOutput = ".class,load. Hello source: file:.*signed_hello.jar"; + // "testlambda" is for testing JDK-8276184 + String[] mainArgs = { "dummy", "testlambda" }; + String mainClass = "Hello"; - try { - output.shouldMatch(expectedOutput); - } catch (Exception e) { - TestCommon.checkCommonExecExceptions(output, e); - } + String skipMsg = "Skipping Hello: Signed JAR"; + String lambdaInArchive = "klasses.*=.*app.*Hello[$][$]Lambda[$].*hidden"; + String loadFromJar = ".class,load. Hello source: file:.*signed_hello.jar"; + String lambdaLoadFromHello = ".class.load. Hello[$][$]Lambda[$].*/0x.*source.*Hello"; + + for (String mainArg : mainArgs) { + output = TestCommon.dump(signedJar, TestCommon.list(mainClass), + "-Xlog:cds+class=debug", mainClass, mainArg); + TestCommon.checkDump(output, skipMsg); + output.shouldNotContain(lambdaInArchive); + + // At runtime, the Hello class should be loaded from the jar file + // instead of from the shared archive since a class from a signed + // jar shouldn't be dumped into the archive. + output = TestCommon.exec(signedJar, "-verbose:class", mainClass, mainArg); - // Test class exists in both signed JAR and unsigned JAR - String jars = signedJar + System.getProperty("path.separator") + unsignedJar; - output = TestCommon.dump(jars, TestCommon.list("Hello")); - TestCommon.checkDump(output, "Skipping Hello: Signed JAR"); + try { + output.shouldMatch(loadFromJar); + if (mainArg.equals("testlambda")) { + output.shouldMatch(lambdaLoadFromHello); + } + } catch (Exception e) { + TestCommon.checkCommonExecExceptions(output, e); + } + + // Test class exists in both signed JAR and unsigned JAR + String jars = signedJar + System.getProperty("path.separator") + unsignedJar; + output = TestCommon.dump(jars, TestCommon.list(mainClass), + "-Xlog:cds+class=debug", mainClass, mainArg); + TestCommon.checkDump(output, skipMsg); + output.shouldNotContain(lambdaInArchive); + } } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java index 6c3fd9b73f1..dbc3fc03e33 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaContainsOldInf.java @@ -24,7 +24,7 @@ /* * @test - * @bug 8274944 + * @bug 8274944 8276184 * @summary VM should not crash during CDS dump when a lambda proxy class * contains an old version of interface. * @requires vm.cds @@ -53,29 +53,34 @@ public class LambdaContainsOldInf extends DynamicArchiveTestBase { String wbJar = ClassFileInstaller.getJarPath("WhiteBox.jar"); String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar; - dump(topArchiveName, - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - "-Xlog:class+load=debug,cds=debug,cds+dynamic=info", - use_whitebox_jar, - "-cp", appJar, mainClass) - .assertNormalExit(output -> { - output.shouldContain("Skipping OldProvider: Old class has been linked") - .shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked") - .shouldHaveExitValue(0); + String[] mainArgs = { "dummy", "addLambda" }; + + for (String mainArg : mainArgs) { + + dump(topArchiveName, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + "-Xlog:class+load=debug,cds=debug,cds+dynamic=info", + use_whitebox_jar, + "-cp", appJar, mainClass, mainArg) + .assertNormalExit(output -> { + output.shouldContain("Skipping OldProvider: Old class has been linked") + .shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked") + .shouldHaveExitValue(0); }); - run(topArchiveName, - "-XX:+UnlockDiagnosticVMOptions", - "-XX:+WhiteBoxAPI", - use_whitebox_jar, - "-Xlog:class+load=debug", - "-cp", appJar, mainClass) - .assertNormalExit(output -> { - output.shouldContain("[class,load] LambdaContainsOldInfApp source: shared objects file (top)") - .shouldMatch(".class.load. OldProvider.source:.*lambda_contains_old_inf.jar") - .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf") - .shouldHaveExitValue(0); + run(topArchiveName, + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI", + use_whitebox_jar, + "-Xlog:class+load=debug", + "-cp", appJar, mainClass, mainArg) + .assertNormalExit(output -> { + output.shouldContain("[class,load] LambdaContainsOldInfApp source: shared objects file (top)") + .shouldMatch(".class.load. OldProvider.source:.*lambda_contains_old_inf.jar") + .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf") + .shouldHaveExitValue(0); }); + } } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaForOldInfInBaseArchive.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaForOldInfInBaseArchive.java new file mode 100644 index 00000000000..01ba6a830fb --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaForOldInfInBaseArchive.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021, 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 8276184 + * @summary Archive an old interface in the base archive and an app class which + * uses the old interface via a lambda expression in the dynamic archive. + * The lambda proxy class of the app class should be in the dynamic archive. + * @requires vm.cds + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes + * @build LambdaContainsOldInfApp sun.hotspot.WhiteBox OldProvider + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar old-inf-base-archive.jar LambdaContainsOldInfApp OldProvider + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LambdaForOldInfInBaseArchive + */ + +import java.io.File; +import jdk.test.lib.cds.CDSOptions; +import jdk.test.lib.cds.CDSTestUtils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.helpers.ClassFileInstaller; + +public class LambdaForOldInfInBaseArchive extends DynamicArchiveTestBase { + static final String classList = CDSTestUtils.getOutputFileName("classlist"); + static final String appClass = "LambdaContainsOldInfApp"; + static final String baseArchiveClass = "OldProvider"; + + public static void main(String[] args) throws Exception { + runTest(LambdaForOldInfInBaseArchive::testCustomBase); + } + + static void testCustomBase() throws Exception { + String topArchiveName = getNewArchiveName("top"); + doTestCustomBase(topArchiveName); + } + + private static void doTestCustomBase(String topArchiveName) throws Exception { + String appJar = ClassFileInstaller.getJarPath("old-inf-base-archive.jar"); + + // create a custom base archive containing and old interface + OutputAnalyzer output = TestCommon.dump(appJar, + TestCommon.list("OldProvider"), "-Xlog:class+load,cds+class=debug"); + TestCommon.checkDump(output); + // Check that the OldProvider is being dumped into the base archive. + output.shouldMatch(".cds,class.*klass.*0x.*app.*OldProvider.*unlinked"); + + String baseArchiveName = TestCommon.getCurrentArchiveName(); + + // create a dynamic archive with the custom base archive. + // The old interface is in the base archive and will be + // accessed using a lambda expression of LambdaContainsOldInfApp. + // The lambda proxy class and the app class will be archived in the dynamic archive. + dump2(baseArchiveName, topArchiveName, + "-Xlog:cds,cds+dynamic,class+load,cds+class=debug", + "-cp", appJar, + appClass) + .assertNormalExit(out -> { + out.shouldContain("OldProvider source: shared objects file") + .shouldMatch("Archiving hidden LambdaContainsOldInfApp[$][$]Lambda[$][\\d+]*"); + }); + + // Run with both base and dynamic archives. The OldProvider class + // should be loaded from the base archive. The LambdaContainsOldInfApp + // and its lambda proxy class should be loaded from the dynamic archive. + run2(baseArchiveName, topArchiveName, + "-Xlog:cds,cds+dynamic,class+load", + "-cp", appJar, + appClass) + .assertNormalExit(out -> { + out.shouldContain("OldProvider source: shared objects file") + .shouldContain("LambdaContainsOldInfApp source: shared objects file (top)") + .shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)"); + }); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/OldClassInBaseArchive.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/OldClassInBaseArchive.java new file mode 100644 index 00000000000..80c3f004d82 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/OldClassInBaseArchive.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2021, 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 8276184 + * @summary Archive an old class in the base archive and an app class which + * uses the old class in the dynamic archive. + * The old class should be loaded from the base archive. The app class + * should be loaded from the dynamic archive. + * @requires vm.cds + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes + * @build OldSuperApp sun.hotspot.WhiteBox OldSuper ChildOldSuper GChild + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar old-class-base-archive.jar OldSuperApp OldSuper ChildOldSuper GChild + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. OldClassInBaseArchive + */ + +import java.io.File; +import jdk.test.lib.cds.CDSOptions; +import jdk.test.lib.cds.CDSTestUtils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.helpers.ClassFileInstaller; + +public class OldClassInBaseArchive extends DynamicArchiveTestBase { + static final String classList = CDSTestUtils.getOutputFileName("classlist"); + static final String appClass = "OldSuperApp"; + static final String baseArchiveClass = "OldSuper"; + + public static void main(String[] args) throws Exception { + runTest(OldClassInBaseArchive::testCustomBase); + } + + static void testCustomBase() throws Exception { + String topArchiveName = getNewArchiveName("top"); + doTestCustomBase(topArchiveName); + } + + private static void doTestCustomBase(String topArchiveName) throws Exception { + String appJar = ClassFileInstaller.getJarPath("old-class-base-archive.jar"); + + // create a custom base archive containing and old class + OutputAnalyzer output = TestCommon.dump(appJar, + TestCommon.list("OldSuper"), "-Xlog:class+load,cds+class=debug"); + TestCommon.checkDump(output); + // Check the OldSuper is being dumped into the base archive. + output.shouldMatch(".cds.class.*klass.*0x.*app.*OldSuper.*unlinked"); + + String baseArchiveName = TestCommon.getCurrentArchiveName(); + + // create a dynamic archive with the custom base archive. + // The old class is in the base archive and will be + // accessed from OldSuperApp. + // The OldSuperApp, ChildOldSuper, and GChild classes will be archived + // in the dynamic archive. + dump2(baseArchiveName, topArchiveName, + "-Xlog:cds,cds+dynamic,class+load,cds+class=debug", + "-cp", appJar, + appClass) + .assertNormalExit(out -> { + out.shouldContain("OldSuper source: shared objects file") + // Check the following classes are being dumped into the dynamic archive. + .shouldMatch(".cds,class.*klass.*0x.*app.*OldSuperApp") + .shouldMatch(".cds,class.*klass.*0x.*app.*ChildOldSuper") + .shouldMatch(".cds,class.*klass.*0x.*app.*GChild"); + }); + + // Run with both base and dynamic archives. The OldSuper class + // should be loaded from the base archive. The OldSuperApp + // and related classes should be loaded from the dynamic archive. + run2(baseArchiveName, topArchiveName, + "-Xlog:cds,cds+dynamic,class+load", + "-cp", appJar, + appClass) + .assertNormalExit(out -> { + out.shouldContain("OldSuper source: shared objects file") + .shouldContain("OldSuperApp source: shared objects file (top)") + .shouldContain("ChildOldSuper source: shared objects file (top)") + .shouldContain("GChild source: shared objects file (top)"); + }); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/RedefineCallerClassTest.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/RedefineCallerClassTest.java new file mode 100644 index 00000000000..b66bb383b45 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/RedefineCallerClassTest.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021, 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 8276184 + * @summary If the caller class is redefined during dump time, the caller class + * and its lambda proxy class should not be archived. + * @requires vm.cds + * @requires vm.jvmti + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds + * /test/hotspot/jtreg/runtime/cds/appcds/test-classes + * /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes + * @build sun.hotspot.WhiteBox OldProvider + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run driver RedefineClassHelper + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. RedefineCallerClassTest + */ + +import jdk.test.lib.helpers.ClassFileInstaller; + +public class RedefineCallerClassTest extends DynamicArchiveTestBase { + static String mainClass = RedefineCallerClass.class.getName(); + + static String providerClass = OldProvider.class.getName(); + + static String sharedClasses[] = { + mainClass, + "SimpleLambda", // caller class will be redefined in RedefineCallerClass + providerClass, // inteface with class file major version < 50 + "jdk/test/lib/compiler/InMemoryJavaCompiler", + "jdk/test/lib/compiler/InMemoryJavaCompiler$FileManagerWrapper", + "jdk/test/lib/compiler/InMemoryJavaCompiler$FileManagerWrapper$1", + "jdk/test/lib/compiler/InMemoryJavaCompiler$MemoryJavaFileObject" + }; + + public static void main(String[] args) throws Exception { + runTest(RedefineCallerClassTest::test); + } + + static void test() throws Exception { + String topArchiveName = getNewArchiveName(); + String appJar = ClassFileInstaller.writeJar("redefine_caller_class.jar", sharedClasses); + + String[] mainArgs = { + "redefineCaller", // redefine caller class only + "useOldInf", // use old interface only + "both" // both of the above + }; + + for (String mainArg : mainArgs) { + String[] options = { + "-Xlog:class+load,cds", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+AllowArchivingWithJavaAgent", + "-javaagent:redefineagent.jar", + "-cp", appJar, mainClass, mainArg + }; + + dump(topArchiveName, options) + .assertNormalExit(output -> { + output.shouldHaveExitValue(0); + if (mainArg.equals("both") || mainArg.equals("useOldInf")) { + output.shouldContain("Skipping OldProvider: Old class has been linked") + .shouldMatch("Skipping.SimpleLambda[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked"); + } + if (mainArg.equals("both") || mainArg.equals("redefineCaller")) { + output.shouldContain("Skipping SimpleLambda: Has been redefined"); + } + }); + + run(topArchiveName, options) + .assertNormalExit(output -> { + output.shouldHaveExitValue(0) + .shouldContain("RedefineCallerClass source: shared objects file (top)") + .shouldMatch(".class.load. SimpleLambda[$][$]Lambda[$].*/0x.*source:.*SimpleLambda"); + if (mainArg.equals("both") || mainArg.equals("useOldInf")) { + output.shouldMatch(".class.load. OldProvider.source:.*redefine_caller_class.jar"); + } + if (mainArg.equals("both") || mainArg.equals("redefineCaller")) { + output.shouldMatch(".class.load. SimpleLambda.source:.*redefine_caller_class.jar"); + } + }); + } + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/RedefineCallerClass.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/RedefineCallerClass.java new file mode 100644 index 00000000000..baf23a2cb18 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/RedefineCallerClass.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021, 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. + * + */ + +class SimpleLambda { + public Runnable getRunnable() { + return () -> {}; + } + public OldProvider getProvider() { + return () -> { + return null; + }; + } +} + +public class RedefineCallerClass { + + public static String newClass = + " class SimpleLambda { " + + " public Runnable getRunnable() { " + + " return () -> {}; " + + " } " + + " public OldProvider getProvider() { " + + " return () -> { " + + " return null; " + + " }; " + + " } " + + " } "; + + public static void main(String args[]) throws Exception { + String mode = "both"; + if (args.length == 1) { + mode = args[0]; + } + SimpleLambda s = new SimpleLambda(); + if (mode.equals("both") || mode.equals("useOldInf")) { + System.out.println(s.getProvider()); + } else { + System.out.println(s.getRunnable()); + } + if (mode.equals("both") || mode.equals("redefineCaller")) { + RedefineClassHelper.redefineClass(s.getClass(), newClass); + } + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/Hello.java b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/Hello.java index 250a63adde8..2b1844c0984 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/Hello.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/Hello.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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,5 +25,12 @@ public class Hello { public static void main(String args[]) { System.out.println("Hello World"); + if (args.length > 0 && args[0].equals("testlambda")) { + System.out.println(getRunnable()); + } + } + + public static Runnable getRunnable() { + return () -> {}; } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java index 81b9cdba49b..7e5f01b1f33 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/LambdaContainsOldInfApp.java @@ -24,6 +24,9 @@ public class LambdaContainsOldInfApp { public static void main(final String... args) { getProvider(); + if (args.length == 1 && args[0].equals("addLambda")) { + getProvider2(); + } } public static OldProvider getProvider() { @@ -31,4 +34,10 @@ public class LambdaContainsOldInfApp { return null; }; } + + public static OldProvider getProvider2() { + return () -> { + return null; + }; + } } -- GitLab From e4362007da8e40c076493364df91cf85960a03e7 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 16 Nov 2021 07:32:34 +0000 Subject: [PATCH 334/890] 8008243: Zero: Implement fast bytecodes Reviewed-by: rkennke, coleenp --- src/hotspot/cpu/zero/zeroInterpreter_zero.cpp | 12 +- .../interpreter/zero/bytecodeInterpreter.cpp | 599 +++++++++++++++--- .../interpreter/zero/bytecodeInterpreter.hpp | 2 +- .../share/prims/jvmtiManageCapabilities.cpp | 6 + 4 files changed, 544 insertions(+), 75 deletions(-) diff --git a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp index f2e8dc2fe23..f3f1327a629 100644 --- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp @@ -186,9 +186,17 @@ void ZeroInterpreter::main_loop(int recurse, TRAPS) { // Call the interpreter if (JvmtiExport::can_post_interpreter_events()) { - BytecodeInterpreter::run(istate); + if (RewriteBytecodes) { + BytecodeInterpreter::run(istate); + } else { + BytecodeInterpreter::run(istate); + } } else { - BytecodeInterpreter::run(istate); + if (RewriteBytecodes) { + BytecodeInterpreter::run(istate); + } else { + BytecodeInterpreter::run(istate); + } } fixup_after_potential_safepoint(); diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index d8fac577d59..f1bfa3d190d 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -293,6 +293,8 @@ istate->set_bcp(pc+opsize); \ return; +#define REWRITE_AT_PC(val) \ + *pc = val; #define METHOD istate->method() #define GET_METHOD_COUNTERS(res) @@ -389,6 +391,81 @@ if (THREAD->has_pending_exception()) goto label; \ } +#define MAYBE_POST_FIELD_ACCESS(obj) { \ + if (JVMTI_ENABLED) { \ + int* count_addr; \ + /* Check to see if a field modification watch has been set */ \ + /* before we take the time to call into the VM. */ \ + count_addr = (int*)JvmtiExport::get_field_access_count_addr(); \ + if (*count_addr > 0) { \ + oop target; \ + if ((Bytecodes::Code)opcode == Bytecodes::_getstatic) { \ + target = NULL; \ + } else { \ + target = obj; \ + } \ + CALL_VM(InterpreterRuntime::post_field_access(THREAD, \ + target, cache), \ + handle_exception); \ + } \ + } \ +} + +#define MAYBE_POST_FIELD_MODIFICATION(obj) { \ + if (JVMTI_ENABLED) { \ + int* count_addr; \ + /* Check to see if a field modification watch has been set */ \ + /* before we take the time to call into the VM. */ \ + count_addr = (int*)JvmtiExport::get_field_modification_count_addr(); \ + if (*count_addr > 0) { \ + oop target; \ + if ((Bytecodes::Code)opcode == Bytecodes::_putstatic) { \ + target = NULL; \ + } else { \ + target = obj; \ + } \ + CALL_VM(InterpreterRuntime::post_field_modification(THREAD, \ + target, cache, \ + (jvalue*)STACK_SLOT(-1)), \ + handle_exception); \ + } \ + } \ +} + +static inline int fast_get_type(TosState tos) { + switch (tos) { + case ztos: + case btos: return Bytecodes::_fast_bgetfield; + case ctos: return Bytecodes::_fast_cgetfield; + case stos: return Bytecodes::_fast_sgetfield; + case itos: return Bytecodes::_fast_igetfield; + case ltos: return Bytecodes::_fast_lgetfield; + case ftos: return Bytecodes::_fast_fgetfield; + case dtos: return Bytecodes::_fast_dgetfield; + case atos: return Bytecodes::_fast_agetfield; + default: + ShouldNotReachHere(); + return -1; + } +} + +static inline int fast_put_type(TosState tos) { + switch (tos) { + case ztos: return Bytecodes::_fast_zputfield; + case btos: return Bytecodes::_fast_bputfield; + case ctos: return Bytecodes::_fast_cputfield; + case stos: return Bytecodes::_fast_sputfield; + case itos: return Bytecodes::_fast_iputfield; + case ltos: return Bytecodes::_fast_lputfield; + case ftos: return Bytecodes::_fast_fputfield; + case dtos: return Bytecodes::_fast_dputfield; + case atos: return Bytecodes::_fast_aputfield; + default: + ShouldNotReachHere(); + return -1; + } +} + /* * BytecodeInterpreter::run(interpreterState istate) * @@ -397,11 +474,13 @@ * the method passed in. */ -// Instantiate two variants of the method for future linking. -template void BytecodeInterpreter::run(interpreterState istate); -template void BytecodeInterpreter::run(interpreterState istate); +// Instantiate variants of the method for future linking. +template void BytecodeInterpreter::run(interpreterState istate); +template void BytecodeInterpreter::run(interpreterState istate); +template void BytecodeInterpreter::run< true, false>(interpreterState istate); +template void BytecodeInterpreter::run< true, true>(interpreterState istate); -template +template void BytecodeInterpreter::run(interpreterState istate) { intptr_t* topOfStack = (intptr_t *)istate->stack(); /* access with STACK macros */ address pc = istate->bcp(); @@ -497,15 +576,15 @@ void BytecodeInterpreter::run(interpreterState istate) { /* 0xC0 */ &&opc_checkcast, &&opc_instanceof, &&opc_monitorenter, &&opc_monitorexit, /* 0xC4 */ &&opc_wide, &&opc_multianewarray, &&opc_ifnull, &&opc_ifnonnull, -/* 0xC8 */ &&opc_goto_w, &&opc_jsr_w, &&opc_breakpoint, &&opc_default, -/* 0xCC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xC8 */ &&opc_goto_w, &&opc_jsr_w, &&opc_breakpoint, &&opc_fast_agetfield, +/* 0xCC */ &&opc_fast_bgetfield,&&opc_fast_cgetfield, &&opc_fast_dgetfield, &&opc_fast_fgetfield, -/* 0xD0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xD4 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xD8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, -/* 0xDC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xD0 */ &&opc_fast_igetfield,&&opc_fast_lgetfield, &&opc_fast_sgetfield, &&opc_fast_aputfield, +/* 0xD4 */ &&opc_fast_bputfield,&&opc_fast_zputfield, &&opc_fast_cputfield, &&opc_fast_dputfield, +/* 0xD8 */ &&opc_fast_fputfield,&&opc_fast_iputfield, &&opc_fast_lputfield, &&opc_fast_sputfield, +/* 0xDC */ &&opc_fast_aload_0, &&opc_fast_iaccess_0, &&opc_fast_aaccess_0, &&opc_fast_faccess_0, -/* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xE0 */ &&opc_fast_iload, &&opc_fast_iload2, &&opc_fast_icaload, &&opc_fast_invokevfinal, /* 0xE4 */ &&opc_default, &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, /* 0xE8 */ &&opc_return_register_finalizer, &&opc_invokehandle, &&opc_default, &&opc_default, @@ -747,10 +826,41 @@ run: UPDATE_PC_AND_TOS_AND_CONTINUE(2, 1); CASE(_iload): + { + if (REWRITE_BYTECODES) { + // Attempt to rewrite iload, iload -> fast_iload2 + // iload, caload -> fast_icaload + // Normal iloads will be rewritten to fast_iload to avoid checking again. + switch (*(pc + 2)) { + case Bytecodes::_fast_iload: + REWRITE_AT_PC(Bytecodes::_fast_iload2); + break; + case Bytecodes::_caload: + REWRITE_AT_PC(Bytecodes::_fast_icaload); + break; + case Bytecodes::_iload: + // Wait until rewritten to _fast_iload. + break; + default: + // Last iload in a (potential) series, don't check again. + REWRITE_AT_PC(Bytecodes::_fast_iload); + } + } + // Normal iload handling. + SET_STACK_SLOT(LOCALS_SLOT(pc[1]), 0); + UPDATE_PC_AND_TOS_AND_CONTINUE(2, 1); + } + + CASE(_fast_iload): CASE(_fload): SET_STACK_SLOT(LOCALS_SLOT(pc[1]), 0); UPDATE_PC_AND_TOS_AND_CONTINUE(2, 1); + CASE(_fast_iload2): + SET_STACK_SLOT(LOCALS_SLOT(pc[1]), 0); + SET_STACK_SLOT(LOCALS_SLOT(pc[3]), 1); + UPDATE_PC_AND_TOS_AND_CONTINUE(4, 2); + CASE(_lload): SET_STACK_LONG_FROM_ADDR(LOCALS_LONG_AT(pc[1]), 1); UPDATE_PC_AND_TOS_AND_CONTINUE(2, 2); @@ -761,11 +871,6 @@ run: #undef OPC_LOAD_n #define OPC_LOAD_n(num) \ - CASE(_aload_##num): \ - VERIFY_OOP(LOCALS_OBJECT(num)); \ - SET_STACK_OBJECT(LOCALS_OBJECT(num), 0); \ - UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1); \ - \ CASE(_iload_##num): \ CASE(_fload_##num): \ SET_STACK_SLOT(LOCALS_SLOT(num), 0); \ @@ -778,10 +883,53 @@ run: SET_STACK_DOUBLE_FROM_ADDR(LOCALS_DOUBLE_AT(num), 1); \ UPDATE_PC_AND_TOS_AND_CONTINUE(1, 2); - OPC_LOAD_n(0); - OPC_LOAD_n(1); - OPC_LOAD_n(2); - OPC_LOAD_n(3); + OPC_LOAD_n(0); + OPC_LOAD_n(1); + OPC_LOAD_n(2); + OPC_LOAD_n(3); + +#undef OPC_ALOAD_n +#define OPC_ALOAD_n(num) \ + CASE(_aload_##num): { \ + oop obj = LOCALS_OBJECT(num); \ + VERIFY_OOP(obj); \ + SET_STACK_OBJECT(obj, 0); \ + UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1); \ + } + + CASE(_aload_0): + { + /* Maybe rewrite if following bytecode is one of the supported _fast_Xgetfield bytecodes. */ + if (REWRITE_BYTECODES) { + switch (*(pc + 1)) { + case Bytecodes::_fast_agetfield: + REWRITE_AT_PC(Bytecodes::_fast_aaccess_0); + break; + case Bytecodes::_fast_fgetfield: + REWRITE_AT_PC(Bytecodes::_fast_faccess_0); + break; + case Bytecodes::_fast_igetfield: + REWRITE_AT_PC(Bytecodes::_fast_iaccess_0); + break; + case Bytecodes::_getfield: { + /* Otherwise, do nothing here, wait until it gets rewritten to _fast_Xgetfield. + * Unfortunately, this punishes volatile field access, because it never gets + * rewritten. */ + break; + } + default: + REWRITE_AT_PC(Bytecodes::_fast_aload_0); + break; + } + } + VERIFY_OOP(LOCALS_OBJECT(0)); + SET_STACK_OBJECT(LOCALS_OBJECT(0), 0); + UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1); + } + + OPC_ALOAD_n(1); + OPC_ALOAD_n(2); + OPC_ALOAD_n(3); /* store to a local variable */ @@ -1313,11 +1461,7 @@ run: /* Array access byte-codes */ - /* Every array access byte-code starts out like this */ -// arrayOopDesc* arrObj = (arrayOopDesc*)STACK_OBJECT(arrayOff); -#define ARRAY_INTRO(arrayOff) \ - arrayOop arrObj = (arrayOop)STACK_OBJECT(arrayOff); \ - jint index = STACK_INT(arrayOff + 1); \ +#define ARRAY_INDEX_CHECK(arrObj, index) \ /* Two integers, the additional message, and the null-terminator */ \ char message[2 * jintAsStringSize + 33]; \ CHECK_NULL(arrObj); \ @@ -1329,6 +1473,13 @@ run: message); \ } + /* Every array access byte-code starts out like this */ +// arrayOopDesc* arrObj = (arrayOopDesc*)STACK_OBJECT(arrayOff); +#define ARRAY_INTRO(arrayOff) \ + arrayOop arrObj = (arrayOop)STACK_OBJECT(arrayOff); \ + jint index = STACK_INT(arrayOff + 1); \ + ARRAY_INDEX_CHECK(arrObj, index) + /* 32-bit loads. These handle conversion from < 32-bit types */ #define ARRAY_LOADTO32(T, T2, format, stackRes, extra) \ { \ @@ -1368,6 +1519,15 @@ run: CASE(_daload): ARRAY_LOADTO64(T_DOUBLE, jdouble, STACK_DOUBLE, 0); + CASE(_fast_icaload): { + // Custom fast access for iload,caload pair. + arrayOop arrObj = (arrayOop) STACK_OBJECT(-1); + jint index = LOCALS_INT(pc[1]); + ARRAY_INDEX_CHECK(arrObj, index); + SET_STACK_INT(*(jchar *)(((address) arrObj->base(T_CHAR)) + index * sizeof(jchar)), -1); + UPDATE_PC_AND_TOS_AND_CONTINUE(3, 0); + } + /* 32-bit stores. These handle conversion to < 32-bit types */ #define ARRAY_STOREFROM32(T, T2, format, stackSrc, extra) \ { \ @@ -1537,26 +1697,6 @@ run: cache = cp->entry_at(index); } - if (JVMTI_ENABLED) { - int *count_addr; - oop obj; - // Check to see if a field modification watch has been set - // before we take the time to call into the VM. - count_addr = (int *)JvmtiExport::get_field_access_count_addr(); - if ( *count_addr > 0 ) { - if ((Bytecodes::Code)opcode == Bytecodes::_getstatic) { - obj = NULL; - } else { - obj = STACK_OBJECT(-1); - VERIFY_OOP(obj); - } - CALL_VM(InterpreterRuntime::post_field_access(THREAD, - obj, - cache), - handle_exception); - } - } - oop obj; if ((Bytecodes::Code)opcode == Bytecodes::_getstatic) { Klass* k = cache->f1_as_klass(); @@ -1565,8 +1705,15 @@ run: } else { obj = STACK_OBJECT(-1); CHECK_NULL(obj); + // Check if we can rewrite non-volatile _getfield to one of the _fast_Xgetfield. + if (REWRITE_BYTECODES && !cache->is_volatile()) { + // Rewrite current BC to _fast_Xgetfield. + REWRITE_AT_PC(fast_get_type(cache->flag_state())); + } } + MAYBE_POST_FIELD_ACCESS(obj); + // // Now store the result on the stack // @@ -1661,33 +1808,6 @@ run: cache = cp->entry_at(index); } - if (JVMTI_ENABLED) { - int *count_addr; - oop obj; - // Check to see if a field modification watch has been set - // before we take the time to call into the VM. - count_addr = (int *)JvmtiExport::get_field_modification_count_addr(); - if ( *count_addr > 0 ) { - if ((Bytecodes::Code)opcode == Bytecodes::_putstatic) { - obj = NULL; - } - else { - if (cache->is_long() || cache->is_double()) { - obj = STACK_OBJECT(-3); - } else { - obj = STACK_OBJECT(-2); - } - VERIFY_OOP(obj); - } - - CALL_VM(InterpreterRuntime::post_field_modification(THREAD, - obj, - cache, - (jvalue *)STACK_SLOT(-1)), - handle_exception); - } - } - // QQQ Need to make this as inlined as possible. Probably need to split all the bytecode cases // out so c++ compiler has a chance for constant prop to fold everything possible away. @@ -1706,8 +1826,16 @@ run: --count; obj = STACK_OBJECT(count); CHECK_NULL(obj); + + // Check if we can rewrite non-volatile _putfield to one of the _fast_Xputfield. + if (REWRITE_BYTECODES && !cache->is_volatile()) { + // Rewrite current BC to _fast_Xputfield. + REWRITE_AT_PC(fast_put_type(cache->flag_state())); + } } + MAYBE_POST_FIELD_MODIFICATION(obj); + // // Now store the result // @@ -2266,6 +2394,10 @@ run: CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); if (cache->is_vfinal()) { callee = cache->f2_as_vfinal_method(); + if (REWRITE_BYTECODES) { + // Rewrite to _fast_invokevfinal. + REWRITE_AT_PC(Bytecodes::_fast_invokevfinal); + } } else { // get receiver int parms = cache->parameter_size(); @@ -2400,6 +2532,329 @@ run: goto opcode_switch; } + CASE(_fast_agetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + VERIFY_OOP(obj->obj_field(field_offset)); + SET_STACK_OBJECT(obj->obj_field(field_offset), -1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_bgetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_INT(obj->byte_field(field_offset), -1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_cgetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_INT(obj->char_field(field_offset), -1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_dgetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_DOUBLE(obj->double_field(field_offset), 0); + MORE_STACK(1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_fgetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_FLOAT(obj->float_field(field_offset), -1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_igetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_INT(obj->int_field(field_offset), -1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_lgetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_LONG(obj->long_field(field_offset), 0); + MORE_STACK(1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_sgetfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = STACK_OBJECT(-1); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_INT(obj->short_field(field_offset), -1); + UPDATE_PC_AND_CONTINUE(3); + } + + CASE(_fast_aputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->obj_field_put(field_offset, STACK_OBJECT(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_bputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->byte_field_put(field_offset, STACK_INT(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_zputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->byte_field_put(field_offset, (STACK_INT(-1) & 1)); // only store LSB + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_cputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->char_field_put(field_offset, STACK_INT(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_dputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-3); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->double_field_put(field_offset, STACK_DOUBLE(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -3); + } + + CASE(_fast_fputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->float_field_put(field_offset, STACK_FLOAT(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_iputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->int_field_put(field_offset, STACK_INT(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_lputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-3); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->long_field_put(field_offset, STACK_LONG(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -3); + } + + CASE(_fast_sputfield): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + oop obj = STACK_OBJECT(-2); + CHECK_NULL(obj); + + MAYBE_POST_FIELD_MODIFICATION(obj); + + int field_offset = cache->f2_as_index(); + obj->short_field_put(field_offset, STACK_INT(-1)); + + UPDATE_PC_AND_TOS_AND_CONTINUE(3, -2); + } + + CASE(_fast_aload_0): { + oop obj = LOCALS_OBJECT(0); + VERIFY_OOP(obj); + SET_STACK_OBJECT(obj, 0); + UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1); + } + + CASE(_fast_aaccess_0): { + u2 index = Bytes::get_native_u2(pc+2); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = LOCALS_OBJECT(0); + CHECK_NULL(obj); + VERIFY_OOP(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + VERIFY_OOP(obj->obj_field(field_offset)); + SET_STACK_OBJECT(obj->obj_field(field_offset), 0); + UPDATE_PC_AND_TOS_AND_CONTINUE(4, 1); + } + + CASE(_fast_faccess_0): { + u2 index = Bytes::get_native_u2(pc+2); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = LOCALS_OBJECT(0); + CHECK_NULL(obj); + VERIFY_OOP(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_INT(obj->int_field(field_offset), 0); + UPDATE_PC_AND_TOS_AND_CONTINUE(4, 1); + } + + CASE(_fast_iaccess_0): { + u2 index = Bytes::get_native_u2(pc+2); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + int field_offset = cache->f2_as_index(); + + oop obj = LOCALS_OBJECT(0); + CHECK_NULL(obj); + VERIFY_OOP(obj); + + MAYBE_POST_FIELD_ACCESS(obj); + + SET_STACK_FLOAT(obj->float_field(field_offset), 0); + UPDATE_PC_AND_TOS_AND_CONTINUE(4, 1); + } + + CASE(_fast_invokevfinal): { + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + assert(cache->is_resolved(Bytecodes::_invokevirtual), "Should be resolved before rewriting"); + + istate->set_msg(call_method); + + CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); + Method* callee = cache->f2_as_vfinal_method(); + istate->set_callee(callee); + if (JVMTI_ENABLED && THREAD->is_interp_only_mode()) { + istate->set_callee_entry_point(callee->interpreter_entry()); + } else { + istate->set_callee_entry_point(callee->from_interpreted_entry()); + } + istate->set_bcp_advance(3); + UPDATE_PC_AND_RETURN(0); + } + DEFAULT: fatal("Unimplemented opcode %d = %s", opcode, Bytecodes::name((Bytecodes::Code)opcode)); diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp index e4a09d492bd..9941055bfd4 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp @@ -503,7 +503,7 @@ static void dup2_x1(intptr_t *tos); /* insert top 2 slots three down */ static void dup2_x2(intptr_t *tos); /* insert top 2 slots four down */ static void swap(intptr_t *tos); /* swap top two elements */ -template +template static void run(interpreterState istate); static void astore(intptr_t* topOfStack, int stack_offset, diff --git a/src/hotspot/share/prims/jvmtiManageCapabilities.cpp b/src/hotspot/share/prims/jvmtiManageCapabilities.cpp index dee9aec8217..e49ca2c776a 100644 --- a/src/hotspot/share/prims/jvmtiManageCapabilities.cpp +++ b/src/hotspot/share/prims/jvmtiManageCapabilities.cpp @@ -326,6 +326,12 @@ void JvmtiManageCapabilities::update() { || avail.can_generate_field_modification_events) { RewriteFrequentPairs = false; +#ifdef ZERO + // The BytecodeInterpreter is specialized only with RewriteBytecodes + // for simplicity. If we want to disable RewriteFrequentPairs, we + // need to disable RewriteBytecodes as well. + RewriteBytecodes = false; +#endif } // If can_redefine_classes is enabled in the onload phase then we know that the -- GitLab From 7719a74cec8c47fd036226b520a5fce7887386da Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 16 Nov 2021 07:49:43 +0000 Subject: [PATCH 335/890] 8277172: Remove stray comment mentioning instr_size_for_decode_klass_not_null on x64 Reviewed-by: dholmes --- src/hotspot/cpu/x86/macroAssembler_x86.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 6a7f671c351..b44e8ee15c8 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -4786,8 +4786,6 @@ void MacroAssembler::encode_and_move_klass_not_null(Register dst, Register src) } } -// !!! If the instructions that get generated here change then function -// instr_size_for_decode_klass_not_null() needs to get updated. void MacroAssembler::decode_klass_not_null(Register r, Register tmp) { assert_different_registers(r, tmp); // Note: it will change flags -- GitLab From 1d79cfd3a16a71ec1bf93a0748e806b21a717b52 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Tue, 16 Nov 2021 08:27:34 +0000 Subject: [PATCH 336/890] 8276229: Stop allowing implicit updates in G1BlockOffsetTable Reviewed-by: tschatzl, ayang --- .../share/gc/g1/g1BlockOffsetTable.cpp | 36 ------------------- .../share/gc/g1/g1BlockOffsetTable.hpp | 23 +++--------- .../share/gc/g1/g1BlockOffsetTable.inline.hpp | 36 ++++++------------- src/hotspot/share/gc/g1/heapRegion.inline.hpp | 6 ---- 4 files changed, 14 insertions(+), 87 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp index fd7ea33ea92..dfb5da1a7a4 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp @@ -213,42 +213,6 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) } } -HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_slow(HeapWord* q, - HeapWord* n, - const void* addr) { - // We're not in the normal case. We need to handle an important subcase - // here: LAB allocation. An allocation previously recorded in the - // offset table was actually a lab allocation, and was divided into - // several objects subsequently. Fix this situation as we answer the - // query, by updating entries as we cross them. - - // If the fist object's end q is at the card boundary. Start refining - // with the corresponding card (the value of the entry will be basically - // set to 0). If the object crosses the boundary -- start from the next card. - size_t n_index = _bot->index_for(n); - size_t next_index = _bot->index_for(n) + !_bot->is_card_boundary(n); - // Calculate a consistent next boundary. If "n" is not at the boundary - // already, step to the boundary. - HeapWord* next_boundary = _bot->address_for_index(n_index) + - (n_index == next_index ? 0 : BOTConstants::N_words); - assert(next_boundary <= _bot->_reserved.end(), - "next_boundary is beyond the end of the covered region " - " next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT, - p2i(next_boundary), p2i(_bot->_reserved.end())); - while (next_boundary < addr) { - while (n <= next_boundary) { - q = n; - oop obj = cast_to_oop(q); - if (obj->klass_or_null_acquire() == NULL) return q; - n += block_size(q); - } - assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); - // [q, n) is the block that crosses the boundary. - alloc_block_work(&next_boundary, q, n); - } - return forward_to_block_containing_addr_const(q, n, addr); -} - // // threshold_ // | _index_ diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp index 89a91d5bce2..128e9d105a2 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp @@ -141,26 +141,11 @@ private: // Returns the address of a block whose start is at most "addr". inline HeapWord* block_at_or_preceding(const void* addr) const; + // Return the address of the beginning of the block that contains "addr". // "q" is a block boundary that is <= "addr"; "n" is the address of the - // next block (or the end of the space.) Return the address of the - // beginning of the block that contains "addr". Does so without side - // effects (see, e.g., spec of block_start.) - inline HeapWord* forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, - const void* addr) const; - - // "q" is a block boundary that is <= "addr"; return the address of the - // beginning of the block that contains "addr". May have side effects - // on "this", by updating imprecise entries. - inline HeapWord* forward_to_block_containing_addr(HeapWord* q, - const void* addr); - - // "q" is a block boundary that is <= "addr"; "n" is the address of the - // next block (or the end of the space.) Return the address of the - // beginning of the block that contains "addr". May have side effects - // on "this", by updating imprecise entries. - HeapWord* forward_to_block_containing_addr_slow(HeapWord* q, - HeapWord* n, - const void* addr); + // next block (or the end of the space.) + inline HeapWord* forward_to_block_containing_addr(HeapWord* q, HeapWord* n, + const void* addr) const; // Requires that "*threshold_" be the first array entry boundary at or // above "blk_start". If the block starts at or crosses "*threshold_", records diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp index 104200eeea2..e4e24c219de 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp @@ -46,16 +46,10 @@ inline HeapWord* G1BlockOffsetTablePart::threshold_for_addr(const void* addr) { } inline HeapWord* G1BlockOffsetTablePart::block_start(const void* addr) { - assert(addr >= _hr->bottom() && addr < _hr->top(), "invalid address"); - HeapWord* q = block_at_or_preceding(addr); - return forward_to_block_containing_addr(q, addr); -} - -inline HeapWord* G1BlockOffsetTablePart::block_start_const(const void* addr) const { assert(addr >= _hr->bottom() && addr < _hr->top(), "invalid address"); HeapWord* q = block_at_or_preceding(addr); HeapWord* n = q + block_size(q); - return forward_to_block_containing_addr_const(q, n, addr); + return forward_to_block_containing_addr(q, n, addr); } u_char G1BlockOffsetTable::offset_array(size_t index) const { @@ -141,9 +135,16 @@ inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr) return q; } -inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, - const void* addr) const { +inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr(HeapWord* q, HeapWord* n, + const void* addr) const { while (n <= addr) { + // When addr is not covered by the block starting at q we need to + // step forward until we find the correct block. With the BOT + // being precise, we should never have to step through more than + // a single card. + assert(_bot->index_for(n) == _bot->index_for(addr), + "BOT not precise. Index for n: " SIZE_FORMAT " must be equal to the index for addr: " SIZE_FORMAT, + _bot->index_for(n), _bot->index_for(addr)); q = n; oop obj = cast_to_oop(q); if (obj->klass_or_null_acquire() == NULL) { @@ -156,21 +157,4 @@ inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_const( return q; } -inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr(HeapWord* q, - const void* addr) { - if (cast_to_oop(q)->klass_or_null_acquire() == NULL) { - return q; - } - HeapWord* n = q + block_size(q); - // In the normal case, where the query "addr" is a card boundary, and the - // offset table chunks are the same size as cards, the block starting at - // "q" will contain addr, so the test below will fail, and we'll fall - // through quickly. - if (n <= addr) { - q = forward_to_block_containing_addr_slow(q, n, addr); - } - assert(q <= addr, "wrong order for current and arg"); - return q; -} - #endif // SHARE_GC_G1_G1BLOCKOFFSETTABLE_INLINE_HPP diff --git a/src/hotspot/share/gc/g1/heapRegion.inline.hpp b/src/hotspot/share/gc/g1/heapRegion.inline.hpp index 3d07d61fe24..120715562ab 100644 --- a/src/hotspot/share/gc/g1/heapRegion.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.inline.hpp @@ -84,10 +84,6 @@ inline HeapWord* HeapRegion::block_start(const void* p) { return _bot_part.block_start(p); } -inline HeapWord* HeapRegion::block_start_const(const void* p) const { - return _bot_part.block_start_const(p); -} - inline bool HeapRegion::is_obj_dead_with_size(const oop obj, const G1CMBitMap* const prev_bitmap, size_t* size) const { HeapWord* addr = cast_from_oop(obj); @@ -356,8 +352,6 @@ HeapWord* HeapRegion::oops_on_memregion_seq_iterate_careful(MemRegion mr, HeapWord* const end = mr.end(); // Find the obj that extends onto mr.start(). - // Update BOT as needed while finding start of (possibly dead) - // object containing the start of the region. HeapWord* cur = block_start(start); #ifdef ASSERT -- GitLab From b8d33a2a4e4ac1be322644102e8f09ce1435b4fb Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 16 Nov 2021 09:49:03 +0000 Subject: [PATCH 337/890] 8277029: JMM GetDiagnosticXXXInfo APIs should verify output array sizes Reviewed-by: dholmes, sspitsyn --- src/hotspot/share/include/jmm.h | 3 ++- src/hotspot/share/services/management.cpp | 10 ++++++---- .../native/libmanagement_ext/DiagnosticCommandImpl.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/include/jmm.h b/src/hotspot/share/include/jmm.h index d7788e7a4e8..ee1c77e504a 100644 --- a/src/hotspot/share/include/jmm.h +++ b/src/hotspot/share/include/jmm.h @@ -333,7 +333,8 @@ typedef struct jmmInterface_1_ { void (JNICALL *GetDiagnosticCommandArgumentsInfo) (JNIEnv *env, jstring commandName, - dcmdArgInfo *infoArray); + dcmdArgInfo *infoArray, + jint count); jstring (JNICALL *ExecuteDiagnosticCommand) (JNIEnv *env, jstring command); diff --git a/src/hotspot/share/services/management.cpp b/src/hotspot/share/services/management.cpp index 7f103ea7849..09c8750f6f9 100644 --- a/src/hotspot/share/services/management.cpp +++ b/src/hotspot/share/services/management.cpp @@ -2015,7 +2015,7 @@ JVM_ENTRY(void, jmm_GetDiagnosticCommandInfo(JNIEnv *env, jobjectArray cmds, JVM_END JVM_ENTRY(void, jmm_GetDiagnosticCommandArgumentsInfo(JNIEnv *env, - jstring command, dcmdArgInfo* infoArray)) + jstring command, dcmdArgInfo* infoArray, jint count)) ResourceMark rm(THREAD); oop cmd = JNIHandles::resolve_external_guard(command); if (cmd == NULL) { @@ -2039,10 +2039,12 @@ JVM_ENTRY(void, jmm_GetDiagnosticCommandArgumentsInfo(JNIEnv *env, } DCmdMark mark(dcmd); GrowableArray* array = dcmd->argument_info_array(); - if (array->length() == 0) { - return; + const int num_args = array->length(); + if (num_args != count) { + assert(false, "jmm_GetDiagnosticCommandArgumentsInfo count mismatch (%d vs %d)", count, num_args); + THROW_MSG(vmSymbols::java_lang_InternalError(), "jmm_GetDiagnosticCommandArgumentsInfo count mismatch"); } - for (int i = 0; i < array->length(); i++) { + for (int i = 0; i < num_args; i++) { infoArray[i].name = array->at(i)->name(); infoArray[i].description = array->at(i)->description(); infoArray[i].type = array->at(i)->type(); diff --git a/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c b/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c index b94c60589c9..021fd7c2db6 100644 --- a/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c +++ b/src/jdk.management/share/native/libmanagement_ext/DiagnosticCommandImpl.c @@ -79,7 +79,7 @@ jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command, return NULL; } jmm_interface->GetDiagnosticCommandArgumentsInfo(env, command, - dcmd_arg_info_array); + dcmd_arg_info_array, num_arg); dcmdArgInfoCls = (*env)->FindClass(env, "com/sun/management/internal/DiagnosticCommandArgumentInfo"); POP_EXCEPTION_CHECK_AND_FREE(0, dcmd_arg_info_array); -- GitLab From 20f3872d1cd6257ab9c76bb998f8dc2d07bc1724 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 16 Nov 2021 11:13:24 +0000 Subject: [PATCH 338/890] 8274261: Use enhanced-for instead of plain 'for' in jdk.jcmd Reviewed-by: sspitsyn, cjplummer --- .../share/classes/sun/tools/jmap/JMap.java | 13 +++++------- .../classes/sun/tools/jstat/Arguments.java | 6 +++--- .../classes/sun/tools/jstat/ColumnFormat.java | 9 +++----- .../classes/sun/tools/jstat/OptionFormat.java | 17 +++++++-------- .../share/classes/sun/tools/jstat/Parser.java | 21 +++++++------------ .../sun/tools/jstat/RawOutputFormatter.java | 8 +++---- 6 files changed, 30 insertions(+), 44 deletions(-) diff --git a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java index e383f8dc7af..8939d60930d 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java @@ -31,7 +31,6 @@ import java.io.InputStream; import java.util.Collection; import com.sun.tools.attach.VirtualMachine; -import com.sun.tools.attach.VirtualMachineDescriptor; import com.sun.tools.attach.AttachNotSupportedException; import sun.tools.attach.HotSpotVirtualMachine; import sun.tools.common.ProcessArgumentMatcher; @@ -171,8 +170,7 @@ public class JMap { String parallel = null; String subopts[] = options.split(","); - for (int i = 0; i < subopts.length; i++) { - String subopt = subopts[i]; + for (String subopt : subopts) { if (subopt.equals("") || subopt.equals("all")) { // pass } else if (subopt.equals("live")) { @@ -184,11 +182,11 @@ public class JMap { usage(1); } } else if (subopt.startsWith("parallel=")) { - parallel = subopt.substring("parallel=".length()); - if (parallel == null) { + parallel = subopt.substring("parallel=".length()); + if (parallel == null) { System.err.println("Fail: no number provided in option: '" + subopt + "'"); usage(1); - } + } } else { System.err.println("Fail: invalid option: '" + subopt + "'"); usage(1); @@ -209,8 +207,7 @@ public class JMap { String liveopt = "-all"; String compress_level = null; - for (int i = 0; i < subopts.length; i++) { - String subopt = subopts[i]; + for (String subopt : subopts) { if (subopt.equals("") || subopt.equals("all")) { // pass } else if (subopt.equals("live")) { diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java index 5441725d06b..ffaa38a0b50 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -115,8 +115,8 @@ public class Arguments { String unitString = null; String valueString = s; - for (int i = 0; i < unitStrings.length; i++) { - int index = s.indexOf(unitStrings[i]); + for (String unit : unitStrings) { + int index = s.indexOf(unit); if (index > 0) { unitString = s.substring(index); valueString = s.substring(0, index); diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java index fc0dfe0483c..c716a6e079b 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,8 +25,6 @@ package sun.tools.jstat; -import java.util.*; - /** * A class to represent the format for a column of data. * @@ -156,9 +154,8 @@ public class ColumnFormat extends OptionFormat { + ";scale=" + scale.toString() + ";align=" + align.toString() + ";required=" + required); - for (Iterator i = children.iterator(); i.hasNext(); /* empty */) { - OptionFormat of = i.next(); - of.printFormat(indentLevel+1); + for (OptionFormat of : children) { + of.printFormat(indentLevel + 1); } System.out.println(indent + "}"); diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionFormat.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionFormat.java index c5d9f79c43f..ee72b05456e 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionFormat.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -77,15 +77,14 @@ public class OptionFormat { public void apply(Closure c) throws MonitorException { - for (Iterator i = children.iterator(); i.hasNext(); /* empty */) { - OptionFormat o = i.next(); - c.visit(o, i.hasNext()); - } + for (Iterator i = children.iterator(); i.hasNext(); /* empty */) { + OptionFormat o = i.next(); + c.visit(o, i.hasNext()); + } - for (Iterator i = children.iterator(); i.hasNext(); /* empty */) { - OptionFormat o = i.next(); - o.apply(c); - } + for (OptionFormat o : children) { + o.apply(c); + } } public void printFormat() { diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java index 5693e422fe6..01dd5c9382d 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -80,7 +80,7 @@ public class Parser { }; - private static Set reservedWords; + private static final Set reservedWords = Set.of(otherKeyWords); private StreamTokenizer st; private String filename; @@ -103,17 +103,12 @@ public class Parser { st.slashSlashComments(true); st.slashStarComments(true); - reservedWords = new HashSet(); - for (int i = 0; i < otherKeyWords.length; i++) { - reservedWords.add(otherKeyWords[i]); + for (char delimiter : delimiters) { + st.ordinaryChar(delimiter); } - for (int i = 0; i < delimiters.length; i++ ) { - st.ordinaryChar(delimiters[i]); - } - - for (int i = 0; i < infixOps.length; i++ ) { - st.ordinaryChar(infixOps[i]); + for (char infixOp : infixOps) { + st.ordinaryChar(infixOp); } } @@ -231,8 +226,8 @@ public class Parser { * determine if the give work is a reserved key word */ private boolean isInfixOperator(char op) { - for (int i = 0; i < infixOps.length; i++) { - if (op == infixOps[i]) { + for (char infixOp : infixOps) { + if (op == infixOp) { return true; } } diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/RawOutputFormatter.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/RawOutputFormatter.java index cbd129cbe50..02a083ba1cd 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/RawOutputFormatter.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/RawOutputFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,8 +48,7 @@ public class RawOutputFormatter implements OutputFormatter { if (header == null) { // build the header string and prune out any unwanted monitors StringBuilder headerBuilder = new StringBuilder(); - for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { - Monitor m = i.next(); + for (Monitor m : logged) { headerBuilder.append(m.getName()).append(' '); } header = headerBuilder.toString(); @@ -60,8 +59,7 @@ public class RawOutputFormatter implements OutputFormatter { public String getRow() throws MonitorException { StringBuilder row = new StringBuilder(); int count = 0; - for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) { - Monitor m = i.next(); + for (Monitor m : logged) { if (count++ > 0) { row.append(" "); } -- GitLab From a9cb8bdbaac7241959805c491b6d13b6e14f8966 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 16 Nov 2021 11:14:37 +0000 Subject: [PATCH 339/890] 8274168: Avoid String.compareTo == 0 to check String equality in java.management Reviewed-by: sspitsyn, dfuchs, cjplummer, dholmes --- .../javax/management/BinaryRelQueryExp.java | 13 ++++---- .../javax/management/loading/MLet.java | 33 ++++++------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/src/java.management/share/classes/javax/management/BinaryRelQueryExp.java b/src/java.management/share/classes/javax/management/BinaryRelQueryExp.java index 4f8a9f4cbff..0bedf209a63 100644 --- a/src/java.management/share/classes/javax/management/BinaryRelQueryExp.java +++ b/src/java.management/share/classes/javax/management/BinaryRelQueryExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -167,17 +167,18 @@ class BinaryRelQueryExp extends QueryEval implements QueryExp { String sval1 = ((StringValueExp)val1).getValue(); String sval2 = ((StringValueExp)val2).getValue(); + int cmp = sval1.compareTo(sval2); switch (relOp) { case Query.GT: - return sval1.compareTo(sval2) > 0; + return cmp > 0; case Query.LT: - return sval1.compareTo(sval2) < 0; + return cmp < 0; case Query.GE: - return sval1.compareTo(sval2) >= 0; + return cmp >= 0; case Query.LE: - return sval1.compareTo(sval2) <= 0; + return cmp <= 0; case Query.EQ: - return sval1.compareTo(sval2) == 0; + return cmp == 0; } } diff --git a/src/java.management/share/classes/javax/management/loading/MLet.java b/src/java.management/share/classes/javax/management/loading/MLet.java index 4adf762c693..bff07766d57 100644 --- a/src/java.management/share/classes/javax/management/loading/MLet.java +++ b/src/java.management/share/classes/javax/management/loading/MLet.java @@ -25,16 +25,12 @@ package javax.management.loading; -// Java import -import com.sun.jmx.defaults.JmxProperties; - import com.sun.jmx.defaults.ServiceName; import com.sun.jmx.remote.util.EnvHelp; import java.io.Externalizable; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInput; @@ -71,7 +67,6 @@ import javax.management.ReflectionException; import static com.sun.jmx.defaults.JmxProperties.MLET_LIB_DIR; import static com.sun.jmx.defaults.JmxProperties.MLET_LOGGER; -import com.sun.jmx.defaults.ServiceName; import javax.management.ServiceNotFoundException; /** @@ -1270,24 +1265,16 @@ public class MLet extends java.net.URLClassLoader MLET_LOGGER.log(Level.DEBUG, "Got unexpected exception", e); } } - if (type.compareTo("java.lang.Boolean") == 0) - return Boolean.valueOf(param); - if (type.compareTo("java.lang.Byte") == 0) - return Byte.valueOf(param); - if (type.compareTo("java.lang.Short") == 0) - return Short.valueOf(param); - if (type.compareTo("java.lang.Long") == 0) - return Long.valueOf(param); - if (type.compareTo("java.lang.Integer") == 0) - return Integer.valueOf(param); - if (type.compareTo("java.lang.Float") == 0) - return Float.valueOf(param); - if (type.compareTo("java.lang.Double") == 0) - return Double.valueOf(param); - if (type.compareTo("java.lang.String") == 0) - return param; - - return param; + return switch (type) { + case "java.lang.Boolean" -> Boolean.valueOf(param); + case "java.lang.Byte" -> Byte.valueOf(param); + case "java.lang.Short" -> Short.valueOf(param); + case "java.lang.Long" -> Long.valueOf(param); + case "java.lang.Integer" -> Integer.valueOf(param); + case "java.lang.Float" -> Float.valueOf(param); + case "java.lang.Double" -> Double.valueOf(param); + default -> param; + }; } @SuppressWarnings("removal") -- GitLab From 0bc268377ed5d2dd15bdd7283a77b59ad505e2b7 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 16 Nov 2021 11:15:52 +0000 Subject: [PATCH 340/890] 8274190: Use String.equals instead of String.compareTo in jdk.internal.jvmstat Reviewed-by: cjplummer, sspitsyn --- .../share/classes/sun/jvmstat/monitor/HostIdentifier.java | 6 +++--- .../share/classes/sun/jvmstat/monitor/MonitoredHost.java | 4 ++-- .../share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java | 4 ++-- .../share/classes/sun/jvmstat/monitor/VmIdentifier.java | 2 +- .../sun/jvmstat/perfdata/monitor/AliasFileParser.java | 7 +++---- .../perfdata/monitor/protocol/file/PerfDataBuffer.java | 7 +++---- .../sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java | 3 +-- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java index b80fccaf52f..c7472e75abd 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/HostIdentifier.java @@ -106,7 +106,7 @@ public class HostIdentifier { * by the string. */ private URI canonicalize(String uriString) throws URISyntaxException { - if ((uriString == null) || (uriString.compareTo("localhost") == 0)) { + if (uriString == null || uriString.equals("localhost")) { uriString = "//localhost"; return new URI(uriString); } @@ -247,7 +247,7 @@ public class HostIdentifier { String authority = vmid.getAuthority(); // check for 'file:' VmIdentifiers and handled as a special case. - if ((scheme != null) && (scheme.compareTo("file") == 0)) { + if ("file".equals(scheme)) { try { uri = new URI("file://localhost"); } catch (URISyntaxException e) { }; @@ -343,7 +343,7 @@ public class HostIdentifier { String host = vmid.getHost(); String authority = vmid.getAuthority(); - if ((scheme != null) && (scheme.compareTo("file") == 0)) { + if ("file".equals(scheme)) { // don't attempt to resolve a file based VmIdentifier. return vmid; } diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredHost.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredHost.java index b119a004520..12969fa670e 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredHost.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredHost.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -203,7 +203,7 @@ public abstract class MonitoredHost { assert hostname != null; if (scheme == null) { - if (hostname.compareTo("localhost") == 0) { + if (hostname.equals("localhost")) { scheme = LOCAL_PROTOCOL; } else { scheme = REMOTE_PROTOCOL; diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java index 7c1149bdc34..81e1e962077 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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,7 +82,7 @@ public class MonitoredVmUtil { int firstSpace = commandLine.indexOf(' '); if (firstSpace > 0) { return commandLine.substring(firstSpace + 1); - } else if (commandLine.compareTo("Unknown") == 0) { + } else if (commandLine.equals("Unknown")) { return commandLine; } else { return null; diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java index 6e7f1cc1f77..da484b1c878 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/monitor/VmIdentifier.java @@ -174,7 +174,7 @@ public class VmIdentifier { private void validate() throws URISyntaxException { // file:// uri, which is a special case where the lvmid is not required. String s = getScheme(); - if ((s != null) && (s.compareTo("file") == 0)) { + if ("file".equals(s)) { return; } if (getLocalVmId() == -1) { diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AliasFileParser.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AliasFileParser.java index 3a4134bc6f9..3b5d35eafbf 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AliasFileParser.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AliasFileParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -28,7 +28,6 @@ package sun.jvmstat.perfdata.monitor; import java.net.*; import java.io.*; import java.util.*; -import java.util.regex.*; /** * Class for parsing alias files. File format is expected to follow @@ -127,7 +126,7 @@ public class AliasFileParser { while (currentToken.ttype != StreamTokenizer.TT_EOF) { // look for the start symbol if ((currentToken.ttype != StreamTokenizer.TT_WORD) - || (currentToken.sval.compareTo(ALIAS) != 0)) { + || !currentToken.sval.equals(ALIAS)) { nextToken(); continue; } @@ -143,7 +142,7 @@ public class AliasFileParser { match(StreamTokenizer.TT_WORD); } while ((currentToken.ttype != StreamTokenizer.TT_EOF) - && (currentToken.sval.compareTo(ALIAS) != 0)); + && !currentToken.sval.equals(ALIAS)); map.put(name, aliases); } diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/PerfDataBuffer.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/PerfDataBuffer.java index 9e42ac4f4d8..e6feb5759c7 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/PerfDataBuffer.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/file/PerfDataBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -28,7 +28,6 @@ package sun.jvmstat.perfdata.monitor.protocol.file; import sun.jvmstat.monitor.*; import sun.jvmstat.perfdata.monitor.*; import java.io.*; -import java.net.URI; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; @@ -60,9 +59,9 @@ public class PerfDataBuffer extends AbstractPerfDataBuffer { FileChannel fc = new RandomAccessFile(f, mode).getChannel(); ByteBuffer bb = null; - if (mode.compareTo("r") == 0) { + if (mode.equals("r")) { bb = fc.map(FileChannel.MapMode.READ_ONLY, 0L, (int)fc.size()); - } else if (mode.compareTo("rw") == 0) { + } else if (mode.equals("rw")) { bb = fc.map(FileChannel.MapMode.READ_WRITE, 0L, (int)fc.size()); } else { throw new IllegalArgumentException("Invalid mode: " + mode); diff --git a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java index d9f981e7de0..60c512b9e41 100644 --- a/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java +++ b/src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java @@ -28,7 +28,6 @@ package sun.jvmstat.perfdata.monitor.v1_0; import sun.jvmstat.monitor.*; import sun.jvmstat.perfdata.monitor.*; import java.util.*; -import java.util.regex.*; import java.nio.*; /** @@ -360,7 +359,7 @@ public class PerfDataBuffer extends PerfDataBufferImpl { String cname = "hotspot.gc.collector.0.name"; StringMonitor collector = (StringMonitor)map.get(cname); - if (collector.stringValue().compareTo("PSScavenge") == 0) { + if (collector.stringValue().equals("PSScavenge")) { boolean adaptiveSizePolicy = true; /* -- GitLab From 9629627e2c8021c254517ac5463cc66723175fd9 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 16 Nov 2021 11:17:08 +0000 Subject: [PATCH 341/890] 8274163: Use String.equals instead of String.compareTo in jdk.jcmd Reviewed-by: cjplummer, amenkov, sspitsyn --- .../classes/sun/tools/jps/Arguments.java | 12 +++---- .../classes/sun/tools/jstat/Arguments.java | 36 +++++++++---------- .../classes/sun/tools/jstat/OptionLister.java | 4 +-- .../share/classes/sun/tools/jstat/Parser.java | 18 +++++----- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/jdk.jcmd/share/classes/sun/tools/jps/Arguments.java b/src/jdk.jcmd/share/classes/sun/tools/jps/Arguments.java index 10db7c39aa9..be37f408c51 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jps/Arguments.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jps/Arguments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -64,11 +64,11 @@ public class Arguments { int argc = 0; if (args.length == 1) { - if ((args[0].compareTo("-?") == 0) - || (args[0].compareTo("-h")== 0) - || (args[0].compareTo("--help")== 0) + if ((args[0].equals("-?")) + || (args[0].equals("-h")) + || (args[0].equals("--help")) // -help: legacy. - || (args[0].compareTo("-help")== 0)) { + || (args[0].equals("-help"))) { help = true; return; } @@ -78,7 +78,7 @@ public class Arguments { argc++) { String arg = args[argc]; - if (arg.compareTo("-q") == 0) { + if (arg.equals("-q")) { quiet = true; } else if (arg.startsWith("-")) { for (int j = 1; j < arg.length(); j++) { diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java index ffaa38a0b50..553a902e33f 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/Arguments.java @@ -127,9 +127,9 @@ public class Arguments { try { int value = Integer.parseInt(valueString); - if (unitString == null || unitString.compareTo("ms") == 0) { + if (unitString == null || unitString.equals("ms")) { return value; - } else if (unitString.compareTo("s") == 0) { + } else if (unitString.equals("s")) { return value * 1000; } else { throw new IllegalArgumentException( @@ -149,17 +149,17 @@ public class Arguments { return; } - if ((args[0].compareTo("-?") == 0) - || (args[0].compareTo("-h") == 0) - || (args[0].compareTo("--help") == 0) + if ((args[0].equals("-?")) + || (args[0].equals("-h")) + || (args[0].equals("--help")) // -help: legacy. - || (args[0].compareTo("-help") == 0)) { + || (args[0].equals("-help"))) { help = true; return; - } else if (args[0].compareTo("-options") == 0) { + } else if (args[0].equals("-options")) { options = true; return; - } else if (args[0].compareTo("-list") == 0) { + } else if (args[0].equals("-list")) { list = true; if (args.length > 2) { throw new IllegalArgumentException("invalid argument count"); @@ -171,23 +171,23 @@ public class Arguments { for ( ; (argc < args.length) && (args[argc].startsWith("-")); argc++) { String arg = args[argc]; - if (arg.compareTo("-a") == 0) { + if (arg.equals("-a")) { comparator = new AscendingMonitorComparator(); - } else if (arg.compareTo("-d") == 0) { + } else if (arg.equals("-d")) { comparator = new DescendingMonitorComparator(); - } else if (arg.compareTo("-t") == 0) { + } else if (arg.equals("-t")) { timestamp = true; - } else if (arg.compareTo("-v") == 0) { + } else if (arg.equals("-v")) { verbose = true; - } else if ((arg.compareTo("-constants") == 0) - || (arg.compareTo("-c") == 0)) { + } else if ((arg.equals("-constants")) + || (arg.equals("-c"))) { constants = true; - } else if ((arg.compareTo("-strings") == 0) - || (arg.compareTo("-s") == 0)) { + } else if ((arg.equals("-strings")) + || (arg.equals("-s"))) { strings = true; } else if (arg.startsWith("-h")) { String value; - if (arg.compareTo("-h") != 0) { + if (!arg.equals("-h")) { value = arg.substring(2); } else { argc++; @@ -245,7 +245,7 @@ public class Arguments { } catch (NumberFormatException nfe) { // it didn't parse. check for the -snap or jstat_options // file options. - if ((argc == 0) && (args[argc].compareTo("-snap") == 0)) { + if ((argc == 0) && (args[argc].equals("-snap"))) { snap = true; } else if (argc == 0) { specialOption = args[argc].substring(1); diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionLister.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionLister.java index 384b6a54383..c417236344c 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionLister.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/OptionLister.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -73,7 +73,7 @@ public class OptionLister { } for ( OptionFormat of : options) { - if (of.getName().compareTo("timestamp") == 0) { + if (of.getName().equals("timestamp")) { // ignore the special timestamp OptionFormat. continue; } diff --git a/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java b/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java index 01dd5c9382d..70e3553e77e 100644 --- a/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java +++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java @@ -468,19 +468,19 @@ public class Parser { return; } - if (lookahead.sval.compareTo(DATA) == 0) { + if (lookahead.sval.equals(DATA)) { dataStmt(cf); - } else if (lookahead.sval.compareTo(HEADER) == 0) { + } else if (lookahead.sval.equals(HEADER)) { headerStmt(cf); - } else if (lookahead.sval.compareTo(WIDTH) == 0) { + } else if (lookahead.sval.equals(WIDTH)) { widthStmt(cf); - } else if (lookahead.sval.compareTo(FORMAT) == 0) { + } else if (lookahead.sval.equals(FORMAT)) { formatStmt(cf); - } else if (lookahead.sval.compareTo(ALIGN) == 0) { + } else if (lookahead.sval.equals(ALIGN)) { alignStmt(cf); - } else if (lookahead.sval.compareTo(SCALE) == 0) { + } else if (lookahead.sval.equals(SCALE)) { scaleStmt(cf); - } else if (lookahead.sval.compareTo(REQUIRED) == 0) { + } else if (lookahead.sval.equals(REQUIRED)) { requiredStmt(cf); } else { return; @@ -539,7 +539,7 @@ public class Parser { while (lookahead.ttype != StreamTokenizer.TT_EOF) { // look for the start symbol if ((lookahead.ttype != StreamTokenizer.TT_WORD) - || (lookahead.sval.compareTo(START) != 0)) { + || (!lookahead.sval.equals(START))) { // skip tokens until a start symbol is found nextToken(); continue; @@ -569,7 +569,7 @@ public class Parser { while (lookahead.ttype != StreamTokenizer.TT_EOF) { // look for the start symbol if ((lookahead.ttype != StreamTokenizer.TT_WORD) - || (lookahead.sval.compareTo(START) != 0)) { + || (!lookahead.sval.equals(START))) { // skip tokens until a start symbol is found nextToken(); continue; -- GitLab From c06df25a4fb76ee65d3fa99ec0579ca4a406c345 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 16 Nov 2021 11:18:10 +0000 Subject: [PATCH 342/890] 8274662: Replace 'while' cycles with iterator with enhanced-for in jdk.hotspot.agent Reviewed-by: amenkov, cjplummer, sspitsyn --- .../jvm/hotspot/runtime/DeadlockDetector.java | 16 +++++----------- .../sun/jvm/hotspot/ui/FindInHeapPanel.java | 8 +++----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java index c053d718fb8..4d41e087aaa 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2021, 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 @@ -55,16 +55,14 @@ public class DeadlockDetector { heap = VM.getVM().getObjectHeap(); createThreadTable(); - Iterator i = threadTable.entrySet().iterator(); - while (i.hasNext()) { - Entry e = (Entry)i.next(); - if (dfn(e) >= 0) { + for (Entry e : threadTable.entrySet()) { + if (e.getValue() >= 0) { // this thread was already visited continue; } thisDfn = globalDfn; - JavaThread thread = (JavaThread)e.getKey(); + JavaThread thread = e.getKey(); previousThread = thread; // When there is a deadlock, all the monitors involved in the dependency @@ -118,7 +116,7 @@ public class DeadlockDetector { break; } previousThread = currentThread; - waitingToLockMonitor = (ObjectMonitor)currentThread.getCurrentPendingMonitor(); + waitingToLockMonitor = currentThread.getCurrentPendingMonitor(); if (concurrentLocks) { waitingToLockBlocker = currentThread.getCurrentParkBlocker(); } @@ -162,10 +160,6 @@ public class DeadlockDetector { return -1; } - private static int dfn(Entry e) { - return ((Integer)e.getValue()).intValue(); - } - private static void printOneDeadlock(PrintStream tty, JavaThread thread, boolean concurrentLocks) { tty.println("Found one Java-level deadlock:"); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java index 94a535072de..ced929dea16 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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,7 +25,6 @@ package sun.jvm.hotspot.ui; import java.util.*; -import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; @@ -193,9 +192,8 @@ public class FindInHeapPanel extends JPanel { private synchronized void updateResultWindow() { if (updates.size() > 0) { - Iterator i = updates.iterator(); - while (i.hasNext()) { - textArea.append((String)i.next()); + for (String update : updates) { + textArea.append(update); } updates = new ArrayList<>();; } -- GitLab From 1c45c8a08287e2d8d7574eaa773850b7f0b33207 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 16 Nov 2021 11:19:01 +0000 Subject: [PATCH 343/890] 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module Reviewed-by: dfuchs, sspitsyn --- .../remote/rmi/RMIConnectionImpl.java | 3 +-- .../management/remote/rmi/RMIConnector.java | 6 ++---- .../remote/rmi/RMIConnectorServer.java | 12 ++++-------- .../DefaultMBeanServerInterceptor.java | 5 +---- .../internal/ArrayNotificationBuffer.java | 4 +--- .../remote/internal/ClientNotifForwarder.java | 19 ++++--------------- .../remote/internal/ServerNotifForwarder.java | 4 +--- .../security/JMXPluggableAuthenticator.java | 5 +---- .../OpenMBeanAttributeInfoSupport.java | 7 ++----- .../remote/JMXConnectorFactory.java | 3 +-- 10 files changed, 18 insertions(+), 50 deletions(-) diff --git a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java index bbd491260a8..bedeaea4ba8 100644 --- a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java +++ b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java @@ -1648,8 +1648,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { */ private static IOException newIOException(String message, Throwable cause) { - final IOException x = new IOException(message); - return EnvHelp.initCause(x,cause); + return new IOException(message, cause); } /** diff --git a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java index 7a903122ad7..d875ce3a5bb 100644 --- a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -367,7 +367,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable } catch (NamingException e) { final String msg = "Failed to retrieve RMIServer stub: " + e; if (tracing) logger.trace("connect",idstr + " " + msg); - throw EnvHelp.initCause(new IOException(msg),e); + throw new IOException(msg, e); } } @@ -543,9 +543,7 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable throw (IOException) closeException; if (closeException instanceof RuntimeException) throw (RuntimeException) closeException; - final IOException x = - new IOException("Failed to close: " + closeException); - throw EnvHelp.initCause(x,closeException); + throw new IOException("Failed to close: " + closeException, closeException); } } diff --git a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java index a918921356e..139b7653424 100644 --- a/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java +++ b/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectorServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -420,8 +420,7 @@ public class RMIConnectorServer extends JMXConnectorServer { try { mbsf = new MBeanServerFileAccessController(accessFile); } catch (IOException e) { - throw EnvHelp.initCause( - new IllegalArgumentException(e.getMessage()), e); + throw new IllegalArgumentException(e.getMessage(), e); } // Set the MBeanServerForwarder // @@ -434,9 +433,7 @@ public class RMIConnectorServer extends JMXConnectorServer { defaultClassLoader = EnvHelp.resolveServerClassLoader( attributes, getMBeanServer()); } catch (InstanceNotFoundException infc) { - IllegalArgumentException x = new - IllegalArgumentException("ClassLoader not found: "+infc); - throw EnvHelp.initCause(x,infc); + throw new IllegalArgumentException("ClassLoader not found: " + infc, infc); } if (tracing) logger.trace("start", "setting RMIServer object"); @@ -831,8 +828,7 @@ public class RMIConnectorServer extends JMXConnectorServer { */ private static IOException newIOException(String message, Throwable cause) { - final IOException x = new IOException(message); - return EnvHelp.initCause(x,cause); + return new IOException(message, cause); } diff --git a/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java b/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java index 0a8350be8eb..0b817e47463 100644 --- a/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java +++ b/src/java.management/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java @@ -38,7 +38,6 @@ import com.sun.jmx.mbeanserver.Repository.RegistrationContext; import com.sun.jmx.mbeanserver.Util; import com.sun.jmx.remote.util.EnvHelp; -import java.io.ObjectInputStream; import java.lang.ref.WeakReference; import java.security.AccessControlContext; import java.security.AccessController; @@ -80,7 +79,6 @@ import javax.management.NotificationFilter; import javax.management.NotificationListener; import javax.management.ObjectInstance; import javax.management.ObjectName; -import javax.management.OperationsException; import javax.management.QueryEval; import javax.management.QueryExp; import javax.management.ReflectionException; @@ -208,8 +206,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { } catch (InstanceNotFoundException e) { /* Can only happen if loaderName doesn't exist, but we just passed null, so we shouldn't get this exception. */ - throw EnvHelp.initCause( - new IllegalArgumentException("Unexpected exception: " + e), e); + throw new IllegalArgumentException("Unexpected exception: " + e, e); } } diff --git a/src/java.management/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java b/src/java.management/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java index 5b490b546fc..ae21c9352fa 100644 --- a/src/java.management/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java +++ b/src/java.management/share/classes/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java @@ -610,11 +610,9 @@ public class ArrayNotificationBuffer implements NotificationBuffer { logger.debug("createListeners", "added creationListener"); } catch (Exception e) { final String msg = "Can't add listener to MBean server delegate: "; - RuntimeException re = new IllegalArgumentException(msg + e); - EnvHelp.initCause(re, e); logger.fine("createListeners", msg + e); logger.debug("createListeners", e); - throw re; + throw new IllegalArgumentException(msg + e, e); } /* Spec doesn't say whether Set returned by QueryNames can be modified diff --git a/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java b/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java index c154c1a6484..28c68feb993 100644 --- a/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java +++ b/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java @@ -51,7 +51,6 @@ import javax.management.remote.TargetedNotification; import com.sun.jmx.remote.util.ClassLogger; import com.sun.jmx.remote.util.EnvHelp; -import java.lang.reflect.UndeclaredThrowableException; import java.util.concurrent.RejectedExecutionException; @@ -340,9 +339,7 @@ public abstract class ClientNotifForwarder { try { wait(); } catch (InterruptedException ire) { - IOException ioe = new IOException(ire.toString()); - EnvHelp.initCause(ioe, ire); - throw ioe; + throw new IOException(ire.toString(), ire); } } @@ -381,9 +378,7 @@ public abstract class ClientNotifForwarder { try { wait(); } catch (InterruptedException ire) { - IOException ioe = new IOException(ire.toString()); - EnvHelp.initCause(ioe, ire); - throw ioe; + throw new IOException(ire.toString(), ire); } } @@ -821,10 +816,7 @@ public abstract class ClientNotifForwarder { try { wait(); } catch (InterruptedException ire) { - IOException ioe = new IOException(ire.toString()); - EnvHelp.initCause(ioe, ire); - - throw ioe; + throw new IOException(ire.toString(), ire); } } @@ -901,10 +893,7 @@ public abstract class ClientNotifForwarder { try { wait(); } catch (InterruptedException ire) { - IOException ioe = new IOException(ire.toString()); - EnvHelp.initCause(ioe, ire); - - throw ioe; + throw new IOException(ire.toString(), ire); } } diff --git a/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java b/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java index c7408f524ba..c119ca9c053 100644 --- a/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java +++ b/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java @@ -121,9 +121,7 @@ public class ServerNotifForwarder { name.getKeyPropertyList()); } catch (MalformedObjectNameException mfoe) { // impossible, but... - IOException ioe = new IOException(mfoe.getMessage()); - ioe.initCause(mfoe); - throw ioe; + throw new IOException(mfoe.getMessage(), mfoe); } } diff --git a/src/java.management/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java b/src/java.management/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java index 722d17a28b4..3e854d60a3e 100644 --- a/src/java.management/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java +++ b/src/java.management/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java @@ -44,7 +44,6 @@ import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; import javax.security.auth.spi.LoginModule; import com.sun.jmx.remote.util.ClassLogger; -import com.sun.jmx.remote.util.EnvHelp; /** *

      This class represents a @@ -228,9 +227,7 @@ public final class JMXPluggableAuthenticator implements JMXAuthenticator { se = (SecurityException) exception; } else { msg = "Authentication failed! " + exception.getMessage(); - final SecurityException e = new SecurityException(msg); - EnvHelp.initCause(e, exception); - se = e; + se = new SecurityException(msg, exception); } logException(method, msg, se); throw se; diff --git a/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java b/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java index a7ff232e8e4..ed7edcab09b 100644 --- a/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java +++ b/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -27,8 +27,6 @@ package javax.management.openmbean; -// java import -// import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Method; @@ -44,7 +42,6 @@ import javax.management.Descriptor; import javax.management.DescriptorRead; import javax.management.ImmutableDescriptor; import javax.management.MBeanAttributeInfo; -import com.sun.jmx.remote.util.EnvHelp; import sun.reflect.misc.MethodUtil; import sun.reflect.misc.ReflectUtil; @@ -626,7 +623,7 @@ public class OpenMBeanAttributeInfoSupport final String msg = "Cannot convert descriptor field " + name + " to " + openType.getTypeName(); - throw EnvHelp.initCause(new IllegalArgumentException(msg), e); + throw new IllegalArgumentException(msg, e); } } diff --git a/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java b/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java index 14f4189afc6..c3e580cf911 100644 --- a/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java +++ b/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java @@ -619,8 +619,7 @@ public class JMXConnectorFactory { if (e instanceof IOException) { exception = (IOException) e; } else { - exception = EnvHelp.initCause( - new IOException(e.getMessage()), e); + exception = new IOException(e.getMessage(), e); } } } -- GitLab From 7906eb050d4675092536048e8e21334767e397e6 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Tue, 16 Nov 2021 11:37:37 +0000 Subject: [PATCH 344/890] 8277119: Add asserts in GenericTaskQueueSet methods Reviewed-by: tschatzl --- src/hotspot/share/gc/shared/taskqueue.hpp | 1 + src/hotspot/share/gc/shared/taskqueue.inline.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/hotspot/share/gc/shared/taskqueue.hpp b/src/hotspot/share/gc/shared/taskqueue.hpp index 325ab352917..e2c21f1dc6d 100644 --- a/src/hotspot/share/gc/shared/taskqueue.hpp +++ b/src/hotspot/share/gc/shared/taskqueue.hpp @@ -483,6 +483,7 @@ GenericTaskQueueSet::register_queue(uint i, T* q) { template T* GenericTaskQueueSet::queue(uint i) { + assert(i < _n, "index out of range."); return _queues[i]; } diff --git a/src/hotspot/share/gc/shared/taskqueue.inline.hpp b/src/hotspot/share/gc/shared/taskqueue.inline.hpp index b6e8e7a4095..c0ea64ba165 100644 --- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp +++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp @@ -320,6 +320,7 @@ GenericTaskQueueSet::steal_best_of_2(uint queue_num, E& t) { template bool GenericTaskQueueSet::steal(uint queue_num, E& t) { + assert(queue_num < _n, "index out of range."); for (uint i = 0; i < 2 * _n; i++) { TASKQUEUE_STATS_ONLY(queue(queue_num)->stats.record_steal_attempt()); if (steal_best_of_2(queue_num, t)) { -- GitLab From 9a9a157a7d45cbfb016d4427931e1d5345210f7a Mon Sep 17 00:00:00 2001 From: Jayathirth D V Date: Tue, 16 Nov 2021 13:18:56 +0000 Subject: [PATCH 345/890] 8276905: Use appropriate macosx_version_minimum value while compiling metal shaders Reviewed-by: ihse, kcr, erikj, prr --- .../modules/java.desktop/lib/Awt2dLibraries.gmk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/make/modules/java.desktop/lib/Awt2dLibraries.gmk b/make/modules/java.desktop/lib/Awt2dLibraries.gmk index ef7eadae206..a0c40825546 100644 --- a/make/modules/java.desktop/lib/Awt2dLibraries.gmk +++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk @@ -834,6 +834,19 @@ endif ################################################################################ +# MACOSX_METAL_VERSION_MIN specifies the lowest version of Macosx +# that should be used to compile Metal shaders. We support Metal +# pipeline only on Macosx >=10.14. For Macosx versions <10.14 even if +# we enable Metal pipeline using -Dsun.java2d.metal=true, at +# runtime we force it to use OpenGL pipeline. And MACOSX_VERSION_MIN +# for aarch64 has always been >10.14 so we use continue to use +# MACOSX_VERSION_MIN for aarch64. +ifeq ($(OPENJDK_TARGET_CPU_ARCH), xaarch64) + MACOSX_METAL_VERSION_MIN=$(MACOSX_VERSION_MIN) +else + MACOSX_METAL_VERSION_MIN=10.14.0 +endif + ifeq ($(call isTargetOs, macosx), true) SHADERS_SRC := $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/shaders.metal SHADERS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/native/java.desktop/libosxui @@ -845,7 +858,9 @@ ifeq ($(call isTargetOs, macosx), true) DEPS := $(SHADERS_SRC), \ OUTPUT_FILE := $(SHADERS_AIR), \ SUPPORT_DIR := $(SHADERS_SUPPORT_DIR), \ - COMMAND := $(METAL) -c -std=osx-metal2.0 -o $(SHADERS_AIR) $(SHADERS_SRC), \ + COMMAND := $(METAL) -c -std=osx-metal2.0 \ + -mmacosx-version-min=$(MACOSX_METAL_VERSION_MIN) \ + -o $(SHADERS_AIR) $(SHADERS_SRC), \ )) $(eval $(call SetupExecute, metallib_shaders, \ -- GitLab From f3eb5014aa75af4463308f52f2bc6e9fcd2da36c Mon Sep 17 00:00:00 2001 From: MeryKitty Date: Tue, 16 Nov 2021 14:09:53 +0000 Subject: [PATCH 346/890] 8276162: Optimise unsigned comparison pattern Reviewed-by: thartmann, kvn --- src/hotspot/share/opto/subnode.cpp | 43 ++- .../c2/irTests/TestUnsignedComparison.java | 345 ++++++++++++++++++ .../bench/vm/compiler/UnsignedComparison.java | 138 +++++++ 3 files changed, 521 insertions(+), 5 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/irTests/TestUnsignedComparison.java create mode 100644 test/micro/org/openjdk/bench/vm/compiler/UnsignedComparison.java diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp index f721566c415..5956b1738f1 100644 --- a/src/hotspot/share/opto/subnode.cpp +++ b/src/hotspot/share/opto/subnode.cpp @@ -1480,13 +1480,15 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } + const int cmp1_op = cmp1->Opcode(); + const int cmp2_op = cmp2->Opcode(); + // Constant on left? Node *con = cmp1; - uint op2 = cmp2->Opcode(); // Move constants to the right of compare's to canonicalize. // Do not muck with Opaque1 nodes, as this indicates a loop // guard that cannot change shape. - if( con->is_Con() && !cmp2->is_Con() && op2 != Op_Opaque1 && + if( con->is_Con() && !cmp2->is_Con() && cmp2_op != Op_Opaque1 && // Because of NaN's, CmpD and CmpF are not commutative cop != Op_CmpD && cop != Op_CmpF && // Protect against swapping inputs to a compare when it is used by a @@ -1504,7 +1506,7 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Change "bool eq/ne (cmp (and X 16) 16)" into "bool ne/eq (cmp (and X 16) 0)". if (cop == Op_CmpI && (_test._test == BoolTest::eq || _test._test == BoolTest::ne) && - cmp1->Opcode() == Op_AndI && cmp2->Opcode() == Op_ConI && + cmp1_op == Op_AndI && cmp2_op == Op_ConI && cmp1->in(2)->Opcode() == Op_ConI) { const TypeInt *t12 = phase->type(cmp2)->isa_int(); const TypeInt *t112 = phase->type(cmp1->in(2))->isa_int(); @@ -1518,7 +1520,7 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Same for long type: change "bool eq/ne (cmp (and X 16) 16)" into "bool ne/eq (cmp (and X 16) 0)". if (cop == Op_CmpL && (_test._test == BoolTest::eq || _test._test == BoolTest::ne) && - cmp1->Opcode() == Op_AndL && cmp2->Opcode() == Op_ConL && + cmp1_op == Op_AndL && cmp2_op == Op_ConL && cmp1->in(2)->Opcode() == Op_ConL) { const TypeLong *t12 = phase->type(cmp2)->isa_long(); const TypeLong *t112 = phase->type(cmp1->in(2))->isa_long(); @@ -1529,10 +1531,41 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } + // Change "cmp (add X min_jint) (add Y min_jint)" into "cmpu X Y" + // and "cmp (add X min_jint) c" into "cmpu X (c + min_jint)" + if (cop == Op_CmpI && + cmp1_op == Op_AddI && + phase->type(cmp1->in(2)) == TypeInt::MIN) { + if (cmp2_op == Op_ConI) { + Node* ncmp2 = phase->intcon(java_add(cmp2->get_int(), min_jint)); + Node* ncmp = phase->transform(new CmpUNode(cmp1->in(1), ncmp2)); + return new BoolNode(ncmp, _test._test); + } else if (cmp2_op == Op_AddI && + phase->type(cmp2->in(2)) == TypeInt::MIN) { + Node* ncmp = phase->transform(new CmpUNode(cmp1->in(1), cmp2->in(1))); + return new BoolNode(ncmp, _test._test); + } + } + + // Change "cmp (add X min_jlong) (add Y min_jlong)" into "cmpu X Y" + // and "cmp (add X min_jlong) c" into "cmpu X (c + min_jlong)" + if (cop == Op_CmpL && + cmp1_op == Op_AddL && + phase->type(cmp1->in(2)) == TypeLong::MIN) { + if (cmp2_op == Op_ConL) { + Node* ncmp2 = phase->longcon(java_add(cmp2->get_long(), min_jlong)); + Node* ncmp = phase->transform(new CmpULNode(cmp1->in(1), ncmp2)); + return new BoolNode(ncmp, _test._test); + } else if (cmp2_op == Op_AddL && + phase->type(cmp2->in(2)) == TypeLong::MIN) { + Node* ncmp = phase->transform(new CmpULNode(cmp1->in(1), cmp2->in(1))); + return new BoolNode(ncmp, _test._test); + } + } + // Change "bool eq/ne (cmp (xor X 1) 0)" into "bool ne/eq (cmp X 0)". // The XOR-1 is an idiom used to flip the sense of a bool. We flip the // test instead. - int cmp1_op = cmp1->Opcode(); const TypeInt* cmp2_type = phase->type(cmp2)->isa_int(); if (cmp2_type == NULL) return NULL; Node* j_xor = cmp1; diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestUnsignedComparison.java b/test/hotspot/jtreg/compiler/c2/irTests/TestUnsignedComparison.java new file mode 100644 index 00000000000..f50075cbfa4 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestUnsignedComparison.java @@ -0,0 +1,345 @@ +/* + * Copyright (c) 2021, 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.c2.irTests; + +import jdk.test.lib.Asserts; +import compiler.lib.ir_framework.*; + +/* + * @test + * @bug 8276162 + * @summary Test that unsigned comparison transformation works as intended. + * @library /test/lib / + * @run driver compiler.c2.irTests.TestUnsignedComparison + */ +public class TestUnsignedComparison { + private static final String CMP_REGEX = "(\\d+(\\s){2}(" + "Cmp(I|L)" + ".*)+(\\s){2}===.*)"; + private static final String CMPU_REGEX = "(\\d+(\\s){2}(" + "Cmp(U|UL)" + ".*)+(\\s){2}===.*)"; + private static final String ADD_REGEX = "(\\d+(\\s){2}(" + "Add(I|L)" + ".*)+(\\s){2}===.*)"; + + private static final int INT_MIN = Integer.MIN_VALUE; + private static final long LONG_MIN = Long.MIN_VALUE; + + // Integers are sorted in unsignedly increasing order + private static final int[] INT_DATA = { + 0, + 1, + 2, + 3, + 0x8000_0000, + 0x8000_0001, + 0x8000_0002, + 0x8000_0003, + 0xFFFF_FFFE, + 0xFFFF_FFFF, + }; + + // Longs are sorted in unsignedly increasing order + private static final long[] LONG_DATA = { + 0L, + 1L, + 2L, + 3L, + 0x00000000_80000000L, + 0x00000000_FFFFFFFFL, + 0x00000001_00000000L, + 0x80000000_00000000L, + 0x80000000_00000001L, + 0x80000000_00000002L, + 0x80000000_00000003L, + 0x80000000_80000000L, + 0xFFFFFFFF_FFFFFFFEL, + 0xFFFFFFFF_FFFFFFFFL, + }; + + // Constants to compare against, add MIN_VALUE beforehand for convenience + private static final int CONST_INDEX = 6; + private static final int INT_CONST = INT_DATA[CONST_INDEX] + INT_MIN; + private static final long LONG_CONST = LONG_DATA[CONST_INDEX] + LONG_MIN; + + public static void main(String[] args) { + TestFramework framework = new TestFramework(); + framework.start(); + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntVarEQ(int x, int y) { + return x + INT_MIN == y + INT_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntVarNE(int x, int y) { + return x + INT_MIN != y + INT_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntVarLT(int x, int y) { + return x + INT_MIN < y + INT_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntVarLE(int x, int y) { + return x + INT_MIN <= y + INT_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntVarGT(int x, int y) { + return x + INT_MIN > y + INT_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntVarGE(int x, int y) { + return x + INT_MIN >= y + INT_MIN; + } + + @Run(test = {"testIntVarEQ", "testIntVarNE", + "testIntVarLT", "testIntVarLE", + "testIntVarGT", "testIntVarGE"}) + public void checkTestIntVar() { + // Verify the transformation "cmp (add X min_jint) (add Y min_jint)" + // to "cmpu X Y" + for (int i = 0; i < INT_DATA.length; i++) { + for (int j = 0; j < INT_DATA.length; j++) { + Asserts.assertEquals(testIntVarEQ(INT_DATA[i], INT_DATA[j]), + i == j); + Asserts.assertEquals(testIntVarNE(INT_DATA[i], INT_DATA[j]), + i != j); + Asserts.assertEquals(testIntVarLT(INT_DATA[i], INT_DATA[j]), + i < j); + Asserts.assertEquals(testIntVarLE(INT_DATA[i], INT_DATA[j]), + i <= j); + Asserts.assertEquals(testIntVarGT(INT_DATA[i], INT_DATA[j]), + i > j); + Asserts.assertEquals(testIntVarGE(INT_DATA[i], INT_DATA[j]), + i >= j); + } + } + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntConEQ(int x) { + return x + INT_MIN == INT_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntConNE(int x) { + return x + INT_MIN != INT_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntConLT(int x) { + return x + INT_MIN < INT_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntConLE(int x) { + return x + INT_MIN <= INT_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntConGT(int x) { + return x + INT_MIN > INT_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testIntConGE(int x) { + return x + INT_MIN >= INT_CONST; + } + + @Run(test = {"testIntConEQ", "testIntConNE", + "testIntConLT", "testIntConLE", + "testIntConGT", "testIntConGE"}) + public void checkTestIntCon() { + // Verify the transformation "cmp (add X min_jint) c" + // to "cmpu X (c + min_jint)" + for (int i = 0; i < INT_DATA.length; i++) { + Asserts.assertEquals(testIntConEQ(INT_DATA[i]), + i == CONST_INDEX); + Asserts.assertEquals(testIntConNE(INT_DATA[i]), + i != CONST_INDEX); + Asserts.assertEquals(testIntConLT(INT_DATA[i]), + i < CONST_INDEX); + Asserts.assertEquals(testIntConLE(INT_DATA[i]), + i <= CONST_INDEX); + Asserts.assertEquals(testIntConGT(INT_DATA[i]), + i > CONST_INDEX); + Asserts.assertEquals(testIntConGE(INT_DATA[i]), + i >= CONST_INDEX); + } + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongVarEQ(long x, long y) { + return x + LONG_MIN == y + LONG_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongVarNE(long x, long y) { + return x + LONG_MIN != y + LONG_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongVarLT(long x, long y) { + return x + LONG_MIN < y + LONG_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongVarLE(long x, long y) { + return x + LONG_MIN <= y + LONG_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongVarGT(long x, long y) { + return x + LONG_MIN > y + LONG_MIN; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongVarGE(long x, long y) { + return x + LONG_MIN >= y + LONG_MIN; + } + + @Run(test = {"testLongVarEQ", "testLongVarNE", + "testLongVarLT", "testLongVarLE", + "testLongVarGT", "testLongVarGE"}) + public void checkTestLongVar() { + // Verify the transformation "cmp (add X min_jlong) (add Y min_jlong)" + // to "cmpu X Y" + for (int i = 0; i < LONG_DATA.length; i++) { + for (int j = 0; j < LONG_DATA.length; j++) { + Asserts.assertEquals(testLongVarEQ(LONG_DATA[i], LONG_DATA[j]), + i == j); + Asserts.assertEquals(testLongVarNE(LONG_DATA[i], LONG_DATA[j]), + i != j); + Asserts.assertEquals(testLongVarLT(LONG_DATA[i], LONG_DATA[j]), + i < j); + Asserts.assertEquals(testLongVarLE(LONG_DATA[i], LONG_DATA[j]), + i <= j); + Asserts.assertEquals(testLongVarGT(LONG_DATA[i], LONG_DATA[j]), + i > j); + Asserts.assertEquals(testLongVarGE(LONG_DATA[i], LONG_DATA[j]), + i >= j); + } + } + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongConEQ(long x) { + return x + LONG_MIN == LONG_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongConNE(long x) { + return x + LONG_MIN != LONG_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongConLT(long x) { + return x + LONG_MIN < LONG_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongConLE(long x) { + return x + LONG_MIN <= LONG_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongConGT(long x) { + return x + LONG_MIN > LONG_CONST; + } + + @Test + @IR(failOn = {CMP_REGEX, ADD_REGEX}) + @IR(counts = {CMPU_REGEX, "1"}) + public boolean testLongConGE(long x) { + return x + LONG_MIN >= LONG_CONST; + } + + @Run(test = {"testLongConEQ", "testLongConNE", + "testLongConLT", "testLongConLE", + "testLongConGT", "testLongConGE"}) + public void checkTestLongConGE() { + // Verify the transformation "cmp (add X min_jlong) c" + // to "cmpu X (c + min_jlong)" + for (int i = 0; i < LONG_DATA.length; i++) { + Asserts.assertEquals(testLongConEQ(LONG_DATA[i]), + i == CONST_INDEX); + Asserts.assertEquals(testLongConNE(LONG_DATA[i]), + i != CONST_INDEX); + Asserts.assertEquals(testLongConLT(LONG_DATA[i]), + i < CONST_INDEX); + Asserts.assertEquals(testLongConLE(LONG_DATA[i]), + i <= CONST_INDEX); + Asserts.assertEquals(testLongConGT(LONG_DATA[i]), + i > CONST_INDEX); + Asserts.assertEquals(testLongConGE(LONG_DATA[i]), + i >= CONST_INDEX); + } + } +} diff --git a/test/micro/org/openjdk/bench/vm/compiler/UnsignedComparison.java b/test/micro/org/openjdk/bench/vm/compiler/UnsignedComparison.java new file mode 100644 index 00000000000..a82e1d87c63 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/UnsignedComparison.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.infra.Blackhole; +import java.util.concurrent.TimeUnit; + +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Fork(2) +@State(Scope.Thread) +public class UnsignedComparison { + private static final int ITERATIONS = 1000; + + private static final int CONST_OPERAND = 4; + private static final int INT_MIN = Integer.MIN_VALUE; + private static final long LONG_MIN = Long.MIN_VALUE; + + int arg0 = 0, arg1 = 4; + + @Setup(Level.Invocation) + public void toggle() { + arg0 = (arg0 + 1) & 7; + } + + @Benchmark + public void intVarDirect(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(arg0 + INT_MIN < arg1 + INT_MIN); + } + } + + @Benchmark + public void intVarLibLT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Integer.compareUnsigned(arg0, arg1) < 0); + } + } + + @Benchmark + public void intVarLibGT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Integer.compareUnsigned(arg0, arg1) > 0); + } + } + + @Benchmark + public void intConDirect(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(arg0 + INT_MIN < CONST_OPERAND + INT_MIN); + } + } + + @Benchmark + public void intConLibLT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Integer.compareUnsigned(arg0, CONST_OPERAND) < 0); + } + } + + @Benchmark + public void intConLibGT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Integer.compareUnsigned(arg0, CONST_OPERAND) > 0); + } + } + + @Benchmark + public void longVarDirect(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(arg0 + LONG_MIN < arg1 + LONG_MIN); + } + } + + @Benchmark + public void longVarLibLT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Long.compareUnsigned(arg0, arg1) < 0); + } + } + + @Benchmark + public void longVarLibGT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Long.compareUnsigned(arg0, arg1) > 0); + } + } + + @Benchmark + public void longConDirect(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(arg0 + LONG_MIN < CONST_OPERAND + LONG_MIN); + } + } + + @Benchmark + public void longConLibLT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Long.compareUnsigned(arg0, CONST_OPERAND) < 0); + } + } + + @Benchmark + public void longConLibGT(Blackhole bh) { + for (int i = 0; i < ITERATIONS; i++) { + bh.consume(Long.compareUnsigned(arg0, CONST_OPERAND) > 0); + } + } +} -- GitLab From d5e47d6b84514edde23a8baff8c2274e5b3ca6bb Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Tue, 16 Nov 2021 14:47:42 +0000 Subject: [PATCH 347/890] 8277089: Use system binutils to build hsdis Reviewed-by: ihse --- make/autoconf/jdk-options.m4 | 53 +++++++++++++++++++++++++++--------- src/utils/hsdis/README | 4 +++ src/utils/hsdis/hsdis.c | 8 ++++-- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index c937101c2c7..cef3a1c1bd7 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -817,26 +817,53 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_HSDIS], BINUTILS_DIR="$with_binutils" fi - AC_MSG_CHECKING([for binutils to use with hsdis]) - if test "x$BINUTILS_DIR" != x; then + binutils_system_error="" + HSDIS_LIBS="" + if test "x$BINUTILS_DIR" = xsystem; then + AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ]) + AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ]) + AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ], [ binutils_system_error="libiberty not found" ]) + AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ]) + elif test "x$BINUTILS_DIR" != x; then if test -e $BINUTILS_DIR/bfd/libbfd.a && \ test -e $BINUTILS_DIR/opcodes/libopcodes.a && \ test -e $BINUTILS_DIR/libiberty/libiberty.a; then - AC_MSG_RESULT([$BINUTILS_DIR]) HSDIS_CFLAGS="-I$BINUTILS_DIR/include -I$BINUTILS_DIR/bfd -DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB" HSDIS_LIBS="$BINUTILS_DIR/bfd/libbfd.a $BINUTILS_DIR/opcodes/libopcodes.a $BINUTILS_DIR/libiberty/libiberty.a $BINUTILS_DIR/zlib/libz.a" - else - AC_MSG_RESULT([invalid]) - AC_MSG_ERROR([$BINUTILS_DIR does not contain a proper binutils installation]) fi - else - AC_MSG_RESULT([missing]) - AC_MSG_NOTICE([--with-hsdis=binutils requires specifying a binutils installation.]) - AC_MSG_NOTICE([Download binutils from https://www.gnu.org/software/binutils and unpack it,]) - AC_MSG_NOTICE([and point --with-binutils-src to the resulting directory, or use]) - AC_MSG_NOTICE([--with-binutils to point to a pre-built binutils installation.]) - AC_MSG_ERROR([Cannot continue]) fi + + AC_MSG_CHECKING([for binutils to use with hsdis]) + case "x$BINUTILS_DIR" in + xsystem) + if test "x$OPENJDK_TARGET_OS" != xlinux; then + AC_MSG_RESULT([invalid]) + AC_MSG_ERROR([binutils on system is supported for Linux only]) + elif test "x$binutils_system_error" = x; then + AC_MSG_RESULT([system]) + HSDIS_CFLAGS="-DSYSTEM_BINUTILS" + else + AC_MSG_RESULT([invalid]) + AC_MSG_ERROR([$binutils_system_error]) + fi + ;; + x) + AC_MSG_RESULT([missing]) + AC_MSG_NOTICE([--with-hsdis=binutils requires specifying a binutils installation.]) + AC_MSG_NOTICE([Download binutils from https://www.gnu.org/software/binutils and unpack it,]) + AC_MSG_NOTICE([and point --with-binutils-src to the resulting directory, or use]) + AC_MSG_NOTICE([--with-binutils to point to a pre-built binutils installation.]) + AC_MSG_ERROR([Cannot continue]) + ;; + *) + if test "x$HSDIS_LIBS" != x; then + AC_MSG_RESULT([$BINUTILS_DIR]) + else + AC_MSG_RESULT([invalid]) + AC_MSG_ERROR([$BINUTILS_DIR does not contain a proper binutils installation]) + fi + ;; + esac else AC_MSG_RESULT([invalid]) AC_MSG_ERROR([Incorrect hsdis backend "$with_hsdis"]) diff --git a/src/utils/hsdis/README b/src/utils/hsdis/README index aee40f6bd27..64a8ab61a7c 100644 --- a/src/utils/hsdis/README +++ b/src/utils/hsdis/README @@ -67,6 +67,10 @@ you can replace it with "--with-binutils=". If you have pre-built binutils binaries, you can point to them directly using "--with-binutils=". +If you want to build hsdis with binutils provided by system +(e.g. binutils-devel from Fedora, binutils-dev from Ubuntu), you can pass +"--with-binutils=system". "system" is available on Linux only. + When you have created a proper configuration, you can then build the hsdis library using "make build-hsdis". diff --git a/src/utils/hsdis/hsdis.c b/src/utils/hsdis/hsdis.c index 8e3f0ca7836..279ed53ba5d 100644 --- a/src/utils/hsdis/hsdis.c +++ b/src/utils/hsdis/hsdis.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * The Universal Permissive License (UPL), Version 1.0 @@ -49,14 +49,16 @@ HotSpot PrintAssembly option. */ +#ifndef SYSTEM_BINUTILS #include /* required by bfd.h */ +#endif + #include #include #include #include #include -#include #include #include "hsdis.h" @@ -565,7 +567,7 @@ static void init_disassemble_info_from_bfd(struct disassemble_info* dinfo, dinfo->arch = bfd_get_arch(abfd); dinfo->mach = bfd_get_mach(abfd); dinfo->disassembler_options = disassembler_options; -#if BFD_VERSION >= 234000000 +#ifdef SEC_ELF_OCTETS /* bfd_octets_per_byte() has 2 args since binutils 2.34 */ dinfo->octets_per_byte = bfd_octets_per_byte (abfd, NULL); #else -- GitLab From e5ffdf9120c14b38e4c8794888d2002e2686ebfc Mon Sep 17 00:00:00 2001 From: Dean Long Date: Tue, 16 Nov 2021 17:25:38 +0000 Subject: [PATCH 348/890] 8276231: ciReplay: SIGSEGV when replay compiling lambdas Reviewed-by: iveresov, chagedorn --- src/hotspot/share/ci/ciReplay.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index 20f33cc4909..e9cfbaf9fbd 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -467,6 +467,7 @@ class CompileReplay : public StackObj { } { bool found_it; + ik->link_class(CHECK_NULL); obj = cp->find_cached_constant_at(cpi, found_it, thread); } } @@ -927,6 +928,7 @@ class CompileReplay : public StackObj { void process_ciInstanceKlass(TRAPS) { InstanceKlass* k = (InstanceKlass*)parse_klass(CHECK); if (k == NULL) { + skip_remaining(); return; } int is_linked = parse_int("is_linked"); -- GitLab From b0a463fa59a1c3c554f48267525729bf89a2c5be Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Tue, 16 Nov 2021 19:01:53 +0000 Subject: [PATCH 349/890] 8169468: NoResizeEventOnDMChangeTest.java fails because FS Window didn't receive all resizes! Reviewed-by: serb --- test/jdk/ProblemList.txt | 1 - .../NoResizeEventOnDMChangeTest.java | 31 ++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index ac8c37f5024..0db2a881113 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -489,7 +489,6 @@ java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all -java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java 8169468 macosx-all java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223,8274106 macosx-aarch64,linux-all,windows-all java/awt/keyboard/AllKeyCode/AllKeyCode.java 8242930 macosx-all diff --git a/test/jdk/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java b/test/jdk/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java index a6e635e08ce..455ad2f2b0a 100644 --- a/test/jdk/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java +++ b/test/jdk/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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,7 +26,6 @@ * @bug 6646411 * @summary Tests that full screen window and its children receive resize event when display mode changes - * @author Dmitri.Trembovetski@sun.com: area=Graphics * @run main/othervm NoResizeEventOnDMChangeTest * @run main/othervm -Dsun.java2d.d3d=false NoResizeEventOnDMChangeTest */ @@ -151,9 +150,22 @@ public class NoResizeEventOnDMChangeTest { System.err.printf("----------- Setting DM %dx%d:\n", dm1.getWidth(), dm1.getHeight()); try { + Frame f = fsWin instanceof Frame ? (Frame) fsWin : (Frame) fsWin.getOwner(); + DisplayMode oldMode = f.getGraphicsConfiguration().getDevice().getDisplayMode(); gd.setDisplayMode(dm1); - r1.incDmChanges(); - r2.incDmChanges(); + sleep(2000); + // Check if setting new display mode actually results in frame being + // placed onto display with different resolution. + DisplayMode newMode = f.getGraphicsConfiguration().getDevice().getDisplayMode(); + if (oldMode.getWidth() != newMode.getWidth() + || oldMode.getHeight() != newMode.getHeight()) { + r1.incDmChanges(); + r2.incDmChanges(); + } else { + System.out.println("Skipping this iteration. Details:"); + System.out.println("Requested device = " + gd); + System.out.println("Actual device = " + f.getGraphicsConfiguration().getDevice()); + } } catch (IllegalArgumentException iae) {} } }); @@ -166,6 +178,7 @@ public class NoResizeEventOnDMChangeTest { fsWin.removeComponentListener(r1); c.removeComponentListener(r2); } + try { EventQueue.invokeAndWait(new Runnable() { public void run() { @@ -191,10 +204,14 @@ public class NoResizeEventOnDMChangeTest { } static void sleep(long ms) { - try { - Thread.sleep(ms); - } catch (InterruptedException ex) {} + long targetTime = System.currentTimeMillis() + ms; + do { + try { + Thread.sleep(targetTime - System.currentTimeMillis()); + } catch (InterruptedException ex) {} + } while (System.currentTimeMillis() < targetTime); } + static class ResizeEventChecker extends ComponentAdapter { int dmChanges; int resizes; -- GitLab From cddc6ce44695cba4614c3405eb2b194d7c76489b Mon Sep 17 00:00:00 2001 From: Daniel Jelinski Date: Tue, 16 Nov 2021 20:34:15 +0000 Subject: [PATCH 350/890] 8275811: Incorrect instance to dispose Reviewed-by: xuelei --- .../classes/sun/security/ssl/InputRecord.java | 2 +- .../sun/security/ssl/OutputRecord.java | 9 ++++++-- .../security/ssl/SSLEngineOutputRecord.java | 22 +++++++++++++++++++ .../security/ssl/SSLSocketOutputRecord.java | 5 +++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/sun/security/ssl/InputRecord.java b/src/java.base/share/classes/sun/security/ssl/InputRecord.java index 8277c799f7f..de860fd15b0 100644 --- a/src/java.base/share/classes/sun/security/ssl/InputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/InputRecord.java @@ -122,7 +122,7 @@ abstract class InputRecord implements Record, Closeable { * Since MAC's doFinal() is called for every SSL/TLS packet, it's * not necessary to do the same with MAC's. */ - readCipher.dispose(); + this.readCipher.dispose(); this.readCipher = readCipher; } diff --git a/src/java.base/share/classes/sun/security/ssl/OutputRecord.java b/src/java.base/share/classes/sun/security/ssl/OutputRecord.java index 696251ff3b1..7a9657152b7 100644 --- a/src/java.base/share/classes/sun/security/ssl/OutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/OutputRecord.java @@ -141,6 +141,11 @@ abstract class OutputRecord // SSLEngine and SSLSocket abstract void encodeChangeCipherSpec() throws IOException; + // SSLEngine and SSLSocket + void disposeWriteCipher() { + throw new UnsupportedOperationException(); + } + // apply to SSLEngine only Ciphertext encode( ByteBuffer[] srcs, int srcsOffset, int srcsLength, @@ -190,7 +195,7 @@ abstract class OutputRecord * Since MAC's doFinal() is called for every SSL/TLS packet, it's * not necessary to do the same with MAC's. */ - writeCipher.dispose(); + disposeWriteCipher(); this.writeCipher = writeCipher; this.isFirstAppOutputRecord = true; @@ -219,7 +224,7 @@ abstract class OutputRecord flush(); // Dispose of any intermediate state in the underlying cipher. - writeCipher.dispose(); + disposeWriteCipher(); this.writeCipher = writeCipher; this.isFirstAppOutputRecord = true; diff --git a/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java index 5de047dfcff..63eff56b4b6 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java @@ -151,6 +151,15 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { fragmenter.queueUpChangeCipherSpec(); } + @Override + void disposeWriteCipher() { + if (fragmenter == null) { + writeCipher.dispose(); + } else { + fragmenter.queueUpCipherDispose(); + } + } + @Override void encodeV2NoCipher() throws IOException { isTalkingToV2 = true; @@ -361,6 +370,7 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { byte majorVersion; byte minorVersion; SSLWriteCipher encodeCipher; + boolean disposeCipher; byte[] fragment; } @@ -422,6 +432,15 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { handshakeMemos.add(memo); } + void queueUpCipherDispose() { + RecordMemo lastMemo = handshakeMemos.peekLast(); + if (lastMemo != null) { + lastMemo.disposeCipher = true; + } else { + writeCipher.dispose(); + } + } + Ciphertext acquireCiphertext(ByteBuffer dstBuf) throws IOException { if (isEmpty()) { return null; @@ -521,6 +540,9 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { dstPos, dstLim, headerSize, ProtocolVersion.valueOf(memo.majorVersion, memo.minorVersion)); + if (memo.disposeCipher) { + memo.encodeCipher.dispose(); + } if (SSLLogger.isOn && SSLLogger.isOn("packet")) { ByteBuffer temporary = dstBuf.duplicate(); diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java b/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java index 07a4093b12a..3b0473d4eb0 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java @@ -243,6 +243,11 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { } } + @Override + void disposeWriteCipher() { + writeCipher.dispose(); + } + @Override public void flush() throws IOException { recordLock.lock(); -- GitLab From 8ed384cfb655d97ba452033e06d18ca38e5fc9b0 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 16 Nov 2021 20:53:49 +0000 Subject: [PATCH 351/890] 8276609: Document setting property `jdk.serialFilter` to an invalid value throws `ExceptionInInitializerError` Reviewed-by: dfuchs, lancea --- src/java.base/share/classes/java/io/ObjectInputFilter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/java.base/share/classes/java/io/ObjectInputFilter.java b/src/java.base/share/classes/java/io/ObjectInputFilter.java index c9722ea23e7..d5cae8043b1 100644 --- a/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -523,6 +523,8 @@ public interface ObjectInputFilter { * {@systemProperty jdk.serialFilter}, its value is used to configure the filter. * If the system property is not defined, and the {@link java.security.Security} property * {@code jdk.serialFilter} is defined then it is used to configure the filter. + * The filter is created as if {@link #createFilter(String) createFilter} is called; + * if the filter string is invalid, an {@link ExceptionInInitializerError} is thrown. * Otherwise, the filter is not configured during initialization and * can be set with {@link #setSerialFilter(ObjectInputFilter) Config.setSerialFilter}. * Setting the {@code jdk.serialFilter} with {@link System#setProperty(String, String) -- GitLab From a77d8ddf11fba33007a4f5c0468d69de23f10f6a Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Tue, 16 Nov 2021 21:03:33 +0000 Subject: [PATCH 352/890] 8276787: Improve warning messages for -XX:+RecordDynamicDumpInfo Reviewed-by: ccheung, stuefe --- src/hotspot/share/cds/dynamicArchive.cpp | 72 +++++----- src/hotspot/share/cds/dynamicArchive.hpp | 6 +- src/hotspot/share/memory/metaspace.cpp | 4 - src/hotspot/share/memory/universe.cpp | 2 + src/hotspot/share/prims/jvm.cpp | 6 +- src/hotspot/share/runtime/arguments.cpp | 97 +++++++------ src/hotspot/share/runtime/arguments.hpp | 2 +- src/hotspot/share/runtime/java.cpp | 5 +- src/hotspot/share/runtime/thread.cpp | 4 +- .../SharedArchiveFileOption.java | 136 ++++++++++++++++-- test/lib/jdk/test/lib/cds/CDSTestUtils.java | 34 +++-- 11 files changed, 255 insertions(+), 113 deletions(-) diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index b3c18e318a8..c821d46d4d0 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -50,7 +50,9 @@ class DynamicArchiveBuilder : public ArchiveBuilder { + const char* _archive_name; public: + DynamicArchiveBuilder(const char* archive_name) : _archive_name(archive_name) {} void mark_pointer(address* ptr_loc) { ArchivePtrMarker::mark_pointer(ptr_loc); } @@ -318,7 +320,7 @@ void DynamicArchiveBuilder::write_archive(char* serialized_data) { FileMapInfo* dynamic_info = FileMapInfo::dynamic_info(); assert(dynamic_info != NULL, "Sanity"); - dynamic_info->open_for_write(Arguments::GetSharedDynamicArchivePath()); + dynamic_info->open_for_write(_archive_name); ArchiveBuilder::write_archive(dynamic_info, NULL, NULL, NULL, NULL); address base = _requested_dynamic_archive_bottom; @@ -333,9 +335,10 @@ void DynamicArchiveBuilder::write_archive(char* serialized_data) { } class VM_PopulateDynamicDumpSharedSpace: public VM_GC_Sync_Operation { - DynamicArchiveBuilder builder; + DynamicArchiveBuilder _builder; public: - VM_PopulateDynamicDumpSharedSpace() : VM_GC_Sync_Operation() {} + VM_PopulateDynamicDumpSharedSpace(const char* archive_name) + : VM_GC_Sync_Operation(), _builder(archive_name) {} VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; } void doit() { ResourceMark rm; @@ -349,11 +352,30 @@ public: } FileMapInfo::check_nonempty_dir_in_shared_path_table(); - builder.doit(); + _builder.doit(); } }; -void DynamicArchive::prepare_for_dynamic_dumping() { +void DynamicArchive::check_for_dynamic_dump() { + if (DynamicDumpSharedSpaces && !UseSharedSpaces) { + // This could happen if SharedArchiveFile has failed to load: + // - -Xshare:off was specified + // - SharedArchiveFile points to an non-existent file. + // - SharedArchiveFile points to an archive that has failed CRC check + // - SharedArchiveFile is not specified and the VM doesn't have a compatible default archive + +#define __THEMSG " is unsupported when base CDS archive is not loaded. Run with -Xlog:cds for more info." + if (RecordDynamicDumpInfo) { + vm_exit_during_initialization("-XX:+RecordDynamicDumpInfo" __THEMSG, NULL); + } else { + assert(ArchiveClassesAtExit != nullptr, "sanity"); + vm_exit_during_initialization("-XX:ArchiveClassesAtExit" __THEMSG, NULL); +#undef __THEMSG + } + } +} + +void DynamicArchive::prepare_for_dump_at_exit() { EXCEPTION_MARK; ResourceMark rm(THREAD); MetaspaceShared::link_shared_classes(THREAD); @@ -367,41 +389,27 @@ void DynamicArchive::prepare_for_dynamic_dumping() { } } -void DynamicArchive::dump(const char* archive_name, TRAPS) { - assert(UseSharedSpaces && RecordDynamicDumpInfo, "already checked in arguments.cpp?"); - assert(ArchiveClassesAtExit == nullptr, "already checked in arguments.cpp?"); - ArchiveClassesAtExit = archive_name; - if (Arguments::init_shared_archive_paths()) { - prepare_for_dynamic_dumping(); - if (DynamicDumpSharedSpaces) { - dump(CHECK); - } - } else { - ArchiveClassesAtExit = nullptr; - THROW_MSG(vmSymbols::java_lang_RuntimeException(), - "Could not setup SharedDynamicArchivePath"); - } - // prevent do dynamic dump at exit. - ArchiveClassesAtExit = nullptr; - if (!Arguments::init_shared_archive_paths()) { - THROW_MSG(vmSymbols::java_lang_RuntimeException(), - "Could not restore SharedDynamicArchivePath"); - } +// This is called by "jcmd VM.cds dynamic_dump" +void DynamicArchive::dump_for_jcmd(const char* archive_name, TRAPS) { + assert(UseSharedSpaces && RecordDynamicDumpInfo, "already checked in arguments.cpp"); + assert(ArchiveClassesAtExit == nullptr, "already checked in arguments.cpp"); + assert(DynamicDumpSharedSpaces, "already checked by check_for_dynamic_dump() during VM startup"); + MetaspaceShared::link_shared_classes(CHECK); + dump(archive_name, THREAD); } -void DynamicArchive::dump(TRAPS) { - if (Arguments::GetSharedDynamicArchivePath() == NULL) { - log_warning(cds, dynamic)("SharedDynamicArchivePath is not specified"); - return; - } - +void DynamicArchive::dump(const char* archive_name, TRAPS) { // copy shared path table to saved. FileMapInfo::clone_shared_path_table(CHECK); - VM_PopulateDynamicDumpSharedSpace op; + VM_PopulateDynamicDumpSharedSpace op(archive_name); VMThread::execute(&op); } +bool DynamicArchive::should_dump_at_vm_exit() { + return DynamicDumpSharedSpaces && (ArchiveClassesAtExit != nullptr); +} + bool DynamicArchive::validate(FileMapInfo* dynamic_info) { assert(!dynamic_info->is_static(), "must be"); // Check if the recorded base archive matches with the current one diff --git a/src/hotspot/share/cds/dynamicArchive.hpp b/src/hotspot/share/cds/dynamicArchive.hpp index 0371b948497..fbb831ae195 100644 --- a/src/hotspot/share/cds/dynamicArchive.hpp +++ b/src/hotspot/share/cds/dynamicArchive.hpp @@ -59,9 +59,11 @@ public: class DynamicArchive : AllStatic { public: - static void prepare_for_dynamic_dumping(); + static void check_for_dynamic_dump(); + static bool should_dump_at_vm_exit(); + static void prepare_for_dump_at_exit(); + static void dump_for_jcmd(const char* archive_name, TRAPS); static void dump(const char* archive_name, TRAPS); - static void dump(TRAPS); static bool is_mapped() { return FileMapInfo::dynamic_info() != NULL; } static bool validate(FileMapInfo* dynamic_info); }; diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index 74b5d1a0b30..e19383675b4 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -749,10 +749,6 @@ void Metaspace::global_initialize() { // If any of the archived space fails to map, UseSharedSpaces // is reset to false. } - - if (DynamicDumpSharedSpaces && !UseSharedSpaces) { - vm_exit_during_initialization("DynamicDumpSharedSpaces is unsupported when base CDS archive is not loaded", NULL); - } #endif // INCLUDE_CDS #ifdef _LP64 diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index 6c7f5a2fab6..ffe92cf65b1 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "cds/dynamicArchive.hpp" #include "cds/heapShared.hpp" #include "cds/metaspaceShared.hpp" #include "classfile/classLoader.hpp" @@ -765,6 +766,7 @@ jint universe_init() { Universe::_do_stack_walk_cache = new LatestMethodCache(); #if INCLUDE_CDS + DynamicArchive::check_for_dynamic_dump(); if (UseSharedSpaces) { // Read the data structures supporting the shared spaces (shared // system dictionary, symbol table, etc.). After that, access to diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index f44b34bf4e5..de4e35492c8 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -426,8 +426,8 @@ extern volatile jint vm_created; JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt()) #if INCLUDE_CDS // Link all classes for dynamic CDS dumping before vm exit. - if (DynamicDumpSharedSpaces) { - DynamicArchive::prepare_for_dynamic_dumping(); + if (DynamicArchive::should_dump_at_vm_exit()) { + DynamicArchive::prepare_for_dump_at_exit(); } #endif EventShutdown event; @@ -3706,7 +3706,7 @@ JVM_ENTRY(void, JVM_DumpDynamicArchive(JNIEnv *env, jstring archiveName)) ResourceMark rm(THREAD); Handle file_handle(THREAD, JNIHandles::resolve_non_null(archiveName)); char* archive_name = java_lang_String::as_utf8_string(file_handle()); - DynamicArchive::dump(archive_name, CHECK); + DynamicArchive::dump_for_jcmd(archive_name, CHECK); #endif // INCLUDE_CDS JVM_END diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 7e154bdd3e7..cbbb4b93f1f 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -1439,6 +1439,8 @@ bool Arguments::check_unsupported_cds_runtime_properties() { if (get_property(unsupported_properties[i]) != NULL) { if (RequireSharedSpaces) { warning("CDS is disabled when the %s option is specified.", unsupported_options[i]); + } else { + log_info(cds)("CDS is disabled when the %s option is specified.", unsupported_options[i]); } return true; } @@ -3117,17 +3119,11 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) { // TODO: revisit the following for the static archive case. set_mode_flags(_int); } - if (DumpSharedSpaces || ArchiveClassesAtExit != NULL) { - // Always verify non-system classes during CDS dump - if (!BytecodeVerificationRemote) { - BytecodeVerificationRemote = true; - log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time."); - } - } // RecordDynamicDumpInfo is not compatible with ArchiveClassesAtExit if (ArchiveClassesAtExit != NULL && RecordDynamicDumpInfo) { - log_info(cds)("RecordDynamicDumpInfo is for jcmd only, could not set with -XX:ArchiveClassesAtExit."); + jio_fprintf(defaultStream::output_stream(), + "-XX:+RecordDynamicDumpInfo cannot be used with -XX:ArchiveClassesAtExit.\n"); return JNI_ERR; } @@ -3143,6 +3139,14 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) { if (UseSharedSpaces && !DumpSharedSpaces && check_unsupported_cds_runtime_properties()) { FLAG_SET_DEFAULT(UseSharedSpaces, false); } + + if (DumpSharedSpaces || DynamicDumpSharedSpaces) { + // Always verify non-system classes during CDS dump + if (!BytecodeVerificationRemote) { + BytecodeVerificationRemote = true; + log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time."); + } + } #endif #ifndef CAN_SHOW_REGISTERS_ON_ASSERT @@ -3422,9 +3426,7 @@ jint Arguments::set_shared_spaces_flags_and_archive_paths() { #if INCLUDE_CDS // Initialize shared archive paths which could include both base and dynamic archive paths // This must be after set_ergonomics_flags() called so flag UseCompressedOops is set properly. - if (!init_shared_archive_paths()) { - return JNI_ENOMEM; - } + init_shared_archive_paths(); #endif // INCLUDE_CDS return JNI_OK; } @@ -3487,45 +3489,45 @@ void Arguments::extract_shared_archive_paths(const char* archive_path, len = end_ptr - begin_ptr; cur_path = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal); strncpy(cur_path, begin_ptr, len + 1); - //cur_path[len] = '\0'; FileMapInfo::check_archive((const char*)cur_path, false /*is_static*/); *top_archive_path = cur_path; } -bool Arguments::init_shared_archive_paths() { - if (ArchiveClassesAtExit != NULL) { +void Arguments::init_shared_archive_paths() { + if (ArchiveClassesAtExit != nullptr) { + assert(!RecordDynamicDumpInfo, "already checked"); if (DumpSharedSpaces) { vm_exit_during_initialization("-XX:ArchiveClassesAtExit cannot be used with -Xshare:dump"); } - if (FLAG_SET_CMDLINE(DynamicDumpSharedSpaces, true) != JVMFlag::SUCCESS) { - return false; - } check_unsupported_dumping_properties(); - SharedDynamicArchivePath = os::strdup_check_oom(ArchiveClassesAtExit, mtArguments); - } else { - if (SharedDynamicArchivePath != nullptr) { - os::free(SharedDynamicArchivePath); - SharedDynamicArchivePath = nullptr; - } } - if (SharedArchiveFile == NULL) { + + if (SharedArchiveFile == nullptr) { SharedArchivePath = get_default_shared_archive_path(); } else { int archives = num_archives(SharedArchiveFile); - if (is_dumping_archive()) { - if (archives > 1) { - vm_exit_during_initialization( - "Cannot have more than 1 archive file specified in -XX:SharedArchiveFile during CDS dumping"); - } - if (DynamicDumpSharedSpaces) { - if (os::same_files(SharedArchiveFile, ArchiveClassesAtExit)) { - vm_exit_during_initialization( - "Cannot have the same archive file specified for -XX:SharedArchiveFile and -XX:ArchiveClassesAtExit", - SharedArchiveFile); - } - } + assert(archives > 0, "must be"); + + if (is_dumping_archive() && archives > 1) { + vm_exit_during_initialization( + "Cannot have more than 1 archive file specified in -XX:SharedArchiveFile during CDS dumping"); } - if (!is_dumping_archive()){ + + if (DumpSharedSpaces) { + assert(archives == 1, "must be"); + // Static dump is simple: only one archive is allowed in SharedArchiveFile. This file + // will be overwritten no matter regardless of its contents + SharedArchivePath = os::strdup_check_oom(SharedArchiveFile, mtArguments); + } else { + // SharedArchiveFile may specify one or two files. In case (c), the path for base.jsa + // is read from top.jsa + // (a) 1 file: -XX:SharedArchiveFile=base.jsa + // (b) 2 files: -XX:SharedArchiveFile=base.jsa:top.jsa + // (c) 2 files: -XX:SharedArchiveFile=top.jsa + // + // However, if either RecordDynamicDumpInfo or ArchiveClassesAtExit is used, we do not + // allow cases (b) and (c). Case (b) is already checked above. + if (archives > 2) { vm_exit_during_initialization( "Cannot have more than 2 archive files specified in the -XX:SharedArchiveFile option"); @@ -3543,11 +3545,26 @@ bool Arguments::init_shared_archive_paths() { extract_shared_archive_paths((const char*)SharedArchiveFile, &SharedArchivePath, &SharedDynamicArchivePath); } - } else { // CDS dumping - SharedArchivePath = os::strdup_check_oom(SharedArchiveFile, mtArguments); + + if (SharedDynamicArchivePath != nullptr) { + // Check for case (c) + if (RecordDynamicDumpInfo) { + vm_exit_during_initialization("-XX:+RecordDynamicDumpInfo is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile", + SharedArchiveFile); + } + if (ArchiveClassesAtExit != nullptr) { + vm_exit_during_initialization("-XX:ArchiveClassesAtExit is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile", + SharedArchiveFile); + } + } + + if (ArchiveClassesAtExit != nullptr && os::same_files(SharedArchiveFile, ArchiveClassesAtExit)) { + vm_exit_during_initialization( + "Cannot have the same archive file specified for -XX:SharedArchiveFile and -XX:ArchiveClassesAtExit", + SharedArchiveFile); + } } } - return (SharedArchivePath != NULL); } #endif // INCLUDE_CDS diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp index dbd20d9257c..0867f5c5c4d 100644 --- a/src/hotspot/share/runtime/arguments.hpp +++ b/src/hotspot/share/runtime/arguments.hpp @@ -618,7 +618,7 @@ class Arguments : AllStatic { static void fix_appclasspath(); static char* get_default_shared_archive_path() NOT_CDS_RETURN_(NULL); - static bool init_shared_archive_paths() NOT_CDS_RETURN_(false); + static void init_shared_archive_paths() NOT_CDS_RETURN; // Operation modi static Mode mode() { return _mode; } diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index bb5b46af6c5..ee7e6abb40a 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -503,9 +503,10 @@ void before_exit(JavaThread* thread) { os::terminate_signal_thread(); #if INCLUDE_CDS - if (DynamicDumpSharedSpaces) { + if (DynamicArchive::should_dump_at_vm_exit()) { + assert(ArchiveClassesAtExit != NULL, "Must be already set"); ExceptionMark em(thread); - DynamicArchive::dump(thread); + DynamicArchive::dump(ArchiveClassesAtExit, thread); if (thread->has_pending_exception()) { ResourceMark rm(thread); oop pending_exception = thread->pending_exception(); diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 1e776285412..b4a9b0c59a8 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -3303,8 +3303,8 @@ void JavaThread::invoke_shutdown_hooks() { // Link all classes for dynamic CDS dumping before vm exit. // Same operation is being done in JVM_BeforeHalt for handling the // case where the application calls System.exit(). - if (DynamicDumpSharedSpaces) { - DynamicArchive::prepare_for_dynamic_dumping(); + if (DynamicArchive::should_dump_at_vm_exit()) { + DynamicArchive::prepare_for_dump_at_exit(); } #endif diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java index d54b36854da..68785b32c1c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java @@ -24,6 +24,7 @@ /* * @test + * @bug 8276787 * @summary Some negative tests for the SharedArchiveFile option * @requires vm.cds * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes @@ -34,9 +35,10 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. SharedArchiveFileOption */ -import jdk.test.lib.helpers.ClassFileInstaller; - import java.io.File; +import jdk.test.lib.Asserts; +import jdk.test.lib.helpers.ClassFileInstaller; +import jtreg.SkippedException; public class SharedArchiveFileOption extends DynamicArchiveTestBase { public static void main(String[] args) throws Exception { @@ -53,12 +55,32 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { doTest(baseArchiveName, topArchiveName); } + private static int testnum = 0; + private static void testcase(String s) { + System.out.println("\n\nTest #" + (++testnum) + " " + s); + } + + private interface MyRunnable { + public void run() throws Exception; + } + + private static void mustSkipWith(String expectedMsg, MyRunnable r) throws Exception { + try { + r.run(); + } catch (SkippedException e) { + System.out.println("Got SkippedException: " + e); + Asserts.assertTrue(e.getMessage().contains(expectedMsg), "SkippedException must have message " + expectedMsg); + return; + } + Asserts.fail("SkippedException should have been thrown"); + } + private static void doTest(String baseArchiveName, String topArchiveName) throws Exception { String appJar = ClassFileInstaller.getJarPath("hello.jar"); String mainClass = "Hello"; String dummyArchiveName = getNewArchiveName("dummy"); - // -Xshare:dump specified with -XX:ArchiveClassesAtExit + testcase("-Xshare:dump specified with -XX:ArchiveClassesAtExit"); dump2(dummyArchiveName, dummyArchiveName, "-Xlog:cds", "-Xlog:cds+dynamic=debug", @@ -68,8 +90,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { output.shouldContain("-XX:ArchiveClassesAtExit cannot be used with -Xshare:dump"); }); - // more than 1 archive file specified in -XX:SharedArchiveFile during - // dynamic dumpgin + testcase("more than 1 archive file specified in -XX:SharedArchiveFile during dynamic dump"); String dummyArchives = dummyArchiveName + File.pathSeparator + dummyArchiveName; dump2(dummyArchives, dummyArchiveName, "-Xlog:cds", @@ -79,7 +100,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { output.shouldContain("Cannot have more than 1 archive file specified in -XX:SharedArchiveFile during CDS dumping"); }); - // normal dynamic archive dumping + testcase("normal dynamic archive dumping"); dump2(baseArchiveName, topArchiveName, "-Xlog:cds", "-Xlog:cds+dynamic=debug", @@ -88,7 +109,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { output.shouldContain("Written dynamic archive 0x"); }); - // same archive file specified for -XX:SharedArchiveFile and -XX:ArchiveClassesAtExit + testcase("same archive file specified for -XX:SharedArchiveFile and -XX:ArchiveClassesAtExit"); dump2(baseArchiveName, baseArchiveName, "-Xlog:cds", "-Xlog:cds+dynamic=debug", @@ -99,7 +120,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { }); - // a top archive specified in the base archive position + testcase("a top archive specified in the base archive position"); run2(topArchiveName, baseArchiveName, "-Xlog:class+load", "-Xlog:cds+dynamic=debug,cds=debug", @@ -108,7 +129,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { output.shouldMatch("Not a base shared archive:.*top.*.jsa"); }); - // a base archive specified in the top archive position + testcase("a base archive specified in the top archive position"); run2(baseArchiveName, baseArchiveName2, "-Xlog:class+load", "-Xlog:cds+dynamic=debug,cds=debug", @@ -117,7 +138,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { output.shouldMatch("Not a top shared archive:.*base.*.jsa"); }); - // more than 2 archives specified in the -XX:ShareArchiveFile option + testcase("more than 2 archives specified in the -XX:ShareArchiveFile option"); String baseArchives = baseArchiveName + File.pathSeparator + baseArchiveName2; run2(baseArchives, topArchiveName, "-Xlog:class+load", @@ -128,7 +149,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { "Cannot have more than 2 archive files specified in the -XX:SharedArchiveFile option"); }); - // base archive not specified + testcase("base archive not specified"); final String topArchive = File.pathSeparator + topArchiveName; run2(topArchive, null, "-Xlog:class+load", @@ -139,7 +160,7 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { "Base archive was not specified: " + topArchive); }); - // top archive not specified + testcase("top archive not specified"); final String baseArchive = baseArchiveName + File.pathSeparator; run2(baseArchive, null, "-Xlog:class+load", @@ -149,5 +170,96 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { output.shouldContain( "Top archive was not specified: " + baseArchive); }); + + + testcase("A dynamic archive is already loaded when -XX:SharedArchiveFile is specified"); + dump2(baseArchiveName /*this is overridden by -XX:SharedArchiveFile= below*/, + topArchiveName, + "-XX:SharedArchiveFile=" + topArchiveName, + "-cp", appJar, mainClass) + .assertAbnormalExit("-XX:ArchiveClassesAtExit is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:"); + + testcase("A dynamic archive is already loaded when -XX:+RecordDynamicDumpInfo is specified"); + run2(null, topArchiveName, + "-XX:+RecordDynamicDumpInfo", + "-cp", appJar, mainClass) + .assertAbnormalExit("-XX:+RecordDynamicDumpInfo is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:"); + + testcase("-XX:+RecordDynamicDumpInfo cannot be used with -XX:ArchiveClassesAtExit"); + dump2(baseArchiveName, + topArchiveName, + "-XX:+RecordDynamicDumpInfo", + "-cp", appJar, mainClass) + .assertAbnormalExit("-XX:+RecordDynamicDumpInfo cannot be used with -XX:ArchiveClassesAtExit"); + + testcase("Specifying -XX:+RecordDynamicDumpInfo should not cause dynamic dump"); + run2(baseArchiveName, null, + "-XX:+RecordDynamicDumpInfo", + "-Xlog:cds+dynamic=debug", + "-cp", appJar, mainClass) + .assertNormalExit(output -> { + output.shouldNotMatch("\\[cds,dynamic"); + }); + + { + String ERROR = "-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded"; + + testcase("-XX:ArchiveClassesAtExit with CDS disabled (-Xshare:off)"); + mustSkipWith(ERROR, () -> { + dump2(baseArchiveName, + topArchiveName, + "-Xshare:off", + "-cp", appJar, mainClass); + }); + + testcase("-XX:ArchiveClassesAtExit with CDS disabled (Base archive cannot be mapped -- doesn't exist"); + mustSkipWith(ERROR, () -> { + dump2(baseArchiveName + ".notExist", + topArchiveName, + "-Xlog:cds", + "-Xshare:auto", + "-cp", appJar, mainClass); + }); + + testcase("-XX:ArchiveClassesAtExit with CDS disabled (incompatible VM options)"); + dump2(baseArchiveName, + topArchiveName, + "--patch-module", + "foo.bar=xxx", + "-Xshare:auto", + "-Xlog:cds", + "-cp", appJar, mainClass) + .assertAbnormalExit("Cannot use the following option when dumping the shared archive: --patch-module"); + } + + { + String ERROR = "-XX:+RecordDynamicDumpInfo is unsupported when base CDS archive is not loaded"; + + testcase("-XX:+RecordDynamicDumpInfo with CDS disabled (-Xshare:off)"); + run2(baseArchiveName, null, + "-XX:+RecordDynamicDumpInfo", + "-Xshare:off", + "-cp", appJar, mainClass) + .assertAbnormalExit(ERROR); + + testcase("-XX:+RecordDynamicDumpInfo with CDS disabled (Base archive cannot be mapped -- doesn't exist"); + run2(baseArchiveName + ".notExist", null, + "-XX:+RecordDynamicDumpInfo", + "-Xshare:auto", + "-Xlog:cds", + "-cp", appJar, mainClass) + .assertAbnormalExit(ERROR); + + testcase("-XX:+RecordDynamicDumpInfo with CDS disabled (incompatible VM options)"); + run2(baseArchiveName + ".notExist", null, + "-XX:+RecordDynamicDumpInfo", + "--patch-module", + "foo.bar=xxx", + "-Xshare:auto", + "-Xlog:cds", + "-cp", appJar, mainClass) + .assertAbnormalExit("CDS is disabled when the --patch-module option is specified", + ERROR); + } } } diff --git a/test/lib/jdk/test/lib/cds/CDSTestUtils.java b/test/lib/jdk/test/lib/cds/CDSTestUtils.java index c3ce3a95504..f7e263ba5c5 100644 --- a/test/lib/jdk/test/lib/cds/CDSTestUtils.java +++ b/test/lib/jdk/test/lib/cds/CDSTestUtils.java @@ -41,7 +41,7 @@ public class CDSTestUtils { public static final String MSG_RANGE_ALREADT_IN_USE = "Unable to allocate region, java heap range is already in use."; public static final String MSG_DYNAMIC_NOT_SUPPORTED = - "DynamicDumpSharedSpaces is unsupported when base CDS archive is not loaded"; + "-XX:ArchiveClassesAtExit is unsupported when base CDS archive is not loaded"; public static final boolean DYNAMIC_DUMP = Boolean.getBoolean("test.dynamic.cds.archive"); public interface Checker { @@ -326,9 +326,7 @@ public class CDSTestUtils { // Special case -- sometimes Xshare:on fails because it failed to map // at given address. This behavior is platform-specific, machine config-specific // and can be random (see ASLR). - if (isUnableToMap(output)) { - throw new SkippedException(UnableToMapMsg); - } + checkMappingFailure(output); if (e != null) { throw e; @@ -351,19 +349,28 @@ public class CDSTestUtils { // instead of utilizing multiple messages. // These are suggestions to improve testibility of the VM. However, implementing them // could also improve usability in the field. - public static boolean isUnableToMap(OutputAnalyzer output) { + private static String hasUnableToMapMessage(OutputAnalyzer output) { String outStr = output.getOutput(); - if ((output.getExitValue() == 1) && - (outStr.contains(MSG_RANGE_NOT_WITHIN_HEAP) || outStr.contains(MSG_DYNAMIC_NOT_SUPPORTED))) { - return true; + if ((output.getExitValue() == 1)) { + if (outStr.contains(MSG_RANGE_NOT_WITHIN_HEAP)) { + return MSG_RANGE_NOT_WITHIN_HEAP; + } + if (outStr.contains(MSG_DYNAMIC_NOT_SUPPORTED)) { + return MSG_DYNAMIC_NOT_SUPPORTED; + } } - return false; + return null; + } + + public static boolean isUnableToMap(OutputAnalyzer output) { + return hasUnableToMapMessage(output) != null; } public static void checkMappingFailure(OutputAnalyzer out) throws SkippedException { - if (isUnableToMap(out)) { - throw new SkippedException(UnableToMapMsg); + String match = hasUnableToMapMessage(out); + if (match != null) { + throw new SkippedException(UnableToMapMsg + ": " + match); } } @@ -472,10 +479,7 @@ public class CDSTestUtils { public static OutputAnalyzer checkExecExpectError(OutputAnalyzer output, int expectedExitValue, String... extraMatches) throws Exception { - if (isUnableToMap(output)) { - throw new SkippedException(UnableToMapMsg); - } - + checkMappingFailure(output); output.shouldHaveExitValue(expectedExitValue); checkMatches(output, extraMatches); return output; -- GitLab From 23e5117a55b3f3d0e3d26bf2d481f4ad1c99af57 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Wed, 17 Nov 2021 03:20:40 +0000 Subject: [PATCH 353/890] 8276559: (httpclient) Consider adding an HttpRequest.Builder.HEAD method to build a HEAD request. Reviewed-by: cstein, dfuchs --- .../classes/java/net/http/HttpRequest.java | 18 +++++- .../net/http/HttpRequestBuilderImpl.java | 5 ++ test/jdk/java/net/httpclient/HeadTest.java | 60 +++++++------------ .../httpclient/HttpRequestBuilderTest.java | 7 ++- .../httpclient/HttpRequestNewBuilderTest.java | 5 +- .../net/httpclient/RequestBuilderTest.java | 7 ++- 6 files changed, 58 insertions(+), 44 deletions(-) diff --git a/src/java.net.http/share/classes/java/net/http/HttpRequest.java b/src/java.net.http/share/classes/java/net/http/HttpRequest.java index 5dc0486826a..fc9c10b14bc 100644 --- a/src/java.net.http/share/classes/java/net/http/HttpRequest.java +++ b/src/java.net.http/share/classes/java/net/http/HttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -256,6 +256,19 @@ public abstract class HttpRequest { */ public Builder DELETE(); + /** + * Sets the request method of this builder to HEAD. + * + * @implSpec The default implementation is expected to have the same behaviour as: + * {@code return method("HEAD", BodyPublishers.noBody());} + * + * @return this builder + * @since 18 + */ + default Builder HEAD() { + return method("HEAD", BodyPublishers.noBody()); + } + /** * Sets the request method and request body of this builder to the * given values. @@ -360,12 +373,13 @@ public abstract class HttpRequest { request.bodyPublisher().ifPresentOrElse( // if body is present, set it bodyPublisher -> builder.method(method, bodyPublisher), - // otherwise, the body is absent, special case for GET/DELETE, + // otherwise, the body is absent, special case for GET/DELETE/HEAD, // or else use empty body () -> { switch (method) { case "GET" -> builder.GET(); case "DELETE" -> builder.DELETE(); + case "HEAD" -> builder.HEAD(); default -> builder.method(method, HttpRequest.BodyPublishers.noBody()); } } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java b/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java index d11a18f7c58..e4dee55d8ea 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpRequestBuilderImpl.java @@ -182,6 +182,11 @@ public class HttpRequestBuilderImpl implements HttpRequest.Builder { return method0("DELETE", null); } + @Override + public HttpRequest.Builder HEAD() { + return method0("HEAD", null); + } + @Override public HttpRequest.Builder PUT(BodyPublisher body) { return method0("PUT", requireNonNull(body)); diff --git a/test/jdk/java/net/httpclient/HeadTest.java b/test/jdk/java/net/httpclient/HeadTest.java index 30fb5741d5d..bda7b84d774 100644 --- a/test/jdk/java/net/httpclient/HeadTest.java +++ b/test/jdk/java/net/httpclient/HeadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8203433 + * @bug 8203433 8276559 * @summary (httpclient) Add tests for HEAD and 304 responses. * @modules java.base/sun.net.www.http * java.net.http/jdk.internal.net.http.common @@ -48,43 +48,20 @@ import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import javax.net.ServerSocketFactory; import javax.net.ssl.SSLContext; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.Writer; import java.net.InetAddress; import java.net.InetSocketAddress; -import java.net.ServerSocket; -import java.net.Socket; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpClient.Redirect; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.atomic.AtomicLong; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static java.lang.System.out; -import static java.nio.charset.StandardCharsets.UTF_8; -import static java.net.HttpURLConnection.HTTP_OK; import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; public class HeadTest implements HttpServerAdapters { @@ -98,8 +75,6 @@ public class HeadTest implements HttpServerAdapters { String http2URI; String https2URI; - static final String MESSAGE = "Basic HeadTest message body"; - static final int ITERATIONS = 3; static final String CONTENT_LEN = "300"; /* @@ -133,27 +108,38 @@ public class HeadTest implements HttpServerAdapters { }; } - static final AtomicLong requestCounter = new AtomicLong(); - @Test(dataProvider = "positive") void test(String uriString, String method, int expResp, HttpClient.Version version) throws Exception { out.printf("%n---- starting (%s) ----%n", uriString); - HttpClient client = HttpClient.newBuilder() - .followRedirects(Redirect.ALWAYS) - .sslContext(sslContext) - .build(); - URI uri = URI.create(uriString); - HttpRequest.Builder requestBuilder = HttpRequest .newBuilder(uri) .method(method, HttpRequest.BodyPublishers.noBody()); - if (version != null) { requestBuilder.version(version); } - HttpRequest request = requestBuilder.build(); + doTest(requestBuilder.build(), expResp); + // repeat the test this time by building the request using convenience + // GET and HEAD methods + requestBuilder = HttpRequest.newBuilder(uri); + if (version != null) { + requestBuilder.version(version); + } + switch (method) { + case "GET" -> requestBuilder.GET(); + case "HEAD" -> requestBuilder.HEAD(); + default -> throw new IllegalArgumentException("Unexpected method " + method); + } + doTest(requestBuilder.build(), expResp); + } + + // issue a request with no body and verify the response code is the expected response code + private void doTest(HttpRequest request, int expResp) throws Exception { + HttpClient client = HttpClient.newBuilder() + .followRedirects(Redirect.ALWAYS) + .sslContext(sslContext) + .build(); out.println("Initial request: " + request.uri()); HttpResponse response = client.send(request, BodyHandlers.ofString()); diff --git a/test/jdk/java/net/httpclient/HttpRequestBuilderTest.java b/test/jdk/java/net/httpclient/HttpRequestBuilderTest.java index a3134397bcf..a0c74048503 100644 --- a/test/jdk/java/net/httpclient/HttpRequestBuilderTest.java +++ b/test/jdk/java/net/httpclient/HttpRequestBuilderTest.java @@ -36,7 +36,7 @@ import static java.net.http.HttpRequest.BodyPublishers.noBody; /** * @test - * @bug 8170064 + * @bug 8170064 8276559 * @summary HttpRequest[.Builder] API and behaviour checks */ public class HttpRequestBuilderTest { @@ -156,6 +156,7 @@ public class HttpRequestBuilderTest { IllegalArgumentException.class); test0("DELETE", () -> HttpRequest.newBuilder(TEST_URI).DELETE().build(), null); + test0("HEAD", () -> HttpRequest.newBuilder(TEST_URI).HEAD().build(), null); builder = test1("POST", builder, builder::POST, noBody(), null); @@ -254,7 +255,9 @@ public class HttpRequestBuilderTest { () -> HttpRequest.newBuilder(TEST_URI).GET().DELETE(), "DELETE"); - + method("newBuilder(TEST_URI).HEAD().build().method() == HEAD", + () -> HttpRequest.newBuilder(TEST_URI).HEAD(), + "HEAD"); } diff --git a/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java b/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java index c1c7e3432b6..eab9ecfc2c7 100644 --- a/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java +++ b/test/jdk/java/net/httpclient/HttpRequestNewBuilderTest.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2021, 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 @@ -51,7 +51,7 @@ import static org.testng.Assert.fail; /** * @test -* @bug 8252304 +* @bug 8252304 8276559 * @summary HttpRequest.newBuilder(HttpRequest) API and behaviour checks * @run testng/othervm HttpRequestNewBuilderTest */ @@ -120,6 +120,7 @@ public class HttpRequestNewBuilderTest { .headers("testName1", "y") .headers("testName1", "z").build() }, // dedicated method + { HttpRequest.newBuilder(URI.create("https://method-0/")).HEAD().build() }, { HttpRequest.newBuilder(URI.create("https://method-1/")).GET().build() }, { HttpRequest.newBuilder(URI.create("https://method-2/")).DELETE().build() }, { HttpRequest.newBuilder(URI.create("https://method-3/")).POST(HttpRequest.BodyPublishers.ofString("testData")).build() }, diff --git a/test/jdk/java/net/httpclient/RequestBuilderTest.java b/test/jdk/java/net/httpclient/RequestBuilderTest.java index 440014f1dd0..991b6f9d2d9 100644 --- a/test/jdk/java/net/httpclient/RequestBuilderTest.java +++ b/test/jdk/java/net/httpclient/RequestBuilderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -23,6 +23,7 @@ /* * @test + * @bug 8276559 * @summary HttpRequest[.Builder] API and behaviour checks * @run testng RequestBuilderTest */ @@ -160,6 +161,10 @@ public class RequestBuilderTest { assertEquals(request.method(), "DELETE"); assertTrue(!request.bodyPublisher().isPresent()); + request = newBuilder(uri).HEAD().build(); + assertEquals(request.method(), "HEAD"); + assertFalse(request.bodyPublisher().isPresent()); + request = newBuilder(uri).GET().POST(BodyPublishers.ofString("")).build(); assertEquals(request.method(), "POST"); assertTrue(request.bodyPublisher().isPresent()); -- GitLab From 08f65a59a7bd387974d94253ec7093524a3e92f1 Mon Sep 17 00:00:00 2001 From: Fairoz Matte Date: Wed, 17 Nov 2021 06:13:26 +0000 Subject: [PATCH 354/890] 8277313: Validate header failed for test/jdk/java/net/httpclient/HeadTest.java Reviewed-by: jdv --- test/jdk/java/net/httpclient/HeadTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/java/net/httpclient/HeadTest.java b/test/jdk/java/net/httpclient/HeadTest.java index bda7b84d774..fe8af5545c3 100644 --- a/test/jdk/java/net/httpclient/HeadTest.java +++ b/test/jdk/java/net/httpclient/HeadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 -- GitLab From 9aa30de4bb55357ddf0900e6103062f02e85753b Mon Sep 17 00:00:00 2001 From: Faye Gao Date: Wed, 17 Nov 2021 08:19:46 +0000 Subject: [PATCH 355/890] 8275317: AArch64: Support some type conversion vectorization in SLP Reviewed-by: thartmann, ngasson --- src/hotspot/share/opto/superword.cpp | 8 ++ src/hotspot/share/opto/vectornode.cpp | 8 ++ .../compiler/codegen/TestIntFloatVect.java | 94 ++++++++++++++++++- .../compiler/codegen/TestLongDoubleVect.java | 94 ++++++++++++++++++- .../vm/compiler/TypeVectorOperations.java | 30 +++++- 5 files changed, 229 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp index 7850e19f16d..d488d0eba5f 100644 --- a/src/hotspot/share/opto/superword.cpp +++ b/src/hotspot/share/opto/superword.cpp @@ -2558,6 +2558,14 @@ void SuperWord::output() { Node* in = vector_opd(p, 1); vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n)); vlen_in_bytes = vn->as_Vector()->length_in_bytes(); + } else if (opc == Op_ConvI2F || opc == Op_ConvL2D || + opc == Op_ConvF2I || opc == Op_ConvD2L) { + assert(n->req() == 2, "only one input expected"); + BasicType bt = velt_basic_type(n); + int vopc = VectorNode::opcode(opc, bt); + Node* in = vector_opd(p, 1); + vn = VectorCastNode::make(vopc, in, bt, vlen); + vlen_in_bytes = vn->as_Vector()->length_in_bytes(); } else if (is_cmov_pack(p)) { if (can_process_post_loop) { // do not refactor of flow in post loop context diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index 6a5b0b9b014..6d845271e47 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -224,6 +224,14 @@ int VectorNode::opcode(int sopc, BasicType bt) { return Op_StoreVector; case Op_MulAddS2I: return Op_MulAddVS2VI; + case Op_ConvI2F: + return Op_VectorCastI2X; + case Op_ConvL2D: + return Op_VectorCastL2X; + case Op_ConvF2I: + return Op_VectorCastF2X; + case Op_ConvD2L: + return Op_VectorCastD2X; default: return 0; // Unimplemented diff --git a/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java b/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java index 9074a699738..be8acc6cb29 100644 --- a/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java +++ b/test/hotspot/jtreg/compiler/codegen/TestIntFloatVect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -75,6 +75,8 @@ public class TestIntFloatVect { test_vi_unaln(a1, b1, (int)123, 103.f); test_cp_unalndst(a1, a2, b1, b2); test_cp_unalnsrc(a1, a2, b1, b2); + test_conv_i2f(a1, b1); + test_conv_f2i(a1, b1); } // Initialize for (int i=0; i Date: Wed, 17 Nov 2021 09:59:55 +0000 Subject: [PATCH 356/890] 8277221: G1: Remove methods without implementations in G1CollectedHeap Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index 513c60ed391..2178dfc9d0f 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -777,8 +777,6 @@ public: // Start a concurrent cycle. void start_concurrent_cycle(bool concurrent_operation_is_full_mark); - void wait_for_root_region_scanning(); - void prepare_tlabs_for_mutator(); void retire_tlabs(); @@ -936,9 +934,6 @@ public: void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap) override; - // Try to minimize the remembered set. - void scrub_rem_set(); - // Apply the given closure on all cards in the Hot Card Cache, emptying it. void iterate_hcc_closure(G1CardTableEntryClosure* cl, uint worker_id); -- GitLab From 2af9e5976fdf94afc7dbe5ad7827553818057bae Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Wed, 17 Nov 2021 11:59:52 +0000 Subject: [PATCH 357/890] 8276139: TestJpsHostName.java not reliable, better to expand HostIdentifierCreate.java test Reviewed-by: jiefu, sspitsyn --- .../HostIdentifier/HostIdentifierCreate.java | 2 +- .../jvmstat/monitor/HostIdentifier/testcases | 14 ++++++ test/jdk/sun/tools/jps/TestJpsHostName.java | 46 ------------------- 3 files changed, 15 insertions(+), 47 deletions(-) delete mode 100644 test/jdk/sun/tools/jps/TestJpsHostName.java diff --git a/test/jdk/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java b/test/jdk/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java index 98b6781a5c8..2f4f61df018 100644 --- a/test/jdk/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java +++ b/test/jdk/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4990825 + * @bug 4990825 8251155 * @summary test that HostIdentifier objects get created as expected * * @modules java.xml diff --git a/test/jdk/sun/jvmstat/monitor/HostIdentifier/testcases b/test/jdk/sun/jvmstat/monitor/HostIdentifier/testcases index 28dff2cdc02..804ab14938b 100644 --- a/test/jdk/sun/jvmstat/monitor/HostIdentifier/testcases +++ b/test/jdk/sun/jvmstat/monitor/HostIdentifier/testcases @@ -218,4 +218,18 @@ special syntax - not a valid URI, but allowed by HostIdentifier rmi://10.0.0.1:1234 + + +Purely numeric + + //12345 + + + + +Purely numeric + + //12345:123 + + diff --git a/test/jdk/sun/tools/jps/TestJpsHostName.java b/test/jdk/sun/tools/jps/TestJpsHostName.java deleted file mode 100644 index 4ef9d91ac31..00000000000 --- a/test/jdk/sun/tools/jps/TestJpsHostName.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. - * 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.process.OutputAnalyzer; - -/* - * @test - * @bug 8251155 - * @summary Test host names starting with digits - * @library /test/lib - * @build JpsHelper - * @run driver TestJpsHostName - */ -public class TestJpsHostName { - - public static void main(String[] args) throws Throwable { - testJpsHostName("12345"); - testJpsHostName("12345:37266"); - } - - private static void testJpsHostName(String hostname) throws Exception { - OutputAnalyzer output = JpsHelper.jps(hostname); - output.shouldNotContain("Malformed Host Identifier: " + hostname); - } - -} -- GitLab From 9f2f46ee4576d9cd0190530949e5e50f796a6bdc Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 17 Nov 2021 14:25:17 +0000 Subject: [PATCH 358/890] 8275037: Test vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java crashes with memory exhaustion on Windows Reviewed-by: coleenp --- .../jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java | 3 ++- .../jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java index e48ff567aac..6f3a2084083 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/GenClassesBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -71,6 +71,7 @@ public class GenClassesBuilder { moveJavaFiles(genSrcDir, prefix); JDKToolLauncher javac = JDKToolLauncher.create("javac") + .addToolArg("-J-Xmx1G") .addToolArg("-d") .addToolArg(classesDir.toString()) .addToolArg("-cp") diff --git a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java index 043cbf8b80e..2b217a368c2 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/sysdict/share/SysDictTest.java @@ -148,8 +148,8 @@ public abstract class SysDictTest extends ThreadedGCTest { // set name into public variable just to be sure // that class is loaded tmp = clz.getName(); - } catch (OutOfMemoryError | ClassNotFoundException e) { - // just ignore + } catch (OutOfMemoryError | ClassNotFoundException | NoClassDefFoundError e) { + // just ignore, note that CNFE and NCDFE can be caused by OOM exceptions. } catch (StackOverflowError soe) { // just ignore, chains could be too large // StackOverflowError could be in some sparcs -- GitLab From 8f5a8f740b62c27cc244debe57aaa2975f84a694 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 17 Nov 2021 17:36:53 +0000 Subject: [PATCH 359/890] 8264293: Create implementation for NSAccessibilityMenu protocol peer 8264296: Create implementation for NSAccessibilityPopUpButton protocol peer 8264295: Create implementation for NSAccessibilityMenuItem protocol peer 8264294: Create implementation for NSAccessibilityMenuBar protocol peer Reviewed-by: pbansal, ant --- .../awt/JavaComponentAccessibility.m | 48 -------------- .../awt/a11y/CommonComponentAccessibility.m | 54 +++++++++++++++- .../libawt_lwawt/awt/a11y/MenuAccessibility.h | 35 +++++++++++ .../libawt_lwawt/awt/a11y/MenuAccessibility.m | 45 ++++++++++++++ .../awt/a11y/MenuBarAccessibility.h | 34 ++++++++++ .../awt/a11y/MenuBarAccessibility.m | 45 ++++++++++++++ .../awt/a11y/MenuItemAccessibility.h | 36 +++++++++++ .../awt/a11y/MenuItemAccessibility.m | 62 +++++++++++++++++++ 8 files changed, 310 insertions(+), 49 deletions(-) create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.h create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.m create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.h create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.m create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.h create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.m diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m index a1dc40ffd17..7f297b0b065 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m @@ -1516,54 +1516,6 @@ JNI_COCOA_ENTER(env); JNI_COCOA_EXIT(env); } -/* - * Class: sun_lwawt_macosx_CAccessible - * Method: menuOpened - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_menuOpened -(JNIEnv *env, jclass jklass, jlong element) -{ -JNI_COCOA_ENTER(env); - [ThreadUtilities performOnMainThread:@selector(postMenuOpened) - on:(JavaComponentAccessibility *)jlong_to_ptr(element) - withObject:nil - waitUntilDone:NO]; -JNI_COCOA_EXIT(env); -} - -/* - * Class: sun_lwawt_macosx_CAccessible - * Method: menuClosed - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_menuClosed -(JNIEnv *env, jclass jklass, jlong element) -{ -JNI_COCOA_ENTER(env); - [ThreadUtilities performOnMainThread:@selector(postMenuClosed) - on:(JavaComponentAccessibility *)jlong_to_ptr(element) - withObject:nil - waitUntilDone:NO]; -JNI_COCOA_EXIT(env); -} - -/* - * Class: sun_lwawt_macosx_CAccessible - * Method: menuItemSelected - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_menuItemSelected -(JNIEnv *env, jclass jklass, jlong element) -{ -JNI_COCOA_ENTER(env); - [ThreadUtilities performOnMainThread:@selector(postMenuItemSelected) - on:(JavaComponentAccessibility *)jlong_to_ptr(element) - withObject:nil - waitUntilDone:NO]; -JNI_COCOA_EXIT(env); -} - /* * Class: sun_lwawt_macosx_CAccessible * Method: unregisterFromCocoaAXSystem diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m index aa706818039..564355f82f6 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m @@ -122,7 +122,7 @@ static jobject sAccessibilityClass = NULL; /* * Here we should keep all the mapping between the accessibility roles and implementing classes */ - rolesMap = [[NSMutableDictionary alloc] initWithCapacity:46]; + rolesMap = [[NSMutableDictionary alloc] initWithCapacity:50]; [rolesMap setObject:@"ButtonAccessibility" forKey:@"pushbutton"]; [rolesMap setObject:@"ImageAccessibility" forKey:@"icon"]; @@ -152,6 +152,10 @@ static jobject sAccessibilityClass = NULL; [rolesMap setObject:@"ListAccessibility" forKey:@"list"]; [rolesMap setObject:@"OutlineAccessibility" forKey:@"tree"]; [rolesMap setObject:@"TableAccessibility" forKey:@"table"]; + [rolesMap setObject:@"MenuBarAccessibility" forKey:@"menubar"]; + [rolesMap setObject:@"MenuAccessibility" forKey:@"menu"]; + [rolesMap setObject:@"MenuItemAccessibility" forKey:@"menuitem"]; + [rolesMap setObject:@"MenuAccessibility" forKey:@"popupmenu"]; /* * All the components below should be ignored by the accessibility subsystem, @@ -1253,3 +1257,51 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_selectedCellsChanged waitUntilDone:NO]; JNI_COCOA_EXIT(env); } + +/* + * Class: sun_lwawt_macosx_CAccessible + * Method: menuOpened + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_menuOpened + (JNIEnv *env, jclass jklass, jlong element) +{ + JNI_COCOA_ENTER(env); + [ThreadUtilities performOnMainThread:@selector(postMenuOpened) + on:(CommonComponentAccessibility *)jlong_to_ptr(element) + withObject:nil + waitUntilDone:NO]; + JNI_COCOA_EXIT(env); +} + +/* + * Class: sun_lwawt_macosx_CAccessible + * Method: menuClosed + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_menuClosed + (JNIEnv *env, jclass jklass, jlong element) +{ + JNI_COCOA_ENTER(env); + [ThreadUtilities performOnMainThread:@selector(postMenuClosed) + on:(CommonComponentAccessibility *)jlong_to_ptr(element) + withObject:nil + waitUntilDone:NO]; + JNI_COCOA_EXIT(env); +} + +/* + * Class: sun_lwawt_macosx_CAccessible + * Method: menuItemSelected + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_menuItemSelected + (JNIEnv *env, jclass jklass, jlong element) +{ + JNI_COCOA_ENTER(env); + [ThreadUtilities performOnMainThread:@selector(postMenuItemSelected) + on:(CommonComponentAccessibility *)jlong_to_ptr(element) + withObject:nil + waitUntilDone:NO]; + JNI_COCOA_EXIT(env); +} diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.h new file mode 100644 index 00000000000..65e127aceed --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "CommonComponentAccessibility.h" +#import "GroupAccessibility.h" + +#import + +@interface MenuAccessibility : GroupAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.m new file mode 100644 index 00000000000..6dc4d050db2 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.m @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "MenuAccessibility.h" + +/* + * Implementing a protocol that represents menus both as submenu and as a + * MenuBar components + */ +@implementation MenuAccessibility +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return [[[self parent] javaRole] isEqualToString:@"combobox"] + ? NSAccessibilityPopUpButtonRole + : NSAccessibilityMenuRole; +} + +- (BOOL)isAccessibilityElement +{ + return YES; +} + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.h new file mode 100644 index 00000000000..3a69dd40c45 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "CommonComponentAccessibility.h" + +#import + +@interface MenuBarAccessibility : CommonComponentAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.m new file mode 100644 index 00000000000..d21bf5318da --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuBarAccessibility.m @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "MenuBarAccessibility.h" +#import "JNIUtilities.h" +#import "ThreadUtilities.h" +#import "sun_lwawt_macosx_CAccessibility.h" + +/* + * This is the protocol for the Menu Bar component + */ +@implementation MenuBarAccessibility +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityMenuBarRole; +} + +- (BOOL)isAccessibilityElement +{ + return YES; +} + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.h new file mode 100644 index 00000000000..19a1cc71a69 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "CommonComponentAccessibility.h" +#import "ButtonAccessibility.h" + +#import + +@interface MenuItemAccessibility : ButtonAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (void)handleAction:(NSMenuItem * _Nonnull)sender; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.m new file mode 100644 index 00000000000..945e50975eb --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuItemAccessibility.m @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "MenuItemAccessibility.h" + +/* + * This is the protocol for the MenuItem component. + */ +@implementation MenuItemAccessibility +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityMenuItemRole; +} + +- (BOOL)isAccessibilityElement +{ + return YES; +} + +- (BOOL)accessibilityPerformPick +{ + return [self performAccessibleAction:0]; +} + +- (BOOL)accessibilityPerformPress +{ + return [self performAccessibleAction:0]; +} + +- (NSString * _Nullable)accessibilityLabel +{ + return [super accessibilityLabel]; +} + +- (id _Nullable)accessibilityValue +{ + return [super accessibilityValue]; +} + +@end -- GitLab From b6876649a82bed508d817ccbde1600d00937e4b2 Mon Sep 17 00:00:00 2001 From: Alex Kasko Date: Wed, 17 Nov 2021 17:48:07 +0000 Subject: [PATCH 360/890] 8277159: Fix java/nio/file/FileStore/Basic.java test by ignoring /run/user/* mount points Reviewed-by: bpb, shade --- test/jdk/java/nio/file/FileStore/Basic.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/jdk/java/nio/file/FileStore/Basic.java b/test/jdk/java/nio/file/FileStore/Basic.java index 329a483dbd6..4a6bbabdc52 100644 --- a/test/jdk/java/nio/file/FileStore/Basic.java +++ b/test/jdk/java/nio/file/FileStore/Basic.java @@ -145,6 +145,16 @@ public class Basic { // reflect whether the space attributes would be accessible // were access to be permitted System.err.format("%s is inaccessible\n", store); + } catch (FileSystemException fse) { + // On Linux, ignore the FSE if the path is one of the + // /run/user/$UID mounts created by pam_systemd(8) as it + // might be mounted as a fuse.portal filesystem and + // its access attempt might fail with EPERM + if (!Platform.isLinux() || store.toString().indexOf("/run/user") == -1) { + throw new RuntimeException(fse); + } else { + System.err.format("%s error: %s\n", store, fse); + } } // two distinct FileStores should not be equal -- GitLab From a907b2b144f2af27392eb7c2f9656fbb1a759618 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 17 Nov 2021 19:53:55 +0000 Subject: [PATCH 361/890] 8276177: nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption failed with "assert(def_ik->is_being_redefined()) failed: should be being redefined to get here" Reviewed-by: hseigel, sspitsyn --- src/hotspot/share/oops/instanceKlass.hpp | 11 ++++++----- src/hotspot/share/utilities/accessFlags.hpp | 5 +++++ test/hotspot/jtreg/ProblemList.txt | 1 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index a3e8da4c8a4..d55b021b370 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -254,8 +254,7 @@ class InstanceKlass: public Klass { _misc_is_shared_platform_class = 1 << 11, // defining class loader is platform class loader _misc_is_shared_app_class = 1 << 12, // defining class loader is app class loader _misc_has_resolved_methods = 1 << 13, // resolved methods table entries added for this class - _misc_is_being_redefined = 1 << 14, // used for locking redefinition - _misc_has_contended_annotations = 1 << 15 // has @Contended annotation + _misc_has_contended_annotations = 1 << 14 // has @Contended annotation }; u2 shared_loader_type_bits() const { return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class; @@ -733,14 +732,16 @@ public: #if INCLUDE_JVMTI // Redefinition locking. Class can only be redefined by one thread at a time. + // The flag is in access_flags so that it can be set and reset using atomic + // operations, and not be reset by other misc_flag settings. bool is_being_redefined() const { - return ((_misc_flags & _misc_is_being_redefined) != 0); + return _access_flags.is_being_redefined(); } void set_is_being_redefined(bool value) { if (value) { - _misc_flags |= _misc_is_being_redefined; + _access_flags.set_is_being_redefined(); } else { - _misc_flags &= ~_misc_is_being_redefined; + _access_flags.clear_is_being_redefined(); } } diff --git a/src/hotspot/share/utilities/accessFlags.hpp b/src/hotspot/share/utilities/accessFlags.hpp index cb3663349a8..83d1b657906 100644 --- a/src/hotspot/share/utilities/accessFlags.hpp +++ b/src/hotspot/share/utilities/accessFlags.hpp @@ -69,6 +69,7 @@ enum { JVM_ACC_IS_SHARED_CLASS = 0x02000000, // True if klass is shared JVM_ACC_IS_HIDDEN_CLASS = 0x04000000, // True if klass is hidden JVM_ACC_IS_VALUE_BASED_CLASS = 0x08000000, // True if klass is marked as a ValueBased class + JVM_ACC_IS_BEING_REDEFINED = 0x00100000, // True if the klass is being redefined. // Klass* and Method* flags JVM_ACC_HAS_LOCAL_VARIABLE_TABLE= 0x00200000, @@ -159,6 +160,10 @@ class AccessFlags { void set_has_localvariable_table() { atomic_set_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); } void clear_has_localvariable_table() { atomic_clear_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); } + bool is_being_redefined() const { return (_flags & JVM_ACC_IS_BEING_REDEFINED) != 0; } + void set_is_being_redefined() { atomic_set_bits(JVM_ACC_IS_BEING_REDEFINED); } + void clear_is_being_redefined() { atomic_clear_bits(JVM_ACC_IS_BEING_REDEFINED); } + // field flags bool is_field_access_watched() const { return (_flags & JVM_ACC_FIELD_ACCESS_WATCHED) != 0; } bool is_field_modification_watched() const diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 7a2d384325a..b4bb635d7c9 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -158,7 +158,6 @@ vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.ja vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all -vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java 8272800 generic-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all -- GitLab From 262d07001babcbe7f9acd2053aa3b7bac304cf85 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 17 Nov 2021 20:03:55 +0000 Subject: [PATCH 362/890] 8277246: Check for NonRepudiation as well when validating a TSA certificate Reviewed-by: xuelei, mullan --- .../classes/sun/security/validator/EndEntityChecker.java | 7 +++++-- test/jdk/sun/security/tools/jarsigner/TimestampCheck.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/sun/security/validator/EndEntityChecker.java b/src/java.base/share/classes/sun/security/validator/EndEntityChecker.java index d0363f7482b..f048fffdbb4 100644 --- a/src/java.base/share/classes/sun/security/validator/EndEntityChecker.java +++ b/src/java.base/share/classes/sun/security/validator/EndEntityChecker.java @@ -105,6 +105,7 @@ class EndEntityChecker { // bit numbers in the key usage extension private static final int KU_SIGNATURE = 0; + private static final int KU_NON_REPUDIATION = 1; private static final int KU_KEY_ENCIPHERMENT = 2; private static final int KU_KEY_AGREEMENT = 4; @@ -356,9 +357,11 @@ class EndEntityChecker { */ private void checkTSAServer(X509Certificate cert, Set exts) throws CertificateException { - if (checkKeyUsage(cert, KU_SIGNATURE) == false) { + // KU and EKU should be consistent + if (!checkKeyUsage(cert, KU_SIGNATURE) + && !checkKeyUsage(cert, KU_NON_REPUDIATION)) { throw new ValidatorException - ("KeyUsage does not allow digital signatures", + ("KeyUsage does not allow digital signatures or non repudiation", ValidatorException.T_EE_EXTENSIONS, cert); } diff --git a/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java b/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java index 9599e6ac066..16fc9bcb145 100644 --- a/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java +++ b/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java @@ -845,7 +845,7 @@ public class TimestampCheck { gencert("weakkeysize"); gencert("disabledkeysize"); gencert("badku", "-ext ku:critical=keyAgreement"); - gencert("ts", "-ext eku:critical=ts -validity 500"); + gencert("ts", "-ext eku:critical=ts -ext ku=nonrep -validity 500"); gencert("expired", "-validity 10 -startdate -12d"); gencert("expiring", "-validity 178"); -- GitLab From 8881f29bc83336bcbc0e8ff0cf1d2bbe55172f5c Mon Sep 17 00:00:00 2001 From: Dean Long Date: Wed, 17 Nov 2021 20:18:07 +0000 Subject: [PATCH 363/890] 8277310: ciReplay: @cpi MethodHandle references not resolved Reviewed-by: chagedorn, thartmann --- src/hotspot/share/ci/ciReplay.cpp | 89 +++++++++++++++---------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index e9cfbaf9fbd..04b9b0a83f1 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -436,7 +436,7 @@ class CompileReplay : public StackObj { } else if (strcmp(dyno_ref, "") == 0) { int pool_index = cp_cache_entry->constant_pool_index(); BootstrapInfo bootstrap_specifier(cp, pool_index, index); - obj = cp->resolve_possibly_cached_constant_at(bootstrap_specifier.bsm_index(), thread); + obj = cp->resolve_possibly_cached_constant_at(bootstrap_specifier.bsm_index(), CHECK_NULL); } else { report_error("unrecognized token"); return NULL; @@ -465,58 +465,57 @@ class CompileReplay : public StackObj { report_error("no method handle found at cpi"); return NULL; } - { - bool found_it; - ik->link_class(CHECK_NULL); - obj = cp->find_cached_constant_at(cpi, found_it, thread); - } + ik->link_class(CHECK_NULL); + obj = cp->resolve_possibly_cached_constant_at(cpi, CHECK_NULL); + } + if (obj == NULL) { + report_error("null cp object found"); + return NULL; } Klass* k = NULL; - if (obj != NULL) { - skip_ws(); - // loop: read fields - char* field = NULL; - do { - field = parse_string(); - if (field == NULL) { - report_error("no field found"); + skip_ws(); + // loop: read fields + char* field = NULL; + do { + field = parse_string(); + if (field == NULL) { + report_error("no field found"); + return NULL; + } + if (strcmp(field, ";") == 0) { + break; + } + // raw Method* + if (strcmp(field, "") == 0) { + Method* vmtarget = java_lang_invoke_MemberName::vmtarget(obj); + k = (vmtarget == NULL) ? NULL : vmtarget->method_holder(); + if (k == NULL) { + report_error("null vmtarget found"); return NULL; } - if (strcmp(field, ";") == 0) { - break; - } - // raw Method* - if (strcmp(field, "") == 0) { - Method* vmtarget = java_lang_invoke_MemberName::vmtarget(obj); - k = (vmtarget == NULL) ? NULL : vmtarget->method_holder(); - if (k == NULL) { - report_error("null vmtarget found"); - return NULL; - } - if (!parse_terminator()) { - report_error("missing terminator"); - return NULL; - } - return k; + if (!parse_terminator()) { + report_error("missing terminator"); + return NULL; } - obj = ciReplay::obj_field(obj, field); - // array - if (obj != NULL && obj->is_objArray()) { - objArrayOop arr = (objArrayOop)obj; - int index = parse_int("index"); - if (index >= arr->length()) { - report_error("bad array index"); - return NULL; - } - obj = arr->obj_at(index); + return k; + } + obj = ciReplay::obj_field(obj, field); + // array + if (obj != NULL && obj->is_objArray()) { + objArrayOop arr = (objArrayOop)obj; + int index = parse_int("index"); + if (index >= arr->length()) { + report_error("bad array index"); + return NULL; } - } while (obj != NULL); - if (obj == NULL) { - report_error("null field found"); - return NULL; + obj = arr->obj_at(index); } - k = obj->klass(); + } while (obj != NULL); + if (obj == NULL) { + report_error("null field found"); + return NULL; } + k = obj->klass(); return k; } -- GitLab From 007ad7c77c6277ce733386b4402b787d81dd41cf Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 17 Nov 2021 20:23:43 +0000 Subject: [PATCH 364/890] 8277303: Terminology mismatch between JLS17-3.9 and SE17's javax.lang.model.SourceVersion method specs Reviewed-by: iris, jjg --- .../javax/lang/model/SourceVersion.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index 32adcd11fff..0f315a3fe17 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -312,8 +312,8 @@ public enum SourceVersion { * Character#isJavaIdentifierStart(int)} returns {@code true}, * followed only by characters for which {@link * Character#isJavaIdentifierPart(int)} returns {@code true}. - * This pattern matches regular identifiers, keywords, restricted - * keywords, restricted identifiers and the literals {@code "true"}, + * This pattern matches regular identifiers, keywords, contextual + * keywords, and the literals {@code "true"}, * {@code "false"}, {@code "null"}. * * The method returns {@code false} for all other strings. @@ -359,8 +359,8 @@ public enum SourceVersion { * {@code false} for keywords, boolean literals, and the null * literal in any segment. * - * This method returns {@code true} for restricted - * keywords and restricted identifiers. + * This method returns {@code true} for contextual + * keywords. * * @param name the string to check * @return {@code true} if this string is a @@ -385,8 +385,8 @@ public enum SourceVersion { * {@code false} for keywords, boolean literals, and the null * literal in any segment. * - * This method returns {@code true} for restricted - * keywords and restricted identifiers. + * This method returns {@code true} for contextual + * keywords. * * @param name the string to check * @param version the version to use @@ -409,8 +409,8 @@ public enum SourceVersion { /** * Returns whether or not {@code s} is a keyword, boolean literal, * or null literal in the latest source version. - * This method returns {@code false} for restricted - * keywords and restricted identifiers. + * This method returns {@code false} for contextual + * keywords. * * @param s the string to check * @return {@code true} if {@code s} is a keyword, or boolean @@ -426,8 +426,8 @@ public enum SourceVersion { /** * Returns whether or not {@code s} is a keyword, boolean literal, * or null literal in the given source version. - * This method returns {@code false} for restricted - * keywords and restricted identifiers. + * This method returns {@code false} for contextual + * keywords. * * @param s the string to check * @param version the version to use -- GitLab From d8c0280273fa9f8e113088d6a43a4af076cd4f87 Mon Sep 17 00:00:00 2001 From: Dean Long Date: Wed, 17 Nov 2021 20:26:25 +0000 Subject: [PATCH 365/890] 8277316: ciReplay: dump_replay_data is not thread-safe Reviewed-by: chagedorn, thartmann --- src/hotspot/share/ci/ciEnv.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 9b8d118196b..7fae95ae632 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1681,8 +1681,8 @@ void ciEnv::dump_replay_data(outputStream* out) { } void ciEnv::dump_replay_data(int compile_id) { - static char buffer[O_BUFLEN]; - int ret = jio_snprintf(buffer, O_BUFLEN, "replay_pid%p_compid%d.log", os::current_process_id(), compile_id); + char buffer[64]; + int ret = jio_snprintf(buffer, sizeof(buffer), "replay_pid%d_compid%d.log", os::current_process_id(), compile_id); if (ret > 0) { int fd = os::open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); if (fd != -1) { @@ -1699,8 +1699,8 @@ void ciEnv::dump_replay_data(int compile_id) { } void ciEnv::dump_inline_data(int compile_id) { - static char buffer[O_BUFLEN]; - int ret = jio_snprintf(buffer, O_BUFLEN, "inline_pid%p_compid%d.log", os::current_process_id(), compile_id); + char buffer[64]; + int ret = jio_snprintf(buffer, sizeof(buffer), "inline_pid%d_compid%d.log", os::current_process_id(), compile_id); if (ret > 0) { int fd = os::open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); if (fd != -1) { -- GitLab From 6bb04626af6574ef1e8d4b7dad0389d4b59f5d08 Mon Sep 17 00:00:00 2001 From: Sean Coffey Date: Wed, 17 Nov 2021 20:50:46 +0000 Subject: [PATCH 366/890] 8277224: sun.security.pkcs.PKCS9Attributes.toString() throws NPE Reviewed-by: weijun --- .../classes/sun/security/pkcs/PKCS9Attributes.java | 10 +++++++--- .../security/x509/AlgorithmId/NonStandardNames.java | 9 +++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java b/src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java index f37070cd64e..7f6c1af5b1b 100644 --- a/src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java +++ b/src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java @@ -275,11 +275,13 @@ public class PKCS9Attributes { */ public PKCS9Attribute[] getAttributes() { PKCS9Attribute[] attribs = new PKCS9Attribute[attributes.size()]; - ObjectIdentifier oid; int j = 0; for (int i=1; i < PKCS9Attribute.PKCS9_OIDS.length && j < attribs.length; i++) { + if (PKCS9Attribute.PKCS9_OIDS[i] == null) { + continue; + } attribs[j] = getAttribute(PKCS9Attribute.PKCS9_OIDS[i]); if (attribs[j] != null) @@ -323,11 +325,13 @@ public class PKCS9Attributes { StringBuilder sb = new StringBuilder(200); sb.append("PKCS9 Attributes: [\n\t"); - ObjectIdentifier oid; PKCS9Attribute value; boolean first = true; for (int i = 1; i < PKCS9Attribute.PKCS9_OIDS.length; i++) { + if (PKCS9Attribute.PKCS9_OIDS[i] == null) { + continue; + } value = getAttribute(PKCS9Attribute.PKCS9_OIDS[i]); if (value == null) continue; @@ -338,7 +342,7 @@ public class PKCS9Attributes { else sb.append(";\n\t"); - sb.append(value.toString()); + sb.append(value); } sb.append("\n\t] (end PKCS9 Attributes)"); diff --git a/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java b/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java index 7823b1eddfa..948cfa47064 100644 --- a/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java +++ b/test/jdk/sun/security/x509/AlgorithmId/NonStandardNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 7180907 + * @bug 7180907 8277224 * @summary Jarsigner -verify fails if rsa file used sha-256 with authenticated attributes * @modules java.base/sun.security.pkcs * java.base/sun.security.tools.keytool @@ -60,8 +60,13 @@ public class NonStandardNames { PKCS9Attributes authed = new PKCS9Attributes(new PKCS9Attribute[]{ new PKCS9Attribute(PKCS9Attribute.CONTENT_TYPE_OID, ContentInfo.DATA_OID), new PKCS9Attribute(PKCS9Attribute.MESSAGE_DIGEST_OID, md.digest(data)), + new PKCS9Attribute(PKCS9Attribute.SIGNATURE_TIMESTAMP_TOKEN_OID, "test".getBytes()) }); + // test PKCS9Attributes.toString(), PKCS9Attributes.getAttributes() + System.out.println(authed); + authed.getAttributes(); + Signature s = Signature.getInstance("SHA256withRSA"); s.initSign(cakg.getPrivateKey()); s.update(authed.getDerEncoding()); -- GitLab From 45a60db5a0aa78fa9eb1c2899bd167c136e0fa03 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Wed, 17 Nov 2021 21:02:13 +0000 Subject: [PATCH 367/890] 8277045: G1: Remove unnecessary set_concurrency call in G1ConcurrentMark::weak_refs_work Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index 9d533cb89cb..dea7a858cba 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -1618,10 +1618,6 @@ void G1ConcurrentMark::weak_refs_work() { uint active_workers = (ParallelRefProcEnabled ? _g1h->workers()->active_workers() : 1U); active_workers = clamp(active_workers, 1u, _max_num_tasks); - // Set the concurrency level. The phase was already set prior to - // executing the remark task. - set_concurrency(active_workers); - // Set the degree of MT processing here. If the discovery was done MT, // the number of threads involved during discovery could differ from // the number of active workers. This is OK as long as the discovered -- GitLab From ce4471f806e51bc9f9ad746b69ba490443947110 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 17 Nov 2021 21:23:38 +0000 Subject: [PATCH 368/890] 8277346: ProblemList 7 serviceability/sa tests on macosx-x64 8277351: ProblemList runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java on macosx-x64 Reviewed-by: tschatzl, bpb --- test/hotspot/jtreg/ProblemList.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index b4bb635d7c9..fcc12d16677 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -105,6 +105,7 @@ runtime/os/TestTracePageSizes.java#compiler-options 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 +runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java 8277350 macosx-x64 applications/jcstress/copy.java 8229852 linux-all @@ -118,10 +119,13 @@ serviceability/sa/TestRevPtrsForInvokeDynamic.java 8241235 generic-all serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64 -serviceability/sa/ClhsdbCDSCore.java 8269982 macosx-aarch64 -serviceability/sa/ClhsdbFindPC.java#xcomp-core 8269982 macosx-aarch64 -serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8269982 macosx-aarch64 -serviceability/sa/ClhsdbPstack.java#core 8269982 macosx-aarch64 +serviceability/sa/ClhsdbCDSCore.java 8269982,8267433 macosx-aarch64,macosx-x64 +serviceability/sa/ClhsdbFindPC.java#xcomp-core 8269982,8267433 macosx-aarch64,macosx-x64 +serviceability/sa/ClhsdbFindPC.java#no-xcomp-core 8269982,8267433 macosx-aarch64,macosx-x64 +serviceability/sa/ClhsdbPmap.java#core 8267433 macosx-x64 +serviceability/sa/ClhsdbPstack.java#core 8269982,8267433 macosx-aarch64,macosx-x64 +serviceability/sa/TestJmapCore.java 8267433 macosx-x64 +serviceability/sa/TestJmapCoreMetaspace.java 8267433 macosx-x64 ############################################################################# -- GitLab From 29e552c03a2825f9526330072668a1d63ac68fd4 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 17 Nov 2021 22:21:38 +0000 Subject: [PATCH 369/890] 8272358: Some tests may fail when executed with other locales than the US Reviewed-by: aivanov --- test/langtools/jdk/jshell/ToolBasicTest.java | 4 ++-- test/langtools/jdk/jshell/ToolSimpleTest.java | 5 +++-- .../javac/lambda/lambdaExecution/LambdaTranslationTest1.java | 4 ++-- .../javac/lambda/lambdaExecution/LambdaTranslationTest2.java | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/langtools/jdk/jshell/ToolBasicTest.java b/test/langtools/jdk/jshell/ToolBasicTest.java index 8d8dfc8f9f4..a6bb7a075de 100644 --- a/test/langtools/jdk/jshell/ToolBasicTest.java +++ b/test/langtools/jdk/jshell/ToolBasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -553,7 +553,7 @@ public class ToolBasicTest extends ReplToolTesting { } public void testOpenResource() { - test( + test(new String[]{"-R", "-Duser.language=en", "-R", "-Duser.country=US"}, (a) -> assertCommand(a, "/open PRINTING", ""), (a) -> assertCommandOutputContains(a, "/list", "void println", "System.out.printf"), diff --git a/test/langtools/jdk/jshell/ToolSimpleTest.java b/test/langtools/jdk/jshell/ToolSimpleTest.java index 26a5402564e..6994e3b99f2 100644 --- a/test/langtools/jdk/jshell/ToolSimpleTest.java +++ b/test/langtools/jdk/jshell/ToolSimpleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -744,7 +744,8 @@ public class ToolSimpleTest extends ReplToolTesting { @Test public void testCompoundStart() { - test(new String[]{"--startup", "DEFAULT", "--startup", "PRINTING"}, + test(new String[]{"-R", "-Duser.language=en", "-R", "-Duser.country=US", + "--startup", "DEFAULT", "--startup", "PRINTING"}, (a) -> assertCommand(a, "printf(\"%4.2f\", Math.PI)", "", "", null, "3.14", "") ); diff --git a/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest1.java b/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest1.java index 37033fff8a1..b207fd1a7d5 100644 --- a/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest1.java +++ b/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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,7 +25,7 @@ * @test * @bug 8003639 * @summary convert lambda testng tests to jtreg and add them - * @run testng LambdaTranslationTest1 + * @run testng/othervm -Duser.language=en -Duser.country=US LambdaTranslationTest1 */ import org.testng.annotations.Test; diff --git a/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest2.java b/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest2.java index fc03a863036..e7e484730b2 100644 --- a/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest2.java +++ b/test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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,7 +25,7 @@ * @test * @bug 8003639 * @summary convert lambda testng tests to jtreg and add them - * @run testng LambdaTranslationTest2 + * @run testng/othervm -Duser.language=en -Duser.country=US LambdaTranslationTest2 */ import org.testng.annotations.Test; -- GitLab From 231fb61aaeae04787c06a4c972197943d9085627 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 18 Nov 2021 01:12:12 +0000 Subject: [PATCH 370/890] 8276970: Default charset for PrintWriter that wraps PrintStream Reviewed-by: rriggs, alanb --- .../classes/java/io/OutputStreamWriter.java | 6 +- .../share/classes/java/io/PrintStream.java | 19 +++- .../share/classes/java/io/PrintWriter.java | 10 +- .../io/PrintStream/InheritEncodingTest.java | 107 ++++++++++++++++++ 4 files changed, 133 insertions(+), 9 deletions(-) create mode 100644 test/jdk/java/io/PrintStream/InheritEncodingTest.java diff --git a/src/java.base/share/classes/java/io/OutputStreamWriter.java b/src/java.base/share/classes/java/io/OutputStreamWriter.java index f9acde201b7..43b0b10e46a 100644 --- a/src/java.base/share/classes/java/io/OutputStreamWriter.java +++ b/src/java.base/share/classes/java/io/OutputStreamWriter.java @@ -99,7 +99,9 @@ public class OutputStreamWriter extends Writer { } /** - * Creates an OutputStreamWriter that uses the default character encoding. + * Creates an OutputStreamWriter that uses the default character encoding, or + * where {@code out} is a {@code PrintStream}, the charset used by the print + * stream. * * @param out An OutputStream * @see Charset#defaultCharset() @@ -107,7 +109,7 @@ public class OutputStreamWriter extends Writer { public OutputStreamWriter(OutputStream out) { super(out); se = StreamEncoder.forOutputStreamWriter(out, this, - Charset.defaultCharset()); + out instanceof PrintStream ps ? ps.charset() : Charset.defaultCharset()); } /** diff --git a/src/java.base/share/classes/java/io/PrintStream.java b/src/java.base/share/classes/java/io/PrintStream.java index acf1a461282..0281ed66ca8 100644 --- a/src/java.base/share/classes/java/io/PrintStream.java +++ b/src/java.base/share/classes/java/io/PrintStream.java @@ -68,6 +68,7 @@ public class PrintStream extends FilterOutputStream private final boolean autoFlush; private boolean trouble = false; private Formatter formatter; + private final Charset charset; /** * Track both the text- and character-output streams, so that their buffers @@ -108,7 +109,8 @@ public class PrintStream extends FilterOutputStream private PrintStream(boolean autoFlush, OutputStream out) { super(out); this.autoFlush = autoFlush; - this.charOut = new OutputStreamWriter(this); + this.charset = out instanceof PrintStream ps ? ps.charset() : Charset.defaultCharset(); + this.charOut = new OutputStreamWriter(this, charset); this.textOut = new BufferedWriter(charOut); } @@ -124,7 +126,8 @@ public class PrintStream extends FilterOutputStream /** * Creates a new print stream, without automatic line flushing, with the * specified OutputStream. Characters written to the stream are converted - * to bytes using the default charset. + * to bytes using the default charset, or where {@code out} is a + * {@code PrintStream}, the charset used by the print stream. * * @param out The output stream to which values and objects will be * printed @@ -139,7 +142,8 @@ public class PrintStream extends FilterOutputStream /** * Creates a new print stream, with the specified OutputStream and line * flushing. Characters written to the stream are converted to bytes using - * the default charset. + * the default charset, or where {@code out} is a {@code PrintStream}, + * the charset used by the print stream. * * @param out The output stream to which values and objects will be * printed @@ -201,6 +205,7 @@ public class PrintStream extends FilterOutputStream this.autoFlush = autoFlush; this.charOut = new OutputStreamWriter(this, charset); this.textOut = new BufferedWriter(charOut); + this.charset = charset; } /** @@ -1374,4 +1379,12 @@ public class PrintStream extends FilterOutputStream return this; } + /** + * {@return the charset used in this {@code PrintStream} instance} + * + * @since 18 + */ + public Charset charset() { + return charset; + } } diff --git a/src/java.base/share/classes/java/io/PrintWriter.java b/src/java.base/share/classes/java/io/PrintWriter.java index 447769d7fb3..874a03cce3b 100644 --- a/src/java.base/share/classes/java/io/PrintWriter.java +++ b/src/java.base/share/classes/java/io/PrintWriter.java @@ -118,7 +118,8 @@ public class PrintWriter extends Writer { * Creates a new PrintWriter, without automatic line flushing, from an * existing OutputStream. This convenience constructor creates the * necessary intermediate OutputStreamWriter, which will convert characters - * into bytes using the default charset. + * into bytes using the default charset, or where {@code out} is a + * {@code PrintStream}, the charset used by the print stream. * * @param out An output stream * @@ -132,8 +133,9 @@ public class PrintWriter extends Writer { /** * Creates a new PrintWriter from an existing OutputStream. This * convenience constructor creates the necessary intermediate - * OutputStreamWriter, which will convert characters into bytes using the - * default charset. + * OutputStreamWriter, which will convert characters into bytes using + * the default charset, or where {@code out} is a {@code PrintStream}, + * the charset used by the print stream. * * @param out An output stream * @param autoFlush A boolean; if true, the {@code println}, @@ -144,7 +146,7 @@ public class PrintWriter extends Writer { * @see Charset#defaultCharset() */ public PrintWriter(OutputStream out, boolean autoFlush) { - this(out, autoFlush, Charset.defaultCharset()); + this(out, autoFlush, out instanceof PrintStream ps ? ps.charset() : Charset.defaultCharset()); } /** diff --git a/test/jdk/java/io/PrintStream/InheritEncodingTest.java b/test/jdk/java/io/PrintStream/InheritEncodingTest.java new file mode 100644 index 00000000000..e31404114a0 --- /dev/null +++ b/test/jdk/java/io/PrintStream/InheritEncodingTest.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021, 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 org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * @test + * @bug 8276970 + * @summary Test to verify the charset in PrintStream is inherited + * in the OutputStreamWriter/PrintWriter + * @run testng InheritEncodingTest + */ +@Test +public class InheritEncodingTest { + + private static final String testString = "\u00e9\u3042"; // "éあ" + + @DataProvider + public Object[][] encodings() { + return new Object[][]{ + {StandardCharsets.ISO_8859_1}, + {StandardCharsets.US_ASCII}, + {StandardCharsets.UTF_8}, + {StandardCharsets.UTF_16}, + {StandardCharsets.UTF_16BE}, + {StandardCharsets.UTF_16LE}, + }; + } + + @Test (dataProvider = "encodings") + public void testOutputStreamWriter(Charset stdCharset) throws IOException { + var ba = new ByteArrayOutputStream(); + var ps = new PrintStream(ba, true, stdCharset); + var expected = new String(testString.getBytes(stdCharset), stdCharset); + + // tests OutputStreamWriter's encoding explicitly + var osw = new OutputStreamWriter(ps); + assertEquals(Charset.forName(osw.getEncoding()), stdCharset); + + // tests roundtrip result + osw.write(testString); + osw.flush(); + var result = ba.toString(stdCharset); + assertEquals(result, expected); + } + + @Test (dataProvider = "encodings") + public void testPrintWriter(Charset stdCharset) throws IOException { + var ba = new ByteArrayOutputStream(); + var ps = new PrintStream(ba, true, stdCharset); + var expected = new String(testString.getBytes(stdCharset), stdCharset); + + // tests roundtrip result + var pw = new PrintWriter(ps); + pw.write(testString); + pw.flush(); + var result = ba.toString(stdCharset); + assertEquals(result, expected); + } + + @Test (dataProvider = "encodings") + public void testPrintStream(Charset stdCharset) throws IOException { + var ba = new ByteArrayOutputStream(); + var ps = new PrintStream(ba, true, stdCharset); + var expected = new String(testString.getBytes(stdCharset), stdCharset); + + // tests PrintStream's charset explicitly + var psWrapper = new PrintStream(ps); + assertEquals(psWrapper.charset(), stdCharset); + + // tests roundtrip result + psWrapper.print(testString); + psWrapper.flush(); + var result = ba.toString(stdCharset); + assertEquals(result, expected); + } +} -- GitLab From b8453ebdb471e08cc8d62c777f33ad52902f67d7 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 18 Nov 2021 01:13:26 +0000 Subject: [PATCH 371/890] 8275007: Java fails to start with null charset if LC_ALL is set to certain locales Reviewed-by: rriggs, iris, joehw, alanb --- .../share/classes/java/lang/System.java | 32 +++++-- src/java.base/share/native/libjava/jni_util.c | 92 ++++++++----------- 2 files changed, 61 insertions(+), 63 deletions(-) diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index 6d4137c7aa4..12a82813433 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -33,7 +33,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; -import java.io.UnsupportedEncodingException; import java.lang.annotation.Annotation; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; @@ -45,9 +44,9 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URI; import java.net.URL; -import java.nio.charset.CharacterCodingException; import java.nio.channels.Channel; import java.nio.channels.spi.SelectorProvider; +import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.security.AccessControlContext; import java.security.AccessController; @@ -84,6 +83,7 @@ import jdk.internal.vm.annotation.Stable; import sun.nio.fs.DefaultFileSystemProvider; import sun.reflect.annotation.AnnotationType; import sun.nio.ch.Interruptible; +import sun.nio.cs.UTF_8; import sun.security.util.SecurityConstants; /** @@ -188,6 +188,11 @@ public final class System { @SuppressWarnings("removal") private static volatile SecurityManager security; // read by VM + // `sun.jnu.encoding` if it is not supported. Otherwise null. + // It is initialized in `initPhase1()` before any charset providers + // are initialized. + private static String notSupportedJnuEncoding; + // return true if a security manager is allowed private static boolean allowSecurityManager() { return (allowSecurityManager != NEVER); @@ -2017,10 +2022,9 @@ public final class System { * Create PrintStream for stdout/err based on encoding. */ private static PrintStream newPrintStream(FileOutputStream fos, String enc) { - if (enc != null) { - try { - return new PrintStream(new BufferedOutputStream(fos, 128), true, enc); - } catch (UnsupportedEncodingException uee) {} + if (enc != null) { + return new PrintStream(new BufferedOutputStream(fos, 128), true, + Charset.forName(enc, UTF_8.INSTANCE)); } return new PrintStream(new BufferedOutputStream(fos, 128), true); } @@ -2113,6 +2117,13 @@ public final class System { VM.saveProperties(tempProps); props = createProperties(tempProps); + // Check if sun.jnu.encoding is supported. If not, replace it with UTF-8. + var jnuEncoding = props.getProperty("sun.jnu.encoding"); + if (jnuEncoding == null || !Charset.isSupported(jnuEncoding)) { + notSupportedJnuEncoding = jnuEncoding == null ? "null" : jnuEncoding; + props.setProperty("sun.jnu.encoding", "UTF-8"); + } + StaticProperty.javaHome(); // Load StaticProperty to cache the property values lineSeparator = props.getProperty("line.separator"); @@ -2141,7 +2152,6 @@ public final class System { Thread current = Thread.currentThread(); current.getThreadGroup().add(current); - // Subsystems that are invoked during initialization can invoke // VM.isBooted() in order to avoid doing things that should // wait until the VM is fully initialized. The initialization level @@ -2248,6 +2258,14 @@ public final class System { WARNING: The Security Manager is deprecated and will be removed in a future release"""); } + // Emit a warning if `sun.jnu.encoding` is not supported. + if (notSupportedJnuEncoding != null) { + System.err.println( + "WARNING: The encoding of the underlying platform's" + + " file system is not supported: " + + notSupportedJnuEncoding); + } + initialErrStream = System.err; // initializing the system class loader diff --git a/src/java.base/share/native/libjava/jni_util.c b/src/java.base/share/native/libjava/jni_util.c index 6ee8a4228c4..343805e90ac 100644 --- a/src/java.base/share/native/libjava/jni_util.c +++ b/src/java.base/share/native/libjava/jni_util.c @@ -639,21 +639,6 @@ static jmethodID String_getBytes_ID; /* String.getBytes(enc) */ static jfieldID String_coder_ID; /* String.coder */ static jfieldID String_value_ID; /* String.value */ -static jboolean isJNUEncodingSupported = JNI_FALSE; -static jboolean jnuEncodingSupported(JNIEnv *env) { - jboolean exe; - if (isJNUEncodingSupported == JNI_TRUE) { - return JNI_TRUE; - } - isJNUEncodingSupported = (jboolean) JNU_CallStaticMethodByName ( - env, &exe, - "java/nio/charset/Charset", - "isSupported", - "(Ljava/lang/String;)Z", - jnuEncoding).z; - return isJNUEncodingSupported; -} - /* Create a new string by converting str to a heap-allocated byte array and * calling the appropriate String constructor. */ @@ -671,22 +656,8 @@ newSizedStringJava(JNIEnv *env, const char *str, const int len) jclass strClazz = JNU_ClassString(env); CHECK_NULL_RETURN(strClazz, 0); (*env)->SetByteArrayRegion(env, bytes, 0, len, (jbyte *)str); - if (jnuEncodingSupported(env)) { - result = (*env)->NewObject(env, strClazz, - String_init_ID, bytes, jnuEncoding); - } else { - /*If the encoding specified in sun.jnu.encoding is not endorsed - by "Charset.isSupported" we have to fall back to use String(byte[]) - explicitly here without specifying the encoding name, in which the - StringCoding class will pickup the iso-8859-1 as the fallback - converter for us. - */ - jmethodID mid = (*env)->GetMethodID(env, strClazz, - "", "([B)V"); - if (mid != NULL) { - result = (*env)->NewObject(env, strClazz, mid, bytes); - } - } + result = (*env)->NewObject(env, strClazz, + String_init_ID, bytes, jnuEncoding); (*env)->DeleteLocalRef(env, bytes); return result; } @@ -766,11 +737,30 @@ InitializeEncoding(JNIEnv *env, const char *encname) strcmp(encname, "utf-16le") == 0) { fastEncoding = FAST_CP1252; } else { + jboolean exe; jstring enc = (*env)->NewStringUTF(env, encname); if (enc == NULL) return; - fastEncoding = NO_FAST_ENCODING; - jnuEncoding = (jstring)(*env)->NewGlobalRef(env, enc); + + if ((jboolean) JNU_CallStaticMethodByName ( + env, &exe, + "java/nio/charset/Charset", + "isSupported", + "(Ljava/lang/String;)Z", + enc).z == JNI_TRUE) { + fastEncoding = NO_FAST_ENCODING; + jnuEncoding = (jstring)(*env)->NewGlobalRef(env, enc); + } else { + // jnuEncoding falls back to UTF-8 + jstring utf8 = (*env)->NewStringUTF(env, "UTF-8"); + if (utf8 == NULL) { + (*env)->DeleteLocalRef(env, enc); + return; + } + fastEncoding = FAST_UTF_8; + jnuEncoding = (jstring)(*env)->NewGlobalRef(env, utf8); + (*env)->DeleteLocalRef(env, utf8); + } (*env)->DeleteLocalRef(env, enc); } } else { @@ -822,32 +812,22 @@ static const char* getStringBytes(JNIEnv *env, jstring jstr) { if ((*env)->EnsureLocalCapacity(env, 2) < 0) return 0; - if (jnuEncodingSupported(env)) { - hab = (*env)->CallObjectMethod(env, jstr, String_getBytes_ID, jnuEncoding); - } else { - jmethodID mid; - jclass strClazz = JNU_ClassString(env); - CHECK_NULL_RETURN(strClazz, 0); - mid = (*env)->GetMethodID(env, strClazz, - "getBytes", "()[B"); - if (mid != NULL) { - hab = (*env)->CallObjectMethod(env, jstr, mid); + hab = (*env)->CallObjectMethod(env, jstr, String_getBytes_ID, jnuEncoding); + if (hab != 0) { + if (!(*env)->ExceptionCheck(env)) { + jint len = (*env)->GetArrayLength(env, hab); + result = MALLOC_MIN4(len); + if (result == 0) { + JNU_ThrowOutOfMemoryError(env, 0); + (*env)->DeleteLocalRef(env, hab); + return 0; + } + (*env)->GetByteArrayRegion(env, hab, 0, len, (jbyte *)result); + result[len] = 0; /* NULL-terminate */ } - } - if (!(*env)->ExceptionCheck(env)) { - jint len = (*env)->GetArrayLength(env, hab); - result = MALLOC_MIN4(len); - if (result == 0) { - JNU_ThrowOutOfMemoryError(env, 0); - (*env)->DeleteLocalRef(env, hab); - return 0; - } - (*env)->GetByteArrayRegion(env, hab, 0, len, (jbyte *)result); - result[len] = 0; /* NULL-terminate */ + (*env)->DeleteLocalRef(env, hab); } - - (*env)->DeleteLocalRef(env, hab); return result; } -- GitLab From 81938001f9bae56c59f4e18b7756089f2cf0bf74 Mon Sep 17 00:00:00 2001 From: Fei Gao Date: Thu, 18 Nov 2021 02:41:27 +0000 Subject: [PATCH 372/890] 8274179: AArch64: Support SVE operations with encodable immediates Reviewed-by: aph, ngasson --- src/hotspot/cpu/aarch64/aarch64.ad | 100 +++++++- src/hotspot/cpu/aarch64/aarch64_sve.ad | 211 ++++++++++++++++ src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 | 54 +++++ src/hotspot/cpu/aarch64/assembler_aarch64.cpp | 53 +++- src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 46 ++++ test/hotspot/gtest/aarch64/aarch64-asmtest.py | 133 ++++++---- test/hotspot/gtest/aarch64/asmtest.out.h | 229 +++++++++++------- .../jtreg/compiler/codegen/TestByteVect.java | 190 ++++++++++++++- .../jtreg/compiler/codegen/TestCharVect.java | 144 ++++++++++- .../jtreg/compiler/codegen/TestIntVect.java | 153 +++++++++++- .../jtreg/compiler/codegen/TestLongVect.java | 130 +++++++++- .../jtreg/compiler/codegen/TestShortVect.java | 137 ++++++++++- 12 files changed, 1433 insertions(+), 147 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 612ed63751b..a1236d032e6 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2685,12 +2685,55 @@ bool size_fits_all_mem_uses(AddPNode* addp, int shift) { return true; } +bool can_combine_with_imm(Node* binary_node, Node* replicate_node) { + if (UseSVE == 0 || !VectorNode::is_invariant_vector(replicate_node)){ + return false; + } + Node* imm_node = replicate_node->in(1); + if (!imm_node->is_Con()) { + return false; + } + + const Type* t = imm_node->bottom_type(); + if (!(t->isa_int() || t->isa_long())) { + return false; + } + + switch (binary_node->Opcode()) { + case Op_AndV: + case Op_OrV: + case Op_XorV: { + Assembler::SIMD_RegVariant T = Assembler::elemType_to_regVariant(Matcher::vector_element_basic_type(binary_node)); + uint64_t value = t->isa_long() ? (uint64_t)imm_node->get_long() : (uint64_t)imm_node->get_int(); + return Assembler::operand_valid_for_sve_logical_immediate(Assembler::regVariant_to_elemBits(T), value); + } + case Op_AddVB: + return (imm_node->get_int() <= 255 && imm_node->get_int() >= -255); + case Op_AddVS: + case Op_AddVI: + return Assembler::operand_valid_for_sve_add_sub_immediate((int64_t)imm_node->get_int()); + case Op_AddVL: + return Assembler::operand_valid_for_sve_add_sub_immediate(imm_node->get_long()); + default: + return false; + } +} + +bool is_vector_arith_imm_pattern(Node* n, Node* m) { + if (n != NULL && m != NULL) { + return can_combine_with_imm(n, m); + } + return false; +} + // Should the matcher clone input 'm' of node 'n'? bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) { // ShiftV src (ShiftCntV con) // StoreVector (VectorStoreMask src) + // Binary src (Replicate con) if (is_vshift_con_pattern(n, m) || - (UseSVE > 0 && m->Opcode() == Op_VectorStoreMask && n->Opcode() == Op_StoreVector)) { + (UseSVE > 0 && m->Opcode() == Op_VectorStoreMask && n->Opcode() == Op_StoreVector) || + is_vector_arith_imm_pattern(n, m)) { mstack.push(m, Visit); return true; } @@ -4611,6 +4654,17 @@ operand immL8_shift8() interface(CONST_INTER); %} +// 8 bit integer valid for vector add sub immediate +operand immBAddSubV() +%{ + predicate(n->get_int() <= 255 && n->get_int() >= -255); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // 32 bit integer valid for add sub immediate operand immIAddSub() %{ @@ -4621,8 +4675,39 @@ operand immIAddSub() interface(CONST_INTER); %} +// 32 bit integer valid for vector add sub immediate +operand immIAddSubV() +%{ + predicate(Assembler::operand_valid_for_sve_add_sub_immediate((int64_t)n->get_int())); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // 32 bit unsigned integer valid for logical immediate -// TODO -- check this is right when e.g the mask is 0x80000000 + +operand immBLog() +%{ + predicate(Assembler::operand_valid_for_sve_logical_immediate(BitsPerByte, (uint64_t)n->get_int())); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + +operand immSLog() +%{ + predicate(Assembler::operand_valid_for_sve_logical_immediate(BitsPerShort, (uint64_t)n->get_int())); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + operand immILog() %{ predicate(Assembler::operand_valid_for_logical_immediate(/*is32*/true, (uint64_t)n->get_int())); @@ -4700,6 +4785,17 @@ operand immLAddSub() interface(CONST_INTER); %} +// 64 bit integer valid for addv subv immediate +operand immLAddSubV() +%{ + predicate(Assembler::operand_valid_for_sve_add_sub_immediate(n->get_long())); + match(ConL); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // 64 bit integer valid for logical immediate operand immLLog() %{ diff --git a/src/hotspot/cpu/aarch64/aarch64_sve.ad b/src/hotspot/cpu/aarch64/aarch64_sve.ad index 78c09b65708..8260459f223 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve.ad +++ b/src/hotspot/cpu/aarch64/aarch64_sve.ad @@ -935,6 +935,217 @@ instruct vaddD_masked(vReg dst_src1, vReg src2, pRegGov pg) %{ ins_pipe(pipe_slow); %} +// vector add reg imm (unpredicated) + +instruct vaddImmB(vReg dst_src, immBAddSubV con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AddVB dst_src (ReplicateB con))); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src, $dst_src, $con\t # vector (sve) (B)" %} + ins_encode %{ + int32_t val = $con$$constant; + if (val > 0){ + __ sve_add(as_FloatRegister($dst_src$$reg), __ B, val); + } else if (val < 0){ + __ sve_sub(as_FloatRegister($dst_src$$reg), __ B, -val); + } + %} + ins_pipe(pipe_slow); +%} + +instruct vaddImmS(vReg dst_src, immIAddSubV con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AddVS dst_src (ReplicateS con))); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src, $dst_src, $con\t # vector (sve) (H)" %} + ins_encode %{ + int32_t val = $con$$constant; + if (val > 0){ + __ sve_add(as_FloatRegister($dst_src$$reg), __ H, val); + } else if (val < 0){ + __ sve_sub(as_FloatRegister($dst_src$$reg), __ H, -val); + } + %} + ins_pipe(pipe_slow); +%} + +instruct vaddImmI(vReg dst_src, immIAddSubV con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AddVI dst_src (ReplicateI con))); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src, $dst_src, $con\t # vector (sve) (S)" %} + ins_encode %{ + int32_t val = $con$$constant; + if (val > 0){ + __ sve_add(as_FloatRegister($dst_src$$reg), __ S, val); + } else if (val < 0){ + __ sve_sub(as_FloatRegister($dst_src$$reg), __ S, -val); + } + %} + ins_pipe(pipe_slow); +%} + +instruct vaddImmL(vReg dst_src, immLAddSubV con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AddVL dst_src (ReplicateL con))); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src, $dst_src, $con\t # vector (sve) (D)" %} + ins_encode %{ + int32_t val = $con$$constant; + if (val > 0){ + __ sve_add(as_FloatRegister($dst_src$$reg), __ D, val); + } else if (val < 0){ + __ sve_sub(as_FloatRegister($dst_src$$reg), __ D, -val); + } + %} + ins_pipe(pipe_slow); +%} + +// vector binary op reg imm (unpredicated) + +instruct vandB(vReg dst_src, immBLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AndV dst_src (ReplicateB con))); + ins_cost(SVE_COST); + format %{ "sve_and $dst_src, $dst_src, $con\t # vector (sve) (B)" %} + ins_encode %{ + __ sve_and(as_FloatRegister($dst_src$$reg), __ B, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vandH(vReg dst_src, immSLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AndV dst_src (ReplicateS con))); + ins_cost(SVE_COST); + format %{ "sve_and $dst_src, $dst_src, $con\t # vector (sve) (H)" %} + ins_encode %{ + __ sve_and(as_FloatRegister($dst_src$$reg), __ H, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vandS(vReg dst_src, immILog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AndV dst_src (ReplicateI con))); + ins_cost(SVE_COST); + format %{ "sve_and $dst_src, $dst_src, $con\t # vector (sve) (S)" %} + ins_encode %{ + __ sve_and(as_FloatRegister($dst_src$$reg), __ S, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vandD(vReg dst_src, immLLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AndV dst_src (ReplicateL con))); + ins_cost(SVE_COST); + format %{ "sve_and $dst_src, $dst_src, $con\t # vector (sve) (D)" %} + ins_encode %{ + __ sve_and(as_FloatRegister($dst_src$$reg), __ D, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vorB(vReg dst_src, immBLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (OrV dst_src (ReplicateB con))); + ins_cost(SVE_COST); + format %{ "sve_orr $dst_src, $dst_src, $con\t # vector (sve) (B)" %} + ins_encode %{ + __ sve_orr(as_FloatRegister($dst_src$$reg), __ B, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vorH(vReg dst_src, immSLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (OrV dst_src (ReplicateS con))); + ins_cost(SVE_COST); + format %{ "sve_orr $dst_src, $dst_src, $con\t # vector (sve) (H)" %} + ins_encode %{ + __ sve_orr(as_FloatRegister($dst_src$$reg), __ H, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vorS(vReg dst_src, immILog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (OrV dst_src (ReplicateI con))); + ins_cost(SVE_COST); + format %{ "sve_orr $dst_src, $dst_src, $con\t # vector (sve) (S)" %} + ins_encode %{ + __ sve_orr(as_FloatRegister($dst_src$$reg), __ S, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vorD(vReg dst_src, immLLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (OrV dst_src (ReplicateL con))); + ins_cost(SVE_COST); + format %{ "sve_orr $dst_src, $dst_src, $con\t # vector (sve) (D)" %} + ins_encode %{ + __ sve_orr(as_FloatRegister($dst_src$$reg), __ D, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vxorB(vReg dst_src, immBLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (XorV dst_src (ReplicateB con))); + ins_cost(SVE_COST); + format %{ "sve_eor $dst_src, $dst_src, $con\t # vector (sve) (B)" %} + ins_encode %{ + __ sve_eor(as_FloatRegister($dst_src$$reg), __ B, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vxorH(vReg dst_src, immSLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (XorV dst_src (ReplicateS con))); + ins_cost(SVE_COST); + format %{ "sve_eor $dst_src, $dst_src, $con\t # vector (sve) (H)" %} + ins_encode %{ + __ sve_eor(as_FloatRegister($dst_src$$reg), __ H, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vxorS(vReg dst_src, immILog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (XorV dst_src (ReplicateI con))); + ins_cost(SVE_COST); + format %{ "sve_eor $dst_src, $dst_src, $con\t # vector (sve) (S)" %} + ins_encode %{ + __ sve_eor(as_FloatRegister($dst_src$$reg), __ S, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} + +instruct vxorD(vReg dst_src, immLLog con) %{ + predicate(UseSVE > 0); + match(Set dst_src (XorV dst_src (ReplicateL con))); + ins_cost(SVE_COST); + format %{ "sve_eor $dst_src, $dst_src, $con\t # vector (sve) (D)" %} + ins_encode %{ + __ sve_eor(as_FloatRegister($dst_src$$reg), __ D, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%} // vector and instruct vand(vReg dst, vReg src1, vReg src2) %{ diff --git a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 index 91a7a8b21d5..7589735365e 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 @@ -603,7 +603,61 @@ BINARY_OP_PREDICATE(vaddI, AddVI, S, sve_add) BINARY_OP_PREDICATE(vaddL, AddVL, D, sve_add) BINARY_OP_PREDICATE(vaddF, AddVF, S, sve_fadd) BINARY_OP_PREDICATE(vaddD, AddVD, D, sve_fadd) +dnl +dnl ADD_IMM($1, $2, $3 ) +dnl ADD_IMM(name_suffix, size, imm_type) +define(`ADD_IMM', ` +instruct vaddImm$1(vReg dst_src, $3 con) %{ + predicate(UseSVE > 0); + match(Set dst_src (AddV$1 dst_src (Replicate$1 con))); + ins_cost(SVE_COST); + format %{ "sve_add $dst_src, $dst_src, $con\t # vector (sve) ($2)" %} + ins_encode %{ + int32_t val = $con$$constant; + if (val > 0){ + __ sve_add(as_FloatRegister($dst_src$$reg), __ $2, val); + } else if (val < 0){ + __ sve_sub(as_FloatRegister($dst_src$$reg), __ $2, -val); + } + %} + ins_pipe(pipe_slow); +%}')dnl +// vector add reg imm (unpredicated) +ADD_IMM(B, B, immBAddSubV) +ADD_IMM(S, H, immIAddSubV) +ADD_IMM(I, S, immIAddSubV) +ADD_IMM(L, D, immLAddSubV) +dnl +dnl BITWISE_OP_IMM($1, $2 $3, $4 $5 ) +dnl BITWISE_OP_IMM(insn_name, op_name1, size, type, op_name2) +define(`BITWISE_OP_IMM', ` +instruct $1(vReg dst_src, imm$4Log con) %{ + predicate(UseSVE > 0); + match(Set dst_src ($2 dst_src (Replicate$4 con))); + ins_cost(SVE_COST); + format %{ "$5 $dst_src, $dst_src, $con\t # vector (sve) ($3)" %} + ins_encode %{ + __ $5(as_FloatRegister($dst_src$$reg), __ $3, + (uint64_t)($con$$constant)); + %} + ins_pipe(pipe_slow); +%}')dnl + +// vector binary op reg imm (unpredicated) +BITWISE_OP_IMM(vandB, AndV, B, B, sve_and) +BITWISE_OP_IMM(vandH, AndV, H, S, sve_and) +BITWISE_OP_IMM(vandS, AndV, S, I, sve_and) +BITWISE_OP_IMM(vandD, AndV, D, L, sve_and) +BITWISE_OP_IMM(vorB, OrV, B, B, sve_orr) +BITWISE_OP_IMM(vorH, OrV, H, S, sve_orr) +BITWISE_OP_IMM(vorS, OrV, S, I, sve_orr) +BITWISE_OP_IMM(vorD, OrV, D, L, sve_orr) +BITWISE_OP_IMM(vxorB, XorV, B, B, sve_eor) +BITWISE_OP_IMM(vxorH, XorV, H, S, sve_eor) +BITWISE_OP_IMM(vxorS, XorV, S, I, sve_eor) +BITWISE_OP_IMM(vxorD, XorV, D, L, sve_eor) +dnl dnl dnl BINARY_OP_UNSIZED($1, $2, $3 ) dnl BINARY_OP_UNSIZED(insn_name, op_name, insn) diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp index 4e883838a66..943ca002c7a 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.cpp @@ -82,6 +82,11 @@ Assembler::SIMD_RegVariant Assembler::elemType_to_regVariant(BasicType bt) { return elemBytes_to_regVariant(type2aelembytes(bt)); } +unsigned Assembler::regVariant_to_elemBits(Assembler::SIMD_RegVariant T){ + guarantee(T != Q, "Invalid register variant"); + return 1 << (T + 3); +} + void Assembler::emit_data64(jlong data, relocInfo::relocType rtype, int format) { @@ -339,21 +344,21 @@ void Assembler::wrap_label(Label &L, prfop op, prefetch_insn insn) { } bool Assembler::operand_valid_for_add_sub_immediate(int64_t imm) { - bool shift = false; - uint64_t uimm = (uint64_t)uabs((jlong)imm); - if (uimm < (1 << 12)) - return true; - if (uimm < (1 << 24) - && ((uimm >> 12) << 12 == uimm)) { - return true; - } - return false; + return operand_valid_for_immediate_bits(imm, 12); +} + +bool Assembler::operand_valid_for_sve_add_sub_immediate(int64_t imm) { + return operand_valid_for_immediate_bits(imm, 8); } bool Assembler::operand_valid_for_logical_immediate(bool is32, uint64_t imm) { return encode_logical_immediate(is32, imm) != 0xffffffff; } +bool Assembler::operand_valid_for_sve_logical_immediate(unsigned elembits, uint64_t imm) { + return encode_sve_logical_immediate(elembits, imm) != 0xffffffff; +} + static uint64_t doubleTo64Bits(jdouble d) { union { jdouble double_value; @@ -383,6 +388,17 @@ int AbstractAssembler::code_fill_byte() { // n.b. this is implemented in subclass MacroAssembler void Assembler::bang_stack_with_offset(int offset) { Unimplemented(); } +bool asm_util::operand_valid_for_immediate_bits(int64_t imm, unsigned nbits) { + guarantee(nbits == 8 || nbits == 12, "invalid nbits value"); + uint64_t uimm = (uint64_t)uabs((jlong)imm); + if (uimm < (UCONST64(1) << nbits)) + return true; + if (uimm < (UCONST64(1) << (2 * nbits)) + && ((uimm >> nbits) << nbits == uimm)) { + return true; + } + return false; +} // and now the routines called by the assembler which encapsulate the // above encode and decode functions @@ -403,6 +419,25 @@ asm_util::encode_logical_immediate(bool is32, uint64_t imm) return encoding_for_logical_immediate(imm); } +uint32_t +asm_util::encode_sve_logical_immediate(unsigned elembits, uint64_t imm) { + guarantee(elembits == 8 || elembits == 16 || + elembits == 32 || elembits == 64, "unsupported element size"); + uint64_t upper = UCONST64(-1) << (elembits/2) << (elembits/2); + /* Allow all zeros or all ones in top bits, so that + * constant expressions like ~1 are permitted. */ + if ((imm & ~upper) != imm && (imm | upper) != imm) + return 0xffffffff; + + // Replicate the immediate in different element sizes to 64 bits. + imm &= ~upper; + for (unsigned i = elembits; i < 64; i *= 2) { + imm |= (imm << i); + } + + return encoding_for_logical_immediate(imm); +} + unsigned Assembler::pack(double value) { float val = (float)value; unsigned result = encoding_for_fp_immediate(val); diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 9858eccb8a7..9eee231ec0f 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -159,6 +159,8 @@ REGISTER_DECLARATION(PRegister, ptrue, p7); namespace asm_util { uint32_t encode_logical_immediate(bool is32, uint64_t imm); + uint32_t encode_sve_logical_immediate(unsigned elembits, uint64_t imm); + bool operand_valid_for_immediate_bits(int64_t imm, unsigned nbits); }; using namespace asm_util; @@ -1516,6 +1518,8 @@ public: static SIMD_Arrangement esize2arrangement(unsigned esize, bool isQ); static SIMD_RegVariant elemType_to_regVariant(BasicType bt); static SIMD_RegVariant elemBytes_to_regVariant(unsigned esize); + // Return the corresponding bits for different SIMD_RegVariant value. + static unsigned regVariant_to_elemBits(SIMD_RegVariant T); enum shift_kind { LSL, LSR, ASR, ROR }; @@ -2953,6 +2957,32 @@ public: INSN(sve_sub, 0b001); #undef INSN +// SVE integer add/subtract immediate (unpredicated) +#define INSN(NAME, op) \ + void NAME(FloatRegister Zd, SIMD_RegVariant T, unsigned imm8) { \ + starti; \ + /* The immediate is an unsigned value in the range 0 to 255, and \ + * for element width of 16 bits or higher it may also be a \ + * positive multiple of 256 in the range 256 to 65280. \ + */ \ + assert(T != Q, "invalid size"); \ + int sh = 0; \ + if (imm8 <= 0xff) { \ + sh = 0; \ + } else if (T != B && imm8 <= 0xff00 && (imm8 & 0xff) == 0) { \ + sh = 1; \ + imm8 = (imm8 >> 8); \ + } else { \ + guarantee(false, "invalid immediate"); \ + } \ + f(0b00100101, 31, 24), f(T, 23, 22), f(0b10000, 21, 17); \ + f(op, 16, 14), f(sh, 13), f(imm8, 12, 5), rf(Zd, 0); \ + } + + INSN(sve_add, 0b011); + INSN(sve_sub, 0b111); +#undef INSN + // SVE floating-point arithmetic - unpredicated #define INSN(NAME, opcode) \ void NAME(FloatRegister Zd, SIMD_RegVariant T, FloatRegister Zn, FloatRegister Zm) { \ @@ -3090,6 +3120,20 @@ public: INSN(sve_bic, 0b11); #undef INSN +// SVE bitwise logical with immediate (unpredicated) +#define INSN(NAME, opc) \ + void NAME(FloatRegister Zd, SIMD_RegVariant T, uint64_t imm) { \ + starti; \ + unsigned elembits = regVariant_to_elemBits(T); \ + uint32_t val = encode_sve_logical_immediate(elembits, imm); \ + f(0b00000101, 31, 24), f(opc, 23, 22), f(0b0000, 21, 18); \ + f(val, 17, 5), rf(Zd, 0); \ + } + INSN(sve_and, 0b10); + INSN(sve_eor, 0b01); + INSN(sve_orr, 0b00); +#undef INSN + // SVE shift immediate - unpredicated #define INSN(NAME, opc, isSHR) \ void NAME(FloatRegister Zd, SIMD_RegVariant T, FloatRegister Zn, int shift) { \ @@ -3639,7 +3683,9 @@ void sve_cmp(Condition cond, PRegister Pd, SIMD_RegVariant T, virtual void bang_stack_with_offset(int offset); static bool operand_valid_for_logical_immediate(bool is32, uint64_t imm); + static bool operand_valid_for_sve_logical_immediate(unsigned elembits, uint64_t imm); static bool operand_valid_for_add_sub_immediate(int64_t imm); + static bool operand_valid_for_sve_add_sub_immediate(int64_t imm); static bool operand_valid_for_float_immediate(double imm); void emit_data64(jlong data, relocInfo::relocType rtype, int format = 0); diff --git a/test/hotspot/gtest/aarch64/aarch64-asmtest.py b/test/hotspot/gtest/aarch64/aarch64-asmtest.py index a7df17b2129..e79afecd3dc 100644 --- a/test/hotspot/gtest/aarch64/aarch64-asmtest.py +++ b/test/hotspot/gtest/aarch64/aarch64-asmtest.py @@ -7,6 +7,55 @@ AARCH64_AS = "as" AARCH64_OBJDUMP = "objdump" AARCH64_OBJCOPY = "objcopy" +# These tables are legal immediate logical operands +immediates8 \ + = [0x1, 0x0c, 0x3e, 0x60, 0x7c, 0x80, 0x83, + 0xe1, 0xbf, 0xef, 0xf3, 0xfe] + +immediates16 \ + = [0x1, 0x38, 0x7e, 0xff, 0x1fc, 0x1ff, 0x3f0, + 0x7e0, 0xfc0, 0x1f80, 0x3ff0, 0x7e00, 0x7e00, + 0x8000, 0x81ff, 0xc1ff, 0xc003, 0xc7ff, 0xdfff, + 0xe03f, 0xe10f, 0xe1ff, 0xf801, 0xfc00, 0xfc07, + 0xff03, 0xfffe] + +immediates32 \ + = [0x1, 0x3f, 0x1f0, 0x7e0, + 0x1c00, 0x3ff0, 0x8000, 0x1e000, + 0x3e000, 0x78000, 0xe0000, 0x100000, + 0x1fffe0, 0x3fe000, 0x780000, 0x7ffff8, + 0xff8000, 0x1800180, 0x1fffc00, 0x3c003c0, + 0x3ffff00, 0x7c00000, 0x7fffe00, 0xf000f00, + 0xfffe000, 0x18181818, 0x1ffc0000, 0x1ffffffe, + 0x3f003f00, 0x3fffe000, 0x60006000, 0x7f807f80, + 0x7ffffc00, 0x800001ff, 0x803fffff, 0x9f9f9f9f, + 0xc0000fff, 0xc0c0c0c0, 0xe0000000, 0xe003e003, + 0xe3ffffff, 0xf0000fff, 0xf0f0f0f0, 0xf80000ff, + 0xf83ff83f, 0xfc00007f, 0xfc1fffff, 0xfe0001ff, + 0xfe3fffff, 0xff003fff, 0xff800003, 0xff87ff87, + 0xffc00fff, 0xffe0000f, 0xffefffef, 0xfff1fff1, + 0xfff83fff, 0xfffc0fff, 0xfffe0fff, 0xffff3fff, + 0xffffc007, 0xffffe1ff, 0xfffff80f, 0xfffffe07, + 0xffffffbf, 0xfffffffd] + +immediates64 \ + = [0x1, 0x1f80, 0x3fff0, 0x3ffffc, + 0x3fe0000, 0x1ffc0000, 0xf8000000, 0x3ffffc000, + 0xffffffe00, 0x3ffffff800, 0xffffc00000, 0x3f000000000, + 0x7fffffff800, 0x1fe000001fe0, 0x3ffffff80000, 0xc00000000000, + 0x1ffc000000000, 0x3ffff0003ffff, 0x7ffffffe00000, 0xfffffffffc000, + 0x1ffffffffffc00, 0x3fffffffffff00, 0x7ffffffffffc00, 0xffffffffff8000, + 0x1ffffffff800000, 0x3fffffc03fffffc, 0x7fffc0000000000, 0xff80ff80ff80ff8, + 0x1c00000000000000, 0x1fffffffffff0000, 0x3fffff803fffff80, 0x7fc000007fc00000, + 0x8000000000000000, 0x803fffff803fffff, 0xc000007fc000007f, 0xe00000000000ffff, + 0xe3ffffffffffffff, 0xf007f007f007f007, 0xf80003ffffffffff, 0xfc000003fc000003, + 0xfe000000007fffff, 0xff00000000007fff, 0xff800000000003ff, 0xffc00000000000ff, + 0xffe00000000003ff, 0xfff0000000003fff, 0xfff80000001fffff, 0xfffc0000fffc0000, + 0xfffe003fffffffff, 0xffff3fffffffffff, 0xffffc0000007ffff, 0xffffe01fffffe01f, + 0xfffff800000007ff, 0xfffffc0fffffffff, 0xffffff00003fffff, 0xffffffc0000007ff, + 0xfffffff0000001ff, 0xfffffffc00003fff, 0xffffffff07ffffff, 0xffffffffe003ffff, + 0xfffffffffc01ffff, 0xffffffffffc00003, 0xfffffffffffc000f, 0xffffffffffffe07f] + class Operand(object): def generate(self): @@ -351,51 +400,12 @@ class AddSubImmOp(TwoRegImmedInstruction): return super(AddSubImmOp, self).cstr() + ");" class LogicalImmOp(AddSubImmOp): - - # These tables are legal immediate logical operands - immediates32 \ - = [0x1, 0x3f, 0x1f0, 0x7e0, - 0x1c00, 0x3ff0, 0x8000, 0x1e000, - 0x3e000, 0x78000, 0xe0000, 0x100000, - 0x1fffe0, 0x3fe000, 0x780000, 0x7ffff8, - 0xff8000, 0x1800180, 0x1fffc00, 0x3c003c0, - 0x3ffff00, 0x7c00000, 0x7fffe00, 0xf000f00, - 0xfffe000, 0x18181818, 0x1ffc0000, 0x1ffffffe, - 0x3f003f00, 0x3fffe000, 0x60006000, 0x7f807f80, - 0x7ffffc00, 0x800001ff, 0x803fffff, 0x9f9f9f9f, - 0xc0000fff, 0xc0c0c0c0, 0xe0000000, 0xe003e003, - 0xe3ffffff, 0xf0000fff, 0xf0f0f0f0, 0xf80000ff, - 0xf83ff83f, 0xfc00007f, 0xfc1fffff, 0xfe0001ff, - 0xfe3fffff, 0xff003fff, 0xff800003, 0xff87ff87, - 0xffc00fff, 0xffe0000f, 0xffefffef, 0xfff1fff1, - 0xfff83fff, 0xfffc0fff, 0xfffe0fff, 0xffff3fff, - 0xffffc007, 0xffffe1ff, 0xfffff80f, 0xfffffe07, - 0xffffffbf, 0xfffffffd] - - immediates \ - = [0x1, 0x1f80, 0x3fff0, 0x3ffffc, - 0x3fe0000, 0x1ffc0000, 0xf8000000, 0x3ffffc000, - 0xffffffe00, 0x3ffffff800, 0xffffc00000, 0x3f000000000, - 0x7fffffff800, 0x1fe000001fe0, 0x3ffffff80000, 0xc00000000000, - 0x1ffc000000000, 0x3ffff0003ffff, 0x7ffffffe00000, 0xfffffffffc000, - 0x1ffffffffffc00, 0x3fffffffffff00, 0x7ffffffffffc00, 0xffffffffff8000, - 0x1ffffffff800000, 0x3fffffc03fffffc, 0x7fffc0000000000, 0xff80ff80ff80ff8, - 0x1c00000000000000, 0x1fffffffffff0000, 0x3fffff803fffff80, 0x7fc000007fc00000, - 0x8000000000000000, 0x803fffff803fffff, 0xc000007fc000007f, 0xe00000000000ffff, - 0xe3ffffffffffffff, 0xf007f007f007f007, 0xf80003ffffffffff, 0xfc000003fc000003, - 0xfe000000007fffff, 0xff00000000007fff, 0xff800000000003ff, 0xffc00000000000ff, - 0xffe00000000003ff, 0xfff0000000003fff, 0xfff80000001fffff, 0xfffc0000fffc0000, - 0xfffe003fffffffff, 0xffff3fffffffffff, 0xffffc0000007ffff, 0xffffe01fffffe01f, - 0xfffff800000007ff, 0xfffffc0fffffffff, 0xffffff00003fffff, 0xffffffc0000007ff, - 0xfffffff0000001ff, 0xfffffffc00003fff, 0xffffffff07ffffff, 0xffffffffe003ffff, - 0xfffffffffc01ffff, 0xffffffffffc00003, 0xfffffffffffc000f, 0xffffffffffffe07f] - def generate(self): AddSubImmOp.generate(self) self.immed = \ - self.immediates32[random.randint(0, len(self.immediates32)-1)] \ + immediates32[random.randint(0, len(immediates32)-1)] \ if self.isWord else \ - self.immediates[random.randint(0, len(self.immediates)-1)] + immediates64[random.randint(0, len(immediates64)-1)] return self @@ -406,6 +416,44 @@ class LogicalImmOp(AddSubImmOp): def cstr(self): return super(AddSubImmOp, self).cstr() + "ll);" +class SVEBinaryImmOp(Instruction): + def __init__(self, name): + reg = SVEVectorRegister().generate() + self.reg = [reg, reg] + self.numRegs = len(self.reg) + self._width = RegVariant(0, 3) + self._isLogical = False + if name in ["and", "eor", "orr"]: + self._isLogical = True + Instruction.__init__(self, name) + + def generate(self): + Instruction.generate(self) + self.immed = random.randint(0, (1<<8)-1) + if self._isLogical: + vectype = self._width.cstr() + if vectype == "__ B": + self.immed = immediates8[random.randint(0, len(immediates8)-1)] + elif vectype == "__ H": + self.immed = immediates16[random.randint(0, len(immediates16)-1)] + elif vectype == "__ S": + self.immed = immediates32[random.randint(0, len(immediates32)-1)] + elif vectype == "__ D": + self.immed = immediates64[random.randint(0, len(immediates64)-1)] + return self + + def cstr(self): + formatStr = "%s%s, %s, %su);" + return (formatStr + % tuple(["__ sve_" + self._name + "("] + + [str(self.reg[0]), self._width.cstr(), self.immed])) + + def astr(self): + formatStr = "%s%s, %s, #0x%x" + Regs = [str(self.reg[i]) + self._width.astr() for i in range(0, self.numRegs)] + return (formatStr + % tuple([Instruction.astr(self)] + Regs + [self.immed])) + class MultiOp(): def multipleForms(self): @@ -1719,6 +1767,9 @@ generate(SHA3SIMDOp, ["bcax", "eor3", "rax1", "xar"]) generate(SHA512SIMDOp, ["sha512h", "sha512h2", "sha512su0", "sha512su1"]) +for i in range(6): + generate(SVEBinaryImmOp, ["add", "sub", "and", "eor", "orr"]) + generate(SVEVectorOp, [["add", "ZZZ"], ["sub", "ZZZ"], ["fadd", "ZZZ"], diff --git a/test/hotspot/gtest/aarch64/asmtest.out.h b/test/hotspot/gtest/aarch64/asmtest.out.h index 85aca7268f4..8bbbdc579f5 100644 --- a/test/hotspot/gtest/aarch64/asmtest.out.h +++ b/test/hotspot/gtest/aarch64/asmtest.out.h @@ -1013,63 +1013,105 @@ __ sha512su0(v26, __ T2D, v26); // sha512su0 v26.2D, v26.2D __ sha512su1(v24, __ T2D, v22, v0); // sha512su1 v24.2D, v22.2D, v0.2D +// SVEBinaryImmOp + __ sve_add(z4, __ B, 147u); // add z4.b, z4.b, #0x93 + __ sve_sub(z0, __ B, 124u); // sub z0.b, z0.b, #0x7c + __ sve_and(z1, __ H, 508u); // and z1.h, z1.h, #0x1fc + __ sve_eor(z9, __ D, 18374686479671656447u); // eor z9.d, z9.d, #0xff00000000007fff + __ sve_orr(z22, __ S, 251662080u); // orr z22.s, z22.s, #0xf000f00 + +// SVEBinaryImmOp + __ sve_add(z8, __ S, 248u); // add z8.s, z8.s, #0xf8 + __ sve_sub(z6, __ S, 16u); // sub z6.s, z6.s, #0x10 + __ sve_and(z11, __ D, 4160749568u); // and z11.d, z11.d, #0xf8000000 + __ sve_eor(z26, __ S, 1610637312u); // eor z26.s, z26.s, #0x60006000 + __ sve_orr(z13, __ D, 18446181398634037247u); // orr z13.d, z13.d, #0xfffe003fffffffff + +// SVEBinaryImmOp + __ sve_add(z5, __ B, 112u); // add z5.b, z5.b, #0x70 + __ sve_sub(z10, __ S, 88u); // sub z10.s, z10.s, #0x58 + __ sve_and(z26, __ S, 253952u); // and z26.s, z26.s, #0x3e000 + __ sve_eor(z22, __ S, 496u); // eor z22.s, z22.s, #0x1f0 + __ sve_orr(z19, __ S, 536870910u); // orr z19.s, z19.s, #0x1ffffffe + +// SVEBinaryImmOp + __ sve_add(z14, __ H, 22u); // add z14.h, z14.h, #0x16 + __ sve_sub(z16, __ B, 172u); // sub z16.b, z16.b, #0xac + __ sve_and(z23, __ B, 62u); // and z23.b, z23.b, #0x3e + __ sve_eor(z17, __ H, 33279u); // eor z17.h, z17.h, #0x81ff + __ sve_orr(z16, __ B, 254u); // orr z16.b, z16.b, #0xfe + +// SVEBinaryImmOp + __ sve_add(z3, __ B, 49u); // add z3.b, z3.b, #0x31 + __ sve_sub(z17, __ S, 110u); // sub z17.s, z17.s, #0x6e + __ sve_and(z12, __ S, 4290777087u); // and z12.s, z12.s, #0xffc00fff + __ sve_eor(z19, __ S, 134217216u); // eor z19.s, z19.s, #0x7fffe00 + __ sve_orr(z23, __ B, 254u); // orr z23.b, z23.b, #0xfe + +// SVEBinaryImmOp + __ sve_add(z13, __ S, 54u); // add z13.s, z13.s, #0x36 + __ sve_sub(z0, __ B, 120u); // sub z0.b, z0.b, #0x78 + __ sve_and(z17, __ D, 18014398509481728u); // and z17.d, z17.d, #0x3fffffffffff00 + __ sve_eor(z22, __ S, 4294709247u); // eor z22.s, z22.s, #0xfffc0fff + __ sve_orr(z2, __ B, 225u); // orr z2.b, z2.b, #0xe1 + // SVEVectorOp - __ sve_add(z4, __ B, z6, z17); // add z4.b, z6.b, z17.b - __ sve_sub(z3, __ H, z15, z1); // sub z3.h, z15.h, z1.h - __ sve_fadd(z6, __ D, z5, z9); // fadd z6.d, z5.d, z9.d - __ sve_fmul(z7, __ D, z20, z22); // fmul z7.d, z20.d, z22.d - __ sve_fsub(z5, __ D, z10, z8); // fsub z5.d, z10.d, z8.d - __ sve_abs(z30, __ B, p1, z17); // abs z30.b, p1/m, z17.b - __ sve_add(z11, __ B, p7, z28); // add z11.b, p7/m, z11.b, z28.b - __ sve_and(z26, __ H, p5, z28); // and z26.h, p5/m, z26.h, z28.h - __ sve_asr(z13, __ D, p7, z16); // asr z13.d, p7/m, z13.d, z16.d - __ sve_cnt(z5, __ H, p0, z13); // cnt z5.h, p0/m, z13.h - __ sve_eor(z15, __ S, p2, z26); // eor z15.s, p2/m, z15.s, z26.s - __ sve_lsl(z11, __ S, p1, z22); // lsl z11.s, p1/m, z11.s, z22.s - __ sve_lsr(z4, __ S, p0, z19); // lsr z4.s, p0/m, z4.s, z19.s - __ sve_mul(z17, __ H, p3, z14); // mul z17.h, p3/m, z17.h, z14.h - __ sve_neg(z2, __ S, p4, z3); // neg z2.s, p4/m, z3.s - __ sve_not(z23, __ B, p1, z6); // not z23.b, p1/m, z6.b - __ sve_orr(z17, __ S, p3, z27); // orr z17.s, p3/m, z17.s, z27.s - __ sve_smax(z16, __ D, p1, z2); // smax z16.d, p1/m, z16.d, z2.d - __ sve_smin(z3, __ S, p1, z6); // smin z3.s, p1/m, z3.s, z6.s - __ sve_sub(z19, __ S, p3, z12); // sub z19.s, p3/m, z19.s, z12.s - __ sve_fabs(z8, __ D, p6, z19); // fabs z8.d, p6/m, z19.d - __ sve_fadd(z0, __ S, p2, z23); // fadd z0.s, p2/m, z0.s, z23.s - __ sve_fdiv(z19, __ D, p7, z13); // fdiv z19.d, p7/m, z19.d, z13.d - __ sve_fmax(z6, __ S, p0, z7); // fmax z6.s, p0/m, z6.s, z7.s - __ sve_fmin(z17, __ S, p6, z8); // fmin z17.s, p6/m, z17.s, z8.s - __ sve_fmul(z22, __ D, p5, z22); // fmul z22.d, p5/m, z22.d, z22.d - __ sve_fneg(z2, __ D, p0, z15); // fneg z2.d, p0/m, z15.d - __ sve_frintm(z20, __ D, p1, z4); // frintm z20.d, p1/m, z4.d - __ sve_frintn(z7, __ D, p0, z8); // frintn z7.d, p0/m, z8.d - __ sve_frintp(z19, __ D, p5, z4); // frintp z19.d, p5/m, z4.d - __ sve_fsqrt(z9, __ D, p5, z11); // fsqrt z9.d, p5/m, z11.d - __ sve_fsub(z5, __ S, p7, z16); // fsub z5.s, p7/m, z5.s, z16.s - __ sve_fmad(z22, __ S, p3, z1, z13); // fmad z22.s, p3/m, z1.s, z13.s - __ sve_fmla(z20, __ S, p4, z25, z15); // fmla z20.s, p4/m, z25.s, z15.s - __ sve_fmls(z4, __ D, p4, z8, z6); // fmls z4.d, p4/m, z8.d, z6.d - __ sve_fnmla(z4, __ D, p7, z16, z29); // fnmla z4.d, p7/m, z16.d, z29.d - __ sve_fnmls(z9, __ D, p3, z2, z11); // fnmls z9.d, p3/m, z2.d, z11.d - __ sve_mla(z3, __ S, p1, z1, z26); // mla z3.s, p1/m, z1.s, z26.s - __ sve_mls(z17, __ S, p3, z8, z17); // mls z17.s, p3/m, z8.s, z17.s - __ sve_and(z24, z5, z19); // and z24.d, z5.d, z19.d - __ sve_eor(z17, z22, z16); // eor z17.d, z22.d, z16.d - __ sve_orr(z20, z19, z0); // orr z20.d, z19.d, z0.d - __ sve_bic(z17, z23, z4); // bic z17.d, z23.d, z4.d - __ sve_uzp1(z4, __ S, z23, z25); // uzp1 z4.s, z23.s, z25.s - __ sve_uzp2(z2, __ H, z8, z8); // uzp2 z2.h, z8.h, z8.h + __ sve_add(z20, __ D, z7, z4); // add z20.d, z7.d, z4.d + __ sve_sub(z7, __ S, z0, z8); // sub z7.s, z0.s, z8.s + __ sve_fadd(z19, __ D, z22, z4); // fadd z19.d, z22.d, z4.d + __ sve_fmul(z9, __ D, z22, z11); // fmul z9.d, z22.d, z11.d + __ sve_fsub(z5, __ S, z30, z16); // fsub z5.s, z30.s, z16.s + __ sve_abs(z22, __ H, p3, z1); // abs z22.h, p3/m, z1.h + __ sve_add(z8, __ D, p5, z16); // add z8.d, p5/m, z8.d, z16.d + __ sve_and(z15, __ S, p1, z4); // and z15.s, p1/m, z15.s, z4.s + __ sve_asr(z8, __ B, p1, z29); // asr z8.b, p1/m, z8.b, z29.b + __ sve_cnt(z28, __ D, p4, z29); // cnt z28.d, p4/m, z29.d + __ sve_eor(z9, __ H, p3, z2); // eor z9.h, p3/m, z9.h, z2.h + __ sve_lsl(z28, __ B, p0, z7); // lsl z28.b, p0/m, z28.b, z7.b + __ sve_lsr(z26, __ H, p5, z17); // lsr z26.h, p5/m, z26.h, z17.h + __ sve_mul(z8, __ D, p4, z21); // mul z8.d, p4/m, z8.d, z21.d + __ sve_neg(z5, __ S, p5, z21); // neg z5.s, p5/m, z21.s + __ sve_not(z22, __ S, p4, z29); // not z22.s, p4/m, z29.s + __ sve_orr(z19, __ S, p0, z4); // orr z19.s, p0/m, z19.s, z4.s + __ sve_smax(z23, __ B, p1, z19); // smax z23.b, p1/m, z23.b, z19.b + __ sve_smin(z23, __ B, p6, z19); // smin z23.b, p6/m, z23.b, z19.b + __ sve_sub(z8, __ D, p2, z14); // sub z8.d, p2/m, z8.d, z14.d + __ sve_fabs(z17, __ S, p7, z21); // fabs z17.s, p7/m, z21.s + __ sve_fadd(z30, __ D, p0, z10); // fadd z30.d, p0/m, z30.d, z10.d + __ sve_fdiv(z12, __ S, p0, z9); // fdiv z12.s, p0/m, z12.s, z9.s + __ sve_fmax(z24, __ D, p4, z4); // fmax z24.d, p4/m, z24.d, z4.d + __ sve_fmin(z6, __ D, p2, z27); // fmin z6.d, p2/m, z6.d, z27.d + __ sve_fmul(z13, __ D, p4, z30); // fmul z13.d, p4/m, z13.d, z30.d + __ sve_fneg(z22, __ D, p5, z30); // fneg z22.d, p5/m, z30.d + __ sve_frintm(z9, __ S, p3, z19); // frintm z9.s, p3/m, z19.s + __ sve_frintn(z20, __ S, p7, z9); // frintn z20.s, p7/m, z9.s + __ sve_frintp(z13, __ S, p3, z19); // frintp z13.s, p3/m, z19.s + __ sve_fsqrt(z24, __ S, p2, z19); // fsqrt z24.s, p2/m, z19.s + __ sve_fsub(z17, __ S, p4, z16); // fsub z17.s, p4/m, z17.s, z16.s + __ sve_fmad(z0, __ S, p0, z11, z7); // fmad z0.s, p0/m, z11.s, z7.s + __ sve_fmla(z14, __ D, p4, z4, z15); // fmla z14.d, p4/m, z4.d, z15.d + __ sve_fmls(z5, __ D, p0, z10, z21); // fmls z5.d, p0/m, z10.d, z21.d + __ sve_fnmla(z3, __ D, p0, z9, z19); // fnmla z3.d, p0/m, z9.d, z19.d + __ sve_fnmls(z10, __ S, p6, z3, z19); // fnmls z10.s, p6/m, z3.s, z19.s + __ sve_mla(z23, __ H, p7, z13, z21); // mla z23.h, p7/m, z13.h, z21.h + __ sve_mls(z26, __ S, p3, z17, z30); // mls z26.s, p3/m, z17.s, z30.s + __ sve_and(z14, z2, z29); // and z14.d, z2.d, z29.d + __ sve_eor(z21, z20, z7); // eor z21.d, z20.d, z7.d + __ sve_orr(z2, z1, z26); // orr z2.d, z1.d, z26.d + __ sve_bic(z9, z16, z17); // bic z9.d, z16.d, z17.d + __ sve_uzp1(z0, __ D, z4, z2); // uzp1 z0.d, z4.d, z2.d + __ sve_uzp2(z14, __ S, z6, z11); // uzp2 z14.s, z6.s, z11.s // SVEReductionOp - __ sve_andv(v24, __ S, p4, z30); // andv s24, p4, z30.s - __ sve_orv(v4, __ H, p7, z1); // orv h4, p7, z1.h - __ sve_eorv(v19, __ H, p3, z0); // eorv h19, p3, z0.h - __ sve_smaxv(v7, __ B, p6, z17); // smaxv b7, p6, z17.b - __ sve_sminv(v27, __ D, p1, z9); // sminv d27, p1, z9.d - __ sve_fminv(v23, __ D, p3, z16); // fminv d23, p3, z16.d - __ sve_fmaxv(v22, __ D, p5, z20); // fmaxv d22, p5, z20.d - __ sve_fadda(v28, __ D, p2, z13); // fadda d28, p2, d28, z13.d - __ sve_uaddv(v7, __ H, p5, z28); // uaddv d7, p5, z28.h + __ sve_andv(v14, __ H, p4, z29); // andv h14, p4, z29.h + __ sve_orv(v3, __ H, p0, z22); // orv h3, p0, z22.h + __ sve_eorv(v3, __ B, p6, z27); // eorv b3, p6, z27.b + __ sve_smaxv(v19, __ D, p5, z7); // smaxv d19, p5, z7.d + __ sve_sminv(v21, __ H, p3, z5); // sminv h21, p3, z5.h + __ sve_fminv(v25, __ D, p1, z21); // fminv d25, p1, z21.d + __ sve_fmaxv(v17, __ S, p0, z3); // fmaxv s17, p0, z3.s + __ sve_fadda(v19, __ S, p3, z7); // fadda s19, p3, s19, z7.s + __ sve_uaddv(v14, __ H, p4, z17); // uaddv d14, p4, z17.h __ bind(forth); @@ -1088,30 +1130,30 @@ 0x9101a1a0, 0xb10a5cc8, 0xd10810aa, 0xf10fd061, 0x120cb166, 0x321764bc, 0x52174681, 0x720c0227, 0x9241018e, 0xb25a2969, 0xd278b411, 0xf26aad01, - 0x14000000, 0x17ffffd7, 0x1400037a, 0x94000000, - 0x97ffffd4, 0x94000377, 0x3400000a, 0x34fffa2a, - 0x34006e8a, 0x35000008, 0x35fff9c8, 0x35006e28, - 0xb400000b, 0xb4fff96b, 0xb4006dcb, 0xb500001d, - 0xb5fff91d, 0xb5006d7d, 0x10000013, 0x10fff8b3, - 0x10006d13, 0x90000013, 0x36300016, 0x3637f836, - 0x36306c96, 0x3758000c, 0x375ff7cc, 0x37586c2c, + 0x14000000, 0x17ffffd7, 0x14000398, 0x94000000, + 0x97ffffd4, 0x94000395, 0x3400000a, 0x34fffa2a, + 0x3400724a, 0x35000008, 0x35fff9c8, 0x350071e8, + 0xb400000b, 0xb4fff96b, 0xb400718b, 0xb500001d, + 0xb5fff91d, 0xb500713d, 0x10000013, 0x10fff8b3, + 0x100070d3, 0x90000013, 0x36300016, 0x3637f836, + 0x36307056, 0x3758000c, 0x375ff7cc, 0x37586fec, 0x128313a0, 0x528a32c7, 0x7289173b, 0x92ab3acc, 0xd2a0bf94, 0xf2c285e8, 0x9358722f, 0x330e652f, 0x53067f3b, 0x93577c53, 0xb34a1aac, 0xd35a4016, 0x13946c63, 0x93c3dbc8, 0x54000000, 0x54fff5a0, - 0x54006a00, 0x54000001, 0x54fff541, 0x540069a1, - 0x54000002, 0x54fff4e2, 0x54006942, 0x54000002, - 0x54fff482, 0x540068e2, 0x54000003, 0x54fff423, - 0x54006883, 0x54000003, 0x54fff3c3, 0x54006823, - 0x54000004, 0x54fff364, 0x540067c4, 0x54000005, - 0x54fff305, 0x54006765, 0x54000006, 0x54fff2a6, - 0x54006706, 0x54000007, 0x54fff247, 0x540066a7, - 0x54000008, 0x54fff1e8, 0x54006648, 0x54000009, - 0x54fff189, 0x540065e9, 0x5400000a, 0x54fff12a, - 0x5400658a, 0x5400000b, 0x54fff0cb, 0x5400652b, - 0x5400000c, 0x54fff06c, 0x540064cc, 0x5400000d, - 0x54fff00d, 0x5400646d, 0x5400000e, 0x54ffefae, - 0x5400640e, 0x5400000f, 0x54ffef4f, 0x540063af, + 0x54006dc0, 0x54000001, 0x54fff541, 0x54006d61, + 0x54000002, 0x54fff4e2, 0x54006d02, 0x54000002, + 0x54fff482, 0x54006ca2, 0x54000003, 0x54fff423, + 0x54006c43, 0x54000003, 0x54fff3c3, 0x54006be3, + 0x54000004, 0x54fff364, 0x54006b84, 0x54000005, + 0x54fff305, 0x54006b25, 0x54000006, 0x54fff2a6, + 0x54006ac6, 0x54000007, 0x54fff247, 0x54006a67, + 0x54000008, 0x54fff1e8, 0x54006a08, 0x54000009, + 0x54fff189, 0x540069a9, 0x5400000a, 0x54fff12a, + 0x5400694a, 0x5400000b, 0x54fff0cb, 0x540068eb, + 0x5400000c, 0x54fff06c, 0x5400688c, 0x5400000d, + 0x54fff00d, 0x5400682d, 0x5400000e, 0x54ffefae, + 0x540067ce, 0x5400000f, 0x54ffef4f, 0x5400676f, 0xd40658e1, 0xd4014d22, 0xd4046543, 0xd4273f60, 0xd44cad80, 0xd503201f, 0xd69f03e0, 0xd6bf03e0, 0xd5033fdf, 0xd5033e9f, 0xd50332bf, 0xd61f0200, @@ -1143,7 +1185,7 @@ 0x791f226d, 0xf95aa2f3, 0xb9587bb7, 0x395f7176, 0x795d9143, 0x399e7e08, 0x799a2697, 0x79df3422, 0xb99c2624, 0xfd5c2374, 0xbd5fa1d9, 0xfd1d595a, - 0xbd1b1869, 0x580053fb, 0x1800000b, 0xf8945060, + 0xbd1b1869, 0x580057bb, 0x1800000b, 0xf8945060, 0xd8000000, 0xf8ae6ba0, 0xf99a0080, 0x1a070035, 0x3a0700a8, 0x5a0e0367, 0x7a11009b, 0x9a000380, 0xba1e030c, 0xda0f0320, 0xfa030301, 0x0b340b11, @@ -1297,20 +1339,27 @@ 0xb8702320, 0xb87a3057, 0xb870508c, 0xb87c43be, 0xb87070db, 0xb86961fd, 0xce273c87, 0xce080ac9, 0xce7e8e9b, 0xce808b45, 0xce79806e, 0xce758768, - 0xcec0835a, 0xce608ad8, 0x043100c4, 0x046105e3, - 0x65c900a6, 0x65d60a87, 0x65c80545, 0x0416a63e, - 0x04001f8b, 0x045a179a, 0x04d09e0d, 0x045aa1a5, - 0x04990b4f, 0x049386cb, 0x04918264, 0x04500dd1, - 0x0497b062, 0x041ea4d7, 0x04980f71, 0x04c80450, - 0x048a04c3, 0x04810d93, 0x04dcba68, 0x65808ae0, - 0x65cd9db3, 0x658680e6, 0x65879911, 0x65c296d6, - 0x04dda1e2, 0x65c2a494, 0x65c0a107, 0x65c1b493, - 0x65cdb569, 0x65819e05, 0x65ad8c36, 0x65af1334, - 0x65e63104, 0x65fd5e04, 0x65eb6c49, 0x049a4423, - 0x04916d11, 0x043330b8, 0x04b032d1, 0x04603274, - 0x04e432f1, 0x05b96ae4, 0x05686d02, 0x049a33d8, - 0x04583c24, 0x04592c13, 0x04083a27, 0x04ca253b, - 0x65c72e17, 0x65c63696, 0x65d829bc, 0x04413787, - + 0xcec0835a, 0xce608ad8, 0x2520d264, 0x2521cf80, + 0x058074c1, 0x054242c9, 0x05004476, 0x25a0df08, + 0x25a1c206, 0x0583288b, 0x05401c3a, 0x05027e8d, + 0x2520ce05, 0x25a1cb0a, 0x0580989a, 0x0540e096, + 0x0500fb73, 0x2560c2ce, 0x2521d590, 0x05803e97, + 0x05400d31, 0x05003ed0, 0x2520c623, 0x25a1cdd1, + 0x058052ac, 0x0540ba33, 0x05003ed7, 0x25a0c6cd, + 0x2521cf00, 0x0583c5b1, 0x05407336, 0x05001e62, + 0x04e400f4, 0x04a80407, 0x65c402d3, 0x65cb0ac9, + 0x659007c5, 0x0456ac36, 0x04c01608, 0x049a048f, + 0x041087a8, 0x04dab3bc, 0x04590c49, 0x041380fc, + 0x0451963a, 0x04d012a8, 0x0497b6a5, 0x049eb3b6, + 0x04980093, 0x04080677, 0x040a1a77, 0x04c109c8, + 0x049cbeb1, 0x65c0815e, 0x658d812c, 0x65c69098, + 0x65c78b66, 0x65c293cd, 0x04ddb7d6, 0x6582ae69, + 0x6580bd34, 0x6581ae6d, 0x658daa78, 0x65819211, + 0x65a78160, 0x65ef108e, 0x65f52145, 0x65f34123, + 0x65b3786a, 0x04555db7, 0x049e6e3a, 0x043d304e, + 0x04a73295, 0x047a3022, 0x04f13209, 0x05e26880, + 0x05ab6cce, 0x045a33ae, 0x045822c3, 0x04193b63, + 0x04c834f3, 0x044a2cb5, 0x65c726b9, 0x65862071, + 0x65982cf3, 0x0441322e, }; // END Generated code -- do not edit diff --git a/test/hotspot/jtreg/compiler/codegen/TestByteVect.java b/test/hotspot/jtreg/compiler/codegen/TestByteVect.java index 385ba2dc8ea..73a2028ac7c 100644 --- a/test/hotspot/jtreg/compiler/codegen/TestByteVect.java +++ b/test/hotspot/jtreg/compiler/codegen/TestByteVect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -54,6 +54,7 @@ public class TestByteVect { static int test() { byte[] a1 = new byte[ARRLEN]; byte[] a2 = new byte[ARRLEN]; + byte[] a3 = new byte[ARRLEN]; System.out.println("Warmup"); for (int i=0; i Date: Thu, 18 Nov 2021 04:33:49 +0000 Subject: [PATCH 373/890] 8276058: Some swing test fails on specific CI macos system Reviewed-by: prr, kizune --- test/jdk/ProblemList.txt | 2 +- .../MakeWindowAlwaysOnTop.java | 6 +- .../JButton/8151303/PressedIconTest.java | 41 +++++++--- .../JInternalFrame/8069348/bug8069348.java | 38 +++++++-- .../SynthButtonUI/6276188/bug6276188.java | 79 ++++++++++++------- 5 files changed, 119 insertions(+), 47 deletions(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 0db2a881113..15355aa04a0 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -190,7 +190,7 @@ java/awt/Toolkit/RealSync/Test.java 6849383 linux-all java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8072110 macosx-all java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java 8073636 macosx-all -java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055,8266245 windows-all,linux-all,macosx-aarch64 +java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055,8266245 windows-all,linux-all,macosx-all java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all java/awt/Focus/6981400/Test1.java 8029675 windows-all,macosx-all java/awt/Focus/6981400/Test3.java 8173264 generic-all diff --git a/test/jdk/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java b/test/jdk/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java index b6e17a88f07..63d3463f981 100644 --- a/test/jdk/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java +++ b/test/jdk/java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java @@ -46,6 +46,10 @@ public class MakeWindowAlwaysOnTop private static Frame f; private static Dialog d; + // move away from cursor + private final static int OFFSET_X = -20; + private final static int OFFSET_Y = -20; + public static void main(String[] args) throws Exception { Robot r = Util.createRobot(); @@ -101,7 +105,7 @@ public class MakeWindowAlwaysOnTop Util.waitForIdle(r); - Color c = r.getPixelColor(p.x + f.getWidth() / 2, p.y + f.getHeight() / 2); + Color c = r.getPixelColor(p.x + f.getWidth() / 2 - OFFSET_X, p.y + f.getHeight() / 2 - OFFSET_Y); System.out.println("Color = " + c); String exceptionMessage = null; diff --git a/test/jdk/javax/swing/JButton/8151303/PressedIconTest.java b/test/jdk/javax/swing/JButton/8151303/PressedIconTest.java index 5a3f2a7066d..d5bbebc4bc1 100644 --- a/test/jdk/javax/swing/JButton/8151303/PressedIconTest.java +++ b/test/jdk/javax/swing/JButton/8151303/PressedIconTest.java @@ -26,7 +26,9 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Point; +import java.awt.Rectangle; import java.awt.Robot; +import java.awt.Toolkit; import java.awt.event.InputEvent; import java.awt.image.BaseMultiResolutionImage; import java.awt.image.BufferedImage; @@ -56,37 +58,56 @@ public class PressedIconTest { private static volatile double scale = -1; private static volatile int centerX; private static volatile int centerY; + private static volatile Point location; + // move away from cursor + private final static int OFFSET_X = -20; + private final static int OFFSET_Y = -20; public static void main(String[] args) throws Exception { Robot robot = new Robot(); - robot.setAutoDelay(50); + robot.setAutoDelay(100); SwingUtilities.invokeAndWait(() -> createAndShowGUI()); robot.waitForIdle(); + robot.delay(1000); SwingUtilities.invokeAndWait(() -> { scale = frame.getGraphicsConfiguration().getDefaultTransform() .getScaleX(); - Point location = frame.getLocation(); + location = frame.getLocation(); Dimension size = frame.getSize(); centerX = location.x + size.width / 2; centerY = location.y + size.height / 2; }); robot.waitForIdle(); + System.out.println("scale " + scale); + robot.mouseMove(centerX, centerY); - robot.mousePress(InputEvent.BUTTON1_MASK); robot.waitForIdle(); - Thread.sleep(100); - Color color = robot.getPixelColor(centerX, centerY); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + Color color = robot.getPixelColor(centerX - OFFSET_X, centerY - OFFSET_Y); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Rectangle screen = new Rectangle(0, 0, (int) screenSize.getWidth(), (int) screenSize.getHeight()); + BufferedImage img = robot.createScreenCapture(screen); + javax.imageio.ImageIO.write(img, "png", new java.io.File("image.png")); + + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + SwingUtilities.invokeAndWait(() -> frame.dispose()); - if ((scale == 1 && !similar(color, COLOR_1X)) - || (scale == 2 && !similar(color, COLOR_2X))) { - throw new RuntimeException("Colors are different!"); + if (scale == 1 && !similar(color, COLOR_1X)) { + System.out.println("color " + color + " COLOR_1X " + COLOR_1X); + throw new RuntimeException("Colors is different for scale=1!"); + } + if (scale == 2 && !similar(color, COLOR_2X)) { + System.out.println("color " + color + " COLOR_2X " + COLOR_2X); + throw new RuntimeException("Colors is different for scale=2!"); } + System.out.println("Test Passed"); } private static void createAndShowGUI() { @@ -108,6 +129,8 @@ public class PressedIconTest { panel.add(button, BorderLayout.CENTER); frame.getContentPane().add(panel); + frame.setUndecorated(true); + frame.setLocationRelativeTo(null); frame.setVisible(true); } diff --git a/test/jdk/javax/swing/JInternalFrame/8069348/bug8069348.java b/test/jdk/javax/swing/JInternalFrame/8069348/bug8069348.java index 939a3da2ce6..ac253b6ccf5 100644 --- a/test/jdk/javax/swing/JInternalFrame/8069348/bug8069348.java +++ b/test/jdk/javax/swing/JInternalFrame/8069348/bug8069348.java @@ -23,9 +23,12 @@ import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Dimension; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; import java.awt.event.InputEvent; import javax.swing.JDesktopPane; import javax.swing.JFrame; @@ -52,6 +55,10 @@ public class bug8069348 { private static final Color DESKTOPPANE_COLOR = Color.YELLOW; private static final Color FRAME_COLOR = Color.ORANGE; + // move away from cursor + private final static int OFFSET_X = -20; + private final static int OFFSET_Y = -20; + private static JFrame frame; private static JInternalFrame internalFrame; @@ -66,7 +73,7 @@ public class bug8069348 { SwingUtilities.invokeAndWait(bug8069348::createAndShowGUI); Robot robot = new Robot(); - robot.setAutoDelay(50); + robot.setAutoDelay(100); robot.waitForIdle(); Rectangle screenBounds = getInternalFrameScreenBounds(); @@ -79,27 +86,43 @@ public class bug8069348 { robot.mouseMove(x, y); robot.waitForIdle(); - robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseMove(x + dx, y + dy); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); int cx = screenBounds.x + screenBounds.width + dx / 2; int cy = screenBounds.y + screenBounds.height + dy / 2; robot.mouseMove(cx, cy); - if (!FRAME_COLOR.equals(robot.getPixelColor(cx, cy))) { + robot.waitForIdle(); + Color color = robot.getPixelColor(cx - OFFSET_X, cy - OFFSET_Y); + + if (!FRAME_COLOR.equals(color)) { + System.out.println("cx " + cx + " cy " + cy); + System.err.println("FRAME_COLOR Red: " + FRAME_COLOR.getRed() + "; Green: " + FRAME_COLOR.getGreen() + "; Blue: " + FRAME_COLOR.getBlue()); + System.err.println("Pixel color Red: " + color.getRed() + "; Green: " + color.getGreen() + "; Blue: " + color.getBlue()); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Rectangle screen = new Rectangle(0, 0, (int) screenSize.getWidth(), (int) screenSize.getHeight()); + BufferedImage img = robot.createScreenCapture(screen); + javax.imageio.ImageIO.write(img, "png", new java.io.File("image.png")); + throw new RuntimeException("Internal frame is not correctly dragged!"); } } finally { - if (frame != null) { - frame.dispose(); - } + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); } + System.out.println("Test Passed"); } private static boolean isSupported() { String d3d = System.getProperty("sun.java2d.d3d"); + System.out.println("d3d " + d3d); return !Boolean.getBoolean(d3d) || getOSType() == OSType.WINDOWS; } @@ -138,6 +161,7 @@ public class bug8069348 { panel.add(desktopPane, BorderLayout.CENTER); frame.add(panel); frame.setSize(WIN_WIDTH, WIN_HEIGHT); + frame.setLocationRelativeTo(null); frame.setVisible(true); frame.requestFocus(); } diff --git a/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java b/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java index 4664325db21..684e5efe0b6 100644 --- a/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java +++ b/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java @@ -37,46 +37,67 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.synth.*; -public class bug6276188 extends JFrame { +public class bug6276188 { private static JButton button; private static Point p; + private static JFrame testFrame; + + // move away from cursor + private final static int OFFSET_X = -20; + private final static int OFFSET_Y = -20; public static void main(String[] args) throws Throwable { - SynthLookAndFeel lookAndFeel = new SynthLookAndFeel(); - lookAndFeel.load(bug6276188.class.getResourceAsStream("bug6276188.xml"), bug6276188.class); + try { + Robot robot = new Robot(); + robot.setAutoDelay(100); - UIManager.setLookAndFeel(lookAndFeel); - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - JFrame testFrame = new JFrame(); - testFrame.setLayout(new BorderLayout()); - testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - testFrame.add(BorderLayout.CENTER, button = new JButton()); + SynthLookAndFeel lookAndFeel = new SynthLookAndFeel(); + lookAndFeel.load(bug6276188.class.getResourceAsStream("bug6276188.xml"), bug6276188.class); + UIManager.setLookAndFeel(lookAndFeel); - testFrame.setSize(new Dimension(320, 200)); - testFrame.setVisible(true); - } - }); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + testFrame = new JFrame(); + testFrame.setLayout(new BorderLayout()); + testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + testFrame.add(BorderLayout.CENTER, button = new JButton()); - Robot robot = new Robot(); - robot.setAutoDelay(50); - robot.waitForIdle(); - robot.delay(200); + testFrame.setSize(new Dimension(320, 200)); + testFrame.setLocationRelativeTo(null); + testFrame.setVisible(true); + } + }); - p = Util.getCenterPoint(button); + robot.waitForIdle(); + robot.delay(1000); - robot.mouseMove(p.x , p.y); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.waitForIdle(); - robot.delay(1000); + p = Util.getCenterPoint(button); + System.out.println("Button center point: " + p); - Color color = robot.getPixelColor(p.x, p.y); - robot.mouseRelease(InputEvent.BUTTON1_MASK); - boolean red = color.getRed() > 0 && color.getGreen() == 0 && color.getBlue() == 0; - if (!red) { - System.err.println("Red: " + color.getRed() + "; Green: " + color.getGreen() + "; Blue: " + color.getBlue()); - throw new RuntimeException("Synth ButtonUI does not handle PRESSED & MOUSE_OVER state"); + robot.mouseMove(p.x , p.y); + robot.waitForIdle(); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + Color color = robot.getPixelColor(p.x - OFFSET_X, p.y - OFFSET_y); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + boolean red = color.getRed() > 0 && color.getGreen() == 0 && color.getBlue() == 0; + if (!red) { + System.err.println("Red: " + color.getRed() + "; Green: " + color.getGreen() + "; Blue: " + color.getBlue()); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Rectangle screen = new Rectangle(0, 0, (int) screenSize.getWidth(), (int) screenSize.getHeight()); + BufferedImage img = robot.createScreenCapture(screen); + javax.imageio.ImageIO.write(img, "png", new java.io.File("image.png")); + throw new RuntimeException("Synth ButtonUI does not handle PRESSED & MOUSE_OVER state"); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (testFrame != null) { + testFrame.dispose(); + } + }); } } } -- GitLab From 2f4b5405f0b53782f3ed5274f68b31eb968efb6d Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 18 Nov 2021 08:32:54 +0000 Subject: [PATCH 374/890] 8276314: [JVMCI] check alignment of call displacement during code installation Reviewed-by: kvn --- src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp | 16 ++++++++++------ src/hotspot/cpu/x86/nativeInst_x86.cpp | 6 ++++-- src/hotspot/cpu/x86/nativeInst_x86.hpp | 6 +++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp index 38f696b50c2..7d93ed522ba 100644 --- a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp +++ b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp @@ -155,14 +155,15 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, JVMCIObject hotspot_met method = JVMCIENV->asMethod(hotspot_method); } #endif + NativeCall* call = NULL; switch (_next_call_type) { case INLINE_INVOKE: - break; + return; case INVOKEVIRTUAL: case INVOKEINTERFACE: { assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface"); - NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); + call = nativeCall_at(_instructions->start() + pc_offset); call->set_destination(SharedRuntime::get_resolve_virtual_call_stub()); _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc), @@ -172,7 +173,7 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, JVMCIObject hotspot_met case INVOKESTATIC: { assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic"); - NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); + call = nativeCall_at(_instructions->start() + pc_offset); call->set_destination(SharedRuntime::get_resolve_static_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::static_call_type, Assembler::call32_operand); @@ -180,15 +181,18 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, JVMCIObject hotspot_met } case INVOKESPECIAL: { assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial"); - NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); + call = nativeCall_at(_instructions->start() + pc_offset); call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub()); _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type, Assembler::call32_operand); break; } default: - JVMCI_ERROR("invalid _next_call_type value"); - break; + JVMCI_ERROR("invalid _next_call_type value: %d", _next_call_type); + return; + } + if (!call->is_displacement_aligned()) { + JVMCI_ERROR("unaligned displacement for call at offset %d", pc_offset); } } diff --git a/src/hotspot/cpu/x86/nativeInst_x86.cpp b/src/hotspot/cpu/x86/nativeInst_x86.cpp index fb00defc99e..0374a9cadea 100644 --- a/src/hotspot/cpu/x86/nativeInst_x86.cpp +++ b/src/hotspot/cpu/x86/nativeInst_x86.cpp @@ -260,6 +260,9 @@ void NativeCall::replace_mt_safe(address instr_addr, address code_buffer) { } +bool NativeCall::is_displacement_aligned() { + return (uintptr_t) displacement_address() % 4 == 0; +} // Similar to replace_mt_safe, but just changes the destination. The // important thing is that free-running threads are able to execute this @@ -282,8 +285,7 @@ void NativeCall::set_destination_mt_safe(address dest) { CompiledICLocker::is_safe(instruction_address()), "concurrent code patching"); // Both C1 and C2 should now be generating code which aligns the patched address // to be within a single cache line. - bool is_aligned = ((uintptr_t)displacement_address() + 0) / cache_line_size == - ((uintptr_t)displacement_address() + 3) / cache_line_size; + bool is_aligned = is_displacement_aligned(); guarantee(is_aligned, "destination must be aligned"); diff --git a/src/hotspot/cpu/x86/nativeInst_x86.hpp b/src/hotspot/cpu/x86/nativeInst_x86.hpp index 94f8b5e637c..a86128e7e4c 100644 --- a/src/hotspot/cpu/x86/nativeInst_x86.hpp +++ b/src/hotspot/cpu/x86/nativeInst_x86.hpp @@ -160,8 +160,6 @@ class NativeCall: public NativeInstruction { return_address_offset = 5 }; - enum { cache_line_size = BytesPerWord }; // conservative estimate! - address instruction_address() const { return addr_at(instruction_offset); } address next_instruction_address() const { return addr_at(return_address_offset); } int displacement() const { return (jint) int_at(displacement_offset); } @@ -175,9 +173,11 @@ class NativeCall: public NativeInstruction { #endif // AMD64 set_int_at(displacement_offset, dest - return_address()); } + // Returns whether the 4-byte displacement operand is 4-byte aligned. + bool is_displacement_aligned(); void set_destination_mt_safe(address dest); - void verify_alignment() { assert((intptr_t)addr_at(displacement_offset) % BytesPerInt == 0, "must be aligned"); } + void verify_alignment() { assert(is_displacement_aligned(), "displacement of call is not aligned"); } void verify(); void print(); -- GitLab From db55f9272c0889f4ea4dee0f4aa3d9613fadb2f8 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Thu, 18 Nov 2021 08:49:07 +0000 Subject: [PATCH 375/890] 8277343: dynamicArchive/SharedArchiveFileOption.java failed: '-XX:+RecordDynamicDumpInfo is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:' missing Reviewed-by: hseigel, ccheung --- .../dynamicArchive/DynamicArchiveTestBase.java | 2 +- .../dynamicArchive/SharedArchiveFileOption.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java index f6e25cfdeb8..b61894c1b4b 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java @@ -291,7 +291,7 @@ class DynamicArchiveTestBase { * UseCompressedClassPointers options. Those "compressed" options were * enabled when the default CDS archive was built. */ - private static boolean isUseSharedSpacesDisabled() { + public static boolean isUseSharedSpacesDisabled() { return (WB.getBooleanVMFlag("UseSharedSpaces") == false); } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java index 68785b32c1c..1dd12b2b55d 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java @@ -180,10 +180,14 @@ public class SharedArchiveFileOption extends DynamicArchiveTestBase { .assertAbnormalExit("-XX:ArchiveClassesAtExit is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:"); testcase("A dynamic archive is already loaded when -XX:+RecordDynamicDumpInfo is specified"); - run2(null, topArchiveName, - "-XX:+RecordDynamicDumpInfo", - "-cp", appJar, mainClass) - .assertAbnormalExit("-XX:+RecordDynamicDumpInfo is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:"); + if (isUseSharedSpacesDisabled()) { + System.out.println("This test is not applicable when JTREG tests are executed with -Xshare:off, or if the JDK doesn't have a default archive."); + } else { + run2(null, topArchiveName, + "-XX:+RecordDynamicDumpInfo", + "-cp", appJar, mainClass) + .assertAbnormalExit("-XX:+RecordDynamicDumpInfo is unsupported when a dynamic CDS archive is specified in -XX:SharedArchiveFile:"); + } testcase("-XX:+RecordDynamicDumpInfo cannot be used with -XX:ArchiveClassesAtExit"); dump2(baseArchiveName, -- GitLab From 0a65e8b282fd41e57108422fbd140527d9697efd Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 18 Nov 2021 10:48:16 +0000 Subject: [PATCH 376/890] 8276794: Change nested classes in java.desktop to static nested classes Reviewed-by: serb, aivanov --- .../com/apple/eawt/_AppEventHandler.java | 32 +++++++++---------- .../com/apple/laf/AquaFileChooserUI.java | 2 +- .../com/apple/laf/AquaFileSystemModel.java | 8 ++--- .../apple/laf/AquaInternalFramePaneUI.java | 4 +-- .../laf/AquaTabbedPaneCopyFromBasicUI.java | 2 +- .../classes/sun/java2d/metal/MTLRenderer.java | 2 +- .../classes/sun/lwawt/macosx/LWCToolkit.java | 3 +- .../plugins/jpeg/DHTMarkerSegment.java | 2 +- .../plugins/jpeg/DQTMarkerSegment.java | 2 +- .../plugins/jpeg/JFIFMarkerSegment.java | 8 ++--- .../plugins/jpeg/SOFMarkerSegment.java | 4 +-- .../plugins/jpeg/SOSMarkerSegment.java | 5 ++- .../swing/plaf/gtk/GTKColorChooserPanel.java | 4 +-- .../swing/plaf/motif/MotifDesktopPaneUI.java | 6 ++-- .../com/sun/media/sound/EventDispatcher.java | 6 ++-- .../sun/media/sound/RealTimeSequencer.java | 4 +-- .../com/sun/media/sound/SoftMainMixer.java | 5 ++- .../com/sun/media/sound/SunFileWriter.java | 4 +-- .../share/classes/java/awt/CardLayout.java | 2 +- .../share/classes/java/awt/Component.java | 2 +- .../share/classes/java/awt/Polygon.java | 2 +- .../share/classes/java/awt/ScrollPane.java | 3 +- .../share/classes/java/awt/Toolkit.java | 2 +- .../share/classes/java/awt/print/Book.java | 4 +-- .../share/classes/java/beans/XMLEncoder.java | 4 +-- .../metadata/IIOMetadataFormatImpl.java | 10 +++--- .../standard/PrinterStateReasons.java | 4 +-- .../javax/sound/sampled/AudioInputStream.java | 4 +-- .../classes/javax/swing/GroupLayout.java | 4 +-- .../share/classes/javax/swing/JComboBox.java | 2 +- .../share/classes/javax/swing/JComponent.java | 5 ++- .../share/classes/javax/swing/JTable.java | 2 +- .../classes/javax/swing/KeyboardManager.java | 4 +-- .../classes/javax/swing/RepaintManager.java | 2 +- .../swing/plaf/basic/BasicDesktopPaneUI.java | 9 ++++-- .../swing/plaf/basic/BasicFileChooserUI.java | 5 ++- .../basic/BasicInternalFrameTitlePane.java | 4 +-- .../swing/plaf/basic/BasicPopupMenuUI.java | 10 +----- .../swing/plaf/basic/BasicTabbedPaneUI.java | 6 ++-- .../swing/plaf/metal/MetalComboBoxEditor.java | 6 ++-- .../swing/plaf/metal/MetalFileChooserUI.java | 6 ++-- .../swing/plaf/metal/MetalIconFactory.java | 4 +-- .../swing/plaf/nimbus/NimbusLookAndFeel.java | 2 +- .../javax/swing/plaf/nimbus/NimbusStyle.java | 2 +- .../swing/plaf/synth/SynthTabbedPaneUI.java | 4 +-- .../javax/swing/plaf/synth/SynthTableUI.java | 4 +-- .../javax/swing/text/DefaultHighlighter.java | 4 +-- .../javax/swing/text/ElementIterator.java | 4 +-- .../javax/swing/text/JTextComponent.java | 6 +--- .../javax/swing/text/StringContent.java | 7 ++-- .../javax/swing/text/StyleContext.java | 4 +-- .../javax/swing/text/html/ImageView.java | 4 +-- .../javax/swing/text/html/TableView.java | 4 +-- .../javax/swing/text/rtf/RTFReader.java | 5 ++- .../swing/tree/DefaultMutableTreeNode.java | 12 +++---- .../share/classes/sun/awt/PlatformFont.java | 3 +- .../classes/sun/java2d/loops/RenderCache.java | 4 +-- .../sun/java2d/opengl/OGLRenderer.java | 4 +-- .../sun/java2d/pipe/GeneralCompositePipe.java | 4 +-- .../sun/java2d/pipe/SpanClipRenderer.java | 4 +-- .../share/classes/sun/print/PrintJob2D.java | 6 +--- .../classes/sun/print/RasterPrinterJob.java | 4 +-- .../classes/sun/print/ServiceDialog.java | 11 ++----- .../swing/plaf/synth/SynthFileChooserUI.java | 4 +-- .../plaf/synth/SynthFileChooserUIImpl.java | 6 ++-- .../table/DefaultTableCellHeaderRenderer.java | 4 +-- .../classes/sun/awt/X11/XTextAreaPeer.java | 15 ++++----- .../classes/sun/awt/X11/XTextFieldPeer.java | 13 ++------ .../unix/classes/sun/font/X11GB2312.java | 6 ++-- .../unix/classes/sun/font/X11GBK.java | 4 +-- .../unix/classes/sun/font/X11KSC5601.java | 6 ++-- .../classes/sun/print/IPPPrintService.java | 2 +- .../swing/plaf/windows/WindowsComboBoxUI.java | 2 +- .../plaf/windows/WindowsFileChooserUI.java | 2 +- .../plaf/windows/WindowsLookAndFeel.java | 6 ++-- .../sun/java/swing/plaf/windows/XPStyle.java | 4 +-- .../classes/sun/awt/windows/WPrinterJob.java | 2 +- .../sun/awt/windows/WScrollPanePeer.java | 4 +-- .../classes/sun/java2d/d3d/D3DRenderer.java | 5 ++- 79 files changed, 173 insertions(+), 223 deletions(-) diff --git a/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java b/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java index e64e9b158b5..248ae55f6d7 100644 --- a/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java +++ b/src/java.desktop/macosx/classes/com/apple/eawt/_AppEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -281,7 +281,7 @@ class _AppEventHandler { } } - class _PreferencesDispatcher extends _AppEventDispatcher { + static class _PreferencesDispatcher extends _AppEventDispatcher { synchronized void setHandler(final PreferencesHandler handler) { super.setHandler(handler); @@ -294,20 +294,20 @@ class _AppEventHandler { } } - class _OpenAppDispatcher extends _QueuingAppEventDispatcher { + static class _OpenAppDispatcher extends _QueuingAppEventDispatcher { void performUsing(com.apple.eawt._OpenAppHandler handler, _NativeEvent event) { handler.handleOpenApp(); } } - class _AppReOpenedDispatcher extends _AppEventMultiplexor { + static class _AppReOpenedDispatcher extends _AppEventMultiplexor { void performOnListener(AppReopenedListener listener, final _NativeEvent event) { final AppReopenedEvent e = new AppReopenedEvent(); listener.appReopened(e); } } - class _AppForegroundDispatcher extends _BooleanAppEventMultiplexor { + static class _AppForegroundDispatcher extends _BooleanAppEventMultiplexor { AppForegroundEvent createEvent(final boolean isTrue) { return new AppForegroundEvent(); } void performFalseEventOn(final AppForegroundListener listener, final AppForegroundEvent e) { @@ -319,7 +319,7 @@ class _AppEventHandler { } } - class _HiddenAppDispatcher extends _BooleanAppEventMultiplexor { + static class _HiddenAppDispatcher extends _BooleanAppEventMultiplexor { AppHiddenEvent createEvent(final boolean isTrue) { return new AppHiddenEvent(); } void performFalseEventOn(final AppHiddenListener listener, final AppHiddenEvent e) { @@ -331,7 +331,7 @@ class _AppEventHandler { } } - class _UserSessionDispatcher extends _BooleanAppEventMultiplexor { + static class _UserSessionDispatcher extends _BooleanAppEventMultiplexor { UserSessionEvent createEvent(final boolean isTrue) { return new UserSessionEvent(Reason.UNSPECIFIED); } @@ -349,7 +349,7 @@ class _AppEventHandler { } } - class _ScreenSleepDispatcher extends _BooleanAppEventMultiplexor { + static class _ScreenSleepDispatcher extends _BooleanAppEventMultiplexor { ScreenSleepEvent createEvent(final boolean isTrue) { return new ScreenSleepEvent(); } void performFalseEventOn(final ScreenSleepListener listener, final ScreenSleepEvent e) { @@ -365,7 +365,7 @@ class _AppEventHandler { } } - class _SystemSleepDispatcher extends _BooleanAppEventMultiplexor { + static class _SystemSleepDispatcher extends _BooleanAppEventMultiplexor { SystemSleepEvent createEvent(final boolean isTrue) { return new SystemSleepEvent(); } void performFalseEventOn(final SystemSleepListener listener, final SystemSleepEvent e) { @@ -381,7 +381,7 @@ class _AppEventHandler { } } - class _OpenFileDispatcher extends _QueuingAppEventDispatcher { + static class _OpenFileDispatcher extends _QueuingAppEventDispatcher { void performUsing(final OpenFilesHandler handler, final _NativeEvent event) { // create file list from fileNames final List fileNameList = event.get(0); @@ -394,7 +394,7 @@ class _AppEventHandler { } } - class _PrintFileDispatcher extends _QueuingAppEventDispatcher { + static class _PrintFileDispatcher extends _QueuingAppEventDispatcher { void performUsing(final PrintFilesHandler handler, final _NativeEvent event) { // create file list from fileNames final List fileNameList = event.get(0); @@ -406,7 +406,7 @@ class _AppEventHandler { } // Java URLs can't handle unknown protocol types, which is why we use URIs - class _OpenURIDispatcher extends _QueuingAppEventDispatcher { + static class _OpenURIDispatcher extends _QueuingAppEventDispatcher { void performUsing(final OpenURIHandler handler, final _NativeEvent event) { final String urlString = event.get(0); try { @@ -450,7 +450,7 @@ class _AppEventHandler { } } - abstract class _AppEventMultiplexor { + abstract static class _AppEventMultiplexor { private final Map listenerToAppContext = new IdentityHashMap(); boolean nativeListenerRegistered; @@ -503,7 +503,7 @@ class _AppEventHandler { } } - abstract class _BooleanAppEventMultiplexor extends _AppEventMultiplexor { + abstract static class _BooleanAppEventMultiplexor extends _AppEventMultiplexor { @Override void performOnListener(L listener, final _NativeEvent event) { final boolean isTrue = Boolean.TRUE.equals(event.get(0)); @@ -530,7 +530,7 @@ class _AppEventHandler { * * User code is not (and should not be) run under any synchronized lock. */ - abstract class _AppEventDispatcher { + abstract static class _AppEventDispatcher { H _handler; AppContext handlerContext; @@ -575,7 +575,7 @@ class _AppEventHandler { } } - abstract class _QueuingAppEventDispatcher extends _AppEventDispatcher { + abstract static class _QueuingAppEventDispatcher extends _AppEventDispatcher { List<_NativeEvent> queuedEvents = new LinkedList<_NativeEvent>(); @Override diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java index 71a4f012116..4160087be4e 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -2445,7 +2445,7 @@ public class AquaFileChooserUI extends FileChooserUI { // Convenience, to translate from the JList directory view to the Mac-style JTable // & minimize diffs between this and BasicFileChooserUI @SuppressWarnings("serial") // Superclass is not serializable across versions - class JTableExtension extends JTable { + static class JTableExtension extends JTable { public void setSelectedIndex(final int index) { getSelectionModel().setSelectionInterval(index, index); } diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java index 14aa78ec849..80ffc080f99 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java @@ -278,7 +278,7 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi // @param a an integer array // @param lo0 left boundary of array partition // @param hi0 right boundary of array partition - abstract class QuickSort { + abstract static class QuickSort { final void quickSort(final Vector v, final int lo0, final int hi0) { int lo = lo0; int hi = hi0; @@ -338,7 +338,7 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi protected abstract boolean lt(SortableFile a, SortableFile b); } - class QuickSortNames extends QuickSort { + static class QuickSortNames extends QuickSort { protected boolean lt(final SortableFile a, final SortableFile b) { final String aLower = a.fName.toLowerCase(); final String bLower = b.fName.toLowerCase(); @@ -346,14 +346,14 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi } } - class QuickSortDates extends QuickSort { + static class QuickSortDates extends QuickSort { protected boolean lt(final SortableFile a, final SortableFile b) { return a.fDateValue < b.fDateValue; } } // for speed in sorting, displaying - class SortableFile /* extends FileView */{ + static class SortableFile /* extends FileView */{ File fFile; String fName; long fDateValue; diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFramePaneUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFramePaneUI.java index e12033fceb5..a0c26ac7841 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFramePaneUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFramePaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -187,7 +187,7 @@ public class AquaInternalFramePaneUI extends BasicDesktopPaneUI implements Mouse } @SuppressWarnings("serial") // JDK implementation class - class AquaDockingDesktopManager extends AquaInternalFrameManager { + static class AquaDockingDesktopManager extends AquaInternalFrameManager { public void openFrame(final JInternalFrame f) { final JInternalFrame.JDesktopIcon desktopIcon = f.getDesktopIcon(); final Container dock = desktopIcon.getParent(); diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index 5722b28e576..6c92b5bbf8a 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -3261,7 +3261,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing } @SuppressWarnings("serial") // Superclass is not serializable across versions - private class ScrollableTabButton extends javax.swing.plaf.basic.BasicArrowButton implements UIResource, SwingConstants { + private static class ScrollableTabButton extends javax.swing.plaf.basic.BasicArrowButton implements UIResource, SwingConstants { public ScrollableTabButton(final int direction) { super(direction, UIManager.getColor("TabbedPane.selected"), UIManager.getColor("TabbedPane.shadow"), UIManager.getColor("TabbedPane.darkShadow"), UIManager.getColor("TabbedPane.highlight")); } diff --git a/src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderer.java b/src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderer.java index 5ca368d446e..5f4b8183d42 100644 --- a/src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderer.java +++ b/src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderer.java @@ -110,7 +110,7 @@ class MTLRenderer extends BufferedRenderPipe { return new Tracer(this); } - private class Tracer extends MTLRenderer { + private static class Tracer extends MTLRenderer { private MTLRenderer mtlr; Tracer(MTLRenderer mtlr) { super(mtlr.rq); diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 1b037510299..4a8f5bafe85 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -426,8 +426,7 @@ public final class LWCToolkit extends LWToolkit { // TODO Auto-generated method stub } - class OSXPlatformFont extends sun.awt.PlatformFont - { + static class OSXPlatformFont extends sun.awt.PlatformFont { OSXPlatformFont(String name, int style) { super(name, style); diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java index 34eca627d97..c14402522db 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java @@ -138,7 +138,7 @@ class DHTMarkerSegment extends MarkerSegment { /** * A Huffman table within a DHT marker segment. */ - class Htable implements Cloneable { + static class Htable implements Cloneable { int tableClass; // 0 == DC, 1 == AC int tableID; // 0 - 4 private static final int NUM_LENGTHS = 16; diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.java index be11577f0e3..8b983afc245 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.java @@ -171,7 +171,7 @@ class DQTMarkerSegment extends MarkerSegment { /** * A quantization table within a DQT marker segment. */ - class Qtable implements Cloneable { + static class Qtable implements Cloneable { int elementPrecision; int tableID; final int QTABLE_SIZE = 64; diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java index e03ceecd393..8b95d8adc65 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java @@ -552,7 +552,7 @@ class JFIFMarkerSegment extends MarkerSegment { // Could put reason codes in here to be parsed in writeJFXXSegment // in order to provide more meaningful warnings. @SuppressWarnings("serial") // JDK-implementation class - private class IllegalThumbException extends Exception {} + private static class IllegalThumbException extends Exception {} /** * Writes out a new JFXX extension segment, without saving it. @@ -794,7 +794,7 @@ class JFIFMarkerSegment extends MarkerSegment { * A superclass for the varieties of thumbnails that can * be stored in a JFIF extension marker segment. */ - abstract class JFIFThumb implements Cloneable { + abstract static class JFIFThumb implements Cloneable { long streamPos = -1L; // Save the thumbnail pos when reading abstract int getLength(); // When writing abstract int getWidth(); @@ -1111,7 +1111,7 @@ class JFIFMarkerSegment extends MarkerSegment { * to clip these, but the entire image must fit into a * single JFXX marker segment. */ - class JFIFThumbJPEG extends JFIFThumb { + static class JFIFThumbJPEG extends JFIFThumb { JPEGMetadata thumbMetadata = null; byte [] data = null; // Compressed image data, for writing private static final int PREAMBLE_SIZE = 6; @@ -1234,7 +1234,7 @@ class JFIFMarkerSegment extends MarkerSegment { return retval; } - private class ThumbnailReadListener + private static class ThumbnailReadListener implements IIOReadProgressListener { JPEGImageReader reader = null; ThumbnailReadListener (JPEGImageReader reader) { diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java index 8cc1813a23e..e5b7e861924 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -199,7 +199,7 @@ class SOFMarkerSegment extends MarkerSegment { /** * A component spec within an SOF marker segment. */ - class ComponentSpec implements Cloneable { + static class ComponentSpec implements Cloneable { int componentId; int HsamplingFactor; int VsamplingFactor; diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java index c8f223190fd..f40acdd0375 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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,7 +25,6 @@ package com.sun.imageio.plugins.jpeg; -//import javax.imageio.IIOException; import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.metadata.IIOMetadataNode; import javax.imageio.stream.ImageOutputStream; @@ -181,7 +180,7 @@ class SOSMarkerSegment extends MarkerSegment { /** * A scan component spec within an SOS marker segment. */ - class ScanComponentSpec implements Cloneable { + static class ScanComponentSpec implements Cloneable { int componentSelector; int dcHuffTable; int acHuffTable; diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java index 77c0e65dabc..78fa1e96635 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -1298,7 +1298,7 @@ class GTKColorChooserPanel extends AbstractColorChooserPanel implements } @SuppressWarnings("serial") // Superclass is not serializable across versions - private class OpaqueLabel extends JLabel { + private static class OpaqueLabel extends JLabel { public boolean isOpaque() { return true; } diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java index 60552b8c780..d25188dc077 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -74,7 +74,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU /// DragPane class //////////////////////////////////////////////////////////////////////////////////// @SuppressWarnings("serial") // Superclass is not serializable across versions - private class DragPane extends JComponent { + private static class DragPane extends JComponent { public void paint(Graphics g) { g.setColor(Color.darkGray); g.drawRect(0, 0, getWidth()-1, getHeight()-1); @@ -85,7 +85,7 @@ public class MotifDesktopPaneUI extends javax.swing.plaf.basic.BasicDesktopPaneU /// MotifDesktopManager class //////////////////////////////////////////////////////////////////////////////////// @SuppressWarnings("serial") // JDK-implementation class - private class MotifDesktopManager extends DefaultDesktopManager implements Serializable, UIResource { + private static class MotifDesktopManager extends DefaultDesktopManager implements Serializable, UIResource { JComponent dragPane; boolean usingDragPane = false; private transient JLayeredPane layeredPaneForDragPane; diff --git a/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java b/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java index 4b5027b12d2..1d66df87f1d 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -350,7 +350,7 @@ final class EventDispatcher implements Runnable { /** * Container for an event and a set of listeners to deliver it to. */ - private class EventInfo { + private static class EventInfo { private final Object event; private final Object[] listeners; @@ -383,7 +383,7 @@ final class EventDispatcher implements Runnable { /** * Container for a clip with its expiration time. */ - private class ClipInfo { + private static class ClipInfo { private final AutoClosingClip clip; private final long expiration; diff --git a/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java b/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java index b0239d33995..6fa6fa59c5c 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/RealTimeSequencer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -1024,7 +1024,7 @@ final class RealTimeSequencer extends AbstractMidiDevice } } // class Info - private class ControllerListElement { + private static class ControllerListElement { // $$jb: using an array for controllers b/c its // easier to deal with than turning all the diff --git a/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java b/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java index f603375f3b5..34ebd3900ae 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftMainMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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,8 +48,7 @@ public final class SoftMainMixer { // A private class thats contains a ModelChannelMixer and it's private buffers. // This becomes necessary when we want to have separate delay buffers for each channel mixer. - private class SoftChannelMixerContainer - { + private static class SoftChannelMixerContainer { ModelChannelMixer mixer; SoftAudioBuffer[] buffers; } diff --git a/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java b/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java index 538c547cef5..1d54bcfe91c 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -151,7 +151,7 @@ abstract class SunFileWriter extends AudioFileWriter { * The class is usefull for use with SequenceInputStream to prevent * closing of the source input streams. */ - final class NoCloseInputStream extends InputStream { + static final class NoCloseInputStream extends InputStream { private final InputStream in; NoCloseInputStream(InputStream in) { diff --git a/src/java.desktop/share/classes/java/awt/CardLayout.java b/src/java.desktop/share/classes/java/awt/CardLayout.java index f7ea3a0ba76..d53c86a9d45 100644 --- a/src/java.desktop/share/classes/java/awt/CardLayout.java +++ b/src/java.desktop/share/classes/java/awt/CardLayout.java @@ -74,7 +74,7 @@ public class CardLayout implements LayoutManager2, /** * A pair of component and string that represents its name. */ - class Card implements Serializable { + static class Card implements Serializable { /** * Use serialVersionUID from JDK 1.4 for interoperability. diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index ff522f5141a..c8930123c0b 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -3931,7 +3931,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @see sun.java2d.SunGraphicsEnvironment#isFlipStrategyPreferred(ComponentPeer) */ - private class ProxyCapabilities extends ExtendedBufferCapabilities { + private static class ProxyCapabilities extends ExtendedBufferCapabilities { private BufferCapabilities orig; private ProxyCapabilities(BufferCapabilities orig) { super(orig.getFrontBufferCapabilities(), diff --git a/src/java.desktop/share/classes/java/awt/Polygon.java b/src/java.desktop/share/classes/java/awt/Polygon.java index ed6f24a91c2..64f049cd1c7 100644 --- a/src/java.desktop/share/classes/java/awt/Polygon.java +++ b/src/java.desktop/share/classes/java/awt/Polygon.java @@ -575,7 +575,7 @@ public class Polygon implements Shape, java.io.Serializable { return getPathIterator(at); } - class PolygonPathIterator implements PathIterator { + static class PolygonPathIterator implements PathIterator { Polygon poly; AffineTransform transform; int index; diff --git a/src/java.desktop/share/classes/java/awt/ScrollPane.java b/src/java.desktop/share/classes/java/awt/ScrollPane.java index 05ffe6130f8..2b51bb671a3 100644 --- a/src/java.desktop/share/classes/java/awt/ScrollPane.java +++ b/src/java.desktop/share/classes/java/awt/ScrollPane.java @@ -740,8 +740,7 @@ public class ScrollPane extends Container implements Accessible { /** * Invoked when the value of the adjustable has changed. */ - class PeerFixer implements AdjustmentListener, java.io.Serializable - { + static class PeerFixer implements AdjustmentListener, java.io.Serializable { /** * Use serialVersionUID from JDK 1.1.1 for interoperability. */ diff --git a/src/java.desktop/share/classes/java/awt/Toolkit.java b/src/java.desktop/share/classes/java/awt/Toolkit.java index 354b5b3f3f3..520d2d9bb90 100644 --- a/src/java.desktop/share/classes/java/awt/Toolkit.java +++ b/src/java.desktop/share/classes/java/awt/Toolkit.java @@ -2090,7 +2090,7 @@ public abstract class Toolkit { } } - private class SelectiveAWTEventListener implements AWTEventListener { + private static class SelectiveAWTEventListener implements AWTEventListener { AWTEventListener listener; private long eventMask; // This array contains the number of times to call the eventlistener diff --git a/src/java.desktop/share/classes/java/awt/print/Book.java b/src/java.desktop/share/classes/java/awt/print/Book.java index 3e67109b340..bc3e11d0238 100644 --- a/src/java.desktop/share/classes/java/awt/print/Book.java +++ b/src/java.desktop/share/classes/java/awt/print/Book.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -174,7 +174,7 @@ public class Book implements Pageable { * The BookPage inner class describes an individual * page in a Book through a PageFormat-Printable pair. */ - private class BookPage { + private static class BookPage { /** * The size and orientation of the page. */ diff --git a/src/java.desktop/share/classes/java/beans/XMLEncoder.java b/src/java.desktop/share/classes/java/beans/XMLEncoder.java index 7deaea30622..646b777e7f7 100644 --- a/src/java.desktop/share/classes/java/beans/XMLEncoder.java +++ b/src/java.desktop/share/classes/java/beans/XMLEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -218,7 +218,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable { private boolean preambleWritten = false; private NameGenerator nameGenerator; - private class ValueData { + private static class ValueData { public int refs = 0; public boolean marked = false; // Marked -> refs > 0 unless ref was a target. public String name = null; diff --git a/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java b/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java index c9afb13a79d..8b5de4089ef 100644 --- a/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java +++ b/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataFormatImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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,9 +26,7 @@ package javax.imageio.metadata; import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; @@ -92,7 +90,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { // Element name (String) -> Element private HashMap elementMap = new HashMap<>(); - class Element { + static class Element { String elementName; int childPolicy; @@ -113,7 +111,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { ObjectValue objectValue; } - class Attribute { + static class Attribute { String attrName; int valueType = VALUE_ARBITRARY; @@ -133,7 +131,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { int listMaxLength; } - class ObjectValue { + static class ObjectValue { int valueType = VALUE_NONE; // ? extends T So that ObjectValue can take Class Class classType = null; diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java b/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java index ecc4d3c44d7..8e46b145651 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReasons.java @@ -227,7 +227,7 @@ public final class PrinterStateReasons return new PrinterStateReasonSet (severity, entrySet()); } - private class PrinterStateReasonSet + private static class PrinterStateReasonSet extends AbstractSet { private Severity mySeverity; @@ -254,7 +254,7 @@ public final class PrinterStateReasons } } - private class PrinterStateReasonSetIterator implements Iterator { + private static class PrinterStateReasonSetIterator implements Iterator { private Severity mySeverity; private Iterator> myIterator; private Map.Entry myEntry; diff --git a/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java b/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java index 6061ec94c6a..7a5a10e657a 100644 --- a/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java +++ b/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -474,7 +474,7 @@ public class AudioInputStream extends InputStream { /** * Private inner class that makes a TargetDataLine look like an InputStream. */ - private class TargetDataLineInputStream extends InputStream { + private static class TargetDataLineInputStream extends InputStream { /** * The TargetDataLine on which this TargetDataLineInputStream is based. diff --git a/src/java.desktop/share/classes/javax/swing/GroupLayout.java b/src/java.desktop/share/classes/javax/swing/GroupLayout.java index 61ed76bd536..3f85678361e 100644 --- a/src/java.desktop/share/classes/javax/swing/GroupLayout.java +++ b/src/java.desktop/share/classes/javax/swing/GroupLayout.java @@ -1267,7 +1267,7 @@ public class GroupLayout implements LayoutManager2 { * min/max/pref. If the min/pref/max has internally changes, or needs * to be updated you must invoke clear. */ - private abstract class Spring { + private abstract static class Spring { private int size; private int min; private int max; @@ -3167,7 +3167,7 @@ public class GroupLayout implements LayoutManager2 { /** * Spring represented a certain amount of space. */ - private class GapSpring extends Spring { + private static class GapSpring extends Spring { private final int min; private final int pref; private final int max; diff --git a/src/java.desktop/share/classes/javax/swing/JComboBox.java b/src/java.desktop/share/classes/javax/swing/JComboBox.java index 13fc319f1a7..3eba525bc81 100644 --- a/src/java.desktop/share/classes/javax/swing/JComboBox.java +++ b/src/java.desktop/share/classes/javax/swing/JComboBox.java @@ -1555,7 +1555,7 @@ implements ItemSelectable,ListDataListener,ActionListener, Accessible { int selectionForKey(char aKey,ComboBoxModel aModel); } - class DefaultKeySelectionManager implements KeySelectionManager, Serializable { + static class DefaultKeySelectionManager implements KeySelectionManager, Serializable { public int selectionForKey(char aKey,ComboBoxModel aModel) { int i,c; int currentSelection = -1; diff --git a/src/java.desktop/share/classes/javax/swing/JComponent.java b/src/java.desktop/share/classes/javax/swing/JComponent.java index d028c00b98b..74fcfcd94d8 100644 --- a/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -3448,7 +3448,7 @@ public abstract class JComponent extends Container implements Serializable, * ActionListeners that are * added via registerKeyboardAction. */ - final class ActionStandin implements Action { + static final class ActionStandin implements Action { private final ActionListener actionListener; private final String command; // This will be non-null if actionListener is an Action. @@ -5501,8 +5501,7 @@ public abstract class JComponent extends Container implements Serializable, * @see java.io.ObjectInputStream#registerValidation * @see SwingUtilities#updateComponentTreeUI */ - private class ReadObjectCallback implements ObjectInputValidation - { + private static class ReadObjectCallback implements ObjectInputValidation { private final Vector roots = new Vector(1); private final ObjectInputStream inputStream; diff --git a/src/java.desktop/share/classes/javax/swing/JTable.java b/src/java.desktop/share/classes/javax/swing/JTable.java index 4b3e02f860f..2506ed2cb7d 100644 --- a/src/java.desktop/share/classes/javax/swing/JTable.java +++ b/src/java.desktop/share/classes/javax/swing/JTable.java @@ -6579,7 +6579,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * A Printable implementation that wraps another * Printable, making it safe for printing on another thread. */ - private class ThreadSafePrintable implements Printable { + private static class ThreadSafePrintable implements Printable { /** The delegate Printable. */ private Printable printDelegate; diff --git a/src/java.desktop/share/classes/javax/swing/KeyboardManager.java b/src/java.desktop/share/classes/javax/swing/KeyboardManager.java index a2246e7a69b..5b79b0d3d51 100644 --- a/src/java.desktop/share/classes/javax/swing/KeyboardManager.java +++ b/src/java.desktop/share/classes/javax/swing/KeyboardManager.java @@ -29,8 +29,6 @@ import java.util.*; import java.awt.*; import java.awt.event.*; import java.applet.*; -import java.beans.*; -import javax.swing.event.*; import sun.awt.EmbeddedFrame; /** @@ -371,7 +369,7 @@ class KeyboardManager { * which looks up topContainers based on component, keystroke pairs * This is used to make unregistering KeyStrokes fast */ - class ComponentKeyStrokePair { + static class ComponentKeyStrokePair { Object component; Object keyStroke; diff --git a/src/java.desktop/share/classes/javax/swing/RepaintManager.java b/src/java.desktop/share/classes/javax/swing/RepaintManager.java index 88684226d95..966e6e8489c 100644 --- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java +++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java @@ -1812,7 +1812,7 @@ public class RepaintManager } } - private class DoubleBufferInfo { + private static class DoubleBufferInfo { public Image image; public Dimension size; public boolean needsReset = false; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java index 894e2b07d1a..c2fab408902 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -31,11 +31,14 @@ import javax.swing.plaf.*; import java.beans.*; import java.awt.event.*; +import java.awt.Component; +import java.awt.Container; import java.awt.Dimension; import java.awt.Insets; +import java.awt.FocusTraversalPolicy; import java.awt.Graphics; import java.awt.KeyboardFocusManager; -import java.awt.*; +import java.awt.Point; import sun.swing.DefaultLookup; import sun.swing.UIAction; @@ -347,7 +350,7 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { * The default DesktopManager installed by the UI. */ @SuppressWarnings("serial") // JDK-implementation class - private class BasicDesktopManager extends DefaultDesktopManager + private static class BasicDesktopManager extends DefaultDesktopManager implements UIResource { } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java index 18f94db3040..33f42da00f8 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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,7 +40,6 @@ import java.util.List; import java.util.regex.*; import sun.awt.shell.ShellFolder; import sun.swing.*; -import sun.swing.SwingUtilities2; /** * Basic L&F implementation of a FileChooser. @@ -1204,7 +1203,7 @@ public class BasicFileChooserUI extends FileChooserUI { /* A file filter which accepts file patterns containing * the special wildcards *? on Windows and *?[] on Unix. */ - class GlobFilter extends FileFilter { + static class GlobFilter extends FileFilter { Pattern pattern; String globPattern; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java index 1a21268d74c..cea618a20e3 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -968,7 +968,7 @@ public class BasicInternalFrameTitlePane extends JComponent } // end SystemMenuBar - private class NoFocusButton extends JButton { + private static class NoFocusButton extends JButton { private String uiKey; public NoFocusButton(String uiKey, String opacityKey) { setFocusPainted(false); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java index ae652d81fa2..70244cd5ff6 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPopupMenuUI.java @@ -28,26 +28,18 @@ package javax.swing.plaf.basic; import javax.swing.*; import javax.swing.event.*; import javax.swing.plaf.*; -import javax.swing.plaf.basic.*; -import javax.swing.border.*; import java.applet.Applet; import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; import java.awt.KeyboardFocusManager; import java.awt.Window; import java.awt.event.*; import java.awt.AWTEvent; import java.awt.Toolkit; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeEvent; - import java.util.*; -import sun.swing.DefaultLookup; import sun.swing.UIAction; import sun.awt.AppContext; @@ -294,7 +286,7 @@ public class BasicPopupMenuUI extends PopupMenuUI { * * @since 1.4 */ - private class BasicPopupMenuListener implements PopupMenuListener { + private static class BasicPopupMenuListener implements PopupMenuListener { public void popupMenuCanceled(PopupMenuEvent e) { } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java index 8446354fe14..c9e5fd51f7f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -3945,8 +3945,8 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { } @SuppressWarnings("serial") // Superclass is not serializable across versions - private class ScrollableTabButton extends BasicArrowButton implements UIResource, - SwingConstants { + private static class ScrollableTabButton extends BasicArrowButton + implements UIResource, SwingConstants { public ScrollableTabButton(int direction) { super(direction, UIManager.getColor("TabbedPane.selected"), diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java index 191d63fa304..4bde085d66a 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -27,9 +27,7 @@ package javax.swing.plaf.metal; import javax.swing.*; import javax.swing.border.*; -import java.io.Serializable; import java.awt.*; -import java.awt.event.*; import javax.swing.plaf.basic.BasicComboBoxEditor; @@ -89,7 +87,7 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor { */ protected static Insets editorBorderInsets = new Insets( 2, 2, 2, 0 ); - class EditorBorder extends AbstractBorder { + static class EditorBorder extends AbstractBorder { public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { g.translate( x, y ); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java index 254393e01af..a17890806c3 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java @@ -38,8 +38,6 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.*; -import java.security.AccessController; -import java.security.PrivilegedAction; import javax.accessibility.*; import sun.awt.shell.ShellFolder; @@ -958,7 +956,7 @@ public class MetalFileChooserUI extends BasicFileChooserUI { } static final int space = 10; - class IndentIcon implements Icon { + static class IndentIcon implements Icon { Icon icon = null; int depth = 0; @@ -1361,7 +1359,7 @@ public class MetalFileChooserUI extends BasicFileChooserUI { } @SuppressWarnings("serial") // Superclass is not serializable across versions - private class AlignedLabel extends JLabel { + private static class AlignedLabel extends JLabel { private AlignedLabel[] group; private int maxWidth = 0; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java index 9df2b625e18..a7e24b332a1 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalIconFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -1621,7 +1621,7 @@ public class MetalIconFactory implements Serializable { Vector images = new Vector(1, 1); ImageGcPair currentImageGcPair; - class ImageGcPair { + static class ImageGcPair { Image image; GraphicsConfiguration gc; ImageGcPair(Image image, GraphicsConfiguration gc) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java b/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java index 03b7fd081ad..495066f066f 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java @@ -495,7 +495,7 @@ public class NimbusLookAndFeel extends SynthLookAndFeel { /** * Simple Symbolic Link style UIDefalts Property */ - private class LinkProperty implements UIDefaults.ActiveValue, UIResource{ + private static class LinkProperty implements UIDefaults.ActiveValue, UIResource{ private String dstPropName; private LinkProperty(String dstPropName) { diff --git a/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java b/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java index b2c8fc6e679..1a838d926e7 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java @@ -1019,7 +1019,7 @@ public final class NimbusStyle extends SynthStyle { * fonts, painters, etc associated with some state for this * style. */ - private final class RuntimeState implements Cloneable { + private static final class RuntimeState implements Cloneable { int state; Painter backgroundPainter; Painter foregroundPainter; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java index 953efdbe42d..98fd2d1c4fe 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -933,7 +933,7 @@ public class SynthTabbedPaneUI extends BasicTabbedPaneUI * {@code UIResource}. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - private class SynthScrollableTabButton extends SynthArrowButton implements + private static class SynthScrollableTabButton extends SynthArrowButton implements UIResource { public SynthScrollableTabButton(int direction) { super(direction); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTableUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTableUI.java index 8a863f41e00..8c007ae05cb 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTableUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTableUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -713,7 +713,7 @@ public class SynthTableUI extends BasicTableUI * The renderer installed by the UI to render the boolean data. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - private class SynthBooleanTableCellRenderer extends JCheckBox implements + private static class SynthBooleanTableCellRenderer extends JCheckBox implements TableCellRenderer { private boolean isRowSelected; diff --git a/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java b/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java index 790fc977793..4e874ec1f00 100644 --- a/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java +++ b/src/java.desktop/share/classes/javax/swing/text/DefaultHighlighter.java @@ -509,7 +509,7 @@ public class DefaultHighlighter extends LayeredHighlighter { } - class HighlightInfo implements Highlighter.Highlight { + static class HighlightInfo implements Highlighter.Highlight { public int getStartOffset() { return p0.getOffset(); @@ -533,7 +533,7 @@ public class DefaultHighlighter extends LayeredHighlighter { * LayeredHighlightPainter is used when a drawsLayeredHighlights is * true. It maintains a rectangle of the region to paint. */ - class LayeredHighlightInfo extends HighlightInfo { + static class LayeredHighlightInfo extends HighlightInfo { void union(Shape bounds) { if (bounds == null) diff --git a/src/java.desktop/share/classes/javax/swing/text/ElementIterator.java b/src/java.desktop/share/classes/javax/swing/text/ElementIterator.java index 8b2714ec985..3c9d1c234d8 100644 --- a/src/java.desktop/share/classes/javax/swing/text/ElementIterator.java +++ b/src/java.desktop/share/classes/javax/swing/text/ElementIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -78,7 +78,7 @@ public class ElementIterator implements Cloneable { * vector of children of the element. In this case, the item on the stack * represents the "index"th child of the element. */ - private class StackItem implements Cloneable { + private static class StackItem implements Cloneable { Element item; int childIndex; diff --git a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java index 414fea199c4..69c7e39d703 100644 --- a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java +++ b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java @@ -52,11 +52,7 @@ import java.awt.font.TextAttribute; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; -import java.awt.print.Printable; -import java.awt.print.PrinterException; - import javax.print.PrintService; -import javax.print.attribute.PrintRequestAttributeSet; import java.text.*; import java.text.AttributedCharacterIterator.Attribute; @@ -5109,7 +5105,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A // // Runnable class for invokeLater() to set caret position later. // - private class DoSetCaretPosition implements Runnable { + private static class DoSetCaretPosition implements Runnable { JTextComponent host; Position newPos; diff --git a/src/java.desktop/share/classes/javax/swing/text/StringContent.java b/src/java.desktop/share/classes/javax/swing/text/StringContent.java index bef98a5cc2a..c66156a39f2 100644 --- a/src/java.desktop/share/classes/javax/swing/text/StringContent.java +++ b/src/java.desktop/share/classes/javax/swing/text/StringContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -27,7 +27,6 @@ package javax.swing.text; import java.util.Vector; import java.io.Serializable; import javax.swing.undo.*; -import javax.swing.SwingUtilities; /** * An implementation of the AbstractDocument.Content interface that is @@ -324,7 +323,7 @@ public final class StringContent implements AbstractDocument.Content, Serializab * it.... the update table holds only a reference * to this grungy thing. */ - final class PosRec { + static final class PosRec { PosRec(int offset) { this.offset = offset; @@ -369,7 +368,7 @@ public final class StringContent implements AbstractDocument.Content, Serializab * Used to hold a reference to a Position that is being reset as the * result of removing from the content. */ - final class UndoPosRef { + static final class UndoPosRef { UndoPosRef(PosRec rec) { this.rec = rec; this.undoLocation = rec.offset; diff --git a/src/java.desktop/share/classes/javax/swing/text/StyleContext.java b/src/java.desktop/share/classes/javax/swing/text/StyleContext.java index b43282d1080..9e01aecd3fb 100644 --- a/src/java.desktop/share/classes/javax/swing/text/StyleContext.java +++ b/src/java.desktop/share/classes/javax/swing/text/StyleContext.java @@ -1055,7 +1055,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon /** * An enumeration of the keys in a SmallAttributeSet. */ - class KeyEnumeration implements Enumeration { + static class KeyEnumeration implements Enumeration { KeyEnumeration(Object[] attr) { this.attr = attr; @@ -1097,7 +1097,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon * Sorts the key strings so that they can be very quickly compared * in the attribute set searches. */ - class KeyBuilder { + static class KeyBuilder { public void initialize(AttributeSet a) { if (a instanceof SmallAttributeSet) { diff --git a/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java b/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java index 7a27edead65..6f0a7cbdff4 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -1056,7 +1056,7 @@ public class ImageView extends View { * the attribute specified an alt attribute. It overriden a handle of * methods as the text is hardcoded and does not come from the document. */ - private class ImageLabelView extends InlineView { + private static class ImageLabelView extends InlineView { private Segment segment; private Color fg; diff --git a/src/java.desktop/share/classes/javax/swing/text/html/TableView.java b/src/java.desktop/share/classes/javax/swing/text/html/TableView.java index cbcef3bab4a..c088bf0eb9a 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/TableView.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/TableView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -1691,7 +1691,7 @@ import javax.swing.text.*; * Default view of an html table cell. This needs to be moved * somewhere else. */ - class CellView extends BlockView { + static class CellView extends BlockView { /** * Constructs a TableCell for the given element. diff --git a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java index add3a86a891..9128a71ed01 100644 --- a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java +++ b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFReader.java @@ -669,8 +669,7 @@ interface Destination { /** This data-sink class is used to implement ignored destinations * (e.g. {\*\blegga blah blah blah} ) * It accepts all keywords and text but does nothing with them. */ -class DiscardingDestination implements Destination -{ +static class DiscardingDestination implements Destination { public void handleBinaryBlob(byte[] data) { /* Discard binary blobs. */ @@ -1071,7 +1070,7 @@ class StylesheetDestination /** Handles the info group. Currently no info keywords are recognized * so this is a subclass of DiscardingDestination. */ -class InfoDestination +static class InfoDestination extends DiscardingDestination implements Destination { diff --git a/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java b/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java index 163e0ec784d..0b8b6679ded 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java +++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java @@ -1330,7 +1330,7 @@ public class DefaultMutableTreeNode implements Cloneable, userObject = tValues[1]; } - private final class PreorderEnumeration implements Enumeration { + private static final class PreorderEnumeration implements Enumeration { private final Stack> stack = new Stack<>(); public PreorderEnumeration(TreeNode rootNode) { @@ -1362,7 +1362,7 @@ public class DefaultMutableTreeNode implements Cloneable, - final class PostorderEnumeration implements Enumeration { + static final class PostorderEnumeration implements Enumeration { protected TreeNode root; protected Enumeration children; protected Enumeration subtree; @@ -1398,7 +1398,7 @@ public class DefaultMutableTreeNode implements Cloneable, - final class BreadthFirstEnumeration implements Enumeration { + static final class BreadthFirstEnumeration implements Enumeration { protected Queue queue; public BreadthFirstEnumeration(TreeNode rootNode) { @@ -1430,11 +1430,11 @@ public class DefaultMutableTreeNode implements Cloneable, // A simple queue with a linked list data structure. - final class Queue { + static final class Queue { QNode head; // null if empty QNode tail; - final class QNode { + static final class QNode { public Object object; public QNode next; // null if end public QNode(Object object, QNode next) { @@ -1486,7 +1486,7 @@ public class DefaultMutableTreeNode implements Cloneable, - final class PathBetweenNodesEnumeration implements Enumeration { + static final class PathBetweenNodesEnumeration implements Enumeration { protected Stack stack; public PathBetweenNodesEnumeration(TreeNode ancestor, diff --git a/src/java.desktop/share/classes/sun/awt/PlatformFont.java b/src/java.desktop/share/classes/sun/awt/PlatformFont.java index aa175d4786c..b1a9b7bc7ca 100644 --- a/src/java.desktop/share/classes/sun/awt/PlatformFont.java +++ b/src/java.desktop/share/classes/sun/awt/PlatformFont.java @@ -428,8 +428,7 @@ public abstract class PlatformFont implements FontPeer { */ private static native void initIDs(); - class PlatformFontCache - { + static class PlatformFontCache { char uniChar; FontDescriptor fontDescriptor; ByteBuffer bb = ByteBuffer.allocate(4); diff --git a/src/java.desktop/share/classes/sun/java2d/loops/RenderCache.java b/src/java.desktop/share/classes/sun/java2d/loops/RenderCache.java index 6dbedb0a573..7a9c2d59eb8 100644 --- a/src/java.desktop/share/classes/sun/java2d/loops/RenderCache.java +++ b/src/java.desktop/share/classes/sun/java2d/loops/RenderCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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,7 +26,7 @@ package sun.java2d.loops; public final class RenderCache { - final class Entry { + static final class Entry { private SurfaceType src; private CompositeType comp; private SurfaceType dst; diff --git a/src/java.desktop/share/classes/sun/java2d/opengl/OGLRenderer.java b/src/java.desktop/share/classes/sun/java2d/opengl/OGLRenderer.java index 95b15fdcb12..a933dacfb0d 100644 --- a/src/java.desktop/share/classes/sun/java2d/opengl/OGLRenderer.java +++ b/src/java.desktop/share/classes/sun/java2d/opengl/OGLRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -108,7 +108,7 @@ class OGLRenderer extends BufferedRenderPipe { return new Tracer(this); } - private class Tracer extends OGLRenderer { + private static class Tracer extends OGLRenderer { private OGLRenderer oglr; Tracer(OGLRenderer oglr) { super(oglr.rq); diff --git a/src/java.desktop/share/classes/sun/java2d/pipe/GeneralCompositePipe.java b/src/java.desktop/share/classes/sun/java2d/pipe/GeneralCompositePipe.java index 2e5ec8b2d0c..564093394bd 100644 --- a/src/java.desktop/share/classes/sun/java2d/pipe/GeneralCompositePipe.java +++ b/src/java.desktop/share/classes/sun/java2d/pipe/GeneralCompositePipe.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -43,7 +43,7 @@ import sun.java2d.loops.MaskBlit; import sun.java2d.loops.CompositeType; public class GeneralCompositePipe implements CompositePipe { - class TileContext { + static class TileContext { SunGraphics2D sunG2D; PaintContext paintCtxt; CompositeContext compCtxt; diff --git a/src/java.desktop/share/classes/sun/java2d/pipe/SpanClipRenderer.java b/src/java.desktop/share/classes/sun/java2d/pipe/SpanClipRenderer.java index 8413fb8bced..62d1f119f33 100644 --- a/src/java.desktop/share/classes/sun/java2d/pipe/SpanClipRenderer.java +++ b/src/java.desktop/share/classes/sun/java2d/pipe/SpanClipRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -51,7 +51,7 @@ public class SpanClipRenderer implements CompositePipe outpipe = pipe; } - class SCRcontext { + static class SCRcontext { RegionIterator iterator; Object outcontext; int[] band; diff --git a/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/src/java.desktop/share/classes/sun/print/PrintJob2D.java index dcc238b4a53..3ad1c488567 100644 --- a/src/java.desktop/share/classes/sun/print/PrintJob2D.java +++ b/src/java.desktop/share/classes/sun/print/PrintJob2D.java @@ -54,7 +54,6 @@ import java.util.Properties; import javax.print.PrintService; import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; -import javax.print.attribute.ResolutionSyntax; import javax.print.attribute.Size2DSyntax; import javax.print.attribute.standard.Chromaticity; import javax.print.attribute.standard.Copies; @@ -64,7 +63,6 @@ import javax.print.attribute.standard.DialogOwner; import javax.print.attribute.standard.JobName; import javax.print.attribute.standard.MediaSize; import javax.print.attribute.standard.PrintQuality; -import javax.print.attribute.standard.PrinterResolution; import javax.print.attribute.standard.SheetCollate; import javax.print.attribute.standard.Sides; import javax.print.attribute.standard.Media; @@ -72,8 +70,6 @@ import javax.print.attribute.standard.OrientationRequested; import javax.print.attribute.standard.MediaSizeName; import javax.print.attribute.standard.PageRanges; -import sun.print.SunPageSelection; -import sun.print.SunMinMaxPage; /** * A class which initiates and executes a print job using @@ -1033,7 +1029,7 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { graphicsDrawn.close(); } - private class MessageQ { + private static class MessageQ { private String qid="noname"; diff --git a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java index 075bdefb145..6ceeb48df85 100644 --- a/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java +++ b/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java @@ -28,8 +28,6 @@ package sun.print; import java.io.FilePermission; import java.awt.Color; -import java.awt.Dialog; -import java.awt.Frame; import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; @@ -304,7 +302,7 @@ public abstract class RasterPrinterJob extends PrinterJob { * The redrawing code needs to look at sx, sy to calculate the scale * to device resolution. */ - private class GraphicsState { + private static class GraphicsState { Rectangle2D region; // Area of page to repaint Shape theClip; // image drawing clip. AffineTransform theTransform; // to transform clip to dev coords. diff --git a/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/src/java.desktop/share/classes/sun/print/ServiceDialog.java index c294ba617eb..8db53d2d376 100644 --- a/src/java.desktop/share/classes/sun/print/ServiceDialog.java +++ b/src/java.desktop/share/classes/sun/print/ServiceDialog.java @@ -26,7 +26,6 @@ package sun.print; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dialog; @@ -35,9 +34,7 @@ import java.awt.Frame; import java.awt.GraphicsConfiguration; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; -import java.awt.GridLayout; import java.awt.Insets; -import java.awt.Toolkit; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -61,13 +58,9 @@ import javax.print.*; import javax.print.attribute.*; import javax.print.attribute.standard.*; import javax.swing.*; -import javax.swing.border.Border; import javax.swing.border.EmptyBorder; -import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; import javax.swing.text.NumberFormatter; @@ -2835,7 +2828,7 @@ public class ServiceDialog extends JDialog implements ActionListener { * placed to the left of the radio button. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - private class IconRadioButton extends JPanel { + private static class IconRadioButton extends JPanel { private JRadioButton rb; private JLabel lbl; @@ -2889,7 +2882,7 @@ public class ServiceDialog extends JDialog implements ActionListener { * user selects a file that already exists. */ @SuppressWarnings("serial") // JDK implementation class - private class ValidatingFileChooser extends JFileChooser { + private static class ValidatingFileChooser extends JFileChooser { public void approveSelection() { File selected = getSelectedFile(); boolean exists; diff --git a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java index 9760dad86c5..b190163ed6a 100644 --- a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java +++ b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -407,7 +407,7 @@ public abstract class SynthFileChooserUI extends BasicFileChooserUI implements /* A file filter which accepts file patterns containing * the special wildcard '*' on windows, plus '?', and '[ ]' on Unix. */ - class GlobFilter extends FileFilter { + static class GlobFilter extends FileFilter { Pattern pattern; String globPattern; diff --git a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java index 0d067a37b51..754630f1220 100644 --- a/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java +++ b/src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java @@ -29,8 +29,6 @@ import java.awt.event.*; import java.beans.*; import java.io.*; import java.util.*; -import java.security.AccessController; -import java.security.PrivilegedAction; import javax.swing.*; import javax.swing.event.*; @@ -697,7 +695,7 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI { } static final int space = 10; - class IndentIcon implements Icon { + static class IndentIcon implements Icon { Icon icon = null; int depth = 0; @@ -1068,7 +1066,7 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI { } @SuppressWarnings("serial") // JDK-implementation class - private class AlignedLabel extends JLabel { + private static class AlignedLabel extends JLabel { private AlignedLabel[] group; private int maxWidth = 0; diff --git a/src/java.desktop/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java b/src/java.desktop/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java index 8aa945d166e..1a112b72623 100644 --- a/src/java.desktop/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java +++ b/src/java.desktop/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -189,7 +189,7 @@ public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer } @SuppressWarnings("serial") // JDK-implementation class - private class EmptyIcon implements Icon, Serializable { + private static class EmptyIcon implements Icon, Serializable { int width = 0; int height = 0; public void paintIcon(Component c, Graphics g, int x, int y) {} diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java index 9dad1de7cee..8fea352942a 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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,7 +26,6 @@ package sun.awt.X11; import java.awt.*; -import java.awt.peer.ComponentPeer; import java.awt.peer.TextAreaPeer; import java.awt.event.*; import javax.swing.event.DocumentListener; @@ -526,7 +525,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { return jtext.getCaretPosition(); } - final class AWTTextAreaUI extends MotifTextAreaUI { + static final class AWTTextAreaUI extends MotifTextAreaUI { private JTextArea jta; @@ -633,7 +632,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } @SuppressWarnings("serial") // JDK-implementation class - final class XAWTScrollBarButton extends BasicArrowButton { + static final class XAWTScrollBarButton extends BasicArrowButton { private UIDefaults uidefaults = XToolkit.getUIDefaults(); private Color darkShadow = SystemColor.controlShadow; @@ -804,7 +803,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } - final class XAWTScrollBarUI extends BasicScrollBarUI { + static final class XAWTScrollBarUI extends BasicScrollBarUI { @Override protected void installDefaults() @@ -894,7 +893,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } @SuppressWarnings("serial") // JDK-implementation class - final class AWTTextArea extends JTextArea implements DocumentListener { + static final class AWTTextArea extends JTextArea implements DocumentListener { private boolean isFocused = false; private final XTextAreaPeer peer; @@ -983,7 +982,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } - final class XAWTScrollPaneUI extends BasicScrollPaneUI { + static final class XAWTScrollPaneUI extends BasicScrollPaneUI { private final Border vsbMarginBorderR = new EmptyBorder(0, 2, 0, 0); private final Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 2); @@ -1093,7 +1092,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } @SuppressWarnings("serial") // JDK-implementation class - private class AWTTextPane extends JScrollPane implements FocusListener { + private static class AWTTextPane extends JScrollPane implements FocusListener { private final JTextArea jtext; private final XWindow xwin; diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java index 4046b292ee6..2caaefed8c0 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -28,9 +28,6 @@ package sun.awt.X11; import java.awt.*; import java.awt.peer.*; import java.awt.event.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.TextEvent; import javax.swing.text.*; import javax.swing.event.DocumentListener; import javax.swing.event.DocumentEvent; @@ -40,10 +37,6 @@ import javax.swing.JPasswordField; import javax.swing.SwingUtilities; import javax.swing.TransferHandler; -import java.awt.event.MouseEvent; -import java.awt.event.FocusEvent; -import java.awt.event.KeyEvent; - import javax.swing.plaf.UIResource; import javax.swing.UIDefaults; import javax.swing.JTextField; @@ -445,7 +438,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } - final class AWTTextFieldUI extends MotifPasswordFieldUI { + static final class AWTTextFieldUI extends MotifPasswordFieldUI { private JTextField jtf; @@ -541,7 +534,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } @SuppressWarnings("serial") // JDK-implementation class - final class XAWTTextField extends JPasswordField + static final class XAWTTextField extends JPasswordField implements ActionListener, DocumentListener { private boolean isFocused = false; diff --git a/src/java.desktop/unix/classes/sun/font/X11GB2312.java b/src/java.desktop/unix/classes/sun/font/X11GB2312.java index 11d109a5323..e1d64cbe54d 100644 --- a/src/java.desktop/unix/classes/sun/font/X11GB2312.java +++ b/src/java.desktop/unix/classes/sun/font/X11GB2312.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -46,7 +46,7 @@ public class X11GB2312 extends Charset { return cs instanceof X11GB2312; } - private class Encoder extends CharsetEncoder { + private static class Encoder extends CharsetEncoder { private DoubleByte.Encoder enc = (DoubleByte.Encoder)new EUC_CN().newEncoder(); public Encoder(Charset cs) { @@ -98,7 +98,7 @@ public class X11GB2312 extends Charset { } } - private class Decoder extends CharsetDecoder { + private static class Decoder extends CharsetDecoder { private DoubleByte.Decoder dec = (DoubleByte.Decoder)new EUC_CN().newDecoder(); public Decoder(Charset cs) { diff --git a/src/java.desktop/unix/classes/sun/font/X11GBK.java b/src/java.desktop/unix/classes/sun/font/X11GBK.java index 04df97da485..effe8f54f9c 100644 --- a/src/java.desktop/unix/classes/sun/font/X11GBK.java +++ b/src/java.desktop/unix/classes/sun/font/X11GBK.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -44,7 +44,7 @@ public class X11GBK extends Charset { return cs instanceof X11GBK; } - private class Encoder extends DoubleByte.Encoder { + private static class Encoder extends DoubleByte.Encoder { private DoubleByte.Encoder enc = (DoubleByte.Encoder)new GBK().newEncoder(); diff --git a/src/java.desktop/unix/classes/sun/font/X11KSC5601.java b/src/java.desktop/unix/classes/sun/font/X11KSC5601.java index 3eca7c01373..1a7cc310bbf 100644 --- a/src/java.desktop/unix/classes/sun/font/X11KSC5601.java +++ b/src/java.desktop/unix/classes/sun/font/X11KSC5601.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -46,7 +46,7 @@ public class X11KSC5601 extends Charset { return cs instanceof X11KSC5601; } - private class Encoder extends CharsetEncoder { + private static class Encoder extends CharsetEncoder { private DoubleByte.Encoder enc = (DoubleByte.Encoder)new EUC_KR().newEncoder(); public Encoder(Charset cs) { @@ -97,7 +97,7 @@ public class X11KSC5601 extends Charset { } } - private class Decoder extends CharsetDecoder { + private static class Decoder extends CharsetDecoder { private DoubleByte.Decoder dec = (DoubleByte.Decoder)new EUC_KR().newDecoder(); public Decoder(Charset cs) { diff --git a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java index 2bb401698da..af890126efb 100644 --- a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java +++ b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java @@ -832,7 +832,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService { //This class is for getting all pre-defined Finishings @SuppressWarnings("serial") // JDK implementation class - private class ExtFinishing extends Finishings { + private static class ExtFinishing extends Finishings { ExtFinishing(int value) { super(100); // 100 to avoid any conflicts with predefined values. } diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java index 695bb4be499..1a601f40332 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java @@ -593,7 +593,7 @@ public class WindowsComboBoxUI extends BasicComboBoxUI { private static final Border NULL_BORDER = new EmptyBorder(0, 0, 0, 0); // Create own version of DashedBorder with more space on left side - private class WindowsComboBoxDashedBorder extends DashedBorder { + private static class WindowsComboBoxDashedBorder extends DashedBorder { public WindowsComboBoxDashedBorder(Color color, int thickness) { super(color, thickness); diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java index 801529b6e6e..21cc715b494 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java @@ -1054,7 +1054,7 @@ public class WindowsFileChooserUI extends BasicFileChooserUI { } static final int space = 10; - class IndentIcon implements Icon { + static class IndentIcon implements Icon { Icon icon = null; int depth = 0; diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index e8ad9418cb3..ecbd0bbe30f 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -2113,7 +2113,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel * Gets an Icon from the native libraries if available. * A desktop property is used to trigger reloading the icon when needed. */ - private class ActiveWindowsIcon implements UIDefaults.ActiveValue { + private static class ActiveWindowsIcon implements UIDefaults.ActiveValue { private Icon icon; private String nativeImageName; private String fallbackName; @@ -2419,7 +2419,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel } } - private class TriggerDesktopProperty extends WindowsDesktopProperty { + private static class TriggerDesktopProperty extends WindowsDesktopProperty { TriggerDesktopProperty(String key) { super(key, null); // This call adds a property change listener for the property, @@ -2436,7 +2436,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel } } - private class FontDesktopProperty extends TriggerDesktopProperty { + private static class FontDesktopProperty extends TriggerDesktopProperty { FontDesktopProperty(String key) { super(key); } diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java index 45fc54c07a6..c2c11c896cf 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java @@ -301,7 +301,7 @@ class XPStyle { } @SuppressWarnings("serial") // Superclass is not serializable across versions - private class XPFillBorder extends LineBorder implements UIResource { + private static class XPFillBorder extends LineBorder implements UIResource { XPFillBorder(Color color, int thickness) { super(color, thickness); } @@ -398,7 +398,7 @@ class XPStyle { } @SuppressWarnings("serial") // Superclass is not serializable across versions - private class XPEmptyBorder extends EmptyBorder implements UIResource { + private static class XPEmptyBorder extends EmptyBorder implements UIResource { XPEmptyBorder(Insets m) { super(m.top+2, m.left+2, m.bottom+2, m.right+2); } diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java b/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java index 6661ae218a1..e9c9c709adb 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java @@ -2297,7 +2297,7 @@ public final class WPrinterJob extends RasterPrinterJob } @SuppressWarnings("serial") // JDK-implementation class -class PrintToFileErrorDialog extends Dialog implements ActionListener{ +static class PrintToFileErrorDialog extends Dialog implements ActionListener { public PrintToFileErrorDialog(Frame parent, String title, String message, String buttonText) { super(parent, title, true); diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java b/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java index 2c7667f25ef..b3d0402213f 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -162,7 +162,7 @@ final class WScrollPanePeer extends WPanelPeer implements ScrollPanePeer { * operation. */ @SuppressWarnings("serial") // JDK-implementation class - class ScrollEvent extends PeerEvent { + static class ScrollEvent extends PeerEvent { ScrollEvent(Object source, Runnable runnable) { super(source, runnable, 0L); } diff --git a/src/java.desktop/windows/classes/sun/java2d/d3d/D3DRenderer.java b/src/java.desktop/windows/classes/sun/java2d/d3d/D3DRenderer.java index bf46ec92934..924dd024d67 100644 --- a/src/java.desktop/windows/classes/sun/java2d/d3d/D3DRenderer.java +++ b/src/java.desktop/windows/classes/sun/java2d/d3d/D3DRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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,7 +30,6 @@ import java.awt.geom.Path2D; import sun.java2d.InvalidPipeException; import sun.java2d.SunGraphics2D; import sun.java2d.loops.GraphicsPrimitive; -import sun.java2d.pipe.BufferedPaints; import sun.java2d.pipe.BufferedRenderPipe; import sun.java2d.pipe.RenderQueue; import sun.java2d.pipe.SpanIterator; @@ -108,7 +107,7 @@ class D3DRenderer extends BufferedRenderPipe { return new Tracer(this); } - private class Tracer extends D3DRenderer { + private static class Tracer extends D3DRenderer { private D3DRenderer d3dr; Tracer(D3DRenderer d3dr) { super(d3dr.rq); -- GitLab From 77cc508802899b370f1cdf592331f81efb8d9208 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 18 Nov 2021 10:52:55 +0000 Subject: [PATCH 377/890] 8277215: Remove redundancy in ReferenceProcessor constructor args Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 -- src/hotspot/share/gc/parallel/psParallelCompact.cpp | 1 - src/hotspot/share/gc/parallel/psScavenge.cpp | 1 - src/hotspot/share/gc/shared/referenceProcessor.cpp | 3 +-- src/hotspot/share/gc/shared/referenceProcessor.hpp | 2 +- 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 13fce2dd126..d27ac1243ef 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1828,7 +1828,6 @@ void G1CollectedHeap::ref_processing_init() { ParallelGCThreads, // degree of mt processing // We discover with the gc worker threads during Remark, so both // thread counts must be considered for discovery. - (ParallelGCThreads > 1) || (ConcGCThreads > 1), // mt discovery MAX2(ParallelGCThreads, ConcGCThreads), // degree of mt discovery true, // Reference discovery is concurrent &_is_alive_closure_cm); // is alive closure @@ -1837,7 +1836,6 @@ void G1CollectedHeap::ref_processing_init() { _ref_processor_stw = new ReferenceProcessor(&_is_subject_to_discovery_stw, ParallelGCThreads, // degree of mt processing - (ParallelGCThreads > 1), // mt discovery ParallelGCThreads, // degree of mt discovery false, // Reference discovery is not concurrent &_is_alive_closure_stw); // is alive closure diff --git a/src/hotspot/share/gc/parallel/psParallelCompact.cpp b/src/hotspot/share/gc/parallel/psParallelCompact.cpp index 212bd424e63..2a3d95192b6 100644 --- a/src/hotspot/share/gc/parallel/psParallelCompact.cpp +++ b/src/hotspot/share/gc/parallel/psParallelCompact.cpp @@ -852,7 +852,6 @@ public: BoolObjectClosure* is_alive_non_header) : ReferenceProcessor(is_subject_to_discovery, ParallelGCThreads, // mt processing degree - true, // mt discovery ParallelGCThreads, // mt discovery degree true, // atomic_discovery is_alive_non_header) { diff --git a/src/hotspot/share/gc/parallel/psScavenge.cpp b/src/hotspot/share/gc/parallel/psScavenge.cpp index f4a2fce76ec..e3b3e76ca47 100644 --- a/src/hotspot/share/gc/parallel/psScavenge.cpp +++ b/src/hotspot/share/gc/parallel/psScavenge.cpp @@ -799,7 +799,6 @@ void PSScavenge::initialize() { _ref_processor = new ReferenceProcessor(&_span_based_discoverer, ParallelGCThreads, // mt processing degree - true, // mt discovery ParallelGCThreads, // mt discovery degree false, // concurrent_discovery NULL); // header provides liveness info diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index b1b411e4119..e5fbc4df3ea 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -87,7 +87,6 @@ void ReferenceProcessor::enable_discovery(bool check_no_refs) { ReferenceProcessor::ReferenceProcessor(BoolObjectClosure* is_subject_to_discovery, uint mt_processing_degree, - bool mt_discovery, uint mt_discovery_degree, bool concurrent_discovery, BoolObjectClosure* is_alive_non_header) : @@ -99,7 +98,7 @@ ReferenceProcessor::ReferenceProcessor(BoolObjectClosure* is_subject_to_discover assert(is_subject_to_discovery != NULL, "must be set"); _discovery_is_concurrent = concurrent_discovery; - _discovery_is_mt = mt_discovery; + _discovery_is_mt = (mt_discovery_degree > 1); _num_queues = MAX2(1U, mt_processing_degree); _max_num_queues = MAX2(_num_queues, mt_discovery_degree); _discovered_refs = NEW_C_HEAP_ARRAY(DiscoveredList, diff --git a/src/hotspot/share/gc/shared/referenceProcessor.hpp b/src/hotspot/share/gc/shared/referenceProcessor.hpp index 2ab68ab29fe..120a7afe2cf 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp @@ -374,7 +374,7 @@ public: // Default parameters give you a vanilla reference processor. ReferenceProcessor(BoolObjectClosure* is_subject_to_discovery, uint mt_processing_degree = 1, - bool mt_discovery = false, uint mt_discovery_degree = 1, + uint mt_discovery_degree = 1, bool concurrent_discovery = false, BoolObjectClosure* is_alive_non_header = NULL); -- GitLab From 2c06bca98fcf9d129d6085e26c225fb26368a558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Thu, 18 Nov 2021 11:17:00 +0000 Subject: [PATCH 378/890] 8266368: Inaccurate after_unwind hook in C2 exception handler Reviewed-by: dlong, thartmann --- src/hotspot/share/opto/runtime.cpp | 12 ++++++------ src/hotspot/share/runtime/sharedRuntime.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index 7e87da8a46f..a80d9559dd8 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -1280,6 +1280,11 @@ static void trace_exception(outputStream* st, oop exception_oop, address excepti // directly from compiled code. Compiled code will call the C++ method following. // We can't allow async exception to be installed during exception processing. JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* current, nmethod* &nm)) + // The frame we rethrow the exception to might not have been processed by the GC yet. + // The stack watermark barrier takes care of detecting that and ensuring the frame + // has updated oops. + StackWatermarkSet::after_unwind(current); + // Do not confuse exception_oop with pending_exception. The exception_oop // is only used to pass arguments into the method. Not for general // exception handling. DO NOT CHANGE IT to use pending_exception, since @@ -1422,7 +1427,7 @@ address OptoRuntime::handle_exception_C(JavaThread* current) { // deoptimized frame if (nm != NULL) { - RegisterMap map(current, false); + RegisterMap map(current, false /* update_map */, false /* process_frames */); frame caller = current->last_frame().sender(&map); #ifdef ASSERT assert(caller.is_compiled_frame(), "must be"); @@ -1461,11 +1466,6 @@ address OptoRuntime::rethrow_C(oopDesc* exception, JavaThread* thread, address r // Enable WXWrite: the function called directly by compiled code. MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, thread)); - // The frame we rethrow the exception to might not have been processed by the GC yet. - // The stack watermark barrier takes care of detecting that and ensuring the frame - // has updated oops. - StackWatermarkSet::after_unwind(thread); - #ifndef PRODUCT SharedRuntime::_rethrow_ctr++; // count rethrows #endif diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 5ac0c3bdf6b..a5de65ea5ab 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -497,7 +497,7 @@ address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* curr return SharedRuntime::deopt_blob()->unpack_with_exception(); } else { // The deferred StackWatermarkSet::after_unwind check will be performed in - // * OptoRuntime::rethrow_C for C2 code + // * OptoRuntime::handle_exception_C_helper for C2 code // * exception_handler_for_pc_helper via Runtime1::handle_exception_from_callee_id for C1 code return nm->exception_begin(); } -- GitLab From 38345bd28db83371676f1685806ddc207a833879 Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Thu, 18 Nov 2021 11:18:15 +0000 Subject: [PATCH 379/890] 8277137: Set OnSpinWaitInst/OnSpinWaitInstCount defaults to "isb"/1 for Arm Neoverse N1 Reviewed-by: phh, aph, ngasson --- .../cpu/aarch64/vm_version_aarch64.cpp | 8 ++ .../TestOnSpinWaitAArch64DefaultFlags.java | 97 +++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index 48b74e7e50e..b4e75f88d29 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -202,6 +202,14 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) { FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true); } + + if (FLAG_IS_DEFAULT(OnSpinWaitInst)) { + FLAG_SET_DEFAULT(OnSpinWaitInst, "isb"); + } + + if (FLAG_IS_DEFAULT(OnSpinWaitInstCount)) { + FLAG_SET_DEFAULT(OnSpinWaitInstCount, 1); + } } if (_cpu == CPU_ARM) { diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java new file mode 100644 index 00000000000..9d9dbc6ea2f --- /dev/null +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java @@ -0,0 +1,97 @@ +/* + * Copyright Amazon.com Inc. 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 TestOnSpinWaitAArch64DefaultFlags + * @summary Check default values of '-XX:OnSpinWaitInst' and '-XX:OnSpinWaitInstCount' for AArch64 implementations. + * @bug 8277137 + * @library /test/lib / + * + * @requires os.arch=="aarch64" + * + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * compiler.onSpinWait.TestOnSpinWaitAArch64DefaultFlags + */ + +package compiler.onSpinWait; + +import java.util.Iterator; +import java.util.List; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import sun.hotspot.cpuinfo.CPUInfo; + +public class TestOnSpinWaitAArch64DefaultFlags { + private static boolean isCPUModelNeoverseN1(String cpuModel) { + return cpuModel.contains("0xd0c"); + } + + private static void checkFinalFlagsEqualTo(ProcessBuilder pb, String expectedOnSpinWaitInstValue, String expectedOnSpinWaitInstCountValue) throws Exception { + OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); + analyzer.shouldHaveExitValue(0); + + Iterator iter = analyzer.asLines().listIterator(); + String line = null; + boolean hasExpectedOnSpinWaitInstValue = false; + boolean hasExpectedOnSpinWaitInstCountValue = false; + while (iter.hasNext()) { + line = iter.next(); + if (!hasExpectedOnSpinWaitInstValue && line.contains("ccstr OnSpinWaitInst")) { + hasExpectedOnSpinWaitInstValue = line.contains("= " + expectedOnSpinWaitInstValue); + } + + if (!hasExpectedOnSpinWaitInstCountValue && line.contains("uint OnSpinWaitInstCount")) { + hasExpectedOnSpinWaitInstCountValue = line.contains("= " + expectedOnSpinWaitInstCountValue); + } + } + if (!hasExpectedOnSpinWaitInstValue) { + System.out.println(analyzer.getOutput()); + throw new RuntimeException("OnSpinWaitInst with the expected value '" + expectedOnSpinWaitInstValue + "' not found."); + } + if (!hasExpectedOnSpinWaitInstCountValue) { + System.out.println(analyzer.getOutput()); + throw new RuntimeException("OnSpinWaitInstCount with the expected value '" + expectedOnSpinWaitInstCountValue + "' not found."); + } + } + + public static void main(String[] args) throws Exception { + List cpuFeatures = CPUInfo.getFeatures(); + if (cpuFeatures.isEmpty()) { + System.out.println("Skip because no CPU features are available."); + return; + } + + final String cpuModel = cpuFeatures.get(0); + + if (isCPUModelNeoverseN1(cpuModel)) { + checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+PrintFlagsFinal", "-version"), "isb", "1"); + checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"), + "isb", "2"); + } else { + System.out.println("Skip because no defaults for CPU model: " + cpuModel); + } + } +} -- GitLab From b3a62b48816358ac7dadde4e7893190500ca7b79 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Thu, 18 Nov 2021 13:18:37 +0000 Subject: [PATCH 380/890] 8276795: Deprecate seldom used CDS flags Reviewed-by: dholmes, ccheung, iklam --- src/hotspot/share/runtime/arguments.cpp | 4 ++++ src/hotspot/share/runtime/globals.hpp | 12 ++++++------ .../compiler/intrinsics/klass/TestIsPrimitive.java | 4 ++-- .../runtime/CommandLine/VMDeprecatedOptions.java | 6 +++++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index cbbb4b93f1f..89352c1f95e 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -528,6 +528,10 @@ static SpecialFlag const special_jvm_flags[] = { { "FlightRecorder", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() }, { "FilterSpuriousWakeups", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::jdk(20) }, { "MinInliningThreshold", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::jdk(20) }, + { "DumpSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, + { "DynamicDumpSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, + { "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, + { "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 9e82b6d7cad..45f16aefa1f 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1801,21 +1801,21 @@ const intx ObjectAlignmentInBytes = 8; /* Shared spaces */ \ \ product(bool, UseSharedSpaces, true, \ - "Use shared spaces for metadata") \ + "(Deprecated) Use shared spaces for metadata") \ \ product(bool, VerifySharedSpaces, false, \ "Verify integrity of shared spaces") \ \ product(bool, RequireSharedSpaces, false, \ - "Require shared spaces for metadata") \ + "(Deprecated) Require shared spaces for metadata") \ \ product(bool, DumpSharedSpaces, false, \ - "Special mode: JVM reads a class list, loads classes, builds " \ - "shared spaces, and dumps the shared spaces to a file to be " \ - "used in future JVM runs") \ + "(Deprecated) Special mode: JVM reads a class list, loads " \ + "classes, builds shared spaces, and dumps the shared spaces to " \ + "a file to be used in future JVM runs") \ \ product(bool, DynamicDumpSharedSpaces, false, \ - "Dynamic archive") \ + "(Deprecated) Dynamic archive") \ \ product(bool, RecordDynamicDumpInfo, false, \ "Record class info for jcmd VM.cds dynamic_dump") \ diff --git a/test/hotspot/jtreg/compiler/intrinsics/klass/TestIsPrimitive.java b/test/hotspot/jtreg/compiler/intrinsics/klass/TestIsPrimitive.java index 11a18895990..8fe3f5f5a3f 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/klass/TestIsPrimitive.java +++ b/test/hotspot/jtreg/compiler/intrinsics/klass/TestIsPrimitive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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,7 +30,7 @@ * * @run main/othervm -ea -Diters=200 -Xint * compiler.intrinsics.klass.TestIsPrimitive - * @run main/othervm -ea -XX:-UseSharedSpaces -Diters=30000 -XX:TieredStopAtLevel=1 + * @run main/othervm -ea -Xshare:off -Diters=30000 -XX:TieredStopAtLevel=1 * compiler.intrinsics.klass.TestIsPrimitive * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 * compiler.intrinsics.klass.TestIsPrimitive diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index 79f02e4368e..ae1165da8a3 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -47,6 +47,10 @@ public class VMDeprecatedOptions { {"InitialRAMFraction", "64"}, {"TLABStats", "false"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, + {"UseSharedSpaces", "false"}, + {"RequireSharedSpaces", "true"}, + {"DumpSharedSpaces", "true"}, + {"DynamicDumpSharedSpaces", "true"}, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, -- GitLab From a44b45fdf31275a2c1e9d1d0132874a7de45f8ee Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Thu, 18 Nov 2021 13:48:12 +0000 Subject: [PATCH 381/890] 4337793: Mark non-serializable fields of java.security.cert.Certificate and CertPath Reviewed-by: valeriep, rriggs --- .../classes/java/security/cert/CertPath.java | 19 ++++++----- .../java/security/cert/Certificate.java | 32 +++++++++++-------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/java.base/share/classes/java/security/cert/CertPath.java b/src/java.base/share/classes/java/security/cert/CertPath.java index 28000591c00..15f49ac3381 100644 --- a/src/java.base/share/classes/java/security/cert/CertPath.java +++ b/src/java.base/share/classes/java/security/cert/CertPath.java @@ -123,7 +123,7 @@ public abstract class CertPath implements Serializable { private static final long serialVersionUID = 6068470306649138683L; /** The type of certificates in this chain. */ - private String type; + private final transient String type; /** * Creates a {@code CertPath} of the specified type. @@ -270,9 +270,11 @@ public abstract class CertPath implements Serializable { /** * Replaces the {@code CertPath} to be serialized with a - * {@code CertPathRep} object. + * {@link CertPathRep CertPathRep} object containing the + * {@code Certificate} type and encoded bytes of the {@code CertPath}. * - * @return the {@code CertPathRep} to be serialized + * @return a {@code CertPathRep} containing the {@code Certificate} type + * and encoded bytes of the {@code CertPath} * * @throws ObjectStreamException if a {@code CertPathRep} object * representing this certification path could not be created @@ -299,16 +301,16 @@ public abstract class CertPath implements Serializable { @java.io.Serial private static final long serialVersionUID = 3015633072427920915L; - /** The Certificate type */ + /** The type of {@code Certificate}s in the {@code CertPath}. */ private String type; - /** The encoded form of the cert path */ + /** The encoded form of the {@code CertPath}. */ private byte[] data; /** * Creates a {@code CertPathRep} with the specified * type and encoded form of a certification path. * - * @param type the standard name of a {@code CertPath} type + * @param type the standard name of a {@code Certificate} type * @param data the encoded form of the certification path */ protected CertPathRep(String type, byte[] data) { @@ -317,11 +319,12 @@ public abstract class CertPath implements Serializable { } /** - * Returns a {@code CertPath} constructed from the type and data. + * Returns a {@code CertPath} constructed from the type and data of + * this {@code CertPathRep}. * * @return the resolved {@code CertPath} object * - * @throws ObjectStreamException if a {@code CertPath} could not + * @throws ObjectStreamException if a {@code CertPath} object could not * be constructed */ @java.io.Serial diff --git a/src/java.base/share/classes/java/security/cert/Certificate.java b/src/java.base/share/classes/java/security/cert/Certificate.java index a34f0316a8c..4a020ddf1cb 100644 --- a/src/java.base/share/classes/java/security/cert/Certificate.java +++ b/src/java.base/share/classes/java/security/cert/Certificate.java @@ -66,10 +66,10 @@ public abstract class Certificate implements java.io.Serializable { private static final long serialVersionUID = -3585440601605666277L; /** The certificate type. */ - private final String type; + private final transient String type; /** The hash code for the certificate. */ - private int hash = -1; // Default to -1 + private transient int hash = -1; // Default to -1 /** * Creates a certificate of the specified type. @@ -236,7 +236,7 @@ public abstract class Certificate implements java.io.Serializable { public abstract PublicKey getPublicKey(); /** - * Alternate Certificate class for serialization. + * Alternate {@code Certificate} class for serialization. * @since 1.3 */ protected static class CertificateRep implements java.io.Serializable { @@ -251,12 +251,12 @@ public abstract class Certificate implements java.io.Serializable { private byte[] data; /** - * Construct the alternate Certificate class with the Certificate - * type and Certificate encoding bytes. + * Construct the alternate {@code Certificate} class with the + * {@code Certificate} type and {@code Certificate} encoding bytes. * - * @param type the standard name of the Certificate type. + * @param type the standard name of the {@code Certificate} type. * - * @param data the Certificate data. + * @param data the {@code Certificate} data. */ protected CertificateRep(String type, byte[] data) { this.type = type; @@ -264,11 +264,12 @@ public abstract class Certificate implements java.io.Serializable { } /** - * Resolve the Certificate Object. + * Returns a {@code Certificate} with the type and data of this + * {@code CertificateRep}. * - * @return the resolved Certificate Object + * @return the resolved {@code Certificate} object * - * @throws java.io.ObjectStreamException if the Certificate + * @throws java.io.ObjectStreamException if the {@code Certificate} * could not be resolved */ @java.io.Serial @@ -288,12 +289,15 @@ public abstract class Certificate implements java.io.Serializable { } /** - * Replace the Certificate to be serialized. + * Replace the {@code Certificate} to be serialized with a + * {@link CertificateRep CertificateRep} object containing the type and + * encoded bytes of the {@code Certificate}. * - * @return the alternate Certificate object to be serialized + * @return a {@code CertificateRep} object containing the type and encoded + * bytes of the {@code Certificate} * - * @throws java.io.ObjectStreamException if a new object representing - * this Certificate could not be created + * @throws java.io.ObjectStreamException if a {@code CertificateRep} object + * representing this {@code Certificate} could not be created * @since 1.3 */ @java.io.Serial -- GitLab From 00c388b4aba41d5f0874585e9c0a33c4571805f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Thu, 18 Nov 2021 14:32:59 +0000 Subject: [PATCH 382/890] 8259643: ZGC can return metaspace OOM prematurely Reviewed-by: stefank, pliden, stuefe --- src/hotspot/share/gc/z/zCollectedHeap.cpp | 24 +-- src/hotspot/share/memory/metaspace.cpp | 10 + .../memory/metaspaceCriticalAllocation.cpp | 178 ++++++++++++++++++ .../memory/metaspaceCriticalAllocation.hpp | 84 +++++++++ src/hotspot/share/runtime/mutexLocker.cpp | 2 + src/hotspot/share/runtime/mutexLocker.hpp | 3 +- 6 files changed, 280 insertions(+), 21 deletions(-) create mode 100644 src/hotspot/share/memory/metaspaceCriticalAllocation.cpp create mode 100644 src/hotspot/share/memory/metaspaceCriticalAllocation.hpp diff --git a/src/hotspot/share/gc/z/zCollectedHeap.cpp b/src/hotspot/share/gc/z/zCollectedHeap.cpp index e07ec3e80c7..1d099122315 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.cpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp @@ -38,6 +38,7 @@ #include "gc/z/zUtils.inline.hpp" #include "memory/classLoaderMetaspace.hpp" #include "memory/iterator.hpp" +#include "memory/metaspaceCriticalAllocation.hpp" #include "memory/universe.hpp" #include "utilities/align.hpp" @@ -153,34 +154,17 @@ HeapWord* ZCollectedHeap::mem_allocate(size_t size, bool* gc_overhead_limit_was_ MetaWord* ZCollectedHeap::satisfy_failed_metadata_allocation(ClassLoaderData* loader_data, size_t size, Metaspace::MetadataType mdtype) { - MetaWord* result; - // Start asynchronous GC collect(GCCause::_metadata_GC_threshold); // Expand and retry allocation - result = loader_data->metaspace_non_null()->expand_and_allocate(size, mdtype); - if (result != NULL) { - return result; - } - - // Start synchronous GC - collect(GCCause::_metadata_GC_clear_soft_refs); - - // Retry allocation - result = loader_data->metaspace_non_null()->allocate(size, mdtype); - if (result != NULL) { - return result; - } - - // Expand and retry allocation - result = loader_data->metaspace_non_null()->expand_and_allocate(size, mdtype); + MetaWord* const result = loader_data->metaspace_non_null()->expand_and_allocate(size, mdtype); if (result != NULL) { return result; } - // Out of memory - return NULL; + // As a last resort, try a critical allocation, riding on a synchronous full GC + return MetaspaceCriticalAllocation::allocate(loader_data, size, mdtype); } void ZCollectedHeap::collect(GCCause::Cause cause) { diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index e19383675b4..d2fadba3a09 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -31,6 +31,7 @@ #include "logging/logStream.hpp" #include "memory/classLoaderMetaspace.hpp" #include "memory/metaspace.hpp" +#include "memory/metaspaceCriticalAllocation.hpp" #include "memory/metaspace/chunkHeaderPool.hpp" #include "memory/metaspace/chunkManager.hpp" #include "memory/metaspace/commitLimiter.hpp" @@ -877,6 +878,9 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, assert(loader_data != NULL, "Should never pass around a NULL loader_data. " "ClassLoaderData::the_null_class_loader_data() should have been used."); + // Deal with concurrent unloading failed allocation starvation + MetaspaceCriticalAllocation::block_if_concurrent_purge(); + MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType; // Try to allocate metadata. @@ -992,6 +996,10 @@ const char* Metaspace::metadata_type_name(Metaspace::MetadataType mdtype) { } void Metaspace::purge() { + // The MetaspaceCritical_lock is used by a concurrent GC to block out concurrent metaspace + // allocations, that would starve critical metaspace allocations, that are about to throw + // OOM if they fail; they need precedence for correctness. + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); ChunkManager* cm = ChunkManager::chunkmanager_nonclass(); if (cm != NULL) { cm->purge(); @@ -1002,6 +1010,8 @@ void Metaspace::purge() { cm->purge(); } } + + MetaspaceCriticalAllocation::satisfy(); } bool Metaspace::contains(const void* ptr) { diff --git a/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp b/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp new file mode 100644 index 00000000000..1edb67bf7f4 --- /dev/null +++ b/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2021, 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 "classfile/classLoaderData.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "logging/log.hpp" +#include "memory/classLoaderMetaspace.hpp" +#include "memory/metaspaceCriticalAllocation.hpp" +#include "memory/universe.hpp" +#include "runtime/interfaceSupport.inline.hpp" +#include "runtime/mutexLocker.hpp" + +class MetadataAllocationRequest { + ClassLoaderData* _loader_data; + size_t _word_size; + Metaspace::MetadataType _type; + MetadataAllocationRequest* _next; + MetaWord* _result; + bool _has_result; + +public: + MetadataAllocationRequest(ClassLoaderData* loader_data, + size_t word_size, + Metaspace::MetadataType type) + : _loader_data(loader_data), + _word_size(word_size), + _type(type), + _next(NULL), + _result(NULL), + _has_result(false) { + MetaspaceCriticalAllocation::add(this); + } + + ~MetadataAllocationRequest() { + MetaspaceCriticalAllocation::remove(this); + } + + ClassLoaderData* loader_data() const { return _loader_data; } + size_t word_size() const { return _word_size; } + Metaspace::MetadataType type() const { return _type; } + MetadataAllocationRequest* next() const { return _next; } + MetaWord* result() const { return _result; } + bool has_result() const { return _has_result; } + + void set_next(MetadataAllocationRequest* next) { _next = next; } + void set_result(MetaWord* result) { + _result = result; + _has_result = true; + } +}; + +volatile bool MetaspaceCriticalAllocation::_has_critical_allocation = false; +MetadataAllocationRequest* MetaspaceCriticalAllocation::_requests_head = NULL; +MetadataAllocationRequest* MetaspaceCriticalAllocation::_requests_tail = NULL; + +void MetaspaceCriticalAllocation::add(MetadataAllocationRequest* request) { + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); + log_info(metaspace)("Requesting critical metaspace allocation; almost out of memory"); + Atomic::store(&_has_critical_allocation, true); + if (_requests_head == NULL) { + _requests_head = _requests_tail = request; + } else { + _requests_tail->set_next(request); + _requests_tail = request; + } +} + +void MetaspaceCriticalAllocation::unlink(MetadataAllocationRequest* curr, MetadataAllocationRequest* prev) { + if (_requests_head == curr) { + _requests_head = curr->next(); + } + if (_requests_tail == curr) { + _requests_tail = prev; + } + if (prev != NULL) { + prev->set_next(curr->next()); + } +} + +void MetaspaceCriticalAllocation::remove(MetadataAllocationRequest* request) { + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); + MetadataAllocationRequest* prev = NULL; + for (MetadataAllocationRequest* curr = _requests_head; curr != NULL; curr = curr->next()) { + if (curr == request) { + unlink(curr, prev); + break; + } else { + prev = curr; + } + } +} + +bool MetaspaceCriticalAllocation::try_allocate_critical(MetadataAllocationRequest* request) { + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); + if (_requests_head == request) { + // The first request can't opportunistically ride on a previous GC + return false; + } + // Try to ride on a previous GC and hope for early satisfaction + wait_for_purge(request); + return request->result() != NULL; +} + +void MetaspaceCriticalAllocation::wait_for_purge(MetadataAllocationRequest* request) { + while (!request->has_result()) { + ThreadBlockInVM tbivm(JavaThread::current()); + MetaspaceCritical_lock->wait_without_safepoint_check(); + } +} + +void MetaspaceCriticalAllocation::block_if_concurrent_purge() { + if (Atomic::load(&_has_critical_allocation)) { + // If there is a concurrent Metaspace::purge() operation, we will block here, + // to make sure critical allocations get precedence and don't get starved. + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); + } +} + +void MetaspaceCriticalAllocation::satisfy() { + assert_lock_strong(MetaspaceCritical_lock); + bool all_satisfied = true; + for (MetadataAllocationRequest* curr = _requests_head; curr != NULL; curr = curr->next()) { + if (curr->result() != NULL) { + // Don't satisfy twice + continue; + } + // Try to allocate metadata. + MetaWord* result = curr->loader_data()->metaspace_non_null()->allocate(curr->word_size(), curr->type()); + if (result == NULL) { + result = curr->loader_data()->metaspace_non_null()->expand_and_allocate(curr->word_size(), curr->type()); + } + if (result == NULL) { + all_satisfied = false; + } + curr->set_result(result); + } + if (all_satisfied) { + Atomic::store(&_has_critical_allocation, false); + } + MetaspaceCritical_lock->notify_all(); +} + +MetaWord* MetaspaceCriticalAllocation::allocate(ClassLoaderData* loader_data, size_t word_size, Metaspace::MetadataType type) { + MetadataAllocationRequest request(loader_data, word_size, type); + + if (try_allocate_critical(&request)) { + // Try to allocate on a previous concurrent GC if there was one, and return if successful + return request.result(); + } + + // Always perform a synchronous full GC before bailing + Universe::heap()->collect(GCCause::_metadata_GC_clear_soft_refs); + + // Return the result, be that success or failure + return request.result(); +} diff --git a/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp b/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp new file mode 100644 index 00000000000..71e8819aef3 --- /dev/null +++ b/src/hotspot/share/memory/metaspaceCriticalAllocation.hpp @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021, 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_MEMORY_METASPACECRITICALALLOCATION_HPP +#define SHARE_MEMORY_METASPACECRITICALALLOCATION_HPP + +#include "memory/allocation.hpp" +#include "memory/metaspace.hpp" + +class MetadataAllocationRequest; +class ClassLoaderData; + +// == Critical allocation support == +// +// The critical allocation support has the purpose of preventing starvation of failed +// metadata allocations that need a GC, in particular for concurrent GCs. +// A "critical" allocation request is registered, then a concurrent full GC is executed. +// When there is any critical allocation present in the system, allocations compete for +// a global lock, so that allocations can be shut out from the concurrent purge() call, +// which takes the same lock. The reasoning is that we gather all the critical allocations +// that are one more failure away from throwing metaspace OOM, in a queue before the GC, +// then free up metaspace due to class unloading in the purge() operation of that GC, +// and satisfy the registered critical allocations. This allows the critical allocations +// to get precedence over normal metaspace allocations, so that the critical allocations +// that are about to throw, do not get starved by other metaspace allocations that have +// not gone through the same dance. +// +// The solution has an intended accuracy of not one allocation, but one per thread. What +// I mean by that, is that the allocations are allowed to throw if they got starved by +// one metaspace allocation per thread, even though a more complicated dance could have +// survived that situation in theory. The motivation is that we are at this point so close +// to being out of memory, and the VM is not having a good time, so the user really ought +// to increase the amount of available metaspace anyway, instead of GC:ing around more +// to satisfy a very small number of additional allocations. But it does solve pathologial +// unbounded starvation scenarios where OOM can get thrown even though most of metaspace +// is full of dead metadata. +// +// The contract for this to work for a given GC is that GCCause::_metadata_GC_clear_soft_refs +// yields a full synchronous GC that unloads metaspace. And it is only intended to be used +// by GCs with concurrent class unloading. + +class MetaspaceCriticalAllocation : public AllStatic { + friend class MetadataAllocationRequest; + + static volatile bool _has_critical_allocation; + static MetadataAllocationRequest* _requests_head; + static MetadataAllocationRequest* _requests_tail; + + static void unlink(MetadataAllocationRequest* curr, MetadataAllocationRequest* prev); + + static void add(MetadataAllocationRequest* request); + static void remove(MetadataAllocationRequest* request); + + static bool try_allocate_critical(MetadataAllocationRequest* request); + static void wait_for_purge(MetadataAllocationRequest* request); + +public: + static void block_if_concurrent_purge(); + static void satisfy(); + static MetaWord* allocate(ClassLoaderData* loader_data, size_t word_size, Metaspace::MetadataType type); +}; + +#endif // SHARE_MEMORY_METASPACECRITICALALLOCATION_HPP diff --git a/src/hotspot/share/runtime/mutexLocker.cpp b/src/hotspot/share/runtime/mutexLocker.cpp index 39770473e16..257f853fb92 100644 --- a/src/hotspot/share/runtime/mutexLocker.cpp +++ b/src/hotspot/share/runtime/mutexLocker.cpp @@ -131,6 +131,7 @@ Mutex* UnsafeJlong_lock = NULL; Mutex* CodeHeapStateAnalytics_lock = NULL; Mutex* Metaspace_lock = NULL; +Monitor* MetaspaceCritical_lock = NULL; Mutex* ClassLoaderDataGraph_lock = NULL; Monitor* ThreadsSMRDelete_lock = NULL; Mutex* ThreadIdTableCreate_lock = NULL; @@ -243,6 +244,7 @@ void mutex_init() { def(RawMonitor_lock , PaddedMutex , nosafepoint-1); def(Metaspace_lock , PaddedMutex , nosafepoint-3); + def(MetaspaceCritical_lock , PaddedMonitor, nosafepoint-1); def(Patching_lock , PaddedMutex , nosafepoint); // used for safepointing and code patching. def(MonitorDeflation_lock , PaddedMonitor, nosafepoint); // used for monitor deflation thread operations diff --git a/src/hotspot/share/runtime/mutexLocker.hpp b/src/hotspot/share/runtime/mutexLocker.hpp index e5916fb47a6..a40b0592cc4 100644 --- a/src/hotspot/share/runtime/mutexLocker.hpp +++ b/src/hotspot/share/runtime/mutexLocker.hpp @@ -139,7 +139,8 @@ extern Monitor* JfrThreadSampler_lock; // used to suspend/resume JFR t extern Mutex* UnsafeJlong_lock; // provides Unsafe atomic updates to jlongs on platforms that don't support cx8 #endif -extern Mutex* Metaspace_lock; // protects Metaspace virtualspace and chunk expansions +extern Mutex* Metaspace_lock; // protects Metaspace virtualspace and chunk expansions +extern Monitor* MetaspaceCritical_lock; // synchronizes failed metaspace allocations that risk throwing metaspace OOM extern Mutex* ClassLoaderDataGraph_lock; // protects CLDG list, needed for concurrent unloading -- GitLab From d93b238f9725727ae1e2e9f203943b5ddf778f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Thu, 18 Nov 2021 14:44:58 +0000 Subject: [PATCH 383/890] 8277180: Intrinsify recursive ObjectMonitor locking for C2 x64 and A64 Reviewed-by: aph, ngasson --- src/hotspot/cpu/aarch64/aarch64.ad | 26 ++++++++++++++++--- src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp | 25 +++++++++++------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index a1236d032e6..11c6ec7df0a 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -3945,7 +3945,7 @@ encode %{ // Try to CAS m->owner from NULL to current thread. __ add(tmp, disp_hdr, (ObjectMonitor::owner_offset_in_bytes()-markWord::monitor_value)); __ cmpxchg(tmp, zr, rthread, Assembler::xword, /*acquire*/ true, - /*release*/ true, /*weak*/ false, noreg); // Sets flags for result + /*release*/ true, /*weak*/ false, rscratch1); // Sets flags for result // Store a non-null value into the box to avoid looking like a re-entrant // lock. The fast-path monitor unlock code checks for @@ -3954,6 +3954,15 @@ encode %{ __ mov(tmp, (address)markWord::unused_mark().value()); __ str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes())); + __ br(Assembler::EQ, cont); // CAS success means locking succeeded + + __ cmp(rscratch1, rthread); + __ br(Assembler::NE, cont); // Check for recursive locking + + // Recursive lock case + __ increment(Address(disp_hdr, ObjectMonitor::recursions_offset_in_bytes() - markWord::monitor_value), 1); + // flag == EQ still from the cmp above, checking if this is a reentrant lock + __ bind(cont); // flag == EQ indicates success // flag == NE indicates failure @@ -3997,11 +4006,20 @@ encode %{ __ add(tmp, tmp, -(int)markWord::monitor_value); // monitor __ ldr(rscratch1, Address(tmp, ObjectMonitor::owner_offset_in_bytes())); __ ldr(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset_in_bytes())); - __ eor(rscratch1, rscratch1, rthread); // Will be 0 if we are the owner. - __ orr(rscratch1, rscratch1, disp_hdr); // Will be 0 if there are 0 recursions - __ cmp(rscratch1, zr); // Sets flags for result + + Label notRecursive; + __ cmp(rscratch1, rthread); __ br(Assembler::NE, cont); + __ cbz(disp_hdr, notRecursive); + + // Recursive lock + __ sub(disp_hdr, disp_hdr, 1u); + __ str(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset_in_bytes())); + // flag == EQ was set in the ownership check above + __ b(cont); + + __ bind(notRecursive); __ ldr(rscratch1, Address(tmp, ObjectMonitor::EntryList_offset_in_bytes())); __ ldr(disp_hdr, Address(tmp, ObjectMonitor::cxq_offset_in_bytes())); __ orr(rscratch1, rscratch1, disp_hdr); // Will be 0 if both are 0. diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index df3501974c4..5e4c8917612 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -574,8 +574,13 @@ void C2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmp // Unconditionally set box->_displaced_header = markWord::unused_mark(). // Without cast to int32_t this style of movptr will destroy r10 which is typically obj. movptr(Address(boxReg, 0), (int32_t)intptr_t(markWord::unused_mark().value())); - // Intentional fall-through into DONE_LABEL ... // Propagate ICC.ZF from CAS above into DONE_LABEL. + jcc(Assembler::equal, DONE_LABEL); // CAS above succeeded; propagate ZF = 1 (success) + + cmpptr(r15_thread, rax); // Check if we are already the owner (recursive lock) + jcc(Assembler::notEqual, DONE_LABEL); // If not recursive, ZF = 0 at this point (fail) + incq(Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); + xorq(rax, rax); // Set ZF = 1 (success) for recursive lock, denoting locking success #endif // _LP64 #if INCLUDE_RTM_OPT } // use_rtm() @@ -670,10 +675,6 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t // Refer to the comments in synchronizer.cpp for how we might encode extra // state in _succ so we can avoid fetching EntryList|cxq. // - // I'd like to add more cases in fast_lock() and fast_unlock() -- - // such as recursive enter and exit -- but we have to be wary of - // I$ bloat, T$ effects and BP$ effects. - // // If there's no contention try a 1-0 exit. That is, exit without // a costly MEMBAR or CAS. See synchronizer.cpp for details on how // we detect and recover from the race that the 1-0 exit admits. @@ -721,9 +722,16 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t bind (CheckSucc); #else // _LP64 // It's inflated - xorptr(boxReg, boxReg); - orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); - jccb (Assembler::notZero, DONE_LABEL); + Label LNotRecursive, LSuccess, LGoSlowPath; + + cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)), 0); + jccb(Assembler::equal, LNotRecursive); + + // Recursive inflated unlock + decq(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions))); + jmpb(LSuccess); + + bind(LNotRecursive); movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(cxq))); orptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(EntryList))); jccb (Assembler::notZero, CheckSucc); @@ -732,7 +740,6 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t jmpb (DONE_LABEL); // Try to avoid passing control into the slow_path ... - Label LSuccess, LGoSlowPath ; bind (CheckSucc); // The following optional optimization can be elided if necessary -- GitLab From 276bfcd1a115f90dde644abef79d64bb61788c75 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Thu, 18 Nov 2021 15:17:59 +0000 Subject: [PATCH 384/890] 8277407: javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java fails to compile after JDK-8276058 Reviewed-by: dcubed --- .../swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java b/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java index 684e5efe0b6..be9c9457fff 100644 --- a/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java +++ b/test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java @@ -80,7 +80,7 @@ public class bug6276188 { robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); - Color color = robot.getPixelColor(p.x - OFFSET_X, p.y - OFFSET_y); + Color color = robot.getPixelColor(p.x - OFFSET_X, p.y - OFFSET_Y); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); boolean red = color.getRed() > 0 && color.getGreen() == 0 && color.getBlue() == 0; -- GitLab From 354a34ea2077c9372e585adb1303df604827a2e2 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 18 Nov 2021 15:54:04 +0000 Subject: [PATCH 385/890] 8277336: Improve CollectedHeap::safepoint_workers comments Reviewed-by: sjohanss, tschatzl --- src/hotspot/share/gc/shared/collectedHeap.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp index efac5e76c86..4418a9d31ef 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.hpp +++ b/src/hotspot/share/gc/shared/collectedHeap.hpp @@ -461,14 +461,15 @@ class CollectedHeap : public CHeapObj { // this collector. The default implementation returns false. virtual bool supports_concurrent_gc_breakpoints() const; - // Provides a thread pool to SafepointSynchronize to use - // for parallel safepoint cleanup. - // GCs that use a GC worker thread pool may want to share - // it for use during safepoint cleanup. This is only possible - // if the GC can pause and resume concurrent work (e.g. G1 - // concurrent marking) for an intermittent non-GC safepoint. - // If this method returns NULL, SafepointSynchronize will - // perform cleanup tasks serially in the VMThread. + // Workers used in non-GC safepoints for parallel safepoint cleanup. If this + // method returns NULL, cleanup tasks are done serially in the VMThread. See + // `SafepointSynchronize::do_cleanup_tasks` for details. + // GCs using a GC worker thread pool inside GC safepoints may opt to share + // that pool with non-GC safepoints, avoiding creating extraneous threads. + // Such sharing is safe, because GC safepoints and non-GC safepoints never + // overlap. For example, `G1CollectedHeap::workers()` (for GC safepoints) and + // `G1CollectedHeap::safepoint_workers()` (for non-GC safepoints) return the + // same thread-pool. virtual WorkerThreads* safepoint_workers() { return NULL; } // Support for object pinning. This is used by JNI Get*Critical() -- GitLab From 5d249c46abc8dfdc3acdaff41d26f3bd9ba84731 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Thu, 18 Nov 2021 16:07:38 +0000 Subject: [PATCH 386/890] 8275071: [macos] A11y cursor gets stuck when combobox is closed Reviewed-by: serb, pbansal --- .../classes/sun/lwawt/macosx/CAccessible.java | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java index b59c8cfe574..d983635f9e9 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java @@ -164,24 +164,18 @@ class CAccessible extends CFRetainedResource implements Accessible { treeNodeCollapsed(ptr); } - // At least for now don't handle combo box menu state changes. - // This may change when later fixing issues which currently - // exist for combo boxes, but for now the following is only - // for JPopupMenus, not for combobox menus. - if (parentRole != AccessibleRole.COMBO_BOX) { - if (thisRole == AccessibleRole.POPUP_MENU) { - if ( newValue != null && - ((AccessibleState)newValue) == AccessibleState.VISIBLE ) { - menuOpened(ptr); - } else if ( oldValue != null && - ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) { - menuClosed(ptr); - } - } else if (thisRole == AccessibleRole.MENU_ITEM) { - if ( newValue != null && - ((AccessibleState)newValue) == AccessibleState.FOCUSED ) { - menuItemSelected(ptr); - } + if (thisRole == AccessibleRole.POPUP_MENU) { + if ( newValue != null && + ((AccessibleState)newValue) == AccessibleState.VISIBLE ) { + menuOpened(ptr); + } else if ( oldValue != null && + ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) { + menuClosed(ptr); + } + } else if (thisRole == AccessibleRole.MENU_ITEM) { + if ( newValue != null && + ((AccessibleState)newValue) == AccessibleState.FOCUSED ) { + menuItemSelected(ptr); } } -- GitLab From ce0f00f66e78a504d5e40a25fa213325ec0af394 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Thu, 18 Nov 2021 16:59:41 +0000 Subject: [PATCH 387/890] 8276093: Improve naming in closures to iterate over card sets Reviewed-by: sjohanss, ayang --- src/hotspot/share/gc/g1/g1CardSet.cpp | 53 ++++++++++--------- src/hotspot/share/gc/g1/g1CardSet.hpp | 12 ++--- src/hotspot/share/gc/g1/g1CardSet.inline.hpp | 18 +++---- .../share/gc/g1/heapRegionRemSet.inline.hpp | 30 +++++------ test/hotspot/gtest/gc/g1/test_g1CardSet.cpp | 10 ++-- 5 files changed, 62 insertions(+), 61 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index cabe8573f88..e9c986ebc53 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -231,9 +231,9 @@ class G1CardSetHashTable : public CHeapObj { }; class G1CardSetHashTableScan : public StackObj { - G1CardSet::G1CardSetPtrIterator* _scan_f; + G1CardSet::CardSetPtrClosure* _scan_f; public: - explicit G1CardSetHashTableScan(G1CardSet::G1CardSetPtrIterator* f) : _scan_f(f) { } + explicit G1CardSetHashTableScan(G1CardSet::CardSetPtrClosure* f) : _scan_f(f) { } bool operator()(G1CardSetHashTableValue* value) { _scan_f->do_cardsetptr(value->_region_idx, value->_num_occupied, value->_card_set); @@ -284,12 +284,12 @@ public: return found.value(); } - void iterate_safepoint(G1CardSet::G1CardSetPtrIterator* cl2) { + void iterate_safepoint(G1CardSet::CardSetPtrClosure* cl2) { G1CardSetHashTableScan cl(cl2); _table.do_safepoint_scan(cl); } - void iterate(G1CardSet::G1CardSetPtrIterator* cl2) { + void iterate(G1CardSet::CardSetPtrClosure* cl2) { G1CardSetHashTableScan cl(cl2); _table.do_scan(Thread::current(), cl); } @@ -800,7 +800,7 @@ void G1CardSet::print_info(outputStream* st, uint card_region, uint card_in_regi } template -void G1CardSet::iterate_cards_during_transfer(CardSetPtr const card_set, CardVisitor& found) { +void G1CardSet::iterate_cards_during_transfer(CardSetPtr const card_set, CardVisitor& cl) { uint type = card_set_type(card_set); assert(type == CardSetInlinePtr || type == CardSetArrayOfCards, "invalid card set type %d to transfer from", @@ -809,11 +809,11 @@ void G1CardSet::iterate_cards_during_transfer(CardSetPtr const card_set, CardVis switch (type) { case CardSetInlinePtr: { G1CardSetInlinePtr ptr(card_set); - ptr.iterate(found, _config->inline_ptr_bits_per_card()); + ptr.iterate(cl, _config->inline_ptr_bits_per_card()); return; } case CardSetArrayOfCards : { - card_set_ptr(card_set)->iterate(found); + card_set_ptr(card_set)->iterate(cl); return; } default: @@ -821,56 +821,57 @@ void G1CardSet::iterate_cards_during_transfer(CardSetPtr const card_set, CardVis } } -void G1CardSet::iterate_containers(G1CardSetPtrIterator* found, bool at_safepoint) { +void G1CardSet::iterate_containers(CardSetPtrClosure* cl, bool at_safepoint) { if (at_safepoint) { - _table->iterate_safepoint(found); + _table->iterate_safepoint(cl); } else { - _table->iterate(found); + _table->iterate(cl); } } +// Applied to all card (ranges) of the containers. template -class G1ContainerCards { - Closure& _iter; +class G1ContainerCardsClosure { + Closure& _cl; uint _region_idx; public: - G1ContainerCards(Closure& iter, uint region_idx) : _iter(iter), _region_idx(region_idx) { } + G1ContainerCardsClosure(Closure& cl, uint region_idx) : _cl(cl), _region_idx(region_idx) { } bool start_iterate(uint tag) { return true; } void operator()(uint card_idx) { - _iter.do_card(_region_idx, card_idx); + _cl.do_card(_region_idx, card_idx); } void operator()(uint card_idx, uint length) { for (uint i = 0; i < length; i++) { - _iter.do_card(_region_idx, card_idx); + _cl.do_card(_region_idx, card_idx); } } }; template class CardOrRanges> -class G1CardSetIterateCardsIterator : public G1CardSet::G1CardSetPtrIterator { +class G1CardSetContainersClosure : public G1CardSet::CardSetPtrClosure { G1CardSet* _card_set; - Closure& _iter; + Closure& _cl; public: - G1CardSetIterateCardsIterator(G1CardSet* card_set, - Closure& iter) : + G1CardSetContainersClosure(G1CardSet* card_set, + Closure& cl) : _card_set(card_set), - _iter(iter) { } + _cl(cl) { } void do_cardsetptr(uint region_idx, size_t num_occupied, G1CardSet::CardSetPtr card_set) override { - CardOrRanges cl(_iter, region_idx); + CardOrRanges cl(_cl, region_idx); _card_set->iterate_cards_or_ranges_in_container(card_set, cl); } }; -void G1CardSet::iterate_cards(G1CardSetCardIterator& iter) { - G1CardSetIterateCardsIterator cl(this, iter); - iterate_containers(&cl); +void G1CardSet::iterate_cards(CardClosure& cl) { + G1CardSetContainersClosure cl2(this, cl); + iterate_containers(&cl2); } bool G1CardSet::occupancy_less_or_equal_to(size_t limit) const { @@ -886,11 +887,11 @@ size_t G1CardSet::occupied() const { } size_t G1CardSet::num_containers() { - class GetNumberOfContainers : public G1CardSetPtrIterator { + class GetNumberOfContainers : public CardSetPtrClosure { public: size_t _count; - GetNumberOfContainers() : G1CardSetPtrIterator(), _count(0) { } + GetNumberOfContainers() : CardSetPtrClosure(), _count(0) { } void do_cardsetptr(uint region_idx, size_t num_occupied, CardSetPtr card_set) override { _count++; diff --git a/src/hotspot/share/gc/g1/g1CardSet.hpp b/src/hotspot/share/gc/g1/g1CardSet.hpp index 937bc99a919..c8e09cec126 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.hpp @@ -291,7 +291,7 @@ private: // // on the given class. template - void iterate_cards_during_transfer(CardSetPtr const card_set, CardVisitor& found); + void iterate_cards_during_transfer(CardSetPtr const card_set, CardVisitor& vl); uint card_set_type_to_mem_object_type(uintptr_t type) const; uint8_t* allocate_mem_object(uintptr_t type); @@ -353,21 +353,21 @@ public: // start_iterate(). // template - void iterate_cards_or_ranges_in_container(CardSetPtr const card_set, CardOrRangeVisitor& found); + void iterate_cards_or_ranges_in_container(CardSetPtr const card_set, CardOrRangeVisitor& cl); - class G1CardSetPtrIterator { + class CardSetPtrClosure { public: virtual void do_cardsetptr(uint region_idx, size_t num_occupied, CardSetPtr card_set) = 0; }; - void iterate_containers(G1CardSetPtrIterator* iter, bool safepoint = false); + void iterate_containers(CardSetPtrClosure* cl, bool safepoint = false); - class G1CardSetCardIterator { + class CardClosure { public: virtual void do_card(uint region_idx, uint card_idx) = 0; }; - void iterate_cards(G1CardSetCardIterator& iter); + void iterate_cards(CardClosure& cl); }; class G1CardSetHashTableValue { diff --git a/src/hotspot/share/gc/g1/g1CardSet.inline.hpp b/src/hotspot/share/gc/g1/g1CardSet.inline.hpp index 4ebc8f664a9..99938b4b74e 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.inline.hpp @@ -42,18 +42,18 @@ inline G1CardSet::CardSetPtr G1CardSet::make_card_set_ptr(void* value, uintptr_t } template -inline void G1CardSet::iterate_cards_or_ranges_in_container(CardSetPtr const card_set, CardOrRangeVisitor& found) { +inline void G1CardSet::iterate_cards_or_ranges_in_container(CardSetPtr const card_set, CardOrRangeVisitor& cl) { switch (card_set_type(card_set)) { case CardSetInlinePtr: { - if (found.start_iterate(G1GCPhaseTimes::MergeRSMergedInline)) { + if (cl.start_iterate(G1GCPhaseTimes::MergeRSMergedInline)) { G1CardSetInlinePtr ptr(card_set); - ptr.iterate(found, _config->inline_ptr_bits_per_card()); + ptr.iterate(cl, _config->inline_ptr_bits_per_card()); } return; } case CardSetArrayOfCards : { - if (found.start_iterate(G1GCPhaseTimes::MergeRSMergedArrayOfCards)) { - card_set_ptr(card_set)->iterate(found); + if (cl.start_iterate(G1GCPhaseTimes::MergeRSMergedArrayOfCards)) { + card_set_ptr(card_set)->iterate(cl); } return; } @@ -65,13 +65,13 @@ inline void G1CardSet::iterate_cards_or_ranges_in_container(CardSetPtr const car case CardSetHowl: { assert(card_set_type(FullCardSet) == CardSetHowl, "Must be"); if (card_set == FullCardSet) { - if (found.start_iterate(G1GCPhaseTimes::MergeRSMergedFull)) { - found(0, _config->max_cards_in_region()); + if (cl.start_iterate(G1GCPhaseTimes::MergeRSMergedFull)) { + cl(0, _config->max_cards_in_region()); } return; } - if (found.start_iterate(G1GCPhaseTimes::MergeRSMergedHowl)) { - card_set_ptr(card_set)->iterate(found, _config); + if (cl.start_iterate(G1GCPhaseTimes::MergeRSMergedHowl)) { + card_set_ptr(card_set)->iterate(cl, _config); } return; } diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp index ff1f75df602..fc7da0994e4 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp @@ -57,49 +57,49 @@ void HeapRegionRemSet::set_state_complete() { template class G1ContainerCardsOrRanges { - Closure& _iter; + Closure& _cl; uint _region_idx; uint _offset; public: - G1ContainerCardsOrRanges(Closure& iter, uint region_idx, uint offset) : _iter(iter), _region_idx(region_idx), _offset(offset) { } + G1ContainerCardsOrRanges(Closure& cl, uint region_idx, uint offset) : _cl(cl), _region_idx(region_idx), _offset(offset) { } bool start_iterate(uint tag) { - return _iter.start_iterate(tag, _region_idx); + return _cl.start_iterate(tag, _region_idx); } void operator()(uint card_idx) { - _iter.do_card(card_idx + _offset); + _cl.do_card(card_idx + _offset); } void operator()(uint card_idx, uint length) { - _iter.do_card_range(card_idx + _offset, length); + _cl.do_card_range(card_idx + _offset, length); } }; template class CardOrRanges> -class G1HeapRegionRemSetMergeCardIterator : public G1CardSet::G1CardSetPtrIterator { +class G1HeapRegionRemSetMergeCardClosure : public G1CardSet::CardSetPtrClosure { G1CardSet* _card_set; - Closure& _iter; + Closure& _cl; uint _log_card_regions_per_region; uint _card_regions_per_region_mask; uint _log_card_region_size; public: - G1HeapRegionRemSetMergeCardIterator(G1CardSet* card_set, - Closure& iter, + G1HeapRegionRemSetMergeCardClosure(G1CardSet* card_set, + Closure& cl, uint log_card_regions_per_region, uint log_card_region_size) : _card_set(card_set), - _iter(iter), + _cl(cl), _log_card_regions_per_region(log_card_regions_per_region), _card_regions_per_region_mask((1 << log_card_regions_per_region) - 1), _log_card_region_size(log_card_region_size) { } void do_cardsetptr(uint card_region_idx, size_t num_occupied, G1CardSet::CardSetPtr card_set) override { - CardOrRanges cl(_iter, + CardOrRanges cl(_cl, card_region_idx >> _log_card_regions_per_region, (card_region_idx & _card_regions_per_region_mask) << _log_card_region_size); _card_set->iterate_cards_or_ranges_in_container(card_set, cl); @@ -108,10 +108,10 @@ public: template inline void HeapRegionRemSet::iterate_for_merge(CardOrRangeVisitor& cl) { - G1HeapRegionRemSetMergeCardIterator cl2(&_card_set, - cl, - _card_set.config()->log2_card_region_per_heap_region(), - _card_set.config()->log2_cards_per_card_region()); + G1HeapRegionRemSetMergeCardClosure cl2(&_card_set, + cl, + _card_set.config()->log2_card_region_per_heap_region(), + _card_set.config()->log2_cards_per_card_region()); _card_set.iterate_containers(&cl2, true /* at_safepoint */); } diff --git a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp index 58e6f3e3c24..f009fc4adea 100644 --- a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp +++ b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp @@ -34,7 +34,7 @@ class G1CardSetTest : public ::testing::Test { - class G1CountCardsClosure : public G1CardSet::G1CardSetCardIterator { + class G1CountCardsClosure : public G1CardSet::CardClosure { public: size_t _num_cards; @@ -82,7 +82,7 @@ public: static void translate_cards(uint cards_per_region, uint region_idx, uint* cards, uint num_cards); - static void iterate_cards(G1CardSet* card_set, G1CardSet::G1CardSetCardIterator* cl); + static void iterate_cards(G1CardSet* card_set, G1CardSet::CardClosure* cl); }; WorkerThreads* G1CardSetTest::_workers = NULL; @@ -101,7 +101,7 @@ void G1CardSetTest::add_cards(G1CardSet* card_set, uint cards_per_region, uint* } } -class G1CheckCardClosure : public G1CardSet::G1CardSetCardIterator { +class G1CheckCardClosure : public G1CardSet::CardClosure { G1CardSet* _card_set; uint _cards_per_region; @@ -163,7 +163,7 @@ void G1CardSetTest::translate_cards(uint cards_per_region, uint region_idx, uint } } -class G1CountCardsOccupied : public G1CardSet::G1CardSetPtrIterator { +class G1CountCardsOccupied : public G1CardSet::CardSetPtrClosure { size_t _num_occupied; public: @@ -178,7 +178,7 @@ public: void G1CardSetTest::check_iteration(G1CardSet* card_set, const size_t expected, const bool single_threaded) { - class CheckIterator : public G1CardSet::G1CardSetCardIterator { + class CheckIterator : public G1CardSet::CardClosure { public: G1CardSet* _card_set; size_t _num_found; -- GitLab From 03473b4c271b2ec7f0ebdb0edabadf7f36816b9d Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Thu, 18 Nov 2021 18:25:38 +0000 Subject: [PATCH 388/890] 8270874: JFrame paint artifacts when dragged from standard monitor to HiDPI monitor Reviewed-by: jdv --- .../native/libawt/windows/awt_Component.cpp | 26 +++++++++++++------ ...indowResizingOnMovingToAnotherDisplay.java | 2 +- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp index 4868fed9089..8db02f9aee4 100644 --- a/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp +++ b/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -47,6 +47,7 @@ #include "awt_Win32GraphicsDevice.h" #include "Hashtable.h" #include "ComCtl32Util.h" +#include "math.h" #include @@ -2234,8 +2235,8 @@ void AwtComponent::PaintUpdateRgn(const RECT *insets) */ RECT* r = (RECT*)(buffer + rgndata->rdh.dwSize); RECT* un[2] = {0, 0}; - DWORD i; - for (i = 0; i < rgndata->rdh.nCount; i++, r++) { + DWORD i; + for (i = 0; i < rgndata->rdh.nCount; i++, r++) { int width = r->right-r->left; int height = r->bottom-r->top; if (width > 0 && height > 0) { @@ -2247,13 +2248,22 @@ void AwtComponent::PaintUpdateRgn(const RECT *insets) } } } + // The Windows may request to update the small region of pixels that + // cannot be represented in the user's space, in this case, we will + // request to repaint the smallest non-empty bounding box in the user's + // space + int screen = GetScreenImOn(); + Devices::InstanceAccess devices; + AwtWin32GraphicsDevice* device = devices->GetDevice(screen); + float scaleX = (device == NULL) ? 1 : device->GetScaleX(); + float scaleY = (device == NULL) ? 1 : device->GetScaleY(); for(i = 0; i < 2; i++) { if (un[i] != 0) { - DoCallback("handleExpose", "(IIII)V", - ScaleDownX(un[i]->left), - ScaleDownY(un[i]->top), - ScaleDownX(un[i]->right - un[i]->left), - ScaleDownY(un[i]->bottom - un[i]->top)); + int x1 = floor(un[i]->left / scaleX); + int y1 = floor(un[i]->top / scaleY); + int x2 = ceil(un[i]->right / scaleX); + int y2 = ceil(un[i]->bottom / scaleY); + DoCallback("handleExpose", "(IIII)V", x1, y1, x2 - x1, y2 - y1); } } delete [] buffer; diff --git a/test/jdk/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java b/test/jdk/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java index 7c0035f4274..7acf4aa1b61 100644 --- a/test/jdk/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java +++ b/test/jdk/java/awt/Window/WindowResizingOnDPIChanging/WindowResizingOnMovingToAnotherDisplay.java @@ -53,7 +53,7 @@ import javax.swing.JTextArea; import javax.swing.SwingUtilities; /* @test - * @bug 8147440 8147016 + * @bug 8147440 8147016 8270874 * @summary HiDPI (Windows): Swing components have incorrect sizes after * changing display resolution * @run main/manual/othervm WindowResizingOnMovingToAnotherDisplay -- GitLab From 8db0c361a39cf10d373c3d2dfa54267cf53452db Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Thu, 18 Nov 2021 18:40:26 +0000 Subject: [PATCH 389/890] 8277414: ProblemList runtime/CommandLine/VMDeprecatedOptions.java on windows-x64 Reviewed-by: mikael, iklam --- test/hotspot/jtreg/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index fcc12d16677..e584b5cf395 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -106,6 +106,7 @@ runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java 8277350 macosx-x64 +runtime/CommandLine/VMDeprecatedOptions.java 8277404 windows-x64 applications/jcstress/copy.java 8229852 linux-all -- GitLab From 57eb864765f38185f8db8f1d37681d6cfe2a3c73 Mon Sep 17 00:00:00 2001 From: Niklas Radomski Date: Thu, 18 Nov 2021 19:00:58 +0000 Subject: [PATCH 390/890] 8276927: [PPC64] Port shenandoahgc to linux on ppc64le Reviewed-by: rkennke, ihse, mdoerr --- make/autoconf/jvm-features.m4 | 3 +- make/hotspot/gensrc/GensrcAdlc.gmk | 1 + .../ppc/gc/shared/barrierSetAssembler_ppc.cpp | 8 + .../c1/shenandoahBarrierSetC1_ppc.cpp | 162 +++ .../shenandoahBarrierSetAssembler_ppc.cpp | 1012 +++++++++++++++++ .../shenandoahBarrierSetAssembler_ppc.hpp | 118 ++ .../cpu/ppc/gc/shenandoah/shenandoah_ppc.ad | 217 ++++ .../gc/shenandoah/shenandoahArguments.cpp | 2 +- 8 files changed, 1521 insertions(+), 2 deletions(-) create mode 100644 src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp create mode 100644 src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp create mode 100644 src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp create mode 100644 src/hotspot/cpu/ppc/gc/shenandoah/shenandoah_ppc.ad diff --git a/make/autoconf/jvm-features.m4 b/make/autoconf/jvm-features.m4 index 1f76c323129..906a2857877 100644 --- a/make/autoconf/jvm-features.m4 +++ b/make/autoconf/jvm-features.m4 @@ -307,7 +307,8 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_SHENANDOAHGC], JVM_FEATURES_CHECK_AVAILABILITY(shenandoahgc, [ AC_MSG_CHECKING([if platform is supported by Shenandoah]) if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || \ - test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then + test "x$OPENJDK_TARGET_CPU" = "xaarch64" || \ + test "x$OPENJDK_TARGET_CPU" = "xppc64le"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU]) diff --git a/make/hotspot/gensrc/GensrcAdlc.gmk b/make/hotspot/gensrc/GensrcAdlc.gmk index f9f1bb38688..25c13272914 100644 --- a/make/hotspot/gensrc/GensrcAdlc.gmk +++ b/make/hotspot/gensrc/GensrcAdlc.gmk @@ -149,6 +149,7 @@ ifeq ($(call check-jvm-feature, compiler2), true) ifeq ($(call check-jvm-feature, shenandoahgc), true) AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \ $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/shenandoah/shenandoah_$(HOTSPOT_TARGET_CPU).ad \ + $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/shenandoah/shenandoah_$(HOTSPOT_TARGET_CPU_ARCH).ad \ ))) endif diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp index 3758cc2fcf7..c4b152a6db3 100644 --- a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp @@ -151,6 +151,8 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Register t assert_different_registers(tmp, R0); + __ block_comment("nmethod_entry_barrier (nmethod_entry_barrier) {"); + // Load stub address using toc (fixed instruction size, unlike load_const_optimized) __ calculate_address_from_global_toc(tmp, StubRoutines::ppc::nmethod_entry_barrier(), true, true, false); // 2 instructions @@ -167,6 +169,8 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Register t // Oops may have been changed; exploiting isync semantics (used as acquire) to make those updates observable. __ isync(); + + __ block_comment("} nmethod_entry_barrier (nmethod_entry_barrier)"); } void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler *masm, Register tmp1, Register tmp2, Register tmp3) { @@ -177,6 +181,8 @@ void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler *masm, Register tmp1, assert_different_registers(tmp1, tmp2, tmp3); + __ block_comment("c2i_entry_barrier (c2i_entry_barrier) {"); + Register tmp1_class_loader_data = tmp1; Label bad_call, skip_barrier; @@ -207,4 +213,6 @@ void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler *masm, Register tmp1, __ bctr(); __ bind(skip_barrier); + + __ block_comment("} c2i_entry_barrier (c2i_entry_barrier)"); } diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp new file mode 100644 index 00000000000..fc06e1b71e0 --- /dev/null +++ b/src/hotspot/cpu/ppc/gc/shenandoah/c1/shenandoahBarrierSetC1_ppc.cpp @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. + * Copyright (c) 2012, 2021 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. + * + */ + +#include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "gc/shenandoah/shenandoahBarrierSet.hpp" +#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp" +#include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp" + +#define __ masm->masm()-> + +void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler *masm) { + __ block_comment("LIR_OpShenandoahCompareAndSwap (shenandaohgc) {"); + + Register addr = _addr->as_register_lo(); + Register new_val = _new_value->as_register(); + Register cmp_val = _cmp_value->as_register(); + Register tmp1 = _tmp1->as_register(); + Register tmp2 = _tmp2->as_register(); + Register result = result_opr()->as_register(); + + if (ShenandoahIUBarrier) { + ShenandoahBarrierSet::assembler()->iu_barrier(masm->masm(), new_val, tmp1, tmp2, + MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS); + } + + if (UseCompressedOops) { + __ encode_heap_oop(cmp_val, cmp_val); + __ encode_heap_oop(new_val, new_val); + } + + // Due to the memory barriers emitted in ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved, + // there is no need to specify stronger memory semantics. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(masm->masm(), addr, cmp_val, new_val, tmp1, tmp2, + false, result); + + if (UseCompressedOops) { + __ decode_heap_oop(cmp_val); + __ decode_heap_oop(new_val); + } + + __ block_comment("} LIR_OpShenandoahCompareAndSwap (shenandaohgc)"); +} + +#undef __ + +#ifdef ASSERT +#define __ gen->lir(__FILE__, __LINE__)-> +#else +#define __ gen->lir()-> +#endif + +LIR_Opr ShenandoahBarrierSetC1::atomic_cmpxchg_at_resolved(LIRAccess &access, LIRItem &cmp_value, LIRItem &new_value) { + BasicType bt = access.type(); + + if (access.is_oop()) { + LIRGenerator* gen = access.gen(); + + if (ShenandoahCASBarrier) { + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ membar(); + } else { + __ membar_release(); + } + } + + if (ShenandoahSATBBarrier) { + pre_barrier(gen, access.access_emit_info(), access.decorators(), access.resolved_addr(), + LIR_OprFact::illegalOpr); + } + + if (ShenandoahCASBarrier) { + cmp_value.load_item(); + new_value.load_item(); + + LIR_Opr t1 = gen->new_register(T_OBJECT); + LIR_Opr t2 = gen->new_register(T_OBJECT); + LIR_Opr addr = access.resolved_addr()->as_address_ptr()->base(); + LIR_Opr result = gen->new_register(T_INT); + + __ append(new LIR_OpShenandoahCompareAndSwap(addr, cmp_value.result(), new_value.result(), t1, t2, result)); + + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ membar_acquire(); + } else { + __ membar(); + } + + return result; + } + } + + return BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value); +} + +LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess &access, LIRItem &value) { + LIRGenerator* gen = access.gen(); + BasicType type = access.type(); + + LIR_Opr result = gen->new_register(type); + value.load_item(); + LIR_Opr value_opr = value.result(); + + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ membar(); + } else { + __ membar_release(); + } + + if (access.is_oop()) { + value_opr = iu_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators()); + } + + assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type"); + LIR_Opr tmp_xchg = gen->new_register(T_INT); + __ xchg(access.resolved_addr(), value_opr, result, tmp_xchg); + + if (access.is_oop()) { + result = load_reference_barrier_impl(access.gen(), result, LIR_OprFact::addressConst(0), + access.decorators()); + + LIR_Opr tmp_barrier = gen->new_register(type); + __ move(result, tmp_barrier); + result = tmp_barrier; + + if (ShenandoahSATBBarrier) { + pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), LIR_OprFact::illegalOpr, result); + } + } + + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ membar_acquire(); + } else { + __ membar(); + } + + return result; +} diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp new file mode 100644 index 00000000000..8c9955078ff --- /dev/null +++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp @@ -0,0 +1,1012 @@ +/* + * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. + * Copyright (c) 2012, 2021 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. + * + */ + +#include "gc/shared/gcArguments.hpp" +#include "gc/shared/gc_globals.hpp" +#include "macroAssembler_ppc.hpp" +#include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "gc/shenandoah/shenandoahBarrierSet.hpp" +#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp" +#include "gc/shenandoah/shenandoahForwarding.hpp" +#include "gc/shenandoah/shenandoahHeap.hpp" +#include "gc/shenandoah/shenandoahHeap.inline.hpp" +#include "gc/shenandoah/shenandoahHeapRegion.hpp" +#include "gc/shenandoah/shenandoahRuntime.hpp" +#include "gc/shenandoah/shenandoahThreadLocalData.hpp" +#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp" +#include "interpreter/interpreter.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/thread.hpp" +#include "utilities/globalDefinitions.hpp" +#include "vm_version_ppc.hpp" + +#ifdef COMPILER1 + +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp" + +#endif + +#define __ masm-> + +void ShenandoahBarrierSetAssembler::satb_write_barrier(MacroAssembler *masm, + Register base, RegisterOrConstant ind_or_offs, + Register tmp1, Register tmp2, Register tmp3, + MacroAssembler::PreservationLevel preservation_level) { + if (ShenandoahSATBBarrier) { + __ block_comment("satb_write_barrier (shenandoahgc) {"); + satb_write_barrier_impl(masm, 0, base, ind_or_offs, tmp1, tmp2, tmp3, preservation_level); + __ block_comment("} satb_write_barrier (shenandoahgc)"); + } +} + +void ShenandoahBarrierSetAssembler::iu_barrier(MacroAssembler *masm, + Register val, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level, + DecoratorSet decorators) { + // IU barriers are also employed to avoid resurrection of weak references, + // even if Shenandoah does not operate in incremental update mode. + if (ShenandoahIUBarrier || ShenandoahSATBBarrier) { + __ block_comment("iu_barrier (shenandoahgc) {"); + satb_write_barrier_impl(masm, decorators, noreg, noreg, val, tmp1, tmp2, preservation_level); + __ block_comment("} iu_barrier (shenandoahgc)"); + } +} + +void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler *masm, DecoratorSet decorators, + Register base, RegisterOrConstant ind_or_offs, + Register dst, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level) { + if (ShenandoahLoadRefBarrier) { + __ block_comment("load_reference_barrier (shenandoahgc) {"); + load_reference_barrier_impl(masm, decorators, base, ind_or_offs, dst, tmp1, tmp2, preservation_level); + __ block_comment("} load_reference_barrier (shenandoahgc)"); + } +} + +void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, DecoratorSet decorators, BasicType type, + Register src, Register dst, Register count, + Register preserve1, Register preserve2) { + __ block_comment("arraycopy_prologue (shenandoahgc) {"); + + Register R11_tmp = R11_scratch1; + + assert_different_registers(src, dst, count, R11_tmp, noreg); + if (preserve1 != noreg) { + // Technically not required, but likely to indicate an error. + assert_different_registers(preserve1, preserve2); + } + + /* ==== Check whether barrier is required (optimizations) ==== */ + // Fast path: Component type of array is not a reference type. + if (!is_reference_type(type)) { + return; + } + + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; + + // Fast path: No barrier required if for every barrier type, it is either disabled or would not store + // any useful information. + if ((!ShenandoahSATBBarrier || dest_uninitialized) && !ShenandoahIUBarrier && !ShenandoahLoadRefBarrier) { + return; + } + + Label skip_prologue; + + // Fast path: Array is of length zero. + __ cmpdi(CCR0, count, 0); + __ beq(CCR0, skip_prologue); + + /* ==== Check whether barrier is required (gc state) ==== */ + __ lbz(R11_tmp, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), + R16_thread); + + // The set of garbage collection states requiring barriers depends on the available barrier types and the + // type of the reference in question. + // For instance, satb barriers may be skipped if it is certain that the overridden values are not relevant + // for the garbage collector. + const int required_states = ShenandoahSATBBarrier && dest_uninitialized + ? ShenandoahHeap::HAS_FORWARDED + : ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::MARKING; + + __ andi_(R11_tmp, R11_tmp, required_states); + __ beq(CCR0, skip_prologue); + + /* ==== Invoke runtime ==== */ + // Save to-be-preserved registers. + int highest_preserve_register_index = 0; + { + if (preserve1 != noreg && preserve1->is_volatile()) { + __ std(preserve1, -BytesPerWord * ++highest_preserve_register_index, R1_SP); + } + if (preserve2 != noreg && preserve2 != preserve1 && preserve2->is_volatile()) { + __ std(preserve2, -BytesPerWord * ++highest_preserve_register_index, R1_SP); + } + + __ std(src, -BytesPerWord * ++highest_preserve_register_index, R1_SP); + __ std(dst, -BytesPerWord * ++highest_preserve_register_index, R1_SP); + __ std(count, -BytesPerWord * ++highest_preserve_register_index, R1_SP); + + __ save_LR_CR(R11_tmp); + __ push_frame_reg_args(-BytesPerWord * highest_preserve_register_index, + R11_tmp); + } + + // Invoke runtime. + address jrt_address = NULL; + if (UseCompressedOops) { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_narrow_oop_entry); + } else { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::arraycopy_barrier_oop_entry); + } + assert(jrt_address != nullptr, "jrt routine cannot be found"); + + __ call_VM_leaf(jrt_address, src, dst, count); + + // Restore to-be-preserved registers. + { + __ pop_frame(); + __ restore_LR_CR(R11_tmp); + + __ ld(count, -BytesPerWord * highest_preserve_register_index--, R1_SP); + __ ld(dst, -BytesPerWord * highest_preserve_register_index--, R1_SP); + __ ld(src, -BytesPerWord * highest_preserve_register_index--, R1_SP); + + if (preserve2 != noreg && preserve2 != preserve1 && preserve2->is_volatile()) { + __ ld(preserve2, -BytesPerWord * highest_preserve_register_index--, R1_SP); + } + if (preserve1 != noreg && preserve1->is_volatile()) { + __ ld(preserve1, -BytesPerWord * highest_preserve_register_index--, R1_SP); + } + } + + __ bind(skip_prologue); + __ block_comment("} arraycopy_prologue (shenandoahgc)"); +} + +// The to-be-enqueued value can either be determined +// - dynamically by passing the reference's address information (load mode) or +// - statically by passing a register the value is stored in (preloaded mode) +// - for performance optimizations in cases where the previous value is known (currently not implemented) and +// - for incremental-update barriers. +// +// decorators: The previous value's decorator set. +// In "load mode", the value must equal '0'. +// base: Base register of the reference's address (load mode). +// In "preloaded mode", the register must equal 'noreg'. +// ind_or_offs: Index or offset of the reference's address (load mode). +// If 'base' equals 'noreg' (preloaded mode), the passed value is ignored. +// pre_val: Register holding the to-be-stored value (preloaded mode). +// In "load mode", this register acts as a temporary register and must +// thus not be 'noreg'. In "preloaded mode", its content will be sustained. +// tmp1/tmp2: Temporary registers, one of which must be non-volatile in "preloaded mode". +void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm, DecoratorSet decorators, + Register base, RegisterOrConstant ind_or_offs, + Register pre_val, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level) { + assert_different_registers(tmp1, tmp2, pre_val, noreg); + + Label skip_barrier; + + /* ==== Determine necessary runtime invocation preservation measures ==== */ + const bool needs_frame = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR; + const bool preserve_gp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_REGS; + const bool preserve_fp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS; + + // Check whether marking is active. + __ lbz(tmp1, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), R16_thread); + + __ andi_(tmp1, tmp1, ShenandoahHeap::MARKING); + __ beq(CCR0, skip_barrier); + + /* ==== Determine the reference's previous value ==== */ + bool preloaded_mode = base == noreg; + Register pre_val_save = noreg; + + if (preloaded_mode) { + // Previous value has been passed to the method, so it must not be determined manually. + // In case 'pre_val' is a volatile register, it must be saved across the C-call + // as callers may depend on its value. + // Unless the general purposes registers are saved anyway, one of the temporary registers + // (i.e., 'tmp1' and 'tmp2') is used to the preserve 'pre_val'. + if (!preserve_gp_registers && pre_val->is_volatile()) { + pre_val_save = !tmp1->is_volatile() ? tmp1 : tmp2; + assert(!pre_val_save->is_volatile(), "at least one of the temporary registers must be non-volatile"); + } + + if ((decorators & IS_NOT_NULL) != 0) { +#ifdef ASSERT + __ cmpdi(CCR0, pre_val, 0); + __ asm_assert_ne("null oop is not allowed"); +#endif // ASSERT + } else { + __ cmpdi(CCR0, pre_val, 0); + __ beq(CCR0, skip_barrier); + } + } else { + // Load from the reference address to determine the reference's current value (before the store is being performed). + // Contrary to the given value in "preloaded mode", it is not necessary to preserve it. + assert(decorators == 0, "decorator set must be empty"); + assert(base != noreg, "base must be a register"); + assert(!ind_or_offs.is_register() || ind_or_offs.as_register() != noreg, "ind_or_offs must be a register"); + if (UseCompressedOops) { + __ lwz(pre_val, ind_or_offs, base); + } else { + __ ld(pre_val, ind_or_offs, base); + } + + __ cmpdi(CCR0, pre_val, 0); + __ beq(CCR0, skip_barrier); + + if (UseCompressedOops) { + __ decode_heap_oop_not_null(pre_val); + } + } + + /* ==== Try to enqueue the to-be-stored value directly into thread's local SATB mark queue ==== */ + { + Label runtime; + Register Rbuffer = tmp1, Rindex = tmp2; + + // Check whether the queue has enough capacity to store another oop. + // If not, jump to the runtime to commit the buffer and to allocate a new one. + // (The buffer's index corresponds to the amount of remaining free space.) + __ ld(Rindex, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()), R16_thread); + __ cmpdi(CCR0, Rindex, 0); + __ beq(CCR0, runtime); // If index == 0 (buffer is full), goto runtime. + + // Capacity suffices. Decrement the queue's size by the size of one oop. + // (The buffer is filled contrary to the heap's growing direction, i.e., it is filled downwards.) + __ addi(Rindex, Rindex, -wordSize); + __ std(Rindex, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()), R16_thread); + + // Enqueue the previous value and skip the invocation of the runtime. + __ ld(Rbuffer, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset()), R16_thread); + __ stdx(pre_val, Rbuffer, Rindex); + __ b(skip_barrier); + + __ bind(runtime); + } + + /* ==== Invoke runtime to commit SATB mark queue to gc and allocate a new buffer ==== */ + // Save to-be-preserved registers. + int nbytes_save = 0; + + if (needs_frame) { + if (preserve_gp_registers) { + nbytes_save = (preserve_fp_registers + ? MacroAssembler::num_volatile_gp_regs + MacroAssembler::num_volatile_fp_regs + : MacroAssembler::num_volatile_gp_regs) * BytesPerWord; + __ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers); + } + + __ save_LR_CR(tmp1); + __ push_frame_reg_args(nbytes_save, tmp2); + } + + if (!preserve_gp_registers && preloaded_mode && pre_val->is_volatile()) { + assert(pre_val_save != noreg, "nv_save must not be noreg"); + + // 'pre_val' register must be saved manually unless general-purpose are preserved in general. + __ mr(pre_val_save, pre_val); + } + + // Invoke runtime. + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), pre_val, R16_thread); + + // Restore to-be-preserved registers. + if (!preserve_gp_registers && preloaded_mode && pre_val->is_volatile()) { + __ mr(pre_val, pre_val_save); + } + + if (needs_frame) { + __ pop_frame(); + __ restore_LR_CR(tmp1); + + if (preserve_gp_registers) { + __ restore_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers); + } + } + + __ bind(skip_barrier); +} + +void ShenandoahBarrierSetAssembler::resolve_forward_pointer_not_null(MacroAssembler *masm, Register dst, Register tmp) { + __ block_comment("resolve_forward_pointer_not_null (shenandoahgc) {"); + + Register tmp1 = tmp, + R0_tmp2 = R0; + assert_different_registers(dst, tmp1, R0_tmp2, noreg); + + // If the object has been evacuated, the mark word layout is as follows: + // | forwarding pointer (62-bit) | '11' (2-bit) | + + // The invariant that stack/thread pointers have the lowest two bits cleared permits retrieving + // the forwarding pointer solely by inversing the lowest two bits. + // This invariant follows inevitably from hotspot's minimal alignment. + assert(markWord::marked_value <= (unsigned long) MinObjAlignmentInBytes, + "marked value must not be higher than hotspot's minimal alignment"); + + Label done; + + // Load the object's mark word. + __ ld(tmp1, oopDesc::mark_offset_in_bytes(), dst); + + // Load the bit mask for the lock bits. + __ li(R0_tmp2, markWord::lock_mask_in_place); + + // Check whether all bits matching the bit mask are set. + // If that is the case, the object has been evacuated and the most significant bits form the forward pointer. + __ andc_(R0_tmp2, R0_tmp2, tmp1); + + assert(markWord::lock_mask_in_place == markWord::marked_value, + "marked value must equal the value obtained when all lock bits are being set"); + if (VM_Version::has_isel()) { + __ xori(tmp1, tmp1, markWord::lock_mask_in_place); + __ isel(dst, CCR0, Assembler::equal, false, tmp1); + } else { + __ bne(CCR0, done); + __ xori(dst, tmp1, markWord::lock_mask_in_place); + } + + __ bind(done); + __ block_comment("} resolve_forward_pointer_not_null (shenandoahgc)"); +} + +// base: Base register of the reference's address. +// ind_or_offs: Index or offset of the reference's address (load mode). +// dst: Reference's address. In case the object has been evacuated, this is the to-space version +// of that object. +void ShenandoahBarrierSetAssembler::load_reference_barrier_impl( + MacroAssembler *masm, DecoratorSet decorators, + Register base, RegisterOrConstant ind_or_offs, + Register dst, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level) { + if (ind_or_offs.is_register()) { + assert_different_registers(tmp1, tmp2, base, ind_or_offs.as_register(), dst, noreg); + } else { + assert_different_registers(tmp1, tmp2, base, dst, noreg); + } + + Label skip_barrier; + + bool is_strong = ShenandoahBarrierSet::is_strong_access(decorators); + bool is_weak = ShenandoahBarrierSet::is_weak_access(decorators); + bool is_phantom = ShenandoahBarrierSet::is_phantom_access(decorators); + bool is_native = ShenandoahBarrierSet::is_native_access(decorators); + bool is_narrow = UseCompressedOops && !is_native; + + /* ==== Check whether heap is stable ==== */ + __ lbz(tmp2, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), R16_thread); + + if (is_strong) { + // For strong references, the heap is considered stable if "has forwarded" is not active. + __ andi_(tmp1, tmp2, ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::EVACUATION); + __ beq(CCR0, skip_barrier); +#ifdef ASSERT + // "evacuation" -> (implies) "has forwarded". If we reach this code, "has forwarded" must thus be set. + __ andi_(tmp1, tmp1, ShenandoahHeap::HAS_FORWARDED); + __ asm_assert_ne("'has forwarded' is missing"); +#endif // ASSERT + } else { + // For all non-strong references, the heap is considered stable if not any of "has forwarded", + // "root set processing", and "weak reference processing" is active. + // The additional phase conditions are in place to avoid the resurrection of weak references (see JDK-8266440). + Label skip_fastpath; + __ andi_(tmp1, tmp2, ShenandoahHeap::WEAK_ROOTS); + __ bne(CCR0, skip_fastpath); + + __ andi_(tmp1, tmp2, ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::EVACUATION); + __ beq(CCR0, skip_barrier); +#ifdef ASSERT + // "evacuation" -> (implies) "has forwarded". If we reach this code, "has forwarded" must thus be set. + __ andi_(tmp1, tmp1, ShenandoahHeap::HAS_FORWARDED); + __ asm_assert_ne("'has forwarded' is missing"); +#endif // ASSERT + + __ bind(skip_fastpath); + } + + /* ==== Check whether region is in collection set ==== */ + if (is_strong) { + // Shenandoah stores metadata on regions in a continuous area of memory in which a single byte corresponds to + // an entire region of the shenandoah heap. At present, only the least significant bit is of significance + // and indicates whether the region is part of the collection set. + // + // All regions are of the same size and are always aligned by a power of two. + // Any address can thus be shifted by a fixed number of bits to retrieve the address prefix shared by + // all objects within that region (region identification bits). + // + // | unused bits | region identification bits | object identification bits | + // (Region size depends on a couple of criteria, such as page size, user-provided arguments and the max heap size. + // The number of object identification bits can thus not be determined at compile time.) + // + // ------------------------------------------------------- <--- cs (collection set) base address + // | lost space due to heap space base address -> 'ShenandoahHeap::in_cset_fast_test_addr()' + // | (region identification bits contain heap base offset) + // |------------------------------------------------------ <--- cs base address + (heap_base >> region size shift) + // | collection set in the proper -> shift: 'region_size_bytes_shift_jint()' + // | + // |------------------------------------------------------ <--- cs base address + (heap_base >> region size shift) + // + number of regions + __ load_const_optimized(tmp2, ShenandoahHeap::in_cset_fast_test_addr(), tmp1); + __ srdi(tmp1, dst, ShenandoahHeapRegion::region_size_bytes_shift_jint()); + __ lbzx(tmp2, tmp1, tmp2); + __ andi_(tmp2, tmp2, 1); + __ beq(CCR0, skip_barrier); + } + + /* ==== Invoke runtime ==== */ + // Save to-be-preserved registers. + int nbytes_save = 0; + + const bool needs_frame = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR; + const bool preserve_gp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_REGS; + const bool preserve_fp_registers = preservation_level >= MacroAssembler::PRESERVATION_FRAME_LR_GP_FP_REGS; + + if (needs_frame) { + if (preserve_gp_registers) { + nbytes_save = (preserve_fp_registers + ? MacroAssembler::num_volatile_gp_regs + MacroAssembler::num_volatile_fp_regs + : MacroAssembler::num_volatile_gp_regs) * BytesPerWord; + __ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers); + } + + __ save_LR_CR(tmp1); + __ push_frame_reg_args(nbytes_save, tmp1); + } + + // Calculate the reference's absolute address. + __ add(R4_ARG2, ind_or_offs, base); + + // Invoke runtime. + address jrt_address = nullptr; + + if (is_strong) { + if (is_narrow) { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong_narrow); + } else { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong); + } + } else if (is_weak) { + if (is_narrow) { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow); + } else { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak); + } + } else { + assert(is_phantom, "only remaining strength"); + assert(!is_narrow, "phantom access cannot be narrow"); + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom); + } + assert(jrt_address != nullptr, "jrt routine cannot be found"); + + __ call_VM_leaf(jrt_address, dst /* reference */, R4_ARG2 /* reference address */); + + // Restore to-be-preserved registers. + if (preserve_gp_registers) { + __ mr(R0, R3_RET); + } else { + __ mr_if_needed(dst, R3_RET); + } + + if (needs_frame) { + __ pop_frame(); + __ restore_LR_CR(tmp1); + + if (preserve_gp_registers) { + __ restore_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers); + __ mr(dst, R0); + } + } + + __ bind(skip_barrier); +} + +// base: Base register of the reference's address. +// ind_or_offs: Index or offset of the reference's address. +// L_handle_null: An optional label that will be jumped to if the reference is null. +void ShenandoahBarrierSetAssembler::load_at( + MacroAssembler *masm, DecoratorSet decorators, BasicType type, + Register base, RegisterOrConstant ind_or_offs, Register dst, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level, Label *L_handle_null) { + // Register must not clash, except 'base' and 'dst'. + if (ind_or_offs.is_register()) { + if (base != noreg) { + assert_different_registers(tmp1, tmp2, base, ind_or_offs.register_or_noreg(), R0, noreg); + } + assert_different_registers(tmp1, tmp2, dst, ind_or_offs.register_or_noreg(), R0, noreg); + } else { + if (base == noreg) { + assert_different_registers(tmp1, tmp2, base, R0, noreg); + } + assert_different_registers(tmp1, tmp2, dst, R0, noreg); + } + + /* ==== Apply load barrier, if required ==== */ + if (ShenandoahBarrierSet::need_load_reference_barrier(decorators, type)) { + assert(is_reference_type(type), "need_load_reference_barrier must check whether type is a reference type"); + + // If 'dst' clashes with either 'base' or 'ind_or_offs', use an intermediate result register + // to keep the values of those alive until the load reference barrier is applied. + Register intermediate_dst = (dst == base || (ind_or_offs.is_register() && dst == ind_or_offs.as_register())) + ? tmp2 + : dst; + + BarrierSetAssembler::load_at(masm, decorators, type, + base, ind_or_offs, + intermediate_dst, + tmp1, noreg, + preservation_level, L_handle_null); + + load_reference_barrier(masm, decorators, + base, ind_or_offs, + intermediate_dst, + tmp1, R0, + preservation_level); + + __ mr_if_needed(dst, intermediate_dst); + } else { + BarrierSetAssembler::load_at(masm, decorators, type, + base, ind_or_offs, + dst, + tmp1, tmp2, + preservation_level, L_handle_null); + } + + /* ==== Apply keep-alive barrier, if required (e.g., to inhibit weak reference resurrection) ==== */ + if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) { + iu_barrier(masm, dst, tmp1, tmp2, preservation_level); + } +} + +// base: Base register of the reference's address. +// ind_or_offs: Index or offset of the reference's address. +// val: To-be-stored value/reference's new value. +void ShenandoahBarrierSetAssembler::store_at(MacroAssembler *masm, DecoratorSet decorators, BasicType type, + Register base, RegisterOrConstant ind_or_offs, Register val, + Register tmp1, Register tmp2, Register tmp3, + MacroAssembler::PreservationLevel preservation_level) { + if (is_reference_type(type)) { + if (ShenandoahSATBBarrier) { + satb_write_barrier(masm, base, ind_or_offs, tmp1, tmp2, tmp3, preservation_level); + } + + if (ShenandoahIUBarrier && val != noreg) { + iu_barrier(masm, val, tmp1, tmp2, preservation_level, decorators); + } + } + + BarrierSetAssembler::store_at(masm, decorators, type, + base, ind_or_offs, + val, + tmp1, tmp2, tmp3, + preservation_level); +} + +void ShenandoahBarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler *masm, + Register dst, Register jni_env, Register obj, + Register tmp, Label &slowpath) { + __ block_comment("try_resolve_jobject_in_native (shenandoahgc) {"); + + assert_different_registers(jni_env, obj, tmp); + + Label done; + + // Fast path: Reference is null (JNI tags are zero for null pointers). + __ cmpdi(CCR0, obj, 0); + __ beq(CCR0, done); + + // Resolve jobject using standard implementation. + BarrierSetAssembler::try_resolve_jobject_in_native(masm, dst, jni_env, obj, tmp, slowpath); + + // Check whether heap is stable. + __ lbz(tmp, + in_bytes(ShenandoahThreadLocalData::gc_state_offset() - JavaThread::jni_environment_offset()), + jni_env); + + __ andi_(tmp, tmp, ShenandoahHeap::EVACUATION | ShenandoahHeap::HAS_FORWARDED); + __ bne(CCR0, slowpath); + + __ bind(done); + __ block_comment("} try_resolve_jobject_in_native (shenandoahgc)"); +} + +// Special shenandoah CAS implementation that handles false negatives due +// to concurrent evacuation. That is, the CAS operation is intended to succeed in +// the following scenarios (success criteria): +// s1) The reference pointer ('base_addr') equals the expected ('expected') pointer. +// s2) The reference pointer refers to the from-space version of an already-evacuated +// object, whereas the expected pointer refers to the to-space version of the same object. +// Situations in which the reference pointer refers to the to-space version of an object +// and the expected pointer refers to the from-space version of the same object can not occur due to +// shenandoah's strong to-space invariant. This also implies that the reference stored in 'new_val' +// can not refer to the from-space version of an already-evacuated object. +// +// To guarantee correct behavior in concurrent environments, two races must be addressed: +// r1) A concurrent thread may heal the reference pointer (i.e., it is no longer referring to the +// from-space version but to the to-space version of the object in question). +// In this case, the CAS operation should succeed. +// r2) A concurrent thread may mutate the reference (i.e., the reference pointer refers to an entirely different object). +// In this case, the CAS operation should fail. +// +// By default, the value held in the 'result' register is zero to indicate failure of CAS, +// non-zero to indicate success. If 'is_cae' is set, the result is the most recently fetched +// value from 'base_addr' rather than a boolean success indicator. +void ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler *masm, Register base_addr, + Register expected, Register new_val, Register tmp1, Register tmp2, + bool is_cae, Register result) { + __ block_comment("cmpxchg_oop (shenandoahgc) {"); + + assert_different_registers(base_addr, new_val, tmp1, tmp2, result, R0); + assert_different_registers(base_addr, expected, tmp1, tmp2, result, R0); + + // Potential clash of 'success_flag' and 'tmp' is being accounted for. + Register success_flag = is_cae ? noreg : result, + current_value = is_cae ? result : tmp1, + tmp = is_cae ? tmp1 : result, + initial_value = tmp2; + + Label done, step_four; + + __ bind(step_four); + + /* ==== Step 1 ("Standard" CAS) ==== */ + // Fast path: The values stored in 'expected' and 'base_addr' are equal. + // Given that 'expected' must refer to the to-space object of an evacuated object (strong to-space invariant), + // no special processing is required. + if (UseCompressedOops) { + __ cmpxchgw(CCR0, current_value, expected, new_val, base_addr, MacroAssembler::MemBarNone, + false, success_flag, true); + } else { + __ cmpxchgd(CCR0, current_value, expected, new_val, base_addr, MacroAssembler::MemBarNone, + false, success_flag, NULL, true); + } + + // Skip the rest of the barrier if the CAS operation succeeds immediately. + // If it does not, the value stored at the address is either the from-space pointer of the + // referenced object (success criteria s2)) or simply another object. + __ beq(CCR0, done); + + /* ==== Step 2 (Null check) ==== */ + // The success criteria s2) cannot be matched with a null pointer + // (null pointers cannot be subject to concurrent evacuation). The failure of the CAS operation is thus legitimate. + __ cmpdi(CCR0, current_value, 0); + __ beq(CCR0, done); + + /* ==== Step 3 (reference pointer refers to from-space version; success criteria s2)) ==== */ + // To check whether the reference pointer refers to the from-space version, the forward + // pointer of the object referred to by the reference is resolved and compared against the expected pointer. + // If this check succeed, another CAS operation is issued with the from-space pointer being the expected pointer. + // + // Save the potential from-space pointer. + __ mr(initial_value, current_value); + + // Resolve forward pointer. + if (UseCompressedOops) { __ decode_heap_oop_not_null(current_value); } + resolve_forward_pointer_not_null(masm, current_value, tmp); + if (UseCompressedOops) { __ encode_heap_oop_not_null(current_value); } + + if (!is_cae) { + // 'success_flag' was overwritten by call to 'resovle_forward_pointer_not_null'. + // Load zero into register for the potential failure case. + __ li(success_flag, 0); + } + __ cmpd(CCR0, current_value, expected); + __ bne(CCR0, done); + + // Discard fetched value as it might be a reference to the from-space version of an object. + if (UseCompressedOops) { + __ cmpxchgw(CCR0, R0, initial_value, new_val, base_addr, MacroAssembler::MemBarNone, + false, success_flag); + } else { + __ cmpxchgd(CCR0, R0, initial_value, new_val, base_addr, MacroAssembler::MemBarNone, + false, success_flag); + } + + /* ==== Step 4 (Retry CAS with to-space pointer (success criteria s2) under race r1)) ==== */ + // The reference pointer could have been healed whilst the previous CAS operation was being performed. + // Another CAS operation must thus be issued with the to-space pointer being the expected pointer. + // If that CAS operation fails as well, race r2) must have occurred, indicating that + // the operation failure is legitimate. + // + // To keep the code's size small and thus improving cache (icache) performance, this highly + // unlikely case should be handled by the smallest possible code. Instead of emitting a third, + // explicit CAS operation, the code jumps back and reuses the first CAS operation (step 1) + // (passed arguments are identical). + // + // A failure of the CAS operation in step 1 would imply that the overall CAS operation is supposed + // to fail. Jumping back to step 1 requires, however, that step 2 and step 3 are re-executed as well. + // It is thus important to ensure that a re-execution of those steps does not put program correctness + // at risk: + // - Step 2: Either terminates in failure (desired result) or falls through to step 3. + // - Step 3: Terminates if the comparison between the forwarded, fetched pointer and the expected value + // fails. Unless the reference has been updated in the meanwhile once again, this is + // guaranteed to be the case. + // In case of a concurrent update, the CAS would be retried again. This is legitimate + // in terms of program correctness (even though it is not desired). + __ bne(CCR0, step_four); + + __ bind(done); + __ block_comment("} cmpxchg_oop (shenandoahgc)"); +} + +#undef __ + +#ifdef COMPILER1 + +#define __ ce->masm()-> + +void ShenandoahBarrierSetAssembler::gen_pre_barrier_stub(LIR_Assembler *ce, ShenandoahPreBarrierStub *stub) { + __ block_comment("gen_pre_barrier_stub (shenandoahgc) {"); + + ShenandoahBarrierSetC1 *bs = (ShenandoahBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); + + // GC status has already been verified by 'ShenandoahBarrierSetC1::pre_barrier'. + // This stub is the slowpath of that function. + + assert(stub->pre_val()->is_register(), "pre_val must be a register"); + Register pre_val = stub->pre_val()->as_register(); + + // If 'do_load()' returns false, the to-be-stored value is already available in 'stub->pre_val()' + // ("preloaded mode" of the store barrier). + if (stub->do_load()) { + ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false); + } + + // Fast path: Reference is null. + __ cmpdi(CCR0, pre_val, 0); + __ bc_far_optimized(Assembler::bcondCRbiIs1_bhintNoHint, __ bi0(CCR0, Assembler::equal), *stub->continuation()); + + // Argument passing via the stack. + __ std(pre_val, -8, R1_SP); + + __ load_const_optimized(R0, bs->pre_barrier_c1_runtime_code_blob()->code_begin()); + __ call_stub(R0); + + __ b(*stub->continuation()); + __ block_comment("} gen_pre_barrier_stub (shenandoahgc)"); +} + +void ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub(LIR_Assembler *ce, + ShenandoahLoadReferenceBarrierStub *stub) { + __ block_comment("gen_load_reference_barrier_stub (shenandoahgc) {"); + + ShenandoahBarrierSetC1 *bs = (ShenandoahBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); + + Register obj = stub->obj()->as_register(); + Register res = stub->result()->as_register(); + Register addr = stub->addr()->as_pointer_register(); + Register tmp1 = stub->tmp1()->as_register(); + Register tmp2 = stub->tmp2()->as_register(); + assert_different_registers(addr, res, tmp1, tmp2); + +#ifdef ASSERT + // Ensure that 'res' is 'R3_ARG1' and contains the same value as 'obj' to reduce the number of required + // copy instructions. + assert(R3_RET == res, "res must be r3"); + __ cmpd(CCR0, res, obj); + __ asm_assert_eq("result register must contain the reference stored in obj"); +#endif + + DecoratorSet decorators = stub->decorators(); + + /* ==== Check whether region is in collection set ==== */ + // GC status (unstable) has already been verified by 'ShenandoahBarrierSetC1::load_reference_barrier_impl'. + // This stub is the slowpath of that function. + + bool is_strong = ShenandoahBarrierSet::is_strong_access(decorators); + bool is_weak = ShenandoahBarrierSet::is_weak_access(decorators); + bool is_phantom = ShenandoahBarrierSet::is_phantom_access(decorators); + bool is_native = ShenandoahBarrierSet::is_native_access(decorators); + + if (is_strong) { + // Check whether object is in collection set. + __ load_const_optimized(tmp2, ShenandoahHeap::in_cset_fast_test_addr(), tmp1); + __ srdi(tmp1, obj, ShenandoahHeapRegion::region_size_bytes_shift_jint()); + __ lbzx(tmp2, tmp1, tmp2); + + __ andi_(tmp2, tmp2, 1); + __ bc_far_optimized(Assembler::bcondCRbiIs1_bhintNoHint, __ bi0(CCR0, Assembler::equal), *stub->continuation()); + } + + address blob_addr = nullptr; + + if (is_strong) { + if (is_native) { + blob_addr = bs->load_reference_barrier_strong_native_rt_code_blob()->code_begin(); + } else { + blob_addr = bs->load_reference_barrier_strong_rt_code_blob()->code_begin(); + } + } else if (is_weak) { + blob_addr = bs->load_reference_barrier_weak_rt_code_blob()->code_begin(); + } else { + assert(is_phantom, "only remaining strength"); + blob_addr = bs->load_reference_barrier_phantom_rt_code_blob()->code_begin(); + } + + assert(blob_addr != nullptr, "code blob cannot be found"); + + // Argument passing via the stack. 'obj' is passed implicitly (as asserted above). + __ std(addr, -8, R1_SP); + + __ load_const_optimized(tmp1, blob_addr, tmp2); + __ call_stub(tmp1); + + // 'res' is 'R3_RET'. The result is thus already in the correct register. + + __ b(*stub->continuation()); + __ block_comment("} gen_load_reference_barrier_stub (shenandoahgc)"); +} + +#undef __ + +#define __ sasm-> + +void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler *sasm) { + __ block_comment("generate_c1_pre_barrier_runtime_stub (shenandoahgc) {"); + + Label runtime, skip_barrier; + BarrierSet *bs = BarrierSet::barrier_set(); + + // Argument passing via the stack. + const int caller_stack_slots = 3; + + Register R0_pre_val = R0; + __ ld(R0, -8, R1_SP); + Register R11_tmp1 = R11_scratch1; + __ std(R11_tmp1, -16, R1_SP); + Register R12_tmp2 = R12_scratch2; + __ std(R12_tmp2, -24, R1_SP); + + /* ==== Check whether marking is active ==== */ + // Even though gc status was checked in 'ShenandoahBarrierSetAssembler::gen_pre_barrier_stub', + // another check is required as a safepoint might have been reached in the meantime (JDK-8140588). + __ lbz(R12_tmp2, in_bytes(ShenandoahThreadLocalData::gc_state_offset()), R16_thread); + + __ andi_(R12_tmp2, R12_tmp2, ShenandoahHeap::MARKING); + __ beq(CCR0, skip_barrier); + + /* ==== Add previous value directly to thread-local SATB mark queue ==== */ + // Check queue's capacity. Jump to runtime if no free slot is available. + __ ld(R12_tmp2, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()), R16_thread); + __ cmpdi(CCR0, R12_tmp2, 0); + __ beq(CCR0, runtime); + + // Capacity suffices. Decrement the queue's size by one slot (size of one oop). + __ addi(R12_tmp2, R12_tmp2, -wordSize); + __ std(R12_tmp2, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()), R16_thread); + + // Enqueue the previous value and skip the runtime invocation. + __ ld(R11_tmp1, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset()), R16_thread); + __ stdx(R0_pre_val, R11_tmp1, R12_tmp2); + __ b(skip_barrier); + + __ bind(runtime); + + /* ==== Invoke runtime to commit SATB mark queue to gc and allocate a new buffer ==== */ + // Save to-be-preserved registers. + const int nbytes_save = (MacroAssembler::num_volatile_regs + caller_stack_slots) * BytesPerWord; + __ save_volatile_gprs(R1_SP, -nbytes_save); + __ save_LR_CR(R11_tmp1); + __ push_frame_reg_args(nbytes_save, R11_tmp1); + + // Invoke runtime. + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry), R0_pre_val, R16_thread); + + // Restore to-be-preserved registers. + __ pop_frame(); + __ restore_LR_CR(R11_tmp1); + __ restore_volatile_gprs(R1_SP, -nbytes_save); + + __ bind(skip_barrier); + + // Restore spilled registers. + __ ld(R11_tmp1, -16, R1_SP); + __ ld(R12_tmp2, -24, R1_SP); + + __ blr(); + __ block_comment("} generate_c1_pre_barrier_runtime_stub (shenandoahgc)"); +} + +void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_stub(StubAssembler *sasm, + DecoratorSet decorators) { + __ block_comment("generate_c1_load_reference_barrier_runtime_stub (shenandoahgc) {"); + + // Argument passing via the stack. + const int caller_stack_slots = 1; + + // Save to-be-preserved registers. + const int nbytes_save = (MacroAssembler::num_volatile_regs - 1 // 'R3_ARG1' is skipped + + caller_stack_slots) * BytesPerWord; + __ save_volatile_gprs(R1_SP, -nbytes_save, true, false); + + // Load arguments from stack. + // No load required, as assured by assertions in 'ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub'. + Register R3_obj = R3_ARG1; + Register R4_load_addr = R4_ARG2; + __ ld(R4_load_addr, -8, R1_SP); + + Register R11_tmp = R11_scratch1; + + /* ==== Invoke runtime ==== */ + bool is_strong = ShenandoahBarrierSet::is_strong_access(decorators); + bool is_weak = ShenandoahBarrierSet::is_weak_access(decorators); + bool is_phantom = ShenandoahBarrierSet::is_phantom_access(decorators); + bool is_native = ShenandoahBarrierSet::is_native_access(decorators); + + address jrt_address = NULL; + + if (is_strong) { + if (is_native) { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong); + } else { + if (UseCompressedOops) { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong_narrow); + } else { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_strong); + } + } + } else if (is_weak) { + assert(!is_native, "weak load reference barrier must not be called off-heap"); + if (UseCompressedOops) { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow); + } else { + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak); + } + } else { + assert(is_phantom, "reference type must be phantom"); + assert(is_native, "phantom load reference barrier must be called off-heap"); + jrt_address = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom); + } + assert(jrt_address != NULL, "load reference barrier runtime routine cannot be found"); + + __ save_LR_CR(R11_tmp); + __ push_frame_reg_args(nbytes_save, R11_tmp); + + // Invoke runtime. Arguments are already stored in the corresponding registers. + __ call_VM_leaf(jrt_address, R3_obj, R4_load_addr); + + // Restore to-be-preserved registers. + __ pop_frame(); + __ restore_LR_CR(R11_tmp); + __ restore_volatile_gprs(R1_SP, -nbytes_save, true, false); // Skip 'R3_RET' register. + + __ blr(); + __ block_comment("} generate_c1_load_reference_barrier_runtime_stub (shenandoahgc)"); +} + +#undef __ + +#endif // COMPILER1 diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp new file mode 100644 index 00000000000..cf55f505b22 --- /dev/null +++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. + * Copyright (c) 2012, 2021 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. + * + */ + +#ifndef CPU_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP +#define CPU_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP + +#include "asm/macroAssembler.hpp" +#include "gc/shared/barrierSetAssembler.hpp" +#include "gc/shenandoah/shenandoahBarrierSet.hpp" + +#ifdef COMPILER1 + +class LIR_Assembler; +class ShenandoahPreBarrierStub; +class ShenandoahLoadReferenceBarrierStub; +class StubAssembler; + +#endif + +class StubCodeGenerator; + +class ShenandoahBarrierSetAssembler: public BarrierSetAssembler { +private: + + /* ==== Actual barrier implementations ==== */ + void satb_write_barrier_impl(MacroAssembler* masm, DecoratorSet decorators, + Register base, RegisterOrConstant ind_or_offs, + Register pre_val, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level); + + void load_reference_barrier_impl(MacroAssembler* masm, DecoratorSet decorators, + Register base, RegisterOrConstant ind_or_offs, + Register dst, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level); + + /* ==== Helper methods for barrier implementations ==== */ + void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp); + +public: + + /* ==== C1 stubs ==== */ +#ifdef COMPILER1 + + void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub); + + void gen_load_reference_barrier_stub(LIR_Assembler* ce, ShenandoahLoadReferenceBarrierStub* stub); + + void generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm); + + void generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, DecoratorSet decorators); + +#endif + + /* ==== Available barriers (facades of the actual implementations) ==== */ + void satb_write_barrier(MacroAssembler* masm, + Register base, RegisterOrConstant ind_or_offs, + Register tmp1, Register tmp2, Register tmp3, + MacroAssembler::PreservationLevel preservation_level); + + void iu_barrier(MacroAssembler* masm, + Register val, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level, DecoratorSet decorators = 0); + + void load_reference_barrier(MacroAssembler* masm, DecoratorSet decorators, + Register base, RegisterOrConstant ind_or_offs, + Register dst, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level); + + /* ==== Helper methods used by C1 and C2 ==== */ + void cmpxchg_oop(MacroAssembler* masm, Register base_addr, Register expected, Register new_val, + Register tmp1, Register tmp2, + bool is_cae, Register result); + + /* ==== Access api ==== */ + virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, + Register src, Register dst, Register count, Register preserve1, Register preserve2); + + virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, + Register base, RegisterOrConstant ind_or_offs, Register val, + Register tmp1, Register tmp2, Register tmp3, + MacroAssembler::PreservationLevel preservation_level); + + virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, + Register base, RegisterOrConstant ind_or_offs, Register dst, + Register tmp1, Register tmp2, + MacroAssembler::PreservationLevel preservation_level, Label* L_handle_null = NULL); + + virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register dst, Register jni_env, + Register obj, Register tmp, Label& slowpath); +}; + +#endif // CPU_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoah_ppc.ad b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoah_ppc.ad new file mode 100644 index 00000000000..4825ca9cf81 --- /dev/null +++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoah_ppc.ad @@ -0,0 +1,217 @@ +// +// Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved. +// Copyright (c) 2012, 2021 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. +// +// + +source_hpp %{ +#include "gc/shenandoah/shenandoahBarrierSet.hpp" +#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp" +%} + +// Weak compareAndSwap operations are treated as strong compareAndSwap operations. +// This is motivated by the retry logic of ShenandoahBarrierSetAssembler::cmpxchg_oop which is hard to realise +// using weak CAS operations. + +instruct compareAndSwapP_shenandoah(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, + iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndSwapP mem (Binary oldval newval))); + match(Set res (ShenandoahWeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire + && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst); + + format %{ "CMPXCHG $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + false, $res$$Register + ); + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndSwapN_shenandoah(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, + iRegNdst tmp1, iRegNdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndSwapN mem (Binary oldval newval))); + match(Set res (ShenandoahWeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire + && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst); + + format %{ "CMPXCHG $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + false, $res$$Register + ); + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndSwapP_acq_shenandoah(iRegIdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, + iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndSwapP mem (Binary oldval newval))); + match(Set res (ShenandoahWeakCompareAndSwapP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() == MemNode::acquire + || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst); + + format %{ "CMPXCHGD acq $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + false, $res$$Register + ); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndSwapN_acq_shenandoah(iRegIdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, + iRegNdst tmp1, iRegNdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndSwapN mem (Binary oldval newval))); + match(Set res (ShenandoahWeakCompareAndSwapN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() == MemNode::acquire + || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst); + + format %{ "CMPXCHGD acq $res, $mem, $oldval, $newval; as bool; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + false, $res$$Register + ); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndExchangeP_shenandoah(iRegPdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, + iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire + && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst); + + format %{ "CMPXCHGD $res, $mem, $oldval, $newval; as ptr; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + true, $res$$Register + ); + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndExchangeN_shenandoah(iRegNdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, + iRegNdst tmp1, iRegNdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() != MemNode::acquire + && ((CompareAndSwapNode*)n)->order() != MemNode::seqcst); + + format %{ "CMPXCHGD $res, $mem, $oldval, $newval; as ptr; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + true, $res$$Register + ); + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndExchangePAcq_shenandoah(iRegPdst res, indirect mem, iRegPsrc oldval, iRegPsrc newval, + iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndExchangeP mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() == MemNode::acquire + || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst); + + format %{ "CMPXCHGD acq $res, $mem, $oldval, $newval; as ptr; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + true, $res$$Register + ); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} + +instruct compareAndExchangeNAcq_shenandoah(iRegNdst res, indirect mem, iRegNsrc oldval, iRegNsrc newval, + iRegNdst tmp1, iRegNdst tmp2, flagsRegCR0 cr) %{ + match(Set res (ShenandoahCompareAndExchangeN mem (Binary oldval newval))); + effect(TEMP_DEF res, TEMP tmp1, TEMP tmp2, KILL cr); + + predicate(((CompareAndSwapNode*)n)->order() == MemNode::acquire + || ((CompareAndSwapNode*)n)->order() == MemNode::seqcst); + + format %{ "CMPXCHGD acq $res, $mem, $oldval, $newval; as ptr; ptr" %} + ins_encode %{ + ShenandoahBarrierSet::assembler()->cmpxchg_oop( + &_masm, + $mem$$Register, $oldval$$Register, $newval$$Register, + $tmp1$$Register, $tmp2$$Register, + true, $res$$Register + ); + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ isync(); + } else { + __ sync(); + } + %} + ins_pipe(pipe_class_default); +%} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp index 624f004e3cc..c7e0c9b0cd9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp @@ -35,7 +35,7 @@ #include "utilities/defaultStream.hpp" void ShenandoahArguments::initialize() { -#if !(defined AARCH64 || defined AMD64 || defined IA32) +#if !(defined AARCH64 || defined AMD64 || defined IA32 || defined PPC64) vm_exit_during_initialization("Shenandoah GC is not supported on this platform."); #endif -- GitLab From 36bd4a35fbee077c00c1f4240f1f02f4d7d5f656 Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Thu, 18 Nov 2021 20:06:13 +0000 Subject: [PATCH 391/890] 8277404: Test VMDeprecatedOptions.java failing with Unable to create shared archive file Reviewed-by: dcubed --- test/hotspot/jtreg/ProblemList.txt | 1 - .../jtreg/runtime/CommandLine/VMDeprecatedOptions.java | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index e584b5cf395..fcc12d16677 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -106,7 +106,6 @@ runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java 8277350 macosx-x64 -runtime/CommandLine/VMDeprecatedOptions.java 8277404 windows-x64 applications/jcstress/copy.java 8229852 linux-all diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index ae1165da8a3..b8e6c41c1ba 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -48,9 +48,9 @@ public class VMDeprecatedOptions { {"TLABStats", "false"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, {"UseSharedSpaces", "false"}, - {"RequireSharedSpaces", "true"}, - {"DumpSharedSpaces", "true"}, - {"DynamicDumpSharedSpaces", "true"}, + {"RequireSharedSpaces", "false"}, + {"DumpSharedSpaces", "false"}, + {"DynamicDumpSharedSpaces", "false"}, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, -- GitLab From 89b125f4d4d6a467185b4b39861fd530a738e67f Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Thu, 18 Nov 2021 21:32:00 +0000 Subject: [PATCH 392/890] 8275527: Refactor forward pointer access Reviewed-by: tschatzl, stefank --- src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp | 5 +++-- .../share/gc/g1/g1FullGCCompactionPoint.cpp | 16 ++-------------- .../share/gc/g1/g1FullGCOopClosures.inline.hpp | 16 +++++----------- src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp | 3 +-- src/hotspot/share/gc/g1/g1OopClosures.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1YoungCollector.cpp | 2 +- src/hotspot/share/gc/serial/markSweep.inline.hpp | 9 ++------- src/hotspot/share/gc/shared/space.cpp | 4 ++-- src/hotspot/share/oops/oop.inline.hpp | 5 +++-- 9 files changed, 20 insertions(+), 42 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp index d0dc0593d3b..2ccda820fb0 100644 --- a/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp +++ b/src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp @@ -60,12 +60,13 @@ public: size_t G1FullGCCompactTask::G1CompactRegionClosure::apply(oop obj) { size_t size = obj->size(); - HeapWord* destination = cast_from_oop(obj->forwardee()); - if (destination == NULL) { + if (!obj->is_forwarded()) { // Object not moving return size; } + HeapWord* destination = cast_from_oop(obj->forwardee()); + // copy object and reinit its mark HeapWord* obj_addr = cast_from_oop(obj); assert(obj_addr != destination, "everything in this pass should be moving"); diff --git a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp index e14f0ea2569..25ff38da77f 100644 --- a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp +++ b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp @@ -103,21 +103,9 @@ void G1FullGCCompactionPoint::forward(oop object, size_t size) { // Store a forwarding pointer if the object should be moved. if (cast_from_oop(object) != _compaction_top) { object->forward_to(cast_to_oop(_compaction_top)); + assert(object->is_forwarded(), "must be forwarded"); } else { - if (object->forwardee() != NULL) { - // Object should not move but mark-word is used so it looks like the - // object is forwarded. Need to clear the mark and it's no problem - // since it will be restored by preserved marks. - object->init_mark(); - } else { - // Make sure object has the correct mark-word set or that it will be - // fixed when restoring the preserved marks. - assert(object->mark() == markWord::prototype() || // Correct mark - object->mark_must_be_preserved(), // Will be restored by PreservedMarksSet - "should have correct prototype obj: " PTR_FORMAT " mark: " PTR_FORMAT " prototype: " PTR_FORMAT, - p2i(object), object->mark().value(), markWord::prototype().value()); - } - assert(object->forwardee() == NULL, "should be forwarded to NULL"); + assert(!object->is_forwarded(), "must not be forwarded"); } // Update compaction values. diff --git a/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp index d9a1759b029..f4b9d9e1176 100644 --- a/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp @@ -77,19 +77,13 @@ template inline void G1AdjustClosure::adjust_pointer(T* p) { return; } - oop forwardee = obj->forwardee(); - if (forwardee == NULL) { - // Not forwarded, return current reference. - assert(obj->mark() == markWord::prototype() || // Correct mark - obj->mark_must_be_preserved(), // Will be restored by PreservedMarksSet - "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT, - p2i(obj), obj->mark().value(), markWord::prototype().value()); - return; + if (obj->is_forwarded()) { + oop forwardee = obj->forwardee(); + // Forwarded, just update. + assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space"); + RawAccess::oop_store(p, forwardee); } - // Forwarded, just update. - assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space"); - RawAccess::oop_store(p, forwardee); } inline void G1AdjustClosure::do_oop(oop* p) { do_oop_work(p); } diff --git a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp index 817966a273b..ea7f94880c4 100644 --- a/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp +++ b/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp @@ -168,8 +168,7 @@ size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosure::apply(oop object) { size_t G1FullGCPrepareTask::G1RePrepareClosure::apply(oop obj) { // We only re-prepare objects forwarded within the current region, so // skip objects that are already forwarded to another region. - oop forwarded_to = obj->forwardee(); - if (forwarded_to != NULL && !_current->is_in(forwarded_to)) { + if (obj->is_forwarded() && !_current->is_in(obj->forwardee())) { return obj->size(); } diff --git a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp index 74b5c19ff45..ac8c370bfd0 100644 --- a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp +++ b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.cpp b/src/hotspot/share/gc/g1/g1YoungCollector.cpp index c900c1ce248..51fbfbb20dd 100644 --- a/src/hotspot/share/gc/g1/g1YoungCollector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungCollector.cpp @@ -856,7 +856,7 @@ public: return; } if (region_attr.is_in_cset()) { - assert( obj->is_forwarded(), "invariant" ); + assert(obj->is_forwarded(), "invariant" ); *p = obj->forwardee(); } else { assert(!obj->is_forwarded(), "invariant" ); diff --git a/src/hotspot/share/gc/serial/markSweep.inline.hpp b/src/hotspot/share/gc/serial/markSweep.inline.hpp index ee0ef1e0b1b..27fb8bb2f29 100644 --- a/src/hotspot/share/gc/serial/markSweep.inline.hpp +++ b/src/hotspot/share/gc/serial/markSweep.inline.hpp @@ -88,13 +88,8 @@ template inline void MarkSweep::adjust_pointer(T* p) { oop obj = CompressedOops::decode_not_null(heap_oop); assert(Universe::heap()->is_in(obj), "should be in heap"); - oop new_obj = cast_to_oop(obj->mark().decode_pointer()); - - assert(new_obj != NULL || // is forwarding ptr? - obj->mark() == markWord::prototype(), // not gc marked? - "should be forwarded"); - - if (new_obj != NULL) { + if (obj->is_forwarded()) { + oop new_obj = obj->forwardee(); assert(is_object_aligned(new_obj), "oop must be aligned"); RawAccess::oop_store(p, new_obj); } diff --git a/src/hotspot/share/gc/shared/space.cpp b/src/hotspot/share/gc/shared/space.cpp index 1638d994e40..560225f88b9 100644 --- a/src/hotspot/share/gc/shared/space.cpp +++ b/src/hotspot/share/gc/shared/space.cpp @@ -376,7 +376,7 @@ HeapWord* CompactibleSpace::forward(oop q, size_t size, // if the object isn't moving we can just set the mark to the default // mark and handle it specially later on. q->init_mark(); - assert(q->forwardee() == NULL, "should be forwarded to NULL"); + assert(!q->is_forwarded(), "should not be forwarded"); } compact_top += size; @@ -536,7 +536,7 @@ void CompactibleSpace::compact() { debug_only(HeapWord* prev_obj = NULL); while (cur_obj < end_of_live) { - if (!cast_to_oop(cur_obj)->is_gc_marked()) { + if (!cast_to_oop(cur_obj)->is_forwarded()) { debug_only(prev_obj = cur_obj); // The first word of the dead object contains a pointer to the next live object or end of space. cur_obj = *(HeapWord**)cur_obj; diff --git a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp index c161e479deb..371e97824f7 100644 --- a/src/hotspot/share/oops/oop.inline.hpp +++ b/src/hotspot/share/oops/oop.inline.hpp @@ -289,12 +289,13 @@ oop oopDesc::forward_to_atomic(oop p, markWord compare, atomic_memory_order orde // The forwardee is used when copying during scavenge and mark-sweep. // It does need to clear the low two locking- and GC-related bits. oop oopDesc::forwardee() const { + assert(is_forwarded(), "only decode when actually forwarded"); return cast_to_oop(mark().decode_pointer()); } // The following method needs to be MT safe. uint oopDesc::age() const { - assert(!is_forwarded(), "Attempt to read age from forwarded mark"); + assert(!mark().is_marked(), "Attempt to read age from forwarded mark"); if (has_displaced_mark()) { return displaced_mark().age(); } else { @@ -303,7 +304,7 @@ uint oopDesc::age() const { } void oopDesc::incr_age() { - assert(!is_forwarded(), "Attempt to increment age of forwarded mark"); + assert(!mark().is_marked(), "Attempt to increment age of forwarded mark"); if (has_displaced_mark()) { set_displaced_mark(displaced_mark().incr_age()); } else { -- GitLab From 839033baf61ca7f10437e8e53b2114b081d97ea9 Mon Sep 17 00:00:00 2001 From: Man Cao Date: Thu, 18 Nov 2021 23:35:01 +0000 Subject: [PATCH 393/890] 8276976: Rename LIR_OprDesc to LIR_Opr Co-authored-by: Chuck Rasbold Reviewed-by: thartmann, iveresov --- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 2 +- src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp | 14 +- src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp | 2 +- src/hotspot/cpu/arm/c1_LIR_arm.cpp | 14 +- src/hotspot/cpu/ppc/c1_LIR_ppc.cpp | 14 +- src/hotspot/cpu/s390/c1_LIR_s390.cpp | 14 +- src/hotspot/cpu/x86/c1_LIR_x86.cpp | 18 +- src/hotspot/share/c1/c1_LIR.cpp | 20 +- src/hotspot/share/c1/c1_LIR.hpp | 317 +++++++++--------- src/hotspot/share/c1/c1_LIRGenerator.cpp | 8 +- src/hotspot/share/c1/c1_LIRGenerator.hpp | 2 +- src/hotspot/share/c1/c1_LinearScan.cpp | 34 +- src/hotspot/share/c1/c1_LinearScan.hpp | 4 +- src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp | 4 +- 14 files changed, 229 insertions(+), 238 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 7582444a1db..1cae3a3f3b6 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -1564,7 +1564,7 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { assert(op->addr()->is_address(), "what else?"); LIR_Address* addr_ptr = op->addr()->as_address_ptr(); assert(addr_ptr->disp() == 0, "need 0 disp"); - assert(addr_ptr->index() == LIR_OprDesc::illegalOpr(), "need 0 index"); + assert(addr_ptr->index() == LIR_Opr::illegalOpr(), "need 0 index"); addr = as_reg(addr_ptr->base()); } Register newval = as_reg(op->new_value()); diff --git a/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp index 58e1cf5ae63..0dd1a2156e8 100644 --- a/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp @@ -26,22 +26,22 @@ #include "asm/register.hpp" #include "c1/c1_LIR.hpp" -FloatRegister LIR_OprDesc::as_float_reg() const { +FloatRegister LIR_Opr::as_float_reg() const { return as_FloatRegister(fpu_regnr()); } -FloatRegister LIR_OprDesc::as_double_reg() const { +FloatRegister LIR_Opr::as_double_reg() const { return as_FloatRegister(fpu_regnrLo()); } // Reg2 unused. LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) { assert(as_FloatRegister(reg2) == fnoreg, "Not used on this platform"); - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg1 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg1 << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size); } #ifndef PRODUCT diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp index 2ee7b68f720..4d6ce557d0a 100644 --- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp @@ -1381,7 +1381,7 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { op->addr()->as_pointer_register() : op->addr()->as_address_ptr()->base()->as_pointer_register(); assert(op->addr()->is_register() || op->addr()->as_address_ptr()->disp() == 0, "unexpected disp"); - assert(op->addr()->is_register() || op->addr()->as_address_ptr()->index() == LIR_OprDesc::illegalOpr(), "unexpected index"); + assert(op->addr()->is_register() || op->addr()->as_address_ptr()->index() == LIR_Opr::illegalOpr(), "unexpected index"); if (op->code() == lir_cas_int || op->code() == lir_cas_obj) { Register cmpval = op->cmp_value()->as_register(); Register newval = op->new_value()->as_register(); diff --git a/src/hotspot/cpu/arm/c1_LIR_arm.cpp b/src/hotspot/cpu/arm/c1_LIR_arm.cpp index 60bd5265bfb..9d70fd12f35 100644 --- a/src/hotspot/cpu/arm/c1_LIR_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIR_arm.cpp @@ -25,21 +25,21 @@ #include "precompiled.hpp" #include "c1/c1_LIR.hpp" -FloatRegister LIR_OprDesc::as_float_reg() const { +FloatRegister LIR_Opr::as_float_reg() const { return as_FloatRegister(fpu_regnr()); } -FloatRegister LIR_OprDesc::as_double_reg() const { +FloatRegister LIR_Opr::as_double_reg() const { return as_FloatRegister(fpu_regnrLo()); } LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) { assert(as_FloatRegister(reg2) != fnoreg, "Arm32 holds double in two regs."); - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg2 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg2 << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size); } #ifndef PRODUCT diff --git a/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp index fb234e82985..d031aaa1e40 100644 --- a/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIR_ppc.cpp @@ -27,22 +27,22 @@ #include "asm/register.hpp" #include "c1/c1_LIR.hpp" -FloatRegister LIR_OprDesc::as_float_reg() const { +FloatRegister LIR_Opr::as_float_reg() const { return as_FloatRegister(fpu_regnr()); } -FloatRegister LIR_OprDesc::as_double_reg() const { +FloatRegister LIR_Opr::as_double_reg() const { return as_FloatRegister(fpu_regnrLo()); } // Reg2 unused. LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) { assert(!as_FloatRegister(reg2)->is_valid(), "Not used on this platform"); - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg1 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg1 << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size); } #ifndef PRODUCT diff --git a/src/hotspot/cpu/s390/c1_LIR_s390.cpp b/src/hotspot/cpu/s390/c1_LIR_s390.cpp index 3c46915e475..4788a398de8 100644 --- a/src/hotspot/cpu/s390/c1_LIR_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIR_s390.cpp @@ -29,22 +29,22 @@ #include "c1/c1_LIR.hpp" -FloatRegister LIR_OprDesc::as_float_reg() const { +FloatRegister LIR_Opr::as_float_reg() const { return FrameMap::nr2floatreg(fpu_regnr()); } -FloatRegister LIR_OprDesc::as_double_reg() const { +FloatRegister LIR_Opr::as_double_reg() const { return FrameMap::nr2floatreg(fpu_regnrHi()); } // Reg2 unused. LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) { assert(!as_FloatRegister(reg2)->is_valid(), "Not used on this platform"); - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg1 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg1 << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size); } #ifndef PRODUCT diff --git a/src/hotspot/cpu/x86/c1_LIR_x86.cpp b/src/hotspot/cpu/x86/c1_LIR_x86.cpp index f7e3392d2e5..6bdbfd1824c 100644 --- a/src/hotspot/cpu/x86/c1_LIR_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIR_x86.cpp @@ -28,21 +28,21 @@ #include "c1/c1_LIR.hpp" -FloatRegister LIR_OprDesc::as_float_reg() const { +FloatRegister LIR_Opr::as_float_reg() const { ShouldNotReachHere(); return fnoreg; } -FloatRegister LIR_OprDesc::as_double_reg() const { +FloatRegister LIR_Opr::as_double_reg() const { ShouldNotReachHere(); return fnoreg; } -XMMRegister LIR_OprDesc::as_xmm_float_reg() const { +XMMRegister LIR_Opr::as_xmm_float_reg() const { return FrameMap::nr2xmmreg(xmm_regnr()); } -XMMRegister LIR_OprDesc::as_xmm_double_reg() const { +XMMRegister LIR_Opr::as_xmm_double_reg() const { assert(xmm_regnrLo() == xmm_regnrHi(), "assumed in calculation"); return FrameMap::nr2xmmreg(xmm_regnrLo()); } @@ -50,11 +50,11 @@ XMMRegister LIR_OprDesc::as_xmm_double_reg() const { // Reg2 unused. LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) { assert(as_FloatRegister(reg2) == fnoreg, "Not used on this platform"); - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg1 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg1 << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size); } #ifndef PRODUCT diff --git a/src/hotspot/share/c1/c1_LIR.cpp b/src/hotspot/share/c1/c1_LIR.cpp index 6b1310dfd83..4ab1d887e3f 100644 --- a/src/hotspot/share/c1/c1_LIR.cpp +++ b/src/hotspot/share/c1/c1_LIR.cpp @@ -33,15 +33,15 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/vm_version.hpp" -Register LIR_OprDesc::as_register() const { +Register LIR_Opr::as_register() const { return FrameMap::cpu_rnr2reg(cpu_regnr()); } -Register LIR_OprDesc::as_register_lo() const { +Register LIR_Opr::as_register_lo() const { return FrameMap::cpu_rnr2reg(cpu_regnrLo()); } -Register LIR_OprDesc::as_register_hi() const { +Register LIR_Opr::as_register_hi() const { return FrameMap::cpu_rnr2reg(cpu_regnrHi()); } @@ -93,7 +93,7 @@ LIR_Address::Scale LIR_Address::scale(BasicType type) { //--------------------------------------------------- -char LIR_OprDesc::type_char(BasicType t) { +char LIR_Opr::type_char(BasicType t) { switch (t) { case T_ARRAY: t = T_OBJECT; @@ -121,7 +121,7 @@ char LIR_OprDesc::type_char(BasicType t) { } #ifndef PRODUCT -void LIR_OprDesc::validate_type() const { +void LIR_Opr::validate_type() const { #ifdef ASSERT if (!is_pointer() && !is_illegal()) { @@ -173,7 +173,7 @@ void LIR_OprDesc::validate_type() const { #endif // PRODUCT -bool LIR_OprDesc::is_oop() const { +bool LIR_Opr::is_oop() const { if (is_pointer()) { return pointer()->is_oop_pointer(); } else { @@ -1373,7 +1373,7 @@ void LIR_List::unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scr void check_LIR() { // cannot do the proper checking as PRODUCT and other modes return different results - // guarantee(sizeof(LIR_OprDesc) == wordSize, "may not have a v-table"); + // guarantee(sizeof(LIR_Opr) == wordSize, "may not have a v-table"); } @@ -1448,12 +1448,12 @@ void print_LIR(BlockList* blocks) { } #else -// LIR_OprDesc -void LIR_OprDesc::print() const { +// LIR_Opr +void LIR_Opr::print() const { print(tty); } -void LIR_OprDesc::print(outputStream* out) const { +void LIR_Opr::print(outputStream* out) const { if (is_illegal()) { return; } diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp index 6a6f33b7755..9334ae273d0 100644 --- a/src/hotspot/share/c1/c1_LIR.hpp +++ b/src/hotspot/share/c1/c1_LIR.hpp @@ -478,40 +478,31 @@ class LIR_Opr { void print(outputStream* out) const PRODUCT_RETURN; }; -// TODO: Remove this hack. -// UGLY HACK: add a type alias. `LIR_Opr` is not actually equivalent to the -// previous `LIR_OprDesc` (`LIR_Opr` is like more similar to previous -// `LIR_OprDesc*`). The only purpose of this typedef is so that the various -// `LIR_OprDesc::enum_value` scattered everywhere don't need to be -// modified. This should be removed, and a textual replacement of -// `LIR_OprDesc::` to `LIR_Opr::` done throughout the code. -typedef LIR_Opr LIR_OprDesc; - -inline LIR_OprDesc::OprType as_OprType(BasicType type) { +inline LIR_Opr::OprType as_OprType(BasicType type) { switch (type) { - case T_INT: return LIR_OprDesc::int_type; - case T_LONG: return LIR_OprDesc::long_type; - case T_FLOAT: return LIR_OprDesc::float_type; - case T_DOUBLE: return LIR_OprDesc::double_type; + case T_INT: return LIR_Opr::int_type; + case T_LONG: return LIR_Opr::long_type; + case T_FLOAT: return LIR_Opr::float_type; + case T_DOUBLE: return LIR_Opr::double_type; case T_OBJECT: - case T_ARRAY: return LIR_OprDesc::object_type; - case T_ADDRESS: return LIR_OprDesc::address_type; - case T_METADATA: return LIR_OprDesc::metadata_type; + case T_ARRAY: return LIR_Opr::object_type; + case T_ADDRESS: return LIR_Opr::address_type; + case T_METADATA: return LIR_Opr::metadata_type; case T_ILLEGAL: // fall through - default: ShouldNotReachHere(); return LIR_OprDesc::unknown_type; + default: ShouldNotReachHere(); return LIR_Opr::unknown_type; } } -inline BasicType as_BasicType(LIR_OprDesc::OprType t) { +inline BasicType as_BasicType(LIR_Opr::OprType t) { switch (t) { - case LIR_OprDesc::int_type: return T_INT; - case LIR_OprDesc::long_type: return T_LONG; - case LIR_OprDesc::float_type: return T_FLOAT; - case LIR_OprDesc::double_type: return T_DOUBLE; - case LIR_OprDesc::object_type: return T_OBJECT; - case LIR_OprDesc::address_type: return T_ADDRESS; - case LIR_OprDesc::metadata_type:return T_METADATA; - case LIR_OprDesc::unknown_type: // fall through + case LIR_Opr::int_type: return T_INT; + case LIR_Opr::long_type: return T_LONG; + case LIR_Opr::float_type: return T_FLOAT; + case LIR_Opr::double_type: return T_DOUBLE; + case LIR_Opr::object_type: return T_OBJECT; + case LIR_Opr::address_type: return T_ADDRESS; + case LIR_Opr::metadata_type:return T_METADATA; + case LIR_Opr::unknown_type: // fall through default: ShouldNotReachHere(); return T_ILLEGAL; } } @@ -549,14 +540,14 @@ class LIR_Address: public LIR_OprPtr { LIR_Address(LIR_Opr base, intx disp, BasicType type): _base(base) - , _index(LIR_OprDesc::illegalOpr()) + , _index(LIR_Opr::illegalOpr()) , _scale(times_1) , _disp(disp) , _type(type) { verify(); } LIR_Address(LIR_Opr base, BasicType type): _base(base) - , _index(LIR_OprDesc::illegalOpr()) + , _index(LIR_Opr::illegalOpr()) , _scale(times_1) , _disp(0) , _type(type) { verify(); } @@ -600,43 +591,43 @@ class LIR_OprFact: public AllStatic { static LIR_Opr nullOpr; static LIR_Opr single_cpu(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::int_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::int_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size); } static LIR_Opr single_cpu_oop(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::object_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::object_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size); } static LIR_Opr single_cpu_address(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::address_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::address_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size); } static LIR_Opr single_cpu_metadata(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::metadata_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::metadata_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size); } static LIR_Opr double_cpu(int reg1, int reg2) { LP64_ONLY(assert(reg1 == reg2, "must be identical")); - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg2 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::long_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg2 << LIR_Opr::reg2_shift) | + LIR_Opr::long_type | + LIR_Opr::cpu_register | + LIR_Opr::double_size); } static LIR_Opr single_fpu(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::float_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::single_size); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::float_type | + LIR_Opr::fpu_register | + LIR_Opr::single_size); } // Platform dependant. @@ -644,40 +635,40 @@ class LIR_OprFact: public AllStatic { #ifdef ARM32 static LIR_Opr single_softfp(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::float_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::float_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size); } static LIR_Opr double_softfp(int reg1, int reg2) { - return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) | - (reg2 << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::double_size); + return (LIR_Opr)(intptr_t)((reg1 << LIR_Opr::reg1_shift) | + (reg2 << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::cpu_register | + LIR_Opr::double_size); } #endif // ARM32 #if defined(X86) static LIR_Opr single_xmm(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - LIR_OprDesc::float_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::is_xmm_mask); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + LIR_Opr::float_type | + LIR_Opr::fpu_register | + LIR_Opr::single_size | + LIR_Opr::is_xmm_mask); } static LIR_Opr double_xmm(int reg) { - return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | - (reg << LIR_OprDesc::reg2_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size | - LIR_OprDesc::is_xmm_mask); + return (LIR_Opr)(intptr_t)((reg << LIR_Opr::reg1_shift) | + (reg << LIR_Opr::reg2_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size | + LIR_Opr::is_xmm_mask); } #endif // X86 static LIR_Opr virtual_register(int index, BasicType type) { - if (index > LIR_OprDesc::vreg_max) { + if (index > LIR_Opr::vreg_max) { // Running out of virtual registers. Caller should bailout. return illegalOpr; } @@ -686,75 +677,75 @@ class LIR_OprFact: public AllStatic { switch (type) { case T_OBJECT: // fall through case T_ARRAY: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::object_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::object_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size | + LIR_Opr::virtual_mask); break; case T_METADATA: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::metadata_type| - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::metadata_type| + LIR_Opr::cpu_register | + LIR_Opr::single_size | + LIR_Opr::virtual_mask); break; case T_INT: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::int_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::int_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size | + LIR_Opr::virtual_mask); break; case T_ADDRESS: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::address_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::address_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size | + LIR_Opr::virtual_mask); break; case T_LONG: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::long_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::double_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::long_type | + LIR_Opr::cpu_register | + LIR_Opr::double_size | + LIR_Opr::virtual_mask); break; #ifdef __SOFTFP__ case T_FLOAT: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::float_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::float_type | + LIR_Opr::cpu_register | + LIR_Opr::single_size | + LIR_Opr::virtual_mask); break; case T_DOUBLE: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::double_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::double_type | + LIR_Opr::cpu_register | + LIR_Opr::double_size | + LIR_Opr::virtual_mask); break; #else // __SOFTFP__ case T_FLOAT: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::float_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::single_size | - LIR_OprDesc::virtual_mask); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::float_type | + LIR_Opr::fpu_register | + LIR_Opr::single_size | + LIR_Opr::virtual_mask); break; case - T_DOUBLE: res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::fpu_register | - LIR_OprDesc::double_size | - LIR_OprDesc::virtual_mask); + T_DOUBLE: res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::double_type | + LIR_Opr::fpu_register | + LIR_Opr::double_size | + LIR_Opr::virtual_mask); break; #endif // __SOFTFP__ default: ShouldNotReachHere(); res = illegalOpr; @@ -763,20 +754,20 @@ class LIR_OprFact: public AllStatic { #ifdef ASSERT res->validate_type(); assert(res->vreg_number() == index, "conversion check"); - assert(index >= LIR_OprDesc::vreg_base, "must start at vreg_base"); - assert(index <= (max_jint >> LIR_OprDesc::data_shift), "index is too big"); + assert(index >= LIR_Opr::vreg_base, "must start at vreg_base"); + assert(index <= (max_jint >> LIR_Opr::data_shift), "index is too big"); // old-style calculation; check if old and new method are equal - LIR_OprDesc::OprType t = as_OprType(type); + LIR_Opr::OprType t = as_OprType(type); #ifdef __SOFTFP__ - LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | + LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | t | - LIR_OprDesc::cpu_register | - LIR_OprDesc::size_for(type) | LIR_OprDesc::virtual_mask); + LIR_Opr::cpu_register | + LIR_Opr::size_for(type) | LIR_Opr::virtual_mask); #else // __SOFTFP__ - LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | t | - ((type == T_FLOAT || type == T_DOUBLE) ? LIR_OprDesc::fpu_register : LIR_OprDesc::cpu_register) | - LIR_OprDesc::size_for(type) | LIR_OprDesc::virtual_mask); + LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | t | + ((type == T_FLOAT || type == T_DOUBLE) ? LIR_Opr::fpu_register : LIR_Opr::cpu_register) | + LIR_Opr::size_for(type) | LIR_Opr::virtual_mask); assert(res == old_res, "old and new method not equal"); #endif // __SOFTFP__ #endif // ASSERT @@ -792,50 +783,50 @@ class LIR_OprFact: public AllStatic { switch (type) { case T_OBJECT: // fall through case T_ARRAY: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::object_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::single_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::object_type | + LIR_Opr::stack_value | + LIR_Opr::single_size); break; case T_METADATA: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::metadata_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::single_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::metadata_type | + LIR_Opr::stack_value | + LIR_Opr::single_size); break; case T_INT: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::int_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::single_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::int_type | + LIR_Opr::stack_value | + LIR_Opr::single_size); break; case T_ADDRESS: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::address_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::single_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::address_type | + LIR_Opr::stack_value | + LIR_Opr::single_size); break; case T_LONG: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::long_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::double_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::long_type | + LIR_Opr::stack_value | + LIR_Opr::double_size); break; case T_FLOAT: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::float_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::single_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::float_type | + LIR_Opr::stack_value | + LIR_Opr::single_size); break; case T_DOUBLE: - res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::double_type | - LIR_OprDesc::stack_value | - LIR_OprDesc::double_size); + res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::double_type | + LIR_Opr::stack_value | + LIR_Opr::double_size); break; default: ShouldNotReachHere(); res = illegalOpr; @@ -843,12 +834,12 @@ class LIR_OprFact: public AllStatic { #ifdef ASSERT assert(index >= 0, "index must be positive"); - assert(index <= (max_jint >> LIR_OprDesc::data_shift), "index is too big"); + assert(index <= (max_jint >> LIR_Opr::data_shift), "index is too big"); - LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | - LIR_OprDesc::stack_value | + LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_Opr::data_shift) | + LIR_Opr::stack_value | as_OprType(type) | - LIR_OprDesc::size_for(type)); + LIR_Opr::size_for(type)); assert(res == old_res, "old and new method not equal"); #endif @@ -2474,8 +2465,8 @@ class LIR_OpVisitState: public StackObj { }; -inline LIR_Opr LIR_OprDesc::illegalOpr() { return LIR_OprFact::illegalOpr; }; +inline LIR_Opr LIR_Opr::illegalOpr() { return LIR_OprFact::illegalOpr; }; -inline LIR_Opr LIR_OprDesc::nullOpr() { return LIR_OprFact::nullOpr; }; +inline LIR_Opr LIR_Opr::nullOpr() { return LIR_OprFact::nullOpr; }; #endif // SHARE_C1_C1_LIR_HPP diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index ff8f08a5bbd..bca42cd7cf5 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -1019,12 +1019,12 @@ LIR_Opr LIRGenerator::new_register(BasicType type) { int vreg_num = _virtual_register_number; // Add a little fudge factor for the bailout since the bailout is only checked periodically. This allows us to hand out // a few extra registers before we really run out which helps to avoid to trip over assertions. - if (vreg_num + 20 >= LIR_OprDesc::vreg_max) { + if (vreg_num + 20 >= LIR_Opr::vreg_max) { bailout("out of virtual registers in LIR generator"); - if (vreg_num + 2 >= LIR_OprDesc::vreg_max) { + if (vreg_num + 2 >= LIR_Opr::vreg_max) { // Wrap it around and continue until bailout really happens to avoid hitting assertions. - _virtual_register_number = LIR_OprDesc::vreg_base; - vreg_num = LIR_OprDesc::vreg_base; + _virtual_register_number = LIR_Opr::vreg_base; + vreg_num = LIR_Opr::vreg_base; } } _virtual_register_number += 1; diff --git a/src/hotspot/share/c1/c1_LIRGenerator.hpp b/src/hotspot/share/c1/c1_LIRGenerator.hpp index f7c47e653fd..ffe7108c34e 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.hpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.hpp @@ -502,7 +502,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { LIRGenerator(Compilation* compilation, ciMethod* method) : _compilation(compilation) , _method(method) - , _virtual_register_number(LIR_OprDesc::vreg_base) + , _virtual_register_number(LIR_Opr::vreg_base) , _vreg_flags(num_vreg_flags) , _barrier_set(BarrierSet::barrier_set()->barrier_set_c1()) { } diff --git a/src/hotspot/share/c1/c1_LinearScan.cpp b/src/hotspot/share/c1/c1_LinearScan.cpp index 84846e8e43d..27b11d05c8b 100644 --- a/src/hotspot/share/c1/c1_LinearScan.cpp +++ b/src/hotspot/share/c1/c1_LinearScan.cpp @@ -173,7 +173,7 @@ bool LinearScan::is_precolored_interval(const Interval* i) { } bool LinearScan::is_virtual_interval(const Interval* i) { - return i->reg_num() >= LIR_OprDesc::vreg_base; + return i->reg_num() >= LIR_Opr::vreg_base; } bool LinearScan::is_precolored_cpu_interval(const Interval* i) { @@ -182,9 +182,9 @@ bool LinearScan::is_precolored_cpu_interval(const Interval* i) { bool LinearScan::is_virtual_cpu_interval(const Interval* i) { #if defined(__SOFTFP__) || defined(E500V2) - return i->reg_num() >= LIR_OprDesc::vreg_base; + return i->reg_num() >= LIR_Opr::vreg_base; #else - return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() != T_FLOAT && i->type() != T_DOUBLE); + return i->reg_num() >= LIR_Opr::vreg_base && (i->type() != T_FLOAT && i->type() != T_DOUBLE); #endif // __SOFTFP__ or E500V2 } @@ -196,7 +196,7 @@ bool LinearScan::is_virtual_fpu_interval(const Interval* i) { #if defined(__SOFTFP__) || defined(E500V2) return false; #else - return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() == T_FLOAT || i->type() == T_DOUBLE); + return i->reg_num() >= LIR_Opr::vreg_base && (i->type() == T_FLOAT || i->type() == T_DOUBLE); #endif // __SOFTFP__ or E500V2 } @@ -274,7 +274,7 @@ Interval* LinearScan::create_interval(int reg_num) { _intervals.at_put(reg_num, interval); // assign register number for precolored intervals - if (reg_num < LIR_OprDesc::vreg_base) { + if (reg_num < LIR_Opr::vreg_base) { interval->assign_reg(reg_num); } return interval; @@ -819,7 +819,7 @@ void LinearScan::compute_global_live_sets() { // (live set must be empty at fixed intervals) for (int i = 0; i < num_blocks; i++) { BlockBegin* block = block_at(i); - for (int j = 0; j < LIR_OprDesc::vreg_base; j++) { + for (int j = 0; j < LIR_Opr::vreg_base; j++) { assert(block->live_in().at(j) == false, "live_in set of fixed register must be empty"); assert(block->live_out().at(j) == false, "live_out set of fixed register must be empty"); assert(block->live_gen().at(j) == false, "live_gen set of fixed register must be empty"); @@ -1333,7 +1333,7 @@ void LinearScan::build_intervals() { int size = (int)live.size(); for (int number = (int)live.get_next_one_offset(0, size); number < size; number = (int)live.get_next_one_offset(number + 1, size)) { assert(live.at(number), "should not stop here otherwise"); - assert(number >= LIR_OprDesc::vreg_base, "fixed intervals must not be live on block bounds"); + assert(number >= LIR_Opr::vreg_base, "fixed intervals must not be live on block bounds"); TRACE_LINEAR_SCAN(2, tty->print_cr("live in %d to %d", number, block_to + 2)); add_use(number, block_from, block_to + 2, noUse, T_ILLEGAL); @@ -1706,7 +1706,7 @@ Interval* LinearScan::split_child_at_op_id(Interval* interval, int op_id, LIR_Op } assert(false, "must find an interval, but do a clean bailout in product mode"); - result = new Interval(LIR_OprDesc::vreg_base); + result = new Interval(LIR_Opr::vreg_base); result->assign_reg(0); result->set_type(T_INT); BAILOUT_("LinearScan: interval is NULL", result); @@ -2435,7 +2435,7 @@ OopMap* LinearScan::compute_oop_map(IntervalWalker* iw, LIR_Op* op, CodeEmitInfo assert(interval->current_from() <= op->id() && op->id() <= interval->current_to(), "interval should not be active otherwise"); assert(interval->assigned_regHi() == any_reg, "oop must be single word"); - assert(interval->reg_num() >= LIR_OprDesc::vreg_base, "fixed interval found"); + assert(interval->reg_num() >= LIR_Opr::vreg_base, "fixed interval found"); // Check if this range covers the instruction. Intervals that // start or end at the current operation are not included in the @@ -3218,7 +3218,7 @@ void LinearScan::print_reg_num(outputStream* out, int reg_num) { if (reg_num == -1) { out->print("[ANY]"); return; - } else if (reg_num >= LIR_OprDesc::vreg_base) { + } else if (reg_num >= LIR_Opr::vreg_base) { out->print("[VREG %d]", reg_num); return; } @@ -3298,7 +3298,7 @@ void LinearScan::verify_intervals() { has_error = true; } - if (i1->reg_num() >= LIR_OprDesc::vreg_base && i1->type() == T_ILLEGAL) { + if (i1->reg_num() >= LIR_Opr::vreg_base && i1->type() == T_ILLEGAL) { tty->print_cr("Interval %d has no type assigned", i1->reg_num()); i1->print(); tty->cr(); has_error = true; } @@ -3969,11 +3969,11 @@ LIR_Opr MoveResolver::get_virtual_register(Interval* interval) { // Add a little fudge factor for the bailout since the bailout is only checked periodically. This allows us to hand out // a few extra registers before we really run out which helps to avoid to trip over assertions. int reg_num = interval->reg_num(); - if (reg_num + 20 >= LIR_OprDesc::vreg_max) { + if (reg_num + 20 >= LIR_Opr::vreg_max) { _allocator->bailout("out of virtual registers in linear scan"); - if (reg_num + 2 >= LIR_OprDesc::vreg_max) { + if (reg_num + 2 >= LIR_Opr::vreg_max) { // Wrap it around and continue until bailout really happens to avoid hitting assertions. - reg_num = LIR_OprDesc::vreg_base; + reg_num = LIR_Opr::vreg_base; } } LIR_Opr vreg = LIR_OprFact::virtual_register(reg_num, interval->type()); @@ -4405,7 +4405,7 @@ void Interval::add_use_pos(int pos, IntervalUseKind use_kind) { // do not add use positions for precolored intervals because // they are never used - if (use_kind != noUse && reg_num() >= LIR_OprDesc::vreg_base) { + if (use_kind != noUse && reg_num() >= LIR_Opr::vreg_base) { #ifdef ASSERT assert(_use_pos_and_kinds.length() % 2 == 0, "must be"); for (int i = 0; i < _use_pos_and_kinds.length(); i += 2) { @@ -4635,7 +4635,7 @@ void Interval::print_on(outputStream* out, bool is_cfg_printer) const { const char* UseKind2Name[] = { "N", "L", "S", "M" }; const char* type_name; - if (reg_num() < LIR_OprDesc::vreg_base) { + if (reg_num() < LIR_Opr::vreg_base) { type_name = "fixed"; } else { type_name = type2name(type()); @@ -4652,7 +4652,7 @@ void Interval::print_on(outputStream* out, bool is_cfg_printer) const { } } else { // Improved output for normal debugging. - if (reg_num() < LIR_OprDesc::vreg_base) { + if (reg_num() < LIR_Opr::vreg_base) { LinearScan::print_reg_num(out, assigned_reg()); } else if (assigned_reg() != -1 && (LinearScan::num_physical_regs(type()) == 1 || assigned_regHi() != -1)) { LinearScan::calc_operand_for_interval(this)->print(out); diff --git a/src/hotspot/share/c1/c1_LinearScan.hpp b/src/hotspot/share/c1/c1_LinearScan.hpp index 20c1a66f40f..5808675a543 100644 --- a/src/hotspot/share/c1/c1_LinearScan.hpp +++ b/src/hotspot/share/c1/c1_LinearScan.hpp @@ -547,8 +547,8 @@ class Interval : public CompilationResourceObj { // accessors int reg_num() const { return _reg_num; } void set_reg_num(int r) { assert(_reg_num == -1, "cannot change reg_num"); _reg_num = r; } - BasicType type() const { assert(_reg_num == -1 || _reg_num >= LIR_OprDesc::vreg_base, "cannot access type for fixed interval"); return _type; } - void set_type(BasicType type) { assert(_reg_num < LIR_OprDesc::vreg_base || _type == T_ILLEGAL || _type == type, "overwriting existing type"); _type = type; } + BasicType type() const { assert(_reg_num == -1 || _reg_num >= LIR_Opr::vreg_base, "cannot access type for fixed interval"); return _type; } + void set_type(BasicType type) { assert(_reg_num < LIR_Opr::vreg_base || _type == T_ILLEGAL || _type == type, "overwriting existing type"); _type = type; } Range* first() const { return _first; } int from() const { return _first->from(); } diff --git a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp index 29c0d2689d8..fbed1921182 100644 --- a/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp +++ b/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp @@ -152,13 +152,13 @@ void G1BarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Opr new_v __ unsigned_shift_right(xor_shift_res, LIR_OprFact::intConst(HeapRegion::LogOfHRGrainBytes), xor_shift_res, - LIR_OprDesc::illegalOpr()); + LIR_Opr::illegalOpr()); } else { __ logical_xor(addr, new_val, xor_res); __ unsigned_shift_right(xor_res, LIR_OprFact::intConst(HeapRegion::LogOfHRGrainBytes), xor_shift_res, - LIR_OprDesc::illegalOpr()); + LIR_Opr::illegalOpr()); } if (!new_val->is_register()) { -- GitLab From 2f0bde1a658b0910304c110920a2e8ccbe4557f8 Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Fri, 19 Nov 2021 02:04:48 +0000 Subject: [PATCH 394/890] 8277102: Dubious PrintCompilation output Reviewed-by: thartmann, dnsimon --- src/hotspot/share/code/nmethod.cpp | 2 +- src/hotspot/share/compiler/compileTask.cpp | 8 +++----- src/hotspot/share/compiler/compileTask.hpp | 6 +++--- .../jvmci/compilerToVM/DisassembleCodeBlobTest.java | 11 ++++++++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index f695f242231..543892bc434 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -924,7 +924,7 @@ void nmethod::print_on(outputStream* st, const char* msg) const { CompileTask::print(st, this, msg, /*short_form:*/ true); st->print_cr(" (" INTPTR_FORMAT ")", p2i(this)); } else { - CompileTask::print(st, this, msg, /*short_form:*/ false, /* cr */ true, /* timestamp */ false); + CompileTask::print(st, this, msg, /*short_form:*/ false); } } } diff --git a/src/hotspot/share/compiler/compileTask.cpp b/src/hotspot/share/compiler/compileTask.cpp index b78806346c5..d610d8bdcf8 100644 --- a/src/hotspot/share/compiler/compileTask.cpp +++ b/src/hotspot/share/compiler/compileTask.cpp @@ -236,13 +236,11 @@ void CompileTask::print_tty() { // CompileTask::print_impl void CompileTask::print_impl(outputStream* st, Method* method, int compile_id, int comp_level, bool is_osr_method, int osr_bci, bool is_blocking, - const char* msg, bool short_form, bool cr, bool timestamp, + const char* msg, bool short_form, bool cr, jlong time_queued, jlong time_started) { if (!short_form) { - if (timestamp) { - // Print current time - st->print("%7d ", (int)tty->time_stamp().milliseconds()); - } + // Print current time + st->print("%7d ", (int)tty->time_stamp().milliseconds()); if (Verbose && time_queued != 0) { // Print time in queue and time being processed by compiler thread jlong now = os::elapsed_counter(); diff --git a/src/hotspot/share/compiler/compileTask.hpp b/src/hotspot/share/compiler/compileTask.hpp index a900bfd4f44..6281dea7a4a 100644 --- a/src/hotspot/share/compiler/compileTask.hpp +++ b/src/hotspot/share/compiler/compileTask.hpp @@ -187,16 +187,16 @@ class CompileTask : public CHeapObj { private: static void print_impl(outputStream* st, Method* method, int compile_id, int comp_level, bool is_osr_method = false, int osr_bci = -1, bool is_blocking = false, - const char* msg = NULL, bool short_form = false, bool cr = true, bool timestamp = true, + const char* msg = NULL, bool short_form = false, bool cr = true, jlong time_queued = 0, jlong time_started = 0); public: void print(outputStream* st = tty, const char* msg = NULL, bool short_form = false, bool cr = true); void print_ul(const char* msg = NULL); - static void print(outputStream* st, const nmethod* nm, const char* msg = NULL, bool short_form = false, bool cr = true, bool timestamp = true) { + static void print(outputStream* st, const nmethod* nm, const char* msg = NULL, bool short_form = false, bool cr = true) { print_impl(st, nm->method(), nm->compile_id(), nm->comp_level(), nm->is_osr_method(), nm->is_osr_method() ? nm->osr_entry_bci() : -1, /*is_blocking*/ false, - msg, short_form, cr, timestamp); + msg, short_form, cr); } static void print_ul(const nmethod* nm, const char* msg = NULL); diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java index 21c5e40da25..9d26ed16eb6 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -101,7 +101,16 @@ public class DisassembleCodeBlobTest { // Therefore compare strings 2 and 3. String str2 = CompilerToVMHelper.disassembleCodeBlob(installedCode); String str3 = CompilerToVMHelper.disassembleCodeBlob(installedCode); - Asserts.assertEQ(str2, str3, + String[] str2Lines = str2.split(System.lineSeparator()); + String[] str3Lines = str3.split(System.lineSeparator()); + // skip the first two lines since it contains a timestamp that may vary from different invocations + // + // Compiled method (c2) 309 463 4 compiler.jvmci.compilerToVM.CompileCodeTestCase$Dummy::staticMethod (1 bytes) + // + // Compiled method (c2) 310 463 4 compiler.jvmci.compilerToVM.CompileCodeTestCase$Dummy::staticMethod (1 bytes) + for (int i = 2; i < str2Lines.length; i++) { + Asserts.assertEQ(str2Lines[i], str3Lines[i], testCase + " : 3nd invocation returned different value from 2nd"); + } } } -- GitLab From 47564caeb0628e5c03a0e7f04093adce77d6dd3b Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Fri, 19 Nov 2021 07:07:17 +0000 Subject: [PATCH 395/890] 8275643: C2's unaryOp vector intrinsic does not properly handle LongVector.neg Reviewed-by: chagedorn, sviswanathan --- src/hotspot/share/prims/vectorSupport.cpp | 1 + .../compiler/vectorapi/TestLongVectorNeg.java | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java diff --git a/src/hotspot/share/prims/vectorSupport.cpp b/src/hotspot/share/prims/vectorSupport.cpp index cc5a37678a4..9b86962c21b 100644 --- a/src/hotspot/share/prims/vectorSupport.cpp +++ b/src/hotspot/share/prims/vectorSupport.cpp @@ -292,6 +292,7 @@ int VectorSupport::vop2ideal(jint id, BasicType bt) { case T_BYTE: // fall-through case T_SHORT: // fall-through case T_INT: return Op_NegI; + case T_LONG: return Op_NegL; case T_FLOAT: return Op_NegF; case T_DOUBLE: return Op_NegD; default: fatal("NEG: %s", type2name(bt)); diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java b/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java new file mode 100644 index 00000000000..859d4b0b5fc --- /dev/null +++ b/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021, 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.vectorapi; + +import jdk.incubator.vector.LongVector; + +/* + * @test + * @bug 8275643 + * @summary Test that LongVector.neg is properly handled by the _VectorUnaryOp C2 intrinsic + * @modules jdk.incubator.vector + * @run main/othervm -XX:-TieredCompilation -XX:+AlwaysIncrementalInline -Xbatch + * -XX:CompileCommand=dontinline,compiler.vectorapi.TestLongVectorNeg::test + * compiler.vectorapi.TestLongVectorNeg + */ +public class TestLongVectorNeg { + + static LongVector test(LongVector v) { + return v.neg(); + } + + public static void main(String[] args) { + LongVector v = LongVector.zero(LongVector.SPECIES_128); + for (int i = 0; i < 50_000; ++i) { + v.abs(); // Warmup to make sure the !VO_SPECIAL code path is taken as well + test(v); + } + } +} -- GitLab From f34f119080b4e8baf396fb26c21d572dd432fd91 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Fri, 19 Nov 2021 07:13:05 +0000 Subject: [PATCH 396/890] 8277213: CompileTask_lock is acquired out of order with MethodCompileQueue_lock Reviewed-by: rbackman, coleenp --- src/hotspot/share/compiler/compileTask.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/compiler/compileTask.hpp b/src/hotspot/share/compiler/compileTask.hpp index 6281dea7a4a..23facc90cc5 100644 --- a/src/hotspot/share/compiler/compileTask.hpp +++ b/src/hotspot/share/compiler/compileTask.hpp @@ -104,7 +104,8 @@ class CompileTask : public CHeapObj { public: CompileTask() : _failure_reason(NULL), _failure_reason_on_C_heap(false) { - _lock = new Monitor(Mutex::safepoint, "CompileTask_lock"); + // May hold MethodCompileQueue_lock + _lock = new Monitor(Mutex::safepoint-1, "CompileTask_lock"); } void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level, -- GitLab From 2f20b0d8daca6bdc53b4b9e1837c428930d34236 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Fri, 19 Nov 2021 07:49:58 +0000 Subject: [PATCH 397/890] 8273039: JShell crashes when naming variable or method "abstract" or "strictfp" Reviewed-by: vromero --- .../com/sun/tools/javac/comp/Attr.java | 8 + .../jdk/jshell/ErrorRecoveryTest.java | 10 +- .../tools/javac/attr/AttrRecoveryTest.java | 165 ++++++++++++++++++ 3 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 test/langtools/tools/javac/attr/AttrRecoveryTest.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index ddf7e7d63b1..32975a193ec 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -5098,6 +5098,14 @@ public class Attr extends JCTree.Visitor { Assert.error("should be handled in annotate"); } + @Override + public void visitModifiers(JCModifiers tree) { + //error recovery only: + Assert.check(resultInfo.pkind == KindSelector.ERR); + + attribAnnotationTypes(tree.annotations, env); + } + public void visitAnnotatedType(JCAnnotatedType tree) { attribAnnotationTypes(tree.annotations, env); Type underlyingType = attribType(tree.underlyingType, env); diff --git a/test/langtools/jdk/jshell/ErrorRecoveryTest.java b/test/langtools/jdk/jshell/ErrorRecoveryTest.java index 0a83fb0e485..0dd43fa68cd 100644 --- a/test/langtools/jdk/jshell/ErrorRecoveryTest.java +++ b/test/langtools/jdk/jshell/ErrorRecoveryTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8270139 + * @bug 8270139 8273039 * @summary Verify error recovery in JShell * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.main @@ -37,6 +37,7 @@ import org.testng.annotations.Test; import static jdk.jshell.Snippet.Status.NONEXISTENT; import static jdk.jshell.Snippet.Status.RECOVERABLE_NOT_DEFINED; +import static jdk.jshell.Snippet.Status.REJECTED; @Test public class ErrorRecoveryTest extends KullaTesting { @@ -49,4 +50,11 @@ public class ErrorRecoveryTest extends KullaTesting { """, ste(MAIN_SNIPPET, NONEXISTENT, RECOVERABLE_NOT_DEFINED, false, null)); } + + public void testBrokenName() { + assertEval("int strictfp = 0;", + DiagCheck.DIAG_ERROR, + DiagCheck.DIAG_IGNORE, + ste(MAIN_SNIPPET, NONEXISTENT, REJECTED, false, null)); + } } diff --git a/test/langtools/tools/javac/attr/AttrRecoveryTest.java b/test/langtools/tools/javac/attr/AttrRecoveryTest.java new file mode 100644 index 00000000000..b364cc28001 --- /dev/null +++ b/test/langtools/tools/javac/attr/AttrRecoveryTest.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2021, 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 8273039 + * @summary Verify error recovery in Attr + * @library /tools/lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.util + * @build toolbox.ToolBox toolbox.JavacTask + * @run main AttrRecoveryTest +*/ + +import com.sun.source.tree.AnnotationTree; +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.ErroneousTree; +import com.sun.source.util.TaskEvent; +import com.sun.source.util.TaskListener; +import com.sun.source.util.TreePath; +import com.sun.source.util.TreePathScanner; +import com.sun.source.util.Trees; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import javax.lang.model.element.Element; + +import toolbox.TestRunner; +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.ToolBox; + +public class AttrRecoveryTest extends TestRunner { + + ToolBox tb; + + public static void main(String... args) throws Exception { + new AttrRecoveryTest().runTests(); + } + + AttrRecoveryTest() { + super(System.err); + tb = new ToolBox(); + } + + public void runTests() throws Exception { + runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + @Test + public void testModifiers(Path base) throws Exception { + record TestCase(String name, String source, String expectedAnnotation, String... errors) {} + TestCase[] tests = new TestCase[] { + new TestCase("a", + """ + public class Test { + Object i () { return int strictfp @Deprecated = 0; } + } + """, + "java.lang.Deprecated", + "Test.java:2:30: compiler.err.dot.class.expected", + "Test.java:2:51: compiler.err.expected4: class, interface, enum, record", + "Test.java:2:26: compiler.err.unexpected.type: kindname.value, kindname.class", + "3 errors"), + new TestCase("b", + """ + public class Test { + Object i () { return int strictfp = 0; } + } + """, + null, + "Test.java:2:30: compiler.err.dot.class.expected", + "Test.java:2:39: compiler.err.expected4: class, interface, enum, record", + "Test.java:2:26: compiler.err.unexpected.type: kindname.value, kindname.class", + "3 errors") + }; + for (TestCase test : tests) { + Path current = base.resolve("" + test.name); + Path src = current.resolve("src"); + Path classes = current.resolve("classes"); + tb.writeJavaFiles(src, + test.source); + + Files.createDirectories(classes); + + var log = + new JavacTask(tb) + .options("-XDrawDiagnostics", + "-XDshould-stop.at=FLOW", + "-Xlint:-preview") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .callback(t -> { + t.addTaskListener(new TaskListener() { + CompilationUnitTree parsed; + @Override + public void finished(TaskEvent e) { + switch (e.getKind()) { + case PARSE -> parsed = e.getCompilationUnit(); + case ANALYZE -> + checkAnnotationsValid(t, parsed, test.expectedAnnotation); + } + } + }); + }) + .run(Task.Expect.FAIL, 1) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + if (!List.of(test.errors).equals(log)) { + throw new AssertionError("Incorrect errors, expected: " + List.of(test.errors) + + ", actual: " + log); + } + } + } + + private void checkAnnotationsValid(com.sun.source.util.JavacTask task, + CompilationUnitTree cut, + String expected) { + boolean[] foundAnnotation = new boolean[1]; + Trees trees = Trees.instance(task); + + new TreePathScanner() { + @Override + public Void visitAnnotation(AnnotationTree node, Void p) { + TreePath typePath = new TreePath(getCurrentPath(), node.getAnnotationType()); + Element el = trees.getElement(typePath); + if (el == null || !el.equals(task.getElements().getTypeElement(expected))) { + throw new AssertionError(); + } + foundAnnotation[0] = true; + return super.visitAnnotation(node, p); + } + + @Override + public Void visitErroneous(ErroneousTree node, Void p) { + return scan(node.getErrorTrees(), p); + } + }.scan(cut, null); + if (foundAnnotation[0] ^ (expected != null)) { + throw new AssertionError(); + } + } +} -- GitLab From 3a76d397949ad22e4786476e583cc9d33c015214 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Fri, 19 Nov 2021 08:23:45 +0000 Subject: [PATCH 398/890] 8277324: C2 compilation fails with "bad AD file" on x86-32 after JDK-8276162 due to missing match rule Reviewed-by: chagedorn, roland --- src/hotspot/cpu/x86/x86_32.ad | 74 +++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index 4475f053fd0..5f09f565d18 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -13150,7 +13150,25 @@ instruct cmovII_mem_LTGE(cmpOp cmp, flagsReg_long_LTGE flags, rRegI dst, memory ins_pipe( pipe_cmov_mem ); %} -// Compare 2 longs and CMOVE ints. +instruct cmovII_reg_LTGE_U(cmpOpU cmp, flagsReg_ulong_LTGE flags, rRegI dst, rRegI src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); + match(Set dst (CMoveI (Binary cmp flags) (Binary dst src))); + ins_cost(200); + expand %{ + cmovII_reg_LTGE(cmp, flags, dst, src); + %} +%} + +instruct cmovII_mem_LTGE_U(cmpOpU cmp, flagsReg_ulong_LTGE flags, rRegI dst, memory src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); + match(Set dst (CMoveI (Binary cmp flags) (Binary dst (LoadI src)))); + ins_cost(250); + expand %{ + cmovII_mem_LTGE(cmp, flags, dst, src); + %} +%} + +// Compare 2 longs and CMOVE ptrs. instruct cmovPP_reg_LTGE(cmpOp cmp, flagsReg_long_LTGE flags, eRegP dst, eRegP src) %{ predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); match(Set dst (CMoveP (Binary cmp flags) (Binary dst src))); @@ -13313,7 +13331,25 @@ instruct cmovII_mem_EQNE(cmpOp cmp, flagsReg_long_EQNE flags, rRegI dst, memory ins_pipe( pipe_cmov_mem ); %} -// Compare 2 longs and CMOVE ints. +instruct cmovII_reg_EQNE_U(cmpOpU cmp, flagsReg_ulong_EQNE flags, rRegI dst, rRegI src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::eq || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ne )); + match(Set dst (CMoveI (Binary cmp flags) (Binary dst src))); + ins_cost(200); + expand %{ + cmovII_reg_EQNE(cmp, flags, dst, src); + %} +%} + +instruct cmovII_mem_EQNE_U(cmpOpU cmp, flagsReg_ulong_EQNE flags, rRegI dst, memory src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::eq || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ne )); + match(Set dst (CMoveI (Binary cmp flags) (Binary dst (LoadI src)))); + ins_cost(250); + expand %{ + cmovII_mem_EQNE(cmp, flags, dst, src); + %} +%} + +// Compare 2 longs and CMOVE ptrs. instruct cmovPP_reg_EQNE(cmpOp cmp, flagsReg_long_EQNE flags, eRegP dst, eRegP src) %{ predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::eq || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ne )); match(Set dst (CMoveP (Binary cmp flags) (Binary dst src))); @@ -13469,22 +13505,18 @@ instruct cmovLL_reg_LEGT_U(cmpOpU_commute cmp, flagsReg_ulong_LEGT flags, eRegL match(Set dst (CMoveL (Binary cmp flags) (Binary dst src))); predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt )); ins_cost(400); - format %{ "CMOV$cmp $dst.lo,$src.lo\n\t" - "CMOV$cmp $dst.hi,$src.hi" %} - opcode(0x0F,0x40); - ins_encode( enc_cmov(cmp), RegReg_Lo2( dst, src ), enc_cmov(cmp), RegReg_Hi2( dst, src ) ); - ins_pipe( pipe_cmov_reg_long ); + expand %{ + cmovLL_reg_LEGT(cmp, flags, dst, src); + %} %} instruct cmovLL_mem_LEGT_U(cmpOpU_commute cmp, flagsReg_ulong_LEGT flags, eRegL dst, load_long_memory src) %{ match(Set dst (CMoveL (Binary cmp flags) (Binary dst (LoadL src)))); predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt )); ins_cost(500); - format %{ "CMOV$cmp $dst.lo,$src.lo\n\t" - "CMOV$cmp $dst.hi,$src.hi+4" %} - opcode(0x0F,0x40); - ins_encode( enc_cmov(cmp), RegMem(dst, src), enc_cmov(cmp), RegMem_Hi(dst, src) ); - ins_pipe( pipe_cmov_reg_long ); + expand %{ + cmovLL_mem_LEGT(cmp, flags, dst, src); + %} %} // Compare 2 longs and CMOVE ints. @@ -13508,6 +13540,24 @@ instruct cmovII_mem_LEGT(cmpOp_commute cmp, flagsReg_long_LEGT flags, rRegI dst, ins_pipe( pipe_cmov_mem ); %} +instruct cmovII_reg_LEGT_U(cmpOpU_commute cmp, flagsReg_ulong_LEGT flags, rRegI dst, rRegI src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt )); + match(Set dst (CMoveI (Binary cmp flags) (Binary dst src))); + ins_cost(200); + expand %{ + cmovII_reg_LEGT(cmp, flags, dst, src); + %} +%} + +instruct cmovII_mem_LEGT_U(cmpOpU_commute cmp, flagsReg_ulong_LEGT flags, rRegI dst, memory src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt )); + match(Set dst (CMoveI (Binary cmp flags) (Binary dst (LoadI src)))); + ins_cost(250); + expand %{ + cmovII_mem_LEGT(cmp, flags, dst, src); + %} +%} + // Compare 2 longs and CMOVE ptrs. instruct cmovPP_reg_LEGT(cmpOp_commute cmp, flagsReg_long_LEGT flags, eRegP dst, eRegP src) %{ predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt )); -- GitLab From 7a046e0f765e0ad04fd52c9a882c5d90b085bc00 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 19 Nov 2021 08:31:09 +0000 Subject: [PATCH 399/890] 8277371: Remove unnecessary DefNewGeneration::ref_processor_init() Reviewed-by: stefank, tschatzl, mli --- src/hotspot/share/gc/serial/defNewGeneration.cpp | 5 ----- src/hotspot/share/gc/serial/defNewGeneration.hpp | 2 -- src/hotspot/share/gc/shared/generation.hpp | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/hotspot/share/gc/serial/defNewGeneration.cpp b/src/hotspot/share/gc/serial/defNewGeneration.cpp index cd5e679cd07..4b64494d242 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.cpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.cpp @@ -878,11 +878,6 @@ void DefNewGeneration::record_spaces_top() { from()->set_top_for_allocations(); } -void DefNewGeneration::ref_processor_init() { - Generation::ref_processor_init(); -} - - void DefNewGeneration::update_counters() { if (UsePerfData) { _eden_counters->update_all(); diff --git a/src/hotspot/share/gc/serial/defNewGeneration.hpp b/src/hotspot/share/gc/serial/defNewGeneration.hpp index 5ea77852566..f060a5ea8ac 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.hpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.hpp @@ -202,8 +202,6 @@ protected: size_t max_byte_size, const char* policy="Serial young collection pauses"); - virtual void ref_processor_init(); - virtual Generation::Name kind() { return Generation::DefNew; } // Accessing spaces diff --git a/src/hotspot/share/gc/shared/generation.hpp b/src/hotspot/share/gc/shared/generation.hpp index 452212ffd72..216b38d38b7 100644 --- a/src/hotspot/share/gc/shared/generation.hpp +++ b/src/hotspot/share/gc/shared/generation.hpp @@ -118,7 +118,7 @@ class Generation: public CHeapObj { }; // allocate and initialize ("weak") refs processing support - virtual void ref_processor_init(); + void ref_processor_init(); void set_ref_processor(ReferenceProcessor* rp) { assert(_ref_processor == NULL, "clobbering existing _ref_processor"); _ref_processor = rp; -- GitLab From 11d819d68a3ce2ae0973b496141c52aa419f90f0 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Fri, 19 Nov 2021 10:15:30 +0000 Subject: [PATCH 400/890] 8277439: G1: Correct include guard name in G1EvacFailureObjectsSet.hpp Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp index a34e46dc96c..c8ec317f351 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp @@ -22,8 +22,8 @@ * */ -#ifndef SHARE_GC_G1_G1EVACUATIONFAILUREOBJSINHR_HPP -#define SHARE_GC_G1_G1EVACUATIONFAILUREOBJSINHR_HPP +#ifndef SHARE_GC_G1_G1EVACFAILUREOBJECTSSET_HPP +#define SHARE_GC_G1_G1EVACFAILUREOBJECTSSET_HPP #include "gc/g1/g1SegmentedArray.hpp" #include "memory/iterator.hpp" @@ -79,4 +79,4 @@ public: }; -#endif //SHARE_GC_G1_G1EVACUATIONFAILUREOBJSINHR_HPP +#endif //SHARE_GC_G1_G1EVACFAILUREOBJECTSSET_HPP -- GitLab From b15e6f076afe5ac68e9af68756860d0b25adea4b Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Fri, 19 Nov 2021 10:38:42 +0000 Subject: [PATCH 401/890] 8277449: compiler/vectorapi/TestLongVectorNeg.java fails with release VMs Reviewed-by: thartmann, chagedorn --- test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java b/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java index 859d4b0b5fc..92cc82b03a4 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestLongVectorNeg.java @@ -30,6 +30,7 @@ import jdk.incubator.vector.LongVector; * @bug 8275643 * @summary Test that LongVector.neg is properly handled by the _VectorUnaryOp C2 intrinsic * @modules jdk.incubator.vector + * @requires vm.debug * @run main/othervm -XX:-TieredCompilation -XX:+AlwaysIncrementalInline -Xbatch * -XX:CompileCommand=dontinline,compiler.vectorapi.TestLongVectorNeg::test * compiler.vectorapi.TestLongVectorNeg -- GitLab From 03debf277537135974d3f55e3a5c7cf6842ee5e0 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Fri, 19 Nov 2021 13:18:12 +0000 Subject: [PATCH 402/890] 8276774: Cookie stored in CookieHandler not sent if user headers contain cookie Reviewed-by: michaelm --- .../jdk/internal/net/http/Http1Request.java | 11 +- .../classes/jdk/internal/net/http/Stream.java | 19 +- .../java/net/httpclient/CookieHeaderTest.java | 6 +- .../java/net/httpclient/UserCookieTest.java | 573 ++++++++++++++++++ 4 files changed, 593 insertions(+), 16 deletions(-) create mode 100644 test/jdk/java/net/httpclient/UserCookieTest.java diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java index c55a3790a11..4e4c96909f5 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java @@ -109,21 +109,22 @@ class Http1Request { final HttpHeaders uh = userHeaders; // Filter any headers from systemHeaders that are set in userHeaders - systemHeaders = HttpHeaders.of(systemHeaders.map(), (k,v) -> uh.firstValue(k).isEmpty()); + final HttpHeaders sh = HttpHeaders.of(systemHeaders.map(), + (k,v) -> uh.firstValue(k).isEmpty()); // If we're sending this request through a tunnel, // then don't send any preemptive proxy-* headers that // the authentication filter may have saved in its // cache. - collectHeaders1(sb, systemHeaders, nocookies); + collectHeaders1(sb, sh, nocookies); // If we're sending this request through a tunnel, // don't send any user-supplied proxy-* headers // to the target server. - collectHeaders1(sb, userHeaders, nocookies); + collectHeaders1(sb, uh, nocookies); - // Gather all 'Cookie:' headers and concatenate their - // values in a single line. + // Gather all 'Cookie:' headers from the unfiltered system headers, + // and the user headers, and concatenate their values in a single line collectCookies(sb, systemHeaders, userHeaders); // terminate headers diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java b/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java index cf9d548911c..5fc8eb36772 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java @@ -97,6 +97,7 @@ import jdk.internal.net.http.hpack.DecodingCallback; */ class Stream extends ExchangeImpl { + private static final String COOKIE_HEADER = "Cookie"; final Logger debug = Utils.getDebugLogger(this::dbgString, Utils.DEBUG); final ConcurrentLinkedQueue inputQ = new ConcurrentLinkedQueue<>(); @@ -245,7 +246,7 @@ class Stream extends ExchangeImpl { debug.log("already completed: dropping error %s", (Object) t); } } catch (Throwable x) { - Log.logError("Subscriber::onError threw exception: {0}", (Object) t); + Log.logError("Subscriber::onError threw exception: {0}", t); } finally { cancelImpl(t); drainInputQueue(); @@ -328,10 +329,7 @@ class Stream extends ExchangeImpl { @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("streamid: ") - .append(streamid); - return sb.toString(); + return "streamid: " + streamid; } private void receiveDataFrame(DataFrame df) { @@ -398,7 +396,6 @@ class Stream extends ExchangeImpl { return sendBodyImpl().thenApply( v -> this); } - @SuppressWarnings("unchecked") Stream(Http2Connection connection, Exchange e, WindowController windowController) @@ -455,7 +452,7 @@ class Stream extends ExchangeImpl { case ResetFrame.TYPE -> incoming_reset((ResetFrame) frame); case PriorityFrame.TYPE -> incoming_priority((PriorityFrame) frame); - default -> throw new IOException("Unexpected frame: " + frame.toString()); + default -> throw new IOException("Unexpected frame: " + frame); } } @@ -652,10 +649,16 @@ class Stream extends ExchangeImpl { // Filter context restricted from userHeaders userh = HttpHeaders.of(userh.map(), Utils.CONTEXT_RESTRICTED(client())); + // Don't override Cookie values that have been set by the CookieHandler. final HttpHeaders uh = userh; + BiPredicate overrides = + (k, v) -> COOKIE_HEADER.equalsIgnoreCase(k) + || uh.firstValue(k).isEmpty(); // Filter any headers from systemHeaders that are set in userHeaders - sysh = HttpHeaders.of(sysh.map(), (k,v) -> uh.firstValue(k).isEmpty()); + // except for "Cookie:" - user cookies will be appended to system + // cookies + sysh = HttpHeaders.of(sysh.map(), overrides); OutgoingHeaders> f = new OutgoingHeaders<>(sysh, userh, this); if (contentLength == 0) { diff --git a/test/jdk/java/net/httpclient/CookieHeaderTest.java b/test/jdk/java/net/httpclient/CookieHeaderTest.java index f5c9b57d376..ae0957337de 100644 --- a/test/jdk/java/net/httpclient/CookieHeaderTest.java +++ b/test/jdk/java/net/httpclient/CookieHeaderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -331,8 +331,8 @@ public class CookieHeaderTest implements HttpServerAdapters { (new RuntimeException(msg)).printStackTrace(); t.sendResponseHeaders(500, -1); os.write(msg.getBytes(UTF_8)); - } else if (cookie.size() == 2 && !cookie.get(1).equals("ORDER=BISCUITS")) { - String msg = "Incorrect cookie header value:[" + cookie.get(0) + "]"; + } else if (cookie.size() > 1 && !cookie.get(1).equals("ORDER=BISCUITS")) { + String msg = "Incorrect cookie header value:[" + cookie.get(1) + "]"; (new RuntimeException(msg)).printStackTrace(); t.sendResponseHeaders(500, -1); os.write(msg.getBytes(UTF_8)); diff --git a/test/jdk/java/net/httpclient/UserCookieTest.java b/test/jdk/java/net/httpclient/UserCookieTest.java new file mode 100644 index 00000000000..9c1c6cc139f --- /dev/null +++ b/test/jdk/java/net/httpclient/UserCookieTest.java @@ -0,0 +1,573 @@ +/* + * Copyright (c) 2021, 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 8276774 + * @summary Test that user-supplied cookies are appended to + * server-cookies for HTTP/2 vs HTTP/1.1 + * @modules java.base/sun.net.www.http + * java.net.http/jdk.internal.net.http.common + * java.net.http/jdk.internal.net.http.frame + * java.net.http/jdk.internal.net.http.hpack + * java.logging + * jdk.httpserver + * @library /test/lib http2/server + * @build Http2TestServer + * @build jdk.test.lib.net.SimpleSSLContext + * @run testng/othervm + * -Djdk.tls.acknowledgeCloseNotify=true + * -Djdk.httpclient.HttpClient.log=trace,headers,requests + * UserCookieTest + */ + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.Writer; +import java.net.CookieHandler; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpClient.Redirect; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.net.ServerSocketFactory; +import javax.net.ssl.SSLContext; + +import com.sun.net.httpserver.HttpServer; +import com.sun.net.httpserver.HttpsConfigurator; +import com.sun.net.httpserver.HttpsServer; +import jdk.test.lib.net.SimpleSSLContext; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import static java.lang.System.out; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.testng.Assert.assertEquals; + +public class UserCookieTest implements HttpServerAdapters { + + SSLContext sslContext; + HttpTestServer httpTestServer; // HTTP/1.1 [ 6 servers ] + HttpTestServer httpsTestServer; // HTTPS/1.1 + HttpTestServer http2TestServer; // HTTP/2 ( h2c ) + HttpTestServer https2TestServer; // HTTP/2 ( h2 ) + DummyServer httpDummyServer; + DummyServer httpsDummyServer; + String httpURI; + String httpsURI; + String http2URI; + String https2URI; + String httpDummy; + String httpsDummy; + + static final String MESSAGE = "Basic CookieHeaderTest message body"; + static final int ITERATIONS = 3; + static final long start = System.nanoTime(); + public static String now() { + long now = System.nanoTime() - start; + long secs = now / 1000_000_000; + long mill = (now % 1000_000_000) / 1000_000; + long nan = now % 1000_000; + return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); + } + + @DataProvider(name = "positive") + public Object[][] positive() { + return new Object[][] { + { httpURI, HttpClient.Version.HTTP_1_1 }, + { httpsURI, HttpClient.Version.HTTP_1_1 }, + { httpDummy, HttpClient.Version.HTTP_1_1 }, + { httpsDummy, HttpClient.Version.HTTP_1_1 }, + { httpURI, HttpClient.Version.HTTP_2 }, + { httpsURI, HttpClient.Version.HTTP_2 }, + { httpDummy, HttpClient.Version.HTTP_2 }, + { httpsDummy, HttpClient.Version.HTTP_2 }, + { http2URI, null }, + { https2URI, null }, + }; + } + + static final AtomicLong requestCounter = new AtomicLong(); + + @Test(dataProvider = "positive") + void test(String uriString, HttpClient.Version version) throws Exception { + out.printf("%n---- starting (%s) ----%n", uriString); + ConcurrentHashMap> cookieHeaders + = new ConcurrentHashMap<>(); + CookieHandler cookieManager = new TestCookieHandler(cookieHeaders); + HttpClient client = HttpClient.newBuilder() + .followRedirects(Redirect.ALWAYS) + .cookieHandler(cookieManager) + .sslContext(sslContext) + .build(); + assert client.cookieHandler().isPresent(); + + URI uri = URI.create(uriString); + List cookies = new ArrayList<>(); + cookies.add("CUSTOMER=ARTHUR_DENT"); + cookies.add("LOCATION=TR\u0100IN_STATION"); + cookies.add("LOC\u0100TION=TRAIN_STATION"); + cookies.add("ORDER=BISCUITS"); + cookieHeaders.put("Cookie", cookies); + String userCookie = "PRICE=42"; + List expectedCookies = + Stream.concat(cookies.stream(), Stream.of(userCookie)).toList(); + + + + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri) + .header("X-uuid", "uuid-" + requestCounter.incrementAndGet()) + .header("Cookie", userCookie); + if (version != null) { + requestBuilder.version(version); + } + HttpRequest request = requestBuilder.build(); + out.println("Initial request: " + request.uri()); + + for (int i=0; i< ITERATIONS; i++) { + out.println("iteration: " + i); + HttpResponse response = client.send(request, BodyHandlers.ofString()); + + out.println(" Got response: " + response); + out.println(" Got body Path: " + response.body()); + + assertEquals(response.statusCode(), 200); + assertEquals(response.body(), MESSAGE); + assertEquals(response.headers().allValues("X-Request-Cookie"), + expectedCookies.stream() + .filter(s -> !s.startsWith("LOC")) + .toList()); + requestBuilder = HttpRequest.newBuilder(uri) + .header("X-uuid", "uuid-" + requestCounter.incrementAndGet()) + .header("Cookie", userCookie); + if (version != null) { + requestBuilder.version(version); + } + request = requestBuilder.build(); + } + } + + // -- Infrastructure + + @BeforeTest + public void setup() throws Exception { + sslContext = new SimpleSSLContext().get(); + if (sslContext == null) + throw new AssertionError("Unexpected null sslContext"); + + InetSocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0); + + httpTestServer = HttpTestServer.of(HttpServer.create(sa, 0)); + httpTestServer.addHandler(new CookieValidationHandler(), "/http1/cookie/"); + httpURI = "http://" + httpTestServer.serverAuthority() + "/http1/cookie/retry"; + HttpsServer httpsServer = HttpsServer.create(sa, 0); + httpsServer.setHttpsConfigurator(new HttpsConfigurator(sslContext)); + httpsTestServer = HttpTestServer.of(httpsServer); + httpsTestServer.addHandler(new CookieValidationHandler(),"/https1/cookie/"); + httpsURI = "https://" + httpsTestServer.serverAuthority() + "/https1/cookie/retry"; + + http2TestServer = HttpTestServer.of(new Http2TestServer("localhost", false, 0)); + http2TestServer.addHandler(new CookieValidationHandler(), "/http2/cookie/"); + http2URI = "http://" + http2TestServer.serverAuthority() + "/http2/cookie/retry"; + https2TestServer = HttpTestServer.of(new Http2TestServer("localhost", true, sslContext)); + https2TestServer.addHandler(new CookieValidationHandler(), "/https2/cookie/"); + https2URI = "https://" + https2TestServer.serverAuthority() + "/https2/cookie/retry"; + + + // DummyServer + httpDummyServer = DummyServer.create(sa); + httpsDummyServer = DummyServer.create(sa, sslContext); + httpDummy = "http://" + httpDummyServer.serverAuthority() + "/http1/dummy/x"; + httpsDummy = "https://" + httpsDummyServer.serverAuthority() + "/https1/dummy/x"; + + httpTestServer.start(); + httpsTestServer.start(); + http2TestServer.start(); + https2TestServer.start(); + httpDummyServer.start(); + httpsDummyServer.start(); + } + + @AfterTest + public void teardown() throws Exception { + httpTestServer.stop(); + httpsTestServer.stop(); + http2TestServer.stop(); + https2TestServer.stop(); + httpsDummyServer.stopServer(); + httpsDummyServer.stopServer(); + } + + static class TestCookieHandler extends CookieHandler { + + final ConcurrentHashMap> cookies; + TestCookieHandler(ConcurrentHashMap> map) { + this.cookies = map; + } + + @java.lang.Override + public Map> get(URI uri, Map> requestHeaders) + throws IOException + { + return cookies; + } + + @java.lang.Override + public void put(URI uri, Map> responseHeaders) + throws IOException + { + // do nothing + } + } + + static class CookieValidationHandler implements HttpTestHandler { + ConcurrentHashMap closedRequests = new ConcurrentHashMap<>(); + + @java.lang.Override + public void handle(HttpTestExchange t) throws IOException { + System.out.println("CookieValidationHandler for: " + t.getRequestURI()); + + List uuids = t.getRequestHeaders().get("X-uuid"); + if (uuids == null || uuids.size() != 1) { + readAllRequestData(t); + try (OutputStream os = t.getResponseBody()) { + String msg = "Incorrect uuid header values:[" + uuids + "]"; + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + } + return; + } + + String uuid = uuids.get(0); + // retrying + if (closedRequests.putIfAbsent(uuid, t.getRequestURI().toString()) == null) { + if (t.getExchangeVersion() == HttpClient.Version.HTTP_1_1) { + // Throwing an exception here only causes a retry + // with HTTP_1_1 - where it forces the server to close + // the connection. + // For HTTP/2 then throwing an IOE would cause the server + // to close the stream, and throwing anything else would + // cause it to close the connection, but neither would + // cause the client to retry. + // So we simply do not try to retry with HTTP/2 and just verify + // we have received the expected cookie + throw new IOException("Closing on first request"); + } + } + + // Check whether this request was upgraded. + // An upgraded request will have a version of HTTP_2 and + // an Upgrade: h2c header + HttpClient.Version version = t.getExchangeVersion(); + List upgrade = t.getRequestHeaders().get("Upgrade"); + if (upgrade == null) upgrade = List.of(); + boolean upgraded = version == HttpClient.Version.HTTP_2 + && upgrade.stream().anyMatch("h2c"::equalsIgnoreCase); + + // not retrying + readAllRequestData(t); + try (OutputStream os = t.getResponseBody()) { + List cookie = t.getRequestHeaders().get("Cookie"); + if (cookie != null) { + if (version == HttpClient.Version.HTTP_1_1 || upgraded) { + if (cookie.size() == 1) { + cookie = List.of(cookie.get(0).split("; ")); + } else if (cookie.size() > 1) { + String msg = "Found multiple 'Cookie:' lines for version=%s (upgraded=%s): %s"; + msg = String.format(msg, version, upgraded, cookie); + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + return; + } + } + Collections.sort(cookie = new ArrayList(cookie)); + } + if (cookie == null || cookie.size() == 0) { + String msg = "No cookie header present"; + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + } else if (!cookie.get(0).equals("CUSTOMER=ARTHUR_DENT")) { + String msg = "Incorrect cookie header value:[" + cookie.get(0) + "]"; + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + } else if (cookie.size() > 1 && !cookie.get(1).equals("ORDER=BISCUITS")) { + String msg = "Incorrect cookie header value:[" + cookie.get(1) + "]"; + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + } else if (cookie.size() > 2 && !cookie.get(2).equals("PRICE=42")) { + String msg = "Incorrect cookie header value:[" + cookie.get(2) + "]"; + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + } else if (cookie.size() != 3) { + String msg = "Incorrect cookie header values:[" + cookie + "]"; + (new RuntimeException(msg)).printStackTrace(); + t.sendResponseHeaders(500, -1); + os.write(msg.getBytes(UTF_8)); + } else { + assert cookie.get(0).equals("CUSTOMER=ARTHUR_DENT"); + byte[] bytes = MESSAGE.getBytes(UTF_8); + for (String value : cookie) { + t.getResponseHeaders().addHeader("X-Request-Cookie", value); + } + t.sendResponseHeaders(200, bytes.length); + os.write(bytes); + } + } finally { + closedRequests.remove(uuid); + } + + } + } + + static void readAllRequestData(HttpTestExchange t) throws IOException { + try (InputStream is = t.getRequestBody()) { + is.readAllBytes(); + } + } + + static class DummyServer extends Thread { + final ServerSocket ss; + final boolean secure; + ConcurrentLinkedQueue connections = new ConcurrentLinkedQueue<>(); + volatile boolean stopped; + DummyServer(ServerSocket ss, boolean secure) { + super("DummyServer[" + ss.getLocalPort()+"]"); + this.secure = secure; + this.ss = ss; + } + + // This is a bit shaky. It doesn't handle continuation + // lines, but our client shouldn't send any. + // Read a line from the input stream, swallowing the final + // \r\n sequence. Stops at the first \n, doesn't complain + // if it wasn't preceded by '\r'. + // + String readLine(InputStream r) throws IOException { + StringBuilder b = new StringBuilder(); + int c; + while ((c = r.read()) != -1) { + if (c == '\n') break; + b.appendCodePoint(c); + } + if (b.codePointAt(b.length() -1) == '\r') { + b.delete(b.length() -1, b.length()); + } + return b.toString(); + } + + @java.lang.Override + public void run() { + try { + while(!stopped) { + Socket clientConnection = ss.accept(); + connections.add(clientConnection); + System.out.println(now() + getName() + ": Client accepted"); + StringBuilder headers = new StringBuilder(); + Socket targetConnection = null; + InputStream ccis = clientConnection.getInputStream(); + OutputStream ccos = clientConnection.getOutputStream(); + Writer w = new OutputStreamWriter( + clientConnection.getOutputStream(), "UTF-8"); + PrintWriter pw = new PrintWriter(w); + System.out.println(now() + getName() + ": Reading request line"); + String requestLine = readLine(ccis); + System.out.println(now() + getName() + ": Request line: " + requestLine); + + StringTokenizer tokenizer = new StringTokenizer(requestLine); + String method = tokenizer.nextToken(); + assert method.equalsIgnoreCase("POST") || method.equalsIgnoreCase("GET"); + String path = tokenizer.nextToken(); + URI uri; + try { + String hostport = serverAuthority(); + uri = new URI((secure ? "https" : "http") +"://" + hostport + path); + } catch (Throwable x) { + System.err.printf("Bad target address: \"%s\" in \"%s\"%n", + path, requestLine); + clientConnection.close(); + continue; + } + + // Read all headers until we find the empty line that + // signals the end of all headers. + String line = requestLine; + String cookies = null; + while (!line.equals("")) { + System.out.println(now() + getName() + ": Reading header: " + + (line = readLine(ccis))); + if (line.startsWith("Cookie:")) { + if (cookies == null) cookies = line; + else cookies = cookies + "\n" + line; + } + headers.append(line).append("\r\n"); + } + + StringBuilder response = new StringBuilder(); + StringBuilder xheaders = new StringBuilder(); + + int index = headers.toString() + .toLowerCase(Locale.US) + .indexOf("content-length: "); + if (index >= 0) { + index = index + "content-length: ".length(); + String cl = headers.toString().substring(index); + StringTokenizer tk = new StringTokenizer(cl); + int len = Integer.parseInt(tk.nextToken()); + System.out.println(now() + getName() + + ": received body: " + + new String(ccis.readNBytes(len), UTF_8)); + } + String resp = MESSAGE; + String status = "200 OK"; + if (cookies == null) { + resp = "No cookies found in headers"; + status = "500 Internal Server Error"; + } else if (cookies.contains("\n")) { + resp = "More than one 'Cookie:' line found: " + + Arrays.asList(cookies.split("\n")); + status = "500 Internal Server Error"; + } else { + List values = + Stream.of(cookies.substring("Cookie:".length()).trim().split("; ")) + .map(String::trim) + .collect(Collectors.toList()); + Collections.sort(values); + if (values.size() != 3) { + resp = "Bad cookie list: " + values; + status = "500 Internal Server Error"; + } else if (!values.get(0).equals("CUSTOMER=ARTHUR_DENT")) { + resp = "Unexpected cookie: " + values.get(0) + " in " + values; + status = "500 Internal Server Error"; + } else if (!values.get(1).equals("ORDER=BISCUITS")) { + resp = "Unexpected cookie: " + values.get(1) + " in " + values; + status = "500 Internal Server Error"; + } else if (!values.get(2).equals("PRICE=42")) { + resp = "Unexpected cookie: " + values.get(1) + " in " + values; + status = "500 Internal Server Error"; + } else { + for (String cookie : values) { + xheaders.append("X-Request-Cookie: ") + .append(cookie) + .append("\r\n"); + } + } + } + byte[] b = resp.getBytes(UTF_8); + System.out.println(now() + + getName() + ": sending back " + uri); + + response.append("HTTP/1.1 ") + .append(status) + .append("\r\nContent-Length: ") + .append(b.length) + .append("\r\n") + .append(xheaders) + .append("\r\n"); + + // Then send the 200 OK response to the client + System.out.println(now() + getName() + ": Sending " + + response); + pw.print(response); + pw.flush(); + ccos.write(b); + ccos.flush(); + ccos.close(); + connections.remove(clientConnection); + clientConnection.close(); + } + } catch (Throwable t) { + if (!stopped) { + System.out.println(now() + getName() + ": failed: " + t); + t.printStackTrace(); + try { + stopServer(); + } catch (Throwable e) { + + } + } + } finally { + System.out.println(now() + getName() + ": exiting"); + } + } + + void close(Socket s) { + try { + s.close(); + } catch(Throwable t) { + + } + } + public void stopServer() throws IOException { + stopped = true; + ss.close(); + connections.forEach(this::close); + } + + public String serverAuthority() { + return InetAddress.getLoopbackAddress().getHostName() + ":" + + ss.getLocalPort(); + } + + static DummyServer create(InetSocketAddress sa) throws IOException { + ServerSocket ss = ServerSocketFactory.getDefault() + .createServerSocket(sa.getPort(), -1, sa.getAddress()); + return new DummyServer(ss, false); + } + + static DummyServer create(InetSocketAddress sa, SSLContext sslContext) throws IOException { + ServerSocket ss = sslContext.getServerSocketFactory() + .createServerSocket(sa.getPort(), -1, sa.getAddress()); + return new DummyServer(ss, true); + } + + + } +} -- GitLab From b1a1bf4e305d6675f8f751aa8fef7013d99466f1 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Fri, 19 Nov 2021 13:25:40 +0000 Subject: [PATCH 403/890] 8277427: Update jib-profiles.js to use JMH 1.33 devkit Reviewed-by: shade, erikj --- make/conf/jib-profiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 5fc212aa452..80228aa7188 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -1154,7 +1154,7 @@ var getJibProfilesDependencies = function (input, common) { jmh: { organization: common.organization, ext: "tar.gz", - revision: "1.28+1.0" + revision: "1.33+1.0" }, jcov: { -- GitLab From a0227965bb8d1d49718794d67f8a4cfeebc9bec2 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 19 Nov 2021 13:55:08 +0000 Subject: [PATCH 404/890] 8275745: Reproducible copyright headers Reviewed-by: ihse, erikj --- make/autoconf/basic_tools.m4 | 8 ++++++++ make/autoconf/jdk-options.m4 | 6 ++++++ .../build/tools/cldrconverter/CLDRConverter.java | 12 +++++++++++- .../tools/cldrconverter/CopyrightHeaders.java | 12 +++--------- .../cldrconverter/ResourceBundleGenerator.java | 4 ++-- .../generatelsrequivmaps/EquivMapsGenerator.java | 16 +++++++++------- make/modules/java.base/Gensrc.gmk | 3 ++- make/modules/jdk.localedata/Gensrc.gmk | 1 + 8 files changed, 42 insertions(+), 20 deletions(-) diff --git a/make/autoconf/basic_tools.m4 b/make/autoconf/basic_tools.m4 index 820d2f4924d..06dd87dce79 100644 --- a/make/autoconf/basic_tools.m4 +++ b/make/autoconf/basic_tools.m4 @@ -356,6 +356,14 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], fi AC_SUBST(IS_GNU_TIME) + # Check if it's GNU date + check_date=`$DATE --version 2>&1 | $GREP GNU` + if test "x$check_date" != x; then + IS_GNU_DATE=yes + else + IS_GNU_DATE=no + fi + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then UTIL_REQUIRE_PROGS(DSYMUTIL, dsymutil) UTIL_REQUIRE_PROGS(MIG, mig) diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index cef3a1c1bd7..f8062d91b69 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -199,6 +199,12 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], AC_MSG_ERROR([Copyright year must have a value]) elif test "x$with_copyright_year" != x; then COPYRIGHT_YEAR="$with_copyright_year" + elif test "x$SOURCE_DATE_EPOCH" != x; then + if test "x$IS_GNU_DATE" = xyes; then + COPYRIGHT_YEAR=`date --date=@$SOURCE_DATE_EPOCH +%Y` + else + COPYRIGHT_YEAR=`date -j -f %s $SOURCE_DATE_EPOCH +%Y` + fi else COPYRIGHT_YEAR=`$DATE +'%Y'` fi diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java index 5fd7a583a42..267f93e733b 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java @@ -114,6 +114,7 @@ public class CLDRConverter { ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_DEFAULT); private static Set AVAILABLE_TZIDS; + static int copyrightYear; private static String zoneNameTempFile; private static String tzDataDir; private static final Map canonicalTZMap = new HashMap<>(); @@ -217,6 +218,10 @@ public class CLDRConverter { verbose = true; break; + case "-year": + copyrightYear = Integer.parseInt(args[++i]); + break; + case "-zntempfile": zoneNameTempFile = args[++i]; break; @@ -235,7 +240,7 @@ public class CLDRConverter { } } } catch (RuntimeException e) { - severe("unknown or imcomplete arg(s): " + currentArg); + severe("unknown or incomplete arg(s): " + currentArg); usage(); System.exit(1); } @@ -260,6 +265,10 @@ public class CLDRConverter { setupBaseLocales("en-US"); } + if (copyrightYear == 0) { + copyrightYear = ZonedDateTime.now(ZoneId.of("America/Los_Angeles")).getYear(); + } + bundleGenerator = new ResourceBundleGenerator(); // Parse data independent of locales @@ -292,6 +301,7 @@ public class CLDRConverter { + "\t-basemodule generates bundles that go into java.base module%n" + "\t-baselocales loc(,loc)* locales that go into the base module%n" + "\t-o dir output directory (default: ./build/gensrc)%n" + + "\t-year year copyright year in output%n" + "\t-zntempfile template file for java.time.format.ZoneName.java%n" + "\t-tzdatadir tzdata directory for java.time.format.ZoneName.java%n" + "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n"); diff --git a/make/jdk/src/classes/build/tools/cldrconverter/CopyrightHeaders.java b/make/jdk/src/classes/build/tools/cldrconverter/CopyrightHeaders.java index 16062de116f..d1ea90a54c6 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/CopyrightHeaders.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/CopyrightHeaders.java @@ -26,6 +26,7 @@ package build.tools.cldrconverter; import java.util.Calendar; +import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; @@ -131,8 +132,7 @@ class CopyrightHeaders { " * questions.\n" + " */\n"; - static String getOracleCopyright() { - int year = getYear(); + static String getOracleCopyright(int year) { return String.format(year > 2012 ? ORACLE_AFTER2012 : ORACLE2012, year); } @@ -140,16 +140,10 @@ class CopyrightHeaders { return UNICODE; } - static String getOpenJDKCopyright() { - int year = getYear(); + static String getOpenJDKCopyright(int year) { return String.format(year > 2012 ? OPENJDK_AFTER2012 : OPENJDK2012, year); } - private static int getYear() { - return new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"), - Locale.US).get(Calendar.YEAR); - } - // no instantiation private CopyrightHeaders() { } diff --git a/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java b/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java index 9c95717edb2..34ce822ab64 100644 --- a/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java +++ b/make/jdk/src/classes/build/tools/cldrconverter/ResourceBundleGenerator.java @@ -198,7 +198,7 @@ class ResourceBundleGenerator implements BundleGenerator { try (PrintWriter out = new PrintWriter(file, encoding)) { // Output copyright headers - out.println(CopyrightHeaders.getOpenJDKCopyright()); + out.println(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear)); out.println(CopyrightHeaders.getUnicodeCopyright()); if (useJava) { @@ -266,7 +266,7 @@ class ResourceBundleGenerator implements BundleGenerator { CLDRConverter.info("Generating file " + file); try (PrintWriter out = new PrintWriter(file, "us-ascii")) { - out.printf(CopyrightHeaders.getOpenJDKCopyright()); + out.printf(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear)); out.printf((CLDRConverter.isBaseModule ? "package sun.util.cldr;\n\n" : "package sun.util.resources.cldr.provider;\n\n") diff --git a/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java b/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java index af2844b29e7..d196230bfbe 100644 --- a/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java +++ b/make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java @@ -29,13 +29,15 @@ import java.io.BufferedWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; -import java.time.ZoneId; -import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.TimeZone; import java.util.TreeMap; import java.util.stream.Collectors; @@ -51,17 +53,19 @@ import java.util.stream.Collectors; public class EquivMapsGenerator { public static void main(String[] args) throws Exception { - if (args.length != 2) { + if (args.length != 3) { System.err.println("Usage: java EquivMapsGenerator" - + " language-subtag-registry.txt LocaleEquivalentMaps.java"); + + " language-subtag-registry.txt LocaleEquivalentMaps.java copyrightYear"); System.exit(1); } + copyrightYear = Integer.parseInt(args[2]); readLSRfile(args[0]); generateEquivalentMap(); generateSourceCode(args[1]); } private static String LSRrevisionDate; + private static int copyrightYear; private static Map initialLanguageMap = new TreeMap<>(); private static Map initialRegionVariantMap = @@ -244,9 +248,7 @@ public class EquivMapsGenerator { + "}"; private static String getOpenJDKCopyright() { - int year = ZonedDateTime.now(ZoneId - .of("America/Los_Angeles")).getYear(); - return String.format(Locale.US, COPYRIGHT, year); + return String.format(Locale.US, COPYRIGHT, copyrightYear); } /** diff --git a/make/modules/java.base/Gensrc.gmk b/make/modules/java.base/Gensrc.gmk index f1eb5ff7e80..9ea2d015d3b 100644 --- a/make/modules/java.base/Gensrc.gmk +++ b/make/modules/java.base/Gensrc.gmk @@ -62,6 +62,7 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \ -baselocales "en-US" \ -o $(GENSRC_DIR) \ -basemodule \ + -year $(COPYRIGHT_YEAR) \ -zntempfile $(ZONENAME_TEMPLATE) \ -tzdatadir $(TZ_DATA_DIR)) $(TOUCH) $@ @@ -99,7 +100,7 @@ GENSRC_LSREQUIVMAPS := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/Loc $(GENSRC_LSREQUIVMAPS): $(TOPDIR)/make/data/lsrdata/language-subtag-registry.txt $(BUILD_TOOLS_JDK) $(call MakeDir, $(@D)) - $(TOOL_GENERATELSREQUIVMAPS) $< $@ + $(TOOL_GENERATELSREQUIVMAPS) $< $@ $(COPYRIGHT_YEAR) TARGETS += $(GENSRC_LSREQUIVMAPS) diff --git a/make/modules/jdk.localedata/Gensrc.gmk b/make/modules/jdk.localedata/Gensrc.gmk index ce746e89732..09f014e8607 100644 --- a/make/modules/jdk.localedata/Gensrc.gmk +++ b/make/modules/jdk.localedata/Gensrc.gmk @@ -46,6 +46,7 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \ $(call ExecuteWithLog, $@, \ $(TOOL_CLDRCONVERTER) -base $(CLDR_DATA_DIR) \ -baselocales "en-US" \ + -year $(COPYRIGHT_YEAR) \ -o $(GENSRC_DIR)) $(TOUCH) $@ -- GitLab From 936f7ff49ed86adb74bb1ff10d93cb3d7f7d70a0 Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Fri, 19 Nov 2021 14:23:04 +0000 Subject: [PATCH 405/890] 8276150: Quarantined jpackage apps are labeled as "damaged" Reviewed-by: almatvee --- .../jpackage/internal/MacAppImageBuilder.java | 81 +++++++++++++------ .../jpackage/macosx/SigningAppImageTest.java | 32 ++++++-- 2 files changed, 80 insertions(+), 33 deletions(-) diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java index f1eed5f5f15..c89612a260c 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java @@ -329,7 +329,8 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { } copyRuntimeFiles(params); - sign(params); + + doSigning(params); } private void copyRuntimeFiles(Map params) @@ -355,7 +356,12 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { } } - private void sign(Map params) throws IOException { + private void doSigning(Map params) + throws IOException { + + // signing or not, unsign first ... + unsignAppBundle(params, root); + if (Optional.ofNullable( SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { try { @@ -647,7 +653,52 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { IOUtils.exec(pb); } - static void signAppBundle( + private static void unsignAppBundle(Map params, + Path appLocation) throws IOException { + + // unsign all dylibs and executables + try (Stream stream = Files.walk(appLocation)) { + stream.peek(path -> { // fix permissions + try { + Set pfp = + Files.getPosixFilePermissions(path); + if (!pfp.contains(PosixFilePermission.OWNER_WRITE)) { + pfp = EnumSet.copyOf(pfp); + pfp.add(PosixFilePermission.OWNER_WRITE); + Files.setPosixFilePermissions(path, pfp); + } + } catch (IOException e) { + Log.verbose(e); + } + }).filter(p -> Files.isRegularFile(p) && + (Files.isExecutable(p) || p.toString().endsWith(".dylib")) + && !(p.toString().contains("dylib.dSYM/Contents")) + ).forEach(p -> { + // If p is a symlink then skip. + if (Files.isSymbolicLink(p)) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.ignoring.symlink"), p.toString())); + } else { + List args = new ArrayList<>(); + args.addAll(Arrays.asList("/usr/bin/codesign", + "--remove-signature", p.toString())); + try { + Set oldPermissions = + Files.getPosixFilePermissions(p); + p.toFile().setWritable(true, true); + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb); + Files.setPosixFilePermissions(p,oldPermissions); + } catch (IOException ioe) { + Log.verbose(ioe); + return; + } + } + }); + } + } + + private static void signAppBundle( Map params, Path appLocation, String signingIdentity, String identifierPrefix, Path entitlements) throws IOException { @@ -682,29 +733,7 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { Log.verbose(MessageFormat.format(I18N.getString( "message.ignoring.symlink"), p.toString())); } else { - List args; - // runtime and Framework files will be signed below - // but they need to be unsigned first here - if ((p.toString().contains("/Contents/runtime")) || - (p.toString().contains("/Contents/Frameworks"))) { - - args = new ArrayList<>(); - args.addAll(Arrays.asList("/usr/bin/codesign", - "--remove-signature", p.toString())); - try { - Set oldPermissions = - Files.getPosixFilePermissions(p); - p.toFile().setWritable(true, true); - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb); - Files.setPosixFilePermissions(p,oldPermissions); - } catch (IOException ioe) { - Log.verbose(ioe); - toThrow.set(ioe); - return; - } - } - args = new ArrayList<>(); + List args = new ArrayList<>(); args.addAll(Arrays.asList("/usr/bin/codesign", "--timestamp", "--options", "runtime", diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java index cd30b24f350..a94b449dcba 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java @@ -22,8 +22,11 @@ */ import java.nio.file.Path; +import java.util.List; + import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.Annotations.Parameters; /** * Tests generation of app image with --mac-sign and related arguments. Test will @@ -57,21 +60,36 @@ import jdk.jpackage.test.Annotations.Test; */ public class SigningAppImageTest { + final boolean doSign; + + public SigningAppImageTest(String flag) { + this.doSign = "true".equals(flag); + } + + @Parameters + public static List data() { + return List.of(new Object[][] {{"true"}, {"false"}}); + } + @Test - public static void test() throws Exception { + public void test() throws Exception { SigningCheck.checkCertificates(); JPackageCommand cmd = JPackageCommand.helloAppImage(); - cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, "--mac-signing-keychain", - SigningBase.KEYCHAIN); + if (doSign) { + cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", + SigningBase.DEV_NAME, "--mac-signing-keychain", + SigningBase.KEYCHAIN); + } cmd.executeAndAssertHelloAppImageCreated(); Path launcherPath = cmd.appLauncherPath(); - SigningBase.verifyCodesign(launcherPath, true); + SigningBase.verifyCodesign(launcherPath, doSign); Path appImage = cmd.outputBundle(); - SigningBase.verifyCodesign(appImage, true); - SigningBase.verifySpctl(appImage, "exec"); + SigningBase.verifyCodesign(appImage, doSign); + if (doSign) { + SigningBase.verifySpctl(appImage, "exec"); + } } } -- GitLab From 03f8c0fb9363dc1bb07bed1ae0359c029caa0130 Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Fri, 19 Nov 2021 14:36:07 +0000 Subject: [PATCH 406/890] 8275887: jarsigner prints invalid digest/signature algorithm warnings if keysize is weak/disabled Reviewed-by: weijun --- .../classes/sun/security/pkcs/SignerInfo.java | 28 +++++++----- .../provider/certpath/AlgorithmChecker.java | 31 ++----------- .../certpath/DistributionPointFetcher.java | 3 +- .../util/DisabledAlgorithmConstraints.java | 43 +++++++++++-------- .../util/JarConstraintsParameters.java | 11 ++--- .../security/util/ManifestEntryVerifier.java | 4 +- .../security/util/SignatureFileVerifier.java | 2 +- .../sun/security/tools/jarsigner/Main.java | 39 +++++++++-------- .../tools/jarsigner/TimestampCheck.java | 18 +++++++- 9 files changed, 90 insertions(+), 89 deletions(-) diff --git a/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java b/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java index 1689672b7a9..868babb2b44 100644 --- a/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java +++ b/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java @@ -76,10 +76,12 @@ public class SignerInfo implements DerEncoder { /** * A map containing the algorithms in this SignerInfo. This is used to * avoid checking algorithms to see if they are disabled more than once. - * The key is the AlgorithmId of the algorithm, and the value is the name of - * the field or attribute. + * The key is the AlgorithmId of the algorithm, and the value is a record + * containing the name of the field or attribute and whether the key + * should also be checked (ex: if it is a signature algorithm). */ - private Map algorithms = new HashMap<>(); + private record AlgorithmInfo(String field, boolean checkKey) {} + private Map algorithms = new HashMap<>(); public SignerInfo(X500Name issuerName, BigInteger serial, @@ -350,7 +352,8 @@ public class SignerInfo implements DerEncoder { } String digestAlgName = digestAlgorithmId.getName(); - algorithms.put(digestAlgorithmId, "SignerInfo digestAlgorithm field"); + algorithms.put(digestAlgorithmId, + new AlgorithmInfo("SignerInfo digestAlgorithm field", false)); byte[] dataSigned; @@ -421,7 +424,8 @@ public class SignerInfo implements DerEncoder { new AlgorithmId(ObjectIdentifier.of(oid), digestEncryptionAlgorithmId.getParameters()); algorithms.put(sigAlgId, - "SignerInfo digestEncryptionAlgorithm field"); + new AlgorithmInfo( + "SignerInfo digestEncryptionAlgorithm field", true)); } X509Certificate cert = getCertificate(block); @@ -677,7 +681,8 @@ public class SignerInfo implements DerEncoder { throws NoSuchAlgorithmException, SignatureException { AlgorithmId digestAlgId = token.getHashAlgorithm(); - algorithms.put(digestAlgId, "TimestampToken digestAlgorithm field"); + algorithms.put(digestAlgId, + new AlgorithmInfo("TimestampToken digestAlgorithm field", false)); MessageDigest md = MessageDigest.getInstance(digestAlgId.getName()); @@ -734,18 +739,19 @@ public class SignerInfo implements DerEncoder { */ public static Set verifyAlgorithms(SignerInfo[] infos, JarConstraintsParameters params, String name) throws SignatureException { - Map algorithms = new HashMap<>(); + Map algorithms = new HashMap<>(); for (SignerInfo info : infos) { algorithms.putAll(info.algorithms); } Set enabledAlgorithms = new HashSet<>(); try { - for (Map.Entry algorithm : algorithms.entrySet()) { - params.setExtendedExceptionMsg(name, algorithm.getValue()); - AlgorithmId algId = algorithm.getKey(); + for (var algEntry : algorithms.entrySet()) { + AlgorithmInfo info = algEntry.getValue(); + params.setExtendedExceptionMsg(name, info.field()); + AlgorithmId algId = algEntry.getKey(); JAR_DISABLED_CHECK.permits(algId.getName(), - algId.getParameters(), params); + algId.getParameters(), params, info.checkKey()); enabledAlgorithms.add(algId.getName()); } } catch (CertPathValidatorException e) { diff --git a/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java b/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java index 4a79c3a3f51..4451aa7e533 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/AlgorithmChecker.java @@ -38,7 +38,6 @@ import java.security.KeyFactory; import java.security.AlgorithmParameters; import java.security.GeneralSecurityException; import java.security.cert.Certificate; -import java.security.cert.X509CRL; import java.security.cert.X509Certificate; import java.security.cert.PKIXCertPathChecker; import java.security.cert.TrustAnchor; @@ -57,7 +56,6 @@ import sun.security.util.DisabledAlgorithmConstraints; import sun.security.validator.Validator; import sun.security.x509.AlgorithmId; import sun.security.x509.X509CertImpl; -import sun.security.x509.X509CRLImpl; /** * A {@code PKIXCertPathChecker} implementation to check whether a @@ -226,13 +224,13 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { CertPathConstraintsParameters cp = new CertPathConstraintsParameters(trustedPubKey, variant, anchor, date); - dac.permits(trustedPubKey.getAlgorithm(), cp); + dac.permits(trustedPubKey.getAlgorithm(), cp, true); } // Check the signature algorithm and parameters against constraints CertPathConstraintsParameters cp = new CertPathConstraintsParameters(x509Cert, variant, anchor, date); - dac.permits(currSigAlg, currSigAlgParams, cp); + dac.permits(currSigAlg, currSigAlgParams, cp, true); } else { if (prevPubKey != null) { if (!constraints.permits(SIGNATURE_PRIMITIVE_SET, @@ -362,29 +360,6 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { } } - /** - * Check the signature algorithm with the specified public key. - * - * @param key the public key to verify the CRL signature - * @param crl the target CRL - * @param variant the Validator variant of the operation. A null value - * passed will set it to Validator.GENERIC. - * @param anchor the trust anchor selected to validate the CRL issuer - */ - static void check(PublicKey key, X509CRL crl, String variant, - TrustAnchor anchor) throws CertPathValidatorException { - - X509CRLImpl x509CRLImpl = null; - try { - x509CRLImpl = X509CRLImpl.toImpl(crl); - } catch (CRLException ce) { - throw new CertPathValidatorException(ce); - } - - AlgorithmId algorithmId = x509CRLImpl.getSigAlgId(); - check(key, algorithmId, variant, anchor); - } - /** * Check the signature algorithm with the specified public key. * @@ -399,7 +374,7 @@ public final class AlgorithmChecker extends PKIXCertPathChecker { DisabledAlgorithmConstraints.certPathConstraints().permits( algorithmId.getName(), algorithmId.getParameters(), - new CertPathConstraintsParameters(key, variant, anchor, null)); + new CertPathConstraintsParameters(key, variant, anchor, null), true); } } diff --git a/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java index bce426cef57..413faa85e89 100644 --- a/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java +++ b/src/java.base/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java @@ -653,7 +653,8 @@ public class DistributionPointFetcher { // check the crl signature algorithm try { - AlgorithmChecker.check(prevKey, crl, variant, anchor); + AlgorithmChecker.check(prevKey, crlImpl.getSigAlgId(), + variant, anchor); } catch (CertPathValidatorException cpve) { if (debug != null) { debug.println("CRL signature algorithm check failed: " + cpve); diff --git a/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java index 2bf39bfae6f..7be36c1a6cb 100644 --- a/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java +++ b/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java @@ -192,9 +192,9 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { } public final void permits(String algorithm, AlgorithmParameters ap, - ConstraintsParameters cp) throws CertPathValidatorException { - - permits(algorithm, cp); + ConstraintsParameters cp, boolean checkKey) + throws CertPathValidatorException { + permits(algorithm, cp, checkKey); if (ap != null) { permits(ap, cp); } @@ -219,13 +219,13 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { PSSParameterSpec pssParams = ap.getParameterSpec(PSSParameterSpec.class); String digestAlg = pssParams.getDigestAlgorithm(); - permits(digestAlg, cp); + permits(digestAlg, cp, false); AlgorithmParameterSpec mgfParams = pssParams.getMGFParameters(); if (mgfParams instanceof MGF1ParameterSpec) { String mgfDigestAlg = ((MGF1ParameterSpec)mgfParams).getDigestAlgorithm(); if (!mgfDigestAlg.equalsIgnoreCase(digestAlg)) { - permits(mgfDigestAlg, cp); + permits(mgfDigestAlg, cp, false); } } } catch (InvalidParameterSpecException ipse) { @@ -233,22 +233,22 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { } } - public final void permits(String algorithm, ConstraintsParameters cp) - throws CertPathValidatorException { - - // Check if named curves in the key are disabled. - for (Key key : cp.getKeys()) { - for (String curve : getNamedCurveFromKey(key)) { - if (!checkAlgorithm(disabledAlgorithms, curve, decomposer)) { - throw new CertPathValidatorException( + public final void permits(String algorithm, ConstraintsParameters cp, + boolean checkKey) throws CertPathValidatorException { + if (checkKey) { + // Check if named curves in the key are disabled. + for (Key key : cp.getKeys()) { + for (String curve : getNamedCurveFromKey(key)) { + if (!checkAlgorithm(disabledAlgorithms, curve, decomposer)) { + throw new CertPathValidatorException( "Algorithm constraints check failed on disabled " + "algorithm: " + curve, null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); + } } } } - - algorithmConstraints.permits(algorithm, cp); + algorithmConstraints.permits(algorithm, cp, checkKey); } private static List getNamedCurveFromKey(Key key) { @@ -481,8 +481,8 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { return true; } - public void permits(String algorithm, ConstraintsParameters cp) - throws CertPathValidatorException { + public void permits(String algorithm, ConstraintsParameters cp, + boolean checkKey) throws CertPathValidatorException { if (debug != null) { debug.println("Constraints.permits(): " + algorithm + ", " @@ -496,8 +496,10 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { algorithms.add(algorithm); } - for (Key key : cp.getKeys()) { - algorithms.add(key.getAlgorithm()); + if (checkKey) { + for (Key key : cp.getKeys()) { + algorithms.add(key.getAlgorithm()); + } } // Check all applicable constraints @@ -507,6 +509,9 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints { continue; } for (Constraint constraint : list) { + if (!checkKey && constraint instanceof KeySizeConstraint) { + continue; + } constraint.permits(cp); } } diff --git a/src/java.base/share/classes/sun/security/util/JarConstraintsParameters.java b/src/java.base/share/classes/sun/security/util/JarConstraintsParameters.java index 9cf2bf9ffb3..28c959d3f59 100644 --- a/src/java.base/share/classes/sun/security/util/JarConstraintsParameters.java +++ b/src/java.base/share/classes/sun/security/util/JarConstraintsParameters.java @@ -98,16 +98,11 @@ public class JarConstraintsParameters implements ConstraintsParameters { this.timestamp = latestTimestamp; } - public JarConstraintsParameters(List chain, Timestamp timestamp) { + public JarConstraintsParameters(List chain, Date timestamp) { this.keys = new HashSet<>(); this.certsIssuedByAnchor = new HashSet<>(); addToCertsAndKeys(chain); - if (timestamp != null) { - addToCertsAndKeys(timestamp.getSignerCertPath()); - this.timestamp = timestamp.getTimestamp(); - } else { - this.timestamp = null; - } + this.timestamp = timestamp; } // extract last certificate and signer's public key from chain @@ -178,7 +173,7 @@ public class JarConstraintsParameters implements ConstraintsParameters { @Override public String extendedExceptionMsg() { - return message; + return message == null ? "." : message; } @Override diff --git a/src/java.base/share/classes/sun/security/util/ManifestEntryVerifier.java b/src/java.base/share/classes/sun/security/util/ManifestEntryVerifier.java index 43d0e751dee..14a56e33f38 100644 --- a/src/java.base/share/classes/sun/security/util/ManifestEntryVerifier.java +++ b/src/java.base/share/classes/sun/security/util/ManifestEntryVerifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -217,7 +217,7 @@ public class ManifestEntryVerifier { params.setExtendedExceptionMsg(JarFile.MANIFEST_NAME, name + " entry"); DisabledAlgorithmConstraints.jarConstraints() - .permits(digest.getAlgorithm(), params); + .permits(digest.getAlgorithm(), params, false); } catch (GeneralSecurityException e) { if (debug != null) { debug.println("Digest algorithm is restricted: " + e); diff --git a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java index 1af7417b7f1..d07152eeb18 100644 --- a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java +++ b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java @@ -383,7 +383,7 @@ public class SignatureFileVerifier { try { params.setExtendedExceptionMsg(name + ".SF", key + " attribute"); DisabledAlgorithmConstraints - .jarConstraints().permits(algorithm, params); + .jarConstraints().permits(algorithm, params, false); } catch (GeneralSecurityException e) { permittedAlgs.put(algorithm, Boolean.FALSE); permittedAlgs.put(key.toUpperCase(), Boolean.FALSE); diff --git a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java index 83383823303..e24d53425a8 100644 --- a/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java +++ b/src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java @@ -1018,9 +1018,14 @@ public class Main { Calendar c = Calendar.getInstance( TimeZone.getTimeZone("UTC"), Locale.getDefault(Locale.Category.FORMAT)); - c.setTime(tsTokenInfo.getDate()); + Date tsDate = tsTokenInfo.getDate(); + c.setTime(tsDate); JarConstraintsParameters jcp = - new JarConstraintsParameters(chain, si.getTimestamp()); + new JarConstraintsParameters(chain, tsDate); + JarConstraintsParameters jcpts = + new JarConstraintsParameters( + tsSi.getCertificateChain(tsToken), + tsDate); history = String.format( rb.getString("history.with.ts"), signer.getSubjectX500Principal(), @@ -1029,9 +1034,9 @@ public class Main { verifyWithWeak(key, jcp), c, tsSigner.getSubjectX500Principal(), - verifyWithWeak(tsDigestAlg, DIGEST_PRIMITIVE_SET, true, jcp), - verifyWithWeak(tsSigAlg, SIG_PRIMITIVE_SET, true, jcp), - verifyWithWeak(tsKey, jcp)); + verifyWithWeak(tsDigestAlg, DIGEST_PRIMITIVE_SET, true, jcpts), + verifyWithWeak(tsSigAlg, SIG_PRIMITIVE_SET, true, jcpts), + verifyWithWeak(tsKey, jcpts)); } else { JarConstraintsParameters jcp = new JarConstraintsParameters(chain, null); @@ -1371,13 +1376,13 @@ public class Main { boolean tsa, JarConstraintsParameters jcp) { try { - JAR_DISABLED_CHECK.permits(alg, jcp); + JAR_DISABLED_CHECK.permits(alg, jcp, false); } catch (CertPathValidatorException e) { disabledAlgFound = true; return String.format(rb.getString("with.disabled"), alg); } try { - LEGACY_CHECK.permits(alg, jcp); + LEGACY_CHECK.permits(alg, jcp, false); return alg; } catch (CertPathValidatorException e) { if (primitiveSet == SIG_PRIMITIVE_SET) { @@ -1399,13 +1404,13 @@ public class Main { private String verifyWithWeak(PublicKey key, JarConstraintsParameters jcp) { int kLen = KeyUtil.getKeySize(key); try { - JAR_DISABLED_CHECK.permits(key.getAlgorithm(), jcp); + JAR_DISABLED_CHECK.permits(key.getAlgorithm(), jcp, true); } catch (CertPathValidatorException e) { disabledAlgFound = true; return String.format(rb.getString("key.bit.disabled"), kLen); } try { - LEGACY_CHECK.permits(key.getAlgorithm(), jcp); + LEGACY_CHECK.permits(key.getAlgorithm(), jcp, true); if (kLen >= 0) { return String.format(rb.getString("key.bit"), kLen); } else { @@ -1422,9 +1427,9 @@ public class Main { boolean tsa, JarConstraintsParameters jcp) { try { - JAR_DISABLED_CHECK.permits(alg, jcp); + JAR_DISABLED_CHECK.permits(alg, jcp, false); try { - LEGACY_CHECK.permits(alg, jcp); + LEGACY_CHECK.permits(alg, jcp, false); } catch (CertPathValidatorException e) { if (primitiveSet == SIG_PRIMITIVE_SET) { legacyAlg |= 2; @@ -1451,9 +1456,9 @@ public class Main { private void checkWeakSign(PrivateKey key, JarConstraintsParameters jcp) { try { - JAR_DISABLED_CHECK.permits(key.getAlgorithm(), jcp); + JAR_DISABLED_CHECK.permits(key.getAlgorithm(), jcp, true); try { - LEGACY_CHECK.permits(key.getAlgorithm(), jcp); + LEGACY_CHECK.permits(key.getAlgorithm(), jcp, true); } catch (CertPathValidatorException e) { legacyAlg |= 8; } @@ -1465,12 +1470,12 @@ public class Main { private static String checkWeakKey(PublicKey key, CertPathConstraintsParameters cpcp) { int kLen = KeyUtil.getKeySize(key); try { - CERTPATH_DISABLED_CHECK.permits(key.getAlgorithm(), cpcp); + CERTPATH_DISABLED_CHECK.permits(key.getAlgorithm(), cpcp, true); } catch (CertPathValidatorException e) { return String.format(rb.getString("key.bit.disabled"), kLen); } try { - LEGACY_CHECK.permits(key.getAlgorithm(), cpcp); + LEGACY_CHECK.permits(key.getAlgorithm(), cpcp, true); if (kLen >= 0) { return String.format(rb.getString("key.bit"), kLen); } else { @@ -1483,12 +1488,12 @@ public class Main { private static String checkWeakAlg(String alg, CertPathConstraintsParameters cpcp) { try { - CERTPATH_DISABLED_CHECK.permits(alg, cpcp); + CERTPATH_DISABLED_CHECK.permits(alg, cpcp, false); } catch (CertPathValidatorException e) { return String.format(rb.getString("with.disabled"), alg); } try { - LEGACY_CHECK.permits(alg, cpcp); + LEGACY_CHECK.permits(alg, cpcp, false); return alg; } catch (CertPathValidatorException e) { return String.format(rb.getString("with.weak"), alg); diff --git a/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java b/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java index 16fc9bcb145..e6794550b90 100644 --- a/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java +++ b/test/jdk/sun/security/tools/jarsigner/TimestampCheck.java @@ -55,7 +55,7 @@ import sun.security.timestamp.TimestampToken; /* * @test * @bug 6543842 6543440 6939248 8009636 8024302 8163304 8169911 8180289 8172404 - * 8247960 8242068 8269039 + * 8247960 8242068 8269039 8275887 * @summary checking response of timestamp * @modules java.base/sun.security.pkcs * java.base/sun.security.timestamp @@ -340,6 +340,7 @@ public class TimestampCheck { verify("tsdisabled2.jar", "-verbose") .shouldHaveExitValue(16) .shouldContain("treated as unsigned") + .shouldNotMatch("Signature.*(disabled)") .shouldMatch("Timestamp.*512.*(disabled)"); // Algorithm used in signing is disabled @@ -356,6 +357,8 @@ public class TimestampCheck { // sign with RSAkeysize < 1024 signVerbose("normal", "sign1.jar", "sign2.jar", "disabledkeysize") .shouldContain("Algorithm constraints check failed on keysize") + .shouldNotContain("option is considered a security " + + "risk and is disabled") .shouldHaveExitValue(4); checkMultiple("sign2.jar"); @@ -419,6 +422,17 @@ public class TimestampCheck { // sign with RSAkeysize < 2048 signVerbose("normal", "sign1.jar", "sign2.jar", "weakkeysize") .shouldNotContain("Algorithm constraints check failed on keysize") + .shouldNotContain("The SHA-256 algorithm specified " + + "for the -digestalg option is considered a " + + "security risk") + .shouldNotContain("The SHA256withRSA algorithm " + + "specified for the -sigalg option is considered " + + "a security risk") + .shouldNotContain("The SHA-256 algorithm specified " + + "for the -tsadigestalg option is considered a " + + "security risk") + .shouldContain("The RSA signing key has a keysize " + + "of 1024 which is considered a security risk") .shouldHaveExitValue(0); checkMultipleWeak("sign2.jar"); @@ -673,7 +687,7 @@ public class TimestampCheck { .shouldMatch("Timestamp signature algorithm: .*key.*(disabled)"); verify(file, "-J-Djava.security.debug=jar") .shouldHaveExitValue(16) - .shouldMatch("SignatureException:.*keysize"); + .shouldMatch("SignatureException:.*MD5"); // For 8171319: keytool should print out warnings when reading or // generating cert/cert req using disabled algorithms. -- GitLab From 976c2bb05611cdc7b11b0918aaf50ff693507aae Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Fri, 19 Nov 2021 15:34:22 +0000 Subject: [PATCH 407/890] 8277212: GC accidentally cleans valid megamorphic vtable inline caches Reviewed-by: eosterlund, pliden, coleenp, thartmann --- src/hotspot/share/code/compiledMethod.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hotspot/share/code/compiledMethod.cpp b/src/hotspot/share/code/compiledMethod.cpp index 3cc2e1c4ffb..4e42b555d96 100644 --- a/src/hotspot/share/code/compiledMethod.cpp +++ b/src/hotspot/share/code/compiledMethod.cpp @@ -478,6 +478,10 @@ bool CompiledMethod::clean_ic_if_metadata_is_dead(CompiledIC *ic) { } else { ShouldNotReachHere(); } + } else { + // This inline cache is a megamorphic vtable call. Those ICs never hold + // any Metadata and should therefore never be cleaned by this function. + return true; } } -- GitLab From 09e8c8c64abf4178a042c79b92d7e08e54467331 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 19 Nov 2021 17:48:43 +0000 Subject: [PATCH 408/890] 8277342: vmTestbase/nsk/stress/strace/strace004.java fails with SIGSEGV in InstanceKlass::jni_id_for Reviewed-by: dholmes, hseigel --- src/hotspot/share/oops/instanceKlass.cpp | 17 +++-------------- src/hotspot/share/oops/instanceKlass.hpp | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 1e237de66ec..b4ee9c5dc0b 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -2061,29 +2061,18 @@ Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name, return NULL; } -/* jni_id_for_impl for jfieldIds only */ -JNIid* InstanceKlass::jni_id_for_impl(int offset) { +/* jni_id_for for jfieldIds only */ +JNIid* InstanceKlass::jni_id_for(int offset) { MutexLocker ml(JfieldIdCreation_lock); - // Retry lookup after we got the lock JNIid* probe = jni_ids() == NULL ? NULL : jni_ids()->find(offset); if (probe == NULL) { - // Slow case, allocate new static field identifier + // Allocate new static field identifier probe = new JNIid(this, offset, jni_ids()); set_jni_ids(probe); } return probe; } - -/* jni_id_for for jfieldIds only */ -JNIid* InstanceKlass::jni_id_for(int offset) { - JNIid* probe = jni_ids() == NULL ? NULL : jni_ids()->find(offset); - if (probe == NULL) { - probe = jni_id_for_impl(offset); - } - return probe; -} - u2 InstanceKlass::enclosing_method_data(int offset) const { const Array* const inner_class_list = inner_classes(); if (inner_class_list == NULL) { diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index d55b021b370..c2ad122e92b 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -1199,8 +1199,6 @@ private: void initialize_impl (TRAPS); void initialize_super_interfaces (TRAPS); void eager_initialize_impl (); - /* jni_id_for_impl for jfieldID only */ - JNIid* jni_id_for_impl (int offset); void add_initialization_error(JavaThread* current, Handle exception); oop get_initialization_error(JavaThread* current); -- GitLab From 6677554374ade32c9f2ddaaa093064de8aebd831 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 19 Nov 2021 18:48:06 +0000 Subject: [PATCH 409/890] 8274949: Use String.contains() instead of String.indexOf() in java.base Reviewed-by: weijun, dfuchs, vtewari, lancea --- src/java.base/share/classes/java/net/HttpCookie.java | 6 +++--- .../share/classes/java/net/HttpURLConnection.java | 2 +- .../share/classes/java/net/SocketPermission.java | 4 +--- .../share/classes/jdk/internal/jrtfs/JrtPath.java | 4 ++-- .../classes/jdk/internal/loader/URLClassPath.java | 6 +++--- .../share/classes/sun/net/www/http/HttpCapture.java | 2 +- .../sun/net/www/protocol/https/HttpsClient.java | 2 +- .../classes/sun/security/provider/PolicyFile.java | 2 +- .../classes/sun/security/rsa/RSAPSSSignature.java | 2 +- .../share/classes/sun/security/rsa/RSAUtil.java | 9 ++++----- .../classes/sun/security/tools/keytool/Main.java | 4 ++-- .../share/classes/sun/security/util/Debug.java | 4 ++-- .../classes/sun/security/util/SignatureUtil.java | 12 ++++++------ .../share/classes/sun/security/x509/AlgorithmId.java | 2 +- .../share/classes/sun/util/locale/LocaleMatcher.java | 4 ++-- .../sun/net/www/protocol/jar/JarFileFactory.java | 4 ++-- .../sun/net/www/protocol/jar/JarFileFactory.java | 4 ++-- 17 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/java.base/share/classes/java/net/HttpCookie.java b/src/java.base/share/classes/java/net/HttpCookie.java index dd8ae13914d..0214359ccde 100644 --- a/src/java.base/share/classes/java/net/HttpCookie.java +++ b/src/java.base/share/classes/java/net/HttpCookie.java @@ -1078,13 +1078,13 @@ public final class HttpCookie implements Cloneable { int version = 0; header = header.toLowerCase(); - if (header.indexOf("expires=") != -1) { + if (header.contains("expires=")) { // only netscape cookie using 'expires' version = 0; - } else if (header.indexOf("version=") != -1) { + } else if (header.contains("version=")) { // version is mandatory for rfc 2965/2109 cookie version = 1; - } else if (header.indexOf("max-age") != -1) { + } else if (header.contains("max-age")) { // rfc 2965/2109 use 'max-age' version = 1; } else if (startsWithIgnoreCase(header, SET_COOKIE2)) { diff --git a/src/java.base/share/classes/java/net/HttpURLConnection.java b/src/java.base/share/classes/java/net/HttpURLConnection.java index 9f7779dd011..dba500f017d 100644 --- a/src/java.base/share/classes/java/net/HttpURLConnection.java +++ b/src/java.base/share/classes/java/net/HttpURLConnection.java @@ -600,7 +600,7 @@ public abstract class HttpURLConnection extends URLConnection { public long getHeaderFieldDate(String name, long Default) { String dateString = getHeaderField(name); try { - if (dateString.indexOf("GMT") == -1) { + if (!dateString.contains("GMT")) { dateString = dateString+" GMT"; } return Date.parse(dateString); diff --git a/src/java.base/share/classes/java/net/SocketPermission.java b/src/java.base/share/classes/java/net/SocketPermission.java index a3101c50ca3..aca7642931f 100644 --- a/src/java.base/share/classes/java/net/SocketPermission.java +++ b/src/java.base/share/classes/java/net/SocketPermission.java @@ -30,12 +30,10 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamField; import java.io.Serializable; -import java.net.InetAddress; import java.security.AccessController; import java.security.Permission; import java.security.PermissionCollection; import java.security.PrivilegedAction; -import java.security.Security; import java.util.Collections; import java.util.Enumeration; import java.util.Map; @@ -333,7 +331,7 @@ public final class SocketPermission extends Permission ind = host.lastIndexOf(':'); host = "[" + host.substring(0, ind) + "]" + host.substring(ind); - } else if (tokens == 8 && host.indexOf("::") == -1) { + } else if (tokens == 8 && !host.contains("::")) { // IPv6 address only, not followed by port host = "[" + host + "]"; } else { diff --git a/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java b/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java index 4720d9c98ad..a3772b5e26d 100644 --- a/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java +++ b/src/java.base/share/classes/jdk/internal/jrtfs/JrtPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -485,7 +485,7 @@ final class JrtPath implements Path { // Remove DotSlash(./) and resolve DotDot (..) components private String getResolved() { int length = path.length(); - if (length == 0 || (path.indexOf("./") == -1 && path.charAt(length - 1) != '.')) { + if (length == 0 || (!path.contains("./") && path.charAt(length - 1) != '.')) { return path; } else { return resolvePath(); diff --git a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java index dad2f25917b..1961e669e87 100644 --- a/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java +++ b/src/java.base/share/classes/jdk/internal/loader/URLClassPath.java @@ -561,11 +561,11 @@ public class URLClassPath { // fallback to checkRead/checkConnect for pre 1.2 // security managers if ((perm instanceof java.io.FilePermission) && - perm.getActions().indexOf("read") != -1) { + perm.getActions().contains("read")) { security.checkRead(perm.getName()); } else if ((perm instanceof java.net.SocketPermission) && - perm.getActions().indexOf("connect") != -1) { + perm.getActions().contains("connect")) { URL locUrl = url; if (urlConnection instanceof JarURLConnection) { locUrl = ((JarURLConnection)urlConnection).getJarFileURL(); @@ -1254,7 +1254,7 @@ public class URLClassPath { URLClassPath.check(url); final File file; - if (name.indexOf("..") != -1) { + if (name.contains("..")) { file = (new File(dir, name.replace('/', File.separatorChar))) .getCanonicalFile(); if ( !((file.getPath()).startsWith(dir.getPath())) ) { diff --git a/src/java.base/share/classes/sun/net/www/http/HttpCapture.java b/src/java.base/share/classes/sun/net/www/http/HttpCapture.java index 48e3dccd58c..1d2732e0473 100644 --- a/src/java.base/share/classes/sun/net/www/http/HttpCapture.java +++ b/src/java.base/share/classes/sun/net/www/http/HttpCapture.java @@ -157,7 +157,7 @@ public class HttpCapture { if (p.matcher(s).find()) { String f = capFiles.get(i); File fi; - if (f.indexOf("%d") >= 0) { + if (f.contains("%d")) { java.util.Random rand = new java.util.Random(); do { String f2 = f.replace("%d", Integer.toString(rand.nextInt())); diff --git a/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java b/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java index 2f718e5bcc9..4818f945bcc 100644 --- a/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java +++ b/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java @@ -645,7 +645,7 @@ final class HttpsClient extends HttpClient // ignore } - if ((cipher != null) && (cipher.indexOf("_anon_") != -1)) { + if ((cipher != null) && (cipher.contains("_anon_"))) { return; } else if ((hostnameVerifier != null) && (hostnameVerifier.verify(host, session))) { diff --git a/src/java.base/share/classes/sun/security/provider/PolicyFile.java b/src/java.base/share/classes/sun/security/provider/PolicyFile.java index a9be95dd598..0708b5ee01a 100644 --- a/src/java.base/share/classes/sun/security/provider/PolicyFile.java +++ b/src/java.base/share/classes/sun/security/provider/PolicyFile.java @@ -723,7 +723,7 @@ public class PolicyFile extends java.security.Policy { + SELF; } // check for self - if (pe.name != null && pe.name.indexOf(SELF) != -1) { + if (pe.name != null && pe.name.contains(SELF)) { // Create a "SelfPermission" , it could be an // an unresolved permission which will be resolved // when implies is called diff --git a/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java b/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java index 994d9f14cce..d523e0b8be1 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java @@ -59,7 +59,7 @@ public class RSAPSSSignature extends SignatureSpi { private boolean isDigestEqual(String stdAlg, String givenAlg) { if (stdAlg == null || givenAlg == null) return false; - if (givenAlg.indexOf("-") != -1) { + if (givenAlg.contains("-")) { return stdAlg.equalsIgnoreCase(givenAlg); } else { if (stdAlg.equals("SHA-1")) { diff --git a/src/java.base/share/classes/sun/security/rsa/RSAUtil.java b/src/java.base/share/classes/sun/security/rsa/RSAUtil.java index 1d2e991e1bd..eb1a2e81e49 100644 --- a/src/java.base/share/classes/sun/security/rsa/RSAUtil.java +++ b/src/java.base/share/classes/sun/security/rsa/RSAUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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,7 +25,6 @@ package sun.security.rsa; -import java.io.IOException; import java.security.*; import java.security.spec.*; import sun.security.util.ObjectIdentifier; @@ -61,9 +60,9 @@ public class RSAUtil { // match loosely in order to work with 3rd party providers which // may not follow the standard names - if (name.indexOf("PSS") != -1) { + if (name.contains("PSS")) { return PSS; - } else if (name.indexOf("RSA") != -1) { + } else if (name.contains("RSA")) { return RSA; } else { // no match throw new ProviderException("Unsupported algorithm " + name); @@ -151,7 +150,7 @@ public class RSAUtil { } catch (ProviderException pe) { // accommodate RSA keys encoded with various RSA signature oids // for backward compatibility - if (algName.indexOf("RSA") != -1) { + if (algName.contains("RSA")) { result[0] = KeyType.RSA; } else { // pass it up diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/src/java.base/share/classes/sun/security/tools/keytool/Main.java index 4d0b92fff00..74f0bd5c255 100644 --- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -1473,10 +1473,10 @@ public final class Main { if (s == null) break; // OpenSSL does not use NEW //if (s.startsWith("-----BEGIN NEW CERTIFICATE REQUEST-----")) { - if (s.startsWith("-----BEGIN") && s.indexOf("REQUEST") >= 0) { + if (s.startsWith("-----BEGIN") && s.contains("REQUEST")) { canRead = true; //} else if (s.startsWith("-----END NEW CERTIFICATE REQUEST-----")) { - } else if (s.startsWith("-----END") && s.indexOf("REQUEST") >= 0) { + } else if (s.startsWith("-----END") && s.contains("REQUEST")) { break; } else if (canRead) { sb.append(s); diff --git a/src/java.base/share/classes/sun/security/util/Debug.java b/src/java.base/share/classes/sun/security/util/Debug.java index 31c650e521d..77db7492878 100644 --- a/src/java.base/share/classes/sun/security/util/Debug.java +++ b/src/java.base/share/classes/sun/security/util/Debug.java @@ -161,10 +161,10 @@ public class Debug { if (args == null) return false; else { - if (args.indexOf("all") != -1) + if (args.contains("all")) return true; else - return (args.indexOf(option) != -1); + return (args.contains(option)); } } diff --git a/src/java.base/share/classes/sun/security/util/SignatureUtil.java b/src/java.base/share/classes/sun/security/util/SignatureUtil.java index 6ad35d12386..7266339c977 100644 --- a/src/java.base/share/classes/sun/security/util/SignatureUtil.java +++ b/src/java.base/share/classes/sun/security/util/SignatureUtil.java @@ -54,7 +54,7 @@ public class SignatureUtil { * form of an OID, or the OID value if no match is found. */ private static String checkName(String algName) { - if (algName.indexOf(".") == -1) { + if (!algName.contains(".")) { return algName; } else { // convert oid to String @@ -100,7 +100,7 @@ public class SignatureUtil { // AlgorithmParameters.getAlgorithm() may returns oid if it's // created during DER decoding. Convert to use the standard name // before passing it to RSAUtil - if (params.getAlgorithm().indexOf(".") != -1) { + if (params.getAlgorithm().contains(".")) { try { params = createAlgorithmParameters(sigName, params.getEncoded()); @@ -109,9 +109,9 @@ public class SignatureUtil { } } - if (sigName.indexOf("RSA") != -1) { + if (sigName.contains("RSA")) { paramSpec = RSAUtil.getParamSpec(params); - } else if (sigName.indexOf("ECDSA") != -1) { + } else if (sigName.contains("ECDSA")) { try { paramSpec = params.getParameterSpec(ECParameterSpec.class); } catch (Exception e) { @@ -141,11 +141,11 @@ public class SignatureUtil { if (paramBytes != null) { sigName = checkName(sigName).toUpperCase(Locale.ENGLISH); - if (sigName.indexOf("RSA") != -1) { + if (sigName.contains("RSA")) { AlgorithmParameters params = createAlgorithmParameters(sigName, paramBytes); paramSpec = RSAUtil.getParamSpec(params); - } else if (sigName.indexOf("ECDSA") != -1) { + } else if (sigName.contains("ECDSA")) { try { Provider p = Signature.getInstance(sigName).getProvider(); paramSpec = ECUtil.getECParameterSpec(p, paramBytes); diff --git a/src/java.base/share/classes/sun/security/x509/AlgorithmId.java b/src/java.base/share/classes/sun/security/x509/AlgorithmId.java index 627fb503ba9..5f2403f3b40 100644 --- a/src/java.base/share/classes/sun/security/x509/AlgorithmId.java +++ b/src/java.base/share/classes/sun/security/x509/AlgorithmId.java @@ -520,7 +520,7 @@ public class AlgorithmId implements Serializable, DerEncoder { } // unknown algorithm oids - if (name.indexOf(".") == -1) { + if (!name.contains(".")) { // see if there is a matching oid string alias mapping from // 3rd party providers name = name.toUpperCase(Locale.ENGLISH); diff --git a/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java b/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java index 93629220de5..07d4252f0e0 100644 --- a/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java +++ b/src/java.base/share/classes/sun/util/locale/LocaleMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -83,7 +83,7 @@ public final class LocaleMatcher { for (LanguageRange lr : priorityList) { String range = lr.getRange(); if (range.startsWith("*-") - || range.indexOf("-*") != -1) { // Extended range + || range.contains("-*")) { // Extended range if (mode == AUTOSELECT_FILTERING) { return filterExtended(priorityList, tags); } else if (mode == MAP_EXTENDED_RANGES) { diff --git a/src/java.base/unix/classes/sun/net/www/protocol/jar/JarFileFactory.java b/src/java.base/unix/classes/sun/net/www/protocol/jar/JarFileFactory.java index 1a9e2e32415..291b6d06d8e 100644 --- a/src/java.base/unix/classes/sun/net/www/protocol/jar/JarFileFactory.java +++ b/src/java.base/unix/classes/sun/net/www/protocol/jar/JarFileFactory.java @@ -203,11 +203,11 @@ class JarFileFactory implements URLJarFile.URLJarFileCloseController { // fallback to checkRead/checkConnect for pre 1.2 // security managers if ((perm instanceof java.io.FilePermission) && - perm.getActions().indexOf("read") != -1) { + perm.getActions().contains("read")) { sm.checkRead(perm.getName()); } else if ((perm instanceof java.net.SocketPermission) && - perm.getActions().indexOf("connect") != -1) { + perm.getActions().contains("connect")) { sm.checkConnect(url.getHost(), url.getPort()); } else { throw se; diff --git a/src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java b/src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java index 3384f5cb58c..8f8808bd5eb 100644 --- a/src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java +++ b/src/java.base/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java @@ -226,11 +226,11 @@ class JarFileFactory implements URLJarFile.URLJarFileCloseController { // fallback to checkRead/checkConnect for pre 1.2 // security managers if ((perm instanceof java.io.FilePermission) && - perm.getActions().indexOf("read") != -1) { + perm.getActions().contains("read")) { sm.checkRead(perm.getName()); } else if ((perm instanceof java.net.SocketPermission) && - perm.getActions().indexOf("connect") != -1) { + perm.getActions().contains("connect")) { sm.checkConnect(url.getHost(), url.getPort()); } else { throw se; -- GitLab From 36b59f3814fdaa44c9c04a0e8d63d0ba56929326 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 19 Nov 2021 18:49:04 +0000 Subject: [PATCH 410/890] 8274333: Redundant null comparison after Pattern.split Reviewed-by: mullan, weijun, rriggs, iris --- .../classes/sun/launcher/LauncherHelper.java | 15 +++++++-------- .../sun/security/util/AlgorithmDecomposer.java | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/src/java.base/share/classes/sun/launcher/LauncherHelper.java index 82b73d01c6b..1f2db91f472 100644 --- a/src/java.base/share/classes/sun/launcher/LauncherHelper.java +++ b/src/java.base/share/classes/sun/launcher/LauncherHelper.java @@ -34,11 +34,6 @@ package sun.launcher; * */ -/** - * A utility package for the java(1), javaw(1) launchers. - * The following are helper methods that the native launcher uses - * to perform checks etc. using JNI, see src/share/bin/java.c - */ import java.io.File; import java.io.IOException; import java.io.PrintStream; @@ -88,7 +83,11 @@ import jdk.internal.module.Modules; import jdk.internal.platform.Container; import jdk.internal.platform.Metrics; - +/** + * A utility package for the java(1), javaw(1) launchers. + * The following are helper methods that the native launcher uses + * to perform checks etc. using JNI, see src/share/bin/java.c + */ public final class LauncherHelper { // No instantiation @@ -154,8 +153,8 @@ public final class LauncherHelper { long initialHeapSize, long maxHeapSize, long stackSize) { initOutput(printToStderr); - String opts[] = optionFlag.split(":"); - String optStr = (opts.length > 1 && opts[1] != null) + String[] opts = optionFlag.split(":"); + String optStr = opts.length > 1 ? opts[1].trim() : "all"; switch (optStr) { diff --git a/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java b/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java index 69eaa22aafb..3f498475932 100644 --- a/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java +++ b/src/java.base/share/classes/sun/security/util/AlgorithmDecomposer.java @@ -57,7 +57,7 @@ public class AlgorithmDecomposer { String[] transTokens = algorithm.split("/"); for (String transToken : transTokens) { - if (transToken == null || transToken.isEmpty()) { + if (transToken.isEmpty()) { continue; } @@ -70,7 +70,7 @@ public class AlgorithmDecomposer { String[] tokens = PATTERN.split(transToken); for (String token : tokens) { - if (token == null || token.isEmpty()) { + if (token.isEmpty()) { continue; } -- GitLab From f609b8fd74c55f3149d8e5a6a9a9bc3598c0b961 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 19 Nov 2021 18:50:03 +0000 Subject: [PATCH 411/890] 8274946: Cleanup unnecessary calls to Throwable.initCause() in java.rmi Reviewed-by: iris, rriggs --- .../classes/java/rmi/server/RMIClassLoader.java | 12 ++++-------- .../rmi/server/RemoteObjectInvocationHandler.java | 3 +-- .../javax/rmi/ssl/SslRMIClientSocketFactory.java | 6 ++---- .../javax/rmi/ssl/SslRMIServerSocketFactory.java | 3 +-- .../share/classes/sun/rmi/log/ReliableLog.java | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java b/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java index fb17f04ef4e..7ee253e5dc8 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java +++ b/src/java.rmi/share/classes/java/rmi/server/RMIClassLoader.java @@ -694,10 +694,8 @@ public class RMIClassLoader { } catch (InstantiationException e) { throw new InstantiationError(e.getMessage()); } catch (ClassCastException e) { - Error error = new LinkageError( - "provider class not assignable to RMIClassLoaderSpi"); - error.initCause(e); - throw error; + throw new LinkageError( + "provider class not assignable to RMIClassLoaderSpi", e); } } @@ -711,10 +709,8 @@ public class RMIClassLoader { try { return iter.next(); } catch (ClassCastException e) { - Error error = new LinkageError( - "provider class not assignable to RMIClassLoaderSpi"); - error.initCause(e); - throw error; + throw new LinkageError( + "provider class not assignable to RMIClassLoaderSpi", e); } } diff --git a/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java b/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java index 68d04f10e40..e619515818c 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java +++ b/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java @@ -221,8 +221,7 @@ public class RemoteObjectInvocationHandler method = cl.getMethod(method.getName(), method.getParameterTypes()); } catch (NoSuchMethodException nsme) { - throw (IllegalArgumentException) - new IllegalArgumentException().initCause(nsme); + throw new IllegalArgumentException(nsme); } Class thrownType = e.getClass(); for (Class declaredType : method.getExceptionTypes()) { diff --git a/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java b/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java index f0faba4345a..ab6664b9d8f 100644 --- a/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java +++ b/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java @@ -133,8 +133,7 @@ public class SslRMIClientSocketFactory try { sslSocket.setEnabledCipherSuites(enabledCipherSuitesList); } catch (IllegalArgumentException e) { - throw (IOException) - new IOException(e.getMessage()).initCause(e); + throw new IOException(e.getMessage(), e); } } // Set the SSLSocket Enabled Protocols @@ -151,8 +150,7 @@ public class SslRMIClientSocketFactory try { sslSocket.setEnabledProtocols(enabledProtocolsList); } catch (IllegalArgumentException e) { - throw (IOException) - new IOException(e.getMessage()).initCause(e); + throw new IOException(e.getMessage(), e); } } // Return the preconfigured SSLSocket diff --git a/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java b/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java index af0055dac0a..3424bf77812 100644 --- a/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java +++ b/src/java.rmi/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java @@ -185,8 +185,7 @@ public class SslRMIServerSocketFactory implements RMIServerSocketFactory { } catch (Exception e) { final String msg = "Unable to check if the cipher suites " + "and protocols to enable are supported"; - throw (IllegalArgumentException) - new IllegalArgumentException(msg).initCause(e); + throw new IllegalArgumentException(msg, e); } } diff --git a/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java b/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java index d4b06e94e82..293e2ccdec3 100644 --- a/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java +++ b/src/java.rmi/share/classes/sun/rmi/log/ReliableLog.java @@ -285,8 +285,7 @@ public class ReliableLog { } catch (IOException e) { throw e; } catch (Exception e) { - throw (IOException) - new IOException("write update failed").initCause(e); + throw new IOException("write update failed", e); } log.sync(); @@ -547,8 +546,7 @@ public class ReliableLog { new LogFile(logName, "rw") : logClassConstructor.newInstance(logName, "rw")); } catch (Exception e) { - throw (IOException) new IOException( - "unable to construct LogFile instance").initCause(e); + throw new IOException("unable to construct LogFile instance", e); } if (truncate) { -- GitLab From e47cc81b095381266104e9137495e91fb4c225a4 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 19 Nov 2021 18:51:13 +0000 Subject: [PATCH 412/890] 8275386: Change nested classes in jdk.jlink to static nested classes Reviewed-by: alanb, rriggs, iris --- .../classes/jdk/tools/jlink/internal/ImagePluginStack.java | 4 ++-- .../classes/jdk/tools/jlink/internal/ResourcePoolManager.java | 4 ++-- .../jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java index bd68c451b74..4bf5987a643 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -282,7 +282,7 @@ public final class ImagePluginStack { * This pool wrap the original pool and automatically uncompress ResourcePoolEntry * if needed. */ - private class LastPoolManager extends ResourcePoolManager { + private static class LastPoolManager extends ResourcePoolManager { private class LastModule implements ResourcePoolModule { final ResourcePoolModule module; diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java index d7125d103d1..67823180480 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ResourcePoolManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -74,7 +74,7 @@ public class ResourcePoolManager { Resources.canEncapsulate(path); } - class ResourcePoolModuleImpl implements ResourcePoolModule { + static class ResourcePoolModuleImpl implements ResourcePoolModule { final Map moduleContent = new LinkedHashMap<>(); // lazily initialized diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java index 4d1129ac8dc..c58013d5443 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java @@ -477,7 +477,7 @@ public final class SystemModulesPlugin extends AbstractPlugin { return bais; } - class ModuleInfoRewriter extends ByteArrayOutputStream { + static class ModuleInfoRewriter extends ByteArrayOutputStream { final ModuleInfoExtender extender; ModuleInfoRewriter(InputStream in) { this.extender = ModuleInfoExtender.newExtender(in); @@ -625,7 +625,7 @@ public final class SystemModulesPlugin extends AbstractPlugin { } /** - * Generate byteccode for no-arg constructor + * Generate bytecode for no-arg constructor */ private void genConstructor(ClassWriter cw) { MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); -- GitLab From a3406a1d8ab4228b06b4f2978f87275093c39468 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 19 Nov 2021 19:49:57 +0000 Subject: [PATCH 413/890] 8277092: TestMetaspaceAllocationMT2.java#ndebug-default fails with "RuntimeException: Committed seems high: NNNN expected at most MMMM" Reviewed-by: coleenp --- .../Metaspace/elastic/MetaspaceTestContext.java | 5 +++-- .../elastic/MetaspaceTestManyArenasManyThreads.java | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestContext.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestContext.java index 3a43d92c48d..521bf75e974 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestContext.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestContext.java @@ -1,9 +1,7 @@ import sun.hotspot.WhiteBox; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; public class MetaspaceTestContext { @@ -140,6 +138,9 @@ public class MetaspaceTestContext { long usageMeasured = usedWords(); long committedMeasured = committedWords(); + System.out.println("context used words " + usageMeasured + ", committed words " + committedMeasured + + "."); + if (usageMeasured > committedMeasured) { throw new RuntimeException("Weirdness."); } diff --git a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java index 3614fde13d3..7e1c2678f4e 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java +++ b/test/hotspot/jtreg/runtime/Metaspace/elastic/MetaspaceTestManyArenasManyThreads.java @@ -83,6 +83,19 @@ public class MetaspaceTestManyArenasManyThreads extends MetaspaceTestWithThreads // Stop all threads. stopAllThreads(); + // At this point a large number of Arenas will have died (see above), but we probably still have + // some live arenas left. The chunk freelist will be full of free chunks. Maybe a bit fragmented, + // with a healthy mixture of larger and smaller chunks, since we still have live arenas. + // These chunks are all committed still, since we did nothing to reclaim the storage. We now purge + // the context manually to uncommit those chunks, in order to get a realistic number for + // committed words (see checkStatistics()). + // Note: In real metaspace, this happens as part of the same GC which removes class loaders and + // frees their metaspace arenas. All within CLDG::purge(). But since this test isolates the metaspace + // context and does test it separately, GC and CLDG are not involved here. We need to purge manually. + // + // Purging uncommits all free chunks >= 64K/16K (MetaspaceReclaimPolicy=standard/aggressive). + context.purge(); + context.updateTotals(); System.out.println(" ## Finished: " + context); -- GitLab From 2d4af2255feb2eaeca533424f8cba3ec0945d757 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Fri, 19 Nov 2021 20:24:17 +0000 Subject: [PATCH 414/890] 8277370: configure script cannot distinguish WSL version Reviewed-by: erikj --- make/autoconf/basic_windows.m4 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/make/autoconf/basic_windows.m4 b/make/autoconf/basic_windows.m4 index a8686e45d89..25d10d9b8fe 100644 --- a/make/autoconf/basic_windows.m4 +++ b/make/autoconf/basic_windows.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2021, 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 @@ -34,9 +34,10 @@ AC_DEFUN([BASIC_SETUP_PATHS_WINDOWS], OPENJDK_BUILD_OS_ENV=windows.wsl1 else # This test is not guaranteed, but there is no documented way of - # distinguishing between WSL1 and WSL2. Assume only WSL2 has WSL_INTEROP - # in /run/WSL - if test -d "/run/WSL" ; then + # distinguishing between WSL1 and WSL2. + # Check whether "Hyper-V" appears in /proc/interrupts because WSL2 runs on Hyper-V. + $GREP -q Hyper-V /proc/interrupts + if test $? -eq 0; then OPENJDK_BUILD_OS_ENV=windows.wsl2 else OPENJDK_BUILD_OS_ENV=windows.wsl1 -- GitLab From 2ab43ec2428edaebfe9a7fb0e716ff7141a28de0 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Fri, 19 Nov 2021 20:51:22 +0000 Subject: [PATCH 415/890] 8273544: Increase test coverage for snippets Reviewed-by: jjg --- .../formats/html/TagletWriterImpl.java | 4 +- .../toolkit/resources/doclets.properties | 3 + .../toolkit/taglets/SnippetTaglet.java | 116 ++-- .../toolkit/taglets/snippet/Attribute.java | 3 +- .../toolkit/taglets/snippet/Attributes.java | 8 - .../toolkit/taglets/snippet/Parser.java | 6 +- .../toolkit/taglets/snippet/Replace.java | 4 +- .../toolkit/taglets/snippet/Style.java | 3 +- .../doclet/testSnippetTag/SnippetTester.java | 119 ++++ .../testSnippetTag/TestSnippetMarkup.java | 574 ++++++++++++++++++ .../testSnippetTag/TestSnippetPathOption.java | 220 +++++++ .../doclet/testSnippetTag/TestSnippetTag.java | 462 +++++++------- 12 files changed, 1233 insertions(+), 289 deletions(-) create mode 100644 test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java create mode 100644 test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java create mode 100644 test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetPathOption.java diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index 68506e3140e..e2d96f0f693 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -429,7 +429,7 @@ public class TagletWriterImpl extends TagletWriter { String strippedLine = line.strip(); int idx = line.indexOf(strippedLine); assert idx >= 0; // because the stripped line is a substring of the line being stripped - Text whitespace = Text.of(line.substring(0, idx)); + Text whitespace = Text.of(utils.normalizeNewlines(line.substring(0, idx))); // If the leading whitespace is not excluded from the link, // browsers might exhibit unwanted behavior. For example, a // browser might display hand-click cursor while user hovers @@ -438,7 +438,7 @@ public class TagletWriterImpl extends TagletWriter { c = new ContentBuilder(whitespace, htmlWriter.linkToContent(element, e, t, strippedLine)); // We don't care about trailing whitespace. } else { - c = HtmlTree.SPAN(Text.of(sequence)); + c = HtmlTree.SPAN(Text.of(utils.normalizeNewlines(sequence))); classes.forEach(((HtmlTree) c)::addStyle); } code.add(c); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties index edc3b53ea46..8825d98f96d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties @@ -361,6 +361,9 @@ doclet.snippet.region.not_found=\ doclet.tag.attribute.value.illegal=\ illegal value for attribute "{0}": "{1}" +doclet.tag.attribute.value.missing=\ + missing value for attribute "{0}" + doclet.tag.attribute.repeated=\ repeated attribute: "{0}" diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java index 9219a78814a..754a5bf0618 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java @@ -28,7 +28,6 @@ package jdk.javadoc.internal.doclets.toolkit.taglets; import java.io.IOException; import java.util.EnumSet; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -84,6 +83,45 @@ public class SnippetTaglet extends BaseTaglet { */ @Override public Content getInlineTagOutput(Element holder, DocTree tag, TagletWriter writer) { + try { + return generateContent(holder, tag, writer); + } catch (BadSnippetException e) { + error(writer, holder, e.tag(), e.key(), e.args()); + return badSnippet(writer); + } + } + + private static final class BadSnippetException extends Exception { + + @java.io.Serial + private static final long serialVersionUID = 1; + + private final transient DocTree tag; + private final String key; + private final transient Object[] args; + + BadSnippetException(DocTree tag, String key, Object... args) { + this.tag = tag; + this.key = key; + this.args = args; + } + + DocTree tag() { + return tag; + } + + String key() { + return key; + } + + Object[] args() { + return args; + } + } + + private Content generateContent(Element holder, DocTree tag, TagletWriter writer) + throws BadSnippetException + { SnippetTree snippetTag = (SnippetTree) tag; // organize snippet attributes in a map, performing basic checks along the way @@ -98,9 +136,8 @@ public class SnippetTaglet extends BaseTaglet { // two like-named attributes found; although we report on the most // recently encountered of the two, the iteration order might differ // from the source order (see JDK-8266826) - error(writer, holder, a, "doclet.tag.attribute.repeated", - a.getName().toString()); - return badSnippet(writer); + throw new BadSnippetException(a, "doclet.tag.attribute.repeated", + a.getName().toString()); } final String CLASS = "class"; @@ -111,22 +148,19 @@ public class SnippetTaglet extends BaseTaglet { final boolean containsBody = snippetTag.getBody() != null; if (containsClass && containsFile) { - error(writer, holder, attributes.get(CLASS), - "doclet.snippet.contents.ambiguity.external"); - return badSnippet(writer); + throw new BadSnippetException(attributes.get(CLASS), + "doclet.snippet.contents.ambiguity.external"); } else if (!containsClass && !containsFile && !containsBody) { - error(writer, holder, tag, "doclet.snippet.contents.none"); - return badSnippet(writer); + throw new BadSnippetException(tag, "doclet.snippet.contents.none"); } String regionName = null; AttributeTree region = attributes.get("region"); if (region != null) { - regionName = stringOf(region.getValue()); + regionName = stringValueOf(region); if (regionName.isBlank()) { - error(writer, holder, region, "doclet.tag.attribute.value.illegal", - "region", region.getValue()); - return badSnippet(writer); + throw new BadSnippetException(region, "doclet.tag.attribute.value.illegal", + "region", region.getValue()); } } @@ -141,12 +175,12 @@ public class SnippetTaglet extends BaseTaglet { if (containsFile || containsClass) { AttributeTree a; String v = containsFile - ? stringOf((a = attributes.get(FILE)).getValue()) - : stringOf((a = attributes.get(CLASS)).getValue()).replace(".", "/") + ".java"; + ? stringValueOf((a = attributes.get(FILE))) + : stringValueOf((a = attributes.get(CLASS))).replace(".", "/") + ".java"; if (v.isBlank()) { - error(writer, holder, a, "doclet.tag.attribute.value.illegal", - containsFile ? FILE : CLASS, v); + throw new BadSnippetException(a, "doclet.tag.attribute.value.illegal", + containsFile ? FILE : CLASS, v); } // we didn't create JavaFileManager, so we won't close it; even if an error occurs @@ -165,24 +199,21 @@ public class SnippetTaglet extends BaseTaglet { if (fileObject == null && fileManager.hasLocation(Location.SNIPPET_PATH)) { fileObject = fileManager.getFileForInput(Location.SNIPPET_PATH, "", v); } - } catch (IOException | IllegalArgumentException e) { + } catch (IOException | IllegalArgumentException e) { // TODO: test this when JDK-8276892 is integrated // JavaFileManager.getFileForInput can throw IllegalArgumentException in certain cases - error(writer, holder, a, "doclet.exception.read.file", v, e.getCause()); - return badSnippet(writer); + throw new BadSnippetException(a, "doclet.exception.read.file", v, e.getCause()); } if (fileObject == null) { // i.e. the file does not exist - error(writer, holder, a, "doclet.File_not_found", v); - return badSnippet(writer); + throw new BadSnippetException(a, "doclet.File_not_found", v); } try { externalContent = fileObject.getCharContent(true).toString(); - } catch (IOException e) { - error(writer, holder, a, "doclet.exception.read.file", - fileObject.getName(), e.getCause()); - return badSnippet(writer); + } catch (IOException e) { // TODO: test this when JDK-8276892 is integrated + throw new BadSnippetException(a, "doclet.exception.read.file", + fileObject.getName(), e.getCause()); } } @@ -197,12 +228,12 @@ public class SnippetTaglet extends BaseTaglet { } } catch (ParseException e) { var path = writer.configuration().utils.getCommentHelper(holder) - .getDocTreePath(snippetTag.getBody()); + .getDocTreePath(snippetTag.getBody()); // TODO: there should be a method in Messages; that method should mirror Reporter's; use that method instead accessing Reporter. String msg = writer.configuration().getDocResources() - .getText("doclet.snippet.markup", e.getMessage()); + .getText("doclet.snippet.markup", e.getMessage()); writer.configuration().getReporter().print(Diagnostic.Kind.ERROR, - path, e.getPosition(), e.getPosition(), e.getPosition(), msg); + path, e.getPosition(), e.getPosition(), e.getPosition(), msg); return badSnippet(writer); } @@ -213,7 +244,7 @@ public class SnippetTaglet extends BaseTaglet { } catch (ParseException e) { assert fileObject != null; writer.configuration().getMessages().error(fileObject, e.getPosition(), - e.getPosition(), e.getPosition(), "doclet.snippet.markup", e.getMessage()); + e.getPosition(), e.getPosition(), "doclet.snippet.markup", e.getMessage()); return badSnippet(writer); } @@ -235,8 +266,7 @@ public class SnippetTaglet extends BaseTaglet { } } if (r1 == null && r2 == null) { - error(writer, holder, tag, "doclet.snippet.region.not_found", regionName); - return badSnippet(writer); + throw new BadSnippetException(tag, "doclet.snippet.region.not_found", regionName); } } @@ -252,9 +282,7 @@ public class SnippetTaglet extends BaseTaglet { String inlineStr = inlineSnippet.asCharSequence().toString(); String externalStr = externalSnippet.asCharSequence().toString(); if (!Objects.equals(inlineStr, externalStr)) { - error(writer, holder, tag, "doclet.snippet.contents.mismatch", diff(inlineStr, externalStr)); - // output one above the other - return badSnippet(writer); + throw new BadSnippetException(tag, "doclet.snippet.contents.mismatch", diff(inlineStr, externalStr)); } } @@ -263,17 +291,17 @@ public class SnippetTaglet extends BaseTaglet { String lang = null; AttributeTree langAttr = attributes.get("lang"); - if (langAttr != null && langAttr.getValueKind() != AttributeTree.ValueKind.EMPTY) { - lang = stringOf(langAttr.getValue()); + if (langAttr != null) { + lang = stringValueOf(langAttr); } else if (containsClass) { lang = "java"; } else if (containsFile) { lang = languageFromFileName(fileObject.getName()); } AttributeTree idAttr = attributes.get("id"); - String id = idAttr == null || idAttr.getValueKind() == AttributeTree.ValueKind.EMPTY - ? null - : stringOf(idAttr.getValue()); + String id = idAttr == null + ? null + : stringValueOf(idAttr); return writer.snippetTagOutput(holder, snippetTag, text, id, lang); } @@ -304,8 +332,12 @@ public class SnippetTaglet extends BaseTaglet { return result.text(); } - private static String stringOf(List value) { - return value.stream() + private static String stringValueOf(AttributeTree at) throws BadSnippetException { + if (at.getValueKind() == AttributeTree.ValueKind.EMPTY) { + throw new BadSnippetException(at, "doclet.tag.attribute.value.missing", + at.getName().toString()); + } + return at.getValue().stream() // value consists of TextTree or ErroneousTree nodes; // ErroneousTree is a subtype of TextTree .map(t -> ((TextTree) t).getBody()) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java index af2587373ea..3289da82764 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attribute.java @@ -58,8 +58,7 @@ import java.util.Objects; * This code and its internal interfaces are subject to change or * deletion without notice. */ -// TODO: uncomment /* sealed */ when minimum boot JDK version >= 17 -public /* sealed */ abstract class Attribute { +public abstract class Attribute { private final String name; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attributes.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attributes.java index 616063d8503..2548ccf0256 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attributes.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Attributes.java @@ -67,12 +67,4 @@ public final class Attributes { .map(type::cast) .findAny(); } - - public int size() { - return attributes.values().stream().mapToInt(List::size).sum(); - } - - public boolean isEmpty() { - return attributes.isEmpty(); - } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java index 2dd7d5b4b6e..3a1fbaade37 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java @@ -152,15 +152,15 @@ public final class Parser { line = rawLine + (addLineTerminator ? "\n" : ""); } else { String maybeMarkup = markedUpLine.group(3); - List parsedTags = null; + List parsedTags; try { parsedTags = markupParser.parse(maybeMarkup); } catch (ParseException e) { - // adjust index + // translate error position from markup to file line throw new ParseException(e::getMessage, markedUpLine.start(3) + e.getPosition()); } for (Tag t : parsedTags) { - t.lineSourceOffset = next.offset; + t.lineSourceOffset = next.offset(); t.markupLineOffset = markedUpLine.start(3); } thisLineTags.addAll(parsedTags); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Replace.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Replace.java index 20820d8762d..1777bf65a74 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Replace.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Replace.java @@ -66,7 +66,7 @@ public final class Replace implements Action { Matcher matcher = pattern.matcher(textString); var replacements = new ArrayList(); StringBuilder b = new StringBuilder(); - int off = 0; // offset because of the replacements (can be negative) + int off = 0; // cumulative offset caused by replacements (can become negative) while (matcher.find()) { int start = matcher.start(); int end = matcher.end(); @@ -79,7 +79,7 @@ public final class Replace implements Action { // there's no need to call matcher.appendTail(b) for (int i = replacements.size() - 1; i >= 0; i--) { Replacement r = replacements.get(i); - text.subText(r.start, r.end).replace(Set.of(), r.value); + text.subText(r.start(), r.end()).replace(Set.of(), r.value()); } } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java index fa6a2c293b6..854899c794e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java @@ -33,8 +33,7 @@ package jdk.javadoc.internal.doclets.toolkit.taglets.snippet; * This code and its internal interfaces are subject to change or * deletion without notice. */ -// TODO: uncomment /* sealed */ when minimum boot JDK version >= 17 -public /* sealed */ interface Style { +public sealed interface Style { /** * A style that describes a link. Characters of this style are typically diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java new file mode 100644 index 00000000000..a220a4a0db9 --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2021, 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.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.function.ObjIntConsumer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import javadoc.tester.JavadocTester; +import toolbox.ToolBox; + +public class SnippetTester extends JavadocTester { + + protected final ToolBox tb = new ToolBox(); + + protected void checkOrder(Output output, String... strings) { + new OutputChecker(output).setExpectOrdered(true).check(strings); + } + + /* + * When checking for errors, it is important not to confuse one error with + * another. This method checks that there are no crashes (which are also + * errors) by checking for stack traces. We never expect crashes. + */ + protected void checkNoCrashes() { + checking("check crashes"); + Matcher matcher = Pattern.compile("\\s*at.*\\(.*\\.java:\\d+\\)") + .matcher(getOutput(Output.STDERR)); + if (!matcher.find()) { + passed(""); + } else { + failed("Looks like a stacktrace: " + matcher.group()); + } + } + + /* + * This is a convenience method to iterate through a list. + * Unlike List.forEach, this method provides the consumer not only with an + * element but also that element's index. + * + * See JDK-8184707. + */ + protected static void forEachNumbered(List list, ObjIntConsumer action) { + for (var iterator = list.listIterator(); iterator.hasNext(); ) { + action.accept(iterator.next(), iterator.previousIndex()); + } + } + + // TODO: + // Explore the toolbox.ToolBox.writeFile and toolbox.ToolBox.writeJavaFiles methods: + // see if any of them could be used instead of this one + protected static void addSnippetFile(Path srcDir, String packageName, String fileName, String content) + throws UncheckedIOException + { + String[] components = packageName.split("\\."); + Path snippetFiles = Path.of(components[0], Arrays.copyOfRange(components, 1, components.length)).resolve("snippet-files"); + try { + Path p = Files.createDirectories(srcDir.resolve(snippetFiles)); + Files.writeString(p.resolve(fileName), content, StandardOpenOption.CREATE_NEW); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + protected void checkOutputEither(Output out, String first, String... other) { + var strings = Stream.concat(Stream.of(first), Stream.of(other)) + .toArray(String[]::new); + new OutputChecker(out).checkAnyOf(strings); + } + + protected String getSnippetHtmlRepresentation(String pathToHtmlFile, + String content) { + return getSnippetHtmlRepresentation(pathToHtmlFile, content, Optional.empty(), Optional.empty()); + } + + protected String getSnippetHtmlRepresentation(String pathToHtmlFile, + String content, + Optional lang, + Optional id) { + // the further away from the root, the further to reach to common resources + int nComponents = (int) pathToHtmlFile.chars().filter(c -> c == '/').count(); + var svgString = "../".repeat(nComponents) + "copy.svg"; + var idString = id.isEmpty() ? "" : " id=\"%s\"".formatted(id.get()); + var langString = lang.isEmpty() ? "" : " class=\"language-%s\"".formatted(lang.get()); + return """ +
      +
      %s
      +
      """.formatted(svgString, idString, langString, content); + } +} diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java new file mode 100644 index 00000000000..16ec3321290 --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java @@ -0,0 +1,574 @@ +/* + * Copyright (c) 2021, 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 8266666 + * @summary Implementation for snippets + * @library /tools/lib ../../lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.javadoc/jdk.javadoc.internal.tool + * @build javadoc.tester.* toolbox.ToolBox toolbox.ModuleBuilder builder.ClassBuilder + * @run main TestSnippetMarkup + */ + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Function; +import java.util.regex.MatchResult; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.lang.model.element.Modifier; +import javax.lang.model.element.NestingKind; +import javax.tools.FileObject; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +import builder.ClassBuilder; +import toolbox.ToolBox; + +import static javax.tools.DocumentationTool.Location.DOCUMENTATION_OUTPUT; + +public class TestSnippetMarkup extends SnippetTester { + + public static void main(String... args) throws Exception { + new TestSnippetMarkup().runTests(m -> new Object[]{Paths.get(m.getName())}); + } + + /* + * The semantics of expectedOutput depends on the test case this record is + * used in. + */ + record TestCase(String region, String input, String expectedOutput) { + TestCase(String input, String expectedOutput) { + this("", input, expectedOutput); + } + } + + // @highlight [region|region=] + // [regex=|substring=] + // [type=bold|italics|highlighted] + // [:] + @Test + public void testHighlight(Path base) throws Exception { + var testCases = List.of( + new TestCase( // FIXME: newline should not be included + """ + First line // @highlight + Second line + """, + """ + First line + Second line + """), + new TestCase( + """ + First line // @highlight regex="\\w" type="bold" + Second line + """, + """ + First line + Second line + """), + new TestCase( // FIXME: newline should not be included + """ + First line // @highlight @highlight regex="\\w" type="bold" + Second line + """, + """ + First line + Second line + """ + )); + testPositive(base, testCases); + } + + // @replace [region|region=] + // [regex=|substring=] + // [replacement=] + // [:] + @Test + public void testReplace(Path base) throws Exception { + var testCases = List.of( + new TestCase( + """ + First line // @replace regex="\\w" replacement="." + Second line + """, + """ + ..... .... + Second line + """), + new TestCase( // "substring" is not treated like "regex" + """ + First line // @replace substring="\\w" replacement="." + Second line + """, + """ + First line + Second line + """ + ), + new TestCase( + """ + First line // @replace substring="i" replacement="." + Second line + """, + """ + F.rst l.ne + Second line + """ + )); + testPositive(base, testCases); + } + + // @link [region|region=] + // [regex=|substring=] + // [target=] + // [type=link|linkplain] + // [:] + @Test + public void testLink(Path base) throws Exception { + var testCases = List.of( + new TestCase( + """ + First line // @link regex="\\w" target="java.lang.Object#Object" + Second line + """, + replace(""" + link(First) link(line) + Second line + """, "link\\((.+?)\\)", r -> link(true, "java.lang.Object#Object", r.group(1))) + )); + testPositive(base, testCases); + } + + @Test + public void testCornerCases(Path base) throws Exception { + var testCases = List.of( + new TestCase( // This is how one might represent a unicode escape sequence uninterpreted, if required. + """ + \\$0041 // @replace substring="$" replacement="u" + """, + """ + \\u0041 + """ + ), + new TestCase( // This is how one might represent `*/` without ending an enclosing comment, if required. + // A non-whitespace character that is also not `*` is needed before `*` so that `*` + // is not confused with the optional doc comment decoration. + // (We cannot use, for example, `**$` or ` *$`.) + """ + a*$ // @replace substring="$" replacement="/" + """, + """ + a*/ + """ + ), + new TestCase( // This is how one might output markup, if required. + // Append a no-op markup since only the rightmost markup is parsed. + """ + // @highlight // @start region=throwaway @end + """, + """ + // @highlight + """ + ) + ); + testPositive(base, testCases); + } + + /* + * For all but the last line of snippet source, next-line markup behaves + * as if that markup without the next-line modifier were put on that + * next line. + */ +// @Test + public void testPositiveInlineExternalTagMarkup_NextLine(Path base) throws Exception { + throw new RuntimeException("Not yet implemented"); + } + + /* + * If next-line markup is put on the last line of a snippet source, + * an error occurs. + */ + @Test + public void testNegativeInlineExternalHybridTagMarkup_NextLinePutOnLastLine(Path base) throws Exception { + Path srcDir = base.resolve("src"); + Path outDir = base.resolve("out"); + var goodFile = "good.txt"; + var badFile = "bad.txt"; + var badFile2 = "bad2.txt"; // to workaround error deduplication + new ClassBuilder(tb, "pkg.A") + .setModifiers("public", "class") + .addMembers( + ClassBuilder.MethodBuilder + .parse("public void inline() { }") + .setComments(""" + {@snippet : + First line // @highlight : + } + """)) + .addMembers( + ClassBuilder.MethodBuilder + .parse("public void external() { }") + .setComments(""" + {@snippet file="%s"} + """.formatted(badFile))) + .addMembers( + ClassBuilder.MethodBuilder + .parse("public void hybrid1() { }") + .setComments(""" + {@snippet file="%s": + First line + } + """.formatted(badFile2))) + .addMembers( + ClassBuilder.MethodBuilder + .parse("public void hybrid2() { }") + .setComments(""" + {@snippet file="%s": + First line // @highlight : + } + """.formatted(goodFile))) + // TODO: these two hybrids are to test what *this* test should not test. + // Add a test that checks that an error in either part + // of a hybrid snippet causes the snippet to fail (property-based testing) + .write(srcDir); + addSnippetFile(srcDir, "pkg", goodFile, """ +First line // @highlight + """); + addSnippetFile(srcDir, "pkg", badFile, """ +First line // @highlight : + """); + addSnippetFile(srcDir, "pkg", badFile2, """ +First line // @highlight : + """); + javadoc("-d", outDir.toString(), + "-sourcepath", srcDir.toString(), + "pkg"); + checkExit(Exit.ERROR); + checkOutput(Output.OUT, true, +""" +A.java:5: error: snippet markup: tag refers to non-existent lines +First line // @highlight : + ^""", +""" +A.java:24: error: snippet markup: tag refers to non-existent lines +First line // @highlight : + ^""", +""" +%s:1: error: snippet markup: tag refers to non-existent lines +First line // @highlight : + ^""".formatted(badFile), +""" +%s:1: error: snippet markup: tag refers to non-existent lines +First line // @highlight : + ^""".formatted(badFile2)); + checkNoCrashes(); + } + + private void testPositive(Path base, List testCases) + throws IOException { + StringBuilder methods = new StringBuilder(); + forEachNumbered(testCases, (i, n) -> { + String r = i.region.isBlank() ? "" : "region=" + i.region; + var methodDef = """ + + /** + {@snippet %s: + %s}*/ + public void case%s() {} + """.formatted(r, i.input, n); + methods.append(methodDef); + }); + var classDef = """ + public class A { + %s + } + """.formatted(methods.toString()); + Path src = Files.createDirectories(base.resolve("src")); + tb.writeJavaFiles(src, classDef); + javadoc("-d", base.resolve("out").toString(), + "-sourcepath", src.toString(), + src.resolve("A.java").toString()); + checkExit(Exit.OK); + checkNoCrashes(); + forEachNumbered(testCases, (t, index) -> { + String html = """ + case%s() +
      + %s +
      """.formatted(index, getSnippetHtmlRepresentation("A.html", t.expectedOutput())); + checkOutput("A.html", true, html); + }); + } + + // FIXME: move error (i.e. negative) tests from TestSnippetTag to here + + // @start region= ... @end [region|region=] + @Test + public void testStart(Path base) throws Exception { + var testCases = new ArrayList(); + for (var variant : generateStartEndVariants()) { + var t = new TestCase(variant.region, + """ + First line + Second line // ###START + Third line + Fourth line // ###END + Fifth line + """.replaceFirst("###START", variant.start) + .replaceFirst("###END", variant.end), + """ + Second line + Third line + Fourth line"""); + testCases.add(t); + } + testPositive(base, testCases); + } + + private static String link(boolean linkPlain, + String targetReference, + String content) + throws UncheckedIOException { + + // The HTML tag generated from the @link snippet markup tag is the + // same as that of the {@link} Standard doclet tag. This is specified + // and can be used for comparison and testing. + + // generate documentation for {@link} to grab its HTML tag; + // generate documentation at low cost and do not interfere with the + // calling test state; for that, do not create file trees, do not write + // to std out/err, and generally try to keep everything in memory + + String source = """ + /** {@link %s %s} */ + public interface A { } + """.formatted(targetReference, content); + + JavaFileObject src = new JavaFileObject() { + @Override + public Kind getKind() {return Kind.SOURCE;} + + @Override + public boolean isNameCompatible(String simpleName, Kind kind) { + return kind == Kind.SOURCE; + } + + @Override + public NestingKind getNestingKind() {return NestingKind.TOP_LEVEL;} + + @Override + public Modifier getAccessLevel() {return Modifier.PUBLIC;} + + @Override + public URI toUri() {throw new UnsupportedOperationException();} + + @Override + public String getName() {return "A.java";} + + @Override + public InputStream openInputStream() { + return new ByteArrayInputStream(source.getBytes(StandardCharsets.UTF_8)); + } + + @Override + public OutputStream openOutputStream() { + throw new UnsupportedOperationException("Read only"); + } + + @Override + public Reader openReader(boolean ignoreEncodingErrors) { + return new StringReader(source); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + + @Override + public Writer openWriter() { + throw new UnsupportedOperationException("Read only"); + } + + @Override + public long getLastModified() { + return 0; + } + + @Override + public boolean delete() { + throw new UnsupportedOperationException("Read only"); + } + }; + + var documentationTool = ToolProvider.getSystemDocumentationTool(); + var writer = new StringWriter(); + + // FileManager has to be StandardJavaFileManager; JavaDoc is adamant about it + class InMemoryFileManager extends ToolBox.MemoryFileManager + implements StandardJavaFileManager { + + private final StandardJavaFileManager delegate = documentationTool + .getStandardFileManager(null, null, null); + + @Override + public Iterable getJavaFileObjectsFromFiles(Iterable files) { + return delegate.getJavaFileObjectsFromFiles(files); + } + + @Override + public Iterable getJavaFileObjects(File... files) { + return delegate.getJavaFileObjects(files); + } + + @Override + public Iterable getJavaFileObjectsFromStrings(Iterable names) { + return delegate.getJavaFileObjectsFromStrings(names); + } + + @Override + public Iterable getJavaFileObjects(String... names) { + return delegate.getJavaFileObjects(names); + } + + @Override + public void setLocation(Location location, Iterable files) throws IOException { + delegate.setLocation(location, files); + } + + @Override + public Iterable getLocation(Location location) { + return delegate.getLocation(location); + } + + @Override + public FileObject getFileForOutput(Location location, + String packageName, + String relativeName, + FileObject sibling) { + return getJavaFileForOutput(location, packageName + relativeName, JavaFileObject.Kind.OTHER, null); + } + } + try { + var fileManager = new InMemoryFileManager(); + fileManager.setLocation(DOCUMENTATION_OUTPUT, Collections.singleton(new File("."))); + // exclude extraneous output; we're only after @link + List options = List.of("--limit-modules", "java.base", + "-quiet", "-nohelp", "-noindex", "-nonavbar", "-nosince", + "-notimestamp", "-notree", "-Xdoclint:none"); + var documentationTask = documentationTool.getTask(null, fileManager, + null, null, options, List.of(src)); + if (!documentationTask.call()) { + throw new IOException(writer.toString()); + } + String output = fileManager.getFileString(DOCUMENTATION_OUTPUT, "A.html"); + // use the [^<>] regex to select HTML elements that immediately enclose "content" + Matcher m = Pattern.compile("(?is)]*\" title=\"[^<>]*\" class=\"[^<>]*\">" + + content + "").matcher(output); + if (!m.find()) { + throw new IOException(output); + } + return m.group(0); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + private static String replace(String source, + String regex, + Function replacer) { + return Pattern.compile(regex).matcher(source).replaceAll(replacer); + } + + private static final AtomicLong UNIQUE_INTEGER_NUMBER = new AtomicLong(); + + private static Collection generateStartEndVariants() { + var variants = new ArrayList(); + for (var start : startAttributes()) + for (var end : endAttributes()) { + var region = uniqueValue(); + var v = new StartEndVariant(region, + "@start" + start.apply(region), + "@end" + end.apply(region)); + variants.add(v); + } + return variants; + } + + private static String uniqueValue() { + return "auto_generated_value_" + UNIQUE_INTEGER_NUMBER.incrementAndGet(); + } + + public static Collection> startAttributes() { + return attributes("region"); + } + + private static Collection> endAttributes() { + var variants = new ArrayList>(); + variants.add(value -> ""); + variants.add(value -> " region"); + variants.addAll(attributes("region")); + return variants; + } + + private static Collection> attributes(String name) { + var variants = new ArrayList>(); + for (var whitespace1 : List.of(" ", " ")) + for (var whitespace2 : List.of("", " ")) + for (var quote : List.of("", "'", "\"")) + for (var whitespace3 : List.of("", " ")) { + Function f = value -> + whitespace1 + name + whitespace2 + + "=" + whitespace3 + (quote + value + quote); + variants.add(f); + } + return variants; + } + + record StartEndVariant(String region, String start, String end) {} +} diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetPathOption.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetPathOption.java new file mode 100644 index 00000000000..208faa45a4b --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetPathOption.java @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2021, 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 8266666 + * @summary Implementation for snippets + * @library /tools/lib ../../lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.javadoc/jdk.javadoc.internal.tool + * @build javadoc.tester.* toolbox.ToolBox toolbox.ModuleBuilder builder.ClassBuilder + * @run main TestSnippetPathOption + */ + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class TestSnippetPathOption extends SnippetTester { + + public static void main(String... args) throws Exception { + new TestSnippetPathOption().runTests(m -> new Object[]{Paths.get(m.getName())}); + } + + /* + # snippet-files snippet-path result + ---+--------------+--------------+--------------------- + 1 + + snippet-files + 2 + invalid snippet-files + 3 - + snippet-path + 4 - invalid error + */ + + @Test + public void test1(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + tb.createDirectories(src.resolve("directoryA"), src.resolve("directoryB")); + tb.writeFile(src.resolve("directoryA/mysnippet.txt"), "Hello, directoryA!"); + tb.writeFile(src.resolve("directoryB/mysnippet.txt"), "Hello, directoryB!"); + tb.writeFile(src.resolve("pkg/snippet-files/mysnippet.txt"), "Hello, snippet-files!"); + tb.writeJavaFiles(src, """ + package pkg; + + /** {@snippet file="mysnippet.txt"} */ + public class X { } + """); + String snippetPathValue = Stream.of("directoryA", "directoryB") + .map(src::resolve) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.joining(File.pathSeparator)); + javadoc("-d", base.resolve("out").toString(), + "--snippet-path", snippetPathValue, + "-sourcepath", src.toString(), + "pkg"); + checkExit(Exit.OK); + checkOutput("pkg/X.html", true, "Hello, snippet-files!"); + checkOutput("pkg/X.html", false, "Hello, directoryA!"); + checkOutput("pkg/X.html", false, "Hello, directoryB!"); + } + + @Test + public void test2(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + tb.createDirectories(src.resolve("directoryA"), src.resolve("directoryB")); + tb.writeFile(src.resolve("pkg/snippet-files/mysnippet.txt"), "Hello, snippet-files!"); + tb.writeJavaFiles(src, """ + package pkg; + + /** {@snippet file="mysnippet.txt"} */ + public class X { } + """); + String snippetPathValue = Stream.of("directoryA", "directoryB") + .map(src::resolve) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.joining(File.pathSeparator)); + javadoc("-d", base.resolve("out").toString(), + "--snippet-path", snippetPathValue, + "-sourcepath", src.toString(), + "pkg"); + checkExit(Exit.OK); + checkOutput("pkg/X.html", true, "Hello, snippet-files!"); + } + + @Test + public void test3(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + tb.createDirectories(src.resolve("directoryA"), src.resolve("directoryB")); + tb.writeFile(src.resolve("directoryA/mysnippet.txt"), "Hello, directoryA!"); + tb.writeFile(src.resolve("directoryB/mysnippet.txt"), "Hello, directoryB!"); + tb.writeJavaFiles(src, """ + package pkg; + + /** {@snippet file="mysnippet.txt"} */ + public class X { } + """); + String snippetPathValue = Stream.of("directoryA", "directoryB") + .map(src::resolve) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.joining(File.pathSeparator)); + javadoc("-d", base.resolve("out").toString(), + "--snippet-path", snippetPathValue, + "-sourcepath", src.toString(), + "pkg"); + checkExit(Exit.OK); + checkOutput("pkg/X.html", true, "Hello, directoryA!"); + checkOutput("pkg/X.html", false, "Hello, directoryB!"); + } + + @Test + public void test4(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + tb.writeJavaFiles(src, """ + package pkg; + + /** {@snippet file="mysnippet.txt"} */ + public class X { } + """); + String snippetPathValue = Stream.of("directoryA", "directoryB") + .map(src::resolve) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.joining(File.pathSeparator)); + javadoc("-d", base.resolve("out").toString(), + "--snippet-path", snippetPathValue, + "-sourcepath", src.toString(), + "pkg"); + checkExit(Exit.ERROR); + } + + /* + * Tests that the elements of the snippet path are iteratively searched + * until the file is found. In particular, tests that if the file is not + * immediately found, the search is not abandoned. + */ + @Test + public void testSearchPath(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + tb.createDirectories(src.resolve("directoryA"), src.resolve("directoryB")); + // do not put snippet in directoryA; only put snippet in directoryB + tb.writeFile(src.resolve("directoryB/mysnippet.txt"), "Hello, directoryB!"); + tb.writeJavaFiles(src, """ + package pkg; + + /** {@snippet file="mysnippet.txt"} */ + public class X { } + """); + // directoryA goes first, assuming that paths are searched in + // the same order they are specified in + String snippetPathValue = Stream.of("directoryA", "directoryB") + .map(src::resolve) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.joining(File.pathSeparator)); + javadoc("-d", base.resolve("out").toString(), + "--snippet-path", snippetPathValue, + "-sourcepath", src.toString(), + "pkg"); + checkExit(Exit.OK); + checkOutput("pkg/X.html", true, "Hello, directoryB!"); + } + + /* + * Tests translation from FQN (the "class" attribute) to file path + * (the "file" attribute). + */ + @Test + public void testClassToFile(Path base) throws Exception { + Path src = Files.createDirectories(base.resolve("src")); + Path directoryA = Files.createDirectories(src.resolve("directoryA")); + tb.writeJavaFiles(directoryA, """ + package com.example.snippet; + + public interface Y { } + """); + tb.writeJavaFiles(src, """ + package pkg; + + /** {@snippet class="com.example.snippet.Y"} */ + public class X { } + """); + String snippetPathValue = Stream.of("directoryA") + .map(src::resolve) + .map(Path::toAbsolutePath) + .map(Path::toString) + .collect(Collectors.joining(File.pathSeparator)); + javadoc("-d", base.resolve("out").toString(), + "--snippet-path", snippetPathValue, + "-sourcepath", src.toString(), + "pkg"); + checkExit(Exit.OK); + checkOutput("pkg/X.html", true, "public interface Y { }"); + } +} diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index a13f75ddae6..269869ba4b5 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -33,27 +33,21 @@ * @run main TestSnippetTag */ -import builder.ClassBuilder; -import builder.ClassBuilder.MethodBuilder; -import javadoc.tester.JavadocTester; -import toolbox.ModuleBuilder; -import toolbox.ToolBox; - import java.io.IOException; -import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; -import java.util.function.ObjIntConsumer; -import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.stream.Stream; + +import builder.ClassBuilder; +import builder.ClassBuilder.MethodBuilder; +import toolbox.ModuleBuilder; // FIXME // 0. Add tests for snippets in all types of elements: e.g., fields @@ -63,7 +57,22 @@ import java.util.stream.Stream; // 3. Add tests for hybrid snippets /* - * General notes. + * General notes + * ============= + * + * To simplify maintenance of this test suite, a test name uses a convention. + * By convention, a test name is a concatenation of the following parts: + * + * 1. "test" + * 2. ("Positive", "Negative") + * 3. ("Inline", "External", "Hybrid") + * 4. ("Tag", "Markup") + * 5. + * + * A test can be either positive or negative; it cannot be both or neither. + * A test can exercise inline, external or hybrid variant or any combination + * thereof, including none at all. A test can exercise tag syntax, markup syntax + * or both. * * 1. Some of the below tests could benefit from using a combinatorics library * as they are otherwise very wordy. @@ -73,35 +82,27 @@ import java.util.stream.Stream; * if x is passed to that method additionally N times: JavadocTester.checkOutput(x, x, ..., x). * This is because a single occurrence of x in the output will be matched N times. */ -public class TestSnippetTag extends JavadocTester { - - private final ToolBox tb = new ToolBox(); - - private TestSnippetTag() { } +public class TestSnippetTag extends SnippetTester { public static void main(String... args) throws Exception { new TestSnippetTag().runTests(m -> new Object[]{Paths.get(m.getName())}); } /* - * Make sure the "id" and "lang" attributes defined in JEP 413 are rendered - * properly as recommended by the HTML5 specification. + * Make sure the "id" and "lang" attributes defined in JEP 413 are translated + * to HTML. In particular, verify that the "lang" attribute is translated + * to a value added to the "class" attribute as recommended by the HTML5 specification: + * https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-code-element */ @Test - public void testIdAndLangAttributes(Path base) throws IOException { + public void testPositiveInlineTag_IdAndLangAttributes(Path base) throws IOException { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); // A record of a snippet content and matching expected attribute values - record SnippetAttributes(String content, String id, String lang) { - public String idAttribute() { - return id == null ? "" : " id=\"" + id + "\""; - } - public String langAttribute() { - return lang == null ? "" : " class=\"language-" + lang + "\""; - } - } + record SnippetAttributes(String content, String id, String lang) { } + // TODO: use combinatorial methods, e.g. just like in TestSnippetMarkup final var snippets = List.of( new SnippetAttributes(""" {@snippet id="foo1" : @@ -218,29 +219,29 @@ public class TestSnippetTag extends JavadocTester { checkExit(Exit.OK); checkLinks(); for (int j = 0; j < snippets.size(); j++) { - SnippetAttributes snippet = snippets.get(j); + var attr = snippets.get(j); + var snippetHtml = getSnippetHtmlRepresentation("pkg/A.html", " Hello, Snippet!\n", + Optional.ofNullable(attr.lang()), Optional.ofNullable(attr.id())); checkOutput("pkg/A.html", true, """ case%s()
      A method. \s -
      -
          Hello, Snippet!
      -                        
      -
      - """.formatted(j, snippet.idAttribute(), snippet.langAttribute())); + %s + """.formatted(j, snippetHtml)); } } /* - * Make sure the lang attribute is derived correctly from the snippet source file - * for external snippets when it is not defined in the snippet. Defining the lang - * attribute in the snippet should always override this mechanism. + * If the "lang" attribute is absent in the snippet tag for an external snippet, + * then the "class" attribute is derived from the snippet source file extension. + * + * If the "class" attribute can be derived both from the "lang" attribute and + * the file extension, then it is derived from the "lang" attribute. */ + // TODO: restructure this as a list of TestCase records @Test - public void testExternalImplicitAttributes(Path base) throws IOException { + public void testPositiveInlineExternalTagMarkup_ImplicitAttributes(Path base) throws IOException { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); @@ -276,60 +277,28 @@ public class TestSnippetTag extends JavadocTester { "com.example"); checkExit(Exit.OK); checkLinks(); - checkOutput("com/example/Cls.html", true, - """ -
      
      -                    System.out.println(msg);
      -                    
      """, - """ -
      
      -                    System.out.println(msg);
      -                    
      """, - """ -
      
      -                    System.out.println(msg);
      -                    
      """, - """ -
      
      -                    System.out.println(msg);
      -                    
      """, - """ -
      
      -                    System.out.println(msg);
      -                    
      """, - """ -
      
      -                    System.out.println(msg);
      -                    
      """, - """ -
      user=jane
      -                    home=/home/jane
      -                    
      """, - """ -
      user=jane
      -                    home=/home/jane
      -                    
      """, - """ -
      user=jane
      -                    home=/home/jane
      -                    
      """); - } + final var javaContent = """ - /* - * This is a convenience method to iterate through a list. - * Unlike List.forEach, this method provides the consumer not only with an - * element but also that element's index. - * - * See JDK-8184707. - */ - private static void forEachNumbered(List list, ObjIntConsumer action) { - for (var iterator = list.listIterator(); iterator.hasNext(); ) { - action.accept(iterator.next(), iterator.previousIndex()); - } + System.out.println(msg); + """; + final var propertiesContent = """ + user=jane + home=/home/jane + """; + checkOutput("com/example/Cls.html", true, + getSnippetHtmlRepresentation("com/example/Cls.html", javaContent, Optional.of("java"), Optional.of("snippet1")), + getSnippetHtmlRepresentation("com/example/Cls.html", javaContent, Optional.of("java"), Optional.of("snippet2")), + getSnippetHtmlRepresentation("com/example/Cls.html", javaContent, Optional.of("none"), Optional.of("snippet3")), + getSnippetHtmlRepresentation("com/example/Cls.html", javaContent, Optional.of("none"), Optional.of("snippet4")), + getSnippetHtmlRepresentation("com/example/Cls.html", javaContent, Optional.empty(), Optional.of("snippet5")), + getSnippetHtmlRepresentation("com/example/Cls.html", javaContent, Optional.empty(), Optional.of("snippet6")), + getSnippetHtmlRepresentation("com/example/user.properties", propertiesContent, Optional.of("properties"), Optional.of("snippet7")), + getSnippetHtmlRepresentation("com/example/user.properties", propertiesContent, Optional.of("none"), Optional.of("snippet8")), + getSnippetHtmlRepresentation("com/example/user.properties", propertiesContent, Optional.empty(), Optional.of("snippet9"))); } @Test - public void testBadTagSyntax(Path base) throws IOException { + public void testNegativeInlineTag_BadTagSyntax(Path base) throws IOException { // TODO consider improving diagnostic output by providing more specific // error messages and better positioning the caret (depends on JDK-8273244) @@ -666,50 +635,13 @@ public class TestSnippetTag extends JavadocTester { )); } - // TODO This is a temporary method; it should be removed after JavadocTester has provided similar functionality (JDK-8273154). - private void checkOrder(Output output, String... strings) { - String outputString = getOutput(output); - int prevIndex = -1; - for (String s : strings) { - s = s.replace("\n", NL); // normalize new lines - int currentIndex = outputString.indexOf(s, prevIndex + 1); - checking("output: " + output + ": " + s + " at index " + currentIndex); - if (currentIndex == -1) { - failed(output + ": " + s + " not found."); - continue; - } - if (currentIndex > prevIndex) { - passed(output + ": " + " is in the correct order"); - } else { - failed(output + ": " + " is in the wrong order."); - } - prevIndex = currentIndex; - } - } - - /* - * When checking for errors, it is important not to confuse one error with - * another. This method checks that there are no crashes (which are also - * errors) by checking for stack traces. We never expect crashes. - */ - private void checkNoCrashes() { - checking("check crashes"); - Matcher matcher = Pattern.compile("\s*at.*\\(.*\\.java:\\d+\\)") - .matcher(getOutput(Output.STDERR)); - if (!matcher.find()) { - passed(""); - } else { - failed("Looks like a stacktrace: " + matcher.group()); - } - } - /* * A colon that is not separated from a tag name by whitespace is considered * a part of that name. This behavior is historical. For more context see, * for example, JDK-4750173. */ @Test - public void testUnknownTag(Path base) throws IOException { + public void testNegativeInlineTagUnknownTag(Path base) throws IOException { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); final var unknownTags = List.of( @@ -746,7 +678,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testInline(Path base) throws Exception { + public void testPositiveInlineTag(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); @@ -948,16 +880,12 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      -
      %s
      -
      """.formatted(id, t.expectedOutput())); + %s""".formatted(id, getSnippetHtmlRepresentation("pkg/A.html", t.expectedOutput()))); }); } @Test - public void testExternalFile(Path base) throws Exception { + public void testPositiveExternalTag_File(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); @@ -1044,30 +972,12 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      -
      %s
      -
      """.formatted(index, expectedOutput)); + %s""".formatted(index, getSnippetHtmlRepresentation("pkg/A.html", expectedOutput))); }); } - // TODO: - // Explore the toolbox.ToolBox.writeFile and toolbox.ToolBox.writeJavaFiles methods: - // see if any of them could be used instead of this one - private void addSnippetFile(Path srcDir, String packageName, String fileName, String content) throws UncheckedIOException { - String[] components = packageName.split("\\."); - Path snippetFiles = Path.of(components[0], Arrays.copyOfRange(components, 1, components.length)).resolve("snippet-files"); - try { - Path p = Files.createDirectories(srcDir.resolve(snippetFiles)); - Files.writeString(p.resolve(fileName), content, StandardOpenOption.CREATE_NEW); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - @Test - public void testInlineSnippetInDocFiles(Path base) throws IOException { + public void testPositiveInlineTag_InDocFiles(Path base) throws IOException { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); // If there is no *.java files, javadoc will not create an output @@ -1109,7 +1019,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testExternalSnippetInDocFiles(Path base) throws IOException { + public void testPositiveExternalTag_InDocFiles(Path base) throws IOException { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); // If there is no *.java files, javadoc will not create an output @@ -1151,7 +1061,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testExternalFileNotFound(Path base) throws Exception { + public void testNegativeExternalTag_FileNotFound(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -1174,8 +1084,8 @@ public class TestSnippetTag extends JavadocTester { checkNoCrashes(); } - @Test // TODO perhaps this could be unified with testExternalFile - public void testExternalFileModuleSourcePath(Path base) throws Exception { + @Test // TODO perhaps this could be unified with testPositiveExternalTagFile + public void testNegativeExternalTag_FileModuleSourcePath(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "snippet.txt"; @@ -1200,8 +1110,8 @@ public class TestSnippetTag extends JavadocTester { checkExit(Exit.OK); } - @Test // TODO perhaps this could be unified with testExternalFileNotFound - public void testExternalFileNotFoundModuleSourcePath(Path base) throws Exception { + @Test // TODO perhaps this could be unified with testNegativeExternalTagFileNotFound + public void testNegativeExternalTag_FileNotFoundModuleSourcePath(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -1230,7 +1140,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testNoContents(Path base) throws Exception { + public void testNegativeTag_NoContents(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1250,7 +1160,37 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testConflict20(Path base) throws Exception { + public void testNegativeExternalTagMarkup(Path base) throws Exception { + // External snippet issues are handled similarly to those of internal snippet + Path srcDir = base.resolve("src"); + Path outDir = base.resolve("out"); + addSnippetFile(srcDir, "pkg", "file.txt", """ + // @start + """ + ); + ClassBuilder classBuilder = new ClassBuilder(tb, "pkg.A") + .setModifiers("public", "class") + .addMembers( + MethodBuilder + .parse("public void case0() { }") + .setComments(""" + {@snippet file="file.txt"} + """)); + classBuilder.write(srcDir); + javadoc("-d", outDir.toString(), + "-sourcepath", srcDir.toString(), + "pkg"); + checkExit(Exit.ERROR); + checkOutput(Output.OUT, true, +""" +: error: snippet markup: missing attribute "region" +// @start + ^"""); + checkNoCrashes(); + } + + @Test + public void testNegativeInlineTag_AttributeConflict20(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1276,7 +1216,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testConflict30(Path base) throws Exception { + public void testNegativeInlineTag_AttributeConflict30(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1297,21 +1237,8 @@ public class TestSnippetTag extends JavadocTester { checkNoCrashes(); } - // TODO: perhaps this method could be added to JavadocTester - private void checkOutputEither(Output out, String first, String... other) { - checking("checkOutputEither"); - String output = getOutput(out); - Stream strings = Stream.concat(Stream.of(first), Stream.of(other)); - Optional any = strings.filter(output::contains).findAny(); - if (any.isPresent()) { - passed(": following text is found:\n" + any.get()); - } else { - failed(": nothing found"); - } - } - @Test - public void testConflict60(Path base) throws Exception { + public void testNegativeInlineTag_AttributeConflict60(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1331,7 +1258,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testConflict70(Path base) throws Exception { + public void testNegativeInlineTag_AttributeConflict70(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1351,7 +1278,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testConflict80(Path base) throws Exception { + public void testNegativeInlineTag_AttributeConflict80(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1375,7 +1302,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testConflict90(Path base) throws Exception { + public void testNegativeInlineTag_AttributeConflict90(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1399,7 +1326,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testErrorPositionResolution(Path base) throws Exception { + public void testNegativeTag_PositionResolution(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); new ClassBuilder(tb, "pkg.A") @@ -1427,7 +1354,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRegion(Path base) throws Exception { + public void testPositiveInlineTag_AttributeConflictRegion(Path base) throws Exception { record TestCase(Snippet snippet, String expectedOutput) { } final var testCases = List.of( new TestCase(newSnippetBuilder() @@ -1605,11 +1532,7 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      -
      %s
      -
      """.formatted(index, t.expectedOutput())); + %s""".formatted(index, getSnippetHtmlRepresentation("pkg/A.html", t.expectedOutput()))); }); } @@ -1647,7 +1570,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testAttributeValueSyntaxUnquotedCurly(Path base) throws Exception { + public void testNegativeInlineTagMarkup_AttributeValueSyntaxUnquotedCurly(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); /* @@ -1681,7 +1604,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testAttributeValueSyntaxCurly(Path base) throws Exception { + public void testPositiveInlineTagMarkup_SyntaxCurly(Path base) throws Exception { /* * The snippet has to be external, otherwise its content would * interfere with the test: that internal closing curly would @@ -1722,24 +1645,16 @@ public class TestSnippetTag extends JavadocTester { """ case0()
      -
      -
      -
      """); + """ + getSnippetHtmlRepresentation("pkg/A.html", "")); checkOutput("pkg/A.html", true, """ case1()
      -
      -
      -
      """); + """ + getSnippetHtmlRepresentation("pkg/A.html", "")); } - @Test - public void testAttributeValueSyntax(Path base) throws Exception { + @Test // TODO: use combinatorial methods + public void testPositiveExternalTagMarkup_AttributeValueSyntax(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); // Test most expected use cases for external snippet @@ -1832,17 +1747,13 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      -
      2
      -
      - """.formatted(j)); + %s + """.formatted(j, getSnippetHtmlRepresentation("pkg/A.html", "2"))); } } @Test - public void testComment(Path base) throws Exception { + public void testPositiveInlineTagMarkup_Comment(Path base) throws Exception { record TestCase(Snippet snippet, String expectedOutput) { } final var testCases = List.of( new TestCase(newSnippetBuilder() @@ -1916,16 +1827,12 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      -
      %s
      -
      """.formatted(index, t.expectedOutput())); + %s""".formatted(index, getSnippetHtmlRepresentation("pkg/A.html", t.expectedOutput()))); }); } @Test - public void testRedundantFileNotFound(Path base) throws Exception { + public void testNegativeHybridTag_FileNotFound(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -1950,7 +1857,110 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRedundantRegionNotFound(Path base) throws Exception { + public void testNegativeTag_ValuelessAttributes(Path base) throws IOException { + // none of these attributes should ever be valueless + record TestCase(String input, String expectedError) { } + var testCases = new ArrayList(); + for (String attrName : List.of("class", "file", "id", "lang", "region")) { + // special case: valueless region attribute + TestCase t = new TestCase(""" +{@snippet %s: + First line + Second line +} +""".formatted(attrName), +""" +: error: missing value for attribute "%s" +{@snippet %s: + ^""".formatted(attrName, attrName)); + testCases.add(t); + } + + List inputs = testCases.stream().map(s -> s.input).toList(); + StringBuilder methods = new StringBuilder(); + forEachNumbered(inputs, (i, n) -> { + methods.append( + """ + + /** + %s*/ + public void case%s() {} + """.formatted(i, n)); + }); + + String classString = + """ + public class A { + %s + } + """.formatted(methods.toString()); + + Path src = Files.createDirectories(base.resolve("src")); + tb.writeJavaFiles(src, classString); + + javadoc("-d", base.resolve("out").toString(), + "-sourcepath", src.toString(), + src.resolve("A.java").toString()); + checkExit(Exit.ERROR); + // use the facility from JDK-8273154 when it becomes available + checkOutput(Output.OUT, true, testCases.stream().map(TestCase::expectedError).toArray(String[]::new)); + checkNoCrashes(); + } + + @Test + public void testNegativeTag_BlankRegion(Path base) throws Exception { + // If a blank region were allowed, it could not be used without quotes + record TestCase(String input, String expectedError) { } + + var testCases = new ArrayList(); + for (String quote : List.of("", "'", "\"")) + for (String value : List.of("", " ")) { + var t = new TestCase(""" +{@snippet region=%s%s%s: + First line + Second line +} +""".formatted(quote, value, quote), + """ +: error: illegal value for attribute "region": "%s" +{@snippet region=%s%s%s: + ^""".formatted(quote.isEmpty() ? "" : value, quote, value, quote)); // unquoted whitespace translates to empty string + testCases.add(t); + } + + List inputs = testCases.stream().map(s -> s.input).toList(); + StringBuilder methods = new StringBuilder(); + forEachNumbered(inputs, (i, n) -> { + methods.append( + """ + + /** + %s*/ + public void case%s() {} + """.formatted(i, n)); + }); + + String classString = + """ + public class A { + %s + } + """.formatted(methods.toString()); + + Path src = Files.createDirectories(base.resolve("src")); + tb.writeJavaFiles(src, classString); + + javadoc("-d", base.resolve("out").toString(), + "-sourcepath", src.toString(), + src.resolve("A.java").toString()); + checkExit(Exit.ERROR); + // use the facility from JDK-8273154 when it becomes available + checkOutput(Output.OUT, true, testCases.stream().map(TestCase::expectedError).toArray(String[]::new)); + checkNoCrashes(); + } + + @Test + public void testNegativeHybridTagMarkup_RegionNotFound(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -1981,7 +1991,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRedundantMismatch(Path base) throws Exception { + public void testNegativeHybridTag_Mismatch(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -2010,7 +2020,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRedundantRegionRegionMismatch(Path base) throws Exception { + public void testNegativeHybridTagMarkup_RegionRegionMismatch(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -2050,7 +2060,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRedundantRegion1Mismatch(Path base) throws Exception { + public void testNegativeHybridTagMarkup_Region1Mismatch(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -2084,7 +2094,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRedundantRegion2Mismatch(Path base) throws Exception { + public void testNegativeHybridTagMarkup_Region2Mismatch(Path base) throws Exception { Path srcDir = base.resolve("src"); Path outDir = base.resolve("out"); var fileName = "text.txt"; @@ -2121,7 +2131,7 @@ public class TestSnippetTag extends JavadocTester { } @Test - public void testRedundant(Path base) throws Exception { + public void testPositiveHybridTagMarkup(Path base) throws Exception { record TestCase(Snippet snippet, String expectedOutput) { } final var testCases = List.of( new TestCase(newSnippetBuilder() @@ -2248,16 +2258,12 @@ public class TestSnippetTag extends JavadocTester { """ case%s()
      -
      -
      %s
      -
      """.formatted(index, t.expectedOutput())); + %s""".formatted(index, getSnippetHtmlRepresentation("pkg/A.html", t.expectedOutput()))); }); } @Test - public void testInvalidRegexDiagnostics(Path base) throws Exception { + public void testNegativeInlineTagMarkup_InvalidRegexDiagnostics(Path base) throws Exception { record TestCase(String input, String expectedError) { } @@ -2341,7 +2347,7 @@ hello there // @highlight type="italics" regex =" [" } @Test - public void testErrorMessages(Path base) throws Exception { + public void testNegativeInlineTagMarkup_ErrorMessages(Path base) throws Exception { record TestCase(String input, String expectedError) { } -- GitLab From c79a485f1c3f9c0c3a79b8847fdcd50a141cd529 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 19 Nov 2021 22:37:28 +0000 Subject: [PATCH 416/890] 8277494: [BACKOUT] JDK-8276150 Quarantined jpackage apps are labeled as "damaged" Reviewed-by: asemenyuk, tschatzl --- .../jpackage/internal/MacAppImageBuilder.java | 81 ++++++------------- .../jpackage/macosx/SigningAppImageTest.java | 32 ++------ 2 files changed, 33 insertions(+), 80 deletions(-) diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java index c89612a260c..f1eed5f5f15 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java @@ -329,8 +329,7 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { } copyRuntimeFiles(params); - - doSigning(params); + sign(params); } private void copyRuntimeFiles(Map params) @@ -356,12 +355,7 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { } } - private void doSigning(Map params) - throws IOException { - - // signing or not, unsign first ... - unsignAppBundle(params, root); - + private void sign(Map params) throws IOException { if (Optional.ofNullable( SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) { try { @@ -653,52 +647,7 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { IOUtils.exec(pb); } - private static void unsignAppBundle(Map params, - Path appLocation) throws IOException { - - // unsign all dylibs and executables - try (Stream stream = Files.walk(appLocation)) { - stream.peek(path -> { // fix permissions - try { - Set pfp = - Files.getPosixFilePermissions(path); - if (!pfp.contains(PosixFilePermission.OWNER_WRITE)) { - pfp = EnumSet.copyOf(pfp); - pfp.add(PosixFilePermission.OWNER_WRITE); - Files.setPosixFilePermissions(path, pfp); - } - } catch (IOException e) { - Log.verbose(e); - } - }).filter(p -> Files.isRegularFile(p) && - (Files.isExecutable(p) || p.toString().endsWith(".dylib")) - && !(p.toString().contains("dylib.dSYM/Contents")) - ).forEach(p -> { - // If p is a symlink then skip. - if (Files.isSymbolicLink(p)) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.ignoring.symlink"), p.toString())); - } else { - List args = new ArrayList<>(); - args.addAll(Arrays.asList("/usr/bin/codesign", - "--remove-signature", p.toString())); - try { - Set oldPermissions = - Files.getPosixFilePermissions(p); - p.toFile().setWritable(true, true); - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb); - Files.setPosixFilePermissions(p,oldPermissions); - } catch (IOException ioe) { - Log.verbose(ioe); - return; - } - } - }); - } - } - - private static void signAppBundle( + static void signAppBundle( Map params, Path appLocation, String signingIdentity, String identifierPrefix, Path entitlements) throws IOException { @@ -733,7 +682,29 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { Log.verbose(MessageFormat.format(I18N.getString( "message.ignoring.symlink"), p.toString())); } else { - List args = new ArrayList<>(); + List args; + // runtime and Framework files will be signed below + // but they need to be unsigned first here + if ((p.toString().contains("/Contents/runtime")) || + (p.toString().contains("/Contents/Frameworks"))) { + + args = new ArrayList<>(); + args.addAll(Arrays.asList("/usr/bin/codesign", + "--remove-signature", p.toString())); + try { + Set oldPermissions = + Files.getPosixFilePermissions(p); + p.toFile().setWritable(true, true); + ProcessBuilder pb = new ProcessBuilder(args); + IOUtils.exec(pb); + Files.setPosixFilePermissions(p,oldPermissions); + } catch (IOException ioe) { + Log.verbose(ioe); + toThrow.set(ioe); + return; + } + } + args = new ArrayList<>(); args.addAll(Arrays.asList("/usr/bin/codesign", "--timestamp", "--options", "runtime", diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java index a94b449dcba..cd30b24f350 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java @@ -22,11 +22,8 @@ */ import java.nio.file.Path; -import java.util.List; - import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.Annotations.Test; -import jdk.jpackage.test.Annotations.Parameters; /** * Tests generation of app image with --mac-sign and related arguments. Test will @@ -60,36 +57,21 @@ import jdk.jpackage.test.Annotations.Parameters; */ public class SigningAppImageTest { - final boolean doSign; - - public SigningAppImageTest(String flag) { - this.doSign = "true".equals(flag); - } - - @Parameters - public static List data() { - return List.of(new Object[][] {{"true"}, {"false"}}); - } - @Test - public void test() throws Exception { + public static void test() throws Exception { SigningCheck.checkCertificates(); JPackageCommand cmd = JPackageCommand.helloAppImage(); - if (doSign) { - cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", - SigningBase.DEV_NAME, "--mac-signing-keychain", - SigningBase.KEYCHAIN); - } + cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", + SigningBase.DEV_NAME, "--mac-signing-keychain", + SigningBase.KEYCHAIN); cmd.executeAndAssertHelloAppImageCreated(); Path launcherPath = cmd.appLauncherPath(); - SigningBase.verifyCodesign(launcherPath, doSign); + SigningBase.verifyCodesign(launcherPath, true); Path appImage = cmd.outputBundle(); - SigningBase.verifyCodesign(appImage, doSign); - if (doSign) { - SigningBase.verifySpctl(appImage, "exec"); - } + SigningBase.verifyCodesign(appImage, true); + SigningBase.verifySpctl(appImage, "exec"); } } -- GitLab From 1d7cef33c5ff24695463a03c58c7ca350ec190fc Mon Sep 17 00:00:00 2001 From: Derek White Date: Sat, 20 Nov 2021 00:48:32 +0000 Subject: [PATCH 417/890] 8276662: Scalability bottleneck in SymbolTable::lookup_common() Reviewed-by: redestad, dholmes, iklam, shade --- src/hotspot/share/classfile/symbolTable.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hotspot/share/classfile/symbolTable.cpp b/src/hotspot/share/classfile/symbolTable.cpp index fa966fc7b22..a321d94bbd2 100644 --- a/src/hotspot/share/classfile/symbolTable.cpp +++ b/src/hotspot/share/classfile/symbolTable.cpp @@ -91,7 +91,14 @@ static volatile bool _has_items_to_clean = false; static volatile bool _alt_hash = false; + +#ifdef USE_LIBRARY_BASED_TLS_ONLY static volatile bool _lookup_shared_first = false; +#else +// "_lookup_shared_first" can get highly contended with many cores if multiple threads +// are updating "lookup success history" in a global shared variable. If built-in TLS is available, use it. +static THREAD_LOCAL bool _lookup_shared_first = false; +#endif // Static arena for symbols that are not deallocated Arena* SymbolTable::_arena = NULL; -- GitLab From 1c215f33698ba2aef4fb230475a9bd33ed3005f9 Mon Sep 17 00:00:00 2001 From: Vishal Chand Date: Sat, 20 Nov 2021 10:03:45 +0000 Subject: [PATCH 418/890] 8272773: Configurable card table card size Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1Arguments.cpp | 3 ++ src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 +- .../share/gc/parallel/objectStartArray.cpp | 12 ++++++- .../share/gc/parallel/objectStartArray.hpp | 16 ++++++--- .../share/gc/parallel/parallelArguments.cpp | 2 ++ .../share/gc/shared/blockOffsetTable.cpp | 12 +++++++ .../share/gc/shared/blockOffsetTable.hpp | 14 +++++--- src/hotspot/share/gc/shared/cardTable.cpp | 33 +++++++++++++++++-- src/hotspot/share/gc/shared/cardTable.hpp | 13 ++++---- src/hotspot/share/gc/shared/gc_globals.hpp | 10 ++++-- src/hotspot/share/gc/shared/genArguments.cpp | 3 ++ .../share/gc/shared/jvmFlagConstraintsGC.cpp | 12 +++++++ .../share/gc/shared/jvmFlagConstraintsGC.hpp | 3 +- 13 files changed, 111 insertions(+), 24 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp index aa1755bc3c6..6750e61a312 100644 --- a/src/hotspot/share/gc/g1/g1Arguments.cpp +++ b/src/hotspot/share/gc/g1/g1Arguments.cpp @@ -45,6 +45,9 @@ static size_t calculate_heap_alignment(size_t space_alignment) { } void G1Arguments::initialize_alignments() { + // Initialize card size before initializing alignments + CardTable::initialize_card_size(); + // Set up the region size and associated fields. // // There is a circular dependency here. We base the region size on the heap diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index d27ac1243ef..62bae602b0a 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1660,7 +1660,7 @@ jint G1CollectedHeap::initialize() { // The G1FromCardCache reserves card with value 0 as "invalid", so the heap must not // start within the first card. - guarantee(heap_rs.base() >= (char*)G1CardTable::card_size, "Java heap must not start within the first card."); + guarantee((uintptr_t)(heap_rs.base()) >= G1CardTable::card_size, "Java heap must not start within the first card."); G1FromCardCache::initialize(max_reserved_regions()); // Also create a G1 rem set. _rem_set = new G1RemSet(this, _card_table, _hot_card_cache); diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp index d2d98bc24a9..e75a1efa734 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.cpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp @@ -31,11 +31,21 @@ #include "services/memTracker.hpp" #include "utilities/align.hpp" +uint ObjectStartArray::block_shift = 0; +uint ObjectStartArray::block_size = 0; +uint ObjectStartArray::block_size_in_words = 0; + +void ObjectStartArray::initialize_block_size(uint card_shift) { + block_shift = card_shift; + block_size = 1 << block_shift; + block_size_in_words = block_size / sizeof(HeapWord); +} + void ObjectStartArray::initialize(MemRegion reserved_region) { // We're based on the assumption that we use the same // size blocks as the card table. assert((int)block_size == (int)CardTable::card_size, "Sanity"); - assert((int)block_size <= 512, "block_size must be less than or equal to 512"); + assert(block_size <= MaxBlockSize, "block_size must be less than or equal to " UINT32_FORMAT, MaxBlockSize); // Calculate how much space must be reserved _reserved_region = reserved_region; diff --git a/src/hotspot/share/gc/parallel/objectStartArray.hpp b/src/hotspot/share/gc/parallel/objectStartArray.hpp index 45b4a53b16c..02c91d20ded 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.hpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.hpp @@ -52,11 +52,17 @@ class ObjectStartArray : public CHeapObj { clean_block = -1 }; - enum BlockSizeConstants { - block_shift = 9, - block_size = 1 << block_shift, - block_size_in_words = block_size / sizeof(HeapWord) - }; + static uint block_shift; + static uint block_size; + static uint block_size_in_words; + + // Maximum size an offset table entry can cover. This maximum is derived from that + // we need an extra bit for possible offsets in the byte for backskip values, leaving 2^7 possible offsets. + // Minimum object alignment is 8 bytes (2^3), so we can at most represent 2^10 offsets within a BOT value. + static const uint MaxBlockSize = 1024; + + // Initialize block size based on card size + static void initialize_block_size(uint card_shift); protected: diff --git a/src/hotspot/share/gc/parallel/parallelArguments.cpp b/src/hotspot/share/gc/parallel/parallelArguments.cpp index 2ffffdf1455..468dc7bdfaf 100644 --- a/src/hotspot/share/gc/parallel/parallelArguments.cpp +++ b/src/hotspot/share/gc/parallel/parallelArguments.cpp @@ -97,6 +97,8 @@ static size_t default_gen_alignment() { } void ParallelArguments::initialize_alignments() { + // Initialize card size before initializing alignments + CardTable::initialize_card_size(); SpaceAlignment = GenAlignment = default_gen_alignment(); HeapAlignment = compute_heap_alignment(); } diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.cpp b/src/hotspot/share/gc/shared/blockOffsetTable.cpp index fb569a6b0a2..b7d58649208 100644 --- a/src/hotspot/share/gc/shared/blockOffsetTable.cpp +++ b/src/hotspot/share/gc/shared/blockOffsetTable.cpp @@ -33,6 +33,18 @@ #include "runtime/java.hpp" #include "services/memTracker.hpp" +uint BOTConstants::LogN = 0; +uint BOTConstants::LogN_words = 0; +uint BOTConstants::N_bytes = 0; +uint BOTConstants::N_words = 0; + +void BOTConstants::initialize_bot_size(uint card_shift) { + LogN = card_shift; + LogN_words = LogN - LogHeapWordSize; + N_bytes = 1 << LogN; + N_words = 1 << LogN_words; +} + ////////////////////////////////////////////////////////////////////// // BlockOffsetSharedArray ////////////////////////////////////////////////////////////////////// diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.hpp b/src/hotspot/share/gc/shared/blockOffsetTable.hpp index 5e60bfe63a4..ff656823a6c 100644 --- a/src/hotspot/share/gc/shared/blockOffsetTable.hpp +++ b/src/hotspot/share/gc/shared/blockOffsetTable.hpp @@ -27,6 +27,7 @@ #include "gc/shared/gc_globals.hpp" #include "gc/shared/memset_with_concurrent_readers.hpp" +#include "gc/shared/cardTable.hpp" #include "memory/allocation.hpp" #include "memory/memRegion.hpp" #include "memory/virtualspace.hpp" @@ -49,16 +50,20 @@ class ContiguousSpace; class BOTConstants : public AllStatic { public: - static const uint LogN = 9; - static const uint LogN_words = LogN - LogHeapWordSize; - static const uint N_bytes = 1 << LogN; - static const uint N_words = 1 << LogN_words; + static uint LogN; + static uint LogN_words; + static uint N_bytes; + static uint N_words; + // entries "e" of at least N_words mean "go back by Base^(e-N_words)." // All entries are less than "N_words + N_powers". static const uint LogBase = 4; static const uint Base = (1 << LogBase); static const uint N_powers = 14; + // Initialize bot size based on card size + static void initialize_bot_size(uint card_shift); + static size_t power_to_cards_back(uint i) { return (size_t)1 << (LogBase * i); } @@ -93,6 +98,7 @@ public: BlockOffsetTable(HeapWord* bottom, HeapWord* end): _bottom(bottom), _end(end) { assert(_bottom <= _end, "arguments out of order"); + assert(BOTConstants::N_bytes == CardTable::card_size, "sanity"); } // Note that the committed size of the covered space may have changed, diff --git a/src/hotspot/share/gc/shared/cardTable.cpp b/src/hotspot/share/gc/shared/cardTable.cpp index 2728e278286..10e4723934d 100644 --- a/src/hotspot/share/gc/shared/cardTable.cpp +++ b/src/hotspot/share/gc/shared/cardTable.cpp @@ -25,6 +25,8 @@ #include "precompiled.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/collectedHeap.hpp" +#include "gc/shared/gcLogPrecious.hpp" +#include "gc/shared/gc_globals.hpp" #include "gc/shared/space.inline.hpp" #include "logging/log.hpp" #include "memory/virtualspace.hpp" @@ -32,6 +34,32 @@ #include "runtime/os.hpp" #include "services/memTracker.hpp" #include "utilities/align.hpp" +#if INCLUDE_PARALLELGC +#include "gc/parallel/objectStartArray.hpp" +#endif + +uint CardTable::card_shift = 0; +uint CardTable::card_size = 0; +uint CardTable::card_size_in_words = 0; + +void CardTable::initialize_card_size() { + assert(UseG1GC || UseParallelGC || UseSerialGC, + "Initialize card size should only be called by card based collectors."); + + card_size = GCCardSizeInBytes; + card_shift = log2i_exact(card_size); + card_size_in_words = card_size / sizeof(HeapWord); + + // Set blockOffsetTable size based on card table entry size + BOTConstants::initialize_bot_size(card_shift); + +#if INCLUDE_PARALLELGC + // Set ObjectStartArray block size based on card table entry size + ObjectStartArray::initialize_block_size(card_shift); +#endif + + log_info_p(gc, init)("CardTable entry size: " UINT32_FORMAT, card_size); +} size_t CardTable::compute_byte_map_size() { assert(_guard_index == cards_required(_whole_heap.word_size()) - 1, @@ -56,8 +84,6 @@ CardTable::CardTable(MemRegion whole_heap) : { assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary"); assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary"); - - assert(card_size <= 512, "card_size must be less than 512"); // why? } CardTable::~CardTable() { @@ -428,7 +454,8 @@ MemRegion CardTable::dirty_card_range_after_reset(MemRegion mr, } uintx CardTable::ct_max_alignment_constraint() { - return card_size * os::vm_page_size(); + // Calculate maximum alignment using GCCardSizeInBytes as card_size hasn't been set yet + return GCCardSizeInBytes * os::vm_page_size(); } void CardTable::verify_guard() { diff --git a/src/hotspot/share/gc/shared/cardTable.hpp b/src/hotspot/share/gc/shared/cardTable.hpp index 94f52651125..bf116a1f1e7 100644 --- a/src/hotspot/share/gc/shared/cardTable.hpp +++ b/src/hotspot/share/gc/shared/cardTable.hpp @@ -228,17 +228,18 @@ public: MemRegion dirty_card_range_after_reset(MemRegion mr, bool reset, int reset_val); - // Constants - enum SomePublicConstants { - card_shift = 9, - card_size = 1 << card_shift, - card_size_in_words = card_size / sizeof(HeapWord) - }; + // CardTable entry size + static uint card_shift; + static uint card_size; + static uint card_size_in_words; static constexpr CardValue clean_card_val() { return clean_card; } static constexpr CardValue dirty_card_val() { return dirty_card; } static intptr_t clean_card_row_val() { return clean_card_row; } + // Initialize card size + static void initialize_card_size(); + // Card marking array base (adjusted for heap low boundary) // This would be the 0th element of _byte_map, if the heap started at 0x0. // But since the heap starts at some higher address, this points to somewhere diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp index 730e5f616bb..b57be5abf62 100644 --- a/src/hotspot/share/gc/shared/gc_globals.hpp +++ b/src/hotspot/share/gc/shared/gc_globals.hpp @@ -692,9 +692,13 @@ product(uintx, GCDrainStackTargetSize, 64, \ "Number of entries we will try to leave on the stack " \ "during parallel gc") \ - range(0, max_juint) - -// end of GC_FLAGS + range(0, max_juint) \ + \ + product(uint, GCCardSizeInBytes, 512, \ + "Card table entry size (in bytes) for card based collectors") \ + range(128, 1024) \ + constraint(GCCardSizeInBytesConstraintFunc,AtParse) + // end of GC_FLAGS DECLARE_FLAGS(GC_FLAGS) diff --git a/src/hotspot/share/gc/shared/genArguments.cpp b/src/hotspot/share/gc/shared/genArguments.cpp index 805f3535762..c53fb72c459 100644 --- a/src/hotspot/share/gc/shared/genArguments.cpp +++ b/src/hotspot/share/gc/shared/genArguments.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "gc/shared/cardTable.hpp" #include "gc/shared/genArguments.hpp" #include "gc/shared/generation.hpp" #include "logging/log.hpp" @@ -61,6 +62,8 @@ static size_t bound_minus_alignment(size_t desired_size, } void GenArguments::initialize_alignments() { + // Initialize card size before initializing alignments + CardTable::initialize_card_size(); SpaceAlignment = GenAlignment = (size_t)Generation::GenGrain; HeapAlignment = compute_heap_alignment(); } diff --git a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp index d7df7532980..82182fbcea8 100644 --- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp +++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp @@ -424,3 +424,15 @@ JVMFlag::Error MaxMetaspaceSizeConstraintFunc(size_t value, bool verbose) { } } +JVMFlag::Error GCCardSizeInBytesConstraintFunc(uint value, bool verbose) { + if (!is_power_of_2(value)) { + JVMFlag::printError(verbose, + "GCCardSizeInBytes ( %u ) must be " + "a power of 2\n", + value); + return JVMFlag::VIOLATES_CONSTRAINT; + } else { + return JVMFlag::SUCCESS; + } +} + diff --git a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp index 205c2391a64..da320944b0e 100644 --- a/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp +++ b/src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp @@ -66,7 +66,8 @@ f(uintx, TLABWasteIncrementConstraintFunc) \ f(uintx, SurvivorRatioConstraintFunc) \ f(size_t, MetaspaceSizeConstraintFunc) \ - f(size_t, MaxMetaspaceSizeConstraintFunc) + f(size_t, MaxMetaspaceSizeConstraintFunc) \ + f(uint, GCCardSizeInBytesConstraintFunc) SHARED_GC_CONSTRAINTS(DECLARE_CONSTRAINT) -- GitLab From 0a9e76c4f9d966015c19e87e3eb59ceb7489459f Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Sat, 20 Nov 2021 10:12:26 +0000 Subject: [PATCH 419/890] 8277485: Zero: Fix _fast_{i,f}access_0 bytecodes handling Reviewed-by: sgehwolf, shade --- src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index f1bfa3d190d..a70b0092cba 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -2805,7 +2805,7 @@ run: UPDATE_PC_AND_TOS_AND_CONTINUE(4, 1); } - CASE(_fast_faccess_0): { + CASE(_fast_iaccess_0): { u2 index = Bytes::get_native_u2(pc+2); ConstantPoolCacheEntry* cache = cp->entry_at(index); int field_offset = cache->f2_as_index(); @@ -2820,7 +2820,7 @@ run: UPDATE_PC_AND_TOS_AND_CONTINUE(4, 1); } - CASE(_fast_iaccess_0): { + CASE(_fast_faccess_0): { u2 index = Bytes::get_native_u2(pc+2); ConstantPoolCacheEntry* cache = cp->entry_at(index); int field_offset = cache->f2_as_index(); -- GitLab From 4ff43010bb3f92bd58f66be52a086b3d078b0cbb Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Sun, 21 Nov 2021 20:42:37 +0000 Subject: [PATCH 420/890] 8224922: Access JavaFileObject from Element(s) Co-authored-by: Jan Lahoda Reviewed-by: jjg --- .../javax/annotation/processing/Filer.java | 10 +- .../lang/model/element/ExecutableElement.java | 8 +- .../lang/model/element/package-info.java | 29 +- .../javax/lang/model/util/Elements.java | 96 +++ .../com/sun/tools/javac/comp/Enter.java | 6 +- .../com/sun/tools/javac/comp/Modules.java | 2 +- .../sun/tools/javac/model/JavacElements.java | 24 + .../model/element/TestFileObjectOf.java | 596 ++++++++++++++++++ .../javac/tree/NoPrivateTypesExported.java | 3 +- 9 files changed, 752 insertions(+), 22 deletions(-) create mode 100644 test/langtools/tools/javac/processing/model/element/TestFileObjectOf.java diff --git a/src/java.compiler/share/classes/javax/annotation/processing/Filer.java b/src/java.compiler/share/classes/javax/annotation/processing/Filer.java index 257b0085e6d..80c01228ed6 100644 --- a/src/java.compiler/share/classes/javax/annotation/processing/Filer.java +++ b/src/java.compiler/share/classes/javax/annotation/processing/Filer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -69,7 +69,13 @@ import java.io.IOException; * originating elements are the classes or interfaces or packages * (representing {@code package-info} files) or modules (representing * {@code module-info} files) which caused an annotation processor to - * attempt to create a new file. For example, if an annotation + * attempt to create a new file. + * In other words, the originating elements are intended to have the + * granularity of compilation units (JLS section {@jls 7.3}), + * essentially file-level granularity, rather than finer-scale + * granularity of, say, a method or field declaration. + * + *

      For example, if an annotation * processor tries to create a source file, {@code * GeneratedFromUserSource}, in response to processing * diff --git a/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java b/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java index 9f8e3997781..882917b21b5 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -131,6 +131,12 @@ public interface ExecutableElement extends Element, Parameterizable { */ AnnotationValue getDefaultValue(); + /** + * {@return the class or interface defining the executable} + */ + @Override + Element getEnclosingElement(); + /** * {@return the simple name of a constructor, method, or * initializer} For a constructor, the name {@code ""} is diff --git a/src/java.compiler/share/classes/javax/lang/model/element/package-info.java b/src/java.compiler/share/classes/javax/lang/model/element/package-info.java index 094dd1825bd..38900425be9 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/package-info.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -36,19 +36,20 @@ * appearing inside method bodies, such as local variables and * anonymous classes. * - *

      When used in the context of annotation processing, an accurate - * model of the element being represented must be returned. As this - * is a language model, the source code provides the fiducial - * (reference) representation of the construct in question rather than - * a representation in an executable output like a class file. - * Executable output may serve as the basis for creating a modeling - * element. However, the process of translating source code to - * executable output may not permit recovering some aspects of the - * source code representation. For example, annotations with - * {@linkplain java.lang.annotation.RetentionPolicy#SOURCE source} - * {@linkplain java.lang.annotation.Retention retention} cannot be - * recovered from class files and class files might not be able to - * provide source position information. + *

      When used in the context of annotation + * processing, an accurate model of the element being represented must + * be returned. As this is a language model, the source code provides + * the fiducial (reference) representation of the construct in + * question rather than a representation in an executable output like + * a class file. Executable output may serve as the basis for + * creating a modeling element. However, the process of translating + * source code to executable output may not permit recovering some + * aspects of the source code representation. For example, + * annotations with {@linkplain + * java.lang.annotation.RetentionPolicy#SOURCE source} {@linkplain + * java.lang.annotation.Retention retention} cannot be recovered from + * class files and class files might not be able to provide source + * position information. * * Names of {@linkplain * javax.lang.model.element.ExecutableElement#getParameters() diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java index f8071dd9844..5f81e6620d7 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java @@ -761,4 +761,100 @@ public interface Elements { } return null; } + + /** + * {@return the file object for this element or {@code null} if + * there is no such file object} + * + *

      The returned file object is for the reference + * representation of the information used to construct the + * element. For example, if during compilation or annotation + * processing, a source file for class {@code Foo} is compiled + * into a class file, the file object returned for the element + * representing {@code Foo} would be for the source file and + * not for the class file. + * + *

      An implementation may choose to not support the + * functionality of this method, in which case {@link + * UnsupportedOperationException} is thrown. + * + *

      In the context of annotation processing, a non-{@code null} + * value is returned if the element was included as part of the + * initial inputs or the containing file was created during the + * run of the annotation processing tool. Otherwise, a {@code + * null} may be returned. In annotation processing, if a + * {@linkplain javax.annotation.processing.Filer#createClassFile + * class file is created}, that class file can serve as the + * reference representation for elements. + * + *

      If it has a file object, the file object for a package will + * be a {@code package-info} file. A package may exist and not + * have any {@code package-info} file even if the package is + * (implicitly) created during an annotation processing run from + * the creation of source or class files in that package. An + * {@linkplain PackageElement#isUnnamed unnamed package} will have + * a {@code null} file since it cannot be declared in a + * compilation unit. + * + *

      If it has a file object, the file object for a module will + * be a {@code module-info} file. An {@linkplain + * ModuleElement#isUnnamed unnamed module} will have a {@code + * null} file since it cannot be declared in a compilation unit. + * An {@linkplain #isAutomaticModule automatic module} will have a + * {@code null} file since it is implicitly declared. + * + *

      If it has a file object, the file object for a top-level + * {@code public} class or interface will be a source or class + * file corresponding to that class or interface. In this case, + * typically the leading portion of the name of the file will + * match the name of the class or interface. A single compilation + * unit can define multiple top-level classes and interfaces, such + * as a primary {@code public} class or interfaces whose name + * corresponds to the file name and one or more auxiliary + * classes or interfaces whose names do not correspond to the file + * name. If a source file is providing the reference + * representation of an auxiliary class or interface, the file for + * the primary class is returned. (An auxiliary class or interface + * can also be defined in a {@code package-info} source file, in + * which case the file for the {@code package-info} file is + * returned.) If a class file is providing the reference + * representation of an auxiliary class or interface, the separate + * class file for the auxiliary class is returned. + * + *

      For a nested class or interface, if it has a file object: + * + *

        + * + *
      • if a source file is providing the reference representation, + * the file object will be that of the {@linkplain + * #getOutermostTypeElement(Element) outermost enclosing} class or + * interface + * + *
      • if a class file is providing the reference representation, + * the file object will be that of the nested class or interface + * itself + * + *
      + * + *

      For other lexically enclosed elements, such as {@linkplain + * VariableElement#getEnclosingElement() variables}, {@linkplain + * ExecutableElement#getEnclosingElement() methods, and + * constructors}, if they have a file object, the file object will + * be the object associated with the {@linkplain + * Element#getEnclosingElement() enclosing element} of the + * lexically enclosed element. + * + * @implSpec The default implementation unconditionally throws + * {@link UnsupportedOperationException}. + * + * @throws UnsupportedOperationException if this functionality is + * not supported + * + * @param e the element to find a file object for + * @since 18 + */ + default javax.tools.JavaFileObject getFileObjectOf(Element e) { + throw new UnsupportedOperationException(); + } } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java index 0fd0ea7858e..5cf8c5d5387 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -376,7 +376,7 @@ public class Enter extends JCTree.Visitor { Name name = names.package_info; ClassSymbol c = syms.enterClass(tree.modle, name, tree.packge); c.flatname = names.fromString(tree.packge + "." + name); - c.sourcefile = tree.sourcefile; + c.classfile = c.sourcefile = tree.sourcefile; c.completer = Completer.NULL_COMPLETER; c.members_field = WriteableScope.create(c); tree.packge.package_info = c; @@ -495,7 +495,7 @@ public class Enter extends JCTree.Visitor { // Fill out class fields. c.completer = Completer.NULL_COMPLETER; // do not allow the initial completer linger on. c.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, c, tree); - c.sourcefile = env.toplevel.sourcefile; + c.classfile = c.sourcefile = env.toplevel.sourcefile; c.members_field = WriteableScope.create(c); c.clearAnnotationMetadata(); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java index e88f46c297e..6197e9fd22e 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java @@ -329,7 +329,7 @@ public class Modules extends JCTree.Visitor { } } sym.completer = getSourceCompleter(toplevel); - sym.module_info.sourcefile = toplevel.sourcefile; + sym.module_info.classfile = sym.module_info.sourcefile = toplevel.sourcefile; decl.sym = sym; if (multiModuleMode || modules.isEmpty()) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java index 34c834d750a..a1ae6c543a9 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java @@ -727,6 +727,30 @@ public class JavacElements implements Elements { return (msym.flags() & Flags.AUTOMATIC_MODULE) != 0; } + @Override @DefinedBy(Api.LANGUAGE_MODEL) + public JavaFileObject getFileObjectOf(Element e) { + Symbol sym = (Symbol) e; + return switch(sym.kind) { + case PCK -> { + PackageSymbol psym = (PackageSymbol) sym; + if (psym.package_info == null) { + yield null; + } + yield psym.package_info.classfile; + } + + case MDL -> { + ModuleSymbol msym = (ModuleSymbol) sym; + if (msym.module_info == null) { + yield null; + } + yield msym.module_info.classfile; + } + case TYP -> ((ClassSymbol) sym).classfile; + default -> sym.enclClass().classfile; + }; + } + /** * Returns the tree node and compilation unit corresponding to this * element, or null if they can't be found. diff --git a/test/langtools/tools/javac/processing/model/element/TestFileObjectOf.java b/test/langtools/tools/javac/processing/model/element/TestFileObjectOf.java new file mode 100644 index 00000000000..1957d00ea4a --- /dev/null +++ b/test/langtools/tools/javac/processing/model/element/TestFileObjectOf.java @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2021, 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 8224922 + * @summary Verify the behavior of the Elements.getFileObjectOf + * @library /tools/lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.jdeps/com.sun.tools.classfile + * @build toolbox.ToolBox toolbox.JavacTask toolbox.TestRunner + * @build TestFileObjectOf + * @run main TestFileObjectOf + */ + +import com.sun.source.tree.VariableTree; +import com.sun.source.util.TreePath; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayDeque; +import java.util.List; +import java.util.Queue; +import java.util.Set; + +import javax.annotation.processing.*; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.*; +import javax.lang.model.util.Elements; + +import com.sun.source.util.TreePathScanner; +import com.sun.source.util.Trees; +import javax.tools.JavaFileObject; +import toolbox.JarTask; +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.TestRunner; +import toolbox.ToolBox; + +public class TestFileObjectOf extends TestRunner { + + private final ToolBox tb; + + TestFileObjectOf() { + super(System.err); + tb = new ToolBox(); + } + + public static void main(String... args) throws Exception { + new TestFileObjectOf().runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + @Test + public void testSourceFiles(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + module m {} + """, + """ + package test; + """, + """ + package test; + public class TestClass { + int fieldTestClass; + TestClass() { } + void methodTestClass(int parameterTestClass) { + int localTestClass; + } + public static class InnerClass { + int fieldInnerClass; + InnerClass() {} + void methodInnerClass(int parameterInnerClass) { + int localInnerClass; + } + } + } + """, + """ + package test; + public enum TestEnum { + CONSTANT; + } + """, + """ + package test2; + public class TestClass2 {} + """); + Path classes = base.resolve("classes").resolve("m"); + tb.createDirectories(classes); + + //from source, implicit: + { + String moduleInfoSource = src.resolve("module-info.java").toUri().toString(); + String packageInfoSource = src.resolve("test").resolve("package-info.java").toUri().toString(); + String testClassSource = src.resolve("test").resolve("TestClass.java").toUri().toString(); + String testEnumSource = src.resolve("test").resolve("TestEnum.java").toUri().toString(); + String testClass2Source = src.resolve("test2").resolve("TestClass2.java").toUri().toString(); + + List log; + + log = new JavacTask(tb) + .options("-Xpkginfo:always", + "-processorpath", System.getProperty("test.classes"), + "-processor", PrintFiles.class.getName(), + "-sourcepath", src.toString()) + .outdir(classes) + .classes("java.lang.Object") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + "m: " + moduleInfoSource, + "test: " + packageInfoSource, + "test2: " + "", + "TestClass: " + testClassSource, + "TestEnum: " + testEnumSource, + "TestClass2: " + testClass2Source, + ": " + testClassSource, + "InnerClass: " + testClassSource, + "fieldTestClass: " + testClassSource, + "methodTestClass: " + testClassSource, + "parameterTestClass: " + testClassSource, + "localTestClass: " + testClassSource, + ": " + testEnumSource, + "CONSTANT: " + testEnumSource, + "valueOf: " + testEnumSource, + "values: " + testEnumSource, + ": " + testClass2Source, + ": " + testClassSource, + "fieldInnerClass: " + testClassSource, + "methodInnerClass: " + testClassSource, + "parameterInnerClass: " + testClassSource, + "localInnerClass: " + testClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + + tb.cleanDirectory(classes); + + //from source, explicit: + { + String moduleInfoSource = src.resolve("module-info.java").toUri().toString(); + String packageInfoSource = src.resolve("test").resolve("package-info.java").toUri().toString(); + String testClassSource = src.resolve("test").resolve("TestClass.java").toUri().toString(); + String testEnumSource = src.resolve("test").resolve("TestEnum.java").toUri().toString(); + String testClass2Source = src.resolve("test2").resolve("TestClass2.java").toUri().toString(); + + List log; + + log = new JavacTask(tb) + .options("-Xpkginfo:always", + "-processorpath", System.getProperty("test.classes"), + "-processor", PrintFiles.class.getName()) + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + "m: " + moduleInfoSource, + "test: " + packageInfoSource, + "test2: " + "", + "TestClass: " + testClassSource, + "TestEnum: " + testEnumSource, + "TestClass2: " + testClass2Source, + ": " + testClassSource, + "InnerClass: " + testClassSource, + "fieldTestClass: " + testClassSource, + "methodTestClass: " + testClassSource, + "parameterTestClass: " + testClassSource, + "localTestClass: " + testClassSource, + ": " + testEnumSource, + "CONSTANT: " + testEnumSource, + "valueOf: " + testEnumSource, + "values: " + testEnumSource, + ": " + testClass2Source, + ": " + testClassSource, + "fieldInnerClass: " + testClassSource, + "methodInnerClass: " + testClassSource, + "parameterInnerClass: " + testClassSource, + "localInnerClass: " + testClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + + //from class: + { + String moduleInfoSource = classes.resolve("module-info.class").toUri().toString(); + String packageInfoSource = classes.resolve("test").resolve("package-info.class").toUri().toString(); + String testClassSource = classes.resolve("test").resolve("TestClass.class").toUri().toString(); + String testInnerClassSource = classes.resolve("test").resolve("TestClass$InnerClass.class").toUri().toString(); + String testEnumSource = classes.resolve("test").resolve("TestEnum.class").toUri().toString(); + String testClass2Source = classes.resolve("test2").resolve("TestClass2.class").toUri().toString(); + + List log; + + log = new JavacTask(tb) + .options("-processorpath", System.getProperty("test.classes"), + "-processor", PrintFiles.class.getName(), + "--module-path", classes.toString(), + "--add-modules", "m") + .outdir(classes) + .classes("java.lang.Object") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + "m: " + moduleInfoSource, + "test: " + packageInfoSource, + "test2: " + "", + "TestClass: " + testClassSource, + "TestEnum: " + testEnumSource, + "TestClass2: " + testClass2Source, + ": " + testClassSource, + "InnerClass: " + testInnerClassSource, + "fieldTestClass: " + testClassSource, + "methodTestClass: " + testClassSource, + ": " + testEnumSource, + ": " + testEnumSource, + "CONSTANT: " + testEnumSource, + "valueOf: " + testEnumSource, + "values: " + testEnumSource, + ": " + testClass2Source, + ": " + testInnerClassSource, + "fieldInnerClass: " + testInnerClassSource, + "methodInnerClass: " + testInnerClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + } + + @SupportedAnnotationTypes("*") + @SupportedOptions("fromClass") + public static final class PrintFiles extends AbstractProcessor { + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) + return false; + + Elements elements = processingEnv.getElementUtils(); + Trees trees = Trees.instance(processingEnv); + Queue q = new ArrayDeque<>(); + q.add(elements.getModuleElement("m")); + + while (!q.isEmpty()) { + Element currentElement = q.remove(); + + handleDeclaration(currentElement); + + switch (currentElement.getKind()) { + case METHOD -> { + ExecutableElement method = (ExecutableElement) currentElement; + TreePath tp = trees.getPath(method); + if (tp != null) { + new TreePathScanner<>() { + @Override + public Object visitVariable(VariableTree node, Object p) { + Element el = trees.getElement(getCurrentPath()); + handleDeclaration(el); + return super.visitVariable(node, p); + } + }.scan(tp, null); + } + } + case MODULE -> { + q.add(elements.getPackageElement("test")); + q.add(elements.getPackageElement("test2")); + } + default -> + currentElement.getEnclosedElements() + .stream() + .sorted((e1, e2) -> e1.getSimpleName().toString().compareTo(e2.getSimpleName().toString())) + .forEach(q::add); + } + } + + return false; + } + + void handleDeclaration(Element el) { + Elements elements = processingEnv.getElementUtils(); + JavaFileObject fileObjects = elements.getFileObjectOf(el); + System.out.println(el.getSimpleName() + ": " + (fileObjects != null ? fileObjects.toUri().toString() : "")); + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + } + + @Test + public void testUnnamed(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + public class TestClass { + } + """); + Path classes = base.resolve("classes"); + tb.createDirectories(classes); + + //from source, implicit: + { + String testClassSource = src.resolve("TestClass.java").toUri().toString(); + + List log; + + log = new JavacTask(tb) + .options("-Xpkginfo:always", + "-classpath", "", + "-processorpath", System.getProperty("test.classes"), + "-processor", UnnamedPrintFiles.class.getName(), + "-sourcepath", src.toString()) + .outdir(classes) + .classes("java.lang.Object") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + ": " + "", + ": " + "", + "TestClass: " + testClassSource, + ": " + testClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + + tb.cleanDirectory(classes); + + //from source, explicit: + { + String testClassSource = src.resolve("TestClass.java").toUri().toString(); + + List log; + + log = new JavacTask(tb) + .options("-Xpkginfo:always", + "-classpath", "", + "-processorpath", System.getProperty("test.classes"), + "-processor", UnnamedPrintFiles.class.getName()) + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + ": " + "", + ": " + "", + "TestClass: " + testClassSource, + ": " + testClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + + //from class: + { + String testClassSource = classes.resolve("TestClass.class").toUri().toString(); + + List log; + + log = new JavacTask(tb) + .options("-processorpath", System.getProperty("test.classes"), + "-processor", UnnamedPrintFiles.class.getName(), + "-classpath", classes.toString()) + .outdir(classes) + .classes("java.lang.Object") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + ": " + "", + ": " + "", + "TestClass: " + testClassSource, + ": " + testClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + } + + @SupportedAnnotationTypes("*") + @SupportedOptions("fromClass") + public static final class UnnamedPrintFiles extends AbstractProcessor { + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) + return false; + + Elements elements = processingEnv.getElementUtils(); + Trees trees = Trees.instance(processingEnv); + Queue q = new ArrayDeque<>(); + q.add(elements.getModuleElement("")); + + while (!q.isEmpty()) { + Element currentElement = q.remove(); + + handleDeclaration(currentElement); + + switch (currentElement.getKind()) { + case METHOD -> { + ExecutableElement method = (ExecutableElement) currentElement; + TreePath tp = trees.getPath(method); + if (tp != null) { + new TreePathScanner<>() { + @Override + public Object visitVariable(VariableTree node, Object p) { + Element el = trees.getElement(getCurrentPath()); + handleDeclaration(el); + return super.visitVariable(node, p); + } + }.scan(tp, null); + } + } + case MODULE -> { + q.add(elements.getPackageElement("")); + } + default -> + currentElement.getEnclosedElements() + .stream() + .sorted((e1, e2) -> e1.getSimpleName().toString().compareTo(e2.getSimpleName().toString())) + .forEach(q::add); + } + } + + return false; + } + + void handleDeclaration(Element el) { + Elements elements = processingEnv.getElementUtils(); + JavaFileObject fileObjects = elements.getFileObjectOf(el); + System.out.println(el.getSimpleName() + ": " + (fileObjects != null ? fileObjects.toUri().toString() : "")); + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + } + + @Test + public void testAutomaticModule(Path base) throws Exception { + Path src = base.resolve("src"); + tb.writeJavaFiles(src, + """ + package test; + public class TestClass { + } + """); + Path classes = base.resolve("classes"); + tb.createDirectories(classes); + + Path module = base.resolve("m.jar"); + + new JavacTask(tb) + .options("-classpath", "") + .outdir(classes) + .files(tb.findJavaFiles(src)) + .run() + .writeAll(); + new JarTask(tb, module) + .baseDir(classes) + .files(".") + .run(); + + String testClassSource = "jar:" + module.toUri().toString() + "!/test/TestClass.class"; + + List log; + + log = new JavacTask(tb) + .options("-processorpath", System.getProperty("test.classes"), + "-processor", AutomaticModulePrintFiles.class.getName(), + "--module-path", module.toString(), + "--add-modules", "m") + .outdir(classes) + .classes("java.lang.Object") + .run() + .writeAll() + .getOutputLines(Task.OutputKind.STDOUT); + + List expected = List.of( + "m: " + "", + "test: " + "", + "TestClass: " + testClassSource, + ": " + testClassSource + ); + + if (!expected.equals(log)) + throw new AssertionError("expected output not found: " + log); + } + + @SupportedAnnotationTypes("*") + @SupportedOptions("fromClass") + public static final class AutomaticModulePrintFiles extends AbstractProcessor { + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) + return false; + + Elements elements = processingEnv.getElementUtils(); + Trees trees = Trees.instance(processingEnv); + Queue q = new ArrayDeque<>(); + q.add(elements.getModuleElement("m")); + + while (!q.isEmpty()) { + Element currentElement = q.remove(); + + handleDeclaration(currentElement); + + switch (currentElement.getKind()) { + case METHOD -> { + ExecutableElement method = (ExecutableElement) currentElement; + TreePath tp = trees.getPath(method); + if (tp != null) { + new TreePathScanner<>() { + @Override + public Object visitVariable(VariableTree node, Object p) { + Element el = trees.getElement(getCurrentPath()); + handleDeclaration(el); + return super.visitVariable(node, p); + } + }.scan(tp, null); + } + } + case MODULE -> { + q.add(elements.getPackageElement("test")); + } + default -> + currentElement.getEnclosedElements() + .stream() + .sorted((e1, e2) -> e1.getSimpleName().toString().compareTo(e2.getSimpleName().toString())) + .forEach(q::add); + } + } + + return false; + } + + void handleDeclaration(Element el) { + Elements elements = processingEnv.getElementUtils(); + JavaFileObject fileObjects = elements.getFileObjectOf(el); + System.out.println(el.getSimpleName() + ": " + (fileObjects != null ? fileObjects.toUri().toString() : "")); + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + } + +} diff --git a/test/langtools/tools/javac/tree/NoPrivateTypesExported.java b/test/langtools/tools/javac/tree/NoPrivateTypesExported.java index cd1b305898c..e723139ef8d 100644 --- a/test/langtools/tools/javac/tree/NoPrivateTypesExported.java +++ b/test/langtools/tools/javac/tree/NoPrivateTypesExported.java @@ -89,7 +89,8 @@ public class NoPrivateTypesExported extends JavacTestingAbstractProcessor { "java.text.", "java.util.", "javax.lang.model.", - "javax.annotation.processing.SupportedSourceVersion" + "javax.annotation.processing.SupportedSourceVersion", + "javax.tools.JavaFileObject" )); Set javaxToolsProcessingAcceptableTemp = new HashSet<>(); javaxToolsProcessingAcceptableTemp.addAll(javaxLangModelAcceptable); -- GitLab From ca31ed5335f6fa7229c94ba20d9d6031b930d69a Mon Sep 17 00:00:00 2001 From: TatWai Chong Date: Mon, 22 Nov 2021 02:31:33 +0000 Subject: [PATCH 421/890] 8275448: [REDO] AArch64: Implement string_compare intrinsic in SVE Reviewed-by: ngasson, aph --- src/hotspot/cpu/aarch64/aarch64.ad | 37 ++++- src/hotspot/cpu/aarch64/aarch64_sve.ad | 99 ++++++++++++ src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 | 36 +++++ .../cpu/aarch64/c2_MacroAssembler_aarch64.cpp | 3 +- .../cpu/aarch64/c2_MacroAssembler_aarch64.hpp | 3 +- src/hotspot/cpu/aarch64/register_aarch64.hpp | 2 + .../aarch64/register_definitions_aarch64.cpp | 4 +- .../cpu/aarch64/stubGenerator_aarch64.cpp | 102 ++++++++++++ .../lang/StringCompareToDifferentLength.java | 148 ++++++++++++++++++ 9 files changed, 423 insertions(+), 11 deletions(-) create mode 100644 test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 11c6ec7df0a..f0dff9cf8bb 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -1199,6 +1199,9 @@ reg_class gov_pr ( // P7, non-allocatable, preserved with all elements preset to TRUE. ); +reg_class p0_reg(P0); +reg_class p1_reg(P1); + // Singleton class for condition codes reg_class int_flags(RFLAGS); @@ -5682,6 +5685,24 @@ operand pRegGov() interface(REG_INTER); %} +operand pRegGov_P0() +%{ + constraint(ALLOC_IN_RC(p0_reg)); + match(RegVectMask); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + +operand pRegGov_P1() +%{ + constraint(ALLOC_IN_RC(p1_reg)); + match(RegVectMask); + op_cost(0); + format %{ %} + interface(REG_INTER); +%} + // Flags register, used as output of signed compare instructions // note that on AArch64 we also use this register as the output for @@ -16660,7 +16681,7 @@ instruct partialSubtypeCheckVsZero(iRegP_R4 sub, iRegP_R0 super, iRegP_R2 temp, instruct string_compareU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, rFlagsReg cr) %{ - predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU); + predicate((UseSVE == 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU)); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); effect(KILL tmp1, KILL tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); @@ -16670,7 +16691,7 @@ instruct string_compareU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 c __ string_compare($str1$$Register, $str2$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register, $tmp1$$Register, $tmp2$$Register, - fnoreg, fnoreg, fnoreg, StrIntrinsicNode::UU); + fnoreg, fnoreg, fnoreg, pnoreg, pnoreg, StrIntrinsicNode::UU); %} ins_pipe(pipe_class_memory); %} @@ -16678,7 +16699,7 @@ instruct string_compareU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 c instruct string_compareL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, rFlagsReg cr) %{ - predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL); + predicate((UseSVE == 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL)); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); effect(KILL tmp1, KILL tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); @@ -16687,7 +16708,7 @@ instruct string_compareL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 c __ string_compare($str1$$Register, $str2$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register, $tmp1$$Register, $tmp2$$Register, - fnoreg, fnoreg, fnoreg, StrIntrinsicNode::LL); + fnoreg, fnoreg, fnoreg, pnoreg, pnoreg, StrIntrinsicNode::LL); %} ins_pipe(pipe_class_memory); %} @@ -16696,7 +16717,7 @@ instruct string_compareUL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, vRegD_V0 vtmp1, vRegD_V1 vtmp2, vRegD_V2 vtmp3, rFlagsReg cr) %{ - predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL); + predicate((UseSVE == 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL)); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); effect(KILL tmp1, KILL tmp2, KILL vtmp1, KILL vtmp2, KILL vtmp3, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); @@ -16707,7 +16728,7 @@ instruct string_compareUL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 $cnt1$$Register, $cnt2$$Register, $result$$Register, $tmp1$$Register, $tmp2$$Register, $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, - $vtmp3$$FloatRegister, StrIntrinsicNode::UL); + $vtmp3$$FloatRegister, pnoreg, pnoreg, StrIntrinsicNode::UL); %} ins_pipe(pipe_class_memory); %} @@ -16716,7 +16737,7 @@ instruct string_compareLU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, vRegD_V0 vtmp1, vRegD_V1 vtmp2, vRegD_V2 vtmp3, rFlagsReg cr) %{ - predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU); + predicate((UseSVE == 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU)); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); effect(KILL tmp1, KILL tmp2, KILL vtmp1, KILL vtmp2, KILL vtmp3, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); @@ -16727,7 +16748,7 @@ instruct string_compareLU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 $cnt1$$Register, $cnt2$$Register, $result$$Register, $tmp1$$Register, $tmp2$$Register, $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, - $vtmp3$$FloatRegister,StrIntrinsicNode::LU); + $vtmp3$$FloatRegister, pnoreg, pnoreg, StrIntrinsicNode::LU); %} ins_pipe(pipe_class_memory); %} diff --git a/src/hotspot/cpu/aarch64/aarch64_sve.ad b/src/hotspot/cpu/aarch64/aarch64_sve.ad index 8260459f223..6ad2d68526c 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve.ad +++ b/src/hotspot/cpu/aarch64/aarch64_sve.ad @@ -5551,6 +5551,105 @@ instruct stringU_indexof_char_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch, ins_pipe(pipe_class_memory); %} +// Intrisics for String.compareTo() + +// Note that Z registers alias the corresponding NEON registers, we declare the vector operands of +// these string_compare variants as NEON register type for convenience so that the prototype of +// string_compare can be shared with all variants. + + +instruct string_compareLL_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, pRegGov_P0 pgtmp1, + pRegGov_P1 pgtmp2, rFlagsReg cr) +%{ + predicate((UseSVE > 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL)); + match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); + effect(TEMP tmp1, TEMP tmp2, TEMP vtmp1, TEMP vtmp2, TEMP pgtmp1, TEMP pgtmp2, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # USE sve" %} + ins_encode %{ + // Count is in 8-bit bytes; non-Compact chars are 16 bits. + __ string_compare($str1$$Register, $str2$$Register, + $cnt1$$Register, $cnt2$$Register, $result$$Register, + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, fnoreg, + as_PRegister($pgtmp1$$reg), as_PRegister($pgtmp2$$reg), + StrIntrinsicNode::LL); + %} + ins_pipe(pipe_class_memory); +%} + +instruct string_compareLU_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, pRegGov_P0 pgtmp1, + pRegGov_P1 pgtmp2, rFlagsReg cr) +%{ + predicate((UseSVE > 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU)); + match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); + effect(TEMP tmp1, TEMP tmp2, TEMP vtmp1, TEMP vtmp2, TEMP pgtmp1, TEMP pgtmp2, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # USE sve" %} + ins_encode %{ + // Count is in 8-bit bytes; non-Compact chars are 16 bits. + __ string_compare($str1$$Register, $str2$$Register, + $cnt1$$Register, $cnt2$$Register, $result$$Register, + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, fnoreg, + as_PRegister($pgtmp1$$reg), as_PRegister($pgtmp2$$reg), + StrIntrinsicNode::LU); + %} + ins_pipe(pipe_class_memory); +%} + +instruct string_compareUL_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, pRegGov_P0 pgtmp1, + pRegGov_P1 pgtmp2, rFlagsReg cr) +%{ + predicate((UseSVE > 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL)); + match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); + effect(TEMP tmp1, TEMP tmp2, TEMP vtmp1, TEMP vtmp2, TEMP pgtmp1, TEMP pgtmp2, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # USE sve" %} + ins_encode %{ + // Count is in 8-bit bytes; non-Compact chars are 16 bits. + __ string_compare($str1$$Register, $str2$$Register, + $cnt1$$Register, $cnt2$$Register, $result$$Register, + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, fnoreg, + as_PRegister($pgtmp1$$reg), as_PRegister($pgtmp2$$reg), + StrIntrinsicNode::UL); + %} + ins_pipe(pipe_class_memory); +%} + +instruct string_compareUU_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, pRegGov_P0 pgtmp1, + pRegGov_P1 pgtmp2, rFlagsReg cr) +%{ + predicate((UseSVE > 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU)); + match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); + effect(TEMP tmp1, TEMP tmp2, TEMP vtmp1, TEMP vtmp2, TEMP pgtmp1, TEMP pgtmp2, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # USE sve" %} + ins_encode %{ + // Count is in 8-bit bytes; non-Compact chars are 16 bits. + __ string_compare($str1$$Register, $str2$$Register, + $cnt1$$Register, $cnt2$$Register, $result$$Register, + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, fnoreg, + as_PRegister($pgtmp1$$reg), as_PRegister($pgtmp2$$reg), + StrIntrinsicNode::UU); + %} + ins_pipe(pipe_class_memory); +%} + // ---------------------------- Vector mask reductions --------------------------- instruct vmask_truecount(iRegINoSp dst, pReg src) %{ predicate(UseSVE > 0 && diff --git a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 index 7589735365e..65de321a6e1 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 @@ -3044,6 +3044,42 @@ dnl $1 $2 $3 STRING_INDEXOF_CHAR(L, Latin1, true) STRING_INDEXOF_CHAR(U, UTF16, false) +// Intrisics for String.compareTo() + +// Note that Z registers alias the corresponding NEON registers, we declare the vector operands of +// these string_compare variants as NEON register type for convenience so that the prototype of +// string_compare can be shared with all variants. + +dnl +define(`STRING_COMPARETO', ` +instruct string_compare$1_sve(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, pRegGov_P0 pgtmp1, + pRegGov_P1 pgtmp2, rFlagsReg cr) +%{ + predicate((UseSVE > 0) && (((StrCompNode*)n)->encoding() == StrIntrinsicNode::$1)); + match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); + effect(TEMP tmp1, TEMP tmp2, TEMP vtmp1, TEMP vtmp2, TEMP pgtmp1, TEMP pgtmp2, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # USE sve" %} + ins_encode %{ + // Count is in 8-bit bytes; non-Compact chars are 16 bits. + __ string_compare($str1$$Register, $str2$$Register, + $cnt1$$Register, $cnt2$$Register, $result$$Register, + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, fnoreg, + as_PRegister($pgtmp1$$reg), as_PRegister($pgtmp2$$reg), + StrIntrinsicNode::$1); + %} + ins_pipe(pipe_class_memory); +%}')dnl +dnl $1 +STRING_COMPARETO(LL) +STRING_COMPARETO(LU) +STRING_COMPARETO(UL) +STRING_COMPARETO(UU) + // ---------------------------- Vector mask reductions --------------------------- instruct vmask_truecount(iRegINoSp dst, pReg src) %{ predicate(UseSVE > 0 && diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp index 5ba1026415f..f8289a4bda5 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp @@ -676,7 +676,8 @@ void C2_MacroAssembler::stringL_indexof_char(Register str1, Register cnt1, // Compare strings. void C2_MacroAssembler::string_compare(Register str1, Register str2, Register cnt1, Register cnt2, Register result, Register tmp1, Register tmp2, - FloatRegister vtmp1, FloatRegister vtmp2, FloatRegister vtmp3, int ae) { + FloatRegister vtmp1, FloatRegister vtmp2, FloatRegister vtmp3, + PRegister pgtmp1, PRegister pgtmp2, int ae) { Label DONE, SHORT_LOOP, SHORT_STRING, SHORT_LAST, TAIL, STUB, DIFF, NEXT_WORD, SHORT_LOOP_TAIL, SHORT_LAST2, SHORT_LAST_INIT, SHORT_LOOP_START, TAIL_CHECK; diff --git a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp index 81d9799f5ad..2c9d4b59ece 100644 --- a/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp @@ -32,7 +32,8 @@ void string_compare(Register str1, Register str2, Register cnt1, Register cnt2, Register result, Register tmp1, Register tmp2, FloatRegister vtmp1, - FloatRegister vtmp2, FloatRegister vtmp3, int ae); + FloatRegister vtmp2, FloatRegister vtmp3, + PRegister pgtmp1, PRegister pgtmp2, int ae); void string_indexof(Register str1, Register str2, Register cnt1, Register cnt2, diff --git a/src/hotspot/cpu/aarch64/register_aarch64.hpp b/src/hotspot/cpu/aarch64/register_aarch64.hpp index 69a0a7eb535..7b472856dc4 100644 --- a/src/hotspot/cpu/aarch64/register_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/register_aarch64.hpp @@ -268,6 +268,8 @@ class PRegisterImpl: public AbstractRegisterImpl { }; // The predicate registers of SVE. +CONSTANT_REGISTER_DECLARATION(PRegister, pnoreg, (-1)); + CONSTANT_REGISTER_DECLARATION(PRegister, p0, ( 0)); CONSTANT_REGISTER_DECLARATION(PRegister, p1, ( 1)); CONSTANT_REGISTER_DECLARATION(PRegister, p2, ( 2)); diff --git a/src/hotspot/cpu/aarch64/register_definitions_aarch64.cpp b/src/hotspot/cpu/aarch64/register_definitions_aarch64.cpp index f48c70d09e6..32358a0b154 100644 --- a/src/hotspot/cpu/aarch64/register_definitions_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/register_definitions_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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. * @@ -188,6 +188,8 @@ REGISTER_DEFINITION(FloatRegister, z29); REGISTER_DEFINITION(FloatRegister, z30); REGISTER_DEFINITION(FloatRegister, z31); +REGISTER_DEFINITION(PRegister, pnoreg); + REGISTER_DEFINITION(PRegister, p0); REGISTER_DEFINITION(PRegister, p1); REGISTER_DEFINITION(PRegister, p2); diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index fff6cd8cf99..b0392086542 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -5031,6 +5031,97 @@ class StubGenerator: public StubCodeGenerator { return start; } + enum string_compare_mode { + LL, + LU, + UL, + UU, + }; + + // The following registers are declared in aarch64.ad + // r0 = result + // r1 = str1 + // r2 = cnt1 + // r3 = str2 + // r4 = cnt2 + // r10 = tmp1 + // r11 = tmp2 + // z0 = ztmp1 + // z1 = ztmp2 + // p0 = pgtmp1 + // p1 = pgtmp2 + address generate_compare_long_string_sve(string_compare_mode mode) { + __ align(CodeEntryAlignment); + address entry = __ pc(); + Register result = r0, str1 = r1, cnt1 = r2, str2 = r3, cnt2 = r4, + tmp1 = r10, tmp2 = r11; + + Label LOOP, MATCH, DONE, NOMATCH; + Register vec_len = tmp1; + Register idx = tmp2; + // The minimum of the string lengths has been stored in cnt2. + Register cnt = cnt2; + FloatRegister ztmp1 = z0, ztmp2 = z1; + PRegister pgtmp1 = p0, pgtmp2 = p1; + + if (mode == LL) { + __ sve_cntb(vec_len); + } else { + __ sve_cnth(vec_len); + } + + __ mov(idx, 0); + __ sve_whilelt(pgtmp1, mode == LL ? __ B : __ H, idx, cnt); + + __ bind(LOOP); + switch (mode) { + case LL: + __ sve_ld1b(ztmp1, __ B, pgtmp1, Address(str1, idx)); + __ sve_ld1b(ztmp2, __ B, pgtmp1, Address(str2, idx)); + break; + case LU: + __ sve_ld1b(ztmp1, __ H, pgtmp1, Address(str1, idx)); + __ sve_ld1h(ztmp2, __ H, pgtmp1, Address(str2, idx, Address::lsl(1))); + break; + case UL: + __ sve_ld1h(ztmp1, __ H, pgtmp1, Address(str1, idx, Address::lsl(1))); + __ sve_ld1b(ztmp2, __ H, pgtmp1, Address(str2, idx)); + break; + case UU: + __ sve_ld1h(ztmp1, __ H, pgtmp1, Address(str1, idx, Address::lsl(1))); + __ sve_ld1h(ztmp2, __ H, pgtmp1, Address(str2, idx, Address::lsl(1))); + break; + default: ShouldNotReachHere(); + } + __ add(idx, idx, vec_len); + + // Compare strings. + __ sve_cmp(Assembler::NE, pgtmp2, mode == LL ? __ B : __ H, pgtmp1, ztmp1, ztmp2); + __ br(__ NE, MATCH); + __ sve_whilelt(pgtmp1, mode == LL ? __ B : __ H, idx, cnt); + __ br(__ LT, LOOP); + + // The result has been computed in the caller prior to entering this stub. + __ b(DONE); + + __ bind(MATCH); + + // Crop the vector to find its location. + __ sve_brkb(pgtmp2, pgtmp1, pgtmp2, false /* isMerge */); + + // Extract the first different characters of each string. + __ sve_lasta(rscratch1, mode == LL ? __ B : __ H, pgtmp2, ztmp1); + __ sve_lasta(rscratch2, mode == LL ? __ B : __ H, pgtmp2, ztmp2); + + // Compute the difference of the first different characters. + __ sub(result, rscratch1, rscratch2); + + __ bind(DONE); + __ ret(lr); + + return entry; + } + // r0 = result // r1 = str1 // r2 = cnt1 @@ -5153,6 +5244,7 @@ class StubGenerator: public StubCodeGenerator { } void generate_compare_long_strings() { + if (UseSVE == 0) { StubRoutines::aarch64::_compare_long_string_LL = generate_compare_long_string_same_encoding(true); StubRoutines::aarch64::_compare_long_string_UU @@ -5161,6 +5253,16 @@ class StubGenerator: public StubCodeGenerator { = generate_compare_long_string_different_encoding(true); StubRoutines::aarch64::_compare_long_string_UL = generate_compare_long_string_different_encoding(false); + } else { + StubRoutines::aarch64::_compare_long_string_LL + = generate_compare_long_string_sve(LL); + StubRoutines::aarch64::_compare_long_string_UU + = generate_compare_long_string_sve(UU); + StubRoutines::aarch64::_compare_long_string_LU + = generate_compare_long_string_sve(LU); + StubRoutines::aarch64::_compare_long_string_UL + = generate_compare_long_string_sve(UL); + } } // R0 = result diff --git a/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java b/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java new file mode 100644 index 00000000000..fb08e32efac --- /dev/null +++ b/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, BELLSOFT. All rights reserved. + * 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 com.arm.benchmarks.intrinsics; + +import java.util.concurrent.TimeUnit; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.CompilerControl; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +import org.openjdk.jmh.infra.Blackhole; + +/** + * This benchmark modified from test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java + * This benchmark can be used to measure performance of compareTo() in + * (Latin1, Latin1), (Latin1, UTF16), (UTF16, Latin1), and (UTF16, UTF16) + * comparisons. + */ + +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@State(Scope.Benchmark) +@Measurement(iterations = 3, time = 1000, timeUnit = TimeUnit.MILLISECONDS) +@Warmup(iterations = 3, time = 1000, timeUnit = TimeUnit.MILLISECONDS) +@CompilerControl(CompilerControl.Mode.DONT_INLINE) +public class StringCompareToDifferentLength { + + @State(Scope.Benchmark) + public static class Input { + @Param({"24", "36", "72", "128", "256", "512"}) + public int size; + + @Param({"2"}) + public int delta; + + int count = 100000; + String longLatin1; + String shortLatin1; + String longUTF16FirstChar; + String shortUTF16FirstChar; + String longUTF16LastChar; + String shortUTF16LastChar; + + /** + * Initialize. New array objects and set initial values. + */ + @Setup(Level.Trial) + public void setup() throws Exception { + char[] strsrc = new char[size + delta]; + // generate ASCII string + for (int i = 0; i < size + delta; i++) { + strsrc[i] = (char) ('a' + (i % 26)); + } + + longLatin1 = new String(strsrc); + shortLatin1 = longLatin1.substring(0, size); + longUTF16LastChar = longLatin1.substring(0, longLatin1.length() - 1) + '\ubeef'; + longUTF16FirstChar = '\ubeef' + longLatin1.substring(1, longLatin1.length()); + shortUTF16LastChar = shortLatin1.substring(0, shortLatin1.length() - 1) + '\ubeef'; + shortUTF16FirstChar = longUTF16FirstChar.substring(0, size); + } + } + + private int runCompareTo(String str2, String str1) { + return str1.compareTo(str2); + } + + /** + * latin1-latin1 + */ + @Benchmark + public void compareToLL(Input in, Blackhole blackhole) { + int res = 0; + for (int i = 0; i < in.count; ++i) { + res += runCompareTo(in.longLatin1, in.shortLatin1); + } + blackhole.consume(res); + } + + /** + * UTF16-UTF16 + */ + @Benchmark + public void compareToUU(Input in, Blackhole blackhole) { + int res = 0; + for (int i = 0; i < in.count; ++i) { + res += runCompareTo(in.longUTF16FirstChar, in.shortUTF16FirstChar); + } + blackhole.consume(res); + } + + /** + * latin1-UTF16 + */ + @Benchmark + public void compareToLU(Input in, Blackhole blackhole) { + int res = 0; + for (int i = 0; i < in.count; ++i) { + res += runCompareTo(in.longUTF16LastChar, in.shortLatin1); + } + blackhole.consume(res); + } + + /** + * UTF16-latin1 + */ + @Benchmark + public void compareToUL(Input in, Blackhole blackhole) { + int res = 0; + for (int i = 0; i < in.count; ++i) { + res += runCompareTo(in.longLatin1, in.shortUTF16LastChar); + } + blackhole.consume(res); + } +} + -- GitLab From 3f847fe89a088d6921107ca887a7a1bace871bd6 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 22 Nov 2021 09:09:21 +0000 Subject: [PATCH 422/890] 8277385: Zero: Enable CompactStrings support Reviewed-by: redestad, adinn --- src/hotspot/cpu/zero/globals_zero.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hotspot/cpu/zero/globals_zero.hpp b/src/hotspot/cpu/zero/globals_zero.hpp index aa330925c5a..208fc32940f 100644 --- a/src/hotspot/cpu/zero/globals_zero.hpp +++ b/src/hotspot/cpu/zero/globals_zero.hpp @@ -69,8 +69,7 @@ define_pd_global(uintx, TypeProfileLevel, 0); define_pd_global(bool, PreserveFramePointer, false); -// No performance work done here yet. -define_pd_global(bool, CompactStrings, false); +define_pd_global(bool, CompactStrings, true); #define ARCH_FLAGS(develop, \ product, \ -- GitLab From 8051041eb2b3d70d4cc62b6f2726279d51e44733 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 22 Nov 2021 09:59:09 +0000 Subject: [PATCH 423/890] 8277534: Remove unused ReferenceProcessor::has_discovered_references Reviewed-by: tschatzl --- src/hotspot/share/gc/shared/referenceProcessor.cpp | 9 --------- src/hotspot/share/gc/shared/referenceProcessor.hpp | 3 --- 2 files changed, 12 deletions(-) diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index e5fbc4df3ea..bf464c56204 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -1054,15 +1054,6 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { return true; } -bool ReferenceProcessor::has_discovered_references() { - for (uint i = 0; i < _max_num_queues * number_of_subclasses_of_ref(); i++) { - if (!_discovered_refs[i].is_empty()) { - return true; - } - } - return false; -} - void ReferenceProcessor::preclean_discovered_references(BoolObjectClosure* is_alive, EnqueueDiscoveredFieldClosure* enqueue, YieldClosure* yield, diff --git a/src/hotspot/share/gc/shared/referenceProcessor.hpp b/src/hotspot/share/gc/shared/referenceProcessor.hpp index 120a7afe2cf..a8ea98683e8 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp @@ -421,9 +421,6 @@ public: // Discover a Reference object, using appropriate discovery criteria virtual bool discover_reference(oop obj, ReferenceType rt); - // Has discovered references that need handling - bool has_discovered_references(); - // Process references found during GC (called by the garbage collector) ReferenceProcessorStats process_discovered_references(RefProcProxyTask& proxy_task, -- GitLab From 32839ba012f0a0a66e249cd8d12b94499d82ec0a Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Mon, 22 Nov 2021 10:47:47 +0000 Subject: [PATCH 424/890] 8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be" Reviewed-by: mdoerr, lmesnik, dcubed --- src/hotspot/share/prims/jvmtiEnvBase.cpp | 27 ++++++++++++++---------- test/hotspot/jtreg/ProblemList.txt | 1 - 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index 29fb94226af..0068ea05169 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -1393,6 +1393,9 @@ SetForceEarlyReturn::doit(Thread *target, bool self) { Thread* current_thread = Thread::current(); HandleMark hm(current_thread); + if (java_thread->is_exiting()) { + return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ + } if (!self) { if (!java_thread->is_suspended()) { _result = JVMTI_ERROR_THREAD_NOT_SUSPENDED; @@ -1523,6 +1526,10 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) { Thread* current_thread = Thread::current(); HandleMark hm(current_thread); JavaThread* java_thread = JavaThread::cast(target); + + if (java_thread->is_exiting()) { + return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ + } assert(java_thread == _state->get_thread(), "Must be"); if (!self && !java_thread->is_suspended()) { @@ -1599,14 +1606,12 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) { // It's fine to update the thread state here because no JVMTI events // shall be posted for this PopFrame. - if (!java_thread->is_exiting() && java_thread->threadObj() != NULL) { - _state->update_for_pop_top_frame(); - java_thread->set_popframe_condition(JavaThread::popframe_pending_bit); - // Set pending step flag for this popframe and it is cleared when next - // step event is posted. - _state->set_pending_step_for_popframe(); - _result = JVMTI_ERROR_NONE; - } + _state->update_for_pop_top_frame(); + java_thread->set_popframe_condition(JavaThread::popframe_pending_bit); + // Set pending step flag for this popframe and it is cleared when next + // step event is posted. + _state->set_pending_step_for_popframe(); + _result = JVMTI_ERROR_NONE; } void @@ -1614,6 +1619,9 @@ SetFramePopClosure::doit(Thread *target, bool self) { ResourceMark rm; JavaThread* java_thread = JavaThread::cast(target); + if (java_thread->is_exiting()) { + return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ + } assert(_state->get_thread() == java_thread, "Must be"); if (!self && !java_thread->is_suspended()) { @@ -1633,9 +1641,6 @@ SetFramePopClosure::doit(Thread *target, bool self) { } assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL"); - if (java_thread->is_exiting() || java_thread->threadObj() == NULL) { - return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ - } int frame_number = _state->count_frames() - _depth; _state->env_thread_state((JvmtiEnvBase*)_env)->set_frame_pop(frame_number); _result = JVMTI_ERROR_NONE; diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index fcc12d16677..6c59d923699 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -161,7 +161,6 @@ vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.ja vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all -vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all -- GitLab From d427c79d3bd6c80b67c10d15a461f13ae7e0f84b Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Mon, 22 Nov 2021 11:27:05 +0000 Subject: [PATCH 425/890] 8277428: G1: Move and inline G1STWIsAliveClosure::do_object_b Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp | 6 ++++++ src/hotspot/share/gc/g1/g1YoungCollector.cpp | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp index 2e0f6028a5d..159ee0471c2 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp @@ -41,6 +41,12 @@ #include "runtime/atomic.hpp" #include "utilities/bitMap.inline.hpp" +inline bool G1STWIsAliveClosure::do_object_b(oop p) { + // An object is reachable if it is outside the collection set, + // or is inside and copied. + return !_g1h->is_in_cset(p) || p->is_forwarded(); +} + G1GCPhaseTimes* G1CollectedHeap::phase_times() const { return _policy->phase_times(); } diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.cpp b/src/hotspot/share/gc/g1/g1YoungCollector.cpp index 51fbfbb20dd..34985059de5 100644 --- a/src/hotspot/share/gc/g1/g1YoungCollector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungCollector.cpp @@ -29,7 +29,7 @@ #include "compiler/oopMap.hpp" #include "gc/g1/g1Allocator.hpp" #include "gc/g1/g1CardSetMemory.hpp" -#include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorState.hpp" #include "gc/g1/g1ConcurrentMark.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" @@ -987,12 +987,6 @@ void G1YoungCollector::process_discovered_references(G1ParScanThreadStateSet* pe phase_times()->record_ref_proc_time((Ticks::now() - start).seconds() * MILLIUNITS); } -bool G1STWIsAliveClosure::do_object_b(oop p) { - // An object is reachable if it is outside the collection set, - // or is inside and copied. - return !_g1h->is_in_cset(p) || p->is_forwarded(); -} - void G1YoungCollector::post_evacuate_cleanup_1(G1ParScanThreadStateSet* per_thread_states) { Ticks start = Ticks::now(); { -- GitLab From 6b4fbaedbb782c5f028735ac1d92838895589192 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Mon, 22 Nov 2021 16:17:01 +0000 Subject: [PATCH 426/890] 8273792: JumpableGenerator.rngs() documentation refers to wrong method Co-authored-by: Guy Steele Reviewed-by: rriggs --- .../share/classes/java/util/random/RandomGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/random/RandomGenerator.java b/src/java.base/share/classes/java/util/random/RandomGenerator.java index 9feff713192..a5e20e55161 100644 --- a/src/java.base/share/classes/java/util/random/RandomGenerator.java +++ b/src/java.base/share/classes/java/util/random/RandomGenerator.java @@ -1196,7 +1196,7 @@ public interface RandomGenerator { * * @return a stream of objects that implement the {@link RandomGenerator} interface * - * @implSpec The default implementation calls {@link JumpableGenerator#jump jump}(). + * @implSpec The default implementation calls {@link JumpableGenerator#jumps jumps}(). */ default Stream rngs() { return this.jumps(); -- GitLab From 8683de5eda2d1a04f187073f969140245908f324 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Mon, 22 Nov 2021 16:19:23 +0000 Subject: [PATCH 427/890] 8274685: Documentation suggests there are ArbitrarilyJumpableGenerator when none Co-authored-by: Guy Steele Reviewed-by: rriggs --- .../java/util/random/package-info.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/java.base/share/classes/java/util/random/package-info.java b/src/java.base/share/classes/java/util/random/package-info.java index 8efaa0bd4c3..102410bffe6 100644 --- a/src/java.base/share/classes/java/util/random/package-info.java +++ b/src/java.base/share/classes/java/util/random/package-info.java @@ -347,12 +347,12 @@ * supported by the interface {@link RandomGenerator.JumpableGenerator}. * Sometimes it is desirable to support two levels of jumping (by long distances * and by really long distances); this strategy is supported by the - * interface {@link RandomGenerator.LeapableGenerator}. There is also an interface + * interface {@link RandomGenerator.LeapableGenerator}. In this package, + * implementations of this interface include "Xoroshiro128PlusPlus" and + * "Xoshiro256PlusPlus". There is also an interface * {@link RandomGenerator.ArbitrarilyJumpableGenerator} for algorithms that allow - * jumping along the state cycle by any user-specified distance. In this package, - * implementations of these interfaces include - * "Xoroshiro128PlusPlus", and - * "Xoshiro256PlusPlus". + * jumping along the state cycle by any user-specified distance; there are currently + * no implementations of this interface in this package. * *

      A more recent category of "splittable" pseudorandom generator algorithms * uses a large family of state cycles and makes some attempt to ensure that @@ -382,13 +382,18 @@ * equidistribution, scalability, and better quality. Each of the * specific implementations here combines one of the best currently known * XBG algorithms (xoroshiro128 or xoshiro256, described by Blackman and - * Vigna in "Scrambled Linear Pseudorandom Number Generators", ACM Transactions - * on Mathematical Software, 2021) with an LCG that uses one of the best + * Vigna in "Scrambled Linear Pseudorandom Number Generators", ACM Transactions + * on Mathematical Software, 2021) with an LCG that uses one of the best * currently known multipliers (found by a search for better multipliers - * in 2019 by Steele and Vigna), and then applies either a mixing function - * identified by Doug Lea or a simple scrambler proposed by Blackman and Vigna. - * Testing has confirmed that the LXM algorithm is far superior in quality to - * the SplitMix algorithm (2014) used by {@code SplittableRandom}. + * in 2019 by Steele and Vigna, described in "Computationally Easy, Spectrally + * Good Multipliers for Congruential Pseudorandom Number Generators", + * Software: Practice and Experience (2021), doi:10.1002/spe.3030), + * and then applies either a mixing function identified by Doug Lea or + * or a simple scrambler proposed by Blackman and Vigna. Testing has + * confirmed that the LXM algorithm is far superior in quality to the + * SplitMix algorithm (2014) used by {@code SplittableRandom} + * (see Steele and Vigna, "LXM: Better Splittable Pseudorandom Number + * Generators (and Almost as Fast)", Proc. 2021 ACM OOPSLA Conference). * * Each class with a name of the form * {@code L}p{@code X}q{@code SomethingRandom} -- GitLab From e529865531d0eb5a2119a1d220b195d088794226 Mon Sep 17 00:00:00 2001 From: Jatin Bhateja Date: Mon, 22 Nov 2021 16:38:52 +0000 Subject: [PATCH 428/890] 8277239: SIGSEGV in vrshift_reg_maskedNode::emit Reviewed-by: sviswanathan, dlong --- src/hotspot/cpu/x86/x86.ad | 104 ++++++++++++++------ src/hotspot/share/opto/node.hpp | 3 + src/hotspot/share/opto/vectorIntrinsics.cpp | 2 +- src/hotspot/share/opto/vectornode.cpp | 34 +++---- src/hotspot/share/opto/vectornode.hpp | 48 ++++++--- 5 files changed, 130 insertions(+), 61 deletions(-) diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 5a8569dc6e0..3f6d5a44b0d 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -6196,7 +6196,7 @@ instruct vshiftcnt(vec dst, rRegI cnt) %{ // Byte vector shift instruct vshiftB(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ - predicate(Matcher::vector_length(n) <= 8 && VectorNode::is_vshift_cnt(n->in(2))); + predicate(Matcher::vector_length(n) <= 8 && !n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); match(Set dst (URShiftVB src shift)); @@ -6216,7 +6216,7 @@ instruct vshiftB(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ %} instruct vshift16B(vec dst, vec src, vec shift, vec tmp1, vec tmp2, rRegI scratch) %{ - predicate(Matcher::vector_length(n) == 16 && VectorNode::is_vshift_cnt(n->in(2)) && + predicate(Matcher::vector_length(n) == 16 && !n->as_ShiftV()->is_var_shift() && UseAVX <= 1); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6241,7 +6241,7 @@ instruct vshift16B(vec dst, vec src, vec shift, vec tmp1, vec tmp2, rRegI scratc %} instruct vshift16B_avx(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ - predicate(Matcher::vector_length(n) == 16 && VectorNode::is_vshift_cnt(n->in(2)) && + predicate(Matcher::vector_length(n) == 16 && !n->as_ShiftV()->is_var_shift() && UseAVX > 1); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6262,7 +6262,7 @@ instruct vshift16B_avx(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ %} instruct vshift32B_avx(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ - predicate(Matcher::vector_length(n) == 32 && VectorNode::is_vshift_cnt(n->in(2))); + predicate(Matcher::vector_length(n) == 32 && !n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); match(Set dst (URShiftVB src shift)); @@ -6287,7 +6287,7 @@ instruct vshift32B_avx(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ %} instruct vshift64B_avx(vec dst, vec src, vec shift, vec tmp1, vec tmp2, rRegI scratch) %{ - predicate(Matcher::vector_length(n) == 64 && VectorNode::is_vshift_cnt(n->in(2))); + predicate(Matcher::vector_length(n) == 64 && !n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVB src shift)); match(Set dst (RShiftVB src shift)); match(Set dst (URShiftVB src shift)); @@ -6320,7 +6320,7 @@ instruct vshift64B_avx(vec dst, vec src, vec shift, vec tmp1, vec tmp2, rRegI sc // unsigned values. // Shorts/Chars vector left shift instruct vshiftS(vec dst, vec src, vec shift) %{ - predicate(VectorNode::is_vshift_cnt(n->in(2))); + predicate(!n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVS src shift)); match(Set dst ( RShiftVS src shift)); match(Set dst (URShiftVS src shift)); @@ -6351,7 +6351,7 @@ instruct vshiftS(vec dst, vec src, vec shift) %{ // Integers vector left shift instruct vshiftI(vec dst, vec src, vec shift) %{ - predicate(VectorNode::is_vshift_cnt(n->in(2))); + predicate(!n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVI src shift)); match(Set dst ( RShiftVI src shift)); match(Set dst (URShiftVI src shift)); @@ -6405,7 +6405,7 @@ instruct vshiftI_imm(vec dst, vec src, immI8 shift) %{ // Longs vector shift instruct vshiftL(vec dst, vec src, vec shift) %{ - predicate(VectorNode::is_vshift_cnt(n->in(2))); + predicate(!n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVL src shift)); match(Set dst (URShiftVL src shift)); effect(TEMP dst, USE src, USE shift); @@ -6446,7 +6446,7 @@ instruct vshiftL_imm(vec dst, vec src, immI8 shift) %{ // -------------------ArithmeticRightShift ----------------------------------- // Long vector arithmetic right shift instruct vshiftL_arith_reg(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %{ - predicate(VectorNode::is_vshift_cnt(n->in(2)) && UseAVX <= 2); + predicate(!n->as_ShiftV()->is_var_shift() && UseAVX <= 2); match(Set dst (RShiftVL src shift)); effect(TEMP dst, TEMP tmp, TEMP scratch); format %{ "vshiftq $dst,$src,$shift" %} @@ -6475,7 +6475,7 @@ instruct vshiftL_arith_reg(vec dst, vec src, vec shift, vec tmp, rRegI scratch) %} instruct vshiftL_arith_reg_evex(vec dst, vec src, vec shift) %{ - predicate(VectorNode::is_vshift_cnt(n->in(2)) && UseAVX > 2); + predicate(!n->as_ShiftV()->is_var_shift() && UseAVX > 2); match(Set dst (RShiftVL src shift)); format %{ "vshiftq $dst,$src,$shift" %} ins_encode %{ @@ -6489,7 +6489,7 @@ instruct vshiftL_arith_reg_evex(vec dst, vec src, vec shift) %{ // Byte variable shift instruct vshift8B_var_nobw(vec dst, vec src, vec shift, vec vtmp, rRegP scratch) %{ predicate(Matcher::vector_length(n) <= 8 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && !VM_Version::supports_avx512bw()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6509,7 +6509,7 @@ instruct vshift8B_var_nobw(vec dst, vec src, vec shift, vec vtmp, rRegP scratch) instruct vshift16B_var_nobw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, rRegP scratch) %{ predicate(Matcher::vector_length(n) == 16 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && !VM_Version::supports_avx512bw()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6537,7 +6537,7 @@ instruct vshift16B_var_nobw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, r instruct vshift32B_var_nobw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, vec vtmp3, vec vtmp4, rRegP scratch) %{ predicate(Matcher::vector_length(n) == 32 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && !VM_Version::supports_avx512bw()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6573,7 +6573,7 @@ instruct vshift32B_var_nobw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, v instruct vshiftB_var_evex_bw(vec dst, vec src, vec shift, vec vtmp, rRegP scratch) %{ predicate(Matcher::vector_length(n) <= 32 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && VM_Version::supports_avx512bw()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6592,7 +6592,7 @@ instruct vshiftB_var_evex_bw(vec dst, vec src, vec shift, vec vtmp, rRegP scratc instruct vshift64B_var_evex_bw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, rRegP scratch) %{ predicate(Matcher::vector_length(n) == 64 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && VM_Version::supports_avx512bw()); match(Set dst ( LShiftVB src shift)); match(Set dst ( RShiftVB src shift)); @@ -6616,7 +6616,7 @@ instruct vshift64B_var_evex_bw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2 // Short variable shift instruct vshift8S_var_nobw(vec dst, vec src, vec shift, vec vtmp, rRegP scratch) %{ predicate(Matcher::vector_length(n) <= 8 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && !VM_Version::supports_avx512bw()); match(Set dst ( LShiftVS src shift)); match(Set dst ( RShiftVS src shift)); @@ -6641,7 +6641,7 @@ instruct vshift8S_var_nobw(vec dst, vec src, vec shift, vec vtmp, rRegP scratch) instruct vshift16S_var_nobw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, rRegP scratch) %{ predicate(Matcher::vector_length(n) == 16 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && !VM_Version::supports_avx512bw()); match(Set dst ( LShiftVS src shift)); match(Set dst ( RShiftVS src shift)); @@ -6676,7 +6676,7 @@ instruct vshift16S_var_nobw(vec dst, vec src, vec shift, vec vtmp1, vec vtmp2, r %} instruct vshift16S_var_evex_bw(vec dst, vec src, vec shift) %{ - predicate(!VectorNode::is_vshift_cnt(n->in(2)) && + predicate(n->as_ShiftV()->is_var_shift() && VM_Version::supports_avx512bw()); match(Set dst ( LShiftVS src shift)); match(Set dst ( RShiftVS src shift)); @@ -6697,7 +6697,7 @@ instruct vshift16S_var_evex_bw(vec dst, vec src, vec shift) %{ //Integer variable shift instruct vshiftI_var(vec dst, vec src, vec shift) %{ - predicate(!VectorNode::is_vshift_cnt(n->in(2))); + predicate(n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVI src shift)); match(Set dst ( RShiftVI src shift)); match(Set dst (URShiftVI src shift)); @@ -6714,7 +6714,7 @@ instruct vshiftI_var(vec dst, vec src, vec shift) %{ //Long variable shift instruct vshiftL_var(vec dst, vec src, vec shift) %{ - predicate(!VectorNode::is_vshift_cnt(n->in(2))); + predicate(n->as_ShiftV()->is_var_shift()); match(Set dst ( LShiftVL src shift)); match(Set dst (URShiftVL src shift)); format %{ "vector_varshift_long $dst,$src,$shift\t!" %} @@ -6731,7 +6731,7 @@ instruct vshiftL_var(vec dst, vec src, vec shift) %{ //Long variable right shift arithmetic instruct vshiftL_arith_var(vec dst, vec src, vec shift, vec vtmp) %{ predicate(Matcher::vector_length(n) <= 4 && - !VectorNode::is_vshift_cnt(n->in(2)) && + n->as_ShiftV()->is_var_shift() && UseAVX == 2); match(Set dst (RShiftVL src shift)); effect(TEMP dst, TEMP vtmp); @@ -6746,7 +6746,7 @@ instruct vshiftL_arith_var(vec dst, vec src, vec shift, vec vtmp) %{ %} instruct vshiftL_arith_var_evex(vec dst, vec src, vec shift) %{ - predicate(!VectorNode::is_vshift_cnt(n->in(2)) && + predicate(n->as_ShiftV()->is_var_shift() && UseAVX > 2); match(Set dst (RShiftVL src shift)); format %{ "vector_varfshift_long $dst,$src,$shift\t!" %} @@ -9033,6 +9033,7 @@ instruct vlshift_imm_masked(vec dst, immI8 shift, kReg mask) %{ %} instruct vlshift_reg_masked(vec dst, vec src2, kReg mask) %{ + predicate(!n->as_ShiftV()->is_var_shift()); match(Set dst (LShiftVS (Binary dst src2) mask)); match(Set dst (LShiftVI (Binary dst src2) mask)); match(Set dst (LShiftVL (Binary dst src2) mask)); @@ -9041,9 +9042,24 @@ instruct vlshift_reg_masked(vec dst, vec src2, kReg mask) %{ int vlen_enc = vector_length_encoding(this); BasicType bt = Matcher::vector_element_basic_type(this); int opc = this->ideal_Opcode(); - bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode()); __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, - $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift); + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, false); + %} + ins_pipe( pipe_slow ); +%} + +instruct vlshiftv_reg_masked(vec dst, vec src2, kReg mask) %{ + predicate(n->as_ShiftV()->is_var_shift()); + match(Set dst (LShiftVS (Binary dst src2) mask)); + match(Set dst (LShiftVI (Binary dst src2) mask)); + match(Set dst (LShiftVL (Binary dst src2) mask)); + format %{ "vplshiftv_masked $dst, $dst, $src2, $mask\t! lshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, true); %} ins_pipe( pipe_slow ); %} @@ -9079,6 +9095,7 @@ instruct vrshift_imm_masked(vec dst, immI8 shift, kReg mask) %{ %} instruct vrshift_reg_masked(vec dst, vec src2, kReg mask) %{ + predicate(!n->as_ShiftV()->is_var_shift()); match(Set dst (RShiftVS (Binary dst src2) mask)); match(Set dst (RShiftVI (Binary dst src2) mask)); match(Set dst (RShiftVL (Binary dst src2) mask)); @@ -9087,9 +9104,24 @@ instruct vrshift_reg_masked(vec dst, vec src2, kReg mask) %{ int vlen_enc = vector_length_encoding(this); BasicType bt = Matcher::vector_element_basic_type(this); int opc = this->ideal_Opcode(); - bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode()); __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, - $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift); + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, false); + %} + ins_pipe( pipe_slow ); +%} + +instruct vrshiftv_reg_masked(vec dst, vec src2, kReg mask) %{ + predicate(n->as_ShiftV()->is_var_shift()); + match(Set dst (RShiftVS (Binary dst src2) mask)); + match(Set dst (RShiftVI (Binary dst src2) mask)); + match(Set dst (RShiftVL (Binary dst src2) mask)); + format %{ "vprshiftv_masked $dst, $dst, $src2, $mask\t! rshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, true); %} ins_pipe( pipe_slow ); %} @@ -9125,6 +9157,7 @@ instruct vurshift_imm_masked(vec dst, immI8 shift, kReg mask) %{ %} instruct vurshift_reg_masked(vec dst, vec src2, kReg mask) %{ + predicate(!n->as_ShiftV()->is_var_shift()); match(Set dst (URShiftVS (Binary dst src2) mask)); match(Set dst (URShiftVI (Binary dst src2) mask)); match(Set dst (URShiftVL (Binary dst src2) mask)); @@ -9133,9 +9166,24 @@ instruct vurshift_reg_masked(vec dst, vec src2, kReg mask) %{ int vlen_enc = vector_length_encoding(this); BasicType bt = Matcher::vector_element_basic_type(this); int opc = this->ideal_Opcode(); - bool is_varshift = !VectorNode::is_vshift_cnt_opcode(in(2)->isa_Mach()->ideal_Opcode()); __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, - $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, is_varshift); + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, false); + %} + ins_pipe( pipe_slow ); +%} + +instruct vurshiftv_reg_masked(vec dst, vec src2, kReg mask) %{ + predicate(n->as_ShiftV()->is_var_shift()); + match(Set dst (URShiftVS (Binary dst src2) mask)); + match(Set dst (URShiftVI (Binary dst src2) mask)); + match(Set dst (URShiftVL (Binary dst src2) mask)); + format %{ "vpurshiftv_masked $dst, $dst, $src2, $mask\t! urshift masked operation" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + BasicType bt = Matcher::vector_element_basic_type(this); + int opc = this->ideal_Opcode(); + __ evmasked_op(opc, bt, $mask$$KRegister, $dst$$XMMRegister, + $dst$$XMMRegister, $src2$$XMMRegister, true, vlen_enc, true); %} ins_pipe( pipe_slow ); %} diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 1c226cbf2a4..94fd6ac3385 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -175,6 +175,7 @@ class VectorMaskCmpNode; class VectorUnboxNode; class VectorSet; class VectorReinterpretNode; +class ShiftVNode; // The type of all node counts and indexes. // It must hold at least 16 bits, but must also be fast to load and store. @@ -711,6 +712,7 @@ public: DEFINE_CLASS_ID(VectorMaskCmp, Vector, 0) DEFINE_CLASS_ID(VectorUnbox, Vector, 1) DEFINE_CLASS_ID(VectorReinterpret, Vector, 2) + DEFINE_CLASS_ID(ShiftV, Vector, 3) DEFINE_CLASS_ID(Proj, Node, 3) DEFINE_CLASS_ID(CatchProj, Proj, 0) @@ -945,6 +947,7 @@ public: DEFINE_CLASS_QUERY(LoadVectorGather) DEFINE_CLASS_QUERY(StoreVector) DEFINE_CLASS_QUERY(StoreVectorScatter) + DEFINE_CLASS_QUERY(ShiftV) DEFINE_CLASS_QUERY(Unlock) #undef DEFINE_CLASS_QUERY diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp index 95ca0ae6d2b..63ee441336e 100644 --- a/src/hotspot/share/opto/vectorIntrinsics.cpp +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp @@ -526,7 +526,7 @@ bool LibraryCallKit::inline_vector_nary_operation(int n) { switch (n) { case 1: case 2: { - operation = VectorNode::make(sopc, opd1, opd2, vt, is_vector_mask(vbox_klass)); + operation = VectorNode::make(sopc, opd1, opd2, vt, is_vector_mask(vbox_klass), VectorNode::is_shift_opcode(opc)); break; } case 3: { diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index 6d845271e47..27524b48dcc 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -480,7 +480,7 @@ VectorNode* VectorNode::make_mask_node(int vopc, Node* n1, Node* n2, uint vlen, } // Make a vector node for binary operation -VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask) { +VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask, bool is_var_shift) { // This method should not be called for unimplemented vectors. guarantee(vopc > 0, "vopc must be > 0"); @@ -534,20 +534,20 @@ VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, b case Op_RotateLeftV: return new RotateLeftVNode(n1, n2, vt); case Op_RotateRightV: return new RotateRightVNode(n1, n2, vt); - case Op_LShiftVB: return new LShiftVBNode(n1, n2, vt); - case Op_LShiftVS: return new LShiftVSNode(n1, n2, vt); - case Op_LShiftVI: return new LShiftVINode(n1, n2, vt); - case Op_LShiftVL: return new LShiftVLNode(n1, n2, vt); + case Op_LShiftVB: return new LShiftVBNode(n1, n2, vt, is_var_shift); + case Op_LShiftVS: return new LShiftVSNode(n1, n2, vt, is_var_shift); + case Op_LShiftVI: return new LShiftVINode(n1, n2, vt, is_var_shift); + case Op_LShiftVL: return new LShiftVLNode(n1, n2, vt, is_var_shift); - case Op_RShiftVB: return new RShiftVBNode(n1, n2, vt); - case Op_RShiftVS: return new RShiftVSNode(n1, n2, vt); - case Op_RShiftVI: return new RShiftVINode(n1, n2, vt); - case Op_RShiftVL: return new RShiftVLNode(n1, n2, vt); + case Op_RShiftVB: return new RShiftVBNode(n1, n2, vt, is_var_shift); + case Op_RShiftVS: return new RShiftVSNode(n1, n2, vt, is_var_shift); + case Op_RShiftVI: return new RShiftVINode(n1, n2, vt, is_var_shift); + case Op_RShiftVL: return new RShiftVLNode(n1, n2, vt, is_var_shift); - case Op_URShiftVB: return new URShiftVBNode(n1, n2, vt); - case Op_URShiftVS: return new URShiftVSNode(n1, n2, vt); - case Op_URShiftVI: return new URShiftVINode(n1, n2, vt); - case Op_URShiftVL: return new URShiftVLNode(n1, n2, vt); + case Op_URShiftVB: return new URShiftVBNode(n1, n2, vt, is_var_shift); + case Op_URShiftVS: return new URShiftVSNode(n1, n2, vt, is_var_shift); + case Op_URShiftVI: return new URShiftVINode(n1, n2, vt, is_var_shift); + case Op_URShiftVL: return new URShiftVLNode(n1, n2, vt, is_var_shift); case Op_AndV: return new AndVNode(n1, n2, vt); case Op_OrV: return new OrVNode (n1, n2, vt); @@ -563,12 +563,12 @@ VectorNode* VectorNode::make(int vopc, Node* n1, Node* n2, const TypeVect* vt, b } // Return the vector version of a scalar binary operation node. -VectorNode* VectorNode::make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt) { +VectorNode* VectorNode::make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt, bool is_var_shift) { const TypeVect* vt = TypeVect::make(bt, vlen); int vopc = VectorNode::opcode(opc, bt); // This method should not be called for unimplemented vectors. guarantee(vopc > 0, "Vector for '%s' is not implemented", NodeClassNames[opc]); - return make(vopc, n1, n2, vt); + return make(vopc, n1, n2, vt, false, is_var_shift); } // Make a vector node for ternary operation @@ -1297,8 +1297,8 @@ Node* VectorNode::degenerate_vector_rotate(Node* src, Node* cnt, bool is_rotate_ shiftRCnt = phase->transform(new RShiftCntVNode(shiftRCnt, vt)); } - return new OrVNode(phase->transform(VectorNode::make(shiftLOpc, src, shiftLCnt, vlen, bt)), - phase->transform(VectorNode::make(shiftROpc, src, shiftRCnt, vlen, bt)), + return new OrVNode(phase->transform(VectorNode::make(shiftLOpc, src, shiftLCnt, vlen, bt, is_binary_vector_op)), + phase->transform(VectorNode::make(shiftROpc, src, shiftRCnt, vlen, bt, is_binary_vector_op)), vt); } diff --git a/src/hotspot/share/opto/vectornode.hpp b/src/hotspot/share/opto/vectornode.hpp index 0b04a053f99..95079919f78 100644 --- a/src/hotspot/share/opto/vectornode.hpp +++ b/src/hotspot/share/opto/vectornode.hpp @@ -72,8 +72,8 @@ class VectorNode : public TypeNode { static VectorNode* scalar2vector(Node* s, uint vlen, const Type* opd_t, bool is_mask = false); static VectorNode* shift_count(int opc, Node* cnt, uint vlen, BasicType bt); - static VectorNode* make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt); - static VectorNode* make(int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask = false); + static VectorNode* make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt, bool is_var_shift = false); + static VectorNode* make(int vopc, Node* n1, Node* n2, const TypeVect* vt, bool is_mask = false, bool is_var_shift = false); static VectorNode* make(int opc, Node* n1, Node* n2, Node* n3, uint vlen, BasicType bt); static VectorNode* make(int vopc, Node* n1, Node* n2, Node* n3, const TypeVect* vt); static VectorNode* make_mask_node(int vopc, Node* n1, Node* n2, uint vlen, BasicType bt); @@ -531,17 +531,24 @@ class SqrtVDNode : public VectorNode { // Class ShiftV functionality. This covers the common behaviors for all kinds // of vector shifts. class ShiftVNode : public VectorNode { + bool _is_var_shift; public: - ShiftVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} + ShiftVNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift) : + VectorNode(in1,in2,vt), _is_var_shift(is_var_shift) { + init_class_id(Class_ShiftV); + } virtual Node* Identity(PhaseGVN* phase); virtual int Opcode() const = 0; + bool is_var_shift() { return _is_var_shift;} + virtual uint size_of() const { return sizeof(ShiftVNode); } }; //------------------------------LShiftVBNode----------------------------------- // Vector left shift bytes class LShiftVBNode : public ShiftVNode { public: - LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -549,7 +556,8 @@ class LShiftVBNode : public ShiftVNode { // Vector left shift shorts class LShiftVSNode : public ShiftVNode { public: - LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -557,7 +565,8 @@ class LShiftVSNode : public ShiftVNode { // Vector left shift ints class LShiftVINode : public ShiftVNode { public: - LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + LShiftVINode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -565,7 +574,8 @@ class LShiftVINode : public ShiftVNode { // Vector left shift longs class LShiftVLNode : public ShiftVNode { public: - LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -573,7 +583,8 @@ class LShiftVLNode : public ShiftVNode { // Vector right arithmetic (signed) shift bytes class RShiftVBNode : public ShiftVNode { public: - RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -581,7 +592,8 @@ class RShiftVBNode : public ShiftVNode { // Vector right arithmetic (signed) shift shorts class RShiftVSNode : public ShiftVNode { public: - RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -589,7 +601,8 @@ class RShiftVSNode : public ShiftVNode { // Vector right arithmetic (signed) shift ints class RShiftVINode : public ShiftVNode { public: - RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + RShiftVINode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -597,7 +610,8 @@ class RShiftVINode : public ShiftVNode { // Vector right arithmetic (signed) shift longs class RShiftVLNode : public ShiftVNode { public: - RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -605,7 +619,8 @@ class RShiftVLNode : public ShiftVNode { // Vector right logical (unsigned) shift bytes class URShiftVBNode : public ShiftVNode { public: - URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -613,7 +628,8 @@ class URShiftVBNode : public ShiftVNode { // Vector right logical (unsigned) shift shorts class URShiftVSNode : public ShiftVNode { public: - URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -621,7 +637,8 @@ class URShiftVSNode : public ShiftVNode { // Vector right logical (unsigned) shift ints class URShiftVINode : public ShiftVNode { public: - URShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + URShiftVINode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; @@ -629,7 +646,8 @@ class URShiftVINode : public ShiftVNode { // Vector right logical (unsigned) shift longs class URShiftVLNode : public ShiftVNode { public: - URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : ShiftVNode(in1,in2,vt) {} + URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt, bool is_var_shift=false) : + ShiftVNode(in1,in2,vt,is_var_shift) {} virtual int Opcode() const; }; -- GitLab From 22f12ac429fbbf134d182d9bf2a16a3d43bc71e1 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 22 Nov 2021 16:59:23 +0000 Subject: [PATCH 429/890] 8277522: Make formatting of null consistent in Elements Reviewed-by: jlahoda --- .../classes/javax/lang/model/util/Elements.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java index 5f81e6620d7..03dec84feb1 100644 --- a/src/java.compiler/share/classes/javax/lang/model/util/Elements.java +++ b/src/java.compiler/share/classes/javax/lang/model/util/Elements.java @@ -68,8 +68,8 @@ public interface Elements { * * * - * If this process leads to a list with a single element, - * the single element is returned, otherwise null is returned. + * If this process leads to a list with a single element, the + * single element is returned, otherwise {@code null} is returned. * * @param name fully qualified package name, * or an empty string for an unnamed package @@ -155,8 +155,8 @@ public interface Elements { * * * - * If this process leads to a list with a single element, - * the single element is returned, otherwise null is returned. + * If this process leads to a list with a single element, the + * single element is returned, otherwise {@code null} is returned. * * @param name the canonical name * @return the named type element, @@ -735,8 +735,9 @@ public interface Elements { } /** - * Returns the record component for the given accessor. Returns null if the - * given method is not a record component accessor. + * Returns the record component for the given accessor. Returns + * {@code null} if the given method is not a record component + * accessor. * * @implSpec The default implementation of this method checks if the element * enclosing the accessor has kind {@link ElementKind#RECORD RECORD} if that is @@ -747,8 +748,8 @@ public interface Elements { * record component is returned, in any other case {@code null} is returned. * * @param accessor the method for which the record component should be found. - * @return the record component, or null if the given method is not a record - * component accessor + * @return the record component, or {@code null} if the given + * method is not a record component accessor * @since 16 */ default RecordComponentElement recordComponentFor(ExecutableElement accessor) { -- GitLab From 33e2a518ebcd50e76c559512539fd7c864fd2407 Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Mon, 22 Nov 2021 17:11:34 +0000 Subject: [PATCH 430/890] 8265795: vmTestbase/nsk/jvmti/AttachOnDemand/attach022/TestDescription.java fails when running with JEP 416 Reviewed-by: sspitsyn, dholmes --- src/hotspot/share/prims/unsafe.cpp | 2 + test/hotspot/jtreg/ProblemList.txt | 2 - .../VMObjectAlloc/VMObjectAllocTest.java | 53 +++++++++++ .../jvmti/VMObjectAlloc/libVMObjectAlloc.cpp | 91 +++++++++++++++++++ 4 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/VMObjectAllocTest.java create mode 100644 test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/libVMObjectAlloc.cpp diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp index 814a8e0ed3f..dd0dca74c85 100644 --- a/src/hotspot/share/prims/unsafe.cpp +++ b/src/hotspot/share/prims/unsafe.cpp @@ -41,6 +41,7 @@ #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.inline.hpp" +#include "prims/jvmtiExport.hpp" #include "prims/unsafe.hpp" #include "runtime/globals.hpp" #include "runtime/handles.inline.hpp" @@ -329,6 +330,7 @@ UNSAFE_LEAF(void, Unsafe_FullFence(JNIEnv *env, jobject unsafe)) { ////// Allocation requests UNSAFE_ENTRY(jobject, Unsafe_AllocateInstance(JNIEnv *env, jobject unsafe, jclass cls)) { + JvmtiVMObjectAllocEventCollector oam; instanceOop i = InstanceKlass::allocate_instance(JNIHandles::resolve_non_null(cls), CHECK_NULL); return JNIHandles::make_local(THREAD, i); } UNSAFE_END diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 6c59d923699..84a8b6918d3 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -38,8 +38,6 @@ # ############################################################################# -vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java 8265795 generic-all -vmTestbase/nsk/jvmti/AttachOnDemand/attach022/TestDescription.java 8265795 generic-all vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java 8265796 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/VMObjectAllocTest.java b/test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/VMObjectAllocTest.java new file mode 100644 index 00000000000..42e50b4e45d --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/VMObjectAllocTest.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021, 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 + * @summary Verifies that a VMObjectAlloc event is generated for object created using MethodHandle + * @requires vm.jvmti + * @run main/othervm/native -agentlib:VMObjectAlloc VMObjectAllocTest + */ + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + +public class VMObjectAllocTest { + + private static native int getNumberOfAllocation(); + + public VMObjectAllocTest(String str) { + } + + public static void main(String[] args) throws Throwable { + + MethodHandles.Lookup publicLookup = MethodHandles.publicLookup(); + MethodType mt = MethodType.methodType(void.class, String.class); + MethodHandle mh = publicLookup.findConstructor(VMObjectAllocTest.class, mt); + mh.invoke("str"); + + if (getNumberOfAllocation() != 1) { + throw new Exception("Number of allocation != 1"); + } + } +} diff --git a/test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/libVMObjectAlloc.cpp b/test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/libVMObjectAlloc.cpp new file mode 100644 index 00000000000..fc5113f1aad --- /dev/null +++ b/test/hotspot/jtreg/serviceability/jvmti/VMObjectAlloc/libVMObjectAlloc.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2021, 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 "jvmti.h" + +extern "C" { + +static int number_of_allocation = 0; + +extern JNIEXPORT void JNICALL +VMObjectAlloc(jvmtiEnv *jvmti, + JNIEnv* jni, + jthread thread, + jobject object, + jclass cls, + jlong size) { + char *signature = NULL; + jvmtiError err = jvmti->GetClassSignature(cls, &signature, NULL); + if (err != JVMTI_ERROR_NONE) { + jni->FatalError("Failed during the GetClassSignature call"); + } + + printf("VMObjectAlloc called for %s\n", signature); + + if (!strcmp(signature, "LVMObjectAllocTest;")) { + number_of_allocation++; + } +} + + +JNIEXPORT jint JNICALL +Java_VMObjectAllocTest_getNumberOfAllocation(JNIEnv *env, jclass cls) { + return number_of_allocation; +} + +extern JNIEXPORT jint JNICALL +Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) { + jvmtiEnv *jvmti; + jvmtiEventCallbacks callbacks; + jvmtiError err; + jvmtiCapabilities caps; + + if (jvm->GetEnv((void **) &jvmti, JVMTI_VERSION) != JNI_OK) { + return JNI_ERR; + } + + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.VMObjectAlloc = &VMObjectAlloc; + memset(&caps, 0, sizeof(caps)); + caps.can_generate_vm_object_alloc_events = 1; + + err = jvmti->AddCapabilities( &caps); + if (err != JVMTI_ERROR_NONE) { + return JNI_ERR; + } + + err = jvmti->SetEventCallbacks(&callbacks, sizeof(jvmtiEventCallbacks)); + if (err != JVMTI_ERROR_NONE) { + return JNI_ERR; + } + + err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC , NULL); + if (err != JVMTI_ERROR_NONE) { + return JNI_ERR; + } + + return JNI_OK; +} + +} //extern "C" -- GitLab From e3911a8532e9b93ba5e65c613bd79864485db5ce Mon Sep 17 00:00:00 2001 From: Alexey Semenyuk Date: Mon, 22 Nov 2021 18:04:46 +0000 Subject: [PATCH 431/890] 8277429: Conflicting jpackage static library name Reviewed-by: almatvee, herrick, erikj --- make/modules/jdk.jpackage/Lib.gmk | 4 ++-- .../classes/jdk/jpackage/internal/LinuxAppImageBuilder.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/make/modules/jdk.jpackage/Lib.gmk b/make/modules/jdk.jpackage/Lib.gmk index aa955b97bee..9d118d950f5 100644 --- a/make/modules/jdk.jpackage/Lib.gmk +++ b/make/modules/jdk.jpackage/Lib.gmk @@ -92,9 +92,9 @@ ifeq ($(call isTargetOs, linux), true) JPACKAGE_LIBAPPLAUNCHER_INCLUDES := $(addprefix -I, $(JPACKAGE_LIBAPPLAUNCHER_SRC)) $(eval $(call SetupJdkLibrary, BUILD_JPACKAGE_LIBAPPLAUNCHER, \ - NAME := jpackageapplauncher, \ + NAME := jpackageapplauncheraux, \ OUTPUT_DIR := $(JPACKAGE_OUTPUT_DIR), \ - SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncher, \ + SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjpackageapplauncheraux, \ SRC := $(JPACKAGE_LIBAPPLAUNCHER_SRC), \ EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \ TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java index a12ed59c10e..7291d56218a 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java @@ -101,7 +101,7 @@ public class LinuxAppImageBuilder extends AbstractAppImageBuilder { private void createLauncherLib() throws IOException { Path path = appLayout.pathGroup().getPath( ApplicationLayout.PathRole.LINUX_APPLAUNCHER_LIB); - try (InputStream resource = getResourceAsStream("libjpackageapplauncher.so")) { + try (InputStream resource = getResourceAsStream("libjpackageapplauncheraux.so")) { writeEntry(resource, path); } -- GitLab From 6cf4cd1aa46414d9af17f3704b27d0d381a17ee8 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Mon, 22 Nov 2021 18:08:13 +0000 Subject: [PATCH 432/890] 8273341: Update Siphash to version 1.0 Reviewed-by: dholmes --- src/hotspot/share/classfile/altHashing.cpp | 33 +++++++++++++--------- src/hotspot/share/classfile/altHashing.hpp | 4 +-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/hotspot/share/classfile/altHashing.cpp b/src/hotspot/share/classfile/altHashing.cpp index d0672138668..98c5502fc1f 100644 --- a/src/hotspot/share/classfile/altHashing.cpp +++ b/src/hotspot/share/classfile/altHashing.cpp @@ -26,18 +26,23 @@ * halfsiphash code adapted from reference implementation * (https://github.com/veorq/SipHash/blob/master/halfsiphash.c) * which is distributed with the following copyright: - * - * SipHash reference C implementation - * - * Copyright (c) 2016 Jean-Philippe Aumasson - * - * To the extent possible under law, the author(s) have dedicated all copyright - * and related and neighboring rights to this software to the public domain - * worldwide. This software is distributed without any warranty. - * - * You should have received a copy of the CC0 Public Domain Dedication along - * with this software. If not, see - * . + */ + +/* + SipHash reference C implementation + + Copyright (c) 2012-2021 Jean-Philippe Aumasson + + Copyright (c) 2012-2014 Daniel J. Bernstein + + To the extent possible under law, the author(s) have dedicated all copyright + and related and neighboring rights to this software to the public domain + worldwide. This software is distributed without any warranty. + + You should have received a copy of the CC0 Public Domain Dedication along + with + this software. If not, see + . */ #include "precompiled.hpp" @@ -135,7 +140,9 @@ static uint64_t halfsiphash_finish64(uint32_t v[4], int rounds) { } // HalfSipHash-2-4 (32-bit output) for Symbols -uint32_t AltHashing::halfsiphash_32(uint64_t seed, const uint8_t* data, int len) { +uint32_t AltHashing::halfsiphash_32(uint64_t seed, const void* in, int len) { + + const unsigned char* data = (const unsigned char*)in; uint32_t v[4]; uint32_t newdata; int off = 0; diff --git a/src/hotspot/share/classfile/altHashing.hpp b/src/hotspot/share/classfile/altHashing.hpp index e1726ae5152..f2fc52410d1 100644 --- a/src/hotspot/share/classfile/altHashing.hpp +++ b/src/hotspot/share/classfile/altHashing.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -43,7 +43,7 @@ class AltHashing : AllStatic { static uint64_t compute_seed(); // For Symbols - static uint32_t halfsiphash_32(uint64_t seed, const uint8_t* data, int len); + static uint32_t halfsiphash_32(uint64_t seed, const void* in, int len); // For Strings static uint32_t halfsiphash_32(uint64_t seed, const uint16_t* data, int len); }; -- GitLab From 851a36247937d124e8217deaaa1a1831cba19b6e Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Mon, 22 Nov 2021 18:26:51 +0000 Subject: [PATCH 433/890] 8264297: Create implementation for NSAccessibilityProgressIndicator protocol peer Reviewed-by: pbansal --- .../awt/a11y/CommonComponentAccessibility.m | 3 +- .../awt/a11y/ProgressIndicatorAccessibility.h | 36 +++++++++++++++ .../awt/a11y/ProgressIndicatorAccessibility.m | 44 +++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.h create mode 100644 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.m diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m index 564355f82f6..201fe5c3591 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m @@ -122,7 +122,7 @@ static jobject sAccessibilityClass = NULL; /* * Here we should keep all the mapping between the accessibility roles and implementing classes */ - rolesMap = [[NSMutableDictionary alloc] initWithCapacity:50]; + rolesMap = [[NSMutableDictionary alloc] initWithCapacity:51]; [rolesMap setObject:@"ButtonAccessibility" forKey:@"pushbutton"]; [rolesMap setObject:@"ImageAccessibility" forKey:@"icon"]; @@ -156,6 +156,7 @@ static jobject sAccessibilityClass = NULL; [rolesMap setObject:@"MenuAccessibility" forKey:@"menu"]; [rolesMap setObject:@"MenuItemAccessibility" forKey:@"menuitem"]; [rolesMap setObject:@"MenuAccessibility" forKey:@"popupmenu"]; + [rolesMap setObject:@"ProgressIndicatorAccessibility" forKey:@"progressbar"]; /* * All the components below should be ignored by the accessibility subsystem, diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.h new file mode 100644 index 00000000000..e5b58ea3f8b --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "JavaComponentAccessibility.h" +#import "GroupAccessibility.h" + +#import + +@interface ProgressIndicatorAccessibility : GroupAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityValue; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.m new file mode 100644 index 00000000000..13ba383f166 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ProgressIndicatorAccessibility.m @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 "ProgressIndicatorAccessibility.h" + +/* + * Implementation of the accessibility peer for the NSProgressIndicator role. + * Main usage is JProgressBar + */ +@implementation ProgressIndicatorAccessibility + +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityProgressIndicatorRole; +} + +- (NSString * _Nullable)accessibilityValue +{ + return [super accessibilityValue]; +} + +@end -- GitLab From 1049aba1fb65fd70bd723c80a84250512a68d653 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Mon, 22 Nov 2021 19:03:30 +0000 Subject: [PATCH 434/890] 8277576: ProblemList runtime/ErrorHandling/CreateCoredumpOnCrash.java on macosx-X64 8277577: ProblemList compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java on linux-aarch64 8277578: ProblemList applications/jcstress/acqrel.java on linux-aarch64 Reviewed-by: mikael --- test/hotspot/jtreg/ProblemList.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 84a8b6918d3..afd66b1db74 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -75,6 +75,8 @@ compiler/whitebox/MakeMethodNotCompilableTest.java 8265360 macosx-aarch64 compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-x64 compiler/codecache/TestStressCodeBuffers.java 8272094 generic-aarch64 +compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java 8277503 linux-aarch64 + ############################################################################# @@ -90,6 +92,8 @@ gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8241293 macosx-x64 +applications/jcstress/acqrel.java 8277434 linux-aarch64 + ############################################################################# # :hotspot_runtime @@ -104,6 +108,7 @@ runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java 8277350 macosx-x64 +runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64 applications/jcstress/copy.java 8229852 linux-all -- GitLab From 05a9a51dbfc46eb52bc28f1f9a618c75ee2597e9 Mon Sep 17 00:00:00 2001 From: Dean Long Date: Mon, 22 Nov 2021 20:50:06 +0000 Subject: [PATCH 435/890] 8277423: ciReplay: hidden class with comment expected error Reviewed-by: chagedorn, thartmann --- src/hotspot/share/ci/ciEnv.cpp | 4 +++- src/hotspot/share/ci/ciInstanceKlass.cpp | 24 ++++++++++++++---------- src/hotspot/share/ci/ciInstanceKlass.hpp | 3 +++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 7fae95ae632..e29b56a3f27 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1654,9 +1654,11 @@ void ciEnv::dump_replay_data_helper(outputStream* out) { GrowableArray* objects = _factory->get_ci_metadata(); out->print_cr("# %d ciObject found", objects->length()); + // The very first entry is the InstanceKlass of the root method of the current compilation in order to get the right // protection domain to load subsequent classes during replay compilation. - out->print_cr("instanceKlass %s", CURRENT_ENV->replay_name(task()->method()->method_holder())); + ciInstanceKlass::dump_replay_instanceKlass(out, task()->method()->method_holder()); + for (int i = 0; i < objects->length(); i++) { objects->at(i)->dump_replay_data(out); } diff --git a/src/hotspot/share/ci/ciInstanceKlass.cpp b/src/hotspot/share/ci/ciInstanceKlass.cpp index 88c475d93d8..8b2806dbf9e 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.cpp +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp @@ -732,6 +732,19 @@ const char *ciInstanceKlass::replay_name() const { return CURRENT_ENV->replay_name(get_instanceKlass()); } +void ciInstanceKlass::dump_replay_instanceKlass(outputStream* out, InstanceKlass* ik) { + if (ik->is_hidden()) { + const char *name = CURRENT_ENV->dyno_name(ik); + if (name != NULL) { + out->print_cr("instanceKlass %s # %s", name, ik->name()->as_quoted_ascii()); + } else { + out->print_cr("# instanceKlass %s", ik->name()->as_quoted_ascii()); + } + } else { + out->print_cr("instanceKlass %s", ik->name()->as_quoted_ascii()); + } +} + void ciInstanceKlass::dump_replay_data(outputStream* out) { ResourceMark rm; @@ -743,16 +756,7 @@ void ciInstanceKlass::dump_replay_data(outputStream* out) { while (sub != NULL) { if (sub->is_instance_klass()) { InstanceKlass *isub = InstanceKlass::cast(sub); - if (isub->is_hidden()) { - const char *name = CURRENT_ENV->dyno_name(isub); - if (name != NULL) { - out->print_cr("instanceKlass %s # %s", name, sub->name()->as_quoted_ascii()); - } else { - out->print_cr("# instanceKlass %s", sub->name()->as_quoted_ascii()); - } - } else { - out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii()); - } + dump_replay_instanceKlass(out, isub); } sub = sub->next_sibling(); } diff --git a/src/hotspot/share/ci/ciInstanceKlass.hpp b/src/hotspot/share/ci/ciInstanceKlass.hpp index 3e79198eddb..9afee115488 100644 --- a/src/hotspot/share/ci/ciInstanceKlass.hpp +++ b/src/hotspot/share/ci/ciInstanceKlass.hpp @@ -293,6 +293,9 @@ public: // Dump the current state of this klass for compilation replay. virtual void dump_replay_data(outputStream* out); + static void dump_replay_instanceKlass(outputStream* out, InstanceKlass* ik); + + // Return stable class name suitable for replay file. const char *replay_name() const; -- GitLab From f62b81c3b5e34895e06bedec137bcef701d49df6 Mon Sep 17 00:00:00 2001 From: Dean Long Date: Mon, 22 Nov 2021 23:17:46 +0000 Subject: [PATCH 436/890] 8273095: vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java fails with "wrong OOME" Reviewed-by: shade, stefank --- test/hotspot/jtreg/ProblemList-Xcomp.txt | 2 -- .../vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-Xcomp.txt b/test/hotspot/jtreg/ProblemList-Xcomp.txt index 9647d4d2cf8..dab2ab3326f 100644 --- a/test/hotspot/jtreg/ProblemList-Xcomp.txt +++ b/test/hotspot/jtreg/ProblemList-Xcomp.txt @@ -35,8 +35,6 @@ vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java 8265295 lin vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java 8245680 windows-x64 -vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java 8273095 generic-all - serviceability/sa/TestJhsdbJstackMixed.java 8248675 linux-aarch64 compiler/codegen/aes/TestAESMain.java 8274323 linux-x64,windows-x64 diff --git a/test/hotspot/jtreg/vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java b/test/hotspot/jtreg/vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java index 9d0a25b00e4..ea59685dfd3 100644 --- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java +++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/hiddenloader/stress/oome/heap/Test.java @@ -63,7 +63,7 @@ public class Test extends MlvmOOMTest { @Override protected void checkOOME(OutOfMemoryError oome) { String message = oome.getMessage(); - if (!"Java heap space".equals(message)) { + if (!message.startsWith("Java heap space")) { throw new RuntimeException("TEST FAIL : wrong OOME", oome); } } -- GitLab From bb11c55dff86706a010c93ee2cc60c87bb2d53b6 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Tue, 23 Nov 2021 00:58:03 +0000 Subject: [PATCH 437/890] 8277542: G1: Move G1CardSetFreePool and related classes to separate files Reviewed-by: ayang, tschatzl --- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 163 +------------- src/hotspot/share/gc/g1/g1CardSetMemory.hpp | 95 +-------- .../share/gc/g1/g1SegmentedArrayFreePool.cpp | 200 ++++++++++++++++++ .../share/gc/g1/g1SegmentedArrayFreePool.hpp | 124 +++++++++++ 4 files changed, 326 insertions(+), 256 deletions(-) create mode 100644 src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp create mode 100644 src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index 988db3a4a8d..aba70b1efcd 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -24,11 +24,10 @@ #include "precompiled.hpp" +#include "gc/g1/g1CardSetContainers.inline.hpp" #include "gc/g1/g1CardSetMemory.inline.hpp" #include "gc/g1/g1SegmentedArray.inline.hpp" -#include "logging/log.hpp" #include "runtime/atomic.hpp" -#include "utilities/formatBuffer.hpp" #include "utilities/ostream.hpp" @@ -142,166 +141,6 @@ void G1CardSetAllocator::print(outputStream* os) { mem_size()); } -G1CardSetMemoryStats::G1CardSetMemoryStats() { - clear(); -} - -void G1CardSetMemoryStats::clear() { - for (uint i = 0; i < num_pools(); i++) { - _num_mem_sizes[i] = 0; - _num_buffers[i] = 0; - } -} - -void G1CardSetFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processor) { - uint num_free_lists = _freelist_pool.num_free_lists(); - - for (uint i = 0; i < num_free_lists; i++) { - unlink_processor->at(i)->visit_free_list(_freelist_pool.free_list(i)); - } -} - -void G1CardSetFreePool::G1ReturnMemoryProcessor::visit_free_list(G1CardSetBufferList* source) { - assert(_source == nullptr, "already visited"); - if (_return_to_vm_size > 0) { - _source = source; - } else { - assert(_source == nullptr, "must be"); - } - if (source->mem_size() > _return_to_vm_size) { - _first = source->get_all(_num_unlinked, _unlinked_bytes); - } else { - assert(_first == nullptr, "must be"); - } - // Above we were racing with other threads getting the contents of the free list, - // so while we might have been asked to return something to the OS initially, - // the free list might be empty anyway. In this case just reset internal values - // used for checking whether there is work available. - if (_first == nullptr) { - _source = nullptr; - _return_to_vm_size = 0; - } -} - -bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { - assert(!finished_return_to_vm(), "already returned everything to the VM"); - assert(_first != nullptr, "must have element to return"); - - size_t keep_size = 0; - size_t keep_num = 0; - - G1CardSetBuffer* cur = _first; - G1CardSetBuffer* last = nullptr; - - while (cur != nullptr && _return_to_vm_size > 0) { - size_t cur_size = cur->mem_size(); - _return_to_vm_size -= MIN2(_return_to_vm_size, cur_size); - - keep_size += cur_size; - keep_num++; - - last = cur; - cur = cur->next(); - // To ensure progress, perform the deadline check here. - if (os::elapsed_counter() > deadline) { - break; - } - } - - assert(_first != nullptr, "must be"); - assert(last != nullptr, "must be"); - - last->set_next(nullptr); - - // Wait for any in-progress pops to avoid ABA for them. - GlobalCounter::write_synchronize(); - _source->bulk_add(*_first, *last, keep_num, keep_size); - _first = cur; - - log_trace(gc, task)("Card Set Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size); - - // _return_to_vm_size may be larger than what is available in the list at the - // time we actually get the list. I.e. the list and _return_to_vm_size may be - // inconsistent. - // So also check if we actually already at the end of the list for the exit - // condition. - if (_return_to_vm_size == 0 || _first == nullptr) { - _source = nullptr; - _return_to_vm_size = 0; - } - return _source != nullptr; -} - -bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { - assert(finished_return_to_vm(), "not finished returning to VM"); - assert(!finished_return_to_os(), "already returned everything to the OS"); - - // Now delete the rest. - size_t num_delete = 0; - size_t mem_size_deleted = 0; - - while (_first != nullptr) { - G1CardSetBuffer* next = _first->next(); - num_delete++; - mem_size_deleted += _first->mem_size(); - delete _first; - _first = next; - - // To ensure progress, perform the deadline check here. - if (os::elapsed_counter() > deadline) { - break; - } - } - - log_trace(gc, task)("Card Set Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted); - - return _first != nullptr; -} - -G1CardSetFreePool G1CardSetFreePool::_freelist_pool(G1CardSetConfiguration::num_mem_object_types()); - -G1CardSetFreePool::G1CardSetFreePool(uint num_free_lists) : - _num_free_lists(num_free_lists) { - - _free_lists = NEW_C_HEAP_ARRAY(G1CardSetBufferList, _num_free_lists, mtGC); - for (uint i = 0; i < _num_free_lists; i++) { - new (&_free_lists[i]) G1CardSetBufferList(); - } -} - -G1CardSetFreePool::~G1CardSetFreePool() { - for (uint i = 0; i < _num_free_lists; i++) { - _free_lists[i].~G1CardSetBufferList(); - } - FREE_C_HEAP_ARRAY(mtGC, _free_lists); -} - -G1CardSetMemoryStats G1CardSetFreePool::memory_sizes() const { - G1CardSetMemoryStats free_list_stats; - assert(free_list_stats.num_pools() == num_free_lists(), "must be"); - for (uint i = 0; i < num_free_lists(); i++) { - free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size(); - free_list_stats._num_buffers[i] = _free_lists[i].num_buffers(); - } - return free_list_stats; -} - -size_t G1CardSetFreePool::mem_size() const { - size_t result = 0; - for (uint i = 0; i < _num_free_lists; i++) { - result += _free_lists[i].mem_size(); - } - return result; -} - -void G1CardSetFreePool::print_on(outputStream* out) { - out->print_cr(" Free Pool: size %zu", free_list_pool()->mem_size()); - for (uint i = 0; i < _num_free_lists; i++) { - FormatBuffer<> fmt(" %s", G1CardSetConfiguration::mem_object_type_name_str(i)); - _free_lists[i].print_on(out, fmt); - } -} - G1CardSetMemoryManager::G1CardSetMemoryManager(G1CardSetConfiguration* config, G1CardSetFreePool* free_list_pool) : _config(config) { diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp index 4167576f9bb..68b7b283542 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp @@ -27,8 +27,8 @@ #include "gc/g1/g1CardSet.hpp" #include "gc/g1/g1CardSetContainers.hpp" -#include "gc/g1/g1CardSetContainers.inline.hpp" #include "gc/g1/g1SegmentedArray.hpp" +#include "gc/g1/g1SegmentedArrayFreePool.hpp" #include "memory/allocation.hpp" #include "utilities/growableArray.hpp" #include "utilities/lockFreeStack.hpp" @@ -136,99 +136,6 @@ public: void print(outputStream* os); }; -// Statistics for a fixed set of buffer lists. Contains the number of buffers and memory -// used for each. Note that statistics are typically not taken atomically so there -// can be inconsistencies. The user must be prepared for them. -class G1CardSetMemoryStats { -public: - - size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()]; - size_t _num_buffers[G1CardSetConfiguration::num_mem_object_types()]; - - // Returns all-zero statistics. - G1CardSetMemoryStats(); - - void add(G1CardSetMemoryStats const other) { - STATIC_ASSERT(ARRAY_SIZE(_num_buffers) == ARRAY_SIZE(_num_mem_sizes)); - for (uint i = 0; i < ARRAY_SIZE(_num_mem_sizes); i++) { - _num_mem_sizes[i] += other._num_mem_sizes[i]; - _num_buffers[i] += other._num_buffers[i]; - } - } - - void clear(); - - uint num_pools() const { return G1CardSetConfiguration::num_mem_object_types(); } -}; - -// A set of free lists holding memory buffers for use by G1CardSetAllocators. -class G1CardSetFreePool { - // The global free pool. - static G1CardSetFreePool _freelist_pool; - - const uint _num_free_lists; - G1CardSetBufferList* _free_lists; - -public: - static G1CardSetFreePool* free_list_pool() { return &_freelist_pool; } - static G1CardSetMemoryStats free_list_sizes() { return _freelist_pool.memory_sizes(); } - - class G1ReturnMemoryProcessor; - typedef GrowableArrayCHeap G1ReturnMemoryProcessorSet; - - static void update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processors); - - explicit G1CardSetFreePool(uint num_free_lists); - ~G1CardSetFreePool(); - - G1CardSetBufferList* free_list(uint i) { - assert(i < _num_free_lists, "must be"); - return &_free_lists[i]; - } - - uint num_free_lists() const { return _num_free_lists; } - - G1CardSetMemoryStats memory_sizes() const; - size_t mem_size() const; - - void print_on(outputStream* out); -}; - -// Data structure containing current in-progress state for returning memory to the -// operating system for a single G1CardSetBufferList. -class G1CardSetFreePool::G1ReturnMemoryProcessor : public CHeapObj { - G1CardSetBufferList* _source; - size_t _return_to_vm_size; - - G1CardSetBuffer* _first; - size_t _unlinked_bytes; - size_t _num_unlinked; - -public: - explicit G1ReturnMemoryProcessor(size_t return_to_vm) : - _source(nullptr), _return_to_vm_size(return_to_vm), _first(nullptr), _unlinked_bytes(0), _num_unlinked(0) { - } - - // Updates the instance members about the given card set buffer list for the purpose - // of giving back memory. Only necessary members are updated, e.g. if there is - // nothing to return to the VM, do not set the source list. - void visit_free_list(G1CardSetBufferList* source); - - bool finished_return_to_vm() const { return _return_to_vm_size == 0; } - bool finished_return_to_os() const { return _first == nullptr; } - - // Returns memory to the VM until the given deadline expires. Returns true if - // there is no more work. Guarantees forward progress, i.e. at least one buffer - // has been processed after returning. - // return_to_vm() re-adds buffers to the respective free list. - bool return_to_vm(jlong deadline); - // Returns memory to the VM until the given deadline expires. Returns true if - // there is no more work. Guarantees forward progress, i.e. at least one buffer - // has been processed after returning. - // return_to_os() gives back buffers to the OS. - bool return_to_os(jlong deadline); -}; - class G1CardSetMemoryManager : public CHeapObj { G1CardSetConfiguration* _config; diff --git a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp new file mode 100644 index 00000000000..48ce124f00f --- /dev/null +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2021, 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/g1CardSetMemory.hpp" +#include "gc/g1/g1SegmentedArrayFreePool.hpp" +#include "gc/g1/g1SegmentedArray.inline.hpp" +#include "logging/log.hpp" +#include "memory/allocation.hpp" +#include "runtime/os.hpp" +#include "utilities/formatBuffer.hpp" +#include "utilities/ostream.hpp" + + +G1CardSetMemoryStats::G1CardSetMemoryStats() { + clear(); +} + +void G1CardSetMemoryStats::clear() { + for (uint i = 0; i < num_pools(); i++) { + _num_mem_sizes[i] = 0; + _num_buffers[i] = 0; + } +} + +void G1CardSetFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processor) { + uint num_free_lists = _freelist_pool.num_free_lists(); + + for (uint i = 0; i < num_free_lists; i++) { + unlink_processor->at(i)->visit_free_list(_freelist_pool.free_list(i)); + } +} + +void G1CardSetFreePool::G1ReturnMemoryProcessor::visit_free_list(G1CardSetBufferList* source) { + assert(_source == nullptr, "already visited"); + if (_return_to_vm_size > 0) { + _source = source; + } else { + assert(_source == nullptr, "must be"); + } + if (source->mem_size() > _return_to_vm_size) { + _first = source->get_all(_num_unlinked, _unlinked_bytes); + } else { + assert(_first == nullptr, "must be"); + } + // Above we were racing with other threads getting the contents of the free list, + // so while we might have been asked to return something to the OS initially, + // the free list might be empty anyway. In this case just reset internal values + // used for checking whether there is work available. + if (_first == nullptr) { + _source = nullptr; + _return_to_vm_size = 0; + } +} + +bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { + assert(!finished_return_to_vm(), "already returned everything to the VM"); + assert(_first != nullptr, "must have element to return"); + + size_t keep_size = 0; + size_t keep_num = 0; + + G1CardSetBuffer* cur = _first; + G1CardSetBuffer* last = nullptr; + + while (cur != nullptr && _return_to_vm_size > 0) { + size_t cur_size = cur->mem_size(); + _return_to_vm_size -= MIN2(_return_to_vm_size, cur_size); + + keep_size += cur_size; + keep_num++; + + last = cur; + cur = cur->next(); + // To ensure progress, perform the deadline check here. + if (os::elapsed_counter() > deadline) { + break; + } + } + + assert(_first != nullptr, "must be"); + assert(last != nullptr, "must be"); + + last->set_next(nullptr); + + // Wait for any in-progress pops to avoid ABA for them. + GlobalCounter::write_synchronize(); + _source->bulk_add(*_first, *last, keep_num, keep_size); + _first = cur; + + log_trace(gc, task)("Card Set Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size); + + // _return_to_vm_size may be larger than what is available in the list at the + // time we actually get the list. I.e. the list and _return_to_vm_size may be + // inconsistent. + // So also check if we actually already at the end of the list for the exit + // condition. + if (_return_to_vm_size == 0 || _first == nullptr) { + _source = nullptr; + _return_to_vm_size = 0; + } + return _source != nullptr; +} + +bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { + assert(finished_return_to_vm(), "not finished returning to VM"); + assert(!finished_return_to_os(), "already returned everything to the OS"); + + // Now delete the rest. + size_t num_delete = 0; + size_t mem_size_deleted = 0; + + while (_first != nullptr) { + G1CardSetBuffer* next = _first->next(); + num_delete++; + mem_size_deleted += _first->mem_size(); + delete _first; + _first = next; + + // To ensure progress, perform the deadline check here. + if (os::elapsed_counter() > deadline) { + break; + } + } + + log_trace(gc, task)("Card Set Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted); + + return _first != nullptr; +} + +G1CardSetFreePool G1CardSetFreePool::_freelist_pool(G1CardSetConfiguration::num_mem_object_types()); + +G1CardSetFreePool::G1CardSetFreePool(uint num_free_lists) : + _num_free_lists(num_free_lists) { + + _free_lists = NEW_C_HEAP_ARRAY(G1CardSetBufferList, _num_free_lists, mtGC); + for (uint i = 0; i < _num_free_lists; i++) { + new (&_free_lists[i]) G1CardSetBufferList(); + } +} + +G1CardSetFreePool::~G1CardSetFreePool() { + for (uint i = 0; i < _num_free_lists; i++) { + _free_lists[i].~G1CardSetBufferList(); + } + FREE_C_HEAP_ARRAY(mtGC, _free_lists); +} + +G1CardSetBufferList* G1CardSetFreePool::free_list(uint i) { + assert(i < _num_free_lists, "must be"); + return &_free_lists[i]; +} + +G1CardSetMemoryStats G1CardSetFreePool::memory_sizes() const { + G1CardSetMemoryStats free_list_stats; + assert(free_list_stats.num_pools() == num_free_lists(), "must be"); + for (uint i = 0; i < num_free_lists(); i++) { + free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size(); + free_list_stats._num_buffers[i] = _free_lists[i].num_buffers(); + } + return free_list_stats; +} + +size_t G1CardSetFreePool::mem_size() const { + size_t result = 0; + for (uint i = 0; i < _num_free_lists; i++) { + result += _free_lists[i].mem_size(); + } + return result; +} + +void G1CardSetFreePool::print_on(outputStream* out) { + out->print_cr(" Free Pool: size %zu", free_list_pool()->mem_size()); + for (uint i = 0; i < _num_free_lists; i++) { + FormatBuffer<> fmt(" %s", G1CardSetConfiguration::mem_object_type_name_str(i)); + _free_lists[i].print_on(out, fmt); + } +} diff --git a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp new file mode 100644 index 00000000000..917b9475c0b --- /dev/null +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021, 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_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP +#define SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP + +#include "gc/g1/g1CardSet.hpp" +#include "gc/g1/g1SegmentedArray.hpp" +#include "utilities/growableArray.hpp" + +// Statistics for a fixed set of buffer lists. Contains the number of buffers and memory +// used for each. Note that statistics are typically not taken atomically so there +// can be inconsistencies. The user must be prepared for them. +class G1CardSetMemoryStats { +public: + + size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()]; + size_t _num_buffers[G1CardSetConfiguration::num_mem_object_types()]; + + // Returns all-zero statistics. + G1CardSetMemoryStats(); + + void add(G1CardSetMemoryStats const other) { + STATIC_ASSERT(ARRAY_SIZE(_num_buffers) == ARRAY_SIZE(_num_mem_sizes)); + for (uint i = 0; i < ARRAY_SIZE(_num_mem_sizes); i++) { + _num_mem_sizes[i] += other._num_mem_sizes[i]; + _num_buffers[i] += other._num_buffers[i]; + } + } + + void clear(); + + uint num_pools() const { return G1CardSetConfiguration::num_mem_object_types(); } +}; + +typedef G1SegmentedArrayBuffer G1CardSetBuffer; +typedef G1SegmentedArrayBufferList G1CardSetBufferList; + +// A set of free lists holding memory buffers for use by G1CardSetAllocators. +class G1CardSetFreePool { + // The global free pool. + static G1CardSetFreePool _freelist_pool; + + const uint _num_free_lists; + G1CardSetBufferList* _free_lists; + +public: + static G1CardSetFreePool* free_list_pool() { return &_freelist_pool; } + static G1CardSetMemoryStats free_list_sizes() { return _freelist_pool.memory_sizes(); } + + class G1ReturnMemoryProcessor; + typedef GrowableArrayCHeap G1ReturnMemoryProcessorSet; + + static void update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processors); + + explicit G1CardSetFreePool(uint num_free_lists); + ~G1CardSetFreePool(); + + G1CardSetBufferList* free_list(uint i); + + uint num_free_lists() const { return _num_free_lists; } + + G1CardSetMemoryStats memory_sizes() const; + size_t mem_size() const; + + void print_on(outputStream* out); +}; + +// Data structure containing current in-progress state for returning memory to the +// operating system for a single G1CardSetBufferList. +class G1CardSetFreePool::G1ReturnMemoryProcessor : public CHeapObj { + G1CardSetBufferList* _source; + size_t _return_to_vm_size; + + G1CardSetBuffer* _first; + size_t _unlinked_bytes; + size_t _num_unlinked; + +public: + explicit G1ReturnMemoryProcessor(size_t return_to_vm) : + _source(nullptr), _return_to_vm_size(return_to_vm), _first(nullptr), _unlinked_bytes(0), _num_unlinked(0) { + } + + // Updates the instance members about the given card set buffer list for the purpose + // of giving back memory. Only necessary members are updated, e.g. if there is + // nothing to return to the VM, do not set the source list. + void visit_free_list(G1CardSetBufferList* source); + + bool finished_return_to_vm() const { return _return_to_vm_size == 0; } + bool finished_return_to_os() const { return _first == nullptr; } + + // Returns memory to the VM until the given deadline expires. Returns true if + // there is no more work. Guarantees forward progress, i.e. at least one buffer + // has been processed after returning. + // return_to_vm() re-adds buffers to the respective free list. + bool return_to_vm(jlong deadline); + // Returns memory to the VM until the given deadline expires. Returns true if + // there is no more work. Guarantees forward progress, i.e. at least one buffer + // has been processed after returning. + // return_to_os() gives back buffers to the OS. + bool return_to_os(jlong deadline); +}; + +#endif //SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP -- GitLab From 12f08ba4d47cb70a0629b17bc3639ce170309f21 Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Tue, 23 Nov 2021 08:19:16 +0000 Subject: [PATCH 438/890] 8277507: Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures Reviewed-by: almatvee --- .../tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java index 71561a51cf3..2d99bb273ba 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java @@ -133,6 +133,10 @@ public final class HelloApp { } void addTo(JPackageCommand cmd) { + // set jlink.debug system property to allow the jlink process + // to print exception stacktraces on any failure + cmd.addArgument("-J-Djlink.debug=true"); + final String moduleName = appDesc.moduleName(); final String qualifiedClassName = appDesc.className(); -- GitLab From e3243ee963d074c892a0ed16a00fd91b440c96ac Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 23 Nov 2021 08:57:34 +0000 Subject: [PATCH 439/890] 8277087: ZipException: zip END header not found at ZipFile#Source.findEND Reviewed-by: lancea --- .../java/util/zip/ZipOutputStream.java | 9 +- .../zip/ZipOutputStream/EmptyComment.java | 111 ++++++++++++++++++ 2 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 test/jdk/java/util/zip/ZipOutputStream/EmptyComment.java diff --git a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index c6dfa69536e..c43bcd38103 100644 --- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -144,11 +144,14 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant * ZIP file comment is greater than 0xFFFF bytes */ public void setComment(String comment) { + byte[] bytes = null; if (comment != null) { - this.comment = zc.getBytes(comment); - if (this.comment.length > 0xffff) - throw new IllegalArgumentException("ZIP file comment too long."); + bytes = zc.getBytes(comment); + if (bytes.length > 0xffff) { + throw new IllegalArgumentException("ZIP file comment too long"); + } } + this.comment = bytes; } /** diff --git a/test/jdk/java/util/zip/ZipOutputStream/EmptyComment.java b/test/jdk/java/util/zip/ZipOutputStream/EmptyComment.java new file mode 100644 index 00000000000..0f52844f3f6 --- /dev/null +++ b/test/jdk/java/util/zip/ZipOutputStream/EmptyComment.java @@ -0,0 +1,111 @@ +/* + * Copyright Amazon.com Inc. 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.ByteArrayOutputStream; +import java.util.function.Consumer; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertThrows; + +/** + * @test + * @bug 8277087 + * @summary Verifies various use cases when the zip comment should be empty + * @run testng EmptyComment + */ +public final class EmptyComment { + + @DataProvider() + Object[][] longLengths() { + return new Object[][]{{0xFFFF + 1}, {0xFFFF + 2}, {0xFFFF * 2}}; + } + + /** + * Overflow, the text is too long to be stored as a comment. + */ + @Test(dataProvider = "longLengths") + void testOverflow(int length) throws Exception { + test(zos -> assertThrows(IllegalArgumentException.class, () -> { + zos.setComment("X".repeat(length)); + })); + } + + /** + * Simple cases where the comment is set to the empty text. + */ + @Test + void testSimpleCases() throws Exception { + test(zos -> {/* do nothing */}); + test(zos -> zos.setComment(null)); + test(zos -> zos.setComment("")); + test(zos -> { + zos.setComment(""); + zos.setComment(null); + }); + test(zos -> { + zos.setComment(null); + zos.setComment(""); + }); + test(zos -> { + zos.setComment("Comment"); + zos.setComment(null); + }); + test(zos -> { + zos.setComment("Comment"); + zos.setComment(""); + }); + } + + private static void test(Consumer test) throws Exception { + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ZipOutputStream zos = new ZipOutputStream(baos)) { + + test.accept(zos); + + zos.putNextEntry(new ZipEntry("x")); + zos.finish(); + + byte[] data = baos.toByteArray(); + + if (data.length > 0xFFFF) { // just in case + throw new RuntimeException("data is too big: " + data.length); + } + int pk = data.length - ZipFile.ENDHDR; + if (data[pk] != 'P' || data[pk + 1] != 'K') { + throw new RuntimeException("PK is not found"); + } + // Since the comment is empty this will be two last bytes + int pos = data.length - ZipFile.ENDHDR + ZipFile.ENDCOM; + + int len = (data[pos] & 0xFF) + ((data[pos + 1] & 0xFF) << 8); + if (len != 0) { + throw new RuntimeException("zip comment is not empty: " + len); + } + } + } +} -- GitLab From 79350b9b4f42e43a8ab27ea76b9115dae6f448af Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Tue, 23 Nov 2021 09:15:20 +0000 Subject: [PATCH 440/890] 8276216: Negated character classes performance regression in Pattern Reviewed-by: clanger --- .../classes/java/util/regex/Pattern.java | 67 ++++++++++------- .../bench/java/util/regex/FindPattern.java | 71 +++++++++++++++++++ 2 files changed, 114 insertions(+), 24 deletions(-) create mode 100644 test/micro/org/openjdk/bench/java/util/regex/FindPattern.java diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java index 5b2533111f4..d52a2b92af9 100644 --- a/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/src/java.base/share/classes/java/util/regex/Pattern.java @@ -5605,50 +5605,69 @@ NEXT: while (i <= last) { } } + private static CharPredicate and(CharPredicate p1, CharPredicate p2, + boolean bmpChar) { + if (bmpChar) { + return (BmpCharPredicate)(ch -> p1.is(ch) && p2.is(ch)); + } else { + return (CharPredicate)(ch -> p1.is(ch) && p2.is(ch)); + } + } + + private static CharPredicate union(CharPredicate p1, CharPredicate p2, + boolean bmpChar) { + if (bmpChar) { + return (BmpCharPredicate)(ch -> p1.is(ch) || p2.is(ch)); + } else { + return (CharPredicate)(ch -> p1.is(ch) || p2.is(ch)); + } + } + + private static CharPredicate union(CharPredicate p1, CharPredicate p2, + CharPredicate p3, boolean bmpChar) { + if (bmpChar) { + return (BmpCharPredicate)(ch -> p1.is(ch) || p2.is(ch) || p3.is(ch)); + } else { + return (CharPredicate)(ch -> p1.is(ch) || p2.is(ch) || p3.is(ch)); + } + } + + private static CharPredicate negate(CharPredicate p1) { + return (CharPredicate)(ch -> !p1.is(ch)); + } + @FunctionalInterface static interface CharPredicate { boolean is(int ch); default CharPredicate and(CharPredicate p) { - return ch -> is(ch) && p.is(ch); + return Pattern.and(this, p, false); } default CharPredicate union(CharPredicate p) { - return ch -> is(ch) || p.is(ch); + return Pattern.union(this, p, false); } default CharPredicate union(CharPredicate p1, CharPredicate p2) { - return ch -> is(ch) || p1.is(ch) || p2.is(ch); + return Pattern.union(this, p1, p2, false); } default CharPredicate negate() { - return ch -> !is(ch); + return Pattern.negate(this); } } static interface BmpCharPredicate extends CharPredicate { default CharPredicate and(CharPredicate p) { - if (p instanceof BmpCharPredicate) - return (BmpCharPredicate)(ch -> is(ch) && p.is(ch)); - return ch -> is(ch) && p.is(ch); + return Pattern.and(this, p, p instanceof BmpCharPredicate); } default CharPredicate union(CharPredicate p) { - if (p instanceof BmpCharPredicate) - return (BmpCharPredicate)(ch -> is(ch) || p.is(ch)); - return ch -> is(ch) || p.is(ch); - } - static CharPredicate union(CharPredicate... predicates) { - CharPredicate cp = ch -> { - for (CharPredicate p : predicates) { - if (!p.is(ch)) - return false; - } - return true; - }; - for (CharPredicate p : predicates) { - if (! (p instanceof BmpCharPredicate)) - return cp; - } - return (BmpCharPredicate)cp; + return Pattern.union(this, p, p instanceof BmpCharPredicate); + } + default CharPredicate union(CharPredicate p1, + CharPredicate p2) { + return Pattern.union(this, p1, p2, + p1 instanceof BmpCharPredicate && + p2 instanceof BmpCharPredicate); } } diff --git a/test/micro/org/openjdk/bench/java/util/regex/FindPattern.java b/test/micro/org/openjdk/bench/java/util/regex/FindPattern.java new file mode 100644 index 00000000000..907a1616889 --- /dev/null +++ b/test/micro/org/openjdk/bench/java/util/regex/FindPattern.java @@ -0,0 +1,71 @@ +/* + * Copyright Amazon.com Inc. 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 org.openjdk.bench.java.util.regex; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +@State(Scope.Benchmark) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Fork(value=1, jvmArgs= {"-showversion", "-XX:+UseSerialGC"}) +@Warmup(iterations = 1, time = 10, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 10, timeUnit = TimeUnit.SECONDS) +public class FindPattern { + @Param({"[^A-Za-z0-9]", "[A-Za-z0-9]"}) + static String patternString; + @Param({"abcdefghijklmnop1234567890ABCDEFGHIJKLMNOP", + ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"}) + static String text; + static Pattern pattern; + + @Setup(Level.Trial) + public void setupTrial() { + pattern = Pattern.compile(patternString); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public int testFind() { + int counter = 0; + Matcher m = pattern.matcher(text); + while (m.find()) { + counter++; + } + return counter; + } +} -- GitLab From 017df140ba65058270c5184db82162d42e42b908 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 23 Nov 2021 10:56:15 +0000 Subject: [PATCH 441/890] 8277556: Call ReferenceProcessorPhaseTimes::set_processing_is_mt once Reviewed-by: sjohanss, tschatzl --- src/hotspot/share/gc/shared/referenceProcessor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index bf464c56204..b36d746486d 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -198,6 +198,8 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(RefPro update_soft_ref_master_clock(); + phase_times.set_processing_is_mt(processing_is_mt()); + { RefProcTotalPhaseTimesTracker tt(SoftWeakFinalRefsPhase, &phase_times); process_soft_weak_final_refs(proxy_task, phase_times); @@ -730,8 +732,6 @@ void ReferenceProcessor::process_soft_weak_final_refs(RefProcProxyTask& proxy_ta phase_times.set_ref_discovered(REF_WEAK, num_weak_refs); phase_times.set_ref_discovered(REF_FINAL, num_final_refs); - phase_times.set_processing_is_mt(processing_is_mt()); - if (num_total_refs == 0) { log_debug(gc, ref)("Skipped SoftWeakFinalRefsPhase of Reference Processing: no references"); return; @@ -764,7 +764,6 @@ void ReferenceProcessor::process_final_keep_alive(RefProcProxyTask& proxy_task, ReferenceProcessorPhaseTimes& phase_times) { size_t const num_final_refs = total_count(_discoveredFinalRefs); - phase_times.set_processing_is_mt(processing_is_mt()); if (num_final_refs == 0) { log_debug(gc, ref)("Skipped KeepAliveFinalRefsPhase of Reference Processing: no references"); @@ -791,7 +790,6 @@ void ReferenceProcessor::process_phantom_refs(RefProcProxyTask& proxy_task, size_t const num_phantom_refs = total_count(_discoveredPhantomRefs); phase_times.set_ref_discovered(REF_PHANTOM, num_phantom_refs); - phase_times.set_processing_is_mt(processing_is_mt()); if (num_phantom_refs == 0) { log_debug(gc, ref)("Skipped PhantomRefsPhase of Reference Processing: no references"); -- GitLab From 36b887a885c76ddbbb1e21b32b8e7d9cc92f6ce2 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 23 Nov 2021 10:57:29 +0000 Subject: [PATCH 442/890] 8277560: Remove WorkerDataArray::_is_serial Reviewed-by: sjohanss, tschatzl --- .../share/gc/shared/workerDataArray.cpp | 10 ---- .../share/gc/shared/workerDataArray.hpp | 4 +- .../gc/shared/workerDataArray.inline.hpp | 48 ++++++++----------- 3 files changed, 20 insertions(+), 42 deletions(-) diff --git a/src/hotspot/share/gc/shared/workerDataArray.cpp b/src/hotspot/share/gc/shared/workerDataArray.cpp index b7140662210..53f337560d3 100644 --- a/src/hotspot/share/gc/shared/workerDataArray.cpp +++ b/src/hotspot/share/gc/shared/workerDataArray.cpp @@ -36,16 +36,6 @@ double WorkerDataArray::uninitialized() { return -1.0; } -template <> -void WorkerDataArray::WDAPrinter::summary(outputStream* out, double time) { - out->print_cr(" %.1lfms", time * MILLIUNITS); -} - -template <> -void WorkerDataArray::WDAPrinter::summary(outputStream* out, size_t value) { - out->print_cr(" " SIZE_FORMAT, value); -} - template <> void WorkerDataArray::WDAPrinter::summary(outputStream* out, double min, double avg, double max, double diff, double sum, bool print_sum) { out->print(" Min: %4.1lf, Avg: %4.1lf, Max: %4.1lf, Diff: %4.1lf", min * MILLIUNITS, avg * MILLIUNITS, max * MILLIUNITS, diff* MILLIUNITS); diff --git a/src/hotspot/share/gc/shared/workerDataArray.hpp b/src/hotspot/share/gc/shared/workerDataArray.hpp index 8908afbc8f9..b2a81bc9482 100644 --- a/src/hotspot/share/gc/shared/workerDataArray.hpp +++ b/src/hotspot/share/gc/shared/workerDataArray.hpp @@ -46,7 +46,7 @@ private: WorkerDataArray* _thread_work_items[MaxThreadWorkItems]; public: - WorkerDataArray(const char* short_name, const char* title, uint length, bool is_serial = false); + WorkerDataArray(const char* short_name, const char* title, uint length); ~WorkerDataArray(); // Create an integer sub-item at the given index to this WorkerDataArray. If length_override @@ -91,9 +91,7 @@ private: private: class WDAPrinter { public: - static void summary(outputStream* out, double time); static void summary(outputStream* out, double min, double avg, double max, double diff, double sum, bool print_sum); - static void summary(outputStream* out, size_t value); static void summary(outputStream* out, size_t min, double avg, size_t max, size_t diff, size_t sum, bool print_sum); static void details(const WorkerDataArray* phase, outputStream* out); diff --git a/src/hotspot/share/gc/shared/workerDataArray.inline.hpp b/src/hotspot/share/gc/shared/workerDataArray.inline.hpp index 3deb734f20d..283fb97af8d 100644 --- a/src/hotspot/share/gc/shared/workerDataArray.inline.hpp +++ b/src/hotspot/share/gc/shared/workerDataArray.inline.hpp @@ -31,14 +31,12 @@ #include "utilities/ostream.hpp" template -WorkerDataArray::WorkerDataArray(const char* short_name, const char* title, uint length, bool is_serial) : +WorkerDataArray::WorkerDataArray(const char* short_name, const char* title, uint length) : _data(NULL), _length(length), _short_name(short_name), - _title(title), - _is_serial(is_serial) { + _title(title) { assert(length > 0, "Must have some workers to store data for"); - assert(!is_serial || length == 1, "Serial phase must only have a single entry."); _data = NEW_C_HEAP_ARRAY(T, _length, mtGC); for (uint i = 0; i < MaxThreadWorkItems; i++) { _thread_work_items[i] = NULL; @@ -158,39 +156,31 @@ void WorkerDataArray::set_all(T value) { template void WorkerDataArray::print_summary_on(outputStream* out, bool print_sum) const { - if (_is_serial) { - out->print("%s:", title()); - } else { - out->print("%-30s", title()); - } + out->print("%-30s", title()); uint start = 0; while (start < _length && get(start) == uninitialized()) { start++; } if (start < _length) { - if (_is_serial) { - WDAPrinter::summary(out, get(0)); - } else { - T min = get(start); - T max = min; - T sum = 0; - uint contributing_threads = 0; - for (uint i = start; i < _length; ++i) { - T value = get(i); - if (value != uninitialized()) { - max = MAX2(max, value); - min = MIN2(min, value); - sum += value; - contributing_threads++; - } + T min = get(start); + T max = min; + T sum = 0; + uint contributing_threads = 0; + for (uint i = start; i < _length; ++i) { + T value = get(i); + if (value != uninitialized()) { + max = MAX2(max, value); + min = MIN2(min, value); + sum += value; + contributing_threads++; } - T diff = max - min; - assert(contributing_threads != 0, "Must be since we found a used value for the start index"); - double avg = sum / (double) contributing_threads; - WDAPrinter::summary(out, min, avg, max, diff, sum, print_sum); - out->print_cr(", Workers: %d", contributing_threads); } + T diff = max - min; + assert(contributing_threads != 0, "Must be since we found a used value for the start index"); + double avg = sum / (double) contributing_threads; + WDAPrinter::summary(out, min, avg, max, diff, sum, print_sum); + out->print_cr(", Workers: %d", contributing_threads); } else { // No data for this phase. out->print_cr(" skipped"); -- GitLab From 66eaf6526126eb27c18acc64c2bb0791142815c9 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 23 Nov 2021 12:33:13 +0000 Subject: [PATCH 443/890] 8277413: Remove unused local variables in jdk.hotspot.agent Reviewed-by: lmesnik, tschatzl, sspitsyn --- .../classes/sun/jvm/hotspot/CommandProcessor.java | 6 +----- .../share/classes/sun/jvm/hotspot/HSDB.java | 2 -- .../sun/jvm/hotspot/HotSpotTypeDataBase.java | 3 +-- .../classes/sun/jvm/hotspot/code/NMethod.java | 3 +-- .../classes/sun/jvm/hotspot/code/StubQueue.java | 4 +--- .../debugger/windbg/WindbgCDebugInfoBuilder.java | 3 +-- .../sun/jvm/hotspot/oops/GenerateOopMap.java | 15 +++++++-------- .../hotspot/ui/classbrowser/HTMLGenerator.java | 2 -- 8 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java index 57098643e6a..d02909aaea3 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java @@ -52,7 +52,6 @@ import sun.jvm.hotspot.debugger.Address; import sun.jvm.hotspot.debugger.OopHandle; import sun.jvm.hotspot.classfile.ClassLoaderDataGraph; import sun.jvm.hotspot.memory.FileMapInfo; -import sun.jvm.hotspot.memory.SystemDictionary; import sun.jvm.hotspot.memory.Universe; import sun.jvm.hotspot.gc.shared.CollectedHeap; import sun.jvm.hotspot.gc.g1.G1CollectedHeap; @@ -94,11 +93,9 @@ import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter; import sun.jvm.hotspot.ui.tree.SimpleTreeNode; import sun.jvm.hotspot.utilities.AddressOps; import sun.jvm.hotspot.utilities.Assert; -import sun.jvm.hotspot.utilities.CompactHashTable; import sun.jvm.hotspot.utilities.HeapProgressThunk; import sun.jvm.hotspot.utilities.LivenessPathElement; import sun.jvm.hotspot.utilities.MethodArray; -import sun.jvm.hotspot.utilities.ObjectReader; import sun.jvm.hotspot.utilities.PointerFinder; import sun.jvm.hotspot.utilities.PointerLocation; import sun.jvm.hotspot.utilities.ReversePtrs; @@ -132,7 +129,7 @@ public class CommandProcessor { if (kls.getClassLoader() == null) return false; if (emitted.get(kls.getName()) != null) { // Since multiple class loaders are being shoved - // together duplicate classes are a possibilty. For + // together duplicate classes are a possibility. For // now just ignore them. return false; } @@ -436,7 +433,6 @@ public class CommandProcessor { Matcher m2 = args2.matcher(arg); Address start = null; Address end = null; - String format = ""; int formatSize = (int)VM.getVM().getAddressSize(); if (m1.matches()) { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java index 973fd6c3d0b..c530cb67b35 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java @@ -40,7 +40,6 @@ import sun.jvm.hotspot.gc.shenandoah.*; import sun.jvm.hotspot.gc.g1.*; import sun.jvm.hotspot.gc.z.*; import sun.jvm.hotspot.interpreter.*; -import sun.jvm.hotspot.memory.*; import sun.jvm.hotspot.oops.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.ui.*; @@ -1737,7 +1736,6 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { String progressBarText, HeapVisitor visitor, CleanupThunk cleanup) { - sun.jvm.hotspot.oops.ObjectHistogram histo = new sun.jvm.hotspot.oops.ObjectHistogram(); HeapProgress progress = new HeapProgress(frameTitle, progressBarText, cleanup); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java index c4c5f43a76c..573e1968cb4 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -426,7 +426,6 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase { boolean isStatic = false; long offset = 0; Address staticFieldAddr = null; - long size = 0; long index = 0; String opaqueName = ""; lookupOrCreateClass(opaqueName, false, false, false); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java index 83b5535ea11..acbd3f90974 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -350,7 +350,6 @@ public class NMethod extends CompiledMethod { // Take giant steps at first (4096, then 256, then 16, then 1) int LOG2_RADIX = 4; - int RADIX = (1 << LOG2_RADIX); Address mid; for (int step = (1 << (LOG2_RADIX*3)); step > 1; step >>= LOG2_RADIX) { while ((mid = lower.addOffsetTo(step * pcDescSize)).lessThan(upper)) { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java index ba8501d1e25..d59971b33ec 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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,7 +24,6 @@ package sun.jvm.hotspot.code; -import java.util.*; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.types.*; @@ -88,7 +87,6 @@ public class StubQueue extends VMObject { public Stub getStubContaining(Address pc) { if (contains(pc)) { - int i = 0; for (Stub s = getFirst(); s != null; s = getNext(s)) { if (stubContains(s, pc)) { return s; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java index f70c8c6e0cc..80b352183e4 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -417,7 +417,6 @@ class WindbgCDebugInfoBuilder // and UDT references to understand how to build the global // database vs. the module-by-module one) DebugVC50SubsectionDirectory dir = vc50.getSubsectionDirectory(); - int moduleNumber = 0; // Debugging for (int i = 0; i < dir.getNumEntries(); i++) { DebugVC50Subsection ss = dir.getSubsection(i); int ssType = ss.getSubsectionType(); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java index 403b454f093..f5b9a821400 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -310,10 +310,10 @@ public class GenerateOopMap { int _max_stack; // Cached value of max. stack depth int _max_monitors; // Cached value of max. monitor stack depth boolean _has_exceptions; // True, if exceptions exist for method - boolean _got_error; // True, if an error occured during interpretation. + boolean _got_error; // True, if an error occurred during interpretation. String _error_msg; // Error message. Set if _got_error is true. // bool _did_rewriting; // was bytecodes rewritten - // bool _did_relocation; // was relocation neccessary + // bool _did_relocation; // was relocation necessary boolean _monitor_safe; // The monitors in this method have been determined // to be safe. @@ -529,7 +529,6 @@ public class GenerateOopMap { CellTypeState replace) { int i; int len = _max_locals + _stack_top; - boolean change = false; for (i = len - 1; i >= 0; i--) { if (match.equal(_state.get(i))) { @@ -1894,7 +1893,7 @@ public class GenerateOopMap { // Create result set boolean _report_result; - boolean _report_result_for_send; // Unfortunatly, stackmaps for sends are special, so we need some extra + boolean _report_result_for_send; // Unfortunately, stackmaps for sends are special, so we need some extra BytecodeStream _itr_send; // variables to handle them properly. void reportResult () { @@ -1947,7 +1946,7 @@ public class GenerateOopMap { } // Conflicts rewrite logic - boolean _conflict; // True, if a conflict occured during interpretation + boolean _conflict; // True, if a conflict occurred during interpretation int _nof_refval_conflicts; // No. of conflicts that require rewrites int[] _new_var_map; @@ -2131,7 +2130,7 @@ public class GenerateOopMap { // Public routines for GenerateOopMap // public GenerateOopMap(Method method) { - // We have to initialize all variables here, that can be queried direcly + // We have to initialize all variables here, that can be queried directly _method = method; _max_locals=0; _init_vars = null; @@ -2204,7 +2203,7 @@ public class GenerateOopMap { if (_got_error) { // We could expand this code to throw somekind of exception (e.g., VerifyException). However, - // an exception thrown in this part of the code is likly to mean that we are executing some + // an exception thrown in this part of the code is likely to mean that we are executing some // illegal bytecodes (that the verifier should have caught if turned on), so we will just exit // with a fatal. throw new RuntimeException("Illegal bytecode sequence encountered while generating interpreter pointer maps - method should be rejected by verifier."); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java index a6823cf1160..118c515b6c6 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java @@ -1281,8 +1281,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants { if (w == Location.Where.ON_STACK) { buf.append("stack[" + loc.getStackOffset() + "]"); } else if (w == Location.Where.IN_REGISTER) { - boolean isFloat = (type == Location.Type.FLOAT_IN_DBL || - type == Location.Type.DBL); int regNum = loc.getRegisterNumber(); VMReg vmReg = new VMReg(regNum); buf.append(VMRegImpl.getRegisterName(vmReg.getValue())); -- GitLab From 90f96fb4db174e50cc2510f292fe69fc995add26 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Tue, 23 Nov 2021 12:46:15 +0000 Subject: [PATCH 444/890] 8277441: CompileQueue::add fails with assert(_last->next() == __null) failed: not last Reviewed-by: chagedorn, neliasso --- src/hotspot/share/compiler/compileBroker.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index fbb295b4c4d..eab2751c3b0 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -411,6 +411,7 @@ void CompileQueue::free_all() { CompileTask::free(current); } _first = NULL; + _last = NULL; // Wake up all threads that block on the queue. MethodCompileQueue_lock->notify_all(); -- GitLab From f4dc03ea6de327425ff265c3d2ec16ea7b0e1634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Tue, 23 Nov 2021 14:34:21 +0000 Subject: [PATCH 445/890] 8276696: ParallelObjectIterator freed at the wrong time in VM_HeapDumper Reviewed-by: pliden, stefank --- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 4 ++-- src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 2 +- .../gc/parallel/parallelScavengeHeap.cpp | 4 ++-- .../gc/parallel/parallelScavengeHeap.hpp | 2 +- src/hotspot/share/gc/shared/collectedHeap.cpp | 12 ++++++++++ src/hotspot/share/gc/shared/collectedHeap.hpp | 22 ++++++++++++++++--- .../share/gc/shenandoah/shenandoahHeap.cpp | 4 ++-- .../share/gc/shenandoah/shenandoahHeap.hpp | 2 +- src/hotspot/share/gc/z/zCollectedHeap.cpp | 2 +- src/hotspot/share/gc/z/zCollectedHeap.hpp | 2 +- src/hotspot/share/gc/z/zHeap.cpp | 2 +- src/hotspot/share/gc/z/zHeap.hpp | 2 +- src/hotspot/share/gc/z/zHeapIterator.hpp | 2 +- src/hotspot/share/memory/heapInspection.cpp | 18 +++++---------- src/hotspot/share/services/heapDumper.cpp | 14 +++++++----- 15 files changed, 59 insertions(+), 35 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 62bae602b0a..86b92a6206f 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -2260,7 +2260,7 @@ void G1CollectedHeap::object_iterate(ObjectClosure* cl) { heap_region_iterate(&blk); } -class G1ParallelObjectIterator : public ParallelObjectIterator { +class G1ParallelObjectIterator : public ParallelObjectIteratorImpl { private: G1CollectedHeap* _heap; HeapRegionClaimer _claimer; @@ -2275,7 +2275,7 @@ public: } }; -ParallelObjectIterator* G1CollectedHeap::parallel_object_iterator(uint thread_num) { +ParallelObjectIteratorImpl* G1CollectedHeap::parallel_object_iterator(uint thread_num) { return new G1ParallelObjectIterator(thread_num); } diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index 2178dfc9d0f..8f86e4d7abe 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -1077,7 +1077,7 @@ public: // Iterate over all objects, calling "cl.do_object" on each. void object_iterate(ObjectClosure* cl) override; - ParallelObjectIterator* parallel_object_iterator(uint thread_num) override; + ParallelObjectIteratorImpl* parallel_object_iterator(uint thread_num) override; // Keep alive an object that was loaded with AS_NO_KEEPALIVE. void keep_alive(oop obj) override; diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp index 0013007a923..d0c1f29bd97 100644 --- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp +++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp @@ -600,7 +600,7 @@ void ParallelScavengeHeap::object_iterate_parallel(ObjectClosure* cl, } } -class PSScavengeParallelObjectIterator : public ParallelObjectIterator { +class PSScavengeParallelObjectIterator : public ParallelObjectIteratorImpl { private: ParallelScavengeHeap* _heap; HeapBlockClaimer _claimer; @@ -615,7 +615,7 @@ public: } }; -ParallelObjectIterator* ParallelScavengeHeap::parallel_object_iterator(uint thread_num) { +ParallelObjectIteratorImpl* ParallelScavengeHeap::parallel_object_iterator(uint thread_num) { return new PSScavengeParallelObjectIterator(); } diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp index 9d8368fc3a4..0a81c0b1315 100644 --- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp +++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp @@ -231,7 +231,7 @@ class ParallelScavengeHeap : public CollectedHeap { void object_iterate(ObjectClosure* cl); void object_iterate_parallel(ObjectClosure* cl, HeapBlockClaimer* claimer); - virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num); + virtual ParallelObjectIteratorImpl* parallel_object_iterator(uint thread_num); HeapWord* block_start(const void* addr) const; bool block_is_obj(const HeapWord* addr) const; diff --git a/src/hotspot/share/gc/shared/collectedHeap.cpp b/src/hotspot/share/gc/shared/collectedHeap.cpp index 96b3eb94681..e33d464764c 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.cpp +++ b/src/hotspot/share/gc/shared/collectedHeap.cpp @@ -110,6 +110,18 @@ void GCHeapLog::log_heap(CollectedHeap* heap, bool before) { st.print_cr("}"); } +ParallelObjectIterator::ParallelObjectIterator(uint thread_num) : + _impl(Universe::heap()->parallel_object_iterator(thread_num)) +{} + +ParallelObjectIterator::~ParallelObjectIterator() { + delete _impl; +} + +void ParallelObjectIterator::object_iterate(ObjectClosure* cl, uint worker_id) { + _impl->object_iterate(cl, worker_id); +} + size_t CollectedHeap::unused() const { MutexLocker ml(Heap_lock); return capacity() - used(); diff --git a/src/hotspot/share/gc/shared/collectedHeap.hpp b/src/hotspot/share/gc/shared/collectedHeap.hpp index 4418a9d31ef..681a832982b 100644 --- a/src/hotspot/share/gc/shared/collectedHeap.hpp +++ b/src/hotspot/share/gc/shared/collectedHeap.hpp @@ -62,10 +62,23 @@ class VirtualSpaceSummary; class WorkerThreads; class nmethod; -class ParallelObjectIterator : public CHeapObj { +class ParallelObjectIteratorImpl : public CHeapObj { public: + virtual ~ParallelObjectIteratorImpl() {} virtual void object_iterate(ObjectClosure* cl, uint worker_id) = 0; - virtual ~ParallelObjectIterator() {} +}; + +// User facing parallel object iterator. This is a StackObj, which ensures that +// the _impl is allocated and deleted in the scope of this object. This ensures +// the life cycle of the implementation is as required by ThreadsListHandle, +// which is sometimes used by the root iterators. +class ParallelObjectIterator : public StackObj { + ParallelObjectIteratorImpl* _impl; + +public: + ParallelObjectIterator(uint thread_num); + ~ParallelObjectIterator(); + void object_iterate(ObjectClosure* cl, uint worker_id); }; // @@ -82,6 +95,7 @@ class CollectedHeap : public CHeapObj { friend class JVMCIVMStructs; friend class IsGCActiveMark; // Block structured external access to _is_gc_active friend class MemAllocator; + friend class ParallelObjectIterator; private: GCHeapLog* _gc_heap_log; @@ -384,10 +398,12 @@ class CollectedHeap : public CHeapObj { // Iterate over all objects, calling "cl.do_object" on each. virtual void object_iterate(ObjectClosure* cl) = 0; - virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num) { + protected: + virtual ParallelObjectIteratorImpl* parallel_object_iterator(uint thread_num) { return NULL; } + public: // Keep alive an object that was loaded with AS_NO_KEEPALIVE. virtual void keep_alive(oop obj) {} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index 7cd9a61b29f..8cbcc86172b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -1366,7 +1366,7 @@ public: // parallel marking queues. // Every worker processes it's own marking queue. work-stealing is used // to balance workload. -class ShenandoahParallelObjectIterator : public ParallelObjectIterator { +class ShenandoahParallelObjectIterator : public ParallelObjectIteratorImpl { private: uint _num_workers; bool _init_ready; @@ -1465,7 +1465,7 @@ private: } }; -ParallelObjectIterator* ShenandoahHeap::parallel_object_iterator(uint workers) { +ParallelObjectIteratorImpl* ShenandoahHeap::parallel_object_iterator(uint workers) { return new ShenandoahParallelObjectIterator(workers, &_aux_bit_map); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp index 79afeb37ab5..1ec9d7051cf 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp @@ -484,7 +484,7 @@ public: // Used for native heap walkers: heap dumpers, mostly void object_iterate(ObjectClosure* cl); // Parallel heap iteration support - virtual ParallelObjectIterator* parallel_object_iterator(uint workers); + virtual ParallelObjectIteratorImpl* parallel_object_iterator(uint workers); // Keep alive an object that was loaded with AS_NO_KEEPALIVE. void keep_alive(oop obj); diff --git a/src/hotspot/share/gc/z/zCollectedHeap.cpp b/src/hotspot/share/gc/z/zCollectedHeap.cpp index 1d099122315..ea883450da0 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.cpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.cpp @@ -226,7 +226,7 @@ void ZCollectedHeap::object_iterate(ObjectClosure* cl) { _heap.object_iterate(cl, true /* visit_weaks */); } -ParallelObjectIterator* ZCollectedHeap::parallel_object_iterator(uint nworkers) { +ParallelObjectIteratorImpl* ZCollectedHeap::parallel_object_iterator(uint nworkers) { return _heap.parallel_object_iterator(nworkers, true /* visit_weaks */); } diff --git a/src/hotspot/share/gc/z/zCollectedHeap.hpp b/src/hotspot/share/gc/z/zCollectedHeap.hpp index 236609361d0..12f6902a025 100644 --- a/src/hotspot/share/gc/z/zCollectedHeap.hpp +++ b/src/hotspot/share/gc/z/zCollectedHeap.hpp @@ -95,7 +95,7 @@ public: virtual GrowableArray memory_pools(); virtual void object_iterate(ObjectClosure* cl); - virtual ParallelObjectIterator* parallel_object_iterator(uint nworkers); + virtual ParallelObjectIteratorImpl* parallel_object_iterator(uint nworkers); virtual void keep_alive(oop obj); diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp index 3bf3cf50ed8..b937a645f62 100644 --- a/src/hotspot/share/gc/z/zHeap.cpp +++ b/src/hotspot/share/gc/z/zHeap.cpp @@ -439,7 +439,7 @@ void ZHeap::object_iterate(ObjectClosure* cl, bool visit_weaks) { iter.object_iterate(cl, 0 /* worker_id */); } -ParallelObjectIterator* ZHeap::parallel_object_iterator(uint nworkers, bool visit_weaks) { +ParallelObjectIteratorImpl* ZHeap::parallel_object_iterator(uint nworkers, bool visit_weaks) { assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); return new ZHeapIterator(nworkers, visit_weaks); } diff --git a/src/hotspot/share/gc/z/zHeap.hpp b/src/hotspot/share/gc/z/zHeap.hpp index f4e36ad738e..723ec52d39c 100644 --- a/src/hotspot/share/gc/z/zHeap.hpp +++ b/src/hotspot/share/gc/z/zHeap.hpp @@ -141,7 +141,7 @@ public: // Iteration void object_iterate(ObjectClosure* cl, bool visit_weaks); - ParallelObjectIterator* parallel_object_iterator(uint nworkers, bool visit_weaks); + ParallelObjectIteratorImpl* parallel_object_iterator(uint nworkers, bool visit_weaks); void pages_do(ZPageClosure* cl); // Serviceability diff --git a/src/hotspot/share/gc/z/zHeapIterator.hpp b/src/hotspot/share/gc/z/zHeapIterator.hpp index bbd3eb203c3..5c3a82d8bb7 100644 --- a/src/hotspot/share/gc/z/zHeapIterator.hpp +++ b/src/hotspot/share/gc/z/zHeapIterator.hpp @@ -42,7 +42,7 @@ using ZHeapIteratorQueues = GenericTaskQueueSet; using ZHeapIteratorArrayQueue = OverflowTaskQueue; using ZHeapIteratorArrayQueues = GenericTaskQueueSet; -class ZHeapIterator : public ParallelObjectIterator { +class ZHeapIterator : public ParallelObjectIteratorImpl { friend class ZHeapIteratorContext; private: diff --git a/src/hotspot/share/memory/heapInspection.cpp b/src/hotspot/share/memory/heapInspection.cpp index b4dd596b50f..da5a793cb91 100644 --- a/src/hotspot/share/memory/heapInspection.cpp +++ b/src/hotspot/share/memory/heapInspection.cpp @@ -578,18 +578,12 @@ uintx HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *fil const uint capped_parallel_thread_num = MIN2(parallel_thread_num, workers->max_workers()); WithActiveWorkers with_active_workers(workers, capped_parallel_thread_num); - ParallelObjectIterator* poi = Universe::heap()->parallel_object_iterator(workers->active_workers()); - if (poi != NULL) { - // The GC supports parallel object iteration. - - ParHeapInspectTask task(poi, cit, filter); - // Run task with the active workers. - workers->run_task(&task); - - delete poi; - if (task.success()) { - return task.missed_count(); - } + ParallelObjectIterator poi(workers->active_workers()); + ParHeapInspectTask task(&poi, cit, filter); + // Run task with the active workers. + workers->run_task(&task); + if (task.success()) { + return task.missed_count(); } } } diff --git a/src/hotspot/share/services/heapDumper.cpp b/src/hotspot/share/services/heapDumper.cpp index c3c939c06d0..b14e1223943 100644 --- a/src/hotspot/share/services/heapDumper.cpp +++ b/src/hotspot/share/services/heapDumper.cpp @@ -1910,7 +1910,6 @@ class VM_HeapDumper : public VM_GC_Operation, public WorkerTask { // Number of dumper threads that only iterate heap. uint _heap_only_dumper_threads = _num_dumper_threads - 1 /* VMDumper thread */; _dumper_controller = new (std::nothrow) DumperController(_heap_only_dumper_threads); - _poi = Universe::heap()->parallel_object_iterator(_num_dumper_threads); } } @@ -1999,10 +1998,6 @@ class VM_HeapDumper : public VM_GC_Operation, public WorkerTask { } FREE_C_HEAP_ARRAY(ThreadStackTrace*, _stack_traces); } - if (_poi != NULL) { - delete _poi; - _poi = NULL; - } if (_dumper_controller != NULL) { delete _dumper_controller; _dumper_controller = NULL; @@ -2252,7 +2247,14 @@ void VM_HeapDumper::doit() { work(0); } else { prepare_parallel_dump(workers->active_workers()); - workers->run_task(this); + if (_num_dumper_threads > 1) { + ParallelObjectIterator poi(_num_dumper_threads); + _poi = &poi; + workers->run_task(this); + _poi = NULL; + } else { + workers->run_task(this); + } finish_parallel_dump(); } -- GitLab From 5e7e2da227cd2b5e2d3d1e2f59fb74ddd1835abb Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 23 Nov 2021 15:02:48 +0000 Subject: [PATCH 446/890] 8272042: java.util.ImmutableCollections$Map1 and MapN should not be @ValueBased Reviewed-by: mchung, iris, naoto, smarks --- .../share/classes/java/util/ImmutableCollections.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/java/util/ImmutableCollections.java b/src/java.base/share/classes/java/util/ImmutableCollections.java index c207e4f1427..4c8fd0cfc8f 100644 --- a/src/java.base/share/classes/java/util/ImmutableCollections.java +++ b/src/java.base/share/classes/java/util/ImmutableCollections.java @@ -1062,7 +1062,7 @@ class ImmutableCollections { // ---------- Map Implementations ---------- - @jdk.internal.ValueBased + // Not a jdk.internal.ValueBased class; disqualified by fields in superclass AbstractMap abstract static class AbstractImmutableMap extends AbstractMap implements Serializable { @Override public void clear() { throw uoe(); } @Override public V compute(K key, BiFunction rf) { throw uoe(); } @@ -1093,7 +1093,7 @@ class ImmutableCollections { } } - @jdk.internal.ValueBased + // Not a jdk.internal.ValueBased class; disqualified by fields in superclass AbstractMap static final class Map1 extends AbstractImmutableMap { @Stable private final K k0; @@ -1160,7 +1160,7 @@ class ImmutableCollections { * @param the key type * @param the value type */ - @jdk.internal.ValueBased + // Not a jdk.internal.ValueBased class; disqualified by fields in superclass AbstractMap static final class MapN extends AbstractImmutableMap { @Stable -- GitLab From 64bdc843907634b24ab02b8d81a0f5048b46072c Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 23 Nov 2021 15:16:15 +0000 Subject: [PATCH 447/890] 8277649: [BACKOUT] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures Reviewed-by: alanb, stefank --- .../tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java index 2d99bb273ba..71561a51cf3 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/HelloApp.java @@ -133,10 +133,6 @@ public final class HelloApp { } void addTo(JPackageCommand cmd) { - // set jlink.debug system property to allow the jlink process - // to print exception stacktraces on any failure - cmd.addArgument("-J-Djlink.debug=true"); - final String moduleName = appDesc.moduleName(); final String qualifiedClassName = appDesc.className(); -- GitLab From 38802ad56a31efc90733cb75ea27f019e2c4f5a4 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Tue, 23 Nov 2021 15:22:11 +0000 Subject: [PATCH 448/890] 8254108: ciReplay: Support incremental inlining Reviewed-by: dlong, thartmann --- src/hotspot/share/ci/ciReplay.cpp | 36 +++- src/hotspot/share/ci/ciReplay.hpp | 5 +- src/hotspot/share/opto/bytecodeInfo.cpp | 43 ++-- src/hotspot/share/opto/doCall.cpp | 4 +- src/hotspot/share/opto/parse.hpp | 7 + .../jtreg/compiler/ciReplay/CiReplayBase.java | 56 +++++- .../jtreg/compiler/ciReplay/InliningBase.java | 174 ++++++++++++++++ .../ciReplay/TestIncrementalInlining.java | 188 ++++++++++++++++++ .../TestInliningProtectionDomain.java | 160 ++------------- 9 files changed, 495 insertions(+), 178 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/ciReplay/InliningBase.java create mode 100644 test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index 04b9b0a83f1..e630278e649 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -103,6 +103,7 @@ typedef struct _ciInlineRecord { int _inline_depth; int _inline_bci; + bool _inline_late; } ciInlineRecord; class CompileReplay; @@ -720,7 +721,7 @@ class CompileReplay : public StackObj { return NULL; } - // compile inline ( )* + // compile inline ( )* void process_compile(TRAPS) { Method* method = parse_method(CHECK); if (had_error()) return; @@ -762,11 +763,19 @@ class CompileReplay : public StackObj { if (had_error()) { break; } + int inline_late = 0; + if (_version >= 2) { + inline_late = parse_int("inline_late"); + if (had_error()) { + break; + } + } + Method* inl_method = parse_method(CHECK); if (had_error()) { break; } - new_ciInlineRecord(inl_method, bci, depth); + new_ciInlineRecord(inl_method, bci, depth, inline_late); } } if (_imethod != NULL) { @@ -1227,13 +1236,14 @@ class CompileReplay : public StackObj { } // Create and initialize a record for a ciInlineRecord - ciInlineRecord* new_ciInlineRecord(Method* method, int bci, int depth) { + ciInlineRecord* new_ciInlineRecord(Method* method, int bci, int depth, int inline_late) { ciInlineRecord* rec = NEW_RESOURCE_OBJ(ciInlineRecord); rec->_klass_name = method->method_holder()->name()->as_utf8(); rec->_method_name = method->name()->as_utf8(); rec->_signature = method->signature()->as_utf8(); rec->_inline_bci = bci; rec->_inline_depth = depth; + rec->_inline_late = inline_late; _ci_inline_records->append(rec); return rec; } @@ -1470,23 +1480,33 @@ bool ciReplay::should_not_inline(ciMethod* method) { return replay_state->find_ciMethodRecord(method->get_Method()) == NULL; } -bool ciReplay::should_inline(void* data, ciMethod* method, int bci, int inline_depth) { +bool ciReplay::should_inline(void* data, ciMethod* method, int bci, int inline_depth, bool& should_delay) { if (data != NULL) { - GrowableArray* records = (GrowableArray*)data; + GrowableArray* records = (GrowableArray*)data; VM_ENTRY_MARK; // Inline record are ordered by bci and depth. - return CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth) != NULL; + ciInlineRecord* record = CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth); + if (record == NULL) { + return false; + } + should_delay = record->_inline_late; + return true; } else if (replay_state != NULL) { VM_ENTRY_MARK; // Inline record are ordered by bci and depth. - return replay_state->find_ciInlineRecord(method->get_Method(), bci, inline_depth) != NULL; + ciInlineRecord* record = replay_state->find_ciInlineRecord(method->get_Method(), bci, inline_depth); + if (record == NULL) { + return false; + } + should_delay = record->_inline_late; + return true; } return false; } bool ciReplay::should_not_inline(void* data, ciMethod* method, int bci, int inline_depth) { if (data != NULL) { - GrowableArray* records = (GrowableArray*)data; + GrowableArray* records = (GrowableArray*)data; VM_ENTRY_MARK; // Inline record are ordered by bci and depth. return CompileReplay::find_ciInlineRecord(records, method->get_Method(), bci, inline_depth) == NULL; diff --git a/src/hotspot/share/ci/ciReplay.hpp b/src/hotspot/share/ci/ciReplay.hpp index 187f47497bd..e835bb907ba 100644 --- a/src/hotspot/share/ci/ciReplay.hpp +++ b/src/hotspot/share/ci/ciReplay.hpp @@ -121,7 +121,7 @@ class ciReplay { static bool is_loaded(Method* method); static bool should_not_inline(ciMethod* method); - static bool should_inline(void* data, ciMethod* method, int bci, int inline_depth); + static bool should_inline(void* data, ciMethod* method, int bci, int inline_depth, bool& should_delay); static bool should_not_inline(void* data, ciMethod* method, int bci, int inline_depth); #endif @@ -135,6 +135,7 @@ class ciReplay { // 0: legacy (no version number) // 1: first instanceKlass sets protection domain (8275868) // replace current_mileage with invocation_count (8276095) -#define REPLAY_VERSION 1 // current version, bump up for incompatible changes +// 2: incremental inlining support (8254108) +#define REPLAY_VERSION 2 // current version, bump up for incompatible changes #endif // SHARE_CI_CIREPLAY_HPP diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index c6bc8f8eb94..40d09201530 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -46,6 +46,7 @@ InlineTree::InlineTree(Compile* c, C(c), _caller_jvms(caller_jvms), _method(callee), + _late_inline(false), _caller_tree((InlineTree*) caller_tree), _count_inline_bcs(method()->code_size_for_inlining()), _max_inline_level(max_inline_level), @@ -113,7 +114,7 @@ static bool is_unboxing_method(ciMethod* callee_method, Compile* C) { // positive filter: should callee be inlined? bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, - int caller_bci, ciCallProfile& profile) { + int caller_bci, NOT_PRODUCT_ARG(bool& should_delay) ciCallProfile& profile) { // Allows targeted inlining if (C->directive()->should_inline(callee_method)) { set_msg("force inline by CompileCommand"); @@ -128,9 +129,13 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, } #ifndef PRODUCT - int inline_depth = inline_level()+1; - if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { - set_msg("force inline by ciReplay"); + int inline_depth = inline_level() + 1; + if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth, should_delay)) { + if (should_delay) { + set_msg("force (incremental) inline by ciReplay"); + } else { + set_msg("force inline by ciReplay"); + } _forced_inline = true; return true; } @@ -194,7 +199,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method, // negative filter: should callee NOT be inlined? bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_method, - int caller_bci, ciCallProfile& profile) { + int caller_bci, NOT_PRODUCT_ARG(bool& should_delay) ciCallProfile& profile) { const char* fail_msg = NULL; // First check all inlining restrictions which are required for correctness @@ -232,9 +237,13 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met } #ifndef PRODUCT - int inline_depth = inline_level()+1; - if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth)) { - set_msg("force inline by ciReplay"); + int inline_depth = inline_level() + 1; + if (ciReplay::should_inline(C->replay_inline_data(), callee_method, caller_bci, inline_depth, should_delay)) { + if (should_delay) { + set_msg("force (incremental) inline by ciReplay"); + } else { + set_msg("force inline by ciReplay"); + } return false; } @@ -369,10 +378,13 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, } _forced_inline = false; // Reset - if (!should_inline(callee_method, caller_method, caller_bci, profile)) { + + // 'should_delay' can be overridden during replay compilation + if (!should_inline(callee_method, caller_method, caller_bci, NOT_PRODUCT_ARG(should_delay) profile)) { return false; } - if (should_not_inline(callee_method, caller_method, caller_bci, profile)) { + // 'should_delay' can be overridden during replay compilation + if (should_not_inline(callee_method, caller_method, caller_bci, NOT_PRODUCT_ARG(should_delay) profile)) { return false; } @@ -557,9 +569,8 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, //------------------------------ok_to_inline----------------------------------- bool InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, bool& should_delay) { - assert(callee_method != NULL, "caller checks for optimized virtual!"); - assert(!should_delay, "should be initialized to false"); #ifdef ASSERT + assert(callee_method != NULL, "caller checks for optimized virtual!"); // Make sure the incoming jvms has the same information content as me. // This means that we can eventually make this whole class AllStatic. if (jvms->caller() == NULL) { @@ -595,7 +606,11 @@ bool InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallPro set_msg("inline (hot)"); } print_inlining(callee_method, caller_bci, caller_method, true /* success */); - build_inline_tree_for_callee(callee_method, jvms, caller_bci); + InlineTree* callee_tree = build_inline_tree_for_callee(callee_method, jvms, caller_bci); + if (should_delay) { + // Record late inlining decision in order to dump it for compiler replay + callee_tree->set_late_inline(); + } return true; } else { // Do not inline @@ -700,7 +715,7 @@ int InlineTree::count() const { } void InlineTree::dump_replay_data(outputStream* out) { - out->print(" %d %d ", inline_level(), caller_bci()); + out->print(" %d %d %d ", inline_level(), caller_bci(), _late_inline); method()->dump_name_as_ascii(out); for (int i = 0 ; i < _subtrees.length(); i++) { _subtrees.at(i)->dump_replay_data(out); diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index 283a364dfec..6746ce02967 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -164,7 +164,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool // Try inlining a bytecoded method: if (!call_does_dispatch) { InlineTree* ilt = InlineTree::find_subtree_from_root(this->ilt(), jvms->caller(), jvms->method()); - bool should_delay = false; + bool should_delay = AlwaysIncrementalInline; if (ilt->ok_to_inline(callee, jvms, profile, should_delay)) { CallGenerator* cg = CallGenerator::for_inline(callee, expected_uses); // For optimized virtual calls assert at runtime that receiver object @@ -189,7 +189,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool return CallGenerator::for_boxing_late_inline(callee, cg); } else if (should_delay_vector_reboxing_inlining(callee, jvms)) { return CallGenerator::for_vector_reboxing_late_inline(callee, cg); - } else if ((should_delay || AlwaysIncrementalInline)) { + } else if (should_delay) { return CallGenerator::for_late_inline(callee, cg); } else { return cg; diff --git a/src/hotspot/share/opto/parse.hpp b/src/hotspot/share/opto/parse.hpp index efed355787b..6a4d77479f6 100644 --- a/src/hotspot/share/opto/parse.hpp +++ b/src/hotspot/share/opto/parse.hpp @@ -46,6 +46,7 @@ class InlineTree : public ResourceObj { Compile* C; // cache JVMState* _caller_jvms; // state of caller ciMethod* _method; // method being called by the caller_jvms + bool _late_inline; // method is inlined incrementally InlineTree* _caller_tree; uint _count_inline_bcs; // Accumulated count of inlined bytecodes const int _max_inline_level; // the maximum inline level for this sub-tree (may be adjusted) @@ -75,10 +76,12 @@ protected: bool should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, + NOT_PRODUCT_ARG(bool& should_delay) ciCallProfile& profile); bool should_not_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, + NOT_PRODUCT_ARG(bool& should_delay) ciCallProfile& profile); bool is_not_reached(ciMethod* callee_method, ciMethod* caller_method, @@ -112,6 +115,10 @@ public: // The call_method is an optimized virtual method candidate otherwise. bool ok_to_inline(ciMethod *call_method, JVMState* caller_jvms, ciCallProfile& profile, bool& should_delay); + void set_late_inline() { + _late_inline = true; + } + // Information about inlined method JVMState* caller_jvms() const { return _caller_jvms; } ciMethod *method() const { return _method; } diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index 2fccc385ee1..a025962081c 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -24,10 +24,17 @@ package compiler.ciReplay; import compiler.whitebox.CompilerWhiteBoxTest; -import java.io.IOException; -import java.io.File; +import jdk.test.lib.Asserts; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.CoreUtils; + import java.io.BufferedReader; +import java.io.File; import java.io.FileReader; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -36,14 +43,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import jdk.test.lib.Platform; -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; -import jdk.test.lib.util.CoreUtils; public abstract class CiReplayBase { public static final String REPLAY_FILE_NAME = "test_replay.txt"; @@ -296,4 +295,41 @@ public abstract class CiReplayBase { throw new Error("Can't create process builder: " + t, t); } } + + protected void removeVersionFromReplayFile() { + setNewVersionLineInReplayFile(null); + } + + protected void setNewVersionInReplayFile(int newVersionNumber) { + setNewVersionLineInReplayFile("version " + newVersionNumber); + } + + private void setNewVersionLineInReplayFile(String firstLineString) { + List newLines = new ArrayList<>(); + Path replayFilePath = Paths.get(getReplayFileName()); + try (var br = Files.newBufferedReader(replayFilePath)) { + String line; + boolean firstLine = true; + while ((line = br.readLine()) != null) { + if (firstLine) { + firstLine = false; + Asserts.assertTrue(line.startsWith("version"), "version number must exist in a proper replay file"); + if (firstLineString != null) { + newLines.add(firstLineString); + } + // Else: Remove first line by skipping it. + } else { + newLines.add(line); + } + } + Asserts.assertFalse(firstLine, replayFilePath + " should not be empty"); + } catch (IOException e) { + throw new Error("Failed to read replay data: " + e, e); + } + try { + Files.write(replayFilePath, newLines, StandardOpenOption.TRUNCATE_EXISTING); + } catch (IOException e) { + throw new Error("Failed to write replay data: " + e, e); + } + } } diff --git a/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java b/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java new file mode 100644 index 00000000000..b89e9b7cb5f --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2021, 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.ciReplay; + +import jdk.test.lib.Asserts; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public abstract class InliningBase extends DumpReplayBase { + public static final String LOG_FILE_NORMAL = "hotspot_normal.log"; + public static final String LOG_FILE_REPLAY = "hotspot_replay.log"; + protected final String[] commandLineReplay; + protected final List commandLineNormal; + protected final Class testClass; + + protected InliningBase(Class testClass) { + this.testClass = testClass; + commandLineNormal = new ArrayList<>(List.of("-XX:LogFile=" + LOG_FILE_NORMAL + "", "-XX:+LogCompilation", "-XX:-TieredCompilation", + "-XX:CompileCommand=exclude," + testClass.getName() + "::main", + "-XX:CompileCommand=option," + testClass.getName() + "::test,bool,PrintInlining,true")); + commandLineReplay = new String[] + {"-XX:LogFile=" + LOG_FILE_REPLAY, "-XX:+LogCompilation", + "-XX:CompileCommand=option," + testClass.getName() + "::test,bool,PrintInlining,true"}; + } + + protected void runTest() { + runTest(commandLineNormal.toArray(new String[0])); + } + + @Override + public String getTestClass() { + return testClass.getName(); + } + + @Override + public void cleanup() { + super.cleanup(); + remove(LOG_FILE_NORMAL); + remove(LOG_FILE_REPLAY); + } + + static class InlineEntry { + String klass; + String method; + String reason; + + public InlineEntry(String klass, String method, String reason) { + this.klass = klass; + this.method = method; + this.reason = reason; + } + + public boolean isNormalInline() { + return reason.equals("inline (hot)"); + } + + public boolean isForcedByReplay() { + return reason.equals("force inline by ciReplay"); + } + + public boolean isDisallowedByReplay() { + return reason.equals("disallowed by ciReplay"); + } + + public boolean isUnloadedSignatureClasses() { + return reason.equals("unloaded signature classes"); + } + + public boolean isForcedIncrementalInlineByReplay() { + return reason.equals("force (incremental) inline by ciReplay"); + } + + public boolean isForcedInline() { + return reason.equals("force inline by annotation"); + } + + public boolean isTooDeep() { + return reason.equals("inlining too deep"); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + if (!(other instanceof InlineEntry)) { + return false; + } + + InlineEntry e = (InlineEntry)other; + return klass.equals(e.klass) && method.equals(e.method); + } + + public boolean compare(String klass, String method, boolean kind) { + return this.klass.equals(klass) && this.method.equals(method) && kind; + } + } + + protected static List parseLogFile(String logFile, String rootMethod, String nmethodMatch, int inlineeCount) { + String nmethodStart = " inlinees = new ArrayList<>(); + int foundLines = 0; + try (var br = Files.newBufferedReader(Paths.get(logFile))) { + String line; + boolean nmethodLine = false; + boolean inlinineLine = false; + while ((line = br.readLine()) != null) { + if (nmethodLine) { + // Ignore other entries which could be in between nmethod entry and inlining statements + if (line.startsWith(" ")) { + inlinineLine = true; + Pattern p = Pattern.compile("(\\S+)::(\\S+).*bytes\\)\s+(.*)"); + Matcher matcher = p.matcher(line); + Asserts.assertTrue(matcher.find(), "must find inlinee method"); + inlinees.add(new InlineEntry(matcher.group(1), matcher.group(2), matcher.group(3).trim())); + foundLines++; + } else if (inlinineLine) { + Asserts.assertEQ(foundLines, inlineeCount, "did not find all inlinees"); + return inlinees; + } + } else { + nmethodLine = line.startsWith(nmethodStart) && line.contains(nmethodMatch); + if (nmethodLine) { + Asserts.assertTrue(line.contains(rootMethod), "should only dump inline information for " + rootMethod); + } + } + } + } catch (IOException e) { + throw new Error("Failed to read " + logFile + " data: " + e, e); + } + Asserts.fail("Should have found inlinees"); + return inlinees; + } + + protected void verifyLists(List inlineesNormal, List inlineesReplay, int expectedSize) { + if (!inlineesNormal.equals(inlineesReplay)) { + System.err.println("Normal entries:"); + inlineesNormal.forEach(System.err::println); + System.err.println("Replay entries:"); + inlineesReplay.forEach(System.err::println); + Asserts.fail("different inlining decision in normal run vs. replay run"); + } + Asserts.assertEQ(expectedSize, inlineesNormal.size(), "unexpected number of inlinees found"); + } +} + diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java b/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java new file mode 100644 index 00000000000..8bac1ea283c --- /dev/null +++ b/test/hotspot/jtreg/compiler/ciReplay/TestIncrementalInlining.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2021, 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 8254108 + * @library / /test/lib + * @summary Testing of ciReplay with incremental inlining. + * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.debug == true & vm.compiler2.enabled + * @modules java.base/jdk.internal.misc + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.ciReplay.TestIncrementalInlining + */ + +package compiler.ciReplay; + +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.test.whitebox.WhiteBox; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class TestIncrementalInlining extends InliningBase { + + private List inlineesNormal; + private List inlineesReplay; + public static void main(String[] args) { + new TestIncrementalInlining(); + } + + TestIncrementalInlining() { + super(IncrementalInliningTest.class); + // Enable Whitebox access for test VM. + commandLineNormal.add("-Dtest.jdk=" + Utils.TEST_JDK); + commandLineNormal.add("-cp"); + commandLineNormal.add(Utils.TEST_CLASS_PATH); + commandLineNormal.add("-Xbootclasspath/a:."); + commandLineNormal.add("-XX:+UnlockDiagnosticVMOptions"); + commandLineNormal.add("-XX:+WhiteBoxAPI"); + commandLineNormal.add("-XX:MaxInlineLevel=2"); + commandLineNormal.add("-XX:-AlwaysIncrementalInline"); + runTest(); + } + + @Override + public void testAction() { + positiveTest(commandLineReplay); + inlineesNormal = parseLogFile(LOG_FILE_NORMAL, getTestClass() + " " + "test", "compile_id='" + getCompileIdFromFile(getReplayFileName()), 5); + verify(true); + + // Incremental inlining is supported in version 2+ + // Test replay file version 1. + removeIncrementalInlineInfo(); + setNewVersionInReplayFile(1); + positiveTest(commandLineReplay); + verify(false); + + // Test replay file without version. + removeVersionFromReplayFile(); + positiveTest(commandLineReplay); + verify(false); + } + + private void verify(boolean isNewFormat) { + inlineesReplay = parseLogFile(LOG_FILE_REPLAY, getTestClass() + " " + "test", "test ()V", 5); + verifyLists(inlineesNormal, inlineesReplay, 5); + checkInlining(isNewFormat); + } + + // Check if inlining is done correctly in ciReplay. + private void checkInlining(boolean isNewFormat) { + String klass = getTestClass(); + Asserts.assertTrue(inlineesNormal.get(0).compare(klass, "level0", inlineesNormal.get(0).isForcedInline())); + Asserts.assertTrue(inlineesReplay.get(0).compare(klass, "level0", inlineesReplay.get(0).isForcedByReplay())); + Asserts.assertTrue(inlineesNormal.get(1).compare(klass, "level1", inlineesNormal.get(1).isNormalInline())); + Asserts.assertTrue(inlineesReplay.get(1).compare(klass, "level1", inlineesReplay.get(1).isForcedByReplay())); + Asserts.assertTrue(inlineesNormal.get(2).compare(klass, "level2", inlineesNormal.get(2).isForcedInline())); + Asserts.assertTrue(inlineesReplay.get(2).compare(klass, "level2", inlineesReplay.get(2).isForcedByReplay())); + Asserts.assertTrue(inlineesNormal.get(3).compare(klass, "late", inlineesNormal.get(3).isForcedInline())); + Asserts.assertTrue(inlineesReplay.get(3).compare(klass, "late", isNewFormat ? + inlineesReplay.get(3).isForcedIncrementalInlineByReplay() + : inlineesReplay.get(3).isForcedByReplay())); + Asserts.assertTrue(inlineesNormal.get(4).compare(klass, "level4", inlineesNormal.get(4).isTooDeep())); + Asserts.assertTrue(inlineesReplay.get(4).compare(klass, "level4", inlineesReplay.get(4).isDisallowedByReplay())); + } + + private void removeIncrementalInlineInfo() { + try { + Path replayFilePath = Paths.get(getReplayFileName()); + List replayContent = Files.readAllLines(replayFilePath); + for (int i = 0; i < replayContent.size(); i++) { + String line = replayContent.get(i); + if (line.startsWith("compile ")) { + int lastIndex = 0; + StringBuilder newLine = new StringBuilder(); + Pattern p = Pattern.compile("(\\d (-?\\d)) \\d compiler"); + Matcher m = p.matcher(line); + boolean firstMatch = true; + while (m.find()) { + newLine.append(line, lastIndex, m.start()) + .append(m.group(1)) + .append(" compiler"); + lastIndex = m.end(); + String bci = m.group(2); + Asserts.assertTrue(firstMatch ? bci.equals("-1") : bci.equals("0"), "only root has -1"); + firstMatch = false; + } + Asserts.assertLessThan(lastIndex, line.length(), "not reached end of line, yet"); + newLine.append(line, lastIndex, line.length()); + replayContent.set(i, newLine.toString()); + } + } + Files.write(replayFilePath, replayContent, StandardOpenOption.TRUNCATE_EXISTING); + } catch (IOException ioe) { + throw new Error("Failed to read/write replay data: " + ioe, ioe); + } + } +} + +class IncrementalInliningTest { + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + private static String s; + + public static void main(String[] args) throws NoSuchMethodException { + WB.testSetForceInlineMethod(IncrementalInliningTest.class.getDeclaredMethod("level0"), true); + WB.testSetForceInlineMethod(IncrementalInliningTest.class.getDeclaredMethod("level2"), true); + WB.testSetForceInlineMethod(IncrementalInliningTest.class.getDeclaredMethod("late"), true); + for (int i = 0; i < 10000; i++) { + test(); + } + } + + private static void test() { + level0(); + } + + public static void level0() { + level1(); + } + + public static void level1() { + level2(); + } + + public static void level2() { + late(); + } + + // Reached max inline level but forced to be inlined -> inline late. + public static void late() { + level4(); + } + + // Reached max inline level and not forced to be inlined -> no inline. + public static void level4() { + s = "HelloWorld"; + } + +} diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java b/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java index 6693295a5d5..0a900fda8e5 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java +++ b/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java @@ -28,173 +28,49 @@ * @summary Testing that ciReplay inlining does not fail with unresolved signature classes. * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.debug == true & vm.compiler2.enabled * @modules java.base/jdk.internal.misc - * @build sun.hotspot.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * compiler.ciReplay.TestInliningProtectionDomain + * @run driver compiler.ciReplay.TestInliningProtectionDomain */ package compiler.ciReplay; import jdk.test.lib.Asserts; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -public class TestInliningProtectionDomain extends DumpReplayBase { - public static final String LOG_FILE_NORMAL = "hotspot_normal.log"; - public static final String LOG_FILE_REPLAY = "hotspot_replay.log"; - private final String[] commandLineReplay; - - private final String className; +public class TestInliningProtectionDomain extends InliningBase { public static void main(String[] args) { - new TestInliningProtectionDomain("ProtectionDomainTestCompiledBefore", true); - new TestInliningProtectionDomain("ProtectionDomainTestNoOtherCompilationPublic", false); - new TestInliningProtectionDomain("ProtectionDomainTestNoOtherCompilationPrivate", false); - new TestInliningProtectionDomain("ProtectionDomainTestNoOtherCompilationPrivateString", false); + new TestInliningProtectionDomain(ProtectionDomainTestCompiledBefore.class, true); + new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPublic.class, false); + new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPrivate.class, false); + new TestInliningProtectionDomain(ProtectionDomainTestNoOtherCompilationPrivateString.class, false); } - public TestInliningProtectionDomain(String className, boolean compileBar) { - this.className = className; - List commandLineNormal = new ArrayList<>(List.of("-XX:LogFile=" + LOG_FILE_NORMAL + "", "-XX:+LogCompilation", "-XX:-TieredCompilation", - "-XX:CompileCommand=exclude," + getTestClass() + "::main", - "-XX:CompileCommand=option," + getTestClass() + "::test,bool,PrintInlining,true")); + public TestInliningProtectionDomain(Class testClass, boolean compileBar) { + super(testClass); if (compileBar) { - commandLineNormal.add("-XX:CompileCommand=compileonly," + getTestClass() + "::bar"); + commandLineNormal.add("-XX:CompileCommand=compileonly," + testClass.getName() + "::bar"); } - commandLineReplay = new String[] - {"-XX:LogFile=" + LOG_FILE_REPLAY + "", "-XX:+LogCompilation", - "-XX:CompileCommand=option," + getTestClass() + "::test,bool,PrintInlining,true"}; - runTest(commandLineNormal.toArray(new String[0])); + runTest(); } @Override public void testAction() { positiveTest(commandLineReplay); - String klass = "compiler.ciReplay." + className; - String entryString = klass + " " + "test"; - boolean inlineFails = className.equals("ProtectionDomainTestNoOtherCompilationPrivate"); + String entryString = getTestClass() + " " + "test"; + boolean inlineFails = testClass == ProtectionDomainTestNoOtherCompilationPrivate.class; int inlineeCount = inlineFails ? 1 : 5; - List inlineesNormal = parseLogFile(LOG_FILE_NORMAL, entryString, "compile_id='" + getCompileIdFromFile(getReplayFileName()), inlineeCount); - List inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount); + List inlineesNormal = parseLogFile(LOG_FILE_NORMAL, entryString, "compile_id='" + getCompileIdFromFile(getReplayFileName()), inlineeCount); + List inlineesReplay = parseLogFile(LOG_FILE_REPLAY, entryString, "test ()V", inlineeCount); verifyLists(inlineesNormal, inlineesReplay, inlineeCount); if (inlineFails) { - Asserts.assertTrue(compare(inlineesNormal.get(0), "compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", - "bar", inlineesNormal.get(0).isUnloadedSignatureClasses())); - Asserts.assertTrue(compare(inlineesReplay.get(0), "compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", - "bar", inlineesReplay.get(0).isDisallowedByReplay())); + Asserts.assertTrue(inlineesNormal.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesNormal.get(0).isUnloadedSignatureClasses())); + Asserts.assertTrue(inlineesReplay.get(0).compare("compiler.ciReplay.ProtectionDomainTestNoOtherCompilationPrivate", "bar", inlineesReplay.get(0).isDisallowedByReplay())); } else { - Asserts.assertTrue(compare(inlineesNormal.get(4), "compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline())); - Asserts.assertTrue(compare(inlineesReplay.get(4), "compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay())); - } - remove(LOG_FILE_NORMAL); - remove(LOG_FILE_REPLAY); - } - - private void verifyLists(List inlineesNormal, List inlineesReplay, int expectedSize) { - if (!inlineesNormal.equals(inlineesReplay)) { - System.err.println("Normal entries:"); - inlineesNormal.forEach(System.err::println); - System.err.println("Replay entries:"); - inlineesReplay.forEach(System.err::println); - Asserts.fail("different inlining decision in normal run vs. replay run"); - } - Asserts.assertEQ(expectedSize, inlineesNormal.size(), "unexpected number of inlinees found"); - } - - public static boolean compare(Entry e, String klass, String method, boolean kind) { - return e.klass.equals(klass) && e.method.equals(method) && kind; - } - - public static List parseLogFile(String logFile, String rootMethod, String nmethodMatch, int inlineeCount) { - String nmethodStart = " inlinees = new ArrayList<>(); - int foundLines = 0; - try (var br = Files.newBufferedReader(Paths.get(logFile))) { - String line; - boolean nmethodLine = false; - boolean inlinineLine = false; - while ((line = br.readLine()) != null) { - if (nmethodLine) { - // Ignore other entries which could be in between nmethod entry and inlining statements - if (line.startsWith(" ")) { - inlinineLine = true; - Pattern p = Pattern.compile("(\\S+)::(\\S+).*bytes\\)\s+(.*)"); - Matcher matcher = p.matcher(line); - Asserts.assertTrue(matcher.find(), "must find inlinee method"); - inlinees.add(new Entry(matcher.group(1), matcher.group(2), matcher.group(3).trim())); - foundLines++; - } else if (inlinineLine) { - Asserts.assertEQ(foundLines, inlineeCount, "did not find all inlinees"); - return inlinees; - } - } else { - nmethodLine = line.startsWith(nmethodStart) && line.contains(nmethodMatch); - if (nmethodLine) { - Asserts.assertTrue(line.contains(rootMethod), "should only dump inline information for " + rootMethod); - } - } - } - } catch (IOException e) { - throw new Error("Failed to read " + logFile + " data: " + e, e); - } - Asserts.fail("Should have found inlinees"); - return inlinees; - } - - - @Override - public String getTestClass() { - return "compiler.ciReplay." + className; - } - - static class Entry { - String klass; - String method; - String reason; - - public Entry(String klass, String method, String reason) { - this.klass = klass; - this.method = method; - this.reason = reason; - } - - public boolean isNormalInline() { - return reason.equals("inline (hot)"); - } - - public boolean isForcedByReplay() { - return reason.equals("force inline by ciReplay"); - } - - public boolean isDisallowedByReplay() { - return reason.equals("disallowed by ciReplay"); - } - - public boolean isUnloadedSignatureClasses() { - return reason.equals("unloaded signature classes"); - } - - @Override - public boolean equals(Object other) { - if (other == this) { - return true; - } - - if (!(other instanceof Entry)) { - return false; - } - - Entry e = (Entry)other; - return klass.equals(e.klass) && method.equals(e.method); + Asserts.assertTrue(inlineesNormal.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesNormal.get(4).isNormalInline())); + Asserts.assertTrue(inlineesReplay.get(4).compare("compiler.ciReplay.InliningBar", "bar2", inlineesReplay.get(4).isForcedByReplay())); } } } -- GitLab From 7b67a49f830b71ef129a4a3a9b0d994d58587edf Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Tue, 23 Nov 2021 15:23:23 +0000 Subject: [PATCH 449/890] 8261847: performance of java.lang.Record::toString should be improved Reviewed-by: jlaskey, redestad --- .../java/lang/runtime/ObjectMethods.java | 138 ++++++++++---- .../javac/records/BigRecordsToStringTest.java | 171 ++++++++++++++++++ .../java/lang/runtime/ObjectMethods.java | 158 ++++++++++++++++ 3 files changed, 433 insertions(+), 34 deletions(-) create mode 100644 test/langtools/tools/javac/records/BigRecordsToStringTest.java create mode 100644 test/micro/org/openjdk/bench/java/lang/runtime/ObjectMethods.java diff --git a/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java b/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java index 62c81c42f5c..5d092328f75 100644 --- a/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java +++ b/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java @@ -29,9 +29,11 @@ import java.lang.invoke.ConstantCallSite; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; +import java.lang.invoke.StringConcatFactory; import java.lang.invoke.TypeDescriptor; import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -52,6 +54,8 @@ public class ObjectMethods { private ObjectMethods() { } + private static final int MAX_STRING_CONCAT_SLOTS = 20; + private static final MethodType DESCRIPTOR_MT = MethodType.methodType(MethodType.class); private static final MethodType NAMES_MT = MethodType.methodType(List.class); private static final MethodHandle FALSE = MethodHandles.constant(boolean.class, false); @@ -251,44 +255,110 @@ public class ObjectMethods { * @param names the names * @return the method handle */ - private static MethodHandle makeToString(Class receiverClass, - List getters, + private static MethodHandle makeToString(MethodHandles.Lookup lookup, + Class receiverClass, + MethodHandle[] getters, List names) { - // This is a pretty lousy algorithm; we spread the receiver over N places, - // apply the N getters, apply N toString operations, and concat the result with String.format - // Better to use String.format directly, or delegate to StringConcatFactory - // Also probably want some quoting around String components - - assert getters.size() == names.size(); - - int[] invArgs = new int[getters.size()]; - Arrays.fill(invArgs, 0); - MethodHandle[] filters = new MethodHandle[getters.size()]; - StringBuilder sb = new StringBuilder(); - sb.append(receiverClass.getSimpleName()).append("["); - for (int i=0; i> splits; + MethodHandle[] toSplit = getters; + int namesIndex = 0; + do { + /* StringConcatFactory::makeConcatWithConstants can only deal with 200 slots, longs and double occupy two + * the rest 1 slot, we need to chop the current `getters` into chunks, it could be that for records with + * a lot of components that we need to do a couple of iterations. The main difference between the first + * iteration and the rest would be on the recipe + */ + splits = split(toSplit); + mhs = new MethodHandle[splits.size()]; + for (int splitIndex = 0; splitIndex < splits.size(); splitIndex++) { + String recipe = ""; + if (firstTime && splitIndex == 0) { + recipe = receiverClass.getSimpleName() + "["; + } + for (int i = 0; i < splits.get(splitIndex).size(); i++) { + recipe += firstTime ? names.get(namesIndex) + "=" + "\1" : "\1"; + if (firstTime && namesIndex != names.size() - 1) { + recipe += ", "; + } + namesIndex++; + } + if (firstTime && splitIndex == splits.size() - 1) { + recipe += "]"; + } + Class[] concatTypeArgs = new Class[splits.get(splitIndex).size()]; + // special case: no need to create another getters if there is only one split + MethodHandle[] currentSplitGetters = new MethodHandle[splits.get(splitIndex).size()]; + for (int j = 0; j < splits.get(splitIndex).size(); j++) { + concatTypeArgs[j] = splits.get(splitIndex).get(j).type().returnType(); + currentSplitGetters[j] = splits.get(splitIndex).get(j); + } + MethodType concatMT = MethodType.methodType(String.class, concatTypeArgs); + try { + mhs[splitIndex] = StringConcatFactory.makeConcatWithConstants( + lookup, "", + concatMT, + recipe, + new Object[0] + ).getTarget(); + mhs[splitIndex] = MethodHandles.filterArguments(mhs[splitIndex], 0, currentSplitGetters); + // this will spread the receiver class across all the getters + mhs[splitIndex] = MethodHandles.permuteArguments( + mhs[splitIndex], + MethodType.methodType(String.class, receiverClass), + new int[splits.get(splitIndex).size()] + ); + } catch (Throwable t) { + throw new RuntimeException(t); + } + } + toSplit = mhs; + firstTime = false; + } while (splits.size() > 1); + return mhs[0]; + } + + /** + * Chops the getters into smaller chunks according to the maximum number of slots + * StringConcatFactory::makeConcatWithConstants can chew + * @param getters the current getters + * @return chunks that wont surpass the maximum number of slots StringConcatFactory::makeConcatWithConstants can chew + */ + private static List> split(MethodHandle[] getters) { + List> splits = new ArrayList<>(); + + int slots = 0; + + // Need to peel, so that neither call has more than acceptable number + // of slots for the arguments. + List cArgs = new ArrayList<>(); + for (MethodHandle methodHandle : getters) { + Class returnType = methodHandle.type().returnType(); + int needSlots = (returnType == long.class || returnType == double.class) ? 2 : 1; + if (slots + needSlots > MAX_STRING_CONCAT_SLOTS) { + splits.add(cArgs); + cArgs = new ArrayList<>(); + slots = 0; + } + cArgs.add(methodHandle); + slots += needSlots; } - else { - MethodHandle filtered = MethodHandles.filterArguments(formatter, 0, filters); - formatter = MethodHandles.permuteArguments(filtered, MethodType.methodType(String.class, receiverClass), invArgs); + + // Flush the tail slice + if (!cArgs.isEmpty()) { + splits.add(cArgs); } - return formatter; + return splits; } /** @@ -367,7 +437,7 @@ public class ObjectMethods { List nameList = "".equals(names) ? List.of() : List.of(names.split(";")); if (nameList.size() != getterList.size()) throw new IllegalArgumentException("Name list and accessor list do not match"); - yield makeToString(recordClass, getterList, nameList); + yield makeToString(lookup, recordClass, getters, nameList); } default -> throw new IllegalArgumentException(methodName); }; diff --git a/test/langtools/tools/javac/records/BigRecordsToStringTest.java b/test/langtools/tools/javac/records/BigRecordsToStringTest.java new file mode 100644 index 00000000000..87e269a9532 --- /dev/null +++ b/test/langtools/tools/javac/records/BigRecordsToStringTest.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2021, 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 8261847 + * @summary test the output of the toString method of records with a large number of components + * @run testng BigRecordsToStringTest + */ + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Parameter; +import java.util.List; +import java.util.function.Supplier; + +import org.testng.annotations.*; +import static org.testng.Assert.*; + +@Test +public class BigRecordsToStringTest { + record BigInt( + int i1,int i2,int i3,int i4,int i5,int i6,int i7,int i8,int i9,int i10, + int i11,int i12,int i13,int i14,int i15,int i16,int i17,int i18,int i19,int i20, + int i21,int i22,int i23,int i24,int i25,int i26,int i27,int i28,int i29,int i30, + int i31,int i32,int i33,int i34,int i35,int i36,int i37,int i38,int i39,int i40, + int i41,int i42,int i43,int i44,int i45,int i46,int i47,int i48,int i49,int i50, + int i51,int i52,int i53,int i54,int i55,int i56,int i57,int i58,int i59,int i60, + int i61,int i62,int i63,int i64,int i65,int i66,int i67,int i68,int i69,int i70, + int i71,int i72,int i73,int i74,int i75,int i76,int i77,int i78,int i79,int i80, + int i81,int i82,int i83,int i84,int i85,int i86,int i87,int i88,int i89,int i90, + int i91,int i92,int i93,int i94,int i95,int i96,int i97,int i98,int i99,int i100, + int i101,int i102,int i103,int i104,int i105,int i106,int i107,int i108,int i109,int i110, + int i111,int i112,int i113,int i114,int i115,int i116,int i117,int i118,int i119,int i120, + int i121,int i122,int i123,int i124,int i125,int i126,int i127,int i128,int i129,int i130, + int i131,int i132,int i133,int i134,int i135,int i136,int i137,int i138,int i139,int i140, + int i141,int i142,int i143,int i144,int i145,int i146,int i147,int i148,int i149,int i150, + int i151,int i152,int i153,int i154,int i155,int i156,int i157,int i158,int i159,int i160, + int i161,int i162,int i163,int i164,int i165,int i166,int i167,int i168,int i169,int i170, + int i171,int i172,int i173,int i174,int i175,int i176,int i177,int i178,int i179,int i180, + int i181,int i182,int i183,int i184,int i185,int i186,int i187,int i188,int i189,int i190, + int i191,int i192,int i193,int i194,int i195,int i196,int i197,int i198,int i199, int i200, + int i201,int i202,int i203,int i204,int i205,int i206,int i207,int i208,int i209,int i210, + int i211,int i212,int i213,int i214,int i215,int i216,int i217,int i218,int i219,int i220, + int i221,int i222,int i223,int i224,int i225,int i226,int i227,int i228,int i229,int i230, + int i231,int i232,int i233,int i234,int i235,int i236,int i237,int i238,int i239,int i240, + int i241,int i242,int i243,int i244,int i245,int i246,int i247,int i248,int i249,int i250, + int i251,int i252,int i253,int i254 + ) {} + + BigInt bigInt= new BigInt( + 1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30, + 31,32,33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48,49,50, + 51,52,53,54,55,56,57,58,59,60, + 61,62,63,64,65,66,67,68,69,70, + 71,72,73,74,75,76,77,78,79,80, + 81,82,83,84,85,86,87,88,89,90, + 91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107,108,109,110, + 111,112,113,114,115,116,117,118,119,120, + 121,122,123,124,125,126,127,128,129,130, + 131,132,133,134,135,136,137,138,139,140, + 141,142,143,144,145,146,147,148,149,150, + 151,152,153,154,155,156,157,158,159,160, + 161,162,163,164,165,166,167,168,169,170, + 171,172,173,174,175,176,177,178,179,180, + 181,182,183,184,185,186,187,188,189,190, + 191,192,193,194,195,196,197,198,199, 200, + 201,202,203,204,205,206,207,208,209,210, + 211,212,213,214,215,216,217,218,219,220, + 221,222,223,224,225,226,227,228,229,230, + 231,232,233,234,235,236,237,238,239,240, + 241,242,243,244,245,246,247,248,249,250, + 251,252,253,254 + ); + + record BigLong( + long i1,long i2,long i3,long i4,long i5,long i6,long i7,long i8,long i9,long i10, + long i11,long i12,long i13,long i14,long i15,long i16,long i17,long i18,long i19,long i20, + long i21,long i22,long i23,long i24,long i25,long i26,long i27,long i28,long i29,long i30, + long i31,long i32,long i33,long i34,long i35,long i36,long i37,long i38,long i39,long i40, + long i41,long i42,long i43,long i44,long i45,long i46,long i47,long i48,long i49,long i50, + long i51,long i52,long i53,long i54,long i55,long i56,long i57,long i58,long i59,long i60, + long i61,long i62,long i63,long i64,long i65,long i66,long i67,long i68,long i69,long i70, + long i71,long i72,long i73,long i74,long i75,long i76,long i77,long i78,long i79,long i80, + long i81,long i82,long i83,long i84,long i85,long i86,long i87,long i88,long i89,long i90, + long i91,long i92,long i93,long i94,long i95,long i96,long i97,long i98,long i99,long i100, + long i101,long i102,long i103,long i104,long i105,long i106,long i107,long i108,long i109,long i110, + long i111,long i112,long i113,long i114,long i115,long i116,long i117,long i118,long i119,long i120, + long i121,long i122,long i123,long i124,long i125,long i126,long i127 + ) {} + + BigLong bigLong = new BigLong( + 1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30, + 31,32,33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48,49,50, + 51,52,53,54,55,56,57,58,59,60, + 61,62,63,64,65,66,67,68,69,70, + 71,72,73,74,75,76,77,78,79,80, + 81,82,83,84,85,86,87,88,89,90, + 91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107,108,109,110, + 111,112,113,114,115,116,117,118,119,120, + 121,122,123,124,125,126,127 + ); + + private static final String BIG_INT_TO_STRING_OUTPUT = + "BigInt[i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9, i10=10, i11=11, i12=12, i13=13, i14=14, i15=15, i16=16, " + + "i17=17, i18=18, i19=19, i20=20, i21=21, i22=22, i23=23, i24=24, i25=25, i26=26, i27=27, i28=28, i29=29, i30=30, " + + "i31=31, i32=32, i33=33, i34=34, i35=35, i36=36, i37=37, i38=38, i39=39, i40=40, i41=41, i42=42, i43=43, i44=44, " + + "i45=45, i46=46, i47=47, i48=48, i49=49, i50=50, i51=51, i52=52, i53=53, i54=54, i55=55, i56=56, i57=57, i58=58, " + + "i59=59, i60=60, i61=61, i62=62, i63=63, i64=64, i65=65, i66=66, i67=67, i68=68, i69=69, i70=70, i71=71, i72=72, " + + "i73=73, i74=74, i75=75, i76=76, i77=77, i78=78, i79=79, i80=80, i81=81, i82=82, i83=83, i84=84, i85=85, i86=86, " + + "i87=87, i88=88, i89=89, i90=90, i91=91, i92=92, i93=93, i94=94, i95=95, i96=96, i97=97, i98=98, i99=99, i100=100, " + + "i101=101, i102=102, i103=103, i104=104, i105=105, i106=106, i107=107, i108=108, i109=109, i110=110, i111=111, i112=112, " + + "i113=113, i114=114, i115=115, i116=116, i117=117, i118=118, i119=119, i120=120, i121=121, i122=122, i123=123, i124=124, " + + "i125=125, i126=126, i127=127, i128=128, i129=129, i130=130, i131=131, i132=132, i133=133, i134=134, i135=135, i136=136, " + + "i137=137, i138=138, i139=139, i140=140, i141=141, i142=142, i143=143, i144=144, i145=145, i146=146, i147=147, i148=148, " + + "i149=149, i150=150, i151=151, i152=152, i153=153, i154=154, i155=155, i156=156, i157=157, i158=158, i159=159, i160=160, " + + "i161=161, i162=162, i163=163, i164=164, i165=165, i166=166, i167=167, i168=168, i169=169, i170=170, i171=171, i172=172, " + + "i173=173, i174=174, i175=175, i176=176, i177=177, i178=178, i179=179, i180=180, i181=181, i182=182, i183=183, i184=184, " + + "i185=185, i186=186, i187=187, i188=188, i189=189, i190=190, i191=191, i192=192, i193=193, i194=194, i195=195, i196=196, " + + "i197=197, i198=198, i199=199, i200=200, i201=201, i202=202, i203=203, i204=204, i205=205, i206=206, i207=207, i208=208, " + + "i209=209, i210=210, i211=211, i212=212, i213=213, i214=214, i215=215, i216=216, i217=217, i218=218, i219=219, i220=220, " + + "i221=221, i222=222, i223=223, i224=224, i225=225, i226=226, i227=227, i228=228, i229=229, i230=230, i231=231, i232=232, " + + "i233=233, i234=234, i235=235, i236=236, i237=237, i238=238, i239=239, i240=240, i241=241, i242=242, i243=243, i244=244, " + + "i245=245, i246=246, i247=247, i248=248, i249=249, i250=250, i251=251, i252=252, i253=253, i254=254]"; + + private static final String BIG_LONG_TO_STRING_OUTPUT = + "BigLong[i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9, i10=10, i11=11, i12=12, i13=13, i14=14, i15=15, i16=16, i17=17, " + + "i18=18, i19=19, i20=20, i21=21, i22=22, i23=23, i24=24, i25=25, i26=26, i27=27, i28=28, i29=29, i30=30, i31=31, i32=32, i33=33, " + + "i34=34, i35=35, i36=36, i37=37, i38=38, i39=39, i40=40, i41=41, i42=42, i43=43, i44=44, i45=45, i46=46, i47=47, i48=48, i49=49, " + + "i50=50, i51=51, i52=52, i53=53, i54=54, i55=55, i56=56, i57=57, i58=58, i59=59, i60=60, i61=61, i62=62, i63=63, i64=64, i65=65, " + + "i66=66, i67=67, i68=68, i69=69, i70=70, i71=71, i72=72, i73=73, i74=74, i75=75, i76=76, i77=77, i78=78, i79=79, i80=80, i81=81, " + + "i82=82, i83=83, i84=84, i85=85, i86=86, i87=87, i88=88, i89=89, i90=90, i91=91, i92=92, i93=93, i94=94, i95=95, i96=96, i97=97, " + + "i98=98, i99=99, i100=100, i101=101, i102=102, i103=103, i104=104, i105=105, i106=106, i107=107, i108=108, i109=109, i110=110, " + + "i111=111, i112=112, i113=113, i114=114, i115=115, i116=116, i117=117, i118=118, i119=119, i120=120, i121=121, i122=122, i123=123, " + + "i124=124, i125=125, i126=126, i127=127]"; + + public void testToStringOutput() { + assertTrue(bigInt.toString().equals(BIG_INT_TO_STRING_OUTPUT)); + assertTrue(bigLong.toString().equals(BIG_LONG_TO_STRING_OUTPUT)); + } +} diff --git a/test/micro/org/openjdk/bench/java/lang/runtime/ObjectMethods.java b/test/micro/org/openjdk/bench/java/lang/runtime/ObjectMethods.java new file mode 100644 index 00000000000..c491141e268 --- /dev/null +++ b/test/micro/org/openjdk/bench/java/lang/runtime/ObjectMethods.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.java.lang.runtime; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.util.concurrent.TimeUnit; + +/** + * Benchmark assesses Record.toString which is implemented by ObjectMethods::makeToString + */ +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class ObjectMethods { + record R0() {} + record R1(int i) {} + record R10(int i1,int i2,int i3,int i4,int i5,int i6,int i7,int i8,int i9,int i10) {} + record R100(int i1,int i2,int i3,int i4,int i5,int i6,int i7,int i8,int i9,int i10, + int i11,int i12,int i13,int i14,int i15,int i16,int i17,int i18,int i19,int i20, + int i21,int i22,int i23,int i24,int i25,int i26,int i27,int i28,int i29,int i30, + int i31,int i32,int i33,int i34,int i35,int i36,int i37,int i38,int i39,int i40, + int i41,int i42,int i43,int i44,int i45,int i46,int i47,int i48,int i49,int i50, + int i51,int i52,int i53,int i54,int i55,int i56,int i57,int i58,int i59,int i60, + int i61,int i62,int i63,int i64,int i65,int i66,int i67,int i68,int i69,int i70, + int i71,int i72,int i73,int i74,int i75,int i76,int i77,int i78,int i79,int i80, + int i81,int i82,int i83,int i84,int i85,int i86,int i87,int i88,int i89,int i90, + int i91,int i92,int i93,int i94,int i95,int i96,int i97,int i98,int i99,int i100) {} + record R254(int i1,int i2,int i3,int i4,int i5,int i6,int i7,int i8,int i9,int i10, + int i11,int i12,int i13,int i14,int i15,int i16,int i17,int i18,int i19,int i20, + int i21,int i22,int i23,int i24,int i25,int i26,int i27,int i28,int i29,int i30, + int i31,int i32,int i33,int i34,int i35,int i36,int i37,int i38,int i39,int i40, + int i41,int i42,int i43,int i44,int i45,int i46,int i47,int i48,int i49,int i50, + int i51,int i52,int i53,int i54,int i55,int i56,int i57,int i58,int i59,int i60, + int i61,int i62,int i63,int i64,int i65,int i66,int i67,int i68,int i69,int i70, + int i71,int i72,int i73,int i74,int i75,int i76,int i77,int i78,int i79,int i80, + int i81,int i82,int i83,int i84,int i85,int i86,int i87,int i88,int i89,int i90, + int i91,int i92,int i93,int i94,int i95,int i96,int i97,int i98,int i99,int i100, + int i101,int i102,int i103,int i104,int i105,int i106,int i107,int i108,int i109,int i110, + int i111,int i112,int i113,int i114,int i115,int i116,int i117,int i118,int i119,int i120, + int i121,int i122,int i123,int i124,int i125,int i126,int i127,int i128,int i129,int i130, + int i131,int i132,int i133,int i134,int i135,int i136,int i137,int i138,int i139,int i140, + int i141,int i142,int i143,int i144,int i145,int i146,int i147,int i148,int i149,int i150, + int i151,int i152,int i153,int i154,int i155,int i156,int i157,int i158,int i159,int i160, + int i161,int i162,int i163,int i164,int i165,int i166,int i167,int i168,int i169,int i170, + int i171,int i172,int i173,int i174,int i175,int i176,int i177,int i178,int i179,int i180, + int i181,int i182,int i183,int i184,int i185,int i186,int i187,int i188,int i189,int i190, + int i191,int i192,int i193,int i194,int i195,int i196,int i197,int i198,int i199, int i200, + int i201,int i202,int i203,int i204,int i205,int i206,int i207,int i208,int i209,int i210, + int i211,int i212,int i213,int i214,int i215,int i216,int i217,int i218,int i219,int i220, + int i221,int i222,int i223,int i224,int i225,int i226,int i227,int i228,int i229,int i230, + int i231,int i232,int i233,int i234,int i235,int i236,int i237,int i238,int i239,int i240, + int i241,int i242,int i243,int i244,int i245,int i246,int i247,int i248,int i249,int i250, + int i251,int i252,int i253,int i254) {} + + R0 r0; + R1 r1; + R10 r10; + R100 r100; + R254 r254; + + @Setup + public void prepare() { + r0 = new R0(); + r1 = new R1(1); + r10 = new R10(1,2,3,4,5,6,7,8,9,10); + r100 = new R100(1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30, + 31,32,33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48,49,50, + 51,52,53,54,55,56,57,58,59,60, + 61,62,63,64,65,66,67,68,69,70, + 71,72,73,74,75,76,77,78,79,80, + 81,82,83,84,85,86,87,88,89,90, + 91,92,93,94,95,96,97,98,99,100); + r254 = new R254(1,2,3,4,5,6,7,8,9,10, + 11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30, + 31,32,33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48,49,50, + 51,52,53,54,55,56,57,58,59,60, + 61,62,63,64,65,66,67,68,69,70, + 71,72,73,74,75,76,77,78,79,80, + 81,82,83,84,85,86,87,88,89,90, + 91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107,108,109,110, + 111,112,113,114,115,116,117,118,119,120, + 121,122,123,124,125,126,127,128,129,130, + 131,132,133,134,135,136,137,138,139,140, + 141,142,143,144,145,146,147,148,149,150, + 151,152,153,154,155,156,157,158,159,160, + 161,162,163,164,165,166,167,168,169,170, + 171,172,173,174,175,176,177,178,179,180, + 181,182,183,184,185,186,187,188,189,190, + 191,192,193,194,195,196,197,198,199, 200, + 201,202,203,204,205,206,207,208,209,210, + 211,212,213,214,215,216,217,218,219,220, + 221,222,223,224,225,226,227,228,229,230, + 231,232,233,234,235,236,237,238,239,240, + 241,242,243,244,245,246,247,248,249,250, + 251,252,253,254); + } + + @Benchmark + public String toString0() { + return r0.toString(); + } + + @Benchmark + public String toString1() { + return r1.toString(); + } + + @Benchmark + public String toString10() { + return r10.toString(); + } + + @Benchmark + public String toString100() { + return r100.toString(); + } + + @Benchmark + public String toString254() { + return r254.toString(); + } +} -- GitLab From 8a44e093dc3e192990fde8ab37ab08c737f06b39 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 23 Nov 2021 16:46:45 +0000 Subject: [PATCH 450/890] 8268725: jshell does not support the --enable-native-access option Reviewed-by: sundar --- .../jdk/internal/jshell/tool/JShellTool.java | 6 ++ .../jshell/tool/resources/l10n.properties | 2 + .../jshell/ToolEnableNativeAccessTest.java | 63 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 test/langtools/jdk/jshell/ToolEnableNativeAccessTest.java diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java index 532454b7cbc..b257b132363 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -274,6 +274,7 @@ public class JShellTool implements MessageHandler { ADD_EXPORTS("--add-exports", false), ENABLE_PREVIEW("--enable-preview", true), SOURCE_RELEASE("-source", true, true, true, false, false), // virtual option, generated by --enable-preview + ENABLE_NATIVE_ACCESS("--enable-native-access", true, true, false, true, true), TO_COMPILER("-C", false, false, true, false, false), TO_REMOTE_VM("-R", false, false, false, true, false),; final String optionFlag; @@ -363,6 +364,7 @@ public class JShellTool implements MessageHandler { private final OptionSpec argAddModules = parser.accepts("add-modules").withRequiredArg(); private final OptionSpec argAddExports = parser.accepts("add-exports").withRequiredArg(); private final OptionSpecBuilder argEnablePreview = parser.accepts("enable-preview"); + private final OptionSpecBuilder argEnableNativeAccess = parser.accepts("enable-native-access"); private final NonOptionArgumentSpec argNonOptions = parser.nonOptions(); private Options opts = new Options(); @@ -471,6 +473,10 @@ public class JShellTool implements MessageHandler { OptionKind.SOURCE_RELEASE.optionFlag, System.getProperty("java.specification.version"))); } + if (options.has(argEnableNativeAccess)) { + opts.addAll(OptionKind.ENABLE_NATIVE_ACCESS, List.of( + OptionKind.ENABLE_NATIVE_ACCESS.optionFlag, "ALL-UNNAMED")); + } if (failed) { exitCode = 1; diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties index dd21e320317..8606527e557 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties @@ -207,6 +207,8 @@ where possible options include:\n\ \ --add-modules (,)*\n\ \ Specify modules to resolve, or all modules on the\n\ \ module path if is ALL-MODULE-PATHs\n\ +\ --enable-native-access\n\ +\ Allow code to run restricted native methods\n\ \ --enable-preview Allow code to depend on preview features of this release\n\ \ --startup One run replacement for the startup definitions\n\ \ --no-startup Do not run the startup definitions\n\ diff --git a/test/langtools/jdk/jshell/ToolEnableNativeAccessTest.java b/test/langtools/jdk/jshell/ToolEnableNativeAccessTest.java new file mode 100644 index 00000000000..212301c0fd8 --- /dev/null +++ b/test/langtools/jdk/jshell/ToolEnableNativeAccessTest.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021, 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 8268725 + * @summary Tests for the --enable-native-access option + * @modules jdk.jshell + * @run testng ToolEnableNativeAccessTest + */ + +import org.testng.annotations.Test; + +import static org.testng.Assert.assertTrue; + +public class ToolEnableNativeAccessTest extends ReplToolTesting { + + @Test + public void testOptionDebug() { + test( + (a) -> assertCommand(a, "/debug b", + "RemoteVM Options: []\n" + + "Compiler options: []"), + (a) -> assertCommand(a, "/env --enable-native-access", + "| Setting new options and restoring state."), + (a) -> assertCommandCheckOutput(a, "/debug b", s -> { + assertTrue(s.contains("RemoteVM Options: [--enable-native-access, ALL-UNNAMED]")); + assertTrue(s.contains("Compiler options: []")); + }) + ); + } + + @Test + public void testCommandLineFlag() { + test(new String[] {"--enable-native-access"}, + (a) -> assertCommandCheckOutput(a, "/debug b", s -> { + assertTrue(s.contains("RemoteVM Options: [--enable-native-access, ALL-UNNAMED]")); + assertTrue(s.contains("Compiler options: []")); + }) + ); + } + +} -- GitLab From e8acac2aba30e8a172ca14509220ec06e833d4af Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 23 Nov 2021 17:08:31 +0000 Subject: [PATCH 451/890] 8277350: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java times out Reviewed-by: hseigel, dholmes, lmesnik --- test/hotspot/jtreg/ProblemList.txt | 1 - .../jni/checked/TestPrimitiveArrayCriticalWithBadParam.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index afd66b1db74..8b34ae74e04 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -107,7 +107,6 @@ runtime/os/TestTracePageSizes.java#compiler-options 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#G1 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Parallel 8267460 linux-aarch64 runtime/os/TestTracePageSizes.java#Serial 8267460 linux-aarch64 -runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java 8277350 macosx-x64 runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64 applications/jcstress/copy.java 8229852 linux-all diff --git a/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java b/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java index a341c5be877..c64b21c7d1b 100644 --- a/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java +++ b/test/hotspot/jtreg/runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java @@ -55,6 +55,7 @@ public class TestPrimitiveArrayCriticalWithBadParam { private static void runTest() { List pbArgs = new ArrayList<>(); + pbArgs.add("-XX:-CreateCoredumpOnCrash"); pbArgs.add("-Xcheck:jni"); pbArgs.add("-Djava.library.path=" + Utils.TEST_NATIVE_PATH); pbArgs.add(TestPrimitiveArrayCriticalWithBadParam.class.getName()); -- GitLab From 032067264fd73cd2f338838d6178f8af24d228b0 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 23 Nov 2021 17:14:59 +0000 Subject: [PATCH 452/890] 8277451: java.lang.reflect.Field::set on static field with invalid argument type should throw IAE Reviewed-by: alanb --- .../internal/reflect/FieldAccessorImpl.java | 12 +- .../MethodHandleBooleanFieldAccessorImpl.java | 8 +- .../MethodHandleByteFieldAccessorImpl.java | 7 +- ...ethodHandleCharacterFieldAccessorImpl.java | 7 +- .../MethodHandleDoubleFieldAccessorImpl.java | 7 +- .../MethodHandleFieldAccessorImpl.java | 24 +- .../MethodHandleFloatFieldAccessorImpl.java | 7 +- .../MethodHandleIntegerFieldAccessorImpl.java | 7 +- .../MethodHandleLongFieldAccessorImpl.java | 7 +- .../MethodHandleObjectFieldAccessorImpl.java | 7 +- .../MethodHandleShortFieldAccessorImpl.java | 7 +- .../java/lang/reflect/Field/NegativeTest.java | 582 ++++++++++++++++++ .../reflect/MethodHandleAccessorsTest.java | 36 +- 13 files changed, 664 insertions(+), 54 deletions(-) create mode 100644 test/jdk/java/lang/reflect/Field/NegativeTest.java diff --git a/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java index cba836c5edd..baeb6bf8956 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/FieldAccessorImpl.java @@ -120,7 +120,7 @@ abstract class FieldAccessorImpl extends MagicAccessorImpl } } - private String getQualifiedFieldName() { + protected String getQualifiedFieldName() { return field.getDeclaringClass().getName() + "." +field.getName(); } @@ -223,16 +223,6 @@ abstract class FieldAccessorImpl extends MagicAccessorImpl return err; } - protected String getMessage(boolean getter, String attemptedType) { - String err = "Can not " + (getter ? "get" : "set"); - if (Modifier.isStatic(field.getModifiers())) - err += " static"; - if (Modifier.isFinal(field.getModifiers())) - err += " final"; - err += " " + field.getType().getName() + " field " + getQualifiedFieldName() + " on " + attemptedType; - return err; - } - protected void throwSetIllegalArgumentException(String attemptedType, String attemptedValue) { throw new IllegalArgumentException(getSetMessage(attemptedType,attemptedValue)); diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java index 10ec2f0e909..2e0609264bd 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleBooleanFieldAccessorImpl.java @@ -56,7 +56,6 @@ class MethodHandleBooleanFieldAccessorImpl extends MethodHandleFieldAccessorImpl } public boolean getBoolean(Object obj) throws IllegalArgumentException { - ensureObj(obj); try { if (isStatic()) { return (boolean) getter.invokeExact(); @@ -66,7 +65,7 @@ class MethodHandleBooleanFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -122,8 +121,8 @@ class MethodHandleBooleanFieldAccessorImpl extends MethodHandleFieldAccessorImpl public void setBoolean(Object obj, boolean z) throws IllegalArgumentException, IllegalAccessException { - ensureObj(obj); if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(z); } try { @@ -135,7 +134,8 @@ class MethodHandleBooleanFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java index 7e88e080854..b56fbbcbcb2 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleByteFieldAccessorImpl.java @@ -69,7 +69,7 @@ class MethodHandleByteFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -127,8 +127,8 @@ class MethodHandleByteFieldAccessorImpl extends MethodHandleFieldAccessorImpl { public void setByte(Object obj, byte b) throws IllegalArgumentException, IllegalAccessException { - ensureObj(obj); if (isReadOnly()) { + ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(b); } try { @@ -140,7 +140,8 @@ class MethodHandleByteFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java index 1e8b4e25525..c1f357326f4 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleCharacterFieldAccessorImpl.java @@ -73,7 +73,7 @@ class MethodHandleCharacterFieldAccessorImpl extends MethodHandleFieldAccessorIm } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -102,8 +102,8 @@ class MethodHandleCharacterFieldAccessorImpl extends MethodHandleFieldAccessorIm public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } @@ -146,7 +146,8 @@ class MethodHandleCharacterFieldAccessorImpl extends MethodHandleFieldAccessorIm } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java index 2d370c331be..01652951e42 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleDoubleFieldAccessorImpl.java @@ -93,7 +93,7 @@ class MethodHandleDoubleFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -102,8 +102,8 @@ class MethodHandleDoubleFieldAccessorImpl extends MethodHandleFieldAccessorImpl public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } @@ -195,7 +195,8 @@ class MethodHandleDoubleFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java index ab59b61d1a2..f979d38f9ab 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFieldAccessorImpl.java @@ -27,6 +27,7 @@ package jdk.internal.reflect; import java.lang.invoke.MethodHandle; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; abstract class MethodHandleFieldAccessorImpl extends FieldAccessorImpl { private static final int IS_READ_ONLY_BIT = 0x0001; @@ -64,21 +65,32 @@ abstract class MethodHandleFieldAccessorImpl extends FieldAccessorImpl { } } + private String getMessage(boolean getter, Class type) { + String err = "Can not " + (getter ? "get" : "set"); + if (Modifier.isStatic(field.getModifiers())) + err += " static"; + if (Modifier.isFinal(field.getModifiers())) + err += " final"; + err += " " + field.getType().getName() + " field " + getQualifiedFieldName(); + if (type != null) { + err += " on " + type.getName(); + } + return err; + } + /** * IllegalArgumentException because Field::get on the specified object, which * is not an instance of the class or interface declaring the underlying method */ - protected IllegalArgumentException newGetIllegalArgumentException(Class type) { - return new IllegalArgumentException(getMessage(true, type.getName())); + protected IllegalArgumentException newGetIllegalArgumentException(Object o) { + return new IllegalArgumentException(getMessage(true, o != null ? o.getClass() : null)); } /** * IllegalArgumentException because Field::set on the specified object, which * is not an instance of the class or interface declaring the underlying method */ - protected IllegalArgumentException newSetIllegalArgumentException(Class type) { - return new IllegalArgumentException(getMessage(false, type.getName())); + protected IllegalArgumentException newSetIllegalArgumentException(Object o) { + return new IllegalArgumentException(getMessage(false, o != null ? o.getClass() : null)); } - - } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java index ee1850f33a8..5ac00ec5ea8 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleFloatFieldAccessorImpl.java @@ -89,7 +89,7 @@ class MethodHandleFloatFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -102,8 +102,8 @@ class MethodHandleFloatFieldAccessorImpl extends MethodHandleFieldAccessorImpl { public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } @@ -186,7 +186,8 @@ class MethodHandleFloatFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java index 19a17cc1ca3..62e3ab083db 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleIntegerFieldAccessorImpl.java @@ -81,7 +81,7 @@ class MethodHandleIntegerFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -102,8 +102,8 @@ class MethodHandleIntegerFieldAccessorImpl extends MethodHandleFieldAccessorImpl public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } @@ -168,7 +168,8 @@ class MethodHandleIntegerFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java index 42ef4c75c05..a0e02204b31 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleLongFieldAccessorImpl.java @@ -85,7 +85,7 @@ class MethodHandleLongFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -102,8 +102,8 @@ class MethodHandleLongFieldAccessorImpl extends MethodHandleFieldAccessorImpl { public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } @@ -177,7 +177,8 @@ class MethodHandleLongFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java index 57da6081c84..722d73d22a6 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleObjectFieldAccessorImpl.java @@ -58,7 +58,7 @@ class MethodHandleObjectFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -98,8 +98,8 @@ class MethodHandleObjectFieldAccessorImpl extends MethodHandleFieldAccessorImpl @Override public void set(Object obj, Object value) throws IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } try { @@ -111,7 +111,8 @@ class MethodHandleObjectFieldAccessorImpl extends MethodHandleFieldAccessorImpl } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // already ensure the receiver type. So this CCE is due to the value. + throwSetIllegalArgumentException(value); } catch (Throwable e) { throw new InternalError(e); } diff --git a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java index d9ac93d7276..265c555421a 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java +++ b/src/java.base/share/classes/jdk/internal/reflect/MethodHandleShortFieldAccessorImpl.java @@ -77,7 +77,7 @@ class MethodHandleShortFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newGetIllegalArgumentException(obj.getClass()); + throw newGetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } @@ -102,8 +102,8 @@ class MethodHandleShortFieldAccessorImpl extends MethodHandleFieldAccessorImpl { public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { + ensureObj(obj); if (isReadOnly()) { - ensureObj(obj); // throw NPE if obj is null on instance field throwFinalFieldIllegalAccessException(value); } @@ -156,7 +156,8 @@ class MethodHandleShortFieldAccessorImpl extends MethodHandleFieldAccessorImpl { } catch (IllegalArgumentException|NullPointerException e) { throw e; } catch (ClassCastException e) { - throw newSetIllegalArgumentException(obj.getClass()); + // receiver is of invalid type + throw newSetIllegalArgumentException(obj); } catch (Throwable e) { throw new InternalError(e); } diff --git a/test/jdk/java/lang/reflect/Field/NegativeTest.java b/test/jdk/java/lang/reflect/Field/NegativeTest.java new file mode 100644 index 00000000000..c8a08beadb4 --- /dev/null +++ b/test/jdk/java/lang/reflect/Field/NegativeTest.java @@ -0,0 +1,582 @@ +/* + * Copyright (c) 2021, 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 8277451 + * @run testng/othervm -Djdk.reflect.useDirectMethodHandle=true NegativeTest + * @run testng/othervm -Djdk.reflect.useDirectMethodHandle=false NegativeTest + * @summary Test exception thrown due to bad receiver and bad value on + * Field with and without setAccessible(true) + */ + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +public class NegativeTest { + static class Fields { + public static int si; + public static char sc; + public static byte sb; + public static short ss; + public static long sl; + public static double sd; + public static float sf; + public static boolean sz; + public static String so; + + public static final int sfi = 10; + public static final char sfc = 'a'; + public static final byte sfb = 1; + public static final short sfs = 2; + public static final long sfl = 1000L; + public static final double sfd = 1.0; + public static final float sff = 2.0f; + public static final boolean sfz = true; + public static final String sfo = "abc"; + + public int i; + public char c; + public byte b; + public short s; + public long l; + public double d; + public float f; + public boolean z; + public String o; + + public final int fi = 10; + public final char fc = 'a'; + public final byte fb = 1; + public final short fs = 2; + public final long fl = 1000L; + public final double fd = 1.0; + public final float ff = 2.0f; + public final boolean fz = true; + public final String fo = "abc"; + } + + static final Field i_field = field("i", false); + static final Field c_field = field("c", false); + static final Field b_field = field("b", false); + static final Field s_field = field("s", false); + static final Field l_field = field("l", false); + static final Field d_field = field("d", false); + static final Field f_field = field("f", false); + static final Field z_field = field("z", false); + static final Field o_field = field("o", false); + static final Field fi_field = field("fi", false); + static final Field fc_field = field("fc", false); + static final Field fb_field = field("fb", false); + static final Field fs_field = field("fs", false); + static final Field fl_field = field("fl", false); + static final Field fd_field = field("fd", false); + static final Field ff_field = field("ff", false); + static final Field fz_field = field("fz", false); + static final Field fo_field = field("fo", false); + + static final Field override_i_field = field("i", true); + static final Field override_c_field = field("c", true); + static final Field override_b_field = field("b", true); + static final Field override_s_field = field("s", true); + static final Field override_l_field = field("l", true); + static final Field override_d_field = field("d", true); + static final Field override_f_field = field("f", true); + static final Field override_z_field = field("z", true); + static final Field override_o_field = field("o", true); + static final Field override_fi_field = field("fi", true); + static final Field override_fc_field = field("fc", true); + static final Field override_fb_field = field("fb", true); + static final Field override_fs_field = field("fs", true); + static final Field override_fl_field = field("fl", true); + static final Field override_fd_field = field("fd", true); + static final Field override_ff_field = field("ff", true); + static final Field override_fz_field = field("fz", true); + static final Field override_fo_field = field("fo", true); + + static final Field si_field = field("si", false); + static final Field sc_field = field("sc", false); + static final Field sb_field = field("sb", false); + static final Field ss_field = field("ss", false); + static final Field sl_field = field("sl", false); + static final Field sd_field = field("sd", false); + static final Field sf_field = field("sf", false); + static final Field sz_field = field("sz", false); + static final Field so_field = field("so", false); + static final Field sfi_field = field("sfi", false); + static final Field sfc_field = field("sfc", false); + static final Field sfb_field = field("sfb", false); + static final Field sfs_field = field("sfs", false); + static final Field sfl_field = field("sfl", false); + static final Field sfd_field = field("sfd", false); + static final Field sff_field = field("sff", false); + static final Field sfz_field = field("sfz", false); + static final Field sfo_field = field("sfo", false); + + static final Field override_si_field = field("si", true); + static final Field override_sc_field = field("sc", true); + static final Field override_sb_field = field("sb", true); + static final Field override_ss_field = field("ss", true); + static final Field override_sl_field = field("sl", true); + static final Field override_sd_field = field("sd", true); + static final Field override_sf_field = field("sf", true); + static final Field override_sz_field = field("sz", true); + static final Field override_so_field = field("so", true); + static final Field override_sfi_field = field("sfi", true); + static final Field override_sfc_field = field("sfc", true); + static final Field override_sfb_field = field("sfb", true); + static final Field override_sfs_field = field("sfs", true); + static final Field override_sfl_field = field("sfl", true); + static final Field override_sfd_field = field("sfd", true); + static final Field override_sff_field = field("sff", true); + static final Field override_sfz_field = field("sfz", true); + static final Field override_sfo_field = field("sfo", true); + + private static Field field(String name, boolean suppressAccessCheck) { + try { + Field f = Fields.class.getDeclaredField(name); + if (suppressAccessCheck) { + f.setAccessible(true); + } + return f; + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + @DataProvider(name = "instanceFields") + private Object[][] instanceFields() { + return new Object[][]{ + new Object[]{i_field}, + new Object[]{c_field}, + new Object[]{b_field}, + new Object[]{s_field}, + new Object[]{l_field}, + new Object[]{d_field}, + new Object[]{f_field}, + new Object[]{z_field}, + new Object[]{o_field}, + new Object[]{override_i_field}, + new Object[]{override_c_field}, + new Object[]{override_b_field}, + new Object[]{override_s_field}, + new Object[]{override_l_field}, + new Object[]{override_d_field}, + new Object[]{override_f_field}, + new Object[]{override_z_field}, + new Object[]{override_o_field}, + // final instance fields + new Object[]{fi_field}, + new Object[]{fc_field}, + new Object[]{fb_field}, + new Object[]{fs_field}, + new Object[]{fl_field}, + new Object[]{fd_field}, + new Object[]{ff_field}, + new Object[]{fz_field}, + new Object[]{fo_field}, + new Object[]{override_fi_field}, + new Object[]{override_fc_field}, + new Object[]{override_fb_field}, + new Object[]{override_fs_field}, + new Object[]{override_fl_field}, + new Object[]{override_fd_field}, + new Object[]{override_ff_field}, + new Object[]{override_fz_field}, + new Object[]{override_fo_field}, + }; + } + private static Fields INSTANCE = new Fields(); + + /* + * Test Field::get on a good receiver, a bad receiver and null. + * + * IllegalArgumentException is thrown if the receiver is of + * a bad type. NullPointerException is thrown if the receiver is null. + */ + @Test(dataProvider = "instanceFields") + public void testReceiver(Field f) throws ReflectiveOperationException { + f.get(INSTANCE); // good receiver + + testBadReceiver(f); + testNullReceiver(f); + } + + /* + * IllegalArgumentException should be thrown for bad receiver type + */ + private void testBadReceiver(Field f) throws ReflectiveOperationException { + assertFalse(Modifier.isStatic(f.getModifiers())); // instance field + Object badObj = new NegativeTest(); + try { + f.get(badObj); + fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } + Class fType = f.getType(); + if (fType.isPrimitive()) { + try { + switch (fType.descriptorString()) { + case "B" -> f.getByte(badObj); + case "C" -> f.getChar(badObj); + case "D" -> f.getDouble(badObj); + case "F" -> f.getFloat(badObj); + case "I" -> f.getInt(badObj); + case "J" -> f.getLong(badObj); + case "S" -> f.getShort(badObj); + case "Z" -> f.getBoolean(badObj); + } + fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } + } + } + + /* + * NullPointerException should be thrown for null receiver + */ + private void testNullReceiver(Field f) throws ReflectiveOperationException { + assertFalse(Modifier.isStatic(f.getModifiers())); // instance field + try { + f.get(null); + fail("expected NullPointerException"); + } catch (NullPointerException e) { + // expected + } + + Class fType = f.getType(); + if (fType.isPrimitive()) { + try { + switch (fType.descriptorString()) { + case "B" -> f.getByte(null); + case "C" -> f.getChar(null); + case "D" -> f.getDouble(null); + case "F" -> f.getFloat(null); + case "I" -> f.getInt(null); + case "J" -> f.getLong(null); + case "S" -> f.getShort(null); + case "Z" -> f.getBoolean(null); + } + fail("expected NullPointerException"); + } catch (NullPointerException e) { + // expected + } + } + } + + @DataProvider(name = "writeableFields") + private Object[][] writeableFields() { + Fields obj = new Fields(); + return new Object[][]{ + // instance fields with and without setAccessible(true) + new Object[]{i_field, obj, Integer.valueOf(10)}, + new Object[]{c_field, obj, Character.valueOf('c')}, + new Object[]{b_field, obj, Byte.valueOf((byte)1)}, + new Object[]{s_field, obj, Short.valueOf((short)2)}, + new Object[]{l_field, obj, Long.valueOf(1000)}, + new Object[]{d_field, obj, Double.valueOf(1.2)}, + new Object[]{f_field, obj, Float.valueOf(2.5f)}, + new Object[]{z_field, obj, Boolean.valueOf(true)}, + new Object[]{o_field, obj, "good-value"}, + new Object[]{override_i_field, obj, Integer.valueOf(10)}, + new Object[]{override_c_field, obj, Character.valueOf('c')}, + new Object[]{override_b_field, obj, Byte.valueOf((byte)1)}, + new Object[]{override_s_field, obj, Short.valueOf((short)2)}, + new Object[]{override_l_field, obj, Long.valueOf(1000)}, + new Object[]{override_d_field, obj, Double.valueOf(1.2)}, + new Object[]{override_f_field, obj, Float.valueOf(2.5f)}, + new Object[]{override_z_field, obj, Boolean.valueOf(true)}, + new Object[]{override_o_field, obj, "good-value"}, + // instance final fields with setAccessible(true) + new Object[]{override_fi_field, obj, Integer.valueOf(10)}, + new Object[]{override_fc_field, obj, Character.valueOf('c')}, + new Object[]{override_fb_field, obj, Byte.valueOf((byte)1)}, + new Object[]{override_fs_field, obj, Short.valueOf((short)2)}, + new Object[]{override_fl_field, obj, Long.valueOf(1000)}, + new Object[]{override_fd_field, obj, Double.valueOf(1.2)}, + new Object[]{override_ff_field, obj, Float.valueOf(2.5f)}, + new Object[]{override_fz_field, obj, Boolean.valueOf(true)}, + new Object[]{override_fo_field, obj, "good-value"}, + // static fields with and without setAccessible(true) + new Object[]{si_field, null, Integer.valueOf(10)}, + new Object[]{sc_field, null, Character.valueOf('c')}, + new Object[]{sb_field, null, Byte.valueOf((byte)1)}, + new Object[]{ss_field, null, Short.valueOf((short)2)}, + new Object[]{sl_field, null, Long.valueOf(1000)}, + new Object[]{sd_field, null, Double.valueOf(1.2)}, + new Object[]{sf_field, null, Float.valueOf(2.5f)}, + new Object[]{sz_field, null, Boolean.valueOf(true)}, + new Object[]{so_field, null, "good-value"}, + new Object[]{override_si_field, null, Integer.valueOf(10)}, + new Object[]{override_sc_field, null, Character.valueOf('c')}, + new Object[]{override_sb_field, null, Byte.valueOf((byte)1)}, + new Object[]{override_ss_field, null, Short.valueOf((short)2)}, + new Object[]{override_sl_field, null, Long.valueOf(1000)}, + new Object[]{override_sd_field, null, Double.valueOf(1.2)}, + new Object[]{override_sf_field, null, Float.valueOf(2.5f)}, + new Object[]{override_sz_field, null, Boolean.valueOf(true)}, + new Object[]{override_so_field, null, "good-value"}, + }; + } + + /* + * Test Field::set with a good and bad value. + * Test setting to null if the field type is primitive. + * + * IllegalArgumentException is thrown if the value is of a bad type or null. + * NullPointerException is thrown if the receiver of an instance field is null. + * The receiver is checked + */ + @Test(dataProvider = "writeableFields") + public void testSetValue(Field f, Object obj, Object value) throws IllegalAccessException { + f.set(obj, value); + Class fType = f.getType(); + if (fType.isPrimitive()) { + switch (fType.descriptorString()) { + case "B" -> f.setByte(obj, ((Byte) value).byteValue()); + case "C" -> f.setChar(obj, ((Character) value).charValue()); + case "D" -> f.setDouble(obj, ((Double) value).doubleValue()); + case "F" -> f.setFloat(obj, ((Float) value).floatValue()); + case "I" -> f.setInt(obj, ((Integer) value).intValue()); + case "J" -> f.setLong(obj, ((Long) value).longValue()); + case "S" -> f.setShort(obj, ((Short) value).shortValue()); + case "Z" -> f.setBoolean(obj, ((Boolean) value).booleanValue()); + } + + // test null value only if it's primitive type + try { + f.set(obj, null); + fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } + } + + Object badValue = new NegativeTest(); + try { + f.set(obj, badValue); + fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } + } + + @DataProvider(name = "readOnlyFinalFields") + private Object[][] readOnlyFinalFields() { + Object obj = INSTANCE; + return new Object[][]{ + // instance final fields + new Object[]{fi_field, obj, Integer.valueOf(10)}, + new Object[]{fc_field, obj, Character.valueOf('c')}, + new Object[]{fb_field, obj, Byte.valueOf((byte)1)}, + new Object[]{fs_field, obj, Short.valueOf((short)2)}, + new Object[]{fl_field, obj, Long.valueOf(1000)}, + new Object[]{fd_field, obj, Double.valueOf(1.2)}, + new Object[]{ff_field, obj, Float.valueOf(2.5f)}, + new Object[]{fz_field, obj, Boolean.valueOf(true)}, + new Object[]{fo_field, obj, "good-value"}, + // static final fields + new Object[]{sfi_field, null, Integer.valueOf(10)}, + new Object[]{sfc_field, null, Character.valueOf('c')}, + new Object[]{sfb_field, null, Byte.valueOf((byte)1)}, + new Object[]{sfs_field, null, Short.valueOf((short)2)}, + new Object[]{sfl_field, null, Long.valueOf(1000)}, + new Object[]{sfd_field, null, Double.valueOf(1.2)}, + new Object[]{sff_field, null, Float.valueOf(2.5f)}, + new Object[]{sfz_field, null, Boolean.valueOf(true)}, + new Object[]{sfo_field, null, "good-value"}, + new Object[]{override_sfi_field, null, Integer.valueOf(10)}, + new Object[]{override_sfc_field, null, Character.valueOf('c')}, + new Object[]{override_sfb_field, null, Byte.valueOf((byte)1)}, + new Object[]{override_sfs_field, null, Short.valueOf((short)2)}, + new Object[]{override_sfl_field, null, Long.valueOf(1000)}, + new Object[]{override_sfd_field, null, Double.valueOf(1.2)}, + new Object[]{override_sff_field, null, Float.valueOf(2.5f)}, + new Object[]{override_sfz_field, null, Boolean.valueOf(true)}, + new Object[]{override_sfo_field, null, "good-value"}, + }; + } + + /* + * Test Field::set on a read-only final field. + * IllegalAccessException is thrown regardless of whether the value + * is of a bad type or not. + */ + @Test(dataProvider = "readOnlyFinalFields") + public void testSetValueOnFinalField(Field f, Object obj, Object value) { + assertTrue(Modifier.isFinal(f.getModifiers())); + try { + f.set(obj, value); + fail("expected IllegalAccessException"); + } catch (IllegalAccessException e) { + // expected + } + + Class fType = f.getType(); + if (fType.isPrimitive()) { + try { + switch (fType.descriptorString()) { + case "B" -> f.setByte(obj, ((Byte)value).byteValue()); + case "C" -> f.setChar(obj, ((Character)value).charValue()); + case "D" -> f.setDouble(obj, ((Double)value).doubleValue()); + case "F" -> f.setFloat(obj, ((Float)value).floatValue()); + case "I" -> f.setInt(obj, ((Integer)value).intValue()); + case "J" -> f.setLong(obj, ((Long)value).longValue()); + case "S" -> f.setShort(obj, ((Short)value).shortValue()); + case "Z" -> f.setBoolean(obj, ((Boolean)value).booleanValue()); + } + fail("expected IllegalAccessException"); + } catch (IllegalAccessException e) { + // expected + } + + // test null value only if it's primitive type + try { + f.set(obj, null); + fail("expected IllegalAccessException"); + } catch (IllegalAccessException e) { + // expected + } + } + + Object badValue = new NegativeTest(); + try { + f.set(obj, badValue); + fail("expected IllegalAccessException"); + } catch (IllegalAccessException e) { + // expected + } + } + + + + @DataProvider(name = "finalInstanceFields") + private Object[][] finalInstanceFields() { + return new Object[][]{ + new Object[]{fi_field, Integer.valueOf(10)}, + new Object[]{fc_field, Character.valueOf('c')}, + new Object[]{fb_field, Byte.valueOf((byte) 1)}, + new Object[]{fs_field, Short.valueOf((short) 2)}, + new Object[]{fl_field, Long.valueOf(1000)}, + new Object[]{fd_field, Double.valueOf(1.2)}, + new Object[]{ff_field, Float.valueOf(2.5f)}, + new Object[]{fz_field, Boolean.valueOf(true)}, + new Object[]{fo_field, "good-value"}, + }; + } + + /* + * Test Field::set on a final instance field with either a bad receiver + * or null. IllegalArgumentException is thrown if the receiver is of + * a bad type. NullPointerException is thrown if the receiver is null. + * The receiver is checked before the access check is performed and + * also before the value is checked. + */ + @Test(dataProvider = "finalInstanceFields") + public void testReceiverOnFinalField(Field f, Object value) { + assertTrue(Modifier.isFinal(f.getModifiers())); + Object badReceiver = new NegativeTest(); + // set the field with a bad receiver with a good value + try { + f.set(badReceiver, value); + fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } catch (IllegalAccessException e) { + throw new RuntimeException("Expected IllegalArgumentException but got: " + e.getMessage(), e); + } + + // set the field with a bad receiver with a bad value + Object badValue = new NegativeTest(); + try { + f.set(badReceiver, badValue); + fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } catch (IllegalAccessException e) { + throw new RuntimeException("Expected IllegalArgumentException but got: " + e.getMessage(), e); + } + + // set the field with a null receiver with a good value + try { + f.set(null, value); + fail("expected NullPointerException"); + } catch (NullPointerException e) { + // expected + } catch (IllegalAccessException e) { + throw new RuntimeException("Expected NullPointerException but got: " + e.getMessage(), e); + } + // set the field with a null receiver with a bad value + try { + f.set(null, badValue); + fail("expected NullPointerException"); + } catch (NullPointerException e) { + // expected + } catch (IllegalAccessException e) { + throw new RuntimeException("Expected NullPointerException but got: " + e.getMessage(), e); + } + + Class fType = f.getType(); + if (fType.isPrimitive()) { + // test bad receiver + try { + switch (fType.descriptorString()) { + case "B" -> f.setByte(badReceiver, ((Byte) value).byteValue()); + case "C" -> f.setChar(badReceiver, ((Character) value).charValue()); + case "D" -> f.setDouble(badReceiver, ((Double) value).doubleValue()); + case "F" -> f.setFloat(badReceiver, ((Float) value).floatValue()); + case "I" -> f.setInt(badReceiver, ((Integer) value).intValue()); + case "J" -> f.setLong(badReceiver, ((Long) value).longValue()); + case "S" -> f.setShort(badReceiver, ((Short) value).shortValue()); + case "Z" -> f.setBoolean(badReceiver, ((Boolean) value).booleanValue()); + } + } catch (IllegalArgumentException e) { + } catch (IllegalAccessException e) { + throw new RuntimeException("Expected IllegalArgumentException but got: " + e.getMessage(), e); + } + // test null receiver + try { + switch (fType.descriptorString()) { + case "B" -> f.setByte(null, ((Byte) value).byteValue()); + case "C" -> f.setChar(null, ((Character) value).charValue()); + case "D" -> f.setDouble(null, ((Double) value).doubleValue()); + case "F" -> f.setFloat(null, ((Float) value).floatValue()); + case "I" -> f.setInt(null, ((Integer) value).intValue()); + case "J" -> f.setLong(null, ((Long) value).longValue()); + case "S" -> f.setShort(null, ((Short) value).shortValue()); + case "Z" -> f.setBoolean(null, ((Boolean) value).booleanValue()); + } + } catch (NullPointerException e) { + // expected + } catch (IllegalAccessException e) { + throw new RuntimeException("Expected NullPointerException but got: " + e.getMessage(), e); + } + } + } +} diff --git a/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java b/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java index 3b702edc5f3..1636bd70445 100644 --- a/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java +++ b/test/jdk/java/lang/reflect/MethodHandleAccessorsTest.java @@ -115,6 +115,8 @@ public class MethodHandleAccessorsTest { public static final int STATIC_FINAL = 1; private final int i; private final String s; + private static String name = "name"; + private byte b = 9; public Public() { this.i = 0; @@ -130,6 +132,11 @@ public class MethodHandleAccessorsTest { this.i = 0; this.s = s; } + public Public(byte b) { + this.b = b; + this.i = 0; + this.s = null; + } public Public(int first, int... rest) { this(varargs_primitive(first, rest)); @@ -162,6 +169,7 @@ public class MethodHandleAccessorsTest { return "Public{" + "i=" + i + ", s='" + s + '\'' + + ", b=" + b + '}'; } } @@ -385,11 +393,14 @@ public class MethodHandleAccessorsTest { new IllegalArgumentException("argument type mismatch"), new IllegalArgumentException("object is not an instance of declaring class"), }; - private static final Throwable[] cannot_get_final_field = new Throwable[] { - new IllegalArgumentException("Can not get final") + private static final Throwable[] cannot_get_field = new Throwable[] { + new IllegalArgumentException("Can not get") + }; + private static final Throwable[] cannot_set_field = new Throwable[] { + new IllegalArgumentException("Can not set") }; - private static final Throwable[] cannot_set_final_field = new Throwable[] { - new IllegalArgumentException("Can not set final") + private static final Throwable[] mismatched_field_type = new Throwable[] { + new IllegalArgumentException("Can not set") }; private static final Throwable[] wrong_argument_count_no_details = new Throwable[] { new IllegalArgumentException("wrong number of arguments") @@ -592,23 +603,30 @@ public class MethodHandleAccessorsTest { @DataProvider(name = "readAccess") private Object[][] readAccess() { boolean newImpl = Boolean.getBoolean("jdk.reflect.useDirectMethodHandle"); + String wrongInst = new String(); return new Object[][]{ new Object[]{"i", new Public(100), 100, noException}, new Object[]{"s", new Public("test"), "test", noException}, - new Object[]{"s", new Object(), "test", - newImpl ? cannot_get_final_field : cannot_set_final_field}, new Object[]{"s", null, "test", null_target}, + new Object[]{"s", wrongInst, "test", + newImpl ? cannot_get_field : cannot_set_field}, + new Object[]{"b", wrongInst, 0, + newImpl ? cannot_get_field : cannot_set_field}, }; } @DataProvider(name = "writeAccess") private Object[][] writeAccess() { + Object o = new Object(); + byte b = 1; return new Object[][]{ new Object[]{"i", new Public(100), 100, 200, noException}, + new Object[]{"i", new Public(100), 100, Integer.valueOf(10), noException}, new Object[]{"s", new Public("test"), "test", "newValue", noException}, - // ## no exception thrown - // new Object[]{"i", new Public(100), 100, new Object(), cannot_set_final_field}, - new Object[]{"s", new Object(), "test", "dummy", cannot_set_final_field}, new Object[]{"s", null, "test", "dummy", null_target}, + new Object[]{"b", new Public(b), b, null, mismatched_field_type}, + new Object[]{"b", new Public(b), b, Long.valueOf(10), mismatched_field_type}, + new Object[]{"name", null, "name", o, mismatched_field_type}, + new Object[]{"i", new Public(100), 100, o, mismatched_field_type}, }; } -- GitLab From ea85e01a4c8db1bc48d590abc882dc6efe5b0f4a Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Tue, 23 Nov 2021 18:14:47 +0000 Subject: [PATCH 453/890] 8271623: Omit enclosing instance fields from inner classes that don't use it Reviewed-by: vromero, jlahoda --- .../com/sun/tools/javac/comp/Lower.java | 71 ++++++++-- .../com/sun/tools/javac/jvm/Target.java | 7 + .../tools/javac/6521805/T6521805d.java | 9 +- .../tools/javac/6521805/T6521805d.out | 2 +- .../tools/javac/6521805/p/Outer.java | 9 +- .../ClassFileModifiers/MemberModifiers.out | 6 - .../classfile/AnnotatedExtendsTest.java | 4 +- ...ssToPrivateInnerClassConstructorsTest.java | 7 +- .../AccessToPrivateInnerClassMembersTest.java | 6 +- .../AccessToPrivateSiblingsTest.java | 6 +- .../Synthetic/BridgeMethodsForLambdaTest.java | 9 +- .../attributes/Synthetic/ThisFieldTest.java | 10 ++ .../examples/ErrSyntheticNameConflict.java | 9 +- .../DontOptimizeOuterThis.java | 84 +++++++++++ .../javac/optimizeOuterThis/InnerClasses.java | 130 ++++++++++++++++++ .../optimizeOuterThis/OptimizeOuterThis.java | 89 ++++++++++++ test/langtools/tools/javap/AnnoTest.java | 26 ++-- 17 files changed, 429 insertions(+), 55 deletions(-) create mode 100644 test/langtools/tools/javac/optimizeOuterThis/DontOptimizeOuterThis.java create mode 100644 test/langtools/tools/javac/optimizeOuterThis/InnerClasses.java create mode 100644 test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java index dd9f5507718..475e50d22bc 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java @@ -98,6 +98,7 @@ public class Lower extends TreeTranslator { private final boolean debugLower; private final boolean disableProtectedAccessors; // experimental private final PkgInfo pkginfoOpt; + private final boolean optimizeOuterThis; protected Lower(Context context) { context.put(lowerKey, this); @@ -119,6 +120,9 @@ public class Lower extends TreeTranslator { Options options = Options.instance(context); debugLower = options.isSet("debuglower"); pkginfoOpt = PkgInfo.get(options); + optimizeOuterThis = + target.optimizeOuterThis() || + options.getBoolean("optimizeOuterThis", false); disableProtectedAccessors = options.isSet("disableProtectedAccessors"); } @@ -1480,8 +1484,12 @@ public class Lower extends TreeTranslator { private VarSymbol makeOuterThisVarSymbol(Symbol owner, long flags) { Type target = types.erasure(owner.enclClass().type.getEnclosingType()); + // Set NOOUTERTHIS for all synthetic outer instance variables, and unset + // it when the variable is accessed. If the variable is never accessed, + // we skip creating an outer instance field and saving the constructor + // parameter to it. VarSymbol outerThis = - new VarSymbol(flags, outerThisName(target, owner), target, owner); + new VarSymbol(flags | NOOUTERTHIS, outerThisName(target, owner), target, owner); outerThisStack = outerThisStack.prepend(outerThis); return outerThis; } @@ -1728,6 +1736,7 @@ public class Lower extends TreeTranslator { } VarSymbol ot = ots.head; JCExpression tree = access(make.at(pos).Ident(ot)); + ot.flags_field &= ~NOOUTERTHIS; TypeSymbol otc = ot.type.tsym; while (otc != c) { do { @@ -1745,6 +1754,7 @@ public class Lower extends TreeTranslator { return makeNull(); } tree = access(make.at(pos).Select(tree, ot)); + ot.flags_field &= ~NOOUTERTHIS; otc = ot.type.tsym; } return tree; @@ -1784,6 +1794,7 @@ public class Lower extends TreeTranslator { } VarSymbol ot = ots.head; JCExpression tree = access(make.at(pos).Ident(ot)); + ot.flags_field &= ~NOOUTERTHIS; TypeSymbol otc = ot.type.tsym; while (!(preciseMatch ? sym.isMemberOf(otc, types) : otc.isSubClass(sym.owner, types))) { do { @@ -1796,6 +1807,7 @@ public class Lower extends TreeTranslator { ot = ots.head; } while (ot.owner != otc); tree = access(make.at(pos).Select(tree, ot)); + ot.flags_field &= ~NOOUTERTHIS; otc = ot.type.tsym; } return tree; @@ -1817,10 +1829,9 @@ public class Lower extends TreeTranslator { /** Return tree simulating the assignment {@code this.this$n = this$n}. */ - JCStatement initOuterThis(int pos) { - VarSymbol rhs = outerThisStack.head; + JCStatement initOuterThis(int pos, VarSymbol rhs) { Assert.check(rhs.owner.kind == MTH); - VarSymbol lhs = outerThisStack.tail.head; + VarSymbol lhs = outerThisStack.head; Assert.check(rhs.owner.owner == lhs.owner); make.at(pos); return @@ -2224,15 +2235,25 @@ public class Lower extends TreeTranslator { // Convert name to flat representation, replacing '.' by '$'. tree.name = Convert.shortName(currentClass.flatName()); - // Add this$n and free variables proxy definitions to class. + // Add free variables proxy definitions to class. for (List l = fvdefs; l.nonEmpty(); l = l.tail) { tree.defs = tree.defs.prepend(l.head); enterSynthetic(tree.pos(), l.head.sym, currentClass.members()); } - if (currentClass.hasOuterInstance()) { + // If this$n was accessed, add the field definition and + // update initial constructors to initialize it + if (currentClass.hasOuterInstance() && shouldEmitOuterThis(currentClass)) { tree.defs = tree.defs.prepend(otdef); enterSynthetic(tree.pos(), otdef.sym, currentClass.members()); + + for (JCTree def : tree.defs) { + if (TreeInfo.isInitialConstructor(def)) { + JCMethodDecl mdef = (JCMethodDecl) def; + mdef.body.stats = mdef.body.stats.prepend( + initOuterThis(mdef.body.pos, mdef.params.head.sym)); + } + } } proxies = prevProxies; @@ -2249,6 +2270,39 @@ public class Lower extends TreeTranslator { result = make_at(tree.pos()).Block(SYNTHETIC, List.nil()); } + private boolean shouldEmitOuterThis(ClassSymbol sym) { + if (!optimizeOuterThis) { + // Optimization is disabled + return true; + } + if ((outerThisStack.head.flags_field & NOOUTERTHIS) == 0) { + // Enclosing instance field is used + return true; + } + if (rs.isSerializable(sym.type) && !hasSerialVersionUID(sym)) { + // Class is serializable and does not have a stable serialVersionUID + return true; + } + return false; + } + + private boolean hasSerialVersionUID(ClassSymbol sym) { + VarSymbol svuid = (VarSymbol) sym.members().findFirst(names.serialVersionUID, f -> f.kind == VAR); + if (svuid == null) { + return false; + } + if ((svuid.flags() & (STATIC | FINAL)) != (STATIC | FINAL)) { + return false; + } + if (!svuid.type.hasTag(LONG)) { + return false; + } + if (svuid.getConstValue() == null) { + return false; + } + return true; + } + List generateMandatedAccessors(JCClassDecl tree) { List fields = TreeInfo.recordFields(tree); return tree.sym.getRecordComponents().stream() @@ -2703,11 +2757,6 @@ public class Lower extends TreeTranslator { olderasure.getThrownTypes(), syms.methodClass); } - if (currentClass.hasOuterInstance() && - TreeInfo.isInitialConstructor(tree)) - { - added = added.prepend(initOuterThis(tree.body.pos)); - } // pop local variables from proxy stack proxies = prevProxies; diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java index 27400d12580..fba0c2584c9 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java @@ -203,4 +203,11 @@ public enum Target { public boolean obsoleteAccStrict() { return compareTo(JDK1_17) >= 0; } + + /** Omit unused enclosing instance fields from inner classes that don't access enclosing + * instance state. + */ + public boolean optimizeOuterThis() { + return compareTo(JDK1_18) >= 0; + } } diff --git a/test/langtools/tools/javac/6521805/T6521805d.java b/test/langtools/tools/javac/6521805/T6521805d.java index 2cdce03c123..15535509d44 100644 --- a/test/langtools/tools/javac/6521805/T6521805d.java +++ b/test/langtools/tools/javac/6521805/T6521805d.java @@ -7,6 +7,8 @@ * @compile/fail/ref=T6521805d.out T6521805d.java -XDrawDiagnostics */ +import java.util.Objects; + class T6521805 { static class Inner extends T6521805.Outer { @@ -22,6 +24,11 @@ class T6521805 { } } - class Outer {} + class Outer { + { + // access enclosing instance so this$0 field is generated + Objects.requireNonNull(T6521805.this); + } + } } diff --git a/test/langtools/tools/javac/6521805/T6521805d.out b/test/langtools/tools/javac/6521805/T6521805d.out index 1cf1b8e229e..92562a1b535 100644 --- a/test/langtools/tools/javac/6521805/T6521805d.out +++ b/test/langtools/tools/javac/6521805/T6521805d.out @@ -1,2 +1,2 @@ -T6521805d.java:18:18: compiler.err.cannot.generate.class: T6521805.Inner, (compiler.misc.synthetic.name.conflict: this$0, T6521805.Inner) +T6521805d.java:20:18: compiler.err.cannot.generate.class: T6521805.Inner, (compiler.misc.synthetic.name.conflict: this$0, T6521805.Inner) 1 error diff --git a/test/langtools/tools/javac/6521805/p/Outer.java b/test/langtools/tools/javac/6521805/p/Outer.java index 8a92158426b..acbbfa0f91f 100644 --- a/test/langtools/tools/javac/6521805/p/Outer.java +++ b/test/langtools/tools/javac/6521805/p/Outer.java @@ -2,6 +2,13 @@ package p; +import java.util.Objects; + class Outer { - class Super {} + class Super { + { + // access enclosing instance so this$0 field is generated + Objects.requireNonNull(Outer.this); + } + } } diff --git a/test/langtools/tools/javac/ClassFileModifiers/MemberModifiers.out b/test/langtools/tools/javac/ClassFileModifiers/MemberModifiers.out index 35b1bc29ca9..6d26076a57f 100644 --- a/test/langtools/tools/javac/ClassFileModifiers/MemberModifiers.out +++ b/test/langtools/tools/javac/ClassFileModifiers/MemberModifiers.out @@ -1,8 +1,6 @@ CLASSFILE MemberModifiers.c --- SUPER -FIELD this$0 ---- FINAL METHOD --- @@ -20,8 +18,6 @@ METHOD m CLASSFILE MemberModifiersAux.Foo.c --- SUPER -FIELD this$1 ---- FINAL METHOD --- @@ -29,8 +25,6 @@ CLASSFILE MemberModifiersAux.Foo --- FINAL SUPER FIELD f --- -FIELD this$0 ---- FINAL METHOD --- METHOD m diff --git a/test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnnotatedExtendsTest.java b/test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnnotatedExtendsTest.java index 5705219aded..3c785debf42 100644 --- a/test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnnotatedExtendsTest.java +++ b/test/langtools/tools/javac/annotations/typeAnnotations/classfile/AnnotatedExtendsTest.java @@ -59,7 +59,7 @@ public class AnnotatedExtendsTest { .classes(classPath.toString()) .run() .getOutput(Task.OutputKind.DIRECT); - if (!javapOut.contains("0: #22(): CLASS_EXTENDS, type_index=65535")) + if (!javapOut.contains("0: #20(): CLASS_EXTENDS, type_index=65535")) throw new AssertionError("Expected output missing: " + javapOut); } -} \ No newline at end of file +} diff --git a/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassConstructorsTest.java b/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassConstructorsTest.java index 5fba9044c19..d7152de66ba 100644 --- a/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassConstructorsTest.java +++ b/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassConstructorsTest.java @@ -44,14 +44,11 @@ "(AccessToPrivateInnerClassConstructorsTest)", "(AccessToPrivateInnerClassConstructorsTest, " + "AccessToPrivateInnerClassConstructorsTest$1)"}, - expectedNumberOfSyntheticFields = 1, expectedNumberOfSyntheticMethods = 0) @ExpectedClass(className = "AccessToPrivateInnerClassConstructorsTest$1Local", - expectedMethods = {"(AccessToPrivateInnerClassConstructorsTest)"}, - expectedNumberOfSyntheticFields = 1) + expectedMethods = {"(AccessToPrivateInnerClassConstructorsTest)"}) @ExpectedClass(className = "AccessToPrivateInnerClassConstructorsTest$2Local", - expectedMethods = {"(AccessToPrivateInnerClassConstructorsTest)"}, - expectedNumberOfSyntheticFields = 1) + expectedMethods = {"(AccessToPrivateInnerClassConstructorsTest)"}) public class AccessToPrivateInnerClassConstructorsTest { public static void main(String... args) { diff --git a/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassMembersTest.java b/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassMembersTest.java index 79fdf5d7e61..171a7a5627b 100644 --- a/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassMembersTest.java +++ b/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateInnerClassMembersTest.java @@ -43,15 +43,13 @@ * 3. access method for private method function(). * 4. getter/setter for private field staticVar. * 5. access method for private method staticFunction(). - * 6. field this in Inner1. - * 7. constructor for Inner*. + * 6. constructor for Inner*. */ @ExpectedClass(className = "AccessToPrivateInnerClassMembersTest", expectedMethods = {"()", "()"}) @ExpectedClass(className = "AccessToPrivateInnerClassMembersTest$Inner1", expectedMethods = {"(AccessToPrivateInnerClassMembersTest)", "function()"}, - expectedFields = "var", - expectedNumberOfSyntheticFields = 1) + expectedFields = "var") @ExpectedClass(className = "AccessToPrivateInnerClassMembersTest$Inner2", expectedMethods = {"function()", "staticFunction()", "()"}, expectedFields = {"staticVar", "var"}) diff --git a/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateSiblingsTest.java b/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateSiblingsTest.java index 47269cf8776..c0e039f8344 100644 --- a/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateSiblingsTest.java +++ b/test/langtools/tools/javac/classfiles/attributes/Synthetic/AccessToPrivateSiblingsTest.java @@ -43,14 +43,12 @@ * 3. access method for private method function(). * 4. getter/setter for private field staticVar. * 5. access method for private method staticFunction(). - * 6. field this in Inner1. - * 7. constructor for Inner*. + * 6. constructor for Inner*. */ @ExpectedClass(className = "AccessToPrivateSiblingsTest", expectedMethods = "()") @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner1", expectedMethods = {"function()", "(AccessToPrivateSiblingsTest)"}, - expectedFields = "var", - expectedNumberOfSyntheticFields = 1) + expectedFields = "var") @ExpectedClass(className = "AccessToPrivateSiblingsTest$Inner2", expectedMethods = "(AccessToPrivateSiblingsTest)", expectedNumberOfSyntheticFields = 1) diff --git a/test/langtools/tools/javac/classfiles/attributes/Synthetic/BridgeMethodsForLambdaTest.java b/test/langtools/tools/javac/classfiles/attributes/Synthetic/BridgeMethodsForLambdaTest.java index 90d0659d2b3..51d9f324e06 100644 --- a/test/langtools/tools/javac/classfiles/attributes/Synthetic/BridgeMethodsForLambdaTest.java +++ b/test/langtools/tools/javac/classfiles/attributes/Synthetic/BridgeMethodsForLambdaTest.java @@ -55,19 +55,16 @@ import java.util.stream.IntStream; @ExpectedClass(className = "BridgeMethodsForLambdaTest$Inner1", expectedMethods = {"(BridgeMethodsForLambdaTest)", "function()", "run()"}, expectedFields = "lambda1", - expectedNumberOfSyntheticMethods = 1, - expectedNumberOfSyntheticFields = 1) + expectedNumberOfSyntheticMethods = 1) @ExpectedClass(className = "BridgeMethodsForLambdaTest$Inner2", expectedMethods = {"()", "staticFunction()"}, expectedFields = "lambda1", expectedNumberOfSyntheticMethods = 1) @ExpectedClass(className = "BridgeMethodsForLambdaTest$Inner3", - expectedMethods = {"(BridgeMethodsForLambdaTest)", "function()"}, - expectedNumberOfSyntheticFields = 1) + expectedMethods = {"(BridgeMethodsForLambdaTest)", "function()"}) @ExpectedClass(className = "BridgeMethodsForLambdaTest$Inner4", expectedMethods = {"(BridgeMethodsForLambdaTest)", "function()"}, - expectedNumberOfSyntheticMethods = 1, - expectedNumberOfSyntheticFields = 1) + expectedNumberOfSyntheticMethods = 1) public class BridgeMethodsForLambdaTest { private class Inner1 implements Runnable { diff --git a/test/langtools/tools/javac/classfiles/attributes/Synthetic/ThisFieldTest.java b/test/langtools/tools/javac/classfiles/attributes/Synthetic/ThisFieldTest.java index 605fb0cc6de..3ca6e65ef90 100644 --- a/test/langtools/tools/javac/classfiles/attributes/Synthetic/ThisFieldTest.java +++ b/test/langtools/tools/javac/classfiles/attributes/Synthetic/ThisFieldTest.java @@ -34,6 +34,8 @@ * @run main SyntheticTestDriver ThisFieldTest */ +import java.util.Objects; + /** * Synthetic members: * 1. fields this$0 for local and anonymous classes. @@ -49,9 +51,17 @@ public class ThisFieldTest { { class Local { + { + // access enclosing instance so this$0 field is generated + Objects.requireNonNull(ThisFieldTest.this); + } } new Local() { + { + // access enclosing instance so this$0 field is generated + Objects.requireNonNull(ThisFieldTest.this); + } }; } } diff --git a/test/langtools/tools/javac/diags/examples/ErrSyntheticNameConflict.java b/test/langtools/tools/javac/diags/examples/ErrSyntheticNameConflict.java index 45d523dc08a..d4b3ead499b 100644 --- a/test/langtools/tools/javac/diags/examples/ErrSyntheticNameConflict.java +++ b/test/langtools/tools/javac/diags/examples/ErrSyntheticNameConflict.java @@ -24,11 +24,18 @@ // key: compiler.err.cannot.generate.class // key: compiler.misc.synthetic.name.conflict +import java.util.Objects; + class ErrSyntheticNameConflict { static class Outer { ErrSyntheticNameConflict this$0 = null; } - public class Inner extends Outer { } + public class Inner extends Outer { + { + // access enclosing instance so this$0 field is generated + Objects.requireNonNull(ErrSyntheticNameConflict.this); + } + } } diff --git a/test/langtools/tools/javac/optimizeOuterThis/DontOptimizeOuterThis.java b/test/langtools/tools/javac/optimizeOuterThis/DontOptimizeOuterThis.java new file mode 100644 index 00000000000..dfba801d256 --- /dev/null +++ b/test/langtools/tools/javac/optimizeOuterThis/DontOptimizeOuterThis.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021, Google LLC. All rights reserved. + * 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.lang.reflect.Field; +import java.util.Arrays; +import java.util.Optional; + +/** + * @test + * @bug 8271623 + * + * @compile --release 17 DontOptimizeOuterThis.java InnerClasses.java + * @run main DontOptimizeOuterThis + */ +public class DontOptimizeOuterThis extends InnerClasses { + + public static void main(String[] args) { + new DontOptimizeOuterThis().test(); + } + + public void test() { + checkInner(localCapturesParameter(0), true); + checkInner(localCapturesLocal(), true); + checkInner(localCapturesEnclosing(), true); + + checkInner(anonCapturesParameter(0), true); + checkInner(anonCapturesLocal(), true); + checkInner(anonCapturesEnclosing(), true); + + checkInner(StaticMemberClass.class, false); // static + checkInner(NonStaticMemberClass.class, true); + checkInner(NonStaticMemberClassCapturesEnclosing.class, true); + + checkInner(N0.class, false); // static + checkInner(N0.N1.class, true); + checkInner(N0.N1.N2.class, true); + checkInner(N0.N1.N2.N3.class, true); + checkInner(N0.N1.N2.N3.N4.class, true); + checkInner(N0.N1.N2.N3.N4.N5.class, true); + + checkInner(SerializableCapture.class, true); + checkInner(SerializableWithSerialVersionUID.class, true); + checkInner(SerializableWithInvalidSerialVersionUIDType.class, true); + checkInner(SerializableWithInvalidSerialVersionUIDNonFinal.class, true); + checkInner(SerializableWithInvalidSerialVersionUIDNonStatic.class, true); + } + + private static void checkInner(Class clazz, boolean expectOuterThis) { + Optional outerThis = Arrays.stream(clazz.getDeclaredFields()) + .filter(f -> f.getName().startsWith("this$")).findFirst(); + if (expectOuterThis) { + if (outerThis.isEmpty()) { + throw new AssertionError( + String.format( + "expected %s to have an enclosing instance", clazz.getName())); + } + } else { + if (outerThis.isPresent()) { + throw new AssertionError( + String.format("%s had an unexpected enclosing instance", clazz.getName())); + } + } + } +} diff --git a/test/langtools/tools/javac/optimizeOuterThis/InnerClasses.java b/test/langtools/tools/javac/optimizeOuterThis/InnerClasses.java new file mode 100644 index 00000000000..2f4ea1ed615 --- /dev/null +++ b/test/langtools/tools/javac/optimizeOuterThis/InnerClasses.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2021, Google LLC. All rights reserved. + * 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.Serializable; + +public class InnerClasses { + + public Class localCapturesParameter(final int x) { + class Local { + public void f() { + System.err.println(x); + } + } + return Local.class; + } + + public Class localCapturesLocal() { + final int x = 0; + class Local { + public void f() { + System.err.println(x); + } + } + return Local.class; + } + + public Class localCapturesEnclosing() { + class Local { + public void f() { + System.err.println(InnerClasses.this); + } + } + return Local.class; + } + + public Class anonCapturesParameter(final int x) { + return new Object() { + public void f() { + System.err.println(x); + } + }.getClass(); + } + + public Class anonCapturesLocal() { + final int x = 0; + return new Object() { + public void f() { + System.err.println(x); + } + }.getClass(); + } + + public Class anonCapturesEnclosing() { + return new Object() { + public void f() { + System.err.println(InnerClasses.this); + } + }.getClass(); + } + + public static class StaticMemberClass {} + + public class NonStaticMemberClass {} + + public class NonStaticMemberClassCapturesEnclosing { + public void f() { + System.err.println(InnerClasses.this); + } + } + + static class N0 { + int x; + + class N1 { + class N2 { + class N3 { + void f() { + System.err.println(x); + } + + class N4 { + class N5 {} + } + } + } + } + } + + class SerializableCapture implements Serializable { + void f() { + System.err.println(InnerClasses.this); + } + } + + class SerializableWithSerialVersionUID implements Serializable { + private static final long serialVersionUID = 0; + } + + class SerializableWithInvalidSerialVersionUIDType implements Serializable { + private static final int serialVersionUID = 0; + } + + class SerializableWithInvalidSerialVersionUIDNonFinal implements Serializable { + private static long serialVersionUID = 0; + } + + class SerializableWithInvalidSerialVersionUIDNonStatic implements Serializable { + private final long serialVersionUID = 0; + } +} diff --git a/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java b/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java new file mode 100644 index 00000000000..1a01d61f94e --- /dev/null +++ b/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021, Google LLC. All rights reserved. + * 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.lang.reflect.Field; +import java.util.Arrays; +import java.util.Optional; + +/** + * @test + * @bug 8271623 + * + * @clean * + * @compile OptimizeOuterThis.java InnerClasses.java + * @run main OptimizeOuterThis + * + * @clean * + * @compile -XDoptimizeOuterThis=true --release 17 OptimizeOuterThis.java InnerClasses.java + * @run main OptimizeOuterThis + */ +public class OptimizeOuterThis extends InnerClasses { + + public static void main(String[] args) { + new OptimizeOuterThis().test(); + } + + public void test() { + checkInner(localCapturesParameter(0), false); + checkInner(localCapturesLocal(), false); + checkInner(localCapturesEnclosing(), true); + + checkInner(anonCapturesParameter(0), false); + checkInner(anonCapturesLocal(), false); + checkInner(anonCapturesEnclosing(), true); + + checkInner(StaticMemberClass.class, false); + checkInner(NonStaticMemberClass.class, false); + checkInner(NonStaticMemberClassCapturesEnclosing.class, true); + + checkInner(N0.class, false); + checkInner(N0.N1.class, true); + checkInner(N0.N1.N2.class, true); + checkInner(N0.N1.N2.N3.class, true); + checkInner(N0.N1.N2.N3.N4.class, false); + checkInner(N0.N1.N2.N3.N4.N5.class, false); + + checkInner(SerializableCapture.class, true); + checkInner(SerializableWithSerialVersionUID.class, false); + checkInner(SerializableWithInvalidSerialVersionUIDType.class, true); + checkInner(SerializableWithInvalidSerialVersionUIDNonFinal.class, true); + checkInner(SerializableWithInvalidSerialVersionUIDNonStatic.class, true); + } + + private static void checkInner(Class clazz, boolean expectOuterThis) { + Optional outerThis = Arrays.stream(clazz.getDeclaredFields()) + .filter(f -> f.getName().startsWith("this$")).findFirst(); + if (expectOuterThis) { + if (outerThis.isEmpty()) { + throw new AssertionError( + String.format( + "expected %s to have an enclosing instance", clazz.getName())); + } + } else { + if (outerThis.isPresent()) { + throw new AssertionError( + String.format("%s had an unexpected enclosing instance %s", clazz.getName(), outerThis.get())); + } + } + } +} diff --git a/test/langtools/tools/javap/AnnoTest.java b/test/langtools/tools/javap/AnnoTest.java index 7d78d163e29..649d7e7b38a 100644 --- a/test/langtools/tools/javap/AnnoTest.java +++ b/test/langtools/tools/javap/AnnoTest.java @@ -49,50 +49,50 @@ public class AnnoTest { expect(out, "RuntimeVisibleAnnotations:\n" + - " 0: #21(#22=B#23)\n" + + " 0: #17(#18=B#19)\n" + " AnnoTest$ByteAnno(\n" + " value=(byte) 42\n" + " )\n" + - " 1: #24(#22=S#25)\n" + + " 1: #20(#18=S#21)\n" + " AnnoTest$ShortAnno(\n" + " value=(short) 3\n" + " )"); expect(out, "RuntimeInvisibleAnnotations:\n" + - " 0: #27(#22=[J#28,J#30,J#32,J#34,J#36])\n" + + " 0: #23(#18=[J#24,J#26,J#28,J#30,J#32])\n" + " AnnoTest$ArrayAnno(\n" + " value=[1l,2l,3l,4l,5l]\n" + " )\n" + - " 1: #38(#22=Z#39)\n" + + " 1: #34(#18=Z#35)\n" + " AnnoTest$BooleanAnno(\n" + " value=false\n" + " )\n" + - " 2: #40(#41=c#42)\n" + + " 2: #36(#37=c#38)\n" + " AnnoTest$ClassAnno(\n" + " type=class Ljava/lang/Object;\n" + " )\n" + - " 3: #43(#44=e#45.#46)\n" + + " 3: #39(#40=e#41.#42)\n" + " AnnoTest$EnumAnno(\n" + " kind=Ljavax/lang/model/element/ElementKind;.PACKAGE\n" + " )\n" + - " 4: #47(#22=I#48)\n" + + " 4: #43(#18=I#44)\n" + " AnnoTest$IntAnno(\n" + " value=2\n" + " )\n" + - " 5: #49()\n" + + " 5: #45()\n" + " AnnoTest$IntDefaultAnno\n" + - " 6: #50(#51=s#52)\n" + + " 6: #46(#47=s#48)\n" + " AnnoTest$NameAnno(\n" + " name=\"NAME\"\n" + " )\n" + - " 7: #53(#54=D#55,#57=F#58)\n" + + " 7: #49(#50=D#51,#53=F#54)\n" + " AnnoTest$MultiAnno(\n" + " d=3.14159d\n" + " f=2.71828f\n" + " )\n" + - " 8: #59()\n" + + " 8: #55()\n" + " AnnoTest$SimpleAnno\n" + - " 9: #60(#22=@#47(#22=I#61))\n" + + " 9: #56(#18=@#43(#18=I#57))\n" + " AnnoTest$AnnoAnno(\n" + " value=@AnnoTest$IntAnno(\n" + " value=5\n" + @@ -100,7 +100,7 @@ public class AnnoTest { " )"); expect(out, "RuntimeInvisibleTypeAnnotations:\n" + - " 0: #63(): CLASS_EXTENDS, type_index=0\n" + + " 0: #59(): CLASS_EXTENDS, type_index=0\n" + " AnnoTest$TypeAnno"); if (errors > 0) -- GitLab From 24e586a04368a76cd9f37aa783b974b9e0351d58 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 23 Nov 2021 18:28:30 +0000 Subject: [PATCH 454/890] 8276764: Enable deterministic file content ordering for Jar and Jmod Reviewed-by: mchung, ihse --- .../share/classes/sun/tools/jar/Main.java | 30 ++- .../classes/jdk/tools/jmod/JmodTask.java | 19 +- test/jdk/tools/jar/ContentOrder.java | 214 ++++++++++++++++++ test/jdk/tools/jmod/JmodTest.java | 15 +- 4 files changed, 263 insertions(+), 15 deletions(-) create mode 100644 test/jdk/tools/jar/ContentOrder.java diff --git a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java index 4458cd00b44..e79b858d990 100644 --- a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java +++ b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -127,7 +127,10 @@ public class Main { Map> pathsMap = new HashMap<>(); // There's also a files array per version - Map filesMap = new HashMap<>(); + // base version is the first entry and then follow with the version given + // from the --release option in the command-line order. + // The value of each entry is the files given in the command-line order. + Map filesMap = new LinkedHashMap<>(); // Do we think this is a multi-release jar? Set to true // if --release option found followed by at least file @@ -772,15 +775,17 @@ public class Main { private void expand(File dir, String[] files, Set cpaths, int version) throws IOException { - if (files == null) + if (files == null) { return; + } for (int i = 0; i < files.length; i++) { File f; - if (dir == null) + if (dir == null) { f = new File(files[i]); - else + } else { f = new File(dir, files[i]); + } boolean isDir = f.isDirectory(); String name = toEntryName(f.getPath(), cpaths, isDir); @@ -802,18 +807,20 @@ public class Main { Entry e = new Entry(f, name, false); if (isModuleInfoEntry(name)) { moduleInfos.putIfAbsent(name, Files.readAllBytes(f.toPath())); - if (uflag) + if (uflag) { entryMap.put(name, e); + } } else if (entries.add(e)) { - if (uflag) + if (uflag) { entryMap.put(name, e); + } } } else if (isDir) { Entry e = new Entry(f, name, true); if (entries.add(e)) { // utilize entryMap for the duplicate dir check even in // case of cflag == true. - // dir name confilict/duplicate could happen with -C option. + // dir name conflict/duplicate could happen with -C option. // just remove the last "e" from the "entries" (zos will fail // with "duplicated" entries), but continue expanding the // sub tree @@ -822,7 +829,12 @@ public class Main { } else { entryMap.put(name, e); } - expand(f, f.list(), cpaths, version); + String[] dirFiles = f.list(); + // Ensure files list is sorted for reproducible jar content + if (dirFiles != null) { + Arrays.sort(dirFiles); + } + expand(f, dirFiles, cpaths, version); } } else { error(formatMsg("error.nosuch.fileordir", String.valueOf(f))); diff --git a/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java b/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java index eb541bba63f..f4248bd16ce 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -767,6 +767,10 @@ public class JmodTask { void processSection(JmodOutputStream out, Section section, Path path) throws IOException { + // Keep a sorted set of files to be processed, so that the jmod + // content is reproducible as Files.walkFileTree order is not defined + SortedMap filesToProcess = new TreeMap(); + Files.walkFileTree(path, Set.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor() { @Override @@ -782,14 +786,21 @@ public class JmodTask { if (out.contains(section, name)) { warning("warn.ignore.duplicate.entry", name, section); } else { - try (InputStream in = Files.newInputStream(file)) { - out.writeEntry(in, section, name); - } + filesToProcess.put(name, file); } } return FileVisitResult.CONTINUE; } }); + + // Process files in sorted order for deterministic jmod content + for (Map.Entry entry : filesToProcess.entrySet()) { + String name = entry.getKey(); + Path file = entry.getValue(); + try (InputStream in = Files.newInputStream(file)) { + out.writeEntry(in, section, name); + } + } } boolean matches(Path path, List matchers) { diff --git a/test/jdk/tools/jar/ContentOrder.java b/test/jdk/tools/jar/ContentOrder.java new file mode 100644 index 00000000000..dc5315efde1 --- /dev/null +++ b/test/jdk/tools/jar/ContentOrder.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2021, 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 8276764 + * @summary test that the jar content ordering is sorted + * @library /test/lib + * @modules jdk.jartool + * @build jdk.test.lib.Platform + * jdk.test.lib.util.FileUtils + * @run testng ContentOrder + */ + +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.io.UncheckedIOException; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.spi.ToolProvider; +import java.util.stream.Stream; +import java.util.zip.ZipException; + +import jdk.test.lib.util.FileUtils; + +public class ContentOrder { + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar") + .orElseThrow(() -> + new RuntimeException("jar tool not found") + ); + + private final String nl = System.lineSeparator(); + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + private final PrintStream out = new PrintStream(baos); + private Runnable onCompletion; + + @BeforeMethod + public void reset() { + onCompletion = null; + } + + @AfterMethod + public void run() { + if (onCompletion != null) { + onCompletion.run(); + } + } + + // Test that the jar content ordering when processing a single directory is sorted + @Test + public void testSingleDir() throws IOException { + mkdir("testjar/Ctest1", "testjar/Btest2/subdir1", "testjar/Atest3"); + touch("testjar/Ctest1/testfile1", "testjar/Ctest1/testfile2", "testjar/Ctest1/testfile3"); + touch("testjar/Btest2/subdir1/testfileC", "testjar/Btest2/subdir1/testfileB", "testjar/Btest2/subdir1/testfileA"); + touch("testjar/Atest3/fileZ", "testjar/Atest3/fileY", "testjar/Atest3/fileX"); + + onCompletion = () -> rm("test.jar", "testjar"); + + jar("cf test.jar testjar"); + jar("tf test.jar"); + System.out.println(new String(baos.toByteArray())); + String output = "META-INF/" + nl + + "META-INF/MANIFEST.MF" + nl + + "testjar/" + nl + + "testjar/Atest3/" + nl + + "testjar/Atest3/fileX" + nl + + "testjar/Atest3/fileY" + nl + + "testjar/Atest3/fileZ" + nl + + "testjar/Btest2/" + nl + + "testjar/Btest2/subdir1/" + nl + + "testjar/Btest2/subdir1/testfileA" + nl + + "testjar/Btest2/subdir1/testfileB" + nl + + "testjar/Btest2/subdir1/testfileC" + nl + + "testjar/Ctest1/" + nl + + "testjar/Ctest1/testfile1" + nl + + "testjar/Ctest1/testfile2" + nl + + "testjar/Ctest1/testfile3" + nl; + Assert.assertEquals(baos.toByteArray(), output.getBytes()); + } + + // Test that when specifying multiple directories or releases that the sort + // ordering is done on each directory and release, reserving the order of + // the directories/releases specified on the command line + @Test + public void testMultiDirWithReleases() throws IOException { + mkdir("testjar/foo/classes", + "testjar/foo11/classes/Zclasses", + "testjar/foo11/classes/Yclasses", + "testjar/foo17/classes/Bclasses", + "testjar/foo17/classes/Aclasses"); + touch("testjar/foo/classes/testfile1", "testjar/foo/classes/testfile2"); + touch("testjar/foo11/classes/Zclasses/testfile1", "testjar/foo11/classes/Zclasses/testfile2"); + touch("testjar/foo11/classes/Yclasses/testfileA", "testjar/foo11/classes/Yclasses/testfileB"); + touch("testjar/foo17/classes/Bclasses/testfile1", "testjar/foo17/classes/Bclasses/testfile2"); + touch("testjar/foo17/classes/Aclasses/testfileA", "testjar/foo17/classes/Aclasses/testfileB"); + + onCompletion = () -> rm("test.jar", "testjar"); + + jar("cf test.jar -C testjar/foo classes " + + "--release 17 -C testjar/foo17 classes/Bclasses -C testjar/foo17 classes/Aclasses " + + "--release 11 -C testjar/foo11 classes/Zclasses -C testjar/foo11 classes/Yclasses"); + jar("tf test.jar"); + System.out.println(new String(baos.toByteArray())); + String output = "META-INF/" + nl + + "META-INF/MANIFEST.MF" + nl + + "classes/" + nl + + "classes/testfile1" + nl + + "classes/testfile2" + nl + + "META-INF/versions/17/classes/Bclasses/" + nl + + "META-INF/versions/17/classes/Bclasses/testfile1" + nl + + "META-INF/versions/17/classes/Bclasses/testfile2" + nl + + "META-INF/versions/17/classes/Aclasses/" + nl + + "META-INF/versions/17/classes/Aclasses/testfileA" + nl + + "META-INF/versions/17/classes/Aclasses/testfileB" + nl + + "META-INF/versions/11/classes/Zclasses/" + nl + + "META-INF/versions/11/classes/Zclasses/testfile1" + nl + + "META-INF/versions/11/classes/Zclasses/testfile2" + nl + + "META-INF/versions/11/classes/Yclasses/" + nl + + "META-INF/versions/11/classes/Yclasses/testfileA" + nl + + "META-INF/versions/11/classes/Yclasses/testfileB" + nl; + Assert.assertEquals(baos.toByteArray(), output.getBytes()); + } + + private Stream mkpath(String... args) { + return Arrays.stream(args).map(d -> Paths.get(".", d.split("/"))); + } + + private void mkdir(String... dirs) { + System.out.println("mkdir -p " + Arrays.toString(dirs)); + Arrays.stream(dirs).forEach(p -> { + try { + Files.createDirectories((new File(p)).toPath()); + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + + private void touch(String... files) { + System.out.println("touch " + Arrays.toString(files)); + Arrays.stream(files).forEach(p -> { + try { + Files.createFile((new File(p)).toPath()); + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + + private void rm(String... files) { + System.out.println("rm -rf " + Arrays.toString(files)); + Arrays.stream(files).forEach(p -> { + try { + Path path = (new File(p)).toPath(); + if (Files.isDirectory(path)) { + FileUtils.deleteFileTreeWithRetry(path); + } else { + FileUtils.deleteFileIfExistsWithRetry(path); + } + } catch (IOException x) { + throw new UncheckedIOException(x); + } + }); + } + + private void jar(String cmdline) throws IOException { + System.out.println("jar " + cmdline); + baos.reset(); + + // the run method catches IOExceptions, we need to expose them + ByteArrayOutputStream baes = new ByteArrayOutputStream(); + PrintStream err = new PrintStream(baes); + PrintStream saveErr = System.err; + System.setErr(err); + int rc = JAR_TOOL.run(out, err, cmdline.split(" +")); + System.setErr(saveErr); + if (rc != 0) { + String s = baes.toString(); + if (s.startsWith("java.util.zip.ZipException: duplicate entry: ")) { + throw new ZipException(s); + } + throw new IOException(s); + } + } +} diff --git a/test/jdk/tools/jmod/JmodTest.java b/test/jdk/tools/jmod/JmodTest.java index c32284faee6..bfec68b748b 100644 --- a/test/jdk/tools/jmod/JmodTest.java +++ b/test/jdk/tools/jmod/JmodTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8142968 8166568 8166286 8170618 8168149 8240910 + * @bug 8142968 8166568 8166286 8170618 8168149 8240910 8276764 * @summary Basic test for jmod * @library /test/lib * @modules jdk.compiler @@ -197,6 +197,17 @@ public class JmodTest { assertContains(r.output, CLASSES_PREFIX + "jdk/test/foo/Foo.class"); assertContains(r.output, CLASSES_PREFIX + "jdk/test/foo/internal/Message.class"); assertContains(r.output, CLASSES_PREFIX + "jdk/test/foo/resources/foo.properties"); + + // JDK-8276764: Ensure the order is sorted for reproducible jmod content + // module-info, followed by + int mod_info_i = r.output.indexOf(CLASSES_PREFIX + "module-info.class"); + int foo_cls_i = r.output.indexOf(CLASSES_PREFIX + "jdk/test/foo/Foo.class"); + int msg_i = r.output.indexOf(CLASSES_PREFIX + "jdk/test/foo/internal/Message.class"); + int res_i = r.output.indexOf(CLASSES_PREFIX + "jdk/test/foo/resources/foo.properties"); + System.out.println("jmod classes sort order check:\n"+r.output); + assertTrue(mod_info_i < foo_cls_i); + assertTrue(foo_cls_i < msg_i); + assertTrue(msg_i < res_i); }); } -- GitLab From 7cb56a230dbd52935ae48fe44b4192ae3b4d7adb Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Tue, 23 Nov 2021 19:27:50 +0000 Subject: [PATCH 455/890] 8265796: vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java fails when running with JEP 416 Reviewed-by: cjplummer, mchung --- test/hotspot/jtreg/ProblemList.txt | 1 - .../referringObjects002/referringObjects002.java | 12 +++++++++--- .../referringObjects002/referringObjects002a.java | 8 +++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 8b34ae74e04..4dca92da5a8 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -38,7 +38,6 @@ # ############################################################################# -vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java 8265796 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java index 95d3edf1050..f1a2432b573 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -56,6 +56,8 @@ * @build nsk.jdi.ObjectReference.referringObjects.referringObjects002.referringObjects002 * nsk.jdi.ObjectReference.referringObjects.referringObjects002.referringObjects002a * nsk.share.jdi.TestClass1 + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm/native * nsk.jdi.ObjectReference.referringObjects.referringObjects002.referringObjects002 * -verbose @@ -63,7 +65,8 @@ * -waittime=5 * -debugee.vmkind=java * -transport.address=dynamic - * -debugee.vmkeys="-Xmx256M ${test.vm.opts} ${test.java.opts}" + * -debugee.vmkeys="-Xmx256M -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}" * -testClassPath ${test.class.path} */ @@ -97,6 +100,10 @@ public class referringObjects002 extends HeapwalkingDebugger { public void checkClassObjectReferrersCount(ClassObjectReference classObjectReference, int expectedCount) { int referrersCount = classObjectReference.referringObjects(0).size(); + log.display("References:"); + for (ObjectReference ref: classObjectReference.referringObjects(0)) { + log.display(ref); + } if (referrersCount != expectedCount) { setSuccess(false); @@ -137,7 +144,6 @@ public class referringObjects002 extends HeapwalkingDebugger { expectedReferrersCount = 3; checkClassObjectReferrersCount(classObjectReference, expectedReferrersCount); - // disable collection and try unload class object classObjectReference.disableCollection(); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002a.java index 1e90e159b58..6a0489d62ea 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002a.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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,6 +29,7 @@ import nsk.share.TestBug; import nsk.share.jdi.HeapwalkingDebuggee; import java.io.*; import java.util.*; +import sun.hotspot.WhiteBox; /* * Class create and save given number of class instances @@ -56,6 +57,8 @@ public class referringObjects002a extends HeapwalkingDebuggee { final static public String COMMAND_DELETE_CLASS_OBJECT_REFERRERS = "deleteClassObjectReferrers"; + private final WhiteBox WB = WhiteBox.getWhiteBox(); + public static void main(String args[]) { new referringObjects002a().doTest(args); } @@ -76,6 +79,9 @@ public class referringObjects002a extends HeapwalkingDebuggee { for (String referenceType : ObjectInstancesManager.allReferenceTypes) classReferrers.add(new ReferringObject(klass, referenceType)); + // force full GC with WB to ensure that weak refernces are collected + // j.l.i.MethodType has ConcurrentWeakInternSet which might contain references to TestClass1 + WB.fullGC(); } // delete all created references to class object -- GitLab From 7b2d823e842e6a66dbe46b048da44ca9e5485c75 Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Tue, 23 Nov 2021 20:05:57 +0000 Subject: [PATCH 456/890] 8277503: compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java failed with "OnSpinWaitInst with the expected value 'isb' not found." Reviewed-by: chagedorn, aph, phh --- test/hotspot/jtreg/ProblemList.txt | 2 -- .../compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 4dca92da5a8..77cfd0c78e3 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -74,8 +74,6 @@ compiler/whitebox/MakeMethodNotCompilableTest.java 8265360 macosx-aarch64 compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-x64 compiler/codecache/TestStressCodeBuffers.java 8272094 generic-aarch64 -compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java 8277503 linux-aarch64 - ############################################################################# diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java index 9d9dbc6ea2f..67a286c6cd9 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java @@ -87,7 +87,8 @@ public class TestOnSpinWaitAArch64DefaultFlags { final String cpuModel = cpuFeatures.get(0); if (isCPUModelNeoverseN1(cpuModel)) { - checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+PrintFlagsFinal", "-version"), "isb", "1"); + checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"), + "isb", "1"); checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"), "isb", "2"); } else { -- GitLab From 712b8756828c88d4f71292d19fddb598d188c429 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Wed, 24 Nov 2021 08:25:03 +0000 Subject: [PATCH 457/890] 8277397: ZGC: Add JFR event for temporary latency measurements Reviewed-by: eosterlund, jbachorik, pliden, mgronlun --- src/hotspot/share/gc/z/zTracer.cpp | 13 +++++++++++++ src/hotspot/share/gc/z/zTracer.hpp | 9 ++++++--- src/hotspot/share/gc/z/zTracer.inline.hpp | 12 +++++++++--- src/hotspot/share/jfr/metadata/metadata.xml | 5 +++++ src/jdk.jfr/share/conf/jfr/default.jfc | 5 +++++ src/jdk.jfr/share/conf/jfr/profile.jfc | 5 +++++ 6 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/gc/z/zTracer.cpp b/src/hotspot/share/gc/z/zTracer.cpp index 2a0d3e11a79..b7d0bc0a697 100644 --- a/src/hotspot/share/gc/z/zTracer.cpp +++ b/src/hotspot/share/gc/z/zTracer.cpp @@ -131,3 +131,16 @@ void ZTracer::send_thread_phase(const char* name, const Ticks& start, const Tick e.commit(); } } + +void ZTracer::send_thread_debug(const char* name, const Ticks& start, const Ticks& end) { + NoSafepointVerifier nsv; + + EventZThreadDebug e(UNTIMED); + if (e.should_commit()) { + e.set_gcId(GCId::current_or_undefined()); + e.set_name(name); + e.set_starttime(start); + e.set_endtime(end); + e.commit(); + } +} diff --git a/src/hotspot/share/gc/z/zTracer.hpp b/src/hotspot/share/gc/z/zTracer.hpp index c39a193168b..3ec97dfa4cb 100644 --- a/src/hotspot/share/gc/z/zTracer.hpp +++ b/src/hotspot/share/gc/z/zTracer.hpp @@ -39,6 +39,7 @@ private: void send_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value); void send_stat_sampler(const ZStatSampler& sampler, uint64_t value); void send_thread_phase(const char* name, const Ticks& start, const Ticks& end); + void send_thread_debug(const char* name, const Ticks& start, const Ticks& end); public: static ZTracer* tracer(); @@ -47,16 +48,18 @@ public: void report_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value); void report_stat_sampler(const ZStatSampler& sampler, uint64_t value); void report_thread_phase(const char* name, const Ticks& start, const Ticks& end); + void report_thread_debug(const char* name, const Ticks& start, const Ticks& end); }; -class ZTraceThreadPhase : public StackObj { +// For temporary latency measurements during development and debugging +class ZTraceThreadDebug : public StackObj { private: const Ticks _start; const char* const _name; public: - ZTraceThreadPhase(const char* name); - ~ZTraceThreadPhase(); + ZTraceThreadDebug(const char* name); + ~ZTraceThreadDebug(); }; #endif // SHARE_GC_Z_ZTRACER_HPP diff --git a/src/hotspot/share/gc/z/zTracer.inline.hpp b/src/hotspot/share/gc/z/zTracer.inline.hpp index 143eebb4d3b..cfaf7b43f0c 100644 --- a/src/hotspot/share/gc/z/zTracer.inline.hpp +++ b/src/hotspot/share/gc/z/zTracer.inline.hpp @@ -50,12 +50,18 @@ inline void ZTracer::report_thread_phase(const char* name, const Ticks& start, c } } -inline ZTraceThreadPhase::ZTraceThreadPhase(const char* name) : +inline void ZTracer::report_thread_debug(const char* name, const Ticks& start, const Ticks& end) { + if (EventZThreadDebug::is_enabled()) { + send_thread_debug(name, start, end); + } +} + +inline ZTraceThreadDebug::ZTraceThreadDebug(const char* name) : _start(Ticks::now()), _name(name) {} -inline ZTraceThreadPhase::~ZTraceThreadPhase() { - ZTracer::tracer()->report_thread_phase(_name, _start, Ticks::now()); +inline ZTraceThreadDebug::~ZTraceThreadDebug() { + ZTracer::tracer()->report_thread_debug(_name, _start, Ticks::now()); } #endif // SHARE_GC_Z_ZTRACER_INLINE_HPP diff --git a/src/hotspot/share/jfr/metadata/metadata.xml b/src/hotspot/share/jfr/metadata/metadata.xml index 6a1f426785c..2cc8cc10bea 100644 --- a/src/hotspot/share/jfr/metadata/metadata.xml +++ b/src/hotspot/share/jfr/metadata/metadata.xml @@ -1034,6 +1034,11 @@ + + + + + diff --git a/src/jdk.jfr/share/conf/jfr/default.jfc b/src/jdk.jfr/share/conf/jfr/default.jfc index b168791f479..7ffacfc0248 100644 --- a/src/jdk.jfr/share/conf/jfr/default.jfc +++ b/src/jdk.jfr/share/conf/jfr/default.jfc @@ -775,6 +775,11 @@ 0 ms + + true + 0 ms + + true 0 ms diff --git a/src/jdk.jfr/share/conf/jfr/profile.jfc b/src/jdk.jfr/share/conf/jfr/profile.jfc index 8d1bada4638..03eac2e8669 100644 --- a/src/jdk.jfr/share/conf/jfr/profile.jfc +++ b/src/jdk.jfr/share/conf/jfr/profile.jfc @@ -775,6 +775,11 @@ 0 ms + + true + 0 ms + + true 0 ms -- GitLab From 6d734604a38447d81df36f4d4ca57ce71bd570af Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Wed, 24 Nov 2021 08:26:22 +0000 Subject: [PATCH 458/890] 8277399: ZGC: Move worker thread logging out of gc+phase=debug Reviewed-by: eosterlund, pliden --- src/hotspot/share/gc/z/zStat.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/z/zStat.cpp b/src/hotspot/share/gc/z/zStat.cpp index 0df9d061087..540c171ae9f 100644 --- a/src/hotspot/share/gc/z/zStat.cpp +++ b/src/hotspot/share/gc/z/zStat.cpp @@ -31,6 +31,7 @@ #include "gc/z/zPageAllocator.inline.hpp" #include "gc/z/zRelocationSetSelector.inline.hpp" #include "gc/z/zStat.hpp" +#include "gc/z/zThread.inline.hpp" #include "gc/z/zTracer.inline.hpp" #include "gc/z/zUtils.hpp" #include "memory/metaspaceUtils.hpp" @@ -736,8 +737,13 @@ ZStatSubPhase::ZStatSubPhase(const char* name) : ZStatPhase("Subphase", name) {} void ZStatSubPhase::register_start(const Ticks& start) const { - LogTarget(Debug, gc, phases, start) log; - log_start(log, true /* thread */); + if (ZThread::is_worker()) { + LogTarget(Trace, gc, phases, start) log; + log_start(log, true /* thread */); + } else { + LogTarget(Debug, gc, phases, start) log; + log_start(log, false /* thread */); + } } void ZStatSubPhase::register_end(const Ticks& start, const Ticks& end) const { @@ -750,8 +756,13 @@ void ZStatSubPhase::register_end(const Ticks& start, const Ticks& end) const { const Tickspan duration = end - start; ZStatSample(_sampler, duration.value()); - LogTarget(Debug, gc, phases) log; - log_end(log, duration, true /* thread */); + if (ZThread::is_worker()) { + LogTarget(Trace, gc, phases) log; + log_end(log, duration, true /* thread */); + } else { + LogTarget(Debug, gc, phases) log; + log_end(log, duration, false /* thread */); + } } ZStatCriticalPhase::ZStatCriticalPhase(const char* name, bool verbose) : -- GitLab From d085c2b8a790a5ddfbb01a0ea4edd4051cfb704b Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Wed, 24 Nov 2021 10:07:49 +0000 Subject: [PATCH 459/890] 8273328: Compiler implementation for Pattern Matching for switch (Second Preview) Reviewed-by: vromero, mcimadamore --- .../com/sun/tools/javac/comp/Attr.java | 16 ++-- .../com/sun/tools/javac/comp/Flow.java | 13 +-- .../tools/javac/patterns/Domination.java | 50 +++++++++++ .../tools/javac/patterns/Domination.out | 10 ++- .../tools/javac/patterns/EnumTypeChanges.java | 4 +- .../tools/javac/patterns/Exhaustiveness.java | 88 +++++++++++++++++++ .../tools/javac/patterns/SwitchErrors.java | 20 ++++- .../tools/javac/patterns/SwitchErrors.out | 19 ++-- .../tools/javac/patterns/Switches.java | 36 +++----- 9 files changed, 207 insertions(+), 49 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index 32975a193ec..8efbf6677ed 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -1680,7 +1680,8 @@ public class Attr extends JCTree.Visitor { // Attribute all cases and // check that there are no duplicate case labels or default clauses. Set labels = new HashSet<>(); // The set of case labels. - List coveredTypes = List.nil(); + List coveredTypesForPatterns = List.nil(); + List coveredTypesForConstants = List.nil(); boolean hasDefault = false; // Is there a default label? boolean hasTotalPattern = false; // Is there a total pattern? boolean hasNullPattern = false; // Is there a null pattern? @@ -1718,7 +1719,7 @@ public class Attr extends JCTree.Visitor { } else if (!labels.add(sym)) { log.error(pat.pos(), Errors.DuplicateCaseLabel); } else { - checkCaseLabelDominated(pat.pos(), coveredTypes, sym.type); + checkCaseLabelDominated(pat.pos(), coveredTypesForConstants, sym.type); } } else if (errorEnumSwitch) { //error recovery: the selector is erroneous, and all the case labels @@ -1751,7 +1752,7 @@ public class Attr extends JCTree.Visitor { } else if (!labels.add(pattype.constValue())) { log.error(c.pos(), Errors.DuplicateCaseLabel); } else { - checkCaseLabelDominated(pat.pos(), coveredTypes, types.boxedTypeOrType(pattype)); + checkCaseLabelDominated(pat.pos(), coveredTypesForConstants, types.boxedTypeOrType(pattype)); } } } @@ -1784,9 +1785,12 @@ public class Attr extends JCTree.Visitor { } hasTotalPattern = true; } - checkCaseLabelDominated(pat.pos(), coveredTypes, patternType); - if (primary.unconditional() && !patternType.isErroneous()) { - coveredTypes = coveredTypes.prepend(patternType); + checkCaseLabelDominated(pat.pos(), coveredTypesForPatterns, patternType); + if (!patternType.isErroneous()) { + coveredTypesForConstants = coveredTypesForConstants.prepend(patternType); + if (primary.unconditional()) { + coveredTypesForPatterns = coveredTypesForPatterns.prepend(patternType); + } } } currentBindings = matchBindingsComputer.switchCase(pat, currentBindings, matchBindings); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java index f4ba0f9bb17..eaff2f1106d 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java @@ -751,7 +751,7 @@ public class Flow { } } - private void transitiveCovers(Set covered) { + private void transitiveCovers(Type seltype, Set covered) { List todo = List.from(covered); while (todo.nonEmpty()) { Symbol sym = todo.head; @@ -773,7 +773,7 @@ public class Flow { case TYP -> { for (Type sup : types.directSupertypes(sym.type)) { if (sup.tsym.kind == TYP) { - if (isTransitivelyCovered(sup.tsym, covered) && + if (isTransitivelyCovered(seltype, sup.tsym, covered) && covered.add(sup.tsym)) { todo = todo.prepend(sup.tsym); } @@ -784,7 +784,7 @@ public class Flow { } } - private boolean isTransitivelyCovered(Symbol sealed, Set covered) { + private boolean isTransitivelyCovered(Type seltype, Symbol sealed, Set covered) { DeferredCompletionFailureHandler.Handler prevHandler = dcfh.setHandler(dcfh.speculativeCodeHandler); try { @@ -793,7 +793,10 @@ public class Flow { if (sealed.kind == TYP && sealed.isAbstract() && sealed.isSealed()) { return ((ClassSymbol) sealed).permitted .stream() - .allMatch(s -> isTransitivelyCovered(s, covered)); + .filter(s -> { + return types.isCastable(seltype, s.type/*, types.noWarnings*/); + }) + .allMatch(s -> isTransitivelyCovered(seltype, s, covered)); } return false; } catch (CompletionFailure cf) { @@ -805,7 +808,7 @@ public class Flow { } private boolean isExhaustive(Type seltype, Set covered) { - transitiveCovers(covered); + transitiveCovers(seltype, covered); return switch (seltype.getTag()) { case CLASS -> { if (seltype.isCompound()) { diff --git a/test/langtools/tools/javac/patterns/Domination.java b/test/langtools/tools/javac/patterns/Domination.java index b5283fe31a7..683758c297c 100644 --- a/test/langtools/tools/javac/patterns/Domination.java +++ b/test/langtools/tools/javac/patterns/Domination.java @@ -68,6 +68,20 @@ public class Domination { } } + int testDominatesStringConstant2(String str) { + switch (str) { + case (String s && s.isEmpty()): return 1; + case "": return -1; + } + } + + int testDominatesStringConstant3(String str) { + switch (str) { + case (String s && !s.isEmpty()): return 1; + case "": return -1; + } + } + int testDominatesIntegerConstant(Integer i) { switch (i) { case Integer j: return 1; @@ -75,6 +89,20 @@ public class Domination { } } + int testDominatesIntegerConstant2(Integer i) { + switch (i) { + case (Integer j && j == 0): return 1; + case 0: return -1; + } + } + + int testDominatesIntegerConstant3(Integer i) { + switch (i) { + case (Integer j && j == 1): return 1; + case 0: return -1; + } + } + int testDominatesEnumConstant() { enum E { A, B; @@ -86,4 +114,26 @@ public class Domination { } } + int testDominatesEnumConstant2() { + enum E { + A, B; + } + E e = E.A; + switch (e) { + case (E d && d == E.A): return 1; + case A: return -1; + } + } + + int testDominatesEnumConstant3() { + enum E { + A, B; + } + E e = E.A; + switch (e) { + case (E d && d == E.B): return 1; + case A: return -1; + } + } + } diff --git a/test/langtools/tools/javac/patterns/Domination.out b/test/langtools/tools/javac/patterns/Domination.out index 3d1aa46bab0..80b95b8527d 100644 --- a/test/langtools/tools/javac/patterns/Domination.out +++ b/test/langtools/tools/javac/patterns/Domination.out @@ -3,7 +3,13 @@ Domination.java:43:18: compiler.err.pattern.dominated Domination.java:51:18: compiler.err.pattern.dominated Domination.java:67:18: compiler.err.pattern.dominated Domination.java:74:18: compiler.err.pattern.dominated -Domination.java:85:18: compiler.err.pattern.dominated +Domination.java:81:18: compiler.err.pattern.dominated +Domination.java:88:18: compiler.err.pattern.dominated +Domination.java:95:18: compiler.err.pattern.dominated +Domination.java:102:18: compiler.err.pattern.dominated +Domination.java:113:18: compiler.err.pattern.dominated +Domination.java:124:18: compiler.err.pattern.dominated +Domination.java:135:18: compiler.err.pattern.dominated - compiler.note.preview.filename: Domination.java, DEFAULT - compiler.note.preview.recompile -6 errors +12 errors diff --git a/test/langtools/tools/javac/patterns/EnumTypeChanges.java b/test/langtools/tools/javac/patterns/EnumTypeChanges.java index f6a0aafe6e7..8d16efd7965 100644 --- a/test/langtools/tools/javac/patterns/EnumTypeChanges.java +++ b/test/langtools/tools/javac/patterns/EnumTypeChanges.java @@ -52,8 +52,8 @@ public class EnumTypeChanges { String statementEnum(EnumTypeChangesEnum e) { switch (e) { case A -> { return "A"; } - case EnumTypeChangesEnum e1 && false -> throw new AssertionError(); case B -> { return "B"; } + case EnumTypeChangesEnum e1 && false -> throw new AssertionError(); default -> { return "D"; } } } @@ -61,8 +61,8 @@ public class EnumTypeChanges { String expressionEnum(EnumTypeChangesEnum e) { return switch (e) { case A -> "A"; - case EnumTypeChangesEnum e1 && false -> throw new AssertionError(); case B -> "B"; + case EnumTypeChangesEnum e1 && false -> throw new AssertionError(); default -> "D"; }; } diff --git a/test/langtools/tools/javac/patterns/Exhaustiveness.java b/test/langtools/tools/javac/patterns/Exhaustiveness.java index 9728fd83f48..36c824deeee 100644 --- a/test/langtools/tools/javac/patterns/Exhaustiveness.java +++ b/test/langtools/tools/javac/patterns/Exhaustiveness.java @@ -799,6 +799,94 @@ public class Exhaustiveness extends TestRunner { """); } + @Test + public void testOnlyApplicable(Path base) throws Exception { + record TestCase(String cases, String... errors) {} + TestCase[] subCases = new TestCase[] { + new TestCase(""" + case C3 c -> {} + case C5 c -> {} + case C6 c -> {} + """), //OK + new TestCase(""" + case C5 c -> {} + case C6 c -> {} + """, + "Test.java:11:9: compiler.err.not.exhaustive.statement", + "- compiler.note.preview.filename: Test.java, DEFAULT", + "- compiler.note.preview.recompile", + "1 error"), + new TestCase(""" + case C3 c -> {} + case C6 c -> {} + """, + "Test.java:11:9: compiler.err.not.exhaustive.statement", + "- compiler.note.preview.filename: Test.java, DEFAULT", + "- compiler.note.preview.recompile", + "1 error"), + new TestCase(""" + case C3 c -> {} + case C5 c -> {} + """, + "Test.java:11:9: compiler.err.not.exhaustive.statement", + "- compiler.note.preview.filename: Test.java, DEFAULT", + "- compiler.note.preview.recompile", + "1 error"), + new TestCase(""" + case C1 c -> {} + case C3 c -> {} + case C5 c -> {} + case C6 c -> {} + """, + "Test.java:12:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: test.Test.I, test.Test.C1)", + "- compiler.note.preview.filename: Test.java, DEFAULT", + "- compiler.note.preview.recompile", + "1 error"), + new TestCase(""" + case C2 c -> {} + case C3 c -> {} + case C5 c -> {} + case C6 c -> {} + """, + "Test.java:12:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: test.Test.I, test.Test.C2)", + "- compiler.note.preview.filename: Test.java, DEFAULT", + "- compiler.note.preview.recompile", + "1 error"), + new TestCase(""" + case C4 c -> {} + case C3 c -> {} + case C5 c -> {} + case C6 c -> {} + """, + "Test.java:12:18: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: test.Test.I, test.Test.C4)", + "- compiler.note.preview.filename: Test.java, DEFAULT", + "- compiler.note.preview.recompile", + "1 error"), + }; + for (TestCase tc : subCases) { + doTest(base, + new String[0], + """ + package test; + public class Test { + sealed interface I {} + final class C1 implements I {} + final class C2 implements I {} + final class C3 implements I {} + final class C4 implements I {} + final class C5 implements I {} + final class C6 implements I {} + void t(I i) { + switch (i) { + ${cases} + } + } + } + """.replace("${cases}", tc.cases), + tc.errors); + } + } + private void doTest(Path base, String[] libraryCode, String testCode, String... expectedErrors) throws IOException { Path current = base.resolve("."); Path libClasses = current.resolve("libClasses"); diff --git a/test/langtools/tools/javac/patterns/SwitchErrors.java b/test/langtools/tools/javac/patterns/SwitchErrors.java index ddeca570d3a..61f544a52c0 100644 --- a/test/langtools/tools/javac/patterns/SwitchErrors.java +++ b/test/langtools/tools/javac/patterns/SwitchErrors.java @@ -185,7 +185,16 @@ public class SwitchErrors { default -> null; }; } - void test8269146a(Integer i) { + void test8269146a1(Integer i) { + switch (i) { + //error - illegal combination of pattern and constant: + case 1, Integer o && o != null: + break; + default: + break; + } + } + void test8269146a2(Integer i) { switch (i) { //error - illegal combination of pattern and constant: case Integer o && o != null, 1: @@ -210,7 +219,14 @@ public class SwitchErrors { break; } } - void test8269301(Integer i) { + void test8269301a(Integer i) { + switch (i) { + //error - illegal combination of pattern, constant and default + case 1, Integer o && o != null, default: + break; + } + } + void test8269301b(Integer i) { switch (i) { //error - illegal combination of pattern, constant and default case Integer o && o != null, 1, default: diff --git a/test/langtools/tools/javac/patterns/SwitchErrors.out b/test/langtools/tools/javac/patterns/SwitchErrors.out index 9c4a8ff677f..4679651c800 100644 --- a/test/langtools/tools/javac/patterns/SwitchErrors.out +++ b/test/langtools/tools/javac/patterns/SwitchErrors.out @@ -31,12 +31,15 @@ SwitchErrors.java:160:18: compiler.err.pattern.dominated SwitchErrors.java:172:18: compiler.err.pattern.expected SwitchErrors.java:178:76: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null) SwitchErrors.java:184:71: compiler.err.cant.resolve.location: kindname.variable, n, , , (compiler.misc.location: kindname.class, SwitchErrors, null) -SwitchErrors.java:191:42: compiler.err.flows.through.from.pattern -SwitchErrors.java:200:24: compiler.err.flows.through.to.pattern -SwitchErrors.java:209:29: compiler.err.total.pattern.and.default -SwitchErrors.java:216:42: compiler.err.flows.through.from.pattern -SwitchErrors.java:216:45: compiler.err.flows.through.from.pattern -SwitchErrors.java:228:18: compiler.err.duplicate.total.pattern +SwitchErrors.java:191:21: compiler.err.flows.through.to.pattern +SwitchErrors.java:200:42: compiler.err.pattern.dominated +SwitchErrors.java:209:24: compiler.err.flows.through.to.pattern +SwitchErrors.java:218:29: compiler.err.total.pattern.and.default +SwitchErrors.java:225:21: compiler.err.flows.through.to.pattern +SwitchErrors.java:225:45: compiler.err.flows.through.from.pattern +SwitchErrors.java:232:42: compiler.err.pattern.dominated +SwitchErrors.java:232:45: compiler.err.flows.through.from.pattern +SwitchErrors.java:244:18: compiler.err.duplicate.total.pattern SwitchErrors.java:9:9: compiler.err.not.exhaustive.statement SwitchErrors.java:15:9: compiler.err.not.exhaustive.statement SwitchErrors.java:21:9: compiler.err.not.exhaustive.statement @@ -48,7 +51,7 @@ SwitchErrors.java:91:9: compiler.err.not.exhaustive.statement SwitchErrors.java:97:9: compiler.err.not.exhaustive.statement SwitchErrors.java:104:9: compiler.err.not.exhaustive.statement SwitchErrors.java:164:9: compiler.err.not.exhaustive.statement -SwitchErrors.java:221:9: compiler.err.not.exhaustive.statement +SwitchErrors.java:237:9: compiler.err.not.exhaustive.statement - compiler.note.preview.filename: SwitchErrors.java, DEFAULT - compiler.note.preview.recompile -51 errors +54 errors diff --git a/test/langtools/tools/javac/patterns/Switches.java b/test/langtools/tools/javac/patterns/Switches.java index cf9858e7d0a..714c7973140 100644 --- a/test/langtools/tools/javac/patterns/Switches.java +++ b/test/langtools/tools/javac/patterns/Switches.java @@ -265,8 +265,8 @@ public class Switches { switch (e) { case A: return "a"; case B: return "b"; - case E x && "A".equals(x.name()): return "broken"; case C: return String.valueOf(e); + case E x && "A".equals(x.name()): return "broken"; case null, E x: return String.valueOf(x); } } @@ -275,8 +275,8 @@ public class Switches { return switch (e) { case A -> "a"; case B -> "b"; - case E x && "A".equals(x.name()) -> "broken"; case C -> String.valueOf(e); + case E x && "A".equals(x.name()) -> "broken"; case null, E x -> String.valueOf(x); }; } @@ -286,8 +286,7 @@ public class Switches { case A: return "a"; case B: return "b"; case E x && "C".equals(x.name()): return "C"; - case C: return "broken"; - case null, E x: return String.valueOf(x); + case null, E x: return e == E.C ? "broken" : String.valueOf(x); } } @@ -296,8 +295,7 @@ public class Switches { case A -> "a"; case B -> "b"; case E x && "C".equals(x.name()) -> "C"; - case C -> "broken"; - case null, E x -> String.valueOf(x); + case null, E x -> e == E.C ? "broken" : String.valueOf(x); }; } @@ -306,8 +304,7 @@ public class Switches { case A: return "a"; case B: return "b"; case Object x && "C".equals(x.toString()): return "C"; - case C: return "broken"; - case null, E x: return String.valueOf(x); + case null, E x: return e == E.C ? "broken" : String.valueOf(x); } } @@ -316,8 +313,7 @@ public class Switches { case A -> "a"; case B -> "b"; case Object x && "C".equals(x.toString()) -> "C"; - case C -> "broken"; - case null, E x -> String.valueOf(x); + case null, E x -> e == E.C ? "broken" : String.valueOf(x); }; } @@ -326,8 +322,7 @@ public class Switches { case A: return "a"; case B: return "b"; case Runnable x && "C".equals(x.toString()): return "C"; - case C: return "broken"; - case null, E x: return String.valueOf(x); + case null, E x: return e == E.C ? "broken" : String.valueOf(x); } } @@ -336,8 +331,7 @@ public class Switches { case A -> "a"; case B -> "b"; case Runnable x && "C".equals(x.toString()) -> "C"; - case C -> "broken"; - case null, E x -> String.valueOf(x); + case null, E x -> e == E.C ? "broken" : String.valueOf(x); }; } @@ -346,8 +340,7 @@ public class Switches { case "A": return "a"; case Switches.ConstantClassClash: return "b"; case String x && "C".equals(x): return "C"; - case "C": return "broken"; - case null, String x: return String.valueOf(x); + case null, String x: return "C".equals(x) ? "broken" : String.valueOf(x); } } @@ -356,8 +349,7 @@ public class Switches { case "A" -> "a"; case ConstantClassClash -> "b"; case String x && "C".equals(x) -> "C"; - case "C" -> "broken"; - case null, String x -> String.valueOf(x); + case null, String x -> e == E.C ? "broken" : String.valueOf(x); }; } @@ -366,8 +358,7 @@ public class Switches { case 0: return "a"; case 1: return "b"; case Integer x && x.equals(2): return "C"; - case 2: return "broken"; - case null, Integer x: return String.valueOf(x); + case null, Integer x: return Objects.equals(x, 2) ? "broken" : String.valueOf(x); } } @@ -376,8 +367,7 @@ public class Switches { case 0 -> "a"; case 1 -> "b"; case Integer x && x.equals(2) -> "C"; - case 2 -> "broken"; - case null, Integer x -> String.valueOf(x); + case null, Integer x -> Objects.equals(x, 2) ? "broken" : String.valueOf(x); }; } @@ -412,7 +402,6 @@ public class Switches { switch (i) { case Integer o && o != null: r = 1; - case -1: r = 1; case null, default: r = 2; } @@ -424,7 +413,6 @@ public class Switches { int r = switch (i) { case Integer o && o != null: r = 1; - case -1: r = 1; case null, default: r = 2; yield r; -- GitLab From 8a8bc29f203fa4aaa29303a778fd388e32ca651a Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Wed, 24 Nov 2021 11:03:07 +0000 Subject: [PATCH 460/890] 8277562: Remove dead method c1 If::swap_sux Reviewed-by: thartmann, neliasso --- src/hotspot/share/c1/c1_Instruction.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/hotspot/share/c1/c1_Instruction.hpp b/src/hotspot/share/c1/c1_Instruction.hpp index 6adaae6f30f..8d360b094b8 100644 --- a/src/hotspot/share/c1/c1_Instruction.hpp +++ b/src/hotspot/share/c1/c1_Instruction.hpp @@ -1998,14 +1998,6 @@ LEAF(If, BlockEnd) _cond = mirror(_cond); } - void swap_sux() { - assert(number_of_sux() == 2, "wrong number of successors"); - BlockList* s = sux(); - BlockBegin* t = s->at(0); s->at_put(0, s->at(1)); s->at_put(1, t); - _cond = negate(_cond); - set_flag(UnorderedIsTrueFlag, !check_flag(UnorderedIsTrueFlag)); - } - void set_should_profile(bool value) { set_flag(ProfileMDOFlag, value); } void set_profiled_method(ciMethod* method) { _profiled_method = method; } void set_profiled_bci(int bci) { _profiled_bci = bci; } -- GitLab From 17e68caad727b04f5e7efde59fce960c66558504 Mon Sep 17 00:00:00 2001 From: KIRIYAMA Takuya Date: Wed, 24 Nov 2021 11:22:43 +0000 Subject: [PATCH 461/890] 8277042: add test for 8276036 to compiler/codecache Reviewed-by: chagedorn, thartmann --- .../codecache/CodeCacheFullCountTest.java | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java diff --git a/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java new file mode 100644 index 00000000000..1fee39144ff --- /dev/null +++ b/test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021, 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.net.URL; +import java.net.URLClassLoader; +import java.lang.reflect.Field; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/* + * @test + * @bug 8276036 8277213 8277441 + * @summary test for the value of full_count in the message of insufficient codecache + * @library /test/lib + */ +public class CodeCacheFullCountTest { + public static void main(String args[]) throws Throwable { + if (args.length == 1) { + wasteCodeCache(); + } else { + runTest(); + } + } + + public static void wasteCodeCache() throws Exception { + URL url = CodeCacheFullCountTest.class.getProtectionDomain().getCodeSource().getLocation(); + + for (int i = 0; i < 500; i++) { + ClassLoader cl = new MyClassLoader(url); + refClass(cl.loadClass("SomeClass")); + } + } + + public static void runTest() throws Throwable { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache"); + OutputAnalyzer oa = ProcessTools.executeProcess(pb); + oa.shouldHaveExitValue(0); + String stdout = oa.getStdout(); + + Pattern pattern = Pattern.compile("full_count=(\\d)"); + Matcher stdoutMatcher = pattern.matcher(stdout); + if (stdoutMatcher.find()) { + int fullCount = Integer.parseInt(stdoutMatcher.group(1)); + if (fullCount != 1) { + throw new RuntimeException("the value of full_count is wrong."); + } + } else { + throw new RuntimeException("codecache shortage did not occur."); + } + } + + private static void refClass(Class clazz) throws Exception { + Field name = clazz.getDeclaredField("NAME"); + name.setAccessible(true); + name.get(null); + } + + private static class MyClassLoader extends URLClassLoader { + public MyClassLoader(URL url) { + super(new URL[]{url}, null); + } + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + try { + return super.loadClass(name, resolve); + } catch (ClassNotFoundException e) { + return Class.forName(name, resolve, CodeCacheFullCountTest.class.getClassLoader()); + } + } + } +} + +abstract class Foo { + public abstract int foo(); +} + +class Foo1 extends Foo { + private int a; + public int foo() { return a; } +} + +class Foo2 extends Foo { + private int a; + public int foo() { return a; } +} + +class Foo3 extends Foo { + private int a; + public int foo() { return a; } +} + +class Foo4 extends Foo { + private int a; + public int foo() { return a; } +} + +class SomeClass { + static final String NAME = "name"; + + static { + int res =0; + Foo[] foos = new Foo[] { new Foo1(), new Foo2(), new Foo3(), new Foo4() }; + for (int i = 0; i < 100000; i++) { + res = foos[i % foos.length].foo(); + } + } +} -- GitLab From 96e36071b63b624d56739b014b457ffc48147c4f Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Wed, 24 Nov 2021 11:51:16 +0000 Subject: [PATCH 462/890] 8275063: Implementation of Foreign Function & Memory API (Second incubator) Reviewed-by: erikj, psandoz, jvernee, darcy --- make/test/JtregNativeJdk.gmk | 2 + src/hotspot/share/classfile/vmSymbols.hpp | 1 - src/hotspot/share/oops/methodData.cpp | 16 - .../share/prims/universalUpcallHandler.cpp | 1 + .../share/classes/java/lang/Module.java | 4 +- .../java/lang/invoke/MethodHandleImpl.java | 26 +- .../classes/java/lang/invoke/VarHandles.java | 79 +- .../share/classes/java/nio/Buffer.java | 5 +- .../internal/access/JavaLangInvokeAccess.java | 7 + .../jdk/internal/access/JavaNioAccess.java | 2 +- .../misc/X-ScopedMemoryAccess.java.template | 10 +- .../jdk/internal/reflect/Reflection.java | 2 + .../share/classes/sun/nio/ch/IOUtil.java | 12 +- .../jdk/incubator/foreign/AbstractLayout.java | 82 +- .../jdk/incubator/foreign/Addressable.java | 15 +- .../jdk/incubator/foreign/CLinker.java | 804 ++------- .../incubator/foreign/FunctionDescriptor.java | 147 +- .../jdk/incubator/foreign/GroupLayout.java | 25 +- .../jdk/incubator/foreign/MemoryAccess.java | 1455 ----------------- .../jdk/incubator/foreign/MemoryAddress.java | 745 +++++++-- .../jdk/incubator/foreign/MemoryHandles.java | 175 +- .../jdk/incubator/foreign/MemoryLayout.java | 146 +- .../jdk/incubator/foreign/MemoryLayouts.java | 157 -- .../jdk/incubator/foreign/MemorySegment.java | 1080 ++++++++++-- .../jdk/incubator/foreign/NativeSymbol.java | 89 + .../jdk/incubator/foreign/PaddingLayout.java | 23 +- .../jdk/incubator/foreign/ResourceScope.java | 207 +-- .../incubator/foreign/SegmentAllocator.java | 338 ++-- .../jdk/incubator/foreign/SequenceLayout.java | 50 +- .../jdk/incubator/foreign/SymbolLookup.java | 19 +- .../classes/jdk/incubator/foreign/VaList.java | 262 +++ .../jdk/incubator/foreign/ValueLayout.java | 492 +++++- .../jdk/incubator/foreign/package-info.java | 153 +- .../jdk/internal/foreign/AbstractCLinker.java | 56 - .../foreign/AbstractMemorySegmentImpl.java | 107 +- .../jdk/internal/foreign/ArenaAllocator.java | 129 +- .../classes/jdk/internal/foreign/CABI.java | 4 +- .../jdk/internal/foreign/ConfinedScope.java | 63 +- .../jdk/internal/foreign/LayoutPath.java | 21 +- .../internal/foreign/MemoryAddressImpl.java | 348 +++- .../foreign/NativeMemorySegmentImpl.java | 18 +- ...callHandler.java => NativeSymbolImpl.java} | 18 +- .../jdk/internal/foreign/PlatformLayouts.java | 157 +- .../internal/foreign/ResourceScopeImpl.java | 140 +- .../classes/jdk/internal/foreign/Scoped.java | 32 + .../jdk/internal/foreign/SharedScope.java | 68 +- .../jdk/internal/foreign/SystemLookup.java | 17 +- .../classes/jdk/internal/foreign/Utils.java | 92 +- .../jdk/internal/foreign/abi/Binding.java | 95 +- .../internal/foreign/abi/BufferLayout.java | 4 +- .../internal/foreign/abi/CallingSequence.java | 1 - .../foreign/abi/CallingSequenceBuilder.java | 2 - .../foreign/abi/ProgrammableInvoker.java | 27 +- .../abi/ProgrammableUpcallHandler.java | 11 +- .../jdk/internal/foreign/abi/SharedUtils.java | 398 +++-- .../jdk/internal/foreign/abi/UpcallStubs.java | 21 +- .../foreign/abi/aarch64/CallArranger.java | 57 +- .../foreign/abi/aarch64/TypeClass.java | 18 +- .../linux/LinuxAArch64CallArranger.java | 41 + .../abi/aarch64/linux/LinuxAArch64Linker.java | 43 +- .../abi/aarch64/linux/LinuxAArch64VaList.java | 108 +- .../macos/MacOsAArch64CallArranger.java | 41 + .../abi/aarch64/macos/MacOsAArch64Linker.java | 46 +- .../abi/aarch64/macos/MacOsAArch64VaList.java | 53 +- .../foreign/abi/x64/sysv/CallArranger.java | 13 +- .../foreign/abi/x64/sysv/SysVVaList.java | 90 +- .../foreign/abi/x64/sysv/SysVx64Linker.java | 43 +- .../foreign/abi/x64/sysv/TypeClass.java | 18 +- .../foreign/abi/x64/windows/CallArranger.java | 34 +- .../foreign/abi/x64/windows/TypeClass.java | 34 +- .../foreign/abi/x64/windows/WinVaList.java | 59 +- .../abi/x64/windows/Windowsx64Linker.java | 43 +- .../compiler/TestLinkToNativeRBP.java | 9 +- .../jdk/java/foreign/CallGeneratorHelper.java | 61 +- test/jdk/java/foreign/NativeTestHelper.java | 92 +- .../java/foreign/SafeFunctionAccessTest.java | 139 +- test/jdk/java/foreign/StdLibTest.java | 148 +- .../jdk/java/foreign/TestAdaptVarHandles.java | 62 +- test/jdk/java/foreign/TestAddressHandle.java | 160 -- test/jdk/java/foreign/TestArrayCopy.java | 542 ++++++ test/jdk/java/foreign/TestArrays.java | 66 +- test/jdk/java/foreign/TestByteBuffer.java | 96 +- test/jdk/java/foreign/TestCircularInit1.java | 45 - test/jdk/java/foreign/TestCircularInit2.java | 47 - test/jdk/java/foreign/TestCondy.java | 29 +- test/jdk/java/foreign/TestDowncall.java | 54 +- test/jdk/java/foreign/TestFree.java | 10 +- .../java/foreign/TestFunctionDescriptor.java | 35 +- test/jdk/java/foreign/TestHandshake.java | 7 +- test/jdk/java/foreign/TestIllegalLink.java | 60 +- test/jdk/java/foreign/TestIntrinsics.java | 48 +- .../java/foreign/TestLayoutAttributes.java | 82 - .../jdk/java/foreign/TestLayoutConstants.java | 58 +- test/jdk/java/foreign/TestLayoutEquality.java | 44 +- test/jdk/java/foreign/TestLayoutPaths.java | 61 +- test/jdk/java/foreign/TestLayouts.java | 129 +- test/jdk/java/foreign/TestMemoryAccess.java | 242 +-- .../foreign/TestMemoryAccessInstance.java | 296 ++++ .../java/foreign/TestMemoryAccessStatics.java | 364 ----- .../jdk/java/foreign/TestMemoryAlignment.java | 38 +- test/jdk/java/foreign/TestMemoryCopy.java | 121 -- .../java/foreign/TestMemoryDereference.java | 217 +++ .../foreign/TestMemoryHandleAsUnsigned.java | 89 +- test/jdk/java/foreign/TestMismatch.java | 6 +- test/jdk/java/foreign/TestNULLAddress.java | 20 +- test/jdk/java/foreign/TestNative.java | 72 +- .../foreign/TestNoForeignUnsafeOverride.java | 2 +- test/jdk/java/foreign/TestNulls.java | 77 +- test/jdk/java/foreign/TestReshape.java | 116 +- test/jdk/java/foreign/TestResourceScope.java | 129 +- test/jdk/java/foreign/TestRestricted.java | 21 +- .../java/foreign/TestScopedOperations.java | 164 +- .../java/foreign/TestSegmentAllocators.java | 386 ++--- test/jdk/java/foreign/TestSegmentCopy.java | 214 +++ ...TestRebase.java => TestSegmentOffset.java} | 58 +- test/jdk/java/foreign/TestSegmentOverlap.java | 142 ++ test/jdk/java/foreign/TestSegments.java | 70 +- test/jdk/java/foreign/TestSharedAccess.java | 8 +- test/jdk/java/foreign/TestSlices.java | 14 +- test/jdk/java/foreign/TestSpliterator.java | 23 +- test/jdk/java/foreign/TestStringEncoding.java | 7 +- test/jdk/java/foreign/TestSymbolLookup.java | 8 +- test/jdk/java/foreign/TestTypeAccess.java | 18 +- .../java/foreign/TestUnsupportedPlatform.java | 2 +- test/jdk/java/foreign/TestUpcall.java | 110 +- .../jdk/java/foreign/TestUpcallException.java | 16 +- .../jdk/java/foreign/TestUpcallHighArity.java | 18 +- .../java/foreign/TestUpcallStructScope.java | 16 +- test/jdk/java/foreign/TestVarArgs.java | 26 +- .../foreign/TestVarHandleCombinators.java | 40 +- test/jdk/java/foreign/ThrowingUpcall.java | 44 +- .../callarranger/TestAarch64CallArranger.java | 81 +- .../callarranger/TestWindowsCallArranger.java | 16 +- .../channels/AbstractChannelsTest.java | 26 +- .../channels/TestAsyncSocketChannels.java | 9 +- .../foreign/channels/TestSocketChannels.java | 8 +- .../foreigntest/PanamaMainUnnamedModule.java | 8 +- .../org/openjdk/foreigntest/PanamaMain.java | 2 +- .../openjdk/foreigntest/PanamaMainInvoke.java | 2 +- .../foreigntest/PanamaMainReflection.java | 2 +- .../handle/invoker/MethodHandleInvoker.java | 29 +- .../handle/lookup/MethodHandleLookup.java | 105 +- test/jdk/java/foreign/libAsyncInvokers.cpp | 146 ++ test/jdk/java/foreign/libIntrinsics.c | 6 + test/jdk/java/foreign/libSafeAccess.c | 6 + .../loaderLookup/TestLoaderLookup.java | 70 + .../foreign/loaderLookup/invoker/Invoker.java | 34 + .../foreign/loaderLookup/lookup/Lookup.java | 38 + .../java/foreign/loaderLookup/lookup/libFoo.c | 34 + .../foreign/malloc/TestMixedMallocFree.java | 20 +- .../foreign/stackwalk/TestAsyncStackWalk.java | 14 +- .../java/foreign/stackwalk/TestStackWalk.java | 14 +- test/jdk/java/foreign/valist/VaListTest.java | 393 ++--- .../foreign/virtual/TestVirtualCalls.java | 25 +- .../invoke/VarHandles/VarHandleTestExact.java | 3 +- .../util/stream/SegmentTestDataProvider.java | 33 +- .../foreign/BulkMismatchAcquire.java | 21 +- .../bench/jdk/incubator/foreign/BulkOps.java | 92 +- .../bench/jdk/incubator/foreign/CLayouts.java | 95 ++ .../foreign/CallOverheadConstant.java | 73 +- .../incubator/foreign/CallOverheadHelper.java | 76 +- .../foreign/CallOverheadVirtual.java | 70 +- .../bench/jdk/incubator/foreign/JNICB.h | 29 + .../bench/jdk/incubator/foreign/JNICB.java | 33 + .../incubator/foreign/LoopOverConstant.java | 4 +- .../jdk/incubator/foreign/LoopOverNew.java | 6 +- .../incubator/foreign/LoopOverNewHeap.java | 112 ++ .../foreign/LoopOverNonConstant.java | 53 +- .../foreign/LoopOverNonConstantFP.java | 13 +- .../foreign/LoopOverNonConstantHeap.java | 26 +- .../foreign/LoopOverNonConstantMapped.java | 22 +- .../foreign/LoopOverNonConstantShared.java | 20 +- .../foreign/LoopOverPollutedBuffer.java | 2 +- .../foreign/LoopOverPollutedSegments.java | 36 +- .../jdk/incubator/foreign/ParallelSum.java | 8 +- .../bench/jdk/incubator/foreign/QSort.java | 136 ++ .../jdk/incubator/foreign/StrLenTest.java | 68 +- .../foreign/TestAdaptVarHandles.java | 6 +- .../jdk/incubator/foreign/TestLoadBytes.java | 13 +- .../jdk/incubator/foreign/UnrolledAccess.java | 25 +- .../bench/jdk/incubator/foreign/Upcalls.java | 57 +- .../bench/jdk/incubator/foreign/VaList.java | 31 +- .../jdk/incubator/foreign/VarHandleExact.java | 4 +- .../jdk/incubator/foreign/libCallOverhead.c | 12 +- .../bench/jdk/incubator/foreign/libJNICB.c | 62 + .../bench/jdk/incubator/foreign/libQSort.c | 35 + .../bench/jdk/incubator/foreign/libQSortJNI.c | 89 + .../jdk/incubator/foreign/libUpcallsJNI.c | 41 +- .../foreign/points/support/PanamaPoint.java | 27 +- .../incubator/vector/TestLoadStoreBytes.java | 16 +- .../incubator/vector/TestLoadStoreShort.java | 18 +- 191 files changed, 9433 insertions(+), 7601 deletions(-) delete mode 100644 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAccess.java delete mode 100644 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayouts.java create mode 100644 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/NativeSymbol.java create mode 100644 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/VaList.java delete mode 100644 src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractCLinker.java rename src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/{abi/UpcallHandler.java => NativeSymbolImpl.java} (65%) create mode 100644 src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Scoped.java create mode 100644 src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64CallArranger.java create mode 100644 src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64CallArranger.java delete mode 100644 test/jdk/java/foreign/TestAddressHandle.java create mode 100644 test/jdk/java/foreign/TestArrayCopy.java delete mode 100644 test/jdk/java/foreign/TestCircularInit1.java delete mode 100644 test/jdk/java/foreign/TestCircularInit2.java delete mode 100644 test/jdk/java/foreign/TestLayoutAttributes.java create mode 100644 test/jdk/java/foreign/TestMemoryAccessInstance.java delete mode 100644 test/jdk/java/foreign/TestMemoryAccessStatics.java delete mode 100644 test/jdk/java/foreign/TestMemoryCopy.java create mode 100644 test/jdk/java/foreign/TestMemoryDereference.java create mode 100644 test/jdk/java/foreign/TestSegmentCopy.java rename test/jdk/java/foreign/{TestRebase.java => TestSegmentOffset.java} (68%) create mode 100644 test/jdk/java/foreign/TestSegmentOverlap.java create mode 100644 test/jdk/java/foreign/libAsyncInvokers.cpp create mode 100644 test/jdk/java/foreign/loaderLookup/TestLoaderLookup.java create mode 100644 test/jdk/java/foreign/loaderLookup/invoker/Invoker.java create mode 100644 test/jdk/java/foreign/loaderLookup/lookup/Lookup.java create mode 100644 test/jdk/java/foreign/loaderLookup/lookup/libFoo.c create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/CLayouts.java create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.h create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.java create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNewHeap.java create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/QSort.java create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/libJNICB.c create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSort.c create mode 100644 test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSortJNI.c diff --git a/make/test/JtregNativeJdk.gmk b/make/test/JtregNativeJdk.gmk index 270ff93d147..1a07de31653 100644 --- a/make/test/JtregNativeJdk.gmk +++ b/make/test/JtregNativeJdk.gmk @@ -54,6 +54,7 @@ BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncStackWalk := $(LIBCXX) +BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncInvokers := $(LIBCXX) # Platform specific setup ifeq ($(call isTargetOs, windows), true) @@ -66,6 +67,7 @@ ifeq ($(call isTargetOs, windows), true) BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := jvm.lib BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libAsyncStackWalk := /EHsc + BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libAsyncInvokers := /EHsc else BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp index 6357019adb7..d8dfcc418cc 100644 --- a/src/hotspot/share/classfile/vmSymbols.hpp +++ b/src/hotspot/share/classfile/vmSymbols.hpp @@ -351,7 +351,6 @@ /* Foreign API Support */ \ template(jdk_internal_invoke_NativeEntryPoint, "jdk/internal/invoke/NativeEntryPoint") \ template(jdk_internal_invoke_NativeEntryPoint_signature, "Ljdk/internal/invoke/NativeEntryPoint;") \ - template(jdk_incubator_foreign_MemoryAccess, "jdk/incubator/foreign/MemoryAccess") \ \ /* Support for JVMCI */ \ JVMCI_VM_SYMBOLS_DO(template, do_alias) \ diff --git a/src/hotspot/share/oops/methodData.cpp b/src/hotspot/share/oops/methodData.cpp index 4146f4a8200..bc0b175f511 100644 --- a/src/hotspot/share/oops/methodData.cpp +++ b/src/hotspot/share/oops/methodData.cpp @@ -1586,18 +1586,6 @@ bool MethodData::profile_unsafe(const methodHandle& m, int bci) { return false; } -bool MethodData::profile_memory_access(const methodHandle& m, int bci) { - Bytecode_invoke inv(m , bci); - if (inv.is_invokestatic()) { - if (inv.klass() == vmSymbols::jdk_incubator_foreign_MemoryAccess()) { - if (inv.name()->starts_with("get") || inv.name()->starts_with("set")) { - return true; - } - } - } - return false; -} - int MethodData::profile_arguments_flag() { return TypeProfileLevel % 10; } @@ -1627,10 +1615,6 @@ bool MethodData::profile_arguments_for_invoke(const methodHandle& m, int bci) { return true; } - if (profile_memory_access(m, bci)) { - return true; - } - assert(profile_arguments_jsr292_only(), "inconsistent"); return profile_jsr292(m, bci); } diff --git a/src/hotspot/share/prims/universalUpcallHandler.cpp b/src/hotspot/share/prims/universalUpcallHandler.cpp index 3457d4202ff..6257036ef9f 100644 --- a/src/hotspot/share/prims/universalUpcallHandler.cpp +++ b/src/hotspot/share/prims/universalUpcallHandler.cpp @@ -174,6 +174,7 @@ ProgrammableUpcallHandler::ProgrammableUpcallHandler() { } void ProgrammableUpcallHandler::handle_uncaught_exception(oop exception) { + ResourceMark rm; // Based on CATCH macro tty->print_cr("Uncaught exception:"); exception->print(); diff --git a/src/java.base/share/classes/java/lang/Module.java b/src/java.base/share/classes/java/lang/Module.java index ab7d2103850..e822c951420 100644 --- a/src/java.base/share/classes/java/lang/Module.java +++ b/src/java.base/share/classes/java/lang/Module.java @@ -68,6 +68,7 @@ import jdk.internal.org.objectweb.asm.ModuleVisitor; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; +import jdk.internal.vm.annotation.Stable; import sun.security.util.SecurityConstants; /** @@ -110,7 +111,8 @@ public final class Module implements AnnotatedElement { private final ModuleDescriptor descriptor; // true, if this module allows restricted native access - private volatile boolean enableNativeAccess; + @Stable + private boolean enableNativeAccess; /** * Creates a new named Module. The resulting Module will be defined to the diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index a428380443e..404782c047e 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -1667,6 +1667,10 @@ abstract class MethodHandleImpl { return caller.makeHiddenClassDefiner(name, bytes, Set.of()).defineClassAsLookup(initialize, classData); } + @Override + public Class[] exceptionTypes(MethodHandle handle) { + return VarHandles.exceptionTypes(handle); + } }); } @@ -2273,15 +2277,16 @@ abstract class MethodHandleImpl { // Indexes into constant method handles: static final int - MH_cast = 0, - MH_selectAlternative = 1, - MH_countedLoopPred = 2, - MH_countedLoopStep = 3, - MH_initIterator = 4, - MH_iteratePred = 5, - MH_iterateNext = 6, - MH_Array_newInstance = 7, - MH_LIMIT = 8; + MH_cast = 0, + MH_selectAlternative = 1, + MH_countedLoopPred = 2, + MH_countedLoopStep = 3, + MH_initIterator = 4, + MH_iteratePred = 5, + MH_iterateNext = 6, + MH_Array_newInstance = 7, + MH_VarHandles_handleCheckedExceptions = 8, + MH_LIMIT = 9; static MethodHandle getConstantHandle(int idx) { MethodHandle handle = HANDLES[idx]; @@ -2331,6 +2336,9 @@ abstract class MethodHandleImpl { case MH_Array_newInstance: return IMPL_LOOKUP.findStatic(Array.class, "newInstance", MethodType.methodType(Object.class, Class.class, int.class)); + case MH_VarHandles_handleCheckedExceptions: + return IMPL_LOOKUP.findStatic(VarHandles.class, "handleCheckedExceptions", + MethodType.methodType(void.class, Throwable.class)); } } catch (ReflectiveOperationException ex) { throw newInternalError(ex); diff --git a/src/java.base/share/classes/java/lang/invoke/VarHandles.java b/src/java.base/share/classes/java/lang/invoke/VarHandles.java index fb86bfab0e8..45cdb75b2ee 100644 --- a/src/java.base/share/classes/java/lang/invoke/VarHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/VarHandles.java @@ -31,12 +31,9 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.lang.reflect.Parameter; import java.nio.ByteOrder; import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -45,8 +42,6 @@ import java.util.stream.Stream; import static java.lang.invoke.MethodHandleStatics.UNSAFE; import static java.lang.invoke.MethodHandleStatics.VAR_HANDLE_IDENTITY_ADAPT; import static java.lang.invoke.MethodHandleStatics.newIllegalArgumentException; -import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; final class VarHandles { @@ -359,13 +354,13 @@ final class VarHandles { return target; } - public static VarHandle filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget) { + public static VarHandle filterValue(VarHandle target, MethodHandle pFilterToTarget, MethodHandle pFilterFromTarget) { Objects.requireNonNull(target); - Objects.requireNonNull(filterToTarget); - Objects.requireNonNull(filterFromTarget); + Objects.requireNonNull(pFilterToTarget); + Objects.requireNonNull(pFilterFromTarget); //check that from/to filters do not throw checked exceptions - noCheckedExceptions(filterToTarget); - noCheckedExceptions(filterFromTarget); + MethodHandle filterToTarget = adaptForCheckedExceptions(pFilterToTarget); + MethodHandle filterFromTarget = adaptForCheckedExceptions(pFilterFromTarget); List> newCoordinates = new ArrayList<>(); List> additionalCoordinates = new ArrayList<>(); @@ -473,8 +468,9 @@ final class VarHandles { List> newCoordinates = new ArrayList<>(targetCoordinates); for (int i = 0 ; i < filters.length ; i++) { - noCheckedExceptions(filters[i]); - MethodType filterType = filters[i].type(); + MethodHandle filter = Objects.requireNonNull(filters[i]); + filter = adaptForCheckedExceptions(filter); + MethodType filterType = filter.type(); if (filterType.parameterCount() != 1) { throw newIllegalArgumentException("Invalid filter type " + filterType); } else if (newCoordinates.get(pos + i) != filterType.returnType()) { @@ -564,10 +560,10 @@ final class VarHandles { return adjustedType; } - public static VarHandle collectCoordinates(VarHandle target, int pos, MethodHandle filter) { + public static VarHandle collectCoordinates(VarHandle target, int pos, MethodHandle pFilter) { Objects.requireNonNull(target); - Objects.requireNonNull(filter); - noCheckedExceptions(filter); + Objects.requireNonNull(pFilter); + MethodHandle filter = adaptForCheckedExceptions(pFilter); List> targetCoordinates = target.coordinateTypes(); if (pos < 0 || pos >= targetCoordinates.size()) { @@ -604,42 +600,55 @@ final class VarHandles { (mode, modeHandle) -> MethodHandles.dropArguments(modeHandle, 1 + pos, valueTypes)); } - private static void noCheckedExceptions(MethodHandle handle) { + private static MethodHandle adaptForCheckedExceptions(MethodHandle target) { + Class[] exceptionTypes = exceptionTypes(target); + if (exceptionTypes != null) { // exceptions known + if (Stream.of(exceptionTypes).anyMatch(VarHandles::isCheckedException)) { + throw newIllegalArgumentException("Cannot adapt a var handle with a method handle which throws checked exceptions"); + } + return target; // no adaptation needed + } else { + MethodHandle handler = MethodHandleImpl.getConstantHandle(MethodHandleImpl.MH_VarHandles_handleCheckedExceptions); + MethodHandle zero = MethodHandles.zero(target.type().returnType()); // dead branch + handler = MethodHandles.collectArguments(zero, 0, handler); + return MethodHandles.catchException(target, Throwable.class, handler); + } + } + + static void handleCheckedExceptions(Throwable throwable) throws Throwable { + if (isCheckedException(throwable.getClass())) { + throw new IllegalStateException("Adapter handle threw checked exception", throwable); + } + throw throwable; + } + + static Class[] exceptionTypes(MethodHandle handle) { if (handle instanceof DirectMethodHandle directHandle) { byte refKind = directHandle.member.getReferenceKind(); MethodHandleInfo info = new InfoFromMemberName( MethodHandles.Lookup.IMPL_LOOKUP, directHandle.member, refKind); - final Class[] exceptionTypes; if (MethodHandleNatives.refKindIsMethod(refKind)) { - exceptionTypes = info.reflectAs(Method.class, MethodHandles.Lookup.IMPL_LOOKUP) + return info.reflectAs(Method.class, MethodHandles.Lookup.IMPL_LOOKUP) .getExceptionTypes(); } else if (MethodHandleNatives.refKindIsField(refKind)) { - exceptionTypes = null; + return new Class[0]; } else if (MethodHandleNatives.refKindIsConstructor(refKind)) { - exceptionTypes = info.reflectAs(Constructor.class, MethodHandles.Lookup.IMPL_LOOKUP) + return info.reflectAs(Constructor.class, MethodHandles.Lookup.IMPL_LOOKUP) .getExceptionTypes(); } else { throw new AssertionError("Cannot get here"); } - if (exceptionTypes != null) { - if (Stream.of(exceptionTypes).anyMatch(VarHandles::isCheckedException)) { - throw newIllegalArgumentException("Cannot adapt a var handle with a method handle which throws checked exceptions"); - } - } } else if (handle instanceof DelegatingMethodHandle) { - noCheckedExceptions(((DelegatingMethodHandle)handle).getTarget()); - } else { - //bound - BoundMethodHandle boundHandle = (BoundMethodHandle)handle; - for (int i = 0 ; i < boundHandle.fieldCount() ; i++) { - Object arg = boundHandle.arg(i); - if (arg instanceof MethodHandle){ - noCheckedExceptions((MethodHandle) arg); - } - } + return exceptionTypes(((DelegatingMethodHandle)handle).getTarget()); + } else if (handle instanceof NativeMethodHandle) { + return new Class[0]; } + + assert handle instanceof BoundMethodHandle : "Unexpected handle type: " + handle; + // unknown + return null; } private static boolean isCheckedException(Class clazz) { diff --git a/src/java.base/share/classes/java/nio/Buffer.java b/src/java.base/share/classes/java/nio/Buffer.java index 607d5d45183..92c9f80dca8 100644 --- a/src/java.base/share/classes/java/nio/Buffer.java +++ b/src/java.base/share/classes/java/nio/Buffer.java @@ -820,7 +820,7 @@ public abstract class Buffer { } @Override - public Scope.Handle acquireScope(Buffer buffer, boolean async) { + public Runnable acquireScope(Buffer buffer, boolean async) { var scope = buffer.scope(); if (scope == null) { return null; @@ -828,7 +828,8 @@ public abstract class Buffer { if (async && scope.ownerThread() != null) { throw new IllegalStateException("Confined scope not supported"); } - return scope.acquire(); + scope.acquire0(); + return scope::release0; } @Override diff --git a/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java b/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java index ee655188c9d..20823fcfcad 100644 --- a/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java +++ b/src/java.base/share/classes/jdk/internal/access/JavaLangInvokeAccess.java @@ -181,4 +181,11 @@ public interface JavaLangInvokeAccess { * The given bytes is trusted. */ Lookup defineHiddenClassWithClassData(Lookup caller, String name, byte[] bytes, Object classData, boolean initialize); + + /** + * A best-effort method that tries to find any exceptions thrown by the given method handle. + * @param handle the handle to check + * @return an array of exceptions, or {@code null}. + */ + Class[] exceptionTypes(MethodHandle handle); } diff --git a/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java b/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java index c639e4ced83..82739b9bf07 100644 --- a/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java +++ b/src/java.base/share/classes/jdk/internal/access/JavaNioAccess.java @@ -92,7 +92,7 @@ public interface JavaNioAccess { * scope handle. Null is returned if the buffer has no scope, or * acquiring is not required to guarantee safety. */ - Scope.Handle acquireScope(Buffer buffer, boolean async); + Runnable acquireScope(Buffer buffer, boolean async); /** * Used by {@code jdk.internal.foreign.MappedMemorySegmentImpl} and byte buffer var handle views. diff --git a/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template index e4cf2f5b2ed..be2e8cb24ff 100644 --- a/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template +++ b/src/java.base/share/classes/jdk/internal/misc/X-ScopedMemoryAccess.java.template @@ -103,19 +103,13 @@ public class ScopedMemoryAccess { */ public interface Scope { - interface Handle { - Scope scope(); - } - void checkValidState(); Thread ownerThread(); - boolean isImplicit(); - - Handle acquire(); + void acquire0(); - void release(Handle handle); + void release0(); /** * Error thrown when memory access fails because the memory has already been released. diff --git a/src/java.base/share/classes/jdk/internal/reflect/Reflection.java b/src/java.base/share/classes/jdk/internal/reflect/Reflection.java index ce9655f7a78..76a4bf8fa4a 100644 --- a/src/java.base/share/classes/jdk/internal/reflect/Reflection.java +++ b/src/java.base/share/classes/jdk/internal/reflect/Reflection.java @@ -32,6 +32,7 @@ import java.util.Objects; import java.util.Set; import jdk.internal.access.SharedSecrets; import jdk.internal.misc.VM; +import jdk.internal.vm.annotation.ForceInline; import jdk.internal.vm.annotation.IntrinsicCandidate; /** Common utility routines used by both java.lang and @@ -106,6 +107,7 @@ public class Reflection { } } + @ForceInline public static void ensureNativeAccess(Class currentClass) { Module module = currentClass.getModule(); if (!SharedSecrets.getJavaLangAccess().isEnableNativeAccess(module)) { diff --git a/src/java.base/share/classes/sun/nio/ch/IOUtil.java b/src/java.base/share/classes/sun/nio/ch/IOUtil.java index 900bb4e4088..bea092befae 100644 --- a/src/java.base/share/classes/sun/nio/ch/IOUtil.java +++ b/src/java.base/share/classes/sun/nio/ch/IOUtil.java @@ -475,15 +475,15 @@ public class IOUtil { private static final JavaNioAccess NIO_ACCESS = SharedSecrets.getJavaNioAccess(); - static Scope.Handle acquireScope(ByteBuffer bb, boolean async) { + static Runnable acquireScope(ByteBuffer bb, boolean async) { return NIO_ACCESS.acquireScope(bb, async); } - private static void releaseScope(Scope.Handle handle) { + private static void releaseScope(Runnable handle) { if (handle == null) return; try { - handle.scope().release(handle); + handle.run(); } catch (Exception e) { throw new IllegalStateException(e); } @@ -535,11 +535,11 @@ public class IOUtil { } } - static record Releaser(Scope.Handle handle) implements Runnable { + static record Releaser(Runnable handle) implements Runnable { Releaser { Objects.requireNonNull(handle) ; } @Override public void run() { releaseScope(handle); } - static Runnable of(Scope.Handle handle) { return new Releaser(handle); } - static Runnable ofNullable(Scope.Handle handle) { + static Runnable of(Runnable handle) { return new Releaser(handle); } + static Runnable ofNullable(Runnable handle) { if (handle == null) return () -> { }; return new Releaser(handle); diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/AbstractLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/AbstractLayout.java index 81a20241a7a..f33e4cc2c4b 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/AbstractLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/AbstractLayout.java @@ -25,26 +25,23 @@ */ package jdk.incubator.foreign; +import jdk.internal.foreign.Utils; +import jdk.internal.vm.annotation.Stable; + import java.lang.constant.ClassDesc; -import java.lang.constant.Constable; import java.lang.constant.ConstantDesc; -import java.lang.constant.ConstantDescs; import java.lang.constant.DirectMethodHandleDesc; import java.lang.constant.DynamicConstantDesc; import java.lang.constant.MethodHandleDesc; import java.lang.constant.MethodTypeDesc; import java.nio.ByteOrder; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.OptionalLong; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static java.lang.constant.ConstantDescs.BSM_GET_STATIC_FINAL; import static java.lang.constant.ConstantDescs.BSM_INVOKE; +import static java.lang.constant.ConstantDescs.CD_Class; import static java.lang.constant.ConstantDescs.CD_String; import static java.lang.constant.ConstantDescs.CD_long; @@ -52,50 +49,33 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { private final OptionalLong size; final long alignment; - final Map attributes; + private final Optional name; + @Stable + long cachedSize; - public AbstractLayout(OptionalLong size, long alignment, Map attributes) { + public AbstractLayout(OptionalLong size, long alignment, Optional name) { this.size = size; this.alignment = alignment; - this.attributes = Collections.unmodifiableMap(attributes); + this.name = name; } @Override public AbstractLayout withName(String name) { Objects.requireNonNull(name); - return withAttribute(LAYOUT_NAME, name); + return dup(alignment, Optional.of(name)); } @Override public final Optional name() { - return attribute(LAYOUT_NAME).map(String.class::cast); - } - - @Override - public Optional attribute(String name) { - Objects.requireNonNull(name); - return Optional.ofNullable(attributes.get(name)); - } - - @Override - public Stream attributes() { - return attributes.keySet().stream(); - } - - @Override - public AbstractLayout withAttribute(String name, Constable value) { - Objects.requireNonNull(name); - Map newAttributes = new HashMap<>(attributes); - newAttributes.put(name, value); - return dup(alignment, newAttributes); + return name; } - abstract AbstractLayout dup(long alignment, Map annos); + abstract AbstractLayout dup(long alignment, Optional name); @Override public AbstractLayout withBitAlignment(long alignmentBits) { checkAlignment(alignmentBits); - return dup(alignmentBits, attributes); + return dup(alignmentBits, name); } void checkAlignment(long alignmentBitCount) { @@ -120,6 +100,15 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { return alignment; } + @Override + public long byteSize() { + if (cachedSize == 0) { + cachedSize = Utils.bitsToBytesOrThrow(bitSize(), + () -> new UnsupportedOperationException("Cannot compute byte size; bit size is not a multiple of 8")); + } + return cachedSize; + } + @Override public boolean hasSize() { return size.isPresent(); @@ -145,11 +134,6 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { if (!hasNaturalAlignment()) { s = alignment + "%" + s; } - if (!attributes.isEmpty()) { - s += attributes.entrySet().stream() - .map(e -> e.getKey() + "=" + e.getValue()) - .collect(Collectors.joining(",", "[", "]")); - } return s; } @@ -158,9 +142,9 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { desc = DynamicConstantDesc.ofNamed(BSM_INVOKE, "withBitAlignment", desc.constantType(), MH_WITH_BIT_ALIGNMENT, desc, bitAlignment()); } - for (var e : attributes.entrySet()) { - desc = DynamicConstantDesc.ofNamed(BSM_INVOKE, "withAttribute", desc.constantType(), MH_WITH_ATTRIBUTE, - desc, e.getKey(), e.getValue().describeConstable().orElseThrow()); + if (name().isPresent()) { + desc = DynamicConstantDesc.ofNamed(BSM_INVOKE, "withName", desc.constantType(), MH_WITH_NAME, + desc, name().get().describeConstable().orElseThrow()); } return desc; @@ -177,7 +161,7 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { @Override public int hashCode() { - return attributes.hashCode() << Long.hashCode(alignment); + return name.hashCode() << Long.hashCode(alignment); } @Override @@ -190,7 +174,7 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { return false; } - return Objects.equals(attributes, ((AbstractLayout) other).attributes) && + return Objects.equals(name, ((AbstractLayout) other).name) && Objects.equals(alignment, ((AbstractLayout) other).alignment); } @@ -208,8 +192,6 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { static final ClassDesc CD_FUNCTION_DESC = FunctionDescriptor.class.describeConstable().get(); - static final ClassDesc CD_Constable = Constable.class.describeConstable().get(); - static final ConstantDesc BIG_ENDIAN = DynamicConstantDesc.ofNamed(BSM_GET_STATIC_FINAL, "BIG_ENDIAN", CD_BYTEORDER, CD_BYTEORDER); static final ConstantDesc LITTLE_ENDIAN = DynamicConstantDesc.ofNamed(BSM_GET_STATIC_FINAL, "LITTLE_ENDIAN", CD_BYTEORDER, CD_BYTEORDER); @@ -217,9 +199,6 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { static final MethodHandleDesc MH_PADDING = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_STATIC, CD_MEMORY_LAYOUT, "paddingLayout", MethodTypeDesc.of(CD_MEMORY_LAYOUT, CD_long)); - static final MethodHandleDesc MH_VALUE = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_STATIC, CD_MEMORY_LAYOUT, "valueLayout", - MethodTypeDesc.of(CD_VALUE_LAYOUT, CD_long, CD_BYTEORDER)); - static final MethodHandleDesc MH_SIZED_SEQUENCE = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_STATIC, CD_MEMORY_LAYOUT, "sequenceLayout", MethodTypeDesc.of(CD_SEQUENCE_LAYOUT, CD_long, CD_MEMORY_LAYOUT)); @@ -232,6 +211,9 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { static final MethodHandleDesc MH_UNION = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_STATIC, CD_MEMORY_LAYOUT, "unionLayout", MethodTypeDesc.of(CD_GROUP_LAYOUT, CD_MEMORY_LAYOUT.arrayType())); + static final MethodHandleDesc MH_VALUE = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_STATIC, CD_MEMORY_LAYOUT, "valueLayout", + MethodTypeDesc.of(CD_VALUE_LAYOUT, CD_Class, CD_BYTEORDER)); + static final MethodHandleDesc MH_VOID_FUNCTION = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.STATIC, CD_FUNCTION_DESC, "ofVoid", MethodTypeDesc.of(CD_FUNCTION_DESC, CD_MEMORY_LAYOUT.arrayType())); @@ -241,6 +223,6 @@ abstract non-sealed class AbstractLayout implements MemoryLayout { static final MethodHandleDesc MH_WITH_BIT_ALIGNMENT = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_VIRTUAL, CD_MEMORY_LAYOUT, "withBitAlignment", MethodTypeDesc.of(CD_MEMORY_LAYOUT, CD_long)); - static final MethodHandleDesc MH_WITH_ATTRIBUTE = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_VIRTUAL, CD_MEMORY_LAYOUT, "withAttribute", - MethodTypeDesc.of(CD_MEMORY_LAYOUT, CD_String, CD_Constable)); + static final MethodHandleDesc MH_WITH_NAME = MethodHandleDesc.ofMethod(DirectMethodHandleDesc.Kind.INTERFACE_VIRTUAL, CD_MEMORY_LAYOUT, "withName", + MethodTypeDesc.of(CD_MEMORY_LAYOUT, CD_String)); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java index b5513c835db..39f61e76122 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java @@ -27,16 +27,21 @@ package jdk.incubator.foreign; /** * Represents a type which is addressable. An addressable type is one which can be projected down to - * a memory address instance (see {@link #address()}). Examples of addressable types are {@link MemorySegment}, - * {@link MemoryAddress} and {@link CLinker.VaList}. + * a {@linkplain #address() memory address}. Examples of addressable types are {@link MemorySegment}, + * {@link MemoryAddress}, {@link VaList} and {@link NativeSymbol}. + *

      + * The {@link Addressable} type is used by the {@link CLinker C linker} to model the types of + * {@link CLinker#downcallHandle(FunctionDescriptor) downcall handle} parameters that must be passed by reference + * (e.g. memory addresses, va lists and upcall stubs). * * @implSpec * Implementations of this interface are value-based. */ -public interface Addressable { +public sealed interface Addressable permits MemorySegment, MemoryAddress, NativeSymbol, VaList { + /** - * Map this object into a {@link MemoryAddress} instance. - * @return the {@link MemoryAddress} instance associated with this object. + * Returns the memory address associated with this addressable. + * @return The memory address associated with this addressable. */ MemoryAddress address(); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java index 5bd4ba57c12..f5f1a6dc313 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java @@ -25,93 +25,123 @@ */ package jdk.incubator.foreign; -import jdk.internal.foreign.AbstractCLinker; -import jdk.internal.foreign.NativeMemorySegmentImpl; -import jdk.internal.foreign.PlatformLayouts; import jdk.internal.foreign.SystemLookup; import jdk.internal.foreign.abi.SharedUtils; -import jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64VaList; -import jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64VaList; -import jdk.internal.foreign.abi.x64.sysv.SysVVaList; -import jdk.internal.foreign.abi.x64.windows.WinVaList; +import jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64Linker; +import jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64Linker; +import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; +import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; -import java.lang.constant.Constable; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Objects; -import java.util.function.Consumer; - -import static jdk.internal.foreign.PlatformLayouts.*; +import java.util.Optional; /** * A C linker implements the C Application Binary Interface (ABI) calling conventions. * Instances of this interface can be used to link foreign functions in native libraries that - * follow the JVM's target platform C ABI. + * follow the JVM's target platform C ABI. A C linker provides two main capabilities: first, it allows Java code + * to link foreign functions into a so called downcall method handle; secondly, it allows + * native code to call Java method handles via the generation of upcall stubs. *

      - * Linking a foreign function is a process which requires two components: a method type, and - * a function descriptor. The method type, consists of a set of carrier types, which, together, - * specify the Java signature which clients must adhere to when calling the underlying foreign function. - * The function descriptor contains a set of memory layouts which, together, specify the foreign function - * signature and classification information (via a custom layout attributes, see {@link TypeKind}), so that linking can take place. + * On unsupported platforms this class will fail to initialize with an {@link ExceptionInInitializerError}. *

      - * Clients of this API can build function descriptors using the predefined memory layout constants - * (based on a subset of the built-in types provided by the C language), found in this interface; alternatively, - * they can also decorate existing value layouts using the required {@link TypeKind} classification attribute - * (this can be done using the {@link MemoryLayout#withAttribute(String, Constable)} method). A failure to do so might - * result in linkage errors, given that linking requires additional classification information to determine, for instance, - * how arguments should be loaded into registers during a foreign function call. + * Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} + * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      + * + *

      Downcall method handles

      + *

      + * {@linkplain #downcallHandle(FunctionDescriptor) Linking a foreign function} is a process which requires a function descriptor, + * a set of memory layouts which, together, specify the signature of the foreign function to be linked, and returns, + * when complete, a downcall method handle, that is, a method handle that can be used to invoke the target native function. + * The Java {@link java.lang.invoke.MethodType method type} associated with the returned method handle is + * {@linkplain #downcallType(FunctionDescriptor) derived} from the argument and return layouts in the function descriptor. + * More specifically, given each layout {@code L} in the function descriptor, a corresponding carrier {@code C} is inferred, + * as described below: + *

        + *
      • if {@code L} is a {@link ValueLayout} with carrier {@code E} then there are two cases: + *
          + *
        • if {@code L} occurs in a parameter position and {@code E} is {@code MemoryAddress.class}, + * then {@code C = Addressable.class};
        • + *
        • otherwise, {@code C = E}; + *
      • + *
      • or, if {@code L} is a {@link GroupLayout}, then {@code C} is set to {@code MemorySegment.class}
      • + *
      *

      - * Implementations of this interface support the following primitive carrier types: - * {@code byte}, {@code short}, {@code char}, {@code int}, {@code long}, {@code float}, - * and {@code double}, as well as {@link MemoryAddress} for passing pointers, and - * {@link MemorySegment} for passing structs and unions. Finally, the {@link VaList} - * carrier type can be used to match the native {@code va_list} type. + * The downcall method handle type, derived as above, might be decorated by additional leading parameters: + *

        + *
      • If the downcall method handle is created {@linkplain #downcallHandle(FunctionDescriptor) without specifying a native symbol}, + * the downcall method handle type features a leading parameter of type {@link NativeSymbol}, from which the + * address of the target native function can be derived.
      • + *
      • If the function descriptor's return layout is a group layout, the resulting downcall method handle accepts + * an additional leading parameter of type {@link SegmentAllocator}, which is used by the linker runtime to allocate the + * memory region associated with the struct returned by the downcall method handle.
      • + *
      + *

      Variadic functions, declared in C either with a trailing ellipses ({@code ...}) at the end of the formal parameter + * list or with an empty formal parameter list, are not supported directly. However, it is possible to link a native + * variadic function by using a {@linkplain FunctionDescriptor#asVariadic(MemoryLayout...) variadic} function descriptor, + * in which the specialized signature of a given variable arity callsite is described in full. Alternatively, + * if the foreign library allows it, clients might also be able to interact with variable arity methods + * by passing a trailing parameter of type {@link VaList}. + * + *

      Upcall stubs

      + * + * {@linkplain #upcallStub(MethodHandle, FunctionDescriptor, ResourceScope) Creating an upcall stub} requires a method + * handle and a function descriptor; in this case, the set of memory layouts in the function descriptor + * specify the signature of the function pointer associated with the upcall stub. *

      - * For the linking process to be successful, some requirements must be satisfied; if {@code M} and {@code F} are - * the method type (obtained after dropping any prefix arguments) and the function descriptor, respectively, - * used during the linking process, then it must be that: + * The type of the provided method handle has to match the Java {@link java.lang.invoke.MethodType method type} + * associated with the upcall stub, which is derived from the argument and return layouts in the function descriptor. + * More specifically, given each layout {@code L} in the function descriptor, a corresponding carrier {@code C} is inferred, as described below: *

        - *
      • The arity of {@code M} is the same as that of {@code F};
      • - *
      • If the return type of {@code M} is {@code void}, then {@code F} should have no return layout - * (see {@link FunctionDescriptor#ofVoid(MemoryLayout...)});
      • - *
      • for each pair of carrier type {@code C} and layout {@code L} in {@code M} and {@code F}, respectively, - * where {@code C} and {@code L} refer to the same argument, or to the return value, the following conditions must hold: + *
      • if {@code L} is a {@link ValueLayout} with carrier {@code E} then there are two cases: *
          - *
        • If {@code C} is a primitve type, then {@code L} must be a {@code ValueLayout}, and the size of the layout must match - * that of the carrier type (see {@link Integer#SIZE} and similar fields in other primitive wrapper classes);
        • - *
        • If {@code C} is {@code MemoryAddress.class}, then {@code L} must be a {@code ValueLayout}, and its size must match - * the platform's address size (see {@link MemoryLayouts#ADDRESS}). For this purpose, the {@link CLinker#C_POINTER} layout - * constant can be used;
        • - *
        • If {@code C} is {@code MemorySegment.class}, then {@code L} must be a {@code GroupLayout}
        • - *
        • If {@code C} is {@code VaList.class}, then {@code L} must be {@link CLinker#C_VA_LIST}
        • - *
        - *
      • + *
      • if {@code L} occurs in a return position and {@code E} is {@code MemoryAddress.class}, + * then {@code C = Addressable.class};
      • + *
      • otherwise, {@code C = E}; + *
      + *
    • or, if {@code L} is a {@link GroupLayout}, then {@code C} is set to {@code MemorySegment.class}
    • * + * Upcall stubs are modelled by instances of type {@link NativeSymbol}; upcall stubs can be passed by reference to other + * downcall method handles (as {@link NativeSymbol} implements the {@link Addressable} interface) and, + * when no longer required, they can be {@link ResourceScope#close() released}, via their {@linkplain NativeSymbol#scope() scope}. * - *

      Variadic functions, declared in C either with a trailing ellipses ({@code ...}) at the end of the formal parameter - * list or with an empty formal parameter list, are not supported directly. It is not possible to create a method handle - * that takes a variable number of arguments, and neither is it possible to create an upcall stub wrapping a method - * handle that accepts a variable number of arguments. However, for downcalls only, it is possible to link a native - * variadic function by using a specialized method type and function descriptor: for each argument that is to be - * passed as a variadic argument, an explicit, additional, carrier type and memory layout must be present in the method type and - * function descriptor objects passed to the linker. Furthermore, as memory layouts corresponding to variadic arguments in - * a function descriptor must contain additional classification information, it is required that - * {@link #asVarArg(MemoryLayout)} is used to create the memory layouts for each parameter corresponding to a variadic - * argument in a specialized function descriptor. + *

      System lookup

      * - *

      On unsupported platforms this class will fail to initialize with an {@link ExceptionInInitializerError}. + * This class implements the {@link SymbolLookup} interface; as such clients can {@linkplain #lookup(String) lookup} symbols + * in the standard libraries associated with this linker. The set of symbols available for lookup is unspecified, + * as it depends on the platform and on the operating system. * - *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} - * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      + *

      Safety considerations

      + * + * Obtaining downcall method handle is intrinsically unsafe. A symbol in a native library does not, in general, + * contain enough signature information (e.g. arity and types of native function parameters). As a consequence, + * the linker runtime cannot validate linkage requests. When a client interacts with a downcall method handle obtained + * through an invalid linkage request (e.g. by specifying a function descriptor featuring too many argument layouts), + * the result of such interaction is unspecified and can lead to JVM crashes. On downcall handle invocation, + * the linker runtime guarantees the following for any argument that is a memory resource {@code R} (of type {@link MemorySegment}, + * {@link NativeSymbol} or {@link VaList}): + *
        + *
      • The resource scope of {@code R} is {@linkplain ResourceScope#isAlive() alive}. Otherwise, the invocation throws + * {@link IllegalStateException};
      • + *
      • The invocation occurs in same thread as the one {@link ResourceScope#ownerThread() owning} the resource scope of {@code R}, + * if said scope is confined. Otherwise, the invocation throws {@link IllegalStateException}; and
      • + *
      • The scope of {@code R} is {@linkplain ResourceScope#keepAlive(ResourceScope) kept alive} (and cannot be closed) during the invocation. + *
      + *

      + * When creating upcall stubs the linker runtime validates the type of the target method handle against the provided + * function descriptor and report an error if any mismatch is detected. As for downcalls, JVM crashes might occur, + * if the native code casts the function pointer associated with an upcall stub to a type + * that is incompatible with the provided function descriptor. Moreover, if the target method + * handle associated with an upcall stub returns a {@linkplain MemoryAddress native address}, clients must ensure + * that this address cannot become invalid after the upcall completes. This can lead to unspecified behavior, + * and even JVM crashes, since an upcall is typically executed in the context of a downcall method handle invocation. * * @implSpec * Implementations of this interface are immutable, thread-safe and value-based. */ -public sealed interface CLinker permits AbstractCLinker { +public sealed interface CLinker extends SymbolLookup permits Windowsx64Linker, SysVx64Linker, LinuxAArch64Linker, MacOsAArch64Linker { /** * Returns the C linker for the current platform. @@ -127,96 +157,75 @@ public sealed interface CLinker permits AbstractCLinker { * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ @CallerSensitive - static CLinker getInstance() { + static CLinker systemCLinker() { Reflection.ensureNativeAccess(Reflection.getCallerClass()); return SharedUtils.getSystemLinker(); } /** - * Obtains a system lookup which is suitable to find symbols in the standard C libraries. The set of symbols - * available for lookup is unspecified, as it depends on the platform and on the operating system. - *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. - * @return a system-specific library lookup which is suitable to find symbols in the standard C libraries. - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + * Lookup a symbol in the standard libraries associated with this linker. + * The set of symbols available for lookup is unspecified, as it depends on the platform and on the operating system. + * @return a symbol in the standard libraries associated with this linker. */ - @CallerSensitive - static SymbolLookup systemLookup() { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - return SystemLookup.getInstance(); + @Override + default Optional lookup(String name) { + return SystemLookup.getInstance().lookup(name); } /** * Obtains a foreign method handle, with the given type and featuring the given function descriptor, - * which can be used to call a target foreign function at the given address. + * which can be used to call a target foreign function at the address in the given native symbol. *

      * If the provided method type's return type is {@code MemorySegment}, then the resulting method handle features * an additional prefix parameter, of type {@link SegmentAllocator}, which will be used by the linker runtime * to allocate structs returned by-value. + *

      + * Calling this method is equivalent to the following code: +

      {@code
      +    linker.downcallHandle(function).bindTo(symbol);
      +}
      * * @param symbol downcall symbol. - * @param type the method type. * @param function the function descriptor. - * @return the downcall method handle. - * @throws IllegalArgumentException in the case of a method type and function descriptor mismatch, or if the symbol - * is {@link MemoryAddress#NULL} - * - * @see SymbolLookup - */ - MethodHandle downcallHandle(Addressable symbol, MethodType type, FunctionDescriptor function); - - /** - * Obtain a foreign method handle, with the given type and featuring the given function descriptor, - * which can be used to call a target foreign function at the given address. - *

      - * If the provided method type's return type is {@code MemorySegment}, then the provided allocator will be used by - * the linker runtime to allocate structs returned by-value. - * - * @param symbol downcall symbol. - * @param allocator the segment allocator. - * @param type the method type. - * @param function the function descriptor. - * @return the downcall method handle. - * @throws IllegalArgumentException in the case of a method type and function descriptor mismatch, or if the symbol - * is {@link MemoryAddress#NULL} + * @return the downcall method handle. The method handle type is inferred + * @throws IllegalArgumentException if the provided descriptor contains either a sequence or a padding layout, + * or if the symbol is {@link MemoryAddress#NULL} * * @see SymbolLookup */ - MethodHandle downcallHandle(Addressable symbol, SegmentAllocator allocator, MethodType type, FunctionDescriptor function); + default MethodHandle downcallHandle(NativeSymbol symbol, FunctionDescriptor function) { + SharedUtils.checkSymbol(symbol); + return downcallHandle(function).bindTo(symbol); + } /** * Obtains a foreign method handle, with the given type and featuring the given function descriptor, which can be - * used to call a target foreign function at an address. - * The resulting method handle features a prefix parameter (as the first parameter) corresponding to the address, of - * type {@link Addressable}. + * used to call a target foreign function at the address in a dynamically provided native symbol. + * The resulting method handle features a prefix parameter (as the first parameter) corresponding to the foreign function + * entry point, of type {@link NativeSymbol}. *

      - * If the provided method type's return type is {@code MemorySegment}, then the resulting method handle features an + * If the provided function descriptor's return layout is a {@link GroupLayout}, then the resulting method handle features an * additional prefix parameter (inserted immediately after the address parameter), of type {@link SegmentAllocator}), * which will be used by the linker runtime to allocate structs returned by-value. *

      - * The returned method handle will throw an {@link IllegalArgumentException} if the target address passed to it is - * {@link MemoryAddress#NULL}, or a {@link NullPointerException} if the target address is {@code null}. + * The returned method handle will throw an {@link IllegalArgumentException} if the native symbol passed to it is + * associated with the {@link MemoryAddress#NULL} address, or a {@link NullPointerException} if the native symbol is {@code null}. * - * @param type the method type. * @param function the function descriptor. - * @return the downcall method handle. - * @throws IllegalArgumentException in the case of a method type and function descriptor mismatch. + * @return the downcall method handle. The method handle type is inferred + * from the provided function descriptor. + * @throws IllegalArgumentException if the provided descriptor contains either a sequence or a padding layout. * * @see SymbolLookup */ - MethodHandle downcallHandle(MethodType type, FunctionDescriptor function); + MethodHandle downcallHandle(FunctionDescriptor function); /** * Allocates a native stub with given scope which can be passed to other foreign functions (as a function pointer); * calling such a function pointer from native code will result in the execution of the provided method handle. * *

      - * The returned memory address is associated with the provided scope. When such scope is closed, + * The returned function pointer is associated with the provided scope. When such scope is closed, * the corresponding native stub will be deallocated. *

      * The target method handle should not throw any exceptions. If the target method handle does throw an exception, @@ -228,563 +237,34 @@ public sealed interface CLinker permits AbstractCLinker { * @param target the target method handle. * @param function the function descriptor. * @param scope the upcall stub scope. - * @return the native stub segment. - * @throws IllegalArgumentException if the target's method type and the function descriptor mismatch. + * @return the native stub symbol. + * @throws IllegalArgumentException if the provided descriptor contains either a sequence or a padding layout, + * or if it is determined that the target method handle can throw an exception, or if the target method handle + * has a type that does not match the upcall stub inferred type. * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other * than the thread owning {@code scope}. */ - MemoryAddress upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope); - - /** - * The layout for the {@code char} C type - */ - ValueLayout C_CHAR = pick(SysV.C_CHAR, Win64.C_CHAR, AArch64.C_CHAR); - /** - * The layout for the {@code short} C type - */ - ValueLayout C_SHORT = pick(SysV.C_SHORT, Win64.C_SHORT, AArch64.C_SHORT); - /** - * The layout for the {@code int} C type - */ - ValueLayout C_INT = pick(SysV.C_INT, Win64.C_INT, AArch64.C_INT); - /** - * The layout for the {@code long} C type - */ - ValueLayout C_LONG = pick(SysV.C_LONG, Win64.C_LONG, AArch64.C_LONG); - /** - * The layout for the {@code long long} C type. - */ - ValueLayout C_LONG_LONG = pick(SysV.C_LONG_LONG, Win64.C_LONG_LONG, AArch64.C_LONG_LONG); - /** - * The layout for the {@code float} C type - */ - ValueLayout C_FLOAT = pick(SysV.C_FLOAT, Win64.C_FLOAT, AArch64.C_FLOAT); - /** - * The layout for the {@code double} C type - */ - ValueLayout C_DOUBLE = pick(SysV.C_DOUBLE, Win64.C_DOUBLE, AArch64.C_DOUBLE); - /** - * The {@code T*} native type. - */ - ValueLayout C_POINTER = pick(SysV.C_POINTER, Win64.C_POINTER, AArch64.C_POINTER); - /** - * The layout for the {@code va_list} C type - */ - MemoryLayout C_VA_LIST = pick(SysV.C_VA_LIST, Win64.C_VA_LIST, AArch64.C_VA_LIST); - - /** - * Returns a memory layout that is suitable to use as the layout for variadic arguments in a specialized - * function descriptor. - * @param the memory layout type - * @param layout the layout the adapt - * @return a potentially newly created layout with the right attributes - */ - @SuppressWarnings("unchecked") - static T asVarArg(T layout) { - Objects.requireNonNull(layout); - return (T) PlatformLayouts.asVarArg(layout); - } - - /** - * Converts a Java string into a UTF-8 encoded, null-terminated C string, - * storing the result into a native memory segment allocated using the provided allocator. - *

      - * This method always replaces malformed-input and unmappable-character - * sequences with this charset's default replacement byte array. The - * {@link java.nio.charset.CharsetEncoder} class should be used when more - * control over the encoding process is required. - * - * @param str the Java string to be converted into a C string. - * @param allocator the allocator to be used for the native segment allocation. - * @return a new native memory segment containing the converted C string. - */ - static MemorySegment toCString(String str, SegmentAllocator allocator) { - Objects.requireNonNull(str); - Objects.requireNonNull(allocator); - return toCString(str.getBytes(StandardCharsets.UTF_8), allocator); - } - - /** - * Converts a Java string into a UTF-8 encoded, null-terminated C string, - * storing the result into a native memory segment associated with the provided resource scope. - *

      - * This method always replaces malformed-input and unmappable-character - * sequences with this charset's default replacement byte array. The - * {@link java.nio.charset.CharsetEncoder} class should be used when more - * control over the encoding process is required. - * - * @param str the Java string to be converted into a C string. - * @param scope the resource scope to be associated with the returned segment. - * @return a new native memory segment containing the converted C string. - * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other - * than the thread owning {@code scope}. - */ - static MemorySegment toCString(String str, ResourceScope scope) { - return toCString(str, SegmentAllocator.ofScope(scope)); - } - - /** - * Converts a UTF-8 encoded, null-terminated C string stored at given address into a Java string. - *

      - * This method always replaces malformed-input and unmappable-character - * sequences with this charset's default replacement string. The {@link - * java.nio.charset.CharsetDecoder} class should be used when more control - * over the decoding process is required. - *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. - * - * @param addr the address at which the string is stored. - * @return a Java string with the contents of the null-terminated C string at given address. - * @throws IllegalArgumentException if the size of the native string is greater than the largest string supported by the platform, - * or if {@code addr == MemoryAddress.NULL}. - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. - */ - @CallerSensitive - static String toJavaString(MemoryAddress addr) { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - SharedUtils.checkAddress(addr); - return SharedUtils.toJavaStringInternal(NativeMemorySegmentImpl.EVERYTHING, addr.toRawLongValue()); - } - - /** - * Converts a UTF-8 encoded, null-terminated C string stored at given address into a Java string. - *

      - * This method always replaces malformed-input and unmappable-character - * sequences with this charset's default replacement string. The {@link - * java.nio.charset.CharsetDecoder} class should be used when more control - * over the decoding process is required. - * @param addr the address at which the string is stored. - * @return a Java string with the contents of the null-terminated C string at given address. - * @throws IllegalArgumentException if the size of the native string is greater than the largest string supported by the platform. - * @throws IllegalStateException if the size of the native string is greater than the size of the segment - * associated with {@code addr}, or if {@code addr} is associated with a segment that is not alive. - */ - static String toJavaString(MemorySegment addr) { - Objects.requireNonNull(addr); - return SharedUtils.toJavaStringInternal(addr, 0L); - } - - private static void copy(MemorySegment addr, byte[] bytes) { - var heapSegment = MemorySegment.ofArray(bytes); - addr.copyFrom(heapSegment); - MemoryAccess.setByteAtOffset(addr, bytes.length, (byte)0); - } - - private static MemorySegment toCString(byte[] bytes, SegmentAllocator allocator) { - MemorySegment addr = allocator.allocate(bytes.length + 1, 1L); - copy(addr, bytes); - return addr; - } + NativeSymbol upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope); /** - * Allocates memory of given size using malloc. - *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. - * - * @param size memory size to be allocated - * @return addr memory address of the allocated memory - * @throws OutOfMemoryError if malloc could not allocate the required amount of native memory. - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + * Obtains the downcall method handle {@linkplain MethodType type} associated with a given function descriptor. + * @param functionDescriptor a function descriptor. + * @return the downcall method handle {@linkplain MethodType type} associated with a given function descriptor. + * @throws IllegalArgumentException if one or more layouts in the function descriptor are not supported + * (e.g. if they are sequence layouts or padding layouts). */ - @CallerSensitive - static MemoryAddress allocateMemory(long size) { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - MemoryAddress addr = SharedUtils.allocateMemoryInternal(size); - if (addr.equals(MemoryAddress.NULL)) { - throw new OutOfMemoryError(); - } else { - return addr; - } + static MethodType downcallType(FunctionDescriptor functionDescriptor) { + return SharedUtils.inferMethodType(functionDescriptor, false); } /** - * Frees the memory pointed by the given memory address. - *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. - * - * @param addr memory address of the native memory to be freed - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * @throws IllegalArgumentException if {@code addr == MemoryAddress.NULL}. - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + * Obtains the method handle {@linkplain MethodType type} associated with an upcall stub with given function descriptor. + * @param functionDescriptor a function descriptor. + * @return the method handle {@linkplain MethodType type} associated with an upcall stub with given function descriptor. + * @throws IllegalArgumentException if one or more layouts in the function descriptor are not supported + * (e.g. if they are sequence layouts or padding layouts). */ - @CallerSensitive - static void freeMemory(MemoryAddress addr) { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - SharedUtils.checkAddress(addr); - SharedUtils.freeMemoryInternal(addr); - } - - /** - * An interface that models a C {@code va_list}. - *

      - * A va list is a stateful cursor used to iterate over a set of variadic arguments. - *

      - * Per the C specification (see C standard 6.5.2.2 Function calls - item 6), - * arguments to variadic calls are erased by way of 'default argument promotions', - * which erases integral types by way of integer promotion (see C standard 6.3.1.1 - item 2), - * and which erases all {@code float} arguments to {@code double}. - *

      - * As such, this interface only supports reading {@code int}, {@code double}, - * and any other type that fits into a {@code long}. - * - *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} - * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      - */ - sealed interface VaList extends Addressable permits WinVaList, SysVVaList, LinuxAArch64VaList, MacOsAArch64VaList, SharedUtils.EmptyVaList { - - /** - * Reads the next value as an {@code int} and advances this va list's position. - * - * @param layout the layout of the value - * @return the value read as an {@code int} - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code int} - */ - int vargAsInt(MemoryLayout layout); - - /** - * Reads the next value as a {@code long} and advances this va list's position. - * - * @param layout the layout of the value - * @return the value read as an {@code long} - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code long} - */ - long vargAsLong(MemoryLayout layout); - - /** - * Reads the next value as a {@code double} and advances this va list's position. - * - * @param layout the layout of the value - * @return the value read as an {@code double} - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code double} - */ - double vargAsDouble(MemoryLayout layout); - - /** - * Reads the next value as a {@code MemoryAddress} and advances this va list's position. - * - * @param layout the layout of the value - * @return the value read as an {@code MemoryAddress} - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code MemoryAddress} - */ - MemoryAddress vargAsAddress(MemoryLayout layout); - - /** - * Reads the next value as a {@code MemorySegment}, and advances this va list's position. - *

      - * The memory segment returned by this method will be allocated using the given {@link SegmentAllocator}. - * - * @param layout the layout of the value - * @param allocator the allocator to be used for the native segment allocation - * @return the value read as an {@code MemorySegment} - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code MemorySegment} - */ - MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator); - - /** - * Reads the next value as a {@code MemorySegment}, and advances this va list's position. - *

      - * The memory segment returned by this method will be associated with the given {@link ResourceScope}. - * - * @param layout the layout of the value - * @param scope the resource scope to be associated with the returned segment - * @return the value read as an {@code MemorySegment} - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code MemorySegment} - * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other - * than the thread owning {@code scope}. - */ - MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope); - - /** - * Skips a number of elements with the given memory layouts, and advances this va list's position. - * - * @param layouts the layout of the value - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - */ - void skip(MemoryLayout... layouts); - - /** - * Returns the resource scope associated with this instance. - * @return the resource scope associated with this instance. - */ - ResourceScope scope(); - - /** - * Copies this C {@code va_list} at its current position. Copying is useful to traverse the va list's elements - * starting from the current position, without affecting the state of the original va list, essentially - * allowing the elements to be traversed multiple times. - *

      - * Any native resource required by the execution of this method will be allocated in the resource scope - * associated with this instance (see {@link #scope()}). - *

      - * This method only copies the va list cursor itself and not the memory that may be attached to the - * va list which holds its elements. That means that if this va list was created with the - * {@link #make(Consumer, ResourceScope)} method, closing this va list will also release the native memory that holds its - * elements, making the copy unusable. - * - * @return a copy of this C {@code va_list}. - * @throws IllegalStateException if the resource scope associated with this instance has been closed - * (see {@link #scope()}). - */ - VaList copy(); - - /** - * Returns the memory address of the C {@code va_list} associated with this instance. - * The returned memory address is associated with same resource scope as that associated with this instance. - * - * @return the memory address of the C {@code va_list} associated with this instance. - */ - @Override - MemoryAddress address(); - - /** - * Constructs a new {@code VaList} instance out of a memory address pointing to an existing C {@code va_list}, - * backed by the {@linkplain ResourceScope#globalScope() global} resource scope. - *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. - * - * @param address a memory address pointing to an existing C {@code va_list}. - * @return a new {@code VaList} instance backed by the C {@code va_list} at {@code address}. - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. - */ - @CallerSensitive - static VaList ofAddress(MemoryAddress address) { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - return SharedUtils.newVaListOfAddress(address, ResourceScope.globalScope()); - } - - /** - * Constructs a new {@code VaList} instance out of a memory address pointing to an existing C {@code va_list}, - * with given resource scope. - *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. - * - * @param address a memory address pointing to an existing C {@code va_list}. - * @param scope the resource scope to be associated with the returned {@code VaList} instance. - * @return a new {@code VaList} instance backed by the C {@code va_list} at {@code address}. - * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other - * than the thread owning {@code scope}. - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. - */ - @CallerSensitive - static VaList ofAddress(MemoryAddress address, ResourceScope scope) { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - Objects.requireNonNull(address); - Objects.requireNonNull(scope); - return SharedUtils.newVaListOfAddress(address, scope); - } - - /** - * Constructs a new {@code VaList} using a builder (see {@link Builder}), associated with a given - * {@linkplain ResourceScope resource scope}. - *

      - * If this method needs to allocate native memory, such memory will be managed by the given - * {@linkplain ResourceScope resource scope}, and will be released when the resource scope is {@linkplain ResourceScope#close closed}. - *

      - * Note that when there are no elements added to the created va list, - * this method will return the same as {@link #empty()}. - * - * @param actions a consumer for a builder (see {@link Builder}) which can be used to specify the elements - * of the underlying C {@code va_list}. - * @param scope the scope to be used for the valist allocation. - * @return a new {@code VaList} instance backed by a fresh C {@code va_list}. - * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other - * than the thread owning {@code scope}. - */ - static VaList make(Consumer actions, ResourceScope scope) { - Objects.requireNonNull(actions); - Objects.requireNonNull(scope); - return SharedUtils.newVaList(actions, scope); - } - - /** - * Returns an empty C {@code va_list} constant. - *

      - * The returned {@code VaList} can not be closed. - * - * @return a {@code VaList} modelling an empty C {@code va_list}. - */ - static VaList empty() { - return SharedUtils.emptyVaList(); - } - - /** - * A builder interface used to construct a C {@code va_list}. - * - *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} - * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      - */ - sealed interface Builder permits WinVaList.Builder, SysVVaList.Builder, LinuxAArch64VaList.Builder, MacOsAArch64VaList.Builder { - - /** - * Adds a native value represented as an {@code int} to the C {@code va_list} being constructed. - * - * @param layout the native layout of the value. - * @param value the value, represented as an {@code int}. - * @return this builder. - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code int} - */ - Builder vargFromInt(ValueLayout layout, int value); - - /** - * Adds a native value represented as a {@code long} to the C {@code va_list} being constructed. - * - * @param layout the native layout of the value. - * @param value the value, represented as a {@code long}. - * @return this builder. - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code long} - */ - Builder vargFromLong(ValueLayout layout, long value); - - /** - * Adds a native value represented as a {@code double} to the C {@code va_list} being constructed. - * - * @param layout the native layout of the value. - * @param value the value, represented as a {@code double}. - * @return this builder. - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code double} - */ - Builder vargFromDouble(ValueLayout layout, double value); - - /** - * Adds a native value represented as a {@code MemoryAddress} to the C {@code va_list} being constructed. - * - * @param layout the native layout of the value. - * @param value the value, represented as a {@code Addressable}. - * @return this builder. - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code MemoryAddress} - */ - Builder vargFromAddress(ValueLayout layout, Addressable value); - - /** - * Adds a native value represented as a {@code MemorySegment} to the C {@code va_list} being constructed. - * - * @param layout the native layout of the value. - * @param value the value, represented as a {@code MemorySegment}. - * @return this builder. - * @throws IllegalArgumentException if the given memory layout is not compatible with {@code MemorySegment} - */ - Builder vargFromSegment(GroupLayout layout, MemorySegment value); - } - } - - /** - * A C type kind. Each kind corresponds to a particular C language builtin type, and can be attached to - * {@link ValueLayout} instances using the {@link MemoryLayout#withAttribute(String, Constable)} in order - * to obtain a layout which can be classified accordingly by {@link CLinker#downcallHandle(Addressable, MethodType, FunctionDescriptor)} - * and {@link CLinker#upcallStub(MethodHandle, FunctionDescriptor, ResourceScope)}. - */ - enum TypeKind { - /** - * A kind corresponding to the integral C {@code char} type - */ - CHAR(true), - /** - * A kind corresponding to the integral C {@code short} type - */ - SHORT(true), - /** - * A kind corresponding to the integral C {@code int} type - */ - INT(true), - /** - * A kind corresponding to the integral C {@code long} type - */ - LONG(true), - /** - * A kind corresponding to the integral C {@code long long} type - */ - LONG_LONG(true), - /** - * A kind corresponding to the floating-point C {@code float} type - */ - FLOAT(false), - /** - * A kind corresponding to the floating-point C {@code double} type - */ - DOUBLE(false), - /** - * A kind corresponding to the an integral C pointer type - */ - POINTER(false); - - private final boolean isIntegral; - - TypeKind(boolean isIntegral) { - this.isIntegral = isIntegral; - } - - /** - * Is this kind integral? - * - * @return true if this kind is integral - */ - public boolean isIntegral() { - return isIntegral; - } - - /** - * Is this kind a floating point type? - * - * @return true if this kind is a floating point type - */ - public boolean isFloat() { - return !isIntegral() && !isPointer(); - } - - /** - * Is this kind a pointer kind? - * - * @return true if this kind is a pointer kind - */ - public boolean isPointer() { - return this == POINTER; - } - - /** - * The layout attribute name associated with this classification kind. Clients can retrieve the type kind - * of a layout using the following code: - *
      {@code
      -        ValueLayout layout = ...
      -        TypeKind = layout.attribute(TypeKind.ATTR_NAME).orElse(null);
      -         * }
      - */ - public static final String ATTR_NAME = "abi/kind"; + static MethodType upcallType(FunctionDescriptor functionDescriptor) { + return SharedUtils.inferMethodType(functionDescriptor, true); } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java index 2124eea6ccd..8c40668d505 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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,10 +30,7 @@ import java.lang.constant.ConstantDescs; import java.lang.constant.DynamicConstantDesc; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; @@ -46,60 +43,16 @@ import java.util.stream.Stream; *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      */ -public final class FunctionDescriptor implements Constable { - - /** - * The name of the function descriptor attribute (see {@link #attributes()} used to mark trivial functions. The - * attribute value must be a boolean. - */ - public static final String TRIVIAL_ATTRIBUTE_NAME = "abi/trivial"; +public sealed class FunctionDescriptor implements Constable permits FunctionDescriptor.VariadicFunction { private final MemoryLayout resLayout; - private final MemoryLayout[] argLayouts; - private final Map attributes; + private final List argLayouts; - private FunctionDescriptor(MemoryLayout resLayout, Map attributes, MemoryLayout... argLayouts) { + private FunctionDescriptor(MemoryLayout resLayout, List argLayouts) { this.resLayout = resLayout; - this.attributes = attributes; this.argLayouts = argLayouts; } - /** - * Returns the attribute with the given name (if it exists). - * - * @param name the attribute name. - * @return the attribute with the given name (if it exists). - */ - public Optional attribute(String name) { - Objects.requireNonNull(name); - return Optional.ofNullable(attributes.get(name)); - } - - /** - * Returns a stream of the attribute names associated with this function descriptor. - * - * @return a stream of the attribute names associated with this function descriptor. - */ - public Stream attributes() { - return attributes.keySet().stream(); - } - - /** - * Returns a new function descriptor which features the same attributes as this descriptor, plus the newly specified attribute. - * If this descriptor already contains an attribute with the same name, the existing attribute value is overwritten in the returned - * descriptor. - * - * @param name the attribute name. - * @param value the attribute value. - * @return a new function descriptor which features the same attributes as this descriptor, plus the newly specified attribute. - */ - public FunctionDescriptor withAttribute(String name, Constable value) { - Objects.requireNonNull(name); - Map newAttributes = new HashMap<>(attributes); - newAttributes.put(name, value); - return new FunctionDescriptor(resLayout, newAttributes, argLayouts); - } - /** * Returns the return layout associated with this function. * @return the return layout. @@ -113,7 +66,7 @@ public final class FunctionDescriptor implements Constable { * @return the argument layouts. */ public List argumentLayouts() { - return Arrays.asList(argLayouts); + return argLayouts; } /** @@ -126,7 +79,7 @@ public final class FunctionDescriptor implements Constable { Objects.requireNonNull(resLayout); Objects.requireNonNull(argLayouts); Arrays.stream(argLayouts).forEach(Objects::requireNonNull); - return new FunctionDescriptor(resLayout, Map.of(), argLayouts); + return new FunctionDescriptor(resLayout, List.of(argLayouts)); } /** @@ -137,7 +90,31 @@ public final class FunctionDescriptor implements Constable { public static FunctionDescriptor ofVoid(MemoryLayout... argLayouts) { Objects.requireNonNull(argLayouts); Arrays.stream(argLayouts).forEach(Objects::requireNonNull); - return new FunctionDescriptor(null, Map.of(), argLayouts); + return new FunctionDescriptor(null, List.of(argLayouts)); + } + + /** + * Obtain a specialized variadic function descriptor, by appending given variadic layouts to this + * function descriptor argument layouts. The resulting function descriptor can report the position + * of the {@linkplain #firstVariadicArgumentIndex() first variadic argument}, and cannot be altered + * in any way: for instance, calling {@link #withReturnLayout(MemoryLayout)} on the resulting descriptor + * will throw an {@link UnsupportedOperationException}. + * @param variadicLayouts the variadic argument layouts to be appended to this descriptor argument layouts. + * @return a new variadic function descriptor, or this descriptor if {@code variadicLayouts.length == 0}. + */ + public FunctionDescriptor asVariadic(MemoryLayout... variadicLayouts) { + Objects.requireNonNull(variadicLayouts); + Arrays.stream(variadicLayouts).forEach(Objects::requireNonNull); + return variadicLayouts.length == 0 ? this : new VariadicFunction(this, variadicLayouts); + } + + /** + * The index of the first variadic argument layout (where defined). + * @return The index of the first variadic argument layout, or {@code -1} if this is not a + * {@linkplain #asVariadic(MemoryLayout...) variadic} layout. + */ + public int firstVariadicArgumentIndex() { + return -1; } /** @@ -149,9 +126,8 @@ public final class FunctionDescriptor implements Constable { public FunctionDescriptor withAppendedArgumentLayouts(MemoryLayout... addedLayouts) { Objects.requireNonNull(addedLayouts); Arrays.stream(addedLayouts).forEach(Objects::requireNonNull); - MemoryLayout[] newLayouts = Arrays.copyOf(argLayouts, argLayouts.length + addedLayouts.length); - System.arraycopy(addedLayouts, 0, newLayouts, argLayouts.length, addedLayouts.length); - return new FunctionDescriptor(resLayout, attributes, newLayouts); + List newLayouts = Stream.concat(argLayouts.stream(), Stream.of(addedLayouts)).toList(); + return new FunctionDescriptor(resLayout, newLayouts); } /** @@ -161,7 +137,7 @@ public final class FunctionDescriptor implements Constable { */ public FunctionDescriptor withReturnLayout(MemoryLayout newReturn) { Objects.requireNonNull(newReturn); - return new FunctionDescriptor(newReturn, attributes, argLayouts); + return new FunctionDescriptor(newReturn, argLayouts); } /** @@ -169,7 +145,7 @@ public final class FunctionDescriptor implements Constable { * @return the new function descriptor. */ public FunctionDescriptor withVoidReturnLayout() { - return new FunctionDescriptor(null, attributes, argLayouts); + return new FunctionDescriptor(null, argLayouts); } /** @@ -187,7 +163,7 @@ public final class FunctionDescriptor implements Constable { /** * Compares the specified object with this function descriptor for equality. Returns {@code true} if and only if the specified - * object is also a function descriptor, and all of the following conditions are met: + * object is also a function descriptor, and all the following conditions are met: *
        *
      • the two function descriptors have equals return layouts (see {@link MemoryLayout#equals(Object)}), or both have no return layout
      • *
      • the two function descriptors have argument layouts that are pair-wise equal (see {@link MemoryLayout#equals(Object)}) @@ -201,11 +177,10 @@ public final class FunctionDescriptor implements Constable { if (this == other) { return true; } - if (!(other instanceof FunctionDescriptor)) { + if (!(other instanceof FunctionDescriptor f)) { return false; } - FunctionDescriptor f = (FunctionDescriptor) other; - return Objects.equals(resLayout, f.resLayout) && Arrays.equals(argLayouts, f.argLayouts); + return Objects.equals(resLayout, f.resLayout) && Objects.equals(argLayouts, f.argLayouts); } /** @@ -214,10 +189,18 @@ public final class FunctionDescriptor implements Constable { */ @Override public int hashCode() { - int hashCode = Arrays.hashCode(argLayouts); + int hashCode = Objects.hashCode(argLayouts); return resLayout == null ? hashCode : resLayout.hashCode() ^ hashCode; } + /** + * Returns an {@link Optional} containing the nominal descriptor for this + * function descriptor, if one can be constructed, or an empty {@link Optional} + * if one cannot be constructed. + * + * @return An {@link Optional} containing the resulting nominal descriptor, + * or an empty {@link Optional} if one cannot be constructed. + */ @Override public Optional> describeConstable() { List constants = new ArrayList<>(); @@ -231,4 +214,40 @@ public final class FunctionDescriptor implements Constable { return Optional.of(DynamicConstantDesc.ofNamed( ConstantDescs.BSM_INVOKE, "function", AbstractLayout.CD_FUNCTION_DESC, constants.toArray(new ConstantDesc[0]))); } + + static final class VariadicFunction extends FunctionDescriptor { + + private final int firstVariadicIndex; + + public VariadicFunction(FunctionDescriptor descriptor, MemoryLayout... argLayouts) { + super(descriptor.returnLayout().orElse(null), + Stream.concat(descriptor.argumentLayouts().stream(), Stream.of(argLayouts)).toList()); + this.firstVariadicIndex = descriptor.argumentLayouts().size(); + } + + @Override + public int firstVariadicArgumentIndex() { + return firstVariadicIndex; + } + + @Override + public FunctionDescriptor withAppendedArgumentLayouts(MemoryLayout... addedLayouts) { + throw new UnsupportedOperationException(); + } + + @Override + public FunctionDescriptor withReturnLayout(MemoryLayout newReturn) { + throw new UnsupportedOperationException(); + } + + @Override + public FunctionDescriptor withVoidReturnLayout() { + throw new UnsupportedOperationException(); + } + + @Override + public Optional> describeConstable() { + return Optional.empty(); + } + } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/GroupLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/GroupLayout.java index bcb56052527..d08bb716ae8 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/GroupLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/GroupLayout.java @@ -25,14 +25,12 @@ */ package jdk.incubator.foreign; -import java.lang.constant.Constable; import java.lang.constant.ConstantDesc; import java.lang.constant.ConstantDescs; import java.lang.constant.DynamicConstantDesc; import java.lang.constant.MethodHandleDesc; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.OptionalLong; @@ -40,7 +38,7 @@ import java.util.function.LongBinaryOperator; import java.util.stream.Collectors; /** - * A group layout is used to combine together multiple member layouts. There are two ways in which member layouts + * A group layout is used to combine multiple member layouts. There are two ways in which member layouts * can be combined: if member layouts are laid out one after the other, the resulting group layout is said to be a struct * (see {@link MemoryLayout#structLayout(MemoryLayout...)}); conversely, if all member layouts are laid out at the same starting offset, * the resulting group layout is said to be a union (see {@link MemoryLayout#unionLayout(MemoryLayout...)}). @@ -105,11 +103,11 @@ public final class GroupLayout extends AbstractLayout implements MemoryLayout { private final List elements; GroupLayout(Kind kind, List elements) { - this(kind, elements, kind.alignof(elements), Map.of()); + this(kind, elements, kind.alignof(elements), Optional.empty()); } - GroupLayout(Kind kind, List elements, long alignment, Map attributes) { - super(kind.sizeof(elements), alignment, attributes); + GroupLayout(Kind kind, List elements, long alignment, Optional name) { + super(kind.sizeof(elements), alignment, name); this.kind = kind; this.elements = elements; } @@ -160,10 +158,9 @@ public final class GroupLayout extends AbstractLayout implements MemoryLayout { if (!super.equals(other)) { return false; } - if (!(other instanceof GroupLayout)) { + if (!(other instanceof GroupLayout g)) { return false; } - GroupLayout g = (GroupLayout)other; return kind.equals(g.kind) && elements.equals(g.elements); } @@ -173,8 +170,8 @@ public final class GroupLayout extends AbstractLayout implements MemoryLayout { } @Override - GroupLayout dup(long alignment, Map attributes) { - return new GroupLayout(kind, elements, alignment, attributes); + GroupLayout dup(long alignment, Optional name) { + return new GroupLayout(kind, elements, alignment, name); } @Override @@ -212,12 +209,4 @@ public final class GroupLayout extends AbstractLayout implements MemoryLayout { public GroupLayout withBitAlignment(long alignmentBits) { return (GroupLayout)super.withBitAlignment(alignmentBits); } - - /** - * {@inheritDoc} - */ - @Override - public GroupLayout withAttribute(String name, Constable value) { - return (GroupLayout)super.withAttribute(name, value); - } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAccess.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAccess.java deleted file mode 100644 index 3e2182b5963..00000000000 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAccess.java +++ /dev/null @@ -1,1455 +0,0 @@ -/* - * Copyright (c) 2020, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.incubator.foreign; - -import jdk.internal.access.foreign.MemorySegmentProxy; -import jdk.internal.vm.annotation.ForceInline; - -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.util.Objects; - -/** - * This class defines ready-made static accessors which can be used to dereference memory segments in many ways. - *

        - * The most primitive accessors (see {@link #getIntAtOffset(MemorySegment, long, ByteOrder)}) take a segment, an offset - * (expressed in bytes) and a byte order. The final address at which the dereference will occur will be computed by offsetting - * the base address by the specified offset, as if by calling {@link MemoryAddress#addOffset(long)} on the specified base address. - *

        - * In cases where no offset is required, overloads are provided (see {@link #getInt(MemorySegment, ByteOrder)}) so that - * clients can omit the offset coordinate. - *

        - * To help dereferencing in array-like use cases (e.g. where the layout of a given memory segment is a sequence - * layout of given size an element count), higher-level overloads are also provided (see {@link #getIntAtIndex(MemorySegment, long, ByteOrder)}), - * which take a segment and a logical element index. The formula to obtain the byte offset {@code O} from an - * index {@code I} is given by {@code O = I * S} where {@code S} is the size (expressed in bytes) of the element to - * be dereferenced. - *

        - * In cases where native byte order is preferred, overloads are provided (see {@link #getIntAtOffset(MemorySegment, long)}) - * so that clients can omit the byte order parameter. - * - *

        Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} - * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

        - */ -public final class MemoryAccess { - - private MemoryAccess() { - // just the one - } - - private static final VarHandle byte_handle = MemoryHandles.varHandle(byte.class, ByteOrder.nativeOrder()); - private static final VarHandle char_LE_handle = unalignedHandle(MemoryLayouts.BITS_16_LE, char.class); - private static final VarHandle short_LE_handle = unalignedHandle(MemoryLayouts.BITS_16_LE, short.class); - private static final VarHandle int_LE_handle = unalignedHandle(MemoryLayouts.BITS_32_LE, int.class); - private static final VarHandle float_LE_handle = unalignedHandle(MemoryLayouts.BITS_32_LE, float.class); - private static final VarHandle long_LE_handle = unalignedHandle(MemoryLayouts.BITS_64_LE, long.class); - private static final VarHandle double_LE_handle = unalignedHandle(MemoryLayouts.BITS_64_LE, double.class); - private static final VarHandle char_BE_handle = unalignedHandle(MemoryLayouts.BITS_16_BE, char.class); - private static final VarHandle short_BE_handle = unalignedHandle(MemoryLayouts.BITS_16_BE, short.class); - private static final VarHandle int_BE_handle = unalignedHandle(MemoryLayouts.BITS_32_BE, int.class); - private static final VarHandle float_BE_handle = unalignedHandle(MemoryLayouts.BITS_32_BE, float.class); - private static final VarHandle long_BE_handle = unalignedHandle(MemoryLayouts.BITS_64_BE, long.class); - private static final VarHandle double_BE_handle = unalignedHandle(MemoryLayouts.BITS_64_BE, double.class); - private static final VarHandle address_handle; - - static { - Class carrier = switch ((int) MemoryLayouts.ADDRESS.byteSize()) { - case 4 -> int.class; - case 8 -> long.class; - default -> throw new ExceptionInInitializerError("Unsupported pointer size: " + MemoryLayouts.ADDRESS.byteSize()); - }; - address_handle = MemoryHandles.asAddressVarHandle(unalignedHandle(MemoryLayouts.ADDRESS, carrier)); - } - - private static VarHandle unalignedHandle(ValueLayout elementLayout, Class carrier) { - return MemoryHandles.varHandle(carrier, 1, elementLayout.order()); - } - - // Note: all the accessor methods defined below take advantage of argument type profiling - // (see src/hotspot/share/oops/methodData.cpp) which greatly enhances performance when the same accessor - // method is used repeatedly with different segment kinds (e.g. on-heap vs. off-heap). - - /** - * Reads a byte from given segment and offset. - * - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a byte value read from {@code segment}. - */ - @ForceInline - public static byte getByteAtOffset(MemorySegment segment, long offset) { - Objects.requireNonNull(segment); - return (byte)byte_handle.get(segment, offset); - } - - /** - * Writes a byte at given segment and offset. - * - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the byte value to be written. - */ - @ForceInline - public static void setByteAtOffset(MemorySegment segment, long offset, byte value) { - Objects.requireNonNull(segment); - byte_handle.set(segment, offset, value); - } - - /** - * Reads a char from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    getCharAtOffset(segment, offset, ByteOrder.nativeOrder());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a char value read from {@code segment}. - */ - @ForceInline - public static char getCharAtOffset(MemorySegment segment, long offset) { - return getCharAtOffset(segment, offset, ByteOrder.nativeOrder()); - } - - /** - * Writes a char at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setCharAtOffset(segment, offset, ByteOrder.nativeOrder(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the char value to be written. - */ - @ForceInline - public static void setCharAtOffset(MemorySegment segment, long offset, char value) { - setCharAtOffset(segment, offset, ByteOrder.nativeOrder(), value); - } - - /** - * Reads a short from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    getShortAtOffset(segment, offset, ByteOrder.nativeOrder());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a short value read from {@code segment}. - */ - @ForceInline - public static short getShortAtOffset(MemorySegment segment, long offset) { - return getShortAtOffset(segment, offset, ByteOrder.nativeOrder()); - } - - /** - * Writes a short at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setShortAtOffset(segment, offset, ByteOrder.nativeOrder(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the short value to be written. - */ - @ForceInline - public static void setShortAtOffset(MemorySegment segment, long offset, short value) { - setShortAtOffset(segment, offset, ByteOrder.nativeOrder(), value); - } - - /** - * Reads an int from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    getIntAtOffset(segment, offset, ByteOrder.nativeOrder());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return an int value read from {@code segment}. - */ - @ForceInline - public static int getIntAtOffset(MemorySegment segment, long offset) { - return getIntAtOffset(segment, offset, ByteOrder.nativeOrder()); - } - - /** - * Writes an int at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setIntAtOffset(segment, offset, ByteOrder.nativeOrder(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the int value to be written. - */ - @ForceInline - public static void setIntAtOffset(MemorySegment segment, long offset, int value) { - setIntAtOffset(segment, offset, ByteOrder.nativeOrder(), value); - } - - /** - * Reads a float from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    getFloatAtOffset(segment, offset, ByteOrder.nativeOrder());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a float value read from {@code segment}. - */ - @ForceInline - public static float getFloatAtOffset(MemorySegment segment, long offset) { - return getFloatAtOffset(segment, offset, ByteOrder.nativeOrder()); - } - - /** - * Writes a float at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setFloatAtOffset(segment, offset, ByteOrder.nativeOrder(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the float value to be written. - */ - @ForceInline - public static void setFloatAtOffset(MemorySegment segment, long offset, float value) { - setFloatAtOffset(segment, offset, ByteOrder.nativeOrder(), value); - } - - /** - * Reads a long from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    getLongAtOffset(segment, offset, ByteOrder.nativeOrder());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a long value read from {@code segment}. - */ - @ForceInline - public static long getLongAtOffset(MemorySegment segment, long offset) { - return getLongAtOffset(segment, offset, ByteOrder.nativeOrder()); - } - - /** - * Writes a long at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setLongAtOffset(segment, offset, ByteOrder.nativeOrder(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the long value to be written. - */ - @ForceInline - public static void setLongAtOffset(MemorySegment segment, long offset, long value) { - setLongAtOffset(segment, offset, ByteOrder.nativeOrder(), value); - } - - /** - * Reads a double from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    getDoubleAtOffset(segment, offset, ByteOrder.nativeOrder());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a double value read from {@code segment}. - */ - @ForceInline - public static double getDoubleAtOffset(MemorySegment segment, long offset) { - return getDoubleAtOffset(segment, offset, ByteOrder.nativeOrder()); - } - - /** - * Writes a double at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setDoubleAtOffset(segment, offset, ByteOrder.nativeOrder(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the double value to be written. - */ - @ForceInline - public static void setDoubleAtOffset(MemorySegment segment, long offset, double value) { - setDoubleAtOffset(segment, offset, ByteOrder.nativeOrder(), value); - } - - /** - * Reads a memory address from given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent (e.g. on a 64-bit platform) to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.asAddressHandle(MemoryHandles.varHandle(long.class, ByteOrder.nativeOrder()));
        -    MemoryAddress value = (MemoryAddress)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @return a memory address read from {@code segment}. - */ - @ForceInline - public static MemoryAddress getAddressAtOffset(MemorySegment segment, long offset) { - Objects.requireNonNull(segment); - return (MemoryAddress)address_handle.get(segment, offset); - } - - /** - * Writes a memory address at given segment and offset, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent (e.g. on a 64-bit platform) to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.asAddressHandle(MemoryHandles.varHandle(long.class, ByteOrder.nativeOrder()));
        -    handle.set(segment, offset, value.address());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param value the memory address to be written (expressed as an {@link Addressable} instance). - */ - @ForceInline - public static void setAddressAtOffset(MemorySegment segment, long offset, Addressable value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(value); - address_handle.set(segment, offset, value.address()); - } - - /** - * Reads a char from given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(char.class, 1, order);
        -    char value = (char)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @return a char value read from {@code segment}. - */ - @ForceInline - public static char getCharAtOffset(MemorySegment segment, long offset, ByteOrder order) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - return (char)((order == ByteOrder.BIG_ENDIAN) ? char_BE_handle : char_LE_handle).get(segment, offset); - } - - /** - * Writes a char at given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(char.class, 1, order);
        -    handle.set(segment, offset, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @param value the char value to be written. - */ - @ForceInline - public static void setCharAtOffset(MemorySegment segment, long offset, ByteOrder order, char value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - ((order == ByteOrder.BIG_ENDIAN) ? char_BE_handle : char_LE_handle).set(segment, offset, value); - } - - /** - * Reads a short from given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(short.class, 1, order);
        -    short value = (short)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @return a short value read from {@code segment}. - */ - @ForceInline - public static short getShortAtOffset(MemorySegment segment, long offset, ByteOrder order) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - return (short)((order == ByteOrder.BIG_ENDIAN) ? short_BE_handle : short_LE_handle).get(segment, offset); - } - - /** - * Writes a short at given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(short.class, 1, order);
        -    handle.set(segment, offset, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @param value the short value to be written. - */ - @ForceInline - public static void setShortAtOffset(MemorySegment segment, long offset, ByteOrder order, short value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - ((order == ByteOrder.BIG_ENDIAN) ? short_BE_handle : short_LE_handle).set(segment, offset, value); - } - - /** - * Reads an int from given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(int.class, 1, order);
        -    int value = (int)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @return an int value read from {@code segment}. - */ - @ForceInline - public static int getIntAtOffset(MemorySegment segment, long offset, ByteOrder order) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - return (int)((order == ByteOrder.BIG_ENDIAN) ? int_BE_handle : int_LE_handle).get(segment, offset); - } - - /** - * Writes an int at given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(int.class, 1, order);
        -    handle.set(segment, offset, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @param value the int value to be written. - */ - @ForceInline - public static void setIntAtOffset(MemorySegment segment, long offset, ByteOrder order, int value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - ((order == ByteOrder.BIG_ENDIAN) ? int_BE_handle : int_LE_handle).set(segment, offset, value); - } - - /** - * Reads a float from given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(float.class, 1, order);
        -    float value = (float)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @return a float value read from {@code segment}. - */ - @ForceInline - public static float getFloatAtOffset(MemorySegment segment, long offset, ByteOrder order) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - return (float)((order == ByteOrder.BIG_ENDIAN) ? float_BE_handle : float_LE_handle).get(segment, offset); - } - - /** - * Writes a float at given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(float.class, 1, order);
        -    handle.set(segment, offset, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @param value the float value to be written. - */ - @ForceInline - public static void setFloatAtOffset(MemorySegment segment, long offset, ByteOrder order, float value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - ((order == ByteOrder.BIG_ENDIAN) ? float_BE_handle : float_LE_handle).set(segment, offset, value); - } - - /** - * Reads a long from given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(long.class, 1, order);
        -    long value = (long)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @return a long value read from {@code segment}. - */ - @ForceInline - public static long getLongAtOffset(MemorySegment segment, long offset, ByteOrder order) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - return (long)((order == ByteOrder.BIG_ENDIAN) ? long_BE_handle : long_LE_handle).get(segment, offset); - } - - /** - * Writes a long at given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(long.class, 1, order);
        -    handle.set(segment, offset, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @param value the long value to be written. - */ - @ForceInline - public static void setLongAtOffset(MemorySegment segment, long offset, ByteOrder order, long value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - ((order == ByteOrder.BIG_ENDIAN) ? long_BE_handle : long_LE_handle).set(segment, offset, value); - } - - /** - * Reads a double from given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(double.class, 1, order);
        -    double value = (double)handle.get(segment, offset);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @return a double value read from {@code segment}. - */ - @ForceInline - public static double getDoubleAtOffset(MemorySegment segment, long offset, ByteOrder order) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - return (double)((order == ByteOrder.BIG_ENDIAN) ? double_BE_handle : double_LE_handle).get(segment, offset); - } - - /** - * Writes a double at given segment and offset with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    VarHandle handle = MemoryHandles.varHandle(double.class, 1, order);
        -    handle.set(segment, offset, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param offset offset in bytes (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(offset)}. - * @param order the specified byte order. - * @param value the double value to be written. - */ - @ForceInline - public static void setDoubleAtOffset(MemorySegment segment, long offset, ByteOrder order, double value) { - Objects.requireNonNull(segment); - Objects.requireNonNull(order); - ((order == ByteOrder.BIG_ENDIAN) ? double_BE_handle : double_LE_handle).set(segment, offset, value); - } - - /** - * Reads a byte from given segment. - *

        - * This is equivalent to the following code: - *

        {@code
        -    byte value = getByteAtOffset(segment, 0L);
        -     * }
        - * - * @param segment the segment to be dereferenced. - * @return a byte value read from {@code segment}. - */ - @ForceInline - public static byte getByte(MemorySegment segment) { - return getByteAtOffset(segment, 0L); - } - - /** - * Writes a byte at given segment. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setByteAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the byte value to be written. - */ - @ForceInline - public static void setByte(MemorySegment segment, byte value) { - setByteAtOffset(segment, 0L, value); - } - - /** - * Reads a char from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    char value = getCharAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return a char value read from {@code segment}. - */ - @ForceInline - public static char getChar(MemorySegment segment) { - return getCharAtOffset(segment, 0L); - } - - /** - * Writes a char at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setCharAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the char value to be written. - */ - @ForceInline - public static void setChar(MemorySegment segment, char value) { - setCharAtOffset(segment, 0L, value); - } - - /** - * Reads a short from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    short value = getShortAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return a short value read from {@code segment}. - */ - @ForceInline - public static short getShort(MemorySegment segment) { - return getShortAtOffset(segment, 0L); - } - - /** - * Writes a short at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setShortAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the short value to be written. - */ - @ForceInline - public static void setShort(MemorySegment segment, short value) { - setShortAtOffset(segment, 0L, value); - } - - /** - * Reads an int from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    int value = getIntAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return an int value read from {@code segment}. - */ - @ForceInline - public static int getInt(MemorySegment segment) { - return getIntAtOffset(segment, 0L); - } - - /** - * Writes an int at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setIntAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the int value to be written. - */ - @ForceInline - public static void setInt(MemorySegment segment, int value) { - setIntAtOffset(segment, 0L, value); - } - - /** - * Reads a float from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    float value = getFloatAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return a float value read from {@code segment}. - */ - @ForceInline - public static float getFloat(MemorySegment segment) { - return getFloatAtOffset(segment, 0L); - } - - /** - * Writes a float at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setFloatAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the float value to be written. - */ - @ForceInline - public static void setFloat(MemorySegment segment, float value) { - setFloatAtOffset(segment, 0L, value); - } - - /** - * Reads a long from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    long value = getLongAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return a long value read from {@code segment}. - */ - @ForceInline - public static long getLong(MemorySegment segment) { - return getLongAtOffset(segment, 0L); - } - - /** - * Writes a long at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setLongAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the long value to be written. - */ - @ForceInline - public static void setLong(MemorySegment segment, long value) { - setLongAtOffset(segment, 0L, value); - } - - /** - * Reads a double from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    double value = getDoubleAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return a double value read from {@code segment}. - */ - @ForceInline - public static double getDouble(MemorySegment segment) { - return getDoubleAtOffset(segment, 0L); - } - - /** - * Writes a double at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setDoubleAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the double value to be written. - */ - @ForceInline - public static void setDouble(MemorySegment segment, double value) { - setDoubleAtOffset(segment, 0L, value); - } - - /** - * Reads a memory address from given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    MemoryAddress value = getAddressAtOffset(segment, 0L);
        -     * }
        - * @param segment the segment to be dereferenced. - * @return a memory address read from {@code segment}. - */ - @ForceInline - public static MemoryAddress getAddress(MemorySegment segment) { - return getAddressAtOffset(segment, 0L); - } - - /** - * Writes a memory address at given segment, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setAddressAtOffset(segment, 0L, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param value the memory address to be written (expressed as an {@link Addressable} instance). - */ - @ForceInline - public static void setAddress(MemorySegment segment, Addressable value) { - setAddressAtOffset(segment, 0L, value); - } - - /** - * Reads a char from given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    char value = getCharAtOffset(segment, 0L, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @return a char value read from {@code segment}. - */ - @ForceInline - public static char getChar(MemorySegment segment, ByteOrder order) { - return getCharAtOffset(segment, 0L, order); - } - - /** - * Writes a char at given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setCharAtOffset(segment, 0L, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @param value the char value to be written. - */ - @ForceInline - public static void setChar(MemorySegment segment, ByteOrder order, char value) { - setCharAtOffset(segment, 0L, order, value); - } - - /** - * Reads a short from given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    short value = getShortAtOffset(segment, 0L, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @return a short value read from {@code segment}. - */ - @ForceInline - public static short getShort(MemorySegment segment, ByteOrder order) { - return getShortAtOffset(segment, 0L, order); - } - - /** - * Writes a short at given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setShortAtOffset(segment, 0L, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @param value the short value to be written. - */ - @ForceInline - public static void setShort(MemorySegment segment, ByteOrder order, short value) { - setShortAtOffset(segment, 0L, order, value); - } - - /** - * Reads an int from given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    int value = getIntAtOffset(segment, 0L, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @return an int value read from {@code segment}. - */ - @ForceInline - public static int getInt(MemorySegment segment, ByteOrder order) { - return getIntAtOffset(segment, 0L, order); - } - - /** - * Writes an int at given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setIntAtOffset(segment, 0L, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @param value the int value to be written. - */ - @ForceInline - public static void setInt(MemorySegment segment, ByteOrder order, int value) { - setIntAtOffset(segment, 0L, order, value); - } - - /** - * Reads a float from given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    float value = getFloatAtOffset(segment, 0L, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @return a float value read from {@code segment}. - */ - @ForceInline - public static float getFloat(MemorySegment segment, ByteOrder order) { - return getFloatAtOffset(segment, 0L, order); - } - - /** - * Writes a float at given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setFloatAtOffset(segment, 0L, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @param value the float value to be written. - */ - @ForceInline - public static void setFloat(MemorySegment segment, ByteOrder order, float value) { - setFloatAtOffset(segment, 0L, order, value); - } - - /** - * Reads a long from given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    long value = getLongAtOffset(segment, 0L, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @return a long value read from {@code segment}. - */ - @ForceInline - public static long getLong(MemorySegment segment, ByteOrder order) { - return getLongAtOffset(segment, 0L, order); - } - - /** - * Writes a long at given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setLongAtOffset(segment, 0L, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @param value the long value to be written. - */ - @ForceInline - public static void setLong(MemorySegment segment, ByteOrder order, long value) { - setLongAtOffset(segment, 0L, order, value); - } - - /** - * Reads a double from given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    double value = getDoubleAtOffset(segment, 0L, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @return a double value read from {@code segment}. - */ - @ForceInline - public static double getDouble(MemorySegment segment, ByteOrder order) { - return getDoubleAtOffset(segment, 0L, order); - } - - /** - * Writes a double at given segment, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setDoubleAtOffset(segment, 0L, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param order the specified byte order. - * @param value the double value to be written. - */ - @ForceInline - public static void setDouble(MemorySegment segment, ByteOrder order, double value) { - setDoubleAtOffset(segment, 0L, order, value); - } - - /** - * Reads a char from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    char value = getCharAtOffset(segment, 2 * index);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @return a char value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static char getCharAtIndex(MemorySegment segment, long index) { - return getCharAtOffset(segment, scale(segment, index, 2)); - } - - /** - * Writes a char at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setCharAtOffset(segment, 2 * index, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @param value the char value to be written. - */ - @ForceInline - public static void setCharAtIndex(MemorySegment segment, long index, char value) { - setCharAtOffset(segment, scale(segment, index, 2), value); - } - - /** - * Reads a short from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    short value = getShortAtOffset(segment, 2 * index);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @return a short value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static short getShortAtIndex(MemorySegment segment, long index) { - return getShortAtOffset(segment, scale(segment, index, 2)); - } - - /** - * Writes a short at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setShortAtOffset(segment, 2 * index, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @param value the short value to be written. - */ - @ForceInline - public static void setShortAtIndex(MemorySegment segment, long index, short value) { - setShortAtOffset(segment, scale(segment, index, 2), value); - } - - /** - * Reads an int from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    int value = getIntAtOffset(segment, 4 * index);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @return an int value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static int getIntAtIndex(MemorySegment segment, long index) { - return getIntAtOffset(segment, scale(segment, index, 4)); - } - - /** - * Writes an int at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setIntAtOffset(segment, 4 * index, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @param value the int value to be written. - */ - @ForceInline - public static void setIntAtIndex(MemorySegment segment, long index, int value) { - setIntAtOffset(segment, scale(segment, index, 4), value); - } - - /** - * Reads a float from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    float value = getFloatAtOffset(segment, 4 * index);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @return a float value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static float getFloatAtIndex(MemorySegment segment, long index) { - return getFloatAtOffset(segment, scale(segment, index, 4)); - } - - /** - * Writes a float at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setFloatAtOffset(segment, 4 * index, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @param value the float value to be written. - */ - @ForceInline - public static void setFloatAtIndex(MemorySegment segment, long index, float value) { - setFloatAtOffset(segment, scale(segment, index, 4), value); - } - - /** - * Reads a long from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    return getLongAtOffset(segment, 8 * index);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @return a long value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static long getLongAtIndex(MemorySegment segment, long index) { - return getLongAtOffset(segment, scale(segment, index, 8)); - } - - /** - * Writes a long at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setLongAtOffset(segment, 8 * index, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param value the long value to be written. - */ - @ForceInline - public static void setLongAtIndex(MemorySegment segment, long index, long value) { - setLongAtOffset(segment, scale(segment, index, 8), value); - } - - /** - * Reads a double from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    return getDoubleAtOffset(segment, 8 * index);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @return a double value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static double getDoubleAtIndex(MemorySegment segment, long index) { - return getDoubleAtOffset(segment, scale(segment, index, 8)); - } - - /** - * Writes a double at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setDoubleAtOffset(segment, 8 * index, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param value the double value to be written. - */ - @ForceInline - public static void setDoubleAtIndex(MemorySegment segment, long index, double value) { - setDoubleAtOffset(segment, scale(segment, index, 8), value); - } - - /** - * Reads a memory address from given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    return getAddressAtOffset(segment, index * MemoryLayouts.ADDRESS.byteSize());
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @return a memory address read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static MemoryAddress getAddressAtIndex(MemorySegment segment, long index) { - return getAddressAtOffset(segment, scale(segment, index, (int)MemoryLayouts.ADDRESS.byteSize())); - } - - /** - * Writes a memory address at given segment and element index, with byte order set to {@link ByteOrder#nativeOrder()}. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setAddressAtOffset(segment, index * MemoryLayouts.ADDRESS.byteSize(), value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param value the memory address to be written (expressed as an {@link Addressable} instance). - */ - @ForceInline - public static void setAddressAtIndex(MemorySegment segment, long index, Addressable value) { - setAddressAtOffset(segment, scale(segment, index, (int)MemoryLayouts.ADDRESS.byteSize()), value); - } - - /** - * Reads a char from given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    char value = getCharAtOffset(segment, 2 * index, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @param order the specified byte order. - * @return a char value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static char getCharAtIndex(MemorySegment segment, long index, ByteOrder order) { - return getCharAtOffset(segment, scale(segment, index, 2), order); - } - - /** - * Writes a char at given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setCharAtOffset(segment, 2 * index, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @param order the specified byte order. - * @param value the char value to be written. - */ - @ForceInline - public static void setCharAtIndex(MemorySegment segment, long index, ByteOrder order, char value) { - setCharAtOffset(segment, scale(segment, index, 2), order, value); - } - - /** - * Reads a short from given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    short value = getShortAtOffset(segment, 2 * index, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @param order the specified byte order. - * @return a short value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static short getShortAtIndex(MemorySegment segment, long index, ByteOrder order) { - return getShortAtOffset(segment, scale(segment, index, 2), order); - } - - /** - * Writes a short at given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setShortAtOffset(segment, 2 * index, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 2)}. - * @param order the specified byte order. - * @param value the short value to be written. - */ - @ForceInline - public static void setShortAtIndex(MemorySegment segment, long index, ByteOrder order, short value) { - setShortAtOffset(segment, scale(segment, index, 2), order, value); - } - - /** - * Reads an int from given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    int value = getIntAtOffset(segment, 4 * index, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @param order the specified byte order. - * @return an int value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static int getIntAtIndex(MemorySegment segment, long index, ByteOrder order) { - return getIntAtOffset(segment, scale(segment, index, 4), order); - } - - /** - * Writes an int at given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setIntAtOffset(segment, 4 * index, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @param order the specified byte order. - * @param value the int value to be written. - */ - @ForceInline - public static void setIntAtIndex(MemorySegment segment, long index, ByteOrder order, int value) { - setIntAtOffset(segment, scale(segment, index, 4), order, value); - } - - /** - * Reads a float from given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    float value = getFloatAtOffset(segment, 4 * index, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @param order the specified byte order. - * @return a float value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static float getFloatAtIndex(MemorySegment segment, long index, ByteOrder order) { - return getFloatAtOffset(segment, scale(segment, index, 4), order); - } - - /** - * Writes a float at given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setFloatAtOffset(segment, 4 * index, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 4)}. - * @param order the specified byte order. - * @param value the float value to be written. - */ - @ForceInline - public static void setFloatAtIndex(MemorySegment segment, long index, ByteOrder order, float value) { - setFloatAtOffset(segment, scale(segment, index, 4), order, value); - } - - /** - * Reads a long from given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    return getLongAtOffset(segment, 8 * index, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param order the specified byte order. - * @return a long value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static long getLongAtIndex(MemorySegment segment, long index, ByteOrder order) { - return getLongAtOffset(segment, scale(segment, index, 8), order); - } - - /** - * Writes a long at given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setLongAtOffset(segment, 8 * index, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param order the specified byte order. - * @param value the long value to be written. - */ - @ForceInline - public static void setLongAtIndex(MemorySegment segment, long index, ByteOrder order, long value) { - setLongAtOffset(segment, scale(segment, index, 8), order, value); - } - - /** - * Reads a double from given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    return getDoubleAtOffset(segment, 8 * index, order);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param order the specified byte order. - * @return a double value read from {@code segment} at the element index specified by {@code index}. - */ - @ForceInline - public static double getDoubleAtIndex(MemorySegment segment, long index, ByteOrder order) { - return getDoubleAtOffset(segment, scale(segment, index, 8), order); - } - - /** - * Writes a double at given segment and element index, with given byte order. - *

        - * This is equivalent to the following code: - *

        {@code
        -    setDoubleAtOffset(segment, 8 * index, order, value);
        -     * }
        - * @param segment the segment to be dereferenced. - * @param index element index (relative to {@code segment}). The final address of this read operation can be expressed as {@code segment.address().addOffset(index * 8)}. - * @param order the specified byte order. - * @param value the double value to be written. - */ - @ForceInline - public static void setDoubleAtIndex(MemorySegment segment, long index, ByteOrder order, double value) { - setDoubleAtOffset(segment, scale(segment, index, 8), order, value); - } - - @ForceInline - private static long scale(MemorySegment address, long index, int size) { - return MemorySegmentProxy.multiplyOffsets(index, size, (MemorySegmentProxy)address); - } -} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java index 08290fc911f..ce1a77c41b3 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java @@ -27,33 +27,45 @@ package jdk.incubator.foreign; import jdk.internal.foreign.MemoryAddressImpl; -import jdk.internal.ref.CleanerFactory; import jdk.internal.reflect.CallerSensitive; -import java.lang.ref.Cleaner; +import java.nio.ByteOrder; /** - * A memory address models a reference into a memory location. Memory addresses are typically obtained using the - * {@link MemorySegment#address()} method, and can refer to either off-heap or on-heap memory. Off-heap memory - * addresses are referred to as native memory addresses (see {@link #isNative()}). Native memory addresses - * allow clients to obtain a raw memory address (expressed as a long value) which can then be used e.g. when interacting - * with native code. - *

        - * Given an address, it is possible to compute its offset relative to a given segment, which can be useful - * when performing memory dereference operations using a memory access var handle (see {@link MemoryHandles}). - *

        - * A memory address is associated with a {@linkplain ResourceScope resource scope}; the resource scope determines the - * lifecycle of the memory address, and whether the address can be used from multiple threads. Memory addresses - * obtained from {@linkplain #ofLong(long) numeric values}, or from native code, are associated with the - * {@linkplain ResourceScope#globalScope() global resource scope}. Memory addresses obtained from segments - * are associated with the same scope as the segment from which they have been obtained. + * A memory address models a reference into a memory location. Memory addresses are typically obtained in three ways: + *

          + *
        • By calling {@link Addressable#address()} on an instance of type {@link Addressable} (e.g. a memory segment);
        • + *
        • By invoking a {@linkplain CLinker#downcallHandle(FunctionDescriptor) downcall method handle} which returns a pointer;
        • + *
        • By reading an address from memory, e.g. via {@link MemorySegment#get(ValueLayout.OfAddress, long)}.
        • + *
        + * A memory address is backed by a raw machine pointer, expressed as a {@linkplain #toRawLongValue() long value}. + * + *

        Dereference

        + * + * A memory address can be read or written using various methods provided in this class (e.g. {@link #get(ValueLayout.OfInt, long)}). + * Each dereference method takes a {@linkplain jdk.incubator.foreign.ValueLayout value layout}, which specifies the size, + * alignment constraints, byte order as well as the Java type associated with the dereference operation, and an offset. + * For instance, to read an int from a segment, using {@link ByteOrder#nativeOrder() default endianness}, the following code can be used: + *
        {@code
        +MemoryAddress address = ...
        +int value = address.get(ValueLayout.JAVA_INT, 0);
        + * }
        + * + * If the value to be read is stored in memory using {@link ByteOrder#BIG_ENDIAN big-endian} encoding, the dereference operation + * can be expressed as follows: + *
        {@code
        +MemoryAddress address = ...
        +int value = address.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0);
        + * }
        + * + * All the dereference methods in this class are restricted: since + * a memory address does not feature temporal nor spatial bounds, the runtime has no way to check the correctness + * of the memory dereference operation. *

        * All implementations of this interface must be value-based; * programmers should treat instances that are {@linkplain #equals(Object) equal} as interchangeable and should not * use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, * synchronization may fail. The {@code equals} method should be used for comparisons. - *

        - * Non-platform classes should not implement {@linkplain MemoryAddress} directly. * *

        Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

        @@ -63,10 +75,11 @@ import java.lang.ref.Cleaner; */ public sealed interface MemoryAddress extends Addressable permits MemoryAddressImpl { - @Override - default MemoryAddress address() { - return this; - } + /** + * Returns the raw long value associated with this memory address. + * @return The raw long value associated with this memory address. + */ + long toRawLongValue(); /** * Creates a new memory address with given offset (in bytes), which might be negative, from current one. @@ -76,155 +89,651 @@ public sealed interface MemoryAddress extends Addressable permits MemoryAddressI MemoryAddress addOffset(long offset); /** - * Returns the resource scope associated with this memory address. - * @return the resource scope associated with this memory address. + * Reads a UTF-8 encoded, null-terminated string from this address and offset. + *

        + * This method always replaces malformed-input and unmappable-character + * sequences with this charset's default replacement string. The {@link + * java.nio.charset.CharsetDecoder} class should be used when more control + * over the decoding process is required. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a Java string constructed from the bytes read from the given starting address ({@code toRowLongValue() + offset}) + * up to (but not including) the first {@code '\0'} terminator character (assuming one is found). + * @throws IllegalArgumentException if the size of the native string is greater than the largest string supported by the platform. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + String getUtf8String(long offset); + + /** + * Writes the given string to this address at given offset, converting it to a null-terminated byte sequence using UTF-8 encoding. + *

        + * This method always replaces malformed-input and unmappable-character + * sequences with this charset's default replacement string. The {@link + * java.nio.charset.CharsetDecoder} class should be used when more control + * over the decoding process is required. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @param str the Java string to be written at this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setUtf8String(long offset, String str); + + /** + * Compares the specified object with this address for equality. Returns {@code true} if and only if the specified + * object is also an address, and it refers to the same memory location as this address. + * + * @param that the object to be compared for equality with this address. + * @return {@code true} if the specified object is equal to this address. + */ + @Override + boolean equals(Object that); + + /** + * Returns the hash code value for this address. + * @return the hash code value for this address. + */ + @Override + int hashCode(); + + /** + * The native memory address instance modelling the {@code NULL} address. + */ + MemoryAddress NULL = new MemoryAddressImpl(0L); + + /** + * Obtain a native memory address instance from given long address. + * @param value the long address. + * @return the new memory address instance. + */ + static MemoryAddress ofLong(long value) { + return value == 0 ? + NULL : + new MemoryAddressImpl(value); + } + + /** + * Reads a byte from this address and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a byte value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - ResourceScope scope(); + @CallerSensitive + byte get(ValueLayout.OfByte layout, long offset); /** - * Returns the offset of this memory address into the given segment. More specifically, if both the segment's - * base address and this address are native addresses, the result is computed as - * {@code this.toRawLongValue() - segment.address().toRawLongValue()}. Otherwise, if both addresses in the form - * {@code (B, O1)}, {@code (B, O2)}, where {@code B} is the same base heap object and {@code O1}, {@code O2} - * are byte offsets (relative to the base object) associated with this address and the segment's base address, - * the result is computed as {@code O1 - O2}. + * Writes a byte to this address instance and offset with given layout. *

        - * If the segment's base address and this address are both heap addresses, but with different base objects, the result is undefined - * and an exception is thrown. Similarly, if the segment's base address is an heap address (resp. off-heap) and - * this address is an off-heap (resp. heap) address, the result is undefined and an exception is thrown. - * Otherwise, the result is a byte offset {@code SO}. If this address falls within the - * spatial bounds of the given segment, then {@code 0 <= SO < segment.byteSize()}; otherwise, {@code SO < 0 || SO > segment.byteSize()}. - * @return the offset of this memory address into the given segment. - * @param segment the segment relative to which this address offset should be computed - * @throws IllegalArgumentException if {@code segment} is not compatible with this address; this can happen, for instance, - * when {@code segment} models an heap memory region, while this address is a {@linkplain #isNative() native} address. + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the byte value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - long segmentOffset(MemorySegment segment); + @CallerSensitive + void set(ValueLayout.OfByte layout, long offset, byte value); /** - Returns a new native memory segment with given size and resource scope (replacing the scope already associated - * with this address), and whose base address is this address. This method can be useful when interacting with custom - * native memory sources (e.g. custom allocators), where an address to some - * underlying memory region is typically obtained from native code (often as a plain {@code long} value). - * The returned segment is not read-only (see {@link MemorySegment#isReadOnly()}), and is associated with the - * provided resource scope. + * Reads a boolean from this address and offset with given layout. *

        - * Clients should ensure that the address and bounds refers to a valid region of memory that is accessible for reading and, - * if appropriate, writing; an attempt to access an invalid memory location from Java code will either return an arbitrary value, - * have no visible effect, or cause an unspecified exception to be thrown. + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a boolean value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + boolean get(ValueLayout.OfBoolean layout, long offset); + + /** + * Writes a boolean to this address instance and offset with given layout. *

        - * This method is equivalent to the following code: - *

        {@code
        -    asSegment(byteSize, null, scope);
        -     * }
        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the boolean value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void set(ValueLayout.OfBoolean layout, long offset, boolean value); + + /** + * Reads a char from this address and offset with given layout. *

        * This method is restricted. * Restricted methods are unsafe, and, if used incorrectly, their use might crash * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on * restricted methods, and use safe and supported functionalities, where possible. * - * @param bytesSize the desired size. - * @param scope the native segment scope. - * @return a new native memory segment with given base address, size and scope. - * @throws IllegalArgumentException if {@code bytesSize <= 0}. - * @throws IllegalStateException if either the scope associated with this address or the provided scope - * have been already closed, or if access occurs from a thread other than the thread owning either - * scopes. - * @throws UnsupportedOperationException if this address is not a {@linkplain #isNative() native} address. + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a char value read from this address. * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ @CallerSensitive - MemorySegment asSegment(long bytesSize, ResourceScope scope); + char get(ValueLayout.OfChar layout, long offset); /** - * Returns a new native memory segment with given size and resource scope (replacing the scope already associated - * with this address), and whose base address is this address. This method can be useful when interacting with custom - * native memory sources (e.g. custom allocators), where an address to some - * underlying memory region is typically obtained from native code (often as a plain {@code long} value). - * The returned segment is associated with the provided resource scope. + * Writes a char to this address instance and offset with given layout. *

        - * Clients should ensure that the address and bounds refers to a valid region of memory that is accessible for reading and, - * if appropriate, writing; an attempt to access an invalid memory location from Java code will either return an arbitrary value, - * have no visible effect, or cause an unspecified exception to be thrown. + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the char value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void set(ValueLayout.OfChar layout, long offset, char value); + + /** + * Reads a short from this address and offset with given layout. *

        - * Calling {@link ResourceScope#close()} on the scope associated with the returned segment will result in calling - * the provided cleanup action (if any). + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a short value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + short get(ValueLayout.OfShort layout, long offset); + + /** + * Writes a short to this address instance and offset with given layout. *

        * This method is restricted. * Restricted methods are unsafe, and, if used incorrectly, their use might crash * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on * restricted methods, and use safe and supported functionalities, where possible. * - * @param bytesSize the desired size. - * @param cleanupAction the cleanup action; can be {@code null}. - * @param scope the native segment scope. - * @return a new native memory segment with given base address, size and scope. - * @throws IllegalArgumentException if {@code bytesSize <= 0}. - * @throws IllegalStateException if either the scope associated with this address or the provided scope - * have been already closed, or if access occurs from a thread other than the thread owning either - * scopes. - * @throws UnsupportedOperationException if this address is not a {@linkplain #isNative() native} address. + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the short value to be written. * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ @CallerSensitive - MemorySegment asSegment(long bytesSize, Runnable cleanupAction, ResourceScope scope); + void set(ValueLayout.OfShort layout, long offset, short value); /** - * Is this an off-heap memory address? - * @return true, if this is an off-heap memory address. + * Reads an int from this address and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return an int value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - boolean isNative(); + @CallerSensitive + int get(ValueLayout.OfInt layout, long offset); /** - * Returns the raw long value associated with this native memory address. - * @return The raw long value associated with this native memory address. - * @throws UnsupportedOperationException if this memory address is not a {@linkplain #isNative() native} address. - * @throws IllegalStateException if the scope associated with this segment has been already closed, - * or if access occurs from a thread other than the thread owning either segment. + * Writes an int to this address instance and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the int value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - long toRawLongValue(); + @CallerSensitive + void set(ValueLayout.OfInt layout, long offset, int value); /** - * Compares the specified object with this address for equality. Returns {@code true} if and only if the specified - * object is also an address, and it refers to the same memory location as this address. + * Reads a float from this address and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. * - * @apiNote two addresses might be considered equal despite their associated resource scopes differ. This - * can happen, for instance, if the same memory address is used to create memory segments with different - * scopes (using {@link #asSegment(long, ResourceScope)}), and the base address of the resulting segments is - * then compared. + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a float value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + float get(ValueLayout.OfFloat layout, long offset); + + /** + * Writes a float to this address instance and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. * - * @param that the object to be compared for equality with this address. - * @return {@code true} if the specified object is equal to this address. + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the float value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - @Override - boolean equals(Object that); + @CallerSensitive + void set(ValueLayout.OfFloat layout, long offset, float value); /** - * Returns the hash code value for this address. - * @return the hash code value for this address. + * Reads a long from this address and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a long value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - @Override - int hashCode(); + @CallerSensitive + long get(ValueLayout.OfLong layout, long offset); /** - * The native memory address instance modelling the {@code NULL} address, associated - * with the {@linkplain ResourceScope#globalScope() global} resource scope. + * Writes a long to this address instance and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the long value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - MemoryAddress NULL = new MemoryAddressImpl(null, 0L); + @CallerSensitive + void set(ValueLayout.OfLong layout, long offset, long value); /** - * Obtain a native memory address instance from given long address. The returned address is associated - * with the {@linkplain ResourceScope#globalScope() global} resource scope. - * @param value the long address. - * @return the new memory address instance. + * Reads a double from this address and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return a double value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. */ - static MemoryAddress ofLong(long value) { - return value == 0 ? - NULL : - new MemoryAddressImpl(null, value); - } + @CallerSensitive + double get(ValueLayout.OfDouble layout, long offset); + + /** + * Writes a double to this address instance and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the double value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void set(ValueLayout.OfDouble layout, long offset, double value); + + /** + * Reads an address from this address and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + offset}. + * @return an address value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + MemoryAddress get(ValueLayout.OfAddress layout, long offset); + + /** + * Writes an address to this address instance and offset with given layout. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + offset}. + * @param value the address value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void set(ValueLayout.OfAddress layout, long offset, Addressable value); + + /** + * Reads a char from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return a char value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + char getAtIndex(ValueLayout.OfChar layout, long index); + + /** + * Writes a char to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the char value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfChar layout, long index, char value); + + /** + * Reads a short from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return a short value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + short getAtIndex(ValueLayout.OfShort layout, long index); + + /** + * Writes a short to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the short value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfShort layout, long index, short value); + + /** + * Reads an int from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return an int value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + int getAtIndex(ValueLayout.OfInt layout, long index); + + /** + * Writes an int to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the int value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfInt layout, long index, int value); + + /** + * Reads a float from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return a float value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + float getAtIndex(ValueLayout.OfFloat layout, long index); + + /** + * Writes a float to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the float value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfFloat layout, long index, float value); + + /** + * Reads a long from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return a long value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + long getAtIndex(ValueLayout.OfLong layout, long index); + + /** + * Writes a long to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the long value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfLong layout, long index, long value); + + /** + * Reads a double from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return a double value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + double getAtIndex(ValueLayout.OfDouble layout, long index); + + /** + * Writes a double to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the double value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfDouble layout, long index, double value); + + /** + * Reads an address from this address and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be read. + * @param index index in bytes (relative to this address). The final address of this read operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @return an address value read from this address. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + MemoryAddress getAtIndex(ValueLayout.OfAddress layout, long index); + + /** + * Writes an address to this address instance and index, scaled by given layout size. + *

        + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param layout the layout of the memory region to be written. + * @param index index in bytes (relative to this address). The final address of this write operation can be expressed as {@code toRowLongValue() + (index * layout.byteSize())}. + * @param value the address value to be written. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + void setAtIndex(ValueLayout.OfAddress layout, long index, Addressable value); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java index 31dbc4e9ce5..f4489ecd601 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java @@ -27,24 +27,21 @@ package jdk.incubator.foreign; import jdk.internal.access.JavaLangInvokeAccess; import jdk.internal.access.SharedSecrets; -import jdk.internal.foreign.Utils; import sun.invoke.util.Wrapper; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; import java.util.List; import java.util.Objects; /** * This class defines several factory methods for constructing and combining memory access var handles. - * To obtain a memory access var handle, clients must start from one of the leaf methods - * (see {@link MemoryHandles#varHandle(Class, ByteOrder)}, - * {@link MemoryHandles#varHandle(Class, long, ByteOrder)}). This determines the variable type - * (all primitive types but {@code void} and {@code boolean} are supported), as well as the alignment constraint and the - * byte order associated with a memory access var handle. The resulting memory access var handle can then be combined in various ways + * Memory access var handles can be obtained using {@link MemoryHandles#varHandle(ValueLayout)}. The provided value layout + * determines the type, as well as the alignment constraint and the byte order associated with the memory access var handle. + *

        + * The resulting memory access var handle can then be combined in various ways * to emulate different addressing modes. The var handles created by this class feature a mandatory coordinate type * (of type {@link MemorySegment}), and one {@code long} coordinate type, which represents the offset, in bytes, relative * to the segment, at which dereference should occur. @@ -53,12 +50,12 @@ import java.util.Objects; *

        {@code
         GroupLayout seq = MemoryLayout.structLayout(
                 MemoryLayout.paddingLayout(32),
        -        MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN).withName("value")
        +        ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN).withName("value")
         );
          * }
        * To access the member layout named {@code value}, we can construct a memory access var handle as follows: *
        {@code
        -VarHandle handle = MemoryHandles.varHandle(int.class, ByteOrder.BIG_ENDIAN); //(MemorySegment, long) -> int
        +VarHandle handle = MemoryHandles.varHandle(ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)); //(MemorySegment, long) -> int
         handle = MemoryHandles.insertCoordinates(handle, 1, 4); //(MemorySegment) -> int
          * }
        * @@ -77,21 +74,21 @@ handle = MemoryHandles.insertCoordinates(handle, 1, 4); //(MemorySegment) -> int * access modes {@code get} and {@code set} for {@code long} and * {@code double} on 32-bit platforms. *
      • atomic update access modes for {@code int}, {@code long}, - * {@code float} or {@code double}. + * {@code float}, {@code double} or {@link MemoryAddress}. * (Future major platform releases of the JDK may support additional * types for certain currently unsupported access modes.) - *
      • numeric atomic update access modes for {@code int} and {@code long}. + *
      • numeric atomic update access modes for {@code int}, {@code long} and {@link MemoryAddress}. * (Future major platform releases of the JDK may support additional * numeric types for certain currently unsupported access modes.) - *
      • bitwise atomic update access modes for {@code int} and {@code long}. + *
      • bitwise atomic update access modes for {@code int}, {@code long} and {@link MemoryAddress}. * (Future major platform releases of the JDK may support additional * numeric types for certain currently unsupported access modes.) *
      * - * If {@code T} is {@code float} or {@code double} then atomic + * If {@code T} is {@code float}, {@code double} or {@link MemoryAddress} then atomic * update access modes compare values using their bitwise representation - * (see {@link Float#floatToRawIntBits} and - * {@link Double#doubleToRawLongBits}, respectively). + * (see {@link Float#floatToRawIntBits}, + * {@link Double#doubleToRawLongBits} and {@link MemoryAddress#toRawLongValue()}, respectively). *

      * Alternatively, a memory access operation is partially aligned if it occurs at a memory address {@code A} * which is only compatible with the alignment constraint {@code B}; in such cases, access for anything other than the @@ -109,8 +106,6 @@ public final class MemoryHandles { //sorry, just the one! } - private static final MethodHandle LONG_TO_ADDRESS; - private static final MethodHandle ADDRESS_TO_LONG; private static final MethodHandle INT_TO_BYTE; private static final MethodHandle BYTE_TO_UNSIGNED_INT; private static final MethodHandle INT_TO_SHORT; @@ -124,10 +119,6 @@ public final class MemoryHandles { static { try { - LONG_TO_ADDRESS = MethodHandles.lookup().findStatic(MemoryHandles.class, "longToAddress", - MethodType.methodType(MemoryAddress.class, long.class)); - ADDRESS_TO_LONG = MethodHandles.lookup().findStatic(MemoryHandles.class, "addressToLong", - MethodType.methodType(long.class, MemoryAddress.class)); INT_TO_BYTE = MethodHandles.explicitCastArguments(MethodHandles.identity(byte.class), MethodType.methodType(byte.class, int.class)); BYTE_TO_UNSIGNED_INT = MethodHandles.lookup().findStatic(Byte.class, "toUnsignedInt", @@ -154,34 +145,10 @@ public final class MemoryHandles { } /** - * Creates a memory access var handle with the given carrier type and byte order. - * - * The returned var handle's type is {@code carrier} and the list of coordinate types is - * {@code (MemorySegment, long)}, where the {@code long} coordinate type corresponds to byte offset into - * a given memory segment. The returned var handle accesses bytes at an offset in a given - * memory segment, composing bytes to or from a value of the type {@code carrier} according to the given endianness; - * the alignment constraint (in bytes) for the resulting memory access var handle is the same as the size (in bytes) of the - * carrier type {@code carrier}. - * - * @apiNote the resulting var handle features certain access mode restrictions, - * which are common to all memory access var handles. - * - * @param carrier the carrier type. Valid carriers are {@code byte}, {@code short}, {@code char}, {@code int}, - * {@code float}, {@code long}, and {@code double}. - * @param byteOrder the required byte order. - * @return the new memory access var handle. - * @throws IllegalArgumentException when an illegal carrier type is used - */ - public static VarHandle varHandle(Class carrier, ByteOrder byteOrder) { - Objects.requireNonNull(carrier); - Objects.requireNonNull(byteOrder); - return varHandle(carrier, - carrierSize(carrier), - byteOrder); - } - - /** - * Creates a memory access var handle with the given carrier type, alignment constraint, and byte order. + * Creates a memory access var handle from given value layout. The provided layout will specify the + * {@linkplain ValueLayout#carrier() carrier type}, the {@linkplain ValueLayout#byteSize() the byte size}, + * the {@linkplain ValueLayout#byteAlignment() byte alignment} and the {@linkplain ValueLayout#order() byte order} + * associated to the returned var handle. * * The returned var handle's type is {@code carrier} and the list of coordinate types is * {@code (MemorySegment, long)}, where the {@code long} coordinate type corresponds to byte offset into @@ -192,56 +159,13 @@ public final class MemoryHandles { * @apiNote the resulting var handle features certain access mode restrictions, * which are common to all memory access var handles. * - * @param carrier the carrier type. Valid carriers are {@code byte}, {@code short}, {@code char}, {@code int}, - * {@code float}, {@code long}, and {@code double}. - * @param alignmentBytes the alignment constraint (in bytes). Must be a power of two. - * @param byteOrder the required byte order. + * @param layout the value layout for which a memory access handle is to be obtained. * @return the new memory access var handle. * @throws IllegalArgumentException if an illegal carrier type is used, or if {@code alignmentBytes} is not a power of two. */ - public static VarHandle varHandle(Class carrier, long alignmentBytes, ByteOrder byteOrder) { - Objects.requireNonNull(carrier); - Objects.requireNonNull(byteOrder); - checkCarrier(carrier); - - if (alignmentBytes <= 0 - || (alignmentBytes & (alignmentBytes - 1)) != 0) { // is power of 2? - throw new IllegalArgumentException("Bad alignment: " + alignmentBytes); - } - - return Utils.fixUpVarHandle(JLI.memoryAccessVarHandle(carrier, false, alignmentBytes - 1, byteOrder)); - } - - /** - * Adapt an existing var handle into a new var handle whose carrier type is {@link MemorySegment}. - * That is, when calling {@link VarHandle#get(Object...)} on the returned var handle, - * the read numeric value will be turned into a memory address (as if by calling {@link MemoryAddress#ofLong(long)}); - * similarly, when calling {@link VarHandle#set(Object...)}, the memory address to be set will be converted - * into a numeric value, and then written into memory. The amount of bytes read (resp. written) from (resp. to) - * memory depends on the carrier of the original memory access var handle. - * - * @param target the memory access var handle to be adapted - * @return the adapted var handle. - * @throws IllegalArgumentException if the carrier type of {@code varHandle} is either {@code boolean}, - * {@code float}, or {@code double}, or is not a primitive type. - */ - public static VarHandle asAddressVarHandle(VarHandle target) { - Objects.requireNonNull(target); - Class carrier = target.varType(); - if (!carrier.isPrimitive() || carrier == boolean.class || - carrier == float.class || carrier == double.class) { - throw new IllegalArgumentException("Unsupported carrier type: " + carrier.getName()); - } - - if (carrier != long.class) { - // slow-path, we need to adapt - return filterValue(target, - MethodHandles.explicitCastArguments(ADDRESS_TO_LONG, MethodType.methodType(carrier, MemoryAddress.class)), - MethodHandles.explicitCastArguments(LONG_TO_ADDRESS, MethodType.methodType(MemoryAddress.class, carrier))); - } else { - // fast-path - return filterValue(target, ADDRESS_TO_LONG, LONG_TO_ADDRESS); - } + public static VarHandle varHandle(ValueLayout layout) { + Objects.requireNonNull(layout); + return layout.accessHandle(); } /** @@ -255,7 +179,7 @@ public final class MemoryHandles { * the case if modeled as a Java {@code short}. This is illustrated in the following example: *

      {@code
           MemorySegment segment = MemorySegment.allocateNative(2, ResourceScope.newImplicitScope());
      -    VarHandle SHORT_VH = MemoryLayouts.JAVA_SHORT.varHandle(short.class);
      +    VarHandle SHORT_VH = ValueLayout.JAVA_SHORT.varHandle();
           VarHandle INT_VH = MemoryHandles.asUnsigned(SHORT_VH, int.class);
           SHORT_VH.set(segment, (short)-1);
           INT_VH.get(segment); // returns 65535
      @@ -276,7 +200,7 @@ public final class MemoryHandles {
            * 

      * The returned var handle will feature the variable type {@code adaptedType}, * and the same access coordinates, the same access modes (see {@link - * java.lang.invoke.VarHandle.AccessMode}, and the same atomic access + * java.lang.invoke.VarHandle.AccessMode}), and the same atomic access * guarantees, as those featured by the {@code target} var handle. * * @param target the memory access var handle to be adapted @@ -284,7 +208,7 @@ public final class MemoryHandles { * @return the adapted var handle. * @throws IllegalArgumentException if the carrier type of {@code target} * is not one of {@code byte}, {@code short}, or {@code int}; if {@code - * adaptedType} is not one of {@code int}, or {@code long}; if the bitwidth + * adaptedType} is not one of {@code int}, or {@code long}; if the bit width * of the {@code adaptedType} is not greater than that of the {@code target} * carrier type. * @@ -324,12 +248,15 @@ public final class MemoryHandles { * is processed using the second filter and returned to the caller. More advanced access mode types, such as * {@link java.lang.invoke.VarHandle.AccessMode#COMPARE_AND_EXCHANGE} might apply both filters at the same time. *

      - * For the boxing and unboxing filters to be well formed, their types must be of the form {@code (A... , S) -> T} and + * For the boxing and unboxing filters to be well-formed, their types must be of the form {@code (A... , S) -> T} and * {@code (A... , T) -> S}, respectively, where {@code T} is the type of the target var handle. If this is the case, * the resulting var handle will have type {@code S} and will feature the additional coordinates {@code A...} (which * will be appended to the coordinates of the target var handle). *

      - * The resulting var handle will feature the same access modes (see {@link java.lang.invoke.VarHandle.AccessMode} and + * If the boxing and unboxing filters throw any checked exceptions when invoked, the resulting var handle will + * throw an {@link IllegalStateException}. + *

      + * The resulting var handle will feature the same access modes (see {@link java.lang.invoke.VarHandle.AccessMode}) and * atomic access guarantees as those featured by the target var handle. * * @param target the target var handle @@ -338,7 +265,7 @@ public final class MemoryHandles { * @return an adapter var handle which accepts a new type, performing the provided boxing/unboxing conversions. * @throws IllegalArgumentException if {@code filterFromTarget} and {@code filterToTarget} are not well-formed, that is, they have types * other than {@code (A... , S) -> T} and {@code (A... , T) -> S}, respectively, where {@code T} is the type of the target var handle, - * or if either {@code filterFromTarget} or {@code filterToTarget} throws any checked exceptions. + * or if it's determined that either {@code filterFromTarget} or {@code filterToTarget} throws any checked exceptions. */ public static VarHandle filterValue(VarHandle target, MethodHandle filterToTarget, MethodHandle filterFromTarget) { return JLI.filterValue(target, filterToTarget, filterFromTarget); @@ -353,9 +280,12 @@ public final class MemoryHandles { * parameter types of the unary filter functions), and then passed (along with any coordinate that was left unaltered * by the adaptation) to the target var handle. *

      - * For the coordinate filters to be well formed, their types must be of the form {@code S1 -> T1, S2 -> T1 ... Sn -> Tn}, + * For the coordinate filters to be well-formed, their types must be of the form {@code S1 -> T1, S2 -> T1 ... Sn -> Tn}, * where {@code T1, T2 ... Tn} are the coordinate types starting at position {@code pos} of the target var handle. *

      + * If any of the filters throws a checked exception when invoked, the resulting var handle will + * throw an {@link IllegalStateException}. + *

      * The resulting var handle will feature the same access modes (see {@link java.lang.invoke.VarHandle.AccessMode}) and * atomic access guarantees as those featured by the target var handle. * @@ -368,7 +298,7 @@ public final class MemoryHandles { * other than {@code S1 -> T1, S2 -> T2, ... Sn -> Tn} where {@code T1, T2 ... Tn} are the coordinate types starting * at position {@code pos} of the target var handle, if {@code pos} is not between 0 and the target var handle coordinate arity, inclusive, * or if more filters are provided than the actual number of coordinate types available starting at {@code pos}, - * or if any of the filters throws any checked exceptions. + * or if it's determined that any of the filters throws any checked exceptions. */ public static VarHandle filterCoordinates(VarHandle target, int pos, MethodHandle... filters) { return JLI.filterCoordinates(target, pos, filters); @@ -382,7 +312,7 @@ public final class MemoryHandles { * When calling e.g. {@link VarHandle#get(Object...)} on the resulting var handle, incoming coordinate values * are joined with bound coordinate values, and then passed to the target var handle. *

      - * For the bound coordinates to be well formed, their types must be {@code T1, T2 ... Tn }, + * For the bound coordinates to be well-formed, their types must be {@code T1, T2 ... Tn }, * where {@code T1, T2 ... Tn} are the coordinate types starting at position {@code pos} of the target var handle. *

      * The resulting var handle will feature the same access modes (see {@link java.lang.invoke.VarHandle.AccessMode}) and @@ -409,7 +339,7 @@ public final class MemoryHandles { *

      * The given array controls the reordering. * Call {@code #I} the number of incoming coordinates (the value - * {@code newCoordinates.size()}, and call {@code #O} the number + * {@code newCoordinates.size()}), and call {@code #O} the number * of outgoing coordinates (the number of coordinates associated with the target var handle). * Then the length of the reordering array must be {@code #O}, * and each element must be a non-negative number less than {@code #I}. @@ -444,7 +374,7 @@ public final class MemoryHandles { } /** - * Adapts a target var handle handle by pre-processing + * Adapts a target var handle by pre-processing * a sub-sequence of its coordinate values with a filter (a method handle). * The pre-processed coordinates are replaced by the result (if any) of the * filter function and the target var handle is then called on the modified (usually shortened) @@ -464,6 +394,9 @@ public final class MemoryHandles { * coordinate type of the target var handle at position {@code pos}, and that target var handle * coordinate is supplied by the return value of the filter. *

      + * If any of the filters throws a checked exception when invoked, the resulting var handle will + * throw an {@link IllegalStateException}. + *

      * The resulting var handle will feature the same access modes (see {@link java.lang.invoke.VarHandle.AccessMode}) and * atomic access guarantees as those featured by the target var handle. * @@ -476,7 +409,7 @@ public final class MemoryHandles { * is void, or it is not the same as the {@code pos} coordinate of the target var handle, * if {@code pos} is not between 0 and the target var handle coordinate arity, inclusive, * if the resulting var handle's type would have too many coordinates, - * or if {@code filter} throws any checked exceptions. + * or if it's determined that {@code filter} throws any checked exceptions. */ public static VarHandle collectCoordinates(VarHandle target, int pos, MethodHandle filter) { return JLI.collectCoordinates(target, pos, filter); @@ -505,24 +438,6 @@ public final class MemoryHandles { return JLI.dropCoordinates(target, pos, valueTypes); } - private static void checkAddressFirstCoordinate(VarHandle handle) { - if (handle.coordinateTypes().size() < 1 || - handle.coordinateTypes().get(0) != MemorySegment.class) { - throw new IllegalArgumentException("Expected var handle with leading coordinate of type MemorySegment"); - } - } - - private static void checkCarrier(Class carrier) { - if (!carrier.isPrimitive() || carrier == void.class || carrier == boolean.class) { - throw new IllegalArgumentException("Illegal carrier: " + carrier.getSimpleName()); - } - } - - private static long carrierSize(Class carrier) { - long bitsAlignment = Math.max(8, Wrapper.forPrimitiveType(carrier).bitWidth()); - return Utils.bitsToBytesOrThrow(bitsAlignment, IllegalStateException::new); - } - private static void checkWidenable(Class carrier) { if (!(carrier == byte.class || carrier == short.class || carrier == int.class)) { throw new IllegalArgumentException("illegal carrier:" + carrier.getSimpleName()); @@ -541,12 +456,4 @@ public final class MemoryHandles { target.getSimpleName() + " is not wider than: " + carrier.getSimpleName()); } } - - private static MemoryAddress longToAddress(long value) { - return MemoryAddress.ofLong(value); - } - - private static long addressToLong(MemoryAddress value) { - return value.toRawLongValue(); - } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java index 44793be750f..8319f22c2ab 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java @@ -46,11 +46,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; /** - * A memory layout can be used to describe the contents of a memory segment in a language neutral fashion. + * A memory layout can be used to describe the contents of a memory segment. * There are two leaves in the layout hierarchy, value layouts, which are used to represent values of given size and kind (see * {@link ValueLayout}) and padding layouts which are used, as the name suggests, to represent a portion of a memory * segment whose contents should be ignored, and which are primarily present for alignment reasons (see {@link MemoryLayout#paddingLayout(long)}). - * Some common value layout constants are defined in the {@link MemoryLayouts} class. + * Some common value layout constants are defined in the {@link ValueLayout} class. *

      * More complex layouts can be derived from simpler ones: a sequence layout denotes a repetition of one or more * element layout (see {@link SequenceLayout}); a group layout denotes an aggregation of (typically) heterogeneous @@ -70,9 +70,9 @@ import java.util.stream.Stream; *

      {@code
       SequenceLayout taggedValues = MemoryLayout.sequenceLayout(5,
           MemoryLayout.structLayout(
      -        MemoryLayout.valueLayout(8, ByteOrder.nativeOrder()).withName("kind"),
      +        ValueLayout.JAVA_BYTE.withName("kind"),
               MemoryLayout.paddingLayout(24),
      -        MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()).withName("value")
      +        ValueLayout.JAVA_INT.withName("value")
           )
       ).withName("TaggedValues");
        * }
      @@ -81,8 +81,6 @@ SequenceLayout taggedValues = MemoryLayout.sequenceLayout(5, * programmers should treat instances that are {@linkplain #equals(Object) equal} as interchangeable and should not * use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, * synchronization may fail. The {@code equals} method should be used for comparisons. - *

      - * Non-platform classes should not implement {@linkplain MemoryLayout} directly. * *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      @@ -122,11 +120,11 @@ SequenceLayout taggedValues = MemoryLayout.sequenceLayout(5, * at a layout nested within the root layout - this is the layout selected by the layout path. * Layout paths are typically expressed as a sequence of one or more {@link PathElement} instances. *

      - * Layout paths are for example useful in order to obtain offsets of arbitrarily nested layouts inside another layout - * (see {@link MemoryLayout#bitOffset(PathElement...)}), to quickly obtain a memory access handle corresponding to the selected - * layout (see {@link MemoryLayout#varHandle(Class, PathElement...)}), to select an arbitrarily nested layout inside - * another layout (see {@link MemoryLayout#select(PathElement...)}, or to transform a nested layout element inside - * another layout (see {@link MemoryLayout#map(UnaryOperator, PathElement...)}). + * Layout paths are for example useful in order to obtain {@linkplain MemoryLayout#bitOffset(PathElement...) offsets} of + * arbitrarily nested layouts inside another layout, to quickly obtain a {@linkplain #varHandle(PathElement...) memory access handle} + * corresponding to the selected layout, to {@linkplain #select(PathElement...) select} an arbitrarily nested layout inside + * another layout, or to {@link #map(UnaryOperator, PathElement...) transform} a nested layout element inside + * another layout. *

      * Such layout paths can be constructed programmatically using the methods in this class. * For instance, given the {@code taggedValues} layout instance constructed as above, we can obtain the offset, @@ -152,7 +150,7 @@ MemoryLayout taggedValuesWithHole = taggedValues.map(l -> MemoryLayout.paddingLa *

      {@code
       MemoryLayout taggedValuesWithHole = MemoryLayout.sequenceLayout(5,
           MemoryLayout.structLayout(
      -        MemoryLayout.valueLayout(8, ByteOrder.nativeOrder()).withName("kind"),
      +        ValueLayout.JAVA_BYTE.withName("kind"),
               MemoryLayout.paddingLayout(32),
               MemoryLayout.paddingLayout(32)
       ));
      @@ -164,8 +162,7 @@ MemoryLayout taggedValuesWithHole = MemoryLayout.sequenceLayout(5,
        * This is important when obtaining memory access var handle from layouts, as in the following code:
        *
        * 
      {@code
      -VarHandle valueHandle = taggedValues.varHandle(int.class,
      -                                               PathElement.sequenceElement(),
      +VarHandle valueHandle = taggedValues.varHandle(PathElement.sequenceElement(),
                                                      PathElement.groupElement("value"));
        * }
      * @@ -189,9 +186,7 @@ long offset2 = (long) offsetHandle.invokeExact(2L); // 16 * *

      Layout attributes

      * - * Layouts can be optionally associated with one or more attributes. A layout attribute forms a name/value - * pair, where the name is a {@link String} and the value is a {@link Constable}. The most common form of layout attribute - * is the layout name (see {@link #LAYOUT_NAME}), a custom name that can be associated with memory layouts and that can be referred to when + * Layouts can be optionally associated with a name. A layout name can be referred to when * constructing layout paths. * * @implSpec @@ -236,18 +231,10 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * @throws UnsupportedOperationException if the layout is, or contains, a sequence layout with unspecified size (see {@link SequenceLayout}), * or if {@code bitSize()} is not a multiple of 8. */ - default long byteSize() { - return Utils.bitsToBytesOrThrow(bitSize(), - () -> new UnsupportedOperationException("Cannot compute byte size; bit size is not a multiple of 8")); - } + long byteSize(); /** * Return the name (if any) associated with this layout. - *

      - * This is equivalent to the following code: - *

      {@code
      -    attribute(LAYOUT_NAME).map(String.class::cast);
      -     * }
      * * @return the layout name (if any). * @see MemoryLayout#withName(String) @@ -256,11 +243,6 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S /** * Creates a new layout which features the desired layout name. - *

      - * This is equivalent to the following code: - *

      {@code
      -    withAttribute(LAYOUT_NAME, name);
      -     * }
      * * @param name the layout name. * @return a new layout which is the same as this layout, except for the name associated with it. @@ -313,36 +295,10 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * * @param bitAlignment the layout alignment constraint, expressed in bits. * @return a new layout which is the same as this layout, except for the alignment constraint associated with it. - * @throws IllegalArgumentException if {@code bitAlignment} is not a power of two, or if it's less than than 8. + * @throws IllegalArgumentException if {@code bitAlignment} is not a power of two, or if it's less than 8. */ MemoryLayout withBitAlignment(long bitAlignment); - /** - * Returns the attribute with the given name (if it exists). - * - * @param name the attribute name - * @return the attribute with the given name (if it exists). - */ - Optional attribute(String name); - - /** - * Returns a new memory layout which features the same attributes as this layout, plus the newly specified attribute. - * If this layout already contains an attribute with the same name, the existing attribute value is overwritten in the returned - * layout. - * - * @param name the attribute name. - * @param value the attribute value. - * @return a new memory layout which features the same attributes as this layout, plus the newly specified attribute. - */ - MemoryLayout withAttribute(String name, Constable value); - - /** - * Returns a stream of the attribute names associated with this layout. - * - * @return a stream of the attribute names associated with this layout. - */ - Stream attributes(); - /** * Computes the offset, in bits, of the layout selected by a given layout path, where the path is considered rooted in this * layout. @@ -366,7 +322,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * by a given layout path, where the path is considered rooted in this layout. * *

      The returned method handle has a return type of {@code long}, and features as many {@code long} - * parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}, + * parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}), * where the order of the parameters corresponds to the order of the path elements. * The returned method handle can be used to compute a layout offset similar to {@link #bitOffset(PathElement...)}, * but where some sequence indices are specified only when invoking the method handle. @@ -417,7 +373,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * by a given layout path, where the path is considered rooted in this layout. * *

      The returned method handle has a return type of {@code long}, and features as many {@code long} - * parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}, + * parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}), * where the order of the parameters corresponds to the order of the path elements. * The returned method handle can be used to compute a layout offset similar to {@link #byteOffset(PathElement...)}, * but where some sequence indices are specified only when invoking the method handle. @@ -477,18 +433,14 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * unspecified sequence access component contained in this layout path. Moreover, the resulting var handle * features certain access mode restrictions, which are common to all memory access var handles. * - * @param carrier the var handle carrier type. * @param elements the layout path elements. * @return a var handle which can be used to dereference memory at the (possibly nested) layout selected by the layout path in {@code elements}. * @throws UnsupportedOperationException if the layout path has one or more elements with incompatible alignment constraints, * or if one of the layouts traversed by the layout path has unspecified size. - * @throws IllegalArgumentException if the carrier does not represent a primitive type, if the carrier is {@code void}, - * {@code boolean}, or if the layout path in {@code elements} does not select a value layout (see {@link ValueLayout}), - * or if the selected value layout has a size that that does not match that of the specified carrier type. + * @throws IllegalArgumentException if the layout path in {@code elements} does not select a value layout (see {@link ValueLayout}). */ - default VarHandle varHandle(Class carrier, PathElement... elements) { - Objects.requireNonNull(carrier); - return computePathOp(LayoutPath.rootPath(this, MemoryLayout::bitSize), path -> path.dereferenceHandle(carrier), + default VarHandle varHandle(PathElement... elements) { + return computePathOp(LayoutPath.rootPath(this, MemoryLayout::bitSize), LayoutPath::dereferenceHandle, Set.of(), elements); } @@ -498,7 +450,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * *

      The returned method handle has a return type of {@code MemorySegment}, features a {@code MemorySegment} * parameter as leading parameter representing the segment to be sliced, and features as many trailing {@code long} - * parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}, + * parameter types as there are free dimensions in the provided layout path (see {@link PathElement#sequenceElement()}), * where the order of the parameters corresponds to the order of the path elements. * The returned method handle can be used to create a slice similar to using {@link MemorySegment#asSlice(long, long)}, * but where the offset argument is dynamically compute based on indices specified when invoking the method handle. @@ -515,7 +467,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * and {@code s_0}, {@code s_1}, ... {@code s_n} are static stride constants which are derived from * the layout path. * - *

      After the offset is computed, the returned segment is create as if by calling: + *

      After the offset is computed, the returned segment is created as if by calling: *

      {@code
           segment.asSlice(offset, layout.byteSize());
            * }
      @@ -582,7 +534,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S } /** - * Is this a padding layout (e.g. a layout created from {@link #paddingLayout(long)}) ? + * Is this a {@linkplain #paddingLayout(long) padding layout} ? * @return true, if this layout is a padding layout. */ boolean isPadding(); @@ -595,8 +547,6 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * of sequence element layout can be explicit (see {@link PathElement#sequenceElement(long)}) or * implicit (see {@link PathElement#sequenceElement()}). When a path uses one or more implicit * sequence path elements, it acquires additional free dimensions. - *

      - * Non-platform classes should not implement {@linkplain PathElement} directly. * *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      @@ -612,7 +562,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * that is combined with such element. * * @implSpec in case multiple group elements with a matching name exist, the path element returned by this - * method will select the first one; that is, the group element with lowest offset from current path is selected. + * method will select the first one; that is, the group element with the lowest offset from current path is selected. * * @param name the name of the group element to be selected. * @return a path element which selects the group element with given name. @@ -728,17 +678,48 @@ E * (S + I * F) } /** - * Create a value layout of given byte order and size. - * - * @param size the value layout size. + * Creates a value layout of given Java carrier and byte order. The type of resulting value layout is determined + * by the carrier provided: + *
        + *
      • {@link ValueLayout.OfBoolean}, for {@code boolean.class}
      • + *
      • {@link ValueLayout.OfByte}, for {@code byte.class}
      • + *
      • {@link ValueLayout.OfShort}, for {@code short.class}
      • + *
      • {@link ValueLayout.OfChar}, for {@code char.class}
      • + *
      • {@link ValueLayout.OfInt}, for {@code int.class}
      • + *
      • {@link ValueLayout.OfFloat}, for {@code float.class}
      • + *
      • {@link ValueLayout.OfLong}, for {@code long.class}
      • + *
      • {@link ValueLayout.OfDouble}, for {@code double.class}
      • + *
      • {@link ValueLayout.OfAddress}, for {@code MemoryAddress.class}
      • + *
      + * @param carrier the value layout carrier. * @param order the value layout's byte order. * @return a new value layout. - * @throws IllegalArgumentException if {@code size <= 0}. + * @throws IllegalArgumentException if the carrier type is not supported. */ - static ValueLayout valueLayout(long size, ByteOrder order) { + static ValueLayout valueLayout(Class carrier, ByteOrder order) { + Objects.requireNonNull(carrier); Objects.requireNonNull(order); - AbstractLayout.checkSize(size); - return new ValueLayout(order, size); + if (carrier == boolean.class) { + return new ValueLayout.OfBoolean(order); + } else if (carrier == char.class) { + return new ValueLayout.OfChar(order); + } else if (carrier == byte.class) { + return new ValueLayout.OfByte(order); + } else if (carrier == short.class) { + return new ValueLayout.OfShort(order); + } else if (carrier == int.class) { + return new ValueLayout.OfInt(order); + } else if (carrier == float.class) { + return new ValueLayout.OfFloat(order); + } else if (carrier == long.class) { + return new ValueLayout.OfLong(order); + } else if (carrier == double.class) { + return new ValueLayout.OfDouble(order); + } else if (carrier == MemoryAddress.class) { + return new ValueLayout.OfAddress(order); + } else { + throw new IllegalArgumentException("Unsupported carrier: " + carrier.getName()); + } } /** @@ -792,9 +773,4 @@ E * (S + I * F) .map(Objects::requireNonNull) .collect(Collectors.toList())); } - - /** - * Attribute name used to specify the name property of a memory layout (see {@link #name()} and {@link #withName(String)}). - */ - String LAYOUT_NAME = "layout/name"; } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayouts.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayouts.java deleted file mode 100644 index 4aee085821f..00000000000 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayouts.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2019, 2020, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.incubator.foreign; - -import jdk.internal.misc.Unsafe; - -import java.nio.ByteOrder; - -/** - * This class defines useful layout constants. Some of the constants defined in this class are explicit in both - * size and byte order (see {@link #BITS_64_BE}), and can therefore be used to explicitly and unambiguously specify the - * contents of a memory segment. Other constants make implicit byte order assumptions (see - * {@link #JAVA_INT}); as such, these constants make it easy to work with other serialization-centric APIs, - * such as {@link java.nio.ByteBuffer}. - */ -public final class MemoryLayouts { - - private MemoryLayouts() { - //just the one, please - } - - /** - * A value layout constant with size of one byte, and byte order set to {@link ByteOrder#LITTLE_ENDIAN}. - */ - public static final ValueLayout BITS_8_LE = MemoryLayout.valueLayout(8, ByteOrder.LITTLE_ENDIAN); - - /** - * A value layout constant with size of two bytes, and byte order set to {@link ByteOrder#LITTLE_ENDIAN}. - */ - public static final ValueLayout BITS_16_LE = MemoryLayout.valueLayout(16, ByteOrder.LITTLE_ENDIAN); - - /** - * A value layout constant with size of four bytes, and byte order set to {@link ByteOrder#LITTLE_ENDIAN}. - */ - public static final ValueLayout BITS_32_LE = MemoryLayout.valueLayout(32, ByteOrder.LITTLE_ENDIAN); - - /** - * A value layout constant with size of eight bytes, and byte order set to {@link ByteOrder#LITTLE_ENDIAN}. - */ - public static final ValueLayout BITS_64_LE = MemoryLayout.valueLayout(64, ByteOrder.LITTLE_ENDIAN); - - /** - * A value layout constant with size of one byte, and byte order set to {@link ByteOrder#BIG_ENDIAN}. - */ - public static final ValueLayout BITS_8_BE = MemoryLayout.valueLayout(8, ByteOrder.BIG_ENDIAN); - - /** - * A value layout constant with size of two bytes, and byte order set to {@link ByteOrder#BIG_ENDIAN}. - */ - public static final ValueLayout BITS_16_BE = MemoryLayout.valueLayout(16, ByteOrder.BIG_ENDIAN); - - /** - * A value layout constant with size of four bytes, and byte order set to {@link ByteOrder#BIG_ENDIAN}. - */ - public static final ValueLayout BITS_32_BE = MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN); - - /** - * A value layout constant with size of eight bytes, and byte order set to {@link ByteOrder#BIG_ENDIAN}. - */ - public static final ValueLayout BITS_64_BE = MemoryLayout.valueLayout(64, ByteOrder.BIG_ENDIAN); - - /** - * A padding layout constant with size of one byte. - */ - public static final MemoryLayout PAD_8 = MemoryLayout.paddingLayout(8); - - /** - * A padding layout constant with size of two bytes. - */ - public static final MemoryLayout PAD_16 = MemoryLayout.paddingLayout(16); - - /** - * A padding layout constant with size of four bytes. - */ - public static final MemoryLayout PAD_32 = MemoryLayout.paddingLayout(32); - - /** - * A padding layout constant with size of eight bytes. - */ - public static final MemoryLayout PAD_64 = MemoryLayout.paddingLayout(64); - - /** - * A value layout constant whose size is the same as that of a machine address (e.g. {@code size_t}), and byte order set to {@link ByteOrder#nativeOrder()}. - */ - public static final ValueLayout ADDRESS = MemoryLayout.valueLayout(Unsafe.ADDRESS_SIZE * 8, ByteOrder.nativeOrder()); - - /** - * A value layout constant whose size is the same as that of a Java {@code byte}, and byte order set to {@link ByteOrder#nativeOrder()}. - */ - public static final ValueLayout JAVA_BYTE = MemoryLayout.valueLayout(8, ByteOrder.nativeOrder()); - - /** - * A value layout constant whose size is the same as that of a Java {@code char}, and byte order set to {@link ByteOrder#nativeOrder()}. - */ - public static final ValueLayout JAVA_CHAR = MemoryLayout.valueLayout(16, ByteOrder.nativeOrder()); - - /** - * A value layout constant whose size is the same as that of a Java {@code short}, and byte order set to {@link ByteOrder#nativeOrder()}. - */ - public static final ValueLayout JAVA_SHORT = MemoryLayout.valueLayout(16, ByteOrder.nativeOrder()); - - /** - * A value layout constant whose size is the same as that of a Java {@code int}, and byte order set to {@link ByteOrder#nativeOrder()}. - */ - public static final ValueLayout JAVA_INT = MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()); - - /** - * A value layout constant whose size is the same as that of a Java {@code long}, and byte order set to {@link ByteOrder#nativeOrder()}. - * The alignment of this layout (see {@link MemoryLayout#byteAlignment()} is platform-dependent, so that the following - * invariant holds: - *
      {@code
      -    MemoryLayouts.JAVA_LONG.byteAlignment() == MemoryLayouts.ADDRESS.byteSize();
      -     * }
      - */ - public static final ValueLayout JAVA_LONG = MemoryLayout.valueLayout(64, ByteOrder.nativeOrder()) - .withBitAlignment(ADDRESS.bitSize()); - - /** - * A value layout constant whose size is the same as that of a Java {@code float}, and byte order set to {@link ByteOrder#nativeOrder()}. - */ - public static final ValueLayout JAVA_FLOAT = MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()); - - /** - * A value layout constant whose size is the same as that of a Java {@code double}, and byte order set to {@link ByteOrder#nativeOrder()}. - * The alignment of this layout (see {@link MemoryLayout#byteAlignment()} is platform-dependent, so that the following - * invariant holds: - *
      {@code
      -    MemoryLayouts.JAVA_DOUBLE.byteAlignment() == MemoryLayouts.ADDRESS.byteSize();
      -     * }
      - */ - public static final ValueLayout JAVA_DOUBLE = MemoryLayout.valueLayout(64, ByteOrder.nativeOrder()) - .withBitAlignment(ADDRESS.bitSize()); -} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java index 09874cf6dd7..a2ead463451 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -27,6 +27,7 @@ package jdk.incubator.foreign; import java.io.UncheckedIOException; +import java.lang.reflect.Array; import java.nio.ByteBuffer; import jdk.internal.foreign.AbstractMemorySegmentImpl; @@ -34,11 +35,18 @@ import jdk.internal.foreign.HeapMemorySegmentImpl; import jdk.internal.foreign.MappedMemorySegmentImpl; import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.foreign.NativeMemorySegmentImpl; +import jdk.internal.foreign.Utils; +import jdk.internal.foreign.abi.SharedUtils; +import jdk.internal.misc.ScopedMemoryAccess; +import jdk.internal.misc.Unsafe; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; +import jdk.internal.vm.annotation.ForceInline; import java.io.IOException; +import java.nio.ByteOrder; import java.nio.channels.FileChannel; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.Objects; import java.util.Spliterator; @@ -86,7 +94,7 @@ import java.util.stream.Stream; * called mapped memory segments; mapped memory segments are associated with an underlying file descriptor. *

      * Contents of mapped memory segments can be {@linkplain #force() persisted} and {@linkplain #load() loaded} to and from the underlying file; - * these capabilities are suitable replacements for some of the functionality in the {@link java.nio.MappedByteBuffer} class. + * these capabilities are suitable replacements for some capabilities in the {@link java.nio.MappedByteBuffer} class. * Note that, while it is possible to map a segment into a byte buffer (see {@link MemorySegment#asByteBuffer()}), * and then call e.g. {@link java.nio.MappedByteBuffer#force()} that way, this can only be done when the source segment * is small enough, due to the size limitation inherent to the ByteBuffer API. @@ -94,7 +102,42 @@ import java.util.stream.Stream; * Clients requiring sophisticated, low-level control over mapped memory segments, should consider writing * custom mapped memory segment factories; using {@link CLinker}, e.g. on Linux, it is possible to call {@code mmap} * with the desired parameters; the returned address can be easily wrapped into a memory segment, using - * {@link MemoryAddress#ofLong(long)} and {@link MemoryAddress#asSegment(long, Runnable, ResourceScope)}. + * {@link MemoryAddress#ofLong(long)} and {@link MemorySegment#ofAddress(MemoryAddress, long, ResourceScope)}. + * + *

      Restricted native segments

      + * + * Sometimes it is necessary to turn a memory address obtained from native code into a memory segment with + * full spatial, temporal and confinement bounds. To do this, clients can {@link #ofAddress(MemoryAddress, long, ResourceScope) obtain} + * a native segment unsafely from a give memory address, by providing the segment size, as well as the segment {@linkplain ResourceScope scope}. + * This is a restricted operation and should be used with + * caution: for instance, an incorrect segment size could result in a VM crash when attempting to dereference + * the memory segment. + * + *

      Dereference

      + * + * A memory segment can be read or written using various methods provided in this class (e.g. {@link #get(ValueLayout.OfInt, long)}). + * Each dereference method takes a {@linkplain jdk.incubator.foreign.ValueLayout value layout}, which specifies the size, + * alignment constraints, byte order as well as the Java type associated with the dereference operation, and an offset. + * For instance, to read an int from a segment, using {@link ByteOrder#nativeOrder() default endianness}, the following code can be used: + *
      {@code
      +MemorySegment segment = ...
      +int value = segment.get(ValueLayout.JAVA_INT, 0);
      + * }
      + * + * If the value to be read is stored in memory using {@link ByteOrder#BIG_ENDIAN big-endian} encoding, the dereference operation + * can be expressed as follows: + *
      {@code
      +MemorySegment segment = ...
      +int value = segment.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0);
      + * }
      + * + * For more complex dereference operations (e.g. structured memory access), clients can obtain a memory access var handle, + * that is, a var handle that accepts a segment and, optionally, one or more additional {@code long} coordinates. Memory + * access var handles can be obtained from {@linkplain MemoryLayout#varHandle(MemoryLayout.PathElement...) memory layouts} + * by providing a so called layout path. + * Alternatively, clients can obtain raw memory access var handles from a given + * {@linkplain MemoryHandles#varHandle(ValueLayout) value layout}, and then adapt it using the var handle combinator + * functions defined in the {@link MemoryHandles} class. * *

      Lifecycle and confinement

      * @@ -105,9 +148,9 @@ import java.util.stream.Stream; *
      {@code
       MemorySegment segment = null;
       try (ResourceScope scope = ResourceScope.newConfinedScope()) {
      -    segment = MemorySegment.allocateNative(8, 1, scope);
      +    segment = MemorySegment.allocateNative(8, scope);
       }
      -MemoryAccess.getLong(segment); // already closed!
      +segment.get(ValueLayout.JAVA_LONG, 0); // already closed!
        * }
      * Additionally, access to a memory segment is subject to the thread-confinement checks enforced by the owning scope; that is, * if the segment is associated with a shared scope, it can be accessed by multiple threads; if it is associated with a confined @@ -143,11 +186,10 @@ MemorySegment roSegment = segment.asReadOnly(); * *
      {@code
       try (ResourceScope scope = ResourceScope.newSharedScope()) {
      -    SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_INT);
      +    SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT);
           MemorySegment segment = MemorySegment.allocateNative(SEQUENCE_LAYOUT, scope);
      -    VarHandle VH_int = SEQUENCE_LAYOUT.elementLayout().varHandle(int.class);
      -    int sum = segment.elements(MemoryLayouts.JAVA_INT).parallel()
      -                           .mapToInt(s -> (int)VH_int.get(s.address()))
      +    int sum = segment.elements(ValueLayout.JAVA_INT).parallel()
      +                           .mapToInt(s -> s.get(ValueLayout.JAVA_INT, 0))
                                  .sum();
       }
        * }
      @@ -158,8 +200,10 @@ try (ResourceScope scope = ResourceScope.newSharedScope()) { public sealed interface MemorySegment extends Addressable permits AbstractMemorySegmentImpl { /** - * The base memory address associated with this memory segment. - * The returned memory address is associated with same resource scope as that associated with this segment. + * The base memory address associated with this native memory segment. + * @throws UnsupportedOperationException if this segment is not a {@linkplain #isNative() native} segment. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. * @return The base memory address. */ @Override @@ -217,8 +261,6 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory * and whose new size is specified by the given argument. * * @see #asSlice(long) - * @see #asSlice(MemoryAddress) - * @see #asSlice(MemoryAddress, long) * * @param offset The new segment base offset (relative to the current segment base address), specified in bytes. * @param newSize The new segment size, specified in bytes. @@ -227,28 +269,6 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory */ MemorySegment asSlice(long offset, long newSize); - /** - * Obtains a new memory segment view whose base address is the given address, and whose new size is specified by the given argument. - *

      - * Equivalent to the following code: - *

      {@code
      -    asSlice(newBase.segmentOffset(this), newSize);
      -     * }
      - * - * @see #asSlice(long) - * @see #asSlice(MemoryAddress) - * @see #asSlice(long, long) - * - * @param newBase The new segment base address. - * @param newSize The new segment size, specified in bytes. - * @return a new memory segment view with updated base/limit addresses. - * @throws IndexOutOfBoundsException if {@code offset < 0}, {@code offset > byteSize()}, {@code newSize < 0}, or {@code newSize > byteSize() - offset} - */ - default MemorySegment asSlice(MemoryAddress newBase, long newSize) { - Objects.requireNonNull(newBase); - return asSlice(newBase.segmentOffset(this), newSize); - } - /** * Obtains a new memory segment view whose base address is the same as the base address of this segment plus a given offset, * and whose new size is computed by subtracting the specified offset from this segment size. @@ -258,8 +278,6 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory asSlice(offset, byteSize() - offset); * }
      * - * @see #asSlice(MemoryAddress) - * @see #asSlice(MemoryAddress, long) * @see #asSlice(long, long) * * @param offset The new segment base offset (relative to the current segment base address), specified in bytes. @@ -270,28 +288,6 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory return asSlice(offset, byteSize() - offset); } - /** - * Obtains a new memory segment view whose base address is the given address, and whose new size is computed by subtracting - * the address offset relative to this segment (see {@link MemoryAddress#segmentOffset(MemorySegment)}) from this segment size. - *

      - * Equivalent to the following code: - *

      {@code
      -    asSlice(newBase.segmentOffset(this));
      -     * }
      - * - * @see #asSlice(long) - * @see #asSlice(MemoryAddress, long) - * @see #asSlice(long, long) - * - * @param newBase The new segment base offset (relative to the current segment base address), specified in bytes. - * @return a new memory segment view with updated base/limit addresses. - * @throws IndexOutOfBoundsException if {@code address.segmentOffset(this) < 0}, or {@code address.segmentOffset(this) > byteSize()}. - */ - default MemorySegment asSlice(MemoryAddress newBase) { - Objects.requireNonNull(newBase); - return asSlice(newBase.segmentOffset(this)); - } - /** * Is this segment read-only? * @return {@code true}, if this segment is read-only. @@ -324,6 +320,42 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory */ boolean isMapped(); + /** + * Returns a slice of this segment that is the overlap between this and + * the provided segment. + * + *

      Two segments {@code S1} and {@code S2} are said to overlap if it is possible to find + * at least two slices {@code L1} (from {@code S1}) and {@code L2} (from {@code S2}) that are backed by the + * same memory region. As such, it is not possible for a + * {@link #isNative() native} segment to overlap with a heap segment; in + * this case, or when no overlap occurs, {@code null} is returned. + * + * @param other the segment to test for an overlap with this segment. + * @return a slice of this segment, or {@code null} if no overlap occurs. + */ + MemorySegment asOverlappingSlice(MemorySegment other); + + /** + * Returns the offset, in bytes, of the provided segment, relative to this + * segment. + * + *

      The offset is relative to the base address of this segment and can be + * a negative or positive value. For instance, if both segments are native + * segments, the resulting offset can be computed as follows: + * + *

      {@code
      +     * other.baseAddress().toRawLongValue() - segment.baseAddress().toRawLongValue()
      +     * }
      + * + * If the segments share the same base address, {@code 0} is returned. If + * {@code other} is a slice of this segment, the offset is always + * {@code 0 <= x < this.byteSize()}. + * + * @param other the segment to retrieve an offset to. + * @return the relative offset, in bytes, of the provided segment. + */ + long segmentOffset(MemorySegment other); + /** * Fills a value into this memory segment. *

      @@ -331,7 +363,7 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory * segment. Equivalent to (but likely more efficient than) the following code: * *

      {@code
      -byteHandle = MemoryLayout.ofSequence(MemoryLayouts.JAVA_BYTE)
      +byteHandle = MemoryLayout.ofSequence(ValueLayout.JAVA_BYTE)
                .varHandle(byte.class, MemoryLayout.PathElement.sequenceElement());
       for (long l = 0; l < segment.byteSize(); l++) {
            byteHandle.set(segment.address(), l, value);
      @@ -346,7 +378,7 @@ for (long l = 0; l < segment.byteSize(); l++) {
            * @param value the value to fill into this segment
            * @return this memory segment
            * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from
      -     * a thread other than the thread owning that scope,
      +     * a thread other than the thread owning that scope.
            * @throws UnsupportedOperationException if this segment is read-only (see {@link #isReadOnly()}).
            */
           MemorySegment fill(byte value);
      @@ -355,23 +387,23 @@ for (long l = 0; l < segment.byteSize(); l++) {
            * Performs a bulk copy from given source segment to this segment. More specifically, the bytes at
            * offset {@code 0} through {@code src.byteSize() - 1} in the source segment are copied into this segment
            * at offset {@code 0} through {@code src.byteSize() - 1}.
      -     * If the source segment overlaps with this segment, then the copying is performed as if the bytes at
      -     * offset {@code 0} through {@code src.byteSize() - 1} in the source segment were first copied into a
      -     * temporary segment with size {@code bytes}, and then the contents of the temporary segment were copied into
      -     * this segment at offset {@code 0} through {@code src.byteSize() - 1}.
            * 

      - * The result of a bulk copy is unspecified if, in the uncommon case, the source segment and this segment - * do not overlap, but refer to overlapping regions of the same backing storage using different addresses. - * For example, this may occur if the same file is {@linkplain MemorySegment#mapFile mapped} to two segments. - * + * Calling this method is equivalent to the following code: + *

      {@code
      +    MemorySegment.copy(src, 0, this, 0, src.byteSize);
      +     * }
      * @param src the source segment. * @throws IndexOutOfBoundsException if {@code src.byteSize() > this.byteSize()}. * @throws IllegalStateException if either the scope associated with the source segment or the scope associated * with this segment have been already closed, or if access occurs from a thread other than the thread owning either * scopes. * @throws UnsupportedOperationException if this segment is read-only (see {@link #isReadOnly()}). + * @return this segment. */ - void copyFrom(MemorySegment src); + default MemorySegment copyFrom(MemorySegment src) { + MemorySegment.copy(src, 0, this, 0, src.byteSize()); + return this; + } /** * Finds and returns the offset, in bytes, of the first mismatch between @@ -381,10 +413,10 @@ for (long l = 0; l < segment.byteSize(); l++) { * the smaller memory segment (exclusive). *

      * If the two segments share a common prefix then the returned offset is - * the length of the common prefix and it follows that there is a mismatch + * the length of the common prefix, and it follows that there is a mismatch * between the two segments at that offset within the respective segments. - * If one segment is a proper prefix of the other then the returned offset is - * the smaller of the segment sizes, and it follows that the offset is only + * If one segment is a proper prefix of the other, then the returned offset is + * the smallest of the segment sizes, and it follows that the offset is only * valid for the larger segment. Otherwise, there is no mismatch and {@code * -1} is returned. * @@ -398,11 +430,11 @@ for (long l = 0; l < segment.byteSize(); l++) { long mismatch(MemorySegment other); /** - * Tells whether or not the contents of this mapped segment is resident in physical + * Tells whether the contents of this mapped segment is resident in physical * memory. * *

      A return value of {@code true} implies that it is highly likely - * that all of the data in this segment is resident in physical memory and + * that all the data in this segment is resident in physical memory and * may therefore be accessed without incurring any virtual-memory page * faults or I/O operations. A return value of {@code false} does not * necessarily imply that this segment's content is not resident in physical @@ -481,19 +513,19 @@ for (long l = 0; l < segment.byteSize(); l++) { void force(); /** - * Wraps this segment in a {@link ByteBuffer}. Some of the properties of the returned buffer are linked to + * Wraps this segment in a {@link ByteBuffer}. Some properties of the returned buffer are linked to * the properties of this segment. For instance, if this segment is immutable * (e.g. the segment is a read-only segment, see {@link #isReadOnly()}), then the resulting buffer is read-only - * (see {@link ByteBuffer#isReadOnly()}. Additionally, if this is a native memory segment, the resulting buffer is + * (see {@link ByteBuffer#isReadOnly()}). Additionally, if this is a native memory segment, the resulting buffer is * direct (see {@link ByteBuffer#isDirect()}). *

      - * The returned buffer's position (see {@link ByteBuffer#position()} is initially set to zero, while + * The returned buffer's position (see {@link ByteBuffer#position()}) is initially set to zero, while * the returned buffer's capacity and limit (see {@link ByteBuffer#capacity()} and {@link ByteBuffer#limit()}, respectively) * are set to this segment' size (see {@link MemorySegment#byteSize()}). For this reason, a byte buffer cannot be * returned if this segment' size is greater than {@link Integer#MAX_VALUE}. *

      * The life-cycle of the returned buffer will be tied to that of this segment. That is, accessing the returned buffer - * after the scope associated with this segment has been closed (see {@link ResourceScope#close()}, will throw an {@link IllegalStateException}. + * after the scope associated with this segment has been closed (see {@link ResourceScope#close()}), will throw an {@link IllegalStateException}. *

      * If this segment is associated with a confined scope, calling read/write I/O operations on the resulting buffer * might result in an unspecified exception being thrown. Examples of such problematic operations are @@ -505,83 +537,135 @@ for (long l = 0; l < segment.byteSize(); l++) { * * @return a {@link ByteBuffer} view of this memory segment. * @throws UnsupportedOperationException if this segment cannot be mapped onto a {@link ByteBuffer} instance, - * e.g. because it models an heap-based segment that is not based on a {@code byte[]}), or if its size is greater + * e.g. because it models a heap-based segment that is not based on a {@code byte[]}), or if its size is greater * than {@link Integer#MAX_VALUE}. */ ByteBuffer asByteBuffer(); /** * Copy the contents of this memory segment into a fresh byte array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh byte array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link byte[]} instance, * e.g. its size is greater than {@link Integer#MAX_VALUE}. */ - byte[] toByteArray(); + byte[] toArray(ValueLayout.OfByte elementLayout); /** * Copy the contents of this memory segment into a fresh short array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh short array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link short[]} instance, * e.g. because {@code byteSize() % 2 != 0}, or {@code byteSize() / 2 > Integer#MAX_VALUE} */ - short[] toShortArray(); + short[] toArray(ValueLayout.OfShort elementLayout); /** * Copy the contents of this memory segment into a fresh char array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh char array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link char[]} instance, * e.g. because {@code byteSize() % 2 != 0}, or {@code byteSize() / 2 > Integer#MAX_VALUE}. */ - char[] toCharArray(); + char[] toArray(ValueLayout.OfChar elementLayout); /** * Copy the contents of this memory segment into a fresh int array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh int array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link int[]} instance, * e.g. because {@code byteSize() % 4 != 0}, or {@code byteSize() / 4 > Integer#MAX_VALUE}. */ - int[] toIntArray(); + int[] toArray(ValueLayout.OfInt elementLayout); /** * Copy the contents of this memory segment into a fresh float array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh float array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link float[]} instance, * e.g. because {@code byteSize() % 4 != 0}, or {@code byteSize() / 4 > Integer#MAX_VALUE}. */ - float[] toFloatArray(); + float[] toArray(ValueLayout.OfFloat elementLayout); /** * Copy the contents of this memory segment into a fresh long array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh long array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link long[]} instance, * e.g. because {@code byteSize() % 8 != 0}, or {@code byteSize() / 8 > Integer#MAX_VALUE}. */ - long[] toLongArray(); + long[] toArray(ValueLayout.OfLong elementLayout); /** * Copy the contents of this memory segment into a fresh double array. + * @param elementLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. * @return a fresh double array copy of this memory segment. * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope, or if this segment's contents cannot be copied into a {@link double[]} instance, * e.g. because {@code byteSize() % 8 != 0}, or {@code byteSize() / 8 > Integer#MAX_VALUE}. */ - double[] toDoubleArray(); + double[] toArray(ValueLayout.OfDouble elementLayout); /** - * Creates a new confined buffer memory segment that models the memory associated with the given byte + * Reads a UTF-8 encoded, null-terminated string from this segment at given offset. + *

      + * This method always replaces malformed-input and unmappable-character + * sequences with this charset's default replacement string. The {@link + * java.nio.charset.CharsetDecoder} class should be used when more control + * over the decoding process is required. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a Java string constructed from the bytes read from the given starting address up to (but not including) + * the first {@code '\0'} terminator character (assuming one is found). + * @throws IllegalArgumentException if the size of the native string is greater than the largest string supported by the platform. + * @throws IllegalStateException if the size of the native string is greater than the size of this segment, + * or if the scope associated with this segment has been closed, or if access occurs from a thread other than the thread owning that scope. + */ + default String getUtf8String(long offset) { + return SharedUtils.toJavaStringInternal(this, offset); + } + + /** + * Writes the given string into this segment at given offset, converting it to a null-terminated byte sequence using UTF-8 encoding. + *

      + * This method always replaces malformed-input and unmappable-character + * sequences with this charset's default replacement string. The {@link + * java.nio.charset.CharsetDecoder} class should be used when more control + * over the decoding process is required. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param str the Java string to be written into this segment. + * @throws IllegalArgumentException if the size of the native string is greater than the largest string supported by the platform. + * @throws IllegalStateException if the size of the native string is greater than the size of this segment, + * or if the scope associated with this segment has been closed, or if access occurs from a thread other than the thread owning that scope. + */ + default void setUtf8String(long offset, String str) { + Utils.toCString(str.getBytes(StandardCharsets.UTF_8), SegmentAllocator.prefixAllocator(asSlice(offset))); + } + + + /** + * Creates a new buffer memory segment that models the memory associated with the given byte * buffer. The segment starts relative to the buffer's position (inclusive) * and ends relative to the buffer's limit (exclusive). *

      * If the buffer is {@link ByteBuffer#isReadOnly() read-only}, the resulting segment will also be * {@link ByteBuffer#isReadOnly() read-only}. The scope associated with this segment can either be the * {@linkplain ResourceScope#globalScope() global} resource scope, in case the buffer has been created independently, - * or to some other (possibly closeable) resource scope, in case the buffer has been obtained using {@link #asByteBuffer()}. + * or some other resource scope, in case the buffer has been obtained using {@link #asByteBuffer()}. *

      * The resulting memory segment keeps a reference to the backing buffer, keeping it reachable. * @@ -593,7 +677,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated byte array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated byte array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -604,7 +688,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated char array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated char array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -615,7 +699,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated short array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated short array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -626,7 +710,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated int array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated int array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -637,7 +721,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated float array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated float array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -648,7 +732,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated long array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated long array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -659,7 +743,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined array memory segment that models the memory associated with a given heap-allocated double array. + * Creates a new array memory segment that models the memory associated with a given heap-allocated double array. * The returned segment's resource scope is set to the {@linkplain ResourceScope#globalScope() global} resource scope. * * @param arr the primitive array backing the array memory segment. @@ -669,8 +753,49 @@ for (long l = 0; l < segment.byteSize(); l++) { return HeapMemorySegmentImpl.OfDouble.fromArray(arr); } + + /** + * Creates a new native memory segment with given size and resource scope, and whose base address is the given address. + * This method can be useful when interacting with custom + * native memory sources (e.g. custom allocators), where an address to some + * underlying memory region is typically obtained from native code (often as a plain {@code long} value). + * The returned segment is not read-only (see {@link MemorySegment#isReadOnly()}), and is associated with the + * provided resource scope. + *

      + * Clients should ensure that the address and bounds refer to a valid region of memory that is accessible for reading and, + * if appropriate, writing; an attempt to access an invalid memory location from Java code will either return an arbitrary value, + * have no visible effect, or cause an unspecified exception to be thrown. + *

      + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * + * @param address the returned segment's base address. + * @param bytesSize the desired size. + * @param scope the native segment scope. + * @return a new native memory segment with given base address, size and scope. + * @throws IllegalArgumentException if {@code bytesSize <= 0}. + * @throws IllegalStateException if the provided scope has been already closed, + * or if access occurs from a thread other than the thread owning the scope. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + static MemorySegment ofAddress(MemoryAddress address, long bytesSize, ResourceScope scope) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + Objects.requireNonNull(address); + Objects.requireNonNull(scope); + if (bytesSize <= 0) { + throw new IllegalArgumentException("Invalid size : " + bytesSize); + } + return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(address, bytesSize, (ResourceScopeImpl)scope); + } + /** - * Creates a new confined native memory segment that models a newly allocated block of off-heap memory with given layout + * Creates a new native memory segment that models a newly allocated block of off-heap memory with given layout * and resource scope. A client is responsible make sure that the resource scope associated with the returned segment is closed * when the segment is no longer in use. Failure to do so will result in off-heap memory leaks. *

      @@ -695,7 +820,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined native memory segment that models a newly allocated block of off-heap memory with given size (in bytes) + * Creates a new native memory segment that models a newly allocated block of off-heap memory with given size (in bytes) * and resource scope. A client is responsible make sure that the resource scope associated with the returned segment is closed * when the segment is no longer in use. Failure to do so will result in off-heap memory leaks. *

      @@ -718,7 +843,7 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Creates a new confined native memory segment that models a newly allocated block of off-heap memory with given size + * Creates a new native memory segment that models a newly allocated block of off-heap memory with given size * (in bytes), alignment constraint (in bytes) and resource scope. A client is responsible make sure that the resource * scope associated with the returned segment is closed when the segment is no longer in use. * Failure to do so will result in off-heap memory leaks. @@ -756,7 +881,7 @@ for (long l = 0; l < segment.byteSize(); l++) { *

      * The content of a mapped memory segment can change at any time, for example * if the content of the corresponding region of the mapped file is changed by - * this (or another) program. Whether or not such changes occur, and when they + * this (or another) program. Whether such changes occur, and when they * occur, is operating-system dependent and therefore unspecified. *

      * All or part of a mapped memory segment may become @@ -774,17 +899,17 @@ for (long l = 0; l < segment.byteSize(); l++) { * @param path the path to the file to memory map. * @param bytesOffset the offset (expressed in bytes) within the file at which the mapped segment is to start. * @param bytesSize the size (in bytes) of the mapped memory backing the memory segment. - * @param mapMode a file mapping mode, see {@link FileChannel#map(FileChannel.MapMode, long, long)}; the chosen mapping mode + * @param mapMode a file mapping mode, see {@link FileChannel#map(FileChannel.MapMode, long, long)}; the mapping mode * might affect the behavior of the returned memory mapped segment (see {@link #force()}). * @param scope the segment scope. - * @return a new confined mapped memory segment. + * @return a new mapped memory segment. * @throws IllegalArgumentException if {@code bytesOffset < 0}, {@code bytesSize < 0}, or if {@code path} is not associated * with the default file system. * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other * than the thread owning {@code scope}. * @throws UnsupportedOperationException if an unsupported map mode is specified. * @throws IOException if the specified path does not point to an existing file, or if some other I/O error occurs. - * @throws SecurityException If a security manager is installed and it denies an unspecified permission required by the implementation. + * @throws SecurityException If a security manager is installed, and it denies an unspecified permission required by the implementation. * In the case of the default provider, the {@link SecurityManager#checkRead(String)} method is invoked to check * read access if the file is opened for reading. The {@link SecurityManager#checkWrite(String)} method is invoked to check * write access if the file is opened for writing. @@ -795,27 +920,738 @@ for (long l = 0; l < segment.byteSize(); l++) { } /** - * Returns a native memory segment whose base address is {@link MemoryAddress#NULL} and whose size is {@link Long#MAX_VALUE}. - * This method can be very useful when dereferencing memory addresses obtained when interacting with native libraries. - * The returned segment is associated with the global resource scope (see {@link ResourceScope#globalScope()}). - * Equivalent to (but likely more efficient than) the following code: - *

      {@code
      -    MemoryAddress.NULL.asSegment(Long.MAX_VALUE)
      -     * }
      + * Performs a bulk copy from source segment to destination segment. More specifically, the bytes at offset + * {@code srcOffset} through {@code srcOffset + bytes - 1} in the source segment are copied into the destination + * segment at offset {@code dstOffset} through {@code dstOffset + bytes - 1}. *

      - * This method is restricted. - * Restricted methods are unsafe, and, if used incorrectly, their use might crash - * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on - * restricted methods, and use safe and supported functionalities, where possible. + * If the source segment overlaps with this segment, then the copying is performed as if the bytes at + * offset {@code srcOffset} through {@code srcOffset + bytes - 1} in the source segment were first copied into a + * temporary segment with size {@code bytes}, and then the contents of the temporary segment were copied into + * the destination segment at offset {@code dstOffset} through {@code dstOffset + bytes - 1}. + *

      + * The result of a bulk copy is unspecified if, in the uncommon case, the source segment and the destination segment + * do not overlap, but refer to overlapping regions of the same backing storage using different addresses. + * For example, this may occur if the same file is {@linkplain MemorySegment#mapFile mapped} to two segments. + *

      + * Calling this method is equivalent to the following code: + *

      {@code
      +    MemorySegment.copy(srcSegment, ValueLayout.JAVA_BYTE, srcOffset, dstSegment, ValueLayout.JAVA_BYTE, dstOffset, bytes);
      +     * }
      + * @param srcSegment the source segment. + * @param srcOffset the starting offset, in bytes, of the source segment. + * @param dstSegment the destination segment. + * @param dstOffset the starting offset, in bytes, of the destination segment. + * @param bytes the number of bytes to be copied. + * @throws IllegalStateException if either the scope associated with the source segment or the scope associated + * with the destination segment have been already closed, or if access occurs from a thread other than the thread + * owning either scopes. + * @throws IndexOutOfBoundsException if {@code srcOffset + bytes > srcSegment.byteSize()} or if + * {@code dstOffset + bytes > dstSegment.byteSize()}, or if either {@code srcOffset}, {@code dstOffset} + * or {@code bytes} are {@code < 0}. + * @throws UnsupportedOperationException if the destination segment is read-only (see {@link #isReadOnly()}). + */ + @ForceInline + static void copy(MemorySegment srcSegment, long srcOffset, MemorySegment dstSegment, long dstOffset, long bytes) { + copy(srcSegment, ValueLayout.JAVA_BYTE, srcOffset, dstSegment, ValueLayout.JAVA_BYTE, dstOffset, bytes); + } + + /** + * Performs a bulk copy from source segment to destination segment. More specifically, if {@code S} is the byte size + * of the element layouts, the bytes at offset {@code srcOffset} through {@code srcOffset + (elementCount * S) - 1} + * in the source segment are copied into the destination segment at offset {@code dstOffset} through {@code dstOffset + (elementCount * S) - 1}. + *

      + * The copy occurs in an element-wise fashion: the bytes in the source segment are interpreted as a sequence of elements + * whose layout is {@code srcElementLayout}, whereas the bytes in the destination segment are interpreted as a sequence of + * elements whose layout is {@code dstElementLayout}. Both element layouts must have same size {@code S}. + * If the byte order of the two element layouts differ, the bytes corresponding to each element to be copied + * are swapped accordingly during the copy operation. + *

      + * If the source segment overlaps with this segment, then the copying is performed as if the bytes at + * offset {@code srcOffset} through {@code srcOffset + (elementCount * S) - 1} in the source segment were first copied into a + * temporary segment with size {@code bytes}, and then the contents of the temporary segment were copied into + * the destination segment at offset {@code dstOffset} through {@code dstOffset + (elementCount * S) - 1}. + *

      + * The result of a bulk copy is unspecified if, in the uncommon case, the source segment and the destination segment + * do not overlap, but refer to overlapping regions of the same backing storage using different addresses. + * For example, this may occur if the same file is {@linkplain MemorySegment#mapFile mapped} to two segments. + * @param srcSegment the source segment. + * @param srcElementLayout the element layout associated with the source segment. + * @param srcOffset the starting offset, in bytes, of the source segment. + * @param dstSegment the destination segment. + * @param dstElementLayout the element layout associated with the destination segment. + * @param dstOffset the starting offset, in bytes, of the destination segment. + * @param elementCount the number of elements to be copied. + * @throws IllegalArgumentException if the element layouts have different sizes, if the source offset is incompatible + * with the alignment constraints in the source element layout, or if the destination offset is incompatible with the + * alignment constraints in the destination element layout. + * @throws IllegalStateException if either the scope associated with the source segment or the scope associated + * with the destination segment have been already closed, or if access occurs from a thread other than the thread + * owning either scopes. + * @throws IndexOutOfBoundsException if {@code srcOffset + (elementCount * S) > srcSegment.byteSize()} or if + * {@code dstOffset + (elementCount * S) > dstSegment.byteSize()}, where {@code S} is the byte size + * of the element layouts, or if either {@code srcOffset}, {@code dstOffset} or {@code elementCount} are {@code < 0}. + * @throws UnsupportedOperationException if the destination segment is read-only (see {@link #isReadOnly()}). + */ + @ForceInline + static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long srcOffset, MemorySegment dstSegment, + ValueLayout dstElementLayout, long dstOffset, long elementCount) { + Objects.requireNonNull(srcSegment); + Objects.requireNonNull(srcElementLayout); + Objects.requireNonNull(dstSegment); + Objects.requireNonNull(dstElementLayout); + AbstractMemorySegmentImpl srcImpl = (AbstractMemorySegmentImpl)srcSegment; + AbstractMemorySegmentImpl dstImpl = (AbstractMemorySegmentImpl)dstSegment; + if (srcElementLayout.byteSize() != dstElementLayout.byteSize()) { + throw new IllegalArgumentException("Source and destination layouts must have same sizes"); + } + if (srcOffset % srcElementLayout.byteAlignment() != 0) { + throw new IllegalArgumentException("Source segment incompatible with alignment constraints"); + } + if (dstOffset % dstElementLayout.byteAlignment() != 0) { + throw new IllegalArgumentException("Target segment incompatible with alignment constraints"); + } + long size = elementCount * srcElementLayout.byteSize(); + srcImpl.checkAccess(srcOffset, size, true); + dstImpl.checkAccess(dstOffset, size, false); + if (srcElementLayout.byteSize() == 1 || srcElementLayout.order() == dstElementLayout.order()) { + ScopedMemoryAccess.getScopedMemoryAccess().copyMemory(srcImpl.scope(), dstImpl.scope(), + srcImpl.unsafeGetBase(), srcImpl.unsafeGetOffset() + srcOffset, + dstImpl.unsafeGetBase(), dstImpl.unsafeGetOffset() + dstOffset, size); + } else { + ScopedMemoryAccess.getScopedMemoryAccess().copySwapMemory(srcImpl.scope(), dstImpl.scope(), + srcImpl.unsafeGetBase(), srcImpl.unsafeGetOffset() + srcOffset, + dstImpl.unsafeGetBase(), dstImpl.unsafeGetOffset() + dstOffset, size, srcElementLayout.byteSize()); + } + } + + /** + * Reads a byte from this segment and offset with given layout. * - * @return a memory segment whose base address is {@link MemoryAddress#NULL} and whose size is {@link Long#MAX_VALUE}. - * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option - * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or - * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a byte value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ - @CallerSensitive - static MemorySegment globalNativeSegment() { - Reflection.ensureNativeAccess(Reflection.getCallerClass()); - return NativeMemorySegmentImpl.EVERYTHING; + @ForceInline + default byte get(ValueLayout.OfByte layout, long offset) { + return (byte)layout.accessHandle().get(this, offset); + } + + /** + * Writes a byte to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the byte value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfByte layout, long offset, byte value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads a boolean from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a boolean value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default boolean get(ValueLayout.OfBoolean layout, long offset) { + return (boolean)layout.accessHandle().get(this, offset); + } + + /** + * Writes a boolean to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the boolean value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfBoolean layout, long offset, boolean value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads a char from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a char value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default char get(ValueLayout.OfChar layout, long offset) { + return (char)layout.accessHandle().get(this, offset); + } + + /** + * Writes a char to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the char value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfChar layout, long offset, char value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads a short from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a short value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default short get(ValueLayout.OfShort layout, long offset) { + return (short)layout.accessHandle().get(this, offset); + } + + /** + * Writes a short to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the short value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfShort layout, long offset, short value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads an int from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return an int value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default int get(ValueLayout.OfInt layout, long offset) { + return (int)layout.accessHandle().get(this, offset); + } + + /** + * Writes an int to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the int value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfInt layout, long offset, int value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads a float from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a float value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default float get(ValueLayout.OfFloat layout, long offset) { + return (float)layout.accessHandle().get(this, offset); + } + + /** + * Writes a float to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the float value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfFloat layout, long offset, float value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads a long from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a long value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default long get(ValueLayout.OfLong layout, long offset) { + return (long)layout.accessHandle().get(this, offset); + } + + /** + * Writes a long to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the long value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfLong layout, long offset, long value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads a double from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return a double value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default double get(ValueLayout.OfDouble layout, long offset) { + return (double)layout.accessHandle().get(this, offset); + } + + /** + * Writes a double to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the double value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfDouble layout, long offset, double value) { + layout.accessHandle().set(this, offset, value); + } + + /** + * Reads an address from this segment and offset with given layout. + * + * @param layout the layout of the memory region to be read. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + offset}. + * @return an address value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default MemoryAddress get(ValueLayout.OfAddress layout, long offset) { + return (MemoryAddress)layout.accessHandle().get(this, offset); + } + + /** + * Writes an address to this segment and offset with given layout. + * + * @param layout the layout of the memory region to be written. + * @param offset offset in bytes (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + offset}. + * @param value the address value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void set(ValueLayout.OfAddress layout, long offset, Addressable value) { + layout.accessHandle().set(this, offset, value.address()); + } + + /** + * Reads a char from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return a char value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default char getAtIndex(ValueLayout.OfChar layout, long index) { + return (char)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes a char to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the char value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfChar layout, long index, char value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value); + } + + /** + * Reads a short from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return a short value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default short getAtIndex(ValueLayout.OfShort layout, long index) { + return (short)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes a short to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the short value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfShort layout, long index, short value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value); + } + + /** + * Reads an int from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return an int value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default int getAtIndex(ValueLayout.OfInt layout, long index) { + return (int)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes an int to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the int value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfInt layout, long index, int value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value); + } + + /** + * Reads a float from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return a float value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default float getAtIndex(ValueLayout.OfFloat layout, long index) { + return (float)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes a float to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the float value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfFloat layout, long index, float value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value); + } + + /** + * Reads a long from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return a long value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default long getAtIndex(ValueLayout.OfLong layout, long index) { + return (long)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes a long to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the long value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfLong layout, long index, long value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value); + } + + /** + * Reads a double from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return a double value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default double getAtIndex(ValueLayout.OfDouble layout, long index) { + return (double)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes a double to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the double value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfDouble layout, long index, double value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value); + } + + /** + * Reads an address from this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be read. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this read operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @return an address value read from this address. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. + */ + @ForceInline + default MemoryAddress getAtIndex(ValueLayout.OfAddress layout, long index) { + return (MemoryAddress)layout.accessHandle().get(this, Utils.scaleOffset(this, index, layout.byteSize())); + } + + /** + * Writes an address to this segment and index, scaled by given layout size. + * + * @param layout the layout of the memory region to be written. + * @param index index (relative to this segment). For instance, if this segment is a {@linkplain #isNative() native} segment, + * the final address of this write operation can be expressed as {@code address().toRowLongValue() + (index * layout.byteSize())}. + * @param value the address value to be written. + * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + */ + @ForceInline + default void setAtIndex(ValueLayout.OfAddress layout, long index, Addressable value) { + layout.accessHandle().set(this, Utils.scaleOffset(this, index, layout.byteSize()), value.address()); + } + + + /** + * Copies a number of elements from a source segment to a destination array, + * starting at a given segment offset (expressed in bytes), and a given array index, using the given source element layout. + * Supported array types are {@code byte[]}, {@code char[]}, {@code short[]}, {@code int[]}, {@code float[]}, {@code long[]} and {@code double[]}. + * @param srcSegment the source segment. + * @param srcLayout the source element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. + * @param srcOffset the starting offset, in bytes, of the source segment. + * @param dstArray the destination array. + * @param dstIndex the starting index of the destination array. + * @param elementCount the number of array elements to be copied. + * @throws IllegalArgumentException if {@code dstArray} is not an array, or if it is an array but whose type is not supported, + * or if the destination array component type does not match the carrier of the source element layout. + */ + @ForceInline + static void copy( + MemorySegment srcSegment, ValueLayout srcLayout, long srcOffset, + Object dstArray, int dstIndex, int elementCount) { + Objects.requireNonNull(srcSegment); + Objects.requireNonNull(dstArray); + Objects.requireNonNull(srcLayout); + long baseAndScale = getBaseAndScale(dstArray.getClass()); + if (dstArray.getClass().componentType() != srcLayout.carrier()) { + throw new IllegalArgumentException("Incompatible value layout: " + srcLayout); + } + int dstBase = (int)baseAndScale; + int dstWidth = (int)(baseAndScale >> 32); + AbstractMemorySegmentImpl srcImpl = (AbstractMemorySegmentImpl)srcSegment; + srcImpl.checkAccess(srcOffset, elementCount * dstWidth, true); + Objects.checkFromIndexSize(dstIndex, elementCount, Array.getLength(dstArray)); + if (dstWidth == 1 || srcLayout.order() == ByteOrder.nativeOrder()) { + ScopedMemoryAccess.getScopedMemoryAccess().copyMemory(srcImpl.scope(), null, + srcImpl.unsafeGetBase(), srcImpl.unsafeGetOffset() + srcOffset, + dstArray, dstBase + (dstIndex * dstWidth), elementCount * dstWidth); + } else { + ScopedMemoryAccess.getScopedMemoryAccess().copySwapMemory(srcImpl.scope(), null, + srcImpl.unsafeGetBase(), srcImpl.unsafeGetOffset() + srcOffset, + dstArray, dstBase + (dstIndex * dstWidth), elementCount * dstWidth, dstWidth); + } + } + + /** + * Copies a number of elements from a source array to a destination segment, + * starting at a given array index, and a given segment offset (expressed in bytes), using the given destination element layout. + * Supported array types are {@code byte[]}, {@code char[]}, {@code short[]}, {@code int[]}, {@code float[]}, {@code long[]} and {@code double[]}. + * @param srcArray the source array. + * @param srcIndex the starting index of the source array. + * @param dstSegment the destination segment. + * @param dstLayout the destination element layout. If the byte order associated with the layout is + * different from the native order, a byte swap operation will be performed on each array element. + * @param dstOffset the starting offset, in bytes, of the destination segment. + * @param elementCount the number of array elements to be copied. + * @throws IllegalArgumentException if {@code srcArray} is not an array, or if it is an array but whose type is not supported, + * or if the source array component type does not match the carrier of the destination element layout. + */ + @ForceInline + static void copy( + Object srcArray, int srcIndex, + MemorySegment dstSegment, ValueLayout dstLayout, long dstOffset, int elementCount) { + Objects.requireNonNull(srcArray); + Objects.requireNonNull(dstSegment); + Objects.requireNonNull(dstLayout); + long baseAndScale = getBaseAndScale(srcArray.getClass()); + if (srcArray.getClass().componentType() != dstLayout.carrier()) { + throw new IllegalArgumentException("Incompatible value layout: " + dstLayout); + } + int srcBase = (int)baseAndScale; + int srcWidth = (int)(baseAndScale >> 32); + Objects.checkFromIndexSize(srcIndex, elementCount, Array.getLength(srcArray)); + AbstractMemorySegmentImpl destImpl = (AbstractMemorySegmentImpl)dstSegment; + destImpl.checkAccess(dstOffset, elementCount * srcWidth, false); + if (srcWidth == 1 || dstLayout.order() == ByteOrder.nativeOrder()) { + ScopedMemoryAccess.getScopedMemoryAccess().copyMemory(null, destImpl.scope(), + srcArray, srcBase + (srcIndex * srcWidth), + destImpl.unsafeGetBase(), destImpl.unsafeGetOffset() + dstOffset, elementCount * srcWidth); + } else { + ScopedMemoryAccess.getScopedMemoryAccess().copySwapMemory(null, destImpl.scope(), + srcArray, srcBase + (srcIndex * srcWidth), + destImpl.unsafeGetBase(), destImpl.unsafeGetOffset() + dstOffset, elementCount * srcWidth, srcWidth); + } + } + + private static long getBaseAndScale(Class arrayType) { + if (arrayType.equals(byte[].class)) { + return (long)Unsafe.ARRAY_BYTE_BASE_OFFSET | ((long)Unsafe.ARRAY_BYTE_INDEX_SCALE << 32); + } else if (arrayType.equals(char[].class)) { + return (long)Unsafe.ARRAY_CHAR_BASE_OFFSET | ((long)Unsafe.ARRAY_CHAR_INDEX_SCALE << 32); + } else if (arrayType.equals(short[].class)) { + return (long)Unsafe.ARRAY_SHORT_BASE_OFFSET | ((long)Unsafe.ARRAY_SHORT_INDEX_SCALE << 32); + } else if (arrayType.equals(int[].class)) { + return (long)Unsafe.ARRAY_INT_BASE_OFFSET | ((long) Unsafe.ARRAY_INT_INDEX_SCALE << 32); + } else if (arrayType.equals(float[].class)) { + return (long)Unsafe.ARRAY_FLOAT_BASE_OFFSET | ((long)Unsafe.ARRAY_FLOAT_INDEX_SCALE << 32); + } else if (arrayType.equals(long[].class)) { + return (long)Unsafe.ARRAY_LONG_BASE_OFFSET | ((long)Unsafe.ARRAY_LONG_INDEX_SCALE << 32); + } else if (arrayType.equals(double[].class)) { + return (long)Unsafe.ARRAY_DOUBLE_BASE_OFFSET | ((long)Unsafe.ARRAY_DOUBLE_INDEX_SCALE << 32); + } else { + throw new IllegalArgumentException("Not a supported array class: " + arrayType.getSimpleName()); + } } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/NativeSymbol.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/NativeSymbol.java new file mode 100644 index 00000000000..bf137e965d7 --- /dev/null +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/NativeSymbol.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.incubator.foreign; + +import jdk.internal.foreign.NativeSymbolImpl; +import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.Reflection; + +import java.lang.invoke.MethodHandle; +import java.util.Objects; + +/** + * A native symbol models a reference to a location (typically the entry point of a function) in a native library. + * A native symbol has a name, and is associated with a scope, which governs the native symbol's lifecycle. + * This is useful, since the library a native symbol refers to can be unloaded, thus invalidating the native symbol. + * While native symbols are typically obtained using a {@link SymbolLookup#lookup(String) symbol lookup}, it is also possible to obtain an + * anonymous native symbol, in the form of an {@linkplain CLinker#upcallStub(MethodHandle, FunctionDescriptor, ResourceScope) upcall stub}, + * that is, a reference to a dynamically-generated native symbol which can be used to call back into Java code. + */ +sealed public interface NativeSymbol extends Addressable permits NativeSymbolImpl { + + /** + * Returns the name of this symbol. + * @return the name of this symbol. + */ + String name(); + + /** + * Returns the resource scope associated with this symbol. + * @return the resource scope associated with this symbol. + */ + ResourceScope scope(); + + /** + * Returns the memory address associated with this symbol. + * @throws IllegalStateException if the scope associated with this symbol has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @return The memory address associated with this symbol. + */ + @Override + MemoryAddress address(); + + /** + * Creates a new symbol from given name, address and scope. + *

      + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * @param name the symbol name. + * @param address the symbol address. + * @param scope the symbol scope. + * @return A new symbol from given name, address and scope. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + static NativeSymbol ofAddress(String name, MemoryAddress address, ResourceScope scope) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + Objects.requireNonNull(name); + Objects.requireNonNull(address); + Objects.requireNonNull(scope); + return new NativeSymbolImpl(name, address, scope); + } +} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/PaddingLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/PaddingLayout.java index db65c48669b..0b90e9a1d1d 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/PaddingLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/PaddingLayout.java @@ -25,10 +25,8 @@ */ package jdk.incubator.foreign; -import java.lang.constant.Constable; import java.lang.constant.ConstantDescs; import java.lang.constant.DynamicConstantDesc; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.OptionalLong; @@ -53,11 +51,11 @@ import java.util.OptionalLong; /* package-private */ final class PaddingLayout extends AbstractLayout implements MemoryLayout { PaddingLayout(long size) { - this(size, 1, Map.of()); + this(size, 1, Optional.empty()); } - PaddingLayout(long size, long alignment, Map attributes) { - super(OptionalLong.of(size), alignment, attributes); + PaddingLayout(long size, long alignment, Optional name) { + super(OptionalLong.of(size), alignment, name); } @Override @@ -73,10 +71,9 @@ import java.util.OptionalLong; if (!super.equals(other)) { return false; } - if (!(other instanceof PaddingLayout)) { + if (!(other instanceof PaddingLayout p)) { return false; } - PaddingLayout p = (PaddingLayout)other; return bitSize() == p.bitSize(); } @@ -86,8 +83,8 @@ import java.util.OptionalLong; } @Override - PaddingLayout dup(long alignment, Map attributes) { - return new PaddingLayout(bitSize(), alignment, attributes); + PaddingLayout dup(long alignment, Optional name) { + return new PaddingLayout(bitSize(), alignment, name); } @Override @@ -119,12 +116,4 @@ import java.util.OptionalLong; public PaddingLayout withBitAlignment(long alignmentBits) { return (PaddingLayout)super.withBitAlignment(alignmentBits); } - - /** - * {@inheritDoc} - */ - @Override - public PaddingLayout withAttribute(String name, Constable value) { - return (PaddingLayout)super.withAttribute(name, value); - } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java index 0a46ab705b3..f2fb32a0594 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java @@ -26,9 +26,11 @@ package jdk.incubator.foreign; import jdk.internal.foreign.ResourceScopeImpl; +import jdk.internal.ref.CleanerFactory; import java.lang.invoke.MethodHandle; import java.lang.ref.Cleaner; +import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.nio.file.Path; import java.util.Objects; @@ -36,109 +38,109 @@ import java.util.Spliterator; /** * A resource scope manages the lifecycle of one or more resources. Resources (e.g. {@link MemorySegment}) associated - * with a resource scope can only be accessed while the resource scope is alive (see {@link #isAlive()}), - * and by the thread associated with the resource scope (if any). + * with a resource scope can only be accessed while the resource scope is {@linkplain #isAlive() alive}, + * and by the {@linkplain #ownerThread() thread} associated with the resource scope (if any). * - *

      Explicit resource scopes

      + *

      Deterministic deallocation

      * - * Resource scopes obtained from {@link #newConfinedScope()}, {@link #newSharedScope()} support deterministic deallocation; - * We call these resource scopes explicit scopes. Explicit resource scopes can be closed explicitly (see {@link ResourceScope#close()}). - * When a resource scope is closed, it is no longer alive (see {@link #isAlive()}, and subsequent operations on - * resources associated with that scope (e.g. attempting to access a {@link MemorySegment} instance) will fail with {@link IllegalStateException}. + * Resource scopes support deterministic deallocation; that is, they can be {@linkplain ResourceScope#close() closed} + * explicitly. When a resource scope is closed, it is no longer {@link #isAlive() alive}, and subsequent + * operations on resources associated with that scope (e.g. attempting to access a {@link MemorySegment} instance) + * will fail with {@link IllegalStateException}. *

      - * Closing a resource scope will cause all the cleanup actions associated with that scope (see {@link #addCloseAction(Runnable)}) to be called. + * Closing a resource scope will cause all the {@linkplain #addCloseAction(Runnable) close actions} associated with that scope to be called. * Moreover, closing a resource scope might trigger the releasing of the underlying memory resources associated with said scope; for instance: *

        - *
      • closing the scope associated with a native memory segment results in freeing the native memory associated with it - * (see {@link MemorySegment#allocateNative(long, ResourceScope)}, or {@link SegmentAllocator#arenaAllocator(ResourceScope)})
      • - *
      • closing the scope associated with a mapped memory segment results in the backing memory-mapped file to be unmapped - * (see {@link MemorySegment#mapFile(Path, long, long, FileChannel.MapMode, ResourceScope)})
      • - *
      • closing the scope associated with an upcall stub results in releasing the stub - * (see {@link CLinker#upcallStub(MethodHandle, FunctionDescriptor, ResourceScope)}
      • + *
      • closing the scope associated with a {@linkplain MemorySegment#allocateNative(long, long, ResourceScope) native memory segment} + * results in freeing the native memory associated with it;
      • + *
      • closing the scope associated with a {@linkplain MemorySegment#mapFile(Path, long, long, FileChannel.MapMode, ResourceScope) mapped memory segment} + * results in the backing memory-mapped file to be unmapped;
      • + *
      • closing the scope associated with an {@linkplain CLinker#upcallStub(MethodHandle, FunctionDescriptor, ResourceScope) upcall stub} + * results in releasing the stub;
      • + *
      • closing the scope associated with a {@linkplain VaList variable arity list} results in releasing the memory + * associated with that variable arity list instance.
      • *
      - *

      - * Sometimes, explicit scopes can be associated with a {@link Cleaner} instance (see {@link #newConfinedScope(Cleaner)} and - * {@link #newSharedScope(Cleaner)}). We call these resource scopes managed resource scopes. A managed resource scope - * is closed automatically once the scope instance becomes unreachable. - *

      - * Managed scopes can be useful to allow for predictable, deterministic resource deallocation, while still prevent accidental native memory leaks. - * In case a managed resource scope is closed explicitly, no further action will be taken when the scope becomes unreachable; - * that is, cleanup actions (see {@link #addCloseAction(Runnable)}) associated with a resource scope, whether managed or not, - * are called exactly once. * - *

      Implicit resource scopes

      + *

      Implicit deallocation

      + * + * Resource scopes can be associated with a {@link Cleaner} instance, so that they are also closed automatically, + * once the scope instance becomes unreachable. + * This can be useful to allow for predictable, deterministic resource deallocation, while still preventing accidental + * native memory leaks. In case a managed resource scope is closed explicitly, no further action will be taken when + * the scope becomes unreachable; that is, {@linkplain #addCloseAction(Runnable) close actions} associated with a + * resource scope, whether managed or not, are called exactly once. + * + *

      Global scope

      * - * Resource scopes obtained from {@link #newImplicitScope()} cannot be closed explicitly. We call these resource scopes - * implicit scopes. Calling {@link #close()} on an implicit resource scope always results in an exception. - * Resources associated with implicit scopes are released once the scope instance becomes - * unreachable. - *

      * An important implicit resource scope is the so called {@linkplain #globalScope() global scope}; the global scope is - * an implicit scope that is guaranteed to never become unreachable. - * As a results, the global scope will never attempt to release resources associated with it. Such resources must, where + * a resource scope that cannot be closed, either explicitly or implicitly. As a result, the global scope will never + * attempt to release resources associated with it. Examples of resources associated with the global scope are: + *

        + *
      • heap segments created from {@linkplain MemorySegment#ofArray(int[]) arrays} or + * {@linkplain MemorySegment#ofByteBuffer(ByteBuffer) buffers};
      • + *
      • variable arity lists {@linkplain VaList#ofAddress(MemoryAddress, ResourceScope) obtained} from raw memory addresses; + *
      • native symbols {@linkplain SymbolLookup#lookup(String) obtained} from a {@linkplain SymbolLookup#loaderLookup() loader lookup}, + * or from the {@link CLinker}.
      • + *
      + * In other words, the global scope is used to indicate that the lifecycle of one or more resources must, where * needed, be managed independently by clients. * *

      Thread confinement

      * - * Resource scopes can be further divided into two categories: thread-confined resource scopes, and shared + * Resource scopes can be divided into two categories: thread-confined resource scopes, and shared * resource scopes. *

      - * Confined resource scopes (see {@link #newConfinedScope()}), support strong thread-confinement guarantees. Upon creation, - * they are assigned an owner thread, typically the thread which initiated the creation operation (see {@link #ownerThread()}). + * {@linkplain #newConfinedScope() Confined resource scopes}, support strong thread-confinement guarantees. Upon creation, + * they are assigned an {@linkplain #ownerThread() owner thread}, typically the thread which initiated the creation operation. * After creating a confined resource scope, only the owner thread will be allowed to directly manipulate the resources * associated with this resource scope. Any attempt to perform resource access from a thread other than the * owner thread will result in a runtime failure. *

      - * Shared resource scopes (see {@link #newSharedScope()} and {@link #newImplicitScope()}), on the other hand, have no owner thread; - * as such resources associated with this shared resource scopes can be accessed by multiple threads. + * {@linkplain #newSharedScope() Shared resource scopes}, on the other hand, have no owner thread; + * as such, resources associated with shared resource scopes can be accessed by multiple threads. * This might be useful when multiple threads need to access the same resource concurrently (e.g. in the case of parallel processing). - * For instance, a client might obtain a {@link Spliterator} from a shared segment, which can then be used to slice the + * For instance, a client might obtain a {@link Spliterator} from a segment backed by a shared scope, which can then be used to slice the * segment and allow multiple threads to work in parallel on disjoint segment slices. The following code can be used to sum * all int values in a memory segment in parallel: * *

      {@code
      -SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_INT);
       try (ResourceScope scope = ResourceScope.newSharedScope()) {
      +    SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT);
           MemorySegment segment = MemorySegment.allocateNative(SEQUENCE_LAYOUT, scope);
      -    VarHandle VH_int = SEQUENCE_LAYOUT.elementLayout().varHandle(int.class);
      -    int sum = StreamSupport.stream(segment.spliterator(SEQUENCE_LAYOUT), true)
      -        .mapToInt(s -> (int)VH_int.get(s.address()))
      -        .sum();
      +    int sum = segment.elements(ValueLayout.JAVA_INT).parallel()
      +                        .mapToInt(s -> s.get(ValueLayout.JAVA_INT, 0))
      +                        .sum();
       }
        * }
      * *

      - * Explicit shared resource scopes, while powerful, must be used with caution: if one or more threads accesses + * Shared resource scopes, while powerful, must be used with caution: if one or more threads accesses * a resource associated with a shared scope while the scope is being closed from another thread, an exception might occur on both * the accessing and the closing threads. Clients should refrain from attempting to close a shared resource scope repeatedly * (e.g. keep calling {@link #close()} until no exception is thrown). Instead, clients of shared resource scopes - * should always ensure that proper synchronization mechanisms (e.g. using resource scope handles, see below) are put in place + * should always ensure that proper synchronization mechanisms (e.g. using temporal dependencies, see below) are put in place * so that threads closing shared resource scopes can never race against threads accessing resources managed by same scopes. * - *

      Resource scope handles

      + *

      Temporal dependencies

      * - * Resource scopes can be made non-closeable by acquiring one or more resource scope handles (see - * {@link #acquire()}. A resource scope handle can be used to make sure that resources associated with a given resource scope - * (either explicit or implicit) cannot be released for a certain period of time - e.g. during a critical region of code - * involving one or more resources associated with the scope. For instance, an explicit resource scope can only be closed - * after all the handles acquired against that scope have been closed (see {@link Handle#close()}). + * Resource scopes can depend on each other. More specifically, a scope can feature + * {@linkplain #keepAlive(ResourceScope) temporal dependencies} on one or more other resource scopes. + * Such a resource scope cannot be closed (either implicitly or explicitly) until all the scopes it depends on + * have also been closed. + *

      * This can be useful when clients need to perform a critical operation on a memory segment, during which they have - * to ensure that the segment will not be released; this can be done as follows: + * to ensure that the scope associated with that segment will not be closed; this can be done as follows: * *

      {@code
       MemorySegment segment = ...
      -ResourceScope.Handle segmentHandle = segment.scope().acquire()
      -try {
      -   
      -} finally {
      -   segment.scope().release(segmentHandle);
      +try (ResourceScope criticalScope = ResourceScope.newConfinedScope()) {
      +    criticalScope.keepAlive(segment.scope());
      +    
       }
        * }
      * - * Acquiring implicit resource scopes is also possible, but it is often unnecessary: since resources associated with - * an implicit scope will only be released when the scope becomes unreachable, - * clients can use e.g. {@link java.lang.ref.Reference#reachabilityFence(Object)} to make sure that resources associated - * with implicit scopes are not released prematurely. That said, the above code snippet works (trivially) for implicit scopes too. + * Note that a resource scope does not become unreachable + * until all the scopes it depends on have been closed. * * @implSpec * Implementations of this interface are immutable, thread-safe and value-based. @@ -158,15 +160,7 @@ public sealed interface ResourceScope extends AutoCloseable permits ResourceScop Thread ownerThread(); /** - * Is this resource scope an implicit scope? - * @return true if this scope is an implicit scope. - * @see #newImplicitScope() - * @see #globalScope() - */ - boolean isImplicit(); - - /** - * Closes this resource scope. As a side-effect, if this operation completes without exceptions, this scope will be marked + * Closes this resource scope. As a side effect, if this operation completes without exceptions, this scope will be marked * as not alive, and subsequent operations on resources associated with this scope will fail with {@link IllegalStateException}. * Additionally, upon successful closure, all native resources associated with this resource scope will be released. * @@ -180,9 +174,9 @@ public sealed interface ResourceScope extends AutoCloseable permits ResourceScop *
    • this resource scope is not alive *
    • this resource scope is confined, and this method is called from a thread other than the thread owning this resource scope
    • *
    • this resource scope is shared and a resource associated with this scope is accessed while this method is called
    • - *
    • one or more handles (see {@link #acquire()}) associated with this resource scope have not been {@linkplain #release(Handle) released}
    • + *
    • one or more scopes which {@linkplain #keepAlive(ResourceScope) depend} on this resource scope have not been closed. * - * @throws UnsupportedOperationException if this resource scope is {@linkplain #isImplicit() implicit}. + * @throws UnsupportedOperationException if this resource scope is the {@linkplain #globalScope() global scope}. */ void close(); @@ -190,61 +184,42 @@ public sealed interface ResourceScope extends AutoCloseable permits ResourceScop * Add a custom cleanup action which will be executed when the resource scope is closed. * The order in which custom cleanup actions are invoked once the scope is closed is unspecified. * @param runnable the custom cleanup action to be associated with this scope. - * @throws IllegalStateException if this scope has already been closed. + * @throws IllegalStateException if this scope has been closed, or if access occurs from + * a thread other than the thread owning this scope. */ void addCloseAction(Runnable runnable); /** - * Acquires a resource scope handle associated with this resource scope. An explicit resource scope cannot be - * {@linkplain #close() closed} until all the resource scope handles acquired from it have been {@linkplain #release(Handle)} released}. - * @return a resource scope handle. - */ - Handle acquire(); - - /** - * Release the provided resource scope handle. This method is idempotent, that is, releasing the same handle - * multiple times has no effect. - * @param handle the resource scope handle to be released. - * @throws IllegalArgumentException if the provided handle is not associated with this scope. - */ - void release(Handle handle); - - /** - * An abstraction modelling a resource scope handle. A resource scope handle is typically {@linkplain #acquire() acquired} by clients - * in order to prevent an explicit resource scope from being closed while executing a certain operation. - * Once obtained, resource scope handles can be {@linkplain #release(Handle)} released}; an explicit resource scope can - * be closed only after all the resource scope handles acquired from it have been released. + * Creates a temporal dependency between this scope and the target scope. As a result, the target scope cannot + * be {@linkplain #close() closed} before this scope. + * @implNote A given scope can support up to {@link Integer#MAX_VALUE} pending keep alive requests. + * @param target the scope that needs to be kept alive. + * @throws IllegalArgumentException if {@code target == this}. + * @throws IllegalStateException if this scope or {@code target} have been closed, or if access occurs from + * a thread other than the thread owning this scope or {@code target}. */ - sealed interface Handle permits ResourceScopeImpl.HandleImpl { - - /** - * Returns the resource scope associated with this handle. - * @return the resource scope associated with this handle. - */ - ResourceScope scope(); - } + void keepAlive(ResourceScope target); /** - * Create a new confined scope. The resulting scope is closeable, and is not managed by a {@link Cleaner}. + * Creates a new confined scope. * @return a new confined scope. */ static ResourceScope newConfinedScope() { - return ResourceScopeImpl.createConfined( null); + return ResourceScopeImpl.createConfined(Thread.currentThread(), null); } /** - * Create a new confined scope managed by a {@link Cleaner}. + * Creates a new confined scope, managed by the provided cleaner instance. * @param cleaner the cleaner to be associated with the returned scope. * @return a new confined scope, managed by {@code cleaner}. - * @throws NullPointerException if {@code cleaner == null}. */ static ResourceScope newConfinedScope(Cleaner cleaner) { Objects.requireNonNull(cleaner); - return ResourceScopeImpl.createConfined( cleaner); + return ResourceScopeImpl.createConfined(Thread.currentThread(), cleaner); } /** - * Create a new shared scope. The resulting scope is closeable, and is not managed by a {@link Cleaner}. + * Creates a new shared scope. * @return a new shared scope. */ static ResourceScope newSharedScope() { @@ -252,10 +227,9 @@ public sealed interface ResourceScope extends AutoCloseable permits ResourceScop } /** - * Create a new shared scope managed by a {@link Cleaner}. + * Creates a new shared scope, managed by the provided cleaner instance. * @param cleaner the cleaner to be associated with the returned scope. * @return a new shared scope, managed by {@code cleaner}. - * @throws NullPointerException if {@code cleaner == null}. */ static ResourceScope newSharedScope(Cleaner cleaner) { Objects.requireNonNull(cleaner); @@ -263,21 +237,20 @@ public sealed interface ResourceScope extends AutoCloseable permits ResourceScop } /** - * Create a new implicit scope. The implicit scope is a managed, shared, and non-closeable scope which only features - * implicit closure. - * Since implicit scopes can only be closed implicitly by the garbage collector, it is recommended that implicit - * scopes are only used in cases where deallocation performance is not a critical concern, to avoid unnecessary - * memory pressure. - * - * @return a new implicit scope. + * Creates a new shared scope, managed by a private {@link Cleaner} instance. Equivalent to (but likely more efficient than) + * the following code: + *
      {@code
      +    newSharedScope(Cleaner.create());
      +     * }
      + * @return a shared scope, managed by a private {@link Cleaner} instance. */ static ResourceScope newImplicitScope() { - return ResourceScopeImpl.createImplicitScope(); + return newSharedScope(CleanerFactory.cleaner()); } /** - * Returns an implicit scope which is assumed to be always alive. - * @return the global scope. + * Returns the global scope. + * @return the global scope. */ static ResourceScope globalScope() { return ResourceScopeImpl.GLOBAL; diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java index f127dc70330..622308da088 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java @@ -25,306 +25,277 @@ package jdk.incubator.foreign; -import jdk.internal.foreign.ArenaAllocator; import jdk.internal.foreign.AbstractMemorySegmentImpl; +import jdk.internal.foreign.ArenaAllocator; import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.foreign.Utils; import java.lang.invoke.VarHandle; import java.lang.reflect.Array; import java.nio.ByteOrder; +import java.nio.charset.StandardCharsets; import java.util.Objects; import java.util.function.Function; -import java.util.stream.Stream; /** * This interface models a memory allocator. Clients implementing this interface * must implement the {@link #allocate(long, long)} method. This interface defines several default methods * which can be useful to create segments from several kinds of Java values such as primitives and arrays. - * This interface can be seen as a thin wrapper around the basic capabilities for creating native segments - * (e.g. {@link MemorySegment#allocateNative(long, long, ResourceScope)}); since {@link SegmentAllocator} is a functional interface, + * This interface can be seen as a thin wrapper around the basic capabilities for + * {@linkplain MemorySegment#allocateNative(long, long, ResourceScope) creating} native segments; + * since {@link SegmentAllocator} is a functional interface, * clients can easily obtain a native allocator by using either a lambda expression or a method reference. *

      - * This interface provides a factory, namely {@link SegmentAllocator#ofScope(ResourceScope)} which can be used to obtain - * a scoped allocator, that is, an allocator which creates segment bound by a given scope. This can be useful - * when working inside a try-with-resources construct: - * - *

      {@code
      -try (ResourceScope scope = ResourceScope.newConfinedScope()) {
      -   SegmentAllocator allocator = SegmentAllocator.ofScope(scope);
      -   ...
      -}
      - * }
      - * - * In addition, this interface also defines factories for commonly used allocators; for instance {@link #arenaAllocator(ResourceScope)} - * and {@link #arenaAllocator(long, ResourceScope)} are arena-style native allocators. Finally {@link #ofSegment(MemorySegment)} - * returns an allocator which wraps a segment (either on-heap or off-heap) and recycles its content upon each new allocation request. + * This interface also defines factories for commonly used allocators: + *
        + *
      • {@link #nativeAllocator(ResourceScope)} creates an allocator which + * {@linkplain MemorySegment#allocateNative(long, long, ResourceScope) allocates} native segments, backed by a given scope;
      • + *
      • {@link #newNativeArena(ResourceScope)} creates a more efficient arena-style native allocator, where memory + * is allocated in bigger blocks, which are then sliced accordingly to fit allocation requests;
      • + *
      • {@link #prefixAllocator(MemorySegment)} creates an allocator which wraps a segment (either on-heap or off-heap) + * and recycles its content upon each new allocation request.
      • + *
      + *

      + * Passing a segment allocator to an API can be especially useful in circumstances where a client wants to communicate where + * the results of a certain operation (performed by the API) should be stored, as a memory segment. For instance, + * {@linkplain CLinker#downcallHandle(FunctionDescriptor) downcall method handles} can accept an additional + * {@link SegmentAllocator} parameter if the underlying native function is known to return a struct by-value. Effectively, + * the allocator parameter tells the linker runtime where to store the return value of the native function. */ @FunctionalInterface public interface SegmentAllocator { /** - * Allocate a block of memory with given layout and initialize it with given byte value. + * Converts a Java string into a UTF-8 encoded, null-terminated C string, + * storing the result into a memory segment. + *

      + * This method always replaces malformed-input and unmappable-character + * sequences with this charset's default replacement byte array. The + * {@link java.nio.charset.CharsetEncoder} class should be used when more + * control over the encoding process is required. + * + * @implSpec the default implementation for this method copies the contents of the provided Java string + * into a new memory segment obtained by calling {@code this.allocate(str.length() + 1)}. + * @param str the Java string to be converted into a C string. + * @return a new native memory segment containing the converted C string. + */ + default MemorySegment allocateUtf8String(String str) { + Objects.requireNonNull(str); + return Utils.toCString(str.getBytes(StandardCharsets.UTF_8), this); + } + + /** + * Allocate a memory segment with given layout and initialize it with given byte value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a byte value. */ - default MemorySegment allocate(ValueLayout layout, byte value) { + default MemorySegment allocate(ValueLayout.OfByte layout, byte value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(byte.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given char value. + * Allocate a memory segment with given layout and initialize it with given char value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a char value. */ - default MemorySegment allocate(ValueLayout layout, char value) { + default MemorySegment allocate(ValueLayout.OfChar layout, char value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(char.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given short value. + * Allocate a memory segment with given layout and initialize it with given short value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a short value. */ - default MemorySegment allocate(ValueLayout layout, short value) { + default MemorySegment allocate(ValueLayout.OfShort layout, short value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(short.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given int value. + * Allocate a memory segment with given layout and initialize it with given int value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a int value. */ - default MemorySegment allocate(ValueLayout layout, int value) { + default MemorySegment allocate(ValueLayout.OfInt layout, int value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(int.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given float value. + * Allocate a memory segment with given layout and initialize it with given float value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a float value. */ - default MemorySegment allocate(ValueLayout layout, float value) { + default MemorySegment allocate(ValueLayout.OfFloat layout, float value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(float.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given long value. + * Allocate a memory segment with given layout and initialize it with given long value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a long value. */ - default MemorySegment allocate(ValueLayout layout, long value) { + default MemorySegment allocate(ValueLayout.OfLong layout, long value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(long.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given double value. + * Allocate a memory segment with given layout and initialize it with given double value. * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize()} does not conform to the size of a double value. */ - default MemorySegment allocate(ValueLayout layout, double value) { + default MemorySegment allocate(ValueLayout.OfDouble layout, double value) { Objects.requireNonNull(layout); - VarHandle handle = layout.varHandle(double.class); + VarHandle handle = layout.varHandle(); MemorySegment addr = allocate(layout); handle.set(addr, value); return addr; } /** - * Allocate a block of memory with given layout and initialize it with given address value + * Allocate a memory segment with given layout and initialize it with given address value * (expressed as an {@link Addressable} instance). - * The address value might be narrowed according to the platform address size (see {@link MemoryLayouts#ADDRESS}). + * The address value might be narrowed according to the platform address size (see {@link ValueLayout#ADDRESS}). * @implSpec the default implementation for this method calls {@code this.allocate(layout)}. * @param layout the layout of the block of memory to be allocated. * @param value the value to be set on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize() != MemoryLayouts.ADDRESS.byteSize()}. */ - default MemorySegment allocate(ValueLayout layout, Addressable value) { + default MemorySegment allocate(ValueLayout.OfAddress layout, Addressable value) { Objects.requireNonNull(value); Objects.requireNonNull(layout); - if (MemoryLayouts.ADDRESS.byteSize() != layout.byteSize()) { - throw new IllegalArgumentException("Layout size mismatch - " + layout.byteSize() + " != " + MemoryLayouts.ADDRESS.byteSize()); - } - return switch ((int)layout.byteSize()) { - case 4 -> allocate(layout, (int)value.address().toRawLongValue()); - case 8 -> allocate(layout, value.address().toRawLongValue()); - default -> throw new UnsupportedOperationException("Unsupported pointer size"); // should not get here - }; + MemorySegment segment = allocate(layout); + layout.varHandle().set(segment, value.address()); + return segment; } /** - * Allocate a block of memory with given layout and initialize it with given byte array. + * Allocate a memory segment with given layout and initialize it with given byte array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a byte value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, byte[] array) { + default MemorySegment allocateArray(ValueLayout.OfByte elementLayout, byte[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } /** - * Allocate a block of memory with given layout and initialize it with given short array. + * Allocate a memory segment with given layout and initialize it with given short array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a short value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, short[] array) { + default MemorySegment allocateArray(ValueLayout.OfShort elementLayout, short[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } /** - * Allocate a block of memory with given layout and initialize it with given char array. + * Allocate a memory segment with given layout and initialize it with given char array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a char value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, char[] array) { + default MemorySegment allocateArray(ValueLayout.OfChar elementLayout, char[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } /** - * Allocate a block of memory with given layout and initialize it with given int array. + * Allocate a memory segment with given layout and initialize it with given int array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a int value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, int[] array) { + default MemorySegment allocateArray(ValueLayout.OfInt elementLayout, int[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } /** - * Allocate a block of memory with given layout and initialize it with given float array. + * Allocate a memory segment with given layout and initialize it with given float array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a float value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, float[] array) { + default MemorySegment allocateArray(ValueLayout.OfFloat elementLayout, float[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } /** - * Allocate a block of memory with given layout and initialize it with given long array. + * Allocate a memory segment with given layout and initialize it with given long array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a long value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, long[] array) { + default MemorySegment allocateArray(ValueLayout.OfLong elementLayout, long[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } /** - * Allocate a block of memory with given layout and initialize it with given double array. + * Allocate a memory segment with given layout and initialize it with given double array. * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. * @param elementLayout the element layout of the array to be allocated. * @param array the array to be copied on the newly allocated memory block. * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code elementLayout.byteSize()} does not conform to the size of a double value. */ - default MemorySegment allocateArray(ValueLayout elementLayout, double[] array) { + default MemorySegment allocateArray(ValueLayout.OfDouble elementLayout, double[] array) { return copyArrayWithSwapIfNeeded(array, elementLayout, MemorySegment::ofArray); } - /** - * Allocate a block of memory with given layout and initialize it with given address array. - * The address value of each array element might be narrowed according to the platform address size (see {@link MemoryLayouts#ADDRESS}). - * @implSpec the default implementation for this method calls {@code this.allocateArray(layout, array.length)}. - * @param elementLayout the element layout of the array to be allocated. - * @param array the array to be copied on the newly allocated memory block. - * @return a segment for the newly allocated memory block. - * @throws IllegalArgumentException if {@code layout.byteSize() != MemoryLayouts.ADDRESS.byteSize()}. - */ - default MemorySegment allocateArray(ValueLayout elementLayout, Addressable[] array) { - Objects.requireNonNull(elementLayout); - Objects.requireNonNull(array); - Stream.of(array).forEach(Objects::requireNonNull); - if (MemoryLayouts.ADDRESS.byteSize() != elementLayout.byteSize()) { - throw new IllegalArgumentException("Layout size mismatch - " + elementLayout.byteSize() + " != " + MemoryLayouts.ADDRESS.byteSize()); - } - return switch ((int)elementLayout.byteSize()) { - case 4 -> copyArrayWithSwapIfNeeded(Stream.of(array) - .mapToInt(a -> (int)a.address().toRawLongValue()).toArray(), - elementLayout, MemorySegment::ofArray); - case 8 -> copyArrayWithSwapIfNeeded(Stream.of(array) - .mapToLong(a -> a.address().toRawLongValue()).toArray(), - elementLayout, MemorySegment::ofArray); - default -> throw new UnsupportedOperationException("Unsupported pointer size"); // should not get here - }; - } - private MemorySegment copyArrayWithSwapIfNeeded(Z array, ValueLayout elementLayout, Function heapSegmentFactory) { Objects.requireNonNull(array); Objects.requireNonNull(elementLayout); - Utils.checkPrimitiveCarrierCompat(array.getClass().componentType(), elementLayout); - MemorySegment addr = allocate(MemoryLayout.sequenceLayout(Array.getLength(array), elementLayout)); - if (elementLayout.byteSize() == 1 || (elementLayout.order() == ByteOrder.nativeOrder())) { - addr.copyFrom(heapSegmentFactory.apply(array)); - } else { - ((AbstractMemorySegmentImpl)addr).copyFromSwap(heapSegmentFactory.apply(array), elementLayout.byteSize()); - } + int size = Array.getLength(array); + MemorySegment addr = allocate(MemoryLayout.sequenceLayout(size, elementLayout)); + MemorySegment.copy(heapSegmentFactory.apply(array), elementLayout, 0, + addr, elementLayout.withOrder(ByteOrder.nativeOrder()), 0, size); return addr; } /** - * Allocate a block of memory with given layout. + * Allocate a memory segment with given layout. * @implSpec the default implementation for this method calls {@code this.allocate(layout.byteSize(), layout.byteAlignment())}. * @param layout the layout of the block of memory to be allocated. * @return a segment for the newly allocated memory block. @@ -335,7 +306,7 @@ public interface SegmentAllocator { } /** - * Allocate a block of memory corresponding to an array with given element layout and size. + * Allocate a memory segment with given element layout and size. * @implSpec the default implementation for this method calls {@code this.allocate(MemoryLayout.sequenceLayout(count, elementLayout))}. * @param elementLayout the array element layout. * @param count the array element count. @@ -347,7 +318,8 @@ public interface SegmentAllocator { } /** - * Allocate a block of memory with given size, with default alignment (1-byte aligned). + * Allocate a memory segment with given size + * and default alignment constraints (1-byte aligned). * @implSpec the default implementation for this method calls {@code this.allocate(bytesSize, 1)}. * @param bytesSize the size (in bytes) of the block of memory to be allocated. * @return a segment for the newly allocated memory block. @@ -357,7 +329,7 @@ public interface SegmentAllocator { } /** - * Allocate a block of memory with given size and alignment constraint. + * Allocate a memory segment with given size and alignment constraints. * @param bytesSize the size (in bytes) of the block of memory to be allocated. * @param bytesAlignment the alignment (in bytes) of the block of memory to be allocated. * @return a segment for the newly allocated memory block. @@ -365,74 +337,91 @@ public interface SegmentAllocator { MemorySegment allocate(long bytesSize, long bytesAlignment); /** - * Returns a native arena-based allocator which allocates a single memory segment, of given size (using malloc), - * and then responds to allocation request by returning different slices of that same segment - * (until no further allocation is possible). - * This can be useful when clients want to perform multiple allocation requests while avoiding the cost associated - * with allocating a new off-heap memory region upon each allocation request. - *

      - * An allocator associated with a shared resource scope is thread-safe and allocation requests may be - * performed concurrently; conversely, if the arena allocator is associated with a confined resource scope, - * allocation requests can only occur from the thread owning the allocator's resource scope. - *

      - * The returned allocator might throw an {@link OutOfMemoryError} if an incoming allocation request exceeds - * the allocator capacity. + * Returns a native unbounded arena-based allocator, with predefined block size and maximum arena size, + * associated with the provided scope. Equivalent to the following code: + *

      {@code
      +    SegmentAllocator.newNativeArena(Long.MAX_VALUE, predefinedBlockSize, scope);
      +     * }
      * - * @param size the size (in bytes) of the allocation arena. - * @param scope the scope associated with the segments returned by this allocator. - * @return a new bounded arena-based allocator - * @throws IllegalArgumentException if {@code size <= 0}. + * @param scope the scope associated with the segments returned by the arena-based allocator. + * @return a new unbounded arena-based allocator * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other * than the thread owning {@code scope}. */ - static SegmentAllocator arenaAllocator(long size, ResourceScope scope) { - Objects.requireNonNull(scope); - return scope.ownerThread() == null ? - new ArenaAllocator.BoundedSharedArenaAllocator(scope, size) : - new ArenaAllocator.BoundedArenaAllocator(scope, size); + static SegmentAllocator newNativeArena(ResourceScope scope) { + return newNativeArena(Long.MAX_VALUE, ArenaAllocator.DEFAULT_BLOCK_SIZE, scope); + } + + /** + * Returns a native unbounded arena-based allocator, with block size set to the specified arena size, associated with + * the provided scope, with given arena size. Equivalent to the following code: + *
      {@code
      +    SegmentAllocator.newNativeArena(arenaSize, arenaSize, scope);
      +     * }
      + * + * @param arenaSize the size (in bytes) of the allocation arena. + * @param scope the scope associated with the segments returned by the arena-based allocator. + * @return a new unbounded arena-based allocator + * @throws IllegalArgumentException if {@code arenaSize <= 0}. + * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other + * than the thread owning {@code scope}. + */ + static SegmentAllocator newNativeArena(long arenaSize, ResourceScope scope) { + return newNativeArena(arenaSize, arenaSize, scope); } /** - * Returns a native unbounded arena-based allocator. + * Returns a native arena-based allocator, associated with the provided scope, with given arena size and block size. *

      - * The returned allocator allocates a memory segment {@code S} of a certain fixed size (using malloc) and then - * responds to allocation requests in one of the following ways: + * The returned allocator {@linkplain MemorySegment#allocateNative(long, ResourceScope) allocates} a memory segment + * {@code S} of the specified block size and then responds to allocation requests in one of the following ways: *

        *
      • if the size of the allocation requests is smaller than the size of {@code S}, and {@code S} has a free * slice {@code S'} which fits that allocation request, return that {@code S'}. *
      • if the size of the allocation requests is smaller than the size of {@code S}, and {@code S} has no free - * slices which fits that allocation request, allocate a new segment {@code S'} (using malloc), which has same size as {@code S} + * slices which fits that allocation request, allocate a new segment {@code S'}, which has same size as {@code S} * and set {@code S = S'}; the allocator then tries to respond to the same allocation request again. - *
      • if the size of the allocation requests is bigger than the size of {@code S}, allocate a new segment {@code S'} - * (using malloc), which has a sufficient size to satisfy the allocation request, and return {@code S'}. + *
      • if the size of the allocation requests is bigger than the size of {@code S}, allocate a new segment {@code S'}, + * which has a sufficient size to satisfy the allocation request, and return {@code S'}. *
      *

      * This segment allocator can be useful when clients want to perform multiple allocation requests while avoiding the * cost associated with allocating a new off-heap memory region upon each allocation request. *

      - * An allocator associated with a shared resource scope is thread-safe and allocation requests may be - * performed concurrently; conversely, if the arena allocator is associated with a confined resource scope, - * allocation requests can only occur from the thread owning the allocator's resource scope. - *

      - * The returned allocator might throw an {@link OutOfMemoryError} if an incoming allocation request exceeds - * the system capacity. + * The returned allocator might throw an {@link OutOfMemoryError} if the total memory allocated with this allocator + * exceeds the arena size, or the system capacity. Furthermore, the returned allocator is not thread safe. + * Concurrent allocation needs to be guarded with synchronization primitives. * - * @param scope the scope associated with the segments returned by this allocator. + * @param arenaSize the size (in bytes) of the allocation arena. + * @param blockSize the block size associated with the arena-based allocator. + * @param scope the scope associated with the segments returned by the arena-based allocator. * @return a new unbounded arena-based allocator + * @throws IllegalArgumentException if {@code blockSize <= 0}, if {@code arenaSize <= 0} or if {@code arenaSize < blockSize}. * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other * than the thread owning {@code scope}. */ - static SegmentAllocator arenaAllocator(ResourceScope scope) { + static SegmentAllocator newNativeArena(long arenaSize, long blockSize, ResourceScope scope) { Objects.requireNonNull(scope); - return scope.ownerThread() == null ? - new ArenaAllocator.UnboundedSharedArenaAllocator(scope) : - new ArenaAllocator.UnboundedArenaAllocator(scope); + if (blockSize <= 0) { + throw new IllegalArgumentException("Invalid block size: " + blockSize); + } + if (arenaSize <= 0 || arenaSize < blockSize) { + throw new IllegalArgumentException("Invalid arena size: " + arenaSize); + } + return new ArenaAllocator(blockSize, arenaSize, scope); } /** * Returns a segment allocator which responds to allocation requests by recycling a single segment; that is, * each new allocation request will return a new slice starting at the segment offset {@code 0} (alignment - * constraints are ignored by this allocator). This can be useful to limit allocation requests in case a client + * constraints are ignored by this allocator), hence the name prefix allocator. + * Equivalent to (but likely more efficient than) the following code: + *

      {@code
      +    MemorySegment segment = ...
      +    SegmentAllocator prefixAllocator = (size, align) -> segment.asSlice(0, size);
      +     * }
      + *

      + * This allocator can be useful to limit allocation requests in case a client * knows that they have fully processed the contents of the allocated segment before the subsequent allocation request * takes place. *

      @@ -442,25 +431,42 @@ public interface SegmentAllocator { * @param segment the memory segment to be recycled by the returned allocator. * @return an allocator which recycles an existing segment upon each new allocation request. */ - static SegmentAllocator ofSegment(MemorySegment segment) { + static SegmentAllocator prefixAllocator(MemorySegment segment) { Objects.requireNonNull(segment); - return (size, align) -> segment.asSlice(0, size); + return (AbstractMemorySegmentImpl)segment; } /** - * Returns a native allocator which responds to allocation requests by allocating new segments - * bound by the given resource scope, using the {@link MemorySegment#allocateNative(long, long, ResourceScope)} - * factory. This code is equivalent (but likely more efficient) to the following: + * Returns a native allocator, associated with the provided scope. Equivalent to (but likely more efficient than) + * the following code: *

      {@code
      -    Resource scope = ...
      -    SegmentAllocator scoped = (size, align) -> MemorySegment.allocateNative(size, align, scope);
      +    ResourceScope scope = ...
      +    SegmentAllocator nativeAllocator = (size, align) -> MemorySegment.allocateNative(size, align, scope);
            * }
      * - * @param scope the resource scope associated with the segments created by the returned allocator. - * @return an allocator which allocates new memory segment bound by the provided resource scope. + * @param scope the scope associated with the returned allocator. + * @return a native allocator, associated with the provided scope. */ - static SegmentAllocator ofScope(ResourceScope scope) { + static SegmentAllocator nativeAllocator(ResourceScope scope) { Objects.requireNonNull(scope); return (ResourceScopeImpl)scope; } + + /** + * Returns a native allocator which allocates segments in independent {@linkplain ResourceScope#newImplicitScope() implicit scopes}. + * Equivalent to (but likely more efficient than) the following code: + *
      {@code
      +    ResourceScope scope = ...
      +    SegmentAllocator implicitAllocator = (size, align) -> MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope());
      +     * }
      + * + * @return a native allocator which allocates segments in independent {@linkplain ResourceScope#newImplicitScope() implicit scopes}. + */ + static SegmentAllocator implicitAllocator() { + class Holder { + static final SegmentAllocator IMPLICIT_ALLOCATOR = (size, align) -> + MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope()); + } + return Holder.IMPLICIT_ALLOCATOR; + } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java index 8b79cb2fb9f..e751830313b 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java @@ -25,31 +25,29 @@ */ package jdk.incubator.foreign; -import java.lang.constant.Constable; import java.lang.constant.ConstantDescs; import java.lang.constant.DynamicConstantDesc; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.OptionalLong; /** * A sequence layout. A sequence layout is used to denote a repetition of a given layout, also called the sequence layout's element layout. - * The repetition count, where it exists (e.g. for finite sequence layouts) is said to be the the sequence layout's element count. + * The repetition count, where it exists (e.g. for finite sequence layouts) is said to be the sequence layout's element count. * A finite sequence layout can be thought of as a group layout where the sequence layout's element layout is repeated a number of times * that is equal to the sequence layout's element count. In other words this layout: * *
      {@code
      -MemoryLayout.sequenceLayout(3, MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN));
      +MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN));
        * }
      * * is equivalent to the following layout: * *
      {@code
       MemoryLayout.structLayout(
      -    MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN),
      -    MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN),
      -    MemoryLayout.valueLayout(32, ByteOrder.BIG_ENDIAN));
      +    ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN),
      +    ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN),
      +    ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN));
        * }
      * *

      @@ -72,13 +70,13 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout private final MemoryLayout elementLayout; SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout) { - this(elemCount, elementLayout, elementLayout.bitAlignment(), Map.of()); + this(elemCount, elementLayout, elementLayout.bitAlignment(), Optional.empty()); } - SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout, long alignment, Map attributes) { + SequenceLayout(OptionalLong elemCount, MemoryLayout elementLayout, long alignment, Optional name) { super(elemCount.isPresent() && AbstractLayout.optSize(elementLayout).isPresent() ? OptionalLong.of(elemCount.getAsLong() * elementLayout.bitSize()) : - OptionalLong.empty(), alignment, attributes); + OptionalLong.empty(), alignment, name); this.elemCount = elemCount; this.elementLayout = elementLayout; } @@ -110,7 +108,7 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout */ public SequenceLayout withElementCount(long elementCount) { AbstractLayout.checkSize(elementCount, true); - return new SequenceLayout(OptionalLong.of(elementCount), elementLayout, alignment, attributes); + return new SequenceLayout(OptionalLong.of(elementCount), elementLayout, alignment, name()); } /** @@ -122,11 +120,11 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout *

      * For instance, given a sequence layout of the kind: *

      {@code
      -    var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, MemoryLayouts.JAVA_INT));
      +    var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT));
            * }
      * calling {@code seq.reshape(2, 6)} will yield the following sequence layout: *
      {@code
      -    var reshapeSeq = MemoryLayout.sequenceLayout(2, MemoryLayout.sequenceLayout(6, MemoryLayouts.JAVA_INT));
      +    var reshapeSeq = MemoryLayout.sequenceLayout(2, MemoryLayout.sequenceLayout(6, ValueLayout.JAVA_INT));
            * }
      *

      * If one of the provided element count is the special value {@code -1}, then the element @@ -151,7 +149,7 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout if (elementCounts.length == 0) { throw new IllegalArgumentException(); } - if (!elementCount().isPresent()) { + if (elementCount().isEmpty()) { throw new UnsupportedOperationException("Cannot reshape a sequence layout whose element count is unspecified"); } SequenceLayout flat = flatten(); @@ -198,11 +196,11 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout * be dropped and their element counts will be incorporated into that of the returned sequence layout. * For instance, given a sequence layout of the kind: *

      {@code
      -    var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, MemoryLayouts.JAVA_INT));
      +    var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT));
            * }
      * calling {@code seq.flatten()} will yield the following sequence layout: *
      {@code
      -    var flattenedSeq = MemoryLayout.sequenceLayout(12, MemoryLayouts.JAVA_INT);
      +    var flattenedSeq = MemoryLayout.sequenceLayout(12, ValueLayout.JAVA_INT);
            * }
      * @return a new sequence layout with the same size as this layout (but, possibly, with different * element count), whose element layout is not a sequence layout. @@ -210,13 +208,12 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout * flattened, does not have an element count. */ public SequenceLayout flatten() { - if (!elementCount().isPresent()) { + if (elementCount().isEmpty()) { throw badUnboundSequenceLayout(); } long count = elementCount().getAsLong(); MemoryLayout elemLayout = elementLayout(); - while (elemLayout instanceof SequenceLayout) { - SequenceLayout elemSeq = (SequenceLayout)elemLayout; + while (elemLayout instanceof SequenceLayout elemSeq) { count = count * elemSeq.elementCount().orElseThrow(this::badUnboundSequenceLayout); elemLayout = elemSeq.elementLayout(); } @@ -241,10 +238,9 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout if (!super.equals(other)) { return false; } - if (!(other instanceof SequenceLayout)) { + if (!(other instanceof SequenceLayout s)) { return false; } - SequenceLayout s = (SequenceLayout)other; return elemCount.equals(s.elemCount) && elementLayout.equals(s.elementLayout); } @@ -254,8 +250,8 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout } @Override - SequenceLayout dup(long alignment, Map attributes) { - return new SequenceLayout(elementCount(), elementLayout, alignment, attributes); + SequenceLayout dup(long alignment, Optional name) { + return new SequenceLayout(elementCount(), elementLayout, alignment, name); } @Override @@ -290,12 +286,4 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout public SequenceLayout withBitAlignment(long alignmentBits) { return (SequenceLayout)super.withBitAlignment(alignmentBits); } - - /** - * {@inheritDoc} - */ - @Override - public SequenceLayout withAttribute(String name, Constable value) { - return (SequenceLayout)super.withAttribute(name, value); - } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SymbolLookup.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SymbolLookup.java index 7f6a3d8110c..5010703ba15 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SymbolLookup.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SymbolLookup.java @@ -26,6 +26,7 @@ package jdk.incubator.foreign; import jdk.internal.access.JavaLangAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; @@ -34,11 +35,11 @@ import java.util.Optional; /** * A symbol lookup. Exposes a lookup operation for searching symbol addresses by name, see {@link SymbolLookup#lookup(String)}. - * A symbol lookup can be used to lookup a symbol in a loaded library. Clients can obtain a {@linkplain #loaderLookup() loader lookup}, + * A symbol lookup can be used to look up a symbol in a loaded library. Clients can obtain a {@linkplain #loaderLookup() loader lookup}, * which can be used to search symbols in libraries loaded by the current classloader (e.g. using {@link System#load(String)}, * or {@link System#loadLibrary(String)}). - * Alternatively, clients can obtain a {@linkplain CLinker#systemLookup() platform-dependent lookup}, to search symbols - * in the standard C library. + * Alternatively, clients can search symbols in the standard C library using a {@link CLinker}, which conveniently + * implements this interface. *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      */ @@ -49,13 +50,15 @@ public interface SymbolLookup { * Looks up a symbol with given name in this lookup. * * @param name the symbol name. - * @return the memory address associated with the symbol (if any). + * @return the lookup symbol (if any). */ - Optional lookup(String name); + Optional lookup(String name); /** * Obtains a symbol lookup suitable to find symbols in native libraries associated with the caller's classloader - * (that is, libraries loaded using {@link System#loadLibrary} or {@link System#load}). + * (that is, libraries loaded using {@link System#loadLibrary} or {@link System#load}). The returned lookup + * returns native symbols backed by a non-closeable, shared scope which keeps the caller's classloader + * reachable. *

      * This method is restricted. * Restricted methods are unsafe, and, if used incorrectly, their use might crash @@ -72,11 +75,13 @@ public interface SymbolLookup { Class caller = Reflection.getCallerClass(); Reflection.ensureNativeAccess(caller); ClassLoader loader = Objects.requireNonNull(caller.getClassLoader()); + ResourceScope loaderScope = ResourceScopeImpl.heapScope(loader); return name -> { Objects.requireNonNull(name); JavaLangAccess javaLangAccess = SharedSecrets.getJavaLangAccess(); MemoryAddress addr = MemoryAddress.ofLong(javaLangAccess.findNative(loader, name)); - return addr == MemoryAddress.NULL? Optional.empty() : Optional.of(addr); + return addr == MemoryAddress.NULL? Optional.empty() : Optional.of(NativeSymbol.ofAddress(name, addr, loaderScope)); }; } + } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/VaList.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/VaList.java new file mode 100644 index 00000000000..7543dac95d0 --- /dev/null +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/VaList.java @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.incubator.foreign; + +import jdk.internal.foreign.abi.SharedUtils; +import jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64VaList; +import jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64VaList; +import jdk.internal.foreign.abi.x64.sysv.SysVVaList; +import jdk.internal.foreign.abi.x64.windows.WinVaList; +import jdk.internal.reflect.CallerSensitive; +import jdk.internal.reflect.Reflection; + +import java.util.Objects; +import java.util.function.Consumer; + +/** + * An interface that models a variable argument list, similar in functionality to a C {@code va_list}. + *

      + * A variable argument list is a stateful cursor used to iterate over a set of arguments. A variable argument list + * can be passed by reference e.g. to a {@linkplain CLinker#downcallHandle(FunctionDescriptor) downcall method handle}. + *

      + * Per the C specification (see C standard 6.5.2.2 Function calls - item 6), + * arguments to variadic calls are erased by way of 'default argument promotions', + * which erases integral types by way of integer promotion (see C standard 6.3.1.1 - item 2), + * and which erases all {@code float} arguments to {@code double}. + *

      + * As such, this interface only supports reading {@code int}, {@code double}, + * and any other type that fits into a {@code long}. + * + * This class is not thread safe, and all accesses should occur within a single thread + * (regardless of the scope associated with the variable arity list). + * + *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} + * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      + */ +sealed public interface VaList extends Addressable permits WinVaList, SysVVaList, LinuxAArch64VaList, MacOsAArch64VaList, SharedUtils.EmptyVaList { + + /** + * Reads the next value as an {@code int} and advances this variable argument list's position. + * + * @param layout the layout of the value to be read. + * @return the {@code int} value read from this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + int nextVarg(ValueLayout.OfInt layout); + + /** + * Reads the next value as a {@code long} and advances this variable argument list's position. + * + * @param layout the layout of the value to be read. + * @return the {@code long} value read from this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + long nextVarg(ValueLayout.OfLong layout); + + /** + * Reads the next value as a {@code double} and advances this variable argument list's position. + * + * @param layout the layout of the value + * @return the {@code double} value read from this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + double nextVarg(ValueLayout.OfDouble layout); + + /** + * Reads the next value as a {@code MemoryAddress} and advances this variable argument list's position. + * + * @param layout the layout of the value to be read. + * @return the {@code MemoryAddress} value read from this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + MemoryAddress nextVarg(ValueLayout.OfAddress layout); + + /** + * Reads the next value as a {@code MemorySegment}, and advances this variable argument list's position. + *

      + * The memory segment returned by this method will be allocated using the given {@link SegmentAllocator}. + * + * @param layout the layout of the value to be read. + * @param allocator the allocator to be used to create a segment where the contents of the variable argument list + * will be copied. + * @return the {@code MemorySegment} value read from this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + MemorySegment nextVarg(GroupLayout layout, SegmentAllocator allocator); + + /** + * Skips a number of elements with the given memory layouts, and advances this variable argument list's position. + * + * @param layouts the layouts of the values to be skipped. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + void skip(MemoryLayout... layouts); + + /** + * Returns the resource scope associated with this variable argument list. + * @return the resource scope associated with this variable argument list. + */ + ResourceScope scope(); + + /** + * Copies this variable argument list at its current position into a new variable argument list associated + * with the same scope as this variable argument list. Copying is useful to + * traverse the variable argument list elements, starting from the current position, without affecting the state + * of the original variable argument list, essentially allowing the elements to be traversed multiple times. + * + * @return a copy of this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + */ + VaList copy(); + + /** + * Returns the memory address associated with this variable argument list. + * @throws IllegalStateException if the scope associated with this variable argument list has been closed, or if access occurs from + * a thread other than the thread owning that scope. + * @return The memory address associated with this variable argument list. + */ + @Override + MemoryAddress address(); + + /** + * Constructs a new variable argument list from a memory address pointing to an existing variable argument list, + * with given resource scope. + *

      + * This method is restricted. + * Restricted methods are unsafe, and, if used incorrectly, their use might crash + * the JVM or, worse, silently result in memory corruption. Thus, clients should refrain from depending on + * restricted methods, and use safe and supported functionalities, where possible. + * + * @param address a memory address pointing to an existing variable argument list. + * @param scope the resource scope to be associated with the returned variable argument list. + * @return a new variable argument list backed by the memory region at {@code address}. + * @throws IllegalStateException if {@code scope} has been already closed, or if access occurs from a thread other + * than the thread owning {@code scope}. + * @throws IllegalCallerException if access to this method occurs from a module {@code M} and the command line option + * {@code --enable-native-access} is either absent, or does not mention the module name {@code M}, or + * {@code ALL-UNNAMED} in case {@code M} is an unnamed module. + */ + @CallerSensitive + static VaList ofAddress(MemoryAddress address, ResourceScope scope) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + Objects.requireNonNull(address); + Objects.requireNonNull(scope); + return SharedUtils.newVaListOfAddress(address, scope); + } + + /** + * Constructs a new variable argument list using a builder (see {@link Builder}), with a given resource scope. + *

      + * If this method needs to allocate native memory, such memory will be managed by the given + * {@linkplain ResourceScope resource scope}, and will be released when the resource scope is {@linkplain ResourceScope#close closed}. + *

      + * Note that when there are no elements added to the created va list, + * this method will return the same as {@link #empty()}. + * + * @param actions a consumer for a builder (see {@link Builder}) which can be used to specify the elements + * of the underlying variable argument list. + * @param scope scope the scope to be associated with the new variable arity list. + * @return a new variable argument list. + * @throws IllegalStateException if the scope associated with {@code allocator} has been already closed, + * or if access occurs from a thread other than the thread owning that scope. + */ + static VaList make(Consumer actions, ResourceScope scope) { + Objects.requireNonNull(actions); + Objects.requireNonNull(scope); + return SharedUtils.newVaList(actions, scope); + } + + /** + * Returns an empty variable argument list, associated with the {@linkplain ResourceScope#globalScope() global} + * scope. The resulting variable argument list does not contain any argument, and throws {@link UnsupportedOperationException} + * on all operations, except for {@link #scope()}, {@link #copy()} and {@link #address()}. + * @return an empty variable argument list. + */ + static VaList empty() { + return SharedUtils.emptyVaList(); + } + + /** + * A builder interface used to construct a variable argument list. + * + *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} + * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      + */ + sealed interface Builder permits WinVaList.Builder, SysVVaList.Builder, LinuxAArch64VaList.Builder, MacOsAArch64VaList.Builder { + + /** + * Writes an {@code int} value to the variable argument list being constructed. + * + * @param layout the layout of the value to be written. + * @param value the {@code int} value to be written. + * @return this builder. + */ + Builder addVarg(ValueLayout.OfInt layout, int value); + + /** + * Writes a {@code long} value to the variable argument list being constructed. + * + * @param layout the layout of the value to be written. + * @param value the {@code long} value to be written. + * @return this builder. + */ + Builder addVarg(ValueLayout.OfLong layout, long value); + + /** + * Writes a {@code double} value to the variable argument list being constructed. + * + * @param layout the layout of the value to be written. + * @param value the {@code double} value to be written. + * @return this builder. + */ + Builder addVarg(ValueLayout.OfDouble layout, double value); + + /** + * Writes an {@code Addressable} value to the variable argument list being constructed. + * + * @param layout the layout of the value to be written. + * @param value the {@code Addressable} value to be written. + * @return this builder. + */ + Builder addVarg(ValueLayout.OfAddress layout, Addressable value); + + /** + * Writes a {@code MemorySegment} value, with given layout, to the variable argument list being constructed. + * + * @param layout the layout of the value to be written. + * @param value the {@code MemorySegment} whose contents will be copied. + * @return this builder. + */ + Builder addVarg(GroupLayout layout, MemorySegment value); + } +} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java index 26271da07da..36a3c6b5b9d 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java @@ -25,19 +25,30 @@ */ package jdk.incubator.foreign; -import java.lang.constant.Constable; +import jdk.internal.foreign.Utils; +import jdk.internal.misc.Unsafe; +import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.Stable; +import sun.invoke.util.Wrapper; + import java.lang.constant.ConstantDescs; import java.lang.constant.DynamicConstantDesc; +import java.lang.invoke.VarHandle; import java.nio.ByteOrder; -import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.OptionalLong; /** * A value layout. A value layout is used to model the memory layout associated with values of basic data types, such as integral types - * (either signed or unsigned) and floating-point types. Each value layout has a size and a byte order (see {@link ByteOrder}). - * + * (either signed or unsigned) and floating-point types. Each value layout has a size, a {@linkplain ByteOrder byte order}) + * and a carrier, that is, the Java type that should be used when {@linkplain MemorySegment#get(OfInt, long) accessing} + * a memory region using the value layout. + *

      + * This class defines useful value layout constants for Java primitive types and addresses. + * The layout constants in this class make implicit alignment and byte-ordering assumption: all layout + * constants in this class are byte-aligned, and their byte order is set to the {@linkplain ByteOrder#nativeOrder() platform default}, + * thus making it easy to work with other APIs, such as arrays and {@link java.nio.ByteBuffer}. *

      * This is a value-based * class; programmers should treat instances that are @@ -52,17 +63,22 @@ import java.util.OptionalLong; * @implSpec * This class is immutable and thread-safe. */ -public final class ValueLayout extends AbstractLayout implements MemoryLayout { +public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { + private final Class carrier; private final ByteOrder order; - ValueLayout(ByteOrder order, long size) { - this(order, size, size, Map.of()); + private static final int ADDRESS_SIZE_BITS = Unsafe.ADDRESS_SIZE * 8; + + ValueLayout(Class carrier, ByteOrder order, long size) { + this(carrier, order, size, size, Optional.empty()); } - ValueLayout(ByteOrder order, long size, long alignment, Map attributes) { - super(OptionalLong.of(size), alignment, attributes); + ValueLayout(Class carrier, ByteOrder order, long size, long alignment, Optional name) { + super(OptionalLong.of(size), alignment, name); + this.carrier = carrier; this.order = order; + checkCarrierSize(carrier, size); } /** @@ -81,7 +97,7 @@ public final class ValueLayout extends AbstractLayout implements MemoryLayout { * @return a new value layout with given byte order. */ public ValueLayout withOrder(ByteOrder order) { - return new ValueLayout(Objects.requireNonNull(order), bitSize(), alignment, attributes); + return new ValueLayout(carrier, Objects.requireNonNull(order), bitSize(), alignment, name()); } @Override @@ -99,29 +115,37 @@ public final class ValueLayout extends AbstractLayout implements MemoryLayout { if (!super.equals(other)) { return false; } - if (!(other instanceof ValueLayout)) { + if (!(other instanceof ValueLayout v)) { return false; } - ValueLayout v = (ValueLayout)other; - return order.equals(v.order) && + return carrier.equals(v.carrier) && + order.equals(v.order) && bitSize() == v.bitSize() && alignment == v.alignment; } + /** + * Returns the carrier associated with this value layout. + * @return the carrier associated with this value layout. + */ + public Class carrier() { + return carrier; + } + @Override public int hashCode() { return Objects.hash(super.hashCode(), order, bitSize(), alignment); } @Override - ValueLayout dup(long alignment, Map attributes) { - return new ValueLayout(order, bitSize(), alignment, attributes); + ValueLayout dup(long alignment, Optional name) { + return new ValueLayout(carrier, order, bitSize(), alignment, name()); } @Override public Optional> describeConstable() { return Optional.of(decorateLayoutConstant(DynamicConstantDesc.ofNamed(ConstantDescs.BSM_INVOKE, "value", - CD_VALUE_LAYOUT, MH_VALUE, bitSize(), order == ByteOrder.BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN))); + CD_VALUE_LAYOUT, MH_VALUE, carrier().describeConstable().get(), order == ByteOrder.BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN))); } //hack: the declarations below are to make javadoc happy; we could have used generics in AbstractLayout @@ -143,11 +167,439 @@ public final class ValueLayout extends AbstractLayout implements MemoryLayout { return (ValueLayout)super.withBitAlignment(alignmentBits); } + static void checkCarrierSize(Class carrier, long size) { + if (!isValidCarrier(carrier)) { + throw new IllegalArgumentException("Invalid carrier: " + carrier.getName()); + } + if (carrier == MemoryAddress.class && size != ADDRESS_SIZE_BITS) { + throw new IllegalArgumentException("Address size mismatch: " + ADDRESS_SIZE_BITS + " != " + size); + } + if (carrier.isPrimitive()) { + int expectedSize = carrier == boolean.class ? 8 : Wrapper.forPrimitiveType(carrier).bitWidth(); + if (size != expectedSize) { + throw new IllegalArgumentException("Carrier size mismatch: " + carrier.getName() + " != " + size); + } + } + } + + static boolean isValidCarrier(Class carrier) { + return carrier == boolean.class + || carrier == byte.class + || carrier == short.class + || carrier == char.class + || carrier == int.class + || carrier == long.class + || carrier == float.class + || carrier == double.class + || carrier == MemoryAddress.class; + } + + @Stable + private VarHandle handle; + + @ForceInline + VarHandle accessHandle() { + if (handle == null) { + // this store to stable field is safe, because return value of 'makeMemoryAccessVarHandle' has stable identity + handle = Utils.makeMemoryAccessVarHandle(this, false); + } + return handle; + } + /** - * {@inheritDoc} + * A value layout whose carrier is {@code boolean.class}. */ - @Override - public ValueLayout withAttribute(String name, Constable value) { - return (ValueLayout)super.withAttribute(name, value); + public static final class OfBoolean extends ValueLayout { + OfBoolean(ByteOrder order) { + super(boolean.class, order, 8); + } + + OfBoolean(ByteOrder order, long alignment, Optional name) { + super(boolean.class, order, 8, alignment, name); + } + + @Override + OfBoolean dup(long alignment, Optional name) { + return new OfBoolean(order(), alignment, name); + } + + @Override + public OfBoolean withName(String name) { + return (OfBoolean)super.withName(name); + } + + @Override + public OfBoolean withBitAlignment(long alignmentBits) { + return (OfBoolean)super.withBitAlignment(alignmentBits); + } + + @Override + public OfBoolean withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfBoolean(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code byte.class}. + */ + public static final class OfByte extends ValueLayout { + OfByte(ByteOrder order) { + super(byte.class, order, 8); + } + + OfByte(ByteOrder order, long alignment, Optional name) { + super(byte.class, order, 8, alignment, name); + } + + @Override + OfByte dup(long alignment, Optional name) { + return new OfByte(order(), alignment, name); + } + + @Override + public OfByte withName(String name) { + return (OfByte)super.withName(name); + } + + @Override + public OfByte withBitAlignment(long alignmentBits) { + return (OfByte)super.withBitAlignment(alignmentBits); + } + + @Override + public OfByte withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfByte(order, alignment, name()); + } } + + /** + * A value layout whose carrier is {@code char.class}. + */ + public static final class OfChar extends ValueLayout { + OfChar(ByteOrder order) { + super(char.class, order, 16); + } + + OfChar(ByteOrder order, long alignment, Optional name) { + super(char.class, order, 16, alignment, name); + } + + @Override + OfChar dup(long alignment, Optional name) { + return new OfChar(order(), alignment, name); + } + + @Override + public OfChar withName(String name) { + return (OfChar)super.withName(name); + } + + @Override + public OfChar withBitAlignment(long alignmentBits) { + return (OfChar)super.withBitAlignment(alignmentBits); + } + + @Override + public OfChar withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfChar(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code short.class}. + */ + public static final class OfShort extends ValueLayout { + OfShort(ByteOrder order) { + super(short.class, order, 16); + } + + OfShort(ByteOrder order, long alignment, Optional name) { + super(short.class, order, 16, alignment, name); + } + + @Override + OfShort dup(long alignment, Optional name) { + return new OfShort(order(), alignment, name); + } + + @Override + public OfShort withName(String name) { + return (OfShort)super.withName(name); + } + + @Override + public OfShort withBitAlignment(long alignmentBits) { + return (OfShort)super.withBitAlignment(alignmentBits); + } + + @Override + public OfShort withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfShort(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code int.class}. + */ + public static final class OfInt extends ValueLayout { + OfInt(ByteOrder order) { + super(int.class, order, 32); + } + + OfInt(ByteOrder order, long alignment, Optional name) { + super(int.class, order, 32, alignment, name); + } + + @Override + OfInt dup(long alignment, Optional name) { + return new OfInt(order(), alignment, name); + } + + @Override + public OfInt withName(String name) { + return (OfInt)super.withName(name); + } + + @Override + public OfInt withBitAlignment(long alignmentBits) { + return (OfInt)super.withBitAlignment(alignmentBits); + } + + @Override + public OfInt withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfInt(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code float.class}. + */ + public static final class OfFloat extends ValueLayout { + OfFloat(ByteOrder order) { + super(float.class, order, 32); + } + + OfFloat(ByteOrder order, long alignment, Optional name) { + super(float.class, order, 32, alignment, name); + } + + @Override + OfFloat dup(long alignment, Optional name) { + return new OfFloat(order(), alignment, name); + } + + @Override + public OfFloat withName(String name) { + return (OfFloat)super.withName(name); + } + + @Override + public OfFloat withBitAlignment(long alignmentBits) { + return (OfFloat)super.withBitAlignment(alignmentBits); + } + + @Override + public OfFloat withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfFloat(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code long.class}. + */ + public static final class OfLong extends ValueLayout { + OfLong(ByteOrder order) { + super(long.class, order, 64); + } + + OfLong(ByteOrder order, long alignment, Optional name) { + super(long.class, order, 64, alignment, name); + } + + @Override + OfLong dup(long alignment, Optional name) { + return new OfLong(order(), alignment, name); + } + + @Override + public OfLong withName(String name) { + return (OfLong)super.withName(name); + } + + @Override + public OfLong withBitAlignment(long alignmentBits) { + return (OfLong)super.withBitAlignment(alignmentBits); + } + + @Override + public OfLong withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfLong(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code double.class}. + */ + public static final class OfDouble extends ValueLayout { + OfDouble(ByteOrder order) { + super(double.class, order, 64); + } + + OfDouble(ByteOrder order, long alignment, Optional name) { + super(double.class, order, 64, alignment, name); + } + + @Override + OfDouble dup(long alignment, Optional name) { + return new OfDouble(order(), alignment, name); + } + + @Override + public OfDouble withName(String name) { + return (OfDouble)super.withName(name); + } + + @Override + public OfDouble withBitAlignment(long alignmentBits) { + return (OfDouble)super.withBitAlignment(alignmentBits); + } + + @Override + public OfDouble withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfDouble(order, alignment, name()); + } + } + + /** + * A value layout whose carrier is {@code MemoryAddress.class}. + */ + public static final class OfAddress extends ValueLayout { + OfAddress(ByteOrder order) { + super(MemoryAddress.class, order, ADDRESS_SIZE_BITS); + } + + OfAddress(ByteOrder order, long size, long alignment, Optional name) { + super(MemoryAddress.class, order, size, alignment, name); + } + + @Override + OfAddress dup(long alignment, Optional name) { + return new OfAddress(order(), bitSize(), alignment, name); + } + + @Override + public OfAddress withName(String name) { + return (OfAddress)super.withName(name); + } + + @Override + public OfAddress withBitAlignment(long alignmentBits) { + return (OfAddress)super.withBitAlignment(alignmentBits); + } + + @Override + public OfAddress withOrder(ByteOrder order) { + Objects.requireNonNull(order); + return new OfAddress(order, bitSize(), alignment, name()); + } + } + + /** + * A value layout constant whose size is the same as that of a machine address (e.g. {@code size_t}), + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *

      {@code
      +    MemoryLayout.valueLayout(MemoryAddress.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfAddress ADDRESS = new OfAddress(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code byte}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(byte.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfByte JAVA_BYTE = new OfByte(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code boolean}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(boolean.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfBoolean JAVA_BOOLEAN = new OfBoolean(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code char}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(char.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfChar JAVA_CHAR = new OfChar(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code short}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(short.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfShort JAVA_SHORT = new OfShort(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code int}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(int.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfInt JAVA_INT = new OfInt(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code long}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(long.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfLong JAVA_LONG = new OfLong(ByteOrder.nativeOrder()) + .withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code float}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(float.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfFloat JAVA_FLOAT = new OfFloat(ByteOrder.nativeOrder()).withBitAlignment(8); + + /** + * A value layout constant whose size is the same as that of a Java {@code double}, + * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. + * Equivalent to the following code: + *
      {@code
      +    MemoryLayout.valueLayout(double.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      +     * }
      + */ + public static final OfDouble JAVA_DOUBLE = new OfDouble(ByteOrder.nativeOrder()).withBitAlignment(8); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java index d4d9a9356ce..82bc2f53d4b 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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,12 +30,11 @@ *

      Foreign memory access

      * *

      - * The key abstractions introduced to support foreign memory access are {@link jdk.incubator.foreign.MemorySegment} and {@link jdk.incubator.foreign.MemoryAddress}. - * The first models a contiguous memory region, which can reside either inside or outside the Java heap; the latter models an address - which also can - * reside either inside or outside the Java heap (and can sometimes be expressed as an offset into a given segment). + * The main abstractions introduced to support foreign memory access is {@link jdk.incubator.foreign.MemorySegment}, which + * models a contiguous memory region, which can reside either inside or outside the Java heap. * A memory segment represents the main access coordinate of a memory access var handle, which can be obtained * using the combinator methods defined in the {@link jdk.incubator.foreign.MemoryHandles} class; a set of - * common dereference operations is provided also by the {@link jdk.incubator.foreign.MemoryAccess} class, which can + * common dereference and copy operations is provided also by the {@link jdk.incubator.foreign.MemorySegment} class, which can * be useful for simple, non-structured access. Finally, the {@link jdk.incubator.foreign.MemoryLayout} class * hierarchy enables description of memory layouts and basic operations such as computing the size in bytes of a given * layout, obtain its alignment requirements, and so on. Memory layouts also provide an alternate, more abstract way, to produce @@ -47,16 +46,18 @@ *

      {@code
       MemorySegment segment = MemorySegment.allocateNative(10 * 4, ResourceScope.newImplicitScope());
       for (int i = 0 ; i < 10 ; i++) {
      -   MemoryAccess.setIntAtIndex(segment, i, 42);
      +   segment.setAtIndex(ValueLayout.JAVA_INT, i, i);
       }
        * }
      * - * Here create a native memory segment, that is, a memory segment backed by + * This code creates a native memory segment, that is, a memory segment backed by * off-heap memory; the size of the segment is 40 bytes, enough to store 10 values of the primitive type {@code int}. - * Inside a loop, we then initialize the contents of the memory segment using the - * {@link jdk.incubator.foreign.MemoryAccess#setIntAtIndex(jdk.incubator.foreign.MemorySegment, long, int)} helper method; - * more specifically, if we view the memory segment as a set of 10 adjacent slots, - * {@code s[i]}, where {@code 0 <= i < 10}, where the size of each slot is exactly 4 bytes, the initialization logic above will set each slot + * Inside a loop, we then initialize the contents of the memory segment; note how the + * {@linkplain jdk.incubator.foreign.MemorySegment#setAtIndex(ValueLayout.OfInt, long, int) dereference method} + * accepts a {@linkplain jdk.incubator.foreign.ValueLayout value layout}, which specifies the size, alignment constraints, + * byte order as well as the Java type ({@code int}, in this case) associated with the dereference operation. More specifically, + * if we view the memory segment as a set of 10 adjacent slots, {@code s[i]}, where {@code 0 <= i < 10}, + * where the size of each slot is exactly 4 bytes, the initialization logic above will set each slot * so that {@code s[i] = i}, again where {@code 0 <= i < 10}. * *

      Deterministic deallocation

      @@ -72,7 +73,7 @@ for (int i = 0 ; i < 10 ; i++) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(10 * 4, scope); for (int i = 0 ; i < 10 ; i++) { - MemoryAccess.setIntAtIndex(segment, i, 42); + segment.setAtIndex(ValueLayout.JAVA_INT, i, i); } } * }
    • @@ -96,9 +97,10 @@ try (ResourceScope scope = ResourceScope.newConfinedScope()) { * operation either succeeds - and accesses a valid memory location - or fails. * *

      Foreign function access

      - * The key abstractions introduced to support foreign function access are {@link jdk.incubator.foreign.SymbolLookup} and {@link jdk.incubator.foreign.CLinker}. - * The former is used to lookup symbols inside native libraries; the latter - * provides linking capabilities which allow to model foreign functions as {@link java.lang.invoke.MethodHandle} instances, + * The key abstractions introduced to support foreign function access are {@link jdk.incubator.foreign.SymbolLookup}, + * {@link jdk.incubator.foreign.MemoryAddress} and {@link jdk.incubator.foreign.CLinker}. + * The first is used to lookup symbols inside native libraries; the second is used to model native addresses (more on that later), + * while the third provides linking capabilities which allows modelling foreign functions as {@link java.lang.invoke.MethodHandle} instances, * so that clients can perform foreign function calls directly in Java, without the need for intermediate layers of native * code (as it's the case with the Java Native Interface (JNI)). *

      @@ -106,30 +108,32 @@ try (ResourceScope scope = ResourceScope.newConfinedScope()) { * we can use the following code: * *

      {@code
      -      MethodHandle strlen = CLinker.getInstance().downcallHandle(
      -        CLinker.systemLookup().lookup("strlen").get(),
      -        MethodType.methodType(long.class, MemoryAddress.class),
      -        FunctionDescriptor.of(CLinker.C_LONG, CLinker.C_POINTER)
      +      var linker = CLinker.systemCLinker();
      +      MethodHandle strlen = linker.downcallHandle(
      +        linker.lookup("strlen").get(),
      +        FunctionDescriptor.of(ValueLayout.JAVA_LONG, ValueLayout.ADDRESS)
             );
       
             try (var scope = ResourceScope.newConfinedScope()) {
      -         var cString = CLinker.toCString("Hello", scope);
      -         long len = (long)strlen.invokeExact(cString.address()); // 5
      +         var cString = MemorySegment.allocateNative(5 + 1, scope);
      +         cString.setUtf8String("Hello");
      +         long len = (long)strlen.invoke(cString); // 5
             }
        * }
      * - * Here, we lookup the {@code strlen} symbol in the {@linkplain jdk.incubator.foreign.CLinker#systemLookup() system lookup}. - * Then, we obtain a linker instance (see {@link jdk.incubator.foreign.CLinker#getInstance()}) and we use it to - * obtain a method handle which targets the {@code strlen} library symbol. To complete the linking successfully, - * we must provide (i) a {@link java.lang.invoke.MethodType} instance, describing the type of the resulting method handle - * and (ii) a {@link jdk.incubator.foreign.FunctionDescriptor} instance, describing the signature of the {@code strlen} - * function. From this information, the linker will uniquely determine the sequence of steps which will turn - * the method handle invocation (here performed using {@link java.lang.invoke.MethodHandle#invokeExact(java.lang.Object...)}) - * into a foreign function call, according to the rules specified by the platform C ABI. The {@link jdk.incubator.foreign.CLinker} - * class also provides many useful methods for interacting with native code, such as converting Java strings into - * native strings and viceversa (see {@link jdk.incubator.foreign.CLinker#toCString(java.lang.String, ResourceScope)} and - * {@link jdk.incubator.foreign.CLinker#toJavaString(jdk.incubator.foreign.MemorySegment)}, respectively), as - * demonstrated in the above example. + * Here, we obtain a {@linkplain jdk.incubator.foreign.CLinker#systemCLinker() linker instance} and we use it + * to {@linkplain jdk.incubator.foreign.CLinker#lookup(java.lang.String) lookup} the {@code strlen} symbol in the + * standard C library; a downcall method handle targeting said symbol is subsequently + * {@linkplain jdk.incubator.foreign.CLinker#downcallHandle(jdk.incubator.foreign.FunctionDescriptor) obtained}. + * To complete the linking successfully, we must provide a {@link jdk.incubator.foreign.FunctionDescriptor} instance, + * describing the signature of the {@code strlen} function. + * From this information, the linker will uniquely determine the sequence of steps which will turn + * the method handle invocation (here performed using {@link java.lang.invoke.MethodHandle#invoke(java.lang.Object...)}) + * into a foreign function call, according to the rules specified by the platform C ABI. + * The {@link jdk.incubator.foreign.MemorySegment} class also provides many useful methods for + * interacting with native code, such as converting Java strings + * {@linkplain jdk.incubator.foreign.MemorySegment#setUtf8String(long, java.lang.String) into} native strings and + * {@linkplain jdk.incubator.foreign.MemorySegment#getUtf8String(long) back}, as demonstrated in the above example. * *

      Foreign addresses

      * @@ -138,53 +142,40 @@ try (ResourceScope scope = ResourceScope.newConfinedScope()) { * such pointers have no spatial bounds (example: does the C type {@code char*} refer to a single {@code char} value, * or an array of {@code char} values, of given size?), no notion of temporal bounds, nor thread-confinement. *

      - * When clients receive a {@link jdk.incubator.foreign.MemoryAddress} instance from a foreign function call, it might be - * necessary to obtain a {@link jdk.incubator.foreign.MemorySegment} instance to dereference the memory pointed to by that address. - * To do that, clients can proceed in three different ways, described below. - *

      - * First, if the memory address is known to belong to a segment the client already owns, a rebase operation can be performed; - * in other words, the client can ask the address what its offset relative to a given segment is, and, then, proceed to dereference - * the original segment accordingly, as follows: + * Raw pointers are modelled using the {@link jdk.incubator.foreign.MemoryAddress} class. When clients receive a + * memory address instance from a foreign function call, they can perform memory dereference on it directly, + * using one of the many unsafe + * {@linkplain jdk.incubator.foreign.MemoryAddress#get(jdk.incubator.foreign.ValueLayout.OfInt, long) dereference methods} + * provided: * *

      {@code
      -MemorySegment segment = MemorySegment.allocateNative(100, scope);
       ...
       MemoryAddress addr = ... //obtain address from native code
      -int x = MemoryAccess.getIntAtOffset(segment, addr.segmentOffset(segment));
      +int x = addr.get(ValueLayout.JAVA_INT, 0);
        * }
      * - * Secondly, if the client does not have a segment which contains a given memory address, it can create one unsafely, - * using the {@link jdk.incubator.foreign.MemoryAddress#asSegment(long, ResourceScope)} factory. This allows the client to - * inject extra knowledge about spatial bounds which might, for instance, be available in the documentation of the foreign function - * which produced the native address. Here is how an unsafe segment can be created from a native address: + * Alternatively, the client can + * {@linkplain jdk.incubator.foreign.MemorySegment#ofAddress(jdk.incubator.foreign.MemoryAddress, long, jdk.incubator.foreign.ResourceScope) create} + * a memory segment unsafely. This allows the client to inject extra knowledge about spatial bounds which might, + * for instance, be available in the documentation of the foreign function which produced the native address. + * Here is how an unsafe segment can be created from a native address: * *
      {@code
       ResourceScope scope = ... // initialize a resource scope object
       MemoryAddress addr = ... //obtain address from native code
      -MemorySegment segment = addr.asSegment(4, scope); // segment is 4 bytes long
      -int x = MemoryAccess.getInt(segment);
      - * }
      - * - * Alternatively, the client can fall back to use the so called everything segment - that is, a primordial segment - * which covers the entire native heap. This segment can be obtained by calling the {@link jdk.incubator.foreign.MemorySegment#globalNativeSegment()} - * method, so that dereference can happen without the need of creating any additional segment instances: - * - *
      {@code
      -MemoryAddress addr = ... //obtain address from native code
      -int x = MemoryAccess.getIntAtOffset(MemorySegment.globalNativeSegment(), addr.toRawLongValue());
      +MemorySegment segment = MemorySegment.ofAddress(addr, 4, scope); // segment is 4 bytes long
      +int x = segment.get(ValueLayout.JAVA_INT, 0);
        * }
      * *

      Upcalls

      * The {@link jdk.incubator.foreign.CLinker} interface also allows to turn an existing method handle (which might point - * to a Java method) into a native memory address (see {@link jdk.incubator.foreign.MemoryAddress}), so that Java code - * can effectively be passed to other foreign functions. For instance, we can write a method that compares two - * integer values, as follows: + * to a Java method) into a memory address, so that Java code can effectively be passed to other foreign functions. + * For instance, we can write a method that compares two integer values, as follows: * *
      {@code
       class IntComparator {
           static int intCompare(MemoryAddress addr1, MemoryAddress addr2) {
      -        return MemoryAccess.getIntAtOffset(MemorySegment.globalNativeSegment(), addr1.toRawLongValue()) -
      -               MemoryAccess.getIntAtOffset(MemorySegment.globalNativeSegment(), addr2.toRawLongValue());
      +        return addr1.get(ValueLayout.JAVA_INT, 0) - addr2.get(ValueLayout.JAVA_INT, 0);
           }
       }
        * }
      @@ -194,39 +185,45 @@ class IntComparator { * method, as follows: * *
      {@code
      +FunctionDescriptor intCompareDescriptor = FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS);
       MethodHandle intCompareHandle = MethodHandles.lookup().findStatic(IntComparator.class,
                                                          "intCompare",
      -                                                   MethodType.methodType(int.class, MemoryAddress.class, MemoryAddress.class));
      +                                                   CLinker.upcallType(comparFunction));
        * }
      * - * Now that we have a method handle instance, we can link it into a fresh native memory address, using the {@link jdk.incubator.foreign.CLinker} interface, as follows: + * As before, we need to create a {@link jdk.incubator.foreign.FunctionDescriptor} instance, this time describing the signature + * of the function pointer we want to create. The descriptor can be used to + * {@linkplain jdk.incubator.foreign.CLinker#upcallType(jdk.incubator.foreign.FunctionDescriptor) derive} a method type + * that can be used to lookup the method handle for {@code IntComparator.intCompare}. + *

      + * Now that we have a method handle instance, we can turn it into a fresh function pointer, + * using the {@link jdk.incubator.foreign.CLinker} interface, as follows: * *

      {@code
       ResourceScope scope = ...
      -MemoryAddress comparFunc = CLinker.getInstance().upcallStub(
      -     intCompareHandle,
      -     FunctionDescriptor.of(C_INT, C_POINTER, C_POINTER),
      -     scope
      +Addressable comparFunc = CLinker.systemCLinker().upcallStub(
      +     intCompareHandle, intCompareDescriptor, scope);
       );
        * }
      * - * As before, we need to provide a {@link jdk.incubator.foreign.FunctionDescriptor} instance describing the signature - * of the function pointer we want to create; as before, this, coupled with the method handle type, uniquely determines the - * sequence of steps which will allow foreign code to call {@code intCompareHandle} according to the rules specified - * by the platform C ABI. The lifecycle of the memory address returned by - * {@link jdk.incubator.foreign.CLinker#upcallStub(java.lang.invoke.MethodHandle, jdk.incubator.foreign.FunctionDescriptor, jdk.incubator.foreign.ResourceScope)} - * is tied to the {@linkplain jdk.incubator.foreign.ResourceScope resource scope} parameter passed to that method. + * The {@link jdk.incubator.foreign.FunctionDescriptor} instance created in the previous step is then used to + * {@linkplain jdk.incubator.foreign.CLinker#upcallStub(java.lang.invoke.MethodHandle, jdk.incubator.foreign.FunctionDescriptor, jdk.incubator.foreign.ResourceScope) create} + * a new upcall stub; the layouts in the function descriptors allow the linker to determine the sequence of steps which + * allow foreign code to call the stub for {@code intCompareHandle} according to the rules specified by the platform C ABI. + * The lifecycle of the upcall stub returned by is tied to the {@linkplain jdk.incubator.foreign.ResourceScope resource scope} + * provided when the upcall stub is created. This same scope is made available by the {@link jdk.incubator.foreign.NativeSymbol} + * instance returned by that method. * * *

      Restricted methods

      * Some methods in this package are considered restricted. Restricted methods are typically used to bind native * foreign data and/or functions to first-class Java API elements which can then be used directly by clients. For instance - * the restricted method {@link jdk.incubator.foreign.MemoryAddress#asSegment(long, ResourceScope)} can be used to create - * a fresh segment with given spatial bounds out of a native address. + * the restricted method {@link MemorySegment#ofAddress(MemoryAddress, long, ResourceScope)} + * can be used to create a fresh segment with given spatial bounds out of a native address. *

      * Binding foreign data and/or functions is generally unsafe and, if done incorrectly, can result in VM crashes, or memory corruption when the bound Java API element is accessed. - * For instance, in the case of {@link jdk.incubator.foreign.MemoryAddress#asSegment(long, ResourceScope)}, if the provided - * spatial bounds are incorrect, a client of the segment returned by that method might crash the VM, or corrupt + * For instance, in the case of {@link MemorySegment#ofAddress(MemoryAddress, long, ResourceScope)}, + * if the provided spatial bounds are incorrect, a client of the segment returned by that method might crash the VM, or corrupt * memory when attempting to dereference said segment. For these reasons, it is crucial for code that calls a restricted method * to never pass arguments that might cause incorrect binding of foreign data and/or functions to a Java API. *

      diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractCLinker.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractCLinker.java deleted file mode 100644 index 91a7cbff6c6..00000000000 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractCLinker.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.internal.foreign; - -import jdk.incubator.foreign.Addressable; -import jdk.incubator.foreign.CLinker; -import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemorySegment; -import jdk.incubator.foreign.SegmentAllocator; -import jdk.internal.foreign.abi.SharedUtils; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import java.util.Objects; - -public abstract non-sealed class AbstractCLinker implements CLinker { - - public final MethodHandle downcallHandle(Addressable symbol, MethodType type, FunctionDescriptor function) { - SharedUtils.checkSymbol(symbol); - return MethodHandles.insertArguments(downcallHandle(type, function), 0, symbol); - } - - public final MethodHandle downcallHandle(Addressable symbol, SegmentAllocator allocator, MethodType type, FunctionDescriptor function) { - SharedUtils.checkSymbol(symbol); - Objects.requireNonNull(allocator); - MethodHandle downcall = MethodHandles.insertArguments(downcallHandle(type, function), 0, symbol); - if (type.returnType().equals(MemorySegment.class)) { - downcall = MethodHandles.insertArguments(downcall, 0, allocator); - } - return downcall; - } -} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java index b54ba68f29f..eacbeb26a51 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -36,6 +36,7 @@ import jdk.internal.vm.annotation.ForceInline; import sun.security.action.GetPropertyAction; import java.nio.ByteBuffer; +import java.nio.ByteOrder; import java.util.*; import java.util.function.Consumer; import java.util.function.Function; @@ -43,6 +44,8 @@ import java.util.function.IntFunction; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; + /** * This abstract class provides an immutable implementation for the {@code MemorySegment} interface. This class contains information * about the segment's spatial and temporal bounds; each memory segment implementation is associated with an owner thread which is set at creation time. @@ -52,7 +55,7 @@ import java.util.stream.StreamSupport; * are defined for each memory segment kind, see {@link NativeMemorySegmentImpl}, {@link HeapMemorySegmentImpl} and * {@link MappedMemorySegmentImpl}. */ -public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegmentProxy implements MemorySegment { +public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegmentProxy implements MemorySegment, SegmentAllocator, Scoped { private static final ScopedMemoryAccess SCOPED_MEMORY_ACCESS = ScopedMemoryAccess.getScopedMemoryAccess(); @@ -140,24 +143,9 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment return this; } - public void copyFrom(MemorySegment src) { - AbstractMemorySegmentImpl that = (AbstractMemorySegmentImpl)Objects.requireNonNull(src); - long size = that.byteSize(); - checkAccess(0, size, false); - that.checkAccess(0, size, true); - SCOPED_MEMORY_ACCESS.copyMemory(scope, that.scope, - that.base(), that.min(), - base(), min(), size); - } - - public void copyFromSwap(MemorySegment src, long elemSize) { - AbstractMemorySegmentImpl that = (AbstractMemorySegmentImpl)src; - long size = that.byteSize(); - checkAccess(0, size, false); - that.checkAccess(0, size, true); - SCOPED_MEMORY_ACCESS.copySwapMemory(scope, that.scope, - that.base(), that.min(), - base(), min(), size, elemSize); + @Override + public MemorySegment allocate(long bytesSize, long bytesAlignment) { + return asSlice(0, bytesSize); } @Override @@ -175,7 +163,7 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment long i = 0; if (length > 7) { - if (MemoryAccess.getByte(this) != MemoryAccess.getByte(that)) { + if (get(JAVA_BYTE, 0) != that.get(JAVA_BYTE, 0)) { return 0; } i = vectorizedMismatchLargeForBytes(scope, that.scope, @@ -190,7 +178,7 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment i = length - remaining; } for (; i < length; i++) { - if (MemoryAccess.getByteAtOffset(this, i) != MemoryAccess.getByteAtOffset(that, i)) { + if (get(JAVA_BYTE, i) != that.get(JAVA_BYTE, i)) { return i; } } @@ -230,9 +218,8 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment } @Override - @ForceInline - public final MemoryAddress address() { - return new MemoryAddressImpl(this, 0L); + public MemoryAddress address() { + throw new UnsupportedOperationException("Cannot obtain address of on-heap segment"); } @Override @@ -269,6 +256,33 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment return false; } + @Override + public final MemorySegment asOverlappingSlice(MemorySegment other) { + AbstractMemorySegmentImpl that = (AbstractMemorySegmentImpl)Objects.requireNonNull(other); + if (base() == that.base()) { // both either native or heap + final long thisStart = this.min(); + final long thatStart = that.min(); + final long thisEnd = thisStart + this.byteSize(); + final long thatEnd = thatStart + that.byteSize(); + + if (thisStart < thatEnd && thisEnd > thatStart) { //overlap occurs + long offsetToThat = this.segmentOffset(that); + long newOffset = offsetToThat >= 0 ? offsetToThat : 0; + return asSlice(newOffset, Math.min(this.byteSize() - newOffset, that.byteSize() + offsetToThat)); + } + } + return null; + } + + @Override + public final long segmentOffset(MemorySegment other) { + AbstractMemorySegmentImpl that = (AbstractMemorySegmentImpl) Objects.requireNonNull(other); + if (base() == that.base()) { + return that.min() - this.min(); + } + throw new UnsupportedOperationException("Cannot compute offset from native to heap (or vice versa)."); + } + @Override public void load() { throw new UnsupportedOperationException("Not a mapped segment"); @@ -290,45 +304,45 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment } @Override - public final byte[] toByteArray() { - return toArray(byte[].class, 1, byte[]::new, MemorySegment::ofArray); + public final byte[] toArray(ValueLayout.OfByte elementLayout) { + return toArray(byte[].class, elementLayout, byte[]::new, MemorySegment::ofArray); } @Override - public final short[] toShortArray() { - return toArray(short[].class, 2, short[]::new, MemorySegment::ofArray); + public final short[] toArray(ValueLayout.OfShort elementLayout) { + return toArray(short[].class, elementLayout, short[]::new, MemorySegment::ofArray); } @Override - public final char[] toCharArray() { - return toArray(char[].class, 2, char[]::new, MemorySegment::ofArray); + public final char[] toArray(ValueLayout.OfChar elementLayout) { + return toArray(char[].class, elementLayout, char[]::new, MemorySegment::ofArray); } @Override - public final int[] toIntArray() { - return toArray(int[].class, 4, int[]::new, MemorySegment::ofArray); + public final int[] toArray(ValueLayout.OfInt elementLayout) { + return toArray(int[].class, elementLayout, int[]::new, MemorySegment::ofArray); } @Override - public final float[] toFloatArray() { - return toArray(float[].class, 4, float[]::new, MemorySegment::ofArray); + public final float[] toArray(ValueLayout.OfFloat elementLayout) { + return toArray(float[].class, elementLayout, float[]::new, MemorySegment::ofArray); } @Override - public final long[] toLongArray() { - return toArray(long[].class, 8, long[]::new, MemorySegment::ofArray); + public final long[] toArray(ValueLayout.OfLong elementLayout) { + return toArray(long[].class, elementLayout, long[]::new, MemorySegment::ofArray); } @Override - public final double[] toDoubleArray() { - return toArray(double[].class, 8, double[]::new, MemorySegment::ofArray); + public final double[] toArray(ValueLayout.OfDouble elementLayout) { + return toArray(double[].class, elementLayout, double[]::new, MemorySegment::ofArray); } - private Z toArray(Class arrayClass, int elemSize, IntFunction arrayFactory, Function segmentFactory) { - int size = checkArraySize(arrayClass.getSimpleName(), elemSize); + private Z toArray(Class arrayClass, ValueLayout elemLayout, IntFunction arrayFactory, Function segmentFactory) { + int size = checkArraySize(arrayClass.getSimpleName(), (int)elemLayout.byteSize()); Z arr = arrayFactory.apply(size); MemorySegment arrSegment = segmentFactory.apply(arr); - arrSegment.copyFrom(this); + MemorySegment.copy(this, elemLayout, 0, arrSegment, elemLayout.withOrder(ByteOrder.nativeOrder()), 0, size); return arr; } @@ -382,11 +396,12 @@ public abstract non-sealed class AbstractMemorySegmentImpl extends MemorySegment private void checkBounds(long offset, long length) { if (isSmall() && - offset < Integer.MAX_VALUE && length < Integer.MAX_VALUE && - offset > Integer.MIN_VALUE && length > Integer.MIN_VALUE) { + offset <= Integer.MAX_VALUE && length <= Integer.MAX_VALUE && + offset >= Integer.MIN_VALUE && length >= Integer.MIN_VALUE) { checkBoundsSmall((int)offset, (int)length); - } else { - if (length < 0 || + } else if (this != NativeMemorySegmentImpl.EVERYTHING) { // oob not possible for everything segment + if ( + length < 0 || offset < 0 || offset > this.length - length) { // careful of overflow throw outOfBoundException(offset, length); diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ArenaAllocator.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ArenaAllocator.java index 8a8474a3be5..009ea6c703d 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ArenaAllocator.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ArenaAllocator.java @@ -29,14 +29,23 @@ import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.ResourceScope; -public abstract class ArenaAllocator implements SegmentAllocator { +public final class ArenaAllocator implements SegmentAllocator { - protected MemorySegment segment; + public static final long DEFAULT_BLOCK_SIZE = 4 * 1024; - protected long sp = 0L; + private MemorySegment segment; - ArenaAllocator(MemorySegment segment) { - this.segment = segment; + private long sp = 0L; + private long size = 0; + private final long blockSize; + private final long arenaSize; + private final ResourceScope scope; + + public ArenaAllocator(long blockSize, long arenaSize, ResourceScope scope) { + this.blockSize = blockSize; + this.arenaSize = arenaSize; + this.scope = scope; + this.segment = newSegment(blockSize, 1); } MemorySegment trySlice(long bytesSize, long bytesAlignment) { @@ -51,99 +60,37 @@ public abstract class ArenaAllocator implements SegmentAllocator { } } - void checkConfinementIfNeeded() { - Thread ownerThread = scope().ownerThread(); - if (ownerThread != null && ownerThread != Thread.currentThread()) { - throw new IllegalStateException("Attempt to allocate outside confinement thread"); - } + public ResourceScope scope() { + return scope; } - ResourceScope scope() { - return segment.scope(); - } - - public static class UnboundedArenaAllocator extends ArenaAllocator { - - private static final long DEFAULT_BLOCK_SIZE = 4 * 1024; - - public UnboundedArenaAllocator(ResourceScope scope) { - super(MemorySegment.allocateNative(DEFAULT_BLOCK_SIZE, 1, scope)); - } - - private MemorySegment newSegment(long size, long align) { - return MemorySegment.allocateNative(size, align, segment.scope()); - } - - @Override - public MemorySegment allocate(long bytesSize, long bytesAlignment) { - checkConfinementIfNeeded(); - // try to slice from current segment first... - MemorySegment slice = trySlice(bytesSize, bytesAlignment); - if (slice != null) { - return slice; - } else { - long maxPossibleAllocationSize = bytesSize + bytesAlignment - 1; - if (maxPossibleAllocationSize > DEFAULT_BLOCK_SIZE) { - // too big - return newSegment(bytesSize, bytesAlignment); - } else { - // allocate a new segment and slice from there - sp = 0L; - segment = newSegment(DEFAULT_BLOCK_SIZE, 1L); - return trySlice(bytesSize, bytesAlignment); - } - } + private MemorySegment newSegment(long bytesSize, long bytesAlignment) { + long allocatedSize = Utils.alignUp(bytesSize, bytesAlignment); + if (size + allocatedSize > arenaSize) { + throw new OutOfMemoryError(); } + size += allocatedSize; + return MemorySegment.allocateNative(bytesSize, bytesAlignment, scope); } - public static class BoundedArenaAllocator extends ArenaAllocator { - - public BoundedArenaAllocator(ResourceScope scope, long size) { - super(MemorySegment.allocateNative(size, 1, scope)); - } - - @Override - public MemorySegment allocate(long bytesSize, long bytesAlignment) { - checkConfinementIfNeeded(); - // try to slice from current segment first... - MemorySegment slice = trySlice(bytesSize, bytesAlignment); - if (slice != null) { - return slice; + @Override + public MemorySegment allocate(long bytesSize, long bytesAlignment) { + // try to slice from current segment first... + MemorySegment slice = trySlice(bytesSize, bytesAlignment); + if (slice != null) { + return slice; + } else { + long maxPossibleAllocationSize = bytesSize + bytesAlignment - 1; + if (maxPossibleAllocationSize > blockSize) { + // too big + return newSegment(bytesSize, bytesAlignment); } else { - throw new OutOfMemoryError("Not enough space left to allocate"); - } - } - } - - public static class BoundedSharedArenaAllocator extends BoundedArenaAllocator { - public BoundedSharedArenaAllocator(ResourceScope scope, long size) { - super(scope, size); - } - - @Override - public synchronized MemorySegment allocate(long bytesSize, long bytesAlignment) { - return super.allocate(bytesSize, bytesAlignment); - } - } - - public static class UnboundedSharedArenaAllocator implements SegmentAllocator { - - final ResourceScope scope; - - final ThreadLocal allocators = new ThreadLocal<>() { - @Override - protected ArenaAllocator initialValue() { - return new UnboundedArenaAllocator(scope); + // allocate a new segment and slice from there + sp = 0L; + segment = newSegment(blockSize, 1L); + slice = trySlice(bytesSize, bytesAlignment); + return slice; } - }; - - public UnboundedSharedArenaAllocator(ResourceScope scope) { - this.scope = scope; - } - - @Override - public MemorySegment allocate(long bytesSize, long bytesAlignment) { - return allocators.get().allocate(bytesSize, bytesAlignment); } } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/CABI.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/CABI.java index 977a8755210..24abdede3be 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/CABI.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/CABI.java @@ -25,9 +25,7 @@ */ package jdk.internal.foreign; -import sun.security.action.GetPropertyAction; - -import static jdk.incubator.foreign.MemoryLayouts.ADDRESS; +import static jdk.incubator.foreign.ValueLayout.ADDRESS; import static sun.security.action.GetPropertyAction.privilegedGetProperty; public enum CABI { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ConfinedScope.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ConfinedScope.java index 16749105bd1..ac8850258c1 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ConfinedScope.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ConfinedScope.java @@ -25,11 +25,11 @@ package jdk.internal.foreign; -import jdk.incubator.foreign.ResourceScope; import jdk.internal.vm.annotation.ForceInline; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; import java.lang.ref.Cleaner; -import java.lang.ref.Reference; /** * A confined scope, which features an owner thread. The liveness check features an additional @@ -41,10 +41,21 @@ final class ConfinedScope extends ResourceScopeImpl { private boolean closed; // = false private int lockCount = 0; + private int asyncReleaseCount = 0; private final Thread owner; + static final VarHandle ASYNC_RELEASE_COUNT; + + static { + try { + ASYNC_RELEASE_COUNT = MethodHandles.lookup().findVarHandle(ConfinedScope.class, "asyncReleaseCount", int.class); + } catch (Throwable ex) { + throw new ExceptionInInitializerError(ex); + } + } + public ConfinedScope(Thread owner, Cleaner cleaner) { - super(cleaner, new ConfinedResourceList()); + super(new ConfinedResourceList(), cleaner); this.owner = owner; } @@ -64,18 +75,35 @@ final class ConfinedScope extends ResourceScopeImpl { } @Override - public HandleImpl acquire() { + @ForceInline + public void acquire0() { checkValidState(); + if (lockCount == MAX_FORKS) { + throw new IllegalStateException("Scope keep alive limit exceeded"); + } lockCount++; - return new ConfinedHandle(); + } + + @Override + @ForceInline + public void release0() { + if (Thread.currentThread() == owner) { + lockCount--; + } else { + // It is possible to end up here in two cases: this scope was kept alive by some other confined scope + // which is implicitly released (in which case the release call comes from the cleaner thread). Or, + // this scope might be kept alive by a shared scope, which means the release call can come from any + // thread. + ASYNC_RELEASE_COUNT.getAndAdd(this, 1); + } } void justClose() { this.checkValidState(); - if (lockCount == 0) { + if (lockCount == 0 || lockCount - ((int)ASYNC_RELEASE_COUNT.getVolatile(this)) == 0) { closed = true; } else { - throw new IllegalStateException("Scope is acquired by " + lockCount + " locks"); + throw new IllegalStateException("Scope is kept alive by " + lockCount + " scopes"); } } @@ -109,25 +137,4 @@ final class ConfinedScope extends ResourceScopeImpl { } } } - - /** - * A confined resource scope handle; no races are possible here. - */ - final class ConfinedHandle implements HandleImpl { - boolean released = false; - - @Override - public ResourceScopeImpl scope() { - return ConfinedScope.this; - } - - @Override - public void release() { - checkValidState(); // thread check - if (!released) { - released = true; - lockCount--; - } - } - } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/LayoutPath.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/LayoutPath.java index 346e6882a45..1d8bb265c83 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/LayoutPath.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/LayoutPath.java @@ -28,8 +28,6 @@ package jdk.internal.foreign; import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; -import jdk.internal.access.JavaLangInvokeAccess; -import jdk.internal.access.SharedSecrets; import jdk.internal.access.foreign.MemorySegmentProxy; import jdk.incubator.foreign.GroupLayout; @@ -53,12 +51,10 @@ import java.util.function.UnaryOperator; * (see {@link #sequenceElement()}, {@link #sequenceElement(long)}, {@link #sequenceElement(long, long)}, {@link #groupElement(String)}). * Once a path has been fully constructed, clients can ask for the offset associated with the layout element selected * by the path (see {@link #offset}), or obtain a memory access var handle to access the selected layout element - * given an address pointing to a segment associated with the root layout (see {@link #dereferenceHandle(Class)}). + * given an address pointing to a segment associated with the root layout (see {@link #dereferenceHandle()}). */ public class LayoutPath { - private static final JavaLangInvokeAccess JLI = SharedSecrets.getJavaLangInvokeAccess(); - private static final MethodHandle ADD_STRIDE; private static final MethodHandle MH_ADD_SCALED_OFFSET; private static final MethodHandle MH_SLICE; @@ -156,8 +152,10 @@ public class LayoutPath { return offset; } - public VarHandle dereferenceHandle(Class carrier) { - Utils.checkPrimitiveCarrierCompat(carrier, layout); + public VarHandle dereferenceHandle() { + if (!(layout instanceof ValueLayout valueLayout)) { + throw new IllegalArgumentException("Path does not select a value layout"); + } checkAlignment(this); List> expectedCoordinates = new ArrayList<>(); @@ -165,8 +163,7 @@ public class LayoutPath { perms.addFirst(0); expectedCoordinates.add(MemorySegment.class); - VarHandle handle = Utils.fixUpVarHandle(JLI.memoryAccessVarHandle(carrier, true, layout.byteAlignment() - 1, - ((ValueLayout)layout).order())); + VarHandle handle = Utils.makeMemoryAccessVarHandle(valueLayout, true); for (int i = 0 ; i < strides.length ; i++) { expectedCoordinates.add(long.class); @@ -226,15 +223,13 @@ public class LayoutPath { MemoryLayout newLayout = op.apply(layout); if (enclosing == null) { return newLayout; - } else if (enclosing.layout instanceof SequenceLayout) { - SequenceLayout seq = (SequenceLayout)enclosing.layout; + } else if (enclosing.layout instanceof SequenceLayout seq) { if (seq.elementCount().isPresent()) { return enclosing.map(l -> dup(l, MemoryLayout.sequenceLayout(seq.elementCount().getAsLong(), newLayout))); } else { return enclosing.map(l -> dup(l, MemoryLayout.sequenceLayout(newLayout))); } - } else if (enclosing.layout instanceof GroupLayout) { - GroupLayout g = (GroupLayout)enclosing.layout; + } else if (enclosing.layout instanceof GroupLayout g) { List newElements = new ArrayList<>(g.memberLayouts()); //if we selected a layout in a group we must have a valid index newElements.set((int)elementIndex, newLayout); diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/MemoryAddressImpl.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/MemoryAddressImpl.java index 2330feefd4e..59d7105082c 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/MemoryAddressImpl.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/MemoryAddressImpl.java @@ -25,128 +25,352 @@ */ package jdk.internal.foreign; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; +import jdk.internal.foreign.abi.SharedUtils; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; -import jdk.incubator.foreign.ResourceScope; -import java.util.Objects; +import jdk.internal.vm.annotation.ForceInline; /** * This class provides an immutable implementation for the {@code MemoryAddress} interface. This class contains information * about the segment this address is associated with, as well as an offset into such segment. */ -public final class MemoryAddressImpl implements MemoryAddress { +public final class MemoryAddressImpl implements MemoryAddress, Scoped { - private final AbstractMemorySegmentImpl segment; private final long offset; - public MemoryAddressImpl(AbstractMemorySegmentImpl segment, long offset) { - this.segment = segment; + public MemoryAddressImpl(long offset) { this.offset = offset; } - Object base() { - return segment != null ? segment.base() : null; + // MemoryAddress methods + + @Override + public MemoryAddress addOffset(long offset) { + return new MemoryAddressImpl(this.offset + offset); } - long offset() { - return segment != null ? - segment.min() + offset : offset; + @Override + public long toRawLongValue() { + return offset; } - // MemoryAddress methods + @Override + public final MemoryAddress address() { + return this; + } + + // Object methods + + @Override + public int hashCode() { + return (int) toRawLongValue(); + } + + @Override + public boolean equals(Object that) { + return (that instanceof MemoryAddressImpl addressImpl && + offset == addressImpl.offset); + } + + @Override + public String toString() { + return "MemoryAddress{ offset=0x" + Long.toHexString(offset) + " }"; + } + + public static MemorySegment ofLongUnchecked(long value) { + return ofLongUnchecked(value, Long.MAX_VALUE); + } + + public static MemorySegment ofLongUnchecked(long value, long byteSize, ResourceScopeImpl resourceScope) { + return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(MemoryAddress.ofLong(value), byteSize, resourceScope); + } + + public static MemorySegment ofLongUnchecked(long value, long byteSize) { + return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(MemoryAddress.ofLong(value), byteSize, ResourceScopeImpl.GLOBAL); + } @Override public ResourceScope scope() { - return segment != null ? - segment.scope() : ResourceScope.globalScope(); + return ResourceScopeImpl.GLOBAL; } @Override - public MemoryAddress addOffset(long offset) { - return new MemoryAddressImpl(segment, this.offset + offset); + @CallerSensitive + @ForceInline + public String getUtf8String(long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + SharedUtils.checkAddress(this); + return NativeMemorySegmentImpl.EVERYTHING.getUtf8String(toRawLongValue() + offset); } @Override - public long segmentOffset(MemorySegment segment) { - Objects.requireNonNull(segment); - AbstractMemorySegmentImpl segmentImpl = (AbstractMemorySegmentImpl)segment; - if (segmentImpl.base() != base()) { - throw new IllegalArgumentException("Incompatible segment: " + segment); - } - return offset() - segmentImpl.min(); + @CallerSensitive + @ForceInline + public void setUtf8String(long offset, String str) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + SharedUtils.checkAddress(this); + NativeMemorySegmentImpl.EVERYTHING.setUtf8String(toRawLongValue() + offset, str); } @Override - public boolean isNative() { - return base() == null; + @ForceInline + @CallerSensitive + public byte get(ValueLayout.OfByte layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); } @Override - public long toRawLongValue() { - if (segment != null) { - if (segment.base() != null) { - throw new UnsupportedOperationException("Not a native address"); - } - segment.checkValidState(); - } - return offset(); + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfByte layout, long offset, byte value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); } - // Object methods + @Override + @ForceInline + @CallerSensitive + public boolean get(ValueLayout.OfBoolean layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); + } @Override - public int hashCode() { - return Objects.hash(base(), offset()); + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfBoolean layout, long offset, boolean value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); } @Override - public boolean equals(Object that) { - if (that instanceof MemoryAddressImpl) { - MemoryAddressImpl addr = (MemoryAddressImpl)that; - return Objects.equals(base(), addr.base()) && - offset() == addr.offset(); - } else { - return false; - } + @ForceInline + @CallerSensitive + public char get(ValueLayout.OfChar layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); } @Override - public String toString() { - return "MemoryAddress{ base: " + base() + " offset=0x" + Long.toHexString(offset()) + " }"; + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfChar layout, long offset, char value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); } @Override + @ForceInline @CallerSensitive - public final MemorySegment asSegment(long bytesSize, ResourceScope scope) { + public short get(ValueLayout.OfShort layout, long offset) { Reflection.ensureNativeAccess(Reflection.getCallerClass()); - return asSegment(bytesSize, null, scope); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); } @Override + @ForceInline @CallerSensitive - public final MemorySegment asSegment(long bytesSize, Runnable cleanupAction, ResourceScope scope) { + public void set(ValueLayout.OfShort layout, long offset, short value) { Reflection.ensureNativeAccess(Reflection.getCallerClass()); - Objects.requireNonNull(scope); - if (bytesSize <= 0) { - throw new IllegalArgumentException("Invalid size : " + bytesSize); - } - return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(this, bytesSize, - cleanupAction, - (ResourceScopeImpl) scope); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); } - public static MemorySegment ofLongUnchecked(long value) { - return ofLongUnchecked(value, Long.MAX_VALUE); + @Override + @ForceInline + @CallerSensitive + public int get(ValueLayout.OfInt layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); } - public static MemorySegment ofLongUnchecked(long value, long byteSize, ResourceScopeImpl resourceScope) { - return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(MemoryAddress.ofLong(value), byteSize, null, resourceScope); + @Override + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfInt layout, long offset, int value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); } - public static MemorySegment ofLongUnchecked(long value, long byteSize) { - return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(MemoryAddress.ofLong(value), byteSize, null, ResourceScopeImpl.GLOBAL); + @Override + @ForceInline + @CallerSensitive + public float get(ValueLayout.OfFloat layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); + } + + @Override + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfFloat layout, long offset, float value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); + } + + @Override + @ForceInline + @CallerSensitive + public long get(ValueLayout.OfLong layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); + } + + @Override + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfLong layout, long offset, long value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); + } + + @Override + @ForceInline + @CallerSensitive + public double get(ValueLayout.OfDouble layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); + } + + @Override + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfDouble layout, long offset, double value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value); + } + + @Override + @ForceInline + @CallerSensitive + public MemoryAddress get(ValueLayout.OfAddress layout, long offset) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + offset); + } + + @Override + @ForceInline + @CallerSensitive + public void set(ValueLayout.OfAddress layout, long offset, Addressable value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + offset, value.address()); + } + + @Override + @ForceInline + @CallerSensitive + public char getAtIndex(ValueLayout.OfChar layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfChar layout, long index, char value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value); + } + + @Override + @ForceInline + @CallerSensitive + public short getAtIndex(ValueLayout.OfShort layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfShort layout, long index, short value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value); + } + + @Override + @ForceInline + @CallerSensitive + public int getAtIndex(ValueLayout.OfInt layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfInt layout, long index, int value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value); + } + + @Override + @ForceInline + @CallerSensitive + public float getAtIndex(ValueLayout.OfFloat layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfFloat layout, long index, float value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value); + } + + @Override + @ForceInline + @CallerSensitive + public long getAtIndex(ValueLayout.OfLong layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfLong layout, long index, long value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value); + } + + @Override + @ForceInline + @CallerSensitive + public double getAtIndex(ValueLayout.OfDouble layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfDouble layout, long index, double value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value); + } + + @Override + @ForceInline + @CallerSensitive + public MemoryAddress getAtIndex(ValueLayout.OfAddress layout, long index) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + return NativeMemorySegmentImpl.EVERYTHING.get(layout, toRawLongValue() + (index * layout.byteSize())); + } + + @Override + @ForceInline + @CallerSensitive + public void setAtIndex(ValueLayout.OfAddress layout, long index, Addressable value) { + Reflection.ensureNativeAccess(Reflection.getCallerClass()); + NativeMemorySegmentImpl.EVERYTHING.set(layout, toRawLongValue() + (index * layout.byteSize()), value.address()); } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java index 8d61c9b79b5..11f795a2f84 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java @@ -28,8 +28,6 @@ package jdk.internal.foreign; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; -import jdk.incubator.foreign.ResourceScope; -import jdk.incubator.foreign.SegmentAllocator; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; import jdk.internal.vm.annotation.ForceInline; @@ -43,12 +41,10 @@ import java.nio.ByteBuffer; */ public class NativeMemorySegmentImpl extends AbstractMemorySegmentImpl { - public static final MemorySegment EVERYTHING = makeNativeSegmentUnchecked(MemoryAddress.NULL, Long.MAX_VALUE, null, ResourceScopeImpl.GLOBAL); + public static final MemorySegment EVERYTHING = makeNativeSegmentUnchecked(MemoryAddress.NULL, Long.MAX_VALUE, ResourceScopeImpl.GLOBAL); private static final Unsafe unsafe = Unsafe.getUnsafe(); - public static final SegmentAllocator IMPLICIT_ALLOCATOR = (size, align) -> MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope()); - // The maximum alignment supported by malloc - typically 16 on // 64-bit platforms and 8 on 32-bit platforms. private static final long MAX_MALLOC_ALIGN = Unsafe.ADDRESS_SIZE == 4 ? 8 : 16; @@ -63,6 +59,13 @@ public class NativeMemorySegmentImpl extends AbstractMemorySegmentImpl { this.min = min; } + @ForceInline + @Override + public MemoryAddress address() { + checkValidState(); + return MemoryAddress.ofLong(unsafeGetOffset()); + } + @Override NativeMemorySegmentImpl dup(long offset, long size, int mask, ResourceScopeImpl scope) { return new NativeMemorySegmentImpl(min + offset, size, mask, scope); @@ -123,12 +126,9 @@ public class NativeMemorySegmentImpl extends AbstractMemorySegmentImpl { return segment; } - public static MemorySegment makeNativeSegmentUnchecked(MemoryAddress min, long bytesSize, Runnable cleanupAction, ResourceScopeImpl scope) { + public static MemorySegment makeNativeSegmentUnchecked(MemoryAddress min, long bytesSize, ResourceScopeImpl scope) { scope.checkValidStateSlow(); AbstractMemorySegmentImpl segment = new NativeMemorySegmentImpl(min.toRawLongValue(), bytesSize, defaultAccessModes(bytesSize), scope); - if (cleanupAction != null) { - scope.addCloseAction(cleanupAction); - } return segment; } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallHandler.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeSymbolImpl.java similarity index 65% rename from src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallHandler.java rename to src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeSymbolImpl.java index a2e9c3ea2b9..ede6a7ad5f8 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallHandler.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/NativeSymbolImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -18,13 +18,21 @@ * 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 + * 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.internal.foreign; -package jdk.internal.foreign.abi; +import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; -public interface UpcallHandler { - long entryPoint(); +public record NativeSymbolImpl(String name, MemoryAddress address, ResourceScope scope) implements NativeSymbol, Scoped { + @Override + public MemoryAddress address() { + ((ResourceScopeImpl)scope).checkValidState(); + return address; + } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/PlatformLayouts.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/PlatformLayouts.java index c5626f92896..c18de05c1a5 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/PlatformLayouts.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/PlatformLayouts.java @@ -25,14 +25,9 @@ */ package jdk.internal.foreign; -import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.ValueLayout; -import java.nio.ByteOrder; - -import static java.nio.ByteOrder.LITTLE_ENDIAN; - public class PlatformLayouts { public static Z pick(Z sysv, Z win64, Z aarch64) { return switch (CABI.current()) { @@ -42,59 +37,6 @@ public class PlatformLayouts { }; } - public static MemoryLayout asVarArg(MemoryLayout ml) { - return switch (CABI.current()) { - case Win64 -> Win64.asVarArg(ml); - case MacOsAArch64 -> AArch64.asVarArg(ml); - default -> ml; - }; - } - - private static ValueLayout ofChar(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.CHAR); - } - - private static ValueLayout ofShort(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.SHORT); - } - - private static ValueLayout ofInt(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.INT); - } - - private static ValueLayout ofLong(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.LONG); - } - - private static ValueLayout ofLongLong(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.LONG_LONG); - } - - private static ValueLayout ofFloat(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.FLOAT); - } - - private static ValueLayout ofDouble(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.DOUBLE); - } - - private static ValueLayout ofPointer(ByteOrder order, long bitSize) { - return MemoryLayout.valueLayout(bitSize, order) - .withAttribute(CLinker.TypeKind.ATTR_NAME, CLinker.TypeKind.POINTER); - } - - public static CLinker.TypeKind getKind(MemoryLayout layout) { - return (CLinker.TypeKind)layout.attribute(CLinker.TypeKind.ATTR_NAME).orElseThrow( - () -> new IllegalStateException("Unexpected value layout: could not determine ABI class")); - } - /** * This class defines layout constants modelling standard primitive types supported by the x64 SystemV ABI. */ @@ -103,50 +45,55 @@ public class PlatformLayouts { //just the one } + /** + * The {@code bool} native type. + */ + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + /** * The {@code char} native type. */ - public static final ValueLayout C_CHAR = ofChar(LITTLE_ENDIAN, 8); + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; /** * The {@code short} native type. */ - public static final ValueLayout C_SHORT = ofShort(LITTLE_ENDIAN, 16); + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT.withBitAlignment(16); /** * The {@code int} native type. */ - public static final ValueLayout C_INT = ofInt(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT.withBitAlignment(32); /** * The {@code long} native type. */ - public static final ValueLayout C_LONG = ofLong(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64); /** * The {@code long long} native type. */ - public static final ValueLayout C_LONG_LONG = ofLongLong(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64); /** * The {@code float} native type. */ - public static final ValueLayout C_FLOAT = ofFloat(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT.withBitAlignment(32); /** * The {@code double} native type. */ - public static final ValueLayout C_DOUBLE = ofDouble(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE.withBitAlignment(64); /** * The {@code T*} native type. */ - public static final ValueLayout C_POINTER = ofPointer(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(64); /** * The {@code va_list} native type, as it is passed to a function. */ - public static final MemoryLayout C_VA_LIST = SysV.C_POINTER; + public static final ValueLayout.OfAddress C_VA_LIST = SysV.C_POINTER; } /** @@ -159,64 +106,53 @@ public class PlatformLayouts { } /** - * The name of the layout attribute (see {@link MemoryLayout#attributes()}) used to mark variadic parameters. The - * attribute value must be a boolean. + * The {@code bool} native type. */ - public static final String VARARGS_ATTRIBUTE_NAME = "abi/windows/varargs"; + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; /** * The {@code char} native type. */ - public static final ValueLayout C_CHAR = ofChar(LITTLE_ENDIAN, 8); + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; /** * The {@code short} native type. */ - public static final ValueLayout C_SHORT = ofShort(LITTLE_ENDIAN, 16); + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT.withBitAlignment(16); /** * The {@code int} native type. */ - public static final ValueLayout C_INT = ofInt(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT.withBitAlignment(32); /** * The {@code long} native type. */ - public static final ValueLayout C_LONG = ofLong(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfInt C_LONG = ValueLayout.JAVA_INT.withBitAlignment(32); /** * The {@code long long} native type. */ - public static final ValueLayout C_LONG_LONG = ofLongLong(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64); /** * The {@code float} native type. */ - public static final ValueLayout C_FLOAT = ofFloat(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT.withBitAlignment(32); /** * The {@code double} native type. */ - public static final ValueLayout C_DOUBLE = ofDouble(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE.withBitAlignment(64); /** * The {@code T*} native type. */ - public static final ValueLayout C_POINTER = ofPointer(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(64); /** * The {@code va_list} native type, as it is passed to a function. */ - public static final MemoryLayout C_VA_LIST = Win64.C_POINTER; - - /** - * Return a new memory layout which describes a variadic parameter to be passed to a function. - * @param layout the original parameter layout. - * @return a layout which is the same as {@code layout}, except for the extra attribute {@link #VARARGS_ATTRIBUTE_NAME}, - * which is set to {@code true}. - */ - public static MemoryLayout asVarArg(MemoryLayout layout) { - return layout.withAttribute(VARARGS_ATTRIBUTE_NAME, true); - } + public static final ValueLayout.OfAddress C_VA_LIST = Win64.C_POINTER; } /** @@ -228,69 +164,54 @@ public class PlatformLayouts { //just the one } + /** + * The {@code bool} native type. + */ + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + /** * The {@code char} native type. */ - public static final ValueLayout C_CHAR = ofChar(LITTLE_ENDIAN, 8); + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; /** * The {@code short} native type. */ - public static final ValueLayout C_SHORT = ofShort(LITTLE_ENDIAN, 16); + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT.withBitAlignment(16); /** * The {@code int} native type. */ - public static final ValueLayout C_INT = ofInt(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT.withBitAlignment(32); /** * The {@code long} native type. */ - public static final ValueLayout C_LONG = ofLong(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64); /** * The {@code long long} native type. */ - public static final ValueLayout C_LONG_LONG = ofLongLong(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64); /** * The {@code float} native type. */ - public static final ValueLayout C_FLOAT = ofFloat(LITTLE_ENDIAN, 32); + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT.withBitAlignment(32); /** * The {@code double} native type. */ - public static final ValueLayout C_DOUBLE = ofDouble(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE.withBitAlignment(64); /** * The {@code T*} native type. */ - public static final ValueLayout C_POINTER = ofPointer(LITTLE_ENDIAN, 64); + public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(64); /** * The {@code va_list} native type, as it is passed to a function. */ - public static final MemoryLayout C_VA_LIST = AArch64.C_POINTER; - - /** - * The name of the layout attribute (see {@link MemoryLayout#attributes()}) - * used to mark variadic parameters on systems such as macOS which pass these - * entirely on the stack. The attribute value must be a boolean. - */ - public final static String STACK_VARARGS_ATTRIBUTE_NAME = "abi/aarch64/stack_varargs"; - - /** - * Return a new memory layout which describes a variadic parameter to be - * passed to a function. This is only required on platforms such as macOS - * which pass variadic parameters entirely on the stack. - * @param layout the original parameter layout. - * @return a layout which is the same as {@code layout}, except for - * the extra attribute {@link #STACK_VARARGS_ATTRIBUTE_NAME}, which is set - * to {@code true}. - */ - public static MemoryLayout asVarArg(MemoryLayout layout) { - return layout.withAttribute(STACK_VARARGS_ATTRIBUTE_NAME, true); - } + public static final ValueLayout.OfAddress C_VA_LIST = AArch64.C_POINTER; } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java index ffd225a6b26..dbb830a1b53 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java @@ -30,7 +30,7 @@ import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; import jdk.internal.misc.ScopedMemoryAccess; -import jdk.internal.ref.CleanerFactory; +import jdk.internal.vm.annotation.ForceInline; import java.lang.ref.Cleaner; import java.lang.ref.Reference; @@ -49,9 +49,12 @@ import java.util.Objects; * shared scopes use a more sophisticated synchronization mechanism, which guarantees that no concurrent * access is possible when a scope is being closed (see {@link jdk.internal.misc.ScopedMemoryAccess}). */ -public abstract non-sealed class ResourceScopeImpl implements ResourceScope, ScopedMemoryAccess.Scope, SegmentAllocator { +public abstract non-sealed class ResourceScopeImpl implements ResourceScope, SegmentAllocator, ScopedMemoryAccess.Scope { final ResourceList resourceList; + final Cleaner.Cleanable cleanable; + + static final int MAX_FORKS = Integer.MAX_VALUE; @Override public void addCloseAction(Runnable runnable) { @@ -59,11 +62,6 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Sco addInternal(ResourceList.ResourceCleanup.ofRunnable(runnable)); } - @Override - public boolean isImplicit() { - return false; - } - /** * Add a cleanup action. If a failure occurred (because of a add vs. close race), call the cleanup action. * This semantics is useful when allocating new memory segments, since we first do a malloc/mmap and _then_ @@ -91,72 +89,38 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Sco } } - protected ResourceScopeImpl(Cleaner cleaner, ResourceList resourceList) { + protected ResourceScopeImpl(ResourceList resourceList, Cleaner cleaner) { this.resourceList = resourceList; - if (cleaner != null) { - cleaner.register(this, resourceList); - } - } - - public static ResourceScopeImpl createImplicitScope() { - return new ImplicitScopeImpl(CleanerFactory.cleaner()); + cleanable = (cleaner != null) ? + cleaner.register(this, resourceList) : null; } public static ResourceScopeImpl createConfined(Thread thread, Cleaner cleaner) { return new ConfinedScope(thread, cleaner); } - /** - * Creates a confined memory scope with given attachment and cleanup action. The returned scope - * is assumed to be confined on the current thread. - * @return a confined memory scope - */ - public static ResourceScopeImpl createConfined(Cleaner cleaner) { - return new ConfinedScope(Thread.currentThread(), cleaner); - } - - /** - * Creates a shared memory scope with given attachment and cleanup action. - * @return a shared memory scope - */ public static ResourceScopeImpl createShared(Cleaner cleaner) { return new SharedScope(cleaner); } - private final void release0(HandleImpl handle) { - try { - Objects.requireNonNull(handle); - if (handle.scope() != this) { - throw new IllegalArgumentException("Cannot release an handle acquired from another scope"); - } - handle.release(); - } finally { - Reference.reachabilityFence(this); - } - } - @Override - public final void release(ResourceScope.Handle handle) { - release0((HandleImpl)handle); + public MemorySegment allocate(long bytesSize, long bytesAlignment) { + return MemorySegment.allocateNative(bytesSize, bytesAlignment, this); } - @Override - public final void release(ScopedMemoryAccess.Scope.Handle handle) { - release0((HandleImpl)handle); - } + public abstract void release0(); - @Override - public abstract HandleImpl acquire(); + public abstract void acquire0(); - /** - * Internal interface used to implement resource scope handles. - */ - public non-sealed interface HandleImpl extends ResourceScope.Handle, ScopedMemoryAccess.Scope.Handle { - - @Override - ResourceScopeImpl scope(); - - void release(); + @Override + public void keepAlive(ResourceScope target) { + Objects.requireNonNull(target); + if (target == this) { + throw new IllegalArgumentException("Invalid target scope."); + } + ResourceScopeImpl targetImpl = (ResourceScopeImpl)target; + targetImpl.acquire0(); + addCloseAction(targetImpl::release0); } /** @@ -167,7 +131,11 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Sco public void close() { try { justClose(); - resourceList.cleanup(); + if (cleanable != null) { + cleanable.clean(); + } else { + resourceList.cleanup(); + } } finally { Reference.reachabilityFence(this); } @@ -215,32 +183,17 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Sco } /** - * Allocates a segment using this scope. Used by {@link SegmentAllocator#ofScope(ResourceScope)}. - */ - @Override - public MemorySegment allocate(long bytesSize, long bytesAlignment) { - return MemorySegment.allocateNative(bytesSize, bytesAlignment, this); - } - - /** - * A non-closeable, shared scope. Similar to a shared scope, but its {@link #close()} method throws unconditionally. - * In addition, non-closeable scopes feature a much simpler scheme for generating resource scope handles, where - * the scope itself also acts as a resource scope handle and is returned by {@link #acquire()}. + * The global, always alive, non-closeable, shared scope. Similar to a shared scope, but its {@link #close()} method throws unconditionally. + * Adding new resources to the global scope, does nothing: as the scope can never become not-alive, there is nothing to track. + * Acquiring and or releasing a resource scope similarly does nothing. */ - static class ImplicitScopeImpl extends SharedScope implements HandleImpl { + static class GlobalScopeImpl extends SharedScope { - public ImplicitScopeImpl(Cleaner cleaner) { - super(cleaner); - } + final Object ref; - @Override - public HandleImpl acquire() { - return this; - } - - @Override - public boolean isImplicit() { - return true; + public GlobalScopeImpl(Object ref) { + super(null); + this.ref = ref; } @Override @@ -249,27 +202,28 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Sco } @Override - public void release() { + @ForceInline + public void release0() { // do nothing } @Override - public ResourceScopeImpl scope() { - return this; + @ForceInline + public void acquire0() { + // do nothing } - } - /** - * The global, always alive, non-closeable, shared scope. This is like a {@link ImplicitScopeImpl non-closeable scope}, - * except that the operation which adds new resources to the global scope does nothing: as the scope can never - * become not-alive, there is nothing to track. - */ - public static final ResourceScopeImpl GLOBAL = new ImplicitScopeImpl( null) { @Override void addInternal(ResourceList.ResourceCleanup resource) { // do nothing } - }; + } + + public static final ResourceScopeImpl GLOBAL = new GlobalScopeImpl(null); + + public static ResourceScopeImpl heapScope(Object ref) { + return new GlobalScopeImpl(ref); + } /** * A list of all cleanup actions associated with a resource scope. Cleanup actions are modelled as instances @@ -296,7 +250,7 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Sco } } - public static abstract class ResourceCleanup { + public abstract static class ResourceCleanup { ResourceCleanup next; public abstract void cleanup(); diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Scoped.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Scoped.java new file mode 100644 index 00000000000..7051aacb527 --- /dev/null +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Scoped.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.foreign; + +import jdk.incubator.foreign.ResourceScope; + +public interface Scoped { + ResourceScope scope(); +} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SharedScope.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SharedScope.java index 8bbeaaab829..93ecf08d468 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SharedScope.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SharedScope.java @@ -25,14 +25,12 @@ package jdk.internal.foreign; -import jdk.incubator.foreign.ResourceScope; import jdk.internal.misc.ScopedMemoryAccess; +import jdk.internal.vm.annotation.ForceInline; import java.lang.invoke.MethodHandles; import java.lang.invoke.VarHandle; import java.lang.ref.Cleaner; -import java.lang.ref.Reference; -import java.util.concurrent.atomic.AtomicBoolean; /** * A shared scope, which can be shared across multiple threads. Closing a shared scope has to ensure that @@ -50,7 +48,6 @@ class SharedScope extends ResourceScopeImpl { private static final int ALIVE = 0; private static final int CLOSING = -1; private static final int CLOSED = -2; - private static final int MAX_FORKS = Integer.MAX_VALUE; private int state = ALIVE; @@ -65,7 +62,7 @@ class SharedScope extends ResourceScopeImpl { } SharedScope(Cleaner cleaner) { - super(cleaner, new SharedResourceList()); + super(new SharedResourceList(), cleaner); } @Override @@ -81,7 +78,8 @@ class SharedScope extends ResourceScopeImpl { } @Override - public HandleImpl acquire() { + @ForceInline + public void acquire0() { int value; do { value = (int) STATE.getVolatile(this); @@ -90,10 +88,22 @@ class SharedScope extends ResourceScopeImpl { throw new IllegalStateException("Already closed"); } else if (value == MAX_FORKS) { //overflow - throw new IllegalStateException("Segment acquire limit exceeded"); + throw new IllegalStateException("Scope keep alive limit exceeded"); } } while (!STATE.compareAndSet(this, value, value + 1)); - return new SharedHandle(); + } + + @Override + @ForceInline + public void release0() { + int value; + do { + value = (int) STATE.getVolatile(this); + if (value <= ALIVE) { + //cannot get here - we can't close segment twice + throw new IllegalStateException("Already closed"); + } + } while (!STATE.compareAndSet(this, value, value - 1)); } void justClose() { @@ -101,7 +111,7 @@ class SharedScope extends ResourceScopeImpl { if (prevState < 0) { throw new IllegalStateException("Already closed"); } else if (prevState != ALIVE) { - throw new IllegalStateException("Scope is acquired by " + prevState + " locks"); + throw new IllegalStateException("Scope is kept alive by " + prevState + " scopes"); } boolean success = SCOPED_MEMORY_ACCESS.closeScope(this); STATE.setVolatile(this, success ? CLOSED : ALIVE); @@ -133,13 +143,13 @@ class SharedScope extends ResourceScopeImpl { @Override void add(ResourceCleanup cleanup) { while (true) { - ResourceCleanup prev = (ResourceCleanup) FST.getAcquire(this); - cleanup.next = prev; - ResourceCleanup newSegment = (ResourceCleanup) FST.compareAndExchangeRelease(this, prev, cleanup); - if (newSegment == ResourceCleanup.CLOSED_LIST) { + ResourceCleanup prev = (ResourceCleanup) FST.getVolatile(this); + if (prev == ResourceCleanup.CLOSED_LIST) { // too late throw new IllegalStateException("Already closed"); - } else if (newSegment == prev) { + } + cleanup.next = prev; + if (FST.compareAndSet(this, prev, cleanup)) { return; //victory } // keep trying @@ -155,9 +165,9 @@ class SharedScope extends ResourceScopeImpl { //ok now we're really closing down ResourceCleanup prev = null; while (true) { - prev = (ResourceCleanup) FST.getAcquire(this); + prev = (ResourceCleanup) FST.getVolatile(this); // no need to check for DUMMY, since only one thread can get here! - if (FST.weakCompareAndSetRelease(this, prev, ResourceCleanup.CLOSED_LIST)) { + if (FST.compareAndSet(this, prev, ResourceCleanup.CLOSED_LIST)) { break; } } @@ -167,30 +177,4 @@ class SharedScope extends ResourceScopeImpl { } } } - - /** - * A shared resource scope handle; this implementation has to handle close vs. close races. - */ - class SharedHandle implements HandleImpl { - final AtomicBoolean released = new AtomicBoolean(false); - - @Override - public ResourceScopeImpl scope() { - return SharedScope.this; - } - - @Override - public void release() { - if (released.compareAndSet(false, true)) { - int value; - do { - value = (int) STATE.getVolatile(jdk.internal.foreign.SharedScope.this); - if (value <= ALIVE) { - //cannot get here - we can't close segment twice - throw new IllegalStateException("Already closed"); - } - } while (!STATE.compareAndSet(jdk.internal.foreign.SharedScope.this, value, value - 1)); - } - } - } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SystemLookup.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SystemLookup.java index 24743c7deeb..45c637b06bf 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SystemLookup.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/SystemLookup.java @@ -25,8 +25,8 @@ package jdk.internal.foreign; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; @@ -39,13 +39,13 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Function; -import static jdk.incubator.foreign.CLinker.C_POINTER; +import static jdk.incubator.foreign.ValueLayout.ADDRESS; public class SystemLookup implements SymbolLookup { private SystemLookup() { } - final static SystemLookup INSTANCE = new SystemLookup(); + static final SystemLookup INSTANCE = new SystemLookup(); /* * On POSIX systems, dlsym will allow us to lookup symbol in library dependencies; the same trick doesn't work @@ -71,11 +71,11 @@ public class SystemLookup implements SymbolLookup { SymbolLookup fallbackLibLookup = libLookup(libs -> libs.loadLibrary("WinFallbackLookup")); int numSymbols = WindowsFallbackSymbols.values().length; - MemorySegment funcs = fallbackLibLookup.lookup("funcs").orElseThrow() - .asSegment(C_POINTER.byteSize() * numSymbols, ResourceScope.newImplicitScope()); + MemorySegment funcs = MemorySegment.ofAddress(fallbackLibLookup.lookup("funcs").orElseThrow().address(), + ADDRESS.byteSize() * numSymbols, ResourceScope.globalScope()); SymbolLookup fallbackLookup = name -> Optional.ofNullable(WindowsFallbackSymbols.valueOfOrNull(name)) - .map(symbol -> MemoryAccess.getAddressAtIndex(funcs, symbol.ordinal())); + .map(symbol -> NativeSymbol.ofAddress(symbol.name(), funcs.getAtIndex(ADDRESS, symbol.ordinal()), ResourceScope.globalScope())); final SymbolLookup finalLookup = lookup; lookup = name -> finalLookup.lookup(name).or(() -> fallbackLookup.lookup(name)); @@ -91,7 +91,8 @@ public class SystemLookup implements SymbolLookup { try { long addr = lib.lookup(name); return addr == 0 ? - Optional.empty() : Optional.of(MemoryAddress.ofLong(addr)); + Optional.empty() : + Optional.of(NativeSymbol.ofAddress(name, MemoryAddress.ofLong(addr), ResourceScope.globalScope())); } catch (NoSuchMethodException e) { return Optional.empty(); } @@ -99,7 +100,7 @@ public class SystemLookup implements SymbolLookup { } @Override - public Optional lookup(String name) { + public Optional lookup(String name) { return syslookup.lookup(name); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java index f3b0240d2d0..6272e6e3100 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java @@ -27,17 +27,19 @@ package jdk.internal.foreign; import jdk.incubator.foreign.*; +import jdk.internal.access.SharedSecrets; import jdk.internal.access.foreign.MemorySegmentProxy; -import jdk.internal.misc.VM; -import sun.invoke.util.Wrapper; +import jdk.internal.vm.annotation.ForceInline; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.invoke.VarHandle; -import java.util.Optional; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static sun.security.action.GetPropertyAction.*; /** @@ -49,6 +51,10 @@ public final class Utils { = Boolean.parseBoolean(privilegedGetProperty("jdk.internal.foreign.SHOULD_ADAPT_HANDLES", "true")); private static final MethodHandle SEGMENT_FILTER; + private static final MethodHandle BYTE_TO_BOOL; + private static final MethodHandle BOOL_TO_BYTE; + private static final MethodHandle ADDRESS_TO_LONG; + private static final MethodHandle LONG_TO_ADDRESS; public static final MethodHandle MH_bitsToBytesOrThrowForOffset; public static final Supplier bitsToBytesThrowOffset @@ -59,6 +65,14 @@ public final class Utils { MethodHandles.Lookup lookup = MethodHandles.lookup(); SEGMENT_FILTER = lookup.findStatic(Utils.class, "filterSegment", MethodType.methodType(MemorySegmentProxy.class, MemorySegment.class)); + BYTE_TO_BOOL = lookup.findStatic(Utils.class, "byteToBoolean", + MethodType.methodType(boolean.class, byte.class)); + BOOL_TO_BYTE = lookup.findStatic(Utils.class, "booleanToByte", + MethodType.methodType(byte.class, boolean.class)); + ADDRESS_TO_LONG = lookup.findVirtual(MemoryAddress.class, "toRawLongValue", + MethodType.methodType(long.class)); + LONG_TO_ADDRESS = lookup.findStatic(MemoryAddress.class, "ofLong", + MethodType.methodType(MemoryAddress.class, long.class)); MH_bitsToBytesOrThrowForOffset = MethodHandles.insertArguments( lookup.findStatic(Utils.class, "bitsToBytesOrThrow", MethodType.methodType(long.class, long.class, Supplier.class)), @@ -91,38 +105,72 @@ public final class Utils { } } - public static VarHandle fixUpVarHandle(VarHandle handle) { + public static VarHandle makeMemoryAccessVarHandle(ValueLayout layout, boolean skipAlignmentCheck) { + class VarHandleCache { + private static final Map handleMap = new ConcurrentHashMap<>(); + private static final Map handleMapNoAlignCheck = new ConcurrentHashMap<>(); + + static VarHandle put(ValueLayout layout, VarHandle handle, boolean skipAlignmentCheck) { + VarHandle prev = (skipAlignmentCheck ? handleMapNoAlignCheck : handleMap).putIfAbsent(layout, handle); + return prev != null ? prev : handle; + } + } + Class baseCarrier = layout.carrier(); + if (layout.carrier() == MemoryAddress.class) { + baseCarrier = switch ((int) ValueLayout.ADDRESS.byteSize()) { + case 8 -> long.class; + case 4 -> int.class; + default -> throw new UnsupportedOperationException("Unsupported address layout"); + }; + } else if (layout.carrier() == boolean.class) { + baseCarrier = byte.class; + } + + VarHandle handle = SharedSecrets.getJavaLangInvokeAccess().memoryAccessVarHandle(baseCarrier, skipAlignmentCheck, + layout.byteAlignment() - 1, layout.order()); + // This adaptation is required, otherwise the memory access var handle will have type MemorySegmentProxy, // and not MemorySegment (which the user expects), which causes performance issues with asType() adaptations. - return SHOULD_ADAPT_HANDLES + handle = SHOULD_ADAPT_HANDLES ? MemoryHandles.filterCoordinates(handle, 0, SEGMENT_FILTER) : handle; + if (layout.carrier() == boolean.class) { + handle = MemoryHandles.filterValue(handle, BOOL_TO_BYTE, BYTE_TO_BOOL); + } else if (layout.carrier() == MemoryAddress.class) { + handle = MemoryHandles.filterValue(handle, + MethodHandles.explicitCastArguments(ADDRESS_TO_LONG, MethodType.methodType(baseCarrier, MemoryAddress.class)), + MethodHandles.explicitCastArguments(LONG_TO_ADDRESS, MethodType.methodType(MemoryAddress.class, baseCarrier))); + } + return VarHandleCache.put(layout, handle, skipAlignmentCheck); } private static MemorySegmentProxy filterSegment(MemorySegment segment) { return (AbstractMemorySegmentImpl)segment; } - public static void checkPrimitiveCarrierCompat(Class carrier, MemoryLayout layout) { - checkLayoutType(layout, ValueLayout.class); - if (!isValidPrimitiveCarrier(carrier)) - throw new IllegalArgumentException("Unsupported carrier: " + carrier); - if (Wrapper.forPrimitiveType(carrier).bitWidth() != layout.bitSize()) - throw new IllegalArgumentException("Carrier size mismatch: " + carrier + " != " + layout); + private static boolean byteToBoolean(byte b) { + return b != 0; + } + + private static byte booleanToByte(boolean b) { + return b ? (byte)1 : (byte)0; + } + + public static void copy(MemorySegment addr, byte[] bytes) { + var heapSegment = MemorySegment.ofArray(bytes); + addr.copyFrom(heapSegment); + addr.set(JAVA_BYTE, bytes.length, (byte)0); } - public static boolean isValidPrimitiveCarrier(Class carrier) { - return carrier == byte.class - || carrier == short.class - || carrier == char.class - || carrier == int.class - || carrier == long.class - || carrier == float.class - || carrier == double.class; + public static MemorySegment toCString(byte[] bytes, SegmentAllocator allocator) { + MemorySegment addr = allocator.allocate(bytes.length + 1, 1L); + copy(addr, bytes); + return addr; } - public static void checkLayoutType(MemoryLayout layout, Class layoutType) { - if (!layoutType.isInstance(layout)) - throw new IllegalArgumentException("Expected a " + layoutType.getSimpleName() + ": " + layout); + @ForceInline + public static long scaleOffset(MemorySegment segment, long index, long size) { + // note: we know size is a small value (as it comes from ValueLayout::byteSize()) + return MemorySegmentProxy.multiplyOffsets(index, (int)size, (AbstractMemorySegmentImpl)segment); } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/Binding.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/Binding.java index 5b8468eafd3..30623223169 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/Binding.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/Binding.java @@ -24,17 +24,20 @@ */ package jdk.internal.foreign.abi; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; +import jdk.incubator.foreign.ValueLayout; import jdk.internal.foreign.MemoryAddressImpl; import jdk.internal.foreign.ResourceScopeImpl; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; import java.util.ArrayList; import java.util.Deque; import java.util.List; @@ -204,7 +207,6 @@ import static java.lang.invoke.MethodType.methodType; public abstract class Binding { private static final MethodHandle MH_UNBOX_ADDRESS; private static final MethodHandle MH_BOX_ADDRESS; - private static final MethodHandle MH_BASE_ADDRESS; private static final MethodHandle MH_COPY_BUFFER; private static final MethodHandle MH_ALLOCATE_BUFFER; private static final MethodHandle MH_TO_SEGMENT; @@ -216,8 +218,6 @@ public abstract class Binding { methodType(long.class)); MH_BOX_ADDRESS = lookup.findStatic(MemoryAddress.class, "ofLong", methodType(MemoryAddress.class, long.class)); - MH_BASE_ADDRESS = lookup.findVirtual(MemorySegment.class, "address", - methodType(MemoryAddress.class)); MH_COPY_BUFFER = lookup.findStatic(Binding.Copy.class, "copyBuffer", methodType(MemorySegment.class, MemorySegment.class, long.class, long.class, Context.class)); MH_ALLOCATE_BUFFER = lookup.findStatic(Binding.Allocate.class, "allocateBuffer", @@ -262,7 +262,7 @@ public abstract class Binding { */ public static Context ofBoundedAllocator(long size) { ResourceScope scope = ResourceScope.newConfinedScope(); - return new Context(SegmentAllocator.arenaAllocator(size, scope), scope); + return new Context(SegmentAllocator.newNativeArena(size, scope), scope); } /** @@ -321,7 +321,6 @@ public abstract class Binding { ALLOC_BUFFER, BOX_ADDRESS, UNBOX_ADDRESS, - BASE_ADDRESS, TO_SEGMENT, DUP } @@ -344,7 +343,7 @@ public abstract class Binding { public abstract MethodHandle specialize(MethodHandle specializedHandle, int insertPos, int allocatorPos); private static void checkType(Class type) { - if (!type.isPrimitive() || type == void.class || type == boolean.class) + if (!type.isPrimitive() || type == void.class) throw new IllegalArgumentException("Illegal type: " + type); } @@ -388,11 +387,11 @@ public abstract class Binding { } public static UnboxAddress unboxAddress() { - return UnboxAddress.INSTANCE; + return UnboxAddress.INSTANCE.get(MemoryAddress.class); } - public static BaseAddress baseAddress() { - return BaseAddress.INSTANCE; + public static UnboxAddress unboxAddress(Class carrier) { + return UnboxAddress.INSTANCE.get(carrier); } public static ToSegment toSegment(MemoryLayout layout) { @@ -467,8 +466,8 @@ public abstract class Binding { return this; } - public Binding.Builder baseAddress() { - bindings.add(Binding.baseAddress()); + public Binding.Builder unboxAddress(Class carrier) { + bindings.add(Binding.unboxAddress(carrier)); return this; } @@ -487,7 +486,7 @@ public abstract class Binding { } } - static abstract class Move extends Binding { + abstract static class Move extends Binding { private final VMStorage storage; private final Class type; @@ -593,7 +592,7 @@ public abstract class Binding { } } - private static abstract class Dereference extends Binding { + private abstract static class Dereference extends Binding { private final long offset; private final Class type; @@ -630,7 +629,8 @@ public abstract class Binding { // alignment is set to 1 byte here to avoid exceptions for cases where we do super word // copies of e.g. 2 int fields of a struct as a single long, while the struct is only // 4-byte-aligned (since it only contains ints) - return MemoryHandles.insertCoordinates(MemoryHandles.varHandle(type, 1, ByteOrder.nativeOrder()), 1, offset); + ValueLayout layout = MemoryLayout.valueLayout(type(), ByteOrder.nativeOrder()).withBitAlignment(8); + return MemoryHandles.insertCoordinates(MemoryHandles.varHandle(layout), 1, offset); } } @@ -740,9 +740,8 @@ public abstract class Binding { private static MemorySegment copyBuffer(MemorySegment operand, long size, long alignment, Context context) { - MemorySegment copy = context.allocator().allocate(size, alignment); - copy.copyFrom(operand.asSlice(0, size)); - return copy; + return context.allocator().allocate(size, alignment) + .copyFrom(operand.asSlice(0, size)); } public long size() { @@ -875,27 +874,44 @@ public abstract class Binding { * and pushes that onto the operand stack. */ public static class UnboxAddress extends Binding { - private static final UnboxAddress INSTANCE = new UnboxAddress(); - private UnboxAddress() { + + static final ClassValue INSTANCE = new ClassValue<>() { + @Override + protected UnboxAddress computeValue(Class type) { + return new UnboxAddress(type); + } + }; + + final Class carrier; + final MethodHandle toAddress; + + private UnboxAddress(Class carrier) { super(Tag.UNBOX_ADDRESS); + this.carrier = carrier; + try { + this.toAddress = MethodHandles.lookup().findVirtual(carrier, "address", MethodType.methodType(MemoryAddress.class)); + } catch (Throwable ex) { + throw new IllegalArgumentException(ex); + } } @Override public void verify(Deque> stack) { Class actualType = stack.pop(); - SharedUtils.checkType(actualType, MemoryAddress.class); + SharedUtils.checkType(actualType, carrier); stack.push(long.class); } @Override public void interpret(Deque stack, BindingInterpreter.StoreFunc storeFunc, BindingInterpreter.LoadFunc loadFunc, Context context) { - stack.push(((MemoryAddress)stack.pop()).toRawLongValue()); + stack.push(((Addressable)stack.pop()).address().toRawLongValue()); } @Override public MethodHandle specialize(MethodHandle specializedHandle, int insertPos, int allocatorPos) { - return filterArguments(specializedHandle, insertPos, MH_UNBOX_ADDRESS); + return filterArguments(specializedHandle, insertPos, + MethodHandles.filterReturnValue(toAddress, MH_UNBOX_ADDRESS)); } @Override @@ -939,41 +955,6 @@ public abstract class Binding { } } - /** - * BASE_ADDRESS() - * Pops a MemorySegment from the operand stack, and takes the base address of the segment - * (the MemoryAddress that points to the start), and pushes that onto the operand stack - */ - public static class BaseAddress extends Binding { - private static final BaseAddress INSTANCE = new BaseAddress(); - private BaseAddress() { - super(Tag.BASE_ADDRESS); - } - - @Override - public void verify(Deque> stack) { - Class actualType = stack.pop(); - SharedUtils.checkType(actualType, MemorySegment.class); - stack.push(MemoryAddress.class); - } - - @Override - public void interpret(Deque stack, BindingInterpreter.StoreFunc storeFunc, - BindingInterpreter.LoadFunc loadFunc, Context context) { - stack.push(((MemorySegment) stack.pop()).address()); - } - - @Override - public MethodHandle specialize(MethodHandle specializedHandle, int insertPos, int allocatorPos) { - return filterArguments(specializedHandle, insertPos, MH_BASE_ADDRESS); - } - - @Override - public String toString() { - return "BaseAddress{}"; - } - } - /** * TO_SEGMENT([size]) * Pops a MemoryAddress from the operand stack, and converts it to a MemorySegment diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/BufferLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/BufferLayout.java index d290a36cc73..5308533676f 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/BufferLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/BufferLayout.java @@ -24,8 +24,8 @@ */ package jdk.internal.foreign.abi; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.ValueLayout; import jdk.internal.foreign.MemoryAddressImpl; import java.io.PrintStream; @@ -34,7 +34,7 @@ import java.util.HashMap; import java.util.Map; class BufferLayout { - static final VarHandle VH_LONG = MemoryLayouts.JAVA_LONG.varHandle(long.class); + static final VarHandle VH_LONG = ValueLayout.JAVA_LONG.varHandle(); final long size; final long arguments_next_pc; diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequence.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequence.java index 1412304a4cb..614166b83d1 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequence.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequence.java @@ -28,7 +28,6 @@ import jdk.incubator.foreign.FunctionDescriptor; import java.lang.invoke.MethodType; import java.util.List; -import java.util.stream.IntStream; import java.util.stream.Stream; public class CallingSequence { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java index bdc8474d2b9..633b9d366d6 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java @@ -100,7 +100,6 @@ public class CallingSequenceBuilder { //ALLOC_BUFFER, //BOX_ADDRESS, UNBOX_ADDRESS, - BASE_ADDRESS, //TO_SEGMENT, DUP ); @@ -129,7 +128,6 @@ public class CallingSequenceBuilder { ALLOC_BUFFER, BOX_ADDRESS, //UNBOX_ADDRESS, - //BASE_ADDRESS, TO_SEGMENT, DUP ); diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableInvoker.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableInvoker.java index 4e7b4b37ea6..304e028c5d7 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableInvoker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableInvoker.java @@ -25,11 +25,11 @@ package jdk.internal.foreign.abi; import jdk.incubator.foreign.Addressable; -import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; +import jdk.incubator.foreign.ValueLayout; import jdk.internal.access.JavaLangInvokeAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.invoke.NativeEntryPoint; @@ -40,7 +40,6 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.invoke.VarHandle; -import java.lang.ref.Reference; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -70,7 +69,7 @@ public class ProgrammableInvoker { private static final JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess(); - private static final VarHandle VH_LONG = MemoryLayouts.JAVA_LONG.varHandle(long.class); + private static final VarHandle VH_LONG = ValueLayout.JAVA_LONG.varHandle(); private static final MethodHandle MH_INVOKE_MOVES; private static final MethodHandle MH_INVOKE_INTERP_BINDINGS; @@ -87,10 +86,10 @@ public class ProgrammableInvoker { MH_INVOKE_MOVES = lookup.findVirtual(ProgrammableInvoker.class, "invokeMoves", methodType(Object.class, long.class, Object[].class, Binding.VMStore[].class, Binding.VMLoad[].class)); MH_INVOKE_INTERP_BINDINGS = lookup.findVirtual(ProgrammableInvoker.class, "invokeInterpBindings", - methodType(Object.class, Addressable.class, SegmentAllocator.class, Object[].class, MethodHandle.class, Map.class, Map.class)); + methodType(Object.class, NativeSymbol.class, SegmentAllocator.class, Object[].class, MethodHandle.class, Map.class, Map.class)); MH_WRAP_ALLOCATOR = lookup.findStatic(Binding.Context.class, "ofAllocator", methodType(Binding.Context.class, SegmentAllocator.class)); - MH_ADDR_TO_LONG = lookup.findStatic(ProgrammableInvoker.class, "unboxTargetAddress", methodType(long.class, Addressable.class)); + MH_ADDR_TO_LONG = lookup.findStatic(ProgrammableInvoker.class, "unboxTargetAddress", methodType(long.class, NativeSymbol.class)); } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } @@ -172,9 +171,9 @@ public class ProgrammableInvoker { return handle; } - private static long unboxTargetAddress(Addressable addr) { - MemoryAddress ma = SharedUtils.checkSymbol(addr); - return ma.toRawLongValue(); + private static long unboxTargetAddress(NativeSymbol addr) { + SharedUtils.checkSymbol(addr); + return addr.address().toRawLongValue(); } // Funnel from type to Object[] @@ -312,7 +311,7 @@ public class ProgrammableInvoker { } } - Object invokeInterpBindings(Addressable address, SegmentAllocator allocator, Object[] args, MethodHandle leaf, + Object invokeInterpBindings(NativeSymbol symbol, SegmentAllocator allocator, Object[] args, MethodHandle leaf, Map argIndexMap, Map retIndexMap) throws Throwable { Binding.Context unboxContext = bufferCopySize != 0 @@ -321,21 +320,17 @@ public class ProgrammableInvoker { try (unboxContext) { // do argument processing, get Object[] as result Object[] leafArgs = new Object[leaf.type().parameterCount()]; - leafArgs[0] = address; // addr + leafArgs[0] = symbol; // symbol for (int i = 0; i < args.length; i++) { Object arg = args[i]; BindingInterpreter.unbox(arg, callingSequence.argumentBindings(i), (storage, type, value) -> { - leafArgs[argIndexMap.get(storage) + 1] = value; // +1 to skip addr + leafArgs[argIndexMap.get(storage) + 1] = value; // +1 to skip symbol }, unboxContext); } // call leaf Object o = leaf.invokeWithArguments(leafArgs); - // make sure arguments are reachable during the call - // technically we only need to do all Addressable parameters here - Reference.reachabilityFence(address); - Reference.reachabilityFence(args); // return value processing if (o == null) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableUpcallHandler.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableUpcallHandler.java index 0f1a04619f6..ba8090f669c 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableUpcallHandler.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/ProgrammableUpcallHandler.java @@ -26,10 +26,10 @@ package jdk.internal.foreign.abi; import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; -import jdk.incubator.foreign.SegmentAllocator; +import jdk.incubator.foreign.ValueLayout; import jdk.internal.access.JavaLangInvokeAccess; import jdk.internal.access.SharedSecrets; import jdk.internal.foreign.MemoryAddressImpl; @@ -46,6 +46,7 @@ import java.util.Objects; import java.util.stream.Stream; import static java.lang.invoke.MethodHandles.dropArguments; +import static java.lang.invoke.MethodHandles.exactInvoker; import static java.lang.invoke.MethodHandles.filterReturnValue; import static java.lang.invoke.MethodHandles.identity; import static java.lang.invoke.MethodHandles.insertArguments; @@ -69,7 +70,7 @@ public class ProgrammableUpcallHandler { private static final JavaLangInvokeAccess JLI = SharedSecrets.getJavaLangInvokeAccess(); - private static final VarHandle VH_LONG = MemoryLayouts.JAVA_LONG.varHandle(long.class); + private static final VarHandle VH_LONG = ValueLayout.JAVA_LONG.varHandle(); private static final MethodHandle MH_invokeMoves; private static final MethodHandle MH_invokeInterpBindings; @@ -88,7 +89,7 @@ public class ProgrammableUpcallHandler { } } - public static UpcallHandler make(ABIDescriptor abi, MethodHandle target, CallingSequence callingSequence) { + public static NativeSymbol make(ABIDescriptor abi, MethodHandle target, CallingSequence callingSequence, ResourceScope scope) { Binding.VMLoad[] argMoves = argMoveBindings(callingSequence); Binding.VMStore[] retMoves = retMoveBindings(callingSequence); @@ -134,7 +135,7 @@ public class ProgrammableUpcallHandler { MethodHandle invokeMoves = insertArguments(MH_invokeMoves, 1, doBindingsErased, argMoves, retMoves, abi, layout); entryPoint = allocateUpcallStub(invokeMoves, abi, layout); } - return () -> entryPoint; + return UpcallStubs.makeUpcall(entryPoint, scope); } private static void checkPrimitive(MethodType type) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/SharedUtils.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/SharedUtils.java index d080d1de191..967fd203e04 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/SharedUtils.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/SharedUtils.java @@ -25,40 +25,45 @@ package jdk.internal.foreign.abi; import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.GroupLayout; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.SequenceLayout; -import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.VaList; import jdk.incubator.foreign.ValueLayout; import jdk.internal.access.JavaLangAccess; +import jdk.internal.access.JavaLangInvokeAccess; import jdk.internal.access.SharedSecrets; +import jdk.internal.foreign.Scoped; import jdk.internal.foreign.CABI; import jdk.internal.foreign.MemoryAddressImpl; +import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.foreign.Utils; import jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64Linker; import jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64Linker; import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; import jdk.internal.foreign.abi.x64.windows.Windowsx64Linker; +import jdk.internal.vm.annotation.ForceInline; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.invoke.VarHandle; import java.lang.ref.Reference; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Consumer; +import java.util.function.UnaryOperator; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -67,17 +72,26 @@ import static java.lang.invoke.MethodHandles.constant; import static java.lang.invoke.MethodHandles.dropArguments; import static java.lang.invoke.MethodHandles.dropReturn; import static java.lang.invoke.MethodHandles.empty; -import static java.lang.invoke.MethodHandles.filterArguments; +import static java.lang.invoke.MethodHandles.foldArguments; import static java.lang.invoke.MethodHandles.identity; import static java.lang.invoke.MethodHandles.insertArguments; import static java.lang.invoke.MethodHandles.permuteArguments; import static java.lang.invoke.MethodHandles.tryFinally; import static java.lang.invoke.MethodType.methodType; -import static jdk.incubator.foreign.CLinker.*; +import static jdk.incubator.foreign.ValueLayout.ADDRESS; +import static jdk.incubator.foreign.ValueLayout.JAVA_BOOLEAN; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; public class SharedUtils { private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess(); + private static final JavaLangInvokeAccess JLIA = SharedSecrets.getJavaLangInvokeAccess(); private static final MethodHandle MH_ALLOC_BUFFER; private static final MethodHandle MH_BASEADDRESS; @@ -87,6 +101,8 @@ public class SharedUtils { private static final MethodHandle MH_CLOSE_CONTEXT; private static final MethodHandle MH_REACHBILITY_FENCE; private static final MethodHandle MH_HANDLE_UNCAUGHT_EXCEPTION; + private static final MethodHandle ACQUIRE_MH; + private static final MethodHandle RELEASE_MH; static { try { @@ -107,13 +123,19 @@ public class SharedUtils { methodType(void.class, Object.class)); MH_HANDLE_UNCAUGHT_EXCEPTION = lookup.findStatic(SharedUtils.class, "handleUncaughtException", methodType(void.class, Throwable.class)); + ACQUIRE_MH = MethodHandles.lookup().findStatic(SharedUtils.class, "acquire", + MethodType.methodType(void.class, Scoped[].class)); + RELEASE_MH = MethodHandles.lookup().findStatic(SharedUtils.class, "release", + MethodType.methodType(void.class, Scoped[].class)); } catch (ReflectiveOperationException e) { throw new BootstrapMethodError(e); } } // this allocator should be used when no allocation is expected - public static final SegmentAllocator THROWING_ALLOCATOR = (size, align) -> { throw new IllegalStateException("Cannot get here"); }; + public static final SegmentAllocator THROWING_ALLOCATOR = (size, align) -> { + throw new IllegalStateException("Cannot get here"); + }; /** * Align the specified type from a given address @@ -225,34 +247,6 @@ public class SharedUtils { return dest; } - public static void checkCompatibleType(Class carrier, MemoryLayout layout, long addressSize) { - if (carrier.isPrimitive()) { - Utils.checkPrimitiveCarrierCompat(carrier, layout); - } else if (carrier == MemoryAddress.class) { - Utils.checkLayoutType(layout, ValueLayout.class); - if (layout.bitSize() != addressSize) - throw new IllegalArgumentException("Address size mismatch: " + addressSize + " != " + layout.bitSize()); - } else if (carrier == MemorySegment.class) { - Utils.checkLayoutType(layout, GroupLayout.class); - } else { - throw new IllegalArgumentException("Unsupported carrier: " + carrier); - } - } - - public static void checkFunctionTypes(MethodType mt, FunctionDescriptor cDesc, long addressSize) { - if (mt.returnType() == void.class != cDesc.returnLayout().isEmpty()) - throw new IllegalArgumentException("Return type mismatch: " + mt + " != " + cDesc); - List argLayouts = cDesc.argumentLayouts(); - if (mt.parameterCount() != argLayouts.size()) - throw new IllegalArgumentException("Arity mismatch: " + mt + " != " + cDesc); - - int paramCount = mt.parameterCount(); - for (int i = 0; i < paramCount; i++) { - checkCompatibleType(mt.parameterType(i), argLayouts.get(i), addressSize); - } - cDesc.returnLayout().ifPresent(rl -> checkCompatibleType(mt.returnType(), rl, addressSize)); - } - public static Class primitiveCarrierForSize(long size, boolean useFloat) { if (useFloat) { if (size == 4) { @@ -287,15 +281,14 @@ public class SharedUtils { public static String toJavaStringInternal(MemorySegment segment, long start) { int len = strlen(segment, start); byte[] bytes = new byte[len]; - MemorySegment.ofArray(bytes) - .copyFrom(segment.asSlice(start, len)); + MemorySegment.copy(segment, JAVA_BYTE, start, bytes, 0, len); return new String(bytes, StandardCharsets.UTF_8); } private static int strlen(MemorySegment segment, long start) { // iterate until overflow (String can only hold a byte[], whose length can be expressed as an int) for (int offset = 0; offset >= 0; offset++) { - byte curr = MemoryAccess.getByteAtOffset(segment, start + offset); + byte curr = segment.get(JAVA_BYTE, start + offset); if (curr == 0) { return offset; } @@ -392,31 +385,21 @@ public class SharedUtils { insertPos = 1; } else { closer = identity(specializedHandle.type().returnType()); // (V) -> V - closer = dropArguments(closer, 0, Throwable.class); // (Throwable, V) -> V + if (!upcall) { + closer = dropArguments(closer, 0, Throwable.class); // (Throwable, V) -> V + } else { + closer = collectArguments(closer, 0, MH_HANDLE_UNCAUGHT_EXCEPTION); // (Throwable, V) -> V + } insertPos = 2; } - // downcalls get the leading Addressable/SegmentAllocator param as well + // downcalls get the leading NativeSymbol/SegmentAllocator param as well if (!upcall) { - closer = collectArguments(closer, insertPos++, reachabilityFenceHandle(Addressable.class)); - closer = dropArguments(closer, insertPos++, SegmentAllocator.class); // (Throwable, V?, Addressable, SegmentAllocator) -> V/void + closer = collectArguments(closer, insertPos++, reachabilityFenceHandle(NativeSymbol.class)); + closer = dropArguments(closer, insertPos++, SegmentAllocator.class); // (Throwable, V?, NativeSymbol, SegmentAllocator) -> V/void } - closer = collectArguments(closer, insertPos++, MH_CLOSE_CONTEXT); // (Throwable, V?, Addressable?, BindingContext) -> V/void - - if (!upcall) { - // now for each Addressable parameter, add a reachability fence - MethodType specType = specializedHandle.type(); - // skip 3 for address, segment allocator, and binding context - for (int i = 3; i < specType.parameterCount(); i++) { - Class param = specType.parameterType(i); - if (Addressable.class.isAssignableFrom(param)) { - closer = collectArguments(closer, insertPos++, reachabilityFenceHandle(param)); - } else { - closer = dropArguments(closer, insertPos++, param); - } - } - } + closer = collectArguments(closer, insertPos++, MH_CLOSE_CONTEXT); // (Throwable, V?, NativeSymbol?, BindingContext) -> V/void MethodHandle contextFactory; @@ -434,34 +417,171 @@ public class SharedUtils { return specializedHandle; } + @ForceInline + @SuppressWarnings("fallthrough") + public static void acquire(Scoped[] args) { + ResourceScope scope4 = null; + ResourceScope scope3 = null; + ResourceScope scope2 = null; + ResourceScope scope1 = null; + ResourceScope scope0 = null; + switch (args.length) { + default: + // slow path, acquire all remaining addressable parameters in isolation + for (int i = 5 ; i < args.length ; i++) { + acquire(args[i].scope()); + } + // fast path, acquire only scopes not seen in other parameters + case 5: + scope4 = args[4].scope(); + acquire(scope4); + case 4: + scope3 = args[3].scope(); + if (scope3 != scope4) + acquire(scope3); + case 3: + scope2 = args[2].scope(); + if (scope2 != scope3 && scope2 != scope4) + acquire(scope2); + case 2: + scope1 = args[1].scope(); + if (scope1 != scope2 && scope1 != scope3 && scope1 != scope4) + acquire(scope1); + case 1: + scope0 = args[0].scope(); + if (scope0 != scope1 && scope0 != scope2 && scope0 != scope3 && scope0 != scope4) + acquire(scope0); + case 0: break; + } + } + + @ForceInline + @SuppressWarnings("fallthrough") + public static void release(Scoped[] args) { + ResourceScope scope4 = null; + ResourceScope scope3 = null; + ResourceScope scope2 = null; + ResourceScope scope1 = null; + ResourceScope scope0 = null; + switch (args.length) { + default: + // slow path, release all remaining addressable parameters in isolation + for (int i = 5 ; i < args.length ; i++) { + release(args[i].scope()); + } + // fast path, release only scopes not seen in other parameters + case 5: + scope4 = args[4].scope(); + release(scope4); + case 4: + scope3 = args[3].scope(); + if (scope3 != scope4) + release(scope3); + case 3: + scope2 = args[2].scope(); + if (scope2 != scope3 && scope2 != scope4) + release(scope2); + case 2: + scope1 = args[1].scope(); + if (scope1 != scope2 && scope1 != scope3 && scope1 != scope4) + release(scope1); + case 1: + scope0 = args[0].scope(); + if (scope0 != scope1 && scope0 != scope2 && scope0 != scope3 && scope0 != scope4) + release(scope0); + case 0: break; + } + } + + @ForceInline + private static void acquire(ResourceScope scope) { + ((ResourceScopeImpl)scope).acquire0(); + } + + @ForceInline + private static void release(ResourceScope scope) { + ((ResourceScopeImpl)scope).release0(); + } + + /* + * This method adds a try/finally block to a downcall method handle, to make sure that all by-reference + * parameters (including the target address of the native function) are kept alive for the duration of + * the downcall. + */ + public static MethodHandle wrapDowncall(MethodHandle downcallHandle, FunctionDescriptor descriptor) { + boolean hasReturn = descriptor.returnLayout().isPresent(); + MethodHandle tryBlock = downcallHandle; + MethodHandle cleanup = hasReturn ? + MethodHandles.identity(downcallHandle.type().returnType()) : + MethodHandles.empty(MethodType.methodType(void.class)); + int addressableCount = 0; + List> adapters = new ArrayList<>(); + for (int i = 0 ; i < downcallHandle.type().parameterCount() ; i++) { + Class ptype = downcallHandle.type().parameterType(i); + if (ptype == Addressable.class || ptype == NativeSymbol.class) { + addressableCount++; + } else { + int pos = i; + adapters.add(mh -> dropArguments(mh, pos, ptype)); + } + } + + if (addressableCount > 0) { + cleanup = dropArguments(cleanup, 0, Throwable.class); + + MethodType adapterType = MethodType.methodType(void.class); + for (int i = 0 ; i < addressableCount ; i++) { + adapterType = adapterType.appendParameterTypes(i == 0 ? NativeSymbol.class : Addressable.class); + } + + MethodHandle acquireHandle = ACQUIRE_MH.asCollector(Scoped[].class, addressableCount).asType(adapterType); + MethodHandle releaseHandle = RELEASE_MH.asCollector(Scoped[].class, addressableCount).asType(adapterType); + + for (UnaryOperator adapter : adapters) { + acquireHandle = adapter.apply(acquireHandle); + releaseHandle = adapter.apply(releaseHandle); + } + + tryBlock = foldArguments(tryBlock, acquireHandle); + cleanup = collectArguments(cleanup, hasReturn ? 2 : 1, releaseHandle); + + return tryFinally(tryBlock, cleanup); + } else { + return downcallHandle; + } + } + + public static void checkExceptions(MethodHandle target) { + Class[] exceptions = JLIA.exceptionTypes(target); + if (exceptions != null && exceptions.length != 0) { + throw new IllegalArgumentException("Target handle may throw exceptions: " + Arrays.toString(exceptions)); + } + } + // lazy init MH_ALLOC and MH_FREE handles private static class AllocHolder { private static final CLinker SYS_LINKER = getSystemLinker(); - static final MethodHandle MH_MALLOC = SYS_LINKER.downcallHandle(CLinker.systemLookup().lookup("malloc").get(), - MethodType.methodType(MemoryAddress.class, long.class), - FunctionDescriptor.of(C_POINTER, C_LONG_LONG)); + static final MethodHandle MH_MALLOC = SYS_LINKER.downcallHandle(CLinker.systemCLinker().lookup("malloc").get(), + FunctionDescriptor.of(ADDRESS, JAVA_LONG)); - static final MethodHandle MH_FREE = SYS_LINKER.downcallHandle(CLinker.systemLookup().lookup("free").get(), - MethodType.methodType(void.class, MemoryAddress.class), - FunctionDescriptor.ofVoid(C_POINTER)); + static final MethodHandle MH_FREE = SYS_LINKER.downcallHandle(CLinker.systemCLinker().lookup("free").get(), + FunctionDescriptor.ofVoid(ADDRESS)); } - public static MemoryAddress checkSymbol(Addressable symbol) { - return checkAddressable(symbol, "Symbol is NULL"); + public static void checkSymbol(NativeSymbol symbol) { + checkAddressable(symbol, "Symbol is NULL"); } - public static MemoryAddress checkAddress(MemoryAddress address) { - return checkAddressable(address, "Address is NULL"); + public static void checkAddress(MemoryAddress address) { + checkAddressable(address, "Address is NULL"); } - private static MemoryAddress checkAddressable(Addressable symbol, String msg) { + private static void checkAddressable(Addressable symbol, String msg) { Objects.requireNonNull(symbol); - MemoryAddress symbolAddr = symbol.address(); - if (symbolAddr.equals(MemoryAddress.NULL)) - throw new IllegalArgumentException("Symbol is NULL: " + symbolAddr); - return symbolAddr; + if (symbol.address().toRawLongValue() == 0) + throw new IllegalArgumentException("Symbol is NULL: " + symbol); } public static MemoryAddress allocateMemoryInternal(long size) { @@ -474,7 +594,7 @@ public class SharedUtils { public static void freeMemoryInternal(MemoryAddress addr) { try { - AllocHolder.MH_FREE.invokeExact(addr); + AllocHolder.MH_FREE.invokeExact((Addressable)addr); } catch (Throwable th) { throw new RuntimeException(th); } @@ -489,12 +609,6 @@ public class SharedUtils { }; } - public static VarHandle vhPrimitiveOrAddress(Class carrier, MemoryLayout layout) { - return carrier == MemoryAddress.class - ? MemoryHandles.asAddressVarHandle(layout.varHandle(primitiveCarrierForSize(layout.byteSize(), false))) - : layout.varHandle(carrier); - } - public static VaList newVaListOfAddress(MemoryAddress ma, ResourceScope scope) { return switch (CABI.current()) { case Win64 -> Windowsx64Linker.newVaListOfAddress(ma, scope); @@ -513,34 +627,6 @@ public class SharedUtils { }; } - public static MethodType convertVaListCarriers(MethodType mt, Class carrier) { - Class[] params = new Class[mt.parameterCount()]; - for (int i = 0; i < params.length; i++) { - Class pType = mt.parameterType(i); - params[i] = ((pType == VaList.class) ? carrier : pType); - } - return methodType(mt.returnType(), params); - } - - public static MethodHandle unboxVaLists(MethodType type, MethodHandle handle, MethodHandle unboxer) { - for (int i = 0; i < type.parameterCount(); i++) { - if (type.parameterType(i) == VaList.class) { - handle = filterArguments(handle, i + 1, unboxer); // +1 for leading address - } - } - return handle; - } - - public static MethodHandle boxVaLists(MethodHandle handle, MethodHandle boxer) { - MethodType type = handle.type(); - for (int i = 0; i < type.parameterCount(); i++) { - if (type.parameterType(i) == VaList.class) { - handle = filterArguments(handle, i, boxer); - } - } - return handle; - } - static void checkType(Class actualType, Class expectedType) { if (expectedType != actualType) { throw new IllegalArgumentException( @@ -549,9 +635,12 @@ public class SharedUtils { } public static boolean isTrivial(FunctionDescriptor cDesc) { - return cDesc.attribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME) - .map(Boolean.class::cast) - .orElse(false); + return false; // FIXME: use system property? + } + + public static boolean isVarargsIndex(FunctionDescriptor descriptor, int argIndex) { + int firstPos = descriptor.firstVariadicArgumentIndex(); + return firstPos != -1 && argIndex >= firstPos; } public static class SimpleVaArg { @@ -566,13 +655,11 @@ public class SharedUtils { } public VarHandle varHandle() { - return carrier == MemoryAddress.class - ? MemoryHandles.asAddressVarHandle(layout.varHandle(primitiveCarrierForSize(layout.byteSize(), false))) - : layout.varHandle(carrier); + return layout.varHandle(); } } - public static non-sealed class EmptyVaList implements VaList { + public static non-sealed class EmptyVaList implements VaList, Scoped { private final MemoryAddress address; @@ -585,32 +672,27 @@ public class SharedUtils { } @Override - public int vargAsInt(MemoryLayout layout) { - throw uoe(); - } - - @Override - public long vargAsLong(MemoryLayout layout) { + public int nextVarg(ValueLayout.OfInt layout) { throw uoe(); } @Override - public double vargAsDouble(MemoryLayout layout) { + public long nextVarg(ValueLayout.OfLong layout) { throw uoe(); } @Override - public MemoryAddress vargAsAddress(MemoryLayout layout) { + public double nextVarg(ValueLayout.OfDouble layout) { throw uoe(); } @Override - public MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator) { + public MemoryAddress nextVarg(ValueLayout.OfAddress layout) { throw uoe(); } @Override - public MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope) { + public MemorySegment nextVarg(GroupLayout layout, SegmentAllocator allocator) { throw uoe(); } @@ -638,19 +720,21 @@ public class SharedUtils { static void writeOverSized(MemorySegment ptr, Class type, Object o) { // use VH_LONG for integers to zero out the whole register in the process if (type == long.class) { - MemoryAccess.setLong(ptr, (long) o); + ptr.set(JAVA_LONG, 0, (long) o); } else if (type == int.class) { - MemoryAccess.setLong(ptr, (int) o); + ptr.set(JAVA_LONG, 0, (int) o); } else if (type == short.class) { - MemoryAccess.setLong(ptr, (short) o); + ptr.set(JAVA_LONG, 0, (short) o); } else if (type == char.class) { - MemoryAccess.setLong(ptr, (char) o); + ptr.set(JAVA_LONG, 0, (char) o); } else if (type == byte.class) { - MemoryAccess.setLong(ptr, (byte) o); + ptr.set(JAVA_LONG, 0, (byte) o); } else if (type == float.class) { - MemoryAccess.setFloat(ptr, (float) o); + ptr.set(JAVA_FLOAT, 0, (float) o); } else if (type == double.class) { - MemoryAccess.setDouble(ptr, (double) o); + ptr.set(JAVA_DOUBLE, 0, (double) o); + } else if (type == boolean.class) { + ptr.set(JAVA_BOOLEAN, 0, (boolean) o); } else { throw new IllegalArgumentException("Unsupported carrier: " + type); } @@ -658,19 +742,21 @@ public class SharedUtils { static void write(MemorySegment ptr, Class type, Object o) { if (type == long.class) { - MemoryAccess.setLong(ptr, (long) o); + ptr.set(JAVA_LONG, 0, (long) o); } else if (type == int.class) { - MemoryAccess.setInt(ptr, (int) o); + ptr.set(JAVA_INT, 0, (int) o); } else if (type == short.class) { - MemoryAccess.setShort(ptr, (short) o); + ptr.set(JAVA_SHORT, 0, (short) o); } else if (type == char.class) { - MemoryAccess.setChar(ptr, (char) o); + ptr.set(JAVA_CHAR, 0, (char) o); } else if (type == byte.class) { - MemoryAccess.setByte(ptr, (byte) o); + ptr.set(JAVA_BYTE, 0, (byte) o); } else if (type == float.class) { - MemoryAccess.setFloat(ptr, (float) o); + ptr.set(JAVA_FLOAT, 0, (float) o); } else if (type == double.class) { - MemoryAccess.setDouble(ptr, (double) o); + ptr.set(JAVA_DOUBLE, 0, (double) o); + } else if (type == boolean.class) { + ptr.set(JAVA_BOOLEAN, 0, (boolean) o); } else { throw new IllegalArgumentException("Unsupported carrier: " + type); } @@ -678,21 +764,43 @@ public class SharedUtils { static Object read(MemorySegment ptr, Class type) { if (type == long.class) { - return MemoryAccess.getLong(ptr); + return ptr.get(JAVA_LONG, 0); } else if (type == int.class) { - return MemoryAccess.getInt(ptr); + return ptr.get(JAVA_INT, 0); } else if (type == short.class) { - return MemoryAccess.getShort(ptr); + return ptr.get(JAVA_SHORT, 0); } else if (type == char.class) { - return MemoryAccess.getChar(ptr); + return ptr.get(JAVA_CHAR, 0); } else if (type == byte.class) { - return MemoryAccess.getByte(ptr); + return ptr.get(JAVA_BYTE, 0); } else if (type == float.class) { - return MemoryAccess.getFloat(ptr); + return ptr.get(JAVA_FLOAT, 0); } else if (type == double.class) { - return MemoryAccess.getDouble(ptr); + return ptr.get(JAVA_DOUBLE, 0); + } else if (type == boolean.class) { + return ptr.get(JAVA_BOOLEAN, 0); } else { throw new IllegalArgumentException("Unsupported carrier: " + type); } } + + public static MethodType inferMethodType(FunctionDescriptor descriptor, boolean upcall) { + MethodType type = MethodType.methodType(descriptor.returnLayout().isPresent() ? + carrierFor(descriptor.returnLayout().get(), upcall) : void.class); + for (MemoryLayout argLayout : descriptor.argumentLayouts()) { + type = type.appendParameterTypes(carrierFor(argLayout, !upcall)); + } + return type; + } + + static Class carrierFor(MemoryLayout layout, boolean forArg) { + if (layout instanceof ValueLayout valueLayout) { + return (forArg && valueLayout.carrier().equals(MemoryAddress.class)) ? + Addressable.class : valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new IllegalArgumentException("Unsupported layout: " + layout); + } + } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallStubs.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallStubs.java index d417b8ad9ab..9f528dfacd0 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallStubs.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/UpcallStubs.java @@ -25,18 +25,13 @@ package jdk.internal.foreign.abi; import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; +import jdk.internal.foreign.NativeSymbolImpl; import jdk.internal.foreign.ResourceScopeImpl; -import jdk.internal.foreign.NativeMemorySegmentImpl; public class UpcallStubs { - public static MemoryAddress upcallAddress(UpcallHandler handler, ResourceScopeImpl scope) { - long stubAddress = handler.entryPoint(); - return NativeMemorySegmentImpl.makeNativeSegmentUnchecked(MemoryAddress.ofLong(stubAddress), 0, - () -> freeUpcallStub(stubAddress), scope).address(); - } - private static void freeUpcallStub(long stubAddress) { if (!freeUpcallStub0(stubAddress)) { throw new IllegalStateException("Not a stub address: " + stubAddress); @@ -52,4 +47,14 @@ public class UpcallStubs { static { registerNatives(); } + + static NativeSymbol makeUpcall(long entry, ResourceScope scope) { + ((ResourceScopeImpl)scope).addOrCleanupIfFail(new ResourceScopeImpl.ResourceList.ResourceCleanup() { + @Override + public void cleanup() { + freeUpcallStub(entry); + } + }); + return new NativeSymbolImpl("upcall:" + Long.toHexString(entry), MemoryAddress.ofLong(entry), scope); + } } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java index ef12d129bcb..abcef36500d 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java @@ -30,9 +30,10 @@ import jdk.incubator.foreign.GroupLayout; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; import jdk.internal.foreign.Utils; import jdk.internal.foreign.abi.CallingSequenceBuilder; -import jdk.internal.foreign.abi.UpcallHandler; import jdk.internal.foreign.abi.ABIDescriptor; import jdk.internal.foreign.abi.Binding; import jdk.internal.foreign.abi.CallingSequence; @@ -40,6 +41,8 @@ import jdk.internal.foreign.abi.ProgrammableInvoker; import jdk.internal.foreign.abi.ProgrammableUpcallHandler; import jdk.internal.foreign.abi.VMStorage; import jdk.internal.foreign.abi.SharedUtils; +import jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64CallArranger; +import jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64CallArranger; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; @@ -54,8 +57,12 @@ import static jdk.internal.foreign.abi.aarch64.AArch64Architecture.*; * to translate a C FunctionDescriptor into a CallingSequence2, which can then be turned into a MethodHandle. * * This includes taking care of synthetic arguments like pointers to return buffers for 'in-memory' returns. + * + * There are minor differences between the ABIs implemented on Linux, macOS, and Windows + * which are handled in sub-classes. Clients should access these through the provided + * public constants CallArranger.LINUX and CallArranger.MACOS. */ -public class CallArranger { +public abstract class CallArranger { private static final int STACK_SLOT_SIZE = 8; public static final int MAX_REGISTER_ARGUMENTS = 8; @@ -95,9 +102,20 @@ public class CallArranger { } } - public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { - SharedUtils.checkFunctionTypes(mt, cDesc, AArch64.C_POINTER.bitSize()); + public static final CallArranger LINUX = new LinuxAArch64CallArranger(); + public static final CallArranger MACOS = new MacOsAArch64CallArranger(); + + /** + * Are variadic arguments assigned to registers as in the standard calling + * convention, or always passed on the stack? + * + * @returns true if variadic arguments should be spilled to the stack. + */ + protected abstract boolean varArgsOnStack(); + + protected CallArranger() {} + public Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { CallingSequenceBuilder csb = new CallingSequenceBuilder(forUpcall); BindingCalculator argCalc = forUpcall ? new BoxBindingCalculator(true) : new UnboxBindingCalculator(true); @@ -116,6 +134,9 @@ public class CallArranger { for (int i = 0; i < mt.parameterCount(); i++) { Class carrier = mt.parameterType(i); MemoryLayout layout = cDesc.argumentLayouts().get(i); + if (varArgsOnStack() && SharedUtils.isVarargsIndex(cDesc, i)) { + argCalc.storageCalculator.adjustForVarArgs(); + } csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); } @@ -124,7 +145,7 @@ public class CallArranger { return new Bindings(csb.build(), returnInMemory); } - public static MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc) { + public MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc) { Bindings bindings = getBindings(mt, cDesc, false); MethodHandle handle = new ProgrammableInvoker(C, bindings.callingSequence).getBoundMethodHandle(); @@ -136,14 +157,14 @@ public class CallArranger { return handle; } - public static UpcallHandler arrangeUpcall(MethodHandle target, MethodType mt, FunctionDescriptor cDesc) { + public NativeSymbol arrangeUpcall(MethodHandle target, MethodType mt, FunctionDescriptor cDesc, ResourceScope scope) { Bindings bindings = getBindings(mt, cDesc, true); if (bindings.isInMemoryReturn) { target = SharedUtils.adaptUpcallForIMR(target, true /* drop return, since we don't have bindings for it */); } - return ProgrammableUpcallHandler.make(C, target, bindings.callingSequence); + return ProgrammableUpcallHandler.make(C, target, bindings.callingSequence,scope); } private static boolean isInMemoryReturn(Optional returnLayout) { @@ -208,18 +229,15 @@ public class CallArranger { return storage[0]; } - void adjustForVarArgs(MemoryLayout layout) { - if (layout.attribute(AArch64.STACK_VARARGS_ATTRIBUTE_NAME) - .map(Boolean.class::cast).orElse(false)) { - // This system passes all variadic parameters on the stack. Ensure - // no further arguments are allocated to registers. - nRegs[StorageClasses.INTEGER] = MAX_REGISTER_ARGUMENTS; - nRegs[StorageClasses.VECTOR] = MAX_REGISTER_ARGUMENTS; - } + void adjustForVarArgs() { + // This system passes all variadic parameters on the stack. Ensure + // no further arguments are allocated to registers. + nRegs[StorageClasses.INTEGER] = MAX_REGISTER_ARGUMENTS; + nRegs[StorageClasses.VECTOR] = MAX_REGISTER_ARGUMENTS; } } - static abstract class BindingCalculator { + abstract static class BindingCalculator { protected final StorageCalculator storageCalculator; protected BindingCalculator(boolean forArguments) { @@ -288,7 +306,6 @@ public class CallArranger { List getBindings(Class carrier, MemoryLayout layout) { TypeClass argumentClass = TypeClass.classifyLayout(layout); Binding.Builder bindings = Binding.builder(); - storageCalculator.adjustForVarArgs(layout); switch (argumentClass) { case STRUCT_REGISTER: { assert carrier == MemorySegment.class; @@ -317,8 +334,7 @@ public class CallArranger { case STRUCT_REFERENCE: { assert carrier == MemorySegment.class; bindings.copy(layout) - .baseAddress() - .unboxAddress(); + .unboxAddress(MemorySegment.class); VMStorage storage = storageCalculator.nextStorage( StorageClasses.INTEGER, AArch64.C_POINTER); bindings.vmStore(storage, long.class); @@ -349,7 +365,7 @@ public class CallArranger { break; } case POINTER: { - bindings.unboxAddress(); + bindings.unboxAddress(carrier); VMStorage storage = storageCalculator.nextStorage(StorageClasses.INTEGER, layout); bindings.vmStore(storage, long.class); @@ -391,7 +407,6 @@ public class CallArranger { List getBindings(Class carrier, MemoryLayout layout) { TypeClass argumentClass = TypeClass.classifyLayout(layout); Binding.Builder bindings = Binding.builder(); - assert !layout.attribute(AArch64.STACK_VARARGS_ATTRIBUTE_NAME).isPresent() : "no variadic upcalls"; switch (argumentClass) { case STRUCT_REGISTER: { assert carrier == MemorySegment.class; diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/TypeClass.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/TypeClass.java index 781d6851b5b..5514d300daa 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/TypeClass.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/TypeClass.java @@ -26,10 +26,10 @@ package jdk.internal.foreign.abi.aarch64; import jdk.incubator.foreign.GroupLayout; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.SequenceLayout; import jdk.incubator.foreign.ValueLayout; -import jdk.internal.foreign.PlatformLayouts; public enum TypeClass { STRUCT_REGISTER, @@ -42,11 +42,17 @@ public enum TypeClass { private static final int MAX_AGGREGATE_REGS_SIZE = 2; private static TypeClass classifyValueType(ValueLayout type) { - return switch (PlatformLayouts.getKind(type)) { - case CHAR, SHORT, INT, LONG, LONG_LONG -> INTEGER; - case POINTER -> POINTER; - case FLOAT, DOUBLE -> FLOAT; - }; + Class carrier = type.carrier(); + if (carrier == boolean.class || carrier == byte.class || carrier == char.class || + carrier == short.class || carrier == int.class || carrier == long.class) { + return INTEGER; + } else if (carrier == float.class || carrier == double.class) { + return FLOAT; + } else if (carrier == MemoryAddress.class) { + return POINTER; + } else { + throw new IllegalStateException("Cannot get here: " + carrier.getName()); + } } static boolean isRegisterAggregate(MemoryLayout type) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64CallArranger.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64CallArranger.java new file mode 100644 index 00000000000..044f4a83266 --- /dev/null +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64CallArranger.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, Arm Limited. All rights reserved. + * 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.foreign.abi.aarch64.linux; + +import jdk.internal.foreign.abi.aarch64.*; + +/** + * AArch64 CallArranger specialized for Linux ABI. + */ +public class LinuxAArch64CallArranger extends CallArranger { + + @Override + protected boolean varArgsOnStack() { + // Variadic arguments are passed as normal arguments + return false; + } + +} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64Linker.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64Linker.java index d2a0db203bf..aca622ab5ba 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64Linker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64Linker.java @@ -25,14 +25,14 @@ */ package jdk.internal.foreign.abi.aarch64.linux; +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; -import jdk.internal.foreign.AbstractCLinker; -import jdk.internal.foreign.ResourceScopeImpl; +import jdk.incubator.foreign.VaList; import jdk.internal.foreign.abi.SharedUtils; -import jdk.internal.foreign.abi.UpcallStubs; import jdk.internal.foreign.abi.aarch64.CallArranger; import java.lang.invoke.MethodHandle; @@ -45,26 +45,11 @@ import java.util.function.Consumer; * ABI implementation based on ARM document "Procedure Call Standard for * the ARM 64-bit Architecture". */ -public final class LinuxAArch64Linker extends AbstractCLinker { +public final class LinuxAArch64Linker implements CLinker { private static LinuxAArch64Linker instance; static final long ADDRESS_SIZE = 64; // bits - private static final MethodHandle MH_unboxVaList; - private static final MethodHandle MH_boxVaList; - - static { - try { - MethodHandles.Lookup lookup = MethodHandles.lookup(); - MH_unboxVaList = lookup.findVirtual(VaList.class, "address", - MethodType.methodType(MemoryAddress.class)); - MH_boxVaList = MethodHandles.insertArguments(lookup.findStatic(LinuxAArch64Linker.class, "newVaListOfAddress", - MethodType.methodType(VaList.class, MemoryAddress.class, ResourceScope.class)), 1, ResourceScope.globalScope()); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } - public static LinuxAArch64Linker getInstance() { if (instance == null) { instance = new LinuxAArch64Linker(); @@ -73,26 +58,28 @@ public final class LinuxAArch64Linker extends AbstractCLinker { } @Override - public final MethodHandle downcallHandle(MethodType type, FunctionDescriptor function) { - Objects.requireNonNull(type); + public final MethodHandle downcallHandle(FunctionDescriptor function) { Objects.requireNonNull(function); - MethodType llMt = SharedUtils.convertVaListCarriers(type, LinuxAArch64VaList.CARRIER); - MethodHandle handle = CallArranger.arrangeDowncall(llMt, function); + MethodType type = SharedUtils.inferMethodType(function, false); + MethodHandle handle = CallArranger.LINUX.arrangeDowncall(type, function); if (!type.returnType().equals(MemorySegment.class)) { // not returning segment, just insert a throwing allocator handle = MethodHandles.insertArguments(handle, 1, SharedUtils.THROWING_ALLOCATOR); } - handle = SharedUtils.unboxVaLists(type, handle, MH_unboxVaList); - return handle; + return SharedUtils.wrapDowncall(handle, function); } @Override - public final MemoryAddress upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { + public final NativeSymbol upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { Objects.requireNonNull(scope); Objects.requireNonNull(target); Objects.requireNonNull(function); - target = SharedUtils.boxVaLists(target, MH_boxVaList); - return UpcallStubs.upcallAddress(CallArranger.arrangeUpcall(target, target.type(), function), (ResourceScopeImpl) scope); + SharedUtils.checkExceptions(target); + MethodType type = SharedUtils.inferMethodType(function, true); + if (!type.equals(target.type())) { + throw new IllegalArgumentException("Wrong method handle type: " + target.type()); + } + return CallArranger.LINUX.arrangeUpcall(target, target.type(), function, scope); } public static VaList newVaList(Consumer actions, ResourceScope scope) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64VaList.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64VaList.java index 567ec2d4bd5..457b798274f 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64VaList.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/linux/LinuxAArch64VaList.java @@ -26,32 +26,30 @@ package jdk.internal.foreign.abi.aarch64.linux; import jdk.incubator.foreign.*; +import jdk.internal.foreign.ResourceScopeImpl; +import jdk.internal.foreign.Scoped; import jdk.internal.foreign.Utils; import jdk.internal.foreign.abi.SharedUtils; import jdk.internal.foreign.abi.aarch64.*; import jdk.internal.misc.Unsafe; import java.lang.invoke.VarHandle; -import java.lang.ref.Cleaner; -import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import java.util.Objects; import static jdk.internal.foreign.PlatformLayouts.AArch64; -import static jdk.incubator.foreign.CLinker.VaList; + import static jdk.incubator.foreign.MemoryLayout.PathElement.groupElement; import static jdk.internal.foreign.abi.SharedUtils.SimpleVaArg; import static jdk.internal.foreign.abi.SharedUtils.THROWING_ALLOCATOR; -import static jdk.internal.foreign.abi.SharedUtils.checkCompatibleType; -import static jdk.internal.foreign.abi.SharedUtils.vhPrimitiveOrAddress; import static jdk.internal.foreign.abi.aarch64.CallArranger.MAX_REGISTER_ARGUMENTS; /** * Standard va_list implementation as defined by AAPCS document and used on * Linux. Variadic parameters may be passed in registers or on the stack. */ -public non-sealed class LinuxAArch64VaList implements VaList { +public non-sealed class LinuxAArch64VaList implements VaList, Scoped { private static final Unsafe U = Unsafe.getUnsafe(); static final Class CARRIER = MemoryAddress.class; @@ -76,9 +74,9 @@ public non-sealed class LinuxAArch64VaList implements VaList { ).withName("__va_list"); private static final MemoryLayout GP_REG - = MemoryLayout.valueLayout(64, ByteOrder.nativeOrder()); + = MemoryLayout.paddingLayout(64).withBitAlignment(64); private static final MemoryLayout FP_REG - = MemoryLayout.valueLayout(128, ByteOrder.nativeOrder()); + = MemoryLayout.paddingLayout(128).withBitAlignment(128); private static final MemoryLayout LAYOUT_GP_REGS = MemoryLayout.sequenceLayout(MAX_REGISTER_ARGUMENTS, GP_REG); @@ -91,18 +89,14 @@ public non-sealed class LinuxAArch64VaList implements VaList { private static final int MAX_GP_OFFSET = (int) LAYOUT_GP_REGS.byteSize(); private static final int MAX_FP_OFFSET = (int) LAYOUT_FP_REGS.byteSize(); - private static final VarHandle VH_stack - = MemoryHandles.asAddressVarHandle(LAYOUT.varHandle(long.class, groupElement("__stack"))); - private static final VarHandle VH_gr_top - = MemoryHandles.asAddressVarHandle(LAYOUT.varHandle(long.class, groupElement("__gr_top"))); - private static final VarHandle VH_vr_top - = MemoryHandles.asAddressVarHandle(LAYOUT.varHandle(long.class, groupElement("__vr_top"))); + private static final VarHandle VH_stack = LAYOUT.varHandle(groupElement("__stack")); + private static final VarHandle VH_gr_top = LAYOUT.varHandle(groupElement("__gr_top")); + private static final VarHandle VH_vr_top = LAYOUT.varHandle(groupElement("__vr_top")); private static final VarHandle VH_gr_offs - = LAYOUT.varHandle(int.class, groupElement("__gr_offs")); + = LAYOUT.varHandle(groupElement("__gr_offs")); private static final VarHandle VH_vr_offs - = LAYOUT.varHandle(int.class, groupElement("__vr_offs")); + = LAYOUT.varHandle(groupElement("__vr_offs")); - private static final Cleaner cleaner = Cleaner.create(); private static final VaList EMPTY = new SharedUtils.EmptyVaList(emptyListAddress()); @@ -117,19 +111,20 @@ public non-sealed class LinuxAArch64VaList implements VaList { } private static LinuxAArch64VaList readFromSegment(MemorySegment segment) { - MemorySegment gpRegsArea = grTop(segment).addOffset(-MAX_GP_OFFSET).asSegment( + MemorySegment gpRegsArea = MemorySegment.ofAddress(grTop(segment).addOffset(-MAX_GP_OFFSET), MAX_GP_OFFSET, segment.scope()); - MemorySegment fpRegsArea = vrTop(segment).addOffset(-MAX_FP_OFFSET).asSegment( + MemorySegment fpRegsArea = MemorySegment.ofAddress(vrTop(segment).addOffset(-MAX_FP_OFFSET), MAX_FP_OFFSET, segment.scope()); return new LinuxAArch64VaList(segment, gpRegsArea, fpRegsArea); } private static MemoryAddress emptyListAddress() { long ptr = U.allocateMemory(LAYOUT.byteSize()); - MemorySegment ms = MemoryAddress.ofLong(ptr).asSegment( - LAYOUT.byteSize(), () -> U.freeMemory(ptr), ResourceScope.newSharedScope()); - cleaner.register(LinuxAArch64VaList.class, () -> ms.scope().close()); + ResourceScope scope = ResourceScope.newImplicitScope(); + scope.addCloseAction(() -> U.freeMemory(ptr)); + MemorySegment ms = MemorySegment.ofAddress(MemoryAddress.ofLong(ptr), + LAYOUT.byteSize(), scope); VH_stack.set(ms, MemoryAddress.NULL); VH_gr_top.set(ms, MemoryAddress.NULL); VH_vr_top.set(ms, MemoryAddress.NULL); @@ -215,58 +210,51 @@ public non-sealed class LinuxAArch64VaList implements VaList { } @Override - public int vargAsInt(MemoryLayout layout) { + public int nextVarg(ValueLayout.OfInt layout) { return (int) read(int.class, layout); } @Override - public long vargAsLong(MemoryLayout layout) { + public long nextVarg(ValueLayout.OfLong layout) { return (long) read(long.class, layout); } @Override - public double vargAsDouble(MemoryLayout layout) { + public double nextVarg(ValueLayout.OfDouble layout) { return (double) read(double.class, layout); } @Override - public MemoryAddress vargAsAddress(MemoryLayout layout) { + public MemoryAddress nextVarg(ValueLayout.OfAddress layout) { return (MemoryAddress) read(MemoryAddress.class, layout); } @Override - public MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator) { + public MemorySegment nextVarg(GroupLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(allocator); return (MemorySegment) read(MemorySegment.class, layout, allocator); } - @Override - public MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope) { - return vargAsSegment(layout, SegmentAllocator.ofScope(scope)); - } - private Object read(Class carrier, MemoryLayout layout) { return read(carrier, layout, THROWING_ALLOCATOR); } private Object read(Class carrier, MemoryLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(layout); - checkCompatibleType(carrier, layout, LinuxAArch64Linker.ADDRESS_SIZE); - TypeClass typeClass = TypeClass.classifyLayout(layout); if (isRegOverflow(currentGPOffset(), currentFPOffset(), typeClass, layout)) { preAlignStack(layout); return switch (typeClass) { case STRUCT_REGISTER, STRUCT_HFA, STRUCT_REFERENCE -> { - MemorySegment slice = stackPtr().asSegment(layout.byteSize(), scope()); + MemorySegment slice = MemorySegment.ofAddress(stackPtr(), layout.byteSize(), scope()); MemorySegment seg = allocator.allocate(layout); seg.copyFrom(slice); postAlignStack(layout); yield seg; } case POINTER, INTEGER, FLOAT -> { - VarHandle reader = vhPrimitiveOrAddress(carrier, layout); - MemorySegment slice = stackPtr().asSegment(layout.byteSize(), scope()); + VarHandle reader = layout.varHandle(); + MemorySegment slice = MemorySegment.ofAddress(stackPtr(), layout.byteSize(), scope()); Object res = reader.get(slice); postAlignStack(layout); yield res; @@ -280,8 +268,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { long offset = 0; while (offset < layout.byteSize()) { final long copy = Math.min(layout.byteSize() - offset, 8); - MemorySegment slice = value.asSlice(offset, copy); - slice.copyFrom(gpRegsArea.asSlice(currentGPOffset(), copy)); + MemorySegment.copy(gpRegsArea, currentGPOffset(), value, offset, copy); consumeGPSlots(1); offset += copy; } @@ -296,8 +283,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { for (MemoryLayout elem : group.memberLayouts()) { assert elem.byteSize() <= 8; final long copy = elem.byteSize(); - MemorySegment slice = value.asSlice(offset, copy); - slice.copyFrom(fpRegsArea.asSlice(currentFPOffset(), copy)); + MemorySegment.copy(fpRegsArea, currentFPOffset(), value, offset, copy); consumeFPSlots(1); offset += copy; } @@ -305,25 +291,24 @@ public non-sealed class LinuxAArch64VaList implements VaList { } case STRUCT_REFERENCE -> { // Struct is passed indirectly via a pointer in an integer register. - VarHandle ptrReader - = SharedUtils.vhPrimitiveOrAddress(MemoryAddress.class, AArch64.C_POINTER); + VarHandle ptrReader = AArch64.C_POINTER.varHandle(); MemoryAddress ptr = (MemoryAddress) ptrReader.get( gpRegsArea.asSlice(currentGPOffset())); consumeGPSlots(1); - MemorySegment slice = ptr.asSegment(layout.byteSize(), scope()); + MemorySegment slice = MemorySegment.ofAddress(ptr, layout.byteSize(), scope()); MemorySegment seg = allocator.allocate(layout); seg.copyFrom(slice); yield seg; } case POINTER, INTEGER -> { - VarHandle reader = SharedUtils.vhPrimitiveOrAddress(carrier, layout); + VarHandle reader = layout.varHandle(); Object res = reader.get(gpRegsArea.asSlice(currentGPOffset())); consumeGPSlots(1); yield res; } case FLOAT -> { - VarHandle reader = layout.varHandle(carrier); + VarHandle reader = layout.varHandle(); Object res = reader.get(fpRegsArea.asSlice(currentFPOffset())); consumeFPSlots(1); yield res; @@ -335,6 +320,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { @Override public void skip(MemoryLayout... layouts) { Objects.requireNonNull(layouts); + ((ResourceScopeImpl)segment.scope()).checkValidStateSlow(); for (MemoryLayout layout : layouts) { Objects.requireNonNull(layout); TypeClass typeClass = TypeClass.classifyLayout(layout); @@ -356,7 +342,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { } public static VaList ofAddress(MemoryAddress ma, ResourceScope scope) { - return readFromSegment(ma.asSegment(LAYOUT.byteSize(), scope)); + return readFromSegment(MemorySegment.ofAddress(ma, LAYOUT.byteSize(), scope)); } @Override @@ -418,35 +404,33 @@ public non-sealed class LinuxAArch64VaList implements VaList { } @Override - public Builder vargFromInt(ValueLayout layout, int value) { + public Builder addVarg(ValueLayout.OfInt layout, int value) { return arg(int.class, layout, value); } @Override - public Builder vargFromLong(ValueLayout layout, long value) { + public Builder addVarg(ValueLayout.OfLong layout, long value) { return arg(long.class, layout, value); } @Override - public Builder vargFromDouble(ValueLayout layout, double value) { + public Builder addVarg(ValueLayout.OfDouble layout, double value) { return arg(double.class, layout, value); } @Override - public Builder vargFromAddress(ValueLayout layout, Addressable value) { + public Builder addVarg(ValueLayout.OfAddress layout, Addressable value) { return arg(MemoryAddress.class, layout, value.address()); } @Override - public Builder vargFromSegment(GroupLayout layout, MemorySegment value) { + public Builder addVarg(GroupLayout layout, MemorySegment value) { return arg(MemorySegment.class, layout, value); } private Builder arg(Class carrier, MemoryLayout layout, Object value) { Objects.requireNonNull(layout); Objects.requireNonNull(value); - checkCompatibleType(carrier, layout, LinuxAArch64Linker.ADDRESS_SIZE); - TypeClass typeClass = TypeClass.classifyLayout(layout); if (isRegOverflow(currentGPOffset, currentFPOffset, typeClass, layout)) { stackArgs.add(new SimpleVaArg(carrier, layout, value)); @@ -458,8 +442,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { long offset = 0; while (offset < layout.byteSize()) { final long copy = Math.min(layout.byteSize() - offset, 8); - MemorySegment slice = valueSegment.asSlice(offset, copy); - gpRegs.asSlice(currentGPOffset, copy).copyFrom(slice); + MemorySegment.copy(valueSegment, offset, gpRegs, currentGPOffset, copy); currentGPOffset += GP_SLOT_SIZE; offset += copy; } @@ -473,8 +456,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { for (MemoryLayout elem : group.memberLayouts()) { assert elem.byteSize() <= 8; final long copy = elem.byteSize(); - MemorySegment slice = valueSegment.asSlice(offset, copy); - fpRegs.asSlice(currentFPOffset, copy).copyFrom(slice); + MemorySegment.copy(valueSegment, offset, fpRegs, currentFPOffset, copy); currentFPOffset += FP_SLOT_SIZE; offset += copy; } @@ -482,20 +464,18 @@ public non-sealed class LinuxAArch64VaList implements VaList { case STRUCT_REFERENCE -> { // Struct is passed indirectly via a pointer in an integer register. MemorySegment valueSegment = (MemorySegment) value; - VarHandle writer - = SharedUtils.vhPrimitiveOrAddress(MemoryAddress.class, - AArch64.C_POINTER); + VarHandle writer = AArch64.C_POINTER.varHandle(); writer.set(gpRegs.asSlice(currentGPOffset), valueSegment.address()); currentGPOffset += GP_SLOT_SIZE; } case POINTER, INTEGER -> { - VarHandle writer = SharedUtils.vhPrimitiveOrAddress(carrier, layout); + VarHandle writer = layout.varHandle(); writer.set(gpRegs.asSlice(currentGPOffset), value); currentGPOffset += GP_SLOT_SIZE; } case FLOAT -> { - VarHandle writer = layout.varHandle(carrier); + VarHandle writer = layout.varHandle(); writer.set(fpRegs.asSlice(currentFPOffset), value); currentFPOffset += FP_SLOT_SIZE; } @@ -513,7 +493,7 @@ public non-sealed class LinuxAArch64VaList implements VaList { return EMPTY; } - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); MemorySegment vaListSegment = allocator.allocate(LAYOUT); MemoryAddress stackArgsPtr = MemoryAddress.NULL; if (!stackArgs.isEmpty()) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64CallArranger.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64CallArranger.java new file mode 100644 index 00000000000..8b35583e5c3 --- /dev/null +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64CallArranger.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, Arm Limited. All rights reserved. + * 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.internal.foreign.abi.aarch64.macos; + +import jdk.internal.foreign.abi.aarch64.*; + +/** + * AArch64 CallArranger specialized for macOS ABI. + */ +public class MacOsAArch64CallArranger extends CallArranger { + + @Override + protected boolean varArgsOnStack() { + // Variadic arguments are always passed on the stack + return true; + } + +} diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64Linker.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64Linker.java index 1e644bf8760..13b30a0f68f 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64Linker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64Linker.java @@ -25,16 +25,14 @@ */ package jdk.internal.foreign.abi.aarch64.macos; -import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; -import jdk.internal.foreign.AbstractCLinker; -import jdk.internal.foreign.ResourceScopeImpl; +import jdk.incubator.foreign.VaList; import jdk.internal.foreign.abi.SharedUtils; -import jdk.internal.foreign.abi.UpcallStubs; import jdk.internal.foreign.abi.aarch64.CallArranger; import java.lang.invoke.MethodHandle; @@ -43,32 +41,15 @@ import java.lang.invoke.MethodType; import java.util.Objects; import java.util.function.Consumer; -import static jdk.internal.foreign.PlatformLayouts.*; - /** * ABI implementation for macOS on Apple silicon. Based on AAPCS with * changes to va_list and passing arguments on the stack. */ -public final class MacOsAArch64Linker extends AbstractCLinker { +public final class MacOsAArch64Linker implements CLinker { private static MacOsAArch64Linker instance; static final long ADDRESS_SIZE = 64; // bits - private static final MethodHandle MH_unboxVaList; - private static final MethodHandle MH_boxVaList; - - static { - try { - MethodHandles.Lookup lookup = MethodHandles.lookup(); - MH_unboxVaList = lookup.findVirtual(VaList.class, "address", - MethodType.methodType(MemoryAddress.class)); - MH_boxVaList = MethodHandles.insertArguments(lookup.findStatic(MacOsAArch64Linker.class, "newVaListOfAddress", - MethodType.methodType(VaList.class, MemoryAddress.class, ResourceScope.class)), 1, ResourceScope.globalScope()); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } - public static MacOsAArch64Linker getInstance() { if (instance == null) { instance = new MacOsAArch64Linker(); @@ -77,26 +58,27 @@ public final class MacOsAArch64Linker extends AbstractCLinker { } @Override - public final MethodHandle downcallHandle(MethodType type, FunctionDescriptor function) { - Objects.requireNonNull(type); + public final MethodHandle downcallHandle(FunctionDescriptor function) { Objects.requireNonNull(function); - MethodType llMt = SharedUtils.convertVaListCarriers(type, MacOsAArch64VaList.CARRIER); - MethodHandle handle = CallArranger.arrangeDowncall(llMt, function); + MethodType type = SharedUtils.inferMethodType(function, false); + MethodHandle handle = CallArranger.MACOS.arrangeDowncall(type, function); if (!type.returnType().equals(MemorySegment.class)) { // not returning segment, just insert a throwing allocator handle = MethodHandles.insertArguments(handle, 1, SharedUtils.THROWING_ALLOCATOR); } - handle = SharedUtils.unboxVaLists(type, handle, MH_unboxVaList); - return handle; + return SharedUtils.wrapDowncall(handle, function); } @Override - public final MemoryAddress upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { + public final NativeSymbol upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { Objects.requireNonNull(scope); Objects.requireNonNull(target); Objects.requireNonNull(function); - target = SharedUtils.boxVaLists(target, MH_boxVaList); - return UpcallStubs.upcallAddress(CallArranger.arrangeUpcall(target, target.type(), function), (ResourceScopeImpl) scope); + MethodType type = SharedUtils.inferMethodType(function, true); + if (!type.equals(target.type())) { + throw new IllegalArgumentException("Wrong method handle type: " + target.type()); + } + return CallArranger.MACOS.arrangeUpcall(target, target.type(), function, scope); } public static VaList newVaList(Consumer actions, ResourceScope scope) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64VaList.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64VaList.java index e456983bb16..022235eb776 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64VaList.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/aarch64/macos/MacOsAArch64VaList.java @@ -26,7 +26,7 @@ package jdk.internal.foreign.abi.aarch64.macos; import jdk.incubator.foreign.*; -import jdk.incubator.foreign.CLinker.VaList; +import jdk.internal.foreign.Scoped; import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.foreign.abi.SharedUtils; import jdk.internal.foreign.abi.SharedUtils.SimpleVaArg; @@ -45,10 +45,10 @@ import static jdk.internal.foreign.abi.SharedUtils.alignUp; * parameters are passed on the stack and the type of va_list decays to * char* instead of the structure defined in the AAPCS. */ -public non-sealed class MacOsAArch64VaList implements VaList { +public non-sealed class MacOsAArch64VaList implements VaList, Scoped { public static final Class CARRIER = MemoryAddress.class; private static final long VA_SLOT_SIZE_BYTES = 8; - private static final VarHandle VH_address = MemoryHandles.asAddressVarHandle(C_POINTER.varHandle(long.class)); + private static final VarHandle VH_address = C_POINTER.varHandle(); private static final VaList EMPTY = new SharedUtils.EmptyVaList(MemoryAddress.NULL); @@ -65,65 +65,59 @@ public non-sealed class MacOsAArch64VaList implements VaList { } @Override - public int vargAsInt(MemoryLayout layout) { + public int nextVarg(ValueLayout.OfInt layout) { return (int) read(int.class, layout); } @Override - public long vargAsLong(MemoryLayout layout) { + public long nextVarg(ValueLayout.OfLong layout) { return (long) read(long.class, layout); } @Override - public double vargAsDouble(MemoryLayout layout) { + public double nextVarg(ValueLayout.OfDouble layout) { return (double) read(double.class, layout); } @Override - public MemoryAddress vargAsAddress(MemoryLayout layout) { + public MemoryAddress nextVarg(ValueLayout.OfAddress layout) { return (MemoryAddress) read(MemoryAddress.class, layout); } @Override - public MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator) { + public MemorySegment nextVarg(GroupLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(allocator); return (MemorySegment) read(MemorySegment.class, layout, allocator); } - @Override - public MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope) { - return vargAsSegment(layout, SegmentAllocator.ofScope(scope)); - } - private Object read(Class carrier, MemoryLayout layout) { return read(carrier, layout, SharedUtils.THROWING_ALLOCATOR); } private Object read(Class carrier, MemoryLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(layout); - SharedUtils.checkCompatibleType(carrier, layout, MacOsAArch64Linker.ADDRESS_SIZE); Object res; if (carrier == MemorySegment.class) { TypeClass typeClass = TypeClass.classifyLayout(layout); res = switch (typeClass) { case STRUCT_REFERENCE -> { MemoryAddress structAddr = (MemoryAddress) VH_address.get(segment); - MemorySegment struct = structAddr.asSegment(layout.byteSize(), scope()); + MemorySegment struct = MemorySegment.ofAddress(structAddr, layout.byteSize(), scope()); MemorySegment seg = allocator.allocate(layout); seg.copyFrom(struct); segment = segment.asSlice(VA_SLOT_SIZE_BYTES); yield seg; } case STRUCT_REGISTER, STRUCT_HFA -> { - MemorySegment struct = allocator.allocate(layout); - struct.copyFrom(segment.asSlice(0L, layout.byteSize())); + MemorySegment struct = allocator.allocate(layout) + .copyFrom(segment.asSlice(0, layout.byteSize())); segment = segment.asSlice(alignUp(layout.byteSize(), VA_SLOT_SIZE_BYTES)); yield struct; } default -> throw new IllegalStateException("Unexpected TypeClass: " + typeClass); }; } else { - VarHandle reader = SharedUtils.vhPrimitiveOrAddress(carrier, layout); + VarHandle reader = layout.varHandle(); res = reader.get(segment); segment = segment.asSlice(VA_SLOT_SIZE_BYTES); } @@ -133,6 +127,7 @@ public non-sealed class MacOsAArch64VaList implements VaList { @Override public void skip(MemoryLayout... layouts) { Objects.requireNonNull(layouts); + ((ResourceScopeImpl)scope).checkValidStateSlow(); for (MemoryLayout layout : layouts) { Objects.requireNonNull(layout); @@ -144,7 +139,7 @@ public non-sealed class MacOsAArch64VaList implements VaList { } static MacOsAArch64VaList ofAddress(MemoryAddress addr, ResourceScope scope) { - MemorySegment segment = addr.asSegment(Long.MAX_VALUE, scope); + MemorySegment segment = MemorySegment.ofAddress(addr, Long.MAX_VALUE, scope); return new MacOsAArch64VaList(segment, scope); } @@ -181,33 +176,32 @@ public non-sealed class MacOsAArch64VaList implements VaList { private Builder arg(Class carrier, MemoryLayout layout, Object value) { Objects.requireNonNull(layout); Objects.requireNonNull(value); - SharedUtils.checkCompatibleType(carrier, layout, MacOsAArch64Linker.ADDRESS_SIZE); args.add(new SimpleVaArg(carrier, layout, value)); return this; } @Override - public Builder vargFromInt(ValueLayout layout, int value) { + public Builder addVarg(ValueLayout.OfInt layout, int value) { return arg(int.class, layout, value); } @Override - public Builder vargFromLong(ValueLayout layout, long value) { + public Builder addVarg(ValueLayout.OfLong layout, long value) { return arg(long.class, layout, value); } @Override - public Builder vargFromDouble(ValueLayout layout, double value) { + public Builder addVarg(ValueLayout.OfDouble layout, double value) { return arg(double.class, layout, value); } @Override - public Builder vargFromAddress(ValueLayout layout, Addressable value) { + public Builder addVarg(ValueLayout.OfAddress layout, Addressable value) { return arg(MemoryAddress.class, layout, value.address()); } @Override - public Builder vargFromSegment(GroupLayout layout, MemorySegment value) { + public Builder addVarg(GroupLayout layout, MemorySegment value) { return arg(MemorySegment.class, layout, value); } @@ -216,7 +210,7 @@ public non-sealed class MacOsAArch64VaList implements VaList { return EMPTY; } - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); // Each argument may occupy up to four slots MemorySegment segment = allocator.allocate(VA_SLOT_SIZE_BYTES * args.size() * 4); @@ -237,10 +231,9 @@ public non-sealed class MacOsAArch64VaList implements VaList { VH_address.set(cursor, copy.address()); cursor = cursor.asSlice(VA_SLOT_SIZE_BYTES); } - case STRUCT_REGISTER, STRUCT_HFA -> { - cursor.copyFrom(msArg.asSlice(0, arg.layout.byteSize())); - cursor = cursor.asSlice(alignUp(arg.layout.byteSize(), VA_SLOT_SIZE_BYTES)); - } + case STRUCT_REGISTER, STRUCT_HFA -> + cursor.copyFrom(msArg.asSlice(0, arg.layout.byteSize())) + .asSlice(alignUp(arg.layout.byteSize(), VA_SLOT_SIZE_BYTES)); default -> throw new IllegalStateException("Unexpected TypeClass: " + typeClass); } } else { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java index f7f2ddd8139..188106c2e6f 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java @@ -30,8 +30,9 @@ import jdk.incubator.foreign.GroupLayout; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; import jdk.internal.foreign.abi.CallingSequenceBuilder; -import jdk.internal.foreign.abi.UpcallHandler; import jdk.internal.foreign.abi.ABIDescriptor; import jdk.internal.foreign.abi.Binding; import jdk.internal.foreign.abi.CallingSequence; @@ -86,8 +87,6 @@ public class CallArranger { } public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { - SharedUtils.checkFunctionTypes(mt, cDesc, SysVx64Linker.ADDRESS_SIZE); - CallingSequenceBuilder csb = new CallingSequenceBuilder(forUpcall); BindingCalculator argCalc = forUpcall ? new BoxBindingCalculator(true) : new UnboxBindingCalculator(true); @@ -134,14 +133,14 @@ public class CallArranger { return handle; } - public static UpcallHandler arrangeUpcall(MethodHandle target, MethodType mt, FunctionDescriptor cDesc) { + public static NativeSymbol arrangeUpcall(MethodHandle target, MethodType mt, FunctionDescriptor cDesc, ResourceScope scope) { Bindings bindings = getBindings(mt, cDesc, true); if (bindings.isInMemoryReturn) { target = SharedUtils.adaptUpcallForIMR(target, true /* drop return, since we don't have bindings for it */); } - return ProgrammableUpcallHandler.make(CSysV, target, bindings.callingSequence); + return ProgrammableUpcallHandler.make(CSysV, target, bindings.callingSequence, scope); } private static boolean isInMemoryReturn(Optional returnLayout) { @@ -239,7 +238,7 @@ public class CallArranger { } } - static abstract class BindingCalculator { + abstract static class BindingCalculator { protected final StorageCalculator storageCalculator; protected BindingCalculator(boolean forArguments) { @@ -280,7 +279,7 @@ public class CallArranger { break; } case POINTER: { - bindings.unboxAddress(); + bindings.unboxAddress(carrier); VMStorage storage = storageCalculator.nextStorage(StorageClasses.INTEGER); bindings.vmStore(storage, long.class); break; diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVVaList.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVVaList.java index 4a74ebfa0d5..66fe2b97c4d 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVVaList.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVVaList.java @@ -26,27 +26,25 @@ package jdk.internal.foreign.abi.x64.sysv; import jdk.incubator.foreign.*; +import jdk.internal.foreign.ResourceScopeImpl; +import jdk.internal.foreign.Scoped; import jdk.internal.foreign.Utils; import jdk.internal.foreign.abi.SharedUtils; import jdk.internal.misc.Unsafe; import java.lang.invoke.VarHandle; -import java.lang.ref.Cleaner; -import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import java.util.Objects; import static jdk.internal.foreign.PlatformLayouts.SysV; -import static jdk.incubator.foreign.CLinker.VaList; + import static jdk.incubator.foreign.MemoryLayout.PathElement.groupElement; import static jdk.internal.foreign.abi.SharedUtils.SimpleVaArg; import static jdk.internal.foreign.abi.SharedUtils.THROWING_ALLOCATOR; -import static jdk.internal.foreign.abi.SharedUtils.checkCompatibleType; -import static jdk.internal.foreign.abi.SharedUtils.vhPrimitiveOrAddress; // See https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf "3.5.7 Variable Argument Lists" -public non-sealed class SysVVaList implements VaList { +public non-sealed class SysVVaList implements VaList, Scoped { private static final Unsafe U = Unsafe.getUnsafe(); static final Class CARRIER = MemoryAddress.class; @@ -67,8 +65,8 @@ public non-sealed class SysVVaList implements VaList { SysV.C_POINTER.withName("reg_save_area") ).withName("__va_list_tag"); - private static final MemoryLayout GP_REG = MemoryLayout.valueLayout(64, ByteOrder.nativeOrder()); - private static final MemoryLayout FP_REG = MemoryLayout.valueLayout(128, ByteOrder.nativeOrder()); + private static final MemoryLayout GP_REG = MemoryLayout.paddingLayout(64).withBitAlignment(64); + private static final MemoryLayout FP_REG = MemoryLayout.paddingLayout(128).withBitAlignment(128); private static final GroupLayout LAYOUT_REG_SAVE_AREA = MemoryLayout.structLayout( GP_REG.withName("%rdi"), @@ -105,14 +103,11 @@ public non-sealed class SysVVaList implements VaList { private static final int MAX_GP_OFFSET = (int) FP_OFFSET; // 6 regs used private static final int MAX_FP_OFFSET = (int) LAYOUT_REG_SAVE_AREA.byteSize(); // 8 16 byte regs - private static final VarHandle VH_fp_offset = LAYOUT.varHandle(int.class, groupElement("fp_offset")); - private static final VarHandle VH_gp_offset = LAYOUT.varHandle(int.class, groupElement("gp_offset")); - private static final VarHandle VH_overflow_arg_area - = MemoryHandles.asAddressVarHandle(LAYOUT.varHandle(long.class, groupElement("overflow_arg_area"))); - private static final VarHandle VH_reg_save_area - = MemoryHandles.asAddressVarHandle(LAYOUT.varHandle(long.class, groupElement("reg_save_area"))); + private static final VarHandle VH_fp_offset = LAYOUT.varHandle(groupElement("fp_offset")); + private static final VarHandle VH_gp_offset = LAYOUT.varHandle(groupElement("gp_offset")); + private static final VarHandle VH_overflow_arg_area = LAYOUT.varHandle(groupElement("overflow_arg_area")); + private static final VarHandle VH_reg_save_area = LAYOUT.varHandle(groupElement("reg_save_area")); - private static final Cleaner cleaner = Cleaner.create(); private static final VaList EMPTY = new SharedUtils.EmptyVaList(emptyListAddress()); private final MemorySegment segment; @@ -130,9 +125,10 @@ public non-sealed class SysVVaList implements VaList { private static MemoryAddress emptyListAddress() { long ptr = U.allocateMemory(LAYOUT.byteSize()); - MemorySegment base = MemoryAddress.ofLong(ptr).asSegment( - LAYOUT.byteSize(), () -> U.freeMemory(ptr), ResourceScope.newSharedScope()); - cleaner.register(SysVVaList.class, () -> base.scope().close()); + ResourceScope scope = ResourceScope.newImplicitScope(); + scope.addCloseAction(() -> U.freeMemory(ptr)); + MemorySegment base = MemorySegment.ofAddress(MemoryAddress.ofLong(ptr), + LAYOUT.byteSize(), scope); VH_gp_offset.set(base, MAX_GP_OFFSET); VH_fp_offset.set(base, MAX_FP_OFFSET); VH_overflow_arg_area.set(base, MemoryAddress.NULL); @@ -173,7 +169,7 @@ public non-sealed class SysVVaList implements VaList { } private static MemorySegment getRegSaveArea(MemorySegment segment) { - return ((MemoryAddress)VH_reg_save_area.get(segment)).asSegment( + return MemorySegment.ofAddress(((MemoryAddress)VH_reg_save_area.get(segment)), LAYOUT_REG_SAVE_AREA.byteSize(), segment.scope()); } @@ -188,59 +184,53 @@ public non-sealed class SysVVaList implements VaList { } @Override - public int vargAsInt(MemoryLayout layout) { + public int nextVarg(ValueLayout.OfInt layout) { return (int) read(int.class, layout); } @Override - public long vargAsLong(MemoryLayout layout) { + public long nextVarg(ValueLayout.OfLong layout) { return (long) read(long.class, layout); } @Override - public double vargAsDouble(MemoryLayout layout) { + public double nextVarg(ValueLayout.OfDouble layout) { return (double) read(double.class, layout); } @Override - public MemoryAddress vargAsAddress(MemoryLayout layout) { + public MemoryAddress nextVarg(ValueLayout.OfAddress layout) { return (MemoryAddress) read(MemoryAddress.class, layout); } @Override - public MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator) { + public MemorySegment nextVarg(GroupLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(allocator); return (MemorySegment) read(MemorySegment.class, layout, allocator); } - @Override - public MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope) { - return vargAsSegment(layout, SegmentAllocator.ofScope(scope)); - } - private Object read(Class carrier, MemoryLayout layout) { return read(carrier, layout, THROWING_ALLOCATOR); } private Object read(Class carrier, MemoryLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(layout); - checkCompatibleType(carrier, layout, SysVx64Linker.ADDRESS_SIZE); TypeClass typeClass = TypeClass.classifyLayout(layout); if (isRegOverflow(currentGPOffset(), currentFPOffset(), typeClass) || typeClass.inMemory()) { preAlignStack(layout); return switch (typeClass.kind()) { case STRUCT -> { - MemorySegment slice = stackPtr().asSegment(layout.byteSize(), scope()); + MemorySegment slice = MemorySegment.ofAddress(stackPtr(), layout.byteSize(), scope()); MemorySegment seg = allocator.allocate(layout); seg.copyFrom(slice); postAlignStack(layout); yield seg; } case POINTER, INTEGER, FLOAT -> { - VarHandle reader = vhPrimitiveOrAddress(carrier, layout); + VarHandle reader = layout.varHandle(); try (ResourceScope localScope = ResourceScope.newConfinedScope()) { - MemorySegment slice = stackPtr().asSegment(layout.byteSize(), localScope); + MemorySegment slice = MemorySegment.ofAddress(stackPtr(), layout.byteSize(), localScope); Object res = reader.get(slice); postAlignStack(layout); yield res; @@ -256,12 +246,11 @@ public non-sealed class SysVVaList implements VaList { while (offset < layout.byteSize()) { final long copy = Math.min(layout.byteSize() - offset, 8); boolean isSSE = typeClass.classes.get(classIdx++) == ArgumentClassImpl.SSE; - MemorySegment slice = value.asSlice(offset, copy); if (isSSE) { - slice.copyFrom(regSaveArea.asSlice(currentFPOffset(), copy)); + MemorySegment.copy(regSaveArea, currentFPOffset(), value, offset, copy); currentFPOffset(currentFPOffset() + FP_SLOT_SIZE); } else { - slice.copyFrom(regSaveArea.asSlice(currentGPOffset(), copy)); + MemorySegment.copy(regSaveArea, currentGPOffset(), value, offset, copy); currentGPOffset(currentGPOffset() + GP_SLOT_SIZE); } offset += copy; @@ -269,13 +258,13 @@ public non-sealed class SysVVaList implements VaList { yield value; } case POINTER, INTEGER -> { - VarHandle reader = SharedUtils.vhPrimitiveOrAddress(carrier, layout); + VarHandle reader = layout.varHandle(); Object res = reader.get(regSaveArea.asSlice(currentGPOffset())); currentGPOffset(currentGPOffset() + GP_SLOT_SIZE); yield res; } case FLOAT -> { - VarHandle reader = layout.varHandle(carrier); + VarHandle reader = layout.varHandle(); Object res = reader.get(regSaveArea.asSlice(currentFPOffset())); currentFPOffset(currentFPOffset() + FP_SLOT_SIZE); yield res; @@ -287,6 +276,7 @@ public non-sealed class SysVVaList implements VaList { @Override public void skip(MemoryLayout... layouts) { Objects.requireNonNull(layouts); + ((ResourceScopeImpl)segment.scope()).checkValidStateSlow(); for (MemoryLayout layout : layouts) { Objects.requireNonNull(layout); TypeClass typeClass = TypeClass.classifyLayout(layout); @@ -305,7 +295,7 @@ public non-sealed class SysVVaList implements VaList { } public static VaList ofAddress(MemoryAddress ma, ResourceScope scope) { - return readFromSegment(ma.asSegment(LAYOUT.byteSize(), scope)); + return readFromSegment(MemorySegment.ofAddress(ma, LAYOUT.byteSize(), scope)); } @Override @@ -353,34 +343,33 @@ public non-sealed class SysVVaList implements VaList { } @Override - public Builder vargFromInt(ValueLayout layout, int value) { + public Builder addVarg(ValueLayout.OfInt layout, int value) { return arg(int.class, layout, value); } @Override - public Builder vargFromLong(ValueLayout layout, long value) { + public Builder addVarg(ValueLayout.OfLong layout, long value) { return arg(long.class, layout, value); } @Override - public Builder vargFromDouble(ValueLayout layout, double value) { + public Builder addVarg(ValueLayout.OfDouble layout, double value) { return arg(double.class, layout, value); } @Override - public Builder vargFromAddress(ValueLayout layout, Addressable value) { + public Builder addVarg(ValueLayout.OfAddress layout, Addressable value) { return arg(MemoryAddress.class, layout, value.address()); } @Override - public Builder vargFromSegment(GroupLayout layout, MemorySegment value) { + public Builder addVarg(GroupLayout layout, MemorySegment value) { return arg(MemorySegment.class, layout, value); } private Builder arg(Class carrier, MemoryLayout layout, Object value) { Objects.requireNonNull(layout); Objects.requireNonNull(value); - checkCompatibleType(carrier, layout, SysVx64Linker.ADDRESS_SIZE); TypeClass typeClass = TypeClass.classifyLayout(layout); if (isRegOverflow(currentGPOffset, currentFPOffset, typeClass) || typeClass.inMemory()) { @@ -395,24 +384,23 @@ public non-sealed class SysVVaList implements VaList { while (offset < layout.byteSize()) { final long copy = Math.min(layout.byteSize() - offset, 8); boolean isSSE = typeClass.classes.get(classIdx++) == ArgumentClassImpl.SSE; - MemorySegment slice = valueSegment.asSlice(offset, copy); if (isSSE) { - reg_save_area.asSlice(currentFPOffset, copy).copyFrom(slice); + MemorySegment.copy(valueSegment, offset, reg_save_area, currentFPOffset, copy); currentFPOffset += FP_SLOT_SIZE; } else { - reg_save_area.asSlice(currentGPOffset, copy).copyFrom(slice); + MemorySegment.copy(valueSegment, offset, reg_save_area, currentGPOffset, copy); currentGPOffset += GP_SLOT_SIZE; } offset += copy; } } case POINTER, INTEGER -> { - VarHandle writer = SharedUtils.vhPrimitiveOrAddress(carrier, layout); + VarHandle writer = layout.varHandle(); writer.set(reg_save_area.asSlice(currentGPOffset), value); currentGPOffset += GP_SLOT_SIZE; } case FLOAT -> { - VarHandle writer = layout.varHandle(carrier); + VarHandle writer = layout.varHandle(); writer.set(reg_save_area.asSlice(currentFPOffset), value); currentFPOffset += FP_SLOT_SIZE; } @@ -430,7 +418,7 @@ public non-sealed class SysVVaList implements VaList { return EMPTY; } - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); MemorySegment vaListSegment = allocator.allocate(LAYOUT); MemoryAddress stackArgsPtr = MemoryAddress.NULL; if (!stackArgs.isEmpty()) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVx64Linker.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVx64Linker.java index 10d4a61c11e..0192168378c 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVx64Linker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/SysVx64Linker.java @@ -25,14 +25,14 @@ package jdk.internal.foreign.abi.x64.sysv; +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; -import jdk.internal.foreign.AbstractCLinker; -import jdk.internal.foreign.ResourceScopeImpl; +import jdk.incubator.foreign.VaList; import jdk.internal.foreign.abi.SharedUtils; -import jdk.internal.foreign.abi.UpcallStubs; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; @@ -43,7 +43,7 @@ import java.util.function.Consumer; /** * ABI implementation based on System V ABI AMD64 supplement v.0.99.6 */ -public final class SysVx64Linker extends AbstractCLinker { +public final class SysVx64Linker implements CLinker { public static final int MAX_INTEGER_ARGUMENT_REGISTERS = 6; public static final int MAX_INTEGER_RETURN_REGISTERS = 2; public static final int MAX_VECTOR_ARGUMENT_REGISTERS = 8; @@ -54,21 +54,6 @@ public final class SysVx64Linker extends AbstractCLinker { static final long ADDRESS_SIZE = 64; // bits - private static final MethodHandle MH_unboxVaList; - private static final MethodHandle MH_boxVaList; - - static { - try { - MethodHandles.Lookup lookup = MethodHandles.lookup(); - MH_unboxVaList = lookup.findVirtual(VaList.class, "address", - MethodType.methodType(MemoryAddress.class)); - MH_boxVaList = MethodHandles.insertArguments(lookup.findStatic(SysVx64Linker.class, "newVaListOfAddress", - MethodType.methodType(VaList.class, MemoryAddress.class, ResourceScope.class)), 1, ResourceScope.globalScope()); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } - public static SysVx64Linker getInstance() { if (instance == null) { instance = new SysVx64Linker(); @@ -83,26 +68,28 @@ public final class SysVx64Linker extends AbstractCLinker { } @Override - public final MethodHandle downcallHandle(MethodType type, FunctionDescriptor function) { - Objects.requireNonNull(type); + public final MethodHandle downcallHandle(FunctionDescriptor function) { Objects.requireNonNull(function); - MethodType llMt = SharedUtils.convertVaListCarriers(type, SysVVaList.CARRIER); - MethodHandle handle = CallArranger.arrangeDowncall(llMt, function); + MethodType type = SharedUtils.inferMethodType(function, false); + MethodHandle handle = CallArranger.arrangeDowncall(type, function); if (!type.returnType().equals(MemorySegment.class)) { // not returning segment, just insert a throwing allocator handle = MethodHandles.insertArguments(handle, 1, SharedUtils.THROWING_ALLOCATOR); } - handle = SharedUtils.unboxVaLists(type, handle, MH_unboxVaList); - return handle; + return SharedUtils.wrapDowncall(handle, function); } @Override - public final MemoryAddress upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { + public final NativeSymbol upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { Objects.requireNonNull(scope); Objects.requireNonNull(target); Objects.requireNonNull(function); - target = SharedUtils.boxVaLists(target, MH_boxVaList); - return UpcallStubs.upcallAddress(CallArranger.arrangeUpcall(target, target.type(), function), (ResourceScopeImpl) scope); + SharedUtils.checkExceptions(target); + MethodType type = SharedUtils.inferMethodType(function, true); + if (!type.equals(target.type())) { + throw new IllegalArgumentException("Wrong method handle type: " + target.type()); + } + return CallArranger.arrangeUpcall(target, target.type(), function, scope); } public static VaList newVaListOfAddress(MemoryAddress ma, ResourceScope scope) { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/TypeClass.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/TypeClass.java index 568b3d6378a..1421072d501 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/TypeClass.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/sysv/TypeClass.java @@ -25,10 +25,10 @@ package jdk.internal.foreign.abi.x64.sysv; import jdk.incubator.foreign.GroupLayout; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.SequenceLayout; import jdk.incubator.foreign.ValueLayout; -import jdk.internal.foreign.PlatformLayouts; import jdk.internal.foreign.Utils; import java.util.ArrayList; @@ -107,11 +107,17 @@ class TypeClass { } private static ArgumentClassImpl argumentClassFor(MemoryLayout layout) { - return switch (PlatformLayouts.getKind(layout)) { - case CHAR, SHORT, INT, LONG, LONG_LONG -> ArgumentClassImpl.INTEGER; - case FLOAT, DOUBLE -> ArgumentClassImpl.SSE; - case POINTER -> ArgumentClassImpl.POINTER; - }; + Class carrier = ((ValueLayout)layout).carrier(); + if (carrier == boolean.class || carrier == byte.class || carrier == char.class || + carrier == short.class || carrier == int.class || carrier == long.class) { + return ArgumentClassImpl.INTEGER; + } else if (carrier == float.class || carrier == double.class) { + return ArgumentClassImpl.SSE; + } else if (carrier == MemoryAddress.class) { + return ArgumentClassImpl.POINTER; + } else { + throw new IllegalStateException("Cannot get here: " + carrier.getName()); + } } // TODO: handle zero length arrays diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java index 5ff77e3928a..df5fa2b08a9 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java @@ -29,9 +29,10 @@ import jdk.incubator.foreign.GroupLayout; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; import jdk.internal.foreign.Utils; import jdk.internal.foreign.abi.CallingSequenceBuilder; -import jdk.internal.foreign.abi.UpcallHandler; import jdk.internal.foreign.abi.ABIDescriptor; import jdk.internal.foreign.abi.Binding; import jdk.internal.foreign.abi.CallingSequence; @@ -82,8 +83,6 @@ public class CallArranger { } public static Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall) { - SharedUtils.checkFunctionTypes(mt, cDesc, Windowsx64Linker.ADDRESS_SIZE); - class CallingSequenceBuilderHelper { final CallingSequenceBuilder csb = new CallingSequenceBuilder(forUpcall); final BindingCalculator argCalc = @@ -91,12 +90,12 @@ public class CallArranger { final BindingCalculator retCalc = forUpcall ? new UnboxBindingCalculator(false) : new BoxBindingCalculator(false); - void addArgumentBindings(Class carrier, MemoryLayout layout) { - csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout)); + void addArgumentBindings(Class carrier, MemoryLayout layout, boolean isVararg) { + csb.addArgumentBindings(carrier, layout, argCalc.getBindings(carrier, layout, isVararg)); } void setReturnBindings(Class carrier, MemoryLayout layout) { - csb.setReturnBindings(carrier, layout, retCalc.getBindings(carrier, layout)); + csb.setReturnBindings(carrier, layout, retCalc.getBindings(carrier, layout, false)); } } var csb = new CallingSequenceBuilderHelper(); @@ -105,7 +104,7 @@ public class CallArranger { if (returnInMemory) { Class carrier = MemoryAddress.class; MemoryLayout layout = Win64.C_POINTER; - csb.addArgumentBindings(carrier, layout); + csb.addArgumentBindings(carrier, layout, false); if (forUpcall) { csb.setReturnBindings(carrier, layout); } @@ -114,7 +113,7 @@ public class CallArranger { } for (int i = 0; i < mt.parameterCount(); i++) { - csb.addArgumentBindings(mt.parameterType(i), cDesc.argumentLayouts().get(i)); + csb.addArgumentBindings(mt.parameterType(i), cDesc.argumentLayouts().get(i), SharedUtils.isVarargsIndex(cDesc, i)); } csb.csb.setTrivial(SharedUtils.isTrivial(cDesc)); @@ -134,14 +133,14 @@ public class CallArranger { return handle; } - public static UpcallHandler arrangeUpcall(MethodHandle target, MethodType mt, FunctionDescriptor cDesc) { + public static NativeSymbol arrangeUpcall(MethodHandle target, MethodType mt, FunctionDescriptor cDesc, ResourceScope scope) { Bindings bindings = getBindings(mt, cDesc, true); if (bindings.isInMemoryReturn) { target = SharedUtils.adaptUpcallForIMR(target, false /* need the return value as well */); } - return ProgrammableUpcallHandler.make(CWindows, target, bindings.callingSequence); + return ProgrammableUpcallHandler.make(CWindows, target, bindings.callingSequence, scope); } private static boolean isInMemoryReturn(Optional returnLayout) { @@ -185,7 +184,7 @@ public class CallArranger { } private interface BindingCalculator { - List getBindings(Class carrier, MemoryLayout layout); + List getBindings(Class carrier, MemoryLayout layout, boolean isVararg); } static class UnboxBindingCalculator implements BindingCalculator { @@ -196,8 +195,8 @@ public class CallArranger { } @Override - public List getBindings(Class carrier, MemoryLayout layout) { - TypeClass argumentClass = TypeClass.typeClassFor(layout); + public List getBindings(Class carrier, MemoryLayout layout, boolean isVararg) { + TypeClass argumentClass = TypeClass.typeClassFor(layout, isVararg); Binding.Builder bindings = Binding.builder(); switch (argumentClass) { case STRUCT_REGISTER: { @@ -211,14 +210,13 @@ public class CallArranger { case STRUCT_REFERENCE: { assert carrier == MemorySegment.class; bindings.copy(layout) - .baseAddress() - .unboxAddress(); + .unboxAddress(MemorySegment.class); VMStorage storage = storageCalculator.nextStorage(StorageClasses.INTEGER, layout); bindings.vmStore(storage, long.class); break; } case POINTER: { - bindings.unboxAddress(); + bindings.unboxAddress(carrier); VMStorage storage = storageCalculator.nextStorage(StorageClasses.INTEGER, layout); bindings.vmStore(storage, long.class); break; @@ -259,8 +257,8 @@ public class CallArranger { } @Override - public List getBindings(Class carrier, MemoryLayout layout) { - TypeClass argumentClass = TypeClass.typeClassFor(layout); + public List getBindings(Class carrier, MemoryLayout layout, boolean isVararg) { + TypeClass argumentClass = TypeClass.typeClassFor(layout, isVararg); Binding.Builder bindings = Binding.builder(); switch (argumentClass) { case STRUCT_REGISTER: { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/TypeClass.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/TypeClass.java index 5a96c1b008e..d24963fc564 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/TypeClass.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/TypeClass.java @@ -25,11 +25,9 @@ package jdk.internal.foreign.abi.x64.windows; import jdk.incubator.foreign.GroupLayout; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.ValueLayout; -import jdk.internal.foreign.PlatformLayouts; - -import static jdk.internal.foreign.PlatformLayouts.Win64.VARARGS_ATTRIBUTE_NAME; enum TypeClass { STRUCT_REGISTER, @@ -39,7 +37,7 @@ enum TypeClass { FLOAT, VARARG_FLOAT; - private static TypeClass classifyValueType(ValueLayout type) { + private static TypeClass classifyValueType(ValueLayout type, boolean isVararg) { // No 128 bit integers in the Windows C ABI. There are __m128(i|d) intrinsic types but they act just // like a struct when passing as an argument (passed by pointer). // https://docs.microsoft.com/en-us/cpp/cpp/m128?view=vs-2019 @@ -49,17 +47,21 @@ enum TypeClass { // but must be considered volatile across function calls." // https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019 - return switch (PlatformLayouts.getKind(type)) { - case CHAR, SHORT, INT, LONG, LONG_LONG -> INTEGER; - case POINTER -> POINTER; - case FLOAT, DOUBLE -> { - if (type.attribute(VARARGS_ATTRIBUTE_NAME) - .map(Boolean.class::cast).orElse(false)) { - yield VARARG_FLOAT; - } - yield FLOAT; + Class carrier = type.carrier(); + if (carrier == boolean.class || carrier == byte.class || carrier == char.class || + carrier == short.class || carrier == int.class || carrier == long.class) { + return INTEGER; + } else if (carrier == float.class || carrier == double.class) { + if (isVararg) { + return VARARG_FLOAT; + } else { + return FLOAT; } - }; + } else if (carrier == MemoryAddress.class) { + return POINTER; + } else { + throw new IllegalStateException("Cannot get here: " + carrier.getName()); + } } static boolean isRegisterAggregate(MemoryLayout type) { @@ -77,9 +79,9 @@ enum TypeClass { return STRUCT_REFERENCE; } - static TypeClass typeClassFor(MemoryLayout type) { + static TypeClass typeClassFor(MemoryLayout type, boolean isVararg) { if (type instanceof ValueLayout) { - return classifyValueType((ValueLayout) type); + return classifyValueType((ValueLayout) type, isVararg); } else if (type instanceof GroupLayout) { return classifyStructType(type); } else { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/WinVaList.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/WinVaList.java index debdf9c6b5d..f74acf568b7 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/WinVaList.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/WinVaList.java @@ -26,7 +26,7 @@ package jdk.internal.foreign.abi.x64.windows; import jdk.incubator.foreign.*; -import jdk.incubator.foreign.CLinker.VaList; +import jdk.internal.foreign.Scoped; import jdk.internal.foreign.ResourceScopeImpl; import jdk.internal.foreign.abi.SharedUtils; import jdk.internal.foreign.abi.SharedUtils.SimpleVaArg; @@ -55,10 +55,10 @@ import static jdk.internal.foreign.PlatformLayouts.Win64.C_POINTER; // ? **(t**)((ap += sizeof(__int64)) - sizeof(__int64)) \ // : *(t* )((ap += sizeof(__int64)) - sizeof(__int64))) // -public non-sealed class WinVaList implements VaList { +public non-sealed class WinVaList implements VaList, Scoped { public static final Class CARRIER = MemoryAddress.class; private static final long VA_SLOT_SIZE_BYTES = 8; - private static final VarHandle VH_address = MemoryHandles.asAddressVarHandle(C_POINTER.varHandle(long.class)); + private static final VarHandle VH_address = C_POINTER.varHandle(); private static final VaList EMPTY = new SharedUtils.EmptyVaList(MemoryAddress.NULL); @@ -75,63 +75,54 @@ public non-sealed class WinVaList implements VaList { } @Override - public int vargAsInt(MemoryLayout layout) { + public int nextVarg(ValueLayout.OfInt layout) { return (int) read(int.class, layout); } @Override - public long vargAsLong(MemoryLayout layout) { + public long nextVarg(ValueLayout.OfLong layout) { return (long) read(long.class, layout); } @Override - public double vargAsDouble(MemoryLayout layout) { + public double nextVarg(ValueLayout.OfDouble layout) { return (double) read(double.class, layout); } @Override - public MemoryAddress vargAsAddress(MemoryLayout layout) { + public MemoryAddress nextVarg(ValueLayout.OfAddress layout) { return (MemoryAddress) read(MemoryAddress.class, layout); } @Override - public MemorySegment vargAsSegment(MemoryLayout layout, SegmentAllocator allocator) { + public MemorySegment nextVarg(GroupLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(allocator); return (MemorySegment) read(MemorySegment.class, layout, allocator); } - @Override - public MemorySegment vargAsSegment(MemoryLayout layout, ResourceScope scope) { - return vargAsSegment(layout, SegmentAllocator.ofScope(scope)); - } - private Object read(Class carrier, MemoryLayout layout) { return read(carrier, layout, SharedUtils.THROWING_ALLOCATOR); } private Object read(Class carrier, MemoryLayout layout, SegmentAllocator allocator) { Objects.requireNonNull(layout); - SharedUtils.checkCompatibleType(carrier, layout, Windowsx64Linker.ADDRESS_SIZE); Object res; if (carrier == MemorySegment.class) { - TypeClass typeClass = TypeClass.typeClassFor(layout); + TypeClass typeClass = TypeClass.typeClassFor(layout, false); res = switch (typeClass) { case STRUCT_REFERENCE -> { MemoryAddress structAddr = (MemoryAddress) VH_address.get(segment); - MemorySegment struct = structAddr.asSegment(layout.byteSize(), scope()); + MemorySegment struct = MemorySegment.ofAddress(structAddr, layout.byteSize(), scope()); MemorySegment seg = allocator.allocate(layout); seg.copyFrom(struct); yield seg; } - case STRUCT_REGISTER -> { - MemorySegment struct = allocator.allocate(layout); - struct.copyFrom(segment.asSlice(0L, layout.byteSize())); - yield struct; - } + case STRUCT_REGISTER -> + allocator.allocate(layout).copyFrom(segment.asSlice(0, layout.byteSize())); default -> throw new IllegalStateException("Unexpected TypeClass: " + typeClass); }; } else { - VarHandle reader = SharedUtils.vhPrimitiveOrAddress(carrier, layout); + VarHandle reader = layout.varHandle(); res = reader.get(segment); } segment = segment.asSlice(VA_SLOT_SIZE_BYTES); @@ -141,12 +132,13 @@ public non-sealed class WinVaList implements VaList { @Override public void skip(MemoryLayout... layouts) { Objects.requireNonNull(layouts); + ((ResourceScopeImpl)scope).checkValidStateSlow(); Stream.of(layouts).forEach(Objects::requireNonNull); segment = segment.asSlice(layouts.length * VA_SLOT_SIZE_BYTES); } static WinVaList ofAddress(MemoryAddress addr, ResourceScope scope) { - MemorySegment segment = addr.asSegment(Long.MAX_VALUE, scope); + MemorySegment segment = MemorySegment.ofAddress(addr, Long.MAX_VALUE, scope); return new WinVaList(segment, scope); } @@ -183,33 +175,32 @@ public non-sealed class WinVaList implements VaList { private Builder arg(Class carrier, MemoryLayout layout, Object value) { Objects.requireNonNull(layout); Objects.requireNonNull(value); - SharedUtils.checkCompatibleType(carrier, layout, Windowsx64Linker.ADDRESS_SIZE); args.add(new SimpleVaArg(carrier, layout, value)); return this; } @Override - public Builder vargFromInt(ValueLayout layout, int value) { + public Builder addVarg(ValueLayout.OfInt layout, int value) { return arg(int.class, layout, value); } @Override - public Builder vargFromLong(ValueLayout layout, long value) { + public Builder addVarg(ValueLayout.OfLong layout, long value) { return arg(long.class, layout, value); } @Override - public Builder vargFromDouble(ValueLayout layout, double value) { + public Builder addVarg(ValueLayout.OfDouble layout, double value) { return arg(double.class, layout, value); } @Override - public Builder vargFromAddress(ValueLayout layout, Addressable value) { + public Builder addVarg(ValueLayout.OfAddress layout, Addressable value) { return arg(MemoryAddress.class, layout, value.address()); } @Override - public Builder vargFromSegment(GroupLayout layout, MemorySegment value) { + public Builder addVarg(GroupLayout layout, MemorySegment value) { return arg(MemorySegment.class, layout, value); } @@ -217,7 +208,7 @@ public non-sealed class WinVaList implements VaList { if (args.isEmpty()) { return EMPTY; } - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); MemorySegment segment = allocator.allocate(VA_SLOT_SIZE_BYTES * args.size()); List attachedSegments = new ArrayList<>(); attachedSegments.add(segment); @@ -226,7 +217,7 @@ public non-sealed class WinVaList implements VaList { for (SimpleVaArg arg : args) { if (arg.carrier == MemorySegment.class) { MemorySegment msArg = ((MemorySegment) arg.value); - TypeClass typeClass = TypeClass.typeClassFor(arg.layout); + TypeClass typeClass = TypeClass.typeClassFor(arg.layout, false); switch (typeClass) { case STRUCT_REFERENCE -> { MemorySegment copy = allocator.allocate(arg.layout); @@ -234,10 +225,8 @@ public non-sealed class WinVaList implements VaList { attachedSegments.add(copy); VH_address.set(cursor, copy.address()); } - case STRUCT_REGISTER -> { - MemorySegment slice = cursor.asSlice(0, VA_SLOT_SIZE_BYTES); - slice.copyFrom(msArg); - } + case STRUCT_REGISTER -> + cursor.copyFrom(msArg.asSlice(0, VA_SLOT_SIZE_BYTES)); default -> throw new IllegalStateException("Unexpected TypeClass: " + typeClass); } } else { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/Windowsx64Linker.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/Windowsx64Linker.java index d40aabd1e7d..6d7c8b23cac 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/Windowsx64Linker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/x64/windows/Windowsx64Linker.java @@ -24,14 +24,14 @@ */ package jdk.internal.foreign.abi.x64.windows; +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; -import jdk.internal.foreign.AbstractCLinker; -import jdk.internal.foreign.ResourceScopeImpl; +import jdk.incubator.foreign.VaList; import jdk.internal.foreign.abi.SharedUtils; -import jdk.internal.foreign.abi.UpcallStubs; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; @@ -42,7 +42,7 @@ import java.util.function.Consumer; /** * ABI implementation based on Windows ABI AMD64 supplement v.0.99.6 */ -public final class Windowsx64Linker extends AbstractCLinker { +public final class Windowsx64Linker implements CLinker { public static final int MAX_INTEGER_ARGUMENT_REGISTERS = 4; public static final int MAX_INTEGER_RETURN_REGISTERS = 1; @@ -55,21 +55,6 @@ public final class Windowsx64Linker extends AbstractCLinker { static final long ADDRESS_SIZE = 64; // bits - private static final MethodHandle MH_unboxVaList; - private static final MethodHandle MH_boxVaList; - - static { - try { - MethodHandles.Lookup lookup = MethodHandles.lookup(); - MH_unboxVaList = lookup.findVirtual(VaList.class, "address", - MethodType.methodType(MemoryAddress.class)); - MH_boxVaList = MethodHandles.insertArguments(lookup.findStatic(Windowsx64Linker.class, "newVaListOfAddress", - MethodType.methodType(VaList.class, MemoryAddress.class, ResourceScope.class)), 1, ResourceScope.globalScope()); - } catch (ReflectiveOperationException e) { - throw new ExceptionInInitializerError(e); - } - } - public static Windowsx64Linker getInstance() { if (instance == null) { instance = new Windowsx64Linker(); @@ -84,26 +69,28 @@ public final class Windowsx64Linker extends AbstractCLinker { } @Override - public final MethodHandle downcallHandle(MethodType type, FunctionDescriptor function) { - Objects.requireNonNull(type); + public final MethodHandle downcallHandle(FunctionDescriptor function) { Objects.requireNonNull(function); - MethodType llMt = SharedUtils.convertVaListCarriers(type, WinVaList.CARRIER); - MethodHandle handle = CallArranger.arrangeDowncall(llMt, function); + MethodType type = SharedUtils.inferMethodType(function, false); + MethodHandle handle = CallArranger.arrangeDowncall(type, function); if (!type.returnType().equals(MemorySegment.class)) { // not returning segment, just insert a throwing allocator handle = MethodHandles.insertArguments(handle, 1, SharedUtils.THROWING_ALLOCATOR); } - handle = SharedUtils.unboxVaLists(type, handle, MH_unboxVaList); - return handle; + return SharedUtils.wrapDowncall(handle, function); } @Override - public final MemoryAddress upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { + public final NativeSymbol upcallStub(MethodHandle target, FunctionDescriptor function, ResourceScope scope) { Objects.requireNonNull(scope); Objects.requireNonNull(target); Objects.requireNonNull(function); - target = SharedUtils.boxVaLists(target, MH_boxVaList); - return UpcallStubs.upcallAddress(CallArranger.arrangeUpcall(target, target.type(), function), (ResourceScopeImpl) scope); + SharedUtils.checkExceptions(target); + MethodType type = SharedUtils.inferMethodType(function, true); + if (!type.equals(target.type())) { + throw new IllegalArgumentException("Wrong method handle type: " + target.type()); + } + return CallArranger.arrangeUpcall(target, target.type(), function, scope); } public static VaList newVaListOfAddress(MemoryAddress ma, ResourceScope scope) { diff --git a/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java b/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java index 4d5203167d3..a5ebe6f5de8 100644 --- a/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java +++ b/test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java @@ -40,22 +40,19 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.SymbolLookup; +import jdk.incubator.foreign.ValueLayout; import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodType; - -import static jdk.incubator.foreign.CLinker.C_INT; public class TestLinkToNativeRBP { static { System.loadLibrary("LinkToNativeRBP"); } - final static CLinker abi = CLinker.getInstance(); + final static CLinker abi = CLinker.systemCLinker(); static final SymbolLookup lookup = SymbolLookup.loaderLookup(); final static MethodHandle foo = abi.downcallHandle(lookup.lookup("foo").get(), - MethodType.methodType(int.class), - FunctionDescriptor.of(C_INT)); + FunctionDescriptor.of(ValueLayout.JAVA_INT)); static int foo() throws Throwable { return (int)foo.invokeExact(); diff --git a/test/jdk/java/foreign/CallGeneratorHelper.java b/test/jdk/java/foreign/CallGeneratorHelper.java index 9a795525e1f..a69fe1a5d81 100644 --- a/test/jdk/java/foreign/CallGeneratorHelper.java +++ b/test/jdk/java/foreign/CallGeneratorHelper.java @@ -22,14 +22,19 @@ * */ +import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.GroupLayout; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; import java.util.ArrayList; import java.util.List; @@ -40,12 +45,13 @@ import java.util.stream.IntStream; import org.testng.annotations.*; -import static jdk.incubator.foreign.CLinker.*; import static org.testng.Assert.*; public class CallGeneratorHelper extends NativeTestHelper { - static SegmentAllocator IMPLICIT_ALLOCATOR = (size, align) -> MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope()); + static SegmentAllocator THROWING_ALLOCATOR = (size, align) -> { + throw new UnsupportedOperationException(); + }; static final int SAMPLE_FACTOR = Integer.parseInt((String)System.getProperties().getOrDefault("generator.sample.factor", "-1")); @@ -58,7 +64,7 @@ public class CallGeneratorHelper extends NativeTestHelper { GroupLayout g = (GroupLayout) layout; for (MemoryLayout field : g.memberLayouts()) { if (field instanceof ValueLayout) { - VarHandle vh = g.varHandle(vhCarrier(field), MemoryLayout.PathElement.groupElement(field.name().orElseThrow())); + VarHandle vh = g.varHandle(MemoryLayout.PathElement.groupElement(field.name().orElseThrow())); assertEquals(vh.get(actual), vh.get(expected)); } } @@ -410,12 +416,9 @@ public class CallGeneratorHelper extends NativeTestHelper { static void initStruct(MemorySegment str, GroupLayout g, List> checks, boolean check) throws ReflectiveOperationException { for (MemoryLayout l : g.memberLayouts()) { if (l.isPadding()) continue; - VarHandle accessor = g.varHandle(structFieldCarrier(l), MemoryLayout.PathElement.groupElement(l.name().get())); + VarHandle accessor = g.varHandle(MemoryLayout.PathElement.groupElement(l.name().get())); List> fieldsCheck = new ArrayList<>(); Object value = makeArg(l, fieldsCheck, check); - if (isPointer(l)) { - value = ((MemoryAddress)value).toRawLongValue(); - } //set value accessor.set(str, value); //add check @@ -424,11 +427,7 @@ public class CallGeneratorHelper extends NativeTestHelper { checks.add(o -> { MemorySegment actual = (MemorySegment)o; try { - if (isPointer(l)) { - fieldsCheck.get(0).accept(MemoryAddress.ofLong((long)accessor.get(actual))); - } else { - fieldsCheck.get(0).accept(accessor.get(actual)); - } + fieldsCheck.get(0).accept(accessor.get(actual)); } catch (Throwable ex) { throw new IllegalStateException(ex); } @@ -437,37 +436,23 @@ public class CallGeneratorHelper extends NativeTestHelper { } } - static Class structFieldCarrier(MemoryLayout layout) { - if (isPointer(layout)) { - return long.class; - } else if (layout instanceof ValueLayout) { - if (isIntegral(layout)) { - return int.class; - } else if (layout.bitSize() == 32) { - return float.class; - } else { - return double.class; - } - } else { - throw new IllegalStateException("Unexpected layout: " + layout); - } - } - - static Class paramCarrier(MemoryLayout layout) { + static Class carrier(MemoryLayout layout, boolean param) { if (layout instanceof GroupLayout) { return MemorySegment.class; } if (isPointer(layout)) { - return MemoryAddress.class; - } else if (layout instanceof ValueLayout) { - if (isIntegral(layout)) { - return int.class; - } else if (layout.bitSize() == 32) { - return float.class; - } else { - return double.class; - } + return param ? Addressable.class : MemoryAddress.class; + } else if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); } else { throw new IllegalStateException("Unexpected layout: " + layout); } } + + MethodHandle downcallHandle(CLinker abi, NativeSymbol symbol, SegmentAllocator allocator, FunctionDescriptor descriptor) { + MethodHandle mh = abi.downcallHandle(symbol, descriptor); + if (descriptor.returnLayout().isPresent() && descriptor.returnLayout().get() instanceof GroupLayout) { + mh = mh.bindTo(allocator); + } + return mh; + } } diff --git a/test/jdk/java/foreign/NativeTestHelper.java b/test/jdk/java/foreign/NativeTestHelper.java index 9b57beac732..ca789f984f8 100644 --- a/test/jdk/java/foreign/NativeTestHelper.java +++ b/test/jdk/java/foreign/NativeTestHelper.java @@ -22,58 +22,90 @@ * */ +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; +import jdk.incubator.foreign.ValueLayout; + +import java.lang.invoke.MethodHandle; public class NativeTestHelper { - static CLinker.TypeKind kind(MemoryLayout layout) { - return (CLinker.TypeKind)layout.attribute(CLinker.TypeKind.ATTR_NAME).orElseThrow( - () -> new IllegalStateException("Unexpected value layout: could not determine ABI class")); + public static boolean isIntegral(MemoryLayout layout) { + return layout instanceof ValueLayout valueLayout && isIntegral(valueLayout.carrier()); } - public static boolean isIntegral(MemoryLayout layout) { - return kind(layout).isIntegral(); + static boolean isIntegral(Class clazz) { + return clazz == byte.class || clazz == char.class || clazz == short.class + || clazz == int.class || clazz == long.class; } public static boolean isPointer(MemoryLayout layout) { - return kind(layout).isPointer(); + return layout instanceof ValueLayout valueLayout && valueLayout.carrier() == MemoryAddress.class; } - public static class NativeScope implements SegmentAllocator, AutoCloseable { - final ResourceScope resourceScope; - final ResourceScope.Handle scopeHandle; - final SegmentAllocator allocator; + // the constants below are useful aliases for C types. The type/carrier association is only valid for 64-bit platforms. - long allocatedBytes = 0; + /** + * The layout for the {@code bool} C type + */ + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + /** + * The layout for the {@code char} C type + */ + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; + /** + * The layout for the {@code short} C type + */ + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT.withBitAlignment(16); + /** + * The layout for the {@code int} C type + */ + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT.withBitAlignment(32); - public NativeScope() { - this.resourceScope = ResourceScope.newConfinedScope(); - this.scopeHandle = resourceScope.acquire(); - this.allocator = SegmentAllocator.arenaAllocator(resourceScope); - } + /** + * The layout for the {@code long long} C type. + */ + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG.withBitAlignment(64); + /** + * The layout for the {@code float} C type + */ + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT.withBitAlignment(32); + /** + * The layout for the {@code double} C type + */ + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE.withBitAlignment(64); + /** + * The {@code T*} native type. + */ + public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS.withBitAlignment(64); - @Override - public MemorySegment allocate(long bytesSize, long bytesAlignment) { - allocatedBytes += bytesSize; - return allocator.allocate(bytesSize, bytesAlignment); - } + private static CLinker LINKER = CLinker.systemCLinker(); - public ResourceScope scope() { - return resourceScope; - } + private static final MethodHandle FREE = LINKER.downcallHandle( + LINKER.lookup("free").get(), FunctionDescriptor.ofVoid(ValueLayout.ADDRESS)); - public long allocatedBytes() { - return allocatedBytes; + private static final MethodHandle MALLOC = LINKER.downcallHandle( + LINKER.lookup("malloc").get(), FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_LONG)); + + public static void freeMemory(Addressable address) { + try { + FREE.invokeExact(address); + } catch (Throwable ex) { + throw new IllegalStateException(ex); } + } - @Override - public void close() { - resourceScope.release(scopeHandle); - resourceScope.close(); + public static MemoryAddress allocateMemory(long size) { + try { + return (MemoryAddress)MALLOC.invokeExact(size); + } catch (Throwable ex) { + throw new IllegalStateException(ex); } } } diff --git a/test/jdk/java/foreign/SafeFunctionAccessTest.java b/test/jdk/java/foreign/SafeFunctionAccessTest.java index b6801ad8888..5c45f42cc26 100644 --- a/test/jdk/java/foreign/SafeFunctionAccessTest.java +++ b/test/jdk/java/foreign/SafeFunctionAccessTest.java @@ -27,27 +27,31 @@ * @run testng/othervm --enable-native-access=ALL-UNNAMED SafeFunctionAccessTest */ +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; -import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; +import jdk.incubator.foreign.VaList; import org.testng.annotations.*; + import static org.testng.Assert.*; -public class SafeFunctionAccessTest { +public class SafeFunctionAccessTest extends NativeTestHelper { static { System.loadLibrary("SafeAccess"); } static MemoryLayout POINT = MemoryLayout.structLayout( - CLinker.C_INT, CLinker.C_INT + C_INT, C_INT ); static final SymbolLookup LOOKUP = SymbolLookup.loaderLookup(); @@ -59,26 +63,135 @@ public class SafeFunctionAccessTest { segment = MemorySegment.allocateNative(POINT, scope); } assertFalse(segment.scope().isAlive()); - MethodHandle handle = CLinker.getInstance().downcallHandle( + MethodHandle handle = CLinker.systemCLinker().downcallHandle( LOOKUP.lookup("struct_func").get(), - MethodType.methodType(void.class, MemorySegment.class), FunctionDescriptor.ofVoid(POINT)); handle.invokeExact(segment); } + @Test + public void testClosedStructAddr_6() throws Throwable { + MethodHandle handle = CLinker.systemCLinker().downcallHandle( + LOOKUP.lookup("addr_func_6").get(), + FunctionDescriptor.ofVoid(C_POINTER, C_POINTER, C_POINTER, C_POINTER, C_POINTER, C_POINTER)); + for (int i = 0 ; i < 6 ; i++) { + MemorySegment[] segments = new MemorySegment[]{ + MemorySegment.allocateNative(POINT, ResourceScope.newImplicitScope()), + MemorySegment.allocateNative(POINT, ResourceScope.newImplicitScope()), + MemorySegment.allocateNative(POINT, ResourceScope.newImplicitScope()), + MemorySegment.allocateNative(POINT, ResourceScope.newImplicitScope()), + MemorySegment.allocateNative(POINT, ResourceScope.newImplicitScope()), + MemorySegment.allocateNative(POINT, ResourceScope.newImplicitScope()) + }; + // check liveness + segments[i].scope().close(); + for (int j = 0 ; j < 6 ; j++) { + if (i == j) { + assertFalse(segments[j].scope().isAlive()); + } else { + assertTrue(segments[j].scope().isAlive()); + } + } + try { + handle.invokeWithArguments(segments); + fail(); + } catch (IllegalStateException ex) { + assertTrue(ex.getMessage().contains("Already closed")); + } + for (int j = 0 ; j < 6 ; j++) { + if (i != j) { + segments[j].scope().close(); // should succeed! + } + } + } + } + @Test(expectedExceptions = IllegalStateException.class) - public void testClosedPointer() throws Throwable { - MemoryAddress address; + public void testClosedVaList() throws Throwable { + VaList list; try (ResourceScope scope = ResourceScope.newConfinedScope()) { - address = MemorySegment.allocateNative(POINT, scope).address(); + list = VaList.make(b -> b.addVarg(C_INT, 42), scope); } - assertFalse(address.scope().isAlive()); - MethodHandle handle = CLinker.getInstance().downcallHandle( + assertFalse(list.scope().isAlive()); + MethodHandle handle = CLinker.systemCLinker().downcallHandle( LOOKUP.lookup("addr_func").get(), - MethodType.methodType(void.class, MemoryAddress.class), - FunctionDescriptor.ofVoid(CLinker.C_POINTER)); + FunctionDescriptor.ofVoid(C_POINTER)); - handle.invokeExact(address); + handle.invokeExact((Addressable)list); + } + + @Test(expectedExceptions = IllegalStateException.class) + public void testClosedUpcall() throws Throwable { + NativeSymbol upcall; + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + MethodHandle dummy = MethodHandles.lookup().findStatic(SafeFunctionAccessTest.class, "dummy", MethodType.methodType(void.class)); + upcall = CLinker.systemCLinker().upcallStub(dummy, FunctionDescriptor.ofVoid(), scope); + } + assertFalse(upcall.scope().isAlive()); + MethodHandle handle = CLinker.systemCLinker().downcallHandle( + LOOKUP.lookup("addr_func").get(), + FunctionDescriptor.ofVoid(C_POINTER)); + + handle.invokeExact((Addressable)upcall); + } + + static void dummy() { } + + @Test + public void testClosedVaListCallback() throws Throwable { + MethodHandle handle = CLinker.systemCLinker().downcallHandle( + LOOKUP.lookup("addr_func_cb").get(), + FunctionDescriptor.ofVoid(C_POINTER, C_POINTER)); + + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + VaList list = VaList.make(b -> b.addVarg(C_INT, 42), scope); + handle.invoke(list, scopeChecker(scope)); + } + } + + @Test + public void testClosedStructCallback() throws Throwable { + MethodHandle handle = CLinker.systemCLinker().downcallHandle( + LOOKUP.lookup("addr_func_cb").get(), + FunctionDescriptor.ofVoid(C_POINTER, C_POINTER)); + + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + MemorySegment segment = MemorySegment.allocateNative(POINT, scope); + handle.invoke(segment, scopeChecker(scope)); + } + } + + @Test + public void testClosedUpcallCallback() throws Throwable { + MethodHandle handle = CLinker.systemCLinker().downcallHandle( + LOOKUP.lookup("addr_func_cb").get(), + FunctionDescriptor.ofVoid(C_POINTER, C_POINTER)); + + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + MethodHandle dummy = MethodHandles.lookup().findStatic(SafeFunctionAccessTest.class, "dummy", MethodType.methodType(void.class)); + NativeSymbol upcall = CLinker.systemCLinker().upcallStub(dummy, FunctionDescriptor.ofVoid(), scope); + handle.invoke(upcall, scopeChecker(scope)); + } + } + + NativeSymbol scopeChecker(ResourceScope scope) { + try { + MethodHandle handle = MethodHandles.lookup().findStatic(SafeFunctionAccessTest.class, "checkScope", + MethodType.methodType(void.class, ResourceScope.class)); + handle = handle.bindTo(scope); + return CLinker.systemCLinker().upcallStub(handle, FunctionDescriptor.ofVoid(), ResourceScope.newImplicitScope()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static void checkScope(ResourceScope scope) { + try { + scope.close(); + fail("Scope closed unexpectedly!"); + } catch (IllegalStateException ex) { + assertTrue(ex.getMessage().contains("kept alive")); //if acquired, fine + } } } diff --git a/test/jdk/java/foreign/StdLibTest.java b/test/jdk/java/foreign/StdLibTest.java index 4495ed15921..1246a260b1d 100644 --- a/test/jdk/java/foreign/StdLibTest.java +++ b/test/jdk/java/foreign/StdLibTest.java @@ -39,7 +39,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; -import java.util.Optional; import java.util.Set; import java.util.function.BiConsumer; import java.util.function.Function; @@ -48,17 +47,14 @@ import java.util.stream.Stream; import jdk.incubator.foreign.*; -import static jdk.incubator.foreign.MemoryAccess.*; - import org.testng.annotations.*; -import static jdk.incubator.foreign.CLinker.*; import static org.testng.Assert.*; @Test -public class StdLibTest { +public class StdLibTest extends NativeTestHelper { - final static CLinker abi = CLinker.getInstance(); + final static CLinker abi = CLinker.systemCLinker(); private StdLibHelper stdLibHelper = new StdLibHelper(); @@ -155,45 +151,36 @@ public class StdLibTest { static class StdLibHelper { - static final SymbolLookup LOOKUP = CLinker.systemLookup(); - - final static MethodHandle strcat = abi.downcallHandle(LOOKUP.lookup("strcat").get(), - MethodType.methodType(MemoryAddress.class, MemoryAddress.class, MemoryAddress.class), - FunctionDescriptor.of(C_POINTER, C_POINTER, C_POINTER)); + final static MethodHandle strcat = abi.downcallHandle(abi.lookup("strcat").get(), + FunctionDescriptor.of(C_POINTER, C_POINTER, C_POINTER)) + .asType(MethodType.methodType(MemoryAddress.class, MemorySegment.class, MemorySegment.class)); // exact signature match - final static MethodHandle strcmp = abi.downcallHandle(LOOKUP.lookup("strcmp").get(), - MethodType.methodType(int.class, MemoryAddress.class, MemoryAddress.class), + final static MethodHandle strcmp = abi.downcallHandle(abi.lookup("strcmp").get(), FunctionDescriptor.of(C_INT, C_POINTER, C_POINTER)); - final static MethodHandle puts = abi.downcallHandle(LOOKUP.lookup("puts").get(), - MethodType.methodType(int.class, MemoryAddress.class), + final static MethodHandle puts = abi.downcallHandle(abi.lookup("puts").get(), FunctionDescriptor.of(C_INT, C_POINTER)); - final static MethodHandle strlen = abi.downcallHandle(LOOKUP.lookup("strlen").get(), - MethodType.methodType(int.class, MemoryAddress.class), + final static MethodHandle strlen = abi.downcallHandle(abi.lookup("strlen").get(), FunctionDescriptor.of(C_INT, C_POINTER)); - final static MethodHandle gmtime = abi.downcallHandle(LOOKUP.lookup("gmtime").get(), - MethodType.methodType(MemoryAddress.class, MemoryAddress.class), + final static MethodHandle gmtime = abi.downcallHandle(abi.lookup("gmtime").get(), FunctionDescriptor.of(C_POINTER, C_POINTER)); - final static MethodHandle qsort = abi.downcallHandle(LOOKUP.lookup("qsort").get(), - MethodType.methodType(void.class, MemoryAddress.class, long.class, long.class, MemoryAddress.class), + final static MethodHandle qsort = abi.downcallHandle(abi.lookup("qsort").get(), FunctionDescriptor.ofVoid(C_POINTER, C_LONG_LONG, C_LONG_LONG, C_POINTER)); final static FunctionDescriptor qsortComparFunction = FunctionDescriptor.of(C_INT, C_POINTER, C_POINTER); final static MethodHandle qsortCompar; - final static MethodHandle rand = abi.downcallHandle(LOOKUP.lookup("rand").get(), - MethodType.methodType(int.class), + final static MethodHandle rand = abi.downcallHandle(abi.lookup("rand").get(), FunctionDescriptor.of(C_INT)); - final static MethodHandle vprintf = abi.downcallHandle(LOOKUP.lookup("vprintf").get(), - MethodType.methodType(int.class, MemoryAddress.class, VaList.class), - FunctionDescriptor.of(C_INT, C_POINTER, C_VA_LIST)); + final static MethodHandle vprintf = abi.downcallHandle(abi.lookup("vprintf").get(), + FunctionDescriptor.of(C_INT, C_POINTER, C_POINTER)); - final static MemoryAddress printfAddr = LOOKUP.lookup("printf").get(); + final static NativeSymbol printfAddr = abi.lookup("printf").get(); final static FunctionDescriptor printfBase = FunctionDescriptor.of(C_INT, C_POINTER); @@ -201,7 +188,7 @@ public class StdLibTest { try { //qsort upcall handle qsortCompar = MethodHandles.lookup().findStatic(StdLibTest.StdLibHelper.class, "qsortCompare", - MethodType.methodType(int.class, MemorySegment.class, MemoryAddress.class, MemoryAddress.class)); + CLinker.upcallType(qsortComparFunction)); } catch (ReflectiveOperationException ex) { throw new IllegalStateException(ex); } @@ -209,44 +196,44 @@ public class StdLibTest { String strcat(String s1, String s2) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment buf = MemorySegment.allocateNative(s1.length() + s2.length() + 1, scope); - MemorySegment other = toCString(s2, scope); - char[] chars = s1.toCharArray(); - for (long i = 0 ; i < chars.length ; i++) { - setByteAtOffset(buf, i, (byte)chars[(int)i]); - } - setByteAtOffset(buf, chars.length, (byte)'\0'); - return toJavaString(((MemoryAddress)strcat.invokeExact(buf.address(), other.address()))); + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment buf = malloc.allocate(s1.length() + s2.length() + 1); + buf.setUtf8String(0, s1); + MemorySegment other = malloc.allocateUtf8String(s2); + return ((MemoryAddress)strcat.invokeExact(buf, other)).getUtf8String(0); } } int strcmp(String s1, String s2) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment ns1 = toCString(s1, scope); - MemorySegment ns2 = toCString(s2, scope); - return (int)strcmp.invokeExact(ns1.address(), ns2.address()); + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment ns1 = malloc.allocateUtf8String(s1); + MemorySegment ns2 = malloc.allocateUtf8String(s2); + return (int)strcmp.invoke(ns1, ns2); } } int puts(String msg) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment s = toCString(msg, scope); - return (int)puts.invokeExact(s.address()); + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment s = malloc.allocateUtf8String(msg); + return (int)puts.invoke(s); } } int strlen(String msg) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment s = toCString(msg, scope); - return (int)strlen.invokeExact(s.address()); + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment s = malloc.allocateUtf8String(msg); + return (int)strlen.invoke(s); } } Tm gmtime(long arg) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment time = MemorySegment.allocateNative(8, scope); - setLong(time, arg); - return new Tm((MemoryAddress)gmtime.invokeExact(time.address())); + time.set(C_LONG_LONG, 0, arg); + return new Tm((MemoryAddress)gmtime.invoke(time)); } } @@ -258,58 +245,57 @@ public class StdLibTest { static final long SIZE = 56; Tm(MemoryAddress addr) { - this.base = addr.asSegment(SIZE, ResourceScope.globalScope()); + this.base = MemorySegment.ofAddress(addr, SIZE, ResourceScope.globalScope()); } int sec() { - return getIntAtOffset(base, 0); + return base.get(C_INT, 0); } int min() { - return getIntAtOffset(base, 4); + return base.get(C_INT, 4); } int hour() { - return getIntAtOffset(base, 8); + return base.get(C_INT, 8); } int mday() { - return getIntAtOffset(base, 12); + return base.get(C_INT, 12); } int mon() { - return getIntAtOffset(base, 16); + return base.get(C_INT, 16); } int year() { - return getIntAtOffset(base, 20); + return base.get(C_INT, 20); } int wday() { - return getIntAtOffset(base, 24); + return base.get(C_INT, 24); } int yday() { - return getIntAtOffset(base, 28); + return base.get(C_INT, 28); } boolean isdst() { - byte b = getByteAtOffset(base, 32); - return b != 0; + return base.get(C_BOOL, 32); } } int[] qsort(int[] arr) throws Throwable { //init native array try (ResourceScope scope = ResourceScope.newConfinedScope()) { - SegmentAllocator allocator = SegmentAllocator.ofScope(scope); - MemorySegment nativeArr = allocator.allocateArray(C_INT, arr); + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment nativeArr = malloc.allocateArray(C_INT, arr); //call qsort - MemoryAddress qsortUpcallStub = abi.upcallStub(qsortCompar.bindTo(nativeArr), qsortComparFunction, scope); + NativeSymbol qsortUpcallStub = abi.upcallStub(qsortCompar, qsortComparFunction, scope); - qsort.invokeExact(nativeArr.address(), (long)arr.length, C_INT.byteSize(), qsortUpcallStub); + qsort.invoke(nativeArr, (long)arr.length, C_INT.byteSize(), qsortUpcallStub); //convert back to Java array - return nativeArr.toIntArray(); + return nativeArr.toArray(C_INT); } } - static int qsortCompare(MemorySegment base, MemoryAddress addr1, MemoryAddress addr2) { - return getIntAtOffset(base, addr1.segmentOffset(base)) - - getIntAtOffset(base, addr2.segmentOffset(base)); + static int qsortCompare(MemoryAddress addr1, MemoryAddress addr2) { + return addr1.get(C_INT, 0) - + addr2.get(C_INT, 0); } int rand() throws Throwable { @@ -318,17 +304,19 @@ public class StdLibTest { int printf(String format, List args) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment formatStr = toCString(format, scope); - return (int)specializedPrintf(args).invokeExact(formatStr.address(), + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment formatStr = malloc.allocateUtf8String(format); + return (int)specializedPrintf(args).invoke(formatStr, args.stream().map(a -> a.nativeValue(scope)).toArray()); } } int vprintf(String format, List args) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment formatStr = toCString(format, scope); + var malloc = SegmentAllocator.nativeAllocator(scope); + MemorySegment formatStr = malloc.allocateUtf8String(format); VaList vaList = VaList.make(b -> args.forEach(a -> a.accept(b, scope)), scope); - return (int)vprintf.invokeExact(formatStr.address(), vaList); + return (int)vprintf.invoke(formatStr, vaList); } } @@ -336,11 +324,13 @@ public class StdLibTest { //method type MethodType mt = MethodType.methodType(int.class, MemoryAddress.class); FunctionDescriptor fd = printfBase; + List variadicLayouts = new ArrayList<>(args.size()); for (PrintfArg arg : args) { mt = mt.appendParameterTypes(arg.carrier); - fd = fd.withAppendedArgumentLayouts(arg.layout); + variadicLayouts.add(arg.layout); } - MethodHandle mh = abi.downcallHandle(printfAddr, mt, fd); + MethodHandle mh = abi.downcallHandle(printfAddr, + fd.asVariadic(variadicLayouts.toArray(new MemoryLayout[args.size()]))); return mh.asSpreader(1, Object[].class, args.size()); } } @@ -401,10 +391,14 @@ public class StdLibTest { enum PrintfArg implements BiConsumer { - INTEGRAL(int.class, asVarArg(C_INT), "%d", scope -> 42, 42, VaList.Builder::vargFromInt), - STRING(MemoryAddress.class, asVarArg(C_POINTER), "%s", scope -> toCString("str", scope).address(), "str", VaList.Builder::vargFromAddress), - CHAR(byte.class, asVarArg(C_CHAR), "%c", scope -> (byte) 'h', 'h', (builder, layout, value) -> builder.vargFromInt(C_INT, (int)value)), - DOUBLE(double.class, asVarArg(C_DOUBLE), "%.4f", scope ->1.2345d, 1.2345d, VaList.Builder::vargFromDouble); + INTEGRAL(int.class, C_INT, "%d", scope -> 42, 42, VaList.Builder::addVarg), + STRING(MemoryAddress.class, C_POINTER, "%s", scope -> { + var segment = MemorySegment.allocateNative(4, scope); + segment.setUtf8String(0, "str"); + return segment.address(); + }, "str", VaList.Builder::addVarg), + CHAR(byte.class, C_CHAR, "%c", scope -> (byte) 'h', 'h', (builder, layout, value) -> builder.addVarg(C_INT, (int)value)), + DOUBLE(double.class, C_DOUBLE, "%.4f", scope ->1.2345d, 1.2345d, VaList.Builder::addVarg); final Class carrier; final ValueLayout layout; @@ -414,7 +408,7 @@ public class StdLibTest { @SuppressWarnings("rawtypes") final VaListBuilderCall builderCall; - PrintfArg(Class carrier, ValueLayout layout, String format, Function nativeValueFactory, Object javaValue, VaListBuilderCall builderCall) { + PrintfArg(Class carrier, L layout, String format, Function nativeValueFactory, Object javaValue, VaListBuilderCall builderCall) { this.carrier = carrier; this.layout = layout; this.format = format; @@ -429,8 +423,8 @@ public class StdLibTest { builderCall.build(builder, layout, nativeValueFactory.apply(scope)); } - interface VaListBuilderCall { - void build(VaList.Builder builder, ValueLayout layout, V value); + interface VaListBuilderCall { + void build(VaList.Builder builder, L layout, V value); } public Object nativeValue(ResourceScope scope) { diff --git a/test/jdk/java/foreign/TestAdaptVarHandles.java b/test/jdk/java/foreign/TestAdaptVarHandles.java index de88626948a..9c0e6c0e554 100644 --- a/test/jdk/java/foreign/TestAdaptVarHandles.java +++ b/test/jdk/java/foreign/TestAdaptVarHandles.java @@ -32,7 +32,6 @@ import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.ValueLayout; @@ -86,18 +85,18 @@ public class TestAdaptVarHandles { } } - static final VarHandle intHandleIndexed = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT) - .varHandle(int.class, MemoryLayout.PathElement.sequenceElement()); + static final VarHandle intHandleIndexed = MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT) + .varHandle(MemoryLayout.PathElement.sequenceElement()); - static final VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + static final VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); - static final VarHandle floatHandle = MemoryLayouts.JAVA_FLOAT.varHandle(float.class); + static final VarHandle floatHandle = ValueLayout.JAVA_FLOAT.varHandle(); @Test public void testFilterValue() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); - VarHandle intHandle = layout.varHandle(int.class); + VarHandle intHandle = layout.varHandle(); VarHandle i2SHandle = MemoryHandles.filterValue(intHandle, S2I, I2S); i2SHandle.set(segment, "1"); String oldValue = (String)i2SHandle.getAndAdd(segment, "42"); @@ -114,9 +113,9 @@ public class TestAdaptVarHandles { @Test public void testFilterValueComposite() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); - VarHandle intHandle = layout.varHandle(int.class); + VarHandle intHandle = layout.varHandle(); MethodHandle CTX_S2I = MethodHandles.dropArguments(S2I, 0, String.class, String.class); VarHandle i2SHandle = MemoryHandles.filterValue(intHandle, CTX_S2I, CTX_I2S); i2SHandle = MemoryHandles.insertCoordinates(i2SHandle, 1, "a", "b"); @@ -135,9 +134,9 @@ public class TestAdaptVarHandles { @Test public void testFilterValueLoose() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); - VarHandle intHandle = layout.varHandle(int.class); + VarHandle intHandle = layout.varHandle(); VarHandle i2SHandle = MemoryHandles.filterValue(intHandle, O2I, I2O); i2SHandle.set(segment, "1"); String oldValue = (String)i2SHandle.getAndAdd(segment, "42"); @@ -159,19 +158,19 @@ public class TestAdaptVarHandles { @Test(expectedExceptions = IllegalArgumentException.class) public void testBadFilterUnboxArity() { - VarHandle floatHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + VarHandle floatHandle = ValueLayout.JAVA_INT.varHandle(); MemoryHandles.filterValue(floatHandle, S2I.bindTo(""), I2S); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadFilterBoxArity() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); MemoryHandles.filterValue(intHandle, S2I, I2S.bindTo(42)); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadFilterBoxPrefixCoordinates() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); MemoryHandles.filterValue(intHandle, MethodHandles.dropArguments(S2I, 1, int.class), MethodHandles.dropArguments(I2S, 1, long.class)); @@ -179,31 +178,40 @@ public class TestAdaptVarHandles { @Test(expectedExceptions = IllegalArgumentException.class) public void testBadFilterBoxException() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); MemoryHandles.filterValue(intHandle, I2S, S2L_EX); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadFilterUnboxException() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); MemoryHandles.filterValue(intHandle, S2L_EX, I2S); } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test(expectedExceptions = IllegalStateException.class) public void testBadFilterBoxHandleException() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); - MemoryHandles.filterValue(intHandle, S2I, I2S_EX); + VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); + VarHandle vh = MemoryHandles.filterValue(intHandle, S2I, I2S_EX); + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + MemorySegment seg = MemorySegment.allocateNative(ValueLayout.JAVA_INT, scope); + vh.set(seg, "42"); + String x = (String) vh.get(seg); // should throw + } } - @Test(expectedExceptions = IllegalArgumentException.class) + @Test(expectedExceptions = IllegalStateException.class) public void testBadFilterUnboxHandleException() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); - MemoryHandles.filterValue(intHandle, S2I_EX, I2S); + VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); + VarHandle vh = MemoryHandles.filterValue(intHandle, S2I_EX, I2S); + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + MemorySegment seg = MemorySegment.allocateNative(ValueLayout.JAVA_INT, scope); + vh.set(seg, "42"); // should throw + } } @Test public void testFilterCoordinates() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); VarHandle intHandle_longIndex = MemoryHandles.filterCoordinates(intHandleIndexed, 0, BASE_ADDR, S2L); intHandle_longIndex.set(segment, "0", 1); @@ -246,7 +254,7 @@ public class TestAdaptVarHandles { @Test public void testInsertCoordinates() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); VarHandle intHandle_longIndex = MemoryHandles.insertCoordinates(intHandleIndexed, 0, segment, 0L); intHandle_longIndex.set(1); @@ -284,7 +292,7 @@ public class TestAdaptVarHandles { @Test public void testPermuteCoordinates() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); VarHandle intHandle_swap = MemoryHandles.permuteCoordinates(intHandleIndexed, List.of(long.class, MemorySegment.class), 1, 0); @@ -323,7 +331,7 @@ public class TestAdaptVarHandles { @Test public void testCollectCoordinates() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); VarHandle intHandle_sum = MemoryHandles.collectCoordinates(intHandleIndexed, 1, SUM_OFFSETS); intHandle_sum.set(segment, -2L, 2L, 1); @@ -366,7 +374,7 @@ public class TestAdaptVarHandles { @Test public void testDropCoordinates() throws Throwable { - ValueLayout layout = MemoryLayouts.JAVA_INT; + ValueLayout layout = ValueLayout.JAVA_INT; MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); VarHandle intHandle_dummy = MemoryHandles.dropCoordinates(intHandleIndexed, 1, float.class, String.class); intHandle_dummy.set(segment, 1f, "hello", 0L, 1); diff --git a/test/jdk/java/foreign/TestAddressHandle.java b/test/jdk/java/foreign/TestAddressHandle.java deleted file mode 100644 index de9bde07a5b..00000000000 --- a/test/jdk/java/foreign/TestAddressHandle.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2019, 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 - * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=true -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=false -Xverify:all TestAddressHandle - * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=true -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=true -Xverify:all TestAddressHandle - * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=false -Xverify:all TestAddressHandle - * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=true -Xverify:all TestAddressHandle - */ - -import java.lang.invoke.*; -import java.nio.ByteOrder; -import jdk.incubator.foreign.*; - -import org.testng.annotations.*; -import static org.testng.Assert.*; - -public class TestAddressHandle { - - static final MethodHandle INT_TO_BOOL; - static final MethodHandle BOOL_TO_INT; - static final MethodHandle INT_TO_STRING; - static final MethodHandle STRING_TO_INT; - - static { - try { - INT_TO_BOOL = MethodHandles.lookup().findStatic(TestAddressHandle.class, "intToBool", - MethodType.methodType(boolean.class, int.class)); - BOOL_TO_INT = MethodHandles.lookup().findStatic(TestAddressHandle.class, "boolToInt", - MethodType.methodType(int.class, boolean.class)); - INT_TO_STRING = MethodHandles.lookup().findStatic(TestAddressHandle.class, "intToString", - MethodType.methodType(String.class, int.class)); - STRING_TO_INT = MethodHandles.lookup().findStatic(TestAddressHandle.class, "stringToInt", - MethodType.methodType(int.class, String.class)); - } catch (Throwable ex) { - throw new ExceptionInInitializerError(ex); - } - } - - @Test(dataProvider = "addressHandles") - public void testAddressHandle(VarHandle addrHandle, int byteSize) { - VarHandle longHandle = MemoryLayouts.JAVA_LONG.varHandle(long.class); - try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment segment = MemorySegment.allocateNative(8, scope); - MemorySegment target = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN ? - segment.asSlice(8 - byteSize) : - segment; - longHandle.set(segment, 42L); - MemoryAddress address = (MemoryAddress)addrHandle.get(target); - assertEquals(address.toRawLongValue(), 42L); - addrHandle.set(target, address.addOffset(1)); - long result = (long)longHandle.get(segment); - assertEquals(43L, result); - } - } - - @Test(dataProvider = "addressHandles") - public void testNull(VarHandle addrHandle, int byteSize) { - VarHandle longHandle = MemoryLayouts.JAVA_LONG.varHandle(long.class); - try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment segment = MemorySegment.allocateNative(8, scope); - longHandle.set(segment, 0L); - MemoryAddress address = (MemoryAddress)addrHandle.get(segment); - assertTrue(address == MemoryAddress.NULL); - } - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testBadAdaptFloat() { - VarHandle floatHandle = MemoryLayouts.JAVA_FLOAT.varHandle(float.class); - MemoryHandles.asAddressVarHandle(floatHandle); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testBadAdaptDouble() { - VarHandle doubleHandle = MemoryLayouts.JAVA_DOUBLE.varHandle(double.class); - MemoryHandles.asAddressVarHandle(doubleHandle); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testBadAdaptBoolean() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); - VarHandle boolHandle = MemoryHandles.filterValue(intHandle, BOOL_TO_INT, INT_TO_BOOL); - MemoryHandles.asAddressVarHandle(boolHandle); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testBadAdaptString() { - VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); - VarHandle stringHandle = MemoryHandles.filterValue(intHandle, STRING_TO_INT, INT_TO_STRING); - MemoryHandles.asAddressVarHandle(stringHandle); - } - - @DataProvider(name = "addressHandles") - static Object[][] addressHandles() { - return new Object[][] { - // long - { MemoryHandles.asAddressVarHandle(at(MemoryHandles.varHandle(long.class, ByteOrder.nativeOrder()), 0)), 8 }, - { MemoryHandles.asAddressVarHandle(MemoryLayouts.JAVA_LONG.varHandle(long.class)), 8 }, - - // int - { MemoryHandles.asAddressVarHandle(at(MemoryHandles.varHandle(int.class, ByteOrder.nativeOrder()), 0)), 4 }, - { MemoryHandles.asAddressVarHandle(MemoryLayouts.JAVA_INT.varHandle(int.class)), 4 }, - - // short - { MemoryHandles.asAddressVarHandle(at(MemoryHandles.varHandle(short.class, ByteOrder.nativeOrder()), 0)), 2 }, - { MemoryHandles.asAddressVarHandle(MemoryLayouts.JAVA_SHORT.varHandle(short.class)), 2 }, - - // char - { MemoryHandles.asAddressVarHandle(at(MemoryHandles.varHandle(char.class, ByteOrder.nativeOrder()), 0)), 2 }, - { MemoryHandles.asAddressVarHandle(MemoryLayouts.JAVA_CHAR.varHandle(char.class)), 2 }, - - // byte - { MemoryHandles.asAddressVarHandle(at(MemoryHandles.varHandle(byte.class, ByteOrder.nativeOrder()), 0)), 1 }, - { MemoryHandles.asAddressVarHandle(MemoryLayouts.JAVA_BYTE.varHandle(byte.class)), 1 } - }; - } - - static VarHandle at(VarHandle handle, long offset) { - return MemoryHandles.insertCoordinates(handle, 1, offset); - } - - static int boolToInt(boolean value) { - return value ? 1 : 0; - } - - static boolean intToBool(int value) { - return value != 0; - } - - static int stringToInt(String value) { - return value.length(); - } - - static String intToString(int value) { - return String.valueOf(value); - } -} diff --git a/test/jdk/java/foreign/TestArrayCopy.java b/test/jdk/java/foreign/TestArrayCopy.java new file mode 100644 index 00000000000..b8a36307fde --- /dev/null +++ b/test/jdk/java/foreign/TestArrayCopy.java @@ -0,0 +1,542 @@ +/* + * Copyright (c) 2019, 2021, 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 + * @run testng TestArrayCopy + */ + +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; + +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.List; + +import jdk.incubator.foreign.MemoryLayout; +import jdk.incubator.foreign.MemorySegment; + +import jdk.incubator.foreign.ValueLayout; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +/** + * These tests exercise the MemoryCopy copyFromArray(...) and copyToArray(...). + * To make these tests more challenging the segment is a view of the given array, + * which makes the copy operations overlapping self-copies. Thus, this checks the claim: + * + *

      If the source (destination) segment is actually a view of the destination (source) array, + * and if the copy region of the source overlaps with the copy region of the destination, + * the copy of the overlapping region is performed as if the data in the overlapping region + * were first copied into a temporary segment before being copied to the destination.

      + */ +public class TestArrayCopy { + private static final ByteOrder NATIVE_ORDER = ByteOrder.nativeOrder(); + private static final ByteOrder NON_NATIVE_ORDER = NATIVE_ORDER == ByteOrder.LITTLE_ENDIAN + ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; + + private static final int SEG_LENGTH_BYTES = 32; + private static final int SEG_OFFSET_BYTES = 8; + + @Test(dataProvider = "copyModesAndHelpers") + public void testSelfCopy(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + int indexShifts = SEG_OFFSET_BYTES / bytesPerElement; + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + MemorySegment truth = truthSegment(base, helper, indexShifts, mode); + ByteOrder bo = mode.swap ? NON_NATIVE_ORDER : NATIVE_ORDER; + //CopyFrom + Object srcArr = helper.toArray(base); + int srcIndex = mode.direction ? 0 : indexShifts; + int srcCopyLen = helper.length(srcArr) - indexShifts; + MemorySegment dstSeg = helper.fromArray(srcArr); + long dstOffsetBytes = mode.direction ? SEG_OFFSET_BYTES : 0; + helper.copyFromArray(srcArr, srcIndex, srcCopyLen, dstSeg, dstOffsetBytes, bo); + assertEquals(truth.mismatch(dstSeg), -1); + //CopyTo + long srcOffsetBytes = mode.direction ? 0 : SEG_OFFSET_BYTES; + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + int dstIndex = mode.direction ? indexShifts : 0; + int dstCopyLen = helper.length(dstArr) - indexShifts; + helper.copyToArray(srcSeg, srcOffsetBytes, dstArr, dstIndex, dstCopyLen, bo); + MemorySegment result = helper.fromArray(dstArr); + assertEquals(truth.mismatch(result), -1); + } + + @Test(dataProvider = "copyModesAndHelpers") + public void testUnalignedCopy(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + int indexShifts = SEG_OFFSET_BYTES / bytesPerElement; + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + ByteOrder bo = mode.swap ? NON_NATIVE_ORDER : NATIVE_ORDER; + //CopyFrom + Object srcArr = helper.toArray(base); + int srcIndex = mode.direction ? 0 : indexShifts; + int srcCopyLen = helper.length(srcArr) - indexShifts; + MemorySegment dstSeg = helper.fromArray(srcArr); + long dstOffsetBytes = mode.direction ? (SEG_OFFSET_BYTES - 1) : 0; + helper.copyFromArray(srcArr, srcIndex, srcCopyLen, dstSeg, dstOffsetBytes, bo); + //CopyTo + long srcOffsetBytes = mode.direction ? 0 : (SEG_OFFSET_BYTES - 1); + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + int dstIndex = mode.direction ? indexShifts : 0; + int dstCopyLen = helper.length(dstArr) - indexShifts; + helper.copyToArray(srcSeg, srcOffsetBytes, dstArr, dstIndex, dstCopyLen, bo); + } + + @Test(dataProvider = "copyModesAndHelpers") + public void testCopyOobLength(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + //CopyFrom + Object srcArr = helper.toArray(base); + MemorySegment dstSeg = helper.fromArray(srcArr); + try { + helper.copyFromArray(srcArr, 0, (SEG_LENGTH_BYTES / bytesPerElement) * 2, dstSeg, 0, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + //CopyTo + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + try { + helper.copyToArray(srcSeg, 0, dstArr, 0, (SEG_LENGTH_BYTES / bytesPerElement) * 2, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + } + + @Test(dataProvider = "copyModesAndHelpers") + public void testCopyNegativeIndices(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + //CopyFrom + Object srcArr = helper.toArray(base); + MemorySegment dstSeg = helper.fromArray(srcArr); + try { + helper.copyFromArray(srcArr, -1, SEG_LENGTH_BYTES / bytesPerElement, dstSeg, 0, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + //CopyTo + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + try { + helper.copyToArray(srcSeg, 0, dstArr, -1, SEG_LENGTH_BYTES / bytesPerElement, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + } + + @Test(dataProvider = "copyModesAndHelpers") + public void testCopyNegativeOffsets(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + //CopyFrom + Object srcArr = helper.toArray(base); + MemorySegment dstSeg = helper.fromArray(srcArr); + try { + helper.copyFromArray(srcArr, 0, SEG_LENGTH_BYTES / bytesPerElement, dstSeg, -1, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + //CopyTo + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + try { + helper.copyToArray(srcSeg, -1, dstArr, 0, SEG_LENGTH_BYTES / bytesPerElement, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + } + + @Test(dataProvider = "copyModesAndHelpers") + public void testCopyOobIndices(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + //CopyFrom + Object srcArr = helper.toArray(base); + MemorySegment dstSeg = helper.fromArray(srcArr); + try { + helper.copyFromArray(srcArr, helper.length(srcArr) + 1, SEG_LENGTH_BYTES / bytesPerElement, dstSeg, 0, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + //CopyTo + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + try { + helper.copyToArray(srcSeg, 0, dstArr, helper.length(dstArr) + 1, SEG_LENGTH_BYTES / bytesPerElement, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + } + + @Test(dataProvider = "copyModesAndHelpers") + public void testCopyOobOffsets(CopyMode mode, CopyHelper helper, String helperDebugString) { + int bytesPerElement = (int)helper.elementLayout.byteSize(); + MemorySegment base = srcSegment(SEG_LENGTH_BYTES); + //CopyFrom + Object srcArr = helper.toArray(base); + MemorySegment dstSeg = helper.fromArray(srcArr); + try { + helper.copyFromArray(srcArr, 0, SEG_LENGTH_BYTES / bytesPerElement, dstSeg, SEG_LENGTH_BYTES + 1, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + //CopyTo + Object dstArr = helper.toArray(base); + MemorySegment srcSeg = helper.fromArray(dstArr).asReadOnly(); + try { + helper.copyToArray(srcSeg, SEG_OFFSET_BYTES + 1, dstArr, 0, SEG_LENGTH_BYTES / bytesPerElement, ByteOrder.nativeOrder()); + fail(); + } catch (IndexOutOfBoundsException ex) { + //ok + } + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNotAnArraySrc() { + MemorySegment segment = MemorySegment.ofArray(new int[] {1, 2, 3, 4}); + MemorySegment.copy(segment, JAVA_BYTE, 0, new String[] { "hello" }, 0, 4); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNotAnArrayDst() { + MemorySegment segment = MemorySegment.ofArray(new int[] {1, 2, 3, 4}); + MemorySegment.copy(new String[] { "hello" }, 0, segment, JAVA_BYTE, 0, 4); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCarrierMismatchSrc() { + MemorySegment segment = MemorySegment.ofArray(new int[] {1, 2, 3, 4}); + MemorySegment.copy(segment, JAVA_INT, 0, new byte[] { 1, 2, 3, 4 }, 0, 4); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCarrierMismatchDst() { + MemorySegment segment = MemorySegment.ofArray(new int[] {1, 2, 3, 4}); + MemorySegment.copy(new byte[] { 1, 2, 3, 4 }, 0, segment, JAVA_INT, 0, 4); + } + + /***** Utilities *****/ + + public static MemorySegment srcSegment(int bytesLength) { + byte[] arr = new byte[bytesLength]; + for (int i = 0; i < arr.length; i++) { + arr[i] = (byte)i; + } + return MemorySegment.ofArray(arr); + } + + public static MemorySegment truthSegment(MemorySegment srcSeg, CopyHelper helper, int indexShifts, CopyMode mode) { + VarHandle indexedHandleNO = MemoryLayout.sequenceLayout(helper.elementLayout.withOrder(NATIVE_ORDER)) + .varHandle(MemoryLayout.PathElement.sequenceElement()); + VarHandle indexedHandleNNO = MemoryLayout.sequenceLayout(helper.elementLayout.withOrder(NON_NATIVE_ORDER)) + .varHandle(MemoryLayout.PathElement.sequenceElement()); + MemorySegment dstSeg = MemorySegment.ofArray(srcSeg.toArray(JAVA_BYTE)); + int indexLength = (int) dstSeg.byteSize() / (int)helper.elementLayout.byteSize(); + if (mode.direction) { + if (mode.swap) { + for (int i = indexLength - 1; i >= indexShifts; i--) { + Object v = indexedHandleNNO.get(dstSeg, i - indexShifts); + indexedHandleNO.set(dstSeg, i, v); + } + } else { + for (int i = indexLength - 1; i >= indexShifts; i--) { + Object v = indexedHandleNO.get(dstSeg, i - indexShifts); + indexedHandleNO.set(dstSeg, i, v); + } + } + } else { //down + if (mode.swap) { + for (int i = indexShifts; i < indexLength; i++) { + Object v = indexedHandleNNO.get(dstSeg, i); + indexedHandleNO.set(dstSeg, i - indexShifts, v); + } + } else { + for (int i = indexShifts; i < indexLength; i++) { + Object v = indexedHandleNO.get(dstSeg, i); + indexedHandleNO.set(dstSeg, i - indexShifts, v); + } + } + } + return dstSeg; + } + + enum CopyMode { + UP_NO_SWAP(true, false), + UP_SWAP(true, true), + DOWN_NO_SWAP(false, false), + DOWN_SWAP(false, true); + + final boolean direction; + final boolean swap; + + CopyMode(boolean direction, boolean swap) { + this.direction = direction; + this.swap = swap; + } + } + + abstract static class CopyHelper { + + final L elementLayout; + final Class carrier; + + public CopyHelper(L elementLayout, Class carrier) { + this.elementLayout = elementLayout; + this.carrier = carrier; + } + + abstract void copyFromArray(X srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo); + abstract void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, X dstArr, int dstIndex, int dstCopyLen, ByteOrder bo); + abstract X toArray(MemorySegment segment); + abstract MemorySegment fromArray(X array); + abstract int length(X arr); + + @Override + public String toString() { + return "CopyHelper{" + + "elementLayout=" + elementLayout + + ", carrier=" + carrier.getName() + + '}'; + } + + static final CopyHelper BYTE = new CopyHelper<>(JAVA_BYTE, byte[].class) { + @Override + void copyFromArray(byte[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, byte[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + byte[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(byte[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(byte[] arr) { + return arr.length; + } + }; + + static final CopyHelper CHAR = new CopyHelper<>(ValueLayout.JAVA_CHAR, char[].class) { + @Override + void copyFromArray(char[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, char[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + char[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(char[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(char[] arr) { + return arr.length; + } + }; + + static final CopyHelper SHORT = new CopyHelper<>(ValueLayout.JAVA_SHORT, short[].class) { + @Override + void copyFromArray(short[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, short[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + short[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(short[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(short[] arr) { + return arr.length; + } + }; + + static final CopyHelper INT = new CopyHelper<>(ValueLayout.JAVA_INT, int[].class) { + @Override + void copyFromArray(int[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, int[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + int[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(int[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(int[] arr) { + return arr.length; + } + }; + + static final CopyHelper FLOAT = new CopyHelper<>(ValueLayout.JAVA_FLOAT, float[].class) { + @Override + void copyFromArray(float[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, float[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + float[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(float[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(float[] arr) { + return arr.length; + } + }; + + static final CopyHelper LONG = new CopyHelper<>(ValueLayout.JAVA_LONG, long[].class) { + @Override + void copyFromArray(long[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, long[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + long[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(long[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(long[] arr) { + return arr.length; + } + }; + + static final CopyHelper DOUBLE = new CopyHelper<>(ValueLayout.JAVA_DOUBLE, double[].class) { + @Override + void copyFromArray(double[] srcArr, int srcIndex, int srcCopyLen, MemorySegment dstSeg, long dstOffsetBytes, ByteOrder bo) { + MemorySegment.copy(srcArr, srcIndex, dstSeg, elementLayout.withOrder(bo), dstOffsetBytes, srcCopyLen); + } + + @Override + void copyToArray(MemorySegment srcSeg, long srcOffsetBytes, double[] dstArr, int dstIndex, int dstCopyLen, ByteOrder bo) { + MemorySegment.copy(srcSeg, elementLayout.withOrder(bo), srcOffsetBytes, dstArr, dstIndex, dstCopyLen); + } + + @Override + double[] toArray(MemorySegment segment) { + return segment.toArray(elementLayout); + } + + @Override + MemorySegment fromArray(double[] array) { + return MemorySegment.ofArray(array); + } + + @Override + int length(double[] arr) { + return arr.length; + } + }; + } + + @DataProvider + Object[][] copyModesAndHelpers() { + CopyHelper[] helpers = { CopyHelper.BYTE, CopyHelper.CHAR, CopyHelper.SHORT, CopyHelper.INT, + CopyHelper.FLOAT, CopyHelper.LONG, CopyHelper.DOUBLE }; + List results = new ArrayList<>(); + for (CopyHelper helper : helpers) { + for (CopyMode mode : CopyMode.values()) { + results.add(new Object[] { mode, helper, helper.toString() }); + } + } + return results.stream().toArray(Object[][]::new); + } +} diff --git a/test/jdk/java/foreign/TestArrays.java b/test/jdk/java/foreign/TestArrays.java index 451beeb4544..ca412554cb4 100644 --- a/test/jdk/java/foreign/TestArrays.java +++ b/test/jdk/java/foreign/TestArrays.java @@ -30,7 +30,6 @@ import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemoryLayout.PathElement; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SequenceLayout; @@ -43,45 +42,52 @@ import java.util.function.Function; import org.testng.annotations.*; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; import static org.testng.Assert.*; public class TestArrays { static SequenceLayout bytes = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_BYTE + JAVA_BYTE ); static SequenceLayout chars = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_CHAR + JAVA_CHAR ); static SequenceLayout shorts = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_SHORT + JAVA_SHORT ); static SequenceLayout ints = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_INT + JAVA_INT ); static SequenceLayout floats = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_FLOAT + JAVA_FLOAT ); static SequenceLayout longs = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_LONG + JAVA_LONG ); static SequenceLayout doubles = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_DOUBLE + JAVA_DOUBLE ); - static VarHandle byteHandle = bytes.varHandle(byte.class, PathElement.sequenceElement()); - static VarHandle charHandle = chars.varHandle(char.class, PathElement.sequenceElement()); - static VarHandle shortHandle = shorts.varHandle(short.class, PathElement.sequenceElement()); - static VarHandle intHandle = ints.varHandle(int.class, PathElement.sequenceElement()); - static VarHandle floatHandle = floats.varHandle(float.class, PathElement.sequenceElement()); - static VarHandle longHandle = longs.varHandle(long.class, PathElement.sequenceElement()); - static VarHandle doubleHandle = doubles.varHandle(double.class, PathElement.sequenceElement()); + static VarHandle byteHandle = bytes.varHandle(PathElement.sequenceElement()); + static VarHandle charHandle = chars.varHandle(PathElement.sequenceElement()); + static VarHandle shortHandle = shorts.varHandle(PathElement.sequenceElement()); + static VarHandle intHandle = ints.varHandle(PathElement.sequenceElement()); + static VarHandle floatHandle = floats.varHandle(PathElement.sequenceElement()); + static VarHandle longHandle = longs.varHandle(PathElement.sequenceElement()); + static VarHandle doubleHandle = doubles.varHandle(PathElement.sequenceElement()); static void initBytes(MemorySegment base, SequenceLayout seq, BiConsumer handleSetter) { for (long i = 0; i < seq.elementCount().getAsLong() ; i++) { @@ -112,7 +118,7 @@ public class TestArrays { public void testTooBigForArray(MemoryLayout layout, Function arrayFactory) { MemoryLayout seq = MemoryLayout.sequenceLayout((Integer.MAX_VALUE * layout.byteSize()) + 1, layout); //do not really allocate here, as it's way too much memory - MemorySegment segment = MemoryAddress.NULL.asSegment(seq.byteSize(), ResourceScope.globalScope()); + MemorySegment segment = MemorySegment.ofAddress(MemoryAddress.NULL, seq.byteSize(), ResourceScope.globalScope()); arrayFactory.apply(segment); } @@ -152,19 +158,19 @@ public class TestArrays { (base) -> initBytes(base, doubles, (addr, pos) -> doubleHandle.set(addr, pos, (double)(long)pos)); Consumer byteChecker = - (base) -> checkBytes(base, bytes, MemorySegment::toByteArray, (addr, pos) -> (byte)byteHandle.get(addr, pos)); + (base) -> checkBytes(base, bytes, s -> s.toArray(JAVA_BYTE), (addr, pos) -> (byte)byteHandle.get(addr, pos)); Consumer shortChecker = - (base) -> checkBytes(base, shorts, MemorySegment::toShortArray, (addr, pos) -> (short)shortHandle.get(addr, pos)); + (base) -> checkBytes(base, shorts, s -> s.toArray(JAVA_SHORT), (addr, pos) -> (short)shortHandle.get(addr, pos)); Consumer charChecker = - (base) -> checkBytes(base, chars, MemorySegment::toCharArray, (addr, pos) -> (char)charHandle.get(addr, pos)); + (base) -> checkBytes(base, chars, s -> s.toArray(JAVA_CHAR), (addr, pos) -> (char)charHandle.get(addr, pos)); Consumer intChecker = - (base) -> checkBytes(base, ints, MemorySegment::toIntArray, (addr, pos) -> (int)intHandle.get(addr, pos)); + (base) -> checkBytes(base, ints, s -> s.toArray(JAVA_INT), (addr, pos) -> (int)intHandle.get(addr, pos)); Consumer floatChecker = - (base) -> checkBytes(base, floats, MemorySegment::toFloatArray, (addr, pos) -> (float)floatHandle.get(addr, pos)); + (base) -> checkBytes(base, floats, s -> s.toArray(JAVA_FLOAT), (addr, pos) -> (float)floatHandle.get(addr, pos)); Consumer longChecker = - (base) -> checkBytes(base, longs, MemorySegment::toLongArray, (addr, pos) -> (long)longHandle.get(addr, pos)); + (base) -> checkBytes(base, longs, s -> s.toArray(JAVA_LONG), (addr, pos) -> (long)longHandle.get(addr, pos)); Consumer doubleChecker = - (base) -> checkBytes(base, doubles, MemorySegment::toDoubleArray, (addr, pos) -> (double)doubleHandle.get(addr, pos)); + (base) -> checkBytes(base, doubles, s -> s.toArray(JAVA_DOUBLE), (addr, pos) -> (double)doubleHandle.get(addr, pos)); return new Object[][]{ {byteInitializer, byteChecker, bytes}, @@ -180,13 +186,13 @@ public class TestArrays { @DataProvider(name = "elemLayouts") public Object[][] elemLayouts() { return new Object[][] { - { MemoryLayouts.JAVA_BYTE, (Function) MemorySegment::toByteArray }, - { MemoryLayouts.JAVA_SHORT, (Function) MemorySegment::toShortArray }, - { MemoryLayouts.JAVA_CHAR, (Function) MemorySegment::toCharArray }, - { MemoryLayouts.JAVA_INT, (Function) MemorySegment::toIntArray }, - { MemoryLayouts.JAVA_FLOAT, (Function) MemorySegment::toFloatArray }, - { MemoryLayouts.JAVA_LONG, (Function) MemorySegment::toLongArray }, - { MemoryLayouts.JAVA_DOUBLE, (Function) MemorySegment::toDoubleArray } + { JAVA_BYTE, (Function)s -> s.toArray(JAVA_BYTE)}, + { JAVA_SHORT, (Function) s -> s.toArray(JAVA_SHORT)}, + { JAVA_CHAR, (Function) s -> s.toArray(JAVA_CHAR)}, + { JAVA_INT, (Function)s -> s.toArray(JAVA_INT)}, + { JAVA_FLOAT, (Function)s -> s.toArray(JAVA_FLOAT)}, + { JAVA_LONG, (Function)s -> s.toArray(JAVA_LONG)}, + { JAVA_DOUBLE, (Function)s -> s.toArray(JAVA_DOUBLE)} }; } } diff --git a/test/jdk/java/foreign/TestByteBuffer.java b/test/jdk/java/foreign/TestByteBuffer.java index cdc9addb381..57d953f771d 100644 --- a/test/jdk/java/foreign/TestByteBuffer.java +++ b/test/jdk/java/foreign/TestByteBuffer.java @@ -28,8 +28,6 @@ * @run testng/othervm --enable-native-access=ALL-UNNAMED TestByteBuffer */ -import jdk.incubator.foreign.MemoryAccess; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; @@ -82,6 +80,13 @@ import org.testng.SkipException; import org.testng.annotations.*; import sun.nio.ch.DirectBuffer; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; import static org.testng.Assert.*; public class TestByteBuffer { @@ -102,40 +107,40 @@ public class TestByteBuffer { static SequenceLayout tuples = MemoryLayout.sequenceLayout(500, MemoryLayout.structLayout( - MemoryLayouts.BITS_32_BE.withName("index"), - MemoryLayouts.BITS_32_BE.withName("value") + JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN).withName("index"), + JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN).withName("value") )); static SequenceLayout bytes = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_8_BE + JAVA_BYTE ); static SequenceLayout chars = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_16_BE + JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN) ); static SequenceLayout shorts = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_16_BE + JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN) ); static SequenceLayout ints = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_32_BE + JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN) ); static SequenceLayout floats = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_32_BE + JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN) ); static SequenceLayout longs = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_64_BE + JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN) ); static SequenceLayout doubles = MemoryLayout.sequenceLayout(100, - MemoryLayouts.BITS_64_BE + JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN) ); - static VarHandle indexHandle = tuples.varHandle(int.class, PathElement.sequenceElement(), PathElement.groupElement("index")); - static VarHandle valueHandle = tuples.varHandle(float.class, PathElement.sequenceElement(), PathElement.groupElement("value")); + static VarHandle indexHandle = tuples.varHandle(PathElement.sequenceElement(), PathElement.groupElement("index")); + static VarHandle valueHandle = tuples.varHandle(PathElement.sequenceElement(), PathElement.groupElement("value")); static void initTuples(MemorySegment base, long count) { for (long i = 0; i < count ; i++) { @@ -263,7 +268,7 @@ public class TestByteBuffer { } } - @Test(dataProvider = "mappedOps", expectedExceptions = UnsupportedOperationException.class) + @Test(dataProvider = "mappedOps", expectedExceptions = IllegalStateException.class) public void testMappedSegmentOperations(MappedSegmentOp mappedBufferOp) throws Throwable { File f = new File("test3.out"); f.createNewFile(); @@ -324,6 +329,9 @@ public class TestByteBuffer { segment.isLoaded(); segment.unload(); segment.isLoaded(); + } catch(IOException e) { + if (e.getMessage().equals("Function not implemented")) + throw new SkipException(e.getMessage(), e); } } @@ -480,7 +488,7 @@ public class TestByteBuffer { @Test(expectedExceptions = IllegalStateException.class) public void testTooBigForByteBuffer() { - MemorySegment segment = MemoryAddress.NULL.asSegment(Integer.MAX_VALUE + 10L, ResourceScope.globalScope()); + MemorySegment segment = MemorySegment.ofAddress(MemoryAddress.NULL, Integer.MAX_VALUE + 10L, ResourceScope.newImplicitScope()); segment.asByteBuffer(); } @@ -511,7 +519,7 @@ public class TestByteBuffer { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.mapFile(f.toPath(), 0, SIZE, FileChannel.MapMode.READ_WRITE, scope); for (byte offset = 0; offset < SIZE; offset++) { - MemoryAccess.setByteAtOffset(segment, offset, offset); + segment.set(JAVA_BYTE, offset, offset); } segment.force(); } @@ -519,7 +527,7 @@ public class TestByteBuffer { for (int offset = 0 ; offset < SIZE ; offset++) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.mapFile(f.toPath(), offset, SIZE - offset, FileChannel.MapMode.READ_ONLY, scope); - assertEquals(MemoryAccess.getByte(segment), offset); + assertEquals(segment.get(JAVA_BYTE, 0), offset); } } } @@ -636,13 +644,13 @@ public class TestByteBuffer { @Test(expectedExceptions = IllegalStateException.class) public void testDeadAccessOnClosedBufferSegment() { - MemorySegment s1 = MemorySegment.allocateNative(MemoryLayouts.JAVA_INT, ResourceScope.newConfinedScope()); + MemorySegment s1 = MemorySegment.allocateNative(JAVA_INT, ResourceScope.newConfinedScope()); MemorySegment s2 = MemorySegment.ofByteBuffer(s1.asByteBuffer()); // memory freed s1.scope().close(); - MemoryAccess.setInt(s2, 10); // Dead access! + s2.set(JAVA_INT, 0, 10); // Dead access! } @Test(dataProvider = "allScopes") @@ -654,7 +662,7 @@ public class TestByteBuffer { ResourceScope scp = closeableScopeOrNull(scope = scopeSupplier.get())) { MemorySegment segment = MemorySegment.allocateNative(10, 1, scope); for (int i = 0; i < 10; i++) { - MemoryAccess.setByteAtOffset(segment, i, (byte) i); + segment.set(JAVA_BYTE, i, (byte) i); } ByteBuffer bb = segment.asByteBuffer(); assertEquals(channel.write(bb), 10); @@ -674,7 +682,7 @@ public class TestByteBuffer { try (FileChannel channel = FileChannel.open(tmp.toPath(), StandardOpenOption.READ, StandardOpenOption.WRITE)) { MemorySegment segment = MemorySegment.allocateNative(10, scopeSupplier.get()); for (int i = 0; i < 10; i++) { - MemoryAccess.setByteAtOffset(segment, i, (byte) i); + segment.set(JAVA_BYTE, i, (byte) i); } ByteBuffer bb = segment.asByteBuffer(); segment.scope().close(); @@ -694,7 +702,7 @@ public class TestByteBuffer { int newSize = 8; var slice = segment.asSlice(4, newSize); - var bytes = slice.toByteArray(); + var bytes = slice.toArray(JAVA_BYTE); assertEquals(newSize, bytes.length); var buffer = slice.asByteBuffer(); @@ -719,6 +727,7 @@ public class TestByteBuffer { public static Object[][] segments() throws Throwable { return new Object[][] { { (Supplier) () -> MemorySegment.allocateNative(16, ResourceScope.newImplicitScope()) }, + { (Supplier) () -> MemorySegment.allocateNative(16, ResourceScope.newConfinedScope()) }, { (Supplier) () -> MemorySegment.ofArray(new byte[16]) } }; } @@ -729,27 +738,20 @@ public class TestByteBuffer { { (Supplier) () -> ResourceScope.newSharedScope() }, { (Supplier) () -> ResourceScope.newConfinedScope() }, { (Supplier) () -> ResourceScope.newSharedScope(Cleaner.create()) }, - { (Supplier) () -> ResourceScope.newConfinedScope(Cleaner.create()) } - }; - } - - @DataProvider(name = "implicitScopes") - public static Object[][] implicitScopes() { - return new Object[][] { - { (Supplier) ResourceScope::newImplicitScope }, - { (Supplier) ResourceScope::globalScope }, + { (Supplier) () -> ResourceScope.newConfinedScope(Cleaner.create()) }, + { (Supplier) () -> ResourceScope.newImplicitScope() } }; } @DataProvider(name = "allScopes") public static Object[][] allScopes() { - return Stream.of(implicitScopes(), closeableScopes()) + return Stream.of(new Object[][] { { (Supplier)ResourceScope::globalScope } }, closeableScopes()) .flatMap(Arrays::stream) .toArray(Object[][]::new); } static ResourceScope closeableScopeOrNull(ResourceScope scope) { - if (scope.isImplicit()) + if (scope == ResourceScope.globalScope()) return null; return scope; } @@ -812,34 +814,34 @@ public class TestByteBuffer { @DataProvider(name = "resizeOps") public Object[][] resizeOps() { Consumer byteInitializer = - (base) -> initBytes(base, bytes, (addr, pos) -> MemoryAccess.setByteAtOffset(addr, pos, (byte)(long)pos)); + (base) -> initBytes(base, bytes, (addr, pos) -> addr.set(JAVA_BYTE, pos, (byte)(long)pos)); Consumer charInitializer = - (base) -> initBytes(base, chars, (addr, pos) -> MemoryAccess.setCharAtIndex(addr, pos, ByteOrder.BIG_ENDIAN, (char)(long)pos)); + (base) -> initBytes(base, chars, (addr, pos) -> addr.setAtIndex(JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), pos, (char)(long)pos)); Consumer shortInitializer = - (base) -> initBytes(base, shorts, (addr, pos) -> MemoryAccess.setShortAtIndex(addr, pos, ByteOrder.BIG_ENDIAN, (short)(long)pos)); + (base) -> initBytes(base, shorts, (addr, pos) -> addr.setAtIndex(JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), pos, (short)(long)pos)); Consumer intInitializer = - (base) -> initBytes(base, ints, (addr, pos) -> MemoryAccess.setIntAtIndex(addr, pos, ByteOrder.BIG_ENDIAN, (int)(long)pos)); + (base) -> initBytes(base, ints, (addr, pos) -> addr.setAtIndex(JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), pos, (int)(long)pos)); Consumer floatInitializer = - (base) -> initBytes(base, floats, (addr, pos) -> MemoryAccess.setFloatAtIndex(addr, pos, ByteOrder.BIG_ENDIAN, (float)(long)pos)); + (base) -> initBytes(base, floats, (addr, pos) -> addr.setAtIndex(JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), pos, (float)(long)pos)); Consumer longInitializer = - (base) -> initBytes(base, longs, (addr, pos) -> MemoryAccess.setLongAtIndex(addr, pos, ByteOrder.BIG_ENDIAN, (long)pos)); + (base) -> initBytes(base, longs, (addr, pos) -> addr.setAtIndex(JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), pos, (long)pos)); Consumer doubleInitializer = - (base) -> initBytes(base, doubles, (addr, pos) -> MemoryAccess.setDoubleAtIndex(addr, pos, ByteOrder.BIG_ENDIAN, (double)(long)pos)); + (base) -> initBytes(base, doubles, (addr, pos) -> addr.setAtIndex(JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), pos, (double)(long)pos)); Consumer byteChecker = - (base) -> checkBytes(base, bytes, Function.identity(), (addr, pos) -> MemoryAccess.getByteAtOffset(addr, pos), ByteBuffer::get); + (base) -> checkBytes(base, bytes, Function.identity(), (addr, pos) -> addr.get(JAVA_BYTE, pos), ByteBuffer::get); Consumer charChecker = - (base) -> checkBytes(base, chars, ByteBuffer::asCharBuffer, (addr, pos) -> MemoryAccess.getCharAtIndex(addr, pos, ByteOrder.BIG_ENDIAN), CharBuffer::get); + (base) -> checkBytes(base, chars, ByteBuffer::asCharBuffer, (addr, pos) -> addr.getAtIndex(JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), pos), CharBuffer::get); Consumer shortChecker = - (base) -> checkBytes(base, shorts, ByteBuffer::asShortBuffer, (addr, pos) -> MemoryAccess.getShortAtIndex(addr, pos, ByteOrder.BIG_ENDIAN), ShortBuffer::get); + (base) -> checkBytes(base, shorts, ByteBuffer::asShortBuffer, (addr, pos) -> addr.getAtIndex(JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), pos), ShortBuffer::get); Consumer intChecker = - (base) -> checkBytes(base, ints, ByteBuffer::asIntBuffer, (addr, pos) -> MemoryAccess.getIntAtIndex(addr, pos, ByteOrder.BIG_ENDIAN), IntBuffer::get); + (base) -> checkBytes(base, ints, ByteBuffer::asIntBuffer, (addr, pos) -> addr.getAtIndex(JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), pos), IntBuffer::get); Consumer floatChecker = - (base) -> checkBytes(base, floats, ByteBuffer::asFloatBuffer, (addr, pos) -> MemoryAccess.getFloatAtIndex(addr, pos, ByteOrder.BIG_ENDIAN), FloatBuffer::get); + (base) -> checkBytes(base, floats, ByteBuffer::asFloatBuffer, (addr, pos) -> addr.getAtIndex(JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), pos), FloatBuffer::get); Consumer longChecker = - (base) -> checkBytes(base, longs, ByteBuffer::asLongBuffer, (addr, pos) -> MemoryAccess.getLongAtIndex(addr, pos, ByteOrder.BIG_ENDIAN), LongBuffer::get); + (base) -> checkBytes(base, longs, ByteBuffer::asLongBuffer, (addr, pos) -> addr.getAtIndex(JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), pos), LongBuffer::get); Consumer doubleChecker = - (base) -> checkBytes(base, doubles, ByteBuffer::asDoubleBuffer, (addr, pos) -> MemoryAccess.getDoubleAtIndex(addr, pos, ByteOrder.BIG_ENDIAN), DoubleBuffer::get); + (base) -> checkBytes(base, doubles, ByteBuffer::asDoubleBuffer, (addr, pos) -> addr.getAtIndex(JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), pos), DoubleBuffer::get); return new Object[][]{ {byteChecker, byteInitializer, bytes}, diff --git a/test/jdk/java/foreign/TestCircularInit1.java b/test/jdk/java/foreign/TestCircularInit1.java deleted file mode 100644 index 46a98bd23f8..00000000000 --- a/test/jdk/java/foreign/TestCircularInit1.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2020, 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.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" - * @modules jdk.incubator.foreign/jdk.internal.foreign - * @run testng/othervm TestCircularInit1 - */ - -import jdk.incubator.foreign.CLinker; -import jdk.internal.foreign.PlatformLayouts; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertNotNull; - -public class TestCircularInit1 { - - @Test - public void testCircularInit() { - System.out.println(PlatformLayouts.Win64.C_CHAR); // trigger clinit - assertNotNull(CLinker.C_CHAR); // should not be null - } - -} diff --git a/test/jdk/java/foreign/TestCircularInit2.java b/test/jdk/java/foreign/TestCircularInit2.java deleted file mode 100644 index 0eeed8184cf..00000000000 --- a/test/jdk/java/foreign/TestCircularInit2.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2020, 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.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" - * @modules jdk.incubator.foreign/jdk.internal.foreign - * @run testng/othervm TestCircularInit2 - */ - -import jdk.incubator.foreign.CLinker; -import jdk.internal.foreign.PlatformLayouts; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertNotNull; - -public class TestCircularInit2 { - - @Test - public void testCircularInit() { - System.out.println(CLinker.C_CHAR); // trigger clinit - assertNotNull(PlatformLayouts.Win64.C_CHAR); - assertNotNull(PlatformLayouts.SysV.C_CHAR); - assertNotNull(PlatformLayouts.AArch64.C_CHAR); - } - -} diff --git a/test/jdk/java/foreign/TestCondy.java b/test/jdk/java/foreign/TestCondy.java index 0f262214799..42191dd4a24 100644 --- a/test/jdk/java/foreign/TestCondy.java +++ b/test/jdk/java/foreign/TestCondy.java @@ -39,7 +39,15 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static jdk.incubator.foreign.CLinker.*; +import static jdk.incubator.foreign.ValueLayout.ADDRESS; +import static jdk.incubator.foreign.ValueLayout.JAVA_BOOLEAN; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; import static org.testng.Assert.assertEquals; public class TestCondy { @@ -53,14 +61,15 @@ public class TestCondy { private static final MemoryLayout[] constants = { - C_CHAR, - C_SHORT, - C_INT, - C_LONG, - C_LONG_LONG, - C_FLOAT, - C_DOUBLE, - C_POINTER + JAVA_BOOLEAN, + JAVA_CHAR, + JAVA_BYTE, + JAVA_SHORT, + JAVA_INT, + JAVA_FLOAT, + JAVA_LONG, + JAVA_DOUBLE, + ADDRESS }; @DataProvider @@ -78,7 +87,7 @@ public class TestCondy { } testValues.add(FunctionDescriptor.ofVoid(constants)); - testValues.add(FunctionDescriptor.of(C_CHAR, constants)); + testValues.add(FunctionDescriptor.of(JAVA_BYTE, constants)); return testValues.stream().map(e -> new Object[] { e }).toArray(Object[][]::new); } diff --git a/test/jdk/java/foreign/TestDowncall.java b/test/jdk/java/foreign/TestDowncall.java index 8a78a20e1fb..252e14c6951 100644 --- a/test/jdk/java/foreign/TestDowncall.java +++ b/test/jdk/java/foreign/TestDowncall.java @@ -33,8 +33,11 @@ * TestDowncall */ +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; @@ -52,7 +55,7 @@ import static org.testng.Assert.*; public class TestDowncall extends CallGeneratorHelper { - static CLinker abi = CLinker.getInstance(); + static CLinker abi = CLinker.systemCLinker(); static { System.loadLibrary("TestDowncall"); } @@ -62,64 +65,37 @@ public class TestDowncall extends CallGeneratorHelper { @Test(dataProvider="functions", dataProviderClass=CallGeneratorHelper.class) public void testDowncall(int count, String fName, Ret ret, List paramTypes, List fields) throws Throwable { List> checks = new ArrayList<>(); - MemoryAddress addr = LOOKUP.lookup(fName).get(); + NativeSymbol addr = LOOKUP.lookup(fName).get(); MethodType mt = methodType(ret, paramTypes, fields); FunctionDescriptor descriptor = function(ret, paramTypes, fields); Object[] args = makeArgs(paramTypes, fields, checks); - try (NativeScope scope = new NativeScope()) { + try (ResourceScope scope = ResourceScope.newSharedScope()) { boolean needsScope = mt.returnType().equals(MemorySegment.class); - Object res = doCall(addr, scope, mt, descriptor, args); + SegmentAllocator allocator = needsScope ? + SegmentAllocator.newNativeArena(scope) : + THROWING_ALLOCATOR; + Object res = doCall(addr, allocator, descriptor, args); if (ret == Ret.NON_VOID) { checks.forEach(c -> c.accept(res)); if (needsScope) { // check that return struct has indeed been allocated in the native scope - assertEquals(((MemorySegment) res).scope(), scope.scope()); - assertEquals(scope.allocatedBytes(), descriptor.returnLayout().get().byteSize()); - } else { - // if here, there should be no allocation through the scope! - assertEquals(scope.allocatedBytes(), 0L); + assertEquals(((MemorySegment) res).scope(), scope); } - } else { - // if here, there should be no allocation through the scope! - assertEquals(scope.allocatedBytes(), 0L); } } } - @Test(dataProvider="functions", dataProviderClass=CallGeneratorHelper.class) - public void testDowncallNoScope(int count, String fName, Ret ret, List paramTypes, List fields) throws Throwable { - List> checks = new ArrayList<>(); - MemoryAddress addr = LOOKUP.lookup(fName).get(); - MethodType mt = methodType(ret, paramTypes, fields); - FunctionDescriptor descriptor = function(ret, paramTypes, fields); - Object[] args = makeArgs(paramTypes, fields, checks); - boolean needsScope = mt.returnType().equals(MemorySegment.class); - Object res = doCall(addr, IMPLICIT_ALLOCATOR, mt, descriptor, args); - if (ret == Ret.NON_VOID) { - checks.forEach(c -> c.accept(res)); - if (needsScope) { - // check that return struct has indeed been allocated in the default scope - try { - ((MemorySegment)res).scope().close(); // should throw - fail("Expected exception!"); - } catch (UnsupportedOperationException ex) { - // ok - } - } - } - } - - Object doCall(MemoryAddress addr, SegmentAllocator allocator, MethodType type, FunctionDescriptor descriptor, Object[] args) throws Throwable { - MethodHandle mh = abi.downcallHandle(addr, allocator, type, descriptor); + Object doCall(NativeSymbol symbol, SegmentAllocator allocator, FunctionDescriptor descriptor, Object[] args) throws Throwable { + MethodHandle mh = downcallHandle(abi, symbol, allocator, descriptor); Object res = mh.invokeWithArguments(args); return res; } static MethodType methodType(Ret ret, List params, List fields) { MethodType mt = ret == Ret.VOID ? - MethodType.methodType(void.class) : MethodType.methodType(paramCarrier(params.get(0).layout(fields))); + MethodType.methodType(void.class) : MethodType.methodType(carrier(params.get(0).layout(fields), false)); for (ParamType p : params) { - mt = mt.appendParameterTypes(paramCarrier(p.layout(fields))); + mt = mt.appendParameterTypes(carrier(p.layout(fields), true)); } return mt; } diff --git a/test/jdk/java/foreign/TestFree.java b/test/jdk/java/foreign/TestFree.java index ad26e1eb571..b009cee0ac4 100644 --- a/test/jdk/java/foreign/TestFree.java +++ b/test/jdk/java/foreign/TestFree.java @@ -29,18 +29,16 @@ * @run testng/othervm --enable-native-access=ALL-UNNAMED TestFree */ -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; -import static jdk.incubator.foreign.CLinker.*; import static org.testng.Assert.assertEquals; -public class TestFree { +public class TestFree extends NativeTestHelper { private static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements) { - return addr.asSegment(numElements * layout.byteSize(), ResourceScope.globalScope()); + return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), ResourceScope.globalScope()); } public void test() throws Throwable { @@ -48,8 +46,8 @@ public class TestFree { MemoryAddress addr = allocateMemory(str.length() + 1); MemorySegment seg = asArray(addr, C_CHAR, str.length() + 1); seg.copyFrom(MemorySegment.ofArray(str.getBytes())); - MemoryAccess.setByteAtOffset(seg, str.length(), (byte)0); - assertEquals(str, toJavaString(seg)); + seg.set(C_CHAR, str.length(), (byte)0); + assertEquals(str, seg.getUtf8String(0)); freeMemory(addr); } } diff --git a/test/jdk/java/foreign/TestFunctionDescriptor.java b/test/jdk/java/foreign/TestFunctionDescriptor.java index d8b82254daf..e67c5b9a3fa 100644 --- a/test/jdk/java/foreign/TestFunctionDescriptor.java +++ b/test/jdk/java/foreign/TestFunctionDescriptor.java @@ -25,7 +25,7 @@ /* * @test * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" - * @run testng TestFunctionDescriptor + * @run testng/othervm --enable-native-access=ALL-UNNAMED TestFunctionDescriptor */ import jdk.incubator.foreign.FunctionDescriptor; @@ -37,15 +37,11 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import static jdk.incubator.foreign.CLinker.C_DOUBLE; -import static jdk.incubator.foreign.CLinker.C_INT; -import static jdk.incubator.foreign.CLinker.C_LONG_LONG; -import static jdk.incubator.foreign.CLinker.C_POINTER; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; -public class TestFunctionDescriptor { +public class TestFunctionDescriptor extends NativeTestHelper { static final String DUMMY_ATTR = "dummy"; @@ -68,56 +64,35 @@ public class TestFunctionDescriptor { assertFalse(returnLayoutOp.isPresent()); } - @Test - public void testAttribute() { - FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); - fd = fd.withAttribute(DUMMY_ATTR, true); - - assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG)); - Optional returnLayoutOp = fd.returnLayout(); - assertTrue(returnLayoutOp.isPresent()); - assertEquals(returnLayoutOp.get(), C_INT); - assertEquals(fd.attributes().collect(Collectors.toList()), List.of(DUMMY_ATTR)); - Optional attr = fd.attribute(DUMMY_ATTR); - assertTrue(attr.isPresent()); - assertEquals(attr.get(), true); - } - @Test public void testAppendArgumentLayouts() { - FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG) - .withAttribute(DUMMY_ATTR, true); + FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); fd = fd.withAppendedArgumentLayouts(C_POINTER); assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG, C_POINTER)); Optional returnLayoutOp = fd.returnLayout(); assertTrue(returnLayoutOp.isPresent()); assertEquals(returnLayoutOp.get(), C_INT); - assertEquals(fd.attributes().collect(Collectors.toList()), List.of(DUMMY_ATTR)); } @Test public void testChangeReturnLayout() { - FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG) - .withAttribute(DUMMY_ATTR, true); + FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); fd = fd.withReturnLayout(C_INT); assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG)); Optional returnLayoutOp = fd.returnLayout(); assertTrue(returnLayoutOp.isPresent()); assertEquals(returnLayoutOp.get(), C_INT); - assertEquals(fd.attributes().collect(Collectors.toList()), List.of(DUMMY_ATTR)); } @Test public void testDropReturnLayout() { - FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG) - .withAttribute(DUMMY_ATTR, true); + FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); fd = fd.withVoidReturnLayout(); assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG)); Optional returnLayoutOp = fd.returnLayout(); assertFalse(returnLayoutOp.isPresent()); - assertEquals(fd.attributes().collect(Collectors.toList()), List.of(DUMMY_ATTR)); } } diff --git a/test/jdk/java/foreign/TestHandshake.java b/test/jdk/java/foreign/TestHandshake.java index ee9b7394594..94fdd8cbf18 100644 --- a/test/jdk/java/foreign/TestHandshake.java +++ b/test/jdk/java/foreign/TestHandshake.java @@ -31,7 +31,6 @@ * @run testng/othervm -XX:-TieredCompilation TestHandshake */ -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemorySegment; import java.lang.invoke.MethodHandles; @@ -48,6 +47,8 @@ import java.util.concurrent.atomic.AtomicLong; import jdk.incubator.foreign.ResourceScope; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; + +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static org.testng.Assert.*; public class TestHandshake { @@ -150,7 +151,7 @@ public class TestHandshake { void doAccess() { int sum = 0; for (int i = 0; i < segment.byteSize(); i++) { - sum += MemoryAccess.getByteAtOffset(segment, i); + sum += segment.get(JAVA_BYTE, i); } } } @@ -193,7 +194,7 @@ public class TestHandshake { super(id, segment); this.copy = MemorySegment.allocateNative(SEGMENT_SIZE, 1, segment.scope()); copy.copyFrom(segment); - MemoryAccess.setByteAtOffset(copy, ThreadLocalRandom.current().nextInt(SEGMENT_SIZE), (byte)42); + copy.set(JAVA_BYTE, ThreadLocalRandom.current().nextInt(SEGMENT_SIZE), (byte)42); } @Override diff --git a/test/jdk/java/foreign/TestIllegalLink.java b/test/jdk/java/foreign/TestIllegalLink.java index f63019bc4ff..7afa01689bc 100644 --- a/test/jdk/java/foreign/TestIllegalLink.java +++ b/test/jdk/java/foreign/TestIllegalLink.java @@ -32,26 +32,23 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; -import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import java.lang.invoke.MethodType; - -import static jdk.incubator.foreign.CLinker.C_INT; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; -public class TestIllegalLink { +public class TestIllegalLink extends NativeTestHelper { - private static final MemoryAddress DUMMY_TARGET = MemoryAddress.ofLong(1); - private static final CLinker ABI = CLinker.getInstance(); + private static final NativeSymbol DUMMY_TARGET = NativeSymbol.ofAddress("dummy", MemoryAddress.ofLong(1), ResourceScope.globalScope()); + private static final CLinker ABI = CLinker.systemCLinker(); @Test(dataProvider = "types") - public void testTypeMismatch(MethodType mt, FunctionDescriptor desc, String expectedExceptionMessage) { + public void testTypeMismatch(FunctionDescriptor desc, String expectedExceptionMessage) { try { - ABI.downcallHandle(DUMMY_TARGET, mt, desc); + ABI.downcallHandle(DUMMY_TARGET, desc); fail("Expected IllegalArgumentException was not thrown"); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains(expectedExceptionMessage)); @@ -62,49 +59,20 @@ public class TestIllegalLink { public static Object[][] types() { return new Object[][]{ { - MethodType.methodType(void.class), - FunctionDescriptor.of(C_INT), - "Return type mismatch" - }, - { - MethodType.methodType(void.class), - FunctionDescriptor.ofVoid(C_INT), - "Arity mismatch" + FunctionDescriptor.of(MemoryLayout.paddingLayout(64)), + "Unsupported layout: x64" }, { - MethodType.methodType(void.class, int.class), - FunctionDescriptor.ofVoid(MemoryLayout.paddingLayout(32)), - "Expected a ValueLayout" - }, - { - MethodType.methodType(void.class, boolean.class), - FunctionDescriptor.ofVoid(MemoryLayouts.BITS_8_LE), - "Unsupported carrier" - }, - { - MethodType.methodType(void.class, int.class), - FunctionDescriptor.ofVoid(MemoryLayouts.BITS_64_LE), - "Carrier size mismatch" - }, - { - MethodType.methodType(void.class, MemoryAddress.class), FunctionDescriptor.ofVoid(MemoryLayout.paddingLayout(64)), - "Expected a ValueLayout" - }, - { - MethodType.methodType(void.class, MemoryAddress.class), - FunctionDescriptor.ofVoid(MemoryLayouts.BITS_16_LE), - "Address size mismatch" + "Unsupported layout: x64" }, { - MethodType.methodType(void.class, MemorySegment.class), - FunctionDescriptor.ofVoid(MemoryLayouts.BITS_64_LE), - "Expected a GroupLayout" + FunctionDescriptor.of(MemoryLayout.sequenceLayout(C_INT)), + "Unsupported layout: [:b32]" }, { - MethodType.methodType(void.class, String.class), - FunctionDescriptor.ofVoid(MemoryLayouts.BITS_64_LE), - "Unsupported carrier" + FunctionDescriptor.ofVoid(MemoryLayout.sequenceLayout(C_INT)), + "Unsupported layout: [:b32]" }, }; } diff --git a/test/jdk/java/foreign/TestIntrinsics.java b/test/jdk/java/foreign/TestIntrinsics.java index 98e6829e4b2..dfafdfc3a21 100644 --- a/test/jdk/java/foreign/TestIntrinsics.java +++ b/test/jdk/java/foreign/TestIntrinsics.java @@ -42,17 +42,17 @@ import java.util.List; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; import org.testng.annotations.*; import static java.lang.invoke.MethodType.methodType; -import static jdk.incubator.foreign.CLinker.*; -import static jdk.incubator.foreign.FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; import static org.testng.Assert.assertEquals; -public class TestIntrinsics { +public class TestIntrinsics extends NativeTestHelper { - static final CLinker abi = CLinker.getInstance(); + static final CLinker abi = CLinker.systemCLinker(); static { System.loadLibrary("Intrinsics"); } @@ -88,52 +88,48 @@ public class TestIntrinsics { } AddIdentity addIdentity = (name, carrier, layout, arg) -> { - MemoryAddress ma = LOOKUP.lookup(name).get(); + NativeSymbol ma = LOOKUP.lookup(name).get(); MethodType mt = methodType(carrier, carrier); FunctionDescriptor fd = FunctionDescriptor.of(layout, layout); - tests.add(abi.downcallHandle(ma, mt, fd), arg, arg); - tests.add(abi.downcallHandle(ma, mt, fd.withAttribute(TRIVIAL_ATTRIBUTE_NAME, true)), arg, arg); - tests.add(abi.downcallHandle(mt, fd), arg, ma, arg); + tests.add(abi.downcallHandle(ma, fd), arg, arg); + tests.add(abi.downcallHandle(fd), arg, ma, arg); }; { // empty - MemoryAddress ma = LOOKUP.lookup("empty").get(); + NativeSymbol ma = LOOKUP.lookup("empty").get(); MethodType mt = methodType(void.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(); - tests.add(abi.downcallHandle(ma, mt, fd), null); - tests.add(abi.downcallHandle(ma, mt, fd.withAttribute(TRIVIAL_ATTRIBUTE_NAME, true)), null); + tests.add(abi.downcallHandle(ma, fd), null); } - addIdentity.add("identity_char", byte.class, C_CHAR, (byte) 10); - addIdentity.add("identity_short", short.class, C_SHORT, (short) 10); - addIdentity.add("identity_int", int.class, C_INT, 10); - addIdentity.add("identity_long", long.class, C_LONG_LONG, 10L); - addIdentity.add("identity_float", float.class, C_FLOAT, 10F); - addIdentity.add("identity_double", double.class, C_DOUBLE, 10D); + addIdentity.add("identity_bool", boolean.class, C_BOOL, true); + addIdentity.add("identity_char", byte.class, C_CHAR, (byte) 10); + addIdentity.add("identity_short", short.class, C_SHORT, (short) 10); + addIdentity.add("identity_int", int.class, C_INT, 10); + addIdentity.add("identity_long", long.class, C_LONG_LONG, 10L); + addIdentity.add("identity_float", float.class, C_FLOAT, 10F); + addIdentity.add("identity_double", double.class, C_DOUBLE, 10D); { // identity_va - MemoryAddress ma = LOOKUP.lookup("identity_va").get(); + NativeSymbol ma = LOOKUP.lookup("identity_va").get(); MethodType mt = methodType(int.class, int.class, double.class, int.class, float.class, long.class); - FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_INT, asVarArg(C_DOUBLE), - asVarArg(C_INT), asVarArg(C_FLOAT), asVarArg(C_LONG_LONG)); - tests.add(abi.downcallHandle(ma, mt, fd), 1, 1, 10D, 2, 3F, 4L); - tests.add(abi.downcallHandle(ma, mt, fd.withAttribute(TRIVIAL_ATTRIBUTE_NAME, true)), 1, 1, 10D, 2, 3F, 4L); + FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_INT).asVariadic(C_DOUBLE, C_INT, C_FLOAT, C_LONG_LONG); + tests.add(abi.downcallHandle(ma, fd), 1, 1, 10D, 2, 3F, 4L); } { // high_arity MethodType baseMT = methodType(void.class, int.class, double.class, long.class, float.class, byte.class, short.class, char.class); FunctionDescriptor baseFD = FunctionDescriptor.ofVoid(C_INT, C_DOUBLE, C_LONG_LONG, C_FLOAT, C_CHAR, - C_SHORT, C_SHORT); + C_SHORT, JAVA_CHAR); Object[] args = {1, 10D, 2L, 3F, (byte) 0, (short) 13, 'a'}; for (int i = 0; i < args.length; i++) { - MemoryAddress ma = LOOKUP.lookup("invoke_high_arity" + i).get(); + NativeSymbol ma = LOOKUP.lookup("invoke_high_arity" + i).get(); MethodType mt = baseMT.changeReturnType(baseMT.parameterType(i)); FunctionDescriptor fd = baseFD.withReturnLayout(baseFD.argumentLayouts().get(i)); Object expected = args[i]; - tests.add(abi.downcallHandle(ma, mt, fd), expected, args); - tests.add(abi.downcallHandle(ma, mt, fd.withAttribute(TRIVIAL_ATTRIBUTE_NAME, true)), expected, args); + tests.add(abi.downcallHandle(ma, fd), expected, args); } } diff --git a/test/jdk/java/foreign/TestLayoutAttributes.java b/test/jdk/java/foreign/TestLayoutAttributes.java deleted file mode 100644 index 9def5a3b823..00000000000 --- a/test/jdk/java/foreign/TestLayoutAttributes.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2020, 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 - * @run testng TestLayoutAttributes - */ - -import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; -import org.testng.annotations.Test; - -import java.util.List; -import java.util.stream.Collectors; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -public class TestLayoutAttributes { - - @Test - public void testAttribute() { - MemoryLayout ml = MemoryLayouts.BITS_32_LE - .withAttribute("MyAttribute", 10L); - assertEquals((long) ml.attribute("MyAttribute").orElseThrow(), 10L); - } - - @Test - public void testAttributeOverwrite() { - MemoryLayout ml = MemoryLayouts.BITS_32_LE - .withAttribute("MyAttribute", 10L); - assertEquals((long) ml.attribute("MyAttribute").orElseThrow(), 10L); - ml = ml.withAttribute("MyAttribute", 11L); - assertEquals((long) ml.attribute("MyAttribute").orElseThrow(), 11L); - } - - @Test - public void testAttributeNonExistent() { - MemoryLayout ml = MemoryLayouts.BITS_32_LE - .withAttribute("MyAttribute", 10L); - assertTrue(ml.attribute("Foo").isEmpty()); - } - - @Test - public void testNameAttribute() { - MemoryLayout ml = MemoryLayouts.BITS_32_LE - .withName("foo"); - assertEquals(ml.name().orElseThrow(), "foo"); - assertEquals(ml.attribute(MemoryLayout.LAYOUT_NAME).orElseThrow(), "foo"); - } - - @Test - public void testAttributesStream() { - MemoryLayout ml = MemoryLayouts.BITS_32_LE - .withName("foo") - .withAttribute("MyAttribute", 10L); - List attribs = ml.attributes().collect(Collectors.toList()); - assertEquals(attribs.size(), 2); - assertTrue(attribs.contains("MyAttribute")); - assertTrue(attribs.contains(MemoryLayout.LAYOUT_NAME)); - } -} diff --git a/test/jdk/java/foreign/TestLayoutConstants.java b/test/jdk/java/foreign/TestLayoutConstants.java index 2ea29679234..59d26ca2700 100644 --- a/test/jdk/java/foreign/TestLayoutConstants.java +++ b/test/jdk/java/foreign/TestLayoutConstants.java @@ -27,11 +27,12 @@ */ import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemoryLayout; import java.lang.invoke.MethodHandles; +import java.nio.ByteOrder; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; import static org.testng.Assert.*; @@ -66,49 +67,48 @@ public class TestLayoutConstants { public Object[][] createLayouts() { return new Object[][] { //padding - { MemoryLayouts.PAD_32 }, - { MemoryLayout.sequenceLayout(MemoryLayouts.PAD_32) }, - { MemoryLayout.sequenceLayout(5, MemoryLayouts.PAD_32) }, - { MemoryLayout.structLayout(MemoryLayouts.PAD_32, MemoryLayouts.PAD_32) }, - { MemoryLayout.unionLayout(MemoryLayouts.PAD_32, MemoryLayouts.PAD_32) }, + {MemoryLayout.paddingLayout(32)}, + { MemoryLayout.sequenceLayout(MemoryLayout.paddingLayout(32)) }, + { MemoryLayout.sequenceLayout(5, MemoryLayout.paddingLayout(32)) }, + { MemoryLayout.structLayout(MemoryLayout.paddingLayout(32), MemoryLayout.paddingLayout(32)) }, + { MemoryLayout.unionLayout(MemoryLayout.paddingLayout(32), MemoryLayout.paddingLayout(32)) }, //values, big endian - { MemoryLayouts.BITS_32_BE }, + { ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN) }, { MemoryLayout.structLayout( - MemoryLayouts.BITS_32_BE, - MemoryLayouts.BITS_32_BE) }, + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)) }, { MemoryLayout.unionLayout( - MemoryLayouts.BITS_32_BE, - MemoryLayouts.BITS_32_BE) }, + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)) }, //values, little endian - { MemoryLayouts.BITS_32_LE }, + { ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN) }, { MemoryLayout.structLayout( - MemoryLayouts.BITS_32_LE, - MemoryLayouts.BITS_32_LE) }, + ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), + ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN)) }, { MemoryLayout.unionLayout( - MemoryLayouts.BITS_32_LE, - MemoryLayouts.BITS_32_LE) }, + ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), + ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN)) }, //deeply nested { MemoryLayout.structLayout( - MemoryLayouts.PAD_16, + MemoryLayout.paddingLayout(16), MemoryLayout.structLayout( - MemoryLayouts.PAD_8, - MemoryLayouts.BITS_32_BE)) }, + MemoryLayout.paddingLayout(8), + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN))) }, { MemoryLayout.unionLayout( - MemoryLayouts.PAD_16, + MemoryLayout.paddingLayout(16), MemoryLayout.structLayout( - MemoryLayouts.PAD_8, - MemoryLayouts.BITS_32_BE)) }, + MemoryLayout.paddingLayout(8), + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN))) }, { MemoryLayout.sequenceLayout( MemoryLayout.structLayout( - MemoryLayouts.PAD_8, - MemoryLayouts.BITS_32_BE)) }, + MemoryLayout.paddingLayout(8), + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN))) }, { MemoryLayout.sequenceLayout(5, MemoryLayout.structLayout( - MemoryLayouts.PAD_8, - MemoryLayouts.BITS_32_BE)) }, - { MemoryLayouts.BITS_32_LE.withName("myInt") }, - { MemoryLayouts.BITS_32_LE.withBitAlignment(8) }, - { MemoryLayouts.BITS_32_LE.withAttribute("xyz", "abc") }, + MemoryLayout.paddingLayout(8), + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN))) }, + { ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN).withName("myInt") }, + { ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN).withBitAlignment(8) }, }; } diff --git a/test/jdk/java/foreign/TestLayoutEquality.java b/test/jdk/java/foreign/TestLayoutEquality.java index 8eb59ec340e..7a4d3124f0b 100644 --- a/test/jdk/java/foreign/TestLayoutEquality.java +++ b/test/jdk/java/foreign/TestLayoutEquality.java @@ -29,7 +29,7 @@ * @run testng TestLayoutEquality */ -import jdk.incubator.foreign.MemoryLayout; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.ValueLayout; import jdk.internal.foreign.PlatformLayouts; import org.testng.annotations.DataProvider; @@ -39,23 +39,32 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +import static jdk.incubator.foreign.ValueLayout.ADDRESS; +import static jdk.incubator.foreign.ValueLayout.JAVA_BOOLEAN; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; import static org.testng.Assert.*; public class TestLayoutEquality { @Test(dataProvider = "layoutConstants") public void testReconstructedEquality(ValueLayout layout) { - ValueLayout newLayout = MemoryLayout.valueLayout(layout.bitSize(), layout.order()); + ValueLayout newLayout = valueLayoutForCarrier(layout.carrier()); + newLayout = newLayout.withBitAlignment(layout.bitAlignment()); + newLayout = newLayout.withOrder(layout.order()); // properties should be equal assertEquals(newLayout.bitSize(), layout.bitSize()); assertEquals(newLayout.bitAlignment(), layout.bitAlignment()); assertEquals(newLayout.name(), layout.name()); - assertEquals(newLayout.attributes().toArray().length, 0); - assertEquals(layout.attributes().toArray().length, 1); - // but equals should return false, because one is a ValueLayout with a CLinker kind - assertNotEquals(newLayout, layout); + // layouts should be equals + assertEquals(newLayout, layout); } @DataProvider @@ -76,4 +85,27 @@ public class TestLayoutEquality { } } + static ValueLayout valueLayoutForCarrier(Class carrier) { + if (carrier == boolean.class) { + return JAVA_BOOLEAN; + } else if (carrier == char.class) { + return JAVA_CHAR; + } else if (carrier == byte.class) { + return JAVA_BYTE; + } else if (carrier == short.class) { + return JAVA_SHORT; + } else if (carrier == int.class) { + return JAVA_INT; + } else if (carrier == long.class) { + return JAVA_LONG; + } else if (carrier == float.class) { + return JAVA_FLOAT; + } else if (carrier == double.class) { + return JAVA_DOUBLE; + } else if (carrier == MemoryAddress.class) { + return ADDRESS; + } else { + throw new UnsupportedOperationException(); + } + } } diff --git a/test/jdk/java/foreign/TestLayoutPaths.java b/test/jdk/java/foreign/TestLayoutPaths.java index 1cf3798c249..438dc86ada6 100644 --- a/test/jdk/java/foreign/TestLayoutPaths.java +++ b/test/jdk/java/foreign/TestLayoutPaths.java @@ -28,24 +28,23 @@ */ import jdk.incubator.foreign.GroupLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemoryLayout.PathElement; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SequenceLayout; +import jdk.incubator.foreign.ValueLayout; import org.testng.SkipException; import org.testng.annotations.*; import java.lang.invoke.MethodHandle; -import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import static jdk.incubator.foreign.MemoryLayout.PathElement.groupElement; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; import static org.testng.Assert.*; public class TestLayoutPaths { @@ -153,7 +152,7 @@ public class TestLayoutPaths { @Test(expectedExceptions = IllegalArgumentException.class) public void testIncompleteAccess() { SequenceLayout seq = MemoryLayout.sequenceLayout(5, MemoryLayout.structLayout(JAVA_INT)); - seq.varHandle(int.class, sequenceElement()); + seq.varHandle(sequenceElement()); } @Test(expectedExceptions = IllegalArgumentException.class) @@ -221,7 +220,7 @@ public class TestLayoutPaths { throw new AssertionError(ex); // should be ok! } try { - g.varHandle(int.class, groupElement("foo")); //ok + g.varHandle(groupElement("foo")); //ok assertTrue(false); //should fail! } catch (UnsupportedOperationException ex) { //ok @@ -232,7 +231,7 @@ public class TestLayoutPaths { @Test public void testBadAlignOffset() { - GroupLayout g = MemoryLayout.structLayout(MemoryLayouts.PAD_8, JAVA_INT.withBitAlignment(16).withName("foo")); + GroupLayout g = MemoryLayout.structLayout(MemoryLayout.paddingLayout(8), JAVA_INT.withBitAlignment(16).withName("foo")); try { g.bitOffset(groupElement("foo")); g.byteOffset(groupElement("foo")); @@ -240,7 +239,7 @@ public class TestLayoutPaths { throw new AssertionError(ex); // should be ok! } try { - g.varHandle(int.class, groupElement("foo")); //ok + g.varHandle(groupElement("foo")); //ok assertTrue(false); //should fail! } catch (UnsupportedOperationException ex) { //ok @@ -299,10 +298,10 @@ public class TestLayoutPaths { public void testStructPaths() { long[] offsets = { 0, 8, 24, 56 }; GroupLayout g = MemoryLayout.structLayout( - MemoryLayouts.JAVA_BYTE.withName("1"), - MemoryLayouts.JAVA_CHAR.withName("2"), - MemoryLayouts.JAVA_FLOAT.withName("3"), - MemoryLayouts.JAVA_LONG.withName("4") + ValueLayout.JAVA_BYTE.withName("1"), + ValueLayout.JAVA_CHAR.withName("2"), + ValueLayout.JAVA_FLOAT.withName("3"), + ValueLayout.JAVA_LONG.withName("4") ); // test select @@ -324,11 +323,11 @@ public class TestLayoutPaths { // test map for (int i = 1 ; i <= 4 ; i++) { - GroupLayout g2 = (GroupLayout)g.map(l -> MemoryLayouts.JAVA_DOUBLE, groupElement(String.valueOf(i))); + GroupLayout g2 = (GroupLayout)g.map(l -> ValueLayout.JAVA_DOUBLE, groupElement(String.valueOf(i))); assertTrue(g2.isStruct()); for (int j = 0 ; j < 4 ; j++) { if (j == i - 1) { - assertEquals(g2.memberLayouts().get(j), MemoryLayouts.JAVA_DOUBLE); + assertEquals(g2.memberLayouts().get(j), ValueLayout.JAVA_DOUBLE); } else { assertEquals(g2.memberLayouts().get(j), g.memberLayouts().get(j)); } @@ -340,10 +339,10 @@ public class TestLayoutPaths { public void testUnionPaths() { long[] offsets = { 0, 0, 0, 0 }; GroupLayout g = MemoryLayout.unionLayout( - MemoryLayouts.JAVA_BYTE.withName("1"), - MemoryLayouts.JAVA_CHAR.withName("2"), - MemoryLayouts.JAVA_FLOAT.withName("3"), - MemoryLayouts.JAVA_LONG.withName("4") + ValueLayout.JAVA_BYTE.withName("1"), + ValueLayout.JAVA_CHAR.withName("2"), + ValueLayout.JAVA_FLOAT.withName("3"), + ValueLayout.JAVA_LONG.withName("4") ); // test select @@ -365,11 +364,11 @@ public class TestLayoutPaths { // test map for (int i = 1 ; i <= 4 ; i++) { - GroupLayout g2 = (GroupLayout)g.map(l -> MemoryLayouts.JAVA_DOUBLE, groupElement(String.valueOf(i))); + GroupLayout g2 = (GroupLayout)g.map(l -> ValueLayout.JAVA_DOUBLE, groupElement(String.valueOf(i))); assertTrue(g2.isUnion()); for (int j = 0 ; j < 4 ; j++) { if (j == i - 1) { - assertEquals(g2.memberLayouts().get(j), MemoryLayouts.JAVA_DOUBLE); + assertEquals(g2.memberLayouts().get(j), ValueLayout.JAVA_DOUBLE); } else { assertEquals(g2.memberLayouts().get(j), g.memberLayouts().get(j)); } @@ -380,12 +379,12 @@ public class TestLayoutPaths { @Test public void testSequencePaths() { long[] offsets = { 0, 8, 16, 24 }; - SequenceLayout g = MemoryLayout.sequenceLayout(4, MemoryLayouts.JAVA_BYTE); + SequenceLayout g = MemoryLayout.sequenceLayout(4, ValueLayout.JAVA_BYTE); // test select MemoryLayout selected = g.select(sequenceElement()); - assertTrue(selected == MemoryLayouts.JAVA_BYTE); + assertTrue(selected == ValueLayout.JAVA_BYTE); // test offset @@ -398,8 +397,8 @@ public class TestLayoutPaths { // test map - SequenceLayout seq2 = (SequenceLayout)g.map(l -> MemoryLayouts.JAVA_DOUBLE, sequenceElement()); - assertTrue(seq2.elementLayout() == MemoryLayouts.JAVA_DOUBLE); + SequenceLayout seq2 = (SequenceLayout)g.map(l -> ValueLayout.JAVA_DOUBLE, sequenceElement()); + assertTrue(seq2.elementLayout() == ValueLayout.JAVA_DOUBLE); } @Test(dataProvider = "testLayouts") @@ -506,26 +505,16 @@ public class TestLayoutPaths { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(layout, scope); MemorySegment slice = (MemorySegment) sliceHandle.invokeExact(segment, indexes); - assertEquals(slice.address().segmentOffset(segment), expectedBitOffset / 8); + assertEquals(slice.address().toRawLongValue() - segment.address().toRawLongValue(), expectedBitOffset / 8); assertEquals(slice.byteSize(), selected.byteSize()); } } - @Test(expectedExceptions = UnsupportedOperationException.class) - public void testSliceHandleUOEInvalidSize() { - MemoryLayout layout = MemoryLayout.structLayout( - MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()).withName("x"), - MemoryLayout.valueLayout(31, ByteOrder.nativeOrder()).withName("y") // size not a multiple of 8 - ); - - layout.sliceHandle(groupElement("y")); // should throw - } - @Test(expectedExceptions = UnsupportedOperationException.class) public void testSliceHandleUOEInvalidOffsetEager() throws Throwable { MemoryLayout layout = MemoryLayout.structLayout( MemoryLayout.paddingLayout(5), - MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()).withName("y") // offset not a multiple of 8 + JAVA_INT.withName("y") // offset not a multiple of 8 ); layout.sliceHandle(groupElement("y")); // should throw @@ -536,7 +525,7 @@ public class TestLayoutPaths { MemoryLayout layout = MemoryLayout.sequenceLayout(3, MemoryLayout.structLayout( MemoryLayout.paddingLayout(4), - MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()).withName("y") // offset not a multiple of 8 + JAVA_INT.withName("y") // offset not a multiple of 8 ) ); diff --git a/test/jdk/java/foreign/TestLayouts.java b/test/jdk/java/foreign/TestLayouts.java index 006163d3d50..6d54bef722d 100644 --- a/test/jdk/java/foreign/TestLayouts.java +++ b/test/jdk/java/foreign/TestLayouts.java @@ -34,15 +34,15 @@ import java.util.function.LongFunction; import java.util.stream.Stream; import org.testng.annotations.*; + +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; import static org.testng.Assert.*; public class TestLayouts { - @Test(dataProvider = "badLayoutSizes", expectedExceptions = IllegalArgumentException.class) - public void testBadLayoutSize(SizedLayoutFactory factory, long size) { - factory.make(size); - } - @Test(dataProvider = "badAlignments", expectedExceptions = IllegalArgumentException.class) public void testBadLayoutAlignment(MemoryLayout layout, long alignment) { layout.withBitAlignment(alignment); @@ -51,12 +51,12 @@ public class TestLayouts { @Test public void testVLAInStruct() { MemoryLayout layout = MemoryLayout.structLayout( - MemoryLayouts.JAVA_INT.withName("size"), + ValueLayout.JAVA_INT.withName("size"), MemoryLayout.paddingLayout(32), - MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_DOUBLE).withName("arr")); + MemoryLayout.sequenceLayout(ValueLayout.JAVA_DOUBLE).withName("arr")); assertFalse(layout.hasSize()); - VarHandle size_handle = layout.varHandle(int.class, MemoryLayout.PathElement.groupElement("size")); - VarHandle array_elem_handle = layout.varHandle(double.class, + VarHandle size_handle = layout.varHandle(MemoryLayout.PathElement.groupElement("size")); + VarHandle array_elem_handle = layout.varHandle( MemoryLayout.PathElement.groupElement("arr"), MemoryLayout.PathElement.sequenceElement()); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -77,12 +77,12 @@ public class TestLayouts { @Test public void testVLAInSequence() { MemoryLayout layout = MemoryLayout.structLayout( - MemoryLayouts.JAVA_INT.withName("size"), + ValueLayout.JAVA_INT.withName("size"), MemoryLayout.paddingLayout(32), - MemoryLayout.sequenceLayout(1, MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_DOUBLE)).withName("arr")); + MemoryLayout.sequenceLayout(1, MemoryLayout.sequenceLayout(ValueLayout.JAVA_DOUBLE)).withName("arr")); assertFalse(layout.hasSize()); - VarHandle size_handle = layout.varHandle(int.class, MemoryLayout.PathElement.groupElement("size")); - VarHandle array_elem_handle = layout.varHandle(double.class, + VarHandle size_handle = layout.varHandle(MemoryLayout.PathElement.groupElement("size")); + VarHandle array_elem_handle = layout.varHandle( MemoryLayout.PathElement.groupElement("arr"), MemoryLayout.PathElement.sequenceElement(0), MemoryLayout.PathElement.sequenceElement()); @@ -103,17 +103,17 @@ public class TestLayouts { @Test public void testIndexedSequencePath() { - MemoryLayout seq = MemoryLayout.sequenceLayout(10, MemoryLayouts.JAVA_INT); + MemoryLayout seq = MemoryLayout.sequenceLayout(10, ValueLayout.JAVA_INT); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(seq, scope); - VarHandle indexHandle = seq.varHandle(int.class, MemoryLayout.PathElement.sequenceElement()); + VarHandle indexHandle = seq.varHandle(MemoryLayout.PathElement.sequenceElement()); // init segment for (int i = 0 ; i < 10 ; i++) { indexHandle.set(segment, (long)i, i); } //check statically indexed handles for (int i = 0 ; i < 10 ; i++) { - VarHandle preindexHandle = seq.varHandle(int.class, MemoryLayout.PathElement.sequenceElement(i)); + VarHandle preindexHandle = seq.varHandle(MemoryLayout.PathElement.sequenceElement(i)); int expected = (int)indexHandle.get(segment, (long)i); int found = (int)preindexHandle.get(segment); assertEquals(expected, found); @@ -143,13 +143,13 @@ public class TestLayouts { @Test(expectedExceptions = IllegalArgumentException.class) public void testBadUnboundSequenceLayoutResize() { - SequenceLayout seq = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT); seq.withElementCount(-1); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadBoundSequenceLayoutResize() { - SequenceLayout seq = MemoryLayout.sequenceLayout(10, MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(10, ValueLayout.JAVA_INT); seq.withElementCount(-1); } @@ -168,13 +168,13 @@ public class TestLayouts { public void testStructSizeAndAlign() { MemoryLayout struct = MemoryLayout.structLayout( MemoryLayout.paddingLayout(8), - MemoryLayouts.JAVA_BYTE, - MemoryLayouts.JAVA_CHAR, - MemoryLayouts.JAVA_INT, - MemoryLayouts.JAVA_LONG + ValueLayout.JAVA_BYTE, + ValueLayout.JAVA_CHAR, + ValueLayout.JAVA_INT, + ValueLayout.JAVA_LONG ); assertEquals(struct.byteSize(), 1 + 1 + 2 + 4 + 8); - assertEquals(struct.byteAlignment(), MemoryLayouts.ADDRESS.byteAlignment()); + assertEquals(struct.byteAlignment(), ValueLayout.ADDRESS.byteAlignment()); } @Test(dataProvider="basicLayouts") @@ -199,13 +199,13 @@ public class TestLayouts { @Test public void testUnionSizeAndAlign() { MemoryLayout struct = MemoryLayout.unionLayout( - MemoryLayouts.JAVA_BYTE, - MemoryLayouts.JAVA_CHAR, - MemoryLayouts.JAVA_INT, - MemoryLayouts.JAVA_LONG + ValueLayout.JAVA_BYTE, + ValueLayout.JAVA_CHAR, + ValueLayout.JAVA_INT, + ValueLayout.JAVA_LONG ); assertEquals(struct.byteSize(), 8); - assertEquals(struct.byteAlignment(), MemoryLayouts.ADDRESS.byteAlignment()); + assertEquals(struct.byteAlignment(), ValueLayout.ADDRESS.byteAlignment()); } @Test(dataProvider = "layoutKinds") @@ -224,31 +224,19 @@ public class TestLayouts { } } - @DataProvider(name = "badLayoutSizes") - public Object[][] factoriesAndSizes() { - return new Object[][] { - { SizedLayoutFactory.VALUE_BE, 0 }, - { SizedLayoutFactory.VALUE_BE, -1 }, - { SizedLayoutFactory.VALUE_LE, 0 }, - { SizedLayoutFactory.VALUE_LE, -1 }, - { SizedLayoutFactory.PADDING, 0 }, - { SizedLayoutFactory.PADDING, -1 }, - { SizedLayoutFactory.SEQUENCE, -1 } - }; - } - @DataProvider(name = "unboundLayouts") public Object[][] unboundLayouts() { + ValueLayout alignedInt = JAVA_INT.withBitAlignment(32); return new Object[][] { - { MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT), 32 }, - { MemoryLayout.sequenceLayout(MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT)), 32 }, - { MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT)), 32 }, - { MemoryLayout.structLayout(MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT)), 32 }, - { MemoryLayout.structLayout(MemoryLayout.sequenceLayout(MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT))), 32 }, - { MemoryLayout.structLayout(MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT))), 32 }, - { MemoryLayout.unionLayout(MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT)), 32 }, - { MemoryLayout.unionLayout(MemoryLayout.sequenceLayout(MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT))), 32 }, - { MemoryLayout.unionLayout(MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT))), 32 }, + { MemoryLayout.sequenceLayout(alignedInt), 32 }, + { MemoryLayout.sequenceLayout(MemoryLayout.sequenceLayout(alignedInt)), 32 }, + { MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(alignedInt)), 32 }, + { MemoryLayout.structLayout(MemoryLayout.sequenceLayout(alignedInt)), 32 }, + { MemoryLayout.structLayout(MemoryLayout.sequenceLayout(MemoryLayout.sequenceLayout(alignedInt))), 32 }, + { MemoryLayout.structLayout(MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(alignedInt))), 32 }, + { MemoryLayout.unionLayout(MemoryLayout.sequenceLayout(alignedInt)), 32 }, + { MemoryLayout.unionLayout(MemoryLayout.sequenceLayout(MemoryLayout.sequenceLayout(alignedInt))), 32 }, + { MemoryLayout.unionLayout(MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(alignedInt))), 32 }, }; } @@ -271,10 +259,10 @@ public class TestLayouts { } enum SizedLayoutFactory { - VALUE_LE(size -> MemoryLayout.valueLayout(size, ByteOrder.LITTLE_ENDIAN)), - VALUE_BE(size -> MemoryLayout.valueLayout(size, ByteOrder.BIG_ENDIAN)), + VALUE_LE(size -> valueLayoutForSize((int)size).withOrder(ByteOrder.LITTLE_ENDIAN)), + VALUE_BE(size -> valueLayoutForSize((int)size).withOrder(ByteOrder.BIG_ENDIAN)), PADDING(MemoryLayout::paddingLayout), - SEQUENCE(size -> MemoryLayout.sequenceLayout(size, MemoryLayouts.PAD_8)); + SEQUENCE(size -> MemoryLayout.sequenceLayout(size, MemoryLayout.paddingLayout(8))); private final LongFunction factory; @@ -287,13 +275,22 @@ public class TestLayouts { } } + static ValueLayout valueLayoutForSize(int size) { + return switch (size) { + case 1 -> JAVA_BYTE; + case 2 -> JAVA_SHORT; + case 4 -> JAVA_INT; + case 8 -> JAVA_LONG; + default -> throw new UnsupportedOperationException(); + }; + } + enum LayoutKind { - VALUE_LE(MemoryLayouts.BITS_8_LE), - VALUE_BE(MemoryLayouts.BITS_8_BE), - PADDING(MemoryLayouts.PAD_8), - SEQUENCE(MemoryLayout.sequenceLayout(1, MemoryLayouts.PAD_8)), - STRUCT(MemoryLayout.structLayout(MemoryLayouts.PAD_8, MemoryLayouts.PAD_8)), - UNION(MemoryLayout.unionLayout(MemoryLayouts.PAD_8, MemoryLayouts.PAD_8)); + VALUE(ValueLayout.JAVA_BYTE), + PADDING(MemoryLayout.paddingLayout(8)), + SEQUENCE(MemoryLayout.sequenceLayout(1, MemoryLayout.paddingLayout(8))), + STRUCT(MemoryLayout.structLayout(MemoryLayout.paddingLayout(8), MemoryLayout.paddingLayout(8))), + UNION(MemoryLayout.unionLayout(MemoryLayout.paddingLayout(8), MemoryLayout.paddingLayout(8))); final MemoryLayout layout; @@ -333,12 +330,12 @@ public class TestLayouts { } static MemoryLayout[] basicLayouts = { - MemoryLayouts.JAVA_BYTE, - MemoryLayouts.JAVA_CHAR, - MemoryLayouts.JAVA_SHORT, - MemoryLayouts.JAVA_INT, - MemoryLayouts.JAVA_FLOAT, - MemoryLayouts.JAVA_LONG, - MemoryLayouts.JAVA_DOUBLE, + ValueLayout.JAVA_BYTE, + ValueLayout.JAVA_CHAR, + ValueLayout.JAVA_SHORT, + ValueLayout.JAVA_INT, + ValueLayout.JAVA_FLOAT, + ValueLayout.JAVA_LONG, + ValueLayout.JAVA_DOUBLE, }; } diff --git a/test/jdk/java/foreign/TestMemoryAccess.java b/test/jdk/java/foreign/TestMemoryAccess.java index d843c7b0b39..7eade5f8147 100644 --- a/test/jdk/java/foreign/TestMemoryAccess.java +++ b/test/jdk/java/foreign/TestMemoryAccess.java @@ -30,7 +30,7 @@ */ import jdk.incubator.foreign.GroupLayout; -import jdk.incubator.foreign.MemoryLayouts; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemoryLayout.PathElement; import jdk.incubator.foreign.MemorySegment; @@ -39,6 +39,7 @@ import jdk.incubator.foreign.SequenceLayout; import jdk.incubator.foreign.ValueLayout; import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; import java.util.function.Function; import org.testng.annotations.*; @@ -47,39 +48,39 @@ import static org.testng.Assert.*; public class TestMemoryAccess { @Test(dataProvider = "elements") - public void testAccess(Function viewFactory, ValueLayout elemLayout, Class carrier, Checker checker) { + public void testAccess(Function viewFactory, ValueLayout elemLayout, Checker checker) { ValueLayout layout = elemLayout.withName("elem"); - testAccessInternal(viewFactory, layout, layout.varHandle(carrier), checker); + testAccessInternal(viewFactory, layout, layout.varHandle(), checker); } @Test(dataProvider = "elements") - public void testPaddedAccessByName(Function viewFactory, MemoryLayout elemLayout, Class carrier, Checker checker) { + public void testPaddedAccessByName(Function viewFactory, MemoryLayout elemLayout, Checker checker) { GroupLayout layout = MemoryLayout.structLayout(MemoryLayout.paddingLayout(elemLayout.bitSize()), elemLayout.withName("elem")); - testAccessInternal(viewFactory, layout, layout.varHandle(carrier, PathElement.groupElement("elem")), checker); + testAccessInternal(viewFactory, layout, layout.varHandle(PathElement.groupElement("elem")), checker); } @Test(dataProvider = "elements") - public void testPaddedAccessByIndexSeq(Function viewFactory, MemoryLayout elemLayout, Class carrier, Checker checker) { + public void testPaddedAccessByIndexSeq(Function viewFactory, MemoryLayout elemLayout, Checker checker) { SequenceLayout layout = MemoryLayout.sequenceLayout(2, elemLayout); - testAccessInternal(viewFactory, layout, layout.varHandle(carrier, PathElement.sequenceElement(1)), checker); + testAccessInternal(viewFactory, layout, layout.varHandle(PathElement.sequenceElement(1)), checker); } @Test(dataProvider = "arrayElements") - public void testArrayAccess(Function viewFactory, MemoryLayout elemLayout, Class carrier, ArrayChecker checker) { + public void testArrayAccess(Function viewFactory, MemoryLayout elemLayout, ArrayChecker checker) { SequenceLayout seq = MemoryLayout.sequenceLayout(10, elemLayout.withName("elem")); - testArrayAccessInternal(viewFactory, seq, seq.varHandle(carrier, PathElement.sequenceElement()), checker); + testArrayAccessInternal(viewFactory, seq, seq.varHandle(PathElement.sequenceElement()), checker); } @Test(dataProvider = "arrayElements") - public void testPaddedArrayAccessByName(Function viewFactory, MemoryLayout elemLayout, Class carrier, ArrayChecker checker) { + public void testPaddedArrayAccessByName(Function viewFactory, MemoryLayout elemLayout, ArrayChecker checker) { SequenceLayout seq = MemoryLayout.sequenceLayout(10, MemoryLayout.structLayout(MemoryLayout.paddingLayout(elemLayout.bitSize()), elemLayout.withName("elem"))); - testArrayAccessInternal(viewFactory, seq, seq.varHandle(carrier, MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.groupElement("elem")), checker); + testArrayAccessInternal(viewFactory, seq, seq.varHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.groupElement("elem")), checker); } @Test(dataProvider = "arrayElements") - public void testPaddedArrayAccessByIndexSeq(Function viewFactory, MemoryLayout elemLayout, Class carrier, ArrayChecker checker) { + public void testPaddedArrayAccessByIndexSeq(Function viewFactory, MemoryLayout elemLayout, ArrayChecker checker) { SequenceLayout seq = MemoryLayout.sequenceLayout(10, MemoryLayout.sequenceLayout(2, elemLayout)); - testArrayAccessInternal(viewFactory, seq, seq.varHandle(carrier, PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement(1)), checker); + testArrayAccessInternal(viewFactory, seq, seq.varHandle(PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement(1)), checker); } private void testAccessInternal(Function viewFactory, MemoryLayout layout, VarHandle handle, Checker checker) { @@ -149,40 +150,33 @@ public class TestMemoryAccess { } @Test(dataProvider = "matrixElements") - public void testMatrixAccess(Function viewFactory, MemoryLayout elemLayout, Class carrier, MatrixChecker checker) { + public void testMatrixAccess(Function viewFactory, MemoryLayout elemLayout, MatrixChecker checker) { SequenceLayout seq = MemoryLayout.sequenceLayout(20, MemoryLayout.sequenceLayout(10, elemLayout.withName("elem"))); - testMatrixAccessInternal(viewFactory, seq, seq.varHandle(carrier, + testMatrixAccessInternal(viewFactory, seq, seq.varHandle( PathElement.sequenceElement(), PathElement.sequenceElement()), checker); } @Test(dataProvider = "matrixElements") - public void testPaddedMatrixAccessByName(Function viewFactory, MemoryLayout elemLayout, Class carrier, MatrixChecker checker) { + public void testPaddedMatrixAccessByName(Function viewFactory, MemoryLayout elemLayout, MatrixChecker checker) { SequenceLayout seq = MemoryLayout.sequenceLayout(20, MemoryLayout.sequenceLayout(10, MemoryLayout.structLayout(MemoryLayout.paddingLayout(elemLayout.bitSize()), elemLayout.withName("elem")))); testMatrixAccessInternal(viewFactory, seq, - seq.varHandle(carrier, + seq.varHandle( PathElement.sequenceElement(), PathElement.sequenceElement(), PathElement.groupElement("elem")), checker); } @Test(dataProvider = "matrixElements") - public void testPaddedMatrixAccessByIndexSeq(Function viewFactory, MemoryLayout elemLayout, Class carrier, MatrixChecker checker) { + public void testPaddedMatrixAccessByIndexSeq(Function viewFactory, MemoryLayout elemLayout, MatrixChecker checker) { SequenceLayout seq = MemoryLayout.sequenceLayout(20, MemoryLayout.sequenceLayout(10, MemoryLayout.sequenceLayout(2, elemLayout))); testMatrixAccessInternal(viewFactory, seq, - seq.varHandle(carrier, + seq.varHandle( PathElement.sequenceElement(), PathElement.sequenceElement(), PathElement.sequenceElement(1)), checker); } - @Test(dataProvider = "badCarriers", - expectedExceptions = IllegalArgumentException.class) - public void testBadCarriers(Class carrier) { - ValueLayout l = MemoryLayouts.BITS_32_LE.withName("elem"); - l.varHandle(carrier); - } - private void testMatrixAccessInternal(Function viewFactory, SequenceLayout seq, VarHandle handle, MatrixChecker checker) { MemorySegment outer_segment; try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -227,37 +221,37 @@ public class TestMemoryAccess { public Object[][] createData() { return new Object[][] { //BE, RW - { ID, MemoryLayouts.BITS_8_BE, byte.class, Checker.BYTE }, - { ID, MemoryLayouts.BITS_16_BE, short.class, Checker.SHORT }, - { ID, MemoryLayouts.BITS_16_BE, char.class, Checker.CHAR }, - { ID, MemoryLayouts.BITS_32_BE, int.class, Checker.INT }, - { ID, MemoryLayouts.BITS_64_BE, long.class, Checker.LONG }, - { ID, MemoryLayouts.BITS_32_BE, float.class, Checker.FLOAT }, - { ID, MemoryLayouts.BITS_64_BE, double.class, Checker.DOUBLE }, + { ID, ValueLayout.JAVA_BYTE, Checker.BYTE }, + { ID, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), Checker.SHORT }, + { ID, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), Checker.CHAR }, + { ID, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), Checker.INT }, + { ID, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), Checker.LONG }, + { ID, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), Checker.FLOAT }, + { ID, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), Checker.DOUBLE }, //BE, RO - { IMMUTABLE, MemoryLayouts.BITS_8_BE, byte.class, Checker.BYTE }, - { IMMUTABLE, MemoryLayouts.BITS_16_BE, short.class, Checker.SHORT }, - { IMMUTABLE, MemoryLayouts.BITS_16_BE, char.class, Checker.CHAR }, - { IMMUTABLE, MemoryLayouts.BITS_32_BE, int.class, Checker.INT }, - { IMMUTABLE, MemoryLayouts.BITS_64_BE, long.class, Checker.LONG }, - { IMMUTABLE, MemoryLayouts.BITS_32_BE, float.class, Checker.FLOAT }, - { IMMUTABLE, MemoryLayouts.BITS_64_BE, double.class, Checker.DOUBLE }, + { IMMUTABLE, ValueLayout.JAVA_BYTE, Checker.BYTE }, + { IMMUTABLE, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), Checker.SHORT }, + { IMMUTABLE, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), Checker.CHAR }, + { IMMUTABLE, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), Checker.INT }, + { IMMUTABLE, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), Checker.LONG }, + { IMMUTABLE, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), Checker.FLOAT }, + { IMMUTABLE, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), Checker.DOUBLE }, //LE, RW - { ID, MemoryLayouts.BITS_8_LE, byte.class, Checker.BYTE }, - { ID, MemoryLayouts.BITS_16_LE, short.class, Checker.SHORT }, - { ID, MemoryLayouts.BITS_16_LE, char.class, Checker.CHAR }, - { ID, MemoryLayouts.BITS_32_LE, int.class, Checker.INT }, - { ID, MemoryLayouts.BITS_64_LE, long.class, Checker.LONG }, - { ID, MemoryLayouts.BITS_32_LE, float.class, Checker.FLOAT }, - { ID, MemoryLayouts.BITS_64_LE, double.class, Checker.DOUBLE }, + { ID, ValueLayout.JAVA_BYTE, Checker.BYTE }, + { ID, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.SHORT }, + { ID, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.CHAR }, + { ID, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.INT }, + { ID, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.LONG }, + { ID, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.FLOAT }, + { ID, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.DOUBLE }, //LE, RO - { IMMUTABLE, MemoryLayouts.BITS_8_LE, byte.class, Checker.BYTE }, - { IMMUTABLE, MemoryLayouts.BITS_16_LE, short.class, Checker.SHORT }, - { IMMUTABLE, MemoryLayouts.BITS_16_LE, char.class, Checker.CHAR }, - { IMMUTABLE, MemoryLayouts.BITS_32_LE, int.class, Checker.INT }, - { IMMUTABLE, MemoryLayouts.BITS_64_LE, long.class, Checker.LONG }, - { IMMUTABLE, MemoryLayouts.BITS_32_LE, float.class, Checker.FLOAT }, - { IMMUTABLE, MemoryLayouts.BITS_64_LE, double.class, Checker.DOUBLE }, + { IMMUTABLE, ValueLayout.JAVA_BYTE, Checker.BYTE }, + { IMMUTABLE, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.SHORT }, + { IMMUTABLE, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.CHAR }, + { IMMUTABLE, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.INT }, + { IMMUTABLE, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.LONG }, + { IMMUTABLE, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.FLOAT }, + { IMMUTABLE, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), Checker.DOUBLE }, }; } @@ -304,37 +298,37 @@ public class TestMemoryAccess { public Object[][] createArrayData() { return new Object[][] { //BE, RW - { ID, MemoryLayouts.BITS_8_BE, byte.class, ArrayChecker.BYTE }, - { ID, MemoryLayouts.BITS_16_BE, short.class, ArrayChecker.SHORT }, - { ID, MemoryLayouts.BITS_16_BE, char.class, ArrayChecker.CHAR }, - { ID, MemoryLayouts.BITS_32_BE, int.class, ArrayChecker.INT }, - { ID, MemoryLayouts.BITS_64_BE, long.class, ArrayChecker.LONG }, - { ID, MemoryLayouts.BITS_32_BE, float.class, ArrayChecker.FLOAT }, - { ID, MemoryLayouts.BITS_64_BE, double.class, ArrayChecker.DOUBLE }, + { ID, ValueLayout.JAVA_BYTE, ArrayChecker.BYTE }, + { ID, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.SHORT }, + { ID, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.CHAR }, + { ID, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.INT }, + { ID, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.LONG }, + { ID, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.FLOAT }, + { ID, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.DOUBLE }, //BE, RO - { IMMUTABLE, MemoryLayouts.BITS_8_BE, byte.class, ArrayChecker.BYTE }, - { IMMUTABLE, MemoryLayouts.BITS_16_BE, short.class, ArrayChecker.SHORT }, - { IMMUTABLE, MemoryLayouts.BITS_16_BE, char.class, ArrayChecker.CHAR }, - { IMMUTABLE, MemoryLayouts.BITS_32_BE, int.class, ArrayChecker.INT }, - { IMMUTABLE, MemoryLayouts.BITS_64_BE, long.class, ArrayChecker.LONG }, - { IMMUTABLE, MemoryLayouts.BITS_32_BE, float.class, ArrayChecker.FLOAT }, - { IMMUTABLE, MemoryLayouts.BITS_64_BE, double.class, ArrayChecker.DOUBLE }, + { IMMUTABLE, ValueLayout.JAVA_BYTE, ArrayChecker.BYTE }, + { IMMUTABLE, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.SHORT }, + { IMMUTABLE, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.CHAR }, + { IMMUTABLE, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.INT }, + { IMMUTABLE, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.LONG }, + { IMMUTABLE, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.FLOAT }, + { IMMUTABLE, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), ArrayChecker.DOUBLE }, //LE, RW - { ID, MemoryLayouts.BITS_8_LE, byte.class, ArrayChecker.BYTE }, - { ID, MemoryLayouts.BITS_16_LE, short.class, ArrayChecker.SHORT }, - { ID, MemoryLayouts.BITS_16_LE, char.class, ArrayChecker.CHAR }, - { ID, MemoryLayouts.BITS_32_LE, int.class, ArrayChecker.INT }, - { ID, MemoryLayouts.BITS_64_LE, long.class, ArrayChecker.LONG }, - { ID, MemoryLayouts.BITS_32_LE, float.class, ArrayChecker.FLOAT }, - { ID, MemoryLayouts.BITS_64_LE, double.class, ArrayChecker.DOUBLE }, + { ID, ValueLayout.JAVA_BYTE, ArrayChecker.BYTE }, + { ID, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.SHORT }, + { ID, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.CHAR }, + { ID, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.INT }, + { ID, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.LONG }, + { ID, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.FLOAT }, + { ID, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.DOUBLE }, //LE, RO - { IMMUTABLE, MemoryLayouts.BITS_8_LE, byte.class, ArrayChecker.BYTE }, - { IMMUTABLE, MemoryLayouts.BITS_16_LE, short.class, ArrayChecker.SHORT }, - { IMMUTABLE, MemoryLayouts.BITS_16_LE, char.class, ArrayChecker.CHAR }, - { IMMUTABLE, MemoryLayouts.BITS_32_LE, int.class, ArrayChecker.INT }, - { IMMUTABLE, MemoryLayouts.BITS_64_LE, long.class, ArrayChecker.LONG }, - { IMMUTABLE, MemoryLayouts.BITS_32_LE, float.class, ArrayChecker.FLOAT }, - { IMMUTABLE, MemoryLayouts.BITS_64_LE, double.class, ArrayChecker.DOUBLE }, + { IMMUTABLE, ValueLayout.JAVA_BYTE, ArrayChecker.BYTE }, + { IMMUTABLE, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.SHORT }, + { IMMUTABLE, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.CHAR }, + { IMMUTABLE, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.INT }, + { IMMUTABLE, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.LONG }, + { IMMUTABLE, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.FLOAT }, + { IMMUTABLE, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), ArrayChecker.DOUBLE }, }; } @@ -381,37 +375,45 @@ public class TestMemoryAccess { public Object[][] createMatrixData() { return new Object[][] { //BE, RW - { ID, MemoryLayouts.BITS_8_BE, byte.class, MatrixChecker.BYTE }, - { ID, MemoryLayouts.BITS_16_BE, short.class, MatrixChecker.SHORT }, - { ID, MemoryLayouts.BITS_16_BE, char.class, MatrixChecker.CHAR }, - { ID, MemoryLayouts.BITS_32_BE, int.class, MatrixChecker.INT }, - { ID, MemoryLayouts.BITS_64_BE, long.class, MatrixChecker.LONG }, - { ID, MemoryLayouts.BITS_32_BE, float.class, MatrixChecker.FLOAT }, - { ID, MemoryLayouts.BITS_64_BE, double.class, MatrixChecker.DOUBLE }, + { ID, ValueLayout.JAVA_BYTE, MatrixChecker.BYTE }, + { ID, ValueLayout.JAVA_BOOLEAN, MatrixChecker.BOOLEAN }, + { ID, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.SHORT }, + { ID, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.CHAR }, + { ID, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.INT }, + { ID, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.LONG }, + { ID, ValueLayout.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.ADDR }, + { ID, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.FLOAT }, + { ID, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.DOUBLE }, //BE, RO - { IMMUTABLE, MemoryLayouts.BITS_8_BE, byte.class, MatrixChecker.BYTE }, - { IMMUTABLE, MemoryLayouts.BITS_16_BE, short.class, MatrixChecker.SHORT }, - { IMMUTABLE, MemoryLayouts.BITS_16_BE, char.class, MatrixChecker.CHAR }, - { IMMUTABLE, MemoryLayouts.BITS_32_BE, int.class, MatrixChecker.INT }, - { IMMUTABLE, MemoryLayouts.BITS_64_BE, long.class, MatrixChecker.LONG }, - { IMMUTABLE, MemoryLayouts.BITS_32_BE, float.class, MatrixChecker.FLOAT }, - { IMMUTABLE, MemoryLayouts.BITS_64_BE, double.class, MatrixChecker.DOUBLE }, + { IMMUTABLE, ValueLayout.JAVA_BYTE, MatrixChecker.BYTE }, + { IMMUTABLE, ValueLayout.JAVA_BOOLEAN, MatrixChecker.BOOLEAN }, + { IMMUTABLE, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.SHORT }, + { IMMUTABLE, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.CHAR }, + { IMMUTABLE, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.INT }, + { IMMUTABLE, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.LONG }, + { IMMUTABLE, ValueLayout.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.ADDR }, + { IMMUTABLE, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.FLOAT }, + { IMMUTABLE, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), MatrixChecker.DOUBLE }, //LE, RW - { ID, MemoryLayouts.BITS_8_LE, byte.class, MatrixChecker.BYTE }, - { ID, MemoryLayouts.BITS_16_LE, short.class, MatrixChecker.SHORT }, - { ID, MemoryLayouts.BITS_16_LE, char.class, MatrixChecker.CHAR }, - { ID, MemoryLayouts.BITS_32_LE, int.class, MatrixChecker.INT }, - { ID, MemoryLayouts.BITS_64_LE, long.class, MatrixChecker.LONG }, - { ID, MemoryLayouts.BITS_32_LE, float.class, MatrixChecker.FLOAT }, - { ID, MemoryLayouts.BITS_64_LE, double.class, MatrixChecker.DOUBLE }, + { ID, ValueLayout.JAVA_BYTE, MatrixChecker.BYTE }, + { ID, ValueLayout.JAVA_BOOLEAN, MatrixChecker.BOOLEAN }, + { ID, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.SHORT }, + { ID, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.CHAR }, + { ID, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.INT }, + { ID, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.LONG }, + { ID, ValueLayout.ADDRESS.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.ADDR }, + { ID, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.FLOAT }, + { ID, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.DOUBLE }, //LE, RO - { IMMUTABLE, MemoryLayouts.BITS_8_LE, byte.class, MatrixChecker.BYTE }, - { IMMUTABLE, MemoryLayouts.BITS_16_LE, short.class, MatrixChecker.SHORT }, - { IMMUTABLE, MemoryLayouts.BITS_16_LE, char.class, MatrixChecker.CHAR }, - { IMMUTABLE, MemoryLayouts.BITS_32_LE, int.class, MatrixChecker.INT }, - { IMMUTABLE, MemoryLayouts.BITS_64_LE, long.class, MatrixChecker.LONG }, - { IMMUTABLE, MemoryLayouts.BITS_32_LE, float.class, MatrixChecker.FLOAT }, - { IMMUTABLE, MemoryLayouts.BITS_64_LE, double.class, MatrixChecker.DOUBLE }, + { IMMUTABLE, ValueLayout.JAVA_BYTE, MatrixChecker.BYTE }, + { IMMUTABLE, ValueLayout.JAVA_BOOLEAN, MatrixChecker.BOOLEAN }, + { IMMUTABLE, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.SHORT }, + { IMMUTABLE, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.CHAR }, + { IMMUTABLE, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.INT }, + { IMMUTABLE, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.LONG }, + { IMMUTABLE, ValueLayout.ADDRESS.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.ADDR }, + { IMMUTABLE, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.FLOAT }, + { IMMUTABLE, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), MatrixChecker.DOUBLE }, }; } @@ -423,6 +425,11 @@ public class TestMemoryAccess { assertEquals(r + c, (byte)handle.get(segment, r, c)); }; + MatrixChecker BOOLEAN = (handle, segment, r, c) -> { + handle.set(segment, r, c, (r + c) != 0); + assertEquals((r + c) != 0, (boolean)handle.get(segment, r, c)); + }; + MatrixChecker SHORT = (handle, segment, r, c) -> { handle.set(segment, r, c, (short)(r + c)); assertEquals(r + c, (short)handle.get(segment, r, c)); @@ -443,6 +450,11 @@ public class TestMemoryAccess { assertEquals(r + c, (long)handle.get(segment, r, c)); }; + MatrixChecker ADDR = (handle, segment, r, c) -> { + handle.set(segment, r, c, MemoryAddress.ofLong(r + c)); + assertEquals(MemoryAddress.ofLong(r + c), (MemoryAddress)handle.get(segment, r, c)); + }; + MatrixChecker FLOAT = (handle, segment, r, c) -> { handle.set(segment, r, c, (float)(r + c)); assertEquals((float)(r + c), (float)handle.get(segment, r, c)); @@ -453,14 +465,4 @@ public class TestMemoryAccess { assertEquals((double)(r + c), (double)handle.get(segment, r, c)); }; } - - @DataProvider(name = "badCarriers") - public Object[][] createBadCarriers() { - return new Object[][] { - { void.class }, - { boolean.class }, - { Object.class }, - { int[].class } - }; - } } diff --git a/test/jdk/java/foreign/TestMemoryAccessInstance.java b/test/jdk/java/foreign/TestMemoryAccessInstance.java new file mode 100644 index 00000000000..702e95bf8da --- /dev/null +++ b/test/jdk/java/foreign/TestMemoryAccessInstance.java @@ -0,0 +1,296 @@ +/* + * Copyright (c) 2021, 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 + * @run testng/othervm --enable-native-access=ALL-UNNAMED TestMemoryAccessInstance + */ + +import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.MemorySegment; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.function.Function; + +import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; +import org.testng.annotations.*; +import static org.testng.Assert.*; + +public class TestMemoryAccessInstance { + + static class Accessor { + + interface SegmentGetter { + X get(T buffer, L layout, long offset); + } + + interface SegmentSetter { + void set(T buffer, L layout, long offset, X o); + } + + interface BufferGetter { + X get(ByteBuffer segment, int offset); + } + + interface BufferSetter { + void set(ByteBuffer buffer, int offset, X o); + } + + final X value; + final L layout; + final Function transform; + final SegmentGetter segmentGetter; + final SegmentSetter segmentSetter; + final BufferGetter bufferGetter; + final BufferSetter bufferSetter; + + Accessor(Function transform, L layout, X value, + SegmentGetter segmentGetter, SegmentSetter segmentSetter, + BufferGetter bufferGetter, BufferSetter bufferSetter) { + this.transform = transform; + this.layout = layout; + this.value = value; + this.segmentGetter = segmentGetter; + this.segmentSetter = segmentSetter; + this.bufferGetter = bufferGetter; + this.bufferSetter = bufferSetter; + } + + void test() { + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + MemorySegment segment = MemorySegment.allocateNative(64, scope); + ByteBuffer buffer = segment.asByteBuffer(); + T t = transform.apply(segment); + segmentSetter.set(t, layout, 4, value); + assertEquals(bufferGetter.get(buffer, 4), value); + bufferSetter.set(buffer, 4, value); + assertEquals(value, segmentGetter.get(t, layout, 4)); + } + } + + static Accessor ofSegment(L layout, X value, + SegmentGetter segmentGetter, SegmentSetter segmentSetter, + BufferGetter bufferGetter, BufferSetter bufferSetter) { + return new Accessor<>(Function.identity(), layout, value, segmentGetter, segmentSetter, bufferGetter, bufferSetter); + } + + static Accessor ofAddress(L layout, X value, + SegmentGetter segmentGetter, SegmentSetter segmentSetter, + BufferGetter bufferGetter, BufferSetter bufferSetter) { + return new Accessor<>(MemorySegment::address, layout, value, segmentGetter, segmentSetter, bufferGetter, bufferSetter); + } + } + + @Test(dataProvider = "segmentAccessors") + public void testSegmentAccess(String testName, Accessor accessor) { + accessor.test(); + } + + @Test(dataProvider = "addressAccessors") + public void testAddressAccess(String testName, Accessor accessor) { + accessor.test(); + } + + static final ByteOrder NE = ByteOrder.nativeOrder(); + + @DataProvider(name = "segmentAccessors") + static Object[][] segmentAccessors() { + return new Object[][]{ + + {"byte", Accessor.ofSegment(ValueLayout.JAVA_BYTE, (byte) 42, + MemorySegment::get, MemorySegment::set, + ByteBuffer::get, ByteBuffer::put) + }, + {"bool", Accessor.ofSegment(ValueLayout.JAVA_BOOLEAN, false, + MemorySegment::get, MemorySegment::set, + (bb, pos) -> bb.get(pos) != 0, (bb, pos, v) -> bb.put(pos, v ? (byte)1 : (byte)0)) + }, + {"char", Accessor.ofSegment(ValueLayout.JAVA_CHAR, (char) 42, + MemorySegment::get, MemorySegment::set, + (bb, pos) -> bb.order(NE).getChar(pos), (bb, pos, v) -> bb.order(NE).putChar(pos, v)) + }, + {"int", Accessor.ofSegment(ValueLayout.JAVA_INT, 42, + MemorySegment::get, MemorySegment::set, + (bb, pos) -> bb.order(NE).getInt(pos), (bb, pos, v) -> bb.order(NE).putInt(pos, v)) + }, + {"float", Accessor.ofSegment(ValueLayout.JAVA_FLOAT, 42f, + MemorySegment::get, MemorySegment::set, + (bb, pos) -> bb.order(NE).getFloat(pos), (bb, pos, v) -> bb.order(NE).putFloat(pos, v)) + }, + {"long", Accessor.ofSegment(ValueLayout.JAVA_LONG, 42L, + MemorySegment::get, MemorySegment::set, + (bb, pos) -> bb.order(NE).getLong(pos), (bb, pos, v) -> bb.order(NE).putLong(pos, v)) + }, + {"double", Accessor.ofSegment(ValueLayout.JAVA_DOUBLE, 42d, + MemorySegment::get, MemorySegment::set, + (bb, pos) -> bb.order(NE).getDouble(pos), (bb, pos, v) -> bb.order(NE).putDouble(pos, v)) + }, + { "address", Accessor.ofSegment(ValueLayout.ADDRESS, MemoryAddress.ofLong(42), + MemorySegment::get, MemorySegment::set, + (bb, pos) -> { + ByteBuffer nb = bb.order(NE); + long addr = ValueLayout.ADDRESS.byteSize() == 8 ? + nb.getLong(pos) : nb.getInt(pos); + return MemoryAddress.ofLong(addr); + }, + (bb, pos, v) -> { + ByteBuffer nb = bb.order(NE); + if (ValueLayout.ADDRESS.byteSize() == 8) { + nb.putLong(pos, v.toRawLongValue()); + } else { + nb.putInt(pos, (int)v.toRawLongValue()); + } + }) + }, + + {"char/index", Accessor.ofSegment(ValueLayout.JAVA_CHAR, (char) 42, + MemorySegment::getAtIndex, MemorySegment::setAtIndex, + (bb, pos) -> bb.order(NE).getChar(pos * 2), (bb, pos, v) -> bb.order(NE).putChar(pos * 2, v)) + }, + {"int/index", Accessor.ofSegment(ValueLayout.JAVA_INT, 42, + MemorySegment::getAtIndex, MemorySegment::setAtIndex, + (bb, pos) -> bb.order(NE).getInt(pos * 4), (bb, pos, v) -> bb.order(NE).putInt(pos * 4, v)) + }, + {"float/index", Accessor.ofSegment(ValueLayout.JAVA_FLOAT, 42f, + MemorySegment::getAtIndex, MemorySegment::setAtIndex, + (bb, pos) -> bb.order(NE).getFloat(pos * 4), (bb, pos, v) -> bb.order(NE).putFloat(pos * 4, v)) + }, + {"long/index", Accessor.ofSegment(ValueLayout.JAVA_LONG, 42L, + MemorySegment::getAtIndex, MemorySegment::setAtIndex, + (bb, pos) -> bb.order(NE).getLong(pos * 8), (bb, pos, v) -> bb.order(NE).putLong(pos * 8, v)) + }, + {"double/index", Accessor.ofSegment(ValueLayout.JAVA_DOUBLE, 42d, + MemorySegment::getAtIndex, MemorySegment::setAtIndex, + (bb, pos) -> bb.order(NE).getDouble(pos * 8), (bb, pos, v) -> bb.order(NE).putDouble(pos * 8, v)) + }, + { "address/index", Accessor.ofSegment(ValueLayout.ADDRESS, MemoryAddress.ofLong(42), + MemorySegment::getAtIndex, MemorySegment::setAtIndex, + (bb, pos) -> { + ByteBuffer nb = bb.order(NE); + long addr = ValueLayout.ADDRESS.byteSize() == 8 ? + nb.getLong(pos * 8) : nb.getInt(pos * 4); + return MemoryAddress.ofLong(addr); + }, + (bb, pos, v) -> { + ByteBuffer nb = bb.order(NE); + if (ValueLayout.ADDRESS.byteSize() == 8) { + nb.putLong(pos * 8, v.toRawLongValue()); + } else { + nb.putInt(pos * 4, (int)v.toRawLongValue()); + } + }) + }, + }; + } + + @DataProvider(name = "addressAccessors") + static Object[][] addressAccessors() { + return new Object[][]{ + + {"byte", Accessor.ofAddress(ValueLayout.JAVA_BYTE, (byte) 42, + MemoryAddress::get, MemoryAddress::set, + ByteBuffer::get, ByteBuffer::put) + }, + {"bool", Accessor.ofAddress(ValueLayout.JAVA_BOOLEAN, false, + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> bb.get(pos) != 0, (bb, pos, v) -> bb.put(pos, v ? (byte)1 : (byte)0)) + }, + {"char", Accessor.ofAddress(ValueLayout.JAVA_CHAR, (char) 42, + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> bb.order(NE).getChar(pos), (bb, pos, v) -> bb.order(NE).putChar(pos, v)) + }, + {"int", Accessor.ofAddress(ValueLayout.JAVA_INT, 42, + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> bb.order(NE).getInt(pos), (bb, pos, v) -> bb.order(NE).putInt(pos, v)) + }, + {"float", Accessor.ofAddress(ValueLayout.JAVA_FLOAT, 42f, + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> bb.order(NE).getFloat(pos), (bb, pos, v) -> bb.order(NE).putFloat(pos, v)) + }, + {"long", Accessor.ofAddress(ValueLayout.JAVA_LONG, 42L, + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> bb.order(NE).getLong(pos), (bb, pos, v) -> bb.order(NE).putLong(pos, v)) + }, + {"double", Accessor.ofAddress(ValueLayout.JAVA_DOUBLE, 42d, + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> bb.order(NE).getDouble(pos), (bb, pos, v) -> bb.order(NE).putDouble(pos, v)) + }, + { "address", Accessor.ofAddress(ValueLayout.ADDRESS, MemoryAddress.ofLong(42), + MemoryAddress::get, MemoryAddress::set, + (bb, pos) -> { + ByteBuffer nb = bb.order(NE); + long addr = ValueLayout.ADDRESS.byteSize() == 8 ? + nb.getLong(pos) : nb.getInt(pos); + return MemoryAddress.ofLong(addr); + }, + (bb, pos, v) -> { + ByteBuffer nb = bb.order(NE); + if (ValueLayout.ADDRESS.byteSize() == 8) { + nb.putLong(pos, v.toRawLongValue()); + } else { + nb.putInt(pos, (int)v.toRawLongValue()); + } + }) + }, + {"char/index", Accessor.ofAddress(ValueLayout.JAVA_CHAR, (char) 42, + MemoryAddress::getAtIndex, MemoryAddress::setAtIndex, + (bb, pos) -> bb.order(NE).getChar(pos * 2), (bb, pos, v) -> bb.order(NE).putChar(pos * 2, v)) + }, + {"int/index", Accessor.ofAddress(ValueLayout.JAVA_INT, 42, + MemoryAddress::getAtIndex, MemoryAddress::setAtIndex, + (bb, pos) -> bb.order(NE).getInt(pos * 4), (bb, pos, v) -> bb.order(NE).putInt(pos * 4, v)) + }, + {"float/index", Accessor.ofAddress(ValueLayout.JAVA_FLOAT, 42f, + MemoryAddress::getAtIndex, MemoryAddress::setAtIndex, + (bb, pos) -> bb.order(NE).getFloat(pos * 4), (bb, pos, v) -> bb.order(NE).putFloat(pos * 4, v)) + }, + {"long/index", Accessor.ofAddress(ValueLayout.JAVA_LONG, 42L, + MemoryAddress::getAtIndex, MemoryAddress::setAtIndex, + (bb, pos) -> bb.order(NE).getLong(pos * 8), (bb, pos, v) -> bb.order(NE).putLong(pos * 8, v)) + }, + {"double/index", Accessor.ofAddress(ValueLayout.JAVA_DOUBLE, 42d, + MemoryAddress::getAtIndex, MemoryAddress::setAtIndex, + (bb, pos) -> bb.order(NE).getDouble(pos * 8), (bb, pos, v) -> bb.order(NE).putDouble(pos * 8, v)) + }, + { "address/index", Accessor.ofAddress(ValueLayout.ADDRESS, MemoryAddress.ofLong(42), + MemoryAddress::getAtIndex, MemoryAddress::setAtIndex, + (bb, pos) -> { + ByteBuffer nb = bb.order(NE); + long addr = ValueLayout.ADDRESS.byteSize() == 8 ? + nb.getLong(pos * 8) : nb.getInt(pos * 4); + return MemoryAddress.ofLong(addr); + }, + (bb, pos, v) -> { + ByteBuffer nb = bb.order(NE); + if (ValueLayout.ADDRESS.byteSize() == 8) { + nb.putLong(pos * 8, v.toRawLongValue()); + } else { + nb.putInt(pos * 4, (int)v.toRawLongValue()); + } + }) + } + }; + } +} diff --git a/test/jdk/java/foreign/TestMemoryAccessStatics.java b/test/jdk/java/foreign/TestMemoryAccessStatics.java deleted file mode 100644 index 4115bf58146..00000000000 --- a/test/jdk/java/foreign/TestMemoryAccessStatics.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (c) 2020, 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 - * @run testng TestMemoryAccessStatics - */ - -import jdk.incubator.foreign.MemoryAccess; -import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemoryLayouts; -import jdk.incubator.foreign.MemorySegment; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import org.testng.annotations.*; -import static org.testng.Assert.*; - -public class TestMemoryAccessStatics { - - static class Accessor { - - interface SegmentGetter { - X get(MemorySegment segment); - } - - interface SegmentSetter { - void set(MemorySegment segment, X o); - } - - interface BufferGetter { - X get(ByteBuffer segment); - } - - interface BufferSetter { - void set(ByteBuffer buffer, X o); - } - - final X value; - final SegmentGetter segmentGetter; - final SegmentSetter segmentSetter; - final BufferGetter bufferGetter; - final BufferSetter bufferSetter; - - Accessor(X value, - SegmentGetter segmentGetter, SegmentSetter segmentSetter, - BufferGetter bufferGetter, BufferSetter bufferSetter) { - this.value = value; - this.segmentGetter = segmentGetter; - this.segmentSetter = segmentSetter; - this.bufferGetter = bufferGetter; - this.bufferSetter = bufferSetter; - } - - void test() { - MemorySegment segment = MemorySegment.ofArray(new byte[32]); - ByteBuffer buffer = segment.asByteBuffer(); - segmentSetter.set(segment, value); - assertEquals(bufferGetter.get(buffer), value); - bufferSetter.set(buffer, value); - assertEquals(value, segmentGetter.get(segment)); - } - - Accessor of(Z value, - SegmentGetter segmentGetter, SegmentSetter segmentSetter, - BufferGetter bufferGetter, BufferSetter bufferSetter) { - return new Accessor<>(value, segmentGetter, segmentSetter, bufferGetter, bufferSetter); - } - } - - @Test(dataProvider = "accessors") - public void testMemoryAccess(String testName, Accessor accessor) { - accessor.test(); - } - - static final ByteOrder BE = ByteOrder.BIG_ENDIAN; - static final ByteOrder LE = ByteOrder.LITTLE_ENDIAN; - static final ByteOrder NE = ByteOrder.nativeOrder(); - - @DataProvider(name = "accessors") - static Object[][] accessors() { - return new Object[][]{ - - {"byte", new Accessor<>((byte) 42, - MemoryAccess::getByte, MemoryAccess::setByte, - (bb) -> bb.get(0), (bb, v) -> bb.put(0, v)) - }, - {"char", new Accessor<>((char) 42, - MemoryAccess::getChar, MemoryAccess::setChar, - (bb) -> bb.order(NE).getChar(0), (bb, v) -> bb.order(NE).putChar(0, v)) - }, - {"char/LE", new Accessor<>((char) 42, - s -> MemoryAccess.getChar(s, LE), (s, x) -> MemoryAccess.setChar(s, LE, x), - (bb) -> bb.order(LE).getChar(0), (bb, v) -> bb.order(LE).putChar(0, v)) - }, - {"char/BE", new Accessor<>((char) 42, - s -> MemoryAccess.getChar(s, BE), (s, x) -> MemoryAccess.setChar(s, BE, x), - (bb) -> bb.order(BE).getChar(0), (bb, v) -> bb.order(BE).putChar(0, v)) - }, - {"short", new Accessor<>((short) 42, - MemoryAccess::getShort, MemoryAccess::setShort, - (bb) -> bb.order(NE).getShort(0), (bb, v) -> bb.order(NE).putShort(0, v)) - }, - {"short/LE", new Accessor<>((short) 42, - s -> MemoryAccess.getShort(s, LE), (s, x) -> MemoryAccess.setShort(s, LE, x), - (bb) -> bb.order(LE).getShort(0), (bb, v) -> bb.order(LE).putShort(0, v)) - }, - {"short/BE", new Accessor<>((short) 42, - s -> MemoryAccess.getShort(s, BE), (s, x) -> MemoryAccess.setShort(s, BE, x), - (bb) -> bb.order(BE).getShort(0), (bb, v) -> bb.order(BE).putShort(0, v)) - }, - {"int", new Accessor<>(42, - MemoryAccess::getInt, MemoryAccess::setInt, - (bb) -> bb.order(NE).getInt(0), (bb, v) -> bb.order(NE).putInt(0, v)) - }, - {"int/LE", new Accessor<>(42, - s -> MemoryAccess.getInt(s, LE), (s, x) -> MemoryAccess.setInt(s, LE, x), - (bb) -> bb.order(LE).getInt(0), (bb, v) -> bb.order(LE).putInt(0, v)) - }, - {"int/BE", new Accessor<>(42, - s -> MemoryAccess.getInt(s, BE), (s, x) -> MemoryAccess.setInt(s, BE, x), - (bb) -> bb.order(BE).getInt(0), (bb, v) -> bb.order(BE).putInt(0, v)) - }, - // float, no offset - {"float", new Accessor<>(42f, - MemoryAccess::getFloat, MemoryAccess::setFloat, - (bb) -> bb.order(NE).getFloat(0), (bb, v) -> bb.order(NE).putFloat(0, v)) - }, - {"float/LE", new Accessor<>(42f, - s -> MemoryAccess.getFloat(s, LE), (s, x) -> MemoryAccess.setFloat(s, LE, x), - (bb) -> bb.order(LE).getFloat(0), (bb, v) -> bb.order(LE).putFloat(0, v)) - }, - {"float/BE", new Accessor<>(42f, - s -> MemoryAccess.getFloat(s, BE), (s, x) -> MemoryAccess.setFloat(s, BE, x), - (bb) -> bb.order(BE).getFloat(0), (bb, v) -> bb.order(BE).putFloat(0, v)) - }, - // double, no offset - {"double", new Accessor<>(42d, - MemoryAccess::getDouble, MemoryAccess::setDouble, - (bb) -> bb.order(NE).getDouble(0), (bb, v) -> bb.order(NE).putDouble(0, v)) - }, - {"double/LE", new Accessor<>(42d, - s -> MemoryAccess.getDouble(s, LE), (s, x) -> MemoryAccess.setDouble(s, LE, x), - (bb) -> bb.order(LE).getDouble(0), (bb, v) -> bb.order(LE).putDouble(0, v)) - }, - {"double/BE", new Accessor<>(42d, - s -> MemoryAccess.getDouble(s, BE), (s, x) -> MemoryAccess.setDouble(s, BE, x), - (bb) -> bb.order(BE).getDouble(0), (bb, v) -> bb.order(BE).putDouble(0, v)) - }, - - - // byte, offset - {"byte/offset", new Accessor<>((byte) 42, - s -> MemoryAccess.getByteAtOffset(s, 4), (s, x) -> MemoryAccess.setByteAtOffset(s, 4, x), - (bb) -> bb.get(4), (bb, v) -> bb.put(4, v)) - }, - // char, offset - {"char/offset", new Accessor<>((char) 42, - s -> MemoryAccess.getCharAtOffset(s, 4), (s, x) -> MemoryAccess.setCharAtOffset(s, 4, x), - (bb) -> bb.order(NE).getChar(4), (bb, v) -> bb.order(NE).putChar(4, v)) - }, - {"char/offset/LE", new Accessor<>((char) 42, - s -> MemoryAccess.getCharAtOffset(s, 4, LE), (s, x) -> MemoryAccess.setCharAtOffset(s, 4, LE, x), - (bb) -> bb.order(LE).getChar(4), (bb, v) -> bb.order(LE).putChar(4, v)) - }, - {"char/offset/BE", new Accessor<>((char) 42, - s -> MemoryAccess.getCharAtOffset(s, 4, BE), (s, x) -> MemoryAccess.setCharAtOffset(s, 4, BE, x), - (bb) -> bb.order(BE).getChar(4), (bb, v) -> bb.order(BE).putChar(4, v)) - }, - // short, offset - {"short/offset", new Accessor<>((short) 42, - s -> MemoryAccess.getShortAtOffset(s, 4), (s, x) -> MemoryAccess.setShortAtOffset(s, 4, x), - (bb) -> bb.order(NE).getShort(4), (bb, v) -> bb.order(NE).putShort(4, v)) - }, - {"short/offset/LE", new Accessor<>((short) 42, - s -> MemoryAccess.getShortAtOffset(s, 4, LE), (s, x) -> MemoryAccess.setShortAtOffset(s, 4, LE, x), - (bb) -> bb.order(LE).getShort(4), (bb, v) -> bb.order(LE).putShort(4, v)) - }, - {"short/offset/BE", new Accessor<>((short) 42, - s -> MemoryAccess.getShortAtOffset(s, 4, BE), (s, x) -> MemoryAccess.setShortAtOffset(s, 4, BE, x), - (bb) -> bb.order(BE).getShort(4), (bb, v) -> bb.order(BE).putShort(4, v)) - }, - // int, offset - {"int/offset", new Accessor<>(42, - s -> MemoryAccess.getIntAtOffset(s, 4), (s, x) -> MemoryAccess.setIntAtOffset(s, 4, x), - (bb) -> bb.order(NE).getInt(4), (bb, v) -> bb.order(NE).putInt(4, v)) - }, - {"int/offset/LE", new Accessor<>(42, - s -> MemoryAccess.getIntAtOffset(s, 4, LE), (s, x) -> MemoryAccess.setIntAtOffset(s, 4, LE, x), - (bb) -> bb.order(LE).getInt(4), (bb, v) -> bb.order(LE).putInt(4, v)) - }, - {"int/offset/BE", new Accessor<>(42, - s -> MemoryAccess.getIntAtOffset(s, 4, BE), (s, x) -> MemoryAccess.setIntAtOffset(s, 4, BE, x), - (bb) -> bb.order(BE).getInt(4), (bb, v) -> bb.order(BE).putInt(4, v)) - }, - // float, offset - {"float/offset", new Accessor<>(42f, - s -> MemoryAccess.getFloatAtOffset(s, 4), (s, x) -> MemoryAccess.setFloatAtOffset(s, 4, x), - (bb) -> bb.order(NE).getFloat(4), (bb, v) -> bb.order(NE).putFloat(4, v)) - }, - {"float/offset/LE", new Accessor<>(42f, - s -> MemoryAccess.getFloatAtOffset(s, 4, LE), (s, x) -> MemoryAccess.setFloatAtOffset(s, 4, LE, x), - (bb) -> bb.order(LE).getFloat(4), (bb, v) -> bb.order(LE).putFloat(4, v)) - }, - {"float/offset/BE", new Accessor<>(42f, - s -> MemoryAccess.getFloatAtOffset(s, 4, BE), (s, x) -> MemoryAccess.setFloatAtOffset(s, 4, BE, x), - (bb) -> bb.order(BE).getFloat(4), (bb, v) -> bb.order(BE).putFloat(4, v)) - }, - // double, offset - {"double/offset", new Accessor<>(42d, - s -> MemoryAccess.getDoubleAtOffset(s, 4), (s, x) -> MemoryAccess.setDoubleAtOffset(s, 4, x), - (bb) -> bb.order(NE).getDouble(4), (bb, v) -> bb.order(NE).putDouble(4, v)) - }, - {"double/offset/LE", new Accessor<>(42d, - s -> MemoryAccess.getDoubleAtOffset(s, 4, LE), (s, x) -> MemoryAccess.setDoubleAtOffset(s, 4, LE, x), - (bb) -> bb.order(LE).getDouble(4), (bb, v) -> bb.order(LE).putDouble(4, v)) - }, - {"double/offset/BE", new Accessor<>(42d, - s -> MemoryAccess.getDoubleAtOffset(s, 4, BE), (s, x) -> MemoryAccess.setDoubleAtOffset(s, 4, BE, x), - (bb) -> bb.order(BE).getDouble(4), (bb, v) -> bb.order(BE).putDouble(4, v)) - }, - - - // char, index - {"char/index", new Accessor<>((char) 42, - s -> MemoryAccess.getCharAtIndex(s, 2), (s, x) -> MemoryAccess.setCharAtIndex(s, 2, x), - (bb) -> bb.order(NE).asCharBuffer().get(2), (bb, v) -> bb.order(NE).asCharBuffer().put(2, v)) - }, - {"char/index/LE", new Accessor<>((char) 42, - s -> MemoryAccess.getCharAtIndex(s, 2, LE), (s, x) -> MemoryAccess.setCharAtIndex(s, 2, LE, x), - (bb) -> bb.order(LE).asCharBuffer().get(2), (bb, v) -> bb.order(LE).asCharBuffer().put(2, v)) - }, - {"char/index/BE", new Accessor<>((char) 42, - s -> MemoryAccess.getCharAtIndex(s, 2, BE), (s, x) -> MemoryAccess.setCharAtIndex(s, 2, BE, x), - (bb) -> bb.order(BE).asCharBuffer().get(2), (bb, v) -> bb.order(BE).asCharBuffer().put(2, v)) - }, - // short, index - {"short/index", new Accessor<>((short) 42, - s -> MemoryAccess.getShortAtIndex(s, 2), (s, x) -> MemoryAccess.setShortAtIndex(s, 2, x), - (bb) -> bb.order(NE).asShortBuffer().get(2), (bb, v) -> bb.order(NE).asShortBuffer().put(2, v)) - }, - {"short/index/LE", new Accessor<>((short) 42, - s -> MemoryAccess.getShortAtIndex(s, 2, LE), (s, x) -> MemoryAccess.setShortAtIndex(s, 2, LE, x), - (bb) -> bb.order(LE).asShortBuffer().get(2), (bb, v) -> bb.order(LE).asShortBuffer().put(2, v)) - }, - {"short/index/BE", new Accessor<>((short) 42, - s -> MemoryAccess.getShortAtIndex(s, 2, BE), (s, x) -> MemoryAccess.setShortAtIndex(s, 2, BE, x), - (bb) -> bb.order(BE).asShortBuffer().get(2), (bb, v) -> bb.order(BE).asShortBuffer().put(2, v)) - }, - {"int/index", new Accessor<>(42, - s -> MemoryAccess.getIntAtIndex(s, 2), (s, x) -> MemoryAccess.setIntAtIndex(s, 2, x), - (bb) -> bb.order(NE).asIntBuffer().get(2), (bb, v) -> bb.order(NE).asIntBuffer().put(2, v)) - }, - {"int/index/LE", new Accessor<>(42, - s -> MemoryAccess.getIntAtIndex(s, 2, LE), (s, x) -> MemoryAccess.setIntAtIndex(s, 2, LE, x), - (bb) -> bb.order(LE).asIntBuffer().get(2), (bb, v) -> bb.order(LE).asIntBuffer().put(2, v)) - }, - {"int/index/BE", new Accessor<>(42, - s -> MemoryAccess.getIntAtIndex(s, 2, BE), (s, x) -> MemoryAccess.setIntAtIndex(s, 2, BE, x), - (bb) -> bb.order(BE).asIntBuffer().get(2), (bb, v) -> bb.order(BE).asIntBuffer().put(2, v)) - }, - {"float/index", new Accessor<>(42f, - s -> MemoryAccess.getFloatAtIndex(s, 2), (s, x) -> MemoryAccess.setFloatAtIndex(s, 2, x), - (bb) -> bb.order(NE).asFloatBuffer().get(2), (bb, v) -> bb.order(NE).asFloatBuffer().put(2, v)) - }, - {"float/index/LE", new Accessor<>(42f, - s -> MemoryAccess.getFloatAtIndex(s, 2, LE), (s, x) -> MemoryAccess.setFloatAtIndex(s, 2, LE, x), - (bb) -> bb.order(LE).asFloatBuffer().get(2), (bb, v) -> bb.order(LE).asFloatBuffer().put(2, v)) - }, - {"float/index/BE", new Accessor<>(42f, - s -> MemoryAccess.getFloatAtIndex(s, 2, BE), (s, x) -> MemoryAccess.setFloatAtIndex(s, 2, BE, x), - (bb) -> bb.order(BE).asFloatBuffer().get(2), (bb, v) -> bb.order(BE).asFloatBuffer().put(2, v)) - }, - {"double/index", new Accessor<>(42d, - s -> MemoryAccess.getDoubleAtIndex(s, 2), (s, x) -> MemoryAccess.setDoubleAtIndex(s, 2, x), - (bb) -> bb.order(NE).asDoubleBuffer().get(2), (bb, v) -> bb.order(NE).asDoubleBuffer().put(2, v)) - }, - {"double/index/LE", new Accessor<>(42d, - s -> MemoryAccess.getDoubleAtIndex(s, 2, LE), (s, x) -> MemoryAccess.setDoubleAtIndex(s, 2, LE, x), - (bb) -> bb.order(LE).asDoubleBuffer().get(2), (bb, v) -> bb.order(LE).asDoubleBuffer().put(2, v)) - }, - {"double/index/BE", new Accessor<>(42d, - s -> MemoryAccess.getDoubleAtIndex(s, 2, BE), (s, x) -> MemoryAccess.setDoubleAtIndex(s, 2, BE, x), - (bb) -> bb.order(BE).asDoubleBuffer().get(2), (bb, v) -> bb.order(BE).asDoubleBuffer().put(2, v)) - }, - - { "address", new Accessor<>(MemoryAddress.ofLong(42), - MemoryAccess::getAddress, MemoryAccess::setAddress, - (bb) -> { - ByteBuffer nb = bb.order(NE); - long addr = MemoryLayouts.ADDRESS.byteSize() == 8 ? - nb.getLong(0) : nb.getInt(0); - return MemoryAddress.ofLong(addr); - }, - (bb, v) -> { - ByteBuffer nb = bb.order(NE); - if (MemoryLayouts.ADDRESS.byteSize() == 8) { - nb.putLong(0, v.toRawLongValue()); - } else { - nb.putInt(0, (int)v.toRawLongValue()); - } - }) - }, - { "address/offset", new Accessor<>(MemoryAddress.ofLong(42), - s -> MemoryAccess.getAddressAtOffset(s, 4), (s, x) -> MemoryAccess.setAddressAtOffset(s, 4, x), - (bb) -> { - ByteBuffer nb = bb.order(NE); - long addr = MemoryLayouts.ADDRESS.byteSize() == 8 ? - nb.getLong(4) : nb.getInt(4); - return MemoryAddress.ofLong(addr); - }, - (bb, v) -> { - ByteBuffer nb = bb.order(NE); - if (MemoryLayouts.ADDRESS.byteSize() == 8) { - nb.putLong(4, v.toRawLongValue()); - } else { - nb.putInt(4, (int)v.toRawLongValue()); - } - }) - }, - { "address/index", new Accessor<>(MemoryAddress.ofLong(42), - s -> MemoryAccess.getAddressAtIndex(s, 2), (s, x) -> MemoryAccess.setAddressAtIndex(s, 2, x), - (bb) -> { - ByteBuffer nb = bb.order(NE); - long addr = MemoryLayouts.ADDRESS.byteSize() == 8 ? - nb.asLongBuffer().get(2) : nb.asIntBuffer().get(2); - return MemoryAddress.ofLong(addr); - }, - (bb, v) -> { - ByteBuffer nb = bb.order(NE); - if (MemoryLayouts.ADDRESS.byteSize() == 8) { - nb.asLongBuffer().put(2, v.toRawLongValue()); - } else { - nb.asIntBuffer().put(2, (int)v.toRawLongValue()); - } - }) - }, - }; - } -} diff --git a/test/jdk/java/foreign/TestMemoryAlignment.java b/test/jdk/java/foreign/TestMemoryAlignment.java index 93f218245c8..d486581435a 100644 --- a/test/jdk/java/foreign/TestMemoryAlignment.java +++ b/test/jdk/java/foreign/TestMemoryAlignment.java @@ -26,7 +26,6 @@ * @run testng TestMemoryAlignment */ -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.GroupLayout; @@ -36,6 +35,7 @@ import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SequenceLayout; import jdk.incubator.foreign.ValueLayout; import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; import java.util.stream.LongStream; import org.testng.annotations.*; @@ -45,11 +45,13 @@ public class TestMemoryAlignment { @Test(dataProvider = "alignments") public void testAlignedAccess(long align) { - ValueLayout layout = MemoryLayouts.BITS_32_BE; + ValueLayout layout = ValueLayout.JAVA_INT + .withBitAlignment(32) + .withOrder(ByteOrder.BIG_ENDIAN); assertEquals(layout.bitAlignment(), 32); ValueLayout aligned = layout.withBitAlignment(align); assertEquals(aligned.bitAlignment(), align); //unreasonable alignment here, to make sure access throws - VarHandle vh = aligned.varHandle(int.class); + VarHandle vh = aligned.varHandle(); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(aligned, scope); vh.set(segment, -42); @@ -60,12 +62,14 @@ public class TestMemoryAlignment { @Test(dataProvider = "alignments") public void testUnalignedAccess(long align) { - ValueLayout layout = MemoryLayouts.BITS_32_BE; + ValueLayout layout = ValueLayout.JAVA_INT + .withBitAlignment(32) + .withOrder(ByteOrder.BIG_ENDIAN); assertEquals(layout.bitAlignment(), 32); ValueLayout aligned = layout.withBitAlignment(align); - MemoryLayout alignedGroup = MemoryLayout.structLayout(MemoryLayouts.PAD_8, aligned); + MemoryLayout alignedGroup = MemoryLayout.structLayout(MemoryLayout.paddingLayout(8), aligned); assertEquals(alignedGroup.bitAlignment(), align); - VarHandle vh = aligned.varHandle(int.class); + VarHandle vh = aligned.varHandle(); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(alignedGroup, scope); vh.set(segment.asSlice(1L), -42); @@ -77,11 +81,11 @@ public class TestMemoryAlignment { @Test(dataProvider = "alignments") public void testUnalignedPath(long align) { - MemoryLayout layout = MemoryLayouts.BITS_32_BE; + MemoryLayout layout = ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN); MemoryLayout aligned = layout.withBitAlignment(align).withName("value"); - GroupLayout alignedGroup = MemoryLayout.structLayout(MemoryLayouts.PAD_8, aligned); + GroupLayout alignedGroup = MemoryLayout.structLayout(MemoryLayout.paddingLayout(8), aligned); try { - alignedGroup.varHandle(int.class, PathElement.groupElement("value")); + alignedGroup.varHandle(PathElement.groupElement("value")); assertEquals(align, 8); //this is the only case where path is aligned } catch (UnsupportedOperationException ex) { assertNotEquals(align, 8); //if align != 8, path is always unaligned @@ -90,9 +94,9 @@ public class TestMemoryAlignment { @Test(dataProvider = "alignments") public void testUnalignedSequence(long align) { - SequenceLayout layout = MemoryLayout.sequenceLayout(5, MemoryLayouts.BITS_32_BE.withBitAlignment(align)); + SequenceLayout layout = MemoryLayout.sequenceLayout(5, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN).withBitAlignment(align)); try { - VarHandle vh = layout.varHandle(int.class, PathElement.sequenceElement()); + VarHandle vh = layout.varHandle(PathElement.sequenceElement()); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(layout, scope); for (long i = 0 ; i < 5 ; i++) { @@ -106,17 +110,17 @@ public class TestMemoryAlignment { @Test public void testPackedAccess() { - ValueLayout vChar = MemoryLayouts.BITS_8_BE; - ValueLayout vShort = MemoryLayouts.BITS_16_BE; - ValueLayout vInt = MemoryLayouts.BITS_32_BE; + ValueLayout vChar = ValueLayout.JAVA_BYTE; + ValueLayout vShort = ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN); + ValueLayout vInt = ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN); //mimic pragma pack(1) GroupLayout g = MemoryLayout.structLayout(vChar.withBitAlignment(8).withName("a"), vShort.withBitAlignment(8).withName("b"), vInt.withBitAlignment(8).withName("c")); assertEquals(g.bitAlignment(), 8); - VarHandle vh_c = g.varHandle(byte.class, PathElement.groupElement("a")); - VarHandle vh_s = g.varHandle(short.class, PathElement.groupElement("b")); - VarHandle vh_i = g.varHandle(int.class, PathElement.groupElement("c")); + VarHandle vh_c = g.varHandle(PathElement.groupElement("a")); + VarHandle vh_s = g.varHandle(PathElement.groupElement("b")); + VarHandle vh_i = g.varHandle(PathElement.groupElement("c")); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(g, scope); vh_c.set(segment, Byte.MIN_VALUE); diff --git a/test/jdk/java/foreign/TestMemoryCopy.java b/test/jdk/java/foreign/TestMemoryCopy.java deleted file mode 100644 index cba9186f124..00000000000 --- a/test/jdk/java/foreign/TestMemoryCopy.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2019, 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 - * @run testng TestMemoryCopy - */ - -import jdk.incubator.foreign.MemoryLayouts; -import jdk.incubator.foreign.MemorySegment; -import jdk.incubator.foreign.ResourceScope; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; - -import java.lang.invoke.VarHandle; -import java.util.ArrayList; -import java.util.List; -import java.util.function.IntFunction; - -import static org.testng.Assert.*; - -public class TestMemoryCopy { - - final static VarHandle BYTE_HANDLE = MemoryLayouts.JAVA_BYTE.varHandle(byte.class); - - @Test(dataProvider = "slices") - public void testCopy(SegmentSlice s1, SegmentSlice s2) { - int size = Math.min(s1.size(), s2.size()); - //prepare source and target segments - for (int i = 0 ; i < size ; i++) { - BYTE_HANDLE.set(s2.segment.asSlice(i), (byte)0); - } - for (int i = 0 ; i < size ; i++) { - BYTE_HANDLE.set(s1.segment.asSlice(i), (byte) i); - } - //perform copy - s2.segment.copyFrom(s1.segment.asSlice(0, size)); - //check that copy actually worked - for (int i = 0 ; i < size ; i++) { - assertEquals((byte)i, BYTE_HANDLE.get(s2.segment.asSlice(i))); - } - } - - static class SegmentSlice { - - enum Kind { - NATIVE(i -> MemorySegment.allocateNative(i, ResourceScope.newImplicitScope())), - ARRAY(i -> MemorySegment.ofArray(new byte[i])); - - final IntFunction segmentFactory; - - Kind(IntFunction segmentFactory) { - this.segmentFactory = segmentFactory; - } - - MemorySegment makeSegment(int elems) { - return segmentFactory.apply(elems); - } - } - - final Kind kind; - final int first; - final int last; - final MemorySegment segment; - - public SegmentSlice(Kind kind, int first, int last, MemorySegment segment) { - this.kind = kind; - this.first = first; - this.last = last; - this.segment = segment; - } - - int size() { - return last - first + 1; - } - } - - @DataProvider(name = "slices") - static Object[][] slices() { - int[] sizes = { 16, 8, 4, 2, 1 }; - List slices = new ArrayList<>(); - for (SegmentSlice.Kind kind : SegmentSlice.Kind.values()) { - MemorySegment segment = kind.makeSegment(16); - //compute all slices - for (int size : sizes) { - for (int index = 0 ; index < 16 ; index += size) { - MemorySegment slice = segment.asSlice(index, size); - slices.add(new SegmentSlice(kind, index, index + size - 1, slice)); - } - } - } - Object[][] sliceArray = new Object[slices.size() * slices.size()][]; - for (int i = 0 ; i < slices.size() ; i++) { - for (int j = 0 ; j < slices.size() ; j++) { - sliceArray[i * slices.size() + j] = new Object[] { slices.get(i), slices.get(j) }; - } - } - return sliceArray; - } -} diff --git a/test/jdk/java/foreign/TestMemoryDereference.java b/test/jdk/java/foreign/TestMemoryDereference.java new file mode 100644 index 00000000000..c62380cc355 --- /dev/null +++ b/test/jdk/java/foreign/TestMemoryDereference.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2020, 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 + * @run testng TestMemoryDereference + */ + +import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.MemorySegment; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +import jdk.incubator.foreign.ValueLayout; +import org.testng.annotations.*; + +import static jdk.incubator.foreign.ValueLayout.ADDRESS; +import static jdk.incubator.foreign.ValueLayout.JAVA_BOOLEAN; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT; +import static org.testng.Assert.*; + +public class TestMemoryDereference { + + static class Accessor { + + interface SegmentGetter { + X get(MemorySegment segment); + } + + interface SegmentSetter { + void set(MemorySegment segment, X o); + } + + interface BufferGetter { + X get(ByteBuffer segment); + } + + interface BufferSetter { + void set(ByteBuffer buffer, X o); + } + + final X value; + final SegmentGetter segmentGetter; + final SegmentSetter segmentSetter; + final BufferGetter bufferGetter; + final BufferSetter bufferSetter; + + Accessor(X value, + SegmentGetter segmentGetter, SegmentSetter segmentSetter, + BufferGetter bufferGetter, BufferSetter bufferSetter) { + this.value = value; + this.segmentGetter = segmentGetter; + this.segmentSetter = segmentSetter; + this.bufferGetter = bufferGetter; + this.bufferSetter = bufferSetter; + } + + void test() { + MemorySegment segment = MemorySegment.ofArray(new byte[32]); + ByteBuffer buffer = segment.asByteBuffer(); + segmentSetter.set(segment, value); + assertEquals(bufferGetter.get(buffer), value); + bufferSetter.set(buffer, value); + assertEquals(value, segmentGetter.get(segment)); + } + + Accessor of(Z value, + SegmentGetter segmentGetter, SegmentSetter segmentSetter, + BufferGetter bufferGetter, BufferSetter bufferSetter) { + return new Accessor<>(value, segmentGetter, segmentSetter, bufferGetter, bufferSetter); + } + } + + @Test(dataProvider = "accessors") + public void testMemoryAccess(String testName, Accessor accessor) { + accessor.test(); + } + + static final ByteOrder BE = ByteOrder.BIG_ENDIAN; + static final ByteOrder LE = ByteOrder.LITTLE_ENDIAN; + static final ByteOrder NE = ByteOrder.nativeOrder(); + + @DataProvider(name = "accessors") + static Object[][] accessors() { + return new Object[][]{ + + // byte, offset + {"byte/offset", new Accessor<>((byte) 42, + s -> s.get(JAVA_BYTE, 8), (s, x) -> s.set(JAVA_BYTE, 8, x), + (bb) -> bb.get(8), (bb, v) -> bb.put(8, v)) + }, + // bool, offset + {"bool", new Accessor<>(false, + s -> s.get(JAVA_BOOLEAN, 8), (s, x) -> s.set(JAVA_BOOLEAN, 8, x), + (bb) -> bb.get(8) != 0, (bb, v) -> bb.put(8, v ? (byte)1 : (byte)0)) + }, + // char, offset + {"char/offset", new Accessor<>((char) 42, + s -> s.get(JAVA_CHAR, 8), (s, x) -> s.set(JAVA_CHAR, 8, x), + (bb) -> bb.order(NE).getChar(8), (bb, v) -> bb.order(NE).putChar(8, v)) + }, + {"char/offset/LE", new Accessor<>((char) 42, + s -> s.get(JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), 8), + (s, x) -> s.set(JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), 8, x), + (bb) -> bb.order(LE).getChar(8), (bb, v) -> bb.order(LE).putChar(8, v)) + }, + {"char/offset/BE", new Accessor<>((char) 42, + s -> s.get(JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), 8), + (s, x) -> s.set(JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), 8, x), + (bb) -> bb.order(BE).getChar(8), (bb, v) -> bb.order(BE).putChar(8, v)) + }, + // short, offset + {"short/offset", new Accessor<>((short) 42, + s -> s.get(JAVA_SHORT, 8), (s, x) -> s.set(JAVA_SHORT, 8, x), + (bb) -> bb.order(NE).getShort(8), (bb, v) -> bb.order(NE).putShort(8, v)) + }, + {"short/offset/LE", new Accessor<>((short) 42, + s -> s.get(JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), 8), + (s, x) -> s.set(JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), 8, x), + (bb) -> bb.order(LE).getShort(8), (bb, v) -> bb.order(LE).putShort(8, v)) + }, + {"short/offset/BE", new Accessor<>((short) 42, + s -> s.get(JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), 8), + (s, x) -> s.set(JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), 8, x), + (bb) -> bb.order(BE).getShort(8), (bb, v) -> bb.order(BE).putShort(8, v)) + }, + // int, offset + {"int/offset", new Accessor<>(42, + s -> s.get(JAVA_INT, 8), (s, x) -> s.set(JAVA_INT, 8, x), + (bb) -> bb.order(NE).getInt(8), (bb, v) -> bb.order(NE).putInt(8, v)) + }, + {"int/offset/LE", new Accessor<>(42, + s -> s.get(JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), 8), + (s, x) -> s.set(JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), 8, x), + (bb) -> bb.order(LE).getInt(8), (bb, v) -> bb.order(LE).putInt(8, v)) + }, + {"int/offset/BE", new Accessor<>(42, + s -> s.get(JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), 8), + (s, x) -> s.set(JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), 8, x), + (bb) -> bb.order(BE).getInt(8), (bb, v) -> bb.order(BE).putInt(8, v)) + }, + // float, offset + {"float/offset", new Accessor<>(42f, + s -> s.get(JAVA_FLOAT, 8), (s, x) -> s.set(JAVA_FLOAT, 8, x), + (bb) -> bb.order(NE).getFloat(8), (bb, v) -> bb.order(NE).putFloat(8, v)) + }, + {"float/offset/LE", new Accessor<>(42f, + s -> s.get(ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), 8), + (s, x) -> s.set(ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), 8, x), + (bb) -> bb.order(LE).getFloat(8), (bb, v) -> bb.order(LE).putFloat(8, v)) + }, + {"float/offset/BE", new Accessor<>(42f, + s -> s.get(ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), 8), + (s, x) -> s.set(ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), 8, x), + (bb) -> bb.order(BE).getFloat(8), (bb, v) -> bb.order(BE).putFloat(8, v)) + }, + // double, offset + {"double/offset", new Accessor<>(42d, + s -> s.get(JAVA_DOUBLE, 8), (s, x) -> s.set(JAVA_DOUBLE, 8, x), + (bb) -> bb.order(NE).getDouble(8), (bb, v) -> bb.order(NE).putDouble(8, v)) + }, + {"double/offset/LE", new Accessor<>(42d, + s -> s.get(ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), 8), + (s, x) -> s.set(ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), 8, x), + (bb) -> bb.order(LE).getDouble(8), (bb, v) -> bb.order(LE).putDouble(8, v)) + }, + {"double/offset/BE", new Accessor<>(42d, + s -> s.get(ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), 8), + (s, x) -> s.set(ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), 8, x), + (bb) -> bb.order(BE).getDouble(8), (bb, v) -> bb.order(BE).putDouble(8, v)) + }, + { "address/offset", new Accessor<>(MemoryAddress.ofLong(42), + s -> s.get(ADDRESS, 8), (s, x) -> s.set(ADDRESS, 8, x), + (bb) -> { + ByteBuffer nb = bb.order(NE); + long addr = ValueLayout.ADDRESS.byteSize() == 8 ? + nb.getLong(8) : nb.getInt(8); + return MemoryAddress.ofLong(addr); + }, + (bb, v) -> { + ByteBuffer nb = bb.order(NE); + if (ValueLayout.ADDRESS.byteSize() == 8) { + nb.putLong(8, v.toRawLongValue()); + } else { + nb.putInt(8, (int)v.toRawLongValue()); + } + }) + }, + }; + } +} diff --git a/test/jdk/java/foreign/TestMemoryHandleAsUnsigned.java b/test/jdk/java/foreign/TestMemoryHandleAsUnsigned.java index d4a6e536234..71ef6fe2999 100644 --- a/test/jdk/java/foreign/TestMemoryHandleAsUnsigned.java +++ b/test/jdk/java/foreign/TestMemoryHandleAsUnsigned.java @@ -25,14 +25,15 @@ import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemoryLayout.PathElement; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; import java.util.Arrays; import java.util.stream.IntStream; import java.util.stream.LongStream; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; import static java.nio.ByteOrder.BIG_ENDIAN; import static org.testng.Assert.*; @@ -54,8 +55,8 @@ public class TestMemoryHandleAsUnsigned { public void testUnsignedIntToByte(int intValue) { byte byteValue = (byte) (intValue & 0xFF); - MemoryLayout layout = MemoryLayouts.BITS_8_BE; - VarHandle byteHandle = layout.varHandle(byte.class); + MemoryLayout layout = ValueLayout.JAVA_BYTE; + VarHandle byteHandle = layout.varHandle(); VarHandle intHandle = MemoryHandles.asUnsigned(byteHandle, int.class); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -77,8 +78,8 @@ public class TestMemoryHandleAsUnsigned { public void testUnsignedLongToByte(long longValue) { byte byteValue = (byte) (longValue & 0xFFL); - MemoryLayout layout = MemoryLayouts.BITS_8_BE; - VarHandle byteHandle = layout.varHandle(byte.class); + MemoryLayout layout = ValueLayout.JAVA_BYTE; + VarHandle byteHandle = layout.varHandle(); VarHandle longHandle = MemoryHandles.asUnsigned(byteHandle, long.class); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -100,8 +101,8 @@ public class TestMemoryHandleAsUnsigned { public void testUnsignedIntToShort(int intValue) { short shortValue = (short) (intValue & 0xFFFF); - MemoryLayout layout = MemoryLayouts.BITS_16_BE; - VarHandle shortHandle = layout.varHandle(short.class); + MemoryLayout layout = ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN); + VarHandle shortHandle = layout.varHandle(); VarHandle intHandle = MemoryHandles.asUnsigned(shortHandle, int.class); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -123,8 +124,8 @@ public class TestMemoryHandleAsUnsigned { public void testUnsignedLongToShort(long longValue) { short shortValue = (short) (longValue & 0xFFFFL); - MemoryLayout layout = MemoryLayouts.BITS_16_BE; - VarHandle shortHandle = layout.varHandle(short.class); + MemoryLayout layout = ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN); + VarHandle shortHandle = layout.varHandle(); VarHandle longHandle = MemoryHandles.asUnsigned(shortHandle, long.class); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -150,8 +151,8 @@ public class TestMemoryHandleAsUnsigned { public void testUnsignedLongToInt(long longValue) { int intValue = (int) (longValue & 0xFFFF_FFFFL); - MemoryLayout layout = MemoryLayouts.BITS_32_BE; - VarHandle intHandle = layout.varHandle(int.class); + MemoryLayout layout = ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN); + VarHandle intHandle = layout.varHandle(); VarHandle longHandle = MemoryHandles.asUnsigned(intHandle, long.class); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -165,8 +166,8 @@ public class TestMemoryHandleAsUnsigned { @Test public void testCoordinatesSequenceLayout() { - MemoryLayout layout = MemoryLayout.sequenceLayout(2, MemoryLayouts.BITS_8_BE); - VarHandle byteHandle = layout.varHandle(byte.class, PathElement.sequenceElement()); + MemoryLayout layout = MemoryLayout.sequenceLayout(2, ValueLayout.JAVA_BYTE); + VarHandle byteHandle = layout.varHandle(PathElement.sequenceElement()); VarHandle intHandle = MemoryHandles.asUnsigned(byteHandle, int.class); try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -184,14 +185,14 @@ public class TestMemoryHandleAsUnsigned { MemorySegment segment = MemorySegment.ofArray(arr); { - VarHandle byteHandle = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_BYTE) - .varHandle(byte.class, PathElement.sequenceElement()); + VarHandle byteHandle = MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE) + .varHandle(PathElement.sequenceElement()); VarHandle intHandle = MemoryHandles.asUnsigned(byteHandle, int.class); assertEquals((int) intHandle.get(segment, 2L), 129); } { - VarHandle byteHandle = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_BYTE) - .varHandle(byte.class, PathElement.sequenceElement()); + VarHandle byteHandle = MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE) + .varHandle(PathElement.sequenceElement()); VarHandle intHandle = MemoryHandles.asUnsigned(byteHandle, int.class); assertEquals((int) intHandle.get(segment, 2L), 129); } @@ -201,7 +202,7 @@ public class TestMemoryHandleAsUnsigned { @Test public void testNull() { - VarHandle handle = MemoryHandles.varHandle(byte.class, BIG_ENDIAN); + VarHandle handle = MemoryHandles.varHandle(ValueLayout.JAVA_BYTE.withOrder(BIG_ENDIAN)); assertThrows(NPE, () -> MemoryHandles.asUnsigned(handle, null)); assertThrows(NPE, () -> MemoryHandles.asUnsigned(null, short.class)); assertThrows(NPE, () -> MemoryHandles.asUnsigned(null, null)); @@ -209,22 +210,22 @@ public class TestMemoryHandleAsUnsigned { static final Class IAE = IllegalArgumentException.class; - static void assertIllegalArgumentExceptionIllegalCarrier(Class carrier, Class adaptedType) { - var vh = MemoryHandles.varHandle(carrier, BIG_ENDIAN); + static void assertIllegalArgumentExceptionIllegalCarrier(ValueLayout layout, Class adaptedType) { + var vh = MemoryHandles.varHandle(layout.withOrder(BIG_ENDIAN)); var exception = expectThrows(IAE, () -> MemoryHandles.asUnsigned(vh, adaptedType)); var msg = exception.getMessage(); assertTrue(msg.contains("illegal carrier"), "Expected \"illegal carrier\" in:[" + msg +"]"); } - static void assertIllegalArgumentExceptionIllegalAdapter(Class carrier, Class adaptedType) { - var vh = MemoryHandles.varHandle(carrier, BIG_ENDIAN); + static void assertIllegalArgumentExceptionIllegalAdapter(ValueLayout layout, Class adaptedType) { + var vh = MemoryHandles.varHandle(layout.withOrder(BIG_ENDIAN)); var exception = expectThrows(IAE, () -> MemoryHandles.asUnsigned(vh, adaptedType)); var msg = exception.getMessage(); assertTrue(msg.contains("illegal adapter type"), "Expected \"illegal adapter type\" in:[" + msg +"]"); } - static void assertIllegalArgumentExceptionIsNotWiderThan(Class carrier, Class adaptedType) { - var vh = MemoryHandles.varHandle(carrier, BIG_ENDIAN); + static void assertIllegalArgumentExceptionIsNotWiderThan(ValueLayout layout, Class adaptedType) { + var vh = MemoryHandles.varHandle(layout.withOrder(BIG_ENDIAN)); var exception = expectThrows(IAE, () -> MemoryHandles.asUnsigned(vh, adaptedType)); var msg = exception.getMessage(); assertTrue(msg.contains("is not wider than"), "Expected \"is not wider than\" in:[" + msg +"]"); @@ -232,25 +233,25 @@ public class TestMemoryHandleAsUnsigned { @Test public void testIllegalArgumentException() { - assertIllegalArgumentExceptionIllegalCarrier(char.class, long.class); - assertIllegalArgumentExceptionIllegalCarrier(double.class, long.class); - assertIllegalArgumentExceptionIllegalCarrier(float.class, long.class); - assertIllegalArgumentExceptionIllegalCarrier(long.class, long.class); - - assertIllegalArgumentExceptionIllegalAdapter(byte.class, void.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, byte.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, short.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, char.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, double.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, float.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, Object.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, Integer.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, Long.class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, long[].class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, int[].class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, Integer[].class); - assertIllegalArgumentExceptionIllegalAdapter(byte.class, Long[].class); - - assertIllegalArgumentExceptionIsNotWiderThan(int.class, int.class); + assertIllegalArgumentExceptionIllegalCarrier(ValueLayout.JAVA_CHAR, long.class); + assertIllegalArgumentExceptionIllegalCarrier(ValueLayout.JAVA_DOUBLE, long.class); + assertIllegalArgumentExceptionIllegalCarrier(ValueLayout.JAVA_FLOAT, long.class); + assertIllegalArgumentExceptionIllegalCarrier(ValueLayout.JAVA_LONG, long.class); + + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, void.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, byte.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, short.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, char.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, double.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, float.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, Object.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, Integer.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, Long.class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, long[].class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, int[].class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, Integer[].class); + assertIllegalArgumentExceptionIllegalAdapter(ValueLayout.JAVA_BYTE, Long[].class); + + assertIllegalArgumentExceptionIsNotWiderThan(ValueLayout.JAVA_INT, int.class); } } diff --git a/test/jdk/java/foreign/TestMismatch.java b/test/jdk/java/foreign/TestMismatch.java index 5f4dd4c3195..a399a20d9b8 100644 --- a/test/jdk/java/foreign/TestMismatch.java +++ b/test/jdk/java/foreign/TestMismatch.java @@ -32,9 +32,9 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.function.IntFunction; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static java.lang.System.out; @@ -43,7 +43,7 @@ import static org.testng.Assert.assertThrows; public class TestMismatch { - final static VarHandle BYTE_HANDLE = MemoryLayouts.JAVA_BYTE.varHandle(byte.class); + final static VarHandle BYTE_HANDLE = ValueLayout.JAVA_BYTE.varHandle(); // stores a increasing sequence of values into the memory of the given segment static MemorySegment initializeSegment(MemorySegment segment) { @@ -112,7 +112,7 @@ public class TestMismatch { @Test public void testLarge() { // skip if not on 64 bits - if (MemoryLayouts.ADDRESS.byteSize() > 32) { + if (ValueLayout.ADDRESS.byteSize() > 32) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { var s1 = MemorySegment.allocateNative((long) Integer.MAX_VALUE + 10L, 8, scope); var s2 = MemorySegment.allocateNative((long) Integer.MAX_VALUE + 10L, 8, scope); diff --git a/test/jdk/java/foreign/TestNULLAddress.java b/test/jdk/java/foreign/TestNULLAddress.java index 7ea4cbb974f..14aec5fb757 100644 --- a/test/jdk/java/foreign/TestNULLAddress.java +++ b/test/jdk/java/foreign/TestNULLAddress.java @@ -34,39 +34,37 @@ import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; import org.testng.annotations.Test; import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodType; -import java.nio.charset.Charset; public class TestNULLAddress { - static final CLinker LINKER = CLinker.getInstance(); + static final CLinker LINKER = CLinker.systemCLinker(); @Test(expectedExceptions = IllegalArgumentException.class) public void testNULLLinking() { LINKER.downcallHandle( - MemoryAddress.NULL, - MethodType.methodType(void.class), + NativeSymbol.ofAddress("nullAddress", MemoryAddress.NULL, ResourceScope.globalScope()), FunctionDescriptor.ofVoid()); } @Test(expectedExceptions = IllegalArgumentException.class) public void testNULLVirtual() throws Throwable { MethodHandle mh = LINKER.downcallHandle( - MethodType.methodType(void.class), FunctionDescriptor.ofVoid()); - mh.invokeExact((Addressable) MemoryAddress.NULL); + mh.invokeExact(NativeSymbol.ofAddress("null", MemoryAddress.NULL, ResourceScope.globalScope())); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testNULLtoJavaString() { - CLinker.toJavaString(MemoryAddress.NULL); + public void testNULLgetString() { + MemoryAddress.NULL.getUtf8String(0); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testNULLfreeMemory() { - CLinker.freeMemory(MemoryAddress.NULL); + public void testNULLsetString() { + MemoryAddress.NULL.setUtf8String(0, "hello"); } } diff --git a/test/jdk/java/foreign/TestNative.java b/test/jdk/java/foreign/TestNative.java index 443c13b11d5..0b6a6cdfb8d 100644 --- a/test/jdk/java/foreign/TestNative.java +++ b/test/jdk/java/foreign/TestNative.java @@ -29,15 +29,13 @@ * @run testng/othervm --enable-native-access=ALL-UNNAMED TestNative */ -import jdk.incubator.foreign.CLinker; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemoryLayout.PathElement; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SequenceLayout; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -56,45 +54,46 @@ import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; import static org.testng.Assert.*; -public class TestNative { +public class TestNative extends NativeTestHelper { static SequenceLayout bytes = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_BYTE.withOrder(ByteOrder.nativeOrder()) + ValueLayout.JAVA_BYTE.withOrder(ByteOrder.nativeOrder()) ); static SequenceLayout chars = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_CHAR.withOrder(ByteOrder.nativeOrder()) + ValueLayout.JAVA_CHAR.withOrder(ByteOrder.nativeOrder()) ); static SequenceLayout shorts = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_SHORT.withOrder(ByteOrder.nativeOrder()) + ValueLayout.JAVA_SHORT.withOrder(ByteOrder.nativeOrder()) ); static SequenceLayout ints = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_INT.withOrder(ByteOrder.nativeOrder()) + JAVA_INT.withOrder(ByteOrder.nativeOrder()) ); static SequenceLayout floats = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_FLOAT.withOrder(ByteOrder.nativeOrder()) + ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.nativeOrder()) ); static SequenceLayout longs = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_LONG.withOrder(ByteOrder.nativeOrder()) + ValueLayout.JAVA_LONG.withOrder(ByteOrder.nativeOrder()) ); static SequenceLayout doubles = MemoryLayout.sequenceLayout(100, - MemoryLayouts.JAVA_DOUBLE.withOrder(ByteOrder.nativeOrder()) + ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.nativeOrder()) ); - static VarHandle byteHandle = bytes.varHandle(byte.class, PathElement.sequenceElement()); - static VarHandle charHandle = chars.varHandle(char.class, PathElement.sequenceElement()); - static VarHandle shortHandle = shorts.varHandle(short.class, PathElement.sequenceElement()); - static VarHandle intHandle = ints.varHandle(int.class, PathElement.sequenceElement()); - static VarHandle floatHandle = floats.varHandle(float.class, PathElement.sequenceElement()); - static VarHandle longHandle = doubles.varHandle(long.class, PathElement.sequenceElement()); - static VarHandle doubleHandle = longs.varHandle(double.class, PathElement.sequenceElement()); + static VarHandle byteHandle = bytes.varHandle(PathElement.sequenceElement()); + static VarHandle charHandle = chars.varHandle(PathElement.sequenceElement()); + static VarHandle shortHandle = shorts.varHandle(PathElement.sequenceElement()); + static VarHandle intHandle = ints.varHandle(PathElement.sequenceElement()); + static VarHandle floatHandle = floats.varHandle(PathElement.sequenceElement()); + static VarHandle longHandle = longs.varHandle(PathElement.sequenceElement()); + static VarHandle doubleHandle = doubles.varHandle(PathElement.sequenceElement()); static void initBytes(MemorySegment base, SequenceLayout seq, BiConsumer handleSetter) { for (long i = 0; i < seq.elementCount().getAsLong() ; i++) { @@ -144,14 +143,6 @@ public class TestNative { public static native long getCapacity(Buffer buffer); - public static MemoryAddress allocate(int size) { - return CLinker.allocateMemory(size); - } - - public static void free(MemoryAddress addr) { - CLinker.freeMemory(addr); - } - @Test(dataProvider="nativeAccessOps") public void testNativeAccess(Consumer checker, Consumer initializer, SequenceLayout seq) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { @@ -176,25 +167,21 @@ public class TestNative { @Test public void testDefaultAccessModes() { - MemoryAddress addr = allocate(12); + MemoryAddress addr = allocateMemory(12); try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment mallocSegment = addr.asSegment(12, () -> free(addr), scope); + scope.addCloseAction(() -> freeMemory(addr)); + MemorySegment mallocSegment = MemorySegment.ofAddress(addr, 12, scope); assertFalse(mallocSegment.isReadOnly()); } } - @Test - public void testDefaultAccessModesEverthing() { - MemorySegment everything = MemorySegment.globalNativeSegment(); - assertFalse(everything.isReadOnly()); - } - @Test public void testMallocSegment() { - MemoryAddress addr = allocate(12); + MemoryAddress addr = allocateMemory(12); MemorySegment mallocSegment = null; try (ResourceScope scope = ResourceScope.newConfinedScope()) { - mallocSegment = addr.asSegment(12, () -> free(addr), scope); + scope.addCloseAction(() -> freeMemory(addr)); + mallocSegment = MemorySegment.ofAddress(addr, 12, scope); assertEquals(mallocSegment.byteSize(), 12); //free here } @@ -202,19 +189,18 @@ public class TestNative { } @Test - public void testEverythingSegment() { - MemoryAddress addr = allocate(4); - MemorySegment everything = MemorySegment.globalNativeSegment(); - MemoryAccess.setIntAtOffset(everything, addr.toRawLongValue(), 42); - assertEquals(MemoryAccess.getIntAtOffset(everything, addr.toRawLongValue()), 42); - free(addr); + public void testAddressAccess() { + MemoryAddress addr = allocateMemory(4); + addr.set(JAVA_INT, 0, 42); + assertEquals(addr.get(JAVA_INT, 0), 42); + freeMemory(addr); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadResize() { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(4, 1, scope); - segment.address().asSegment(0, ResourceScope.globalScope()); + MemorySegment.ofAddress(segment.address(), 0, ResourceScope.globalScope()); } } diff --git a/test/jdk/java/foreign/TestNoForeignUnsafeOverride.java b/test/jdk/java/foreign/TestNoForeignUnsafeOverride.java index ac47ea3113f..d5aa76dc541 100644 --- a/test/jdk/java/foreign/TestNoForeignUnsafeOverride.java +++ b/test/jdk/java/foreign/TestNoForeignUnsafeOverride.java @@ -28,7 +28,7 @@ import jdk.incubator.foreign.*; public class PanamaMain { public static void main(String[] args) { System.out.println("Trying to get CLinker"); - CLinker.getInstance(); + CLinker.systemCLinker(); System.out.println("Got CLinker"); } } diff --git a/test/jdk/java/foreign/TestNulls.java b/test/jdk/java/foreign/TestNulls.java index ccb27a61d35..7f57108b5d2 100644 --- a/test/jdk/java/foreign/TestNulls.java +++ b/test/jdk/java/foreign/TestNulls.java @@ -60,6 +60,8 @@ import java.util.function.UnaryOperator; import java.util.stream.Collectors; import java.util.stream.Stream; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; import static org.testng.Assert.*; import static org.testng.Assert.fail; @@ -82,27 +84,43 @@ public class TestNulls { MemoryLayout.PathElement.class, SequenceLayout.class, ValueLayout.class, + ValueLayout.OfBoolean.class, + ValueLayout.OfByte.class, + ValueLayout.OfChar.class, + ValueLayout.OfShort.class, + ValueLayout.OfInt.class, + ValueLayout.OfFloat.class, + ValueLayout.OfLong.class, + ValueLayout.OfDouble.class, + ValueLayout.OfAddress.class, GroupLayout.class, Addressable.class, SymbolLookup.class, - MemoryAccess.class, - MemoryLayouts.class, MemoryHandles.class, CLinker.class, - CLinker.VaList.class, - CLinker.VaList.Builder.class, + VaList.class, + VaList.Builder.class, FunctionDescriptor.class, SegmentAllocator.class, - ResourceScope.class + ResourceScope.class, + NativeSymbol.class }; static final Set EXCLUDE_LIST = Set.of( + "jdk.incubator.foreign.ResourceScope/newConfinedScope(java.lang.ref.Cleaner)/0/0", + "jdk.incubator.foreign.ResourceScope/newSharedScope(java.lang.ref.Cleaner)/0/0", "jdk.incubator.foreign.MemoryLayout/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", - "jdk.incubator.foreign.MemoryAddress/asSegment(long,java.lang.Runnable,java.lang.Object)/1/0", - "jdk.incubator.foreign.MemoryAddress/asSegment(long,java.lang.Runnable,java.lang.Object)/2/0", - "jdk.incubator.foreign.MemoryAddress/asSegment(long,java.lang.Runnable,jdk.incubator.foreign.ResourceScope)/1/0", "jdk.incubator.foreign.SequenceLayout/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", "jdk.incubator.foreign.ValueLayout/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfAddress/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfBoolean/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfByte/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfChar/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfShort/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfInt/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfFloat/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfLong/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", + "jdk.incubator.foreign.ValueLayout$OfDouble/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", "jdk.incubator.foreign.GroupLayout/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0", "jdk.incubator.foreign.MemoryHandles/insertCoordinates(java.lang.invoke.VarHandle,int,java.lang.Object[])/2/1", "jdk.incubator.foreign.FunctionDescriptor/withAttribute(java.lang.String,java.lang.constant.Constable)/1/0" @@ -139,7 +157,7 @@ public class TestNulls { addDefaultMapping(Class.class, String.class); addDefaultMapping(Runnable.class, () -> {}); addDefaultMapping(Object.class, new Object()); - addDefaultMapping(VarHandle.class, MemoryHandles.varHandle(int.class, ByteOrder.nativeOrder())); + addDefaultMapping(VarHandle.class, MemoryHandles.varHandle(JAVA_INT)); addDefaultMapping(MethodHandle.class, MethodHandles.identity(int.class)); addDefaultMapping(List.class, List.of()); addDefaultMapping(Charset.class, Charset.defaultCharset()); @@ -147,32 +165,41 @@ public class TestNulls { addDefaultMapping(MethodType.class, MethodType.methodType(void.class)); addDefaultMapping(MemoryAddress.class, MemoryAddress.ofLong(1)); addDefaultMapping(Addressable.class, MemoryAddress.ofLong(1)); - addDefaultMapping(MemoryLayout.class, MemoryLayouts.JAVA_INT); - addDefaultMapping(ValueLayout.class, MemoryLayouts.JAVA_INT); - addDefaultMapping(GroupLayout.class, MemoryLayout.structLayout(MemoryLayouts.JAVA_INT)); - addDefaultMapping(SequenceLayout.class, MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT)); + addDefaultMapping(MemoryLayout.class, ValueLayout.JAVA_INT); + addDefaultMapping(ValueLayout.class, ValueLayout.JAVA_INT); + addDefaultMapping(ValueLayout.OfAddress.class, ValueLayout.ADDRESS); + addDefaultMapping(ValueLayout.OfByte.class, ValueLayout.JAVA_BYTE); + addDefaultMapping(ValueLayout.OfBoolean.class, ValueLayout.JAVA_BOOLEAN); + addDefaultMapping(ValueLayout.OfChar.class, ValueLayout.JAVA_CHAR); + addDefaultMapping(ValueLayout.OfShort.class, ValueLayout.JAVA_SHORT); + addDefaultMapping(ValueLayout.OfInt.class, ValueLayout.JAVA_INT); + addDefaultMapping(ValueLayout.OfFloat.class, ValueLayout.JAVA_FLOAT); + addDefaultMapping(ValueLayout.OfLong.class, JAVA_LONG); + addDefaultMapping(ValueLayout.OfDouble.class, ValueLayout.JAVA_DOUBLE); + addDefaultMapping(GroupLayout.class, MemoryLayout.structLayout(ValueLayout.JAVA_INT)); + addDefaultMapping(SequenceLayout.class, MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT)); addDefaultMapping(MemorySegment.class, MemorySegment.ofArray(new byte[10])); addDefaultMapping(FunctionDescriptor.class, FunctionDescriptor.ofVoid()); - addDefaultMapping(CLinker.class, CLinker.getInstance()); - addDefaultMapping(CLinker.VaList.class, VaListHelper.vaList); - addDefaultMapping(CLinker.VaList.Builder.class, VaListHelper.vaListBuilder); - addDefaultMapping(ResourceScope.class, ResourceScope.newImplicitScope()); - addDefaultMapping(SegmentAllocator.class, (size, align) -> null); + addDefaultMapping(CLinker.class, CLinker.systemCLinker()); + addDefaultMapping(VaList.class, VaListHelper.vaList); + addDefaultMapping(VaList.Builder.class, VaListHelper.vaListBuilder); + addDefaultMapping(ResourceScope.class, ResourceScope.newSharedScope()); + addDefaultMapping(SegmentAllocator.class, SegmentAllocator.prefixAllocator(MemorySegment.ofArray(new byte[10]))); addDefaultMapping(Supplier.class, () -> null); - addDefaultMapping(ResourceScope.Handle.class, ResourceScope.globalScope().acquire()); addDefaultMapping(ClassLoader.class, TestNulls.class.getClassLoader()); - addDefaultMapping(SymbolLookup.class, CLinker.systemLookup()); + addDefaultMapping(SymbolLookup.class, CLinker.systemCLinker()); + addDefaultMapping(NativeSymbol.class, NativeSymbol.ofAddress("dummy", MemoryAddress.ofLong(1), ResourceScope.globalScope())); } static class VaListHelper { - static final CLinker.VaList vaList; - static final CLinker.VaList.Builder vaListBuilder; + static final VaList vaList; + static final VaList.Builder vaListBuilder; static { - AtomicReference builderRef = new AtomicReference<>(); - vaList = CLinker.VaList.make(b -> { + AtomicReference builderRef = new AtomicReference<>(); + vaList = VaList.make(b -> { builderRef.set(b); - b.vargFromLong(CLinker.C_LONG_LONG, 42L); + b.addVarg(JAVA_LONG, 42L); }, ResourceScope.newImplicitScope()); vaListBuilder = builderRef.get(); } diff --git a/test/jdk/java/foreign/TestReshape.java b/test/jdk/java/foreign/TestReshape.java index dc53e83ee0f..4fcfb5eb210 100644 --- a/test/jdk/java/foreign/TestReshape.java +++ b/test/jdk/java/foreign/TestReshape.java @@ -27,7 +27,6 @@ */ import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.SequenceLayout; import java.util.ArrayList; @@ -35,6 +34,7 @@ import java.util.Iterator; import java.util.List; import java.util.stream.LongStream; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; import static org.testng.Assert.*; @@ -54,43 +54,43 @@ public class TestReshape { @Test(expectedExceptions = IllegalArgumentException.class) public void testInvalidReshape() { - SequenceLayout seq = MemoryLayout.sequenceLayout(4, MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(4, ValueLayout.JAVA_INT); seq.reshape(3, 2); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadReshapeInference() { - SequenceLayout seq = MemoryLayout.sequenceLayout(4, MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(4, ValueLayout.JAVA_INT); seq.reshape(-1, -1); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadReshapeParameterZero() { - SequenceLayout seq = MemoryLayout.sequenceLayout(4, MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(4, ValueLayout.JAVA_INT); seq.reshape(0, 4); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadReshapeParameterNegative() { - SequenceLayout seq = MemoryLayout.sequenceLayout(4, MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(4, ValueLayout.JAVA_INT); seq.reshape(-2, 2); } @Test(expectedExceptions = UnsupportedOperationException.class) public void testReshapeOnUnboundSequence() { - SequenceLayout seq = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT); seq.reshape(3, 2); } @Test(expectedExceptions = UnsupportedOperationException.class) public void testFlattenOnUnboundSequence() { - SequenceLayout seq = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT); + SequenceLayout seq = MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT); seq.flatten(); } @Test(expectedExceptions = UnsupportedOperationException.class) public void testFlattenOnUnboundNestedSequence() { - SequenceLayout seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT)); + SequenceLayout seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT)); seq.flatten(); } @@ -125,61 +125,61 @@ public class TestReshape { } static MemoryLayout POINT = MemoryLayout.structLayout( - MemoryLayouts.JAVA_INT, - MemoryLayouts.JAVA_INT + ValueLayout.JAVA_INT, + ValueLayout.JAVA_INT ); @DataProvider(name = "shapes") Object[][] shapes() { return new Object[][] { - { MemoryLayouts.JAVA_BYTE, new long[] { 256 } }, - { MemoryLayouts.JAVA_BYTE, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_BYTE, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_BYTE, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_BYTE, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_BYTE, new long[] { 8, 16, 2 } }, - - { MemoryLayouts.JAVA_SHORT, new long[] { 256 } }, - { MemoryLayouts.JAVA_SHORT, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_SHORT, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_SHORT, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_SHORT, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_SHORT, new long[] { 8, 16, 2 } }, - - { MemoryLayouts.JAVA_CHAR, new long[] { 256 } }, - { MemoryLayouts.JAVA_CHAR, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_CHAR, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_CHAR, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_CHAR, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_CHAR, new long[] { 8, 16, 2 } }, - - { MemoryLayouts.JAVA_INT, new long[] { 256 } }, - { MemoryLayouts.JAVA_INT, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_INT, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_INT, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_INT, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_INT, new long[] { 8, 16, 2 } }, - - { MemoryLayouts.JAVA_LONG, new long[] { 256 } }, - { MemoryLayouts.JAVA_LONG, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_LONG, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_LONG, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_LONG, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_LONG, new long[] { 8, 16, 2 } }, - - { MemoryLayouts.JAVA_FLOAT, new long[] { 256 } }, - { MemoryLayouts.JAVA_FLOAT, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_FLOAT, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_FLOAT, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_FLOAT, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_FLOAT, new long[] { 8, 16, 2 } }, - - { MemoryLayouts.JAVA_DOUBLE, new long[] { 256 } }, - { MemoryLayouts.JAVA_DOUBLE, new long[] { 16, 16 } }, - { MemoryLayouts.JAVA_DOUBLE, new long[] { 4, 4, 4, 4 } }, - { MemoryLayouts.JAVA_DOUBLE, new long[] { 2, 8, 16 } }, - { MemoryLayouts.JAVA_DOUBLE, new long[] { 16, 8, 2 } }, - { MemoryLayouts.JAVA_DOUBLE, new long[] { 8, 16, 2 } }, + { ValueLayout.JAVA_BYTE, new long[] { 256 } }, + { ValueLayout.JAVA_BYTE, new long[] { 16, 16 } }, + { ValueLayout.JAVA_BYTE, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_BYTE, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_BYTE, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_BYTE, new long[] { 8, 16, 2 } }, + + { ValueLayout.JAVA_SHORT, new long[] { 256 } }, + { ValueLayout.JAVA_SHORT, new long[] { 16, 16 } }, + { ValueLayout.JAVA_SHORT, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_SHORT, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_SHORT, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_SHORT, new long[] { 8, 16, 2 } }, + + { ValueLayout.JAVA_CHAR, new long[] { 256 } }, + { ValueLayout.JAVA_CHAR, new long[] { 16, 16 } }, + { ValueLayout.JAVA_CHAR, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_CHAR, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_CHAR, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_CHAR, new long[] { 8, 16, 2 } }, + + { ValueLayout.JAVA_INT, new long[] { 256 } }, + { ValueLayout.JAVA_INT, new long[] { 16, 16 } }, + { ValueLayout.JAVA_INT, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_INT, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_INT, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_INT, new long[] { 8, 16, 2 } }, + + { ValueLayout.JAVA_LONG, new long[] { 256 } }, + { ValueLayout.JAVA_LONG, new long[] { 16, 16 } }, + { ValueLayout.JAVA_LONG, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_LONG, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_LONG, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_LONG, new long[] { 8, 16, 2 } }, + + { ValueLayout.JAVA_FLOAT, new long[] { 256 } }, + { ValueLayout.JAVA_FLOAT, new long[] { 16, 16 } }, + { ValueLayout.JAVA_FLOAT, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_FLOAT, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_FLOAT, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_FLOAT, new long[] { 8, 16, 2 } }, + + { ValueLayout.JAVA_DOUBLE, new long[] { 256 } }, + { ValueLayout.JAVA_DOUBLE, new long[] { 16, 16 } }, + { ValueLayout.JAVA_DOUBLE, new long[] { 4, 4, 4, 4 } }, + { ValueLayout.JAVA_DOUBLE, new long[] { 2, 8, 16 } }, + { ValueLayout.JAVA_DOUBLE, new long[] { 16, 8, 2 } }, + { ValueLayout.JAVA_DOUBLE, new long[] { 8, 16, 2 } }, { POINT, new long[] { 256 } }, { POINT, new long[] { 16, 16 } }, diff --git a/test/jdk/java/foreign/TestResourceScope.java b/test/jdk/java/foreign/TestResourceScope.java index bb126abbe8a..77c436bca89 100644 --- a/test/jdk/java/foreign/TestResourceScope.java +++ b/test/jdk/java/foreign/TestResourceScope.java @@ -39,6 +39,7 @@ import static org.testng.Assert.*; import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; @@ -157,15 +158,14 @@ public class TestResourceScope { } } - @Test(dataProvider = "cleaners") - public void testLockSingleThread(Supplier cleanerSupplier) { - Cleaner cleaner = cleanerSupplier.get(); - ResourceScope scope = cleaner != null ? - ResourceScope.newConfinedScope(cleaner) : - ResourceScope.newConfinedScope(); - List handles = new ArrayList<>(); + @Test + public void testLockSingleThread() { + ResourceScope scope = ResourceScope.newConfinedScope(); + List handles = new ArrayList<>(); for (int i = 0 ; i < N_THREADS ; i++) { - handles.add(scope.acquire()); + ResourceScope handle = ResourceScope.newConfinedScope(); + handle.keepAlive(scope); + handles.add(handle); } while (true) { @@ -175,31 +175,24 @@ public class TestResourceScope { break; } catch (IllegalStateException ex) { assertTrue(handles.size() > 0); - ResourceScope.Handle handle = handles.remove(0); - scope.release(handle); - scope.release(handle); // make sure it's idempotent - scope.release(handle); // make sure it's idempotent + ResourceScope handle = handles.remove(0); + handle.close(); } } } - @Test(dataProvider = "cleaners") - public void testLockSharedMultiThread(Supplier cleanerSupplier) { - Cleaner cleaner = cleanerSupplier.get(); - ResourceScope scope = cleaner != null ? - ResourceScope.newSharedScope(cleaner) : - ResourceScope.newSharedScope(); + @Test + public void testLockSharedMultiThread() { + ResourceScope scope = ResourceScope.newSharedScope(); AtomicInteger lockCount = new AtomicInteger(); for (int i = 0 ; i < N_THREADS ; i++) { new Thread(() -> { - try { - ResourceScope.Handle handle = scope.acquire(); // this can throw if segment has been closed + try (ResourceScope handle = ResourceScope.newConfinedScope()) { + handle.keepAlive(scope); lockCount.incrementAndGet(); waitSomeTime(); lockCount.decrementAndGet(); - scope.release(handle); // cannot throw (acquired segments cannot be closed) - scope.release(handle); // cannot throw (idempotent) - scope.release(handle); // cannot throw (idempotent) + handle.close(); } catch (IllegalStateException ex) { // might be already closed - do nothing } @@ -230,13 +223,12 @@ public class TestResourceScope { @Test public void testCloseConfinedLock() { ResourceScope scope = ResourceScope.newConfinedScope(); - ResourceScope.Handle handle = scope.acquire(); + ResourceScope handle = ResourceScope.newConfinedScope(); + handle.keepAlive(scope); AtomicReference failure = new AtomicReference<>(); Thread t = new Thread(() -> { try { - scope.release(handle); - scope.release(handle); // make sure it's idempotent - scope.release(handle); // make sure it's idempotent + handle.close(); } catch (Throwable ex) { failure.set(ex); } @@ -255,24 +247,85 @@ public class TestResourceScope { public void testScopeHandles(Supplier scopeFactory) { ResourceScope scope = scopeFactory.get(); acquireRecursive(scope, 5); - if (!scope.isImplicit()) { + if (scope != ResourceScope.globalScope()) { scope.close(); } } + @Test(dataProvider = "scopes", expectedExceptions = IllegalArgumentException.class) + public void testAcquireSelf(Supplier scopeSupplier) { + ResourceScope scope = scopeSupplier.get(); + scope.keepAlive(scope); + } + private void acquireRecursive(ResourceScope scope, int acquireCount) { - ResourceScope.Handle handle = scope.acquire(); - assertEquals(handle.scope(), scope); - if (acquireCount > 0) { - // recursive acquire - acquireRecursive(scope, acquireCount - 1); + try (ResourceScope handle = ResourceScope.newConfinedScope()) { + handle.keepAlive(scope); + if (acquireCount > 0) { + // recursive acquire + acquireRecursive(scope, acquireCount - 1); + } + if (scope != ResourceScope.globalScope()) { + assertThrows(IllegalStateException.class, scope::close); + } } - if (!scope.isImplicit()) { - assertThrows(IllegalStateException.class, scope::close); + } + + @Test + public void testConfinedScopeWithImplicitDependency() { + ResourceScope root = ResourceScope.newConfinedScope(); + // Create many implicit scopes which depend on 'root', and let them become unreachable. + for (int i = 0; i < N_THREADS; i++) { + ResourceScope.newConfinedScope(Cleaner.create()).keepAlive(root); } - scope.release(handle); - scope.release(handle); // make sure it's idempotent - scope.release(handle); // make sure it's idempotent + // Now let's keep trying to close 'root' until we succeed. This is trickier than it seems: cleanup action + // might be called from another thread (the Cleaner thread), so that the confined scope lock count is updated racily. + // If that happens, the loop below never terminates. + while (true) { + try { + root.close(); + break; // success! + } catch (IllegalStateException ex) { + kickGC(); + for (int i = 0 ; i < N_THREADS ; i++) { // add more races from current thread + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + scope.keepAlive(root); + // dummy + } + } + // try again + } + } + } + + @Test + public void testConfinedScopeWithSharedDependency() { + ResourceScope root = ResourceScope.newConfinedScope(); + List threads = new ArrayList<>(); + // Create many implicit scopes which depend on 'root', and let them become unreachable. + for (int i = 0; i < N_THREADS; i++) { + ResourceScope scope = ResourceScope.newSharedScope(); // create scope inside same thread! + scope.keepAlive(root); + Thread t = new Thread(scope::close); // close from another thread! + threads.add(t); + t.start(); + } + for (int i = 0 ; i < N_THREADS ; i++) { // add more races from current thread + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + scope.keepAlive(root); + // dummy + } + } + threads.forEach(t -> { + try { + t.join(); + } catch (InterruptedException ex) { + // ok + } + }); + // Now let's close 'root'. This is trickier than it seems: releases of the confined scope happen in different + // threads, so that the confined scope lock count is updated racily. If that happens, the following close will blow up. + root.close(); } private void waitSomeTime() { diff --git a/test/jdk/java/foreign/TestRestricted.java b/test/jdk/java/foreign/TestRestricted.java index 68d23b6eb23..8667ffe1f47 100644 --- a/test/jdk/java/foreign/TestRestricted.java +++ b/test/jdk/java/foreign/TestRestricted.java @@ -21,6 +21,7 @@ * questions. */ +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -38,37 +39,37 @@ import java.lang.reflect.InvocationTargetException; public class TestRestricted { @Test(expectedExceptions = InvocationTargetException.class) public void testReflection() throws Throwable { - Method method = MemorySegment.class.getDeclaredMethod("globalNativeSegment"); + Method method = CLinker.class.getDeclaredMethod("systemCLinker"); method.invoke(null); } @Test(expectedExceptions = IllegalCallerException.class) public void testInvoke() throws Throwable { - var mh = MethodHandles.lookup().findStatic(MemorySegment.class, - "globalNativeSegment", MethodType.methodType(MemorySegment.class)); - var seg = (MemorySegment)mh.invokeExact(); + var mh = MethodHandles.lookup().findStatic(CLinker.class, + "systemCLinker", MethodType.methodType(CLinker.class)); + var seg = (CLinker)mh.invokeExact(); } @Test(expectedExceptions = IllegalCallerException.class) public void testDirectAccess() throws Throwable { - MemorySegment.globalNativeSegment(); + CLinker.systemCLinker(); } @Test(expectedExceptions = InvocationTargetException.class) public void testReflection2() throws Throwable { - Method method = MemoryAddress.class.getDeclaredMethod("asSegment", long.class, ResourceScope.class); - method.invoke(MemoryAddress.NULL, 4000L, ResourceScope.globalScope()); + Method method = MemorySegment.class.getDeclaredMethod("ofAddress", MemoryAddress.class, long.class, ResourceScope.class); + method.invoke(null, MemoryAddress.NULL, 4000L, ResourceScope.globalScope()); } @Test(expectedExceptions = IllegalCallerException.class) public void testInvoke2() throws Throwable { - var mh = MethodHandles.lookup().findVirtual(MemoryAddress.class, "asSegment", - MethodType.methodType(MemorySegment.class, long.class, ResourceScope.class)); + var mh = MethodHandles.lookup().findStatic(MemorySegment.class, "ofAddress", + MethodType.methodType(MemorySegment.class, MemoryAddress.class, long.class, ResourceScope.class)); var seg = (MemorySegment)mh.invokeExact(MemoryAddress.NULL, 4000L, ResourceScope.globalScope()); } @Test(expectedExceptions = IllegalCallerException.class) public void testDirectAccess2() throws Throwable { - MemoryAddress.NULL.asSegment(4000L, ResourceScope.globalScope()); + MemorySegment.ofAddress(MemoryAddress.NULL, 4000, ResourceScope.globalScope()); } } diff --git a/test/jdk/java/foreign/TestScopedOperations.java b/test/jdk/java/foreign/TestScopedOperations.java index 9254a9e5b3a..7384693481c 100644 --- a/test/jdk/java/foreign/TestScopedOperations.java +++ b/test/jdk/java/foreign/TestScopedOperations.java @@ -27,13 +27,14 @@ * @run testng/othervm --enable-native-access=ALL-UNNAMED TestScopedOperations */ -import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; +import jdk.incubator.foreign.VaList; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -47,6 +48,9 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Function; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; @@ -67,11 +71,12 @@ public class TestScopedOperations { } @Test(dataProvider = "scopedOperations") - public void testOpAfterClose(String name, ScopedOperation scopedOperation) { + public void testOpAfterClose(String name, ScopedOperation scopedOperation) { ResourceScope scope = ResourceScope.newConfinedScope(); + Z obj = scopedOperation.apply(scope); scope.close(); try { - scopedOperation.accept(scope); + scopedOperation.accept(obj); fail(); } catch (IllegalStateException ex) { assertTrue(ex.getMessage().contains("closed")); @@ -79,12 +84,13 @@ public class TestScopedOperations { } @Test(dataProvider = "scopedOperations") - public void testOpOutsideConfinement(String name, ScopedOperation scopedOperation) { + public void testOpOutsideConfinement(String name, ScopedOperation scopedOperation) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { + Z obj = scopedOperation.apply(scope); AtomicReference failed = new AtomicReference<>(); Thread t = new Thread(() -> { try { - scopedOperation.accept(scope); + scopedOperation.accept(obj); } catch (Throwable ex) { failed.set(ex); } @@ -106,9 +112,10 @@ public class TestScopedOperations { ScopedOperation.ofScope(scope -> scope.addCloseAction(() -> { }), "ResourceScope::addOnClose"); ScopedOperation.ofScope(scope -> { - ResourceScope.Handle handle = scope.acquire(); - scope.release(handle); - }, "ResourceScope::lock"); + ResourceScope scope2 = ResourceScope.newConfinedScope(); + scope2.keepAlive(scope); + scope2.close(); + }, "ResourceScope::keepAlive"); ScopedOperation.ofScope(scope -> MemorySegment.allocateNative(100, scope), "MemorySegment::allocateNative"); ScopedOperation.ofScope(scope -> { try { @@ -117,54 +124,46 @@ public class TestScopedOperations { fail(); } }, "MemorySegment::mapFromFile"); - ScopedOperation.ofScope(scope -> CLinker.VaList.make(b -> {}, scope), "VaList::make"); - ScopedOperation.ofScope(scope -> CLinker.VaList.ofAddress(MemoryAddress.ofLong(42), scope), "VaList::make"); - ScopedOperation.ofScope(scope -> CLinker.toCString("Hello", scope), "CLinker::toCString"); - ScopedOperation.ofScope(SegmentAllocator::arenaAllocator, "SegmentAllocator::arenaAllocator"); + ScopedOperation.ofScope(scope -> VaList.make(b -> b.addVarg(JAVA_INT, 42), scope), "VaList::make"); + ScopedOperation.ofScope(scope -> VaList.ofAddress(MemoryAddress.ofLong(42), scope), "VaList::make"); + ScopedOperation.ofScope(SegmentAllocator::newNativeArena, "SegmentAllocator::arenaAllocator"); // segment operations - ScopedOperation.ofSegment(MemorySegment::toByteArray, "MemorySegment::toByteArray"); - ScopedOperation.ofSegment(MemorySegment::toCharArray, "MemorySegment::toCharArray"); - ScopedOperation.ofSegment(MemorySegment::toShortArray, "MemorySegment::toShortArray"); - ScopedOperation.ofSegment(MemorySegment::toIntArray, "MemorySegment::toIntArray"); - ScopedOperation.ofSegment(MemorySegment::toFloatArray, "MemorySegment::toFloatArray"); - ScopedOperation.ofSegment(MemorySegment::toLongArray, "MemorySegment::toLongArray"); - ScopedOperation.ofSegment(MemorySegment::toDoubleArray, "MemorySegment::toDoubleArray"); + ScopedOperation.ofSegment(s -> s.toArray(JAVA_BYTE), "MemorySegment::toArray(BYTE)"); ScopedOperation.ofSegment(MemorySegment::address, "MemorySegment::address"); - ScopedOperation.ofSegment(s -> MemoryLayout.sequenceLayout(s.byteSize(), MemoryLayouts.JAVA_BYTE), "MemorySegment::spliterator"); ScopedOperation.ofSegment(s -> s.copyFrom(s), "MemorySegment::copyFrom"); ScopedOperation.ofSegment(s -> s.mismatch(s), "MemorySegment::mismatch"); ScopedOperation.ofSegment(s -> s.fill((byte) 0), "MemorySegment::fill"); - // address operations - ScopedOperation.ofAddress(a -> a.toRawLongValue(), "MemoryAddress::toRawLongValue"); - ScopedOperation.ofAddress(a -> a.asSegment(100, ResourceScope.globalScope()), "MemoryAddress::asSegment"); // valist operations - ScopedOperation.ofVaList(CLinker.VaList::address, "VaList::address"); - ScopedOperation.ofVaList(CLinker.VaList::copy, "VaList::copy"); - ScopedOperation.ofVaList(list -> list.vargAsAddress(MemoryLayouts.ADDRESS), "VaList::vargAsAddress"); - ScopedOperation.ofVaList(list -> list.vargAsInt(MemoryLayouts.JAVA_INT), "VaList::vargAsInt"); - ScopedOperation.ofVaList(list -> list.vargAsLong(MemoryLayouts.JAVA_LONG), "VaList::vargAsLong"); - ScopedOperation.ofVaList(list -> list.vargAsDouble(MemoryLayouts.JAVA_DOUBLE), "VaList::vargAsDouble"); - ScopedOperation.ofVaList(CLinker.VaList::skip, "VaList::skip"); - ScopedOperation.ofVaList(list -> list.vargAsSegment(MemoryLayout.structLayout(MemoryLayouts.JAVA_INT), ResourceScope.newImplicitScope()), "VaList::vargAsSegment/1"); + ScopedOperation.ofVaList(VaList::address, "VaList::address"); + ScopedOperation.ofVaList(VaList::copy, "VaList::copy"); + ScopedOperation.ofVaList(list -> list.nextVarg(ValueLayout.ADDRESS), "VaList::nextVarg/address"); + ScopedOperation.ofVaList(list -> list.nextVarg(ValueLayout.JAVA_INT), "VaList::nextVarg/int"); + ScopedOperation.ofVaList(list -> list.nextVarg(ValueLayout.JAVA_LONG), "VaList::nextVarg/long"); + ScopedOperation.ofVaList(list -> list.nextVarg(ValueLayout.JAVA_DOUBLE), "VaList::nextVarg/double"); + ScopedOperation.ofVaList(VaList::skip, "VaList::skip"); + ScopedOperation.ofVaList(list -> list.nextVarg(MemoryLayout.structLayout(ValueLayout.JAVA_INT), + SegmentAllocator.prefixAllocator(MemorySegment.ofArray(new byte[4]))), "VaList::nextVargs/segment"); // allocator operations ScopedOperation.ofAllocator(a -> a.allocate(1), "NativeAllocator::allocate/size"); ScopedOperation.ofAllocator(a -> a.allocate(1, 1), "NativeAllocator::allocate/size/align"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_BYTE), "NativeAllocator::allocate/layout"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_BYTE, (byte) 0), "NativeAllocator::allocate/byte"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_CHAR, (char) 0), "NativeAllocator::allocate/char"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_SHORT, (short) 0), "NativeAllocator::allocate/short"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_INT, 0), "NativeAllocator::allocate/int"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_FLOAT, 0f), "NativeAllocator::allocate/float"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_LONG, 0L), "NativeAllocator::allocate/long"); - ScopedOperation.ofAllocator(a -> a.allocate(MemoryLayouts.JAVA_DOUBLE, 0d), "NativeAllocator::allocate/double"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_BYTE, 1L), "NativeAllocator::allocateArray/size"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_BYTE, new byte[]{0}), "NativeAllocator::allocateArray/byte"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_CHAR, new char[]{0}), "NativeAllocator::allocateArray/char"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_SHORT, new short[]{0}), "NativeAllocator::allocateArray/short"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_INT, new int[]{0}), "NativeAllocator::allocateArray/int"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_FLOAT, new float[]{0}), "NativeAllocator::allocateArray/float"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_LONG, new long[]{0}), "NativeAllocator::allocateArray/long"); - ScopedOperation.ofAllocator(a -> a.allocateArray(MemoryLayouts.JAVA_DOUBLE, new double[]{0}), "NativeAllocator::allocateArray/double"); + ScopedOperation.ofAllocator(a -> a.allocate(JAVA_BYTE), "NativeAllocator::allocate/layout"); + ScopedOperation.ofAllocator(a -> a.allocate(JAVA_BYTE, (byte) 0), "NativeAllocator::allocate/byte"); + ScopedOperation.ofAllocator(a -> a.allocate(ValueLayout.JAVA_CHAR, (char) 0), "NativeAllocator::allocate/char"); + ScopedOperation.ofAllocator(a -> a.allocate(ValueLayout.JAVA_SHORT, (short) 0), "NativeAllocator::allocate/short"); + ScopedOperation.ofAllocator(a -> a.allocate(ValueLayout.JAVA_INT, 0), "NativeAllocator::allocate/int"); + ScopedOperation.ofAllocator(a -> a.allocate(ValueLayout.JAVA_FLOAT, 0f), "NativeAllocator::allocate/float"); + ScopedOperation.ofAllocator(a -> a.allocate(ValueLayout.JAVA_LONG, 0L), "NativeAllocator::allocate/long"); + ScopedOperation.ofAllocator(a -> a.allocate(ValueLayout.JAVA_DOUBLE, 0d), "NativeAllocator::allocate/double"); + ScopedOperation.ofAllocator(a -> a.allocateArray(JAVA_BYTE, 1L), "NativeAllocator::allocateArray/size"); + ScopedOperation.ofAllocator(a -> a.allocateArray(JAVA_BYTE, new byte[]{0}), "NativeAllocator::allocateArray/byte"); + ScopedOperation.ofAllocator(a -> a.allocateArray(ValueLayout.JAVA_CHAR, new char[]{0}), "NativeAllocator::allocateArray/char"); + ScopedOperation.ofAllocator(a -> a.allocateArray(ValueLayout.JAVA_SHORT, new short[]{0}), "NativeAllocator::allocateArray/short"); + ScopedOperation.ofAllocator(a -> a.allocateArray(ValueLayout.JAVA_INT, new int[]{0}), "NativeAllocator::allocateArray/int"); + ScopedOperation.ofAllocator(a -> a.allocateArray(ValueLayout.JAVA_FLOAT, new float[]{0}), "NativeAllocator::allocateArray/float"); + ScopedOperation.ofAllocator(a -> a.allocateArray(ValueLayout.JAVA_LONG, new long[]{0}), "NativeAllocator::allocateArray/long"); + ScopedOperation.ofAllocator(a -> a.allocateArray(ValueLayout.JAVA_DOUBLE, new double[]{0}), "NativeAllocator::allocateArray/double"); + // native symbol + ScopedOperation.of(scope -> NativeSymbol.ofAddress("", MemoryAddress.NULL, scope), NativeSymbol::address, "NativeSymbol::address"); }; @DataProvider(name = "scopedOperations") @@ -172,56 +171,56 @@ public class TestScopedOperations { return scopedOperations.stream().map(op -> new Object[] { op.name, op }).toArray(Object[][]::new); } - static class ScopedOperation implements Consumer { + static class ScopedOperation implements Consumer, Function { - final Consumer scopeConsumer; + final Function factory; + final Consumer operation; final String name; - private ScopedOperation(Consumer scopeConsumer, String name) { - this.scopeConsumer = scopeConsumer; + private ScopedOperation(Function factory, Consumer operation, String name) { + this.factory = factory; + this.operation = operation; this.name = name; } @Override - public void accept(ResourceScope scope) { - scopeConsumer.accept(scope); + public void accept(X obj) { + operation.accept(obj); } - static void ofScope(Consumer scopeConsumer, String name) { - scopedOperations.add(new ScopedOperation(scopeConsumer::accept, name)); + @Override + public X apply(ResourceScope scope) { + return factory.apply(scope); } - static void ofVaList(Consumer vaListConsumer, String name) { - scopedOperations.add(new ScopedOperation(scope -> { - CLinker.VaList vaList = CLinker.VaList.make((builder) -> {}, scope); - vaListConsumer.accept(vaList); - }, name)); + static void of(Function factory, Consumer consumer, String name) { + scopedOperations.add(new ScopedOperation<>(factory, consumer, name)); } - static void ofSegment(Consumer segmentConsumer, String name) { - for (SegmentFactory segmentFactory : SegmentFactory.values()) { - scopedOperations.add(new ScopedOperation(scope -> { - MemorySegment segment = segmentFactory.segmentFactory.apply(scope); - segmentConsumer.accept(segment); - }, segmentFactory.name() + "/" + name)); - } + static void ofScope(Consumer scopeConsumer, String name) { + scopedOperations.add(new ScopedOperation<>(Function.identity(), scopeConsumer, name)); + } + + static void ofVaList(Consumer vaListConsumer, String name) { + scopedOperations.add(new ScopedOperation<>(scope -> VaList.make(builder -> builder.addVarg(JAVA_LONG, 42), scope), + vaListConsumer, name)); } - static void ofAddress(Consumer addressConsumer, String name) { + static void ofSegment(Consumer segmentConsumer, String name) { for (SegmentFactory segmentFactory : SegmentFactory.values()) { - scopedOperations.add(new ScopedOperation(scope -> { - MemoryAddress segment = segmentFactory.segmentFactory.apply(scope).address(); - addressConsumer.accept(segment); - }, segmentFactory.name() + "/" + name)); + scopedOperations.add(new ScopedOperation<>( + segmentFactory.segmentFactory, + segmentConsumer, + segmentFactory.name() + "/" + name)); } } static void ofAllocator(Consumer allocatorConsumer, String name) { for (AllocatorFactory allocatorFactory : AllocatorFactory.values()) { - scopedOperations.add(new ScopedOperation(scope -> { - SegmentAllocator allocator = allocatorFactory.allocatorFactory.apply(scope); - allocatorConsumer.accept(allocator); - }, allocatorFactory.name() + "/" + name)); + scopedOperations.add(new ScopedOperation<>( + allocatorFactory.allocatorFactory, + allocatorConsumer, + allocatorFactory.name() + "/" + name)); } } @@ -235,7 +234,7 @@ public class TestScopedOperations { throw new AssertionError(ex); } }), - UNSAFE(scope -> MemoryAddress.NULL.asSegment(10, scope)); + UNSAFE(scope -> MemorySegment.ofAddress(MemoryAddress.NULL, 10, scope)); static { try { @@ -255,13 +254,8 @@ public class TestScopedOperations { } enum AllocatorFactory { - ARENA_BOUNDED(scope -> SegmentAllocator.arenaAllocator(1000, scope)), - ARENA_UNBOUNDED(SegmentAllocator::arenaAllocator), - FROM_SEGMENT(scope -> { - MemorySegment segment = MemorySegment.allocateNative(10, scope); - return SegmentAllocator.ofSegment(segment); - }), - FROM_SCOPE(SegmentAllocator::ofScope); + ARENA_BOUNDED(scope -> SegmentAllocator.newNativeArena(1000, scope)), + ARENA_UNBOUNDED(SegmentAllocator::newNativeArena); final Function allocatorFactory; diff --git a/test/jdk/java/foreign/TestSegmentAllocators.java b/test/jdk/java/foreign/TestSegmentAllocators.java index 3d2538ad897..aa269191a23 100644 --- a/test/jdk/java/foreign/TestSegmentAllocators.java +++ b/test/jdk/java/foreign/TestSegmentAllocators.java @@ -34,6 +34,7 @@ import org.testng.annotations.*; import java.lang.invoke.VarHandle; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.nio.CharBuffer; import java.nio.DoubleBuffer; import java.nio.FloatBuffer; import java.nio.IntBuffer; @@ -51,17 +52,19 @@ import static org.testng.Assert.*; public class TestSegmentAllocators { final static int ELEMS = 128; - final static Class ADDRESS_CARRIER = MemoryLayouts.ADDRESS.bitSize() == 64 ? long.class : int.class; + final static Class ADDRESS_CARRIER = ValueLayout.ADDRESS.bitSize() == 64 ? long.class : int.class; @Test(dataProvider = "nativeScopes") - public void testAllocation(Z value, AllocationFactory allocationFactory, ValueLayout layout, AllocationFunction allocationFunction, Function handleFactory) { - ValueLayout[] layouts = { + @SuppressWarnings("unchecked") + public void testAllocation(Z value, AllocationFactory allocationFactory, L layout, AllocationFunction allocationFunction, Function handleFactory) { + layout = (L)layout.withBitAlignment(layout.bitSize()); + L[] layouts = (L[])new ValueLayout[] { layout, layout.withBitAlignment(layout.bitAlignment() * 2), layout.withBitAlignment(layout.bitAlignment() * 4), layout.withBitAlignment(layout.bitAlignment() * 8) }; - for (ValueLayout alignedLayout : layouts) { + for (L alignedLayout : layouts) { List addressList = new ArrayList<>(); int elems = ELEMS / ((int)alignedLayout.byteAlignment() / (int)layout.byteAlignment()); ResourceScope[] scopes = { @@ -80,16 +83,18 @@ public class TestSegmentAllocators { } boolean isBound = allocationFactory.isBound(); try { - allocationFunction.allocate(allocator, alignedLayout, value); //too much, should fail if bound + allocationFunction.allocate(allocator, alignedLayout, value); assertFalse(isBound); } catch (OutOfMemoryError ex) { //failure is expected if bound assertTrue(isBound); } } - // addresses should be invalid now - for (MemorySegment address : addressList) { - assertFalse(address.scope().isAlive()); + if (allocationFactory != AllocationFactory.IMPLICIT_ALLOCATOR) { + // addresses should be invalid now + for (MemorySegment address : addressList) { + assertFalse(address.scope().isAlive()); + } } } } @@ -100,7 +105,7 @@ public class TestSegmentAllocators { @Test public void testBigAllocationInUnboundedScope() { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); for (int i = 8 ; i < SIZE_256M ; i *= 8) { MemorySegment address = allocator.allocate(i, i); //check size @@ -111,24 +116,30 @@ public class TestSegmentAllocators { } } - @Test(expectedExceptions = OutOfMemoryError.class) + @Test public void testTooBigForBoundedArena() { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(10, scope); - allocator.allocate(12); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(10, scope); + assertThrows(OutOfMemoryError.class, () -> allocator.allocate(12)); + allocator.allocate(5); // ok } } @Test public void testBiggerThanBlockForBoundedArena() { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - SegmentAllocator allocator = SegmentAllocator.arenaAllocator(4 * 1024 * 2, scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(4 * 1024 * 2, scope); allocator.allocate(4 * 1024 + 1); // should be ok } } + @Test(expectedExceptions = IllegalArgumentException.class) + public void testBadUnboundedArenaSize() { + SegmentAllocator.newNativeArena( -1, ResourceScope.globalScope()); + } + @Test(dataProvider = "arrayScopes") - public void testArray(AllocationFactory allocationFactory, ValueLayout layout, AllocationFunction allocationFunction, ToArrayHelper arrayHelper) { + public void testArray(AllocationFactory allocationFactory, ValueLayout layout, AllocationFunction allocationFunction, ToArrayHelper arrayHelper) { Z arr = arrayHelper.array(); ResourceScope[] scopes = { ResourceScope.newConfinedScope(), @@ -146,221 +157,142 @@ public class TestSegmentAllocators { @DataProvider(name = "nativeScopes") static Object[][] nativeScopes() { - return new Object[][] { - { (byte)42, AllocationFactory.BOUNDED, MemoryLayouts.BITS_8_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(byte.class) }, - { (short)42, AllocationFactory.BOUNDED, MemoryLayouts.BITS_16_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(short.class) }, - { (char)42, AllocationFactory.BOUNDED, MemoryLayouts.BITS_16_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(char.class) }, - { 42, AllocationFactory.BOUNDED, - MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(int.class) }, - { 42f, AllocationFactory.BOUNDED, MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(float.class) }, - { 42L, AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(long.class) }, - { 42d, AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(double.class) }, - { MemoryAddress.ofLong(42), AllocationFactory.BOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> MemoryHandles.asAddressVarHandle(l.varHandle(ADDRESS_CARRIER)) }, - - { (byte)42, AllocationFactory.BOUNDED, MemoryLayouts.BITS_8_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(byte.class) }, - { (short)42, AllocationFactory.BOUNDED, MemoryLayouts.BITS_16_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(short.class) }, - { (char)42, AllocationFactory.BOUNDED, MemoryLayouts.BITS_16_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(char.class) }, - { 42, AllocationFactory.BOUNDED, - MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(int.class) }, - { 42f, AllocationFactory.BOUNDED, MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(float.class) }, - { 42L, AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(long.class) }, - { 42d, AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(double.class) }, - { MemoryAddress.ofLong(42), AllocationFactory.BOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.LITTLE_ENDIAN), - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> MemoryHandles.asAddressVarHandle(l.varHandle(ADDRESS_CARRIER)) }, - - { (byte)42, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_8_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(byte.class) }, - { (short)42, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_16_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(short.class) }, - { (char)42, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_16_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(char.class) }, - { 42, AllocationFactory.UNBOUNDED, - MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(int.class) }, - { 42f, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(float.class) }, - { 42L, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(long.class) }, - { 42d, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(double.class) }, - { MemoryAddress.ofLong(42), AllocationFactory.UNBOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> MemoryHandles.asAddressVarHandle(l.varHandle(ADDRESS_CARRIER)) }, - - { (byte)42, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_8_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(byte.class) }, - { (short)42, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_16_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(short.class) }, - { (char)42, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_16_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(char.class) }, - { 42, AllocationFactory.UNBOUNDED, - MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(int.class) }, - { 42f, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(float.class) }, - { 42L, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(long.class) }, - { 42d, AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> l.varHandle(double.class) }, - { MemoryAddress.ofLong(42), AllocationFactory.UNBOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.LITTLE_ENDIAN), - (AllocationFunction) SegmentAllocator::allocate, - (Function)l -> MemoryHandles.asAddressVarHandle(l.varHandle(ADDRESS_CARRIER)) }, - }; + List nativeScopes = new ArrayList<>(); + for (AllocationFactory factory : AllocationFactory.values()) { + nativeScopes.add(new Object[] { (byte)42, factory, ValueLayout.JAVA_BYTE, + (AllocationFunction.OfByte) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { (short)42, factory, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfShort) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { (char)42, factory, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfChar) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42, factory, + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfInt) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42f, factory, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfFloat) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42L, factory, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfLong) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42d, factory, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfDouble) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { MemoryAddress.ofLong(42), factory, ValueLayout.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfAddress) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + + nativeScopes.add(new Object[] { (short)42, factory, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfShort) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { (char)42, factory, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfChar) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42, factory, + ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfInt) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42f, factory, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfFloat) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42L, factory, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfLong) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { 42d, factory, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfDouble) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + nativeScopes.add(new Object[] { MemoryAddress.ofLong(42), factory, ValueLayout.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfAddress) SegmentAllocator::allocate, + (Function)l -> l.varHandle() }); + } + return nativeScopes.toArray(Object[][]::new); } @DataProvider(name = "arrayScopes") static Object[][] arrayScopes() { - return new Object[][] { - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_8_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toByteArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_16_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toShortArray }, - { AllocationFactory.BOUNDED, - MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toIntArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toFloatArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toLongArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toDoubleArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.LITTLE_ENDIAN), - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toAddressArray }, - - - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_8_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toByteArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_16_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toShortArray }, - { AllocationFactory.BOUNDED, - MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toIntArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toFloatArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toLongArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toDoubleArray }, - { AllocationFactory.BOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toAddressArray }, - - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_8_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toByteArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_16_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toShortArray }, - { AllocationFactory.UNBOUNDED, - MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toIntArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_32_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toFloatArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toLongArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_LE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toDoubleArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.LITTLE_ENDIAN), - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toAddressArray }, - - - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_8_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toByteArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_16_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toShortArray }, - { AllocationFactory.UNBOUNDED, - MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toIntArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_32_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toFloatArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toLongArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.BITS_64_BE, - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toDoubleArray }, - { AllocationFactory.UNBOUNDED, MemoryLayouts.ADDRESS.withOrder(ByteOrder.BIG_ENDIAN), - (AllocationFunction) SegmentAllocator::allocateArray, - ToArrayHelper.toAddressArray }, + List arrayScopes = new ArrayList<>(); + for (AllocationFactory factory : AllocationFactory.values()) { + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_BYTE, + (AllocationFunction.OfByteArray) SegmentAllocator::allocateArray, + ToArrayHelper.toByteArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfCharArray) SegmentAllocator::allocateArray, + ToArrayHelper.toCharArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfShortArray) SegmentAllocator::allocateArray, + ToArrayHelper.toShortArray }); + arrayScopes.add(new Object[] { factory, + ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfIntArray) SegmentAllocator::allocateArray, + ToArrayHelper.toIntArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfFloatArray) SegmentAllocator::allocateArray, + ToArrayHelper.toFloatArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfLongArray) SegmentAllocator::allocateArray, + ToArrayHelper.toLongArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), + (AllocationFunction.OfDoubleArray) SegmentAllocator::allocateArray, + ToArrayHelper.toDoubleArray }); + + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfCharArray) SegmentAllocator::allocateArray, + ToArrayHelper.toCharArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfShortArray) SegmentAllocator::allocateArray, + ToArrayHelper.toShortArray }); + arrayScopes.add(new Object[] { factory, + ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfIntArray) SegmentAllocator::allocateArray, + ToArrayHelper.toIntArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfFloatArray) SegmentAllocator::allocateArray, + ToArrayHelper.toFloatArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfLongArray) SegmentAllocator::allocateArray, + ToArrayHelper.toLongArray }); + arrayScopes.add(new Object[] { factory, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), + (AllocationFunction.OfDoubleArray) SegmentAllocator::allocateArray, + ToArrayHelper.toDoubleArray }); }; + return arrayScopes.toArray(Object[][]::new); } - interface AllocationFunction { - MemorySegment allocate(SegmentAllocator allocator, ValueLayout layout, X value); + interface AllocationFunction { + MemorySegment allocate(SegmentAllocator allocator, L layout, X value); + + interface OfByte extends AllocationFunction { } + interface OfBoolean extends AllocationFunction { } + interface OfChar extends AllocationFunction { } + interface OfShort extends AllocationFunction { } + interface OfInt extends AllocationFunction { } + interface OfFloat extends AllocationFunction { } + interface OfLong extends AllocationFunction { } + interface OfDouble extends AllocationFunction { } + interface OfAddress extends AllocationFunction { } + + interface OfByteArray extends AllocationFunction { } + interface OfCharArray extends AllocationFunction { } + interface OfShortArray extends AllocationFunction { } + interface OfIntArray extends AllocationFunction { } + interface OfFloatArray extends AllocationFunction { } + interface OfLongArray extends AllocationFunction { } + interface OfDoubleArray extends AllocationFunction { } } - static class AllocationFactory { + enum AllocationFactory { + ARENA_BOUNDED(true, SegmentAllocator::newNativeArena), + ARENA_UNBOUNDED(false, (size, scope) -> SegmentAllocator.newNativeArena(scope)), + NATIVE_ALLOCATOR(false, (size, scope) -> SegmentAllocator.nativeAllocator(scope)), + IMPLICIT_ALLOCATOR(false, (size, scope) -> SegmentAllocator.implicitAllocator()); + private final boolean isBound; private final BiFunction factory; - private AllocationFactory(boolean isBound, BiFunction factory) { + AllocationFactory(boolean isBound, BiFunction factory) { this.isBound = isBound; this.factory = factory; } @@ -372,9 +304,6 @@ public class TestSegmentAllocators { public boolean isBound() { return isBound; } - - static AllocationFactory BOUNDED = new AllocationFactory(true, SegmentAllocator::arenaAllocator); - static AllocationFactory UNBOUNDED = new AllocationFactory(false, (size, scope) -> SegmentAllocator.arenaAllocator(scope)); } interface ToArrayHelper { @@ -396,6 +325,21 @@ public class TestSegmentAllocators { } }; + ToArrayHelper toCharArray = new ToArrayHelper<>() { + @Override + public char[] array() { + return new char[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + } + + @Override + public char[] toArray(MemorySegment segment, ValueLayout layout) { + CharBuffer buffer = segment.asByteBuffer().order(layout.order()).asCharBuffer(); + char[] found = new char[buffer.limit()]; + buffer.get(found); + return found; + } + }; + ToArrayHelper toShortArray = new ToArrayHelper<>() { @Override public short[] array() { @@ -474,7 +418,7 @@ public class TestSegmentAllocators { ToArrayHelper toAddressArray = new ToArrayHelper<>() { @Override public MemoryAddress[] array() { - return switch ((int)MemoryLayouts.ADDRESS.byteSize()) { + return switch ((int) ValueLayout.ADDRESS.byteSize()) { case 4 -> wrap(toIntArray.array()); case 8 -> wrap(toLongArray.array()); default -> throw new IllegalStateException("Cannot get here"); diff --git a/test/jdk/java/foreign/TestSegmentCopy.java b/test/jdk/java/foreign/TestSegmentCopy.java new file mode 100644 index 00000000000..de2dba08483 --- /dev/null +++ b/test/jdk/java/foreign/TestSegmentCopy.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2019, 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 + * @run testng TestSegmentCopy + */ + +import jdk.incubator.foreign.MemoryHandles; +import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.function.IntFunction; + +import static org.testng.Assert.*; + +public class TestSegmentCopy { + + @Test(dataProvider = "slices") + public void testByteCopy(SegmentSlice s1, SegmentSlice s2) { + int size = Math.min(s1.byteSize(), s2.byteSize()); + //prepare source and target segments + for (int i = 0 ; i < size ; i++) { + Type.BYTE.set(s2, i, 0); + } + for (int i = 0 ; i < size ; i++) { + Type.BYTE.set(s1, i, i); + } + //perform copy + MemorySegment.copy(s1.segment, 0, s2.segment, 0, size); + //check that copy actually worked + for (int i = 0 ; i < size ; i++) { + Type.BYTE.check(s2, i, i); + } + } + + @Test(dataProvider = "slices") + public void testElementCopy(SegmentSlice s1, SegmentSlice s2) { + if (s1.type.carrier != s2.type.carrier) return; + int size = Math.min(s1.elementSize(), s2.elementSize()); + //prepare source and target segments + for (int i = 0 ; i < size ; i++) { + s2.set(i, 0); + } + for (int i = 0 ; i < size ; i++) { + s1.set(i, i); + } + //perform copy + MemorySegment.copy(s1.segment, s1.type.layout, 0, s2.segment, s2.type.layout, 0, size); + //check that copy actually worked + for (int i = 0; i < size; i++) { + s2.check(i, i); + } + } + + interface Getter { + X get(MemorySegment segment, ValueLayout layout, long index); + } + + interface Setter { + void set(MemorySegment segment, ValueLayout layout, long index, X val); + } + + enum Type { + // Byte + BYTE(byte.class, ValueLayout.JAVA_BYTE, i -> (byte)i), + //LE + SHORT_LE(short.class, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN), i -> (short)i), + CHAR_LE(char.class, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.LITTLE_ENDIAN), i -> (char)i), + INT_LE(int.class, ValueLayout.JAVA_INT.withOrder(ByteOrder.LITTLE_ENDIAN), i -> i), + FLOAT_LE(float.class, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.LITTLE_ENDIAN), i -> (float)i), + LONG_LE(long.class, ValueLayout.JAVA_LONG.withOrder(ByteOrder.LITTLE_ENDIAN), i -> (long)i), + DOUBLE_LE(double.class, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.LITTLE_ENDIAN), i -> (double)i), + //BE + SHORT_BE(short.class, ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN), i -> (short)i), + CHAR_BE(char.class, ValueLayout.JAVA_CHAR.withOrder(ByteOrder.BIG_ENDIAN), i -> (char)i), + INT_BE(int.class, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), i -> i), + FLOAT_BE(float.class, ValueLayout.JAVA_FLOAT.withOrder(ByteOrder.BIG_ENDIAN), i -> (float)i), + LONG_BE(long.class, ValueLayout.JAVA_LONG.withOrder(ByteOrder.BIG_ENDIAN), i -> (long)i), + DOUBLE_BE(double.class, ValueLayout.JAVA_DOUBLE.withOrder(ByteOrder.BIG_ENDIAN), i -> (double)i); + + final ValueLayout layout; + final IntFunction valueConverter; + final Class carrier; + + @SuppressWarnings("unchecked") + Type(Class carrier, ValueLayout layout, IntFunction valueConverter) { + this.carrier = carrier; + this.layout = layout; + this.valueConverter = (IntFunction)valueConverter; + } + + int size() { + return (int)layout.byteSize(); + } + + VarHandle handle() { + return MemoryHandles.varHandle(layout); + } + + void set(SegmentSlice slice, int index, int val) { + handle().set(slice.segment, index * size(), valueConverter.apply(val)); + } + + void check(SegmentSlice slice, int index, int val) { + assertEquals(handle().get(slice.segment, index * size()), valueConverter.apply(val)); + } + } + + static class SegmentSlice { + + enum Kind { + NATIVE(i -> MemorySegment.allocateNative(i, ResourceScope.newImplicitScope())), + ARRAY(i -> MemorySegment.ofArray(new byte[i])); + + final IntFunction segmentFactory; + + Kind(IntFunction segmentFactory) { + this.segmentFactory = segmentFactory; + } + + MemorySegment makeSegment(int elems) { + return segmentFactory.apply(elems); + } + } + + final Kind kind; + final Type type; + final int first; + final int last; + final MemorySegment segment; + + public SegmentSlice(Kind kind, Type type, int first, int last, MemorySegment segment) { + this.kind = kind; + this.type = type; + this.first = first; + this.last = last; + this.segment = segment; + } + + void set(int index, int val) { + type.set(this, index, val); + } + + void check(int index, int val) { + type.check(this, index, val); + } + + int byteSize() { + return last - first + 1; + } + + int elementSize() { + return byteSize() / type.size(); + } + + @Override + public String toString() { + return String.format("SegmentSlice{%s, %d, %d}", type, first, last); + } + } + + @DataProvider(name = "slices") + static Object[][] elementSlices() { + List slices = new ArrayList<>(); + for (SegmentSlice.Kind kind : SegmentSlice.Kind.values()) { + MemorySegment segment = kind.makeSegment(16); + //compute all slices + for (Type type : Type.values()) { + for (int index = 0; index < 16; index += type.size()) { + MemorySegment first = segment.asSlice(0, index); + slices.add(new SegmentSlice(kind, type, 0, index - 1, first)); + MemorySegment second = segment.asSlice(index); + slices.add(new SegmentSlice(kind, type, index, 15, second)); + } + } + } + Object[][] sliceArray = new Object[slices.size() * slices.size()][]; + for (int i = 0 ; i < slices.size() ; i++) { + for (int j = 0 ; j < slices.size() ; j++) { + sliceArray[i * slices.size() + j] = new Object[] { slices.get(i), slices.get(j) }; + } + } + return sliceArray; + } +} diff --git a/test/jdk/java/foreign/TestRebase.java b/test/jdk/java/foreign/TestSegmentOffset.java similarity index 68% rename from test/jdk/java/foreign/TestRebase.java rename to test/jdk/java/foreign/TestSegmentOffset.java index 0396523c8a5..b9149f2471f 100644 --- a/test/jdk/java/foreign/TestRebase.java +++ b/test/jdk/java/foreign/TestSegmentOffset.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -16,60 +16,58 @@ * 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 + * 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 - * @run testng TestRebase + * @run testng TestSegmentOffset */ -import jdk.incubator.foreign.MemoryAccess; -import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; - import java.util.ArrayList; import java.util.List; import java.util.function.IntFunction; - +import static java.lang.System.out; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static org.testng.Assert.*; -public class TestRebase { +public class TestSegmentOffset { @Test(dataProvider = "slices") - public void testRebase(SegmentSlice s1, SegmentSlice s2) { + public void testOffset(SegmentSlice s1, SegmentSlice s2) { if (s1.contains(s2)) { - //check that an address and its rebased counterpart point to same element - MemoryAddress base = s2.segment.address(); - long offset = base.segmentOffset(s1.segment); + // check that a segment and its overlapping segment point to same elements + long offset = s1.segment.segmentOffset(s2.segment); for (int i = 0; i < s2.size(); i++) { - int expected = MemoryAccess.getByteAtOffset(s2.segment, i); - int found = (int)MemoryAccess.getByteAtOffset(s1.segment, i + offset); + out.format("testOffset s1:%s, s2:%s, offset:%d, i:%s\n", s1, s2, offset, i); + byte expected = s2.segment.get(JAVA_BYTE, i); + byte found = s1.segment.get(JAVA_BYTE, i + offset); assertEquals(found, expected); } } else if (s1.kind != s2.kind) { - // check that rebase s1 to s2 fails + // check that offset from s1 to s2 fails try { - s1.segment.address().segmentOffset(s2.segment); - fail("Rebase unexpectedly passed!"); - } catch (IllegalArgumentException ex) { - assertTrue(true); + long offset = s1.segment.segmentOffset(s2.segment); + out.format("testOffset s1:%s, s2:%s, offset:%d\n", s1, s2, offset); + fail("offset unexpectedly passed!"); + } catch (UnsupportedOperationException ex) { + assertTrue(ex.getMessage().contains("Cannot compute offset from native to heap (or vice versa).")); } } else if (!s2.contains(s1)) { - //disjoint segments - check that rebased address is out of bounds - MemoryAddress base = s2.segment.address(); - long offset = base.segmentOffset(s1.segment); + // disjoint segments - check that offset is out of bounds + long offset = s1.segment.segmentOffset(s2.segment); for (int i = 0; i < s2.size(); i++) { - MemoryAccess.getByteAtOffset(s2.segment, i); + out.format("testOffset s1:%s, s2:%s, offset:%d, i:%s\n", s1, s2, offset, i); + s2.segment.get(JAVA_BYTE, i); try { - MemoryAccess.getByteAtOffset(s1.segment, i + offset); - fail("Rebased address on a disjoint segment is not out of bounds!"); + s1.segment.get(JAVA_BYTE, i + offset); + fail("Offset on a disjoint segment is not out of bounds!"); } catch (IndexOutOfBoundsException ex) { assertTrue(true); } @@ -80,7 +78,7 @@ public class TestRebase { static class SegmentSlice { enum Kind { - NATIVE(i -> MemorySegment.allocateNative(i, ResourceScope.newImplicitScope())), + NATIVE(i -> MemorySegment.allocateNative(i, ResourceScope.newConfinedScope())), ARRAY(i -> MemorySegment.ofArray(new byte[i])); final IntFunction segmentFactory; @@ -122,12 +120,12 @@ public class TestRebase { int[] sizes = { 16, 8, 4, 2, 1 }; List slices = new ArrayList<>(); for (SegmentSlice.Kind kind : SegmentSlice.Kind.values()) { - //init root segment + // init root segment MemorySegment segment = kind.makeSegment(16); for (int i = 0 ; i < 16 ; i++) { - MemoryAccess.setByteAtOffset(segment, i, (byte)i); + segment.set(JAVA_BYTE, i, (byte)i); } - //compute all slices + // compute all slices for (int size : sizes) { for (int index = 0 ; index < 16 ; index += size) { MemorySegment slice = segment.asSlice(index, size); diff --git a/test/jdk/java/foreign/TestSegmentOverlap.java b/test/jdk/java/foreign/TestSegmentOverlap.java new file mode 100644 index 00000000000..fb55e92dedb --- /dev/null +++ b/test/jdk/java/foreign/TestSegmentOverlap.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2021, 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 + * @run testng/othervm TestSegmentOverlap + */ + +import java.io.File; +import java.io.IOException; +import java.nio.channels.FileChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.List; +import java.util.function.Supplier; +import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.ResourceScope; +import org.testng.annotations.Test; +import org.testng.annotations.DataProvider; +import static java.lang.System.out; +import static org.testng.Assert.*; + +public class TestSegmentOverlap { + + static Path tempPath; + + static { + try { + File file = File.createTempFile("buffer", "txt"); + file.deleteOnExit(); + tempPath = file.toPath(); + Files.write(file.toPath(), new byte[16], StandardOpenOption.WRITE); + + } catch (IOException ex) { + throw new ExceptionInInitializerError(ex); + } + } + + @DataProvider(name = "segmentFactories") + public Object[][] segmentFactories() { + List> l = List.of( + () -> MemorySegment.allocateNative(16, ResourceScope.newConfinedScope()), + () -> { + try { + return MemorySegment.mapFile(tempPath, 0L, 16, FileChannel.MapMode.READ_WRITE, ResourceScope.newConfinedScope()); + } catch (IOException e) { + throw new RuntimeException(e); + } + }, + () -> MemorySegment.ofArray(new byte[] { 0x00, 0x01, 0x02, 0x03 } ), + () -> MemorySegment.ofArray(new char[] {'a', 'b', 'c', 'd' } ), + () -> MemorySegment.ofArray(new double[] { 1d, 2d, 3d, 4d} ), + () -> MemorySegment.ofArray(new float[] { 1.0f, 2.0f, 3.0f, 4.0f } ), + () -> MemorySegment.ofArray(new int[] { 1, 2, 3, 4 }), + () -> MemorySegment.ofArray(new long[] { 1L, 2L, 3L, 4L } ), + () -> MemorySegment.ofArray(new short[] { 1, 2, 3, 4 } ) + ); + return l.stream().map(s -> new Object[] { s }).toArray(Object[][]::new); + } + + @Test(dataProvider="segmentFactories") + public void testBasic(Supplier segmentSupplier) { + var s1 = segmentSupplier.get(); + var s2 = segmentSupplier.get(); + var sOther = s1.isNative() ? OtherSegmentFactory.HEAP.factory.get() + : OtherSegmentFactory.NATIVE.factory.get(); + out.format("testBasic s1:%s, s2:%s, sOther:%s\n", s1, s2, sOther); + assertNull(s1.asOverlappingSlice(s2)); + assertNull(s2.asOverlappingSlice(s1)); + assertNull(s1.asOverlappingSlice(sOther)); + } + + @Test(dataProvider="segmentFactories") + public void testIdentical(Supplier segmentSupplier) { + var s1 = segmentSupplier.get(); + var s2 = s1.asReadOnly(); + out.format("testIdentical s1:%s, s2:%s\n", s1, s2); + assertEquals(s1.asOverlappingSlice(s2).byteSize(), s1.byteSize()); + assertEquals(s1.asOverlappingSlice(s2).scope(), s1.scope()); + + assertEquals(s2.asOverlappingSlice(s1).byteSize(), s2.byteSize()); + assertEquals(s2.asOverlappingSlice(s1).scope(), s2.scope()); + + if (s1.isNative()) { + assertEquals(s1.asOverlappingSlice(s2).address(), s1.address()); + assertEquals(s2.asOverlappingSlice(s1).address(), s2.address()); + } + } + + @Test(dataProvider="segmentFactories") + public void testSlices(Supplier segmentSupplier) { + MemorySegment s1 = segmentSupplier.get(); + MemorySegment s2 = segmentSupplier.get(); + for (int offset = 0 ; offset < 4 ; offset++) { + MemorySegment slice = s1.asSlice(offset); + out.format("testSlices s1:%s, s2:%s, slice:%s, offset:%d\n", s1, s2, slice, offset); + assertEquals(s1.asOverlappingSlice(slice).byteSize(), s1.byteSize() - offset); + assertEquals(s1.asOverlappingSlice(slice).scope(), s1.scope()); + + assertEquals(slice.asOverlappingSlice(s1).byteSize(), slice.byteSize()); + assertEquals(slice.asOverlappingSlice(s1).scope(), slice.scope()); + + if (s1.isNative()) { + assertEquals(s1.asOverlappingSlice(slice).address(), s1.address().addOffset(offset)); + assertEquals(slice.asOverlappingSlice(s1).address(), slice.address()); + } + assertNull(s2.asOverlappingSlice(slice)); + } + } + + enum OtherSegmentFactory { + NATIVE(() -> MemorySegment.allocateNative(16, ResourceScope.newConfinedScope())), + HEAP(() -> MemorySegment.ofArray(new byte[]{16})); + + final Supplier factory; + + OtherSegmentFactory(Supplier segmentFactory) { + this.factory = segmentFactory; + } + } +} diff --git a/test/jdk/java/foreign/TestSegments.java b/test/jdk/java/foreign/TestSegments.java index beadf1618ac..fdf37344823 100644 --- a/test/jdk/java/foreign/TestSegments.java +++ b/test/jdk/java/foreign/TestSegments.java @@ -27,23 +27,21 @@ * @run testng/othervm -Xmx4G -XX:MaxDirectMemorySize=1M TestSegments */ -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.lang.invoke.VarHandle; import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.function.IntFunction; -import java.util.function.LongFunction; import java.util.function.Supplier; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; import static org.testng.Assert.*; public class TestSegments { @@ -53,11 +51,6 @@ public class TestSegments { MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope()); } - @Test(dataProvider = "badLayouts", expectedExceptions = UnsupportedOperationException.class) - public void testBadAllocateLayout(MemoryLayout layout) { - MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); - } - @Test(expectedExceptions = { OutOfMemoryError.class, IllegalArgumentException.class }) public void testAllocateTooBig() { @@ -71,8 +64,8 @@ public class TestSegments { @Test public void testNativeSegmentIsZeroed() { - VarHandle byteHandle = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_BYTE) - .varHandle(byte.class, MemoryLayout.PathElement.sequenceElement()); + VarHandle byteHandle = MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE) + .varHandle(MemoryLayout.PathElement.sequenceElement()); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(1000, 1, scope); for (long i = 0 ; i < segment.byteSize() ; i++) { @@ -83,8 +76,8 @@ public class TestSegments { @Test public void testSlices() { - VarHandle byteHandle = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_BYTE) - .varHandle(byte.class, MemoryLayout.PathElement.sequenceElement()); + VarHandle byteHandle = MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE) + .varHandle(MemoryLayout.PathElement.sequenceElement()); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(10, 1, scope); //init @@ -107,14 +100,14 @@ public class TestSegments { public void testSmallSegmentMax() { long offset = (long)Integer.MAX_VALUE + (long)Integer.MAX_VALUE + 2L + 6L; // overflows to 6 when casted to int MemorySegment memorySegment = MemorySegment.allocateNative(10, ResourceScope.newImplicitScope()); - MemoryAccess.getIntAtOffset(memorySegment, offset); + memorySegment.get(JAVA_INT, offset); } @Test(expectedExceptions = IndexOutOfBoundsException.class) public void testSmallSegmentMin() { long offset = ((long)Integer.MIN_VALUE * 2L) + 6L; // underflows to 6 when casted to int MemorySegment memorySegment = MemorySegment.allocateNative(10, ResourceScope.newImplicitScope()); - MemoryAccess.getIntAtOffset(memorySegment, offset); + memorySegment.get(JAVA_INT, offset); } @Test(dataProvider = "segmentFactories") @@ -125,7 +118,7 @@ public class TestSegments { } static void tryClose(MemorySegment segment) { - if (!segment.scope().isImplicit()) { + if (segment.scope() != ResourceScope.globalScope()) { segment.scope().close(); } } @@ -142,10 +135,10 @@ public class TestSegments { () -> MemorySegment.ofArray(new short[] { 1, 2, 3, 4 } ), () -> MemorySegment.allocateNative(4, ResourceScope.newImplicitScope()), () -> MemorySegment.allocateNative(4, 8, ResourceScope.newImplicitScope()), - () -> MemorySegment.allocateNative(MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()), ResourceScope.newImplicitScope()), - () -> MemorySegment.allocateNative(4, ResourceScope.newConfinedScope()), - () -> MemorySegment.allocateNative(4, 8, ResourceScope.newConfinedScope()), - () -> MemorySegment.allocateNative(MemoryLayout.valueLayout(32, ByteOrder.nativeOrder()), ResourceScope.newConfinedScope()) + () -> MemorySegment.allocateNative(JAVA_INT, ResourceScope.newImplicitScope()), + () -> MemorySegment.allocateNative(4, ResourceScope.newImplicitScope()), + () -> MemorySegment.allocateNative(4, 8, ResourceScope.newImplicitScope()), + () -> MemorySegment.allocateNative(JAVA_INT, ResourceScope.newImplicitScope()) ); return l.stream().map(s -> new Object[] { s }).toArray(Object[][]::new); @@ -153,8 +146,8 @@ public class TestSegments { @Test(dataProvider = "segmentFactories") public void testFill(Supplier memorySegmentSupplier) { - VarHandle byteHandle = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_BYTE) - .varHandle(byte.class, MemoryLayout.PathElement.sequenceElement()); + VarHandle byteHandle = MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE) + .varHandle(MemoryLayout.PathElement.sequenceElement()); for (byte value : new byte[] {(byte) 0xFF, (byte) 0x00, (byte) 0x45}) { MemorySegment segment = memorySegmentSupplier.get(); @@ -193,15 +186,13 @@ public class TestSegments { } @Test(dataProvider = "segmentFactories") - public void testNativeSegments(Supplier memorySegmentSupplier) throws Exception { + public void testNativeSegments(Supplier memorySegmentSupplier) { MemorySegment segment = memorySegmentSupplier.get(); try { - segment.address().toRawLongValue(); + segment.address(); assertTrue(segment.isNative()); - assertTrue(segment.address().isNative()); } catch (UnsupportedOperationException exception) { assertFalse(segment.isNative()); - assertFalse(segment.address().isNative()); } tryClose(segment); } @@ -262,33 +253,6 @@ public class TestSegments { }; } - @DataProvider(name = "badLayouts") - public Object[][] layouts() { - SizedLayoutFactory[] layoutFactories = SizedLayoutFactory.values(); - Object[][] values = new Object[layoutFactories.length * 2][2]; - for (int i = 0; i < layoutFactories.length ; i++) { - values[i * 2] = new Object[] { MemoryLayout.structLayout(layoutFactories[i].make(7), MemoryLayout.paddingLayout(9)) }; // good size, bad align - values[(i * 2) + 1] = new Object[] { layoutFactories[i].make(15).withBitAlignment(16) }; // bad size, good align - } - return values; - } - - enum SizedLayoutFactory { - VALUE_BE(size -> MemoryLayout.valueLayout(size, ByteOrder.BIG_ENDIAN)), - VALUE_LE(size -> MemoryLayout.valueLayout(size, ByteOrder.LITTLE_ENDIAN)), - PADDING(MemoryLayout::paddingLayout); - - private final LongFunction factory; - - SizedLayoutFactory(LongFunction factory) { - this.factory = factory; - } - - MemoryLayout make(long size) { - return factory.apply(size); - } - } - @DataProvider(name = "heapFactories") public Object[][] heapFactories() { return new Object[][] { diff --git a/test/jdk/java/foreign/TestSharedAccess.java b/test/jdk/java/foreign/TestSharedAccess.java index b5b5f717b46..346d92acef7 100644 --- a/test/jdk/java/foreign/TestSharedAccess.java +++ b/test/jdk/java/foreign/TestSharedAccess.java @@ -43,11 +43,11 @@ import static org.testng.Assert.*; public class TestSharedAccess { - static final VarHandle intHandle = MemoryLayouts.JAVA_INT.varHandle(int.class); + static final VarHandle intHandle = ValueLayout.JAVA_INT.varHandle(); @Test public void testShared() throws Throwable { - SequenceLayout layout = MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_INT); + SequenceLayout layout = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT); try (ResourceScope scope = ResourceScope.newSharedScope()) { MemorySegment s = MemorySegment.allocateNative(layout, scope); for (int i = 0 ; i < layout.elementCount().getAsLong() ; i++) { @@ -98,7 +98,7 @@ public class TestSharedAccess { setInt(s, 42); assertEquals(getInt(s), 42); List threads = new ArrayList<>(); - MemorySegment sharedSegment = s.address().asSegment(s.byteSize(), scope); + MemorySegment sharedSegment = MemorySegment.ofAddress(s.address(), s.byteSize(), scope); for (int i = 0 ; i < 1000 ; i++) { threads.add(new Thread(() -> { assertEquals(getInt(sharedSegment), 42); @@ -121,7 +121,7 @@ public class TestSharedAccess { CountDownLatch b = new CountDownLatch(1); CompletableFuture r; try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment s1 = MemorySegment.allocateNative(MemoryLayout.sequenceLayout(2, MemoryLayouts.JAVA_INT), scope); + MemorySegment s1 = MemorySegment.allocateNative(MemoryLayout.sequenceLayout(2, ValueLayout.JAVA_INT), scope); r = CompletableFuture.runAsync(() -> { try { ByteBuffer bb = s1.asByteBuffer(); diff --git a/test/jdk/java/foreign/TestSlices.java b/test/jdk/java/foreign/TestSlices.java index da9ad9135b1..0cdc392cd93 100644 --- a/test/jdk/java/foreign/TestSlices.java +++ b/test/jdk/java/foreign/TestSlices.java @@ -23,12 +23,12 @@ */ import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import java.lang.invoke.VarHandle; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; import static org.testng.Assert.*; @@ -39,9 +39,9 @@ import static org.testng.Assert.*; public class TestSlices { static MemoryLayout LAYOUT = MemoryLayout.sequenceLayout(2, - MemoryLayout.sequenceLayout(5, MemoryLayouts.JAVA_INT)); + MemoryLayout.sequenceLayout(5, ValueLayout.JAVA_INT)); - static VarHandle VH_ALL = LAYOUT.varHandle(int.class, + static VarHandle VH_ALL = LAYOUT.varHandle( MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement()); @Test(dataProvider = "slices") @@ -76,16 +76,16 @@ public class TestSlices { // x { VH_ALL, 2, 5, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } }, // x[0::2] - { LAYOUT.varHandle(int.class, MemoryLayout.PathElement.sequenceElement(), + { LAYOUT.varHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement(0, 2)), 2, 3, new int[] { 1, 3, 5, 6, 8, 10 } }, // x[1::2] - { LAYOUT.varHandle(int.class, MemoryLayout.PathElement.sequenceElement(), + { LAYOUT.varHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement(1, 2)), 2, 2, new int[] { 2, 4, 7, 9 } }, // x[4::-2] - { LAYOUT.varHandle(int.class, MemoryLayout.PathElement.sequenceElement(), + { LAYOUT.varHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement(4, -2)), 2, 3, new int[] { 5, 3, 1, 10, 8, 6 } }, // x[3::-2] - { LAYOUT.varHandle(int.class, MemoryLayout.PathElement.sequenceElement(), + { LAYOUT.varHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement(3, -2)), 2, 2, new int[] { 4, 2, 9, 7 } }, }; } diff --git a/test/jdk/java/foreign/TestSpliterator.java b/test/jdk/java/foreign/TestSpliterator.java index d8c3fe24e0a..17f4ef39259 100644 --- a/test/jdk/java/foreign/TestSpliterator.java +++ b/test/jdk/java/foreign/TestSpliterator.java @@ -27,7 +27,6 @@ */ import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SequenceLayout; @@ -40,22 +39,22 @@ import java.util.concurrent.CountedCompleter; import java.util.concurrent.RecursiveTask; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.LongStream; -import java.util.stream.StreamSupport; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; import static org.testng.Assert.*; public class TestSpliterator { - static final VarHandle INT_HANDLE = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT) - .varHandle(int.class, MemoryLayout.PathElement.sequenceElement()); + static final VarHandle INT_HANDLE = MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT) + .varHandle(MemoryLayout.PathElement.sequenceElement()); final static int CARRIER_SIZE = 4; @Test(dataProvider = "splits") public void testSum(int size, int threshold) { - SequenceLayout layout = MemoryLayout.sequenceLayout(size, MemoryLayouts.JAVA_INT); + SequenceLayout layout = MemoryLayout.sequenceLayout(size, ValueLayout.JAVA_INT); //setup try (ResourceScope scope = ResourceScope.newSharedScope()) { @@ -82,7 +81,7 @@ public class TestSpliterator { @Test public void testSumSameThread() { - SequenceLayout layout = MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_INT); + SequenceLayout layout = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT); //setup MemorySegment segment = MemorySegment.allocateNative(layout, ResourceScope.newImplicitScope()); @@ -100,32 +99,32 @@ public class TestSpliterator { @Test(expectedExceptions = IllegalArgumentException.class) public void testBadSpliteratorElementSizeTooBig() { - MemorySegment.ofArray(new byte[2]).spliterator(MemoryLayouts.JAVA_INT); + MemorySegment.ofArray(new byte[2]).spliterator(ValueLayout.JAVA_INT); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadStreamElementSizeTooBig() { - MemorySegment.ofArray(new byte[2]).elements(MemoryLayouts.JAVA_INT); + MemorySegment.ofArray(new byte[2]).elements(ValueLayout.JAVA_INT); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadSpliteratorElementSizeNotMultiple() { - MemorySegment.ofArray(new byte[7]).spliterator(MemoryLayouts.JAVA_INT); + MemorySegment.ofArray(new byte[7]).spliterator(ValueLayout.JAVA_INT); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadStreamElementSizeNotMultiple() { - MemorySegment.ofArray(new byte[7]).elements(MemoryLayouts.JAVA_INT); + MemorySegment.ofArray(new byte[7]).elements(ValueLayout.JAVA_INT); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadSpliteratorElementSizeZero() { - MemorySegment.ofArray(new byte[7]).spliterator(MemoryLayout.sequenceLayout(0, MemoryLayouts.JAVA_INT)); + MemorySegment.ofArray(new byte[7]).spliterator(MemoryLayout.sequenceLayout(0, ValueLayout.JAVA_INT)); } @Test(expectedExceptions = IllegalArgumentException.class) public void testBadStreamElementSizeZero() { - MemorySegment.ofArray(new byte[7]).elements(MemoryLayout.sequenceLayout(0, MemoryLayouts.JAVA_INT)); + MemorySegment.ofArray(new byte[7]).elements(MemoryLayout.sequenceLayout(0, ValueLayout.JAVA_INT)); } static long sumSingle(long acc, MemorySegment segment) { diff --git a/test/jdk/java/foreign/TestStringEncoding.java b/test/jdk/java/foreign/TestStringEncoding.java index 90fae756ada..baa14db9d9b 100644 --- a/test/jdk/java/foreign/TestStringEncoding.java +++ b/test/jdk/java/foreign/TestStringEncoding.java @@ -22,10 +22,10 @@ * */ -import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.SegmentAllocator; import org.testng.annotations.*; import static org.testng.Assert.*; @@ -40,11 +40,12 @@ public class TestStringEncoding { @Test(dataProvider = "strings") public void testStrings(String testString, int expectedByteLength) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment text = CLinker.toCString(testString, scope); + SegmentAllocator allocator = SegmentAllocator.newNativeArena(expectedByteLength, scope); + MemorySegment text = allocator.allocateUtf8String(testString); assertEquals(text.byteSize(), expectedByteLength); - String roundTrip = CLinker.toJavaString(text); + String roundTrip = text.getUtf8String(0); assertEquals(roundTrip, testString); } } diff --git a/test/jdk/java/foreign/TestSymbolLookup.java b/test/jdk/java/foreign/TestSymbolLookup.java index 1cc537d5261..fa76aa89ce3 100644 --- a/test/jdk/java/foreign/TestSymbolLookup.java +++ b/test/jdk/java/foreign/TestSymbolLookup.java @@ -29,12 +29,12 @@ */ import jdk.incubator.foreign.SymbolLookup; -import jdk.incubator.foreign.MemoryAccess; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.Test; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static org.testng.Assert.*; // FYI this test is run on 64-bit platforms only for now, @@ -61,7 +61,7 @@ public class TestSymbolLookup { @Test public void testVariableSymbolLookup() { - MemorySegment segment = LOOKUP.lookup("c").get().asSegment(MemoryLayouts.JAVA_INT.byteSize(), ResourceScope.globalScope()); - assertEquals(MemoryAccess.getInt(segment), 42); + MemorySegment segment = MemorySegment.ofAddress(LOOKUP.lookup("c").get().address(), ValueLayout.JAVA_INT.byteSize(), ResourceScope.globalScope()); + assertEquals(segment.get(JAVA_BYTE, 0), 42); } } diff --git a/test/jdk/java/foreign/TestTypeAccess.java b/test/jdk/java/foreign/TestTypeAccess.java index 9683f58987f..dc3ee8434bd 100644 --- a/test/jdk/java/foreign/TestTypeAccess.java +++ b/test/jdk/java/foreign/TestTypeAccess.java @@ -27,10 +27,9 @@ * @run testng TestTypeAccess */ -import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemorySegment; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; import java.lang.invoke.VarHandle; @@ -38,24 +37,17 @@ import java.lang.invoke.WrongMethodTypeException; public class TestTypeAccess { - static final VarHandle INT_HANDLE = MemoryLayouts.JAVA_INT.varHandle(int.class); - - static final VarHandle ADDR_HANDLE = MemoryHandles.asAddressVarHandle(INT_HANDLE); + static final VarHandle INT_HANDLE = ValueLayout.JAVA_INT.varHandle(); + static final VarHandle ADDR_HANDLE = ValueLayout.ADDRESS.varHandle(); @Test(expectedExceptions=ClassCastException.class) public void testMemoryAddressCoordinateAsString() { - try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment s = MemorySegment.allocateNative(8, 8, scope); - int v = (int)INT_HANDLE.get("string"); - } + int v = (int)INT_HANDLE.get("string"); } @Test(expectedExceptions=WrongMethodTypeException.class) public void testMemoryCoordinatePrimitive() { - try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment s = MemorySegment.allocateNative(8, 8, scope); - int v = (int)INT_HANDLE.get(1); - } + int v = (int)INT_HANDLE.get(1); } @Test(expectedExceptions=ClassCastException.class) diff --git a/test/jdk/java/foreign/TestUnsupportedPlatform.java b/test/jdk/java/foreign/TestUnsupportedPlatform.java index 478cac72e33..eb1b5cf53a4 100644 --- a/test/jdk/java/foreign/TestUnsupportedPlatform.java +++ b/test/jdk/java/foreign/TestUnsupportedPlatform.java @@ -39,7 +39,7 @@ public class TestUnsupportedPlatform { @Test(expectedExceptions = ExceptionInInitializerError.class) public void testNoInitialization() { - CLinker.getInstance(); // trigger initialization + CLinker.systemCLinker(); // trigger initialization } } diff --git a/test/jdk/java/foreign/TestUpcall.java b/test/jdk/java/foreign/TestUpcall.java index 2b679e85396..9ee7a381cae 100644 --- a/test/jdk/java/foreign/TestUpcall.java +++ b/test/jdk/java/foreign/TestUpcall.java @@ -23,24 +23,29 @@ */ /* - * @test + * @test id=async * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" * @modules jdk.incubator.foreign/jdk.internal.foreign * @build NativeTestHelper CallGeneratorHelper TestUpcall * * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 + * -DUPCALL_TEST_TYPE=ASYNC * TestUpcall */ +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; +import org.testng.SkipException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -48,22 +53,32 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.stream.Collectors; import static java.lang.invoke.MethodHandles.insertArguments; -import static jdk.incubator.foreign.CLinker.C_POINTER; import static org.testng.Assert.assertEquals; public class TestUpcall extends CallGeneratorHelper { + private enum TestType { + SCOPE, + NO_SCOPE, + ASYNC + } + + private static final TestType UPCALL_TEST_TYPE = TestType.valueOf(System.getProperty("UPCALL_TEST_TYPE")); + static { System.loadLibrary("TestUpcall"); + System.loadLibrary("AsyncInvokers"); } - static CLinker abi = CLinker.getInstance(); + static CLinker abi = CLinker.systemCLinker(); static final SymbolLookup LOOKUP = SymbolLookup.loaderLookup(); @@ -80,22 +95,29 @@ public class TestUpcall extends CallGeneratorHelper { } } - static MemoryAddress dummyStub; + static NativeSymbol dummyStub; @BeforeClass void setup() { dummyStub = abi.upcallStub(DUMMY, FunctionDescriptor.ofVoid(), ResourceScope.newImplicitScope()); } + private static void checkSelected(TestType type) { + if (UPCALL_TEST_TYPE != type) + return;//throw new SkipException("Skipping tests that were not selected"); + } + @Test(dataProvider="functions", dataProviderClass=CallGeneratorHelper.class) public void testUpcalls(int count, String fName, Ret ret, List paramTypes, List fields) throws Throwable { + checkSelected(TestType.SCOPE); + List> returnChecks = new ArrayList<>(); List> argChecks = new ArrayList<>(); - MemoryAddress addr = LOOKUP.lookup(fName).get(); - MethodType mtype = methodType(ret, paramTypes, fields); - try (NativeScope scope = new NativeScope()) { - MethodHandle mh = abi.downcallHandle(addr, scope, mtype, function(ret, paramTypes, fields)); - Object[] args = makeArgs(scope.scope(), ret, paramTypes, fields, returnChecks, argChecks); + NativeSymbol addr = LOOKUP.lookup(fName).get(); + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); + MethodHandle mh = downcallHandle(abi, addr, allocator, function(ret, paramTypes, fields)); + Object[] args = makeArgs(scope, ret, paramTypes, fields, returnChecks, argChecks); Object[] callArgs = args; Object res = mh.invokeWithArguments(callArgs); argChecks.forEach(c -> c.accept(args)); @@ -106,29 +128,57 @@ public class TestUpcall extends CallGeneratorHelper { } @Test(dataProvider="functions", dataProviderClass=CallGeneratorHelper.class) - public void testUpcallsNoScope(int count, String fName, Ret ret, List paramTypes, List fields) throws Throwable { + public void testUpcallsAsync(int count, String fName, Ret ret, List paramTypes, List fields) throws Throwable { + checkSelected(TestType.ASYNC); List> returnChecks = new ArrayList<>(); List> argChecks = new ArrayList<>(); - MemoryAddress addr = LOOKUP.lookup(fName).get(); - MethodType mtype = methodType(ret, paramTypes, fields); - MethodHandle mh = abi.downcallHandle(addr, IMPLICIT_ALLOCATOR, mtype, function(ret, paramTypes, fields)); - Object[] args = makeArgs(ResourceScope.newImplicitScope(), ret, paramTypes, fields, returnChecks, argChecks); - Object[] callArgs = args; - Object res = mh.invokeWithArguments(callArgs); - argChecks.forEach(c -> c.accept(args)); - if (ret == Ret.NON_VOID) { - returnChecks.forEach(c -> c.accept(res)); + NativeSymbol addr = LOOKUP.lookup(fName).get(); + try (ResourceScope scope = ResourceScope.newSharedScope()) { + SegmentAllocator allocator = SegmentAllocator.newNativeArena(scope); + FunctionDescriptor descriptor = function(ret, paramTypes, fields); + MethodHandle mh = downcallHandle(abi, addr, allocator, descriptor); + Object[] args = makeArgs(ResourceScope.newImplicitScope(), ret, paramTypes, fields, returnChecks, argChecks); + + mh = mh.asSpreader(Object[].class, args.length); + mh = MethodHandles.insertArguments(mh, 0, (Object) args); + FunctionDescriptor callbackDesc = descriptor.returnLayout() + .map(FunctionDescriptor::of) + .orElse(FunctionDescriptor.ofVoid()); + NativeSymbol callback = abi.upcallStub(mh.asType(CLinker.upcallType(callbackDesc)), callbackDesc, scope); + + MethodHandle invoker = asyncInvoker(ret, ret == Ret.VOID ? null : paramTypes.get(0), fields); + + Object res = invoker.type().returnType() == MemorySegment.class + ? invoker.invoke(allocator, callback) + : invoker.invoke(callback); + argChecks.forEach(c -> c.accept(args)); + if (ret == Ret.NON_VOID) { + returnChecks.forEach(c -> c.accept(res)); + } } } - static MethodType methodType(Ret ret, List params, List fields) { - MethodType mt = ret == Ret.VOID ? - MethodType.methodType(void.class) : MethodType.methodType(paramCarrier(params.get(0).layout(fields))); - for (ParamType p : params) { - mt = mt.appendParameterTypes(paramCarrier(p.layout(fields))); + private static final Map INVOKERS = new HashMap<>(); + + private MethodHandle asyncInvoker(Ret ret, ParamType returnType, List fields) { + if (ret == Ret.VOID) { + String name = "call_async_V"; + return INVOKERS.computeIfAbsent(name, symbol -> + abi.downcallHandle( + LOOKUP.lookup(symbol).orElseThrow(), + FunctionDescriptor.ofVoid(C_POINTER))); } - mt = mt.appendParameterTypes(MemoryAddress.class); //the callback - return mt; + + String name = "call_async_" + returnType.name().charAt(0) + + (returnType == ParamType.STRUCT ? "_" + sigCode(fields) : ""); + + return INVOKERS.computeIfAbsent(name, symbol -> { + NativeSymbol invokerSymbol = LOOKUP.lookup(symbol).orElseThrow(); + MemoryLayout returnLayout = returnType.layout(fields); + FunctionDescriptor desc = FunctionDescriptor.of(returnLayout, C_POINTER); + + return abi.downcallHandle(invokerSymbol, desc); + }); } static FunctionDescriptor function(Ret ret, List params, List fields) { @@ -150,9 +200,9 @@ public class TestUpcall extends CallGeneratorHelper { } @SuppressWarnings("unchecked") - static MemoryAddress makeCallback(ResourceScope scope, Ret ret, List params, List fields, List> checks, List> argChecks) { + static NativeSymbol makeCallback(ResourceScope scope, Ret ret, List params, List fields, List> checks, List> argChecks) { if (params.isEmpty()) { - return dummyStub.address(); + return dummyStub; } AtomicReference box = new AtomicReference<>(); @@ -162,7 +212,7 @@ public class TestUpcall extends CallGeneratorHelper { for (int i = 0; i < params.size(); i++) { ParamType pt = params.get(i); MemoryLayout layout = pt.layout(fields); - Class carrier = paramCarrier(layout); + Class carrier = carrier(layout, false); mh = mh.asType(mh.type().changeParameterType(i, carrier)); final int finalI = i; @@ -175,7 +225,7 @@ public class TestUpcall extends CallGeneratorHelper { ParamType firstParam = params.get(0); MemoryLayout firstlayout = firstParam.layout(fields); - Class firstCarrier = paramCarrier(firstlayout); + Class firstCarrier = carrier(firstlayout, true); if (firstCarrier == MemorySegment.class) { checks.add(o -> assertStructEquals((MemorySegment) box.get()[0], (MemorySegment) o, firstlayout)); diff --git a/test/jdk/java/foreign/TestUpcallException.java b/test/jdk/java/foreign/TestUpcallException.java index d6630a74d77..900b9c58513 100644 --- a/test/jdk/java/foreign/TestUpcallException.java +++ b/test/jdk/java/foreign/TestUpcallException.java @@ -33,9 +33,6 @@ * TestUpcallException */ -import jdk.incubator.foreign.CLinker; -import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.ResourceScope; import jdk.test.lib.Utils; import org.testng.annotations.Test; @@ -54,17 +51,17 @@ public class TestUpcallException { @Test public void testExceptionInterpreted() throws InterruptedException, IOException { - boolean useSpec = false; - run(useSpec); + run(/* useSpec = */ false, /* isVoid = */ true); + run(/* useSpec = */ false, /* isVoid = */ false); } @Test public void testExceptionSpecialized() throws IOException, InterruptedException { - boolean useSpec = true; - run(useSpec); + run(/* useSpec = */ true, /* isVoid = */ true); + run(/* useSpec = */ true, /* isVoid = */ false); } - private void run(boolean useSpec) throws IOException, InterruptedException { + private void run(boolean useSpec, boolean isVoid) throws IOException, InterruptedException { Process process = new ProcessBuilder() .command( Paths.get(Utils.TEST_JDK) @@ -77,7 +74,8 @@ public class TestUpcallException { "-Djava.library.path=" + System.getProperty("java.library.path"), "-Djdk.internal.foreign.ProgrammableUpcallHandler.USE_SPEC=" + useSpec, "-cp", Utils.TEST_CLASS_PATH, - "ThrowingUpcall") + "ThrowingUpcall", + isVoid ? "void" : "non-void") .start(); int result = process.waitFor(); diff --git a/test/jdk/java/foreign/TestUpcallHighArity.java b/test/jdk/java/foreign/TestUpcallHighArity.java index dfe819c97e2..b025de9ed4a 100644 --- a/test/jdk/java/foreign/TestUpcallHighArity.java +++ b/test/jdk/java/foreign/TestUpcallHighArity.java @@ -33,8 +33,10 @@ * TestUpcallHighArity */ +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; @@ -49,13 +51,12 @@ import java.lang.invoke.MethodType; import java.util.List; import java.util.concurrent.atomic.AtomicReference; -import static jdk.incubator.foreign.CLinker.*; import static org.testng.Assert.assertEquals; public class TestUpcallHighArity extends CallGeneratorHelper { static final MethodHandle MH_do_upcall; static final MethodHandle MH_passAndSave; - static final CLinker LINKER = CLinker.getInstance(); + static final CLinker LINKER = CLinker.systemCLinker(); // struct S_PDI { void* p0; double p1; int p2; }; static final MemoryLayout S_PDI_LAYOUT = MemoryLayout.structLayout( @@ -70,12 +71,7 @@ public class TestUpcallHighArity extends CallGeneratorHelper { SymbolLookup lookup = SymbolLookup.loaderLookup(); MH_do_upcall = LINKER.downcallHandle( lookup.lookup("do_upcall").get(), - MethodType.methodType(void.class, MemoryAddress.class, - MemorySegment.class, int.class, double.class, MemoryAddress.class, - MemorySegment.class, int.class, double.class, MemoryAddress.class, - MemorySegment.class, int.class, double.class, MemoryAddress.class, - MemorySegment.class, int.class, double.class, MemoryAddress.class), - FunctionDescriptor.ofVoid(C_POINTER, + FunctionDescriptor.ofVoid(C_POINTER, S_PDI_LAYOUT, C_INT, C_DOUBLE, C_POINTER, S_PDI_LAYOUT, C_INT, C_DOUBLE, C_POINTER, S_PDI_LAYOUT, C_INT, C_DOUBLE, C_POINTER, @@ -108,9 +104,9 @@ public class TestUpcallHighArity extends CallGeneratorHelper { .asCollector(Object[].class, upcallType.parameterCount()) .asType(upcallType); try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemoryAddress upcallStub = LINKER.upcallStub(target, upcallDescriptor, scope); + NativeSymbol upcallStub = LINKER.upcallStub(target, upcallDescriptor, scope); Object[] args = new Object[upcallType.parameterCount() + 1]; - args[0] = upcallStub.address(); + args[0] = upcallStub; List argLayouts = upcallDescriptor.argumentLayouts(); for (int i = 1; i < args.length; i++) { args[i] = makeArg(argLayouts.get(i - 1), null, false); @@ -123,7 +119,7 @@ public class TestUpcallHighArity extends CallGeneratorHelper { if (upcallType.parameterType(i) == MemorySegment.class) { assertStructEquals((MemorySegment) capturedArgsArr[i], (MemorySegment) args[i + 1], argLayouts.get(i)); } else { - assertEquals(capturedArgsArr[i], args[i + 1]); + assertEquals(capturedArgsArr[i], args[i + 1], "For index " + i); } } } diff --git a/test/jdk/java/foreign/TestUpcallStructScope.java b/test/jdk/java/foreign/TestUpcallStructScope.java index 72bb1eafb9f..045d6191a9d 100644 --- a/test/jdk/java/foreign/TestUpcallStructScope.java +++ b/test/jdk/java/foreign/TestUpcallStructScope.java @@ -37,8 +37,10 @@ * TestUpcallStructScope */ +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; @@ -52,14 +54,11 @@ import java.lang.invoke.MethodType; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; -import static jdk.incubator.foreign.CLinker.C_DOUBLE; -import static jdk.incubator.foreign.CLinker.C_INT; -import static jdk.incubator.foreign.CLinker.C_POINTER; import static org.testng.Assert.assertFalse; -public class TestUpcallStructScope { +public class TestUpcallStructScope extends NativeTestHelper { static final MethodHandle MH_do_upcall; - static final CLinker LINKER = CLinker.getInstance(); + static final CLinker LINKER = CLinker.systemCLinker(); static final MethodHandle MH_Consumer_accept; // struct S_PDI { void* p0; double p1; int p2; }; @@ -74,8 +73,7 @@ public class TestUpcallStructScope { SymbolLookup lookup = SymbolLookup.loaderLookup(); MH_do_upcall = LINKER.downcallHandle( lookup.lookup("do_upcall").get(), - MethodType.methodType(void.class, MemoryAddress.class, MemorySegment.class), - FunctionDescriptor.ofVoid(C_POINTER, S_PDI_LAYOUT) + FunctionDescriptor.ofVoid(C_POINTER, S_PDI_LAYOUT) ); try { @@ -96,9 +94,9 @@ public class TestUpcallStructScope { MethodHandle target = methodHandle(capturedSegment::set); FunctionDescriptor upcallDesc = FunctionDescriptor.ofVoid(S_PDI_LAYOUT); try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemoryAddress upcallStub = LINKER.upcallStub(target, upcallDesc, scope); + NativeSymbol upcallStub = LINKER.upcallStub(target, upcallDesc, scope); MemorySegment argSegment = MemorySegment.allocateNative(S_PDI_LAYOUT, scope); - MH_do_upcall.invokeExact(upcallStub.address(), argSegment); + MH_do_upcall.invoke(upcallStub, argSegment); } MemorySegment captured = capturedSegment.get(); diff --git a/test/jdk/java/foreign/TestVarArgs.java b/test/jdk/java/foreign/TestVarArgs.java index 40ccea4e684..0efc22d7514 100644 --- a/test/jdk/java/foreign/TestVarArgs.java +++ b/test/jdk/java/foreign/TestVarArgs.java @@ -33,6 +33,7 @@ import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.ValueLayout; @@ -45,27 +46,26 @@ import java.lang.invoke.VarHandle; import java.util.ArrayList; import java.util.List; -import static jdk.incubator.foreign.CLinker.*; import static jdk.incubator.foreign.MemoryLayout.PathElement.*; import static org.testng.Assert.assertEquals; -public class TestVarArgs { +public class TestVarArgs extends NativeTestHelper { static final MemoryLayout ML_CallInfo = MemoryLayout.structLayout( C_POINTER.withName("writeback"), // writeback C_POINTER.withName("argIDs")); // arg ids - static final VarHandle VH_CallInfo_writeback = ML_CallInfo.varHandle(long.class, groupElement("writeback")); - static final VarHandle VH_CallInfo_argIDs = ML_CallInfo.varHandle(long.class, groupElement("argIDs")); + static final VarHandle VH_CallInfo_writeback = ML_CallInfo.varHandle(groupElement("writeback")); + static final VarHandle VH_CallInfo_argIDs = ML_CallInfo.varHandle(groupElement("argIDs")); - static final VarHandle VH_IntArray = MemoryLayout.sequenceLayout(C_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_IntArray = MemoryLayout.sequenceLayout(C_INT).varHandle(sequenceElement()); - static final CLinker abi = CLinker.getInstance(); + static final CLinker abi = CLinker.systemCLinker(); static { System.loadLibrary("VarArgs"); } - static final MemoryAddress VARARGS_ADDR = + static final NativeSymbol VARARGS_ADDR = SymbolLookup.loaderLookup() .lookup("varargs").get(); @@ -80,8 +80,8 @@ public class TestVarArgs { MemoryAddress callInfoPtr = callInfo.address(); - VH_CallInfo_writeback.set(callInfo, writeBack.address().toRawLongValue()); - VH_CallInfo_argIDs.set(callInfo, argIDs.address().toRawLongValue()); + VH_CallInfo_writeback.set(callInfo, writeBack.address()); + VH_CallInfo_argIDs.set(callInfo, argIDs.address()); for (int i = 0; i < args.size(); i++) { VH_IntArray.set(argIDs, (long) i, args.get(i).id.ordinal()); @@ -90,9 +90,9 @@ public class TestVarArgs { List argLayouts = new ArrayList<>(); argLayouts.add(C_POINTER); // call info argLayouts.add(C_INT); // size - args.forEach(a -> argLayouts.add(asVarArg(a.layout))); - FunctionDescriptor desc = FunctionDescriptor.ofVoid(argLayouts.toArray(MemoryLayout[]::new)); + FunctionDescriptor desc = FunctionDescriptor.ofVoid(argLayouts.stream().toArray(MemoryLayout[]::new)) + .asVariadic(args.stream().map(a -> a.layout).toArray(MemoryLayout[]::new)); List> carriers = new ArrayList<>(); carriers.add(MemoryAddress.class); // call info @@ -101,7 +101,7 @@ public class TestVarArgs { MethodType mt = MethodType.methodType(void.class, carriers); - MethodHandle downcallHandle = abi.downcallHandle(VARARGS_ADDR, mt, desc); + MethodHandle downcallHandle = abi.downcallHandle(VARARGS_ADDR, desc); List argValues = new ArrayList<>(); argValues.add(callInfoPtr); // call info @@ -140,7 +140,7 @@ public class TestVarArgs { this.value = value; this.layout = layout; this.carrier = carrier; - this.vh = layout.varHandle(carrier); + this.vh = layout.varHandle(); } static VarArg intArg(int value) { diff --git a/test/jdk/java/foreign/TestVarHandleCombinators.java b/test/jdk/java/foreign/TestVarHandleCombinators.java index 2090c31fdd9..e9beaebafa8 100644 --- a/test/jdk/java/foreign/TestVarHandleCombinators.java +++ b/test/jdk/java/foreign/TestVarHandleCombinators.java @@ -29,6 +29,7 @@ import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -43,7 +44,7 @@ public class TestVarHandleCombinators { @Test public void testElementAccess() { - VarHandle vh = MemoryHandles.varHandle(byte.class, ByteOrder.nativeOrder()); + VarHandle vh = MemoryHandles.varHandle(ValueLayout.JAVA_BYTE); byte[] arr = { 0, 0, -1, 0 }; MemorySegment segment = MemorySegment.ofArray(arr); @@ -52,7 +53,7 @@ public class TestVarHandleCombinators { @Test(expectedExceptions = IllegalStateException.class) public void testUnalignedElement() { - VarHandle vh = MemoryHandles.varHandle(byte.class, 4, ByteOrder.nativeOrder()); + VarHandle vh = MemoryHandles.varHandle(ValueLayout.JAVA_BYTE.withBitAlignment(32)); MemorySegment segment = MemorySegment.ofArray(new byte[4]); vh.get(segment, 2L); //should throw //FIXME: the VH only checks the alignment of the segment, which is fine if the VH is derived from layouts, @@ -60,19 +61,9 @@ public class TestVarHandleCombinators { //FIXME: at least until the VM is fixed } - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAlignNotPowerOf2() { - VarHandle vh = MemoryHandles.varHandle(byte.class, 3, ByteOrder.nativeOrder()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAlignNegative() { - VarHandle vh = MemoryHandles.varHandle(byte.class, -1, ByteOrder.nativeOrder()); - } - @Test public void testAlign() { - VarHandle vh = MemoryHandles.varHandle(byte.class, 2, ByteOrder.nativeOrder()); + VarHandle vh = MemoryHandles.varHandle(ValueLayout.JAVA_BYTE.withBitAlignment(16)); MemorySegment segment = MemorySegment.allocateNative(1, 2, ResourceScope.newImplicitScope()); vh.set(segment, 0L, (byte) 10); // fine, memory region is aligned @@ -81,7 +72,7 @@ public class TestVarHandleCombinators { @Test public void testByteOrderLE() { - VarHandle vh = MemoryHandles.varHandle(short.class, 2, ByteOrder.LITTLE_ENDIAN); + VarHandle vh = MemoryHandles.varHandle(ValueLayout.JAVA_SHORT.withOrder(ByteOrder.LITTLE_ENDIAN)); byte[] arr = new byte[2]; MemorySegment segment = MemorySegment.ofArray(arr); vh.set(segment, 0L, (short) 0xFF); @@ -91,7 +82,7 @@ public class TestVarHandleCombinators { @Test public void testByteOrderBE() { - VarHandle vh = MemoryHandles.varHandle(short.class, 2, ByteOrder.BIG_ENDIAN); + VarHandle vh = MemoryHandles.varHandle(ValueLayout.JAVA_SHORT.withOrder(ByteOrder.BIG_ENDIAN)); byte[] arr = new byte[2]; MemorySegment segment = MemorySegment.ofArray(arr); vh.set(segment, 0L, (short) 0xFF); @@ -106,7 +97,7 @@ public class TestVarHandleCombinators { //[10 : [5 : [x32 i32]]] - VarHandle vh = MemoryHandles.varHandle(int.class, ByteOrder.nativeOrder()); + VarHandle vh = MemoryHandles.varHandle(ValueLayout.JAVA_INT.withBitAlignment(32)); int count = 0; try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment segment = MemorySegment.allocateNative(inner_size * outer_size * 8, 4, scope); @@ -121,21 +112,4 @@ public class TestVarHandleCombinators { } } } - - @Test(dataProvider = "badCarriers", expectedExceptions = IllegalArgumentException.class) - public void testBadCarrier(Class carrier) { - MemoryHandles.varHandle(carrier, ByteOrder.nativeOrder()); - } - - @DataProvider(name = "badCarriers") - public Object[][] createBadCarriers() { - return new Object[][] { - { void.class }, - { boolean.class }, - { Object.class }, - { int[].class }, - { MemorySegment.class } - }; - } - } diff --git a/test/jdk/java/foreign/ThrowingUpcall.java b/test/jdk/java/foreign/ThrowingUpcall.java index 405a89fc2f4..9efbf68565c 100644 --- a/test/jdk/java/foreign/ThrowingUpcall.java +++ b/test/jdk/java/foreign/ThrowingUpcall.java @@ -23,29 +23,30 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SymbolLookup; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import java.security.Permission; -import static jdk.incubator.foreign.CLinker.C_POINTER; +public class ThrowingUpcall extends NativeTestHelper { -public class ThrowingUpcall { - - private static final MethodHandle downcall; + private static final MethodHandle downcallVoid; + private static final MethodHandle downcallNonVoid; public static final MethodHandle MH_throwException; static { System.loadLibrary("TestUpcall"); SymbolLookup lookup = SymbolLookup.loaderLookup(); - downcall = CLinker.getInstance().downcallHandle( + downcallVoid = CLinker.systemCLinker().downcallHandle( lookup.lookup("f0_V__").orElseThrow(), - MethodType.methodType(void.class, MemoryAddress.class), - FunctionDescriptor.ofVoid(C_POINTER) + FunctionDescriptor.ofVoid(C_POINTER) + ); + downcallNonVoid = CLinker.systemCLinker().downcallHandle( + lookup.lookup("f10_I_I_").orElseThrow(), + FunctionDescriptor.of(C_INT, C_INT, C_POINTER) ); try { @@ -61,18 +62,35 @@ public class ThrowingUpcall { } public static void main(String[] args) throws Throwable { - test(); + if (args[0].equals("void")) { + testVoid(); + } else { + testNonVoid(); + } } - public static void test() throws Throwable { + public static void testVoid() throws Throwable { MethodHandle handle = MH_throwException; MethodHandle invoker = MethodHandles.exactInvoker(MethodType.methodType(void.class)); handle = MethodHandles.insertArguments(invoker, 0, handle); try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemoryAddress stub = CLinker.getInstance().upcallStub(handle, FunctionDescriptor.ofVoid(), scope); + NativeSymbol stub = CLinker.systemCLinker().upcallStub(handle, FunctionDescriptor.ofVoid(), scope); + + downcallVoid.invoke(stub); // should call Shutdown.exit(1); + } + } + + public static void testNonVoid() throws Throwable { + MethodHandle handle = MethodHandles.identity(int.class); + handle = MethodHandles.collectArguments(handle, 0, MH_throwException); + MethodHandle invoker = MethodHandles.exactInvoker(MethodType.methodType(int.class, int.class)); + handle = MethodHandles.insertArguments(invoker, 0, handle); + + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + NativeSymbol stub = CLinker.systemCLinker().upcallStub(handle, FunctionDescriptor.of(C_INT, C_INT), scope); - downcall.invokeExact(stub); // should call Shutdown.exit(1); + downcallNonVoid.invoke(42, stub); // should call Shutdown.exit(1); } } diff --git a/test/jdk/java/foreign/callarranger/TestAarch64CallArranger.java b/test/jdk/java/foreign/callarranger/TestAarch64CallArranger.java index eef17a4aad1..382b303f89b 100644 --- a/test/jdk/java/foreign/callarranger/TestAarch64CallArranger.java +++ b/test/jdk/java/foreign/callarranger/TestAarch64CallArranger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -56,7 +56,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { public void testEmpty() { MethodType mt = MethodType.methodType(void.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -78,7 +78,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { C_INT, C_INT, C_INT, C_INT, C_INT, C_INT, C_INT, C_INT, C_INT, C_INT); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -103,11 +103,11 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { @Test public void testTwoIntTwoFloat() { - MethodType mt = MethodType.methodType(void.class, + MethodType mt = MethodType.methodType(void.class, int.class, int.class, float.class, float.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid( C_INT, C_INT, C_FLOAT, C_FLOAT); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -128,7 +128,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { public void testStruct(MemoryLayout struct, Binding[] expectedBindings) { MethodType mt = MethodType.methodType(void.class, MemorySegment.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(struct); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -157,8 +157,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { // struct s { int32_t a, b; double c; int32_t d }; { struct2, new Binding[] { copy(struct2), - baseAddress(), - unboxAddress(), + unboxAddress(MemorySegment.class), vmStore(r0, long.class) }}, // struct s { int32_t a[2]; float b[2] }; @@ -188,7 +187,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { MethodType mt = MethodType.methodType(void.class, MemorySegment.class, MemorySegment.class, int.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(struct1, struct2, C_INT); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -198,14 +197,12 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { checkArgumentBindings(callingSequence, new Binding[][]{ { copy(struct1), - baseAddress(), - unboxAddress(), + unboxAddress(MemorySegment.class), vmStore(r0, long.class) }, { copy(struct2), - baseAddress(), - unboxAddress(), + unboxAddress(MemorySegment.class), vmStore(r1, long.class) }, { vmStore(r2, int.class) } @@ -220,7 +217,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { MethodType mt = MethodType.methodType(MemorySegment.class); FunctionDescriptor fd = FunctionDescriptor.of(struct); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertTrue(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -243,7 +240,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { MethodType mt = MethodType.methodType(MemorySegment.class); FunctionDescriptor fd = FunctionDescriptor.of(struct); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -269,7 +266,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { MethodType mt = MethodType.methodType(MemorySegment.class, float.class, int.class, MemorySegment.class); FunctionDescriptor fd = FunctionDescriptor.of(hfa, C_FLOAT, C_INT, hfa); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -305,7 +302,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { MethodType mt = MethodType.methodType(void.class, MemorySegment.class, MemorySegment.class, MemorySegment.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(struct, struct, struct); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -358,7 +355,7 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { int.class, int.class, int.class, int.class, MemorySegment.class, int.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid( struct, struct, C_INT, C_INT, C_INT, C_INT, C_INT, C_INT, struct, C_INT); - CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; @@ -366,18 +363,60 @@ public class TestAarch64CallArranger extends CallArrangerTestBase { assertEquals(callingSequence.functionDesc(), fd); checkArgumentBindings(callingSequence, new Binding[][]{ - { copy(struct), baseAddress(), unboxAddress(), vmStore(r0, long.class) }, - { copy(struct), baseAddress(), unboxAddress(), vmStore(r1, long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(r0, long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(r1, long.class) }, { vmStore(r2, int.class) }, { vmStore(r3, int.class) }, { vmStore(r4, int.class) }, { vmStore(r5, int.class) }, { vmStore(r6, int.class) }, { vmStore(r7, int.class) }, - { copy(struct), baseAddress(), unboxAddress(), vmStore(stackStorage(0), long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(stackStorage(0), long.class) }, { vmStore(stackStorage(1), int.class) }, }); checkReturnBindings(callingSequence, new Binding[]{}); } + + @Test + public void testVarArgsInRegs() { + MethodType mt = MethodType.methodType(void.class, int.class, int.class, float.class); + FunctionDescriptor fd = FunctionDescriptor.ofVoid(C_INT).asVariadic(C_INT, C_FLOAT); + CallArranger.Bindings bindings = CallArranger.LINUX.getBindings(mt, fd, false); + + assertFalse(bindings.isInMemoryReturn); + CallingSequence callingSequence = bindings.callingSequence; + assertEquals(callingSequence.methodType(), mt); + assertEquals(callingSequence.functionDesc(), fd); + + // This is identical to the non-variadic calling sequence + checkArgumentBindings(callingSequence, new Binding[][]{ + { vmStore(r0, int.class) }, + { vmStore(r1, int.class) }, + { vmStore(v0, float.class) }, + }); + + checkReturnBindings(callingSequence, new Binding[]{}); + } + + @Test + public void testVarArgsOnStack() { + MethodType mt = MethodType.methodType(void.class, int.class, int.class, float.class); + FunctionDescriptor fd = FunctionDescriptor.ofVoid(C_INT).asVariadic(C_INT, C_FLOAT); + CallArranger.Bindings bindings = CallArranger.MACOS.getBindings(mt, fd, false); + + assertFalse(bindings.isInMemoryReturn); + CallingSequence callingSequence = bindings.callingSequence; + assertEquals(callingSequence.methodType(), mt); + assertEquals(callingSequence.functionDesc(), fd); + + // The two variadic arguments should be allocated on the stack + checkArgumentBindings(callingSequence, new Binding[][]{ + { vmStore(r0, int.class) }, + { vmStore(stackStorage(0), int.class) }, + { vmStore(stackStorage(1), float.class) }, + }); + + checkReturnBindings(callingSequence, new Binding[]{}); + } } diff --git a/test/jdk/java/foreign/callarranger/TestWindowsCallArranger.java b/test/jdk/java/foreign/callarranger/TestWindowsCallArranger.java index cb85c6f55e8..98ad5f4befb 100644 --- a/test/jdk/java/foreign/callarranger/TestWindowsCallArranger.java +++ b/test/jdk/java/foreign/callarranger/TestWindowsCallArranger.java @@ -156,8 +156,7 @@ public class TestWindowsCallArranger extends CallArrangerTestBase { { vmStore(rdx, int.class) }, { copy(structLayout), - baseAddress(), - unboxAddress(), + unboxAddress(MemorySegment.class), vmStore(r8, long.class) }, { vmStore(r9, int.class) }, @@ -178,7 +177,7 @@ public class TestWindowsCallArranger extends CallArrangerTestBase { MethodType mt = MethodType.methodType(void.class, int.class, double.class, int.class, double.class, double.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid( - C_INT, C_DOUBLE, asVarArg(C_INT), asVarArg(C_DOUBLE), asVarArg(C_DOUBLE)); + C_INT, C_DOUBLE).asVariadic(C_INT, C_DOUBLE, C_DOUBLE); CallArranger.Bindings bindings = CallArranger.getBindings(mt, fd, false); assertFalse(bindings.isInMemoryReturn); @@ -251,8 +250,7 @@ public class TestWindowsCallArranger extends CallArrangerTestBase { checkArgumentBindings(callingSequence, new Binding[][]{ { copy(struct), - baseAddress(), - unboxAddress(), + unboxAddress(MemorySegment.class), vmStore(rcx, long.class) } }); @@ -350,19 +348,19 @@ public class TestWindowsCallArranger extends CallArrangerTestBase { assertEquals(callingSequence.functionDesc(), fd); checkArgumentBindings(callingSequence, new Binding[][]{ - { copy(struct), baseAddress(), unboxAddress(), vmStore(rcx, long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(rcx, long.class) }, { vmStore(rdx, int.class) }, { vmStore(xmm2, double.class) }, { unboxAddress(), vmStore(r9, long.class) }, - { copy(struct), baseAddress(), unboxAddress(), vmStore(stackStorage(0), long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(stackStorage(0), long.class) }, { vmStore(stackStorage(1), int.class) }, { vmStore(stackStorage(2), double.class) }, { unboxAddress(), vmStore(stackStorage(3), long.class) }, - { copy(struct), baseAddress(), unboxAddress(), vmStore(stackStorage(4), long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(stackStorage(4), long.class) }, { vmStore(stackStorage(5), int.class) }, { vmStore(stackStorage(6), double.class) }, { unboxAddress(), vmStore(stackStorage(7), long.class) }, - { copy(struct), baseAddress(), unboxAddress(), vmStore(stackStorage(8), long.class) }, + { copy(struct), unboxAddress(MemorySegment.class), vmStore(stackStorage(8), long.class) }, { vmStore(stackStorage(9), int.class) }, { vmStore(stackStorage(10), double.class) }, { unboxAddress(), vmStore(stackStorage(11), long.class) }, diff --git a/test/jdk/java/foreign/channels/AbstractChannelsTest.java b/test/jdk/java/foreign/channels/AbstractChannelsTest.java index 81c6f0bf193..be0fb0afe8b 100644 --- a/test/jdk/java/foreign/channels/AbstractChannelsTest.java +++ b/test/jdk/java/foreign/channels/AbstractChannelsTest.java @@ -22,18 +22,19 @@ */ import java.io.IOException; -import java.lang.ref.Cleaner; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Random; import java.util.concurrent.ExecutionException; import java.util.function.Supplier; import java.util.stream.Stream; -import jdk.incubator.foreign.MemoryAccess; + import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.test.lib.RandomFactory; import org.testng.annotations.*; + +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static org.testng.Assert.*; /** @@ -51,7 +52,7 @@ public class AbstractChannelsTest { } static ResourceScope closeableScopeOrNull(ResourceScope scope) { - if (scope.isImplicit()) + if (scope == ResourceScope.globalScope()) return null; return scope; } @@ -75,7 +76,7 @@ public class AbstractChannelsTest { static ByteBuffer segmentBufferOfSize(ResourceScope scope, int size) { var segment = MemorySegment.allocateNative(size, 1, scope); for (int i = 0; i < size; i++) { - MemoryAccess.setByteAtOffset(segment, i, ((byte)RANDOM.nextInt())); + segment.set(JAVA_BYTE, i, ((byte)RANDOM.nextInt())); } return segment.asByteBuffer(); } @@ -129,7 +130,6 @@ public class AbstractChannelsTest { public static Object[][] confinedScopes() { return new Object[][] { { ScopeSupplier.NEW_CONFINED }, - { ScopeSupplier.NEW_CONFINED_EXPLICIT }, }; } @@ -137,7 +137,6 @@ public class AbstractChannelsTest { public static Object[][] sharedScopes() { return new Object[][] { { ScopeSupplier.NEW_SHARED }, - { ScopeSupplier.NEW_SHARED_EXPLICIT }, }; } @@ -151,7 +150,6 @@ public class AbstractChannelsTest { @DataProvider(name = "implicitScopes") public static Object[][] implicitScopes() { return new Object[][] { - { ScopeSupplier.NEW_IMPLICIT }, { ScopeSupplier.GLOBAL }, }; } @@ -174,26 +172,20 @@ public class AbstractChannelsTest { public static Object[][] sharedScopesAndTimeouts() { return new Object[][] { { ScopeSupplier.NEW_SHARED , 0 }, - { ScopeSupplier.NEW_SHARED_EXPLICIT , 0 }, { ScopeSupplier.NEW_SHARED , 30 }, - { ScopeSupplier.NEW_SHARED_EXPLICIT , 30 }, }; } static class ScopeSupplier implements Supplier { static final Supplier NEW_CONFINED = - new ScopeSupplier(() -> ResourceScope.newConfinedScope(), "newConfinedScope()"); - static final Supplier NEW_CONFINED_EXPLICIT = - new ScopeSupplier(() -> ResourceScope.newConfinedScope(Cleaner.create()), "newConfinedScope(Cleaner)"); + new ScopeSupplier(ResourceScope::newConfinedScope, "newConfinedScope()"); static final Supplier NEW_SHARED = - new ScopeSupplier(() -> ResourceScope.newSharedScope(), "newSharedScope()"); - static final Supplier NEW_SHARED_EXPLICIT = - new ScopeSupplier(() -> ResourceScope.newSharedScope(Cleaner.create()), "newSharedScope(Cleaner)"); + new ScopeSupplier(ResourceScope::newSharedScope, "newSharedScope()"); static final Supplier NEW_IMPLICIT = - new ScopeSupplier(() -> ResourceScope.newImplicitScope(), "newImplicitScope()"); + new ScopeSupplier(ResourceScope::newImplicitScope, "newImplicitScope()"); static final Supplier GLOBAL = - new ScopeSupplier(() -> ResourceScope.globalScope(), "globalScope()"); + new ScopeSupplier(ResourceScope::globalScope, "globalScope()"); private final Supplier supplier; private final String str; diff --git a/test/jdk/java/foreign/channels/TestAsyncSocketChannels.java b/test/jdk/java/foreign/channels/TestAsyncSocketChannels.java index 1189600ddfe..f3d4a2cee46 100644 --- a/test/jdk/java/foreign/channels/TestAsyncSocketChannels.java +++ b/test/jdk/java/foreign/channels/TestAsyncSocketChannels.java @@ -48,12 +48,13 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Supplier; -import jdk.incubator.foreign.MemoryAccess; + import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import org.testng.annotations.*; import static java.lang.System.out; import static java.util.concurrent.TimeUnit.SECONDS; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static org.testng.Assert.*; /** @@ -162,7 +163,7 @@ public class TestAsyncSocketChannels extends AbstractChannelsTest { MemorySegment segment1 = MemorySegment.allocateNative(10, 1, scope); MemorySegment segment2 = MemorySegment.allocateNative(10, 1, scope); for (int i = 0; i < 10; i++) { - MemoryAccess.setByteAtOffset(segment1, i, (byte) i); + segment1.set(JAVA_BYTE, i, (byte) i); } { // Future variants ByteBuffer bb1 = segment1.asByteBuffer(); @@ -221,7 +222,7 @@ public class TestAsyncSocketChannels extends AbstractChannelsTest { ioOp.accept(handler); assertFalse(handler.isDone()); assertTrue(scope.isAlive()); - assertMessage(expectThrows(ISE, () -> scope.close()), "Scope is acquired by"); + assertMessage(expectThrows(ISE, () -> scope.close()), "Scope is kept alive by"); // write to allow the blocking read complete, which will // in turn unlock the scope and allow it to be closed. @@ -270,7 +271,7 @@ public class TestAsyncSocketChannels extends AbstractChannelsTest { // give time for socket buffer to fill up. awaitNoFurtherWrites(bytesWritten); - assertMessage(expectThrows(ISE, () -> scope.close()), "Scope is acquired by"); + assertMessage(expectThrows(ISE, () -> scope.close()), "Scope is kept alive by"); assertTrue(scope.isAlive()); // signal handler to stop further writing diff --git a/test/jdk/java/foreign/channels/TestSocketChannels.java b/test/jdk/java/foreign/channels/TestSocketChannels.java index 3ca3e2dc11a..7cbb624fd87 100644 --- a/test/jdk/java/foreign/channels/TestSocketChannels.java +++ b/test/jdk/java/foreign/channels/TestSocketChannels.java @@ -40,10 +40,12 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; import java.util.stream.Stream; -import jdk.incubator.foreign.MemoryAccess; + import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import org.testng.annotations.*; + +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; import static org.testng.Assert.*; /** @@ -101,7 +103,7 @@ public class TestSocketChannels extends AbstractChannelsTest { MemorySegment segment1 = MemorySegment.allocateNative(10, 1, scope); MemorySegment segment2 = MemorySegment.allocateNative(10, 1, scope); for (int i = 0; i < 10; i++) { - MemoryAccess.setByteAtOffset(segment1, i, (byte) i); + segment1.set(JAVA_BYTE, i, (byte) i); } ByteBuffer bb1 = segment1.asByteBuffer(); ByteBuffer bb2 = segment2.asByteBuffer(); @@ -119,7 +121,7 @@ public class TestSocketChannels extends AbstractChannelsTest { var segment1 = MemorySegment.ofArray(new byte[10]); var segment2 = MemorySegment.ofArray(new byte[10]); for (int i = 0; i < 10; i++) { - MemoryAccess.setByteAtOffset(segment1, i, (byte) i); + segment1.set(JAVA_BYTE, i, (byte) i); } ByteBuffer bb1 = segment1.asByteBuffer(); ByteBuffer bb2 = segment2.asByteBuffer(); diff --git a/test/jdk/java/foreign/enablenativeaccess/org/openjdk/foreigntest/PanamaMainUnnamedModule.java b/test/jdk/java/foreign/enablenativeaccess/org/openjdk/foreigntest/PanamaMainUnnamedModule.java index bf32954eee3..789d70b1397 100644 --- a/test/jdk/java/foreign/enablenativeaccess/org/openjdk/foreigntest/PanamaMainUnnamedModule.java +++ b/test/jdk/java/foreign/enablenativeaccess/org/openjdk/foreigntest/PanamaMainUnnamedModule.java @@ -32,26 +32,26 @@ import java.lang.reflect.Method; public class PanamaMainUnnamedModule { @Test public void testReflection() throws Throwable { - Method method = CLinker.class.getDeclaredMethod("getInstance"); + Method method = CLinker.class.getDeclaredMethod("systemCLinker"); method.invoke(null); } @Test public void testSetAccessible() throws Throwable { - Method method = CLinker.class.getDeclaredMethod("getInstance"); + Method method = CLinker.class.getDeclaredMethod("systemCLinker"); method.setAccessible(true); method.invoke(null); } @Test public void testInvoke() throws Throwable { - var mh = MethodHandles.lookup().findStatic(CLinker.class, "getInstance", + var mh = MethodHandles.lookup().findStatic(CLinker.class, "systemCLinker", MethodType.methodType(CLinker.class)); var linker = (CLinker)mh.invokeExact(); } @Test public void testDirectAccess() throws Throwable { - CLinker.getInstance(); + CLinker.systemCLinker(); } } diff --git a/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMain.java b/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMain.java index b4416f87808..82c1e500853 100644 --- a/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMain.java +++ b/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMain.java @@ -28,7 +28,7 @@ import jdk.incubator.foreign.*; public class PanamaMain { public static void main(String[] args) { System.out.println("Trying to get CLinker"); - CLinker.getInstance(); + CLinker.systemCLinker(); System.out.println("Got CLinker"); } } diff --git a/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainInvoke.java b/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainInvoke.java index 6a5a2bd4a92..46bf5a2c8d2 100644 --- a/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainInvoke.java +++ b/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainInvoke.java @@ -28,7 +28,7 @@ import jdk.incubator.foreign.*; public class PanamaMainInvoke { public static void main(String[] args) throws Throwable { - var mh = MethodHandles.lookup().findStatic(CLinker.class, "getInstance", + var mh = MethodHandles.lookup().findStatic(CLinker.class, "systemCLinker", MethodType.methodType(CLinker.class)); var linker = (CLinker)mh.invokeExact(); } diff --git a/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainReflection.java b/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainReflection.java index 0ddd28b97ee..8206aab123b 100644 --- a/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainReflection.java +++ b/test/jdk/java/foreign/enablenativeaccess/panama_module/org/openjdk/foreigntest/PanamaMainReflection.java @@ -28,7 +28,7 @@ import java.lang.reflect.Method; public class PanamaMainReflection { public static void main(String[] args) throws Throwable { - Method method = CLinker.class.getDeclaredMethod("getInstance"); + Method method = CLinker.class.getDeclaredMethod("systemCLinker"); method.invoke(null); } } diff --git a/test/jdk/java/foreign/handles/invoker_module/handle/invoker/MethodHandleInvoker.java b/test/jdk/java/foreign/handles/invoker_module/handle/invoker/MethodHandleInvoker.java index bad4d441a48..c9ffe911be6 100644 --- a/test/jdk/java/foreign/handles/invoker_module/handle/invoker/MethodHandleInvoker.java +++ b/test/jdk/java/foreign/handles/invoker_module/handle/invoker/MethodHandleInvoker.java @@ -28,10 +28,11 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; +import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.SymbolLookup; +import jdk.incubator.foreign.ValueLayout; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; @@ -52,7 +53,7 @@ public class MethodHandleInvoker { throw new AssertionError("Caller module is not lookup_module!"); } } catch (Throwable ex) { - throw new AssertionError("Call to restricted method did not fail as expected!"); + throw new AssertionError("Call to restricted method did not fail as expected!", ex); } } @@ -63,8 +64,7 @@ public class MethodHandleInvoker { } static { - addDefaultMapping(CLinker.class, CLinker.getInstance()); - addDefaultMapping(long.class, 0L); + addDefaultMapping(CLinker.class, CLinker.systemCLinker()); addDefaultMapping(Path.class, Path.of("nonExistent")); addDefaultMapping(String.class, "Hello!"); addDefaultMapping(Runnable.class, () -> {}); @@ -73,11 +73,28 @@ public class MethodHandleInvoker { addDefaultMapping(MethodType.class, MethodType.methodType(void.class)); addDefaultMapping(MemoryAddress.class, MemoryAddress.NULL); addDefaultMapping(Addressable.class, MemoryAddress.NULL); - addDefaultMapping(MemoryLayout.class, MemoryLayouts.JAVA_INT); + addDefaultMapping(MemoryLayout.class, ValueLayout.JAVA_INT); addDefaultMapping(FunctionDescriptor.class, FunctionDescriptor.ofVoid()); addDefaultMapping(SymbolLookup.class, SymbolLookup.loaderLookup()); addDefaultMapping(ResourceScope.class, ResourceScope.newImplicitScope()); - addDefaultMapping(SegmentAllocator.class, (size, align) -> null); + addDefaultMapping(SegmentAllocator.class, SegmentAllocator.prefixAllocator(MemorySegment.ofArray(new byte[10]))); + addDefaultMapping(ValueLayout.OfByte.class, ValueLayout.JAVA_BYTE); + addDefaultMapping(ValueLayout.OfBoolean.class, ValueLayout.JAVA_BOOLEAN); + addDefaultMapping(ValueLayout.OfChar.class, ValueLayout.JAVA_CHAR); + addDefaultMapping(ValueLayout.OfShort.class, ValueLayout.JAVA_SHORT); + addDefaultMapping(ValueLayout.OfInt.class, ValueLayout.JAVA_INT); + addDefaultMapping(ValueLayout.OfFloat.class, ValueLayout.JAVA_FLOAT); + addDefaultMapping(ValueLayout.OfLong.class, ValueLayout.JAVA_LONG); + addDefaultMapping(ValueLayout.OfDouble.class, ValueLayout.JAVA_DOUBLE); + addDefaultMapping(ValueLayout.OfAddress.class, ValueLayout.ADDRESS); + addDefaultMapping(byte.class, (byte)0); + addDefaultMapping(boolean.class, true); + addDefaultMapping(char.class, (char)0); + addDefaultMapping(short.class, (short)0); + addDefaultMapping(int.class, 0); + addDefaultMapping(float.class, 0f); + addDefaultMapping(long.class, 0L); + addDefaultMapping(double.class, 0d); } static Object[] makeArgs(MethodType type) { diff --git a/test/jdk/java/foreign/handles/lookup_module/handle/lookup/MethodHandleLookup.java b/test/jdk/java/foreign/handles/lookup_module/handle/lookup/MethodHandleLookup.java index 20f092057c4..8755d40e6b1 100644 --- a/test/jdk/java/foreign/handles/lookup_module/handle/lookup/MethodHandleLookup.java +++ b/test/jdk/java/foreign/handles/lookup_module/handle/lookup/MethodHandleLookup.java @@ -23,24 +23,20 @@ package handle.lookup; -import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.util.Optional; -import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; -import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; -import jdk.incubator.foreign.SegmentAllocator; +import jdk.incubator.foreign.VaList; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.*; public class MethodHandleLookup { @@ -54,38 +50,77 @@ public class MethodHandleLookup { static Object[][] restrictedMethods() { try { return new Object[][]{ - { MethodHandles.lookup().findStatic(CLinker.class, "getInstance", - MethodType.methodType(CLinker.class)), "CLinker::getInstance" }, - { MethodHandles.lookup().findStatic(CLinker.class, "toJavaString", - MethodType.methodType(String.class, MemoryAddress.class)), - "CLinker::toJavaString" }, - { MethodHandles.lookup().findStatic(CLinker.class, "allocateMemory", - MethodType.methodType(MemoryAddress.class, long.class)), - "CLinker::allocateMemory" }, - { MethodHandles.lookup().findStatic(CLinker.class, "freeMemory", - MethodType.methodType(void.class, MemoryAddress.class)), - "CLinker::freeMemory" }, - { MethodHandles.lookup().findStatic(CLinker.VaList.class, "ofAddress", - MethodType.methodType(CLinker.VaList.class, MemoryAddress.class)), + { MethodHandles.lookup().findStatic(CLinker.class, "systemCLinker", + MethodType.methodType(CLinker.class)), "ForeignLinker::systemCLinker" }, + { MethodHandles.lookup().findStatic(VaList.class, "ofAddress", + MethodType.methodType(VaList.class, MemoryAddress.class, ResourceScope.class)), "VaList::ofAddress/1" }, - { MethodHandles.lookup().findStatic(CLinker.VaList.class, "ofAddress", - MethodType.methodType(CLinker.VaList.class, MemoryAddress.class, ResourceScope.class)), - "VaList::ofAddress/2" }, - { MethodHandles.lookup().findStatic(CLinker.class, "systemLookup", - MethodType.methodType(SymbolLookup.class)), - "CLinker::systemLookup" }, { MethodHandles.lookup().findStatic(SymbolLookup.class, "loaderLookup", MethodType.methodType(SymbolLookup.class)), "SymbolLookup::loaderLookup" }, - { MethodHandles.lookup().findVirtual(MemoryAddress.class, "asSegment", - MethodType.methodType(MemorySegment.class, long.class, ResourceScope.class)), - "MemoryAddress::asSegment/1" }, - { MethodHandles.lookup().findVirtual(MemoryAddress.class, "asSegment", - MethodType.methodType(MemorySegment.class, long.class, Runnable.class, ResourceScope.class)), - "MemoryAddress::asSegment/2" }, - { MethodHandles.lookup().findStatic(MemorySegment.class, "globalNativeSegment", - MethodType.methodType(MemorySegment.class)), - "MemoryAddress::globalNativeSegment" } + { MethodHandles.lookup().findStatic(MemorySegment.class, "ofAddress", + MethodType.methodType(MemorySegment.class, MemoryAddress.class, long.class, ResourceScope.class)), + "MemorySegment::ofAddress" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "getUtf8String", + MethodType.methodType(String.class, long.class)), + "MemoryAddress::getUtf8String" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "setUtf8String", + MethodType.methodType(void.class, long.class, String.class)), + "MemoryAddress::setUtf8String" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(byte.class, ValueLayout.OfByte.class, long.class)), + "MemoryAddress::get/byte" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(boolean.class, ValueLayout.OfBoolean.class, long.class)), + "MemoryAddress::get/boolean" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(char.class, ValueLayout.OfChar.class, long.class)), + "MemoryAddress::get/char" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(short.class, ValueLayout.OfShort.class, long.class)), + "MemoryAddress::get/short" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(int.class, ValueLayout.OfInt.class, long.class)), + "MemoryAddress::get/int" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(float.class, ValueLayout.OfFloat.class, long.class)), + "MemoryAddress::get/float" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(long.class, ValueLayout.OfLong.class, long.class)), + "MemoryAddress::get/long" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(double.class, ValueLayout.OfDouble.class, long.class)), + "MemoryAddress::get/double" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "get", + MethodType.methodType(MemoryAddress.class, ValueLayout.OfAddress.class, long.class)), + "MemoryAddress::get/address" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfByte.class, long.class, byte.class)), + "MemoryAddress::set/byte" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfBoolean.class, long.class, boolean.class)), + "MemoryAddress::set/boolean" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfChar.class, long.class, char.class)), + "MemoryAddress::set/char" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfShort.class, long.class, short.class)), + "MemoryAddress::set/short" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfInt.class, long.class, int.class)), + "MemoryAddress::set/int" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfFloat.class, long.class, float.class)), + "MemoryAddress::set/float" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfLong.class, long.class, long.class)), + "MemoryAddress::set/long" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfDouble.class, long.class, double.class)), + "MemoryAddress::set/double" }, + { MethodHandles.lookup().findVirtual(MemoryAddress.class, "set", + MethodType.methodType(void.class, ValueLayout.OfAddress.class, long.class, Addressable.class)), + "MemoryAddress::set/address" }, }; } catch (Throwable ex) { throw new ExceptionInInitializerError((ex)); diff --git a/test/jdk/java/foreign/libAsyncInvokers.cpp b/test/jdk/java/foreign/libAsyncInvokers.cpp new file mode 100644 index 00000000000..775e2c3c814 --- /dev/null +++ b/test/jdk/java/foreign/libAsyncInvokers.cpp @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2021, 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 "libTestUpcall.h" +#ifdef __clang__ +#pragma clang optimize off +#elif defined __GNUC__ +#pragma GCC optimize ("O0") +#elif defined _MSC_BUILD +#pragma optimize( "", off ) +#endif + +template +void launch_v(CB cb) { + std::thread thrd(cb); + thrd.join(); +} + +template +void start(O& out, CB cb) { + out = cb(); +} + +template +O launch(CB cb) { + O result; + std::thread thrd(&start, std::ref(result), cb); + thrd.join(); + return result; +} + +extern "C" { +EXPORT void call_async_V(void (*cb)(void)) { launch_v(cb); } + +EXPORT int call_async_I(int (*cb)(void)) { return launch(cb); } +EXPORT float call_async_F(float (*cb)(void)) { return launch(cb); } +EXPORT double call_async_D(double (*cb)(void)) { return launch(cb); } +EXPORT void* call_async_P(void* (*cb)(void)) { return launch(cb); } + +EXPORT struct S_I call_async_S_I(struct S_I (*cb)(void)) { return launch(cb); } +EXPORT struct S_F call_async_S_F(struct S_F (*cb)(void)) { return launch(cb); } +EXPORT struct S_D call_async_S_D(struct S_D (*cb)(void)) { return launch(cb); } +EXPORT struct S_P call_async_S_P(struct S_P (*cb)(void)) { return launch(cb); } +EXPORT struct S_II call_async_S_II(struct S_II (*cb)(void)) { return launch(cb); } +EXPORT struct S_IF call_async_S_IF(struct S_IF (*cb)(void)) { return launch(cb); } +EXPORT struct S_ID call_async_S_ID(struct S_ID (*cb)(void)) { return launch(cb); } +EXPORT struct S_IP call_async_S_IP(struct S_IP (*cb)(void)) { return launch(cb); } +EXPORT struct S_FI call_async_S_FI(struct S_FI (*cb)(void)) { return launch(cb); } +EXPORT struct S_FF call_async_S_FF(struct S_FF (*cb)(void)) { return launch(cb); } +EXPORT struct S_FD call_async_S_FD(struct S_FD (*cb)(void)) { return launch(cb); } +EXPORT struct S_FP call_async_S_FP(struct S_FP (*cb)(void)) { return launch(cb); } +EXPORT struct S_DI call_async_S_DI(struct S_DI (*cb)(void)) { return launch(cb); } +EXPORT struct S_DF call_async_S_DF(struct S_DF (*cb)(void)) { return launch(cb); } +EXPORT struct S_DD call_async_S_DD(struct S_DD (*cb)(void)) { return launch(cb); } +EXPORT struct S_DP call_async_S_DP(struct S_DP (*cb)(void)) { return launch(cb); } +EXPORT struct S_PI call_async_S_PI(struct S_PI (*cb)(void)) { return launch(cb); } +EXPORT struct S_PF call_async_S_PF(struct S_PF (*cb)(void)) { return launch(cb); } +EXPORT struct S_PD call_async_S_PD(struct S_PD (*cb)(void)) { return launch(cb); } +EXPORT struct S_PP call_async_S_PP(struct S_PP (*cb)(void)) { return launch(cb); } +EXPORT struct S_III call_async_S_III(struct S_III (*cb)(void)) { return launch(cb); } +EXPORT struct S_IIF call_async_S_IIF(struct S_IIF (*cb)(void)) { return launch(cb); } +EXPORT struct S_IID call_async_S_IID(struct S_IID (*cb)(void)) { return launch(cb); } +EXPORT struct S_IIP call_async_S_IIP(struct S_IIP (*cb)(void)) { return launch(cb); } +EXPORT struct S_IFI call_async_S_IFI(struct S_IFI (*cb)(void)) { return launch(cb); } +EXPORT struct S_IFF call_async_S_IFF(struct S_IFF (*cb)(void)) { return launch(cb); } +EXPORT struct S_IFD call_async_S_IFD(struct S_IFD (*cb)(void)) { return launch(cb); } +EXPORT struct S_IFP call_async_S_IFP(struct S_IFP (*cb)(void)) { return launch(cb); } +EXPORT struct S_IDI call_async_S_IDI(struct S_IDI (*cb)(void)) { return launch(cb); } +EXPORT struct S_IDF call_async_S_IDF(struct S_IDF (*cb)(void)) { return launch(cb); } +EXPORT struct S_IDD call_async_S_IDD(struct S_IDD (*cb)(void)) { return launch(cb); } +EXPORT struct S_IDP call_async_S_IDP(struct S_IDP (*cb)(void)) { return launch(cb); } +EXPORT struct S_IPI call_async_S_IPI(struct S_IPI (*cb)(void)) { return launch(cb); } +EXPORT struct S_IPF call_async_S_IPF(struct S_IPF (*cb)(void)) { return launch(cb); } +EXPORT struct S_IPD call_async_S_IPD(struct S_IPD (*cb)(void)) { return launch(cb); } +EXPORT struct S_IPP call_async_S_IPP(struct S_IPP (*cb)(void)) { return launch(cb); } +EXPORT struct S_FII call_async_S_FII(struct S_FII (*cb)(void)) { return launch(cb); } +EXPORT struct S_FIF call_async_S_FIF(struct S_FIF (*cb)(void)) { return launch(cb); } +EXPORT struct S_FID call_async_S_FID(struct S_FID (*cb)(void)) { return launch(cb); } +EXPORT struct S_FIP call_async_S_FIP(struct S_FIP (*cb)(void)) { return launch(cb); } +EXPORT struct S_FFI call_async_S_FFI(struct S_FFI (*cb)(void)) { return launch(cb); } +EXPORT struct S_FFF call_async_S_FFF(struct S_FFF (*cb)(void)) { return launch(cb); } +EXPORT struct S_FFD call_async_S_FFD(struct S_FFD (*cb)(void)) { return launch(cb); } +EXPORT struct S_FFP call_async_S_FFP(struct S_FFP (*cb)(void)) { return launch(cb); } +EXPORT struct S_FDI call_async_S_FDI(struct S_FDI (*cb)(void)) { return launch(cb); } +EXPORT struct S_FDF call_async_S_FDF(struct S_FDF (*cb)(void)) { return launch(cb); } +EXPORT struct S_FDD call_async_S_FDD(struct S_FDD (*cb)(void)) { return launch(cb); } +EXPORT struct S_FDP call_async_S_FDP(struct S_FDP (*cb)(void)) { return launch(cb); } +EXPORT struct S_FPI call_async_S_FPI(struct S_FPI (*cb)(void)) { return launch(cb); } +EXPORT struct S_FPF call_async_S_FPF(struct S_FPF (*cb)(void)) { return launch(cb); } +EXPORT struct S_FPD call_async_S_FPD(struct S_FPD (*cb)(void)) { return launch(cb); } +EXPORT struct S_FPP call_async_S_FPP(struct S_FPP (*cb)(void)) { return launch(cb); } +EXPORT struct S_DII call_async_S_DII(struct S_DII (*cb)(void)) { return launch(cb); } +EXPORT struct S_DIF call_async_S_DIF(struct S_DIF (*cb)(void)) { return launch(cb); } +EXPORT struct S_DID call_async_S_DID(struct S_DID (*cb)(void)) { return launch(cb); } +EXPORT struct S_DIP call_async_S_DIP(struct S_DIP (*cb)(void)) { return launch(cb); } +EXPORT struct S_DFI call_async_S_DFI(struct S_DFI (*cb)(void)) { return launch(cb); } +EXPORT struct S_DFF call_async_S_DFF(struct S_DFF (*cb)(void)) { return launch(cb); } +EXPORT struct S_DFD call_async_S_DFD(struct S_DFD (*cb)(void)) { return launch(cb); } +EXPORT struct S_DFP call_async_S_DFP(struct S_DFP (*cb)(void)) { return launch(cb); } +EXPORT struct S_DDI call_async_S_DDI(struct S_DDI (*cb)(void)) { return launch(cb); } +EXPORT struct S_DDF call_async_S_DDF(struct S_DDF (*cb)(void)) { return launch(cb); } +EXPORT struct S_DDD call_async_S_DDD(struct S_DDD (*cb)(void)) { return launch(cb); } +EXPORT struct S_DDP call_async_S_DDP(struct S_DDP (*cb)(void)) { return launch(cb); } +EXPORT struct S_DPI call_async_S_DPI(struct S_DPI (*cb)(void)) { return launch(cb); } +EXPORT struct S_DPF call_async_S_DPF(struct S_DPF (*cb)(void)) { return launch(cb); } +EXPORT struct S_DPD call_async_S_DPD(struct S_DPD (*cb)(void)) { return launch(cb); } +EXPORT struct S_DPP call_async_S_DPP(struct S_DPP (*cb)(void)) { return launch(cb); } +EXPORT struct S_PII call_async_S_PII(struct S_PII (*cb)(void)) { return launch(cb); } +EXPORT struct S_PIF call_async_S_PIF(struct S_PIF (*cb)(void)) { return launch(cb); } +EXPORT struct S_PID call_async_S_PID(struct S_PID (*cb)(void)) { return launch(cb); } +EXPORT struct S_PIP call_async_S_PIP(struct S_PIP (*cb)(void)) { return launch(cb); } +EXPORT struct S_PFI call_async_S_PFI(struct S_PFI (*cb)(void)) { return launch(cb); } +EXPORT struct S_PFF call_async_S_PFF(struct S_PFF (*cb)(void)) { return launch(cb); } +EXPORT struct S_PFD call_async_S_PFD(struct S_PFD (*cb)(void)) { return launch(cb); } +EXPORT struct S_PFP call_async_S_PFP(struct S_PFP (*cb)(void)) { return launch(cb); } +EXPORT struct S_PDI call_async_S_PDI(struct S_PDI (*cb)(void)) { return launch(cb); } +EXPORT struct S_PDF call_async_S_PDF(struct S_PDF (*cb)(void)) { return launch(cb); } +EXPORT struct S_PDD call_async_S_PDD(struct S_PDD (*cb)(void)) { return launch(cb); } +EXPORT struct S_PDP call_async_S_PDP(struct S_PDP (*cb)(void)) { return launch(cb); } +EXPORT struct S_PPI call_async_S_PPI(struct S_PPI (*cb)(void)) { return launch(cb); } +EXPORT struct S_PPF call_async_S_PPF(struct S_PPF (*cb)(void)) { return launch(cb); } +EXPORT struct S_PPD call_async_S_PPD(struct S_PPD (*cb)(void)) { return launch(cb); } +EXPORT struct S_PPP call_async_S_PPP(struct S_PPP (*cb)(void)) { return launch(cb); } +} diff --git a/test/jdk/java/foreign/libIntrinsics.c b/test/jdk/java/foreign/libIntrinsics.c index 5b6923cbbd7..89d0a09c7b6 100644 --- a/test/jdk/java/foreign/libIntrinsics.c +++ b/test/jdk/java/foreign/libIntrinsics.c @@ -22,6 +22,8 @@ * */ +#include + #ifdef _WIN64 #define EXPORT __declspec(dllexport) #else @@ -31,6 +33,10 @@ EXPORT void empty() { } +EXPORT bool identity_bool(bool x) { + return x; +} + EXPORT char identity_char(char x) { return x; } diff --git a/test/jdk/java/foreign/libSafeAccess.c b/test/jdk/java/foreign/libSafeAccess.c index a5bcbe0e892..3a640329aa1 100644 --- a/test/jdk/java/foreign/libSafeAccess.c +++ b/test/jdk/java/foreign/libSafeAccess.c @@ -36,3 +36,9 @@ struct Point { EXPORT void struct_func(struct Point p) { } EXPORT void addr_func(struct Point* p) { } + +EXPORT void addr_func_6(struct Point* p1, struct Point* p2, struct Point* p3, struct Point* p4, struct Point* p5, struct Point* p6) { } + +EXPORT void addr_func_cb(void* p, void (*callback)()) { + callback(); +} diff --git a/test/jdk/java/foreign/loaderLookup/TestLoaderLookup.java b/test/jdk/java/foreign/loaderLookup/TestLoaderLookup.java new file mode 100644 index 00000000000..3d83ba044ed --- /dev/null +++ b/test/jdk/java/foreign/loaderLookup/TestLoaderLookup.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021, 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.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" + * @compile --add-modules jdk.incubator.foreign lookup/Lookup.java + * @compile --add-modules jdk.incubator.foreign invoker/Invoker.java + * @run main/othervm --enable-native-access=ALL-UNNAMED TestLoaderLookup + */ + +import java.lang.reflect.*; +import jdk.incubator.foreign.*; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Paths; + +public class TestLoaderLookup { + public static void main(String[] args) throws ReflectiveOperationException { + ClassLoader loader1 = newClassLoader("lookup"); + Class lookup = loader1.loadClass("lookup.Lookup"); + Method fooSymbol = lookup.getDeclaredMethod("fooSymbol"); + NativeSymbol foo = (NativeSymbol)fooSymbol.invoke(null); + + ClassLoader loader2 = newClassLoader("invoker"); + Class invoker = loader2.loadClass("invoker.Invoker"); + Method invoke = invoker.getDeclaredMethod("invoke", NativeSymbol.class); + invoke.invoke(null, foo); + + loader1 = null; + lookup = null; + fooSymbol = null; + // Make sure that the loader is kept reachable + for (int i = 0 ; i < 1000 ; i++) { + invoke.invoke(null, foo); // might crash if loader1 is GC'ed + System.gc(); + } + } + + public static ClassLoader newClassLoader(String path) { + try { + return new URLClassLoader(new URL[] { + Paths.get(System.getProperty("test.classes", path)).toUri().toURL(), + }, null); + } catch (MalformedURLException e){ + throw new RuntimeException("Unexpected URL conversion failure", e); + } + } +} diff --git a/test/jdk/java/foreign/loaderLookup/invoker/Invoker.java b/test/jdk/java/foreign/loaderLookup/invoker/Invoker.java new file mode 100644 index 00000000000..fab39a25498 --- /dev/null +++ b/test/jdk/java/foreign/loaderLookup/invoker/Invoker.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021, 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 invoker; + +import jdk.incubator.foreign.*; + +public class Invoker { + public static void invoke(NativeSymbol symbol) throws Throwable { + var linker = CLinker.systemCLinker(); + var handle = linker.downcallHandle(symbol, FunctionDescriptor.ofVoid()); + handle.invokeExact(); + } +} \ No newline at end of file diff --git a/test/jdk/java/foreign/loaderLookup/lookup/Lookup.java b/test/jdk/java/foreign/loaderLookup/lookup/Lookup.java new file mode 100644 index 00000000000..087a91dcdc2 --- /dev/null +++ b/test/jdk/java/foreign/loaderLookup/lookup/Lookup.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, 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 lookup; + +import jdk.incubator.foreign.*; + +public class Lookup { + static { + System.loadLibrary("Foo"); + } + + static SymbolLookup lookup = SymbolLookup.loaderLookup(); + + public static NativeSymbol fooSymbol() { + return lookup.lookup("foo").get(); + } +} \ No newline at end of file diff --git a/test/jdk/java/foreign/loaderLookup/lookup/libFoo.c b/test/jdk/java/foreign/loaderLookup/lookup/libFoo.c new file mode 100644 index 00000000000..68525215b93 --- /dev/null +++ b/test/jdk/java/foreign/loaderLookup/lookup/libFoo.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021, 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 + +#ifdef _WIN64 +#define EXPORT __declspec(dllexport) +#else +#define EXPORT +#endif + +EXPORT void foo(void) { + // do nothing +} diff --git a/test/jdk/java/foreign/malloc/TestMixedMallocFree.java b/test/jdk/java/foreign/malloc/TestMixedMallocFree.java index 41c7616c5f9..1603fd83ee3 100644 --- a/test/jdk/java/foreign/malloc/TestMixedMallocFree.java +++ b/test/jdk/java/foreign/malloc/TestMixedMallocFree.java @@ -23,13 +23,13 @@ /* * @test + * @library ../ * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" * @run testng/othervm --enable-native-access=ALL-UNNAMED TestMixedMallocFree */ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -37,12 +37,11 @@ import jdk.incubator.foreign.SymbolLookup; import org.testng.annotations.Test; import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodType; -import static jdk.incubator.foreign.CLinker.*; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; import static org.testng.Assert.assertEquals; -public class TestMixedMallocFree { +public class TestMixedMallocFree extends NativeTestHelper { static final MethodHandle MH_my_malloc; @@ -50,21 +49,20 @@ public class TestMixedMallocFree { System.loadLibrary("Malloc"); SymbolLookup MALLOC = SymbolLookup.loaderLookup(); - MH_my_malloc = CLinker.getInstance().downcallHandle( + MH_my_malloc = CLinker.systemCLinker().downcallHandle( MALLOC.lookup("my_malloc").orElseThrow(), - MethodType.methodType(MemoryAddress.class, long.class), - FunctionDescriptor.of(C_POINTER, C_LONG_LONG)); + FunctionDescriptor.of(C_POINTER, C_LONG_LONG)); } @Test public void testMalloc() throws Throwable { MemoryAddress ma = (MemoryAddress) MH_my_malloc.invokeExact(4L); - MemorySegment seg = ma.asSegment(4L, ResourceScope.newImplicitScope()); - MemoryAccess.setInt(seg, 42); - assertEquals(MemoryAccess.getInt(seg), 42); + MemorySegment seg = MemorySegment.ofAddress(ma, 4L, ResourceScope.newImplicitScope()); + seg.set(JAVA_INT, 0, 42); + assertEquals(seg.get(JAVA_INT, 0), 42); // Test if this free crashes the VM, which might be the case if we load the wrong default library // and end up mixing two allocators together. - CLinker.freeMemory(ma); + freeMemory(ma); } } diff --git a/test/jdk/java/foreign/stackwalk/TestAsyncStackWalk.java b/test/jdk/java/foreign/stackwalk/TestAsyncStackWalk.java index b56231230fd..9c9de5e0305 100644 --- a/test/jdk/java/foreign/stackwalk/TestAsyncStackWalk.java +++ b/test/jdk/java/foreign/stackwalk/TestAsyncStackWalk.java @@ -25,6 +25,7 @@ * @test id=default_gc * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" * @library /test/lib + * @library ../ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @@ -52,6 +53,7 @@ * @requires (((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64") * @requires vm.gc.Z * @library /test/lib + * @library ../ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @@ -80,6 +82,7 @@ * @requires (((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64") * @requires vm.gc.Shenandoah * @library /test/lib + * @library ../ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @@ -106,6 +109,7 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; @@ -116,13 +120,12 @@ import jdk.incubator.foreign.ResourceScope; import sun.hotspot.WhiteBox; import static java.lang.invoke.MethodHandles.lookup; -import static jdk.incubator.foreign.CLinker.C_POINTER; import static jdk.test.lib.Asserts.assertTrue; -public class TestAsyncStackWalk { +public class TestAsyncStackWalk extends NativeTestHelper { static final WhiteBox WB = WhiteBox.getWhiteBox(); - static final CLinker linker = CLinker.getInstance(); + static final CLinker linker = CLinker.systemCLinker(); static final MethodHandle MH_asyncStackWalk; static final MethodHandle MH_m; @@ -133,7 +136,6 @@ public class TestAsyncStackWalk { SymbolLookup lookup = SymbolLookup.loaderLookup(); MH_asyncStackWalk = linker.downcallHandle( lookup.lookup("asyncStackWalk").get(), - MethodType.methodType(void.class, MemoryAddress.class), FunctionDescriptor.ofVoid(C_POINTER)); MH_m = lookup().findStatic(TestAsyncStackWalk.class, "m", MethodType.methodType(void.class)); } catch (ReflectiveOperationException e) { @@ -146,7 +148,7 @@ public class TestAsyncStackWalk { public static void main(String[] args) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemoryAddress stub = linker.upcallStub(MH_m, FunctionDescriptor.ofVoid(), scope); + NativeSymbol stub = linker.upcallStub(MH_m, FunctionDescriptor.ofVoid(), scope); MemoryAddress stubAddress = stub.address(); invocations = 0; didStackWalk = false; @@ -156,7 +158,7 @@ public class TestAsyncStackWalk { } static void payload(MemoryAddress cb) throws Throwable { - MH_asyncStackWalk.invokeExact(cb); + MH_asyncStackWalk.invoke(cb); } static void m() { diff --git a/test/jdk/java/foreign/stackwalk/TestStackWalk.java b/test/jdk/java/foreign/stackwalk/TestStackWalk.java index 5d220cce25c..07cc0e83df6 100644 --- a/test/jdk/java/foreign/stackwalk/TestStackWalk.java +++ b/test/jdk/java/foreign/stackwalk/TestStackWalk.java @@ -25,6 +25,7 @@ * @test id=default_gc * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" * @library /test/lib + * @library ../ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @@ -52,6 +53,7 @@ * @requires (((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64") * @requires vm.gc.Z * @library /test/lib + * @library ../ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @@ -80,6 +82,7 @@ * @requires (((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64") * @requires vm.gc.Shenandoah * @library /test/lib + * @library ../ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * @@ -106,6 +109,7 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; @@ -117,12 +121,11 @@ import jdk.incubator.foreign.ResourceScope; import sun.hotspot.WhiteBox; import static java.lang.invoke.MethodHandles.lookup; -import static jdk.incubator.foreign.CLinker.C_POINTER; -public class TestStackWalk { +public class TestStackWalk extends NativeTestHelper { static final WhiteBox WB = WhiteBox.getWhiteBox(); - static final CLinker linker = CLinker.getInstance(); + static final CLinker linker = CLinker.systemCLinker(); static final MethodHandle MH_foo; static final MethodHandle MH_m; @@ -133,7 +136,6 @@ public class TestStackWalk { SymbolLookup lookup = SymbolLookup.loaderLookup(); MH_foo = linker.downcallHandle( lookup.lookup("foo").get(), - MethodType.methodType(void.class, MemoryAddress.class), FunctionDescriptor.ofVoid(C_POINTER)); MH_m = lookup().findStatic(TestStackWalk.class, "m", MethodType.methodType(void.class)); } catch (ReflectiveOperationException e) { @@ -145,7 +147,7 @@ public class TestStackWalk { public static void main(String[] args) throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemoryAddress stub = linker.upcallStub(MH_m, FunctionDescriptor.ofVoid(), scope); + NativeSymbol stub = linker.upcallStub(MH_m, FunctionDescriptor.ofVoid(), scope); MemoryAddress stubAddress = stub.address(); armed = false; for (int i = 0; i < 20_000; i++) { @@ -158,7 +160,7 @@ public class TestStackWalk { } static void payload(MemoryAddress cb) throws Throwable { - MH_foo.invokeExact(cb); + MH_foo.invoke(cb); Reference.reachabilityFence(cb); // keep oop alive across call } diff --git a/test/jdk/java/foreign/valist/VaListTest.java b/test/jdk/java/foreign/valist/VaListTest.java index b2aac7d6dc8..9b48d361ed8 100644 --- a/test/jdk/java/foreign/valist/VaListTest.java +++ b/test/jdk/java/foreign/valist/VaListTest.java @@ -36,7 +36,7 @@ */ import jdk.incubator.foreign.*; -import jdk.incubator.foreign.CLinker.VaList; +import jdk.incubator.foreign.VaList; import jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64Linker; import jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64Linker; import jdk.internal.foreign.abi.x64.sysv.SysVx64Linker; @@ -55,59 +55,65 @@ import java.util.function.Function; import java.util.stream.DoubleStream; import java.util.stream.IntStream; -import static jdk.incubator.foreign.CLinker.C_DOUBLE; -import static jdk.incubator.foreign.CLinker.C_FLOAT; -import static jdk.incubator.foreign.CLinker.C_INT; -import static jdk.incubator.foreign.CLinker.C_LONG; -import static jdk.incubator.foreign.CLinker.C_LONG_LONG; -import static jdk.incubator.foreign.CLinker.C_POINTER; -import static jdk.incubator.foreign.CLinker.C_VA_LIST; import static jdk.incubator.foreign.MemoryLayout.PathElement.groupElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; import static jdk.internal.foreign.PlatformLayouts.*; import static org.testng.Assert.*; public class VaListTest extends NativeTestHelper { - private static final CLinker abi = CLinker.getInstance(); + private static final CLinker abi = CLinker.systemCLinker(); static { System.loadLibrary("VaList"); } static final SymbolLookup LOOKUP = SymbolLookup.loaderLookup(); - private static final MethodHandle MH_sumInts = link("sumInts", - MethodType.methodType(int.class, int.class, VaList.class), - FunctionDescriptor.of(C_INT, C_INT, C_VA_LIST)); - private static final MethodHandle MH_sumDoubles = link("sumDoubles", - MethodType.methodType(double.class, int.class, VaList.class), - FunctionDescriptor.of(C_DOUBLE, C_INT, C_VA_LIST)); - private static final MethodHandle MH_getInt = link("getInt", - MethodType.methodType(int.class, VaList.class), - FunctionDescriptor.of(C_INT, C_VA_LIST)); - private static final MethodHandle MH_sumStruct = link("sumStruct", - MethodType.methodType(int.class, VaList.class), - FunctionDescriptor.of(C_INT, C_VA_LIST)); - private static final MethodHandle MH_sumBigStruct = link("sumBigStruct", - MethodType.methodType(long.class, VaList.class), - FunctionDescriptor.of(C_LONG_LONG, C_VA_LIST)); - private static final MethodHandle MH_sumHugeStruct = link("sumHugeStruct", - MethodType.methodType(long.class, VaList.class), - FunctionDescriptor.of(C_LONG_LONG, C_VA_LIST)); - private static final MethodHandle MH_sumFloatStruct = link("sumFloatStruct", - MethodType.methodType(float.class, VaList.class), - FunctionDescriptor.of(C_FLOAT, C_VA_LIST)); - private static final MethodHandle MH_sumStack = link("sumStack", - MethodType.methodType(void.class, MemoryAddress.class, MemoryAddress.class, VaList.class), - FunctionDescriptor.ofVoid(C_POINTER, C_POINTER, C_VA_LIST)); - - private static MethodHandle link(String symbol, MethodType mt, FunctionDescriptor fd) { - return abi.downcallHandle(LOOKUP.lookup(symbol).get(), mt, fd); + private static final MethodHandle ADDRESS_TO_VALIST; + + static { + try { + ADDRESS_TO_VALIST = MethodHandles.lookup().findStatic(VaList.class, "ofAddress", MethodType.methodType(VaList.class, MemoryAddress.class, ResourceScope.class)); + } catch (Throwable ex) { + throw new ExceptionInInitializerError(ex); + } + } + + + private static final MethodHandle MH_sumInts = linkVaList("sumInts", + FunctionDescriptor.of(C_INT, C_INT, C_POINTER)); + private static final MethodHandle MH_sumDoubles = linkVaList("sumDoubles", + FunctionDescriptor.of(C_DOUBLE, C_INT, C_POINTER)); + private static final MethodHandle MH_getInt = linkVaList("getInt", + FunctionDescriptor.of(C_INT, C_POINTER)); + private static final MethodHandle MH_sumStruct = linkVaList("sumStruct", + FunctionDescriptor.of(C_INT, C_POINTER)); + private static final MethodHandle MH_sumBigStruct = linkVaList("sumBigStruct", + FunctionDescriptor.of(C_LONG_LONG, C_POINTER)); + private static final MethodHandle MH_sumHugeStruct = linkVaList("sumHugeStruct", + FunctionDescriptor.of(C_LONG_LONG, C_POINTER)); + private static final MethodHandle MH_sumFloatStruct = linkVaList("sumFloatStruct", + FunctionDescriptor.of(C_FLOAT, C_POINTER)); + private static final MethodHandle MH_sumStack = linkVaList("sumStack", + FunctionDescriptor.ofVoid(C_POINTER, C_POINTER, C_POINTER)); + + private static MethodHandle link(String symbol, FunctionDescriptor fd) { + return linkInternal(symbol, fd); + } + + private static MethodHandle linkVaList(String symbol, FunctionDescriptor fd) { + return linkInternal(symbol, fd); + } + + + private static MethodHandle linkInternal(String symbol, FunctionDescriptor fd) { + return abi.downcallHandle(LOOKUP.lookup(symbol).get(), fd); } private static MethodHandle linkVaListCB(String symbol) { return link(symbol, - MethodType.methodType(void.class, MemoryAddress.class), FunctionDescriptor.ofVoid(C_POINTER)); } @@ -123,22 +129,22 @@ public class VaListTest extends NativeTestHelper { private static final Function, VaList> platformVaListFactory = (builder) -> VaList.make(builder, ResourceScope.newConfinedScope()); - private static final BiFunction, NativeScope, VaList> winVaListScopedFactory - = (builder, scope) -> Windowsx64Linker.newVaList(builder, scope.scope()); - private static final BiFunction, NativeScope, VaList> sysvVaListScopedFactory - = (builder, scope) -> SysVx64Linker.newVaList(builder, scope.scope()); - private static final BiFunction, NativeScope, VaList> linuxAArch64VaListScopedFactory - = (builder, scope) -> LinuxAArch64Linker.newVaList(builder, scope.scope()); - private static final BiFunction, NativeScope, VaList> macAArch64VaListScopedFactory - = (builder, scope) -> MacOsAArch64Linker.newVaList(builder, scope.scope()); - private static final BiFunction, NativeScope, VaList> platformVaListScopedFactory - = (builder, scope) -> VaList.make(builder, scope.scope()); + private static final BiFunction, ResourceScope, VaList> winVaListScopedFactory + = (builder, scope) -> Windowsx64Linker.newVaList(builder, scope); + private static final BiFunction, ResourceScope, VaList> sysvVaListScopedFactory + = (builder, scope) -> SysVx64Linker.newVaList(builder, scope); + private static final BiFunction, ResourceScope, VaList> linuxAArch64VaListScopedFactory + = (builder, scope) -> LinuxAArch64Linker.newVaList(builder, scope); + private static final BiFunction, ResourceScope, VaList> macAArch64VaListScopedFactory + = (builder, scope) -> MacOsAArch64Linker.newVaList(builder, scope); + private static final BiFunction, ResourceScope, VaList> platformVaListScopedFactory + = (builder, scope) -> VaList.make(builder, scope); @DataProvider @SuppressWarnings("unchecked") public static Object[][] sumInts() { - Function> sumIntsJavaFact = layout -> - (num, list) -> IntStream.generate(() -> list.vargAsInt(layout)).limit(num).sum(); + Function> sumIntsJavaFact = layout -> + (num, list) -> IntStream.generate(() -> list.nextVarg(layout)).limit(num).sum(); BiFunction sumIntsNative = MethodHandleProxies.asInterfaceInstance(BiFunction.class, MH_sumInts); return new Object[][]{ @@ -153,11 +159,11 @@ public class VaListTest extends NativeTestHelper { @Test(dataProvider = "sumInts") public void testIntSum(Function, VaList> vaListFactory, BiFunction sumInts, - ValueLayout intLayout) { + ValueLayout.OfInt intLayout) { VaList vaList = vaListFactory.apply(b -> - b.vargFromInt(intLayout, 10) - .vargFromInt(intLayout, 15) - .vargFromInt(intLayout, 20)); + b.addVarg(intLayout, 10) + .addVarg(intLayout, 15) + .addVarg(intLayout, 20)); int x = sumInts.apply(3, vaList); assertEquals(x, 45); vaList.scope().close(); @@ -166,8 +172,8 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] sumDoubles() { - Function> sumDoublesJavaFact = layout -> - (num, list) -> DoubleStream.generate(() -> list.vargAsDouble(layout)).limit(num).sum(); + Function> sumDoublesJavaFact = layout -> + (num, list) -> DoubleStream.generate(() -> list.nextVarg(layout)).limit(num).sum(); BiFunction sumDoublesNative = MethodHandleProxies.asInterfaceInstance(BiFunction.class, MH_sumDoubles); return new Object[][]{ @@ -182,11 +188,11 @@ public class VaListTest extends NativeTestHelper { @Test(dataProvider = "sumDoubles") public void testDoubleSum(Function, VaList> vaListFactory, BiFunction sumDoubles, - ValueLayout doubleLayout) { + ValueLayout.OfDouble doubleLayout) { VaList vaList = vaListFactory.apply(b -> - b.vargFromDouble(doubleLayout, 3.0D) - .vargFromDouble(doubleLayout, 4.0D) - .vargFromDouble(doubleLayout, 5.0D)); + b.addVarg(doubleLayout, 3.0D) + .addVarg(doubleLayout, 4.0D) + .addVarg(doubleLayout, 5.0D)); double x = sumDoubles.apply(3, vaList); assertEquals(x, 12.0D); vaList.scope().close(); @@ -195,10 +201,10 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] pointers() { - Function> getIntJavaFact = layout -> + Function> getIntJavaFact = layout -> list -> { - MemoryAddress ma = list.vargAsAddress(layout); - return MemoryAccess.getIntAtOffset(MemorySegment.globalNativeSegment(), ma.toRawLongValue()); + MemoryAddress ma = list.nextVarg(layout); + return ma.get(JAVA_INT, 0); }; Function getIntNative = MethodHandleProxies.asInterfaceInstance(Function.class, MH_getInt); return new Object[][]{ @@ -213,11 +219,11 @@ public class VaListTest extends NativeTestHelper { @Test(dataProvider = "pointers") public void testVaListMemoryAddress(Function, VaList> vaListFactory, Function getFromPointer, - ValueLayout pointerLayout) { + ValueLayout.OfAddress pointerLayout) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment msInt = MemorySegment.allocateNative(JAVA_INT, scope); - MemoryAccess.setInt(msInt, 10); - VaList vaList = vaListFactory.apply(b -> b.vargFromAddress(pointerLayout, msInt.address())); + msInt.set(JAVA_INT, 0, 10); + VaList vaList = vaListFactory.apply(b -> b.addVarg(pointerLayout, msInt.address())); int x = getFromPointer.apply(vaList); assertEquals(x, 10); vaList.scope().close(); @@ -231,28 +237,29 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] structs() { - TriFunction> sumStructJavaFact + TriFunction> sumStructJavaFact = (pointLayout, VH_Point_x, VH_Point_y) -> list -> { - MemorySegment struct = list.vargAsSegment(pointLayout, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(pointLayout, ResourceScope.newImplicitScope()); + list.nextVarg(pointLayout, SegmentAllocator.prefixAllocator(struct)); int x = (int) VH_Point_x.get(struct); int y = (int) VH_Point_y.get(struct); return x + y; }; - TriFunction> sumStructNativeFact + TriFunction> sumStructNativeFact = (pointLayout, VH_Point_x, VH_Point_y) -> MethodHandleProxies.asInterfaceInstance(Function.class, MH_sumStruct); TriFunction, VaList>, MemoryLayout, - TriFunction>, Object[]> argsFact + TriFunction>, Object[]> argsFact = (vaListFact, intLayout, sumStructFact) -> { GroupLayout pointLayout = MemoryLayout.structLayout( intLayout.withName("x"), intLayout.withName("y") ); - VarHandle VH_Point_x = pointLayout.varHandle(int.class, groupElement("x")); - VarHandle VH_Point_y = pointLayout.varHandle(int.class, groupElement("y")); + VarHandle VH_Point_x = pointLayout.varHandle(groupElement("x")); + VarHandle VH_Point_y = pointLayout.varHandle(groupElement("y")); return new Object[] { vaListFact, sumStructFact.apply(pointLayout, VH_Point_x, VH_Point_y), pointLayout, VH_Point_x, VH_Point_y }; }; @@ -274,7 +281,7 @@ public class VaListTest extends NativeTestHelper { VH_Point_x.set(struct, 5); VH_Point_y.set(struct, 10); - VaList vaList = vaListFactory.apply(b -> b.vargFromSegment(Point_LAYOUT, struct)); + VaList vaList = vaListFactory.apply(b -> b.addVarg(Point_LAYOUT, struct)); int sum = sumStruct.apply(vaList); assertEquals(sum, 15); vaList.scope().close(); @@ -284,28 +291,29 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] bigStructs() { - TriFunction> sumStructJavaFact + TriFunction> sumStructJavaFact = (BigPoint_LAYOUT, VH_BigPoint_x, VH_BigPoint_y) -> list -> { - MemorySegment struct = list.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + list.nextVarg(BigPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); long x = (long) VH_BigPoint_x.get(struct); long y = (long) VH_BigPoint_y.get(struct); return x + y; }; - TriFunction> sumStructNativeFact + TriFunction> sumStructNativeFact = (pointLayout, VH_BigPoint_x, VH_BigPoint_y) -> MethodHandleProxies.asInterfaceInstance(Function.class, MH_sumBigStruct); TriFunction, VaList>, MemoryLayout, - TriFunction>, Object[]> argsFact + TriFunction>, Object[]> argsFact = (vaListFact, longLongLayout, sumBigStructFact) -> { GroupLayout BigPoint_LAYOUT = MemoryLayout.structLayout( longLongLayout.withName("x"), longLongLayout.withName("y") ); - VarHandle VH_BigPoint_x = BigPoint_LAYOUT.varHandle(long.class, groupElement("x")); - VarHandle VH_BigPoint_y = BigPoint_LAYOUT.varHandle(long.class, groupElement("y")); + VarHandle VH_BigPoint_x = BigPoint_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_BigPoint_y = BigPoint_LAYOUT.varHandle(groupElement("y")); return new Object[] { vaListFact, sumBigStructFact.apply(BigPoint_LAYOUT, VH_BigPoint_x, VH_BigPoint_y), BigPoint_LAYOUT, VH_BigPoint_x, VH_BigPoint_y }; }; @@ -327,7 +335,7 @@ public class VaListTest extends NativeTestHelper { VH_BigPoint_x.set(struct, 5); VH_BigPoint_y.set(struct, 10); - VaList vaList = vaListFactory.apply(b -> b.vargFromSegment(BigPoint_LAYOUT, struct)); + VaList vaList = vaListFactory.apply(b -> b.addVarg(BigPoint_LAYOUT, struct)); long sum = sumBigStruct.apply(vaList); assertEquals(sum, 15); vaList.scope().close(); @@ -337,28 +345,29 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] floatStructs() { - TriFunction> sumStructJavaFact + TriFunction> sumStructJavaFact = (FloatPoint_LAYOUT, VH_FloatPoint_x, VH_FloatPoint_y) -> list -> { - MemorySegment struct = list.vargAsSegment(FloatPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(FloatPoint_LAYOUT, ResourceScope.newImplicitScope()); + list.nextVarg(FloatPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); float x = (float) VH_FloatPoint_x.get(struct); float y = (float) VH_FloatPoint_y.get(struct); return x + y; }; - TriFunction> sumStructNativeFact + TriFunction> sumStructNativeFact = (pointLayout, VH_FloatPoint_x, VH_FloatPoint_y) -> MethodHandleProxies.asInterfaceInstance(Function.class, MH_sumFloatStruct); TriFunction, VaList>, MemoryLayout, - TriFunction>, Object[]> argsFact + TriFunction>, Object[]> argsFact = (vaListFact, floatLayout, sumFloatStructFact) -> { GroupLayout FloatPoint_LAYOUT = MemoryLayout.structLayout( floatLayout.withName("x"), floatLayout.withName("y") ); - VarHandle VH_FloatPoint_x = FloatPoint_LAYOUT.varHandle(float.class, groupElement("x")); - VarHandle VH_FloatPoint_y = FloatPoint_LAYOUT.varHandle(float.class, groupElement("y")); + VarHandle VH_FloatPoint_x = FloatPoint_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_FloatPoint_y = FloatPoint_LAYOUT.varHandle(groupElement("y")); return new Object[] { vaListFact, sumFloatStructFact.apply(FloatPoint_LAYOUT, VH_FloatPoint_x, VH_FloatPoint_y), FloatPoint_LAYOUT, VH_FloatPoint_x, VH_FloatPoint_y }; }; @@ -381,7 +390,7 @@ public class VaListTest extends NativeTestHelper { VH_FloatPoint_x.set(struct, 1.234f); VH_FloatPoint_y.set(struct, 3.142f); - VaList vaList = vaListFactory.apply(b -> b.vargFromSegment(FloatPoint_LAYOUT, struct)); + VaList vaList = vaListFactory.apply(b -> b.addVarg(FloatPoint_LAYOUT, struct)); float sum = sumFloatStruct.apply(vaList); assertEquals(sum, 4.376f, 0.00001f); vaList.scope().close(); @@ -395,31 +404,32 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] hugeStructs() { - QuadFunc> sumStructJavaFact + QuadFunc> sumStructJavaFact = (HugePoint_LAYOUT, VH_HugePoint_x, VH_HugePoint_y, VH_HugePoint_z) -> list -> { - MemorySegment struct = list.vargAsSegment(HugePoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(HugePoint_LAYOUT, ResourceScope.newImplicitScope()); + list.nextVarg(HugePoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); long x = (long) VH_HugePoint_x.get(struct); long y = (long) VH_HugePoint_y.get(struct); long z = (long) VH_HugePoint_z.get(struct); return x + y + z; }; - QuadFunc> sumStructNativeFact + QuadFunc> sumStructNativeFact = (pointLayout, VH_HugePoint_x, VH_HugePoint_y, VH_HugePoint_z) -> MethodHandleProxies.asInterfaceInstance(Function.class, MH_sumHugeStruct); TriFunction, VaList>, MemoryLayout, - QuadFunc>, Object[]> argsFact + QuadFunc>, Object[]> argsFact = (vaListFact, longLongLayout, sumBigStructFact) -> { GroupLayout HugePoint_LAYOUT = MemoryLayout.structLayout( longLongLayout.withName("x"), longLongLayout.withName("y"), longLongLayout.withName("z") ); - VarHandle VH_HugePoint_x = HugePoint_LAYOUT.varHandle(long.class, groupElement("x")); - VarHandle VH_HugePoint_y = HugePoint_LAYOUT.varHandle(long.class, groupElement("y")); - VarHandle VH_HugePoint_z = HugePoint_LAYOUT.varHandle(long.class, groupElement("z")); + VarHandle VH_HugePoint_x = HugePoint_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_HugePoint_y = HugePoint_LAYOUT.varHandle(groupElement("y")); + VarHandle VH_HugePoint_z = HugePoint_LAYOUT.varHandle(groupElement("z")); return new Object[] { vaListFact, sumBigStructFact.apply(HugePoint_LAYOUT, VH_HugePoint_x, VH_HugePoint_y, VH_HugePoint_z), HugePoint_LAYOUT, VH_HugePoint_x, VH_HugePoint_y, VH_HugePoint_z }; @@ -446,7 +456,7 @@ public class VaListTest extends NativeTestHelper { VH_HugePoint_y.set(struct, 2); VH_HugePoint_z.set(struct, 3); - VaList vaList = vaListFactory.apply(b -> b.vargFromSegment(HugePoint_LAYOUT, struct)); + VaList vaList = vaListFactory.apply(b -> b.addVarg(HugePoint_LAYOUT, struct)); long sum = sumHugeStruct.apply(vaList); assertEquals(sum, 6); vaList.scope().close(); @@ -459,22 +469,22 @@ public class VaListTest extends NativeTestHelper { @DataProvider public static Object[][] sumStack() { - BiFunction sumStackJavaFact = (longLayout, doubleLayout) -> + BiFunction sumStackJavaFact = (longLayout, doubleLayout) -> (longSum, doubleSum, list) -> { long lSum = 0L; for (int i = 0; i < 16; i++) { - lSum += list.vargAsLong(longLayout); + lSum += list.nextVarg(longLayout); } - MemoryAccess.setLong(longSum, lSum); + longSum.set(JAVA_LONG, 0, lSum); double dSum = 0D; for (int i = 0; i < 16; i++) { - dSum += list.vargAsDouble(doubleLayout); + dSum += list.nextVarg(doubleLayout); } - MemoryAccess.setDouble(doubleSum, dSum); + doubleSum.set(JAVA_DOUBLE, 0, dSum); }; SumStackFunc sumStackNative = (longSum, doubleSum, list) -> { try { - MH_sumStack.invokeExact(longSum.address(), doubleSum.address(), list); + MH_sumStack.invoke(longSum, doubleSum, list); } catch (Throwable ex) { throw new AssertionError(ex); } @@ -491,20 +501,20 @@ public class VaListTest extends NativeTestHelper { @Test(dataProvider = "sumStack") public void testStack(Function, VaList> vaListFactory, SumStackFunc sumStack, - ValueLayout longLayout, - ValueLayout doubleLayout) { + ValueLayout.OfLong longLayout, + ValueLayout.OfDouble doubleLayout) { try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment longSum = MemorySegment.allocateNative(longLayout, scope); MemorySegment doubleSum = MemorySegment.allocateNative(doubleLayout, scope); - MemoryAccess.setLong(longSum, 0L); - MemoryAccess.setDouble(doubleSum, 0D); + longSum.set(JAVA_LONG, 0, 0L); + doubleSum.set(JAVA_DOUBLE, 0, 0D); VaList list = vaListFactory.apply(b -> { for (long l = 1; l <= 16L; l++) { - b.vargFromLong(longLayout, l); + b.addVarg(longLayout, l); } for (double d = 1; d <= 16D; d++) { - b.vargFromDouble(doubleLayout, d); + b.addVarg(doubleLayout, d); } }); @@ -514,8 +524,8 @@ public class VaListTest extends NativeTestHelper { list.scope().close(); } - long lSum = MemoryAccess.getLong(longSum); - double dSum = MemoryAccess.getDouble(doubleSum); + long lSum = longSum.get(JAVA_LONG, 0); + double dSum = doubleSum.get(JAVA_DOUBLE, 0); assertEquals(lSum, 136L); assertEquals(dSum, 136D); @@ -524,10 +534,10 @@ public class VaListTest extends NativeTestHelper { @Test(dataProvider = "upcalls") public void testUpcall(MethodHandle target, MethodHandle callback) throws Throwable { - FunctionDescriptor desc = FunctionDescriptor.ofVoid(C_VA_LIST); + FunctionDescriptor desc = FunctionDescriptor.ofVoid(C_POINTER); try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemoryAddress stub = abi.upcallStub(callback, desc, scope); - target.invokeExact(stub.address()); + NativeSymbol stub = abi.upcallStub(callback, desc, scope); + target.invoke(stub); } } @@ -555,8 +565,8 @@ public class VaListTest extends NativeTestHelper { @DataProvider @SuppressWarnings("unchecked") public static Object[][] sumIntsScoped() { - Function> sumIntsJavaFact = layout -> - (num, list) -> IntStream.generate(() -> list.vargAsInt(layout)).limit(num).sum(); + Function> sumIntsJavaFact = layout -> + (num, list) -> IntStream.generate(() -> list.nextVarg(layout)).limit(num).sum(); BiFunction sumIntsNative = MethodHandleProxies.asInterfaceInstance(BiFunction.class, MH_sumInts); return new Object[][]{ @@ -569,14 +579,13 @@ public class VaListTest extends NativeTestHelper { } @Test(dataProvider = "sumIntsScoped") - public void testScopedVaList(BiFunction, NativeScope, VaList> vaListFactory, + public void testScopedVaList(BiFunction, ResourceScope, VaList> vaListFactory, BiFunction sumInts, - ValueLayout intLayout) { + ValueLayout.OfInt intLayout) { VaList listLeaked; - try (NativeScope scope = new NativeScope()) { - VaList list = vaListFactory.apply(b -> b.vargFromInt(intLayout, 4) - .vargFromInt(intLayout, 8), - scope); + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + VaList list = vaListFactory.apply(b -> b.addVarg(intLayout, 4) + .addVarg(intLayout, 8), scope); int x = sumInts.apply(2, list); assertEquals(x, 12); listLeaked = list; @@ -589,13 +598,14 @@ public class VaListTest extends NativeTestHelper { Function sumStruct, // ignored GroupLayout Point_LAYOUT, VarHandle VH_Point_x, VarHandle VH_Point_y) { MemorySegment pointOut; - try (NativeScope scope = new NativeScope()) { + try (ResourceScope scope = ResourceScope.newConfinedScope()) { try (ResourceScope innerScope = ResourceScope.newConfinedScope()) { MemorySegment pointIn = MemorySegment.allocateNative(Point_LAYOUT, innerScope); VH_Point_x.set(pointIn, 3); VH_Point_y.set(pointIn, 6); - VaList list = vaListFactory.apply(b -> b.vargFromSegment(Point_LAYOUT, pointIn)); - pointOut = list.vargAsSegment(Point_LAYOUT, scope); + VaList list = vaListFactory.apply(b -> b.addVarg(Point_LAYOUT, pointIn)); + pointOut = MemorySegment.allocateNative(Point_LAYOUT, scope); + list.nextVarg(Point_LAYOUT, SegmentAllocator.prefixAllocator(pointOut)); assertEquals((int) VH_Point_x.get(pointOut), 3); assertEquals((int) VH_Point_y.get(pointOut), 6); list.scope().close(); @@ -617,12 +627,12 @@ public class VaListTest extends NativeTestHelper { } @Test(dataProvider = "copy") - public void testCopy(Function, VaList> vaListFactory, ValueLayout intLayout) { - VaList list = vaListFactory.apply(b -> b.vargFromInt(intLayout, 4) - .vargFromInt(intLayout, 8)); + public void testCopy(Function, VaList> vaListFactory, ValueLayout.OfInt intLayout) { + VaList list = vaListFactory.apply(b -> b.addVarg(intLayout, 4) + .addVarg(intLayout, 8)); VaList copy = list.copy(); - assertEquals(copy.vargAsInt(intLayout), 4); - assertEquals(copy.vargAsInt(intLayout), 8); + assertEquals(copy.nextVarg(intLayout), 4); + assertEquals(copy.nextVarg(intLayout), 8); // try { // this logic only works on Windows! // int x = copy.vargAsInt(intLayout); @@ -631,21 +641,21 @@ public class VaListTest extends NativeTestHelper { // // ok - we exhausted the list // } - assertEquals(list.vargAsInt(intLayout), 4); - assertEquals(list.vargAsInt(intLayout), 8); + assertEquals(list.nextVarg(intLayout), 4); + assertEquals(list.nextVarg(intLayout), 8); list.scope().close(); } @Test(dataProvider = "copy", expectedExceptions = IllegalStateException.class) public void testCopyUnusableAfterOriginalClosed(Function, VaList> vaListFactory, - ValueLayout intLayout) { - VaList list = vaListFactory.apply(b -> b.vargFromInt(intLayout, 4) - .vargFromInt(intLayout, 8)); + ValueLayout.OfInt intLayout) { + VaList list = vaListFactory.apply(b -> b.addVarg(intLayout, 4) + .addVarg(intLayout, 8)); VaList copy = list.copy(); list.scope().close(); - copy.vargAsInt(intLayout); // should throw + copy.nextVarg(intLayout); // should throw } @DataProvider @@ -654,38 +664,40 @@ public class VaListTest extends NativeTestHelper { C_LONG_LONG.withName("x"), C_LONG_LONG.withName("y") ); - VarHandle VH_BigPoint_x = BigPoint_LAYOUT.varHandle(long.class, groupElement("x")); - VarHandle VH_BigPoint_y = BigPoint_LAYOUT.varHandle(long.class, groupElement("y")); + VarHandle VH_BigPoint_x = BigPoint_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_BigPoint_y = BigPoint_LAYOUT.varHandle(groupElement("y")); GroupLayout Point_LAYOUT = MemoryLayout.structLayout( C_INT.withName("x"), C_INT.withName("y") ); - VarHandle VH_Point_x = Point_LAYOUT.varHandle(int.class, groupElement("x")); - VarHandle VH_Point_y = Point_LAYOUT.varHandle(int.class, groupElement("y")); + VarHandle VH_Point_x = Point_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_Point_y = Point_LAYOUT.varHandle(groupElement("y")); GroupLayout FloatPoint_LAYOUT = MemoryLayout.structLayout( C_FLOAT.withName("x"), C_FLOAT.withName("y") ); - VarHandle VH_FloatPoint_x = FloatPoint_LAYOUT.varHandle(float.class, groupElement("x")); - VarHandle VH_FloatPoint_y = FloatPoint_LAYOUT.varHandle(float.class, groupElement("y")); + VarHandle VH_FloatPoint_x = FloatPoint_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_FloatPoint_y = FloatPoint_LAYOUT.varHandle(groupElement("y")); GroupLayout HugePoint_LAYOUT = MemoryLayout.structLayout( C_LONG_LONG.withName("x"), C_LONG_LONG.withName("y"), C_LONG_LONG.withName("z") ); - VarHandle VH_HugePoint_x = HugePoint_LAYOUT.varHandle(long.class, groupElement("x")); - VarHandle VH_HugePoint_y = HugePoint_LAYOUT.varHandle(long.class, groupElement("y")); - VarHandle VH_HugePoint_z = HugePoint_LAYOUT.varHandle(long.class, groupElement("z")); + VarHandle VH_HugePoint_x = HugePoint_LAYOUT.varHandle(groupElement("x")); + VarHandle VH_HugePoint_y = HugePoint_LAYOUT.varHandle(groupElement("y")); + VarHandle VH_HugePoint_z = HugePoint_LAYOUT.varHandle(groupElement("z")); return new Object[][]{ { linkVaListCB("upcallBigStruct"), VaListConsumer.mh(vaList -> { - MemorySegment struct = vaList.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + vaList.nextVarg(BigPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((long) VH_BigPoint_x.get(struct), 8); assertEquals((long) VH_BigPoint_y.get(struct), 16); })}, { linkVaListCB("upcallBigStruct"), VaListConsumer.mh(vaList -> { VaList copy = vaList.copy(); - MemorySegment struct = vaList.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + vaList.nextVarg(BigPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((long) VH_BigPoint_x.get(struct), 8); assertEquals((long) VH_BigPoint_y.get(struct), 16); @@ -693,84 +705,91 @@ public class VaListTest extends NativeTestHelper { VH_BigPoint_y.set(struct, 0); // should be independent - struct = copy.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + copy.nextVarg(BigPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((long) VH_BigPoint_x.get(struct), 8); assertEquals((long) VH_BigPoint_y.get(struct), 16); })}, { linkVaListCB("upcallBigStructPlusScalar"), VaListConsumer.mh(vaList -> { - MemorySegment struct = vaList.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + vaList.nextVarg(BigPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((long) VH_BigPoint_x.get(struct), 8); assertEquals((long) VH_BigPoint_y.get(struct), 16); - assertEquals(vaList.vargAsLong(C_LONG_LONG), 42); + assertEquals(vaList.nextVarg(C_LONG_LONG), 42); })}, { linkVaListCB("upcallBigStructPlusScalar"), VaListConsumer.mh(vaList -> { vaList.skip(BigPoint_LAYOUT); - assertEquals(vaList.vargAsLong(C_LONG_LONG), 42); + assertEquals(vaList.nextVarg(C_LONG_LONG), 42); })}, { linkVaListCB("upcallStruct"), VaListConsumer.mh(vaList -> { - MemorySegment struct = vaList.vargAsSegment(Point_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(Point_LAYOUT, ResourceScope.newImplicitScope()); + vaList.nextVarg(Point_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((int) VH_Point_x.get(struct), 5); assertEquals((int) VH_Point_y.get(struct), 10); })}, { linkVaListCB("upcallHugeStruct"), VaListConsumer.mh(vaList -> { - MemorySegment struct = vaList.vargAsSegment(HugePoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(HugePoint_LAYOUT, ResourceScope.newImplicitScope()); + vaList.nextVarg(HugePoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((long) VH_HugePoint_x.get(struct), 1); assertEquals((long) VH_HugePoint_y.get(struct), 2); assertEquals((long) VH_HugePoint_z.get(struct), 3); })}, { linkVaListCB("upcallFloatStruct"), VaListConsumer.mh(vaList -> { - MemorySegment struct = vaList.vargAsSegment(FloatPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = MemorySegment.allocateNative(FloatPoint_LAYOUT, ResourceScope.newImplicitScope()); + vaList.nextVarg(FloatPoint_LAYOUT, SegmentAllocator.prefixAllocator(struct)); assertEquals((float) VH_FloatPoint_x.get(struct), 1.0f); assertEquals((float) VH_FloatPoint_y.get(struct), 2.0f); })}, { linkVaListCB("upcallMemoryAddress"), VaListConsumer.mh(vaList -> { - MemoryAddress intPtr = vaList.vargAsAddress(C_POINTER); - MemorySegment ms = intPtr.asSegment(C_INT.byteSize(), ResourceScope.globalScope()); - int x = MemoryAccess.getInt(ms); + MemoryAddress intPtr = vaList.nextVarg(C_POINTER); + MemorySegment ms = MemorySegment.ofAddress(intPtr, C_INT.byteSize(), ResourceScope.globalScope()); + int x = ms.get(JAVA_INT, 0); assertEquals(x, 10); })}, { linkVaListCB("upcallDoubles"), VaListConsumer.mh(vaList -> { - assertEquals(vaList.vargAsDouble(C_DOUBLE), 3.0); - assertEquals(vaList.vargAsDouble(C_DOUBLE), 4.0); - assertEquals(vaList.vargAsDouble(C_DOUBLE), 5.0); + assertEquals(vaList.nextVarg(C_DOUBLE), 3.0); + assertEquals(vaList.nextVarg(C_DOUBLE), 4.0); + assertEquals(vaList.nextVarg(C_DOUBLE), 5.0); })}, { linkVaListCB("upcallInts"), VaListConsumer.mh(vaList -> { - assertEquals(vaList.vargAsInt(C_INT), 10); - assertEquals(vaList.vargAsInt(C_INT), 15); - assertEquals(vaList.vargAsInt(C_INT), 20); + assertEquals(vaList.nextVarg(C_INT), 10); + assertEquals(vaList.nextVarg(C_INT), 15); + assertEquals(vaList.nextVarg(C_INT), 20); })}, { linkVaListCB("upcallStack"), VaListConsumer.mh(vaList -> { // skip all registers for (long l = 1; l <= 16; l++) { - assertEquals(vaList.vargAsLong(C_LONG_LONG), l); + assertEquals(vaList.nextVarg(C_LONG_LONG), l); } for (double d = 1; d <= 16; d++) { - assertEquals(vaList.vargAsDouble(C_DOUBLE), d); + assertEquals(vaList.nextVarg(C_DOUBLE), d); } // test some arbitrary values on the stack - assertEquals((byte) vaList.vargAsInt(C_INT), (byte) 1); - assertEquals((char) vaList.vargAsInt(C_INT), 'a'); - assertEquals((short) vaList.vargAsInt(C_INT), (short) 3); - assertEquals(vaList.vargAsInt(C_INT), 4); - assertEquals(vaList.vargAsLong(C_LONG_LONG), 5L); - assertEquals((float) vaList.vargAsDouble(C_DOUBLE), 6.0F); - assertEquals(vaList.vargAsDouble(C_DOUBLE), 7.0D); - assertEquals((byte) vaList.vargAsInt(C_INT), (byte) 8); - assertEquals((char) vaList.vargAsInt(C_INT), 'b'); - assertEquals((short) vaList.vargAsInt(C_INT), (short) 10); - assertEquals(vaList.vargAsInt(C_INT), 11); - assertEquals(vaList.vargAsLong(C_LONG_LONG), 12L); - assertEquals((float) vaList.vargAsDouble(C_DOUBLE), 13.0F); - assertEquals(vaList.vargAsDouble(C_DOUBLE), 14.0D); - - MemorySegment point = vaList.vargAsSegment(Point_LAYOUT, ResourceScope.newImplicitScope()); + assertEquals((byte) vaList.nextVarg(C_INT), (byte) 1); + assertEquals((char) vaList.nextVarg(C_INT), 'a'); + assertEquals((short) vaList.nextVarg(C_INT), (short) 3); + assertEquals(vaList.nextVarg(C_INT), 4); + assertEquals(vaList.nextVarg(C_LONG_LONG), 5L); + assertEquals((float) vaList.nextVarg(C_DOUBLE), 6.0F); + assertEquals(vaList.nextVarg(C_DOUBLE), 7.0D); + assertEquals((byte) vaList.nextVarg(C_INT), (byte) 8); + assertEquals((char) vaList.nextVarg(C_INT), 'b'); + assertEquals((short) vaList.nextVarg(C_INT), (short) 10); + assertEquals(vaList.nextVarg(C_INT), 11); + assertEquals(vaList.nextVarg(C_LONG_LONG), 12L); + assertEquals((float) vaList.nextVarg(C_DOUBLE), 13.0F); + assertEquals(vaList.nextVarg(C_DOUBLE), 14.0D); + + MemorySegment buffer = MemorySegment.allocateNative(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + SegmentAllocator bufferAllocator = SegmentAllocator.prefixAllocator(buffer); + + MemorySegment point = vaList.nextVarg(Point_LAYOUT, bufferAllocator); assertEquals((int) VH_Point_x.get(point), 5); assertEquals((int) VH_Point_y.get(point), 10); VaList copy = vaList.copy(); - MemorySegment bigPoint = vaList.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment bigPoint = vaList.nextVarg(BigPoint_LAYOUT, bufferAllocator); assertEquals((long) VH_BigPoint_x.get(bigPoint), 15); assertEquals((long) VH_BigPoint_y.get(bigPoint), 20); @@ -778,20 +797,20 @@ public class VaListTest extends NativeTestHelper { VH_BigPoint_y.set(bigPoint, 0); // should be independent - MemorySegment struct = copy.vargAsSegment(BigPoint_LAYOUT, ResourceScope.newImplicitScope()); + MemorySegment struct = copy.nextVarg(BigPoint_LAYOUT, bufferAllocator); assertEquals((long) VH_BigPoint_x.get(struct), 15); assertEquals((long) VH_BigPoint_y.get(struct), 20); })}, // test skip { linkVaListCB("upcallStack"), VaListConsumer.mh(vaList -> { vaList.skip(C_LONG_LONG, C_LONG_LONG, C_LONG_LONG, C_LONG_LONG); - assertEquals(vaList.vargAsLong(C_LONG_LONG), 5L); + assertEquals(vaList.nextVarg(C_LONG_LONG), 5L); vaList.skip(C_LONG_LONG, C_LONG_LONG, C_LONG_LONG, C_LONG_LONG); - assertEquals(vaList.vargAsLong(C_LONG_LONG), 10L); + assertEquals(vaList.nextVarg(C_LONG_LONG), 10L); vaList.skip(C_LONG_LONG, C_LONG_LONG, C_LONG_LONG, C_LONG_LONG, C_LONG_LONG, C_LONG_LONG); - assertEquals(vaList.vargAsDouble(C_DOUBLE), 1.0D); + assertEquals(vaList.nextVarg(C_DOUBLE), 1.0D); vaList.skip(C_DOUBLE, C_DOUBLE, C_DOUBLE, C_DOUBLE); - assertEquals(vaList.vargAsDouble(C_DOUBLE), 6.0D); + assertEquals(vaList.nextVarg(C_DOUBLE), 6.0D); })}, }; } @@ -801,8 +820,10 @@ public class VaListTest extends NativeTestHelper { static MethodHandle mh(VaListConsumer instance) { try { - return MethodHandles.lookup().findVirtual(VaListConsumer.class, "accept", + MethodHandle handle = MethodHandles.lookup().findVirtual(VaListConsumer.class, "accept", MethodType.methodType(void.class, VaList.class)).bindTo(instance); + return MethodHandles.filterArguments(handle, 0, + MethodHandles.insertArguments(ADDRESS_TO_VALIST, 1, ResourceScope.newConfinedScope())); } catch (ReflectiveOperationException e) { throw new InternalError(e); } diff --git a/test/jdk/java/foreign/virtual/TestVirtualCalls.java b/test/jdk/java/foreign/virtual/TestVirtualCalls.java index 39f80bdce1d..70eecd151ce 100644 --- a/test/jdk/java/foreign/virtual/TestVirtualCalls.java +++ b/test/jdk/java/foreign/virtual/TestVirtualCalls.java @@ -24,6 +24,7 @@ /* * @test * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" + * @library ../ * @run testng/othervm * --enable-native-access=ALL-UNNAMED * TestVirtualCalls @@ -34,28 +35,26 @@ import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodType; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; import org.testng.annotations.*; -import static jdk.incubator.foreign.CLinker.*; import static org.testng.Assert.assertEquals; -public class TestVirtualCalls { +public class TestVirtualCalls extends NativeTestHelper { - static final CLinker abi = CLinker.getInstance(); + static final CLinker abi = CLinker.systemCLinker(); static final MethodHandle func; - static final MemoryAddress funcA; - static final MemoryAddress funcB; - static final MemoryAddress funcC; + static final NativeSymbol funcA; + static final NativeSymbol funcB; + static final NativeSymbol funcC; static { func = abi.downcallHandle( - MethodType.methodType(int.class), - FunctionDescriptor.of(C_INT)); + FunctionDescriptor.of(C_INT)); System.loadLibrary("Virtual"); SymbolLookup lookup = SymbolLookup.loaderLookup(); @@ -66,14 +65,14 @@ public class TestVirtualCalls { @Test public void testVirtualCalls() throws Throwable { - assertEquals((int) func.invokeExact((Addressable) funcA), 1); - assertEquals((int) func.invokeExact((Addressable) funcB), 2); - assertEquals((int) func.invokeExact((Addressable) funcC), 3); + assertEquals((int) func.invokeExact(funcA), 1); + assertEquals((int) func.invokeExact(funcB), 2); + assertEquals((int) func.invokeExact(funcC), 3); } @Test(expectedExceptions = NullPointerException.class) public void testNullTarget() throws Throwable { - int x = (int) func.invokeExact((Addressable) null); + int x = (int) func.invokeExact((NativeSymbol) null); } } diff --git a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestExact.java b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestExact.java index 6c14c885a24..bd1d1b58b6f 100644 --- a/test/jdk/java/lang/invoke/VarHandles/VarHandleTestExact.java +++ b/test/jdk/java/lang/invoke/VarHandles/VarHandleTestExact.java @@ -47,6 +47,7 @@ */ import jdk.incubator.foreign.MemoryHandles; +import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import jdk.internal.access.foreign.MemorySegmentProxy; @@ -170,7 +171,7 @@ public class VarHandleTestExact { @Test(dataProvider = "dataSetMemorySegment") public void testExactSegmentSet(Class carrier, Object testValue, SetSegmentX setter) { - VarHandle vh = MemoryHandles.varHandle(carrier, ByteOrder.nativeOrder()); + VarHandle vh = MemoryHandles.varHandle(MemoryLayout.valueLayout(carrier, ByteOrder.nativeOrder())); try (ResourceScope scope = ResourceScope.newConfinedScope()) { MemorySegment seg = MemorySegment.allocateNative(8, scope); doTest(vh, diff --git a/test/jdk/java/util/stream/test/org/openjdk/tests/java/util/stream/SegmentTestDataProvider.java b/test/jdk/java/util/stream/test/org/openjdk/tests/java/util/stream/SegmentTestDataProvider.java index 772e112b23d..7a4d16dff13 100644 --- a/test/jdk/java/util/stream/test/org/openjdk/tests/java/util/stream/SegmentTestDataProvider.java +++ b/test/jdk/java/util/stream/test/org/openjdk/tests/java/util/stream/SegmentTestDataProvider.java @@ -23,9 +23,7 @@ package org.openjdk.tests.java.util.stream; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; import java.lang.invoke.VarHandle; @@ -36,12 +34,13 @@ import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; +import jdk.incubator.foreign.ValueLayout; import org.testng.annotations.DataProvider; public class SegmentTestDataProvider { static boolean compareSegmentsByte(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getByte; + Function mapper = s -> s.get(ValueLayout.JAVA_BYTE, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -52,7 +51,7 @@ public class SegmentTestDataProvider { } static boolean compareSegmentsChar(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getChar; + Function mapper = s -> s.get(ValueLayout.JAVA_CHAR, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -63,7 +62,7 @@ public class SegmentTestDataProvider { } static boolean compareSegmentsShort(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getShort; + Function mapper = s -> s.get(ValueLayout.JAVA_SHORT, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -74,7 +73,7 @@ public class SegmentTestDataProvider { } static boolean compareSegmentsInt(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getInt; + Function mapper = s -> s.get(ValueLayout.JAVA_INT, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -85,7 +84,7 @@ public class SegmentTestDataProvider { } static boolean compareSegmentsLong(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getLong; + Function mapper = s-> s.get(ValueLayout.JAVA_LONG, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -96,7 +95,7 @@ public class SegmentTestDataProvider { } static boolean compareSegmentsFloat(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getFloat; + Function mapper = s -> s.get(ValueLayout.JAVA_FLOAT, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -115,7 +114,7 @@ public class SegmentTestDataProvider { } static boolean compareSegmentsDouble(Collection segments1, Collection segments2, boolean isOrdered) { - Function mapper = MemoryAccess::getDouble; + Function mapper = s -> s.get(ValueLayout.JAVA_DOUBLE, 0); List list1 = segments1.stream() .map(mapper) .collect(Collectors.toList()); @@ -127,18 +126,18 @@ public class SegmentTestDataProvider { static void initSegment(MemorySegment segment) { for (int i = 0 ; i < segment.byteSize() ; i++) { - MemoryAccess.setByte(segment, (byte)i); + segment.set(ValueLayout.JAVA_BYTE, 0, (byte)i); } } static Object[][] spliteratorTestData = { - { "bytes", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_BYTE), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsByte }, - { "chars", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_CHAR), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsChar }, - { "shorts", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_SHORT), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsShort }, - { "ints", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_INT), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsInt }, - { "longs", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_LONG), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsLong }, - { "floats", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_FLOAT), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsFloat }, - { "doubles", MemoryLayout.sequenceLayout(1024, MemoryLayouts.JAVA_DOUBLE), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsDouble }, + { "bytes", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_BYTE), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsByte }, + { "chars", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_CHAR), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsChar }, + { "shorts", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_SHORT), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsShort }, + { "ints", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsInt }, + { "longs", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_LONG), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsLong }, + { "floats", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_FLOAT), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsFloat }, + { "doubles", MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_DOUBLE), (SpliteratorTestHelper.ContentAsserter)SegmentTestDataProvider::compareSegmentsDouble }, }; // returns an array of (String name, Supplier>, ContentAsserter) diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkMismatchAcquire.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkMismatchAcquire.java index 5d962ee3979..c9fc3abd33a 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkMismatchAcquire.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkMismatchAcquire.java @@ -26,7 +26,6 @@ package org.openjdk.bench.jdk.incubator.foreign; import jdk.incubator.foreign.ResourceScope; -import jdk.incubator.foreign.SegmentAllocator; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -38,15 +37,12 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; -import sun.misc.Unsafe; import jdk.incubator.foreign.MemorySegment; import java.nio.ByteBuffer; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; - @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -71,7 +67,7 @@ public class BulkMismatchAcquire { } } - @Param({"CONFINED", "SHARED", "IMPLICIT"}) + @Param({"CONFINED", "SHARED"}) public ScopeKind scopeKind; // large(ish) segments/buffers with same content, 0, for mismatch, non-multiple-of-8 sized @@ -121,8 +117,7 @@ public class BulkMismatchAcquire { @TearDown public void tearDown() { - if (!scope.isImplicit()) - scope.close(); + scope.close(); } @Benchmark @@ -134,11 +129,9 @@ public class BulkMismatchAcquire { @Benchmark @OutputTimeUnit(TimeUnit.NANOSECONDS) public long mismatch_large_segment_acquire() { - var handle = mismatchSegmentLarge1.scope().acquire(); - try { + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + scope.keepAlive(mismatchSegmentLarge1.scope()); return mismatchSegmentLarge1.mismatch(mismatchSegmentLarge2); - } finally { - mismatchSegmentLarge1.scope().release(handle); } } @@ -157,11 +150,9 @@ public class BulkMismatchAcquire { @Benchmark @OutputTimeUnit(TimeUnit.NANOSECONDS) public long mismatch_small_segment_acquire() { - var handle = mismatchSegmentLarge1.scope().acquire(); - try { + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + scope.keepAlive(mismatchSegmentLarge1.scope()); return mismatchSegmentSmall1.mismatch(mismatchSegmentSmall2); - } finally { - mismatchSegmentLarge1.scope().release(handle); } } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkOps.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkOps.java index ac92e9429ca..25d6cf557b0 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkOps.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/BulkOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -27,19 +27,23 @@ package org.openjdk.bench.jdk.incubator.foreign; import jdk.incubator.foreign.ResourceScope; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.CompilerControl; import org.openjdk.jmh.annotations.Fork; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; import org.openjdk.jmh.annotations.Warmup; import sun.misc.Unsafe; import jdk.incubator.foreign.MemorySegment; import java.nio.ByteBuffer; +import java.nio.IntBuffer; import java.util.concurrent.TimeUnit; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -55,26 +59,31 @@ public class BulkOps { static final int CARRIER_SIZE = (int)JAVA_INT.byteSize(); static final int ALLOC_SIZE = ELEM_SIZE * CARRIER_SIZE; - static final long unsafe_addr = unsafe.allocateMemory(ALLOC_SIZE); - static final MemorySegment segment = MemorySegment.allocateNative(ALLOC_SIZE, ResourceScope.newConfinedScope()); + final ResourceScope scope = ResourceScope.newConfinedScope(); - static final int[] bytes = new int[ELEM_SIZE]; - static final MemorySegment bytesSegment = MemorySegment.ofArray(bytes); - static final int UNSAFE_INT_OFFSET = unsafe.arrayBaseOffset(int[].class); + final long unsafe_addr = unsafe.allocateMemory(ALLOC_SIZE); + final MemorySegment segment = MemorySegment.allocateNative(ALLOC_SIZE, ResourceScope.newConfinedScope()); + final IntBuffer buffer = IntBuffer.allocate(ELEM_SIZE); + + final int[] bytes = new int[ELEM_SIZE]; + final MemorySegment bytesSegment = MemorySegment.ofArray(bytes); + final int UNSAFE_INT_OFFSET = unsafe.arrayBaseOffset(int[].class); // large(ish) segments/buffers with same content, 0, for mismatch, non-multiple-of-8 sized static final int SIZE_WITH_TAIL = (1024 * 1024) + 7; - static final MemorySegment mismatchSegmentLarge1 = MemorySegment.allocateNative(SIZE_WITH_TAIL, ResourceScope.newConfinedScope()); - static final MemorySegment mismatchSegmentLarge2 = MemorySegment.allocateNative(SIZE_WITH_TAIL, ResourceScope.newConfinedScope()); - static final ByteBuffer mismatchBufferLarge1 = ByteBuffer.allocateDirect(SIZE_WITH_TAIL); - static final ByteBuffer mismatchBufferLarge2 = ByteBuffer.allocateDirect(SIZE_WITH_TAIL); + final MemorySegment mismatchSegmentLarge1 = MemorySegment.allocateNative(SIZE_WITH_TAIL, scope); + final MemorySegment mismatchSegmentLarge2 = MemorySegment.allocateNative(SIZE_WITH_TAIL, scope); + final ByteBuffer mismatchBufferLarge1 = ByteBuffer.allocateDirect(SIZE_WITH_TAIL); + final ByteBuffer mismatchBufferLarge2 = ByteBuffer.allocateDirect(SIZE_WITH_TAIL); // mismatch at first byte - static final MemorySegment mismatchSegmentSmall1 = MemorySegment.allocateNative(7, ResourceScope.newConfinedScope()); - static final MemorySegment mismatchSegmentSmall2 = MemorySegment.allocateNative(7, ResourceScope.newConfinedScope()); - static final ByteBuffer mismatchBufferSmall1 = ByteBuffer.allocateDirect(7); - static final ByteBuffer mismatchBufferSmall2 = ByteBuffer.allocateDirect(7); - static { + final MemorySegment mismatchSegmentSmall1 = MemorySegment.allocateNative(7, scope); + final MemorySegment mismatchSegmentSmall2 = MemorySegment.allocateNative(7, scope); + final ByteBuffer mismatchBufferSmall1 = ByteBuffer.allocateDirect(7); + final ByteBuffer mismatchBufferSmall2 = ByteBuffer.allocateDirect(7); + + @Setup + public void setup() { mismatchSegmentSmall1.fill((byte) 0xFF); mismatchBufferSmall1.put((byte) 0xFF).clear(); // verify expected mismatch indices @@ -90,14 +99,17 @@ public class BulkOps { bi = mismatchBufferSmall1.mismatch(mismatchBufferSmall2); if (bi != 0) throw new AssertionError("Unexpected mismatch index:" + bi); - } - static { for (int i = 0 ; i < bytes.length ; i++) { bytes[i] = i; } } + @TearDown + public void tearDown() { + scope.close(); + } + @Benchmark @OutputTimeUnit(TimeUnit.NANOSECONDS) public void unsafe_fill() { @@ -122,6 +134,50 @@ public class BulkOps { segment.copyFrom(bytesSegment); } + @Benchmark + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void segment_copy_static() { + MemorySegment.copy(bytes, 0, segment, JAVA_INT, 0, bytes.length); + } + + @Benchmark + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void segment_copy_static_small() { + MemorySegment.copy(bytes, 0, segment, JAVA_INT, 0, 10); + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void segment_copy_static_small_dontinline() { + MemorySegment.copy(bytes, 0, segment, JAVA_INT, 0, 10); + } + + @Benchmark + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void unsafe_copy_small() { + unsafe.copyMemory(bytes, UNSAFE_INT_OFFSET, null, unsafe_addr, 10 * CARRIER_SIZE); + } + + @Benchmark + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void buffer_copy_small() { + buffer.put(0, bytes, 0, 10); + } + + @Benchmark + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void buffer_copy() { + buffer.put(0, bytes, 0, bytes.length); + } + + @Benchmark + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public void segment_copy_static_dontinline() { + MemorySegment.copy(bytes, 0, segment, JAVA_INT, 0, bytes.length); + } + @Benchmark @OutputTimeUnit(TimeUnit.NANOSECONDS) public long mismatch_large_segment() { diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CLayouts.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CLayouts.java new file mode 100644 index 00000000000..530731e34bf --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CLayouts.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.jdk.incubator.foreign; + +import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.ValueLayout; + +import java.lang.invoke.MethodHandle; + +public class CLayouts { + + // the constants below are useful aliases for C types. The type/carrier association is only valid for 64-bit platforms. + + /** + * The layout for the {@code bool} C type + */ + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + /** + * The layout for the {@code char} C type + */ + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; + /** + * The layout for the {@code short} C type + */ + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; + /** + * The layout for the {@code int} C type + */ + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; + + /** + * The layout for the {@code long long} C type. + */ + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; + /** + * The layout for the {@code float} C type + */ + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; + /** + * The layout for the {@code double} C type + */ + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; + /** + * The {@code T*} native type. + */ + public static final ValueLayout.OfAddress C_POINTER = ValueLayout.ADDRESS; + + private static CLinker LINKER = CLinker.systemCLinker(); + + private static final MethodHandle FREE = LINKER.downcallHandle( + LINKER.lookup("free").get(), FunctionDescriptor.ofVoid(ValueLayout.ADDRESS)); + + private static final MethodHandle MALLOC = LINKER.downcallHandle( + LINKER.lookup("malloc").get(), FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.JAVA_LONG)); + + public static void freeMemory(Addressable address) { + try { + FREE.invokeExact(address); + } catch (Throwable ex) { + throw new IllegalStateException(ex); + } + } + + public static MemoryAddress allocateMemory(long size) { + try { + return (MemoryAddress)MALLOC.invokeExact(size); + } catch (Throwable ex) { + throw new IllegalStateException(ex); + } + } +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadConstant.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadConstant.java index bd627646770..8fe3d1b1ea4 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadConstant.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadConstant.java @@ -22,6 +22,7 @@ */ package org.openjdk.bench.jdk.incubator.foreign; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import org.openjdk.jmh.annotations.Benchmark; @@ -55,11 +56,6 @@ public class CallOverheadConstant { func.invokeExact(); } - @Benchmark - public void panama_blank_trivial() throws Throwable { - func_trivial.invokeExact(); - } - @Benchmark public int jni_identity() throws Throwable { return identity(10); @@ -71,18 +67,73 @@ public class CallOverheadConstant { } @Benchmark - public int panama_identity_trivial() throws Throwable { - return (int) identity_trivial.invokeExact(10); + public MemorySegment panama_identity_struct_confined() throws Throwable { + return (MemorySegment) identity_struct.invokeExact(recycling_allocator, confinedPoint); + } + + @Benchmark + public MemorySegment panama_identity_struct_shared() throws Throwable { + return (MemorySegment) identity_struct.invokeExact(recycling_allocator, sharedPoint); + } + + @Benchmark + public MemorySegment panama_identity_struct_confined_3() throws Throwable { + return (MemorySegment) identity_struct_3.invokeExact(recycling_allocator, confinedPoint, confinedPoint, confinedPoint); + } + + @Benchmark + public MemorySegment panama_identity_struct_shared_3() throws Throwable { + return (MemorySegment) identity_struct_3.invokeExact(recycling_allocator, sharedPoint, sharedPoint, sharedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_shared() throws Throwable { + return (MemoryAddress) identity_memory_address.invokeExact((Addressable)sharedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_confined() throws Throwable { + return (MemoryAddress) identity_memory_address.invokeExact((Addressable)confinedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_shared_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)sharedPoint.address(), (Addressable)sharedPoint.address(), (Addressable)sharedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_confined_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)confinedPoint.address(), (Addressable)confinedPoint.address(), (Addressable)confinedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_shared() throws Throwable { + return (MemoryAddress) identity_memory_address.invokeExact((Addressable)sharedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_confined() throws Throwable { + return (MemoryAddress) identity_memory_address.invokeExact((Addressable)confinedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_shared_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)sharedPoint, (Addressable)sharedPoint, (Addressable)sharedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_confined_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)confinedPoint, (Addressable)confinedPoint, (Addressable)confinedPoint); } @Benchmark - public MemorySegment panama_identity_struct() throws Throwable { - return (MemorySegment) identity_struct.invokeExact(recycling_allocator, point); + public MemoryAddress panama_identity_memory_address_null() throws Throwable { + return (MemoryAddress) identity_memory_address.invokeExact((Addressable)MemoryAddress.NULL); } @Benchmark - public MemoryAddress panama_identity_memory_address() throws Throwable { - return (MemoryAddress) identity_memory_address.invokeExact(MemoryAddress.NULL); + public MemoryAddress panama_identity_memory_address_null_non_exact() throws Throwable { + return (MemoryAddress) identity_memory_address.invoke(MemoryAddress.NULL); } @Benchmark diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadHelper.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadHelper.java index 4989f5fa47e..259c4b26bdd 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadHelper.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadHelper.java @@ -22,12 +22,11 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.SymbolLookup; @@ -36,57 +35,58 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; import static java.lang.invoke.MethodHandles.insertArguments; -import static jdk.incubator.foreign.CLinker.C_DOUBLE; -import static jdk.incubator.foreign.CLinker.C_INT; -import static jdk.incubator.foreign.CLinker.C_LONG_LONG; -import static jdk.incubator.foreign.CLinker.C_POINTER; -public class CallOverheadHelper { +public class CallOverheadHelper extends CLayouts { - static final CLinker abi = CLinker.getInstance(); + static final CLinker abi = CLinker.systemCLinker(); static final MethodHandle func; static final MethodHandle func_v; - static Addressable func_addr; + static NativeSymbol func_addr; static final MethodHandle identity; static final MethodHandle identity_v; - static Addressable identity_addr; + static NativeSymbol identity_addr; static final MethodHandle identity_struct; static final MethodHandle identity_struct_v; - static Addressable identity_struct_addr; + static NativeSymbol identity_struct_addr; + static final MethodHandle identity_struct_3; + static final MethodHandle identity_struct_3_v; + static NativeSymbol identity_struct_3_addr; static final MethodHandle identity_memory_address; static final MethodHandle identity_memory_address_v; - static Addressable identity_memory_address_addr; + static NativeSymbol identity_memory_address_addr; + static final MethodHandle identity_memory_address_3; + static final MethodHandle identity_memory_address_3_v; + static NativeSymbol identity_memory_address_3_addr; static final MethodHandle args1; static final MethodHandle args1_v; - static Addressable args1_addr; + static NativeSymbol args1_addr; static final MethodHandle args2; static final MethodHandle args2_v; - static Addressable args2_addr; + static NativeSymbol args2_addr; static final MethodHandle args3; static final MethodHandle args3_v; - static Addressable args3_addr; + static NativeSymbol args3_addr; static final MethodHandle args4; static final MethodHandle args4_v; - static Addressable args4_addr; + static NativeSymbol args4_addr; static final MethodHandle args5; static final MethodHandle args5_v; - static Addressable args5_addr; + static NativeSymbol args5_addr; static final MethodHandle args10; static final MethodHandle args10_v; - static Addressable args10_addr; - static final MethodHandle func_trivial; - static final MethodHandle func_trivial_v; - static final MethodHandle identity_trivial; - static final MethodHandle identity_trivial_v; + static NativeSymbol args10_addr; static final MemoryLayout POINT_LAYOUT = MemoryLayout.structLayout( - C_LONG_LONG, C_LONG_LONG + C_INT, C_INT ); + static final MemorySegment sharedPoint = MemorySegment.allocateNative(POINT_LAYOUT, ResourceScope.newSharedScope()); + static final MemorySegment confinedPoint = MemorySegment.allocateNative(POINT_LAYOUT, ResourceScope.newConfinedScope()); + static final MemorySegment point = MemorySegment.allocateNative(POINT_LAYOUT, ResourceScope.newImplicitScope()); - static final SegmentAllocator recycling_allocator = SegmentAllocator.ofSegment(MemorySegment.allocateNative(POINT_LAYOUT, ResourceScope.newImplicitScope())); + static final SegmentAllocator recycling_allocator = SegmentAllocator.prefixAllocator(MemorySegment.allocateNative(POINT_LAYOUT, ResourceScope.newImplicitScope())); static { System.loadLibrary("CallOverheadJNI"); @@ -97,66 +97,62 @@ public class CallOverheadHelper { func_addr = lookup.lookup("func").orElseThrow(); MethodType mt = MethodType.methodType(void.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(); - func_v = abi.downcallHandle(mt, fd); + func_v = abi.downcallHandle(fd); func = insertArguments(func_v, 0, func_addr); - func_trivial_v = abi.downcallHandle(mt, fd.withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true)); - func_trivial = insertArguments(func_trivial_v, 0, func_addr); } { identity_addr = lookup.lookup("identity").orElseThrow(); - MethodType mt = MethodType.methodType(int.class, int.class); FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_INT); - identity_v = abi.downcallHandle(mt, fd); + identity_v = abi.downcallHandle(fd); identity = insertArguments(identity_v, 0, identity_addr); - identity_trivial_v = abi.downcallHandle(mt, fd.withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true)); - identity_trivial = insertArguments(identity_trivial_v, 0, identity_addr); } identity_struct_addr = lookup.lookup("identity_struct").orElseThrow(); identity_struct_v = abi.downcallHandle( - MethodType.methodType(MemorySegment.class, MemorySegment.class), FunctionDescriptor.of(POINT_LAYOUT, POINT_LAYOUT)); identity_struct = insertArguments(identity_struct_v, 0, identity_struct_addr); + identity_struct_3_addr = lookup.lookup("identity_struct_3").orElseThrow(); + identity_struct_3_v = abi.downcallHandle( + FunctionDescriptor.of(POINT_LAYOUT, POINT_LAYOUT, POINT_LAYOUT, POINT_LAYOUT)); + identity_struct_3 = insertArguments(identity_struct_3_v, 0, identity_struct_3_addr); + identity_memory_address_addr = lookup.lookup("identity_memory_address").orElseThrow(); identity_memory_address_v = abi.downcallHandle( - MethodType.methodType(MemoryAddress.class, MemoryAddress.class), FunctionDescriptor.of(C_POINTER, C_POINTER)); identity_memory_address = insertArguments(identity_memory_address_v, 0, identity_memory_address_addr); + identity_memory_address_3_addr = lookup.lookup("identity_memory_address_3").orElseThrow(); + identity_memory_address_3_v = abi.downcallHandle( + FunctionDescriptor.of(C_POINTER, C_POINTER, C_POINTER, C_POINTER)); + identity_memory_address_3 = insertArguments(identity_memory_address_3_v, 0, identity_memory_address_3_addr); + args1_addr = lookup.lookup("args1").orElseThrow(); args1_v = abi.downcallHandle( - MethodType.methodType(void.class, long.class), FunctionDescriptor.ofVoid(C_LONG_LONG)); args1 = insertArguments(args1_v, 0, args1_addr); args2_addr = lookup.lookup("args2").orElseThrow(); args2_v = abi.downcallHandle( - MethodType.methodType(void.class, long.class, double.class), FunctionDescriptor.ofVoid(C_LONG_LONG, C_DOUBLE)); args2 = insertArguments(args2_v, 0, args2_addr); args3_addr = lookup.lookup("args3").orElseThrow(); args3_v = abi.downcallHandle( - MethodType.methodType(void.class, long.class, double.class, long.class), FunctionDescriptor.ofVoid(C_LONG_LONG, C_DOUBLE, C_LONG_LONG)); args3 = insertArguments(args3_v, 0, args3_addr); args4_addr = lookup.lookup("args4").orElseThrow(); args4_v = abi.downcallHandle( - MethodType.methodType(void.class, long.class, double.class, long.class, double.class), FunctionDescriptor.ofVoid(C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE)); args4 = insertArguments(args4_v, 0, args4_addr); args5_addr = lookup.lookup("args5").orElseThrow(); args5_v = abi.downcallHandle( - MethodType.methodType(void.class, long.class, double.class, long.class, double.class, long.class), FunctionDescriptor.ofVoid(C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG)); args5 = insertArguments(args5_v, 0, args5_addr); args10_addr = lookup.lookup("args10").orElseThrow(); args10_v = abi.downcallHandle( - MethodType.methodType(void.class, long.class, double.class, long.class, double.class, long.class, - double.class, long.class, double.class, long.class, double.class), FunctionDescriptor.ofVoid(C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE)); args10 = insertArguments(args10_v, 0, args10_addr); diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadVirtual.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadVirtual.java index e1e557bad23..11152bdd044 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadVirtual.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadVirtual.java @@ -22,6 +22,7 @@ */ package org.openjdk.bench.jdk.incubator.foreign; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import org.openjdk.jmh.annotations.Benchmark; @@ -56,23 +57,72 @@ public class CallOverheadVirtual { } @Benchmark - public void panama_blank_trivial() throws Throwable { - func_trivial_v.invokeExact(func_addr); + public int jni_identity() throws Throwable { + return identity(10); + } + + public MemorySegment panama_identity_struct_confined() throws Throwable { + return (MemorySegment) identity_struct_v.invokeExact(identity_struct_addr, recycling_allocator, confinedPoint); } @Benchmark - public int jni_identity() throws Throwable { - return identity(10); + public MemorySegment panama_identity_struct_shared() throws Throwable { + return (MemorySegment) identity_struct_v.invokeExact(identity_struct_addr, recycling_allocator, sharedPoint); } @Benchmark - public int panama_identity() throws Throwable { - return (int) identity_v.invokeExact(identity_addr, 10); + public MemorySegment panama_identity_struct_confined_3() throws Throwable { + return (MemorySegment) identity_struct_3_v.invokeExact(identity_struct_3_addr, recycling_allocator, confinedPoint, confinedPoint, confinedPoint); } @Benchmark - public int panama_identity_trivial() throws Throwable { - return (int) identity_trivial_v.invokeExact(identity_addr, 10); + public MemorySegment panama_identity_struct_shared_3() throws Throwable { + return (MemorySegment) identity_struct_3_v.invokeExact(identity_struct_3_addr, recycling_allocator, sharedPoint, sharedPoint, sharedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_shared() throws Throwable { + return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, (Addressable)sharedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_confined() throws Throwable { + return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, (Addressable)confinedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_shared_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_memory_address_3_addr, (Addressable)sharedPoint.address(), (Addressable)sharedPoint.address(), (Addressable)sharedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_memory_address_confined_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_memory_address_3_addr, (Addressable)confinedPoint.address(), (Addressable)confinedPoint.address(), (Addressable)confinedPoint.address()); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_shared() throws Throwable { + return (MemoryAddress) identity_memory_address_v.invokeExact(identity_struct_addr, (Addressable)sharedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_confined() throws Throwable { + return (MemoryAddress) identity_memory_address_v.invokeExact(identity_struct_addr, (Addressable)confinedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_shared_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_struct_3_addr, (Addressable)sharedPoint, (Addressable)sharedPoint, (Addressable)sharedPoint); + } + + @Benchmark + public MemoryAddress panama_identity_struct_ref_confined_3() throws Throwable { + return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_struct_3_addr, (Addressable)confinedPoint, (Addressable)confinedPoint, (Addressable)confinedPoint); + } + + @Benchmark + public int panama_identity() throws Throwable { + return (int) identity_v.invokeExact(identity_addr, 10); } @Benchmark @@ -81,8 +131,8 @@ public class CallOverheadVirtual { } @Benchmark - public MemoryAddress panama_identity_memory_address() throws Throwable { - return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, MemoryAddress.NULL); + public MemoryAddress panama_identity_memory_address_null() throws Throwable { + return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, (Addressable)MemoryAddress.NULL); } @Benchmark diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.h b/test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.h new file mode 100644 index 00000000000..9af5383ead7 --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021, 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 + +typedef struct { + jclass holder; + jmethodID mid; +} *JNICB; diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.java new file mode 100644 index 00000000000..89ead66025e --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/JNICB.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.jdk.incubator.foreign; + +public class JNICB { + + static { + System.loadLibrary("JNICB"); + } + + public static native long makeCB(String holder, String name, String signature); +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverConstant.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverConstant.java index 64cc3697687..e1b1b86b61a 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverConstant.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverConstant.java @@ -44,7 +44,7 @@ import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -73,7 +73,7 @@ public class LoopOverConstant { //setup native memory segment static final MemorySegment segment = MemorySegment.allocateNative(ALLOC_SIZE, ResourceScope.newImplicitScope()); - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); static { for (int i = 0; i < ELEM_SIZE; i++) { diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNew.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNew.java index 0d59d83488f..c50148e46e6 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNew.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNew.java @@ -44,7 +44,7 @@ import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -61,10 +61,10 @@ public class LoopOverNew { static final int ALLOC_SIZE = ELEM_SIZE * CARRIER_SIZE; static final MemoryLayout ALLOC_LAYOUT = MemoryLayout.sequenceLayout(ELEM_SIZE, JAVA_INT); - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); final ResourceScope scope = ResourceScope.newConfinedScope(); - final SegmentAllocator recyclingAlloc = SegmentAllocator.ofSegment(MemorySegment.allocateNative(ALLOC_LAYOUT, scope)); + final SegmentAllocator recyclingAlloc = SegmentAllocator.prefixAllocator(MemorySegment.allocateNative(ALLOC_LAYOUT, scope)); @TearDown public void tearDown() throws Throwable { diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNewHeap.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNewHeap.java new file mode 100644 index 00000000000..62677639f2f --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNewHeap.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.jdk.incubator.foreign; + +import jdk.incubator.foreign.MemoryLayout; +import jdk.incubator.foreign.MemorySegment; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.CompilerControl; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Warmup; +import sun.misc.Unsafe; + +import java.lang.invoke.VarHandle; +import java.nio.IntBuffer; +import java.util.concurrent.TimeUnit; + +import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; + +@BenchmarkMode(Mode.AverageTime) +@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@State(org.openjdk.jmh.annotations.Scope.Thread) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign" }) +public class LoopOverNewHeap { + + static final Unsafe unsafe = Utils.unsafe; + + static final int ELEM_SIZE = 1_000_000; + static final int CARRIER_SIZE = (int)JAVA_INT.byteSize(); + + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); + + @Param(value = {"false", "true"}) + boolean polluteProfile; + + @Setup + public void setup() { + if (polluteProfile) { + for (int i = 0 ; i < 10000 ; i++) { + MemorySegment intB = MemorySegment.ofArray(new byte[ELEM_SIZE]); + MemorySegment intI = MemorySegment.ofArray(new int[ELEM_SIZE]); + MemorySegment intD = MemorySegment.ofArray(new double[ELEM_SIZE]); + MemorySegment intF = MemorySegment.ofArray(new float[ELEM_SIZE]); + } + } + } + + @Benchmark + public void unsafe_loop() { + int[] elems = new int[ELEM_SIZE]; + for (int i = 0; i < ELEM_SIZE; i++) { + unsafe.putInt(elems, Unsafe.ARRAY_INT_BASE_OFFSET + (i * CARRIER_SIZE) , i); + } + } + + + @Benchmark + public void segment_loop() { + MemorySegment segment = MemorySegment.ofArray(new int[ELEM_SIZE]); + for (int i = 0; i < ELEM_SIZE; i++) { + VH_int.set(segment, (long) i, i); + } + } + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + @Benchmark + public void segment_loop_dontinline() { + MemorySegment segment = MemorySegment.ofArray(new int[ELEM_SIZE]); + for (int i = 0; i < ELEM_SIZE; i++) { + VH_int.set(segment, (long) i, i); + } + } + + @Benchmark + public void buffer_loop() { + IntBuffer buffer = IntBuffer.wrap(new int[ELEM_SIZE]); + for (int i = 0; i < ELEM_SIZE; i++) { + buffer.put(i , i); + } + } + +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstant.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstant.java index c4af846b685..ada578b09ba 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstant.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -22,7 +22,7 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.MemoryAccess; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -44,14 +44,14 @@ import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @State(org.openjdk.jmh.annotations.Scope.Thread) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign" }) +@Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" }) public class LoopOverNonConstant { static final Unsafe unsafe = Utils.unsafe; @@ -60,7 +60,7 @@ public class LoopOverNonConstant { static final int CARRIER_SIZE = (int)JAVA_INT.byteSize(); static final int ALLOC_SIZE = ELEM_SIZE * CARRIER_SIZE; - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); MemorySegment segment; long unsafe_addr; @@ -117,19 +117,48 @@ public class LoopOverNonConstant { } @Benchmark - public int segment_loop_static() { - int res = 0; - for (int i = 0; i < ELEM_SIZE; i ++) { - res += MemoryAccess.getIntAtIndex(segment, i); + public int segment_loop() { + int sum = 0; + for (int i = 0; i < ELEM_SIZE; i++) { + sum += (int) VH_int.get(segment, (long) i); } - return res; + return sum; } @Benchmark - public int segment_loop() { + public int segment_loop_instance() { int sum = 0; for (int i = 0; i < ELEM_SIZE; i++) { - sum += (int) VH_int.get(segment, (long) i); + sum += segment.get(JAVA_INT, i * CARRIER_SIZE); + + } + return sum; + } + + @Benchmark + public int segment_loop_instance_index() { + int sum = 0; + for (int i = 0; i < ELEM_SIZE; i++) { + sum += segment.getAtIndex(JAVA_INT, i); + + } + return sum; + } + + @Benchmark + public int segment_loop_instance_address() { + int sum = 0; + for (int i = 0; i < ELEM_SIZE; i++) { + sum += segment.address().get(JAVA_INT, i * CARRIER_SIZE); + } + return sum; + } + + @Benchmark + public int segment_loop_instance_address_index() { + int sum = 0; + for (int i = 0; i < ELEM_SIZE; i++) { + sum += segment.address().getAtIndex(JAVA_INT, i); } return sum; } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantFP.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantFP.java index 17c8cd6b341..180c12240fa 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantFP.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantFP.java @@ -22,7 +22,6 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; import org.openjdk.jmh.annotations.Benchmark; @@ -42,7 +41,7 @@ import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -75,10 +74,10 @@ public class LoopOverNonConstantFP { segmentIn = MemorySegment.allocateNative(ALLOC_SIZE, ResourceScope.newConfinedScope()); segmentOut = MemorySegment.allocateNative(ALLOC_SIZE, ResourceScope.newConfinedScope()); for (int i = 0; i < ELEM_SIZE; i++) { - MemoryAccess.setDoubleAtIndex(segmentIn, i, i); + segmentIn.setAtIndex(JAVA_DOUBLE, i, i); } for (int i = 0; i < ELEM_SIZE; i++) { - MemoryAccess.setDoubleAtIndex(segmentOut, i, i); + segmentOut.setAtIndex(JAVA_DOUBLE, i, i); } byteBufferIn = ByteBuffer.allocateDirect(ALLOC_SIZE).order(ByteOrder.nativeOrder()); byteBufferOut = ByteBuffer.allocateDirect(ALLOC_SIZE).order(ByteOrder.nativeOrder()); @@ -112,9 +111,9 @@ public class LoopOverNonConstantFP { @Benchmark public void segment_loop() { for (int i = 0; i < ELEM_SIZE; i ++) { - MemoryAccess.setDoubleAtIndex(segmentOut, i, - MemoryAccess.getDoubleAtIndex(segmentIn, i) + - MemoryAccess.getDoubleAtIndex(segmentOut, i)); + segmentOut.setAtIndex(JAVA_DOUBLE, i, + segmentIn.getAtIndex(JAVA_DOUBLE, i) + + segmentOut.getAtIndex(JAVA_DOUBLE, i)); } } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantHeap.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantHeap.java index 2b2be067fdc..5b51db08c00 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantHeap.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -22,7 +22,6 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -46,7 +45,10 @@ import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; +import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -63,7 +65,7 @@ public class LoopOverNonConstantHeap { static final int ALLOC_SIZE = ELEM_SIZE * CARRIER_SIZE; static final int UNSAFE_BYTE_BASE = unsafe.arrayBaseOffset(byte[].class); - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); MemorySegment segment; byte[] base; @@ -79,13 +81,13 @@ public class LoopOverNonConstantHeap { MemorySegment intI = MemorySegment.ofArray(new int[ALLOC_SIZE]); MemorySegment intD = MemorySegment.ofArray(new double[ALLOC_SIZE]); MemorySegment intF = MemorySegment.ofArray(new float[ALLOC_SIZE]); - MemorySegment s = MemorySegment.allocateNative(ALLOC_SIZE, 1, ResourceScope.newConfinedScope(Cleaner.create())); + MemorySegment s = MemorySegment.allocateNative(ALLOC_SIZE, 1, ResourceScope.newConfinedScope()); for (int i = 0; i < ALLOC_SIZE; i++) { - MemoryAccess.setByteAtOffset(intB, i, (byte)i); - MemoryAccess.setIntAtIndex(intI, i, i); - MemoryAccess.setDoubleAtIndex(intD, i, i); - MemoryAccess.setFloatAtIndex(intF, i, i); - MemoryAccess.setByteAtOffset(s, i, (byte) i); + intB.set(JAVA_BYTE, i, (byte)i); + intI.setAtIndex(JAVA_INT, i, i); + intD.setAtIndex(JAVA_DOUBLE, i, i); + intF.setAtIndex(JAVA_FLOAT, i, i); + s.set(JAVA_BYTE, i, (byte) i); } } @@ -134,10 +136,10 @@ public class LoopOverNonConstantHeap { } @Benchmark - public int segment_loop_static() { + public int segment_loop_instance() { int res = 0; for (int i = 0; i < ELEM_SIZE; i ++) { - res += MemoryAccess.getIntAtIndex(segment, i); + res += segment.get(JAVA_INT, i * CARRIER_SIZE); } return res; } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantMapped.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantMapped.java index 11f1c1f061e..5e4e22916bf 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantMapped.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantMapped.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -22,7 +22,6 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -51,14 +50,14 @@ import java.nio.file.StandardOpenOption; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @State(org.openjdk.jmh.annotations.Scope.Thread) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign" }) +@Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" }) public class LoopOverNonConstantMapped { static final Unsafe unsafe = Utils.unsafe; @@ -81,7 +80,7 @@ public class LoopOverNonConstantMapped { } } - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); MemorySegment segment; long unsafe_addr; @@ -143,10 +142,19 @@ public class LoopOverNonConstantMapped { } @Benchmark - public int segment_loop_static() { + public int segment_loop_instance() { int res = 0; for (int i = 0; i < ELEM_SIZE; i ++) { - res += MemoryAccess.getIntAtIndex(segment, i); + res += segment.get(JAVA_INT, i * CARRIER_SIZE); + } + return res; + } + + @Benchmark + public int segment_loop_instance_address() { + int res = 0; + for (int i = 0; i < ELEM_SIZE; i ++) { + res += segment.address().get(JAVA_INT, i * CARRIER_SIZE); } return res; } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantShared.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantShared.java index 06c6310845a..75c64a024f9 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantShared.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverNonConstantShared.java @@ -22,7 +22,6 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -44,7 +43,7 @@ import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -60,7 +59,7 @@ public class LoopOverNonConstantShared { static final int CARRIER_SIZE = (int)JAVA_INT.byteSize(); static final int ALLOC_SIZE = ELEM_SIZE * CARRIER_SIZE; - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); MemorySegment segment; long unsafe_addr; @@ -72,7 +71,7 @@ public class LoopOverNonConstantShared { for (int i = 0; i < ELEM_SIZE; i++) { unsafe.putInt(unsafe_addr + (i * CARRIER_SIZE) , i); } - segment = MemorySegment.allocateNative(ALLOC_SIZE, CARRIER_SIZE, ResourceScope.newSharedScope()); + segment = MemorySegment.allocateNative(ALLOC_SIZE, CARRIER_SIZE, ResourceScope.newConfinedScope()); for (int i = 0; i < ELEM_SIZE; i++) { VH_int.set(segment, (long) i, i); } @@ -117,10 +116,19 @@ public class LoopOverNonConstantShared { } @Benchmark - public int segment_loop_static() { + public int segment_loop_instance() { int res = 0; for (int i = 0; i < ELEM_SIZE; i ++) { - res += MemoryAccess.getIntAtIndex(segment, i); + res += segment.get(JAVA_INT, i * CARRIER_SIZE); + } + return res; + } + + @Benchmark + public int segment_loop_instance_address() { + int res = 0; + for (int i = 0; i < ELEM_SIZE; i ++) { + res += segment.get(JAVA_INT, i * CARRIER_SIZE); } return res; } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedBuffer.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedBuffer.java index 3903159c407..0d1c90cb987 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedBuffer.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedBuffer.java @@ -42,7 +42,7 @@ import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.util.concurrent.TimeUnit; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedSegments.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedSegments.java index 65ae252ee32..4cb01f091f1 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedSegments.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/LoopOverPollutedSegments.java @@ -22,7 +22,6 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -42,7 +41,8 @@ import java.lang.invoke.VarHandle; import java.util.concurrent.TimeUnit; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -62,7 +62,7 @@ public class LoopOverPollutedSegments { byte[] arr; long addr; - static final VarHandle intHandle = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, MemoryLayout.PathElement.sequenceElement()); + static final VarHandle intHandle = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(MemoryLayout.PathElement.sequenceElement()); @Setup @@ -79,14 +79,14 @@ public class LoopOverPollutedSegments { for (int rep = 0 ; rep < 5 ; rep++) { for (int i = 0; i < ELEM_SIZE; i++) { unsafe.putInt(arr, Unsafe.ARRAY_BYTE_BASE_OFFSET + (i * 4), i); - MemoryAccess.setIntAtIndex(nativeSegment, i, i); - MemoryAccess.setFloatAtIndex(nativeSegment, i, i); + nativeSegment.setAtIndex(JAVA_INT, i, i); + nativeSegment.setAtIndex(JAVA_FLOAT, i, i); intHandle.set(nativeSegment, (long)i, i); - MemoryAccess.setIntAtIndex(heapSegmentBytes, i, i); - MemoryAccess.setFloatAtIndex(heapSegmentBytes, i, i); + heapSegmentBytes.setAtIndex(JAVA_INT, i, i); + heapSegmentBytes.setAtIndex(JAVA_FLOAT, i, i); intHandle.set(heapSegmentBytes, (long)i, i); - MemoryAccess.setIntAtIndex(heapSegmentFloats, i, i); - MemoryAccess.setFloatAtIndex(heapSegmentFloats, i, i); + heapSegmentFloats.setAtIndex(JAVA_INT, i, i); + heapSegmentFloats.setAtIndex(JAVA_FLOAT, i, i); intHandle.set(heapSegmentFloats, (long)i, i); } } @@ -113,11 +113,11 @@ public class LoopOverPollutedSegments { } @Benchmark - public int native_segment_static() { + public int native_segment_instance() { int sum = 0; for (int k = 0; k < ELEM_SIZE; k++) { - MemoryAccess.setIntAtOffset(nativeSegment, k, k + 1); - int v = MemoryAccess.getIntAtOffset(nativeSegment, k); + nativeSegment.setAtIndex(JAVA_INT, k, k + 1); + int v = nativeSegment.getAtIndex(JAVA_INT, k); sum += v; } return sum; @@ -135,11 +135,11 @@ public class LoopOverPollutedSegments { } @Benchmark - public int heap_segment_ints_static() { + public int heap_segment_ints_instance() { int sum = 0; for (int k = 0; k < ELEM_SIZE; k++) { - MemoryAccess.setIntAtOffset(heapSegmentBytes, k, k + 1); - int v = MemoryAccess.getIntAtOffset(heapSegmentBytes, k); + heapSegmentBytes.setAtIndex(JAVA_INT, k, k + 1); + int v = heapSegmentBytes.getAtIndex(JAVA_INT, k); sum += v; } return sum; @@ -157,11 +157,11 @@ public class LoopOverPollutedSegments { } @Benchmark - public int heap_segment_floats_static() { + public int heap_segment_floats_instance() { int sum = 0; for (int k = 0; k < ELEM_SIZE; k++) { - MemoryAccess.setIntAtOffset(heapSegmentFloats, k, k + 1); - int v = MemoryAccess.getIntAtOffset(heapSegmentFloats, k); + heapSegmentFloats.setAtIndex(JAVA_INT, k, k + 1); + int v = heapSegmentFloats.getAtIndex(JAVA_INT, k); sum += v; } return sum; diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/ParallelSum.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/ParallelSum.java index 231c606103b..6ec449a1ec0 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/ParallelSum.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/ParallelSum.java @@ -24,9 +24,9 @@ package org.openjdk.bench.jdk.incubator.foreign; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SequenceLayout; +import jdk.incubator.foreign.ValueLayout; import sun.misc.Unsafe; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -52,7 +52,7 @@ import java.util.function.Predicate; import java.util.function.ToIntFunction; import static jdk.incubator.foreign.MemoryLayout.PathElement.sequenceElement; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -65,9 +65,9 @@ public class ParallelSum { final static int CARRIER_SIZE = 4; final static int ALLOC_SIZE = CARRIER_SIZE * 1024 * 1024 * 256; final static int ELEM_SIZE = ALLOC_SIZE / CARRIER_SIZE; - static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(int.class, sequenceElement()); + static final VarHandle VH_int = MemoryLayout.sequenceLayout(JAVA_INT).varHandle(sequenceElement()); - final static MemoryLayout ELEM_LAYOUT = MemoryLayouts.JAVA_INT; + final static MemoryLayout ELEM_LAYOUT = ValueLayout.JAVA_INT; final static int BULK_FACTOR = 512; final static SequenceLayout ELEM_LAYOUT_BULK = MemoryLayout.sequenceLayout(BULK_FACTOR, ELEM_LAYOUT); diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/QSort.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/QSort.java new file mode 100644 index 00000000000..04a10f8ed4e --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/QSort.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.jdk.incubator.foreign; + +import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.MemoryLayout; +import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.ResourceScope; +import jdk.incubator.foreign.SymbolLookup; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.util.concurrent.TimeUnit; + +import static java.lang.invoke.MethodHandles.lookup; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; + +@BenchmarkMode(Mode.AverageTime) +@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@State(org.openjdk.jmh.annotations.Scope.Thread) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" }) +public class QSort extends CLayouts { + + static final CLinker abi = CLinker.systemCLinker(); + static final MethodHandle clib_qsort; + static final NativeSymbol native_compar; + static final NativeSymbol panama_upcall_compar; + static final long jni_upcall_compar; + + static final int[] INPUT = { 5, 3, 2, 7, 8, 12, 1, 7 }; + static final MemorySegment INPUT_SEGMENT; + + static NativeSymbol qsort_addr = abi.lookup("qsort").get(); + + static { + INPUT_SEGMENT = MemorySegment.allocateNative(MemoryLayout.sequenceLayout(INPUT.length, JAVA_INT), ResourceScope.globalScope()); + INPUT_SEGMENT.copyFrom(MemorySegment.ofArray(INPUT)); + + System.loadLibrary("QSortJNI"); + jni_upcall_compar = JNICB.makeCB("org/openjdk/bench/jdk/incubator/foreign/QSort", "jni_upcall_compar", "(II)I"); + + try { + clib_qsort = abi.downcallHandle( + qsort_addr, + FunctionDescriptor.ofVoid(C_POINTER, C_LONG_LONG, C_LONG_LONG, C_POINTER) + ); + System.loadLibrary("QSort"); + native_compar = SymbolLookup.loaderLookup().lookup("compar").orElseThrow(); + panama_upcall_compar = abi.upcallStub( + lookup().findStatic(QSort.class, + "panama_upcall_compar", + MethodType.methodType(int.class, MemoryAddress.class, MemoryAddress.class)), + FunctionDescriptor.of(C_INT, C_POINTER, C_POINTER), + ResourceScope.globalScope() + ); + } catch (ReflectiveOperationException e) { + throw new BootstrapMethodError(e); + } + } + + static native void jni_qsort_optimized(int[] array, long cb); + static native void jni_qsort_naive(int[] array); + + @FunctionalInterface + interface JNIComparator { + int cmp(int e0, int e1); + } + + static final JNIComparator COMP = QSort::jni_upcall_compar; + + @Benchmark + public void native_qsort() throws Throwable { + clib_qsort.invokeExact((Addressable)INPUT_SEGMENT, (long) INPUT.length, JAVA_INT.byteSize(), (Addressable)native_compar); + } + + @Benchmark + public void jni_upcall_qsort_optimized() { + jni_qsort_optimized(INPUT, jni_upcall_compar); + } + + @Benchmark + public void jni_upcall_qsort_naive() { + jni_qsort_naive(INPUT); + } + + @Benchmark + public void panama_upcall_qsort() throws Throwable { + clib_qsort.invokeExact((Addressable)INPUT_SEGMENT, (long) INPUT.length, JAVA_INT.byteSize(), (Addressable)panama_upcall_compar); + } + + private static int getIntAbsolute(MemoryAddress addr) { + return addr.get(JAVA_INT, 0); + } + + static int panama_upcall_compar(MemoryAddress e0, MemoryAddress e1) { + return Integer.compare(getIntAbsolute(e0), getIntAbsolute(e1)); + } + + static int jni_upcall_compar(int j0, int j1) { + return Integer.compare(j0, j1); + } +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/StrLenTest.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/StrLenTest.java index ec4da5ffc88..ec7d58cf823 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/StrLenTest.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/StrLenTest.java @@ -25,9 +25,9 @@ package org.openjdk.bench.jdk.incubator.foreign; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -45,10 +45,9 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodType; import java.util.concurrent.TimeUnit; -import static jdk.incubator.foreign.CLinker.*; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -56,12 +55,12 @@ import static jdk.incubator.foreign.CLinker.*; @State(org.openjdk.jmh.annotations.Scope.Thread) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" }) -public class StrLenTest { +public class StrLenTest extends CLayouts { - ResourceScope scope = ResourceScope.newConfinedScope(); + ResourceScope scope = ResourceScope.newImplicitScope(); SegmentAllocator segmentAllocator; - SegmentAllocator arenaAllocator = SegmentAllocator.arenaAllocator(scope); + SegmentAllocator arenaAllocator = SegmentAllocator.newNativeArena(scope); @Param({"5", "20", "100"}) public int size; @@ -72,31 +71,17 @@ public class StrLenTest { } static final MethodHandle STRLEN; - static final MethodHandle STRLEN_TRIVIAL; - static final MethodHandle MALLOC_TRIVIAL; - static final MethodHandle FREE_TRIVIAL; static { - CLinker abi = CLinker.getInstance(); - STRLEN = abi.downcallHandle(CLinker.systemLookup().lookup("strlen").get(), - MethodType.methodType(int.class, MemoryAddress.class), + CLinker abi = CLinker.systemCLinker(); + STRLEN = abi.downcallHandle(abi.lookup("strlen").get(), FunctionDescriptor.of(C_INT, C_POINTER)); - STRLEN_TRIVIAL = abi.downcallHandle(CLinker.systemLookup().lookup("strlen").get(), - MethodType.methodType(int.class, MemoryAddress.class), - FunctionDescriptor.of(C_INT, C_POINTER).withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true)); - MALLOC_TRIVIAL = abi.downcallHandle(CLinker.systemLookup().lookup("malloc").get(), - MethodType.methodType(MemoryAddress.class, long.class), - FunctionDescriptor.of(C_POINTER, C_LONG_LONG).withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true)); - - FREE_TRIVIAL = abi.downcallHandle(CLinker.systemLookup().lookup("free").get(), - MethodType.methodType(void.class, MemoryAddress.class), - FunctionDescriptor.ofVoid(C_POINTER).withAttribute(FunctionDescriptor.TRIVIAL_ATTRIBUTE_NAME, true)); } @Setup public void setup() { str = makeString(size); - segmentAllocator = SegmentAllocator.ofSegment(MemorySegment.allocateNative(size + 1, ResourceScope.newImplicitScope())); + segmentAllocator = SegmentAllocator.prefixAllocator(MemorySegment.allocateNative(size + 1, ResourceScope.newConfinedScope())); } @TearDown @@ -112,54 +97,37 @@ public class StrLenTest { @Benchmark public int panama_strlen() throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - MemorySegment segment = CLinker.toCString(str, scope); - return (int)STRLEN.invokeExact(segment.address()); + MemorySegment segment = MemorySegment.allocateNative(str.length() + 1, scope); + segment.setUtf8String(0, str); + return (int)STRLEN.invokeExact((Addressable)segment); } } @Benchmark public int panama_strlen_arena() throws Throwable { - return (int)STRLEN.invokeExact(CLinker.toCString(str, arenaAllocator).address()); + return (int)STRLEN.invokeExact((Addressable)arenaAllocator.allocateUtf8String(str)); } @Benchmark public int panama_strlen_prefix() throws Throwable { - return (int)STRLEN.invokeExact(CLinker.toCString(str, segmentAllocator).address()); + return (int)STRLEN.invokeExact((Addressable)segmentAllocator.allocateUtf8String(str)); } @Benchmark public int panama_strlen_unsafe() throws Throwable { MemoryAddress address = makeStringUnsafe(str); - int res = (int) STRLEN.invokeExact(address); - CLinker.freeMemory(address); - return res; - } - - @Benchmark - public int panama_strlen_unsafe_trivial() throws Throwable { - MemoryAddress address = makeStringUnsafeTrivial(str); - int res = (int) STRLEN_TRIVIAL.invokeExact(address); - FREE_TRIVIAL.invokeExact(address); + int res = (int) STRLEN.invokeExact((Addressable)address); + freeMemory(address); return res; } static MemoryAddress makeStringUnsafe(String s) { byte[] bytes = s.getBytes(); int len = bytes.length; - MemoryAddress address = CLinker.allocateMemory(len + 1); - MemorySegment str = address.asSegment(len + 1, ResourceScope.globalScope()); - str.copyFrom(MemorySegment.ofArray(bytes)); - MemoryAccess.setByteAtOffset(str, len, (byte)0); - return address; - } - - static MemoryAddress makeStringUnsafeTrivial(String s) throws Throwable { - byte[] bytes = s.getBytes(); - int len = bytes.length; - MemoryAddress address = (MemoryAddress)MALLOC_TRIVIAL.invokeExact((long)len + 1); - MemorySegment str = address.asSegment(len + 1, ResourceScope.globalScope()); + MemoryAddress address = allocateMemory(len + 1); + MemorySegment str = MemorySegment.ofAddress(address, len + 1, ResourceScope.globalScope()); str.copyFrom(MemorySegment.ofArray(bytes)); - MemoryAccess.setByteAtOffset(str, len, (byte)0); + str.set(JAVA_BYTE, len, (byte)0); return address; } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestAdaptVarHandles.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestAdaptVarHandles.java index f8f482b3a28..4540b590782 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestAdaptVarHandles.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestAdaptVarHandles.java @@ -26,8 +26,8 @@ package org.openjdk.bench.jdk.incubator.foreign; import jdk.incubator.foreign.MemoryHandles; import jdk.incubator.foreign.MemoryLayout; -import jdk.incubator.foreign.MemoryLayouts; import jdk.incubator.foreign.MemorySegment; +import jdk.incubator.foreign.ValueLayout; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -85,8 +85,8 @@ public class TestAdaptVarHandles { static final VarHandle VH_box_int = MemoryHandles.filterValue(VH_int, INTBOX_TO_INT, INT_TO_INTBOX); - static final VarHandle VH_addr_int = MemoryLayout.sequenceLayout(MemoryLayouts.JAVA_INT) - .varHandle(int.class, MemoryLayout.PathElement.sequenceElement()); + static final VarHandle VH_addr_int = MemoryLayout.sequenceLayout(ValueLayout.JAVA_INT) + .varHandle(MemoryLayout.PathElement.sequenceElement()); static final VarHandle VH_addr_box_int = MemoryHandles.filterValue(VH_addr_int, INTBOX_TO_INT, INT_TO_INTBOX); diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestLoadBytes.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestLoadBytes.java index 45c170b8dd3..6288c49cf92 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestLoadBytes.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/TestLoadBytes.java @@ -23,14 +23,8 @@ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.CLinker; -import jdk.incubator.foreign.MemoryAccess; -import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; -import jdk.incubator.vector.ByteVector; -import jdk.incubator.vector.IntVector; -import jdk.incubator.vector.VectorSpecies; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.CompilerControl; @@ -44,9 +38,10 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; + @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -119,7 +114,7 @@ public class TestLoadBytes { public int segmentNativeScalar() { int size = 0; for (int i = 0; i < srcArray.length; i++) { - var v = MemoryAccess.getByteAtOffset(srcSegmentImplicit, i); + var v = srcSegmentImplicit.get(JAVA_BYTE, i); size += v; } return size; @@ -129,7 +124,7 @@ public class TestLoadBytes { public int segmentNativeScalarConst() { int size = 0; for (int i = 0; i < 1024; i++) { - var v = MemoryAccess.getByteAtOffset(srcSegmentImplicit, i); + var v = srcSegmentImplicit.get(JAVA_BYTE, i); size += v; } return size; diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/UnrolledAccess.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/UnrolledAccess.java index 614ff42b8f4..ea72c01f7b9 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/UnrolledAccess.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/UnrolledAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -23,7 +23,6 @@ package org.openjdk.bench.jdk.incubator.foreign; -import static jdk.incubator.foreign.MemoryAccess.*; import jdk.incubator.foreign.*; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.runner.Runner; @@ -34,20 +33,22 @@ import java.util.concurrent.TimeUnit; import java.lang.invoke.VarHandle; +import static jdk.incubator.foreign.ValueLayout.JAVA_LONG; + @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @State(org.openjdk.jmh.annotations.Scope.Thread) @OutputTimeUnit(TimeUnit.MICROSECONDS) -@Fork(3) +@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED" }) public class UnrolledAccess { static final Unsafe U = Utils.unsafe; final static int SIZE = 1024; - static final VarHandle LONG_HANDLE = MemoryLayout.sequenceLayout(SIZE, MemoryLayouts.JAVA_LONG) - .varHandle(long.class, MemoryLayout.PathElement.sequenceElement()); + static final VarHandle LONG_HANDLE = MemoryLayout.sequenceLayout(SIZE, JAVA_LONG) + .varHandle(MemoryLayout.PathElement.sequenceElement()); @State(Scope.Benchmark) public static class Data { @@ -65,8 +66,8 @@ public class UnrolledAccess { this.outputArray = new double[SIZE]; this.inputAddress = U.allocateMemory(8 * SIZE); this.outputAddress = U.allocateMemory(8 * SIZE); - this.inputSegment = MemoryAddress.ofLong(inputAddress).asSegment(8*SIZE, ResourceScope.globalScope()); - this.outputSegment = MemoryAddress.ofLong(outputAddress).asSegment(8*SIZE, ResourceScope.globalScope()); + this.inputSegment = MemorySegment.ofAddress(MemoryAddress.ofLong(inputAddress), 8*SIZE, ResourceScope.globalScope()); + this.outputSegment = MemorySegment.ofAddress(MemoryAddress.ofLong(outputAddress), 8*SIZE, ResourceScope.globalScope()); } } @@ -96,15 +97,15 @@ public class UnrolledAccess { } @Benchmark - public void static_handle_loop(Data state) { + public void handle_loop_instance(Data state) { final MemorySegment is = state.inputSegment; final MemorySegment os = state.outputSegment; for(int i = 0; i < SIZE; i+=4) { - setLongAtIndex(os, i,getLongAtIndex(is, i) + MemoryAccess.getLongAtIndex(os, i)); - setLongAtIndex(os, i+1,getLongAtIndex(is, i+1) + getLongAtIndex(os, i+1)); - setLongAtIndex(os, i+2,getLongAtIndex(is, i+2) + getLongAtIndex(os, i+2)); - setLongAtIndex(os, i+3,getLongAtIndex(is, i+3) + getLongAtIndex(os, i+3)); + os.setAtIndex(JAVA_LONG, i, is.getAtIndex(JAVA_LONG, i) + os.get(JAVA_LONG, i)); + os.setAtIndex(JAVA_LONG, i+1, is.getAtIndex(JAVA_LONG, i+1) + os.get(JAVA_LONG, i+1)); + os.setAtIndex(JAVA_LONG, i+2, is.getAtIndex(JAVA_LONG, i+2) + os.get(JAVA_LONG, i+2)); + os.setAtIndex(JAVA_LONG, i+3, is.getAtIndex(JAVA_LONG, i+3) + os.get(JAVA_LONG, i+3)); } } } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java index a25f4f9ae9f..12a7ca3b42b 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -22,9 +22,10 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.ResourceScope; import jdk.incubator.foreign.SymbolLookup; import org.openjdk.jmh.annotations.Benchmark; @@ -41,10 +42,6 @@ import java.lang.invoke.MethodType; import java.util.concurrent.TimeUnit; import static java.lang.invoke.MethodHandles.lookup; -import static jdk.incubator.foreign.CLinker.C_DOUBLE; -import static jdk.incubator.foreign.CLinker.C_INT; -import static jdk.incubator.foreign.CLinker.C_LONG_LONG; -import static jdk.incubator.foreign.CLinker.C_POINTER; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -52,18 +49,18 @@ import static jdk.incubator.foreign.CLinker.C_POINTER; @State(org.openjdk.jmh.annotations.Scope.Thread) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" }) -public class Upcalls { +public class Upcalls extends CLayouts { - static final CLinker abi = CLinker.getInstance(); + static final CLinker abi = CLinker.systemCLinker(); static final MethodHandle blank; static final MethodHandle identity; static final MethodHandle args5; static final MethodHandle args10; - static final MemoryAddress cb_blank; - static final MemoryAddress cb_identity; - static final MemoryAddress cb_args5; - static final MemoryAddress cb_args10; + static final NativeSymbol cb_blank; + static final NativeSymbol cb_identity; + static final NativeSymbol cb_args5; + static final NativeSymbol cb_args10; static final long cb_blank_jni; static final long cb_identity_jni; @@ -74,10 +71,10 @@ public class Upcalls { System.loadLibrary("UpcallsJNI"); String className = "org/openjdk/bench/jdk/incubator/foreign/Upcalls"; - cb_blank_jni = makeCB(className, "blank", "()V"); - cb_identity_jni = makeCB(className, "identity", "(I)I"); - cb_args5_jni = makeCB(className, "args5", "(JDJDJ)V"); - cb_args10_jni = makeCB(className, "args10", "(JDJDJDJDJD)V"); + cb_blank_jni = JNICB.makeCB(className, "blank", "()V"); + cb_identity_jni = JNICB.makeCB(className, "identity", "(I)I"); + cb_args5_jni = JNICB.makeCB(className, "args5", "(JDJDJ)V"); + cb_args10_jni = JNICB.makeCB(className, "args10", "(JDJDJDJDJD)V"); try { System.loadLibrary("Upcalls"); @@ -86,7 +83,7 @@ public class Upcalls { MethodType mt = MethodType.methodType(void.class); FunctionDescriptor fd = FunctionDescriptor.ofVoid(); - blank = linkFunc(name, mt, fd); + blank = linkFunc(name, fd); cb_blank = makeCB(name, mt, fd); } { @@ -94,7 +91,7 @@ public class Upcalls { MethodType mt = MethodType.methodType(int.class, int.class); FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_INT); - identity = linkFunc(name, mt, fd); + identity = linkFunc(name, fd); cb_identity = makeCB(name, mt, fd); } { @@ -104,7 +101,7 @@ public class Upcalls { FunctionDescriptor fd = FunctionDescriptor.ofVoid( C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG); - args5 = linkFunc(name, mt, fd); + args5 = linkFunc(name, fd); cb_args5 = makeCB(name, mt, fd); } { @@ -116,7 +113,7 @@ public class Upcalls { C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE, C_LONG_LONG, C_DOUBLE); - args10 = linkFunc(name, mt, fd); + args10 = linkFunc(name, fd); cb_args10 = makeCB(name, mt, fd); } } catch (ReflectiveOperationException e) { @@ -124,19 +121,18 @@ public class Upcalls { } } - static MethodHandle linkFunc(String name, MethodType baseType, FunctionDescriptor baseDesc) { + static MethodHandle linkFunc(String name, FunctionDescriptor baseDesc) { return abi.downcallHandle( SymbolLookup.loaderLookup().lookup(name).orElseThrow(), - baseType.insertParameterTypes(baseType.parameterCount(), MemoryAddress.class), - baseDesc.withAppendedArgumentLayouts(C_POINTER) + baseDesc.withAppendedArgumentLayouts(C_POINTER) ); } - static MemoryAddress makeCB(String name, MethodType mt, FunctionDescriptor fd) throws ReflectiveOperationException { + static NativeSymbol makeCB(String name, MethodType mt, FunctionDescriptor fd) throws ReflectiveOperationException { return abi.upcallStub( lookup().findStatic(Upcalls.class, name, mt), fd, ResourceScope.globalScope() - ).address(); + ); } static native void blank(long cb); @@ -144,7 +140,6 @@ public class Upcalls { static native void args5(long a0, double a1, long a2, double a3, long a4, long cb); static native void args10(long a0, double a1, long a2, double a3, long a4, double a5, long a6, double a7, long a8, double a9, long cb); - static native long makeCB(String holder, String name, String signature); @Benchmark public void jni_blank() throws Throwable { @@ -153,7 +148,7 @@ public class Upcalls { @Benchmark public void panama_blank() throws Throwable { - blank.invokeExact(cb_blank); + blank.invokeExact((Addressable)cb_blank); } @Benchmark @@ -173,17 +168,17 @@ public class Upcalls { @Benchmark public int panama_identity() throws Throwable { - return (int) identity.invokeExact(10, cb_identity); + return (int) identity.invokeExact(10, (Addressable)cb_identity); } @Benchmark public void panama_args5() throws Throwable { - args5.invokeExact(1L, 2D, 3L, 4D, 5L, cb_args5); + args5.invokeExact(1L, 2D, 3L, 4D, 5L, (Addressable)cb_args5); } @Benchmark public void panama_args10() throws Throwable { - args10.invokeExact(1L, 2D, 3L, 4D, 5L, 6D, 7L, 8D, 9L, 10D, cb_args10); + args10.invokeExact(1L, 2D, 3L, 4D, 5L, 6D, 7L, 8D, 9L, 10D, (Addressable)cb_args10); } static void blank() {} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/VaList.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/VaList.java index 34d74652cad..d904c79a734 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/VaList.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/VaList.java @@ -22,8 +22,10 @@ */ package org.openjdk.bench.jdk.incubator.foreign; -import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.ResourceScope; import org.openjdk.jmh.annotations.Benchmark; @@ -36,24 +38,17 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodType; import java.util.concurrent.TimeUnit; -import static jdk.incubator.foreign.CLinker.C_DOUBLE; -import static jdk.incubator.foreign.CLinker.C_INT; -import static jdk.incubator.foreign.CLinker.C_LONG_LONG; -import static jdk.incubator.foreign.CLinker.C_VA_LIST; -import static jdk.incubator.foreign.CLinker.asVarArg; - @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @State(org.openjdk.jmh.annotations.Scope.Thread) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(value = 3, jvmArgsAppend = { "--add-modules=jdk.incubator.foreign", "--enable-native-access=ALL-UNNAMED" }) -public class VaList { +public class VaList extends CLayouts { - static final CLinker linker = CLinker.getInstance(); + static final CLinker linker = CLinker.systemCLinker(); static { System.loadLibrary("VaList"); } @@ -64,11 +59,9 @@ public class VaList { static { SymbolLookup lookup = SymbolLookup.loaderLookup(); MH_ellipsis = linker.downcallHandle(lookup.lookup("ellipsis").get(), - MethodType.methodType(void.class, int.class, int.class, double.class, long.class), - FunctionDescriptor.ofVoid(C_INT, asVarArg(C_INT), asVarArg(C_DOUBLE), asVarArg(C_LONG_LONG))); + FunctionDescriptor.ofVoid(C_INT).asVariadic(C_INT, C_DOUBLE, C_LONG_LONG)); MH_vaList = linker.downcallHandle(lookup.lookup("vaList").get(), - MethodType.methodType(void.class, int.class, CLinker.VaList.class), - FunctionDescriptor.ofVoid(C_INT, C_VA_LIST)); + FunctionDescriptor.ofVoid(C_INT, C_POINTER)); } @Benchmark @@ -80,12 +73,12 @@ public class VaList { @Benchmark public void vaList() throws Throwable { try (ResourceScope scope = ResourceScope.newConfinedScope()) { - CLinker.VaList vaList = CLinker.VaList.make(b -> - b.vargFromInt(C_INT, 1) - .vargFromDouble(C_DOUBLE, 2D) - .vargFromLong(C_LONG_LONG, 3L), scope); + jdk.incubator.foreign.VaList vaList = jdk.incubator.foreign.VaList.make(b -> + b.addVarg(C_INT, 1) + .addVarg(C_DOUBLE, 2D) + .addVarg(C_LONG_LONG, 3L), scope); MH_vaList.invokeExact(3, - vaList); + (Addressable)vaList); } } } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/VarHandleExact.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/VarHandleExact.java index d560765c48c..0cb783473df 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/VarHandleExact.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/VarHandleExact.java @@ -40,7 +40,7 @@ import java.lang.invoke.VarHandle; import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; -import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT; +import static jdk.incubator.foreign.ValueLayout.JAVA_INT; @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -54,7 +54,7 @@ public class VarHandleExact { static final VarHandle generic; static { - generic = MemoryHandles.varHandle(int.class, ByteOrder.nativeOrder()); + generic = MemoryHandles.varHandle(JAVA_INT); exact = generic.withInvokeExactBehavior(); } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libCallOverhead.c b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libCallOverhead.c index f42aec0172c..8ad44f58cec 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libCallOverhead.c +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libCallOverhead.c @@ -34,18 +34,26 @@ EXPORT int identity(int x) { } typedef struct { - long long x; - long long y; + int x; + int y; } Point; EXPORT Point identity_struct(Point p) { return p; } +EXPORT Point identity_struct_3(Point p1, Point p2, Point p3) { + return p1; +} + EXPORT void* identity_memory_address(void* p) { return p; } +EXPORT void* identity_memory_address_3(void* p1, void* p2, void* p3) { + return p1; +} + EXPORT void args1(long long a0) {} EXPORT void args2(long long a0, double a1) {} EXPORT void args3(long long a0, double a1, long long a2) {} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libJNICB.c b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libJNICB.c new file mode 100644 index 00000000000..617d16d29dd --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libJNICB.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021, 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 + +#include "JNICB.h" +#include "jlong.h" + +#define CHECK_NULL(thing, message) \ + if (thing == NULL) { \ + jclass cls = (*env)->FindClass(env, "java/lang/Exception"); \ + (*env)->ThrowNew(env, cls, message); \ + return 0; \ + } + +JNIEXPORT jlong JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_JNICB_makeCB + (JNIEnv *env, jclass cls, jstring holderName, jstring methodName, jstring descriptor) { + + const char* holderNameC = (*env)->GetStringUTFChars(env, holderName, NULL); + const char* methodNameC = (*env)->GetStringUTFChars(env, methodName, NULL); + const char* descriptorC = (*env)->GetStringUTFChars(env, descriptor, NULL); + + JNICB cb = malloc(sizeof *cb); + CHECK_NULL(cb, "Can not allocate cb"); + + jclass holder = (*env)->FindClass(env, holderNameC); + CHECK_NULL(holder, "Can not find class"); + holder = (jclass) (*env)->NewGlobalRef(env, holder); + cb->holder = holder; + + jmethodID methodID = (*env)->GetStaticMethodID(env, holder, methodNameC, descriptorC); + CHECK_NULL(methodID, "Can not find method"); + //methodID = (jmethodID) (*env)->NewGlobalRef(env, methodID); // DON'T DO THIS! -> Crashes GC + cb->mid = methodID; + + (*env)->ReleaseStringUTFChars(env, holderName, holderNameC); + (*env)->ReleaseStringUTFChars(env, methodName, methodNameC); + (*env)->ReleaseStringUTFChars(env, descriptor, descriptorC); + + return ptr_to_jlong(cb); +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSort.c b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSort.c new file mode 100644 index 00000000000..cafb83d8708 --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSort.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, 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. + */ + +#ifdef _WIN64 +#define EXPORT __declspec(dllexport) +#else +#define EXPORT +#endif + + +EXPORT int compar(const void* e0, const void* e1) { + int i0 = *((int*) e0); + int i1 = *((int*) e1); + return i0 - i1; +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSortJNI.c b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSortJNI.c new file mode 100644 index 00000000000..f6fe1b0c5d1 --- /dev/null +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libQSortJNI.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021, 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 + +#include "jlong.h" +#include "JNICB.h" + +#ifdef _WIN64 +#define THREAD_LOCAL __declspec(thread) +#else +#define THREAD_LOCAL __thread +#endif + +THREAD_LOCAL struct { + JNICB cb; + JNIEnv* env; +} ctx_opt; + +static int comparator(const void* e0, const void* e1) { + JNICB jniCb = ctx_opt.cb; + JNIEnv* env = ctx_opt.env; + jint j0 = *((jint*) e0); + jint j1 = *((jint*) e1); + return (*env)->CallStaticIntMethod(env, jniCb->holder, jniCb->mid, j0, j1); +} + +JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_QSort_jni_1qsort_1optimized + (JNIEnv *env, jclass cls, jintArray arr, jlong cb) { + + ctx_opt.cb = jlong_to_ptr(cb); + ctx_opt.env = env; + + jint* ints = (*env)->GetIntArrayElements(env, arr, NULL); + jsize length = (*env)->GetArrayLength(env, arr); + + qsort(ints, length, sizeof(jint), &comparator); + + (*env)->ReleaseIntArrayElements(env, arr, ints, 0); +} + +JavaVM* VM = NULL; + +int java_cmp(const void *a, const void *b) { + int v1 = *((int*)a); + int v2 = *((int*)b); + + JNIEnv* env; + (*VM)->GetEnv(VM, (void**) &env, JNI_VERSION_10); + + jclass qsortClass = (*env)->FindClass(env, "org/openjdk/bench/jdk/incubator/foreign/QSort"); + jmethodID methodId = (*env)->GetStaticMethodID(env, qsortClass, "jni_upcall_compar", "(II)I"); + + return (*env)->CallStaticIntMethod(env, qsortClass, methodId, v1, v2); +} + +JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_QSort_jni_1qsort_1naive + (JNIEnv *env, jclass cls, jintArray arr) { + if (VM == NULL) { + (*env)->GetJavaVM(env, &VM); + } + + jint* carr = (*env)->GetIntArrayElements(env, arr, 0); + jsize length = (*env)->GetArrayLength(env, arr); + qsort(carr, length, sizeof(jint), java_cmp); + (*env)->ReleaseIntArrayElements(env, arr, carr, 0); +} diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libUpcallsJNI.c b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libUpcallsJNI.c index c44979e3e62..4e892637621 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/libUpcallsJNI.c +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/libUpcallsJNI.c @@ -22,46 +22,9 @@ */ #include #include -#include "jlong.h" - -typedef struct { - jclass holder; - jmethodID mid; -} *JNICB; - -#define CHECK_NULL(thing, message) \ - if (thing == NULL) { \ - jclass cls = (*env)->FindClass(env, "java/lang/Exception"); \ - (*env)->ThrowNew(env, cls, message); \ - return 0; \ - } - -JNIEXPORT jlong JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_Upcalls_makeCB - (JNIEnv *env, jclass cls, jstring holderName, jstring methodName, jstring descriptor) { - - const char* holderNameC = (*env)->GetStringUTFChars(env, holderName, NULL); - const char* methodNameC = (*env)->GetStringUTFChars(env, methodName, NULL); - const char* descriptorC = (*env)->GetStringUTFChars(env, descriptor, NULL); - - JNICB cb = malloc(sizeof *cb); - CHECK_NULL(cb, "Can not allocate cb"); - jclass holder = (*env)->FindClass(env, holderNameC); - CHECK_NULL(holder, "Can not find class"); - holder = (jclass) (*env)->NewGlobalRef(env, holder); - cb->holder = holder; - - jmethodID methodID = (*env)->GetStaticMethodID(env, holder, methodNameC, descriptorC); - CHECK_NULL(methodID, "Can not find method"); - //methodID = (jmethodID) (*env)->NewGlobalRef(env, methodID); // DON'T DO THIS! -> Crashes GC - cb->mid = methodID; - - (*env)->ReleaseStringUTFChars(env, holderName, holderNameC); - (*env)->ReleaseStringUTFChars(env, methodName, methodNameC); - (*env)->ReleaseStringUTFChars(env, descriptor, descriptorC); - - return ptr_to_jlong(cb); -} +#include "jlong.h" +#include "JNICB.h" JNIEXPORT void JNICALL Java_org_openjdk_bench_jdk_incubator_foreign_Upcalls_blank (JNIEnv *env, jclass cls, jlong cb) { diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/points/support/PanamaPoint.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/points/support/PanamaPoint.java index b12d57b20be..87c4855771b 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/points/support/PanamaPoint.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/points/support/PanamaPoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -22,46 +22,45 @@ */ package org.openjdk.bench.jdk.incubator.foreign.points.support; +import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryAddress; +import jdk.incubator.foreign.SymbolLookup; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; -import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.ResourceScope; +import org.openjdk.bench.jdk.incubator.foreign.CLayouts; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; import static java.lang.invoke.MethodType.methodType; import static jdk.incubator.foreign.MemoryLayout.PathElement.groupElement; -import static jdk.incubator.foreign.CLinker.*; -public class PanamaPoint implements AutoCloseable { +public class PanamaPoint extends CLayouts implements AutoCloseable { public static final MemoryLayout LAYOUT = MemoryLayout.structLayout( C_INT.withName("x"), C_INT.withName("y") ); - private static final VarHandle VH_x = LAYOUT.varHandle(int.class, groupElement("x")); - private static final VarHandle VH_y = LAYOUT.varHandle(int.class, groupElement("y")); + private static final VarHandle VH_x = LAYOUT.varHandle(groupElement("x")); + private static final VarHandle VH_y = LAYOUT.varHandle(groupElement("y")); private static final MethodHandle MH_distance; private static final MethodHandle MH_distance_ptrs; static { - CLinker abi = CLinker.getInstance(); + CLinker abi = CLinker.systemCLinker(); System.loadLibrary("Point"); SymbolLookup lookup = SymbolLookup.loaderLookup(); MH_distance = abi.downcallHandle( lookup.lookup("distance").get(), - methodType(double.class, MemorySegment.class, MemorySegment.class), - FunctionDescriptor.of(C_DOUBLE, LAYOUT, LAYOUT) + FunctionDescriptor.of(C_DOUBLE, LAYOUT, LAYOUT) ); MH_distance_ptrs = abi.downcallHandle( - lookup.lookup("distance_ptrs").get(), - methodType(double.class, MemoryAddress.class, MemoryAddress.class), - FunctionDescriptor.of(C_DOUBLE, C_POINTER, C_POINTER) + lookup.lookup("distance_ptrs").get(), + FunctionDescriptor.of(C_DOUBLE, C_POINTER, C_POINTER) ); } @@ -107,7 +106,7 @@ public class PanamaPoint implements AutoCloseable { public double distanceToPtrs(PanamaPoint other) { try { - return (double) MH_distance_ptrs.invokeExact(segment.address(), other.segment.address()); + return (double) MH_distance_ptrs.invokeExact((Addressable)segment, (Addressable)other.segment); } catch (Throwable throwable) { throw new InternalError(throwable); } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreBytes.java b/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreBytes.java index 582a7b4665a..ce0386cb028 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreBytes.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreBytes.java @@ -26,8 +26,6 @@ package org.openjdk.bench.jdk.incubator.vector; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; -import jdk.incubator.foreign.CLinker; -import jdk.incubator.foreign.MemoryAccess; import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -46,6 +44,8 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; +import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE; + @BenchmarkMode(Mode.AverageTime) @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) @@ -116,8 +116,8 @@ public class TestLoadStoreBytes { dstBufferSegmentImplicit = dstSegmentImplicit.asByteBuffer(); - srcAddress = CLinker.allocateMemory(size); - dstAddress = CLinker.allocateMemory(size); + srcAddress = MemorySegment.allocateNative(size, implicitScope).address(); + dstAddress = MemorySegment.allocateNative(size, implicitScope).address(); a = new byte[size]; b = new byte[size]; @@ -232,16 +232,16 @@ public class TestLoadStoreBytes { @CompilerControl(CompilerControl.Mode.PRINT) public void segmentImplicitScalar() { for (int i = 0; i < SPECIES.loopBound(srcArray.length); i++) { - var v = MemoryAccess.getByteAtOffset(srcSegmentImplicit, i); - MemoryAccess.setByteAtOffset(dstSegmentImplicit, i, v); + var v = srcSegmentImplicit.get(JAVA_BYTE, i); + dstSegmentImplicit.set(JAVA_BYTE, i, v); } } @Benchmark public void bufferSegmentConfined() { try (final var scope = ResourceScope.newConfinedScope()) { - final var srcBufferSegmentConfined = srcAddress.asSegment(size, scope).asByteBuffer(); - final var dstBufferSegmentConfined = dstAddress.asSegment(size, scope).asByteBuffer(); + final var srcBufferSegmentConfined = MemorySegment.ofAddress(srcAddress, size, scope).asByteBuffer(); + final var dstBufferSegmentConfined = MemorySegment.ofAddress(dstAddress, size, scope).asByteBuffer(); for (int i = 0; i < SPECIES.loopBound(srcArray.length); i += SPECIES.length()) { var v = ByteVector.fromByteBuffer(SPECIES, srcBufferSegmentConfined, i, ByteOrder.nativeOrder()); diff --git a/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreShort.java b/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreShort.java index 6bd9a85143f..881cfad9aa6 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreShort.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/vector/TestLoadStoreShort.java @@ -26,7 +26,7 @@ package org.openjdk.bench.jdk.incubator.vector; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.concurrent.TimeUnit; -import jdk.incubator.foreign.CLinker; + import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemorySegment; import jdk.incubator.foreign.ResourceScope; @@ -112,15 +112,15 @@ public class TestLoadStoreShort { dstBufferNative = ByteBuffer.allocateDirect(size); - implicitScope = ResourceScope.newImplicitScope(); + implicitScope = ResourceScope.newSharedScope(); srcSegmentImplicit = MemorySegment.allocateNative(size, SPECIES.vectorByteSize(), implicitScope); srcBufferSegmentImplicit = srcSegmentImplicit.asByteBuffer(); dstSegmentImplicit = MemorySegment.allocateNative(size, SPECIES.vectorByteSize(), implicitScope); dstBufferSegmentImplicit = dstSegmentImplicit.asByteBuffer(); - srcAddress = CLinker.allocateMemory(size); - dstAddress = CLinker.allocateMemory(size); + srcAddress = MemorySegment.allocateNative(size, implicitScope).address(); + dstAddress = MemorySegment.allocateNative(size, implicitScope).address(); this.longSize = longSize; @@ -130,12 +130,6 @@ public class TestLoadStoreShort { } - @TearDown - public void tearDown() { - CLinker.freeMemory(srcAddress); - CLinker.freeMemory(dstAddress); - } - @Benchmark @CompilerControl(CompilerControl.Mode.PRINT) public void array() { @@ -216,8 +210,8 @@ public class TestLoadStoreShort { @Benchmark public void bufferSegmentConfined() { try (final var scope = ResourceScope.newConfinedScope()) { - final var srcBufferSegmentConfined = srcAddress.asSegment(size, scope).asByteBuffer(); - final var dstBufferSegmentConfined = dstAddress.asSegment(size, scope).asByteBuffer(); + final var srcBufferSegmentConfined = MemorySegment.ofAddress(srcAddress, size, scope).asByteBuffer(); + final var dstBufferSegmentConfined = MemorySegment.ofAddress(dstAddress, size, scope).asByteBuffer(); for (int i = 0; i < SPECIES.loopBound(srcArray.length); i += SPECIES.length()) { var v = ShortVector.fromByteBuffer(SPECIES, srcBufferSegmentConfined, i, ByteOrder.nativeOrder()); -- GitLab From cf7adae6333c7446048ef0364737927337631f63 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 24 Nov 2021 12:12:23 +0000 Subject: [PATCH 463/890] 8275320: NMT should perform buffer overrun checks 8275320: NMT should perform buffer overrun checks 8275301: Unify C-heap buffer overrun checks into NMT Reviewed-by: simonis, zgu --- src/hotspot/share/runtime/os.cpp | 21 ++- .../share/services/mallocSiteTable.cpp | 2 - .../share/services/mallocSiteTable.hpp | 3 + src/hotspot/share/services/mallocTracker.cpp | 108 ++++++++++- src/hotspot/share/services/mallocTracker.hpp | 134 +++++++++++--- src/hotspot/share/services/memTracker.hpp | 9 +- src/hotspot/share/utilities/debug.cpp | 2 - .../test_nmt_buffer_overflow_detection.cpp | 169 ++++++++++++++++++ test/hotspot/gtest/testutils.cpp | 3 +- test/hotspot/gtest/testutils.hpp | 4 +- test/hotspot/gtest/unittest.hpp | 17 ++ 11 files changed, 423 insertions(+), 49 deletions(-) create mode 100644 test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 52c91be8f25..65695f7d1ce 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -669,13 +669,14 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { // NMT support NMT_TrackingLevel level = MemTracker::tracking_level(); - size_t nmt_header_size = MemTracker::malloc_header_size(level); + const size_t nmt_overhead = + MemTracker::malloc_header_size(level) + MemTracker::malloc_footer_size(level); #ifndef ASSERT - const size_t alloc_size = size + nmt_header_size; + const size_t alloc_size = size + nmt_overhead; #else - const size_t alloc_size = GuardedMemory::get_total_size(size + nmt_header_size); - if (size + nmt_header_size > alloc_size) { // Check for rollover. + const size_t alloc_size = GuardedMemory::get_total_size(size + nmt_overhead); + if (size + nmt_overhead > alloc_size) { // Check for rollover. return NULL; } #endif @@ -693,7 +694,7 @@ void* os::malloc(size_t size, MEMFLAGS memflags, const NativeCallStack& stack) { return NULL; } // Wrap memory with guard - GuardedMemory guarded(ptr, size + nmt_header_size); + GuardedMemory guarded(ptr, size + nmt_overhead); ptr = guarded.get_user_ptr(); if ((intptr_t)ptr == (intptr_t)MallocCatchPtr) { @@ -741,8 +742,9 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa // NMT support NMT_TrackingLevel level = MemTracker::tracking_level(); void* membase = MemTracker::record_free(memblock, level); - size_t nmt_header_size = MemTracker::malloc_header_size(level); - void* ptr = ::realloc(membase, size + nmt_header_size); + const size_t nmt_overhead = + MemTracker::malloc_header_size(level) + MemTracker::malloc_footer_size(level); + void* ptr = ::realloc(membase, size + nmt_overhead); return MemTracker::record_malloc(ptr, size, memflags, stack, level); #else if (memblock == NULL) { @@ -761,7 +763,10 @@ void* os::realloc(void *memblock, size_t size, MEMFLAGS memflags, const NativeCa if (ptr != NULL ) { GuardedMemory guarded(MemTracker::malloc_base(memblock)); // Guard's user data contains NMT header - size_t memblock_size = guarded.get_user_size() - MemTracker::malloc_header_size(memblock); + NMT_TrackingLevel level = MemTracker::tracking_level(); + const size_t nmt_overhead = + MemTracker::malloc_header_size(level) + MemTracker::malloc_footer_size(level); + size_t memblock_size = guarded.get_user_size() - nmt_overhead; memcpy(ptr, memblock, MIN2(size, memblock_size)); if (paranoid) { verify_memory(MemTracker::malloc_base(ptr)); diff --git a/src/hotspot/share/services/mallocSiteTable.cpp b/src/hotspot/share/services/mallocSiteTable.cpp index 869a6738531..dae1357cef1 100644 --- a/src/hotspot/share/services/mallocSiteTable.cpp +++ b/src/hotspot/share/services/mallocSiteTable.cpp @@ -39,7 +39,6 @@ volatile int MallocSiteTable::_access_count = 0; // Tracking hashtable contention NOT_PRODUCT(int MallocSiteTable::_peak_count = 0;) - /* * Initialize malloc site table. * Hashtable entry is malloc'd, so it can cause infinite recursion. @@ -49,7 +48,6 @@ NOT_PRODUCT(int MallocSiteTable::_peak_count = 0;) * time, it is in single-threaded mode from JVM perspective. */ bool MallocSiteTable::initialize() { - assert((size_t)table_size <= MAX_MALLOCSITE_TABLE_SIZE, "Hashtable overflow"); // Fake the call stack for hashtable entry allocation assert(NMT_TrackingStackDepth > 1, "At least one tracking stack"); diff --git a/src/hotspot/share/services/mallocSiteTable.hpp b/src/hotspot/share/services/mallocSiteTable.hpp index f401d456b18..8aa25310326 100644 --- a/src/hotspot/share/services/mallocSiteTable.hpp +++ b/src/hotspot/share/services/mallocSiteTable.hpp @@ -114,6 +114,9 @@ class MallocSiteTable : AllStatic { table_size = (table_base_size * NMT_TrackingStackDepth - 1) }; + // The table must not be wider than the maximum value the bucket_idx field + // in the malloc header can hold. + STATIC_ASSERT(table_size <= MAX_MALLOCSITE_TABLE_SIZE); // This is a very special lock, that allows multiple shared accesses (sharedLock), but // once exclusive access (exclusiveLock) is requested, all shared accesses are diff --git a/src/hotspot/share/services/mallocTracker.cpp b/src/hotspot/share/services/mallocTracker.cpp index e67f2d8a2a9..be1d6eea330 100644 --- a/src/hotspot/share/services/mallocTracker.cpp +++ b/src/hotspot/share/services/mallocTracker.cpp @@ -23,10 +23,13 @@ */ #include "precompiled.hpp" +#include "runtime/os.hpp" #include "services/mallocSiteTable.hpp" #include "services/mallocTracker.hpp" #include "services/mallocTracker.inline.hpp" #include "services/memTracker.hpp" +#include "utilities/debug.hpp" +#include "utilities/ostream.hpp" size_t MallocMemorySummary::_snapshot[CALC_OBJ_SIZE_IN_TYPE(MallocMemorySnapshot, size_t)]; @@ -103,15 +106,118 @@ void MallocMemorySummary::initialize() { ::new ((void*)_snapshot)MallocMemorySnapshot(); } -void MallocHeader::release() const { +void MallocHeader::mark_block_as_dead() { + _canary = _header_canary_dead_mark; + NOT_LP64(_alt_canary = _header_alt_canary_dead_mark); + set_footer(_footer_canary_dead_mark); +} + +void MallocHeader::release() { // Tracking already shutdown, no housekeeping is needed anymore if (MemTracker::tracking_level() <= NMT_minimal) return; + check_block_integrity(); + MallocMemorySummary::record_free(size(), flags()); MallocMemorySummary::record_free_malloc_header(sizeof(MallocHeader)); if (MemTracker::tracking_level() == NMT_detail) { MallocSiteTable::deallocation_at(size(), _bucket_idx, _pos_idx); } + + mark_block_as_dead(); +} + +void MallocHeader::print_block_on_error(outputStream* st, address bad_address) const { + assert(bad_address >= (address)this, "sanity"); + + // This function prints block information, including hex dump, in case of a detected + // corruption. The hex dump should show both block header and corruption site + // (which may or may not be close together or identical). Plus some surrounding area. + // + // Note that we use os::print_hex_dump(), which is able to cope with unmapped + // memory (it uses SafeFetch). + + st->print_cr("NMT Block at " PTR_FORMAT ", corruption at: " PTR_FORMAT ": ", + p2i(this), p2i(bad_address)); + static const size_t min_dump_length = 256; + address from1 = align_down((address)this, sizeof(void*)) - (min_dump_length / 2); + address to1 = from1 + min_dump_length; + address from2 = align_down(bad_address, sizeof(void*)) - (min_dump_length / 2); + address to2 = from2 + min_dump_length; + if (from2 > to1) { + // Dump gets too large, split up in two sections. + os::print_hex_dump(st, from1, to1, 1); + st->print_cr("..."); + os::print_hex_dump(st, from2, to2, 1); + } else { + // print one hex dump + os::print_hex_dump(st, from1, to2, 1); + } +} + +// Check block integrity. If block is broken, print out a report +// to tty (optionally with hex dump surrounding the broken block), +// then trigger a fatal error. +void MallocHeader::check_block_integrity() const { + +#define PREFIX "NMT corruption: " + // Note: if you modify the error messages here, make sure you + // adapt the associated gtests too. + + // Weed out obviously wrong block addresses of NULL or very low + // values. Note that we should not call this for ::free(NULL), + // which should be handled by os::free() above us. + if (((size_t)p2i(this)) < K) { + fatal(PREFIX "Block at " PTR_FORMAT ": invalid block address", p2i(this)); + } + + // From here on we assume the block pointer to be valid. We could + // use SafeFetch but since this is a hot path we don't. If we are + // wrong, we will crash when accessing the canary, which hopefully + // generates distinct crash report. + + // Weed out obviously unaligned addresses. NMT blocks, being the result of + // malloc calls, should adhere to malloc() alignment. Malloc alignment is + // specified by the standard by this requirement: + // "malloc returns a pointer which is suitably aligned for any built-in type" + // For us it means that it is *at least* 64-bit on all of our 32-bit and + // 64-bit platforms since we have native 64-bit types. It very probably is + // larger than that, since there exist scalar types larger than 64bit. Here, + // we test the smallest alignment we know. + // Should we ever start using std::max_align_t, this would be one place to + // fix up. + if (!is_aligned(this, sizeof(uint64_t))) { + print_block_on_error(tty, (address)this); + fatal(PREFIX "Block at " PTR_FORMAT ": block address is unaligned", p2i(this)); + } + + // Check header canary + if (_canary != _header_canary_life_mark) { + print_block_on_error(tty, (address)this); + fatal(PREFIX "Block at " PTR_FORMAT ": header canary broken.", p2i(this)); + } + +#ifndef _LP64 + // On 32-bit we have a second canary, check that one too. + if (_alt_canary != _header_alt_canary_life_mark) { + print_block_on_error(tty, (address)this); + fatal(PREFIX "Block at " PTR_FORMAT ": header alternate canary broken.", p2i(this)); + } +#endif + + // Does block size seems reasonable? + if (_size >= max_reasonable_malloc_size) { + print_block_on_error(tty, (address)this); + fatal(PREFIX "Block at " PTR_FORMAT ": header looks invalid (weirdly large block size)", p2i(this)); + } + + // Check footer canary + if (get_footer() != _footer_canary_life_mark) { + print_block_on_error(tty, footer_address()); + fatal(PREFIX "Block at " PTR_FORMAT ": footer canary broken at " PTR_FORMAT " (buffer overflow?)", + p2i(this), p2i(footer_address())); + } +#undef PREFIX } bool MallocHeader::record_malloc_site(const NativeCallStack& stack, size_t size, diff --git a/src/hotspot/share/services/mallocTracker.hpp b/src/hotspot/share/services/mallocTracker.hpp index 74fbba3a51c..9fd3968831b 100644 --- a/src/hotspot/share/services/mallocTracker.hpp +++ b/src/hotspot/share/services/mallocTracker.hpp @@ -239,31 +239,99 @@ class MallocMemorySummary : AllStatic { /* * Malloc tracking header. - * To satisfy malloc alignment requirement, NMT uses 2 machine words for tracking purpose, - * which ensures 8-bytes alignment on 32-bit systems and 16-bytes on 64-bit systems (Product build). + * + * If NMT is active (state >= minimal), we need to track allocations. A simple and cheap way to + * do this is by using malloc headers. + * + * The user allocation is preceded by a header and is immediately followed by a (possibly unaligned) + * footer canary: + * + * +--------------+------------- .... ------------------+-----+ + * | header | user | can | + * | | allocation | ary | + * +--------------+------------- .... ------------------+-----+ + * 16 bytes user size 2 byte + * + * Alignment: + * + * The start of the user allocation needs to adhere to malloc alignment. We assume 128 bits + * on both 64-bit/32-bit to be enough for that. So the malloc header is 16 bytes long on both + * 32-bit and 64-bit. + * + * Layout on 64-bit: + * + * 0 1 2 3 4 5 6 7 + * +--------+--------+--------+--------+--------+--------+--------+--------+ + * | 64-bit size | ... + * +--------+--------+--------+--------+--------+--------+--------+--------+ + * + * 8 9 10 11 12 13 14 15 16 ++ + * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ + * ... | bucket idx | pos idx | flags | unused | canary | ... User payload .... + * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ + * + * Layout on 32-bit: + * + * 0 1 2 3 4 5 6 7 + * +--------+--------+--------+--------+--------+--------+--------+--------+ + * | alt. canary | 32-bit size | ... + * +--------+--------+--------+--------+--------+--------+--------+--------+ + * + * 8 9 10 11 12 13 14 15 16 ++ + * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ + * ... | bucket idx | pos idx | flags | unused | canary | ... User payload .... + * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ + * + * Notes: + * - We have a canary in the two bytes directly preceding the user payload. That allows us to + * catch negative buffer overflows. + * - On 32-bit, due to the smaller size_t, we have some bits to spare. So we also have a second + * canary at the very start of the malloc header (generously sized 32 bits). + * - The footer canary consists of two bytes. Since the footer location may be unaligned to 16 bits, + * the bytes are stored individually. */ class MallocHeader { -#ifdef _LP64 - size_t _size : 64; - size_t _flags : 8; - size_t _pos_idx : 16; - size_t _bucket_idx: 40; -#define MAX_MALLOCSITE_TABLE_SIZE right_n_bits(40) -#define MAX_BUCKET_LENGTH right_n_bits(16) -#else - size_t _size : 32; - size_t _flags : 8; - size_t _pos_idx : 8; - size_t _bucket_idx: 16; -#define MAX_MALLOCSITE_TABLE_SIZE right_n_bits(16) -#define MAX_BUCKET_LENGTH right_n_bits(8) -#endif // _LP64 + + NOT_LP64(uint32_t _alt_canary); + size_t _size; + uint16_t _bucket_idx; + uint16_t _pos_idx; + uint8_t _flags; + uint8_t _unused; + uint16_t _canary; + +#define MAX_MALLOCSITE_TABLE_SIZE (USHRT_MAX - 1) +#define MAX_BUCKET_LENGTH (USHRT_MAX - 1) + + static const uint16_t _header_canary_life_mark = 0xE99E; + static const uint16_t _header_canary_dead_mark = 0xD99D; + static const uint16_t _footer_canary_life_mark = 0xE88E; + static const uint16_t _footer_canary_dead_mark = 0xD88D; + NOT_LP64(static const uint32_t _header_alt_canary_life_mark = 0xE99EE99E;) + NOT_LP64(static const uint32_t _header_alt_canary_dead_mark = 0xD88DD88D;) + + // We discount sizes larger than these + static const size_t max_reasonable_malloc_size = LP64_ONLY(256 * G) NOT_LP64(3500 * M); + + // Check block integrity. If block is broken, print out a report + // to tty (optionally with hex dump surrounding the broken block), + // then trigger a fatal error. + void check_block_integrity() const; + void print_block_on_error(outputStream* st, address bad_address) const; + void mark_block_as_dead(); + + static uint16_t build_footer(uint8_t b1, uint8_t b2) { return ((uint16_t)b1 << 8) | (uint16_t)b2; } + + uint8_t* footer_address() const { return ((address)this) + sizeof(MallocHeader) + _size; } + uint16_t get_footer() const { return build_footer(footer_address()[0], footer_address()[1]); } + void set_footer(uint16_t v) { footer_address()[0] = v >> 8; footer_address()[1] = (uint8_t)v; } public: + MallocHeader(size_t size, MEMFLAGS flags, const NativeCallStack& stack, NMT_TrackingLevel level) { - assert(sizeof(MallocHeader) == sizeof(void*) * 2, - "Wrong header size"); + + assert(size < max_reasonable_malloc_size, "Too large allocation size?"); if (level == NMT_minimal) { return; @@ -277,11 +345,18 @@ class MallocHeader { if (record_malloc_site(stack, size, &bucket_idx, &pos_idx, flags)) { assert(bucket_idx <= MAX_MALLOCSITE_TABLE_SIZE, "Overflow bucket index"); assert(pos_idx <= MAX_BUCKET_LENGTH, "Overflow bucket position index"); - _bucket_idx = bucket_idx; - _pos_idx = pos_idx; + _bucket_idx = (uint16_t)bucket_idx; + _pos_idx = (uint16_t)pos_idx; } } + _unused = 0; + _canary = _header_canary_life_mark; + // On 32-bit we have some bits more, use them for a second canary + // guarding the start of the header. + NOT_LP64(_alt_canary = _header_alt_canary_life_mark;) + set_footer(_footer_canary_life_mark); // set after initializing _size + MallocMemorySummary::record_malloc(size, flags); MallocMemorySummary::record_new_malloc_header(sizeof(MallocHeader)); } @@ -290,8 +365,8 @@ class MallocHeader { inline MEMFLAGS flags() const { return (MEMFLAGS)_flags; } bool get_stack(NativeCallStack& stack) const; - // Cleanup tracking information before the memory is released. - void release() const; + // Cleanup tracking information and mark block as dead before the memory is released. + void release(); private: inline void set_size(size_t size) { @@ -301,6 +376,9 @@ class MallocHeader { size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const; }; +// This needs to be true on both 64-bit and 32-bit platforms +STATIC_ASSERT(sizeof(MallocHeader) == (sizeof(uint64_t) * 2)); + // Main class called from MemTracker to track malloc activities class MallocTracker : AllStatic { @@ -315,6 +393,11 @@ class MallocTracker : AllStatic { return (level == NMT_off) ? 0 : sizeof(MallocHeader); } + // malloc tracking footer size for specific tracking level + static inline size_t malloc_footer_size(NMT_TrackingLevel level) { + return (level == NMT_off) ? 0 : sizeof(uint16_t); + } + // Parameter name convention: // memblock : the beginning address for user data // malloc_base: the beginning address that includes malloc tracking header @@ -349,11 +432,6 @@ class MallocTracker : AllStatic { return header->flags(); } - // Get header size - static inline size_t get_header_size(void* memblock) { - return (memblock == NULL) ? 0 : sizeof(MallocHeader); - } - static inline void record_new_arena(MEMFLAGS flags) { MallocMemorySummary::record_new_arena(flags); } diff --git a/src/hotspot/share/services/memTracker.hpp b/src/hotspot/share/services/memTracker.hpp index d18746f452e..21d1aa82630 100644 --- a/src/hotspot/share/services/memTracker.hpp +++ b/src/hotspot/share/services/memTracker.hpp @@ -58,6 +58,7 @@ class MemTracker : AllStatic { const NativeCallStack& stack, NMT_TrackingLevel level) { return mem_base; } static inline size_t malloc_header_size(NMT_TrackingLevel level) { return 0; } static inline size_t malloc_header_size(void* memblock) { return 0; } + static inline size_t malloc_footer_size(NMT_TrackingLevel level) { return 0; } static inline void* malloc_base(void* memblock) { return memblock; } static inline void* record_free(void* memblock, NMT_TrackingLevel level) { return memblock; } @@ -157,11 +158,9 @@ class MemTracker : AllStatic { return MallocTracker::malloc_header_size(level); } - static size_t malloc_header_size(void* memblock) { - if (tracking_level() != NMT_off) { - return MallocTracker::get_header_size(memblock); - } - return 0; + // malloc tracking footer size for specific tracking level + static inline size_t malloc_footer_size(NMT_TrackingLevel level) { + return MallocTracker::malloc_footer_size(level); } // To malloc base address, which is the starting address diff --git a/src/hotspot/share/utilities/debug.cpp b/src/hotspot/share/utilities/debug.cpp index 778d1a1b4a4..1a0c3a84647 100644 --- a/src/hotspot/share/utilities/debug.cpp +++ b/src/hotspot/share/utilities/debug.cpp @@ -237,7 +237,6 @@ void report_vm_error(const char* file, int line, const char* error_msg) static void print_error_for_unit_test(const char* message, const char* detail_fmt, va_list detail_args) { -#ifdef ASSERT if (ExecutingUnitTests) { char detail_msg[256]; if (detail_fmt != NULL) { @@ -262,7 +261,6 @@ static void print_error_for_unit_test(const char* message, const char* detail_fm va_end(detail_args_copy); } } -#endif // ASSERT } void report_vm_error(const char* file, int line, const char* error_msg, const char* detail_fmt, ...) diff --git a/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp b/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp new file mode 100644 index 00000000000..c1aeb3e845c --- /dev/null +++ b/test/hotspot/gtest/nmt/test_nmt_buffer_overflow_detection.cpp @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2021 SAP SE. All rights reserved. + * Copyright (c) 2021, 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 "memory/allocation.hpp" +#include "runtime/os.hpp" +#include "services/memTracker.hpp" +#include "utilities/debug.hpp" +#include "utilities/ostream.hpp" +#include "unittest.hpp" +#include "testutils.hpp" + +#if INCLUDE_NMT + +// This prefix shows up on any c heap corruption NMT detects. If unsure which assert will +// come, just use this one. +#define COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX "NMT corruption" + + + +#define DEFINE_TEST(test_function, expected_assertion_message) \ + TEST_VM_FATAL_ERROR_MSG(NMT, test_function, ".*" expected_assertion_message ".*") { \ + if (MemTracker::tracking_level() > NMT_off) { \ + tty->print_cr("NMT overwrite death test, please ignore subsequent error dump."); \ + test_function (); \ + } else { \ + /* overflow detection requires NMT to be on. If off, fake assert. */ \ + guarantee(false, \ + "fake message ignore this - " expected_assertion_message); \ + } \ + } + +/////// + +static void test_overwrite_front() { + address p = (address) os::malloc(1, mtTest); + *(p - 1) = 'a'; + os::free(p); +} + +DEFINE_TEST(test_overwrite_front, "header canary broken") + +/////// + +static void test_overwrite_back() { + address p = (address) os::malloc(1, mtTest); + *(p + 1) = 'a'; + os::free(p); +} + +DEFINE_TEST(test_overwrite_back, "footer canary broken") + +/////// + +// A overwrite farther away from the NMT header; the report should show the hex dump split up +// in two parts, containing both header and corruption site. +static void test_overwrite_back_long(size_t distance) { + address p = (address) os::malloc(distance, mtTest); + *(p + distance) = 'a'; + os::free(p); +} +static void test_overwrite_back_long_aligned_distance() { test_overwrite_back_long(0x2000); } +DEFINE_TEST(test_overwrite_back_long_aligned_distance, "footer canary broken") +static void test_overwrite_back_long_unaligned_distance() { test_overwrite_back_long(0x2001); } +DEFINE_TEST(test_overwrite_back_long_unaligned_distance, "footer canary broken") + +/////// + +static void test_double_free() { + address p = (address) os::malloc(1, mtTest); + os::free(p); + // Now a double free. Note that this is susceptible to concurrency issues should + // a concurrent thread have done a malloc and gotten the same address after the + // first free. To decrease chance of this happening, we repeat the double free + // several times. + for (int i = 0; i < 100; i ++) { + os::free(p); + } +} + +// What assertion message we will see depends on whether the VM wipes the memory-to-be-freed +// on the first free(), and whether the libc uses the freed memory to store bookkeeping information. +// If the death marker in the header is still intact after the first free, we will recognize this as +// double free; if it got wiped, we should at least see a broken header canary. +// The message would be either +// - "header canary broken" or +// - "header canary dead (double free?)". +// However, since gtest regex expressions do not support unions (a|b), I search for a reasonable +// subset here. +DEFINE_TEST(test_double_free, "header canary") + +/////// + +static void test_invalid_block_address() { + // very low, like the result of an overflow or of accessing a NULL this pointer + os::free((void*)0x100); +} +DEFINE_TEST(test_invalid_block_address, "invalid block address") + +/////// + +static void test_unaliged_block_address() { + address p = (address) os::malloc(1, mtTest); + os::free(p + 6); +} +DEFINE_TEST(test_unaliged_block_address, "block address is unaligned"); + +/////// + +// Test that we notice block corruption on realloc too +static void test_corruption_on_realloc(size_t s1, size_t s2) { + address p1 = (address) os::malloc(s1, mtTest); + *(p1 + s1) = 'a'; + address p2 = (address) os::realloc(p1, s2, mtTest); + + // Still here? + tty->print_cr("NMT did not detect corruption on os::realloc?"); + // Note: don't use ASSERT here, that does not work as expected in death tests. Just + // let the test run its course, it should notice something is amiss. +} +static void test_corruption_on_realloc_growing() { test_corruption_on_realloc(0x10, 0x11); } +DEFINE_TEST(test_corruption_on_realloc_growing, COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX); +static void test_corruption_on_realloc_shrinking() { test_corruption_on_realloc(0x11, 0x10); } +DEFINE_TEST(test_corruption_on_realloc_shrinking, COMMON_NMT_HEAP_CORRUPTION_MESSAGE_PREFIX); + +/////// + +// realloc is the trickiest of the bunch. Test that realloc works and correctly takes over +// NMT header and footer to the resized block. We just test that nothing crashes - if the +// header/footer get corrupted, NMT heap corruption checker will trigger alert on os::free()). +TEST_VM(NMT, test_realloc) { + // We test both directions (growing and shrinking) and a small range for each to cover all + // size alignment variants. Should not matter, but this should be cheap. + for (size_t s1 = 0xF0; s1 < 0x110; s1 ++) { + for (size_t s2 = 0x100; s2 > 0xF0; s2 --) { + address p1 = (address) os::malloc(s1, mtTest); + ASSERT_NOT_NULL(p1); + GtestUtils::mark_range(p1, s1); // mark payload range... + address p2 = (address) os::realloc(p1, s2, mtTest); + ASSERT_NOT_NULL(p2); + ASSERT_RANGE_IS_MARKED(p2, MIN2(s1, s2)) // ... and check that it survived the resize + << s1 << "->" << s2 << std::endl; + os::free(p2); // <- if NMT headers/footers got corrupted this asserts + } + } +} + +#endif // INCLUDE_NMT diff --git a/test/hotspot/gtest/testutils.cpp b/test/hotspot/gtest/testutils.cpp index 47351f056af..eb2898a526d 100644 --- a/test/hotspot/gtest/testutils.cpp +++ b/test/hotspot/gtest/testutils.cpp @@ -57,7 +57,8 @@ bool GtestUtils::check_range(const void* p, size_t s, uint8_t expected) { } if (first_wrong != NULL) { - tty->print_cr("wrong pattern around " PTR_FORMAT, p2i(first_wrong)); + tty->print_cr("check_range [" PTR_FORMAT ".." PTR_FORMAT "), 0x%X, : wrong pattern around " PTR_FORMAT, + p2i(p), p2i(p) + s, expected, p2i(first_wrong)); // Note: We deliberately print the surroundings too without bounds check. Might be interesting, // and os::print_hex_dump uses SafeFetch, so this is fine without bounds checks. os::print_hex_dump(tty, (address)(align_down(p2, 0x10) - 0x10), diff --git a/test/hotspot/gtest/testutils.hpp b/test/hotspot/gtest/testutils.hpp index 8ed72f4644f..9852e87cada 100644 --- a/test/hotspot/gtest/testutils.hpp +++ b/test/hotspot/gtest/testutils.hpp @@ -51,8 +51,8 @@ public: #define ASSERT_RANGE_IS_MARKED(p, size) ASSERT_TRUE(GtestUtils::check_range(p, size)) // Convenience asserts -#define ASSERT_NOT_NULL(p) ASSERT_NE(p, (char*)NULL) -#define ASSERT_NULL(p) ASSERT_EQ(p, (char*)NULL) +#define ASSERT_NOT_NULL(p) ASSERT_NE(p2i(p), 0) +#define ASSERT_NULL(p) ASSERT_EQ(p2i(p), 0) #define ASSERT_ALIGN(p, n) ASSERT_TRUE(is_aligned(p, n)) diff --git a/test/hotspot/gtest/unittest.hpp b/test/hotspot/gtest/unittest.hpp index b414b2fbdd9..fefcc8efc39 100644 --- a/test/hotspot/gtest/unittest.hpp +++ b/test/hotspot/gtest/unittest.hpp @@ -149,4 +149,21 @@ TEST_VM_ASSERT_MSG is only available in debug builds #endif +#define TEST_VM_FATAL_ERROR_MSG(category, name, msg) \ + static void test_ ## category ## _ ## name ## _(); \ + \ + static void child_ ## category ## _ ## name ## _() { \ + ::testing::GTEST_FLAG(throw_on_failure) = true; \ + test_ ## category ## _ ## name ## _(); \ + exit(0); \ + } \ + \ + TEST(category, CONCAT(name, _vm_assert)) { \ + ASSERT_EXIT(child_ ## category ## _ ## name ## _(), \ + ::testing::ExitedWithCode(1), \ + msg); \ + } \ + \ + void test_ ## category ## _ ## name ## _() + #endif // UNITTEST_HPP -- GitLab From 0384739afc2d470ab6a3525e9d85aca0af58f2ed Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Wed, 24 Nov 2021 15:14:22 +0000 Subject: [PATCH 464/890] 8276665: ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException Reviewed-by: naoto, lancea, smarks --- .../classes/java/io/ObjectInputStream.java | 24 ++- .../Serializable/GetField/ReadFieldsCNF.java | 190 ++++++++++++++++++ 2 files changed, 210 insertions(+), 4 deletions(-) create mode 100644 test/jdk/java/io/Serializable/GetField/ReadFieldsCNF.java diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java index d58bf1d91c9..d91939684eb 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -297,6 +297,15 @@ public class ObjectInputStream static final boolean SET_FILTER_AFTER_READ = GetBooleanAction .privilegedGetProperty("jdk.serialSetFilterAfterRead"); + /** + * Property to control {@link GetField#get(String, Object)} conversion of + * {@link ClassNotFoundException} to {@code null}. If set to {@code true} + * {@link GetField#get(String, Object)} returns null otherwise + * throwing {@link ClassNotFoundException}. + */ + private static final boolean GETFIELD_CNFE_RETURNS_NULL = GetBooleanAction + .privilegedGetProperty("jdk.serialGetFieldCnfeReturnsNull"); + /** * Property to override the implementation limit on the number * of interfaces allowed for Proxies. The property value is clamped to 0..65535. @@ -1596,12 +1605,13 @@ public class ObjectInputStream * @param val the default value to use if {@code name} does not * have a value * @return the value of the named {@code Object} field + * @throws ClassNotFoundException Class of a serialized object cannot be found. * @throws IOException if there are I/O errors while reading from the * underlying {@code InputStream} * @throws IllegalArgumentException if type of {@code name} is * not serializable or if the field type is incorrect */ - public abstract Object get(String name, Object val) throws IOException; + public abstract Object get(String name, Object val) throws IOException, ClassNotFoundException; } /** @@ -2645,13 +2655,19 @@ public class ObjectInputStream return (off >= 0) ? Bits.getDouble(primValues, off) : val; } - public Object get(String name, Object val) { + public Object get(String name, Object val) throws ClassNotFoundException { int off = getFieldOffset(name, Object.class); if (off >= 0) { int objHandle = objHandles[off]; handles.markDependency(passHandle, objHandle); - return (handles.lookupException(objHandle) == null) ? - objValues[off] : null; + ClassNotFoundException ex = handles.lookupException(objHandle); + if (ex == null) + return objValues[off]; + if (Caches.GETFIELD_CNFE_RETURNS_NULL) { + // Revert to the prior behavior; return null instead of CNFE + return null; + } + throw ex; } else { return val; } diff --git a/test/jdk/java/io/Serializable/GetField/ReadFieldsCNF.java b/test/jdk/java/io/Serializable/GetField/ReadFieldsCNF.java new file mode 100644 index 00000000000..7b91222d737 --- /dev/null +++ b/test/jdk/java/io/Serializable/GetField/ReadFieldsCNF.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2021, 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 8273660 + * @summary Verify that ObjectInputStream ReadFields correctly reports ClassNotFoundException + * while getting the field value. The test uses Vector that calls ReadFields from its readObject. + * @library /test/lib + * @run testng ReadFieldsCNF + * @run testng/othervm -Djdk.serialGetFieldCnfeReturnsNull=true ReadFieldsCNF + */ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.io.StreamCorruptedException; +import java.nio.charset.StandardCharsets; +import java.util.Vector; + +import org.testng.annotations.Test; +import org.testng.Assert; + +import jdk.test.lib.hexdump.HexPrinter; +import jdk.test.lib.hexdump.ObjectStreamPrinter; + +public class ReadFieldsCNF { + + private static final boolean GETFIELD_CNFE_RETURNS_NULL = + Boolean.getBoolean("jdk.serialGetFieldCnfeReturnsNull"); + + + /** + * Test a Vector holding a reference to a class instance that will not be found. + * @throws IOException If any other exception occurs + */ + @Test + private static void testVectorWithRole() throws IOException { + System.out.println("Property GETFIELD_CNFE_RETURNS_NULL: " + GETFIELD_CNFE_RETURNS_NULL); + + Role role = new Role(); + Vector vector = new Vector<>(); + vector.add(role); + + // Modify the byte stream to change the classname to be deserialized to + // XeadFieldsCNF$Role. + byte[] bytes = writeObject(vector); + + // Locate the name of the class to be deserialize + String s = new String(bytes, StandardCharsets.ISO_8859_1); // Map bytes to chars + int off = s.indexOf(Role.class.getName()); + System.out.printf("Role offset: %d (0x%x) : %s%n", off, off, Role.class.getName()); + if (off < 0) { + HexPrinter.simple().formatter(ObjectStreamPrinter.formatter()).format(bytes); + Assert.fail("classname not found"); + } + + bytes[off] = (byte) 'X'; // replace R with X -> Class not found + + // Deserialize the Vector expecting a ClassNotFoundException + ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); + try { + Object obj = in.readObject(); + System.out.println("Read: " + obj); + Assert.fail("Should not reach here, an exception should always occur"); + } catch (ClassNotFoundException cnfe) { + // Expected ClassNotFoundException + String expected = "XeadFieldsCNF$Role"; + Assert.assertEquals(expected, cnfe.getMessage(), "Wrong classname"); + if (GETFIELD_CNFE_RETURNS_NULL) { + Assert.fail("Expected IOException got ClassNotFoundException", cnfe); + } + System.out.println("Normal: OIS.readObject: " + cnfe); + } catch (StreamCorruptedException ioe) { + if (!GETFIELD_CNFE_RETURNS_NULL) { + Assert.fail("Expected ClassNotFoundException got StreamCorruptedException ", ioe); + } + System.out.println("Normal: " + ioe); + } + // Other exceptions cause the test to fail + } + + /** + * For an object holding a reference to a class that will not be found. + * @throws IOException If any other exception occurs + */ + @Test + private static void testHolderWithRole() throws IOException { + System.out.println("Property GETFIELD_CNFE_RETURNS_NULL: " + GETFIELD_CNFE_RETURNS_NULL); + Role role = new Role(); + Holder holder = new Holder(role); + + // Modify the byte stream to change the classname to be deserialized to + // XeadFieldsCNF$Role. + byte[] bytes = writeObject(holder); + + String s = new String(bytes, StandardCharsets.ISO_8859_1); // Map bytes to chars + int off = s.indexOf(Role.class.getName(), 0); + off = s.indexOf(Role.class.getName(), off + 1); // 2nd occurrence of classname + System.out.printf("Role offset: %d (0x%x)%n", off, off); + if (off < 0) { + HexPrinter.simple().formatter(ObjectStreamPrinter.formatter()).format(bytes); + Assert.fail("classname found at index: " + off + " (0x" + Integer.toHexString(off) + ")"); + } + + bytes[off] = (byte) 'X'; // replace R with X -> Class not found + + // Deserialize the Vector expecting a ClassNotFoundException + ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); + try { + Holder obj = (Holder)in.readObject(); + System.out.println("Read: " + obj); + Assert.fail("Should not reach here, an exception should always occur"); + } catch (ClassNotFoundException cnfe) { + // Expected ClassNotFoundException + String expected = "XeadFieldsCNF$Role"; + Assert.assertEquals(expected, cnfe.getMessage(), "Wrong classname"); + System.out.println("Normal: OIS.readObject: " + cnfe); + } catch (StreamCorruptedException ioe) { + if (!GETFIELD_CNFE_RETURNS_NULL) { + Assert.fail("Expected ClassNotFoundException got StreamCorruptedException ", ioe); + } + System.out.println("Normal: " + ioe); + } + // Other exceptions cause the test to fail + } + + private static byte[] writeObject(Object o) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ObjectOutputStream os = new ObjectOutputStream(baos)) { + os.writeObject(o); + } + return baos.toByteArray(); + } + + static class Role implements Serializable { + private static final long serialVersionUID = 0L; + + Role() {} + } + + static class Holder implements Serializable { + private static final long serialVersionUID = 1L; + + Role role; + + Holder(Role role) { + this.role = role; + } + + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField fields = ois.readFields(); + try { + Object repl = new Object(); + role = (Role)fields.get("role", repl); + System.out.println("Holder.readObject Role: " + role); + } catch (Exception ex) { + // Catch CNFE and ignore it; check elsewhere that CNFE is thrown from OIS.readObject + System.out.println("Normal: exception in Holder.readObject, ignoring: " + ex); + } + } + + public String toString() { + return "role: " + role; + } + } +} -- GitLab From 663e33de13788586fa49bd9816bd148e58ad1031 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Wed, 24 Nov 2021 16:50:25 +0000 Subject: [PATCH 465/890] 8272728: javac ignores any -J option in @argfiles silently Reviewed-by: jjg --- .../com/sun/tools/javac/main/Option.java | 5 +++++ .../tools/javac/options/modes/AtFilesTest.java | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java index 033539c2c16..d5f1efa566b 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java @@ -510,6 +510,11 @@ public enum Option { public void process(OptionHelper helper, String option) { throw new AssertionError("the -J flag should be caught by the launcher."); } + + @Override + public void process(OptionHelper helper, String option, String arg) throws InvalidValueException { + throw helper.newInvalidValueException(Errors.InvalidFlag(option + arg)); + } }, MOREINFO("-moreinfo", null, HIDDEN, BASIC) { diff --git a/test/langtools/tools/javac/options/modes/AtFilesTest.java b/test/langtools/tools/javac/options/modes/AtFilesTest.java index 761e20b5302..5cf5c2acbaf 100644 --- a/test/langtools/tools/javac/options/modes/AtFilesTest.java +++ b/test/langtools/tools/javac/options/modes/AtFilesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8044859 + * @bug 8044859 8272728 * @summary test support for at-files * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.file @@ -33,6 +33,7 @@ * @run main AtFilesTest */ +import com.sun.tools.javac.main.Main; import java.io.IOException; public class AtFilesTest extends OptionModesTester { @@ -60,4 +61,16 @@ public class AtFilesTest extends OptionModesTester { runParse(opts, files) .checkIllegalArgumentException(); } + + @Test + void testAtFilesMustNotContainOptionJ() throws IOException { + writeFile("args", "-J-verbose"); + + String[] opts = { "@args", "-version" }; + String[] files = { }; + + runMain(opts, files) + .checkResult(Main.Result.CMDERR.exitCode) + .checkLog(Log.DIRECT, "-J-verbose"); + } } -- GitLab From 951247c8cb4ea898bf7c188bed8e143ca7417c83 Mon Sep 17 00:00:00 2001 From: Adam Sotona Date: Wed, 24 Nov 2021 17:03:53 +0000 Subject: [PATCH 466/890] 8235876: Misleading warning message in java source-file mode Reviewed-by: vromero --- .../com/sun/tools/javac/launcher/Main.java | 1 + .../tools/javac/launcher/SourceLauncherTest.java | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java index 428b3a4a51e..76de3372d03 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/launcher/Main.java @@ -354,6 +354,7 @@ public class Main { javacOpts.add("-Xdiags:verbose"); javacOpts.add("-Xlint:deprecation"); javacOpts.add("-Xlint:unchecked"); + javacOpts.add("-Xlint:-options"); return javacOpts; } diff --git a/test/langtools/tools/javac/launcher/SourceLauncherTest.java b/test/langtools/tools/javac/launcher/SourceLauncherTest.java index 7507a6d9c27..1b8fc23e679 100644 --- a/test/langtools/tools/javac/launcher/SourceLauncherTest.java +++ b/test/langtools/tools/javac/launcher/SourceLauncherTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8192920 8204588 8246774 8248843 8268869 + * @bug 8192920 8204588 8246774 8248843 8268869 8235876 * @summary Test source launcher * @library /tools/lib * @modules jdk.compiler/com.sun.tools.javac.api @@ -630,6 +630,20 @@ public class SourceLauncherTest extends TestRunner { } } + @Test + public void testNoOptionsWarnings(Path base) throws IOException { + tb.writeJavaFiles(base, "public class Main { public static void main(String... args) {}}"); + String log = new JavaTask(tb) + .vmOptions("--source", "7") + .className(base.resolve("Main.java").toString()) + .run(Task.Expect.SUCCESS) + .getOutput(Task.OutputKind.STDERR); + + if (log.contains("warning: [options]")) { + error("Unexpected options warning in error output: " + log); + } + } + void testError(Path file, String expectStdErr, String expectFault) throws IOException { Result r = run(file, Collections.emptyList(), List.of("1", "2", "3")); checkEmpty("stdout", r.stdOut); -- GitLab From 077b2de088665b907dbfc2b0522a1e109d1d2ca3 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 24 Nov 2021 18:47:50 +0000 Subject: [PATCH 467/890] 8274161: Cleanup redundant casts in jdk.compiler Reviewed-by: vromero --- .../share/classes/com/sun/tools/javac/comp/Attr.java | 12 ++++++------ .../com/sun/tools/javac/comp/LambdaToMethod.java | 12 ++++++------ .../classes/com/sun/tools/javac/comp/Lower.java | 8 ++++---- .../com/sun/tools/javac/comp/TransPatterns.java | 4 ++-- .../com/sun/tools/javac/jvm/StringConcat.java | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index 8efbf6677ed..4b22fb1b17f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -3954,14 +3954,14 @@ public class Attr extends JCTree.Visitor { : chk.checkNonVoid(tree.arg.pos(), attribExpr(tree.arg, env)); // Find operator. - Symbol operator = tree.operator = operators.resolveUnary(tree, tree.getTag(), argtype); + OperatorSymbol operator = tree.operator = operators.resolveUnary(tree, tree.getTag(), argtype); Type owntype = types.createErrorType(tree.type); if (operator != operators.noOpSymbol && !argtype.isErroneous()) { owntype = (tree.getTag().isIncOrDecUnaryOp()) ? tree.arg.type : operator.type.getReturnType(); - int opc = ((OperatorSymbol)operator).opcode; + int opc = operator.opcode; // If the argument is constant, fold it. if (argtype.constValue() != null) { @@ -4008,13 +4008,13 @@ public class Attr extends JCTree.Visitor { matchBindings = matchBindingsComputer.binary(tree, lhsBindings, matchBindings); // Find operator. - Symbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag(), left, right); + OperatorSymbol operator = tree.operator = operators.resolveBinary(tree, tree.getTag(), left, right); Type owntype = types.createErrorType(tree.type); if (operator != operators.noOpSymbol && !left.isErroneous() && !right.isErroneous()) { owntype = operator.type.getReturnType(); - int opc = ((OperatorSymbol)operator).opcode; + int opc = operator.opcode; // If both arguments are constants, fold them. if (left.constValue() != null && right.constValue() != null) { Type ctype = cfolder.fold2(opc, left, right); @@ -5498,11 +5498,11 @@ public class Attr extends JCTree.Visitor { c.owner.kind != PCK && ((c.flags() & STATIC) == 0 || c.name == names.empty) && (TreeInfo.flags(l.head) & (STATIC | INTERFACE)) != 0) { - Symbol sym = null; + VarSymbol sym = null; if (l.head.hasTag(VARDEF)) sym = ((JCVariableDecl) l.head).sym; if (sym == null || sym.kind != VAR || - ((VarSymbol) sym).getConstValue() == null) + sym.getConstValue() == null) log.error(l.head.pos(), Errors.IclsCantHaveStaticDecl(c)); } } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java index c48ac804ac8..55f79c5bc1c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java @@ -424,14 +424,14 @@ public class LambdaToMethod extends TreeTranslator { //add captured locals for (Symbol fv : localContext.getSymbolMap(CAPTURED_VAR).keySet()) { if (fv != localContext.self) { - JCTree captured_local = make.Ident(fv).setType(fv.type); - syntheticInits.append((JCExpression) captured_local); + JCExpression captured_local = make.Ident(fv).setType(fv.type); + syntheticInits.append(captured_local); } } // add captured outer this instances (used only when `this' capture itself is illegal) for (Symbol fv : localContext.getSymbolMap(CAPTURED_OUTER_THIS).keySet()) { - JCTree captured_local = make.QualThis(fv.type); - syntheticInits.append((JCExpression) captured_local); + JCExpression captured_local = make.QualThis(fv.type); + syntheticInits.append(captured_local); } //then, determine the arguments to the indy call @@ -1184,13 +1184,13 @@ public class LambdaToMethod extends TreeTranslator { syms.stringType, syms.methodTypeType).appendList(staticArgs.map(types::constantType)); - Symbol bsm = rs.resolveInternalMethod(pos, attrEnv, site, + MethodSymbol bsm = rs.resolveInternalMethod(pos, attrEnv, site, bsmName, bsm_staticArgs, List.nil()); DynamicMethodSymbol dynSym = new DynamicMethodSymbol(methName, syms.noSymbol, - ((MethodSymbol)bsm).asHandle(), + bsm.asHandle(), indyType, staticArgs.toArray(new LoadableConstant[staticArgs.length()])); JCFieldAccess qualifier = make.Select(make.QualIdent(site.tsym), bsmName); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java index 475e50d22bc..374e18fb0a5 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java @@ -2369,7 +2369,7 @@ public class Lower extends TreeTranslator { enumDefs.append(make.VarDef(valuesVar, make.App(make.QualIdent(valuesMethod)))); tree.sym.members().enter(valuesVar); - Symbol valuesSym = lookupMethod(tree.pos(), names.values, + MethodSymbol valuesSym = lookupMethod(tree.pos(), names.values, tree.type, List.nil()); List valuesBody; if (useClone()) { @@ -2420,7 +2420,7 @@ public class Lower extends TreeTranslator { } JCMethodDecl valuesDef = - make.MethodDef((MethodSymbol)valuesSym, make.Block(0, valuesBody)); + make.MethodDef(valuesSym, make.Block(0, valuesBody)); enumDefs.append(valuesDef); @@ -2635,7 +2635,7 @@ public class Lower extends TreeTranslator { Name bootstrapName, Name argName, boolean isStatic) { - Symbol bsm = rs.resolveInternalMethod(tree.pos(), attrEnv, site, + MethodSymbol bsm = rs.resolveInternalMethod(tree.pos(), attrEnv, site, bootstrapName, staticArgTypes, List.nil()); MethodType indyType = msym.type.asMethodType(); @@ -2647,7 +2647,7 @@ public class Lower extends TreeTranslator { ); DynamicMethodSymbol dynSym = new DynamicMethodSymbol(argName, syms.noSymbol, - ((MethodSymbol)bsm).asHandle(), + bsm.asHandle(), indyType, staticArgValues); JCFieldAccess qualifier = make.Select(make.QualIdent(site.tsym), argName); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java index fda59d6ddaa..f3f304659ed 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java @@ -371,7 +371,7 @@ public class TransPatterns extends TreeTranslator { boolean enumSelector = seltype.tsym.isEnum(); Name bootstrapName = enumSelector ? names.enumSwitch : names.typeSwitch; - Symbol bsm = rs.resolveInternalMethod(tree.pos(), env, syms.switchBootstrapsType, + MethodSymbol bsm = rs.resolveInternalMethod(tree.pos(), env, syms.switchBootstrapsType, bootstrapName, staticArgTypes, List.nil()); MethodType indyType = new MethodType( @@ -382,7 +382,7 @@ public class TransPatterns extends TreeTranslator { ); DynamicMethodSymbol dynSym = new DynamicMethodSymbol(bootstrapName, syms.noSymbol, - ((MethodSymbol)bsm).asHandle(), + bsm.asHandle(), indyType, staticArgValues); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java index 2c17b6880e8..0dddb3e5868 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/StringConcat.java @@ -371,7 +371,7 @@ public abstract class StringConcat { syms.stringType, syms.methodTypeType); - Symbol bsm = rs.resolveInternalMethod(pos, + MethodSymbol bsm = rs.resolveInternalMethod(pos, gen.getAttrEnv(), syms.stringConcatFactory, names.makeConcat, @@ -380,7 +380,7 @@ public abstract class StringConcat { Symbol.DynamicMethodSymbol dynSym = new Symbol.DynamicMethodSymbol(names.makeConcat, syms.noSymbol, - ((MethodSymbol)bsm).asHandle(), + bsm.asHandle(), indyType, List.nil().toArray(new LoadableConstant[0])); @@ -487,7 +487,7 @@ public abstract class StringConcat { .append(syms.stringType) .appendList(constTypes); - Symbol bsm = rs.resolveInternalMethod(pos, + MethodSymbol bsm = rs.resolveInternalMethod(pos, gen.getAttrEnv(), syms.stringConcatFactory, names.makeConcatWithConstants, @@ -496,7 +496,7 @@ public abstract class StringConcat { Symbol.DynamicMethodSymbol dynSym = new Symbol.DynamicMethodSymbol(names.makeConcatWithConstants, syms.noSymbol, - ((MethodSymbol)bsm).asHandle(), + bsm.asHandle(), indyType, List.of(LoadableConstant.String(recipe)) .appendList(constants).toArray(new LoadableConstant[constants.size()])); -- GitLab From 96fe1d0d4d95d87950ff2ecec570a927d831746e Mon Sep 17 00:00:00 2001 From: Leonid Mesnik Date: Wed, 24 Nov 2021 20:11:18 +0000 Subject: [PATCH 468/890] 8264605: vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java failed with "agent_tools.cpp, 471: (foundThread = (jthread) jni_env->NewGlobalRef(foundThread)) != NULL" Reviewed-by: sspitsyn, dholmes --- test/hotspot/jtreg/ProblemList.txt | 1 - .../nsk/share/jvmti/agent_tools.cpp | 33 +++++++------------ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 77cfd0c78e3..1e505775007 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -159,7 +159,6 @@ vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 gener vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64 -vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp index 660e2fc54e5..2412bd63040 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_tools.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -138,34 +138,25 @@ jvmtiEnv* nsk_jvmti_getAgentJVMTIEnv() { return jvmti_env; } -/* ============================================================================= */ -static void set_agent_thread_state(thread_state_t value) { - rawMonitorEnter(jvmti_env, agent_data.monitor); - agent_data.thread_state = value; - rawMonitorNotify(jvmti_env, agent_data.monitor); - rawMonitorExit(jvmti_env, agent_data.monitor); -} - /** Wrapper for user agent thread. */ static void JNICALL agentThreadWrapper(jvmtiEnv* jvmti_env, JNIEnv* agentJNI, void* arg) { jni_env = agentJNI; - /* run user agent proc */ - { - set_agent_thread_state(RUNNABLE); + rawMonitorEnter(jvmti_env, agent_data.monitor); + agent_data.thread_state = RUNNABLE; + rawMonitorNotify(jvmti_env, agent_data.monitor); + rawMonitorExit(jvmti_env, agent_data.monitor); - NSK_TRACE((*agentThreadProc)(jvmti_env, agentJNI, agentThreadArg)); + NSK_TRACE((*agentThreadProc)(jvmti_env, agentJNI, agentThreadArg)); - set_agent_thread_state(TERMINATED); - } + rawMonitorEnter(jvmti_env, agent_data.monitor); + agent_data.thread_state = TERMINATED; + agentJNI->DeleteGlobalRef(agentThread); + agentThread = NULL; + rawMonitorNotify(jvmti_env, agent_data.monitor); + rawMonitorExit(jvmti_env, agent_data.monitor); - /* finalize agent thread */ - { - /* gelete global ref for agent thread */ - agentJNI->DeleteGlobalRef(agentThread); - agentThread = NULL; - } } /** Start wrapper for user agent thread. */ -- GitLab From e785f699614abc8d557be8fc1782a1f86f272430 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Wed, 24 Nov 2021 20:13:06 +0000 Subject: [PATCH 469/890] 8276124: Provide snippet support for properties files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Gibbons Co-authored-by: Hannes Wallnöfer Reviewed-by: jjg --- .../toolkit/taglets/SnippetTaglet.java | 63 ++++-- .../toolkit/taglets/snippet/Parser.java | 48 ++--- .../doclet/testSnippetTag/SnippetTester.java | 6 + .../testSnippetTag/TestLangProperties.java | 187 ++++++++++++++++++ 4 files changed, 263 insertions(+), 41 deletions(-) create mode 100644 test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java index 754a5bf0618..925359bf4ae 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java @@ -30,6 +30,7 @@ import java.util.EnumSet; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; import javax.lang.model.element.Element; @@ -63,6 +64,38 @@ import jdk.javadoc.internal.doclets.toolkit.util.Utils; */ public class SnippetTaglet extends BaseTaglet { + public enum Language { + + JAVA("java"), + PROPERTIES("properties"); + + private static final Map languages; + + static { + Map tmp = new HashMap<>(); + for (var language : values()) { + String id = Objects.requireNonNull(language.identifier); + if (tmp.put(id, language) != null) + throw new IllegalStateException(); // 1-1 correspondence + } + languages = Map.copyOf(tmp); + } + + Language(String id) { + identifier = id; + } + + private final String identifier; + + public static Optional of(String identifier) { + if (identifier == null) + return Optional.empty(); + return Optional.ofNullable(languages.get(identifier)); + } + + public String getIdentifier() {return identifier;} + } + public SnippetTaglet() { super(DocTree.Kind.SNIPPET, true, EnumSet.allOf(Taglet.Location.class)); } @@ -217,6 +250,19 @@ public class SnippetTaglet extends BaseTaglet { } } + String lang = null; + AttributeTree langAttr = attributes.get("lang"); + if (langAttr != null) { + lang = stringValueOf(langAttr); + } else if (containsClass) { + lang = "java"; + } else if (containsFile) { + lang = languageFromFileName(fileObject.getName()); + } + + Optional language = Language.of(lang); + + // TODO cache parsed external snippet (WeakHashMap) StyledText inlineSnippet = null; @@ -224,7 +270,7 @@ public class SnippetTaglet extends BaseTaglet { try { if (inlineContent != null) { - inlineSnippet = parse(writer.configuration().getDocResources(), inlineContent); + inlineSnippet = parse(writer.configuration().getDocResources(), language, inlineContent); } } catch (ParseException e) { var path = writer.configuration().utils.getCommentHelper(holder) @@ -239,7 +285,7 @@ public class SnippetTaglet extends BaseTaglet { try { if (externalContent != null) { - externalSnippet = parse(writer.configuration().getDocResources(), externalContent); + externalSnippet = parse(writer.configuration().getDocResources(), language, externalContent); } } catch (ParseException e) { assert fileObject != null; @@ -289,15 +335,6 @@ public class SnippetTaglet extends BaseTaglet { assert inlineSnippet != null || externalSnippet != null; StyledText text = inlineSnippet != null ? inlineSnippet : externalSnippet; - String lang = null; - AttributeTree langAttr = attributes.get("lang"); - if (langAttr != null) { - lang = stringValueOf(langAttr); - } else if (containsClass) { - lang = "java"; - } else if (containsFile) { - lang = languageFromFileName(fileObject.getName()); - } AttributeTree idAttr = attributes.get("id"); String id = idAttr == null ? null @@ -326,8 +363,8 @@ public class SnippetTaglet extends BaseTaglet { """.formatted(inline, external); } - private StyledText parse(Resources resources, String content) throws ParseException { - Parser.Result result = new Parser(resources).parse(content); + private StyledText parse(Resources resources, Optional language, String content) throws ParseException { + Parser.Result result = new Parser(resources).parse(language, content); result.actions().forEach(Action::perform); return result.text(); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java index 3a1fbaade37..fea60c0d956 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java @@ -39,6 +39,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import jdk.javadoc.internal.doclets.toolkit.Resources; +import jdk.javadoc.internal.doclets.toolkit.taglets.SnippetTaglet; /* * Semantics of a EOL comment; plus @@ -76,10 +77,10 @@ import jdk.javadoc.internal.doclets.toolkit.Resources; */ public final class Parser { - // next-line tag behaves as if it were specified on the next line - - private String eolMarker; - private Matcher markedUpLine; + private static final Pattern JAVA_COMMENT = Pattern.compile( + "^(?.*)//(?\\s*@\\s*\\w+.+?)$"); + private static final Pattern PROPERTIES_COMMENT = Pattern.compile( + "^(?[ \t]*([#!].*)?)[#!](?\\s*@\\s*\\w+.+?)$"); private final Resources resources; private final MarkupParser markupParser; @@ -93,32 +94,23 @@ public final class Parser { this.markupParser = new MarkupParser(resources); } - public Result parse(String source) throws ParseException { - return parse("//", source); + public Result parse(Optional language, String source) throws ParseException { + SnippetTaglet.Language lang = language.orElse(SnippetTaglet.Language.JAVA); + var p = switch (lang) { + case JAVA -> JAVA_COMMENT; + case PROPERTIES -> PROPERTIES_COMMENT; + }; + return parse(p, source); } /* * Newline characters in the returned text are of the \n form. */ - public Result parse(String eolMarker, String source) throws ParseException { - Objects.requireNonNull(eolMarker); + private Result parse(Pattern commentPattern, String source) throws ParseException { + Objects.requireNonNull(commentPattern); Objects.requireNonNull(source); - if (!Objects.equals(eolMarker, this.eolMarker)) { - if (eolMarker.length() < 1) { - throw new IllegalArgumentException(); - } - for (int i = 0; i < eolMarker.length(); i++) { - switch (eolMarker.charAt(i)) { - case '\f', '\n', '\r' -> throw new IllegalArgumentException(); - } - } - this.eolMarker = eolMarker; - // capture the rightmost eolMarker (e.g. "//") - // The below Pattern.compile should never throw PatternSyntaxException - Pattern pattern = Pattern.compile("^(.*)(" + Pattern.quote(eolMarker) - + "(\\s*@\\s*\\w+.+?))$"); - this.markedUpLine = pattern.matcher(""); // reusable matcher - } + + Matcher markedUpLine = commentPattern.matcher(""); // reusable matcher tags.clear(); regions.clear(); @@ -151,17 +143,17 @@ public final class Parser { if (!markedUpLine.matches()) { // (1) line = rawLine + (addLineTerminator ? "\n" : ""); } else { - String maybeMarkup = markedUpLine.group(3); + String maybeMarkup = rawLine.substring(markedUpLine.start("markup")); List parsedTags; try { parsedTags = markupParser.parse(maybeMarkup); } catch (ParseException e) { // translate error position from markup to file line - throw new ParseException(e::getMessage, markedUpLine.start(3) + e.getPosition()); + throw new ParseException(e::getMessage, markedUpLine.start("markup") + e.getPosition()); } for (Tag t : parsedTags) { t.lineSourceOffset = next.offset(); - t.markupLineOffset = markedUpLine.start(3); + t.markupLineOffset = markedUpLine.start("markup"); } thisLineTags.addAll(parsedTags); for (var tagIterator = thisLineTags.iterator(); tagIterator.hasNext(); ) { @@ -176,7 +168,7 @@ public final class Parser { // TODO: log this with NOTICE; line = rawLine + (addLineTerminator ? "\n" : ""); } else { // (3) - String payload = markedUpLine.group(1); + String payload = rawLine.substring(0, markedUpLine.end("payload")); line = payload + (addLineTerminator ? "\n" : ""); } } diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java index a220a4a0db9..ebe13149bb2 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java @@ -101,6 +101,12 @@ public class SnippetTester extends JavadocTester { return getSnippetHtmlRepresentation(pathToHtmlFile, content, Optional.empty(), Optional.empty()); } + protected String getSnippetHtmlRepresentation(String pathToHtmlFile, + String content, + Optional lang) { + return getSnippetHtmlRepresentation(pathToHtmlFile, content, lang, Optional.empty()); + } + protected String getSnippetHtmlRepresentation(String pathToHtmlFile, String content, Optional lang, diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java new file mode 100644 index 00000000000..54b0c9c8da3 --- /dev/null +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2021, 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 8266666 + * @summary Implementation for snippets + * @library /tools/lib ../../lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.javadoc/jdk.javadoc.internal.tool + * @build javadoc.tester.* toolbox.ToolBox toolbox.ModuleBuilder builder.ClassBuilder + * @run main TestLangProperties + */ + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class TestLangProperties extends SnippetTester { + + public static void main(String... args) throws Exception { + new TestLangProperties().runTests(m -> new Object[]{Paths.get(m.getName())}); + } + + @Test + public void testPositiveOuterMarkup(Path base) throws Exception { + var testCases = new ArrayList(); + for (String whitespace1 : List.of("", " ", "\t")) + for (String commentIndicator1 : List.of("#", "!")) + for (String whitespace2 : List.of("", " ", "\t")) { + String markup = whitespace1 + commentIndicator1 + + whitespace2 + "@highlight :"; + var t = new TestSnippetMarkup.TestCase( + """ + %s + coffee=espresso + tea=black + """.formatted(markup), + """ + + coffee=espresso + tea=black + """); + testCases.add(t); + } + testPositive(base, testCases); + } + + @Test + public void testPositiveInnerMarkup(Path base) throws Exception { + var testCases = new ArrayList(); + for (String whitespace1 : List.of("", " ", "\t")) + for (String commentIndicator1 : List.of("#", "!")) + for (String whitespace2 : List.of("", " ", "\t")) + for (String unrelatedComment : List.of("a comment")) + for (String whitespace3 : List.of("", " ")) + for (String commentIndicator2 : List.of("#", "!")) { + String payload = whitespace1 + commentIndicator1 + whitespace2 + unrelatedComment; + String markup = payload + whitespace3 + commentIndicator2 + "@highlight :"; + var t = new TestSnippetMarkup.TestCase( + """ + %s + coffee=espresso + tea=black + """.formatted(markup), + """ + %s + coffee=espresso + tea=black + """.formatted(payload)); + testCases.add(t); + } + testPositive(base, testCases); + } + + @Test + public void testPositiveIneffectiveOuterMarkup(Path base) throws Exception { + var testCases = new ArrayList(); + for (String whitespace1 : List.of("", " ", "\t")) + for (String commentIndicator1 : List.of("#", "!")) + for (String whitespace2 : List.of("", " ", "\t")) { + String ineffectiveMarkup = whitespace1 + + commentIndicator1 + whitespace2 + + "@highlight :"; + var t = new TestSnippetMarkup.TestCase( + """ + coffee=espresso%s + tea=black + """.formatted(ineffectiveMarkup), + """ + coffee=espresso%s + tea=black + """.formatted(ineffectiveMarkup)); + testCases.add(t); + } + testPositive(base, testCases); + } + + @Test + public void testPositiveIneffectiveInnerMarkup(Path base) throws Exception { + var testCases = new ArrayList(); + for (String whitespace1 : List.of("", " ", "\t")) + for (String commentIndicator1 : List.of("#", "!")) + for (String whitespace2 : List.of("", " ", "\t")) + for (String unrelatedComment : List.of("a comment")) + for (String whitespace3 : List.of("", " ")) + for (String commentIndicator2 : List.of("#", "!")) { + String ineffectiveMarkup = whitespace1 + + commentIndicator1 + whitespace2 + + unrelatedComment + whitespace3 + + commentIndicator2 + "@highlight :"; + var t = new TestSnippetMarkup.TestCase( + """ + coffee=espresso%s + tea=black + """.formatted(ineffectiveMarkup), + """ + coffee=espresso%s + tea=black + """.formatted(ineffectiveMarkup)); + testCases.add(t); + } + testPositive(base, testCases); + } + + private void testPositive(Path base, List testCases) + throws IOException { + StringBuilder methods = new StringBuilder(); + forEachNumbered(testCases, (i, n) -> { + String r = i.region().isBlank() ? "" : "region=" + i.region(); + var methodDef = """ + + /** + {@snippet lang="properties" %s: + %s}*/ + public void case%s() {} + """.formatted(r, i.input(), n); + methods.append(methodDef); + }); + var classDef = """ + public class A { + %s + } + """.formatted(methods.toString()); + Path src = Files.createDirectories(base.resolve("src")); + tb.writeJavaFiles(src, classDef); + javadoc("-d", base.resolve("out").toString(), + "-sourcepath", src.toString(), + src.resolve("A.java").toString()); + checkExit(Exit.OK); + checkNoCrashes(); + forEachNumbered(testCases, (t, index) -> { + String html = """ + case%s() +
      + %s +
      """.formatted(index, getSnippetHtmlRepresentation("A.html", + t.expectedOutput(), Optional.of("properties"))); + checkOutput("A.html", true, html); + }); + } +} -- GitLab From b5841ba3f3d079f3cfee532a4e7f23b00f5cd063 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Wed, 24 Nov 2021 20:42:29 +0000 Subject: [PATCH 470/890] 8277806: 4 tools/jar failures per platform after JDK-8272728 Reviewed-by: alanb, jjg --- test/jdk/tools/jar/modularJar/Basic.java | 5 +---- test/jdk/tools/jar/multiRelease/MRTestBase.java | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/test/jdk/tools/jar/modularJar/Basic.java b/test/jdk/tools/jar/modularJar/Basic.java index f6f95b63207..26e9b835a49 100644 --- a/test/jdk/tools/jar/modularJar/Basic.java +++ b/test/jdk/tools/jar/modularJar/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -1093,9 +1093,6 @@ public class Basic { { List commands = new ArrayList<>(); - if (!TOOL_VM_OPTIONS.isEmpty()) { - commands.addAll(Arrays.asList(TOOL_VM_OPTIONS.split("\\s+", -1))); - } commands.add("-d"); commands.add(dest.toString()); if (dest.toString().contains("bar")) { diff --git a/test/jdk/tools/jar/multiRelease/MRTestBase.java b/test/jdk/tools/jar/multiRelease/MRTestBase.java index 8447b20b368..abd5782fdcd 100644 --- a/test/jdk/tools/jar/multiRelease/MRTestBase.java +++ b/test/jdk/tools/jar/multiRelease/MRTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -108,7 +108,6 @@ public class MRTestBase { if (!opts.isEmpty()) { commands.addAll(Arrays.asList(opts.split(" +"))); } - commands.addAll(Utils.getForwardVmOptions()); commands.add("-d"); commands.add(dest.toString()); Stream.of(sourceFiles) -- GitLab From 26472bd3bd8788b0839e2871ed220e438fb6d608 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 24 Nov 2021 22:27:24 +0000 Subject: [PATCH 471/890] 8277811: ProblemList vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001/TestDescription.java 8277813: ProblemList vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java Reviewed-by: dholmes --- test/hotspot/jtreg/ProblemList.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 1e505775007..8878a661562 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -149,6 +149,7 @@ vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock001/TestD vmTestbase/nsk/jdi/HiddenClass/events/events001.java 8257705 generic-all vmTestbase/nsk/jdi/ThreadReference/stop/stop001/TestDescription.java 7034630 generic-all +vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001/TestDescription.java 8277803 generic-all vmTestbase/metaspace/gc/firstGC_10m/TestDescription.java 8208250 generic-all vmTestbase/metaspace/gc/firstGC_50m/TestDescription.java 8208250 generic-all @@ -159,6 +160,7 @@ vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 gener vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64 +vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java 8277812 generic-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all -- GitLab From a81e4fc07b654a3cc954921981d9d3c0cfd8bcec Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 25 Nov 2021 02:12:03 +0000 Subject: [PATCH 472/890] 8258117: jar tool sets the time stamp of module-info.class entries to the current time Reviewed-by: lancea, ihse, alanb --- .../share/classes/sun/tools/jar/Main.java | 89 +++++-- ...olModuleDescriptorReproducibilityTest.java | 218 ++++++++++++++++++ 2 files changed, 285 insertions(+), 22 deletions(-) create mode 100644 test/jdk/tools/jar/modularJar/JarToolModuleDescriptorReproducibilityTest.java diff --git a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java index e79b858d990..4e6df7e39bf 100644 --- a/src/jdk.jartool/share/classes/sun/tools/jar/Main.java +++ b/src/jdk.jartool/share/classes/sun/tools/jar/Main.java @@ -44,6 +44,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.FileTime; import java.text.MessageFormat; import java.util.*; import java.util.function.Consumer; @@ -120,7 +121,7 @@ public class Main { Set entries = new LinkedHashSet<>(); // module-info.class entries need to be added/updated. - Map moduleInfos = new HashMap<>(); + Map moduleInfos = new HashMap<>(); // A paths Set for each version, where each Set contains directories // specified by the "-C" operation. @@ -806,7 +807,10 @@ public class Main { if (f.isFile()) { Entry e = new Entry(f, name, false); if (isModuleInfoEntry(name)) { - moduleInfos.putIfAbsent(name, Files.readAllBytes(f.toPath())); + Path path = f.toPath(); + byte[] fileContent = Files.readAllBytes(path); + ModuleInfoEntry mie = new StreamedModuleInfoEntry(name, fileContent, Files.getLastModifiedTime(path)); + moduleInfos.putIfAbsent(name, mie); if (uflag) { entryMap.put(name, e); } @@ -907,7 +911,7 @@ public class Main { */ boolean update(InputStream in, OutputStream out, InputStream newManifest, - Map moduleInfos, + Map moduleInfos, JarIndex jarIndex) throws IOException { ZipInputStream zis = new ZipInputStream(in); @@ -956,7 +960,7 @@ public class Main { return false; } } else if (moduleInfos != null && isModuleInfoEntry) { - moduleInfos.putIfAbsent(name, zis.readAllBytes()); + moduleInfos.putIfAbsent(name, new StreamedModuleInfoEntry(name, zis.readAllBytes(), e.getLastModifiedTime())); } else { boolean isDir = e.isDirectory(); if (!entryMap.containsKey(name)) { // copy the old stuff @@ -1040,15 +1044,21 @@ public class Main { zos.closeEntry(); } - private void updateModuleInfo(Map moduleInfos, ZipOutputStream zos) + private void updateModuleInfo(Map moduleInfos, ZipOutputStream zos) throws IOException { String fmt = uflag ? "out.update.module-info": "out.added.module-info"; - for (Map.Entry mi : moduleInfos.entrySet()) { + for (Map.Entry mi : moduleInfos.entrySet()) { String name = mi.getKey(); - byte[] bytes = mi.getValue(); + ModuleInfoEntry mie = mi.getValue(); + byte[] bytes = mie.readAllBytes(); ZipEntry e = new ZipEntry(name); - e.setTime(System.currentTimeMillis()); + FileTime lastModified = mie.getLastModifiedTime(); + if (lastModified != null) { + e.setLastModifiedTime(lastModified); + } else { + e.setLastModifiedTime(FileTime.fromMillis(System.currentTimeMillis())); + } if (flag0) { crc32ModuleInfo(e, bytes); } @@ -1743,12 +1753,23 @@ public class Main { /** * Associates a module descriptor's zip entry name along with its - * bytes and an optional URI. Used when describing modules. + * bytes and an optional URI. */ interface ModuleInfoEntry { - String name(); - Optional uriString(); - InputStream bytes() throws IOException; + String name(); + Optional uriString(); + InputStream bytes() throws IOException; + /** + * @return Returns the last modified time of the module-info.class. + * Returns null if the last modified time is unknown or cannot be + * determined. + */ + FileTime getLastModifiedTime(); + default byte[] readAllBytes() throws IOException { + try (InputStream is = bytes()) { + return is.readAllBytes(); + } + } } static class ZipFileModuleInfoEntry implements ModuleInfoEntry { @@ -1762,6 +1783,12 @@ public class Main { @Override public InputStream bytes() throws IOException { return zipFile.getInputStream(entry); } + + @Override + public FileTime getLastModifiedTime() { + return entry.getLastModifiedTime(); + } + /** Returns an optional containing the effective URI. */ @Override public Optional uriString() { String uri = (Paths.get(zipFile.getName())).toUri().toString(); @@ -1773,14 +1800,28 @@ public class Main { static class StreamedModuleInfoEntry implements ModuleInfoEntry { private final String name; private final byte[] bytes; - StreamedModuleInfoEntry(String name, byte[] bytes) { + private final FileTime lastModifiedTime; + + StreamedModuleInfoEntry(String name, byte[] bytes, FileTime lastModifiedTime) { this.name = name; this.bytes = bytes; + this.lastModifiedTime = lastModifiedTime; } @Override public String name() { return name; } @Override public InputStream bytes() throws IOException { return new ByteArrayInputStream(bytes); } + + @Override + public byte[] readAllBytes() throws IOException { + return bytes; + } + + @Override + public FileTime getLastModifiedTime() { + return lastModifiedTime; + } + /** Returns an empty optional. */ @Override public Optional uriString() { return Optional.empty(); // no URI can be derived @@ -1832,7 +1873,7 @@ public class Main { while ((e = zis.getNextEntry()) != null) { String ename = e.getName(); if (isModuleInfoEntry(ename)) { - infos.add(new StreamedModuleInfoEntry(ename, zis.readAllBytes())); + infos.add(new StreamedModuleInfoEntry(ename, zis.readAllBytes(), e.getLastModifiedTime())); } } } @@ -2045,14 +2086,14 @@ public class Main { return (classname.replace('.', '/')) + ".class"; } - private boolean checkModuleInfo(byte[] moduleInfoBytes, Set entries) + private boolean checkModuleInfo(ModuleInfoEntry moduleInfoEntry, Set entries) throws IOException { boolean ok = true; - if (moduleInfoBytes != null) { // no root module-info.class if null + if (moduleInfoEntry != null) { // no root module-info.class if null try { // ModuleDescriptor.read() checks open/exported pkgs vs packages - ModuleDescriptor md = ModuleDescriptor.read(ByteBuffer.wrap(moduleInfoBytes)); + ModuleDescriptor md = ModuleDescriptor.read(moduleInfoEntry.bytes()); // A module must have the implementation class of the services it 'provides'. if (md.provides().stream().map(Provides::providers).flatMap(List::stream) .filter(p -> !entries.contains(toBinaryName(p))) @@ -2070,15 +2111,19 @@ public class Main { /** * Adds extended modules attributes to the given module-info's. The given - * Map values are updated in-place. Returns false if an error occurs. + * Map values are updated in-place. */ - private void addExtendedModuleAttributes(Map moduleInfos, + private void addExtendedModuleAttributes(Map moduleInfos, Set packages) throws IOException { - for (Map.Entry e: moduleInfos.entrySet()) { - ModuleDescriptor md = ModuleDescriptor.read(ByteBuffer.wrap(e.getValue())); - e.setValue(extendedInfoBytes(md, e.getValue(), packages)); + for (Map.Entry e: moduleInfos.entrySet()) { + ModuleInfoEntry mie = e.getValue(); + byte[] bytes = mie.readAllBytes(); + ModuleDescriptor md = ModuleDescriptor.read(ByteBuffer.wrap(bytes)); + byte[] extended = extendedInfoBytes(md, bytes, packages); + // replace the entry value with the extended bytes + e.setValue(new StreamedModuleInfoEntry(mie.name(), extended, mie.getLastModifiedTime())); } } diff --git a/test/jdk/tools/jar/modularJar/JarToolModuleDescriptorReproducibilityTest.java b/test/jdk/tools/jar/modularJar/JarToolModuleDescriptorReproducibilityTest.java new file mode 100644 index 00000000000..376b2617998 --- /dev/null +++ b/test/jdk/tools/jar/modularJar/JarToolModuleDescriptorReproducibilityTest.java @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2021, 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 org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.module.ModuleDescriptor; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; +import java.util.spi.ToolProvider; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; + +/** + * @test + * @bug 8258117 + * @summary Tests that the content generated for module-info.class, using the jar command, is reproducible + * @run testng JarToolModuleDescriptorReproducibilityTest + */ +public class JarToolModuleDescriptorReproducibilityTest { + + private static final String MODULE_NAME = "foo"; + private static final String MODULE_VERSION = "1.2.3"; + private static final String UPDATED_MODULE_VERSION = "1.2.4"; + private static final String MAIN_CLASS = "jdk.test.foo.Foo"; + private static final Path MODULE_CLASSES_DIR = Path.of("8258117-module-classes", MODULE_NAME).toAbsolutePath(); + + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar") + .orElseThrow(() + -> new RuntimeException("jar tool not found") + ); + private static final ToolProvider JAVAC_TOOL = ToolProvider.findFirst("javac") + .orElseThrow(() + -> new RuntimeException("javac tool not found") + ); + + + @BeforeClass + public static void setup() throws Exception { + compileModuleClasses(); + } + + /** + * Launches a "jar --create" command multiple times with a module-info.class. The module-info.class + * is internally updated by the jar tool to add additional data. Expects that each such generated + * jar has the exact same bytes. + */ + @Test + public void testJarCreate() throws Exception { + List jarFiles = new ArrayList<>(); + for (int i = 0; i < 3; i++) { + Path targetJar = Files.createTempFile(Path.of("."), "8258117-jar-create", ".jar"); + jarFiles.add(targetJar); + if (i > 0) { + // the timestamp that gets embedded in (Zip/Jar)Entry gets narrowed + // down to SECONDS unit. So we make sure that there's at least a second + // gap between the jar file creations, to be sure that the jar file + // was indeed generated at "different times" + Thread.sleep(1000); + } + // create a modular jar + runJarCommand("--create", + "--file=" + targetJar, + "--main-class=" + MAIN_CLASS, + "--module-version=" + MODULE_VERSION, + "--no-manifest", + "-C", MODULE_CLASSES_DIR.toString(), "."); + // verify the module descriptor in the jar + assertExpectedModuleInfo(targetJar, MODULE_VERSION); + } + assertAllFileContentsAreSame(jarFiles); + } + + /** + * Launches a "jar --update" process multiple times to update the module-info.class + * descriptor with the same content and then expects that the modular jar created by + * each of these processes has the exact same bytes. + */ + @Test + public void testJarUpdate() throws Exception { + List jarFiles = new ArrayList<>(); + for (int i = 0; i < 3; i++) { + Path targetJar = Files.createTempFile(Path.of("."), "8258117-jar-update", ".jar"); + jarFiles.add(targetJar); + if (i > 0) { + // the timestamp that gets embedded in (Zip/Jar)Entry gets narrowed + // down to SECONDS unit. So we make sure that there's at least a second + // gap between the jar file creations, to be sure that the jar file + // was indeed generated at "different times" + Thread.sleep(1000); + } + // first create the modular jar + runJarCommand("--create", + "--file=" + targetJar, + "--module-version=" + MODULE_VERSION, + "--no-manifest", + "-C", MODULE_CLASSES_DIR.toString(), "."); + assertExpectedModuleInfo(targetJar, MODULE_VERSION); + // now update the same modular jar + runJarCommand("--update", + "--file=" + targetJar, + "--module-version=" + UPDATED_MODULE_VERSION, + "--no-manifest", + "-C", MODULE_CLASSES_DIR.toString(), "module-info.class"); + // verify the module descriptor in the jar + assertExpectedModuleInfo(targetJar, UPDATED_MODULE_VERSION); + } + assertAllFileContentsAreSame(jarFiles); + } + + // compiles using javac tool the classes used in the test module + private static void compileModuleClasses() throws Exception { + Path sourcePath = Path.of(System.getProperty("test.src", "."), + "src", MODULE_NAME); + List sourceFiles = new ArrayList<>(); + Files.walkFileTree(sourcePath, new SimpleFileVisitor<>() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (file.toString().endsWith(".java")) { + sourceFiles.add(file.toString()); + } + return FileVisitResult.CONTINUE; + } + }); + Path classesDir = Files.createDirectories(MODULE_CLASSES_DIR); + List javacArgs = new ArrayList<>(); + javacArgs.add("-d"); + javacArgs.add(classesDir.toString()); + sourceFiles.forEach((f) -> javacArgs.add(f)); + System.out.println("Launching javac command with args: " + javacArgs); + StringWriter sw = new StringWriter(); + try (PrintWriter pw = new PrintWriter(sw)) { + int exitCode = JAVAC_TOOL.run(pw, pw, javacArgs.toArray(new String[0])); + assertEquals(exitCode, 0, "Module compilation failed: " + sw.toString()); + } + System.out.println("Module classes successfully compiled to directory " + classesDir); + } + + // runs the "jar" command passing it the "jarArgs" and verifying that the command + // execution didn't fail + private static void runJarCommand(String... jarArgs) { + StringWriter sw = new StringWriter(); + System.out.println("Launching jar command with args: " + Arrays.toString(jarArgs)); + try (PrintWriter pw = new PrintWriter(sw)) { + int exitCode = JAR_TOOL.run(pw, pw, jarArgs); + assertEquals(exitCode, 0, "jar command execution failed: " + sw.toString()); + } + } + + // verifies the byte equality of the contents in each of the files + private static void assertAllFileContentsAreSame(List files) throws Exception { + Path firstFile = files.get(0); + for (int i = 1; i < files.size(); i++) { + assertEquals(Files.mismatch(firstFile, files.get(i)), -1, + "Content in file " + files.get(i) + " isn't the same as in file " + firstFile); + } + } + + // verifies that a module-info.class is present in the jar and the module name and version are the expected + // ones + private static void assertExpectedModuleInfo(Path jar, String expectedModuleVersion) throws Exception { + try (JarInputStream jaris = new JarInputStream(Files.newInputStream(jar))) { + JarEntry moduleInfoEntry = null; + JarEntry entry = null; + while ((entry = jaris.getNextJarEntry()) != null) { + if (entry.getName().equals("module-info.class")) { + moduleInfoEntry = entry; + break; + } + } + assertNotNull(moduleInfoEntry, "module-info.class is missing from jar " + jar); + + ModuleDescriptor md = ModuleDescriptor.read(jaris); + assertEquals(md.name(), MODULE_NAME, "Unexpected module name"); + assertFalse(md.rawVersion().isEmpty(), "Module version missing from descriptor"); + + String actualVersion = md.rawVersion().get(); + assertEquals(actualVersion, expectedModuleVersion, "Unexpected module version"); + + System.out.println(moduleInfoEntry.getName() + " has a timestamp of " + + moduleInfoEntry.getTime() + " for version " + actualVersion); + } + } +} + -- GitLab From 21e302a0f4cbf3ace907c36d871a2f2cf6277188 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Thu, 25 Nov 2021 04:27:21 +0000 Subject: [PATCH 473/890] 8270435: UT: MonitorUsedDeflationThresholdTest failed: did not find too_many string in output Reviewed-by: dholmes --- .../Monitor/MonitorUsedDeflationThresholdTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java b/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java index 6bae009a84d..5dd01e4262b 100644 --- a/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java +++ b/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java @@ -81,6 +81,11 @@ public class MonitorUsedDeflationThresholdTest { // of monitors for threads that call Object.wait(). "-XX:+UnlockDiagnosticVMOptions", "-XX:AvgMonitorsPerThreadEstimate=1", + // MonitorUsedDeflationThreshold == 10 means we'll request + // deflations when 10% of monitors are used rather than the + // default 90%. This should allow the test to tolerate a burst + // of used monitors by threads not under this test's control. + "-XX:MonitorUsedDeflationThreshold=10", // Enable monitorinflation logging so we can see that // MonitorUsedDeflationThreshold and // NoAsyncDeflationProgressMaxoption are working. @@ -89,8 +94,9 @@ public class MonitorUsedDeflationThresholdTest { "-Xlog:safepoint+cleanup=info", "-Xlog:safepoint+stats=debug", // Run the test with inflate_count == 33 since that - // reproduced the bug with JDK13. Anything above the - // in_use_list_ceiling will do the trick. + // reproduced the bug with JDK13. With inflate_count == 33, an + // initial ceiling == 12 and MonitorUsedDeflationThreshold == 10, + // we should hit NoAsyncDeflationProgressMax at least 3 times. "MonitorUsedDeflationThresholdTest", "33"); OutputAnalyzer output_detail = new OutputAnalyzer(pb.start()); @@ -111,6 +117,8 @@ public class MonitorUsedDeflationThresholdTest { throw new RuntimeException("Did not find too_many string in output.\n"); } System.out.println("too_many='" + too_many + "'"); + // Uncomment the following line for dumping test output in passing runs: + // output_detail.reportDiagnosticSummary(); System.out.println("PASSED."); return; -- GitLab From f0136ec94539d0e30ec11d44f8143196da1f7125 Mon Sep 17 00:00:00 2001 From: Fairoz Matte Date: Thu, 25 Nov 2021 08:37:31 +0000 Subject: [PATCH 474/890] 8275687: runtime/CommandLine/PrintTouchedMethods test shouldn't catch RuntimeException Reviewed-by: iklam, chagedorn --- .../runtime/CommandLine/PrintTouchedMethodsJcmd.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java b/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java index f3188007941..26f0c3ca0dc 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java +++ b/test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java @@ -41,10 +41,6 @@ public class PrintTouchedMethodsJcmd { var pb = new ProcessBuilder(); pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.print_touched_methods"}); var output = new OutputAnalyzer(pb.start()); - try { - output.shouldContain("PrintTouchedMethodsJcmd.main:([Ljava/lang/String;)V"); - } catch (RuntimeException e) { - output.shouldContain("Unknown diagnostic command"); - } - } + output.shouldContain("PrintTouchedMethodsJcmd.main:([Ljava/lang/String;)V"); + } } -- GitLab From 3034ae87ce4b94c7dc40cfb5a96d6d1e87910bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Thu, 25 Nov 2021 09:50:43 +0000 Subject: [PATCH 475/890] 8277631: ZGC: CriticalMetaspaceAllocation asserts Reviewed-by: pliden, stefank, dholmes --- .../memory/metaspaceCriticalAllocation.cpp | 18 +++++++---- .../gc/gctests/LoadUnloadGC/LoadUnloadGC.java | 30 +++++++++++++++++-- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp b/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp index 1edb67bf7f4..08400e5b5d4 100644 --- a/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp +++ b/src/hotspot/share/memory/metaspaceCriticalAllocation.cpp @@ -113,10 +113,12 @@ void MetaspaceCriticalAllocation::remove(MetadataAllocationRequest* request) { } bool MetaspaceCriticalAllocation::try_allocate_critical(MetadataAllocationRequest* request) { - MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); - if (_requests_head == request) { - // The first request can't opportunistically ride on a previous GC - return false; + { + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); + if (_requests_head == request) { + // The first request can't opportunistically ride on a previous GC + return false; + } } // Try to ride on a previous GC and hope for early satisfaction wait_for_purge(request); @@ -124,8 +126,12 @@ bool MetaspaceCriticalAllocation::try_allocate_critical(MetadataAllocationReques } void MetaspaceCriticalAllocation::wait_for_purge(MetadataAllocationRequest* request) { - while (!request->has_result()) { - ThreadBlockInVM tbivm(JavaThread::current()); + ThreadBlockInVM tbivm(JavaThread::current()); + MutexLocker ml(MetaspaceCritical_lock, Mutex::_no_safepoint_check_flag); + for (;;) { + if (request->has_result()) { + break; + } MetaspaceCritical_lock->wait_without_safepoint_check(); } } diff --git a/test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java b/test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java index edd65b81145..9b79865462d 100644 --- a/test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java +++ b/test/hotspot/jtreg/vmTestbase/gc/gctests/LoadUnloadGC/LoadUnloadGC.java @@ -28,11 +28,11 @@ * @summary converted from VM Testbase gc/gctests/LoadUnloadGC. * VM Testbase keywords: [gc, stress, stressopt, nonconcurrent, monitoring] * VM Testbase readme: - * In this test a 1000 classes are loaded and unloaded in a loop. + * In this test 1000 classes are loaded and unloaded in a loop. * Class0 gets loaded which results in Class1 getting loaded and so on all - * the way uptill class1000. The classes should be unloaded whenever a + * the way up to class1000. The classes should be unloaded whenever a * garbage collection takes place because their classloader is made unreachable - * at the end of the each loop iteration. The loop is repeated 1000 times. + * at the end of each loop iteration. The loop is repeated 1000 times. * * @requires vm.opt.final.ClassUnloading * @library /vmTestbase @@ -45,6 +45,30 @@ * gc.gctests.LoadUnloadGC.LoadUnloadGC */ +/* + * @test + * @key stress + * + * @summary converted from VM Testbase gc/gctests/LoadUnloadGC. + * VM Testbase keywords: [gc, stress, stressopt, nonconcurrent, monitoring] + * VM Testbase readme: + * In this test 1000 classes are loaded and unloaded in a loop. + * Class0 gets loaded which results in Class1 getting loaded and so on all + * the way up to class1000. The classes should be unloaded whenever a + * garbage collection takes place because their classloader is made unreachable + * at the end of each loop iteration. The loop is repeated 1000 times. + * + * @requires vm.opt.final.ClassUnloading + * @library /vmTestbase + * /test/lib + * @build nsk.share.gc.ClassChain + * @run main/othervm + * -XX:MaxMetaspaceSize=64M + * -XX:MetaspaceSize=64M + * -XX:CompressedClassSpaceSize=32M + * gc.gctests.LoadUnloadGC.LoadUnloadGC + */ + package gc.gctests.LoadUnloadGC; import nsk.share.test.*; -- GitLab From f788834998eeb9083e971857446321ed173aa916 Mon Sep 17 00:00:00 2001 From: Ivan Walulya Date: Thu, 25 Nov 2021 14:10:51 +0000 Subject: [PATCH 476/890] 8277786: G1: Rename log2_card_region_per_heap_region used in G1CardSet Reviewed-by: ayang, tschatzl, mli --- src/hotspot/share/gc/g1/g1CardSet.cpp | 16 ++++++++-------- src/hotspot/share/gc/g1/g1CardSet.hpp | 8 ++++---- .../share/gc/g1/heapRegionRemSet.inline.hpp | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index e9c986ebc53..eb39beaef0b 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -45,14 +45,14 @@ G1CardSet::CardSetPtr G1CardSet::FullCardSet = (G1CardSet::CardSetPtr)-1; static uint default_log2_card_region_per_region() { - uint log2_card_region_per_heap_region = 0; + uint log2_card_regions_per_heap_region = 0; const uint card_container_limit = G1CardSetContainer::LogCardsPerRegionLimit; if (card_container_limit < (uint)HeapRegion::LogCardsPerRegion) { - log2_card_region_per_heap_region = (uint)HeapRegion::LogCardsPerRegion - card_container_limit; + log2_card_regions_per_heap_region = (uint)HeapRegion::LogCardsPerRegion - card_container_limit; } - return log2_card_region_per_heap_region; + return log2_card_regions_per_heap_region; } G1CardSetConfiguration::G1CardSetConfiguration() : @@ -64,7 +64,7 @@ G1CardSetConfiguration::G1CardSetConfiguration() : (uint)HeapRegion::CardsPerRegion, /* max_cards_in_cardset */ default_log2_card_region_per_region()) /* log2_card_region_per_region */ { - assert((_log2_card_region_per_heap_region + _log2_cards_per_card_region) == (uint)HeapRegion::LogCardsPerRegion, + assert((_log2_card_regions_per_heap_region + _log2_cards_per_card_region) == (uint)HeapRegion::LogCardsPerRegion, "inconsistent heap region virtualization setup"); } @@ -91,7 +91,7 @@ G1CardSetConfiguration::G1CardSetConfiguration(uint inline_ptr_bits_per_card, uint num_buckets_in_howl, double cards_in_howl_threshold_percent, uint max_cards_in_card_set, - uint log2_card_region_per_heap_region) : + uint log2_card_regions_per_heap_region) : _inline_ptr_bits_per_card(inline_ptr_bits_per_card), _num_cards_in_array(num_cards_in_array), _num_buckets_in_howl(num_buckets_in_howl), @@ -101,8 +101,8 @@ G1CardSetConfiguration::G1CardSetConfiguration(uint inline_ptr_bits_per_card, _cards_in_howl_bitmap_threshold(_num_cards_in_howl_bitmap * cards_in_bitmap_threshold_percent), _log2_num_cards_in_howl_bitmap(log2i_exact(_num_cards_in_howl_bitmap)), _bitmap_hash_mask(~(~(0) << _log2_num_cards_in_howl_bitmap)), - _log2_card_region_per_heap_region(log2_card_region_per_heap_region), - _log2_cards_per_card_region(log2i_exact(_max_cards_in_card_set) - _log2_card_region_per_heap_region) { + _log2_card_regions_per_heap_region(log2_card_regions_per_heap_region), + _log2_cards_per_card_region(log2i_exact(_max_cards_in_card_set) - _log2_card_regions_per_heap_region) { assert(is_power_of_2(_max_cards_in_card_set), "max_cards_in_card_set must be a power of 2: %u", _max_cards_in_card_set); @@ -134,7 +134,7 @@ void G1CardSetConfiguration::log_configuration() { num_cards_in_array(), G1CardSetArray::size_in_bytes(num_cards_in_array()), num_buckets_in_howl(), cards_in_howl_threshold(), num_cards_in_howl_bitmap(), G1CardSetBitMap::size_in_bytes(num_cards_in_howl_bitmap()), cards_in_howl_bitmap_threshold(), - (uint)1 << log2_card_region_per_heap_region(), + (uint)1 << log2_card_regions_per_heap_region(), (uint)1 << log2_cards_per_card_region()); } diff --git a/src/hotspot/share/gc/g1/g1CardSet.hpp b/src/hotspot/share/gc/g1/g1CardSet.hpp index c8e09cec126..903b9d0b7ed 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.hpp @@ -58,7 +58,7 @@ class G1CardSetConfiguration { uint _cards_in_howl_bitmap_threshold; uint _log2_num_cards_in_howl_bitmap; size_t _bitmap_hash_mask; - uint _log2_card_region_per_heap_region; + uint _log2_card_regions_per_heap_region; uint _log2_cards_per_card_region; G1CardSetAllocOptions* _card_set_alloc_options; @@ -69,7 +69,7 @@ class G1CardSetConfiguration { uint num_buckets_in_howl, double cards_in_howl_threshold_percent, uint max_cards_in_card_set, - uint log2_card_region_per_heap_region); + uint log2_card_regions_per_heap_region); void init_card_set_alloc_options(); void log_configuration(); @@ -127,8 +127,8 @@ public: // The next two members give information about how many card regions are there // per area (heap region) and how many cards each card region has. - // The log2 of the amount of card regions per heap region configured. - uint log2_card_region_per_heap_region() const { return _log2_card_region_per_heap_region; } + // The log2 of the number of card regions per heap region configured. + uint log2_card_regions_per_heap_region() const { return _log2_card_regions_per_heap_region; } // The log2 of the number of cards per card region. This is calculated from max_cards_in_region() // and above. uint log2_cards_per_card_region() const { return _log2_cards_per_card_region; } diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp index fc7da0994e4..eaa2d7f1e56 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp @@ -110,7 +110,7 @@ template inline void HeapRegionRemSet::iterate_for_merge(CardOrRangeVisitor& cl) { G1HeapRegionRemSetMergeCardClosure cl2(&_card_set, cl, - _card_set.config()->log2_card_region_per_heap_region(), + _card_set.config()->log2_card_regions_per_heap_region(), _card_set.config()->log2_cards_per_card_region()); _card_set.iterate_containers(&cl2, true /* at_safepoint */); } -- GitLab From 987992042454f92936d3efbd01e7beb921e3b70e Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 25 Nov 2021 14:54:48 +0000 Subject: [PATCH 477/890] 8277825: Remove unused ReferenceProcessorPhaseTimes::_sub_phases_total_time_ms Reviewed-by: tschatzl --- .../share/gc/shared/referenceProcessorPhaseTimes.cpp | 12 ------------ .../share/gc/shared/referenceProcessorPhaseTimes.hpp | 5 ----- 2 files changed, 17 deletions(-) diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp index 87d60b1a6c0..42c39d70b10 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp @@ -200,7 +200,6 @@ void ReferenceProcessorPhaseTimes::set_phase_time_ms(ReferenceProcessor::RefProc void ReferenceProcessorPhaseTimes::reset() { for (int i = 0; i < ReferenceProcessor::RefSubPhaseMax; i++) { _sub_phases_worker_time_sec[i]->reset(); - _sub_phases_total_time_ms[i] = uninitialized(); } for (int i = 0; i < ReferenceProcessor::RefPhaseMax; i++) { @@ -227,17 +226,6 @@ ReferenceProcessorPhaseTimes::~ReferenceProcessorPhaseTimes() { delete _soft_weak_final_refs_phase_worker_time_sec; } -double ReferenceProcessorPhaseTimes::sub_phase_total_time_ms(ReferenceProcessor::RefProcSubPhases sub_phase) const { - ASSERT_SUB_PHASE(sub_phase); - return _sub_phases_total_time_ms[sub_phase]; -} - -void ReferenceProcessorPhaseTimes::set_sub_phase_total_phase_time_ms(ReferenceProcessor::RefProcSubPhases sub_phase, - double time_ms) { - ASSERT_SUB_PHASE(sub_phase); - _sub_phases_total_time_ms[sub_phase] = time_ms; -} - void ReferenceProcessorPhaseTimes::add_ref_cleared(ReferenceType ref_type, size_t count) { ASSERT_REF_TYPE(ref_type); Atomic::add(&_ref_cleared[ref_type_2_index(ref_type)], count, memory_order_relaxed); diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp index 5d1f2d2eeb7..2c062b94c3d 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp @@ -41,8 +41,6 @@ class ReferenceProcessorPhaseTimes : public CHeapObj { // Records per thread time information of each sub phase. WorkerDataArray* _sub_phases_worker_time_sec[ReferenceProcessor::RefSubPhaseMax]; - // Total time of each sub phase. - double _sub_phases_total_time_ms[ReferenceProcessor::RefSubPhaseMax]; // Records total elapsed time for each phase. double _phases_time_ms[ReferenceProcessor::RefPhaseMax]; @@ -62,7 +60,6 @@ class ReferenceProcessorPhaseTimes : public CHeapObj { GCTimer* _gc_timer; double phase_time_ms(ReferenceProcessor::RefProcPhases phase) const; - double sub_phase_total_time_ms(ReferenceProcessor::RefProcSubPhases sub_phase) const; double total_time_ms() const { return _total_time_ms; } @@ -84,8 +81,6 @@ public: WorkerDataArray* sub_phase_worker_time_sec(ReferenceProcessor::RefProcSubPhases phase) const; void set_phase_time_ms(ReferenceProcessor::RefProcPhases phase, double par_phase_time_ms); - void set_sub_phase_total_phase_time_ms(ReferenceProcessor::RefProcSubPhases sub_phase, double ref_proc_time_ms); - void set_total_time_ms(double total_time_ms) { _total_time_ms = total_time_ms; } void add_ref_cleared(ReferenceType ref_type, size_t count); -- GitLab From eb4d886bc0f57085b21ef41f2069ff60b2714cfa Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 26 Nov 2021 01:45:33 +0000 Subject: [PATCH 478/890] 8277504: Use String.stripTrailing instead of hand-crafted method in SwingUtilities2 Reviewed-by: pbansal, serb --- .../share/classes/sun/swing/SwingUtilities2.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java index e746dad6e7e..5b8cf120e13 100644 --- a/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java +++ b/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java @@ -520,7 +520,7 @@ public class SwingUtilities2 { * it to fit in the screen width. This distributes the spacing * more evenly than directly laying out to the screen advances. */ - String trimmedText = trimTrailingSpaces(text); + String trimmedText = text.stripTrailing(); if (!trimmedText.isEmpty()) { float screenWidth = (float) g2d.getFont().getStringBounds (trimmedText, getFontRenderContext(c)).getWidth(); @@ -866,7 +866,7 @@ public class SwingUtilities2 { String text = new String(data, offset, length); TextLayout layout = new TextLayout(text, g2d.getFont(), deviceFontRenderContext); - String trimmedText = trimTrailingSpaces(text); + String trimmedText = text.stripTrailing(); if (!trimmedText.isEmpty()) { float screenWidth = (float)g2d.getFont(). getStringBounds(trimmedText, frc).getWidth(); @@ -1321,14 +1321,6 @@ public class SwingUtilities2 { return (g instanceof PrinterGraphics || g instanceof PrintGraphics); } - private static String trimTrailingSpaces(String s) { - int i = s.length() - 1; - while(i >= 0 && Character.isWhitespace(s.charAt(i))) { - i--; - } - return s.substring(0, i + 1); - } - private static AttributedCharacterIterator getTrimmedTrailingSpacesIterator (AttributedCharacterIterator iterator) { int curIdx = iterator.getIndex(); -- GitLab From 7e54d065a17f1277adf1b8561fadb8a480bc6bed Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Fri, 26 Nov 2021 01:55:58 +0000 Subject: [PATCH 479/890] 8277165: jdeps --multi-release --print-module-deps fails if module-info.class in different versioned directories 8277166: Data race in jdeps VersionHelper 8277123: jdeps does not report some exceptions correctly Reviewed-by: jvernee, alanb --- .../com/sun/tools/jdeps/ClassFileReader.java | 4 +- .../com/sun/tools/jdeps/DependencyFinder.java | 9 +- .../tools/jdeps/MultiReleaseException.java | 2 +- .../com/sun/tools/jdeps/VersionHelper.java | 13 +-- .../jdeps/multiVersion/MultiVersionError.java | 107 ++++++++++++++++++ .../multiVersion/src/m1/module-info.java | 27 +++++ .../jdeps/multiVersion/src/m1/p/Test.java | 27 +++++ .../multiVersion/src/m1/p/internal/P.java | 30 +++++ .../multiVersion/src/m2/module-info.java | 27 +++++ .../multiVersion/src/m2/p/internal/P.java | 30 +++++ .../tools/jdeps/multiVersion/src/m2/q/Q.java | 32 ++++++ 11 files changed, 295 insertions(+), 13 deletions(-) create mode 100644 test/langtools/tools/jdeps/multiVersion/MultiVersionError.java create mode 100644 test/langtools/tools/jdeps/multiVersion/src/m1/module-info.java create mode 100644 test/langtools/tools/jdeps/multiVersion/src/m1/p/Test.java create mode 100644 test/langtools/tools/jdeps/multiVersion/src/m1/p/internal/P.java create mode 100644 test/langtools/tools/jdeps/multiVersion/src/m2/module-info.java create mode 100644 test/langtools/tools/jdeps/multiVersion/src/m2/p/internal/P.java create mode 100644 test/langtools/tools/jdeps/multiVersion/src/m2/q/Q.java diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java index 1c4df796279..b03c175da24 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ClassFileReader.java @@ -356,7 +356,8 @@ public class ClassFileReader implements Closeable { protected ClassFile readClassFile(JarFile jarfile, JarEntry e) throws IOException { try (InputStream is = jarfile.getInputStream(e)) { ClassFile cf = ClassFile.read(is); - if (jarfile.isMultiRelease()) { + // exclude module-info.class since this jarFile is on classpath + if (jarfile.isMultiRelease() && !cf.getName().equals("module-info")) { VersionHelper.add(jarfile, e, cf); } return cf; @@ -437,5 +438,4 @@ public class ClassFileReader implements Closeable { throw new UnsupportedOperationException("Not supported yet."); } } - private static final String MODULE_INFO = "module-info.class"; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java index 514e2ef607a..d9a07700134 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/DependencyFinder.java @@ -268,7 +268,14 @@ class DependencyFinder { } return targets; } catch (InterruptedException|ExecutionException e) { - throw new Error(e); + Throwable cause = e.getCause(); + if (cause instanceof RuntimeException x) { + throw x; + } else if (cause instanceof Error x) { + throw x; + } else { + throw new Error(e); + } } } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java index 0341923f926..0943287b933 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/MultiReleaseException.java @@ -47,7 +47,7 @@ class MultiReleaseException extends RuntimeException { * The detail message array */ public MultiReleaseException(String key, Object... params) { - super(); + super(JdepsTask.getMessage(key, params)); this.key = key; this.params = params; } diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/VersionHelper.java b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/VersionHelper.java index 9ff358a63d3..227c9ccd264 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/VersionHelper.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/VersionHelper.java @@ -55,15 +55,10 @@ public class VersionHelper { String version = realName.substring(len, n); assert (Integer.parseInt(version) > 8); String name = cf.getName().replace('/', '.'); - if (nameToVersion.containsKey(name)) { - if (!version.equals(nameToVersion.get(name))) { - throw new MultiReleaseException( - "err.multirelease.version.associated", - name, nameToVersion.get(name), version - ); - } - } else { - nameToVersion.put(name, version); + String v = nameToVersion.computeIfAbsent(name, _n -> version); + if (!version.equals(v)) { + throw new MultiReleaseException("err.multirelease.version.associated", + name, nameToVersion.get(name), version); } } else { throw new MultiReleaseException("err.multirelease.jar.malformed", diff --git a/test/langtools/tools/jdeps/multiVersion/MultiVersionError.java b/test/langtools/tools/jdeps/multiVersion/MultiVersionError.java new file mode 100644 index 00000000000..62513406b71 --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/MultiVersionError.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021, 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 8277165 + * @library ../lib + * @build CompilerUtils + * @run testng MultiVersionError + * @summary Tests multiple versions of the same class file + */ + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Set; +import java.util.spi.ToolProvider; + +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertTrue; + +public class MultiVersionError { + private static final String TEST_SRC = System.getProperty("test.src"); + private static final Path SRC_DIR = Paths.get(TEST_SRC, "src"); + + private static final Path MODS_DIR = Paths.get("mods"); + + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar").orElseThrow(); + private static final Set modules = Set.of("m1", "m2"); + + /** + * Compiles classes used by the test + */ + @BeforeTest + public void compileAll() throws Exception { + CompilerUtils.cleanDir(MODS_DIR); + modules.forEach(mn -> + assertTrue(CompilerUtils.compileModule(SRC_DIR, MODS_DIR, mn))); + + // create a modular multi-release m1.jar + Path m1 = MODS_DIR.resolve("m1"); + Path m2 = MODS_DIR.resolve("m2"); + jar("cf", "m1.jar", "-C", m1.toString(), "p/Test.class", + "--release", "9", "-C", m1.toString(), "module-info.class", + "--release", "11", "-C", m1.toString(), "p/internal/P.class"); + jar("cf", "m2.jar", "-C", m2.toString(), "q/Q.class", + "--release", "10", "-C", m2.toString(), "module-info.class"); + + // package private p/internal/P.class in m1 instead + jar("cf", "m3.jar", "-C", m2.toString(), "q/Q.class", + "--release", "12", "-C", m2.toString(), "module-info.class", + "-C", m1.toString(), "p/internal/P.class"); + } + + /* + * multiple module-info.class from different versions should be excluded + * from multiple version check. + */ + @Test + public void noMultiVersionClass() { + // skip parsing p.internal.P to workaround JDK-8277681 + JdepsRunner jdepsRunner = new JdepsRunner("--print-module-deps", "--multi-release", "10", + "--ignore-missing-deps", + "--module-path", "m1.jar", "m2.jar"); + int rc = jdepsRunner.run(true); + assertTrue(rc == 0); + assertTrue(jdepsRunner.outputContains("java.base,m1")); + } + + /* + * Detect multiple versions of p.internal.P class + */ + @Test + public void classInMultiVersions() { + JdepsRunner jdepsRunner = new JdepsRunner("--print-module-deps", "--multi-release", "13", + "--module-path", "m1.jar", "m3.jar"); + int rc = jdepsRunner.run(true); + assertTrue(rc != 0); + assertTrue(jdepsRunner.outputContains("class p.internal.P already associated with version")); + } + + private static void jar(String... options) { + int rc = JAR_TOOL.run(System.out, System.err, options); + assertTrue(rc == 0); + } +} diff --git a/test/langtools/tools/jdeps/multiVersion/src/m1/module-info.java b/test/langtools/tools/jdeps/multiVersion/src/m1/module-info.java new file mode 100644 index 00000000000..316803466ca --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/src/m1/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021, 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. + */ + +module m1 { + requires java.management; + exports p; +} diff --git a/test/langtools/tools/jdeps/multiVersion/src/m1/p/Test.java b/test/langtools/tools/jdeps/multiVersion/src/m1/p/Test.java new file mode 100644 index 00000000000..e3d9139bbdd --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/src/m1/p/Test.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021, 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 p; + +public class Test { +} diff --git a/test/langtools/tools/jdeps/multiVersion/src/m1/p/internal/P.java b/test/langtools/tools/jdeps/multiVersion/src/m1/p/internal/P.java new file mode 100644 index 00000000000..3a14badd1d0 --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/src/m1/p/internal/P.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2021, 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 p.internal; + +import java.lang.management.*; + +class P { + private static RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean(); +} diff --git a/test/langtools/tools/jdeps/multiVersion/src/m2/module-info.java b/test/langtools/tools/jdeps/multiVersion/src/m2/module-info.java new file mode 100644 index 00000000000..5404ca47867 --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/src/m2/module-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021, 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. + */ + +module m2 { + requires m1; + requires java.logging; +} diff --git a/test/langtools/tools/jdeps/multiVersion/src/m2/p/internal/P.java b/test/langtools/tools/jdeps/multiVersion/src/m2/p/internal/P.java new file mode 100644 index 00000000000..d68265798bd --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/src/m2/p/internal/P.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2021, 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 p.internal; + +import java.util.logging.Logger; + +public class P { + private static final Logger LOGGER = Logger.getLogger("p"); +} diff --git a/test/langtools/tools/jdeps/multiVersion/src/m2/q/Q.java b/test/langtools/tools/jdeps/multiVersion/src/m2/q/Q.java new file mode 100644 index 00000000000..46cad1cc9d1 --- /dev/null +++ b/test/langtools/tools/jdeps/multiVersion/src/m2/q/Q.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021, 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 q; + +public class Q { + static p.Test t = new p.Test(); + + public Q() { + Object o = new p.internal.P(); + } +} -- GitLab From 3383c0dcc016715dcb350b6ba196a7cdc833cdc6 Mon Sep 17 00:00:00 2001 From: Stuart Monteith Date: Fri, 26 Nov 2021 09:02:58 +0000 Subject: [PATCH 480/890] 8277659: [TESTBUG] Microbenchmark ThreadOnSpinWaitProducerConsumer.java hangs Reviewed-by: njian, ngasson --- .../bench/java/lang/ThreadOnSpinWaitProducerConsumer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/micro/org/openjdk/bench/java/lang/ThreadOnSpinWaitProducerConsumer.java b/test/micro/org/openjdk/bench/java/lang/ThreadOnSpinWaitProducerConsumer.java index e111b77ab51..a4778838a84 100644 --- a/test/micro/org/openjdk/bench/java/lang/ThreadOnSpinWaitProducerConsumer.java +++ b/test/micro/org/openjdk/bench/java/lang/ThreadOnSpinWaitProducerConsumer.java @@ -193,6 +193,7 @@ public class ThreadOnSpinWaitProducerConsumer { } } threadConsumer.interrupt(); + threadConsumer.join(); if (producedDataCount != maxNum) { throw new RuntimeException("Produced: " + producedDataCount + ". Expected: " + maxNum); -- GitLab From 00a6238daed4a4aaa6001275ce620646cdabfeb5 Mon Sep 17 00:00:00 2001 From: Yadong Wang Date: Fri, 26 Nov 2021 09:09:02 +0000 Subject: [PATCH 481/890] 8277508: need to check has_predicated_vectors before calling scalable_predicate_reg_slots Reviewed-by: njian, thartmann, ngasson --- src/hotspot/share/opto/matcher.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/hotspot/share/opto/matcher.cpp b/src/hotspot/share/opto/matcher.cpp index fadfd11f2bf..21198087fd9 100644 --- a/src/hotspot/share/opto/matcher.cpp +++ b/src/hotspot/share/opto/matcher.cpp @@ -634,18 +634,20 @@ void Matcher::init_first_stack_mask() { if (Matcher::supports_scalable_vector()) { int k = 1; OptoReg::Name in = OptoReg::add(_in_arg_limit, -1); - // Exclude last input arg stack slots to avoid spilling vector register there, - // otherwise RegVectMask spills could stomp over stack slots in caller frame. - for (; (in >= init_in) && (k < scalable_predicate_reg_slots()); k++) { - scalable_stack_mask.Remove(in); - in = OptoReg::add(in, -1); - } + if (Matcher::has_predicated_vectors()) { + // Exclude last input arg stack slots to avoid spilling vector register there, + // otherwise RegVectMask spills could stomp over stack slots in caller frame. + for (; (in >= init_in) && (k < scalable_predicate_reg_slots()); k++) { + scalable_stack_mask.Remove(in); + in = OptoReg::add(in, -1); + } - // For RegVectMask - scalable_stack_mask.clear_to_sets(scalable_predicate_reg_slots()); - assert(scalable_stack_mask.is_AllStack(), "should be infinite stack"); - *idealreg2spillmask[Op_RegVectMask] = *idealreg2regmask[Op_RegVectMask]; - idealreg2spillmask[Op_RegVectMask]->OR(scalable_stack_mask); + // For RegVectMask + scalable_stack_mask.clear_to_sets(scalable_predicate_reg_slots()); + assert(scalable_stack_mask.is_AllStack(), "should be infinite stack"); + *idealreg2spillmask[Op_RegVectMask] = *idealreg2regmask[Op_RegVectMask]; + idealreg2spillmask[Op_RegVectMask]->OR(scalable_stack_mask); + } // Exclude last input arg stack slots to avoid spilling vector register there, // otherwise vector spills could stomp over stack slots in caller frame. -- GitLab From 99e4bda303f2c71972a125d0ecaf4cf986c8614a Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Fri, 26 Nov 2021 09:46:09 +0000 Subject: [PATCH 482/890] 8277417: C1 LIR instruction for load-klass Reviewed-by: iveresov, mdoerr, ngasson, aph --- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 29 ++++++++++-------- src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp | 21 +++++++++---- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 29 ++++++++++++++---- src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp | 23 ++++++++++---- src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp | 30 +++++++++++-------- src/hotspot/share/c1/c1_LIR.cpp | 22 ++++++++++++++ src/hotspot/share/c1/c1_LIR.hpp | 25 ++++++++++++++++ src/hotspot/share/c1/c1_LIRAssembler.hpp | 1 + src/hotspot/share/c1/c1_LIRGenerator.cpp | 17 ++++++----- src/hotspot/share/c1/c1_LIRGenerator.hpp | 2 ++ .../share/gc/shared/c1/barrierSetC1.cpp | 2 +- 11 files changed, 152 insertions(+), 49 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 1cae3a3f3b6..254ea0aaa98 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -986,14 +986,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch __ ldr(dest->as_register(), as_Address(from_addr)); break; case T_ADDRESS: - // FIXME: OMG this is a horrible kludge. Any offset from an - // address that matches klass_offset_in_bytes() will be loaded - // as a word, not a long. - if (UseCompressedClassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) { - __ ldrw(dest->as_register(), as_Address(from_addr)); - } else { - __ ldr(dest->as_register(), as_Address(from_addr)); - } + __ ldr(dest->as_register(), as_Address(from_addr)); break; case T_INT: __ ldrw(dest->as_register(), as_Address(from_addr)); @@ -1032,10 +1025,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch // Load barrier has not yet been applied, so ZGC can't verify the oop here __ verify_oop(dest->as_register()); } - } else if (type == T_ADDRESS && addr->disp() == oopDesc::klass_offset_in_bytes()) { - if (UseCompressedClassPointers) { - __ decode_klass_not_null(dest->as_register()); - } } } @@ -2593,6 +2582,22 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { __ bind(*op->stub()->continuation()); } +void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { + Register obj = op->obj()->as_pointer_register(); + Register result = op->result_opr()->as_pointer_register(); + + CodeEmitInfo* info = op->info(); + if (info != NULL) { + add_debug_info_for_null_check_here(info); + } + + if (UseCompressedClassPointers) { + __ ldrw(result, Address (obj, oopDesc::klass_offset_in_bytes())); + __ decode_klass_not_null(result); + } else { + __ ldr(result, Address (obj, oopDesc::klass_offset_in_bytes())); + } +} void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { ciMethod* method = op->profiled_method(); diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp index 4d6ce557d0a..3ec2db3b313 100644 --- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp @@ -720,11 +720,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, break; case T_ADDRESS: - if (UseCompressedClassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) { - __ ldr_u32(dest->as_pointer_register(), as_Address(addr)); - } else { - __ ldr(dest->as_pointer_register(), as_Address(addr)); - } + __ ldr(dest->as_pointer_register(), as_Address(addr)); break; case T_INT: @@ -2445,6 +2441,21 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { __ bind(*op->stub()->continuation()); } +void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { + Register obj = op->obj()->as_pointer_register(); + Register result = op->result_opr()->as_pointer_register(); + + CodeEmitInfo* info = op->info(); + if (info != NULL) { + add_debug_info_for_null_check_here(info); + } + + if (UseCompressedClassPointers) { // On 32 bit arm?? + __ ldr_u32(result, Address(obj, oopDesc::klass_offset_in_bytes())); + } else { + __ ldr(result, Address(obj, oopDesc::klass_offset_in_bytes())); + } +} void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { ciMethod* method = op->profiled_method(); diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index 831e2bdfe93..9492dadff4f 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -812,12 +812,7 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ 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); - } + __ ld(to_reg->as_register(), offset, base); break; case T_ARRAY : // fall through case T_OBJECT: @@ -2732,6 +2727,28 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { __ bind(*op->stub()->continuation()); } +void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { + Register obj = op->obj()->as_pointer_register(); + Register result = op->result_opr()->as_pointer_register(); + + CodeEmitInfo* info = op->info(); + if (info != NULL) { + if (info != NULL) { + if (!os::zero_page_read_protected() || !ImplicitNullChecks) { + explicit_null_check(obj, info); + } else { + add_debug_info_for_null_check_here(info); + } + } + } + + if (UseCompressedClassPointers) { + __ lwz(result, oopDesc::klass_offset_in_bytes(), obj); + __ decode_klass_not_null(result); + } else { + __ ld(result, oopDesc::klass_offset_in_bytes(), obj); + } +} void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { ciMethod* method = op->profiled_method(); diff --git a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp index 6971490e068..cb5903886ca 100644 --- a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp @@ -950,12 +950,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, LIR_P } break; case T_ADDRESS: - if (UseCompressedClassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) { - __ z_llgf(dest->as_register(), disp_value, disp_reg, src); - __ decode_klass_not_null(dest->as_register()); - } else { - __ z_lg(dest->as_register(), disp_value, disp_reg, src); - } + __ z_lg(dest->as_register(), disp_value, disp_reg, src); break; case T_ARRAY : // fall through case T_OBJECT: @@ -2754,6 +2749,22 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { __ bind(*op->stub()->continuation()); } +void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { + Register obj = op->obj()->as_pointer_register(); + Register result = op->result_opr()->as_pointer_register(); + + CodeEmitInfo* info = op->info(); + if (info != NULL) { + add_debug_info_for_null_check_here(info); + } + + if (UseCompressedClassPointers) { + __ z_llgf(result, Address(obj, oopDesc::klass_offset_in_bytes())); + __ decode_klass_not_null(result); + } else { + __ z_lg(result, Address(obj, oopDesc::klass_offset_in_bytes())); + } +} void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { ciMethod* method = op->profiled_method(); int bci = op->profiled_bci(); diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index 971c2515017..07f2762fa16 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -1184,7 +1184,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch LIR_Address* addr = src->as_address_ptr(); Address from_addr = as_Address(addr); - Register tmp_load_klass = LP64_ONLY(rscratch1) NOT_LP64(noreg); if (addr->base()->type() == T_OBJECT) { __ verify_oop(addr->base()->as_pointer_register()); @@ -1257,11 +1256,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch break; case T_ADDRESS: - if (UseCompressedClassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) { - __ movl(dest->as_register(), from_addr); - } else { - __ movptr(dest->as_register(), from_addr); - } + __ movptr(dest->as_register(), from_addr); break; case T_INT: __ movl(dest->as_register(), from_addr); @@ -1367,12 +1362,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch if (!UseZGC) { __ verify_oop(dest->as_register()); } - } else if (type == T_ADDRESS && addr->disp() == oopDesc::klass_offset_in_bytes()) { -#ifdef _LP64 - if (UseCompressedClassPointers) { - __ decode_klass_not_null(dest->as_register(), tmp_load_klass); - } -#endif } } @@ -3528,6 +3517,23 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { __ bind(*op->stub()->continuation()); } +void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { + Register obj = op->obj()->as_pointer_register(); + Register result = op->result_opr()->as_pointer_register(); + + CodeEmitInfo* info = op->info(); + if (info != NULL) { + add_debug_info_for_null_check_here(info); + } + +#ifdef _LP64 + if (UseCompressedClassPointers) { + __ movl(result, Address(obj, oopDesc::klass_offset_in_bytes())); + __ decode_klass_not_null(result, rscratch1); + } else +#endif + __ movptr(result, Address(obj, oopDesc::klass_offset_in_bytes())); +} void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { ciMethod* method = op->profiled_method(); diff --git a/src/hotspot/share/c1/c1_LIR.cpp b/src/hotspot/share/c1/c1_LIR.cpp index 4ab1d887e3f..c4e2b013387 100644 --- a/src/hotspot/share/c1/c1_LIR.cpp +++ b/src/hotspot/share/c1/c1_LIR.cpp @@ -880,6 +880,19 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } +// LIR_OpLoadKlass + case lir_load_klass: + { + LIR_OpLoadKlass* opLoadKlass = op->as_OpLoadKlass(); + assert(opLoadKlass != NULL, "must be"); + + do_input(opLoadKlass->_obj); + do_output(opLoadKlass->_result); + if (opLoadKlass->_info) do_info(opLoadKlass->_info); + break; + } + + // LIR_OpProfileCall: case lir_profile_call: { assert(op->as_OpProfileCall() != NULL, "must be"); @@ -1049,6 +1062,10 @@ void LIR_OpLock::emit_code(LIR_Assembler* masm) { } } +void LIR_OpLoadKlass::emit_code(LIR_Assembler* masm) { + masm->emit_load_klass(this); +} + #ifdef ASSERT void LIR_OpAssert::emit_code(LIR_Assembler* masm) { masm->emit_assert(this); @@ -1970,6 +1987,11 @@ void LIR_OpLock::print_instr(outputStream* out) const { out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry())); } +void LIR_OpLoadKlass::print_instr(outputStream* out) const { + obj()->print(out); out->print(" "); + result_opr()->print(out); out->print(" "); +} + #ifdef ASSERT void LIR_OpAssert::print_instr(outputStream* out) const { print_condition(out, condition()); out->print(" "); diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp index 9334ae273d0..d5eb62aab1f 100644 --- a/src/hotspot/share/c1/c1_LIR.hpp +++ b/src/hotspot/share/c1/c1_LIR.hpp @@ -895,6 +895,7 @@ class LIR_OpUpdateCRC32; class LIR_OpLock; class LIR_OpTypeCheck; class LIR_OpCompareAndSwap; +class LIR_OpLoadKlass; class LIR_OpProfileCall; class LIR_OpProfileType; #ifdef ASSERT @@ -939,6 +940,7 @@ enum LIR_Code { , lir_roundfp , lir_safepoint , lir_unwind + , lir_load_klass , end_op1 , begin_op2 , lir_cmp @@ -1148,6 +1150,7 @@ class LIR_Op: public CompilationResourceObj { virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; } virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; } + virtual LIR_OpLoadKlass* as_OpLoadKlass() { return NULL; } virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; } virtual LIR_OpProfileType* as_OpProfileType() { return NULL; } #ifdef ASSERT @@ -1820,6 +1823,25 @@ class LIR_OpLock: public LIR_Op { void print_instr(outputStream* out) const PRODUCT_RETURN; }; +class LIR_OpLoadKlass: public LIR_Op { + friend class LIR_OpVisitState; + + private: + LIR_Opr _obj; + CodeEmitInfo* _info; + public: + LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info) + : LIR_Op(lir_load_klass, result, NULL) + , _obj(obj) + , _info(info) {} + + LIR_Opr obj() const { return _obj; } + CodeEmitInfo* info() const { return _info; } + + virtual LIR_OpLoadKlass* as_OpLoadKlass() { return this; } + virtual void emit_code(LIR_Assembler* masm); + void print_instr(outputStream* out) const PRODUCT_RETURN; +}; class LIR_OpDelay: public LIR_Op { friend class LIR_OpVisitState; @@ -2262,6 +2284,9 @@ class LIR_List: public CompilationResourceObj { void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); } void xchg(LIR_Opr src, LIR_Opr set, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xchg, src, set, res, tmp)); } + + void load_klass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info) { append(new LIR_OpLoadKlass(obj, result, info)); } + #ifdef ASSERT void lir_assert(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, const char* msg, bool halt) { append(new LIR_OpAssert(condition, opr1, opr2, msg, halt)); } #endif diff --git a/src/hotspot/share/c1/c1_LIRAssembler.hpp b/src/hotspot/share/c1/c1_LIRAssembler.hpp index 683e9218462..f27ade60bae 100644 --- a/src/hotspot/share/c1/c1_LIRAssembler.hpp +++ b/src/hotspot/share/c1/c1_LIRAssembler.hpp @@ -197,6 +197,7 @@ class LIR_Assembler: public CompilationResourceObj { void emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, Label* failure, Label* obj_is_null); void emit_compare_and_swap(LIR_OpCompareAndSwap* op); void emit_lock(LIR_OpLock* op); + void emit_load_klass(LIR_OpLoadKlass* op); void emit_call(LIR_OpJavaCall* op); void emit_rtcall(LIR_OpRTCall* op); void emit_profile_call(LIR_OpProfileCall* op); diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index bca42cd7cf5..05aa3587ee2 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -1231,13 +1231,17 @@ void LIRGenerator::do_isInstance(Intrinsic* x) { __ move(call_result, result); } +void LIRGenerator::load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info) { + __ load_klass(obj, klass, null_check_info); +} + // Example: object.getClass () void LIRGenerator::do_getClass(Intrinsic* x) { assert(x->number_of_arguments() == 1, "wrong type"); LIRItem rcvr(x->argument_at(0), this); rcvr.load_item(); - LIR_Opr temp = new_register(T_METADATA); + LIR_Opr temp = new_register(T_ADDRESS); LIR_Opr result = rlock_result(x); // need to perform the null check on the rcvr @@ -1246,10 +1250,9 @@ void LIRGenerator::do_getClass(Intrinsic* x) { info = state_for(x); } - // FIXME T_ADDRESS should actually be T_METADATA but it can't because the - // meaning of these two is mixed up (see JDK-8026837). - __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), temp, info); - __ move_wide(new LIR_Address(temp, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), temp); + LIR_Opr klass = new_register(T_METADATA); + load_klass(rcvr.result(), klass, info); + __ move_wide(new LIR_Address(klass, in_bytes(Klass::java_mirror_offset()), T_ADDRESS), temp); // mirror = ((OopHandle)mirror)->resolve(); access_load(IN_NATIVE, T_OBJECT, LIR_OprFact::address(new LIR_Address(temp, T_OBJECT)), result); @@ -1322,7 +1325,7 @@ void LIRGenerator::do_getObjectSize(Intrinsic* x) { value.load_item(); LIR_Opr klass = new_register(T_METADATA); - __ move(new LIR_Address(value.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), klass, NULL); + load_klass(value.result(), klass, NULL); LIR_Opr layout = new_register(T_INT); __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout); @@ -3572,7 +3575,7 @@ LIR_Opr LIRGenerator::mask_boolean(LIR_Opr array, LIR_Opr value, CodeEmitInfo*& __ logical_and(value, LIR_OprFact::intConst(1), value_fixed); } LIR_Opr klass = new_register(T_METADATA); - __ move(new LIR_Address(array, oopDesc::klass_offset_in_bytes(), T_ADDRESS), klass, null_check_info); + load_klass(array, klass, null_check_info); null_check_info = NULL; LIR_Opr layout = new_register(T_INT); __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout); diff --git a/src/hotspot/share/c1/c1_LIRGenerator.hpp b/src/hotspot/share/c1/c1_LIRGenerator.hpp index ffe7108c34e..2c26e7714fd 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.hpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.hpp @@ -239,6 +239,8 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void move_to_phi(PhiResolver* resolver, Value cur_val, Value sux_val); void move_to_phi(ValueStack* cur_state); + void load_klass(LIR_Opr obj, LIR_Opr klass, CodeEmitInfo* null_check_info); + // platform dependent LIR_Opr getThreadPointer(); diff --git a/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp b/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp index 663ff91372b..b1828fcdb17 100644 --- a/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp +++ b/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp @@ -334,7 +334,7 @@ void BarrierSetC1::generate_referent_check(LIRAccess& access, LabelObj* cont) { if (gen_type_check) { // We have determined that offset == referent_offset && src != null. // if (src->_klass->_reference_type == REF_NONE) -> continue - __ move(new LIR_Address(base_reg, oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass); + gen->load_klass(base_reg, src_klass, NULL); LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE); LIR_Opr reference_type = gen->new_register(T_INT); __ move(reference_type_addr, reference_type); -- GitLab From 3e798dd40c68439f3220445e679b9e0e495435d8 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Fri, 26 Nov 2021 09:48:09 +0000 Subject: [PATCH 483/890] 8275330: C2: assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || def_block->dominates(block)) failed: uses must be dominated by definitions Reviewed-by: thartmann, chagedorn --- src/hotspot/share/opto/loopPredicate.cpp | 12 +-- src/hotspot/share/opto/loopTransform.cpp | 66 ++++++++++++---- src/hotspot/share/opto/loopnode.cpp | 8 +- src/hotspot/share/opto/loopnode.hpp | 19 ++--- src/hotspot/share/opto/macro.cpp | 14 ++++ src/hotspot/share/opto/opaquenode.cpp | 19 ----- src/hotspot/share/opto/opaquenode.hpp | 6 +- .../TestDeadPostLoopBecausePredicate.java | 79 +++++++++++++++++++ 8 files changed, 168 insertions(+), 55 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/loopopts/TestDeadPostLoopBecausePredicate.java diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 1378f80331f..8b590511f67 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -341,9 +341,9 @@ void PhaseIdealLoop::clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree* assert(predicate->is_Proj() && predicate->as_Proj()->is_IfProj(), "predicate must be a projection of an if node"); IfProjNode* predicate_proj = predicate->as_IfProj(); - ProjNode* fast_proj = clone_skeleton_predicate_for_unswitched_loops(iff, predicate_proj, uncommon_proj, reason, iffast_pred, loop); + ProjNode* fast_proj = clone_skeleton_predicate_for_unswitched_loops(iff, predicate_proj, reason, iffast_pred); assert(skeleton_predicate_has_opaque(fast_proj->in(0)->as_If()), "must find skeleton predicate for fast loop"); - ProjNode* slow_proj = clone_skeleton_predicate_for_unswitched_loops(iff, predicate_proj, uncommon_proj, reason, ifslow_pred, loop); + ProjNode* slow_proj = clone_skeleton_predicate_for_unswitched_loops(iff, predicate_proj, reason, ifslow_pred); assert(skeleton_predicate_has_opaque(slow_proj->in(0)->as_If()), "must find skeleton predicate for slow loop"); // Update control dependent data nodes. @@ -397,10 +397,10 @@ void PhaseIdealLoop::get_skeleton_predicates(Node* predicate, Unique_Node_List& // Clone a skeleton predicate for an unswitched loop. OpaqueLoopInit and OpaqueLoopStride nodes are cloned and uncommon // traps are kept for the predicate (a Halt node is used later when creating pre/main/post loops and copying this cloned // predicate again). -ProjNode* PhaseIdealLoop::clone_skeleton_predicate_for_unswitched_loops(Node* iff, ProjNode* predicate, Node* uncommon_proj, - Deoptimization::DeoptReason reason, ProjNode* output_proj, - IdealLoopTree* loop) { - Node* bol = clone_skeleton_predicate_bool(iff, NULL, NULL, predicate, uncommon_proj, output_proj, loop); +ProjNode* PhaseIdealLoop::clone_skeleton_predicate_for_unswitched_loops(Node* iff, ProjNode* predicate, + Deoptimization::DeoptReason reason, + ProjNode* output_proj) { + Node* bol = clone_skeleton_predicate_bool(iff, NULL, NULL, output_proj); ProjNode* proj = create_new_if_for_predicate(output_proj, NULL, reason, iff->Opcode(), predicate->is_IfTrue()); _igvn.replace_input_of(proj->in(0), 1, bol); _igvn.replace_input_of(output_proj->in(0), 0, proj); diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index bbfb5b12d08..00147d54ec7 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -1287,10 +1287,12 @@ void PhaseIdealLoop::copy_skeleton_predicates_to_main_loop_helper(Node* predicat // Clone the skeleton predicate twice and initialize one with the initial // value of the loop induction variable. Leave the other predicate // to be initialized when increasing the stride during loop unrolling. - prev_proj = clone_skeleton_predicate_for_main_loop(iff, opaque_init, NULL, predicate, uncommon_proj, current_proj, outer_loop, prev_proj); + prev_proj = clone_skeleton_predicate_for_main_or_post_loop(iff, opaque_init, NULL, predicate, uncommon_proj, + current_proj, outer_loop, prev_proj); assert(skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()), ""); - prev_proj = clone_skeleton_predicate_for_main_loop(iff, init, stride, predicate, uncommon_proj, current_proj, outer_loop, prev_proj); + prev_proj = clone_skeleton_predicate_for_main_or_post_loop(iff, init, stride, predicate, uncommon_proj, + current_proj, outer_loop, prev_proj); assert(!skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()), ""); // Rewire any control inputs from the cloned skeleton predicates down to the main and post loop for data nodes that are part of the @@ -1367,8 +1369,7 @@ bool PhaseIdealLoop::skeleton_predicate_has_opaque(IfNode* iff) { // Clone the skeleton predicate bool for a main or unswitched loop: // Main loop: Set new_init and new_stride nodes as new inputs. // Unswitched loop: new_init and new_stride are both NULL. Clone OpaqueLoopInit and OpaqueLoopStride instead. -Node* PhaseIdealLoop::clone_skeleton_predicate_bool(Node* iff, Node* new_init, Node* new_stride, Node* predicate, Node* uncommon_proj, - Node* control, IdealLoopTree* outer_loop) { +Node* PhaseIdealLoop::clone_skeleton_predicate_bool(Node* iff, Node* new_init, Node* new_stride, Node* control) { Node_Stack to_clone(2); to_clone.push(iff->in(1), 1); uint current = C->unique(); @@ -1444,9 +1445,9 @@ Node* PhaseIdealLoop::clone_skeleton_predicate_bool(Node* iff, Node* new_init, N // Clone a skeleton predicate for the main loop. new_init and new_stride are set as new inputs. Since the predicates cannot fail at runtime, // Halt nodes are inserted instead of uncommon traps. -Node* PhaseIdealLoop::clone_skeleton_predicate_for_main_loop(Node* iff, Node* new_init, Node* new_stride, Node* predicate, Node* uncommon_proj, - Node* control, IdealLoopTree* outer_loop, Node* input_proj) { - Node* result = clone_skeleton_predicate_bool(iff, new_init, new_stride, predicate, uncommon_proj, control, outer_loop); +Node* PhaseIdealLoop::clone_skeleton_predicate_for_main_or_post_loop(Node* iff, Node* new_init, Node* new_stride, Node* predicate, Node* uncommon_proj, + Node* control, IdealLoopTree* outer_loop, Node* input_proj) { + Node* result = clone_skeleton_predicate_bool(iff, new_init, new_stride, control); Node* proj = predicate->clone(); Node* other_proj = uncommon_proj->clone(); Node* new_iff = iff->clone(); @@ -1460,8 +1461,8 @@ Node* PhaseIdealLoop::clone_skeleton_predicate_for_main_loop(Node* iff, Node* ne C->root()->add_req(halt); new_iff->set_req(0, input_proj); - register_control(new_iff, outer_loop->_parent, input_proj); - register_control(proj, outer_loop->_parent, new_iff); + register_control(new_iff, outer_loop == _ltree_root ? _ltree_root : outer_loop->_parent, input_proj); + register_control(proj, outer_loop == _ltree_root ? _ltree_root : outer_loop->_parent, new_iff); register_control(other_proj, _ltree_root, new_iff); register_control(halt, _ltree_root, other_proj); return proj; @@ -1544,7 +1545,8 @@ void PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree *loop, Node_List &old_n // Add the post loop const uint idx_before_pre_post = Compile::current()->unique(); CountedLoopNode *post_head = NULL; - Node *main_exit = insert_post_loop(loop, old_new, main_head, main_end, incr, limit, post_head); + Node* post_incr = incr; + Node* main_exit = insert_post_loop(loop, old_new, main_head, main_end, post_incr, limit, post_head); const uint idx_after_post_before_pre = Compile::current()->unique(); //------------------------------ @@ -1643,6 +1645,7 @@ void PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree *loop, Node_List &old_n assert(post_head->in(1)->is_IfProj(), "must be zero-trip guard If node projection of the post loop"); copy_skeleton_predicates_to_main_loop(pre_head, castii, stride, outer_loop, outer_main_head, dd_main_head, idx_before_pre_post, idx_after_post_before_pre, min_taken, post_head->in(1), old_new); + copy_skeleton_predicates_to_post_loop(outer_main_head, post_head, post_incr, stride); // Step B4: Shorten the pre-loop to run only 1 iteration (for now). // RCE and alignment may change this later. @@ -1765,6 +1768,7 @@ void PhaseIdealLoop::insert_vector_post_loop(IdealLoopTree *loop, Node_List &old // In this case we throw away the result as we are not using it to connect anything else. CountedLoopNode *post_head = NULL; insert_post_loop(loop, old_new, main_head, main_end, incr, limit, post_head); + copy_skeleton_predicates_to_post_loop(main_head->skip_strip_mined(), post_head, incr, main_head->stride()); // It's difficult to be precise about the trip-counts // for post loops. They are usually very short, @@ -1811,6 +1815,7 @@ void PhaseIdealLoop::insert_scalar_rced_post_loop(IdealLoopTree *loop, Node_List // In this case we throw away the result as we are not using it to connect anything else. CountedLoopNode *post_head = NULL; insert_post_loop(loop, old_new, main_head, main_end, incr, limit, post_head); + copy_skeleton_predicates_to_post_loop(main_head->skip_strip_mined(), post_head, incr, main_head->stride()); // It's difficult to be precise about the trip-counts // for post loops. They are usually very short, @@ -1827,9 +1832,9 @@ void PhaseIdealLoop::insert_scalar_rced_post_loop(IdealLoopTree *loop, Node_List //------------------------------insert_post_loop------------------------------- // Insert post loops. Add a post loop to the given loop passed. -Node *PhaseIdealLoop::insert_post_loop(IdealLoopTree *loop, Node_List &old_new, - CountedLoopNode *main_head, CountedLoopEndNode *main_end, - Node *incr, Node *limit, CountedLoopNode *&post_head) { +Node *PhaseIdealLoop::insert_post_loop(IdealLoopTree* loop, Node_List& old_new, + CountedLoopNode* main_head, CountedLoopEndNode* main_end, + Node*& incr, Node* limit, CountedLoopNode*& post_head) { IfNode* outer_main_end = main_end; IdealLoopTree* outer_loop = loop; if (main_head->is_strip_mined()) { @@ -1913,8 +1918,8 @@ Node *PhaseIdealLoop::insert_post_loop(IdealLoopTree *loop, Node_List &old_new, } // CastII for the new post loop: - Node* castii = cast_incr_before_loop(zer_opaq->in(1), zer_taken, post_head); - assert(castii != NULL, "no castII inserted"); + incr = cast_incr_before_loop(zer_opaq->in(1), zer_taken, post_head); + assert(incr != NULL, "no castII inserted"); return new_main_exit; } @@ -1956,7 +1961,8 @@ void PhaseIdealLoop::update_main_loop_skeleton_predicates(Node* ctrl, CountedLoo _igvn.replace_input_of(iff, 1, iff->in(1)->in(2)); } else { // Add back predicates updated for the new stride. - prev_proj = clone_skeleton_predicate_for_main_loop(iff, init, max_value, entry, proj, ctrl, outer_loop, prev_proj); + prev_proj = clone_skeleton_predicate_for_main_or_post_loop(iff, init, max_value, entry, proj, ctrl, outer_loop, + prev_proj); assert(!skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()), "unexpected"); } } @@ -1968,6 +1974,34 @@ void PhaseIdealLoop::update_main_loop_skeleton_predicates(Node* ctrl, CountedLoo } } +void PhaseIdealLoop::copy_skeleton_predicates_to_post_loop(LoopNode* main_loop_head, CountedLoopNode* post_loop_head, Node* init, Node* stride) { + // Go over the skeleton predicates of the main loop and make a copy for the post loop with its initial iv value and + // stride as inputs. + Node* post_loop_entry = post_loop_head->in(LoopNode::EntryControl); + Node* main_loop_entry = main_loop_head->in(LoopNode::EntryControl); + IdealLoopTree* post_loop = get_loop(post_loop_head); + + Node* ctrl = main_loop_entry; + Node* prev_proj = post_loop_entry; + while (ctrl != NULL && ctrl->is_Proj() && ctrl->in(0)->is_If()) { + IfNode* iff = ctrl->in(0)->as_If(); + ProjNode* proj = iff->proj_out(1 - ctrl->as_Proj()->_con); + if (proj->unique_ctrl_out()->Opcode() != Op_Halt) { + break; + } + if (iff->in(1)->Opcode() == Op_Opaque4 && skeleton_predicate_has_opaque(iff)) { + prev_proj = clone_skeleton_predicate_for_main_or_post_loop(iff, init, stride, ctrl, proj, post_loop_entry, + post_loop, prev_proj); + assert(!skeleton_predicate_has_opaque(prev_proj->in(0)->as_If()), "unexpected"); + } + ctrl = ctrl->in(0)->in(0); + } + if (prev_proj != post_loop_entry) { + _igvn.replace_input_of(post_loop_head, LoopNode::EntryControl, prev_proj); + set_idom(post_loop_head, prev_proj, dom_depth(post_loop_head)); + } +} + //------------------------------do_unroll-------------------------------------- // Unroll the loop body one step - make each trip do 2 iterations. void PhaseIdealLoop::do_unroll(IdealLoopTree *loop, Node_List &old_new, bool adjust_min_trip) { diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index f77ddeea4ba..3e150b9cb94 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -2389,12 +2389,14 @@ Node* CountedLoopNode::skip_predicates_from_entry(Node* ctrl) { } Node* CountedLoopNode::skip_predicates() { + Node* ctrl = in(LoopNode::EntryControl); if (is_main_loop()) { - Node* ctrl = skip_strip_mined()->in(LoopNode::EntryControl); - + ctrl = skip_strip_mined()->in(LoopNode::EntryControl); + } + if (is_main_loop() || is_post_loop()) { return skip_predicates_from_entry(ctrl); } - return in(LoopNode::EntryControl); + return ctrl; } diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 35db18e0b6e..1fee41ba62a 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -917,13 +917,13 @@ private: void copy_skeleton_predicates_to_main_loop(CountedLoopNode* pre_head, Node* init, Node* stride, IdealLoopTree* outer_loop, LoopNode* outer_main_head, uint dd_main_head, const uint idx_before_pre_post, const uint idx_after_post_before_pre, Node* zero_trip_guard_proj_main, Node* zero_trip_guard_proj_post, const Node_List &old_new); - Node* clone_skeleton_predicate_for_main_loop(Node* iff, Node* new_init, Node* new_stride, Node* predicate, Node* uncommon_proj, Node* control, - IdealLoopTree* outer_loop, Node* input_proj); - Node* clone_skeleton_predicate_bool(Node* iff, Node* new_init, Node* new_stride, Node* predicate, Node* uncommon_proj, Node* control, - IdealLoopTree* outer_loop); + Node* clone_skeleton_predicate_for_main_or_post_loop(Node* iff, Node* new_init, Node* new_stride, Node* predicate, Node* uncommon_proj, Node* control, + IdealLoopTree* outer_loop, Node* input_proj); + Node* clone_skeleton_predicate_bool(Node* iff, Node* new_init, Node* new_stride, Node* control); static bool skeleton_predicate_has_opaque(IfNode* iff); static void get_skeleton_predicates(Node* predicate, Unique_Node_List& list, bool get_opaque = false); void update_main_loop_skeleton_predicates(Node* ctrl, CountedLoopNode* loop_head, Node* init, int stride_con); + void copy_skeleton_predicates_to_post_loop(LoopNode* main_loop_head, CountedLoopNode* post_loop_head, Node* init, Node* stride); void insert_loop_limit_check(ProjNode* limit_check_proj, Node* cmp_limit, Node* bol); #ifdef ASSERT bool only_has_infinite_loops(); @@ -1246,9 +1246,9 @@ public: void insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_new, bool peel_only ); // Add post loop after the given loop. - Node *insert_post_loop(IdealLoopTree *loop, Node_List &old_new, - CountedLoopNode *main_head, CountedLoopEndNode *main_end, - Node *incr, Node *limit, CountedLoopNode *&post_head); + Node *insert_post_loop(IdealLoopTree* loop, Node_List& old_new, + CountedLoopNode* main_head, CountedLoopEndNode* main_end, + Node*& incr, Node* limit, CountedLoopNode*& post_head); // Add an RCE'd post loop which we will multi-version adapt for run time test path usage void insert_scalar_rced_post_loop( IdealLoopTree *loop, Node_List &old_new ); @@ -1593,8 +1593,9 @@ private: Node_List* old_new = NULL); void clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree* loop, const Node_List& old_new, Deoptimization::DeoptReason reason, ProjNode* old_predicate_proj, ProjNode* iffast_pred, ProjNode* ifslow_pred); - ProjNode* clone_skeleton_predicate_for_unswitched_loops(Node* iff, ProjNode* predicate, Node* uncommon_proj, Deoptimization::DeoptReason reason, - ProjNode* output_proj, IdealLoopTree* loop); + ProjNode* clone_skeleton_predicate_for_unswitched_loops(Node* iff, ProjNode* predicate, + Deoptimization::DeoptReason reason, + ProjNode* output_proj); static void check_created_predicate_for_unswitching(const Node* new_entry) PRODUCT_RETURN; bool _created_loop_node; diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp index f7b6a9ea66b..1205d2007d7 100644 --- a/src/hotspot/share/opto/macro.cpp +++ b/src/hotspot/share/opto/macro.cpp @@ -2366,6 +2366,7 @@ void PhaseMacroExpand::eliminate_macro_nodes() { assert(n->Opcode() == Op_LoopLimit || n->Opcode() == Op_Opaque2 || n->Opcode() == Op_Opaque3 || + n->Opcode() == Op_Opaque4 || BarrierSet::barrier_set()->barrier_set_c2()->is_gc_barrier_node(n), "unknown node type in macro list"); } @@ -2427,6 +2428,19 @@ bool PhaseMacroExpand::expand_macro_nodes() { _igvn.replace_node(n, repl); success = true; #endif + } else if (n->Opcode() == Op_Opaque4) { + // With Opaque4 nodes, the expectation is that the test of input 1 + // is always equal to the constant value of input 2. So we can + // remove the Opaque4 and replace it by input 2. In debug builds, + // leave the non constant test in instead to sanity check that it + // never fails (if it does, that subgraph was constructed so, at + // runtime, a Halt node is executed). +#ifdef ASSERT + _igvn.replace_node(n, n->in(1)); +#else + _igvn.replace_node(n, n->in(2)); +#endif + success = true; } else if (n->Opcode() == Op_OuterStripMinedLoop) { n->as_OuterStripMinedLoop()->adjust_strip_mined_loop(&_igvn); C->remove_macro_node(n); diff --git a/src/hotspot/share/opto/opaquenode.cpp b/src/hotspot/share/opto/opaquenode.cpp index c1b769e2370..c66df16b2d0 100644 --- a/src/hotspot/share/opto/opaquenode.cpp +++ b/src/hotspot/share/opto/opaquenode.cpp @@ -60,25 +60,6 @@ bool Opaque2Node::cmp( const Node &n ) const { return (&n == this); // Always fail except on self } -Node* Opaque4Node::Identity(PhaseGVN* phase) { - if (phase->C->post_loop_opts_phase()) { - // With Opaque4 nodes, the expectation is that the test of input 1 - // is always equal to the constant value of input 2. So we can - // remove the Opaque4 and replace it by input 2. In debug builds, - // leave the non constant test in instead to sanity check that it - // never fails (if it does, that subgraph was constructed so, at - // runtime, a Halt node is executed). -#ifdef ASSERT - return this->in(1); -#else - return this->in(2); -#endif - } else { - phase->C->record_for_post_loop_opts_igvn(this); - } - return this; -} - const Type* Opaque4Node::Value(PhaseGVN* phase) const { return phase->type(in(1)); } diff --git a/src/hotspot/share/opto/opaquenode.hpp b/src/hotspot/share/opto/opaquenode.hpp index 160f814fd2d..cb7ff23764b 100644 --- a/src/hotspot/share/opto/opaquenode.hpp +++ b/src/hotspot/share/opto/opaquenode.hpp @@ -114,11 +114,13 @@ class Opaque3Node : public Opaque2Node { // GraphKit::must_be_not_null(). class Opaque4Node : public Node { public: - Opaque4Node(Compile* C, Node *tst, Node* final_tst) : Node(NULL, tst, final_tst) {} + Opaque4Node(Compile* C, Node *tst, Node* final_tst) : Node(NULL, tst, final_tst) { + init_flags(Flag_is_macro); + C->add_macro_node(this); + } virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::BOOL; } - virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const; }; diff --git a/test/hotspot/jtreg/compiler/loopopts/TestDeadPostLoopBecausePredicate.java b/test/hotspot/jtreg/compiler/loopopts/TestDeadPostLoopBecausePredicate.java new file mode 100644 index 00000000000..719de54204f --- /dev/null +++ b/test/hotspot/jtreg/compiler/loopopts/TestDeadPostLoopBecausePredicate.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021, 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. + */ + +/** + * @test + * @bug 8275330 + * @summary C2: assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || def_block->dominates(block)) failed: uses must be dominated by definitions + * + * @run main/othervm -Xmx512m -XX:+UnlockDiagnosticVMOptions -Xcomp -XX:CompileOnly=TestDeadPostLoopBecausePredicate TestDeadPostLoopBecausePredicate + * + */ + + +public class TestDeadPostLoopBecausePredicate { + + public static final int N = 400; + + public static int iFld=54270; + public static int iFld1=-4; + public int iFld2=201; + + public int mainTest(String[] strArr1) { + + int i=0, i17=8052, i19=22380, i20=60894, iArr[]=new int[N]; + init(iArr, 4); + + i = 1; + do { + for (i17 = 5; i17 < 114; i17++) { + switch ((i17 % 7) + 126) { + case 126: + for (i19 = 2; i19 > i; i19 -= 3) { + try { + i20 = (iFld2 % TestDeadPostLoopBecausePredicate.iFld1); + i20 = (iArr[i19 - 1] % TestDeadPostLoopBecausePredicate.iFld); + TestDeadPostLoopBecausePredicate.iFld = (TestDeadPostLoopBecausePredicate.iFld1 % iArr[i19]); + } catch (ArithmeticException a_e) {} + } + break; + } + } + } while (++i < 220); + + return i20; + } + + public static void init(int[] a, int seed) { + for (int j = 0; j < a.length; j++) { + a[j] = (j % 2 == 0) ? seed + j : seed - j; + } + } + + public static void main(String[] strArr) { + TestDeadPostLoopBecausePredicate _instance = new TestDeadPostLoopBecausePredicate(); + for (int i = 0; i < 10; i++ ) { + _instance.mainTest(strArr); + } + } +} -- GitLab From 040b2c52d3e82048630fbd45a7db48a5e65204b7 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Fri, 26 Nov 2021 09:52:10 +0000 Subject: [PATCH 484/890] 8277139: Improve code readability in PredecessorValidator (c1_IR.cpp) Reviewed-by: thartmann, chagedorn --- src/hotspot/share/c1/c1_IR.cpp | 101 +++++++++++++++++---------------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/src/hotspot/share/c1/c1_IR.cpp b/src/hotspot/share/c1/c1_IR.cpp index e4b9d86dcc3..0b7f7a2b2c1 100644 --- a/src/hotspot/share/c1/c1_IR.cpp +++ b/src/hotspot/share/c1/c1_IR.cpp @@ -1266,7 +1266,7 @@ typedef GrowableArray BlockListList; class PredecessorValidator : public BlockClosure { private: - BlockListList* _predecessors; + BlockListList* _predecessors; // Each index i will hold predecessors of block with id i BlockList* _blocks; static int cmp(BlockBegin** a, BlockBegin** b) { @@ -1277,71 +1277,74 @@ class PredecessorValidator : public BlockClosure { PredecessorValidator(IR* hir) { ResourceMark rm; _predecessors = new BlockListList(BlockBegin::number_of_blocks(), BlockBegin::number_of_blocks(), NULL); - _blocks = new BlockList(); + _blocks = new BlockList(BlockBegin::number_of_blocks()); - int i; hir->start()->iterate_preorder(this); if (hir->code() != NULL) { assert(hir->code()->length() == _blocks->length(), "must match"); - for (i = 0; i < _blocks->length(); i++) { + for (int i = 0; i < _blocks->length(); i++) { assert(hir->code()->contains(_blocks->at(i)), "should be in both lists"); } } - for (i = 0; i < _blocks->length(); i++) { + for (int i = 0; i < _blocks->length(); i++) { BlockBegin* block = _blocks->at(i); - BlockList* preds = _predecessors->at(block->block_id()); - if (preds == NULL) { - assert(block->number_of_preds() == 0, "should be the same"); - continue; - } - - // clone the pred list so we can mutate it - BlockList* pred_copy = new BlockList(); - int j; - for (j = 0; j < block->number_of_preds(); j++) { - pred_copy->append(block->pred_at(j)); - } - // sort them in the same order - preds->sort(cmp); - pred_copy->sort(cmp); - int length = MIN2(preds->length(), block->number_of_preds()); - for (j = 0; j < block->number_of_preds(); j++) { - assert(preds->at(j) == pred_copy->at(j), "must match"); - } - - assert(preds->length() == block->number_of_preds(), "should be the same"); + verify_block_preds_against_collected_preds(block); } } virtual void block_do(BlockBegin* block) { _blocks->append(block); - BlockEnd* be = block->end(); - int n = be->number_of_sux(); - int i; - for (i = 0; i < n; i++) { - BlockBegin* sux = be->sux_at(i); - assert(!sux->is_set(BlockBegin::exception_entry_flag), "must not be xhandler"); - - BlockList* preds = _predecessors->at_grow(sux->block_id(), NULL); - if (preds == NULL) { - preds = new BlockList(); - _predecessors->at_put(sux->block_id(), preds); - } - preds->append(block); + verify_successor_xentry_flag(block); + collect_predecessors(block); + } + + private: + void verify_successor_xentry_flag(const BlockBegin* block) const { + for (int i = 0; i < block->end()->number_of_sux(); i++) { + assert(!block->end()->sux_at(i)->is_set(BlockBegin::exception_entry_flag), "must not be xhandler"); + } + for (int i = 0; i < block->number_of_exception_handlers(); i++) { + assert(block->exception_handler_at(i)->is_set(BlockBegin::exception_entry_flag), "must be xhandler"); } + } - n = block->number_of_exception_handlers(); - for (i = 0; i < n; i++) { - BlockBegin* sux = block->exception_handler_at(i); - assert(sux->is_set(BlockBegin::exception_entry_flag), "must be xhandler"); + void collect_predecessors(BlockBegin* block) { + for (int i = 0; i < block->end()->number_of_sux(); i++) { + collect_predecessor(block, block->end()->sux_at(i)); + } + for (int i = 0; i < block->number_of_exception_handlers(); i++) { + collect_predecessor(block, block->exception_handler_at(i)); + } + } - BlockList* preds = _predecessors->at_grow(sux->block_id(), NULL); - if (preds == NULL) { - preds = new BlockList(); - _predecessors->at_put(sux->block_id(), preds); - } - preds->append(block); + void collect_predecessor(BlockBegin* const pred, const BlockBegin* sux) { + BlockList* preds = _predecessors->at_grow(sux->block_id(), NULL); + if (preds == NULL) { + preds = new BlockList(); + _predecessors->at_put(sux->block_id(), preds); + } + preds->append(pred); + } + + void verify_block_preds_against_collected_preds(const BlockBegin* block) const { + BlockList* preds = _predecessors->at(block->block_id()); + if (preds == NULL) { + assert(block->number_of_preds() == 0, "should be the same"); + return; + } + assert(preds->length() == block->number_of_preds(), "should be the same"); + + // clone the pred list so we can mutate it + BlockList* pred_copy = new BlockList(); + for (int j = 0; j < block->number_of_preds(); j++) { + pred_copy->append(block->pred_at(j)); + } + // sort them in the same order + preds->sort(cmp); + pred_copy->sort(cmp); + for (int j = 0; j < block->number_of_preds(); j++) { + assert(preds->at(j) == pred_copy->at(j), "must match"); } } }; -- GitLab From ce0234b47d5c40e74dac368396e92cdec5cc2de7 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Fri, 26 Nov 2021 14:54:09 +0000 Subject: [PATCH 485/890] 8277860: PPC: Remove duplicate info != NULL check Reviewed-by: chagedorn, mdoerr --- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index 9492dadff4f..23e03cb36e3 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -2733,12 +2733,10 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { CodeEmitInfo* info = op->info(); if (info != NULL) { - if (info != NULL) { - if (!os::zero_page_read_protected() || !ImplicitNullChecks) { - explicit_null_check(obj, info); - } else { - add_debug_info_for_null_check_here(info); - } + if (!os::zero_page_read_protected() || !ImplicitNullChecks) { + explicit_null_check(obj, info); + } else { + add_debug_info_for_null_check_here(info); } } -- GitLab From 3d810ad6912b7bca03e212b604cf60412da11c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Fri, 26 Nov 2021 14:55:02 +0000 Subject: [PATCH 486/890] 8277411: C2 fast_unlock intrinsic on AArch64 has unnecessary ownership check Reviewed-by: ngasson, neliasso --- src/hotspot/cpu/aarch64/aarch64.ad | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index f0dff9cf8bb..1f1a2172934 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -4007,19 +4007,15 @@ encode %{ __ bind(object_has_monitor); STATIC_ASSERT(markWord::monitor_value <= INT_MAX); __ add(tmp, tmp, -(int)markWord::monitor_value); // monitor - __ ldr(rscratch1, Address(tmp, ObjectMonitor::owner_offset_in_bytes())); __ ldr(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset_in_bytes())); Label notRecursive; - __ cmp(rscratch1, rthread); - __ br(Assembler::NE, cont); - __ cbz(disp_hdr, notRecursive); // Recursive lock __ sub(disp_hdr, disp_hdr, 1u); __ str(disp_hdr, Address(tmp, ObjectMonitor::recursions_offset_in_bytes())); - // flag == EQ was set in the ownership check above + __ cmp(disp_hdr, disp_hdr); // Sets flags for result __ b(cont); __ bind(notRecursive); -- GitLab From 40fef2311c95eca0ec34652f9fc0e56b827b8380 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Fri, 26 Nov 2021 16:21:15 +0000 Subject: [PATCH 487/890] 8275908: Record null_check traps for calls and array_check traps in the interpreter Reviewed-by: chagedorn, mdoerr --- .../share/interpreter/interpreterRuntime.cpp | 19 +- src/hotspot/share/opto/graphKit.cpp | 19 +- src/hotspot/share/prims/whitebox.cpp | 73 +++++ src/hotspot/share/runtime/deoptimization.cpp | 32 ++ src/hotspot/share/runtime/deoptimization.hpp | 1 + .../OptimizeImplicitExceptions.java | 275 ++++++++++++++++++ .../compiler/uncommontrap/Decompile.java | 166 +++++++++++ test/lib/jdk/test/whitebox/WhiteBox.java | 30 ++ test/lib/sun/hotspot/WhiteBox.java | 30 ++ 9 files changed, 636 insertions(+), 9 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java create mode 100644 test/hotspot/jtreg/compiler/uncommontrap/Decompile.java diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index 6b178d62560..5e61410ddc2 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -407,7 +407,11 @@ JRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* current, // lookup exception klass TempNewSymbol s = SymbolTable::new_symbol(name); if (ProfileTraps) { - note_trap(current, Deoptimization::Reason_class_check); + if (s == vmSymbols::java_lang_ArrayStoreException()) { + note_trap(current, Deoptimization::Reason_array_check); + } else { + note_trap(current, Deoptimization::Reason_class_check); + } } // create exception, with klass name as detail message Handle exception = Exceptions::new_exception(current, s, klass_name); @@ -825,7 +829,18 @@ void InterpreterRuntime::resolve_invoke(JavaThread* current, Bytecodes::Code byt JavaThread* THREAD = current; // For exception macros. LinkResolver::resolve_invoke(info, receiver, pool, last_frame.get_index_u2_cpcache(bytecode), bytecode, - CHECK); + THREAD); + + if (HAS_PENDING_EXCEPTION) { + if (ProfileTraps && PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_NullPointerException()) { + // Preserve the original exception across the call to note_trap() + PreserveExceptionMark pm(current); + // Recording the trap will help the compiler to potentially recognize this exception as "hot" + note_trap(current, Deoptimization::Reason_null_check); + } + return; + } + if (JvmtiExport::can_hotswap_or_post_breakpoint() && info.resolved_method()->is_old()) { resolved_method = methodHandle(current, info.resolved_method()->get_new_method()); } else { diff --git a/src/hotspot/share/opto/graphKit.cpp b/src/hotspot/share/opto/graphKit.cpp index cafbc0aaa7c..10939bcee63 100644 --- a/src/hotspot/share/opto/graphKit.cpp +++ b/src/hotspot/share/opto/graphKit.cpp @@ -580,11 +580,10 @@ void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) { ex_obj = env()->ArrayIndexOutOfBoundsException_instance(); break; case Deoptimization::Reason_class_check: - if (java_bc() == Bytecodes::_aastore) { - ex_obj = env()->ArrayStoreException_instance(); - } else { - ex_obj = env()->ClassCastException_instance(); - } + ex_obj = env()->ClassCastException_instance(); + break; + case Deoptimization::Reason_array_check: + ex_obj = env()->ArrayStoreException_instance(); break; default: break; @@ -3340,7 +3339,10 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass, // It needs a null check because a null will *pass* the cast check. // A non-null value will always produce an exception. if (!objtp->maybe_null()) { - builtin_throw(Deoptimization::Reason_class_check, makecon(TypeKlassPtr::make(objtp->klass()))); + bool is_aastore = (java_bc() == Bytecodes::_aastore); + Deoptimization::DeoptReason reason = is_aastore ? + Deoptimization::Reason_array_check : Deoptimization::Reason_class_check; + builtin_throw(reason, makecon(TypeKlassPtr::make(objtp->klass()))); return top(); } else if (!too_many_traps_or_recompiles(Deoptimization::Reason_null_assert)) { return null_assert(obj); @@ -3422,7 +3424,10 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass, if (not_subtype_ctrl != top()) { // If failure is possible PreserveJVMState pjvms(this); set_control(not_subtype_ctrl); - builtin_throw(Deoptimization::Reason_class_check, load_object_klass(not_null_obj)); + bool is_aastore = (java_bc() == Bytecodes::_aastore); + Deoptimization::DeoptReason reason = is_aastore ? + Deoptimization::Reason_array_check : Deoptimization::Reason_class_check; + builtin_throw(reason, load_object_klass(not_null_obj)); } } else { (*failure_control) = not_subtype_ctrl; diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 995123c1ef9..4411ddc802d 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -955,6 +955,72 @@ WB_ENTRY(void, WB_MakeMethodNotCompilable(JNIEnv* env, jobject o, jobject method } WB_END +WB_ENTRY(jint, WB_GetMethodDecompileCount(JNIEnv* env, jobject o, jobject method)) + jmethodID jmid = reflected_method_to_jmid(thread, env, method); + CHECK_JNI_EXCEPTION_(env, 0); + methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); + uint cnt = 0; + MethodData* mdo = mh->method_data(); + if (mdo != NULL) { + cnt = mdo->decompile_count(); + } + return cnt; +WB_END + +// Get the trap count of a method for a specific reason. If the trap count for +// that reason did overflow, this includes the overflow trap count of the method. +// If 'reason' is NULL, the sum of the traps for all reasons will be returned. +// This number includes the overflow trap count if the trap count for any reason +// did overflow. +WB_ENTRY(jint, WB_GetMethodTrapCount(JNIEnv* env, jobject o, jobject method, jstring reason_obj)) + jmethodID jmid = reflected_method_to_jmid(thread, env, method); + CHECK_JNI_EXCEPTION_(env, 0); + methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); + uint cnt = 0; + MethodData* mdo = mh->method_data(); + if (mdo != NULL) { + ResourceMark rm(THREAD); + char* reason_str = (reason_obj == NULL) ? + NULL : java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(reason_obj)); + bool overflow = false; + for (uint reason = 0; reason < mdo->trap_reason_limit(); reason++) { + if (reason_str != NULL && !strcmp(reason_str, Deoptimization::trap_reason_name(reason))) { + cnt = mdo->trap_count(reason); + // Count in the overflow trap count on overflow + if (cnt == (uint)-1) { + cnt = mdo->trap_count_limit() + mdo->overflow_trap_count(); + } + break; + } else if (reason_str == NULL) { + uint c = mdo->trap_count(reason); + if (c == (uint)-1) { + c = mdo->trap_count_limit(); + if (!overflow) { + // Count overflow trap count just once + overflow = true; + c += mdo->overflow_trap_count(); + } + } + cnt += c; + } + } + } + return cnt; +WB_END + +WB_ENTRY(jint, WB_GetDeoptCount(JNIEnv* env, jobject o, jstring reason_obj, jstring action_obj)) + if (reason_obj == NULL && action_obj == NULL) { + return Deoptimization::total_deoptimization_count(); + } + ResourceMark rm(THREAD); + const char *reason_str = (reason_obj == NULL) ? + NULL : java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(reason_obj)); + const char *action_str = (action_obj == NULL) ? + NULL : java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(action_obj)); + + return Deoptimization::deoptimization_count(reason_str, action_str); +WB_END + WB_ENTRY(jint, WB_GetMethodEntryBci(JNIEnv* env, jobject o, jobject method)) jmethodID jmid = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, InvocationEntryBci); @@ -2527,6 +2593,13 @@ static JNINativeMethod methods[] = { CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetDontInlineMethod}, {CC"getMethodCompilationLevel0", CC"(Ljava/lang/reflect/Executable;Z)I", (void*)&WB_GetMethodCompilationLevel}, + {CC"getMethodDecompileCount0", + CC"(Ljava/lang/reflect/Executable;)I", (void*)&WB_GetMethodDecompileCount}, + {CC"getMethodTrapCount0", + CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)I", + (void*)&WB_GetMethodTrapCount}, + {CC"getDeoptCount0", + CC"(Ljava/lang/String;Ljava/lang/String;)I", (void*)&WB_GetDeoptCount}, {CC"getMethodEntryBci0", CC"(Ljava/lang/reflect/Executable;)I", (void*)&WB_GetMethodEntryBci}, {CC"getCompileQueueSize", diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index d5449203251..054d0ac9ffe 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -2608,6 +2608,30 @@ jint Deoptimization::total_deoptimization_count() { return _deoptimization_hist[Reason_none][0][0]; } +// Get the deopt count for a specific reason and a specific action. If either +// one of 'reason' or 'action' is null, the method returns the sum of all +// deoptimizations with the specific 'action' or 'reason' respectively. +// If both arguments are null, the method returns the total deopt count. +jint Deoptimization::deoptimization_count(const char *reason_str, const char *action_str) { + if (reason_str == NULL && action_str == NULL) { + return total_deoptimization_count(); + } + juint counter = 0; + for (int reason = 0; reason < Reason_LIMIT; reason++) { + if (reason_str == NULL || !strcmp(reason_str, trap_reason_name(reason))) { + for (int action = 0; action < Action_LIMIT; action++) { + if (action_str == NULL || !strcmp(action_str, trap_action_name(action))) { + juint* cases = _deoptimization_hist[reason][1+action]; + for (int bc_case = 0; bc_case < BC_CASE_LIMIT; bc_case++) { + counter += cases[bc_case] >> LSB_BITS; + } + } + } + } + } + return counter; +} + void Deoptimization::print_statistics() { juint total = total_deoptimization_count(); juint account = total; @@ -2661,6 +2685,14 @@ const char* Deoptimization::trap_reason_name(int reason) { return "unknown"; } +jint Deoptimization::total_deoptimization_count() { + return 0; +} + +jint Deoptimization::deoptimization_count(const char *reason_str, const char *action_str) { + return 0; +} + void Deoptimization::print_statistics() { // no output } diff --git a/src/hotspot/share/runtime/deoptimization.hpp b/src/hotspot/share/runtime/deoptimization.hpp index af176ce41fd..74b78a853b4 100644 --- a/src/hotspot/share/runtime/deoptimization.hpp +++ b/src/hotspot/share/runtime/deoptimization.hpp @@ -433,6 +433,7 @@ class Deoptimization : AllStatic { int trap_request); static jint total_deoptimization_count(); + static jint deoptimization_count(const char* reason_str, const char* action_str); // JVMTI PopFrame support diff --git a/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java b/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java new file mode 100644 index 00000000000..1917fc68c5d --- /dev/null +++ b/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java @@ -0,0 +1,275 @@ +/* + * Copyright Amazon.com Inc. 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 8275908 + * @summary Record null_check traps for calls and array_check traps in the interpreter + * + * @requires vm.compiler2.enabled & vm.compMode != "Xcomp" + * + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+UseSerialGC -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,compiler.exceptions.OptimizeImplicitExceptions::throwImplicitException + * compiler.exceptions.OptimizeImplicitExceptions + */ + +package compiler.exceptions; + +import java.lang.reflect.Method; +import java.util.HashMap; + +import jdk.test.lib.Asserts; +import jdk.test.whitebox.WhiteBox; + +public class OptimizeImplicitExceptions { + // ImplicitException represents the various implicit (aka. 'built-in') exceptions + // which can be thrown implicitely by the JVM when executing bytecodes. + public enum ImplicitException { + // NullPointerException during field access + NULL_POINTER_EXCEPTION("null_check"), + // NullPointerException during invoke + INVOKE_NULL_POINTER_EXCEPTION("null_check"), + ARITHMETIC_EXCEPTION("div0_check"), + ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION("range_check"), + ARRAY_STORE_EXCEPTION("array_check"), + CLASS_CAST_EXCEPTION("class_check"); + private final String reason; + ImplicitException(String reason) { + this.reason = reason; + } + public String getReason() { + return reason; + } + } + // TestMode represents a specific combination of the OmitStackTraceInFastThrow command line options. + // They will be set up in 'setFlags(TestMode testMode)' before a new test run starts. + public enum TestMode { + OMIT_STACKTRACES_IN_FASTTHROW, + STACKTRACES_IN_FASTTHROW + } + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + // The number of deoptimizations after which a method will be made not-entrant + private static final int PerBytecodeTrapLimit = WB.getIntxVMFlag("PerBytecodeTrapLimit").intValue(); + // The number of interpreter invocations after which a decompiled method will be re-compiled. + private static final int Tier0InvokeNotifyFreq = (int)Math.pow(2, WB.getIntxVMFlag("Tier0InvokeNotifyFreqLog")); + // The following variables are used to track the value of the global deopt counters between the various test phases. + private static int oldDeoptCount = 0; + private static HashMap oldDeoptCountReason = new HashMap(ImplicitException.values().length); + // The following two objects are declared statically to simplify the test method. + private static String[] string_a = new String[1]; + private static final Object o = new Object(); + + // This is the main test method. It will repeatedly called with the same ImplicitException 'type' to + // JIT-compile it, deoptimized it, re-compile it again and do various checks on the way. + // This process will be repeated then for each kind of ImplicitException 'type'. + public static Object throwImplicitException(ImplicitException type, Object[] object_a) { + switch (type) { + case NULL_POINTER_EXCEPTION: { + return object_a.length; + } + case INVOKE_NULL_POINTER_EXCEPTION: { + return object_a.hashCode(); + } + case ARITHMETIC_EXCEPTION: { + return ((42 / (object_a.length - 1)) > 2) ? null : object_a[0]; + } + case ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION: { + return object_a[5]; + } + case ARRAY_STORE_EXCEPTION: { + return (object_a[0] = o); + } + case CLASS_CAST_EXCEPTION: { + return (ImplicitException[])object_a; + } + } + return null; + } + + // Completely unload (i.e. make "not-entrant"->"zombie"->"unload/free") a JIT-compiled + // version of a method and clear the method's profiling counters. + private static void unloadAndClean(Method m) { + WB.deoptimizeMethod(m); // Makes the nmethod "not entrant". + WB.forceNMethodSweep(); // Makes all "not entrant" nmethods "zombie". This requires + WB.forceNMethodSweep(); // two sweeps, see 'nmethod::can_convert_to_zombie()' for why. + WB.forceNMethodSweep(); // Need third sweep to actually unload/free all "zombie" nmethods. + System.gc(); + WB.clearMethodState(m); + } + + // Set '-XX' flags according to 'TestMode' + private static void setFlags(TestMode testMode) { + if (testMode == TestMode.OMIT_STACKTRACES_IN_FASTTHROW) { + WB.setBooleanVMFlag("OmitStackTraceInFastThrow", true); + } else { + WB.setBooleanVMFlag("OmitStackTraceInFastThrow", false); + } + + System.out.println("=========================================================="); + System.out.println("testMode=" + testMode + + " OmitStackTraceInFastThrow=" + WB.getBooleanVMFlag("OmitStackTraceInFastThrow")); + System.out.println("=========================================================="); + } + + private static void printCounters(TestMode testMode, ImplicitException impExcp, Method throwImplicitException_m, int invocations) { + System.out.println("testMode=" + testMode + " exception=" + impExcp + " invocations=" + invocations + "\n" + + "decompilecount=" + WB.getMethodDecompileCount(throwImplicitException_m) + " " + + "trapCount=" + WB.getMethodTrapCount(throwImplicitException_m) + " " + + "trapCount(" + impExcp.getReason() + ")=" + + WB.getMethodTrapCount(throwImplicitException_m, impExcp.getReason()) + " " + + "globalDeoptCount=" + WB.getDeoptCount() + " " + + "globalDeoptCount(" + impExcp.getReason() + ")=" + WB.getDeoptCount(impExcp.getReason(), null)); + System.out.println("method compiled=" + WB.isMethodCompiled(throwImplicitException_m)); + } + + // Checks after the test method has been JIT-compiled but before the compiled version has been invoked. + private static void checkSimple(TestMode testMode, ImplicitException impExcp, Exception ex, Method throwImplicitException_m, int invocations) { + + printCounters(testMode, impExcp, throwImplicitException_m, invocations); + // At this point, throwImplicitException() has been compiled but the compiled version has not been invoked yet. + Asserts.assertEQ(WB.getMethodCompilationLevel(throwImplicitException_m), 4, "Method should be compiled at level 4."); + + int trapCount = WB.getMethodTrapCount(throwImplicitException_m); + int trapCountSpecific = WB.getMethodTrapCount(throwImplicitException_m, impExcp.getReason()); + Asserts.assertEQ(trapCount, invocations, "Trap count must much invocation count."); + Asserts.assertEQ(trapCountSpecific, invocations, "Trap count must much invocation count."); + Asserts.assertNotNull(ex.getMessage(), "Exceptions thrown in the interpreter should have a message."); + } + + // Checks after the JIT-compiled test method has been invoked 'invocations' times. + private static void check(TestMode testMode, ImplicitException impExcp, Exception ex, + Method throwImplicitException_m, int invocations, int totalInvocations) { + + printCounters(testMode, impExcp, throwImplicitException_m, totalInvocations); + // At this point, the compiled version of 'throwImplicitException()' has been invoked 'invocations' times. + Asserts.assertEQ(WB.getMethodCompilationLevel(throwImplicitException_m), 4, "Method should be compiled at level 4."); + int deoptCount = WB.getDeoptCount(); + int deoptCountReason = WB.getDeoptCount(impExcp.getReason(), null/*action*/); + if (testMode == TestMode.OMIT_STACKTRACES_IN_FASTTHROW) { + // No deoptimizations for '-XX:+OmitStackTraceInFastThrow' + Asserts.assertEQ(oldDeoptCount, deoptCount, "Wrong number of deoptimizations."); + Asserts.assertEQ(oldDeoptCountReason.get(impExcp.getReason()), deoptCountReason, "Wrong number of deoptimizations."); + // '-XX:+OmitStackTraceInFastThrow' never has message because it is using a global singleton exception. + Asserts.assertNull(ex.getMessage(), "Optimized exceptions have no message."); + } else if (testMode == TestMode.STACKTRACES_IN_FASTTHROW) { + // We always deoptimize for '-XX:-OmitStackTraceInFastThrow + Asserts.assertEQ(oldDeoptCount + invocations, deoptCount, "Wrong number of deoptimizations."); + Asserts.assertEQ(oldDeoptCountReason.get(impExcp.getReason()) + invocations, deoptCountReason, "Wrong number of deoptimizations."); + Asserts.assertNotNull(ex.getMessage(), "Exceptions thrown in the interpreter should have a message."); + } else { + Asserts.fail("Unknown test mode."); + } + oldDeoptCount = deoptCount; + oldDeoptCountReason.put(impExcp.getReason(), deoptCountReason); + } + + public static void main(String[] args) throws Exception { + + if (!WB.getBooleanVMFlag("ProfileTraps")) { + // The fast-throw optimzation only works if we're running with -XX:+ProfileTraps + return; + } + + // Initialize global deopt counts to zero. + for (ImplicitException impExcp : ImplicitException.values()) { + oldDeoptCountReason.put(impExcp.getReason(), 0); + } + // Get a handle of the test method for usage with the WhiteBox API. + Method throwImplicitException_m = OptimizeImplicitExceptions.class + .getDeclaredMethod("throwImplicitException", new Class[] { ImplicitException.class, Object[].class}); + + for (TestMode testMode : TestMode.values()) { + setFlags(testMode); + for (ImplicitException impExcp : ImplicitException.values()) { + int invocations = 0; + Exception lastException = null; + + // Warmup and compile, but don't invoke compiled code. + while(!WB.isMethodCompiled(throwImplicitException_m)) { + invocations++; + try { + throwImplicitException(impExcp, impExcp.getReason().equals("null_check") ? null : string_a); + } catch (Exception catchedExcp) { + lastException = catchedExcp; + continue; + } + throw new Exception("Should not happen"); + } + + checkSimple(testMode, impExcp, lastException, throwImplicitException_m, invocations); + + // Invoke compiled code 'PerBytecodeTrapLimit' times. + for (int i = 0; i < PerBytecodeTrapLimit; i++) { + invocations++; + try { + throwImplicitException(impExcp, impExcp.getReason().equals("null_check") ? null : string_a); + } catch (Exception catchedExcp) { + lastException = catchedExcp; + continue; + } + throw new Exception("Should not happen"); + } + + check(testMode, impExcp, lastException, throwImplicitException_m, PerBytecodeTrapLimit, invocations); + + // Invoke compiled code 'Tier0InvokeNotifyFreq' times. + // If the method was de-compiled before, this will re-compile it again. + for (int i = 0; i < Tier0InvokeNotifyFreq; i++) { + invocations++; + try { + throwImplicitException(impExcp, impExcp.getReason().equals("null_check") ? null : string_a); + } catch (Exception catchedExcp) { + lastException = catchedExcp; + continue; + } + throw new Exception("Should not happen"); + } + + check(testMode, impExcp, lastException, throwImplicitException_m, Tier0InvokeNotifyFreq, invocations); + + // Invoke compiled code 'PerBytecodeTrapLimit' times. + for (int i = 0; i < PerBytecodeTrapLimit; i++) { + invocations++; + try { + throwImplicitException(impExcp, impExcp.getReason().equals("null_check") ? null : string_a); + } catch (Exception catchedExcp) { + lastException = catchedExcp; + continue; + } + throw new Exception("Should not happen"); + } + + check(testMode, impExcp, lastException, throwImplicitException_m, PerBytecodeTrapLimit, invocations); + + System.out.println("------------------------------------------------------------------"); + + unloadAndClean(throwImplicitException_m); + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java b/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java new file mode 100644 index 00000000000..829612b8b12 --- /dev/null +++ b/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java @@ -0,0 +1,166 @@ +/* + * Copyright Amazon.com Inc. 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 8275908 + * @summary Quick test for the new WhiteBox methods of JDK-8275908 + * + * @requires vm.compiler2.enabled & vm.compMode != "Xcomp" + * + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+UseSerialGC -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,compiler.uncommontrap.Decompile::uncommonTrap + * -XX:CompileCommand=inline,compiler.uncommontrap.Decompile*::foo + * compiler.uncommontrap.Decompile + */ + +package compiler.uncommontrap; + +import java.lang.reflect.Method; + +import jdk.test.lib.Asserts; +import jdk.test.whitebox.WhiteBox; + +public class Decompile { + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + // The number of deoptimizations after which a method will be made not-entrant + private static final int PerBytecodeTrapLimit = WB.getIntxVMFlag("PerBytecodeTrapLimit").intValue(); + // The number of interpreter invocations after which a decompiled method will be re-compiled. + private static final int Tier0InvokeNotifyFreq = (int)Math.pow(2, WB.getIntxVMFlag("Tier0InvokeNotifyFreqLog")); + // VM builds without JVMCI like x86_32 call the bimorphic inlining trap just 'bimorphic' + // while all the other builds with JVMCI call it 'bimorphic_or_optimized_type_check'. + private static final boolean isJVMCISupported = WhiteBox.getWhiteBox().isJVMCISupportedByGC(); + private static final String bimorphicTrapName = isJVMCISupported ? "bimorphic_or_optimized_type_check" : "bimorphic"; + + static class Base { + void foo() {} + } + static class X extends Base { + void foo() {} + } + static class Y extends Base { + void foo() {} + } + + static void uncommonTrap(Base t) { + t.foo(); + } + + private static void printCounters(Method uncommonTrap_m, int invocations) { + System.out.println("-----------------------------------------------------------------"); + System.out.println("invocations=" + invocations + " " + + "method compiled=" + WB.isMethodCompiled(uncommonTrap_m) + " " + + "decompileCount=" + WB.getMethodDecompileCount(uncommonTrap_m) + "\n" + + "trapCount=" + WB.getMethodTrapCount(uncommonTrap_m) + " " + + "trapCount(class_check)=" + WB.getMethodTrapCount(uncommonTrap_m, "class_check") + " " + + "trapCount(" + bimorphicTrapName + ")=" + + WB.getMethodTrapCount(uncommonTrap_m, bimorphicTrapName) + "\n" + + "globalDeoptCount=" + WB.getDeoptCount() + " " + + "globalDeoptCount(class_check)=" + WB.getDeoptCount("class_check", null) + " " + + "globalDeoptCount(" + bimorphicTrapName + ")=" + + WB.getDeoptCount(bimorphicTrapName, null)); + System.out.println("-----------------------------------------------------------------"); + } + + private static void check(Method uncommonTrap_m, int invocations, boolean isCompiled, int decompileCount, + int trapCount, int trapCountClassCheck, int trapCountBimorphic, + int deoptCount, int deoptCountClassCheck, int deoptCountBimorphic) { + + printCounters(uncommonTrap_m, invocations); + + Asserts.assertEQ(isCompiled, WB.isMethodCompiled(uncommonTrap_m), + "Wrong compilation status."); + Asserts.assertEQ(decompileCount, WB.getMethodDecompileCount(uncommonTrap_m), + "Wrong number of decompilations."); + Asserts.assertEQ(trapCount, WB.getMethodTrapCount(uncommonTrap_m), + "Wrong number of traps."); + Asserts.assertEQ(trapCountClassCheck, WB.getMethodTrapCount(uncommonTrap_m, "class_check"), + "Wrong number of traps."); + Asserts.assertEQ(trapCountBimorphic, WB.getMethodTrapCount(uncommonTrap_m, bimorphicTrapName), + "Wrong number of traps."); + Asserts.assertEQ(deoptCount, WB.getDeoptCount(), + "Wrong number of deoptimizations."); + Asserts.assertEQ(deoptCountClassCheck, WB.getDeoptCount("class_check", null), + "Wrong number of class_check deoptimizations."); + Asserts.assertEQ(deoptCountBimorphic, WB.getDeoptCount(bimorphicTrapName, null), + "Wrong number of " + bimorphicTrapName + "deoptimizations."); + } + public static void main(String[] args) throws Exception { + + // Get a handle of the test method for usage with the WhiteBox API. + Method uncommonTrap_m = Decompile.class + .getDeclaredMethod("uncommonTrap", new Class[] { Base.class }); + + int invocations = 0; + Base b = new Base(); + // This is a little tricky :) We have to define 'x' already here otherwise + // the class 'X' won't be loaded and 'uncommonTrap()' will be compiled without + // a class check but a CHA dependency that class 'B' has no subtypes. + X x = new X(); + Y y = new Y(); + + // Warmup and compile with an object of type 'Base' as receiver, but don't invoke compiled code. + while(!WB.isMethodCompiled(uncommonTrap_m)) { + invocations++; + uncommonTrap(b); + } + check(uncommonTrap_m, invocations, true /* is_compiled */, 0 /* decompileCount */, + 0 /* trapCount */, 0 /* trapCountClassCheck */, 0 /* trapCountBimorphic */, + 0 /* deoptCount */, 0 /* deoptCountClassCheck */, 0 /* deoptCountBimorphic */); + + // Invoke compiled code 'PerBytecodeTrapLimit' times with an receiver object of type 'X'. + // This should deoptimize 'PerBytecodeTrapLimit' times and finally decompile the method. + for (int i = 0; i < PerBytecodeTrapLimit; i++) { + invocations++; + uncommonTrap(x); + } + check(uncommonTrap_m, invocations, false /* is_compiled */, 1 /* decompileCount */, + PerBytecodeTrapLimit /* trapCount */, PerBytecodeTrapLimit /* trapCountClassCheck */, 0 /* trapCountBimorphic */, + PerBytecodeTrapLimit /* deoptCount */, PerBytecodeTrapLimit /* deoptCountClassCheck */, 0 /* deoptCountBimorphic */); + + // Invoke the method 'Tier0InvokeNotifyFreq' more times with an receiver object of type 'X'. + // This should re-compile the method again with bimorphic inlining for receiver types 'Base' and 'X'. + for (int i = 0; i < Tier0InvokeNotifyFreq; i++) { + invocations++; + uncommonTrap(x); + } + check(uncommonTrap_m, invocations, true /* is_compiled */, 1 /* decompileCount */, + PerBytecodeTrapLimit /* trapCount */, PerBytecodeTrapLimit /* trapCountClassCheck */, 0 /* trapCountBimorphic */, + PerBytecodeTrapLimit /* deoptCount */, PerBytecodeTrapLimit /* deoptCountClassCheck */, 0 /* deoptCountBimorphic */); + + // Invoke compiled code 'PerBytecodeTrapLimit' times with an receiver object of type 'Y'. + // This should deoptimize 'PerBytecodeTrapLimit' times and finally decompile the method. + for (int i = 0; i < PerBytecodeTrapLimit; i++) { + invocations++; + uncommonTrap(y); + } + check(uncommonTrap_m, invocations, false /* is_compiled */, 2 /* decompileCount */, + 2*PerBytecodeTrapLimit /* trapCount */, PerBytecodeTrapLimit /* trapCountClassCheck */, PerBytecodeTrapLimit /* trapCountBimorphic */, + 2*PerBytecodeTrapLimit /* deoptCount */, PerBytecodeTrapLimit /* deoptCountClassCheck */, PerBytecodeTrapLimit /* deoptCountBimorphic */); + } +} \ No newline at end of file diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index 4488559c470..c4f90b975a4 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -317,6 +317,36 @@ public class WhiteBox { Objects.requireNonNull(method); return getMethodCompilationLevel0(method, isOsr); } + public int getMethodDecompileCount(Executable method) { + Objects.requireNonNull(method); + return getMethodDecompileCount0(method); + } + private native int getMethodDecompileCount0(Executable method); + // Get the total trap count of a method. If the trap count for a specific reason + // did overflow, this includes the overflow trap count of the method. + public int getMethodTrapCount(Executable method) { + Objects.requireNonNull(method); + return getMethodTrapCount0(method, null); + } + // Get the trap count of a method for a specific reason. If the trap count for + // that reason did overflow, this includes the overflow trap count of the method. + public int getMethodTrapCount(Executable method, String reason) { + Objects.requireNonNull(method); + return getMethodTrapCount0(method, reason); + } + private native int getMethodTrapCount0(Executable method, String reason); + // Get the total deopt count. + public int getDeoptCount() { + return getDeoptCount0(null, null); + } + // Get the deopt count for a specific reason and a specific action. If either + // one of 'reason' or 'action' is null, the method returns the sum of all + // deoptimizations with the specific 'action' or 'reason' respectively. + // If both arguments are null, the method returns the total deopt count. + public int getDeoptCount(String reason, String action) { + return getDeoptCount0(reason, action); + } + private native int getDeoptCount0(String reason, String action); private native boolean testSetDontInlineMethod0(Executable method, boolean value); public boolean testSetDontInlineMethod(Executable method, boolean value) { Objects.requireNonNull(method); diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index 8db7ec3baaf..4536e608093 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -318,6 +318,36 @@ public class WhiteBox { Objects.requireNonNull(method); return getMethodCompilationLevel0(method, isOsr); } + public int getMethodDecompileCount(Executable method) { + Objects.requireNonNull(method); + return getMethodDecompileCount0(method); + } + private native int getMethodDecompileCount0(Executable method); + // Get the total trap count of a method. If the trap count for a specific reason + // did overflow, this includes the overflow trap count of the method. + public int getMethodTrapCount(Executable method) { + Objects.requireNonNull(method); + return getMethodTrapCount0(method, null); + } + // Get the trap count of a method for a specific reason. If the trap count for + // that reason did overflow, this includes the overflow trap count of the method. + public int getMethodTrapCount(Executable method, String reason) { + Objects.requireNonNull(method); + return getMethodTrapCount0(method, reason); + } + private native int getMethodTrapCount0(Executable method, String reason); + // Get the total deopt count. + public int getDeoptCount() { + return getDeoptCount0(null, null); + } + // Get the deopt count for a specific reason and a specific action. If either + // one of 'reason' or 'action' is null, the method returns the sum of all + // deoptimizations with the specific 'action' or 'reason' respectively. + // If both arguments are null, the method returns the total deopt count. + public int getDeoptCount(String reason, String action) { + return getDeoptCount0(reason, action); + } + private native int getDeoptCount0(String reason, String action); private native boolean testSetDontInlineMethod0(Executable method, boolean value); public boolean testSetDontInlineMethod(Executable method, boolean value) { Objects.requireNonNull(method); -- GitLab From b9eb532de20be7c2c18a654a23dcc8dd66654049 Mon Sep 17 00:00:00 2001 From: Erik Gahlin Date: Fri, 26 Nov 2021 19:13:38 +0000 Subject: [PATCH 488/890] 8276685: Malformed Javadoc inline tags in JDK source in /jdk/management/jfr/RecordingInfo.java Reviewed-by: mgronlun --- .../share/classes/jdk/management/jfr/RecordingInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jdk.management.jfr/share/classes/jdk/management/jfr/RecordingInfo.java b/src/jdk.management.jfr/share/classes/jdk/management/jfr/RecordingInfo.java index 16a710ee14a..8d2f1e061cc 100644 --- a/src/jdk.management.jfr/share/classes/jdk/management/jfr/RecordingInfo.java +++ b/src/jdk.management.jfr/share/classes/jdk/management/jfr/RecordingInfo.java @@ -300,10 +300,10 @@ public final class RecordingInfo { /** * Returns the desired duration, measured in seconds, of the recording - * associated with this {@link RecordingInfo}, or {code 0} if no duration + * associated with this {@link RecordingInfo}, or {@code 0} if no duration * has been set. * - * @return the desired duration, or {code 0} if no duration has been set + * @return the desired duration, or {@code 0} if no duration has been set * * @see Recording#getDuration() */ -- GitLab From e9b36a83160d3c1fa79841692e9fadf336bf7954 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Sat, 27 Nov 2021 00:46:09 +0000 Subject: [PATCH 489/890] 8276670: G1: Rename G1CardSetFreePool and related classes Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 7 +- src/hotspot/share/gc/g1/g1CardSetMemory.hpp | 4 +- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 28 ++++---- src/hotspot/share/gc/g1/g1CollectedHeap.hpp | 14 ++-- ...cpp => g1SegmentedArrayFreeMemoryTask.cpp} | 57 ++++++++-------- ...hpp => g1SegmentedArrayFreeMemoryTask.hpp} | 31 ++++----- .../share/gc/g1/g1SegmentedArrayFreePool.cpp | 65 ++++++++++--------- .../share/gc/g1/g1SegmentedArrayFreePool.hpp | 60 +++++++++-------- src/hotspot/share/gc/g1/g1YoungCollector.cpp | 8 +-- src/hotspot/share/gc/g1/g1YoungCollector.hpp | 2 +- .../gc/g1/g1YoungGCPostEvacuateTasks.cpp | 2 +- src/hotspot/share/gc/g1/heapRegion.hpp | 1 - src/hotspot/share/gc/g1/heapRegionRemSet.cpp | 6 +- src/hotspot/share/gc/g1/heapRegionRemSet.hpp | 3 +- test/hotspot/gtest/gc/g1/test_g1CardSet.cpp | 2 + 15 files changed, 154 insertions(+), 136 deletions(-) rename src/hotspot/share/gc/g1/{g1CardSetFreeMemoryTask.cpp => g1SegmentedArrayFreeMemoryTask.cpp} (70%) rename src/hotspot/share/gc/g1/{g1CardSetFreeMemoryTask.hpp => g1SegmentedArrayFreeMemoryTask.hpp} (72%) diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index aba70b1efcd..f48311a504c 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -30,7 +30,6 @@ #include "runtime/atomic.hpp" #include "utilities/ostream.hpp" - template G1CardSetAllocator::G1CardSetAllocator(const char* name, const G1CardSetAllocOptions* buffer_options, @@ -202,11 +201,11 @@ size_t G1CardSetMemoryManager::wasted_mem_size() const { return result; } -G1CardSetMemoryStats G1CardSetMemoryManager::memory_stats() const { - G1CardSetMemoryStats result; +G1SegmentedArrayMemoryStats G1CardSetMemoryManager::memory_stats() const { + G1SegmentedArrayMemoryStats result; for (uint i = 0; i < num_mem_object_types(); i++) { result._num_mem_sizes[i] += _allocators[i].mem_size(); - result._num_buffers[i] += _allocators[i].num_buffers(); + result._num_segments[i] += _allocators[i].num_buffers(); } return result; } diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp index 68b7b283542..50cb308f276 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp @@ -136,6 +136,8 @@ public: void print(outputStream* os); }; +typedef G1SegmentedArrayFreePool G1CardSetFreePool; + class G1CardSetMemoryManager : public CHeapObj { G1CardSetConfiguration* _config; @@ -163,7 +165,7 @@ public: size_t mem_size() const; size_t wasted_mem_size() const; - G1CardSetMemoryStats memory_stats() const; + G1SegmentedArrayMemoryStats memory_stats() const; }; #endif // SHARE_GC_G1_G1CARDSETMEMORY_HPP diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index 86b92a6206f..b35f48eaa7b 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -33,7 +33,6 @@ #include "gc/g1/g1Arguments.hpp" #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BatchedTask.hpp" -#include "gc/g1/g1CardSetFreeMemoryTask.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectionSet.hpp" #include "gc/g1/g1CollectionSetCandidates.hpp" @@ -65,13 +64,14 @@ #include "gc/g1/g1RootClosures.hpp" #include "gc/g1/g1RootProcessor.hpp" #include "gc/g1/g1SATBMarkQueueSet.hpp" +#include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp" +#include "gc/g1/g1ServiceThread.hpp" #include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1Trace.hpp" -#include "gc/g1/g1ServiceThread.hpp" #include "gc/g1/g1UncommitRegionTask.hpp" #include "gc/g1/g1VMOperations.hpp" -#include "gc/g1/g1YoungGCEvacFailureInjector.hpp" #include "gc/g1/g1YoungCollector.hpp" +#include "gc/g1/g1YoungGCEvacFailureInjector.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionRemSet.inline.hpp" #include "gc/g1/heapRegionSet.inline.hpp" @@ -87,17 +87,17 @@ #include "gc/shared/locationPrinter.inline.hpp" #include "gc/shared/oopStorageParState.hpp" #include "gc/shared/preservedMarks.inline.hpp" -#include "gc/shared/suspendibleThreadSet.hpp" #include "gc/shared/referenceProcessor.inline.hpp" -#include "gc/shared/taskTerminator.hpp" +#include "gc/shared/suspendibleThreadSet.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "gc/shared/taskTerminator.hpp" #include "gc/shared/tlab_globals.hpp" -#include "gc/shared/weakProcessor.inline.hpp" #include "gc/shared/workerPolicy.hpp" +#include "gc/shared/weakProcessor.inline.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" -#include "memory/iterator.hpp" #include "memory/heapInspection.hpp" +#include "memory/iterator.hpp" #include "memory/metaspaceUtils.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" @@ -1431,7 +1431,7 @@ G1CollectedHeap::G1CollectedHeap() : CollectedHeap(), _service_thread(NULL), _periodic_gc_task(NULL), - _free_card_set_memory_task(NULL), + _free_segmented_array_memory_task(NULL), _workers(NULL), _card_table(NULL), _collection_pause_end(Ticks::now()), @@ -1723,8 +1723,8 @@ jint G1CollectedHeap::initialize() { _periodic_gc_task = new G1PeriodicGCTask("Periodic GC Task"); _service_thread->register_task(_periodic_gc_task); - _free_card_set_memory_task = new G1CardSetFreeMemoryTask("Card Set Free Memory Task"); - _service_thread->register_task(_free_card_set_memory_task); + _free_segmented_array_memory_task = new G1SegmentedArrayFreeMemoryTask("Card Set Free Memory Task"); + _service_thread->register_task(_free_segmented_array_memory_task); { G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set(); @@ -2616,8 +2616,8 @@ void G1CollectedHeap::gc_epilogue(bool full) { _collection_pause_end = Ticks::now(); - _free_card_set_memory_task->notify_new_stats(&_young_gen_card_set_stats, - &_collection_set_candidates_card_set_stats); + _free_segmented_array_memory_task->notify_new_stats(&_young_gen_card_set_stats, + &_collection_set_candidates_card_set_stats); } uint G1CollectedHeap::uncommit_regions(uint region_limit) { @@ -2941,11 +2941,11 @@ bool G1CollectedHeap::should_sample_collection_set_candidates() const { return candidates != NULL && candidates->num_remaining() > 0; } -void G1CollectedHeap::set_collection_set_candidates_stats(G1CardSetMemoryStats& stats) { +void G1CollectedHeap::set_collection_set_candidates_stats(G1SegmentedArrayMemoryStats& stats) { _collection_set_candidates_card_set_stats = stats; } -void G1CollectedHeap::set_young_gen_card_set_stats(const G1CardSetMemoryStats& stats) { +void G1CollectedHeap::set_young_gen_card_set_stats(const G1SegmentedArrayMemoryStats& stats) { _young_gen_card_set_stats = stats; } diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index 8f86e4d7abe..30ff5d19bec 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -27,7 +27,6 @@ #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BiasedArray.hpp" -#include "gc/g1/g1CardSetFreeMemoryTask.hpp" #include "gc/g1/g1CardTable.hpp" #include "gc/g1/g1CollectionSet.hpp" #include "gc/g1/g1CollectorState.hpp" @@ -35,12 +34,13 @@ #include "gc/g1/g1EdenRegions.hpp" #include "gc/g1/g1EvacStats.hpp" #include "gc/g1/g1GCPauseType.hpp" +#include "gc/g1/g1HeapRegionAttr.hpp" #include "gc/g1/g1HeapTransition.hpp" #include "gc/g1/g1HeapVerifier.hpp" #include "gc/g1/g1HRPrinter.hpp" -#include "gc/g1/g1HeapRegionAttr.hpp" #include "gc/g1/g1MonitoringSupport.hpp" #include "gc/g1/g1NUMA.hpp" +#include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp" #include "gc/g1/g1SurvivorRegions.hpp" #include "gc/g1/g1YoungGCEvacFailureInjector.hpp" #include "gc/g1/heapRegionManager.hpp" @@ -143,7 +143,7 @@ class G1CollectedHeap : public CollectedHeap { private: G1ServiceThread* _service_thread; G1ServiceTask* _periodic_gc_task; - G1CardSetFreeMemoryTask* _free_card_set_memory_task; + G1SegmentedArrayFreeMemoryTask* _free_segmented_array_memory_task; WorkerThreads* _workers; G1CardTable* _card_table; @@ -160,9 +160,9 @@ private: HeapRegionSet _humongous_set; // Young gen memory statistics before GC. - G1CardSetMemoryStats _young_gen_card_set_stats; + G1SegmentedArrayMemoryStats _young_gen_card_set_stats; // Collection set candidates memory statistics after GC. - G1CardSetMemoryStats _collection_set_candidates_card_set_stats; + G1SegmentedArrayMemoryStats _collection_set_candidates_card_set_stats; // The block offset table for the G1 heap. G1BlockOffsetTable* _bot; @@ -259,8 +259,8 @@ public: void set_humongous_stats(uint num_humongous_total, uint num_humongous_candidates); bool should_sample_collection_set_candidates() const; - void set_collection_set_candidates_stats(G1CardSetMemoryStats& stats); - void set_young_gen_card_set_stats(const G1CardSetMemoryStats& stats); + void set_collection_set_candidates_stats(G1SegmentedArrayMemoryStats& stats); + void set_young_gen_card_set_stats(const G1SegmentedArrayMemoryStats& stats); private: diff --git a/src/hotspot/share/gc/g1/g1CardSetFreeMemoryTask.cpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.cpp similarity index 70% rename from src/hotspot/share/gc/g1/g1CardSetFreeMemoryTask.cpp rename to src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.cpp index 09a22728a89..4752adde74d 100644 --- a/src/hotspot/share/gc/g1/g1CardSetFreeMemoryTask.cpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.cpp @@ -23,22 +23,23 @@ */ #include "precompiled.hpp" -#include "gc/g1/g1CardSetFreeMemoryTask.hpp" +#include "ci/ciUtilities.hpp" #include "gc/g1/g1CardSetMemory.inline.hpp" #include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp" #include "gc/g1/g1_globals.hpp" +#include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/suspendibleThreadSet.hpp" -#include "heapRegionRemSet.hpp" -#include "ci/ciUtilities.hpp" +#include "runtime/os.hpp" -constexpr const char* G1CardSetFreeMemoryTask::_state_names[]; +constexpr const char* G1SegmentedArrayFreeMemoryTask::_state_names[]; -const char* G1CardSetFreeMemoryTask::get_state_name(State value) const { +const char* G1SegmentedArrayFreeMemoryTask::get_state_name(State value) const { return _state_names[static_cast>(value)]; } -bool G1CardSetFreeMemoryTask::deadline_exceeded(jlong deadline) { +bool G1SegmentedArrayFreeMemoryTask::deadline_exceeded(jlong deadline) { return os::elapsed_counter() >= deadline; } @@ -47,31 +48,31 @@ static size_t keep_size(size_t free, size_t used, double percent) { return MIN2(free, to_keep); } -bool G1CardSetFreeMemoryTask::calculate_return_infos(jlong deadline) { +bool G1SegmentedArrayFreeMemoryTask::calculate_return_infos(jlong deadline) { // Ignore the deadline in this step as it is very short. - G1CardSetMemoryStats used = _total_used; - G1CardSetMemoryStats free = G1CardSetFreePool::free_list_sizes(); + G1SegmentedArrayMemoryStats used = _total_used; + G1SegmentedArrayMemoryStats free = G1SegmentedArrayFreePool::free_list_sizes(); _return_info = new G1ReturnMemoryProcessorSet(used.num_pools()); for (uint i = 0; i < used.num_pools(); i++) { size_t return_to_vm_size = keep_size(free._num_mem_sizes[i], used._num_mem_sizes[i], G1RemSetFreeMemoryKeepExcessRatio); - log_trace(gc, task)("Card Set Free Memory: Type %s: Free: %zu (%zu) " + log_trace(gc, task)("Segmented Array Free Memory: Type %s: Free: %zu (%zu) " "Used: %zu Keep: %zu", G1CardSetConfiguration::mem_object_type_name_str(i), - free._num_mem_sizes[i], free._num_buffers[i], + free._num_mem_sizes[i], free._num_segments[i], used._num_mem_sizes[i], return_to_vm_size); _return_info->append(new G1ReturnMemoryProcessor(return_to_vm_size)); } - G1CardSetFreePool::update_unlink_processors(_return_info); + G1SegmentedArrayFreePool::update_unlink_processors(_return_info); return false; } -bool G1CardSetFreeMemoryTask::return_memory_to_vm(jlong deadline) { +bool G1SegmentedArrayFreeMemoryTask::return_memory_to_vm(jlong deadline) { for (int i = 0; i < _return_info->length(); i++) { G1ReturnMemoryProcessor* info = _return_info->at(i); if (!info->finished_return_to_vm()) { @@ -83,7 +84,7 @@ bool G1CardSetFreeMemoryTask::return_memory_to_vm(jlong deadline) { return false; } -bool G1CardSetFreeMemoryTask::return_memory_to_os(jlong deadline) { +bool G1SegmentedArrayFreeMemoryTask::return_memory_to_os(jlong deadline) { for (int i = 0; i < _return_info->length(); i++) { G1ReturnMemoryProcessor* info = _return_info->at(i); if (!info->finished_return_to_os()) { @@ -95,7 +96,7 @@ bool G1CardSetFreeMemoryTask::return_memory_to_os(jlong deadline) { return false; } -bool G1CardSetFreeMemoryTask::cleanup_return_infos() { +bool G1SegmentedArrayFreeMemoryTask::cleanup_return_infos() { for (int i = 0; i < _return_info->length(); i++) { G1ReturnMemoryProcessor* info = _return_info->at(i); delete info; @@ -106,12 +107,12 @@ bool G1CardSetFreeMemoryTask::cleanup_return_infos() { return false; } -bool G1CardSetFreeMemoryTask::free_excess_card_set_memory() { +bool G1SegmentedArrayFreeMemoryTask::free_excess_segmented_array_memory() { jlong start = os::elapsed_counter(); jlong end = start + (os::elapsed_frequency() / 1000) * G1RemSetFreeMemoryStepDurationMillis; - log_trace(gc, task)("Card Set Free Memory: Step start %1.3f end %1.3f", + log_trace(gc, task)("Segmented Array Free Memory: Step start %1.3f end %1.3f", TimeHelper::counter_to_millis(start), TimeHelper::counter_to_millis(end)); State next_state; @@ -148,7 +149,7 @@ bool G1CardSetFreeMemoryTask::free_excess_card_set_memory() { break; } default: - log_error(gc, task)("Should not try to free excess card set memory in %s state", get_state_name(_state)); + log_error(gc, task)("Should not try to free excess segmented array memory in %s state", get_state_name(_state)); ShouldNotReachHere(); break; } @@ -156,41 +157,41 @@ bool G1CardSetFreeMemoryTask::free_excess_card_set_memory() { set_state(next_state); } while (_state != State::Inactive && !deadline_exceeded(end)); - log_trace(gc, task)("Card Set Free Memory: Step took %1.3fms, done %s", + log_trace(gc, task)("Segmented Array Free Memory: Step took %1.3fms, done %s", TimeHelper::counter_to_millis(os::elapsed_counter() - start), bool_to_str(_state == State::CalculateUsed)); return is_active(); } -void G1CardSetFreeMemoryTask::set_state(State new_state) { - log_trace(gc, task)("Card Set Free Memory: State change from %s to %s", +void G1SegmentedArrayFreeMemoryTask::set_state(State new_state) { + log_trace(gc, task)("Segmented Array Free Memory: State change from %s to %s", get_state_name(_state), get_state_name(new_state)); _state = new_state; } -bool G1CardSetFreeMemoryTask::is_active() const { +bool G1SegmentedArrayFreeMemoryTask::is_active() const { return _state != State::Inactive; } -jlong G1CardSetFreeMemoryTask::reschedule_delay_ms() const { +jlong G1SegmentedArrayFreeMemoryTask::reschedule_delay_ms() const { return G1RemSetFreeMemoryRescheduleDelayMillis; } -G1CardSetFreeMemoryTask::G1CardSetFreeMemoryTask(const char* name) : +G1SegmentedArrayFreeMemoryTask::G1SegmentedArrayFreeMemoryTask(const char* name) : G1ServiceTask(name), _state(State::CalculateUsed), _return_info(nullptr) { } -void G1CardSetFreeMemoryTask::execute() { +void G1SegmentedArrayFreeMemoryTask::execute() { SuspendibleThreadSetJoiner sts; - if (free_excess_card_set_memory()) { + if (free_excess_segmented_array_memory()) { schedule(reschedule_delay_ms()); } } -void G1CardSetFreeMemoryTask::notify_new_stats(G1CardSetMemoryStats* young_gen_stats, - G1CardSetMemoryStats* collection_set_candidate_stats) { +void G1SegmentedArrayFreeMemoryTask::notify_new_stats(G1SegmentedArrayMemoryStats* young_gen_stats, + G1SegmentedArrayMemoryStats* collection_set_candidate_stats) { assert_at_safepoint_on_vm_thread(); _total_used = *young_gen_stats; diff --git a/src/hotspot/share/gc/g1/g1CardSetFreeMemoryTask.hpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.hpp similarity index 72% rename from src/hotspot/share/gc/g1/g1CardSetFreeMemoryTask.hpp rename to src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.hpp index 3d617243aa4..a4195cd424c 100644 --- a/src/hotspot/share/gc/g1/g1CardSetFreeMemoryTask.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreeMemoryTask.hpp @@ -22,17 +22,18 @@ * */ -#ifndef SHARE_GC_G1_G1CARDSETFREEMEMORYTASK_HPP -#define SHARE_GC_G1_G1CARDSETFREEMEMORYTASK_HPP +#ifndef SHARE_GC_G1_G1SEGMENTEDARRAYFREEMEMORYTASK_HPP +#define SHARE_GC_G1_G1SEGMENTEDARRAYFREEMEMORYTASK_HPP -#include "gc/g1/g1ServiceThread.hpp" #include "gc/g1/g1CardSetMemory.hpp" +#include "gc/g1/g1SegmentedArrayFreePool.hpp" +#include "gc/g1/g1ServiceThread.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "utilities/growableArray.hpp" #include "utilities/ticks.hpp" -// Task handling deallocation of free card set memory. -class G1CardSetFreeMemoryTask : public G1ServiceTask { +// Task handling deallocation of free segmented array memory. +class G1SegmentedArrayFreeMemoryTask : public G1ServiceTask { enum class State : uint { Inactive, @@ -52,11 +53,11 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask { State _state; - // Current total card set memory usage. - G1CardSetMemoryStats _total_used; + // Current total segmented array memory usage. + G1SegmentedArrayMemoryStats _total_used; - typedef G1CardSetFreePool::G1ReturnMemoryProcessor G1ReturnMemoryProcessor; - typedef G1CardSetFreePool::G1ReturnMemoryProcessorSet G1ReturnMemoryProcessorSet; + typedef G1SegmentedArrayFreePool::G1ReturnMemoryProcessor G1ReturnMemoryProcessor; + typedef G1SegmentedArrayFreePool::G1ReturnMemoryProcessorSet G1ReturnMemoryProcessorSet; G1ReturnMemoryProcessorSet* _return_info; @@ -70,9 +71,9 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask { bool return_memory_to_os(jlong deadline); bool cleanup_return_infos(); - // Free excess card set memory, main method. Returns true if there is more work + // Free excess segmented array memory, main method. Returns true if there is more work // to do. - bool free_excess_card_set_memory(); + bool free_excess_segmented_array_memory(); void set_state(State new_state); // Returns whether we are currently processing a recent request. @@ -82,14 +83,14 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask { jlong reschedule_delay_ms() const; public: - explicit G1CardSetFreeMemoryTask(const char* name); + explicit G1SegmentedArrayFreeMemoryTask(const char* name); void execute() override; // Notify the task of new used remembered set memory statistics for the young // generation and the collection set candidate sets. - void notify_new_stats(G1CardSetMemoryStats* young_gen_stats, - G1CardSetMemoryStats* collection_set_candidate_stats); + void notify_new_stats(G1SegmentedArrayMemoryStats* young_gen_stats, + G1SegmentedArrayMemoryStats* collection_set_candidate_stats); }; -#endif // SHARE_GC_G1_G1CARDSETFREEMEMORYTASK_HPP +#endif // SHARE_GC_G1_G1SEGMENTEDARRAYFREEMEMORYTASK_HPP diff --git a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp index 48ce124f00f..b21f4a1b545 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp @@ -24,7 +24,6 @@ #include "precompiled.hpp" -#include "gc/g1/g1CardSetMemory.hpp" #include "gc/g1/g1SegmentedArrayFreePool.hpp" #include "gc/g1/g1SegmentedArray.inline.hpp" #include "logging/log.hpp" @@ -33,19 +32,19 @@ #include "utilities/formatBuffer.hpp" #include "utilities/ostream.hpp" - -G1CardSetMemoryStats::G1CardSetMemoryStats() { +G1SegmentedArrayMemoryStats::G1SegmentedArrayMemoryStats() { clear(); } -void G1CardSetMemoryStats::clear() { +void G1SegmentedArrayMemoryStats::clear() { for (uint i = 0; i < num_pools(); i++) { _num_mem_sizes[i] = 0; - _num_buffers[i] = 0; + _num_segments[i] = 0; } } -void G1CardSetFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processor) { +template +void G1SegmentedArrayFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processor) { uint num_free_lists = _freelist_pool.num_free_lists(); for (uint i = 0; i < num_free_lists; i++) { @@ -53,7 +52,8 @@ void G1CardSetFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unl } } -void G1CardSetFreePool::G1ReturnMemoryProcessor::visit_free_list(G1CardSetBufferList* source) { +template +void G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::visit_free_list(G1SegmentedArrayBufferList* source) { assert(_source == nullptr, "already visited"); if (_return_to_vm_size > 0) { _source = source; @@ -75,15 +75,16 @@ void G1CardSetFreePool::G1ReturnMemoryProcessor::visit_free_list(G1CardSetBuffer } } -bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { +template +bool G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { assert(!finished_return_to_vm(), "already returned everything to the VM"); assert(_first != nullptr, "must have element to return"); size_t keep_size = 0; size_t keep_num = 0; - G1CardSetBuffer* cur = _first; - G1CardSetBuffer* last = nullptr; + G1SegmentedArrayBuffer* cur = _first; + G1SegmentedArrayBuffer* last = nullptr; while (cur != nullptr && _return_to_vm_size > 0) { size_t cur_size = cur->mem_size(); @@ -110,7 +111,7 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { _source->bulk_add(*_first, *last, keep_num, keep_size); _first = cur; - log_trace(gc, task)("Card Set Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size); + log_trace(gc, task)("Segmented Array Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size); // _return_to_vm_size may be larger than what is available in the list at the // time we actually get the list. I.e. the list and _return_to_vm_size may be @@ -124,7 +125,8 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { return _source != nullptr; } -bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { +template +bool G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { assert(finished_return_to_vm(), "not finished returning to VM"); assert(!finished_return_to_os(), "already returned everything to the OS"); @@ -133,7 +135,7 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { size_t mem_size_deleted = 0; while (_first != nullptr) { - G1CardSetBuffer* next = _first->next(); + G1SegmentedArrayBuffer* next = _first->next(); num_delete++; mem_size_deleted += _first->mem_size(); delete _first; @@ -145,45 +147,45 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { } } - log_trace(gc, task)("Card Set Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted); + log_trace(gc, task)("Segmented Array Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted); return _first != nullptr; } -G1CardSetFreePool G1CardSetFreePool::_freelist_pool(G1CardSetConfiguration::num_mem_object_types()); +template +G1SegmentedArrayFreePool G1SegmentedArrayFreePool::_freelist_pool(G1CardSetConfiguration::num_mem_object_types()); -G1CardSetFreePool::G1CardSetFreePool(uint num_free_lists) : +template +G1SegmentedArrayFreePool::G1SegmentedArrayFreePool(uint num_free_lists) : _num_free_lists(num_free_lists) { - _free_lists = NEW_C_HEAP_ARRAY(G1CardSetBufferList, _num_free_lists, mtGC); + _free_lists = NEW_C_HEAP_ARRAY(G1SegmentedArrayBufferList, _num_free_lists, mtGC); for (uint i = 0; i < _num_free_lists; i++) { - new (&_free_lists[i]) G1CardSetBufferList(); + new (&_free_lists[i]) G1SegmentedArrayBufferList(); } } -G1CardSetFreePool::~G1CardSetFreePool() { +template +G1SegmentedArrayFreePool::~G1SegmentedArrayFreePool() { for (uint i = 0; i < _num_free_lists; i++) { - _free_lists[i].~G1CardSetBufferList(); + _free_lists[i].~G1SegmentedArrayBufferList(); } FREE_C_HEAP_ARRAY(mtGC, _free_lists); } -G1CardSetBufferList* G1CardSetFreePool::free_list(uint i) { - assert(i < _num_free_lists, "must be"); - return &_free_lists[i]; -} - -G1CardSetMemoryStats G1CardSetFreePool::memory_sizes() const { - G1CardSetMemoryStats free_list_stats; +template +G1SegmentedArrayMemoryStats G1SegmentedArrayFreePool::memory_sizes() const { + G1SegmentedArrayMemoryStats free_list_stats; assert(free_list_stats.num_pools() == num_free_lists(), "must be"); for (uint i = 0; i < num_free_lists(); i++) { free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size(); - free_list_stats._num_buffers[i] = _free_lists[i].num_buffers(); + free_list_stats._num_segments[i] = _free_lists[i].num_buffers(); } return free_list_stats; } -size_t G1CardSetFreePool::mem_size() const { +template +size_t G1SegmentedArrayFreePool::mem_size() const { size_t result = 0; for (uint i = 0; i < _num_free_lists; i++) { result += _free_lists[i].mem_size(); @@ -191,10 +193,13 @@ size_t G1CardSetFreePool::mem_size() const { return result; } -void G1CardSetFreePool::print_on(outputStream* out) { +template +void G1SegmentedArrayFreePool::print_on(outputStream* out) { out->print_cr(" Free Pool: size %zu", free_list_pool()->mem_size()); for (uint i = 0; i < _num_free_lists; i++) { FormatBuffer<> fmt(" %s", G1CardSetConfiguration::mem_object_type_name_str(i)); _free_lists[i].print_on(out, fmt); } } + +template class G1SegmentedArrayFreePool; diff --git a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp index 917b9475c0b..918e92e3911 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp @@ -21,6 +21,7 @@ * questions. * */ + #ifndef SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP #define SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP @@ -28,23 +29,23 @@ #include "gc/g1/g1SegmentedArray.hpp" #include "utilities/growableArray.hpp" -// Statistics for a fixed set of buffer lists. Contains the number of buffers and memory +// Statistics for a segmented array. Contains the number of segments and memory // used for each. Note that statistics are typically not taken atomically so there // can be inconsistencies. The user must be prepared for them. -class G1CardSetMemoryStats { +class G1SegmentedArrayMemoryStats { public: size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()]; - size_t _num_buffers[G1CardSetConfiguration::num_mem_object_types()]; + size_t _num_segments[G1CardSetConfiguration::num_mem_object_types()]; // Returns all-zero statistics. - G1CardSetMemoryStats(); + G1SegmentedArrayMemoryStats(); - void add(G1CardSetMemoryStats const other) { - STATIC_ASSERT(ARRAY_SIZE(_num_buffers) == ARRAY_SIZE(_num_mem_sizes)); + void add(G1SegmentedArrayMemoryStats const other) { + STATIC_ASSERT(ARRAY_SIZE(_num_segments) == ARRAY_SIZE(_num_mem_sizes)); for (uint i = 0; i < ARRAY_SIZE(_num_mem_sizes); i++) { _num_mem_sizes[i] += other._num_mem_sizes[i]; - _num_buffers[i] += other._num_buffers[i]; + _num_segments[i] += other._num_segments[i]; } } @@ -53,46 +54,49 @@ public: uint num_pools() const { return G1CardSetConfiguration::num_mem_object_types(); } }; -typedef G1SegmentedArrayBuffer G1CardSetBuffer; -typedef G1SegmentedArrayBufferList G1CardSetBufferList; - -// A set of free lists holding memory buffers for use by G1CardSetAllocators. -class G1CardSetFreePool { +// A set of free lists holding memory buffers for use by G1SegmentedArray, +// e.g. G1CardSetAllocators::SegmentedArray +template +class G1SegmentedArrayFreePool { // The global free pool. - static G1CardSetFreePool _freelist_pool; + static G1SegmentedArrayFreePool _freelist_pool; const uint _num_free_lists; - G1CardSetBufferList* _free_lists; + G1SegmentedArrayBufferList* _free_lists; public: - static G1CardSetFreePool* free_list_pool() { return &_freelist_pool; } - static G1CardSetMemoryStats free_list_sizes() { return _freelist_pool.memory_sizes(); } + static G1SegmentedArrayFreePool* free_list_pool() { return &_freelist_pool; } + static G1SegmentedArrayMemoryStats free_list_sizes() { return _freelist_pool.memory_sizes(); } class G1ReturnMemoryProcessor; typedef GrowableArrayCHeap G1ReturnMemoryProcessorSet; static void update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processors); - explicit G1CardSetFreePool(uint num_free_lists); - ~G1CardSetFreePool(); + explicit G1SegmentedArrayFreePool(uint num_free_lists); + ~G1SegmentedArrayFreePool(); - G1CardSetBufferList* free_list(uint i); + G1SegmentedArrayBufferList* free_list(uint i) { + assert(i < _num_free_lists, "must be"); + return &_free_lists[i]; + } uint num_free_lists() const { return _num_free_lists; } - G1CardSetMemoryStats memory_sizes() const; + G1SegmentedArrayMemoryStats memory_sizes() const; size_t mem_size() const; void print_on(outputStream* out); }; // Data structure containing current in-progress state for returning memory to the -// operating system for a single G1CardSetBufferList. -class G1CardSetFreePool::G1ReturnMemoryProcessor : public CHeapObj { - G1CardSetBufferList* _source; +// operating system for a single G1SegmentedArrayBufferList. +template +class G1SegmentedArrayFreePool::G1ReturnMemoryProcessor : public CHeapObj { + G1SegmentedArrayBufferList* _source; size_t _return_to_vm_size; - G1CardSetBuffer* _first; + G1SegmentedArrayBuffer* _first; size_t _unlinked_bytes; size_t _num_unlinked; @@ -101,10 +105,10 @@ public: _source(nullptr), _return_to_vm_size(return_to_vm), _first(nullptr), _unlinked_bytes(0), _num_unlinked(0) { } - // Updates the instance members about the given card set buffer list for the purpose - // of giving back memory. Only necessary members are updated, e.g. if there is - // nothing to return to the VM, do not set the source list. - void visit_free_list(G1CardSetBufferList* source); + // Updates the instance members about the given segmented array buffer list for + // the purpose of giving back memory. Only necessary members are updated, + // e.g. if there is nothing to return to the VM, do not set the source list. + void visit_free_list(G1SegmentedArrayBufferList* source); bool finished_return_to_vm() const { return _return_to_vm_size == 0; } bool finished_return_to_os() const { return _first == nullptr; } diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.cpp b/src/hotspot/share/gc/g1/g1YoungCollector.cpp index 34985059de5..d476c981d71 100644 --- a/src/hotspot/share/gc/g1/g1YoungCollector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungCollector.cpp @@ -330,7 +330,7 @@ class G1PrepareEvacuationTask : public WorkerTask { uint _worker_humongous_total; uint _worker_humongous_candidates; - G1CardSetMemoryStats _card_set_stats; + G1SegmentedArrayMemoryStats _card_set_stats; void sample_card_set_size(HeapRegion* hr) { // Sample card set sizes for young gen and humongous before GC: this makes @@ -446,7 +446,7 @@ class G1PrepareEvacuationTask : public WorkerTask { return false; } - G1CardSetMemoryStats card_set_stats() const { + G1SegmentedArrayMemoryStats card_set_stats() const { return _card_set_stats; } }; @@ -456,7 +456,7 @@ class G1PrepareEvacuationTask : public WorkerTask { volatile uint _humongous_total; volatile uint _humongous_candidates; - G1CardSetMemoryStats _all_card_set_stats; + G1SegmentedArrayMemoryStats _all_card_set_stats; public: G1PrepareEvacuationTask(G1CollectedHeap* g1h) : @@ -490,7 +490,7 @@ public: return _humongous_total; } - const G1CardSetMemoryStats all_card_set_stats() const { + const G1SegmentedArrayMemoryStats all_card_set_stats() const { return _all_card_set_stats; } }; diff --git a/src/hotspot/share/gc/g1/g1YoungCollector.hpp b/src/hotspot/share/gc/g1/g1YoungCollector.hpp index 4bc1eaf1942..055803a3352 100644 --- a/src/hotspot/share/gc/g1/g1YoungCollector.hpp +++ b/src/hotspot/share/gc/g1/g1YoungCollector.hpp @@ -33,7 +33,6 @@ class WorkerTask; class G1Allocator; class G1BatchedTask; -class G1CardSetMemoryStats; class G1CollectedHeap; class G1CollectionSet; class G1CollectorState; @@ -49,6 +48,7 @@ class G1ParScanThreadStateSet; class G1Policy; class G1RedirtyCardsQueueSet; class G1RemSet; +class G1SegmentedArrayMemoryStats; class G1SurvivorRegions; class G1YoungGCEvacFailureInjector; class STWGCTimer; diff --git a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp index 2df06a5e324..f8e260e21e6 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCPostEvacuateTasks.cpp @@ -82,7 +82,7 @@ public: class G1SampleCollectionSetCandidatesClosure : public HeapRegionClosure { public: - G1CardSetMemoryStats _total; + G1SegmentedArrayMemoryStats _total; bool do_heap_region(HeapRegion* r) override { _total.add(r->rem_set()->card_set_memory_stats()); diff --git a/src/hotspot/share/gc/g1/heapRegion.hpp b/src/hotspot/share/gc/g1/heapRegion.hpp index 2317861388a..cac95b4105f 100644 --- a/src/hotspot/share/gc/g1/heapRegion.hpp +++ b/src/hotspot/share/gc/g1/heapRegion.hpp @@ -38,7 +38,6 @@ #include "utilities/macros.hpp" class G1CardSetConfiguration; -class G1CardSetMemoryManager; class G1CollectedHeap; class G1CMBitMap; class G1Predictions; diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.cpp b/src/hotspot/share/gc/g1/heapRegionRemSet.cpp index a0e740ad267..694496975f5 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.cpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.cpp @@ -81,7 +81,7 @@ HeapRegionRemSet::HeapRegionRemSet(HeapRegion* hr, G1CardSetConfiguration* config) : _m(Mutex::service - 1, FormatBuffer<128>("HeapRegionRemSet#%u_lock", hr->hrm_index())), _code_roots(), - _card_set_mm(config, G1CardSetFreePool::free_list_pool()), + _card_set_mm(config, G1SegmentedArrayFreePool::free_list_pool()), _card_set(config, &_card_set_mm), _hr(hr), _state(Untracked) { } @@ -105,6 +105,10 @@ void HeapRegionRemSet::clear_locked(bool only_cardset) { assert(occupied() == 0, "Should be clear."); } +G1SegmentedArrayMemoryStats HeapRegionRemSet::card_set_memory_stats() const { + return _card_set_mm.memory_stats(); +} + void HeapRegionRemSet::print_static_mem_size(outputStream* out) { out->print_cr(" Static structures = " SIZE_FORMAT, HeapRegionRemSet::static_mem_size()); } diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.hpp index 958d6fceaf1..2a1b3c5527b 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.hpp @@ -33,6 +33,7 @@ #include "runtime/safepoint.hpp" #include "utilities/bitMap.hpp" +class G1CardSetMemoryManager; class outputStream; class HeapRegionRemSet : public CHeapObj { @@ -125,7 +126,7 @@ public: void clear(bool only_cardset = false); void clear_locked(bool only_cardset = false); - G1CardSetMemoryStats card_set_memory_stats() const { return _card_set_mm.memory_stats(); } + G1SegmentedArrayMemoryStats card_set_memory_stats() const; // The actual # of bytes this hr_remset takes up. Also includes the strong code // root set. diff --git a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp index f009fc4adea..b6c0d545746 100644 --- a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp +++ b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp @@ -25,10 +25,12 @@ #include "gc/g1/g1CardSet.inline.hpp" #include "gc/g1/g1CardSetContainers.hpp" #include "gc/g1/g1CardSetMemory.hpp" +#include "gc/g1/g1SegmentedArrayFreePool.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/workerThread.hpp" #include "logging/log.hpp" +#include "memory/allocation.hpp" #include "unittest.hpp" #include "utilities/powerOfTwo.hpp" -- GitLab From 8f9eb620acbc447cf9124b1fe5574a9f02115f45 Mon Sep 17 00:00:00 2001 From: Ichiroh Takiguchi Date: Mon, 29 Nov 2021 00:11:28 +0000 Subject: [PATCH 490/890] 8274784: jshell: Garbled character was displayed by System.out.println(...) on Japanese Windows Reviewed-by: naoto --- .../internal/org/jline/terminal/impl/AbstractTerminal.java | 2 +- .../jdk/jshell/execution/RemoteExecutionControl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractTerminal.java b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractTerminal.java index e92233c7b4f..8a464a67265 100644 --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractTerminal.java +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/AbstractTerminal.java @@ -55,7 +55,7 @@ public abstract class AbstractTerminal implements Terminal { public AbstractTerminal(String name, String type, Charset encoding, SignalHandler signalHandler) throws IOException { this.name = name; this.type = type != null ? type : "ansi"; - this.encoding = encoding != null ? encoding : Charset.defaultCharset(); + this.encoding = encoding != null ? encoding : System.out.charset(); for (Signal signal : Signal.values()) { handlers.put(signal, signalHandler); } diff --git a/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java b/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java index 810e80acf47..d8818dee541 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -63,8 +63,8 @@ public class RemoteExecutionControl extends DirectExecutionControl implements Ex InputStream inStream = socket.getInputStream(); OutputStream outStream = socket.getOutputStream(); Map> outputs = new HashMap<>(); - outputs.put("out", st -> System.setOut(new PrintStream(st, true))); - outputs.put("err", st -> System.setErr(new PrintStream(st, true))); + outputs.put("out", st -> System.setOut(new PrintStream(st, true, System.out.charset()))); + outputs.put("err", st -> System.setErr(new PrintStream(st, true, System.err.charset()))); Map> input = new HashMap<>(); input.put("in", System::setIn); forwardExecutionControlAndIO(new RemoteExecutionControl(), inStream, outStream, outputs, input); -- GitLab From c3a7f2f4bce9170c1630e01eebd4fcd174b44964 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Mon, 29 Nov 2021 06:41:55 +0000 Subject: [PATCH 491/890] 8277382: make c1 BlockMerger use IR::verify only when necessary Reviewed-by: thartmann, neliasso --- src/hotspot/share/c1/c1_Optimizer.cpp | 227 +++++++++++++------------- 1 file changed, 111 insertions(+), 116 deletions(-) diff --git a/src/hotspot/share/c1/c1_Optimizer.cpp b/src/hotspot/share/c1/c1_Optimizer.cpp index e5c5061e334..8e32b813ef7 100644 --- a/src/hotspot/share/c1/c1_Optimizer.cpp +++ b/src/hotspot/share/c1/c1_Optimizer.cpp @@ -336,140 +336,135 @@ class BlockMerger: public BlockClosure { bool try_merge(BlockBegin* block) { BlockEnd* end = block->end(); - if (end->as_Goto() != NULL) { - assert(end->number_of_sux() == 1, "end must have exactly one successor"); - // Note: It would be sufficient to check for the number of successors (= 1) - // in order to decide if this block can be merged potentially. That - // would then also include switch statements w/ only a default case. - // However, in that case we would need to make sure the switch tag - // expression is executed if it can produce observable side effects. - // We should probably have the canonicalizer simplifying such switch - // statements and then we are sure we don't miss these merge opportunities - // here (was bug - gri 7/7/99). - BlockBegin* sux = end->default_sux(); - if (sux->number_of_preds() == 1 && !sux->is_entry_block() && !end->is_safepoint()) { - // merge the two blocks + if (end->as_Goto() == NULL) return false; + + assert(end->number_of_sux() == 1, "end must have exactly one successor"); + // Note: It would be sufficient to check for the number of successors (= 1) + // in order to decide if this block can be merged potentially. That + // would then also include switch statements w/ only a default case. + // However, in that case we would need to make sure the switch tag + // expression is executed if it can produce observable side effects. + // We should probably have the canonicalizer simplifying such switch + // statements and then we are sure we don't miss these merge opportunities + // here (was bug - gri 7/7/99). + BlockBegin* sux = end->default_sux(); + if (sux->number_of_preds() != 1 || sux->is_entry_block() || end->is_safepoint()) return false; + // merge the two blocks #ifdef ASSERT - // verify that state at the end of block and at the beginning of sux are equal - // no phi functions must be present at beginning of sux - ValueStack* sux_state = sux->state(); - ValueStack* end_state = end->state(); - - assert(end_state->scope() == sux_state->scope(), "scopes must match"); - assert(end_state->stack_size() == sux_state->stack_size(), "stack not equal"); - assert(end_state->locals_size() == sux_state->locals_size(), "locals not equal"); - - int index; - Value sux_value; - for_each_stack_value(sux_state, index, sux_value) { - assert(sux_value == end_state->stack_at(index), "stack not equal"); - } - for_each_local_value(sux_state, index, sux_value) { - Phi* sux_phi = sux_value->as_Phi(); - if (sux_phi != NULL && sux_phi->is_illegal()) continue; - assert(sux_value == end_state->local_at(index), "locals not equal"); - } - assert(sux_state->caller_state() == end_state->caller_state(), "caller not equal"); + // verify that state at the end of block and at the beginning of sux are equal + // no phi functions must be present at beginning of sux + ValueStack* sux_state = sux->state(); + ValueStack* end_state = end->state(); + + assert(end_state->scope() == sux_state->scope(), "scopes must match"); + assert(end_state->stack_size() == sux_state->stack_size(), "stack not equal"); + assert(end_state->locals_size() == sux_state->locals_size(), "locals not equal"); + + int index; + Value sux_value; + for_each_stack_value(sux_state, index, sux_value) { + assert(sux_value == end_state->stack_at(index), "stack not equal"); + } + for_each_local_value(sux_state, index, sux_value) { + Phi* sux_phi = sux_value->as_Phi(); + if (sux_phi != NULL && sux_phi->is_illegal()) continue; + assert(sux_value == end_state->local_at(index), "locals not equal"); + } + assert(sux_state->caller_state() == end_state->caller_state(), "caller not equal"); #endif - // find instruction before end & append first instruction of sux block - Instruction* prev = end->prev(); - Instruction* next = sux->next(); - assert(prev->as_BlockEnd() == NULL, "must not be a BlockEnd"); - prev->set_next(next); - prev->fixup_block_pointers(); - sux->disconnect_from_graph(); - block->set_end(sux->end()); - // add exception handlers of deleted block, if any - for (int k = 0; k < sux->number_of_exception_handlers(); k++) { - BlockBegin* xhandler = sux->exception_handler_at(k); - block->add_exception_handler(xhandler); - - // also substitute predecessor of exception handler - assert(xhandler->is_predecessor(sux), "missing predecessor"); - xhandler->remove_predecessor(sux); - if (!xhandler->is_predecessor(block)) { - xhandler->add_predecessor(block); - } - } + // find instruction before end & append first instruction of sux block + Instruction* prev = end->prev(); + Instruction* next = sux->next(); + assert(prev->as_BlockEnd() == NULL, "must not be a BlockEnd"); + prev->set_next(next); + prev->fixup_block_pointers(); + sux->disconnect_from_graph(); + block->set_end(sux->end()); + // add exception handlers of deleted block, if any + for (int k = 0; k < sux->number_of_exception_handlers(); k++) { + BlockBegin* xhandler = sux->exception_handler_at(k); + block->add_exception_handler(xhandler); - // debugging output - _merge_count++; - if (PrintBlockElimination) { - tty->print_cr("%d. merged B%d & B%d (stack size = %d)", - _merge_count, block->block_id(), sux->block_id(), sux->state()->stack_size()); - } + // also substitute predecessor of exception handler + assert(xhandler->is_predecessor(sux), "missing predecessor"); + xhandler->remove_predecessor(sux); + if (!xhandler->is_predecessor(block)) { + xhandler->add_predecessor(block); + } + } - _hir->verify(); - - If* if_ = block->end()->as_If(); - if (if_) { - IfOp* ifop = if_->x()->as_IfOp(); - Constant* con = if_->y()->as_Constant(); - bool swapped = false; - if (!con || !ifop) { - ifop = if_->y()->as_IfOp(); - con = if_->x()->as_Constant(); - swapped = true; + // debugging output + _merge_count++; + if (PrintBlockElimination) { + tty->print_cr("%d. merged B%d & B%d (stack size = %d)", + _merge_count, block->block_id(), sux->block_id(), sux->state()->stack_size()); + } + + _hir->verify(); + + If* if_ = block->end()->as_If(); + if (if_) { + IfOp* ifop = if_->x()->as_IfOp(); + Constant* con = if_->y()->as_Constant(); + bool swapped = false; + if (!con || !ifop) { + ifop = if_->y()->as_IfOp(); + con = if_->x()->as_Constant(); + swapped = true; + } + if (con && ifop) { + Constant* tval = ifop->tval()->as_Constant(); + Constant* fval = ifop->fval()->as_Constant(); + if (tval && fval) { + // Find the instruction before if_, starting with ifop. + // When if_ and ifop are not in the same block, prev + // becomes NULL In such (rare) cases it is not + // profitable to perform the optimization. + Value prev = ifop; + while (prev != NULL && prev->next() != if_) { + prev = prev->next(); } - if (con && ifop) { - Constant* tval = ifop->tval()->as_Constant(); - Constant* fval = ifop->fval()->as_Constant(); - if (tval && fval) { - // Find the instruction before if_, starting with ifop. - // When if_ and ifop are not in the same block, prev - // becomes NULL In such (rare) cases it is not - // profitable to perform the optimization. - Value prev = ifop; - while (prev != NULL && prev->next() != if_) { - prev = prev->next(); - } - if (prev != NULL) { - Instruction::Condition cond = if_->cond(); - BlockBegin* tsux = if_->tsux(); - BlockBegin* fsux = if_->fsux(); - if (swapped) { - cond = Instruction::mirror(cond); - } - - BlockBegin* tblock = tval->compare(cond, con, tsux, fsux); - BlockBegin* fblock = fval->compare(cond, con, tsux, fsux); - if (tblock != fblock && !if_->is_safepoint()) { - If* newif = new If(ifop->x(), ifop->cond(), false, ifop->y(), - tblock, fblock, if_->state_before(), if_->is_safepoint()); - newif->set_state(if_->state()->copy()); - - assert(prev->next() == if_, "must be guaranteed by above search"); - NOT_PRODUCT(newif->set_printable_bci(if_->printable_bci())); - prev->set_next(newif); - block->set_end(newif); - - _merge_count++; - if (PrintBlockElimination) { - tty->print_cr("%d. replaced If and IfOp at end of B%d with single If", _merge_count, block->block_id()); - } - - _hir->verify(); - } + if (prev != NULL) { + Instruction::Condition cond = if_->cond(); + BlockBegin* tsux = if_->tsux(); + BlockBegin* fsux = if_->fsux(); + if (swapped) { + cond = Instruction::mirror(cond); + } + + BlockBegin* tblock = tval->compare(cond, con, tsux, fsux); + BlockBegin* fblock = fval->compare(cond, con, tsux, fsux); + if (tblock != fblock && !if_->is_safepoint()) { + If* newif = new If(ifop->x(), ifop->cond(), false, ifop->y(), + tblock, fblock, if_->state_before(), if_->is_safepoint()); + newif->set_state(if_->state()->copy()); + + assert(prev->next() == if_, "must be guaranteed by above search"); + NOT_PRODUCT(newif->set_printable_bci(if_->printable_bci())); + prev->set_next(newif); + block->set_end(newif); + + _merge_count++; + if (PrintBlockElimination) { + tty->print_cr("%d. replaced If and IfOp at end of B%d with single If", _merge_count, block->block_id()); } + + _hir->verify(); } } } - - return true; } } - return false; + + return true; } virtual void block_do(BlockBegin* block) { - _hir->verify(); // repeat since the same block may merge again - while (try_merge(block)) { - _hir->verify(); - } + while (try_merge(block)) ; } }; -- GitLab From 0c7a4b8aa8bb672e87aae7090494719db018b9b1 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 29 Nov 2021 07:47:28 +0000 Subject: [PATCH 492/890] 8277842: IGV: Add jvms property to know where a node came from Reviewed-by: roland, neliasso, thartmann --- src/hotspot/share/opto/idealGraphPrinter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/opto/idealGraphPrinter.cpp b/src/hotspot/share/opto/idealGraphPrinter.cpp index 736e796c16c..cb403853f33 100644 --- a/src/hotspot/share/opto/idealGraphPrinter.cpp +++ b/src/hotspot/share/opto/idealGraphPrinter.cpp @@ -418,6 +418,14 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) { break; } + Node_Notes* nn = C->node_notes_at(node->_idx); + if (nn != NULL && !nn->is_clear() && nn->jvms() != NULL) { + buffer[0] = 0; + stringStream ss(buffer, sizeof(buffer) - 1); + nn->jvms()->dump_spec(&ss); + print_prop("jvms", buffer); + } + const jushort flags = node->flags(); if (flags & Node::Flag_is_Copy) { print_prop("is_copy", "true"); -- GitLab From aed53eea5ea2782c74ea05521462db2ab20b7ebd Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Mon, 29 Nov 2021 08:19:24 +0000 Subject: [PATCH 493/890] 8264838: IGV: enhance graph export functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Roberto Castañeda Lozano Co-authored-by: Nils Eliasson Reviewed-by: chagedorn, thartmann --- src/utils/IdealGraphVisualizer/.java-version | 1 + .../BatikSVGProxy/pom.xml | 85 ------------- .../com/sun/hotspot/igv/svg/BatikSVG.java | 114 ------------------ .../com/sun/hotspot/igv/svg/package-info.java | 29 ----- .../BatikSVGProxy/src/main/nbm/manifest.mf | 5 - .../com/sun/hotspot/igv/svg/Bundle.properties | 1 - src/utils/IdealGraphVisualizer/View/pom.xml | 20 ++- .../sun/hotspot/igv/view/DiagramViewer.java | 7 +- .../hotspot/igv/view/EditorTopComponent.java | 86 +++++++++---- .../igv/view/actions/ExportAction.java | 13 +- .../IdealGraphVisualizer/application/pom.xml | 5 - src/utils/IdealGraphVisualizer/pom.xml | 7 +- 12 files changed, 94 insertions(+), 279 deletions(-) create mode 100644 src/utils/IdealGraphVisualizer/.java-version delete mode 100644 src/utils/IdealGraphVisualizer/BatikSVGProxy/pom.xml delete mode 100644 src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/BatikSVG.java delete mode 100644 src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/package-info.java delete mode 100644 src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/nbm/manifest.mf delete mode 100644 src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/resources/com/sun/hotspot/igv/svg/Bundle.properties diff --git a/src/utils/IdealGraphVisualizer/.java-version b/src/utils/IdealGraphVisualizer/.java-version new file mode 100644 index 00000000000..60d3b2f4a4c --- /dev/null +++ b/src/utils/IdealGraphVisualizer/.java-version @@ -0,0 +1 @@ +15 diff --git a/src/utils/IdealGraphVisualizer/BatikSVGProxy/pom.xml b/src/utils/IdealGraphVisualizer/BatikSVGProxy/pom.xml deleted file mode 100644 index dccb16b356b..00000000000 --- a/src/utils/IdealGraphVisualizer/BatikSVGProxy/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - 4.0.0 - - IdealGraphVisualizer-parent - com.sun.hotspot.igv - 1.0-SNAPSHOT - - com.sun.hotspot.igv - BatikSVGProxy - 1.0-SNAPSHOT - nbm - BatikSVGProxy - - UTF-8 - - - - - - - org.apache.netbeans.utilities - nbm-maven-plugin - ${nbmmvnplugin.version} - true - - - com.sun.hotspot.igv.svg - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${mvncompilerplugin.version} - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-jar-plugin - ${mvnjarplugin.version} - - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - - - diff --git a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/BatikSVG.java b/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/BatikSVG.java deleted file mode 100644 index 8c3d92dc064..00000000000 --- a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/BatikSVG.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2008, 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 com.sun.hotspot.igv.svg; - -import java.awt.Graphics2D; -import java.io.Writer; -import java.io.File; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import org.w3c.dom.DOMImplementation; - -/** - * Utility class - * @author Thomas Wuerthinger - */ -public class BatikSVG { - - private BatikSVG() { - } - - private static Constructor SVGGraphics2DConstructor; - private static Method streamMethod; - private static Method createDefaultMethod; - private static Method getDOMImplementationMethod; - private static Method setEmbeddedFontsOnMethod; - private static Class classSVGGraphics2D; - - /** - * Creates a graphics object that allows to be exported to SVG data using the {@link #printToStream(Graphics2D, Writer, boolean) printToStream} method. - * @return the newly created Graphics2D object or null if the library does not exist - */ - public static Graphics2D createGraphicsObject() { - try { - if (SVGGraphics2DConstructor == null) { - String batikJar = System.getenv().get("IGV_BATIK_JAR"); - if (batikJar == null) { - return null; - } - // Load batik in it's own class loader since some it's support jars interfere with the JDK - URL url = new File(batikJar).toURI().toURL(); - ClassLoader cl = new URLClassLoader(new URL[] { url }); - Class classGenericDOMImplementation = cl.loadClass("org.apache.batik.dom.GenericDOMImplementation"); - Class classSVGGeneratorContext = cl.loadClass("org.apache.batik.svggen.SVGGeneratorContext"); - classSVGGraphics2D = cl.loadClass("org.apache.batik.svggen.SVGGraphics2D"); - getDOMImplementationMethod = classGenericDOMImplementation.getDeclaredMethod("getDOMImplementation", new Class[0]); - createDefaultMethod = classSVGGeneratorContext.getDeclaredMethod("createDefault", new Class[]{org.w3c.dom.Document.class}); - setEmbeddedFontsOnMethod = classSVGGeneratorContext.getDeclaredMethod("setEmbeddedFontsOn", new Class[]{boolean.class}); - streamMethod = classSVGGraphics2D.getDeclaredMethod("stream", Writer.class, boolean.class); - SVGGraphics2DConstructor = classSVGGraphics2D.getConstructor(classSVGGeneratorContext, boolean.class); - } - DOMImplementation dom = (DOMImplementation) getDOMImplementationMethod.invoke(null); - org.w3c.dom.Document document = dom.createDocument("http://www.w3.org/2000/svg", "svg", null); - Object ctx = createDefaultMethod.invoke(null, document); - setEmbeddedFontsOnMethod.invoke(ctx, true); - Graphics2D svgGenerator = (Graphics2D) SVGGraphics2DConstructor.newInstance(ctx, true); - return svgGenerator; - } catch (ClassNotFoundException e) { - return null; - } catch (NoSuchMethodException e) { - return null; - } catch (IllegalAccessException e) { - return null; - } catch (InvocationTargetException e) { - return null; - } catch (InstantiationException e) { - return null; - } catch (MalformedURLException e) { - return null; - } - } - - /** - * Serializes a graphics object to a stream in SVG format. - * @param svgGenerator the graphics object. Only graphics objects created by the {@link #createGraphicsObject() createGraphicsObject} method are valid. - * @param stream the stream to which the data is written - * @param useCSS whether to use CSS styles in the SVG output - */ - public static void printToStream(Graphics2D svgGenerator, Writer stream, boolean useCSS) { - assert classSVGGraphics2D != null; - assert classSVGGraphics2D.isInstance(svgGenerator); - try { - streamMethod.invoke(svgGenerator, stream, useCSS); - } catch (IllegalAccessException e) { - assert false; - } catch (InvocationTargetException e) { - assert false; - } - } -} diff --git a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/package-info.java b/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/package-info.java deleted file mode 100644 index 272fc48e96f..00000000000 --- a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/java/com/sun/hotspot/igv/svg/package-info.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2008, 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 package is used to proxy the SVG export functionality of the BatikSVG library. Reflection is used such that the - * library is optional and need not be present at build time. - */ -package com.sun.hotspot.igv.svg; - diff --git a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/nbm/manifest.mf b/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/nbm/manifest.mf deleted file mode 100644 index 175014d653e..00000000000 --- a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/nbm/manifest.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module: com.sun.hotspot.igv.svg -OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/svg/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 - diff --git a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/resources/com/sun/hotspot/igv/svg/Bundle.properties b/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/resources/com/sun/hotspot/igv/svg/Bundle.properties deleted file mode 100644 index e579912925b..00000000000 --- a/src/utils/IdealGraphVisualizer/BatikSVGProxy/src/main/resources/com/sun/hotspot/igv/svg/Bundle.properties +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module-Name=BatikSVGProxy diff --git a/src/utils/IdealGraphVisualizer/View/pom.xml b/src/utils/IdealGraphVisualizer/View/pom.xml index 12b2a8678b4..0b1b0d77f31 100644 --- a/src/utils/IdealGraphVisualizer/View/pom.xml +++ b/src/utils/IdealGraphVisualizer/View/pom.xml @@ -81,11 +81,6 @@ SelectionCoordinator ${project.version} - - com.sun.hotspot.igv - BatikSVGProxy - ${project.version} - com.sun.hotspot.igv Settings @@ -151,6 +146,21 @@ org-netbeans-api-visual ${netbeans.version} + + org.apache.xmlgraphics + batik-dom + ${batik.version} + + + org.apache.xmlgraphics + batik-svggen + ${batik.version} + + + com.github.librepdf + openpdf + ${openpdf.version} + diff --git a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramViewer.java b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramViewer.java index 42697d025fe..2c58ac4dd26 100644 --- a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramViewer.java +++ b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramViewer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -27,6 +27,7 @@ package com.sun.hotspot.igv.view; import com.sun.hotspot.igv.graph.Figure; import java.awt.Component; import java.awt.Graphics2D; +import java.awt.Rectangle; import java.util.Collection; import java.util.List; import javax.swing.JComponent; @@ -44,7 +45,7 @@ interface DiagramViewer { PANNING, } - public void paint(Graphics2D svgGenerator); + public void paint(Graphics2D generator); public Lookup getLookup(); @@ -70,4 +71,6 @@ interface DiagramViewer { public void setInteractionMode(InteractionMode mode); + public Rectangle getBounds(); + } diff --git a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java index 76a73b97068..cf5e965de69 100644 --- a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java +++ b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java @@ -36,7 +36,6 @@ import com.sun.hotspot.igv.filter.FilterChainProvider; import com.sun.hotspot.igv.graph.Diagram; import com.sun.hotspot.igv.graph.Figure; import com.sun.hotspot.igv.graph.services.DiagramProvider; -import com.sun.hotspot.igv.svg.BatikSVG; import com.sun.hotspot.igv.util.LookupHistory; import com.sun.hotspot.igv.util.RangeSlider; import com.sun.hotspot.igv.view.actions.*; @@ -48,10 +47,21 @@ import java.awt.event.KeyListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.*; import javax.swing.*; import javax.swing.border.Border; +import org.apache.batik.dom.GenericDOMImplementation; +import org.apache.batik.svggen.SVGGeneratorContext; +import org.apache.batik.svggen.SVGGraphics2D; +import com.lowagie.text.Document; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.PdfWriter; +import com.lowagie.text.pdf.PdfContentByte; +import com.lowagie.text.pdf.PdfTemplate; +import com.lowagie.text.pdf.PdfGraphics2D; +import org.w3c.dom.DOMImplementation; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; import org.openide.actions.RedoAction; @@ -103,30 +113,14 @@ public final class EditorTopComponent extends TopComponent implements PropertyCh @Override public void export(File f) { - Graphics2D svgGenerator = BatikSVG.createGraphicsObject(); - - if (svgGenerator == null) { - NotifyDescriptor message = new NotifyDescriptor.Message("For export to SVG files the Batik SVG Toolkit must be intalled.", NotifyDescriptor.ERROR_MESSAGE); - DialogDisplayer.getDefault().notifyLater(message); + String lcFileName = f.getName().toLowerCase(); + if (lcFileName.endsWith(".pdf")) { + exportToPDF(scene, f); + } else if (lcFileName.endsWith(".svg")) { + exportToSVG(scene, f); } else { - scene.paint(svgGenerator); - FileOutputStream os = null; - try { - os = new FileOutputStream(f); - Writer out = new OutputStreamWriter(os, UTF_8); - BatikSVG.printToStream(svgGenerator, out, true); - } catch (FileNotFoundException e) { - NotifyDescriptor message = new NotifyDescriptor.Message("For export to SVG files the Batik SVG Toolkit must be intalled.", NotifyDescriptor.ERROR_MESSAGE); - DialogDisplayer.getDefault().notifyLater(message); - } finally { - if (os != null) { - try { - os.close(); - } catch (IOException e) { - } - } - } - + NotifyDescriptor message = new NotifyDescriptor.Message("Unknown image file extension: expected either '.pdf' or '.svg'", NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notifyLater(message); } } }; @@ -639,5 +633,47 @@ public final class EditorTopComponent extends TopComponent implements PropertyCh @Override protected Object writeReplace() throws ObjectStreamException { throw new NotSerializableException(); -} + } + + private static void exportToPDF(DiagramViewer scene, File f) { + int width = scene.getBounds().width; + int height = scene.getBounds().height; + com.lowagie.text.Document document = new Document(new Rectangle(width, height)); + PdfWriter writer = null; + try { + writer = PdfWriter.getInstance(document, new FileOutputStream(f)); + writer.setCloseStream(true); + document.open(); + PdfContentByte contentByte = writer.getDirectContent(); + PdfTemplate template = contentByte.createTemplate(width, height); + PdfGraphics2D pdfGenerator = new PdfGraphics2D(contentByte, width, height); + scene.paint(pdfGenerator); + pdfGenerator.dispose(); + contentByte.addTemplate(template, 0, 0); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (document.isOpen()) { + document.close(); + } + if (writer != null) { + writer.close(); + } + } + } + + private static void exportToSVG(DiagramViewer scene, File f) { + DOMImplementation dom = GenericDOMImplementation.getDOMImplementation(); + org.w3c.dom.Document document = dom.createDocument("http://www.w3.org/2000/svg", "svg", null); + SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document); + ctx.setEmbeddedFontsOn(true); + SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, true); + scene.paint(svgGenerator); + try (FileOutputStream os = new FileOutputStream(f)) { + Writer out = new OutputStreamWriter(os, StandardCharsets.UTF_8); + svgGenerator.stream(out, true); + } catch (IOException e) { + e.printStackTrace(); + } + } } diff --git a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/actions/ExportAction.java b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/actions/ExportAction.java index 8583a6fbf35..e5ea4025c33 100644 --- a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/actions/ExportAction.java +++ b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/actions/ExportAction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -45,7 +45,7 @@ public final class ExportAction extends CallableSystemAction implements LookupLi private final Lookup.Result result; public ExportAction() { - putValue(Action.SHORT_DESCRIPTION, "Export current graph as SVG file"); + putValue(Action.SHORT_DESCRIPTION, "Export current graph as image file"); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK)); lookup = Utilities.actionsGlobalContext(); result = lookup.lookup(new Lookup.Template<>(ExportCookie.class)); @@ -66,12 +66,15 @@ public final class ExportAction extends CallableSystemAction implements LookupLi @Override public boolean accept(File f) { - return true; + String lcFileName = f.getName().toLowerCase(); + return lcFileName.endsWith(".pdf") || + lcFileName.endsWith(".svg") || + f.isDirectory(); } @Override public String getDescription() { - return "SVG files (*.svg)"; + return "Image files (*.pdf, *.svg)"; } }); fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT))); @@ -80,7 +83,7 @@ public final class ExportAction extends CallableSystemAction implements LookupLi if (fc.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { File file = fc.getSelectedFile(); if (!file.getName().contains(".")) { - file = new File(file.getAbsolutePath() + ".svg"); + file = new File(file.getAbsolutePath() + ".pdf"); } File dir = file; diff --git a/src/utils/IdealGraphVisualizer/application/pom.xml b/src/utils/IdealGraphVisualizer/application/pom.xml index b5422fecb52..5fcb7252c5d 100644 --- a/src/utils/IdealGraphVisualizer/application/pom.xml +++ b/src/utils/IdealGraphVisualizer/application/pom.xml @@ -142,11 +142,6 @@ Graal ${project.version} - - ${project.groupId} - BatikSVGProxy - ${project.version} - ${project.groupId} View diff --git a/src/utils/IdealGraphVisualizer/pom.xml b/src/utils/IdealGraphVisualizer/pom.xml index c1b1896dde4..daaae24a5fd 100644 --- a/src/utils/IdealGraphVisualizer/pom.xml +++ b/src/utils/IdealGraphVisualizer/pom.xml @@ -86,16 +86,17 @@ ServerCompiler FilterWindow Graal - BatikSVGProxy View RELEASE123 1.0.2 - 4.3 + 4.6 3.8.1 - 3.1.2 + 3.2.0 4.13.2 + 1.14 + 1.3.26 idealgraphvisualizer -- GitLab From 9a3a9b139178f2645d51a0f12d95a8b424cd5b9d Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Mon, 29 Nov 2021 09:06:13 +0000 Subject: [PATCH 494/890] 8277865: G1: Change integer division to floating point division Reviewed-by: ayang, tschatzl --- src/hotspot/share/gc/g1/g1ConcurrentMark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp index dea7a858cba..ece2ac0452a 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp @@ -770,7 +770,7 @@ public: double worker_cost() const override { // The work done per region is very small, therefore we choose this magic number to cap the number // of threads used when there are few regions. - const uint regions_per_thread = 1000; + const double regions_per_thread = 1000; return _claimer.n_regions() / regions_per_thread; } -- GitLab From e3e5908d0d385ef908ba9752908aaf28b4b3e4f4 Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Mon, 29 Nov 2021 09:22:16 +0000 Subject: [PATCH 495/890] 8277847: Support toolGuide tag in class-level documentation Reviewed-by: alanb, jjg --- .../src/classes/build/tools/taglet/ToolGuide.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/make/jdk/src/classes/build/tools/taglet/ToolGuide.java b/make/jdk/src/classes/build/tools/taglet/ToolGuide.java index ae70d424222..f3ce80cf241 100644 --- a/make/jdk/src/classes/build/tools/taglet/ToolGuide.java +++ b/make/jdk/src/classes/build/tools/taglet/ToolGuide.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -31,8 +31,8 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.lang.model.element.Element; -import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; import com.sun.source.doctree.DocTree; import com.sun.source.doctree.UnknownBlockTagTree; @@ -75,7 +75,7 @@ public class ToolGuide implements Taglet { */ @Override public Set getAllowedLocations() { - return EnumSet.of(MODULE, PACKAGE); + return EnumSet.of(MODULE, PACKAGE, TYPE); } @Override @@ -151,6 +151,12 @@ public class ToolGuide implements Taglet { return pe.getEnclosingElement() != null ? "../" + pkgPart : pkgPart; + case CLASS: + TypeElement te = (TypeElement)elem; + return te.getQualifiedName() + .toString() + .replace('.', '/') + .replaceAll("[^/]+", ".."); default: throw new IllegalArgumentException(elem.getKind().toString()); -- GitLab From 72bacf8d256071773d8fd9f9c2d0aebb2cb32dea Mon Sep 17 00:00:00 2001 From: Patric Hedlin Date: Mon, 29 Nov 2021 10:34:13 +0000 Subject: [PATCH 496/890] 8276108: Wrong instruction generation in aarch64 backend Co-authored-by: Nick Gasson Reviewed-by: aph, neliasso --- src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 19 ++++++++++--------- .../cpu/aarch64/assembler_aarch64.inline.hpp | 8 +++++++- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 15 +++++++-------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 9eee231ec0f..0b460582e6e 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -478,16 +478,17 @@ class Address { assert(size == 0, "bad size"); size = 0b100; } + assert(offset_ok_for_immed(_offset, size), + "must be, was: %ld, %d", _offset, size); unsigned mask = (1 << size) - 1; - if (_offset < 0 || _offset & mask) - { - i->f(0b00, 25, 24); - i->f(0, 21), i->f(0b00, 11, 10); - i->sf(_offset, 20, 12); - } else { - i->f(0b01, 25, 24); - i->f(_offset >> size, 21, 10); - } + if (_offset < 0 || _offset & mask) { + i->f(0b00, 25, 24); + i->f(0, 21), i->f(0b00, 11, 10); + i->sf(_offset, 20, 12); + } else { + i->f(0b01, 25, 24); + i->f(_offset >> size, 21, 10); + } } break; diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp index 9fabf1699c5..e7efe472b82 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp @@ -30,8 +30,14 @@ #include "asm/codeBuffer.hpp" #include "code/codeCache.hpp" - +// Check if an offset is within the encoding range for LDR/STR instructions +// with an immediate offset, either using unscaled signed 9-bits or, scaled +// unsigned 12-bits. We favour the scaled unsigned encoding for all aligned +// offsets (only using the signed 9-bit encoding for negative and unaligned +// offsets). As a precondition, 0 <= shift <= 4 is the log2(size), for the +// supported data widths, {1, 2, 4, 8, 16} bytes. inline bool Address::offset_ok_for_immed(int64_t offset, uint shift) { + precond(shift < 5); uint mask = (1 << shift) - 1; if (offset < 0 || (offset & mask) != 0) { // Unscaled signed offset, encoded in a signed imm9 field. diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 254ea0aaa98..fead8af7d1b 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -187,14 +187,13 @@ Address LIR_Assembler::as_Address(LIR_Address* addr, Register tmp) { default: ShouldNotReachHere(); } - } else { - intptr_t addr_offset = intptr_t(addr->disp()); - if (Address::offset_ok_for_immed(addr_offset, addr->scale())) - return Address(base, addr_offset, Address::lsl(addr->scale())); - else { - __ mov(tmp, addr_offset); - return Address(base, tmp, Address::lsl(addr->scale())); - } + } else { + assert(addr->scale() == 0, + "expected for immediate operand, was: %d", addr->scale()); + ptrdiff_t offset = ptrdiff_t(addr->disp()); + // NOTE: Does not handle any 16 byte vector access. + const uint type_size = type2aelembytes(addr->type(), true); + return __ legitimize_address(Address(base, offset), type_size, tmp); } return Address(); } -- GitLab From 37de442269e8c14e0a112e26a8cbb63e12dec9e7 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Mon, 29 Nov 2021 10:50:43 +0000 Subject: [PATCH 497/890] 8275241: Unused ArrayList is created in RequestEngine.addHooks Reviewed-by: egahlin --- src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java index 49aa2bcd3f2..ff728fbf4f2 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java @@ -28,7 +28,6 @@ package jdk.jfr.internal; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -162,10 +161,8 @@ public final class RequestEngine { // Only to be used for JVM events. No access control contest // or check if hook already exists static void addHooks(List newEntries) { - List addEntries = new ArrayList<>(); for (RequestHook rh : newEntries) { rh.type.setEventHook(true); - addEntries.add(rh); logHook("Added", rh.type); } entries.addAll(newEntries); -- GitLab From 2622ab3fe94814fb4f7f22e4015ef1519e546905 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 29 Nov 2021 11:58:13 +0000 Subject: [PATCH 498/890] 8277928: Fix compilation on macosx-aarch64 after 8276108 Reviewed-by: shade, dholmes --- src/hotspot/cpu/aarch64/assembler_aarch64.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 0b460582e6e..1bf593b4524 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -479,7 +479,7 @@ class Address { size = 0b100; } assert(offset_ok_for_immed(_offset, size), - "must be, was: %ld, %d", _offset, size); + "must be, was: " INT64_FORMAT ", %d", _offset, size); unsigned mask = (1 << size) - 1; if (_offset < 0 || _offset & mask) { i->f(0b00, 25, 24); -- GitLab From e5676f8d0b4f9e97497581e848e8b06fb7e11828 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Mon, 29 Nov 2021 12:05:10 +0000 Subject: [PATCH 499/890] 8277450: Record number of references into collection set during gc Reviewed-by: kbarrett, iwalulya --- src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp | 2 ++ src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp | 1 + src/hotspot/share/gc/g1/g1OopClosures.hpp | 6 ++++-- src/hotspot/share/gc/g1/g1OopClosures.inline.hpp | 1 + src/hotspot/share/gc/g1/g1RemSet.cpp | 12 ++++++++++-- test/hotspot/jtreg/gc/g1/TestGCLogMessages.java | 1 + 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp index c77dd7196f5..7c3eba2be94 100644 --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp @@ -116,10 +116,12 @@ G1GCPhaseTimes::G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads) : _gc_par_phases[ScanHR]->create_thread_work_items("Scanned Cards:", ScanHRScannedCards); _gc_par_phases[ScanHR]->create_thread_work_items("Scanned Blocks:", ScanHRScannedBlocks); _gc_par_phases[ScanHR]->create_thread_work_items("Claimed Chunks:", ScanHRClaimedChunks); + _gc_par_phases[ScanHR]->create_thread_work_items("Found Roots:", ScanHRFoundRoots); _gc_par_phases[OptScanHR]->create_thread_work_items("Scanned Cards:", ScanHRScannedCards); _gc_par_phases[OptScanHR]->create_thread_work_items("Scanned Blocks:", ScanHRScannedBlocks); _gc_par_phases[OptScanHR]->create_thread_work_items("Claimed Chunks:", ScanHRClaimedChunks); + _gc_par_phases[OptScanHR]->create_thread_work_items("Found Roots:", ScanHRFoundRoots); _gc_par_phases[OptScanHR]->create_thread_work_items("Scanned Refs:", ScanHRScannedOptRefs); _gc_par_phases[OptScanHR]->create_thread_work_items("Used Memory:", ScanHRUsedMemory); diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp index 255aab6f96e..9db7f18dd34 100644 --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp @@ -123,6 +123,7 @@ class G1GCPhaseTimes : public CHeapObj { ScanHRScannedCards, ScanHRScannedBlocks, ScanHRClaimedChunks, + ScanHRFoundRoots, ScanHRScannedOptRefs, ScanHRUsedMemory }; diff --git a/src/hotspot/share/gc/g1/g1OopClosures.hpp b/src/hotspot/share/gc/g1/g1OopClosures.hpp index 9f0c4a23a55..0dbaabbf639 100644 --- a/src/hotspot/share/gc/g1/g1OopClosures.hpp +++ b/src/hotspot/share/gc/g1/g1OopClosures.hpp @@ -61,10 +61,12 @@ public: // Used to scan cards from the DCQS or the remembered sets during garbage collection. class G1ScanCardClosure : public G1ScanClosureBase { + size_t& _heap_roots_found; public: G1ScanCardClosure(G1CollectedHeap* g1h, - G1ParScanThreadState* pss) : - G1ScanClosureBase(g1h, pss) { } + G1ParScanThreadState* pss, + size_t& heap_roots_found) : + G1ScanClosureBase(g1h, pss), _heap_roots_found(heap_roots_found) { } template void do_oop_work(T* p); virtual void do_oop(narrowOop* p) { do_oop_work(p); } diff --git a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp index ac8c370bfd0..2cd41d4255f 100644 --- a/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp +++ b/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp @@ -180,6 +180,7 @@ inline void G1ScanCardClosure::do_oop_work(T* p) { // Since the source is always from outside the collection set, here we implicitly know // that this is a cross-region reference too. prefetch_and_push(p, obj); + _heap_roots_found++; } else if (!HeapRegion::is_in_same_region(p, obj)) { handle_non_cset_obj_common(region_attr, p, obj); _par_scan_state->enqueue_card_if_tracked(region_attr, p, obj); diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index b689e649762..dcde1bd8fa5 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -774,6 +774,7 @@ class G1ScanHRForRegionClosure : public HeapRegionClosure { size_t _cards_scanned; size_t _blocks_scanned; size_t _chunks_claimed; + size_t _heap_roots_found; Tickspan _rem_set_root_scan_time; Tickspan _rem_set_trim_partially_time; @@ -785,7 +786,7 @@ class G1ScanHRForRegionClosure : public HeapRegionClosure { HeapWord* scan_memregion(uint region_idx_for_card, MemRegion mr) { HeapRegion* const card_region = _g1h->region_at(region_idx_for_card); - G1ScanCardClosure card_cl(_g1h, _pss); + G1ScanCardClosure card_cl(_g1h, _pss, _heap_roots_found); HeapWord* const scanned_to = card_region->oops_on_memregion_seq_iterate_careful(mr, &card_cl); assert(scanned_to != NULL, "Should be able to scan range"); @@ -880,6 +881,7 @@ public: _cards_scanned(0), _blocks_scanned(0), _chunks_claimed(0), + _heap_roots_found(0), _rem_set_root_scan_time(), _rem_set_trim_partially_time(), _scanned_to(NULL), @@ -906,6 +908,7 @@ public: size_t cards_scanned() const { return _cards_scanned; } size_t blocks_scanned() const { return _blocks_scanned; } size_t chunks_claimed() const { return _chunks_claimed; } + size_t heap_roots_found() const { return _heap_roots_found; } }; void G1RemSet::scan_heap_roots(G1ParScanThreadState* pss, @@ -924,6 +927,7 @@ void G1RemSet::scan_heap_roots(G1ParScanThreadState* pss, p->record_or_add_thread_work_item(scan_phase, worker_id, cl.cards_scanned(), G1GCPhaseTimes::ScanHRScannedCards); p->record_or_add_thread_work_item(scan_phase, worker_id, cl.blocks_scanned(), G1GCPhaseTimes::ScanHRScannedBlocks); p->record_or_add_thread_work_item(scan_phase, worker_id, cl.chunks_claimed(), G1GCPhaseTimes::ScanHRClaimedChunks); + p->record_or_add_thread_work_item(scan_phase, worker_id, cl.heap_roots_found(), G1GCPhaseTimes::ScanHRFoundRoots); } // Heap region closure to be applied to all regions in the current collection set @@ -937,6 +941,7 @@ class G1ScanCollectionSetRegionClosure : public HeapRegionClosure { uint _worker_id; + size_t _opt_roots_scanned; size_t _opt_refs_scanned; size_t _opt_refs_memory_used; @@ -951,7 +956,7 @@ class G1ScanCollectionSetRegionClosure : public HeapRegionClosure { G1OopStarChunkedList* opt_rem_set_list = _pss->oops_into_optional_region(r); - G1ScanCardClosure scan_cl(G1CollectedHeap::heap(), _pss); + G1ScanCardClosure scan_cl(G1CollectedHeap::heap(), _pss, _opt_roots_scanned); G1ScanRSForOptionalClosure cl(G1CollectedHeap::heap(), &scan_cl); _opt_refs_scanned += opt_rem_set_list->oops_do(&cl, _pss->closures()->strong_oops()); _opt_refs_memory_used += opt_rem_set_list->used_memory(); @@ -970,6 +975,7 @@ public: _scan_phase(scan_phase), _code_roots_phase(code_roots_phase), _worker_id(worker_id), + _opt_roots_scanned(0), _opt_refs_scanned(0), _opt_refs_memory_used(0), _strong_code_root_scan_time(), @@ -1006,6 +1012,7 @@ public: Tickspan rem_set_opt_root_scan_time() const { return _rem_set_opt_root_scan_time; } Tickspan rem_set_opt_trim_partially_time() const { return _rem_set_opt_trim_partially_time; } + size_t opt_roots_scanned() const { return _opt_roots_scanned; } size_t opt_refs_scanned() const { return _opt_refs_scanned; } size_t opt_refs_memory_used() const { return _opt_refs_memory_used; } }; @@ -1028,6 +1035,7 @@ void G1RemSet::scan_collection_set_regions(G1ParScanThreadState* pss, // At this time we record some metrics only for the evacuations after the initial one. if (scan_phase == G1GCPhaseTimes::OptScanHR) { + p->record_or_add_thread_work_item(scan_phase, worker_id, cl.opt_roots_scanned(), G1GCPhaseTimes::ScanHRFoundRoots); p->record_or_add_thread_work_item(scan_phase, worker_id, cl.opt_refs_scanned(), G1GCPhaseTimes::ScanHRScannedOptRefs); p->record_or_add_thread_work_item(scan_phase, worker_id, cl.opt_refs_memory_used(), G1GCPhaseTimes::ScanHRUsedMemory); } diff --git a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java index a9f347dbb07..3b997d74dc1 100644 --- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java +++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java @@ -142,6 +142,7 @@ public class TestGCLogMessages { new LogMessageWithLevel("Scanned Cards", Level.DEBUG), new LogMessageWithLevel("Scanned Blocks", Level.DEBUG), new LogMessageWithLevel("Claimed Chunks", Level.DEBUG), + new LogMessageWithLevel("Found Roots", Level.DEBUG), // Code Roots Scan new LogMessageWithLevel("Code Root Scan", Level.DEBUG), // Object Copy -- GitLab From 45e8973a22424d76d62cd29f6f934116ceb695fb Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Mon, 29 Nov 2021 12:13:51 +0000 Subject: [PATCH 500/890] 8277896: Remove unused BOTConstants member methods Reviewed-by: kbarrett --- src/hotspot/share/gc/shared/blockOffsetTable.hpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.hpp b/src/hotspot/share/gc/shared/blockOffsetTable.hpp index ff656823a6c..fef56d31205 100644 --- a/src/hotspot/share/gc/shared/blockOffsetTable.hpp +++ b/src/hotspot/share/gc/shared/blockOffsetTable.hpp @@ -67,17 +67,10 @@ public: static size_t power_to_cards_back(uint i) { return (size_t)1 << (LogBase * i); } - static size_t power_to_words_back(uint i) { - return power_to_cards_back(i) * N_words; - } static size_t entry_to_cards_back(u_char entry) { assert(entry >= N_words, "Precondition"); return power_to_cards_back(entry - N_words); } - static size_t entry_to_words_back(u_char entry) { - assert(entry >= N_words, "Precondition"); - return power_to_words_back(entry - N_words); - } }; ////////////////////////////////////////////////////////////////////////// -- GitLab From 960bdde7ebc59cefc5c60fc21b8c8267d7c0b631 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Mon, 29 Nov 2021 12:19:45 +0000 Subject: [PATCH 501/890] 8277904: G1: Remove G1CardSetArray::max_entries Reviewed-by: tschatzl --- src/hotspot/share/gc/g1/g1CardSetContainers.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp index c273695aa63..0c6270d228f 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp @@ -228,7 +228,6 @@ public: void iterate(CardVisitor& found); size_t num_entries() const { return _num_entries & EntryMask; } - size_t max_entries() const { return _size; } static size_t header_size_in_bytes() { return header_size_in_bytes_internal(); } -- GitLab From 614c6e61fa3a9f094a311b12e780491c611657e6 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Mon, 29 Nov 2021 12:29:06 +0000 Subject: [PATCH 502/890] 8277878: Fix compiler tests after JDK-8275908 Reviewed-by: thartmann, chagedorn --- .../compiler/exceptions/OptimizeImplicitExceptions.java | 2 +- test/hotspot/jtreg/compiler/uncommontrap/Decompile.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java b/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java index 1917fc68c5d..289353a38a2 100644 --- a/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java +++ b/test/hotspot/jtreg/compiler/exceptions/OptimizeImplicitExceptions.java @@ -32,7 +32,7 @@ * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+UseSerialGC -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation + * -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation * -XX:CompileCommand=compileonly,compiler.exceptions.OptimizeImplicitExceptions::throwImplicitException * compiler.exceptions.OptimizeImplicitExceptions */ diff --git a/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java b/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java index 829612b8b12..3ea6bb5cb29 100644 --- a/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java +++ b/test/hotspot/jtreg/compiler/uncommontrap/Decompile.java @@ -32,7 +32,7 @@ * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+UseSerialGC -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation + * -Xbatch -XX:-UseOnStackReplacement -XX:-TieredCompilation * -XX:CompileCommand=compileonly,compiler.uncommontrap.Decompile::uncommonTrap * -XX:CompileCommand=inline,compiler.uncommontrap.Decompile*::foo * compiler.uncommontrap.Decompile @@ -54,7 +54,8 @@ public class Decompile { private static final int Tier0InvokeNotifyFreq = (int)Math.pow(2, WB.getIntxVMFlag("Tier0InvokeNotifyFreqLog")); // VM builds without JVMCI like x86_32 call the bimorphic inlining trap just 'bimorphic' // while all the other builds with JVMCI call it 'bimorphic_or_optimized_type_check'. - private static final boolean isJVMCISupported = WhiteBox.getWhiteBox().isJVMCISupportedByGC(); + // Only builds with JVMCI have the "EnableJVMCI" flag. + private static final boolean isJVMCISupported = (WB.getBooleanVMFlag("EnableJVMCI") != null); private static final String bimorphicTrapName = isJVMCISupported ? "bimorphic_or_optimized_type_check" : "bimorphic"; static class Base { -- GitLab From ad51d0692534744d04a32959e7e50ee5e87adff5 Mon Sep 17 00:00:00 2001 From: Ivan Walulya Date: Mon, 29 Nov 2021 13:10:06 +0000 Subject: [PATCH 503/890] 8277789: G1: G1CardSetConfiguration prefixes num_ and max_ used interchangeably Reviewed-by: mli, tschatzl --- src/hotspot/share/gc/g1/g1Arguments.cpp | 4 +- src/hotspot/share/gc/g1/g1CardSet.cpp | 48 +++++++++---------- src/hotspot/share/gc/g1/g1CardSet.hpp | 26 +++++----- .../gc/g1/g1CardSetContainers.inline.hpp | 18 +++---- test/hotspot/gtest/gc/g1/test_g1CardSet.cpp | 8 ++-- 5 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp index 6750e61a312..1af2aebc7d2 100644 --- a/src/hotspot/share/gc/g1/g1Arguments.cpp +++ b/src/hotspot/share/gc/g1/g1Arguments.cpp @@ -135,8 +135,8 @@ void G1Arguments::initialize_card_set_configuration() { uint region_size_log_mb = (uint)MAX2(HeapRegion::LogOfHRGrainBytes - LOG_M, 0); if (FLAG_IS_DEFAULT(G1RemSetArrayOfCardsEntries)) { - uint num_cards_in_inline_ptr = G1CardSetConfiguration::num_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift); - FLAG_SET_ERGO(G1RemSetArrayOfCardsEntries, MAX2(num_cards_in_inline_ptr * 2, + uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift); + FLAG_SET_ERGO(G1RemSetArrayOfCardsEntries, MAX2(max_cards_in_inline_ptr * 2, G1RemSetArrayOfCardsEntriesBase * (1u << (region_size_log_mb + 1)))); } diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index eb39beaef0b..370e6a06dca 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -57,7 +57,7 @@ static uint default_log2_card_region_per_region() { G1CardSetConfiguration::G1CardSetConfiguration() : G1CardSetConfiguration(HeapRegion::LogCardsPerRegion, /* inline_ptr_bits_per_card */ - G1RemSetArrayOfCardsEntries, /* num_cards_in_array */ + G1RemSetArrayOfCardsEntries, /* max_cards_in_array */ (double)G1RemSetCoarsenHowlBitmapToHowlFullPercent / 100, /* cards_in_bitmap_threshold_percent */ G1RemSetHowlNumBuckets, /* num_buckets_in_howl */ (double)G1RemSetCoarsenHowlToFullPercent / 100, /* cards_in_howl_threshold_percent */ @@ -68,17 +68,17 @@ G1CardSetConfiguration::G1CardSetConfiguration() : "inconsistent heap region virtualization setup"); } -G1CardSetConfiguration::G1CardSetConfiguration(uint num_cards_in_array, +G1CardSetConfiguration::G1CardSetConfiguration(uint max_cards_in_array, double cards_in_bitmap_threshold_percent, uint max_buckets_in_howl, double cards_in_howl_threshold_percent, uint max_cards_in_card_set, uint log2_card_region_per_region) : G1CardSetConfiguration(log2i_exact(max_cards_in_card_set), /* inline_ptr_bits_per_card */ - num_cards_in_array, /* num_cards_in_array */ + max_cards_in_array, /* max_cards_in_array */ cards_in_bitmap_threshold_percent, /* cards_in_bitmap_threshold_percent */ G1CardSetHowl::num_buckets(max_cards_in_card_set, /* num_buckets_in_howl */ - num_cards_in_array, + max_cards_in_array, max_buckets_in_howl), cards_in_howl_threshold_percent, /* cards_in_howl_threshold_percent */ max_cards_in_card_set, /* max_cards_in_cardset */ @@ -86,21 +86,21 @@ G1CardSetConfiguration::G1CardSetConfiguration(uint num_cards_in_array, { } G1CardSetConfiguration::G1CardSetConfiguration(uint inline_ptr_bits_per_card, - uint num_cards_in_array, + uint max_cards_in_array, double cards_in_bitmap_threshold_percent, uint num_buckets_in_howl, double cards_in_howl_threshold_percent, uint max_cards_in_card_set, uint log2_card_regions_per_heap_region) : _inline_ptr_bits_per_card(inline_ptr_bits_per_card), - _num_cards_in_array(num_cards_in_array), + _max_cards_in_array(max_cards_in_array), _num_buckets_in_howl(num_buckets_in_howl), _max_cards_in_card_set(max_cards_in_card_set), _cards_in_howl_threshold(max_cards_in_card_set * cards_in_howl_threshold_percent), - _num_cards_in_howl_bitmap(G1CardSetHowl::bitmap_size(_max_cards_in_card_set, _num_buckets_in_howl)), - _cards_in_howl_bitmap_threshold(_num_cards_in_howl_bitmap * cards_in_bitmap_threshold_percent), - _log2_num_cards_in_howl_bitmap(log2i_exact(_num_cards_in_howl_bitmap)), - _bitmap_hash_mask(~(~(0) << _log2_num_cards_in_howl_bitmap)), + _max_cards_in_howl_bitmap(G1CardSetHowl::bitmap_size(_max_cards_in_card_set, _num_buckets_in_howl)), + _cards_in_howl_bitmap_threshold(_max_cards_in_howl_bitmap * cards_in_bitmap_threshold_percent), + _log2_max_cards_in_howl_bitmap(log2i_exact(_max_cards_in_howl_bitmap)), + _bitmap_hash_mask(~(~(0) << _log2_max_cards_in_howl_bitmap)), _log2_card_regions_per_heap_region(log2_card_regions_per_heap_region), _log2_cards_per_card_region(log2i_exact(_max_cards_in_card_set) - _log2_card_regions_per_heap_region) { @@ -118,8 +118,8 @@ G1CardSetConfiguration::~G1CardSetConfiguration() { void G1CardSetConfiguration::init_card_set_alloc_options() { _card_set_alloc_options = NEW_C_HEAP_ARRAY(G1CardSetAllocOptions, num_mem_object_types(), mtGC); new (&_card_set_alloc_options[0]) G1CardSetAllocOptions((uint)CardSetHash::get_node_size()); - new (&_card_set_alloc_options[1]) G1CardSetAllocOptions((uint)G1CardSetArray::size_in_bytes(_num_cards_in_array), 2, 256); - new (&_card_set_alloc_options[2]) G1CardSetAllocOptions((uint)G1CardSetBitMap::size_in_bytes(_num_cards_in_howl_bitmap), 2, 256); + new (&_card_set_alloc_options[1]) G1CardSetAllocOptions((uint)G1CardSetArray::size_in_bytes(_max_cards_in_array), 2, 256); + new (&_card_set_alloc_options[2]) G1CardSetAllocOptions((uint)G1CardSetBitMap::size_in_bytes(_max_cards_in_howl_bitmap), 2, 256); new (&_card_set_alloc_options[3]) G1CardSetAllocOptions((uint)G1CardSetHowl::size_in_bytes(_num_buckets_in_howl), 2, 256); } @@ -130,19 +130,19 @@ void G1CardSetConfiguration::log_configuration() { "Howl #buckets %u coarsen threshold %u " "Howl Bitmap #elems %u size %zu coarsen threshold %u " "Card regions per heap region %u cards per card region %u", - num_cards_in_inline_ptr(), sizeof(void*), - num_cards_in_array(), G1CardSetArray::size_in_bytes(num_cards_in_array()), + max_cards_in_inline_ptr(), sizeof(void*), + max_cards_in_array(), G1CardSetArray::size_in_bytes(max_cards_in_array()), num_buckets_in_howl(), cards_in_howl_threshold(), - num_cards_in_howl_bitmap(), G1CardSetBitMap::size_in_bytes(num_cards_in_howl_bitmap()), cards_in_howl_bitmap_threshold(), + max_cards_in_howl_bitmap(), G1CardSetBitMap::size_in_bytes(max_cards_in_howl_bitmap()), cards_in_howl_bitmap_threshold(), (uint)1 << log2_card_regions_per_heap_region(), (uint)1 << log2_cards_per_card_region()); } -uint G1CardSetConfiguration::num_cards_in_inline_ptr() const { - return num_cards_in_inline_ptr(_inline_ptr_bits_per_card); +uint G1CardSetConfiguration::max_cards_in_inline_ptr() const { + return max_cards_in_inline_ptr(_inline_ptr_bits_per_card); } -uint G1CardSetConfiguration::num_cards_in_inline_ptr(uint bits_per_card) { +uint G1CardSetConfiguration::max_cards_in_inline_ptr(uint bits_per_card) { return G1CardSetInlinePtr::max_cards_in_inline_ptr(bits_per_card); } @@ -508,19 +508,19 @@ G1AddCardResult G1CardSet::add_to_howl(CardSetPtr parent_card_set, G1AddCardResult G1CardSet::add_to_bitmap(CardSetPtr card_set, uint card_in_region) { G1CardSetBitMap* bitmap = card_set_ptr(card_set); uint card_offset = _config->howl_bitmap_offset(card_in_region); - return bitmap->add(card_offset, _config->cards_in_howl_bitmap_threshold(), _config->num_cards_in_howl_bitmap()); + return bitmap->add(card_offset, _config->cards_in_howl_bitmap_threshold(), _config->max_cards_in_howl_bitmap()); } G1AddCardResult G1CardSet::add_to_inline_ptr(CardSetPtr volatile* card_set_addr, CardSetPtr card_set, uint card_in_region) { G1CardSetInlinePtr value(card_set_addr, card_set); - return value.add(card_in_region, _config->inline_ptr_bits_per_card(), _config->num_cards_in_inline_ptr()); + return value.add(card_in_region, _config->inline_ptr_bits_per_card(), _config->max_cards_in_inline_ptr()); } G1CardSet::CardSetPtr G1CardSet::create_coarsened_array_of_cards(uint card_in_region, bool within_howl) { uint8_t* data = nullptr; CardSetPtr new_card_set; if (within_howl) { - uint const size_in_bits = _config->num_cards_in_howl_bitmap(); + uint const size_in_bits = _config->max_cards_in_howl_bitmap(); uint card_offset = _config->howl_bitmap_offset(card_in_region); data = allocate_mem_object(CardSetBitMap); new (data) G1CardSetBitMap(card_offset, size_in_bits); @@ -549,7 +549,7 @@ bool G1CardSet::coarsen_card_set(volatile CardSetPtr* card_set_addr, break; } case CardSetInlinePtr: { - uint const size = _config->num_cards_in_array(); + uint const size = _config->max_cards_in_array(); uint8_t* data = allocate_mem_object(CardSetArrayOfCards); new (data) G1CardSetArray(card_in_region, size); new_card_set = make_card_set_ptr(data, CardSetArrayOfCards); @@ -626,7 +626,7 @@ void G1CardSet::transfer_cards_in_howl(CardSetPtr parent_card_set, G1TransferCard iter(this, card_region); iterate_cards_during_transfer(source_card_set, iter); } else { - uint diff = _config->num_cards_in_howl_bitmap() - card_set_ptr(source_card_set)->num_bits_set(); + uint diff = _config->max_cards_in_howl_bitmap() - card_set_ptr(source_card_set)->num_bits_set(); // Need to correct for that the Full remembered set occupies more cards than the // bitmap before. @@ -755,7 +755,7 @@ bool G1CardSet::contains_card(uint card_region, uint card_in_region) { return ptr.contains(card_in_region, _config->inline_ptr_bits_per_card()); } case CardSetArrayOfCards : return card_set_ptr(card_set)->contains(card_in_region); - case CardSetBitMap: return card_set_ptr(card_set)->contains(card_in_region, _config->num_cards_in_howl_bitmap()); + case CardSetBitMap: return card_set_ptr(card_set)->contains(card_in_region, _config->max_cards_in_howl_bitmap()); case CardSetHowl: { G1CardSetHowl* howling_array = card_set_ptr(card_set); diff --git a/src/hotspot/share/gc/g1/g1CardSet.hpp b/src/hotspot/share/gc/g1/g1CardSet.hpp index 903b9d0b7ed..465984d7138 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.hpp +++ b/src/hotspot/share/gc/g1/g1CardSet.hpp @@ -50,13 +50,13 @@ class G1CardSetConfiguration { // regions covered by this card set. uint _inline_ptr_bits_per_card; - uint _num_cards_in_array; + uint _max_cards_in_array; uint _num_buckets_in_howl; uint _max_cards_in_card_set; uint _cards_in_howl_threshold; - uint _num_cards_in_howl_bitmap; + uint _max_cards_in_howl_bitmap; uint _cards_in_howl_bitmap_threshold; - uint _log2_num_cards_in_howl_bitmap; + uint _log2_max_cards_in_howl_bitmap; size_t _bitmap_hash_mask; uint _log2_card_regions_per_heap_region; uint _log2_cards_per_card_region; @@ -64,7 +64,7 @@ class G1CardSetConfiguration { G1CardSetAllocOptions* _card_set_alloc_options; G1CardSetConfiguration(uint inline_ptr_bits_per_card, - uint num_cards_in_array, + uint max_cards_in_array, double cards_in_bitmap_threshold_percent, uint num_buckets_in_howl, double cards_in_howl_threshold_percent, @@ -79,7 +79,7 @@ public: G1CardSetConfiguration(); // Initialize card set configuration from parameters. // Testing only. - G1CardSetConfiguration(uint num_cards_in_array, + G1CardSetConfiguration(uint max_cards_in_array, double cards_in_bitmap_threshold_percent, uint max_buckets_in_howl, double cards_in_howl_threshold_percent, @@ -90,21 +90,19 @@ public: // Inline pointer configuration uint inline_ptr_bits_per_card() const { return _inline_ptr_bits_per_card; } - uint num_cards_in_inline_ptr() const; - static uint num_cards_in_inline_ptr(uint bits_per_card); + uint max_cards_in_inline_ptr() const; + static uint max_cards_in_inline_ptr(uint bits_per_card); // Array of Cards configuration - bool use_cards_in_array() const { return _num_cards_in_array != 0; } // Unused for now - // Number of cards in "Array of Cards" set; 0 to disable. + // Maximum number of cards in "Array of Cards" set; 0 to disable. // Always coarsen to next level if full, so no specific threshold. - uint num_cards_in_array() const { return _num_cards_in_array; } + uint max_cards_in_array() const { return _max_cards_in_array; } // Bitmap within Howl card set container configuration - bool use_cards_in_howl_bitmap() const { return _num_cards_in_howl_bitmap != 0; } // Unused for now - uint num_cards_in_howl_bitmap() const { return _num_cards_in_howl_bitmap; } + uint max_cards_in_howl_bitmap() const { return _max_cards_in_howl_bitmap; } // (Approximate) Number of cards in bitmap to coarsen Howl Bitmap to Howl Full. uint cards_in_howl_bitmap_threshold() const { return _cards_in_howl_bitmap_threshold; } - uint log2_num_cards_in_howl_bitmap() const {return _log2_num_cards_in_howl_bitmap;} + uint log2_max_cards_in_howl_bitmap() const {return _log2_max_cards_in_howl_bitmap;} // Howl card set container configuration uint num_buckets_in_howl() const { return _num_buckets_in_howl; } @@ -112,7 +110,7 @@ public: uint cards_in_howl_threshold() const { return _cards_in_howl_threshold; } uint howl_bitmap_offset(uint card_idx) const { return card_idx & _bitmap_hash_mask; } // Given a card index, return the bucket in the array of card sets. - uint howl_bucket_index(uint card_idx) { return card_idx >> _log2_num_cards_in_howl_bitmap; } + uint howl_bucket_index(uint card_idx) { return card_idx >> _log2_max_cards_in_howl_bitmap; } // Full card configuration // Maximum number of cards in a non-full card set for a single region. Card sets diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index e23386d4040..7390afc12dd 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -252,14 +252,14 @@ inline void G1CardSetBitMap::iterate(CardVisitor& found, size_t size_in_bits, ui inline G1CardSetHowl::G1CardSetHowl(EntryCountType card_in_region, G1CardSetConfiguration* config) : G1CardSetContainer(), - _num_entries((config->num_cards_in_array() + 1)) /* Card Transfer will not increment _num_entries */ { + _num_entries((config->max_cards_in_array() + 1)) /* Card Transfer will not increment _num_entries */ { EntryCountType num_buckets = config->num_buckets_in_howl(); EntryCountType bucket = config->howl_bucket_index(card_in_region); for (uint i = 0; i < num_buckets; ++i) { _buckets[i] = G1CardSetInlinePtr(); if (i == bucket) { G1CardSetInlinePtr value(&_buckets[i], _buckets[i]); - value.add(card_in_region, config->inline_ptr_bits_per_card(), config->num_cards_in_inline_ptr()); + value.add(card_in_region, config->inline_ptr_bits_per_card(), config->max_cards_in_inline_ptr()); } } } @@ -275,7 +275,7 @@ inline bool G1CardSetHowl::contains(uint card_idx, G1CardSetConfiguration* confi } case G1CardSet::CardSetBitMap: { uint card_offset = config->howl_bitmap_offset(card_idx); - return G1CardSet::card_set_ptr(card_set)->contains(card_offset, config->num_cards_in_howl_bitmap()); + return G1CardSet::card_set_ptr(card_set)->contains(card_offset, config->max_cards_in_howl_bitmap()); } case G1CardSet::CardSetInlinePtr: { G1CardSetInlinePtr ptr(card_set); @@ -321,28 +321,28 @@ inline void G1CardSetHowl::iterate_cardset(CardSetPtr const card_set, uint index } case G1CardSet::CardSetBitMap: { if (found.start_iterate(G1GCPhaseTimes::MergeRSHowlBitmap)) { - uint offset = index << config->log2_num_cards_in_howl_bitmap(); - G1CardSet::card_set_ptr(card_set)->iterate(found, config->num_cards_in_howl_bitmap(), offset); + uint offset = index << config->log2_max_cards_in_howl_bitmap(); + G1CardSet::card_set_ptr(card_set)->iterate(found, config->max_cards_in_howl_bitmap(), offset); } return; } case G1CardSet::CardSetHowl: { // actually FullCardSet assert(card_set == G1CardSet::FullCardSet, "Must be"); if (found.start_iterate(G1GCPhaseTimes::MergeRSHowlFull)) { - uint offset = index << config->log2_num_cards_in_howl_bitmap(); - found(offset, config->num_cards_in_howl_bitmap()); + uint offset = index << config->log2_max_cards_in_howl_bitmap(); + found(offset, config->max_cards_in_howl_bitmap()); } return; } } } -inline G1CardSetHowl::EntryCountType G1CardSetHowl::num_buckets(size_t size_in_bits, size_t num_cards_in_array, size_t max_num_buckets) { +inline G1CardSetHowl::EntryCountType G1CardSetHowl::num_buckets(size_t size_in_bits, size_t max_cards_in_array, size_t max_num_buckets) { size_t size_bitmap_bytes = BitMap::calc_size_in_words(size_in_bits) * BytesPerWord; // Ensure that in the worst case arrays consume half the memory size // of storing the entire bitmap size_t max_size_arrays_bytes = size_bitmap_bytes / 2; - size_t size_array_bytes = num_cards_in_array * sizeof(G1CardSetArray::EntryDataType); + size_t size_array_bytes = max_cards_in_array * sizeof(G1CardSetArray::EntryDataType); size_t num_arrays = max_size_arrays_bytes / size_array_bytes; // We use shifts and masks for indexing the array. So round down to the next // power of two to not use more than expected memory. diff --git a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp index b6c0d545746..914c64aacc5 100644 --- a/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp +++ b/test/hotspot/gtest/gc/g1/test_g1CardSet.cpp @@ -345,17 +345,17 @@ void G1CardSetTest::cardset_basic_test() { ASSERT_TRUE(count == card_set.occupied()); } - G1AddCardResult res = card_set.add_card(99, config.num_cards_in_howl_bitmap() - 1); + G1AddCardResult res = card_set.add_card(99, config.max_cards_in_howl_bitmap() - 1); // Adding above card should have coarsened Bitmap -> Full. ASSERT_TRUE(res == Added); - ASSERT_TRUE(config.num_cards_in_howl_bitmap() == card_set.occupied()); + ASSERT_TRUE(config.max_cards_in_howl_bitmap() == card_set.occupied()); - res = card_set.add_card(99, config.num_cards_in_howl_bitmap() - 2); + res = card_set.add_card(99, config.max_cards_in_howl_bitmap() - 2); ASSERT_TRUE(res == Found); uint threshold = config.cards_in_howl_threshold(); uint adjusted_threshold = config.cards_in_howl_bitmap_threshold() * config.num_buckets_in_howl(); - i = config.num_cards_in_howl_bitmap(); + i = config.max_cards_in_howl_bitmap(); count = i; for (; i < threshold; i++) { G1AddCardResult res = card_set.add_card(99, i); -- GitLab From 05ab1767684bee0a3b8c8214c610beafaad058f9 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Mon, 29 Nov 2021 14:00:10 +0000 Subject: [PATCH 504/890] 8277797: Remove undefined/unused SharedRuntime::trampoline_size() Reviewed-by: dholmes, stuefe --- src/hotspot/share/runtime/sharedRuntime.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hotspot/share/runtime/sharedRuntime.hpp b/src/hotspot/share/runtime/sharedRuntime.hpp index ec816928ac7..1adc9661985 100644 --- a/src/hotspot/share/runtime/sharedRuntime.hpp +++ b/src/hotspot/share/runtime/sharedRuntime.hpp @@ -384,8 +384,6 @@ class SharedRuntime: AllStatic { uint num_bits, uint total_args_passed); - static size_t trampoline_size(); - // Generate I2C and C2I adapters. These adapters are simple argument marshalling // blobs. Unlike adapters in the tiger and earlier releases the code in these // blobs does not create a new frame and are therefore virtually invisible -- GitLab From 3d39f09c6cdc875b44147b4e84e496b6abf93996 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Mon, 29 Nov 2021 16:00:09 +0000 Subject: [PATCH 505/890] 8277654: Shenandoah: Don't produce new memory state in C2 LRB runtime call Reviewed-by: roland, shade --- .../gc/shenandoah/c2/shenandoahSupport.cpp | 134 +----------------- .../gc/shenandoah/c2/shenandoahSupport.hpp | 3 +- 2 files changed, 5 insertions(+), 132 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index 5ba3828b2d3..f46d9436316 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -54,7 +54,6 @@ bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) { PhaseIdealLoop::optimize(igvn, LoopOptsShenandoahExpand); if (C->failing()) return false; PhaseIdealLoop::verify(igvn); - DEBUG_ONLY(verify_raw_mem(C->root());) if (attempt_more_loopopts) { C->set_major_progress(); if (!C->optimize_loops(igvn, LoopOptsShenandoahPostExpand)) { @@ -964,18 +963,11 @@ void ShenandoahBarrierC2Support::test_in_cset(Node*& ctrl, Node*& not_cset_ctrl, phase->register_new_node(cset_bool, old_ctrl); } -void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, +void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, DecoratorSet decorators, PhaseIdealLoop* phase) { IdealLoopTree*loop = phase->get_loop(ctrl); const TypePtr* obj_type = phase->igvn().type(val)->is_oopptr(); - // The slow path stub consumes and produces raw memory in addition - // to the existing memory edges - Node* base = find_bottom_mem(ctrl, phase); - MergeMemNode* mm = MergeMemNode::make(base); - mm->set_memory_at(Compile::AliasIdxRaw, raw_mem); - phase->register_new_node(mm, ctrl); - address calladdr = NULL; const char* name = NULL; bool is_strong = ShenandoahBarrierSet::is_strong_access(decorators); @@ -1013,7 +1005,7 @@ void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* lo call->init_req(TypeFunc::Control, ctrl); call->init_req(TypeFunc::I_O, phase->C->top()); - call->init_req(TypeFunc::Memory, mm); + call->init_req(TypeFunc::Memory, phase->C->top()); call->init_req(TypeFunc::FramePtr, phase->C->top()); call->init_req(TypeFunc::ReturnAdr, phase->C->top()); call->init_req(TypeFunc::Parms, val); @@ -1021,8 +1013,6 @@ void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* lo phase->register_control(call, loop, ctrl); ctrl = new ProjNode(call, TypeFunc::Control); phase->register_control(ctrl, loop, call); - result_mem = new ProjNode(call, TypeFunc::Memory); - phase->register_new_node(result_mem, call); val = new ProjNode(call, TypeFunc::Parms); phase->register_new_node(val, call); val = new CheckCastPPNode(ctrl, val, obj_type); @@ -1341,12 +1331,9 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { Node* ctrl = phase->get_ctrl(lrb); Node* val = lrb->in(ShenandoahLoadReferenceBarrierNode::ValueIn); - Node* orig_ctrl = ctrl; Node* raw_mem = fixer.find_mem(ctrl, lrb); - Node* init_raw_mem = raw_mem; - Node* raw_mem_for_ctrl = fixer.find_mem(ctrl, NULL); IdealLoopTree *loop = phase->get_loop(ctrl); @@ -1359,7 +1346,6 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { enum { _heap_stable = 1, _evac_path, _not_cset, PATH_LIMIT }; Node* region = new RegionNode(PATH_LIMIT); Node* val_phi = new PhiNode(region, val->bottom_type()->is_oopptr()); - Node* raw_mem_phi = PhiNode::make(region, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM); // Stable path. int flags = ShenandoahHeap::HAS_FORWARDED; @@ -1372,7 +1358,6 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { // Heap stable case region->init_req(_heap_stable, heap_stable_ctrl); val_phi->init_req(_heap_stable, val); - raw_mem_phi->init_req(_heap_stable, raw_mem); // Test for in-cset, unless it's a native-LRB. Native LRBs need to return NULL // even for non-cset objects to prevent ressurrection of such objects. @@ -1384,11 +1369,9 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { if (not_cset_ctrl != NULL) { region->init_req(_not_cset, not_cset_ctrl); val_phi->init_req(_not_cset, val); - raw_mem_phi->init_req(_not_cset, raw_mem); } else { region->del_req(_not_cset); val_phi->del_req(_not_cset); - raw_mem_phi->del_req(_not_cset); } // Resolve object when orig-value is in cset. @@ -1429,15 +1412,13 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { } } } - call_lrb_stub(ctrl, val, addr, result_mem, raw_mem, lrb->decorators(), phase); + call_lrb_stub(ctrl, val, addr, lrb->decorators(), phase); region->init_req(_evac_path, ctrl); val_phi->init_req(_evac_path, val); - raw_mem_phi->init_req(_evac_path, result_mem); phase->register_control(region, loop, heap_stable_iff); Node* out_val = val_phi; phase->register_new_node(val_phi, region); - phase->register_new_node(raw_mem_phi, region); fix_ctrl(lrb, region, fixer, uses, uses_to_ignore, last, phase); @@ -1450,18 +1431,10 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { for(uint next = 0; next < uses.size(); next++ ) { Node *n = uses.at(next); assert(phase->get_ctrl(n) == ctrl, "bad control"); - assert(n != init_raw_mem, "should leave input raw mem above the barrier"); + assert(n != raw_mem, "should leave input raw mem above the barrier"); phase->set_ctrl(n, region); follow_barrier_uses(n, ctrl, uses, phase); } - - // The slow path call produces memory: hook the raw memory phi - // from the expanded load reference barrier with the rest of the graph - // which may require adding memory phis at every post dominated - // region and at enclosing loop heads. Use the memory state - // collected in memory_nodes to fix the memory graph. Update that - // memory state as we go. - fixer.fix_mem(ctrl, region, init_raw_mem, raw_mem_for_ctrl, raw_mem_phi, uses); } // Done expanding load-reference-barriers. assert(ShenandoahBarrierSetC2::bsc2()->state()->load_reference_barriers_count() == 0, "all load reference barrier nodes should have been replaced"); @@ -1902,105 +1875,6 @@ void ShenandoahBarrierC2Support::optimize_after_expansion(VectorSet &visited, No } } -#ifdef ASSERT -void ShenandoahBarrierC2Support::verify_raw_mem(RootNode* root) { - const bool trace = false; - ResourceMark rm; - Unique_Node_List nodes; - Unique_Node_List controls; - Unique_Node_List memories; - - nodes.push(root); - for (uint next = 0; next < nodes.size(); next++) { - Node *n = nodes.at(next); - if (ShenandoahBarrierSetC2::is_shenandoah_lrb_call(n)) { - controls.push(n); - if (trace) { tty->print("XXXXXX verifying"); n->dump(); } - for (uint next2 = 0; next2 < controls.size(); next2++) { - Node *m = controls.at(next2); - for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) { - Node* u = m->fast_out(i); - if (u->is_CFG() && !u->is_Root() && - !(u->Opcode() == Op_CProj && u->in(0)->Opcode() == Op_NeverBranch && u->as_Proj()->_con == 1) && - !(u->is_Region() && u->unique_ctrl_out()->Opcode() == Op_Halt)) { - if (trace) { tty->print("XXXXXX pushing control"); u->dump(); } - controls.push(u); - } - } - } - memories.push(n->as_Call()->proj_out(TypeFunc::Memory)); - for (uint next2 = 0; next2 < memories.size(); next2++) { - Node *m = memories.at(next2); - assert(m->bottom_type() == Type::MEMORY, ""); - for (DUIterator_Fast imax, i = m->fast_outs(imax); i < imax; i++) { - Node* u = m->fast_out(i); - if (u->bottom_type() == Type::MEMORY && (u->is_Mem() || u->is_ClearArray())) { - if (trace) { tty->print("XXXXXX pushing memory"); u->dump(); } - memories.push(u); - } else if (u->is_LoadStore()) { - if (trace) { tty->print("XXXXXX pushing memory"); u->find_out_with(Op_SCMemProj)->dump(); } - memories.push(u->find_out_with(Op_SCMemProj)); - } else if (u->is_MergeMem() && u->as_MergeMem()->memory_at(Compile::AliasIdxRaw) == m) { - if (trace) { tty->print("XXXXXX pushing memory"); u->dump(); } - memories.push(u); - } else if (u->is_Phi()) { - assert(u->bottom_type() == Type::MEMORY, ""); - if (u->adr_type() == TypeRawPtr::BOTTOM || u->adr_type() == TypePtr::BOTTOM) { - assert(controls.member(u->in(0)), ""); - if (trace) { tty->print("XXXXXX pushing memory"); u->dump(); } - memories.push(u); - } - } else if (u->is_SafePoint() || u->is_MemBar()) { - for (DUIterator_Fast jmax, j = u->fast_outs(jmax); j < jmax; j++) { - Node* uu = u->fast_out(j); - if (uu->bottom_type() == Type::MEMORY) { - if (trace) { tty->print("XXXXXX pushing memory"); uu->dump(); } - memories.push(uu); - } - } - } - } - } - for (uint next2 = 0; next2 < controls.size(); next2++) { - Node *m = controls.at(next2); - if (m->is_Region()) { - bool all_in = true; - for (uint i = 1; i < m->req(); i++) { - if (!controls.member(m->in(i))) { - all_in = false; - break; - } - } - if (trace) { tty->print("XXX verifying %s", all_in ? "all in" : ""); m->dump(); } - bool found_phi = false; - for (DUIterator_Fast jmax, j = m->fast_outs(jmax); j < jmax && !found_phi; j++) { - Node* u = m->fast_out(j); - if (u->is_Phi() && memories.member(u)) { - found_phi = true; - for (uint i = 1; i < u->req() && found_phi; i++) { - Node* k = u->in(i); - if (memories.member(k) != controls.member(m->in(i))) { - found_phi = false; - } - } - } - } - assert(found_phi || all_in, ""); - } - } - controls.clear(); - memories.clear(); - } - for( uint i = 0; i < n->len(); ++i ) { - Node *m = n->in(i); - if (m != NULL) { - nodes.push(m); - } - } - } -} -#endif - ShenandoahIUBarrierNode::ShenandoahIUBarrierNode(Node* val) : Node(NULL, val) { ShenandoahBarrierSetC2::bsc2()->state()->add_iu_barrier(this); } diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp index 6632e42b36f..86a74011f5a 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp @@ -50,7 +50,6 @@ private: static bool verify_helper(Node* in, Node_Stack& phis, VectorSet& visited, verify_type t, bool trace, Unique_Node_List& barriers_used); static void report_verify_failure(const char* msg, Node* n1 = NULL, Node* n2 = NULL); - static void verify_raw_mem(RootNode* root); #endif static Node* dom_mem(Node* mem, Node* ctrl, int alias, Node*& mem_ctrl, PhaseIdealLoop* phase); static Node* no_branches(Node* c, Node* dom, bool allow_one_proj, PhaseIdealLoop* phase); @@ -61,7 +60,7 @@ private: static void test_null(Node*& ctrl, Node* val, Node*& null_ctrl, PhaseIdealLoop* phase); static void test_gc_state(Node*& ctrl, Node* raw_mem, Node*& heap_stable_ctrl, PhaseIdealLoop* phase, int flags); - static void call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, + static void call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, DecoratorSet decorators, PhaseIdealLoop* phase); static void test_in_cset(Node*& ctrl, Node*& not_cset_ctrl, Node* val, Node* raw_mem, PhaseIdealLoop* phase); static void move_gc_state_test_out_of_loop(IfNode* iff, PhaseIdealLoop* phase); -- GitLab From 825e633e71ca942fe88c509e7f951ff8903c45cf Mon Sep 17 00:00:00 2001 From: Pavel Kharskii Date: Mon, 29 Nov 2021 16:54:47 +0000 Subject: [PATCH 506/890] 8277944: JDK 18 - update GA Release Date Reviewed-by: coffeys --- make/conf/version-numbers.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/conf/version-numbers.conf b/make/conf/version-numbers.conf index 2d12d668a71..191579c4bfa 100644 --- a/make/conf/version-numbers.conf +++ b/make/conf/version-numbers.conf @@ -33,7 +33,7 @@ DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2022-03-15 +DEFAULT_VERSION_DATE=2022-03-22 DEFAULT_VERSION_CLASSFILE_MAJOR=62 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_VERSION_DOCS_API_SINCE=11 -- GitLab From 3a4a94e5a830c4e88ac12619b868f3d89aa416a5 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Mon, 29 Nov 2021 23:17:39 +0000 Subject: [PATCH 507/890] 8277854: The upper bound of GCCardSizeInBytes should be limited to 512 for 32-bit platforms Reviewed-by: tschatzl, mli --- src/hotspot/share/gc/shared/gc_globals.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/gc_globals.hpp b/src/hotspot/share/gc/shared/gc_globals.hpp index b57be5abf62..684357297d8 100644 --- a/src/hotspot/share/gc/shared/gc_globals.hpp +++ b/src/hotspot/share/gc/shared/gc_globals.hpp @@ -696,7 +696,7 @@ \ product(uint, GCCardSizeInBytes, 512, \ "Card table entry size (in bytes) for card based collectors") \ - range(128, 1024) \ + range(128, NOT_LP64(512) LP64_ONLY(1024)) \ constraint(GCCardSizeInBytesConstraintFunc,AtParse) // end of GC_FLAGS -- GitLab From 560f9c937233d548ef8db8cd9044fdc6c4cefe41 Mon Sep 17 00:00:00 2001 From: MeryKitty Date: Mon, 29 Nov 2021 23:21:04 +0000 Subject: [PATCH 508/890] 8277426: Optimize mask reduction operations on x86 Reviewed-by: sviswanathan, jiefu --- src/hotspot/cpu/x86/assembler_x86.cpp | 14 ++ src/hotspot/cpu/x86/assembler_x86.hpp | 2 + src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp | 140 +++++++++++++----- src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp | 6 +- src/hotspot/cpu/x86/x86.ad | 111 +++++++++----- 5 files changed, 193 insertions(+), 80 deletions(-) diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index 2119c0797a6..ad74f80b2aa 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -4306,6 +4306,20 @@ void Assembler::vpmovmskb(Register dst, XMMRegister src, int vec_enc) { emit_int16((unsigned char)0xD7, (0xC0 | encode)); } +void Assembler::vmovmskps(Register dst, XMMRegister src, int vec_enc) { + assert(VM_Version::supports_avx(), ""); + InstructionAttr attributes(vec_enc, /* 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_int16(0x50, (0xC0 | encode)); +} + +void Assembler::vmovmskpd(Register dst, XMMRegister src, int vec_enc) { + assert(VM_Version::supports_avx(), ""); + InstructionAttr attributes(vec_enc, /* 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_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x50, (0xC0 | encode)); +} + void Assembler::vpmaskmovd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert((VM_Version::supports_avx2() && vector_len == AVX_256bit), ""); InstructionMark im(this); diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 09b2a392d30..0707a12a0f6 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1774,6 +1774,8 @@ private: void pmovmskb(Register dst, XMMRegister src); void vpmovmskb(Register dst, XMMRegister src, int vec_enc); + void vmovmskps(Register dst, XMMRegister src, int vec_enc); + void vmovmskpd(Register dst, XMMRegister src, int vec_enc); void vpmaskmovd(XMMRegister dst, XMMRegister nds, Address src, int vector_len); // SSE 4.1 extract diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index 5e4c8917612..59a541e215e 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -4060,61 +4060,123 @@ void C2_MacroAssembler::masked_op(int ideal_opc, int mask_len, KRegister dst, } #ifdef _LP64 -void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, KRegister mask, - Register tmp, int masklen, int masksize, - int vec_enc) { - if(VM_Version::supports_avx512bw()) { - kmovql(tmp, mask); - } else { - assert(masklen <= 16, ""); - kmovwl(tmp, mask); - } - if (masksize < 16) { - andq(tmp, (((jlong)1 << masklen) - 1)); - } +void C2_MacroAssembler::vector_mask_operation_helper(int opc, Register dst, Register tmp, int masklen) { switch(opc) { case Op_VectorMaskTrueCount: popcntq(dst, tmp); break; case Op_VectorMaskLastTrue: - mov64(dst, -1); - bsrq(tmp, tmp); - cmov(Assembler::notZero, dst, tmp); + if (VM_Version::supports_lzcnt()) { + lzcntq(tmp, tmp); + movl(dst, 63); + subl(dst, tmp); + } else { + movl(dst, -1); + bsrq(tmp, tmp); + cmov32(Assembler::notZero, dst, tmp); + } break; case Op_VectorMaskFirstTrue: - mov64(dst, masklen); - bsfq(tmp, tmp); - cmov(Assembler::notZero, dst, tmp); + if (VM_Version::supports_bmi1()) { + if (masklen < 32) { + orl(tmp, 1 << masklen); + tzcntl(dst, tmp); + } else if (masklen == 32) { + tzcntl(dst, tmp); + } else { + assert(masklen == 64, ""); + tzcntq(dst, tmp); + } + } else { + if (masklen < 32) { + orl(tmp, 1 << masklen); + bsfl(dst, tmp); + } else { + assert(masklen == 32 || masklen == 64, ""); + movl(dst, masklen); + if (masklen == 32) { + bsfl(tmp, tmp); + } else { + bsfq(tmp, tmp); + } + cmov32(Assembler::notZero, dst, tmp); + } + } + break; + case Op_VectorMaskToLong: + assert(dst == tmp, "Dst and tmp should be the same for toLong operations"); break; default: assert(false, "Unhandled mask operation"); } } -void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, - XMMRegister xtmp1, Register tmp, int masklen, int masksize, - int vec_enc) { - assert(VM_Version::supports_avx(), ""); - vpxor(xtmp, xtmp, xtmp, vec_enc); - vpsubb(xtmp, xtmp, mask, vec_enc); - vpmovmskb(tmp, xtmp, vec_enc); - if (masksize < 16) { - andq(tmp, (((jlong)1 << masklen) - 1)); +void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, KRegister mask, Register tmp, + int masklen, int masksize, int vec_enc) { + assert(VM_Version::supports_popcnt(), ""); + + if(VM_Version::supports_avx512bw()) { + kmovql(tmp, mask); + } else { + assert(masklen <= 16, ""); + kmovwl(tmp, mask); } - switch(opc) { - case Op_VectorMaskTrueCount: - popcntq(dst, tmp); + + // Mask generated out of partial vector comparisons/replicate/mask manipulation + // operations needs to be clipped. + if (masksize < 16 && opc != Op_VectorMaskFirstTrue) { + andq(tmp, (1 << masklen) - 1); + } + + vector_mask_operation_helper(opc, dst, tmp, masklen); +} + +void C2_MacroAssembler::vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, + Register tmp, int masklen, BasicType bt, int vec_enc) { + assert(vec_enc == AVX_128bit && VM_Version::supports_avx() || + vec_enc == AVX_256bit && (VM_Version::supports_avx2() || type2aelembytes(bt) >= 4), ""); + assert(VM_Version::supports_popcnt(), ""); + + bool need_clip = false; + switch(bt) { + case T_BOOLEAN: + // While masks of other types contain 0, -1; boolean masks contain lane values of 0, 1 + vpxor(xtmp, xtmp, xtmp, vec_enc); + vpsubb(xtmp, xtmp, mask, vec_enc); + vpmovmskb(tmp, xtmp, vec_enc); + need_clip = masklen < 16; break; - case Op_VectorMaskLastTrue: - mov64(dst, -1); - bsrq(tmp, tmp); - cmov(Assembler::notZero, dst, tmp); + case T_BYTE: + vpmovmskb(tmp, mask, vec_enc); + need_clip = masklen < 16; break; - case Op_VectorMaskFirstTrue: - mov64(dst, masklen); - bsfq(tmp, tmp); - cmov(Assembler::notZero, dst, tmp); + case T_SHORT: + vpacksswb(xtmp, mask, mask, vec_enc); + if (masklen >= 16) { + vpermpd(xtmp, xtmp, 8, vec_enc); + } + vpmovmskb(tmp, xtmp, Assembler::AVX_128bit); + need_clip = masklen < 16; break; - default: assert(false, "Unhandled mask operation"); + case T_INT: + case T_FLOAT: + vmovmskps(tmp, mask, vec_enc); + need_clip = masklen < 4; + break; + case T_LONG: + case T_DOUBLE: + vmovmskpd(tmp, mask, vec_enc); + need_clip = masklen < 2; + break; + default: assert(false, "Unhandled type, %s", type2name(bt)); } + + // Mask generated out of partial vector comparisons/replicate/mask manipulation + // operations needs to be clipped. + if (need_clip && opc != Op_VectorMaskFirstTrue) { + // need_clip implies masklen < 32 + andq(tmp, (1 << masklen) - 1); + } + + vector_mask_operation_helper(opc, dst, tmp, masklen); } #endif diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp index 8efa36a8101..83acb399317 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp @@ -224,10 +224,12 @@ public: public: #ifdef _LP64 + void vector_mask_operation_helper(int opc, Register dst, Register tmp, int masklen); + void vector_mask_operation(int opc, Register dst, KRegister mask, Register tmp, int masklen, int masksize, int vec_enc); - void vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, XMMRegister xtmp1, - Register tmp, int masklen, int masksize, int vec_enc); + void vector_mask_operation(int opc, Register dst, XMMRegister mask, XMMRegister xtmp, + Register tmp, int masklen, BasicType bt, int vec_enc); #endif void string_indexof_char(Register str1, Register cnt1, Register ch, Register result, XMMRegister vec1, XMMRegister vec2, XMMRegister vec3, Register tmp); diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 3f6d5a44b0d..4b55780a3d2 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -8647,43 +8647,45 @@ instruct vmask_tolong_evex(rRegL dst, kReg mask, rFlagsReg cr) %{ effect(TEMP dst, KILL cr); format %{ "vector_tolong_evex $dst, $mask \t! vector mask tolong" %} ins_encode %{ - int mask_len = Matcher::vector_length(this, $mask); + int opcode = this->ideal_Opcode(); BasicType mbt = Matcher::vector_element_basic_type(this, $mask); - if (VM_Version::supports_avx512vlbw()) { - __ kmovql($dst$$Register, $mask$$KRegister); - } else { - assert(mask_len <= 16, ""); - __ kmovwl($dst$$Register, $mask$$KRegister); - } - // Mask generated out of partial vector comparisons/replicate/mask manipulation - // operations needs to be clipped. + int mask_len = Matcher::vector_length(this, $mask); int mask_size = mask_len * type2aelembytes(mbt); - if (mask_size < 16) { - __ andq($dst$$Register, (((jlong)1 << mask_len) - 1)); - } + int vlen_enc = vector_length_encoding(this, $mask); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, + $dst$$Register, mask_len, mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} -instruct vmask_tolong_avx(rRegL dst, vec mask, vec xtmp, rFlagsReg cr) %{ - predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL && - n->in(1)->bottom_type()->is_vect()->element_basic_type() == T_BOOLEAN); +instruct vmask_tolong_bool(rRegL dst, vec mask, vec xtmp, rFlagsReg cr) %{ + predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorMaskToLong mask)); - format %{ "vector_tolong_avx $dst, $mask \t! using $xtmp as TEMP" %} + format %{ "vector_tolong_bool $dst, $mask \t! using $xtmp as TEMP" %} effect(TEMP_DEF dst, TEMP xtmp, KILL cr); ins_encode %{ + int opcode = this->ideal_Opcode(); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); + int vlen_enc = vector_length_encoding(this, $mask); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, + $dst$$Register, mask_len, mbt, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmask_tolong_avx(rRegL dst, vec mask, immI size, vec xtmp, rFlagsReg cr) %{ + predicate(n->in(1)->in(1)->bottom_type()->isa_vectmask() == NULL); + match(Set dst (VectorMaskToLong (VectorStoreMask mask size))); + format %{ "vector_tolong_avx $dst, $mask \t! using $xtmp as TEMP" %} + effect(TEMP_DEF dst, TEMP xtmp, KILL cr); + ins_encode %{ + int opcode = this->ideal_Opcode(); BasicType mbt = Matcher::vector_element_basic_type(this, $mask); + int mask_len = Matcher::vector_length(this, $mask); int vlen_enc = vector_length_encoding(this, $mask); - __ vpxor($xtmp$$XMMRegister, $xtmp$$XMMRegister, $xtmp$$XMMRegister, vlen_enc); - __ vpsubb($xtmp$$XMMRegister, $xtmp$$XMMRegister, $mask$$XMMRegister, vlen_enc); - __ vpmovmskb($dst$$Register, $xtmp$$XMMRegister, vlen_enc); - // Mask generated out of partial vector comparisons/replicate/mask manipulation - // operations needs to be clipped. - int mask_size = mask_len * type2aelembytes(mbt); - if (mask_size < 16) { - __ andq($dst$$Register, (((jlong)1 << mask_len) - 1)); - } + __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, + $dst$$Register, mask_len, mbt, vlen_enc); %} ins_pipe( pipe_slow ); %} @@ -8699,25 +8701,40 @@ instruct vmask_truecount_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsReg cr) %{ int mask_len = Matcher::vector_length(this, $mask); int mask_size = mask_len * type2aelembytes(mbt); int vlen_enc = vector_length_encoding(this, $mask); - __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, $tmp$$Register, - mask_len, mask_size, vlen_enc); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, + $tmp$$Register, mask_len, mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} -instruct vmask_truecount_avx(rRegI dst, vec mask, rRegL tmp, vec xtmp, vec xtmp1, rFlagsReg cr) %{ +instruct vmask_truecount_bool(rRegI dst, vec mask, rRegL tmp, vec xtmp, rFlagsReg cr) %{ predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorMaskTrueCount mask)); - effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, TEMP xtmp1, KILL cr); - format %{ "vector_truecount_avx $dst, $mask \t! using $tmp, $xtmp and $xtmp1 as TEMP" %} + effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr); + format %{ "vector_truecount_bool $dst, $mask \t! using $tmp, $xtmp as TEMP" %} + ins_encode %{ + int opcode = this->ideal_Opcode(); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); + int mask_len = Matcher::vector_length(this, $mask); + int vlen_enc = vector_length_encoding(this, $mask); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, + $tmp$$Register, mask_len, mbt, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmask_truecount_avx(rRegI dst, vec mask, immI size, rRegL tmp, vec xtmp, rFlagsReg cr) %{ + predicate(n->in(1)->in(1)->bottom_type()->isa_vectmask() == NULL); + match(Set dst (VectorMaskTrueCount (VectorStoreMask mask size))); + effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr); + format %{ "vector_truecount_avx $dst, $mask \t! using $tmp, $xtmp as TEMP" %} ins_encode %{ int opcode = this->ideal_Opcode(); BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); - int mask_size = mask_len * type2aelembytes(mbt); int vlen_enc = vector_length_encoding(this, $mask); __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, - $xtmp1$$XMMRegister, $tmp$$Register, mask_len, mask_size, vlen_enc); + $tmp$$Register, mask_len, mbt, vlen_enc); %} ins_pipe( pipe_slow ); %} @@ -8734,26 +8751,42 @@ instruct vmask_first_or_last_true_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsRe int mask_len = Matcher::vector_length(this, $mask); int mask_size = mask_len * type2aelembytes(mbt); int vlen_enc = vector_length_encoding(this, $mask); - __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, $tmp$$Register, mask_len, - mask_size, vlen_enc); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$KRegister, + $tmp$$Register, mask_len, mask_size, vlen_enc); %} ins_pipe( pipe_slow ); %} -instruct vmask_first_or_last_true_avx(rRegI dst, vec mask, rRegL tmp, vec xtmp, vec xtmp1, rFlagsReg cr) %{ +instruct vmask_first_or_last_true_bool(rRegI dst, vec mask, rRegL tmp, vec xtmp, rFlagsReg cr) %{ predicate(n->in(1)->bottom_type()->isa_vectmask() == NULL); match(Set dst (VectorMaskFirstTrue mask)); match(Set dst (VectorMaskLastTrue mask)); - effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, TEMP xtmp1, KILL cr); - format %{ "vector_mask_first_or_last_true_avx $dst, $mask \t! using $tmp, $xtmp and $xtmp1 as TEMP" %} + effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr); + format %{ "vector_mask_first_or_last_true_bool $dst, $mask \t! using $tmp, $xtmp as TEMP" %} + ins_encode %{ + int opcode = this->ideal_Opcode(); + BasicType mbt = Matcher::vector_element_basic_type(this, $mask); + int mask_len = Matcher::vector_length(this, $mask); + int vlen_enc = vector_length_encoding(this, $mask); + __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, + $tmp$$Register, mask_len, mbt, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vmask_first_or_last_true_avx(rRegI dst, vec mask, immI size, rRegL tmp, vec xtmp, rFlagsReg cr) %{ + predicate(n->in(1)->in(1)->bottom_type()->isa_vectmask() == NULL); + match(Set dst (VectorMaskFirstTrue (VectorStoreMask mask size))); + match(Set dst (VectorMaskLastTrue (VectorStoreMask mask size))); + effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr); + format %{ "vector_mask_first_or_last_true_avx $dst, $mask \t! using $tmp, $xtmp as TEMP" %} ins_encode %{ int opcode = this->ideal_Opcode(); BasicType mbt = Matcher::vector_element_basic_type(this, $mask); int mask_len = Matcher::vector_length(this, $mask); - int mask_size = mask_len * type2aelembytes(mbt); int vlen_enc = vector_length_encoding(this, $mask); __ vector_mask_operation(opcode, $dst$$Register, $mask$$XMMRegister, $xtmp$$XMMRegister, - $xtmp1$$XMMRegister, $tmp$$Register, mask_len, mask_size, vlen_enc); + $tmp$$Register, mask_len, mbt, vlen_enc); %} ins_pipe( pipe_slow ); %} -- GitLab From 27299eaa98fd2d608a6cecfbf2b1a2a177bd5e9a Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Tue, 30 Nov 2021 01:34:52 +0000 Subject: [PATCH 509/890] 8277803: vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001 fails with "Synthetic fields not found" Reviewed-by: dholmes, cjplummer, sspitsyn --- test/hotspot/jtreg/ProblemList.txt | 1 - .../nsk/jdi/TypeComponent/isSynthetic/issynthetic001a.java | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 8878a661562..fb6c99b196c 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -149,7 +149,6 @@ vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock001/TestD vmTestbase/nsk/jdi/HiddenClass/events/events001.java 8257705 generic-all vmTestbase/nsk/jdi/ThreadReference/stop/stop001/TestDescription.java 7034630 generic-all -vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001/TestDescription.java 8277803 generic-all vmTestbase/metaspace/gc/firstGC_10m/TestDescription.java 8208250 generic-all vmTestbase/metaspace/gc/firstGC_50m/TestDescription.java 8208250 generic-all diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001a.java index d65ae796b4e..0ccc8460a67 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001a.java @@ -27,6 +27,7 @@ package nsk.jdi.TypeComponent.isSynthetic; import nsk.share.*; import nsk.share.jpda.*; import nsk.share.jdi.*; +import java.util.Objects; public class issynthetic001a { @@ -94,5 +95,10 @@ class ClassToCheck { protected Inter ER0, ER1[]={ER0}, ER2[][]={ER1}; transient Inter ET0, ET1[]={ET0}, ET2[][]={ET1}; volatile Inter EV0, EV1[]={EV0}, EV2[][]={EV1}; + + { + // access enclosing instance so this$0 field is generated + Objects.requireNonNull(ClassToCheck.this); + } } } -- GitLab From fde6fe7997a889b17af89b3a8fd25456568a1fa6 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 30 Nov 2021 07:33:46 +0000 Subject: [PATCH 510/890] 8277824: Remove empty RefProcSubPhasesWorkerTimeTracker destructor Co-authored-by: Kim Barrett Reviewed-by: tschatzl, kbarrett --- .../share/gc/shared/referenceProcessorPhaseTimes.cpp | 5 +---- .../share/gc/shared/referenceProcessorPhaseTimes.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp index 42c39d70b10..8d02b56f899 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp @@ -101,10 +101,7 @@ RefProcWorkerTimeTracker::~RefProcWorkerTimeTracker() { RefProcSubPhasesWorkerTimeTracker::RefProcSubPhasesWorkerTimeTracker(ReferenceProcessor::RefProcSubPhases phase, ReferenceProcessorPhaseTimes* phase_times, uint worker_id) : - RefProcWorkerTimeTracker(phase_times->sub_phase_worker_time_sec(phase), worker_id) { -} - -RefProcSubPhasesWorkerTimeTracker::~RefProcSubPhasesWorkerTimeTracker() { + _tracker(phase_times->sub_phase_worker_time_sec(phase), worker_id) { } RefProcPhaseTimeBaseTracker::RefProcPhaseTimeBaseTracker(const char* title, diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp index 2c062b94c3d..1ebfeb88a9c 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp @@ -98,23 +98,23 @@ public: void print_all_references(uint base_indent = 0, bool print_total = true) const; }; -class RefProcWorkerTimeTracker : public CHeapObj { +class RefProcWorkerTimeTracker : public StackObj { protected: WorkerDataArray* _worker_time; double _start_time; uint _worker_id; public: RefProcWorkerTimeTracker(WorkerDataArray* worker_time, uint worker_id); - virtual ~RefProcWorkerTimeTracker(); + ~RefProcWorkerTimeTracker(); }; // Updates working time of each worker thread for a given sub phase. -class RefProcSubPhasesWorkerTimeTracker : public RefProcWorkerTimeTracker { +class RefProcSubPhasesWorkerTimeTracker : public StackObj { + RefProcWorkerTimeTracker _tracker; public: RefProcSubPhasesWorkerTimeTracker(ReferenceProcessor::RefProcSubPhases phase, ReferenceProcessorPhaseTimes* phase_times, uint worker_id); - ~RefProcSubPhasesWorkerTimeTracker(); }; class RefProcPhaseTimeBaseTracker : public StackObj { -- GitLab From d230feea55379618a875566b9f9e3b01deb70795 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 30 Nov 2021 07:34:51 +0000 Subject: [PATCH 511/890] 8277931: Parallel: Remove unused PSVirtualSpace::expand_into Reviewed-by: tschatzl --- .../share/gc/parallel/psVirtualspace.cpp | 61 ------------------- .../share/gc/parallel/psVirtualspace.hpp | 1 - 2 files changed, 62 deletions(-) diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.cpp b/src/hotspot/share/gc/parallel/psVirtualspace.cpp index 473a1f26854..d0bf10c32da 100644 --- a/src/hotspot/share/gc/parallel/psVirtualspace.cpp +++ b/src/hotspot/share/gc/parallel/psVirtualspace.cpp @@ -121,67 +121,6 @@ bool PSVirtualSpace::shrink_by(size_t bytes) { return result; } -size_t -PSVirtualSpace::expand_into(PSVirtualSpace* other_space, size_t bytes) { - assert(is_aligned(bytes), "arg not aligned"); - assert(grows_up(), "this space must grow up"); - assert(other_space->grows_down(), "other space must grow down"); - assert(reserved_high_addr() == other_space->reserved_low_addr(), - "spaces not contiguous"); - assert(special() == other_space->special(), "one space is special, the other is not"); - DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this)); - DEBUG_ONLY(PSVirtualSpaceVerifier other_verifier(other_space)); - - size_t bytes_needed = bytes; - - // First use the uncommitted region in this space. - size_t tmp_bytes = MIN2(uncommitted_size(), bytes_needed); - if (tmp_bytes > 0) { - if (expand_by(tmp_bytes)) { - bytes_needed -= tmp_bytes; - } else { - return 0; - } - } - - // Next take from the uncommitted region in the other space, and commit it. - tmp_bytes = MIN2(other_space->uncommitted_size(), bytes_needed); - if (tmp_bytes > 0) { - char* const commit_base = committed_high_addr(); - if (other_space->special() || - os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) { - // Reduce the reserved region in the other space. - other_space->set_reserved(other_space->reserved_low_addr() + tmp_bytes, - other_space->reserved_high_addr(), - other_space->special()); - - // Grow both reserved and committed in this space. - _reserved_high_addr += tmp_bytes; - _committed_high_addr += tmp_bytes; - bytes_needed -= tmp_bytes; - } else { - return bytes - bytes_needed; - } - } - - // Finally take from the already committed region in the other space. - tmp_bytes = bytes_needed; - if (tmp_bytes > 0) { - // Reduce both committed and reserved in the other space. - other_space->set_committed(other_space->committed_low_addr() + tmp_bytes, - other_space->committed_high_addr()); - other_space->set_reserved(other_space->reserved_low_addr() + tmp_bytes, - other_space->reserved_high_addr(), - other_space->special()); - - // Grow both reserved and committed in this space. - _reserved_high_addr += tmp_bytes; - _committed_high_addr += tmp_bytes; - } - - return bytes; -} - #ifndef PRODUCT bool PSVirtualSpace::is_aligned(size_t value, size_t align) { const size_t tmp_value = value + align - 1; diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.hpp b/src/hotspot/share/gc/parallel/psVirtualspace.hpp index 853264ed62d..1c3721ce019 100644 --- a/src/hotspot/share/gc/parallel/psVirtualspace.hpp +++ b/src/hotspot/share/gc/parallel/psVirtualspace.hpp @@ -95,7 +95,6 @@ class PSVirtualSpace : public CHeapObj { inline void set_committed(char* low_addr, char* high_addr); virtual bool expand_by(size_t bytes); virtual bool shrink_by(size_t bytes); - virtual size_t expand_into(PSVirtualSpace* space, size_t bytes); void release(); #ifndef PRODUCT -- GitLab From 3ee26c6a8152795be281924c26e5def329580352 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Tue, 30 Nov 2021 08:21:16 +0000 Subject: [PATCH 512/890] 8267767: Redundant condition check in SafepointSynchronize::thread_not_running Reviewed-by: hseigel, coleenp, ayang --- src/hotspot/share/runtime/safepoint.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/runtime/safepoint.cpp b/src/hotspot/share/runtime/safepoint.cpp index 039f8b495b0..064a9f64b75 100644 --- a/src/hotspot/share/runtime/safepoint.cpp +++ b/src/hotspot/share/runtime/safepoint.cpp @@ -168,6 +168,14 @@ void SafepointSynchronize::decrement_waiting_to_block() { bool SafepointSynchronize::thread_not_running(ThreadSafepointState *cur_state) { if (!cur_state->is_running()) { + // Robustness: asserted in the caller, but handle/tolerate it for release bits. + LogTarget(Error, safepoint) lt; + if (lt.is_enabled()) { + ResourceMark rm; + LogStream ls(lt); + ls.print("Illegal initial state detected: "); + cur_state->print_on(&ls); + } return true; } cur_state->examine_state_of_thread(SafepointSynchronize::safepoint_counter()); -- GitLab From ceae380d3a3fcef5678e3073e25eb37ca0a24c46 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Tue, 30 Nov 2021 08:33:00 +0000 Subject: [PATCH 513/890] 8277843: [Vector API] scalar2vector generates incorrect type info for mask operations if Op_MaskAll is unavailable Co-authored-by: Jatin Bhateja Reviewed-by: thartmann, jbhateja --- src/hotspot/share/opto/vectornode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index 27524b48dcc..3a88fb37ab0 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -596,13 +596,13 @@ VectorNode* VectorNode::make(int opc, Node* n1, Node* n2, Node* n3, uint vlen, B // Scalar promotion VectorNode* VectorNode::scalar2vector(Node* s, uint vlen, const Type* opd_t, bool is_mask) { BasicType bt = opd_t->array_element_basic_type(); - const TypeVect* vt = opd_t->singleton() ? TypeVect::make(opd_t, vlen, is_mask) - : TypeVect::make(bt, vlen, is_mask); - if (is_mask && Matcher::match_rule_supported_vector(Op_MaskAll, vlen, bt)) { + const TypeVect* vt = TypeVect::make(opd_t, vlen, true); return new MaskAllNode(s, vt); } + const TypeVect* vt = opd_t->singleton() ? TypeVect::make(opd_t, vlen) + : TypeVect::make(bt, vlen); switch (bt) { case T_BOOLEAN: case T_BYTE: -- GitLab From a5f2a58ba4ac25f4bd66f1f1f4c036a4f0024229 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 30 Nov 2021 09:20:49 +0000 Subject: [PATCH 514/890] 8277846: Implement fast-path for ASCII-compatible CharsetEncoders on ppc64 Reviewed-by: lucy, mbaesken --- src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp | 44 ++++++++++++++++--- src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.hpp | 10 ++++- src/hotspot/cpu/ppc/matcher_ppc.hpp | 2 +- src/hotspot/cpu/ppc/ppc.ad | 40 ++++++++--------- 4 files changed, 64 insertions(+), 32 deletions(-) diff --git a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp index 69a29c02654..1ae5c13e62e 100644 --- a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp @@ -41,17 +41,18 @@ // Compress char[] to byte[] by compressing 16 bytes at once. void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register cnt, Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, - Label& Lfailure) { + Label& Lfailure, bool ascii) { const Register tmp0 = R0; + const int byte_mask = ascii ? 0x7F : 0xFF; assert_different_registers(src, dst, cnt, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5); Label Lloop, Lslow; // Check if cnt >= 8 (= 16 bytes) - lis(tmp1, 0xFF); // tmp1 = 0x00FF00FF00FF00FF + lis(tmp1, byte_mask); // tmp1 = 0x00FF00FF00FF00FF (non ascii case) srwi_(tmp2, cnt, 3); beq(CCR0, Lslow); - ori(tmp1, tmp1, 0xFF); + ori(tmp1, tmp1, byte_mask); rldimi(tmp1, tmp1, 32, 0); mtctr(tmp2); @@ -67,7 +68,7 @@ void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register rldimi(tmp4, tmp4, 2*8, 2*8); // _4_6_7_7 andc_(tmp0, tmp0, tmp1); - bne(CCR0, Lfailure); // Not latin1. + bne(CCR0, Lfailure); // Not latin1/ascii. addi(src, src, 16); rlwimi(tmp3, tmp2, 0*8, 24, 31);// _____1_3 @@ -87,20 +88,49 @@ void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register } // Compress char[] to byte[]. cnt must be positive int. -void C2_MacroAssembler::string_compress(Register src, Register dst, Register cnt, Register tmp, Label& Lfailure) { +void C2_MacroAssembler::string_compress(Register src, Register dst, Register cnt, Register tmp, + Label& Lfailure, bool ascii) { + const int byte_mask = ascii ? 0x7F : 0xFF; Label Lloop; mtctr(cnt); bind(Lloop); lhz(tmp, 0, src); - cmplwi(CCR0, tmp, 0xff); - bgt(CCR0, Lfailure); // Not latin1. + cmplwi(CCR0, tmp, byte_mask); + bgt(CCR0, Lfailure); // Not latin1/ascii. addi(src, src, 2); stb(tmp, 0, dst); addi(dst, dst, 1); bdnz(Lloop); } +void C2_MacroAssembler::encode_iso_array(Register src, Register dst, Register len, + Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, + Register result, bool ascii) { + Label Lslow, Lfailure1, Lfailure2, Ldone; + + string_compress_16(src, dst, len, tmp1, tmp2, tmp3, tmp4, tmp5, Lfailure1, ascii); + rldicl_(result, len, 0, 64-3); // Remaining characters. + beq(CCR0, Ldone); + bind(Lslow); + string_compress(src, dst, result, tmp2, Lfailure2, ascii); + li(result, 0); + b(Ldone); + + bind(Lfailure1); + mr(result, len); + mfctr(tmp1); + rldimi_(result, tmp1, 3, 0); // Remaining characters. + beq(CCR0, Ldone); + b(Lslow); + + bind(Lfailure2); + mfctr(result); // Remaining characters. + + bind(Ldone); + subf(result, result, len); +} + // Inflate byte[] to char[] by inflating 16 bytes at once. void C2_MacroAssembler::string_inflate_16(Register src, Register dst, Register cnt, Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5) { diff --git a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.hpp index 9f363f2b962..9c4576f2eaf 100644 --- a/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.hpp @@ -32,10 +32,16 @@ // Compress char[] to byte[] by compressing 16 bytes at once. void string_compress_16(Register src, Register dst, Register cnt, Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, - Label& Lfailure); + Label& Lfailure, bool ascii = false); // Compress char[] to byte[]. cnt must be positive int. - void string_compress(Register src, Register dst, Register cnt, Register tmp, Label& Lfailure); + void string_compress(Register src, Register dst, Register cnt, Register tmp, + Label& Lfailure, bool ascii = false); + + // Encode UTF16 to ISO_8859_1 or ASCII. Return len on success or position of first mismatch. + void encode_iso_array(Register src, Register dst, Register len, + Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, + Register result, bool ascii); // Inflate byte[] to char[] by inflating 16 bytes at once. void string_inflate_16(Register src, Register dst, Register cnt, diff --git a/src/hotspot/cpu/ppc/matcher_ppc.hpp b/src/hotspot/cpu/ppc/matcher_ppc.hpp index 877f0be33c4..c07525bf79e 100644 --- a/src/hotspot/cpu/ppc/matcher_ppc.hpp +++ b/src/hotspot/cpu/ppc/matcher_ppc.hpp @@ -165,6 +165,6 @@ } // Implements a variant of EncodeISOArrayNode that encode ASCII only - static const bool supports_encode_ascii_array = false; + static const bool supports_encode_ascii_array = true; #endif // CPU_PPC_MATCHER_PPC_HPP diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 958059e1ca2..2ced017e2f4 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -12806,30 +12806,26 @@ instruct encode_iso_array(rarg1RegP src, rarg2RegP dst, iRegIsrc len, iRegIdst r effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, USE_KILL src, USE_KILL dst, KILL ctr, KILL cr0); ins_cost(300); - format %{ "Encode array $src,$dst,$len -> $result \t// KILL $tmp1, $tmp2, $tmp3, $tmp4, $tmp5" %} + format %{ "Encode iso array $src,$dst,$len -> $result \t// KILL $tmp1, $tmp2, $tmp3, $tmp4, $tmp5" %} ins_encode %{ - Label Lslow, Lfailure1, Lfailure2, Ldone; - __ string_compress_16($src$$Register, $dst$$Register, $len$$Register, $tmp1$$Register, - $tmp2$$Register, $tmp3$$Register, $tmp4$$Register, $tmp5$$Register, Lfailure1); - __ rldicl_($result$$Register, $len$$Register, 0, 64-3); // Remaining characters. - __ beq(CCR0, Ldone); - __ bind(Lslow); - __ string_compress($src$$Register, $dst$$Register, $result$$Register, $tmp2$$Register, Lfailure2); - __ li($result$$Register, 0); - __ b(Ldone); - - __ bind(Lfailure1); - __ mr($result$$Register, $len$$Register); - __ mfctr($tmp1$$Register); - __ rldimi_($result$$Register, $tmp1$$Register, 3, 0); // Remaining characters. - __ beq(CCR0, Ldone); - __ b(Lslow); - - __ bind(Lfailure2); - __ mfctr($result$$Register); // Remaining characters. + __ encode_iso_array($src$$Register, $dst$$Register, $len$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp3$$Register, $tmp4$$Register, $tmp5$$Register, $result$$Register, false); + %} + ins_pipe(pipe_class_default); +%} - __ bind(Ldone); - __ subf($result$$Register, $result$$Register, $len$$Register); +// encode char[] to byte[] in ASCII +instruct encode_ascii_array(rarg1RegP src, rarg2RegP dst, iRegIsrc len, iRegIdst result, iRegLdst tmp1, + iRegLdst tmp2, iRegLdst tmp3, iRegLdst tmp4, iRegLdst tmp5, regCTR ctr, flagsRegCR0 cr0) %{ + predicate(((EncodeISOArrayNode*)n)->is_ascii()); + match(Set result (EncodeISOArray src (Binary dst len))); + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, + USE_KILL src, USE_KILL dst, KILL ctr, KILL cr0); + ins_cost(300); + format %{ "Encode ascii array $src,$dst,$len -> $result \t// KILL $tmp1, $tmp2, $tmp3, $tmp4, $tmp5" %} + ins_encode %{ + __ encode_iso_array($src$$Register, $dst$$Register, $len$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp3$$Register, $tmp4$$Register, $tmp5$$Register, $result$$Register, true); %} ins_pipe(pipe_class_default); %} -- GitLab From fecf906f0af9ddc0e83cb681845009f34555d5dc Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Tue, 30 Nov 2021 11:50:51 +0000 Subject: [PATCH 515/890] 8267928: Loop predicate gets inexact loop limit before PhaseIdealLoop::rc_predicate Reviewed-by: thartmann, chagedorn, kvn --- src/hotspot/share/opto/loopPredicate.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 8b590511f67..b43adfa0305 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -1277,6 +1277,7 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree *loop, ProjNode* // Limit is not exact. // Calculate exact limit here. // Note, counted loop's test is '<' or '>'. + loop->compute_trip_count(this); Node* limit = exact_limit(loop); int stride = cl->stride()->get_int(); -- GitLab From 69f56a0ea0c2d551b660909deb89f0051540f9d0 Mon Sep 17 00:00:00 2001 From: Adam Sotona Date: Tue, 30 Nov 2021 12:56:48 +0000 Subject: [PATCH 516/890] 8264485: build.tools.depend.Depend.toString(byte[]) creates malformed hex strings Reviewed-by: jlahoda --- make/jdk/src/classes/build/tools/depend/Depend.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/make/jdk/src/classes/build/tools/depend/Depend.java b/make/jdk/src/classes/build/tools/depend/Depend.java index 74df2af2d57..71d1b378879 100644 --- a/make/jdk/src/classes/build/tools/depend/Depend.java +++ b/make/jdk/src/classes/build/tools/depend/Depend.java @@ -37,6 +37,7 @@ import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; +import java.util.HexFormat; import java.util.List; import java.util.Map; import java.util.Objects; @@ -156,13 +157,7 @@ public class Depend implements Plugin { } private String toString(byte[] digest) { - StringBuilder result = new StringBuilder(); - - for (byte b : digest) { - result.append(String.format("%X", b)); - } - - return result.toString(); + return HexFormat.of().withUpperCase().formatHex(digest); } private static final class APIVisitor implements ElementVisitor, -- GitLab From 01cefc94c766b87d426cf1dec89a8867454faf0e Mon Sep 17 00:00:00 2001 From: Maxim Kartashev Date: Tue, 30 Nov 2021 13:01:17 +0000 Subject: [PATCH 517/890] 8277977: Incorrect references to --enable-reproducible-builds in docs Reviewed-by: ihse --- doc/building.html | 2 +- doc/building.md | 2 +- make/autoconf/jdk-options.m4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/building.html b/doc/building.html index 1333a36771a..97c9b2a4bb6 100644 --- a/doc/building.html +++ b/doc/building.html @@ -891,7 +891,7 @@ spawn failed
      • Turn on build system support for reproducible builds
      -

      Add the flag --enable-reproducible-builds to your configure command line. This will turn on support for reproducible builds where it could otherwise be lacking.

      +

      Add the flag --enable-reproducible-build to your configure command line. This will turn on support for reproducible builds where it could otherwise be lacking.

      • Do not rely on configure's default adhoc version strings
      diff --git a/doc/building.md b/doc/building.md index ac694ef8404..033f99d3f5a 100644 --- a/doc/building.md +++ b/doc/building.md @@ -1518,7 +1518,7 @@ non-determinism and make a larger part of the build reproducible: * Turn on build system support for reproducible builds -Add the flag `--enable-reproducible-builds` to your `configure` command line. +Add the flag `--enable-reproducible-build` to your `configure` command line. This will turn on support for reproducible builds where it could otherwise be lacking. diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index f8062d91b69..337263caa50 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -702,7 +702,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD], if test "x$OPENJDK_BUILD_OS" = xwindows && \ test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = xfalse && \ test "x$ENABLE_REPRODUCIBLE_BUILD" = xfalse; then - AC_MSG_NOTICE([On Windows it is not possible to combine --disable-reproducible-builds]) + AC_MSG_NOTICE([On Windows it is not possible to combine --disable-reproducible-build]) AC_MSG_NOTICE([with --disable-absolute-paths-in-output.]) AC_MSG_ERROR([Cannot continue]) fi -- GitLab From 915084041f32bf6ffe4d12c031ac5e69adcc07f5 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 30 Nov 2021 13:42:18 +0000 Subject: [PATCH 518/890] 8277899: Parallel: Simplify PSVirtualSpace::initialize logic Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/parallel/objectStartArray.cpp | 4 +--- src/hotspot/share/gc/parallel/psVirtualspace.cpp | 8 +------- src/hotspot/share/gc/parallel/psVirtualspace.hpp | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp index e75a1efa734..c9c7ac6b796 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.cpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp @@ -65,9 +65,7 @@ void ObjectStartArray::initialize(MemRegion reserved_region) { MemTracker::record_virtual_memory_type((address)backing_store.base(), mtGC); // We do not commit any memory initially - if (!_virtual_space.initialize(backing_store, 0)) { - vm_exit_during_initialization("Could not commit space for ObjectStartArray"); - } + _virtual_space.initialize(backing_store); _raw_base = (jbyte*)_virtual_space.low_boundary(); diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.cpp b/src/hotspot/share/gc/parallel/psVirtualspace.cpp index d0bf10c32da..830aa54d2b1 100644 --- a/src/hotspot/share/gc/parallel/psVirtualspace.cpp +++ b/src/hotspot/share/gc/parallel/psVirtualspace.cpp @@ -56,16 +56,10 @@ PSVirtualSpace::PSVirtualSpace(): } // Deprecated. -bool PSVirtualSpace::initialize(ReservedSpace rs, - size_t commit_size) { +void PSVirtualSpace::initialize(ReservedSpace rs) { set_reserved(rs); set_committed(reserved_low_addr(), reserved_low_addr()); - - // Commit to initial size. - assert(commit_size <= rs.size(), "commit_size too big"); - bool result = commit_size > 0 ? expand_by(commit_size) : true; DEBUG_ONLY(verify()); - return result; } PSVirtualSpace::~PSVirtualSpace() { diff --git a/src/hotspot/share/gc/parallel/psVirtualspace.hpp b/src/hotspot/share/gc/parallel/psVirtualspace.hpp index 1c3721ce019..4bb0547e3f1 100644 --- a/src/hotspot/share/gc/parallel/psVirtualspace.hpp +++ b/src/hotspot/share/gc/parallel/psVirtualspace.hpp @@ -73,7 +73,7 @@ class PSVirtualSpace : public CHeapObj { _special(false) { } PSVirtualSpace(); - bool initialize(ReservedSpace rs, size_t commit_size); + void initialize(ReservedSpace rs); bool contains(void* p) const; -- GitLab From 98a9f037397d437d2c3221e8522ed8ab397a457a Mon Sep 17 00:00:00 2001 From: Jorn Vernee Date: Tue, 30 Nov 2021 14:34:00 +0000 Subject: [PATCH 519/890] 8277602: Deopt code does not extend the stack enough if the caller is an optimize entry blob Reviewed-by: dlong, thartmann --- .../cpu/x86/universalUpcallHandler_x86_64.cpp | 8 +- src/hotspot/share/runtime/deoptimization.cpp | 2 +- src/hotspot/share/runtime/frame.hpp | 5 + src/hotspot/share/runtime/vframeArray.cpp | 2 + .../foreign/upcalldeopt/TestUpcallDeopt.java | 112 ++++++++++++++++++ .../java/foreign/upcalldeopt/libUpcallDeopt.c | 32 +++++ 6 files changed, 153 insertions(+), 8 deletions(-) create mode 100644 test/jdk/java/foreign/upcalldeopt/TestUpcallDeopt.java create mode 100644 test/jdk/java/foreign/upcalldeopt/libUpcallDeopt.c diff --git a/src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp b/src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp index c54b907f9b5..da675bf0aa6 100644 --- a/src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp +++ b/src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp @@ -616,12 +616,9 @@ address ProgrammableUpcallHandler::generate_optimized_upcall_stub(jobject receiv int reg_save_area_size = compute_reg_save_area_size(abi); int arg_save_area_size = compute_arg_save_area_size(conv); int res_save_area_size = compute_res_save_area_size(conv); - // To spill receiver during deopt - int deopt_spill_size = 1 * BytesPerWord; int shuffle_area_offset = 0; - int deopt_spill_offset = shuffle_area_offset + out_arg_area; - int res_save_area_offset = deopt_spill_offset + deopt_spill_size; + int res_save_area_offset = shuffle_area_offset + out_arg_area; int arg_save_area_offset = res_save_area_offset + res_save_area_size; int reg_save_area_offset = arg_save_area_offset + arg_save_area_size; int frame_data_offset = reg_save_area_offset + reg_save_area_size; @@ -648,9 +645,6 @@ address ProgrammableUpcallHandler::generate_optimized_upcall_stub(jobject receiv // | res_save_area | // |---------------------| = res_save_are_offset // | | - // | deopt_spill | - // |---------------------| = deopt_spill_offset - // | | // SP-> | out_arg_area | needs to be at end for shadow space // // diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index 054d0ac9ffe..85159a3287a 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -585,7 +585,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread // QQQ I'd rather see this pushed down into last_frame_adjust // and have it take the sender (aka caller). - if (deopt_sender.is_compiled_frame() || caller_was_method_handle) { + if (deopt_sender.is_compiled_caller() || caller_was_method_handle) { caller_adjustment = last_frame_adjust(0, callee_locals); } else if (callee_locals > callee_parameters) { // The caller frame may need extending to accommodate diff --git a/src/hotspot/share/runtime/frame.hpp b/src/hotspot/share/runtime/frame.hpp index 282530a88ba..e4eed4a1198 100644 --- a/src/hotspot/share/runtime/frame.hpp +++ b/src/hotspot/share/runtime/frame.hpp @@ -146,6 +146,11 @@ class frame { bool is_interpreted_frame_valid(JavaThread* thread) const; // performs sanity checks on interpreted frames. + // is this frame doing a call using the compiled calling convention? + bool is_compiled_caller() const { + return is_compiled_frame() || is_optimized_entry_frame(); + } + // tells whether this frame is marked for deoptimization bool should_be_deoptimized() const; diff --git a/src/hotspot/share/runtime/vframeArray.cpp b/src/hotspot/share/runtime/vframeArray.cpp index 2c5bf70c4ac..0d6417037c6 100644 --- a/src/hotspot/share/runtime/vframeArray.cpp +++ b/src/hotspot/share/runtime/vframeArray.cpp @@ -337,6 +337,7 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters, for(i = 0; i < expressions()->size(); i++) { StackValue *value = expressions()->at(i); intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); + assert(!is_bottom_frame || !(caller->is_compiled_caller() && addr >= caller->unextended_sp()), "overwriting caller frame!"); switch(value->type()) { case T_INT: *addr = value->get_int(); @@ -375,6 +376,7 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters, for(i = 0; i < locals()->size(); i++) { StackValue *value = locals()->at(i); intptr_t* addr = iframe()->interpreter_frame_local_at(i); + assert(!is_bottom_frame || !(caller->is_compiled_caller() && addr >= caller->unextended_sp()), "overwriting caller frame!"); switch(value->type()) { case T_INT: *addr = value->get_int(); diff --git a/test/jdk/java/foreign/upcalldeopt/TestUpcallDeopt.java b/test/jdk/java/foreign/upcalldeopt/TestUpcallDeopt.java new file mode 100644 index 00000000000..a8a09420344 --- /dev/null +++ b/test/jdk/java/foreign/upcalldeopt/TestUpcallDeopt.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021, 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 id=default_gc + * @bug 8277602 + * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" + * @library /test/lib + * @library ../ + * @build sun.hotspot.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * + * @run main/othervm + * -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * --enable-native-access=ALL-UNNAMED + * -Xbatch + * TestUpcallDeopt + */ + +import jdk.incubator.foreign.Addressable; +import jdk.incubator.foreign.CLinker; +import jdk.incubator.foreign.FunctionDescriptor; +import jdk.incubator.foreign.NativeSymbol; +import jdk.incubator.foreign.SymbolLookup; +import jdk.incubator.foreign.MemoryAddress; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodType; +import java.lang.ref.Reference; + +import jdk.incubator.foreign.ResourceScope; +import sun.hotspot.WhiteBox; + +import static java.lang.invoke.MethodHandles.lookup; + +public class TestUpcallDeopt extends NativeTestHelper { + static final WhiteBox WB = WhiteBox.getWhiteBox(); + + static final CLinker linker = CLinker.systemCLinker(); + + static final MethodHandle MH_foo; + static final MethodHandle MH_m; + + static { + try { + System.loadLibrary("UpcallDeopt"); + SymbolLookup lookup = SymbolLookup.loaderLookup(); + MH_foo = linker.downcallHandle( + lookup.lookup("foo").orElseThrow(), + FunctionDescriptor.ofVoid(C_POINTER, C_INT, C_INT, C_INT, C_INT)); + MH_m = lookup().findStatic(TestUpcallDeopt.class, "m", + MethodType.methodType(void.class, int.class, int.class, int.class, int.class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static boolean armed; + + // we need to deoptimize through an uncommon trap in the callee of the optimized upcall stub + // that is created when calling upcallStub below + public static void main(String[] args) throws Throwable { + try (ResourceScope scope = ResourceScope.newConfinedScope()) { + NativeSymbol stub = linker.upcallStub(MH_m, FunctionDescriptor.ofVoid(C_INT, C_INT, C_INT, C_INT), scope); + armed = false; + for (int i = 0; i < 20_000; i++) { + payload(stub); // warmup + } + + armed = true; + payload(stub); // test + } + } + + static void payload(NativeSymbol cb) throws Throwable { + MH_foo.invokeExact((Addressable) cb, 0, 1, 2, 3); + Reference.reachabilityFence(cb); // keep oop alive across call + } + + // Takes a bunch of arguments, even though unused, to test + // if the caller's frame is extended enough to spill these arguments. + static void m(int a0, int a1, int a2, int a3) { + if (armed) { + // Trigger uncommon trap from this frame + WB.verifyFrames(/*log=*/true, /*updateRegisterMap=*/true); + WB.verifyFrames(/*log=*/true, /*updateRegisterMap=*/false); // triggers different code paths + } + } + +} diff --git a/test/jdk/java/foreign/upcalldeopt/libUpcallDeopt.c b/test/jdk/java/foreign/upcalldeopt/libUpcallDeopt.c new file mode 100644 index 00000000000..ae2a8dc0173 --- /dev/null +++ b/test/jdk/java/foreign/upcalldeopt/libUpcallDeopt.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021, 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. + */ + +#ifdef _WIN64 +#define EXPORT __declspec(dllexport) +#else +#define EXPORT +#endif + +EXPORT void foo(void (*cb)(int, int, int, int), int a0, int a1, int a2, int a3) { + cb(a0, a1, a2, a3); +} -- GitLab From 21d9ca6cd942ac98a3be2577ded8eaf92dac7d46 Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Tue, 30 Nov 2021 18:55:24 +0000 Subject: [PATCH 520/890] 8274983: C1 optimizes the invocation of private interface methods Reviewed-by: dlong, iveresov --- src/hotspot/share/c1/c1_GraphBuilder.cpp | 39 ++++++--- .../vm/compiler/InterfacePrivateCalls.java | 80 +++++++++++++++++++ 2 files changed, 107 insertions(+), 12 deletions(-) create mode 100644 test/micro/org/openjdk/bench/vm/compiler/InterfacePrivateCalls.java diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index 9afabb75060..2c10642f8ad 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.cpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp @@ -1865,22 +1865,17 @@ void GraphBuilder::invoke(Bytecodes::Code code) { log->identify(target), Bytecodes::name(code)); - // invoke-special-super - if (bc_raw == Bytecodes::_invokespecial && !target->is_object_initializer()) { - ciInstanceKlass* sender_klass = calling_klass; - if (sender_klass->is_interface()) { - int index = state()->stack_size() - (target->arg_size_no_receiver() + 1); - Value receiver = state()->stack_at(index); - CheckCast* c = new CheckCast(sender_klass, receiver, copy_state_before()); - c->set_invokespecial_receiver_check(); - state()->stack_at_put(index, append_split(c)); - } - } - // Some methods are obviously bindable without any type checks so // convert them directly to an invokespecial or invokestatic. if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) { switch (bc_raw) { + case Bytecodes::_invokeinterface: + // convert to invokespecial if the target is the private interface method. + if (target->is_private()) { + assert(holder->is_interface(), "How did we get a non-interface method here!"); + code = Bytecodes::_invokespecial; + } + break; case Bytecodes::_invokevirtual: code = Bytecodes::_invokespecial; break; @@ -1897,6 +1892,26 @@ void GraphBuilder::invoke(Bytecodes::Code code) { } } + if (code == Bytecodes::_invokespecial) { + // Additional receiver subtype checks for interface calls via invokespecial or invokeinterface. + ciKlass* receiver_constraint = nullptr; + + if (bc_raw == Bytecodes::_invokeinterface) { + receiver_constraint = holder; + } else if (bc_raw == Bytecodes::_invokespecial && !target->is_object_initializer() && calling_klass->is_interface()) { + receiver_constraint = calling_klass; + } + + if (receiver_constraint != nullptr) { + int index = state()->stack_size() - (target->arg_size_no_receiver() + 1); + Value receiver = state()->stack_at(index); + CheckCast* c = new CheckCast(receiver_constraint, receiver, copy_state_before()); + // go to uncommon_trap when checkcast fails + c->set_invokespecial_receiver_check(); + state()->stack_at_put(index, append_split(c)); + } + } + // Push appendix argument (MethodType, CallSite, etc.), if one. bool patch_for_appendix = false; int patching_appendix_arg = 0; diff --git a/test/micro/org/openjdk/bench/vm/compiler/InterfacePrivateCalls.java b/test/micro/org/openjdk/bench/vm/compiler/InterfacePrivateCalls.java new file mode 100644 index 00000000000..620b885db36 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/InterfacePrivateCalls.java @@ -0,0 +1,80 @@ +/* + * Copyright Amazon.com Inc. 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 org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; + +import java.util.concurrent.TimeUnit; + +@State(Scope.Benchmark) +public class InterfacePrivateCalls { + interface I { + private int bar() { return 0; } + default int foo() { + return bar(); + } + } + + static class C1 implements I {} + static class C2 implements I {} + static class C3 implements I {} + + private I[] objs; + + @Setup(Level.Trial) + public void setupTrial() { + objs = new I[3]; + objs[0] = new C1(); + objs[1] = new C2(); + objs[2] = new C3(); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + @Fork(value=1, jvmArgsAppend={"-XX:TieredStopAtLevel=1"}) + public void invokePrivateInterfaceMethodC1() { + for (int i = 0; i < objs.length; ++i) { + objs[i].foo(); + } + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + @Fork(value=1) + public void invokePrivateInterfaceMethodC2() { + for (int i = 0; i < objs.length; ++i) { + objs[i].foo(); + } + } +} -- GitLab From 15a680647c4c5df4538e906960c594da79aebf5c Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Tue, 30 Nov 2021 20:22:35 +0000 Subject: [PATCH 521/890] 8277434: tests fail with "assert(is_forwarded()) failed: only decode when actually forwarded" Reviewed-by: ayang, shade, tschatzl --- src/hotspot/share/gc/g1/g1ParScanThreadState.cpp | 4 ++++ src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp | 4 ++-- test/hotspot/jtreg/ProblemList.txt | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp index a8ffaa20ed5..2028f775e31 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp @@ -482,6 +482,10 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio Copy::aligned_disjoint_words(cast_from_oop(old), obj_ptr, word_sz); const oop obj = cast_to_oop(obj_ptr); + // Because the forwarding is done with memory_order_relaxed there is no + // ordering with the above copy. Clients that get the forwardee must not + // examine its contents without other synchronization, since the contents + // may not be up to date for them. const oop forward_ptr = old->forward_to_atomic(obj, old_mark, memory_order_relaxed); if (forward_ptr == NULL) { diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp index 46651307bc1..c37f0f38e51 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp @@ -111,9 +111,9 @@ template void G1ParScanThreadState::write_ref_field_post(T* p, oop obj // References to the current collection set are references to objects that failed // evacuation. Currently these regions are always relabelled as old without // remembered sets, so skip them. - assert(dest_attr.is_in_cset() == (obj->is_forwarded() && obj->forwardee() == obj), - "Only evac-failed objects must be in the collection set here but " PTR_FORMAT " is not", p2i(obj)); if (dest_attr.is_in_cset()) { + assert(obj->is_forwarded(), "evac-failed but not forwarded: " PTR_FORMAT, p2i(obj)); + assert(obj->forwardee() == obj, "evac-failed but not self-forwarded: " PTR_FORMAT, p2i(obj)); return; } enqueue_card_if_tracked(dest_attr, p, obj); diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index fb6c99b196c..2784a110bb8 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -89,8 +89,6 @@ gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8241293 macosx-x64 -applications/jcstress/acqrel.java 8277434 linux-aarch64 - ############################################################################# # :hotspot_runtime -- GitLab From 5a4a9bb9d55134deac0e02cf37f31d1dd2223024 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 30 Nov 2021 20:40:10 +0000 Subject: [PATCH 522/890] 8278019: ProblemList java/awt/dnd/BadSerializationTest/BadSerializationTest.java on linux and windows Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 15355aa04a0..69afd3be6b3 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -516,6 +516,7 @@ java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest. java/awt/Window/GetScreenLocation/GetScreenLocationTest.java 8225787 linux-x64 java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java 8266243 macosx-aarch64 +java/awt/dnd/BadSerializationTest/BadSerializationTest.java 8277817 linux-x64,windows-x64 ############################################################################ -- GitLab From e30e67670981ee905724787c109b7b7fd2b70b42 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Tue, 30 Nov 2021 20:50:13 +0000 Subject: [PATCH 523/890] 8277606: String(String) constructor could copy hashIsZero Reviewed-by: redestad, rriggs --- src/java.base/share/classes/java/lang/String.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java.base/share/classes/java/lang/String.java b/src/java.base/share/classes/java/lang/String.java index 50e5525bb3e..abb35ebaeb1 100644 --- a/src/java.base/share/classes/java/lang/String.java +++ b/src/java.base/share/classes/java/lang/String.java @@ -261,6 +261,7 @@ public final class String this.value = original.value; this.coder = original.coder; this.hash = original.hash; + this.hashIsZero = original.hashIsZero; } /** -- GitLab From 2942646957537b2a4b078bc8cb0becab967c21e2 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Tue, 30 Nov 2021 22:07:07 +0000 Subject: [PATCH 524/890] 8276683: Malformed Javadoc inline tags in JDK source in com/sun/tools/javac/util/RawDiagnosticFormatter.java Reviewed-by: darcy, prappo, iris --- .../com/sun/tools/javac/util/RawDiagnosticFormatter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java index 27312e021e0..818e2e47427 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java @@ -59,8 +59,8 @@ public final class RawDiagnosticFormatter extends AbstractDiagnosticFormatter { /** * Helper class to generate stable positions for AST nodes occurring in diagnostic arguments. - * If the AST node appears in the same line number as the main diagnostic, the line is information is omitted. - * Otherwise both line and column information is included, using the format @{code line:col}". + * If the AST node appears in the same line number as the main diagnostic, the line information is omitted. + * Otherwise, both line and column information is included, using the format {@code line:col}. * * Note: since subdiagnostics can be created without a diagnostic source, a position helper * should always refer to the toplevel diagnostic source. @@ -85,7 +85,7 @@ public final class RawDiagnosticFormatter extends AbstractDiagnosticFormatter { /** * Create a formatter based on the supplied options. - * @param options + * @param options the compiler options */ public RawDiagnosticFormatter(Options options) { super(null, new SimpleConfiguration(options, -- GitLab From f1c20e91d822c6df4c5da895f2abd6305e00bf8b Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Tue, 30 Nov 2021 22:41:36 +0000 Subject: [PATCH 525/890] 8190748: java/text/Format/DateFormat/DateFormatTest.java and NonGregorianFormatTest fail intermittently Reviewed-by: rriggs, joehw, lancea --- .../java/text/Format/DateFormat/DateFormatTest.java | 6 +++--- .../Format/DateFormat/NonGregorianFormatTest.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/test/jdk/java/text/Format/DateFormat/DateFormatTest.java b/test/jdk/java/text/Format/DateFormat/DateFormatTest.java index 43c73ac3778..5be792d1cd7 100644 --- a/test/jdk/java/text/Format/DateFormat/DateFormatTest.java +++ b/test/jdk/java/text/Format/DateFormat/DateFormatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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,7 +24,7 @@ /** * @test * @bug 4052223 4089987 4469904 4326988 4486735 8008577 8045998 8140571 - * 8216969 + * 8190748 8216969 * @summary test DateFormat and SimpleDateFormat. * @library /java/text/testlib * @modules jdk.localedata @@ -342,7 +342,7 @@ public class DateFormatTest extends IntlTest // Test pattern with runs things together public void TestRunTogetherPattern985() { - String format = "yyyyMMddHHmmssSSS"; + String format = "yyyyMMddHHmmssSSSzzzz"; String now, then; SimpleDateFormat formatter = new SimpleDateFormat(format); diff --git a/test/jdk/java/text/Format/DateFormat/NonGregorianFormatTest.java b/test/jdk/java/text/Format/DateFormat/NonGregorianFormatTest.java index 93e2a9ffeee..613687eb910 100644 --- a/test/jdk/java/text/Format/DateFormat/NonGregorianFormatTest.java +++ b/test/jdk/java/text/Format/DateFormat/NonGregorianFormatTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -23,12 +23,13 @@ /* * @test - * @bug 4833268 6253991 8008577 + * @bug 4833268 6253991 8008577 8190748 * @summary Test formatting and parsing with non-Gregorian calendars * @modules jdk.localedata * @run main/othervm -Djava.locale.providers=COMPAT,SPI NonGregorianFormatTest */ +import java.time.ZoneId; import java.util.*; import java.text.*; import static java.util.Calendar.*; @@ -160,10 +161,15 @@ public class NonGregorianFormatTest { private static void testRoundTrip(DateFormat df, Date orig) { try { + var defZone = ZoneId.systemDefault(); + if (defZone.getRules().getTransition(orig.toInstant().atZone(defZone).toLocalDateTime()) != null) { + System.out.println("At the offset transition. Round trip test skipped."); + return; + } String s = df.format(orig); Date parsed = df.parse(s); if (!orig.equals(parsed)) { - error("testRoundTrip: bad date: origianl: '%s', parsed '%s'%n", orig, parsed); + error("testRoundTrip: bad date: original: '%s', parsed '%s'%n", orig, parsed); } } catch (Exception e) { error("Unexpected exception: %s%n", e); -- GitLab From 65251f76937d1844e2235ce64b42b17f4492d20e Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Tue, 30 Nov 2021 22:43:53 +0000 Subject: [PATCH 526/890] 8151594: Move concurrent refinement thread activation logging out of GC pause Reviewed-by: tschatzl, ayang --- src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp index e57617114d2..5df9bf407e0 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -104,10 +104,6 @@ void G1ConcurrentRefineThread::run_service() { break; } - log_debug(gc, refine)("Activated worker %d, on threshold: " SIZE_FORMAT ", current: " SIZE_FORMAT, - _worker_id, _cr->activation_threshold(_worker_id), - G1BarrierSet::dirty_card_queue_set().num_cards()); - // For logging. G1ConcurrentRefineStats start_stats = *_refinement_stats; G1ConcurrentRefineStats total_stats; // Accumulate over activation. @@ -115,6 +111,10 @@ void G1ConcurrentRefineThread::run_service() { { SuspendibleThreadSetJoiner sts_join; + log_debug(gc, refine)("Activated worker %d, on threshold: %zu, current: %zu", + _worker_id, _cr->activation_threshold(_worker_id), + G1BarrierSet::dirty_card_queue_set().num_cards()); + while (!should_terminate()) { if (sts_join.should_yield()) { // Accumulate changed stats before possible GC that resets stats. -- GitLab From dd73e3cea238b231b20095de87e94f928700f15a Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Wed, 1 Dec 2021 00:44:51 +0000 Subject: [PATCH 527/890] 8277814: ConcurrentRefineThread should report rate when deactivating Reviewed-by: tschatzl, sjohanss --- src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp | 8 +++++++- src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp | 5 ++++- src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp index 055fd8b891d..3e8f83326b2 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -32,6 +32,12 @@ G1ConcurrentRefineStats::G1ConcurrentRefineStats() : _dirtied_cards(0) {} +double G1ConcurrentRefineStats::refinement_rate_ms() const { + // Report 0 when no time recorded because no refinement performed. + double secs = refinement_time().seconds(); + return (secs > 0) ? (refined_cards() / (secs * MILLIUNITS)) : 0.0; +} + G1ConcurrentRefineStats& G1ConcurrentRefineStats::operator+=(const G1ConcurrentRefineStats& other) { _refinement_time += other._refinement_time; diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp index d0e17301a5f..ae576778a07 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineStats.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -47,6 +47,9 @@ public: // Number of refined cards. size_t refined_cards() const { return _refined_cards; } + // Refinement rate, in cards per ms. + double refinement_rate_ms() const; + // Number of cards for which refinement was skipped because some other // thread had already refined them. size_t precleaned_cards() const { return _precleaned_cards; } diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp index 5df9bf407e0..45defd5e713 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp @@ -131,12 +131,12 @@ void G1ConcurrentRefineThread::run_service() { } total_stats += *_refinement_stats - start_stats; - log_debug(gc, refine)("Deactivated worker %d, off threshold: " SIZE_FORMAT - ", current: " SIZE_FORMAT - ", refined cards: " SIZE_FORMAT, + log_debug(gc, refine)("Deactivated worker %d, off threshold: %zu, " + "cards: %zu, refined %zu, rate %1.2fc/ms", _worker_id, _cr->deactivation_threshold(_worker_id), G1BarrierSet::dirty_card_queue_set().num_cards(), - total_stats.refined_cards()); + total_stats.refined_cards(), + total_stats.refinement_rate_ms()); if (os::supports_vtime()) { _vtime_accum = (os::elapsedVTime() - _vtime_start); -- GitLab From ab867f6c7c578ae7e65af2989b6836d523a41c5a Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 1 Dec 2021 00:48:28 +0000 Subject: [PATCH 528/890] 8272162: S4U2Self ticket without forwardable flag Reviewed-by: valeriep --- .../share/conf/security/java.security | 26 +++++ .../sun/security/jgss/krb5/Krb5Context.java | 28 +++--- .../jgss/krb5/Krb5InitCredential.java | 2 +- .../jgss/krb5/Krb5ProxyCredential.java | 25 +++-- .../sun/security/krb5/Credentials.java | 22 +++-- .../classes/sun/security/krb5/KdcComm.java | 35 ++++--- .../classes/sun/security/krb5/KrbAsReq.java | 9 +- .../sun/security/krb5/KrbAsReqBuilder.java | 4 +- .../classes/sun/security/krb5/KrbKdcReq.java | 38 ++++++++ .../classes/sun/security/krb5/KrbTgsRep.java | 9 +- .../classes/sun/security/krb5/KrbTgsReq.java | 95 ++++++++---------- .../krb5/internal/CredentialsUtil.java | 86 ++++++++--------- .../sun/security/krb5/internal/KDCReq.java | 5 - .../krb5/internal/ReferralsCache.java | 12 +-- .../sun/security/krb5/internal/Ticket.java | 4 +- test/jdk/sun/security/krb5/auto/KDC.java | 74 ++++++++++---- .../sun/security/krb5/auto/S4U2selfNotF.java | 96 +++++++++++++++++++ 17 files changed, 375 insertions(+), 195 deletions(-) create mode 100644 src/java.security.jgss/share/classes/sun/security/krb5/KrbKdcReq.java create mode 100644 test/jdk/sun/security/krb5/auto/S4U2selfNotF.java diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security index 63be286686d..91b3a01ee57 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security @@ -1365,3 +1365,29 @@ jdk.tls.alpnCharset=ISO_8859_1 # The default pattern value allows any object factory class specified by the reference # instance to recreate the referenced object. #jdk.jndi.object.factoriesFilter=* + +# +# Policy for non-forwardable service ticket in a S4U2proxy request +# +# The Service for User to Proxy (S4U2proxy) Kerberos extension enables a middle service +# to obtain a service ticket to another service on behalf of a user. It requires that +# the user's service ticket to the first service has the forwardable flag set [1]. +# However, some KDC implementations ignore this requirement and accept service tickets +# with the flag unset. +# +# If this security property is set to "true", then +# +# 1) The user service ticket, when obtained by the middle service after a S4U2self +# impersonation, is not required to have the forwardable flag set; and, +# +# 2) If a S4U2proxy request receives a KRB_ERROR of the KDC_ERR_BADOPTION error code +# and the ticket to the middle service is not forwardable, OpenJDK will try the same +# request with another KDC instead of treating it as a fatal failure. +# +# The default value is "false". +# +# If a system property of the same name is also specified, it supersedes the +# security property value defined here. +# +# [1] https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/bde93b0e-f3c9-4ddf-9f44-e1453be7af5a +#jdk.security.krb5.s4u2proxy.acceptNonForwardableServiceTicket=false diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java index 8a9ab5f8488..6e0286c5d5b 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java @@ -45,7 +45,6 @@ import javax.security.auth.kerberos.ServicePermission; import javax.security.auth.kerberos.KerberosCredMessage; import javax.security.auth.kerberos.KerberosPrincipal; import javax.security.auth.kerberos.KerberosTicket; -import sun.security.krb5.internal.Ticket; import sun.security.krb5.internal.AuthorizationData; /** @@ -120,9 +119,12 @@ class Krb5Context implements GSSContextSpi { // XXX See if the required info from these can be extracted and // stored elsewhere private Credentials tgt; + + // On the Initiator side, contains the final TGS to a service on both + // delegation and no-delegation scenarios. + // On the Acceptor side, contains a user TGS usable for delegation. private Credentials serviceCreds; private KrbApReq apReq; - Ticket serviceTicket; private final GSSCaller caller; private static final boolean DEBUG = Krb5Util.DEBUG; @@ -548,7 +550,7 @@ class Krb5Context implements GSSContextSpi { delegatedCred = new Krb5ProxyCredential( Krb5InitCredential.getInstance( GSSCaller.CALLER_ACCEPT, myName, lifetime), - peerName, serviceTicket); + peerName, serviceCreds); } catch (GSSException gsse) { // OK, delegatedCred is null then } @@ -623,13 +625,13 @@ class Krb5Context implements GSSContextSpi { "No TGT available"); } myName = (Krb5NameElement) myCred.getName(); - final Krb5ProxyCredential second; + final Krb5ProxyCredential proxyCreds; if (myCred instanceof Krb5InitCredential) { - second = null; + proxyCreds = null; tgt = ((Krb5InitCredential) myCred).getKrb5Credentials(); } else { - second = (Krb5ProxyCredential) myCred; - tgt = second.self.getKrb5Credentials(); + proxyCreds = (Krb5ProxyCredential) myCred; + tgt = proxyCreds.self.getKrb5Credentials(); } checkPermission(peerName.getKrb5PrincipalName().getName(), @@ -657,9 +659,9 @@ class Krb5Context implements GSSContextSpi { GSSCaller.CALLER_UNKNOWN, // since it's useSubjectCredsOnly here, // don't worry about the null - second == null ? + proxyCreds == null ? myName.getKrb5PrincipalName().getName(): - second.getName().getKrb5PrincipalName().getName(), + proxyCreds.getName().getKrb5PrincipalName().getName(), peerName.getKrb5PrincipalName().getName()); }}); kerbTicket = tmp; @@ -690,15 +692,15 @@ class Krb5Context implements GSSContextSpi { "the subject"); } // Get Service ticket using the Kerberos protocols - if (second == null) { + if (proxyCreds == null) { serviceCreds = Credentials.acquireServiceCreds( peerName.getKrb5PrincipalName().getName(), tgt); } else { serviceCreds = Credentials.acquireS4U2proxyCreds( peerName.getKrb5PrincipalName().getName(), - second.tkt, - second.getName().getKrb5PrincipalName(), + proxyCreds.userCreds, + proxyCreds.getName().getKrb5PrincipalName(), tgt); } if (GSSUtil.useSubjectCredsOnly(caller)) { @@ -844,7 +846,7 @@ class Krb5Context implements GSSContextSpi { retVal = new AcceptSecContextToken(this, token.getKrbApReq()).encode(); } - serviceTicket = token.getKrbApReq().getCreds().getTicket(); + serviceCreds = token.getKrbApReq().getCreds(); myCred = null; state = STATE_DONE; } else { diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java index 5bd5652f699..5ec6c30a676 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java @@ -392,7 +392,7 @@ public class Krb5InitCredential Krb5NameElement kname = (Krb5NameElement)name; Credentials newCred = Credentials.acquireS4U2selfCreds( kname.getKrb5PrincipalName(), krb5Credentials); - return new Krb5ProxyCredential(this, kname, newCred.getTicket()); + return new Krb5ProxyCredential(this, kname, newCred); } catch (IOException | KrbException ke) { GSSException ge = new GSSException(GSSException.FAILURE, -1, diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5ProxyCredential.java b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5ProxyCredential.java index 8fbe93a5768..8859c759f13 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5ProxyCredential.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5ProxyCredential.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -33,7 +33,6 @@ import java.io.IOException; import sun.security.krb5.Credentials; import sun.security.krb5.KrbException; -import sun.security.krb5.internal.Ticket; import javax.security.auth.kerberos.KerberosTicket; @@ -50,23 +49,23 @@ public class Krb5ProxyCredential implements Krb5CredElement { public final Krb5InitCredential self; // the middle server - private final Krb5NameElement client; // the client + private final Krb5NameElement user; // the user - // The ticket with cname=client and sname=self. This can be a normal - // service ticket or an S4U2self ticket. - public final Ticket tkt; + // The creds with cname=user and sname=self. The ticket inside can + // be either a normal service ticket or an S4U2self ticket. + public final Credentials userCreds; - Krb5ProxyCredential(Krb5InitCredential self, Krb5NameElement client, - Ticket tkt) { + Krb5ProxyCredential(Krb5InitCredential self, Krb5NameElement user, + Credentials userCreds) { this.self = self; - this.tkt = tkt; - this.client = client; + this.userCreds = userCreds; + this.user = user; } - // The client name behind the proxy + // The user name behind the proxy @Override public final Krb5NameElement getName() throws GSSException { - return client; + return user; } @Override @@ -130,7 +129,7 @@ public class Krb5ProxyCredential Credentials proxyCreds = Krb5Util.ticketToCreds(proxy); return new Krb5ProxyCredential(initiator, Krb5NameElement.getInstance(proxyCreds.getClient()), - proxyCreds.getTicket()); + proxyCreds); } else { return initiator; } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/Credentials.java b/src/java.security.jgss/share/classes/sun/security/krb5/Credentials.java index d84ccd2b631..b4efc5f4db7 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/Credentials.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/Credentials.java @@ -35,6 +35,8 @@ import sun.security.action.GetPropertyAction; import sun.security.krb5.internal.*; import sun.security.krb5.internal.ccache.CredentialsCache; import sun.security.krb5.internal.crypto.EType; +import sun.security.util.SecurityProperties; + import java.io.IOException; import java.util.Date; import java.util.Locale; @@ -64,6 +66,10 @@ public class Credentials { static boolean alreadyLoaded = false; private static boolean alreadyTried = false; + public static final boolean S4U2PROXY_ACCEPT_NON_FORWARDABLE + = "true".equalsIgnoreCase(SecurityProperties.privilegedGetOverridable( + "jdk.security.krb5.s4u2proxy.acceptNonForwardableServiceTicket")); + private Credentials proxy = null; public Credentials getProxy() { @@ -97,7 +103,7 @@ public class Credentials { this.authzData = authzData; } - // Warning: called by NativeCreds.c and nativeccache.c + // Warning: also called by NativeCreds.c and nativeccache.c public Credentials(Ticket new_ticket, PrincipalName new_client, PrincipalName new_client_alias, @@ -478,7 +484,7 @@ public class Credentials { * * @param service the name of service principal using format * components@realm - * @param ccreds client's initial credential. + * @param initCreds client's initial credential. * @exception IOException if an error occurs in reading the credentials * cache * @exception KrbException if an error occurs specific to Kerberos @@ -486,21 +492,21 @@ public class Credentials { */ public static Credentials acquireServiceCreds(String service, - Credentials ccreds) + Credentials initCreds) throws KrbException, IOException { - return CredentialsUtil.acquireServiceCreds(service, ccreds); + return CredentialsUtil.acquireServiceCreds(service, initCreds); } public static Credentials acquireS4U2selfCreds(PrincipalName user, - Credentials ccreds) throws KrbException, IOException { - return CredentialsUtil.acquireS4U2selfCreds(user, ccreds); + Credentials middleTGT) throws KrbException, IOException { + return CredentialsUtil.acquireS4U2selfCreds(user, middleTGT); } public static Credentials acquireS4U2proxyCreds(String service, - Ticket second, PrincipalName client, Credentials ccreds) + Credentials userCreds, PrincipalName client, Credentials middleTGT) throws KrbException, IOException { return CredentialsUtil.acquireS4U2proxyCreds( - service, second, client, ccreds); + service, userCreds, client, middleTGT); } /* diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/KdcComm.java b/src/java.security.jgss/share/classes/sun/security/krb5/KdcComm.java index 25af49ea451..5790b06170b 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/KdcComm.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/KdcComm.java @@ -188,21 +188,22 @@ public final class KdcComm { this.realm = realm; } - public byte[] send(byte[] obuf) + public byte[] send(KrbKdcReq req) throws IOException, KrbException { int udpPrefLimit = getRealmSpecificValue( realm, "udp_preference_limit", defaultUdpPrefLimit); + byte[] obuf = req.encoding(); boolean useTCP = (udpPrefLimit > 0 && (obuf != null && obuf.length > udpPrefLimit)); - return send(obuf, useTCP); + return send(req, useTCP); } - private byte[] send(byte[] obuf, boolean useTCP) + private byte[] send(KrbKdcReq req, boolean useTCP) throws IOException, KrbException { - if (obuf == null) + if (req == null) return null; Config cfg = Config.getInstance(); @@ -225,12 +226,12 @@ public final class KdcComm { } byte[] ibuf = null; try { - ibuf = sendIfPossible(obuf, tempKdc.next(), useTCP); + ibuf = sendIfPossible(req, tempKdc.next(), useTCP); } catch(Exception first) { boolean ok = false; while(tempKdc.hasNext()) { try { - ibuf = sendIfPossible(obuf, tempKdc.next(), useTCP); + ibuf = sendIfPossible(req, tempKdc.next(), useTCP); ok = true; break; } catch(Exception ignore) {} @@ -243,13 +244,13 @@ public final class KdcComm { return ibuf; } - // send the AS Request to the specified KDC + // send the KDC Request to the specified KDC // failover to using TCP if useTCP is not set and response is too big - private byte[] sendIfPossible(byte[] obuf, String tempKdc, boolean useTCP) + private byte[] sendIfPossible(KrbKdcReq req, String tempKdc, boolean useTCP) throws IOException, KrbException { try { - byte[] ibuf = send(obuf, tempKdc, useTCP); + byte[] ibuf = send(req, tempKdc, useTCP); KRBError ke = null; try { ke = new KRBError(ibuf); @@ -259,10 +260,17 @@ public final class KdcComm { if (ke != null) { if (ke.getErrorCode() == Krb5.KRB_ERR_RESPONSE_TOO_BIG) { - ibuf = send(obuf, tempKdc, true); + ibuf = send(req, tempKdc, true); } else if (ke.getErrorCode() == Krb5.KDC_ERR_SVC_UNAVAILABLE) { throw new KrbException("A service is not available"); + } else if (ke.getErrorCode() == Krb5.KDC_ERR_BADOPTION + && Credentials.S4U2PROXY_ACCEPT_NON_FORWARDABLE + && req instanceof KrbTgsReq tgsReq) { + Credentials extra = tgsReq.getAdditionalCreds(); + if (extra != null && !extra.isForwardable()) { + throw new KrbException("S4U2Proxy with non-forwardable ticket"); + } } } KdcAccessibility.removeBad(tempKdc); @@ -278,12 +286,12 @@ public final class KdcComm { } } - // send the AS Request to the specified KDC + // send the KDC Request to the specified KDC - private byte[] send(byte[] obuf, String tempKdc, boolean useTCP) + private byte[] send(KrbKdcReq req, String tempKdc, boolean useTCP) throws IOException, KrbException { - if (obuf == null) + if (req == null) return null; int port = Krb5.KDC_INET_DEFAULT_PORT; @@ -336,6 +344,7 @@ public final class KdcComm { port = tempPort; } + byte[] obuf = req.encoding(); if (DEBUG) { System.out.println(">>> KrbKdcReq send: kdc=" + kdc + (useTCP ? " TCP:":" UDP:") diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReq.java b/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReq.java index 19e3ef61076..580beddf21b 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReq.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReq.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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,7 +42,7 @@ import java.util.Arrays; * This class encapsulates the KRB-AS-REQ message that the client * sends to the KDC. */ -public class KrbAsReq { +public class KrbAsReq extends KrbKdcReq { private ASReq asReqMessg; private boolean DEBUG = Krb5.DEBUG; @@ -165,10 +165,7 @@ public class KrbAsReq { asReqMessg = new ASReq( paData, kdc_req_body); - } - - byte[] encoding() throws IOException, Asn1Exception { - return asReqMessg.asn1Encode(); + obuf = asReqMessg.asn1Encode(); } // Used by KrbAsRep to validate AS-REP diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReqBuilder.java b/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReqBuilder.java index bdd70d64911..177f714d1ea 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReqBuilder.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/KrbAsReqBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, 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 @@ -342,7 +342,7 @@ public final class KrbAsReqBuilder { } try { req = build(pakey, referralsState); - rep = new KrbAsRep(comm.send(req.encoding())); + rep = new KrbAsRep(comm.send(req)); return this; } catch (KrbException ke) { if (!preAuthFailedOnce && ( diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/KrbKdcReq.java b/src/java.security.jgss/share/classes/sun/security/krb5/KrbKdcReq.java new file mode 100644 index 00000000000..e64cc977b46 --- /dev/null +++ b/src/java.security.jgss/share/classes/sun/security/krb5/KrbKdcReq.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.security.krb5; + +/** + * Parent class for KrbAsReq and KrbTgsReq. + */ +abstract class KrbKdcReq { + + protected byte[] obuf; + + public byte[] encoding() { + return obuf; + } +} diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsRep.java b/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsRep.java index 356bfe110f7..c9eb9eaf21f 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsRep.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsRep.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -43,7 +43,7 @@ import java.io.IOException; public class KrbTgsRep extends KrbKdcRep { private TGSRep rep; private Credentials creds; - private Ticket secondTicket; + private Credentials additionalCreds; KrbTgsRep(byte[] ibuf, KrbTgsReq tgsReq) throws KrbException, IOException { @@ -115,7 +115,7 @@ public class KrbTgsRep extends KrbKdcRep { enc_part.caddr ); this.rep = rep; - this.secondTicket = tgsReq.getSecondTicket(); + this.additionalCreds = tgsReq.getAdditionalCreds(); } /** @@ -126,7 +126,8 @@ public class KrbTgsRep extends KrbKdcRep { } sun.security.krb5.internal.ccache.Credentials setCredentials() { - return new sun.security.krb5.internal.ccache.Credentials(rep, secondTicket); + return new sun.security.krb5.internal.ccache.Credentials( + rep, additionalCreds == null ? null : additionalCreds.ticket); } private static boolean isReferralSname(PrincipalName sname) { diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java b/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java index cedd612d2c9..8c2b7068111 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java @@ -42,7 +42,7 @@ import java.util.Arrays; * This class encapsulates a Kerberos TGS-REQ that is sent from the * client to the KDC. */ -public class KrbTgsReq { +public class KrbTgsReq extends KrbKdcReq { private PrincipalName princName; private PrincipalName clientAlias; @@ -50,34 +50,31 @@ public class KrbTgsReq { private PrincipalName serverAlias; private TGSReq tgsReqMessg; private KerberosTime ctime; - private Ticket secondTicket = null; + private Credentials additionalCreds = null; private boolean useSubkey = false; EncryptionKey tgsReqKey; - private byte[] obuf; - private byte[] ibuf; - // Used in CredentialsUtil public KrbTgsReq(KDCOptions options, Credentials asCreds, PrincipalName cname, PrincipalName clientAlias, PrincipalName sname, PrincipalName serverAlias, - Ticket[] additionalTickets, PAData[] extraPAs) - throws KrbException, IOException { + Credentials additionalCreds, PAData[] extraPAs) + throws KrbException, IOException { this(options, - asCreds, - cname, - clientAlias, - sname, - serverAlias, - null, // KerberosTime from - null, // KerberosTime till - null, // KerberosTime rtime - null, // int[] eTypes - null, // HostAddresses addresses - null, // AuthorizationData authorizationData - additionalTickets, - null, // EncryptionKey subKey - extraPAs); + asCreds, + cname, + clientAlias, + sname, + serverAlias, + null, // KerberosTime from + null, // KerberosTime till + null, // KerberosTime rtime + null, // int[] eTypes + null, // HostAddresses addresses + null, // AuthorizationData authorizationData + additionalCreds, + null, // EncryptionKey subKey + extraPAs); } // Called by Credentials, KrbCred @@ -92,11 +89,11 @@ public class KrbTgsReq { int[] eTypes, HostAddresses addresses, AuthorizationData authorizationData, - Ticket[] additionalTickets, + Credentials additionalCreds, EncryptionKey subKey) throws KrbException, IOException { this(options, asCreds, asCreds.getClient(), asCreds.getClientAlias(), sname, serverAlias, from, till, rtime, eTypes, - addresses, authorizationData, additionalTickets, subKey, null); + addresses, authorizationData, additionalCreds, subKey, null); } private KrbTgsReq( @@ -112,7 +109,7 @@ public class KrbTgsReq { int[] eTypes, HostAddresses addresses, AuthorizationData authorizationData, - Ticket[] additionalTickets, + Credentials additionalCreds, EncryptionKey subKey, PAData[] extraPAs) throws KrbException, IOException { @@ -154,24 +151,24 @@ public class KrbTgsReq { if (!(asCreds.flags.get(KDCOptions.POSTDATED))) throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS); } else { - if (from != null) from = null; + if (from != null) from = null; } if (options.get(KDCOptions.RENEWABLE)) { if (!(asCreds.flags.get(KDCOptions.RENEWABLE))) throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS); } else { - if (rtime != null) rtime = null; + if (rtime != null) rtime = null; } if (options.get(KDCOptions.ENC_TKT_IN_SKEY) || options.get(KDCOptions.CNAME_IN_ADDL_TKT)) { - if (additionalTickets == null) + if (additionalCreds == null) throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS); // in TGS_REQ there could be more than one additional // tickets, but in file-based credential cache, // there is only one additional ticket field. - secondTicket = additionalTickets[0]; + this.additionalCreds = additionalCreds; } else { - if (additionalTickets != null) - additionalTickets = null; + if (additionalCreds != null) + additionalCreds = null; } tgsReqMessg = createRequest( @@ -187,7 +184,7 @@ public class KrbTgsReq { eTypes, addresses, authorizationData, - additionalTickets, + additionalCreds, subKey, extraPAs); obuf = tgsReqMessg.asn1Encode(); @@ -206,34 +203,16 @@ public class KrbTgsReq { } - /** - * Sends a TGS request to the realm of the target. - * @throws KrbException - * @throws IOException - */ - public void send() throws IOException, KrbException { - String realmStr = null; - if (servName != null) - realmStr = servName.getRealmString(); - KdcComm comm = new KdcComm(realmStr); - ibuf = comm.send(obuf); - } - - public KrbTgsRep getReply() - throws KrbException, IOException { - return new KrbTgsRep(ibuf, this); - } - /** * Sends the request, waits for a reply, and returns the Credentials. * Used in Credentials, KrbCred, and internal/CredentialsUtil. */ public Credentials sendAndGetCreds() throws IOException, KrbException { - KrbTgsRep tgs_rep = null; - String kdc = null; - send(); - tgs_rep = getReply(); - return tgs_rep.getCreds(); + String realmStr = servName != null + ? servName.getRealmString() + : null; + KdcComm comm = new KdcComm(realmStr); + return new KrbTgsRep(comm.send(this), this).getCreds(); } KerberosTime getCtime() { @@ -253,7 +232,7 @@ public class KrbTgsReq { int[] eTypes, HostAddresses addresses, AuthorizationData authorizationData, - Ticket[] additionalTickets, + Credentials additionalCreds, EncryptionKey subKey, PAData[] extraPAs) throws IOException, KrbException, UnknownHostException { @@ -302,6 +281,8 @@ public class KrbTgsReq { KeyUsage.KU_TGS_REQ_AUTH_DATA_SESSKEY); } + Ticket[] additionalTickets = additionalCreds == null ? null + : new Ticket[] { additionalCreds.getTicket() }; KDCReqBody reqBody = new KDCReqBody( kdc_options, cname, @@ -347,8 +328,8 @@ public class KrbTgsReq { return tgsReqMessg; } - Ticket getSecondTicket() { - return secondTicket; + Credentials getAdditionalCreds() { + return additionalCreds; } PrincipalName getClientAlias() { diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java index 1f5f033c58b..223810f67b5 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java @@ -32,7 +32,6 @@ package sun.security.krb5.internal; import sun.security.krb5.*; -import sun.security.util.DerValue; import java.io.IOException; import java.util.LinkedList; @@ -55,17 +54,14 @@ public class CredentialsUtil { * Used by a middle server to acquire credentials on behalf of a * user to itself using the S4U2self extension. * @param user the user to impersonate - * @param ccreds the TGT of the middle service + * @param middleTGT the TGT of the middle service * @return the new creds (cname=user, sname=middle) */ public static Credentials acquireS4U2selfCreds(PrincipalName user, - Credentials ccreds) throws KrbException, IOException { - if (!ccreds.isForwardable()) { - throw new KrbException("S4U2self needs a FORWARDABLE ticket"); - } - PrincipalName sname = ccreds.getClient(); + Credentials middleTGT) throws KrbException, IOException { + PrincipalName sname = middleTGT.getClient(); String uRealm = user.getRealmString(); - String localRealm = ccreds.getClient().getRealmString(); + String localRealm = sname.getRealmString(); if (!uRealm.equals(localRealm)) { // Referrals will be required because the middle service // and the user impersonated are on different realms. @@ -73,25 +69,25 @@ public class CredentialsUtil { throw new KrbException("Cross-realm S4U2Self request not" + " possible when referrals are disabled."); } - if (ccreds.getClientAlias() != null) { + if (middleTGT.getClientAlias() != null) { // If the name was canonicalized, the user pick // has preference. This gives the possibility of // using FQDNs that KDCs may use to return referrals. // I.e.: a SVC/host.realm-2.com@REALM-1.COM name // may be used by REALM-1.COM KDC to return a // referral to REALM-2.COM. - sname = ccreds.getClientAlias(); + sname = middleTGT.getClientAlias(); } sname = new PrincipalName(sname.getNameType(), sname.getNameStrings(), new Realm(uRealm)); } Credentials creds = serviceCreds( KDCOptions.with(KDCOptions.FORWARDABLE), - ccreds, ccreds.getClient(), sname, user, + middleTGT, middleTGT.getClient(), sname, user, null, new PAData[] { new PAData(Krb5.PA_FOR_USER, new PAForUserEnc(user, - ccreds.getSessionKey()).asn1Encode()), + middleTGT.getSessionKey()).asn1Encode()), new PAData(Krb5.PA_PAC_OPTIONS, new PaPacOptions() .setResourceBasedConstrainedDelegation(true) @@ -101,7 +97,7 @@ public class CredentialsUtil { if (!creds.getClient().equals(user)) { throw new KrbException("S4U2self request not honored by KDC"); } - if (!creds.isForwardable()) { + if (!creds.isForwardable() && !Credentials.S4U2PROXY_ACCEPT_NON_FORWARDABLE) { throw new KrbException("S4U2self ticket must be FORWARDABLE"); } return creds; @@ -111,17 +107,17 @@ public class CredentialsUtil { * Used by a middle server to acquire a service ticket to a backend * server using the S4U2proxy extension. * @param backend the name of the backend service - * @param second the client's service ticket to the middle server - * @param ccreds the TGT of the middle server - * @return the creds (cname=client, sname=backend) + * @param userCreds containing the user's service ticket to the middle server + * @param middleTGT the TGT of the middle server + * @return the creds (cname=user, sname=backend) */ public static Credentials acquireS4U2proxyCreds( - String backend, Ticket second, - PrincipalName client, Credentials ccreds) + String backend, Credentials userCreds, + PrincipalName client, Credentials middleTGT) throws KrbException, IOException { PrincipalName backendPrincipal = new PrincipalName(backend); String backendRealm = backendPrincipal.getRealmString(); - String localRealm = ccreds.getClient().getRealmString(); + String localRealm = middleTGT.getClient().getRealmString(); if (!backendRealm.equals(localRealm)) { // The middle service and the backend service are on // different realms, so referrals will be required. @@ -136,8 +132,8 @@ public class CredentialsUtil { } Credentials creds = serviceCreds(KDCOptions.with( KDCOptions.CNAME_IN_ADDL_TKT, KDCOptions.FORWARDABLE), - ccreds, ccreds.getClient(), backendPrincipal, null, - new Ticket[] {second}, new PAData[] { + middleTGT, middleTGT.getClient(), backendPrincipal, null, + userCreds, new PAData[] { new PAData(Krb5.PA_PAC_OPTIONS, new PaPacOptions() .setResourceBasedConstrainedDelegation(true) @@ -159,28 +155,30 @@ public class CredentialsUtil { * from the foreign KDC. * * @param service the name of service principal - * @param ccreds client's initial credential + * @param initCreds client's initial credential */ public static Credentials acquireServiceCreds( - String service, Credentials ccreds) + String service, Credentials initCreds) throws KrbException, IOException { - PrincipalName sname = new PrincipalName(service, - PrincipalName.KRB_NT_UNKNOWN); - return serviceCreds(sname, ccreds); + return serviceCreds(new KDCOptions(), initCreds, + initCreds.getClient(), + new PrincipalName(service, PrincipalName.KRB_NT_UNKNOWN), + null, null, + null, S4U2Type.NONE); } /** * Gets a TGT to another realm * @param localRealm this realm * @param serviceRealm the other realm, cannot equals to localRealm - * @param ccreds TGT in this realm + * @param localTGT TGT in this realm * @param okAsDelegate an [out] argument to receive the okAsDelegate * property. True only if all realms allow delegation. * @return the TGT for the other realm, null if cannot find a path * @throws KrbException if something goes wrong */ private static Credentials getTGTforRealm(String localRealm, - String serviceRealm, Credentials ccreds, boolean[] okAsDelegate) + String serviceRealm, Credentials localTGT, boolean[] okAsDelegate) throws KrbException { // Get a list of realms to traverse @@ -192,7 +190,7 @@ public class CredentialsUtil { String newTgtRealm = null; okAsDelegate[0] = true; - for (cTgt = ccreds, i = 0; i < realms.length;) { + for (cTgt = localTGT, i = 0; i < realms.length;) { tempService = PrincipalName.tgsService(serviceRealm, realms[i]); if (DEBUG) { @@ -309,10 +307,10 @@ public class CredentialsUtil { * This method does the real job to request the service credential. */ private static Credentials serviceCreds( - PrincipalName service, Credentials ccreds) + PrincipalName service, Credentials initCreds) throws KrbException, IOException { - return serviceCreds(new KDCOptions(), ccreds, - ccreds.getClient(), service, null, null, + return serviceCreds(new KDCOptions(), initCreds, + initCreds.getClient(), service, null, null, null, S4U2Type.NONE); } @@ -325,13 +323,13 @@ public class CredentialsUtil { private static Credentials serviceCreds( KDCOptions options, Credentials asCreds, PrincipalName cname, PrincipalName sname, - PrincipalName user, Ticket[] additionalTickets, + PrincipalName user, Credentials additionalCreds, PAData[] extraPAs, S4U2Type s4u2Type) throws KrbException, IOException { if (!Config.DISABLE_REFERRALS) { try { return serviceCredsReferrals(options, asCreds, cname, sname, - s4u2Type, user, additionalTickets, extraPAs); + s4u2Type, user, additionalCreds, extraPAs); } catch (KrbException e) { // Server may raise an error if CANONICALIZE is true. // Try CANONICALIZE false. @@ -339,7 +337,7 @@ public class CredentialsUtil { } return serviceCredsSingle(options, asCreds, cname, asCreds.getClientAlias(), sname, sname, s4u2Type, - user, additionalTickets, extraPAs); + user, additionalCreds, extraPAs); } /* @@ -350,7 +348,7 @@ public class CredentialsUtil { KDCOptions options, Credentials asCreds, PrincipalName cname, PrincipalName sname, S4U2Type s4u2Type, PrincipalName user, - Ticket[] additionalTickets, PAData[] extraPAs) + Credentials additionalCreds, PAData[] extraPAs) throws KrbException, IOException { options = new KDCOptions(options.toBooleanArray()); options.set(KDCOptions.CANONICALIZE, true); @@ -363,12 +361,12 @@ public class CredentialsUtil { while (referrals.size() <= Config.MAX_REFERRALS) { ReferralsCache.ReferralCacheEntry ref = ReferralsCache.get(cname, sname, user, - additionalTickets, refSname.getRealmString()); + additionalCreds, refSname.getRealmString()); String toRealm = null; if (ref == null) { creds = serviceCredsSingle(options, asCreds, cname, clientAlias, refSname, cSname, s4u2Type, - user, additionalTickets, extraPAs); + user, additionalCreds, extraPAs); PrincipalName server = creds.getServer(); if (!refSname.equals(server)) { String[] serverNameStrings = server.getNameStrings(); @@ -380,7 +378,7 @@ public class CredentialsUtil { // Server Name (sname) has the following format: // krbtgt/TO-REALM.COM@FROM-REALM.COM ReferralsCache.put(cname, sname, user, - additionalTickets, server.getRealmString(), + additionalCreds, server.getRealmString(), serverNameStrings[1], creds); toRealm = serverNameStrings[1]; isReferral = true; @@ -398,13 +396,11 @@ public class CredentialsUtil { toRealm = handleS4U2ProxyReferral(asCreds, credsInOut, sname); creds = credsInOut[0]; - if (additionalTickets == null || - additionalTickets.length == 0 || - credsInOut[1] == null) { + if (additionalCreds == null || credsInOut[1] == null) { throw new KrbException("Additional tickets expected" + " for S4U2Proxy."); } - additionalTickets[0] = credsInOut[1].getTicket(); + additionalCreds = credsInOut[1]; } else if (s4u2Type == S4U2Type.SELF) { handleS4U2SelfReferral(extraPAs, user, creds); } @@ -436,7 +432,7 @@ public class CredentialsUtil { PrincipalName cname, PrincipalName clientAlias, PrincipalName refSname, PrincipalName sname, S4U2Type s4u2Type, PrincipalName user, - Ticket[] additionalTickets, PAData[] extraPAs) + Credentials additionalCreds, PAData[] extraPAs) throws KrbException, IOException { Credentials theCreds = null; boolean[] okAsDelegate = new boolean[]{true}; @@ -473,7 +469,7 @@ public class CredentialsUtil { " same realm"); } KrbTgsReq req = new KrbTgsReq(options, asCreds, cname, clientAlias, - refSname, sname, additionalTickets, extraPAs); + refSname, sname, additionalCreds, extraPAs); theCreds = req.sendAndGetCreds(); if (theCreds != null) { if (DEBUG) { diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReq.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReq.java index 39e226a8de2..fd37366d7b0 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReq.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReq.java @@ -31,7 +31,6 @@ package sun.security.krb5.internal; import sun.security.krb5.*; -import java.util.Vector; import sun.security.util.*; import java.io.IOException; import java.math.BigInteger; @@ -192,8 +191,4 @@ public class KDCReq { true, (byte) msgType), bytes); return out.toByteArray(); } - - public byte[] asn1EncodeReqBody() throws Asn1Exception, IOException { - return reqBody.asn1Encode(msgType); - } } diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/ReferralsCache.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/ReferralsCache.java index c8f7414877b..fa68fc42b2e 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/ReferralsCache.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/ReferralsCache.java @@ -112,10 +112,10 @@ final class ReferralsCache { * REALM-1.COM -> REALM-2.COM referral entry is removed from the cache. */ static synchronized void put(PrincipalName cname, PrincipalName service, - PrincipalName user, Ticket[] userSvcTickets, String fromRealm, + PrincipalName user, Credentials additionalCreds, String fromRealm, String toRealm, Credentials creds) { - Ticket userSvcTicket = (userSvcTickets != null ? - userSvcTickets[0] : null); + Ticket userSvcTicket = (additionalCreds != null ? + additionalCreds.getTicket() : null); ReferralCacheKey k = new ReferralCacheKey(cname, service, user, userSvcTicket); pruneExpired(k); @@ -152,9 +152,9 @@ final class ReferralsCache { */ static synchronized ReferralCacheEntry get(PrincipalName cname, PrincipalName service, PrincipalName user, - Ticket[] userSvcTickets, String fromRealm) { - Ticket userSvcTicket = (userSvcTickets != null ? - userSvcTickets[0] : null); + Credentials additionalCreds, String fromRealm) { + Ticket userSvcTicket = (additionalCreds != null ? + additionalCreds.getTicket() : null); ReferralCacheKey k = new ReferralCacheKey(cname, service, user, userSvcTicket); pruneExpired(k); diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Ticket.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Ticket.java index e4253d9bcf1..b9268ce2b6c 100644 --- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Ticket.java +++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Ticket.java @@ -85,12 +85,12 @@ public class Ticket implements Cloneable { // Warning: called by NativeCreds.c and nativeccache.c public Ticket(byte[] data) throws Asn1Exception, - RealmException, KrbApErrException, IOException { + RealmException, KrbApErrException, IOException { init(new DerValue(data)); } public Ticket(DerValue encoding) throws Asn1Exception, - RealmException, KrbApErrException, IOException { + RealmException, KrbApErrException, IOException { init(encoding); } diff --git a/test/jdk/sun/security/krb5/auto/KDC.java b/test/jdk/sun/security/krb5/auto/KDC.java index aeab113995f..6e4bfba61f4 100644 --- a/test/jdk/sun/security/krb5/auto/KDC.java +++ b/test/jdk/sun/security/krb5/auto/KDC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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,8 +29,11 @@ import java.lang.reflect.InvocationTargetException; import java.net.*; import java.io.*; import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.*; import java.util.concurrent.*; import java.util.stream.Collectors; @@ -249,6 +252,14 @@ public class KDC { * If true, will check if TGS-REQ contains a non-null addresses field. */ CHECK_ADDRESSES, + /** + * If true, S4U2self ticket is not set forwardable. + */ + S4U2SELF_NOT_FORWARDABLE, + /** + * If true, allow S4U2self ticket not forwardable. + */ + S4U2SELF_ALLOW_NOT_FORWARDABLE, }; /** @@ -441,12 +452,12 @@ public class KDC { } /** - * Adds a new principal to this realm with a random password + * Adds a new principal to this realm with a generated password * @param user the principal's name. For a service principal, use the * form of host/f.q.d.n */ public void addPrincipalRandKey(String user) { - addPrincipal(user, randomPassword()); + addPrincipal(user, randomPassword(user + "@" + realm)); } /** @@ -607,14 +618,29 @@ public class KDC { startServer(port, asDaemon); } /** - * Generates a 32-char random password + * Generates a 32-char password + * @param user the string to generate from, random is null * @return the password */ - private static char[] randomPassword() { - char[] pass = new char[32]; - Random r = new Random(); - for (int i=0; i<31; i++) - pass[i] = (char)('a' + r.nextInt(26)); + private static char[] randomPassword(String user) { + char[] pass; + if (user == null) { + pass = new char[32]; + Random r = new Random(); + for (int i = 0; i < 31; i++) { + pass[i] = (char) ('a' + r.nextInt(26)); + } + } else { + try { + pass = Base64.getEncoder().encodeToString( + MessageDigest.getInstance("SHA-256").digest((user) + .getBytes(StandardCharsets.UTF_8))) + .substring(0, 32) + .toCharArray(); + } catch (NoSuchAlgorithmException e) { + throw new AssertionError(e); + } + } // The last char cannot be a number, otherwise, keyForUser() // believes it's a sign of kvno pass[31] = 'Z'; @@ -629,7 +655,7 @@ public class KDC { */ private static EncryptionKey generateRandomKey(int eType) throws KrbException { - return genKey0(randomPassword(), "NOTHING", null, eType, null); + return genKey0(randomPassword(null), "NOTHING", null, eType, null); } /** @@ -790,7 +816,7 @@ public class KDC { service.getNameStrings(), service.getRealm()); } try { - System.out.println(realm + "> " + tgsReq.reqBody.cname + + log(tgsReq.reqBody.cname + " sends TGS-REQ for " + service + ", " + tgsReq.reqBody.kdcOptions); KDCReqBody body = tgsReq.reqBody; @@ -810,7 +836,7 @@ public class KDC { boolean allowForwardable = true; boolean isReferral = false; if (body.kdcOptions.get(KDCOptions.CANONICALIZE)) { - System.out.println(realm + "> verifying referral for " + + log("verifying referral for " + body.sname.getNameString()); KDC referral = aliasReferrals.get(body.sname.getNameString()); if (referral != null) { @@ -819,7 +845,7 @@ public class KDC { PrincipalName.NAME_COMPONENT_SEPARATOR_STR + referral.getRealm(), PrincipalName.KRB_NT_SRV_INST, this.getRealm()); - System.out.println(realm + "> referral to " + + log("referral to " + referral.getRealm()); isReferral = true; } @@ -842,14 +868,14 @@ public class KDC { // Finally, cname will be overwritten by PA-FOR-USER // if it exists. cname = etp.cname; - System.out.println(realm + "> presenting a ticket of " + log("presenting a ticket of " + etp.cname + " to " + tkt.sname); } else if (pa.getType() == Krb5.PA_FOR_USER) { if (options.containsKey(Option.ALLOW_S4U2SELF)) { PAForUserEnc p4u = new PAForUserEnc( new DerValue(pa.getValue()), null); forUserCName = p4u.name; - System.out.println(realm + "> See PA_FOR_USER " + log("See PA_FOR_USER " + " in the name of " + p4u.name); } } @@ -862,6 +888,9 @@ public class KDC { // allowed to send S4U2self, do not send an error. // Instead, send a ticket which is useless later. allowForwardable = false; + } else if (options.get(Option.S4U2SELF_NOT_FORWARDABLE) == Boolean.TRUE) { + // Requsted not forwardable + allowForwardable = false; } cname = forUserCName; } @@ -936,15 +965,16 @@ public class KDC { DerInputStream derIn = new DerInputStream(bb); DerValue der = derIn.getDerValue(); EncTicketPart tktEncPart = new EncTicketPart(der.toByteArray()); - if (!tktEncPart.flags.get(Krb5.TKT_OPTS_FORWARDABLE)) { - //throw new KrbException(Krb5.KDC_ERR_BADOPTION); + if (!tktEncPart.flags.get(Krb5.TKT_OPTS_FORWARDABLE) + && options.get(Option.S4U2SELF_ALLOW_NOT_FORWARDABLE) != Boolean.TRUE) { + throw new KrbException(Krb5.KDC_ERR_BADOPTION); } PrincipalName client = tktEncPart.cname; - System.out.println(realm + "> and an additional ticket of " + log("and an additional ticket of " + client + " to " + second.sname); if (map.containsKey(cname.toString())) { if (map.get(cname.toString()).contains(service.toString())) { - System.out.println(realm + "> S4U2proxy OK"); + log("S4U2proxy OK"); } else { throw new KrbException(Krb5.KDC_ERR_BADOPTION); } @@ -1066,7 +1096,7 @@ public class KDC { Realm.getDefault()); } try { - System.out.println(realm + "> " + asReq.reqBody.cname + + log(asReq.reqBody.cname + " sends AS-REQ for " + service + ", " + asReq.reqBody.kdcOptions); @@ -1601,6 +1631,10 @@ public class KDC { return udpConsumerReady && tcpConsumerReady && dispatcherReady; } + void log(String s) { + System.out.println(realm + ":" + port + "> " + s); + } + public void terminate() { if (nativeKdc != null) { System.out.println("Killing kdc..."); diff --git a/test/jdk/sun/security/krb5/auto/S4U2selfNotF.java b/test/jdk/sun/security/krb5/auto/S4U2selfNotF.java new file mode 100644 index 00000000000..44cf1dd5edd --- /dev/null +++ b/test/jdk/sun/security/krb5/auto/S4U2selfNotF.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021, 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 8272162 + * @summary S4U2Self ticket without forwardable flag + * @library /test/lib + * @compile -XDignore.symbol.file S4U2selfNotF.java + * @run main jdk.test.lib.FileInstaller TestHosts TestHosts + * @run main/othervm -Djdk.net.hosts.file=TestHosts + * -Djdk.security.krb5.s4u2proxy.acceptNonForwardableServiceTicket=true + * S4U2selfNotF + */ + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; + +import jdk.test.lib.Asserts; +import sun.security.jgss.GSSUtil; +import sun.security.krb5.Config; + +public class S4U2selfNotF { + + public static void main(String[] args) throws Exception { + + // Create 2 KDCs that has almost the same settings + OneKDC[] kdcs = new OneKDC[2]; + boolean[] touched = new boolean[2]; + for (int i = 0; i < 2; i++) { + final int pos = i; + kdcs[i] = new OneKDC(null) { + protected byte[] processTgsReq(byte[] in) throws Exception { + touched[pos] = true; + return super.processTgsReq(in); + } + }; + kdcs[i].setOption(KDC.Option.ALLOW_S4U2SELF, + List.of(OneKDC.USER + "@" + OneKDC.REALM)); + kdcs[i].setOption(KDC.Option.ALLOW_S4U2PROXY, Map.of( + OneKDC.USER + "@" + OneKDC.REALM, + List.of(OneKDC.BACKEND + "@" + OneKDC.REALM))); + } + kdcs[0].writeJAASConf(); + + // except that the 1st issues a non-forwardable S4U2self + // ticket and only the 2nd accepts it + kdcs[0].setOption(KDC.Option.S4U2SELF_NOT_FORWARDABLE, true); + kdcs[1].setOption(KDC.Option.S4U2SELF_ALLOW_NOT_FORWARDABLE, true); + + Files.write(Path.of(OneKDC.KRB5_CONF), String.format(""" + [libdefaults] + default_realm = RABBIT.HOLE + forwardable = true + default_keytab_name = localkdc.ktab + + [realms] + RABBIT.HOLE = { + kdc = kdc.rabbit.hole:%d kdc.rabbit.hole:%d + } + """, kdcs[0].getPort(), kdcs[1].getPort()) + .getBytes(StandardCharsets.UTF_8)); + Config.refresh(); + + Context c = Context.fromJAAS("client"); + c = c.impersonate(OneKDC.USER2); + c.startAsClient(OneKDC.BACKEND, GSSUtil.GSS_KRB5_MECH_OID); + c.take(new byte[0]); + + Asserts.assertTrue(touched[0]); // get S4U2self from 1st one + Asserts.assertTrue(touched[1]); // get S4U2proxy from 2nd one + } +} -- GitLab From 7049c13cf4bf4cdfcd0c8f0fa96bf4c3748ae1e7 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 1 Dec 2021 01:01:57 +0000 Subject: [PATCH 529/890] 8231107: Allow store password to be null when saving a PKCS12 KeyStore Reviewed-by: mullan --- .../share/classes/java/security/KeyStore.java | 4 +- .../classes/java/security/KeyStoreSpi.java | 4 +- .../sun/security/pkcs12/PKCS12KeyStore.java | 40 +++++++------------ .../sun/security/pkcs12/EmptyPassword.java | 39 +++++++++++++++--- 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/src/java.base/share/classes/java/security/KeyStore.java b/src/java.base/share/classes/java/security/KeyStore.java index 2edbe65d26d..0d9fdc9b3c0 100644 --- a/src/java.base/share/classes/java/security/KeyStore.java +++ b/src/java.base/share/classes/java/security/KeyStore.java @@ -1384,7 +1384,9 @@ public class KeyStore { * integrity with the given password. * * @param stream the output stream to which this keystore is written. - * @param password the password to generate the keystore integrity check + * @param password the password to generate the keystore integrity check. + * May be {@code null} if the keystore does not support + * or require an integrity check. * * @throws KeyStoreException if the keystore has not been initialized * (loaded). diff --git a/src/java.base/share/classes/java/security/KeyStoreSpi.java b/src/java.base/share/classes/java/security/KeyStoreSpi.java index 7db1f52042e..3c275dd9e27 100644 --- a/src/java.base/share/classes/java/security/KeyStoreSpi.java +++ b/src/java.base/share/classes/java/security/KeyStoreSpi.java @@ -289,7 +289,9 @@ public abstract class KeyStoreSpi { * integrity with the given password. * * @param stream the output stream to which this keystore is written. - * @param password the password to generate the keystore integrity check + * @param password the password to generate the keystore integrity check. + * May be {@code null} if the keystore does not support + * or require an integrity check. * * @throws IOException if there was an I/O problem with data * @throws NoSuchAlgorithmException if the appropriate data integrity diff --git a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index db79e2fcb63..e52beceb084 100644 --- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -1259,14 +1259,20 @@ public final class PKCS12KeyStore extends KeyStoreSpi { " certificate(s) in a PKCS#7 encryptedData"); } - byte[] encrData = createEncryptedData(password); - if (!certProtectionAlgorithm.equalsIgnoreCase("NONE")) { + byte[] certsData = getCertificateData(); + if (password != null && !certProtectionAlgorithm.equalsIgnoreCase("NONE")) { + // -- SEQUENCE of EncryptedData + DerOutputStream encrData = new DerOutputStream(); + encrData.putInteger(0); + encrData.write(encryptContent(certsData, password)); + DerOutputStream encrDataContent = new DerOutputStream(); + encrDataContent.write(DerValue.tag_Sequence, encrData); ContentInfo encrContentInfo = new ContentInfo(ContentInfo.ENCRYPTED_DATA_OID, - new DerValue(encrData)); + new DerValue(encrDataContent.toByteArray())); encrContentInfo.encode(authSafeContentInfo); } else { - ContentInfo dataContentInfo = new ContentInfo(encrData); + ContentInfo dataContentInfo = new ContentInfo(certsData); dataContentInfo.encode(authSafeContentInfo); } } @@ -1289,7 +1295,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { if (macIterationCount < 0) { macIterationCount = defaultMacIterationCount(); } - if (!macAlgorithm.equalsIgnoreCase("NONE")) { + if (password != null && !macAlgorithm.equalsIgnoreCase("NONE")) { byte[] macData = calculateMac(password, authenticatedSafe); pfx.write(macData); } @@ -1704,12 +1710,11 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } /* - * Create EncryptedData content type, that contains EncryptedContentInfo. - * Includes certificates in individual SafeBags of type CertBag. - * Each CertBag may include pkcs12 attributes + * Create Data content type, includes certificates in individual + * SafeBags of type CertBag. Each CertBag may include pkcs12 attributes * (see comments in getBagAttributes) */ - private byte[] createEncryptedData(char[] password) + private byte[] getCertificateData() throws CertificateException, IOException { DerOutputStream out = new DerOutputStream(); @@ -1803,22 +1808,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { // wrap as SequenceOf SafeBag DerOutputStream safeBagValue = new DerOutputStream(); safeBagValue.write(DerValue.tag_SequenceOf, out); - byte[] safeBagData = safeBagValue.toByteArray(); - - // encrypt the content (EncryptedContentInfo) - if (!certProtectionAlgorithm.equalsIgnoreCase("NONE")) { - byte[] encrContentInfo = encryptContent(safeBagData, password); - - // -- SEQUENCE of EncryptedData - DerOutputStream encrData = new DerOutputStream(); - DerOutputStream encrDataContent = new DerOutputStream(); - encrData.putInteger(0); - encrData.write(encrContentInfo); - encrDataContent.write(DerValue.tag_Sequence, encrData); - return encrDataContent.toByteArray(); - } else { - return safeBagData; - } + return safeBagValue.toByteArray(); } /* diff --git a/test/jdk/sun/security/pkcs12/EmptyPassword.java b/test/jdk/sun/security/pkcs12/EmptyPassword.java index 1f5e7ad457e..5e78003a485 100644 --- a/test/jdk/sun/security/pkcs12/EmptyPassword.java +++ b/test/jdk/sun/security/pkcs12/EmptyPassword.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -23,11 +23,11 @@ /* * @test - * @bug 8202299 + * @bug 8202299 8231107 * @modules java.base/sun.security.tools.keytool * java.base/sun.security.x509 * @library /test/lib - * @summary Java Keystore fails to load PKCS12/PFX certificates created in WindowsServer2016 + * @summary Testing empty (any of null, "", "\0") password behaviors */ import jdk.test.lib.Asserts; @@ -38,6 +38,7 @@ import java.io.File; import java.io.FileOutputStream; import java.security.KeyStore; import java.security.cert.Certificate; +import java.util.Arrays; public class EmptyPassword { @@ -52,13 +53,39 @@ public class EmptyPassword { new Certificate[] { gen.getSelfCertificate(new X500Name("CN=Me"), 100) }); - try (FileOutputStream fos = new FileOutputStream("p12")) { - ks.store(fos, new char[1]); - } + + // 8202299: interop between new char[0] and new char[1] + store(ks, "p12", new char[1]); // It can be loaded with password "". ks = KeyStore.getInstance(new File("p12"), new char[0]); Asserts.assertTrue(ks.getKey("a", new char[0]) != null); Asserts.assertTrue(ks.getCertificate("a") != null); + + ks = KeyStore.getInstance(new File("p12"), new char[1]); + Asserts.assertTrue(ks.getKey("a", new char[1]) != null); + Asserts.assertTrue(ks.getCertificate("a") != null); + + // 8231107: Store with null password makes it password-less + store(ks, "p00", null); + + // Can read cert and key with any password + for (char[] pass: new char[][] { + new char[0], // password actually used before 8202299 + new char[1], // the interoperability before 8202299 + null, // password-less after 8202299 + "whatever".toCharArray() + }) { + System.out.println("with password " + Arrays.toString(pass)); + ks = KeyStore.getInstance(new File("p00"), pass); + Asserts.assertTrue(ks.getKey("a", new char[1]) != null); + Asserts.assertTrue(ks.getCertificate("a") != null); + } + } + + static void store(KeyStore ks, String file, char[] pass) throws Exception { + try (FileOutputStream fos = new FileOutputStream(file)) { + ks.store(fos, pass); + } } } -- GitLab From 0a01baaf2dd31a0fe2bc8b1327fb072cc3909eeb Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Wed, 1 Dec 2021 01:17:07 +0000 Subject: [PATCH 530/890] 8277986: Typo in javadoc of java.util.zip.ZipEntry#setTime Reviewed-by: alanb, iris, lancea --- src/java.base/share/classes/java/util/zip/ZipEntry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/util/zip/ZipEntry.java b/src/java.base/share/classes/java/util/zip/ZipEntry.java index 9ff3533116c..5846d6cc3bb 100644 --- a/src/java.base/share/classes/java/util/zip/ZipEntry.java +++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java @@ -153,7 +153,7 @@ public class ZipEntry implements ZipConstants, Cloneable { * be stored into the {@code date and time fields} of the zip file * entry and encoded in standard {@code MS-DOS date and time format}. * The {@link java.util.TimeZone#getDefault() default TimeZone} is - * used to convert the epoch time to the MS-DOS data and time. + * used to convert the epoch time to the MS-DOS date and time. * * @param time * The last modification time of the entry in milliseconds -- GitLab From da2be99cfe1121d5a59fa575ea0ac425ad4dbd0f Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Wed, 1 Dec 2021 01:25:17 +0000 Subject: [PATCH 531/890] 8277026: Remove blank lines remaining from snippet markup Reviewed-by: jjg --- .../formats/html/TagletWriterImpl.java | 9 +- .../toolkit/taglets/snippet/Parser.java | 4 +- .../toolkit/taglets/snippet/Style.java | 6 +- .../toolkit/taglets/snippet/StyledText.java | 6 +- .../testSnippetTag/TestLangProperties.java | 1 - .../testSnippetTag/TestSnippetMarkup.java | 233 ++++++++++++++++++ .../doclet/testSnippetTag/TestSnippetTag.java | 1 - 7 files changed, 249 insertions(+), 11 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index e2d96f0f693..640786dd4eb 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -401,6 +401,7 @@ public class TagletWriterImpl extends TagletWriter { Element e = null; String t = null; boolean linkEncountered = false; + boolean markupEncountered = false; Set classes = new HashSet<>(); for (Style s : styles) { if (s instanceof Style.Name n) { @@ -414,6 +415,8 @@ public class TagletWriterImpl extends TagletWriter { // TODO: diagnostic output } } else if (s instanceof Style.Markup) { + markupEncountered = true; + break; } else { // TODO: transform this if...else into an exhaustive // switch over the sealed Style hierarchy when "Pattern @@ -423,7 +426,9 @@ public class TagletWriterImpl extends TagletWriter { } } Content c; - if (linkEncountered) { + if (markupEncountered) { + return; + } else if (linkEncountered) { assert e != null; String line = sequence.toString(); String strippedLine = line.strip(); @@ -438,7 +443,7 @@ public class TagletWriterImpl extends TagletWriter { c = new ContentBuilder(whitespace, htmlWriter.linkToContent(element, e, t, strippedLine)); // We don't care about trailing whitespace. } else { - c = HtmlTree.SPAN(Text.of(utils.normalizeNewlines(sequence))); + c = HtmlTree.SPAN(Text.of(text)); classes.forEach(((HtmlTree) c)::addStyle); } code.add(c); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java index fea60c0d956..ccc6ce87799 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java @@ -139,6 +139,7 @@ public final class Parser { String rawLine = next.line(); boolean addLineTerminator = iterator.hasNext() || trailingNewline; String line; + boolean hasMarkup = false; markedUpLine.reset(rawLine); if (!markedUpLine.matches()) { // (1) line = rawLine + (addLineTerminator ? "\n" : ""); @@ -168,6 +169,7 @@ public final class Parser { // TODO: log this with NOTICE; line = rawLine + (addLineTerminator ? "\n" : ""); } else { // (3) + hasMarkup = true; String payload = rawLine.substring(0, markedUpLine.end("payload")); line = payload + (addLineTerminator ? "\n" : ""); } @@ -185,7 +187,7 @@ public final class Parser { thisLineTags.clear(); - append(text, Set.of(), line); + append(text, line.isBlank() && hasMarkup ? Set.of(new Style.Markup()) : Set.of(), line); // TODO: mark up trailing whitespace! lineStart += line.length(); } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java index 854899c794e..f7fd6aab9cb 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Style.java @@ -37,21 +37,21 @@ public sealed interface Style { /** * A style that describes a link. Characters of this style are typically - * processed by wrapping into an HTML {@code A} element pointing to the + * processed by being wrapped into an HTML {@code A} element pointing to the * provided target. */ record Link(String target) implements Style { } /** * A named style. Characters of this style are typically processed by - * wrapping into an HTML {@code SPAN} element with the {@code class} + * being wrapped into an HTML {@code SPAN} element with the {@code class} * attribute which is obtained from the provided name. */ record Name(String name) implements Style { } /** * A marker of belonging to markup. Characters of this style are typically - * processed by omitting from the output. + * processed by being omitted from the output. */ record Markup() implements Style { } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/StyledText.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/StyledText.java index d7e51a4e937..2a64b87acfa 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/StyledText.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/StyledText.java @@ -74,8 +74,8 @@ public class StyledText { } /* - * For each character of this text adds the provided objects to a set of - * objects associated with that character. + * For each character of this text adds the provided styles to a set of + * styles associated with that character. */ public void addStyle(Set additionalStyles) { styles.add(0, length(), additionalStyles); @@ -87,7 +87,7 @@ public class StyledText { /* * Replaces all characters of this text with the provided sequence of - * characters, each of which is associated with all the provided objects. + * characters, each of which is associated with all the provided styles. */ public void replace(Set styles, CharSequence plaintext) { replace(0, length(), styles, plaintext); diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java index 54b0c9c8da3..de8ea1b3490 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestLangProperties.java @@ -62,7 +62,6 @@ public class TestLangProperties extends SnippetTester { tea=black """.formatted(markup), """ - coffee=espresso tea=black """); diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java index 16ec3321290..66d08933bc2 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java @@ -370,6 +370,239 @@ First line // @highlight : testPositive(base, testCases); } + /* + * These are corner cases. As such they are expected to rarely happen in + * practise. These tests merely capture what the results looked when + * the feature was integrated. This might help when refactoring + * and refreshing the feature, to better understand the impact of + * the proposed changes. + */ + @Test + public void testPositiveInlineTagMarkup_ReplaceOnBlankLine(Path base) throws Exception { + var testCases = List.of( + // the complete line is being replaced + new TestCase("one", + """ + // @start region=one @replace regex=".*" replacement="-----" + one + // @end + """, + """ + -----one + """ + ), + // the contents of the line, but not the line terminator is being replaced + new TestCase("two", + """ + // @start region=two @replace regex=".+" replacement="*****" + two + // @end + """, + """ + *****two + """ + ), + new TestCase( + """ + // @replace regex="duke" replacement="duchess" + """, + """ + """ + ) + ); + testPositive(base, testCases); + } + + @Test + public void testPositiveInlineTagMarkup_BlankLinesRegionEquivalence(Path base) throws Exception { + var testCases = List.of( + new TestCase("example1", + """ + // @start region="example1" + if (v.isPresent()) { + System.out.println("v: " + v.get()); + } // @end + """, + """ + if (v.isPresent()) { + System.out.println("v: " + v.get()); + }"""), + new TestCase("example2", + """ + if (v.isPresent()) { // @start region="example2" + System.out.println("v: " + v.get()); + } // @end + """, + """ + if (v.isPresent()) { + System.out.println("v: " + v.get()); + }"""), + new TestCase("example3", + """ + // @start region="example3" : + if (v.isPresent()) { + System.out.println("v: " + v.get()); + // @end : + } + """, + """ + if (v.isPresent()) { + System.out.println("v: " + v.get()); + }""") + ); + testPositive(base, testCases); + } + + @Test + public void testPositiveInlineTagMarkup_BlankLinesEquivalence(Path base) throws Exception { + var testCases = List.of( + new TestCase( + """ + // @start region="example" + if (v.isPresent()) { + System.out.println("v: " + v.get()); + } + // @end + """, + """ + if (v.isPresent()) { + System.out.println("v: " + v.get()); + } + """), + new TestCase( + """ + if (v.isPresent()) { // @start region="example" + System.out.println("v: " + v.get()); + } // @end + """, + """ + if (v.isPresent()) { + System.out.println("v: " + v.get()); + } + """), + new TestCase( + """ + // @start region="example" : + if (v.isPresent()) { + System.out.println("v: " + v.get()); + // @end : + } + """, + """ + if (v.isPresent()) { + System.out.println("v: " + v.get()); + } + """) + ); + testPositive(base, testCases); + } + + @Test + public void testPositiveInlineTagMarkup_BlankLinesFromStartEnd(Path base) throws Exception { + // A markup line that contains either @start or @end is removed. + var testCases = List.of( + new TestCase(""" + First line + // @start region="a" + Third line + // @end + Fifth line + """, + """ + First line + Third line + Fifth line + """), + new TestCase(""" + First line + // @start region="a" + // @start region="b" + Third line + // @end + Fifth line + // @end + """, + """ + First line + Third line + Fifth line + """), + // note incidental whitespace removal in test cases below + new TestCase("a", """ + First line + // @start region="a" + Third line + // @end + Fifth line + """, + + """ + Third line + """), + new TestCase("b", """ + First line + // @start region="a" + // @start region="b" + Third line + // @end + Fifth line + // @end + """, + """ + Third line + """) + ); + testPositive(base, testCases); + } + + @Test + public void testPositiveInlineTagMarkup_BlankLinesFromNextLineMarkup(Path base) throws Exception { + // A markup line that refers to the next line is removed. + var testCases = List.of( + new TestCase(""" + First line + // @highlight: + Third line + """, + """ + First line + Third line + """), + new TestCase(""" + First line + // @link target="Object#equals(Object)": + Third line + """, + replace(""" + First line + link(Third line) + """, "link\\((.+?)\\)", r -> link(true, "java.lang.Object#equals(Object)", r.group(1))) + ), + new TestCase(""" + First line + // @replace regex=.+ replacement="x": + Third line + """, + """ + First line + x + """), + new TestCase(""" + First line + // @start region=a: + Third line + // @end: + Fifth line + """, + """ + First line + Third line + Fifth line + """) + ); + testPositive(base, testCases); + } + private static String link(boolean linkPlain, String targetReference, String content) diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index 269869ba4b5..07efd52829b 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -278,7 +278,6 @@ public class TestSnippetTag extends SnippetTester { checkExit(Exit.OK); checkLinks(); final var javaContent = """ - System.out.println(msg); """; final var propertiesContent = """ -- GitLab From c73319354399596ab2b9aab0a7f62e8fa0ab9365 Mon Sep 17 00:00:00 2001 From: Masanori Yano Date: Wed, 1 Dec 2021 06:18:44 +0000 Subject: [PATCH 532/890] 8262297: ImageIO.write() method will throw IndexOutOfBoundsException Reviewed-by: serb, jdv --- .../imageio/plugins/bmp/BMPImageWriter.java | 8 +- .../plugins/bmp/BMPBitsPerPixelTest.java | 80 +++++++++++++++++++ 2 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index 6a020ae9343..1773cf9ba98 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -327,7 +327,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { if (!canEncodeImage(compressionType, colorModel, sampleModel)) { throw new IOException("Image can not be encoded with compression type " - + BMPCompressionTypes.getName(compressionType)); + + BMPCompressionTypes.getName(compressionType) + + " and " + colorModel.getPixelSize() + " bits per pixel"); } byte[] r = null, g = null, b = null, a = null; @@ -1456,6 +1457,9 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { } int biType = imgType.getBufferedImageType(); int bpp = imgType.getColorModel().getPixelSize(); + if (bpp != 0 && bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32) { + return false; + } if (compressionType == BI_RLE4 && bpp != 4) { // only 4bpp images can be encoded as BI_RLE4 return false; diff --git a/test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java b/test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java new file mode 100644 index 00000000000..6708eb9f670 --- /dev/null +++ b/test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021, 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 8262297 + * @summary Test that writing invalid bit per pixel image throws IOException + */ + +import java.awt.image.BufferedImage; +import java.awt.image.IndexColorModel; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class BMPBitsPerPixelTest { + + public static void main(String[] args) { + test(1, false); + test(2, true); + test(3, true); + test(4, false); + test(5, true); + test(6, true); + test(7, true); + test(8, false); + } + + public static void test(int bpp, boolean shouldThrowException) { + int palettes = (int)Math.pow(2, bpp); + byte[] r = new byte[palettes]; + byte[] g = new byte[palettes]; + byte[] b = new byte[palettes]; + boolean exceptionThrown = false; + try { + IndexColorModel cm = new IndexColorModel(bpp, palettes, r, g, b); + int imageType = BufferedImage.TYPE_BYTE_BINARY; + if (bpp > 4) { + imageType = BufferedImage.TYPE_BYTE_INDEXED; + } + BufferedImage img = new BufferedImage(10, 10, imageType, (IndexColorModel)cm); + File file = File.createTempFile("test", ".bmp", new File(".")); + file.deleteOnExit(); + ImageIO.write(img, "BMP", file); + } catch (IOException e) { + exceptionThrown = true; + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("Unexpected exception: " + e); + } + + if (shouldThrowException && !exceptionThrown) { + throw new RuntimeException("IOException was not caught."); + } else if (!shouldThrowException && exceptionThrown) { + throw new RuntimeException("IOException should not be thrown."); + } else { + System.out.println("Test PASSED."); + } + } +} -- GitLab From 349328c929ccad242a344da69585404e4fea087f Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Wed, 1 Dec 2021 07:19:44 +0000 Subject: [PATCH 533/890] 8277777: [Vector API] assert(r->is_XMMRegister()) failed: must be in x86_32.ad Reviewed-by: thartmann, jbhateja --- src/hotspot/cpu/x86/x86_32.ad | 41 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index 5f09f565d18..68f6122b201 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -755,6 +755,7 @@ static enum RC rc_class( OptoReg::Name reg ) { assert(UseSSE < 2, "shouldn't be used in SSE2+ mode"); return rc_float; } + if (r->is_KRegister()) return rc_kreg; assert(r->is_XMMRegister(), "must be"); return rc_xmm; } @@ -1249,26 +1250,6 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo return size; } - assert( size > 0, "missed a case" ); - - // -------------------------------------------------------------------- - // Check for second bits still needing moving. - if( src_second == dst_second ) - return size; // Self copy; no move - assert( src_second_rc != rc_bad && dst_second_rc != rc_bad, "src_second & dst_second cannot be Bad" ); - - // Check for second word int-int move - if( src_second_rc == rc_int && dst_second_rc == rc_int ) - return impl_mov_helper(cbuf,do_size,src_second,dst_second,size, st); - - // Check for second word integer store - if( src_second_rc == rc_int && dst_second_rc == rc_stack ) - return impl_helper(cbuf,do_size,false,ra_->reg2offset(dst_second),src_second,0x89,"MOV ",size, st); - - // Check for second word integer load - if( dst_second_rc == rc_int && src_second_rc == rc_stack ) - return impl_helper(cbuf,do_size,true ,ra_->reg2offset(src_second),dst_second,0x8B,"MOV ",size, st); - // AVX-512 opmask specific spilling. if (src_first_rc == rc_stack && dst_first_rc == rc_kreg) { assert((src_first & 1) == 0 && src_first + 1 == src_second, "invalid register pair"); @@ -1306,6 +1287,26 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo return 0; } + assert( size > 0, "missed a case" ); + + // -------------------------------------------------------------------- + // Check for second bits still needing moving. + if( src_second == dst_second ) + return size; // Self copy; no move + assert( src_second_rc != rc_bad && dst_second_rc != rc_bad, "src_second & dst_second cannot be Bad" ); + + // Check for second word int-int move + if( src_second_rc == rc_int && dst_second_rc == rc_int ) + return impl_mov_helper(cbuf,do_size,src_second,dst_second,size, st); + + // Check for second word integer store + if( src_second_rc == rc_int && dst_second_rc == rc_stack ) + return impl_helper(cbuf,do_size,false,ra_->reg2offset(dst_second),src_second,0x89,"MOV ",size, st); + + // Check for second word integer load + if( dst_second_rc == rc_int && src_second_rc == rc_stack ) + return impl_helper(cbuf,do_size,true ,ra_->reg2offset(src_second),dst_second,0x8B,"MOV ",size, st); + Unimplemented(); return 0; // Mute compiler } -- GitLab From 70d5dffb4e7110902b59b56efaef31614916148c Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Wed, 1 Dec 2021 08:24:59 +0000 Subject: [PATCH 534/890] 8275326: C2: assert(no_dead_loop) failed: dead loop detected Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/cfgnode.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index 21526a6246a..64bf4b7f582 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -2272,13 +2272,13 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Phi(...MergeMem(m0, m1:AT1, m2:AT2)...) into // MergeMem(Phi(...m0...), Phi:AT1(...m1...), Phi:AT2(...m2...)) PhaseIterGVN* igvn = phase->is_IterGVN(); + assert(igvn != NULL, "sanity check"); Node* hook = new Node(1); PhiNode* new_base = (PhiNode*) clone(); // Must eagerly register phis, since they participate in loops. - if (igvn) { - igvn->register_new_node_with_optimizer(new_base); - hook->add_req(new_base); - } + igvn->register_new_node_with_optimizer(new_base); + hook->add_req(new_base); + MergeMemNode* result = MergeMemNode::make(new_base); for (uint i = 1; i < req(); ++i) { Node *ii = in(i); @@ -2290,10 +2290,8 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (mms.is_empty()) { Node* new_phi = new_base->slice_memory(mms.adr_type(phase->C)); made_new_phi = true; - if (igvn) { - igvn->register_new_node_with_optimizer(new_phi); - hook->add_req(new_phi); - } + igvn->register_new_node_with_optimizer(new_phi); + hook->add_req(new_phi); mms.set_memory(new_phi); } Node* phi = mms.memory(); @@ -2311,6 +2309,13 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } } + // Already replace this phi node to cut it off from the graph to not interfere in dead loop checks during the + // transformations of the new phi nodes below. Otherwise, we could wrongly conclude that there is no dead loop + // because we are finding this phi node again. Also set the type of the new MergeMem node in case we are also + // visiting it in the transformations below. + igvn->replace_node(this, result); + igvn->set_type(result, result->bottom_type()); + // now transform the new nodes, and return the mergemem for (MergeMemStream mms(result); mms.next_non_empty(); ) { Node* phi = mms.memory(); -- GitLab From fde0b95ede68c188479852c46df7e28dc4b79594 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Wed, 1 Dec 2021 08:44:51 +0000 Subject: [PATCH 535/890] 8277861: Terminally deprecate Thread.stop Reviewed-by: rriggs, mchung, uschindler, dholmes --- src/java.base/share/classes/java/lang/Thread.java | 2 +- src/java.base/share/classes/java/lang/ThreadGroup.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 17580d2aa84..797a7f9f82e 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -922,7 +922,7 @@ public class Thread implements Runnable { * Why * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) public final void stop() { @SuppressWarnings("removal") SecurityManager security = System.getSecurityManager(); diff --git a/src/java.base/share/classes/java/lang/ThreadGroup.java b/src/java.base/share/classes/java/lang/ThreadGroup.java index c6e532a7444..bd55ca1595e 100644 --- a/src/java.base/share/classes/java/lang/ThreadGroup.java +++ b/src/java.base/share/classes/java/lang/ThreadGroup.java @@ -628,6 +628,7 @@ public class ThreadGroup implements Thread.UncaughtExceptionHandler { * {@link Thread#stop} for details. */ @Deprecated(since="1.2", forRemoval=true) + @SuppressWarnings("removal") public final void stop() { if (stopOrSuspend(false)) Thread.currentThread().stop(); -- GitLab From 84aa0a191b085a3d7cb338fd5e67281d0e4b57be Mon Sep 17 00:00:00 2001 From: Jayathirth D V Date: Wed, 1 Dec 2021 10:22:17 +0000 Subject: [PATCH 536/890] 8278047: Few javax/imageio test regressed after JDK-8262297 fix Reviewed-by: tschatzl --- .../imageio/plugins/bmp/BMPImageWriter.java | 8 +- .../plugins/bmp/BMPBitsPerPixelTest.java | 80 ------------------- 2 files changed, 2 insertions(+), 86 deletions(-) delete mode 100644 test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index 1773cf9ba98..6a020ae9343 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -327,8 +327,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { if (!canEncodeImage(compressionType, colorModel, sampleModel)) { throw new IOException("Image can not be encoded with compression type " - + BMPCompressionTypes.getName(compressionType) - + " and " + colorModel.getPixelSize() + " bits per pixel"); + + BMPCompressionTypes.getName(compressionType)); } byte[] r = null, g = null, b = null, a = null; @@ -1457,9 +1456,6 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { } int biType = imgType.getBufferedImageType(); int bpp = imgType.getColorModel().getPixelSize(); - if (bpp != 0 && bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32) { - return false; - } if (compressionType == BI_RLE4 && bpp != 4) { // only 4bpp images can be encoded as BI_RLE4 return false; diff --git a/test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java b/test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java deleted file mode 100644 index 6708eb9f670..00000000000 --- a/test/jdk/javax/imageio/plugins/bmp/BMPBitsPerPixelTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2021, 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 8262297 - * @summary Test that writing invalid bit per pixel image throws IOException - */ - -import java.awt.image.BufferedImage; -import java.awt.image.IndexColorModel; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; - -public class BMPBitsPerPixelTest { - - public static void main(String[] args) { - test(1, false); - test(2, true); - test(3, true); - test(4, false); - test(5, true); - test(6, true); - test(7, true); - test(8, false); - } - - public static void test(int bpp, boolean shouldThrowException) { - int palettes = (int)Math.pow(2, bpp); - byte[] r = new byte[palettes]; - byte[] g = new byte[palettes]; - byte[] b = new byte[palettes]; - boolean exceptionThrown = false; - try { - IndexColorModel cm = new IndexColorModel(bpp, palettes, r, g, b); - int imageType = BufferedImage.TYPE_BYTE_BINARY; - if (bpp > 4) { - imageType = BufferedImage.TYPE_BYTE_INDEXED; - } - BufferedImage img = new BufferedImage(10, 10, imageType, (IndexColorModel)cm); - File file = File.createTempFile("test", ".bmp", new File(".")); - file.deleteOnExit(); - ImageIO.write(img, "BMP", file); - } catch (IOException e) { - exceptionThrown = true; - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Unexpected exception: " + e); - } - - if (shouldThrowException && !exceptionThrown) { - throw new RuntimeException("IOException was not caught."); - } else if (!shouldThrowException && exceptionThrown) { - throw new RuntimeException("IOException should not be thrown."); - } else { - System.out.println("Test PASSED."); - } - } -} -- GitLab From f505396cccdd00a284b516dee1e314d1bf285f9e Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Wed, 1 Dec 2021 10:37:09 +0000 Subject: [PATCH 537/890] 8277459: Add jwebserver tool Reviewed-by: michaelm, dfuchs, ihse --- make/modules/jdk.httpserver/Launcher.gmk | 30 ++ .../sun/net/httpserver/SimpleFileServer.java | 10 +- .../com/sun/net/httpserver/package-info.java | 25 +- .../share/classes/module-info.java | 50 +--- .../httpserver/simpleserver/JWebServer.java | 66 +++++ .../sun/net/httpserver/simpleserver/Main.java | 11 +- .../simpleserver/SimpleFileServerImpl.java | 23 +- .../resources/simpleserver.properties | 16 +- src/jdk.httpserver/share/man/jwebserver.1 | 175 ++++++++++++ .../simpleserver/CommandLineNegativeTest.java | 2 +- .../CommandLinePortNotSpecifiedTest.java | 5 +- .../simpleserver/CommandLinePositiveTest.java | 25 +- .../jwebserver/CommandLineNegativeTest.java | 245 +++++++++++++++++ .../CommandLinePortNotSpecifiedTest.java | 154 +++++++++++ .../jwebserver/CommandLinePositiveTest.java | 257 ++++++++++++++++++ test/jdk/tools/launcher/HelpFlagsTest.java | 1 + test/jdk/tools/launcher/VersionCheck.java | 3 +- 17 files changed, 1028 insertions(+), 70 deletions(-) create mode 100644 make/modules/jdk.httpserver/Launcher.gmk create mode 100644 src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java create mode 100644 src/jdk.httpserver/share/man/jwebserver.1 create mode 100644 test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLineNegativeTest.java create mode 100644 test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePortNotSpecifiedTest.java create mode 100644 test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java diff --git a/make/modules/jdk.httpserver/Launcher.gmk b/make/modules/jdk.httpserver/Launcher.gmk new file mode 100644 index 00000000000..ead28ba1ca5 --- /dev/null +++ b/make/modules/jdk.httpserver/Launcher.gmk @@ -0,0 +1,30 @@ +# +# Copyright (c) 2021, 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. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# 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 LauncherCommon.gmk + +$(eval $(call SetupBuildLauncher, jwebserver, \ + MAIN_CLASS := sun.net.httpserver.simpleserver.JWebServer, \ +)) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java index bd81e8e5eac..3d5c448c687 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java @@ -104,12 +104,12 @@ import sun.net.httpserver.simpleserver.OutputFilter; * server.start(); * } * - *

      Main entry point

      + *

      jwebserver Tool

      * - *

      A simple HTTP file server implementation is - * provided via the - * main entry point - * of the {@code jdk.httpserver} module. + *

      A simple HTTP file server implementation is provided via the + * {@code jwebserver} tool. + * + * @toolGuide jwebserver * * @since 18 */ diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java index ed3978e0eae..3b9de3520fb 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java @@ -31,6 +31,24 @@ Any HTTP functionality not provided by this API can be implemented by application code using the API.

      + * The main components are: + *

        + *
      • the {@link com.sun.net.httpserver.HttpExchange} class that describes a + * request and response pair,
      • + *
      • the {@link com.sun.net.httpserver.HttpHandler} interface to handle + * incoming requests, plus the {@link com.sun.net.httpserver.HttpHandlers} class + * that provides useful handler implementations,
      • + *
      • the {@link com.sun.net.httpserver.HttpContext} class that maps a URI path + * to a {@code HttpHandler},
      • + *
      • the {@link com.sun.net.httpserver.HttpServer} class to listen for + * connections and dispatch requests to handlers,
      • + *
      • the {@link com.sun.net.httpserver.Filter} class that allows pre- and post- + * processing of requests.
      + *

      + * The {@link com.sun.net.httpserver.SimpleFileServer} class offers a simple + * HTTP-only file server (intended for testing, development and debugging purposes + * only). A default implementation is provided via the {@code jwebserver} tool. +

      Programmers must implement the {@link com.sun.net.httpserver.HttpHandler} interface. This interface provides a callback which is invoked to handle incoming requests from clients. A HTTP request and its response is known as an exchange. HTTP exchanges are @@ -120,13 +138,6 @@ } }); -

      - The {@link com.sun.net.httpserver.SimpleFileServer} class offers a simple - HTTP file server (intended for testing, development and debugging purposes - only). A default implementation is provided via the - main entry point - of the {@code jdk.httpserver} module. - @since 1.6 */ package com.sun.net.httpserver; diff --git a/src/jdk.httpserver/share/classes/module-info.java b/src/jdk.httpserver/share/classes/module-info.java index 417854d2ee8..d7ddf8eb303 100644 --- a/src/jdk.httpserver/share/classes/module-info.java +++ b/src/jdk.httpserver/share/classes/module-info.java @@ -24,41 +24,21 @@ */ /** - * Defines the JDK-specific HTTP server API. - *

      - * A basic high-level API for building embedded servers. Both HTTP and - * HTTPS are supported. - *

      - * The main components are: - *

        - *
      • the {@link com.sun.net.httpserver.HttpExchange} class that describes a - * request and response pair,
      • - *
      • the {@link com.sun.net.httpserver.HttpHandler} interface to handle - * incoming requests, plus the {@link com.sun.net.httpserver.HttpHandlers} class - * that provides useful handler implementations,
      • - *
      • the {@link com.sun.net.httpserver.HttpContext} class that maps a URI path - * to a {@code HttpHandler},
      • - *
      • the {@link com.sun.net.httpserver.HttpServer} class to listen for - * connections and dispatch requests to handlers,
      • - *
      • the {@link com.sun.net.httpserver.Filter} class that allows pre- and post- - * processing of requests.
      - *

      - * The {@link com.sun.net.httpserver.SimpleFileServer} class offers a simple - * HTTP file server (intended for testing, development and debugging purposes - * only). A default implementation is provided via the - * main entry point of the {@code jdk.httpserver} module, which can be used on - * the command line as such: - *

      {@code
      - *    Usage: java -m jdk.httpserver [-b bind address] [-p port] [-d directory]
      - *                                  [-o none|info|verbose] [-h to show options]
      - *    Options:
      - *    -b, --bind-address    - Address to bind to. Default: 127.0.0.1 or ::1 (loopback).
      - *                            For all interfaces use "-b 0.0.0.0" or "-b ::".
      - *    -d, --directory       - Directory to serve. Default: current directory.
      - *    -o, --output          - Output format. none|info|verbose. Default: info.
      - *    -p, --port            - Port to listen on. Default: 8000.
      - *    -h, -?, --help        - Print this help message.
      - * }
      + * Defines the JDK-specific HTTP server API, and provides the jwebserver tool + * for running a minimal HTTP server. + * + *

      The {@link com.sun.net.httpserver} package defines a high-level API for + * building servers that support HTTP and HTTPS. The SimpleFileServer class + * implements a simple HTTP-only file server intended for testing, development + * and debugging purposes. A default implementation is provided via the + * {@code jwebserver} tool and the main entry point of the module, which can + * also be invoked with {@code java -m jdk.httpserver}. + * + *

      The {@link com.sun.net.httpserver.spi} package specifies a Service Provider + * Interface (SPI) for locating HTTP server implementations based on the + * {@code com.sun.net.httpserver} API. + * + * @toolGuide jwebserver * * @uses com.sun.net.httpserver.spi.HttpServerProvider * diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java new file mode 100644 index 00000000000..c338e4844e6 --- /dev/null +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021, 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.net.httpserver.simpleserver; + +import java.io.PrintWriter; +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Programmatic entry point to start the jwebserver tool. + * + *

      This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interface are subject to change or deletion + * without notice. + */ +public class JWebServer { + + /** + * This constructor should never be called. + */ + private JWebServer() { throw new AssertionError(); } + + /** + * The main entry point. + * + *

      The command line arguments are parsed and the server is started. If + * started successfully, the server will run on a new non-daemon thread, + * and this method will return. Otherwise, if the server is not started + * successfully, e.g. an error is encountered while parsing the arguments + * or an I/O error occurs, the server is not started and this method invokes + * System::exit with an appropriate exit code. + * + * @param args the command-line options + * @throws NullPointerException if {@code args} is {@code null}, or if there + * are any {@code null} values in the {@code args} array + */ + public static void main(String... args) { + int ec = SimpleFileServerImpl.start(new PrintWriter(System.out, true, UTF_8), "jwebserver", args); + if (ec != 0) { + System.exit(ec); + } // otherwise, the server has either been started successfully and + // runs in another non-daemon thread, or -h or -version have been + // passed and the main thread has exited normally. + } +} diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java index c51140bf5e9..9f76be48abd 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java @@ -27,7 +27,7 @@ import java.io.PrintWriter; import static java.nio.charset.StandardCharsets.UTF_8; /** - * Programmatic entry point to start the simpleserver tool. + * Programmatic entry point to start "java -m jdk.httpserver". * *

      This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. @@ -56,10 +56,11 @@ public class Main { * are any {@code null} values in the {@code args} array */ public static void main(String... args) { - int ec = SimpleFileServerImpl.start(new PrintWriter(System.out, true, UTF_8), args); - if (ec != 0) + int ec = SimpleFileServerImpl.start(new PrintWriter(System.out, true, UTF_8), "java", args); + if (ec != 0) { System.exit(ec); - // otherwise the server has been started successfully and runs in - // another non-daemon thread. + } // otherwise, the server has either been started successfully and + // runs in another non-daemon thread, or -h or -version have been + // passed and the main thread has exited normally. } } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java index 57138018bb9..852aae5a838 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/SimpleFileServerImpl.java @@ -71,11 +71,12 @@ final class SimpleFileServerImpl { * * @param writer the writer to which output should be written * @param args the command line options + * @param launcher the launcher the server is started from * @throws NullPointerException if any of the arguments are {@code null}, * or if there are any {@code null} values in the {@code args} array * @return startup status code */ - static int start(PrintWriter writer, String[] args) { + static int start(PrintWriter writer, String launcher, String[] args) { Objects.requireNonNull(args); for (var arg : args) { Objects.requireNonNull(arg); @@ -96,7 +97,11 @@ final class SimpleFileServerImpl { option = options.next(); switch (option) { case "-h", "-?", "--help" -> { - out.showHelp(); + out.showHelp(launcher); + return Startup.OK.statusCode; + } + case "-version", "--version" -> { + out.showVersion(launcher); return Startup.OK.statusCode; } case "-b", "--bind-address" -> { @@ -115,7 +120,7 @@ final class SimpleFileServerImpl { } } catch (AssertionError ae) { out.reportError(ResourceBundleHelper.getMessage("err.unknown.option", option)); - out.showUsage(); + out.showUsage(launcher); return Startup.CMDERR.statusCode; } catch (NoSuchElementException nsee) { out.reportError(ResourceBundleHelper.getMessage("err.missing.arg", option)); @@ -169,12 +174,16 @@ final class SimpleFileServerImpl { } } - void showUsage() { - writer.println(ResourceBundleHelper.getMessage("usage")); + void showUsage(String launcher) { + writer.println(ResourceBundleHelper.getMessage("usage." + launcher)); + } + + void showVersion(String launcher) { + writer.println(ResourceBundleHelper.getMessage("version", launcher, System.getProperty("java.version"))); } - void showHelp() { - writer.println(ResourceBundleHelper.getMessage("usage")); + void showHelp(String launcher) { + writer.println(ResourceBundleHelper.getMessage("usage." + launcher)); writer.println(ResourceBundleHelper.getMessage("options", LOOPBACK_ADDR.getHostAddress())); } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/resources/simpleserver.properties b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/resources/simpleserver.properties index bf7572b02d6..fc5a9ec6029 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/resources/simpleserver.properties +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/resources/simpleserver.properties @@ -23,9 +23,18 @@ # questions. # -usage=\ +usage.java=\ Usage: java -m jdk.httpserver [-b bind address] [-p port] [-d directory]\n\ -\ [-o none|info|verbose] [-h to show options] +\ [-o none|info|verbose] [-h to show options]\n\ +\ [-version to show version information] + +usage.jwebserver=\ +Usage: jwebserver [-b bind address] [-p port] [-d directory]\n\ +\ [-o none|info|verbose] [-h to show options]\n\ +\ [-version to show version information] + +version=\ +{0} {1} options=\ Options:\n\ @@ -34,7 +43,8 @@ Options:\n\ -d, --directory - Directory to serve. Default: current directory.\n\ -o, --output - Output format. none|info|verbose. Default: info.\n\ -p, --port - Port to listen on. Default: 8000.\n\ --h, -?, --help - Print this help message.\n\ +-h, -?, --help - Prints this help message and exits.\n\ +-version, --version - Prints version information and exits.\n\ To stop the server, press Ctrl + C. opt.bindaddress=\ diff --git a/src/jdk.httpserver/share/man/jwebserver.1 b/src/jdk.httpserver/share/man/jwebserver.1 new file mode 100644 index 00000000000..c0c1341a0f8 --- /dev/null +++ b/src/jdk.httpserver/share/man/jwebserver.1 @@ -0,0 +1,175 @@ +.\" Automatically generated by Pandoc 2.3.1 +.\" +.TH "JWEBSERVER" "1" "2021" "JDK 18\-internal" "JDK Commands" +.hy +.SH NAME +.PP +jwebserver \- launch the Java Simple Web Server +.SH SYNOPSIS +.PP +\f[CB]jwebserver\f[R] [\f[I]options\f[R]] +.TP +.B \f[I]options\f[R] +Command\-line options. +For a detailed description of the options, see \f[B]Options\f[R]. +.RS +.RE +.SH DESCRIPTION +.PP +The \f[CB]jwebserver\f[R] tool provides a minimal HTTP server, designed to +be used for prototyping, testing, and debugging. +It serves a single directory hierarchy, and only serves static files. +Only HTTP/1.1 is supported; HTTP/2 and HTTPS are not supported. +.PP +Only idempotent HEAD and GET requests are served. +Any other requests receive a \f[CB]501\ \-\ Not\ Implemented\f[R] or a +\f[CB]405\ \-\ Not\ Allowed\f[R] response. +GET requests are mapped to the directory being served, as follows: +.IP \[bu] 2 +If the requested resource is a file, its content is served. +.IP \[bu] 2 +If the requested resource is a directory that contains an index file, +the content of the index file is served. +.IP \[bu] 2 +Otherwise, the names of all files and subdirectories of the directory +are listed. +Symbolic links and hidden files are not listed or served. +.PP +MIME types are configured automatically, using the built\-in table. +For example, \f[CB]\&.html\f[R] files are served as \f[CB]text/html\f[R] and +\f[CB]\&.java\f[R] files are served as \f[CB]text/plain\f[R]. +.PP +\f[CB]jwebserver\f[R] is located in the jdk.httpserver module, and can +alternatively be started with \f[CB]java\ \-m\ jdk.httpserver\f[R]. +It is based on the web server implementation in the +\f[CB]com.sun.net.httpserver\f[R] package. +The \f[CB]com.sun.net.httpserver.SimpleFileServer\f[R] class provides a +programmatic way to retrieve the server and its components for reuse and +extension. +.SH USAGE +.IP +.nf +\f[CB] +jwebserver\ [\-b\ bind\ address]\ [\-p\ port]\ [\-d\ directory] +\ \ \ \ \ \ \ \ \ \ \ [\-o\ none|info|verbose]\ [\-h\ to\ show\ options] +\ \ \ \ \ \ \ \ \ \ \ [\-version\ to\ show\ version\ information] +\f[R] +.fi +.SH OPTIONS +.TP +.B \f[CB]\-h\f[R] or \f[CB]\-?\f[R] or \f[CB]\-\-help\f[R] +Prints the help message and exits. +.RS +.RE +.TP +.B \f[CB]\-b\f[R] \f[I]addr\f[R] or \f[CB]\-\-bind\-address\f[R] \f[I]addr\f[R] +Specifies the address to bind to. +Default: 127.0.0.1 or ::1 (loopback). +For all interfaces use \f[CB]\-b\ 0.0.0.0\f[R] or \f[CB]\-b\ ::\f[R]. +.RS +.RE +.TP +.B \f[CB]\-d\f[R] \f[I]dir\f[R] or \f[CB]\-\-directory\f[R] \f[I]dir\f[R] +Specifies the directory to serve. +Default: current directory. +.RS +.RE +.TP +.B \f[CB]\-o\f[R] \f[I]level\f[R] or \f[CB]\-\-output\f[R] \f[I]level\f[R] +Specifies the output format. +\f[CB]none\f[R] | \f[CB]info\f[R] | \f[CB]verbose\f[R]. +Default: \f[CB]info\f[R]. +.RS +.RE +.TP +.B \f[CB]\-p\f[R] \f[I]port\f[R] or \f[CB]\-\-port\f[R] \f[I]port\f[R] +Specifies the port to listen on. +Default: 8000. +.RS +.RE +.TP +.B \f[CB]\-version\f[R] or \f[CB]\-\-version\f[R] +Prints the version information and exits. +.RS +.RE +.PP +To stop the server, press \f[CB]Ctrl\ +\ C\f[R]. +.SH STARTING THE SERVER +.PP +The following command starts the Simple Web Server: +.IP +.nf +\f[CB] +$\ jwebserver +\f[R] +.fi +.PP +If startup is successful, the server prints a message to +\f[CB]System.out\f[R] listing the local address and the absolute path of +the directory being served. +For example: +.IP +.nf +\f[CB] +$\ jwebserver +Binding\ to\ loopback\ by\ default.\ For\ all\ interfaces\ use\ "\-b\ 0.0.0.0"\ or\ "\-b\ ::". +Serving\ /cwd\ and\ subdirectories\ on\ 127.0.0.1\ port\ 8000 +URL\ http://127.0.0.1:8000/ +\f[R] +.fi +.SH CONFIGURATION +.PP +By default, the server runs in the foreground and binds to the loopback +address and port 8000. +This can be changed with the \f[CB]\-b\f[R] and \f[CB]\-p\f[R] options. +.PD 0 +.P +.PD +For example, to bind the Simple Web Server to all interfaces, use: +.IP +.nf +\f[CB] +$\ jwebserver\ \-b\ 0.0.0.0 +Serving\ /cwd\ and\ subdirectories\ on\ 0.0.0.0\ (all\ interfaces)\ port\ 8000 +URL\ http://123.456.7.891:8000/ +\f[R] +.fi +.PP +Note that this makes the web server accessible to all hosts on the +network. +\f[I]Do not do this unless you are sure the server cannot leak any +sensitive information.\f[R] +.PP +As another example, use the following command to run on port 9000: +.IP +.nf +\f[CB] +$\ jwebserver\ \-p\ 9000 +\f[R] +.fi +.PP +By default, the files of the current directory are served. +A different directory can be specified with the \f[CB]\-d\f[R] option. +.PP +By default, every request is logged on the console. +The output looks like this: +.IP +.nf +\f[CB] +127.0.0.1\ \-\ \-\ [10/Feb/2021:14:34:11\ +0000]\ "GET\ /some/subdirectory/\ HTTP/1.1"\ 200\ \- +\f[R] +.fi +.PP +Logging output can be changed with the \f[CB]\-o\f[R] option. +The default setting is \f[CB]info\f[R]. +The \f[CB]verbose\f[R] setting additionally includes the request and +response headers as well as the absolute path of the requested resource. +.SH STOPPING THE SERVER +.PP +Once started successfully, the server runs until it is stopped. +On Unix platforms, the server can be stopped by sending it a +\f[CB]SIGINT\f[R] signal (\f[CB]Ctrl+C\f[R] in a terminal window). +.SH HELP OPTION +.PP +The \f[CB]\-h\f[R] option displays a help message describing the usage and +the options of the \f[CB]jwebserver\f[R]. diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLineNegativeTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLineNegativeTest.java index a494d5961a3..3a22d54f36d 100644 --- a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLineNegativeTest.java +++ b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLineNegativeTest.java @@ -23,7 +23,7 @@ /* * @test - * @summary Negative tests for simpleserver command-line tool + * @summary Negative tests for java -m jdk.httpserver command * @library /test/lib * @modules jdk.httpserver * @run testng/othervm CommandLineNegativeTest diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePortNotSpecifiedTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePortNotSpecifiedTest.java index 9e53d1008e4..ba414a9d0c1 100644 --- a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePortNotSpecifiedTest.java +++ b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePortNotSpecifiedTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8276848 - * @summary Tests the command-line tool with port not specified + * @summary Tests the java -m jdk.httpserver command with port not specified * @modules jdk.httpserver * @library /test/lib * @run testng/othervm/manual CommandLinePortNotSpecifiedTest @@ -118,7 +118,8 @@ public class CommandLinePortNotSpecifiedTest { -d, --directory - Directory to serve. Default: current directory. -o, --output - Output format. none|info|verbose. Default: info. -p, --port - Port to listen on. Default: 8000. - -h, -?, --help - Print this help message. + -h, -?, --help - Prints this help message and exits. + -version, --version - Prints version information and exits. To stop the server, press Ctrl + C.""".formatted(LOOPBACK_ADDR); // The stdout/stderr output line to wait for when starting the simpleserver diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java index c17b9e1b973..fce013460c1 100644 --- a/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java +++ b/test/jdk/com/sun/net/httpserver/simpleserver/CommandLinePositiveTest.java @@ -23,7 +23,7 @@ /* * @test - * @summary Positive tests for simpleserver command-line tool + * @summary Positive tests for java -m jdk.httpserver command * @library /test/lib * @modules jdk.httpserver * @run testng/othervm CommandLinePositiveTest @@ -46,6 +46,7 @@ import static java.lang.System.out; public class CommandLinePositiveTest { + static final String JAVA_VERSION = System.getProperty("java.version"); static final Path JAVA_HOME = Path.of(System.getProperty("java.home")); static final String JAVA = getJava(JAVA_HOME); static final Path CWD = Path.of(".").toAbsolutePath().normalize(); @@ -106,7 +107,8 @@ public class CommandLinePositiveTest { static final String USAGE_TEXT = """ Usage: java -m jdk.httpserver [-b bind address] [-p port] [-d directory] - [-o none|info|verbose] [-h to show options]"""; + [-o none|info|verbose] [-h to show options] + [-version to show version information]"""; static final String OPTIONS_TEXT = """ Options: @@ -115,7 +117,8 @@ public class CommandLinePositiveTest { -d, --directory - Directory to serve. Default: current directory. -o, --output - Output format. none|info|verbose. Default: info. -p, --port - Port to listen on. Default: 8000. - -h, -?, --help - Print this help message. + -h, -?, --help - Prints this help message and exits. + -version, --version - Prints version information and exits. To stop the server, press Ctrl + C.""".formatted(LOOPBACK_ADDR); @Test(dataProvider = "helpOptions") @@ -129,6 +132,18 @@ public class CommandLinePositiveTest { .shouldContain(OPTIONS_TEXT); } + @DataProvider + public Object[][] versionOptions() { return new Object[][] {{"-version"}, {"--version"}}; } + + @Test(dataProvider = "versionOptions") + public void testVersion(String opt) throws Throwable { + out.println("\n--- testVersion, opt=\"%s\" ".formatted(opt)); + simpleserver(WaitForLine.VERSION_STARTUP_LINE, + false, // do not explicitly destroy the process + JAVA, "-m", "jdk.httpserver", opt) + .shouldHaveExitValue(0); + } + @DataProvider public Object[][] bindOptions() { return new Object[][] {{"-b"}, {"--bind-address"}}; } @@ -207,11 +222,13 @@ public class CommandLinePositiveTest { static final String REGULAR_STARTUP_LINE1_STRING = "Serving"; static final String REGULAR_STARTUP_LINE2_STRING = "URL http://"; + static final String VERSION_STARTUP_LINE_STRING = "java " + JAVA_VERSION; // The stdout/stderr output line to wait for when starting the simpleserver enum WaitForLine { REGULAR_STARTUP_LINE (REGULAR_STARTUP_LINE2_STRING) , - HELP_STARTUP_LINE (OPTIONS_TEXT.lines().reduce((first, second) -> second).orElseThrow()); + HELP_STARTUP_LINE (OPTIONS_TEXT.lines().reduce((first, second) -> second).orElseThrow()), + VERSION_STARTUP_LINE (VERSION_STARTUP_LINE_STRING); final String value; WaitForLine(String value) { this.value = value; } diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLineNegativeTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLineNegativeTest.java new file mode 100644 index 00000000000..77671d1e82d --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLineNegativeTest.java @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2021, 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 + * @summary Negative tests for the jwebserver command-line tool + * @library /test/lib + * @modules jdk.httpserver + * @run testng/othervm CommandLineNegativeTest + */ + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.file.Files; +import java.nio.file.Path; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.FileUtils; +import org.testng.SkipException; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static java.lang.System.out; +import static org.testng.Assert.assertFalse; + +public class CommandLineNegativeTest { + + static final Path JAVA_HOME = Path.of(System.getProperty("java.home")); + static final String JWEBSERVER = getJwebserver(JAVA_HOME); + static final Path CWD = Path.of(".").toAbsolutePath().normalize(); + static final Path TEST_DIR = CWD.resolve("CommandLineNegativeTest"); + static final Path TEST_FILE = TEST_DIR.resolve("file.txt"); + static final String LOOPBACK_ADDR = InetAddress.getLoopbackAddress().getHostAddress(); + + @BeforeTest + public void setup() throws IOException { + if (Files.exists(TEST_DIR)) { + FileUtils.deleteFileTreeWithRetry(TEST_DIR); + } + Files.createDirectories(TEST_DIR); + Files.createFile(TEST_FILE); + } + + @DataProvider + public Object[][] unknownOption() { + return new Object[][] { + {"--unknownOption"}, + {"null"} + }; + } + + @Test(dataProvider = "unknownOption") + public void testBadOption(String opt) throws Throwable { + out.println("\n--- testUnknownOption, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt) + .shouldNotHaveExitValue(0) + .shouldContain("Error: unknown option: " + opt); + } + + @DataProvider + public Object[][] tooManyOptionArgs() { + return new Object[][] { + {"-b", "localhost"}, + {"-d", "/some/path"}, + {"-o", "none"}, + {"-p", "0"}, + {"--bind-address", "localhost"}, + {"--directory", "/some/path"}, + {"--output", "none"}, + {"--port", "0"} + // doesn't fail for -h option + }; + } + + @Test(dataProvider = "tooManyOptionArgs") + public void testTooManyOptionArgs(String opt, String arg) throws Throwable { + out.println("\n--- testTooManyOptionArgs, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt, arg, arg) + .shouldNotHaveExitValue(0) + .shouldContain("Error: unknown option: " + arg); + } + + @DataProvider + public Object[][] noArg() { + return new Object[][] { + {"-b", """ + -b, --bind-address - Address to bind to. Default: %s (loopback). + For all interfaces use "-b 0.0.0.0" or "-b ::".""".formatted(LOOPBACK_ADDR)}, + {"-d", "-d, --directory - Directory to serve. Default: current directory."}, + {"-o", "-o, --output - Output format. none|info|verbose. Default: info."}, + {"-p", "-p, --port - Port to listen on. Default: 8000."}, + {"--bind-address", """ + -b, --bind-address - Address to bind to. Default: %s (loopback). + For all interfaces use "-b 0.0.0.0" or "-b ::".""".formatted(LOOPBACK_ADDR)}, + {"--directory", "-d, --directory - Directory to serve. Default: current directory."}, + {"--output", "-o, --output - Output format. none|info|verbose. Default: info."}, + {"--port", "-p, --port - Port to listen on. Default: 8000."} + // doesn't fail for -h option + }; + } + + @Test(dataProvider = "noArg") + public void testNoArg(String opt, String msg) throws Throwable { + out.println("\n--- testNoArg, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt) + .shouldNotHaveExitValue(0) + .shouldContain("Error: no value given for " + opt) + .shouldContain(msg); + } + + @DataProvider + public Object[][] invalidValue() { + return new Object[][] { + {"-b", "[127.0.0.1]"}, + {"-b", "badhost"}, + {"--bind-address", "192.168.1.220..."}, + + {"-o", "bad-output-level"}, + {"--output", "bad-output-level"}, + + {"-p", "+-"}, + {"--port", "+-"} + }; + } + + @Test(dataProvider = "invalidValue") + public void testInvalidValue(String opt, String val) throws Throwable { + out.println("\n--- testInvalidValue, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt, val) + .shouldNotHaveExitValue(0) + .shouldContain("Error: invalid value given for " + opt + ": " + val); + } + + @DataProvider + public Object[][] portOptions() { return new Object[][] {{"-p"}, {"--port"}}; } + + @Test(dataProvider = "portOptions") + public void testPortOutOfRange(String opt) throws Throwable { + out.println("\n--- testPortOutOfRange, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt, "65536") // range 0 to 65535 + .shouldNotHaveExitValue(0) + .shouldContain("Error: server config failed: " + "port out of range:65536"); + } + + @DataProvider + public Object[][] directoryOptions() { return new Object[][] {{"-d"}, {"--directory"}}; } + + @Test(dataProvider = "directoryOptions") + public void testRootNotAbsolute(String opt) throws Throwable { + out.println("\n--- testRootNotAbsolute, opt=\"%s\" ".formatted(opt)); + var root = Path.of("."); + assertFalse(root.isAbsolute()); + simpleserver(JWEBSERVER, opt, root.toString()) + .shouldNotHaveExitValue(0) + .shouldContain("Error: server config failed: " + "Path is not absolute:"); + } + + @Test(dataProvider = "directoryOptions") + public void testRootNotADirectory(String opt) throws Throwable { + out.println("\n--- testRootNotADirectory, opt=\"%s\" ".formatted(opt)); + var file = TEST_FILE.toString(); + assertFalse(Files.isDirectory(TEST_FILE)); + simpleserver(JWEBSERVER, opt, file) + .shouldNotHaveExitValue(0) + .shouldContain("Error: server config failed: " + "Path is not a directory: " + file); + } + + @Test(dataProvider = "directoryOptions") + public void testRootDoesNotExist(String opt) throws Throwable { + out.println("\n--- testRootDoesNotExist, opt=\"%s\" ".formatted(opt)); + Path root = TEST_DIR.resolve("not/existent/dir"); + assertFalse(Files.exists(root)); + simpleserver(JWEBSERVER, opt, root.toString()) + .shouldNotHaveExitValue(0) + .shouldContain("Error: server config failed: " + "Path does not exist: " + root.toString()); + } + + @Test(dataProvider = "directoryOptions") + public void testRootNotReadable(String opt) throws Throwable { + out.println("\n--- testRootNotReadable, opt=\"%s\" ".formatted(opt)); + if (Platform.isWindows()) { + // Not applicable to Windows. Reason: cannot revoke an owner's read + // access to a directory that was created by that owner + throw new SkipException("cannot run on Windows"); + } + Path root = Files.createDirectories(TEST_DIR.resolve("not/readable/dir")); + try { + root.toFile().setReadable(false, false); + assertFalse(Files.isReadable(root)); + simpleserver(JWEBSERVER, opt, root.toString()) + .shouldNotHaveExitValue(0) + .shouldContain("Error: server config failed: " + "Path is not readable: " + root.toString()); + } finally { + root.toFile().setReadable(true, false); + } + } + + @AfterTest + public void teardown() throws IOException { + if (Files.exists(TEST_DIR)) { + FileUtils.deleteFileTreeWithRetry(TEST_DIR); + } + } + + // --- infra --- + + static String getJwebserver(Path image) { + boolean isWindows = System.getProperty("os.name").startsWith("Windows"); + Path jwebserver = image.resolve("bin").resolve(isWindows ? "jwebserver.exe" : "jwebserver"); + if (Files.notExists(jwebserver)) + throw new RuntimeException(jwebserver + " not found"); + return jwebserver.toAbsolutePath().toString(); + } + + static OutputAnalyzer simpleserver(String... args) throws Throwable { + var pb = new ProcessBuilder(args) + .directory(TEST_DIR.toFile()); + var outputAnalyser = ProcessTools.executeCommand(pb) + .outputTo(System.out) + .errorTo(System.out); + return outputAnalyser; + } +} diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePortNotSpecifiedTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePortNotSpecifiedTest.java new file mode 100644 index 00000000000..4d850442b25 --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePortNotSpecifiedTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021, 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 8276848 + * @summary Tests the jwebserver tool with port not specified + * @modules jdk.httpserver + * @library /test/lib + * @run testng/othervm/manual CommandLinePortNotSpecifiedTest + */ + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.TimeUnit; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.FileUtils; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; +import static java.lang.System.out; + +public class CommandLinePortNotSpecifiedTest { + + static final Path JAVA_HOME = Path.of(System.getProperty("java.home")); + static final String JWEBSERVER = getJwebserver(JAVA_HOME); + static final Path CWD = Path.of(".").toAbsolutePath().normalize(); + static final Path TEST_DIR = CWD.resolve("CommandLinePortNotSpecifiedTest"); + static final Path TEST_FILE = TEST_DIR.resolve("file.txt"); + static final String TEST_DIR_STR = TEST_DIR.toString(); + static final String LOOPBACK_ADDR = InetAddress.getLoopbackAddress().getHostAddress(); + + @BeforeTest + public void setup() throws IOException { + if (Files.exists(TEST_DIR)) { + FileUtils.deleteFileTreeWithRetry(TEST_DIR); + } + Files.createDirectories(TEST_DIR); + Files.createFile(TEST_FILE); + } + + static final int SIGTERM = 15; + static final int NORMAL_EXIT_CODE = normalExitCode(); + + static int normalExitCode() { + if (Platform.isWindows()) { + return 1; // expected process destroy exit code + } else { + // signal terminated exit code on Unix is 128 + signal value + return 128 + SIGTERM; + } + } + + /** + * This is a manual test to confirm the command-line tool starts successfully + * in the case where the port is not specified. In this case the server uses + * the default port 8000. The test is manual to avoid a BindException in the + * unlikely but not impossible case that the port is already in use. + */ + @Test + public void testPortNotSpecified() throws Throwable { + out.println("\n--- testPortNotSpecified"); + simpleserver(JWEBSERVER) + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Binding to loopback by default. For all interfaces use \"-b 0.0.0.0\" or \"-b ::\".") + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + } + + @AfterTest + public void teardown() throws IOException { + if (Files.exists(TEST_DIR)) { + FileUtils.deleteFileTreeWithRetry(TEST_DIR); + } + } + + // --- infra --- + + static String getJwebserver(Path image) { + boolean isWindows = System.getProperty("os.name").startsWith("Windows"); + Path jwebserver = image.resolve("bin").resolve(isWindows ? "jwebserver.exe" : "jwebserver"); + if (Files.notExists(jwebserver)) + throw new RuntimeException(jwebserver + " not found"); + return jwebserver.toAbsolutePath().toString(); + } + + static final String REGULAR_STARTUP_LINE1_STRING = "Serving"; + static final String REGULAR_STARTUP_LINE2_STRING = "URL http://"; + + static final String OPTIONS_TEXT = """ + Options: + -b, --bind-address - Address to bind to. Default: %s (loopback). + For all interfaces use "-b 0.0.0.0" or "-b ::". + -d, --directory - Directory to serve. Default: current directory. + -o, --output - Output format. none|info|verbose. Default: info. + -p, --port - Port to listen on. Default: 8000. + -h, -?, --help - Prints this help message and exits. + -version, --version - Prints version information and exits. + To stop the server, press Ctrl + C.""".formatted(LOOPBACK_ADDR); + + // The stdout/stderr output line to wait for when starting the simpleserver + enum WaitForLine { + REGULAR_STARTUP_LINE (REGULAR_STARTUP_LINE2_STRING) , + HELP_STARTUP_LINE (OPTIONS_TEXT.lines().reduce((first, second) -> second).orElseThrow()); + + final String value; + WaitForLine(String value) { this.value = value; } + } + + static OutputAnalyzer simpleserver(String... args) throws Throwable { + return simpleserver(WaitForLine.REGULAR_STARTUP_LINE, true, args); + } + + static OutputAnalyzer simpleserver(WaitForLine waitForLine, boolean destroy, String... args) throws Throwable { + StringBuffer sb = new StringBuffer(); // stdout & stderr + // start the process and await the waitForLine before returning + var p = ProcessTools.startProcess("simpleserver", + new ProcessBuilder(args).directory(TEST_DIR.toFile()), + line -> sb.append(line + "\n"), + line -> line.startsWith(waitForLine.value), + 30, // suitably high default timeout, not expected to timeout + TimeUnit.SECONDS); + if (destroy) { + p.destroy(); // SIGTERM on Unix + } + int ec = p.waitFor(); + var outputAnalyser = new OutputAnalyzer(sb.toString(), "", ec); + return outputAnalyser; + } +} diff --git a/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java new file mode 100644 index 00000000000..c3a63371828 --- /dev/null +++ b/test/jdk/com/sun/net/httpserver/simpleserver/jwebserver/CommandLinePositiveTest.java @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2021, 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 + * @summary Positive tests for the jwebserver command-line tool + * @library /test/lib + * @modules jdk.httpserver + * @run testng/othervm CommandLinePositiveTest + */ + +import java.io.IOException; +import java.net.InetAddress; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.TimeUnit; +import jdk.test.lib.Platform; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.FileUtils; +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static java.lang.System.out; + +public class CommandLinePositiveTest { + + static final String JAVA_VERSION = System.getProperty("java.version"); + static final Path JAVA_HOME = Path.of(System.getProperty("java.home")); + static final String JWEBSERVER = getJwebserver(JAVA_HOME); + static final Path CWD = Path.of(".").toAbsolutePath().normalize(); + static final Path TEST_DIR = CWD.resolve("CommandLinePositiveTest"); + static final Path TEST_FILE = TEST_DIR.resolve("file.txt"); + static final String TEST_DIR_STR = TEST_DIR.toString(); + static final String LOOPBACK_ADDR = InetAddress.getLoopbackAddress().getHostAddress(); + + @BeforeTest + public void setup() throws IOException { + if (Files.exists(TEST_DIR)) { + FileUtils.deleteFileTreeWithRetry(TEST_DIR); + } + Files.createDirectories(TEST_DIR); + Files.createFile(TEST_FILE); + } + + static final int SIGTERM = 15; + static final int NORMAL_EXIT_CODE = normalExitCode(); + + static int normalExitCode() { + if (Platform.isWindows()) { + return 1; // expected process destroy exit code + } else { + // signal terminated exit code on Unix is 128 + signal value + return 128 + SIGTERM; + } + } + + @DataProvider + public Object[][] directoryOptions() { return new Object[][] {{"-d"}, {"--directory"}}; } + + @Test(dataProvider = "directoryOptions") + public void testDirectory(String opt) throws Throwable { + out.println("\n--- testDirectory, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, "-p", "0", opt, TEST_DIR_STR) + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Binding to loopback by default. For all interfaces use \"-b 0.0.0.0\" or \"-b ::\".") + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + } + + @DataProvider + public Object[][] portOptions() { return new Object[][] {{"-p"}, {"--port"}}; } + + @Test(dataProvider = "portOptions") + public void testPort(String opt) throws Throwable { + out.println("\n--- testPort, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt, "0") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Binding to loopback by default. For all interfaces use \"-b 0.0.0.0\" or \"-b ::\".") + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + } + + @DataProvider + public Object[][] helpOptions() { return new Object[][] {{"-h"}, {"-?"}, {"--help"}}; } + + static final String USAGE_TEXT = """ + Usage: jwebserver [-b bind address] [-p port] [-d directory] + [-o none|info|verbose] [-h to show options] + [-version to show version information]"""; + + static final String OPTIONS_TEXT = """ + Options: + -b, --bind-address - Address to bind to. Default: %s (loopback). + For all interfaces use "-b 0.0.0.0" or "-b ::". + -d, --directory - Directory to serve. Default: current directory. + -o, --output - Output format. none|info|verbose. Default: info. + -p, --port - Port to listen on. Default: 8000. + -h, -?, --help - Prints this help message and exits. + -version, --version - Prints version information and exits. + To stop the server, press Ctrl + C.""".formatted(LOOPBACK_ADDR); + + @Test(dataProvider = "helpOptions") + public void testHelp(String opt) throws Throwable { + out.println("\n--- testHelp, opt=\"%s\" ".formatted(opt)); + simpleserver(WaitForLine.HELP_STARTUP_LINE, + false, // do not explicitly destroy the process + JWEBSERVER, opt) + .shouldHaveExitValue(0) + .shouldContain(USAGE_TEXT) + .shouldContain(OPTIONS_TEXT); + } + + @DataProvider + public Object[][] versionOptions() { return new Object[][] {{"-version"}, {"--version"}}; } + + @Test(dataProvider = "versionOptions") + public void testVersion(String opt) throws Throwable { + out.println("\n--- testVersion, opt=\"%s\" ".formatted(opt)); + simpleserver(WaitForLine.VERSION_STARTUP_LINE, + false, // do not explicitly destroy the process + JWEBSERVER, opt) + .shouldHaveExitValue(0); + } + + @DataProvider + public Object[][] bindOptions() { return new Object[][] {{"-b"}, {"--bind-address"}}; } + + @Test(dataProvider = "bindOptions") + public void testBindAllInterfaces(String opt) throws Throwable { + out.println("\n--- testBindAllInterfaces, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, "-p", "0", opt, "0.0.0.0") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") + .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); + simpleserver(JWEBSERVER, opt, "::0") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on 0.0.0.0 (all interfaces) port") + .shouldContain("URL http://" + InetAddress.getLocalHost().getHostAddress()); + } + + @Test(dataProvider = "bindOptions") + public void testLastOneWinsBindAddress(String opt) throws Throwable { + out.println("\n--- testLastOneWinsBindAddress, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, "-p", "0", opt, "123.4.5.6", opt, LOOPBACK_ADDR) + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + + } + + @Test(dataProvider = "directoryOptions") + public void testLastOneWinsDirectory(String opt) throws Throwable { + out.println("\n--- testLastOneWinsDirectory, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, "-p", "0", opt, TEST_DIR_STR, opt, TEST_DIR_STR) + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Binding to loopback by default. For all interfaces use \"-b 0.0.0.0\" or \"-b ::\".") + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + } + + @DataProvider + public Object[][] outputOptions() { return new Object[][] {{"-o"}, {"--output"}}; } + + @Test(dataProvider = "outputOptions") + public void testLastOneWinsOutput(String opt) throws Throwable { + out.println("\n--- testLastOneWinsOutput, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, "-p", "0", opt, "none", opt, "verbose") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Binding to loopback by default. For all interfaces use \"-b 0.0.0.0\" or \"-b ::\".") + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + } + + @Test(dataProvider = "portOptions") + public void testLastOneWinsPort(String opt) throws Throwable { + out.println("\n--- testLastOneWinsPort, opt=\"%s\" ".formatted(opt)); + simpleserver(JWEBSERVER, opt, "-999", opt, "0") + .shouldHaveExitValue(NORMAL_EXIT_CODE) + .shouldContain("Binding to loopback by default. For all interfaces use \"-b 0.0.0.0\" or \"-b ::\".") + .shouldContain("Serving " + TEST_DIR_STR + " and subdirectories on " + LOOPBACK_ADDR + " port") + .shouldContain("URL http://" + LOOPBACK_ADDR); + } + + @AfterTest + public void teardown() throws IOException { + if (Files.exists(TEST_DIR)) { + FileUtils.deleteFileTreeWithRetry(TEST_DIR); + } + } + + // --- infra --- + + static String getJwebserver(Path image) { + boolean isWindows = System.getProperty("os.name").startsWith("Windows"); + Path jwebserver = image.resolve("bin").resolve(isWindows ? "jwebserver.exe" : "jwebserver"); + if (Files.notExists(jwebserver)) + throw new RuntimeException(jwebserver + " not found"); + return jwebserver.toAbsolutePath().toString(); + } + + static final String REGULAR_STARTUP_LINE1_STRING = "Serving"; + static final String REGULAR_STARTUP_LINE2_STRING = "URL http://"; + static final String VERSION_STARTUP_LINE_STRING = "jwebserver " + JAVA_VERSION; + + // The stdout/stderr output line to wait for when starting the simpleserver + enum WaitForLine { + REGULAR_STARTUP_LINE (REGULAR_STARTUP_LINE2_STRING) , + HELP_STARTUP_LINE (OPTIONS_TEXT.lines().reduce((first, second) -> second).orElseThrow()), + VERSION_STARTUP_LINE (VERSION_STARTUP_LINE_STRING); + + final String value; + WaitForLine(String value) { this.value = value; } + } + + static OutputAnalyzer simpleserver(String... args) throws Throwable { + return simpleserver(WaitForLine.REGULAR_STARTUP_LINE, true, args); + } + + static OutputAnalyzer simpleserver(WaitForLine waitForLine, boolean destroy, String... args) throws Throwable { + StringBuffer sb = new StringBuffer(); // stdout & stderr + // start the process and await the waitForLine before returning + var p = ProcessTools.startProcess("simpleserver", + new ProcessBuilder(args).directory(TEST_DIR.toFile()), + line -> sb.append(line + "\n"), + line -> line.startsWith(waitForLine.value), + 30, // suitably high default timeout, not expected to timeout + TimeUnit.SECONDS); + if (destroy) { + p.destroy(); // SIGTERM on Unix + } + int ec = p.waitFor(); + var outputAnalyser = new OutputAnalyzer(sb.toString(), "", ec); + return outputAnalyser; + } +} diff --git a/test/jdk/tools/launcher/HelpFlagsTest.java b/test/jdk/tools/launcher/HelpFlagsTest.java index 173074ab905..dda649b9f41 100644 --- a/test/jdk/tools/launcher/HelpFlagsTest.java +++ b/test/jdk/tools/launcher/HelpFlagsTest.java @@ -151,6 +151,7 @@ public class HelpFlagsTest extends TestHelper { new ToolHelpSpec("rmiregistry", 0, 0, 0, 0, 0, 0, 1), // none, prints help message anyways. new ToolHelpSpec("serialver", 0, 0, 0, 0, 0, 0, 1), // none, prints help message anyways. new ToolHelpSpec("jpackage", 0, 1, 1, 0, 0, 1, 1), // -h, --help, + new ToolHelpSpec("jwebserver", 1, 1, 1, 0, 0, 1, 1), // -?, -h, --help }; // Returns corresponding object from jdkTools array. diff --git a/test/jdk/tools/launcher/VersionCheck.java b/test/jdk/tools/launcher/VersionCheck.java index 38a61b54198..32d8db799ea 100644 --- a/test/jdk/tools/launcher/VersionCheck.java +++ b/test/jdk/tools/launcher/VersionCheck.java @@ -61,7 +61,8 @@ public class VersionCheck extends TestHelper { "jmc.ini", "jweblauncher", "jpackage", - "ssvagent" + "ssvagent", + "jwebserver" }; // tools that do not accept -version -- GitLab From 0c29ee50f07aa003f7cdaaa54f96b5c75b1f04db Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 1 Dec 2021 11:09:31 +0000 Subject: [PATCH 538/890] 8274319: Replace usages of Collections.sort with List.sort call in jdk.jfr Reviewed-by: egahlin --- .../share/classes/jdk/jfr/internal/MetadataReader.java | 6 +++--- .../classes/jdk/jfr/internal/PlatformRecorder.java | 3 +-- .../classes/jdk/jfr/internal/SettingsManager.java | 6 +++--- .../share/classes/jdk/jfr/internal/TypeLibrary.java | 3 ++- .../jdk/jfr/internal/consumer/RepositoryFiles.java | 2 +- .../classes/jdk/jfr/internal/dcmd/AbstractDCmd.java | 3 +-- .../share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java | 10 ++-------- .../jdk/jfr/internal/tool/EventPrintWriter.java | 5 ++--- .../share/classes/jdk/jfr/internal/tool/Metadata.java | 3 +-- .../share/classes/jdk/jfr/internal/tool/Summary.java | 5 ++--- 10 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java index ca5c5c31ecd..91d243402aa 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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,7 +40,7 @@ import static jdk.jfr.internal.MetadataDescriptor.ELEMENT_TYPE; import java.io.DataInput; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -84,7 +84,7 @@ final class MetadataReader { descriptor.root = root; if (Logger.shouldLog(LogTag.JFR_SYSTEM_PARSER, LogLevel.TRACE)) { List ts = new ArrayList<>(types.values()); - Collections.sort(ts, (x,y) -> x.getName().compareTo(y.getName())); + ts.sort(Comparator.comparing(Type::getName)); for (Type t : ts) { t.log("Found", LogTag.JFR_SYSTEM_PARSER, LogLevel.TRACE); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java index ef1d51a0622..63a4840618f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java @@ -36,7 +36,6 @@ import java.security.AccessControlContext; import java.security.AccessController; import java.time.Duration; import java.time.Instant; -import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -437,7 +436,7 @@ public final class PlatformRecorder { } // n*log(n), should be able to do n*log(k) with a priority queue, // where k = number of recordings, n = number of chunks - Collections.sort(chunks, RepositoryChunk.END_TIME_COMPARATOR); + chunks.sort(RepositoryChunk.END_TIME_COMPARATOR); return chunks; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java index db239b980e5..d6078ef9f98 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/SettingsManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -27,7 +27,7 @@ package jdk.jfr.internal; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -140,7 +140,7 @@ final class SettingsManager { } } else { if (Logger.shouldLog(LogTag.JFR_SETTING, LogLevel.INFO)) { - Collections.sort(eventControls, (x,y) -> x.getEventType().getName().compareTo(y.getEventType().getName())); + eventControls.sort(Comparator.comparing(x -> x.getEventType().getName())); } for (EventControl ec : eventControls) { setEventControl(ec); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java index fb16c92f171..e57172b867a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java @@ -36,6 +36,7 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -108,7 +109,7 @@ public final class TypeLibrary { List jvmTypes; try { jvmTypes = MetadataLoader.createTypes(); - Collections.sort(jvmTypes, (a,b) -> Long.compare(a.getId(), b.getId())); + jvmTypes.sort(Comparator.comparingLong(Type::getId)); } catch (IOException e) { throw new Error("JFR: Could not read metadata"); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java index 78bd18ddc7a..6ef88ecad37 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RepositoryFiles.java @@ -213,7 +213,7 @@ public final class RepositoryFiles { pathSet.remove(time); pathLookup.remove(remove); } - Collections.sort(added, (p1, p2) -> p1.compareTo(p2)); + Collections.sort(added); for (Path p : added) { // Only add files that have a complete header // as the JVM may be in progress writing the file diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java index a6130b2ece7..b7fb23c9402 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java @@ -32,7 +32,6 @@ import java.nio.file.Paths; import java.time.Duration; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -169,7 +168,7 @@ abstract class AbstractDCmd { protected final List getRecordings() { List list = new ArrayList<>(getFlightRecorder().getRecordings()); - Collections.sort(list, Comparator.comparing(Recording::getId)); + list.sort(Comparator.comparingLong(Recording::getId)); return list; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java index ef32321120b..888ca4eda2a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -27,7 +27,6 @@ package jdk.jfr.internal.dcmd; import java.time.Duration; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; @@ -135,12 +134,7 @@ final class DCmdCheck extends AbstractDCmd { private static List sortByEventPath(Collection events) { List sorted = new ArrayList<>(); sorted.addAll(events); - Collections.sort(sorted, new Comparator() { - @Override - public int compare(EventType e1, EventType e2) { - return e1.getName().compareTo(e2.getName()); - } - }); + sorted.sort(Comparator.comparing(EventType::getName)); return sorted; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java index 9a393f30ee8..a6c92761a57 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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,7 +30,6 @@ import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Path; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -77,7 +76,7 @@ abstract class EventPrintWriter extends StructuredWriter { events.add(event); } if (PRIVATE_ACCESS.isLastEventInChunk(file)) { - Collections.sort(events, PRIVATE_ACCESS.eventComparator()); + events.sort(PRIVATE_ACCESS.eventComparator()); print(events); events.clear(); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Metadata.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Metadata.java index c72a34edfd0..3404c740439 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Metadata.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Metadata.java @@ -31,7 +31,6 @@ import java.io.PrintWriter; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Collections; import java.util.Comparator; import java.util.Deque; import java.util.List; @@ -206,7 +205,7 @@ final class Metadata extends Command { } List types = findTypes(file); - Collections.sort(types, new TypeComparator()); + types.sort(new TypeComparator()); for (Type type : types) { if (filter != null) { // If --events or --categories, only operate on events diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java index 3375ec3f7a6..767ccf63507 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -32,7 +32,6 @@ import java.time.Instant; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.util.ArrayList; -import java.util.Collections; import java.util.Deque; import java.util.HashMap; import java.util.List; @@ -143,7 +142,7 @@ final class Summary extends Command { println(" Start: " + DATE_FORMAT.format(Instant.ofEpochSecond(epochSeconds, adjustNanos)) + " (UTC)"); println(" Duration: " + (totalDuration + 500_000_000) / 1_000_000_000 + " s"); List statsList = new ArrayList<>(stats.values()); - Collections.sort(statsList, (u, v) -> Long.compare(v.count, u.count)); + statsList.sort((u, v) -> Long.compare(v.count, u.count)); println(); String header = " Count Size (bytes) "; String typeHeader = " Event Type"; -- GitLab From bc6dce149efef54b1d6c945c68cd75feb1276f5b Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 1 Dec 2021 11:26:42 +0000 Subject: [PATCH 539/890] 8277736: G1: Allow forced evacuation failure of first N regions in collection set Reviewed-by: ayang, tschatzl --- .../share/gc/g1/g1ParScanThreadState.cpp | 6 ++-- .../share/gc/g1/g1ParScanThreadState.hpp | 2 +- .../gc/g1/g1YoungGCEvacFailureInjector.cpp | 31 +++++++++++++++++++ .../gc/g1/g1YoungGCEvacFailureInjector.hpp | 8 ++++- .../g1YoungGCEvacFailureInjector.inline.hpp | 5 ++- src/hotspot/share/gc/g1/g1_globals.hpp | 8 ++++- 6 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp index 2028f775e31..da24578f9df 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp @@ -421,8 +421,8 @@ HeapWord* G1ParScanThreadState::allocate_copy_slow(G1HeapRegionAttr* dest_attr, } #if EVAC_FAILURE_INJECTOR -bool G1ParScanThreadState::inject_evacuation_failure() { - return _g1h->evac_failure_injector()->evacuation_should_fail(_evac_failure_inject_counter); +bool G1ParScanThreadState::inject_evacuation_failure(uint region_idx) { + return _g1h->evac_failure_injector()->evacuation_should_fail(_evac_failure_inject_counter, region_idx); } #endif @@ -470,7 +470,7 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio assert(_g1h->is_in_reserved(obj_ptr), "Allocated memory should be in the heap"); // Should this evacuation fail? - if (inject_evacuation_failure()) { + if (inject_evacuation_failure(from_region->hrm_index())) { // Doing this after all the allocation attempts also tests the // undo_allocation() method too. undo_allocation(dest_attr, obj_ptr, word_sz, node_index); diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp index 478b8745731..f40ca519268 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp @@ -107,7 +107,7 @@ class G1ParScanThreadState : public CHeapObj { EvacuationFailedInfo _evacuation_failed_info; G1EvacFailureRegions* _evac_failure_regions; - bool inject_evacuation_failure() EVAC_FAILURE_INJECTOR_RETURN_( return false; ); + bool inject_evacuation_failure(uint region_idx) EVAC_FAILURE_INJECTOR_RETURN_( return false; ); public: G1ParScanThreadState(G1CollectedHeap* g1h, diff --git a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp index 67b44263004..c534d6f29c8 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp +++ b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.cpp @@ -30,6 +30,33 @@ #if EVAC_FAILURE_INJECTOR +class SelectEvacFailureRegionClosure : public HeapRegionClosure { + CHeapBitMap& _evac_failure_regions; + size_t _evac_failure_regions_num; + +public: + SelectEvacFailureRegionClosure(CHeapBitMap& evac_failure_regions, size_t cset_length) : + _evac_failure_regions(evac_failure_regions), + _evac_failure_regions_num(cset_length * G1EvacuationFailureALotCSetPercent / 100) { } + + bool do_heap_region(HeapRegion* r) override { + assert(r->in_collection_set(), "must be"); + if (_evac_failure_regions_num > 0) { + _evac_failure_regions.set_bit(r->hrm_index()); + --_evac_failure_regions_num; + return false; + } + return true; + } +}; + +void G1YoungGCEvacFailureInjector::select_evac_failure_regions() { + G1CollectedHeap* g1h = G1CollectedHeap::heap(); + _evac_failure_regions.reinitialize(g1h->max_reserved_regions()); + SelectEvacFailureRegionClosure closure(_evac_failure_regions, g1h->collection_set()->cur_length()); + g1h->collection_set_iterate_all(&closure); +} + bool G1YoungGCEvacFailureInjector::arm_if_needed_for_gc_type(bool for_young_gc, bool during_concurrent_start, bool mark_or_rebuild_in_progress) { @@ -68,6 +95,10 @@ void G1YoungGCEvacFailureInjector::arm_if_needed() { arm_if_needed_for_gc_type(in_young_only_phase, in_concurrent_start_gc, mark_or_rebuild_in_progress); + + if (_inject_evacuation_failure_for_current_gc) { + select_evac_failure_regions(); + } } } diff --git a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp index eb0d4598c14..aff61c4035d 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp +++ b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.hpp @@ -56,11 +56,17 @@ class G1YoungGCEvacFailureInjector { // Used to determine whether evacuation failure injection should be in effect // for the current GC. size_t _last_collection_with_evacuation_failure; + + // Records the regions that will fail evacuation. + CHeapBitMap _evac_failure_regions; #endif bool arm_if_needed_for_gc_type(bool for_young_gc, bool during_concurrent_start, bool mark_or_rebuild_in_progress) EVAC_FAILURE_INJECTOR_RETURN_( return false; ); + + // Selects the regions that will fail evacuation by G1EvacuationFailureALotCSetPercent. + void select_evac_failure_regions() EVAC_FAILURE_INJECTOR_RETURN; public: // Arm the evacuation failure injector if needed for the current @@ -69,7 +75,7 @@ public: // Return true if it's time to cause an evacuation failure; the caller // provides the (preferably thread-local) counter to minimize performance impact. - bool evacuation_should_fail(size_t& counter) EVAC_FAILURE_INJECTOR_RETURN_( return false; ); + bool evacuation_should_fail(size_t& counter, uint region_idx) EVAC_FAILURE_INJECTOR_RETURN_( return false; ); // Reset the evacuation failure injection counters. Should be called at // the end of an evacuation pause in which an evacuation failure occurred. diff --git a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp index e259fc61376..90d64056b83 100644 --- a/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp +++ b/src/hotspot/share/gc/g1/g1YoungGCEvacFailureInjector.inline.hpp @@ -32,10 +32,13 @@ #if EVAC_FAILURE_INJECTOR -inline bool G1YoungGCEvacFailureInjector::evacuation_should_fail(size_t& counter) { +inline bool G1YoungGCEvacFailureInjector::evacuation_should_fail(size_t& counter, uint region_idx) { if (!_inject_evacuation_failure_for_current_gc) { return false; } + if (!_evac_failure_regions.at(region_idx)) { + return false; + } if (++counter < G1EvacuationFailureALotCount) { return false; } diff --git a/src/hotspot/share/gc/g1/g1_globals.hpp b/src/hotspot/share/gc/g1/g1_globals.hpp index ed71b6d45b2..40334fc5f10 100644 --- a/src/hotspot/share/gc/g1/g1_globals.hpp +++ b/src/hotspot/share/gc/g1/g1_globals.hpp @@ -73,7 +73,13 @@ \ product(bool, G1EvacuationFailureALotDuringMixedGC, true, \ "Force use of evacuation failure handling during mixed " \ - "evacuation pauses") + "evacuation pauses") \ + \ + product(uint, G1EvacuationFailureALotCSetPercent, 100, \ + "The percentage of regions in the collection set starting " \ + "from the beginning where the forced evacuation failure " \ + "injection will be applied.") \ + range(1, 100) #else #define GC_G1_EVACUATION_FAILURE_FLAGS(develop, \ develop_pd, \ -- GitLab From 8d7958e46969fd59df7bc6dd1cbe31ae63686b05 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 1 Dec 2021 12:06:07 +0000 Subject: [PATCH 540/890] 8277981: String Deduplication table is never cleaned up due to bad dead_factor_for_cleanup Reviewed-by: zgu, kbarrett, tschatzl --- src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp b/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp index a01548a72b0..3fa3df12891 100644 --- a/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp +++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupConfig.cpp @@ -161,6 +161,6 @@ void StringDedup::Config::initialize() { _load_factor_for_shrink = StringDeduplicationShrinkTableLoad; _load_factor_target = StringDeduplicationTargetTableLoad; _minimum_dead_for_cleanup = StringDeduplicationCleanupDeadMinimum; - _dead_factor_for_cleanup = percent_of(StringDeduplicationCleanupDeadPercent, 100); + _dead_factor_for_cleanup = StringDeduplicationCleanupDeadPercent / 100.0; _hash_seed = initial_hash_seed(); } -- GitLab From 37ff7f3b66eaa74d62d6a93f2f34ec744db21834 Mon Sep 17 00:00:00 2001 From: KIRIYAMA Takuya Date: Wed, 1 Dec 2021 12:47:26 +0000 Subject: [PATCH 541/890] 8277866: gc/epsilon/TestMemoryMXBeans.java failed with wrong initial heap size Reviewed-by: tschatzl, shade --- test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java b/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java index a9ff8d00ba0..1cb358e60dd 100644 --- a/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java +++ b/test/hotspot/jtreg/gc/epsilon/TestMemoryMXBeans.java @@ -36,7 +36,7 @@ package gc.epsilon; * gc.epsilon.TestMemoryMXBeans * -1 256 * - * @run main/othervm -Xmx256m -Xmx256m + * @run main/othervm -Xms256m -Xmx256m * -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC * gc.epsilon.TestMemoryMXBeans * 256 256 -- GitLab From abaa073bcbdb202658c8a97401ffb098d71e0f16 Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Wed, 1 Dec 2021 13:14:09 +0000 Subject: [PATCH 542/890] 8277946: NMT: Deprecate and remove VM.native_memory shutdown jcmd command option Reviewed-by: stuefe, shade, dholmes --- src/hotspot/share/services/nmtDCmd.cpp | 13 +--- src/hotspot/share/services/nmtDCmd.hpp | 1 - .../runtime/NMT/JcmdWithNMTDisabled.java | 3 +- .../jtreg/runtime/NMT/ShutdownTwice.java | 59 ------------------- .../runtime/NMT/SummaryAfterShutdown.java | 59 ------------------- 5 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 test/hotspot/jtreg/runtime/NMT/ShutdownTwice.java delete mode 100644 test/hotspot/jtreg/runtime/NMT/SummaryAfterShutdown.java diff --git a/src/hotspot/share/services/nmtDCmd.cpp b/src/hotspot/share/services/nmtDCmd.cpp index e89dd2c56e7..dd8eb17c298 100644 --- a/src/hotspot/share/services/nmtDCmd.cpp +++ b/src/hotspot/share/services/nmtDCmd.cpp @@ -50,9 +50,6 @@ NMTDCmd::NMTDCmd(outputStream* output, "comparison against previous baseline, which shows the memory " \ "allocation activities at different callsites.", "BOOLEAN", false, "false"), - _shutdown("shutdown", "request runtime to shutdown itself and free the " \ - "memory used by runtime.", - "BOOLEAN", false, "false"), _statistics("statistics", "print tracker statistics for tuning purpose.", \ "BOOLEAN", false, "false"), _scale("scale", "Memory usage in which scale, KB, MB or GB", @@ -62,7 +59,6 @@ NMTDCmd::NMTDCmd(outputStream* output, _dcmdparser.add_dcmd_option(&_baseline); _dcmdparser.add_dcmd_option(&_summary_diff); _dcmdparser.add_dcmd_option(&_detail_diff); - _dcmdparser.add_dcmd_option(&_shutdown); _dcmdparser.add_dcmd_option(&_statistics); _dcmdparser.add_dcmd_option(&_scale); } @@ -79,9 +75,6 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) { if (MemTracker::tracking_level() == NMT_off) { output()->print_cr("Native memory tracking is not enabled"); return; - } else if (MemTracker::tracking_level() == NMT_minimal) { - output()->print_cr("Native memory tracking has been shutdown"); - return; } const char* scale_value = _scale.value(); @@ -97,12 +90,11 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) { if (_baseline.is_set() && _baseline.value()) { ++nopt; } if (_summary_diff.is_set() && _summary_diff.value()) { ++nopt; } if (_detail_diff.is_set() && _detail_diff.value()) { ++nopt; } - if (_shutdown.is_set() && _shutdown.value()) { ++nopt; } if (_statistics.is_set() && _statistics.value()) { ++nopt; } if (nopt > 1) { output()->print_cr("At most one of the following option can be specified: " \ - "summary, detail, metadata, baseline, summary.diff, detail.diff, shutdown"); + "summary, detail, metadata, baseline, summary.diff, detail.diff"); return; } else if (nopt == 0) { if (_summary.is_set()) { @@ -147,9 +139,6 @@ void NMTDCmd::execute(DCmdSource source, TRAPS) { } else { output()->print_cr("No detail baseline for comparison"); } - } else if (_shutdown.value()) { - MemTracker::shutdown(); - output()->print_cr("Native memory tracking has been turned off"); } else if (_statistics.value()) { if (check_detail_tracking_level(output())) { MemTracker::tuning_statistics(output()); diff --git a/src/hotspot/share/services/nmtDCmd.hpp b/src/hotspot/share/services/nmtDCmd.hpp index 1ea19735cdc..52c61d34c0c 100644 --- a/src/hotspot/share/services/nmtDCmd.hpp +++ b/src/hotspot/share/services/nmtDCmd.hpp @@ -42,7 +42,6 @@ class NMTDCmd: public DCmdWithParser { DCmdArgument _baseline; DCmdArgument _summary_diff; DCmdArgument _detail_diff; - DCmdArgument _shutdown; DCmdArgument _statistics; DCmdArgument _scale; diff --git a/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java b/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java index 5567a57b517..891f82be0bd 100644 --- a/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java +++ b/test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -69,7 +69,6 @@ public class JcmdWithNMTDisabled { jcmdCommand("summary.diff"); jcmdCommand("detail.diff"); jcmdCommand("scale=GB"); - jcmdCommand("shutdown"); } // Helper method for invoking different jcmd calls, all should fail with the same message saying NMT is not enabled diff --git a/test/hotspot/jtreg/runtime/NMT/ShutdownTwice.java b/test/hotspot/jtreg/runtime/NMT/ShutdownTwice.java deleted file mode 100644 index 600d57cc91f..00000000000 --- a/test/hotspot/jtreg/runtime/NMT/ShutdownTwice.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2013, 2020, 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 - * @summary Run shutdown twice - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice - */ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.JDKToolFinder; - -public class ShutdownTwice { - - public static void main(String args[]) throws Exception { - // Grab my own PID - String pid = Long.toString(ProcessTools.getProcessId()); - OutputAnalyzer output; - - ProcessBuilder pb = new ProcessBuilder(); - - // Run 'jcmd VM.native_memory shutdown' - pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "shutdown"}); - output = new OutputAnalyzer(pb.start()); - - // Verify that jcmd reports that NMT is shutting down - output.shouldContain("Native memory tracking has been turned off"); - - // Run shutdown again - output = new OutputAnalyzer(pb.start()); - - // Verify that jcmd reports that NMT has been shutdown already - output.shouldContain("Native memory tracking has been shutdown"); - } -} diff --git a/test/hotspot/jtreg/runtime/NMT/SummaryAfterShutdown.java b/test/hotspot/jtreg/runtime/NMT/SummaryAfterShutdown.java deleted file mode 100644 index ab058fe8f0e..00000000000 --- a/test/hotspot/jtreg/runtime/NMT/SummaryAfterShutdown.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2013, 2020, 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 - * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown - */ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.JDKToolFinder; - -public class SummaryAfterShutdown { - - public static void main(String args[]) throws Exception { - OutputAnalyzer output; - // Grab my own PID - String pid = Long.toString(ProcessTools.getProcessId()); - ProcessBuilder pb = new ProcessBuilder(); - - // Run 'jcmd VM.native_memory shutdown' - pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "shutdown"}); - output = new OutputAnalyzer(pb.start()); - - // Verify that jcmd reports that NMT is shutting down - output.shouldContain("Native memory tracking has been turned off"); - - // Run 'jcmd VM.native_memory summary' - pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); - output = new OutputAnalyzer(pb.start()); - - // Verify that jcmd reports that NMT has been shutdown - output.shouldContain("Native memory tracking has been shutdown"); - } -} -- GitLab From 1e9ed54d362b8c57be5fbbac2de5afbd0f05435f Mon Sep 17 00:00:00 2001 From: Ravi Reddy Date: Wed, 1 Dec 2021 15:35:00 +0000 Subject: [PATCH 543/890] 8193682: Infinite loop in ZipOutputStream.close() Reviewed-by: lancea, coffeys --- .../java/util/zip/DeflaterOutputStream.java | 9 +- .../java/util/zip/GZIPOutputStream.java | 38 +++-- .../java/util/zip/ZipOutputStream.java | 102 ++++++------ test/jdk/java/util/zip/CloseDeflaterTest.java | 147 ++++++++++++++++++ 4 files changed, 229 insertions(+), 67 deletions(-) create mode 100644 test/jdk/java/util/zip/CloseDeflaterTest.java diff --git a/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java b/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java index 365bc676b08..7dfbd7f9edb 100644 --- a/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/DeflaterOutputStream.java @@ -234,9 +234,12 @@ public class DeflaterOutputStream extends FilterOutputStream { */ public void close() throws IOException { if (!closed) { - finish(); - if (usesDefaultDeflater) - def.end(); + try { + finish(); + } finally { + if (usesDefaultDeflater) + def.end(); + } out.close(); closed = true; } diff --git a/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java b/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java index 153af0959b1..cdfac329cfa 100644 --- a/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/GZIPOutputStream.java @@ -157,24 +157,30 @@ public class GZIPOutputStream extends DeflaterOutputStream { */ public void finish() throws IOException { if (!def.finished()) { - def.finish(); - while (!def.finished()) { - int len = def.deflate(buf, 0, buf.length); - if (def.finished() && len <= buf.length - TRAILER_SIZE) { - // last deflater buffer. Fit trailer at the end - writeTrailer(buf, len); - len = len + TRAILER_SIZE; - out.write(buf, 0, len); - return; + try { + def.finish(); + while (!def.finished()) { + int len = def.deflate(buf, 0, buf.length); + if (def.finished() && len <= buf.length - TRAILER_SIZE) { + // last deflater buffer. Fit trailer at the end + writeTrailer(buf, len); + len = len + TRAILER_SIZE; + out.write(buf, 0, len); + return; + } + if (len > 0) + out.write(buf, 0, len); } - if (len > 0) - out.write(buf, 0, len); + // if we can't fit the trailer at the end of the last + // deflater buffer, we write it separately + byte[] trailer = new byte[TRAILER_SIZE]; + writeTrailer(trailer, 0); + out.write(trailer); + } catch (IOException e) { + if (usesDefaultDeflater) + def.end(); + throw e; } - // if we can't fit the trailer at the end of the last - // deflater buffer, we write it separately - byte[] trailer = new byte[TRAILER_SIZE]; - writeTrailer(trailer, 0); - out.write(trailer); } } diff --git a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index c43bcd38103..8f562a135a7 100644 --- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -259,58 +259,64 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant public void closeEntry() throws IOException { ensureOpen(); if (current != null) { - ZipEntry e = current.entry; - switch (e.method) { - case DEFLATED -> { - def.finish(); - while (!def.finished()) { - deflate(); - } - if ((e.flag & 8) == 0) { - // verify size, compressed size, and crc-32 settings - if (e.size != def.getBytesRead()) { - throw new ZipException( - "invalid entry size (expected " + e.size + - " but got " + def.getBytesRead() + " bytes)"); - } - if (e.csize != def.getBytesWritten()) { - throw new ZipException( - "invalid entry compressed size (expected " + - e.csize + " but got " + def.getBytesWritten() + " bytes)"); + try { + ZipEntry e = current.entry; + switch (e.method) { + case DEFLATED -> { + def.finish(); + while (!def.finished()) { + deflate(); + } + if ((e.flag & 8) == 0) { + // verify size, compressed size, and crc-32 settings + if (e.size != def.getBytesRead()) { + throw new ZipException( + "invalid entry size (expected " + e.size + + " but got " + def.getBytesRead() + " bytes)"); + } + if (e.csize != def.getBytesWritten()) { + throw new ZipException( + "invalid entry compressed size (expected " + + e.csize + " but got " + def.getBytesWritten() + " bytes)"); + } + if (e.crc != crc.getValue()) { + throw new ZipException( + "invalid entry CRC-32 (expected 0x" + + Long.toHexString(e.crc) + " but got 0x" + + Long.toHexString(crc.getValue()) + ")"); + } + } else { + e.size = def.getBytesRead(); + e.csize = def.getBytesWritten(); + e.crc = crc.getValue(); + writeEXT(e); + } + def.reset(); + written += e.csize; } - if (e.crc != crc.getValue()) { - throw new ZipException( - "invalid entry CRC-32 (expected 0x" + - Long.toHexString(e.crc) + " but got 0x" + - Long.toHexString(crc.getValue()) + ")"); + case STORED -> { + // we already know that both e.size and e.csize are the same + if (e.size != written - locoff) { + throw new ZipException( + "invalid entry size (expected " + e.size + + " but got " + (written - locoff) + " bytes)"); + } + if (e.crc != crc.getValue()) { + throw new ZipException( + "invalid entry crc-32 (expected 0x" + + Long.toHexString(e.crc) + " but got 0x" + + Long.toHexString(crc.getValue()) + ")"); + } } - } else { - e.size = def.getBytesRead(); - e.csize = def.getBytesWritten(); - e.crc = crc.getValue(); - writeEXT(e); + default -> throw new ZipException("invalid compression method"); } - def.reset(); - written += e.csize; - } - case STORED -> { - // we already know that both e.size and e.csize are the same - if (e.size != written - locoff) { - throw new ZipException( - "invalid entry size (expected " + e.size + - " but got " + (written - locoff) + " bytes)"); - } - if (e.crc != crc.getValue()) { - throw new ZipException( - "invalid entry crc-32 (expected 0x" + - Long.toHexString(e.crc) + " but got 0x" + - Long.toHexString(crc.getValue()) + ")"); - } - } - default -> throw new ZipException("invalid compression method"); + crc.reset(); + current = null; + } catch (IOException e) { + if (usesDefaultDeflater && !(e instanceof ZipException)) + def.end(); + throw e; } - crc.reset(); - current = null; } } diff --git a/test/jdk/java/util/zip/CloseDeflaterTest.java b/test/jdk/java/util/zip/CloseDeflaterTest.java new file mode 100644 index 00000000000..8aa4960f543 --- /dev/null +++ b/test/jdk/java/util/zip/CloseDeflaterTest.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021, 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 8193682 + * @summary Test Infinite loop while writing on closed GZipOutputStream , ZipOutputStream and JarOutputStream. + * @run testng CloseDeflaterTest + */ +import java.io.*; +import java.util.Random; +import java.util.jar.JarOutputStream; +import java.util.zip.GZIPOutputStream; +import java.util.zip.ZipOutputStream; +import java.util.zip.ZipEntry; + +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import static org.testng.Assert.fail; + + +public class CloseDeflaterTest { + + //number of bytes to write + private static final int INPUT_LENGTH= 512; + //OutputStream that will throw an exception during a write operation + private static OutputStream outStream = new OutputStream() { + @Override + public void write(byte[] b, int off, int len) throws IOException { + //throw exception during write + throw new IOException(); + } + @Override + public void write(byte b[]) throws IOException {} + @Override + public void write(int b) throws IOException {} + }; + private static byte[] inputBytes = new byte[INPUT_LENGTH]; + private static Random rand = new Random(); + + @DataProvider(name = "testgzipinput") + public Object[][] testGZipInput() { + //testGZip will close the GZipOutputStream using close() method when the boolean + //useCloseMethod is set to true and finish() method if the value is set to false + return new Object[][] { + { GZIPOutputStream.class, true }, + { GZIPOutputStream.class, false }, + }; + } + + @DataProvider(name = "testzipjarinput") + public Object[][] testZipAndJarInput() { + //testZipAndJarInput will perfrom write/closeEntry operations on JarOutputStream when the boolean + //useJar is set to true and on ZipOutputStream if the value is set to false + return new Object[][] { + { JarOutputStream.class, true }, + { ZipOutputStream.class, false }, + }; + } + + @BeforeTest + public void before_test() + { + //add inputBytes array with random bytes to write into Zip + rand.nextBytes(inputBytes); + } + + //Test for infinite loop by writing bytes to closed GZIPOutputStream + @Test(dataProvider = "testgzipinput") + public void testGZip(Class type, boolean useCloseMethod) throws IOException { + GZIPOutputStream zip = new GZIPOutputStream(outStream); + try { + zip.write(inputBytes, 0, INPUT_LENGTH); + //close zip + if(useCloseMethod) { + zip.close(); + } else { + zip.finish(); + } + } catch (IOException e) { + //expected + } + for (int i = 0; i < 3; i++) { + try { + //write on a closed GZIPOutputStream + zip.write(inputBytes, 0, INPUT_LENGTH); + fail("Deflater closed exception not thrown"); + } catch (NullPointerException e) { + //expected , Deflater has been closed exception + } + } + } + + //Test for infinite loop by writing bytes to closed ZipOutputStream/JarOutputStream + @Test(dataProvider = "testzipjarinput") + public void testZipCloseEntry(Class type,boolean useJar) throws IOException { + ZipOutputStream zip = null; + if(useJar) { + zip = new JarOutputStream(outStream); + } else { + zip = new ZipOutputStream(outStream); + } + try { + zip.putNextEntry(new ZipEntry("")); + } catch (IOException e) { + //expected to throw IOException since putNextEntry calls write method + } + try { + zip.write(inputBytes, 0, INPUT_LENGTH); + //close zip entry + zip.closeEntry(); + } catch (IOException e) { + //expected + } + for (int i = 0; i < 3; i++) { + try { + //write on a closed ZipOutputStream + zip.write(inputBytes, 0, INPUT_LENGTH); + fail("Deflater closed exception not thrown"); + } catch (NullPointerException e) { + //expected , Deflater has been closed exception + } + } + } + +} -- GitLab From 9b3e67205913daa1960373a4ab33422137082696 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Wed, 1 Dec 2021 16:12:46 +0000 Subject: [PATCH 544/890] 8278014: [vectorapi] Remove test run script Reviewed-by: sviswanathan, jiefu, shade --- test/jdk/jdk/incubator/vector/build-tests.sh | 57 ------------- test/jdk/jdk/incubator/vector/clean.sh | 4 +- test/jdk/jdk/incubator/vector/config.sh | 5 +- test/jdk/jdk/incubator/vector/gen-tests.sh | 14 +--- test/jdk/jdk/incubator/vector/run-tests.sh | 86 -------------------- 5 files changed, 5 insertions(+), 161 deletions(-) delete mode 100644 test/jdk/jdk/incubator/vector/build-tests.sh delete mode 100644 test/jdk/jdk/incubator/vector/run-tests.sh diff --git a/test/jdk/jdk/incubator/vector/build-tests.sh b/test/jdk/jdk/incubator/vector/build-tests.sh deleted file mode 100644 index 69f0290ce26..00000000000 --- a/test/jdk/jdk/incubator/vector/build-tests.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018, 2020, 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# 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. -# - -. config.sh - -Log false "Building Vector API tests, $(date)\n" - -# For each type -for type in byte short int long float double -do - Type="$(tr '[:lower:]' '[:upper:]' <<< ${type:0:1})${type:1}" - - # For each size - for bits in 64 128 256 512 - do - vectorteststype=${typeprefix}${Type}${bits}VectorTests - # Compile - Log true "Compiling ${vectorteststype}... " - Log false "\n${JAVAC} -cp \"${VECTORTESTS_HOME_CP}$SEPARATOR${TESTNG_JAR}\" --add-modules=jdk.incubator.vector $vectorteststype.java 2>&1" - compilation=$(${JAVAC} -cp "${VECTORTESTS_HOME_CP}$SEPARATOR${TESTNG_JAR}" \ - --add-modules=jdk.incubator.vector $vectorteststype.java 2>&1) - if [[ $compilation == *"error"* ]]; then - Log true "$compilation\n" - exit -1 - else - Log false "$compilation\n" - fi - Log true "done\n" - done -done - -rm -fr build - - diff --git a/test/jdk/jdk/incubator/vector/clean.sh b/test/jdk/jdk/incubator/vector/clean.sh index f889a913623..7c177d80016 100644 --- a/test/jdk/jdk/incubator/vector/clean.sh +++ b/test/jdk/jdk/incubator/vector/clean.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, 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,4 +24,4 @@ # questions. # -rm -rf *.class build.log test-output +rm -rf build.log diff --git a/test/jdk/jdk/incubator/vector/config.sh b/test/jdk/jdk/incubator/vector/config.sh index c1447b2e9fd..15bfe647c3a 100644 --- a/test/jdk/jdk/incubator/vector/config.sh +++ b/test/jdk/jdk/incubator/vector/config.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, 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 @@ -35,9 +35,6 @@ SPP_CLASSNAME="build.tools.spp.Spp" SEPARATOR=":" TYPEPREFIX="" TEMPLATE_FILE="unit_tests.template" -TESTNG_JAR="${TESTNG_PLUGIN}/plugins/org.testng.source_6.13.1.r201712040515.jar" -TESTNG_RUN_JAR="${TESTNG_PLUGIN}/plugins/org.testng_6.13.1.r201712040515.jar" -JCOMMANDER_JAR="${TESTNG_PLUGIN}/plugins/com.beust.jcommander_1.72.0.jar" TEST_ITER_COUNT=100 PERF_TEMPLATE_FILE="perf_tests.template" diff --git a/test/jdk/jdk/incubator/vector/gen-tests.sh b/test/jdk/jdk/incubator/vector/gen-tests.sh index 0056f54868d..d02f0c519fe 100644 --- a/test/jdk/jdk/incubator/vector/gen-tests.sh +++ b/test/jdk/jdk/incubator/vector/gen-tests.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, 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 @@ -28,20 +28,10 @@ # You can regenerate the source files, # and you can clean them up. # FIXME: Move this script under $REPO/make/gensrc/ -list_mech_gen() { - ( # List MG files physically present - grep -il 'mechanically generated.*do not edit' $(find * -name \*.java -print) - # List MG files currently deleted (via --clean) - hg status -nd . - ) | egrep '(^|/)(Byte|Short|Int|Long|Float|Double)(Scalar|([0-9Max]+Vector)).*\.java$' -} case $* in '') CLASS_FILTER='*';; --generate*) CLASS_FILTER=${2-'*'};; ---clean) MG=$(list_mech_gen); set -x; rm -f $MG; exit;; ---revert) MG=$(list_mech_gen); set -x; hg revert $MG; exit;; ---list) list_mech_gen; exit;; ---help|*) echo "Usage: $0 [--generate [file] | --clean | --revert | --list]"; exit 1;; +--help|*) echo "Usage: $0 [--generate [file]]"; exit 1;; esac . config.sh diff --git a/test/jdk/jdk/incubator/vector/run-tests.sh b/test/jdk/jdk/incubator/vector/run-tests.sh deleted file mode 100644 index 0669a97c2e6..00000000000 --- a/test/jdk/jdk/incubator/vector/run-tests.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018, 2020, 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# 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. -# - -. config.sh - -POSITIONAL=() -while [[ $# -gt 0 ]] -do -key="$1" - -TESTS="" -DISABLE_VECTOR_INTRINSICS=false -case $key in - -t|--tests) - TESTS="$2" - echo "Tests set to $TESTS" - shift # past argument - shift # past value - ;; - -d|--disable-vector-intrinsics) - DISABLE_VECTOR_INTRINSICS=true - echo "Warning: Disabling Vector intrinsics..." - shift # past argument - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; -esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - - -if [ "$TESTS" == "" ]; then - # Run all the tests by default. - TESTS="Byte64VectorTests,Byte128VectorTests,Byte256VectorTests,Byte512VectorTests," - TESTS+="Int64VectorTests,Int128VectorTests,Int256VectorTests,Int512VectorTests," - TESTS+="Long64VectorTests,Long128VectorTests,Long256VectorTests,Long512VectorTests," - TESTS+="Short64VectorTests,Short128VectorTests,Short256VectorTests,Short512VectorTests," - TESTS+="Double64VectorTests,Double128VectorTests,Double256VectorTests,Double512VectorTests," - TESTS+="Float64VectorTests,Float128VectorTests,Float256VectorTests,Float512VectorTests" -fi - -# Get Java flags. -JAVA_FLAGS="-XX:-TieredCompilation" -if [ "$DISABLE_VECTOR_INTRINSICS" == "true" ]; then - JAVA_FLAGS+=" -XX:-UseVectorApiIntrinsics" -fi - -LogRun false "Running tests $(date)\n" -LogRun true "Running the following tests:\n" -LogRun true "${TESTS}\n" -LogRun false "${JAVA} -cp \"${VECTORTESTS_HOME_CP}${SEPARATOR}${TESTNG_RUN_JAR}${SEPARATOR}${JCOMMANDER_JAR}\" ${JAVA_FLAGS} --add-modules jdk.incubator.vector --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED org.testng.TestNG -testclass $TESTS" - -# Actual TestNG run. -time ${JAVA} -cp "${VECTORTESTS_HOME_CP}${SEPARATOR}${TESTNG_RUN_JAR}${SEPARATOR}${JCOMMANDER_JAR}" \ - ${JAVA_FLAGS} \ - --add-modules jdk.incubator.vector \ - --add-opens jdk.incubator.vector/jdk.incubator.vector=ALL-UNNAMED \ - -Djdk.incubator.vector.test.loop-iterations=${TEST_ITER_COUNT} \ - org.testng.TestNG -testclass $TESTS -LogRun true "Tests run complete. Please look at test-output/index.html to visualize the results.\n" - -- GitLab From a363b7b9217cbb9a7580a87b812da8d5a4215326 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 1 Dec 2021 17:14:53 +0000 Subject: [PATCH 545/890] 8177819: DateTimeFormatterBuilder zone parsing should recognise DST 8277049: ZonedDateTime parse in Fall DST transition fails to retain the correct zonename. Reviewed-by: joehw, scolebourne --- .../java/time/format/DateTimeFormatter.java | 14 +- .../time/format/DateTimeFormatterBuilder.java | 163 +++++------------- .../time/format/DateTimeParseContext.java | 20 ++- .../classes/java/time/format/Parsed.java | 15 +- .../format/TestZoneTextPrinterParser.java | 39 ++++- 5 files changed, 121 insertions(+), 130 deletions(-) diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java index c94b123b26c..063b6e14a00 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeFormatter.java +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ import java.time.Period; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.chrono.ChronoLocalDateTime; +import java.time.chrono.ChronoZonedDateTime; import java.time.chrono.Chronology; import java.time.chrono.IsoChronology; import java.time.format.DateTimeFormatterBuilder.CompositePrinterParser; @@ -373,15 +374,15 @@ import sun.util.locale.provider.TimeZoneNameUtility; * letters throws {@code IllegalArgumentException}. *

      * Zone names: This outputs the display name of the time-zone ID. If the - * pattern letter is 'z' the output is the daylight savings aware zone name. + * pattern letter is 'z' the output is the daylight saving aware zone name. * If there is insufficient information to determine whether DST applies, - * the name ignoring daylight savings time will be used. + * the name ignoring daylight saving time will be used. * If the count of letters is one, two or three, then the short name is output. * If the count of letters is four, then the full name is output. * Five or more letters throws {@code IllegalArgumentException}. *

      * If the pattern letter is 'v' the output provides the zone name ignoring - * daylight savings time. If the count of letters is one, then the short name is output. + * daylight saving time. If the count of letters is one, then the short name is output. * If the count of letters is four, then the full name is output. * Two, three and five or more letters throw {@code IllegalArgumentException}. *

      @@ -502,7 +503,10 @@ import sun.util.locale.provider.TimeZoneNameUtility; * {@code LocalDateTime} to form the instant, with any zone ignored. * If a {@code ZoneId} was parsed without an offset then the zone will be * combined with the {@code LocalDateTime} to form the instant using the rules - * of {@link ChronoLocalDateTime#atZone(ZoneId)}. + * of {@link ChronoLocalDateTime#atZone(ZoneId)}. If the {@code ZoneId} was + * parsed from a zone name that indicates whether daylight saving time is in + * operation or not, then that fact will be used to select the correct offset + * at the local time-line overlap. * * * @implSpec diff --git a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java index 7af964f106b..40c0de53d3f 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -4324,9 +4324,10 @@ public final class DateTimeFormatterBuilder { } } - private static final int STD = 0; - private static final int DST = 1; - private static final int GENERIC = 2; + static final int UNDEFINED = -1; + static final int STD = 0; + static final int DST = 1; + static final int GENERIC = 2; private static final Map>> cache = new ConcurrentHashMap<>(); @@ -4433,11 +4434,11 @@ public final class DateTimeFormatterBuilder { nonRegionIds.add(zid); continue; } - tree.add(zid, zid); // don't convert zid -> metazone + tree.add(zid, zid, UNDEFINED); // don't convert zid -> metazone zid = ZoneName.toZid(zid, locale); int i = textStyle == TextStyle.FULL ? 1 : 2; for (; i < names.length; i += 2) { - tree.add(names[i], zid); + tree.add(names[i], zid, (i - 1) / 2); } } @@ -4450,7 +4451,7 @@ public final class DateTimeFormatterBuilder { int i = textStyle == TextStyle.FULL ? 1 : 2; for (; i < cidNames.length; i += 2) { if (cidNames[i] != null && !cidNames[i].isEmpty()) { - t.add(cidNames[i], cid); + t.add(cidNames[i], cid, (i - 1) / 2); } } }); @@ -4465,7 +4466,7 @@ public final class DateTimeFormatterBuilder { } int i = textStyle == TextStyle.FULL ? 1 : 2; for (; i < names.length; i += 2) { - tree.add(names[i], zid); + tree.add(names[i], zid, (i - 1) / 2); } } } @@ -4571,15 +4572,16 @@ public final class DateTimeFormatterBuilder { // parse PrefixTree tree = getTree(context); ParsePosition ppos = new ParsePosition(position); - String parsedZoneId = tree.match(text, ppos); - if (parsedZoneId == null) { + PrefixTree parsedZoneId = tree.match(text, ppos); + if (parsedZoneId.value == null) { if (context.charEquals(nextChar, 'Z')) { context.setParsed(ZoneOffset.UTC); return position + 1; } return ~position; } - context.setParsed(ZoneId.of(parsedZoneId)); + context.setParsed(ZoneId.of(parsedZoneId.value)); + context.setParsedZoneNameType(parsedZoneId.type); return ppos.getIndex(); } @@ -4641,14 +4643,16 @@ public final class DateTimeFormatterBuilder { static class PrefixTree { protected String key; protected String value; + protected int type; protected char c0; // performance optimization to avoid the // boundary check cost of key.charat(0) protected PrefixTree child; protected PrefixTree sibling; - private PrefixTree(String k, String v, PrefixTree child) { + private PrefixTree(String k, String v, int type, PrefixTree child) { this.key = k; this.value = v; + this.type = type; this.child = child; if (k.isEmpty()) { c0 = 0xffff; @@ -4664,13 +4668,10 @@ public final class DateTimeFormatterBuilder { * @return the tree, not null */ public static PrefixTree newTree(DateTimeParseContext context) { - //if (!context.isStrict()) { - // return new LENIENT("", null, null); - //} if (context.isCaseSensitive()) { - return new PrefixTree("", null, null); + return new PrefixTree("", null, ZoneTextPrinterParser.UNDEFINED, null); } - return new CI("", null, null); + return new CI("", null, ZoneTextPrinterParser.UNDEFINED, null); } /** @@ -4683,7 +4684,7 @@ public final class DateTimeFormatterBuilder { public static PrefixTree newTree(Set keys, DateTimeParseContext context) { PrefixTree tree = newTree(context); for (String k : keys) { - tree.add0(k, k); + tree.add0(k, k, ZoneTextPrinterParser.UNDEFINED); } return tree; } @@ -4692,7 +4693,7 @@ public final class DateTimeFormatterBuilder { * Clone a copy of this tree */ public PrefixTree copyTree() { - PrefixTree copy = new PrefixTree(key, value, null); + PrefixTree copy = new PrefixTree(key, value, type, null); if (child != null) { copy.child = child.copyTree(); } @@ -4710,11 +4711,11 @@ public final class DateTimeFormatterBuilder { * @param v the value, not null * @return true if the pair is added successfully */ - public boolean add(String k, String v) { - return add0(k, v); + public boolean add(String k, String v, int t) { + return add0(k, v, t); } - private boolean add0(String k, String v) { + private boolean add0(String k, String v, int t) { k = toKey(k); int prefixLen = prefixLength(k); if (prefixLen == key.length()) { @@ -4723,12 +4724,12 @@ public final class DateTimeFormatterBuilder { PrefixTree c = child; while (c != null) { if (isEqual(c.c0, subKey.charAt(0))) { - return c.add0(subKey, v); + return c.add0(subKey, v, t); } c = c.sibling; } // add the node as the child of the current node - c = newNode(subKey, v, null); + c = newNode(subKey, v, t, null); c.sibling = child; child = c; return true; @@ -4738,18 +4739,20 @@ public final class DateTimeFormatterBuilder { // return false; //} value = v; + type = t; return true; } // split the existing node - PrefixTree n1 = newNode(key.substring(prefixLen), value, child); + PrefixTree n1 = newNode(key.substring(prefixLen), value, type, child); key = k.substring(0, prefixLen); child = n1; if (prefixLen < k.length()) { - PrefixTree n2 = newNode(k.substring(prefixLen), v, null); + PrefixTree n2 = newNode(k.substring(prefixLen), v, t, null); child.sibling = n2; value = null; } else { value = v; + type = t; } return true; } @@ -4760,9 +4763,9 @@ public final class DateTimeFormatterBuilder { * @param text the input text to parse, not null * @param off the offset position to start parsing at * @param end the end position to stop parsing - * @return the resulting string, or null if no match found. + * @return the resulting tree, or null if no match found. */ - public String match(CharSequence text, int off, int end) { + public PrefixTree match(CharSequence text, int off, int end) { if (!prefixOf(text, off, end)){ return null; } @@ -4770,16 +4773,16 @@ public final class DateTimeFormatterBuilder { PrefixTree c = child; do { if (isEqual(c.c0, text.charAt(off))) { - String found = c.match(text, off, end); + PrefixTree found = c.match(text, off, end); if (found != null) { return found; } - return value; + return this; } c = c.sibling; } while (c != null); } - return value; + return this; } /** @@ -4789,9 +4792,9 @@ public final class DateTimeFormatterBuilder { * @param pos the position to start parsing at, from 0 to the text * length. Upon return, position will be updated to the new parse * position, or unchanged, if no match found. - * @return the resulting string, or null if no match found. + * @return the resulting tree, or null if no match found. */ - public String match(CharSequence text, ParsePosition pos) { + public PrefixTree match(CharSequence text, ParsePosition pos) { int off = pos.getIndex(); int end = text.length(); if (!prefixOf(text, off, end)){ @@ -4803,7 +4806,7 @@ public final class DateTimeFormatterBuilder { do { if (isEqual(c.c0, text.charAt(off))) { pos.setIndex(off); - String found = c.match(text, pos); + PrefixTree found = c.match(text, pos); if (found != null) { return found; } @@ -4813,15 +4816,15 @@ public final class DateTimeFormatterBuilder { } while (c != null); } pos.setIndex(off); - return value; + return this; } protected String toKey(String k) { return k; } - protected PrefixTree newNode(String k, String v, PrefixTree child) { - return new PrefixTree(k, v, child); + protected PrefixTree newNode(String k, String v, int t, PrefixTree child) { + return new PrefixTree(k, v, t, child); } protected boolean isEqual(char c1, char c2) { @@ -4861,13 +4864,13 @@ public final class DateTimeFormatterBuilder { */ private static class CI extends PrefixTree { - private CI(String k, String v, PrefixTree child) { - super(k, v, child); + private CI(String k, String v, int t, PrefixTree child) { + super(k, v, t, child); } @Override - protected CI newNode(String k, String v, PrefixTree child) { - return new CI(k, v, child); + protected CI newNode(String k, String v, int t, PrefixTree child) { + return new CI(k, v, t, child); } @Override @@ -4890,86 +4893,6 @@ public final class DateTimeFormatterBuilder { return true; } } - - /** - * Lenient prefix tree. Case insensitive and ignores characters - * like space, underscore and slash. - */ - private static class LENIENT extends CI { - - private LENIENT(String k, String v, PrefixTree child) { - super(k, v, child); - } - - @Override - protected CI newNode(String k, String v, PrefixTree child) { - return new LENIENT(k, v, child); - } - - private boolean isLenientChar(char c) { - return c == ' ' || c == '_' || c == '/'; - } - - protected String toKey(String k) { - for (int i = 0; i < k.length(); i++) { - if (isLenientChar(k.charAt(i))) { - StringBuilder sb = new StringBuilder(k.length()); - sb.append(k, 0, i); - i++; - while (i < k.length()) { - if (!isLenientChar(k.charAt(i))) { - sb.append(k.charAt(i)); - } - i++; - } - return sb.toString(); - } - } - return k; - } - - @Override - public String match(CharSequence text, ParsePosition pos) { - int off = pos.getIndex(); - int end = text.length(); - int len = key.length(); - int koff = 0; - while (koff < len && off < end) { - if (isLenientChar(text.charAt(off))) { - off++; - continue; - } - if (!isEqual(key.charAt(koff++), text.charAt(off++))) { - return null; - } - } - if (koff != len) { - return null; - } - if (child != null && off != end) { - int off0 = off; - while (off0 < end && isLenientChar(text.charAt(off0))) { - off0++; - } - if (off0 < end) { - PrefixTree c = child; - do { - if (isEqual(c.c0, text.charAt(off0))) { - pos.setIndex(off0); - String found = c.match(text, pos); - if (found != null) { - return found; - } - break; - } - c = c.sibling; - } while (c != null); - } - } - pos.setIndex(off); - return value; - } - } } //----------------------------------------------------------------------- diff --git a/src/java.base/share/classes/java/time/format/DateTimeParseContext.java b/src/java.base/share/classes/java/time/format/DateTimeParseContext.java index 32eefcecc30..0a4c7e825a3 100644 --- a/src/java.base/share/classes/java/time/format/DateTimeParseContext.java +++ b/src/java.base/share/classes/java/time/format/DateTimeParseContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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 @@ -417,6 +417,24 @@ final class DateTimeParseContext { currentParsed().zone = zone; } + /** + * Stores the parsed zone name type. + *

      + * This stores the zone name type that has been parsed. + * The parsed type should either be; + *

        + *
      • {@link DateTimeFormatterBuilder.ZoneTextPrinterParser#UNDEFINED}
      • + *
      • {@link DateTimeFormatterBuilder.ZoneTextPrinterParser#STD}
      • + *
      • {@link DateTimeFormatterBuilder.ZoneTextPrinterParser#DST}
      • + *
      • {@link DateTimeFormatterBuilder.ZoneTextPrinterParser#GENERIC}
      • + *
      + * + * @param type the parsed zone name type + */ + void setParsedZoneNameType(int type) { + currentParsed().zoneNameType = type; + } + /** * Stores the parsed leap second. */ diff --git a/src/java.base/share/classes/java/time/format/Parsed.java b/src/java.base/share/classes/java/time/format/Parsed.java index 567c2700a15..1ec956dfa2c 100644 --- a/src/java.base/share/classes/java/time/format/Parsed.java +++ b/src/java.base/share/classes/java/time/format/Parsed.java @@ -87,6 +87,7 @@ import java.time.LocalTime; import java.time.Period; import java.time.ZoneId; import java.time.ZoneOffset; +import java.time.ZonedDateTime; import java.time.chrono.ChronoLocalDate; import java.time.chrono.ChronoLocalDateTime; import java.time.chrono.ChronoZonedDateTime; @@ -132,6 +133,10 @@ final class Parsed implements TemporalAccessor { * The parsed zone. */ ZoneId zone; + /** + * The parsed zone name type. + */ + int zoneNameType = DateTimeFormatterBuilder.ZoneTextPrinterParser.UNDEFINED; /** * The parsed chronology. */ @@ -175,6 +180,7 @@ final class Parsed implements TemporalAccessor { Parsed cloned = new Parsed(); cloned.fieldValues.putAll(this.fieldValues); cloned.zone = this.zone; + cloned.zoneNameType = this.zoneNameType; cloned.chrono = this.chrono; cloned.leapSecond = this.leapSecond; cloned.dayPeriod = this.dayPeriod; @@ -652,8 +658,12 @@ final class Parsed implements TemporalAccessor { fieldValues.put(INSTANT_SECONDS, instant); } else { if (zone != null) { - long instant = date.atTime(time).atZone(zone).toEpochSecond(); - fieldValues.put(INSTANT_SECONDS, instant); + var czdt = date.atTime(time).atZone(zone); + if (zoneNameType == DateTimeFormatterBuilder.ZoneTextPrinterParser.STD || + zoneNameType == DateTimeFormatterBuilder.ZoneTextPrinterParser.GENERIC) { + czdt = czdt.withLaterOffsetAtOverlap(); + } + fieldValues.put(INSTANT_SECONDS, czdt.toEpochSecond()); } } } @@ -718,6 +728,7 @@ final class Parsed implements TemporalAccessor { buf.append(fieldValues).append(',').append(chrono); if (zone != null) { buf.append(',').append(zone); + buf.append(',').append(zoneNameType); } if (date != null || time != null) { buf.append(" resolved to "); diff --git a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java index 77ccf37ad56..7981d769907 100644 --- a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2021, 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,10 +24,12 @@ package test.java.time.format; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; import java.text.DateFormatSymbols; import java.time.ZoneId; import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; import java.time.format.DecimalStyle; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; @@ -49,7 +51,7 @@ import org.testng.annotations.Test; /* * @test - * @bug 8081022 8151876 8166875 8189784 8206980 + * @bug 8081022 8151876 8166875 8177819 8189784 8206980 8277049 * @key randomness */ @@ -236,4 +238,37 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { .withDecimalStyle(DecimalStyle.of(locale)); } + @DataProvider(name="roundTripAtOverlap") + Object[][] data_roundTripAtOverlap() { + return new Object[][] { + {"yyyy-MM-dd HH:mm:ss.SSS z", "2021-10-31 02:30:00.000 CET"}, + {"yyyy-MM-dd HH:mm:ss.SSS z", "2021-10-31 02:30:00.000 CEST"}, + {"yyyy-MM-dd HH:mm:ss.SSS z", "2021-11-07 01:30:00.000 EST"}, + {"yyyy-MM-dd HH:mm:ss.SSS z", "2021-11-07 01:30:00.000 EDT"}, + {"yyyy-MM-dd HH:mm:ss.SSS zzzz", "2021-10-31 02:30:00.000 Central European Standard Time"}, + {"yyyy-MM-dd HH:mm:ss.SSS zzzz", "2021-10-31 02:30:00.000 Central European Summer Time"}, + {"yyyy-MM-dd HH:mm:ss.SSS zzzz", "2021-11-07 01:30:00.000 Eastern Standard Time"}, + {"yyyy-MM-dd HH:mm:ss.SSS zzzz", "2021-11-07 01:30:00.000 Eastern Daylight Time"}, + + {"yyyy-MM-dd HH:mm:ss.SSS v", "2021-10-31 02:30:00.000 CET"}, + {"yyyy-MM-dd HH:mm:ss.SSS v", "2021-11-07 01:30:00.000 ET"}, + {"yyyy-MM-dd HH:mm:ss.SSS vvvv", "2021-10-31 02:30:00.000 Central European Time"}, + {"yyyy-MM-dd HH:mm:ss.SSS vvvv", "2021-11-07 01:30:00.000 Eastern Time"}, + }; + } + + @Test(dataProvider="roundTripAtOverlap") + public void test_roundTripAtOverlap(String pattern, String input) { + var dtf = DateTimeFormatter.ofPattern(pattern); + assertEquals(dtf.format(ZonedDateTime.parse(input, dtf)), input); + var lc = input.toLowerCase(Locale.ROOT); + try { + ZonedDateTime.parse(lc, dtf); + fail("Should throw DateTimeParseException"); + } catch (DateTimeParseException ignore) {} + + dtf = new DateTimeFormatterBuilder().parseCaseInsensitive().appendPattern(pattern).toFormatter(); + assertEquals(dtf.format(ZonedDateTime.parse(input, dtf)), input); + assertEquals(dtf.format(ZonedDateTime.parse(lc, dtf)), input); + } } -- GitLab From f41e768bba2b2ce3b3cc5813ccb1ac4984dcefbd Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Wed, 1 Dec 2021 18:13:16 +0000 Subject: [PATCH 546/890] 8277762: Allow configuration of HOTSPOT_BUILD_USER Reviewed-by: erikj --- make/autoconf/basic.m4 | 7 +------ make/autoconf/jdk-version.m4 | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/make/autoconf/basic.m4 b/make/autoconf/basic.m4 index 60b4097cba9..e7fdab53050 100644 --- a/make/autoconf/basic.m4 +++ b/make/autoconf/basic.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2021, 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 @@ -94,11 +94,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/make/autoconf - - # Setup username (for use in adhoc version strings etc) - # Outer [ ] to quote m4. - [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] - AC_SUBST(USERNAME) ]) ############################################################################### diff --git a/make/autoconf/jdk-version.m4 b/make/autoconf/jdk-version.m4 index 60405d67bcb..5312624d90c 100644 --- a/make/autoconf/jdk-version.m4 +++ b/make/autoconf/jdk-version.m4 @@ -69,6 +69,17 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], AC_SUBST(JDK_RC_PLATFORM_NAME) AC_SUBST(HOTSPOT_VM_DISTRO) + # Setup username (for use in adhoc version strings etc) + AC_ARG_WITH([build-user], [AS_HELP_STRING([--with-build-user], + [build username to use in version strings])]) + if test "x$with_build_user" != x; then + USERNAME="$with_build_user" + else + # Outer [ ] to quote m4. + [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] + fi + AC_SUBST(USERNAME) + # Set the JDK RC name AC_ARG_WITH(jdk-rc-name, [AS_HELP_STRING([--with-jdk-rc-name], [Set JDK RC name. This is used for FileDescription and ProductName properties -- GitLab From 0dfb3a705d2ad0ce4ac0f7dd18fb65d7ae735f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 1 Dec 2021 18:19:26 +0000 Subject: [PATCH 547/890] 8268582: javadoc throws NPE with --ignore-source-errors option Reviewed-by: jjg --- .../internal/doclets/toolkit/util/Utils.java | 7 +++++-- .../jdk/javadoc/tool/IgnoreSourceErrors.java | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java index 4d289797bcf..ec7b14c5b4f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java @@ -2893,8 +2893,11 @@ public class Utils { } public PreviewSummary declaredUsingPreviewAPIs(Element el) { - List usedInDeclaration = new ArrayList<>(); - usedInDeclaration.addAll(annotations2Classes(el)); + if (el.asType().getKind() == ERROR) { + // Can happen with undocumented --ignore-source-errors option + return new PreviewSummary(Collections.emptySet(), Collections.emptySet(), Collections.emptySet()); + } + List usedInDeclaration = new ArrayList<>(annotations2Classes(el)); switch (el.getKind()) { case ANNOTATION_TYPE, CLASS, ENUM, INTERFACE, RECORD -> { TypeElement te = (TypeElement) el; diff --git a/test/langtools/jdk/javadoc/tool/IgnoreSourceErrors.java b/test/langtools/jdk/javadoc/tool/IgnoreSourceErrors.java index 6c79492db05..44e698d7a88 100644 --- a/test/langtools/jdk/javadoc/tool/IgnoreSourceErrors.java +++ b/test/langtools/jdk/javadoc/tool/IgnoreSourceErrors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8175219 + * @bug 8175219 8268582 * @summary test --ignore-errors works correctly * @modules * jdk.javadoc/jdk.javadoc.internal.api @@ -73,6 +73,12 @@ public class IgnoreSourceErrors extends TestRunner { if (!out.contains("modifier static not allowed here")) { throw new Exception("expected string not found \'modifier static not allowed here\'"); } + if (!out.contains("package invalid.example does not exist")) { + throw new Exception("expected string not found \'package invalid.example does not exist\'"); + } + if (!out.contains("cannot find symbol")) { + throw new Exception("expected string not found \'cannot find symbol\'"); + } } @Test @@ -84,12 +90,19 @@ public class IgnoreSourceErrors extends TestRunner { if (!out.contains("modifier static not allowed here")) { throw new Exception("expected string not found \'modifier static not allowed here\'"); } + if (!out.contains("package invalid.example does not exist")) { + throw new Exception("expected string not found \'package invalid.example does not exist\'"); + } + if (!out.contains("cannot find symbol")) { + throw new Exception("expected string not found \'cannot find symbol\'"); + } } void emitSample(Path file) throws IOException { String[] contents = { "/** A java file with errors */", - "public static class Foo {}" + "import invalid.example.OtherClass;", + "public static class Foo extends OtherClass {}" }; Files.write(file, Arrays.asList(contents), StandardOpenOption.CREATE); } -- GitLab From 51d6d7a36b760b2b2b77269cc06438108a9931a2 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Wed, 1 Dec 2021 20:21:38 +0000 Subject: [PATCH 548/890] 8266839: Enable pandoc on macosx-aarch64 at Oracle Reviewed-by: erikj --- make/conf/jib-profiles.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 80228aa7188..24aeea9893d 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -450,7 +450,7 @@ var getJibProfilesProfiles = function (input, common, data) { "macosx-aarch64": { target_os: "macosx", target_cpu: "aarch64", - dependencies: ["devkit", "gtest"], + dependencies: ["devkit", "gtest", "pandoc"], configure_args: concat(common.configure_args_64bit, "--with-zlib=system", "--with-macosx-version-max=11.00.00"), }, @@ -1100,6 +1100,17 @@ var getJibProfilesDependencies = function (input, common) { environment_path: common.boot_jdk_home + "/bin" } + var pandoc_version; + if (input.build_cpu == "aarch64") { + if (input.build_os == "macosx") { + pandoc_version = "2.14.0.2+1.0"; + } else { + pandoc_version = "2.5+1.0"; + } + } else { + pandoc_version = "2.3.1+1.0"; + } + var makeBinDir = (input.build_os == "windows" ? input.get("gnumake", "install_path") + "/cygwin/bin" : input.get("gnumake", "install_path") + "/bin"); @@ -1212,7 +1223,7 @@ var getJibProfilesDependencies = function (input, common) { pandoc: { organization: common.organization, ext: "tar.gz", - revision: (input.build_cpu == 'aarch64' ? "2.5+1.0" : "2.3.1+1.0"), + revision: pandoc_version, module: "pandoc-" + input.build_platform, configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc", environment_path: input.get("pandoc", "install_path") + "/pandoc" -- GitLab From 67745fa749e5075b37aeca7db9d446bc287da835 Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Thu, 2 Dec 2021 01:06:45 +0000 Subject: [PATCH 549/890] 8276299: G1: Unify the wording buffer/node/element in G1SegmentedArrayXxx, G1CardSetXxx and related classes Reviewed-by: tschatzl, ayang, iwalulya --- src/hotspot/share/gc/g1/g1Arguments.cpp | 2 +- src/hotspot/share/gc/g1/g1CardSet.cpp | 22 +- .../share/gc/g1/g1CardSetContainers.hpp | 4 +- .../gc/g1/g1CardSetContainers.inline.hpp | 40 ++-- src/hotspot/share/gc/g1/g1CardSetMemory.cpp | 104 ++++----- src/hotspot/share/gc/g1/g1CardSetMemory.hpp | 78 +++---- .../share/gc/g1/g1CardSetMemory.inline.hpp | 38 ++-- .../share/gc/g1/g1EvacFailureObjectsSet.cpp | 16 +- .../share/gc/g1/g1EvacFailureObjectsSet.hpp | 6 +- src/hotspot/share/gc/g1/g1RemSetSummary.cpp | 2 +- src/hotspot/share/gc/g1/g1SegmentedArray.hpp | 176 ++++++++-------- .../share/gc/g1/g1SegmentedArray.inline.hpp | 198 +++++++++--------- .../share/gc/g1/g1SegmentedArrayFreePool.cpp | 22 +- .../share/gc/g1/g1SegmentedArrayFreePool.hpp | 24 +-- 14 files changed, 367 insertions(+), 365 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp index 1af2aebc7d2..912ab253de6 100644 --- a/src/hotspot/share/gc/g1/g1Arguments.cpp +++ b/src/hotspot/share/gc/g1/g1Arguments.cpp @@ -143,7 +143,7 @@ void G1Arguments::initialize_card_set_configuration() { // Round to next 8 byte boundary for array to maximize space usage. size_t const cur_size = G1CardSetArray::size_in_bytes(G1RemSetArrayOfCardsEntries); FLAG_SET_ERGO(G1RemSetArrayOfCardsEntries, - G1RemSetArrayOfCardsEntries + (uint)(align_up(cur_size, G1CardSetAllocOptions::BufferAlignment) - cur_size) / sizeof(G1CardSetArray::EntryDataType)); + G1RemSetArrayOfCardsEntries + (uint)(align_up(cur_size, G1CardSetAllocOptions::SlotAlignment) - cur_size) / sizeof(G1CardSetArray::EntryDataType)); // Howl card set container globals. if (FLAG_IS_DEFAULT(G1RemSetHowlNumBuckets)) { diff --git a/src/hotspot/share/gc/g1/g1CardSet.cpp b/src/hotspot/share/gc/g1/g1CardSet.cpp index 370e6a06dca..ad886b1e7e6 100644 --- a/src/hotspot/share/gc/g1/g1CardSet.cpp +++ b/src/hotspot/share/gc/g1/g1CardSet.cpp @@ -125,10 +125,10 @@ void G1CardSetConfiguration::init_card_set_alloc_options() { void G1CardSetConfiguration::log_configuration() { log_debug_p(gc, remset)("Card Set container configuration: " - "InlinePtr #elems %u size %zu " - "Array Of Cards #elems %u size %zu " + "InlinePtr #cards %u size %zu " + "Array Of Cards #cards %u size %zu " "Howl #buckets %u coarsen threshold %u " - "Howl Bitmap #elems %u size %zu coarsen threshold %u " + "Howl Bitmap #cards %u size %zu coarsen threshold %u " "Card regions per heap region %u cards per card region %u", max_cards_in_inline_ptr(), sizeof(void*), max_cards_in_array(), G1CardSetArray::size_in_bytes(max_cards_in_array()), @@ -199,8 +199,8 @@ void G1CardSetCoarsenStats::print_on(outputStream* out) { class G1CardSetHashTable : public CHeapObj { using CardSetPtr = G1CardSet::CardSetPtr; - // Did we insert at least one element in the table? - bool volatile _inserted_elem; + // Did we insert at least one card in the table? + bool volatile _inserted_card; G1CardSetMemoryManager* _mm; CardSetHash _table; @@ -247,7 +247,7 @@ public: G1CardSetHashTable(G1CardSetMemoryManager* mm, size_t initial_log_table_size = InitialLogTableSize) : - _inserted_elem(false), + _inserted_card(false), _mm(mm), _table(mm, initial_log_table_size) { } @@ -267,10 +267,10 @@ public: G1CardSetHashTableValue value(region_idx, G1CardSetInlinePtr()); bool inserted = _table.insert_get(Thread::current(), lookup, value, found, should_grow); - if (!_inserted_elem && inserted) { + if (!_inserted_card && inserted) { // It does not matter to us who is setting the flag so a regular atomic store // is sufficient. - Atomic::store(&_inserted_elem, true); + Atomic::store(&_inserted_card, true); } return found.value(); @@ -295,9 +295,9 @@ public: } void reset() { - if (Atomic::load(&_inserted_elem)) { + if (Atomic::load(&_inserted_card)) { _table.unsafe_reset(InitialLogTableSize); - Atomic::store(&_inserted_elem, false); + Atomic::store(&_inserted_card, false); } } @@ -630,7 +630,7 @@ void G1CardSet::transfer_cards_in_howl(CardSetPtr parent_card_set, // Need to correct for that the Full remembered set occupies more cards than the // bitmap before. - // We add 1 element less because the values will be incremented + // We add 1 card less because the values will be incremented // in G1CardSet::add_card for the current addition or where already incremented in // G1CardSet::add_to_howl after coarsening. diff -= 1; diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp index 0c6270d228f..b74a68c84ae 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.hpp @@ -95,7 +95,7 @@ class G1CardSetInlinePtr : public StackObj { return result; } - uint find(uint const card_idx, uint const bits_per_card, uint start_at, uint num_elems); + uint find(uint const card_idx, uint const bits_per_card, uint start_at, uint num_cards); public: G1CardSetInlinePtr() : _value_addr(nullptr), _value((CardSetPtr)G1CardSet::CardSetInlinePtr) { } @@ -218,7 +218,7 @@ private: } public: - G1CardSetArray(uint const card_in_region, EntryCountType num_elems); + G1CardSetArray(uint const card_in_region, EntryCountType num_cards); G1AddCardResult add(uint card_idx); diff --git a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp index 7390afc12dd..df0e43f0d84 100644 --- a/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetContainers.inline.hpp @@ -50,19 +50,19 @@ inline G1AddCardResult G1CardSetInlinePtr::add(uint card_idx, uint bits_per_card uint cur_idx = 0; while (true) { - uint num_elems = num_cards_in(_value); - if (num_elems > 0) { - cur_idx = find(card_idx, bits_per_card, cur_idx, num_elems); + uint num_cards = num_cards_in(_value); + if (num_cards > 0) { + cur_idx = find(card_idx, bits_per_card, cur_idx, num_cards); } // Check if the card is already stored in the pointer. - if (cur_idx < num_elems) { + if (cur_idx < num_cards) { return Found; } // Check if there is actually enough space. - if (num_elems >= max_cards_in_inline_ptr) { + if (num_cards >= max_cards_in_inline_ptr) { return Overflow; } - CardSetPtr new_value = merge(_value, card_idx, num_elems, bits_per_card); + CardSetPtr new_value = merge(_value, card_idx, num_cards, bits_per_card); CardSetPtr old_value = Atomic::cmpxchg(_value_addr, _value, new_value, memory_order_relaxed); if (_value == old_value) { return Added; @@ -77,38 +77,38 @@ inline G1AddCardResult G1CardSetInlinePtr::add(uint card_idx, uint bits_per_card } } -inline uint G1CardSetInlinePtr::find(uint card_idx, uint bits_per_card, uint start_at, uint num_elems) { - assert(start_at < num_elems, "Precondition!"); +inline uint G1CardSetInlinePtr::find(uint card_idx, uint bits_per_card, uint start_at, uint num_cards) { + assert(start_at < num_cards, "Precondition!"); uintptr_t const card_mask = (1 << bits_per_card) - 1; uintptr_t value = ((uintptr_t)_value) >> card_pos_for(start_at, bits_per_card); // Check if the card is already stored in the pointer. - for (uint cur_idx = start_at; cur_idx < num_elems; cur_idx++) { + for (uint cur_idx = start_at; cur_idx < num_cards; cur_idx++) { if ((value & card_mask) == card_idx) { return cur_idx; } value >>= bits_per_card; } - return num_elems; + return num_cards; } inline bool G1CardSetInlinePtr::contains(uint card_idx, uint bits_per_card) { - uint num_elems = num_cards_in(_value); - if (num_elems == 0) { + uint num_cards = num_cards_in(_value); + if (num_cards == 0) { return false; } - uint cur_idx = find(card_idx, bits_per_card, 0, num_elems); - return cur_idx < num_elems; + uint cur_idx = find(card_idx, bits_per_card, 0, num_cards); + return cur_idx < num_cards; } template inline void G1CardSetInlinePtr::iterate(CardVisitor& found, uint bits_per_card) { - uint const num_elems = num_cards_in(_value); + uint const num_cards = num_cards_in(_value); uintptr_t const card_mask = (1 << bits_per_card) - 1; uintptr_t value = ((uintptr_t)_value) >> card_pos_for(0, bits_per_card); - for (uint cur_idx = 0; cur_idx < num_elems; cur_idx++) { + for (uint cur_idx = 0; cur_idx < num_cards; cur_idx++) { found(value & card_mask); value >>= bits_per_card; } @@ -136,9 +136,9 @@ inline uintptr_t G1CardSetContainer::decrement_refcount() { return Atomic::sub(&_ref_count, 2u); } -inline G1CardSetArray::G1CardSetArray(uint card_in_region, EntryCountType num_elems) : +inline G1CardSetArray::G1CardSetArray(uint card_in_region, EntryCountType num_cards) : G1CardSetContainer(), - _size(num_elems), + _size(num_cards), _num_entries(1) { assert(_size > 0, "CardSetArray of size 0 not supported."); assert(_size < LockBitMask, "Only support CardSetArray of size %u or smaller.", LockBitMask - 1); @@ -166,7 +166,7 @@ inline G1CardSetArray::G1CardSetArrayLocker::G1CardSetArrayLocker(EntryCountType inline G1AddCardResult G1CardSetArray::add(uint card_idx) { assert(card_idx < (1u << (sizeof(_data[0]) * BitsPerByte)), - "Card index %u does not fit card element.", card_idx); + "Card index %u does not fit allowed card value range.", card_idx); EntryCountType num_entries = Atomic::load_acquire(&_num_entries) & EntryMask; EntryCountType idx = 0; for (; idx < num_entries; idx++) { @@ -181,7 +181,7 @@ inline G1AddCardResult G1CardSetArray::add(uint card_idx) { // Reload number of entries from the G1CardSetArrayLocker as it might have changed. // It already read the actual value with the necessary synchronization. num_entries = x.num_entries(); - // Look if the elements added while waiting for the lock are the same as our card. + // Look if the cards added while waiting for the lock are the same as our card. for (; idx < num_entries; idx++) { if (_data[idx] == card_idx) { return Found; diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp index f48311a504c..85b4250090a 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.cpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.cpp @@ -30,28 +30,28 @@ #include "runtime/atomic.hpp" #include "utilities/ostream.hpp" -template -G1CardSetAllocator::G1CardSetAllocator(const char* name, - const G1CardSetAllocOptions* buffer_options, - G1CardSetBufferList* free_buffer_list) : - _segmented_array(buffer_options, free_buffer_list), +template +G1CardSetAllocator::G1CardSetAllocator(const char* name, + const G1CardSetAllocOptions* alloc_options, + G1CardSetFreeList* free_segment_list) : + _segmented_array(alloc_options, free_segment_list), _transfer_lock(false), - _free_nodes_list(), - _pending_nodes_list(), - _num_pending_nodes(0), - _num_free_nodes(0) + _free_slots_list(), + _pending_slots_list(), + _num_pending_slots(0), + _num_free_slots(0) { - uint elem_size = _segmented_array.elem_size(); - assert(elem_size >= sizeof(G1CardSetContainer), "Element instance size %u for allocator %s too small", elem_size, name); + uint slot_size = _segmented_array.slot_size(); + assert(slot_size >= sizeof(G1CardSetContainer), "Slot instance size %u for allocator %s too small", slot_size, name); } -template -G1CardSetAllocator::~G1CardSetAllocator() { +template +G1CardSetAllocator::~G1CardSetAllocator() { drop_all(); } -template -bool G1CardSetAllocator::try_transfer_pending() { +template +bool G1CardSetAllocator::try_transfer_pending() { // Attempt to claim the lock. if (Atomic::load_acquire(&_transfer_lock) || // Skip CAS if likely to fail. Atomic::cmpxchg(&_transfer_lock, false, true)) { @@ -59,13 +59,13 @@ bool G1CardSetAllocator::try_transfer_pending() { } // Have the lock; perform the transfer. - // Claim all the pending nodes. - G1CardSetContainer* first = _pending_nodes_list.pop_all(); + // Claim all the pending slots. + G1CardSetContainer* first = _pending_slots_list.pop_all(); if (first != nullptr) { - // Prepare to add the claimed nodes, and update _num_pending_nodes. + // Prepare to add the claimed slots, and update _num_pending_slots. G1CardSetContainer* last = first; - Atomic::load_acquire(&_num_pending_nodes); + Atomic::load_acquire(&_num_pending_slots); uint count = 1; for (G1CardSetContainer* next = first->next(); next != nullptr; next = next->next()) { @@ -73,70 +73,70 @@ bool G1CardSetAllocator::try_transfer_pending() { ++count; } - Atomic::sub(&_num_pending_nodes, count); + Atomic::sub(&_num_pending_slots, count); // Wait for any in-progress pops to avoid ABA for them. GlobalCounter::write_synchronize(); - // Add synchronized nodes to _free_node_list. + // Add synchronized slots to _free_slots_list. // Update count first so there can be no underflow in allocate(). - Atomic::add(&_num_free_nodes, count); - _free_nodes_list.prepend(*first, *last); + Atomic::add(&_num_free_slots, count); + _free_slots_list.prepend(*first, *last); } Atomic::release_store(&_transfer_lock, false); return true; } -template -void G1CardSetAllocator::free(Elem* elem) { - assert(elem != nullptr, "precondition"); +template +void G1CardSetAllocator::free(Slot* slot) { + assert(slot != nullptr, "precondition"); // Desired minimum transfer batch size. There is relatively little // importance to the specific number. It shouldn't be too big, else // we're wasting space when the release rate is low. If the release // rate is high, we might accumulate more than this before being // able to start a new transfer, but that's okay. Also note that // the allocation rate and the release rate are going to be fairly - // similar, due to how the buffers are used. - kbarret + // similar, due to how the slots are used. - kbarret uint const trigger_transfer = 10; - uint pending_count = Atomic::add(&_num_pending_nodes, 1u, memory_order_relaxed); + uint pending_count = Atomic::add(&_num_pending_slots, 1u, memory_order_relaxed); - G1CardSetContainer* node = reinterpret_cast(reinterpret_cast(elem)); + G1CardSetContainer* container = reinterpret_cast(reinterpret_cast(slot)); - node->set_next(nullptr); - assert(node->next() == nullptr, "precondition"); + container->set_next(nullptr); + assert(container->next() == nullptr, "precondition"); - _pending_nodes_list.push(*node); + _pending_slots_list.push(*container); if (pending_count > trigger_transfer) { try_transfer_pending(); } } -template -void G1CardSetAllocator::drop_all() { - _free_nodes_list.pop_all(); - _pending_nodes_list.pop_all(); - _num_pending_nodes = 0; - _num_free_nodes = 0; +template +void G1CardSetAllocator::drop_all() { + _free_slots_list.pop_all(); + _pending_slots_list.pop_all(); + _num_pending_slots = 0; + _num_free_slots = 0; _segmented_array.drop_all(); } -template -void G1CardSetAllocator::print(outputStream* os) { - uint num_allocated_nodes = _segmented_array.num_allocated_nodes(); - uint num_available_nodes = _segmented_array.num_available_nodes(); - uint highest = _segmented_array.first_array_buffer() != nullptr - ? _segmented_array.first_array_buffer()->num_elems() +template +void G1CardSetAllocator::print(outputStream* os) { + uint num_allocated_slots = _segmented_array.num_allocated_slots(); + uint num_available_slots = _segmented_array.num_available_slots(); + uint highest = _segmented_array.first_array_segment() != nullptr + ? _segmented_array.first_array_segment()->num_slots() : 0; - uint num_buffers = _segmented_array.num_buffers(); - os->print("MA " PTR_FORMAT ": %u elems pending (allocated %u available %u) used %.3f highest %u buffers %u size %zu ", + uint num_segments = _segmented_array.num_segments(); + os->print("MA " PTR_FORMAT ": %u slots pending (allocated %u available %u) used %.3f highest %u segments %u size %zu ", p2i(this), - _num_pending_nodes, - num_allocated_nodes, - num_available_nodes, - percent_of(num_allocated_nodes - _num_pending_nodes, num_available_nodes), + _num_pending_slots, + num_allocated_slots, + num_available_slots, + percent_of(num_allocated_slots - _num_pending_slots, num_available_slots), highest, - num_buffers, + num_segments, mem_size()); } @@ -205,7 +205,7 @@ G1SegmentedArrayMemoryStats G1CardSetMemoryManager::memory_stats() const { G1SegmentedArrayMemoryStats result; for (uint i = 0; i < num_mem_object_types(); i++) { result._num_mem_sizes[i] += _allocators[i].mem_size(); - result._num_segments[i] += _allocators[i].num_buffers(); + result._num_segments[i] += _allocators[i].num_segments(); } return result; } diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp index 50cb308f276..a9d235f39e5 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.hpp @@ -37,43 +37,43 @@ class G1CardSetConfiguration; class outputStream; // Collects G1CardSetAllocator options/heuristics. Called by G1CardSetAllocator -// to determine the next size of the allocated G1CardSetBuffer. +// to determine the next size of the allocated G1CardSetSegment. class G1CardSetAllocOptions : public G1SegmentedArrayAllocOptions { - static const uint MinimumBufferSize = 8; - static const uint MaximumBufferSize = UINT_MAX / 2; + static const uint MinimumNumSlots = 8; + static const uint MaximumNumSlots = UINT_MAX / 2; - uint exponential_expand(uint prev_num_elems) const { - return clamp(prev_num_elems * 2, _initial_num_elems, _max_num_elems); + uint exponential_expand(uint prev_num_slots) const { + return clamp(prev_num_slots * 2, _initial_num_slots, _max_num_slots); } public: - static const uint BufferAlignment = 8; + static const uint SlotAlignment = 8; - G1CardSetAllocOptions(uint elem_size, uint initial_num_elems = MinimumBufferSize, uint max_num_elems = MaximumBufferSize) : - G1SegmentedArrayAllocOptions(align_up(elem_size, BufferAlignment), initial_num_elems, max_num_elems, BufferAlignment) { + G1CardSetAllocOptions(uint slot_size, uint initial_num_slots = MinimumNumSlots, uint max_num_slots = MaximumNumSlots) : + G1SegmentedArrayAllocOptions(align_up(slot_size, SlotAlignment), initial_num_slots, max_num_slots, SlotAlignment) { } - virtual uint next_num_elems(uint prev_num_elems) const override { - return exponential_expand(prev_num_elems); + virtual uint next_num_slots(uint prev_num_slots) const override { + return exponential_expand(prev_num_slots); } }; -typedef G1SegmentedArrayBuffer G1CardSetBuffer; +typedef G1SegmentedArraySegment G1CardSetSegment; -typedef G1SegmentedArrayBufferList G1CardSetBufferList; +typedef G1SegmentedArrayFreeList G1CardSetFreeList; -// Arena-like allocator for (card set) heap memory objects (Elem elements). +// Arena-like allocator for (card set) heap memory objects (Slot slots). // // Allocation and deallocation in the first phase on G1CardSetContainer basis // may occur by multiple threads at once. // // Allocation occurs from an internal free list of G1CardSetContainers first, -// only then trying to bump-allocate from the current G1CardSetBuffer. If there is -// none, this class allocates a new G1CardSetBuffer (allocated from the C heap, +// only then trying to bump-allocate from the current G1CardSetSegment. If there is +// none, this class allocates a new G1CardSetSegment (allocated from the C heap, // asking the G1CardSetAllocOptions instance about sizes etc) and uses that one. // -// The NodeStack free list is a linked list of G1CardSetContainers -// within all G1CardSetBuffer instances allocated so far. It uses a separate +// The SegmentStack free list is a linked list of G1CardSetContainers +// within all G1CardSetSegment instances allocated so far. It uses a separate // pending list and global synchronization to avoid the ABA problem when the // user frees a memory object. // @@ -84,54 +84,56 @@ typedef G1SegmentedArrayBufferList G1CardSetBufferList; // Since it is expected that every CardSet (and in extension each region) has its // own set of allocators, there is intentionally no padding between them to save // memory. -template +template class G1CardSetAllocator { - // G1CardSetBuffer management. + // G1CardSetSegment management. - typedef G1SegmentedArray SegmentedArray; - // G1CardSetContainer node management within the G1CardSetBuffers allocated + typedef G1SegmentedArray SegmentedArray; + // G1CardSetContainer slot management within the G1CardSetSegments allocated // by this allocator. - static G1CardSetContainer* volatile* next_ptr(G1CardSetContainer& node); - typedef LockFreeStack NodeStack; + static G1CardSetContainer* volatile* next_ptr(G1CardSetContainer& slot); + typedef LockFreeStack SlotStack; SegmentedArray _segmented_array; volatile bool _transfer_lock; - NodeStack _free_nodes_list; - NodeStack _pending_nodes_list; + SlotStack _free_slots_list; + SlotStack _pending_slots_list; - volatile uint _num_pending_nodes; // Number of nodes in the pending list. - volatile uint _num_free_nodes; // Number of nodes in the free list. + volatile uint _num_pending_slots; // Number of slots in the pending list. + volatile uint _num_free_slots; // Number of slots in the free list. - // Try to transfer nodes from _pending_nodes_list to _free_nodes_list, with a - // synchronization delay for any in-progress pops from the _free_nodes_list + // Try to transfer slots from _pending_slots_list to _free_slots_list, with a + // synchronization delay for any in-progress pops from the _free_slots_list // to solve ABA here. bool try_transfer_pending(); - uint num_free_elems() const; + uint num_free_slots() const; public: G1CardSetAllocator(const char* name, - const G1CardSetAllocOptions* buffer_options, - G1CardSetBufferList* free_buffer_list); + const G1CardSetAllocOptions* alloc_options, + G1CardSetFreeList* free_segment_list); ~G1CardSetAllocator(); - Elem* allocate(); - void free(Elem* elem); + Slot* allocate(); + void free(Slot* slot); - // Deallocate all buffers to the free buffer list and reset this allocator. Must + // Deallocate all segments to the free segment list and reset this allocator. Must // be called in a globally synchronized area. void drop_all(); size_t mem_size() const { return sizeof(*this) + - _segmented_array.num_buffers() * sizeof(G1CardSetBuffer) + _segmented_array.num_available_nodes() * _segmented_array.elem_size(); + _segmented_array.num_segments() * sizeof(G1CardSetSegment) + _segmented_array.num_available_slots() * + _segmented_array.slot_size(); } size_t wasted_mem_size() const { - return (_segmented_array.num_available_nodes() - (_segmented_array.num_allocated_nodes() - _num_pending_nodes)) * _segmented_array.elem_size(); + return (_segmented_array.num_available_slots() - (_segmented_array.num_allocated_slots() - _num_pending_slots)) * + _segmented_array.slot_size(); } - inline uint num_buffers() { return _segmented_array.num_buffers(); } + inline uint num_segments() { return _segmented_array.num_segments(); } void print(outputStream* os); }; diff --git a/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp b/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp index 0eaac226b59..21a509f449d 100644 --- a/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardSetMemory.inline.hpp @@ -33,32 +33,32 @@ #include "gc/g1/g1CardSetContainers.inline.hpp" #include "utilities/globalCounter.inline.hpp" -template -G1CardSetContainer* volatile* G1CardSetAllocator::next_ptr(G1CardSetContainer& node) { - return node.next_addr(); +template +G1CardSetContainer* volatile* G1CardSetAllocator::next_ptr(G1CardSetContainer& slot) { + return slot.next_addr(); } -template -Elem* G1CardSetAllocator::allocate() { - assert(_segmented_array.elem_size() > 0, "instance size not set."); +template +Slot* G1CardSetAllocator::allocate() { + assert(_segmented_array.slot_size() > 0, "instance size not set."); - if (num_free_elems() > 0) { + if (num_free_slots() > 0) { // Pop under critical section to deal with ABA problem // Other solutions to the same problem are more complicated (ref counting, HP) GlobalCounter::CriticalSection cs(Thread::current()); - G1CardSetContainer* node = _free_nodes_list.pop(); - if (node != nullptr) { - Elem* elem = reinterpret_cast(reinterpret_cast(node)); - Atomic::sub(&_num_free_nodes, 1u); - guarantee(is_aligned(elem, 8), "result " PTR_FORMAT " not aligned", p2i(elem)); - return elem; + G1CardSetContainer* container = _free_slots_list.pop(); + if (container != nullptr) { + Slot* slot = reinterpret_cast(reinterpret_cast(container)); + Atomic::sub(&_num_free_slots, 1u); + guarantee(is_aligned(slot, 8), "result " PTR_FORMAT " not aligned", p2i(slot)); + return slot; } } - Elem* elem = _segmented_array.allocate(); - assert(elem != nullptr, "must be"); - return elem; + Slot* slot = _segmented_array.allocate(); + assert(slot != nullptr, "must be"); + return slot; } inline uint8_t* G1CardSetMemoryManager::allocate(uint type) { @@ -74,9 +74,9 @@ inline void G1CardSetMemoryManager::free_node(void* value) { free(0, value); } -template -inline uint G1CardSetAllocator::num_free_elems() const { - return Atomic::load(&_num_free_nodes); +template +inline uint G1CardSetAllocator::num_free_slots() const { + return Atomic::load(&_num_free_slots); } #endif // SHARE_GC_G1_G1CARDSETMEMORY_INLINE_HPP diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp index deabc897ed8..a15f8965bcb 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp @@ -31,9 +31,9 @@ const G1SegmentedArrayAllocOptions G1EvacFailureObjectsSet::_alloc_options = - G1SegmentedArrayAllocOptions((uint)sizeof(OffsetInRegion), BufferLength, UINT_MAX, Alignment); + G1SegmentedArrayAllocOptions((uint)sizeof(OffsetInRegion), SegmentLength, UINT_MAX, Alignment); -G1SegmentedArrayBufferList G1EvacFailureObjectsSet::_free_buffer_list; +G1SegmentedArrayFreeList G1EvacFailureObjectsSet::_free_segment_list; #ifdef ASSERT void G1EvacFailureObjectsSet::assert_is_valid_offset(size_t offset) const { @@ -57,7 +57,7 @@ G1EvacFailureObjectsSet::OffsetInRegion G1EvacFailureObjectsSet::to_offset(oop o G1EvacFailureObjectsSet::G1EvacFailureObjectsSet(uint region_idx, HeapWord* bottom) : DEBUG_ONLY(_region_idx(region_idx) COMMA) _bottom(bottom), - _offsets(&_alloc_options, &_free_buffer_list) { + _offsets(&_alloc_options, &_free_segment_list) { assert(HeapRegion::LogOfHRGrainBytes < 32, "must be"); } @@ -76,7 +76,7 @@ class G1EvacFailureObjectsIterationHelper { } void join_and_sort() { - _segments->iterate_nodes(*this); + _segments->iterate_segments(*this); QuickSort::sort(_offset_array, _array_length, order_oop, true); } @@ -96,7 +96,7 @@ public: _array_length(0) { } void process_and_drop(ObjectClosure* closure) { - uint num = _segments->num_allocated_nodes(); + uint num = _segments->num_allocated_slots(); _offset_array = NEW_C_HEAP_ARRAY(OffsetInRegion, num, mtGC); join_and_sort(); @@ -106,9 +106,9 @@ public: FREE_C_HEAP_ARRAY(OffsetInRegion, _offset_array); } - // Callback of G1SegmentedArray::iterate_nodes - void do_buffer(G1SegmentedArrayBuffer* node, uint length) { - node->copy_to(&_offset_array[_array_length]); + // Callback of G1SegmentedArray::iterate_segments + void do_segment(G1SegmentedArraySegment* segment, uint length) { + segment->copy_to(&_offset_array[_array_length]); _array_length += length; } }; diff --git a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp index c8ec317f351..a2628807ee1 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.hpp @@ -33,7 +33,7 @@ class G1EvacFailureObjectsIterationHelper; // This class collects addresses of objects that failed evacuation in a specific // heap region. -// Provides sorted iteration of these elements for processing during the remove +// Provides sorted iteration of these objects for processing during the remove // self forwards phase. class G1EvacFailureObjectsSet { friend class G1EvacFailureObjectsIterationHelper; @@ -45,13 +45,13 @@ public: typedef uint OffsetInRegion; private: - static const uint BufferLength = 256; + static const uint SegmentLength = 256; static const uint Alignment = 4; static const G1SegmentedArrayAllocOptions _alloc_options; // This free list is shared among evacuation failure process in all regions. - static G1SegmentedArrayBufferList _free_buffer_list; + static G1SegmentedArrayFreeList _free_segment_list; DEBUG_ONLY(const uint _region_idx;) diff --git a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp index 473166ad5db..cae7df6f902 100644 --- a/src/hotspot/share/gc/g1/g1RemSetSummary.cpp +++ b/src/hotspot/share/gc/g1/g1RemSetSummary.cpp @@ -319,7 +319,7 @@ public: } out->print_cr(" Region with largest amount of code roots = " HR_FORMAT ", " - "size = " SIZE_FORMAT "%s, num_elems = " SIZE_FORMAT ".", + "size = " SIZE_FORMAT "%s, num_slots = " SIZE_FORMAT ".", HR_FORMAT_PARAMS(max_code_root_mem_sz_region()), byte_size_in_proper_unit(max_code_root_rem_set->strong_code_roots_mem_size()), proper_unit_for_byte_size(max_code_root_rem_set->strong_code_roots_mem_size()), diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp index b1522ae68c1..8091b6b2c8b 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.hpp @@ -29,147 +29,147 @@ #include "memory/allocation.hpp" #include "utilities/lockFreeStack.hpp" -// A single buffer/arena containing _num_elems blocks of memory of _elem_size. -// G1SegmentedArrayBuffers can be linked together using a singly linked list. +// A single segment/arena containing _num_slots blocks of memory of _slot_size. +// G1SegmentedArraySegments can be linked together using a singly linked list. template -class G1SegmentedArrayBuffer : public CHeapObj { - const uint _elem_size; - const uint _num_elems; +class G1SegmentedArraySegment : public CHeapObj { + const uint _slot_size; + const uint _num_slots; - G1SegmentedArrayBuffer* volatile _next; + G1SegmentedArraySegment* volatile _next; - char* _buffer; // Actual data. + char* _segment; // Actual data. - // Index into the next free block to allocate into. Full if equal (or larger) - // to _num_elems (can be larger because we atomically increment this value and + // Index into the next free slot to allocate into. Full if equal (or larger) + // to _num_slots (can be larger because we atomically increment this value and // check only afterwards if the allocation has been successful). uint volatile _next_allocate; public: - G1SegmentedArrayBuffer(uint elem_size, uint num_elems, G1SegmentedArrayBuffer* next); - ~G1SegmentedArrayBuffer(); + G1SegmentedArraySegment(uint slot_size, uint num_slots, G1SegmentedArraySegment* next); + ~G1SegmentedArraySegment(); - G1SegmentedArrayBuffer* volatile* next_addr() { return &_next; } + G1SegmentedArraySegment* volatile* next_addr() { return &_next; } - void* get_new_buffer_elem(); + void* get_new_slot(); - uint num_elems() const { return _num_elems; } + uint num_slots() const { return _num_slots; } - G1SegmentedArrayBuffer* next() const { return _next; } + G1SegmentedArraySegment* next() const { return _next; } - void set_next(G1SegmentedArrayBuffer* next) { + void set_next(G1SegmentedArraySegment* next) { assert(next != this, " loop condition"); _next = next; } - void reset(G1SegmentedArrayBuffer* next) { + void reset(G1SegmentedArraySegment* next) { _next_allocate = 0; assert(next != this, " loop condition"); set_next(next); - memset((void*)_buffer, 0, (size_t)_num_elems * _elem_size); + memset((void*)_segment, 0, (size_t)_num_slots * _slot_size); } - uint elem_size() const { return _elem_size; } + uint slot_size() const { return _slot_size; } - size_t mem_size() const { return sizeof(*this) + (size_t)_num_elems * _elem_size; } + size_t mem_size() const { return sizeof(*this) + (size_t)_num_slots * _slot_size; } uint length() const { - // _next_allocate might grow larger than _num_elems in multi-thread environments + // _next_allocate might grow larger than _num_slots in multi-thread environments // due to races. - return MIN2(_next_allocate, _num_elems); + return MIN2(_next_allocate, _num_slots); } - // Copies the (valid) contents of this buffer into the destination. + // Copies the (valid) contents of this segment into the destination. void copy_to(void* dest) const { - ::memcpy(dest, _buffer, length() * _elem_size); + ::memcpy(dest, _segment, length() * _slot_size); } - bool is_full() const { return _next_allocate >= _num_elems; } + bool is_full() const { return _next_allocate >= _num_slots; } }; -// Set of (free) G1SegmentedArrayBuffers. The assumed usage is that allocation -// to it and removal of elements is strictly separate, but every action may be +// Set of (free) G1SegmentedArraySegments. The assumed usage is that allocation +// to it and removal of segments is strictly separate, but every action may be // performed by multiple threads at the same time. // Counts and memory usage are current on a best-effort basis if accessed concurrently. template -class G1SegmentedArrayBufferList { - static G1SegmentedArrayBuffer* volatile* next_ptr(G1SegmentedArrayBuffer& node) { - return node.next_addr(); +class G1SegmentedArrayFreeList { + static G1SegmentedArraySegment* volatile* next_ptr(G1SegmentedArraySegment& segment) { + return segment.next_addr(); } - typedef LockFreeStack, &G1SegmentedArrayBufferList::next_ptr> NodeStack; + typedef LockFreeStack, &G1SegmentedArrayFreeList::next_ptr> SegmentStack; - NodeStack _list; + SegmentStack _list; - volatile size_t _num_buffers; + volatile size_t _num_segments; volatile size_t _mem_size; public: - G1SegmentedArrayBufferList() : _list(), _num_buffers(0), _mem_size(0) { } - ~G1SegmentedArrayBufferList() { free_all(); } + G1SegmentedArrayFreeList() : _list(), _num_segments(0), _mem_size(0) { } + ~G1SegmentedArrayFreeList() { free_all(); } - void bulk_add(G1SegmentedArrayBuffer& first, G1SegmentedArrayBuffer& last, size_t num, size_t mem_size); + void bulk_add(G1SegmentedArraySegment& first, G1SegmentedArraySegment& last, size_t num, size_t mem_size); - G1SegmentedArrayBuffer* get(); - G1SegmentedArrayBuffer* get_all(size_t& num_buffers, size_t& mem_size); + G1SegmentedArraySegment* get(); + G1SegmentedArraySegment* get_all(size_t& num_segments, size_t& mem_size); // Give back all memory to the OS. void free_all(); void print_on(outputStream* out, const char* prefix = ""); - size_t num_buffers() const { return Atomic::load(&_num_buffers); } + size_t num_segments() const { return Atomic::load(&_num_segments); } size_t mem_size() const { return Atomic::load(&_mem_size); } }; -// Configuration for G1SegmentedArray, e.g element size, element number of next G1SegmentedArrayBuffer. +// Configuration for G1SegmentedArray, e.g slot size, slot number of next G1SegmentedArraySegment. class G1SegmentedArrayAllocOptions { protected: - const uint _elem_size; - const uint _initial_num_elems; - // Defines a limit to the number of elements in the buffer - const uint _max_num_elems; - const uint _alignment; + const uint _slot_size; + const uint _initial_num_slots; + // Defines a limit to the number of slots in the segment + const uint _max_num_slots; + const uint _slot_alignment; public: - G1SegmentedArrayAllocOptions(uint elem_size, uint initial_num_elems, uint max_num_elems, uint alignment) : - _elem_size(elem_size), - _initial_num_elems(initial_num_elems), - _max_num_elems(max_num_elems), - _alignment(alignment) { - assert(_elem_size > 0, "Must be"); - assert(_initial_num_elems > 0, "Must be"); - assert(_max_num_elems > 0, "Must be"); - assert(_alignment > 0, "Must be"); + G1SegmentedArrayAllocOptions(uint slot_size, uint initial_num_slots, uint max_num_slots, uint alignment) : + _slot_size(slot_size), + _initial_num_slots(initial_num_slots), + _max_num_slots(max_num_slots), + _slot_alignment(alignment) { + assert(_slot_size > 0, "Must be"); + assert(_initial_num_slots > 0, "Must be"); + assert(_max_num_slots > 0, "Must be"); + assert(_slot_alignment > 0, "Must be"); } - virtual uint next_num_elems(uint prev_num_elems) const { - return _initial_num_elems; + virtual uint next_num_slots(uint prev_num_slots) const { + return _initial_num_slots; } - uint elem_size() const { return _elem_size; } + uint slot_size() const { return _slot_size; } - uint alignment() const { return _alignment; } + uint slot_alignment() const { return _slot_alignment; } }; -// A segmented array where G1SegmentedArrayBuffer is the segment, and -// G1SegmentedArrayBufferList is the free list to cache G1SegmentedArrayBuffer, +// A segmented array where G1SegmentedArraySegment is the segment, and +// G1SegmentedArrayFreeList is the free list to cache G1SegmentedArraySegments, // and G1SegmentedArrayAllocOptions is the configuration for G1SegmentedArray // attributes. // // Implementation details as below: // -// Arena-like allocator for (card set, or ...) heap memory objects (Elem elements). +// Arena-like allocator for (card set, or ...) heap memory objects (Slot slots). // -// Actual allocation from the C heap occurs on G1SegmentedArrayBuffer basis, i.e. segments -// of elements. The assumed allocation pattern for these G1SegmentedArrayBuffer elements +// Actual allocation from the C heap occurs on G1SegmentedArraySegment basis, i.e. segments +// of slots. The assumed allocation pattern for these G1SegmentedArraySegment slots // is assumed to be strictly two-phased: // -// - in the first phase, G1SegmentedArrayBuffers are allocated from the C heap (or a free +// - in the first phase, G1SegmentedArraySegments are allocated from the C heap (or a free // list given at initialization time). This allocation may occur in parallel. This // typically corresponds to a single mutator phase, but may extend over multiple. // -// - in the second phase, G1SegmentedArrayBuffers are given back in bulk to the free list. +// - in the second phase, G1SegmentedArraySegments are given back in bulk to the free list. // This is typically done during a GC pause. // // Some third party is responsible for giving back memory from the free list to @@ -180,54 +180,54 @@ public: // The class also manages a few counters for statistics using atomic operations. // Their values are only consistent within each other with extra global // synchronization. -template +template class G1SegmentedArray { - // G1SegmentedArrayAllocOptions provides parameters for allocation buffer + // G1SegmentedArrayAllocOptions provides parameters for allocation segment // sizing and expansion. const G1SegmentedArrayAllocOptions* _alloc_options; - G1SegmentedArrayBuffer* volatile _first; // The (start of the) list of all buffers. - G1SegmentedArrayBuffer* _last; // The last element of the list of all buffers. - volatile uint _num_buffers; // Number of assigned buffers to this allocator. - volatile size_t _mem_size; // Memory used by all buffers. + G1SegmentedArraySegment* volatile _first; // The (start of the) list of all segments. + G1SegmentedArraySegment* _last; // The last segment of the list of all segments. + volatile uint _num_segments; // Number of assigned segments to this allocator. + volatile size_t _mem_size; // Memory used by all segments. - G1SegmentedArrayBufferList* _free_buffer_list; // The global free buffer list to - // preferentially get new buffers from. + G1SegmentedArrayFreeList* _free_segment_list; // The global free segment list to + // preferentially get new segments from. - volatile uint _num_available_nodes; // Number of nodes available in all buffers (allocated + free + pending + not yet used). - volatile uint _num_allocated_nodes; // Number of total nodes allocated and in use. + volatile uint _num_available_slots; // Number of slots available in all segments (allocated + free + pending + not yet used). + volatile uint _num_allocated_slots; // Number of total slots allocated and in use. private: - inline G1SegmentedArrayBuffer* create_new_buffer(G1SegmentedArrayBuffer* const prev); + inline G1SegmentedArraySegment* create_new_segment(G1SegmentedArraySegment* const prev); DEBUG_ONLY(uint calculate_length() const;) public: - const G1SegmentedArrayBuffer* first_array_buffer() const { return Atomic::load(&_first); } + const G1SegmentedArraySegment* first_array_segment() const { return Atomic::load(&_first); } - uint num_available_nodes() const { return Atomic::load(&_num_available_nodes); } - uint num_allocated_nodes() const { - uint allocated = Atomic::load(&_num_allocated_nodes); + uint num_available_slots() const { return Atomic::load(&_num_available_slots); } + uint num_allocated_slots() const { + uint allocated = Atomic::load(&_num_allocated_slots); assert(calculate_length() == allocated, "Must be"); return allocated; } - inline uint elem_size() const; + inline uint slot_size() const; - G1SegmentedArray(const G1SegmentedArrayAllocOptions* buffer_options, - G1SegmentedArrayBufferList* free_buffer_list); + G1SegmentedArray(const G1SegmentedArrayAllocOptions* alloc_options, + G1SegmentedArrayFreeList* free_segment_list); ~G1SegmentedArray(); - // Deallocate all buffers to the free buffer list and reset this allocator. Must + // Deallocate all segments to the free segment list and reset this allocator. Must // be called in a globally synchronized area. void drop_all(); - inline Elem* allocate(); + inline Slot* allocate(); - inline uint num_buffers() const; + inline uint num_segments() const; - template - void iterate_nodes(BufferClosure& closure) const; + template + void iterate_segments(SegmentClosure& closure) const; }; #endif //SHARE_GC_G1_G1SEGMENTEDARRAY_HPP diff --git a/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp b/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp index 463085602be..1829f47e216 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArray.inline.hpp @@ -31,79 +31,79 @@ #include "utilities/globalCounter.inline.hpp" template -G1SegmentedArrayBuffer::G1SegmentedArrayBuffer(uint elem_size, uint num_instances, G1SegmentedArrayBuffer* next) : - _elem_size(elem_size), _num_elems(num_instances), _next(next), _next_allocate(0) { +G1SegmentedArraySegment::G1SegmentedArraySegment(uint slot_size, uint num_slots, G1SegmentedArraySegment* next) : + _slot_size(slot_size), _num_slots(num_slots), _next(next), _next_allocate(0) { - _buffer = NEW_C_HEAP_ARRAY(char, (size_t)_num_elems * elem_size, mtGCCardSet); + _segment = NEW_C_HEAP_ARRAY(char, (size_t)_num_slots * slot_size, mtGCCardSet); } template -G1SegmentedArrayBuffer::~G1SegmentedArrayBuffer() { - FREE_C_HEAP_ARRAY(mtGCCardSet, _buffer); +G1SegmentedArraySegment::~G1SegmentedArraySegment() { + FREE_C_HEAP_ARRAY(mtGCCardSet, _segment); } template -void* G1SegmentedArrayBuffer::get_new_buffer_elem() { - if (_next_allocate >= _num_elems) { +void* G1SegmentedArraySegment::get_new_slot() { + if (_next_allocate >= _num_slots) { return nullptr; } uint result = Atomic::fetch_and_add(&_next_allocate, 1u, memory_order_relaxed); - if (result >= _num_elems) { + if (result >= _num_slots) { return nullptr; } - void* r = _buffer + (uint)result * _elem_size; + void* r = _segment + (uint)result * _slot_size; return r; } template -void G1SegmentedArrayBufferList::bulk_add(G1SegmentedArrayBuffer& first, - G1SegmentedArrayBuffer& last, - size_t num, - size_t mem_size) { +void G1SegmentedArrayFreeList::bulk_add(G1SegmentedArraySegment& first, + G1SegmentedArraySegment& last, + size_t num, + size_t mem_size) { _list.prepend(first, last); - Atomic::add(&_num_buffers, num, memory_order_relaxed); + Atomic::add(&_num_segments, num, memory_order_relaxed); Atomic::add(&_mem_size, mem_size, memory_order_relaxed); } template -void G1SegmentedArrayBufferList::print_on(outputStream* out, const char* prefix) { - out->print_cr("%s: buffers %zu size %zu", - prefix, Atomic::load(&_num_buffers), Atomic::load(&_mem_size)); +void G1SegmentedArrayFreeList::print_on(outputStream* out, const char* prefix) { + out->print_cr("%s: segments %zu size %zu", + prefix, Atomic::load(&_num_segments), Atomic::load(&_mem_size)); } template -G1SegmentedArrayBuffer* G1SegmentedArrayBufferList::get() { +G1SegmentedArraySegment* G1SegmentedArrayFreeList::get() { GlobalCounter::CriticalSection cs(Thread::current()); - G1SegmentedArrayBuffer* result = _list.pop(); + G1SegmentedArraySegment* result = _list.pop(); if (result != nullptr) { - Atomic::dec(&_num_buffers, memory_order_relaxed); + Atomic::dec(&_num_segments, memory_order_relaxed); Atomic::sub(&_mem_size, result->mem_size(), memory_order_relaxed); } return result; } template -G1SegmentedArrayBuffer* G1SegmentedArrayBufferList::get_all(size_t& num_buffers, - size_t& mem_size) { +G1SegmentedArraySegment* G1SegmentedArrayFreeList::get_all(size_t& num_segments, + size_t& mem_size) { GlobalCounter::CriticalSection cs(Thread::current()); - G1SegmentedArrayBuffer* result = _list.pop_all(); - num_buffers = Atomic::load(&_num_buffers); + G1SegmentedArraySegment* result = _list.pop_all(); + num_segments = Atomic::load(&_num_segments); mem_size = Atomic::load(&_mem_size); if (result != nullptr) { - Atomic::sub(&_num_buffers, num_buffers, memory_order_relaxed); + Atomic::sub(&_num_segments, num_segments, memory_order_relaxed); Atomic::sub(&_mem_size, mem_size, memory_order_relaxed); } return result; } template -void G1SegmentedArrayBufferList::free_all() { +void G1SegmentedArrayFreeList::free_all() { size_t num_freed = 0; size_t mem_size_freed = 0; - G1SegmentedArrayBuffer* cur; + G1SegmentedArraySegment* cur; while ((cur = _list.pop()) != nullptr) { mem_size_freed += cur->mem_size(); @@ -111,130 +111,130 @@ void G1SegmentedArrayBufferList::free_all() { delete cur; } - Atomic::sub(&_num_buffers, num_freed, memory_order_relaxed); + Atomic::sub(&_num_segments, num_freed, memory_order_relaxed); Atomic::sub(&_mem_size, mem_size_freed, memory_order_relaxed); } -template -G1SegmentedArrayBuffer* G1SegmentedArray::create_new_buffer(G1SegmentedArrayBuffer* const prev) { - // Take an existing buffer if available. - G1SegmentedArrayBuffer* next = _free_buffer_list->get(); +template +G1SegmentedArraySegment* G1SegmentedArray::create_new_segment(G1SegmentedArraySegment* const prev) { + // Take an existing segment if available. + G1SegmentedArraySegment* next = _free_segment_list->get(); if (next == nullptr) { - uint prev_num_elems = (prev != nullptr) ? prev->num_elems() : 0; - uint num_elems = _alloc_options->next_num_elems(prev_num_elems); - next = new G1SegmentedArrayBuffer(elem_size(), num_elems, prev); + uint prev_num_slots = (prev != nullptr) ? prev->num_slots() : 0; + uint num_slots = _alloc_options->next_num_slots(prev_num_slots); + next = new G1SegmentedArraySegment(slot_size(), num_slots, prev); } else { - assert(elem_size() == next->elem_size() , - "Mismatch %d != %d Elem %zu", elem_size(), next->elem_size(), sizeof(Elem)); + assert(slot_size() == next->slot_size() , + "Mismatch %d != %d Slot %zu", slot_size(), next->slot_size(), sizeof(Slot)); next->reset(prev); } - // Install it as current allocation buffer. - G1SegmentedArrayBuffer* old = Atomic::cmpxchg(&_first, prev, next); + // Install it as current allocation segment. + G1SegmentedArraySegment* old = Atomic::cmpxchg(&_first, prev, next); if (old != prev) { - // Somebody else installed the buffer, use that one. + // Somebody else installed the segment, use that one. delete next; return old; } else { - // Did we install the first element in the list? If so, this is also the last. + // Did we install the first segment in the list? If so, this is also the last. if (prev == nullptr) { _last = next; } - // Successfully installed the buffer into the list. - Atomic::inc(&_num_buffers, memory_order_relaxed); + // Successfully installed the segment into the list. + Atomic::inc(&_num_segments, memory_order_relaxed); Atomic::add(&_mem_size, next->mem_size(), memory_order_relaxed); - Atomic::add(&_num_available_nodes, next->num_elems(), memory_order_relaxed); + Atomic::add(&_num_available_slots, next->num_slots(), memory_order_relaxed); return next; } } -template -uint G1SegmentedArray::elem_size() const { - return _alloc_options->elem_size(); +template +uint G1SegmentedArray::slot_size() const { + return _alloc_options->slot_size(); } -template -G1SegmentedArray::G1SegmentedArray(const G1SegmentedArrayAllocOptions* buffer_options, - G1SegmentedArrayBufferList* free_buffer_list) : - _alloc_options(buffer_options), +template +G1SegmentedArray::G1SegmentedArray(const G1SegmentedArrayAllocOptions* alloc_options, + G1SegmentedArrayFreeList* free_segment_list) : + _alloc_options(alloc_options), _first(nullptr), _last(nullptr), - _num_buffers(0), + _num_segments(0), _mem_size(0), - _free_buffer_list(free_buffer_list), - _num_available_nodes(0), - _num_allocated_nodes(0) { - assert(_free_buffer_list != nullptr, "precondition!"); + _free_segment_list(free_segment_list), + _num_available_slots(0), + _num_allocated_slots(0) { + assert(_free_segment_list != nullptr, "precondition!"); } -template -G1SegmentedArray::~G1SegmentedArray() { +template +G1SegmentedArray::~G1SegmentedArray() { drop_all(); } -template -void G1SegmentedArray::drop_all() { - G1SegmentedArrayBuffer* cur = Atomic::load_acquire(&_first); +template +void G1SegmentedArray::drop_all() { + G1SegmentedArraySegment* cur = Atomic::load_acquire(&_first); if (cur != nullptr) { - assert(_last != nullptr, "If there is at least one element, there must be a last one."); + assert(_last != nullptr, "If there is at least one segment, there must be a last one."); - G1SegmentedArrayBuffer* first = cur; + G1SegmentedArraySegment* first = cur; #ifdef ASSERT // Check list consistency. - G1SegmentedArrayBuffer* last = cur; - uint num_buffers = 0; + G1SegmentedArraySegment* last = cur; + uint num_segments = 0; size_t mem_size = 0; while (cur != nullptr) { mem_size += cur->mem_size(); - num_buffers++; + num_segments++; - G1SegmentedArrayBuffer* next = cur->next(); + G1SegmentedArraySegment* next = cur->next(); last = cur; cur = next; } #endif - assert(num_buffers == _num_buffers, "Buffer count inconsistent %u %u", num_buffers, _num_buffers); + assert(num_segments == _num_segments, "Segment count inconsistent %u %u", num_segments, _num_segments); assert(mem_size == _mem_size, "Memory size inconsistent"); - assert(last == _last, "Inconsistent last element"); + assert(last == _last, "Inconsistent last segment"); - _free_buffer_list->bulk_add(*first, *_last, _num_buffers, _mem_size); + _free_segment_list->bulk_add(*first, *_last, _num_segments, _mem_size); } _first = nullptr; _last = nullptr; - _num_buffers = 0; + _num_segments = 0; _mem_size = 0; - _num_available_nodes = 0; - _num_allocated_nodes = 0; + _num_available_slots = 0; + _num_allocated_slots = 0; } -template -Elem* G1SegmentedArray::allocate() { - assert(elem_size() > 0, "instance size not set."); +template +Slot* G1SegmentedArray::allocate() { + assert(slot_size() > 0, "instance size not set."); - G1SegmentedArrayBuffer* cur = Atomic::load_acquire(&_first); + G1SegmentedArraySegment* cur = Atomic::load_acquire(&_first); if (cur == nullptr) { - cur = create_new_buffer(cur); + cur = create_new_segment(cur); } while (true) { - Elem* elem = (Elem*)cur->get_new_buffer_elem(); - if (elem != nullptr) { - Atomic::inc(&_num_allocated_nodes, memory_order_relaxed); - guarantee(is_aligned(elem, _alloc_options->alignment()), - "result " PTR_FORMAT " not aligned at %u", p2i(elem), _alloc_options->alignment()); - return elem; + Slot* slot = (Slot*)cur->get_new_slot(); + if (slot != nullptr) { + Atomic::inc(&_num_allocated_slots, memory_order_relaxed); + guarantee(is_aligned(slot, _alloc_options->slot_alignment()), + "result " PTR_FORMAT " not aligned at %u", p2i(slot), _alloc_options->slot_alignment()); + return slot; } - // The buffer is full. Next round. + // The segment is full. Next round. assert(cur->is_full(), "must be"); - cur = create_new_buffer(cur); + cur = create_new_segment(cur); } } -template -inline uint G1SegmentedArray::num_buffers() const { - return Atomic::load(&_num_buffers); +template +inline uint G1SegmentedArray::num_segments() const { + return Atomic::load(&_num_segments); } #ifdef ASSERT @@ -243,7 +243,7 @@ class LengthClosure { uint _total; public: LengthClosure() : _total(0) {} - void do_buffer(G1SegmentedArrayBuffer* node, uint limit) { + void do_segment(G1SegmentedArraySegment* segment, uint limit) { _total += limit; } uint length() const { @@ -251,24 +251,24 @@ public: } }; -template -uint G1SegmentedArray::calculate_length() const { +template +uint G1SegmentedArray::calculate_length() const { LengthClosure closure; - iterate_nodes(closure); + iterate_segments(closure); return closure.length(); } #endif -template -template -void G1SegmentedArray::iterate_nodes(BufferClosure& closure) const { - G1SegmentedArrayBuffer* cur = Atomic::load_acquire(&_first); +template +template +void G1SegmentedArray::iterate_segments(SegmentClosure& closure) const { + G1SegmentedArraySegment* cur = Atomic::load_acquire(&_first); assert((cur != nullptr) == (_last != nullptr), - "If there is at least one element, there must be a last one"); + "If there is at least one segment, there must be a last one"); while (cur != nullptr) { - closure.do_buffer(cur, cur->length()); + closure.do_segment(cur, cur->length()); cur = cur->next(); } } diff --git a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp index b21f4a1b545..118638da75b 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.cpp @@ -53,7 +53,7 @@ void G1SegmentedArrayFreePool::update_unlink_processors(G1ReturnMemoryProc } template -void G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::visit_free_list(G1SegmentedArrayBufferList* source) { +void G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::visit_free_list(G1SegmentedArrayFreeList* source) { assert(_source == nullptr, "already visited"); if (_return_to_vm_size > 0) { _source = source; @@ -78,13 +78,13 @@ void G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::visit_free_list(G1 template bool G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { assert(!finished_return_to_vm(), "already returned everything to the VM"); - assert(_first != nullptr, "must have element to return"); + assert(_first != nullptr, "must have segment to return"); size_t keep_size = 0; size_t keep_num = 0; - G1SegmentedArrayBuffer* cur = _first; - G1SegmentedArrayBuffer* last = nullptr; + G1SegmentedArraySegment* cur = _first; + G1SegmentedArraySegment* last = nullptr; while (cur != nullptr && _return_to_vm_size > 0) { size_t cur_size = cur->mem_size(); @@ -111,7 +111,7 @@ bool G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong _source->bulk_add(*_first, *last, keep_num, keep_size); _first = cur; - log_trace(gc, task)("Segmented Array Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size); + log_trace(gc, task)("Segmented Array Free Memory: Returned to VM %zu segments size %zu", keep_num, keep_size); // _return_to_vm_size may be larger than what is available in the list at the // time we actually get the list. I.e. the list and _return_to_vm_size may be @@ -135,7 +135,7 @@ bool G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::return_to_os(jlong size_t mem_size_deleted = 0; while (_first != nullptr) { - G1SegmentedArrayBuffer* next = _first->next(); + G1SegmentedArraySegment* next = _first->next(); num_delete++; mem_size_deleted += _first->mem_size(); delete _first; @@ -147,7 +147,7 @@ bool G1SegmentedArrayFreePool::G1ReturnMemoryProcessor::return_to_os(jlong } } - log_trace(gc, task)("Segmented Array Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted); + log_trace(gc, task)("Segmented Array Free Memory: Return to OS %zu segments size %zu", num_delete, mem_size_deleted); return _first != nullptr; } @@ -159,16 +159,16 @@ template G1SegmentedArrayFreePool::G1SegmentedArrayFreePool(uint num_free_lists) : _num_free_lists(num_free_lists) { - _free_lists = NEW_C_HEAP_ARRAY(G1SegmentedArrayBufferList, _num_free_lists, mtGC); + _free_lists = NEW_C_HEAP_ARRAY(G1SegmentedArrayFreeList < flag >, _num_free_lists, mtGC); for (uint i = 0; i < _num_free_lists; i++) { - new (&_free_lists[i]) G1SegmentedArrayBufferList(); + new (&_free_lists[i]) G1SegmentedArrayFreeList(); } } template G1SegmentedArrayFreePool::~G1SegmentedArrayFreePool() { for (uint i = 0; i < _num_free_lists; i++) { - _free_lists[i].~G1SegmentedArrayBufferList(); + _free_lists[i].~G1SegmentedArrayFreeList(); } FREE_C_HEAP_ARRAY(mtGC, _free_lists); } @@ -179,7 +179,7 @@ G1SegmentedArrayMemoryStats G1SegmentedArrayFreePool::memory_sizes() const assert(free_list_stats.num_pools() == num_free_lists(), "must be"); for (uint i = 0; i < num_free_lists(); i++) { free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size(); - free_list_stats._num_segments[i] = _free_lists[i].num_buffers(); + free_list_stats._num_segments[i] = _free_lists[i].num_segments(); } return free_list_stats; } diff --git a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp index 918e92e3911..ba1b952875c 100644 --- a/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp +++ b/src/hotspot/share/gc/g1/g1SegmentedArrayFreePool.hpp @@ -54,7 +54,7 @@ public: uint num_pools() const { return G1CardSetConfiguration::num_mem_object_types(); } }; -// A set of free lists holding memory buffers for use by G1SegmentedArray, +// A set of free lists holding freed segments for use by G1SegmentedArray, // e.g. G1CardSetAllocators::SegmentedArray template class G1SegmentedArrayFreePool { @@ -62,7 +62,7 @@ class G1SegmentedArrayFreePool { static G1SegmentedArrayFreePool _freelist_pool; const uint _num_free_lists; - G1SegmentedArrayBufferList* _free_lists; + G1SegmentedArrayFreeList* _free_lists; public: static G1SegmentedArrayFreePool* free_list_pool() { return &_freelist_pool; } @@ -76,7 +76,7 @@ public: explicit G1SegmentedArrayFreePool(uint num_free_lists); ~G1SegmentedArrayFreePool(); - G1SegmentedArrayBufferList* free_list(uint i) { + G1SegmentedArrayFreeList* free_list(uint i) { assert(i < _num_free_lists, "must be"); return &_free_lists[i]; } @@ -90,13 +90,13 @@ public: }; // Data structure containing current in-progress state for returning memory to the -// operating system for a single G1SegmentedArrayBufferList. +// operating system for a single G1SegmentedArrayFreeList. template class G1SegmentedArrayFreePool::G1ReturnMemoryProcessor : public CHeapObj { - G1SegmentedArrayBufferList* _source; + G1SegmentedArrayFreeList* _source; size_t _return_to_vm_size; - G1SegmentedArrayBuffer* _first; + G1SegmentedArraySegment* _first; size_t _unlinked_bytes; size_t _num_unlinked; @@ -105,23 +105,23 @@ public: _source(nullptr), _return_to_vm_size(return_to_vm), _first(nullptr), _unlinked_bytes(0), _num_unlinked(0) { } - // Updates the instance members about the given segmented array buffer list for + // Updates the instance members about the given free list for // the purpose of giving back memory. Only necessary members are updated, // e.g. if there is nothing to return to the VM, do not set the source list. - void visit_free_list(G1SegmentedArrayBufferList* source); + void visit_free_list(G1SegmentedArrayFreeList* source); bool finished_return_to_vm() const { return _return_to_vm_size == 0; } bool finished_return_to_os() const { return _first == nullptr; } // Returns memory to the VM until the given deadline expires. Returns true if - // there is no more work. Guarantees forward progress, i.e. at least one buffer + // there is no more work. Guarantees forward progress, i.e. at least one segment // has been processed after returning. - // return_to_vm() re-adds buffers to the respective free list. + // return_to_vm() re-adds segments to the respective free list. bool return_to_vm(jlong deadline); // Returns memory to the VM until the given deadline expires. Returns true if - // there is no more work. Guarantees forward progress, i.e. at least one buffer + // there is no more work. Guarantees forward progress, i.e. at least one segment // has been processed after returning. - // return_to_os() gives back buffers to the OS. + // return_to_os() gives back segments to the OS. bool return_to_os(jlong deadline); }; -- GitLab From 09522db5aa9503131381bbb4fe3f2eae829645ce Mon Sep 17 00:00:00 2001 From: Jaikiran Pai Date: Thu, 2 Dec 2021 01:29:52 +0000 Subject: [PATCH 550/890] 8277647: [REDO] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures Reviewed-by: sundar --- .../jpackage/helpers/jdk/jpackage/test/JPackageCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java index 3315de374c3..b68fe08bd1e 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java @@ -768,6 +768,11 @@ public final class JPackageCommand extends CommandArguments { } private JPackageCommand adjustArgumentsBeforeExecution() { + if (!isWithToolProvider()) { + // if jpackage is launched as a process then set the jlink.debug system property + // to allow the jlink process to print exception stacktraces on any failure + addArgument("-J-Djlink.debug=true"); + } if (!hasArgument("--runtime-image") && !hasArgument("--app-image") && DEFAULT_RUNTIME_IMAGE != null && !ignoreDefaultRuntime) { addArguments("--runtime-image", DEFAULT_RUNTIME_IMAGE); } -- GitLab From b226ab99c872e791d3ed9fca015cf92847904c34 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 2 Dec 2021 02:50:13 +0000 Subject: [PATCH 551/890] 8276141: XPathFactory set/getProperty method Reviewed-by: rriggs, naoto, lancea, iris, alanb --- .../xpath/internal/jaxp/XPathFactoryImpl.java | 36 ++++++++- .../internal/res/XPATHErrorResources.java | 28 ++++++- .../classes/javax/xml/xpath/XPathFactory.java | 61 ++++++++++++++- .../unittest/xpath/XPathFactoryDummyImpl.java | 74 +++++++++++++++++++ .../xml/jaxp/unittest/xpath/XPathTest.java | 67 +++++++++++++++-- 5 files changed, 255 insertions(+), 11 deletions(-) create mode 100644 test/jaxp/javax/xml/jaxp/unittest/xpath/XPathFactoryDummyImpl.java diff --git a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java index f5ad625ec17..f41615fe6ab 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java +++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java @@ -36,7 +36,7 @@ import jdk.xml.internal.JdkXmlFeatures; * * @author Ramesh Mandava * - * @LastModified: May 2021 + * @LastModified: Nov 2021 */ public class XPathFactoryImpl extends XPathFactory { @@ -310,4 +310,38 @@ public class XPathFactoryImpl extends XPathFactory { xPathVariableResolver = resolver; } + + @Override + public void setProperty(String name, String value) { + // property name cannot be null + if (name == null) { + String fmsg = XSLMessages.createXPATHMessage( + XPATHErrorResources.ER_PROPERTY_NAME_NULL, + new Object[] {CLASS_NAME, value} ); + throw new NullPointerException(fmsg); + } + + // property name not recognized + String fmsg = XSLMessages.createXPATHMessage( + XPATHErrorResources.ER_PROPERTY_UNKNOWN, + new Object[] {name, CLASS_NAME, value} ); + throw new IllegalArgumentException(fmsg); + } + + @Override + public String getProperty(String name) { + // property name cannot be null + if (name == null) { + String fmsg = XSLMessages.createXPATHMessage( + XPATHErrorResources.ER_GETTING_NULL_PROPERTY, + new Object[] {CLASS_NAME} ); + throw new NullPointerException(fmsg); + } + + // unknown property + String fmsg = XSLMessages.createXPATHMessage( + XPATHErrorResources.ER_GETTING_UNKNOWN_PROPERTY, + new Object[] {name, CLASS_NAME} ); + throw new IllegalArgumentException(fmsg); + } } diff --git a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java index 54e4fe7b646..2e5f86ee30e 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java +++ b/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -31,7 +31,7 @@ import java.util.ListResourceBundle; * Also you need to update the count of messages(MAX_CODE)or * the count of warnings(MAX_WARNING) [ Information purpose only] * @xsl.usage advanced - * @LastModified: May 2019 + * @LastModified: Nov 2021 */ public class XPATHErrorResources extends ListResourceBundle { @@ -322,6 +322,10 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = public static final String ER_SECUREPROCESSING_FEATURE = "ER_SECUREPROCESSING_FEATURE"; public static final String ER_NULL_XPATH_FUNCTION_RESOLVER = "ER_NULL_XPATH_FUNCTION_RESOLVER"; public static final String ER_NULL_XPATH_VARIABLE_RESOLVER = "ER_NULL_XPATH_VARIABLE_RESOLVER"; + public static final String ER_PROPERTY_NAME_NULL = "ER_PROPERTY_NAME_NULL"; + public static final String ER_PROPERTY_UNKNOWN = "ER_PROPERTY_UNKNOWN"; + public static final String ER_GETTING_NULL_PROPERTY = "ER_GETTING_NULL_PROPERTY"; + public static final String ER_GETTING_UNKNOWN_PROPERTY = "ER_GETTING_UNKNOWN_PROPERTY"; //END: Keys needed for exception messages of JAXP 1.3 XPath API implementation public static final String WG_LOCALE_NAME_NOT_HANDLED = @@ -836,6 +840,26 @@ public static final String ER_IGNORABLE_WHITESPACE_NOT_HANDLED = { ER_NULL_XPATH_VARIABLE_RESOLVER, "Attempting to set a null XPathVariableResolver:{0}#setXPathVariableResolver(null)"}, + /** Field ER_PROPERTY_NAME_NULL */ + + { ER_PROPERTY_NAME_NULL, + "Trying to set a property with a null name: {0}#setProperty( null, {1})"}, + + /** Field ER_PROPERTY_UNKNOWN */ + + { ER_PROPERTY_UNKNOWN, + "Trying to set the unknown property \"{0}\":{1}#setProperty({0},{2})"}, + + /** Field ER_GETTING_NULL_PROPERTY */ + + { ER_GETTING_NULL_PROPERTY, + "Trying to get a property with a null name: {0}#getProperty(null)"}, + + /** Field ER_GETTING_NULL_PROPERTY */ + + { ER_GETTING_UNKNOWN_PROPERTY, + "Trying to get the unknown property \"{0}\":{1}#getProperty({0})"}, + //END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation // Warnings... diff --git a/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java b/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java index 3e6c7d1d554..90004e31691 100644 --- a/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java +++ b/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java @@ -275,8 +275,9 @@ public abstract class XPathFactory { public abstract boolean isObjectModelSupported(String objectModel); /** - *

      Set a feature for this {@code XPathFactory} and - * XPaths created by this factory.

      + * Sets a feature for this {@code XPathFactory}. The feature applies to + * {@code XPath} objects that the {@code XPathFactory} creates. It has no + * impact on {@code XPath} objects that are already created. * *

      * Feature names are fully qualified {@link java.net.URI}s. @@ -369,4 +370,60 @@ public abstract class XPathFactory { * @return New instance of an XPath. */ public abstract XPath newXPath(); + + /** + * Sets a property for this {@code XPathFactory}. The property applies to + * {@code XPath} objects that the {@code XPathFactory} creates. It has no + * impact on {@code XPath} objects that are already created. + *

      + * A property can either be defined in this {@code XPathFactory}, or by the + * underlying implementation. + * + * @implSpec + * The default implementation throws + * {@link java.lang.UnsupportedOperationException}. + * + * @param name the property name + * @param value the value for the property + * + * @throws IllegalArgumentException if the property name is not recognized, + * or the value can not be assigned + * @throws UnsupportedOperationException if the implementation does not + * support the method + * @throws NullPointerException if the {@code name} is {@code null} + * + * @since 18 + */ + public void setProperty(String name, String value) { + + if (name == null) { + throw new NullPointerException("the name parameter is null"); + } + throw new UnsupportedOperationException("not implemented"); + } + + /** + * Returns the value of the specified property. + * + * @implSpec + * The default implementation throws + * {@link java.lang.UnsupportedOperationException}. + * + * @param name the property name + * @return the value of the property. + * + * @throws IllegalArgumentException if the property name is not recognized + * @throws UnsupportedOperationException if the implementation does not + * support the method + * @throws NullPointerException if the {@code name} is {@code null} + * + * @since 18 + */ + public String getProperty(String name) { + + if (name == null) { + throw new NullPointerException("the name parameter is null"); + } + throw new UnsupportedOperationException("not implemented"); + } } diff --git a/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathFactoryDummyImpl.java b/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathFactoryDummyImpl.java new file mode 100644 index 00000000000..8eb75c225cd --- /dev/null +++ b/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathFactoryDummyImpl.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2021, 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 xpath; + +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPathFactoryConfigurationException; +import javax.xml.xpath.XPathFunctionResolver; +import javax.xml.xpath.XPathVariableResolver; + +/** + * A dummy implementation of the XPathFactory without implementing + * the setProperty/getProperty methods + */ +public class XPathFactoryDummyImpl extends XPathFactory { + + @Override + public boolean isObjectModelSupported(String objectModel) { + // support the default object model, W3C DOM + if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) { + return true; + } + + // no support + return false; + } + + + @Override + public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getFeature(String name) throws XPathFactoryConfigurationException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setXPathVariableResolver(XPathVariableResolver resolver) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setXPathFunctionResolver(XPathFunctionResolver resolver) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public XPath newXPath() { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathTest.java b/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathTest.java index 7f5c45dc12b..82c4cc5b1f3 100644 --- a/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathTest.java +++ b/test/jaxp/javax/xml/jaxp/unittest/xpath/XPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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,22 +30,77 @@ import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; +import org.testng.Assert; import org.testng.annotations.DataProvider; -import org.testng.annotations.Listeners; import org.testng.annotations.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; /* * @test - * @bug 6376058 - * @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest - * @run testng/othervm -DrunSecMngr=true -Djava.security.manager=allow xpath.XPathTest + * @bug 6376058 8276141 + * @build xpath.XPathTest xpath.XPathFactoryDummyImpl * @run testng/othervm xpath.XPathTest * @summary Test XPath functions. See details for each test. */ -@Listeners({jaxp.library.BasePolicy.class}) public class XPathTest { + /* + * DataProvider for testXPathFactory + */ + @DataProvider(name = "xpath") + public Object[][] getXPathFactory() throws Exception { + return new Object[][]{ + {null}, + {"xpath.XPathFactoryDummyImpl"}, + }; + } + + /* + * @bug 8276141 + * Tests the setProperty/getProperty method for the XPathFactory. + */ + @Test(dataProvider = "xpath") + public void testXPathFactory(String factoryName) + throws Exception { + + XPathFactory xpf; + if (factoryName == null) { + xpf = XPathFactory.newInstance(); + } else { + xpf = XPathFactory.newInstance( + XPathFactory.DEFAULT_OBJECT_MODEL_URI, factoryName, null); + } + + // NPE + Assert.assertThrows(NullPointerException.class, + () -> setProperty(xpf, null, "value")); + Assert.assertThrows(NullPointerException.class, + () -> getProperty(xpf, null)); + + if (factoryName == null) { + // default factory impl + Assert.assertThrows(IllegalArgumentException.class, + () -> setProperty(xpf, "unknown", "value")); + Assert.assertThrows(IllegalArgumentException.class, + () -> getProperty(xpf, "unknown")); + } else { + // the DummyImpl does not implement the method + Assert.assertThrows(UnsupportedOperationException.class, + () -> setProperty(xpf, "unknown", "value")); + Assert.assertThrows(UnsupportedOperationException.class, + () -> getProperty(xpf, "unknown")); + } + } + + private void setProperty(XPathFactory xpf, String name, String value) + throws Exception { + xpf.setProperty(name, value); + } + + private void getProperty(XPathFactory xpf, String name) + throws Exception { + xpf.getProperty(name); + } /* @bug 6211561 -- GitLab From 8198807b4a811040c7d9f65fb98494fc7d840814 Mon Sep 17 00:00:00 2001 From: Jayathirth D V Date: Thu, 2 Dec 2021 05:00:48 +0000 Subject: [PATCH 552/890] 8266435: WBMPImageReader.read() should not truncate the input stream Reviewed-by: serb --- .../imageio/plugins/wbmp/WBMPImageReader.java | 8 +- .../plugins/wbmp/WBMPStreamTruncateTest.java | 118 ++++++++++++++++++ 2 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java index 5676733e65f..ac62269b2d9 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -244,8 +244,8 @@ public class WBMPImageReader extends ImageReader { } // If noTransform is necessary, read the data. - iis.read(((DataBufferByte)tile.getDataBuffer()).getData(), - 0, height*sm.getScanlineStride()); + iis.readFully(((DataBufferByte)tile.getDataBuffer()).getData(), + 0, height*sm.getScanlineStride()); processImageUpdate(bi, 0, 0, width, height, 1, 1, @@ -280,7 +280,7 @@ public class WBMPImageReader extends ImageReader { if (abortRequested()) break; - iis.read(buf, 0, len); + iis.readFully(buf, 0, len); for (int i = 0; i < destinationRegion.width; i++) { //get the bit and assign to the data buffer of the raster int v = (buf[srcPos[i]] >> srcOff[i]) & 1; diff --git a/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java b/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java new file mode 100644 index 00000000000..36b8d4a72e0 --- /dev/null +++ b/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2021, 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 8266435 + * @summary Test verifies that WBMPImageReader doesnt truncate + * the stream and reads it fully + * @run main WBMPStreamTruncateTest + */ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import javax.imageio.ImageIO; +import javax.imageio.stream.ImageInputStreamImpl; + +public class WBMPStreamTruncateTest +{ + static final int LIMIT = 100; + static final int width = 100; + static final int height = 100; + public static void main(String[] args) throws IOException + { + String sep = System.getProperty("file.separator"); + String dir = System.getProperty("test.src", "."); + String filePath = dir+sep; + BufferedImage srcImage = new + BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY); + Graphics2D g = (Graphics2D) srcImage.getGraphics(); + g.setBackground(Color.WHITE); + g.fillRect(0, 0, srcImage.getWidth(), srcImage.getHeight()); + g.dispose(); + // create WBMP image + File imageFile = File. + createTempFile("test", ".wbmp", new File(filePath)); + imageFile.deleteOnExit(); + ImageIO.write(srcImage, "wbmp", imageFile); + BufferedImage testImg = + ImageIO.read(new LimitedImageInputStream(imageFile, LIMIT)); + for (int x = 0; x < testImg.getWidth(); ++x) + { + for (int y = 0; y < testImg.getHeight(); ++y) + { + int i1 = testImg.getRGB(x, y); + int i2 = srcImage.getRGB(x, y); + if (i1 != i2) + { + throw new RuntimeException("Stream is decoded only until " + + "the limit specified"); + } + } + } + } + + static class LimitedImageInputStream extends ImageInputStreamImpl + { + private final RandomAccessFile raf; + private final int limit; + + public LimitedImageInputStream(File file, int limit) + throws FileNotFoundException + { + raf = new RandomAccessFile(file, "r"); + this.limit = limit; + } + + @Override + public int read() throws IOException + { + return raf.read(); + } + + @Override + public int read(byte[] b, int off, int len) throws IOException + { + return raf.read(b, off, Math.min(limit, len)); + } + + @Override + public void close() throws IOException + { + super.close(); + raf.close(); + } + + @Override + public void seek(long pos) throws IOException + { + super.seek(pos); + raf.seek(pos); + } + } +} -- GitLab From a093cdddaf5ab88eb84a147e523db5c3e1be54be Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Thu, 2 Dec 2021 06:52:45 +0000 Subject: [PATCH 553/890] 8276657: XSLT compiler tries to define a class with empty name Reviewed-by: naoto --- .../org/apache/xalan/internal/xsltc/compiler/XSLTC.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java index 99d3681c0e7..a76dcaf7cdb 100644 --- a/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java +++ b/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java @@ -58,7 +58,7 @@ import org.xml.sax.XMLReader; * @author G. Todd Miller * @author Morten Jorgensen * @author John Howard (johnh@schemasoft.com) - * @LastModified: May 2021 + * @LastModified: Nov 2021 */ public final class XSLTC { @@ -460,8 +460,11 @@ public final class XSLTC { if (name != null) { setClassName(name); } - else if (systemId != null && !systemId.equals("")) { - setClassName(Util.baseName(systemId)); + else if (systemId != null && !systemId.isEmpty()) { + String clsName = Util.baseName(systemId); + if (clsName != null && !clsName.isEmpty()) { + setClassName(clsName); + } } // Ensure we have a non-empty class name at this point -- GitLab From 088b244ec6d9393a1fcd2233fa5b4cf46f9ae0dd Mon Sep 17 00:00:00 2001 From: Patric Hedlin Date: Thu, 2 Dec 2021 09:25:12 +0000 Subject: [PATCH 554/890] 8251216: Implement MD5 intrinsics on AArch64 Co-authored-by: Ludovic Henry Reviewed-by: aph, neliasso --- .../cpu/aarch64/stubGenerator_aarch64.cpp | 192 ++++++++++++++++++ .../cpu/aarch64/stubRoutines_aarch64.hpp | 2 +- .../cpu/aarch64/vm_version_aarch64.cpp | 5 +- .../sha/predicate/IntrinsicPredicates.java | 5 +- 4 files changed, 198 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index b0392086542..fdf874b2e0d 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -3210,6 +3210,194 @@ class StubGenerator: public StubCodeGenerator { return start; } + // Arguments: + // + // Inputs: + // c_rarg0 - byte[] source+offset + // c_rarg1 - int[] SHA.state + // c_rarg2 - int offset + // c_rarg3 - int limit + // + address generate_md5_implCompress(bool multi_block, const char *name) { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ pc(); + + Register buf = c_rarg0; + Register state = c_rarg1; + Register ofs = c_rarg2; + Register limit = c_rarg3; + Register a = r4; + Register b = r5; + Register c = r6; + Register d = r7; + Register rscratch3 = r10; + Register rscratch4 = r11; + + Label keys; + Label md5_loop; + + __ BIND(md5_loop); + + // Save hash values for addition after rounds + __ ldrw(a, Address(state, 0)); + __ ldrw(b, Address(state, 4)); + __ ldrw(c, Address(state, 8)); + __ ldrw(d, Address(state, 12)); + +#define FF(r1, r2, r3, r4, k, s, t) \ + __ eorw(rscratch3, r3, r4); \ + __ movw(rscratch2, t); \ + __ andw(rscratch3, rscratch3, r2); \ + __ addw(rscratch4, r1, rscratch2); \ + __ ldrw(rscratch1, Address(buf, k*4)); \ + __ eorw(rscratch3, rscratch3, r4); \ + __ addw(rscratch3, rscratch3, rscratch1); \ + __ addw(rscratch3, rscratch3, rscratch4); \ + __ rorw(rscratch2, rscratch3, 32 - s); \ + __ addw(r1, rscratch2, r2); + +#define GG(r1, r2, r3, r4, k, s, t) \ + __ eorw(rscratch2, r2, r3); \ + __ ldrw(rscratch1, Address(buf, k*4)); \ + __ andw(rscratch3, rscratch2, r4); \ + __ movw(rscratch2, t); \ + __ eorw(rscratch3, rscratch3, r3); \ + __ addw(rscratch4, r1, rscratch2); \ + __ addw(rscratch3, rscratch3, rscratch1); \ + __ addw(rscratch3, rscratch3, rscratch4); \ + __ rorw(rscratch2, rscratch3, 32 - s); \ + __ addw(r1, rscratch2, r2); + +#define HH(r1, r2, r3, r4, k, s, t) \ + __ eorw(rscratch3, r3, r4); \ + __ movw(rscratch2, t); \ + __ addw(rscratch4, r1, rscratch2); \ + __ ldrw(rscratch1, Address(buf, k*4)); \ + __ eorw(rscratch3, rscratch3, r2); \ + __ addw(rscratch3, rscratch3, rscratch1); \ + __ addw(rscratch3, rscratch3, rscratch4); \ + __ rorw(rscratch2, rscratch3, 32 - s); \ + __ addw(r1, rscratch2, r2); + +#define II(r1, r2, r3, r4, k, s, t) \ + __ movw(rscratch3, t); \ + __ ornw(rscratch2, r2, r4); \ + __ addw(rscratch4, r1, rscratch3); \ + __ ldrw(rscratch1, Address(buf, k*4)); \ + __ eorw(rscratch3, rscratch2, r3); \ + __ addw(rscratch3, rscratch3, rscratch1); \ + __ addw(rscratch3, rscratch3, rscratch4); \ + __ rorw(rscratch2, rscratch3, 32 - s); \ + __ addw(r1, rscratch2, r2); + + // Round 1 + FF(a, b, c, d, 0, 7, 0xd76aa478) + FF(d, a, b, c, 1, 12, 0xe8c7b756) + FF(c, d, a, b, 2, 17, 0x242070db) + FF(b, c, d, a, 3, 22, 0xc1bdceee) + FF(a, b, c, d, 4, 7, 0xf57c0faf) + FF(d, a, b, c, 5, 12, 0x4787c62a) + FF(c, d, a, b, 6, 17, 0xa8304613) + FF(b, c, d, a, 7, 22, 0xfd469501) + FF(a, b, c, d, 8, 7, 0x698098d8) + FF(d, a, b, c, 9, 12, 0x8b44f7af) + FF(c, d, a, b, 10, 17, 0xffff5bb1) + FF(b, c, d, a, 11, 22, 0x895cd7be) + FF(a, b, c, d, 12, 7, 0x6b901122) + FF(d, a, b, c, 13, 12, 0xfd987193) + FF(c, d, a, b, 14, 17, 0xa679438e) + FF(b, c, d, a, 15, 22, 0x49b40821) + + // Round 2 + GG(a, b, c, d, 1, 5, 0xf61e2562) + GG(d, a, b, c, 6, 9, 0xc040b340) + GG(c, d, a, b, 11, 14, 0x265e5a51) + GG(b, c, d, a, 0, 20, 0xe9b6c7aa) + GG(a, b, c, d, 5, 5, 0xd62f105d) + GG(d, a, b, c, 10, 9, 0x02441453) + GG(c, d, a, b, 15, 14, 0xd8a1e681) + GG(b, c, d, a, 4, 20, 0xe7d3fbc8) + GG(a, b, c, d, 9, 5, 0x21e1cde6) + GG(d, a, b, c, 14, 9, 0xc33707d6) + GG(c, d, a, b, 3, 14, 0xf4d50d87) + GG(b, c, d, a, 8, 20, 0x455a14ed) + GG(a, b, c, d, 13, 5, 0xa9e3e905) + GG(d, a, b, c, 2, 9, 0xfcefa3f8) + GG(c, d, a, b, 7, 14, 0x676f02d9) + GG(b, c, d, a, 12, 20, 0x8d2a4c8a) + + // Round 3 + HH(a, b, c, d, 5, 4, 0xfffa3942) + HH(d, a, b, c, 8, 11, 0x8771f681) + HH(c, d, a, b, 11, 16, 0x6d9d6122) + HH(b, c, d, a, 14, 23, 0xfde5380c) + HH(a, b, c, d, 1, 4, 0xa4beea44) + HH(d, a, b, c, 4, 11, 0x4bdecfa9) + HH(c, d, a, b, 7, 16, 0xf6bb4b60) + HH(b, c, d, a, 10, 23, 0xbebfbc70) + HH(a, b, c, d, 13, 4, 0x289b7ec6) + HH(d, a, b, c, 0, 11, 0xeaa127fa) + HH(c, d, a, b, 3, 16, 0xd4ef3085) + HH(b, c, d, a, 6, 23, 0x04881d05) + HH(a, b, c, d, 9, 4, 0xd9d4d039) + HH(d, a, b, c, 12, 11, 0xe6db99e5) + HH(c, d, a, b, 15, 16, 0x1fa27cf8) + HH(b, c, d, a, 2, 23, 0xc4ac5665) + + // Round 4 + II(a, b, c, d, 0, 6, 0xf4292244) + II(d, a, b, c, 7, 10, 0x432aff97) + II(c, d, a, b, 14, 15, 0xab9423a7) + II(b, c, d, a, 5, 21, 0xfc93a039) + II(a, b, c, d, 12, 6, 0x655b59c3) + II(d, a, b, c, 3, 10, 0x8f0ccc92) + II(c, d, a, b, 10, 15, 0xffeff47d) + II(b, c, d, a, 1, 21, 0x85845dd1) + II(a, b, c, d, 8, 6, 0x6fa87e4f) + II(d, a, b, c, 15, 10, 0xfe2ce6e0) + II(c, d, a, b, 6, 15, 0xa3014314) + II(b, c, d, a, 13, 21, 0x4e0811a1) + II(a, b, c, d, 4, 6, 0xf7537e82) + II(d, a, b, c, 11, 10, 0xbd3af235) + II(c, d, a, b, 2, 15, 0x2ad7d2bb) + II(b, c, d, a, 9, 21, 0xeb86d391) + +#undef FF +#undef GG +#undef HH +#undef II + + // write hash values back in the correct order + __ ldrw(rscratch1, Address(state, 0)); + __ addw(rscratch1, rscratch1, a); + __ strw(rscratch1, Address(state, 0)); + + __ ldrw(rscratch2, Address(state, 4)); + __ addw(rscratch2, rscratch2, b); + __ strw(rscratch2, Address(state, 4)); + + __ ldrw(rscratch3, Address(state, 8)); + __ addw(rscratch3, rscratch3, c); + __ strw(rscratch3, Address(state, 8)); + + __ ldrw(rscratch4, Address(state, 12)); + __ addw(rscratch4, rscratch4, d); + __ strw(rscratch4, Address(state, 12)); + + if (multi_block) { + __ add(buf, buf, 64); + __ add(ofs, ofs, 64); + __ cmp(ofs, limit); + __ br(Assembler::LE, md5_loop); + __ mov(c_rarg0, ofs); // return ofs + } + + __ ret(lr); + + return start; + } + // Arguments: // // Inputs: @@ -7501,6 +7689,10 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_galoisCounterMode_AESCrypt = generate_galoisCounterMode_AESCrypt(); } + if (UseMD5Intrinsics) { + StubRoutines::_md5_implCompress = generate_md5_implCompress(false, "md5_implCompress"); + StubRoutines::_md5_implCompressMB = generate_md5_implCompress(true, "md5_implCompressMB"); + } if (UseSHA1Intrinsics) { StubRoutines::_sha1_implCompress = generate_sha1_implCompress(false, "sha1_implCompress"); StubRoutines::_sha1_implCompressMB = generate_sha1_implCompress(true, "sha1_implCompressMB"); diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp index e3ebc448447..67536dc1d2b 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp @@ -36,7 +36,7 @@ static bool returns_to_call_stub(address return_pc) { enum platform_dependent_constants { code_size1 = 19000, // simply increase if too small (assembler will crash if too small) - code_size2 = 38000 // simply increase if too small (assembler will crash if too small) + code_size2 = 45000 // simply increase if too small (assembler will crash if too small) }; class aarch64 { diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index b4e75f88d29..e08d0b6f134 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -301,9 +301,8 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseFMA, true); } - if (UseMD5Intrinsics) { - warning("MD5 intrinsics are not available on this CPU"); - FLAG_SET_DEFAULT(UseMD5Intrinsics, false); + if (FLAG_IS_DEFAULT(UseMD5Intrinsics)) { + UseMD5Intrinsics = true; } if (_features & (CPU_SHA1 | CPU_SHA2 | CPU_SHA3 | CPU_SHA512)) { diff --git a/test/hotspot/jtreg/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java b/test/hotspot/jtreg/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java index 00eb0e2d272..782ab6b9b46 100644 --- a/test/hotspot/jtreg/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java +++ b/test/hotspot/jtreg/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java @@ -60,10 +60,11 @@ public class IntrinsicPredicates { }; public static final BooleanSupplier MD5_INSTRUCTION_AVAILABLE - = // x86 variants + = new OrPredicate(new CPUSpecificPredicate("aarch64.*", null, null), + // x86 variants new OrPredicate(new CPUSpecificPredicate("amd64.*", null, null), new OrPredicate(new CPUSpecificPredicate("i386.*", null, null), - new CPUSpecificPredicate("x86.*", null, null))); + new CPUSpecificPredicate("x86.*", null, null)))); public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE = new OrPredicate(new CPUSpecificPredicate("aarch64.*", new String[] { "sha1" }, null), -- GitLab From 103da8fae12a2aaff1a02a219690ce89fc098641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 2 Dec 2021 09:40:24 +0000 Subject: [PATCH 555/890] 8274639: Provide a way to disable warnings for cross-modular links Reviewed-by: jjg --- .../html/resources/standard.properties | 8 +++ .../internal/doclets/toolkit/BaseOptions.java | 51 +++++++++++++--- .../internal/doclets/toolkit/util/Extern.java | 29 +++++---- .../TestLinkOptionWithModule.java | 59 +++++++++++++++++-- 4 files changed, 124 insertions(+), 23 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index 130f3e55740..f491b97adfe 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -457,6 +457,14 @@ doclet.usage.linkoffline.parameters=\ doclet.usage.linkoffline.description=\ Link to docs at using package list at +# L10N: do not localize the option parameters: warn info +doclet.usage.link-modularity-mismatch.parameters=\ + (warn|info) +doclet.usage.link-modularity-mismatch.description=\ + Report external documentation with wrong modularity with either\n\ + a warning or informational message. The default behaviour is to\n\ + report a warning. + doclet.usage.link-platform-properties.parameters=\ doclet.usage.link-platform-properties.description=\ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java index 5fe0e514884..6445f4fc6a0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseOptions.java @@ -36,6 +36,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; +import java.util.Locale; import java.util.MissingResourceException; import java.util.Set; import java.util.StringTokenizer; @@ -165,6 +166,20 @@ public abstract class BaseOptions { // A list of pairs containing urls and package list private final List> linkOfflineList = new ArrayList<>(); + /** + * An enum of policies for handling modularity mismatches in external documentation. + */ + public enum ModularityMismatchPolicy { + INFO, + WARN + } + + /** + * Argument for command-line option {@code --link-modularity-mismatch}. + * Describes how to handle external documentation with non-matching modularity. + */ + private ModularityMismatchPolicy linkModularityMismatch = ModularityMismatchPolicy.WARN; + /** * Location of alternative platform link properties file. */ @@ -403,6 +418,23 @@ public abstract class BaseOptions { } }, + new Option(resources, "--link-modularity-mismatch", 1) { + @Override + public boolean process(String opt, List args) { + String s = args.get(0); + switch (s) { + case "warn", "info" -> + linkModularityMismatch = ModularityMismatchPolicy.valueOf(s.toUpperCase(Locale.ROOT)); + default -> { + reporter.print(ERROR, resources.getText( + "doclet.Option_invalid", s, "--link-modularity-mismatch")); + return false; + } + } + return true; + } + }, + new Option(resources, "--link-platform-properties", 1) { @Override public boolean process(String opt, List args) { @@ -464,16 +496,13 @@ public abstract class BaseOptions { public boolean process(String opt, List args) { String o = args.get(0); switch (o) { - case "summary": - summarizeOverriddenMethods = true; - break; - case "detail": - summarizeOverriddenMethods = false; - break; - default: + case "summary" -> summarizeOverriddenMethods = true; + case "detail" -> summarizeOverriddenMethods = false; + default -> { reporter.print(ERROR, resources.getText("doclet.Option_invalid",o, "--override-methods")); return false; + } } return true; } @@ -827,6 +856,14 @@ public abstract class BaseOptions { return linkOfflineList; } + /** + * Argument for command-line option {@code --link-modularity-mismatch}. + * Describes how to handle external documentation with non-matching modularity. + */ + public ModularityMismatchPolicy linkModularityMismatch() { + return linkModularityMismatch; + } + /** * Argument for command-line option {@code --link-platform-properties}. */ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java index 052fe0eb13b..71ec19d270c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java @@ -514,7 +514,7 @@ public class Extern { DocPath elempath; String moduleName = null; DocPath basePath = DocPath.create(path); - boolean issueWarning = true; + boolean showDiagnostic = true; while ((elemname = in.readLine()) != null) { if (elemname.length() > 0) { elempath = basePath; @@ -534,14 +534,14 @@ public class Extern { // For user provided libraries we check whether modularity matches the actual library. // We trust modularity to be correct for platform library element lists. if (platformVersion == 0) { - actualModuleName = checkLinkCompatibility(elemname, moduleName, path, issueWarning); + actualModuleName = checkLinkCompatibility(elemname, moduleName, path, showDiagnostic); } else { actualModuleName = moduleName == null ? DocletConstants.DEFAULT_ELEMENT_NAME : moduleName; } Item item = new Item(elemname, elempath, relative); packageItems.computeIfAbsent(actualModuleName, k -> new TreeMap<>()) .putIfAbsent(elemname, item); // first-one-wins semantics - issueWarning = false; + showDiagnostic = false; } } } @@ -556,25 +556,23 @@ public class Extern { * @param packageName the package name * @param moduleName the module name or null * @param path the documentation path - * @param issueWarning whether to print a warning in case of modularity mismatch + * @param showDiagnostic whether to print a diagnostic message in case of modularity mismatch * @return the module name to use according to actual modularity of the package */ - private String checkLinkCompatibility(String packageName, String moduleName, String path, boolean issueWarning) { + private String checkLinkCompatibility(String packageName, String moduleName, String path, boolean showDiagnostic) { PackageElement pe = utils.elementUtils.getPackageElement(packageName); if (pe != null) { ModuleElement me = (ModuleElement)pe.getEnclosingElement(); if (me == null || me.isUnnamed()) { - if (moduleName != null && issueWarning) { - configuration.getReporter().print(Kind.WARNING, - resources.getText("doclet.linkMismatch_PackagedLinkedtoModule", path)); + if (moduleName != null && showDiagnostic) { + printModularityMismatchDiagnostic("doclet.linkMismatch_PackagedLinkedtoModule", path); } // library is not modular, ignore module name even if documentation is modular return DocletConstants.DEFAULT_ELEMENT_NAME; } else if (moduleName == null) { - // suppress the warning message in the case of automatic modules - if (!utils.elementUtils.isAutomaticModule(me) && issueWarning) { - configuration.getReporter().print(Kind.WARNING, - resources.getText("doclet.linkMismatch_ModuleLinkedtoPackage", path)); + // suppress the diagnostic message in the case of automatic modules + if (!utils.elementUtils.isAutomaticModule(me) && showDiagnostic) { + printModularityMismatchDiagnostic("doclet.linkMismatch_ModuleLinkedtoPackage", path); } // library is modular, use module name for lookup even though documentation is not return utils.getModuleName(me); @@ -659,4 +657,11 @@ public class Extern { return in; } + + private void printModularityMismatchDiagnostic(String key, Object arg) { + switch (configuration.getOptions().linkModularityMismatch()) { + case INFO -> configuration.getMessages().notice(key, arg); + case WARN -> configuration.getMessages().warning(key, arg); + } + } } diff --git a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java index c12432322ff..4f7602251d8 100644 --- a/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java +++ b/test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOptionWithModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8205593 8240169 + * @bug 8205593 8240169 8274639 * @summary Javadoc -link makes broken links if module name matches package name * @library /tools/lib ../../lib * @modules @@ -71,6 +71,7 @@ public class TestLinkOptionWithModule extends JavadocTester { "--module", "com.ex1"); javadoc("-d", out2.toString(), + "-Werror", "-Xdoclint:-missing", "--module-source-path", moduleSrc.toString(), "--module", "com.ex2", "-link", "../" + out1.getFileName()); @@ -109,13 +110,14 @@ public class TestLinkOptionWithModule extends JavadocTester { "-subpackages", "com.ex1"); javadoc("-d", out2.toString(), + "--link-modularity-mismatch", "warn", "--module-source-path", moduleSrc.toString(), "--module", "com.ex2", "-link", "../" + out1.getFileName()); checkExit(Exit.OK); checkOutput(Output.OUT, true, - "The code being documented uses modules but the packages defined " + "warning: The code being documented uses modules but the packages defined " + "in ../out3a/ are in the unnamed module"); checkOutput("com.ex2/com/ex2/B.html", true, """ @@ -137,13 +139,62 @@ public class TestLinkOptionWithModule extends JavadocTester { checkExit(Exit.OK); checkOutput(Output.OUT, true, - "The code being documented uses packages in the unnamed module, but the packages defined " + "warning: The code being documented uses packages in the unnamed module, but the packages defined " + "in ../out4a/ are in named modules"); checkOutput("com/ex2/B.html", true, """ A"""); } + @Test + public void testModuleLinkedToPackageNoWarning(Path base) throws Exception { + Path out1 = base.resolve("out5a"), out2 = base.resolve("out5b"); + + javadoc("-d", out1.toString(), + "-sourcepath", packageSrc.toString(), + "-subpackages", "com.ex1"); + + javadoc("-d", out2.toString(), + "--link-modularity-mismatch", "info", + "-Werror", "-Xdoclint:-missing", + "--module-source-path", moduleSrc.toString(), + "--module", "com.ex2", + "-link", "../" + out1.getFileName()); + + checkExit(Exit.OK); + checkOutput(Output.OUT, true, + "The code being documented uses modules but the packages defined " + + "in ../out5a/ are in the unnamed module"); + checkOutput("com.ex2/com/ex2/B.html", true, + """ + A"""); + } + + @Test + public void testPackageLinkedToModuleNoWarning(Path base) throws Exception { + Path out1 = base.resolve("out6a"), out2 = base.resolve("out6b"); + + javadoc("-d", out1.toString(), + "--module-source-path", moduleSrc.toString(), + "--module", "com.ex1"); + + javadoc("-d", out2.toString(), + "--link-modularity-mismatch", "info", + "-quiet", // should not print modularity mismatch info + "-Werror", "-Xdoclint:-missing", + "-sourcepath", packageSrc.toString(), + "-subpackages", "com.ex2", + "-link", "../" + out1.getFileName()); + + checkExit(Exit.OK); + // Modularity mismatch diagnostic should not be printed because we're runnning with -quiet option + checkOutput(Output.OUT, false, + "The code being documented uses packages in the unnamed module, but the packages defined " + + "in ../out6a/ are in named modules"); + checkOutput("com/ex2/B.html", true, + """ + A"""); + } void initModulesAndPackages() throws Exception{ new ModuleBuilder(tb, "com.ex1") -- GitLab From 84ca14d0e90fd2c0390a07fc1bcfad0fce14cd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Thu, 2 Dec 2021 09:56:39 +0000 Subject: [PATCH 556/890] 8277194: applications/runthese/RunThese30M.java crashes with jfrSymbolTable.cpp:305 assert(_instance != null) Reviewed-by: shade --- src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp b/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp index 7f68d7b5de0..78970935016 100644 --- a/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp +++ b/src/hotspot/share/jfr/periodic/jfrFinalizerStatisticsEvent.cpp @@ -57,6 +57,9 @@ static void send_event(const FinalizerEntry* fe, const InstanceKlass* ik, const } void JfrFinalizerStatisticsEvent::send_unload_event(const InstanceKlass* ik) { + if (!EventFinalizerStatistics::is_enabled()) { + return; + } Thread* const thread = Thread::current(); ResourceMark rm(thread); send_event(FinalizerService::lookup(ik, thread), ik, JfrTicks::now(), thread); -- GitLab From 16cfbc4f4c0e979160cc8fb946453fa8afa5d1cc Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Thu, 2 Dec 2021 10:41:36 +0000 Subject: [PATCH 557/890] 8278071: typos in MemorySegment::set, MemorySegment::setAtIndex javadoc Reviewed-by: iris --- .../jdk/incubator/foreign/MemorySegment.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java index a2ead463451..49b393df241 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java @@ -1051,6 +1051,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfByte layout, long offset, byte value) { @@ -1084,6 +1085,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfBoolean layout, long offset, boolean value) { @@ -1117,6 +1119,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfChar layout, long offset, char value) { @@ -1150,6 +1153,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfShort layout, long offset, short value) { @@ -1183,6 +1187,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfInt layout, long offset, int value) { @@ -1216,6 +1221,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfFloat layout, long offset, float value) { @@ -1249,6 +1255,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfLong layout, long offset, long value) { @@ -1282,6 +1289,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfDouble layout, long offset, double value) { @@ -1315,6 +1323,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void set(ValueLayout.OfAddress layout, long offset, Addressable value) { @@ -1348,6 +1357,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfChar layout, long index, char value) { @@ -1381,6 +1391,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfShort layout, long index, short value) { @@ -1414,6 +1425,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfInt layout, long index, int value) { @@ -1447,6 +1459,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfFloat layout, long index, float value) { @@ -1480,6 +1493,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfLong layout, long index, long value) { @@ -1513,6 +1527,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfDouble layout, long index, double value) { @@ -1546,6 +1561,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalStateException if the scope associated with this segment has been closed, or if access occurs from * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the + * memory segment. */ @ForceInline default void setAtIndex(ValueLayout.OfAddress layout, long index, Addressable value) { -- GitLab From e002bfec8cb815b551c9b0f851a8a5b288e8360d Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 2 Dec 2021 10:45:36 +0000 Subject: [PATCH 558/890] 8278049: G1: add precondition to set_remainder_to_point_to_start Reviewed-by: mli, tschatzl --- src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp index dfb5da1a7a4..c98aa2c79a2 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -97,14 +97,7 @@ void G1BlockOffsetTablePart::update() { // The arguments follow the normal convention of denoting // a right-open interval: [start, end) void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) { - - if (start >= end) { - // The start address is equal to the end address (or to - // the right of the end address) so there are not cards - // that need to be updated.. - return; - } - + assert(start < end, "precondition"); // Write the backskip value for each region. // // offset @@ -149,9 +142,7 @@ void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, H // a closed, inclusive interval: [start_card, end_card], cf set_remainder_to_point_to_start() // above. void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_card, size_t end_card) { - if (start_card > end_card) { - return; - } + assert(start_card <= end_card, "precondition"); assert(start_card > _bot->index_for(_hr->bottom()), "Cannot be first card"); assert(_bot->offset_array(start_card-1) <= BOTConstants::N_words, "Offset card has an unexpected value"); -- GitLab From ea905bd3dad5fc1baad66e714bdd01fa679d2d46 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Thu, 2 Dec 2021 11:22:31 +0000 Subject: [PATCH 559/890] 8277924: Small tweaks to foreign function and memory API Reviewed-by: jvernee, psandoz --- .../incubator/foreign/FunctionDescriptor.java | 46 ++++++++++++++----- .../foreign/abi/CallingSequenceBuilder.java | 4 +- .../java/foreign/TestFunctionDescriptor.java | 8 ++-- test/jdk/java/foreign/TestIntrinsics.java | 3 +- test/jdk/java/foreign/TestUpcall.java | 30 ++++++++++-- .../callarranger/TestSysVCallArranger.java | 24 +++++----- .../bench/jdk/incubator/foreign/Upcalls.java | 2 +- 7 files changed, 79 insertions(+), 38 deletions(-) diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java index 8c40668d505..9c557ec9e9e 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/FunctionDescriptor.java @@ -97,7 +97,7 @@ public sealed class FunctionDescriptor implements Constable permits FunctionDesc * Obtain a specialized variadic function descriptor, by appending given variadic layouts to this * function descriptor argument layouts. The resulting function descriptor can report the position * of the {@linkplain #firstVariadicArgumentIndex() first variadic argument}, and cannot be altered - * in any way: for instance, calling {@link #withReturnLayout(MemoryLayout)} on the resulting descriptor + * in any way: for instance, calling {@link #changeReturnLayout(MemoryLayout)} on the resulting descriptor * will throw an {@link UnsupportedOperationException}. * @param variadicLayouts the variadic argument layouts to be appended to this descriptor argument layouts. * @return a new variadic function descriptor, or this descriptor if {@code variadicLayouts.length == 0}. @@ -123,10 +123,26 @@ public sealed class FunctionDescriptor implements Constable permits FunctionDesc * @param addedLayouts the argument layouts to append. * @return the new function descriptor. */ - public FunctionDescriptor withAppendedArgumentLayouts(MemoryLayout... addedLayouts) { - Objects.requireNonNull(addedLayouts); - Arrays.stream(addedLayouts).forEach(Objects::requireNonNull); - List newLayouts = Stream.concat(argLayouts.stream(), Stream.of(addedLayouts)).toList(); + public FunctionDescriptor appendArgumentLayouts(MemoryLayout... addedLayouts) { + return insertArgumentLayouts(argLayouts.size(), addedLayouts); + } + + /** + * Create a new function descriptor with the given argument layouts inserted at the given index, into the argument + * layout array of this function descriptor. + * @param index the index at which to insert the arguments + * @param addedLayouts the argument layouts to insert at given index. + * @return the new function descriptor. + * @throws IllegalArgumentException if {@code index < 0 || index > argumentLayouts().size()}. + */ + public FunctionDescriptor insertArgumentLayouts(int index, MemoryLayout... addedLayouts) { + if (index < 0 || index > argLayouts.size()) + throw new IllegalArgumentException("Index out of bounds: " + index); + List added = List.of(addedLayouts); // null check on array and its elements + List newLayouts = new ArrayList<>(argLayouts.size() + addedLayouts.length); + newLayouts.addAll(argLayouts.subList(0, index)); + newLayouts.addAll(added); + newLayouts.addAll(argLayouts.subList(index, argLayouts.size())); return new FunctionDescriptor(resLayout, newLayouts); } @@ -135,16 +151,17 @@ public sealed class FunctionDescriptor implements Constable permits FunctionDesc * @param newReturn the new return layout. * @return the new function descriptor. */ - public FunctionDescriptor withReturnLayout(MemoryLayout newReturn) { + public FunctionDescriptor changeReturnLayout(MemoryLayout newReturn) { Objects.requireNonNull(newReturn); return new FunctionDescriptor(newReturn, argLayouts); } /** - * Create a new function descriptor with the return layout dropped. + * Create a new function descriptor with the return layout dropped. This is useful to model functions + * which return no values. * @return the new function descriptor. */ - public FunctionDescriptor withVoidReturnLayout() { + public FunctionDescriptor dropReturnLayout() { return new FunctionDescriptor(null, argLayouts); } @@ -212,7 +229,7 @@ public sealed class FunctionDescriptor implements Constable permits FunctionDesc constants.add(argLayout.describeConstable().get()); } return Optional.of(DynamicConstantDesc.ofNamed( - ConstantDescs.BSM_INVOKE, "function", AbstractLayout.CD_FUNCTION_DESC, constants.toArray(new ConstantDesc[0]))); + ConstantDescs.BSM_INVOKE, "function", AbstractLayout.CD_FUNCTION_DESC, constants.toArray(new ConstantDesc[0]))); } static final class VariadicFunction extends FunctionDescriptor { @@ -231,17 +248,22 @@ public sealed class FunctionDescriptor implements Constable permits FunctionDesc } @Override - public FunctionDescriptor withAppendedArgumentLayouts(MemoryLayout... addedLayouts) { + public FunctionDescriptor appendArgumentLayouts(MemoryLayout... addedLayouts) { + throw new UnsupportedOperationException(); + } + + @Override + public FunctionDescriptor insertArgumentLayouts(int index, MemoryLayout... addedLayouts) { throw new UnsupportedOperationException(); } @Override - public FunctionDescriptor withReturnLayout(MemoryLayout newReturn) { + public FunctionDescriptor changeReturnLayout(MemoryLayout newReturn) { throw new UnsupportedOperationException(); } @Override - public FunctionDescriptor withVoidReturnLayout() { + public FunctionDescriptor dropReturnLayout() { throw new UnsupportedOperationException(); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java index 633b9d366d6..3f36ec22f2f 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java @@ -59,7 +59,7 @@ public class CallingSequenceBuilder { verifyBindings(true, carrier, bindings); inputBindings.add(bindings); mt = mt.appendParameterTypes(carrier); - desc = desc.withAppendedArgumentLayouts(layout); + desc = desc.appendArgumentLayouts(layout); return this; } @@ -68,7 +68,7 @@ public class CallingSequenceBuilder { verifyBindings(false, carrier, bindings); this.outputBindings = bindings; mt = mt.changeReturnType(carrier); - desc = desc.withReturnLayout(layout); + desc = desc.changeReturnLayout(layout); return this; } diff --git a/test/jdk/java/foreign/TestFunctionDescriptor.java b/test/jdk/java/foreign/TestFunctionDescriptor.java index e67c5b9a3fa..7f6eb908744 100644 --- a/test/jdk/java/foreign/TestFunctionDescriptor.java +++ b/test/jdk/java/foreign/TestFunctionDescriptor.java @@ -32,10 +32,8 @@ import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.MemoryLayout; import org.testng.annotations.Test; -import java.lang.constant.Constable; import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; @@ -67,7 +65,7 @@ public class TestFunctionDescriptor extends NativeTestHelper { @Test public void testAppendArgumentLayouts() { FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); - fd = fd.withAppendedArgumentLayouts(C_POINTER); + fd = fd.appendArgumentLayouts(C_POINTER); assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG, C_POINTER)); Optional returnLayoutOp = fd.returnLayout(); @@ -78,7 +76,7 @@ public class TestFunctionDescriptor extends NativeTestHelper { @Test public void testChangeReturnLayout() { FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); - fd = fd.withReturnLayout(C_INT); + fd = fd.changeReturnLayout(C_INT); assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG)); Optional returnLayoutOp = fd.returnLayout(); @@ -89,7 +87,7 @@ public class TestFunctionDescriptor extends NativeTestHelper { @Test public void testDropReturnLayout() { FunctionDescriptor fd = FunctionDescriptor.of(C_INT, C_DOUBLE, C_LONG_LONG); - fd = fd.withVoidReturnLayout(); + fd = fd.dropReturnLayout(); assertEquals(fd.argumentLayouts(), List.of(C_DOUBLE, C_LONG_LONG)); Optional returnLayoutOp = fd.returnLayout(); diff --git a/test/jdk/java/foreign/TestIntrinsics.java b/test/jdk/java/foreign/TestIntrinsics.java index dfafdfc3a21..1d4afce2289 100644 --- a/test/jdk/java/foreign/TestIntrinsics.java +++ b/test/jdk/java/foreign/TestIntrinsics.java @@ -40,7 +40,6 @@ import java.lang.invoke.MethodType; import java.util.ArrayList; import java.util.List; -import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SymbolLookup; @@ -127,7 +126,7 @@ public class TestIntrinsics extends NativeTestHelper { for (int i = 0; i < args.length; i++) { NativeSymbol ma = LOOKUP.lookup("invoke_high_arity" + i).get(); MethodType mt = baseMT.changeReturnType(baseMT.parameterType(i)); - FunctionDescriptor fd = baseFD.withReturnLayout(baseFD.argumentLayouts().get(i)); + FunctionDescriptor fd = baseFD.changeReturnLayout(baseFD.argumentLayouts().get(i)); Object expected = args[i]; tests.add(abi.downcallHandle(ma, fd), expected, args); } diff --git a/test/jdk/java/foreign/TestUpcall.java b/test/jdk/java/foreign/TestUpcall.java index 9ee7a381cae..c6959d7d131 100644 --- a/test/jdk/java/foreign/TestUpcall.java +++ b/test/jdk/java/foreign/TestUpcall.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -22,6 +22,30 @@ * */ +/* + * @test id=scope + * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" + * @modules jdk.incubator.foreign/jdk.internal.foreign + * @build NativeTestHelper CallGeneratorHelper TestUpcall + * + * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 + * -DUPCALL_TEST_TYPE=SCOPE + * TestUpcall + */ + +/* + * @test id=no_scope + * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" + * @modules jdk.incubator.foreign/jdk.internal.foreign + * @build NativeTestHelper CallGeneratorHelper TestUpcall + * + * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + * --enable-native-access=ALL-UNNAMED -Dgenerator.sample.factor=17 + * -DUPCALL_TEST_TYPE=NO_SCOPE + * TestUpcall + */ + /* * @test id=async * @requires ((os.arch == "amd64" | os.arch == "x86_64") & sun.arch.data.model == "64") | os.arch == "aarch64" @@ -34,13 +58,11 @@ * TestUpcall */ -import jdk.incubator.foreign.Addressable; import jdk.incubator.foreign.CLinker; import jdk.incubator.foreign.FunctionDescriptor; import jdk.incubator.foreign.NativeSymbol; import jdk.incubator.foreign.SegmentAllocator; import jdk.incubator.foreign.SymbolLookup; -import jdk.incubator.foreign.MemoryAddress; import jdk.incubator.foreign.MemoryLayout; import jdk.incubator.foreign.MemorySegment; @@ -104,7 +126,7 @@ public class TestUpcall extends CallGeneratorHelper { private static void checkSelected(TestType type) { if (UPCALL_TEST_TYPE != type) - return;//throw new SkipException("Skipping tests that were not selected"); + throw new SkipException("Skipping tests that were not selected"); } @Test(dataProvider="functions", dataProviderClass=CallGeneratorHelper.class) diff --git a/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java b/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java index 668132bc1de..ea1382e4a2e 100644 --- a/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java +++ b/test/jdk/java/foreign/callarranger/TestSysVCallArranger.java @@ -62,7 +62,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { vmStore(rax, long.class) } @@ -89,7 +89,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { dup(), bufferLoad(0, long.class), vmStore(rdi, long.class), @@ -119,7 +119,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { dup(), bufferLoad(0, long.class), vmStore(rdi, long.class), @@ -148,7 +148,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { dup(), bufferLoad(0, long.class), vmStore(stackStorage(0), long.class), @@ -177,7 +177,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { dup(), bufferLoad(0, long.class), vmStore(stackStorage(0), long.class), @@ -201,7 +201,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { vmStore(rdi, int.class) }, @@ -231,7 +231,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { vmStore(xmm0, double.class) }, @@ -265,7 +265,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { vmStore(rdi, long.class) }, @@ -321,7 +321,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { vmStore(rdi, int.class) }, @@ -363,7 +363,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { unboxAddress(), vmStore(rdi, long.class) }, @@ -384,7 +384,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ expectedBindings, @@ -442,7 +442,7 @@ public class TestSysVCallArranger extends CallArrangerTestBase { assertFalse(bindings.isInMemoryReturn); CallingSequence callingSequence = bindings.callingSequence; assertEquals(callingSequence.methodType(), mt.appendParameterTypes(long.class)); - assertEquals(callingSequence.functionDesc(), fd.withAppendedArgumentLayouts(C_LONG)); + assertEquals(callingSequence.functionDesc(), fd.appendArgumentLayouts(C_LONG)); checkArgumentBindings(callingSequence, new Binding[][]{ { vmStore(rax, long.class) } diff --git a/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java b/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java index 12a7ca3b42b..06a25c4ab3a 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/foreign/Upcalls.java @@ -124,7 +124,7 @@ public class Upcalls extends CLayouts { static MethodHandle linkFunc(String name, FunctionDescriptor baseDesc) { return abi.downcallHandle( SymbolLookup.loaderLookup().lookup(name).orElseThrow(), - baseDesc.withAppendedArgumentLayouts(C_POINTER) + baseDesc.appendArgumentLayouts(C_POINTER) ); } -- GitLab From b79554bb5cef14590d427543a40efbcc60c66548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Thu, 2 Dec 2021 11:33:46 +0000 Subject: [PATCH 560/890] 8278130: Failure in jdk/javadoc/tool/CheckManPageOptions.java after JDK-8274639 Reviewed-by: prappo --- test/langtools/jdk/javadoc/tool/CheckManPageOptions.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/langtools/jdk/javadoc/tool/CheckManPageOptions.java b/test/langtools/jdk/javadoc/tool/CheckManPageOptions.java index 437b55da677..8b8202e9fe5 100644 --- a/test/langtools/jdk/javadoc/tool/CheckManPageOptions.java +++ b/test/langtools/jdk/javadoc/tool/CheckManPageOptions.java @@ -60,10 +60,11 @@ public class CheckManPageOptions { static final PrintStream out = System.err; - // FIXME: JDK-8274295, JDK-8266666 + // FIXME: JDK-8274295, JDK-8266666, JDK-8278077 List MISSING_IN_MAN_PAGE = List.of( "--add-script", "--legal-notices", + "--link-modularity-mismatch", "--link-platform-properties", "--no-platform-links", "--since", -- GitLab From 3d98ec1b7bc77237177ecfc069c0e9a7e75829bc Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Thu, 2 Dec 2021 13:00:14 +0000 Subject: [PATCH 561/890] 8273056: java.util.random does not correctly sample exponential or Gaussian distributions Co-authored-by: Guy Steele Reviewed-by: bpb, darcy --- .../internal/util/random/RandomSupport.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java b/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java index 1d64432979d..d47043b89aa 100644 --- a/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java +++ b/src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java @@ -1186,10 +1186,10 @@ public class RandomSupport { // For the exponential distribution, every overhang is convex. final double[] X = DoubleZigguratTables.exponentialX; final double[] Y = DoubleZigguratTables.exponentialY; - for (;; U1 = (rng.nextLong() >>> 1)) { + // At this point, the high-order bits of U1 have not been used yet, + // but we need the value in U1 to be positive. + for (U1 = (U1 >>> 1);; U1 = (rng.nextLong() >>> 1)) { long U2 = (rng.nextLong() >>> 1); - // Compute the actual x-coordinate of the randomly chosen point. - double x = (X[j] * 0x1.0p63) + ((X[j-1] - X[j]) * (double)U1); // Does the point lie below the curve? long Udiff = U2 - U1; if (Udiff < 0) { @@ -1200,11 +1200,13 @@ public class RandomSupport { U2 = U1; U1 -= Udiff; } + // Compute the actual x-coordinate of the randomly chosen point. + double x = (X[j] * 0x1.0p63) + ((X[j-1] - X[j]) * (double)U1); if (Udiff >= DoubleZigguratTables.exponentialConvexMargin) { return x + extra; // The chosen point is way below the curve; accept it. } // Compute the actual y-coordinate of the randomly chosen point. - double y = (Y[j] * 0x1.0p63) + ((Y[j] - Y[j-1]) * (double)U2); + double y = (Y[j] * 0x1.0p63) + ((Y[j-1] - Y[j]) * (double)U2); // Now see how that y-coordinate compares to the curve if (y <= Math.exp(-x)) { return x + extra; // The chosen point is below the curve; accept it. @@ -1323,7 +1325,7 @@ public class RandomSupport { continue; // The chosen point is way above the curve; reject it. } // Compute the actual y-coordinate of the randomly chosen point. - double y = (Y[j] * 0x1.0p63) + ((Y[j] - Y[j-1]) * (double)U2); + double y = (Y[j] * 0x1.0p63) + ((Y[j-1] - Y[j]) * (double)U2); // Now see how that y-coordinate compares to the curve if (y <= Math.exp(-0.5*x*x)) { break; // The chosen point is below the curve; accept it. @@ -1348,8 +1350,6 @@ public class RandomSupport { } else if (j < DoubleZigguratTables.normalInflectionIndex) { // Convex overhang for (;; U1 = (rng.nextLong() >>> 1)) { long U2 = (rng.nextLong() >>> 1); - // Compute the actual x-coordinate of the randomly chosen point. - x = (X[j] * 0x1.0p63) + ((X[j-1] - X[j]) * (double)U1); // Does the point lie below the curve? long Udiff = U2 - U1; if (Udiff < 0) { @@ -1360,11 +1360,13 @@ public class RandomSupport { U2 = U1; U1 -= Udiff; } + // Compute the actual x-coordinate of the randomly chosen point. + x = (X[j] * 0x1.0p63) + ((X[j-1] - X[j]) * (double)U1); if (Udiff >= DoubleZigguratTables.normalConvexMargin) { break; // The chosen point is way below the curve; accept it. } // Compute the actual y-coordinate of the randomly chosen point. - double y = (Y[j] * 0x1.0p63) + ((Y[j] - Y[j-1]) * (double)U2); + double y = (Y[j] * 0x1.0p63) + ((Y[j-1] - Y[j]) * (double)U2); // Now see how that y-coordinate compares to the curve if (y <= Math.exp(-0.5*x*x)) break; // The chosen point is below the curve; accept it. // Otherwise, we reject this sample and have to try again. @@ -1384,7 +1386,7 @@ public class RandomSupport { continue; // The chosen point is way above the curve; reject it. } // Compute the actual y-coordinate of the randomly chosen point. - double y = (Y[j] * 0x1.0p63) + ((Y[j] - Y[j-1]) * (double)U2); + double y = (Y[j] * 0x1.0p63) + ((Y[j-1] - Y[j]) * (double)U2); // Now see how that y-coordinate compares to the curve if (y <= Math.exp(-0.5*x*x)) { break; // The chosen point is below the curve; accept it. -- GitLab From 7696897932a35708b1632517127c1a3a59919878 Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Thu, 2 Dec 2021 14:08:33 +0000 Subject: [PATCH 562/890] 8276837: [macos]: Error when signing the additional launcher Reviewed-by: asemenyuk, almatvee --- .../jpackage/internal/MacAppImageBuilder.java | 47 +++++++++---------- .../jdk/jpackage/internal/IOUtils.java | 24 +++++++--- .../jpackage/macosx/SigningAppImageTest.java | 7 +++ 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java index f1eed5f5f15..fd33ffbb3db 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java @@ -593,7 +593,6 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { Log.error(I18N.getString("message.keychain.error")); return; } - boolean contains = keychainList.stream().anyMatch( str -> str.trim().equals("\""+keyChainPath.trim()+"\"")); if (contains) { @@ -608,7 +607,9 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { if (path.startsWith("\"") && path.endsWith("\"")) { path = path.substring(1, path.length()-1); } - keyChains.add(path); + if (!keyChains.contains(path)) { + keyChains.add(path); + } }); List args = new ArrayList<>(); @@ -682,27 +683,23 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { Log.verbose(MessageFormat.format(I18N.getString( "message.ignoring.symlink"), p.toString())); } else { - List args; - // runtime and Framework files will be signed below - // but they need to be unsigned first here - if ((p.toString().contains("/Contents/runtime")) || - (p.toString().contains("/Contents/Frameworks"))) { - - args = new ArrayList<>(); - args.addAll(Arrays.asList("/usr/bin/codesign", - "--remove-signature", p.toString())); - try { - Set oldPermissions = - Files.getPosixFilePermissions(p); - p.toFile().setWritable(true, true); - ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb); - Files.setPosixFilePermissions(p,oldPermissions); - } catch (IOException ioe) { - Log.verbose(ioe); - toThrow.set(ioe); - return; - } + // unsign everything before signing + List args = new ArrayList<>(); + args.addAll(Arrays.asList("/usr/bin/codesign", + "--remove-signature", p.toString())); + try { + Set oldPermissions = + Files.getPosixFilePermissions(p); + p.toFile().setWritable(true, true); + ProcessBuilder pb = new ProcessBuilder(args); + // run quietly + IOUtils.exec(pb, false, null, false, + Executor.INFINITE_TIMEOUT, true); + Files.setPosixFilePermissions(p,oldPermissions); + } catch (IOException ioe) { + Log.verbose(ioe); + toThrow.set(ioe); + return; } args = new ArrayList<>(); args.addAll(Arrays.asList("/usr/bin/codesign", @@ -727,7 +724,9 @@ public class MacAppImageBuilder extends AbstractAppImageBuilder { Files.getPosixFilePermissions(p); p.toFile().setWritable(true, true); ProcessBuilder pb = new ProcessBuilder(args); - IOUtils.exec(pb); + // run quietly + IOUtils.exec(pb, false, null, false, + Executor.INFINITE_TIMEOUT, true); Files.setPosixFilePermissions(p, oldPermissions); } catch (IOException ioe) { toThrow.set(ioe); diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java index bc32df6a9ba..b52285bc0ff 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java @@ -190,14 +190,24 @@ public class IOUtils { static void exec(ProcessBuilder pb, boolean testForPresenceOnly, PrintStream consumer, boolean writeOutputToFile, long timeout) throws IOException { + exec(pb, testForPresenceOnly, consumer, writeOutputToFile, + Executor.INFINITE_TIMEOUT, false); + } + + static void exec(ProcessBuilder pb, boolean testForPresenceOnly, + PrintStream consumer, boolean writeOutputToFile, + long timeout, boolean quiet) throws IOException { List output = new ArrayList<>(); - Executor exec = Executor.of(pb).setWriteOutputToFile(writeOutputToFile) - .setTimeout(timeout).setOutputConsumer(lines -> { - lines.forEach(output::add); - if (consumer != null) { - output.forEach(consumer::println); - } - }); + Executor exec = Executor.of(pb) + .setWriteOutputToFile(writeOutputToFile) + .setTimeout(timeout) + .setQuiet(quiet) + .setOutputConsumer(lines -> { + lines.forEach(output::add); + if (consumer != null) { + output.forEach(consumer::println); + } + }); if (testForPresenceOnly) { exec.execute(); diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java index cd30b24f350..1ebef43dad8 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java @@ -24,6 +24,7 @@ import java.nio.file.Path; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.AdditionalLauncher; /** * Tests generation of app image with --mac-sign and related arguments. Test will @@ -65,11 +66,17 @@ public class SigningAppImageTest { cmd.addArguments("--mac-sign", "--mac-signing-key-user-name", SigningBase.DEV_NAME, "--mac-signing-keychain", SigningBase.KEYCHAIN); + + AdditionalLauncher testAL = new AdditionalLauncher("testAL"); + testAL.applyTo(cmd); cmd.executeAndAssertHelloAppImageCreated(); Path launcherPath = cmd.appLauncherPath(); SigningBase.verifyCodesign(launcherPath, true); + Path testALPath = launcherPath.getParent().resolve("testAL"); + SigningBase.verifyCodesign(testALPath, true); + Path appImage = cmd.outputBundle(); SigningBase.verifyCodesign(appImage, true); SigningBase.verifySpctl(appImage, "exec"); -- GitLab From d2b16c89855d584a563caa4f725802dc91a83407 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Thu, 2 Dec 2021 14:39:27 +0000 Subject: [PATCH 563/890] 8276126: Dump time class transformation causes heap objects of non-boot classes to be archived Reviewed-by: iklam, minqi --- src/hotspot/share/cds/heapShared.cpp | 1 + src/hotspot/share/cds/heapShared.hpp | 11 ++- src/hotspot/share/classfile/classLoader.cpp | 11 ++- src/hotspot/share/classfile/classLoader.hpp | 3 +- .../share/classfile/classLoaderExt.cpp | 20 +++- .../share/classfile/classLoaderExt.hpp | 2 +- src/hotspot/share/classfile/klassFactory.cpp | 2 +- test/hotspot/jtreg/TEST.groups | 1 + .../cds/appcds/LambdaWithJavaAgent.java | 93 +++++++++++++++++++ .../test-classes/TransformBootClass.java | 62 +++++++++++++ .../appcds/test-classes/TransformBootClass.mf | 5 + 11 files changed, 201 insertions(+), 10 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.java create mode 100644 test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.mf diff --git a/src/hotspot/share/cds/heapShared.cpp b/src/hotspot/share/cds/heapShared.cpp index aa4694168c1..2ae72ffb5ed 100644 --- a/src/hotspot/share/cds/heapShared.cpp +++ b/src/hotspot/share/cds/heapShared.cpp @@ -71,6 +71,7 @@ bool HeapShared::_closed_regions_mapped = false; bool HeapShared::_open_regions_mapped = false; bool HeapShared::_is_loaded = false; +bool HeapShared::_disable_writing = false; address HeapShared::_narrow_oop_base; int HeapShared::_narrow_oop_shift; DumpedInternedStrings *HeapShared::_dumped_interned_strings = NULL; diff --git a/src/hotspot/share/cds/heapShared.hpp b/src/hotspot/share/cds/heapShared.hpp index 0a673c51e86..52a8de9ad46 100644 --- a/src/hotspot/share/cds/heapShared.hpp +++ b/src/hotspot/share/cds/heapShared.hpp @@ -155,10 +155,18 @@ public: // Can this VM write heap regions into the CDS archive? Currently only G1+compressed{oops,cp} static bool can_write() { - CDS_JAVA_HEAP_ONLY(return (UseG1GC && UseCompressedOops && UseCompressedClassPointers);) + CDS_JAVA_HEAP_ONLY( + if (_disable_writing) { + return false; + } + return (UseG1GC && UseCompressedOops && UseCompressedClassPointers); + ) NOT_CDS_JAVA_HEAP(return false;) } + static void disable_writing() { + CDS_JAVA_HEAP_ONLY(_disable_writing = true;) + } // Can this VM map archived heap regions? Currently only G1+compressed{oops,cp} static bool can_map() { CDS_JAVA_HEAP_ONLY(return (UseG1GC && UseCompressedOops && UseCompressedClassPointers);) @@ -188,6 +196,7 @@ public: private: #if INCLUDE_CDS_JAVA_HEAP + static bool _disable_writing; static bool _closed_regions_mapped; static bool _open_regions_mapped; static bool _is_loaded; diff --git a/src/hotspot/share/classfile/classLoader.cpp b/src/hotspot/share/classfile/classLoader.cpp index cf5ede2415f..d5ac1c308fd 100644 --- a/src/hotspot/share/classfile/classLoader.cpp +++ b/src/hotspot/share/classfile/classLoader.cpp @@ -1253,7 +1253,8 @@ char* ClassLoader::skip_uri_protocol(char* source) { // Record the shared classpath index and loader type for classes loaded // by the builtin loaders at dump time. -void ClassLoader::record_result(JavaThread* current, InstanceKlass* ik, const ClassFileStream* stream) { +void ClassLoader::record_result(JavaThread* current, InstanceKlass* ik, + const ClassFileStream* stream, bool redefined) { Arguments::assert_is_dumping_archive(); assert(stream != NULL, "sanity"); @@ -1337,10 +1338,10 @@ void ClassLoader::record_result(JavaThread* current, InstanceKlass* ik, const Cl } } - // No path entry found for this class. Must be a shared class loaded by the + // No path entry found for this class: most likely a shared class loaded by the // user defined classloader. - if (classpath_index < 0) { - assert(ik->shared_classpath_index() < 0, "Sanity"); + if (classpath_index < 0 && !SystemDictionaryShared::is_builtin_loader(ik->class_loader_data())) { + assert(ik->shared_classpath_index() < 0, "not assigned yet"); ik->set_shared_classpath_index(UNREGISTERED_INDEX); SystemDictionaryShared::set_shared_class_misc_info(ik, (ClassFileStream*)stream); return; @@ -1359,7 +1360,7 @@ void ClassLoader::record_result(JavaThread* current, InstanceKlass* ik, const Cl ik->name()->utf8_length()); assert(file_name != NULL, "invariant"); - ClassLoaderExt::record_result(classpath_index, ik); + ClassLoaderExt::record_result(classpath_index, ik, redefined); } #endif // INCLUDE_CDS diff --git a/src/hotspot/share/classfile/classLoader.hpp b/src/hotspot/share/classfile/classLoader.hpp index 9cafdd2a83e..c454a503a2e 100644 --- a/src/hotspot/share/classfile/classLoader.hpp +++ b/src/hotspot/share/classfile/classLoader.hpp @@ -365,7 +365,8 @@ class ClassLoader: AllStatic { static int num_module_path_entries(); static void exit_with_path_failure(const char* error, const char* message); static char* skip_uri_protocol(char* source); - static void record_result(JavaThread* current, InstanceKlass* ik, const ClassFileStream* stream); + static void record_result(JavaThread* current, InstanceKlass* ik, + const ClassFileStream* stream, bool redefined); #endif static char* lookup_vm_options(); diff --git a/src/hotspot/share/classfile/classLoaderExt.cpp b/src/hotspot/share/classfile/classLoaderExt.cpp index e571f2deda8..b6da1fb52c0 100644 --- a/src/hotspot/share/classfile/classLoaderExt.cpp +++ b/src/hotspot/share/classfile/classLoaderExt.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "cds/filemap.hpp" +#include "cds/heapShared.hpp" #include "classfile/classFileParser.hpp" #include "classfile/classLoader.inline.hpp" #include "classfile/classLoaderExt.hpp" @@ -227,7 +228,7 @@ void ClassLoaderExt::setup_search_paths(JavaThread* current) { ClassLoaderExt::setup_app_search_path(current); } -void ClassLoaderExt::record_result(const s2 classpath_index, InstanceKlass* result) { +void ClassLoaderExt::record_result(const s2 classpath_index, InstanceKlass* result, bool redefined) { Arguments::assert_is_dumping_archive(); // We need to remember where the class comes from during dumping. @@ -245,4 +246,21 @@ void ClassLoaderExt::record_result(const s2 classpath_index, InstanceKlass* resu } result->set_shared_classpath_index(classpath_index); result->set_shared_class_loader_type(classloader_type); +#if INCLUDE_CDS_JAVA_HEAP + if (DumpSharedSpaces && AllowArchivingWithJavaAgent && classloader_type == ClassLoader::BOOT_LOADER && + classpath_index < 0 && HeapShared::can_write() && redefined) { + // During static dump, classes for the built-in loaders are always loaded from + // known locations (jimage, classpath or modulepath), so classpath_index should + // always be >= 0. + // The only exception is when a java agent is used during dump time (for testing + // purposes only). If a class is transformed by the agent, the CodeSource of + // this class may point to an unknown location. This may break heap object archiving, + // which requires all the boot classes to be from known locations. This is an + // uncommon scenario (even in test cases). Let's simply disable heap object archiving. + ResourceMark rm; + log_warning(cds)("CDS heap objects cannot be written because class %s maybe modified by ClassFileLoadHook.", + result->external_name()); + HeapShared::disable_writing(); + } +#endif // INCLUDE_CDS_JAVA_HEAP } diff --git a/src/hotspot/share/classfile/classLoaderExt.hpp b/src/hotspot/share/classfile/classLoaderExt.hpp index cbc5481db78..7e58bc6d1e3 100644 --- a/src/hotspot/share/classfile/classLoaderExt.hpp +++ b/src/hotspot/share/classfile/classLoaderExt.hpp @@ -111,7 +111,7 @@ public: return _has_non_jar_in_classpath; } - static void record_result(const s2 classpath_index, InstanceKlass* result); + static void record_result(const s2 classpath_index, InstanceKlass* result, bool redefined); static void set_has_app_classes() { _has_app_classes = true; } diff --git a/src/hotspot/share/classfile/klassFactory.cpp b/src/hotspot/share/classfile/klassFactory.cpp index 7b5960ee36e..de3e176a464 100644 --- a/src/hotspot/share/classfile/klassFactory.cpp +++ b/src/hotspot/share/classfile/klassFactory.cpp @@ -211,7 +211,7 @@ InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream, #if INCLUDE_CDS if (Arguments::is_dumping_archive()) { - ClassLoader::record_result(THREAD, result, stream); + ClassLoader::record_result(THREAD, result, stream, old_stream != stream); } #endif // INCLUDE_CDS diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 9578e55493a..c2d58ee5d47 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -354,6 +354,7 @@ hotspot_appcds_dynamic = \ -runtime/cds/appcds/LambdaEagerInit.java \ -runtime/cds/appcds/LambdaProxyClasslist.java \ -runtime/cds/appcds/LambdaVerificationFailedDuringDump.java \ + -runtime/cds/appcds/LambdaWithJavaAgent.java \ -runtime/cds/appcds/LambdaWithOldClass.java \ -runtime/cds/appcds/LongClassListPath.java \ -runtime/cds/appcds/LotsOfClasses.java \ diff --git a/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java b/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java new file mode 100644 index 00000000000..3398b9f66a4 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021, 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 8276126 + * @summary Test static dumping with java agent transforming a class loaded + * by the boot class loader. + * @requires vm.cds.write.archived.java.heap + * @requires vm.jvmti + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds/test-classes + * @compile test-classes/Hello.java + * @compile test-classes/TransformBootClass.java + * @run driver LambdaWithJavaAgent + */ + +import jdk.test.lib.cds.CDSOptions; +import jdk.test.lib.cds.CDSTestUtils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.helpers.ClassFileInstaller; + +public class LambdaWithJavaAgent { + + public static String agentClasses[] = { + TransformBootClass.class.getName(), + }; + + public static void main(String[] args) throws Exception { + String mainClass = Hello.class.getName(); + String namePrefix = "lambda-with-java-agent"; + JarBuilder.build(namePrefix, mainClass); + + String appJar = TestCommon.getTestJar(namePrefix + ".jar"); + String classList = namePrefix + ".list"; + String archiveName = namePrefix + ".jsa"; + + String agentJar = + ClassFileInstaller.writeJar("TransformBootClass.jar", + ClassFileInstaller.Manifest.fromSourceFile("test-classes/TransformBootClass.mf"), + agentClasses); + String useJavaAgent = "-javaagent:" + agentJar + "=jdk/internal/math/FDBigInteger"; + + // dump class list + CDSTestUtils.dumpClassList(classList, "-cp", appJar, mainClass); + + // create archive with the class list + CDSOptions opts = (new CDSOptions()) + .addPrefix("-XX:ExtraSharedClassListFile=" + classList, + "-cp", appJar, + "-XX:+AllowArchivingWithJavaAgent", + useJavaAgent, + "-Xlog:class+load,cds+class=debug,cds") + .setArchiveName(archiveName); + OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts); + output.shouldContain("CDS heap objects cannot be written because class jdk.internal.math.FDBigInteger maybe modified by ClassFileLoadHook") + .shouldContain("Skipping jdk/internal/math/FDBigInteger: Unsupported location") + .shouldMatch(".class.load.*jdk.internal.math.FDBigInteger.*source.*modules"); + + // run with archive + CDSOptions runOpts = (new CDSOptions()) + .addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug", + "-XX:+AllowArchivingWithJavaAgent", + useJavaAgent) + .setArchiveName(archiveName) + .setUseVersion(false) + .addSuffix(mainClass); + output = CDSTestUtils.runWithArchive(runOpts); + TestCommon.checkExecReturn(output, 0, true, + "Hello source: shared objects file"); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.java b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.java new file mode 100644 index 00000000000..e13c768cc99 --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021, 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.lang.instrument.ClassFileTransformer; +import java.lang.instrument.Instrumentation; +import java.lang.instrument.IllegalClassFormatException; +import java.security.ProtectionDomain; + +public class TransformBootClass implements ClassFileTransformer { + + static String targetClass = null; + + public byte[] transform(ClassLoader loader, String name, Class classBeingRedefined, + ProtectionDomain pd, byte[] buffer) throws IllegalClassFormatException { + + if (name.equals(targetClass)) { + System.out.println("Transforming class " + name); + return buffer; + } + return null; + } + + private static Instrumentation savedInstrumentation; + + public static void premain(String agentArguments, Instrumentation instrumentation) { + System.out.println("TransformBootClass.premain() is called"); + instrumentation.addTransformer(new TransformBootClass(), /*canRetransform=*/true); + savedInstrumentation = instrumentation; + if (agentArguments != null) { + targetClass = agentArguments; + } + } + + public static Instrumentation getInstrumentation() { + return savedInstrumentation; + } + + public static void agentmain(String args, Instrumentation inst) throws Exception { + premain(args, inst); + } +} diff --git a/test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.mf b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.mf new file mode 100644 index 00000000000..e9d472b02ba --- /dev/null +++ b/test/hotspot/jtreg/runtime/cds/appcds/test-classes/TransformBootClass.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Premain-Class: TransformBootClass +Agent-Class: TransformBootClass +Can-Retransform-Classes: true +Can-Redefine-Classes: true -- GitLab From 3889af3f7debc4f8d75f620bb54134d1d11a6c83 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Thu, 2 Dec 2021 15:09:58 +0000 Subject: [PATCH 564/890] 8277906: Incorrect type for IV phi of long counted loops after CCP Reviewed-by: thartmann, chagedorn --- src/hotspot/share/opto/phaseX.cpp | 10 +-- .../TestIVPhiTypeIncorrectAfterCCP.java | 61 +++++++++++++++++++ 2 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/longcountedloops/TestIVPhiTypeIncorrectAfterCCP.java diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 29444fffac2..0589d1eab0c 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -1508,13 +1508,13 @@ void PhaseIterGVN::add_users_to_worklist0( Node *n ) { // Return counted loop Phi if as a counted loop exit condition, cmp // compares the the induction variable with n -static PhiNode* countedloop_phi_from_cmp(CmpINode* cmp, Node* n) { +static PhiNode* countedloop_phi_from_cmp(CmpNode* cmp, Node* n) { for (DUIterator_Fast imax, i = cmp->fast_outs(imax); i < imax; i++) { Node* bol = cmp->fast_out(i); for (DUIterator_Fast i2max, i2 = bol->fast_outs(i2max); i2 < i2max; i2++) { Node* iff = bol->fast_out(i2); - if (iff->is_CountedLoopEnd()) { - CountedLoopEndNode* cle = iff->as_CountedLoopEnd(); + if (iff->is_BaseCountedLoopEnd()) { + BaseCountedLoopEndNode* cle = iff->as_BaseCountedLoopEnd(); if (cle->limit() == n) { PhiNode* phi = cle->phi(); if (phi != NULL) { @@ -1832,8 +1832,8 @@ void PhaseCCP::analyze() { // If n is used in a counted loop exit condition then the type // of the counted loop's Phi depends on the type of n. See // PhiNode::Value(). - if (m_op == Op_CmpI) { - PhiNode* phi = countedloop_phi_from_cmp((CmpINode*)m, n); + if (m_op == Op_CmpI || m_op == Op_CmpL) { + PhiNode* phi = countedloop_phi_from_cmp(m->as_Cmp(), n); if (phi != NULL) { worklist.push(phi); } diff --git a/test/hotspot/jtreg/compiler/longcountedloops/TestIVPhiTypeIncorrectAfterCCP.java b/test/hotspot/jtreg/compiler/longcountedloops/TestIVPhiTypeIncorrectAfterCCP.java new file mode 100644 index 00000000000..0c22c12f06f --- /dev/null +++ b/test/hotspot/jtreg/compiler/longcountedloops/TestIVPhiTypeIncorrectAfterCCP.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021, 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. + */ + +/** + * @test + * @bug 8277906 + * @summary Incorrect type for IV phi of long counted loops after CCP + * + * @run main/othervm -XX:-TieredCompilation -XX:CompileCommand=compileonly,TestIVPhiTypeIncorrectAfterCCP::test -XX:-BackgroundCompilation TestIVPhiTypeIncorrectAfterCCP + * + */ + +public class TestIVPhiTypeIncorrectAfterCCP { + + static int test() { + int array[] = new int[50]; + + float f = 0; + for (int i = 3; i < 49; i++) { + for (long l = 1; l < i; l++) { + array[(int)l] = i; + f += l; + } + } + int sum = 0; + for (int i = 0; i < array.length; i++) { + sum += array[i]; + } + return sum; + } + + public static void main(String[] args) { + long expected = test(); + for (int i = 0; i < 10_000; i++) { + int res = test(); + if (res != expected) { + throw new RuntimeException("Unexpected result: " + res + " != " + expected); + } + } + } +} -- GitLab From 65960f712ed6d4c4478d74f0842ce78d500d4229 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Thu, 2 Dec 2021 15:15:06 +0000 Subject: [PATCH 565/890] 8277753: Long*VectorTests.java fail with "bad AD file" on x86_32 after JDK-8276162 Reviewed-by: kvn, thartmann --- src/hotspot/cpu/x86/x86_32.ad | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index 68f6122b201..611206fa9fa 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -13180,6 +13180,16 @@ instruct cmovPP_reg_LTGE(cmpOp cmp, flagsReg_long_LTGE flags, eRegP dst, eRegP s ins_pipe( pipe_cmov_reg ); %} +// Compare 2 unsigned longs and CMOVE ptrs. +instruct cmovPP_reg_LTGE_U(cmpOpU cmp, flagsReg_ulong_LTGE flags, eRegP dst, eRegP src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); + match(Set dst (CMoveP (Binary cmp flags) (Binary dst src))); + ins_cost(200); + expand %{ + cmovPP_reg_LTGE(cmp,flags,dst,src); + %} +%} + // Compare 2 longs and CMOVE doubles instruct cmovDDPR_reg_LTGE(cmpOp cmp, flagsReg_long_LTGE flags, regDPR dst, regDPR src) %{ predicate( UseSSE<=1 && _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge ); @@ -13361,6 +13371,16 @@ instruct cmovPP_reg_EQNE(cmpOp cmp, flagsReg_long_EQNE flags, eRegP dst, eRegP s ins_pipe( pipe_cmov_reg ); %} +// Compare 2 unsigned longs and CMOVE ptrs. +instruct cmovPP_reg_EQNE_U(cmpOpU cmp, flagsReg_ulong_EQNE flags, eRegP dst, eRegP src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::eq || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ne )); + match(Set dst (CMoveP (Binary cmp flags) (Binary dst src))); + ins_cost(200); + expand %{ + cmovPP_reg_EQNE(cmp,flags,dst,src); + %} +%} + // Compare 2 longs and CMOVE doubles instruct cmovDDPR_reg_EQNE(cmpOp cmp, flagsReg_long_EQNE flags, regDPR dst, regDPR src) %{ predicate( UseSSE<=1 && _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::eq || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ne ); @@ -13570,6 +13590,16 @@ instruct cmovPP_reg_LEGT(cmpOp_commute cmp, flagsReg_long_LEGT flags, eRegP dst, ins_pipe( pipe_cmov_reg ); %} +// Compare 2 unsigned longs and CMOVE ptrs. +instruct cmovPP_reg_LEGT_U(cmpOpU_commute cmp, flagsReg_ulong_LEGT flags, eRegP dst, eRegP src) %{ + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt )); + match(Set dst (CMoveP (Binary cmp flags) (Binary dst src))); + ins_cost(200); + expand %{ + cmovPP_reg_LEGT(cmp,flags,dst,src); + %} +%} + // Compare 2 longs and CMOVE doubles instruct cmovDDPR_reg_LEGT(cmpOp_commute cmp, flagsReg_long_LEGT flags, regDPR dst, regDPR src) %{ predicate( UseSSE<=1 && _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::le || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::gt ); -- GitLab From 8d9cb2efe655cc3945b3fe51a5e7d90f48b688e6 Mon Sep 17 00:00:00 2001 From: Adam Sotona Date: Thu, 2 Dec 2021 15:29:26 +0000 Subject: [PATCH 566/890] 8278078: Cannot reference super before supertype constructor has been called Reviewed-by: mcimadamore --- .../com/sun/tools/javac/comp/Attr.java | 3 +- ...validThisAndSuperInConstructorArgTest.java | 68 ++++++++++++++++ ...nvalidThisAndSuperInConstructorArgTest.out | 14 ++++ ...ValidThisAndSuperInConstructorArgTest.java | 78 +++++++++++++++++++ 4 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.java create mode 100644 test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.out create mode 100644 test/langtools/tools/javac/8278078/ValidThisAndSuperInConstructorArgTest.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index 4b22fb1b17f..7bd813cddb7 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -4348,7 +4348,8 @@ public class Attr extends JCTree.Visitor { if (env.info.isSelfCall && ((sym.name == names._this && site.tsym == env.enclClass.sym) || - sym.name == names._super && env.info.constructorArgs)) { + sym.name == names._super && env.info.constructorArgs && + (sitesym.isInterface() || site.tsym == env.enclClass.sym))) { chk.earlyRefError(tree.pos(), sym); } } else { diff --git a/test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.java b/test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.java new file mode 100644 index 00000000000..eee79e2d5e9 --- /dev/null +++ b/test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.java @@ -0,0 +1,68 @@ + +import java.util.function.Supplier; + +/** + * @test /nodynamiccopyright/ + * @bug 8278078 + * @summary error: cannot reference super before supertype constructor has been called + * @compile/fail/ref=InvalidThisAndSuperInConstructorArgTest.out -XDrawDiagnostics InvalidThisAndSuperInConstructorArgTest.java + */ +public class InvalidThisAndSuperInConstructorArgTest { + + interface InterfaceWithDefault { + default String get() { + return ""; + } + } + + InvalidThisAndSuperInConstructorArgTest(String s) { + } + + class InnerClass extends AssertionError implements InterfaceWithDefault { + InnerClass() { + super(InnerClass.super.toString()); + } + InnerClass(int i) { + this(InnerClass.super.toString()); + } + InnerClass(boolean b) { + super(InnerClass.this.toString()); + } + InnerClass(double d) { + this(InnerClass.this.toString()); + } + InnerClass(float f) { + super(AssertionError.super.toString()); + } + InnerClass(char ch) { + this(AssertionError.super.toString()); + } + InnerClass(byte b) { + super(AssertionError.this.toString()); + } + InnerClass(Object o) { + this(AssertionError.this.toString()); + } + InnerClass(int[] ii) { + this(InterfaceWithDefault.super.get()); + } + InnerClass(boolean[] bb) { + super(InterfaceWithDefault.this.get()); + } + InnerClass(double[] dd) { + this(InterfaceWithDefault.this.get()); + } + InnerClass(float[] ff) { + super(InterfaceWithDefault.super.get()); + } + InnerClass(char[] chch) { + this(InnerClass.this::toString); + } + InnerClass(String s) { + super(s); + } + InnerClass(Supplier sup) { + super(sup); + } + } +} diff --git a/test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.out b/test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.out new file mode 100644 index 00000000000..1109eb0fdc4 --- /dev/null +++ b/test/langtools/tools/javac/8278078/InvalidThisAndSuperInConstructorArgTest.out @@ -0,0 +1,14 @@ +InvalidThisAndSuperInConstructorArgTest.java:23:29: compiler.err.cant.ref.before.ctor.called: super +InvalidThisAndSuperInConstructorArgTest.java:26:28: compiler.err.cant.ref.before.ctor.called: super +InvalidThisAndSuperInConstructorArgTest.java:29:29: compiler.err.cant.ref.before.ctor.called: this +InvalidThisAndSuperInConstructorArgTest.java:32:28: compiler.err.cant.ref.before.ctor.called: this +InvalidThisAndSuperInConstructorArgTest.java:35:33: compiler.err.not.encl.class: java.lang.AssertionError +InvalidThisAndSuperInConstructorArgTest.java:38:32: compiler.err.not.encl.class: java.lang.AssertionError +InvalidThisAndSuperInConstructorArgTest.java:41:33: compiler.err.not.encl.class: java.lang.AssertionError +InvalidThisAndSuperInConstructorArgTest.java:44:32: compiler.err.not.encl.class: java.lang.AssertionError +InvalidThisAndSuperInConstructorArgTest.java:47:38: compiler.err.cant.ref.before.ctor.called: super +InvalidThisAndSuperInConstructorArgTest.java:50:39: compiler.err.not.encl.class: InvalidThisAndSuperInConstructorArgTest.InterfaceWithDefault +InvalidThisAndSuperInConstructorArgTest.java:53:38: compiler.err.not.encl.class: InvalidThisAndSuperInConstructorArgTest.InterfaceWithDefault +InvalidThisAndSuperInConstructorArgTest.java:56:39: compiler.err.cant.ref.before.ctor.called: super +InvalidThisAndSuperInConstructorArgTest.java:59:28: compiler.err.cant.ref.before.ctor.called: this +13 errors diff --git a/test/langtools/tools/javac/8278078/ValidThisAndSuperInConstructorArgTest.java b/test/langtools/tools/javac/8278078/ValidThisAndSuperInConstructorArgTest.java new file mode 100644 index 00000000000..2fe1388420c --- /dev/null +++ b/test/langtools/tools/javac/8278078/ValidThisAndSuperInConstructorArgTest.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021, 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 8278078 + * @summary error: cannot reference super before supertype constructor has been called + * @compile ValidThisAndSuperInConstructorArgTest.java + * @run main ValidThisAndSuperInConstructorArgTest + */ +public class ValidThisAndSuperInConstructorArgTest { + + static final String SUPER = "unexpected super call"; + static final String THIS = "unexpected this call"; + + public String get() { + return SUPER; + } + + static class StaticSubClass extends ValidThisAndSuperInConstructorArgTest { + @Override + public String get() { + return THIS; + } + + class InnerClass extends AssertionError { + InnerClass() { + super(StaticSubClass.super.get()); + } + InnerClass(int i) { + this(StaticSubClass.super.get()); + } + InnerClass(boolean b) { + super(StaticSubClass.this.get()); + } + InnerClass(double d) { + this(StaticSubClass.this.get()); + } + InnerClass(String s) { + super(s); + } + void assertThis() { + if (!THIS.equals(getMessage())) throw this; + } + void assertSuper() { + if (!SUPER.equals(getMessage())) throw this; + } + } + } + + public static void main(String...args) { + var test = new StaticSubClass(); + test.new InnerClass().assertSuper(); + test.new InnerClass(1).assertSuper(); + test.new InnerClass(true).assertThis(); + test.new InnerClass(1.0).assertThis(); + } +} -- GitLab From dc2abc9f05c2b7c52aeb242082359c48963f9854 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Thu, 2 Dec 2021 15:36:43 +0000 Subject: [PATCH 567/890] 8278080: Add --with-cacerts-src='user cacerts folder' to enable deterministic cacerts generation Reviewed-by: erikj --- make/autoconf/jdk-options.m4 | 17 +++++++++++++++++ make/autoconf/spec.gmk.in | 2 ++ make/modules/java.base/Gendata.gmk | 3 +++ 3 files changed, 22 insertions(+) diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index 337263caa50..cc4a44d39c9 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -169,6 +169,23 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], fi AC_SUBST(CACERTS_FILE) + # Choose cacerts source folder for user provided PEM files + AC_ARG_WITH(cacerts-src, [AS_HELP_STRING([--with-cacerts-src], + [specify alternative cacerts source folder containing certificates])]) + CACERTS_SRC="" + AC_MSG_CHECKING([for cacerts source]) + if test "x$with_cacerts_src" == x; then + AC_MSG_RESULT([default]) + else + CACERTS_SRC=$with_cacerts_src + if test ! -d "$CACERTS_SRC"; then + AC_MSG_RESULT([fail]) + AC_MSG_ERROR([Specified cacerts source folder "$CACERTS_SRC" does not exist]) + fi + AC_MSG_RESULT([$CACERTS_SRC]) + fi + AC_SUBST(CACERTS_SRC) + # Enable or disable unlimited crypto UTIL_ARG_ENABLE(NAME: unlimited-crypto, DEFAULT: true, RESULT: UNLIMITED_CRYPTO, DESC: [enable unlimited crypto policy]) diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 72be922f103..bc13f30e5f1 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -416,6 +416,8 @@ GTEST_FRAMEWORK_SRC := @GTEST_FRAMEWORK_SRC@ # Source file for cacerts CACERTS_FILE=@CACERTS_FILE@ +# Source folder for user provided cacerts PEM files +CACERTS_SRC=@CACERTS_SRC@ # Enable unlimited crypto policy UNLIMITED_CRYPTO=@UNLIMITED_CRYPTO@ diff --git a/make/modules/java.base/Gendata.gmk b/make/modules/java.base/Gendata.gmk index f9c25c8c53f..36ddcec9960 100644 --- a/make/modules/java.base/Gendata.gmk +++ b/make/modules/java.base/Gendata.gmk @@ -71,6 +71,9 @@ $(GENDATA_CACERTS): $(BUILD_TOOLS_JDK) $(wildcard $(GENDATA_CACERTS_SRC)/*) ifeq ($(CACERTS_FILE), ) TARGETS += $(GENDATA_CACERTS) endif +ifneq ($(CACERTS_SRC), ) + GENDATA_CACERTS_SRC := $(CACERTS_SRC) +endif ################################################################################ -- GitLab From 7c4ef3abaff55b29dddc50f2aea8a04a3214f9fb Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Thu, 2 Dec 2021 15:59:50 +0000 Subject: [PATCH 568/890] 8277985: G1: Compare max_parallel_refinement_threads to UINT_MAX Reviewed-by: kbarrett, tschatzl --- src/hotspot/share/gc/g1/g1Arguments.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp index 912ab253de6..400f6b50024 100644 --- a/src/hotspot/share/gc/g1/g1Arguments.cpp +++ b/src/hotspot/share/gc/g1/g1Arguments.cpp @@ -243,7 +243,7 @@ void G1Arguments::initialize() { // the refcount in G1CardSetContainer. uint max_parallel_refinement_threads = G1ConcRefinementThreads + G1DirtyCardQueueSet::num_par_ids(); uint const divisor = 3; // Safe divisor; we increment by 2 for each claim, but there is a small initial value. - if (max_parallel_refinement_threads > UINTPTR_MAX / divisor) { + if (max_parallel_refinement_threads > UINT_MAX / divisor) { vm_exit_during_initialization("Too large parallelism for remembered sets."); } } -- GitLab From ad1ff27b730773a141d73744e5f5a899bdfbea78 Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Thu, 2 Dec 2021 16:33:32 +0000 Subject: [PATCH 569/890] 8277422: tools/jar/JarEntryTime.java fails with modified time mismatch Reviewed-by: joehw, msheppar, naoto --- test/jdk/tools/jar/JarEntryTime.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/jdk/tools/jar/JarEntryTime.java b/test/jdk/tools/jar/JarEntryTime.java index 80fd65fba5c..4d84547d074 100644 --- a/test/jdk/tools/jar/JarEntryTime.java +++ b/test/jdk/tools/jar/JarEntryTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2021, 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 @@ -23,7 +23,7 @@ /** * @test - * @bug 4225317 6969651 + * @bug 4225317 6969651 8277422 * @modules jdk.jartool * @summary Check extracted files have date as per those in the .jar file */ @@ -31,6 +31,7 @@ import java.io.File; import java.io.PrintWriter; import java.nio.file.attribute.FileTime; +import java.time.ZoneId; import java.util.Date; import java.util.TimeZone; import java.util.spi.ToolProvider; @@ -93,6 +94,14 @@ public class JarEntryTime { jarFile.delete(); testFile.delete(); + var date = new Date(); + var defZone = ZoneId.systemDefault(); + if (defZone.getRules().getTransition( + date.toInstant().atZone(defZone).toLocalDateTime()) != null) { + System.out.println("At the offset transition. JarEntryTime test skipped."); + return; + } + /* Create a directory structure * outer/ * inner/ -- GitLab From 8b042d14b78c66b50495d0d8b559ca3f6744d806 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 2 Dec 2021 18:17:32 +0000 Subject: [PATCH 570/890] 8257856: Make ClassFileVersionsTest.java robust to JDK version updates Reviewed-by: alanb --- .../lang/module/ClassFileVersionsTest.java | 109 ++++++++---------- 1 file changed, 50 insertions(+), 59 deletions(-) diff --git a/test/jdk/java/lang/module/ClassFileVersionsTest.java b/test/jdk/java/lang/module/ClassFileVersionsTest.java index 6e9b19a09bc..9d723662b24 100644 --- a/test/jdk/java/lang/module/ClassFileVersionsTest.java +++ b/test/jdk/java/lang/module/ClassFileVersionsTest.java @@ -43,74 +43,65 @@ import org.testng.annotations.Test; import static org.testng.Assert.*; public class ClassFileVersionsTest { + private static final int FEATURE; + static { + FEATURE = Runtime.version().feature(); + assert FEATURE >= 10; + } // major, minor, modifiers for requires java.base @DataProvider(name = "supported") public Object[][] supported() { - return new Object[][]{ - { 53, 0, Set.of() }, // JDK 9 - { 53, 0, Set.of(STATIC) }, - { 53, 0, Set.of(TRANSITIVE) }, - { 53, 0, Set.of(STATIC, TRANSITIVE) }, - - { 54, 0, Set.of() }, // JDK 10 - { 55, 0, Set.of() }, // JDK 11 - { 56, 0, Set.of() }, // JDK 12 - { 57, 0, Set.of() }, // JDK 13 - { 58, 0, Set.of() }, // JDK 14 - { 59, 0, Set.of() }, // JDK 15 - { 60, 0, Set.of() }, // JDK 16 - { 61, 0, Set.of() }, // JDK 17 - { 62, 0, Set.of() }, // JDK 18 - }; + /* + * There are four test cases for JDK 9 and then one test case + * for each subsequent JDK version from JDK 10 to the current + * feature release for a total of (4 + (FEATURE - 9) ) => + * (feature - 5) rows. + */ + Object[][] result = new Object[(FEATURE - 5)][]; + + // Class file version of JDK 9 is 53.0 + result[0] = new Object[]{ 53, 0, Set.of()}; + result[1] = new Object[]{ 53, 0, Set.of(STATIC) }; + result[2] = new Object[]{ 53, 0, Set.of(TRANSITIVE) }; + result[3] = new Object[]{ 53, 0, Set.of(STATIC, TRANSITIVE) }; + + // Major class file version of JDK N is 44 + n. Create rows + // for JDK 10 through FEATURE. + for (int i = 4; i < (FEATURE - 5) ; i++) { + result[i] = new Object[]{i + 50, 0, Set.of()}; + } + + return result; } // major, minor, modifiers for requires java.base @DataProvider(name = "unsupported") public Object[][] unsupported() { - return new Object[][]{ - { 50, 0, Set.of()}, // JDK 6 - { 51, 0, Set.of()}, // JDK 7 - { 52, 0, Set.of()}, // JDK 8 - - { 54, 0, Set.of(STATIC) }, // JDK 10 - { 54, 0, Set.of(TRANSITIVE) }, - { 54, 0, Set.of(STATIC, TRANSITIVE) }, - - { 55, 0, Set.of(STATIC) }, // JDK 11 - { 55, 0, Set.of(TRANSITIVE) }, - { 55, 0, Set.of(STATIC, TRANSITIVE) }, - - { 56, 0, Set.of(STATIC) }, // JDK 12 - { 56, 0, Set.of(TRANSITIVE) }, - { 56, 0, Set.of(STATIC, TRANSITIVE) }, - - { 57, 0, Set.of(STATIC) }, // JDK 13 - { 57, 0, Set.of(TRANSITIVE) }, - { 57, 0, Set.of(STATIC, TRANSITIVE) }, - - { 58, 0, Set.of(STATIC) }, // JDK 14 - { 58, 0, Set.of(TRANSITIVE) }, - { 58, 0, Set.of(STATIC, TRANSITIVE) }, - - { 59, 0, Set.of(STATIC) }, // JDK 15 - { 59, 0, Set.of(TRANSITIVE) }, - { 59, 0, Set.of(STATIC, TRANSITIVE) }, - - { 60, 0, Set.of(STATIC) }, // JDK 16 - { 60, 0, Set.of(TRANSITIVE) }, - { 60, 0, Set.of(STATIC, TRANSITIVE) }, - - { 61, 0, Set.of(STATIC) }, // JDK 17 - { 61, 0, Set.of(TRANSITIVE) }, - { 61, 0, Set.of(STATIC, TRANSITIVE) }, - - { 62, 0, Set.of(STATIC) }, // JDK 18 - { 62, 0, Set.of(TRANSITIVE) }, - { 62, 0, Set.of(STATIC, TRANSITIVE) }, - - { 63, 0, Set.of()}, // JDK 19 - }; + /* + * There are three test cases for releases prior to JDK 9, + * three test cases for each JDK version from JDK 10 to the + * current feature release, plus one addition test case for + * the next release for a total of (3 + (FEATURE - 9) * 3 + 1) + * rows. + */ + int unsupportedCount = 3 + (FEATURE - 9)*3 + 1; + Object[][] result = new Object[unsupportedCount][]; + + result[0] = new Object[]{50, 0, Set.of()}; // JDK 6 + result[1] = new Object[]{51, 0, Set.of()}; // JDK 7 + result[2] = new Object[]{52, 0, Set.of()}; // JDK 8 + + for (int i = 10; i <= FEATURE ; i++) { + int base = 3 + (i-10)*3; + // Major class file version of JDK N is 44+n + result[base] = new Object[]{i + 44, 0, Set.of(STATIC)}; + result[base + 1] = new Object[]{i + 44, 0, Set.of(TRANSITIVE)}; + result[base + 2] = new Object[]{i + 44, 0, Set.of(STATIC, TRANSITIVE)}; + } + + result[unsupportedCount - 1] = new Object[]{FEATURE+1+44, 0, Set.of()}; + return result; } @Test(dataProvider = "supported") -- GitLab From 8f196a2487982a0ae827cdef17243b8c64ba3217 Mon Sep 17 00:00:00 2001 From: Ao Qi Date: Thu, 2 Dec 2021 18:57:23 +0000 Subject: [PATCH 571/890] 8278037: Clean up PPC32 related code in C1 Reviewed-by: jiefu, stuefe, shade, mdoerr --- src/hotspot/share/c1/c1_LIR.cpp | 20 +++--------- src/hotspot/share/c1/c1_LinearScan.cpp | 7 ---- src/hotspot/share/c1/c1_Runtime1.cpp | 44 -------------------------- 3 files changed, 4 insertions(+), 67 deletions(-) diff --git a/src/hotspot/share/c1/c1_LIR.cpp b/src/hotspot/share/c1/c1_LIR.cpp index c4e2b013387..c726c94daef 100644 --- a/src/hotspot/share/c1/c1_LIR.cpp +++ b/src/hotspot/share/c1/c1_LIR.cpp @@ -132,17 +132,15 @@ void LIR_Opr::validate_type() const { size_field() == double_size, "must match"); break; case T_FLOAT: - // FP return values can be also in CPU registers on ARM and PPC32 (softfp ABI) + // FP return values can be also in CPU registers on ARM (softfp ABI) assert((kindfield == fpu_register || kindfield == stack_value - ARM_ONLY(|| kindfield == cpu_register) - PPC32_ONLY(|| kindfield == cpu_register) ) && + ARM_ONLY(|| kindfield == cpu_register) ) && size_field() == single_size, "must match"); break; case T_DOUBLE: - // FP return values can be also in CPU registers on ARM and PPC32 (softfp ABI) + // FP return values can be also in CPU registers on ARM (softfp ABI) assert((kindfield == fpu_register || kindfield == stack_value - ARM_ONLY(|| kindfield == cpu_register) - PPC32_ONLY(|| kindfield == cpu_register) ) && + ARM_ONLY(|| kindfield == cpu_register) ) && size_field() == double_size, "must match"); break; case T_BOOLEAN: @@ -497,10 +495,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) { assert(opConvert->_info == NULL, "must be"); if (opConvert->_opr->is_valid()) do_input(opConvert->_opr); if (opConvert->_result->is_valid()) do_output(opConvert->_result); -#ifdef PPC32 - if (opConvert->_tmp1->is_valid()) do_temp(opConvert->_tmp1); - if (opConvert->_tmp2->is_valid()) do_temp(opConvert->_tmp2); -#endif do_stub(opConvert->_stub); break; @@ -1874,12 +1868,6 @@ void LIR_OpConvert::print_instr(outputStream* out) const { print_bytecode(out, bytecode()); in_opr()->print(out); out->print(" "); result_opr()->print(out); out->print(" "); -#ifdef PPC32 - if(tmp1()->is_valid()) { - tmp1()->print(out); out->print(" "); - tmp2()->print(out); out->print(" "); - } -#endif } void LIR_OpConvert::print_bytecode(outputStream* out, Bytecodes::Code code) { diff --git a/src/hotspot/share/c1/c1_LinearScan.cpp b/src/hotspot/share/c1/c1_LinearScan.cpp index 27b11d05c8b..d2386d7cbb6 100644 --- a/src/hotspot/share/c1/c1_LinearScan.cpp +++ b/src/hotspot/share/c1/c1_LinearScan.cpp @@ -2141,12 +2141,8 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) { #ifdef _LP64 return LIR_OprFact::double_cpu(assigned_reg, assigned_reg); -#else -#if defined(PPC32) - return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg); #else return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi); -#endif // PPC32 #endif // LP64 } @@ -2789,9 +2785,6 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArrayfpu_regnrHi() == opr->fpu_regnrLo() + 1, "assumed in calculation (only fpu_regnrLo is used)"); #endif -#ifdef PPC32 - assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrHi is used)"); -#endif #ifdef VM_LITTLE_ENDIAN VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrLo()); diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp index 072b3d3900a..d7e0df012e5 100644 --- a/src/hotspot/share/c1/c1_Runtime1.cpp +++ b/src/hotspot/share/c1/c1_Runtime1.cpp @@ -243,9 +243,6 @@ void Runtime1::generate_blob_for(BufferBlob* buffer_blob, StubID id) { case fpu2long_stub_id: case unwind_exception_id: case counter_overflow_id: -#if defined(PPC32) - case handle_exception_nofpu_id: -#endif expect_oop_map = false; break; default: @@ -1179,40 +1176,6 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ ShouldNotReachHere(); } -#if defined(PPC32) - if (load_klass_or_mirror_patch_id || - stub_id == Runtime1::load_appendix_patching_id) { - // Update the location in the nmethod with the proper - // metadata. When the code was generated, a NULL was stuffed - // in the metadata table and that table needs to be update to - // have the right value. On intel the value is kept - // directly in the instruction instead of in the metadata - // table, so set_data above effectively updated the value. - nmethod* nm = CodeCache::find_nmethod(instr_pc); - assert(nm != NULL, "invalid nmethod_pc"); - RelocIterator mds(nm, copy_buff, copy_buff + 1); - bool found = false; - while (mds.next() && !found) { - if (mds.type() == relocInfo::oop_type) { - assert(stub_id == Runtime1::load_mirror_patching_id || - stub_id == Runtime1::load_appendix_patching_id, "wrong stub id"); - oop_Relocation* r = mds.oop_reloc(); - oop* oop_adr = r->oop_addr(); - *oop_adr = stub_id == Runtime1::load_mirror_patching_id ? mirror() : appendix(); - r->fix_oop_relocation(); - found = true; - } else if (mds.type() == relocInfo::metadata_type) { - assert(stub_id == Runtime1::load_klass_patching_id, "wrong stub id"); - metadata_Relocation* r = mds.metadata_reloc(); - Metadata** metadata_adr = r->metadata_addr(); - *metadata_adr = load_klass; - r->fix_metadata_relocation(); - found = true; - } - } - assert(found, "the metadata must exist!"); - } -#endif if (do_patch) { // replace instructions // first replace the tail, then the call @@ -1270,13 +1233,6 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* current, Runtime1::StubID stub_ RelocIterator iter(nm, (address)instr_pc, (address)(instr_pc + 1)); relocInfo::change_reloc_info_for_address(&iter, (address) instr_pc, relocInfo::none, rtype); -#ifdef PPC32 - { address instr_pc2 = instr_pc + NativeMovConstReg::lo_offset; - RelocIterator iter2(nm, instr_pc2, instr_pc2 + 1); - relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2, - relocInfo::none, rtype); - } -#endif } } else { -- GitLab From 4f15be2cd41252d2e5a3f0832f07b98462e9076d Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Thu, 2 Dec 2021 19:17:09 +0000 Subject: [PATCH 572/890] 8277965: Enclosing instance optimization affects serialization Reviewed-by: darcy --- .../com/sun/tools/javac/comp/Lower.java | 21 ++----------------- .../optimizeOuterThis/OptimizeOuterThis.java | 2 +- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java index 374e18fb0a5..7b2ccb7f426 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java @@ -2279,30 +2279,13 @@ public class Lower extends TreeTranslator { // Enclosing instance field is used return true; } - if (rs.isSerializable(sym.type) && !hasSerialVersionUID(sym)) { - // Class is serializable and does not have a stable serialVersionUID + if (rs.isSerializable(sym.type)) { + // Class is serializable return true; } return false; } - private boolean hasSerialVersionUID(ClassSymbol sym) { - VarSymbol svuid = (VarSymbol) sym.members().findFirst(names.serialVersionUID, f -> f.kind == VAR); - if (svuid == null) { - return false; - } - if ((svuid.flags() & (STATIC | FINAL)) != (STATIC | FINAL)) { - return false; - } - if (!svuid.type.hasTag(LONG)) { - return false; - } - if (svuid.getConstValue() == null) { - return false; - } - return true; - } - List generateMandatedAccessors(JCClassDecl tree) { List fields = TreeInfo.recordFields(tree); return tree.sym.getRecordComponents().stream() diff --git a/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java b/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java index 1a01d61f94e..a42508e2a0a 100644 --- a/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java +++ b/test/langtools/tools/javac/optimizeOuterThis/OptimizeOuterThis.java @@ -64,7 +64,7 @@ public class OptimizeOuterThis extends InnerClasses { checkInner(N0.N1.N2.N3.N4.N5.class, false); checkInner(SerializableCapture.class, true); - checkInner(SerializableWithSerialVersionUID.class, false); + checkInner(SerializableWithSerialVersionUID.class, true); checkInner(SerializableWithInvalidSerialVersionUIDType.class, true); checkInner(SerializableWithInvalidSerialVersionUIDNonFinal.class, true); checkInner(SerializableWithInvalidSerialVersionUIDNonStatic.class, true); -- GitLab From 669c90e23b2397fa9fb4388e8380c95c3b19eb48 Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Thu, 2 Dec 2021 19:28:42 +0000 Subject: [PATCH 573/890] 8278099: two sun/security/pkcs11/Signature tests failed with AssertionError Reviewed-by: dcubed --- .../share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java index db5474fa888..0c9ebb289c1 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_MECHANISM.java @@ -164,7 +164,6 @@ public class CK_MECHANISM { // CK_MECHANISM(long) constructor and setParameter(CK_RSA_PKCS_PSS_PARAMS) // methods instead of creating yet another constructor public void setParameter(CK_RSA_PKCS_PSS_PARAMS params) { - assert(this.mechanism == CKM_RSA_PKCS_PSS); assert(params != null); if (this.pParameter != null && this.pParameter.equals(params)) { return; -- GitLab From 30087cc1b829e4c2cd77b7c28d077426888160e3 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Thu, 2 Dec 2021 19:40:17 +0000 Subject: [PATCH 574/890] 8275342: Change nested classes in java.prefs to static nested classes Reviewed-by: dfuchs, rriggs --- .../java/util/prefs/MacOSXPreferencesFile.java | 8 +------- .../classes/java/util/prefs/AbstractPreferences.java | 9 ++------- .../java/util/prefs/FileSystemPreferences.java | 11 ++++++----- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java b/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java index ab954513b81..61ee92cf601 100644 --- a/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java +++ b/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java @@ -93,18 +93,12 @@ class MacOSXPreferencesFile { }); } - private class FlushTask extends TimerTask { + private static class FlushTask extends TimerTask { public void run() { MacOSXPreferencesFile.flushWorld(); } } - private class SyncTask extends TimerTask { - public void run() { - MacOSXPreferencesFile.syncWorld(); - } - } - // Maps string -> weak reference to MacOSXPreferencesFile private static HashMap> cachedFiles; diff --git a/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java b/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java index e0e2551bb69..b0844b2e7ca 100644 --- a/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java +++ b/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java @@ -29,11 +29,6 @@ import java.util.*; import java.io.*; import java.security.AccessController; import java.security.PrivilegedAction; -// These imports needed only as a workaround for a JavaDoc bug -import java.lang.Integer; -import java.lang.Long; -import java.lang.Float; -import java.lang.Double; /** * This class provides a skeletal implementation of the {@link Preferences} @@ -1498,13 +1493,13 @@ public abstract class AbstractPreferences extends Preferences { * eventQueue so the event dispatch thread knows whether to call * childAdded or childRemoved. */ - private class NodeAddedEvent extends NodeChangeEvent { + private static class NodeAddedEvent extends NodeChangeEvent { private static final long serialVersionUID = -6743557530157328528L; NodeAddedEvent(Preferences parent, Preferences child) { super(parent, child); } } - private class NodeRemovedEvent extends NodeChangeEvent { + private static class NodeRemovedEvent extends NodeChangeEvent { private static final long serialVersionUID = 8735497392918824837L; NodeRemovedEvent(Preferences parent, Preferences child) { super(parent, child); diff --git a/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java b/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java index 5aafccbc487..2a894714666 100644 --- a/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java +++ b/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java @@ -24,6 +24,7 @@ */ package java.util.prefs; + import java.util.*; import java.io.*; import java.security.AccessController; @@ -298,8 +299,8 @@ class FileSystemPreferences extends AbstractPreferences { * A temporary file used for saving changes to preferences. As part of * the sync operation, changes are first saved into this file, and then * atomically renamed to prefsFile. This results in an atomic state - * change from one valid set of preferences to another. The - * the file-lock is held for the duration of this transformation. + * change from one valid set of preferences to another. + * The file-lock is held for the duration of this transformation. */ private final File tmpFile; @@ -385,12 +386,12 @@ class FileSystemPreferences extends AbstractPreferences { /** * Represents a change to a preference. */ - private abstract class Change { + private abstract static class Change { /** * Reapplies the change to prefsCache. */ abstract void replay(); - }; + } /** * Represents a preference put. @@ -426,7 +427,7 @@ class FileSystemPreferences extends AbstractPreferences { /** * Represents the creation of this node. */ - private class NodeCreate extends Change { + private static class NodeCreate extends Change { /** * Performs no action, but the presence of this object in changeLog * will force the node and its ancestors to be made permanent at the -- GitLab From 73a9654c2685e14454a355a16bfe3f6687966f14 Mon Sep 17 00:00:00 2001 From: Sergey Tsypanov Date: Thu, 2 Dec 2021 20:00:49 +0000 Subject: [PATCH 575/890] 8276806: Use Objects.checkFromIndexSize where possible in java.base Reviewed-by: rriggs, lancea --- .../share/classes/java/io/ObjectInputStream.java | 10 ++-------- .../share/classes/java/io/ObjectOutputStream.java | 6 ++---- .../share/classes/java/io/PipedInputStream.java | 10 ++++++---- .../share/classes/java/io/PushbackInputStream.java | 10 ++++++---- .../share/classes/java/io/SequenceInputStream.java | 8 ++++---- .../share/classes/java/lang/AbstractStringBuilder.java | 4 +--- .../classes/java/util/zip/DeflaterInputStream.java | 7 ++++--- .../classes/java/util/zip/InflaterInputStream.java | 7 ++++--- .../classes/java/util/zip/InflaterOutputStream.java | 7 ++++--- .../share/classes/java/util/zip/ZipInputStream.java | 8 ++++---- .../share/classes/java/util/zip/ZipOutputStream.java | 6 +++--- 11 files changed, 40 insertions(+), 43 deletions(-) diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java index d91939684eb..5a0978ab382 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -1035,10 +1035,7 @@ public class ObjectInputStream if (buf == null) { throw new NullPointerException(); } - int endoff = off + len; - if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { - throw new IndexOutOfBoundsException(); - } + Objects.checkFromIndexSize(off, len, buf.length); return bin.read(buf, off, len, false); } @@ -1207,10 +1204,7 @@ public class ObjectInputStream * @throws IOException If other I/O error has occurred. */ public void readFully(byte[] buf, int off, int len) throws IOException { - int endoff = off + len; - if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { - throw new IndexOutOfBoundsException(); - } + Objects.checkFromToIndex(off, len, buf.length); bin.readFully(buf, off, len, false); } diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java index 8d34fcec483..2a4d455c3a0 100644 --- a/src/java.base/share/classes/java/io/ObjectOutputStream.java +++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java @@ -32,6 +32,7 @@ import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Objects; import java.util.StringJoiner; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -718,10 +719,7 @@ public class ObjectOutputStream if (buf == null) { throw new NullPointerException(); } - int endoff = off + len; - if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { - throw new IndexOutOfBoundsException(); - } + Objects.checkFromIndexSize(off, len, buf.length); bout.write(buf, off, len, false); } diff --git a/src/java.base/share/classes/java/io/PipedInputStream.java b/src/java.base/share/classes/java/io/PipedInputStream.java index 88375166029..c6034e193cf 100644 --- a/src/java.base/share/classes/java/io/PipedInputStream.java +++ b/src/java.base/share/classes/java/io/PipedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2021, 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,6 +25,8 @@ package java.io; +import java.util.Objects; + /** * A piped input stream should be connected * to a piped output stream; the piped input @@ -367,9 +369,9 @@ public class PipedInputStream extends InputStream { public synchronized int read(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + } + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return 0; } diff --git a/src/java.base/share/classes/java/io/PushbackInputStream.java b/src/java.base/share/classes/java/io/PushbackInputStream.java index 398751cdca0..9076657db26 100644 --- a/src/java.base/share/classes/java/io/PushbackInputStream.java +++ b/src/java.base/share/classes/java/io/PushbackInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2021, 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,6 +25,8 @@ package java.io; +import java.util.Objects; + /** * A {@code PushbackInputStream} adds * functionality to another input stream, namely @@ -162,9 +164,9 @@ public class PushbackInputStream extends FilterInputStream { ensureOpen(); if (b == null) { throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + } + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return 0; } diff --git a/src/java.base/share/classes/java/io/SequenceInputStream.java b/src/java.base/share/classes/java/io/SequenceInputStream.java index 89b0507a552..5f692ce6c44 100644 --- a/src/java.base/share/classes/java/io/SequenceInputStream.java +++ b/src/java.base/share/classes/java/io/SequenceInputStream.java @@ -25,8 +25,8 @@ package java.io; -import java.io.InputStream; import java.util.Enumeration; +import java.util.Objects; import java.util.Vector; /** @@ -189,9 +189,9 @@ public class SequenceInputStream extends InputStream { return -1; } else if (b == null) { throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + } + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return 0; } do { diff --git a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java index fce54fcb3d1..cf83c825d38 100644 --- a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java +++ b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java @@ -430,9 +430,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * {@code beginIndex} is larger than {@code endIndex}. */ public int codePointCount(int beginIndex, int endIndex) { - if (beginIndex < 0 || endIndex > count || beginIndex > endIndex) { - throw new IndexOutOfBoundsException(); - } + Preconditions.checkFromToIndex(beginIndex, endIndex, length(), null); if (isLatin1()) { return endIndex - beginIndex; } diff --git a/src/java.base/share/classes/java/util/zip/DeflaterInputStream.java b/src/java.base/share/classes/java/util/zip/DeflaterInputStream.java index e0ecba0fcad..84d2c888543 100644 --- a/src/java.base/share/classes/java/util/zip/DeflaterInputStream.java +++ b/src/java.base/share/classes/java/util/zip/DeflaterInputStream.java @@ -28,6 +28,7 @@ package java.util.zip; import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; +import java.util.Objects; /** * Implements an input stream filter for compressing data in the "deflate" @@ -172,9 +173,9 @@ public class DeflaterInputStream extends FilterInputStream { ensureOpen(); if (b == null) { throw new NullPointerException("Null buffer for read"); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + } + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return 0; } diff --git a/src/java.base/share/classes/java/util/zip/InflaterInputStream.java b/src/java.base/share/classes/java/util/zip/InflaterInputStream.java index 534241d3d0a..e8ab2a44973 100644 --- a/src/java.base/share/classes/java/util/zip/InflaterInputStream.java +++ b/src/java.base/share/classes/java/util/zip/InflaterInputStream.java @@ -29,6 +29,7 @@ import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; import java.io.EOFException; +import java.util.Objects; /** * This class implements a stream filter for uncompressing data in the @@ -142,9 +143,9 @@ public class InflaterInputStream extends FilterInputStream { ensureOpen(); if (b == null) { throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + } + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return 0; } try { diff --git a/src/java.base/share/classes/java/util/zip/InflaterOutputStream.java b/src/java.base/share/classes/java/util/zip/InflaterOutputStream.java index aa306239224..7b08d5b4538 100644 --- a/src/java.base/share/classes/java/util/zip/InflaterOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/InflaterOutputStream.java @@ -28,6 +28,7 @@ package java.util.zip; import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.util.Objects; /** * Implements an output stream filter for uncompressing data stored in the @@ -223,9 +224,9 @@ public class InflaterOutputStream extends FilterOutputStream { ensureOpen(); if (b == null) { throw new NullPointerException("Null buffer for read"); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + } + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return; } diff --git a/src/java.base/share/classes/java/util/zip/ZipInputStream.java b/src/java.base/share/classes/java/util/zip/ZipInputStream.java index 4c1eac3204c..5f740a76655 100644 --- a/src/java.base/share/classes/java/util/zip/ZipInputStream.java +++ b/src/java.base/share/classes/java/util/zip/ZipInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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,6 +30,7 @@ import java.io.IOException; import java.io.EOFException; import java.io.PushbackInputStream; import java.nio.charset.Charset; +import java.util.Objects; import sun.nio.cs.UTF_8; @@ -182,9 +183,8 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants */ public int read(byte[] b, int off, int len) throws IOException { ensureOpen(); - if (off < 0 || len < 0 || off > b.length - len) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return 0; } diff --git a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java index 8f562a135a7..1b8ed562d9f 100644 --- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java +++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java @@ -28,6 +28,7 @@ package java.util.zip; import java.io.OutputStream; import java.io.IOException; import java.nio.charset.Charset; +import java.util.Objects; import java.util.Vector; import java.util.HashSet; import static java.util.zip.ZipConstants64.*; @@ -333,9 +334,8 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant throws IOException { ensureOpen(); - if (off < 0 || len < 0 || off > b.length - len) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { + Objects.checkFromIndexSize(off, len, b.length); + if (len == 0) { return; } -- GitLab From e0f1fc783cb492dd1eb18f2d56c57bdc160a410d Mon Sep 17 00:00:00 2001 From: Scott Gibbons Date: Thu, 2 Dec 2021 20:06:05 +0000 Subject: [PATCH 576/890] 8277358: Accelerate CRC32-C Co-authored-by: Greg Tucker Co-authored-by: Scott Gibbons Reviewed-by: kvn, sviswanathan, ecaspole --- src/hotspot/cpu/x86/macroAssembler_x86.cpp | 38 ++++++------ src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 33 ++++++---- src/hotspot/cpu/x86/stubRoutines_x86.cpp | 17 ++++++ src/hotspot/cpu/x86/stubRoutines_x86.hpp | 2 + .../openjdk/bench/java/util/TestCRC32C.java | 60 +++++++++++++++++++ 5 files changed, 122 insertions(+), 28 deletions(-) create mode 100644 test/micro/org/openjdk/bench/java/util/TestCRC32C.java diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index b44e8ee15c8..05a36a8195d 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -7030,7 +7030,7 @@ void MacroAssembler::fold512bit_crc32_avx512(XMMRegister xcrc, XMMRegister xK, X // Helper function for AVX 512 CRC32 // Compute CRC32 for < 256B buffers -void MacroAssembler::kernel_crc32_avx512_256B(Register crc, Register buf, Register len, Register key, Register pos, +void MacroAssembler::kernel_crc32_avx512_256B(Register crc, Register buf, Register len, Register table, Register pos, Register tmp1, Register tmp2, Label& L_barrett, Label& L_16B_reduction_loop, Label& L_get_last_two_xmms, Label& L_128_done, Label& L_cleanup) { @@ -7043,7 +7043,7 @@ void MacroAssembler::kernel_crc32_avx512_256B(Register crc, Register buf, Regist jcc(Assembler::less, L_less_than_32); // if there is, load the constants - movdqu(xmm10, Address(key, 1 * 16)); //rk1 and rk2 in xmm10 + movdqu(xmm10, Address(table, 1 * 16)); //rk1 and rk2 in xmm10 movdl(xmm0, crc); // get the initial crc value movdqu(xmm7, Address(buf, pos, Address::times_1, 0 * 16)); //load the plaintext pxor(xmm7, xmm0); @@ -7070,7 +7070,7 @@ void MacroAssembler::kernel_crc32_avx512_256B(Register crc, Register buf, Regist pxor(xmm7, xmm0); //xor the initial crc value addl(pos, 16); subl(len, 16); - movdqu(xmm10, Address(key, 1 * 16)); // rk1 and rk2 in xmm10 + movdqu(xmm10, Address(table, 1 * 16)); // rk1 and rk2 in xmm10 jmp(L_get_last_two_xmms); bind(L_less_than_16_left); @@ -7190,12 +7190,17 @@ void MacroAssembler::kernel_crc32_avx512_256B(Register crc, Register buf, Regist * param crc register containing existing CRC (32-bit) * param buf register pointing to input byte buffer (byte*) * param len register containing number of bytes +* param table address of crc or crc32c table * param tmp1 scratch register * param tmp2 scratch register * return rax result register +* +* This routine is identical for crc32c with the exception of the precomputed constant +* table which will be passed as the table argument. The calculation steps are +* the same for both variants. */ -void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register len, Register key, Register tmp1, Register tmp2) { - assert_different_registers(crc, buf, len, key, tmp1, tmp2, rax); +void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register len, Register table, Register tmp1, Register tmp2) { + assert_different_registers(crc, buf, len, table, tmp1, tmp2, rax, r12); Label L_tail, L_tail_restore, L_tail_loop, L_exit, L_align_loop, L_aligned; Label L_fold_tail, L_fold_128b, L_fold_512b, L_fold_512b_loop, L_fold_tail_loop; @@ -7210,8 +7215,6 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le // 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. - lea(key, ExternalAddress(StubRoutines::x86::crc_table_avx512_addr())); - notl(crc); movl(pos, 0); // check if smaller than 256B @@ -7225,7 +7228,7 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le evmovdquq(xmm0, Address(buf, pos, Address::times_1, 0 * 64), Assembler::AVX_512bit); evmovdquq(xmm4, Address(buf, pos, Address::times_1, 1 * 64), Assembler::AVX_512bit); evpxorq(xmm0, xmm0, xmm10, Assembler::AVX_512bit); - evbroadcasti32x4(xmm10, Address(key, 2 * 16), Assembler::AVX_512bit); //zmm10 has rk3 and rk4 + evbroadcasti32x4(xmm10, Address(table, 2 * 16), Assembler::AVX_512bit); //zmm10 has rk3 and rk4 subl(len, 256); cmpl(len, 256); @@ -7233,7 +7236,7 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le evmovdquq(xmm7, Address(buf, pos, Address::times_1, 2 * 64), Assembler::AVX_512bit); evmovdquq(xmm8, Address(buf, pos, Address::times_1, 3 * 64), Assembler::AVX_512bit); - evbroadcasti32x4(xmm16, Address(key, 0 * 16), Assembler::AVX_512bit); //zmm16 has rk-1 and rk-2 + evbroadcasti32x4(xmm16, Address(table, 0 * 16), Assembler::AVX_512bit); //zmm16 has rk-1 and rk-2 subl(len, 256); bind(L_fold_256_B_loop); @@ -7279,8 +7282,8 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le // at this point, the buffer pointer is pointing at the last y Bytes of the buffer, where 0 <= y < 128 // the 128B of folded data is in 8 of the xmm registers : xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 bind(L_fold_128_B_register); - evmovdquq(xmm16, Address(key, 5 * 16), Assembler::AVX_512bit); // multiply by rk9-rk16 - evmovdquq(xmm11, Address(key, 9 * 16), Assembler::AVX_512bit); // multiply by rk17-rk20, rk1,rk2, 0,0 + evmovdquq(xmm16, Address(table, 5 * 16), Assembler::AVX_512bit); // multiply by rk9-rk16 + evmovdquq(xmm11, Address(table, 9 * 16), Assembler::AVX_512bit); // multiply by rk17-rk20, rk1,rk2, 0,0 evpclmulqdq(xmm1, xmm0, xmm16, 0x01, Assembler::AVX_512bit); evpclmulqdq(xmm2, xmm0, xmm16, 0x10, Assembler::AVX_512bit); // save last that has no multiplicand @@ -7289,7 +7292,7 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le evpclmulqdq(xmm5, xmm4, xmm11, 0x01, Assembler::AVX_512bit); evpclmulqdq(xmm6, xmm4, xmm11, 0x10, Assembler::AVX_512bit); // Needed later in reduction loop - movdqu(xmm10, Address(key, 1 * 16)); + movdqu(xmm10, Address(table, 1 * 16)); vpternlogq(xmm1, 0x96, xmm2, xmm5, Assembler::AVX_512bit); // xor ABC vpternlogq(xmm1, 0x96, xmm6, xmm7, Assembler::AVX_512bit); // xor ABC @@ -7305,7 +7308,7 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le jcc(Assembler::less, L_final_reduction_for_128); bind(L_16B_reduction_loop); - vpclmulqdq(xmm8, xmm7, xmm10, 0x1); + vpclmulqdq(xmm8, xmm7, xmm10, 0x01); vpclmulqdq(xmm7, xmm7, xmm10, 0x10); vpxor(xmm7, xmm7, xmm8, Assembler::AVX_128bit); movdqu(xmm0, Address(buf, pos, Address::times_1, 0 * 16)); @@ -7336,14 +7339,14 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le vpshufb(xmm2, xmm2, xmm0, Assembler::AVX_128bit); blendvpb(xmm2, xmm2, xmm1, xmm0, Assembler::AVX_128bit); - vpclmulqdq(xmm8, xmm7, xmm10, 0x1); + vpclmulqdq(xmm8, xmm7, xmm10, 0x01); vpclmulqdq(xmm7, xmm7, xmm10, 0x10); vpxor(xmm7, xmm7, xmm8, Assembler::AVX_128bit); vpxor(xmm7, xmm7, xmm2, Assembler::AVX_128bit); bind(L_128_done); // compute crc of a 128-bit value - movdqu(xmm10, Address(key, 3 * 16)); + movdqu(xmm10, Address(table, 3 * 16)); movdqu(xmm0, xmm7); // 64b fold @@ -7359,14 +7362,14 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le jmp(L_barrett); bind(L_less_than_256); - kernel_crc32_avx512_256B(crc, buf, len, key, pos, tmp1, tmp2, L_barrett, L_16B_reduction_loop, L_get_last_two_xmms, L_128_done, L_cleanup); + kernel_crc32_avx512_256B(crc, buf, len, table, pos, tmp1, tmp2, L_barrett, L_16B_reduction_loop, L_get_last_two_xmms, L_128_done, L_cleanup); //barrett reduction bind(L_barrett); vpand(xmm7, xmm7, ExternalAddress(StubRoutines::x86::crc_by128_masks_avx512_addr() + 1 * 16), Assembler::AVX_128bit, tmp2); movdqu(xmm1, xmm7); movdqu(xmm2, xmm7); - movdqu(xmm10, Address(key, 4 * 16)); + movdqu(xmm10, Address(table, 4 * 16)); pclmulqdq(xmm7, xmm10, 0x0); pxor(xmm7, xmm2); @@ -7378,7 +7381,6 @@ void MacroAssembler::kernel_crc32_avx512(Register crc, Register buf, Register le pextrd(crc, xmm7, 2); bind(L_cleanup); - notl(crc); // ~c addptr(rsp, 16 * 2 + 8); pop(r12); } diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index f5ef24ddf4c..9e08504b117 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -6528,7 +6528,13 @@ address generate_avx_ghash_processBlocks() { if (VM_Version::supports_sse4_1() && VM_Version::supports_avx512_vpclmulqdq() && VM_Version::supports_avx512bw() && VM_Version::supports_avx512vl()) { + // The constants used in the CRC32 algorithm requires the 1's compliment of the initial crc value. + // However, the constant table for CRC32-C assumes the original crc value. Account for this + // difference before calling and after returning. + __ lea(table, ExternalAddress(StubRoutines::x86::crc_table_avx512_addr())); + __ notl(crc); __ kernel_crc32_avx512(crc, buf, len, table, tmp1, tmp2); + __ notl(crc); } else { __ kernel_crc32(crc, buf, len, table, tmp1); } @@ -6580,20 +6586,27 @@ address generate_avx_ghash_processBlocks() { BLOCK_COMMENT("Entry:"); __ enter(); // required for proper stackwalking of RuntimeStub frame + if (VM_Version::supports_sse4_1() && VM_Version::supports_avx512_vpclmulqdq() && + VM_Version::supports_avx512bw() && + VM_Version::supports_avx512vl()) { + __ lea(j, ExternalAddress(StubRoutines::x86::crc32c_table_avx512_addr())); + __ kernel_crc32_avx512(crc, buf, len, j, l, k); + } else { #ifdef _WIN64 - __ push(y); - __ push(z); + __ push(y); + __ push(z); #endif - __ crc32c_ipl_alg2_alt2(crc, buf, len, - a, j, k, - l, y, z, - c_farg0, c_farg1, c_farg2, - is_pclmulqdq_supported); - __ movl(rax, crc); + __ crc32c_ipl_alg2_alt2(crc, buf, len, + a, j, k, + l, y, z, + c_farg0, c_farg1, c_farg2, + is_pclmulqdq_supported); #ifdef _WIN64 - __ pop(z); - __ pop(y); + __ pop(z); + __ pop(y); #endif + } + __ movl(rax, crc); __ vzeroupper(); __ leave(); // required for proper stackwalking of RuntimeStub frame __ ret(0); diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.cpp b/src/hotspot/cpu/x86/stubRoutines_x86.cpp index ec5a5d0f143..81362c76bd6 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.cpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.cpp @@ -221,6 +221,23 @@ juint StubRoutines::x86::_crc_table_avx512[] = 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL }; +juint StubRoutines::x86::_crc32c_table_avx512[] = +{ + 0xb9e02b86UL, 0x00000000UL, 0xdcb17aa4UL, 0x00000000UL, + 0x493c7d27UL, 0x00000000UL, 0xc1068c50UL, 0x0000000eUL, + 0x06e38d70UL, 0x00000002UL, 0x6992cea2UL, 0x00000000UL, + 0x493c7d27UL, 0x00000000UL, 0xdd45aab8UL, 0x00000000UL, + 0xdea713f0UL, 0x00000000UL, 0x05ec76f0UL, 0x00000001UL, + 0x47db8317UL, 0x00000000UL, 0x2ad91c30UL, 0x00000000UL, + 0x0715ce53UL, 0x00000000UL, 0xc49f4f67UL, 0x00000000UL, + 0x39d3b296UL, 0x00000000UL, 0x083a6eecUL, 0x00000000UL, + 0x9e4addf8UL, 0x00000000UL, 0x740eef02UL, 0x00000000UL, + 0xddc0152bUL, 0x00000000UL, 0x1c291d04UL, 0x00000000UL, + 0xba4fc28eUL, 0x00000000UL, 0x3da6d0cbUL, 0x00000000UL, + 0x493c7d27UL, 0x00000000UL, 0xc1068c50UL, 0x0000000eUL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL +}; + juint StubRoutines::x86::_crc_by128_masks_avx512[] = { 0xffffffffUL, 0xffffffffUL, 0x00000000UL, 0x00000000UL, diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.hpp b/src/hotspot/cpu/x86/stubRoutines_x86.hpp index 1ef8377dfc2..e4dd9550ce2 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp @@ -137,6 +137,7 @@ class x86 { #ifdef _LP64 static juint _crc_by128_masks_avx512[]; static juint _crc_table_avx512[]; + static juint _crc32c_table_avx512[]; static juint _shuf_table_crc32_avx512[]; static juint _adler32_shuf0_table[]; static juint _adler32_shuf1_table[]; @@ -256,6 +257,7 @@ class x86 { static address crc_by128_masks_avx512_addr() { return (address)_crc_by128_masks_avx512; } static address shuf_table_crc32_avx512_addr() { return (address)_shuf_table_crc32_avx512; } static address crc_table_avx512_addr() { return (address)_crc_table_avx512; } + static address crc32c_table_avx512_addr() { return (address)_crc32c_table_avx512; } static address ghash_polynomial512_addr() { return _ghash_poly512_addr; } #endif // _LP64 static address ghash_long_swap_mask_addr() { return _ghash_long_swap_mask_addr; } diff --git a/test/micro/org/openjdk/bench/java/util/TestCRC32C.java b/test/micro/org/openjdk/bench/java/util/TestCRC32C.java new file mode 100644 index 00000000000..0c3b39fc59a --- /dev/null +++ b/test/micro/org/openjdk/bench/java/util/TestCRC32C.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.java.util; + +import java.util.Random; +import java.util.concurrent.TimeUnit; +import java.util.zip.CRC32C; +import org.openjdk.jmh.annotations.*; + +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@State(Scope.Benchmark) +@Fork(value = 2) + +public class TestCRC32C { + + private CRC32C crc32c; + private Random random; + private byte[] bytes; + + @Param({"64", "128", "256", "512", "1024", "2048", "4096", "8192", "16384", "32768", "65536"}) + private int count; + + public TestCRC32C() { + crc32c = new CRC32C(); + random = new Random(2147483648L); + bytes = new byte[1000000]; + random.nextBytes(bytes); + } + + @Setup(Level.Iteration) + public void setupBytes() { + crc32c.reset(); + } + + @Benchmark + public void testCRC32CUpdate() { + crc32c.update(bytes, 0, count); + } +} -- GitLab From 652b5f8546d0453238166f8fcd0cd3d882886bb4 Mon Sep 17 00:00:00 2001 From: Tim Prinzing Date: Thu, 2 Dec 2021 20:47:29 +0000 Subject: [PATCH 577/890] 8276674: Malformed Javadoc inline tags in JDK source Reviewed-by: jjg, rriggs, prappo, bchristi --- .../share/classes/java/util/stream/AbstractTask.java | 2 +- src/java.base/share/classes/java/util/stream/FindOps.java | 2 +- src/java.base/share/classes/java/util/stream/Node.java | 6 +++--- src/java.base/share/classes/java/util/stream/Nodes.java | 8 ++++---- .../share/classes/java/util/stream/PipelineHelper.java | 2 +- .../share/classes/jdk/internal/jshell/tool/Feedback.java | 2 +- .../jtreg/vmTestbase/nsk/share/ClassFileFinder.java | 2 +- .../tools/javac/classfiles/attributes/lib/TestResult.java | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/java.base/share/classes/java/util/stream/AbstractTask.java b/src/java.base/share/classes/java/util/stream/AbstractTask.java index 44c2656157b..9a61729f68d 100644 --- a/src/java.base/share/classes/java/util/stream/AbstractTask.java +++ b/src/java.base/share/classes/java/util/stream/AbstractTask.java @@ -180,7 +180,7 @@ abstract class AbstractTask The type of input element diff --git a/src/java.base/share/classes/java/util/stream/Node.java b/src/java.base/share/classes/java/util/stream/Node.java index 131195944ee..7c4dda8adaf 100644 --- a/src/java.base/share/classes/java/util/stream/Node.java +++ b/src/java.base/share/classes/java/util/stream/Node.java @@ -200,7 +200,7 @@ interface Node { Node build(); /** - * Specialized @{code Node.Builder} for int elements + * Specialized {@code Node.Builder} for int elements */ interface OfInt extends Node.Builder, Sink.OfInt { @Override @@ -208,7 +208,7 @@ interface Node { } /** - * Specialized @{code Node.Builder} for long elements + * Specialized {@code Node.Builder} for long elements */ interface OfLong extends Node.Builder, Sink.OfLong { @Override @@ -216,7 +216,7 @@ interface Node { } /** - * Specialized @{code Node.Builder} for double elements + * Specialized {@code Node.Builder} for double elements */ interface OfDouble extends Node.Builder, Sink.OfDouble { @Override diff --git a/src/java.base/share/classes/java/util/stream/Nodes.java b/src/java.base/share/classes/java/util/stream/Nodes.java index ae0c202e514..33e1d920c26 100644 --- a/src/java.base/share/classes/java/util/stream/Nodes.java +++ b/src/java.base/share/classes/java/util/stream/Nodes.java @@ -170,7 +170,7 @@ final class Nodes { } /** - * Produces a variable size @{link Node.Builder}. + * Produces a variable size {@link Node.Builder}. * * @param the type of elements of the node builder * @return a {@code Node.Builder} @@ -208,7 +208,7 @@ final class Nodes { } /** - * Produces a variable size @{link Node.Builder.OfInt}. + * Produces a variable size {@link Node.Builder.OfInt}. * * @return a {@code Node.Builder.OfInt} */ @@ -245,7 +245,7 @@ final class Nodes { } /** - * Produces a variable size @{link Node.Builder.OfLong}. + * Produces a variable size {@link Node.Builder.OfLong}. * * @return a {@code Node.Builder.OfLong} */ @@ -282,7 +282,7 @@ final class Nodes { } /** - * Produces a variable size @{link Node.Builder.OfDouble}. + * Produces a variable size {@link Node.Builder.OfDouble}. * * @return a {@code Node.Builder.OfDouble} */ diff --git a/src/java.base/share/classes/java/util/stream/PipelineHelper.java b/src/java.base/share/classes/java/util/stream/PipelineHelper.java index 7503bb6bf56..9571311ac1f 100644 --- a/src/java.base/share/classes/java/util/stream/PipelineHelper.java +++ b/src/java.base/share/classes/java/util/stream/PipelineHelper.java @@ -163,7 +163,7 @@ abstract class PipelineHelper { abstract Spliterator wrapSpliterator(Spliterator spliterator); /** - * Constructs a @{link Node.Builder} compatible with the output shape of + * Constructs a {@link Node.Builder} compatible with the output shape of * this {@code PipelineHelper}. * * @param exactSizeIfKnown if >=0 then a builder will be created that has a diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java index 60a14bddf09..4b63ad7f200 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/Feedback.java @@ -626,7 +626,7 @@ class Feedback { } /** - * Set mode. Create, changed, or delete a feedback mode. For @{code /set + * Set mode. Create, changed, or delete a feedback mode. For {@code /set * mode [] [-command|-quiet|-delete|-retain]}. * * @return true if successful diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/ClassFileFinder.java b/test/hotspot/jtreg/vmTestbase/nsk/share/ClassFileFinder.java index 3024ae1d7a5..e79430044ca 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/ClassFileFinder.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/ClassFileFinder.java @@ -36,7 +36,7 @@ public class ClassFileFinder { * classpath. * * @param name a classname - * @param classPath @{link File.pathSeparator} separated directories + * @param classPath {@link File.pathSeparator} separated directories * @return an absolute path to the found classfile, or null if it cannot be * found */ diff --git a/test/langtools/tools/javac/classfiles/attributes/lib/TestResult.java b/test/langtools/tools/javac/classfiles/attributes/lib/TestResult.java index 39b727cecea..4c9662f110f 100644 --- a/test/langtools/tools/javac/classfiles/attributes/lib/TestResult.java +++ b/test/langtools/tools/javac/classfiles/attributes/lib/TestResult.java @@ -26,7 +26,7 @@ import java.io.StringWriter; import java.util.*; /** - * This class accumulates test results. Test results can be checked with method @{code checkStatus}. + * This class accumulates test results. Test results can be checked with method {@code checkStatus}. */ public class TestResult extends TestBase { -- GitLab From 15345e3edcd8beee0d2c3192cfaaf76c7accee1f Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Thu, 2 Dec 2021 20:53:13 +0000 Subject: [PATCH 578/890] 8276661: (fs) UserDefinedFileAttributeView no longer works with long path (win) Reviewed-by: alanb --- .../classes/sun/nio/fs/WindowsPath.java | 52 ++++++++++++------- .../WindowsUserDefinedFileAttributeView.java | 4 +- .../UserDefinedFileAttributeView/Basic.java | 10 ++-- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java b/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java index 8500646a96f..ac41eaefc69 100644 --- a/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java +++ b/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java @@ -174,38 +174,48 @@ class WindowsPath implements Path { // use this path for Win32 calls // This method will prefix long paths with \\?\ or \\?\UNC as required. String getPathForWin32Calls() throws WindowsException { - // short absolute paths can be used directly - if (isAbsolute() && path.length() <= MAX_PATH) - return path; + return getPathForWin32Calls(true); + } + + String getPathWithPrefixForWin32Calls() throws WindowsException { + return getPathForWin32Calls(false); + } - // return cached values if available - WeakReference ref = pathForWin32Calls; - String resolved = (ref != null) ? ref.get() : null; - if (resolved != null) { - // Win32 path already available - return resolved; + private String getPathForWin32Calls(boolean allowShortPath) throws WindowsException { + if (allowShortPath) { + // short absolute paths can be used directly + if (isAbsolute() && path.length() <= MAX_PATH) + return path; + + // returned cached value if possible + WeakReference ref = pathForWin32Calls; + String cached = (ref != null) ? ref.get() : null; + if (cached != null) { + // Win32 path already available + return cached; + } } // resolve against default directory - resolved = getAbsolutePath(); + String resolved = getAbsolutePath(); // Long paths need to have "." and ".." removed and be prefixed with // "\\?\". Note that it is okay to remove ".." even when it follows // a link - for example, it is okay for foo/link/../bar to be changed // to foo/bar. The reason is that Win32 APIs to access foo/link/../bar // will access foo/bar anyway (which differs to Unix systems) - if (resolved.length() > MAX_PATH) { + if (resolved.length() > MAX_PATH || !allowShortPath) { if (resolved.length() > MAX_LONG_PATH) { throw new WindowsException("Cannot access file with path exceeding " + MAX_LONG_PATH + " characters"); } - resolved = addPrefixIfNeeded(GetFullPathName(resolved)); + resolved = addPrefix(GetFullPathName(resolved)); } // cache the resolved path (except drive relative paths as the working // directory on removal media devices can change during the lifetime // of the VM) - if (type != WindowsPathType.DRIVE_RELATIVE) { + if (allowShortPath && type != WindowsPathType.DRIVE_RELATIVE) { synchronized (this) { pathForWin32Calls = new WeakReference(resolved); } @@ -279,14 +289,20 @@ class WindowsPath implements Path { Character.toUpperCase(root2.charAt(0)); } + // Add long path prefix to path + static String addPrefix(String path) { + if (path.startsWith("\\\\")) { + path = "\\\\?\\UNC" + path.substring(1, path.length()); + } else { + path = "\\\\?\\" + path; + } + return path; + } + // Add long path prefix to path if required static String addPrefixIfNeeded(String path) { if (path.length() > MAX_PATH) { - if (path.startsWith("\\\\")) { - path = "\\\\?\\UNC" + path.substring(1, path.length()); - } else { - path = "\\\\?\\" + path; - } + return addPrefix(path); } return path; } diff --git a/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java b/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java index 2fba50a3832..a96596af3cd 100644 --- a/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java +++ b/src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java @@ -61,9 +61,7 @@ class WindowsUserDefinedFileAttributeView throw new IllegalArgumentException("'name' has a root component"); if (namePath.getParent() != null) throw new IllegalArgumentException("'name' has more than one element"); - String path = join(file.getPathForWin32Calls(), name); - WindowsPath wp = WindowsPath.createFromNormalizedPath(wfs, path); - return wp.getPathForWin32Calls(); + return join(file.getPathWithPrefixForWin32Calls(), name); } private final WindowsPath file; diff --git a/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java b/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java index bc47b8719f2..00ab4670ba6 100644 --- a/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java +++ b/test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java @@ -242,7 +242,7 @@ public class Basic { // We need to run up to MAX_PATH for directories, // but not quite go over it. - int MAX_PATH = 247; + int MAX_PATH = 250; int requiredLen = MAX_PATH - len - 2; // Create a really long directory name. @@ -252,11 +252,15 @@ public class Basic { Files.createDirectory(longPath); try { - // Try to set absolute path as extended attribute; expect IAE + System.out.println("Testing " + longPath); + + // Try to set absolute path as extended attribute; + // expect IAE tryCatch(IllegalArgumentException.class, new Task() { public void run() throws IOException { setEA(longPath, "user:C:\\"); - }}); + } + }); // Try to set an extended attribute on it. setEA(longPath, "user:short"); -- GitLab From b310f301efd5390408fb56b62cc09eb9a1604413 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 2 Dec 2021 20:59:46 +0000 Subject: [PATCH 579/890] 8277396: [TESTBUG] In DefaultButtonModelCrashTest.java, frame is accessed from main thread Reviewed-by: serb, psadhukhan --- .../DefaultButtonModelCrashTest.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/test/jdk/javax/swing/DefaultButtonModel/DefaultButtonModelCrashTest.java b/test/jdk/javax/swing/DefaultButtonModel/DefaultButtonModelCrashTest.java index efcf335a54d..14190ce65d3 100644 --- a/test/jdk/javax/swing/DefaultButtonModel/DefaultButtonModelCrashTest.java +++ b/test/jdk/javax/swing/DefaultButtonModel/DefaultButtonModelCrashTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -21,23 +21,21 @@ * questions. */ -/** +/* * @test * @bug 8182577 - * @summary Verifies if moving focus via custom ButtonModel causes crash + * @summary Verifies if moving focus to JToggleButton with DefaultButtonModel + * that is added to a ButtonGroup doesn't throw ClassCastException * @key headful * @run main DefaultButtonModelCrashTest */ import java.awt.BorderLayout; -import java.awt.Container; -import java.awt.Point; import java.awt.Robot; import java.awt.event.KeyEvent; import javax.swing.ButtonModel; import javax.swing.DefaultButtonModel; import javax.swing.JCheckBox; -import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; @@ -45,8 +43,6 @@ import javax.swing.SwingUtilities; public class DefaultButtonModelCrashTest { private JFrame frame = null; - private JPanel panel; - private volatile Point p = null; public static void main(String[] args) throws Exception { new DefaultButtonModelCrashTest(); @@ -58,29 +54,34 @@ public class DefaultButtonModelCrashTest { robot.setAutoDelay(200); SwingUtilities.invokeAndWait(() -> go()); robot.waitForIdle(); + robot.delay(1000); robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); robot.delay(100); robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); } finally { - if (frame != null) { SwingUtilities.invokeAndWait(()->frame.dispose()); } + SwingUtilities.invokeAndWait(() -> { + if (frame != null) { + frame.dispose(); + } + }); } } private void go() { - frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - Container contentPane = frame.getContentPane(); - ButtonModel model = new DefaultButtonModel(); + ButtonModel model = new DefaultButtonModel(); JCheckBox check = new JCheckBox("a bit broken"); check.setModel(model); - panel = new JPanel(new BorderLayout()); + + JPanel panel = new JPanel(new BorderLayout()); panel.add(new JTextField("Press Tab (twice?)"), BorderLayout.NORTH); panel.add(check); - contentPane.add(panel); + + frame.getContentPane().add(panel); frame.setLocationRelativeTo(null); frame.pack(); frame.setVisible(true); -- GitLab From b8ac0d20ceec26b3a1dd0b9577817fa6320ea9ef Mon Sep 17 00:00:00 2001 From: Tim Prinzing Date: Thu, 2 Dec 2021 21:22:43 +0000 Subject: [PATCH 580/890] 8276681: Additional malformed Javadoc inline tags in JDK source Reviewed-by: lancea --- .../sun/java/swing/plaf/windows/AnimationController.java | 2 +- .../javax/management/modelmbean/RequiredModelMBean.java | 2 +- .../classes/jdk/internal/net/http/ResponseSubscribers.java | 2 +- .../share/classes/java/rmi/server/RemoteObject.java | 6 +++--- .../internal/security/signature/SignatureProperties.java | 2 +- .../share/classes/com/sun/source/util/Trees.java | 2 +- .../DesktopEventsExceptions/DesktopEventsExceptions.java | 2 +- .../awt/regtesthelpers/process/ProcessCommunicator.java | 2 +- .../tck/flow/support/PublisherVerificationRules.java | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/AnimationController.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/AnimationController.java index 05c2f5c0a40..b50a5ad583e 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/AnimationController.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/AnimationController.java @@ -59,7 +59,7 @@ import sun.awt.AppContext; *

    • It tracks the animation state for every UI component involved in the * animation and paints {@code Skin} in new {@code State} over the * {@code Skin} in last {@code State} using - * {@code AlphaComposite.SrcOver.derive(alpha)} where {code alpha} + * {@code AlphaComposite.SrcOver.derive(alpha)} where {@code alpha} * depends on the state of animation * * diff --git a/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java b/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java index bfa8d5bc79a..abace393e67 100644 --- a/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java +++ b/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java @@ -192,7 +192,7 @@ public class RequiredModelMBean * * @exception MBeanException Wraps a distributed communication Exception. * @exception RuntimeOperationsException Wraps an - * {link java.lang.IllegalArgumentException}: + * {@link java.lang.IllegalArgumentException}: * The MBeanInfo passed in parameter is null. * **/ diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java index ba9df1b4c9c..9506d133324 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java @@ -1086,7 +1086,7 @@ public class ResponseSubscribers { * Invokes bs::getBody using the provided executor. * If invoking bs::getBody requires an executor, and the given executor * is a {@link HttpClientImpl.DelegatingExecutor}, then the executor's - * delegate is used. If an error occurs anywhere then the given {code cf} + * delegate is used. If an error occurs anywhere then the given {@code cf} * is completed exceptionally (this method does not throw). * @param e The executor that should be used to call bs::getBody * @param bs The BodySubscriber diff --git a/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java b/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java index 55f4c8ca626..4245d362a24 100644 --- a/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java +++ b/src/java.rmi/share/classes/java/rmi/server/RemoteObject.java @@ -251,7 +251,7 @@ public abstract class RemoteObject implements Remote, java.io.Serializable { * written by {@link java.io.ObjectOutput#writeInt(int)} * *
    • the data written as a result of calling - * {link java.rmi.server.ObjID#write(java.io.ObjectOutput)} + * {@link java.rmi.server.ObjID#write(java.io.ObjectOutput)} * on the ObjID instance contained in the reference * *
    • the boolean value false, @@ -275,7 +275,7 @@ public abstract class RemoteObject implements Remote, java.io.Serializable { * written by {@link java.io.ObjectOutput#writeInt(int)} * *
    • the data written as a result of calling - * {link java.rmi.server.ObjID#write(java.io.ObjectOutput)} + * {@link java.rmi.server.ObjID#write(java.io.ObjectOutput)} * on the ObjID instance contained in the reference * *
    • the boolean value false, @@ -304,7 +304,7 @@ public abstract class RemoteObject implements Remote, java.io.Serializable { * writeObject on the stream instance * *
    • the data written as a result of calling - * {link java.rmi.server.ObjID#write(java.io.ObjectOutput)} + * {@link java.rmi.server.ObjID#write(java.io.ObjectOutput)} * on the ObjID instance contained in the reference * *
    • the boolean value false, diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java index 22f19b88cb7..e409c992500 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java @@ -88,7 +88,7 @@ public class SignatureProperties extends SignatureElementProxy { /** * Return the ith SignatureProperty. Valid {@code i} - * values are 0 to {@code {link@ getSize}-1}. + * values are 0 to {@code {@link getSize}-1}. * * @param i Index of the requested {@link SignatureProperty} * @return the ith SignatureProperty diff --git a/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java b/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java index b33117bc541..e4228d37bd5 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java +++ b/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java @@ -72,7 +72,7 @@ public abstract class Trees { } /** - * Returns a {code Trees} object for a given {@code ProcessingEnvironment}. + * Returns a {@code Trees} object for a given {@code ProcessingEnvironment}. * @param env the processing environment for which to get the {@code Trees} object * @throws IllegalArgumentException if the env does not support the Tree API. * @return the {@code Trees} object diff --git a/test/jdk/java/awt/Desktop/DesktopEventsExceptions/DesktopEventsExceptions.java b/test/jdk/java/awt/Desktop/DesktopEventsExceptions/DesktopEventsExceptions.java index 2a1b88d7d73..83a35b71a12 100644 --- a/test/jdk/java/awt/Desktop/DesktopEventsExceptions/DesktopEventsExceptions.java +++ b/test/jdk/java/awt/Desktop/DesktopEventsExceptions/DesktopEventsExceptions.java @@ -45,7 +45,7 @@ import java.util.List; * @test * @bug 8203224 * @summary tests that the correct exceptions are thrown by the events classes - * in {code java.awt.desktop} package + * in {@code java.awt.desktop} package * @run main/othervm DesktopEventsExceptions * @run main/othervm -Djava.awt.headless=true DesktopEventsExceptions */ diff --git a/test/jdk/java/awt/regtesthelpers/process/ProcessCommunicator.java b/test/jdk/java/awt/regtesthelpers/process/ProcessCommunicator.java index 60a5952b32c..474a23717ea 100644 --- a/test/jdk/java/awt/regtesthelpers/process/ProcessCommunicator.java +++ b/test/jdk/java/awt/regtesthelpers/process/ProcessCommunicator.java @@ -76,7 +76,7 @@ public class ProcessCommunicator { } /** - * Executes child {code Process} + * Executes child {@code Process} * * @param classToExecute class to be executed as a child java process * @param args args to be passed in to the child process diff --git a/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/PublisherVerificationRules.java b/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/PublisherVerificationRules.java index 823a5174652..3af007cb9e1 100644 --- a/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/PublisherVerificationRules.java +++ b/test/jdk/java/net/httpclient/reactivestreams-tck/org/reactivestreams/tck/flow/support/PublisherVerificationRules.java @@ -126,7 +126,7 @@ public interface PublisherVerificationRules { *

      * The test is not executed if {@link org.reactivestreams.tck.PublisherVerification#maxElementsFromPublisher()} is less than 10. *

      - * Note that this test is probabilistic, that is, may not capture any concurrent invocation in a {code Publisher} implementation. + * Note that this test is probabilistic, that is, may not capture any concurrent invocation in a {@code Publisher} implementation. * Note also that this test is sensitive to cases when a {@code request()} call in {@code onSubscribe()} triggers an asynchronous * call to the other {@code onXXX} methods. In contrast, the test allows synchronous call chain of * {@code onSubscribe -> request -> onNext}. -- GitLab From c93552c8bbcdabb6219327d67409bf63432f49d8 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Thu, 2 Dec 2021 21:31:13 +0000 Subject: [PATCH 581/890] 8277069: [REDO] JDK-8276743 Make openjdk build Zip Archive generation "reproducible" Co-authored-by: Andrew Leonard Co-authored-by: Magnus Ihse Bursie Reviewed-by: erikj --- make/Main.gmk | 10 +- make/ToolsJdk.gmk | 2 + make/common/ZipArchive.gmk | 26 +- .../MakeZipReproducible.java | 231 ++++++++++++++++++ 4 files changed, 262 insertions(+), 7 deletions(-) create mode 100644 make/jdk/src/classes/build/tools/makezipreproducible/MakeZipReproducible.java diff --git a/make/Main.gmk b/make/Main.gmk index 75eee65ba84..e5ea250bf5a 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -324,7 +324,7 @@ $(eval $(call SetupTarget, vscode-project-ccls, \ # aren't built until after libjava and libjvm are available to link to. $(eval $(call SetupTarget, demos-jdk, \ MAKEFILE := CompileDemos, \ - DEPS := java.base-libs exploded-image, \ + DEPS := java.base-libs exploded-image buildtools-jdk, \ )) $(eval $(call SetupTarget, test-image-demos-jdk, \ @@ -383,12 +383,12 @@ bootcycle-images: $(eval $(call SetupTarget, zip-security, \ MAKEFILE := ZipSecurity, \ - DEPS := java.base-java java.security.jgss-java java.security.jgss-libs, \ + DEPS := buildtools-jdk java.base-java java.security.jgss-java java.security.jgss-libs, \ )) $(eval $(call SetupTarget, zip-source, \ MAKEFILE := ZipSource, \ - DEPS := gensrc, \ + DEPS := buildtools-jdk gensrc, \ )) $(eval $(call SetupTarget, jrtfs-jar, \ @@ -508,13 +508,13 @@ $(eval $(call SetupTarget, docs-jdk-index, \ $(eval $(call SetupTarget, docs-zip, \ MAKEFILE := Docs, \ TARGET := docs-zip, \ - DEPS := docs-jdk, \ + DEPS := docs-jdk buildtools-jdk, \ )) $(eval $(call SetupTarget, docs-specs-zip, \ MAKEFILE := Docs, \ TARGET := docs-specs-zip, \ - DEPS := docs-jdk-specs, \ + DEPS := docs-jdk-specs buildtools-jdk, \ )) $(eval $(call SetupTarget, update-build-docs, \ diff --git a/make/ToolsJdk.gmk b/make/ToolsJdk.gmk index 395a78602f6..af9def3a415 100644 --- a/make/ToolsJdk.gmk +++ b/make/ToolsJdk.gmk @@ -82,6 +82,8 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class TOOL_GENERATEEMOJIDATA = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ build.tools.generateemojidata.GenerateEmojiData +TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \ + build.tools.makezipreproducible.MakeZipReproducible # TODO: There are references to the jdwpgen.jar in jdk/make/netbeans/jdwpgen/build.xml # and nbproject/project.properties in the same dir. Needs to be looked at. diff --git a/make/common/ZipArchive.gmk b/make/common/ZipArchive.gmk index efa013f501e..592d1a60aa0 100644 --- a/make/common/ZipArchive.gmk +++ b/make/common/ZipArchive.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2021, 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,6 +26,9 @@ ifndef _ZIP_ARCHIVE_GMK _ZIP_ARCHIVE_GMK := 1 +# Depends on build tools for MakeZipReproducible +include ../ToolsJdk.gmk + ifeq (,$(_MAKEBASE_GMK)) $(error You must include MakeBase.gmk prior to including ZipArchive.gmk) endif @@ -51,6 +54,8 @@ endif # FOLLOW_SYMLINKS - Set to explicitly follow symlinks. Affects performance of # finding files. # ZIP_OPTIONS extra options to pass to zip +# REPRODUCIBLE override ENABLE_REPRODUCIBLE_BUILD (to make zip reproducible or not) + SetupZipArchive = $(NamedParamsMacroTemplate) define SetupZipArchiveBody @@ -124,6 +129,10 @@ define SetupZipArchiveBody ) \ ) + ifeq ($$($1_REPRODUCIBLE), ) + $1_REPRODUCIBLE := $$(ENABLE_REPRODUCIBLE_BUILD) + endif + # Use a slightly shorter name for logging, but with enough path to identify this zip. $1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_ZIP)) @@ -134,6 +143,8 @@ define SetupZipArchiveBody # dir is very small. # If zip has nothing to do, it returns 12 and would fail the build. Check for 12 # and only fail if it's not. + # For reproducible builds set the zip access & modify times to SOURCE_DATE_EPOCH + # by using a ziptmp folder to generate final zip from using MakeZipReproducible. $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) $$(call LogWarn, Updating $$($1_NAME)) $$(call MakeTargetDir) @@ -163,7 +174,18 @@ define SetupZipArchiveBody $$($1_ZIP_EXCLUDES_$$s) \ || test "$$$$?" = "12" \ ))$$(NEWLINE) \ - ) true \ + ) true + ifeq ($$($1_REPRODUCIBLE), true) + $$(call ExecuteWithLog, \ + $$(SUPPORT_OUTPUTDIR)/makezipreproducible/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \ + ($(RM) $$(SUPPORT_OUTPUTDIR)/ziptmp/$1/tmp.zip && \ + $(MKDIR) -p $$(SUPPORT_OUTPUTDIR)/ziptmp/$1 && \ + $(TOOL_MAKEZIPREPRODUCIBLE) -f $$(SUPPORT_OUTPUTDIR)/ziptmp/$1/tmp.zip \ + -t $(SOURCE_DATE_EPOCH) $$@ && \ + $(RM) $$@ && \ + $(MV) $$(SUPPORT_OUTPUTDIR)/ziptmp/$1/tmp.zip $$@ \ + )) + endif $(TOUCH) $$@ # Add zip to target list diff --git a/make/jdk/src/classes/build/tools/makezipreproducible/MakeZipReproducible.java b/make/jdk/src/classes/build/tools/makezipreproducible/MakeZipReproducible.java new file mode 100644 index 00000000000..48f08541d67 --- /dev/null +++ b/make/jdk/src/classes/build/tools/makezipreproducible/MakeZipReproducible.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2021, 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 build.tools.makezipreproducible; + +import java.io.*; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +/** + * Generate a zip file in a "reproducible" manner from the input zip file. + * Standard zip tools rely on OS file list querying whose ordering can vary + * by platform architecture, this class ensures the zip entries are ordered + * and also supports SOURCE_DATE_EPOCH timestamps. + */ +public class MakeZipReproducible { + String input_file = null; + String fname = null; + String zname = ""; + long timestamp = -1L; + boolean verbose = false; + + // Keep a sorted Set of ZipEntrys to be processed, so that the zip is reproducible + SortedMap entries = new TreeMap(); + + private boolean ok; + + public MakeZipReproducible() { + } + + public synchronized boolean run(String args[]) { + ok = true; + if (!parseArgs(args)) { + return false; + } + try { + zname = fname.replace(File.separatorChar, '/'); + if (zname.startsWith("./")) { + zname = zname.substring(2); + } + + if (verbose) System.out.println("Input zip file: " + input_file); + + File inFile = new File(input_file); + if (!inFile.exists()) { + error("Input zip file does not exist"); + ok = false; + } else { + File zipFile = new File(fname); + // Check archive to create does not exist + if (!zipFile.exists()) { + // Process input ZipEntries + ok = processInputEntries(inFile); + if (ok) { + try (FileOutputStream out = new FileOutputStream(fname)) { + ok = create(inFile, new BufferedOutputStream(out, 4096)); + } + } else { + } + } else { + error("Target zip file "+fname+" already exists."); + ok = false; + } + } + } catch (IOException e) { + fatalError(e); + ok = false; + } catch (Error ee) { + ee.printStackTrace(); + ok = false; + } catch (Throwable t) { + t.printStackTrace(); + ok = false; + } + return ok; + } + + boolean parseArgs(String args[]) { + try { + boolean parsingIncludes = false; + boolean parsingExcludes = false; + int count = 0; + while(count < args.length) { + if (args[count].startsWith("-")) { + String flag = args[count].substring(1); + switch (flag.charAt(0)) { + case 'f': + fname = args[++count]; + break; + case 't': + // SOURCE_DATE_EPOCH timestamp specified + timestamp = Long.parseLong(args[++count]) * 1000; + break; + case 'v': + verbose = true; + break; + default: + error(String.format("Illegal option -%s", String.valueOf(flag.charAt(0)))); + usageError(); + return false; + } + } else { + // input zip file + if (input_file != null) { + error("Input zip file already specified"); + usageError(); + return false; + } + input_file = args[count]; + } + count++; + } + } catch (ArrayIndexOutOfBoundsException e) { + usageError(); + return false; + } catch (NumberFormatException e) { + usageError(); + return false; + } + if (fname == null) { + error("-f must be specified"); + usageError(); + return false; + } + // If no files specified then default to current directory + if (input_file == null) { + error("No input zip file specified"); + usageError(); + return false; + } + + return true; + } + + // Process input zip file and add to sorted entries set + boolean processInputEntries(File inFile) throws IOException { + ZipFile zipFile = new ZipFile(inFile); + zipFile.stream().forEach(entry -> entries.put(entry.getName(), entry)); + + return true; + } + + // Create new zip from entries + boolean create(File inFile, OutputStream out) throws IOException + { + try (ZipFile zipFile = new ZipFile(inFile); + ZipOutputStream zos = new ZipOutputStream(out)) { + for (Map.Entry entry : entries.entrySet()) { + ZipEntry zipEntry = entry.getValue(); + if (zipEntry.getSize() > 0) { + try (InputStream eis = zipFile.getInputStream(zipEntry)) { + addEntry(zos, zipEntry, eis); + } + } else { + addEntry(zos, zipEntry, null); + } + } + } + return true; + } + + // Add Entry and data to Zip + void addEntry(ZipOutputStream zos, ZipEntry entry, InputStream entryInputStream) throws IOException { + if (verbose) { + System.out.println("Adding: "+entry.getName()); + } + + // Set to specified timestamp if set otherwise leave as original lastModified time + if (timestamp != -1L) { + entry.setTime(timestamp); + } + + zos.putNextEntry(entry); + if (entry.getSize() > 0 && entryInputStream != null) { + entryInputStream.transferTo(zos); + } + zos.closeEntry(); + } + + void usageError() { + error( + "Usage: MakeZipReproducible [-v] [-t ] -f \n" + + "Options:\n" + + " -v verbose output\n" + + " -f specify archive file name to create\n" + + " -t specific SOURCE_DATE_EPOCH value to use for timestamps\n" + + " input_zip_file re-written as a reproducible zip output_zip_file.\n"); + } + + void fatalError(Exception e) { + e.printStackTrace(); + } + + protected void error(String s) { + System.err.println(s); + } + + public static void main(String args[]) { + MakeZipReproducible z = new MakeZipReproducible(); + System.exit(z.run(args) ? 0 : 1); + } +} + -- GitLab From 19ce33d5e770dc3fd7a9588e7954bbb499b7a05c Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Thu, 2 Dec 2021 22:16:55 +0000 Subject: [PATCH 582/890] 8258512: serviceability/sa/TestJmapCore.java timed out on macOS 10.13.6 Reviewed-by: lmesnik, dcubed --- test/hotspot/jtreg/serviceability/sa/TestJmapCore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java index 1c861f8c601..1acb962c494 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java +++ b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java @@ -26,7 +26,7 @@ * @summary Test verifies that jhsdb jmap could generate heap dump from core when heap is full * @requires vm.hasSA * @library /test/lib - * @run driver/timeout=240 TestJmapCore run heap + * @run driver/timeout=480 TestJmapCore run heap */ import java.io.File; -- GitLab From 473ececaf5df8392e76d022d7126770526be31f7 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Fri, 3 Dec 2021 06:00:14 +0000 Subject: [PATCH 583/890] 8278174: runtime/cds/appcds/LambdaWithJavaAgent.java fails with release VMs Reviewed-by: dholmes --- test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java b/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java index 3398b9f66a4..955c07ac7a6 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/LambdaWithJavaAgent.java @@ -69,6 +69,7 @@ public class LambdaWithJavaAgent { CDSOptions opts = (new CDSOptions()) .addPrefix("-XX:ExtraSharedClassListFile=" + classList, "-cp", appJar, + "-XX:+UnlockDiagnosticVMOptions", "-XX:+AllowArchivingWithJavaAgent", useJavaAgent, "-Xlog:class+load,cds+class=debug,cds") @@ -81,6 +82,7 @@ public class LambdaWithJavaAgent { // run with archive CDSOptions runOpts = (new CDSOptions()) .addPrefix("-cp", appJar, "-Xlog:class+load,cds=debug", + "-XX:+UnlockDiagnosticVMOptions", "-XX:+AllowArchivingWithJavaAgent", useJavaAgent) .setArchiveName(archiveName) -- GitLab From bef5c7a2865e53778e9e476e57c31c0b0f98bcb1 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 3 Dec 2021 07:19:48 +0000 Subject: [PATCH 584/890] 8278116: runtime/modules/LoadUnloadModuleStress.java has duplicate -Xmx Reviewed-by: dholmes --- test/hotspot/jtreg/runtime/modules/LoadUnloadModuleStress.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/modules/LoadUnloadModuleStress.java b/test/hotspot/jtreg/runtime/modules/LoadUnloadModuleStress.java index 2d279856e52..0e1565cf6db 100644 --- a/test/hotspot/jtreg/runtime/modules/LoadUnloadModuleStress.java +++ b/test/hotspot/jtreg/runtime/modules/LoadUnloadModuleStress.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @compile/module=java.base java/lang/ModuleHelper.java * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx64m -Xmx64m LoadUnloadModuleStress 15000 + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xms64m -Xmx64m LoadUnloadModuleStress 15000 */ import java.lang.ref.WeakReference; -- GitLab From 0fbd2713f1b47c343172fa34be021706c957520e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 3 Dec 2021 07:20:39 +0000 Subject: [PATCH 585/890] 8278115: gc/stress/gclocker/TestGCLockerWithSerial.java has duplicate -Xmx Reviewed-by: mli, tschatzl --- .../jtreg/gc/stress/gclocker/TestGCLockerWithSerial.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithSerial.java b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithSerial.java index e81a762212b..9de8fa88ca7 100644 --- a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithSerial.java +++ b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithSerial.java @@ -30,7 +30,7 @@ package gc.stress.gclocker; * @requires vm.gc.Serial * @requires vm.flavor != "minimal" * @summary Stress Serial's GC locker by calling GetPrimitiveArrayCritical while concurrently filling up old gen. - * @run main/native/othervm/timeout=200 -Xlog:gc*=info -Xmx1500m -Xmx1500m -XX:+UseSerialGC gc.stress.gclocker.TestGCLockerWithSerial + * @run main/native/othervm/timeout=200 -Xlog:gc*=info -Xms1500m -Xmx1500m -XX:+UseSerialGC gc.stress.gclocker.TestGCLockerWithSerial */ public class TestGCLockerWithSerial { public static void main(String[] args) { -- GitLab From 890700320a379c2712fe420017f7b84a8904c0c3 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Fri, 3 Dec 2021 07:40:34 +0000 Subject: [PATCH 586/890] 8272234: Pass originating elements from Filer to JavaFileManager Reviewed-by: jjg --- .../tools/ForwardingJavaFileManager.java | 67 +++ .../classes/javax/tools/JavaFileManager.java | 104 ++++ .../tools/javac/api/ClientCodeWrapper.java | 22 + .../javac/main/DelegatingJavaFileManager.java | 12 + .../tools/javac/processing/JavacFiler.java | 31 +- .../javac/api/TestClientCodeWrapper.java | 15 +- .../filer/TestOriginatingElements.java | 486 ++++++++++++++++++ 7 files changed, 727 insertions(+), 10 deletions(-) create mode 100644 test/langtools/tools/javac/processing/filer/TestOriginatingElements.java diff --git a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java index 27b55f3603a..9001b0ef383 100644 --- a/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/ForwardingJavaFileManager.java @@ -26,6 +26,7 @@ package javax.tools; import java.io.IOException; +import java.lang.reflect.Method; import java.util.Iterator; import java.util.Objects; import java.util.ServiceLoader; @@ -144,6 +145,39 @@ public class ForwardingJavaFileManager implements Jav return fileManager.getJavaFileForOutput(location, className, kind, sibling); } + /**{@inheritDoc} + * + * @implSpec If the subclass of the {@code ForwardingJavaFileManager} overrides the + * {@link #getJavaFileForOutput} method, this method will delegate to it as per the + * general contract of {@link JavaFileManager#getJavaFileForOutputForOriginatingFiles}. + * If the subclass does not override the method, the call will be delegated to the + * {@code fileManager}. + * + * @throws IllegalArgumentException {@inheritDoc} + * @throws IllegalStateException {@inheritDoc} + */ + @Override + public JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location, + String className, + Kind kind, + FileObject... originatingFiles) throws IOException { + try { + Method delegate = getClass().getMethod("getJavaFileForOutput", + Location.class, String.class, + Kind.class, FileObject.class); + if (delegate.getDeclaringClass() == ForwardingJavaFileManager.class) { + return fileManager.getJavaFileForOutputForOriginatingFiles(location, className, + kind, originatingFiles); + } else { + return JavaFileManager.super + .getJavaFileForOutputForOriginatingFiles(location, className, + kind, originatingFiles); + } + } catch (NoSuchMethodException ex) { + throw new InternalError("This should never happen.", ex); + } + } + /** * @throws IllegalArgumentException {@inheritDoc} * @throws IllegalStateException {@inheritDoc} @@ -171,6 +205,39 @@ public class ForwardingJavaFileManager implements Jav return fileManager.getFileForOutput(location, packageName, relativeName, sibling); } + /**{@inheritDoc} + * + * @implSpec If the subclass of the {@code ForwardingJavaFileManager} overrides the + * {@link #getFileForOutput} method, this method will delegate to it as per the + * general contract of {@link JavaFileManager#getFileForOutputForOriginatingFiles}. + * If the subclass does not override the method, the call will be delegated to the + * {@code fileManager}. + * + * @throws IllegalArgumentException {@inheritDoc} + * @throws IllegalStateException {@inheritDoc} + */ + @Override + public FileObject getFileForOutputForOriginatingFiles(Location location, + String packageName, + String relativeName, + FileObject... originatingFiles) throws IOException { + try { + Method delegate = getClass().getMethod("getFileForOutput", + Location.class, String.class, + String.class, FileObject.class); + if (delegate.getDeclaringClass() == ForwardingJavaFileManager.class) { + return fileManager.getFileForOutputForOriginatingFiles(location, packageName, + relativeName, originatingFiles); + } else { + return JavaFileManager.super + .getFileForOutputForOriginatingFiles(location, packageName, + relativeName, originatingFiles); + } + } catch (NoSuchMethodException ex) { + throw new InternalError("This should never happen.", ex); + } + } + @Override public void flush() throws IOException { fileManager.flush(); diff --git a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java index 85cde42addc..af926147845 100644 --- a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java @@ -31,6 +31,8 @@ import java.io.IOException; import java.util.Iterator; import java.util.ServiceLoader; import java.util.Set; +import javax.annotation.processing.Filer; +import javax.lang.model.util.Elements; import static javax.tools.JavaFileObject.Kind; @@ -338,6 +340,51 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker { FileObject sibling) throws IOException; + /** + * Returns a {@linkplain JavaFileObject file object} for output + * representing the specified class of the specified kind in the + * given package-oriented location. + * + *

      The provided {@code originatingFiles} represent files that + * were, in an unspecified way, used to create the content of + * the file created by this method. See {@code originatingElements} + * in {@link Filer#createSourceFile}. {@link Elements#getFileObjectOf} + * may be used to convert the {@code Element}s to {@code FileObject}s. + * + * @implSpec The default implementation calls + * {@link #getJavaFileForOutput(javax.tools.JavaFileManager.Location, java.lang.String, javax.tools.JavaFileObject.Kind, javax.tools.FileObject) } + * with the first element of the {@code originatingFiles}, if any, as a {@code sibling}. + * + * @param location a package-oriented location + * @param className the name of a class + * @param kind the kind of file, must be one of {@link + * JavaFileObject.Kind#SOURCE SOURCE} or {@link + * JavaFileObject.Kind#CLASS CLASS} + * @param originatingFiles the files which are contributing to this newly created file; + * {@code null} is equivalent to empty {@code originatingFiles}, + * meaning no known originating files + * @return a file object for output + * @throws IllegalArgumentException if sibling is not known to + * this file manager, or if the location is not known to this file + * manager and the file manager does not support unknown + * locations, or if the kind is not valid, or if the location is + * not an output location + * @throws IOException if an I/O error occurred, or if {@link + * #close} has been called and this file manager cannot be + * reopened + * @throws IllegalStateException {@link #close} has been called + * and this file manager cannot be reopened + * @since 18 + * @see Filer#createSourceFile + */ + default JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location, + String className, + Kind kind, + FileObject... originatingFiles) + throws IOException { + return getJavaFileForOutput(location, className, kind, siblingFrom(originatingFiles)); + } + /** * Returns a {@linkplain FileObject file object} for input * representing the specified relative @@ -430,6 +477,59 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker { FileObject sibling) throws IOException; + /** + * Returns a {@linkplain FileObject file object} for output + * representing the specified relative + * name in the specified package in the given location. + * + *

      The provided {@code originatingFiles} represent files that + * were, in an unspecified way, used to create the content of + * the file created by this method. See {@code originatingElements} + * in {@link Filer#createResource}. {@link Elements#getFileObjectOf} + * may be used to convert the {@code Element}s to {@code FileObject}s. + * + *

      If the returned object represents a {@linkplain + * JavaFileObject.Kind#SOURCE source} or {@linkplain + * JavaFileObject.Kind#CLASS class} file, it must be an instance + * of {@link JavaFileObject}. + * + *

      Informally, the file object returned by this method is + * located in the concatenation of the location, package name, and + * relative name or in a location inferred from the {@code originatingFiles}. + * See {@link #getFileForInput getFileForInput} for an example. + * + * @implSpec The default implementation calls + * {@link #getFileForOutput(javax.tools.JavaFileManager.Location, java.lang.String, java.lang.String, javax.tools.FileObject) } + * with the first element of the {@code originatingFiles}, if any, as a {@code sibling}. + * + * @param location an output location + * @param packageName a package name + * @param relativeName a relative name + * @param originatingFiles the files which are contributing to this newly created file; + * {@code null} is equivalent to empty {@code originatingFiles}, + * meaning no known originating files + * @return a file object + * @throws IllegalArgumentException if sibling is not known to + * this file manager, or if the location is not known to this file + * manager and the file manager does not support unknown + * locations, or if {@code relativeName} is not valid, + * or if the location is not an output location + * @throws IOException if an I/O error occurred, or if {@link + * #close} has been called and this file manager cannot be + * reopened + * @throws IllegalStateException if {@link #close} has been called + * and this file manager cannot be reopened + * @since 18 + * @see Filer#createResource + */ + default FileObject getFileForOutputForOriginatingFiles(Location location, + String packageName, + String relativeName, + FileObject... originatingFiles) + throws IOException { + return getFileForOutput(location, packageName, relativeName, siblingFrom(originatingFiles)); + } + /** * Flushes any resources opened for output by this file manager * directly or indirectly. Flushing a closed file manager has no @@ -594,4 +694,8 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker { throw new UnsupportedOperationException(); } + private static FileObject siblingFrom(FileObject[] originatingFiles) { + return originatingFiles != null && originatingFiles.length > 0 ? originatingFiles[0] : null; + } + } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java index a26345ead88..643d5bbee1f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java @@ -305,6 +305,17 @@ public class ClientCodeWrapper { } } + @Override @DefinedBy(Api.COMPILER) + public JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location, String className, Kind kind, FileObject... originatingFiles) throws IOException { + try { + return wrap(clientJavaFileManager.getJavaFileForOutputForOriginatingFiles(location, className, kind, originatingFiles)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException | Error e) { + throw new ClientCodeException(e); + } + } + @Override @DefinedBy(Api.COMPILER) public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { try { @@ -316,6 +327,17 @@ public class ClientCodeWrapper { } } + @Override @DefinedBy(Api.COMPILER) + public FileObject getFileForOutputForOriginatingFiles(Location location, String packageName, String relativeName, FileObject... originatingFiles) throws IOException { + try { + return wrap(clientJavaFileManager.getFileForOutputForOriginatingFiles(location, packageName, relativeName, originatingFiles)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException | Error e) { + throw new ClientCodeException(e); + } + } + @Override @DefinedBy(Api.COMPILER) public boolean contains(Location location, FileObject file) throws IOException { try { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/DelegatingJavaFileManager.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/DelegatingJavaFileManager.java index 6e242df3060..70b4d4da8c8 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/DelegatingJavaFileManager.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/DelegatingJavaFileManager.java @@ -115,6 +115,12 @@ public class DelegatingJavaFileManager implements JavaFileManager { return delegate(location).getJavaFileForOutput(location, className, kind, sibling); } + @Override + public JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location, String className, Kind kind, + FileObject... originatingFiles) throws IOException { + return delegate(location).getJavaFileForOutputForOriginatingFiles(location, className, kind, originatingFiles); + } + @Override public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { @@ -127,6 +133,12 @@ public class DelegatingJavaFileManager implements JavaFileManager { return delegate(location).getFileForOutput(location, packageName, relativeName, sibling); } + @Override + public FileObject getFileForOutputForOriginatingFiles(Location location, String packageName, String relativeName, + FileObject... originatingFiles) throws IOException { + return delegate(location).getFileForOutputForOriginatingFiles(location, packageName, relativeName, originatingFiles); + } + @Override public void flush() throws IOException { releaseFM.flush(); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java index ebac3ceaa5a..bef291869ab 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java @@ -36,6 +36,7 @@ import java.io.FilterWriter; import java.io.PrintWriter; import java.io.IOException; import java.util.*; +import java.util.stream.Stream; import static java.util.Collections.*; @@ -62,8 +63,10 @@ import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.DefinedBy.Api; import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING; +import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Symbol.PackageSymbol; import com.sun.tools.javac.main.Option; +import java.util.stream.Collectors; /** * The FilerImplementation class must maintain a number of @@ -432,14 +435,14 @@ public class JavacFiler implements Filer, Closeable { public JavaFileObject createSourceFile(CharSequence nameAndModule, Element... originatingElements) throws IOException { Pair moduleAndClass = checkOrInferModule(nameAndModule); - return createSourceOrClassFile(moduleAndClass.fst, true, moduleAndClass.snd); + return createSourceOrClassFile(moduleAndClass.fst, true, moduleAndClass.snd, originatingElements); } @Override @DefinedBy(Api.ANNOTATION_PROCESSING) public JavaFileObject createClassFile(CharSequence nameAndModule, Element... originatingElements) throws IOException { Pair moduleAndClass = checkOrInferModule(nameAndModule); - return createSourceOrClassFile(moduleAndClass.fst, false, moduleAndClass.snd); + return createSourceOrClassFile(moduleAndClass.fst, false, moduleAndClass.snd, originatingElements); } private Pair checkOrInferModule(CharSequence moduleAndPkg) throws FilerException { @@ -483,7 +486,7 @@ public class JavacFiler implements Filer, Closeable { return Pair.of(explicitModule, pkg); } - private JavaFileObject createSourceOrClassFile(ModuleSymbol mod, boolean isSourceFile, String name) throws IOException { + private JavaFileObject createSourceOrClassFile(ModuleSymbol mod, boolean isSourceFile, String name, Element... originatingElements) throws IOException { Assert.checkNonNull(mod); if (lint) { @@ -506,7 +509,7 @@ public class JavacFiler implements Filer, Closeable { JavaFileObject.Kind.CLASS); JavaFileObject fileObject = - fileManager.getJavaFileForOutput(loc, name, kind, null); + fileManager.getJavaFileForOutputForOriginatingFiles(loc, name, kind, originatingFiles(originatingElements)); checkFileReopening(fileObject, true); if (lastRound) @@ -521,6 +524,17 @@ public class JavacFiler implements Filer, Closeable { return new FilerOutputJavaFileObject(mod, name, fileObject); } + private JavaFileObject[] originatingFiles(Element[] originatingElements) { + if (originatingElements == null) { + return new JavaFileObject[0]; + } + JavaFileObject[] originatingFiles = Stream.of(originatingElements) + .map(elementUtils::getFileObjectOf) + .filter(fo -> fo != null) + .toArray(s -> new JavaFileObject[s]); + return originatingFiles; + } + @Override @DefinedBy(Api.ANNOTATION_PROCESSING) public FileObject createResource(JavaFileManager.Location location, CharSequence moduleAndPkg, @@ -538,8 +552,8 @@ public class JavacFiler implements Filer, Closeable { checkName(strPkg); FileObject fileObject = - fileManager.getFileForOutput(location, strPkg, - relativeName.toString(), null); + fileManager.getFileForOutputForOriginatingFiles(location, strPkg, + relativeName.toString(), originatingFiles(originatingElements)); checkFileReopening(fileObject, true); if (fileObject instanceof JavaFileObject javaFileObject) @@ -579,10 +593,9 @@ public class JavacFiler implements Filer, Closeable { // invocation. FileObject fileObject; if (location.isOutputLocation()) { - fileObject = fileManager.getFileForOutput(location, + fileObject = fileManager.getFileForOutputForOriginatingFiles(location, pkg, - relativeName.toString(), - null); + relativeName.toString()); } else { fileObject = fileManager.getFileForInput(location, pkg, diff --git a/test/langtools/tools/javac/api/TestClientCodeWrapper.java b/test/langtools/tools/javac/api/TestClientCodeWrapper.java index c7f595a4512..7c96f29fe5b 100644 --- a/test/langtools/tools/javac/api/TestClientCodeWrapper.java +++ b/test/langtools/tools/javac/api/TestClientCodeWrapper.java @@ -62,7 +62,8 @@ public class TestClientCodeWrapper extends JavacTestingAbstractProcessor { defaultFileManager = fm; for (Method m: getMethodsExcept(JavaFileManager.class, - "close", "getJavaFileForInput", "getLocationForModule", "getServiceLoader", "contains")) { + "close", "getJavaFileForInput", "getLocationForModule", "getServiceLoader", + "contains", "getFileForOutput", "siblingFrom")) { test(m); } @@ -370,6 +371,12 @@ public class TestClientCodeWrapper extends JavacTestingAbstractProcessor { return wrap(super.getJavaFileForOutput(location, className, kind, sibling)); } + @Override + public JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location, String className, Kind kind, FileObject... originatingFiles) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "getJavaFileForOutputForOriginatingFiles"); + return wrap(super.getJavaFileForOutputForOriginatingFiles(location, className, kind, originatingFiles)); + } + @Override public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { throwUserExceptionIfNeeded(fileManagerMethod, "getFileForInput"); @@ -382,6 +389,12 @@ public class TestClientCodeWrapper extends JavacTestingAbstractProcessor { return wrap(super.getFileForOutput(location, packageName, relativeName, sibling)); } + @Override + public FileObject getFileForOutputForOriginatingFiles(Location location, String packageName, String relativeName, FileObject... originatingFiles) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "getFileForOutputForOriginatingFiles"); + return wrap(super.getFileForOutputForOriginatingFiles(location, packageName, relativeName, originatingFiles)); + } + @Override public void flush() throws IOException { throwUserExceptionIfNeeded(fileManagerMethod, "flush"); diff --git a/test/langtools/tools/javac/processing/filer/TestOriginatingElements.java b/test/langtools/tools/javac/processing/filer/TestOriginatingElements.java new file mode 100644 index 00000000000..a936c0bb554 --- /dev/null +++ b/test/langtools/tools/javac/processing/filer/TestOriginatingElements.java @@ -0,0 +1,486 @@ +/* + * Copyright (c) 2021, 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 8272234 + * @summary Verify proper handling of originating elements in javac's Filer. + * @library /tools/lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * @build toolbox.TestRunner toolbox.ToolBox TestOriginatingElements + * @run main TestOriginatingElements + */ + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.Set; + +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.TypeElement; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Iterator; +import javax.annotation.processing.Filer; +import javax.annotation.processing.SupportedOptions; +import javax.lang.model.element.Element; +import javax.lang.model.element.ModuleElement; +import javax.lang.model.element.PackageElement; +import javax.lang.model.util.Elements; +import javax.tools.FileObject; +import javax.tools.ForwardingJavaFileManager; +import javax.tools.JavaFileManager; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardLocation; +import toolbox.JavacTask; +import toolbox.TestRunner; +import toolbox.TestRunner.Test; +import toolbox.ToolBox; +import toolbox.ToolBox.MemoryFileManager; + +public class TestOriginatingElements extends TestRunner { + + public static void main(String... args) throws Exception { + new TestOriginatingElements().runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + private static final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + private final ToolBox tb = new ToolBox(); + + public TestOriginatingElements() { + super(System.err); + } + + @Test + public void testOriginatingElements(Path outerBase) throws Exception { + Path libSrc = outerBase.resolve("lib-src"); + tb.writeJavaFiles(libSrc, + """ + module lib { exports lib1; exports lib2; } + """, + """ + package lib1; + public @interface A { + } + """, + """ + package lib2; + public class Lib { + } + """); + tb.writeFile(libSrc.resolve("lib1/package-info.java"), "@A package lib1;"); + Path libClasses = outerBase.resolve("lib-classes"); + Path libClassesModule = libClasses.resolve("lib"); + Files.createDirectories(libClassesModule); + + new JavacTask(tb) + .files(tb.findJavaFiles(libSrc)) + .outdir(libClassesModule) + .run(); + + Path src = outerBase.resolve("src"); + tb.writeJavaFiles(src, + """ + module m {} + """, + """ + package t; + public class T1 { + } + """, + """ + package t; + public class T2 { + } + """, + """ + package t; + public class T3 { + } + """); + tb.writeFile(src.resolve("p/package-info.java"), "package p;"); + Path classes = outerBase.resolve("classes"); + Files.createDirectories(classes); + try (StandardJavaFileManager sjfm = compiler.getStandardFileManager(null, null, null)) { + List testOutput = new ArrayList<>(); + JavaFileManager fm = new ForwardingJavaFileManager(sjfm) { + @Override + public JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location, + String className, + JavaFileObject.Kind kind, + FileObject... originatingFiles) throws IOException { + List.of(originatingFiles) + .stream() + .map(fo -> getInfo(fo)) + .forEach(testOutput::add); + return super.getJavaFileForOutputForOriginatingFiles(location, className, kind, originatingFiles); + } + @Override + public FileObject getFileForOutputForOriginatingFiles(Location location, + String packageName, + String relativeName, + FileObject... originatingFiles) throws IOException { + List.of(originatingFiles) + .stream() + .map(fo -> getInfo(fo)) + .forEach(testOutput::add); + return super.getFileForOutputForOriginatingFiles(location, packageName, relativeName, originatingFiles); + } + private String getInfo(FileObject fo) { + try { + JavaFileObject jfo = (JavaFileObject) fo; //the test only expects JavaFileObjects here: + JavaFileManager.Location location = jfo.getKind() == JavaFileObject.Kind.SOURCE + ? StandardLocation.SOURCE_PATH + : sjfm.getLocationForModule(StandardLocation.SYSTEM_MODULES, "java.base"); + String binaryName = inferBinaryName(location, jfo); + return binaryName + "(" + jfo.getKind() + ")"; + } catch (IOException ex) { + throw new AssertionError(ex); + } + } + }; + try { + String generatedData; + try (MemoryFileManager mfm = new MemoryFileManager(sjfm)) { + compiler.getTask(null, mfm, null, null, null, + List.of(new ToolBox.JavaSource("package test; public class Generated2 {}"))) + .call(); + generatedData = + Base64.getEncoder().encodeToString(mfm.getFileBytes(StandardLocation.CLASS_OUTPUT, "test.Generated2")); + } + List options = List.of("-sourcepath", src.toString(), + "-processor", "TestOriginatingElements$P", + "-processorpath", System.getProperty("test.class.path"), + "--module-path", libClasses.toString(), + "--add-modules", "lib", + "-d", classes.toString(), + "-AgeneratedData=" + generatedData); + ToolProvider.getSystemJavaCompiler() + .getTask(null, fm, null, options, null, sjfm.getJavaFileObjects(tb.findJavaFiles(src))) + .call(); + List expectedOriginatingFiles = List.of("t.T1(SOURCE)", + "java.lang.String(CLASS)", + "p.package-info(SOURCE)", + "lib1.package-info(CLASS)", + "module-info(SOURCE)", + "module-info(CLASS)", + "t.T2(SOURCE)", + "java.lang.CharSequence(CLASS)", + "p.package-info(SOURCE)", + "lib1.package-info(CLASS)", + "module-info(SOURCE)", + "module-info(CLASS)", + "t.T3(SOURCE)", + "java.lang.Exception(CLASS)", + "p.package-info(SOURCE)", + "lib1.package-info(CLASS)", + "module-info(SOURCE)", + "module-info(CLASS)"); + assertEquals(expectedOriginatingFiles, testOutput); + } catch (IOException ex) { + throw new IllegalStateException(ex); + } + } + } + + @SupportedAnnotationTypes("*") + @SupportedOptions("generatedData") + public static class P extends AbstractProcessor { + int round; + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (round++ == 0) { + Elements elems = processingEnv.getElementUtils(); + ModuleElement mdl = elems.getModuleElement("m"); + ModuleElement java_base = elems.getModuleElement("java.base"); + PackageElement pack = elems.getPackageElement("p"); + PackageElement lib1Pack = elems.getPackageElement("lib1"); + PackageElement lib2Pack = elems.getPackageElement("lib2"); + Filer filer = processingEnv.getFiler(); + try { + filer.createSourceFile("test.Generated1", + element("t.T1"), + element("java.lang.String"), + pack, + lib1Pack, + lib2Pack, + mdl, + java_base).openOutputStream().close(); + try (OutputStream out = filer.createClassFile("test.Generated2", + element("t.T2"), + element("java.lang.CharSequence"), + pack, + lib1Pack, + lib2Pack, + mdl, + java_base).openOutputStream()) { + out.write(Base64.getDecoder().decode(processingEnv.getOptions().get("generatedData"))); + } + filer.createResource(StandardLocation.CLASS_OUTPUT, + "test", + "Generated3.txt", + element("t.T3"), + element("java.lang.Exception"), + pack, + lib1Pack, + lib2Pack, + mdl, + java_base).openOutputStream().close(); + } catch (IOException ex) { + throw new AssertionError(ex); + } + } + return false; + } + + private Element element(String type) { + return processingEnv.getElementUtils().getTypeElement(type); + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + } + + @Test + public void testVacuousJavaFileManager(Path outerBase) throws Exception { + List log = new ArrayList<>(); + JavaFileObject expectedOut = new SimpleJavaFileObject(new URI("Out.java"), JavaFileObject.Kind.SOURCE) {}; + JavaFileManager fm = new MinimalJavaFileManager() { + @Override + public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { + log.add("getJavaFileForOutput(" + location + ", " + className + ", " + kind + ", " + sibling); + return expectedOut; + } + @Override + public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + log.add("getFileForOutput(" + location + ", " + packageName + ", " + relativeName + ", " + sibling); + return expectedOut; + } + }; + + FileObject fo1 = new SimpleJavaFileObject(new URI("Test1.java"), JavaFileObject.Kind.SOURCE) { + @Override + public String toString() { + return "Test1 - FO"; + } + }; + FileObject fo2 = new SimpleJavaFileObject(new URI("Test2.java"), JavaFileObject.Kind.SOURCE) { + @Override + public String toString() { + return "Test2 - FO"; + } + }; + + assertEquals(expectedOut, + fm.getJavaFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test.Test", JavaFileObject.Kind.SOURCE, fo1, fo2)); + assertEquals(List.of("getJavaFileForOutput(CLASS_OUTPUT, test.Test, SOURCE, Test1 - FO"), log); log.clear(); + + assertEquals(expectedOut, + fm.getJavaFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test.Test", JavaFileObject.Kind.SOURCE)); + assertEquals(List.of("getJavaFileForOutput(CLASS_OUTPUT, test.Test, SOURCE, null"), log); log.clear(); + + assertEquals(expectedOut, + fm.getFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test", "Test.java", fo1, fo2)); + assertEquals(List.of("getFileForOutput(CLASS_OUTPUT, test, Test.java, Test1 - FO"), log); log.clear(); + assertEquals(expectedOut, + fm.getFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test", "Test.java")); + assertEquals(List.of("getFileForOutput(CLASS_OUTPUT, test, Test.java, null"), log); log.clear(); + } + + @Test + public void testForwardingJavaFileManager(Path outerBase) throws Exception { + List log = new ArrayList<>(); + JavaFileObject expectedOut = new SimpleJavaFileObject(new URI("Out.java"), JavaFileObject.Kind.SOURCE) {}; + + FileObject fo1 = new SimpleJavaFileObject(new URI("Test1.java"), JavaFileObject.Kind.SOURCE) { + @Override + public String toString() { + return "Test1 - FO"; + } + }; + FileObject fo2 = new SimpleJavaFileObject(new URI("Test2.java"), JavaFileObject.Kind.SOURCE) { + @Override + public String toString() { + return "Test2 - FO"; + } + }; + + JavaFileManager forwardingWithOverride = new ForwardingJavaFileManager<>(new MinimalJavaFileManager() { + @Override + public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { + log.add("getJavaFileForOutput(" + location + ", " + className + ", " + kind + ", " + sibling); + return expectedOut; + } + @Override + public JavaFileObject getJavaFileForOutputForOriginatingFiles(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject... originatingFiles) throws IOException { + throw new AssertionError("Should not be called."); + } + @Override + public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + log.add("getFileForOutput(" + location + ", " + packageName + ", " + relativeName + ", " + sibling); + return expectedOut; + } + @Override + public FileObject getFileForOutputForOriginatingFiles(JavaFileManager.Location location, String packageName, String relativeName, FileObject... originatingFiles) throws IOException { + throw new AssertionError("Should not be called."); + } + }) { + @Override + public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { + return super.getJavaFileForOutput(location, className, kind, sibling); + } + @Override + public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + return super.getFileForOutput(location, packageName, relativeName, sibling); + } + }; + + assertEquals(expectedOut, + forwardingWithOverride.getJavaFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test.Test", JavaFileObject.Kind.SOURCE, fo1, fo2)); + assertEquals(List.of("getJavaFileForOutput(CLASS_OUTPUT, test.Test, SOURCE, Test1 - FO"), log); log.clear(); + + assertEquals(expectedOut, + forwardingWithOverride.getJavaFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test.Test", JavaFileObject.Kind.SOURCE)); + assertEquals(List.of("getJavaFileForOutput(CLASS_OUTPUT, test.Test, SOURCE, null"), log); log.clear(); + + assertEquals(expectedOut, + forwardingWithOverride.getFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test", "Test.java", fo1, fo2)); + assertEquals(List.of("getFileForOutput(CLASS_OUTPUT, test, Test.java, Test1 - FO"), log); log.clear(); + assertEquals(expectedOut, + forwardingWithOverride.getFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test", "Test.java")); + assertEquals(List.of("getFileForOutput(CLASS_OUTPUT, test, Test.java, null"), log); log.clear(); + + JavaFileManager forwardingWithOutOverride = new ForwardingJavaFileManager<>(new MinimalJavaFileManager() { + @Override + public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { + throw new AssertionError("Should not be called."); + } + @Override + public JavaFileObject getJavaFileForOutputForOriginatingFiles(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject... originatingFiles) throws IOException { + log.add("getJavaFileForOutputForOriginatingFiles(" + location + ", " + className + ", " + kind + ", " + List.of(originatingFiles)); + return expectedOut; + } + @Override + public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + throw new AssertionError("Should not be called."); + } + @Override + public FileObject getFileForOutputForOriginatingFiles(JavaFileManager.Location location, String packageName, String relativeName, FileObject... originatingFiles) throws IOException { + log.add("getFileForOutputForOriginatingFiles(" + location + ", " + packageName + ", " + relativeName + ", " + List.of(originatingFiles)); + return expectedOut; + } + }) {}; + + assertEquals(expectedOut, + forwardingWithOutOverride.getJavaFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test.Test", JavaFileObject.Kind.SOURCE, fo1, fo2)); + assertEquals(List.of("getJavaFileForOutputForOriginatingFiles(CLASS_OUTPUT, test.Test, SOURCE, [Test1 - FO, Test2 - FO]"), log); log.clear(); + + assertEquals(expectedOut, + forwardingWithOutOverride.getJavaFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test.Test", JavaFileObject.Kind.SOURCE)); + assertEquals(List.of("getJavaFileForOutputForOriginatingFiles(CLASS_OUTPUT, test.Test, SOURCE, []"), log); log.clear(); + + assertEquals(expectedOut, + forwardingWithOutOverride.getFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test", "Test.java", fo1, fo2)); + assertEquals(List.of("getFileForOutputForOriginatingFiles(CLASS_OUTPUT, test, Test.java, [Test1 - FO, Test2 - FO]"), log); log.clear(); + assertEquals(expectedOut, + forwardingWithOutOverride.getFileForOutputForOriginatingFiles(StandardLocation.CLASS_OUTPUT, "test", "Test.java")); + assertEquals(List.of("getFileForOutputForOriginatingFiles(CLASS_OUTPUT, test, Test.java, []"), log); log.clear(); + } + + class MinimalJavaFileManager implements JavaFileManager { + @Override + public ClassLoader getClassLoader(JavaFileManager.Location location) { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public Iterable list(JavaFileManager.Location location, String packageName, Set kinds, boolean recurse) throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file) { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public boolean isSameFile(FileObject a, FileObject b) { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public boolean handleOption(String current, Iterator remaining) { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public boolean hasLocation(JavaFileManager.Location location) { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public JavaFileObject getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind) throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public FileObject getFileForInput(JavaFileManager.Location location, String packageName, String relativeName) throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public void flush() throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public void close() throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + @Override + public int isSupportedOption(String option) { + throw new UnsupportedOperationException("Not supported."); + } + }; + + private void assertEquals(Object expected, Object actual) throws AssertionError { + if (!expected.equals(actual)) { + throw new AssertionError("Unexpected output: " + actual + ", expected: " + expected); + } + } + +} -- GitLab From 45da3aea22fd85f214e661b2c98631cb91ddb55d Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 3 Dec 2021 08:28:37 +0000 Subject: [PATCH 587/890] 8278163: --with-cacerts-src variable resolved after GenerateCacerts recipe setup Reviewed-by: ihse --- make/modules/java.base/Gendata.gmk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/make/modules/java.base/Gendata.gmk b/make/modules/java.base/Gendata.gmk index 36ddcec9960..4b894eeae4a 100644 --- a/make/modules/java.base/Gendata.gmk +++ b/make/modules/java.base/Gendata.gmk @@ -60,7 +60,11 @@ TARGETS += $(GENDATA_CURDATA) ################################################################################ -GENDATA_CACERTS_SRC := $(TOPDIR)/make/data/cacerts/ +ifneq ($(CACERTS_SRC), ) + GENDATA_CACERTS_SRC := $(CACERTS_SRC) +else + GENDATA_CACERTS_SRC := $(TOPDIR)/make/data/cacerts/ +endif GENDATA_CACERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/cacerts $(GENDATA_CACERTS): $(BUILD_TOOLS_JDK) $(wildcard $(GENDATA_CACERTS_SRC)/*) @@ -71,9 +75,6 @@ $(GENDATA_CACERTS): $(BUILD_TOOLS_JDK) $(wildcard $(GENDATA_CACERTS_SRC)/*) ifeq ($(CACERTS_FILE), ) TARGETS += $(GENDATA_CACERTS) endif -ifneq ($(CACERTS_SRC), ) - GENDATA_CACERTS_SRC := $(CACERTS_SRC) -endif ################################################################################ -- GitLab From d1cad2463a3f70d4ff9246d5bbae268bfa6717d7 Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Fri, 3 Dec 2021 09:54:23 +0000 Subject: [PATCH 588/890] 8278168: Add a few missing words to the specification of Files.mismatch Reviewed-by: rriggs, bpb, iris, alanb --- src/java.base/share/classes/java/nio/file/Files.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/classes/java/nio/file/Files.java b/src/java.base/share/classes/java/nio/file/Files.java index 98efa051d11..9c1f92614fa 100644 --- a/src/java.base/share/classes/java/nio/file/Files.java +++ b/src/java.base/share/classes/java/nio/file/Files.java @@ -1552,7 +1552,7 @@ public final class Files { *

        *
      • The two paths locate the {@linkplain #isSameFile(Path, Path) same file}, * even if two {@linkplain Path#equals(Object) equal} paths locate a file - * does not exist, or
      • + * that does not exist, or *
      • The two files are the same size, and every byte in the first file * is identical to the corresponding byte in the second file.
      • *
      @@ -1561,7 +1561,7 @@ public final class Files { * returned by this method is: *
        *
      • The position of the first mismatched byte, or
      • - *
      • The size of the smaller file (in bytes) when the files are different + *
      • The size of the smaller file (in bytes) when the files are of different * sizes and every byte of the smaller file is identical to the * corresponding byte of the larger file.
      • *
      -- GitLab From 53df9ffbca841358eb8bb49837ec4bf43a1a743b Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Fri, 3 Dec 2021 10:18:21 +0000 Subject: [PATCH 589/890] 8278154: SimpleFileServer#createFileServer() should specify that the returned server is not started Reviewed-by: dfuchs --- .../classes/com/sun/net/httpserver/SimpleFileServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java index 3d5c448c687..a08f48567c9 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java @@ -164,14 +164,15 @@ public final class SimpleFileServer { } /** - * Creates a file server the serves files from a given path. + * Creates a file server that serves files from a given path. * *

      The server is configured with an initial context that maps the * URI {@code path} to a file handler. The file handler is * created as if by an invocation of * {@link #createFileHandler(Path) createFileHandler(rootDirectory)}, and is * associated to a context created as if by an invocation of - * {@link HttpServer#createContext(String) createContext("/")}. + * {@link HttpServer#createContext(String) createContext("/")}. The returned + * server is not started. * *

      An output level can be given to print log messages relating to the * exchanges handled by the server. The log messages, if any, are printed to -- GitLab From e4774e68e3bdb186269e909247bbd1b9f8e4f4be Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 3 Dec 2021 10:57:18 +0000 Subject: [PATCH 590/890] 8277916: Gather non-strong reference count logic in a single place Reviewed-by: sjohanss, mli --- .../share/gc/shared/referenceProcessor.cpp | 25 ++++++++++--------- .../shared/referenceProcessorPhaseTimes.cpp | 5 ++++ .../shared/referenceProcessorPhaseTimes.hpp | 1 + 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index b36d746486d..5f46d8f9568 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -191,10 +191,10 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(RefPro // Stop treating discovered references specially. disable_discovery(); - ReferenceProcessorStats stats(total_count(_discoveredSoftRefs), - total_count(_discoveredWeakRefs), - total_count(_discoveredFinalRefs), - total_count(_discoveredPhantomRefs)); + phase_times.set_ref_discovered(REF_SOFT, total_count(_discoveredSoftRefs)); + phase_times.set_ref_discovered(REF_WEAK, total_count(_discoveredWeakRefs)); + phase_times.set_ref_discovered(REF_FINAL, total_count(_discoveredFinalRefs)); + phase_times.set_ref_discovered(REF_PHANTOM, total_count(_discoveredPhantomRefs)); update_soft_ref_master_clock(); @@ -220,6 +220,10 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(RefPro // Elements on discovered lists were pushed to the pending list. verify_no_references_recorded(); + ReferenceProcessorStats stats(phase_times.ref_discovered(REF_SOFT), + phase_times.ref_discovered(REF_WEAK), + phase_times.ref_discovered(REF_FINAL), + phase_times.ref_discovered(REF_PHANTOM)); return stats; } @@ -725,12 +729,10 @@ void ReferenceProcessor::run_task(RefProcTask& task, RefProcProxyTask& proxy_tas void ReferenceProcessor::process_soft_weak_final_refs(RefProcProxyTask& proxy_task, ReferenceProcessorPhaseTimes& phase_times) { - size_t const num_soft_refs = total_count(_discoveredSoftRefs); - size_t const num_weak_refs = total_count(_discoveredWeakRefs); - size_t const num_final_refs = total_count(_discoveredFinalRefs); + size_t const num_soft_refs = phase_times.ref_discovered(REF_SOFT); + size_t const num_weak_refs = phase_times.ref_discovered(REF_WEAK); + size_t const num_final_refs = phase_times.ref_discovered(REF_FINAL); size_t const num_total_refs = num_soft_refs + num_weak_refs + num_final_refs; - phase_times.set_ref_discovered(REF_WEAK, num_weak_refs); - phase_times.set_ref_discovered(REF_FINAL, num_final_refs); if (num_total_refs == 0) { log_debug(gc, ref)("Skipped SoftWeakFinalRefsPhase of Reference Processing: no references"); @@ -763,7 +765,7 @@ void ReferenceProcessor::process_soft_weak_final_refs(RefProcProxyTask& proxy_ta void ReferenceProcessor::process_final_keep_alive(RefProcProxyTask& proxy_task, ReferenceProcessorPhaseTimes& phase_times) { - size_t const num_final_refs = total_count(_discoveredFinalRefs); + size_t const num_final_refs = phase_times.ref_discovered(REF_FINAL); if (num_final_refs == 0) { log_debug(gc, ref)("Skipped KeepAliveFinalRefsPhase of Reference Processing: no references"); @@ -788,8 +790,7 @@ void ReferenceProcessor::process_final_keep_alive(RefProcProxyTask& proxy_task, void ReferenceProcessor::process_phantom_refs(RefProcProxyTask& proxy_task, ReferenceProcessorPhaseTimes& phase_times) { - size_t const num_phantom_refs = total_count(_discoveredPhantomRefs); - phase_times.set_ref_discovered(REF_PHANTOM, num_phantom_refs); + size_t const num_phantom_refs = phase_times.ref_discovered(REF_PHANTOM); if (num_phantom_refs == 0) { log_debug(gc, ref)("Skipped PhantomRefsPhase of Reference Processing: no references"); diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp index 8d02b56f899..2c9df9f2965 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp @@ -233,6 +233,11 @@ void ReferenceProcessorPhaseTimes::set_ref_discovered(ReferenceType ref_type, si _ref_discovered[ref_type_2_index(ref_type)] = count; } +size_t ReferenceProcessorPhaseTimes::ref_discovered(ReferenceType ref_type) { + ASSERT_REF_TYPE(ref_type); + return _ref_discovered[ref_type_2_index(ref_type)]; +} + double ReferenceProcessorPhaseTimes::balance_queues_time_ms(ReferenceProcessor::RefProcPhases phase) const { ASSERT_PHASE(phase); return _balance_queues_time_ms[phase]; diff --git a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp index 1ebfeb88a9c..5b2e9e7bc7b 100644 --- a/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp +++ b/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp @@ -85,6 +85,7 @@ public: void add_ref_cleared(ReferenceType ref_type, size_t count); void set_ref_discovered(ReferenceType ref_type, size_t count); + size_t ref_discovered(ReferenceType ref_type); void set_balance_queues_time_ms(ReferenceProcessor::RefProcPhases phase, double time_ms); -- GitLab From dda8f26ce0d2b54ef78b74b82e58255aca80576a Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Fri, 3 Dec 2021 10:58:14 +0000 Subject: [PATCH 591/890] 8278139: G1: Refactor G1BlockOffsetTablePart::block_at_or_preceding Reviewed-by: sjohanss, mli --- src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp index e4e24c219de..7471a4ca078 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp @@ -119,20 +119,18 @@ inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr) size_t index = _bot->index_for(addr); - HeapWord* q = _bot->address_for_index(index); - uint offset = _bot->offset_array(index); // Extend u_char to uint. while (offset >= BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); - q -= (BOTConstants::N_words * n_cards_back); index -= n_cards_back; offset = _bot->offset_array(index); } assert(offset < BOTConstants::N_words, "offset too large"); - q -= offset; - return q; + + HeapWord* q = _bot->address_for_index(index); + return q - offset; } inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr(HeapWord* q, HeapWord* n, -- GitLab From 18c54b4e1ade2ea5531054ed19441d5bff84fcdc Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Fri, 3 Dec 2021 13:04:26 +0000 Subject: [PATCH 592/890] 8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop Reviewed-by: aivanov --- .../classes/com/apple/laf/AquaBorder.java | 4 +- .../com/apple/laf/AquaButtonBorder.java | 6 +-- .../classes/com/apple/laf/AquaComboBoxUI.java | 5 +-- .../com/apple/laf/AquaFileChooserUI.java | 8 ++-- .../com/apple/laf/AquaLookAndFeel.java | 4 +- .../classes/com/apple/laf/AquaRootPaneUI.java | 13 +++--- .../classes/com/apple/laf/AquaSliderUI.java | 6 +-- .../com/apple/laf/AquaTableHeaderUI.java | 8 ++-- .../classes/com/apple/laf/ScreenMenu.java | 7 +--- .../macosx/classes/sun/font/CFontManager.java | 4 +- .../sun/lwawt/macosx/CAccessibility.java | 4 +- .../sun/lwawt/macosx/CPlatformWindow.java | 4 +- .../classes/sun/lwawt/macosx/CPrinterJob.java | 4 +- .../imageio/plugins/bmp/BMPImageWriter.java | 8 ++-- .../plugins/common/SimpleCMYKColorSpace.java | 2 +- .../plugins/gif/GIFWritableImageMetadata.java | 3 +- .../imageio/plugins/jpeg/JPEGMetadata.java | 4 +- .../plugins/tiff/TIFFBaseJPEGCompressor.java | 6 +-- .../imageio/plugins/tiff/TIFFImageWriter.java | 2 +- .../swing/plaf/motif/MotifFileChooserUI.java | 6 +-- .../java/swing/plaf/motif/MotifMenuUI.java | 8 ++-- .../sun/media/sound/AbstractMidiDevice.java | 8 ++-- .../sound/AudioFloatFormatConverter.java | 5 +-- .../com/sun/media/sound/PortMixer.java | 4 +- .../sun/media/sound/SoftMixingDataLine.java | 5 +-- .../com/sun/media/sound/SoftSynthesizer.java | 16 +++---- .../share/classes/java/awt/AWTEvent.java | 3 +- .../share/classes/java/awt/Component.java | 4 +- .../share/classes/java/awt/Container.java | 8 ++-- .../share/classes/java/awt/MenuComponent.java | 3 +- .../classes/java/awt/dnd/DropTarget.java | 2 +- .../awt/image/AreaAveragingScaleFilter.java | 4 +- .../java/awt/image/ComponentSampleModel.java | 3 +- .../image/MultiPixelPackedSampleModel.java | 5 +-- .../java/awt/image/ReplicateScaleFilter.java | 14 +++---- .../image/SinglePixelPackedSampleModel.java | 5 +-- .../java/beans/IndexedPropertyDescriptor.java | 5 +-- .../java/beans/PropertyDescriptor.java | 5 +-- .../javax/imageio/ImageTypeSpecifier.java | 17 ++------ .../share/classes/javax/print/DocFlavor.java | 6 +-- .../share/classes/javax/print/MimeType.java | 12 +++--- .../javax/print/attribute/DateTimeSyntax.java | 5 +-- .../print/attribute/HashAttributeSet.java | 9 ++-- .../javax/print/attribute/IntegerSyntax.java | 5 +-- .../print/attribute/ResolutionSyntax.java | 10 ++--- .../print/attribute/SetOfIntegerSyntax.java | 4 +- .../javax/print/attribute/Size2DSyntax.java | 7 ++-- .../javax/print/attribute/TextSyntax.java | 7 ++-- .../javax/print/attribute/URISyntax.java | 5 +-- .../javax/print/attribute/standard/Media.java | 6 +-- .../classes/javax/swing/AbstractAction.java | 2 +- .../classes/javax/swing/AbstractButton.java | 10 ++--- .../classes/javax/swing/DebugGraphics.java | 6 +-- .../share/classes/javax/swing/JComboBox.java | 5 +-- .../share/classes/javax/swing/JComponent.java | 13 +++--- .../classes/javax/swing/JInternalFrame.java | 3 +- .../share/classes/javax/swing/JLabel.java | 4 +- .../share/classes/javax/swing/JList.java | 16 +++---- .../share/classes/javax/swing/JMenu.java | 2 +- .../share/classes/javax/swing/JMenuBar.java | 4 +- .../classes/javax/swing/JOptionPane.java | 29 +++++++------ .../share/classes/javax/swing/JPopupMenu.java | 13 +++--- .../share/classes/javax/swing/JSlider.java | 4 +- .../share/classes/javax/swing/JTable.java | 42 ++++++++----------- .../share/classes/javax/swing/JTree.java | 30 +++++++------ .../javax/swing/MenuSelectionManager.java | 6 +-- .../classes/javax/swing/RepaintManager.java | 2 +- .../classes/javax/swing/SpinnerDateModel.java | 8 ++-- .../javax/swing/SpinnerNumberModel.java | 8 ++-- .../classes/javax/swing/SwingUtilities.java | 4 +- .../classes/javax/swing/TransferHandler.java | 6 +-- .../javax/swing/event/EventListenerList.java | 2 +- .../swing/plaf/basic/BasicDesktopPaneUI.java | 5 +-- .../plaf/basic/BasicInternalFrameUI.java | 12 +++--- .../javax/swing/plaf/basic/BasicMenuUI.java | 14 +++---- .../swing/plaf/basic/BasicOptionPaneUI.java | 13 +++--- .../swing/plaf/basic/BasicSpinnerUI.java | 6 +-- .../swing/plaf/basic/BasicSplitPaneUI.java | 7 ++-- .../swing/plaf/basic/BasicTableHeaderUI.java | 6 +-- .../javax/swing/plaf/basic/BasicTableUI.java | 37 ++++++++-------- .../javax/swing/plaf/basic/BasicTextUI.java | 11 ++--- .../swing/plaf/basic/BasicToolBarUI.java | 4 +- .../javax/swing/plaf/basic/BasicTreeUI.java | 6 +-- .../swing/plaf/metal/MetalFileChooserUI.java | 4 +- .../swing/plaf/synth/SynthTextFieldUI.java | 5 +-- .../javax/swing/plaf/synth/SynthTreeUI.java | 7 ++-- .../classes/javax/swing/text/BoxView.java | 8 ++-- .../swing/text/DefaultStyledDocument.java | 6 +-- .../javax/swing/text/JTextComponent.java | 3 +- .../javax/swing/text/html/AccessibleHTML.java | 9 ++-- .../classes/javax/swing/text/html/CSS.java | 4 +- .../javax/swing/text/html/HRuleView.java | 10 ++--- .../javax/swing/text/html/HTMLDocument.java | 4 +- .../javax/swing/text/html/HTMLEditorKit.java | 21 ++++------ .../javax/swing/text/html/HTMLWriter.java | 12 +++--- .../javax/swing/text/html/HiddenTagView.java | 5 +-- .../classes/javax/swing/text/html/Map.java | 7 ++-- .../javax/swing/text/html/StyleSheet.java | 8 ++-- .../javax/swing/text/rtf/RTFGenerator.java | 2 +- .../swing/tree/DefaultMutableTreeNode.java | 4 +- .../javax/swing/tree/DefaultTreeModel.java | 4 +- .../swing/tree/DefaultTreeSelectionModel.java | 2 +- .../classes/sun/awt/im/InputContext.java | 4 +- .../classes/sun/awt/shell/ShellFolder.java | 4 +- .../classes/sun/font/AttributeValues.java | 8 ++-- .../share/classes/sun/font/FontUtilities.java | 3 +- .../sun/print/PSStreamPrintService.java | 5 +-- .../share/classes/sun/print/PathGraphics.java | 6 +-- .../share/classes/sun/print/PrintJob2D.java | 10 ++--- .../classes/sun/print/ServiceDialog.java | 10 ++--- .../classes/sun/swing/DefaultLookup.java | 38 ++++++++--------- .../sun/swing/MenuItemLayoutHelper.java | 8 ++-- .../classes/sun/awt/X11/XComponentPeer.java | 6 +-- .../classes/sun/awt/X11/XEmbedCanvasPeer.java | 6 +-- .../unix/classes/sun/awt/X11/XWindow.java | 25 +++++------ .../unix/classes/sun/awt/X11/XWindowPeer.java | 8 ++-- .../classes/sun/java2d/xr/XRSurfaceData.java | 7 ++-- .../classes/sun/print/IPPPrintService.java | 3 +- .../unix/classes/sun/print/UnixPrintJob.java | 3 +- .../plaf/windows/WindowsFileChooserUI.java | 4 +- .../sun/awt/shell/Win32ShellFolder2.java | 3 +- .../classes/sun/awt/windows/WPrinterJob.java | 3 +- 122 files changed, 411 insertions(+), 526 deletions(-) diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java index f9e099fd4d4..cf75ab164ba 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -128,7 +128,7 @@ public abstract class AquaBorder implements Border, UIResource { if (!((javax.swing.text.JTextComponent)focusable).isEditable()) return false; } - return (focusable != null && focusable instanceof JComponent && ((JComponent)focusable).hasFocus()); + return (focusable instanceof JComponent jComponent) && jComponent.hasFocus(); } @Override diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java index f58c518d2d4..1d11a0a8d96 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaButtonBorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -145,9 +145,9 @@ public abstract class AquaButtonBorder extends AquaBorder implements Border, UIR * @param c the component for which this border insets value applies */ public Insets getBorderInsets(final Component c) { - if (c == null || !(c instanceof AbstractButton)) return new Insets(0, 0, 0, 0); + if (!(c instanceof AbstractButton button)) return new Insets(0, 0, 0, 0); - Insets margin = ((AbstractButton)c).getMargin(); + Insets margin = button.getMargin(); margin = (margin == null) ? new InsetsUIResource(0, 0, 0, 0) : (Insets)margin.clone(); margin.top += sizeVariant.margins.top; diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java index 06f84d0eae1..c25d89559fc 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -598,8 +598,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { final boolean editable = comboBox.isEditable(); final Dimension size; - if (!editable && arrowButton != null && arrowButton instanceof AquaComboBoxButton) { - final AquaComboBoxButton button = (AquaComboBoxButton)arrowButton; + if (!editable && arrowButton instanceof final AquaComboBoxButton button) { final Insets buttonInsets = button.getInsets(); // Insets insets = comboBox.getInsets(); final Insets insets = new Insets(0, 5, 0, 25);//comboBox.getInsets(); diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java index 4160087be4e..d8bfca02fe7 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -519,14 +519,14 @@ public class AquaFileChooserUI extends FileChooserUI { void setPackageIsTraversable(final Object o) { int newProp = -1; - if (o != null && o instanceof String) newProp = parseTraversableProperty((String)o); + if (o instanceof String s) newProp = parseTraversableProperty(s); if (newProp != -1) fPackageIsTraversable = newProp; else fPackageIsTraversable = sGlobalPackageIsTraversable; } void setApplicationIsTraversable(final Object o) { int newProp = -1; - if (o != null && o instanceof String) newProp = parseTraversableProperty((String)o); + if (o instanceof String s) newProp = parseTraversableProperty(s); if (newProp != -1) fApplicationIsTraversable = newProp; else fApplicationIsTraversable = sGlobalApplicationIsTraversable; } @@ -1985,11 +1985,11 @@ public class AquaFileChooserUI extends FileChooserUI { static { Object o = UIManager.get(PACKAGE_TRAVERSABLE_PROPERTY); - if (o != null && o instanceof String) sGlobalPackageIsTraversable = parseTraversableProperty((String)o); + if (o instanceof String s) sGlobalPackageIsTraversable = parseTraversableProperty(s); else sGlobalPackageIsTraversable = kOpenConditional; o = UIManager.get(APPLICATION_TRAVERSABLE_PROPERTY); - if (o != null && o instanceof String) sGlobalApplicationIsTraversable = parseTraversableProperty((String)o); + if (o instanceof String s) sGlobalApplicationIsTraversable = parseTraversableProperty(s); else sGlobalApplicationIsTraversable = kOpenConditional; } static final String sDataPrefix = "FileChooser."; diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java index 610b408c99b..dad0b2279eb 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -188,8 +188,8 @@ public class AquaLookAndFeel extends BasicLookAndFeel { KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance()); final PopupFactory popupFactory = PopupFactory.getSharedInstance(); - if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) { - ((ScreenPopupFactory)popupFactory).setActive(false); + if (popupFactory instanceof ScreenPopupFactory spf) { + spf.setActive(false); } super.uninitialize(); diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java index a4e179645a9..2b4e1bb0867 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -75,8 +75,7 @@ public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, // it is not since we are going to grab the one that was set on the JFrame. :( final Component parent = c.getParent(); - if (parent != null && parent instanceof JFrame) { - final JFrame frameParent = (JFrame)parent; + if (parent instanceof JFrame frameParent) { final Color bg = frameParent.getBackground(); if (bg == null || bg instanceof UIResource) { frameParent.setBackground(UIManager.getColor("Panel.background")); @@ -126,8 +125,8 @@ public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, final Window owningWindow = SwingUtilities.getWindowAncestor(jmb); // Could be a JDialog, and may have been added to a JRootPane not yet in a window. - if (owningWindow != null && owningWindow instanceof JFrame) { - ((AquaMenuBarUI)mbui).setScreenMenuBar((JFrame)owningWindow); + if (owningWindow instanceof JFrame frame) { + ((AquaMenuBarUI)mbui).setScreenMenuBar(frame); } } } @@ -154,8 +153,8 @@ public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, final Window owningWindow = SwingUtilities.getWindowAncestor(jmb); // Could be a JDialog, and may have been added to a JRootPane not yet in a window. - if (owningWindow != null && owningWindow instanceof JFrame) { - ((AquaMenuBarUI)mbui).clearScreenMenuBar((JFrame)owningWindow); + if (owningWindow instanceof JFrame frame) { + ((AquaMenuBarUI)mbui).clearScreenMenuBar(frame); } } } diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java index 3775fc859e4..50da054c1f8 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaSliderUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -266,8 +266,8 @@ public class AquaSliderUI extends BasicSliderUI implements Sizeable { if (slider.getPaintTicks() || slider.getPaintLabels()) return true; final Object shouldPaintArrowThumbProperty = slider.getClientProperty("Slider.paintThumbArrowShape"); - if (shouldPaintArrowThumbProperty != null && shouldPaintArrowThumbProperty instanceof Boolean) { - return ((Boolean)shouldPaintArrowThumbProperty).booleanValue(); + if (shouldPaintArrowThumbProperty instanceof Boolean b) { + return b; } return false; diff --git a/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java index 85577ce46ca..af5621657de 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/AquaTableHeaderUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021, 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 @@ -103,9 +103,8 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI { } final TableHeaderUI headerUI = target.getUI(); - if (headerUI == null || !(headerUI instanceof AquaTableHeaderUI)) return; + if (!(headerUI instanceof AquaTableHeaderUI aquaHeaderUI)) return; - final AquaTableHeaderUI aquaHeaderUI = (AquaTableHeaderUI)headerUI; aquaHeaderUI.sortColumn = tableColumn.getModelIndex(); aquaHeaderUI.sortOrder = sortDirection; final AquaTableCellRenderer renderer = aquaHeaderUI.new AquaTableCellRenderer(); @@ -145,8 +144,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI { } protected static TableColumn getTableColumn(final JTableHeader target, final Object value) { - if (value == null || !(value instanceof Integer)) return null; - final int columnIndex = ((Integer)value).intValue(); + if (!(value instanceof Integer columnIndex)) return null; final TableColumnModel columnModel = target.getColumnModel(); if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) return null; diff --git a/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java b/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java index 4f6e006faf8..747e8ac137e 100644 --- a/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java +++ b/src/java.desktop/macosx/classes/com/apple/laf/ScreenMenu.java @@ -351,11 +351,8 @@ final class ScreenMenu extends Menu // Tell our parent to add/remove us final MenuContainer parent = getParent(); - if (parent != null) { - if (parent instanceof ScreenMenu) { - final ScreenMenu sm = (ScreenMenu)parent; - sm.setChildVisible(fInvoker, b); - } + if (parent instanceof ScreenMenu sm) { + sm.setChildVisible(fInvoker, b); } } diff --git a/src/java.desktop/macosx/classes/sun/font/CFontManager.java b/src/java.desktop/macosx/classes/sun/font/CFontManager.java index 85182158ec1..8775d561f7c 100644 --- a/src/java.desktop/macosx/classes/sun/font/CFontManager.java +++ b/src/java.desktop/macosx/classes/sun/font/CFontManager.java @@ -283,9 +283,9 @@ public final class CFontManager extends SunFontManager { if (realFamily == null) return false; Font2D realFont = realFamily.getFontWithExactStyleMatch(style); - if (realFont == null || !(realFont instanceof CFont)) return false; + if (!(realFont instanceof CFont cFont)) return false; - CFont newFont = new CFont((CFont)realFont, logicalFamilyName); + CFont newFont = new CFont(cFont, logicalFamilyName); registerGenericFont(newFont, true); return true; diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java index 2f23d8d0fdf..f338f25f05e 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java @@ -627,8 +627,8 @@ class CAccessibility implements PropertyChangeListener { return invokeAndWait(new Callable() { public Accessible call() throws Exception { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - if (c == null || !(c instanceof Accessible)) return null; - return CAccessible.getCAccessible((Accessible)c); + if (!(c instanceof Accessible accessible)) return null; + return CAccessible.getCAccessible(accessible); } }, c); } diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index eb97221dc72..1aa4eae1e5d 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -244,12 +244,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo c.execute(ptr -> nativeRevalidateNSWindowShadow(ptr)); }}, new Property(WINDOW_DOCUMENT_FILE) { public void applyProperty(final CPlatformWindow c, final Object value) { - if (value == null || !(value instanceof java.io.File)) { + if (!(value instanceof java.io.File file)) { c.execute(ptr->nativeSetNSWindowRepresentedFilename(ptr, null)); return; } - final String filename = ((java.io.File)value).getAbsolutePath(); + final String filename = file.getAbsolutePath(); c.execute(ptr->nativeSetNSWindowRepresentedFilename(ptr, filename)); }}, new Property(WINDOW_FULL_CONTENT) { diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index 4849c16b79f..de96e59d92e 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -845,10 +845,10 @@ public final class CPrinterJob extends RasterPrinterJob { @Override protected MediaSize getMediaSize(Media media, PrintService service, PageFormat page) { - if (media == null || !(media instanceof MediaSizeName)) { + if (!(media instanceof MediaSizeName msn)) { return getDefaultMediaSize(page); } - MediaSize size = MediaSize.getMediaSizeForName((MediaSizeName) media); + MediaSize size = MediaSize.getMediaSizeForName(msn); return size != null ? size : getDefaultMediaSize(page); } diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index 6a020ae9343..56c21e18548 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -210,10 +210,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { IIOMetadata imageMetadata = image.getMetadata(); BMPMetadata bmpImageMetadata = null; - if (imageMetadata != null - && imageMetadata instanceof BMPMetadata) - { - bmpImageMetadata = (BMPMetadata)imageMetadata; + if (imageMetadata instanceof BMPMetadata bmp) { + bmpImageMetadata = bmp; } else { ImageTypeSpecifier imageType = new ImageTypeSpecifier(colorModel, sampleModel); diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SimpleCMYKColorSpace.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SimpleCMYKColorSpace.java index 95c4d9ec597..75586561598 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SimpleCMYKColorSpace.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SimpleCMYKColorSpace.java @@ -59,7 +59,7 @@ public final class SimpleCMYKColorSpace extends ColorSpace { } public boolean equals(Object o) { - return o != null && o instanceof SimpleCMYKColorSpace; + return o instanceof SimpleCMYKColorSpace; } public int hashCode() { diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java index 8566d45f6a4..a3e8a769490 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java @@ -248,8 +248,7 @@ class GIFWritableImageMetadata extends GIFImageMetadata { Object applicationExtensionData = applicationExtension.getUserObject(); - if (applicationExtensionData == null || - !(applicationExtensionData instanceof byte[])) { + if (!(applicationExtensionData instanceof byte[])) { fatal(applicationExtension, "Bad user object in ApplicationExtension!"); } diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java index ece1df86fcf..a2fe287bc3d 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java @@ -371,8 +371,8 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { JPEGImageWriteParam jparam = null; - if ((param != null) && (param instanceof JPEGImageWriteParam)) { - jparam = (JPEGImageWriteParam) param; + if (param instanceof JPEGImageWriteParam p) { + jparam = p; if (!jparam.areTablesSet()) { jparam = null; } diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java index d78cb1cbdd9..74695ae46ce 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -274,8 +274,8 @@ public abstract class TIFFBaseJPEGCompressor extends TIFFCompressor { // Initialize the ImageWriteParam. if(this.JPEGParam == null) { - if(param != null && param instanceof JPEGImageWriteParam) { - JPEGParam = (JPEGImageWriteParam)param; + if (param instanceof JPEGImageWriteParam p) { + JPEGParam = p; } else { JPEGParam = new JPEGImageWriteParam(writer != null ? diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java index 1d2cff42311..07186c0deb5 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java @@ -2895,7 +2895,7 @@ public class TIFFImageWriter extends ImageWriter { int numThumbs = thumbnails.size(); for(int i = 0; i < numThumbs; i++) { Object thumb = thumbnails.get(i); - if(thumb == null || !(thumb instanceof BufferedImage)) { + if (!(thumb instanceof BufferedImage)) { throw new IllegalArgumentException ("thumbnails contains null references or objects other than BufferedImages!"); } diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java index fcb9e724feb..847fbf4117d 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -787,8 +787,8 @@ public class MotifFileChooserUI extends BasicFileChooserUI { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value != null && value instanceof FileFilter) { - setText(((FileFilter)value).getDescription()); + if (value instanceof FileFilter fileFilter) { + setText(fileFilter.getDescription()); } return this; diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java index eaeb5b2ab66..bcee2e666fa 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifMenuUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -110,10 +110,10 @@ public class MotifMenuUI extends BasicMenuUI manager.clearSelectedPath(); } else { Container cnt = menu.getParent(); - if(cnt != null && cnt instanceof JMenuBar) { + if (cnt instanceof JMenuBar menuBar) { MenuElement[] me = new MenuElement[2]; - me[0]=(MenuElement)cnt; - me[1]=menu; + me[0] = menuBar; + me[1] = menu; manager.setSelectedPath(me); } } diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java index 52588387a78..1b50f31eb9e 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2021, 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 @@ -576,11 +576,9 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice if (midiOutReceiver == oldR) { midiOutReceiver = null; } - if (newR != null) { - if ((newR instanceof MidiOutDevice.MidiOutReceiver) + if ((newR instanceof MidiOutDevice.MidiOutReceiver newReceiver) && (midiOutReceiver == null)) { - midiOutReceiver = ((MidiOutDevice.MidiOutReceiver) newR); - } + midiOutReceiver = newReceiver; } optimizedReceiverCount = ((midiOutReceiver!=null)?1:0); diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java b/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java index 6dbbb338450..cb0dcf9df7e 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -293,8 +293,7 @@ public final class AudioFloatFormatConverter extends FormatConversionProvider { format.getSampleRate(), sourceFormat.isBigEndian()); nrofchannels = targetFormat.getChannels(); Object interpolation = format.getProperty("interpolation"); - if (interpolation != null && (interpolation instanceof String)) { - String resamplerType = (String) interpolation; + if (interpolation instanceof String resamplerType) { if (resamplerType.equalsIgnoreCase("point")) this.resampler = new SoftPointResampler(); if (resamplerType.equalsIgnoreCase("linear")) diff --git a/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java b/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java index 5f2c24788d3..099067f3ad6 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/PortMixer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -115,7 +115,7 @@ final class PortMixer extends AbstractMixer { public Line getLine(Line.Info info) throws LineUnavailableException { Line.Info fullInfo = getLineInfo(info); - if ((fullInfo != null) && (fullInfo instanceof Port.Info)) { + if (fullInfo instanceof Port.Info) { for (int i = 0; i < portInfos.length; i++) { if (fullInfo.equals(portInfos[i])) { return getPort(i); diff --git a/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingDataLine.java b/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingDataLine.java index 99962841c8f..4ba5e614874 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingDataLine.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftMixingDataLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2021, 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 @@ -102,8 +102,7 @@ public abstract class SoftMixingDataLine implements DataLine { format.getSampleRate(), sourceFormat.isBigEndian()); nrofchannels = targetFormat.getChannels(); Object interpolation = format.getProperty("interpolation"); - if (interpolation != null && (interpolation instanceof String)) { - String resamplerType = (String) interpolation; + if (interpolation instanceof String resamplerType) { if (resamplerType.equalsIgnoreCase("point")) this.resampler = new SoftPointResampler(); if (resamplerType.equalsIgnoreCase("linear")) diff --git a/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java b/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java index 9d73c68e6ad..c2642436fe4 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/SoftSynthesizer.java @@ -574,25 +574,25 @@ public final class SoftSynthesizer implements AudioSynthesizer, @Override public boolean loadInstrument(Instrument instrument) { - if (instrument == null || (!(instrument instanceof ModelInstrument))) { + if (!(instrument instanceof ModelInstrument modelInstrument)) { throw new IllegalArgumentException("Unsupported instrument: " + instrument); } List instruments = new ArrayList<>(); - instruments.add((ModelInstrument)instrument); + instruments.add(modelInstrument); return loadInstruments(instruments); } @Override public void unloadInstrument(Instrument instrument) { - if (instrument == null || (!(instrument instanceof ModelInstrument))) { + if (!(instrument instanceof ModelInstrument modelInstrument)) { throw new IllegalArgumentException("Unsupported instrument: " + instrument); } if (!isOpen()) return; - String pat = patchToString(instrument.getPatch()); + String pat = patchToString(modelInstrument.getPatch()); synchronized (control_mutex) { for (SoftChannel c: channels) c.current_instrument = null; @@ -841,11 +841,11 @@ public final class SoftSynthesizer implements AudioSynthesizer, public boolean loadAllInstruments(Soundbank soundbank) { List instruments = new ArrayList<>(); for (Instrument ins: soundbank.getInstruments()) { - if (ins == null || !(ins instanceof ModelInstrument)) { + if (!(ins instanceof ModelInstrument modelInstrument)) { throw new IllegalArgumentException( "Unsupported instrument: " + ins); } - instruments.add((ModelInstrument)ins); + instruments.add(modelInstrument); } return loadInstruments(instruments); } @@ -870,11 +870,11 @@ public final class SoftSynthesizer implements AudioSynthesizer, List instruments = new ArrayList<>(); for (Patch patch: patchList) { Instrument ins = soundbank.getInstrument(patch); - if (ins == null || !(ins instanceof ModelInstrument)) { + if (!(ins instanceof ModelInstrument modelInstrument)) { throw new IllegalArgumentException( "Unsupported instrument: " + ins); } - instruments.add((ModelInstrument)ins); + instruments.add(modelInstrument); } return loadInstruments(instruments); } diff --git a/src/java.desktop/share/classes/java/awt/AWTEvent.java b/src/java.desktop/share/classes/java/awt/AWTEvent.java index 404a4fb221b..93def2fadc9 100644 --- a/src/java.desktop/share/classes/java/awt/AWTEvent.java +++ b/src/java.desktop/share/classes/java/awt/AWTEvent.java @@ -355,8 +355,7 @@ public abstract class AWTEvent extends EventObject { Component comp = null; if (newSource instanceof Component) { comp = (Component)newSource; - while (comp != null && comp.peer != null && - (comp.peer instanceof LightweightPeer)) { + while (comp != null && (comp.peer instanceof LightweightPeer)) { comp = comp.parent; } } diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index c8930123c0b..22ec79a07b5 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -4944,8 +4944,8 @@ public abstract class Component implements ImageObserver, MenuContainer, // the active/passive/peered clients loose focus. if (id == FocusEvent.FOCUS_GAINED) { InputContext inputContext = getInputContext(); - if (inputContext != null && inputContext instanceof sun.awt.im.InputContext) { - ((sun.awt.im.InputContext)inputContext).disableNativeIM(); + if (inputContext instanceof sun.awt.im.InputContext ctx) { + ctx.disableNativeIM(); } } } diff --git a/src/java.desktop/share/classes/java/awt/Container.java b/src/java.desktop/share/classes/java/awt/Container.java index 68270d35ada..5b4489f3cac 100644 --- a/src/java.desktop/share/classes/java/awt/Container.java +++ b/src/java.desktop/share/classes/java/awt/Container.java @@ -3891,18 +3891,18 @@ public class Container extends Component { public void componentAdded(ContainerEvent e) { Component c = e.getChild(); - if (c != null && c instanceof Accessible) { + if (c instanceof Accessible accessible) { AccessibleAWTContainer.this.firePropertyChange( AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, - null, ((Accessible) c).getAccessibleContext()); + null, accessible.getAccessibleContext()); } } public void componentRemoved(ContainerEvent e) { Component c = e.getChild(); - if (c != null && c instanceof Accessible) { + if (c instanceof Accessible accessible) { AccessibleAWTContainer.this.firePropertyChange( AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, - ((Accessible) c).getAccessibleContext(), null); + accessible.getAccessibleContext(), null); } } } diff --git a/src/java.desktop/share/classes/java/awt/MenuComponent.java b/src/java.desktop/share/classes/java/awt/MenuComponent.java index e66b5867b23..0e7ab46cedf 100644 --- a/src/java.desktop/share/classes/java/awt/MenuComponent.java +++ b/src/java.desktop/share/classes/java/awt/MenuComponent.java @@ -373,8 +373,7 @@ public abstract class MenuComponent implements java.io.Serializable { Toolkit.getDefaultToolkit().notifyAWTEventListeners(e); if (newEventsOnly || - (parent != null && parent instanceof MenuComponent && - ((MenuComponent)parent).newEventsOnly)) { + (parent instanceof MenuComponent mc && mc.newEventsOnly)) { if (eventEnabled(e)) { processEvent(e); } else if (e instanceof ActionEvent && parent != null) { diff --git a/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java b/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java index a05dbdebad2..7ba9c9711da 100644 --- a/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java +++ b/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java @@ -793,7 +793,7 @@ public class DropTarget implements DropTargetListener, Serializable { */ protected void initializeAutoscrolling(Point p) { - if (component == null || !(component instanceof Autoscroll)) return; + if (!(component instanceof Autoscroll)) return; autoScroller = createDropTargetAutoScroller(component, p); } diff --git a/src/java.desktop/share/classes/java/awt/image/AreaAveragingScaleFilter.java b/src/java.desktop/share/classes/java/awt/image/AreaAveragingScaleFilter.java index decfeb33622..9e3434d4eed 100644 --- a/src/java.desktop/share/classes/java/awt/image/AreaAveragingScaleFilter.java +++ b/src/java.desktop/share/classes/java/awt/image/AreaAveragingScaleFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -105,7 +105,7 @@ public class AreaAveragingScaleFilter extends ReplicateScaleFilter { private int[] calcRow() { float origmult = ((float) srcWidth) * srcHeight; - if (outpixbuf == null || !(outpixbuf instanceof int[])) { + if (!(outpixbuf instanceof int[])) { outpixbuf = new int[destWidth]; } int[] outpix = (int[]) outpixbuf; diff --git a/src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java b/src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java index f8f6ffff56e..9e0a8548eb0 100644 --- a/src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java +++ b/src/java.desktop/share/classes/java/awt/image/ComponentSampleModel.java @@ -1185,11 +1185,10 @@ public class ComponentSampleModel extends SampleModel } public boolean equals(Object o) { - if ((o == null) || !(o instanceof ComponentSampleModel)) { + if (!(o instanceof ComponentSampleModel that)) { return false; } - ComponentSampleModel that = (ComponentSampleModel)o; return this.width == that.width && this.height == that.height && this.numBands == that.numBands && diff --git a/src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java b/src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java index 6a4aff4a39b..dcec78fb348 100644 --- a/src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java +++ b/src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -655,11 +655,10 @@ public class MultiPixelPackedSampleModel extends SampleModel } public boolean equals(Object o) { - if ((o == null) || !(o instanceof MultiPixelPackedSampleModel)) { + if (!(o instanceof MultiPixelPackedSampleModel that)) { return false; } - MultiPixelPackedSampleModel that = (MultiPixelPackedSampleModel)o; return this.width == that.width && this.height == that.height && this.numBands == that.numBands && diff --git a/src/java.desktop/share/classes/java/awt/image/ReplicateScaleFilter.java b/src/java.desktop/share/classes/java/awt/image/ReplicateScaleFilter.java index 10ba0842772..a92a77e422e 100644 --- a/src/java.desktop/share/classes/java/awt/image/ReplicateScaleFilter.java +++ b/src/java.desktop/share/classes/java/awt/image/ReplicateScaleFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -126,8 +126,8 @@ public class ReplicateScaleFilter extends ImageFilter { String key = "rescale"; String val = destWidth + "x" + destHeight; Object o = p.get(key); - if (o != null && o instanceof String) { - val = ((String) o) + ", " + val; + if (o instanceof String s) { + val = s + ", " + val; } p.put(key, val); super.setProperties(p); @@ -194,8 +194,8 @@ public class ReplicateScaleFilter extends ImageFilter { int dx1 = (2 * x * destWidth + srcWidth - 1) / (2 * srcWidth); int dy1 = (2 * y * destHeight + srcHeight - 1) / (2 * srcHeight); byte[] outpix; - if (outpixbuf != null && outpixbuf instanceof byte[]) { - outpix = (byte[]) outpixbuf; + if (outpixbuf instanceof byte[] outbytes) { + outpix = outbytes; } else { outpix = new byte[destWidth]; outpixbuf = outpix; @@ -235,8 +235,8 @@ public class ReplicateScaleFilter extends ImageFilter { int dx1 = (2 * x * destWidth + srcWidth - 1) / (2 * srcWidth); int dy1 = (2 * y * destHeight + srcHeight - 1) / (2 * srcHeight); int[] outpix; - if (outpixbuf != null && outpixbuf instanceof int[]) { - outpix = (int[]) outpixbuf; + if (outpixbuf instanceof int[] outints) { + outpix = outints; } else { outpix = new int[destWidth]; outpixbuf = outpix; diff --git a/src/java.desktop/share/classes/java/awt/image/SinglePixelPackedSampleModel.java b/src/java.desktop/share/classes/java/awt/image/SinglePixelPackedSampleModel.java index dd9b898e46f..864ed00cf76 100644 --- a/src/java.desktop/share/classes/java/awt/image/SinglePixelPackedSampleModel.java +++ b/src/java.desktop/share/classes/java/awt/image/SinglePixelPackedSampleModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -754,11 +754,10 @@ public class SinglePixelPackedSampleModel extends SampleModel } public boolean equals(Object o) { - if ((o == null) || !(o instanceof SinglePixelPackedSampleModel)) { + if (!(o instanceof SinglePixelPackedSampleModel that)) { return false; } - SinglePixelPackedSampleModel that = (SinglePixelPackedSampleModel)o; return this.width == that.width && this.height == that.height && this.numBands == that.numBands && diff --git a/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java b/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java index ebeff6c4438..b49b1cb07a9 100644 --- a/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/IndexedPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -407,8 +407,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { return true; } - if (obj != null && obj instanceof IndexedPropertyDescriptor) { - IndexedPropertyDescriptor other = (IndexedPropertyDescriptor)obj; + if (obj instanceof IndexedPropertyDescriptor other) { Method otherIndexedReadMethod = other.getIndexedReadMethod(); Method otherIndexedWriteMethod = other.getIndexedWriteMethod(); diff --git a/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java b/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java index 373b7ad6fff..d63c446f373 100644 --- a/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java +++ b/src/java.desktop/share/classes/java/beans/PropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2021, 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 @@ -503,8 +503,7 @@ public class PropertyDescriptor extends FeatureDescriptor { if (this == obj) { return true; } - if (obj != null && obj instanceof PropertyDescriptor) { - PropertyDescriptor other = (PropertyDescriptor)obj; + if (obj instanceof PropertyDescriptor other) { Method otherReadMethod = other.getReadMethod(); Method otherWriteMethod = other.getWriteMethod(); diff --git a/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java b/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java index e50958f1757..e328d7499bc 100644 --- a/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java +++ b/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -328,14 +328,10 @@ public class ImageTypeSpecifier { } public boolean equals(Object o) { - if ((o == null) || - !(o instanceof ImageTypeSpecifier.Interleaved)) { + if (!(o instanceof Interleaved that)) { return false; } - ImageTypeSpecifier.Interleaved that = - (ImageTypeSpecifier.Interleaved)o; - if ((!(this.colorSpace.equals(that.colorSpace))) || (this.dataType != that.dataType) || (this.hasAlpha != that.hasAlpha) || @@ -472,14 +468,10 @@ public class ImageTypeSpecifier { } public boolean equals(Object o) { - if ((o == null) || - !(o instanceof ImageTypeSpecifier.Banded)) { + if (!(o instanceof Banded that)) { return false; } - ImageTypeSpecifier.Banded that = - (ImageTypeSpecifier.Banded)o; - if ((!(this.colorSpace.equals(that.colorSpace))) || (this.dataType != that.dataType) || (this.hasAlpha != that.hasAlpha) || @@ -1095,11 +1087,10 @@ public class ImageTypeSpecifier { * {@code ImageTypeSpecifier}. */ public boolean equals(Object o) { - if ((o == null) || !(o instanceof ImageTypeSpecifier)) { + if (!(o instanceof ImageTypeSpecifier that)) { return false; } - ImageTypeSpecifier that = (ImageTypeSpecifier)o; return (colorModel.equals(that.colorModel)) && (sampleModel.equals(that.sampleModel)); } diff --git a/src/java.desktop/share/classes/javax/print/DocFlavor.java b/src/java.desktop/share/classes/javax/print/DocFlavor.java index 557a1799a24..0e04dfb471c 100644 --- a/src/java.desktop/share/classes/javax/print/DocFlavor.java +++ b/src/java.desktop/share/classes/javax/print/DocFlavor.java @@ -537,10 +537,8 @@ public class DocFlavor implements Serializable, Cloneable { * {@code false} otherwise */ public boolean equals(Object obj) { - return - obj != null && - obj instanceof DocFlavor && - getStringValue().equals (((DocFlavor) obj).getStringValue()); + return obj instanceof DocFlavor other && + getStringValue().equals(other.getStringValue()); } /** diff --git a/src/java.desktop/share/classes/javax/print/MimeType.java b/src/java.desktop/share/classes/javax/print/MimeType.java index b2967428a2a..4e3acdb99fa 100644 --- a/src/java.desktop/share/classes/javax/print/MimeType.java +++ b/src/java.desktop/share/classes/javax/print/MimeType.java @@ -141,10 +141,9 @@ class MimeType implements Serializable, Cloneable { throw new UnsupportedOperationException(); } public boolean equals(Object o) { - return (o != null && - o instanceof Map.Entry && - getKey().equals (((Map.Entry) o).getKey()) && - getValue().equals(((Map.Entry) o).getValue())); + return o instanceof Map.Entry entry && + getKey().equals(entry.getKey()) && + getValue().equals(entry.getValue()); } public int hashCode() { return getKey().hashCode() ^ getValue().hashCode(); @@ -290,9 +289,8 @@ class MimeType implements Serializable, Cloneable { * {@code false} otherwise */ public boolean equals (Object obj) { - return(obj != null && - obj instanceof MimeType && - getStringValue().equals(((MimeType) obj).getStringValue())); + return obj instanceof MimeType mimeType && + getStringValue().equals(mimeType.getStringValue()); } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java b/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java index 769177ed82b..2f0eafb9f79 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java @@ -115,9 +115,8 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { * attribute, {@code false} otherwise */ public boolean equals(Object object) { - return (object != null && - object instanceof DateTimeSyntax && - value.equals(((DateTimeSyntax) object).value)); + return object instanceof DateTimeSyntax other && + value.equals(other.value); } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java b/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java index aaeef91954c..4ad4c8634aa 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java +++ b/src/java.desktop/share/classes/javax/print/attribute/HashAttributeSet.java @@ -345,10 +345,8 @@ public class HashAttributeSet implements AttributeSet, Serializable { * value */ public boolean containsValue(Attribute attribute) { - return - attribute != null && - attribute instanceof Attribute && - attribute.equals(attrMap.get(attribute.getCategory())); + return attribute != null && + attribute.equals(attrMap.get(attribute.getCategory())); } /** @@ -441,11 +439,10 @@ public class HashAttributeSet implements AttributeSet, Serializable { * set */ public boolean equals(Object object) { - if (object == null || !(object instanceof AttributeSet)) { + if (!(object instanceof AttributeSet aset)) { return false; } - AttributeSet aset = (AttributeSet)object; if (aset.size() != size()) { return false; } diff --git a/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java b/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java index c67eff7ebb8..f6dbee3aa5a 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java @@ -108,9 +108,8 @@ public abstract class IntegerSyntax implements Serializable, Cloneable { * attribute, {@code false} otherwise */ public boolean equals(Object object) { - - return (object != null && object instanceof IntegerSyntax && - value == ((IntegerSyntax) object).value); + return object instanceof IntegerSyntax other && + value == other.value; } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java b/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java index d3eb94956a9..8ffae65a0d2 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java @@ -267,13 +267,9 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * attribute, {@code false} otherwise */ public boolean equals(Object object) { - - return(object != null && - object instanceof ResolutionSyntax && - this.crossFeedResolution == - ((ResolutionSyntax) object).crossFeedResolution && - this.feedResolution == - ((ResolutionSyntax) object).feedResolution); + return object instanceof ResolutionSyntax other && + this.crossFeedResolution == other.crossFeedResolution && + this.feedResolution == other.feedResolution; } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java index 0fac430e29a..6df67ef90ca 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java @@ -483,9 +483,9 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * set-of-integer attribute, {@code false} otherwise */ public boolean equals(Object object) { - if (object != null && object instanceof SetOfIntegerSyntax) { + if (object instanceof SetOfIntegerSyntax other) { int[][] myMembers = this.members; - int[][] otherMembers = ((SetOfIntegerSyntax) object).members; + int[][] otherMembers = other.members; int m = myMembers.length; int n = otherMembers.length; if (m == n) { diff --git a/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java b/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java index 8adc51b8ff5..9ff772bc30d 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java @@ -264,10 +264,9 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { * two-dimensional size attribute, {@code false} otherwise */ public boolean equals(Object object) { - return(object != null && - object instanceof Size2DSyntax && - this.x == ((Size2DSyntax) object).x && - this.y == ((Size2DSyntax) object).y); + return object instanceof Size2DSyntax size2DSyntax && + this.x == size2DSyntax.x && + this.y == size2DSyntax.y; } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java b/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java index 40fd3171e7a..9a343bc8af2 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java @@ -132,10 +132,9 @@ public abstract class TextSyntax implements Serializable, Cloneable { * attribute, {@code false} otherwise */ public boolean equals(Object object) { - return(object != null && - object instanceof TextSyntax && - this.value.equals (((TextSyntax) object).value) && - this.locale.equals (((TextSyntax) object).locale)); + return object instanceof TextSyntax other && + this.value.equals(other.value) && + this.locale.equals(other.locale); } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java b/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java index e5f4f57f138..10545df71fd 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java +++ b/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java @@ -101,9 +101,8 @@ public abstract class URISyntax implements Serializable, Cloneable { * attribute, {@code false} otherwise */ public boolean equals(Object object) { - return(object != null && - object instanceof URISyntax && - this.uri.equals (((URISyntax) object).uri)); + return object instanceof URISyntax other && + this.uri.equals(other.uri); } /** diff --git a/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java b/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java index 6e42547d955..6b62f1dbecd 100644 --- a/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java +++ b/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java @@ -90,9 +90,9 @@ public abstract class Media extends EnumSyntax * attribute, {@code false} otherwise */ public boolean equals(Object object) { - return(object != null && object instanceof Media && - object.getClass() == this.getClass() && - ((Media)object).getValue() == this.getValue()); + return object instanceof Media other && + object.getClass() == this.getClass() && + other.getValue() == this.getValue(); } /** diff --git a/src/java.desktop/share/classes/javax/swing/AbstractAction.java b/src/java.desktop/share/classes/javax/swing/AbstractAction.java index d56821c0424..6a22a985d69 100644 --- a/src/java.desktop/share/classes/javax/swing/AbstractAction.java +++ b/src/java.desktop/share/classes/javax/swing/AbstractAction.java @@ -193,7 +193,7 @@ public abstract class AbstractAction implements Action, Cloneable, Serializable // to change enabled, it would be possible for stack // overflow in the case where a developer implemented setEnabled // in terms of putValue. - if (newValue == null || !(newValue instanceof Boolean)) { + if (!(newValue instanceof Boolean)) { newValue = false; } oldValue = enabled; diff --git a/src/java.desktop/share/classes/javax/swing/AbstractButton.java b/src/java.desktop/share/classes/javax/swing/AbstractButton.java index 56ff09c2c49..8a2936cd499 100644 --- a/src/java.desktop/share/classes/javax/swing/AbstractButton.java +++ b/src/java.desktop/share/classes/javax/swing/AbstractButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -2394,8 +2394,8 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl if (defaultIcon instanceof Accessible) { AccessibleContext ac = ((Accessible)defaultIcon).getAccessibleContext(); - if (ac != null && ac instanceof AccessibleIcon) { - return new AccessibleIcon[] { (AccessibleIcon)ac }; + if (ac instanceof AccessibleIcon ai) { + return new AccessibleIcon[] { ai }; } } return null; @@ -2441,8 +2441,8 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl if (!relationSet.contains(AccessibleRelation.MEMBER_OF)) { // get the members of the button group if one exists ButtonModel model = getModel(); - if (model != null && model instanceof DefaultButtonModel) { - ButtonGroup group = ((DefaultButtonModel)model).getGroup(); + if (model instanceof DefaultButtonModel defaultModel) { + ButtonGroup group = defaultModel.getGroup(); if (group != null) { // set the target of the MEMBER_OF relation to be // the members of the button group. diff --git a/src/java.desktop/share/classes/javax/swing/DebugGraphics.java b/src/java.desktop/share/classes/javax/swing/DebugGraphics.java index 5cd8c69dfac..102f7e35dd5 100644 --- a/src/java.desktop/share/classes/javax/swing/DebugGraphics.java +++ b/src/java.desktop/share/classes/javax/swing/DebugGraphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -1417,8 +1417,8 @@ public class DebugGraphics extends Graphics { Container container = (Container)component; int debugOptions = 0; - while (container != null && (container instanceof JComponent)) { - debugOptions |= info.getDebugOptions((JComponent)container); + while (container instanceof JComponent jc) { + debugOptions |= info.getDebugOptions(jc); container = container.getParent(); } diff --git a/src/java.desktop/share/classes/javax/swing/JComboBox.java b/src/java.desktop/share/classes/javax/swing/JComboBox.java index 3eba525bc81..fdbbdc68657 100644 --- a/src/java.desktop/share/classes/javax/swing/JComboBox.java +++ b/src/java.desktop/share/classes/javax/swing/JComboBox.java @@ -2000,11 +2000,10 @@ implements ItemSelectable,ListDataListener,ActionListener, Accessible { // Get the popup Accessible a = JComboBox.this.getUI().getAccessibleChild(JComboBox.this, 0); - if (a != null && - a instanceof javax.swing.plaf.basic.ComboPopup) { + if (a instanceof javax.swing.plaf.basic.ComboPopup popup) { // get the popup list - JList list = ((javax.swing.plaf.basic.ComboPopup)a).getList(); + JList list = popup.getList(); // return the i-th selection in the popup list AccessibleContext ac = list.getAccessibleContext(); diff --git a/src/java.desktop/share/classes/javax/swing/JComponent.java b/src/java.desktop/share/classes/javax/swing/JComponent.java index 74fcfcd94d8..c572a12ebb4 100644 --- a/src/java.desktop/share/classes/javax/swing/JComponent.java +++ b/src/java.desktop/share/classes/javax/swing/JComponent.java @@ -878,8 +878,7 @@ public abstract class JComponent extends Container implements Serializable, } // If we are only to paint to a specific child, determine // its index. - if (paintingChild != null && - (paintingChild instanceof JComponent) && + if ((paintingChild instanceof JComponent) && paintingChild.isOpaque()) { for (; i >= 0; i--) { if (getComponent(i) == paintingChild){ @@ -3636,20 +3635,18 @@ public abstract class JComponent extends Container implements Serializable, boolean temporary, boolean focusedWindowChangeAllowed, FocusEvent.Cause cause) { - if ((to == null) || !(to instanceof JComponent)) { + if (!(to instanceof JComponent target)) { return true; } - if ((from == null) || !(from instanceof JComponent)) { + if (!(from instanceof JComponent jFocusOwner)) { return true; } - JComponent target = (JComponent) to; if (!target.getVerifyInputWhenFocusTarget()) { return true; } - JComponent jFocusOwner = (JComponent)from; InputVerifier iv = jFocusOwner.getInputVerifier(); if (iv == null) { @@ -3774,7 +3771,7 @@ public abstract class JComponent extends Container implements Serializable, protected AccessibleContainerHandler() {} public void componentAdded(ContainerEvent e) { Component c = e.getChild(); - if (c != null && c instanceof Accessible) { + if (c instanceof Accessible) { AccessibleJComponent.this.firePropertyChange( AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, null, c.getAccessibleContext()); @@ -3782,7 +3779,7 @@ public abstract class JComponent extends Container implements Serializable, } public void componentRemoved(ContainerEvent e) { Component c = e.getChild(); - if (c != null && c instanceof Accessible) { + if (c instanceof Accessible) { AccessibleJComponent.this.firePropertyChange( AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, c.getAccessibleContext(), null); diff --git a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java index 17b0fecde08..62efd03c0db 100644 --- a/src/java.desktop/share/classes/javax/swing/JInternalFrame.java +++ b/src/java.desktop/share/classes/javax/swing/JInternalFrame.java @@ -1233,10 +1233,9 @@ public class JInternalFrame extends JComponent implements @BeanProperty(bound = false, expert = true, description = "Specifies what desktop layer is used.") public void setLayer(Integer layer) { - if(getParent() != null && getParent() instanceof JLayeredPane) { + if (getParent() instanceof JLayeredPane p) { // Normally we want to do this, as it causes the LayeredPane // to draw properly. - JLayeredPane p = (JLayeredPane)getParent(); p.setLayer(this, layer.intValue(), p.getPosition(this)); } else { // Try to do the right thing diff --git a/src/java.desktop/share/classes/javax/swing/JLabel.java b/src/java.desktop/share/classes/javax/swing/JLabel.java index e7678d79374..bb1db1fdfb8 100644 --- a/src/java.desktop/share/classes/javax/swing/JLabel.java +++ b/src/java.desktop/share/classes/javax/swing/JLabel.java @@ -1110,8 +1110,8 @@ public class JLabel extends JComponent implements SwingConstants, Accessible if (icon instanceof Accessible) { AccessibleContext ac = ((Accessible)icon).getAccessibleContext(); - if (ac != null && ac instanceof AccessibleIcon) { - return new AccessibleIcon[] { (AccessibleIcon)ac }; + if (ac instanceof AccessibleIcon ai) { + return new AccessibleIcon[] { ai }; } } return null; diff --git a/src/java.desktop/share/classes/javax/swing/JList.java b/src/java.desktop/share/classes/javax/swing/JList.java index 7932209974b..ac4a1e3fe3a 100644 --- a/src/java.desktop/share/classes/javax/swing/JList.java +++ b/src/java.desktop/share/classes/javax/swing/JList.java @@ -2949,21 +2949,21 @@ public class JList extends JComponent implements Scrollable, Accessible // re-set listData listeners if (name.equals("model")) { - if (oldValue != null && oldValue instanceof ListModel) { - ((ListModel) oldValue).removeListDataListener(this); + if (oldValue instanceof ListModel oldModel) { + oldModel.removeListDataListener(this); } - if (newValue != null && newValue instanceof ListModel) { - ((ListModel) newValue).addListDataListener(this); + if (newValue instanceof ListModel newModel) { + newModel.addListDataListener(this); } // re-set listSelectionModel listeners } else if (name.equals("selectionModel")) { - if (oldValue != null && oldValue instanceof ListSelectionModel) { - ((ListSelectionModel) oldValue).removeListSelectionListener(this); + if (oldValue instanceof ListSelectionModel oldModel) { + oldModel.removeListSelectionListener(this); } - if (newValue != null && newValue instanceof ListSelectionModel) { - ((ListSelectionModel) newValue).addListSelectionListener(this); + if (newValue instanceof ListSelectionModel newModel) { + newModel.addListSelectionListener(this); } firePropertyChange( diff --git a/src/java.desktop/share/classes/javax/swing/JMenu.java b/src/java.desktop/share/classes/javax/swing/JMenu.java index 5e54131d3ed..dbac4812ca8 100644 --- a/src/java.desktop/share/classes/javax/swing/JMenu.java +++ b/src/java.desktop/share/classes/javax/swing/JMenu.java @@ -1598,7 +1598,7 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement return; } JMenuItem mi = getItem(i); - if (mi != null && mi instanceof JMenu) { + if (mi instanceof JMenu) { if (mi.isSelected()) { MenuElement[] old = MenuSelectionManager.defaultManager().getSelectedPath(); diff --git a/src/java.desktop/share/classes/javax/swing/JMenuBar.java b/src/java.desktop/share/classes/javax/swing/JMenuBar.java index cedaf9d25ad..b9458570278 100644 --- a/src/java.desktop/share/classes/javax/swing/JMenuBar.java +++ b/src/java.desktop/share/classes/javax/swing/JMenuBar.java @@ -706,9 +706,7 @@ public class JMenuBar extends JComponent implements Accessible,MenuElement return false; } - if (c != null && c instanceof JComponent && - ((JComponent)c).processKeyBinding(ks, e, condition, pressed)) { - + if (c instanceof JComponent jc && jc.processKeyBinding(ks, e, condition, pressed)) { return true; } diff --git a/src/java.desktop/share/classes/javax/swing/JOptionPane.java b/src/java.desktop/share/classes/javax/swing/JOptionPane.java index 51dcd81d146..99eee90347b 100644 --- a/src/java.desktop/share/classes/javax/swing/JOptionPane.java +++ b/src/java.desktop/share/classes/javax/swing/JOptionPane.java @@ -2330,17 +2330,17 @@ public class JOptionPane extends JComponent implements Accessible Vector values = new Vector(); s.defaultWriteObject(); - // Save the icon, if its Serializable. - if(icon != null && icon instanceof Serializable) { + // Save the icon, if it's Serializable. + if (icon instanceof Serializable) { values.addElement("icon"); values.addElement(icon); } - // Save the message, if its Serializable. - if(message != null && message instanceof Serializable) { + // Save the message, if it's Serializable. + if (message instanceof Serializable) { values.addElement("message"); values.addElement(message); } - // Save the treeModel, if its Serializable. + // Save the treeModel, if it's Serializable. if(options != null) { ArrayList serOptions = new ArrayList(); @@ -2354,17 +2354,17 @@ public class JOptionPane extends JComponent implements Accessible values.addElement(arrayOptions); } } - // Save the initialValue, if its Serializable. - if(initialValue != null && initialValue instanceof Serializable) { + // Save the initialValue, if it's Serializable. + if (initialValue instanceof Serializable) { values.addElement("initialValue"); values.addElement(initialValue); } - // Save the value, if its Serializable. - if(value != null && value instanceof Serializable) { + // Save the value, if it's Serializable. + if (value instanceof Serializable) { values.addElement("value"); values.addElement(value); } - // Save the selectionValues, if its Serializable. + // Save the selectionValues, if it's Serializable. if(selectionValues != null) { boolean serialize = true; @@ -2381,14 +2381,13 @@ public class JOptionPane extends JComponent implements Accessible values.addElement(selectionValues); } } - // Save the inputValue, if its Serializable. - if(inputValue != null && inputValue instanceof Serializable) { + // Save the inputValue, if it's Serializable. + if (inputValue instanceof Serializable) { values.addElement("inputValue"); values.addElement(inputValue); } - // Save the initialSelectionValue, if its Serializable. - if(initialSelectionValue != null && - initialSelectionValue instanceof Serializable) { + // Save the initialSelectionValue, if it's Serializable. + if (initialSelectionValue instanceof Serializable) { values.addElement("initialSelectionValue"); values.addElement(initialSelectionValue); } diff --git a/src/java.desktop/share/classes/javax/swing/JPopupMenu.java b/src/java.desktop/share/classes/javax/swing/JPopupMenu.java index 17afba6ec4b..ef9ad42ef81 100644 --- a/src/java.desktop/share/classes/javax/swing/JPopupMenu.java +++ b/src/java.desktop/share/classes/javax/swing/JPopupMenu.java @@ -988,10 +988,9 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { JPopupMenu mp = this; while((mp!=null) && (mp.isPopupMenu()!=true) && (mp.getInvoker() != null) && - (mp.getInvoker().getParent() != null) && - (mp.getInvoker().getParent() instanceof JPopupMenu) + (mp.getInvoker().getParent() instanceof JPopupMenu popupMenu) ) { - mp = (JPopupMenu) mp.getInvoker().getParent(); + mp = popupMenu; } return mp; } @@ -1330,13 +1329,13 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { Vector values = new Vector(); s.defaultWriteObject(); - // Save the invoker, if its Serializable. - if(invoker != null && invoker instanceof Serializable) { + // Save the invoker if != null, (Component implements Serializable) + if (invoker != null) { values.addElement("invoker"); values.addElement(invoker); } - // Save the popup, if its Serializable. - if(popup != null && popup instanceof Serializable) { + // Save the popup, if it's Serializable. + if (popup instanceof Serializable) { values.addElement("popup"); values.addElement(popup); } diff --git a/src/java.desktop/share/classes/javax/swing/JSlider.java b/src/java.desktop/share/classes/javax/swing/JSlider.java index 6310e69fd4c..0d826fe7e49 100644 --- a/src/java.desktop/share/classes/javax/swing/JSlider.java +++ b/src/java.desktop/share/classes/javax/swing/JSlider.java @@ -1018,8 +1018,8 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { @SuppressWarnings("rawtypes") Dictionary labelTable = getLabelTable(); - if (labelTable != null && (labelTable instanceof PropertyChangeListener)) { - removePropertyChangeListener((PropertyChangeListener) labelTable); + if (labelTable instanceof PropertyChangeListener listener) { + removePropertyChangeListener(listener); } addPropertyChangeListener( table ); diff --git a/src/java.desktop/share/classes/javax/swing/JTable.java b/src/java.desktop/share/classes/javax/swing/JTable.java index 2506ed2cb7d..9af6a1ba616 100644 --- a/src/java.desktop/share/classes/javax/swing/JTable.java +++ b/src/java.desktop/share/classes/javax/swing/JTable.java @@ -6758,11 +6758,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable // re-set tableModel listeners if (name.equals("model")) { - if (oldValue != null && oldValue instanceof TableModel) { - ((TableModel) oldValue).removeTableModelListener(this); + if (oldValue instanceof TableModel oldModel) { + oldModel.removeTableModelListener(this); } - if (newValue != null && newValue instanceof TableModel) { - ((TableModel) newValue).addTableModelListener(this); + if (newValue instanceof TableModel newModel) { + newModel.addTableModelListener(this); } // re-set selectionModel listeners @@ -6771,24 +6771,20 @@ public class JTable extends JComponent implements TableModelListener, Scrollable Object source = e.getSource(); if (source == JTable.this) { // row selection model - if (oldValue != null && - oldValue instanceof ListSelectionModel) { - ((ListSelectionModel) oldValue).removeListSelectionListener(this); + if (oldValue instanceof ListSelectionModel oldModel) { + oldModel.removeListSelectionListener(this); } - if (newValue != null && - newValue instanceof ListSelectionModel) { - ((ListSelectionModel) newValue).addListSelectionListener(this); + if (newValue instanceof ListSelectionModel newModel) { + newModel.addListSelectionListener(this); } } else if (source == JTable.this.getColumnModel()) { - if (oldValue != null && - oldValue instanceof ListSelectionModel) { - ((ListSelectionModel) oldValue).removeListSelectionListener(this); + if (oldValue instanceof ListSelectionModel oldModel) { + oldModel.removeListSelectionListener(this); } - if (newValue != null && - newValue instanceof ListSelectionModel) { - ((ListSelectionModel) newValue).addListSelectionListener(this); + if (newValue instanceof ListSelectionModel newModel) { + newModel.addListSelectionListener(this); } } else { @@ -6799,13 +6795,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable // and column's selection property listener as well } else if (name.equals("columnModel")) { - if (oldValue != null && oldValue instanceof TableColumnModel) { - TableColumnModel tcm = (TableColumnModel) oldValue; + if (oldValue instanceof TableColumnModel tcm) { tcm.removeColumnModelListener(this); tcm.getSelectionModel().removeListSelectionListener(this); } - if (newValue != null && newValue instanceof TableColumnModel) { - TableColumnModel tcm = (TableColumnModel) newValue; + if (newValue instanceof TableColumnModel tcm) { tcm.addColumnModelListener(this); tcm.getSelectionModel().addListSelectionListener(this); } @@ -6813,11 +6807,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable // re-se cellEditor listeners } else if (name.equals("tableCellEditor")) { - if (oldValue != null && oldValue instanceof TableCellEditor) { - ((TableCellEditor) oldValue).removeCellEditorListener(this); + if (oldValue instanceof TableCellEditor oldEditor) { + oldEditor.removeCellEditorListener(this); } - if (newValue != null && newValue instanceof TableCellEditor) { - ((TableCellEditor) newValue).addCellEditorListener(this); + if (newValue instanceof TableCellEditor newEditor) { + newEditor.addCellEditorListener(this); } } } diff --git a/src/java.desktop/share/classes/javax/swing/JTree.java b/src/java.desktop/share/classes/javax/swing/JTree.java index 06b76b0d3da..ae90ea8be8b 100644 --- a/src/java.desktop/share/classes/javax/swing/JTree.java +++ b/src/java.desktop/share/classes/javax/swing/JTree.java @@ -3127,23 +3127,23 @@ public class JTree extends JComponent implements Scrollable, Accessible Vector values = new Vector(); s.defaultWriteObject(); - // Save the cellRenderer, if its Serializable. - if(cellRenderer != null && cellRenderer instanceof Serializable) { + // Save the cellRenderer, if it's Serializable. + if (cellRenderer instanceof Serializable) { values.addElement("cellRenderer"); values.addElement(cellRenderer); } - // Save the cellEditor, if its Serializable. - if(cellEditor != null && cellEditor instanceof Serializable) { + // Save the cellEditor, if it's Serializable. + if (cellEditor instanceof Serializable) { values.addElement("cellEditor"); values.addElement(cellEditor); } - // Save the treeModel, if its Serializable. - if(treeModel != null && treeModel instanceof Serializable) { + // Save the treeModel, if it's Serializable. + if (treeModel instanceof Serializable) { values.addElement("treeModel"); values.addElement(treeModel); } - // Save the selectionModel, if its Serializable. - if(selectionModel != null && selectionModel instanceof Serializable) { + // Save the selectionModel, if it's Serializable. + if (selectionModel instanceof Serializable) { values.addElement("selectionModel"); values.addElement(selectionModel); } @@ -5414,14 +5414,12 @@ public class JTree extends JComponent implements Scrollable, Accessible public Rectangle getBounds() { Rectangle r = tree.getPathBounds(path); Accessible parent = getAccessibleParent(); - if (parent != null) { - if (parent instanceof AccessibleJTreeNode) { - Point parentLoc = ((AccessibleJTreeNode) parent).getLocationInJTree(); - if (parentLoc != null && r != null) { - r.translate(-parentLoc.x, -parentLoc.y); - } else { - return null; // not visible! - } + if (parent instanceof AccessibleJTreeNode treeNode) { + Point parentLoc = treeNode.getLocationInJTree(); + if (parentLoc != null && r != null) { + r.translate(-parentLoc.x, -parentLoc.y); + } else { + return null; // not visible! } } return r; diff --git a/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java b/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java index 25c525a2032..c84a218b877 100644 --- a/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java +++ b/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -72,8 +72,8 @@ public class MenuSelectionManager { // installing additional listener if found in the AppContext Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY); - if (o != null && o instanceof ChangeListener) { - msm.addChangeListener((ChangeListener) o); + if (o instanceof ChangeListener listener) { + msm.addChangeListener(listener); } } diff --git a/src/java.desktop/share/classes/javax/swing/RepaintManager.java b/src/java.desktop/share/classes/javax/swing/RepaintManager.java index 966e6e8489c..fe414fc16af 100644 --- a/src/java.desktop/share/classes/javax/swing/RepaintManager.java +++ b/src/java.desktop/share/classes/javax/swing/RepaintManager.java @@ -928,7 +928,7 @@ public class RepaintManager for (int i = roots.size() - 1; i >= index; i--) { Component c = roots.get(i); for(;;) { - if (c == root || c == null || !(c instanceof JComponent)) { + if (c == root || !(c instanceof JComponent)) { break; } c = c.getParent(); diff --git a/src/java.desktop/share/classes/javax/swing/SpinnerDateModel.java b/src/java.desktop/share/classes/javax/swing/SpinnerDateModel.java index 9117c93809f..c78bc150c1a 100644 --- a/src/java.desktop/share/classes/javax/swing/SpinnerDateModel.java +++ b/src/java.desktop/share/classes/javax/swing/SpinnerDateModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -454,11 +454,11 @@ public class SpinnerDateModel extends AbstractSpinnerModel implements Serializab * @see #addChangeListener */ public void setValue(Object value) { - if ((value == null) || !(value instanceof Date)) { + if (!(value instanceof Date date)) { throw new IllegalArgumentException("illegal value"); } - if (!value.equals(this.value.getTime())) { - this.value.setTime((Date)value); + if (!date.equals(this.value.getTime())) { + this.value.setTime(date); fireStateChanged(); } } diff --git a/src/java.desktop/share/classes/javax/swing/SpinnerNumberModel.java b/src/java.desktop/share/classes/javax/swing/SpinnerNumberModel.java index d8db7b3ae0f..d2dd0a9d5f6 100644 --- a/src/java.desktop/share/classes/javax/swing/SpinnerNumberModel.java +++ b/src/java.desktop/share/classes/javax/swing/SpinnerNumberModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -452,11 +452,11 @@ public class SpinnerNumberModel extends AbstractSpinnerModel implements Serializ * @see SpinnerModel#addChangeListener */ public void setValue(Object value) { - if ((value == null) || !(value instanceof Number)) { + if (!(value instanceof Number number)) { throw new IllegalArgumentException("illegal value"); } - if (!value.equals(this.value)) { - this.value = (Number)value; + if (!number.equals(this.value)) { + this.value = number; fireStateChanged(); } } diff --git a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java index e15347ec06a..5e3965e69b8 100644 --- a/src/java.desktop/share/classes/javax/swing/SwingUtilities.java +++ b/src/java.desktop/share/classes/javax/swing/SwingUtilities.java @@ -2054,8 +2054,8 @@ public class SwingUtilities implements SwingConstants * ImageIcon, and the image it contains is the same as image. */ static boolean doesIconReferenceImage(Icon icon, Image image) { - Image iconImage = (icon != null && (icon instanceof ImageIcon)) ? - ((ImageIcon)icon).getImage() : null; + Image iconImage = (icon instanceof ImageIcon i) ? + i.getImage() : null; return (iconImage == image); } diff --git a/src/java.desktop/share/classes/javax/swing/TransferHandler.java b/src/java.desktop/share/classes/javax/swing/TransferHandler.java index b366a283ffa..f2622880e7f 100644 --- a/src/java.desktop/share/classes/javax/swing/TransferHandler.java +++ b/src/java.desktop/share/classes/javax/swing/TransferHandler.java @@ -1272,9 +1272,9 @@ public class TransferHandler implements Serializable { // If the Drop target is inactive the dragExit will not be dispatched to the dtListener, // so make sure that we clean up the dtListener anyway. DropTargetListener dtListener = getDropTargetListener(); - if (dtListener != null && dtListener instanceof DropHandler) { - ((DropHandler)dtListener).cleanup(false); - } + if (dtListener instanceof DropHandler dropHandler) { + dropHandler.cleanup(false); + } } } diff --git a/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java b/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java index 21dacb1d0df..1be0228864c 100644 --- a/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java +++ b/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java @@ -283,7 +283,7 @@ public class EventListenerList implements Serializable { for (int i = 0; i < lList.length; i+=2) { Class t = (Class)lList[i]; EventListener l = (EventListener)lList[i+1]; - if ((l!=null) && (l instanceof Serializable)) { + if (l instanceof Serializable) { s.writeObject(t.getName()); s.writeObject(l); } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java index c2fab408902..772ea16c44e 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java @@ -569,10 +569,7 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { if (cycleRoot != null) { FocusTraversalPolicy policy = cycleRoot.getFocusTraversalPolicy(); - if (policy != null && policy instanceof - SortingFocusTraversalPolicy) { - SortingFocusTraversalPolicy sPolicy = - (SortingFocusTraversalPolicy)policy; + if (policy instanceof SortingFocusTraversalPolicy sPolicy) { boolean idc = sPolicy.getImplicitDownCycleTraversal(); try { sPolicy.setImplicitDownCycleTraversal(false); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java index 603dd896fde..4e2e0fac305 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -578,9 +578,8 @@ public class BasicInternalFrameUI extends InternalFrameUI * @param c the new north pane */ public void setNorthPane(JComponent c) { - if (northPane != null && - northPane instanceof BasicInternalFrameTitlePane) { - ((BasicInternalFrameTitlePane)northPane).uninstallListeners(); + if (northPane instanceof BasicInternalFrameTitlePane tp) { + tp.uninstallListeners(); } replacePane(northPane, c); northPane = c; @@ -1614,9 +1613,8 @@ public class BasicInternalFrameUI extends InternalFrameUI // account the title pane since you are allowed to resize // the frames to the point where just the title pane is visible. Dimension result = new Dimension(); - if (getNorthPane() != null && - getNorthPane() instanceof BasicInternalFrameTitlePane) { - result = new Dimension(getNorthPane().getMinimumSize()); + if (getNorthPane() instanceof BasicInternalFrameTitlePane tp) { + result = new Dimension(tp.getMinimumSize()); } Insets i = frame.getInsets(); result.width += i.left + i.right; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 33699871a18..0d2b0fde15e 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -297,20 +297,20 @@ public class BasicMenuUI extends BasicMenuItemUI final MenuSelectionManager defaultManager = MenuSelectionManager.defaultManager(); if(force) { Container cnt = menu.getParent(); - if(cnt != null && cnt instanceof JMenuBar) { + if (cnt instanceof JMenuBar menuBar) { MenuElement[] me; MenuElement[] subElements; subElements = menu.getPopupMenu().getSubElements(); if(subElements.length > 0) { me = new MenuElement[4]; - me[0] = (MenuElement) cnt; + me[0] = menuBar; me[1] = menu; me[2] = menu.getPopupMenu(); me[3] = subElements[0]; } else { me = new MenuElement[3]; - me[0] = (MenuElement)cnt; + me[0] = menuBar; me[1] = menu; me[2] = menu.getPopupMenu(); } @@ -512,10 +512,10 @@ public class BasicMenuUI extends BasicMenuItemUI manager.clearSelectedPath(); } else { Container cnt = menu.getParent(); - if(cnt != null && cnt instanceof JMenuBar) { + if (cnt instanceof JMenuBar menuBar) { MenuElement[] me = new MenuElement[2]; - me[0]=(MenuElement)cnt; - me[1]=menu; + me[0] = menuBar; + me[1] = menu; manager.setSelectedPath(me); } } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 427823573a6..935e028783a 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -964,13 +964,10 @@ public class BasicOptionPaneUI extends OptionPaneUI { * the look and feel for based on the value in the inputComponent. */ protected void resetInputValue() { - if(inputComponent != null && (inputComponent instanceof JTextField)) { - optionPane.setInputValue(((JTextField)inputComponent).getText()); - - } else if(inputComponent != null && - (inputComponent instanceof JComboBox)) { - optionPane.setInputValue(((JComboBox)inputComponent) - .getSelectedItem()); + if (inputComponent instanceof JTextField textField) { + optionPane.setInputValue(textField.getText()); + } else if (inputComponent instanceof JComboBox comboBox) { + optionPane.setInputValue(comboBox.getSelectedItem()); } else if(inputComponent != null) { optionPane.setInputValue(((JList)inputComponent) .getSelectedValue()); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java index 71d0e4b6717..cc6c46318d7 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -197,8 +197,8 @@ public class BasicSpinnerUI extends SpinnerUI spinner.addChangeListener(getHandler()); } JComponent editor = spinner.getEditor(); - if (editor != null && editor instanceof JSpinner.DefaultEditor) { - JTextField tf = ((JSpinner.DefaultEditor)editor).getTextField(); + if (editor instanceof JSpinner.DefaultEditor defaultEditor) { + JTextField tf = defaultEditor.getTextField(); if (tf != null) { tf.addFocusListener(nextButtonHandler); tf.addFocusListener(previousButtonHandler); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index 24b2fa873f1..5fa79a7fa4d 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -344,7 +344,7 @@ public class BasicSplitPaneUI extends SplitPaneUI Border b = divider.getBorder(); - if (b == null || !(b instanceof UIResource)) { + if (!(b instanceof UIResource)) { divider.setBorder(UIManager.getBorder("SplitPaneDivider.border")); } @@ -2359,8 +2359,7 @@ public class BasicSplitPaneUI extends SplitPaneUI } private Component getFirstAvailableComponent(Component c) { - if (c!=null && c instanceof JSplitPane) { - JSplitPane sp = (JSplitPane)c; + if (c instanceof JSplitPane sp) { Component left = getFirstAvailableComponent(sp.getLeftComponent()); if (left != null) { c = left; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java index 721fcbda9b7..924458ad2fa 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -535,13 +535,11 @@ public class BasicTableHeaderUI extends TableHeaderUI { * to ensure that the newly selected column is visible. */ private void scrollToColumn(int col) { - Container container; JTable table; //Test whether the header is in a scroll pane and has a table. if ((header.getParent() == null) || - ((container = header.getParent().getParent()) == null) || - !(container instanceof JScrollPane) || + !(header.getParent().getParent() instanceof JScrollPane) || ((table = header.getTable()) == null)) { return; } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java index 2ee4f1fa26d..c4ec26c5632 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -933,24 +933,21 @@ public class BasicTableUI extends TableUI // the table, seems to have no effect. Component editorComp = table.getEditorComponent(); - if (table.isEditing() && editorComp != null) { - if (editorComp instanceof JComponent) { - JComponent component = (JComponent)editorComp; - map = component.getInputMap(JComponent.WHEN_FOCUSED); - Object binding = (map != null) ? map.get(keyStroke) : null; - if (binding == null) { - map = component.getInputMap(JComponent. - WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - binding = (map != null) ? map.get(keyStroke) : null; - } - if (binding != null) { - ActionMap am = component.getActionMap(); - Action action = (am != null) ? am.get(binding) : null; - if (action != null && SwingUtilities. + if (table.isEditing() && editorComp instanceof JComponent component) { + map = component.getInputMap(JComponent.WHEN_FOCUSED); + Object binding = (map != null) ? map.get(keyStroke) : null; + if (binding == null) { + map = component.getInputMap(JComponent. + WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + binding = (map != null) ? map.get(keyStroke) : null; + } + if (binding != null) { + ActionMap am = component.getActionMap(); + Action action = (am != null) ? am.get(binding) : null; + if (action != null && SwingUtilities. notifyAction(action, keyStroke, e, component, - e.getModifiers())) { - e.consume(); - } + e.getModifiers())) { + e.consume(); } } } @@ -1485,8 +1482,8 @@ public class BasicTableUI extends TableUI Container parent = SwingUtilities.getUnwrappedParent(table); // should be viewport if (parent != null) { parent = parent.getParent(); // should be the scrollpane - if (parent != null && parent instanceof JScrollPane) { - LookAndFeel.installBorder((JScrollPane)parent, "Table.scrollPaneBorder"); + if (parent instanceof JScrollPane scrollPane) { + LookAndFeel.installBorder(scrollPane, "Table.scrollPaneBorder"); } } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java index b6d4bc6412b..6e98a57e5c3 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java @@ -182,8 +182,7 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { String prefix = getPropertyPrefix(); Object o = DefaultLookup.get(editor, this, prefix + ".keyBindings"); - if ((o != null) && (o instanceof JTextComponent.KeyBinding[])) { - JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) o; + if (o instanceof JTextComponent.KeyBinding[] bindings) { JTextComponent.loadKeymap(map, bindings, getComponent().getActions()); } } @@ -536,8 +535,7 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { * should allow Tab to keyboard - accessibility */ EditorKit editorKit = getEditorKit(editor); - if ( editorKit != null - && editorKit instanceof DefaultEditorKit) { + if (editorKit instanceof DefaultEditorKit) { Set storedForwardTraversalKeys = editor. getFocusTraversalKeys(KeyboardFocusManager. FORWARD_TRAVERSAL_KEYS); @@ -617,9 +615,8 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { if (getEditorKit(editor) instanceof DefaultEditorKit) { if (map != null) { Object obj = map.get(DefaultEditorKit.insertBreakAction); - if (obj != null - && obj instanceof DefaultEditorKit.InsertBreakAction) { - Action action = new TextActionWrapper((TextAction)obj); + if (obj instanceof DefaultEditorKit.InsertBreakAction breakAction) { + Action action = new TextActionWrapper(breakAction); componentMap.put(action.getValue(Action.NAME),action); } } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java index a1d47aa4408..8a13bf119a5 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java @@ -654,8 +654,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants Container p; for(p = toolBar.getParent() ; p != null && !(p instanceof Window) ; p = p.getParent()); - if(p != null && p instanceof Window) - frame = (Window) p; + if (p instanceof Window window) + frame = window; } if(floatingToolBar == null) { floatingToolBar = createFloatingWindow(toolBar); diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 650048a9973..2626b1c9585 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -1131,10 +1131,8 @@ public class BasicTreeUI extends TreeUI * @return a default cell editor */ protected TreeCellEditor createDefaultCellEditor() { - if(currentCellRenderer != null && - (currentCellRenderer instanceof DefaultTreeCellRenderer)) { - DefaultTreeCellEditor editor = new DefaultTreeCellEditor - (tree, (DefaultTreeCellRenderer)currentCellRenderer); + if (currentCellRenderer instanceof DefaultTreeCellRenderer defaultRenderer) { + DefaultTreeCellEditor editor = new DefaultTreeCellEditor(tree, defaultRenderer); return editor; } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java index a17890806c3..997af4983a3 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java @@ -1142,8 +1142,8 @@ public class MetalFileChooserUI extends BasicFileChooserUI { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value != null && value instanceof FileFilter) { - setText(((FileFilter)value).getDescription()); + if (value instanceof FileFilter fileFilter) { + setText(fileFilter.getDescription()); } return this; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java index 29aacf365f1..707c438180d 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -147,8 +147,7 @@ public class SynthTextFieldUI extends BasicTextFieldUI implements SynthUI { Caret caret = comp.getCaret(); if (caret instanceof UIResource) { Object o = style.get(context, prefix + ".caretBlinkRate"); - if (o != null && o instanceof Integer) { - Integer rate = (Integer)o; + if (o instanceof Integer rate) { caret.setBlinkRate(rate.intValue()); } } diff --git a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java index d7cf0aa99f8..ce9ae2813e8 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthTreeUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -203,9 +203,8 @@ public class SynthTreeUI extends BasicTreeUI TreeCellRenderer renderer = tree.getCellRenderer(); DefaultTreeCellEditor editor; - if(renderer != null && (renderer instanceof DefaultTreeCellRenderer)) { - editor = new SynthTreeCellEditor(tree, (DefaultTreeCellRenderer) - renderer); + if (renderer instanceof DefaultTreeCellRenderer defaultRenderer) { + editor = new SynthTreeCellEditor(tree, defaultRenderer); } else { editor = new SynthTreeCellEditor(tree, null); diff --git a/src/java.desktop/share/classes/javax/swing/text/BoxView.java b/src/java.desktop/share/classes/javax/swing/text/BoxView.java index 1988adcad34..afaefacccf5 100644 --- a/src/java.desktop/share/classes/javax/swing/text/BoxView.java +++ b/src/java.desktop/share/classes/javax/swing/text/BoxView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -1150,9 +1150,9 @@ public class BoxView extends CompositeView { int index = getViewIndexAtPosition(testPos); if(index != -1) { View v = getView(index); - if(v != null && v instanceof CompositeView) { - return ((CompositeView)v).flipEastAndWestAtEnds(position, - bias); + if (v instanceof CompositeView compositeView) { + return compositeView.flipEastAndWestAtEnds(position, + bias); } } } diff --git a/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java b/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java index 721421f780c..f549f522ff2 100644 --- a/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java +++ b/src/java.desktop/share/classes/javax/swing/text/DefaultStyledDocument.java @@ -438,11 +438,11 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc */ public void setLogicalStyle(int pos, Style s) { Element paragraph = getParagraphElement(pos); - if ((paragraph != null) && (paragraph instanceof AbstractElement)) { + if (paragraph instanceof AbstractElement abstractElement) { try { writeLock(); - StyleChangeUndoableEdit edit = new StyleChangeUndoableEdit((AbstractElement)paragraph, s); - ((AbstractElement)paragraph).setResolveParent(s); + StyleChangeUndoableEdit edit = new StyleChangeUndoableEdit(abstractElement, s); + abstractElement.setResolveParent(s); int p0 = paragraph.getStartOffset(); int p1 = paragraph.getEndOffset(); DefaultDocumentEvent e = diff --git a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java index 69c7e39d703..cbdd308cc84 100644 --- a/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java +++ b/src/java.desktop/share/classes/javax/swing/text/JTextComponent.java @@ -3302,8 +3302,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A // Fixes bug 4487492 Document doc = JTextComponent.this.getDocument(); - if (doc != null && doc instanceof StyledDocument) { - StyledDocument sDoc = (StyledDocument)doc; + if (doc instanceof StyledDocument sDoc) { int offset = startIndex; int length = endIndex - startIndex; sDoc.setCharacterAttributes(offset, length, as, true); diff --git a/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java b/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java index a756cb2a02f..ba8465d4570 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/AccessibleHTML.java @@ -370,8 +370,8 @@ class AccessibleHTML implements Accessible { */ public Accessible getAccessibleChild(int i) { ElementInfo childInfo = elementInfo.getChild(i); - if (childInfo != null && childInfo instanceof Accessible) { - return (Accessible)childInfo; + if (childInfo instanceof Accessible accessibleChild) { + return accessibleChild; } else { return null; } @@ -1212,9 +1212,8 @@ class AccessibleHTML implements Accessible { private String getText(int offset, int length) throws BadLocationException { - if (model != null && model instanceof StyledDocument) { - StyledDocument doc = (StyledDocument)model; - return model.getText(offset, length); + if (model instanceof StyledDocument doc) { + return doc.getText(offset, length); } else { return null; } diff --git a/src/java.desktop/share/classes/javax/swing/text/html/CSS.java b/src/java.desktop/share/classes/javax/swing/text/html/CSS.java index 76ce4ac815f..22fa96b6153 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/CSS.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/CSS.java @@ -1608,8 +1608,8 @@ public class CSS implements Serializable { if (key instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag)key; Object o = htmlAttrSet.getAttribute(tag); - if (o != null && o instanceof AttributeSet) { - translateAttributes(tag, (AttributeSet)o, cssAttrSet); + if (o instanceof AttributeSet as) { + translateAttributes(tag, as, cssAttrSet); } } else if (key instanceof CSS.Attribute) { cssAttrSet.addAttribute(key, htmlAttrSet.getAttribute(key)); diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HRuleView.java b/src/java.desktop/share/classes/javax/swing/text/html/HRuleView.java index bacd81d271c..885f0b7f2c9 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HRuleView.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HRuleView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -72,16 +72,16 @@ class HRuleView extends View { noshade = (String)eAttr.getAttribute(HTML.Attribute.NOSHADE); Object value = eAttr.getAttribute(HTML.Attribute.SIZE); - if (value != null && (value instanceof String)) { + if (value instanceof String s) { try { - size = Integer.parseInt((String)value); + size = Integer.parseInt(s); } catch (NumberFormatException e) { size = 1; } } value = attr.getAttribute(CSS.Attribute.WIDTH); - if (value != null && (value instanceof CSS.LengthValue)) { - widthValue = (CSS.LengthValue)value; + if (value instanceof CSS.LengthValue lv) { + widthValue = lv; } topMargin = getLength(CSS.Attribute.MARGIN_TOP, attr); bottomMargin = getLength(CSS.Attribute.MARGIN_BOTTOM, attr); diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java index 00272bc1eaa..46d84e3cadc 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java @@ -901,8 +901,8 @@ public class HTMLDocument extends DefaultStyledDocument { if (name != null) { Object maps = getProperty(MAP_PROPERTY); - if (maps != null && (maps instanceof Hashtable)) { - return (Map)((Hashtable)maps).get(name); + if (maps instanceof Hashtable hashtable) { + return (Map) hashtable.get(name); } } return null; diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java index b6b0b789eef..8b674af6552 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java @@ -841,8 +841,8 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { Element elem, AttributeSet attr, int offset, int x, int y) { Object useMap = attr.getAttribute(HTML.Attribute.USEMAP); - if (useMap != null && (useMap instanceof String)) { - Map m = hdoc.getMap((String)useMap); + if (useMap instanceof String s) { + Map m = hdoc.getMap(s); if (m != null && offset < hdoc.getLength()) { Rectangle bounds; TextUI ui = html.getUI(); @@ -1467,12 +1467,8 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { Container container = getContainer(); - Container parentContainer; - if (container != null - && (container instanceof javax.swing.JEditorPane) - && (parentContainer = container.getParent()) != null - && (parentContainer instanceof javax.swing.JViewport)) { - JViewport viewPort = (JViewport)parentContainer; + if ((container instanceof JEditorPane) + && (container.getParent() instanceof JViewport viewPort)) { if (cachedViewPort != null) { JViewport cachedObject = cachedViewPort.get(); if (cachedObject != null) { @@ -2387,9 +2383,9 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { */ private void doObjectAction(JEditorPane editor, Element elem) { View view = getView(editor, elem); - if (view != null && view instanceof ObjectView) { - Component comp = ((ObjectView)view).getComponent(); - if (comp != null && comp instanceof Accessible) { + if (view instanceof ObjectView objectView) { + Component comp = objectView.getComponent(); + if (comp instanceof Accessible) { AccessibleContext ac = comp.getAccessibleContext(); if (ac != null) { AccessibleAction aa = ac.getAccessibleAction(); @@ -2473,10 +2469,9 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible { JEditorPane editor = (JEditorPane)c; Document d = editor.getDocument(); - if (d == null || !(d instanceof HTMLDocument)) { + if (!(d instanceof HTMLDocument doc)) { return; } - HTMLDocument doc = (HTMLDocument)d; ElementIterator ei = new ElementIterator(doc); int currentOffset = editor.getCaretPosition(); diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTMLWriter.java b/src/java.desktop/share/classes/javax/swing/text/html/HTMLWriter.java index a166235d4c2..c11214d71e3 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLWriter.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLWriter.java @@ -308,9 +308,7 @@ public class HTMLWriter extends AbstractWriter { // If an instance of an UNKNOWN Tag, or an instance of a // tag that is only visible during editing // - if (nameTag != null && endTag != null && - (endTag instanceof String) && - endTag.equals("true")) { + if (nameTag != null && "true".equals(endTag)) { outputEndTag = true; } @@ -732,8 +730,8 @@ public class HTMLWriter extends AbstractWriter { write('<'); write(tag.toString()); Object o = attr.getAttribute(tag); - if (o != null && o instanceof AttributeSet) { - writeAttributes((AttributeSet)o); + if (o instanceof AttributeSet as) { + writeAttributes(as); } write('>'); tags.addElement(tag); @@ -813,8 +811,8 @@ public class HTMLWriter extends AbstractWriter { write('<'); write(t.toString()); Object o = tagValues.elementAt(i); - if (o != null && o instanceof AttributeSet) { - writeAttributes((AttributeSet)o); + if (o instanceof AttributeSet as) { + writeAttributes(as); } write('>'); } diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HiddenTagView.java b/src/java.desktop/share/classes/javax/swing/text/html/HiddenTagView.java index 325bec6b8d6..25406848bf7 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HiddenTagView.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HiddenTagView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -271,8 +271,7 @@ class HiddenTagView extends EditableView implements DocumentListener { AttributeSet as = getElement().getAttributes(); if (as != null) { Object end = as.getAttribute(HTML.Attribute.ENDTAG); - if (end != null && (end instanceof String) && - ((String)end).equals("true")) { + if ("true".equals(end)) { return true; } } diff --git a/src/java.desktop/share/classes/javax/swing/text/html/Map.java b/src/java.desktop/share/classes/javax/swing/text/html/Map.java index cc79b5aeb3b..c88d4e7495b 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/Map.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/Map.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -181,12 +181,11 @@ class Map implements Serializable { * from trying to parse one of the numbers null is returned. */ protected static int[] extractCoords(Object stringCoords) { - if (stringCoords == null || !(stringCoords instanceof String)) { + if (!(stringCoords instanceof String s)) { return null; } - StringTokenizer st = new StringTokenizer((String)stringCoords, - ", \t\n\r"); + StringTokenizer st = new StringTokenizer(s, ", \t\n\r"); int[] retValue = null; int numCoords = 0; diff --git a/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java b/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java index 3352e0e79f8..9fb2ff25d63 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java @@ -2211,10 +2211,9 @@ public class StyleSheet extends StyleContext { retIndex--; } else if (as.isDefined(HTML.Attribute.VALUE)) { Object value = as.getAttribute(HTML.Attribute.VALUE); - if (value != null && - (value instanceof String)) { + if (value instanceof String s) { try { - int iValue = Integer.parseInt((String)value); + int iValue = Integer.parseInt(s); return retIndex - counter + iValue; } catch (NumberFormatException nfe) {} @@ -2744,8 +2743,7 @@ public class StyleSheet extends StyleContext { kind of conditional behaviour in the stylesheet. **/ - if (o != null && o instanceof AttributeSet) { - AttributeSet attr = (AttributeSet)o; + if (o instanceof AttributeSet attr) { if (attr.getAttribute(HTML.Attribute.HREF) == null) { continue; } diff --git a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java index 46a7ce7efb9..82ee2fffb0b 100644 --- a/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java +++ b/src/java.desktop/share/classes/javax/swing/text/rtf/RTFGenerator.java @@ -391,7 +391,7 @@ public void writeRTFHeader() updateCharacterAttributes(goat, style, false); basis = style.getResolveParent(); - if (basis != null && basis instanceof Style) { + if (basis instanceof Style) { Integer basedOn = styleTable.get(basis); if (basedOn != null) { writeControlWord("sbasedon", basedOn.intValue()); diff --git a/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java b/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java index 0b8b6679ded..7735895502e 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java +++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultMutableTreeNode.java @@ -1297,8 +1297,8 @@ public class DefaultMutableTreeNode implements Cloneable, Object[] tValues; s.defaultWriteObject(); - // Save the userObject, if its Serializable. - if(userObject != null && userObject instanceof Serializable) { + // Save the userObject, if it's Serializable. + if (userObject instanceof Serializable) { tValues = new Object[2]; tValues[0] = "userObject"; tValues[1] = userObject; diff --git a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeModel.java b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeModel.java index 6bc14783098..6d2a692c043 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeModel.java +++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeModel.java @@ -690,8 +690,8 @@ public class DefaultTreeModel implements Serializable, TreeModel { Vector values = new Vector(); s.defaultWriteObject(); - // Save the root, if its Serializable. - if(root != null && root instanceof Serializable) { + // Save the root, if it's Serializable. + if (root instanceof Serializable) { values.addElement("root"); values.addElement(root); } diff --git a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java index 2c592f24d2b..e1bdc4fc94b 100644 --- a/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java +++ b/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java @@ -1217,7 +1217,7 @@ public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeS s.defaultWriteObject(); // Save the rowMapper, if it implements Serializable - if(rowMapper != null && rowMapper instanceof Serializable) { + if (rowMapper instanceof Serializable) { tValues = new Object[2]; tValues[0] = "rowMapper"; tValues[1] = rowMapper; diff --git a/src/java.desktop/share/classes/sun/awt/im/InputContext.java b/src/java.desktop/share/classes/sun/awt/im/InputContext.java index 3ca1f6cedb9..c35d17bfae3 100644 --- a/src/java.desktop/share/classes/sun/awt/im/InputContext.java +++ b/src/java.desktop/share/classes/sun/awt/im/InputContext.java @@ -790,8 +790,8 @@ public class InputContext extends java.awt.im.InputContext */ public void disableNativeIM() { InputMethod inputMethod = getInputMethod(); - if (inputMethod != null && inputMethod instanceof InputMethodAdapter) { - ((InputMethodAdapter)inputMethod).stopListening(); + if (inputMethod instanceof InputMethodAdapter adapter) { + adapter.stopListening(); } } diff --git a/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java b/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java index dd0d43bcf46..0c375a900a0 100644 --- a/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java +++ b/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java @@ -181,9 +181,7 @@ public abstract class ShellFolder extends File { * @see #compareTo(Object) */ public int compareTo(File file2) { - if (file2 == null || !(file2 instanceof ShellFolder) - || ((file2 instanceof ShellFolder) && ((ShellFolder)file2).isFileSystem())) { - + if (!(file2 instanceof ShellFolder sf) || sf.isFileSystem()) { if (isFileSystem()) { return super.compareTo(file2); } else { diff --git a/src/java.desktop/share/classes/sun/font/AttributeValues.java b/src/java.desktop/share/classes/sun/font/AttributeValues.java index 910195a2a9e..6b3c0aaf4e2 100644 --- a/src/java.desktop/share/classes/sun/font/AttributeValues.java +++ b/src/java.desktop/share/classes/sun/font/AttributeValues.java @@ -764,8 +764,8 @@ public final class AttributeValues implements Cloneable { return ((AttributeMap)map).getValues().justification; } Object obj = map.get(TextAttribute.JUSTIFICATION); - if (obj != null && obj instanceof Number) { - return max(0, min(1, ((Number)obj).floatValue())); + if (obj instanceof Number number) { + return max(0, min(1, number.floatValue())); } } return DEFAULT.justification; @@ -778,8 +778,8 @@ public final class AttributeValues implements Cloneable { return ((AttributeMap)map).getValues().numericShaping; } Object obj = map.get(TextAttribute.NUMERIC_SHAPING); - if (obj != null && obj instanceof NumericShaper) { - return (NumericShaper)obj; + if (obj instanceof NumericShaper shaper) { + return shaper; } } return DEFAULT.numericShaping; diff --git a/src/java.desktop/share/classes/sun/font/FontUtilities.java b/src/java.desktop/share/classes/sun/font/FontUtilities.java index 550cdcce3cf..c4f8c317a92 100644 --- a/src/java.desktop/share/classes/sun/font/FontUtilities.java +++ b/src/java.desktop/share/classes/sun/font/FontUtilities.java @@ -413,10 +413,9 @@ public final class FontUtilities { FontManager fm = FontManagerFactory.getInstance(); Font2D dialog = fm.findFont2D("dialog", font.getStyle(), FontManager.NO_FALLBACK); // Should never be null, but MACOSX fonts are not CompositeFonts - if (dialog == null || !(dialog instanceof CompositeFont)) { + if (!(dialog instanceof CompositeFont dialog2D)) { return fuir; } - CompositeFont dialog2D = (CompositeFont)dialog; PhysicalFont physicalFont = (PhysicalFont)font2D; ConcurrentHashMap compMap = compMapRef.get(); if (compMap == null) { // Its been collected. diff --git a/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java b/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java index d2215229405..62a28e05052 100644 --- a/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java +++ b/src/java.desktop/share/classes/sun/print/PSStreamPrintService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -320,8 +320,7 @@ public class PSStreamPrintService extends StreamPrintService MediaSize mediaSize = (MediaSize)attributes.get(MediaSize.class); if (mediaSize == null) { Media media = (Media)attributes.get(Media.class); - if (media != null && media instanceof MediaSizeName) { - MediaSizeName msn = (MediaSizeName)media; + if (media instanceof MediaSizeName msn) { mediaSize = MediaSize.getMediaSizeForName(msn); } } diff --git a/src/java.desktop/share/classes/sun/print/PathGraphics.java b/src/java.desktop/share/classes/sun/print/PathGraphics.java index 1fbd7fa68d6..2235f82aab5 100644 --- a/src/java.desktop/share/classes/sun/print/PathGraphics.java +++ b/src/java.desktop/share/classes/sun/print/PathGraphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -895,8 +895,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { */ Map map = font.getAttributes(); Object o = map.get(TextAttribute.TRACKING); - boolean tracking = o != null && (o instanceof Number) && - (((Number)o).floatValue() != 0f); + boolean tracking = (o instanceof Number n) && + (n.floatValue() != 0f); if (tracking) { noPositionAdjustments = false; diff --git a/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/src/java.desktop/share/classes/sun/print/PrintJob2D.java index 3ad1c488567..323cb0cc84e 100644 --- a/src/java.desktop/share/classes/sun/print/PrintJob2D.java +++ b/src/java.desktop/share/classes/sun/print/PrintJob2D.java @@ -450,8 +450,8 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { Media media = (Media)attributes.get(Media.class); MediaSize mediaSize = null; - if (media != null && media instanceof MediaSizeName) { - mediaSize = MediaSize.getMediaSizeForName((MediaSizeName)media); + if (media instanceof MediaSizeName msn) { + mediaSize = MediaSize.getMediaSizeForName(msn); } Paper p = pageFormat.getPaper(); @@ -590,9 +590,9 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { pageAttributes.setPrintQuality(PrintQualityType.NORMAL); } - Media msn = (Media)attributes.get(Media.class); - if (msn != null && msn instanceof MediaSizeName) { - MediaType mType = unMapMedia((MediaSizeName)msn); + Media media = (Media)attributes.get(Media.class); + if (media instanceof MediaSizeName msn) { + MediaType mType = unMapMedia(msn); if (mType != null) { pageAttributes.setMedia(mType); diff --git a/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/src/java.desktop/share/classes/sun/print/ServiceDialog.java index 8db53d2d376..7167ba1884f 100644 --- a/src/java.desktop/share/classes/sun/print/ServiceDialog.java +++ b/src/java.desktop/share/classes/sun/print/ServiceDialog.java @@ -1613,11 +1613,10 @@ public class ServiceDialog extends JDialog implements ActionListener { MediaSize mediaSize = null; Media media = (Media)asCurrent.get(Media.class); - if (media == null || !(media instanceof MediaSizeName)) { + if (!(media instanceof MediaSizeName)) { media = (Media)psCurrent.getDefaultAttributeValue(Media.class); } - if (media != null && (media instanceof MediaSizeName)) { - MediaSizeName msn = (MediaSizeName)media; + if (media instanceof MediaSizeName msn) { mediaSize = MediaSize.getMediaSizeForName(msn); } if (mediaSize == null) { @@ -1699,11 +1698,10 @@ public class ServiceDialog extends JDialog implements ActionListener { MediaSize mediaSize = null; Media media = (Media)asCurrent.get(Media.class); - if (media == null || !(media instanceof MediaSizeName)) { + if (!(media instanceof MediaSizeName)) { media = (Media)psCurrent.getDefaultAttributeValue(Media.class); } - if (media != null && (media instanceof MediaSizeName)) { - MediaSizeName msn = (MediaSizeName)media; + if (media instanceof MediaSizeName msn) { mediaSize = MediaSize.getMediaSizeForName(msn); } if (mediaSize == null) { diff --git a/src/java.desktop/share/classes/sun/swing/DefaultLookup.java b/src/java.desktop/share/classes/sun/swing/DefaultLookup.java index 51949f2c626..cf3919d9d97 100644 --- a/src/java.desktop/share/classes/sun/swing/DefaultLookup.java +++ b/src/java.desktop/share/classes/sun/swing/DefaultLookup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -132,10 +132,10 @@ public class DefaultLookup { int defaultValue) { Object iValue = get(c, ui, key); - if (iValue == null || !(iValue instanceof Number)) { - return defaultValue; + if (iValue instanceof Number number) { + return number.intValue(); } - return ((Number)iValue).intValue(); + return defaultValue; } public static int getInt(JComponent c, ComponentUI ui, String key) { @@ -146,10 +146,10 @@ public class DefaultLookup { Insets defaultValue) { Object iValue = get(c, ui, key); - if (iValue == null || !(iValue instanceof Insets)) { - return defaultValue; + if (iValue instanceof Insets insets) { + return insets; } - return (Insets)iValue; + return defaultValue; } public static Insets getInsets(JComponent c, ComponentUI ui, String key) { @@ -160,10 +160,10 @@ public class DefaultLookup { boolean defaultValue) { Object iValue = get(c, ui, key); - if (iValue == null || !(iValue instanceof Boolean)) { - return defaultValue; + if (iValue instanceof Boolean b) { + return b; } - return ((Boolean)iValue).booleanValue(); + return defaultValue; } public static boolean getBoolean(JComponent c, ComponentUI ui, String key) { @@ -174,10 +174,10 @@ public class DefaultLookup { Color defaultValue) { Object iValue = get(c, ui, key); - if (iValue == null || !(iValue instanceof Color)) { - return defaultValue; + if (iValue instanceof Color color) { + return color; } - return (Color)iValue; + return defaultValue; } public static Color getColor(JComponent c, ComponentUI ui, String key) { @@ -187,10 +187,10 @@ public class DefaultLookup { public static Icon getIcon(JComponent c, ComponentUI ui, String key, Icon defaultValue) { Object iValue = get(c, ui, key); - if (iValue == null || !(iValue instanceof Icon)) { - return defaultValue; + if (iValue instanceof Icon icon) { + return icon; } - return (Icon)iValue; + return defaultValue; } public static Icon getIcon(JComponent c, ComponentUI ui, String key) { @@ -200,10 +200,10 @@ public class DefaultLookup { public static Border getBorder(JComponent c, ComponentUI ui, String key, Border defaultValue) { Object iValue = get(c, ui, key); - if (iValue == null || !(iValue instanceof Border)) { - return defaultValue; + if (iValue instanceof Border border) { + return border; } - return (Border)iValue; + return defaultValue; } public static Border getBorder(JComponent c, ComponentUI ui, String key) { diff --git a/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java b/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java index ff2898d0f72..6859fb0bab5 100644 --- a/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java +++ b/src/java.desktop/share/classes/sun/swing/MenuItemLayoutHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -378,10 +378,10 @@ public class MenuItemLayoutHelper { if (miParent != null) { value = miParent.getClientProperty(propertyName); } - if ((value == null) || !(value instanceof Integer)) { - value = 0; + if (value instanceof Integer intValue) { + return intValue; } - return (Integer) value; + return 0; } public static boolean isColumnLayout(boolean isLeftToRight, diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java index 8297bf738f8..1f4b0a4d5c8 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -1365,8 +1365,8 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget if (graphicsConfig != null) { oldVisual = graphicsConfig.getVisual(); } - if (gc != null && gc instanceof X11GraphicsConfig) { - newVisual = ((X11GraphicsConfig)gc).getVisual(); + if (gc instanceof X11GraphicsConfig x11Config) { + newVisual = x11Config.getVisual(); } // If the new visual differs from the old one, the peer must be diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java index fe2f5ffb7e4..4317136816c 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XEmbedCanvasPeer.java @@ -567,8 +567,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener // Find the top-level and see if it is XEmbed client. If so, ask him to // register the accelerator XWindowPeer parent = getToplevelXWindow(); - if (parent != null && parent instanceof XEmbeddedFramePeer) { - XEmbeddedFramePeer embedded = (XEmbeddedFramePeer)parent; + if (parent instanceof XEmbeddedFramePeer embedded) { embedded.registerAccelerator(stroke); } } @@ -577,8 +576,7 @@ public class XEmbedCanvasPeer extends XCanvasPeer implements WindowFocusListener // Find the top-level and see if it is XEmbed client. If so, ask him to // register the accelerator XWindowPeer parent = getToplevelXWindow(); - if (parent != null && parent instanceof XEmbeddedFramePeer) { - XEmbeddedFramePeer embedded = (XEmbeddedFramePeer)parent; + if (parent instanceof XEmbeddedFramePeer embedded) { embedded.unregisterAccelerator(stroke); } } diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java index b047e688f79..8d2ba131cb7 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -303,15 +303,13 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { Component temp = target.getParent(); final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); ComponentPeer peer = acc.getPeer(temp); - while (!(peer instanceof XWindow)) + while (!(peer instanceof XWindow window)) { temp = temp.getParent(); peer = acc.getPeer(temp); } - if (peer != null && peer instanceof XWindow) - return ((XWindow)peer).getContentWindow(); - else return 0; + return window.getContentWindow(); } @@ -327,8 +325,8 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { temp = temp.getParent(); peer = acc.getPeer(temp); } - if (peer != null && peer instanceof XWindow) - return (XWindow) peer; + if (peer instanceof XWindow xWindow) + return xWindow; else return null; } @@ -927,9 +925,7 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { long childWnd = xce.get_subwindow(); if (childWnd != XConstants.None) { XBaseWindow child = XToolkit.windowToXWindow(childWnd); - if (child != null && child instanceof XWindow && - !child.isEventDisabled(xev)) - { + if (child instanceof XWindow && !child.isEventDisabled(xev)) { return; } } @@ -1438,20 +1434,19 @@ class XWindow extends XBaseWindow implements X11ComponentPeer { XToolkit.awtLock(); try { Object wpeer = XToolkit.targetToPeer(comp); - if (wpeer == null - || !(wpeer instanceof XDecoratedPeer) - || ((XDecoratedPeer)wpeer).configure_seen) + if (!(wpeer instanceof XDecoratedPeer xDecoratedPeer) + || xDecoratedPeer.configure_seen) { return toGlobal(0, 0); } // wpeer is an XDecoratedPeer not yet fully adopted by WM Point pt = toOtherWindow(getContentWindow(), - ((XDecoratedPeer)wpeer).getContentWindow(), + xDecoratedPeer.getContentWindow(), 0, 0); if (pt == null) { - pt = new Point(((XBaseWindow)wpeer).getAbsoluteX(), ((XBaseWindow)wpeer).getAbsoluteY()); + pt = new Point(xDecoratedPeer.getAbsoluteX(), xDecoratedPeer.getAbsoluteY()); } pt.x += comp.getX(); pt.y += comp.getY(); diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java index 3a79e785be6..94a1dfd5196 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java +++ b/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java @@ -416,10 +416,10 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); for (int i = 0; i < cnt; i++) { final ComponentPeer childPeer = acc.getPeer(children[i]); - if (childPeer != null && childPeer instanceof XWindowPeer) { - if (((XWindowPeer)childPeer).winAttr.iconsInherited) { - ((XWindowPeer)childPeer).winAttr.icons = icons; - ((XWindowPeer)childPeer).recursivelySetIcon(icons); + if (childPeer instanceof XWindowPeer xWindowPeer) { + if (xWindowPeer.winAttr.iconsInherited) { + xWindowPeer.winAttr.icons = icons; + xWindowPeer.recursivelySetIcon(icons); } } } diff --git a/src/java.desktop/unix/classes/sun/java2d/xr/XRSurfaceData.java b/src/java.desktop/unix/classes/sun/java2d/xr/XRSurfaceData.java index 1b12b54b8f8..4d4a04af937 100644 --- a/src/java.desktop/unix/classes/sun/java2d/xr/XRSurfaceData.java +++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRSurfaceData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2021, 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 @@ -207,9 +207,8 @@ public abstract class XRSurfaceData extends XSurfaceData { protected MaskFill getMaskFill(SunGraphics2D sg2d) { AlphaComposite aComp = null; - if(sg2d.composite != null - && sg2d.composite instanceof AlphaComposite) { - aComp = (AlphaComposite) sg2d.composite; + if (sg2d.composite instanceof AlphaComposite alphaComposite) { + aComp = alphaComposite; } boolean supportedPaint = sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR diff --git a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java index af890126efb..82cb84a1455 100644 --- a/src/java.desktop/unix/classes/sun/print/IPPPrintService.java +++ b/src/java.desktop/unix/classes/sun/print/IPPPrintService.java @@ -671,8 +671,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService { int match = -1; Media media = (Media)attributes.get(Media.class); - if (media != null && media instanceof MediaSizeName) { - MediaSizeName msn = (MediaSizeName)media; + if (media instanceof MediaSizeName msn) { // case when no supported mediasizenames are reported // check given media against the default diff --git a/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java b/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java index 2184e8a3fcf..eefef8a5353 100644 --- a/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java +++ b/src/java.desktop/unix/classes/sun/print/UnixPrintJob.java @@ -366,8 +366,7 @@ public class UnixPrintJob implements CancelablePrintJob { } } - if (customTray != null && - customTray instanceof CustomMediaTray) { + if (customTray != null) { String choice = customTray.getChoiceName(); if (choice != null) { mOptions += " InputSlot="+choice; diff --git a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java index 21cc715b494..92980c52a00 100644 --- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java +++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java @@ -1221,8 +1221,8 @@ public class WindowsFileChooserUI extends BasicFileChooserUI { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value != null && value instanceof FileFilter) { - setText(((FileFilter)value).getDescription()); + if (value instanceof FileFilter fileFilter) { + setText(fileFilter.getDescription()); } return this; diff --git a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java index f08f5337e2e..1564804cf84 100644 --- a/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java +++ b/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java @@ -540,14 +540,13 @@ final class Win32ShellFolder2 extends ShellFolder { * Check to see if two ShellFolder objects are the same */ public boolean equals(Object o) { - if (o == null || !(o instanceof Win32ShellFolder2)) { + if (!(o instanceof Win32ShellFolder2 rhs)) { // Short-circuit circuitous delegation path if (!(o instanceof File)) { return super.equals(o); } return pathsEqual(getPath(), ((File) o).getPath()); } - Win32ShellFolder2 rhs = (Win32ShellFolder2) o; if ((parent == null && rhs.parent != null) || (parent != null && rhs.parent == null)) { return false; diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java b/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java index e9c9c709adb..028cb36c2fc 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java @@ -731,8 +731,7 @@ public final class WPrinterJob extends RasterPrinterJob */ if (attr.getCategory() == SunAlternateMedia.class) { Media media = (Media)attributes.get(Media.class); - if (media == null || - !(media instanceof MediaTray)) { + if (!(media instanceof MediaTray)) { attr = ((SunAlternateMedia)attr).getMedia(); } } -- GitLab From ba2a8e5a496799451095362279b9dd4b6df20b67 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Fri, 3 Dec 2021 13:20:08 +0000 Subject: [PATCH 593/890] 8278205: jlink plugins should dump .class file in debug mode Reviewed-by: jlaskey --- .../jdk/tools/jlink/internal/JlinkTask.java | 2 +- .../internal/plugins/AbstractPlugin.java | 35 +++++++++++++++++++ .../plugins/IncludeLocalesPlugin.java | 2 +- .../StripJavaDebugAttributesPlugin.java | 2 +- .../internal/plugins/VersionPropsPlugin.java | 6 ++-- 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java index d90e4cf38e4..835294d26de 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java @@ -78,7 +78,7 @@ import jdk.internal.module.ModuleResolution; * ## Should use jdk.joptsimple some day. */ public class JlinkTask { - static final boolean DEBUG = Boolean.getBoolean("jlink.debug"); + public static final boolean DEBUG = Boolean.getBoolean("jlink.debug"); // jlink API ignores by default. Remove when signing is implemented. static final boolean IGNORE_SIGNING_DEFAULT = true; diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/AbstractPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/AbstractPlugin.java index fd4fdcd39dd..758cb17e83e 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/AbstractPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/AbstractPlugin.java @@ -26,10 +26,16 @@ package jdk.tools.jlink.internal.plugins; import jdk.tools.jlink.plugin.Plugin; +import jdk.tools.jlink.internal.JlinkTask; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +import jdk.internal.org.objectweb.asm.ClassReader; public abstract class AbstractPlugin implements Plugin { @@ -61,6 +67,35 @@ public abstract class AbstractPlugin implements Plugin { this.name = name; this.pluginsBundle = bundle; } + + private void dumpClassFile(String path, byte[] buf) { + try { + String fullPath = String.format("%d-%s%s%s", + ProcessHandle.current().pid(), + getName(), File.separator, + path.replace('/', File.separatorChar)); + System.err.printf("Dumping class file %s\n", fullPath); + new File(fullPath.substring(0, fullPath.lastIndexOf('/'))).mkdirs(); + Files.write(Paths.get(fullPath), buf); + } catch (IOException ioExp) { + System.err.println("writing " + path + " failed"); + ioExp.printStackTrace(); + } + } + + protected ClassReader newClassReader(String path, byte[] buf) { + try { + return new ClassReader(buf); + } catch (IllegalArgumentException iae) { + if (JlinkTask.DEBUG) { + System.err.printf("Failed to parse class file: %s\n", path); + iae.printStackTrace(); + dumpClassFile(path, buf); + } + throw iae; + } + } + @Override public String getName() { return name; diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java index 17062af55f3..623b7f2917b 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java @@ -158,7 +158,7 @@ public final class IncludeLocalesPlugin extends AbstractPlugin implements Resour if (resource != null && resource.type().equals(ResourcePoolEntry.Type.CLASS_OR_RESOURCE)) { byte[] bytes = resource.contentBytes(); - ClassReader cr = new ClassReader(bytes); + ClassReader cr = newClassReader(path, bytes); if (Arrays.stream(cr.getInterfaces()) .anyMatch(i -> i.contains(METAINFONAME)) && stripUnsupportedLocales(bytes, cr)) { diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java index c7c39799921..8e212f649c8 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java @@ -59,7 +59,7 @@ public final class StripJavaDebugAttributesPlugin extends AbstractPlugin { if (path.endsWith("module-info.class")) { // XXX. Do we have debug info? Is Asm ready for module-info? } else { - ClassReader reader = new ClassReader(resource.contentBytes()); + ClassReader reader = newClassReader(path, resource.contentBytes()); ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); reader.accept(writer, ClassReader.SKIP_DEBUG); byte[] content = writer.toByteArray(); diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java index 8c1c8374faf..af241efcea7 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/VersionPropsPlugin.java @@ -96,9 +96,9 @@ abstract class VersionPropsPlugin extends AbstractPlugin { private boolean redefined = false; - private byte[] redefine(byte[] classFile) { + private byte[] redefine(String path, byte[] classFile) { - var cr = new ClassReader(classFile); + var cr = newClassReader(path, classFile); var cw = new ClassWriter(0); cr.accept(new ClassVisitor(Opcodes.ASM7, cw) { @@ -189,7 +189,7 @@ abstract class VersionPropsPlugin extends AbstractPlugin { in.transformAndCopy(res -> { if (res.type().equals(ResourcePoolEntry.Type.CLASS_OR_RESOURCE)) { if (res.path().equals(VERSION_PROPS_CLASS)) { - return res.copyWithContent(redefine(res.contentBytes())); + return res.copyWithContent(redefine(res.path(), res.contentBytes())); } } return res; -- GitLab From 3f28a21414be32375dc0f4b12d349826bacd4810 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Fri, 3 Dec 2021 13:23:36 +0000 Subject: [PATCH 594/890] 8278144: Javadoc for MemorySegment::set/MemorySegment::setAtIndex is missing throws tag Reviewed-by: sundar --- .../jdk/incubator/foreign/MemorySegment.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java index 49b393df241..cd0f1181863 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java @@ -651,6 +651,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * @throws IllegalArgumentException if the size of the native string is greater than the largest string supported by the platform. * @throws IllegalStateException if the size of the native string is greater than the size of this segment, * or if the scope associated with this segment has been closed, or if access occurs from a thread other than the thread owning that scope. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ default void setUtf8String(long offset, String str) { Utils.toCString(str.getBytes(StandardCharsets.UTF_8), SegmentAllocator.prefixAllocator(asSlice(offset))); @@ -1052,6 +1053,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfByte layout, long offset, byte value) { @@ -1086,6 +1088,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfBoolean layout, long offset, boolean value) { @@ -1120,6 +1123,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfChar layout, long offset, char value) { @@ -1154,6 +1158,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfShort layout, long offset, short value) { @@ -1188,6 +1193,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfInt layout, long offset, int value) { @@ -1222,6 +1228,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfFloat layout, long offset, float value) { @@ -1256,6 +1263,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfLong layout, long offset, long value) { @@ -1290,6 +1298,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfDouble layout, long offset, double value) { @@ -1324,6 +1333,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void set(ValueLayout.OfAddress layout, long offset, Addressable value) { @@ -1358,6 +1368,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfChar layout, long index, char value) { @@ -1392,6 +1403,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfShort layout, long index, short value) { @@ -1426,6 +1438,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfInt layout, long index, int value) { @@ -1460,6 +1473,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfFloat layout, long index, float value) { @@ -1494,6 +1508,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfLong layout, long index, long value) { @@ -1528,6 +1543,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfDouble layout, long index, double value) { @@ -1562,6 +1578,7 @@ for (long l = 0; l < segment.byteSize(); l++) { * a thread other than the thread owning that scope. * @throws IndexOutOfBoundsException when the dereference operation falls outside the spatial bounds of the * memory segment. + * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}. */ @ForceInline default void setAtIndex(ValueLayout.OfAddress layout, long index, Addressable value) { -- GitLab From f7237793ffa3a5a804fea49f165c8b9f1935cfac Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Fri, 3 Dec 2021 13:31:06 +0000 Subject: [PATCH 595/890] 8278079: C2: expand_dtrace_alloc_probe doesn't take effect in macro.cpp Reviewed-by: thartmann, kvn, chagedorn --- src/hotspot/share/opto/macro.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp index 1205d2007d7..a4bdcecb12a 100644 --- a/src/hotspot/share/opto/macro.cpp +++ b/src/hotspot/share/opto/macro.cpp @@ -1242,8 +1242,7 @@ void PhaseMacroExpand::expand_allocate_common( initial_slow_test = BoolNode::make_predicate(initial_slow_test, &_igvn); } - if (C->env()->dtrace_alloc_probes() || - (!UseTLAB && !Universe::heap()->supports_inline_contig_alloc())) { + if (!UseTLAB && !Universe::heap()->supports_inline_contig_alloc()) { // Force slow-path allocation expand_fast_path = false; initial_slow_test = NULL; @@ -1631,7 +1630,7 @@ void PhaseMacroExpand::expand_initialize_membar(AllocateNode* alloc, InitializeN void PhaseMacroExpand::expand_dtrace_alloc_probe(AllocateNode* alloc, Node* oop, Node*& ctrl, Node*& rawmem) { - if (C->env()->dtrace_extended_probes()) { + if (C->env()->dtrace_alloc_probes()) { // Slow-path call int size = TypeFunc::Parms + 2; CallLeafNode *call = new CallLeafNode(OptoRuntime::dtrace_object_alloc_Type(), @@ -1648,7 +1647,7 @@ void PhaseMacroExpand::expand_dtrace_alloc_probe(AllocateNode* alloc, Node* oop, call->init_req(TypeFunc::Parms + 1, oop); call->init_req(TypeFunc::Control, ctrl); call->init_req(TypeFunc::I_O , top()); // does no i/o - call->init_req(TypeFunc::Memory , ctrl); + call->init_req(TypeFunc::Memory , rawmem); call->init_req(TypeFunc::ReturnAdr, alloc->in(TypeFunc::ReturnAdr)); call->init_req(TypeFunc::FramePtr, alloc->in(TypeFunc::FramePtr)); transform_later(call); -- GitLab From 53a4342783d94cead4d26e5b29d286421b9432c3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 3 Dec 2021 15:42:18 +0000 Subject: [PATCH 596/890] 8278137: JFR: PrettyWriter uses incorrect year specifier Reviewed-by: egahlin --- .../share/classes/jdk/jfr/internal/tool/PrettyWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java index 32178df920c..c13bdb2ae27 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java @@ -59,7 +59,7 @@ import jdk.jfr.internal.Utils; */ public final class PrettyWriter extends EventPrintWriter { private static final String TYPE_OLD_OBJECT = Type.TYPES_PREFIX + "OldObject"; - private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HH:mm:ss.SSS (YYYY-MM-dd)"); + private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HH:mm:ss.SSS (yyyy-MM-dd)"); private static final Long ZERO = 0L; private boolean showIds; private RecordedEvent currentEvent; -- GitLab From 0e7b6bcd8260293c3d39417f04b9b1e4409aa20a Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Fri, 3 Dec 2021 15:43:51 +0000 Subject: [PATCH 597/890] 8278141: LIR_OpLoadKlass::_info shadows the field of the same name from LIR_Op Reviewed-by: thartmann, rkennke --- src/hotspot/share/c1/c1_LIR.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp index d5eb62aab1f..c4504b7b8b5 100644 --- a/src/hotspot/share/c1/c1_LIR.hpp +++ b/src/hotspot/share/c1/c1_LIR.hpp @@ -1828,15 +1828,13 @@ class LIR_OpLoadKlass: public LIR_Op { private: LIR_Opr _obj; - CodeEmitInfo* _info; public: LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info) - : LIR_Op(lir_load_klass, result, NULL) + : LIR_Op(lir_load_klass, result, info) , _obj(obj) - , _info(info) {} + {} LIR_Opr obj() const { return _obj; } - CodeEmitInfo* info() const { return _info; } virtual LIR_OpLoadKlass* as_OpLoadKlass() { return this; } virtual void emit_code(LIR_Assembler* masm); -- GitLab From 0d938cedcaf55886058b94dc280a8f7181c79fdf Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 3 Dec 2021 16:00:27 +0000 Subject: [PATCH 598/890] 8278172: java/nio/channels/FileChannel/BlockDeviceSize.java should only run on Linux Reviewed-by: lancea, alanb --- test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java b/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java index aafe4192d32..496312256be 100644 --- a/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java +++ b/test/jdk/java/nio/channels/FileChannel/BlockDeviceSize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -23,6 +23,7 @@ /* @test * @bug 8054029 + * @requires (os.family == "linux") * @summary Block devices should not report size=0 on Linux */ -- GitLab From 0a0909263194032ae7d8348484e3638f84090233 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Fri, 3 Dec 2021 16:36:19 +0000 Subject: [PATCH 599/890] 8268288: jdk/jfr/api/consumer/streaming/TestOutOfProcessMigration.java fails with "Error: ShouldNotReachHere()" Reviewed-by: minqi, iklam --- src/hotspot/share/cds/filemap.cpp | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 14eaa8a6abb..72a0d35bca7 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -2480,28 +2480,28 @@ void FileMapInfo::stop_sharing_and_unmap(const char* msg) { ClassPathEntry** FileMapInfo::_classpath_entries_for_jvmti = NULL; ClassPathEntry* FileMapInfo::get_classpath_entry_for_jvmti(int i, TRAPS) { + if (i == 0) { + // index 0 corresponds to the ClassPathImageEntry which is a globally shared object + // and should never be deleted. + return ClassLoader::get_jrt_entry(); + } ClassPathEntry* ent = _classpath_entries_for_jvmti[i]; if (ent == NULL) { - if (i == 0) { - ent = ClassLoader::get_jrt_entry(); - assert(ent != NULL, "must be"); + SharedClassPathEntry* scpe = shared_path(i); + assert(scpe->is_jar(), "must be"); // other types of scpe will not produce archived classes + + const char* path = scpe->name(); + struct stat st; + if (os::stat(path, &st) != 0) { + char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128); + jio_snprintf(msg, strlen(path) + 127, "error in finding JAR file %s", path); + THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL); } else { - SharedClassPathEntry* scpe = shared_path(i); - assert(scpe->is_jar(), "must be"); // other types of scpe will not produce archived classes - - const char* path = scpe->name(); - struct stat st; - if (os::stat(path, &st) != 0) { + ent = ClassLoader::create_class_path_entry(THREAD, path, &st, false, false); + if (ent == NULL) { char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128); - jio_snprintf(msg, strlen(path) + 127, "error in finding JAR file %s", path); + jio_snprintf(msg, strlen(path) + 127, "error in opening JAR file %s", path); THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL); - } else { - ent = ClassLoader::create_class_path_entry(THREAD, path, &st, false, false); - if (ent == NULL) { - char *msg = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, strlen(path) + 128); - jio_snprintf(msg, strlen(path) + 127, "error in opening JAR file %s", path); - THROW_MSG_(vmSymbols::java_io_IOException(), msg, NULL); - } } } -- GitLab From fbf096eea46756bdac6f474266caec500c4dc5c5 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 3 Dec 2021 16:56:36 +0000 Subject: [PATCH 600/890] 8251400: Fix incorrect addition of library to test in JDK-8237858 Reviewed-by: dholmes, erikj --- make/common/TestFilesCompilation.gmk | 6 +----- make/test/JtregNativeJdk.gmk | 8 +++++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk index 01dc181d2c2..bb807ebf6b1 100644 --- a/make/common/TestFilesCompilation.gmk +++ b/make/common/TestFilesCompilation.gmk @@ -62,11 +62,7 @@ define SetupTestFilesCompilationBody $1_OUTPUT_SUBDIR := lib $1_BASE_CFLAGS := $(CFLAGS_JDKLIB) $1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB) - ifeq ($(call isTargetOs, windows), false) - $1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN) -pthread - else - $1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN) - endif + $1_LDFLAGS := $(LDFLAGS_JDKLIB) $$(call SET_SHARED_LIBRARY_ORIGIN) $1_COMPILATION_TYPE := LIBRARY else ifeq ($$($1_TYPE), PROGRAM) $1_PREFIX = exe diff --git a/make/test/JtregNativeJdk.gmk b/make/test/JtregNativeJdk.gmk index 1a07de31653..62c0fc809b3 100644 --- a/make/test/JtregNativeJdk.gmk +++ b/make/test/JtregNativeJdk.gmk @@ -53,9 +53,6 @@ BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \ -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli -BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncStackWalk := $(LIBCXX) -BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncInvokers := $(LIBCXX) - # Platform specific setup ifeq ($(call isTargetOs, windows), true) BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c exelauncher.c @@ -68,9 +65,14 @@ ifeq ($(call isTargetOs, windows), true) BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libAsyncStackWalk := /EHsc BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libAsyncInvokers := /EHsc + BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncStackWalk := $(LIBCXX) + BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncInvokers := $(LIBCXX) else BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava + BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libNativeThread := -pthread + BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncStackWalk := $(LIBCXX) -pthread + BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libAsyncInvokers := $(LIBCXX) -pthread BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c ifeq ($(call isTargetOs, linux), true) BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava -- GitLab From 2e30fa936dd5fffceb17d338271f5e725c85801c Mon Sep 17 00:00:00 2001 From: merykitty Date: Fri, 3 Dec 2021 17:07:11 +0000 Subject: [PATCH 601/890] 8278171: [vectorapi] Mask incorrectly computed for zero extending cast Reviewed-by: psandoz --- .../jdk/incubator/vector/AbstractVector.java | 2 +- .../incubator/vector/VectorReshapeTests.java | 321 ++++++++++++++++++ 2 files changed, 322 insertions(+), 1 deletion(-) diff --git a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractVector.java b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractVector.java index 1ffdb058a27..6acd4282edd 100644 --- a/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractVector.java +++ b/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/AbstractVector.java @@ -707,7 +707,7 @@ abstract class AbstractVector extends Vector { return v.convert0('C', rspi); } // extend in place, but remove unwanted sign extension - long mask = -1L >>> sizeChange; + long mask = -1L >>> -dsp.elementSize(); return (AbstractVector) v.convert0('C', rspi) .lanewise(AND, rspi.broadcast(mask)); diff --git a/test/jdk/jdk/incubator/vector/VectorReshapeTests.java b/test/jdk/jdk/incubator/vector/VectorReshapeTests.java index 01dcc4caf85..5db3577f36e 100644 --- a/test/jdk/jdk/incubator/vector/VectorReshapeTests.java +++ b/test/jdk/jdk/incubator/vector/VectorReshapeTests.java @@ -3334,6 +3334,327 @@ public class VectorReshapeTests { } } + @ForceInline + static + void testVectorUCastByteToShort(VectorSpecies a, VectorSpecies b, byte[] input, short[] output) { + assert(input.length == a.length()); + assert(output.length == b.length()); + + ByteVector av = ByteVector.fromArray(a, input, 0); + ShortVector bv = (ShortVector) av.convertShape(VectorOperators.ZERO_EXTEND_B2S, b, 0); + bv.intoArray(output, 0); + + for (int i = 0; i < Math.min(input.length, output.length); i++) { + Assert.assertEquals(output[i], Byte.toUnsignedLong(input[i])); + } + for(int i = input.length; i < output.length; i++) { + Assert.assertEquals(output[i], (short)0); + } + } + + @ForceInline + static + void testVectorUCastByteToInt(VectorSpecies a, VectorSpecies b, byte[] input, int[] output) { + assert(input.length == a.length()); + assert(output.length == b.length()); + + ByteVector av = ByteVector.fromArray(a, input, 0); + IntVector bv = (IntVector) av.convertShape(VectorOperators.ZERO_EXTEND_B2I, b, 0); + bv.intoArray(output, 0); + + for (int i = 0; i < Math.min(input.length, output.length); i++) { + Assert.assertEquals(output[i], Byte.toUnsignedLong(input[i])); + } + for(int i = input.length; i < output.length; i++) { + Assert.assertEquals(output[i], (int)0); + } + } + + @ForceInline + static + void testVectorUCastByteToLong(VectorSpecies a, VectorSpecies b, byte[] input, long[] output) { + assert(input.length == a.length()); + assert(output.length == b.length()); + + ByteVector av = ByteVector.fromArray(a, input, 0); + LongVector bv = (LongVector) av.convertShape(VectorOperators.ZERO_EXTEND_B2L, b, 0); + bv.intoArray(output, 0); + + for (int i = 0; i < Math.min(input.length, output.length); i++) { + Assert.assertEquals(output[i], Byte.toUnsignedLong(input[i])); + } + for(int i = input.length; i < output.length; i++) { + Assert.assertEquals(output[i], (long)0); + } + } + + @ForceInline + static + void testVectorUCastShortToInt(VectorSpecies a, VectorSpecies b, short[] input, int[] output) { + assert(input.length == a.length()); + assert(output.length == b.length()); + + ShortVector av = ShortVector.fromArray(a, input, 0); + IntVector bv = (IntVector) av.convertShape(VectorOperators.ZERO_EXTEND_S2I, b, 0); + bv.intoArray(output, 0); + + for (int i = 0; i < Math.min(input.length, output.length); i++) { + Assert.assertEquals(output[i], Short.toUnsignedLong(input[i])); + } + for(int i = input.length; i < output.length; i++) { + Assert.assertEquals(output[i], (int)0); + } + } + + @ForceInline + static + void testVectorUCastShortToLong(VectorSpecies a, VectorSpecies b, short[] input, long[] output) { + assert(input.length == a.length()); + assert(output.length == b.length()); + + ShortVector av = ShortVector.fromArray(a, input, 0); + LongVector bv = (LongVector) av.convertShape(VectorOperators.ZERO_EXTEND_S2L, b, 0); + bv.intoArray(output, 0); + + for (int i = 0; i < Math.min(input.length, output.length); i++) { + Assert.assertEquals(output[i], Short.toUnsignedLong(input[i])); + } + for(int i = input.length; i < output.length; i++) { + Assert.assertEquals(output[i], (long)0); + } + } + + @ForceInline + static + void testVectorUCastIntToLong(VectorSpecies a, VectorSpecies b, int[] input, long[] output) { + assert(input.length == a.length()); + assert(output.length == b.length()); + + IntVector av = IntVector.fromArray(a, input, 0); + LongVector bv = (LongVector) av.convertShape(VectorOperators.ZERO_EXTEND_I2L, b, 0); + bv.intoArray(output, 0); + + for (int i = 0; i < Math.min(input.length, output.length); i++) { + Assert.assertEquals(output[i], Integer.toUnsignedLong(input[i])); + } + for(int i = input.length; i < output.length; i++) { + Assert.assertEquals(output[i], (long)0); + } + } + + @Test(dataProvider = "byteUnaryOpProvider") + static void testUCastFromByte(IntFunction fa) { + byte[] bin64 = fa.apply(bspec64.length()); + byte[] bin128 = fa.apply(bspec128.length()); + byte[] bin256 = fa.apply(bspec256.length()); + byte[] bin512 = fa.apply(bspec512.length()); + + short[] sout64 = new short[sspec64.length()]; + short[] sout128 = new short[sspec128.length()]; + short[] sout256 = new short[sspec256.length()]; + short[] sout512 = new short[sspec512.length()]; + + int[] iout64 = new int[ispec64.length()]; + int[] iout128 = new int[ispec128.length()]; + int[] iout256 = new int[ispec256.length()]; + int[] iout512 = new int[ispec512.length()]; + + long[] lout64 = new long[lspec64.length()]; + long[] lout128 = new long[lspec128.length()]; + long[] lout256 = new long[lspec256.length()]; + long[] lout512 = new long[lspec512.length()]; + + for (int i = 0; i < NUM_ITER; i++) { + // B2S exact fit + testVectorUCastByteToShort(bspec64, sspec128, bin64, sout128); + testVectorUCastByteToShort(bspec128, sspec256, bin128, sout256); + testVectorUCastByteToShort(bspec256, sspec512, bin256, sout512); + + // B2S expansion + testVectorUCastByteToShort(bspec64, sspec64, bin64, sout64); + testVectorUCastByteToShort(bspec128, sspec128, bin128, sout128); + testVectorUCastByteToShort(bspec256, sspec256, bin256, sout256); + testVectorUCastByteToShort(bspec512, sspec512, bin512, sout512); + + testVectorUCastByteToShort(bspec128, sspec64, bin128, sout64); + testVectorUCastByteToShort(bspec256, sspec128, bin256, sout128); + testVectorUCastByteToShort(bspec512, sspec256, bin512, sout256); + + testVectorUCastByteToShort(bspec256, sspec64, bin256, sout64); + testVectorUCastByteToShort(bspec512, sspec128, bin512, sout128); + + testVectorUCastByteToShort(bspec512, sspec64, bin512, sout64); + + // B2S contraction + testVectorUCastByteToShort(bspec64, sspec256, bin64, sout256); + testVectorUCastByteToShort(bspec128, sspec512, bin128, sout512); + + testVectorUCastByteToShort(bspec64, sspec512, bin64, sout512); + + // B2I exact fit + testVectorUCastByteToInt(bspec64, ispec256, bin64, iout256); + testVectorUCastByteToInt(bspec128, ispec512, bin128, iout512); + + // B2I expansion + testVectorUCastByteToInt(bspec64, ispec128, bin64, iout128); + testVectorUCastByteToInt(bspec128, ispec256, bin128, iout256); + testVectorUCastByteToInt(bspec256, ispec512, bin256, iout512); + + testVectorUCastByteToInt(bspec64, ispec64, bin64, iout64); + testVectorUCastByteToInt(bspec128, ispec128, bin128, iout128); + testVectorUCastByteToInt(bspec256, ispec256, bin256, iout256); + testVectorUCastByteToInt(bspec512, ispec512, bin512, iout512); + + testVectorUCastByteToInt(bspec128, ispec64, bin128, iout64); + testVectorUCastByteToInt(bspec256, ispec128, bin256, iout128); + testVectorUCastByteToInt(bspec512, ispec256, bin512, iout256); + + testVectorUCastByteToInt(bspec256, ispec64, bin256, iout64); + testVectorUCastByteToInt(bspec512, ispec128, bin512, iout128); + + testVectorUCastByteToInt(bspec512, ispec64, bin512, iout64); + + // B2I contraction + testVectorUCastByteToInt(bspec64, ispec512, bin64, iout512); + + // B2L exact fit + testVectorUCastByteToLong(bspec64, lspec512, bin64, lout512); + + // B2L expansion + testVectorUCastByteToLong(bspec64, lspec256, bin64, lout256); + testVectorUCastByteToLong(bspec128, lspec512, bin128, lout512); + + testVectorUCastByteToLong(bspec64, lspec128, bin64, lout128); + testVectorUCastByteToLong(bspec128, lspec256, bin128, lout256); + testVectorUCastByteToLong(bspec256, lspec512, bin256, lout512); + + testVectorUCastByteToLong(bspec64, lspec64, bin64, lout64); + testVectorUCastByteToLong(bspec128, lspec128, bin128, lout128); + testVectorUCastByteToLong(bspec256, lspec256, bin256, lout256); + testVectorUCastByteToLong(bspec512, lspec512, bin512, lout512); + + testVectorUCastByteToLong(bspec128, lspec64, bin128, lout64); + testVectorUCastByteToLong(bspec256, lspec128, bin256, lout128); + testVectorUCastByteToLong(bspec512, lspec256, bin512, lout256); + + testVectorUCastByteToLong(bspec256, lspec64, bin256, lout64); + testVectorUCastByteToLong(bspec512, lspec128, bin512, lout128); + + testVectorUCastByteToLong(bspec512, lspec64, bin512, lout64); + } + } + + @Test(dataProvider = "shortUnaryOpProvider") + static void testUCastFromShort(IntFunction fa) { + short[] sin64 = fa.apply(sspec64.length()); + short[] sin128 = fa.apply(sspec128.length()); + short[] sin256 = fa.apply(sspec256.length()); + short[] sin512 = fa.apply(sspec512.length()); + + int[] iout64 = new int[ispec64.length()]; + int[] iout128 = new int[ispec128.length()]; + int[] iout256 = new int[ispec256.length()]; + int[] iout512 = new int[ispec512.length()]; + + long[] lout64 = new long[lspec64.length()]; + long[] lout128 = new long[lspec128.length()]; + long[] lout256 = new long[lspec256.length()]; + long[] lout512 = new long[lspec512.length()]; + + for (int i = 0; i < NUM_ITER; i++) { + // S2I exact fit + testVectorUCastShortToInt(sspec64, ispec128, sin64, iout128); + testVectorUCastShortToInt(sspec128, ispec256, sin128, iout256); + testVectorUCastShortToInt(sspec256, ispec512, sin256, iout512); + + // S2I expansion + testVectorUCastShortToInt(sspec64, ispec64, sin64, iout64); + testVectorUCastShortToInt(sspec128, ispec128, sin128, iout128); + testVectorUCastShortToInt(sspec256, ispec256, sin256, iout256); + testVectorUCastShortToInt(sspec512, ispec512, sin512, iout512); + + testVectorUCastShortToInt(sspec128, ispec64, sin128, iout64); + testVectorUCastShortToInt(sspec256, ispec128, sin256, iout128); + testVectorUCastShortToInt(sspec512, ispec256, sin512, iout256); + + testVectorUCastShortToInt(sspec256, ispec64, sin256, iout64); + testVectorUCastShortToInt(sspec512, ispec128, sin512, iout128); + + testVectorUCastShortToInt(sspec512, ispec64, sin512, iout64); + + // S2I contraction + testVectorUCastShortToInt(sspec64, ispec256, sin64, iout256); + testVectorUCastShortToInt(sspec128, ispec512, sin128, iout512); + + testVectorUCastShortToInt(sspec64, ispec512, sin64, iout512); + + // S2L exact fit + testVectorUCastShortToLong(sspec64, lspec256, sin64, lout256); + testVectorUCastShortToLong(sspec128, lspec512, sin128, lout512); + + // S2L expansion + testVectorUCastShortToLong(sspec64, lspec128, sin64, lout128); + testVectorUCastShortToLong(sspec128, lspec256, sin128, lout256); + testVectorUCastShortToLong(sspec256, lspec512, sin256, lout512); + + testVectorUCastShortToLong(sspec64, lspec64, sin64, lout64); + testVectorUCastShortToLong(sspec128, lspec128, sin128, lout128); + testVectorUCastShortToLong(sspec256, lspec256, sin256, lout256); + testVectorUCastShortToLong(sspec512, lspec512, sin512, lout512); + + testVectorUCastShortToLong(sspec128, lspec64, sin128, lout64); + testVectorUCastShortToLong(sspec256, lspec128, sin256, lout128); + testVectorUCastShortToLong(sspec512, lspec256, sin512, lout256); + + testVectorUCastShortToLong(sspec256, lspec64, sin256, lout64); + testVectorUCastShortToLong(sspec512, lspec128, sin512, lout128); + + testVectorUCastShortToLong(sspec512, lspec64, sin512, lout64); + + // S2L contraction + testVectorUCastShortToLong(sspec64, lspec512, sin64, lout512); + } + } + + @Test(dataProvider = "intUnaryOpProvider") + static void testUCastFromInt(IntFunction fa) { + int[] iin64 = fa.apply(ispec64.length()); + int[] iin128 = fa.apply(ispec128.length()); + int[] iin256 = fa.apply(ispec256.length()); + int[] iin512 = fa.apply(ispec512.length()); + + long[] lout64 = new long[lspec64.length()]; + long[] lout128 = new long[lspec128.length()]; + long[] lout256 = new long[lspec256.length()]; + long[] lout512 = new long[lspec512.length()]; + + // I2L exact fit + testVectorUCastIntToLong(ispec64, lspec128, iin64, lout128); + testVectorUCastIntToLong(ispec128, lspec256, iin128, lout256); + testVectorUCastIntToLong(ispec256, lspec512, iin256, lout512); + + // I2L expansion + testVectorUCastIntToLong(ispec64, lspec64, iin64, lout64); + testVectorUCastIntToLong(ispec128, lspec128, iin128, lout128); + testVectorUCastIntToLong(ispec256, lspec256, iin256, lout256); + testVectorUCastIntToLong(ispec512, lspec512, iin512, lout512); + + testVectorUCastIntToLong(ispec128, lspec64, iin128, lout64); + testVectorUCastIntToLong(ispec256, lspec128, iin256, lout128); + testVectorUCastIntToLong(ispec512, lspec256, iin512, lout256); + + testVectorUCastIntToLong(ispec256, lspec64, iin256, lout64); + testVectorUCastIntToLong(ispec512, lspec128, iin512, lout128); + + testVectorUCastIntToLong(ispec512, lspec64, iin512, lout64); + + // I2L contraction + testVectorUCastIntToLong(ispec64, lspec256, iin64, lout256); + testVectorUCastIntToLong(ispec128, lspec512, iin128, lout512); + + testVectorUCastIntToLong(ispec64, lspec512, iin64, lout512); + } + static void testVectorCastByteMaxToByte(VectorSpecies a, VectorSpecies b, byte[] input, byte[] output) { -- GitLab From 660f21a418ee4c616d0b91133fd44e74a77d4d53 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Fri, 3 Dec 2021 17:08:40 +0000 Subject: [PATCH 602/890] 8278119: ProblemList few headful test failing in macosx12-aarch64 system Reviewed-by: dcubed --- test/jdk/ProblemList.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 69afd3be6b3..24519795f9a 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -729,10 +729,19 @@ javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all javax/swing/JButton/8151303/PressedIconTest.java 8266246 macosx-aarch64 javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java 8273573 macosx-all -# Several tests which fail on some hidpi systems +# Several tests which fail on some hidpi systems/macosx12-aarch64 system java/awt/Window/8159168/SetShapeTest.java 8274106 macosx-aarch64 java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java 8274106 macosx-aarch64 javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8274106 macosx-aarch64 +javax/swing/text/html/StyleSheet/bug4936917.java 8277816 macosx-aarch64 +javax/swing/plaf/metal/MetalGradient/8163193/ButtonGradientTest.java 8277816 macosx-aarch64 +javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java 8277816 macosx-aarch64 +javax/swing/JInternalFrame/8069348/bug8069348.java 8277816 macosx-aarch64 +java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java 8277816 macosx-aarch64 +java/awt/Robot/CheckCommonColors/CheckCommonColors.java 8277816 macosx-aarch64 +java/awt/ColorClass/AlphaColorTest.java 8277816 macosx-aarch64 +java/awt/AlphaComposite/WindowAlphaCompositeTest.java 8277816 macosx-aarch64 + # macos12 failure javax/swing/JMenu/4515762/bug4515762.java 8276074 macosx-all -- GitLab From 01cb2b9883d7c9ecdba0ee5bd42124faed4d080c Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Fri, 3 Dec 2021 17:14:10 +0000 Subject: [PATCH 603/890] 8277529: SIGSEGV in C2 CompilerThread Node::rematerialize() compiling Packet::readUnsignedTrint Reviewed-by: thartmann, roland, kvn --- src/hotspot/share/opto/loopPredicate.cpp | 68 ++++++--- src/hotspot/share/opto/memnode.cpp | 9 +- .../TestDepBetweenLoopAndPredicate.java | 134 ++++++++++++++++++ 3 files changed, 182 insertions(+), 29 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/loopopts/TestDepBetweenLoopAndPredicate.java diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index b43adfa0305..279edf25046 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -555,6 +555,7 @@ class Invariance : public StackObj { Node_List _old_new; // map of old to new (clone) IdealLoopTree* _lpt; PhaseIdealLoop* _phase; + Node* _data_dependency_on; // The projection into the loop on which data nodes are dependent or NULL otherwise // Helper function to set up the invariance for invariance computation // If n is a known invariant, set up directly. Otherwise, look up the @@ -656,7 +657,8 @@ class Invariance : public StackObj { _visited(area), _invariant(area), _stack(area, 10 /* guess */), _clone_visited(area), _old_new(area), - _lpt(lpt), _phase(lpt->_phase) + _lpt(lpt), _phase(lpt->_phase), + _data_dependency_on(NULL) { LoopNode* head = _lpt->_head->as_Loop(); Node* entry = head->skip_strip_mined()->in(LoopNode::EntryControl); @@ -664,7 +666,12 @@ class Invariance : public StackObj { // If a node is pinned between the predicates and the loop // entry, we won't be able to move any node in the loop that // depends on it above it in a predicate. Mark all those nodes - // as non loop invariatnt. + // as non-loop-invariant. + // Loop predication could create new nodes for which the below + // invariant information is missing. Mark the 'entry' node to + // later check again if a node needs to be treated as non-loop- + // invariant as well. + _data_dependency_on = entry; Unique_Node_List wq; wq.push(entry); for (uint next = 0; next < wq.size(); ++next) { @@ -683,6 +690,12 @@ class Invariance : public StackObj { } } + // Did we explicitly mark some nodes non-loop-invariant? If so, return the entry node on which some data nodes + // are dependent that prevent loop predication. Otherwise, return NULL. + Node* data_dependency_on() { + return _data_dependency_on; + } + // Map old to n for invariance computation and clone void map_ctrl(Node* old, Node* n) { assert(old->is_CFG() && n->is_CFG(), "must be"); @@ -757,31 +770,44 @@ bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invari Node* offset = NULL; jlong scale = 0; Node* iv = _head->as_BaseCountedLoop()->phi(); - if (is_range_check_if(iff, phase, T_INT, iv, range, offset, scale)) { - if (!invar.is_invariant(range)) { + Compile* C = Compile::current(); + const uint old_unique_idx = C->unique(); + if (!is_range_check_if(iff, phase, T_INT, iv, range, offset, scale)) { + return false; + } + if (!invar.is_invariant(range)) { + return false; + } + if (offset != NULL) { + if (!invar.is_invariant(offset)) { // offset must be invariant return false; } - if (offset && !invar.is_invariant(offset)) { // offset must be invariant - return false; + Node* data_dependency_on = invar.data_dependency_on(); + if (data_dependency_on != NULL && old_unique_idx < C->unique()) { + // 'offset' node was newly created in is_range_check_if(). Check that it does not depend on the entry projection + // into the loop. If it does, we cannot perform loop predication (see Invariant::Invariant()). + assert(!offset->is_CFG(), "offset must be a data node"); + if (_phase->get_ctrl(offset) == data_dependency_on) { + return false; + } } + } #ifdef ASSERT - if (offset && phase->has_ctrl(offset)) { - Node* offset_ctrl = phase->get_ctrl(offset); - if (phase->get_loop(predicate_proj) == phase->get_loop(offset_ctrl) && - phase->is_dominator(predicate_proj, offset_ctrl)) { - // If the control of offset is loop predication promoted by previous pass, - // then it will lead to cyclic dependency. - // Previously promoted loop predication is in the same loop of predication - // point. - // This situation can occur when pinning nodes too conservatively - can we do better? - assert(false, "cyclic dependency prevents range check elimination, idx: offset %d, offset_ctrl %d, predicate_proj %d", - offset->_idx, offset_ctrl->_idx, predicate_proj->_idx); - } + if (offset && phase->has_ctrl(offset)) { + Node* offset_ctrl = phase->get_ctrl(offset); + if (phase->get_loop(predicate_proj) == phase->get_loop(offset_ctrl) && + phase->is_dominator(predicate_proj, offset_ctrl)) { + // If the control of offset is loop predication promoted by previous pass, + // then it will lead to cyclic dependency. + // Previously promoted loop predication is in the same loop of predication + // point. + // This situation can occur when pinning nodes too conservatively - can we do better? + assert(false, "cyclic dependency prevents range check elimination, idx: offset %d, offset_ctrl %d, predicate_proj %d", + offset->_idx, offset_ctrl->_idx, predicate_proj->_idx); } -#endif - return true; } - return false; +#endif + return true; } //------------------------------rc_predicate----------------------------------- diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index 8577d1f6a94..815cbb2f450 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -1627,14 +1627,7 @@ Node *LoadNode::split_through_phi(PhaseGVN *phase) { the_clone = x; // Remember for possible deletion. // Alter data node to use pre-phi inputs if (this->in(0) == region) { - if (mem->is_Phi() && (mem->in(0) == region) && mem->in(i)->in(0) != NULL && - MemNode::all_controls_dominate(address, region)) { - // Enable other optimizations such as loop predication which does not work - // if we directly pin the node to node `in` - x->set_req(0, mem->in(i)->in(0)); // Use same control as memory - } else { - x->set_req(0, in); - } + x->set_req(0, in); } else { x->set_req(0, NULL); } diff --git a/test/hotspot/jtreg/compiler/loopopts/TestDepBetweenLoopAndPredicate.java b/test/hotspot/jtreg/compiler/loopopts/TestDepBetweenLoopAndPredicate.java new file mode 100644 index 00000000000..674ae02f239 --- /dev/null +++ b/test/hotspot/jtreg/compiler/loopopts/TestDepBetweenLoopAndPredicate.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2021, 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 8277529 + * @summary RangeCheck should not be moved out of a loop if a node on the data input chain for the bool is dependent + * on the projection into the loop (after the predicates). + * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.loopopts.TestDepBetweenLoopAndPredicate::test* + * compiler.loopopts.TestDepBetweenLoopAndPredicate + */ + +package compiler.loopopts; + +public class TestDepBetweenLoopAndPredicate { + static int x, y, z; + static boolean flag; + static int[] iArrFld = new int[25]; + static int[] iArrFld2 = new int[5]; + static int limit = 5; + + public static void main(String[] args) { + for (int i = 0; i < 10000; i++) { + flag = !flag; + test(); + } + + for (int i = 0; i < 5000; i++) { + flag = !flag; + test2(); + test3(); + test4(); + test5(); + } + } + + public static void test() { + int[] iArr = new int[20]; + System.arraycopy(iArrFld, x, iArr, y, 18); + + if (flag) { + return; + } + + for (int i = 0; i < limit; i++) { + iArr[19]++; + } + } + + public static void test2() { + for (int i = 0; i < limit; i++) { + int[] iArr = new int[20]; + System.arraycopy(iArrFld, x, iArr, y, 18); + + if (flag) { + return; + } + + for (int j = i; j < limit; j++) { + x = iArrFld[iArr[19]]; // No new offset node created + iArr[19]++; + } + } + } + + public static void test3() { + for (int i = 0; i < limit; i++) { + int[] iArr = new int[20]; + System.arraycopy(iArrFld, x, iArr, y, 18); + + if (flag) { + return; + } + + for (int j = i + 1; j < limit; j++) { + x = iArrFld[iArr[19]]; // New offset node created + iArr[19]++; + } + } + } + + public static void test4() { + for (int i = 0; i < limit; i++) { + int[] iArr = new int[20]; + System.arraycopy(iArrFld, x, iArr, y, 18); + + if (flag) { + return; + } + + for (int j = i + 1 + z; j < limit; j++) { + x = iArrFld[iArr[19]]; // New offset node created + iArr[19]++; + } + } + } + + public static void test5() { + for (int i = 0; i < limit; i++) { + int[] iArr = new int[20]; + System.arraycopy(iArrFld, x, iArr, y, 18); + + if (flag) { + return; + } + + for (int j = i + 1 + z; j < limit; j++) { + x = iArrFld[iArr[19]]; // New offset node created + iArr[19]++; + y += iArrFld2[3]; // Range check removed because not dependent on projection into the loop + } + } + } +} -- GitLab From 678ac589adeba0e9c2ae6d123f05ff20f02082c8 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 3 Dec 2021 17:22:14 +0000 Subject: [PATCH 604/890] 8278240: ProblemList containers/docker/TestJcmd.java on linux-aarch64 Reviewed-by: mseledtsov, tschatzl --- test/hotspot/jtreg/ProblemList.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 2784a110bb8..696385cad23 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -106,6 +106,8 @@ runtime/ErrorHandling/CreateCoredumpOnCrash.java 8267433 macosx-x64 applications/jcstress/copy.java 8229852 linux-all +containers/docker/TestJcmd.java 8278102 linux-aarch64 + ############################################################################# # :hotspot_serviceability -- GitLab From 780b8b1072811208968e4f32f5368eab622fcdcc Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 3 Dec 2021 18:14:33 +0000 Subject: [PATCH 605/890] 8278179: Enable all doclint warnings for build of java.naming Reviewed-by: iris, erikj --- make/modules/java.naming/Java.gmk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/modules/java.naming/Java.gmk b/make/modules/java.naming/Java.gmk index 32bb474385f..648853d6f53 100644 --- a/make/modules/java.naming/Java.gmk +++ b/make/modules/java.naming/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,6 +23,6 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-accessibility \ +DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:java.*,javax.*' CLEAN += jndiprovider.properties -- GitLab From 38f525e96e767597d16698d4b243b681782acc9f Mon Sep 17 00:00:00 2001 From: vamsi-parasa Date: Fri, 3 Dec 2021 18:17:54 +0000 Subject: [PATCH 606/890] 8275821: Optimize random number generators developed in JDK-8248862 using Math.unsignedMultiplyHigh() Reviewed-by: psandoz, jlaskey --- .../jdk/random/L128X1024MixRandom.java | 12 +--- .../classes/jdk/random/L128X128MixRandom.java | 11 +-- .../classes/jdk/random/L128X256MixRandom.java | 11 +-- .../bench/java/util/RandomGeneratorNext.java | 72 +++++++++++++++++++ 4 files changed, 75 insertions(+), 31 deletions(-) create mode 100644 test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java diff --git a/src/jdk.random/share/classes/jdk/random/L128X1024MixRandom.java b/src/jdk.random/share/classes/jdk/random/L128X1024MixRandom.java index a612233f2ca..46f8a642d54 100644 --- a/src/jdk.random/share/classes/jdk/random/L128X1024MixRandom.java +++ b/src/jdk.random/share/classes/jdk/random/L128X1024MixRandom.java @@ -323,17 +323,7 @@ public final class L128X1024MixRandom extends AbstractSplittableWithBrineGenerat // Update the LCG subgenerator // The LCG is, in effect, s = ((1LL << 64) + ML) * s + a, if only we had 128-bit arithmetic. final long u = ML * sl; - - // Note that Math.multiplyHigh computes the high half of the product of signed values, - // but what we need is the high half of the product of unsigned values; for this we use the - // formula "unsignedMultiplyHigh(a, b) = multiplyHigh(a, b) + ((a >> 63) & b) + ((b >> 63) & a)"; - // in effect, each operand is added to the result iff the sign bit of the other operand is 1. - // (See Henry S. Warren, Jr., _Hacker's Delight_ (Second Edition), Addison-Wesley (2013), - // Section 8-3, p. 175; or see the First Edition, Addison-Wesley (2003), Section 8-3, p. 133.) - // If Math.unsignedMultiplyHigh(long, long) is ever implemented, the following line can become: - // sh = (ML * sh) + Math.unsignedMultiplyHigh(ML, sl) + sl + ah; - // and this entire comment can be deleted. - sh = (ML * sh) + (Math.multiplyHigh(ML, sl) + ((ML >> 63) & sl) + ((sl >> 63) & ML)) + sl + ah; + sh = (ML * sh) + Math.unsignedMultiplyHigh(ML, sl) + sl + ah; sl = u + al; if (Long.compareUnsigned(sl, u) < 0) ++sh; // Handle the carry propagation from low half to high half. diff --git a/src/jdk.random/share/classes/jdk/random/L128X128MixRandom.java b/src/jdk.random/share/classes/jdk/random/L128X128MixRandom.java index 1b7d25850a6..ac12b96b4d2 100644 --- a/src/jdk.random/share/classes/jdk/random/L128X128MixRandom.java +++ b/src/jdk.random/share/classes/jdk/random/L128X128MixRandom.java @@ -248,16 +248,7 @@ public final class L128X128MixRandom extends AbstractSplittableWithBrineGenerato // Update the LCG subgenerator // The LCG is, in effect, s = ((1LL << 64) + ML) * s + a, if only we had 128-bit arithmetic. final long u = ML * sl; - // Note that Math.multiplyHigh computes the high half of the product of signed values, - // but what we need is the high half of the product of unsigned values; for this we use the - // formula "unsignedMultiplyHigh(a, b) = multiplyHigh(a, b) + ((a >> 63) & b) + ((b >> 63) & a)"; - // in effect, each operand is added to the result iff the sign bit of the other operand is 1. - // (See Henry S. Warren, Jr., _Hacker's Delight_ (Second Edition), Addison-Wesley (2013), - // Section 8-3, p. 175; or see the First Edition, Addison-Wesley (2003), Section 8-3, p. 133.) - // If Math.unsignedMultiplyHigh(long, long) is ever implemented, the following line can become: - // sh = (ML * sh) + Math.unsignedMultiplyHigh(ML, sl) + sl + ah; - // and this entire comment can be deleted. - sh = (ML * sh) + (Math.multiplyHigh(ML, sl) + ((ML >> 63) & sl) + ((sl >> 63) & ML)) + sl + ah; + sh = (ML * sh) + Math.unsignedMultiplyHigh(ML, sl) + sl + ah; sl = u + al; if (Long.compareUnsigned(sl, u) < 0) ++sh; // Handle the carry propagation from low half to high half. diff --git a/src/jdk.random/share/classes/jdk/random/L128X256MixRandom.java b/src/jdk.random/share/classes/jdk/random/L128X256MixRandom.java index dad792d8c94..024d8525b3f 100644 --- a/src/jdk.random/share/classes/jdk/random/L128X256MixRandom.java +++ b/src/jdk.random/share/classes/jdk/random/L128X256MixRandom.java @@ -269,16 +269,7 @@ public final class L128X256MixRandom extends AbstractSplittableWithBrineGenerato // Update the LCG subgenerator // The LCG is, in effect, s = ((1LL << 64) + ML) * s + a, if only we had 128-bit arithmetic. final long u = ML * sl; - // Note that Math.multiplyHigh computes the high half of the product of signed values, - // but what we need is the high half of the product of unsigned values; for this we use the - // formula "unsignedMultiplyHigh(a, b) = multiplyHigh(a, b) + ((a >> 63) & b) + ((b >> 63) & a)"; - // in effect, each operand is added to the result iff the sign bit of the other operand is 1. - // (See Henry S. Warren, Jr., _Hacker's Delight_ (Second Edition), Addison-Wesley (2013), - // Section 8-3, p. 175; or see the First Edition, Addison-Wesley (2003), Section 8-3, p. 133.) - // If Math.unsignedMultiplyHigh(long, long) is ever implemented, the following line can become: - // sh = (ML * sh) + Math.unsignedMultiplyHigh(ML, sl) + sl + ah; - // and this entire comment can be deleted. - sh = (ML * sh) + (Math.multiplyHigh(ML, sl) + ((ML >> 63) & sl) + ((sl >> 63) & ML)) + sl + ah; + sh = (ML * sh) + Math.unsignedMultiplyHigh(ML, sl) + sl + ah; sl = u + al; if (Long.compareUnsigned(sl, u) < 0) ++sh; // Handle the carry propagation from low half to high half. diff --git a/test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java b/test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java new file mode 100644 index 00000000000..adb70e195e4 --- /dev/null +++ b/test/micro/org/openjdk/bench/java/util/RandomGeneratorNext.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.java.util; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Param; +import java.util.random.RandomGenerator; +import java.util.random.RandomGeneratorFactory; +import java.util.concurrent.TimeUnit; + +/** + * Tests java.util.random.RandomGenerator's different random number generators which use Math.unsignedMultiplyHigh(). + */ +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class RandomGeneratorNext { + + RandomGenerator randomGenerator; + + @Param({"L128X128MixRandom", "L128X256MixRandom", "L128X1024MixRandom"}) + String randomGeneratorName; + + long[] buffer; + + @Param("1024") + int size; + + @Setup + public void setup() { + buffer = new long[size]; + randomGenerator = RandomGeneratorFactory.of(randomGeneratorName).create(randomGeneratorName.hashCode()); + } + + @Benchmark + public long testNextLong() { + return randomGenerator.nextLong(); + } + + @Benchmark + public long[] testFillBufferWithNextLong() { + for (int i = 0; i < size; i++) buffer[i] = randomGenerator.nextLong(); + return buffer; + } + +} -- GitLab From a729a70c0119ed071ff490b0dfd4e3e2cb1a5ae4 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Fri, 3 Dec 2021 18:52:17 +0000 Subject: [PATCH 607/890] 8225181: KeyStore should have a getAttributes method Reviewed-by: mullan --- .../share/classes/java/security/KeyStore.java | 28 +++++++ .../classes/java/security/KeyStoreSpi.java | 29 ++++++- .../sun/security/pkcs12/PKCS12KeyStore.java | 9 +++ .../sun/security/provider/DomainKeyStore.java | 24 +++++- .../sun/security/util/KeyStoreDelegator.java | 5 ++ .../sun/security/pkcs12/GetAttributes.java | 76 +++++++++++++++++++ 6 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 test/jdk/sun/security/pkcs12/GetAttributes.java diff --git a/src/java.base/share/classes/java/security/KeyStore.java b/src/java.base/share/classes/java/security/KeyStore.java index 0d9fdc9b3c0..efc18f53d33 100644 --- a/src/java.base/share/classes/java/security/KeyStore.java +++ b/src/java.base/share/classes/java/security/KeyStore.java @@ -1020,6 +1020,34 @@ public class KeyStore { return this.type; } + /** + * Retrieves the attributes associated with the given alias. + * + * @param alias the alias name + * @return an unmodifiable {@code Set} of attributes. This set is + * empty if the {@code KeyStoreSpi} implementation has not overridden + * {@link KeyStoreSpi#engineGetAttributes(String)}, or the given + * alias does not exist, or there are no attributes associated + * with the alias. This set may also be empty for + * {@code PrivateKeyEntry} or {@code SecretKeyEntry} + * entries that contain protected attributes and are only available + * through the {@link Entry#getAttributes} method after the entry + * is extracted. + * + * @throws KeyStoreException if the keystore has not been initialized + * (loaded). + * @throws NullPointerException if {@code alias} is {@code null} + * + * @since 18 + */ + public final Set getAttributes(String alias) + throws KeyStoreException { + if (!initialized) { + throw new KeyStoreException("Uninitialized keystore"); + } + return keyStoreSpi.engineGetAttributes(Objects.requireNonNull(alias)); + } + /** * Returns the key associated with the given alias, using the given * password to recover it. The key must have been associated with diff --git a/src/java.base/share/classes/java/security/KeyStoreSpi.java b/src/java.base/share/classes/java/security/KeyStoreSpi.java index 3c275dd9e27..e13c95fd931 100644 --- a/src/java.base/share/classes/java/security/KeyStoreSpi.java +++ b/src/java.base/share/classes/java/security/KeyStoreSpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -447,6 +447,33 @@ public abstract class KeyStoreSpi { return; } + /** + * Retrieves the attributes associated with the given alias. + * + * @implSpec + * The default implementation returns an empty {@code Set}. + * {@code KeyStoreSpi} implementations that support attributes + * should override this method. + * + * @param alias the alias name + * @return an unmodifiable {@code Set} of attributes. This set is + * empty if the given alias does not exist or there are no + * attributes associated with the alias. This set may also be + * empty for {@code PrivateKeyEntry} or {@code SecretKeyEntry} + * entries that contain protected attributes. These protected + * attributes should be populated into the result returned by + * {@link #engineGetEntry} and can be retrieved by calling + * the {@link Entry#getAttributes} method. + * + * @throws KeyStoreException if the keystore has not been initialized + * (loaded). + * + * @since 18 + */ + public Set engineGetAttributes(String alias) { + return Collections.emptySet(); + } + /** * Gets a {@code KeyStore.Entry} for the specified alias * with the specified protection parameter. diff --git a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index e52beceb084..74bdedeae9e 100644 --- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -1307,6 +1307,15 @@ public final class PKCS12KeyStore extends KeyStoreSpi { stream.flush(); } + @Override + public Set engineGetAttributes(String alias) { + if (!engineContainsAlias(alias)) { + return super.engineGetAttributes(alias); + } + Entry entry = entries.get(alias.toLowerCase(Locale.ENGLISH)); + return getAttributes(entry); + } + /** * Gets a KeyStore.Entry for the specified alias * with the specified protection parameter. diff --git a/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java b/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java index a6ace711faa..be0e91a55a3 100644 --- a/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java +++ b/src/java.base/share/classes/sun/security/provider/DomainKeyStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -236,6 +236,28 @@ abstract class DomainKeyStore extends KeyStoreSpi { return date; } + @Override + public Set engineGetAttributes(String alias) { + + AbstractMap.SimpleEntry> pair = + getKeystoresForReading(alias); + Set result = Collections.emptySet(); + + try { + String entryAlias = pair.getKey(); + for (KeyStore keystore : pair.getValue()) { + result = keystore.getAttributes(entryAlias); + if (result != null) { + break; + } + } + } catch (KeyStoreException e) { + throw new IllegalStateException(e); + } + + return result; + } + /** * Assigns the given private key to the given alias, protecting * it with the given password as defined in PKCS8. diff --git a/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java b/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java index d3e3de0d991..27cde4b2053 100644 --- a/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java +++ b/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java @@ -129,6 +129,11 @@ public class KeyStoreDelegator extends KeyStoreSpi { keystore.engineDeleteEntry(alias); } + @Override + public Set engineGetAttributes(String alias) { + return keystore.engineGetAttributes(alias); + } + @Override public Enumeration engineAliases() { return keystore.engineAliases(); diff --git a/test/jdk/sun/security/pkcs12/GetAttributes.java b/test/jdk/sun/security/pkcs12/GetAttributes.java new file mode 100644 index 00000000000..6a4f37c9787 --- /dev/null +++ b/test/jdk/sun/security/pkcs12/GetAttributes.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021, 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 8225181 + * @summary KeyStore should have a getAttributes method + * @library /test/lib + * @modules java.base/sun.security.tools.keytool + * java.base/sun.security.x509 + */ + +import jdk.test.lib.Asserts; +import sun.security.tools.keytool.CertAndKeyGen; +import sun.security.x509.X500Name; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.security.KeyStore; +import java.security.cert.Certificate; + +public class GetAttributes { + + static char[] pass = "changeit".toCharArray(); + + public static void main(String[] args) throws Exception { + + // Create a keystore with one private key entry and one cert entry + CertAndKeyGen cag = new CertAndKeyGen("EC", "SHA256withECDSA"); + KeyStore ks = KeyStore.getInstance("pkcs12"); + ks.load(null, null); + cag.generate("secp256r1"); + ks.setKeyEntry("a", cag.getPrivateKey(), pass, new Certificate[] { + cag.getSelfCertificate(new X500Name("CN=a"), 1000)} ); + cag.generate("secp256r1"); + ks.setCertificateEntry("b", + cag.getSelfCertificate(new X500Name("CN=b"), 1000)); + + // Test + check(ks); + + // Test newly loaded + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ks.store(bos, pass); + KeyStore ks2 = KeyStore.getInstance("pkcs12"); + ks2.load(new ByteArrayInputStream(bos.toByteArray()), pass); + check(ks2); + } + + static void check(KeyStore ks) throws Exception { + var entry = ks.getEntry("a", new KeyStore.PasswordProtection(pass)); + Asserts.assertEQ(ks.getAttributes("a"), entry.getAttributes()); + entry = ks.getEntry("b", null); + Asserts.assertEQ(ks.getAttributes("b"), entry.getAttributes()); + } +} -- GitLab From e1cde19dbdbbca365ecfea6d1e2e85a42ed8bde0 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Fri, 3 Dec 2021 19:52:18 +0000 Subject: [PATCH 608/890] 8278247: KeyStoreSpi::engineGetAttributes does not throws KeyStoreException Reviewed-by: mullan --- src/java.base/share/classes/java/security/KeyStoreSpi.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/java.base/share/classes/java/security/KeyStoreSpi.java b/src/java.base/share/classes/java/security/KeyStoreSpi.java index e13c95fd931..7702c0c93b5 100644 --- a/src/java.base/share/classes/java/security/KeyStoreSpi.java +++ b/src/java.base/share/classes/java/security/KeyStoreSpi.java @@ -465,9 +465,6 @@ public abstract class KeyStoreSpi { * {@link #engineGetEntry} and can be retrieved by calling * the {@link Entry#getAttributes} method. * - * @throws KeyStoreException if the keystore has not been initialized - * (loaded). - * * @since 18 */ public Set engineGetAttributes(String alias) { -- GitLab From 2b87c2b429f1c9f0d940795d5f74a54a20c2f5c0 Mon Sep 17 00:00:00 2001 From: Jatin Bhateja Date: Fri, 3 Dec 2021 20:21:21 +0000 Subject: [PATCH 609/890] 8277793: Support vector F2I and D2L cast operations for X86 Reviewed-by: neliasso, sviswanathan --- src/hotspot/cpu/x86/assembler_x86.cpp | 15 ++++ src/hotspot/cpu/x86/assembler_x86.hpp | 6 ++ src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp | 81 +++++++++++++++++++ src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp | 12 +++ src/hotspot/cpu/x86/macroAssembler_x86.cpp | 10 +++ src/hotspot/cpu/x86/macroAssembler_x86.hpp | 2 + src/hotspot/cpu/x86/x86.ad | 66 +++++++++++++-- 7 files changed, 186 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/x86/assembler_x86.cpp b/src/hotspot/cpu/x86/assembler_x86.cpp index ad74f80b2aa..4c23b12d0b5 100644 --- a/src/hotspot/cpu/x86/assembler_x86.cpp +++ b/src/hotspot/cpu/x86/assembler_x86.cpp @@ -2060,6 +2060,13 @@ void Assembler::vcvtpd2ps(XMMRegister dst, XMMRegister src, int vector_len) { emit_int16(0x5A, (0xC0 | encode)); } +void Assembler::vcvttps2dq(XMMRegister dst, XMMRegister src, int vector_len) { + assert(vector_len <= AVX_256bit ? VM_Version::supports_avx() : VM_Version::supports_evex(), ""); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); + emit_int16(0x5B, (0xC0 | encode)); +} + void Assembler::evcvtqq2ps(XMMRegister dst, XMMRegister src, int vector_len) { assert(UseAVX > 2 && VM_Version::supports_avx512dq(), ""); InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); @@ -2068,6 +2075,14 @@ void Assembler::evcvtqq2ps(XMMRegister dst, XMMRegister src, int vector_len) { emit_int16(0x5B, (0xC0 | encode)); } +void Assembler::evcvttpd2qq(XMMRegister dst, XMMRegister src, int vector_len) { + assert(UseAVX > 2 && VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int16(0x7A, (0xC0 | encode)); +} + void Assembler::evcvtqq2pd(XMMRegister dst, XMMRegister src, int vector_len) { assert(UseAVX > 2 && VM_Version::supports_avx512dq(), ""); InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); diff --git a/src/hotspot/cpu/x86/assembler_x86.hpp b/src/hotspot/cpu/x86/assembler_x86.hpp index 0707a12a0f6..5a6e9129fd8 100644 --- a/src/hotspot/cpu/x86/assembler_x86.hpp +++ b/src/hotspot/cpu/x86/assembler_x86.hpp @@ -1168,10 +1168,16 @@ private: void vcvtps2pd(XMMRegister dst, XMMRegister src, int vector_len); void vcvtpd2ps(XMMRegister dst, XMMRegister src, int vector_len); + // Convert vector float and int + void vcvttps2dq(XMMRegister dst, XMMRegister src, int vector_len); + // Convert vector long to vector FP void evcvtqq2ps(XMMRegister dst, XMMRegister src, int vector_len); void evcvtqq2pd(XMMRegister dst, XMMRegister src, int vector_len); + // Convert vector double to long + void evcvttpd2qq(XMMRegister dst, XMMRegister src, int vector_len); + // Evex casts with truncation void evpmovwb(XMMRegister dst, XMMRegister src, int vector_len); void evpmovdw(XMMRegister dst, XMMRegister src, int vector_len); diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index 59a541e215e..4aec9668a14 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -4059,6 +4059,87 @@ void C2_MacroAssembler::masked_op(int ideal_opc, int mask_len, KRegister dst, } } +/* + * Algorithm for vector D2L and F2I conversions:- + * a) Perform vector D2L/F2I cast. + * b) Choose fast path if none of the result vector lane contains 0x80000000 value. + * It signifies that source value could be any of the special floating point + * values(NaN,-Inf,Inf,Max,-Min). + * c) Set destination to zero if source is NaN value. + * d) Replace 0x80000000 with MaxInt if source lane contains a +ve value. + */ + +void C2_MacroAssembler::vector_castD2L_evex(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, XMMRegister xtmp2, + KRegister ktmp1, KRegister ktmp2, AddressLiteral double_sign_flip, + Register scratch, int vec_enc) { + Label done; + evcvttpd2qq(dst, src, vec_enc); + evmovdqul(xtmp1, k0, double_sign_flip, false, vec_enc, scratch); + evpcmpeqq(ktmp1, xtmp1, dst, vec_enc); + kortestwl(ktmp1, ktmp1); + jccb(Assembler::equal, done); + + vpxor(xtmp2, xtmp2, xtmp2, vec_enc); + evcmppd(ktmp2, k0, src, src, Assembler::UNORD_Q, vec_enc); + evmovdquq(dst, ktmp2, xtmp2, true, vec_enc); + + kxorwl(ktmp1, ktmp1, ktmp2); + evcmppd(ktmp1, ktmp1, src, xtmp2, Assembler::NLT_UQ, vec_enc); + vpternlogq(xtmp2, 0x11, xtmp1, xtmp1, vec_enc); + evmovdquq(dst, ktmp1, xtmp2, true, vec_enc); + bind(done); +} + +void C2_MacroAssembler::vector_castF2I_avx(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, + XMMRegister xtmp2, XMMRegister xtmp3, XMMRegister xtmp4, + AddressLiteral float_sign_flip, Register scratch, int vec_enc) { + Label done; + vcvttps2dq(dst, src, vec_enc); + vmovdqu(xtmp1, float_sign_flip, scratch, vec_enc); + vpcmpeqd(xtmp2, dst, xtmp1, vec_enc); + vptest(xtmp2, xtmp2, vec_enc); + jccb(Assembler::equal, done); + + vpcmpeqd(xtmp4, xtmp4, xtmp4, vec_enc); + vpxor(xtmp1, xtmp1, xtmp4, vec_enc); + + vpxor(xtmp4, xtmp4, xtmp4, vec_enc); + vcmpps(xtmp3, src, src, Assembler::UNORD_Q, vec_enc); + vblendvps(dst, dst, xtmp4, xtmp3, vec_enc); + + // Recompute the mask for remaining special value. + vpxor(xtmp2, xtmp2, xtmp3, vec_enc); + // Extract SRC values corresponding to TRUE mask lanes. + vpand(xtmp4, xtmp2, src, vec_enc); + // Flip mask bits so that MSB bit of MASK lanes corresponding to +ve special + // values are set. + vpxor(xtmp3, xtmp2, xtmp4, vec_enc); + + vblendvps(dst, dst, xtmp1, xtmp3, vec_enc); + bind(done); +} + +void C2_MacroAssembler::vector_castF2I_evex(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, XMMRegister xtmp2, + KRegister ktmp1, KRegister ktmp2, AddressLiteral float_sign_flip, + Register scratch, int vec_enc) { + Label done; + vcvttps2dq(dst, src, vec_enc); + evmovdqul(xtmp1, k0, float_sign_flip, false, vec_enc, scratch); + Assembler::evpcmpeqd(ktmp1, k0, xtmp1, dst, vec_enc); + kortestwl(ktmp1, ktmp1); + jccb(Assembler::equal, done); + + vpxor(xtmp2, xtmp2, xtmp2, vec_enc); + evcmpps(ktmp2, k0, src, src, Assembler::UNORD_Q, vec_enc); + evmovdqul(dst, ktmp2, xtmp2, true, vec_enc); + + kxorwl(ktmp1, ktmp1, ktmp2); + evcmpps(ktmp1, ktmp1, src, xtmp2, Assembler::NLT_UQ, vec_enc); + vpternlogd(xtmp2, 0x11, xtmp1, xtmp1, vec_enc); + evmovdqul(dst, ktmp1, xtmp2, true, vec_enc); + bind(done); +} + #ifdef _LP64 void C2_MacroAssembler::vector_mask_operation_helper(int opc, Register dst, Register tmp, int masklen) { switch(opc) { diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp index 83acb399317..e6588e0485d 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.hpp @@ -290,4 +290,16 @@ public: void masked_op(int ideal_opc, int mask_len, KRegister dst, KRegister src1, KRegister src2); + + void vector_castF2I_avx(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, + XMMRegister xtmp2, XMMRegister xtmp3, XMMRegister xtmp4, + AddressLiteral float_sign_flip, Register scratch, int vec_enc); + + void vector_castF2I_evex(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, XMMRegister xtmp2, + KRegister ktmp1, KRegister ktmp2, AddressLiteral float_sign_flip, + Register scratch, int vec_enc); + + void vector_castD2L_evex(XMMRegister dst, XMMRegister src, XMMRegister xtmp1, XMMRegister xtmp2, + KRegister ktmp1, KRegister ktmp2, AddressLiteral double_sign_flip, + Register scratch, int vec_enc); #endif // CPU_X86_C2_MACROASSEMBLER_X86_HPP diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 05a36a8195d..a81e0941ac4 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -2546,6 +2546,15 @@ void MacroAssembler::vmovdqu(XMMRegister dst, AddressLiteral src, Register scrat } } +void MacroAssembler::vmovdqu(XMMRegister dst, AddressLiteral src, Register scratch_reg, int vector_len) { + assert(vector_len <= AVX_256bit, "AVX2 vector length"); + if (vector_len == AVX_256bit) { + vmovdqu(dst, src, scratch_reg); + } else { + movdqu(dst, src, scratch_reg); + } +} + void MacroAssembler::kmov(KRegister dst, Address src) { if (VM_Version::supports_avx512bw()) { kmovql(dst, src); @@ -9037,4 +9046,5 @@ void MacroAssembler::get_thread(Register thread) { } } + #endif // !WIN32 || _LP64 diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index 392ff61d87f..5c101b49687 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -1117,6 +1117,8 @@ public: void vmovdqu(XMMRegister dst, Address src); void vmovdqu(XMMRegister dst, XMMRegister src); void vmovdqu(XMMRegister dst, AddressLiteral src, Register scratch_reg = rscratch1); + void vmovdqu(XMMRegister dst, AddressLiteral src, Register scratch_reg, int vector_len); + // AVX512 Unaligned void evmovdqu(BasicType type, KRegister kmask, Address dst, XMMRegister src, int vector_len); diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 4b55780a3d2..c7e396e2637 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -1382,6 +1382,8 @@ Assembler::Width widthForType(BasicType bt) { static address vector_long_shufflemask() { return StubRoutines::x86::vector_long_shuffle_mask(); } static address vector_32_bit_mask() { return StubRoutines::x86::vector_32_bit_mask(); } static address vector_64_bit_mask() { return StubRoutines::x86::vector_64_bit_mask(); } + static address vector_float_signflip() { return StubRoutines::x86::vector_float_sign_flip();} + static address vector_double_signflip() { return StubRoutines::x86::vector_double_sign_flip();} //============================================================================= const bool Matcher::match_rule_supported(int opcode) { @@ -1792,13 +1794,19 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType return false; } break; - case Op_VectorCastF2X: case Op_VectorCastD2X: - if (is_integral_type(bt)) { - // Casts from FP to integral types require special fixup logic not easily - // implementable with vectors. - return false; // Implementation limitation + if (is_subword_type(bt) || bt == T_INT) { + return false; + } + if (bt == T_LONG && !VM_Version::supports_avx512dq()) { + return false; + } + break; + case Op_VectorCastF2X: + if (is_subword_type(bt) || bt == T_LONG) { + return false; } + break; case Op_MulReductionVI: if (bt == T_BYTE && size_in_bits == 512 && !VM_Version::supports_avx512bw()) { return false; @@ -7157,7 +7165,7 @@ instruct vcastLtoX_evex(vec dst, vec src) %{ instruct vcastFtoD_reg(vec dst, vec src) %{ predicate(Matcher::vector_element_basic_type(n) == T_DOUBLE); match(Set dst (VectorCastF2X src)); - format %{ "vector_cast_f2x $dst,$src\t!" %} + format %{ "vector_cast_f2d $dst,$src\t!" %} ins_encode %{ int vlen_enc = vector_length_encoding(this); __ vcvtps2pd($dst$$XMMRegister, $src$$XMMRegister, vlen_enc); @@ -7165,6 +7173,38 @@ instruct vcastFtoD_reg(vec dst, vec src) %{ ins_pipe( pipe_slow ); %} +instruct vcastFtoI_reg_avx(vec dst, vec src, vec xtmp1, vec xtmp2, vec xtmp3, vec xtmp4, rRegP scratch, rFlagsReg cr) %{ + predicate(!VM_Version::supports_avx512vl() && + Matcher::vector_length_in_bytes(n) < 64 && + Matcher::vector_element_basic_type(n) == T_INT); + match(Set dst (VectorCastF2X src)); + effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP xtmp3, TEMP xtmp4, TEMP scratch, KILL cr); + format %{ "vector_cast_f2i $dst,$src\t! using $xtmp1, $xtmp2, $xtmp3 and $xtmp4 as TEMP" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + __ vector_castF2I_avx($dst$$XMMRegister, $src$$XMMRegister, $xtmp1$$XMMRegister, + $xtmp2$$XMMRegister, $xtmp3$$XMMRegister, $xtmp4$$XMMRegister, + ExternalAddress(vector_float_signflip()), $scratch$$Register, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + +instruct vcastFtoI_reg_evex(vec dst, vec src, vec xtmp1, vec xtmp2, kReg ktmp1, kReg ktmp2, rRegP scratch, rFlagsReg cr) %{ + predicate((VM_Version::supports_avx512vl() || + Matcher::vector_length_in_bytes(n) == 64) && + Matcher::vector_element_basic_type(n) == T_INT); + match(Set dst (VectorCastF2X src)); + effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP ktmp1, TEMP ktmp2, TEMP scratch, KILL cr); + format %{ "vector_cast_f2i $dst,$src\t! using $xtmp1, $xtmp2, $ktmp1 and $ktmp2 as TEMP" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + __ vector_castF2I_evex($dst$$XMMRegister, $src$$XMMRegister, $xtmp1$$XMMRegister, + $xtmp2$$XMMRegister, $ktmp1$$KRegister, $ktmp2$$KRegister, + ExternalAddress(vector_float_signflip()), $scratch$$Register, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + instruct vcastDtoF_reg(vec dst, vec src) %{ predicate(Matcher::vector_element_basic_type(n) == T_FLOAT); match(Set dst (VectorCastD2X src)); @@ -7176,6 +7216,20 @@ instruct vcastDtoF_reg(vec dst, vec src) %{ ins_pipe( pipe_slow ); %} +instruct vcastDtoL_reg_evex(vec dst, vec src, vec xtmp1, vec xtmp2, kReg ktmp1, kReg ktmp2, rRegP scratch, rFlagsReg cr) %{ + predicate(Matcher::vector_element_basic_type(n) == T_LONG); + match(Set dst (VectorCastD2X src)); + effect(TEMP dst, TEMP xtmp1, TEMP xtmp2, TEMP ktmp1, TEMP ktmp2, TEMP scratch, KILL cr); + format %{ "vector_cast_d2l $dst,$src\t! using $xtmp1, $xtmp2, $ktmp1 and $ktmp2 as TEMP" %} + ins_encode %{ + int vlen_enc = vector_length_encoding(this); + __ vector_castD2L_evex($dst$$XMMRegister, $src$$XMMRegister, $xtmp1$$XMMRegister, + $xtmp2$$XMMRegister, $ktmp1$$KRegister, $ktmp2$$KRegister, + ExternalAddress(vector_double_signflip()), $scratch$$Register, vlen_enc); + %} + ins_pipe( pipe_slow ); +%} + // --------------------------------- VectorMaskCmp -------------------------------------- instruct vcmpFD(legVec dst, legVec src1, legVec src2, immI8 cond) %{ -- GitLab From 24e16ac637095d7dee1d6fe34f996b68eedfa8bc Mon Sep 17 00:00:00 2001 From: Sandhya Viswanathan Date: Fri, 3 Dec 2021 21:06:16 +0000 Subject: [PATCH 610/890] 8277617: Adjust AVX3Threshold for copy/fill stubs Reviewed-by: jbhateja, dholmes, neliasso, jiefu --- src/hotspot/cpu/x86/macroAssembler_x86.cpp | 13 +++++++------ .../cpu/x86/macroAssembler_x86_arrayCopy_avx3.cpp | 2 +- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 15 ++++++++------- src/hotspot/cpu/x86/vm_version_x86.cpp | 11 +++++++++++ src/hotspot/cpu/x86/vm_version_x86.hpp | 2 ++ 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index a81e0941ac4..36f48006974 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -5021,7 +5021,7 @@ void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, X // cnt - number of qwords (8-byte words). // base - start address, qword aligned. Label L_zero_64_bytes, L_loop, L_sloop, L_tail, L_end; - bool use64byteVector = MaxVectorSize == 64 && AVX3Threshold == 0; + bool use64byteVector = (MaxVectorSize == 64) && (VM_Version::avx3_threshold() == 0); if (use64byteVector) { vpxor(xtmp, xtmp, xtmp, AVX_512bit); } else if (MaxVectorSize >= 32) { @@ -5085,7 +5085,7 @@ void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, X // Clearing constant sized memory using YMM/ZMM registers. void MacroAssembler::clear_mem(Register base, int cnt, Register rtmp, XMMRegister xtmp, KRegister mask) { assert(UseAVX > 2 && VM_Version::supports_avx512vlbw(), ""); - bool use64byteVector = MaxVectorSize > 32 && AVX3Threshold == 0; + bool use64byteVector = (MaxVectorSize > 32) && (VM_Version::avx3_threshold() == 0); int vector64_count = (cnt & (~0x7)) >> 3; cnt = cnt & 0x7; @@ -5328,8 +5328,8 @@ void MacroAssembler::generate_fill(BasicType t, bool aligned, // Fill 64-byte chunks Label L_fill_64_bytes_loop_avx3, L_check_fill_64_bytes_avx2; - // If number of bytes to fill < AVX3Threshold, perform fill using AVX2 - cmpl(count, AVX3Threshold); + // If number of bytes to fill < VM_Version::avx3_threshold(), perform fill using AVX2 + cmpl(count, VM_Version::avx3_threshold()); jccb(Assembler::below, L_check_fill_64_bytes_avx2); vpbroadcastd(xtmp, xtmp, Assembler::AVX_512bit); @@ -8717,6 +8717,7 @@ void MacroAssembler::generate_fill_avx3(BasicType type, Register to, Register va Label L_fill_zmm_sequence; int shift = -1; + int avx3threshold = VM_Version::avx3_threshold(); switch(type) { case T_BYTE: shift = 0; break; @@ -8732,10 +8733,10 @@ void MacroAssembler::generate_fill_avx3(BasicType type, Register to, Register va fatal("Unhandled type: %s\n", type2name(type)); } - if (AVX3Threshold != 0 || MaxVectorSize == 32) { + if ((avx3threshold != 0) || (MaxVectorSize == 32)) { if (MaxVectorSize == 64) { - cmpq(count, AVX3Threshold >> shift); + cmpq(count, avx3threshold >> shift); jcc(Assembler::greater, L_fill_zmm_sequence); } diff --git a/src/hotspot/cpu/x86/macroAssembler_x86_arrayCopy_avx3.cpp b/src/hotspot/cpu/x86/macroAssembler_x86_arrayCopy_avx3.cpp index cbf4db8966b..79ff020a54d 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86_arrayCopy_avx3.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86_arrayCopy_avx3.cpp @@ -114,7 +114,7 @@ void MacroAssembler::arraycopy_avx3_special_cases_conjoint(XMMRegister xmm, KReg bool use64byteVector, Label& L_entry, Label& L_exit) { Label L_entry_64, L_entry_96, L_entry_128; Label L_entry_160, L_entry_192; - bool avx3 = MaxVectorSize > 32 && AVX3Threshold == 0; + bool avx3 = (MaxVectorSize > 32) && (VM_Version::avx3_threshold() == 0); int size_mat[][6] = { /* T_BYTE */ {32 , 64, 96 , 128 , 160 , 192 }, diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 9e08504b117..e80d105bc36 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -1384,8 +1384,8 @@ class StubGenerator: public StubCodeGenerator { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); - - bool use64byteVector = MaxVectorSize > 32 && AVX3Threshold == 0; + int avx3threshold = VM_Version::avx3_threshold(); + bool use64byteVector = (MaxVectorSize > 32) && (avx3threshold == 0); Label L_main_loop, L_main_loop_64bytes, L_tail, L_tail64, L_exit, L_entry; Label L_repmovs, L_main_pre_loop, L_main_pre_loop_64bytes, L_pre_main_post_64; const Register from = rdi; // source array address @@ -1448,7 +1448,7 @@ class StubGenerator: public StubCodeGenerator { // PRE-MAIN-POST loop for aligned copy. __ BIND(L_entry); - if (AVX3Threshold != 0) { + if (avx3threshold != 0) { __ cmpq(count, threshold[shift]); if (MaxVectorSize == 64) { // Copy using 64 byte vectors. @@ -1460,7 +1460,7 @@ class StubGenerator: public StubCodeGenerator { } } - if (MaxVectorSize < 64 || AVX3Threshold != 0) { + if ((MaxVectorSize < 64) || (avx3threshold != 0)) { // Partial copy to make dst address 32 byte aligned. __ movq(temp2, to); __ andq(temp2, 31); @@ -1603,7 +1603,8 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); - bool use64byteVector = MaxVectorSize > 32 && AVX3Threshold == 0; + int avx3threshold = VM_Version::avx3_threshold(); + bool use64byteVector = (MaxVectorSize > 32) && (avx3threshold == 0); Label L_main_pre_loop, L_main_pre_loop_64bytes, L_pre_main_post_64; Label L_main_loop, L_main_loop_64bytes, L_tail, L_tail64, L_exit, L_entry; @@ -1668,12 +1669,12 @@ class StubGenerator: public StubCodeGenerator { // PRE-MAIN-POST loop for aligned copy. __ BIND(L_entry); - if (MaxVectorSize > 32 && AVX3Threshold != 0) { + if ((MaxVectorSize > 32) && (avx3threshold != 0)) { __ cmpq(temp1, threshold[shift]); __ jcc(Assembler::greaterEqual, L_pre_main_post_64); } - if (MaxVectorSize < 64 || AVX3Threshold != 0) { + if ((MaxVectorSize < 64) || (avx3threshold != 0)) { // Partial copy to make dst address 32 byte aligned. __ leaq(temp2, Address(to, temp1, (Address::ScaleFactor)(shift), 0)); __ andq(temp2, 31); diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp index 605faf89f19..e20a1c2bae1 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_x86.cpp @@ -1878,6 +1878,17 @@ void VM_Version::check_virtualizations() { } } +// avx3_threshold() sets the threshold at which 64-byte instructions are used +// for implementing the array copy and clear operations. +// The Intel platforms that supports the serialize instruction +// has improved implementation of 64-byte load/stores and so the default +// threshold is set to 0 for these platforms. +int VM_Version::avx3_threshold() { + return (is_intel_family_core() && + supports_serialize() && + FLAG_IS_DEFAULT(AVX3Threshold)) ? 0 : AVX3Threshold; +} + void VM_Version::initialize() { ResourceMark rm; // Making this stub must be FIRST use of assembler diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index 6feb3b8c1a0..d32daec89fb 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -911,6 +911,8 @@ public: static bool is_intel_skylake() { return is_intel_family_core() && extended_cpu_model() == CPU_MODEL_SKYLAKE; } + static int avx3_threshold(); + static bool is_intel_tsc_synched_at_init() { if (is_intel_family_core()) { uint32_t ext_model = extended_cpu_model(); -- GitLab From 02ee337ae0d163ae44b1691eb9de12c5608ba178 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Sat, 4 Dec 2021 02:12:35 +0000 Subject: [PATCH 611/890] 8278175: Enable all doclint warnings for build of java.desktop Reviewed-by: erikj, prr --- make/modules/java.desktop/Java.gmk | 4 ++-- .../share/classes/java/awt/BufferCapabilities.java | 3 ++- src/java.desktop/share/classes/java/awt/Component.java | 1 + src/java.desktop/share/classes/java/awt/event/KeyEvent.java | 1 + .../java/beans/beancontext/BeanContextServicesSupport.java | 2 +- .../classes/java/beans/beancontext/BeanContextSupport.java | 1 + .../share/classes/javax/swing/DefaultListSelectionModel.java | 3 ++- src/java.desktop/share/classes/javax/swing/JApplet.java | 3 ++- src/java.desktop/share/classes/javax/swing/JDialog.java | 5 +++-- src/java.desktop/share/classes/javax/swing/JScrollBar.java | 3 ++- .../classes/javax/swing/filechooser/FileSystemView.java | 2 +- .../classes/javax/swing/plaf/basic/BasicMenuItemUI.java | 1 + .../share/classes/javax/swing/plaf/basic/BasicMenuUI.java | 1 + .../share/classes/javax/swing/plaf/metal/MetalBorders.java | 4 ++-- .../share/classes/javax/swing/text/LayeredHighlighter.java | 3 ++- .../share/classes/javax/swing/text/html/HTML.java | 1 + .../share/classes/javax/swing/text/html/HTMLEditorKit.java | 3 ++- .../classes/javax/swing/text/html/parser/AttributeList.java | 5 +++-- .../share/classes/javax/swing/text/html/parser/Parser.java | 3 ++- .../share/classes/javax/swing/undo/UndoableEditSupport.java | 3 ++- 20 files changed, 34 insertions(+), 18 deletions(-) diff --git a/make/modules/java.desktop/Java.gmk b/make/modules/java.desktop/Java.gmk index e9f0d1fa318..a6d6cf80c1d 100644 --- a/make/modules/java.desktop/Java.gmk +++ b/make/modules/java.desktop/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,7 +23,7 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-reference,-missing \ +DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:java.*,javax.*' COPY += .gif .png .wav .txt .xml .css .pf CLEAN += iio-plugin.properties cursors.properties diff --git a/src/java.desktop/share/classes/java/awt/BufferCapabilities.java b/src/java.desktop/share/classes/java/awt/BufferCapabilities.java index 18c3d725b36..8d2288023b5 100644 --- a/src/java.desktop/share/classes/java/awt/BufferCapabilities.java +++ b/src/java.desktop/share/classes/java/awt/BufferCapabilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -33,6 +33,7 @@ package java.awt; * @author Michael Martak * @since 1.4 */ +@SuppressWarnings("doclint:missing") public class BufferCapabilities implements Cloneable { private ImageCapabilities frontCaps; diff --git a/src/java.desktop/share/classes/java/awt/Component.java b/src/java.desktop/share/classes/java/awt/Component.java index 22ec79a07b5..2378588b033 100644 --- a/src/java.desktop/share/classes/java/awt/Component.java +++ b/src/java.desktop/share/classes/java/awt/Component.java @@ -214,6 +214,7 @@ import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON; * @author Arthur van Hoff * @author Sami Shaio */ +@SuppressWarnings("doclint:missing") public abstract class Component implements ImageObserver, MenuContainer, Serializable { diff --git a/src/java.desktop/share/classes/java/awt/event/KeyEvent.java b/src/java.desktop/share/classes/java/awt/event/KeyEvent.java index 53b3bf9c9f1..f416719fd2e 100644 --- a/src/java.desktop/share/classes/java/awt/event/KeyEvent.java +++ b/src/java.desktop/share/classes/java/awt/event/KeyEvent.java @@ -151,6 +151,7 @@ import sun.awt.AWTAccessor; * * @since 1.1 */ +@SuppressWarnings("doclint:missing") public class KeyEvent extends InputEvent { /** diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java index 878c489e0f6..d3e6c6ea87a 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextServicesSupport.java @@ -54,7 +54,7 @@ import java.util.TooManyListenersException; * @author Laurence P. G. Cable * @since 1.2 */ - +@SuppressWarnings("doclint:missing") public class BeanContextServicesSupport extends BeanContextSupport implements BeanContextServices { diff --git a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java index 58e05f77084..e5e53db3dfe 100644 --- a/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java +++ b/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java @@ -59,6 +59,7 @@ import java.util.Map; * @author Laurence P. G. Cable * @since 1.2 */ +@SuppressWarnings("doclint:missing") public class BeanContextSupport extends BeanContextChildSupport implements BeanContext, Serializable, diff --git a/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java b/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java index 25e47c8b90b..1924df3123e 100644 --- a/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java +++ b/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java @@ -50,7 +50,8 @@ import javax.swing.event.*; * @see ListSelectionModel * @since 1.2 */ -@SuppressWarnings("serial") // Same-version serialization only +@SuppressWarnings({"serial", // Same-version serialization only + "doclint:missing"}) public class DefaultListSelectionModel implements ListSelectionModel, Cloneable, Serializable { private static final int MIN = -1; diff --git a/src/java.desktop/share/classes/javax/swing/JApplet.java b/src/java.desktop/share/classes/javax/swing/JApplet.java index d15fac15f66..a1ba64dcf0d 100644 --- a/src/java.desktop/share/classes/javax/swing/JApplet.java +++ b/src/java.desktop/share/classes/javax/swing/JApplet.java @@ -99,7 +99,8 @@ import javax.accessibility.AccessibleContext; @Deprecated(since = "9", forRemoval = true) @JavaBean(defaultProperty = "JMenuBar", description = "Swing's Applet subclass.") @SwingContainer(delegate = "getContentPane") -@SuppressWarnings({"serial", "removal"}) // Same-version serialization only +@SuppressWarnings({"serial", "removal", // Same-version serialization only + "doclint:missing"}) public class JApplet extends Applet implements Accessible, RootPaneContainer, TransferHandler.HasGetTransferHandler diff --git a/src/java.desktop/share/classes/javax/swing/JDialog.java b/src/java.desktop/share/classes/javax/swing/JDialog.java index 522c8dae0a0..97013e59a6b 100644 --- a/src/java.desktop/share/classes/javax/swing/JDialog.java +++ b/src/java.desktop/share/classes/javax/swing/JDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -95,7 +95,8 @@ import javax.accessibility.*; */ @JavaBean(defaultProperty = "JMenuBar", description = "A toplevel window for creating dialog boxes.") @SwingContainer(delegate = "getContentPane") -@SuppressWarnings("serial") // Same-version serialization only +@SuppressWarnings({"serial", // Same-version serialization only + "doclint:missing"}) public class JDialog extends Dialog implements WindowConstants, Accessible, RootPaneContainer, diff --git a/src/java.desktop/share/classes/javax/swing/JScrollBar.java b/src/java.desktop/share/classes/javax/swing/JScrollBar.java index df6e3e23b68..25cdb0886a9 100644 --- a/src/java.desktop/share/classes/javax/swing/JScrollBar.java +++ b/src/java.desktop/share/classes/javax/swing/JScrollBar.java @@ -83,7 +83,8 @@ import javax.swing.plaf.ScrollBarUI; */ @JavaBean(defaultProperty = "UI", description = "A component that helps determine the visible content range of an area.") @SwingContainer(false) -@SuppressWarnings("serial") // Same-version serialization only +@SuppressWarnings({"serial", // Same-version serialization only + "doclint:missing"}) public class JScrollBar extends JComponent implements Adjustable, Accessible { /** diff --git a/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java b/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java index 17a3b196b07..0f30ef14d88 100644 --- a/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java +++ b/src/java.desktop/share/classes/javax/swing/filechooser/FileSystemView.java @@ -65,7 +65,7 @@ import sun.awt.shell.ShellFolder; // PENDING(jeff) - need to provide a specification for // how Mac/OS2/BeOS/etc file systems can modify FileSystemView // to handle their particular type of file system. - +@SuppressWarnings("doclint:missing") public abstract class FileSystemView { static FileSystemView windowsFileSystemView = null; diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java index e2103468ab8..fa6a5312767 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -45,6 +45,7 @@ import sun.swing.*; * @author Arnaud Weber * @author Fredrik Lagerblad */ +@SuppressWarnings("doclint:missing") public class BasicMenuItemUI extends MenuItemUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 0d2b0fde15e..78727a729c4 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -46,6 +46,7 @@ import java.util.ArrayList; * @author David Karlton * @author Arnaud Weber */ +@SuppressWarnings("doclint:missing") public class BasicMenuUI extends BasicMenuItemUI { /** diff --git a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java index 56e7cf7a798..9513b723490 100644 --- a/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java +++ b/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -47,7 +47,7 @@ import sun.swing.SwingUtilities2; * Factory object that can vend Borders appropriate for the metal L & F. * @author Steve Wilson */ - +@SuppressWarnings("doclint:missing") public class MetalBorders { /** diff --git a/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java b/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java index 08291e71769..c50710233fc 100644 --- a/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java +++ b/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -33,6 +33,7 @@ import java.awt.Shape; * @author Timothy Prinzing * @see Highlighter */ +@SuppressWarnings("doclint:missing") public abstract class LayeredHighlighter implements Highlighter { /** * Constructor for subclasses to call. diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTML.java b/src/java.desktop/share/classes/javax/swing/text/html/HTML.java index d23b2753580..a27893d9fcc 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HTML.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTML.java @@ -43,6 +43,7 @@ import javax.swing.text.StyleContext; * @author Sunita Mani * */ +@SuppressWarnings("doclint:missing") public class HTML { /** diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java index 8b674af6552..c85989533f2 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java @@ -216,7 +216,8 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; * * @author Timothy Prinzing */ -@SuppressWarnings("serial") // Same-version serialization only +@SuppressWarnings({"serial", // Same-version serialization only + "doclint:missing"}) public class HTMLEditorKit extends StyledEditorKit implements Accessible { private JEditorPane theEditor; diff --git a/src/java.desktop/share/classes/javax/swing/text/html/parser/AttributeList.java b/src/java.desktop/share/classes/javax/swing/text/html/parser/AttributeList.java index 898e9367171..f57a7f2a917 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/parser/AttributeList.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/parser/AttributeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -44,7 +44,8 @@ import java.io.*; * @author Arthur Van Hoff * */ -@SuppressWarnings("serial") // Same-version serialization only +@SuppressWarnings({"serial", // Same-version serialization only + "doclint:missing"}) public final class AttributeList implements DTDConstants, Serializable { diff --git a/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java b/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java index 2a59e3b2163..fc7cac3cdc1 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2021, 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 @@ -75,6 +75,7 @@ import java.net.URL; * @author Arthur van Hoff * @author Sunita Mani */ +@SuppressWarnings("doclint:missing") public class Parser implements DTDConstants { diff --git a/src/java.desktop/share/classes/javax/swing/undo/UndoableEditSupport.java b/src/java.desktop/share/classes/javax/swing/undo/UndoableEditSupport.java index decd6afb9a0..5646222ecb1 100644 --- a/src/java.desktop/share/classes/javax/swing/undo/UndoableEditSupport.java +++ b/src/java.desktop/share/classes/javax/swing/undo/UndoableEditSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021, 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 @@ -33,6 +33,7 @@ import java.util.*; * * @author Ray Ryan */ +@SuppressWarnings("doclint:missing") public class UndoableEditSupport { /** * The update level. -- GitLab From 9642629d15d9631d8da9a3abdabc40323f3c774b Mon Sep 17 00:00:00 2001 From: Markus Karg Date: Sat, 4 Dec 2021 09:27:23 +0000 Subject: [PATCH 612/890] 8276779: (ch) InputStream returned by Channels.newInputStream should have fast path for SelectableChannels Reviewed-by: lancea, alanb --- .../classes/java/nio/channels/Channels.java | 9 +- .../sun/nio/ch/ChannelInputStream.java | 22 ++++- .../nio/channels/Channels/TransferTo.java | 90 ++++++++++++++++++- 3 files changed, 110 insertions(+), 11 deletions(-) diff --git a/src/java.base/share/classes/java/nio/channels/Channels.java b/src/java.base/share/classes/java/nio/channels/Channels.java index 2d1637c5369..3e68d49b2b7 100644 --- a/src/java.base/share/classes/java/nio/channels/Channels.java +++ b/src/java.base/share/classes/java/nio/channels/Channels.java @@ -69,9 +69,12 @@ public final class Channels { /** * Constructs a stream that reads bytes from the given channel. * - *

      The {@code read} methods of the resulting stream will throw an - * {@link IllegalBlockingModeException} if invoked while the underlying - * channel is in non-blocking mode. The stream will not be buffered, and + *

      The {@code read} and {@code transferTo} methods of the resulting stream + * will throw an {@link IllegalBlockingModeException} if invoked while the + * underlying channel is in non-blocking mode. The {@code transferTo} method + * will also throw an {@code IllegalBlockingModeException} if invoked to + * transfer bytes to an output stream that writes to an underlying channel in + * non-blocking mode. The stream will not be buffered, and * it will not support the {@link InputStream#mark mark} or {@link * InputStream#reset reset} methods. The stream will be safe for access by * multiple concurrent threads. Closing the stream will in turn cause the diff --git a/src/java.base/share/classes/sun/nio/ch/ChannelInputStream.java b/src/java.base/share/classes/sun/nio/ch/ChannelInputStream.java index 6f312cb9ed2..4ddd30485af 100644 --- a/src/java.base/share/classes/sun/nio/ch/ChannelInputStream.java +++ b/src/java.base/share/classes/sun/nio/ch/ChannelInputStream.java @@ -34,6 +34,7 @@ import java.nio.channels.IllegalBlockingModeException; import java.nio.channels.ReadableByteChannel; import java.nio.channels.SeekableByteChannel; import java.nio.channels.SelectableChannel; +import java.nio.channels.WritableByteChannel; import java.util.Arrays; import java.util.Objects; import jdk.internal.util.ArraysSupport; @@ -238,15 +239,28 @@ public class ChannelInputStream Objects.requireNonNull(out, "out"); if (out instanceof ChannelOutputStream cos - && ch instanceof FileChannel fc - && cos.channel() instanceof FileChannel dst) { - return transfer(fc, dst); + && ch instanceof FileChannel fc) { + WritableByteChannel wbc = cos.channel(); + + if (wbc instanceof FileChannel dst) { + return transfer(fc, dst); + } + + if (wbc instanceof SelectableChannel sc) { + synchronized (sc.blockingLock()) { + if (!sc.isBlocking()) + throw new IllegalBlockingModeException(); + return transfer(fc, wbc); + } + } + + return transfer(fc, wbc); } return super.transferTo(out); } - private static long transfer(FileChannel src, FileChannel dst) throws IOException { + private static long transfer(FileChannel src, WritableByteChannel dst) throws IOException { long initialPos = src.position(); long pos = initialPos; try { diff --git a/test/jdk/java/nio/channels/Channels/TransferTo.java b/test/jdk/java/nio/channels/Channels/TransferTo.java index 792419c2ff3..c75b9913e87 100644 --- a/test/jdk/java/nio/channels/Channels/TransferTo.java +++ b/test/jdk/java/nio/channels/Channels/TransferTo.java @@ -28,11 +28,19 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.channels.Channels; import java.nio.channels.FileChannel; +import java.nio.channels.IllegalBlockingModeException; +import java.nio.channels.Pipe; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.SelectableChannel; +import java.nio.channels.WritableByteChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.Arrays; import java.util.Random; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Supplier; @@ -70,6 +78,8 @@ public class TransferTo { private static final Random RND = RandomFactory.getRandom(); + private static final Path CWD = Path.of("."); + /* * Provides test scenarios, i. e. combinations of input and output streams to be tested. */ @@ -79,6 +89,12 @@ public class TransferTo { // tests FileChannel.transferTo(FileChannel) optimized case { fileChannelInput(), fileChannelOutput() }, + // tests FileChannel.transferTo(SelectableChannelOutput) optimized case + { fileChannelInput(), selectableChannelOutput() }, + + // tests FileChannel.transferTo(WritableChannelOutput) optimized case + { fileChannelInput(), writableByteChannelOutput() }, + // tests InputStream.transferTo(OutputStream) default case { readableByteChannelInput(), defaultOutput() } }; @@ -138,10 +154,10 @@ public class TransferTo { */ @Test public void testMoreThanTwoGB() throws IOException { - Path sourceFile = Files.createTempFile("test2GBSource", null); + Path sourceFile = Files.createTempFile(CWD, "test2GBSource", null); try { // preparing two temporary files which will be compared at the end of the test - Path targetFile = Files.createTempFile("test2GBtarget", null); + Path targetFile = Files.createTempFile(CWD, "test2GBtarget", null); try { // writing 3 GB of random bytes into source file for (int i = 0; i < NUM_WRITES; i++) @@ -169,6 +185,37 @@ public class TransferTo { } } + /* + * Special test whether selectable channel based transfer throws blocking mode exception. + */ + @Test + public void testIllegalBlockingMode() throws IOException { + Pipe pipe = Pipe.open(); + try { + // testing arbitrary input (here: empty file) to non-blocking selectable output + try (FileChannel fc = FileChannel.open(Files.createTempFile(CWD, "testIllegalBlockingMode", null)); + InputStream is = Channels.newInputStream(fc); + SelectableChannel sc = pipe.sink().configureBlocking(false); + OutputStream os = Channels.newOutputStream((WritableByteChannel) sc)) { + + // IllegalBlockingMode must be thrown when trying to perform a transfer + assertThrows(IllegalBlockingModeException.class, () -> is.transferTo(os)); + } + + // testing non-blocking selectable input to arbitrary output (here: byte array) + try (SelectableChannel sc = pipe.source().configureBlocking(false); + InputStream is = Channels.newInputStream((ReadableByteChannel) sc); + OutputStream os = new ByteArrayOutputStream()) { + + // IllegalBlockingMode must be thrown when trying to perform a transfer + assertThrows(IllegalBlockingModeException.class, () -> is.transferTo(os)); + } + } finally { + pipe.source().close(); + pipe.sink().close(); + } + } + /* * Asserts that the transferred content is correct, i. e. compares the actually transferred bytes * to the expected assumption. The position of the input and output stream before the transfer is @@ -242,7 +289,7 @@ public class TransferTo { return new InputStreamProvider() { @Override public InputStream input(byte... bytes) throws Exception { - Path path = Files.createTempFile(null, null); + Path path = Files.createTempFile(CWD, "fileChannelInput", null); Files.write(path, bytes); FileChannel fileChannel = FileChannel.open(path); return Channels.newInputStream(fileChannel); @@ -268,7 +315,7 @@ public class TransferTo { private static OutputStreamProvider fileChannelOutput() { return new OutputStreamProvider() { public OutputStream output(Consumer> spy) throws Exception { - Path path = Files.createTempFile(null, null); + Path path = Files.createTempFile(CWD, "fileChannelOutput", null); FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.WRITE); spy.accept(() -> { try { @@ -282,4 +329,39 @@ public class TransferTo { }; } + private static OutputStreamProvider selectableChannelOutput() throws IOException { + return new OutputStreamProvider() { + public OutputStream output(Consumer> spy) throws Exception { + Pipe pipe = Pipe.open(); + Future bytes = CompletableFuture.supplyAsync(() -> { + try { + InputStream is = Channels.newInputStream(pipe.source()); + return is.readAllBytes(); + } catch (IOException e) { + throw new AssertionError("Exception while asserting content", e); + } + }); + final OutputStream os = Channels.newOutputStream(pipe.sink()); + spy.accept(() -> { + try { + os.close(); + return bytes.get(); + } catch (IOException | InterruptedException | ExecutionException e) { + throw new AssertionError("Exception while asserting content", e); + } + }); + return os; + } + }; + } + + private static OutputStreamProvider writableByteChannelOutput() { + return new OutputStreamProvider() { + public OutputStream output(Consumer> spy) throws Exception { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + spy.accept(outputStream::toByteArray); + return Channels.newOutputStream(Channels.newChannel(outputStream)); + } + }; + } } -- GitLab From 267c024eb52acd1611188dd5b1417b877ff3eafd Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Sat, 4 Dec 2021 13:05:06 +0000 Subject: [PATCH 613/890] 8265150: AsyncGetCallTrace crashes on ResourceMark Reviewed-by: dholmes, stuefe, eosterlund, sspitsyn --- src/hotspot/share/oops/method.cpp | 13 +++++-------- src/hotspot/share/prims/jvmtiEnvBase.cpp | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index 5991d385231..830b539997b 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.cpp @@ -324,14 +324,11 @@ int Method::bci_from(address bcp) const { if (is_native() && bcp == 0) { return 0; } -#ifdef ASSERT - { - ResourceMark rm; - assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(), - "bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s", - p2i(bcp), name_and_sig_as_C_string()); - } -#endif + // Do not have a ResourceMark here because AsyncGetCallTrace stack walking code + // may call this after interrupting a nested ResourceMark. + assert(is_native() && bcp == code_base() || contains(bcp) || VMError::is_error_reported(), + "bcp doesn't belong to this method. bcp: " INTPTR_FORMAT, p2i(bcp)); + return bcp - code_base(); } diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index 0068ea05169..10e08801124 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -829,7 +829,7 @@ JvmtiEnvBase::get_stack_trace(JavaThread *java_thread, "call by myself / at safepoint / at handshake"); int count = 0; if (java_thread->has_last_Java_frame()) { - RegisterMap reg_map(java_thread); + RegisterMap reg_map(java_thread, false /* update_map */, false /* process_frames */); ResourceMark rm(current_thread); javaVFrame *jvf = java_thread->last_java_vframe(®_map); HandleMark hm(current_thread); -- GitLab From 839b6067c85cfc260803af9b01dd1e7e7f8388db Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Sun, 5 Dec 2021 21:38:45 +0000 Subject: [PATCH 614/890] 8278143: Remove unused "argc" from ConstantPool::copy_bootstrap_arguments_at_impl Reviewed-by: lfoltan, dholmes --- src/hotspot/share/oops/constantPool.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/oops/constantPool.cpp b/src/hotspot/share/oops/constantPool.cpp index 68fb0c70171..1ff1abbb57d 100644 --- a/src/hotspot/share/oops/constantPool.cpp +++ b/src/hotspot/share/oops/constantPool.cpp @@ -1178,16 +1178,15 @@ void ConstantPool::copy_bootstrap_arguments_at_impl(const constantPoolHandle& th objArrayHandle info, int pos, bool must_resolve, Handle if_not_available, TRAPS) { - int argc; int limit = pos + end_arg - start_arg; // checks: index in range [0..this_cp->length), - // tag at index, start..end in range [0..argc], + // tag at index, start..end in range [0..this_cp->bootstrap_argument_count], // info array non-null, pos..limit in [0..info.length] if ((0 >= index || index >= this_cp->length()) || !(this_cp->tag_at(index).is_invoke_dynamic() || this_cp->tag_at(index).is_dynamic_constant()) || (0 > start_arg || start_arg > end_arg) || - (end_arg > (argc = this_cp->bootstrap_argument_count_at(index))) || + (end_arg > this_cp->bootstrap_argument_count_at(index)) || (0 > pos || pos > limit) || (info.is_null() || limit > info->length())) { // An index or something else went wrong; throw an error. -- GitLab From 104aa1f7f9f212318113e304e16e185a6acbec6c Mon Sep 17 00:00:00 2001 From: Srikanth Adayapalam Date: Mon, 6 Dec 2021 06:24:56 +0000 Subject: [PATCH 615/890] 8268575: Annotations not visible on model elements before they are generated Reviewed-by: mcimadamore --- .../com/sun/tools/javac/comp/Annotate.java | 2 +- .../javac/processing/8268575/Processor.java | 79 +++++++++++++++++++ .../javac/processing/8268575/T8268575.java | 34 ++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 test/langtools/tools/javac/processing/8268575/Processor.java create mode 100644 test/langtools/tools/javac/processing/8268575/T8268575.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java index 2561ae38f29..fdf91e6f423 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java @@ -345,7 +345,7 @@ public class Annotate { Assert.checkNonNull(c, "Failed to create annotation"); - if (a.type.tsym.isAnnotationType()) { + if (a.type.isErroneous() || a.type.tsym.isAnnotationType()) { if (annotated.containsKey(a.type.tsym)) { if (!allowRepeatedAnnos) { log.error(DiagnosticFlag.SOURCE_LEVEL, a.pos(), Feature.REPEATED_ANNOTATIONS.error(sourceName)); diff --git a/test/langtools/tools/javac/processing/8268575/Processor.java b/test/langtools/tools/javac/processing/8268575/Processor.java new file mode 100644 index 00000000000..8640c292303 --- /dev/null +++ b/test/langtools/tools/javac/processing/8268575/Processor.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021, 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.IOException; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.util.Set; +import javax.annotation.processing.AbstractProcessor; +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.ExecutableElement; +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.TypeElement; +import javax.lang.model.element.VariableElement; +import javax.tools.Diagnostic.Kind; +import javax.tools.JavaFileObject; +import java.util.List; + +@SupportedAnnotationTypes("*") +public class Processor extends AbstractProcessor { + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + int round = 1; + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + processingEnv.getMessager().printMessage(Kind.NOTE, "round " + round); + Element t = processingEnv.getElementUtils().getTypeElement("T8268575"); + for (Element e : t.getEnclosedElements()) { + if (e instanceof ExecutableElement) { + for (VariableElement p : ((ExecutableElement) e).getParameters()) { + List annos = p.getAnnotationMirrors(); + if (annos.size() != 1) { + throw new RuntimeException("Missing annotation in round " + round); + } + } + } + } + if (round == 1) { + String name = "A"; + try { + JavaFileObject jfo = processingEnv.getFiler().createSourceFile(name); + try (Writer w = jfo.openWriter()) { + w.write("@interface " + name + " {}"); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + round++; + return false; + } +} diff --git a/test/langtools/tools/javac/processing/8268575/T8268575.java b/test/langtools/tools/javac/processing/8268575/T8268575.java new file mode 100644 index 00000000000..9233dbe55d1 --- /dev/null +++ b/test/langtools/tools/javac/processing/8268575/T8268575.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021, 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 8268575 + * @summary Annotations not visible on model elements before they are generated + * @build Processor + * @compile -processor Processor T8268575.java + */ + +class T8268575 { + void f(@A int x) {} +} -- GitLab From f180a4591f52d0af0c030aa85be33c51b06c90ee Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 6 Dec 2021 06:26:50 +0000 Subject: [PATCH 616/890] 8278016: Add compiler tests to tier{2,3} Reviewed-by: kvn, dholmes --- test/hotspot/jtreg/TEST.groups | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index c2d58ee5d47..9ca2a042577 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -173,6 +173,50 @@ tier1_compiler_3 = \ -compiler/loopopts/Test7052494.java \ -compiler/runtime/Test6826736.java +tier2_compiler = \ + compiler/allocation/ \ + compiler/arguments/ \ + compiler/calls/ \ + compiler/cha/ \ + compiler/controldependency/ \ + compiler/conversions/ \ + compiler/codegen/ \ + compiler/linkage/ \ + compiler/loopstripmining/ \ + compiler/loopopts/Test7052494.java \ + compiler/longcountedloops/ \ + compiler/intrinsics/bmi \ + compiler/intrinsics/mathexact \ + compiler/intrinsics/sha \ + compiler/intrinsics/bigInteger/TestMultiplyToLen.java \ + compiler/intrinsics/zip/TestAdler32.java \ + compiler/membars/ \ + compiler/onSpinWait/ \ + compiler/parsing/ \ + compiler/rangechecks/ \ + compiler/reflection/ \ + compiler/rtm/ \ + compiler/runtime/Test6826736.java \ + compiler/stable/ \ + compiler/stringopts/ \ + -:tier1_compiler \ + -:hotspot_slow_compiler + +tier3_compiler = \ + compiler/c2/ \ + compiler/ciReplay/ \ + compiler/compilercontrol/ \ + compiler/debug/ \ + compiler/oracle/ \ + compiler/print/ \ + compiler/relocations/ \ + compiler/tiered/ \ + compiler/vectorapi/ \ + compiler/whitebox/ \ + :hotspot_slow_compiler \ + -:tier1_compiler \ + -:tier2_compiler + tier1_compiler_not_xcomp = \ compiler/profiling @@ -468,11 +512,13 @@ tier2 = \ :hotspot_tier2_runtime \ :hotspot_tier2_runtime_platform_agnostic \ :hotspot_tier2_serviceability \ + :tier2_compiler \ :tier2_gc_epsilon \ :tier2_gc_shenandoah tier3 = \ :hotspot_tier3_runtime \ + :tier3_compiler \ :tier3_gc_shenandoah # Everything that is not in other tiers, but not apps -- GitLab From f39fe5b3d629c6d557eb7bab8d1ff81350c616cc Mon Sep 17 00:00:00 2001 From: Tobias Holenstein Date: Mon, 6 Dec 2021 08:23:49 +0000 Subject: [PATCH 617/890] 8154011: Make TraceDeoptimization a diagnostic flag Reviewed-by: kvn, dholmes, thartmann --- src/hotspot/share/runtime/globals.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 45f16aefa1f..ded9a1fe93a 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1280,7 +1280,7 @@ const intx ObjectAlignmentInBytes = 8; constraint(AllocatePrefetchInstrConstraintFunc, AfterMemoryInit) \ \ /* deoptimization */ \ - develop(bool, TraceDeoptimization, false, \ + product(bool, TraceDeoptimization, false, DIAGNOSTIC, \ "Trace deoptimization") \ \ develop(bool, PrintDeoptimizationDetails, false, \ -- GitLab From 194cdf4e28225133dcdf29cf1bf4e580f3fd9208 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 6 Dec 2021 08:42:26 +0000 Subject: [PATCH 618/890] 8277864: Compilation error thrown while doing a boxing conversion on selector expression Reviewed-by: jlaskey, vromero --- .../com/sun/tools/javac/comp/TransPatterns.java | 5 +++-- test/langtools/tools/javac/patterns/Switches.java | 13 ++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java index f3f304659ed..56fdc73e02e 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java @@ -347,8 +347,9 @@ public class TransPatterns extends TreeTranslator { } } selector = translate(selector); - statements.append(make.at(tree.pos).VarDef(temp, !hasNullCase ? attr.makeNullCheck(selector) - : selector)); + boolean needsNullCheck = !hasNullCase && !seltype.isPrimitive(); + statements.append(make.at(tree.pos).VarDef(temp, needsNullCheck ? attr.makeNullCheck(selector) + : selector)); VarSymbol index = new VarSymbol(Flags.SYNTHETIC, names.fromString(tree.pos + target.syntheticNameChar() + "index"), syms.intType, diff --git a/test/langtools/tools/javac/patterns/Switches.java b/test/langtools/tools/javac/patterns/Switches.java index 714c7973140..e4c1bd6edb4 100644 --- a/test/langtools/tools/javac/patterns/Switches.java +++ b/test/langtools/tools/javac/patterns/Switches.java @@ -28,7 +28,7 @@ import java.util.function.Function; /* * @test - * @bug 8262891 8268333 8268896 8269802 8269808 8270151 8269113 + * @bug 8262891 8268333 8268896 8269802 8269808 8270151 8269113 8277864 * @summary Check behavior of pattern switches. * @compile --enable-preview -source ${jdk.version} Switches.java * @run main/othervm --enable-preview Switches @@ -85,6 +85,9 @@ public class Switches { assertEquals(2, switchOverNull1()); assertEquals(2, switchOverNull2()); assertEquals(2, switchOverNull3()); + assertEquals(5, switchOverPrimitiveInt(0)); + assertEquals(7, switchOverPrimitiveInt(1)); + assertEquals(9, switchOverPrimitiveInt(2)); } void run(Function mapper) { @@ -591,6 +594,14 @@ public class Switches { }; } + private int switchOverPrimitiveInt(Integer i) { + return switch (i) { + case 0 -> 5 + 0; + case Integer j && j == 1 -> 6 + j; + case Integer j -> 7 + j; + }; + } + //verify that for cases like: //case ConstantClassClash -> //ConstantClassClash is interpreted as a field, not as a class -- GitLab From 8d190dd003c58aa9ebb403e95a73a128af7e8941 Mon Sep 17 00:00:00 2001 From: Ludvig Janiuk Date: Mon, 6 Dec 2021 08:58:41 +0000 Subject: [PATCH 619/890] 8277496: Remove duplication in c1 Block successor lists Reviewed-by: neliasso, kvn --- src/hotspot/share/c1/c1_CFGPrinter.cpp | 12 +-- src/hotspot/share/c1/c1_GraphBuilder.cpp | 71 +++++++++++++++-- src/hotspot/share/c1/c1_IR.cpp | 11 +++ src/hotspot/share/c1/c1_Instruction.cpp | 76 +++---------------- src/hotspot/share/c1/c1_Instruction.hpp | 22 ++---- .../share/c1/c1_InstructionPrinter.cpp | 9 +-- src/hotspot/share/c1/c1_LIR.cpp | 2 +- src/hotspot/share/c1/c1_Optimizer.cpp | 23 +++++- 8 files changed, 121 insertions(+), 105 deletions(-) diff --git a/src/hotspot/share/c1/c1_CFGPrinter.cpp b/src/hotspot/share/c1/c1_CFGPrinter.cpp index 9cd617d5428..73a1d2d649e 100644 --- a/src/hotspot/share/c1/c1_CFGPrinter.cpp +++ b/src/hotspot/share/c1/c1_CFGPrinter.cpp @@ -231,9 +231,7 @@ void CFGPrinterOutput::print_LIR(BlockBegin* block) { void CFGPrinterOutput::print_block(BlockBegin* block) { print_begin("block"); - print("name \"B%d\"", block->block_id()); - print("from_bci %d", block->bci()); print("to_bci %d", (block->end() == NULL ? -1 : block->end()->printable_bci())); @@ -246,9 +244,13 @@ void CFGPrinterOutput::print_block(BlockBegin* block) { output()->cr(); output()->indent(); - output()->print("successors "); - for (i = 0; i < block->number_of_sux(); i++) { - output()->print("\"B%d\" ", block->sux_at(i)->block_id()); + if (block->end() != NULL) { + output()->print("successors "); + for (i = 0; i < block->number_of_sux(); i++) { + output()->print("\"B%d\" ", block->sux_at(i)->block_id()); + } + } else { + output()->print("(block has no end, cannot print successors)"); } output()->cr(); diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index 2c10642f8ad..2f9355f1099 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.cpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp @@ -53,6 +53,7 @@ class BlockListBuilder { BlockList _blocks; // internal list of all blocks BlockList* _bci2block; // mapping from bci to blocks for GraphBuilder + GrowableArray _bci2block_successors; // Mapping bcis to their blocks successors while we dont have a blockend // fields used by mark_loops ResourceBitMap _active; // for iteration of control flow graph @@ -89,6 +90,11 @@ class BlockListBuilder { void print(); #endif + int number_of_successors(BlockBegin* block); + BlockBegin* successor_at(BlockBegin* block, int i); + void add_successor(BlockBegin* block, BlockBegin* sux); + bool is_successor(BlockBegin* block, BlockBegin* sux); + public: // creation BlockListBuilder(Compilation* compilation, IRScope* scope, int osr_bci); @@ -105,6 +111,7 @@ BlockListBuilder::BlockListBuilder(Compilation* compilation, IRScope* scope, int , _scope(scope) , _blocks(16) , _bci2block(new BlockList(scope->method()->code_size(), NULL)) + , _bci2block_successors(scope->method()->code_size()) , _active() // size not known yet , _visited() // size not known yet , _loop_map() // size not known yet @@ -118,6 +125,8 @@ BlockListBuilder::BlockListBuilder(Compilation* compilation, IRScope* scope, int mark_loops(); NOT_PRODUCT(if (PrintInitialBlockList) print()); + // _bci2block still contains blocks with _end == null and > 0 sux in _bci2block_successors. + #ifndef PRODUCT if (PrintCFGToFile) { stringStream title; @@ -160,6 +169,7 @@ BlockBegin* BlockListBuilder::make_block_at(int cur_bci, BlockBegin* predecessor block = new BlockBegin(cur_bci); block->init_stores_to_locals(method()->max_locals()); _bci2block->at_put(cur_bci, block); + _bci2block_successors.at_put_grow(cur_bci, BlockList()); _blocks.append(block); assert(predecessor == NULL || predecessor->bci() < cur_bci, "targets for backward branches must already exist"); @@ -170,7 +180,7 @@ BlockBegin* BlockListBuilder::make_block_at(int cur_bci, BlockBegin* predecessor BAILOUT_("Exception handler can be reached by both normal and exceptional control flow", block); } - predecessor->add_successor(block); + add_successor(predecessor, block); block->increment_total_preds(); } @@ -201,8 +211,8 @@ void BlockListBuilder::handle_exceptions(BlockBegin* current, int cur_bci) { assert(entry->is_set(BlockBegin::exception_entry_flag), "flag must be set"); // add each exception handler only once - if (!current->is_successor(entry)) { - current->add_successor(entry); + if(!is_successor(current, entry)) { + add_successor(current, entry); entry->increment_total_preds(); } @@ -418,9 +428,9 @@ int BlockListBuilder::mark_loops(BlockBegin* block, bool in_subroutine) { _active.set_bit(block_id); intptr_t loop_state = 0; - for (int i = block->number_of_sux() - 1; i >= 0; i--) { + for (int i = number_of_successors(block) - 1; i >= 0; i--) { // recursively process all successors - loop_state |= mark_loops(block->sux_at(i), in_subroutine); + loop_state |= mark_loops(successor_at(block, i), in_subroutine); } // clear active-bit after all successors are processed @@ -452,6 +462,28 @@ int BlockListBuilder::mark_loops(BlockBegin* block, bool in_subroutine) { return loop_state; } +inline int BlockListBuilder::number_of_successors(BlockBegin* block) +{ + assert(_bci2block_successors.length() > block->bci(), "sux must exist"); + return _bci2block_successors.at(block->bci()).length(); +} + +inline BlockBegin* BlockListBuilder::successor_at(BlockBegin* block, int i) +{ + assert(_bci2block_successors.length() > block->bci(), "sux must exist"); + return _bci2block_successors.at(block->bci()).at(i); +} + +inline void BlockListBuilder::add_successor(BlockBegin* block, BlockBegin* sux) +{ + assert(_bci2block_successors.length() > block->bci(), "sux must exist"); + _bci2block_successors.at(block->bci()).append(sux); +} + +inline bool BlockListBuilder::is_successor(BlockBegin* block, BlockBegin* sux) { + assert(_bci2block_successors.length() > block->bci(), "sux must exist"); + return _bci2block_successors.at(block->bci()).contains(sux); +} #ifndef PRODUCT @@ -477,10 +509,10 @@ void BlockListBuilder::print() { tty->print(cur->is_set(BlockBegin::subroutine_entry_flag) ? " sr" : " "); tty->print(cur->is_set(BlockBegin::parser_loop_header_flag) ? " lh" : " "); - if (cur->number_of_sux() > 0) { + if (number_of_successors(cur) > 0) { tty->print(" sux: "); - for (int j = 0; j < cur->number_of_sux(); j++) { - BlockBegin* sux = cur->sux_at(j); + for (int j = 0; j < number_of_successors(cur); j++) { + BlockBegin* sux = successor_at(cur, j); tty->print("B%d ", sux->block_id()); } } @@ -3230,6 +3262,8 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) _initial_state = state_at_entry(); start_block->merge(_initial_state); + // End nulls still exist here + // complete graph _vmap = new ValueMap(); switch (scope->method()->intrinsic_id()) { @@ -3333,6 +3367,27 @@ GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope) } CHECK_BAILOUT(); +# ifdef ASSERT + //All blocks reachable from start_block have _end != NULL + { + BlockList processed; + BlockList to_go; + to_go.append(start_block); + while(to_go.length() > 0) { + BlockBegin* current = to_go.pop(); + assert(current != NULL, "Should not happen."); + assert(current->end() != NULL, "All blocks reachable from start_block should have end() != NULL."); + processed.append(current); + for(int i = 0; i < current->number_of_sux(); i++) { + BlockBegin* s = current->sux_at(i); + if (!processed.contains(s)) { + to_go.append(s); + } + } + } + } +#endif // ASSERT + _start = setup_start_block(osr_bci, start_block, _osr_entry, _initial_state); eliminate_redundant_phis(_start); diff --git a/src/hotspot/share/c1/c1_IR.cpp b/src/hotspot/share/c1/c1_IR.cpp index 0b7f7a2b2c1..53c19c78683 100644 --- a/src/hotspot/share/c1/c1_IR.cpp +++ b/src/hotspot/share/c1/c1_IR.cpp @@ -1261,6 +1261,16 @@ void IR::print(bool cfg_only, bool live_only) { } } +class EndNotNullValidator : public BlockClosure { + public: + EndNotNullValidator(IR* hir) { + hir->start()->iterate_postorder(this); + } + + void block_do(BlockBegin* block) { + assert(block->end() != NULL, "Expect block end to exist."); + } +}; typedef GrowableArray BlockListList; @@ -1363,6 +1373,7 @@ public: void IR::verify() { #ifdef ASSERT PredecessorValidator pv(this); + EndNotNullValidator(this); VerifyBlockBeginField verifier; this->iterate_postorder(&verifier); #endif diff --git a/src/hotspot/share/c1/c1_Instruction.cpp b/src/hotspot/share/c1/c1_Instruction.cpp index 687d2dae707..801aeb054aa 100644 --- a/src/hotspot/share/c1/c1_Instruction.cpp +++ b/src/hotspot/share/c1/c1_Instruction.cpp @@ -524,39 +524,21 @@ Constant::CompareResult Constant::compare(Instruction::Condition cond, Value rig // Implementation of BlockBegin -void BlockBegin::set_end(BlockEnd* end) { - assert(end != NULL, "should not reset block end to NULL"); - if (end == _end) { - return; - } - clear_end(); - - // Set the new end - _end = end; +void BlockBegin::set_end(BlockEnd* new_end) { // Assumes that no predecessor of new_end still has it as its successor + assert(new_end != NULL, "Should not reset block new_end to NULL"); + if (new_end == _end) return; - _successors.clear(); - // Now reset successors list based on BlockEnd - for (int i = 0; i < end->number_of_sux(); i++) { - BlockBegin* sux = end->sux_at(i); - _successors.append(sux); - sux->_predecessors.append(this); + // Remove this block as predecessor of its current successors + if (_end != NULL) + for (int i = 0; i < number_of_sux(); i++) { + sux_at(i)->remove_predecessor(this); } - _end->set_begin(this); -} - -void BlockBegin::clear_end() { - // Must make the predecessors/successors match up with the - // BlockEnd's notion. - if (_end != NULL) { - // disconnect from the old end - _end->set_begin(NULL); + _end = new_end; - // disconnect this block from it's current successors - for (int i = 0; i < _successors.length(); i++) { - _successors.at(i)->remove_predecessor(this); - } - _end = NULL; + // Add this block as predecessor of its new successors + for (int i = 0; i < number_of_sux(); i++) { + sux_at(i)->add_predecessor(this); } } @@ -575,7 +557,7 @@ void BlockBegin::disconnect_edge(BlockBegin* from, BlockBegin* to) { if (index >= 0) { sux->_predecessors.remove_at(index); } - from->_successors.remove_at(s); + from->end()->remove_sux_at(s); } else { s++; } @@ -583,16 +565,6 @@ void BlockBegin::disconnect_edge(BlockBegin* from, BlockBegin* to) { } -void BlockBegin::disconnect_from_graph() { - // disconnect this block from all other blocks - for (int p = 0; p < number_of_preds(); p++) { - pred_at(p)->remove_successor(this); - } - for (int s = 0; s < number_of_sux(); s++) { - sux_at(s)->remove_predecessor(this); - } -} - void BlockBegin::substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux) { // modify predecessors before substituting successors for (int i = 0; i < number_of_sux(); i++) { @@ -669,14 +641,6 @@ BlockBegin* BlockBegin::insert_block_between(BlockBegin* sux) { } -void BlockBegin::remove_successor(BlockBegin* pred) { - int idx; - while ((idx = _successors.find(pred)) >= 0) { - _successors.remove_at(idx); - } -} - - void BlockBegin::add_predecessor(BlockBegin* pred) { _predecessors.append(pred); } @@ -953,26 +917,10 @@ void BlockList::print(bool cfg_only, bool live_only) { // Implementation of BlockEnd -void BlockEnd::set_begin(BlockBegin* begin) { - BlockList* sux = NULL; - if (begin != NULL) { - sux = begin->successors(); - } else if (this->begin() != NULL) { - // copy our sux list - BlockList* sux = new BlockList(this->begin()->number_of_sux()); - for (int i = 0; i < this->begin()->number_of_sux(); i++) { - sux->append(this->begin()->sux_at(i)); - } - } - _sux = sux; -} - - void BlockEnd::substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux) { substitute(*_sux, old_sux, new_sux); } - // Implementation of Phi // Normal phi functions take their operands from the last instruction of the diff --git a/src/hotspot/share/c1/c1_Instruction.hpp b/src/hotspot/share/c1/c1_Instruction.hpp index 8d360b094b8..5b5ea8a863c 100644 --- a/src/hotspot/share/c1/c1_Instruction.hpp +++ b/src/hotspot/share/c1/c1_Instruction.hpp @@ -1595,7 +1595,6 @@ LEAF(BlockBegin, StateSplit) ResourceBitMap _stores_to_locals; // bit is set when a local variable is stored in the block // SSA specific fields: (factor out later) - BlockList _successors; // the successors of this block BlockList _predecessors; // the predecessors of this block BlockList _dominates; // list of blocks that are dominated by this block BlockBegin* _dominator; // the dominator of this block @@ -1649,7 +1648,6 @@ LEAF(BlockBegin, StateSplit) , _flags(0) , _total_preds(0) , _stores_to_locals() - , _successors(2) , _predecessors(2) , _dominates(2) , _dominator(NULL) @@ -1676,7 +1674,6 @@ LEAF(BlockBegin, StateSplit) // accessors int block_id() const { return _block_id; } int bci() const { return _bci; } - BlockList* successors() { return &_successors; } BlockList* dominates() { return &_dominates; } BlockBegin* dominator() const { return _dominator; } int loop_depth() const { return _loop_depth; } @@ -1704,9 +1701,7 @@ LEAF(BlockBegin, StateSplit) void set_dominator_depth(int d) { _dominator_depth = d; } void set_depth_first_number(int dfn) { _depth_first_number = dfn; } void set_linear_scan_number(int lsn) { _linear_scan_number = lsn; } - void set_end(BlockEnd* end); - void clear_end(); - void disconnect_from_graph(); + void set_end(BlockEnd* new_end); static void disconnect_edge(BlockBegin* from, BlockBegin* to); BlockBegin* insert_block_between(BlockBegin* sux); void substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux); @@ -1729,10 +1724,6 @@ LEAF(BlockBegin, StateSplit) // successors and predecessors int number_of_sux() const; BlockBegin* sux_at(int i) const; - void add_successor(BlockBegin* sux); - void remove_successor(BlockBegin* pred); - bool is_successor(BlockBegin* sux) const { return _successors.contains(sux); } - void add_predecessor(BlockBegin* pred); void remove_predecessor(BlockBegin* pred); bool is_predecessor(BlockBegin* pred) const { return _predecessors.contains(pred); } @@ -1792,6 +1783,7 @@ LEAF(BlockBegin, StateSplit) // debugging void print_block() PRODUCT_RETURN; void print_block(InstructionPrinter& ip, bool live_only = false) PRODUCT_RETURN; + }; @@ -1825,14 +1817,13 @@ BASE(BlockEnd, StateSplit) BlockBegin* begin() const { return _block; } // manipulation - void set_begin(BlockBegin* begin); + inline void remove_sux_at(int i) { _sux->remove_at(i);} + inline int find_sux(BlockBegin* sux) {return _sux->find(sux);} // successors int number_of_sux() const { return _sux != NULL ? _sux->length() : 0; } BlockBegin* sux_at(int i) const { return _sux->at(i); } BlockBegin* default_sux() const { return sux_at(number_of_sux() - 1); } - BlockBegin** addr_sux_at(int i) const { return _sux->adr_at(i); } - int sux_index(BlockBegin* sux) const { return _sux->find(sux); } void substitute_sux(BlockBegin* old_sux, BlockBegin* new_sux); }; @@ -2439,9 +2430,8 @@ class BlockPair: public CompilationResourceObj { typedef GrowableArray BlockPairList; -inline int BlockBegin::number_of_sux() const { assert(_end == NULL || _end->number_of_sux() == _successors.length(), "mismatch"); return _successors.length(); } -inline BlockBegin* BlockBegin::sux_at(int i) const { assert(_end == NULL || _end->sux_at(i) == _successors.at(i), "mismatch"); return _successors.at(i); } -inline void BlockBegin::add_successor(BlockBegin* sux) { assert(_end == NULL, "Would create mismatch with successors of BlockEnd"); _successors.append(sux); } +inline int BlockBegin::number_of_sux() const { assert(_end != NULL, "need end"); return _end->number_of_sux(); } +inline BlockBegin* BlockBegin::sux_at(int i) const { assert(_end != NULL , "need end"); return _end->sux_at(i); } #undef ASSERT_VALUES diff --git a/src/hotspot/share/c1/c1_InstructionPrinter.cpp b/src/hotspot/share/c1/c1_InstructionPrinter.cpp index 3e0708351a6..1a074a98ff8 100644 --- a/src/hotspot/share/c1/c1_InstructionPrinter.cpp +++ b/src/hotspot/share/c1/c1_InstructionPrinter.cpp @@ -612,14 +612,7 @@ void InstructionPrinter::do_BlockBegin(BlockBegin* x) { output()->print(" dom B%d", x->dominator()->block_id()); } - // print predecessors and successors - if (x->successors()->length() > 0) { - output()->print(" sux:"); - for (int i = 0; i < x->successors()->length(); i ++) { - output()->print(" B%d", x->successors()->at(i)->block_id()); - } - } - + // print predecessors if (x->number_of_preds() > 0) { output()->print(" pred:"); for (int i = 0; i < x->number_of_preds(); i ++) { diff --git a/src/hotspot/share/c1/c1_LIR.cpp b/src/hotspot/share/c1/c1_LIR.cpp index c726c94daef..d27b9175c9d 100644 --- a/src/hotspot/share/c1/c1_LIR.cpp +++ b/src/hotspot/share/c1/c1_LIR.cpp @@ -1580,7 +1580,7 @@ static void print_block(BlockBegin* x) { } } - if (x->number_of_sux() > 0) { + if (end != NULL && x->number_of_sux() > 0) { tty->print("sux: "); for (int i = 0; i < x->number_of_sux(); i ++) { tty->print("B%d ", x->sux_at(i)->block_id()); diff --git a/src/hotspot/share/c1/c1_Optimizer.cpp b/src/hotspot/share/c1/c1_Optimizer.cpp index 8e32b813ef7..e406a530b73 100644 --- a/src/hotspot/share/c1/c1_Optimizer.cpp +++ b/src/hotspot/share/c1/c1_Optimizer.cpp @@ -312,6 +312,19 @@ void Optimizer::eliminate_conditional_expressions() { CE_Eliminator ce(ir()); } +void disconnect_from_graph(BlockBegin* block) { + for (int p = 0; p < block->number_of_preds(); p++) { + BlockBegin* pred = block->pred_at(p); + int idx; + while ((idx = pred->end()->find_sux(block)) >= 0) { + pred->end()->remove_sux_at(idx); + } + } + for (int s = 0; s < block->number_of_sux(); s++) { + block->sux_at(s)->remove_predecessor(block); + } +} + class BlockMerger: public BlockClosure { private: IR* _hir; @@ -369,8 +382,8 @@ class BlockMerger: public BlockClosure { for_each_local_value(sux_state, index, sux_value) { Phi* sux_phi = sux_value->as_Phi(); if (sux_phi != NULL && sux_phi->is_illegal()) continue; - assert(sux_value == end_state->local_at(index), "locals not equal"); - } + assert(sux_value == end_state->local_at(index), "locals not equal"); + } assert(sux_state->caller_state() == end_state->caller_state(), "caller not equal"); #endif @@ -380,8 +393,12 @@ class BlockMerger: public BlockClosure { assert(prev->as_BlockEnd() == NULL, "must not be a BlockEnd"); prev->set_next(next); prev->fixup_block_pointers(); - sux->disconnect_from_graph(); + + // disconnect this block from all other blocks + disconnect_from_graph(sux); block->set_end(sux->end()); + + // TODO Should this be done in set_end universally? // add exception handlers of deleted block, if any for (int k = 0; k < sux->number_of_exception_handlers(); k++) { BlockBegin* xhandler = sux->exception_handler_at(k); -- GitLab From d14f06a9630d2cd2a929d0e44ebe4bb10e20dbd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Mon, 6 Dec 2021 09:29:28 +0000 Subject: [PATCH 620/890] 8278031: MultiThreadedRefCounter should not use relaxed atomic decrement Reviewed-by: kbarrett --- src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp b/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp index 149047837b7..33df23fe060 100644 --- a/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp +++ b/src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp @@ -116,7 +116,11 @@ class MultiThreadedRefCounter { } bool dec() const { - return 0 == Atomic::sub(&_refs, 1, memory_order_relaxed); + if (0 == Atomic::sub(&_refs, 1, memory_order_release)) { + OrderAccess::acquire(); + return true; + } + return false; } intptr_t current() const { -- GitLab From 286a26c36600ed82726f1678194363b2828851dd Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Mon, 6 Dec 2021 11:50:11 +0000 Subject: [PATCH 621/890] 8278277: G1: Simplify implementation of G1GCPhaseTimes::record_or_add_time_secs Reviewed-by: iwalulya, sjohanss, tschatzl --- src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp index 7c3eba2be94..cc4a90a36f1 100644 --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp @@ -266,11 +266,7 @@ void G1GCPhaseTimes::add_time_secs(GCParPhases phase, uint worker_id, double sec } void G1GCPhaseTimes::record_or_add_time_secs(GCParPhases phase, uint worker_id, double secs) { - if (_gc_par_phases[phase]->get(worker_id) == _gc_par_phases[phase]->uninitialized()) { - record_time_secs(phase, worker_id, secs); - } else { - add_time_secs(phase, worker_id, secs); - } + _gc_par_phases[phase]->set_or_add(worker_id, secs); } double G1GCPhaseTimes::get_time_secs(GCParPhases phase, uint worker_id) { -- GitLab From 6994d809371e80c1e24cd296c48c7f75886577b7 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Mon, 6 Dec 2021 13:44:22 +0000 Subject: [PATCH 622/890] 8278291: compiler/uncommontrap/TraceDeoptimizationNoRealloc.java fails with release VMs after JDK-8154011 Reviewed-by: shade, thartmann --- .../compiler/uncommontrap/TraceDeoptimizationNoRealloc.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java b/test/hotspot/jtreg/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java index 4a371a525b3..4cd10a1a63e 100644 --- a/test/hotspot/jtreg/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java +++ b/test/hotspot/jtreg/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -27,7 +27,7 @@ * @summary -XX:+TraceDeoptimization tries to print realloc'ed objects even when there are none * * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement - * -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceDeoptimization + * -XX:+UnlockDiagnosticVMOptions -XX:+TraceDeoptimization * compiler.uncommontrap.TraceDeoptimizationNoRealloc */ -- GitLab From a885aab696777c99c8c4c5d9a46afc5fe0a4fe47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Mon, 6 Dec 2021 14:36:51 +0000 Subject: [PATCH 623/890] 8276125: RunThese24H.java SIGSEGV in JfrThreadGroup::thread_group_id Reviewed-by: egahlin, shade --- .../jfr/recorder/checkpoint/types/jfrThreadGroup.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp index 107e7fa15d9..6d362305400 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp @@ -151,8 +151,12 @@ int JfrThreadGroupsHelper::populate_thread_group_hierarchy(const JavaThread* jt, assert(current != NULL, "invariant"); assert(_thread_group_hierarchy != NULL, "invariant"); + oop thread_oop = jt->threadObj(); + if (thread_oop == nullptr) { + return 0; + } // immediate thread group - Handle thread_group_handle(current, java_lang_Thread::threadGroup(jt->threadObj())); + Handle thread_group_handle(current, java_lang_Thread::threadGroup(thread_oop)); if (thread_group_handle == NULL) { return 0; } @@ -167,7 +171,7 @@ int JfrThreadGroupsHelper::populate_thread_group_hierarchy(const JavaThread* jt, Handle parent_thread_group_handle(current, parent_thread_group_obj); // and check parents parents... - while (!(parent_thread_group_handle == NULL)) { + while (parent_thread_group_handle != nullptr) { const jweak parent_group_weak_ref = use_weak_handles ? JNIHandles::make_weak_global(parent_thread_group_handle) : NULL; thread_group_pointers = new JfrThreadGroupPointers(parent_thread_group_handle, parent_group_weak_ref); _thread_group_hierarchy->append(thread_group_pointers); -- GitLab From 7c6f57fcb1f1fcecf26f7b8046a5a41ca6d9c315 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 6 Dec 2021 14:48:03 +0000 Subject: [PATCH 624/890] 8275610: C2: Object field load floats above its null check resulting in a segfault Reviewed-by: kvn, roland --- src/hotspot/share/opto/loopopts.cpp | 10 ++ .../TestEliminateNullCheckWithSplitIf.java | 102 ++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/loopopts/TestEliminateNullCheckWithSplitIf.java diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 8dff310c569..f1cb053d87e 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -1174,6 +1174,16 @@ bool PhaseIdealLoop::identical_backtoback_ifs(Node *n) { if (!n->in(0)->is_Region()) { return false; } + + IfNode* n_if = n->as_If(); + if (n_if->proj_out(0)->outcnt() > 1 || n_if->proj_out(1)->outcnt() > 1) { + // Removing the dominated If node by using the split-if optimization does not work if there are data dependencies. + // Some data dependencies depend on its immediate dominator If node and should not be separated from it (e.g. null + // checks, division by zero checks etc.). Bail out for now until data dependencies are correctly handled when + // optimizing back-to-back ifs. + return false; + } + Node* region = n->in(0); Node* dom = idom(region); if (!dom->is_If() || dom->in(1) != n->in(1)) { diff --git a/test/hotspot/jtreg/compiler/loopopts/TestEliminateNullCheckWithSplitIf.java b/test/hotspot/jtreg/compiler/loopopts/TestEliminateNullCheckWithSplitIf.java new file mode 100644 index 00000000000..e83b23255b3 --- /dev/null +++ b/test/hotspot/jtreg/compiler/loopopts/TestEliminateNullCheckWithSplitIf.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021, 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 + * @key stress randomness + * @bug 8275610 + * @summary Null check for field access of object floats above null check resulting in a segfault. + * @requires vm.compiler2.enabled + * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.loopopts.TestEliminateNullCheckWithSplitIf::test + * -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:StressSeed=42 compiler.loopopts.TestEliminateNullCheckWithSplitIf + * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.loopopts.TestEliminateNullCheckWithSplitIf::test + * -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressIGVN compiler.loopopts.TestEliminateNullCheckWithSplitIf + */ + +package compiler.loopopts; + +public class TestEliminateNullCheckWithSplitIf { + public static int[] iArrFld = new int[20]; + public static int[] iArrFld2 = new int[20]; + public static int iFld = 10; + public static MyClass obj; + + public static void main(String[] strArr) { + for (int i = 0; i < 10000; i++) { + obj = (i % 100 == 0 ? null : new MyClass()); + test(); + } + } + + // The field access obj.iFld requires a null check NC3 and adds a not-null CastPP node on the succeeded projection. + // In the first IGVN after parsing, the null check NC3 can be subsumed by the explicit null check NC2. + // (done in IfNode::simple_subsuming()). The Bool node of NC2 is also shared with the same null check NC1 earlier. + // However, C2 cannot remove the null check NC2, yet, because the IR in between the two checks are too complex + // (IfNode::search_identical() fails). + // Now, loopopts are applied: + // (1) First, the split if optimization is done. It recognizes that NC1 and NC2 are back to back null checks and removes + // the null check NC2 by splitting it through the region R which is removed afterwards. In this process, control dependent + // data nodes on the out projections of NC2 end up at the new regions R1/R2 created for each projection for R. They get + // the last nodes of the if and else block as input. For this example, R1 is a control input to the CastPP node which + // will merge both true projections. + // (2) Later in loop opts, the loop L is transformed into normal code and y will become a constant 1. + // After loopopts, another round of IGVN is done: + // (These steps also depend on the order in which they are applied in order to trigger the bug) + // (1) The region R is removed because one path is dead (a result of the split if optimization). + // (2) The new If node added by the above split if optimization is also folded. This rewires the CastPP node to + // the last control node in the If block which is the true projection of range check RC2. Up until now, the CastPP + // is still after the null check NC1. + // (3) The range check RC2 is removed because the range check RC1 already covers this range (see RangeCheck::Ideal()). + // All data nodes which are control dependent on RC2 will be rewired to the dominating range check RC1, including + // the non-null CastPP node - which now has a control input above the null check NC1. This also means that the field + // load obj.iFld now has the same early control as the CastPP (CastPP -> AddP -> LoadI). Using StressGCM can + // now schedule the obj.iFld load before the null check NC1 because the early control allows it which leads to a + // segmentation fault if obj is null. + public static void test() { + int x = iArrFld[17]; // Emits range check RC1 + if (obj != null) { // Null check NC1 + int y = 0; + for (int i = 0; i < 1; i++) { // Loop L + y++; + } + // Use additional loop to keep the rangecheck for iArrFld[y] in before loopopts. + // y will become constant 1 but only once the loop above is removed in loopopts. + x = iArrFld[y]; // Emits range check RC2 + } else { + x = iArrFld2[18]; + } + // Region R merging the if and else paths above. + if (obj != null) { // Null check NC2 + x = iArrFld2[obj.iFld]; // Emits Null check NC3 for obj.iFld + } + } +} + +class MyClass { + int iFld; +} + + + + -- GitLab From adf39522c178b82dc73e341751b2d9aba984469d Mon Sep 17 00:00:00 2001 From: Vishal Chand Date: Mon, 6 Dec 2021 15:28:20 +0000 Subject: [PATCH 625/890] 8277372: Add getters for BOT and card table members Reviewed-by: tschatzl, sjohanss, ayang --- .../gc/g1/g1BarrierSetAssembler_aarch64.cpp | 4 +- .../cardTableBarrierSetAssembler_aarch64.cpp | 6 +- src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp | 2 +- .../arm/gc/g1/g1BarrierSetAssembler_arm.cpp | 4 +- .../cardTableBarrierSetAssembler_arm.cpp | 6 +- .../ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp | 4 +- .../cardTableBarrierSetAssembler_ppc.cpp | 6 +- .../s390/gc/g1/g1BarrierSetAssembler_s390.cpp | 4 +- .../cardTableBarrierSetAssembler_s390.cpp | 6 +- .../x86/gc/g1/g1BarrierSetAssembler_x86.cpp | 4 +- .../cardTableBarrierSetAssembler_x86.cpp | 10 +-- src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp | 2 +- src/hotspot/share/gc/g1/g1AllocRegion.cpp | 2 +- src/hotspot/share/gc/g1/g1Arguments.cpp | 2 +- .../share/gc/g1/g1BlockOffsetTable.cpp | 40 ++++++------ .../share/gc/g1/g1BlockOffsetTable.hpp | 10 +-- .../share/gc/g1/g1BlockOffsetTable.inline.hpp | 8 +-- src/hotspot/share/gc/g1/g1CardCounts.cpp | 2 +- src/hotspot/share/gc/g1/g1CardTable.cpp | 2 +- src/hotspot/share/gc/g1/g1CardTable.hpp | 4 +- .../share/gc/g1/g1CardTable.inline.hpp | 2 +- src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 2 +- src/hotspot/share/gc/g1/g1RemSet.cpp | 4 +- src/hotspot/share/gc/g1/heapRegion.cpp | 2 +- src/hotspot/share/gc/g1/heapRegionRemSet.cpp | 2 +- .../share/gc/g1/heapRegionRemSet.inline.hpp | 4 +- .../share/gc/parallel/objectStartArray.cpp | 26 ++++---- .../share/gc/parallel/objectStartArray.hpp | 25 ++++++-- src/hotspot/share/gc/parallel/psOldGen.cpp | 2 +- .../share/gc/shared/blockOffsetTable.cpp | 64 +++++++++---------- .../share/gc/shared/blockOffsetTable.hpp | 39 +++++++---- .../gc/shared/blockOffsetTable.inline.hpp | 4 +- .../gc/shared/c1/cardTableBarrierSetC1.cpp | 4 +- .../gc/shared/c2/cardTableBarrierSetC2.cpp | 2 +- src/hotspot/share/gc/shared/cardTable.cpp | 30 ++++----- src/hotspot/share/gc/shared/cardTable.hpp | 28 +++++--- src/hotspot/share/gc/shared/vmStructs_gc.hpp | 7 -- .../share/jvmci/jvmciCompilerToVMInit.cpp | 2 +- .../gtest/gc/g1/test_freeRegionList.cpp | 2 +- .../gtest/gc/g1/test_g1CardSetContainers.cpp | 2 +- 40 files changed, 205 insertions(+), 176 deletions(-) diff --git a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp index 77a6dc8b739..cd689b008e0 100644 --- a/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp @@ -222,7 +222,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, const Register card_addr = tmp; - __ lsr(card_addr, store_addr, CardTable::card_shift); + __ lsr(card_addr, store_addr, CardTable::card_shift()); // get the address of the card __ load_byte_map_base(tmp2); @@ -444,7 +444,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* assert_different_registers(card_offset, byte_map_base, rscratch1); __ load_parameter(0, card_offset); - __ lsr(card_offset, card_offset, CardTable::card_shift); + __ lsr(card_offset, card_offset, CardTable::card_shift()); __ load_byte_map_base(byte_map_base); __ ldrb(rscratch1, Address(byte_map_base, card_offset)); __ cmpw(rscratch1, (int)G1CardTable::g1_young_card_val()); diff --git a/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp index fb677828e20..f94f2b9c902 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp @@ -38,7 +38,7 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register ob BarrierSet* bs = BarrierSet::barrier_set(); assert(bs->kind() == BarrierSet::CardTableBarrierSet, "Wrong barrier set kind"); - __ lsr(obj, obj, CardTable::card_shift); + __ lsr(obj, obj, CardTable::card_shift()); assert(CardTable::dirty_card_val() == 0, "must be"); @@ -64,8 +64,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl __ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop))); // end = start + count << LogBytesPerHeapOop __ sub(end, end, BytesPerHeapOop); // last element address to make inclusive - __ lsr(start, start, CardTable::card_shift); - __ lsr(end, end, CardTable::card_shift); + __ lsr(start, start, CardTable::card_shift()); + __ lsr(end, end, CardTable::card_shift()); __ sub(count, end, start); // number of bytes to copy __ load_byte_map_base(scratch); diff --git a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp index 0a5b80b23b7..69a76f4beb0 100644 --- a/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp @@ -377,7 +377,7 @@ void LIRGenerator::CardTableBarrierSet_post_barrier_helper(LIR_Opr addr, LIR_Con // Use unsigned type T_BOOLEAN here rather than (signed) T_BYTE since signed load // byte instruction does not support the addressing mode we need. - LIR_Address* card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTable::card_shift, 0, T_BOOLEAN); + LIR_Address* card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTable::card_shift(), 0, T_BOOLEAN); if (UseCondCardMark) { LIR_Opr cur_value = new_register(T_INT); __ move(card_addr, cur_value); diff --git a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp index 63bf45b8db5..765b05e779b 100644 --- a/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp @@ -218,7 +218,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, const Register card_addr = tmp1; __ mov_address(tmp2, (address)ct->byte_map_base()); - __ add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTable::card_shift)); + __ add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTable::card_shift())); __ ldrb(tmp2, Address(card_addr)); __ cmp(tmp2, (int)G1CardTable::g1_young_card_val()); @@ -452,7 +452,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* // explicitly specify that 'cardtable' has a relocInfo::none // type. __ lea(r_card_base_1, cardtable); - __ add(r_card_addr_0, r_card_base_1, AsmOperand(r_obj_0, lsr, CardTable::card_shift)); + __ add(r_card_addr_0, r_card_base_1, AsmOperand(r_obj_0, lsr, CardTable::card_shift())); // first quick check without barrier __ ldrb(r_tmp2, Address(r_card_addr_0)); diff --git a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp index 86f43597e22..11b2ca2ef1d 100644 --- a/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp @@ -55,8 +55,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl __ add_ptr_scaled_int32(count, addr, count, LogBytesPerHeapOop); __ sub(count, count, BytesPerHeapOop); // last addr - __ logical_shift_right(addr, addr, CardTable::card_shift); - __ logical_shift_right(count, count, CardTable::card_shift); + __ logical_shift_right(addr, addr, CardTable::card_shift()); + __ logical_shift_right(count, count, CardTable::card_shift()); __ sub(count, count, addr); // nb of cards // warning: Rthread has not been preserved @@ -129,7 +129,7 @@ void CardTableBarrierSetAssembler::store_check_part2(MacroAssembler* masm, Regis "Wrong barrier set kind"); assert(CardTable::dirty_card_val() == 0, "Dirty card value must be 0 due to optimizations."); - Address card_table_addr(card_table_base, obj, lsr, CardTable::card_shift); + Address card_table_addr(card_table_base, obj, lsr, CardTable::card_shift()); if (UseCondCardMark) { Label already_dirty; diff --git a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp index a9328e8d616..05c8374cfa4 100644 --- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp @@ -245,7 +245,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato Register Rbase = tmp2; __ load_const_optimized(Rbase, (address)(ct->card_table()->byte_map_base()), /*temp*/ tmp3); - __ srdi(Rcard_addr, store_addr, CardTable::card_shift); + __ srdi(Rcard_addr, store_addr, CardTable::card_shift()); // Get the address of the card. __ lbzx(/*card value*/ tmp3, Rbase, Rcard_addr); @@ -516,7 +516,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* __ std(addr, -8, R1_SP); __ std(tmp2, -16, R1_SP); - __ srdi(addr, R0, CardTable::card_shift); // Addr is passed in R0. + __ srdi(addr, R0, CardTable::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] diff --git a/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp index 8337317e3f2..0d80f2fd954 100644 --- a/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp @@ -54,8 +54,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl __ addi(count, count, -BytesPerHeapOop); __ add(count, addr, count); // Use two shifts to clear out those low order two bits! (Cannot opt. into 1.) - __ srdi(addr, addr, CardTable::card_shift); - __ srdi(count, count, CardTable::card_shift); + __ srdi(addr, addr, CardTable::card_shift()); + __ srdi(count, count, CardTable::card_shift()); __ subf(count, addr, count); __ add_const_optimized(addr, addr, (address)ct->byte_map_base(), R0); __ addi(count, count, 1); @@ -74,7 +74,7 @@ void CardTableBarrierSetAssembler::card_table_write(MacroAssembler* masm, Register tmp, Register obj) { assert_different_registers(obj, tmp, R0); __ load_const_optimized(tmp, (address)byte_map_base, R0); - __ srdi(obj, obj, CardTable::card_shift); + __ srdi(obj, obj, CardTable::card_shift()); __ li(R0, CardTable::dirty_card_val()); __ stbx(R0, tmp, obj); } diff --git a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp index 7258630bb0b..b6e3d9eb2c7 100644 --- a/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp @@ -305,7 +305,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato // calculate address of card __ load_const_optimized(Rbase, (address)ct->card_table()->byte_map_base()); // Card table base. - __ z_srlg(Rcard_addr, Rstore_addr, CardTable::card_shift); // Index into card table. + __ z_srlg(Rcard_addr, Rstore_addr, CardTable::card_shift()); // Index into card table. __ z_algr(Rcard_addr, Rbase); // Explicit calculation needed for cli. Rbase = noreg; // end of lifetime @@ -548,7 +548,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* // Calculate address of card corresponding to the updated oop slot. AddressLiteral rs(byte_map_base); - __ z_srlg(addr_card, addr_oop, CardTable::card_shift); + __ z_srlg(addr_card, addr_oop, CardTable::card_shift()); addr_oop = noreg; // dead now __ load_const_optimized(cardtable, rs); // cardtable := __ z_agr(addr_card, cardtable); // addr_card := addr_oop>>card_shift + cardtable diff --git a/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp index d3f7bafd33e..0124868e46a 100644 --- a/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp @@ -70,8 +70,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl __ load_const_optimized(Z_R1, (address)ct->byte_map_base()); // count = (count>>shift) - (addr>>shift) - __ z_srlg(addr, addr, CardTable::card_shift); - __ z_srlg(count, count, CardTable::card_shift); + __ z_srlg(addr, addr, CardTable::card_shift()); + __ z_srlg(count, count, CardTable::card_shift()); // Prefetch first elements of card table for update. if (VM_Version::has_Prefetch()) { @@ -146,7 +146,7 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register st assert_different_registers(store_addr, tmp); - __ z_srlg(store_addr, store_addr, CardTable::card_shift); + __ z_srlg(store_addr, store_addr, CardTable::card_shift()); __ load_absolute_address(tmp, (address)ct->byte_map_base()); __ z_agr(store_addr, tmp); __ z_mvi(0, store_addr, CardTable::dirty_card_val()); diff --git a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp index 645c2fec8bd..6525b13c5c2 100644 --- a/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp @@ -298,7 +298,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, const Register cardtable = tmp2; __ movptr(card_addr, store_addr); - __ shrptr(card_addr, CardTable::card_shift); + __ shrptr(card_addr, CardTable::card_shift()); // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT // a valid address and therefore is not properly handled by the relocation code. __ movptr(cardtable, (intptr_t)ct->card_table()->byte_map_base()); @@ -540,7 +540,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* const Register card_addr = rcx; __ load_parameter(0, card_addr); - __ shrptr(card_addr, CardTable::card_shift); + __ shrptr(card_addr, CardTable::card_shift()); // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT // a valid address and therefore is not properly handled by the relocation code. __ movptr(cardtable, (intptr_t)ct->card_table()->byte_map_base()); diff --git a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp index 9b2d2c5efed..7fc36ffae8f 100644 --- a/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp @@ -60,8 +60,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl #ifdef _LP64 __ leaq(end, Address(addr, count, TIMES_OOP, 0)); // end == addr+count*oop_size __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive - __ shrptr(addr, CardTable::card_shift); - __ shrptr(end, CardTable::card_shift); + __ shrptr(addr, CardTable::card_shift()); + __ shrptr(end, CardTable::card_shift()); __ subptr(end, addr); // end --> cards count __ mov64(tmp, disp); @@ -72,8 +72,8 @@ __ BIND(L_loop); __ jcc(Assembler::greaterEqual, L_loop); #else __ lea(end, Address(addr, count, Address::times_ptr, -wordSize)); - __ shrptr(addr, CardTable::card_shift); - __ shrptr(end, CardTable::card_shift); + __ shrptr(addr, CardTable::card_shift()); + __ shrptr(end, CardTable::card_shift()); __ subptr(end, addr); // end --> count __ BIND(L_loop); Address cardtable(addr, count, Address::times_1, disp); @@ -93,7 +93,7 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register ob CardTableBarrierSet* ctbs = barrier_set_cast(bs); CardTable* ct = ctbs->card_table(); - __ shrptr(obj, CardTable::card_shift); + __ shrptr(obj, CardTable::card_shift()); Address card_addr; diff --git a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp index d5c4c14f92e..7d28f26e68e 100644 --- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp +++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp @@ -442,7 +442,7 @@ void G1BarrierSetC2::post_barrier(GraphKit* kit, Node* cast = __ CastPX(__ ctrl(), adr); // Divide pointer by card size - Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift) ); + Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift()) ); // Combine card table base and card offset Node* card_adr = __ AddP(no_base, byte_map_base_node(kit), card_offset ); diff --git a/src/hotspot/share/gc/g1/g1AllocRegion.cpp b/src/hotspot/share/gc/g1/g1AllocRegion.cpp index 239822d6d1d..915110e3ebb 100644 --- a/src/hotspot/share/gc/g1/g1AllocRegion.cpp +++ b/src/hotspot/share/gc/g1/g1AllocRegion.cpp @@ -371,7 +371,7 @@ HeapRegion* OldGCAllocRegion::release() { // Determine how far we are from the next card boundary. If it is smaller than // the minimum object size we can allocate into, expand into the next card. HeapWord* top = cur->top(); - HeapWord* aligned_top = align_up(top, BOTConstants::N_bytes); + HeapWord* aligned_top = align_up(top, BOTConstants::card_size()); size_t to_allocate_words = pointer_delta(aligned_top, top, HeapWordSize); diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp index 400f6b50024..348402cf957 100644 --- a/src/hotspot/share/gc/g1/g1Arguments.cpp +++ b/src/hotspot/share/gc/g1/g1Arguments.cpp @@ -135,7 +135,7 @@ void G1Arguments::initialize_card_set_configuration() { uint region_size_log_mb = (uint)MAX2(HeapRegion::LogOfHRGrainBytes - LOG_M, 0); if (FLAG_IS_DEFAULT(G1RemSetArrayOfCardsEntries)) { - uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift); + uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift()); FLAG_SET_ERGO(G1RemSetArrayOfCardsEntries, MAX2(max_cards_in_inline_ptr * 2, G1RemSetArrayOfCardsEntriesBase * (1u << (region_size_log_mb + 1)))); } diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp index c98aa2c79a2..08e7dd5f1d4 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp @@ -52,14 +52,14 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st bool G1BlockOffsetTable::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); - return (delta & right_n_bits((int)BOTConstants::LogN_words)) == (size_t)NoBits; + return (delta & right_n_bits((int)BOTConstants::log_card_size_in_words())) == (size_t)NoBits; } #ifdef ASSERT void G1BlockOffsetTable::check_index(size_t index, const char* msg) const { - assert((index) < (_reserved.word_size() >> BOTConstants::LogN_words), + assert((index) < (_reserved.word_size() >> BOTConstants::log_card_size_in_words()), "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT, - msg, (index), (_reserved.word_size() >> BOTConstants::LogN_words)); + msg, (index), (_reserved.word_size() >> BOTConstants::log_card_size_in_words())); assert(G1CollectedHeap::heap()->is_in(address_for_index_raw(index)), "Index " SIZE_FORMAT " corresponding to " PTR_FORMAT " (%u) is not in committed area.", @@ -134,7 +134,7 @@ void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, H size_t start_card = _bot->index_for(start); size_t end_card = _bot->index_for(end-1); assert(start ==_bot->address_for_index(start_card), "Precondition"); - assert(end ==_bot->address_for_index(end_card)+BOTConstants::N_words, "Precondition"); + assert(end ==_bot->address_for_index(end_card)+BOTConstants::card_size_in_words(), "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card); // closed interval } @@ -144,7 +144,7 @@ void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, H void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_card, size_t end_card) { assert(start_card <= end_card, "precondition"); assert(start_card > _bot->index_for(_hr->bottom()), "Cannot be first card"); - assert(_bot->offset_array(start_card-1) <= BOTConstants::N_words, + assert(_bot->offset_array(start_card-1) <= BOTConstants::card_size_in_words(), "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; @@ -153,7 +153,7 @@ void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_c // so that the reach ends in this region and not at the start // of the next. size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); - offset = BOTConstants::N_words + i; + offset = BOTConstants::card_size_in_words() + i; if (reach >= end_card) { _bot->set_offset_array(start_card_for_region, end_card, offset); start_card_for_region = reach + 1; @@ -174,16 +174,16 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) if (end_card < start_card) { return; } - guarantee(_bot->offset_array(start_card) == BOTConstants::N_words, "Wrong value in second card"); + guarantee(_bot->offset_array(start_card) == BOTConstants::card_size_in_words(), "Wrong value in second card"); for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { u_char entry = _bot->offset_array(c); if (c - start_card > BOTConstants::power_to_cards_back(1)) { - guarantee(entry > BOTConstants::N_words, + guarantee(entry > BOTConstants::card_size_in_words(), "Should be in logarithmic region - " "entry: %u, " "_array->offset_array(c): %u, " "N_words: %u", - (uint)entry, (uint)_bot->offset_array(c), BOTConstants::N_words); + (uint)entry, (uint)_bot->offset_array(c), BOTConstants::card_size_in_words()); } size_t backskip = BOTConstants::entry_to_cards_back(entry); size_t landing_card = c - backskip; @@ -196,10 +196,10 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) } else { guarantee(landing_card == start_card - 1, "Tautology"); // Note that N_words is the maximum offset value - guarantee(_bot->offset_array(landing_card) <= BOTConstants::N_words, + guarantee(_bot->offset_array(landing_card) <= BOTConstants::card_size_in_words(), "landing card offset: %u, " "N_words: %u", - (uint)_bot->offset_array(landing_card), (uint)BOTConstants::N_words); + (uint)_bot->offset_array(landing_card), (uint)BOTConstants::card_size_in_words()); } } } @@ -224,13 +224,13 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, HeapWord* b "phantom block"); assert(blk_end > threshold, "should be past threshold"); assert(blk_start <= threshold, "blk_start should be at or before threshold"); - assert(pointer_delta(threshold, blk_start) <= BOTConstants::N_words, + assert(pointer_delta(threshold, blk_start) <= BOTConstants::card_size_in_words(), "offset should be <= BlockOffsetSharedArray::N"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_start), "reference must be into the heap"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); - assert(threshold == _bot->_reserved.start() + index*BOTConstants::N_words, + assert(threshold == _bot->_reserved.start() + index*BOTConstants::card_size_in_words(), "index must agree with threshold"); DEBUG_ONLY(size_t orig_index = index;) @@ -250,14 +250,14 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, HeapWord* b HeapWord* rem_st = _bot->address_for_index(index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _bot->address_for_index(end_index) + BOTConstants::N_words; + HeapWord* rem_end = _bot->address_for_index(end_index) + BOTConstants::card_size_in_words(); set_remainder_to_point_to_start(rem_st, rem_end); } index = end_index + 1; // Calculate threshold_ this way because end_index // may be the last valid index in the covered region. - threshold = _bot->address_for_index(end_index) + BOTConstants::N_words; + threshold = _bot->address_for_index(end_index) + BOTConstants::card_size_in_words(); assert(threshold >= blk_end, "Incorrect offset threshold"); *threshold_ = threshold; @@ -268,7 +268,7 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, HeapWord* b size_t start_index = _bot->index_for(blk_start); HeapWord* boundary = _bot->address_for_index(start_index); assert((_bot->offset_array(orig_index) == 0 && blk_start == boundary) || - (_bot->offset_array(orig_index) > 0 && _bot->offset_array(orig_index) <= BOTConstants::N_words), + (_bot->offset_array(orig_index) > 0 && _bot->offset_array(orig_index) <= BOTConstants::card_size_in_words()), "offset array should have been set - " "orig_index offset: %u, " "blk_start: " PTR_FORMAT ", " @@ -278,12 +278,12 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, HeapWord* b for (size_t j = orig_index + 1; j <= end_index; j++) { assert(_bot->offset_array(j) > 0 && _bot->offset_array(j) <= - (u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), + (u_char) (BOTConstants::card_size_in_words()+BOTConstants::N_powers-1), "offset array should have been set - " "%u not > 0 OR %u not <= %u", (uint) _bot->offset_array(j), (uint) _bot->offset_array(j), - (uint) (BOTConstants::N_words+BOTConstants::N_powers-1)); + (uint) (BOTConstants::card_size_in_words() + BOTConstants::N_powers - 1)); } #endif } @@ -297,7 +297,7 @@ void G1BlockOffsetTablePart::verify() const { for (size_t current_card = start_card; current_card < end_card; current_card++) { u_char entry = _bot->offset_array(current_card); - if (entry < BOTConstants::N_words) { + if (entry < BOTConstants::card_size_in_words()) { // The entry should point to an object before the current card. Verify that // it is possible to walk from that object in to the current card by just // iterating over the objects following it. @@ -361,7 +361,7 @@ void G1BlockOffsetTablePart::zero_bottom_entry_raw() { } void G1BlockOffsetTablePart::initialize_threshold() { - _next_offset_threshold = _hr->bottom() + BOTConstants::N_words; + _next_offset_threshold = _hr->bottom() + BOTConstants::card_size_in_words(); } void G1BlockOffsetTablePart::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) { diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp index 128e9d105a2..fa7658e185e 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp @@ -55,9 +55,9 @@ private: volatile u_char* _offset_array; // byte array keeping backwards offsets void check_offset(size_t offset, const char* msg) const { - assert(offset <= BOTConstants::N_words, + assert(offset <= BOTConstants::card_size_in_words(), "%s - offset: " SIZE_FORMAT ", N_words: %u", - msg, offset, BOTConstants::N_words); + msg, offset, BOTConstants::card_size_in_words()); } // Bounds checking accessors: @@ -80,13 +80,13 @@ public: // Return the number of slots needed for an offset array // that covers mem_region_words words. static size_t compute_size(size_t mem_region_words) { - size_t number_of_slots = (mem_region_words / BOTConstants::N_words); + size_t number_of_slots = (mem_region_words / BOTConstants::card_size_in_words()); return ReservedSpace::allocation_align_size_up(number_of_slots); } // Returns how many bytes of the heap a single byte of the BOT corresponds to. static size_t heap_map_factor() { - return BOTConstants::N_bytes; + return BOTConstants::card_size(); } // Initialize the Block Offset Table to cover the memory region passed @@ -102,7 +102,7 @@ public: inline HeapWord* address_for_index(size_t index) const; // Variant of address_for_index that does not check the index for validity. inline HeapWord* address_for_index_raw(size_t index) const { - return _reserved.start() + (index << BOTConstants::LogN_words); + return _reserved.start() + (index << BOTConstants::log_card_size_in_words()); } }; diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp index 7471a4ca078..aa0c004a302 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp @@ -41,7 +41,7 @@ inline HeapWord* G1BlockOffsetTablePart::threshold_for_addr(const void* addr) { } // Calculate next threshold. - HeapWord* threshold = card_boundary + BOTConstants::N_words; + HeapWord* threshold = card_boundary + BOTConstants::card_size_in_words(); return threshold; } @@ -84,7 +84,7 @@ void G1BlockOffsetTable::set_offset_array(size_t left, size_t right, u_char offs // Variant of index_for that does not check the index for validity. inline size_t G1BlockOffsetTable::index_for_raw(const void* p) const { - return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> BOTConstants::LogN; + return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> BOTConstants::log_card_size(); } inline size_t G1BlockOffsetTable::index_for(const void* p) const { @@ -120,14 +120,14 @@ inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr) size_t index = _bot->index_for(addr); uint offset = _bot->offset_array(index); // Extend u_char to uint. - while (offset >= BOTConstants::N_words) { + while (offset >= BOTConstants::card_size_in_words()) { // The excess of the offset from N_words indicates a power of Base // to go back by. size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); index -= n_cards_back; offset = _bot->offset_array(index); } - assert(offset < BOTConstants::N_words, "offset too large"); + assert(offset < BOTConstants::card_size_in_words(), "offset too large"); HeapWord* q = _bot->address_for_index(index); return q - offset; diff --git a/src/hotspot/share/gc/g1/g1CardCounts.cpp b/src/hotspot/share/gc/g1/g1CardCounts.cpp index 1607ec40b95..6e56eecafb9 100644 --- a/src/hotspot/share/gc/g1/g1CardCounts.cpp +++ b/src/hotspot/share/gc/g1/g1CardCounts.cpp @@ -126,7 +126,7 @@ void G1CardCounts::clear_range(MemRegion mr) { HeapWord* start_addr = _ct->addr_for(from_card_ptr); assert(start_addr == mr.start(), "MemRegion start must be aligned to a card."); HeapWord* last_addr = _ct->addr_for(last_card_ptr); - assert((last_addr + G1CardTable::card_size_in_words) == mr.end(), "MemRegion end must be aligned to a card."); + assert((last_addr + G1CardTable::card_size_in_words()) == mr.end(), "MemRegion end must be aligned to a card."); #endif // ASSERT // Clear the counts for the (exclusive) card range. diff --git a/src/hotspot/share/gc/g1/g1CardTable.cpp b/src/hotspot/share/gc/g1/g1CardTable.cpp index 9e565c1ba64..4fc6db5bac1 100644 --- a/src/hotspot/share/gc/g1/g1CardTable.cpp +++ b/src/hotspot/share/gc/g1/g1CardTable.cpp @@ -62,7 +62,7 @@ void G1CardTable::initialize(G1RegionToSpaceMapper* mapper) { _covered[0] = _whole_heap; _byte_map = (CardValue*) mapper->reserved().start(); - _byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift); + _byte_map_base = _byte_map - (uintptr_t(low_bound) >> _card_shift); 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"); diff --git a/src/hotspot/share/gc/g1/g1CardTable.hpp b/src/hotspot/share/gc/g1/g1CardTable.hpp index fd150db39f8..e73cbfaf86d 100644 --- a/src/hotspot/share/gc/g1/g1CardTable.hpp +++ b/src/hotspot/share/gc/g1/g1CardTable.hpp @@ -110,12 +110,12 @@ public: inline uint region_idx_for(CardValue* p); static size_t compute_size(size_t mem_region_size_in_words) { - size_t number_of_slots = (mem_region_size_in_words / card_size_in_words); + size_t number_of_slots = (mem_region_size_in_words / _card_size_in_words); return ReservedSpace::allocation_align_size_up(number_of_slots); } // Returns how many bytes of the heap a single byte of the Card Table corresponds to. - static size_t heap_map_factor() { return card_size; } + static size_t heap_map_factor() { return _card_size; } void initialize() {} void initialize(G1RegionToSpaceMapper* mapper); diff --git a/src/hotspot/share/gc/g1/g1CardTable.inline.hpp b/src/hotspot/share/gc/g1/g1CardTable.inline.hpp index 41ffdf5318e..d2962cbad84 100644 --- a/src/hotspot/share/gc/g1/g1CardTable.inline.hpp +++ b/src/hotspot/share/gc/g1/g1CardTable.inline.hpp @@ -31,7 +31,7 @@ inline uint G1CardTable::region_idx_for(CardValue* p) { size_t const card_idx = pointer_delta(p, _byte_map, sizeof(CardValue)); - return (uint)(card_idx >> (HeapRegion::LogOfHRGrainBytes - card_shift)); + return (uint)(card_idx >> (HeapRegion::LogOfHRGrainBytes - _card_shift)); } inline bool G1CardTable::mark_clean_as_dirty(CardValue* card) { diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index b35f48eaa7b..58f4a34d344 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -1660,7 +1660,7 @@ jint G1CollectedHeap::initialize() { // The G1FromCardCache reserves card with value 0 as "invalid", so the heap must not // start within the first card. - guarantee((uintptr_t)(heap_rs.base()) >= G1CardTable::card_size, "Java heap must not start within the first card."); + guarantee((uintptr_t)(heap_rs.base()) >= G1CardTable::card_size(), "Java heap must not start within the first card."); G1FromCardCache::initialize(max_reserved_regions()); // Also create a G1 rem set. _rem_set = new G1RemSet(this, _card_table, _hot_card_cache); diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index dcde1bd8fa5..f4893300a07 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -808,7 +808,7 @@ class G1ScanHRForRegionClosure : public HeapRegionClosure { return; } - HeapWord* scan_end = MIN2(card_start + (num_cards << BOTConstants::LogN_words), top); + HeapWord* scan_end = MIN2(card_start + (num_cards << BOTConstants::log_card_size_in_words()), top); if (_scanned_to >= scan_end) { return; } @@ -1674,7 +1674,7 @@ void G1RemSet::refine_card_concurrently(CardValue* const card_ptr, // Don't use addr_for(card_ptr + 1) which can ask for // a card beyond the heap. - HeapWord* end = start + G1CardTable::card_size_in_words; + HeapWord* end = start + G1CardTable::card_size_in_words(); MemRegion dirty_region(start, MIN2(scan_limit, end)); assert(!dirty_region.is_empty(), "sanity"); diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp index 78ca4ad8bf9..ca85f50ae25 100644 --- a/src/hotspot/share/gc/g1/heapRegion.cpp +++ b/src/hotspot/share/gc/g1/heapRegion.cpp @@ -91,7 +91,7 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) { GrainWords = GrainBytes >> LogHeapWordSize; guarantee(CardsPerRegion == 0, "we should only set it once"); - CardsPerRegion = GrainBytes >> G1CardTable::card_shift; + CardsPerRegion = GrainBytes >> G1CardTable::card_shift(); LogCardsPerRegion = log2i(CardsPerRegion); diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.cpp b/src/hotspot/share/gc/g1/heapRegionRemSet.cpp index 694496975f5..d4570173f0e 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.cpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.cpp @@ -60,7 +60,7 @@ void HeapRegionRemSet::initialize(MemRegion reserved) { vm_exit_during_initialization("Can not represent all cards in a card region within uint."); } - _split_card_shift = CardBitsWithinCardRegion + CardTable::card_shift; + _split_card_shift = CardBitsWithinCardRegion + CardTable::card_shift(); _split_card_mask = ((size_t)1 << _split_card_shift) - 1; // Check if the card region/region within cards combination can cover the heap. diff --git a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp index eaa2d7f1e56..cd48da2a5bf 100644 --- a/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp +++ b/src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp @@ -118,7 +118,7 @@ inline void HeapRegionRemSet::iterate_for_merge(CardOrRangeVisitor& cl) { void HeapRegionRemSet::split_card(OopOrNarrowOopStar from, uint& card_region, uint& card_within_region) const { size_t offset = pointer_delta(from, _heap_base_address, 1); card_region = (uint)(offset >> _split_card_shift); - card_within_region = (uint)((offset & _split_card_mask) >> CardTable::card_shift); + card_within_region = (uint)((offset & _split_card_mask) >> CardTable::card_shift()); assert(card_within_region < ((uint)1 << G1CardSetContainer::LogCardsPerRegionLimit), "must be"); } @@ -129,7 +129,7 @@ void HeapRegionRemSet::add_reference(OopOrNarrowOopStar from, uint tid) { } uint cur_idx = _hr->hrm_index(); - uintptr_t from_card = uintptr_t(from) >> CardTable::card_shift; + uintptr_t from_card = uintptr_t(from) >> CardTable::card_shift(); if (G1FromCardCache::contains_or_replace(tid, cur_idx, from_card)) { // We can't check whether the card is in the remembered set - the card container diff --git a/src/hotspot/share/gc/parallel/objectStartArray.cpp b/src/hotspot/share/gc/parallel/objectStartArray.cpp index c9c7ac6b796..7768ca5ee00 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.cpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.cpp @@ -31,26 +31,26 @@ #include "services/memTracker.hpp" #include "utilities/align.hpp" -uint ObjectStartArray::block_shift = 0; -uint ObjectStartArray::block_size = 0; -uint ObjectStartArray::block_size_in_words = 0; +uint ObjectStartArray::_card_shift = 0; +uint ObjectStartArray::_card_size = 0; +uint ObjectStartArray::_card_size_in_words = 0; void ObjectStartArray::initialize_block_size(uint card_shift) { - block_shift = card_shift; - block_size = 1 << block_shift; - block_size_in_words = block_size / sizeof(HeapWord); + _card_shift = card_shift; + _card_size = 1 << _card_shift; + _card_size_in_words = _card_size / sizeof(HeapWord); } void ObjectStartArray::initialize(MemRegion reserved_region) { // We're based on the assumption that we use the same // size blocks as the card table. - assert((int)block_size == (int)CardTable::card_size, "Sanity"); - assert(block_size <= MaxBlockSize, "block_size must be less than or equal to " UINT32_FORMAT, MaxBlockSize); + assert(_card_size == CardTable::card_size(), "Sanity"); + assert(_card_size <= MaxBlockSize, "block_size must be less than or equal to " UINT32_FORMAT, MaxBlockSize); // Calculate how much space must be reserved _reserved_region = reserved_region; - size_t bytes_to_reserve = reserved_region.word_size() / block_size_in_words; + size_t bytes_to_reserve = reserved_region.word_size() / _card_size_in_words; assert(bytes_to_reserve > 0, "Sanity"); bytes_to_reserve = @@ -76,7 +76,7 @@ void ObjectStartArray::initialize(MemRegion reserved_region) { MemTracker::record_virtual_memory_type((address)_raw_base, mtGC); - _offset_base = _raw_base - (size_t(reserved_region.start()) >> block_shift); + _offset_base = _raw_base - (size_t(reserved_region.start()) >> _card_shift); _covered_region.set_start(reserved_region.start()); _covered_region.set_word_size(0); @@ -91,10 +91,10 @@ void ObjectStartArray::set_covered_region(MemRegion mr) { HeapWord* low_bound = mr.start(); HeapWord* high_bound = mr.end(); - assert((uintptr_t(low_bound) & (block_size - 1)) == 0, "heap must start at block boundary"); - assert((uintptr_t(high_bound) & (block_size - 1)) == 0, "heap must end at block boundary"); + assert((uintptr_t(low_bound) & (_card_size - 1)) == 0, "heap must start at block boundary"); + assert((uintptr_t(high_bound) & (_card_size - 1)) == 0, "heap must end at block boundary"); - size_t requested_blocks_size_in_bytes = mr.word_size() / block_size_in_words; + size_t requested_blocks_size_in_bytes = mr.word_size() / _card_size_in_words; // Only commit memory in page sized chunks requested_blocks_size_in_bytes = diff --git a/src/hotspot/share/gc/parallel/objectStartArray.hpp b/src/hotspot/share/gc/parallel/objectStartArray.hpp index 02c91d20ded..857b01daa3a 100644 --- a/src/hotspot/share/gc/parallel/objectStartArray.hpp +++ b/src/hotspot/share/gc/parallel/objectStartArray.hpp @@ -46,16 +46,16 @@ class ObjectStartArray : public CHeapObj { jbyte* _raw_base; jbyte* _offset_base; + static uint _card_shift; + static uint _card_size; + static uint _card_size_in_words; + public: enum BlockValueConstants { clean_block = -1 }; - static uint block_shift; - static uint block_size; - static uint block_size_in_words; - // Maximum size an offset table entry can cover. This maximum is derived from that // we need an extra bit for possible offsets in the byte for backskip values, leaving 2^7 possible offsets. // Minimum object alignment is 8 bytes (2^3), so we can at most represent 2^10 offsets within a BOT value. @@ -64,13 +64,24 @@ class ObjectStartArray : public CHeapObj { // Initialize block size based on card size static void initialize_block_size(uint card_shift); + static uint card_shift() { + return _card_shift; + } + + static uint card_size() { + return _card_size; + } + static uint card_size_in_words() { + return _card_size_in_words; + } + protected: // Mapping from address to object start array entry jbyte* block_for_addr(void* p) const { assert(_covered_region.contains(p), "out of bounds access to object start array"); - jbyte* result = &_offset_base[uintptr_t(p) >> block_shift]; + jbyte* result = &_offset_base[uintptr_t(p) >> _card_shift]; assert(_blocks_region.contains(result), "out of bounds result in byte_for"); return result; @@ -81,7 +92,7 @@ class ObjectStartArray : public CHeapObj { assert(_blocks_region.contains(p), "out of bounds access to object start array"); size_t delta = pointer_delta(p, _offset_base, sizeof(jbyte)); - HeapWord* result = (HeapWord*) (delta << block_shift); + HeapWord* result = (HeapWord*) (delta << _card_shift); assert(_covered_region.contains(result), "out of bounds accessor from card marking array"); return result; @@ -104,7 +115,7 @@ class ObjectStartArray : public CHeapObj { } size_t delta = pointer_delta(p, _offset_base, sizeof(jbyte)); - HeapWord* result = (HeapWord*) (delta << block_shift); + HeapWord* result = (HeapWord*) (delta << _card_shift); result += *p; assert(_covered_region.contains(result), diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp index 4f689ec7251..efbaac25d07 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.cpp +++ b/src/hotspot/share/gc/parallel/psOldGen.cpp @@ -152,7 +152,7 @@ size_t PSOldGen::num_iterable_blocks() const { void PSOldGen::object_iterate_block(ObjectClosure* cl, size_t block_index) { size_t block_word_size = IterateBlockSize / HeapWordSize; - assert((block_word_size % (ObjectStartArray::block_size)) == 0, + assert((block_word_size % (ObjectStartArray::card_size())) == 0, "Block size not a multiple of start_array block"); MutableSpace *space = object_space(); diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.cpp b/src/hotspot/share/gc/shared/blockOffsetTable.cpp index b7d58649208..e350e70ad5f 100644 --- a/src/hotspot/share/gc/shared/blockOffsetTable.cpp +++ b/src/hotspot/share/gc/shared/blockOffsetTable.cpp @@ -33,16 +33,16 @@ #include "runtime/java.hpp" #include "services/memTracker.hpp" -uint BOTConstants::LogN = 0; -uint BOTConstants::LogN_words = 0; -uint BOTConstants::N_bytes = 0; -uint BOTConstants::N_words = 0; +uint BOTConstants::_log_card_size = 0; +uint BOTConstants::_log_card_size_in_words = 0; +uint BOTConstants::_card_size = 0; +uint BOTConstants::_card_size_in_words = 0; void BOTConstants::initialize_bot_size(uint card_shift) { - LogN = card_shift; - LogN_words = LogN - LogHeapWordSize; - N_bytes = 1 << LogN; - N_words = 1 << LogN_words; + _log_card_size = card_shift; + _log_card_size_in_words = _log_card_size - LogHeapWordSize; + _card_size = 1 << _log_card_size; + _card_size_in_words = 1 << _log_card_size_in_words; } ////////////////////////////////////////////////////////////////////// @@ -99,7 +99,7 @@ void BlockOffsetSharedArray::resize(size_t new_word_size) { bool BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); - return (delta & right_n_bits((int)BOTConstants::LogN_words)) == (size_t)NoBits; + return (delta & right_n_bits((int)BOTConstants::log_card_size_in_words())) == (size_t)NoBits; } @@ -116,7 +116,7 @@ BlockOffsetArray::BlockOffsetArray(BlockOffsetSharedArray* array, set_init_to_zero(init_to_zero_); if (!init_to_zero_) { // initialize cards to point back to mr.start() - set_remainder_to_point_to_start(mr.start() + BOTConstants::N_words, mr.end()); + set_remainder_to_point_to_start(mr.start() + BOTConstants::card_size_in_words(), mr.end()); _array->set_offset_array(0, 0); // set first card to 0 } } @@ -172,7 +172,7 @@ set_remainder_to_point_to_start(HeapWord* start, HeapWord* end, bool reducing) { size_t start_card = _array->index_for(start); size_t end_card = _array->index_for(end-1); assert(start ==_array->address_for_index(start_card), "Precondition"); - assert(end ==_array->address_for_index(end_card)+BOTConstants::N_words, "Precondition"); + assert(end ==_array->address_for_index(end_card)+BOTConstants::card_size_in_words(), "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card, reducing); // closed interval } @@ -188,7 +188,7 @@ BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size_t return; } assert(start_card > _array->index_for(_bottom), "Cannot be first card"); - assert(_array->offset_array(start_card-1) <= BOTConstants::N_words, + assert(_array->offset_array(start_card-1) <= BOTConstants::card_size_in_words(), "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; @@ -197,7 +197,7 @@ BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size_t // so that the reach ends in this region and not at the start // of the next. size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); - offset = BOTConstants::N_words + i; + offset = BOTConstants::card_size_in_words() + i; if (reach >= end_card) { _array->set_offset_array(start_card_for_region, end_card, offset, reducing); start_card_for_region = reach + 1; @@ -218,13 +218,13 @@ void BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const if (end_card < start_card) { return; } - guarantee(_array->offset_array(start_card) == BOTConstants::N_words, "Wrong value in second card"); - u_char last_entry = BOTConstants::N_words; + guarantee(_array->offset_array(start_card) == BOTConstants::card_size_in_words(), "Wrong value in second card"); + u_char last_entry = BOTConstants::card_size_in_words(); for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { u_char entry = _array->offset_array(c); guarantee(entry >= last_entry, "Monotonicity"); if (c - start_card > BOTConstants::power_to_cards_back(1)) { - guarantee(entry > BOTConstants::N_words, "Should be in logarithmic region"); + guarantee(entry > BOTConstants::card_size_in_words(), "Should be in logarithmic region"); } size_t backskip = BOTConstants::entry_to_cards_back(entry); size_t landing_card = c - backskip; @@ -234,7 +234,7 @@ void BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const } else { guarantee(landing_card == (start_card - 1), "Tautology"); // Note that N_words is the maximum offset value - guarantee(_array->offset_array(landing_card) <= BOTConstants::N_words, "Offset value"); + guarantee(_array->offset_array(landing_card) <= BOTConstants::card_size_in_words(), "Offset value"); } last_entry = entry; // remember for monotonicity test } @@ -266,7 +266,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, uintptr_t start_ui = (uintptr_t)blk_start; // Calculate the last card boundary preceding end of blk intptr_t boundary_before_end = (intptr_t)end_ui; - clear_bits(boundary_before_end, right_n_bits((int)BOTConstants::LogN)); + clear_bits(boundary_before_end, right_n_bits((int)BOTConstants::log_card_size())); if (start_ui <= (uintptr_t)boundary_before_end) { // blk starts at or crosses a boundary // Calculate index of card on which blk begins @@ -279,7 +279,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, if (blk_start != boundary) { // blk starts strictly after boundary // adjust card boundary and start_index forward to next card - boundary += BOTConstants::N_words; + boundary += BOTConstants::card_size_in_words(); start_index++; } assert(start_index <= end_index, "monotonicity of index_for()"); @@ -296,8 +296,8 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, // We have finished marking the "offset card". We need to now // mark the subsequent cards that this blk spans. if (start_index < end_index) { - HeapWord* rem_st = _array->address_for_index(start_index) + BOTConstants::N_words; - HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::N_words; + HeapWord* rem_st = _array->address_for_index(start_index) + BOTConstants::card_size_in_words(); + HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::card_size_in_words(); set_remainder_to_point_to_start(rem_st, rem_end, reducing); } break; @@ -380,22 +380,22 @@ HeapWord* BlockOffsetArrayContigSpace::block_start_unsafe(const void* addr) cons HeapWord* q = _array->address_for_index(index); uint offset = _array->offset_array(index); // Extend u_char to uint. - while (offset > BOTConstants::N_words) { + while (offset > BOTConstants::card_size_in_words()) { // The excess of the offset from N_words indicates a power of Base // to go back by. size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); - q -= (BOTConstants::N_words * n_cards_back); + q -= (BOTConstants::card_size_in_words() * n_cards_back); assert(q >= _sp->bottom(), "Went below bottom!"); index -= n_cards_back; offset = _array->offset_array(index); } - while (offset == BOTConstants::N_words) { + while (offset == BOTConstants::card_size_in_words()) { assert(q >= _sp->bottom(), "Went below bottom!"); - q -= BOTConstants::N_words; + q -= BOTConstants::card_size_in_words(); index--; offset = _array->offset_array(index); } - assert(offset < BOTConstants::N_words, "offset too large"); + assert(offset < BOTConstants::card_size_in_words(), "offset too large"); q -= offset; HeapWord* n = q; @@ -428,14 +428,14 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, "should be past threshold"); assert(blk_start <= _next_offset_threshold, "blk_start should be at or before threshold"); - assert(pointer_delta(_next_offset_threshold, blk_start) <= BOTConstants::N_words, + assert(pointer_delta(_next_offset_threshold, blk_start) <= BOTConstants::card_size_in_words(), "offset should be <= BlockOffsetSharedArray::N"); assert(_sp->is_in_reserved(blk_start), "reference must be into the space"); assert(_sp->is_in_reserved(blk_end-1), "limit must be within the space"); assert(_next_offset_threshold == - _array->_reserved.start() + _next_offset_index*BOTConstants::N_words, + _array->_reserved.start() + _next_offset_index*BOTConstants::card_size_in_words(), "index must agree with threshold"); debug_only(size_t orig_next_offset_index = _next_offset_index;) @@ -457,7 +457,7 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, HeapWord* rem_st = _array->address_for_index(_next_offset_index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::N_words; + HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::card_size_in_words(); set_remainder_to_point_to_start(rem_st, rem_end); } @@ -465,7 +465,7 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, _next_offset_index = end_index + 1; // Calculate _next_offset_threshold this way because end_index // may be the last valid index in the covered region. - _next_offset_threshold = _array->address_for_index(end_index) + BOTConstants::N_words; + _next_offset_threshold = _array->address_for_index(end_index) + BOTConstants::card_size_in_words(); assert(_next_offset_threshold >= blk_end, "Incorrect offset threshold"); #ifdef ASSERT @@ -476,11 +476,11 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, assert((_array->offset_array(orig_next_offset_index) == 0 && blk_start == boundary) || (_array->offset_array(orig_next_offset_index) > 0 && - _array->offset_array(orig_next_offset_index) <= BOTConstants::N_words), + _array->offset_array(orig_next_offset_index) <= BOTConstants::card_size_in_words()), "offset array should have been set"); for (size_t j = orig_next_offset_index + 1; j <= end_index; j++) { assert(_array->offset_array(j) > 0 && - _array->offset_array(j) <= (u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), + _array->offset_array(j) <= (u_char) (BOTConstants::card_size_in_words()+BOTConstants::N_powers-1), "offset array should have been set"); } #endif diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.hpp b/src/hotspot/share/gc/shared/blockOffsetTable.hpp index fef56d31205..7d6ddfdf799 100644 --- a/src/hotspot/share/gc/shared/blockOffsetTable.hpp +++ b/src/hotspot/share/gc/shared/blockOffsetTable.hpp @@ -49,12 +49,12 @@ class ContiguousSpace; class BOTConstants : public AllStatic { -public: - static uint LogN; - static uint LogN_words; - static uint N_bytes; - static uint N_words; + static uint _log_card_size; + static uint _log_card_size_in_words; + static uint _card_size; + static uint _card_size_in_words; +public: // entries "e" of at least N_words mean "go back by Base^(e-N_words)." // All entries are less than "N_words + N_powers". static const uint LogBase = 4; @@ -67,9 +67,22 @@ public: static size_t power_to_cards_back(uint i) { return (size_t)1 << (LogBase * i); } + static size_t entry_to_cards_back(u_char entry) { - assert(entry >= N_words, "Precondition"); - return power_to_cards_back(entry - N_words); + assert(entry >= _card_size_in_words, "Precondition"); + return power_to_cards_back(entry - _card_size_in_words); + } + static uint log_card_size() { + return _log_card_size; + } + static uint log_card_size_in_words() { + return _log_card_size_in_words; + } + static uint card_size() { + return _card_size; + } + static uint card_size_in_words() { + return _card_size_in_words; } }; @@ -91,7 +104,7 @@ public: BlockOffsetTable(HeapWord* bottom, HeapWord* end): _bottom(bottom), _end(end) { assert(_bottom <= _end, "arguments out of order"); - assert(BOTConstants::N_bytes == CardTable::card_size, "sanity"); + assert(BOTConstants::card_size() == CardTable::card_size(), "sanity"); } // Note that the committed size of the covered space may have changed, @@ -178,7 +191,7 @@ class BlockOffsetSharedArray: public CHeapObj { check_reducing_assertion(reducing); assert(index < _vs.committed_size(), "index out of range"); assert(high >= low, "addresses out of order"); - assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large"); + assert(pointer_delta(high, low) <= BOTConstants::card_size_in_words(), "offset too large"); assert(!reducing || _offset_array[index] >= (u_char)pointer_delta(high, low), "Not reducing"); _offset_array[index] = (u_char)pointer_delta(high, low); @@ -189,7 +202,7 @@ class BlockOffsetSharedArray: public CHeapObj { assert(index_for(right - 1) < _vs.committed_size(), "right address out of range"); assert(left < right, "Heap addresses out of order"); - size_t num_cards = pointer_delta(right, left) >> BOTConstants::LogN_words; + size_t num_cards = pointer_delta(right, left) >> BOTConstants::log_card_size_in_words(); fill_range(index_for(left), num_cards, offset); } @@ -206,7 +219,7 @@ class BlockOffsetSharedArray: public CHeapObj { void check_offset_array(size_t index, HeapWord* high, HeapWord* low) const { assert(index < _vs.committed_size(), "index out of range"); assert(high >= low, "addresses out of order"); - assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large"); + assert(pointer_delta(high, low) <= BOTConstants::card_size_in_words(), "offset too large"); assert(_offset_array[index] == pointer_delta(high, low), "Wrong offset"); } @@ -221,7 +234,7 @@ class BlockOffsetSharedArray: public CHeapObj { // to be reserved. size_t compute_size(size_t mem_region_words) { - size_t number_of_slots = (mem_region_words / BOTConstants::N_words) + 1; + size_t number_of_slots = (mem_region_words / BOTConstants::card_size_in_words()) + 1; return ReservedSpace::allocation_align_size_up(number_of_slots); } @@ -335,7 +348,7 @@ class BlockOffsetArray: public BlockOffsetTable { assert(_array->is_card_boundary(new_end), "new _end would not be a card boundary"); // set all the newly added cards - _array->set_offset_array(_end, new_end, BOTConstants::N_words); + _array->set_offset_array(_end, new_end, BOTConstants::card_size_in_words()); } _end = new_end; // update _end } diff --git a/src/hotspot/share/gc/shared/blockOffsetTable.inline.hpp b/src/hotspot/share/gc/shared/blockOffsetTable.inline.hpp index ceb852b4ffc..abaa0dade46 100644 --- a/src/hotspot/share/gc/shared/blockOffsetTable.inline.hpp +++ b/src/hotspot/share/gc/shared/blockOffsetTable.inline.hpp @@ -50,14 +50,14 @@ inline size_t BlockOffsetSharedArray::index_for(const void* p) const { pc < (char*)_reserved.end(), "p not in range."); size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char)); - size_t result = delta >> BOTConstants::LogN; + size_t result = delta >> BOTConstants::log_card_size(); assert(result < _vs.committed_size(), "bad index from address"); return result; } inline HeapWord* BlockOffsetSharedArray::address_for_index(size_t index) const { assert(index < _vs.committed_size(), "bad index"); - HeapWord* result = _reserved.start() + (index << BOTConstants::LogN_words); + HeapWord* result = _reserved.start() + (index << BOTConstants::log_card_size_in_words()); assert(result >= _reserved.start() && result < _reserved.end(), "bad address from index"); return result; diff --git a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp index b66e94836ed..660c324aa99 100644 --- a/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp +++ b/src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp @@ -69,9 +69,9 @@ void CardTableBarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Op if (TwoOperandLIRForm) { LIR_Opr addr_opr = LIR_OprFact::address(new LIR_Address(addr, addr->type())); __ leal(addr_opr, tmp); - __ unsigned_shift_right(tmp, CardTable::card_shift, tmp); + __ unsigned_shift_right(tmp, CardTable::card_shift(), tmp); } else { - __ unsigned_shift_right(addr, CardTable::card_shift, tmp); + __ unsigned_shift_right(addr, CardTable::card_shift(), tmp); } LIR_Address* card_addr; diff --git a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp index 73ea620041b..0a7a032c117 100644 --- a/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp @@ -91,7 +91,7 @@ void CardTableBarrierSetC2::post_barrier(GraphKit* kit, Node* cast = __ CastPX(__ ctrl(), adr); // Divide by card size - Node* card_offset = __ URShiftX(cast, __ ConI(CardTable::card_shift)); + Node* card_offset = __ URShiftX(cast, __ ConI(CardTable::card_shift())); // Combine card table base and card offset Node* card_adr = __ AddP(__ top(), byte_map_base_node(kit), card_offset); diff --git a/src/hotspot/share/gc/shared/cardTable.cpp b/src/hotspot/share/gc/shared/cardTable.cpp index 10e4723934d..2ff5f8d31c3 100644 --- a/src/hotspot/share/gc/shared/cardTable.cpp +++ b/src/hotspot/share/gc/shared/cardTable.cpp @@ -38,27 +38,27 @@ #include "gc/parallel/objectStartArray.hpp" #endif -uint CardTable::card_shift = 0; -uint CardTable::card_size = 0; -uint CardTable::card_size_in_words = 0; +uint CardTable::_card_shift = 0; +uint CardTable::_card_size = 0; +uint CardTable::_card_size_in_words = 0; void CardTable::initialize_card_size() { assert(UseG1GC || UseParallelGC || UseSerialGC, "Initialize card size should only be called by card based collectors."); - card_size = GCCardSizeInBytes; - card_shift = log2i_exact(card_size); - card_size_in_words = card_size / sizeof(HeapWord); + _card_size = GCCardSizeInBytes; + _card_shift = log2i_exact(_card_size); + _card_size_in_words = _card_size / sizeof(HeapWord); // Set blockOffsetTable size based on card table entry size - BOTConstants::initialize_bot_size(card_shift); + BOTConstants::initialize_bot_size(_card_shift); #if INCLUDE_PARALLELGC // Set ObjectStartArray block size based on card table entry size - ObjectStartArray::initialize_block_size(card_shift); + ObjectStartArray::initialize_block_size(_card_shift); #endif - log_info_p(gc, init)("CardTable entry size: " UINT32_FORMAT, card_size); + log_info_p(gc, init)("CardTable entry size: " UINT32_FORMAT, _card_size); } size_t CardTable::compute_byte_map_size() { @@ -82,8 +82,8 @@ CardTable::CardTable(MemRegion whole_heap) : _committed(MemRegion::create_array(_max_covered_regions, mtGC)), _guard_region() { - assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary"); - assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary"); + assert((uintptr_t(_whole_heap.start()) & (_card_size - 1)) == 0, "heap must start at card boundary"); + assert((uintptr_t(_whole_heap.end()) & (_card_size - 1)) == 0, "heap must end at card boundary"); } CardTable::~CardTable() { @@ -120,7 +120,7 @@ void CardTable::initialize() { // // _byte_map = _byte_map_base + (uintptr_t(low_bound) >> card_shift) _byte_map = (CardValue*) heap_rs.base(); - _byte_map_base = _byte_map - (uintptr_t(low_bound) >> card_shift); + _byte_map_base = _byte_map - (uintptr_t(low_bound) >> _card_shift); 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"); @@ -413,7 +413,7 @@ void CardTable::dirty_card_iterate(MemRegion mr, MemRegionClosure* cl) { next_entry <= limit && *next_entry == dirty_card; dirty_cards++, next_entry++); MemRegion cur_cards(addr_for(cur_entry), - dirty_cards*card_size_in_words); + dirty_cards*_card_size_in_words); cl->do_MemRegion(cur_cards); } } @@ -439,7 +439,7 @@ MemRegion CardTable::dirty_card_range_after_reset(MemRegion mr, next_entry <= limit && *next_entry == dirty_card; dirty_cards++, next_entry++); MemRegion cur_cards(addr_for(cur_entry), - dirty_cards*card_size_in_words); + dirty_cards * _card_size_in_words); if (reset) { for (size_t i = 0; i < dirty_cards; i++) { cur_entry[i] = reset_val; @@ -493,7 +493,7 @@ void CardTable::verify_region(MemRegion mr, CardValue val, bool val_equals) { } log_error(gc, verify)("== card " PTR_FORMAT " [" PTR_FORMAT "," PTR_FORMAT "], val: %d", p2i(curr), p2i(addr_for(curr)), - p2i((HeapWord*) (((size_t) addr_for(curr)) + card_size)), + p2i((HeapWord*) (((size_t) addr_for(curr)) + _card_size)), (int) curr_val); } } diff --git a/src/hotspot/share/gc/shared/cardTable.hpp b/src/hotspot/share/gc/shared/cardTable.hpp index bf116a1f1e7..075b961b3cd 100644 --- a/src/hotspot/share/gc/shared/cardTable.hpp +++ b/src/hotspot/share/gc/shared/cardTable.hpp @@ -111,6 +111,11 @@ protected: // a word's worth (row) of clean card values static const intptr_t clean_card_row = (intptr_t)(-1); + // CardTable entry size + static uint _card_shift; + static uint _card_size; + static uint _card_size_in_words; + public: CardTable(MemRegion whole_heap); virtual ~CardTable(); @@ -133,8 +138,8 @@ public: // in, um, words. inline size_t cards_required(size_t covered_words) { // Add one for a guard card, used to detect errors. - const size_t words = align_up(covered_words, card_size_in_words); - return words / card_size_in_words + 1; + const size_t words = align_up(covered_words, _card_size_in_words); + return words / _card_size_in_words + 1; } // Dirty the bytes corresponding to "mr" (not all of which must be @@ -157,7 +162,7 @@ public: "Attempt to access p = " PTR_FORMAT " out of bounds of " " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")", p2i(p), p2i(_whole_heap.start()), p2i(_whole_heap.end())); - CardValue* result = &_byte_map_base[uintptr_t(p) >> card_shift]; + CardValue* result = &_byte_map_base[uintptr_t(p) >> _card_shift]; assert(result >= _byte_map && result < _byte_map + _byte_map_size, "out of bounds accessor for card marking array"); return result; @@ -189,7 +194,7 @@ public: " _byte_map: " PTR_FORMAT " _byte_map + _byte_map_size: " PTR_FORMAT, p2i(p), p2i(_byte_map), p2i(_byte_map + _byte_map_size)); size_t delta = pointer_delta(p, _byte_map_base, sizeof(CardValue)); - HeapWord* result = (HeapWord*) (delta << card_shift); + HeapWord* result = (HeapWord*) (delta << _card_shift); assert(_whole_heap.contains(result), "Returning result = " PTR_FORMAT " out of bounds of " " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")", @@ -228,10 +233,17 @@ public: MemRegion dirty_card_range_after_reset(MemRegion mr, bool reset, int reset_val); - // CardTable entry size - static uint card_shift; - static uint card_size; - static uint card_size_in_words; + static uint card_shift() { + return _card_shift; + } + + static uint card_size() { + return _card_size; + } + + static uint card_size_in_words() { + return _card_size_in_words; + } static constexpr CardValue clean_card_val() { return clean_card; } static constexpr CardValue dirty_card_val() { return dirty_card; } diff --git a/src/hotspot/share/gc/shared/vmStructs_gc.hpp b/src/hotspot/share/gc/shared/vmStructs_gc.hpp index 2de1cc8c57c..f9b1c631123 100644 --- a/src/hotspot/share/gc/shared/vmStructs_gc.hpp +++ b/src/hotspot/share/gc/shared/vmStructs_gc.hpp @@ -261,10 +261,6 @@ declare_constant(BarrierSet::ModRef) \ declare_constant(BarrierSet::CardTableBarrierSet) \ \ - declare_constant(BOTConstants::LogN) \ - declare_constant(BOTConstants::LogN_words) \ - declare_constant(BOTConstants::N_bytes) \ - declare_constant(BOTConstants::N_words) \ declare_constant(BOTConstants::LogBase) \ declare_constant(BOTConstants::Base) \ declare_constant(BOTConstants::N_powers) \ @@ -274,9 +270,6 @@ declare_constant(CardTable::dirty_card) \ declare_constant(CardTable::Precise) \ declare_constant(CardTable::ObjHeadPreciseArray) \ - declare_constant(CardTable::card_shift) \ - declare_constant(CardTable::card_size) \ - declare_constant(CardTable::card_size_in_words) \ \ declare_constant(CollectedHeap::Serial) \ declare_constant(CollectedHeap::Parallel) \ diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index bde6be763ca..63e41d3574c 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -138,7 +138,7 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { CardTable::CardValue* base = ci_card_table_address(); assert(base != NULL, "unexpected byte_map_base"); cardtable_start_address = base; - cardtable_shift = CardTable::card_shift; + cardtable_shift = CardTable::card_shift(); } else { // No card mark barriers cardtable_start_address = 0; diff --git a/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp b/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp index 9a69816558b..2cf82eb4037 100644 --- a/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp +++ b/test/hotspot/gtest/gc/g1/test_freeRegionList.cpp @@ -57,7 +57,7 @@ TEST_VM(FreeRegionList, length) { bot_rs.size(), os::vm_page_size(), HeapRegion::GrainBytes, - BOTConstants::N_bytes, + BOTConstants::card_size(), mtGC); G1BlockOffsetTable bot(heap, bot_storage); bot_storage->commit_regions(0, num_regions_in_test); diff --git a/test/hotspot/gtest/gc/g1/test_g1CardSetContainers.cpp b/test/hotspot/gtest/gc/g1/test_g1CardSetContainers.cpp index c2ebeadd481..9283fc3303f 100644 --- a/test/hotspot/gtest/gc/g1/test_g1CardSetContainers.cpp +++ b/test/hotspot/gtest/gc/g1/test_g1CardSetContainers.cpp @@ -240,7 +240,7 @@ TEST_VM_F(G1CardSetContainersTest, basic_cardset_inptr_test) { uint const max = (uint)log2i(HeapRegionBounds::max_size()); for (uint i = min; i <= max; i++) { - G1CardSetContainersTest::cardset_inlineptr_test(i - CardTable::card_shift); + G1CardSetContainersTest::cardset_inlineptr_test(i - CardTable::card_shift()); } } -- GitLab From ab781874b27ee4fe1bc6b5fa2cd7997e451e2026 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 6 Dec 2021 15:43:42 +0000 Subject: [PATCH 626/890] 8277105: Inconsistent handling of missing permitted subclasses Reviewed-by: vromero --- .../com/sun/tools/javac/comp/Flow.java | 33 ++- .../tools/javac/patterns/Exhaustiveness.java | 96 --------- .../sealed/MissingPermittedSubtypes.java | 199 ++++++++++++++++++ 3 files changed, 214 insertions(+), 114 deletions(-) create mode 100644 test/langtools/tools/javac/sealed/MissingPermittedSubtypes.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java index eaff2f1106d..1346d141bb7 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java @@ -207,7 +207,6 @@ public class Flow { private final JCDiagnostic.Factory diags; private Env attrEnv; private Lint lint; - private final DeferredCompletionFailureHandler dcfh; private final boolean allowEffectivelyFinalInInnerClasses; public static Flow instance(Context context) { @@ -332,7 +331,6 @@ public class Flow { lint = Lint.instance(context); rs = Resolve.instance(context); diags = JCDiagnostic.Factory.instance(context); - dcfh = DeferredCompletionFailureHandler.instance(context); Source source = Source.instance(context); allowEffectivelyFinalInInnerClasses = Feature.EFFECTIVELY_FINAL_IN_INNER_CLASSES.allowedInSource(source); } @@ -693,7 +691,7 @@ public class Flow { } if (!tree.hasTotalPattern && exhaustiveSwitch && !TreeInfo.isErrorEnumSwitch(tree.selector, tree.cases) && - (constants == null || !isExhaustive(tree.selector.type, constants))) { + (constants == null || !isExhaustive(tree.selector.pos(), tree.selector.type, constants))) { log.error(tree, Errors.NotExhaustiveStatement); } if (!tree.hasTotalPattern) { @@ -728,7 +726,7 @@ public class Flow { } } if (!tree.hasTotalPattern && !TreeInfo.isErrorEnumSwitch(tree.selector, tree.cases) && - !isExhaustive(tree.selector.type, constants)) { + !isExhaustive(tree.selector.pos(), tree.selector.type, constants)) { log.error(tree, Errors.NotExhaustive); } alive = prevAlive; @@ -751,7 +749,7 @@ public class Flow { } } - private void transitiveCovers(Type seltype, Set covered) { + private void transitiveCovers(DiagnosticPosition pos, Type seltype, Set covered) { List todo = List.from(covered); while (todo.nonEmpty()) { Symbol sym = todo.head; @@ -773,7 +771,7 @@ public class Flow { case TYP -> { for (Type sup : types.directSupertypes(sym.type)) { if (sup.tsym.kind == TYP) { - if (isTransitivelyCovered(seltype, sup.tsym, covered) && + if (isTransitivelyCovered(pos, seltype, sup.tsym, covered) && covered.add(sup.tsym)) { todo = todo.prepend(sup.tsym); } @@ -784,9 +782,8 @@ public class Flow { } } - private boolean isTransitivelyCovered(Type seltype, Symbol sealed, Set covered) { - DeferredCompletionFailureHandler.Handler prevHandler = - dcfh.setHandler(dcfh.speculativeCodeHandler); + private boolean isTransitivelyCovered(DiagnosticPosition pos, Type seltype, + Symbol sealed, Set covered) { try { if (covered.stream().anyMatch(c -> sealed.isSubClass(c, types))) return true; @@ -796,30 +793,30 @@ public class Flow { .filter(s -> { return types.isCastable(seltype, s.type/*, types.noWarnings*/); }) - .allMatch(s -> isTransitivelyCovered(seltype, s, covered)); + .allMatch(s -> isTransitivelyCovered(pos, seltype, s, covered)); } return false; } catch (CompletionFailure cf) { - //safe to ignore, the symbol will be un-completed when the speculative handler is removed. - return false; - } finally { - dcfh.setHandler(prevHandler); + chk.completionError(pos, cf); + return true; } } - private boolean isExhaustive(Type seltype, Set covered) { - transitiveCovers(seltype, covered); + private boolean isExhaustive(DiagnosticPosition pos, Type seltype, Set covered) { + transitiveCovers(pos, seltype, covered); return switch (seltype.getTag()) { case CLASS -> { if (seltype.isCompound()) { if (seltype.isIntersection()) { - yield ((Type.IntersectionClassType) seltype).getComponents().stream().anyMatch(t -> isExhaustive(t, covered)); + yield ((Type.IntersectionClassType) seltype).getComponents() + .stream() + .anyMatch(t -> isExhaustive(pos, t, covered)); } yield false; } yield covered.contains(seltype.tsym); } - case TYPEVAR -> isExhaustive(((TypeVar) seltype).getUpperBound(), covered); + case TYPEVAR -> isExhaustive(pos, ((TypeVar) seltype).getUpperBound(), covered); default -> false; }; } diff --git a/test/langtools/tools/javac/patterns/Exhaustiveness.java b/test/langtools/tools/javac/patterns/Exhaustiveness.java index 36c824deeee..b7db66c3231 100644 --- a/test/langtools/tools/javac/patterns/Exhaustiveness.java +++ b/test/langtools/tools/javac/patterns/Exhaustiveness.java @@ -369,102 +369,6 @@ public class Exhaustiveness extends TestRunner { """); } - @Test - public void testInaccessiblePermitted(Path base) throws IOException { - Path current = base.resolve("."); - Path libSrc = current.resolve("lib-src"); - - tb.writeJavaFiles(libSrc, - """ - package lib; - public sealed interface S permits A, B {} - """, - """ - package lib; - public final class A implements S {} - """, - """ - package lib; - final class B implements S {} - """); - - Path libClasses = current.resolve("libClasses"); - - Files.createDirectories(libClasses); - - new JavacTask(tb) - .options("--enable-preview", - "-source", JAVA_VERSION) - .outdir(libClasses) - .files(tb.findJavaFiles(libSrc)) - .run(); - - Path src = current.resolve("src"); - tb.writeJavaFiles(src, - """ - package test; - import lib.*; - public class Test { - private int test(S obj) { - return switch (obj) { - case A a -> 0; - }; - } - } - """); - - Path classes = current.resolve("libClasses"); - - Files.createDirectories(libClasses); - - var log = - new JavacTask(tb) - .options("--enable-preview", - "-source", JAVA_VERSION, - "-XDrawDiagnostics", - "-Xlint:-preview", - "--class-path", libClasses.toString()) - .outdir(classes) - .files(tb.findJavaFiles(src)) - .run(Task.Expect.FAIL) - .writeAll() - .getOutputLines(Task.OutputKind.DIRECT); - - List expectedErrors = List.of( - "Test.java:5:16: compiler.err.not.exhaustive", - "- compiler.note.preview.filename: Test.java, DEFAULT", - "- compiler.note.preview.recompile", - "1 error"); - - if (!expectedErrors.equals(log)) { - throw new AssertionError("Incorrect errors, expected: " + expectedErrors + - ", actual: " + log); - } - - Path bClass = libClasses.resolve("lib").resolve("B.class"); - - Files.delete(bClass); - - var log2 = - new JavacTask(tb) - .options("--enable-preview", - "-source", JAVA_VERSION, - "-XDrawDiagnostics", - "-Xlint:-preview", - "--class-path", libClasses.toString()) - .outdir(classes) - .files(tb.findJavaFiles(src)) - .run(Task.Expect.FAIL) - .writeAll() - .getOutputLines(Task.OutputKind.DIRECT); - - if (!expectedErrors.equals(log2)) { - throw new AssertionError("Incorrect errors, expected: " + expectedErrors + - ", actual: " + log2); - } - - } - @Test public void testExhaustiveStatement1(Path base) throws Exception { doTest(base, diff --git a/test/langtools/tools/javac/sealed/MissingPermittedSubtypes.java b/test/langtools/tools/javac/sealed/MissingPermittedSubtypes.java new file mode 100644 index 00000000000..ba75407099a --- /dev/null +++ b/test/langtools/tools/javac/sealed/MissingPermittedSubtypes.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2021, 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 8277105 + * @summary Verify missing permitted subtype is handled properly for both casts and pattern switches. + * @library /tools/lib + * @modules jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.util + * @build toolbox.ToolBox toolbox.JavacTask + * @run main MissingPermittedSubtypes +*/ + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import toolbox.TestRunner; +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.ToolBox; + +public class MissingPermittedSubtypes extends TestRunner { + + private static final String JAVA_VERSION = System.getProperty("java.specification.version"); + + ToolBox tb; + + public static void main(String... args) throws Exception { + new MissingPermittedSubtypes().runTests(); + } + + MissingPermittedSubtypes() { + super(System.err); + tb = new ToolBox(); + } + + public void runTests() throws Exception { + runTests(m -> new Object[] { Paths.get(m.getName()) }); + } + + @Test + public void testInaccessiblePermitted(Path base) throws IOException { + Path current = base.resolve("."); + Path libSrc = current.resolve("lib-src"); + + tb.writeJavaFiles(libSrc, + """ + package lib; + public sealed interface S permits A, B1, B2 {} + """, + """ + package lib; + public final class A implements S {} + """, + """ + package lib; + final class B1 implements S {} + """, + """ + package lib; + final class B2 implements S, Runnable { + public void run() {} + } + """); + + Path libClasses = current.resolve("libClasses"); + + Files.createDirectories(libClasses); + + new JavacTask(tb) + .options("--enable-preview", + "-source", JAVA_VERSION) + .outdir(libClasses) + .files(tb.findJavaFiles(libSrc)) + .run(); + + Path b1Class = libClasses.resolve("lib").resolve("B1.class"); + + Files.delete(b1Class); + + Path b2Class = libClasses.resolve("lib").resolve("B2.class"); + + Files.delete(b2Class); + + { + Path src1 = current.resolve("src1"); + tb.writeJavaFiles(src1, + """ + package test; + import lib.*; + public class Test1 { + private void test(S obj) { + int i = switch (obj) { + case A a -> 0; + }; + Runnable r = () -> {obj = null;}; + } + } + """); + + Path classes1 = current.resolve("classes1"); + + Files.createDirectories(classes1); + + var log = + new JavacTask(tb) + .options("--enable-preview", + "-source", JAVA_VERSION, + "-XDrawDiagnostics", + "-Xlint:-preview", + "--class-path", libClasses.toString()) + .outdir(classes1) + .files(tb.findJavaFiles(src1)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + List expectedErrors = List.of( + "Test1.java:5:24: compiler.err.cant.access: lib.B1, (compiler.misc.class.file.not.found: lib.B1)", + "Test1.java:8:29: compiler.err.cant.ref.non.effectively.final.var: obj, (compiler.misc.lambda)", + "- compiler.note.preview.filename: Test1.java, DEFAULT", + "- compiler.note.preview.recompile", + "2 errors"); + + if (!expectedErrors.equals(log)) { + throw new AssertionError("Incorrect errors, expected: " + expectedErrors + + ", actual: " + log); + } + } + + { + Path src2 = current.resolve("src2"); + tb.writeJavaFiles(src2, + """ + package test; + import lib.*; + public class Test1 { + private void test(S obj) { + Runnable r = (Runnable) obj; + String s = (String) obj; + } + } + """); + + Path classes2 = current.resolve("classes2"); + + Files.createDirectories(classes2); + + var log = + new JavacTask(tb) + .options("--enable-preview", + "-source", JAVA_VERSION, + "-XDrawDiagnostics", + "-Xlint:-preview", + "--class-path", libClasses.toString()) + .outdir(classes2) + .files(tb.findJavaFiles(src2)) + .run(Task.Expect.FAIL) + .writeAll() + .getOutputLines(Task.OutputKind.DIRECT); + + List expectedErrors = List.of( + "Test1.java:5:19: compiler.err.cant.access: lib.B1, (compiler.misc.class.file.not.found: lib.B1)", + "Test1.java:6:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: lib.S, java.lang.String)", + "2 errors"); + + if (!expectedErrors.equals(log)) { + throw new AssertionError("Incorrect errors, expected: " + expectedErrors + + ", actual: " + log); + } + } + } + +} -- GitLab From 082fdf479367612a7bd795d3becfe9830db4b2d6 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Mon, 6 Dec 2021 16:08:28 +0000 Subject: [PATCH 627/890] 8172065: javax/swing/JTree/4908142/bug4908142.java The selected index should be "aad" Reviewed-by: aivanov --- test/jdk/javax/swing/JTree/4908142/bug4908142.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JTree/4908142/bug4908142.java b/test/jdk/javax/swing/JTree/4908142/bug4908142.java index 671af8abd2d..784feda153d 100644 --- a/test/jdk/javax/swing/JTree/4908142/bug4908142.java +++ b/test/jdk/javax/swing/JTree/4908142/bug4908142.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -60,6 +60,7 @@ public class bug4908142 { }); robot.waitForIdle(); + robot.delay(1000); SwingUtilities.invokeAndWait(new Runnable() { @@ -70,12 +71,14 @@ public class bug4908142 { }); robot.waitForIdle(); - + robot.delay(500); robot.keyPress(KeyEvent.VK_A); robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); robot.keyPress(KeyEvent.VK_A); robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); robot.keyPress(KeyEvent.VK_D); robot.keyRelease(KeyEvent.VK_D); robot.waitForIdle(); @@ -114,6 +117,7 @@ public class bug4908142 { JScrollPane sp = new JScrollPane(tree); fr.getContentPane().add(sp); + fr.setLocationRelativeTo(null); fr.setSize(200, 200); fr.setVisible(true); } -- GitLab From 587e5409c2488cf8c3579a4932c588efc5a02749 Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Mon, 6 Dec 2021 16:09:45 +0000 Subject: [PATCH 628/890] 8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> \(a java\.lang\.Class ...' Reviewed-by: kevinw, sspitsyn --- .../serviceability/sa/LingeredAppWithLock.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java index 9acf9d3bbb9..4140a3e3381 100644 --- a/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java +++ b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -47,6 +47,19 @@ public class LingeredAppWithLock extends LingeredApp { objectLock.start(); primitiveLock.start(); + // Wait until all threads have reached their blocked or timed wait state + while ((classLock1.getState() != Thread.State.BLOCKED && + classLock1.getState() != Thread.State.TIMED_WAITING) || + (classLock2.getState() != Thread.State.BLOCKED && + classLock2.getState() != Thread.State.TIMED_WAITING) || + (objectLock.getState() != Thread.State.TIMED_WAITING) || + (primitiveLock.getState() != Thread.State.TIMED_WAITING)) { + try { + Thread.sleep(100); + } catch (InterruptedException ex) { + } + } + LingeredApp.main(args); } } -- GitLab From 5045eb538b3afc6cf646642f1109473597b3004a Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 6 Dec 2021 16:56:27 +0000 Subject: [PATCH 629/890] 8278273: Remove unnecessary exclusion of doclint accessibility checks Reviewed-by: iris, alanb, ihse --- make/modules/java.base/Java.gmk | 4 ++-- make/modules/java.instrument/Java.gmk | 4 ++-- make/modules/java.logging/Java.gmk | 4 ++-- make/modules/java.management/Java.gmk | 4 ++-- make/modules/java.smartcardio/Java.gmk | 4 ++-- make/modules/java.sql.rowset/Java.gmk | 4 ++-- make/modules/java.xml/Java.gmk | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/make/modules/java.base/Java.gmk b/make/modules/java.base/Java.gmk index 58d707e6148..b5bd86ada54 100644 --- a/make/modules/java.base/Java.gmk +++ b/make/modules/java.base/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,7 +23,7 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \ +DOCLINT += -Xdoclint:all/protected,-reference \ '-Xdoclint/package:java.*,javax.*' JAVAC_FLAGS += -XDstringConcat=inline COPY += .icu .dat .spp .nrm content-types.properties \ diff --git a/make/modules/java.instrument/Java.gmk b/make/modules/java.instrument/Java.gmk index 5f46b155e0c..f49e425718e 100644 --- a/make/modules/java.instrument/Java.gmk +++ b/make/modules/java.instrument/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,5 +23,5 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-accessibility \ +DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:java.*,javax.*' diff --git a/make/modules/java.logging/Java.gmk b/make/modules/java.logging/Java.gmk index 40da53d432b..a6641fc1485 100644 --- a/make/modules/java.logging/Java.gmk +++ b/make/modules/java.logging/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,5 +23,5 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \ +DOCLINT += -Xdoclint:all/protected,-reference \ '-Xdoclint/package:java.*,javax.*' diff --git a/make/modules/java.management/Java.gmk b/make/modules/java.management/Java.gmk index 40da53d432b..a6641fc1485 100644 --- a/make/modules/java.management/Java.gmk +++ b/make/modules/java.management/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,5 +23,5 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \ +DOCLINT += -Xdoclint:all/protected,-reference \ '-Xdoclint/package:java.*,javax.*' diff --git a/make/modules/java.smartcardio/Java.gmk b/make/modules/java.smartcardio/Java.gmk index 5f46b155e0c..f49e425718e 100644 --- a/make/modules/java.smartcardio/Java.gmk +++ b/make/modules/java.smartcardio/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,5 +23,5 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-accessibility \ +DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:java.*,javax.*' diff --git a/make/modules/java.sql.rowset/Java.gmk b/make/modules/java.sql.rowset/Java.gmk index 2ea5be28ed1..63437c6113f 100644 --- a/make/modules/java.sql.rowset/Java.gmk +++ b/make/modules/java.sql.rowset/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,7 +23,7 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-accessibility \ +DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:java.*,javax.*' CLEAN_FILES += $(wildcard \ $(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \ diff --git a/make/modules/java.xml/Java.gmk b/make/modules/java.xml/Java.gmk index b7bf8b70165..aa4b786020f 100644 --- a/make/modules/java.xml/Java.gmk +++ b/make/modules/java.xml/Java.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -23,7 +23,7 @@ # questions. # -DOCLINT += -Xdoclint:all/protected,-accessibility \ +DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \ javax.xml.transform javax.xml.validation javax.xml.xpath)' CLEAN += .properties -- GitLab From 70bad89b012eb200ca1e76f384a6e5fb307cf26d Mon Sep 17 00:00:00 2001 From: Artem Semenov Date: Mon, 6 Dec 2021 17:39:43 +0000 Subject: [PATCH 630/890] 8277497: Last column cell in the JTAble row is read as empty cell Reviewed-by: ant, kizune, pbansal --- .../share/classes/javax/swing/JLabel.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/java.desktop/share/classes/javax/swing/JLabel.java b/src/java.desktop/share/classes/javax/swing/JLabel.java index bb1db1fdfb8..8dff4a8fd25 100644 --- a/src/java.desktop/share/classes/javax/swing/JLabel.java +++ b/src/java.desktop/share/classes/javax/swing/JLabel.java @@ -1075,6 +1075,10 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * @see AccessibleContext#setAccessibleName */ public String getAccessibleName() { + return getAccessibleNameCheckIcon(getAccessibleNameImpl()); + } + + private String getAccessibleNameImpl() { String name = accessibleName; if (name == null) { @@ -1089,6 +1093,19 @@ public class JLabel extends JComponent implements SwingConstants, Accessible return name; } + private String getAccessibleNameCheckIcon(String name) { + if (((name == null) || name.isEmpty()) && + (JLabel.this.getIcon() != null)) { + if (JLabel.this.getIcon() instanceof Accessible) { + AccessibleContext ac = ((Accessible) JLabel.this.getIcon()).getAccessibleContext(); + if (ac != null) { + name = ac.getAccessibleName(); + } + } + } + return name; + } + /** * Get the role of this object. * @@ -1097,6 +1114,11 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * @see AccessibleRole */ public AccessibleRole getAccessibleRole() { + String name = getAccessibleNameImpl(); + if (((name == null) || name.isEmpty()) && + (JLabel.this.getIcon() != null)) { + return AccessibleRole.ICON; + } return AccessibleRole.LABEL; } -- GitLab From 2c31a1735d5b8646ed8984a5475d5c8c9c91c19d Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Mon, 6 Dec 2021 18:00:54 +0000 Subject: [PATCH 631/890] 8275082: Update XML Security for Java to 2.3.0 Reviewed-by: mullan --- .../apache/xml/internal/security/Init.java | 10 +- .../implementations/IntegrityHmac.java | 2 +- .../Canonicalizer20010315.java | 2 +- .../implementations/CanonicalizerBase.java | 6 +- .../CanonicalizerPhysical.java | 2 +- .../implementations/NameSpaceSymbTable.java | 2 +- .../XMLSecurityRuntimeException.java | 181 ------------------ .../keys/keyresolver/KeyResolver.java | 12 +- .../KeyInfoReferenceResolver.java | 3 +- .../xml/internal/security/resource/config.xml | 2 - .../resource/xmlsecurity_en.properties | 3 +- .../security/signature/XMLSignatureInput.java | 15 +- .../implementations/TransformC14N.java | 2 +- .../TransformC14NExclusive.java | 2 +- .../TransformEnvelopedSignature.java | 8 +- .../implementations/TransformXPath.java | 15 +- .../xml/internal/security/utils/Base64.java | 1 + .../security/utils/DOMNamespaceContext.java | 6 +- .../security/utils/RFC2253Parser.java | 114 +++++------ .../xml/internal/security/utils/XMLUtils.java | 2 +- .../utils/resolver/ResourceResolver.java | 13 +- .../resolver/ResourceResolverContext.java | 1 - .../implementations/ResolverDirectHTTP.java | 5 +- .../ResolverLocalFilesystem.java | 45 +---- .../internal/dom/ApacheCanonicalizer.java | 3 - .../xml/dsig/internal/dom/DOMReference.java | 2 +- .../xml/dsig/internal/dom/DOMTransform.java | 2 +- .../dsig/internal/dom/DOMURIDereferencer.java | 2 +- .../org/jcp/xml/dsig/internal/dom/Policy.java | 25 ++- .../org/jcp/xml/dsig/internal/dom/Utils.java | 2 +- .../jcp/xml/dsig/internal/dom/XMLDSigRI.java | 2 +- src/java.xml.crypto/share/legal/santuario.md | 2 +- 32 files changed, 141 insertions(+), 353 deletions(-) delete mode 100644 src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityRuntimeException.java diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java index 4c51e7b5e83..a35a4699d82 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/Init.java @@ -84,7 +84,7 @@ public class Init { } @SuppressWarnings("removal") - InputStream is = + InputStream is = //NOPMD AccessController.doPrivileged( (PrivilegedAction) () -> { @@ -351,6 +351,9 @@ public class Init { * @param callingClass The Class object of the calling object */ public static URL getResource(String resourceName, Class callingClass) { + if (resourceName == null) { + throw new NullPointerException(); + } URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName); if (url == null && resourceName.charAt(0) == '/') { //certain classloaders need it without the leading / @@ -404,6 +407,9 @@ public class Init { * @param callingClass The Class object of the calling object */ private static List getResources(String resourceName, Class callingClass) { + if (resourceName == null) { + throw new NullPointerException(); + } List ret = new ArrayList<>(); Enumeration urls = new Enumeration() { public boolean hasMoreElements() { @@ -479,7 +485,7 @@ public class Init { } - if (ret.isEmpty() && resourceName != null && resourceName.charAt(0) != '/') { + if (ret.isEmpty() && resourceName.charAt(0) != '/') { return getResources('/' + resourceName, callingClass); } return ret; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java index 90302d47844..fdaf8643279 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/IntegrityHmac.java @@ -309,7 +309,7 @@ public abstract class IntegrityHmac extends SignatureAlgorithmSpi { Node n = XMLUtils.selectDsNode(element.getFirstChild(), Constants._TAG_HMACOUTPUTLENGTH, 0); if (n != null) { String hmacLength = XMLUtils.getFullTextChildrenFromNode(n); - if (hmacLength != null && !"".equals(hmacLength)) { + if (hmacLength != null && hmacLength.length() != 0) { this.hmacOutputLength = new HMACOutputLength(Integer.parseInt(hmacLength)); } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java index 1ed26fea60b..f0cd610b320 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/Canonicalizer20010315.java @@ -125,7 +125,7 @@ public abstract class Canonicalizer20010315 extends CanonicalizerBase { * Output the Attr[]s for the given element. *
      * The code of this method is a copy of - * {@link #outputAttributes(Element, NameSpaceSymbTable, Map)}, + * {@link #outputAttributes(Element, NameSpaceSymbTable, Map, OutputStream)}, * whereas it takes into account that subtree-c14n is -- well -- subtree-based. * So if the element in question isRoot of c14n, it's parent is not in the * node set, as well as all other ancestors. diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java index d3b972c95f8..ce971a45a98 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerBase.java @@ -211,7 +211,7 @@ public abstract class CanonicalizerBase extends CanonicalizerSpi { Node sibling = null; Node parentNode = null; Map cache = new HashMap<>(); - do { + do { //NOPMD switch (currentNode.getNodeType()) { case Node.ENTITY_NODE : @@ -338,7 +338,7 @@ public abstract class CanonicalizerBase extends CanonicalizerSpi { Node parentNode = null; int documentLevel = NODE_BEFORE_DOCUMENT_ELEMENT; Map cache = new HashMap<>(); - do { + do { //NOPMD switch (currentNode.getNodeType()) { case Node.ENTITY_NODE : @@ -560,7 +560,7 @@ public abstract class CanonicalizerBase extends CanonicalizerSpi { } parents.clear(); Attr nsprefix = ns.getMappingWithoutRendered(XMLNS); - if (nsprefix != null && "".equals(nsprefix.getValue())) { + if (nsprefix != null && nsprefix.getValue().length() == 0) { ns.addMappingAndRender( XMLNS, "", getNullNode(nsprefix.getOwnerDocument())); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java index 4b2333938f5..66ad12029fc 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/CanonicalizerPhysical.java @@ -110,7 +110,7 @@ public class CanonicalizerPhysical extends CanonicalizerBase { * Output the Attr[]s for the given element. *
      * The code of this method is a copy of - * {@link #outputAttributes(Element, NameSpaceSymbTable, Map)}, + * {@link #outputAttributes(Element, NameSpaceSymbTable, Map, OutputStream)}, * whereas it takes into account that subtree-c14n is -- well -- subtree-based. * So if the element in question isRoot of c14n, it's parent is not in the * node set, as well as all other ancestors. diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java index 2fc853fe690..f0b1903accd 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/NameSpaceSymbTable.java @@ -348,7 +348,7 @@ class SymbMap implements Cloneable { List entrySet() { List a = new ArrayList<>(); for (int i = 0;i < entries.length;i++) { - if (entries[i] != null && !"".equals(entries[i].uri)) { + if (entries[i] != null && entries[i].uri.length() != 0) { a.add(entries[i]); } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityRuntimeException.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityRuntimeException.java deleted file mode 100644 index 7d17fe867e1..00000000000 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/exceptions/XMLSecurityRuntimeException.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * reserved comment block - * DO NOT REMOVE OR ALTER! - */ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.sun.org.apache.xml.internal.security.exceptions; - -import java.text.MessageFormat; - -import com.sun.org.apache.xml.internal.security.utils.Constants; -import com.sun.org.apache.xml.internal.security.utils.I18n; - -/** - * The mother of all runtime Exceptions in this bundle. It allows exceptions to have - * their messages translated to the different locales. - * - * The {@code xmlsecurity_en.properties} file contains this line: - *

      - * xml.WrongElement = Can't create a {0} from a {1} element
      - * 
      - * - * Usage in the Java source is: - *
      - * {
      - *    Object[] exArgs = { Constants._TAG_TRANSFORMS, "BadElement" };
      - *
      - *    throw new XMLSecurityException("xml.WrongElement", exArgs);
      - * }
      - * 
      - * - * Additionally, if another Exception has been caught, we can supply it, too - *
      - * try {
      - *    ...
      - * } catch (Exception oldEx) {
      - *    Object[] exArgs = { Constants._TAG_TRANSFORMS, "BadElement" };
      - *
      - *    throw new XMLSecurityException("xml.WrongElement", exArgs, oldEx);
      - * }
      - * 
      - * - * - */ -public class XMLSecurityRuntimeException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - /** Field msgID */ - protected String msgID; - - /** - * Constructor XMLSecurityRuntimeException - * - */ - public XMLSecurityRuntimeException() { - super("Missing message string"); - - this.msgID = null; - } - - /** - * Constructor XMLSecurityRuntimeException - * - * @param msgID - */ - public XMLSecurityRuntimeException(String msgID) { - super(I18n.getExceptionMessage(msgID)); - - this.msgID = msgID; - } - - /** - * Constructor XMLSecurityRuntimeException - * - * @param msgID - * @param exArgs - */ - public XMLSecurityRuntimeException(String msgID, Object[] exArgs) { - super(MessageFormat.format(I18n.getExceptionMessage(msgID), exArgs)); - - this.msgID = msgID; - } - - /** - * Constructor XMLSecurityRuntimeException - * - * @param originalException - */ - public XMLSecurityRuntimeException(Exception originalException) { - super("Missing message ID to locate message string in resource bundle \"" - + Constants.exceptionMessagesResourceBundleBase - + "\". Original Exception was a " - + originalException.getClass().getName() + " and message " - + originalException.getMessage(), originalException); - } - - /** - * Constructor XMLSecurityRuntimeException - * - * @param msgID - * @param originalException - */ - public XMLSecurityRuntimeException(String msgID, Exception originalException) { - super(I18n.getExceptionMessage(msgID, originalException), originalException); - - this.msgID = msgID; - } - - /** - * Constructor XMLSecurityRuntimeException - * - * @param msgID - * @param exArgs - * @param originalException - */ - public XMLSecurityRuntimeException(String msgID, Object[] exArgs, Exception originalException) { - super(MessageFormat.format(I18n.getExceptionMessage(msgID), exArgs), originalException); - - this.msgID = msgID; - } - - /** - * Method getMsgID - * - * @return the messageId - */ - public String getMsgID() { - if (msgID == null) { - return "Missing message ID"; - } - return msgID; - } - - /** {@inheritDoc} */ - public String toString() { - String s = this.getClass().getName(); - String message = super.getLocalizedMessage(); - - if (message != null) { - message = s + ": " + message; - } else { - message = s; - } - - if (this.getCause() != null) { - message = message + "\nOriginal Exception was " + this.getCause().toString(); - } - - return message; - } - - /** - * Method getOriginalException - * - * @return the original exception - */ - public Exception getOriginalException() { - if (this.getCause() instanceof Exception) { - return (Exception)this.getCause(); - } - return null; - } - -} diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java index 7aa9a30128a..7445013e9cb 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java @@ -170,8 +170,8 @@ public class KeyResolver { ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException { JavaUtils.checkRegisterPermission(); - KeyResolverSpi keyResolverSpi = - (KeyResolverSpi) JavaUtils.newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, KeyResolver.class)); + KeyResolverSpi keyResolverSpi = (KeyResolverSpi) + JavaUtils.newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, KeyResolver.class)); register(keyResolverSpi, false); } @@ -193,8 +193,8 @@ public class KeyResolver { KeyResolverSpi keyResolverSpi = null; Exception ex = null; try { - keyResolverSpi = (KeyResolverSpi) JavaUtils.newInstanceWithEmptyConstructor( - ClassLoaderUtils.loadClass(className, KeyResolver.class)); + keyResolverSpi = (KeyResolverSpi) + JavaUtils.newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, KeyResolver.class)); register(keyResolverSpi, true); } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | InvocationTargetException e) { ex = e; @@ -253,8 +253,8 @@ public class KeyResolver { JavaUtils.checkRegisterPermission(); List keyResolverList = new ArrayList<>(classNames.size()); for (String className : classNames) { - KeyResolverSpi keyResolverSpi = (KeyResolverSpi)JavaUtils - .newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, KeyResolver.class)); + KeyResolverSpi keyResolverSpi = (KeyResolverSpi) + JavaUtils.newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, KeyResolver.class)); keyResolverList.add(keyResolverSpi); } resolverList.addAll(keyResolverList); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/KeyInfoReferenceResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/KeyInfoReferenceResolver.java index fb32875c1b1..101fd2d12a5 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/KeyInfoReferenceResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/KeyInfoReferenceResolver.java @@ -162,6 +162,7 @@ public class KeyInfoReferenceResolver extends KeyResolverSpi { validateReference(referentElement, secureValidation); KeyInfo referent = new KeyInfo(referentElement, baseURI); + referent.setSecureValidation(secureValidation); referent.addStorageResolver(storage); return referent; } @@ -181,7 +182,7 @@ public class KeyInfoReferenceResolver extends KeyResolverSpi { } KeyInfo referent = new KeyInfo(referentElement, ""); - if (referent.containsKeyInfoReference()) { + if (referent.containsKeyInfoReference() || referent.containsRetrievalMethod()) { if (secureValidation) { throw new XMLSecurityException("KeyInfoReferenceResolver.InvalidReferentElement.ReferenceWithSecure"); } else { diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/config.xml b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/config.xml index 603d49e0ad5..bbd26a399ca 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/config.xml +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/resource/config.xml @@ -96,8 +96,6 @@ - all his descendants in the output. + * method included the node and all its descendants in the output. * * @param rootNode */ @@ -528,7 +527,7 @@ public class XMLSignatureInput { if (inputOctetStreamProxy == null) { return null; } - try { + try { //NOPMD bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy); } finally { inputOctetStreamProxy.close(); @@ -539,15 +538,9 @@ public class XMLSignatureInput { /** * @param filter */ - public void addNodeFilter(NodeFilter filter) { + public void addNodeFilter(NodeFilter filter) throws XMLParserException, IOException { if (isOctetStream()) { - try { - convertToNodes(); - } catch (Exception e) { - throw new XMLSecurityRuntimeException( - "signature.XMLSignatureInput.nodesetReference", e - ); - } + convertToNodes(); } nodeFilters.add(filter); } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N.java index e0f9b4faa1e..6337bc2c201 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14N.java @@ -60,7 +60,7 @@ public class TransformC14N extends TransformSpi { Canonicalizer20010315 c14n = getCanonicalizer(); - if (os == null) { + if (os == null && (input.isOctetStream() || input.isElement() || input.isNodeSet())) { try (ByteArrayOutputStream writer = new ByteArrayOutputStream()) { c14n.engineCanonicalize(input, writer, secureValidation); writer.flush(); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusive.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusive.java index 5393fa99ac3..eca648267e1 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusive.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformC14NExclusive.java @@ -82,7 +82,7 @@ public class TransformC14NExclusive extends TransformSpi { Canonicalizer20010315Excl c14n = getCanonicalizer(); - if (os == null) { + if (os == null && (input.isOctetStream() || input.isElement() || input.isNodeSet())) { try (ByteArrayOutputStream writer = new ByteArrayOutputStream()) { c14n.engineCanonicalize(input, inclusiveNamespaces, writer, secureValidation); writer.flush(); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformEnvelopedSignature.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformEnvelopedSignature.java index 539590cc84c..030d7063cc3 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformEnvelopedSignature.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformEnvelopedSignature.java @@ -22,8 +22,10 @@ */ package com.sun.org.apache.xml.internal.security.transforms.implementations; +import java.io.IOException; import java.io.OutputStream; +import com.sun.org.apache.xml.internal.security.parser.XMLParserException; import com.sun.org.apache.xml.internal.security.signature.NodeFilter; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import com.sun.org.apache.xml.internal.security.transforms.TransformSpi; @@ -71,7 +73,11 @@ public class TransformEnvelopedSignature extends TransformSpi { Node signatureElement = searchSignatureElement(transformElement); input.setExcludeNode(signatureElement); - input.addNodeFilter(new EnvelopedNodeFilter(signatureElement)); + try { + input.addNodeFilter(new EnvelopedNodeFilter(signatureElement)); + } catch (XMLParserException | IOException ex) { + throw new TransformationException(ex); + } return input; } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath.java index cdde27c6834..ca844c00682 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/TransformXPath.java @@ -22,11 +22,12 @@ */ package com.sun.org.apache.xml.internal.security.transforms.implementations; +import java.io.IOException; import java.io.OutputStream; import javax.xml.transform.TransformerException; -import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityRuntimeException; +import com.sun.org.apache.xml.internal.security.parser.XMLParserException; import com.sun.org.apache.xml.internal.security.signature.NodeFilter; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; import com.sun.org.apache.xml.internal.security.transforms.TransformSpi; @@ -51,6 +52,9 @@ import org.w3c.dom.Node; */ public class TransformXPath extends TransformSpi { + private static final com.sun.org.slf4j.internal.Logger LOG = + com.sun.org.slf4j.internal.LoggerFactory.getLogger(TransformXPath.class); + /** * {@inheritDoc} */ @@ -102,7 +106,7 @@ public class TransformXPath extends TransformSpi { input.addNodeFilter(new XPathNodeFilter(xpathElement, xpathnode, str, xpathAPIInstance)); input.setNodeSet(true); return input; - } catch (DOMException ex) { + } catch (XMLParserException | IOException | DOMException ex) { throw new TransformationException(ex); } } @@ -144,11 +148,8 @@ public class TransformXPath extends TransformSpi { } return 0; } catch (TransformerException e) { - Object[] eArgs = {currentNode}; - throw new XMLSecurityRuntimeException("signature.Transform.node", eArgs, e); - } catch (Exception e) { - Object[] eArgs = {currentNode, currentNode.getNodeType()}; - throw new XMLSecurityRuntimeException("signature.Transform.nodeAndType",eArgs, e); + LOG.debug("Error evaluating XPath expression", e); + return 0; } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java index d9d0e761468..0534fff3844 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java @@ -43,6 +43,7 @@ import org.w3c.dom.Text; * @see com.sun.org.apache.xml.internal.security.transforms.implementations.TransformBase64Decode */ @Deprecated +@SuppressWarnings("PMD") public final class Base64 { /** Field BASE64DEFAULTLENGTH */ diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java index 116e8688342..6a2f5d5af26 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java @@ -127,11 +127,11 @@ public class DOMNamespaceContext implements NamespaceContext { return DEFAULT_NS_PREFIX; } } - if (namespaceURI == null) { + if (namespaceURI == null && context != null) { return context.lookupNamespaceURI(null) != null ? null : DEFAULT_NS_PREFIX; - } else if (namespaceURI.equals(XML_NS_URI)) { + } else if (XML_NS_URI.equals(namespaceURI)) { return XML_NS_PREFIX; - } else if (namespaceURI.equals(XMLNS_ATTRIBUTE_NS_URI)) { + } else if (XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { return XMLNS_ATTRIBUTE; } return null; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java index 4574e35f76a..552d1330a3f 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/RFC2253Parser.java @@ -190,20 +190,21 @@ public class RFC2253Parser { if (value.startsWith("\"")) { StringBuilder sb = new StringBuilder(); - StringReader sr = new StringReader(value.substring(1, value.length() - 1)); - int i = 0; - char c; + try (StringReader sr = new StringReader(value.substring(1, value.length() - 1))) { + int i = 0; + char c; - while ((i = sr.read()) > -1) { - c = (char) i; + while ((i = sr.read()) > -1) { + c = (char) i; - //the following char is defined at 4.Relationship with RFC1779 and LDAPv2 inrfc2253 - if (c == ',' || c == '=' || c == '+' || c == '<' - || c == '>' || c == '#' || c == ';') { - sb.append('\\'); - } + //the following char is defined at 4.Relationship with RFC1779 and LDAPv2 inrfc2253 + if (c == ',' || c == '=' || c == '+' || c == '<' + || c == '>' || c == '#' || c == ';') { + sb.append('\\'); + } - sb.append(c); + sb.append(c); + } } value = trim(sb.toString()); @@ -263,37 +264,38 @@ public class RFC2253Parser { */ static String changeLess32toRFC(String string) throws IOException { StringBuilder sb = new StringBuilder(); - StringReader sr = new StringReader(string); int i = 0; char c; - while ((i = sr.read()) > -1) { - c = (char) i; - - if (c == '\\') { - sb.append(c); - - char c1 = (char) sr.read(); - char c2 = (char) sr.read(); - - //65 (A) 97 (a) - if ((c1 >= 48 && c1 <= 57 || c1 >= 65 && c1 <= 70 || c1 >= 97 && c1 <= 102) - && (c2 >= 48 && c2 <= 57 - || c2 >= 65 && c2 <= 70 - || c2 >= 97 && c2 <= 102)) { - try { - char ch = (char) Byte.parseByte("" + c1 + c2, 16); + try (StringReader sr = new StringReader(string)) { + while ((i = sr.read()) > -1) { + c = (char) i; - sb.append(ch); - } catch (NumberFormatException ex) { - throw new IOException(ex); + if (c == '\\') { + sb.append(c); + + char c1 = (char) sr.read(); + char c2 = (char) sr.read(); + + //65 (A) 97 (a) + if ((c1 >= 48 && c1 <= 57 || c1 >= 65 && c1 <= 70 || c1 >= 97 && c1 <= 102) + && (c2 >= 48 && c2 <= 57 + || c2 >= 65 && c2 <= 70 + || c2 >= 97 && c2 <= 102)) { + try { + char ch = (char) Byte.parseByte("" + c1 + c2, 16); + + sb.append(ch); + } catch (NumberFormatException ex) { + throw new IOException(ex); + } + } else { + sb.append(c1); + sb.append(c2); } } else { - sb.append(c1); - sb.append(c2); + sb.append(c); } - } else { - sb.append(c); } } @@ -309,15 +311,16 @@ public class RFC2253Parser { */ static String changeLess32toXML(String string) throws IOException { StringBuilder sb = new StringBuilder(); - StringReader sr = new StringReader(string); int i = 0; - while ((i = sr.read()) > -1) { - if (i < 32) { - sb.append('\\'); - sb.append(Integer.toHexString(i)); - } else { - sb.append((char) i); + try (StringReader sr = new StringReader(string)) { + while ((i = sr.read()) > -1) { + if (i < 32) { + sb.append('\\'); + sb.append(Integer.toHexString(i)); + } else { + sb.append((char) i); + } } } @@ -333,28 +336,29 @@ public class RFC2253Parser { */ static String changeWStoXML(String string) throws IOException { StringBuilder sb = new StringBuilder(); - StringReader sr = new StringReader(string); int i = 0; char c; - while ((i = sr.read()) > -1) { - c = (char) i; + try (StringReader sr = new StringReader(string)) { + while ((i = sr.read()) > -1) { + c = (char) i; - if (c == '\\') { - char c1 = (char) sr.read(); + if (c == '\\') { + char c1 = (char) sr.read(); - if (c1 == ' ') { - sb.append('\\'); + if (c1 == ' ') { + sb.append('\\'); - String s = "20"; + String s = "20"; - sb.append(s); + sb.append(s); + } else { + sb.append('\\'); + sb.append(c1); + } } else { - sb.append('\\'); - sb.append(c1); + sb.append(c); } - } else { - sb.append(c); } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java index 5eaeda3b5f0..446d640194e 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java @@ -583,7 +583,7 @@ public final class XMLUtils { Node parent = null; Node sibling = null; final String namespaceNs = Constants.NamespaceSpecNS; - do { + do { //NOPMD switch (node.getNodeType()) { case Node.ELEMENT_NODE : Element element = (Element) node; diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java index 1b3f2be87cb..42271aa0128 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java @@ -122,8 +122,8 @@ public class ResourceResolver { List resourceResolversToAdd = new ArrayList<>(classNames.size()); for (String className : classNames) { - ResourceResolverSpi resourceResolverSpi = (ResourceResolverSpi)JavaUtils - .newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, ResourceResolver.class)); + ResourceResolverSpi resourceResolverSpi = (ResourceResolverSpi) + JavaUtils.newInstanceWithEmptyConstructor(ClassLoaderUtils.loadClass(className, ResourceResolver.class)); resourceResolversToAdd.add(resourceResolverSpi); } resolverList.addAll(resourceResolversToAdd); @@ -159,15 +159,6 @@ public class ResourceResolver { LOG.debug("check resolvability by class {}", resolver.getClass().getName()); if (resolver.engineCanResolveURI(context)) { - // Check to see whether the Resolver is allowed - if (context.secureValidation - && (resolver instanceof ResolverLocalFilesystem - || resolver instanceof ResolverDirectHTTP)) { - Object[] exArgs = { resolver.getClass().getName() }; - throw new ResourceResolverException( - "signature.Reference.ForbiddenResolver", exArgs, context.uriToResolve, context.baseUri - ); - } return resolver.engineResolveURI(context); } } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverContext.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverContext.java index 47d0dbb87a8..ef56d435dde 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverContext.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolverContext.java @@ -54,5 +54,4 @@ public class ResourceResolverContext { public Map getProperties() { return properties; } - } diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java index 955a42a01cf..c1f9e199fb2 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java @@ -219,7 +219,8 @@ public class ResolverDirectHTTP extends ResourceResolverSpi { LOG.debug("I was asked whether I can resolve {}", context.uriToResolve); if (context.uriToResolve.startsWith("http:") || - context.baseUri != null && context.baseUri.startsWith("http:")) { + context.uriToResolve.startsWith("https:") || + context.baseUri != null && (context.baseUri.startsWith("http:") || context.baseUri.startsWith("https:"))) { LOG.debug("I state that I can resolve {}", context.uriToResolve); return true; } @@ -231,7 +232,7 @@ public class ResolverDirectHTTP extends ResourceResolverSpi { private static URI getNewURI(String uri, String baseURI) throws URISyntaxException { URI newUri = null; - if (baseURI == null || "".equals(baseURI)) { + if (baseURI == null || baseURI.length() == 0) { newUri = new URI(uri); } else { newUri = new URI(baseURI).resolve(uri); diff --git a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java index 7e73ace1b2a..9d7e00bdbd6 100644 --- a/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java +++ b/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverLocalFilesystem.java @@ -38,8 +38,6 @@ import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverS */ public class ResolverLocalFilesystem extends ResourceResolverSpi { - private static final int FILE_URI_LENGTH = "file:/".length(); - private static final com.sun.org.slf4j.internal.Logger LOG = com.sun.org.slf4j.internal.LoggerFactory.getLogger(ResolverLocalFilesystem.class); @@ -53,9 +51,7 @@ public class ResolverLocalFilesystem extends ResourceResolverSpi { // calculate new URI URI uriNew = getNewURI(context.uriToResolve, context.baseUri); - String fileName = - ResolverLocalFilesystem.translateUriToFilename(uriNew.toString()); - InputStream inputStream = Files.newInputStream(Paths.get(fileName)); + InputStream inputStream = Files.newInputStream(Paths.get(uriNew)); //NOPMD XMLSignatureInput result = new XMLSignatureInput(inputStream); result.setSecureValidation(context.secureValidation); @@ -67,41 +63,6 @@ public class ResolverLocalFilesystem extends ResourceResolverSpi { } } - /** - * Method translateUriToFilename - * - * @param uri - * @return the string of the filename - */ - private static String translateUriToFilename(String uri) { - - String subStr = uri.substring(FILE_URI_LENGTH); - - if (subStr.indexOf("%20") > -1) { - int offset = 0; - int index = 0; - StringBuilder temp = new StringBuilder(subStr.length()); - do { - index = subStr.indexOf("%20",offset); - if (index == -1) { - temp.append(subStr.substring(offset)); - } else { - temp.append(subStr.substring(offset, index)); - temp.append(' '); - offset = index + 3; - } - } while(index != -1); - subStr = temp.toString(); - } - - if (subStr.charAt(1) == ':') { - // we're running M$ Windows, so this works fine - return subStr; - } - // we're running some UNIX, so we have to prepend a slash - return "/" + subStr; - } - /** * {@inheritDoc} */ @@ -111,7 +72,7 @@ public class ResolverLocalFilesystem extends ResourceResolverSpi { } if (context.uriToResolve.isEmpty() || context.uriToResolve.charAt(0) == '#' || - context.uriToResolve.startsWith("http:")) { + context.uriToResolve.startsWith("http:") || context.uriToResolve.startsWith("https:")) { return false; } @@ -133,7 +94,7 @@ public class ResolverLocalFilesystem extends ResourceResolverSpi { private static URI getNewURI(String uri, String baseURI) throws URISyntaxException { URI newUri = null; - if (baseURI == null || "".equals(baseURI)) { + if (baseURI == null || baseURI.length() == 0) { newUri = new URI(uri); } else { newUri = new URI(baseURI).resolve(uri); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java index bb279ecc728..7655866ad74 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/ApacheCanonicalizer.java @@ -239,9 +239,6 @@ public abstract class ApacheCanonicalizer extends TransformService { try { in = apacheTransform.performTransform(in, os, secVal); - if (!in.isNodeSet() && !in.isElement()) { - return null; - } if (in.isOctetStream()) { return new ApacheOctetStreamData(in); } else { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java index 0b63c5eba16..d278808ea05 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMReference.java @@ -447,7 +447,7 @@ public final class DOMReference extends DOMStructure } Data data = dereferencedData; XMLSignatureInput xi = null; - try (OutputStream os = new UnsyncBufferedOutputStream(dos)) { + try (OutputStream os = new UnsyncBufferedOutputStream(dos)) { //NOPMD for (int i = 0, size = transforms.size(); i < size; i++) { DOMTransform transform = (DOMTransform)transforms.get(i); if (i < size - 1) { diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java index a18b76e81f6..fd6a89229c4 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMTransform.java @@ -116,7 +116,7 @@ public class DOMTransform extends DOMStructure implements Transform { Document ownerDoc = DOMUtils.getOwnerDocument(parent); Element transformElem = null; - if (parent.getLocalName().equals("Transforms")) { + if ("Transforms".equals(parent.getLocalName())) { transformElem = DOMUtils.createElement(ownerDoc, "Transform", XMLSignature.XMLNS, dsPrefix); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java index 6b728e236cb..b7412738725 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java @@ -138,7 +138,7 @@ public final class DOMURIDereferencer implements URIDereferencer { } try { - ResourceResolverContext resContext = new ResourceResolverContext(uriAttr, baseURI, false); + ResourceResolverContext resContext = new ResourceResolverContext(uriAttr, baseURI, secVal); XMLSignatureInput in = ResourceResolver.resolve(resContext); if (in.isOctetStream()) { return new ApacheOctetStreamData(in); diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Policy.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Policy.java index f32cf39fd62..fffca6b38f5 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Policy.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Policy.java @@ -43,14 +43,13 @@ import java.util.Set; */ public final class Policy { - // all restrictions are initialized to be unconstrained - private static Set disallowedAlgs = new HashSet<>(); - private static int maxTrans = Integer.MAX_VALUE; - private static int maxRefs = Integer.MAX_VALUE; - private static Set disallowedRefUriSchemes = new HashSet<>(); - private static Map minKeyMap = new HashMap<>(); - private static boolean noDuplicateIds = false; - private static boolean noRMLoops = false; + private static Set disallowedAlgs; + private static int maxTrans; + private static int maxRefs; + private static Set disallowedRefUriSchemes; + private static Map minKeyMap; + private static boolean noDuplicateIds; + private static boolean noRMLoops; static { try { @@ -64,6 +63,16 @@ public final class Policy { private Policy() {} private static void initialize() { + // First initialized to be unconstrained and then parse the + // security property "jdk.xml.dsig.secureValidationPolicy" + disallowedAlgs = new HashSet<>(); + maxTrans = Integer.MAX_VALUE; + maxRefs = Integer.MAX_VALUE; + disallowedRefUriSchemes = new HashSet<>(); + minKeyMap = new HashMap<>(); + noDuplicateIds = false; + noRMLoops = false; + @SuppressWarnings("removal") String prop = AccessController.doPrivileged((PrivilegedAction) () -> diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java index 0edb5dd5aff..72c34c647ba 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java @@ -114,7 +114,7 @@ public final class Utils { } private static boolean getBoolean(XMLCryptoContext xc, String name) { - Boolean value = (Boolean)xc.getProperty(name); + Boolean value = (Boolean) xc.getProperty(name); return value != null && value; } } diff --git a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java index f26b6d9940b..65bb25f058f 100644 --- a/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java +++ b/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java @@ -134,7 +134,7 @@ public final class XMLDSigRI extends Provider { @SuppressWarnings("removal") public XMLDSigRI() { // This is the JDK XMLDSig provider, synced from - // Apache Santuario XML Security for Java, version 2.2.1 + // Apache Santuario XML Security for Java, version 2.3.0 super("XMLDSig", VER, INFO); final Provider p = this; diff --git a/src/java.xml.crypto/share/legal/santuario.md b/src/java.xml.crypto/share/legal/santuario.md index eba3a79e3e9..fa87128126d 100644 --- a/src/java.xml.crypto/share/legal/santuario.md +++ b/src/java.xml.crypto/share/legal/santuario.md @@ -1,4 +1,4 @@ -## Apache Santuario v2.2.1 +## Apache Santuario v2.3.0 ### Apache Santuario Notice
      -- 
      GitLab
      
      
      From 239362da51e70b9e968cb488b7c2ec9d91c32837 Mon Sep 17 00:00:00 2001
      From: ANUPAM DEV 
      Date: Mon, 6 Dec 2021 18:46:29 +0000
      Subject: [PATCH 632/890] 8247973: Javadoc incorrect for IdentityArrayList,
       IdentityLinkedList
      
      Reviewed-by: aivanov, prr
      ---
       .../sun/awt/util/IdentityArrayList.java       | 20 +++++++++++++------
       .../sun/awt/util/IdentityLinkedList.java      | 10 +++++-----
       2 files changed, 19 insertions(+), 11 deletions(-)
      
      diff --git a/src/java.desktop/share/classes/sun/awt/util/IdentityArrayList.java b/src/java.desktop/share/classes/sun/awt/util/IdentityArrayList.java
      index 8f1bbdc4714..98f93cc3ec7 100644
      --- a/src/java.desktop/share/classes/sun/awt/util/IdentityArrayList.java
      +++ b/src/java.desktop/share/classes/sun/awt/util/IdentityArrayList.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2007, 2021, 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
      @@ -203,7 +203,7 @@ public class IdentityArrayList extends AbstractList
            * Returns {@code true} if this list contains the specified element.
            * More formally, returns {@code true} if and only if this list contains
            * at least one element {@code e} such that
      -     * {@code Objects.equals(o, e)}.
      +     * {@code o == e}.
            *
            * @param o element whose presence in this list is to be tested
            * @return {@code true} if this list contains the specified element
      @@ -216,8 +216,12 @@ public class IdentityArrayList extends AbstractList
            * Returns the index of the first occurrence of the specified element
            * in this list, or -1 if this list does not contain the element.
            * More formally, returns the lowest index {@code i} such that
      -     * {@code Objects.equals(o, get(i))},
      +     * {@code get(i) == o},
            * or -1 if there is no such index.
      +     *
      +     * @param o element to search for
      +     * @return the index of the first occurrence of the specified element in
      +     *         this list, or -1 if this list does not contain the element
            */
           public int indexOf(Object o) {
               for (int i = 0; i < size; i++) {
      @@ -232,8 +236,12 @@ public class IdentityArrayList extends AbstractList
            * Returns the index of the last occurrence of the specified element
            * in this list, or -1 if this list does not contain the element.
            * More formally, returns the highest index {@code i} such that
      -     * {@code Objects.equals(o, get(i))},
      +     * {@code get(i) == o},
            * or -1 if there is no such index.
      +     *
      +     * @param o element to search for
      +     * @return the index of the last occurrence of the specified element in
      +     *         this list, or -1 if this list does not contain the element
            */
           public int lastIndexOf(Object o) {
               for (int i = size-1; i >= 0; i--) {
      @@ -390,9 +398,9 @@ public class IdentityArrayList extends AbstractList
       
           /**
            * Removes the first occurrence of the specified element from this list,
      -     * if it is present.  If the list does not contain the element, it is
      +     * if it is present.  If this list does not contain the element, the list is
            * unchanged.  More formally, removes the element with the lowest index
      -     * {@code i} such that {@code Objects.equals(o, get(i))}
      +     * {@code i} such that {@code get(i) == o}
            * (if such an element exists).  Returns {@code true} if this list
            * contained the specified element (or equivalently, if this list
            * changed as a result of the call).
      diff --git a/src/java.desktop/share/classes/sun/awt/util/IdentityLinkedList.java b/src/java.desktop/share/classes/sun/awt/util/IdentityLinkedList.java
      index 21474bafcfd..fef09665bc0 100644
      --- a/src/java.desktop/share/classes/sun/awt/util/IdentityLinkedList.java
      +++ b/src/java.desktop/share/classes/sun/awt/util/IdentityLinkedList.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2007, 2021, 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
      @@ -183,7 +183,7 @@ public class IdentityLinkedList
            * Returns {@code true} if this list contains the specified element.
            * More formally, returns {@code true} if and only if this list contains
            * at least one element {@code e} such that
      -     * {@code Objects.equals(o, e)}.
      +     * {@code o == e}.
            *
            * @param o element whose presence in this list is to be tested
            * @return {@code true} if this list contains the specified element
      @@ -218,7 +218,7 @@ public class IdentityLinkedList
            * Removes the first occurrence of the specified element from this list,
            * if it is present.  If this list does not contain the element, it is
            * unchanged.  More formally, removes the element with the lowest index
      -     * {@code i} such that {@code get(i)==o}
      +     * {@code i} such that {@code get(i) == o}
            * (if such an element exists).  Returns {@code true} if this list
            * contained the specified element (or equivalently, if this list
            * changed as a result of the call).
      @@ -389,7 +389,7 @@ public class IdentityLinkedList
            * Returns the index of the first occurrence of the specified element
            * in this list, or -1 if this list does not contain the element.
            * More formally, returns the lowest index {@code i} such that
      -     * {@code get(i)==o},
      +     * {@code get(i) == o},
            * or -1 if there is no such index.
            *
            * @param o element to search for
      @@ -411,7 +411,7 @@ public class IdentityLinkedList
            * Returns the index of the last occurrence of the specified element
            * in this list, or -1 if this list does not contain the element.
            * More formally, returns the highest index {@code i} such that
      -     * {@code get(i)==o},
      +     * {@code get(i) == o},
            * or -1 if there is no such index.
            *
            * @param o element to search for
      -- 
      GitLab
      
      
      From ea8d3c92c69c393cdbc6c62398f1e9c6adc708d3 Mon Sep 17 00:00:00 2001
      From: Martin Balao 
      Date: Mon, 6 Dec 2021 20:31:55 +0000
      Subject: [PATCH 633/890] 8271566: DSA signature length value is not accurate
       in P11Signature
      
      Reviewed-by: valeriep
      ---
       .../classes/sun/security/pkcs11/P11Key.java   | 742 +++++++++++-------
       .../sun/security/pkcs11/P11Signature.java     |  35 +-
       .../pkcs11/Signature/LargeDSAKey.java         |  98 +++
       3 files changed, 568 insertions(+), 307 deletions(-)
       create mode 100644 test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java
      
      diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java
      index 638bd208aa6..bf0c5f2ba84 100644
      --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java
      +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java
      @@ -115,7 +115,7 @@ abstract class P11Key implements Key, Length {
           }
       
           P11Key(String type, Session session, long keyID, String algorithm,
      -            int keyLength, CK_ATTRIBUTE[] attributes) {
      +            int keyLength, CK_ATTRIBUTE[] attrs) {
               this.type = type;
               this.token = session.token;
               this.algorithm = algorithm;
      @@ -123,15 +123,15 @@ abstract class P11Key implements Key, Length {
               boolean tokenObject = false;
               boolean sensitive = false;
               boolean extractable = true;
      -        int n = (attributes == null) ? 0 : attributes.length;
      -        for (int i = 0; i < n; i++) {
      -            CK_ATTRIBUTE attr = attributes[i];
      -            if (attr.type == CKA_TOKEN) {
      -                tokenObject = attr.getBoolean();
      -            } else if (attr.type == CKA_SENSITIVE) {
      -                sensitive = attr.getBoolean();
      -            } else if (attr.type == CKA_EXTRACTABLE) {
      -                extractable = attr.getBoolean();
      +        if (attrs != null) {
      +            for (CK_ATTRIBUTE attr : attrs) {
      +                if (attr.type == CKA_TOKEN) {
      +                    tokenObject = attr.getBoolean();
      +                } else if (attr.type == CKA_SENSITIVE) {
      +                    sensitive = attr.getBoolean();
      +                } else if (attr.type == CKA_EXTRACTABLE) {
      +                    extractable = attr.getBoolean();
      +                }
                   }
               }
               this.tokenObject = tokenObject;
      @@ -247,7 +247,7 @@ abstract class P11Key implements Key, Length {
           public String toString() {
               token.ensureValid();
               String s1 = token.provider.getName() + " " + algorithm + " " + type
      -                + " key, " + keyLength + " bits";
      +                + " key, " + keyLength + " bits ";
               s1 += (tokenObject ? "token" : "session") + " object";
               if (isPublic()) {
                   s1 += ")";
      @@ -278,19 +278,31 @@ abstract class P11Key implements Key, Length {
               return type == SECRET;
           }
       
      -    void fetchAttributes(CK_ATTRIBUTE[] attributes) {
      +    CK_ATTRIBUTE[] fetchAttributes(CK_ATTRIBUTE[] attrs) {
      +        Objects.requireNonNull(attrs, "attrs must be non-null");
               Session tempSession = null;
               long keyID = this.getKeyID();
               try {
                   tempSession = token.getOpSession();
                   token.p11.C_GetAttributeValue(tempSession.id(), keyID,
      -                        attributes);
      +                    attrs);
               } catch (PKCS11Exception e) {
                   throw new ProviderException(e);
               } finally {
                   this.releaseKeyID();
                   token.releaseSession(tempSession);
               }
      +        return attrs;
      +    }
      +
      +    // convenience method which returns the attribute values as BigInteger[]
      +    BigInteger[] fetchAttributesAsInts(CK_ATTRIBUTE[] attrs) {
      +        attrs = fetchAttributes(attrs);
      +        BigInteger[] res = new BigInteger[attrs.length];
      +        for (int i = 0; i < attrs.length; i++) {
      +            res[i] = attrs[i].getBigInteger();
      +        }
      +        return res;
           }
       
           private static final CK_ATTRIBUTE[] A0 = new CK_ATTRIBUTE[0];
      @@ -329,44 +341,43 @@ abstract class P11Key implements Key, Length {
           }
       
           static SecretKey secretKey(Session session, long keyID, String algorithm,
      -            int keyLength, CK_ATTRIBUTE[] attributes) {
      -        attributes = getAttributes(session, keyID, attributes, new CK_ATTRIBUTE[] {
      -            new CK_ATTRIBUTE(CKA_TOKEN),
      -            new CK_ATTRIBUTE(CKA_SENSITIVE),
      -            new CK_ATTRIBUTE(CKA_EXTRACTABLE),
      +            int keyLength, CK_ATTRIBUTE[] attrs) {
      +        attrs = getAttributes(session, keyID, attrs, new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_TOKEN),
      +                    new CK_ATTRIBUTE(CKA_SENSITIVE),
      +                    new CK_ATTRIBUTE(CKA_EXTRACTABLE),
               });
      -        return new P11SecretKey(session, keyID, algorithm, keyLength,
      -                attributes);
      +        return new P11SecretKey(session, keyID, algorithm, keyLength, attrs);
           }
       
      -    static SecretKey masterSecretKey(Session session, long keyID, String algorithm,
      -            int keyLength, CK_ATTRIBUTE[] attributes, int major, int minor) {
      -        attributes = getAttributes(session, keyID, attributes, new CK_ATTRIBUTE[] {
      -            new CK_ATTRIBUTE(CKA_TOKEN),
      -            new CK_ATTRIBUTE(CKA_SENSITIVE),
      -            new CK_ATTRIBUTE(CKA_EXTRACTABLE),
      +    static SecretKey masterSecretKey(Session session, long keyID,
      +            String algorithm, int keyLength, CK_ATTRIBUTE[] attrs,
      +            int major, int minor) {
      +        attrs = getAttributes(session, keyID, attrs, new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_TOKEN),
      +                    new CK_ATTRIBUTE(CKA_SENSITIVE),
      +                    new CK_ATTRIBUTE(CKA_EXTRACTABLE),
               });
      -        return new P11TlsMasterSecretKey(
      -                session, keyID, algorithm, keyLength, attributes, major,
      -                minor);
      +        return new P11TlsMasterSecretKey(session, keyID, algorithm, keyLength,
      +                attrs, major, minor);
           }
       
           // we assume that all components of public keys are always accessible
           static PublicKey publicKey(Session session, long keyID, String algorithm,
      -            int keyLength, CK_ATTRIBUTE[] attributes) {
      +            int keyLength, CK_ATTRIBUTE[] attrs) {
               switch (algorithm) {
                   case "RSA":
                       return new P11RSAPublicKey(session, keyID, algorithm,
      -                        keyLength, attributes);
      +                        keyLength, attrs);
                   case "DSA":
                       return new P11DSAPublicKey(session, keyID, algorithm,
      -                        keyLength, attributes);
      +                        keyLength, attrs);
                   case "DH":
                       return new P11DHPublicKey(session, keyID, algorithm,
      -                        keyLength, attributes);
      +                        keyLength, attrs);
                   case "EC":
                       return new P11ECPublicKey(session, keyID, algorithm,
      -                        keyLength, attributes);
      +                        keyLength, attrs);
                   default:
                       throw new ProviderException
                           ("Unknown public key algorithm " + algorithm);
      @@ -374,73 +385,45 @@ abstract class P11Key implements Key, Length {
           }
       
           static PrivateKey privateKey(Session session, long keyID, String algorithm,
      -            int keyLength, CK_ATTRIBUTE[] attributes) {
      -        attributes = getAttributes(session, keyID, attributes, new CK_ATTRIBUTE[] {
      -            new CK_ATTRIBUTE(CKA_TOKEN),
      -            new CK_ATTRIBUTE(CKA_SENSITIVE),
      -            new CK_ATTRIBUTE(CKA_EXTRACTABLE),
      +            int keyLength, CK_ATTRIBUTE[] attrs) {
      +        attrs = getAttributes(session, keyID, attrs, new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_TOKEN),
      +                    new CK_ATTRIBUTE(CKA_SENSITIVE),
      +                    new CK_ATTRIBUTE(CKA_EXTRACTABLE),
               });
      -        if (attributes[1].getBoolean() || (attributes[2].getBoolean() == false)) {
      -            return new P11PrivateKey
      -                (session, keyID, algorithm, keyLength, attributes);
      -        } else {
      -            switch (algorithm) {
      -                case "RSA":
      -                    // In order to decide if this is RSA CRT key, we first query
      -                    // and see if all extra CRT attributes are available.
      -                    CK_ATTRIBUTE[] attrs2 = new CK_ATTRIBUTE[] {
      -                        new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT),
      -                        new CK_ATTRIBUTE(CKA_PRIME_1),
      -                        new CK_ATTRIBUTE(CKA_PRIME_2),
      -                        new CK_ATTRIBUTE(CKA_EXPONENT_1),
      -                        new CK_ATTRIBUTE(CKA_EXPONENT_2),
      -                        new CK_ATTRIBUTE(CKA_COEFFICIENT),
      -                    };
      -                    boolean crtKey;
      -                    try {
      -                        session.token.p11.C_GetAttributeValue
      -                            (session.id(), keyID, attrs2);
      -                        crtKey = ((attrs2[0].pValue instanceof byte[]) &&
      -                                  (attrs2[1].pValue instanceof byte[]) &&
      -                                  (attrs2[2].pValue instanceof byte[]) &&
      -                                  (attrs2[3].pValue instanceof byte[]) &&
      -                                  (attrs2[4].pValue instanceof byte[]) &&
      -                                  (attrs2[5].pValue instanceof byte[])) ;
      -                    } catch (PKCS11Exception e) {
      -                        // ignore, assume not available
      -                        crtKey = false;
      -                    }
      -                    if (crtKey) {
      -                        return new P11RSAPrivateKey(session, keyID, algorithm,
      -                                keyLength, attributes, attrs2);
      -                    } else {
      -                        return new P11RSAPrivateNonCRTKey(session, keyID,
      -                                algorithm, keyLength, attributes);
      -                    }
      -                case "DSA":
      -                    return new P11DSAPrivateKey(session, keyID, algorithm,
      -                            keyLength, attributes);
      -                case "DH":
      -                    return new P11DHPrivateKey(session, keyID, algorithm,
      -                            keyLength, attributes);
      -                case "EC":
      -                    return new P11ECPrivateKey(session, keyID, algorithm,
      -                            keyLength, attributes);
      -                default:
      -                    throw new ProviderException
      -                            ("Unknown private key algorithm " + algorithm);
      -            }
      +
      +        boolean keySensitive = (attrs[0].getBoolean() ||
      +                attrs[1].getBoolean() || !attrs[2].getBoolean());
      +
      +        switch (algorithm) {
      +        case "RSA":
      +            return P11RSAPrivateKeyInternal.of(session, keyID, algorithm,
      +                    keyLength, attrs, keySensitive);
      +        case "DSA":
      +            return P11DSAPrivateKeyInternal.of(session, keyID, algorithm,
      +                    keyLength, attrs, keySensitive);
      +        case "DH":
      +            return P11DHPrivateKeyInternal.of(session, keyID, algorithm,
      +                    keyLength, attrs, keySensitive);
      +        case "EC":
      +            return P11ECPrivateKeyInternal.of(session, keyID, algorithm,
      +                    keyLength, attrs, keySensitive);
      +        default:
      +            throw new ProviderException
      +                    ("Unknown private key algorithm " + algorithm);
               }
           }
       
      -    // class for sensitive and unextractable private keys
      -    private static final class P11PrivateKey extends P11Key
      -                                                implements PrivateKey {
      +    // base class for all PKCS11 private keys
      +    private static abstract class P11PrivateKey extends P11Key implements
      +            PrivateKey {
               private static final long serialVersionUID = -2138581185214187615L;
       
      +        protected byte[] encoded; // guard by synchronized
      +
               P11PrivateKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PRIVATE, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(PRIVATE, session, keyID, algorithm, keyLength, attrs);
               }
               // XXX temporary encoding for serialization purposes
               public String getFormat() {
      @@ -455,11 +438,14 @@ abstract class P11Key implements Key, Length {
       
           private static class P11SecretKey extends P11Key implements SecretKey {
               private static final long serialVersionUID = -7828241727014329084L;
      -        private volatile byte[] encoded;
      +
      +        private volatile byte[] encoded; // guard by double-checked locking
      +
               P11SecretKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(SECRET, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(SECRET, session, keyID, algorithm, keyLength, attrs);
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   if (sensitive || (extractable == false)) {
      @@ -468,32 +454,21 @@ abstract class P11Key implements Key, Length {
                       return "RAW";
                   }
               }
      +
               byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (getFormat() == null) {
                       return null;
                   }
      +
                   byte[] b = encoded;
                   if (b == null) {
                       synchronized (this) {
                           b = encoded;
                           if (b == null) {
      -                        Session tempSession = null;
      -                        long keyID = this.getKeyID();
      -                        try {
      -                            tempSession = token.getOpSession();
      -                            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      +                        b = fetchAttributes(new CK_ATTRIBUTE[] {
                                       new CK_ATTRIBUTE(CKA_VALUE),
      -                            };
      -                            token.p11.C_GetAttributeValue
      -                                    (tempSession.id(), keyID, attributes);
      -                            b = attributes[0].getByteArray();
      -                        } catch (PKCS11Exception e) {
      -                            throw new ProviderException(e);
      -                        } finally {
      -                            this.releaseKeyID();
      -                            token.releaseSession(tempSession);
      -                        }
      +                        })[0].getByteArray();
                               encoded = b;
                           }
                       }
      @@ -502,6 +477,19 @@ abstract class P11Key implements Key, Length {
               }
           }
       
      +    // base class for all PKCS11 public keys
      +    private static abstract class P11PublicKey extends P11Key implements
      +            PublicKey {
      +        private static final long serialVersionUID = 1L;
      +
      +        protected byte[] encoded; // guard by synchronized
      +
      +        P11PublicKey(Session session, long keyID, String algorithm,
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(PUBLIC, session, keyID, algorithm, keyLength, attrs);
      +        }
      +    }
      +
           @SuppressWarnings("deprecation")
           private static class P11TlsMasterSecretKey extends P11SecretKey
                   implements TlsMasterSecret {
      @@ -509,8 +497,8 @@ abstract class P11Key implements Key, Length {
       
               private final int majorVersion, minorVersion;
               P11TlsMasterSecretKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes, int major, int minor) {
      -            super(session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs, int major, int minor) {
      +            super(session, keyID, algorithm, keyLength, attrs);
                   this.majorVersion = major;
                   this.minorVersion = minor;
               }
      @@ -523,17 +511,92 @@ abstract class P11Key implements Key, Length {
               }
           }
       
      +    // impl class for sensitive/unextractable RSA private keys
      +    static class P11RSAPrivateKeyInternal extends P11PrivateKey {
      +        private static final long serialVersionUID = -2138581185214187615L;
      +
      +        static P11RSAPrivateKeyInternal of(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs,
      +                boolean keySensitive) {
      +            if (keySensitive) {
      +                return new P11RSAPrivateKeyInternal(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            } else {
      +                CK_ATTRIBUTE[] rsaAttrs = new CK_ATTRIBUTE[] {
      +                        new CK_ATTRIBUTE(CKA_MODULUS),
      +                        new CK_ATTRIBUTE(CKA_PRIVATE_EXPONENT),
      +                        new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT),
      +                        new CK_ATTRIBUTE(CKA_PRIME_1),
      +                        new CK_ATTRIBUTE(CKA_PRIME_2),
      +                        new CK_ATTRIBUTE(CKA_EXPONENT_1),
      +                        new CK_ATTRIBUTE(CKA_EXPONENT_2),
      +                        new CK_ATTRIBUTE(CKA_COEFFICIENT),
      +                };
      +                boolean isCRT = true;
      +                Session tempSession = null;
      +                try {
      +                    tempSession = session.token.getOpSession();
      +                    session.token.p11.C_GetAttributeValue(tempSession.id(),
      +                            keyID, rsaAttrs);
      +                    for (CK_ATTRIBUTE attr : rsaAttrs) {
      +                        isCRT &= (attr.pValue instanceof byte[]);
      +                        if (!isCRT) break;
      +                    }
      +                } catch (PKCS11Exception e) {
      +                    // ignore, assume not available
      +                    isCRT = false;
      +                } finally {
      +                    session.token.releaseSession(tempSession);
      +                }
      +                BigInteger n = rsaAttrs[0].getBigInteger();
      +                BigInteger d = rsaAttrs[1].getBigInteger();
      +                if (isCRT) {
      +                    return new P11RSAPrivateKey(session, keyID, algorithm,
      +                           keyLength, attrs, n, d,
      +                           Arrays.copyOfRange(rsaAttrs, 2, rsaAttrs.length));
      +                } else {
      +                    return new P11RSAPrivateNonCRTKey(session, keyID,
      +                           algorithm, keyLength, attrs, n, d);
      +                }
      +            }
      +        }
      +
      +        protected transient BigInteger n;
      +
      +        private P11RSAPrivateKeyInternal(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
      +        }
      +
      +        private synchronized void fetchValues() {
      +            token.ensureValid();
      +            if (n != null) return;
      +
      +            n = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_MODULUS)
      +            })[0];
      +        }
      +
      +        public BigInteger getModulus() {
      +            fetchValues();
      +            return n;
      +        }
      +    }
      +
           // RSA CRT private key
      -    private static final class P11RSAPrivateKey extends P11Key
      -                implements RSAPrivateCrtKey {
      +    private static final class P11RSAPrivateKey extends P11RSAPrivateKeyInternal
      +            implements RSAPrivateCrtKey {
               private static final long serialVersionUID = 9215872438913515220L;
       
      -        private BigInteger n, e, d, p, q, pe, qe, coeff;
      -        private byte[] encoded;
      -        P11RSAPrivateKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attrs, CK_ATTRIBUTE[] crtAttrs) {
      -            super(PRIVATE, session, keyID, algorithm, keyLength, attrs);
      +        private transient BigInteger e, d, p, q, pe, qe, coeff;
      +
      +        private P11RSAPrivateKey(Session session, long keyID, String algorithm,
      +                int keyLength, CK_ATTRIBUTE[] attrs, BigInteger n, BigInteger d,
      +                CK_ATTRIBUTE[] crtAttrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
       
      +            this.n = n;
      +            this.d = d;
                   for (CK_ATTRIBUTE a : crtAttrs) {
                       if (a.type == CKA_PUBLIC_EXPONENT) {
                           e = a.getBigInteger();
      @@ -550,28 +613,15 @@ abstract class P11Key implements Key, Length {
                       }
                   }
               }
      -        private synchronized void fetchValues() {
      -            token.ensureValid();
      -            if (n != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      -                new CK_ATTRIBUTE(CKA_MODULUS),
      -                new CK_ATTRIBUTE(CKA_PRIVATE_EXPONENT),
      -            };
      -            fetchAttributes(attributes);
      -            n = attributes[0].getBigInteger();
      -            d = attributes[1].getBigInteger();
      -        }
       
               public String getFormat() {
                   token.ensureValid();
                   return "PKCS#8";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      -                fetchValues();
                       try {
                           Key newKey = RSAPrivateCrtKeyImpl.newKey
                               (KeyType.RSA, null, n, e, d, p, q, pe, qe, coeff);
      @@ -582,15 +632,15 @@ abstract class P11Key implements Key, Length {
                   }
                   return encoded;
               }
      +
      +        @Override
               public BigInteger getModulus() {
      -            fetchValues();
                   return n;
               }
               public BigInteger getPublicExponent() {
                   return e;
               }
               public BigInteger getPrivateExponent() {
      -            fetchValues();
                   return d;
               }
               public BigInteger getPrimeP() {
      @@ -611,37 +661,28 @@ abstract class P11Key implements Key, Length {
           }
       
           // RSA non-CRT private key
      -    private static final class P11RSAPrivateNonCRTKey extends P11Key
      -                implements RSAPrivateKey {
      +    private static final class P11RSAPrivateNonCRTKey extends
      +            P11RSAPrivateKeyInternal implements RSAPrivateKey {
               private static final long serialVersionUID = 1137764983777411481L;
       
      -        private BigInteger n, d;
      -        private byte[] encoded;
      +        private transient BigInteger d;
      +
               P11RSAPrivateNonCRTKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PRIVATE, session, keyID, algorithm, keyLength, attributes);
      -        }
      -        private synchronized void fetchValues() {
      -            token.ensureValid();
      -            if (n != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      -                new CK_ATTRIBUTE(CKA_MODULUS),
      -                new CK_ATTRIBUTE(CKA_PRIVATE_EXPONENT),
      -            };
      -            fetchAttributes(attributes);
      -            n = attributes[0].getBigInteger();
      -            d = attributes[1].getBigInteger();
      +                int keyLength, CK_ATTRIBUTE[] attrs, BigInteger n,
      +                BigInteger d) {
      +            super(session, keyID, algorithm, keyLength, attrs);
      +            this.n = n;
      +            this.d = d;
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "PKCS#8";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      -                fetchValues();
                       try {
                           // XXX make constructor in SunRsaSign provider public
                           // and call it directly
      @@ -655,42 +696,43 @@ abstract class P11Key implements Key, Length {
                   }
                   return encoded;
               }
      +
      +        @Override
               public BigInteger getModulus() {
      -            fetchValues();
                   return n;
               }
               public BigInteger getPrivateExponent() {
      -            fetchValues();
                   return d;
               }
           }
       
      -    private static final class P11RSAPublicKey extends P11Key
      +    private static final class P11RSAPublicKey extends P11PublicKey
                                                       implements RSAPublicKey {
               private static final long serialVersionUID = -826726289023854455L;
      -        private BigInteger n, e;
      -        private byte[] encoded;
      +        private transient BigInteger n, e;
      +
               P11RSAPublicKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PUBLIC, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (n != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      +            if (n != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
                       new CK_ATTRIBUTE(CKA_MODULUS),
      -                new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT),
      -            };
      -            fetchAttributes(attributes);
      -            n = attributes[0].getBigInteger();
      -            e = attributes[1].getBigInteger();
      +                new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT)
      +            });
      +            n = res[0];
      +            e = res[1];
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "X.509";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      @@ -704,6 +746,7 @@ abstract class P11Key implements Key, Length {
                   }
                   return encoded;
               }
      +
               public BigInteger getModulus() {
                   fetchValues();
                   return n;
      @@ -719,41 +762,37 @@ abstract class P11Key implements Key, Length {
               }
           }
       
      -    private static final class P11DSAPublicKey extends P11Key
      +    private static final class P11DSAPublicKey extends P11PublicKey
                                                       implements DSAPublicKey {
               private static final long serialVersionUID = 5989753793316396637L;
       
      -        private BigInteger y;
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private DSAParams params;
      -        private byte[] encoded;
      +        private transient BigInteger y;
      +        private transient DSAParams params;
      +
               P11DSAPublicKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PUBLIC, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (y != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      +            if (y != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
                       new CK_ATTRIBUTE(CKA_VALUE),
                       new CK_ATTRIBUTE(CKA_PRIME),
                       new CK_ATTRIBUTE(CKA_SUBPRIME),
      -                new CK_ATTRIBUTE(CKA_BASE),
      -            };
      -            fetchAttributes(attributes);
      -            y = attributes[0].getBigInteger();
      -            params = new DSAParameterSpec(
      -                attributes[1].getBigInteger(),
      -                attributes[2].getBigInteger(),
      -                attributes[3].getBigInteger()
      -            );
      +                new CK_ATTRIBUTE(CKA_BASE)
      +            });
      +            y = res[0];
      +            params = new DSAParameterSpec(res[1], res[2], res[3]);
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "X.509";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      @@ -783,41 +822,76 @@ abstract class P11Key implements Key, Length {
               }
           }
       
      -    private static final class P11DSAPrivateKey extends P11Key
      -                                                implements DSAPrivateKey {
      +    static class P11DSAPrivateKeyInternal extends P11PrivateKey {
               private static final long serialVersionUID = 3119629997181999389L;
       
      -        private BigInteger x;
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private DSAParams params;
      -        private byte[] encoded;
      +        protected transient DSAParams params;
      +
      +        static P11DSAPrivateKeyInternal of(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs,
      +                boolean keySensitive) {
      +            if (keySensitive) {
      +                return new P11DSAPrivateKeyInternal(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            } else {
      +                return new P11DSAPrivateKey(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            }
      +        }
      +
      +        private P11DSAPrivateKeyInternal(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
      +        }
      +
      +        private synchronized void fetchValues() {
      +            token.ensureValid();
      +            if (params != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_PRIME),
      +                    new CK_ATTRIBUTE(CKA_SUBPRIME),
      +                    new CK_ATTRIBUTE(CKA_BASE),
      +            });
      +            params = new DSAParameterSpec(res[0], res[1], res[2]);
      +        }
      +
      +        protected DSAParams getParams() {
      +            fetchValues();
      +            return params;
      +        }
      +    }
      +
      +    private static final class P11DSAPrivateKey extends P11DSAPrivateKeyInternal
      +                                        implements DSAPrivateKey {
      +        private static final long serialVersionUID = 3119629997181999389L;
      +
      +        private transient BigInteger x; // params inside P11DSAPrivateKeyInternal
      +
               P11DSAPrivateKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PRIVATE, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (x != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      -                new CK_ATTRIBUTE(CKA_VALUE),
      -                new CK_ATTRIBUTE(CKA_PRIME),
      -                new CK_ATTRIBUTE(CKA_SUBPRIME),
      -                new CK_ATTRIBUTE(CKA_BASE),
      -            };
      -            fetchAttributes(attributes);
      -            x = attributes[0].getBigInteger();
      -            params = new DSAParameterSpec(
      -                attributes[1].getBigInteger(),
      -                attributes[2].getBigInteger(),
      -                attributes[3].getBigInteger()
      -            );
      +            if (x != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_VALUE),
      +                    new CK_ATTRIBUTE(CKA_PRIME),
      +                    new CK_ATTRIBUTE(CKA_SUBPRIME),
      +                    new CK_ATTRIBUTE(CKA_BASE),
      +            });
      +            x = res[0];
      +            params = new DSAParameterSpec(res[1], res[2], res[3]);
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "PKCS#8";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      @@ -828,49 +902,87 @@ abstract class P11Key implements Key, Length {
                   }
                   return encoded;
               }
      +
               public BigInteger getX() {
                   fetchValues();
                   return x;
               }
      +
      +        @Override
               public DSAParams getParams() {
                   fetchValues();
                   return params;
               }
           }
       
      -    private static final class P11DHPrivateKey extends P11Key
      +    static class P11DHPrivateKeyInternal extends P11PrivateKey {
      +        private static final long serialVersionUID = 1L;
      +
      +        protected transient DHParameterSpec params;
      +
      +        static P11DHPrivateKeyInternal of(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs,
      +                boolean keySensitive) {
      +            if (keySensitive) {
      +                return new P11DHPrivateKeyInternal(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            } else {
      +                return new P11DHPrivateKey(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            }
      +        }
      +
      +        private P11DHPrivateKeyInternal(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
      +        }
      +
      +        private synchronized void fetchValues() {
      +            token.ensureValid();
      +            if (params != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_PRIME),
      +                    new CK_ATTRIBUTE(CKA_BASE),
      +            });
      +            params = new DHParameterSpec(res[0], res[1]);
      +        }
      +
      +        public DHParameterSpec getParams() {
      +            fetchValues();
      +            return params;
      +        }
      +    }
      +
      +    private static final class P11DHPrivateKey extends P11DHPrivateKeyInternal
                                                       implements DHPrivateKey {
               private static final long serialVersionUID = -1698576167364928838L;
       
      -        private BigInteger x;
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private DHParameterSpec params;
      -        private byte[] encoded;
      +        private transient BigInteger x; // params in P11DHPrivateKeyInternal
      +
               P11DHPrivateKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PRIVATE, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (x != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      -                new CK_ATTRIBUTE(CKA_VALUE),
      -                new CK_ATTRIBUTE(CKA_PRIME),
      -                new CK_ATTRIBUTE(CKA_BASE),
      -            };
      -            fetchAttributes(attributes);
      -            x = attributes[0].getBigInteger();
      -            params = new DHParameterSpec(
      -                attributes[1].getBigInteger(),
      -                attributes[2].getBigInteger()
      -            );
      +            if (x != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_VALUE),
      +                    new CK_ATTRIBUTE(CKA_PRIME),
      +                    new CK_ATTRIBUTE(CKA_BASE),
      +            });
      +            x = res[0];
      +            params = new DHParameterSpec(res[1], res[2]);
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "PKCS#8";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      @@ -897,10 +1009,10 @@ abstract class P11Key implements Key, Length {
                   return params;
               }
               public int hashCode() {
      +            fetchValues();
                   if (!token.isValid()) {
                       return 0;
                   }
      -            fetchValues();
                   return Objects.hash(x, params.getP(), params.getG());
               }
               public boolean equals(Object obj) {
      @@ -921,39 +1033,36 @@ abstract class P11Key implements Key, Length {
               }
           }
       
      -    private static final class P11DHPublicKey extends P11Key
      +    private static final class P11DHPublicKey extends P11PublicKey
                                                       implements DHPublicKey {
               static final long serialVersionUID = -598383872153843657L;
       
      -        private BigInteger y;
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private DHParameterSpec params;
      -        private byte[] encoded;
      +        private transient BigInteger y;
      +        private transient DHParameterSpec params;
      +
               P11DHPublicKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PUBLIC, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (y != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      -                new CK_ATTRIBUTE(CKA_VALUE),
      -                new CK_ATTRIBUTE(CKA_PRIME),
      -                new CK_ATTRIBUTE(CKA_BASE),
      -            };
      -            fetchAttributes(attributes);
      -            y = attributes[0].getBigInteger();
      -            params = new DHParameterSpec(
      -                attributes[1].getBigInteger(),
      -                attributes[2].getBigInteger()
      -            );
      +            if (y != null) return;
      +
      +            BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] {
      +                    new CK_ATTRIBUTE(CKA_VALUE),
      +                    new CK_ATTRIBUTE(CKA_PRIME),
      +                    new CK_ATTRIBUTE(CKA_BASE),
      +            });
      +            y = res[0];
      +            params = new DHParameterSpec(res[1], res[2]);
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "X.509";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      @@ -1009,45 +1118,88 @@ abstract class P11Key implements Key, Length {
               }
           }
       
      -    private static final class P11ECPrivateKey extends P11Key
      +    static class P11ECPrivateKeyInternal extends P11PrivateKey {
      +
      +        private static final long serialVersionUID = 1L;
      +
      +        protected transient ECParameterSpec params;
      +
      +        static P11ECPrivateKeyInternal of(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs,
      +                boolean keySensitive) {
      +            if (keySensitive) {
      +                return new P11ECPrivateKeyInternal(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            } else {
      +                return new P11ECPrivateKey(session, keyID, algorithm,
      +                        keyLength, attrs);
      +            }
      +        }
      +
      +        private P11ECPrivateKeyInternal(Session session, long keyID,
      +                String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
      +        }
      +
      +        private synchronized void fetchValues() {
      +            token.ensureValid();
      +            if (params != null) return;
      +
      +            try {
      +                byte[] paramBytes = fetchAttributes(new CK_ATTRIBUTE[] {
      +                        new CK_ATTRIBUTE(CKA_EC_PARAMS)
      +                })[0].getByteArray();
      +
      +                params = P11ECKeyFactory.decodeParameters(paramBytes);
      +            } catch (Exception e) {
      +                throw new RuntimeException("Could not parse key values", e);
      +            }
      +        }
      +
      +        protected ECParameterSpec getParams() {
      +            fetchValues();
      +            return params;
      +        }
      +    }
      +
      +    private static final class P11ECPrivateKey extends P11ECPrivateKeyInternal
                                                       implements ECPrivateKey {
               private static final long serialVersionUID = -7786054399510515515L;
       
      -        private BigInteger s;
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private ECParameterSpec params;
      -        private byte[] encoded;
      +        private transient BigInteger s; // params in P11ECPrivateKeyInternal
      +
               P11ECPrivateKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PRIVATE, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (s != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      +            if (s != null) return;
      +
      +            CK_ATTRIBUTE[] attrs = fetchAttributes(new CK_ATTRIBUTE[] {
                       new CK_ATTRIBUTE(CKA_VALUE),
      -                new CK_ATTRIBUTE(CKA_EC_PARAMS, params),
      -            };
      -            fetchAttributes(attributes);
      -            s = attributes[0].getBigInteger();
      +                new CK_ATTRIBUTE(CKA_EC_PARAMS),
      +            });
      +
      +            s = attrs[0].getBigInteger();
                   try {
                       params = P11ECKeyFactory.decodeParameters
      -                            (attributes[1].getByteArray());
      +                            (attrs[1].getByteArray());
                   } catch (Exception e) {
                       throw new RuntimeException("Could not parse key values", e);
                   }
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "PKCS#8";
               }
      +
               synchronized byte[] getEncodedInternal() {
      -            token.ensureValid();
                   if (encoded == null) {
      -                fetchValues();
                       try {
      +                    fetchValues();
                           Key key = ECUtil.generateECPrivateKey(s, params);
                           encoded = key.getEncoded();
                       } catch (InvalidKeySpecException e) {
      @@ -1056,44 +1208,43 @@ abstract class P11Key implements Key, Length {
                   }
                   return encoded;
               }
      +
               public BigInteger getS() {
                   fetchValues();
                   return s;
               }
      +
               public ECParameterSpec getParams() {
                   fetchValues();
                   return params;
               }
           }
       
      -    private static final class P11ECPublicKey extends P11Key
      +    private static final class P11ECPublicKey extends P11PublicKey
                                                       implements ECPublicKey {
               private static final long serialVersionUID = -6371481375154806089L;
       
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private ECPoint w;
      -        @SuppressWarnings("serial") // Type of field is not Serializable
      -        private ECParameterSpec params;
      -        private byte[] encoded;
      +        private transient ECPoint w;
      +        private transient ECParameterSpec params;
      +
               P11ECPublicKey(Session session, long keyID, String algorithm,
      -                int keyLength, CK_ATTRIBUTE[] attributes) {
      -            super(PUBLIC, session, keyID, algorithm, keyLength, attributes);
      +                int keyLength, CK_ATTRIBUTE[] attrs) {
      +            super(session, keyID, algorithm, keyLength, attrs);
               }
      +
               private synchronized void fetchValues() {
                   token.ensureValid();
      -            if (w != null) {
      -                return;
      -            }
      -            CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] {
      +            if (w != null) return;
      +
      +            CK_ATTRIBUTE[] attrs = fetchAttributes(new CK_ATTRIBUTE[] {
                       new CK_ATTRIBUTE(CKA_EC_POINT),
                       new CK_ATTRIBUTE(CKA_EC_PARAMS),
      -            };
      -            fetchAttributes(attributes);
      +            });
       
                   try {
                       params = P11ECKeyFactory.decodeParameters
      -                            (attributes[1].getByteArray());
      -                byte[] ecKey = attributes[0].getByteArray();
      +                            (attrs[1].getByteArray());
      +                byte[] ecKey = attrs[0].getByteArray();
       
                       // Check whether the X9.63 encoding of an EC point is wrapped
                       // in an ASN.1 OCTET STRING
      @@ -1115,10 +1266,12 @@ abstract class P11Key implements Key, Length {
                       throw new RuntimeException("Could not parse key values", e);
                   }
               }
      +
               public String getFormat() {
                   token.ensureValid();
                   return "X.509";
               }
      +
               synchronized byte[] getEncodedInternal() {
                   token.ensureValid();
                   if (encoded == null) {
      @@ -1417,3 +1570,4 @@ final class SessionKeyRef extends PhantomReference {
               this.clear();
           }
       }
      +
      diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java
      index 7c171435640..f18fc621d2e 100644
      --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java
      +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java
      @@ -119,6 +119,9 @@ final class P11Signature extends SignatureSpi {
           // key instance used, if init*() was called
           private P11Key p11Key;
       
      +    // signature length expected or 0 for unknown
      +    private int sigLen;
      +
           // message digest, if we do the digesting ourselves
           private final MessageDigest md;
       
      @@ -285,7 +288,7 @@ final class P11Signature extends SignatureSpi {
               try {
                   if (mode == M_SIGN) {
                       if (type == T_UPDATE) {
      -                    token.p11.C_SignFinal(session.id(), 0);
      +                    token.p11.C_SignFinal(session.id(), sigLen);
                       } else {
                           byte[] digest;
                           if (type == T_DIGEST) {
      @@ -296,12 +299,7 @@ final class P11Signature extends SignatureSpi {
                           token.p11.C_Sign(session.id(), digest);
                       }
                   } else { // M_VERIFY
      -                byte[] signature;
      -                if (mechanism == CKM_DSA) {
      -                    signature = new byte[64]; // assume N = 256
      -                } else {
      -                    signature = new byte[(p11Key.length() + 7) >> 3];
      -                }
      +                byte[] signature = new byte[sigLen];
                       if (type == T_UPDATE) {
                           token.p11.C_VerifyFinal(session.id(), signature);
                       } else {
      @@ -372,6 +370,15 @@ final class P11Signature extends SignatureSpi {
                       md.reset();
                   }
               }
      +        sigLen = 0;
      +        if ("DSA".equals(p11Key.getAlgorithm())) {
      +            if (p11Key instanceof P11Key.P11DSAPrivateKeyInternal) {
      +                sigLen = ((P11Key.P11DSAPrivateKeyInternal)p11Key).getParams()
      +                        .getQ().bitLength() >> 2;
      +            } else if (p11Key instanceof DSAKey) {
      +                sigLen = ((DSAKey)p11Key).getParams().getQ().bitLength() >> 2;
      +            }
      +        }
               initialized = true;
           }
       
      @@ -617,7 +624,7 @@ final class P11Signature extends SignatureSpi {
               try {
                   byte[] signature;
                   if (type == T_UPDATE) {
      -                signature = token.p11.C_SignFinal(session.id(), 0);
      +                signature = token.p11.C_SignFinal(session.id(), sigLen);
                   } else {
                       byte[] digest;
                       if (type == T_DIGEST) {
      @@ -684,7 +691,7 @@ final class P11Signature extends SignatureSpi {
               try {
                   if (!p1363Format) {
                       if (keyAlgorithm.equals("DSA")) {
      -                    signature = asn1ToDSA(signature);
      +                    signature = asn1ToDSA(signature, sigLen);
                       } else if (keyAlgorithm.equals("EC")) {
                           signature = asn1ToECDSA(signature);
                       }
      @@ -801,7 +808,8 @@ final class P11Signature extends SignatureSpi {
               }
           }
       
      -    private static byte[] asn1ToDSA(byte[] sig) throws SignatureException {
      +    private static byte[] asn1ToDSA(byte[] sig, int sigLen)
      +            throws SignatureException {
               try {
                   // Enforce strict DER checking for signatures
                   DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
      @@ -816,8 +824,8 @@ final class P11Signature extends SignatureSpi {
                   BigInteger r = values[0].getPositiveBigInteger();
                   BigInteger s = values[1].getPositiveBigInteger();
       
      -            byte[] br = toByteArray(r, 20);
      -            byte[] bs = toByteArray(s, 20);
      +            byte[] br = toByteArray(r, sigLen/2);
      +            byte[] bs = toByteArray(s, sigLen/2);
                   if ((br == null) || (bs == null)) {
                       throw new SignatureException("Out of range value for R or S");
                   }
      @@ -829,7 +837,7 @@ final class P11Signature extends SignatureSpi {
               }
           }
       
      -    private byte[] asn1ToECDSA(byte[] sig) throws SignatureException {
      +    private static byte[] asn1ToECDSA(byte[] sig) throws SignatureException {
               try {
                   // Enforce strict DER checking for signatures
                   DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
      @@ -909,3 +917,4 @@ final class P11Signature extends SignatureSpi {
               return null;
           }
       }
      +
      diff --git a/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java b/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java
      new file mode 100644
      index 00000000000..a45a5ca47f5
      --- /dev/null
      +++ b/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java
      @@ -0,0 +1,98 @@
      +/*
      + * Copyright (c) 2021, 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.
      + */
      +
      +import java.security.AlgorithmParameterGenerator;
      +import java.security.AlgorithmParameters;
      +import java.security.KeyPair;
      +import java.security.KeyPairGenerator;
      +import java.security.PrivateKey;
      +import java.security.Provider;
      +import java.security.PublicKey;
      +import java.security.SecureRandom;
      +import java.security.Signature;
      +import java.security.spec.DSAGenParameterSpec;
      +import java.security.spec.DSAParameterSpec;
      +
      +/*
      + * @test
      + * @bug 8271566
      + * @library /test/lib ..
      + * @modules jdk.crypto.cryptoki
      + * @run main/othervm/timeout=30 LargeDSAKey
      + */
      +
      +public final class LargeDSAKey extends PKCS11Test {
      +
      +    private static final boolean enableDebug = false;
      +
      +    private static final String knownText =
      +            "Known text known text known text";
      +
      +    @Override
      +    public void main(Provider p) throws Exception {
      +        KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", p);
      +        AlgorithmParameterGenerator dsaParGen =
      +                AlgorithmParameterGenerator.getInstance("DSA");
      +        DSAGenParameterSpec dsaParGenSpec =
      +                new DSAGenParameterSpec(2048, 256);
      +        dsaParGen.init(dsaParGenSpec, new SecureRandom());
      +        AlgorithmParameters params = dsaParGen.generateParameters();
      +        DSAParameterSpec dsaParams =
      +                params.getParameterSpec(DSAParameterSpec.class);
      +        kpg.initialize(dsaParams);
      +        KeyPair kp = kpg.generateKeyPair();
      +        doTestSignature(kp, p);
      +    }
      +
      +    private static void doTestSignature(KeyPair kp, Provider p)
      +            throws Exception {
      +        byte[] knownTextSig = null;
      +        Signature s = Signature.getInstance("SHA1withDSA", p);
      +        PrivateKey privKey = kp.getPrivate();
      +        PublicKey pubKey = kp.getPublic();
      +        if (enableDebug) {
      +            System.out.println("Signature algorithm: " + s.getAlgorithm());
      +            System.out.println("Signature Provider: " + s.getProvider());
      +            System.out.println("Private key for signature: " + privKey);
      +            System.out.println("Public key for signature: " + pubKey);
      +        }
      +        s.initSign(privKey);
      +        s.update(knownText.getBytes());
      +        knownTextSig = s.sign();
      +        s.initVerify(pubKey);
      +        s.update(knownText.getBytes());
      +        if (s.verify(knownTextSig) == false) {
      +            throw new Exception("Could not verify signature");
      +        }
      +        if (enableDebug) {
      +            System.out.println("Signature verified");
      +        }
      +    }
      +
      +    public static void main(String[] args) throws Throwable {
      +        main(new LargeDSAKey());
      +        System.out.println("TEST PASS - OK");
      +    }
      +
      +}
      -- 
      GitLab
      
      
      From 2ff12966a345eaa1c16ed73165b3eb273e56f8dd Mon Sep 17 00:00:00 2001
      From: =?UTF-8?q?Ivan=20=C5=A0ipka?= 
      Date: Mon, 6 Dec 2021 23:34:32 +0000
      Subject: [PATCH 634/890] 8277957: Add test group for IPv6 exclusive testing
      
      Reviewed-by: alanb, msheppar
      ---
       test/jdk/TEST.groups | 18 +++++++++++++++++-
       1 file changed, 17 insertions(+), 1 deletion(-)
      
      diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups
      index 37dafa2e73a..9cdec38ea9a 100644
      --- a/test/jdk/TEST.groups
      +++ b/test/jdk/TEST.groups
      @@ -518,7 +518,23 @@ needs_g1gc = \
         jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1FullCollection.java \
         jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1ConcurrentMark.java \
         jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventG1.java
      -  
      +
      +#  This set of tests will be executed in an ipv6 only environment
      +
      +jdk_ipv6_only = \
      +    :jdk_net \
      +    :jdk_nio_networkchannel
      +
      +jdk_nio_networkchannel = \
      +    java/nio/channels/AsyncCloseAndInterrupt.java \
      +    java/nio/channels/AsynchronousServerSocketChannel \
      +    java/nio/channels/AsynchronousSocketChannel \
      +    java/nio/channels/DatagramChannel \
      +    java/nio/channels/ServerSocketChannel \
      +    java/nio/channels/SocketChannel \
      +    java/nio/channels/Selector \
      +    java/nio/channels/etc
      +
       jdk_core_manual = \
           :jdk_core_manual_no_input \
           :jdk_core_manual_no_input_security \
      -- 
      GitLab
      
      
      From f148e3e4623c6d0270a10ba73140e0c37ca5398a Mon Sep 17 00:00:00 2001
      From: Jonathan Gibbons 
      Date: Tue, 7 Dec 2021 00:41:11 +0000
      Subject: [PATCH 635/890] 8278318: Create {@index} entries for key LangTools
       terms
      
      Reviewed-by: darcy
      ---
       src/java.compiler/share/classes/module-info.java | 6 ++++--
       src/jdk.compiler/share/classes/module-info.java  | 6 +++++-
       2 files changed, 9 insertions(+), 3 deletions(-)
      
      diff --git a/src/java.compiler/share/classes/module-info.java b/src/java.compiler/share/classes/module-info.java
      index 3d937e09f0c..0793855d1dc 100644
      --- a/src/java.compiler/share/classes/module-info.java
      +++ b/src/java.compiler/share/classes/module-info.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2014, 2021, 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,7 +24,9 @@
        */
       
       /**
      - * Defines the Language Model, Annotation Processing, and Java Compiler APIs.
      + * Defines the {@index "Language Model"}, {@index "Annotation Processing"}, and
      + * {@index "Java Compiler"} APIs.
      + *
        * 

      * These APIs model declarations and types of the Java programming language, * and define interfaces for tools such as compilers which can be invoked diff --git a/src/jdk.compiler/share/classes/module-info.java b/src/jdk.compiler/share/classes/module-info.java index 88066d3c363..a417a2998dc 100644 --- a/src/jdk.compiler/share/classes/module-info.java +++ b/src/jdk.compiler/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -28,6 +28,10 @@ * {@linkplain javax.tools.ToolProvider#getSystemJavaCompiler system Java compiler} * and its command line equivalent, {@index javac javac tool}. * + *

      The {@code com.sun.source.*} packages provide the {@index "Compiler Tree API"}: + * an API for accessing the abstract trees (ASTs) representing Java source code + * and documentation comments, used by javac, javadoc and related tools. + * *

      javac

      * *

      -- GitLab From 10db0e41634b62be5c1a931bd54ac4260108670d Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Tue, 7 Dec 2021 01:37:55 +0000 Subject: [PATCH 636/890] 8277932: Subject:callAs() not throwing NPE when action is null Reviewed-by: rriggs --- src/java.base/share/classes/javax/security/auth/Subject.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java.base/share/classes/javax/security/auth/Subject.java b/src/java.base/share/classes/javax/security/auth/Subject.java index 8e30f84ff44..c1235bffd53 100644 --- a/src/java.base/share/classes/javax/security/auth/Subject.java +++ b/src/java.base/share/classes/javax/security/auth/Subject.java @@ -402,6 +402,7 @@ public final class Subject implements java.io.Serializable { */ public static T callAs(final Subject subject, final Callable action) throws CompletionException { + Objects.requireNonNull(action); if (USE_TL) { Subject oldSubject = SUBJECT_THREAD_LOCAL.get(); SUBJECT_THREAD_LOCAL.set(subject); -- GitLab From f22d157e551fb28991e7713a45e63a0a8d9d2c4c Mon Sep 17 00:00:00 2001 From: Sibabrata Sahoo Date: Tue, 7 Dec 2021 05:10:30 +0000 Subject: [PATCH 637/890] 8277353: java/security/MessageDigest/ThreadSafetyTest.java test times out Reviewed-by: weijun --- .../jdk/java/security/MessageDigest/ThreadSafetyTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java b/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java index 41ecbca2677..594e9926eab 100644 --- a/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java +++ b/test/jdk/java/security/MessageDigest/ThreadSafetyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Azul Systems, Inc. All rights reserved. + * Copyright (c) 2020, 2021, Azul Systems, 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 @@ -23,9 +23,9 @@ /* * @test - * @bug 8241960 + * @bug 8241960 8277353 * @summary Confirm that java.security.MessageDigest is thread-safe after clone. - * @run main/othervm ThreadSafetyTest 5 4 + * @run main ThreadSafetyTest 4 2 */ import java.security.MessageDigest; @@ -56,7 +56,7 @@ public class ThreadSafetyTest { duration = Integer.parseInt(args[1]); } int nProcessors = Runtime.getRuntime().availableProcessors(); - int nTasks = nProcessors * threadsFactor; + int nTasks = Math.min(nProcessors, 4) * threadsFactor; System.out.println("Testing with " + nTasks + " threads on " + nProcessors + " processors for " + duration + -- GitLab From e535cb3fbac11785cfdb43c9b6f73b2a38a621d6 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Tue, 7 Dec 2021 08:16:49 +0000 Subject: [PATCH 638/890] 8272395: Bad HTML in JVMTI man page Reviewed-by: dholmes, iris --- src/hotspot/share/prims/jvmti.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/prims/jvmti.xml b/src/hotspot/share/prims/jvmti.xml index af48e72a1cf..b05d34cdec2 100644 --- a/src/hotspot/share/prims/jvmti.xml +++ b/src/hotspot/share/prims/jvmti.xml @@ -6861,7 +6861,7 @@ class C2 extends C1 implements I2 {

      • By loading and deriving a class from a class file representation using a class loader (see ).
      • -
      • By invoking Lookup::defineHiddenClass +
      • By invoking Lookup::defineHiddenClass that creates a hidden class or interface from a class file representation.
      • By invoking methods in certain Java SE Platform APIs such as reflection.
      @@ -6923,7 +6923,7 @@ class C2 extends C1 implements I2 { class_count_ptr, and the array itself via classes_ptr.

      - See Lookup::defineHiddenClass. + See Lookup::defineHiddenClass. jvmdi @@ -6973,7 +6973,7 @@ class C2 extends C1 implements I2 { "L" + N + "." + S + ";" where N is the binary name encoded in internal form (JVMS 4.2.1) indicated by the class file passed to - Lookup::defineHiddenClass, + Lookup::defineHiddenClass, and S is an unqualified name. The returned name is not a type descriptor and does not conform to JVMS 4.3.2. For example, com.foo.Foo/AnySuffix is "Lcom/foo/Foo.AnySuffix;" -- GitLab From 24877ac0788d3db9f2e9c7492a0d3e42244e7e06 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 7 Dec 2021 08:49:18 +0000 Subject: [PATCH 639/890] 8278270: ServerSocket is not thread safe Reviewed-by: dfuchs --- .../share/classes/java/net/ServerSocket.java | 131 +++++++++--------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index 3d985f84df3..7c567d3e8c7 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -78,17 +78,17 @@ import sun.net.PlatformSocketImpl; */ public class ServerSocket implements java.io.Closeable { /** - * Various states of this socket. + * The underlying SocketImpl */ - private boolean created = false; - private boolean bound = false; - private boolean closed = false; - private Object closeLock = new Object(); + private final SocketImpl impl; /** - * The implementation of this Socket. + * Various states of this socket, need stateLock to change. */ - private SocketImpl impl; + private volatile boolean created; // impl.create(boolean) called + private volatile boolean bound; + private volatile boolean closed; + private final Object stateLock = new Object(); /** * Creates a server socket with a user-specified {@code SocketImpl}. @@ -124,7 +124,7 @@ public class ServerSocket implements java.io.Closeable { * @revised 1.4 */ public ServerSocket() throws IOException { - setImpl(); + this.impl = createImpl(); } /** @@ -264,18 +264,15 @@ public class ServerSocket implements java.io.Closeable { * @since 1.1 */ public ServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException { - setImpl(); if (port < 0 || port > 0xFFFF) - throw new IllegalArgumentException( - "Port value out of range: " + port); + throw new IllegalArgumentException("Port value out of range: " + port); if (backlog < 1) - backlog = 50; + backlog = 50; + + this.impl = createImpl(); try { bind(new InetSocketAddress(bindAddr, port), backlog); - } catch(SecurityException e) { - close(); - throw e; - } catch(IOException e) { + } catch (IOException | SecurityException e) { close(); throw e; } @@ -289,35 +286,36 @@ public class ServerSocket implements java.io.Closeable { * @throws SocketException if creation fails. * @since 1.4 */ - SocketImpl getImpl() throws SocketException { - if (!created) - createImpl(); + private SocketImpl getImpl() throws SocketException { + if (!created) { + synchronized (stateLock) { + if (!created) { + if (closed) { + throw new SocketException("Socket is closed"); + } + try { + impl.create(true); + } catch (SocketException e) { + throw e; + } catch (IOException e) { + throw new SocketException(e.getMessage()); + } + created = true; + } + } + } return impl; } - private void setImpl() { + /** + * Create a SocketImpl for a server socket. + */ + private static SocketImpl createImpl() { SocketImplFactory factory = ServerSocket.factory; if (factory != null) { - impl = factory.createSocketImpl(); + return factory.createSocketImpl(); } else { - impl = SocketImpl.createPlatformSocketImpl(true); - } - } - - /** - * Creates the socket implementation. - * - * @throws SocketException if creation fails - * @since 1.4 - */ - void createImpl() throws SocketException { - if (impl == null) - setImpl(); - try { - impl.create(true); - created = true; - } catch (IOException e) { - throw new SocketException(e.getMessage()); + return SocketImpl.createPlatformSocketImpl(true); } } @@ -379,21 +377,21 @@ public class ServerSocket implements java.io.Closeable { if (epoint.isUnresolved()) throw new SocketException("Unresolved address"); if (backlog < 1) - backlog = 50; - try { - @SuppressWarnings("removal") - SecurityManager security = System.getSecurityManager(); - if (security != null) - security.checkListen(epoint.getPort()); + backlog = 50; + + @SuppressWarnings("removal") + SecurityManager security = System.getSecurityManager(); + if (security != null) + security.checkListen(epoint.getPort()); + + synchronized (stateLock) { + if (closed) + throw new SocketException("Socket is closed"); + if (bound) + throw new SocketException("Already bound"); getImpl().bind(epoint.getAddress(), epoint.getPort()); getImpl().listen(backlog); bound = true; - } catch(SecurityException e) { - bound = false; - throw e; - } catch(IOException e) { - bound = false; - throw e; } } @@ -711,12 +709,18 @@ public class ServerSocket implements java.io.Closeable { * @revised 1.4 */ public void close() throws IOException { - synchronized(closeLock) { - if (isClosed()) - return; - if (created) - impl.close(); - closed = true; + synchronized (stateLock) { + if (!closed) { + try { + // close underlying socket if created + if (created) { + impl.close(); + } + } finally { + closed = true; + } + + } } } @@ -760,9 +764,7 @@ public class ServerSocket implements java.io.Closeable { * @since 1.4 */ public boolean isClosed() { - synchronized(closeLock) { - return closed; - } + return closed; } /** @@ -783,7 +785,7 @@ public class ServerSocket implements java.io.Closeable { * @since 1.1 * @see #getSoTimeout() */ - public synchronized void setSoTimeout(int timeout) throws SocketException { + public void setSoTimeout(int timeout) throws SocketException { if (isClosed()) throw new SocketException("Socket is closed"); if (timeout < 0) @@ -799,7 +801,7 @@ public class ServerSocket implements java.io.Closeable { * @since 1.1 * @see #setSoTimeout(int) */ - public synchronized int getSoTimeout() throws IOException { + public int getSoTimeout() throws IOException { if (isClosed()) throw new SocketException("Socket is closed"); Object o = getImpl().getOption(SocketOptions.SO_TIMEOUT); @@ -984,7 +986,7 @@ public class ServerSocket implements java.io.Closeable { * @since 1.4 * @see #getReceiveBufferSize */ - public synchronized void setReceiveBufferSize (int size) throws SocketException { + public void setReceiveBufferSize (int size) throws SocketException { if (!(size > 0)) { throw new IllegalArgumentException("negative receive size"); } @@ -1007,8 +1009,7 @@ public class ServerSocket implements java.io.Closeable { * @see #setReceiveBufferSize(int) * @since 1.4 */ - public synchronized int getReceiveBufferSize() - throws SocketException{ + public int getReceiveBufferSize() throws SocketException { if (isClosed()) throw new SocketException("Socket is closed"); int result = 0; -- GitLab From 07669e3bc65b1728d784e21ec83b437374f9fa19 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Tue, 7 Dec 2021 09:26:13 +0000 Subject: [PATCH 640/890] 8275375: [REDO] JDK-8271949 dumppath in -XX:FlightRecorderOptions does not affect Reviewed-by: egahlin, mgronlun --- src/hotspot/share/jfr/jni/jfrJniMethod.cpp | 17 ++++++- src/hotspot/share/jfr/jni/jfrJniMethod.hpp | 6 ++- .../jfr/jni/jfrJniMethodRegistration.cpp | 2 + .../recorder/repository/jfrEmergencyDump.cpp | 47 ++++++++++++++--- .../recorder/repository/jfrEmergencyDump.hpp | 9 +++- .../jfr/recorder/service/jfrOptionSet.cpp | 22 ++++++++ .../share/classes/jdk/jfr/internal/JVM.java | 17 ++++++- .../classes/jdk/jfr/internal/Options.java | 31 +++++++++--- .../jdk/jfr/internal/SecuritySupport.java | 6 +-- .../jdk/jfr/internal/dcmd/DCmdConfigure.java | 11 ++-- test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java | 50 ++++++++++++++----- 11 files changed, 179 insertions(+), 39 deletions(-) diff --git a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp index 54a4680ced8..690b02ef36d 100644 --- a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp +++ b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -35,6 +35,7 @@ #include "jfr/recorder/repository/jfrRepository.hpp" #include "jfr/recorder/repository/jfrChunkRotation.hpp" #include "jfr/recorder/repository/jfrChunkWriter.hpp" +#include "jfr/recorder/repository/jfrEmergencyDump.hpp" #include "jfr/recorder/service/jfrEventThrottler.hpp" #include "jfr/recorder/service/jfrOptionSet.hpp" #include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp" @@ -315,6 +316,20 @@ JVM_ENTRY_NO_ENV(void, jfr_set_repository_location(JNIEnv* env, jobject repo, js return JfrRepository::set_path(location, thread); JVM_END +NO_TRANSITION(void, jfr_set_dump_path(JNIEnv* env, jobject jvm, jstring dumppath)) + if (dumppath == NULL) { + JfrEmergencyDump::set_dump_path(NULL); + } else { + const char* dump_path = env->GetStringUTFChars(dumppath, NULL); + JfrEmergencyDump::set_dump_path(dump_path); + env->ReleaseStringUTFChars(dumppath, dump_path); + } +NO_TRANSITION_END + +NO_TRANSITION(jstring, jfr_get_dump_path(JNIEnv* env, jobject jvm)) + return env->NewStringUTF(JfrEmergencyDump::get_dump_path()); +NO_TRANSITION_END + JVM_ENTRY_NO_ENV(void, jfr_uncaught_exception(JNIEnv* env, jobject jvm, jobject t, jthrowable throwable)) JfrJavaSupport::uncaught_exception(throwable, thread); JVM_END diff --git a/src/hotspot/share/jfr/jni/jfrJniMethod.hpp b/src/hotspot/share/jfr/jni/jfrJniMethod.hpp index 19a676c4a22..946ef04470d 100644 --- a/src/hotspot/share/jfr/jni/jfrJniMethod.hpp +++ b/src/hotspot/share/jfr/jni/jfrJniMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -113,6 +113,10 @@ jlong JNICALL jfr_type_id(JNIEnv* env, jobject jvm, jclass jc); void JNICALL jfr_set_repository_location(JNIEnv* env, jobject repo, jstring location); +void JNICALL jfr_set_dump_path(JNIEnv* env, jobject jvm, jstring dumppath); + +jstring JNICALL jfr_get_dump_path(JNIEnv* env, jobject jvm); + jobject JNICALL jfr_get_event_writer(JNIEnv* env, jclass cls); jobject JNICALL jfr_new_event_writer(JNIEnv* env, jclass cls); diff --git a/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp b/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp index db137776f65..5bc8a95a826 100644 --- a/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp +++ b/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp @@ -75,6 +75,8 @@ JfrJniMethodRegistration::JfrJniMethodRegistration(JNIEnv* env) { (char*)"flush", (char*)"(Ljdk/jfr/internal/EventWriter;II)Z", (void*)jfr_event_writer_flush, (char*)"flush", (char*)"()V", (void*)jfr_flush, (char*)"setRepositoryLocation", (char*)"(Ljava/lang/String;)V", (void*)jfr_set_repository_location, + (char*)"setDumpPath", (char*)"(Ljava/lang/String;)V", (void*)jfr_set_dump_path, + (char*)"getDumpPath", (char*)"()Ljava/lang/String;", (void*)jfr_get_dump_path, (char*)"abort", (char*)"(Ljava/lang/String;)V", (void*)jfr_abort, (char*)"addStringConstant", (char*)"(JLjava/lang/String;)Z", (void*)jfr_add_string_constant, (char*)"uncaughtException", (char*)"(Ljava/lang/Thread;Ljava/lang/Throwable;)V", (void*)jfr_uncaught_exception, diff --git a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp index 0bcfc8568f5..1dac9703459 100644 --- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp +++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp @@ -41,6 +41,8 @@ #include "utilities/growableArray.hpp" #include "utilities/ostream.hpp" +char JfrEmergencyDump::_dump_path[JVM_MAXPATHLEN] = { 0 }; + static const char vm_error_filename_fmt[] = "hs_err_pid%p.jfr"; static const char vm_oom_filename_fmt[] = "hs_oom_pid%p.jfr"; static const char vm_soe_filename_fmt[] = "hs_soe_pid%p.jfr"; @@ -66,12 +68,17 @@ static bool is_path_empty() { } // returns with an appended file separator (if successful) -static size_t get_current_directory() { - if (os::get_current_directory(_path_buffer, sizeof(_path_buffer)) == NULL) { - return 0; +static size_t get_dump_directory() { + const char* dump_path = JfrEmergencyDump::get_dump_path(); + if (*dump_path == '\0') { + if (os::get_current_directory(_path_buffer, sizeof(_path_buffer)) == NULL) { + return 0; + } + } else { + strcpy(_path_buffer, dump_path); } - const size_t cwd_len = strlen(_path_buffer); - const int result = jio_snprintf(_path_buffer + cwd_len, + const size_t path_len = strlen(_path_buffer); + const int result = jio_snprintf(_path_buffer + path_len, sizeof(_path_buffer), "%s", os::file_separator()); @@ -105,7 +112,7 @@ static void close_emergency_dump_file() { static const char* create_emergency_dump_path() { assert(is_path_empty(), "invariant"); - const size_t path_len = get_current_directory(); + const size_t path_len = get_dump_directory(); if (path_len == 0) { return NULL; } @@ -125,12 +132,21 @@ static const char* create_emergency_dump_path() { return result ? _path_buffer : NULL; } -static bool open_emergency_dump_file() { +bool JfrEmergencyDump::open_emergency_dump_file() { if (is_emergency_dump_file_open()) { // opened already return true; } - return open_emergency_dump_fd(create_emergency_dump_path()); + + bool result = open_emergency_dump_fd(create_emergency_dump_path()); + if (!result && *_dump_path != '\0') { + log_warning(jfr)("Unable to create an emergency dump file at the location set by dumppath=%s", _dump_path); + // Fallback. Try to create it in the current directory. + *_dump_path = '\0'; + *_path_buffer = '\0'; + result = open_emergency_dump_fd(create_emergency_dump_path()); + } + return result; } static void report(outputStream* st, bool emergency_file_opened, const char* repository_path) { @@ -150,6 +166,21 @@ static void report(outputStream* st, bool emergency_file_opened, const char* rep } } +void JfrEmergencyDump::set_dump_path(const char* dump_path) { + if (dump_path == NULL || *dump_path == '\0') { + os::get_current_directory(_dump_path, sizeof(_dump_path)); + } else { + if (strlen(dump_path) < JVM_MAXPATHLEN) { + strncpy(_dump_path, dump_path, JVM_MAXPATHLEN); + _dump_path[JVM_MAXPATHLEN - 1] = '\0'; + } + } +} + +const char* JfrEmergencyDump::get_dump_path() { + return _dump_path; +} + void JfrEmergencyDump::on_vm_error_report(outputStream* st, const char* repository_path) { assert(st != NULL, "invariant"); Thread* thread = Thread::current_or_null_safe(); diff --git a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp index 909f73bf892..c96a7d802dc 100644 --- a/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp +++ b/src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -32,7 +32,14 @@ // Responsible for creating an hs_err.jfr file in exceptional shutdown situations (crash, OOM) // class JfrEmergencyDump : AllStatic { + private: + static char _dump_path[JVM_MAXPATHLEN]; + + static bool open_emergency_dump_file(); + public: + static void set_dump_path(const char* dump_path); + static const char* get_dump_path(); static const char* chunk_path(const char* repository_path); static void on_vm_error(const char* repository_path); static void on_vm_error_report(outputStream* st, const char* repository_path); diff --git a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp index 166603d4397..7f9dfcee4ff 100644 --- a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp +++ b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp @@ -163,6 +163,7 @@ bool JfrOptionSet::allow_event_retransforms() { // default options for the dcmd parser const char* const default_repository = NULL; +const char* const default_dumppath = NULL; const char* const default_global_buffer_size = "512k"; const char* const default_num_global_buffers = "20"; const char* const default_memory_size = "10m"; @@ -182,6 +183,13 @@ static DCmdArgument _dcmd_repository( false, default_repository); +static DCmdArgument _dcmd_dumppath( + "dumppath", + "Path to emergency dump", + "STRING", + false, + default_dumppath); + static DCmdArgument _dcmd_threadbuffersize( "threadbuffersize", "Thread buffer size", @@ -258,6 +266,7 @@ static DCmdParser _parser; static void register_parser_options() { _parser.add_dcmd_option(&_dcmd_repository); + _parser.add_dcmd_option(&_dcmd_dumppath); _parser.add_dcmd_option(&_dcmd_threadbuffersize); _parser.add_dcmd_option(&_dcmd_memorysize); _parser.add_dcmd_option(&_dcmd_globalbuffersize); @@ -346,6 +355,18 @@ bool JfrOptionSet::configure(TRAPS) { configure._repository_path.set_value(repo_copy); } + configure._dump_path.set_is_set(_dcmd_dumppath.is_set()); + char* dumppath = _dcmd_dumppath.value(); + if (dumppath != NULL) { + const size_t len = strlen(dumppath); + char* dumppath_copy = JfrCHeapObj::new_array(len + 1); + if (NULL == dumppath_copy) { + return false; + } + strncpy(dumppath_copy, dumppath, len + 1); + configure._dump_path.set_value(dumppath_copy); + } + configure._stack_depth.set_is_set(_dcmd_stackdepth.is_set()); configure._stack_depth.set_value(_dcmd_stackdepth.value()); @@ -373,6 +394,7 @@ bool JfrOptionSet::configure(TRAPS) { if (HAS_PENDING_EXCEPTION) { java_lang_Throwable::print(PENDING_EXCEPTION, tty); CLEAR_PENDING_EXCEPTION; + tty->cr(); // java_lang_Throwable::print will not print '\n' return false; } return true; diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java index b5aff49cbe0..ff84b31b0cd 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java @@ -473,13 +473,26 @@ public final class JVM { public native void flush(); /** - * Sets the location of the disk repository, to be used at an emergency - * dump. + * Sets the location of the disk repository. * * @param dirText */ public native void setRepositoryLocation(String dirText); + /** + * Sets the path to emergency dump. + * + * @param dumpPathText + */ + public native void setDumpPath(String dumpPathText); + + /** + * Gets the path to emergency dump. + * + * @return The path to emergency dump. + */ + public native String getDumpPath(); + /** * Access to VM termination support. * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java index 4d430bebba2..204badc4242 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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,9 +25,16 @@ package jdk.jfr.internal; +import java.io.IOException; + +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; import jdk.jfr.internal.SecuritySupport.SafePath; import jdk.internal.misc.Unsafe; +import static java.nio.file.LinkOption.*; + /** * Options that control Flight Recorder. * @@ -48,7 +55,7 @@ public final class Options { private static final int DEFAULT_STACK_DEPTH = 64; private static final boolean DEFAULT_SAMPLE_THREADS = true; private static final long DEFAULT_MAX_CHUNK_SIZE = 12 * 1024 * 1024; - private static final SafePath DEFAULT_DUMP_PATH = SecuritySupport.USER_HOME; + private static final SafePath DEFAULT_DUMP_PATH = null; private static long memorySize; private static long globalBufferSize; @@ -57,7 +64,6 @@ public final class Options { private static int stackDepth; private static boolean sampleThreads; private static long maxChunkSize; - private static SafePath dumpPath; static { final long pageSize = Unsafe.getUnsafe().pageSize(); @@ -113,12 +119,19 @@ public final class Options { globalBufferSize = globalBufsize; } - public static synchronized void setDumpPath(SafePath path) { - dumpPath = path; + public static synchronized void setDumpPath(SafePath path) throws IOException { + if (path != null) { + if (SecuritySupport.isWritable(path)) { + path = SecuritySupport.toRealPath(path, NOFOLLOW_LINKS); + } else { + throw new IOException("Cannot write JFR emergency dump to " + path.toString()); + } + } + jvm.setDumpPath(path == null ? null : path.toString()); } public static synchronized SafePath getDumpPath() { - return dumpPath; + return new SafePath(jvm.getDumpPath()); } public static synchronized void setStackDepth(Integer stackTraceDepth) { @@ -144,7 +157,11 @@ public final class Options { setMemorySize(DEFAULT_MEMORY_SIZE); setGlobalBufferSize(DEFAULT_GLOBAL_BUFFER_SIZE); setGlobalBufferCount(DEFAULT_GLOBAL_BUFFER_COUNT); - setDumpPath(DEFAULT_DUMP_PATH); + try { + setDumpPath(DEFAULT_DUMP_PATH); + } catch (IOException e) { + // Ignore (depends on default value in JVM: it would be NULL) + } setSampleThreads(DEFAULT_SAMPLE_THREADS); setStackDepth(DEFAULT_STACK_DEPTH); setThreadBufferSize(DEFAULT_THREAD_BUFFER_SIZE); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java index d761eb98c58..ae03bce313d 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java @@ -41,6 +41,7 @@ import java.nio.channels.ReadableByteChannel; import java.nio.file.DirectoryStream; import java.nio.file.FileVisitResult; import java.nio.file.Files; +import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; @@ -77,7 +78,6 @@ public final class SecuritySupport { private static final Module JFR_MODULE = Event.class.getModule(); public static final SafePath JFC_DIRECTORY = getPathInProperty("java.home", "lib/jfr"); public static final FileAccess PRIVILEGED = new Privileged(); - static final SafePath USER_HOME = getPathInProperty("user.home", null); static final SafePath JAVA_IO_TMPDIR = getPathInProperty("java.io.tmpdir", null); static { @@ -365,8 +365,8 @@ public final class SecuritySupport { doPriviligedIO(() -> Files.walkFileTree(safePath.toPath(), new DirectoryCleaner())); } - static SafePath toRealPath(SafePath safePath) throws IOException { - return new SafePath(doPrivilegedIOWithReturn(() -> safePath.toPath().toRealPath())); + static SafePath toRealPath(SafePath safePath, LinkOption... options) throws IOException { + return new SafePath(doPrivilegedIOWithReturn(() -> safePath.toPath().toRealPath(options))); } static boolean existDirectory(SafePath directory) throws IOException { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java index 4cfc9ae4800..edcb1530474 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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,7 +25,7 @@ package jdk.jfr.internal.dcmd; - +import java.io.IOException; import jdk.jfr.FlightRecorder; import jdk.jfr.internal.LogLevel; @@ -106,7 +106,11 @@ final class DCmdConfigure extends AbstractDCmd { } if (dumpPath != null) { - Options.setDumpPath(new SafePath(dumpPath)); + try { + Options.setDumpPath(new SafePath(dumpPath)); + } catch (IOException e) { + throw new DCmdException("Could not set " + dumpPath + " to emergency dump path. " + e.getMessage(), e); + } Logger.log(LogTag.JFR, LogLevel.INFO, "Emergency dump path set to " + dumpPath); if (verbose) { printDumpPath(); @@ -183,6 +187,7 @@ final class DCmdConfigure extends AbstractDCmd { println("Current configuration:"); println(); printRepositoryPath(); + printDumpPath(); printStackDepth(); printGlobalBufferCount(); printGlobalBufferSize(); diff --git a/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java b/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java index 3869509b242..5cd1f435bfd 100644 --- a/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java +++ b/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.List; import jdk.internal.misc.Unsafe; @@ -74,22 +75,42 @@ public class TestDumpOnCrash { } public static void main(String[] args) throws Exception { + // Test without dumppath test(CrasherIllegalAccess.class, "", true); test(CrasherIllegalAccess.class, "", false); test(CrasherHalt.class, "", true); test(CrasherHalt.class, "", false); + // Test with dumppath + Path dumppath = Files.createTempDirectory(null); + try { + test(CrasherIllegalAccess.class, "", true, dumppath.toString()); + test(CrasherIllegalAccess.class, "", false, dumppath.toString()); + test(CrasherHalt.class, "", true, dumppath.toString()); + test(CrasherHalt.class, "", false, dumppath.toString()); + } finally { + dumppath.toFile().delete(); + } + // Test is excluded until 8219680 is fixed // @ignore 8219680 // test(CrasherSig.class, "FPE", true); } private static void test(Class crasher, String signal, boolean disk) throws Exception { + test(crasher, signal, disk, null); + } + + private static void test(Class crasher, String signal, boolean disk, String dumppath) throws Exception { + test(crasher, signal, disk, dumppath, dumppath); + } + + private static void test(Class crasher, String signal, boolean disk, String dumppath, String expectedPath) throws Exception { // The JVM may be in a state it can't recover from, so try three times // before concluding functionality is not working. for (int attempt = 0; attempt < ATTEMPTS; attempt++) { try { - verify(runProcess(crasher, signal, disk)); + verify(runProcess(crasher, signal, disk, dumppath), expectedPath); return; } catch (Exception e) { System.out.println("Attempt " + attempt + ". Verification failed:"); @@ -105,17 +126,19 @@ public class TestDumpOnCrash { throw new Exception(ATTEMPTS + " attempts with failure!"); } - private static long runProcess(Class crasher, String signal, boolean disk) throws Exception { + private static long runProcess(Class crasher, String signal, boolean disk, String dumppath) throws Exception { System.out.println("Test case for crasher " + crasher.getName()); - final String flightRecordingOptions = "dumponexit=true,disk=" + Boolean.toString(disk); - Process p = ProcessTools.createTestJvm( - "-Xmx64m", - "-XX:-CreateCoredumpOnCrash", - "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", - "-XX:StartFlightRecording:" + flightRecordingOptions, - crasher.getName(), - signal) - .start(); + List options = new ArrayList<>(); + options.add("-Xmx64m"); + options.add("-XX:-CreateCoredumpOnCrash"); + options.add("--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED"); + options.add("-XX:StartFlightRecording:dumponexit=true,disk=" + Boolean.toString(disk)); + if (dumppath != null) { + options.add("-XX:FlightRecorderOptions=dumppath=" + dumppath); + } + options.add(crasher.getName()); + options.add(signal); + Process p = ProcessTools.createTestJvm(options).start(); OutputAnalyzer output = new OutputAnalyzer(p); System.out.println("========== Crasher process output:"); @@ -125,9 +148,10 @@ public class TestDumpOnCrash { return p.pid(); } - private static void verify(long pid) throws IOException { + private static void verify(long pid, String dumppath) throws IOException { String fileName = "hs_err_pid" + pid + ".jfr"; - Path file = Paths.get(fileName).toAbsolutePath().normalize(); + Path file = (dumppath == null) ? Paths.get(fileName) : Paths.get(dumppath, fileName); + file = file.toAbsolutePath().normalize(); Asserts.assertTrue(Files.exists(file), "No emergency jfr recording file " + file + " exists"); Asserts.assertNotEquals(Files.size(file), 0L, "File length 0. Should at least be some bytes"); -- GitLab From b2638e5efd3c2b1abe790ab59baf28afa308614f Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 7 Dec 2021 11:32:17 +0000 Subject: [PATCH 641/890] 8244602: Add JTREG_REPEAT_COUNT to repeat execution of a test Reviewed-by: ihse, erikj --- doc/testing.html | 2 ++ doc/testing.md | 4 ++++ make/RunTests.gmk | 23 ++++++++++++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/testing.html b/doc/testing.html index 1146400df80..f647af91934 100644 --- a/doc/testing.html +++ b/doc/testing.html @@ -194,6 +194,8 @@ TEST FAILURE

      Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value %20).

      RETRY_COUNT

      Retry failed tests up to a set number of times. Defaults to 0.

      +

      REPEAT_COUNT

      +

      Repeat the tests for a set number of times. Defaults to 0.

      Gtest keywords

      REPEAT

      The number of times to repeat the tests (--gtest_repeat).

      diff --git a/doc/testing.md b/doc/testing.md index 5dde4d11804..bba5ae0941c 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -421,6 +421,10 @@ modules. If multiple modules are specified, they should be separated by space Retry failed tests up to a set number of times. Defaults to 0. +#### REPEAT_COUNT + +Repeat the tests for a set number of times. Defaults to 0. + ### Gtest keywords #### REPEAT diff --git a/make/RunTests.gmk b/make/RunTests.gmk index a2c8ea8101e..81540266ec0 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -200,7 +200,7 @@ $(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG)) $(eval $(call ParseKeywordVariable, JTREG, \ SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \ TEST_MODE ASSERT VERBOSE RETAIN MAX_MEM RUN_PROBLEM_LISTS \ - RETRY_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \ + RETRY_COUNT REPEAT_COUNT MAX_OUTPUT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \ STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \ EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \ $(CUSTOM_JTREG_STRING_KEYWORDS), \ @@ -745,6 +745,15 @@ define SetupRunJtregTestBody JTREG_RETAIN ?= fail,error JTREG_RUN_PROBLEM_LISTS ?= false JTREG_RETRY_COUNT ?= 0 + JTREG_REPEAT_COUNT ?= 0 + + ifneq ($$(JTREG_RETRY_COUNT), 0) + ifneq ($$(JTREG_REPEAT_COUNT), 0) + $$(info Error: Cannot use both JTREG_RETRY_COUNT and JTREG_REPEAT_COUNT together.) + $$(info Please choose one or the other.) + $$(error Cannot continue) + endif + endif ifneq ($$(JTREG_LAUNCHER_OPTIONS), ) $1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS) @@ -869,6 +878,18 @@ define SetupRunJtregTestBody done endif + ifneq ($$(JTREG_REPEAT_COUNT), 0) + $1_COMMAND_LINE := \ + for i in {1..$$(JTREG_REPEAT_COUNT)}; do \ + $$(PRINTF) "\nRepeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)\n"; \ + $$($1_COMMAND_LINE); \ + if [ "`$$(CAT) $$($1_EXITCODE)`" != "0" ]; then \ + $$(PRINTF) "\nFailures detected, no more repeats.\n"; \ + break; \ + fi; \ + done + endif + run-test-$1: pre-run-test clean-workdir-$1 $$(call LogWarn) $$(call LogWarn, Running test '$$($1_TEST)') -- GitLab From 44fcee3830466e34656ea553d10a60fc382c85a6 Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Tue, 7 Dec 2021 13:34:35 +0000 Subject: [PATCH 642/890] 8278289: Drop G1BlockOffsetTablePart::_object_can_span Reviewed-by: tschatzl, sjohanss, mli --- src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp | 7 ------- src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp | 4 ---- src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp | 11 ++++++++--- src/hotspot/share/gc/g1/heapRegion.cpp | 4 ---- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp index 08e7dd5f1d4..1c4bc3d3332 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp @@ -75,7 +75,6 @@ void G1BlockOffsetTable::check_index(size_t index, const char* msg) const { G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, HeapRegion* hr) : _next_offset_threshold(NULL), - DEBUG_ONLY(_object_can_span(false) COMMA) _bot(array), _hr(hr) { @@ -331,12 +330,6 @@ void G1BlockOffsetTablePart::verify() const { } } -#ifdef ASSERT -void G1BlockOffsetTablePart::set_object_can_span(bool can_span) { - _object_can_span = can_span; -} -#endif - #ifndef PRODUCT void G1BlockOffsetTablePart::print_on(outputStream* out) { size_t from_index = _bot->index_for(_hr->bottom()); diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp index fa7658e185e..1a13ad68c07 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp @@ -114,9 +114,6 @@ private: // allocation boundary at which offset array must be updated HeapWord* _next_offset_threshold; - // Indicates if an object can span into this G1BlockOffsetTablePart. - debug_only(bool _object_can_span;) - // This is the global BlockOffsetTable. G1BlockOffsetTable* _bot; @@ -212,7 +209,6 @@ public: } void set_for_starts_humongous(HeapWord* obj_top, size_t fill_size); - void set_object_can_span(bool can_span) NOT_DEBUG_RETURN; void print_on(outputStream* out) PRODUCT_RETURN; }; diff --git a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp index aa0c004a302..c606d9393f5 100644 --- a/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp @@ -113,9 +113,14 @@ inline size_t G1BlockOffsetTablePart::block_size(const HeapWord* p) const { } inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr) const { - assert(_object_can_span || _bot->offset_array(_bot->index_for(_hr->bottom())) == 0, - "Object crossed region boundary, found offset %u instead of 0", - (uint) _bot->offset_array(_bot->index_for(_hr->bottom()))); +#ifdef ASSERT + if (!_hr->is_continues_humongous()) { + // For non-ContinuesHumongous regions, the first obj always starts from bottom. + u_char offset = _bot->offset_array(_bot->index_for(_hr->bottom())); + assert(offset == 0, "Found offset %u instead of 0 for region %u %s", + offset, _hr->hrm_index(), _hr->get_short_type_str()); + } +#endif size_t index = _bot->index_for(addr); diff --git a/src/hotspot/share/gc/g1/heapRegion.cpp b/src/hotspot/share/gc/g1/heapRegion.cpp index ca85f50ae25..bcf240336ce 100644 --- a/src/hotspot/share/gc/g1/heapRegion.cpp +++ b/src/hotspot/share/gc/g1/heapRegion.cpp @@ -214,8 +214,6 @@ void HeapRegion::set_continues_humongous(HeapRegion* first_hr) { report_region_type_change(G1HeapRegionTraceType::ContinuesHumongous); _type.set_continues_humongous(); _humongous_start_region = first_hr; - - _bot_part.set_object_can_span(true); } void HeapRegion::clear_humongous() { @@ -223,8 +221,6 @@ void HeapRegion::clear_humongous() { assert(capacity() == HeapRegion::GrainBytes, "pre-condition"); _humongous_start_region = NULL; - - _bot_part.set_object_can_span(false); } HeapRegion::HeapRegion(uint hrm_index, -- GitLab From 35361270cb3aae9fa560736f8d05f1b258704c87 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 7 Dec 2021 14:15:04 +0000 Subject: [PATCH 643/890] 8277383: VM.metaspace optionally show chunk freelist details Reviewed-by: coleenp, shade --- .../share/memory/metaspace/metaspaceDCmd.cpp | 3 +++ .../share/memory/metaspace/metaspaceDCmd.hpp | 1 + .../memory/metaspace/metaspaceReporter.cpp | 18 +++++++++++++++ .../memory/metaspace/metaspaceReporter.hpp | 4 +++- .../runtime/Metaspace/PrintMetaspaceDcmd.java | 23 +++++++++++++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp b/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp index 22e623b2356..96814781377 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp @@ -42,6 +42,7 @@ MetaspaceDCmd::MetaspaceDCmd(outputStream* output, bool heap) : _by_spacetype("by-spacetype", "Break down numbers by loader type.", "BOOLEAN", false, "false"), _by_chunktype("by-chunktype", "Break down numbers by chunk type.", "BOOLEAN", false, "false"), _show_vslist("vslist", "Shows details about the underlying virtual space.", "BOOLEAN", false, "false"), + _show_chunkfreelist("chunkfreelist", "Shows details about global chunk free lists (ChunkManager).", "BOOLEAN", false, "false"), _scale("scale", "Memory usage in which to scale. Valid values are: 1, KB, MB or GB (fixed scale) " "or \"dynamic\" for a dynamically chosen scale.", "STRING", false, "dynamic"), @@ -53,6 +54,7 @@ MetaspaceDCmd::MetaspaceDCmd(outputStream* output, bool heap) : _dcmdparser.add_dcmd_option(&_by_chunktype); _dcmdparser.add_dcmd_option(&_by_spacetype); _dcmdparser.add_dcmd_option(&_show_vslist); + _dcmdparser.add_dcmd_option(&_show_chunkfreelist); _dcmdparser.add_dcmd_option(&_scale); } @@ -96,6 +98,7 @@ void MetaspaceDCmd::execute(DCmdSource source, TRAPS) { if (_by_chunktype.value()) flags |= (int)MetaspaceReporter::Option::BreakDownByChunkType; if (_by_spacetype.value()) flags |= (int)MetaspaceReporter::Option::BreakDownBySpaceType; if (_show_vslist.value()) flags |= (int)MetaspaceReporter::Option::ShowVSList; + if (_show_chunkfreelist.value()) flags |= (int)MetaspaceReporter::Option::ShowChunkFreeList; VM_PrintMetadata op(output(), scale, flags); VMThread::execute(&op); } diff --git a/src/hotspot/share/memory/metaspace/metaspaceDCmd.hpp b/src/hotspot/share/memory/metaspace/metaspaceDCmd.hpp index 0c0f49795d5..329dd6025d7 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceDCmd.hpp +++ b/src/hotspot/share/memory/metaspace/metaspaceDCmd.hpp @@ -38,6 +38,7 @@ class MetaspaceDCmd : public DCmdWithParser { DCmdArgument _by_spacetype; DCmdArgument _by_chunktype; DCmdArgument _show_vslist; + DCmdArgument _show_chunkfreelist; DCmdArgument _scale; DCmdArgument _show_classes; public: diff --git a/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp b/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp index d856883aaec..2bdc9019acf 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceReporter.cpp @@ -300,6 +300,24 @@ void MetaspaceReporter::print_report(outputStream* out, size_t scale, int flags) out->cr(); } + // -- Print Chunkmanager details. + if ((flags & (int)Option::ShowChunkFreeList) > 0) { + out->cr(); + out->print_cr("Chunk freelist details:"); + if (Metaspace::using_class_space()) { + out->print_cr(" Non-Class:"); + } + ChunkManager::chunkmanager_nonclass()->print_on(out); + out->cr(); + if (Metaspace::using_class_space()) { + out->print_cr(" Class:"); + ChunkManager::chunkmanager_class()->print_on(out); + out->cr(); + } + } + out->cr(); + + //////////// Waste section /////////////////////////// // As a convenience, print a summary of common waste. out->cr(); diff --git a/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp b/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp index 45c76b69e9d..2aab2063379 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp +++ b/src/hotspot/share/memory/metaspace/metaspaceReporter.hpp @@ -44,7 +44,9 @@ public: // Print details about the underlying virtual spaces. ShowVSList = (1 << 3), // If show_loaders: show loaded classes for each loader. - ShowClasses = (1 << 4) + ShowClasses = (1 << 4), + // Print details about the underlying virtual spaces. + ShowChunkFreeList = (1 << 5) }; // This will print out a basic metaspace usage report but diff --git a/test/hotspot/jtreg/runtime/Metaspace/PrintMetaspaceDcmd.java b/test/hotspot/jtreg/runtime/Metaspace/PrintMetaspaceDcmd.java index 413a911e700..d90a49a0adb 100644 --- a/test/hotspot/jtreg/runtime/Metaspace/PrintMetaspaceDcmd.java +++ b/test/hotspot/jtreg/runtime/Metaspace/PrintMetaspaceDcmd.java @@ -168,6 +168,29 @@ public class PrintMetaspaceDcmd { output.shouldContain("Virtual space list"); output.shouldMatch("node.*reserved.*committed.*used.*"); + pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.metaspace", "chunkfreelist"}); + // Output should look somewhat like this... + // vvvvvvvvvvvvvvvv + // Chunk freelist details: + // Non-Class: + // cm non-class-space: 5 chunks, total word size: 402944. + // -- List[lv00]: empty + // -- List[lv01]: - - total : 1 chunks. + // -- List[lv02]: - - total : 1 chunks. + // -- List[lv03]: empty + // ..... + // + // total chunks: 5, total word size: 402944. + // ^^^^^^^^^^^^^^^^^ + // .... but the actual number of chunks in the freelist is difficult to predict and may be low or zero since + // no class unloading happened yet. + output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + output.shouldContain("Chunk freelist details:"); + // ... but we should see at least one one chunk somewhere, the list should never be empty. + output.shouldMatch(".*-- List\\[lv00\\].*"); + output.shouldMatch(".*total chunks.*total word size.*"); + // Test with different scales pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.metaspace", "scale=G"}); output = new OutputAnalyzer(pb.start()); -- GitLab From 56ca66e86f848d3790115aa2faec632c226d8cd2 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 7 Dec 2021 14:21:47 +0000 Subject: [PATCH 644/890] 8277863: Deprecate sun.misc.Unsafe methods that return offsets Reviewed-by: psandoz, mchung --- .../share/classes/sun/misc/Unsafe.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java index e0ab5f3dffa..2f8d397c6c9 100644 --- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java +++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java @@ -633,8 +633,15 @@ public final class Unsafe { * the field locations in a form usable by {@link #getInt(Object,long)}. * Therefore, code which will be ported to such JVMs on 64-bit platforms * must preserve all bits of static field offsets. + * + * @deprecated The guarantee that a field will always have the same offset + * and base may not be true in a future release. The ability to provide an + * offset and object reference to a heap memory accessor will be removed + * in a future release. Use {@link java.lang.invoke.VarHandle} instead. + * * @see #getInt(Object, long) */ + @Deprecated(since="18") @ForceInline public long objectFieldOffset(Field f) { if (f == null) { @@ -665,8 +672,15 @@ public final class Unsafe { * a few bits to encode an offset within a non-array object, * However, for consistency with other methods in this class, * this method reports its result as a long value. + * + * @deprecated The guarantee that a field will always have the same offset + * and base may not be true in a future release. The ability to provide an + * offset and object reference to a heap memory accessor will be removed + * in a future release. Use {@link java.lang.invoke.VarHandle} instead. + * * @see #getInt(Object, long) */ + @Deprecated(since="18") @ForceInline public long staticFieldOffset(Field f) { if (f == null) { @@ -691,7 +705,13 @@ public final class Unsafe { * which is a "cookie", not guaranteed to be a real Object, and it should * not be used in any way except as argument to the get and put routines in * this class. + * + * @deprecated The guarantee that a field will always have the same offset + * and base may not be true in a future release. The ability to provide an + * offset and object reference to a heap memory accessor will be removed + * in a future release. Use {@link java.lang.invoke.VarHandle} instead. */ + @Deprecated(since="18") @ForceInline public Object staticFieldBase(Field f) { if (f == null) { -- GitLab From 69d8669fb3f1e4db2fbb3366a1349dd0285f5b0f Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 7 Dec 2021 14:22:35 +0000 Subject: [PATCH 645/890] 8278339: ServerSocket::isClosed may return false after accept throws Reviewed-by: dfuchs --- .../share/classes/java/net/ServerSocket.java | 13 ++- .../ServerSocket/IsClosedAfterAsyncClose.java | 81 +++++++++++++++++++ 2 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 test/jdk/java/net/ServerSocket/IsClosedAfterAsyncClose.java diff --git a/src/java.base/share/classes/java/net/ServerSocket.java b/src/java.base/share/classes/java/net/ServerSocket.java index 7c567d3e8c7..9441e6476e3 100644 --- a/src/java.base/share/classes/java/net/ServerSocket.java +++ b/src/java.base/share/classes/java/net/ServerSocket.java @@ -711,15 +711,12 @@ public class ServerSocket implements java.io.Closeable { public void close() throws IOException { synchronized (stateLock) { if (!closed) { - try { - // close underlying socket if created - if (created) { - impl.close(); - } - } finally { - closed = true; - } + closed = true; + // close underlying socket if created + if (created) { + impl.close(); + } } } } diff --git a/test/jdk/java/net/ServerSocket/IsClosedAfterAsyncClose.java b/test/jdk/java/net/ServerSocket/IsClosedAfterAsyncClose.java new file mode 100644 index 00000000000..1b777932900 --- /dev/null +++ b/test/jdk/java/net/ServerSocket/IsClosedAfterAsyncClose.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021, 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 8278339 + * @summary Test that ServerSocket::isClosed returns true after async close + */ + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; + +public class IsClosedAfterAsyncClose { + + private static final int ITERATIONS = 100; + + public static void main(String[] args) throws Exception { + for (int i = 0; i < ITERATIONS; i++) { + System.out.printf("Test %d...%n", i); + + // create listener bound to the loopback address + ServerSocket listener = new ServerSocket(); + InetAddress loopback = InetAddress.getLoopbackAddress(); + listener.bind(new InetSocketAddress(loopback, 0)); + + // task to close listener after a delay + Runnable closeListener = () -> { + try { + Thread.sleep(100); + listener.close(); + } catch (Exception e) { + e.printStackTrace(); + } + }; + + // main thread blocks in accept. When listener is closed then accept + // should wakeup with an IOException and isClosed should be true. + try (listener) { + Thread closer = new Thread(closeListener); + closer.start(); + try { + while (true) { + Socket s = listener.accept(); + // close spurious connection + s.close(); + } + } catch (IOException ioe) { + if (!listener.isClosed()) { + throw new RuntimeException("isClosed returned false!!"); + } + } finally { + closer.join(); + } + } + } + } +} + -- GitLab From 5b81d5eeb4124ff04dc3b9a96d0b53edcfa07c5f Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Tue, 7 Dec 2021 14:41:42 +0000 Subject: [PATCH 646/890] 8276901: Implement UseHeavyMonitors consistently Reviewed-by: coleenp, mdoerr, dcubed --- src/hotspot/cpu/aarch64/aarch64.ad | 91 +++++++------ .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 8 +- .../cpu/aarch64/sharedRuntime_aarch64.cpp | 87 ++++++------ src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp | 2 +- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 4 +- src/hotspot/cpu/ppc/macroAssembler_ppc.cpp | 91 +++++++------ src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp | 2 +- src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp | 8 +- src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp | 58 ++++---- src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp | 103 ++++++++------- src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp | 100 +++++++------- src/hotspot/share/c1/c1_LIRGenerator.cpp | 2 +- src/hotspot/share/c1/c1_Runtime1.cpp | 2 +- src/hotspot/share/c1/c1_globals.hpp | 3 - src/hotspot/share/runtime/arguments.cpp | 17 +++ src/hotspot/share/runtime/globals.hpp | 7 +- src/hotspot/share/runtime/synchronizer.cpp | 124 ++++++++++-------- .../CommandLine/VMDeprecatedOptions.java | 43 +++--- .../ConcurrentHashMap/MapLoops.java | 8 ++ 19 files changed, 442 insertions(+), 318 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 1f1a2172934..4e6ed4832bf 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -3906,37 +3906,40 @@ encode %{ // Check for existing monitor __ tbnz(disp_hdr, exact_log2(markWord::monitor_value), object_has_monitor); - // Set tmp to be (markWord of object | UNLOCK_VALUE). - __ orr(tmp, disp_hdr, markWord::unlocked_value); - - // Initialize the box. (Must happen before we update the object mark!) - __ str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes())); - - // Compare object markWord with an unlocked value (tmp) and if - // equal exchange the stack address of our box with object markWord. - // On failure disp_hdr contains the possibly locked markWord. - __ cmpxchg(oop, tmp, box, Assembler::xword, /*acquire*/ true, - /*release*/ true, /*weak*/ false, disp_hdr); - __ br(Assembler::EQ, cont); - - assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); - - // If the compare-and-exchange succeeded, then we found an unlocked - // object, will have now locked it will continue at label cont - - __ bind(cas_failed); - // We did not see an unlocked object so try the fast recursive case. - - // Check if the owner is self by comparing the value in the - // markWord of object (disp_hdr) with the stack pointer. - __ mov(rscratch1, sp); - __ sub(disp_hdr, disp_hdr, rscratch1); - __ mov(tmp, (address) (~(os::vm_page_size()-1) | markWord::lock_mask_in_place)); - // If condition is true we are cont and hence we can store 0 as the - // displaced header in the box, which indicates that it is a recursive lock. - __ ands(tmp/*==0?*/, disp_hdr, tmp); // Sets flags for result - __ str(tmp/*==0, perhaps*/, Address(box, BasicLock::displaced_header_offset_in_bytes())); - + if (!UseHeavyMonitors) { + // Set tmp to be (markWord of object | UNLOCK_VALUE). + __ orr(tmp, disp_hdr, markWord::unlocked_value); + + // Initialize the box. (Must happen before we update the object mark!) + __ str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes())); + + // Compare object markWord with an unlocked value (tmp) and if + // equal exchange the stack address of our box with object markWord. + // On failure disp_hdr contains the possibly locked markWord. + __ cmpxchg(oop, tmp, box, Assembler::xword, /*acquire*/ true, + /*release*/ true, /*weak*/ false, disp_hdr); + __ br(Assembler::EQ, cont); + + assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); + + // If the compare-and-exchange succeeded, then we found an unlocked + // object, will have now locked it will continue at label cont + + __ bind(cas_failed); + // We did not see an unlocked object so try the fast recursive case. + + // Check if the owner is self by comparing the value in the + // markWord of object (disp_hdr) with the stack pointer. + __ mov(rscratch1, sp); + __ sub(disp_hdr, disp_hdr, rscratch1); + __ mov(tmp, (address) (~(os::vm_page_size()-1) | markWord::lock_mask_in_place)); + // If condition is true we are cont and hence we can store 0 as the + // displaced header in the box, which indicates that it is a recursive lock. + __ ands(tmp/*==0?*/, disp_hdr, tmp); // Sets flags for result + __ str(tmp/*==0, perhaps*/, Address(box, BasicLock::displaced_header_offset_in_bytes())); + } else { + __ tst(oop, oop); // Set NE to indicate 'failure' -> take slow-path. We know that oop != 0. + } __ b(cont); // Handle existing monitor. @@ -3982,23 +3985,29 @@ encode %{ assert_different_registers(oop, box, tmp, disp_hdr); - // Find the lock address and load the displaced header from the stack. - __ ldr(disp_hdr, Address(box, BasicLock::displaced_header_offset_in_bytes())); + if (!UseHeavyMonitors) { + // Find the lock address and load the displaced header from the stack. + __ ldr(disp_hdr, Address(box, BasicLock::displaced_header_offset_in_bytes())); - // If the displaced header is 0, we have a recursive unlock. - __ cmp(disp_hdr, zr); - __ br(Assembler::EQ, cont); + // If the displaced header is 0, we have a recursive unlock. + __ cmp(disp_hdr, zr); + __ br(Assembler::EQ, cont); + } // Handle existing monitor. __ ldr(tmp, Address(oop, oopDesc::mark_offset_in_bytes())); __ tbnz(disp_hdr, exact_log2(markWord::monitor_value), object_has_monitor); - // Check if it is still a light weight lock, this is is true if we - // see the stack address of the basicLock in the markWord of the - // object. + if (!UseHeavyMonitors) { + // Check if it is still a light weight lock, this is is true if we + // see the stack address of the basicLock in the markWord of the + // object. - __ cmpxchg(oop, box, disp_hdr, Assembler::xword, /*acquire*/ false, - /*release*/ true, /*weak*/ false, tmp); + __ cmpxchg(oop, box, disp_hdr, Assembler::xword, /*acquire*/ false, + /*release*/ true, /*weak*/ false, tmp); + } else { + __ tst(oop, oop); // Set NE to indicate 'failure' -> take slow-path. We know that oop != 0. + } __ b(cont); assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index fead8af7d1b..6f91b1539a6 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -438,7 +438,11 @@ int LIR_Assembler::emit_unwind_handler() { if (method()->is_synchronized()) { monitor_address(0, FrameMap::r0_opr); stub = new MonitorExitStub(FrameMap::r0_opr, true, 0); - __ unlock_object(r5, r4, r0, *stub->entry()); + if (UseHeavyMonitors) { + __ b(*stub->entry()); + } else { + __ unlock_object(r5, r4, r0, *stub->entry()); + } __ bind(*stub->continuation()); } @@ -2562,7 +2566,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { Register obj = op->obj_opr()->as_register(); // may not be an oop Register hdr = op->hdr_opr()->as_register(); Register lock = op->lock_opr()->as_register(); - if (!UseFastLocking) { + if (UseHeavyMonitors) { __ b(*op->stub()->entry()); } else if (op->code() == lir_lock) { assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header"); diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index 5c80566aead..254cde16e09 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -1642,39 +1642,42 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Load the oop from the handle __ ldr(obj_reg, Address(oop_handle_reg, 0)); - // Load (object->mark() | 1) into swap_reg %r0 - __ ldr(rscratch1, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - __ orr(swap_reg, rscratch1, 1); + if (!UseHeavyMonitors) { + // Load (object->mark() | 1) into swap_reg %r0 + __ ldr(rscratch1, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + __ orr(swap_reg, rscratch1, 1); - // Save (object->mark() | 1) into BasicLock's displaced header - __ str(swap_reg, Address(lock_reg, mark_word_offset)); + // Save (object->mark() | 1) into BasicLock's displaced header + __ str(swap_reg, Address(lock_reg, mark_word_offset)); - // src -> dest iff dest == r0 else r0 <- dest - { Label here; - __ cmpxchg_obj_header(r0, lock_reg, obj_reg, rscratch1, lock_done, /*fallthrough*/NULL); - } + // src -> dest iff dest == r0 else r0 <- dest + { Label here; + __ cmpxchg_obj_header(r0, lock_reg, obj_reg, rscratch1, lock_done, /*fallthrough*/NULL); + } - // Hmm should this move to the slow path code area??? + // Hmm should this move to the slow path code area??? - // Test if the oopMark is an obvious stack pointer, i.e., - // 1) (mark & 3) == 0, and - // 2) sp <= mark < mark + os::pagesize() - // These 3 tests can be done by evaluating the following - // expression: ((mark - sp) & (3 - os::vm_page_size())), - // assuming both stack pointer and pagesize have their - // least significant 2 bits clear. - // NOTE: the oopMark is in swap_reg %r0 as the result of cmpxchg + // Test if the oopMark is an obvious stack pointer, i.e., + // 1) (mark & 3) == 0, and + // 2) sp <= mark < mark + os::pagesize() + // These 3 tests can be done by evaluating the following + // expression: ((mark - sp) & (3 - os::vm_page_size())), + // assuming both stack pointer and pagesize have their + // least significant 2 bits clear. + // NOTE: the oopMark is in swap_reg %r0 as the result of cmpxchg - __ sub(swap_reg, sp, swap_reg); - __ neg(swap_reg, swap_reg); - __ ands(swap_reg, swap_reg, 3 - os::vm_page_size()); + __ sub(swap_reg, sp, swap_reg); + __ neg(swap_reg, swap_reg); + __ ands(swap_reg, swap_reg, 3 - os::vm_page_size()); - // Save the test result, for recursive case, the result is zero - __ str(swap_reg, Address(lock_reg, mark_word_offset)); - __ br(Assembler::NE, slow_path_lock); + // Save the test result, for recursive case, the result is zero + __ str(swap_reg, Address(lock_reg, mark_word_offset)); + __ br(Assembler::NE, slow_path_lock); + } else { + __ b(slow_path_lock); + } // Slow path will re-enter here - __ bind(lock_done); } @@ -1775,26 +1778,30 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ ldr(obj_reg, Address(oop_handle_reg, 0)); Label done; - // Simple recursive lock? - __ ldr(rscratch1, Address(sp, lock_slot_offset * VMRegImpl::stack_slot_size)); - __ cbz(rscratch1, done); + if (!UseHeavyMonitors) { + // Simple recursive lock? + __ ldr(rscratch1, Address(sp, lock_slot_offset * VMRegImpl::stack_slot_size)); + __ cbz(rscratch1, done); - // Must save r0 if if it is live now because cmpxchg must use it - if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) { - save_native_result(masm, ret_type, stack_slots); - } + // Must save r0 if if it is live now because cmpxchg must use it + if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) { + save_native_result(masm, ret_type, stack_slots); + } - // get address of the stack lock - __ lea(r0, Address(sp, lock_slot_offset * VMRegImpl::stack_slot_size)); - // get old displaced header - __ ldr(old_hdr, Address(r0, 0)); + // get address of the stack lock + __ lea(r0, Address(sp, lock_slot_offset * VMRegImpl::stack_slot_size)); + // get old displaced header + __ ldr(old_hdr, Address(r0, 0)); - // Atomic swap old header if oop still contains the stack lock - Label succeed; - __ cmpxchg_obj_header(r0, old_hdr, obj_reg, rscratch1, succeed, &slow_path_unlock); - __ bind(succeed); + // Atomic swap old header if oop still contains the stack lock + Label succeed; + __ cmpxchg_obj_header(r0, old_hdr, obj_reg, rscratch1, succeed, &slow_path_unlock); + __ bind(succeed); + } else { + __ b(slow_path_unlock); + } // slow path re-enters here __ bind(unlock_done); diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp index 3ec2db3b313..95fab38a584 100644 --- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp @@ -2425,7 +2425,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { Register hdr = op->hdr_opr()->as_pointer_register(); Register lock = op->lock_opr()->as_pointer_register(); - if (!UseFastLocking) { + if (UseHeavyMonitors) { __ b(*op->stub()->entry()); } else if (op->code() == lir_lock) { assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header"); diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index 23e03cb36e3..2d5ac43f442 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -2689,7 +2689,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { // Obj may not be an oop. if (op->code() == lir_lock) { MonitorEnterStub* stub = (MonitorEnterStub*)op->stub(); - if (UseFastLocking) { + if (!UseHeavyMonitors) { 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) { @@ -2711,7 +2711,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { } } else { assert (op->code() == lir_unlock, "Invalid code, expected lir_unlock"); - if (UseFastLocking) { + if (!UseHeavyMonitors) { 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 { diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index 98565003691..cb58e775422 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -2660,27 +2660,32 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register andi_(temp, displaced_header, markWord::monitor_value); bne(CCR0, object_has_monitor); - // Set displaced_header to be (markWord of object | UNLOCK_VALUE). - ori(displaced_header, displaced_header, markWord::unlocked_value); - - // Load Compare Value application register. - - // Initialize the box. (Must happen before we update the object mark!) - std(displaced_header, BasicLock::displaced_header_offset_in_bytes(), box); - - // Must fence, otherwise, preceding store(s) may float below cmpxchg. - // Compare object markWord with mark and if equal exchange scratch1 with object markWord. - cmpxchgd(/*flag=*/flag, - /*current_value=*/current_header, - /*compare_value=*/displaced_header, - /*exchange_value=*/box, - /*where=*/oop, - MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, - MacroAssembler::cmpxchgx_hint_acquire_lock(), - noreg, - &cas_failed, - /*check without membar and ldarx first*/true); - assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); + if (!UseHeavyMonitors) { + // Set displaced_header to be (markWord of object | UNLOCK_VALUE). + ori(displaced_header, displaced_header, markWord::unlocked_value); + + // Load Compare Value application register. + + // Initialize the box. (Must happen before we update the object mark!) + std(displaced_header, BasicLock::displaced_header_offset_in_bytes(), box); + + // Must fence, otherwise, preceding store(s) may float below cmpxchg. + // Compare object markWord with mark and if equal exchange scratch1 with object markWord. + cmpxchgd(/*flag=*/flag, + /*current_value=*/current_header, + /*compare_value=*/displaced_header, + /*exchange_value=*/box, + /*where=*/oop, + MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, + MacroAssembler::cmpxchgx_hint_acquire_lock(), + noreg, + &cas_failed, + /*check without membar and ldarx first*/true); + assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); + } else { + // Set NE to indicate 'failure' -> take slow-path. + crandc(flag, Assembler::equal, flag, Assembler::equal); + } // If the compare-and-exchange succeeded, then we found an unlocked // object and we have now locked it. @@ -2768,12 +2773,14 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe } #endif - // Find the lock address and load the displaced header from the stack. - ld(displaced_header, BasicLock::displaced_header_offset_in_bytes(), box); + if (!UseHeavyMonitors) { + // Find the lock address and load the displaced header from the stack. + ld(displaced_header, BasicLock::displaced_header_offset_in_bytes(), box); - // If the displaced header is 0, we have a recursive unlock. - cmpdi(flag, displaced_header, 0); - beq(flag, cont); + // If the displaced header is 0, we have a recursive unlock. + cmpdi(flag, displaced_header, 0); + beq(flag, cont); + } // Handle existing monitor. // The object has an existing monitor iff (mark & monitor_value) != 0. @@ -2782,20 +2789,24 @@ void MacroAssembler::compiler_fast_unlock_object(ConditionRegister flag, Registe andi_(R0, current_header, markWord::monitor_value); bne(CCR0, object_has_monitor); - // Check if it is still a light weight lock, this is is true if we see - // the stack address of the basicLock in the markWord of the object. - // Cmpxchg sets flag to cmpd(current_header, box). - cmpxchgd(/*flag=*/flag, - /*current_value=*/current_header, - /*compare_value=*/box, - /*exchange_value=*/displaced_header, - /*where=*/oop, - MacroAssembler::MemBarRel, - MacroAssembler::cmpxchgx_hint_release_lock(), - noreg, - &cont); - - assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); + if (!UseHeavyMonitors) { + // Check if it is still a light weight lock, this is is true if we see + // the stack address of the basicLock in the markWord of the object. + // Cmpxchg sets flag to cmpd(current_header, box). + cmpxchgd(/*flag=*/flag, + /*current_value=*/current_header, + /*compare_value=*/box, + /*exchange_value=*/displaced_header, + /*where=*/oop, + MacroAssembler::MemBarRel, + MacroAssembler::cmpxchgx_hint_release_lock(), + noreg, + &cont); + assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); + } else { + // Set NE to indicate 'failure' -> take slow-path. + crandc(flag, Assembler::equal, flag, Assembler::equal); + } // Handle existing monitor. b(cont); diff --git a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp index cb5903886ca..1d1f163826e 100644 --- a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp @@ -2730,7 +2730,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { Register obj = op->obj_opr()->as_register(); // May not be an oop. Register hdr = op->hdr_opr()->as_register(); Register lock = op->lock_opr()->as_register(); - if (!UseFastLocking) { + if (UseHeavyMonitors) { __ branch_optimized(Assembler::bcondAlways, *op->stub()->entry()); } else if (op->code() == lir_lock) { assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header"); diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index 07f2762fa16..eaeeae235f0 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -461,7 +461,11 @@ int LIR_Assembler::emit_unwind_handler() { if (method()->is_synchronized()) { monitor_address(0, FrameMap::rax_opr); stub = new MonitorExitStub(FrameMap::rax_opr, true, 0); - __ unlock_object(rdi, rsi, rax, *stub->entry()); + if (UseHeavyMonitors) { + __ jmp(*stub->entry()); + } else { + __ unlock_object(rdi, rsi, rax, *stub->entry()); + } __ bind(*stub->continuation()); } @@ -3498,7 +3502,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) { Register obj = op->obj_opr()->as_register(); // may not be an oop Register hdr = op->hdr_opr()->as_register(); Register lock = op->lock_opr()->as_register(); - if (!UseFastLocking) { + if (UseHeavyMonitors) { __ jmp(*op->stub()->entry()); } else if (op->code() == lir_lock) { assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header"); diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index 4aec9668a14..cc0ad344c96 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -485,6 +485,7 @@ void C2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmp #if INCLUDE_RTM_OPT if (UseRTMForStackLocks && use_rtm) { + assert(!UseHeavyMonitors, "+UseHeavyMonitors and +UseRTMForStackLocks are mutually exclusive"); rtm_stack_locking(objReg, tmpReg, scrReg, cx2Reg, stack_rtm_counters, method_data, profile_rtm, DONE_LABEL, IsInflated); @@ -495,20 +496,25 @@ void C2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmp testptr(tmpReg, markWord::monitor_value); // inflated vs stack-locked|neutral jccb(Assembler::notZero, IsInflated); - // Attempt stack-locking ... - orptr (tmpReg, markWord::unlocked_value); - movptr(Address(boxReg, 0), tmpReg); // Anticipate successful CAS - lock(); - cmpxchgptr(boxReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Updates tmpReg - jcc(Assembler::equal, DONE_LABEL); // Success - - // Recursive locking. - // The object is stack-locked: markword contains stack pointer to BasicLock. - // Locked by current thread if difference with current SP is less than one page. - subptr(tmpReg, rsp); - // Next instruction set ZFlag == 1 (Success) if difference is less then one page. - andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) ); - movptr(Address(boxReg, 0), tmpReg); + if (!UseHeavyMonitors) { + // Attempt stack-locking ... + orptr (tmpReg, markWord::unlocked_value); + movptr(Address(boxReg, 0), tmpReg); // Anticipate successful CAS + lock(); + cmpxchgptr(boxReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Updates tmpReg + jcc(Assembler::equal, DONE_LABEL); // Success + + // Recursive locking. + // The object is stack-locked: markword contains stack pointer to BasicLock. + // Locked by current thread if difference with current SP is less than one page. + subptr(tmpReg, rsp); + // Next instruction set ZFlag == 1 (Success) if difference is less then one page. + andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) ); + movptr(Address(boxReg, 0), tmpReg); + } else { + // Clear ZF so that we take the slow path at the DONE label. objReg is known to be not 0. + testptr(objReg, objReg); + } jmp(DONE_LABEL); bind(IsInflated); @@ -638,6 +644,7 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t #if INCLUDE_RTM_OPT if (UseRTMForStackLocks && use_rtm) { + assert(!UseHeavyMonitors, "+UseHeavyMonitors and +UseRTMForStackLocks are mutually exclusive"); Label L_regular_unlock; movptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // fetch markword andptr(tmpReg, markWord::lock_mask_in_place); // look at 2 lock bits @@ -649,11 +656,15 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t } #endif - cmpptr(Address(boxReg, 0), (int32_t)NULL_WORD); // Examine the displaced header - jcc (Assembler::zero, DONE_LABEL); // 0 indicates recursive stack-lock + if (!UseHeavyMonitors) { + cmpptr(Address(boxReg, 0), (int32_t)NULL_WORD); // Examine the displaced header + jcc (Assembler::zero, DONE_LABEL); // 0 indicates recursive stack-lock + } movptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Examine the object's markword - testptr(tmpReg, markWord::monitor_value); // Inflated? - jccb (Assembler::zero, Stacked); + if (!UseHeavyMonitors) { + testptr(tmpReg, markWord::monitor_value); // Inflated? + jccb (Assembler::zero, Stacked); + } // It's inflated. #if INCLUDE_RTM_OPT @@ -795,11 +806,12 @@ void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register t testl (boxReg, 0); // set ICC.ZF=1 to indicate success jmpb (DONE_LABEL); - bind (Stacked); - movptr(tmpReg, Address (boxReg, 0)); // re-fetch - lock(); - cmpxchgptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Uses RAX which is box - + if (!UseHeavyMonitors) { + bind (Stacked); + movptr(tmpReg, Address (boxReg, 0)); // re-fetch + lock(); + cmpxchgptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes())); // Uses RAX which is box + } #endif bind(DONE_LABEL); } diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp index a00af0e4af0..e139b3cf6eb 100644 --- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp +++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp @@ -1705,36 +1705,41 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Load the oop from the handle __ movptr(obj_reg, Address(oop_handle_reg, 0)); - // Load immediate 1 into swap_reg %rax, - __ movptr(swap_reg, 1); - - // Load (object->mark() | 1) into swap_reg %rax, - __ orptr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - - // Save (object->mark() | 1) into BasicLock's displaced header - __ movptr(Address(lock_reg, mark_word_offset), swap_reg); - - // src -> dest iff dest == rax, else rax, <- dest - // *obj_reg = lock_reg iff *obj_reg == rax, else rax, = *(obj_reg) - __ lock(); - __ cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - __ jcc(Assembler::equal, lock_done); - - // Test if the oopMark is an obvious stack pointer, i.e., - // 1) (mark & 3) == 0, and - // 2) rsp <= mark < mark + os::pagesize() - // These 3 tests can be done by evaluating the following - // expression: ((mark - rsp) & (3 - os::vm_page_size())), - // assuming both stack pointer and pagesize have their - // least significant 2 bits clear. - // NOTE: the oopMark is in swap_reg %rax, as the result of cmpxchg - - __ subptr(swap_reg, rsp); - __ andptr(swap_reg, 3 - os::vm_page_size()); - - // Save the test result, for recursive case, the result is zero - __ movptr(Address(lock_reg, mark_word_offset), swap_reg); - __ jcc(Assembler::notEqual, slow_path_lock); + if (!UseHeavyMonitors) { + // Load immediate 1 into swap_reg %rax, + __ movptr(swap_reg, 1); + + // Load (object->mark() | 1) into swap_reg %rax, + __ orptr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + + // Save (object->mark() | 1) into BasicLock's displaced header + __ movptr(Address(lock_reg, mark_word_offset), swap_reg); + + // src -> dest iff dest == rax, else rax, <- dest + // *obj_reg = lock_reg iff *obj_reg == rax, else rax, = *(obj_reg) + __ lock(); + __ cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + __ jcc(Assembler::equal, lock_done); + + // Test if the oopMark is an obvious stack pointer, i.e., + // 1) (mark & 3) == 0, and + // 2) rsp <= mark < mark + os::pagesize() + // These 3 tests can be done by evaluating the following + // expression: ((mark - rsp) & (3 - os::vm_page_size())), + // assuming both stack pointer and pagesize have their + // least significant 2 bits clear. + // NOTE: the oopMark is in swap_reg %rax, as the result of cmpxchg + + __ subptr(swap_reg, rsp); + __ andptr(swap_reg, 3 - os::vm_page_size()); + + // Save the test result, for recursive case, the result is zero + __ movptr(Address(lock_reg, mark_word_offset), swap_reg); + __ jcc(Assembler::notEqual, slow_path_lock); + } else { + __ jmp(slow_path_lock); + } + // Slow path will re-enter here __ bind(lock_done); } @@ -1852,28 +1857,32 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Get locked oop from the handle we passed to jni __ movptr(obj_reg, Address(oop_handle_reg, 0)); - // Simple recursive lock? + if (!UseHeavyMonitors) { + // Simple recursive lock? - __ cmpptr(Address(rbp, lock_slot_rbp_offset), (int32_t)NULL_WORD); - __ jcc(Assembler::equal, done); + __ cmpptr(Address(rbp, lock_slot_rbp_offset), (int32_t)NULL_WORD); + __ jcc(Assembler::equal, done); - // Must save rax, if if it is live now because cmpxchg must use it - if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) { - save_native_result(masm, ret_type, stack_slots); - } + // Must save rax, if if it is live now because cmpxchg must use it + if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) { + save_native_result(masm, ret_type, stack_slots); + } - // get old displaced header - __ movptr(rbx, Address(rbp, lock_slot_rbp_offset)); + // get old displaced header + __ movptr(rbx, Address(rbp, lock_slot_rbp_offset)); - // get address of the stack lock - __ lea(rax, Address(rbp, lock_slot_rbp_offset)); + // get address of the stack lock + __ lea(rax, Address(rbp, lock_slot_rbp_offset)); - // Atomic swap old header if oop still contains the stack lock - // src -> dest iff dest == rax, else rax, <- dest - // *obj_reg = rbx, iff *obj_reg == rax, else rax, = *(obj_reg) - __ lock(); - __ cmpxchgptr(rbx, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - __ jcc(Assembler::notEqual, slow_path_unlock); + // Atomic swap old header if oop still contains the stack lock + // src -> dest iff dest == rax, else rax, <- dest + // *obj_reg = rbx, iff *obj_reg == rax, else rax, = *(obj_reg) + __ lock(); + __ cmpxchgptr(rbx, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + __ jcc(Assembler::notEqual, slow_path_unlock); + } else { + __ jmp(slow_path_unlock); + } // slow path re-enters here __ bind(unlock_done); diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp index f78ec39c25e..9ff40e943ba 100644 --- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp +++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp @@ -1918,37 +1918,41 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // Load the oop from the handle __ movptr(obj_reg, Address(oop_handle_reg, 0)); - // Load immediate 1 into swap_reg %rax - __ movl(swap_reg, 1); - - // Load (object->mark() | 1) into swap_reg %rax - __ orptr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - - // Save (object->mark() | 1) into BasicLock's displaced header - __ movptr(Address(lock_reg, mark_word_offset), swap_reg); - - // src -> dest iff dest == rax else rax <- dest - __ lock(); - __ cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - __ jcc(Assembler::equal, lock_done); - - // Hmm should this move to the slow path code area??? - - // Test if the oopMark is an obvious stack pointer, i.e., - // 1) (mark & 3) == 0, and - // 2) rsp <= mark < mark + os::pagesize() - // These 3 tests can be done by evaluating the following - // expression: ((mark - rsp) & (3 - os::vm_page_size())), - // assuming both stack pointer and pagesize have their - // least significant 2 bits clear. - // NOTE: the oopMark is in swap_reg %rax as the result of cmpxchg - - __ subptr(swap_reg, rsp); - __ andptr(swap_reg, 3 - os::vm_page_size()); - - // Save the test result, for recursive case, the result is zero - __ movptr(Address(lock_reg, mark_word_offset), swap_reg); - __ jcc(Assembler::notEqual, slow_path_lock); + if (!UseHeavyMonitors) { + // Load immediate 1 into swap_reg %rax + __ movl(swap_reg, 1); + + // Load (object->mark() | 1) into swap_reg %rax + __ orptr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + + // Save (object->mark() | 1) into BasicLock's displaced header + __ movptr(Address(lock_reg, mark_word_offset), swap_reg); + + // src -> dest iff dest == rax else rax <- dest + __ lock(); + __ cmpxchgptr(lock_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + __ jcc(Assembler::equal, lock_done); + + // Hmm should this move to the slow path code area??? + + // Test if the oopMark is an obvious stack pointer, i.e., + // 1) (mark & 3) == 0, and + // 2) rsp <= mark < mark + os::pagesize() + // These 3 tests can be done by evaluating the following + // expression: ((mark - rsp) & (3 - os::vm_page_size())), + // assuming both stack pointer and pagesize have their + // least significant 2 bits clear. + // NOTE: the oopMark is in swap_reg %rax as the result of cmpxchg + + __ subptr(swap_reg, rsp); + __ andptr(swap_reg, 3 - os::vm_page_size()); + + // Save the test result, for recursive case, the result is zero + __ movptr(Address(lock_reg, mark_word_offset), swap_reg); + __ jcc(Assembler::notEqual, slow_path_lock); + } else { + __ jmp(slow_path_lock); + } // Slow path will re-enter here @@ -2055,26 +2059,30 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ movptr(obj_reg, Address(oop_handle_reg, 0)); Label done; - // Simple recursive lock? - __ cmpptr(Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size), (int32_t)NULL_WORD); - __ jcc(Assembler::equal, done); + if (!UseHeavyMonitors) { + // Simple recursive lock? + __ cmpptr(Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size), (int32_t)NULL_WORD); + __ jcc(Assembler::equal, done); - // Must save rax if if it is live now because cmpxchg must use it - if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) { - save_native_result(masm, ret_type, stack_slots); - } + // Must save rax if if it is live now because cmpxchg must use it + if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) { + save_native_result(masm, ret_type, stack_slots); + } - // get address of the stack lock - __ lea(rax, Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size)); - // get old displaced header - __ movptr(old_hdr, Address(rax, 0)); + // get address of the stack lock + __ lea(rax, Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size)); + // get old displaced header + __ movptr(old_hdr, Address(rax, 0)); - // Atomic swap old header if oop still contains the stack lock - __ lock(); - __ cmpxchgptr(old_hdr, Address(obj_reg, oopDesc::mark_offset_in_bytes())); - __ jcc(Assembler::notEqual, slow_path_unlock); + // Atomic swap old header if oop still contains the stack lock + __ lock(); + __ cmpxchgptr(old_hdr, Address(obj_reg, oopDesc::mark_offset_in_bytes())); + __ jcc(Assembler::notEqual, slow_path_unlock); + } else { + __ jmp(slow_path_unlock); + } // slow path re-enters here __ bind(unlock_done); diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 05aa3587ee2..c064558b458 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -620,7 +620,7 @@ void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, L // setup registers LIR_Opr hdr = lock; lock = new_hdr; - CodeStub* slow_path = new MonitorExitStub(lock, UseFastLocking, monitor_no); + CodeStub* slow_path = new MonitorExitStub(lock, !UseHeavyMonitors, monitor_no); __ load_stack_address_monitor(monitor_no, lock); __ unlock_object(hdr, object, lock, scratch, slow_path); } diff --git a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp index d7e0df012e5..68e77c823c8 100644 --- a/src/hotspot/share/c1/c1_Runtime1.cpp +++ b/src/hotspot/share/c1/c1_Runtime1.cpp @@ -736,7 +736,7 @@ JRT_BLOCK_ENTRY(void, Runtime1::monitorenter(JavaThread* current, oopDesc* obj, _monitorenter_slowcase_cnt++; } #endif - if (!UseFastLocking) { + if (UseHeavyMonitors) { lock->set_obj(obj); } assert(obj == lock->obj(), "must match"); diff --git a/src/hotspot/share/c1/c1_globals.hpp b/src/hotspot/share/c1/c1_globals.hpp index 2b5de079a0c..e90aaf6536d 100644 --- a/src/hotspot/share/c1/c1_globals.hpp +++ b/src/hotspot/share/c1/c1_globals.hpp @@ -242,9 +242,6 @@ develop(bool, UseFastNewObjectArray, true, \ "Use fast inlined object array allocation") \ \ - develop(bool, UseFastLocking, true, \ - "Use fast inlined locking code") \ - \ develop(bool, UseSlowPath, false, \ "For debugging: test slow cases by always using them") \ \ diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 89352c1f95e..969c8e82b91 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -532,6 +532,9 @@ static SpecialFlag const special_jvm_flags[] = { { "DynamicDumpSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, { "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() }, +#ifdef PRODUCT + { "UseHeavyMonitors", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::jdk(20) }, +#endif // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, @@ -2018,6 +2021,20 @@ bool Arguments::check_vm_args_consistency() { } #endif +#if !defined(X86) && !defined(AARCH64) && !defined(PPC64) + if (UseHeavyMonitors) { + warning("UseHeavyMonitors is not fully implemented on this architecture"); + } +#endif +#if defined(X86) || defined(PPC64) + if (UseHeavyMonitors && UseRTMForStackLocks) { + fatal("-XX:+UseHeavyMonitors and -XX:+UseRTMForStackLocks are mutually exclusive"); + } +#endif + if (VerifyHeavyMonitors && !UseHeavyMonitors) { + fatal("-XX:+VerifyHeavyMonitors requires -XX:+UseHeavyMonitors"); + } + return status; } diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index ded9a1fe93a..beb719ff0b9 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -1066,7 +1066,12 @@ const intx ObjectAlignmentInBytes = 8; "If true, error data is printed to stdout instead of a file") \ \ product(bool, UseHeavyMonitors, false, \ - "use heavyweight instead of lightweight Java monitors") \ + "(Deprecated) Use heavyweight instead of lightweight Java " \ + "monitors") \ + \ + develop(bool, VerifyHeavyMonitors, false, \ + "Checks that no stack locking happens when using " \ + "+UseHeavyMonitors") \ \ product(bool, PrintStringTableStatistics, false, \ "print statistics about the StringTable and SymbolTable") \ diff --git a/src/hotspot/share/runtime/synchronizer.cpp b/src/hotspot/share/runtime/synchronizer.cpp index 87f28806508..4f9c7c21a9b 100644 --- a/src/hotspot/share/runtime/synchronizer.cpp +++ b/src/hotspot/share/runtime/synchronizer.cpp @@ -417,6 +417,14 @@ void ObjectSynchronizer::handle_sync_on_value_based_class(Handle obj, JavaThread } } +static bool useHeavyMonitors() { +#if defined(X86) || defined(AARCH64) || defined(PPC64) + return UseHeavyMonitors; +#else + return false; +#endif +} + // ----------------------------------------------------------------------------- // Monitor Enter/Exit // The interpreter and compiler assembly code tries to lock using the fast path @@ -428,28 +436,33 @@ void ObjectSynchronizer::enter(Handle obj, BasicLock* lock, JavaThread* current) handle_sync_on_value_based_class(obj, current); } - markWord mark = obj->mark(); - if (mark.is_neutral()) { - // Anticipate successful CAS -- the ST of the displaced mark must - // be visible <= the ST performed by the CAS. - lock->set_displaced_header(mark); - if (mark == obj()->cas_set_mark(markWord::from_pointer(lock), mark)) { + if (!useHeavyMonitors()) { + markWord mark = obj->mark(); + if (mark.is_neutral()) { + // Anticipate successful CAS -- the ST of the displaced mark must + // be visible <= the ST performed by the CAS. + lock->set_displaced_header(mark); + if (mark == obj()->cas_set_mark(markWord::from_pointer(lock), mark)) { + return; + } + // Fall through to inflate() ... + } else if (mark.has_locker() && + current->is_lock_owned((address)mark.locker())) { + assert(lock != mark.locker(), "must not re-lock the same lock"); + assert(lock != (BasicLock*)obj->mark().value(), "don't relock with same BasicLock"); + lock->set_displaced_header(markWord::from_pointer(NULL)); return; } - // Fall through to inflate() ... - } else if (mark.has_locker() && - current->is_lock_owned((address)mark.locker())) { - assert(lock != mark.locker(), "must not re-lock the same lock"); - assert(lock != (BasicLock*)obj->mark().value(), "don't relock with same BasicLock"); - lock->set_displaced_header(markWord::from_pointer(NULL)); - return; + + // The object header will never be displaced to this lock, + // so it does not matter what the value is, except that it + // must be non-zero to avoid looking like a re-entrant lock, + // and must not look locked either. + lock->set_displaced_header(markWord::unused_mark()); + } else if (VerifyHeavyMonitors) { + guarantee(!obj->mark().has_locker(), "must not be stack-locked"); } - // The object header will never be displaced to this lock, - // so it does not matter what the value is, except that it - // must be non-zero to avoid looking like a re-entrant lock, - // and must not look locked either. - lock->set_displaced_header(markWord::unused_mark()); // An async deflation can race after the inflate() call and before // enter() can make the ObjectMonitor busy. enter() returns false if // we have lost the race to async deflation and we simply try again. @@ -462,45 +475,49 @@ void ObjectSynchronizer::enter(Handle obj, BasicLock* lock, JavaThread* current) } void ObjectSynchronizer::exit(oop object, BasicLock* lock, JavaThread* current) { - markWord mark = object->mark(); + if (!useHeavyMonitors()) { + markWord mark = object->mark(); - markWord dhw = lock->displaced_header(); - if (dhw.value() == 0) { - // If the displaced header is NULL, then this exit matches up with - // a recursive enter. No real work to do here except for diagnostics. + markWord dhw = lock->displaced_header(); + if (dhw.value() == 0) { + // If the displaced header is NULL, then this exit matches up with + // a recursive enter. No real work to do here except for diagnostics. #ifndef PRODUCT - if (mark != markWord::INFLATING()) { - // Only do diagnostics if we are not racing an inflation. Simply - // exiting a recursive enter of a Java Monitor that is being - // inflated is safe; see the has_monitor() comment below. - assert(!mark.is_neutral(), "invariant"); - assert(!mark.has_locker() || - current->is_lock_owned((address)mark.locker()), "invariant"); - if (mark.has_monitor()) { - // The BasicLock's displaced_header is marked as a recursive - // enter and we have an inflated Java Monitor (ObjectMonitor). - // This is a special case where the Java Monitor was inflated - // after this thread entered the stack-lock recursively. When a - // Java Monitor is inflated, we cannot safely walk the Java - // Monitor owner's stack and update the BasicLocks because a - // Java Monitor can be asynchronously inflated by a thread that - // does not own the Java Monitor. - ObjectMonitor* m = mark.monitor(); - assert(m->object()->mark() == mark, "invariant"); - assert(m->is_entered(current), "invariant"); + if (mark != markWord::INFLATING()) { + // Only do diagnostics if we are not racing an inflation. Simply + // exiting a recursive enter of a Java Monitor that is being + // inflated is safe; see the has_monitor() comment below. + assert(!mark.is_neutral(), "invariant"); + assert(!mark.has_locker() || + current->is_lock_owned((address)mark.locker()), "invariant"); + if (mark.has_monitor()) { + // The BasicLock's displaced_header is marked as a recursive + // enter and we have an inflated Java Monitor (ObjectMonitor). + // This is a special case where the Java Monitor was inflated + // after this thread entered the stack-lock recursively. When a + // Java Monitor is inflated, we cannot safely walk the Java + // Monitor owner's stack and update the BasicLocks because a + // Java Monitor can be asynchronously inflated by a thread that + // does not own the Java Monitor. + ObjectMonitor* m = mark.monitor(); + assert(m->object()->mark() == mark, "invariant"); + assert(m->is_entered(current), "invariant"); + } } - } #endif - return; - } - - if (mark == markWord::from_pointer(lock)) { - // If the object is stack-locked by the current thread, try to - // swing the displaced header from the BasicLock back to the mark. - assert(dhw.is_neutral(), "invariant"); - if (object->cas_set_mark(dhw, mark) == mark) { return; } + + if (mark == markWord::from_pointer(lock)) { + // If the object is stack-locked by the current thread, try to + // swing the displaced header from the BasicLock back to the mark. + assert(dhw.is_neutral(), "invariant"); + if (object->cas_set_mark(dhw, mark) == mark) { + return; + } + } + } else if (VerifyHeavyMonitors) { + guarantee(!object->mark().has_locker(), "must not be stack-locked"); } // We have to take the slow-path of possible inflation and then exit. @@ -804,7 +821,10 @@ intptr_t ObjectSynchronizer::FastHashCode(Thread* current, oop obj) { markWord temp, test; intptr_t hash; markWord mark = read_stable_mark(obj); - + if (VerifyHeavyMonitors) { + assert(UseHeavyMonitors, "+VerifyHeavyMonitors requires +UseHeavyMonitors"); + guarantee(!mark.has_locker(), "must not be stack locked"); + } if (mark.is_neutral()) { // if this is a normal header hash = mark.hash(); if (hash != 0) { // if it has a hash, just return it diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index b8e6c41c1ba..4f4d7470630 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -21,6 +21,10 @@ * questions. */ +import java.util.Arrays; +import java.util.ArrayList; + +import jdk.test.lib.Platform; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.*; @@ -39,22 +43,31 @@ public class VMDeprecatedOptions { * each entry is {[0]: option name, [1]: value to set * (true/false/n/string)}. */ - public static final String[][] DEPRECATED_OPTIONS = { - // deprecated non-alias flags: - {"MaxGCMinorPauseMillis", "1032"}, - {"MaxRAMFraction", "8"}, - {"MinRAMFraction", "2"}, - {"InitialRAMFraction", "64"}, - {"TLABStats", "false"}, - {"AllowRedefinitionToAddDeleteMethods", "true"}, - {"UseSharedSpaces", "false"}, - {"RequireSharedSpaces", "false"}, - {"DumpSharedSpaces", "false"}, - {"DynamicDumpSharedSpaces", "false"}, + public static final String[][] DEPRECATED_OPTIONS; + static { + ArrayList deprecated = new ArrayList( + Arrays.asList(new String[][] { + // deprecated non-alias flags: + {"MaxGCMinorPauseMillis", "1032"}, + {"MaxRAMFraction", "8"}, + {"MinRAMFraction", "2"}, + {"InitialRAMFraction", "64"}, + {"TLABStats", "false"}, + {"AllowRedefinitionToAddDeleteMethods", "true"}, + {"UseSharedSpaces", "false"}, + {"RequireSharedSpaces", "false"}, + {"DumpSharedSpaces", "false"}, + {"DynamicDumpSharedSpaces", "false"}, - // deprecated alias flags (see also aliased_jvm_flags): - {"DefaultMaxRAMFraction", "4"}, - {"CreateMinidumpOnCrash", "false"} + // deprecated alias flags (see also aliased_jvm_flags): + {"DefaultMaxRAMFraction", "4"}, + {"CreateMinidumpOnCrash", "false"} + } + )); + if (!Platform.isDebugBuild()) { + deprecated.add(new String[]{"UseHeavyMonitors", "false"}); + } + DEPRECATED_OPTIONS = deprecated.toArray(new String[][]{}); }; static String getDeprecationString(String optionName) { diff --git a/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java b/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java index 0f52bc67f08..922b18836dd 100644 --- a/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java +++ b/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java @@ -45,6 +45,14 @@ * @run main/timeout=1600 MapLoops */ +/* + * @test + * @summary Exercise multithreaded maps, using only heavy monitors. + * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" | os.arch == "ppc64" | os.arch == "ppc64le" + * @library /test/lib + * @run main/othervm/timeout=1600 -XX:+IgnoreUnrecognizedVMOptions -XX:+UseHeavyMonitors -XX:+VerifyHeavyMonitors MapLoops + */ + import static java.util.concurrent.TimeUnit.MILLISECONDS; import java.util.List; -- GitLab From bb50b92b804839577cee5092a8a62a98b760f0dc Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Tue, 7 Dec 2021 14:54:32 +0000 Subject: [PATCH 647/890] 8277536: Use String.blank in jdk.javadoc where applicable Reviewed-by: jjg --- .../doclets/formats/html/HtmlDocletWriter.java | 18 +++++------------- .../jdk/javadoc/internal/doclint/Checker.java | 8 +------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index 76709124ff2..cf9c43264c1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -896,7 +896,7 @@ public class HtmlDocletWriter { * Return the link for the given member. * * @param context the id of the context where the link will be printed. - * @param typeElement the typeElement that we should link to. This is not + * @param typeElement the typeElement that we should link to. This is * not necessarily the type containing element since we may be * inheriting comments. * @param element the member being linked to. @@ -912,7 +912,7 @@ public class HtmlDocletWriter { * Return the link for the given member. * * @param context the id of the context where the link will be printed. - * @param typeElement the typeElement that we should link to. This is not + * @param typeElement the typeElement that we should link to. This is * not necessarily the type containing element since we may be * inheriting comments. * @param element the member being linked to. @@ -929,7 +929,7 @@ public class HtmlDocletWriter { * Return the link for the given member. * * @param context the id of the context where the link will be printed. - * @param typeElement the typeElement that we should link to. This is not + * @param typeElement the typeElement that we should link to. This is * not necessarily the type containing element since we may be * inheriting comments. * @param element the member being linked to. @@ -945,7 +945,7 @@ public class HtmlDocletWriter { * Return the link for the given member. * * @param context the id of the context where the link will be printed. - * @param typeElement the typeElement that we should link to. This is not + * @param typeElement the typeElement that we should link to. This is * not necessarily the type containing element since we may be * inheriting comments. * @param element the member being linked to. @@ -1407,14 +1407,6 @@ public class HtmlDocletWriter { return false; } - boolean isAllWhiteSpace(String body) { - for (int i = 0 ; i < body.length(); i++) { - if (!Character.isWhitespace(body.charAt(i))) - return false; - } - return true; - } - // Notify the next DocTree handler to take necessary action private boolean commentRemoved = false; @@ -1505,7 +1497,7 @@ public class HtmlDocletWriter { // Ignore any trailing whitespace OR whitespace after removed html comment if ((isLastNode || commentRemoved) && tag.getKind() == TEXT - && isAllWhiteSpace(ch.getText(tag))) + && ch.getText(tag).isBlank()) continue; // Ignore any leading html comments diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java index 0d73d233cc1..abf8c698bba 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/Checker.java @@ -1236,13 +1236,7 @@ public class Checker extends DocTreePathScanner { } boolean hasNonWhitespace(TextTree tree) { - String s = tree.getBody(); - for (int i = 0; i < s.length(); i++) { - Character c = s.charAt(i); - if (!Character.isWhitespace(s.charAt(i))) - return true; - } - return false; + return !tree.getBody().isBlank(); } // -- GitLab From c609b5d3d7a3d08e489c2c9ed40c42bcb5bd2147 Mon Sep 17 00:00:00 2001 From: Aleksei Efimov Date: Tue, 7 Dec 2021 15:42:02 +0000 Subject: [PATCH 648/890] 8277628: Spec for InetAddressResolverProvider::get() throwing error or exception could be clearer Reviewed-by: alanb, dfuchs --- .../classes/java/net/spi/InetAddressResolverProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/classes/java/net/spi/InetAddressResolverProvider.java b/src/java.base/share/classes/java/net/spi/InetAddressResolverProvider.java index 30f1c4f5b3e..6dff033ffc8 100644 --- a/src/java.base/share/classes/java/net/spi/InetAddressResolverProvider.java +++ b/src/java.base/share/classes/java/net/spi/InetAddressResolverProvider.java @@ -66,7 +66,8 @@ import java.util.ServiceLoader; * *

      If instantiating a custom resolver from a provider discovered in * step 1 throws an error or exception, the system-wide resolver will not be - * set and the error or exception will be propagated to the calling thread. + * set and the error or exception will be propagated to the caller of the method + * that triggered the lookup operation. * Otherwise, any lookup operation will be performed using the * system-wide resolver. * @@ -85,7 +86,7 @@ public abstract class InetAddressResolverProvider { * *

      Any error or exception thrown by this method is considered as * a failure of {@code InetAddressResolver} instantiation and will be propagated to - * the calling thread. + * the caller of the method that triggered the lookup operation. * @param configuration a {@link Configuration} instance containing platform built-in address * resolution configuration. * @return the resolver provided by this provider -- GitLab From bd7c54aee8d9795676087d6b34d4744031de1ef1 Mon Sep 17 00:00:00 2001 From: Maurizio Cimadamore Date: Tue, 7 Dec 2021 16:13:54 +0000 Subject: [PATCH 649/890] 8278341: Liveness check for global scope is not as fast as it could be Reviewed-by: shade, jvernee --- .../classes/jdk/internal/foreign/ResourceScopeImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java index dbb830a1b53..ab47db827e7 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/ResourceScopeImpl.java @@ -217,6 +217,11 @@ public abstract non-sealed class ResourceScopeImpl implements ResourceScope, Seg void addInternal(ResourceList.ResourceCleanup resource) { // do nothing } + + @Override + public boolean isAlive() { + return true; + } } public static final ResourceScopeImpl GLOBAL = new GlobalScopeImpl(null); -- GitLab From 543d1a8cf41d32dca161c9d8041f133a71bf0ecb Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Tue, 7 Dec 2021 16:44:52 +0000 Subject: [PATCH 650/890] 8275721: Name of UTC timezone in a locale changes depending on previous code Reviewed-by: joehw --- .../cldr/CLDRTimeZoneNameProviderImpl.java | 42 +++++------ .../TimeZone/ChineseTimeZoneNameTest.java | 72 +++++++++++++++++++ 2 files changed, 91 insertions(+), 23 deletions(-) create mode 100644 test/jdk/sun/util/resources/TimeZone/ChineseTimeZoneNameTest.java diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java index 6d78d77f64d..d03e753a0a4 100644 --- a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java +++ b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java @@ -82,7 +82,7 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { } if (namesSuper != null) { - // CLDR's resource bundle has an translated entry for this id. + // CLDR's resource bundle has a translated entry for this id. // Fix up names if needed, either missing or no-inheritance namesSuper[INDEX_TZID] = id; @@ -91,7 +91,7 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { case "": // Fill in empty elements deriveFallbackName(namesSuper, i, locale, - !TimeZone.getTimeZone(id).useDaylightTime()); + TimeZone.getTimeZone(id).toZoneId().getRules().isFixedOffset()); break; case NO_INHERITANCE_MARKER: // CLDR's "no inheritance marker" @@ -129,7 +129,7 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { // Derive fallback time zone name according to LDML's logic private void deriveFallbackNames(String[] names, Locale locale) { - boolean noDST = !TimeZone.getTimeZone(names[0]).useDaylightTime(); + boolean noDST = TimeZone.getTimeZone(names[0]).toZoneId().getRules().isFixedOffset(); for (int i = INDEX_STD_LONG; i <= INDEX_GEN_SHORT; i++) { deriveFallbackName(names, i, locale, noDST); @@ -149,13 +149,12 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { return; } - // Check parent locale first + // Check parent locales first if (!exists(names, index)) { CLDRLocaleProviderAdapter clpa = (CLDRLocaleProviderAdapter)LocaleProviderAdapter.forType(Type.CLDR); var cands = clpa.getCandidateLocales("", locale); - if (cands.size() > 1) { - var parentLoc = cands.get(1); // immediate parent locale - String[] parentNames = super.getDisplayNameArray(id, parentLoc); + for (int i = 1; i < cands.size() ; i++) { + String[] parentNames = super.getDisplayNameArray(id, cands.get(i)); if (parentNames != null && !parentNames[index].isEmpty()) { names[index] = parentNames[index]; return; @@ -163,22 +162,6 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { } } - // Check if COMPAT can substitute the name - if (LocaleProviderAdapter.getAdapterPreference().contains(Type.JRE)) { - String[] compatNames = (String[])LocaleProviderAdapter.forJRE() - .getLocaleResources(mapChineseLocale(locale)) - .getTimeZoneNames(id); - if (compatNames != null) { - for (int i = INDEX_STD_LONG; i <= INDEX_GEN_SHORT; i++) { - // Assumes COMPAT has no empty slots - if (i == index || !exists(names, i)) { - names[i] = compatNames[i]; - } - } - return; - } - } - // Region Fallback if (regionFormatFallback(names, index, locale)) { return; @@ -189,6 +172,19 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { return; } + // Check if COMPAT can substitute the name + if (!exists(names, index) && + LocaleProviderAdapter.getAdapterPreference().contains(Type.JRE)) { + String[] compatNames = (String[])LocaleProviderAdapter.forJRE() + .getLocaleResources(mapChineseLocale(locale)) + .getTimeZoneNames(id); + if (compatNames != null) { + // Assumes COMPAT has no empty slots + names[index] = compatNames[index]; + return; + } + } + // last resort names[index] = toGMTFormat(id, index == INDEX_DST_LONG || index == INDEX_DST_SHORT, diff --git a/test/jdk/sun/util/resources/TimeZone/ChineseTimeZoneNameTest.java b/test/jdk/sun/util/resources/TimeZone/ChineseTimeZoneNameTest.java new file mode 100644 index 00000000000..c752ec4d63c --- /dev/null +++ b/test/jdk/sun/util/resources/TimeZone/ChineseTimeZoneNameTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021, 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 8275721 + * @modules jdk.localedata + * @summary Checks Chinese time zone names for `UTC` using CLDR are consistent + * @run testng/othervm -Djava.locale.providers=CLDR,COMPAT ChineseTimeZoneNameTest + * @run testng/othervm -Djava.locale.providers=CLDR ChineseTimeZoneNameTest + */ + +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Locale; + +import static org.testng.Assert.assertEquals; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +@Test +public class ChineseTimeZoneNameTest { + + private static final Locale SIMPLIFIED_CHINESE = Locale.forLanguageTag("zh-Hans"); + private static final Locale TRADITIONAL_CHINESE = Locale.forLanguageTag("zh-Hant"); + private static final ZonedDateTime EPOCH_UTC = + ZonedDateTime.ofInstant(Instant.ofEpochSecond (0), ZoneId.of ("UTC")); + + @DataProvider(name="locales") + Object[][] data() { + return new Object[][] { + {Locale.CHINESE, SIMPLIFIED_CHINESE}, + {Locale.SIMPLIFIED_CHINESE, SIMPLIFIED_CHINESE}, + {Locale.forLanguageTag("zh-SG"), SIMPLIFIED_CHINESE}, + {Locale.forLanguageTag("zh-Hans-TW"), SIMPLIFIED_CHINESE}, + {Locale.forLanguageTag("zh-HK"), TRADITIONAL_CHINESE}, + {Locale.forLanguageTag("zh-MO"), TRADITIONAL_CHINESE}, + {Locale.TRADITIONAL_CHINESE, TRADITIONAL_CHINESE}, + {Locale.forLanguageTag("zh-Hant-CN"), TRADITIONAL_CHINESE}, + }; + } + + @Test(dataProvider="locales") + public void test_ChineseTimeZoneNames(Locale testLoc, Locale resourceLoc) { + assertEquals(DateTimeFormatter.ofPattern("z", testLoc).format(EPOCH_UTC), + DateTimeFormatter.ofPattern("z", resourceLoc).format(EPOCH_UTC)); + assertEquals(DateTimeFormatter.ofPattern("zzzz", testLoc).format(EPOCH_UTC), + DateTimeFormatter.ofPattern("zzzz", resourceLoc).format(EPOCH_UTC)); + } +} -- GitLab From 7ea4b19f544cabb70590793ef59d5a8be05deeb1 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 7 Dec 2021 16:47:24 +0000 Subject: [PATCH 651/890] 8278166: java/nio/channels/Channels/TransferTo.java timed out Reviewed-by: lancea, alanb --- .../nio/channels/Channels/TransferTo.java | 148 +++++++++++------- 1 file changed, 95 insertions(+), 53 deletions(-) diff --git a/test/jdk/java/nio/channels/Channels/TransferTo.java b/test/jdk/java/nio/channels/Channels/TransferTo.java index c75b9913e87..e7fa169788c 100644 --- a/test/jdk/java/nio/channels/Channels/TransferTo.java +++ b/test/jdk/java/nio/channels/Channels/TransferTo.java @@ -23,9 +23,10 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import java.io.InputStream; +import java.io.IOException; import java.io.OutputStream; +import java.nio.ByteBuffer; import java.nio.channels.Channels; import java.nio.channels.FileChannel; import java.nio.channels.IllegalBlockingModeException; @@ -51,6 +52,7 @@ import org.testng.annotations.Test; import jdk.test.lib.RandomFactory; import static java.lang.String.format; +import static java.nio.file.StandardOpenOption.*; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertThrows; @@ -62,8 +64,8 @@ import static org.testng.Assert.assertTrue; * @build jdk.test.lib.RandomFactory * @run testng/othervm/timeout=180 TransferTo * @bug 8265891 - * @summary tests whether sun.nio.ChannelInputStream.transferTo conforms to the - * InputStream.transferTo contract defined in the javadoc + * @summary Tests whether sun.nio.ChannelInputStream.transferTo conforms to the + * InputStream.transferTo specification * @key randomness */ public class TransferTo { @@ -72,16 +74,17 @@ public class TransferTo { private static final int ITERATIONS = 10; - private static final int NUM_WRITES = 3 * 1024; - private static final int BYTES_PER_WRITE = 1024 * 1024; - private static final long BYTES_WRITTEN = (long) NUM_WRITES * BYTES_PER_WRITE; + private static final int NUM_WRITES = 3*1024; + private static final int BYTES_PER_WRITE = 1024*1024; + private static final long BYTES_WRITTEN = (long) NUM_WRITES*BYTES_PER_WRITE; private static final Random RND = RandomFactory.getRandom(); private static final Path CWD = Path.of("."); /* - * Provides test scenarios, i. e. combinations of input and output streams to be tested. + * Provides test scenarios, i.e., combinations of input and output streams + * to be tested. */ @DataProvider public static Object[][] streamCombinations() throws Exception { @@ -89,10 +92,12 @@ public class TransferTo { // tests FileChannel.transferTo(FileChannel) optimized case { fileChannelInput(), fileChannelOutput() }, - // tests FileChannel.transferTo(SelectableChannelOutput) optimized case + // tests FileChannel.transferTo(SelectableChannelOutput) + // optimized case { fileChannelInput(), selectableChannelOutput() }, - // tests FileChannel.transferTo(WritableChannelOutput) optimized case + // tests FileChannel.transferTo(WritableChannelOutput) + // optimized case { fileChannelInput(), writableByteChannelOutput() }, // tests InputStream.transferTo(OutputStream) default case @@ -101,7 +106,8 @@ public class TransferTo { } /* - * Testing API compliance: Input stream must throw NullPointerException when parameter "out" is null. + * Testing API compliance: input stream must throw NullPointerException + * when parameter "out" is null. */ @Test(dataProvider = "streamCombinations") public void testNullPointerException(InputStreamProvider inputStreamProvider, @@ -117,7 +123,8 @@ public class TransferTo { } /* - * Testing API compliance: Complete content of input stream must be transferred to output stream. + * Testing API compliance: complete content of input stream must be + * transferred to output stream. */ @Test(dataProvider = "streamCombinations") public void testStreamContents(InputStreamProvider inputStreamProvider, @@ -128,10 +135,12 @@ public class TransferTo { // tests input stream with a length between 1k and 4k checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(1024, 4096)); - // tests input stream with several data chunks, as 16k is more than a single chunk can hold + // tests input stream with several data chunks, as 16k is more than a + // single chunk can hold checkTransferredContents(inputStreamProvider, outputStreamProvider, createRandomBytes(16384, 16384)); - // tests randomly chosen starting positions within source and target stream + // tests randomly chosen starting positions within source and + // target stream for (int i = 0; i < ITERATIONS; i++) { byte[] inBytes = createRandomBytes(MIN_SIZE, MAX_SIZE_INCR); int posIn = RND.nextInt(inBytes.length); @@ -147,34 +156,60 @@ public class TransferTo { } /* - * Special test for file-to-file transfer of more than two GB. - * This test covers multiple iterations of FileChannel.transerTo(FileChannel), - * which ChannelInputStream.transferTo() only applies in this particular case, - * and cannot get tested using a single byte[] due to size limitation of arrays. + * Special test for file-to-file transfer of more than 2 GB. This test + * covers multiple iterations of FileChannel.transerTo(FileChannel), + * which ChannelInputStream.transferTo() only applies in this particular + * case, and cannot get tested using a single byte[] due to size limitation + * of arrays. */ @Test public void testMoreThanTwoGB() throws IOException { - Path sourceFile = Files.createTempFile(CWD, "test2GBSource", null); + // prepare two temporary files to be compared at the end of the test + // set the source file name + String sourceName = String.format("test3GBSource%s.tmp", + String.valueOf(RND.nextInt(Integer.MAX_VALUE))); + Path sourceFile = CWD.resolve(sourceName); + try { - // preparing two temporary files which will be compared at the end of the test - Path targetFile = Files.createTempFile(CWD, "test2GBtarget", null); + // set the target file name + String targetName = String.format("test3GBTarget%s.tmp", + String.valueOf(RND.nextInt(Integer.MAX_VALUE))); + Path targetFile = CWD.resolve(targetName); + try { - // writing 3 GB of random bytes into source file - for (int i = 0; i < NUM_WRITES; i++) - Files.write(sourceFile, createRandomBytes(BYTES_PER_WRITE, 0), StandardOpenOption.APPEND); + // calculate initial position to be just short of 2GB + final long initPos = 2047*BYTES_PER_WRITE; + + // create the source file with a hint to be sparse + try (FileChannel fc = FileChannel.open(sourceFile, CREATE_NEW, SPARSE, WRITE, APPEND);) { + // set initial position to avoid writing nearly 2GB + fc.position(initPos); + + // fill the remainder of the file with random bytes + int nw = (int)(NUM_WRITES - initPos/BYTES_PER_WRITE); + for (int i = 0; i < nw; i++) { + byte[] rndBytes = createRandomBytes(BYTES_PER_WRITE, 0); + ByteBuffer src = ByteBuffer.wrap(rndBytes); + fc.write(src); + } + } - // performing actual transfer, effectively by multiple invocations of Filechannel.transferTo(FileChannel) - long count; - try (InputStream inputStream = Channels.newInputStream(FileChannel.open(sourceFile)); - OutputStream outputStream = Channels - .newOutputStream(FileChannel.open(targetFile, StandardOpenOption.WRITE))) { - count = inputStream.transferTo(outputStream); + // create the target file with a hint to be sparse + try (FileChannel fc = FileChannel.open(targetFile, CREATE_NEW, WRITE, SPARSE);) { } - // comparing reported transferred bytes, must be 3 GB - assertEquals(count, BYTES_WRITTEN); + // perform actual transfer, effectively by multiple invocations + // of Filechannel.transferTo(FileChannel) + try (InputStream inputStream = Channels.newInputStream(FileChannel.open(sourceFile)); + OutputStream outputStream = Channels.newOutputStream(FileChannel.open(targetFile, WRITE))) { + long count = inputStream.transferTo(outputStream); + + // compare reported transferred bytes, must be 3 GB + // less the value of the initial position + assertEquals(count, BYTES_WRITTEN - initPos); + } - // comparing content of both files, failing in case of any difference + // compare content of both files, failing if different assertEquals(Files.mismatch(sourceFile, targetFile), -1); } finally { @@ -186,28 +221,33 @@ public class TransferTo { } /* - * Special test whether selectable channel based transfer throws blocking mode exception. + * Special test of whether selectable channel based transfer throws blocking + * mode exception. */ @Test public void testIllegalBlockingMode() throws IOException { Pipe pipe = Pipe.open(); try { - // testing arbitrary input (here: empty file) to non-blocking selectable output + // testing arbitrary input (here: empty file) to non-blocking + // selectable output try (FileChannel fc = FileChannel.open(Files.createTempFile(CWD, "testIllegalBlockingMode", null)); - InputStream is = Channels.newInputStream(fc); - SelectableChannel sc = pipe.sink().configureBlocking(false); - OutputStream os = Channels.newOutputStream((WritableByteChannel) sc)) { + InputStream is = Channels.newInputStream(fc); + SelectableChannel sc = pipe.sink().configureBlocking(false); + OutputStream os = Channels.newOutputStream((WritableByteChannel) sc)) { - // IllegalBlockingMode must be thrown when trying to perform a transfer + // IllegalBlockingMode must be thrown when trying to perform + // a transfer assertThrows(IllegalBlockingModeException.class, () -> is.transferTo(os)); } - // testing non-blocking selectable input to arbitrary output (here: byte array) + // testing non-blocking selectable input to arbitrary output + // (here: byte array) try (SelectableChannel sc = pipe.source().configureBlocking(false); - InputStream is = Channels.newInputStream((ReadableByteChannel) sc); - OutputStream os = new ByteArrayOutputStream()) { + InputStream is = Channels.newInputStream((ReadableByteChannel) sc); + OutputStream os = new ByteArrayOutputStream()) { - // IllegalBlockingMode must be thrown when trying to perform a transfer + // IllegalBlockingMode must be thrown when trying to perform + // a transfer assertThrows(IllegalBlockingModeException.class, () -> is.transferTo(os)); } } finally { @@ -217,9 +257,9 @@ public class TransferTo { } /* - * Asserts that the transferred content is correct, i. e. compares the actually transferred bytes - * to the expected assumption. The position of the input and output stream before the transfer is - * the start of stream (BOF). + * Asserts that the transferred content is correct, i.e., compares the bytes + * actually transferred to those expected. The position of the input and + * output streams before the transfer are zero (BOF). */ private static void checkTransferredContents(InputStreamProvider inputStreamProvider, OutputStreamProvider outputStreamProvider, byte[] inBytes) throws Exception { @@ -227,16 +267,16 @@ public class TransferTo { } /* - * Asserts that the transferred content is correct, i. e. compares the actually transferred bytes - * to the expected assumption. The position of the input and output stream before the transfer is - * provided by the caller. + * Asserts that the transferred content is correct, i. e. compares the bytes + * actually transferred to those expected. The positions of the input and + * output streams before the transfer are provided by the caller. */ private static void checkTransferredContents(InputStreamProvider inputStreamProvider, OutputStreamProvider outputStreamProvider, byte[] inBytes, int posIn, int posOut) throws Exception { AtomicReference> recorder = new AtomicReference<>(); try (InputStream in = inputStreamProvider.input(inBytes); - OutputStream out = outputStreamProvider.output(recorder::set)) { - // skip bytes till starting position + OutputStream out = outputStreamProvider.output(recorder::set)) { + // skip bytes until starting position in.skipNBytes(posIn); out.write(new byte[posOut]); @@ -252,7 +292,8 @@ public class TransferTo { } /* - * Creates an array of random size (between min and min + maxRandomAdditive) filled with random bytes + * Creates an array of random size (between min and min + maxRandomAdditive) + * filled with random bytes */ private static byte[] createRandomBytes(int min, int maxRandomAdditive) { byte[] bytes = new byte[min + (maxRandomAdditive == 0 ? 0 : RND.nextInt(maxRandomAdditive))]; @@ -298,7 +339,8 @@ public class TransferTo { } /* - * Creates a provider for an input stream which wraps a readable byte channel but is not a file channel + * Creates a provider for an input stream which wraps a readable byte + * channel but is not a file channel */ private static InputStreamProvider readableByteChannelInput() { return new InputStreamProvider() { @@ -316,7 +358,7 @@ public class TransferTo { return new OutputStreamProvider() { public OutputStream output(Consumer> spy) throws Exception { Path path = Files.createTempFile(CWD, "fileChannelOutput", null); - FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.WRITE); + FileChannel fileChannel = FileChannel.open(path, WRITE); spy.accept(() -> { try { return Files.readAllBytes(path); -- GitLab From 7217cb78789046cfc823b63cacc36f6cf2b825f5 Mon Sep 17 00:00:00 2001 From: Maxim Kartashev Date: Tue, 7 Dec 2021 16:59:34 +0000 Subject: [PATCH 652/890] 8274883: (se) Selector.open throws IAE when the default file system provider is changed to a custom provider Reviewed-by: alanb, michaelm --- .../classes/sun/nio/ch/SocketChannelImpl.java | 4 +- .../classes/sun/nio/ch/UnixDomainSockets.java | 16 +- .../channels/Selector/CustomFileSystem.java | 37 ++++ .../Selector/CustomFileSystemProvider.java | 204 ++++++++++++++++++ 4 files changed, 256 insertions(+), 5 deletions(-) create mode 100644 test/jdk/java/nio/channels/Selector/CustomFileSystem.java create mode 100644 test/jdk/java/nio/channels/Selector/CustomFileSystemProvider.java diff --git a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java index 477fa1afca2..117c14d5711 100644 --- a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java +++ b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java @@ -700,11 +700,11 @@ class SocketChannelImpl private SocketAddress unixBind(SocketAddress local) throws IOException { UnixDomainSockets.checkPermission(); if (local == null) { - return UnixDomainSockets.UNNAMED; + return UnixDomainSockets.unnamed(); } else { Path path = UnixDomainSockets.checkAddress(local).getPath(); if (path.toString().isEmpty()) { - return UnixDomainSockets.UNNAMED; + return UnixDomainSockets.unnamed(); } else { // bind to non-empty path UnixDomainSockets.bind(fd, path); diff --git a/src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java b/src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java index ee7e1d9d51a..251e79c6ecc 100644 --- a/src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java +++ b/src/java.base/share/classes/sun/nio/ch/UnixDomainSockets.java @@ -44,7 +44,9 @@ import sun.nio.fs.AbstractFileSystemProvider; class UnixDomainSockets { private UnixDomainSockets() { } - static final UnixDomainSocketAddress UNNAMED = UnixDomainSocketAddress.of(""); + private static class UnnamedHolder { + static final UnixDomainSocketAddress UNNAMED = UnixDomainSocketAddress.of(""); + } private static final boolean supported; @@ -71,7 +73,7 @@ class UnixDomainSockets { // Security check passed } catch (SecurityException e) { // Return unnamed address only if security check fails - addr = UNNAMED; + addr = unnamed(); } return addr; } @@ -133,7 +135,11 @@ class UnixDomainSockets { throw new BindException("Could not locate temporary directory for sockets"); int rnd = random.nextInt(Integer.MAX_VALUE); try { - Path path = Path.of(dir, "socket_" + rnd); + final Path path = Path.of(dir, "socket_" + rnd); + if (path.getFileSystem().provider() != sun.nio.fs.DefaultFileSystemProvider.instance()) { + throw new UnsupportedOperationException( + "Unix Domain Sockets not supported on non-default file system"); + } return UnixDomainSocketAddress.of(path); } catch (InvalidPathException e) { throw new BindException("Invalid temporary directory"); @@ -160,6 +166,10 @@ class UnixDomainSockets { return n; } + static UnixDomainSocketAddress unnamed() { + return UnnamedHolder.UNNAMED; + } + private static native boolean init(); private static native int socket0() throws IOException; diff --git a/test/jdk/java/nio/channels/Selector/CustomFileSystem.java b/test/jdk/java/nio/channels/Selector/CustomFileSystem.java new file mode 100644 index 00000000000..8113a716910 --- /dev/null +++ b/test/jdk/java/nio/channels/Selector/CustomFileSystem.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. + * 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 Verifies that an attempt to call Selector.open() on a non-default + * file system succeeds. + * @build CustomFileSystem CustomFileSystemProvider + * @run main/othervm -Djava.nio.file.spi.DefaultFileSystemProvider=CustomFileSystemProvider CustomFileSystem + */ + +public class CustomFileSystem { + public static void main(String args[]) throws java.io.IOException { + java.nio.channels.Selector.open(); + } +} diff --git a/test/jdk/java/nio/channels/Selector/CustomFileSystemProvider.java b/test/jdk/java/nio/channels/Selector/CustomFileSystemProvider.java new file mode 100644 index 00000000000..f3e876e08a7 --- /dev/null +++ b/test/jdk/java/nio/channels/Selector/CustomFileSystemProvider.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, JetBrains s.r.o.. All rights reserved. + * 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.IOException; +import java.net.URI; +import java.nio.channels.FileChannel; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.AccessMode; +import java.nio.file.CopyOption; +import java.nio.file.DirectoryStream; +import java.nio.file.FileStore; +import java.nio.file.FileSystem; +import java.nio.file.LinkOption; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.ReadOnlyFileSystemException; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileAttributeView; +import java.nio.file.attribute.UserPrincipalLookupService; +import java.nio.file.spi.FileSystemProvider; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +public class CustomFileSystemProvider extends FileSystemProvider { + + private final FileSystemProvider defaultProvider; + + public CustomFileSystemProvider(FileSystemProvider defaultProvider) { + this.defaultProvider = defaultProvider; + } + + FileSystemProvider defaultProvider() { + return defaultProvider; + } + + @Override + public String getScheme() { + return "file"; + } + + @Override + public FileSystem newFileSystem(URI uri, Map env) throws IOException { + return defaultProvider.newFileSystem(uri, env); + } + + @Override + public FileSystem getFileSystem(URI uri) { + return defaultProvider.getFileSystem(uri); + } + + @Override + public Path getPath(URI uri) { + return defaultProvider.getPath(uri); + } + + @Override + public void setAttribute(Path file, String attribute, Object value, + LinkOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public Map readAttributes(Path file, String attributes, + LinkOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public V getFileAttributeView(Path file, + Class type, + LinkOption... options) + { + throw new RuntimeException("not implemented"); + } + + @Override + public boolean isHidden(Path file) throws IOException { + throw new ReadOnlyFileSystemException(); + } + + @Override + public boolean isSameFile(Path file, Path other) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public void checkAccess(Path file, AccessMode... modes) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void copy(Path source, Path target, CopyOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void move(Path source, Path target, CopyOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void delete(Path file) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public void createSymbolicLink(Path link, Path target, FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void createLink(Path link, Path existing) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public Path readSymbolicLink(Path link) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public void createDirectory(Path dir, FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public DirectoryStream newDirectoryStream(Path dir, + DirectoryStream.Filter filter) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public SeekableByteChannel newByteChannel(Path file, + Set options, + FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public FileChannel newFileChannel(Path file, + Set options, + FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public FileStore getFileStore(Path file) throws IOException { + throw new RuntimeException("not implemented"); + } +} -- GitLab From 5a036ace01ebedd88fb3d9100e3a0c19871677ac Mon Sep 17 00:00:00 2001 From: Zhengyu Gu Date: Tue, 7 Dec 2021 17:42:08 +0000 Subject: [PATCH 653/890] 8277990: NMT: Remove NMT shutdown capability Reviewed-by: stuefe, shade --- src/hotspot/os/posix/perfMemory_posix.cpp | 2 +- src/hotspot/os/windows/perfMemory_windows.cpp | 2 +- src/hotspot/share/gc/z/zPhysicalMemory.cpp | 4 +- src/hotspot/share/prims/whitebox.cpp | 32 ---- src/hotspot/share/runtime/os.cpp | 8 +- .../share/services/mallocSiteTable.cpp | 175 +++++++----------- .../share/services/mallocSiteTable.hpp | 89 ++------- src/hotspot/share/services/mallocTracker.cpp | 27 +-- src/hotspot/share/services/mallocTracker.hpp | 7 - src/hotspot/share/services/memTracker.cpp | 42 +---- src/hotspot/share/services/memTracker.hpp | 40 ++-- src/hotspot/share/services/nmtCommon.cpp | 8 +- src/hotspot/share/services/nmtCommon.hpp | 25 +-- .../share/services/threadStackTracker.cpp | 15 +- .../share/services/threadStackTracker.hpp | 3 +- .../share/services/virtualMemoryTracker.cpp | 17 -- .../share/services/virtualMemoryTracker.hpp | 4 +- .../runtime/NMT/ChangeTrackingLevel.java | 49 ----- test/lib/jdk/test/whitebox/WhiteBox.java | 1 - test/lib/sun/hotspot/WhiteBox.java | 1 - 20 files changed, 118 insertions(+), 433 deletions(-) delete mode 100644 test/hotspot/jtreg/runtime/NMT/ChangeTrackingLevel.java diff --git a/src/hotspot/os/posix/perfMemory_posix.cpp b/src/hotspot/os/posix/perfMemory_posix.cpp index a89947f32ed..5d0448246bf 100644 --- a/src/hotspot/os/posix/perfMemory_posix.cpp +++ b/src/hotspot/os/posix/perfMemory_posix.cpp @@ -1028,7 +1028,7 @@ static char* mmap_create_shared(size_t size) { // static void unmap_shared(char* addr, size_t bytes) { int res; - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { // Note: Tracker contains a ThreadCritical. Tracker tkr(Tracker::release); res = ::munmap(addr, bytes); diff --git a/src/hotspot/os/windows/perfMemory_windows.cpp b/src/hotspot/os/windows/perfMemory_windows.cpp index 600eb8882f9..0a53a94957c 100644 --- a/src/hotspot/os/windows/perfMemory_windows.cpp +++ b/src/hotspot/os/windows/perfMemory_windows.cpp @@ -1834,7 +1834,7 @@ void PerfMemory::detach(char* addr, size_t bytes) { return; } - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { // it does not go through os api, the operation has to record from here Tracker tkr(Tracker::release); remove_file_mapping(addr); diff --git a/src/hotspot/share/gc/z/zPhysicalMemory.cpp b/src/hotspot/share/gc/z/zPhysicalMemory.cpp index abdf7df69b0..eb889f4e4f2 100644 --- a/src/hotspot/share/gc/z/zPhysicalMemory.cpp +++ b/src/hotspot/share/gc/z/zPhysicalMemory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -282,7 +282,7 @@ void ZPhysicalMemoryManager::nmt_commit(uintptr_t offset, size_t size) const { } void ZPhysicalMemoryManager::nmt_uncommit(uintptr_t offset, size_t size) const { - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { const uintptr_t addr = ZAddress::marked0(offset); Tracker tracker(Tracker::uncommit); tracker.record((address)addr, size); diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 4411ddc802d..03bda0315a1 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -703,37 +703,6 @@ WB_ENTRY(void, WB_NMTReleaseMemory(JNIEnv* env, jobject o, jlong addr, jlong siz os::release_memory((char *)(uintptr_t)addr, size); WB_END -WB_ENTRY(jboolean, WB_NMTChangeTrackingLevel(JNIEnv* env)) - // Test that we can downgrade NMT levels but not upgrade them. - if (MemTracker::tracking_level() == NMT_off) { - MemTracker::transition_to(NMT_off); - return MemTracker::tracking_level() == NMT_off; - } else { - assert(MemTracker::tracking_level() == NMT_detail, "Should start out as detail tracking"); - MemTracker::transition_to(NMT_summary); - assert(MemTracker::tracking_level() == NMT_summary, "Should be summary now"); - - // Can't go to detail once NMT is set to summary. - MemTracker::transition_to(NMT_detail); - assert(MemTracker::tracking_level() == NMT_summary, "Should still be summary now"); - - // Shutdown sets tracking level to minimal. - MemTracker::shutdown(); - assert(MemTracker::tracking_level() == NMT_minimal, "Should be minimal now"); - - // Once the tracking level is minimal, we cannot increase to summary. - // The code ignores this request instead of asserting because if the malloc site - // table overflows in another thread, it tries to change the code to summary. - MemTracker::transition_to(NMT_summary); - assert(MemTracker::tracking_level() == NMT_minimal, "Should still be minimal now"); - - // Really can never go up to detail, verify that the code would never do this. - MemTracker::transition_to(NMT_detail); - assert(MemTracker::tracking_level() == NMT_minimal, "Should still be minimal now"); - return MemTracker::tracking_level() == NMT_minimal; - } -WB_END - WB_ENTRY(jint, WB_NMTGetHashSize(JNIEnv* env, jobject o)) int hash_size = MallocSiteTable::hash_buckets(); assert(hash_size > 0, "NMT hash_size should be > 0"); @@ -2567,7 +2536,6 @@ static JNINativeMethod methods[] = { {CC"NMTCommitMemory", CC"(JJ)V", (void*)&WB_NMTCommitMemory }, {CC"NMTUncommitMemory", CC"(JJ)V", (void*)&WB_NMTUncommitMemory }, {CC"NMTReleaseMemory", CC"(JJ)V", (void*)&WB_NMTReleaseMemory }, - {CC"NMTChangeTrackingLevel", CC"()Z", (void*)&WB_NMTChangeTrackingLevel}, {CC"NMTGetHashSize", CC"()I", (void*)&WB_NMTGetHashSize }, {CC"NMTNewArena", CC"(J)J", (void*)&WB_NMTNewArena }, {CC"NMTFreeArena", CC"(J)V", (void*)&WB_NMTFreeArena }, diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 65695f7d1ce..8263480c11d 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -1786,7 +1786,7 @@ void os::commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint, bool os::uncommit_memory(char* addr, size_t bytes, bool executable) { bool res; - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { Tracker tkr(Tracker::uncommit); res = pd_uncommit_memory(addr, bytes, executable); if (res) { @@ -1800,7 +1800,7 @@ bool os::uncommit_memory(char* addr, size_t bytes, bool executable) { bool os::release_memory(char* addr, size_t bytes) { bool res; - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { // Note: Tracker contains a ThreadCritical. Tracker tkr(Tracker::release); res = pd_release_memory(addr, bytes); @@ -1869,7 +1869,7 @@ char* os::remap_memory(int fd, const char* file_name, size_t file_offset, bool os::unmap_memory(char *addr, size_t bytes) { bool result; - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { Tracker tkr(Tracker::release); result = pd_unmap_memory(addr, bytes); if (result) { @@ -1905,7 +1905,7 @@ char* os::reserve_memory_special(size_t size, size_t alignment, size_t page_size bool os::release_memory_special(char* addr, size_t bytes) { bool res; - if (MemTracker::tracking_level() > NMT_minimal) { + if (MemTracker::enabled()) { // Note: Tracker contains a ThreadCritical. Tracker tkr(Tracker::release); res = pd_release_memory_special(addr, bytes); diff --git a/src/hotspot/share/services/mallocSiteTable.cpp b/src/hotspot/share/services/mallocSiteTable.cpp index dae1357cef1..2670c138daa 100644 --- a/src/hotspot/share/services/mallocSiteTable.cpp +++ b/src/hotspot/share/services/mallocSiteTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -33,12 +33,6 @@ MallocSiteHashtableEntry* MallocSiteTable::_table[MallocSiteTable::table_size]; const NativeCallStack* MallocSiteTable::_hash_entry_allocation_stack = NULL; const MallocSiteHashtableEntry* MallocSiteTable::_hash_entry_allocation_site = NULL; -// concurrent access counter -volatile int MallocSiteTable::_access_count = 0; - -// Tracking hashtable contention -NOT_PRODUCT(int MallocSiteTable::_peak_count = 0;) - /* * Initialize malloc site table. * Hashtable entry is malloc'd, so it can cause infinite recursion. @@ -202,122 +196,81 @@ void MallocSiteTable::delete_linked_list(MallocSiteHashtableEntry* head) { } } -void MallocSiteTable::shutdown() { - AccessLock locker(&_access_count); - locker.exclusiveLock(); - reset(); -} - bool MallocSiteTable::walk_malloc_site(MallocSiteWalker* walker) { assert(walker != NULL, "NuLL walker"); - AccessLock locker(&_access_count); - if (locker.sharedLock()) { - NOT_PRODUCT(_peak_count = MAX2(_peak_count, _access_count);) - return walk(walker); - } - return false; -} - - -void MallocSiteTable::AccessLock::exclusiveLock() { - int target; - int val; - - assert(_lock_state != ExclusiveLock, "Can only call once"); - assert(*_lock >= 0, "Can not content exclusive lock"); - - // make counter negative to block out shared locks - do { - val = *_lock; - target = _MAGIC_ + *_lock; - } while (Atomic::cmpxchg(_lock, val, target) != val); - - // wait for all readers to exit - while (*_lock != _MAGIC_) { -#ifdef _WINDOWS - os::naked_short_sleep(1); -#else - os::naked_yield(); -#endif - } - _lock_state = ExclusiveLock; + return walk(walker); } void MallocSiteTable::print_tuning_statistics(outputStream* st) { - - AccessLock locker(&_access_count); - if (locker.sharedLock()) { - // Total number of allocation sites, include empty sites - int total_entries = 0; - // Number of allocation sites that have all memory freed - int empty_entries = 0; - // Number of captured call stack distribution - int stack_depth_distribution[NMT_TrackingStackDepth + 1] = { 0 }; - // Chain lengths - int lengths[table_size] = { 0 }; - - for (int i = 0; i < table_size; i ++) { - int this_chain_length = 0; - const MallocSiteHashtableEntry* head = _table[i]; - while (head != NULL) { - total_entries ++; - this_chain_length ++; - if (head->size() == 0) { - empty_entries ++; - } - const int callstack_depth = head->peek()->call_stack()->frames(); - assert(callstack_depth >= 0 && callstack_depth <= NMT_TrackingStackDepth, - "Sanity (%d)", callstack_depth); - stack_depth_distribution[callstack_depth] ++; - head = head->next(); - } - lengths[i] = this_chain_length; - } - - st->print_cr("Malloc allocation site table:"); - st->print_cr("\tTotal entries: %d", total_entries); - st->print_cr("\tEmpty entries: %d (%2.2f%%)", empty_entries, ((float)empty_entries * 100) / total_entries); - st->cr(); - - // We report the hash distribution (chain length distribution) of the n shortest chains - // - under the assumption that this usually contains all lengths. Reporting threshold - // is 20, and the expected avg chain length is 5..6 (see table size). - static const int chain_length_threshold = 20; - int chain_length_distribution[chain_length_threshold] = { 0 }; - int over_threshold = 0; - int longest_chain_length = 0; - for (int i = 0; i < table_size; i ++) { - if (lengths[i] >= chain_length_threshold) { - over_threshold ++; - } else { - chain_length_distribution[lengths[i]] ++; + // Total number of allocation sites, include empty sites + int total_entries = 0; + // Number of allocation sites that have all memory freed + int empty_entries = 0; + // Number of captured call stack distribution + int stack_depth_distribution[NMT_TrackingStackDepth + 1] = { 0 }; + // Chain lengths + int lengths[table_size] = { 0 }; + + for (int i = 0; i < table_size; i ++) { + int this_chain_length = 0; + const MallocSiteHashtableEntry* head = _table[i]; + while (head != NULL) { + total_entries ++; + this_chain_length ++; + if (head->size() == 0) { + empty_entries ++; } - longest_chain_length = MAX2(longest_chain_length, lengths[i]); + const int callstack_depth = head->peek()->call_stack()->frames(); + assert(callstack_depth >= 0 && callstack_depth <= NMT_TrackingStackDepth, + "Sanity (%d)", callstack_depth); + stack_depth_distribution[callstack_depth] ++; + head = head->next(); } + lengths[i] = this_chain_length; + } - st->print_cr("Hash distribution:"); - if (chain_length_distribution[0] == 0) { - st->print_cr("no empty buckets."); + st->print_cr("Malloc allocation site table:"); + st->print_cr("\tTotal entries: %d", total_entries); + st->print_cr("\tEmpty entries: %d (%2.2f%%)", empty_entries, ((float)empty_entries * 100) / total_entries); + st->cr(); + + // We report the hash distribution (chain length distribution) of the n shortest chains + // - under the assumption that this usually contains all lengths. Reporting threshold + // is 20, and the expected avg chain length is 5..6 (see table size). + static const int chain_length_threshold = 20; + int chain_length_distribution[chain_length_threshold] = { 0 }; + int over_threshold = 0; + int longest_chain_length = 0; + for (int i = 0; i < table_size; i ++) { + if (lengths[i] >= chain_length_threshold) { + over_threshold ++; } else { - st->print_cr("%d buckets are empty.", chain_length_distribution[0]); - } - for (int len = 1; len < MIN2(longest_chain_length + 1, chain_length_threshold); len ++) { - st->print_cr("%2d %s: %d.", len, (len == 1 ? " entry" : "entries"), chain_length_distribution[len]); + chain_length_distribution[lengths[i]] ++; } - if (longest_chain_length >= chain_length_threshold) { - st->print_cr(">=%2d entries: %d.", chain_length_threshold, over_threshold); - } - st->print_cr("most entries: %d.", longest_chain_length); - st->cr(); + longest_chain_length = MAX2(longest_chain_length, lengths[i]); + } - st->print_cr("Call stack depth distribution:"); - for (int i = 0; i <= NMT_TrackingStackDepth; i ++) { - st->print_cr("\t%d: %d", i, stack_depth_distribution[i]); - } - st->cr(); - } // lock -} + st->print_cr("Hash distribution:"); + if (chain_length_distribution[0] == 0) { + st->print_cr("no empty buckets."); + } else { + st->print_cr("%d buckets are empty.", chain_length_distribution[0]); + } + for (int len = 1; len < MIN2(longest_chain_length + 1, chain_length_threshold); len ++) { + st->print_cr("%2d %s: %d.", len, (len == 1 ? " entry" : "entries"), chain_length_distribution[len]); + } + if (longest_chain_length >= chain_length_threshold) { + st->print_cr(">=%2d entries: %d.", chain_length_threshold, over_threshold); + } + st->print_cr("most entries: %d.", longest_chain_length); + st->cr(); + st->print_cr("Call stack depth distribution:"); + for (int i = 0; i <= NMT_TrackingStackDepth; i ++) { + st->print_cr("\t%d: %d", i, stack_depth_distribution[i]); + } + st->cr(); +} bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) { return Atomic::replace_if_null(&_next, entry); diff --git a/src/hotspot/share/services/mallocSiteTable.hpp b/src/hotspot/share/services/mallocSiteTable.hpp index 8aa25310326..6e026f9704c 100644 --- a/src/hotspot/share/services/mallocSiteTable.hpp +++ b/src/hotspot/share/services/mallocSiteTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -118,54 +118,8 @@ class MallocSiteTable : AllStatic { // in the malloc header can hold. STATIC_ASSERT(table_size <= MAX_MALLOCSITE_TABLE_SIZE); - // This is a very special lock, that allows multiple shared accesses (sharedLock), but - // once exclusive access (exclusiveLock) is requested, all shared accesses are - // rejected forever. - class AccessLock : public StackObj { - enum LockState { - NoLock, - SharedLock, - ExclusiveLock - }; - - private: - // A very large negative number. The only possibility to "overflow" - // this number is when there are more than -min_jint threads in - // this process, which is not going to happen in foreseeable future. - const static int _MAGIC_ = min_jint; - - LockState _lock_state; - volatile int* _lock; - public: - AccessLock(volatile int* lock) : - _lock_state(NoLock), _lock(lock) { - } - - ~AccessLock() { - if (_lock_state == SharedLock) { - Atomic::dec(_lock); - } - } - // Acquire shared lock. - // Return true if shared access is granted. - inline bool sharedLock() { - jint res = Atomic::add(_lock, 1); - if (res < 0) { - Atomic::dec(_lock); - return false; - } - _lock_state = SharedLock; - return true; - } - // Acquire exclusive lock - void exclusiveLock(); - }; - public: static bool initialize(); - static void shutdown(); - - NOT_PRODUCT(static int access_peak_count() { return _peak_count; }) // Number of hash buckets static inline int hash_buckets() { return (int)table_size; } @@ -174,14 +128,10 @@ class MallocSiteTable : AllStatic { // acquired before access the entry. static inline bool access_stack(NativeCallStack& stack, size_t bucket_idx, size_t pos_idx) { - AccessLock locker(&_access_count); - if (locker.sharedLock()) { - NOT_PRODUCT(_peak_count = MAX2(_peak_count, _access_count);) - MallocSite* site = malloc_site(bucket_idx, pos_idx); - if (site != NULL) { - stack = *site->call_stack(); - return true; - } + MallocSite* site = malloc_site(bucket_idx, pos_idx); + if (site != NULL) { + stack = *site->call_stack(); + return true; } return false; } @@ -195,27 +145,18 @@ class MallocSiteTable : AllStatic { // 2. overflow hash bucket static inline bool allocation_at(const NativeCallStack& stack, size_t size, size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) { - AccessLock locker(&_access_count); - if (locker.sharedLock()) { - NOT_PRODUCT(_peak_count = MAX2(_peak_count, _access_count);) - MallocSite* site = lookup_or_add(stack, bucket_idx, pos_idx, flags); - if (site != NULL) site->allocate(size); - return site != NULL; - } - return false; + MallocSite* site = lookup_or_add(stack, bucket_idx, pos_idx, flags); + if (site != NULL) site->allocate(size); + return site != NULL; } // Record memory deallocation. bucket_idx and pos_idx indicate where the allocation // information was recorded. static inline bool deallocation_at(size_t size, size_t bucket_idx, size_t pos_idx) { - AccessLock locker(&_access_count); - if (locker.sharedLock()) { - NOT_PRODUCT(_peak_count = MAX2(_peak_count, _access_count);) - MallocSite* site = malloc_site(bucket_idx, pos_idx); - if (site != NULL) { - site->deallocate(size); - return true; - } + MallocSite* site = malloc_site(bucket_idx, pos_idx); + if (site != NULL) { + site->deallocate(size); + return true; } return false; } @@ -251,17 +192,11 @@ class MallocSiteTable : AllStatic { } private: - // Counter for counting concurrent access - static volatile int _access_count; - // The callsite hashtable. It has to be a static table, // since malloc call can come from C runtime linker. static MallocSiteHashtableEntry* _table[table_size]; static const NativeCallStack* _hash_entry_allocation_stack; static const MallocSiteHashtableEntry* _hash_entry_allocation_site; - - - NOT_PRODUCT(static int _peak_count;) }; #endif // INCLUDE_NMT diff --git a/src/hotspot/share/services/mallocTracker.cpp b/src/hotspot/share/services/mallocTracker.cpp index be1d6eea330..285a60d853f 100644 --- a/src/hotspot/share/services/mallocTracker.cpp +++ b/src/hotspot/share/services/mallocTracker.cpp @@ -113,8 +113,7 @@ void MallocHeader::mark_block_as_dead() { } void MallocHeader::release() { - // Tracking already shutdown, no housekeeping is needed anymore - if (MemTracker::tracking_level() <= NMT_minimal) return; + assert(MemTracker::enabled(), "Sanity"); check_block_integrity(); @@ -222,15 +221,7 @@ void MallocHeader::check_block_integrity() const { bool MallocHeader::record_malloc_site(const NativeCallStack& stack, size_t size, size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const { - bool ret = MallocSiteTable::allocation_at(stack, size, bucket_idx, pos_idx, flags); - - // Something went wrong, could be OOM or overflow malloc site table. - // We want to keep tracking data under OOM circumstance, so transition to - // summary tracking. - if (!ret) { - MemTracker::transition_to(NMT_summary); - } - return ret; + return MallocSiteTable::allocation_at(stack, size, bucket_idx, pos_idx, flags); } bool MallocHeader::get_stack(NativeCallStack& stack) const { @@ -248,18 +239,6 @@ bool MallocTracker::initialize(NMT_TrackingLevel level) { return true; } -bool MallocTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) { - assert(from != NMT_off, "Can not transition from off state"); - assert(to != NMT_off, "Can not transition to off state"); - assert (from != NMT_minimal, "cannot transition from minimal state"); - - if (from == NMT_detail) { - assert(to == NMT_minimal || to == NMT_summary, "Just check"); - MallocSiteTable::shutdown(); - } - return true; -} - // Record a malloc memory allocation void* MallocTracker::record_malloc(void* malloc_base, size_t size, MEMFLAGS flags, const NativeCallStack& stack, NMT_TrackingLevel level) { @@ -281,7 +260,7 @@ void* MallocTracker::record_malloc(void* malloc_base, size_t size, MEMFLAGS flag assert(((size_t)memblock & (sizeof(size_t) * 2 - 1)) == 0, "Alignment check"); #ifdef ASSERT - if (level > NMT_minimal) { + if (level > NMT_off) { // Read back assert(get_size(memblock) == size, "Wrong size"); assert(get_flags(memblock) == flags, "Wrong flags"); diff --git a/src/hotspot/share/services/mallocTracker.hpp b/src/hotspot/share/services/mallocTracker.hpp index 9fd3968831b..6490b3d53ff 100644 --- a/src/hotspot/share/services/mallocTracker.hpp +++ b/src/hotspot/share/services/mallocTracker.hpp @@ -330,13 +330,8 @@ class MallocHeader { public: MallocHeader(size_t size, MEMFLAGS flags, const NativeCallStack& stack, NMT_TrackingLevel level) { - assert(size < max_reasonable_malloc_size, "Too large allocation size?"); - if (level == NMT_minimal) { - return; - } - _flags = NMTUtil::flag_to_index(flags); set_size(size); if (level == NMT_detail) { @@ -386,8 +381,6 @@ class MallocTracker : AllStatic { // Initialize malloc tracker for specific tracking level static bool initialize(NMT_TrackingLevel level); - static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to); - // malloc tracking header size for specific tracking level static inline size_t malloc_header_size(NMT_TrackingLevel level) { return (level == NMT_off) ? 0 : sizeof(MallocHeader); diff --git a/src/hotspot/share/services/memTracker.cpp b/src/hotspot/share/services/memTracker.cpp index a28d3badbcf..1037ec27418 100644 --- a/src/hotspot/share/services/memTracker.cpp +++ b/src/hotspot/share/services/memTracker.cpp @@ -108,41 +108,9 @@ void Tracker::record(address addr, size_t size) { } } - -// Shutdown can only be issued via JCmd, and NMT JCmd is serialized by lock -void MemTracker::shutdown() { - // We can only shutdown NMT to minimal tracking level if it is ever on. - if (tracking_level() > NMT_minimal) { - transition_to(NMT_minimal); - } -} - -bool MemTracker::transition_to(NMT_TrackingLevel level) { - NMT_TrackingLevel current_level = tracking_level(); - - assert(level != NMT_off || current_level == NMT_off, "Cannot transition NMT to off"); - - if (current_level == level) { - return true; - } else if (current_level > level) { - // Downgrade tracking level, we want to lower the tracking level first - _tracking_level = level; - // Make _tracking_level visible immediately. - OrderAccess::fence(); - VirtualMemoryTracker::transition(current_level, level); - MallocTracker::transition(current_level, level); - ThreadStackTracker::transition(current_level, level); - } else { - // Upgrading tracking level is not supported and has never been supported. - // Allocating and deallocating malloc tracking structures is not thread safe and - // leads to inconsistencies unless a lot coarser locks are added. - } - return true; -} - // Report during error reporting. void MemTracker::error_report(outputStream* output) { - if (tracking_level() >= NMT_summary) { + if (enabled()) { report(true, output, MemReporterBase::default_scale); // just print summary for error case. output->print("Preinit state:"); NMTPreInit::print_state(output); @@ -157,11 +125,8 @@ void MemTracker::final_report(outputStream* output) { // printing the final report during normal VM exit, it should not print // the final report again. In addition, it should be guarded from // recursive calls in case NMT reporting itself crashes. - if (Atomic::cmpxchg(&g_final_report_did_run, false, true) == false) { - NMT_TrackingLevel level = tracking_level(); - if (level >= NMT_summary) { - report(level == NMT_summary, output, 1); - } + if (enabled() && Atomic::cmpxchg(&g_final_report_did_run, false, true) == false) { + report(tracking_level() == NMT_summary, output, 1); } } @@ -189,7 +154,6 @@ void MemTracker::tuning_statistics(outputStream* out) { out->print_cr("State: %s", NMTUtil::tracking_level_to_string(_tracking_level)); out->print_cr("Malloc allocation site table size: %d", MallocSiteTable::hash_buckets()); out->print_cr(" Tracking stack depth: %d", NMT_TrackingStackDepth); - NOT_PRODUCT(out->print_cr("Peak concurrent access: %d", MallocSiteTable::access_peak_count());) out->cr(); MallocSiteTable::print_tuning_statistics(out); out->cr(); diff --git a/src/hotspot/share/services/memTracker.hpp b/src/hotspot/share/services/memTracker.hpp index 21d1aa82630..1c81c3f7928 100644 --- a/src/hotspot/share/services/memTracker.hpp +++ b/src/hotspot/share/services/memTracker.hpp @@ -49,7 +49,7 @@ class Tracker : public StackObj { class MemTracker : AllStatic { public: static inline NMT_TrackingLevel tracking_level() { return NMT_off; } - static inline void shutdown() { } + static inline bool enabled() { return false; } static inline void init() { } static bool check_launcher_nmt_support(const char* value) { return true; } static bool verify_nmt_option() { return true; } @@ -137,14 +137,9 @@ class MemTracker : AllStatic { return _tracking_level; } - // Shutdown native memory tracking. - // This transitions the tracking level: - // summary -> minimal - // detail -> minimal - static void shutdown(); - - // Transition the tracking level to specified level - static bool transition_to(NMT_TrackingLevel level); + static inline bool enabled() { + return _tracking_level > NMT_off; + } static inline void* record_malloc(void* mem_base, size_t size, MEMFLAGS flag, const NativeCallStack& stack, NMT_TrackingLevel level) { @@ -180,20 +175,20 @@ class MemTracker : AllStatic { // Record creation of an arena static inline void record_new_arena(MEMFLAGS flag) { - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; MallocTracker::record_new_arena(flag); } // Record destruction of an arena static inline void record_arena_free(MEMFLAGS flag) { - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; MallocTracker::record_arena_free(flag); } // Record arena size change. Arena size is the size of all arena // chuncks that backing up the arena. static inline void record_arena_size_change(ssize_t diff, MEMFLAGS flag) { - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; MallocTracker::record_arena_size_change(diff, flag); } @@ -203,11 +198,9 @@ class MemTracker : AllStatic { static inline void record_virtual_memory_reserve(void* addr, size_t size, const NativeCallStack& stack, MEMFLAGS flag = mtNone) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadCritical tc; - // Recheck to avoid potential racing during NMT shutdown - if (tracking_level() < NMT_summary) return; VirtualMemoryTracker::add_reserved_region((address)addr, size, stack, flag); } } @@ -215,10 +208,9 @@ class MemTracker : AllStatic { static inline void record_virtual_memory_reserve_and_commit(void* addr, size_t size, const NativeCallStack& stack, MEMFLAGS flag = mtNone) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadCritical tc; - if (tracking_level() < NMT_summary) return; VirtualMemoryTracker::add_reserved_region((address)addr, size, stack, flag); VirtualMemoryTracker::add_committed_region((address)addr, size, stack); } @@ -227,10 +219,9 @@ class MemTracker : AllStatic { static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadCritical tc; - if (tracking_level() < NMT_summary) return; VirtualMemoryTracker::add_committed_region((address)addr, size, stack); } } @@ -243,28 +234,25 @@ class MemTracker : AllStatic { // memory flags of the original region. static inline void record_virtual_memory_split_reserved(void* addr, size_t size, size_t split) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadCritical tc; - // Recheck to avoid potential racing during NMT shutdown - if (tracking_level() < NMT_summary) return; VirtualMemoryTracker::split_reserved_region((address)addr, size, split); } } static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadCritical tc; - if (tracking_level() < NMT_summary) return; VirtualMemoryTracker::set_reserved_region_type((address)addr, flag); } } static void record_thread_stack(void* addr, size_t size) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadStackTracker::new_thread_stack((address)addr, size, CALLER_PC); } @@ -272,7 +260,7 @@ class MemTracker : AllStatic { static inline void release_thread_stack(void* addr, size_t size) { assert_post_init(); - if (tracking_level() < NMT_summary) return; + if (!enabled()) return; if (addr != NULL) { ThreadStackTracker::delete_thread_stack((address)addr, size); } diff --git a/src/hotspot/share/services/nmtCommon.cpp b/src/hotspot/share/services/nmtCommon.cpp index 0137a880d8c..2494336595b 100644 --- a/src/hotspot/share/services/nmtCommon.cpp +++ b/src/hotspot/share/services/nmtCommon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -28,11 +28,14 @@ #define MEMORY_TYPE_DECLARE_NAME(type, human_readable) \ human_readable, +STATIC_ASSERT(NMT_off > NMT_unknown); +STATIC_ASSERT(NMT_summary > NMT_off); +STATIC_ASSERT(NMT_detail > NMT_summary); + const char* NMTUtil::_memory_type_names[] = { MEMORY_TYPES_DO(MEMORY_TYPE_DECLARE_NAME) }; - const char* NMTUtil::scale_name(size_t scale) { switch(scale) { case 1: return ""; @@ -64,7 +67,6 @@ const char* NMTUtil::tracking_level_to_string(NMT_TrackingLevel lvl) { switch(lvl) { case NMT_unknown: return "unknown"; break; case NMT_off: return "off"; break; - case NMT_minimal: return "minimal"; break; case NMT_summary: return "summary"; break; case NMT_detail: return "detail"; break; default: return "invalid"; break; diff --git a/src/hotspot/share/services/nmtCommon.hpp b/src/hotspot/share/services/nmtCommon.hpp index 10876976091..b573fb6b7df 100644 --- a/src/hotspot/share/services/nmtCommon.hpp +++ b/src/hotspot/share/services/nmtCommon.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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,10 +41,6 @@ // - nothing is tracked // - no malloc headers are used // -// "minimal": after shutdown - NMT had been on at some point but has been switched off -// - nothing is tracked -// - malloc headers are allocated but not initialized not used -// // "summary": after initialization with NativeMemoryTracking=summary - NMT in summary mode // - category summaries per tag are tracked // - thread stacks are tracked @@ -59,25 +55,16 @@ // - malloc headers are used // - malloc call site table is allocated and used // -// Valid state transitions: -// -// unknown ----> off -// | -// |--> summary -- -// | | -// |--> detail --+--> minimal -// // Please keep relation of numerical values! -// unknown < off < minimal < summary < detail +// unknown < off < summary < detail // enum NMT_TrackingLevel { - NMT_unknown = 0, - NMT_off = 1, - NMT_minimal = 2, - NMT_summary = 3, - NMT_detail = 4 + NMT_unknown, + NMT_off, + NMT_summary, + NMT_detail }; // Number of stack frames to capture. This is a diff --git a/src/hotspot/share/services/threadStackTracker.cpp b/src/hotspot/share/services/threadStackTracker.cpp index b426e81613b..5caad66bb89 100644 --- a/src/hotspot/share/services/threadStackTracker.cpp +++ b/src/hotspot/share/services/threadStackTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -42,19 +42,6 @@ bool ThreadStackTracker::initialize(NMT_TrackingLevel level) { return true; } -bool ThreadStackTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) { - assert (from != NMT_minimal, "cannot convert from the lowest tracking level to anything"); - if (to == NMT_minimal) { - assert(from == NMT_summary || from == NMT_detail, "Just check"); - ThreadCritical tc; - if (_simple_thread_stacks != NULL) { - delete _simple_thread_stacks; - _simple_thread_stacks = NULL; - } - } - return true; -} - int ThreadStackTracker::compare_thread_stack_base(const SimpleThreadStackSite& s1, const SimpleThreadStackSite& s2) { return s1.base() - s2.base(); } diff --git a/src/hotspot/share/services/threadStackTracker.hpp b/src/hotspot/share/services/threadStackTracker.hpp index 3eee93cd71c..74e2311b763 100644 --- a/src/hotspot/share/services/threadStackTracker.hpp +++ b/src/hotspot/share/services/threadStackTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -72,7 +72,6 @@ private: static SortedLinkedList* _simple_thread_stacks; public: static bool initialize(NMT_TrackingLevel level); - static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to); static void new_thread_stack(void* base, size_t size, const NativeCallStack& stack); static void delete_thread_stack(void* base, size_t size); diff --git a/src/hotspot/share/services/virtualMemoryTracker.cpp b/src/hotspot/share/services/virtualMemoryTracker.cpp index f9909f9e569..77fb24927f5 100644 --- a/src/hotspot/share/services/virtualMemoryTracker.cpp +++ b/src/hotspot/share/services/virtualMemoryTracker.cpp @@ -671,20 +671,3 @@ bool VirtualMemoryTracker::walk_virtual_memory(VirtualMemoryWalker* walker) { } return true; } - -// Transition virtual memory tracking level. -bool VirtualMemoryTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) { - assert (from != NMT_minimal, "cannot convert from the lowest tracking level to anything"); - if (to == NMT_minimal) { - assert(from == NMT_summary || from == NMT_detail, "Just check"); - // Clean up virtual memory tracking data structures. - ThreadCritical tc; - // Check for potential race with other thread calling transition - if (_reserved_regions != NULL) { - delete _reserved_regions; - _reserved_regions = NULL; - } - } - - return true; -} diff --git a/src/hotspot/share/services/virtualMemoryTracker.hpp b/src/hotspot/share/services/virtualMemoryTracker.hpp index a7948f67447..c96af6b8387 100644 --- a/src/hotspot/share/services/virtualMemoryTracker.hpp +++ b/src/hotspot/share/services/virtualMemoryTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -387,8 +387,6 @@ class VirtualMemoryTracker : AllStatic { // Walk virtual memory data structure for creating baseline, etc. static bool walk_virtual_memory(VirtualMemoryWalker* walker); - static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to); - // Snapshot current thread stacks static void snapshot_thread_stacks(); diff --git a/test/hotspot/jtreg/runtime/NMT/ChangeTrackingLevel.java b/test/hotspot/jtreg/runtime/NMT/ChangeTrackingLevel.java deleted file mode 100644 index 0cc059c13b9..00000000000 --- a/test/hotspot/jtreg/runtime/NMT/ChangeTrackingLevel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2013, 2021, 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 8059100 - * @summary Test that you can decrease NMT tracking level but not increase it. - * @modules java.base/jdk.internal.misc - * @library /test/lib - * @build sun.hotspot.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ChangeTrackingLevel - */ - -import sun.hotspot.WhiteBox; - -public class ChangeTrackingLevel { - - public static WhiteBox wb = WhiteBox.getWhiteBox(); - public static void main(String args[]) throws Exception { - boolean testChangeLevel = wb.NMTChangeTrackingLevel(); - if (testChangeLevel) { - System.out.println("NMT level change test passed."); - } else { - // it also fails if the VM asserts. - throw new RuntimeException("NMT level change test failed"); - } - } -}; diff --git a/test/lib/jdk/test/whitebox/WhiteBox.java b/test/lib/jdk/test/whitebox/WhiteBox.java index c4f90b975a4..e1e137f3b89 100644 --- a/test/lib/jdk/test/whitebox/WhiteBox.java +++ b/test/lib/jdk/test/whitebox/WhiteBox.java @@ -225,7 +225,6 @@ public class WhiteBox { public native void NMTReleaseMemory(long addr, long size); public native long NMTMallocWithPseudoStack(long size, int index); public native long NMTMallocWithPseudoStackAndType(long size, int index, int type); - public native boolean NMTChangeTrackingLevel(); public native int NMTGetHashSize(); public native long NMTNewArena(long initSize); public native void NMTFreeArena(long arena); diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index 4536e608093..1729545b0bb 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -226,7 +226,6 @@ public class WhiteBox { public native void NMTReleaseMemory(long addr, long size); public native long NMTMallocWithPseudoStack(long size, int index); public native long NMTMallocWithPseudoStackAndType(long size, int index, int type); - public native boolean NMTChangeTrackingLevel(); public native int NMTGetHashSize(); public native long NMTNewArena(long initSize); public native void NMTFreeArena(long arena); -- GitLab From 3955b037da8a0981d8efc67f28caaacdef7dfb31 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 7 Dec 2021 18:15:25 +0000 Subject: [PATCH 654/890] 8277328: jdk/jshell/CommandCompletionTest.java failures on Windows Reviewed-by: vromero --- .../jdk/internal/jshell/tool/JShellTool.java | 8 +++--- .../jdk/jshell/CommandCompletionTest.java | 25 ++++++++++++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java index b257b132363..ac78e23eff6 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java @@ -254,7 +254,7 @@ public class JShellTool implements MessageHandler { Pattern.compile(OPTION_PRE_PATTERN.pattern() + "(?

      -??)(?-([a-z][a-z\\-]*)?)"); // match an option flag and a (possibly missing or incomplete) value private static final Pattern OPTION_VALUE_PATTERN = - Pattern.compile(OPTION_PATTERN.pattern() + "\\s+(?\\S*)"); + Pattern.compile(OPTION_PATTERN.pattern() + "\\s+(?(\\S|\\\\ )*)"); // Tool id (tid) mapping: the three name spaces NameSpace mainNamespace; @@ -1561,13 +1561,13 @@ public class JShellTool implements MessageHandler { private static CompletionProvider fileCompletions(Predicate accept) { return (code, cursor, anchor) -> { int lastSlash = code.lastIndexOf('/'); - String path = code.substring(0, lastSlash + 1); - String prefix = lastSlash != (-1) ? code.substring(lastSlash + 1) : code; + String path = code.substring(0, lastSlash + 1).replace("\\ ", " "); + String prefix = (lastSlash != (-1) ? code.substring(lastSlash + 1) : code).replace("\\ ", " "); Path current = toPathResolvingUserHome(path); List result = new ArrayList<>(); try (Stream dir = Files.list(current)) { dir.filter(f -> accept.test(f) && f.getFileName().toString().startsWith(prefix)) - .map(f -> new ArgSuggestion(f.getFileName() + (Files.isDirectory(f) ? "/" : ""))) + .map(f -> new ArgSuggestion(f.getFileName().toString().replace(" ", "\\ ") + (Files.isDirectory(f) ? "/" : ""))) .forEach(result::add); } catch (IOException ex) { //ignore... diff --git a/test/langtools/jdk/jshell/CommandCompletionTest.java b/test/langtools/jdk/jshell/CommandCompletionTest.java index 27746a748b9..3a5eb1a46a7 100644 --- a/test/langtools/jdk/jshell/CommandCompletionTest.java +++ b/test/langtools/jdk/jshell/CommandCompletionTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8144095 8164825 8169818 8153402 8165405 8177079 8178013 8167554 8166232 + * @bug 8144095 8164825 8169818 8153402 8165405 8177079 8178013 8167554 8166232 8277328 * @summary Test Command Completion * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.main @@ -331,6 +331,22 @@ public class CommandCompletionTest extends ReplToolTesting { ); } + @Test + public void testClassPathWithSpace() throws IOException { + Compiler compiler = new Compiler(); + Path outDir = compiler.getPath("testClassPathWithSpace"); + Path dirWithSpace = Files.createDirectories(outDir.resolve("dir with space")); + Files.createDirectories(dirWithSpace.resolve("nested with space")); + String[] pathArray = new String[] {"dir\\ with\\ space/"}; + String[] pathArray2 = new String[] {"nested\\ with\\ space/"}; + testNoStartUp( + a -> assertCompletion(a, "/env -class-path " + outDir + "/|", false, pathArray), + a -> assertCompletion(a, "/env -class-path " + outDir + "/dir|", false, pathArray), + a -> assertCompletion(a, "/env -class-path " + outDir + "/dir\\ with|", false, pathArray), + a -> assertCompletion(a, "/env -class-path " + outDir + "/dir\\ with\\ space/|", false, pathArray2) + ); + } + @Test public void testUserHome() throws IOException { List completions; @@ -338,8 +354,9 @@ public class CommandCompletionTest extends ReplToolTesting { String selectedFile; try (Stream content = Files.list(home)) { selectedFile = content.filter(CLASSPATH_FILTER) + .filter(file -> file.getFileName().toString().contains(" ")) .findAny() - .map(file -> file.getFileName().toString()) + .map(file -> file.getFileName().toString().replace(" ", "\\ ")) .orElse(null); } if (selectedFile == null) { @@ -347,8 +364,8 @@ public class CommandCompletionTest extends ReplToolTesting { } try (Stream content = Files.list(home)) { completions = content.filter(CLASSPATH_FILTER) - .filter(file -> file.getFileName().toString().startsWith(selectedFile)) - .map(file -> file.getFileName().toString() + (Files.isDirectory(file) ? "/" : "")) + .filter(file -> file.getFileName().toString().startsWith(selectedFile.replace("\\ ", " "))) + .map(file -> file.getFileName().toString().replace(" ", "\\ ") + (Files.isDirectory(file) ? "/" : "")) .sorted() .collect(Collectors.toList()); } -- GitLab From d7c283a081c37bfb8bc5934e4b2af16cad512fd2 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Tue, 7 Dec 2021 18:44:39 +0000 Subject: [PATCH 655/890] 8275233: Incorrect line number reported in exception stack trace thrown from a lambda expression Reviewed-by: jlahoda --- .../sun/tools/javac/comp/LambdaToMethod.java | 11 +++-- .../diags/examples/LambdaDeduplicate.java | 2 +- .../deduplication/DeduplicationDebugInfo.java | 41 +++++++++++++++++++ .../deduplication/DeduplicationDebugInfo.out | 1 + .../DeduplicationDebugInfo_none.out | 0 .../deduplication/DeduplicationTest.java | 1 + 6 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.java create mode 100644 test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.out create mode 100644 test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo_none.out diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java index 55f79c5bc1c..0638da66a89 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java @@ -165,9 +165,14 @@ public class LambdaToMethod extends TreeTranslator { dumpLambdaToMethodStats = options.isSet("debug.dumpLambdaToMethodStats"); attr = Attr.instance(context); forceSerializable = options.isSet("forceSerializable"); - debugLinesOrVars = options.isSet(Option.G) - || options.isSet(Option.G_CUSTOM, "lines") - || options.isSet(Option.G_CUSTOM, "vars"); + boolean lineDebugInfo = + options.isUnset(Option.G_CUSTOM) || + options.isSet(Option.G_CUSTOM, "lines"); + boolean varDebugInfo = + options.isUnset(Option.G_CUSTOM) + ? options.isSet(Option.G) + : options.isSet(Option.G_CUSTOM, "vars"); + debugLinesOrVars = lineDebugInfo || varDebugInfo; verboseDeduplication = options.isSet("debug.dumpLambdaToMethodDeduplication"); deduplicateLambdas = options.getBoolean("deduplicateLambdas", true); nestmateLambdas = Target.instance(context).runtimeUseNestAccess(); diff --git a/test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java b/test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java index 8dda7bb2dd9..cf39f9ffb75 100644 --- a/test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java +++ b/test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java @@ -23,7 +23,7 @@ // key: compiler.note.verbose.l2m.deduplicate -// options: --debug=dumpLambdaToMethodDeduplication +// options: -g:none --debug=dumpLambdaToMethodDeduplication import java.util.function.Function; diff --git a/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.java b/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.java new file mode 100644 index 00000000000..2302b8f431d --- /dev/null +++ b/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021, Google LLC. All rights reserved. + * 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 8275233 + * @summary Incorrect line number reported in exception stack trace thrown from a lambda expression + * @compile/ref=DeduplicationDebugInfo.out -XDrawDiagnostics -XDdebug.dumpLambdaToMethodDeduplication -g:none DeduplicationDebugInfo.java + * @compile/ref=DeduplicationDebugInfo_none.out -XDrawDiagnostics -XDdebug.dumpLambdaToMethodDeduplication DeduplicationDebugInfo.java + * @compile/ref=DeduplicationDebugInfo_none.out -XDrawDiagnostics -XDdebug.dumpLambdaToMethodDeduplication -g:lines DeduplicationDebugInfo.java + * @compile/ref=DeduplicationDebugInfo_none.out -XDrawDiagnostics -XDdebug.dumpLambdaToMethodDeduplication -g:vars DeduplicationDebugInfo.java + * @compile/ref=DeduplicationDebugInfo_none.out -XDrawDiagnostics -XDdebug.dumpLambdaToMethodDeduplication -g:lines,vars DeduplicationDebugInfo.java + */ + +import java.util.function.Function; + +class DeduplicationDebugInfoTest { + void f() { + Function f = x -> x.hashCode(); + Function g = x -> x.hashCode(); + } +} diff --git a/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.out b/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.out new file mode 100644 index 00000000000..f428fe28846 --- /dev/null +++ b/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo.out @@ -0,0 +1 @@ +DeduplicationDebugInfo.java:39:39: compiler.note.verbose.l2m.deduplicate: lambda$f$0(java.lang.Object) diff --git a/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo_none.out b/test/langtools/tools/javac/lambda/deduplication/DeduplicationDebugInfo_none.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/langtools/tools/javac/lambda/deduplication/DeduplicationTest.java b/test/langtools/tools/javac/lambda/deduplication/DeduplicationTest.java index 14d0b88f09e..44c200e6226 100644 --- a/test/langtools/tools/javac/lambda/deduplication/DeduplicationTest.java +++ b/test/langtools/tools/javac/lambda/deduplication/DeduplicationTest.java @@ -93,6 +93,7 @@ public class DeduplicationTest { Arrays.asList( "-d", ".", + "-g:none", "-XDdebug.dumpLambdaToMethodDeduplication", "-XDdebug.dumpLambdaToMethodStats"), null, -- GitLab From 061017a9f4280657987524092b60611bfae8b95f Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Tue, 7 Dec 2021 18:56:58 +0000 Subject: [PATCH 656/890] 8273175: Add @since tags to the DocTree.Kind enum constants Reviewed-by: darcy --- .../classes/com/sun/source/doctree/DocTree.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java b/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java index b0375d200c3..4dea3d09bf4 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java @@ -80,6 +80,8 @@ public interface DocTree { /** * Used for instances of {@link DocTypeTree} * representing an HTML DocType declaration. + * + * @since 10 */ DOC_TYPE, @@ -122,6 +124,8 @@ public interface DocTree { /** * Used for instances of {@link IndexTree} * representing an {@code @index} tag. + * + * @since 9 */ INDEX("index"), @@ -158,6 +162,8 @@ public interface DocTree { /** * Used for instances of {@link ProvidesTree} * representing an {@code @provides} tag. + * + * @since 9 */ PROVIDES("provides"), @@ -207,6 +213,8 @@ public interface DocTree { /** * Used for instances of {@link SnippetTree} * representing an {@code @snippet} tag. + * + * @since 18 */ SNIPPET("snippet"), @@ -219,12 +227,16 @@ public interface DocTree { /** * Used for instances of {@link SystemPropertyTree} * representing an {@code @systemProperty} tag. + * + * @since 12 */ SYSTEM_PROPERTY("systemProperty"), /** * Used for instances of {@link SummaryTree} * representing an {@code @summary} tag. + * + * @since 10 */ SUMMARY("summary"), @@ -255,6 +267,8 @@ public interface DocTree { /** * Used for instances of {@link UsesTree} * representing an {@code @uses} tag. + * + * @since 9 */ USES("uses"), -- GitLab From a8a1fbce5b8efe014b2dac16b83e60de4cf65a3e Mon Sep 17 00:00:00 2001 From: Pavel Rappo Date: Tue, 7 Dec 2021 18:58:08 +0000 Subject: [PATCH 657/890] 8278068: Fix next-line modifier (snippet markup) 8277027: Treat unrecognized markup as snippet text, but warn about it Reviewed-by: jjg --- .../toolkit/resources/doclets.properties | 2 + .../toolkit/taglets/SnippetTaglet.java | 20 +++- .../toolkit/taglets/snippet/MarkupParser.java | 47 ++++---- .../toolkit/taglets/snippet/Parser.java | 10 +- .../doclet/testSnippetTag/SnippetTester.java | 44 +++++++ .../testSnippetTag/TestSnippetMarkup.java | 109 ++++++++++++++++++ .../doclet/testSnippetTag/TestSnippetTag.java | 5 +- 7 files changed, 201 insertions(+), 36 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties index 8825d98f96d..78fc21db8a2 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties @@ -373,6 +373,8 @@ doclet.snippet.contents.mismatch=\ doclet.snippet.markup=\ snippet markup: {0} +doclet.snippet.markup.spurious=\ + spurious markup doclet.snippet.markup.attribute.absent=\ missing attribute "{0}" doclet.snippet.markup.attribute.simultaneous.use=\ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java index 925359bf4ae..0f40ab1e297 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java @@ -269,8 +269,14 @@ public class SnippetTaglet extends BaseTaglet { StyledText externalSnippet = null; try { + Diags d = (text, pos) -> { + var path = writer.configuration().utils.getCommentHelper(holder) + .getDocTreePath(snippetTag.getBody()); + writer.configuration().getReporter().print(Diagnostic.Kind.WARNING, + path, pos, pos, pos, text); + }; if (inlineContent != null) { - inlineSnippet = parse(writer.configuration().getDocResources(), language, inlineContent); + inlineSnippet = parse(writer.configuration().getDocResources(), d, language, inlineContent); } } catch (ParseException e) { var path = writer.configuration().utils.getCommentHelper(holder) @@ -284,8 +290,10 @@ public class SnippetTaglet extends BaseTaglet { } try { + var finalFileObject = fileObject; + Diags d = (text, pos) -> writer.configuration().getMessages().warning(finalFileObject, pos, pos, pos, text); if (externalContent != null) { - externalSnippet = parse(writer.configuration().getDocResources(), language, externalContent); + externalSnippet = parse(writer.configuration().getDocResources(), d, language, externalContent); } } catch (ParseException e) { assert fileObject != null; @@ -363,12 +371,16 @@ public class SnippetTaglet extends BaseTaglet { """.formatted(inline, external); } - private StyledText parse(Resources resources, Optional language, String content) throws ParseException { - Parser.Result result = new Parser(resources).parse(language, content); + private StyledText parse(Resources resources, Diags diags, Optional language, String content) throws ParseException { + Parser.Result result = new Parser(resources).parse(diags, language, content); result.actions().forEach(Action::perform); return result.text(); } + public interface Diags { + void warn(String text, int pos); + } + private static String stringValueOf(AttributeTree at) throws BadSnippetException { if (at.getValueKind() == AttributeTree.ValueKind.EMPTY) { throw new BadSnippetException(at, "doclet.tag.attribute.value.missing", diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java index 879ba7bf2e4..59d6b3f9fdb 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/MarkupParser.java @@ -31,11 +31,8 @@ import java.util.List; import jdk.javadoc.internal.doclets.toolkit.Resources; // -// markup-comment = { markup-tag } ; -// markup-tag = "@" , tag-name , {attribute} [":"] ; -// -// If optional trailing ":" is present, the tag refers to the next line -// rather than to this line. +// markup-comment = { markup-tag } [":"] ; +// markup-tag = "@" , tag-name , {attribute} ; // /** @@ -76,15 +73,28 @@ public final class MarkupParser { } protected List parse() throws ParseException { + List tags = readTags(); + if (ch == ':') { + tags.forEach(t -> t.appliesToNextLine = true); + nextChar(); + } + skipWhitespace(); + if (ch != EOI) { + return List.of(); + } + return tags; + } + + protected List readTags() throws ParseException { List tags = new ArrayList<>(); - // TODO: what to do with leading and trailing unrecognized markup? + skipWhitespace(); while (bp < buflen) { - switch (ch) { - case '@' -> tags.add(readTag()); - default -> nextChar(); + if (ch == '@') { + tags.add(readTag()); + } else { + break; } } - return tags; } @@ -94,26 +104,13 @@ public final class MarkupParser { String name = readIdentifier(); skipWhitespace(); - boolean appliesToNextLine = false; - List attributes = List.of(); - - if (ch == ':') { - appliesToNextLine = true; - nextChar(); - } else { - attributes = attrs(); - skipWhitespace(); - if (ch == ':') { - appliesToNextLine = true; - nextChar(); - } - } + List attributes = attrs(); + skipWhitespace(); Parser.Tag i = new Parser.Tag(); i.nameLineOffset = nameBp; i.name = name; i.attributes = attributes; - i.appliesToNextLine = appliesToNextLine; return i; } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java index ccc6ce87799..3ed4ac03166 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/snippet/Parser.java @@ -94,19 +94,19 @@ public final class Parser { this.markupParser = new MarkupParser(resources); } - public Result parse(Optional language, String source) throws ParseException { + public Result parse(SnippetTaglet.Diags diags, Optional language, String source) throws ParseException { SnippetTaglet.Language lang = language.orElse(SnippetTaglet.Language.JAVA); var p = switch (lang) { case JAVA -> JAVA_COMMENT; case PROPERTIES -> PROPERTIES_COMMENT; }; - return parse(p, source); + return parse(diags, p, source); } /* * Newline characters in the returned text are of the \n form. */ - private Result parse(Pattern commentPattern, String source) throws ParseException { + private Result parse(SnippetTaglet.Diags diags, Pattern commentPattern, String source) throws ParseException { Objects.requireNonNull(commentPattern); Objects.requireNonNull(source); @@ -150,7 +150,7 @@ public final class Parser { parsedTags = markupParser.parse(maybeMarkup); } catch (ParseException e) { // translate error position from markup to file line - throw new ParseException(e::getMessage, markedUpLine.start("markup") + e.getPosition()); + throw new ParseException(e::getMessage, next.offset() + markedUpLine.start("markup") + e.getPosition()); } for (Tag t : parsedTags) { t.lineSourceOffset = next.offset(); @@ -166,7 +166,7 @@ public final class Parser { } } if (parsedTags.isEmpty()) { // (2) - // TODO: log this with NOTICE; + diags.warn(resources.getText("doclet.snippet.markup.spurious"), next.offset() + markedUpLine.start("markup")); line = rawLine + (addLineTerminator ? "\n" : ""); } else { // (3) hasMarkup = true; diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java index ebe13149bb2..23d653be00f 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/SnippetTester.java @@ -26,9 +26,11 @@ import java.io.UncheckedIOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; import java.util.List; import java.util.Optional; +import java.util.function.BiPredicate; import java.util.function.ObjIntConsumer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -122,4 +124,46 @@ public class SnippetTester extends JavadocTester {
      %s
      """.formatted(svgString, idString, langString, content); } + + // There's JavadocTester.diff(), but its semantics is different; hence we + // use this method. + protected void match(Path path1, Path path2, BiPredicate filter) throws IOException { + checking("diff " + path1 + ", " + path2); + try (var paths1 = Files.find(path1, Integer.MAX_VALUE, filter).sorted(); + var paths2 = Files.find(path2, Integer.MAX_VALUE, filter).sorted()) { + var it1 = paths1.iterator(); + var it2 = paths2.iterator(); + while (true) { + if (it1.hasNext() != it2.hasNext()) { + failed(it1.hasNext() ? it1.next() : it2.next(), "missing"); + return; + } + if (!it1.hasNext()) { + passed("match"); + return; + } + Path next1 = it1.next(); + Path next2 = it2.next(); + if (!path1.relativize(next1).equals(path2.relativize(next2))) { + // compare directory tree to see the difference + failed("mismatching names %s %s".formatted(next1, next2)); + return; + } + if (Files.isDirectory(next1) != Files.isDirectory(next2)) { + // it'd be surprising to ever see this + failed("mismatching types %s %s".formatted(next1, next2)); + return; + } + if (Files.isDirectory(next1)) { + continue; + } + if (Files.size(next1) != Files.size(next2) + || Files.mismatch(next1, next2) != -1L) { + failed("mismatching contents: diff %s %s".formatted(next1.toAbsolutePath(), + next2.toAbsolutePath())); + return; + } + } + } + } } diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java index 66d08933bc2..8b5e6b4438d 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetMarkup.java @@ -603,6 +603,115 @@ First line // @highlight : testPositive(base, testCases); } + @Test + public void testPositiveInlineTagMarkup_FalseMarkup(Path base) throws Exception { + var testCases = List.of( + new TestCase( + """ + First line + // @formatter:off + Second Line + Third line + // @formatter:on + Fourth line + """, + """ + First line + // @formatter:off + Second Line + Third line + // @formatter:on + Fourth line + """), + new TestCase("showThis", + """ + First line + // @formatter:off + // @start region=showThis + Second Line + Third line + // @end region + // @formatter:on + Fourth line + """, + """ + Second Line + Third line + """) + ); + testPositive(base, testCases); + } + + @Test + public void testPositiveInlineTagMarkup_NextLineTwoTags(Path base) throws Exception { + var firstTag = new String[]{ + "@highlight string=firstWord", + "@replace string=secondWord replacement=replacedSecondWord", + "@link substring=firstWord target=java.lang.Object"}; + var secondTag = new String[]{ + "@highlight string=secondWord", + "@replace string=firstWord replacement=replacedFirstWord", + "@link substring=secondWord target=java.lang.Thread"}; + List testCases = new ArrayList<>(); + for (var f : firstTag) { + for (var s : secondTag) + for (var separator : List.of("", " ")) { + var t = new TestCase( + """ + first-line // %s %s%s: + firstWord secondWord thirdWord + """.formatted(f, s, separator), + """ + first-line + firstWord secondWord thirdWord // %s %s + """.formatted(f, s)); + testCases.add(t); + } + } + testEquivalence(base, testCases); + } + + record Snippet(String region, String snippet) { } + + private void testEquivalence(Path base, List testCases) throws IOException { + // group all the testcases in just two runs + Path out1 = base.resolve("out1"); + Path out2 = base.resolve("out2"); + run(base.resolve("src1"), out1, testCases.stream().map(t -> new Snippet(t.region(), t.input())).toList()); + run(base.resolve("src2"), out2, testCases.stream().map(t -> new Snippet(t.region(), t.expectedOutput())).toList()); + match(out1, out2, (p, a) -> /* p.toString().endsWith(".html") */ true); + } + + private void run(Path source, Path target, List snippets) throws IOException { + StringBuilder methods = new StringBuilder(); + forEachNumbered(snippets, (i, n) -> { + String r = i.region.isBlank() ? "" : "region=" + i.region; + var methodDef = """ + + /** + {@snippet %s: + %s}*/ + public void case%s() {} + """.formatted(r, i.snippet(), n); + methods.append(methodDef); + }); + var classDef = """ + public class A { + %s + } + """.formatted(methods.toString()); + Path src = Files.createDirectories(source); + tb.writeJavaFiles(src, classDef); + javadoc("-d", target.toString(), + "--limit-modules", "java.base", + "-quiet", "-nohelp", "-noindex", "-nonavbar", "-nosince", + "-notimestamp", "-notree", "-Xdoclint:none", + "-sourcepath", src.toString(), + src.resolve("A.java").toString()); + checkExit(Exit.OK); + checkNoCrashes(); + } + private static String link(boolean linkPlain, String targetReference, String content) diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index 07efd52829b..fac9dfef6e1 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -2418,11 +2418,12 @@ error: snippet markup: invalid attribute value /* ---------------------- */ new TestCase(""" {@snippet : - hello // @highlight substring=" + hello + there // @highlight substring=" }""", """ error: snippet markup: unterminated attribute value - hello // @highlight substring=" + there // @highlight substring=" ^ """), new TestCase(""" -- GitLab From 716c2e1e85c244b31cf73e5ac1a2d765e3514c4d Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 7 Dec 2021 19:28:04 +0000 Subject: [PATCH 658/890] 8278368: ProblemList tools/jpackage/share/MultiNameTwoPhaseTest.java on macosx-x64 Reviewed-by: mikael --- test/jdk/ProblemList.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 24519795f9a..5a03523f327 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -833,6 +833,8 @@ jdk/jfr/api/consumer/streaming/TestLatestEvent.java 8268297 windows- # jdk_jpackage +tools/jpackage/share/MultiNameTwoPhaseTest.java 8278233 macosx-x64 + ############################################################################ # Client manual tests -- GitLab From 3d61372ba589fbd76fee62ea607997f0fb0bc433 Mon Sep 17 00:00:00 2001 From: Mikhailo Seledtsov Date: Tue, 7 Dec 2021 21:58:19 +0000 Subject: [PATCH 659/890] 8278363: Create extented container test groups Reviewed-by: lmesnik --- test/hotspot/jtreg/TEST.groups | 7 +++++++ test/jdk/TEST.groups | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 9ca2a042577..c66e80a10c1 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -71,6 +71,13 @@ hotspot_native_sanity = \ hotspot_containers = \ containers +# Test sets for running inside container environment +hotspot_containers_extended = \ + runtime \ + serviceability \ + vmTestbase/nsk/jvmti \ + vmTestbase/nsk/monitoring + hotspot_vector_1 = \ compiler/c2/cr6340864 \ compiler/codegen \ diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups index 9cdec38ea9a..3f8f683af09 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups @@ -583,3 +583,8 @@ jdk_core_manual_requires_human_input = \ java/util/TimeZone/DefaultTimeZoneTest.java +# Test sets for running inside container environment +jdk_containers_extended = \ + :jdk_io \ + :jdk_nio \ + :jdk_svc -- GitLab From 3c2951f738c5041761b551674822a32b418094c2 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Tue, 7 Dec 2021 23:31:09 +0000 Subject: [PATCH 660/890] 8275771: JDK source code contains redundant boolean operations in jdk.compiler and langtools Reviewed-by: jlahoda --- .../tools/compileproperties/CompileProperties.java | 3 ++- .../classes/com/sun/tools/javac/comp/Resolve.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/make/langtools/tools/compileproperties/CompileProperties.java b/make/langtools/tools/compileproperties/CompileProperties.java index 49cfc8a4a4b..7d69f9b47b2 100644 --- a/make/langtools/tools/compileproperties/CompileProperties.java +++ b/make/langtools/tools/compileproperties/CompileProperties.java @@ -183,7 +183,8 @@ public class CompileProperties { log.error("cannot close " + filename, e); } } - if ( ok = true && contents != null ) { + ok = true; + if ( contents != null ) { String tokens[] = (new String(contents)).split("\\s+"); if ( tokens.length > 0 ) { ok = parseOptions(tokens); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java index 1ba0ace43b4..aa8ce943d04 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java @@ -1301,7 +1301,7 @@ public class Resolve { @Override void skip(JCTree tree) { - result &= false; + result = false; } @Override @@ -1313,9 +1313,9 @@ public class Resolve { @Override public void visitReference(JCMemberReference tree) { if (sRet.hasTag(VOID)) { - result &= true; + // do nothing } else if (tRet.hasTag(VOID)) { - result &= false; + result = false; } else if (tRet.isPrimitive() != sRet.isPrimitive()) { boolean retValIsPrimitive = tree.refPolyKind == PolyKind.STANDALONE && @@ -1335,9 +1335,9 @@ public class Resolve { @Override public void visitLambda(JCLambda tree) { if (sRet.hasTag(VOID)) { - result &= true; + // do nothing } else if (tRet.hasTag(VOID)) { - result &= false; + result = false; } else { List lambdaResults = lambdaResults(tree); if (!lambdaResults.isEmpty() && unrelatedFunctionalInterfaces(tRet, sRet)) { -- GitLab From ec7cb6d5d305003429b51384ed72973767c70124 Mon Sep 17 00:00:00 2001 From: Brent Christian Date: Wed, 8 Dec 2021 00:23:15 +0000 Subject: [PATCH 661/890] 8276447: Deprecate finalization-related methods for removal Reviewed-by: rriggs, alanb, lancea, darcy, mchung, serb, smarks, prr --- .../share/classes/java/lang/Enum.java | 7 +++- .../share/classes/java/lang/Object.java | 40 +++++++++++-------- .../share/classes/java/lang/Runtime.java | 9 +++++ .../share/classes/java/lang/System.java | 12 +++++- .../java/util/concurrent/Executors.java | 2 +- .../util/concurrent/ThreadPoolExecutor.java | 7 +++- .../classes/sun/net/www/MeteredStream.java | 2 +- .../sun/security/ssl/BaseSSLSocketImpl.java | 2 +- .../classes/apple/laf/JRSUIControl.java | 2 +- .../classes/sun/awt/CGraphicsEnvironment.java | 2 +- .../macosx/classes/sun/font/CFont.java | 2 +- .../macosx/classes/sun/font/CStrike.java | 2 +- .../sun/lwawt/macosx/CFRetainedResource.java | 2 +- .../classes/sun/lwawt/macosx/CPrinterJob.java | 2 +- .../plugins/common/SubImageInputStream.java | 2 +- .../imageio/plugins/png/PNGImageWriter.java | 4 +- .../plugins/tiff/TIFFBaseJPEGCompressor.java | 2 +- .../plugins/tiff/TIFFJPEGDecompressor.java | 2 +- .../plugins/tiff/TIFFOldJPEGDecompressor.java | 2 +- .../sun/imageio/stream/StreamFinalizer.java | 2 +- .../sun/media/sound/AbstractMidiDevice.java | 2 +- .../sun/media/sound/JavaSoundAudioClip.java | 1 + .../share/classes/java/awt/Graphics.java | 15 +++---- .../share/classes/java/awt/PrintJob.java | 15 +++---- .../javax/imageio/spi/ServiceRegistry.java | 16 +++----- .../stream/FileCacheImageInputStream.java | 14 +++---- .../imageio/stream/FileImageInputStream.java | 14 +++---- .../imageio/stream/FileImageOutputStream.java | 14 +++---- .../imageio/stream/ImageInputStreamImpl.java | 14 +++---- .../stream/MemoryCacheImageInputStream.java | 14 +++---- .../javax/swing/text/StringContent.java | 2 +- .../classes/sun/java2d/SunGraphics2D.java | 2 +- .../share/classes/sun/print/PeekGraphics.java | 2 +- .../share/classes/sun/print/PrintJob2D.java | 2 +- .../classes/sun/print/ProxyGraphics.java | 2 +- .../classes/sun/print/ProxyGraphics2D.java | 2 +- .../classes/sun/awt/X11InputMethodBase.java | 2 +- .../classes/sun/awt/windows/WInputMethod.java | 2 +- .../java/lang/management/MemoryMXBean.java | 8 +++- .../classes/sun/management/MemoryImpl.java | 1 + .../ldap/AbstractLdapNamingEnumeration.java | 2 +- .../classes/com/sun/jndi/ldap/LdapClient.java | 2 +- .../classes/com/sun/jndi/ldap/LdapCtx.java | 2 +- .../ldap/sasl/DefaultCallbackHandler.java | 2 +- .../classes/sun/rmi/log/LogInputStream.java | 2 +- .../security/jgss/wrapper/GSSCredElement.java | 2 +- .../security/jgss/wrapper/GSSNameElement.java | 2 +- .../jgss/wrapper/NativeGSSContext.java | 2 +- .../com/sun/security/sasl/CramMD5Base.java | 2 +- .../com/sun/security/sasl/PlainClient.java | 2 +- .../sun/security/smartcardio/CardImpl.java | 2 +- .../sun/security/pkcs11/P11KeyStore.java | 2 +- .../sun/security/pkcs11/wrapper/PKCS11.java | 2 +- .../classes/sun/security/mscapi/CKey.java | 2 +- .../sun/tools/jconsole/SummaryTab.java | 1 + .../jdk/jfr/internal/ChunkInputStream.java | 2 +- .../jdk/jfr/internal/ChunksChannel.java | 2 +- .../jdk/jfr/internal/RepositoryChunk.java | 2 +- .../classes/com/sun/jndi/dns/DnsClient.java | 2 +- .../jndi/rmi/registry/RegistryContext.java | 4 +- .../security/sasl/gsskerb/GssKrb5Base.java | 2 +- .../classes/jdk/nio/zipfs/ZipFileSystem.java | 2 +- 62 files changed, 156 insertions(+), 140 deletions(-) diff --git a/src/java.base/share/classes/java/lang/Enum.java b/src/java.base/share/classes/java/lang/Enum.java index 636ad7c757e..886461c3a91 100644 --- a/src/java.base/share/classes/java/lang/Enum.java +++ b/src/java.base/share/classes/java/lang/Enum.java @@ -275,8 +275,13 @@ public abstract class Enum> /** * enum classes cannot have finalize methods. + * + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @SuppressWarnings("deprecation") + @Deprecated(since="18", forRemoval=true) + @SuppressWarnings("removal") protected final void finalize() { } /** diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java index b8085b230af..52028ba99a7 100644 --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -478,6 +478,12 @@ public class Object { * A subclass overrides the {@code finalize} method to dispose of * system resources or to perform other cleanup. *

      + * When running in a Java virtual machine in which finalization has been + * disabled or removed, the garbage collector will never call + * {@code finalize()}. In a Java virtual machine in which finalization is + * enabled, the garbage collector might call {@code finalize} only after an + * indefinite delay. + *

      * The general contract of {@code finalize} is that it is invoked * if and when the Java virtual * machine has determined that there is no longer any @@ -543,27 +549,29 @@ public class Object { * } * } * - * @deprecated The finalization mechanism is inherently problematic. - * Finalization can lead to performance issues, deadlocks, and hangs. - * Errors in finalizers can lead to resource leaks; there is no way to cancel - * finalization if it is no longer necessary; and no ordering is specified - * among calls to {@code finalize} methods of different objects. - * Furthermore, there are no guarantees regarding the timing of finalization. - * The {@code finalize} method might be called on a finalizable object - * only after an indefinite delay, if at all. - * - * Classes whose instances hold non-heap resources should provide a method - * to enable explicit release of those resources, and they should also - * implement {@link AutoCloseable} if appropriate. - * The {@link java.lang.ref.Cleaner} and {@link java.lang.ref.PhantomReference} - * provide more flexible and efficient ways to release resources when an object - * becomes unreachable. + * @deprecated Finalization is deprecated and subject to removal in a future + * release. The use of finalization can lead to problems with security, + * performance, and reliability. + * See JEP 421 for + * discussion and alternatives. + *

      + * Subclasses that override {@code finalize} to perform cleanup should use + * alternative cleanup mechanisms and remove the {@code finalize} method. + * Use {@link java.lang.ref.Cleaner} and + * {@link java.lang.ref.PhantomReference} as safer ways to release resources + * when an object becomes unreachable. Alternatively, add a {@code close} + * method to explicitly release resources, and implement + * {@code AutoCloseable} to enable use of the {@code try}-with-resources + * statement. + *

      + * This method will remain in place until finalizers have been removed from + * most existing code. * * @throws Throwable the {@code Exception} raised by this method * @see java.lang.ref.WeakReference * @see java.lang.ref.PhantomReference * @jls 12.6 Finalization of Class Instances */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) protected void finalize() throws Throwable { } } diff --git a/src/java.base/share/classes/java/lang/Runtime.java b/src/java.base/share/classes/java/lang/Runtime.java index 2288aca4d11..c674880c636 100644 --- a/src/java.base/share/classes/java/lang/Runtime.java +++ b/src/java.base/share/classes/java/lang/Runtime.java @@ -707,8 +707,17 @@ public class Runtime { * The method {@link System#runFinalization()} is the conventional * and convenient means of invoking this method. * + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. + *

      + * When running in a JVM in which finalization has been disabled or removed, + * no objects will be pending finalization, so this method does nothing. + * * @see java.lang.Object#finalize() + * @jls 12.6 Finalization of Class Instances */ + @Deprecated(since="18", forRemoval=true) public void runFinalization() { SharedSecrets.getJavaLangRefAccess().runFinalization(); } diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index 12a82813433..47b436847cb 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -1922,8 +1922,18 @@ public final class System { * Runtime.getRuntime().runFinalization() * * + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. + *

      + * When running in a JVM in which finalization has been disabled or removed, + * no objects will be pending finalization, so this method does nothing. + * * @see java.lang.Runtime#runFinalization() + * @jls 12.6 Finalization of Class Instances */ + @Deprecated(since="18", forRemoval=true) + @SuppressWarnings("removal") public static void runFinalization() { Runtime.getRuntime().runFinalization(); } @@ -2321,7 +2331,7 @@ public final class System { public Thread newThreadWithAcc(Runnable target, @SuppressWarnings("removal") AccessControlContext acc) { return new Thread(target, acc); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public void invokeFinalize(Object o) throws Throwable { o.finalize(); } diff --git a/src/java.base/share/classes/java/util/concurrent/Executors.java b/src/java.base/share/classes/java/util/concurrent/Executors.java index a9e7de32a00..3345153bd97 100644 --- a/src/java.base/share/classes/java/util/concurrent/Executors.java +++ b/src/java.base/share/classes/java/util/concurrent/Executors.java @@ -791,7 +791,7 @@ public class Executors { FinalizableDelegatedExecutorService(ExecutorService executor) { super(executor); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { super.shutdown(); } diff --git a/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java b/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java index 49d2a29b262..f23e72a8f70 100644 --- a/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java +++ b/src/java.base/share/classes/java/util/concurrent/ThreadPoolExecutor.java @@ -1477,8 +1477,13 @@ public class ThreadPoolExecutor extends AbstractExecutorService { * @implNote Previous versions of this class had a finalize method * that shut down this executor, but in this version, finalize * does nothing. + * + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") protected void finalize() {} /** diff --git a/src/java.base/share/classes/sun/net/www/MeteredStream.java b/src/java.base/share/classes/sun/net/www/MeteredStream.java index 049b16c03c6..fc0579a679e 100644 --- a/src/java.base/share/classes/sun/net/www/MeteredStream.java +++ b/src/java.base/share/classes/sun/net/www/MeteredStream.java @@ -242,7 +242,7 @@ public class MeteredStream extends FilterInputStream { return readLock.isHeldByCurrentThread(); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { try { close(); diff --git a/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java b/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java index ba58741d759..8923dee25c9 100644 --- a/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java @@ -270,7 +270,7 @@ abstract class BaseSSLSocketImpl extends SSLSocket { * the penalty of prematurly killing SSL sessions. */ @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected final void finalize() throws Throwable { try { close(); diff --git a/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java b/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java index e3579449b75..6e6c86ccf7a 100644 --- a/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java +++ b/src/java.desktop/macosx/classes/apple/laf/JRSUIControl.java @@ -114,7 +114,7 @@ public final class JRSUIControl { changes.putAll(other.changes); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected synchronized void finalize() throws Throwable { if (cfDictionaryPtr == 0) return; disposeCFDictionary(cfDictionaryPtr); diff --git a/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java b/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java index e96ce7e18d7..fe4431e3091 100644 --- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java +++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java @@ -144,7 +144,7 @@ public final class CGraphicsEnvironment extends SunGraphicsEnvironment { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { try { super.finalize(); diff --git a/src/java.desktop/macosx/classes/sun/font/CFont.java b/src/java.desktop/macosx/classes/sun/font/CFont.java index 885fc7fc471..85b38beb86c 100644 --- a/src/java.desktop/macosx/classes/sun/font/CFont.java +++ b/src/java.desktop/macosx/classes/sun/font/CFont.java @@ -247,7 +247,7 @@ public final class CFont extends PhysicalFont implements FontSubstitution { return compFont; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected synchronized void finalize() { if (nativeFontPtr != 0) { disposeNativeFont(nativeFontPtr); diff --git a/src/java.desktop/macosx/classes/sun/font/CStrike.java b/src/java.desktop/macosx/classes/sun/font/CStrike.java index 088fb01591e..eb049c3d449 100644 --- a/src/java.desktop/macosx/classes/sun/font/CStrike.java +++ b/src/java.desktop/macosx/classes/sun/font/CStrike.java @@ -125,7 +125,7 @@ public final class CStrike extends PhysicalStrike { return nativeStrikePtr; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected synchronized void finalize() throws Throwable { if (nativeStrikePtr != 0) { disposeNativeStrikePtr(nativeStrikePtr); diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java index de0553501e6..43d6c218b29 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java @@ -163,7 +163,7 @@ public class CFRetainedResource { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected final void finalize() throws Throwable { dispose(); } diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index de96e59d92e..8dd02462284 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -598,7 +598,7 @@ public final class CPrinterJob extends RasterPrinterJob { // The following methods are CPrinterJob specific. @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { synchronized (fNSPrintInfoLock) { if (fNSPrintInfo != -1) { diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java index 8ddffc522f1..10211c6636c 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/common/SubImageInputStream.java @@ -72,7 +72,7 @@ public final class SubImageInputStream extends ImageInputStreamImpl { streamPos = pos; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java index 449661b8c91..ce6f771ecdc 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java @@ -147,7 +147,7 @@ final class ChunkStream extends ImageOutputStreamImpl { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) @@ -284,7 +284,7 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java index 74695ae46ce..dba8d878169 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFBaseJPEGCompressor.java @@ -435,7 +435,7 @@ public abstract class TIFFBaseJPEGCompressor extends TIFFCompressor { return compDataLength; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { super.finalize(); if(JPEGWriter != null) { diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java index 384687f8344..0b21835901b 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFJPEGDecompressor.java @@ -139,7 +139,7 @@ public class TIFFJPEGDecompressor extends TIFFDecompressor { JPEGReader.read(0, JPEGParam); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { super.finalize(); JPEGReader.dispose(); diff --git a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java index 67dd60f8a79..3cd89b396cc 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java +++ b/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFOldJPEGDecompressor.java @@ -610,7 +610,7 @@ public class TIFFOldJPEGDecompressor extends TIFFJPEGDecompressor { JPEGReader.read(0, JPEGParam); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { super.finalize(); JPEGReader.dispose(); diff --git a/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java b/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java index be1e659ee6e..012d7e10645 100644 --- a/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java +++ b/src/java.desktop/share/classes/com/sun/imageio/stream/StreamFinalizer.java @@ -60,7 +60,7 @@ public class StreamFinalizer { this.stream = stream; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { try { stream.close(); diff --git a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java index 1b50f31eb9e..3ba4ce2ed36 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/AbstractMidiDevice.java @@ -425,7 +425,7 @@ abstract class AbstractMidiDevice implements MidiDevice, ReferenceCountingDevice * close this device if discarded by the garbage collector. */ @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected final void finalize() { close(); } diff --git a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java index bc2f87fe33f..c804a0e49c2 100644 --- a/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java +++ b/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java @@ -283,6 +283,7 @@ public final class JavaSoundAudioClip implements AudioClip, MetaEventListener, L } @Override + @SuppressWarnings("removal") protected void finalize() { if (clip != null) { diff --git a/src/java.desktop/share/classes/java/awt/Graphics.java b/src/java.desktop/share/classes/java/awt/Graphics.java index 51cdd6a88da..5ed31aeadb0 100644 --- a/src/java.desktop/share/classes/java/awt/Graphics.java +++ b/src/java.desktop/share/classes/java/awt/Graphics.java @@ -1162,17 +1162,14 @@ public abstract class Graphics { /** * Disposes of this graphics context once it is no longer referenced. * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. + * * @see #dispose */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") public void finalize() { dispose(); } diff --git a/src/java.desktop/share/classes/java/awt/PrintJob.java b/src/java.desktop/share/classes/java/awt/PrintJob.java index a9e2bd8bea2..f4ea24efd97 100644 --- a/src/java.desktop/share/classes/java/awt/PrintJob.java +++ b/src/java.desktop/share/classes/java/awt/PrintJob.java @@ -85,17 +85,14 @@ public abstract class PrintJob { /** * Ends this print job once it is no longer referenced. * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. + * * @see #end */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") public void finalize() { end(); } diff --git a/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java b/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java index 741ca55c501..4a43ca8133a 100644 --- a/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java +++ b/src/java.desktop/share/classes/javax/imageio/spi/ServiceRegistry.java @@ -680,16 +680,12 @@ public class ServiceRegistry { * @exception Throwable if an error occurs during superclass * finalization. * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") public void finalize() throws Throwable { deregisterAll(); super.finalize(); @@ -842,7 +838,7 @@ class SubRegistry { accMap.clear(); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public synchronized void finalize() { clear(); } diff --git a/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java b/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java index e5974900161..6bf14838b7f 100644 --- a/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java +++ b/src/java.desktop/share/classes/javax/imageio/stream/FileCacheImageInputStream.java @@ -261,16 +261,12 @@ public class FileCacheImageInputStream extends ImageInputStreamImpl { /** * {@inheritDoc} * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer: for performance reasons we instead use the // Disposer mechanism for ensuring that the underlying diff --git a/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java b/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java index 7ecc28767a0..b1cce6fae4c 100644 --- a/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java +++ b/src/java.desktop/share/classes/javax/imageio/stream/FileImageInputStream.java @@ -156,16 +156,12 @@ public class FileImageInputStream extends ImageInputStreamImpl { /** * {@inheritDoc} * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer: for performance reasons we instead use the // Disposer mechanism for ensuring that the underlying diff --git a/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java b/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java index e75c40396d8..715b43f40fb 100644 --- a/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java +++ b/src/java.desktop/share/classes/javax/imageio/stream/FileImageOutputStream.java @@ -164,16 +164,12 @@ public class FileImageOutputStream extends ImageOutputStreamImpl { /** * {@inheritDoc} * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer: for performance reasons we instead use the // Disposer mechanism for ensuring that the underlying diff --git a/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java b/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java index c7cdc47cdaf..053bbf74918 100644 --- a/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java +++ b/src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java @@ -868,16 +868,12 @@ public abstract class ImageInputStreamImpl implements ImageInputStream { * @exception Throwable if an error occurs during superclass * finalization. * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") protected void finalize() throws Throwable { if (!isClosed) { try { diff --git a/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java b/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java index 4fcb0f40b81..44b9d8cd5fb 100644 --- a/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java +++ b/src/java.desktop/share/classes/javax/imageio/stream/MemoryCacheImageInputStream.java @@ -179,16 +179,12 @@ public class MemoryCacheImageInputStream extends ImageInputStreamImpl { /** * {@inheritDoc} * - * @deprecated The {@code finalize} method has been deprecated. - * Subclasses that override {@code finalize} in order to perform cleanup - * should be modified to use alternative cleanup mechanisms and - * to remove the overriding {@code finalize} method. - * When overriding the {@code finalize} method, its implementation must explicitly - * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. - * See the specification for {@link Object#finalize()} for further - * information about migration options. + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for background information and details + * about migration options. */ - @Deprecated(since="9") + @Deprecated(since="9", forRemoval=true) + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Empty finalizer: for performance reasons we instead use the // Disposer mechanism for ensuring that the underlying diff --git a/src/java.desktop/share/classes/javax/swing/text/StringContent.java b/src/java.desktop/share/classes/javax/swing/text/StringContent.java index c66156a39f2..7f154df38ed 100644 --- a/src/java.desktop/share/classes/javax/swing/text/StringContent.java +++ b/src/java.desktop/share/classes/javax/swing/text/StringContent.java @@ -350,7 +350,7 @@ public final class StringContent implements AbstractDocument.Content, Serializab return rec.offset; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { // schedule the record to be removed later // on another thread. diff --git a/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java b/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java index 15db79d69d2..b5b5225938b 100644 --- a/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java +++ b/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java @@ -3656,7 +3656,7 @@ public final class SunGraphics2D * enough to know that if our override is empty then it should not * mark us as finalizeable. */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public void finalize() { // DO NOT REMOVE THIS METHOD } diff --git a/src/java.desktop/share/classes/sun/print/PeekGraphics.java b/src/java.desktop/share/classes/sun/print/PeekGraphics.java index c400ad59ca2..b5eabc84773 100644 --- a/src/java.desktop/share/classes/sun/print/PeekGraphics.java +++ b/src/java.desktop/share/classes/sun/print/PeekGraphics.java @@ -1336,7 +1336,7 @@ public class PeekGraphics extends Graphics2D /** * Empty finalizer as no clean up needed here. */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public void finalize() { } diff --git a/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/src/java.desktop/share/classes/sun/print/PrintJob2D.java index 323cb0cc84e..9083bd3e269 100644 --- a/src/java.desktop/share/classes/sun/print/PrintJob2D.java +++ b/src/java.desktop/share/classes/sun/print/PrintJob2D.java @@ -940,7 +940,7 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { * Ends this print job once it is no longer referenced. * @see #end */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public void finalize() { end(); } diff --git a/src/java.desktop/share/classes/sun/print/ProxyGraphics.java b/src/java.desktop/share/classes/sun/print/ProxyGraphics.java index 124a7a487f6..c6c0615c343 100644 --- a/src/java.desktop/share/classes/sun/print/ProxyGraphics.java +++ b/src/java.desktop/share/classes/sun/print/ProxyGraphics.java @@ -1099,7 +1099,7 @@ public class ProxyGraphics extends Graphics { /** * Empty finalizer as no clean up needed here. */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public void finalize() { } diff --git a/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java b/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java index fc1c0e76810..c05ba9a6188 100644 --- a/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java +++ b/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java @@ -1264,7 +1264,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Empty finalizer as no clean up needed here. */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") public void finalize() { } diff --git a/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java b/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java index 671df20d1db..eb71b7a5972 100644 --- a/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java +++ b/src/java.desktop/unix/classes/sun/awt/X11InputMethodBase.java @@ -172,7 +172,7 @@ public abstract class X11InputMethodBase extends InputMethodAdapter { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { dispose(); super.finalize(); diff --git a/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java b/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java index 9ad52ba7111..681662032e1 100644 --- a/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java +++ b/src/java.desktop/windows/classes/sun/awt/windows/WInputMethod.java @@ -133,7 +133,7 @@ final class WInputMethod extends InputMethodAdapter } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { // Release the resources used by the native input context. diff --git a/src/java.management/share/classes/java/lang/management/MemoryMXBean.java b/src/java.management/share/classes/java/lang/management/MemoryMXBean.java index 716d2bcefca..f17e5e8077a 100644 --- a/src/java.management/share/classes/java/lang/management/MemoryMXBean.java +++ b/src/java.management/share/classes/java/lang/management/MemoryMXBean.java @@ -207,9 +207,15 @@ public interface MemoryMXBean extends PlatformManagedObject { * Returns the approximate number of objects for which * finalization is pending. * + * @deprecated Finalization has been deprecated for removal. See + * {@link java.lang.Object#finalize} for details. + * * @return the approximate number objects for which finalization - * is pending. + * is pending. If this MemoryMXBean contains information about a JVM in + * which finalization has been disabled or removed, this method always + * returns zero. */ + @Deprecated(since="18") public int getObjectPendingFinalizationCount(); /** diff --git a/src/java.management/share/classes/sun/management/MemoryImpl.java b/src/java.management/share/classes/sun/management/MemoryImpl.java index 7850b90e783..5bdbe7b6349 100644 --- a/src/java.management/share/classes/sun/management/MemoryImpl.java +++ b/src/java.management/share/classes/sun/management/MemoryImpl.java @@ -58,6 +58,7 @@ class MemoryImpl extends NotificationEmitterSupport this.jvm = vm; } + @SuppressWarnings("deprecation") public int getObjectPendingFinalizationCount() { return jdk.internal.misc.VM.getFinalRefCount(); } diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java index 94c15c09d11..5c7644212f9 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java @@ -383,7 +383,7 @@ abstract class AbstractLdapNamingEnumeration listArg = ne.listArg; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected final void finalize() { cleanup(); } diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java index d972766dc11..4834b6e530a 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapClient.java @@ -477,7 +477,7 @@ public final class LdapClient implements PooledConnection { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { if (debug > 0) System.err.println("LdapClient: finalize " + this); forceClose(pooled); diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java index 059b654f581..9a918edf0c3 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -2639,7 +2639,7 @@ public final class LdapCtx extends ComponentDirContext // ----------------- Connection --------------------- - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { try { close(); diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java index 2a782c0e9cc..b6388915840 100644 --- a/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java +++ b/src/java.naming/share/classes/com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java @@ -131,7 +131,7 @@ final class DefaultCallbackHandler implements CallbackHandler { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { clearPassword(); } diff --git a/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java b/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java index 649fa22516d..1dbdd3064bc 100644 --- a/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java +++ b/src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java @@ -128,7 +128,7 @@ class LogInputStream extends InputStream { /** * Closes the stream when garbage is collected. */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws IOException { close(); } diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java index bfe1807935a..447b6c947e9 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSCredElement.java @@ -132,7 +132,7 @@ public class GSSCredElement implements GSSCredentialSpi { return "N/A"; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { dispose(); } diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java index 54641f2f6e6..b449169c441 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java @@ -290,7 +290,7 @@ public class GSSNameElement implements GSSNameSpi { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { dispose(); } diff --git a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java index e89b109250e..61640be3507 100644 --- a/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java +++ b/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/NativeGSSContext.java @@ -639,7 +639,7 @@ class NativeGSSContext implements GSSContextSpi { return isInitiator; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { dispose(); } diff --git a/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java b/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java index bbbe88a71e4..b59b449e3c5 100644 --- a/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java +++ b/src/java.security.sasl/share/classes/com/sun/security/sasl/CramMD5Base.java @@ -136,7 +136,7 @@ abstract class CramMD5Base { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { clearPassword(); } diff --git a/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java b/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java index e365e772e6e..04a8d9856c2 100644 --- a/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java +++ b/src/java.security.sasl/share/classes/com/sun/security/sasl/PlainClient.java @@ -195,7 +195,7 @@ final class PlainClient implements SaslClient { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { clearPassword(); } diff --git a/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java b/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java index 576333a1421..b982df5dd07 100644 --- a/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java +++ b/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java @@ -276,7 +276,7 @@ final class CardImpl extends Card { + ", protocol " + getProtocol() + ", state " + state; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { try { if (state == State.OK) { diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java index 0f7b97ebc87..585fb47ec54 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java @@ -243,7 +243,7 @@ final class P11KeyStore extends KeyStoreSpi { pc.setPassword(password); // this clones the password if not null } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { if (password != null) { Arrays.fill(password, ' '); diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java index 2b2f3d0ebd4..a4c852f7abf 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java @@ -1615,7 +1615,7 @@ public class PKCS11 { * * @exception Throwable If finalization fails. */ - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { disconnect(); } diff --git a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java index 019f0ccac56..e010e971787 100644 --- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java +++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKey.java @@ -55,7 +55,7 @@ abstract class CKey implements Key, Length { this.hCryptKey = hCryptKey; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { try { synchronized(this) { diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/SummaryTab.java b/src/jdk.jconsole/share/classes/sun/tools/jconsole/SummaryTab.java index f70f1b1f358..3168665cfc0 100644 --- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/SummaryTab.java +++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/SummaryTab.java @@ -113,6 +113,7 @@ class SummaryTab extends Tab { StringBuilder buf; + @SuppressWarnings("deprecation") synchronized Result formatSummary() { Result result = new Result(); ProxyClient proxyClient = vmPanel.getProxyClient(); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunkInputStream.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunkInputStream.java index a5e1d01783f..5b192443980 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunkInputStream.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunkInputStream.java @@ -112,7 +112,7 @@ final class ChunkInputStream extends InputStream { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { super.finalize(); close(); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunksChannel.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunksChannel.java index 1139536c938..b606105d29e 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunksChannel.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/ChunksChannel.java @@ -137,7 +137,7 @@ final class ChunksChannel implements ReadableByteChannel { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { super.finalize(); close(); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java index af5ff3e08e4..8cb8bd85c37 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java @@ -134,7 +134,7 @@ final class RepositoryChunk { } @Override - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { boolean destroy = false; synchronized (this) { diff --git a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java index ed4f2d8a105..a5508ec45db 100644 --- a/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java +++ b/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java @@ -148,7 +148,7 @@ public class DnsClient { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { close(); } diff --git a/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java b/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java index bea428a6068..d77055d2808 100644 --- a/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java +++ b/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java @@ -120,7 +120,7 @@ public class RegistryContext implements Context, Referenceable { reference = ctx.reference; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { close(); } @@ -596,7 +596,7 @@ class BindingEnumeration implements NamingEnumeration { nextName = 0; } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() { ctx.close(); } diff --git a/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java b/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java index 04cc61a5d2e..afdb7279c17 100644 --- a/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java +++ b/src/jdk.security.jgss/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Base.java @@ -162,7 +162,7 @@ abstract class GssKrb5Base extends AbstractSaslImpl { } } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws Throwable { dispose(); } diff --git a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java index 4f9b4e427bc..d63ca41424a 100644 --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -1219,7 +1219,7 @@ class ZipFileSystem extends FileSystem { return zc.toString(name); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") protected void finalize() throws IOException { close(); } -- GitLab From d7ad546758091ea16f836c9771ff5c03a32fb712 Mon Sep 17 00:00:00 2001 From: Stuart Marks Date: Wed, 8 Dec 2021 00:27:53 +0000 Subject: [PATCH 662/890] 8276422: Add command-line option to disable finalization Co-authored-by: David Holmes Co-authored-by: Brent Christian Reviewed-by: dholmes, kbarrett, bchristi --- make/data/hotspot-symbols/symbols-unix | 1 + .../share/classfile/classFileParser.cpp | 6 +- src/hotspot/share/include/jvm.h | 3 + src/hotspot/share/oops/instanceKlass.cpp | 1 + src/hotspot/share/oops/instanceKlass.hpp | 10 ++ src/hotspot/share/prims/jvm.cpp | 4 + src/hotspot/share/runtime/arguments.cpp | 12 ++ .../classes/java/lang/ref/Finalizer.java | 30 +++-- .../launcher/resources/launcher.properties | 5 +- .../share/native/libjava/Finalizer.c | 5 +- .../java/lang/Object/FinalizationOption.java | 122 ++++++++++++++++++ .../Object/InvalidFinalizationOption.java | 52 ++++++++ .../runtime/TestFinalizerStatisticsEvent.java | 31 ++++- 13 files changed, 265 insertions(+), 17 deletions(-) create mode 100644 test/jdk/java/lang/Object/FinalizationOption.java create mode 100644 test/jdk/java/lang/Object/InvalidFinalizationOption.java diff --git a/make/data/hotspot-symbols/symbols-unix b/make/data/hotspot-symbols/symbols-unix index d735f61b3a4..9ec0c1ec7c7 100644 --- a/make/data/hotspot-symbols/symbols-unix +++ b/make/data/hotspot-symbols/symbols-unix @@ -147,6 +147,7 @@ JVM_IsArrayClass JVM_IsCDSDumpingEnabled JVM_IsConstructorIx JVM_IsDumpingClassList +JVM_IsFinalizationEnabled JVM_IsHiddenClass JVM_IsInterface JVM_IsPrimitiveClass diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index a7ae7bef5c3..368e3534184 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -2835,7 +2835,8 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs, annotation_default_length, CHECK_NULL); - if (name == vmSymbols::finalize_method_name() && + if (InstanceKlass::is_finalization_enabled() && + name == vmSymbols::finalize_method_name() && signature == vmSymbols::void_method_signature()) { if (m->is_empty_method()) { _has_empty_finalizer = true; @@ -4171,7 +4172,8 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) { bool f = false; const Method* const m = ik->lookup_method(vmSymbols::finalize_method_name(), vmSymbols::void_method_signature()); - if (m != NULL && !m->is_empty_method()) { + if (InstanceKlass::is_finalization_enabled() && + (m != NULL) && !m->is_empty_method()) { f = true; } diff --git a/src/hotspot/share/include/jvm.h b/src/hotspot/share/include/jvm.h index 7783b00841d..e4f56c552b7 100644 --- a/src/hotspot/share/include/jvm.h +++ b/src/hotspot/share/include/jvm.h @@ -759,6 +759,9 @@ JVM_SupportsCX8(void); JNIEXPORT void JNICALL JVM_ReportFinalizationComplete(JNIEnv *env, jobject finalizee); +JNIEXPORT jboolean JNICALL +JVM_IsFinalizationEnabled(JNIEnv *env); + /************************************************************************* PART 2: Support for the Verifier and Class File Format Checker ************************************************************************/ diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index b4ee9c5dc0b..fafc58fa9fd 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -141,6 +141,7 @@ #endif // ndef DTRACE_ENABLED +bool InstanceKlass::_finalization_enabled = true; static inline bool is_class_loader(const Symbol* class_name, const ClassFileParser& parser) { diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index c2ad122e92b..82e918d1444 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -329,7 +329,17 @@ class InstanceKlass: public Klass { static bool _disable_method_binary_search; + // Controls finalizer registration + static bool _finalization_enabled; + public: + + // Queries finalization state + static bool is_finalization_enabled() { return _finalization_enabled; } + + // Sets finalization state + static void set_finalization_enabled(bool val) { _finalization_enabled = val; } + // The three BUILTIN class loader types bool is_shared_boot_class() const { return (_misc_flags & _misc_is_shared_boot_class) != 0; diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index de4e35492c8..f1d00c5da97 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -690,6 +690,10 @@ JVM_ENTRY(void, JVM_ReportFinalizationComplete(JNIEnv * env, jobject finalizee)) MANAGEMENT_ONLY(FinalizerService::on_complete(JNIHandles::resolve_non_null(finalizee), THREAD);) JVM_END +JVM_ENTRY(jboolean, JVM_IsFinalizationEnabled(JNIEnv * env)) + return InstanceKlass::is_finalization_enabled(); +JVM_END + // java.io.File /////////////////////////////////////////////////////////////// JVM_LEAF(char*, JVM_NativePath(char* path)) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 969c8e82b91..8b32e89e834 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -40,6 +40,7 @@ #include "logging/logStream.hpp" #include "logging/logTag.hpp" #include "memory/allocation.inline.hpp" +#include "oops/instanceKlass.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "runtime/arguments.hpp" @@ -2887,6 +2888,17 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m if (FLAG_SET_CMDLINE(ErrorFileToStdout, true) != JVMFlag::SUCCESS) { return JNI_EINVAL; } + } else if (match_option(option, "--finalization=", &tail)) { + if (strcmp(tail, "enabled") == 0) { + InstanceKlass::set_finalization_enabled(true); + } else if (strcmp(tail, "disabled") == 0) { + InstanceKlass::set_finalization_enabled(false); + } else { + jio_fprintf(defaultStream::error_stream(), + "Invalid finalization value '%s', must be 'disabled' or 'enabled'.\n", + tail); + return JNI_EINVAL; + } } else if (match_option(option, "-XX:+ExtendedDTraceProbes")) { #if defined(DTRACE_ENABLED) if (FLAG_SET_CMDLINE(ExtendedDTraceProbes, true) != JVMFlag::SUCCESS) { diff --git a/src/java.base/share/classes/java/lang/ref/Finalizer.java b/src/java.base/share/classes/java/lang/ref/Finalizer.java index d5838b7a6b1..18aedf11bb3 100644 --- a/src/java.base/share/classes/java/lang/ref/Finalizer.java +++ b/src/java.base/share/classes/java/lang/ref/Finalizer.java @@ -61,9 +61,17 @@ final class Finalizer extends FinalReference { /* Package-private; must return queue; } + static final boolean ENABLED = isFinalizationEnabled(); + + private static native boolean isFinalizationEnabled(); + /* Invoked by VM */ static void register(Object finalizee) { - new Finalizer(finalizee); + if (ENABLED) { + new Finalizer(finalizee); + } else { + throw new InternalError("unexpected call to Finalizer::register when finalization is disabled"); + } } private void runFinalizer(JavaLangAccess jla) { @@ -130,7 +138,7 @@ final class Finalizer extends FinalReference { /* Package-private; must /* Called by Runtime.runFinalization() */ static void runFinalization() { - if (VM.initLevel() == 0) { + if (VM.initLevel() == 0 || ! ENABLED) { return; } @@ -182,14 +190,16 @@ final class Finalizer extends FinalReference { /* Package-private; must } static { - ThreadGroup tg = Thread.currentThread().getThreadGroup(); - for (ThreadGroup tgn = tg; - tgn != null; - tg = tgn, tgn = tg.getParent()); - Thread finalizer = new FinalizerThread(tg); - finalizer.setPriority(Thread.MAX_PRIORITY - 2); - finalizer.setDaemon(true); - finalizer.start(); + if (ENABLED) { + ThreadGroup tg = Thread.currentThread().getThreadGroup(); + for (ThreadGroup tgn = tg; + tgn != null; + tg = tgn, tgn = tg.getParent()); + Thread finalizer = new FinalizerThread(tg); + finalizer.setPriority(Thread.MAX_PRIORITY - 2); + finalizer.setDaemon(true); + finalizer.start(); + } } } diff --git a/src/java.base/share/classes/sun/launcher/resources/launcher.properties b/src/java.base/share/classes/sun/launcher/resources/launcher.properties index efcc4d69969..22fe4a35a5e 100644 --- a/src/java.base/share/classes/sun/launcher/resources/launcher.properties +++ b/src/java.base/share/classes/sun/launcher/resources/launcher.properties @@ -194,7 +194,10 @@ java.launcher.X.usage=\n\ \ override or augment a module with classes and resources\n\ \ in JAR files or directories.\n\ \ --source \n\ -\ set the version of the source in source-file mode.\n\n\ +\ set the version of the source in source-file mode.\n\ +\ --finalization=\n\ +\ controls finalization\n\ +\ is one of "enabled" or "disabled"\n\n\ These extra options are subject to change without notice.\n # Translators please note do not translate the options themselves diff --git a/src/java.base/share/native/libjava/Finalizer.c b/src/java.base/share/native/libjava/Finalizer.c index d0b81f63d6e..063e330ac9b 100644 --- a/src/java.base/share/native/libjava/Finalizer.c +++ b/src/java.base/share/native/libjava/Finalizer.c @@ -32,4 +32,7 @@ Java_java_lang_ref_Finalizer_reportComplete(JNIEnv* env, jclass cls, jobject fin JVM_ReportFinalizationComplete(env, finalizee); } - +JNIEXPORT jboolean JNICALL +Java_java_lang_ref_Finalizer_isFinalizationEnabled(JNIEnv* env, jclass cls) { + return JVM_IsFinalizationEnabled(env); +} diff --git a/test/jdk/java/lang/Object/FinalizationOption.java b/test/jdk/java/lang/Object/FinalizationOption.java new file mode 100644 index 00000000000..7d50412e26f --- /dev/null +++ b/test/jdk/java/lang/Object/FinalizationOption.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2021, 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 8276422 + * @summary add command-line option to disable finalization + * @run main/othervm FinalizationOption yes + * @run main/othervm --finalization=enabled FinalizationOption yes + * @run main/othervm --finalization=disabled FinalizationOption no + */ +public class FinalizationOption { + static volatile boolean finalizerWasCalled = false; + + @SuppressWarnings("deprecation") + protected void finalize() { + finalizerWasCalled = true; + } + + static void create() { + new FinalizationOption(); + } + + /** + * Checks whether the finalizer thread is or is not running. The finalizer thread + * is a thread in the root thread group whose named is "Finalizer". + * @param expected boolean indicating whether a finalizer thread should exist + * @return boolean indicating whether the expectation was met + */ + static boolean checkFinalizerThread(boolean expected) { + ThreadGroup root = Thread.currentThread().getThreadGroup(); + for (ThreadGroup parent = root; + parent != null; + root = parent, parent = root.getParent()) + ; + + int nt = 100; + Thread[] threads; + while (true) { + threads = new Thread[nt]; + nt = root.enumerate(threads); + if (nt < threads.length) + break; + threads = new Thread[nt + 100]; + } + + Thread ft = null; + for (int i = 0; i < nt; i++) { + if ("Finalizer".equals(threads[i].getName())) { + ft = threads[i]; + break; + } + } + + String msg = (ft == null) ? "(none)" : ft.toString(); + boolean passed = (ft != null) == expected; + System.out.printf("Finalizer thread. Expected: %s Actual: %s %s%n", + expected, msg, passed ? "Passed." : "FAILED!"); + return passed; + } + + /** + * Checks whether there was a call to the finalize() method. + * @param expected boolean whether finalize() should be called + * @return boolean indicating whether the expecation was met + */ + static boolean checkFinalizerCalled(boolean expected) { + create(); + for (int i = 0; i < 100; i++) { + System.gc(); + try { + Thread.sleep(10L); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + if (finalizerWasCalled) { + break; + } + } + boolean passed = (expected == finalizerWasCalled); + System.out.printf("Call to finalize(). Expected: %s Actual: %s %s%n", + expected, finalizerWasCalled, + passed ? "Passed." : "FAILED!"); + return passed; + } + + public static void main(String[] args) { + boolean finalizationEnabled = switch (args[0]) { + case "yes" -> true; + case "no" -> false; + default -> { + throw new AssertionError("usage: FinalizationOption yes|no"); + } + }; + + boolean threadPass = checkFinalizerThread(finalizationEnabled); + boolean calledPass = checkFinalizerCalled(finalizationEnabled); + + if (!threadPass || !calledPass) + throw new AssertionError("Test failed."); + } +} diff --git a/test/jdk/java/lang/Object/InvalidFinalizationOption.java b/test/jdk/java/lang/Object/InvalidFinalizationOption.java new file mode 100644 index 00000000000..c5cca549ead --- /dev/null +++ b/test/jdk/java/lang/Object/InvalidFinalizationOption.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021, 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 8276422 + * @summary Invalid/missing values for the finalization option should be rejected + * @library /test/lib + * @run driver InvalidFinalizationOption + */ + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +public class InvalidFinalizationOption { + public static void main(String[] args) throws Exception { + record TestData(String arg, String expected) { } + + TestData[] testData = { + new TestData("--finalization", "Unrecognized option"), + new TestData("--finalization=", "Invalid finalization value"), + new TestData("--finalization=azerty", "Invalid finalization value") + }; + + for (var data : testData) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(data.arg); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain(data.expected); + output.shouldHaveExitValue(1); + } + } +} diff --git a/test/jdk/jdk/jfr/event/runtime/TestFinalizerStatisticsEvent.java b/test/jdk/jdk/jfr/event/runtime/TestFinalizerStatisticsEvent.java index ecec7c383fb..8256a62b571 100644 --- a/test/jdk/jdk/jfr/event/runtime/TestFinalizerStatisticsEvent.java +++ b/test/jdk/jdk/jfr/event/runtime/TestFinalizerStatisticsEvent.java @@ -34,17 +34,20 @@ import jdk.test.lib.jfr.TestClassLoader; /** * @test + * @bug 8266936 8276422 * @summary The test verifies that classes overriding finalize() are represented as events. * @key jfr * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -Xlog:class+unload,finalizer -Xmx16m jdk.jfr.event.runtime.TestFinalizerStatisticsEvent + * @run main/othervm -Xlog:class+unload,finalizer -Xmx16m --finalization=disabled jdk.jfr.event.runtime.TestFinalizerStatisticsEvent disabled */ public final class TestFinalizerStatisticsEvent { private final static String TEST_CLASS_NAME = "jdk.jfr.event.runtime.TestFinalizerStatisticsEvent$TestClassOverridingFinalize"; private final static String TEST_CLASS_UNLOAD_NAME = "jdk.jfr.event.runtime.TestFinalizerStatisticsEvent$TestClassUnloadOverridingFinalize"; private final static String EVENT_PATH = EventNames.FinalizerStatistics; + private static boolean disabled = false; // Declare as public static to prevent the compiler from optimizing away all unread writes public static TestClassLoader unloadableClassLoader; @@ -52,6 +55,10 @@ public final class TestFinalizerStatisticsEvent { public static Object overridingInstance; public static void main(String[] args) throws Throwable { + if (args.length > 0 && "disabled".equals(args[0])) { + disabled = true; + System.out.println("Testing with finalization disabled"); + } Recording recording1 = new Recording(); recording1.enable(EVENT_PATH); Recording recording2 = new Recording(); @@ -69,8 +76,12 @@ public final class TestFinalizerStatisticsEvent { recording1.stop(); // rotation writes an event for TEST_CLASS_NAME into recording1 which now has 4 events reflecting this test case (3 chunks + 1 unload) try { - verify(recording2); - verify(recording1); + if (disabled) { + verifyDisabled(recording1); + } else { + verifyEnabled(recording2); + verifyEnabled(recording1); + } } finally { recording2.close(); @@ -84,7 +95,8 @@ public final class TestFinalizerStatisticsEvent { System.gc(); } - private static void verify(Recording recording) throws Throwable { + /* Verify correct operation with finalization enabled */ + private static void verifyEnabled(Recording recording) throws Throwable { boolean foundTestClassName = false; boolean foundTestClassUnloadName = false; List events = Events.fromRecording(recording); @@ -108,6 +120,19 @@ public final class TestFinalizerStatisticsEvent { Asserts.assertTrue(foundTestClassUnloadName, "The class: " + TEST_CLASS_UNLOAD_NAME + " overriding finalize() is not found"); } + /* Verify no jdk.FinalizerStatistics events with finalization disabled */ + private static void verifyDisabled(Recording recording) throws Throwable { + int f10nEvents = 0; + List events = Events.fromRecording(recording); + for (RecordedEvent event : events) { + System.out.println("Event:" + event); + if ("jdk.FinalizerStatistics".equals(event.getEventType().getName())) { + f10nEvents++; + } + } + Asserts.assertEquals(f10nEvents, 0, "Finalization disabled, but recorded " + f10nEvents + " jdk.FinalizerStatistics events"); + } + static public class TestClassOverridingFinalize { public boolean finalized = false; -- GitLab From fb6d6113112d8a15864195ccd59b583fc12087fd Mon Sep 17 00:00:00 2001 From: Hamlin Li Date: Wed, 8 Dec 2021 01:26:35 +0000 Subject: [PATCH 663/890] 8278276: G1: Refine naming of G1GCParPhaseTimesTracker::_must_record Reviewed-by: sjohanss, tschatzl --- src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp | 6 +++--- src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp | 10 +++++----- src/hotspot/share/gc/g1/g1RemSet.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp b/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp index 11a62b03825..af626e99fd4 100644 --- a/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp +++ b/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -36,10 +36,10 @@ protected: G1GCPhaseTimes* _phase_times; uint _worker_id; EventGCPhaseParallel _event; - bool _must_record; + bool _allow_multiple_record; public: - G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record = true); + G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool allow_multiple_record = false); virtual ~G1GCParPhaseTimesTracker(); }; diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp index cc4a90a36f1..3495c22f841 100644 --- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp +++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp @@ -574,8 +574,8 @@ void G1EvacPhaseWithTrimTimeTracker::stop() { _stopped = true; } -G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record) : - _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id), _event(), _must_record(must_record) { +G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool allow_multiple_record) : + _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id), _event(), _allow_multiple_record(allow_multiple_record) { if (_phase_times != NULL) { _start_time = Ticks::now(); } @@ -583,10 +583,10 @@ G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() { if (_phase_times != NULL) { - if (_must_record) { - _phase_times->record_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds()); - } else { + if (_allow_multiple_record) { _phase_times->record_or_add_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds()); + } else { + _phase_times->record_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds()); } _event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_phase)); } diff --git a/src/hotspot/share/gc/g1/g1RemSet.cpp b/src/hotspot/share/gc/g1/g1RemSet.cpp index f4893300a07..26bb89f2dbb 100644 --- a/src/hotspot/share/gc/g1/g1RemSet.cpp +++ b/src/hotspot/share/gc/g1/g1RemSet.cpp @@ -1423,7 +1423,7 @@ public: // Merge remembered sets of current candidates. { - G1GCParPhaseTimesTracker x(p, merge_remset_phase, worker_id, _initial_evacuation /* must_record */); + G1GCParPhaseTimesTracker x(p, merge_remset_phase, worker_id, !_initial_evacuation /* allow_multiple_record */); G1MergeCardSetStats stats; { G1MergeCardSetClosure cl(_scan_state); -- GitLab From e7db581e9196b64ef65849e4600f17b23ca9138a Mon Sep 17 00:00:00 2001 From: Pengfei Li Date: Wed, 8 Dec 2021 04:29:23 +0000 Subject: [PATCH 664/890] 8277168: AArch64: Enable arraycopy partial inlining with SVE Reviewed-by: jbhateja, roland, aph --- src/hotspot/cpu/aarch64/aarch64.ad | 2 +- src/hotspot/cpu/aarch64/aarch64_sve.ad | 17 +++++++++++++- src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 | 17 +++++++++++++- .../cpu/aarch64/vm_version_aarch64.cpp | 8 +++++++ src/hotspot/cpu/arm/arm.ad | 2 +- src/hotspot/cpu/ppc/ppc.ad | 2 +- src/hotspot/cpu/s390/s390.ad | 2 +- src/hotspot/cpu/x86/x86.ad | 2 +- src/hotspot/share/opto/c2_globals.hpp | 2 +- src/hotspot/share/opto/library_call.cpp | 2 +- src/hotspot/share/opto/macroArrayCopy.cpp | 2 +- src/hotspot/share/opto/matcher.hpp | 2 +- src/hotspot/share/opto/type.cpp | 12 ++++++++-- src/hotspot/share/opto/type.hpp | 2 ++ src/hotspot/share/opto/vectornode.cpp | 22 ++++++++++++------- src/hotspot/share/opto/vectornode.hpp | 14 +++++------- 16 files changed, 80 insertions(+), 30 deletions(-) diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 4e6ed4832bf..970ddecf3bd 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -2481,7 +2481,7 @@ const RegMask* Matcher::predicate_reg_mask(void) { return &_PR_REG_mask; } -const TypeVect* Matcher::predicate_reg_type(const Type* elemTy, int length) { +const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) { return new TypeVectMask(elemTy, length); } diff --git a/src/hotspot/cpu/aarch64/aarch64_sve.ad b/src/hotspot/cpu/aarch64/aarch64_sve.ad index 6ad2d68526c..0d922d4c77a 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve.ad +++ b/src/hotspot/cpu/aarch64/aarch64_sve.ad @@ -5744,4 +5744,19 @@ instruct vmask_lasttrue_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr __ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg)); %} ins_pipe(pipe_slow); -%} \ No newline at end of file +%} + +// ---------------------------- Vector mask generation --------------------------- +instruct vmask_gen(pRegGov pg, iRegL len, rFlagsReg cr) %{ + predicate(UseSVE > 0); + match(Set pg (VectorMaskGen len)); + effect(KILL cr); + ins_cost(SVE_COST); + format %{ "sve_whilelo $pg, zr, $len\t # sve" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo(as_PRegister($pg$$reg), size, zr, as_Register($len$$reg)); + %} + ins_pipe(pipe_slow); +%} diff --git a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 index 65de321a6e1..10f9096b54b 100644 --- a/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 +++ b/src/hotspot/cpu/aarch64/aarch64_sve_ad.m4 @@ -3174,4 +3174,19 @@ instruct vmask_lasttrue_partial(iRegINoSp dst, pReg src, pReg ptmp, rFlagsReg cr __ sve_vmask_lasttrue($dst$$Register, bt, as_PRegister($ptmp$$reg), as_PRegister($ptmp$$reg)); %} ins_pipe(pipe_slow); -%}dnl +%} + +// ---------------------------- Vector mask generation --------------------------- +instruct vmask_gen(pRegGov pg, iRegL len, rFlagsReg cr) %{ + predicate(UseSVE > 0); + match(Set pg (VectorMaskGen len)); + effect(KILL cr); + ins_cost(SVE_COST); + format %{ "sve_whilelo $pg, zr, $len\t # sve" %} + ins_encode %{ + BasicType bt = Matcher::vector_element_basic_type(this); + Assembler::SIMD_RegVariant size = __ elemType_to_regVariant(bt); + __ sve_whilelo(as_PRegister($pg$$reg), size, zr, as_Register($len$$reg)); + %} + ins_pipe(pipe_slow); +%} diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index e08d0b6f134..4ec813df164 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -469,6 +469,14 @@ void VM_Version::initialize() { } } + int inline_size = (UseSVE > 0 && MaxVectorSize >= 16) ? MaxVectorSize : 0; + if (FLAG_IS_DEFAULT(ArrayOperationPartialInlineSize)) { + FLAG_SET_DEFAULT(ArrayOperationPartialInlineSize, inline_size); + } else if (ArrayOperationPartialInlineSize != 0 && ArrayOperationPartialInlineSize != inline_size) { + warning("Setting ArrayOperationPartialInlineSize to %d", inline_size); + ArrayOperationPartialInlineSize = inline_size; + } + if (FLAG_IS_DEFAULT(OptoScheduling)) { OptoScheduling = true; } diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad index 9e76f430054..16217afd105 100644 --- a/src/hotspot/cpu/arm/arm.ad +++ b/src/hotspot/cpu/arm/arm.ad @@ -991,7 +991,7 @@ const RegMask* Matcher::predicate_reg_mask(void) { return NULL; } -const TypeVect* Matcher::predicate_reg_type(const Type* elemTy, int length) { +const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) { return NULL; } diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 2ced017e2f4..5a712117e82 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -2185,7 +2185,7 @@ const RegMask* Matcher::predicate_reg_mask(void) { return NULL; } -const TypeVect* Matcher::predicate_reg_type(const Type* elemTy, int length) { +const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) { return NULL; } diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad index 60c27c61a51..8a6e62a809b 100644 --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -1544,7 +1544,7 @@ const RegMask* Matcher::predicate_reg_mask(void) { return NULL; } -const TypeVect* Matcher::predicate_reg_type(const Type* elemTy, int length) { +const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) { return NULL; } diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index c7e396e2637..47e898ea46b 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -2051,7 +2051,7 @@ const RegMask* Matcher::predicate_reg_mask(void) { return &_VECTMASK_REG_mask; } -const TypeVect* Matcher::predicate_reg_type(const Type* elemTy, int length) { +const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) { return new TypeVectMask(elemTy, length); } diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index b30bb4b70a4..cc6d1d762da 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -85,7 +85,7 @@ product(intx, ArrayOperationPartialInlineSize, 0, DIAGNOSTIC, \ "Partial inline size used for small array operations" \ "(e.g. copy,cmp) acceleration.") \ - range(0, 64) \ + range(0, 256) \ \ product(bool, AlignVector, true, \ "Perform vector store/load alignment in loop") \ diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 0270b1ac01a..ea56b6e01de 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -5427,7 +5427,7 @@ bool LibraryCallKit::inline_vectorizedMismatch() { Node* obja_adr_mem = memory(C->get_alias_index(obja_adr_t)); Node* objb_adr_mem = memory(C->get_alias_index(objb_adr_t)); - Node* vmask = _gvn.transform(new VectorMaskGenNode(ConvI2X(casted_length), TypeVect::VECTMASK, elem_bt)); + Node* vmask = _gvn.transform(VectorMaskGenNode::make(ConvI2X(casted_length), elem_bt)); Node* vload_obja = _gvn.transform(new LoadVectorMaskedNode(control(), obja_adr_mem, obja_adr, obja_adr_t, vt, vmask)); Node* vload_objb = _gvn.transform(new LoadVectorMaskedNode(control(), objb_adr_mem, objb_adr, objb_adr_t, vt, vmask)); Node* result = _gvn.transform(new VectorCmpMaskedNode(vload_obja, vload_objb, vmask, TypeInt::INT)); diff --git a/src/hotspot/share/opto/macroArrayCopy.cpp b/src/hotspot/share/opto/macroArrayCopy.cpp index 68f98070e76..37f2db44269 100644 --- a/src/hotspot/share/opto/macroArrayCopy.cpp +++ b/src/hotspot/share/opto/macroArrayCopy.cpp @@ -237,7 +237,7 @@ void PhaseMacroExpand::generate_partial_inlining_block(Node** ctrl, MergeMemNode inline_block = generate_guard(ctrl, bol_le, NULL, PROB_FAIR); stub_block = *ctrl; - Node* mask_gen = new VectorMaskGenNode(casted_length, TypeVect::VECTMASK, type); + Node* mask_gen = VectorMaskGenNode::make(casted_length, type); transform_later(mask_gen); unsigned vec_size = lane_count * type2aelembytes(type); diff --git a/src/hotspot/share/opto/matcher.hpp b/src/hotspot/share/opto/matcher.hpp index 446fb259ee5..c428193ff72 100644 --- a/src/hotspot/share/opto/matcher.hpp +++ b/src/hotspot/share/opto/matcher.hpp @@ -332,7 +332,7 @@ public: static const bool match_rule_supported_vector_masked(int opcode, int vlen, BasicType bt); static const RegMask* predicate_reg_mask(void); - static const TypeVect* predicate_reg_type(const Type* elemTy, int length); + static const TypeVectMask* predicate_reg_type(const Type* elemTy, int length); // Vector width in bytes static const int vector_width_in_bytes(BasicType bt); diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index 2cd8925002a..56e5c54ef18 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -2390,8 +2390,7 @@ const TypeVect *TypeVect::makemask(const Type* elem, uint length) { BasicType elem_bt = elem->array_element_basic_type(); if (Matcher::has_predicated_vectors() && Matcher::match_rule_supported_vector_masked(Op_VectorLoadMask, length, elem_bt)) { - const TypeVect* mtype = Matcher::predicate_reg_type(elem, length); - return (TypeVect*)(const_cast(mtype))->hashcons(); + return TypeVectMask::make(elem, length); } else { return make(elem, length); } @@ -2505,6 +2504,15 @@ const Type *TypeVectMask::xdual() const { return new TypeVectMask(element_type()->dual(), length()); } +const TypeVectMask *TypeVectMask::make(const BasicType elem_bt, uint length) { + return make(get_const_basic_type(elem_bt), length); +} + +const TypeVectMask *TypeVectMask::make(const Type* elem, uint length) { + const TypeVectMask* mtype = Matcher::predicate_reg_type(elem, length); + return (TypeVectMask*) const_cast(mtype)->hashcons(); +} + //============================================================================= // Convenience common pre-built types. const TypePtr *TypePtr::NULL_PTR; diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index 6a927ee49a7..754e0c0adc6 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -870,6 +870,8 @@ public: TypeVectMask(const Type* elem, uint length) : TypeVect(VectorMask, elem, length) {} virtual bool eq(const Type *t) const; virtual const Type *xdual() const; + static const TypeVectMask* make(const BasicType elem_bt, uint length); + static const TypeVectMask* make(const Type* elem, uint length); }; //------------------------------TypePtr---------------------------------------- diff --git a/src/hotspot/share/opto/vectornode.cpp b/src/hotspot/share/opto/vectornode.cpp index 3a88fb37ab0..49be2d3e7ae 100644 --- a/src/hotspot/share/opto/vectornode.cpp +++ b/src/hotspot/share/opto/vectornode.cpp @@ -801,10 +801,10 @@ Node* LoadVectorMaskedNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mask_len = in(3)->in(1); const TypeLong* ty = phase->type(mask_len)->isa_long(); if (ty && ty->is_con()) { - BasicType mask_bt = ((VectorMaskGenNode*)in(3))->get_elem_type(); - uint load_sz = type2aelembytes(mask_bt) * ty->get_con(); - if ( load_sz == 32 || load_sz == 64) { - assert(load_sz == 32 || MaxVectorSize > 32, "Unexpected load size"); + BasicType mask_bt = Matcher::vector_element_basic_type(in(3)); + int load_sz = type2aelembytes(mask_bt) * ty->get_con(); + assert(load_sz <= MaxVectorSize, "Unexpected load size"); + if (load_sz == MaxVectorSize) { Node* ctr = in(MemNode::Control); Node* mem = in(MemNode::Memory); Node* adr = in(MemNode::Address); @@ -820,10 +820,10 @@ Node* StoreVectorMaskedNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mask_len = in(4)->in(1); const TypeLong* ty = phase->type(mask_len)->isa_long(); if (ty && ty->is_con()) { - BasicType mask_bt = ((VectorMaskGenNode*)in(4))->get_elem_type(); - uint load_sz = type2aelembytes(mask_bt) * ty->get_con(); - if ( load_sz == 32 || load_sz == 64) { - assert(load_sz == 32 || MaxVectorSize > 32, "Unexpected store size"); + BasicType mask_bt = Matcher::vector_element_basic_type(in(4)); + int load_sz = type2aelembytes(mask_bt) * ty->get_con(); + assert(load_sz <= MaxVectorSize, "Unexpected store size"); + if (load_sz == MaxVectorSize) { Node* ctr = in(MemNode::Control); Node* mem = in(MemNode::Memory); Node* adr = in(MemNode::Address); @@ -1425,6 +1425,12 @@ Node* ShiftVNode::Identity(PhaseGVN* phase) { return this; } +Node* VectorMaskGenNode::make(Node* length, BasicType mask_bt) { + int max_vector = Matcher::max_vector_size(mask_bt); + const TypeVectMask* t_vmask = TypeVectMask::make(mask_bt, max_vector); + return new VectorMaskGenNode(length, t_vmask); +} + Node* VectorMaskOpNode::make(Node* mask, const Type* ty, int mopc) { switch(mopc) { case Op_VectorMaskTrueCount: diff --git a/src/hotspot/share/opto/vectornode.hpp b/src/hotspot/share/opto/vectornode.hpp index 95079919f78..fc424f59a3e 100644 --- a/src/hotspot/share/opto/vectornode.hpp +++ b/src/hotspot/share/opto/vectornode.hpp @@ -919,23 +919,19 @@ class VectorCmpMaskedNode : public TypeNode { virtual int Opcode() const; }; +//------------------------------VectorMaskGenNode---------------------------------- class VectorMaskGenNode : public TypeNode { public: - VectorMaskGenNode(Node* length, const Type* ty, BasicType ety): TypeNode(ty, 2), _elemType(ety) { + VectorMaskGenNode(Node* length, const Type* ty): TypeNode(ty, 2) { init_req(1, length); } virtual int Opcode() const; - BasicType get_elem_type() { return _elemType;} - virtual uint size_of() const { return sizeof(VectorMaskGenNode); } - virtual uint ideal_reg() const { - return Op_RegVectMask; - } - - private: - BasicType _elemType; + virtual uint ideal_reg() const { return Op_RegVectMask; } + static Node* make(Node* length, BasicType vmask_bt); }; +//------------------------------VectorMaskOpNode----------------------------------- class VectorMaskOpNode : public TypeNode { public: VectorMaskOpNode(Node* mask, const Type* ty, int mopc): -- GitLab From 5266e7d780efee11309260ce96ae0c5b4836effb Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Wed, 8 Dec 2021 06:45:01 +0000 Subject: [PATCH 665/890] 8278379: Zero VM is broken due to UseRTMForStackLocks was not declared after JDK-8276901 Reviewed-by: dholmes, shade --- src/hotspot/share/runtime/arguments.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 8b32e89e834..adfe1a1fb6a 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -2027,7 +2027,7 @@ bool Arguments::check_vm_args_consistency() { warning("UseHeavyMonitors is not fully implemented on this architecture"); } #endif -#if defined(X86) || defined(PPC64) +#if (defined(X86) || defined(PPC64)) && !defined(ZERO) if (UseHeavyMonitors && UseRTMForStackLocks) { fatal("-XX:+UseHeavyMonitors and -XX:+UseRTMForStackLocks are mutually exclusive"); } -- GitLab From 30f0c6475359516ce454722f06ac0c997e09868b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 8 Dec 2021 06:52:16 +0000 Subject: [PATCH 666/890] 8277992: Add fast jdk_svc subtests to jdk:tier3 Reviewed-by: mseledtsov, alanb --- test/jdk/TEST.groups | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups index 3f8f683af09..00b06cae87b 100644 --- a/test/jdk/TEST.groups +++ b/test/jdk/TEST.groups @@ -74,7 +74,9 @@ tier3 = \ :build \ :jdk_vector \ :jdk_rmi \ - :jdk_jfr_tier3 + :jdk_svc \ + -:jdk_svc_sanity \ + -:svc_tools # Everything not in other tiers tier4 = \ @@ -283,9 +285,6 @@ jdk_tools = \ jdk_jfr = \ jdk/jfr -jdk_jfr_tier3 = \ - jdk/jfr/event/metadata/TestLookForUntestedEvents.java - # # Catch-all for other areas with a small number of tests # -- GitLab From b334d9680b2ee796d5058d68881215bb11499aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Wed, 8 Dec 2021 07:07:57 +0000 Subject: [PATCH 667/890] 8276964: Better indicate a snippet that could not be processed Reviewed-by: jjg --- .../formats/html/HtmlDocletWriter.java | 35 +- .../formats/html/TagletWriterImpl.java | 9 + .../formats/html/markup/HtmlStyle.java | 5 + .../doclets/formats/html/markup/TagName.java | 2 + .../html/resources/standard.properties | 1 + .../doclets/toolkit/resources/stylesheet.css | 14 +- .../toolkit/taglets/SnippetTaglet.java | 12 +- .../doclets/toolkit/taglets/TagletWriter.java | 12 + .../TestGenericTypeLink.java | 42 ++- .../doclet/testInherited/TestInherited.java | 36 ++- .../TestNonInlineHtmlTagRemoval.java | 2 +- .../javadoc/doclet/testSeeTag/TestSeeTag.java | 7 +- .../doclet/testSnippetTag/TestSnippetTag.java | 303 +++++++++++------- 13 files changed, 329 insertions(+), 151 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index cf9c43264c1..1a735412886 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -36,6 +36,7 @@ import java.util.ListIterator; import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -1063,7 +1064,8 @@ public class HtmlDocletWriter { "doclet.see.class_or_package_not_found", "@" + tagName, seeText); - return (labelContent.isEmpty() ? text: labelContent); + return invalidTagOutput(resources.getText("doclet.tag.invalid", tagName), + Optional.of(labelContent.isEmpty() ? text: labelContent)); } } } else if (refMemName == null) { @@ -1614,13 +1616,18 @@ public class HtmlDocletWriter { DocTreePath dtp = ch.getDocTreePath(node); if (dtp != null) { String body = node.getBody(); - if (body.matches("(?i)\\{@[a-z]+.*")) { - messages.warning(dtp,"doclet.tag.invalid_usage", body); - } else { + Matcher m = Pattern.compile("(?i)\\{@([a-z]+).*").matcher(body); + String tagName = m.matches() ? m.group(1) : null; + if (tagName == null) { messages.warning(dtp, "doclet.tag.invalid_input", body); + result.add(invalidTagOutput(resources.getText("doclet.tag.invalid_input", body), + Optional.empty())); + } else { + messages.warning(dtp, "doclet.tag.invalid_usage", body); + result.add(invalidTagOutput(resources.getText("doclet.tag.invalid", tagName), + Optional.of(Text.of(body)))); } } - result.add(Text.of(node.toString())); return false; } @@ -1774,6 +1781,24 @@ public class HtmlDocletWriter { && currentPageElement != utils.getEnclosingTypeElement(element)); } + /** + * Returns the output for an invalid tag. The returned content uses special styling to + * highlight the problem. Depending on the presence of the {@code detail} string the method + * returns a plain text span or an expandable component. + * + * @param summary the single-line summary message + * @param detail the optional detail message which may contain preformatted text + * @return the output + */ + protected Content invalidTagOutput(String summary, Optional detail) { + if (detail.isEmpty() || detail.get().isEmpty()) { + return HtmlTree.SPAN(HtmlStyle.invalidTag, Text.of(summary)); + } + return new HtmlTree(TagName.DETAILS).addStyle(HtmlStyle.invalidTag) + .add(new HtmlTree(TagName.SUMMARY).add(Text.of(summary))) + .add(new HtmlTree(TagName.PRE).add(detail.get())); + } + /** * Returns true if element lives in the same package as the type or package * element of this writer. diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java index 640786dd4eb..576597ae86e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.HashSet; import java.util.List; +import java.util.Optional; import java.util.Set; import javax.lang.model.element.Element; @@ -536,6 +537,14 @@ public class TagletWriterImpl extends TagletWriter { : Text.of(constantVal); } + @Override + protected Content invalidTagOutput(String summary, Optional detail) { + return htmlWriter.invalidTagOutput(summary, + detail.isEmpty() || detail.get().isEmpty() + ? Optional.empty() + : Optional.of(Text.of(utils.normalizeNewlines(detail.get())))); + } + @Override public Content commentTagsToOutput(DocTree holder, List tags) { return commentTagsToOutput(null, holder, tags, false); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java index 1d22926b816..ad74b81eee5 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java @@ -907,6 +907,11 @@ public enum HtmlStyle { */ inheritedList, + /** + * The class of an element that acts as a notification for an invalid tag. + */ + invalidTag, + /** * The class of a {@code p} element containing legal copy in the page footer. */ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/TagName.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/TagName.java index 34655300b30..59aad16bf2d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/TagName.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/TagName.java @@ -47,6 +47,7 @@ public enum TagName { CAPTION, CODE, DD, + DETAILS, DIV, DL, DT, @@ -83,6 +84,7 @@ public enum TagName { SPAN, STRONG, SUB, + SUMMARY, SUP, TABLE, TBODY, diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index f491b97adfe..8a511b8ca4f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -106,6 +106,7 @@ doclet.see.class_or_package_not_accessible=Tag {0}: reference not accessible: {1 doclet.see.nested_link=Tag {0}: nested link doclet.tag.invalid_usage=invalid usage of tag {0} doclet.tag.invalid_input=invalid input: ''{0}'' +doclet.tag.invalid=invalid @{0} doclet.Deprecated_API=Deprecated API doclet.Deprecated_Elements=Deprecated {0} doclet.Deprecated_In_Release=Deprecated in {0} diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index d61caef2a0e..69252eab283 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -555,6 +555,18 @@ div.block { div.block div.deprecation-comment { font-style:normal; } +details.invalid-tag, span.invalid-tag { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + background: #ffe6e6; + border: thin solid #000000; + border-radius:2px; + padding: 2px 4px; + display:inline-block; +} +details.invalid-tag summary { + cursor: pointer; +} /* * Styles specific to HTML5 elements. */ @@ -991,11 +1003,9 @@ button.snippet-copy:active { pre.snippet .italic { font-style: italic; } - pre.snippet .bold { font-weight: bold; } - pre.snippet .highlighted { background-color: #f7c590; border-radius: 10%; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java index 0f40ab1e297..3c13b194c22 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/SnippetTaglet.java @@ -120,7 +120,8 @@ public class SnippetTaglet extends BaseTaglet { return generateContent(holder, tag, writer); } catch (BadSnippetException e) { error(writer, holder, e.tag(), e.key(), e.args()); - return badSnippet(writer); + String details = writer.configuration().getDocResources().getText(e.key(), e.args()); + return badSnippet(writer, Optional.of(details)); } } @@ -286,7 +287,7 @@ public class SnippetTaglet extends BaseTaglet { .getText("doclet.snippet.markup", e.getMessage()); writer.configuration().getReporter().print(Diagnostic.Kind.ERROR, path, e.getPosition(), e.getPosition(), e.getPosition(), msg); - return badSnippet(writer); + return badSnippet(writer, Optional.of(e.getMessage())); } try { @@ -299,7 +300,7 @@ public class SnippetTaglet extends BaseTaglet { assert fileObject != null; writer.configuration().getMessages().error(fileObject, e.getPosition(), e.getPosition(), e.getPosition(), "doclet.snippet.markup", e.getMessage()); - return badSnippet(writer); + return badSnippet(writer, Optional.of(e.getMessage())); } // the region must be matched at least in one content: it can be matched @@ -408,8 +409,9 @@ public class SnippetTaglet extends BaseTaglet { writer.configuration().utils.getCommentHelper(holder).getDocTreePath(tag), key, args); } - private Content badSnippet(TagletWriter writer) { - return writer.getOutputInstance().add("bad snippet"); + private Content badSnippet(TagletWriter writer, Optional details) { + Resources resources = writer.configuration().getDocResources(); + return writer.invalidTagOutput(resources.getText("doclet.tag.invalid", "snippet"), details); } private String packageName(PackageElement pkg, Utils utils) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java index a12c7b42ffd..b9142d6721a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/TagletWriter.java @@ -27,6 +27,7 @@ package jdk.javadoc.internal.doclets.toolkit.taglets; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; @@ -239,6 +240,17 @@ public abstract class TagletWriter { protected abstract Content valueTagOutput(VariableElement field, String constantVal, boolean includeLink); + /** + * Returns the output for an invalid tag. The returned content uses special styling to + * highlight the problem. Depending on the presence of the {@code detail} string the method + * returns a plain text span or an expandable component. + * + * @param summary the single-line summary message + * @param detail the optional detail message which may contain preformatted text + * @return the output + */ + protected abstract Content invalidTagOutput(String summary, Optional detail); + /** * Returns the main type element of the current page or null for pages that don't have one. * diff --git a/test/langtools/jdk/javadoc/doclet/testGenericTypeLink/TestGenericTypeLink.java b/test/langtools/jdk/javadoc/doclet/testGenericTypeLink/TestGenericTypeLink.java index fbfbb5f3978..1f0ea233288 100644 --- a/test/langtools/jdk/javadoc/doclet/testGenericTypeLink/TestGenericTypeLink.java +++ b/test/langtools/jdk/javadoc/doclet/testGenericTypeLink/TestGenericTypeLink.java @@ -166,18 +166,48 @@ public class TestGenericTypeLink extends JavadocTester { checkExit(Exit.ERROR); checkOutput("pkg2/B.html", true, """ -
      java.util.Foo<String> - Baz<Object> - #b(List<Integer>)
      """, +
      +
      + invalid @link +
      java.util.Foo<String>
      +
      + + \s +
      + invalid @linkplain +
      Baz<Object>
      +
      + + \s +
      + invalid @link +
      #b(List<Integer>)
      +
      +
      """, """
      See Also:
        -
      • java.util.List<Bar>
      • -
      • Baz<Object, String>
      • -
      • B#b(List<Baz>)
      • +
      • +
        + invalid @see +
        java.util.List<Bar>
        +
        +
      • +
      • +
        + invalid @see +
        Baz<Object, String>
        +
        +
      • +
      • +
        + invalid @see +
        B#b(List<Baz>)
        +
        +
      """); diff --git a/test/langtools/jdk/javadoc/doclet/testInherited/TestInherited.java b/test/langtools/jdk/javadoc/doclet/testInherited/TestInherited.java index 21391201a03..0806278b43d 100644 --- a/test/langtools/jdk/javadoc/doclet/testInherited/TestInherited.java +++ b/test/langtools/jdk/javadoc/doclet/testInherited/TestInherited.java @@ -69,11 +69,11 @@ public class TestInherited extends JavadocTester { checkExit(Exit.OK); checkOutput("BadParam.Base.html", true, """
      Parameters:
      -
      i - a < b
      +
      i - a invalid input: '<' b
      """); checkOutput("BadParam.Sub.html", true, """
      Parameters:
      -
      i - a < b
      +
      i - a invalid input: '<' b
      """); } @@ -101,11 +101,11 @@ public class TestInherited extends JavadocTester { checkExit(Exit.OK); checkOutput("BadReturn.Base.html", true, """
      Returns:
      -
      a < b
      +
      a invalid input: '<' b
      """); checkOutput("BadReturn.Sub.html", true, """
      Returns:
      -
      a < b
      +
      a invalid input: '<' b
      """); } @@ -147,16 +147,36 @@ public class TestInherited extends JavadocTester { src.resolve("BadReference.java").toString()); checkExit(Exit.OK); checkOutput("BadReference.Intf.html", true, """ -
      NonExistingClass
      +
      +
      + invalid @link +
      NonExistingClass
      +
      +
      """); checkOutput("BadReference.Impl1.html", true, """ -
      NonExistingClass
      +
      +
      + invalid @link +
      NonExistingClass
      +
      +
      """); checkOutput("BadReference.Impl2.html", true, """ -
      NonExistingClass
      +
      +
      + invalid @link +
      NonExistingClass
      +
      +
      """); checkOutput("BadReference.Impl3.html", true, """ -
      NonExistingClass
      +
      +
      + invalid @link +
      NonExistingClass
      +
      +
      """); } } diff --git a/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java b/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java index 35a25e29bf2..b0b54bbdd6c 100644 --- a/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java +++ b/test/langtools/jdk/javadoc/doclet/testNonInlineHtmlTagRemoval/TestNonInlineHtmlTagRemoval.java @@ -85,6 +85,6 @@ public class TestNonInlineHtmlTagRemoval extends JavadocTester { checkOutput("Negative.html", true, """ -
      case1: A hanging < : xx<
      """); +
      case1: A hanging < : xxinvalid input: '<'
      """); } } diff --git a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java index f364cd47ef7..b6661acae52 100644 --- a/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSeeTag/TestSeeTag.java @@ -100,7 +100,12 @@ public class TestSeeTag extends JavadocTester {
      • Object
      • -
      • Foo<String>
      • +
      • +
        + invalid @see +
        Foo<String>
        +
        +
      """); diff --git a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java index fac9dfef6e1..4b0dd06a2a2 100644 --- a/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java +++ b/test/langtools/jdk/javadoc/doclet/testSnippetTag/TestSnippetTag.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8266666 8275788 + * @bug 8266666 8275788 8276964 * @summary Implementation for snippets * @library /tools/lib ../../lib * @modules jdk.compiler/com.sun.tools.javac.api @@ -1080,6 +1080,12 @@ public class TestSnippetTag extends SnippetTester { checkOutput(Output.OUT, true, """ A.java:4: error: File not found: %s""".formatted(fileName)); + checkOutput("pkg/A.html", true, """ +
      + invalid @snippet +
      File not found: text.txt
      +
      + """); checkNoCrashes(); } @@ -1155,6 +1161,12 @@ public class TestSnippetTag extends SnippetTester { checkOutput(Output.OUT, true, """ A.java:3: error: @snippet does not specify contents"""); + checkOutput("pkg/A.html", true, """ +
      + invalid @snippet +
      @snippet does not specify contents
      +
      + """); checkNoCrashes(); } @@ -1211,6 +1223,12 @@ public class TestSnippetTag extends SnippetTester { checkOutput(Output.OUT, true, """ A.java:3: error: @snippet specifies multiple external contents, which is ambiguous"""); + checkOutput("pkg/A.html", true, """ +
      + invalid @snippet +
      @snippet specifies multiple external contents, which is ambiguous
      +
      + """); checkNoCrashes(); } @@ -1863,15 +1881,15 @@ public class TestSnippetTag extends SnippetTester { for (String attrName : List.of("class", "file", "id", "lang", "region")) { // special case: valueless region attribute TestCase t = new TestCase(""" -{@snippet %s: - First line - Second line -} -""".formatted(attrName), -""" -: error: missing value for attribute "%s" -{@snippet %s: - ^""".formatted(attrName, attrName)); + {@snippet %s: + First line + Second line + } + """.formatted(attrName), + """ + : error: missing value for attribute "%s" + {@snippet %s: + ^""".formatted(attrName, attrName)); testCases.add(t); } @@ -1915,15 +1933,18 @@ public class TestSnippetTag extends SnippetTester { for (String quote : List.of("", "'", "\"")) for (String value : List.of("", " ")) { var t = new TestCase(""" -{@snippet region=%s%s%s: - First line - Second line -} -""".formatted(quote, value, quote), - """ -: error: illegal value for attribute "region": "%s" -{@snippet region=%s%s%s: - ^""".formatted(quote.isEmpty() ? "" : value, quote, value, quote)); // unquoted whitespace translates to empty string + {@snippet region=%s%s%s: + First line + Second line + } + """.formatted(quote, value, quote), + """ + : error: illegal value for attribute "region": "%s" + {@snippet region=%s%s%s: + ^ + """.formatted( + quote.isEmpty() ? "" : value, // unquoted whitespace translates to empty string + quote, value, quote)); testCases.add(t); } @@ -2015,6 +2036,17 @@ public class TestSnippetTag extends SnippetTester { checkOutput(Output.OUT, true, """ A.java:4: error: contents mismatch"""); + checkOutput("pkg/A.html", true, """ +
      + invalid @snippet +
      contents mismatch:
      +                        ----------------- inline -------------------
      +                        Hello, Snippet!
      +                        ----------------- external -----------------
      +                        Hello, Snippet!...more
      +                        
      +
      + """); checkNoCrashes(); } @@ -2055,6 +2087,19 @@ public class TestSnippetTag extends SnippetTester { checkOutput(Output.OUT, true, """ A.java:4: error: contents mismatch"""); + checkOutput("pkg/A.html", true, """ +
      + invalid @snippet +
      contents mismatch:
      +                        ----------------- inline -------------------
      +                        Hello, Snippet! ...more
      +
      +                        ----------------- external -----------------
      +                        Hello, Snippet!
      +
      +                        
      +
      + """); checkNoCrashes(); } @@ -2278,41 +2323,41 @@ public class TestSnippetTag extends SnippetTester { final var testCases = List.of( new TestCase(""" -{@snippet : -hello there // @highlight regex ="\t**" -}""", + {@snippet : + hello there // @highlight regex ="\t**" + }""", """ -error: snippet markup: invalid regex -hello there // @highlight regex ="\t**" - \t ^ -"""), + error: snippet markup: invalid regex + hello there // @highlight regex ="\t**" + \t ^ + """), new TestCase(""" -{@snippet : -hello there // @highlight regex ="\\t**" -}""", + {@snippet : + hello there // @highlight regex ="\\t**" + }""", """ -error: snippet markup: invalid regex -hello there // @highlight regex ="\\t**" - ^ -"""), + error: snippet markup: invalid regex + hello there // @highlight regex ="\\t**" + ^ + """), new TestCase(""" -{@snippet : -hello there // @highlight regex="\\.\\*\\+\\E" -}""", + {@snippet : + hello there // @highlight regex="\\.\\*\\+\\E" + }""", """ -error: snippet markup: invalid regex -hello there // @highlight regex="\\.\\*\\+\\E" - \s\s\s\s ^ -"""), // use \s to counteract shift introduced by \\ so as to visually align ^ right below E + error: snippet markup: invalid regex + hello there // @highlight regex="\\.\\*\\+\\E" + \s\s\s\s ^ + """), // use \s to counteract shift introduced by \\ so as to visually align ^ right below E new TestCase(""" -{@snippet : -hello there // @highlight type="italics" regex =" [" -}""", + {@snippet : + hello there // @highlight type="italics" regex =" [" + }""", """ -error: snippet markup: invalid regex -hello there // @highlight type="italics" regex =" [" - ^ -""") + error: snippet markup: invalid regex + hello there // @highlight type="italics" regex =" [" + ^ + """) ); List inputs = testCases.stream().map(s -> s.input).toList(); @@ -2342,6 +2387,12 @@ hello there // @highlight type="italics" regex =" [" src.resolve("A.java").toString()); checkExit(Exit.ERROR); checkOrder(Output.OUT, testCases.stream().map(TestCase::expectedError).toArray(String[]::new)); + checkOutput("A.html", true, """ +
      + invalid @snippet +
      invalid regex
      +
      + """); checkNoCrashes(); } @@ -2352,118 +2403,118 @@ hello there // @highlight type="italics" regex =" [" final var testCases = List.of( new TestCase(""" -{@snippet : - hello // @link -}""", + {@snippet : + hello // @link + }""", """ -error: snippet markup: missing attribute "target" - hello // @link - ^ + error: snippet markup: missing attribute "target" + hello // @link + ^ """), new TestCase(""" -{@snippet : - hello // @start -}""", + {@snippet : + hello // @start + }""", """ -error: snippet markup: missing attribute "region" - hello // @start - ^ + error: snippet markup: missing attribute "region" + hello // @start + ^ """), new TestCase(""" -{@snippet : - hello // @replace -}""", + {@snippet : + hello // @replace + }""", """ -error: snippet markup: missing attribute "replacement" - hello // @replace - ^ + error: snippet markup: missing attribute "replacement" + hello // @replace + ^ """), /* ---------------------- */ new TestCase(""" -{@snippet : - hello // @highlight regex=\\w+ substring=hello -}""", + {@snippet : + hello // @highlight regex=\\w+ substring=hello + }""", """ -error: snippet markup: attributes "substring" and "regex" used simultaneously - hello // @highlight regex=\\w+ substring=hello - ^ + error: snippet markup: attributes "substring" and "regex" used simultaneously + hello // @highlight regex=\\w+ substring=hello + ^ """), new TestCase(""" -{@snippet : - hello // @start region="x" name="here" -}""", + {@snippet : + hello // @start region="x" name="here" + }""", """ -error: snippet markup: unexpected attribute - hello // @start region="x" name="here" - ^ + error: snippet markup: unexpected attribute + hello // @start region="x" name="here" + ^ """), new TestCase(""" -{@snippet : - hello // @start region="" -}""", + {@snippet : + hello // @start region="" + }""", """ -error: snippet markup: invalid attribute value - hello // @start region="" - ^ + error: snippet markup: invalid attribute value + hello // @start region="" + ^ """), new TestCase(""" -{@snippet : - hello // @link target="Object#equals()" type=fluffy -}""", + {@snippet : + hello // @link target="Object#equals()" type=fluffy + }""", """ -error: snippet markup: invalid attribute value - hello // @link target="Object#equals()" type=fluffy - ^ + error: snippet markup: invalid attribute value + hello // @link target="Object#equals()" type=fluffy + ^ """), /* ---------------------- */ new TestCase(""" -{@snippet : - hello - there // @highlight substring=" -}""", + {@snippet : + hello + there // @highlight substring=" + }""", """ -error: snippet markup: unterminated attribute value - there // @highlight substring=" - ^ + error: snippet markup: unterminated attribute value + there // @highlight substring=" + ^ """), new TestCase(""" -{@snippet : - hello // @start region="this" - world // @start region="this" - ! // @end -}""", + {@snippet : + hello // @start region="this" + world // @start region="this" + ! // @end + }""", """ -error: snippet markup: duplicated region - world // @start region="this" - ^ + error: snippet markup: duplicated region + world // @start region="this" + ^ """), new TestCase(""" -{@snippet : - hello // @end -}""", + {@snippet : + hello // @end + }""", """ -error: snippet markup: no region to end - hello // @end - ^ + error: snippet markup: no region to end + hello // @end + ^ """), new TestCase(""" -{@snippet : - hello // @start region=this -}""", + {@snippet : + hello // @start region=this + }""", """ -error: snippet markup: unpaired region - hello // @start region=this - ^ + error: snippet markup: unpaired region + hello // @start region=this + ^ """), new TestCase(""" -{@snippet : - hello // @highlight substring="hello" : -}""", + {@snippet : + hello // @highlight substring="hello" : + }""", """ -error: snippet markup: tag refers to non-existent lines - hello // @highlight substring="hello" : - ^ - """) + error: snippet markup: tag refers to non-existent lines + hello // @highlight substring="hello" : + ^ + """) ); List inputs = testCases.stream().map(s -> s.input).toList(); StringBuilder methods = new StringBuilder(); @@ -2493,6 +2544,12 @@ error: snippet markup: tag refers to non-existent lines checkExit(Exit.ERROR); // use the facility from JDK-8273154 when it becomes available checkOutput(Output.OUT, true, testCases.stream().map(TestCase::expectedError).toArray(String[]::new)); + checkOutput("A.html", true, """ +
      + invalid @snippet +
      missing attribute "target"
      +
      + """); checkNoCrashes(); } } -- GitLab From 5dcdee4bcd337591c79aad8620a7f38345e6e3d9 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 8 Dec 2021 07:55:12 +0000 Subject: [PATCH 668/890] 8262341: Refine identical code in AddI/LNode. Reviewed-by: thartmann, eliu --- src/hotspot/share/opto/addnode.cpp | 261 +++++++---------------- src/hotspot/share/opto/addnode.hpp | 21 +- src/hotspot/share/opto/castnode.hpp | 13 +- src/hotspot/share/opto/cfgnode.cpp | 2 +- src/hotspot/share/opto/loopPredicate.cpp | 2 +- src/hotspot/share/opto/loopTransform.cpp | 9 +- src/hotspot/share/opto/loopnode.cpp | 12 +- src/hotspot/share/opto/loopnode.hpp | 30 +-- src/hotspot/share/opto/mulnode.cpp | 13 ++ src/hotspot/share/opto/mulnode.hpp | 27 +-- src/hotspot/share/opto/node.hpp | 41 +++- src/hotspot/share/opto/subnode.hpp | 32 --- src/hotspot/share/opto/type.cpp | 24 +++ src/hotspot/share/opto/type.hpp | 12 +- 14 files changed, 185 insertions(+), 314 deletions(-) diff --git a/src/hotspot/share/opto/addnode.cpp b/src/hotspot/share/opto/addnode.cpp index 598deb08ffa..7c27e5c4724 100644 --- a/src/hotspot/share/opto/addnode.cpp +++ b/src/hotspot/share/opto/addnode.cpp @@ -263,66 +263,69 @@ AddNode* AddNode::make(Node* in1, Node* in2, BasicType bt) { //============================================================================= //------------------------------Idealize--------------------------------------- -Node *AddINode::Ideal(PhaseGVN *phase, bool can_reshape) { +Node* AddNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) { Node* in1 = in(1); Node* in2 = in(2); int op1 = in1->Opcode(); int op2 = in2->Opcode(); // Fold (con1-x)+con2 into (con1+con2)-x - if ( op1 == Op_AddI && op2 == Op_SubI ) { + if (op1 == Op_Add(bt) && op2 == Op_Sub(bt)) { // Swap edges to try optimizations below in1 = in2; in2 = in(1); op1 = op2; op2 = in2->Opcode(); } - if( op1 == Op_SubI ) { - const Type *t_sub1 = phase->type( in1->in(1) ); - const Type *t_2 = phase->type( in2 ); - if( t_sub1->singleton() && t_2->singleton() && t_sub1 != Type::TOP && t_2 != Type::TOP ) - return new SubINode(phase->makecon( add_ring( t_sub1, t_2 ) ), in1->in(2) ); + if (op1 == Op_Sub(bt)) { + const Type* t_sub1 = phase->type(in1->in(1)); + const Type* t_2 = phase->type(in2 ); + if (t_sub1->singleton() && t_2->singleton() && t_sub1 != Type::TOP && t_2 != Type::TOP) { + return SubNode::make(phase->makecon(add_ring(t_sub1, t_2)), in1->in(2), bt); + } // Convert "(a-b)+(c-d)" into "(a+c)-(b+d)" - if( op2 == Op_SubI ) { + if (op2 == Op_Sub(bt)) { // Check for dead cycle: d = (a-b)+(c-d) assert( in1->in(2) != this && in2->in(2) != this, "dead loop in AddINode::Ideal" ); - Node *sub = new SubINode(NULL, NULL); - sub->init_req(1, phase->transform(new AddINode(in1->in(1), in2->in(1) ) )); - sub->init_req(2, phase->transform(new AddINode(in1->in(2), in2->in(2) ) )); + Node* sub = SubNode::make(NULL, NULL, bt); + sub->init_req(1, phase->transform(AddNode::make(in1->in(1), in2->in(1), bt))); + sub->init_req(2, phase->transform(AddNode::make(in1->in(2), in2->in(2), bt))); return sub; } // Convert "(a-b)+(b+c)" into "(a+c)" - if( op2 == Op_AddI && in1->in(2) == in2->in(1) ) { - assert(in1->in(1) != this && in2->in(2) != this,"dead loop in AddINode::Ideal"); - return new AddINode(in1->in(1), in2->in(2)); + if (op2 == Op_Add(bt) && in1->in(2) == in2->in(1)) { + assert(in1->in(1) != this && in2->in(2) != this,"dead loop in AddINode::Ideal/AddLNode::Ideal"); + return AddNode::make(in1->in(1), in2->in(2), bt); } // Convert "(a-b)+(c+b)" into "(a+c)" - if( op2 == Op_AddI && in1->in(2) == in2->in(2) ) { - assert(in1->in(1) != this && in2->in(1) != this,"dead loop in AddINode::Ideal"); - return new AddINode(in1->in(1), in2->in(1)); + if (op2 == Op_Add(bt) && in1->in(2) == in2->in(2)) { + assert(in1->in(1) != this && in2->in(1) != this,"dead loop in AddINode::Ideal/AddLNode::Ideal"); + return AddNode::make(in1->in(1), in2->in(1), bt); } // Convert "(a-b)+(b-c)" into "(a-c)" - if( op2 == Op_SubI && in1->in(2) == in2->in(1) ) { - assert(in1->in(1) != this && in2->in(2) != this,"dead loop in AddINode::Ideal"); - return new SubINode(in1->in(1), in2->in(2)); + if (op2 == Op_Sub(bt) && in1->in(2) == in2->in(1)) { + assert(in1->in(1) != this && in2->in(2) != this,"dead loop in AddINode::Ideal/AddLNode::Ideal"); + return SubNode::make(in1->in(1), in2->in(2), bt); } // Convert "(a-b)+(c-a)" into "(c-b)" - if( op2 == Op_SubI && in1->in(1) == in2->in(2) ) { - assert(in1->in(2) != this && in2->in(1) != this,"dead loop in AddINode::Ideal"); - return new SubINode(in2->in(1), in1->in(2)); + if (op2 == Op_Sub(bt) && in1->in(1) == in2->in(2)) { + assert(in1->in(2) != this && in2->in(1) != this,"dead loop in AddINode::Ideal/AddLNode::Ideal"); + return SubNode::make(in2->in(1), in1->in(2), bt); } } // Convert "x+(0-y)" into "(x-y)" - if( op2 == Op_SubI && phase->type(in2->in(1)) == TypeInt::ZERO ) - return new SubINode(in1, in2->in(2) ); + if (op2 == Op_Sub(bt) && phase->type(in2->in(1)) == TypeInteger::zero(bt)) { + return SubNode::make(in1, in2->in(2), bt); + } // Convert "(0-y)+x" into "(x-y)" - if( op1 == Op_SubI && phase->type(in1->in(1)) == TypeInt::ZERO ) - return new SubINode( in2, in1->in(2) ); + if (op1 == Op_Sub(bt) && phase->type(in1->in(1)) == TypeInteger::zero(bt)) { + return SubNode::make(in2, in1->in(2), bt); + } // Associative - if (op1 == Op_MulI && op2 == Op_MulI) { + if (op1 == Op_Mul(bt) && op2 == Op_Mul(bt)) { Node* add_in1 = NULL; Node* add_in2 = NULL; Node* mul_in = NULL; @@ -350,49 +353,26 @@ Node *AddINode::Ideal(PhaseGVN *phase, bool can_reshape) { } if (mul_in != NULL) { - Node* add = phase->transform(new AddINode(add_in1, add_in2)); - return new MulINode(mul_in, add); - } - } - - // Convert (x>>>z)+y into (x+(y<>>z for small constant z and y. - // Helps with array allocation math constant folding - // See 4790063: - // Unrestricted transformation is unsafe for some runtime values of 'x' - // ( x == 0, z == 1, y == -1 ) fails - // ( x == -5, z == 1, y == 1 ) fails - // Transform works for small z and small negative y when the addition - // (x + (y << z)) does not cross zero. - // Implement support for negative y and (x >= -(y << z)) - // Have not observed cases where type information exists to support - // positive y and (x <= -(y << z)) - if( op1 == Op_URShiftI && op2 == Op_ConI && - in1->in(2)->Opcode() == Op_ConI ) { - jint z = phase->type( in1->in(2) )->is_int()->get_con() & 0x1f; // only least significant 5 bits matter - jint y = phase->type( in2 )->is_int()->get_con(); - - if( z < 5 && -5 < y && y < 0 ) { - const Type *t_in11 = phase->type(in1->in(1)); - if( t_in11 != Type::TOP && (t_in11->is_int()->_lo >= -(y << z)) ) { - Node *a = phase->transform( new AddINode( in1->in(1), phase->intcon(y<in(2) ); - } + Node* add = phase->transform(AddNode::make(add_in1, add_in2, bt)); + return MulNode::make(mul_in, add, bt); } } // Convert (x >>> rshift) + (x << lshift) into RotateRight(x, rshift) if (Matcher::match_rule_supported(Op_RotateRight) && - ((op1 == Op_URShiftI && op2 == Op_LShiftI) || (op1 == Op_LShiftI && op2 == Op_URShiftI)) && + ((op1 == Op_URShift(bt) && op2 == Op_LShift(bt)) || (op1 == Op_LShift(bt) && op2 == Op_URShift(bt))) && in1->in(1) != NULL && in1->in(1) == in2->in(1)) { - Node* rshift = op1 == Op_URShiftI ? in1->in(2) : in2->in(2); - Node* lshift = op1 == Op_URShiftI ? in2->in(2) : in1->in(2); + Node* rshift = op1 == Op_URShift(bt) ? in1->in(2) : in2->in(2); + Node* lshift = op1 == Op_URShift(bt) ? in2->in(2) : in1->in(2); if (rshift != NULL && lshift != NULL) { const TypeInt* rshift_t = phase->type(rshift)->isa_int(); const TypeInt* lshift_t = phase->type(lshift)->isa_int(); + int bits = bt == T_INT ? 32 : 64; + int mask = bt == T_INT ? 0x1F : 0x3F; if (lshift_t != NULL && lshift_t->is_con() && rshift_t != NULL && rshift_t->is_con() && - ((lshift_t->get_con() & 0x1F) == (32 - (rshift_t->get_con() & 0x1F)))) { - return new RotateRightNode(in1->in(1), phase->intcon(rshift_t->get_con() & 0x1F), TypeInt::INT); + ((lshift_t->get_con() & mask) == (bits - (rshift_t->get_con() & mask)))) { + return new RotateRightNode(in1->in(1), phase->intcon(rshift_t->get_con() & mask), TypeInteger::bottom(bt)); } } } @@ -400,14 +380,49 @@ Node *AddINode::Ideal(PhaseGVN *phase, bool can_reshape) { // Convert (~x+1) into -x. Note there isn't a bitwise not bytecode, // "~x" would typically represented as "x^(-1)", so (~x+1) will // be (x^(-1))+1. - if (op1 == Op_XorI && phase->type(in2) == TypeInt::ONE && - phase->type(in1->in(2)) == TypeInt::MINUS_1) { - return new SubINode(phase->makecon(TypeInt::ZERO), in1->in(1)); + if (op1 == Op_Xor(bt) && phase->type(in2) == TypeInteger::one(bt) && + phase->type(in1->in(2)) == TypeInteger::minus_1(bt)) { + return SubNode::make(phase->makecon(TypeInteger::zero(bt)), in1->in(1), bt); } return AddNode::Ideal(phase, can_reshape); } +Node* AddINode::Ideal(PhaseGVN* phase, bool can_reshape) { + Node* in1 = in(1); + Node* in2 = in(2); + int op1 = in1->Opcode(); + int op2 = in2->Opcode(); + + // Convert (x>>>z)+y into (x+(y<>>z for small constant z and y. + // Helps with array allocation math constant folding + // See 4790063: + // Unrestricted transformation is unsafe for some runtime values of 'x' + // ( x == 0, z == 1, y == -1 ) fails + // ( x == -5, z == 1, y == 1 ) fails + // Transform works for small z and small negative y when the addition + // (x + (y << z)) does not cross zero. + // Implement support for negative y and (x >= -(y << z)) + // Have not observed cases where type information exists to support + // positive y and (x <= -(y << z)) + if (op1 == Op_URShiftI && op2 == Op_ConI && + in1->in(2)->Opcode() == Op_ConI) { + jint z = phase->type(in1->in(2))->is_int()->get_con() & 0x1f; // only least significant 5 bits matter + jint y = phase->type(in2)->is_int()->get_con(); + + if (z < 5 && -5 < y && y < 0) { + const Type* t_in11 = phase->type(in1->in(1)); + if( t_in11 != Type::TOP && (t_in11->is_int()->_lo >= -(y << z))) { + Node* a = phase->transform(new AddINode( in1->in(1), phase->intcon(y<in(2)); + } + } + } + + return AddNode::IdealIL(phase, can_reshape, T_INT); +} + + //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x Node* AddINode::Identity(PhaseGVN* phase) { @@ -451,124 +466,8 @@ const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const { //============================================================================= //------------------------------Idealize--------------------------------------- -Node *AddLNode::Ideal(PhaseGVN *phase, bool can_reshape) { - Node* in1 = in(1); - Node* in2 = in(2); - int op1 = in1->Opcode(); - int op2 = in2->Opcode(); - // Fold (con1-x)+con2 into (con1+con2)-x - if ( op1 == Op_AddL && op2 == Op_SubL ) { - // Swap edges to try optimizations below - in1 = in2; - in2 = in(1); - op1 = op2; - op2 = in2->Opcode(); - } - // Fold (con1-x)+con2 into (con1+con2)-x - if( op1 == Op_SubL ) { - const Type *t_sub1 = phase->type( in1->in(1) ); - const Type *t_2 = phase->type( in2 ); - if( t_sub1->singleton() && t_2->singleton() && t_sub1 != Type::TOP && t_2 != Type::TOP ) - return new SubLNode(phase->makecon( add_ring( t_sub1, t_2 ) ), in1->in(2) ); - // Convert "(a-b)+(c-d)" into "(a+c)-(b+d)" - if( op2 == Op_SubL ) { - // Check for dead cycle: d = (a-b)+(c-d) - assert( in1->in(2) != this && in2->in(2) != this, - "dead loop in AddLNode::Ideal" ); - Node *sub = new SubLNode(NULL, NULL); - sub->init_req(1, phase->transform(new AddLNode(in1->in(1), in2->in(1) ) )); - sub->init_req(2, phase->transform(new AddLNode(in1->in(2), in2->in(2) ) )); - return sub; - } - // Convert "(a-b)+(b+c)" into "(a+c)" - if( op2 == Op_AddL && in1->in(2) == in2->in(1) ) { - assert(in1->in(1) != this && in2->in(2) != this,"dead loop in AddLNode::Ideal"); - return new AddLNode(in1->in(1), in2->in(2)); - } - // Convert "(a-b)+(c+b)" into "(a+c)" - if( op2 == Op_AddL && in1->in(2) == in2->in(2) ) { - assert(in1->in(1) != this && in2->in(1) != this,"dead loop in AddLNode::Ideal"); - return new AddLNode(in1->in(1), in2->in(1)); - } - // Convert "(a-b)+(b-c)" into "(a-c)" - if( op2 == Op_SubL && in1->in(2) == in2->in(1) ) { - assert(in1->in(1) != this && in2->in(2) != this,"dead loop in AddLNode::Ideal"); - return new SubLNode(in1->in(1), in2->in(2)); - } - // Convert "(a-b)+(c-a)" into "(c-b)" - if( op2 == Op_SubL && in1->in(1) == in2->in(2) ) { - assert(in1->in(2) != this && in2->in(1) != this,"dead loop in AddLNode::Ideal"); - return new SubLNode(in2->in(1), in1->in(2)); - } - } - - // Convert "x+(0-y)" into "(x-y)" - if( op2 == Op_SubL && phase->type(in2->in(1)) == TypeLong::ZERO ) - return new SubLNode( in1, in2->in(2) ); - - // Convert "(0-y)+x" into "(x-y)" - if( op1 == Op_SubL && phase->type(in1->in(1)) == TypeLong::ZERO ) - return new SubLNode( in2, in1->in(2) ); - - // Associative - if (op1 == Op_MulL && op2 == Op_MulL) { - Node* add_in1 = NULL; - Node* add_in2 = NULL; - Node* mul_in = NULL; - - if (in1->in(1) == in2->in(1)) { - // Convert "a*b+a*c into a*(b+c) - add_in1 = in1->in(2); - add_in2 = in2->in(2); - mul_in = in1->in(1); - } else if (in1->in(2) == in2->in(1)) { - // Convert a*b+b*c into b*(a+c) - add_in1 = in1->in(1); - add_in2 = in2->in(2); - mul_in = in1->in(2); - } else if (in1->in(2) == in2->in(2)) { - // Convert a*c+b*c into (a+b)*c - add_in1 = in1->in(1); - add_in2 = in2->in(1); - mul_in = in1->in(2); - } else if (in1->in(1) == in2->in(2)) { - // Convert a*b+c*a into a*(b+c) - add_in1 = in1->in(2); - add_in2 = in2->in(1); - mul_in = in1->in(1); - } - - if (mul_in != NULL) { - Node* add = phase->transform(new AddLNode(add_in1, add_in2)); - return new MulLNode(mul_in, add); - } - } - - // Convert (x >>> rshift) + (x << lshift) into RotateRight(x, rshift) - if (Matcher::match_rule_supported(Op_RotateRight) && - ((op1 == Op_URShiftL && op2 == Op_LShiftL) || (op1 == Op_LShiftL && op2 == Op_URShiftL)) && - in1->in(1) != NULL && in1->in(1) == in2->in(1)) { - Node* rshift = op1 == Op_URShiftL ? in1->in(2) : in2->in(2); - Node* lshift = op1 == Op_URShiftL ? in2->in(2) : in1->in(2); - if (rshift != NULL && lshift != NULL) { - const TypeInt* rshift_t = phase->type(rshift)->isa_int(); - const TypeInt* lshift_t = phase->type(lshift)->isa_int(); - if (lshift_t != NULL && lshift_t->is_con() && - rshift_t != NULL && rshift_t->is_con() && - ((lshift_t->get_con() & 0x3F) == (64 - (rshift_t->get_con() & 0x3F)))) { - return new RotateRightNode(in1->in(1), phase->intcon(rshift_t->get_con() & 0x3F), TypeLong::LONG); - } - } - } - - // Convert (~x+1) into -x. Note there isn't a bitwise not bytecode, - // "~x" would typically represented as "x^(-1)", so (~x+1) will - // be (x^(-1))+1 - if (op1 == Op_XorL && phase->type(in2) == TypeLong::ONE && - phase->type(in1->in(2)) == TypeLong::MINUS_1) { - return new SubLNode(phase->makecon(TypeLong::ZERO), in1->in(1)); - } - return AddNode::Ideal(phase, can_reshape); +Node* AddLNode::Ideal(PhaseGVN* phase, bool can_reshape) { + return AddNode::IdealIL(phase, can_reshape, T_LONG); } diff --git a/src/hotspot/share/opto/addnode.hpp b/src/hotspot/share/opto/addnode.hpp index 132d796aea4..1e9c3a8b1df 100644 --- a/src/hotspot/share/opto/addnode.hpp +++ b/src/hotspot/share/opto/addnode.hpp @@ -51,7 +51,8 @@ public: // We also canonicalize the Node, moving constants to the right input, // and flatten expressions (so that 1+x+2 becomes x+3). - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); + Node* IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt); // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. @@ -74,10 +75,6 @@ public: // Supplied function to return the multiplicative opcode virtual int min_opcode() const = 0; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } static AddNode* make(Node* in1, Node* in2, BasicType bt); }; @@ -92,12 +89,9 @@ public: virtual const Type *bottom_type() const { return TypeInt::INT; } int max_opcode() const { return Op_MaxI; } int min_opcode() const { return Op_MinI; } - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } + virtual uint ideal_reg() const { return Op_RegI; } }; @@ -112,12 +106,9 @@ public: virtual const Type *bottom_type() const { return TypeLong::LONG; } int max_opcode() const { return Op_MaxL; } int min_opcode() const { return Op_MinL; } - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } + virtual uint ideal_reg() const { return Op_RegL; } }; diff --git a/src/hotspot/share/opto/castnode.hpp b/src/hotspot/share/opto/castnode.hpp index 2aa318c0e24..ae4cf418945 100644 --- a/src/hotspot/share/opto/castnode.hpp +++ b/src/hotspot/share/opto/castnode.hpp @@ -60,10 +60,6 @@ public: TypeNode* dominating_cast(PhaseGVN* gvn, PhaseTransform* pt) const; static Node* make_cast(int opcode, Node* c, Node *n, const Type *t, DependencyType dependency); static Node* make(Node* c, Node *n, const Type *t, BasicType bt); - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; @@ -104,10 +100,6 @@ class CastIINode: public ConstraintCastNode { return false; #endif } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } #ifndef PRODUCT virtual void dump_spec(outputStream* st) const; @@ -125,10 +117,7 @@ public: : ConstraintCastNode(n, t, dependency){ init_class_id(Class_CastLL); } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } + virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegL; } }; diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index 64bf4b7f582..e583dd9deec 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -2521,7 +2521,7 @@ bool PhiNode::is_data_loop(RegionNode* r, Node* uin, const PhaseGVN* phase) { //------------------------------is_tripcount----------------------------------- bool PhiNode::is_tripcount(BasicType bt) const { return (in(0) != NULL && in(0)->is_BaseCountedLoop() && - in(0)->as_BaseCountedLoop()->operates_on(bt, true) && + in(0)->as_BaseCountedLoop()->bt() == bt && in(0)->as_BaseCountedLoop()->phi() == this); } diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 279edf25046..c0396bbe95d 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -741,7 +741,7 @@ bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, BasicT return false; } const CmpNode *cmp = bol->in(1)->as_Cmp(); - if (!(cmp->is_Cmp() && cmp->operates_on(bt, false))) { + if (cmp->Opcode() != Op_Cmp_unsigned(bt)) { return false; } range = cmp->in(2); diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 00147d54ec7..0b2b58c50b8 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -2521,7 +2521,7 @@ bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType } int opc = exp->Opcode(); // Can't use is_Mul() here as it's true for AndI and AndL - if ((opc == Op_MulI || opc == Op_MulL) && exp->operates_on(bt, true)) { + if (opc == Op_Mul(bt)) { if (exp->in(1)->uncast() == iv && exp->in(2)->is_Con()) { if (p_scale != NULL) { *p_scale = exp->in(2)->get_integer_as_long(bt); @@ -2534,7 +2534,7 @@ bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType } return true; } - } else if (exp->is_LShift() && exp->operates_on(bt, true)) { + } else if (opc == Op_LShift(bt)) { if (exp->in(1)->uncast() == iv && exp->in(2)->is_Con()) { if (p_scale != NULL) { jint shift_amount = exp->in(2)->get_int(); @@ -2563,7 +2563,8 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scal return true; } exp = exp->uncast(); - if (exp->is_Add() && exp->operates_on(bt, true)) { + int opc = exp->Opcode(); + if (opc == Op_Add(bt)) { if (is_scaled_iv(exp->in(1), iv, p_scale, bt)) { if (p_offset != NULL) { *p_offset = exp->in(2); @@ -2590,7 +2591,7 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scal return true; } } - } else if (exp->is_Sub() && exp->operates_on(bt, true)) { + } else if (opc == Op_Sub(bt)) { if (is_scaled_iv(exp->in(1), iv, p_scale, bt)) { if (p_offset != NULL) { Node *zero = _igvn.integercon(0, bt); diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index 3e150b9cb94..46e675ae239 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -71,7 +71,7 @@ void LoopNode::dump_spec(outputStream *st) const { //------------------------------is_valid_counted_loop------------------------- bool LoopNode::is_valid_counted_loop(BasicType bt) const { - if (is_BaseCountedLoop() && operates_on(bt, false)) { + if (is_BaseCountedLoop() && as_BaseCountedLoop()->bt() == bt) { BaseCountedLoopNode* l = as_BaseCountedLoop(); BaseCountedLoopEndNode* le = l->loopexit_or_null(); if (le != NULL && @@ -1433,12 +1433,12 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ Node* incr = NULL; Node* limit = NULL; Node* cmp = loop_exit_test(back_control, loop, incr, limit, bt, cl_prob); - if (cmp == NULL || !(cmp->is_Cmp() && cmp->operates_on(iv_bt, true))) { + if (cmp == NULL || cmp->Opcode() != Op_Cmp(iv_bt)) { return false; // Avoid pointer & float & 64-bit compares } // Trip-counter increment must be commutative & associative. - if (incr->is_ConstraintCast() && incr->operates_on(iv_bt, false)) { + if (incr->Opcode() == Op_Cast(iv_bt)) { incr = incr->in(1); } @@ -1455,7 +1455,7 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ if (!(incr = CountedLoopNode::match_incr_with_optional_truncation(incr, &trunc1, &trunc2, &iv_trunc_t, iv_bt))) { return false; // Funny increment opcode } - assert(incr->is_Add() && incr->operates_on(iv_bt, false), "wrong increment code"); + assert(incr->Opcode() == Op_Add(iv_bt), "wrong increment code"); Node* xphi = NULL; Node* stride = loop_iv_stride(incr, loop, xphi); @@ -1464,7 +1464,7 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ return false; } - if (xphi->is_ConstraintCast() && xphi->operates_on(iv_bt, false)) { + if (xphi->Opcode() == Op_Cast(iv_bt)) { xphi = xphi->in(1); } @@ -2272,7 +2272,7 @@ Node* CountedLoopNode::match_incr_with_optional_truncation(Node* expr, Node** tr } // If (maybe after stripping) it is an AddI, we won: - if (n1->is_Add() && n1->operates_on(bt, true)) { + if (n1op == Op_Add(bt)) { *trunc1 = t1; *trunc2 = t2; *trunc_type = trunc_t; diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 1fee41ba62a..4cca7ab45da 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -215,10 +215,6 @@ public: BaseCountedLoopEndNode* loopexit() const; virtual BasicType bt() const = 0; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } static BaseCountedLoopNode* make(Node* entry, Node* backedge, BasicType bt); }; @@ -342,10 +338,6 @@ public: static Node* skip_predicates_from_entry(Node* ctrl); Node* skip_predicates(); - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } virtual BasicType bt() const { return T_INT; } @@ -366,11 +358,6 @@ public: virtual int Opcode() const; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } - virtual BasicType bt() const { return T_LONG; } @@ -423,17 +410,13 @@ public: if (!ln->is_BaseCountedLoop() || ln->as_BaseCountedLoop()->loopexit_or_null() != this) { return NULL; } - if (!ln->operates_on(bt(), true)) { + if (ln->as_BaseCountedLoop()->bt() != bt()) { return NULL; } return ln->as_BaseCountedLoop(); } BoolTest::mask test_trip() const { return in(TestValue)->as_Bool()->_test._test; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } jlong stride_con() const; virtual BasicType bt() const = 0; @@ -453,10 +436,6 @@ public: CountedLoopNode* loopnode() const { return (CountedLoopNode*) BaseCountedLoopEndNode::loopnode(); } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } virtual BasicType bt() const { return T_INT; @@ -477,10 +456,7 @@ public: LongCountedLoopNode* loopnode() const { return (LongCountedLoopNode*) BaseCountedLoopEndNode::loopnode(); } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } + virtual int Opcode() const; virtual BasicType bt() const { @@ -498,7 +474,7 @@ inline BaseCountedLoopEndNode* BaseCountedLoopNode::loopexit_or_null() const { return NULL; } BaseCountedLoopEndNode* result = lexit->as_BaseCountedLoopEnd(); - if (!result->operates_on(bt(), true)) { + if (result->bt() != bt()) { return NULL; } return result; diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp index 4c999ea5524..a45ad23f6c1 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp @@ -222,6 +222,19 @@ const Type* MulNode::Value(PhaseGVN* phase) const { return mul_ring(t1,t2); // Local flavor of type multiplication } +MulNode* MulNode::make(Node* in1, Node* in2, BasicType bt) { + switch (bt) { + case T_INT: + return new MulINode(in1, in2); + case T_LONG: + return new MulLNode(in1, in2); + default: + fatal("Not implemented for %s", type2name(bt)); + } + return NULL; +} + + //============================================================================= //------------------------------Ideal------------------------------------------ // Check for power-of-2 multiply, then try the regular MulNode::Ideal diff --git a/src/hotspot/share/opto/mulnode.hpp b/src/hotspot/share/opto/mulnode.hpp index 25bd6ebf150..3c7f27910a7 100644 --- a/src/hotspot/share/opto/mulnode.hpp +++ b/src/hotspot/share/opto/mulnode.hpp @@ -75,16 +75,13 @@ public: // Supplied function to return the multiplicative opcode virtual int mul_opcode() const = 0; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } - // Supplied function to return the additive opcode virtual int max_opcode() const = 0; // Supplied function to return the multiplicative opcode virtual int min_opcode() const = 0; + + static MulNode* make(Node* in1, Node* in2, BasicType bt); }; //------------------------------MulINode--------------------------------------- @@ -103,10 +100,6 @@ public: int min_opcode() const { return Op_MinI; } const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } }; //------------------------------MulLNode--------------------------------------- @@ -125,10 +118,6 @@ public: int min_opcode() const { return Op_MinL; } const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } }; @@ -234,10 +223,6 @@ public: LShiftNode(Node *in1, Node *in2) : Node(NULL,in1,in2) { init_class_id(Class_LShift); } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } }; //------------------------------LShiftINode------------------------------------ @@ -251,10 +236,6 @@ public: virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } }; //------------------------------LShiftLNode------------------------------------ @@ -268,10 +249,6 @@ public: virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } }; diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 94fd6ac3385..79fbf805fda 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -1265,12 +1265,6 @@ public: uint _del_tick; // Bumped when a deletion happens.. #endif #endif -public: - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - Unimplemented(); - return false; - } }; inline bool not_a_node(const Node* n) { @@ -1835,4 +1829,39 @@ public: #endif }; +#include "opto/opcodes.hpp" + +#define Op_IL(op) \ + inline int Op_ ## op(BasicType bt) { \ + assert(bt == T_INT || bt == T_LONG, "only for int or longs"); \ + if (bt == T_INT) { \ + return Op_## op ## I; \ + } \ + return Op_## op ## L; \ +} + +Op_IL(Add) +Op_IL(Sub) +Op_IL(Mul) +Op_IL(URShift) +Op_IL(LShift) +Op_IL(Xor) +Op_IL(Cmp) + +inline int Op_Cmp_unsigned(BasicType bt) { + assert(bt == T_INT || bt == T_LONG, "only for int or longs"); + if (bt == T_INT) { + return Op_CmpU; + } + return Op_CmpUL; +} + +inline int Op_Cast(BasicType bt) { + assert(bt == T_INT || bt == T_LONG, "only for int or longs"); + if (bt == T_INT) { + return Op_CastII; + } + return Op_CastLL; +} + #endif // SHARE_OPTO_NODE_HPP diff --git a/src/hotspot/share/opto/subnode.hpp b/src/hotspot/share/opto/subnode.hpp index 281b28237c8..398b219e646 100644 --- a/src/hotspot/share/opto/subnode.hpp +++ b/src/hotspot/share/opto/subnode.hpp @@ -62,10 +62,6 @@ public: virtual const Type *add_id() const = 0; static SubNode* make(Node* in1, Node* in2, BasicType bt); - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } }; @@ -81,10 +77,6 @@ public: const Type *add_id() const { return TypeInt::ZERO; } const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT; - } }; //------------------------------SubLNode--------------------------------------- @@ -98,10 +90,6 @@ public: const Type *add_id() const { return TypeLong::ZERO; } const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG; - } }; // NOTE: SubFPNode should be taken away and replaced by add and negate @@ -162,10 +150,6 @@ public: // including eventual control nodes and their projections. virtual void related(GrowableArray *in_rel, GrowableArray *out_rel, bool compact) const; #endif - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return false; - } }; //------------------------------CmpINode--------------------------------------- @@ -176,10 +160,6 @@ public: virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *sub( const Type *, const Type * ) const; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT && signed_int; - } }; //------------------------------CmpUNode--------------------------------------- @@ -191,10 +171,6 @@ public: virtual const Type *sub( const Type *, const Type * ) const; const Type* Value(PhaseGVN* phase) const; bool is_index_range_check() const; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_INT && !signed_int; - } }; //------------------------------CmpPNode--------------------------------------- @@ -225,10 +201,6 @@ public: virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *sub( const Type *, const Type * ) const; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG && signed_int; - } }; //------------------------------CmpULNode--------------------------------------- @@ -238,10 +210,6 @@ public: CmpULNode(Node* in1, Node* in2) : CmpNode(in1, in2) { } virtual int Opcode() const; virtual const Type* sub(const Type*, const Type*) const; - virtual bool operates_on(BasicType bt, bool signed_int) const { - assert(bt == T_INT || bt == T_LONG, "unsupported"); - return bt == T_LONG && !signed_int; - } }; //------------------------------CmpL3Node-------------------------------------- diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index 56e5c54ef18..5484406beb0 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -1413,6 +1413,30 @@ const TypeInteger* TypeInteger::bottom(BasicType bt) { return TypeLong::LONG; } +const TypeInteger* TypeInteger::zero(BasicType bt) { + if (bt == T_INT) { + return TypeInt::ZERO; + } + assert(bt == T_LONG, "basic type not an int or long"); + return TypeLong::ZERO; +} + +const TypeInteger* TypeInteger::one(BasicType bt) { + if (bt == T_INT) { + return TypeInt::ONE; + } + assert(bt == T_LONG, "basic type not an int or long"); + return TypeLong::ONE; +} + +const TypeInteger* TypeInteger::minus_1(BasicType bt) { + if (bt == T_INT) { + return TypeInt::MINUS_1; + } + assert(bt == T_LONG, "basic type not an int or long"); + return TypeLong::MINUS_1; +} + //============================================================================= // Convience common pre-built types. const TypeInt *TypeInt::MAX; // INT_MAX diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index 754e0c0adc6..f525a75b14e 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -558,10 +558,14 @@ public: virtual jlong hi_as_long() const = 0; virtual jlong lo_as_long() const = 0; jlong get_con_as_long(BasicType bt) const; + bool is_con() const { return lo_as_long() == hi_as_long(); } static const TypeInteger* make(jlong lo, jlong hi, int w, BasicType bt); static const TypeInteger* bottom(BasicType type); + static const TypeInteger* zero(BasicType type); + static const TypeInteger* one(BasicType type); + static const TypeInteger* minus_1(BasicType type); }; @@ -588,9 +592,9 @@ public: static const TypeInt *make(jint lo, jint hi, int w); // Check for single integer - int is_con() const { return _lo==_hi; } + bool is_con() const { return _lo==_hi; } bool is_con(int i) const { return is_con() && _lo == i; } - jint get_con() const { assert( is_con(), "" ); return _lo; } + jint get_con() const { assert(is_con(), "" ); return _lo; } virtual bool is_finite() const; // Has a finite value @@ -656,9 +660,9 @@ public: static const TypeLong *make(jlong lo, jlong hi, int w); // Check for single integer - int is_con() const { return _lo==_hi; } + bool is_con() const { return _lo==_hi; } bool is_con(int i) const { return is_con() && _lo == i; } - jlong get_con() const { assert( is_con(), "" ); return _lo; } + jlong get_con() const { assert(is_con(), "" ); return _lo; } // Check for positive 32-bit value. int is_positive_int() const { return _lo >= 0 && _hi <= (jlong)max_jint; } -- GitLab From 10e0318ff7289b248289a70a56adeff3c257de04 Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Wed, 8 Dec 2021 09:16:44 +0000 Subject: [PATCH 669/890] 8278158: jwebserver should set request timeout Reviewed-by: dfuchs, michaelm --- .../httpserver/simpleserver/JWebServer.java | 21 ++++++++++++++----- .../sun/net/httpserver/simpleserver/Main.java | 21 ++++++++++++++----- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java index c338e4844e6..59f77abbae8 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/JWebServer.java @@ -28,11 +28,6 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** * Programmatic entry point to start the jwebserver tool. - * - *

      This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interface are subject to change or deletion - * without notice. */ public class JWebServer { @@ -51,11 +46,18 @@ public class JWebServer { * or an I/O error occurs, the server is not started and this method invokes * System::exit with an appropriate exit code. * + *

      If the system property "sun.net.httpserver.maxReqTime" has not been + * set by the user, it is set to a value of 5 seconds. This is to prevent + * the server from hanging indefinitely, for example in the case of an HTTPS + * request. + * * @param args the command-line options * @throws NullPointerException if {@code args} is {@code null}, or if there * are any {@code null} values in the {@code args} array */ public static void main(String... args) { + setMaxReqTime(); + int ec = SimpleFileServerImpl.start(new PrintWriter(System.out, true, UTF_8), "jwebserver", args); if (ec != 0) { System.exit(ec); @@ -63,4 +65,13 @@ public class JWebServer { // runs in another non-daemon thread, or -h or -version have been // passed and the main thread has exited normally. } + + public static final String MAXREQTIME_KEY = "sun.net.httpserver.maxReqTime"; + public static final String MAXREQTIME_VAL = "5"; + + private static void setMaxReqTime() { + if (System.getProperty(MAXREQTIME_KEY) == null) { + System.setProperty(MAXREQTIME_KEY, MAXREQTIME_VAL); + } + } } diff --git a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java index 9f76be48abd..83441cdbc7f 100644 --- a/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java +++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/simpleserver/Main.java @@ -28,11 +28,6 @@ import static java.nio.charset.StandardCharsets.UTF_8; /** * Programmatic entry point to start "java -m jdk.httpserver". - * - *

      This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interface are subject to change or deletion - * without notice. */ public class Main { @@ -51,11 +46,18 @@ public class Main { * or an I/O error occurs, the server is not started and this method invokes * System::exit with an appropriate exit code. * + *

      If the system property "sun.net.httpserver.maxReqTime" has not been + * set by the user, it is set to a value of 5 seconds. This is to prevent + * the server from hanging indefinitely, for example in the case of an HTTPS + * request. + * * @param args the command-line options * @throws NullPointerException if {@code args} is {@code null}, or if there * are any {@code null} values in the {@code args} array */ public static void main(String... args) { + setMaxReqTime(); + int ec = SimpleFileServerImpl.start(new PrintWriter(System.out, true, UTF_8), "java", args); if (ec != 0) { System.exit(ec); @@ -63,4 +65,13 @@ public class Main { // runs in another non-daemon thread, or -h or -version have been // passed and the main thread has exited normally. } + + public static final String MAXREQTIME_KEY = "sun.net.httpserver.maxReqTime"; + public static final String MAXREQTIME_VAL = "5"; + + private static void setMaxReqTime() { + if (System.getProperty(MAXREQTIME_KEY) == null) { + System.setProperty(MAXREQTIME_KEY, MAXREQTIME_VAL); + } + } } -- GitLab From 54993b13078ceb05736bb0e1d7ed7415c390442e Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 8 Dec 2021 09:18:58 +0000 Subject: [PATCH 670/890] 8278309: [windows] use of uninitialized OSThread::_state Reviewed-by: dholmes, shade --- src/hotspot/os/windows/os_windows.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 6f8c88d764d..7273e9ec539 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -676,6 +676,9 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, return false; } + // Initial state is ALLOCATED but not INITIALIZED + osthread->set_state(ALLOCATED); + // Initialize the JDK library's interrupt event. // This should really be done when OSThread is constructed, // but there is no way for a constructor to report failure to @@ -777,7 +780,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, osthread->set_thread_handle(thread_handle); osthread->set_thread_id(thread_id); - // Initial thread state is INITIALIZED, not SUSPENDED + // Thread state now is INITIALIZED, not SUSPENDED osthread->set_state(INITIALIZED); // The thread is returned suspended (in state INITIALIZED), and is started higher up in the call chain -- GitLab From e5cb84e9a1bca321f22d6e3ce13a6026342b4b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Wed, 8 Dec 2021 11:18:24 +0000 Subject: [PATCH 671/890] 8278336: Use int64_t to represent byte quantities consistently in JfrObjectAllocationSample Reviewed-by: egahlin --- .../jfr/support/jfrObjectAllocationSample.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp index 412c35229b4..fb71d7a3362 100644 --- a/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp +++ b/src/hotspot/share/jfr/support/jfrObjectAllocationSample.cpp @@ -35,7 +35,7 @@ inline void send_allocation_sample(const Klass* klass, int64_t allocated_bytes) assert(allocated_bytes > 0, "invariant"); EventObjectAllocationSample event; if (event.should_commit()) { - const size_t weight = allocated_bytes - _last_allocated_bytes; + const int64_t weight = allocated_bytes - _last_allocated_bytes; assert(weight > 0, "invariant"); event.set_objectClass(klass); event.set_weight(weight); @@ -48,7 +48,7 @@ inline bool send_allocation_sample_with_result(const Klass* klass, int64_t alloc assert(allocated_bytes > 0, "invariant"); EventObjectAllocationSample event; if (event.should_commit()) { - const size_t weight = allocated_bytes - _last_allocated_bytes; + const int64_t weight = allocated_bytes - _last_allocated_bytes; assert(weight > 0, "invariant"); event.set_objectClass(klass); event.set_weight(weight); @@ -59,11 +59,11 @@ inline bool send_allocation_sample_with_result(const Klass* klass, int64_t alloc return false; } -inline intptr_t estimate_tlab_size_bytes(Thread* thread) { +inline int64_t estimate_tlab_size_bytes(Thread* thread) { const size_t desired_tlab_size_bytes = thread->tlab().desired_size() * HeapWordSize; const size_t alignment_reserve_bytes = thread->tlab().alignment_reserve_in_bytes(); assert(desired_tlab_size_bytes > alignment_reserve_bytes, "invariant"); - return static_cast(desired_tlab_size_bytes - alignment_reserve_bytes); + return static_cast(desired_tlab_size_bytes - alignment_reserve_bytes); } inline int64_t load_allocated_bytes(Thread* thread) { @@ -81,14 +81,14 @@ inline int64_t load_allocated_bytes(Thread* thread) { // To avoid large objects from being undersampled compared to the regular TLAB samples, // the data amount is normalized as if it was a TLAB, giving a number of TLAB sampling attempts to the large object. -static void normalize_as_tlab_and_send_allocation_samples(const Klass* klass, intptr_t obj_alloc_size_bytes, Thread* thread) { +static void normalize_as_tlab_and_send_allocation_samples(const Klass* klass, int64_t obj_alloc_size_bytes, Thread* thread) { const int64_t allocated_bytes = load_allocated_bytes(thread); assert(allocated_bytes > 0, "invariant"); // obj_alloc_size_bytes is already attributed to allocated_bytes at this point. if (!UseTLAB) { send_allocation_sample(klass, allocated_bytes); return; } - const intptr_t tlab_size_bytes = estimate_tlab_size_bytes(thread); + const int64_t tlab_size_bytes = estimate_tlab_size_bytes(thread); if (allocated_bytes - _last_allocated_bytes < tlab_size_bytes) { return; } @@ -103,7 +103,7 @@ static void normalize_as_tlab_and_send_allocation_samples(const Klass* klass, in void JfrObjectAllocationSample::send_event(const Klass* klass, size_t alloc_size, bool outside_tlab, Thread* thread) { if (outside_tlab) { - normalize_as_tlab_and_send_allocation_samples(klass, static_cast(alloc_size), thread); + normalize_as_tlab_and_send_allocation_samples(klass, static_cast(alloc_size), thread); return; } const int64_t allocated_bytes = load_allocated_bytes(thread); -- GitLab From fd8cb2dae87e5726e89a1789e5a1ddd461c4400d Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 8 Dec 2021 14:03:56 +0000 Subject: [PATCH 672/890] 8278346: java/nio/file/Files/probeContentType/Basic.java fails on Linux SLES15 machine Reviewed-by: shade --- .../java/nio/file/Files/probeContentType/Basic.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/jdk/java/nio/file/Files/probeContentType/Basic.java b/test/jdk/java/nio/file/Files/probeContentType/Basic.java index 0812f886c30..b404673b2f4 100644 --- a/test/jdk/java/nio/file/Files/probeContentType/Basic.java +++ b/test/jdk/java/nio/file/Files/probeContentType/Basic.java @@ -110,8 +110,8 @@ public class Basic { + " cannot be determined"); failures++; } else if (!expectedTypes.contains(type)) { - System.err.printf("Content type: %s; expected: %s%n", - type, expectedTypes); + System.err.printf("For extension %s we got content type: %s; expected: %s%n", + extension, type, expectedTypes); failures++; } } finally { @@ -155,7 +155,7 @@ public class Basic { // Verify that certain extensions are mapped to the correct type. var exTypes = new ExType[] { new ExType("adoc", List.of("text/plain")), - new ExType("bz2", List.of("application/bz2", "application/x-bzip2")), + new ExType("bz2", List.of("application/bz2", "application/x-bzip2", "application/x-bzip")), new ExType("css", List.of("text/css")), new ExType("csv", List.of("text/csv")), new ExType("doc", List.of("application/msword")), @@ -166,19 +166,19 @@ public class Basic { new ExType("js", List.of("text/javascript", "application/javascript")), new ExType("json", List.of("application/json")), new ExType("markdown", List.of("text/markdown")), - new ExType("md", List.of("text/markdown")), + new ExType("md", List.of("text/markdown", "application/x-genesis-rom")), new ExType("mp3", List.of("audio/mpeg")), new ExType("mp4", List.of("video/mp4")), new ExType("odp", List.of("application/vnd.oasis.opendocument.presentation")), new ExType("ods", List.of("application/vnd.oasis.opendocument.spreadsheet")), new ExType("odt", List.of("application/vnd.oasis.opendocument.text")), new ExType("pdf", List.of("application/pdf")), - new ExType("php", List.of("text/plain", "text/php")), + new ExType("php", List.of("text/plain", "text/php", "application/x-php")), new ExType("png", List.of("image/png")), new ExType("ppt", List.of("application/vnd.ms-powerpoint")), new ExType("pptx",List.of("application/vnd.openxmlformats-officedocument.presentationml.presentation")), new ExType("py", List.of("text/plain", "text/x-python", "text/x-python-script")), - new ExType("rar", List.of("application/rar", "application/vnd.rar")), + new ExType("rar", List.of("application/rar", "application/vnd.rar", "application/x-rar")), new ExType("rtf", List.of("application/rtf", "text/rtf")), new ExType("webm", List.of("video/webm")), new ExType("webp", List.of("image/webp")), -- GitLab From 37921e30803449c06b4d542fdfeed9928cce8a7d Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Wed, 8 Dec 2021 15:31:49 +0000 Subject: [PATCH 673/890] 8269258: java/net/httpclient/ManyRequestsLegacy.java failed with connection timeout Reviewed-by: michaelm --- .../jdk/java/net/httpclient/ManyRequests.java | 204 ++++++++++++------ .../java/net/httpclient/ManyRequests2.java | 12 +- .../net/httpclient/ManyRequestsLegacy.java | 184 +++++++++++----- 3 files changed, 274 insertions(+), 126 deletions(-) diff --git a/test/jdk/java/net/httpclient/ManyRequests.java b/test/jdk/java/net/httpclient/ManyRequests.java index f79d565162a..296377441a7 100644 --- a/test/jdk/java/net/httpclient/ManyRequests.java +++ b/test/jdk/java/net/httpclient/ManyRequests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -32,13 +32,13 @@ * @compile ../../../com/sun/net/httpserver/LogFilter.java * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java - * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests - * @run main/othervm/timeout=40 -Dtest.insertDelay=true ManyRequests - * @run main/othervm/timeout=40 -Dtest.chunkSize=64 ManyRequests - * @run main/othervm/timeout=40 -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests + * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl,channel ManyRequests + * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true ManyRequests + * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=channel -Dtest.chunkSize=64 ManyRequests + * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=channel -Dtest.insertDelay=true -Dtest.chunkSize=64 ManyRequests * @summary Send a large number of requests asynchronously */ - // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl ManyRequests + // * @run main/othervm/timeout=40 -Djdk.httpclient.HttpClient.log=ssl,channel ManyRequests import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsParameters; @@ -47,6 +47,7 @@ import com.sun.net.httpserver.HttpExchange; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.ConnectException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.URI; @@ -54,13 +55,18 @@ import java.net.http.HttpClient; import java.net.http.HttpClient.Builder; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; +import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.time.Duration; import java.util.Arrays; import java.util.Formatter; import java.util.HashMap; import java.util.LinkedList; +import java.util.Map; import java.util.Random; +import java.util.concurrent.CompletionException; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; @@ -68,17 +74,27 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Logger; import java.util.logging.Level; import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; import javax.net.ssl.SSLContext; + +import jdk.test.lib.Platform; +import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; +import jdk.test.lib.net.URIBuilder; public class ManyRequests { - volatile static int counter = 0; + static final int MAX_COUNT = 20; + static final int MAX_LIMIT = 40; + static final AtomicInteger COUNT = new AtomicInteger(); + static final AtomicInteger LIMIT = new AtomicInteger(MAX_LIMIT); + static final Random RANDOM = RandomFactory.getRandom(); public static void main(String[] args) throws Exception { Logger logger = Logger.getLogger("com.sun.net.httpserver"); logger.setLevel(Level.ALL); logger.info("TEST"); + Stream.of(Logger.getLogger("").getHandlers()).forEach((h) -> h.setLevel(Level.ALL)); System.out.println("Sending " + REQUESTS + " requests; delay=" + INSERT_DELAY + ", chunks=" + CHUNK_SIZE @@ -106,14 +122,14 @@ public class ManyRequests { } //static final int REQUESTS = 1000; - static final int REQUESTS = 20; + static final int REQUESTS = MAX_COUNT; static final boolean INSERT_DELAY = Boolean.getBoolean("test.insertDelay"); static final int CHUNK_SIZE = Math.max(0, Integer.parseInt(System.getProperty("test.chunkSize", "0"))); static final boolean XFIXED = Boolean.getBoolean("test.XFixed"); static class TestEchoHandler extends EchoHandler { - final Random rand = jdk.test.lib.RandomFactory.getRandom(); + final Random rand = RANDOM; @Override public void handle(HttpExchange e) throws IOException { System.out.println("Server: received " + e.getRequestURI()); @@ -139,60 +155,126 @@ public class ManyRequests { } } + static String now(long start) { + long elapsed = System.nanoTime() - start; + long ms = elapsed / 1000_000L; + long s = ms / 1000L; + if (s == 0) return ms + "ms: "; + return s + "s, " + (ms - s * 1000L) + "ms: "; + } + + static String failure(Throwable t) { + String s = "\n\t failed: " + t; + for (t = t.getCause(); t != null ; t = t.getCause()) { + s = s + "\n\t\t Caused by: " + t; + } + return s; + } + static void test(HttpsServer server, HttpClient client) throws Exception { int port = server.getAddress().getPort(); - URI baseURI = new URI("https://localhost:" + port + "/foo/x"); + + URI baseURI = URIBuilder.newBuilder() + .scheme("https") + .host(InetAddress.getLoopbackAddress().getHostName()) + .port(port) + .path("/foo/x").build(); server.createContext("/foo", new TestEchoHandler()); server.start(); - RequestLimiter limiter = new RequestLimiter(40); - Random rand = new Random(); - CompletableFuture[] results = new CompletableFuture[REQUESTS]; - HashMap bodies = new HashMap<>(); - - for (int i=0; i { - System.out.println("Client: sendAsync: " + r.uri()); - return client.sendAsync(r, BodyHandlers.ofByteArray()); - }) - .thenCompose((resp) -> { - limiter.requestComplete(); - if (resp.statusCode() != 200) { - String s = "Expected 200, got: " + resp.statusCode(); - System.out.println(s + " from " - + resp.request().uri().getPath()); - return completedWithIOException(s); - } else { - counter++; - System.out.println("Result (" + counter + ") from " - + resp.request().uri().getPath()); - } - return CompletableFuture.completedStage(resp.body()) - .thenApply((b) -> new Pair<>(resp, b)); - }) - .thenAccept((pair) -> { - HttpRequest request = pair.t.request(); - byte[] requestBody = bodies.get(request); - check(Arrays.equals(requestBody, pair.u), - "bodies not equal:[" + bytesToHexString(requestBody) - + "] [" + bytesToHexString(pair.u) + "]"); - - }); - } + // This loop implements a retry mechanism to work around an issue + // on some systems (observed on Windows 10) that seem to be trying to + // throttle the number of connections that can be made concurrently by + // rejecting connection attempts. + // On the first iteration of this loop, we will attempt 20 concurrent + // requests. If this fails with ConnectException, we will retry the + // 20 requests, but limiting the concurrency to 10 (LIMIT <- 10). + // If this fails again, the test will fail. + boolean done = false; + LOOP: do { + RequestLimiter limiter = new RequestLimiter(LIMIT.get()); + Random rand = RANDOM; + CompletableFuture[] results = new CompletableFuture[REQUESTS]; + Map bodies = new ConcurrentHashMap<>(); + + long start = System.nanoTime(); + + for (int i = 0; i < REQUESTS; i++) { + byte[] buf = new byte[(i + 1) * CHUNK_SIZE + i + 1]; // different size bodies + rand.nextBytes(buf); + URI uri = new URI(baseURI.toString() + String.valueOf(i + 1)); + HttpRequest r = HttpRequest.newBuilder(uri) + .header("XFixed", "true") + .POST(BodyPublishers.ofByteArray(buf)) + .build(); + bodies.put(r, buf); + + results[i] = + limiter.whenOkToSend() + .thenCompose((v) -> { + System.out.println("Client: sendAsync: " + r.uri()); + return client.sendAsync(r, BodyHandlers.ofByteArray()); + }) + .handle((resp, t) -> { + limiter.requestComplete(); + CompletionStage, byte[]>> res; + String now = now(start); + if (t == null) { + if (resp.statusCode() != 200) { + String s = "Expected 200, got: " + resp.statusCode(); + System.out.println(now + s + " from " + + resp.request().uri().getPath()); + res = completedWithIOException(s); + return res; + } else { + int counter = COUNT.incrementAndGet(); + System.out.println(now + "Result (" + counter + ") from " + + resp.request().uri().getPath()); + } + res = CompletableFuture.completedStage(resp.body()) + .thenApply((b) -> new Pair<>(resp, b)); + return res; + } else { + int counter = COUNT.incrementAndGet(); + System.out.println(now + "Result (" + counter + ") from " + + r.uri().getPath() + + failure(t)); + res = CompletableFuture.failedFuture(t); + return res; + } + }) + .thenCompose(c -> c) + .thenAccept((pair) -> { + HttpRequest request = pair.t.request(); + byte[] requestBody = bodies.get(request); + check(Arrays.equals(requestBody, pair.u), + "bodies not equal:[" + bytesToHexString(requestBody) + + "] [" + bytesToHexString(pair.u) + "]"); + + }); + } + + // wait for them all to complete and throw exception in case of err + try { + CompletableFuture.allOf(results).join(); + done = true; + } catch (CompletionException e) { + if (!Platform.isWindows()) throw e; + if (LIMIT.get() < REQUESTS) throw e; + Throwable cause = e; + while ((cause = cause.getCause()) != null) { + if (cause instanceof ConnectException) { + // try again, limit concurrency by half + COUNT.set(0); + LIMIT.set(REQUESTS/2); + System.out.println("*** Retrying due to " + cause); + continue LOOP; + } + } + throw e; + } + } while (!done); - // wait for them all to complete and throw exception in case of error - CompletableFuture.allOf(results).join(); } static CompletableFuture completedWithIOException(String message) { @@ -213,13 +295,7 @@ public class ManyRequests { return sb.toString(); } - static final class Pair { - Pair(T t, U u) { - this.t = t; this.u = u; - } - T t; - U u; - } + record Pair(T t, U u) { } /** * A simple limiter for controlling the number of requests to be run in diff --git a/test/jdk/java/net/httpclient/ManyRequests2.java b/test/jdk/java/net/httpclient/ManyRequests2.java index b0eee6e3be4..49e7f758f7c 100644 --- a/test/jdk/java/net/httpclient/ManyRequests2.java +++ b/test/jdk/java/net/httpclient/ManyRequests2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -33,10 +33,14 @@ * @compile ../../../com/sun/net/httpserver/EchoHandler.java * @compile ../../../com/sun/net/httpserver/FileServerHandler.java * @build ManyRequests ManyRequests2 - * @run main/othervm/timeout=40 -Dtest.XFixed=true ManyRequests2 - * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.insertDelay=true ManyRequests2 - * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.chunkSize=64 ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true + * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.insertDelay=true + * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 + * @run main/othervm/timeout=40 -Dtest.XFixed=true -Dtest.chunkSize=64 + * -Djdk.httpclient.HttpClient.log=channel ManyRequests2 * @run main/othervm/timeout=40 -Djdk.internal.httpclient.debug=true + * -Djdk.httpclient.HttpClient.log=channel * -Dtest.XFixed=true -Dtest.insertDelay=true * -Dtest.chunkSize=64 ManyRequests2 * @summary Send a large number of requests asynchronously. diff --git a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java index b8d296087b9..0e9aba5deaf 100644 --- a/test/jdk/java/net/httpclient/ManyRequestsLegacy.java +++ b/test/jdk/java/net/httpclient/ManyRequestsLegacy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -43,6 +43,7 @@ import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HostnameVerifier; + import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsParameters; import com.sun.net.httpserver.HttpsServer; @@ -50,12 +51,18 @@ import com.sun.net.httpserver.HttpExchange; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.URI; import java.net.URLConnection; +import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; @@ -73,12 +80,20 @@ import java.util.LinkedList; import java.util.Random; import java.util.logging.Logger; import java.util.logging.Level; + +import jdk.test.lib.Platform; +import jdk.test.lib.RandomFactory; import jdk.test.lib.net.SimpleSSLContext; import static java.net.Proxy.NO_PROXY; public class ManyRequestsLegacy { - volatile static int counter = 0; + static final int MAX_COUNT = 20; + static final int MAX_LIMIT = 40; + static final AtomicInteger COUNT = new AtomicInteger(); + static final AtomicInteger LIMIT = new AtomicInteger(MAX_LIMIT); + static final Random RANDOM = RandomFactory.getRandom(); + public static void main(String[] args) throws Exception { Logger logger = Logger.getLogger("com.sun.net.httpserver"); @@ -110,7 +125,7 @@ public class ManyRequestsLegacy { } //static final int REQUESTS = 1000; - static final int REQUESTS = 20; + static final int REQUESTS = MAX_COUNT; static final boolean INSERT_DELAY = Boolean.getBoolean("test.insertDelay"); static final int CHUNK_SIZE = Math.max(0, Integer.parseInt(System.getProperty("test.chunkSize", "0"))); @@ -194,7 +209,7 @@ public class ManyRequestsLegacy { } static class TestEchoHandler extends EchoHandler { - final Random rand = new Random(); + final Random rand = RANDOM; @Override public void handle(HttpExchange e) throws IOException { System.out.println("Server: received " + e.getRequestURI()); @@ -220,60 +235,119 @@ public class ManyRequestsLegacy { } } + static String now(long start) { + long elapsed = System.nanoTime() - start; + long ms = elapsed / 1000_000L; + long s = ms / 1000L; + if (s == 0) return ms + "ms: "; + return s + "s, " + (ms - s * 1000L) + "ms: "; + } + + static String failure(Throwable t) { + String s = "\n\t failed: " + t; + for (t = t.getCause(); t != null ; t = t.getCause()) { + s = s + "\n\t\t Caused by: " + t; + } + return s; + } + static void test(HttpsServer server, LegacyHttpClient client) throws Exception { int port = server.getAddress().getPort(); URI baseURI = new URI("https://localhost:" + port + "/foo/x"); server.createContext("/foo", new TestEchoHandler()); server.start(); - RequestLimiter limiter = new RequestLimiter(40); - Random rand = new Random(); - CompletableFuture[] results = new CompletableFuture[REQUESTS]; - HashMap bodies = new HashMap<>(); - - for (int i=0; i { - System.out.println("Client: sendAsync: " + r.uri()); - return client.sendAsync(r, buf); - }) - .thenCompose((resp) -> { - limiter.requestComplete(); - if (resp.statusCode() != 200) { - String s = "Expected 200, got: " + resp.statusCode(); - System.out.println(s + " from " - + resp.request().uri().getPath()); - return completedWithIOException(s); - } else { - counter++; - System.out.println("Result (" + counter + ") from " - + resp.request().uri().getPath()); - } - return CompletableFuture.completedStage(resp.body()) - .thenApply((b) -> new Pair<>(resp, b)); - }) - .thenAccept((pair) -> { - HttpRequest request = pair.t.request(); - byte[] requestBody = bodies.get(request); - check(Arrays.equals(requestBody, pair.u), - "bodies not equal:[" + bytesToHexString(requestBody) - + "] [" + bytesToHexString(pair.u) + "]"); - - }); - } + // This loop implements a retry mechanism to work around an issue + // on some systems (observed on Windows 10) that seem to be trying to + // throttle the number of connections that can be made concurrently by + // rejecting connection attempts. + // On the first iteration of this loop, we will attempt 20 concurrent + // requests. If this fails with ConnectException, we will retry the + // 20 requests, but limiting the concurrency to 10 (LIMIT <- 10). + // If this fails again, the test will fail. + boolean done = false; + LOOP: do { + RequestLimiter limiter = new RequestLimiter(LIMIT.get()); + Random rand = RANDOM; + CompletableFuture[] results = new CompletableFuture[REQUESTS]; + Map bodies = new ConcurrentHashMap<>(); + long start = System.nanoTime(); + + for (int i = 0; i < REQUESTS; i++) { + byte[] buf = new byte[(i + 1) * CHUNK_SIZE + i + 1]; // different size bodies + rand.nextBytes(buf); + URI uri = new URI(baseURI.toString() + String.valueOf(i + 1)); + HttpRequest r = HttpRequest.newBuilder(uri) + .header("XFixed", "true") + .POST(BodyPublishers.ofByteArray(buf)) + .build(); + bodies.put(r, buf); + + results[i] = + limiter.whenOkToSend() + .thenCompose((v) -> { + System.out.println("Client: sendAsync: " + r.uri()); + return client.sendAsync(r, buf); + }) + .handle((resp, t) -> { + limiter.requestComplete(); + CompletionStage, byte[]>> res; + String now = now(start); + if (t == null) { + if (resp.statusCode() != 200) { + String s = "Expected 200, got: " + resp.statusCode(); + System.out.println(now + s + " from " + + resp.request().uri().getPath()); + res = completedWithIOException(s); + return res; + } else { + int counter = COUNT.incrementAndGet(); + System.out.println(now + "Result (" + counter + ") from " + + resp.request().uri().getPath()); + } + res = CompletableFuture.completedStage(resp.body()) + .thenApply((b) -> new Pair<>(resp, b)); + return res; + } else { + int counter = COUNT.incrementAndGet(); + System.out.println(now + "Result (" + counter + ") from " + + r.uri().getPath() + + failure(t)); + res = CompletableFuture.failedFuture(t); + return res; + } + }) + .thenCompose(c -> c) + .thenAccept((pair) -> { + HttpRequest request = pair.t.request(); + byte[] requestBody = bodies.get(request); + check(Arrays.equals(requestBody, pair.u), + "bodies not equal:[" + bytesToHexString(requestBody) + + "] [" + bytesToHexString(pair.u) + "]"); + + }); + } - // wait for them all to complete and throw exception in case of error - CompletableFuture.allOf(results).join(); + try { + // wait for them all to complete and throw exception in case of error + CompletableFuture.allOf(results).join(); + done = true; + } catch (CompletionException e) { + if (!Platform.isWindows()) throw e; + if (LIMIT.get() < REQUESTS) throw e; + Throwable cause = e; + while ((cause = cause.getCause()) != null) { + if (cause instanceof ConnectException) { + // try again, limit concurrency by half + COUNT.set(0); + LIMIT.set(REQUESTS/2); + System.out.println("*** Retrying due to " + cause); + continue LOOP; + } + } + throw e; + } + } while (!done); } static CompletableFuture completedWithIOException(String message) { @@ -294,13 +368,7 @@ public class ManyRequestsLegacy { return sb.toString(); } - static final class Pair { - Pair(T t, U u) { - this.t = t; this.u = u; - } - T t; - U u; - } + record Pair(T t, U u) { } /** * A simple limiter for controlling the number of requests to be run in -- GitLab From e4852c6f0aa25e7d40c577d507aedc7916ee8d50 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Wed, 8 Dec 2021 15:59:37 +0000 Subject: [PATCH 674/890] 8277998: runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#custom-cl-zgc failed "assert(ZAddress::is_marked(addr)) failed: Should be marked" Reviewed-by: iklam, minqi --- src/hotspot/share/cds/dynamicArchive.cpp | 3 ++ src/hotspot/share/cds/lambdaFormInvokers.cpp | 33 ++++++++++++++++--- src/hotspot/share/cds/lambdaFormInvokers.hpp | 6 +++- .../cds/appcds/DumpClassListWithLF.java | 4 +-- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/cds/dynamicArchive.cpp b/src/hotspot/share/cds/dynamicArchive.cpp index c821d46d4d0..64c95e08933 100644 --- a/src/hotspot/share/cds/dynamicArchive.cpp +++ b/src/hotspot/share/cds/dynamicArchive.cpp @@ -354,6 +354,9 @@ public: _builder.doit(); } + ~VM_PopulateDynamicDumpSharedSpace() { + LambdaFormInvokers::cleanup_regenerated_classes(); + } }; void DynamicArchive::check_for_dynamic_dump() { diff --git a/src/hotspot/share/cds/lambdaFormInvokers.cpp b/src/hotspot/share/cds/lambdaFormInvokers.cpp index 5c058dc43ac..59666085d04 100644 --- a/src/hotspot/share/cds/lambdaFormInvokers.cpp +++ b/src/hotspot/share/cds/lambdaFormInvokers.cpp @@ -39,10 +39,11 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" -#include "oops/klass.hpp" +#include "oops/klass.inline.hpp" #include "oops/objArrayKlass.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" +#include "oops/oopHandle.inline.hpp" #include "oops/typeArrayOop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" @@ -50,6 +51,7 @@ GrowableArrayCHeap* LambdaFormInvokers::_lambdaform_lines = nullptr; Array*>* LambdaFormInvokers::_static_archive_invokers = nullptr; +GrowableArrayCHeap* LambdaFormInvokers::_regenerated_mirrors = nullptr; #define NUM_FILTER 4 static const char* filter[NUM_FILTER] = {"java.lang.invoke.Invokers$Holder", @@ -81,6 +83,25 @@ void LambdaFormInvokers::append(char* line) { _lambdaform_lines->append(line); } +// The regenerated Klass is not added to any class loader, so we need +// to keep its java_mirror alive to avoid class unloading. +void LambdaFormInvokers::add_regenerated_class(oop regenerated_class) { + if (_regenerated_mirrors == nullptr) { + _regenerated_mirrors = new GrowableArrayCHeap(150); + } + _regenerated_mirrors->append(OopHandle(Universe::vm_global(), regenerated_class)); +} + +void LambdaFormInvokers::cleanup_regenerated_classes() { + if (_regenerated_mirrors == nullptr) return; + + for (int i = 0; i < _regenerated_mirrors->length(); i++) { + _regenerated_mirrors->at(i).release(Universe::vm_global()); + } + delete _regenerated_mirrors; + _regenerated_mirrors = nullptr; +} + // convenient output class PrintLambdaFormMessage { public: @@ -155,12 +176,11 @@ void LambdaFormInvokers::regenerate_holder_classes(TRAPS) { char *buf = NEW_RESOURCE_ARRAY(char, len); memcpy(buf, (char*)h_bytes->byte_at_addr(0), len); ClassFileStream st((u1*)buf, len, NULL, ClassFileStream::verify); - reload_class(class_name, st, CHECK); + regenerate_class(class_name, st, CHECK); } } -// class_handle - the class name, bytes_handle - the class bytes -void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) { +void LambdaFormInvokers::regenerate_class(char* name, ClassFileStream& st, TRAPS) { Symbol* class_name = SymbolTable::new_symbol((const char*)name); // the class must exist Klass* klass = SystemDictionary::resolve_or_null(class_name, THREAD); @@ -180,6 +200,9 @@ void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) { cl_info, CHECK); + assert(result->java_mirror() != nullptr, "must be"); + add_regenerated_class(result->java_mirror()); + { MutexLocker mu_r(THREAD, Compile_lock); // add_to_hierarchy asserts this. SystemDictionary::add_to_hierarchy(result); @@ -191,7 +214,7 @@ void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) { // exclude the existing class from dump SystemDictionaryShared::set_excluded(InstanceKlass::cast(klass)); SystemDictionaryShared::init_dumptime_info(result); - log_info(cds, lambda)("Replaced class %s, old: " INTPTR_FORMAT " new: " INTPTR_FORMAT, + log_info(cds, lambda)("Regenerated class %s, old: " INTPTR_FORMAT " new: " INTPTR_FORMAT, name, p2i(klass), p2i(result)); } diff --git a/src/hotspot/share/cds/lambdaFormInvokers.hpp b/src/hotspot/share/cds/lambdaFormInvokers.hpp index acb5eab4d8a..c3b151790f1 100644 --- a/src/hotspot/share/cds/lambdaFormInvokers.hpp +++ b/src/hotspot/share/cds/lambdaFormInvokers.hpp @@ -25,6 +25,7 @@ #ifndef SHARE_CDS_LAMBDAFORMINVOKERS_HPP #define SHARE_CDS_LAMBDAFORMINVOKERS_HPP #include "memory/allStatic.hpp" +#include "oops/oopHandle.hpp" #include "runtime/handles.hpp" #include "utilities/growableArray.hpp" @@ -37,7 +38,9 @@ class LambdaFormInvokers : public AllStatic { static GrowableArrayCHeap* _lambdaform_lines; // For storing LF form lines (LF_RESOLVE only) in read only table. static Array*>* _static_archive_invokers; - static void reload_class(char* name, ClassFileStream& st, TRAPS); + static GrowableArrayCHeap* _regenerated_mirrors; + static void regenerate_class(char* name, ClassFileStream& st, TRAPS); + static void add_regenerated_class(oop regenerated_class); public: static void append(char* line); static void append_filtered(char* line); @@ -45,5 +48,6 @@ class LambdaFormInvokers : public AllStatic { static void read_static_archive_invokers(); static void regenerate_holder_classes(TRAPS); static void serialize(SerializeClosure* soc); + static void cleanup_regenerated_classes(); }; #endif // SHARE_CDS_LAMBDAFORMINVOKERS_HPP diff --git a/test/hotspot/jtreg/runtime/cds/appcds/DumpClassListWithLF.java b/test/hotspot/jtreg/runtime/cds/appcds/DumpClassListWithLF.java index a0a898989e1..b0851f46e9c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/DumpClassListWithLF.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/DumpClassListWithLF.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -33,7 +33,7 @@ */ public class DumpClassListWithLF extends ClassListFormatBase { - static final String REPLACE_OK = "Replaced class java/lang/invoke/DirectMethodHandle$Holder"; + static final String REPLACE_OK = "Regenerated class java/lang/invoke/DirectMethodHandle$Holder"; public static void main(String[] args) throws Throwable { String appJar = JarBuilder.getOrCreateHelloJar(); -- GitLab From 40d726b8aae7dff4316115b3a25001d502321efe Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Wed, 8 Dec 2021 16:07:49 +0000 Subject: [PATCH 675/890] 8278310: Improve logging in CDS DynamicLoaderConstraintsTest.java Reviewed-by: iklam --- src/hotspot/share/cds/archiveBuilder.hpp | 4 ++-- .../loaderConstraints/DynamicLoaderConstraintsTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/cds/archiveBuilder.hpp b/src/hotspot/share/cds/archiveBuilder.hpp index 1057d05b083..484f7271a7c 100644 --- a/src/hotspot/share/cds/archiveBuilder.hpp +++ b/src/hotspot/share/cds/archiveBuilder.hpp @@ -312,14 +312,14 @@ public: template u4 buffer_to_offset_u4(T p) const { uintx offset = buffer_to_offset((address)p); - guarantee(offset <= MAX_SHARED_DELTA, "must be 32-bit offset"); + guarantee(offset <= MAX_SHARED_DELTA, "must be 32-bit offset " INTPTR_FORMAT, offset); return (u4)offset; } template u4 any_to_offset_u4(T p) const { uintx offset = any_to_offset((address)p); - guarantee(offset <= MAX_SHARED_DELTA, "must be 32-bit offset"); + guarantee(offset <= MAX_SHARED_DELTA, "must be 32-bit offset " INTPTR_FORMAT, offset); return (u4)offset; } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java b/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java index 9d194c288a3..e983b5a7aec 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java @@ -139,7 +139,7 @@ public class DynamicLoaderConstraintsTest extends DynamicArchiveTestBase { "java.base,jdk.httpserver", "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", - "-Xlog:class+load,class+loader+constraints", + "-Xlog:cds=debug,class+load,class+loader+constraints", }; if (useCustomLoader) { -- GitLab From 79165b738d6d1336740631c855960a235b9ecfe4 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Wed, 8 Dec 2021 16:10:06 +0000 Subject: [PATCH 676/890] 8278324: Update the --generate-cds-archive jlink plugin usage message Reviewed-by: alanb --- .../share/classes/jdk/tools/jlink/resources/plugins.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties index 958c43c2ca4..017c46baab0 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties @@ -142,7 +142,8 @@ generate-cds-archive.description=\ CDS plugin: generate cds archives if the runtime image supports CDS feature.\n\ generate-cds-archive.usage=\ -\ --generate-cds-archive Generate CDS archives if the runtime image supports CDS feature. +\ --generate-cds-archive Generate CDS archive if the runtime image supports\n\ +\ the CDS feature. generate-jli-classes.argument=@filename -- GitLab From 3e93e0b809f2c6cb4a466af92ec678cbc82863e4 Mon Sep 17 00:00:00 2001 From: Yumin Qi Date: Wed, 8 Dec 2021 16:20:39 +0000 Subject: [PATCH 677/890] 8276769: -Xshare:auto should tolerate problems in the CDS archive Reviewed-by: iklam, ccheung --- src/hotspot/share/cds/filemap.cpp | 228 +++++++++++------- src/hotspot/share/include/cds.h | 4 +- src/hotspot/share/runtime/arguments.cpp | 37 ++- src/hotspot/share/runtime/arguments.hpp | 2 +- .../cds/appcds/SharedArchiveConsistency.java | 16 +- .../dynamicArchive/ArchiveConsistency.java | 101 +++++--- .../DynamicArchiveTestBase.java | 6 +- 7 files changed, 259 insertions(+), 135 deletions(-) diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 72a0d35bca7..89a4d90d257 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -121,7 +121,6 @@ void FileMapInfo::fail_continue(const char *msg, ...) { fail_exit(msg, ap); } else { if (log_is_enabled(Info, cds)) { - ResourceMark rm; LogStream ls(Log(cds)::info()); ls.print("UseSharedSpaces: "); ls.vprint_cr(msg, ap); @@ -1042,15 +1041,20 @@ void FileMapInfo::validate_non_existent_class_paths() { } } -// a utility class for checking file header +// A utility class for reading/validating the GenericCDSFileMapHeader portion of +// a CDS archive's header. The file header of all CDS archives with versions from +// CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION (12) are guaranteed to always start +// with GenericCDSFileMapHeader. This makes it possible to read important information +// from a CDS archive created by a different version of HotSpot, so that we can +// automatically regenerate the archive as necessary (JDK-8261455). class FileHeaderHelper { int _fd; - GenericCDSFileMapHeader _header; + bool _is_valid; + GenericCDSFileMapHeader* _header; + const char* _base_archive_name; public: - FileHeaderHelper() { - _fd = -1; - } + FileHeaderHelper() : _fd(-1), _is_valid(false), _header(nullptr), _base_archive_name(nullptr) {} ~FileHeaderHelper() { if (_fd != -1) { @@ -1059,8 +1063,10 @@ public: } bool initialize(const char* archive_name) { + log_info(cds)("Opening shared archive: %s", archive_name); _fd = os::open(archive_name, O_RDONLY | O_BINARY, 0); if (_fd < 0) { + FileMapInfo::fail_continue("Specified shared archive not found (%s)", archive_name); return false; } return initialize(_fd); @@ -1069,117 +1075,185 @@ public: // for an already opened file, do not set _fd bool initialize(int fd) { assert(fd != -1, "Archive should be opened"); + + + // First read the generic header so we know the exact size of the actual header. + GenericCDSFileMapHeader gen_header; size_t size = sizeof(GenericCDSFileMapHeader); lseek(fd, 0, SEEK_SET); - size_t n = os::read(fd, (void*)&_header, (unsigned int)size); + size_t n = os::read(fd, (void*)&gen_header, (unsigned int)size); if (n != size) { - vm_exit_during_initialization("Unable to read generic CDS file map header from shared archive"); + FileMapInfo::fail_continue("Unable to read generic CDS file map header from shared archive"); return false; } + + if (gen_header._magic != CDS_ARCHIVE_MAGIC && + gen_header._magic != CDS_DYNAMIC_ARCHIVE_MAGIC) { + FileMapInfo::fail_continue("The shared archive file has a bad magic number: %#x", gen_header._magic); + return false; + } + + if (gen_header._version < CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION) { + FileMapInfo::fail_continue("Cannot handle shared archive file version %d. Must be at least %d", + gen_header._version, CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION); + return false; + } + + size_t filelen = os::lseek(fd, 0, SEEK_END); + if (gen_header._header_size >= filelen) { + FileMapInfo::fail_continue("Archive file header larger than archive file"); + return false; + } + + // Read the actual header and perform more checks + size = gen_header._header_size; + _header = (GenericCDSFileMapHeader*)NEW_C_HEAP_ARRAY(char, size, mtInternal); + lseek(fd, 0, SEEK_SET); + n = os::read(fd, (void*)_header, (unsigned int)size); + if (n != size) { + FileMapInfo::fail_continue("Unable to read actual CDS file map header from shared archive"); + return false; + } + + if (!check_crc()) { + return false; + } + + if (!check_and_init_base_archive_name()) { + return false; + } + + // All fields in the GenericCDSFileMapHeader has been validated. + _is_valid = true; return true; } GenericCDSFileMapHeader* get_generic_file_header() { - return &_header; - } - - char* read_base_archive_name() { - assert(_fd != -1, "Archive should be open"); - size_t name_size = _header._base_archive_name_size; - assert(name_size != 0, "For non-default base archive, name size should be non-zero!"); - char* base_name = NEW_C_HEAP_ARRAY(char, name_size, mtInternal); - lseek(_fd, _header._base_archive_name_offset, SEEK_SET); // position to correct offset. - size_t n = os::read(_fd, base_name, (unsigned int)name_size); - if (n != name_size) { - log_info(cds)("Unable to read base archive name from archive"); - FREE_C_HEAP_ARRAY(char, base_name); - return nullptr; + assert(_header != nullptr && _is_valid, "must be a valid archive file"); + return _header; + } + + const char* base_archive_name() { + assert(_header != nullptr && _is_valid, "must be a valid archive file"); + return _base_archive_name; + } + + private: + bool check_crc() { + if (VerifySharedSpaces) { + FileMapHeader* header = (FileMapHeader*)_header; + int actual_crc = header->compute_crc(); + if (actual_crc != header->crc()) { + log_info(cds)("_crc expected: %d", header->crc()); + log_info(cds)(" actual: %d", actual_crc); + FileMapInfo::fail_continue("Header checksum verification failed."); + return false; + } } - if (base_name[name_size - 1] != '\0' || strlen(base_name) != name_size - 1) { - log_info(cds)("Base archive name is damaged"); - FREE_C_HEAP_ARRAY(char, base_name); - return nullptr; + return true; + } + + bool check_and_init_base_archive_name() { + unsigned int name_offset = _header->_base_archive_name_offset; + unsigned int name_size = _header->_base_archive_name_size; + unsigned int header_size = _header->_header_size; + + if (name_offset + name_size < name_offset) { + FileMapInfo::fail_continue("base_archive_name offset/size overflow: " UINT32_FORMAT "/" UINT32_FORMAT, + name_offset, name_size); + return false; } - if (!os::file_exists(base_name)) { - log_info(cds)("Base archive %s does not exist", base_name); - FREE_C_HEAP_ARRAY(char, base_name); - return nullptr; + if (_header->_magic == CDS_ARCHIVE_MAGIC) { + if (name_offset != 0) { + FileMapInfo::fail_continue("static shared archive must have zero _base_archive_name_offset"); + return false; + } + if (name_size != 0) { + FileMapInfo::fail_continue("static shared archive must have zero _base_archive_name_size"); + return false; + } + } else { + assert(_header->_magic == CDS_DYNAMIC_ARCHIVE_MAGIC, "must be"); + if ((name_size == 0 && name_offset != 0) || + (name_size != 0 && name_offset == 0)) { + // If either is zero, both must be zero. This indicates that we are using the default base archive. + FileMapInfo::fail_continue("Invalid base_archive_name offset/size: " UINT32_FORMAT "/" UINT32_FORMAT, + name_offset, name_size); + return false; + } + if (name_size > 0) { + if (name_offset + name_size > header_size) { + FileMapInfo::fail_continue("Invalid base_archive_name offset/size (out of range): " + UINT32_FORMAT " + " UINT32_FORMAT " > " UINT32_FORMAT , + name_offset, name_size, header_size); + return false; + } + const char* name = ((const char*)_header) + _header->_base_archive_name_offset; + if (name[name_size - 1] != '\0' || strlen(name) != name_size - 1) { + FileMapInfo::fail_continue("Base archive name is damaged"); + return false; + } + if (!os::file_exists(name)) { + FileMapInfo::fail_continue("Base archive %s does not exist", name); + return false; + } + _base_archive_name = name; + } } - return base_name; + return true; } }; bool FileMapInfo::check_archive(const char* archive_name, bool is_static) { FileHeaderHelper file_helper; if (!file_helper.initialize(archive_name)) { - // do not vm_exit_during_initialization here because Arguments::init_shared_archive_paths() - // requires a shared archive name. The open_for_read() function will log a message regarding - // failure in opening a shared archive. + // Any errors are reported by fail_continue(). return false; } GenericCDSFileMapHeader* header = file_helper.get_generic_file_header(); if (is_static) { if (header->_magic != CDS_ARCHIVE_MAGIC) { - vm_exit_during_initialization("Not a base shared archive", archive_name); - return false; - } - if (header->_base_archive_name_offset != 0) { - log_info(cds)("_base_archive_name_offset should be 0"); - log_info(cds)("_base_archive_name_offset = " UINT32_FORMAT, header->_base_archive_name_offset); + fail_continue("Not a base shared archive: %s", archive_name); return false; } } else { if (header->_magic != CDS_DYNAMIC_ARCHIVE_MAGIC) { - vm_exit_during_initialization("Not a top shared archive", archive_name); + fail_continue("Not a top shared archive: %s", archive_name); return false; } - unsigned int name_size = header->_base_archive_name_size; - unsigned int name_offset = header->_base_archive_name_offset; - unsigned int header_size = header->_header_size; - if (name_offset + name_size != header_size) { - log_info(cds)("_header_size should be equal to _base_archive_name_offset plus _base_archive_name_size"); - log_info(cds)(" _base_archive_name_size = " UINT32_FORMAT, name_size); - log_info(cds)(" _base_archive_name_offset = " UINT32_FORMAT, name_offset); - log_info(cds)(" _header_size = " UINT32_FORMAT, header_size); - return false; - } - char* base_name = file_helper.read_base_archive_name(); - if (base_name == nullptr) { - return false; - } - FREE_C_HEAP_ARRAY(char, base_name); } return true; } +// Return value: +// false: +// is not a valid archive. *base_archive_name is set to null. +// true && (*base_archive_name) == NULL: +// is a valid static archive. +// true && (*base_archive_name) != NULL: +// is a valid dynamic archive. bool FileMapInfo::get_base_archive_name_from_header(const char* archive_name, char** base_archive_name) { FileHeaderHelper file_helper; + *base_archive_name = NULL; + if (!file_helper.initialize(archive_name)) { return false; } GenericCDSFileMapHeader* header = file_helper.get_generic_file_header(); if (header->_magic != CDS_DYNAMIC_ARCHIVE_MAGIC) { - // Not a dynamic header, no need to proceed further. - return false; + assert(header->_magic == CDS_ARCHIVE_MAGIC, "must be"); + return true; } - if ((header->_base_archive_name_size == 0 && header->_base_archive_name_offset != 0) || - (header->_base_archive_name_size != 0 && header->_base_archive_name_offset == 0)) { - fail_continue("Default base archive not set correct"); - return false; - } - if (header->_base_archive_name_size == 0 && - header->_base_archive_name_offset == 0) { + const char* base = file_helper.base_archive_name(); + if (base == nullptr) { *base_archive_name = Arguments::get_default_shared_archive_path(); } else { - // read the base archive name - *base_archive_name = file_helper.read_base_archive_name(); - if (*base_archive_name == nullptr) { - return false; - } + *base_archive_name = os::strdup_check_oom(base); } + return true; } @@ -1247,16 +1321,6 @@ bool FileMapInfo::init_from_file(int fd) { return false; } - if (VerifySharedSpaces) { - int expected_crc = header()->compute_crc(); - if (expected_crc != header()->crc()) { - log_info(cds)("_crc expected: %d", expected_crc); - log_info(cds)(" actual: %d", header()->crc()); - FileMapInfo::fail_continue("Header checksum verification failed."); - return false; - } - } - _file_offset = header()->header_size(); // accounts for the size of _base_archive_name if (is_static()) { @@ -1294,9 +1358,9 @@ bool FileMapInfo::open_for_read() { int fd = os::open(_full_path, O_RDONLY | O_BINARY, 0); if (fd < 0) { if (errno == ENOENT) { - fail_continue("Specified shared archive not found (%s).", _full_path); + fail_continue("Specified shared archive not found (%s)", _full_path); } else { - fail_continue("Failed to open shared archive file (%s).", + fail_continue("Failed to open shared archive file (%s)", os::strerror(errno)); } return false; diff --git a/src/hotspot/share/include/cds.h b/src/hotspot/share/include/cds.h index eeb45ba34c4..476f84c34df 100644 --- a/src/hotspot/share/include/cds.h +++ b/src/hotspot/share/include/cds.h @@ -38,6 +38,7 @@ #define NUM_CDS_REGIONS 7 // this must be the same as MetaspaceShared::n_regions #define CDS_ARCHIVE_MAGIC 0xf00baba2 #define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba8 +#define CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION 12 #define CURRENT_CDS_ARCHIVE_VERSION 12 typedef struct CDSFileMapRegion { @@ -59,7 +60,8 @@ typedef struct CDSFileMapRegion { char* _mapped_base; // Actually mapped address (NULL if this region is not mapped). } CDSFileMapRegion; -// This portion of the archive file header must remain unchanged for _version >= 12. +// This portion of the archive file header must remain unchanged for +// _version >= CDS_GENERIC_HEADER_SUPPORTED_MIN_VERSION (12). // This makes it possible to read important information from a CDS archive created by // a different version of HotSpot, so that we can automatically regenerate the archive as necessary. typedef struct GenericCDSFileMapHeader { diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index adfe1a1fb6a..fe54fd3cb29 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -3449,7 +3449,7 @@ jint Arguments::parse_options_buffer(const char* name, char* buffer, const size_ return vm_args->set_args(&options); } -jint Arguments::set_shared_spaces_flags_and_archive_paths() { +void Arguments::set_shared_spaces_flags_and_archive_paths() { if (DumpSharedSpaces) { if (RequireSharedSpaces) { warning("Cannot dump shared archive while using shared archive"); @@ -3459,9 +3459,12 @@ jint Arguments::set_shared_spaces_flags_and_archive_paths() { #if INCLUDE_CDS // Initialize shared archive paths which could include both base and dynamic archive paths // This must be after set_ergonomics_flags() called so flag UseCompressedOops is set properly. - init_shared_archive_paths(); + // + // UseSharedSpaces may be disabled if -XX:SharedArchiveFile is invalid. + if (DumpSharedSpaces || UseSharedSpaces) { + init_shared_archive_paths(); + } #endif // INCLUDE_CDS - return JNI_OK; } #if INCLUDE_CDS @@ -3510,7 +3513,9 @@ void Arguments::extract_shared_archive_paths(const char* archive_path, char* cur_path = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal); strncpy(cur_path, begin_ptr, len); cur_path[len] = '\0'; - FileMapInfo::check_archive((const char*)cur_path, true /*is_static*/); + if (!FileMapInfo::check_archive((const char*)cur_path, true /*is_static*/)) { + return; + } *base_archive_path = cur_path; begin_ptr = ++end_ptr; @@ -3522,7 +3527,9 @@ void Arguments::extract_shared_archive_paths(const char* archive_path, len = end_ptr - begin_ptr; cur_path = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal); strncpy(cur_path, begin_ptr, len + 1); - FileMapInfo::check_archive((const char*)cur_path, false /*is_static*/); + if (!FileMapInfo::check_archive((const char*)cur_path, false /*is_static*/)) { + return; + } *top_archive_path = cur_path; } @@ -3566,17 +3573,26 @@ void Arguments::init_shared_archive_paths() { "Cannot have more than 2 archive files specified in the -XX:SharedArchiveFile option"); } if (archives == 1) { - char* temp_archive_path = os::strdup_check_oom(SharedArchiveFile, mtArguments); + char* base_archive_path = NULL; bool success = - FileMapInfo::get_base_archive_name_from_header(temp_archive_path, &SharedArchivePath); + FileMapInfo::get_base_archive_name_from_header(SharedArchiveFile, &base_archive_path); if (!success) { - SharedArchivePath = temp_archive_path; + no_shared_spaces("invalid archive"); + } else if (base_archive_path == NULL) { + // User has specified a single archive, which is a static archive. + SharedArchivePath = const_cast(SharedArchiveFile); } else { - SharedDynamicArchivePath = temp_archive_path; + // User has specified a single archive, which is a dynamic archive. + SharedDynamicArchivePath = const_cast(SharedArchiveFile); + SharedArchivePath = base_archive_path; // has been c-heap allocated. } } else { extract_shared_archive_paths((const char*)SharedArchiveFile, &SharedArchivePath, &SharedDynamicArchivePath); + if (SharedArchivePath == NULL) { + assert(SharedDynamicArchivePath == NULL, "must be"); + no_shared_spaces("invalid archive"); + } } if (SharedDynamicArchivePath != nullptr) { @@ -4049,8 +4065,7 @@ jint Arguments::apply_ergo() { GCConfig::arguments()->initialize(); - result = set_shared_spaces_flags_and_archive_paths(); - if (result != JNI_OK) return result; + set_shared_spaces_flags_and_archive_paths(); // Initialize Metaspace flags and alignments Metaspace::ergo_initialize(); diff --git a/src/hotspot/share/runtime/arguments.hpp b/src/hotspot/share/runtime/arguments.hpp index 0867f5c5c4d..40b9308c82b 100644 --- a/src/hotspot/share/runtime/arguments.hpp +++ b/src/hotspot/share/runtime/arguments.hpp @@ -366,7 +366,7 @@ class Arguments : AllStatic { static void set_use_compressed_oops(); static void set_use_compressed_klass_ptrs(); static jint set_ergonomics_flags(); - static jint set_shared_spaces_flags_and_archive_paths(); + static void set_shared_spaces_flags_and_archive_paths(); // Limits the given heap size by the maximum amount of virtual // memory this process is currently allowed to use. It also takes // the virtual-to-physical ratio of the current GC into account. diff --git a/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java b/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java index 57086f343b3..aee023198f5 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java @@ -112,7 +112,8 @@ public class SharedArchiveConsistency { // test, should pass System.out.println("1. Normal, should pass but may fail\n"); - String[] execArgs = {"-Xlog:cds=debug", "-cp", jarFile, "Hello"}; + // disable VerifySharedSpaces, it may be turned on by jtreg args + String[] execArgs = {"-Xlog:cds=debug", "-XX:-VerifySharedSpaces", "-cp", jarFile, "Hello"}; // tests that corrupt contents of the archive need to run with // VerifySharedSpaces enabled to detect inconsistencies String[] verifyExecArgs = {"-Xlog:cds", "-XX:+VerifySharedSpaces", "-cp", jarFile, "Hello"}; @@ -172,7 +173,7 @@ public class SharedArchiveConsistency { System.out.println("\n2d. Corrupt _version, should fail\n"); String modVersion = startNewArchive("modify-version"); copiedJsa = CDSArchiveUtils.copyArchiveFile(orgJsaFile, modVersion); - CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetVersion(), 0x00000000); + CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetVersion(), 0x3FFFFFFF); output = shareAuto ? TestCommon.execAuto(execArgs) : TestCommon.execCommon(execArgs); output.shouldContain("The shared archive file has the wrong version"); output.shouldNotContain("Checksum verification failed"); @@ -180,6 +181,17 @@ public class SharedArchiveConsistency { output.shouldContain(HELLO_WORLD); } + System.out.println("\n2e. Corrupt _version, should fail\n"); + String modVersion2 = startNewArchive("modify-version2"); + copiedJsa = CDSArchiveUtils.copyArchiveFile(orgJsaFile, modVersion2); + CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetVersion(), 0x00000000); + output = shareAuto ? TestCommon.execAuto(execArgs) : TestCommon.execCommon(execArgs); + output.shouldContain("Cannot handle shared archive file version 0. Must be at least 12"); + output.shouldNotContain("Checksum verification failed"); + if (shareAuto) { + output.shouldContain(HELLO_WORLD); + } + // modify content inside regions System.out.println("\n3. Corrupt Content, should fail\n"); for (int i=0; i { for (String s : checkMessages) { output.shouldContain(s); } + output.shouldContain(HELLO_WORLD); }); } else { result.assertAbnormalExit( output -> { for (String s : checkMessages) { output.shouldContain(s); } + output.shouldContain("Unable to use shared archive"); }); } } + private static void startTest(String str) { + System.out.println("\n" + str); + } + private static void doTest(String baseArchiveName, String topArchiveName) throws Exception { String appJar = ClassFileInstaller.getJarPath("hello.jar"); String mainClass = "Hello"; @@ -94,42 +110,36 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { throw new IOException(jsa + " does not exist!"); } - // 1. Modify the CRC values in the header of the top archive. - System.out.println("\n1. Modify the CRC values in the header of the top archive"); + startTest("1. Modify the CRC values in the header of the top archive"); String modTop = getNewArchiveName("modTopRegionsCrc"); File copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, modTop); CDSArchiveUtils.modifyAllRegionsCrc(copiedJsa); + VERIFY_CRC = true; runTwo(baseArchiveName, modTop, - appJar, mainClass, 1, - new String[] {"Header checksum verification failed", - "Unable to use shared archive"}); + appJar, mainClass, isAuto ? 0 : 1, + "Header checksum verification failed"); + VERIFY_CRC = false; - // 2. Make header size larger than the archive size - System.out.println("\n2. Make header size larger than the archive size"); + startTest("2. Make header size larger than the archive size"); String largerHeaderSize = getNewArchiveName("largerHeaderSize"); copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, largerHeaderSize); CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetHeaderSize(), (int)copiedJsa.length() + 1024); runTwo(baseArchiveName, largerHeaderSize, - appJar, mainClass, 1, - new String[] {"_header_size should be equal to _base_archive_name_offset plus _base_archive_name_size", - "Unable to use shared archive"}); + appJar, mainClass, isAuto ? 0 : 1, + "Archive file header larger than archive file"); - // 3. Make base archive path offset beyond of header size - System.out.println("\n3. Make base archive path offset beyond of header size."); + startTest("3. Make base archive name offset beyond of header size."); String wrongBaseArchiveNameOffset = getNewArchiveName("wrongBaseArchiveNameOffset"); copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseArchiveNameOffset); int fileHeaderSize = (int)CDSArchiveUtils.fileHeaderSize(copiedJsa); int baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa); CDSArchiveUtils.modifyHeaderIntField(copiedJsa, CDSArchiveUtils.offsetBaseArchiveNameOffset(), baseArchiveNameOffset + 1024); runTwo(baseArchiveName, wrongBaseArchiveNameOffset, - appJar, mainClass, 1, - new String[] {"_header_size should be equal to _base_archive_name_offset plus _base_archive_name_size", - "The shared archive file has an incorrect header size", - "Unable to use shared archive"}); + appJar, mainClass, isAuto ? 0 : 1, + "Invalid base_archive_name offset/size (out of range)"); - // 4. Make base archive path offset points to middle of name size - System.out.println("\n4. Make base archive path offset points to middle of name size"); + startTest("4. Make base archive name offset points to middle of the base archive name"); String wrongBaseNameOffset = getNewArchiveName("wrongBaseNameOffset"); copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseNameOffset); int baseArchiveNameSize = CDSArchiveUtils.baseArchiveNameSize(copiedJsa); @@ -137,13 +147,10 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { CDSArchiveUtils.modifyHeaderIntField(copiedJsa, baseArchiveNameOffset, baseArchiveNameOffset + baseArchiveNameSize/2); runTwo(baseArchiveName, wrongBaseNameOffset, - appJar, mainClass, 1, - new String[] {"An error has occurred while processing the shared archive file.", - "Header checksum verification failed", - "Unable to use shared archive"}); + appJar, mainClass, isAuto ? 0 : 1, + "Base archive name is damaged"); - // 5. Make base archive name not terminated with '\0' - System.out.println("\n5. Make base archive name not terminated with '\0'"); + startTest("5. Make base archive name not terminated with '\0'"); String wrongBaseName = getNewArchiveName("wrongBaseName"); copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseName); baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa); @@ -152,12 +159,10 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { CDSArchiveUtils.writeData(copiedJsa, offset, new byte[] {(byte)'X'}); runTwo(baseArchiveName, wrongBaseName, - appJar, mainClass, 1, - new String[] {"Base archive name is damaged", - "Header checksum verification failed"}); + appJar, mainClass, isAuto ? 0 : 1, + "Base archive name is damaged"); - // 6. Modify base archive name to a file that doesn't exist. - System.out.println("\n6. Modify base archive name to a file that doesn't exist"); + startTest("6. Modify base archive name to a file that doesn't exist"); String wrongBaseName2 = getNewArchiveName("wrongBaseName2"); copiedJsa = CDSArchiveUtils.copyArchiveFile(jsa, wrongBaseName2); baseArchiveNameOffset = CDSArchiveUtils.baseArchiveNameOffset(copiedJsa); @@ -170,8 +175,32 @@ public class ArchiveConsistency extends DynamicArchiveTestBase { (new File(badName)).delete(); runTwo(baseArchiveName, wrongBaseName2, - appJar, mainClass, 1, - new String[] {"Base archive " + badName + " does not exist", - "Header checksum verification failed"}); + appJar, mainClass, isAuto ? 0 : 1, + "Base archive " + badName + " does not exist"); + + // Following three tests: + // -XX:SharedArchiveFile=non-exist-base.jsa:top.jsa + // -XX:SharedArchiveFile=base.jsa:non-exist-top.jsa + // -XX:SharedArchiveFile=non-exist-base.jsa:non-exist-top.jsa + startTest("7. Non-exist base archive"); + String nonExistBase = "non-exist-base.jsa"; + File nonExistBaseFile = new File(nonExistBase); + nonExistBaseFile.delete(); + runTwo(nonExistBase, topArchiveName, + appJar, mainClass, isAuto ? 0 : 1, + "Specified shared archive not found (" + nonExistBase + ")"); + + startTest("8. Non-exist top archive"); + String nonExistTop = "non-exist-top.jsa"; + File nonExistTopFile = new File(nonExistTop); + nonExistTopFile.delete(); + runTwo(baseArchiveName, nonExistTop, + appJar, mainClass, isAuto ? 0 : 1, + "Specified shared archive not found (" + nonExistTop + ")"); + + startTest("9. nost-exist-base and non-exist-top"); + runTwo(nonExistBase, nonExistTop, + appJar, mainClass, isAuto ? 0 : 1, + "Specified shared archive not found (" + nonExistBase + ")"); } } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java index b61894c1b4b..b46eb7ea35a 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java @@ -36,6 +36,7 @@ import sun.hotspot.WhiteBox; */ class DynamicArchiveTestBase { private static boolean executedIn_run = false; + private static boolean autoMode = false; // -Xshare:auto private static final WhiteBox WB = WhiteBox.getWhiteBox(); @@ -47,6 +48,7 @@ class DynamicArchiveTestBase { public void run(String args[]) throws Exception; } + public static void setAutoMode(boolean val) { autoMode = val; } /* * Tests for dynamic archives should be written using this pattern: @@ -183,7 +185,7 @@ class DynamicArchiveTestBase { (topArchiveName == null) ? baseArchiveName : baseArchiveName + File.pathSeparator + topArchiveName; String[] cmdLine = TestCommon.concat( - "-Xshare:on", + autoMode ? "-Xshare:auto" : "-Xshare:on", "-XX:SharedArchiveFile=" + archiveFiles); cmdLine = TestCommon.concat(cmdLine, cmdLineSuffix); return execProcess("exec", null, cmdLine); @@ -202,7 +204,7 @@ class DynamicArchiveTestBase { (topArchiveName == null) ? baseArchiveName : baseArchiveName + File.pathSeparator + topArchiveName; String[] cmdLine = TestCommon.concat( - "-Xshare:on", + autoMode ? "-Xshare:auto" : "-Xshare:on", "-XX:SharedArchiveFile=" + archiveFiles); cmdLine = TestCommon.concat(cmdLine, cmdLineSuffix); return execProcess("exec", jarDir, cmdLine); -- GitLab From 8af3b27ce98bcb9cf0c155c98d6b9a9bc159aafe Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 8 Dec 2021 16:39:24 +0000 Subject: [PATCH 678/890] 8277850: C2: optimize mask checks in counted loops Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/mulnode.cpp | 93 ++++++++++++++- src/hotspot/share/opto/mulnode.hpp | 5 + .../compiler/c2/irTests/TestShiftAndMask.java | 108 ++++++++++++++++++ .../compiler/lib/ir_framework/IRNode.java | 8 ++ 4 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/c2/irTests/TestShiftAndMask.java diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp index a45ad23f6c1..e28ccb6e94a 100644 --- a/src/hotspot/share/opto/mulnode.cpp +++ b/src/hotspot/share/opto/mulnode.cpp @@ -505,6 +505,15 @@ const Type *AndINode::mul_ring( const Type *t0, const Type *t1 ) const { return TypeInt::INT; // No constants to be had } +const Type* AndINode::Value(PhaseGVN* phase) const { + // patterns similar to (v << 2) & 3 + if (AndIL_shift_and_mask(phase, in(2), in(1), T_INT)) { + return TypeInt::ZERO; + } + + return MulNode::Value(phase); +} + //------------------------------Identity--------------------------------------- // Masking off the high bits of an unsigned load is not required Node* AndINode::Identity(PhaseGVN* phase) { @@ -598,6 +607,12 @@ Node *AndINode::Ideal(PhaseGVN *phase, bool can_reshape) { phase->type(load->in(1)) == TypeInt::ZERO ) return new AndINode( load->in(2), in(2) ); + // pattern similar to (v1 + (v2 << 2)) & 3 transformed to v1 & 3 + Node* progress = AndIL_add_shift_and_mask(phase, T_INT); + if (progress != NULL) { + return progress; + } + return MulNode::Ideal(phase, can_reshape); } @@ -629,6 +644,15 @@ const Type *AndLNode::mul_ring( const Type *t0, const Type *t1 ) const { return TypeLong::LONG; // No constants to be had } +const Type* AndLNode::Value(PhaseGVN* phase) const { + // patterns similar to (v << 2) & 3 + if (AndIL_shift_and_mask(phase, in(2), in(1), T_LONG)) { + return TypeLong::ZERO; + } + + return MulNode::Value(phase); +} + //------------------------------Identity--------------------------------------- // Masking off the high bits of an unsigned load is not required Node* AndLNode::Identity(PhaseGVN* phase) { @@ -675,7 +699,7 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { const jlong mask = t2->get_con(); Node* in1 = in(1); - uint op = in1->Opcode(); + int op = in1->Opcode(); // Are we masking a long that was converted from an int with a mask // that fits in 32-bits? Commute them and use an AndINode. Don't @@ -705,6 +729,12 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } + // pattern similar to (v1 + (v2 << 2)) & 3 transformed to v1 & 3 + Node* progress = AndIL_add_shift_and_mask(phase, T_LONG); + if (progress != NULL) { + return progress; + } + return MulNode::Ideal(phase, can_reshape); } @@ -1683,3 +1713,64 @@ const Type* RotateRightNode::Value(PhaseGVN* phase) const { return TypeLong::LONG; } } + +// Helper method to transform: +// patterns similar to (v << 2) & 3 to 0 +// and +// patterns similar to (v1 + (v2 << 2)) & 3 transformed to v1 & 3 +bool MulNode::AndIL_shift_and_mask(PhaseGVN* phase, Node* mask, Node* shift, BasicType bt) { + if (mask == NULL || shift == NULL) { + return false; + } + const TypeInteger* mask_t = phase->type(mask)->isa_integer(bt); + const TypeInteger* shift_t = phase->type(shift)->isa_integer(bt); + if (mask_t == NULL || shift_t == NULL) { + return false; + } + if (bt == T_LONG && shift != NULL && shift->Opcode() == Op_ConvI2L) { + bt = T_INT; + shift = shift->in(1); + if (shift == NULL) { + return false; + } + } + if (shift->Opcode() != Op_LShift(bt)) { + return false; + } + Node* shift2 = shift->in(2); + if (shift2 == NULL) { + return false; + } + const Type* shift2_t = phase->type(shift2); + if (!shift2_t->isa_int() || !shift2_t->is_int()->is_con()) { + return false; + } + + jint shift_con = shift2_t->is_int()->get_con() & ((bt == T_INT ? BitsPerJavaInteger : BitsPerJavaLong) - 1); + if ((((jlong)1) << shift_con) > mask_t->hi_as_long() && mask_t->lo_as_long() >= 0) { + return true; + } + + return false; +} + +// Helper method to transform: +// patterns similar to (v1 + (v2 << 2)) & 3 to v1 & 3 +Node* MulNode::AndIL_add_shift_and_mask(PhaseGVN* phase, BasicType bt) { + Node* in1 = in(1); + Node* in2 = in(2); + if (in1 != NULL && in2 != NULL && in1->Opcode() == Op_Add(bt)) { + Node* add1 = in1->in(1); + Node* add2 = in1->in(2); + if (add1 != NULL && add2 != NULL) { + if (AndIL_shift_and_mask(phase, in2, add1, bt)) { + set_req_X(1, add2, phase); + return this; + } else if (AndIL_shift_and_mask(phase, in2, add2, bt)) { + set_req_X(1, add1, phase); + return this; + } + } + } + return NULL; +} diff --git a/src/hotspot/share/opto/mulnode.hpp b/src/hotspot/share/opto/mulnode.hpp index 3c7f27910a7..ec751aec799 100644 --- a/src/hotspot/share/opto/mulnode.hpp +++ b/src/hotspot/share/opto/mulnode.hpp @@ -82,6 +82,9 @@ public: virtual int min_opcode() const = 0; static MulNode* make(Node* in1, Node* in2, BasicType bt); + + static bool AndIL_shift_and_mask(PhaseGVN* phase, Node* mask, Node* shift, BasicType bt); + Node* AndIL_add_shift_and_mask(PhaseGVN* phase, BasicType bt); }; //------------------------------MulINode--------------------------------------- @@ -189,6 +192,7 @@ public: virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::MINUS_1; } const Type *add_id() const { return TypeInt::ZERO; } @@ -208,6 +212,7 @@ public: virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::MINUS_1; } const Type *add_id() const { return TypeLong::ZERO; } diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestShiftAndMask.java b/test/hotspot/jtreg/compiler/c2/irTests/TestShiftAndMask.java new file mode 100644 index 00000000000..ca6d59428a8 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestShiftAndMask.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021, 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. + */ + +package compiler.c2.irTests; + +import compiler.lib.ir_framework.*; + +/* + * @test + * @bug 8277850 + * @summary C2: optimize mask checks in counted loops + * @library /test/lib / + * @run driver compiler.c2.irTests.TestShiftAndMask + */ + +public class TestShiftAndMask { + public static void main(String[] args) { + TestFramework.run(); + } + + @Test + @Arguments(Argument.RANDOM_EACH) + @IR(failOn = { IRNode.AND_I, IRNode.LSHIFT_I }) + public static int shiftMaskInt(int i) { + return (i << 2) & 3; // transformed to: return 0; + } + + @Test + @Arguments(Argument.RANDOM_EACH) + @IR(failOn = { IRNode.AND_L, IRNode.LSHIFT_L }) + public static long shiftMaskLong(long i) { + return (i << 2) & 3; // transformed to: return 0; + } + + @Test + @Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH}) + @IR(counts = { IRNode.AND_I, "1" }) + @IR(failOn = { IRNode.ADD_I, IRNode.LSHIFT_I }) + public static int addShiftMaskInt(int i, int j) { + return (j + (i << 2)) & 3; // transformed to: return j & 3; + } + + @Test + @Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH}) + @IR(counts = { IRNode.AND_L, "1" }) + @IR(failOn = { IRNode.ADD_L, IRNode.LSHIFT_L }) + public static long addShiftMaskLong(long i, long j) { + return (j + (i << 2)) & 3; // transformed to: return j & 3; + } + + @Test + @Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH}) + @IR(failOn = { IRNode.AND_I, IRNode.ADD_I, IRNode.LSHIFT_I }) + public static int addShiftMaskInt2(int i, int j) { + return ((j << 2) + (i << 2)) & 3; // transformed to: return 0; + } + + @Test + @Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH}) + @IR(failOn = { IRNode.AND_L, IRNode.ADD_L, IRNode.LSHIFT_L }) + public static long addShiftMaskLong2(long i, long j) { + return ((j << 2) + (i << 2)) & 3; // transformed to: return 0; + } + + @Test + @Arguments(Argument.RANDOM_EACH) + @IR(failOn = { IRNode.AND_L, IRNode.LSHIFT_I }) + public static long shiftConvMask(int i) { + return ((long)(i << 2)) & 3; // transformed to: return 0; + } + + @Test + @Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH}) + @IR(counts = { IRNode.AND_L, "1" }) + @IR(failOn = { IRNode.ADD_L, IRNode.LSHIFT_I, IRNode.CONV_I2L }) + public static long addShiftConvMask(int i, long j) { + return (j + (i << 2)) & 3; // transformed to: return j & 3; + } + + @Test + @Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH}) + @IR(failOn = { IRNode.AND_L, IRNode.ADD_L, IRNode.LSHIFT_L }) + public static long addShiftConvMask2(int i, int j) { + return (((long)(j << 2)) + ((long)(i << 2))) & 3; // transformed to: return 0; + } + +} + diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index a995cad3f2d..18875cd9377 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -133,6 +133,14 @@ public class IRNode { public static final String SCOPE_OBJECT = "(.*# ScObj.*" + END; public static final String MEMBAR = START + "MemBar" + MID + END; + public static final String AND_I = START + "AndI" + MID + END; + public static final String AND_L = START + "AndL" + MID + END; + public static final String LSHIFT_I = START + "LShiftI" + MID + END; + public static final String LSHIFT_L = START + "LShiftL" + MID + END; + public static final String ADD_I = START + "AddI" + MID + END; + public static final String ADD_L = START + "AddL" + MID + END; + public static final String CONV_I2L = START + "ConvI2L" + MID + END; + /** * Called by {@link IRMatcher} to merge special composite nodes together with additional user-defined input. */ -- GitLab From 2478158815a9ae0466542e27562bff046d760d3e Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Wed, 8 Dec 2021 17:11:14 +0000 Subject: [PATCH 679/890] 8277361: java/nio/channels/Channels/ReadXBytes.java fails with OOM error Reviewed-by: alanb, lancea --- .../nio/channels/Channels/ReadXBytes.java | 54 +++++++++++++------ 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/test/jdk/java/nio/channels/Channels/ReadXBytes.java b/test/jdk/java/nio/channels/Channels/ReadXBytes.java index 1f36d4031fd..f146d629da1 100644 --- a/test/jdk/java/nio/channels/Channels/ReadXBytes.java +++ b/test/jdk/java/nio/channels/Channels/ReadXBytes.java @@ -25,12 +25,12 @@ * @test * @bug 8268435 8274780 * @summary Verify ChannelInputStream methods readAllBytes and readNBytes - * @requires vm.bits == 64 + * @requires (sun.arch.data.model == "64" & os.maxMemory >= 16g) * @library .. * @library /test/lib * @build jdk.test.lib.RandomFactory * @modules java.base/jdk.internal.util - * @run testng/othervm/timeout=900 -Xmx8G ReadXBytes + * @run testng/othervm/timeout=900 -Xmx12G ReadXBytes * @key randomness */ import java.io.File; @@ -38,7 +38,7 @@ import java.io.FileInputStream; import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; -import java.io.RandomAccessFile; +import java.nio.ByteBuffer; import java.nio.channels.Channel; import java.nio.channels.Channels; import java.nio.channels.FileChannel; @@ -46,11 +46,12 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.SeekableByteChannel; import java.nio.file.Files; import java.nio.file.Path; -import static java.nio.file.StandardOpenOption.READ; import java.util.List; import java.util.Random; import jdk.internal.util.ArraysSupport; +import static java.nio.file.StandardOpenOption.*; + import jdk.test.lib.RandomFactory; import org.testng.Assert; @@ -72,30 +73,51 @@ public class ReadXBytes { // A length greater than a 32-bit integer can accommodate private static final long HUGE_LENGTH = Integer.MAX_VALUE + 27L; + // Current directory + private static final Path DIR = Path.of(System.getProperty("test.dir", ".")); + // --- Framework --- + // Create a temporary file path + static Path createFilePath() { + String name = String.format("ReadXBytes%d.tmp", System.nanoTime()); + return DIR.resolve(name); + } + // Creates a temporary file of a specified length with undefined content static Path createFile(long length) throws IOException { - File file = File.createTempFile("foo", ".bar"); - file.deleteOnExit(); - try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { - raf.setLength(length); + Path path = createFilePath(); + path.toFile().deleteOnExit(); + try (FileChannel fc = FileChannel.open(path, CREATE_NEW, SPARSE, WRITE)) { + if (length > 0) { + fc.position(length - 1); + fc.write(ByteBuffer.wrap(new byte[] {27})); + } } - return file.toPath(); + return path; } // Creates a temporary file of a specified length with random content static Path createFileWithRandomContent(long length) throws IOException { Path file = createFile(length); - try (RandomAccessFile raf = new RandomAccessFile(file.toFile(), "rw")) { - long written = 0L; - int bufLength = Math.min(32768, (int)Math.min(length, BIG_LENGTH)); + try (FileChannel fc = FileChannel.open(file, WRITE);) { + long pos = 0L; + // if the length exceeds 2 GB, skip the first 2 GB - 1 MB bytes + if (length >= 2L*1024*1024*1024) { + // write the last (length - 2GB - 1MB) bytes + pos = 2047L*1024*1024; + } else if (length > 0) { + // write either the first or last bytes only + long p = Math.min(Math.abs(RAND.nextLong()), length - 1); + pos = RAND.nextBoolean() ? p : length - 1 - p; + } + fc.position(pos); + int bufLength = Math.min(32768, (int)Math.min(length - pos, BIG_LENGTH)); byte[] buf = new byte[bufLength]; - while (written < length) { + while (pos < length) { RAND.nextBytes(buf); - int len = (int)Math.min(bufLength, length - written); - raf.write(buf, 0, len); - written += len; + int len = (int)Math.min(bufLength, length - pos); + pos += fc.write(ByteBuffer.wrap(buf, 0, len)); } } return file; -- GitLab From 9b747491de01fd011b09668a67113e80c2b7c708 Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Wed, 8 Dec 2021 17:44:10 +0000 Subject: [PATCH 680/890] 8276660: Scalability bottleneck in java.security.Provider.getService() Reviewed-by: weijun --- .../share/classes/java/security/Provider.java | 501 ++++++++++-------- 1 file changed, 275 insertions(+), 226 deletions(-) diff --git a/src/java.base/share/classes/java/security/Provider.java b/src/java.base/share/classes/java/security/Provider.java index 11c8eb29ca7..c6c3d63c61f 100644 --- a/src/java.base/share/classes/java/security/Provider.java +++ b/src/java.base/share/classes/java/security/Provider.java @@ -191,6 +191,8 @@ public abstract class Provider extends Properties { this.versionStr = Double.toString(version); this.info = info; this.serviceMap = new ConcurrentHashMap<>(); + this.legacyMap = new ConcurrentHashMap<>(); + this.prngAlgos = new LinkedHashSet(6); putId(); initialized = true; } @@ -229,6 +231,8 @@ public abstract class Provider extends Properties { this.version = parseVersionStr(versionStr); this.info = info; this.serviceMap = new ConcurrentHashMap<>(); + this.legacyMap = new ConcurrentHashMap<>(); + this.prngAlgos = new LinkedHashSet(6); putId(); initialized = true; } @@ -572,7 +576,6 @@ public abstract class Provider extends Properties { public synchronized boolean replace(Object key, Object oldValue, Object newValue) { check("putProviderProperty." + name); - if (debug != null) { debug.println("Replace " + name + " provider property " + key); } @@ -598,7 +601,6 @@ public abstract class Provider extends Properties { @Override public synchronized Object replace(Object key, Object value) { check("putProviderProperty." + name); - if (debug != null) { debug.println("Replace " + name + " provider property " + key); } @@ -627,7 +629,6 @@ public abstract class Provider extends Properties { public synchronized void replaceAll(BiFunction function) { check("putProviderProperty." + name); - if (debug != null) { debug.println("ReplaceAll " + name + " provider property "); } @@ -657,7 +658,6 @@ public abstract class Provider extends Properties { ? super Object, ? extends Object> remappingFunction) { check("putProviderProperty." + name); check("removeProviderProperty." + name); - if (debug != null) { debug.println("Compute " + name + " provider property " + key); } @@ -684,11 +684,10 @@ public abstract class Provider extends Properties { * @since 1.8 */ @Override - public synchronized Object computeIfAbsent(Object key, Function mappingFunction) { + public synchronized Object computeIfAbsent(Object key, + Function mappingFunction) { check("putProviderProperty." + name); check("removeProviderProperty." + name); - if (debug != null) { debug.println("ComputeIfAbsent " + name + " provider property " + key); @@ -714,11 +713,11 @@ public abstract class Provider extends Properties { * @since 1.8 */ @Override - public synchronized Object computeIfPresent(Object key, BiFunction remappingFunction) { + public synchronized Object computeIfPresent(Object key, + BiFunction + remappingFunction) { check("putProviderProperty." + name); check("removeProviderProperty." + name); - if (debug != null) { debug.println("ComputeIfPresent " + name + " provider property " + key); @@ -747,11 +746,11 @@ public abstract class Provider extends Properties { * @since 1.8 */ @Override - public synchronized Object merge(Object key, Object value, BiFunction remappingFunction) { + public synchronized Object merge(Object key, Object value, + BiFunction + remappingFunction) { check("putProviderProperty." + name); check("removeProviderProperty." + name); - if (debug != null) { debug.println("Merge " + name + " provider property " + key); } @@ -777,7 +776,8 @@ public abstract class Provider extends Properties { * @since 1.8 */ @Override - public synchronized void forEach(BiConsumer action) { + public synchronized void forEach(BiConsumer + action) { checkInitialized(); super.forEach(action); } @@ -817,14 +817,11 @@ public abstract class Provider extends Properties { } } - // legacy properties changed since last call to any services method? - private transient boolean legacyChanged; + // legacyMap changed since last call to getServices() + private transient volatile boolean legacyChanged; // serviceMap changed since last call to getServices() private transient volatile boolean servicesChanged; - // Map used to keep track of legacy registration - private transient Map legacyStrings; - // Map // used for services added via putService(), initialized on demand private transient Map serviceMap; @@ -832,6 +829,9 @@ public abstract class Provider extends Properties { // For backward compatibility, the registration ordering of // SecureRandom (RNG) algorithms needs to be preserved for // "new SecureRandom()" calls when this provider is used + // NOTE: may need extra mechanism for providers to indicate their + // preferred ordering of SecureRandom algorithms since registration + // ordering info is lost once serialized private transient Set prngAlgos; // Map @@ -840,7 +840,7 @@ public abstract class Provider extends Properties { // Set // Unmodifiable set of all services. Initialized on demand. - private transient Set serviceSet; + private transient volatile Set serviceSet; // register the id attributes for this provider // this is to ensure that equals() and hashCode() do not incorrectly @@ -872,6 +872,7 @@ public abstract class Provider extends Properties { for (Map.Entry entry : super.entrySet()) { copy.put(entry.getKey(), entry.getValue()); } + defaults = null; in.defaultReadObject(); if (this.versionStr == null) { @@ -882,23 +883,22 @@ public abstract class Provider extends Properties { this.version = parseVersionStr(this.versionStr); } this.serviceMap = new ConcurrentHashMap<>(); + this.legacyMap = new ConcurrentHashMap<>(); + this.prngAlgos = new LinkedHashSet(6); implClear(); initialized = true; putAll(copy); } - // check whether to update 'legacyString' with the specified key - private boolean checkLegacy(Object key) { - String keyString = (String)key; - if (keyString.startsWith("Provider.")) { + // returns false if no update necessary, i.e. key isn't String or + // is String but it's provider-related (name/version/info/className) + private static boolean checkLegacy(Object key) { + if (key instanceof String && ((String)key).startsWith("Provider.")) { + // ignore provider related updates return false; + } else { + return true; } - - legacyChanged = true; - if (legacyStrings == null) { - legacyStrings = new LinkedHashMap<>(); - } - return true; } /** @@ -913,149 +913,161 @@ public abstract class Provider extends Properties { } private Object implRemove(Object key) { - if (key instanceof String) { - if (!checkLegacy(key)) { - return null; - } - legacyStrings.remove((String)key); + if (!checkLegacy(key)) return null; + + Object o = super.remove(key); + if (o instanceof String so && key instanceof String sk) { + parseLegacy(sk, so, OPType.REMOVE); } - return super.remove(key); + return o; } private boolean implRemove(Object key, Object value) { - if (key instanceof String && value instanceof String) { - if (!checkLegacy(key)) { - return false; - } - legacyStrings.remove((String)key, (String)value); + if (!checkLegacy(key)) return false; + + boolean result = super.remove(key, value); + if (result && key instanceof String sk && value instanceof String sv) { + parseLegacy(sk, sv, OPType.REMOVE); } - return super.remove(key, value); + return result; } private boolean implReplace(Object key, Object oldValue, Object newValue) { - if ((key instanceof String) && (oldValue instanceof String) && - (newValue instanceof String)) { - if (!checkLegacy(key)) { - return false; + if (!checkLegacy(key)) return false; + + boolean result = super.replace(key, oldValue, newValue); + if (result && key instanceof String sk) { + if (newValue instanceof String sv) { + parseLegacy(sk, sv, OPType.ADD); + } else if (oldValue instanceof String sv) { + parseLegacy(sk, sv, OPType.REMOVE); } - legacyStrings.replace((String)key, (String)oldValue, - (String)newValue); } - return super.replace(key, oldValue, newValue); + return result; } private Object implReplace(Object key, Object value) { - if ((key instanceof String) && (value instanceof String)) { - if (!checkLegacy(key)) { - return null; + if (!checkLegacy(key)) return null; + + Object o = super.replace(key, value); + if (key instanceof String sk) { + if (o instanceof String so) { + if (value instanceof String sv) { + parseLegacy(sk, sv, OPType.ADD); + } else { + parseLegacy(sk, so, OPType.REMOVE); + } } - legacyStrings.replace((String)key, (String)value); } - return super.replace(key, value); + return o; } @SuppressWarnings("unchecked") // Function must actually operate over strings private void implReplaceAll(BiFunction function) { + + super.replaceAll(function); + // clear out all existing mappings and start fresh + legacyMap.clear(); legacyChanged = true; - if (legacyStrings == null) { - legacyStrings = new LinkedHashMap<>(); - } else { - legacyStrings.replaceAll((BiFunction) function); + for (Map.Entry entry : super.entrySet()) { + Object key = entry.getKey(); + Object value = entry.getValue(); + if ((key instanceof String sk) && (value instanceof String sv)) { + if (!checkLegacy(sk)) { + continue; + } + parseLegacy(sk, sv, OPType.ADD); + } } - super.replaceAll(function); } @SuppressWarnings("unchecked") // Function must actually operate over strings private Object implMerge(Object key, Object value, BiFunction remappingFunction) { - if ((key instanceof String) && (value instanceof String)) { - if (!checkLegacy(key)) { - return null; + if (!checkLegacy(key)) return null; + + Object o = super.merge(key, value, remappingFunction); + if (key instanceof String sk) { + if (o == null) { + parseLegacy(sk, null, OPType.REMOVE); + } else if (o instanceof String so) { + parseLegacy(sk, so, OPType.ADD); } - legacyStrings.merge((String)key, (String)value, - (BiFunction) remappingFunction); } - return super.merge(key, value, remappingFunction); + return o; } @SuppressWarnings("unchecked") // Function must actually operate over strings private Object implCompute(Object key, BiFunction remappingFunction) { - if (key instanceof String) { - if (!checkLegacy(key)) { - return null; + + if (!checkLegacy(key)) return null; + + Object o = super.compute(key, remappingFunction); + if (key instanceof String sk) { + if (o == null) { + parseLegacy(sk, null, OPType.REMOVE); + } else if (o instanceof String so) { + parseLegacy(sk, so, OPType.ADD); } - legacyStrings.compute((String) key, - (BiFunction) remappingFunction); } - return super.compute(key, remappingFunction); + return o; } @SuppressWarnings("unchecked") // Function must actually operate over strings private Object implComputeIfAbsent(Object key, Function mappingFunction) { - if (key instanceof String) { - if (!checkLegacy(key)) { - return null; - } - legacyStrings.computeIfAbsent((String) key, - (Function) - mappingFunction); + if (!checkLegacy(key)) return null; + + Object o = super.computeIfAbsent(key, mappingFunction); + if (o instanceof String so && key instanceof String sk) { + parseLegacy(sk, so, OPType.ADD); } - return super.computeIfAbsent(key, mappingFunction); + return o; } @SuppressWarnings("unchecked") // Function must actually operate over strings private Object implComputeIfPresent(Object key, BiFunction remappingFunction) { - if (key instanceof String) { - if (!checkLegacy(key)) { - return null; - } - legacyStrings.computeIfPresent((String) key, - (BiFunction) remappingFunction); + if (!checkLegacy(key)) return null; + + Object o = super.computeIfPresent(key, remappingFunction); + if (o instanceof String so && key instanceof String sk) { + parseLegacy(sk, so, OPType.ADD); } - return super.computeIfPresent(key, remappingFunction); + return o; } private Object implPut(Object key, Object value) { - if ((key instanceof String) && (value instanceof String)) { - if (!checkLegacy(key)) { - return null; - } - legacyStrings.put((String)key, (String)value); + if (!checkLegacy(key)) return null; + + Object o = super.put(key, value); + if (key instanceof String sk && value instanceof String sv) { + parseLegacy(sk, sv, OPType.ADD); } - return super.put(key, value); + return o; } private Object implPutIfAbsent(Object key, Object value) { - if ((key instanceof String) && (value instanceof String)) { - if (!checkLegacy(key)) { - return null; - } - legacyStrings.putIfAbsent((String)key, (String)value); + if (!checkLegacy(key)) return null; + + Object o = super.putIfAbsent(key, value); + if (o == null && key instanceof String sk && + value instanceof String sv) { + parseLegacy(sk, sv, OPType.ADD); } - return super.putIfAbsent(key, value); + return o; } private void implClear() { - if (legacyStrings != null) { - legacyStrings.clear(); - } - if (legacyMap != null) { - legacyMap.clear(); - } + legacyMap.clear(); serviceMap.clear(); legacyChanged = false; servicesChanged = false; serviceSet = null; - prngAlgos = null; + prngAlgos.clear(); super.clear(); putId(); } @@ -1085,40 +1097,8 @@ public abstract class Provider extends Properties { boolean matches(String type, String algorithm) { return (this.type == type) && (this.originalAlgorithm == algorithm); } - } - - /** - * Ensure all the legacy String properties are fully parsed into - * service objects. - */ - private void ensureLegacyParsed() { - if (legacyChanged == false || (legacyStrings == null)) { - return; - } - serviceSet = null; - if (legacyMap == null) { - legacyMap = new ConcurrentHashMap<>(); - } else { - legacyMap.clear(); - } - for (Map.Entry entry : legacyStrings.entrySet()) { - parseLegacyPut(entry.getKey(), entry.getValue()); - } - removeInvalidServices(legacyMap); - legacyChanged = false; - } - - /** - * Remove all invalid services from the Map. Invalid services can only - * occur if the legacy properties are inconsistent or incomplete. - */ - private void removeInvalidServices(Map map) { - for (Iterator> t = - map.entrySet().iterator(); t.hasNext(); ) { - Service s = t.next().getValue(); - if (s.isValid() == false) { - t.remove(); - } + public String toString() { + return type + "." + algorithm; } } @@ -1136,71 +1116,136 @@ public abstract class Provider extends Properties { return new String[] {type, alg}; } + // utility method for getting a String with service type and algorithm + private static String getKey(Service s) { + return s.getType() + "." + s.getAlgorithm(); + } + private static final String ALIAS_PREFIX = "Alg.Alias."; private static final String ALIAS_PREFIX_LOWER = "alg.alias."; private static final int ALIAS_LENGTH = ALIAS_PREFIX.length(); - private void parseLegacyPut(String name, String value) { + private static enum OPType { + ADD, REMOVE; + } + + private void parseLegacy(String name, String value, OPType opType) { + // alias if (name.toLowerCase(ENGLISH).startsWith(ALIAS_PREFIX_LOWER)) { // e.g. put("Alg.Alias.MessageDigest.SHA", "SHA-1"); // aliasKey ~ MessageDigest.SHA - String stdAlg = value; - String aliasKey = name.substring(ALIAS_LENGTH); - String[] typeAndAlg = getTypeAndAlgorithm(aliasKey); + String aliasKeyStr = name.substring(ALIAS_LENGTH); + String[] typeAndAlg = getTypeAndAlgorithm(aliasKeyStr); if (typeAndAlg == null) { return; } + legacyChanged = true; + Objects.requireNonNull(value, "alias value should map to an alg"); String type = getEngineName(typeAndAlg[0]); String aliasAlg = typeAndAlg[1].intern(); - ServiceKey key = new ServiceKey(type, stdAlg, true); - Service s = legacyMap.get(key); - if (s == null) { - s = new Service(this, type, stdAlg); - legacyMap.put(key, s); + ServiceKey stdKey = new ServiceKey(type, value, true); + Service stdService = legacyMap.get(stdKey); + ServiceKey aliasKey = new ServiceKey(type, aliasAlg, true); + switch (opType) { + case ADD: + // clean up old alias if present + Service prevAliasService = legacyMap.get(aliasAlg); + if (prevAliasService != null) { + prevAliasService.removeAlias(aliasAlg); + } + if (stdService == null) { + // add standard mapping in order to add alias + stdService = new Service(this, type, value); + legacyMap.put(stdKey, stdService); + } + stdService.addAlias(aliasAlg); + legacyMap.put(aliasKey, stdService); + break; + case REMOVE: + if (stdService != null) { + stdService.removeAlias(aliasAlg); + } + legacyMap.remove(aliasKey); + break; + default: + throw new AssertionError(); } - legacyMap.put(new ServiceKey(type, aliasAlg, true), s); - s.addAlias(aliasAlg); } else { String[] typeAndAlg = getTypeAndAlgorithm(name); if (typeAndAlg == null) { return; } + legacyChanged = true; int i = typeAndAlg[1].indexOf(' '); + // regular registration if (i == -1) { // e.g. put("MessageDigest.SHA-1", "sun.security.provider.SHA"); String type = getEngineName(typeAndAlg[0]); String stdAlg = typeAndAlg[1].intern(); - String className = value; - ServiceKey key = new ServiceKey(type, stdAlg, true); - Service s = legacyMap.get(key); - if (s == null) { - s = new Service(this, type, stdAlg); - legacyMap.put(key, s); - } - s.className = className; - - if (type.equals("SecureRandom")) { - updateSecureRandomEntries(true, s.algorithm); + ServiceKey stdKey = new ServiceKey(type, stdAlg, true); + Service stdService = legacyMap.get(stdKey); + switch (opType) { + case ADD: + Objects.requireNonNull(value, + "className can't be null"); + if (stdService == null) { + stdService = new Service(this, type, stdAlg); + legacyMap.put(stdKey, stdService); + } + stdService.className = value; + break; + case REMOVE: + // only remove if value also matches when non-null + if (stdService != null) { + if (value == null) { + legacyMap.remove(stdKey); + } else if (stdService.className.equals(value)) { + legacyMap.remove(stdKey, stdService); + } + // remove all corresponding alias mappings + for (String alias : stdService.getAliases()) { + legacyMap.remove(new ServiceKey(type, alias, + true), stdService); + } + } + break; + default: + throw new AssertionError(); } + checkAndUpdateSecureRandom(type, stdAlg, + (opType != OPType.REMOVE)); } else { // attribute // e.g. put("MessageDigest.SHA-1 ImplementedIn", "Software"); - String attributeValue = value; String type = getEngineName(typeAndAlg[0]); - String attributeString = typeAndAlg[1]; - String stdAlg = attributeString.substring(0, i).intern(); - String attributeName = attributeString.substring(i + 1); + String attrString = typeAndAlg[1]; + String stdAlg = attrString.substring(0, i).intern(); + String attrName = attrString.substring(i + 1); // kill additional spaces - while (attributeName.startsWith(" ")) { - attributeName = attributeName.substring(1); + while (attrName.startsWith(" ")) { + attrName = attrName.substring(1); } - attributeName = attributeName.intern(); - ServiceKey key = new ServiceKey(type, stdAlg, true); - Service s = legacyMap.get(key); - if (s == null) { - s = new Service(this, type, stdAlg); - legacyMap.put(key, s); + attrName = attrName.intern(); + ServiceKey stdKey = new ServiceKey(type, stdAlg, true); + Service stdService = legacyMap.get(stdKey); + switch (opType) { + case ADD: + Objects.requireNonNull(value, + "attribute value should not be null"); + + if (stdService == null) { + stdService = new Service(this, type, stdAlg); + legacyMap.put(stdKey, stdService); + } + stdService.addAttribute(attrName, value); + break; + case REMOVE: + if (stdService != null) { + stdService.removeAttribute(attrName, value); + } + break; + default: + throw new AssertionError(); } - s.addAttribute(attributeName, attributeValue); } } } @@ -1227,25 +1272,25 @@ public abstract class Provider extends Properties { */ public Service getService(String type, String algorithm) { checkInitialized(); - // avoid allocating a new ServiceKey object if possible ServiceKey key = previousKey; if (key.matches(type, algorithm) == false) { key = new ServiceKey(type, algorithm, false); previousKey = key; } - if (!serviceMap.isEmpty()) { - Service s = serviceMap.get(key); - if (s != null) { - return s; - } + + Service s = serviceMap.get(key); + if (s != null) { + return s; } - synchronized (this) { - ensureLegacyParsed(); - if (legacyMap != null && !legacyMap.isEmpty()) { - return legacyMap.get(key); - } + + s = legacyMap.get(key); + if (s != null && !s.isValid()) { + legacyMap.remove(key, s); + } else { + return s; } + return null; } @@ -1267,22 +1312,19 @@ public abstract class Provider extends Properties { * * @since 1.5 */ - public synchronized Set getServices() { + public Set getServices() { checkInitialized(); - if (legacyChanged || servicesChanged) { - serviceSet = null; - } - if (serviceSet == null) { - ensureLegacyParsed(); + if (serviceSet == null || legacyChanged || servicesChanged) { Set set = new LinkedHashSet<>(); if (!serviceMap.isEmpty()) { set.addAll(serviceMap.values()); } - if (legacyMap != null && !legacyMap.isEmpty()) { + if (!legacyMap.isEmpty()) { set.addAll(legacyMap.values()); } serviceSet = Collections.unmodifiableSet(set); servicesChanged = false; + legacyChanged = false; } return serviceSet; } @@ -1339,44 +1381,36 @@ public abstract class Provider extends Properties { servicesChanged = true; synchronized (this) { putPropertyStrings(s); - if (type.equals("SecureRandom")) { - updateSecureRandomEntries(true, s.algorithm); - } + checkAndUpdateSecureRandom(type, algorithm, true); } } - // keep tracks of the registered secure random algos and store them in order - private void updateSecureRandomEntries(boolean doAdd, String s) { - Objects.requireNonNull(s); - if (doAdd) { - if (prngAlgos == null) { - prngAlgos = new LinkedHashSet(); + private void checkAndUpdateSecureRandom(String type, String algo, + boolean doAdd) { + if (type.equalsIgnoreCase("SecureRandom")) { + if (doAdd) { + prngAlgos.add(algo); + } else { + prngAlgos.remove(algo); + } + if (debug != null) { + debug.println((doAdd? "Add":"Remove") + + " SecureRandom algo " + algo); } - prngAlgos.add(s); - } else { - prngAlgos.remove(s); - } - - if (debug != null) { - debug.println((doAdd? "Add":"Remove") + " SecureRandom algo " + s); } } // used by new SecureRandom() to find out the default SecureRandom // service for this provider - synchronized Service getDefaultSecureRandomService() { + Service getDefaultSecureRandomService() { checkInitialized(); - if (legacyChanged) { - prngAlgos = null; - ensureLegacyParsed(); - } - - if (prngAlgos != null && !prngAlgos.isEmpty()) { + if (!prngAlgos.isEmpty()) { + String algo = prngAlgos.iterator().next(); // IMPORTANT: use the Service obj returned by getService(...) call // as providers may override putService(...)/getService(...) and // return their own Service objects - return getService("SecureRandom", prngAlgos.iterator().next()); + return getService("SecureRandom", algo); } return null; @@ -1473,12 +1507,9 @@ public abstract class Provider extends Properties { for (String alias : s.getAliases()) { serviceMap.remove(new ServiceKey(type, alias, false)); } - synchronized (this) { - removePropertyStrings(s); - if (type.equals("SecureRandom")) { - updateSecureRandomEntries(false, s.algorithm); - } - } + + removePropertyStrings(s); + checkAndUpdateSecureRandom(type, algorithm, false); } // Wrapped String that behaves in a case insensitive way for equals/hashCode @@ -1686,6 +1717,13 @@ public abstract class Provider extends Properties { aliases.add(alias); } + private void removeAlias(String alias) { + if (aliases.isEmpty()) { + return; + } + aliases.remove(alias); + } + void addAttribute(String type, String value) { if (attributes.isEmpty()) { attributes = new HashMap<>(8); @@ -1693,6 +1731,17 @@ public abstract class Provider extends Properties { attributes.put(new UString(type), value); } + void removeAttribute(String type, String value) { + if (attributes.isEmpty()) { + return; + } + if (value == null) { + attributes.remove(new UString(type)); + } else { + attributes.remove(new UString(type), value); + } + } + /** * Construct a new service. * -- GitLab From 83454530ea538c80e2f1205cd8d2f9732503b592 Mon Sep 17 00:00:00 2001 From: Alexey Ushakov Date: Wed, 8 Dec 2021 17:48:53 +0000 Subject: [PATCH 681/890] 8272392: Lanai: SwingSet2. Black background on expanding tree node Reviewed-by: aghaisas, jdv --- .../java2d/metal/EncoderManager.m | 40 ++++++-------- .../libawt_lwawt/java2d/metal/MTLBlitLoops.m | 5 +- .../libawt_lwawt/java2d/metal/MTLClip.m | 3 - .../libawt_lwawt/java2d/metal/MTLPaints.m | 25 ++++----- .../java2d/metal/MTLPipelineStatesStorage.m | 55 +++++++++---------- .../libawt_lwawt/java2d/metal/RenderOptions.h | 1 - .../native/libawt_lwawt/java2d/metal/common.h | 1 - 7 files changed, 57 insertions(+), 73 deletions(-) diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/EncoderManager.m b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/EncoderManager.m index 0fb18c3f4c3..95374d2c93e 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/EncoderManager.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/EncoderManager.m @@ -41,11 +41,9 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; - (void)dealloc; - (void)reset:(id)destination - isDstOpaque:(jboolean)isDstOpaque - isDstPremultiplied:(jboolean)isDstPremultiplied - isAA:(jboolean)isAA - isText:(jboolean)isText - isLCD:(jboolean)isLCD; + isAA:(jboolean)isAA + isText:(jboolean)isText + isLCD:(jboolean)isLCD; - (void)updateEncoder:(id)encoder context:(MTLContext *)mtlc @@ -64,7 +62,6 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; // Persistent encoder properties id _destination; - SurfaceRasterFlags _dstFlags; jboolean _isAA; jboolean _isText; @@ -123,14 +120,10 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; } - (void)reset:(id)destination - isDstOpaque:(jboolean)isDstOpaque - isDstPremultiplied:(jboolean)isDstPremultiplied - isAA:(jboolean)isAA - isText:(jboolean)isText - isLCD:(jboolean)isLCD { + isAA:(jboolean)isAA + isText:(jboolean)isText + isLCD:(jboolean)isLCD { _destination = destination; - _dstFlags.isOpaque = isDstOpaque; - _dstFlags.isPremultiplied = isDstPremultiplied; _isAA = isAA; _isText = isText; _isLCD = isLCD; @@ -288,20 +281,20 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; - (id _Nonnull)getAARenderEncoder:(const BMTLSDOps * _Nonnull)dstOps { id dstTxt = dstOps->pTexture; - RenderOptions roptions = {JNI_FALSE, JNI_TRUE, INTERPOLATION_NEAREST_NEIGHBOR, defaultRasterFlags, {dstOps->isOpaque, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; + RenderOptions roptions = {JNI_FALSE, JNI_TRUE, INTERPOLATION_NEAREST_NEIGHBOR, defaultRasterFlags, JNI_FALSE, JNI_FALSE, JNI_FALSE}; return [self getEncoder:dstTxt renderOptions:&roptions]; } - (id _Nonnull)getAAShaderRenderEncoder:(const BMTLSDOps * _Nonnull)dstOps { - RenderOptions roptions = {JNI_FALSE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, defaultRasterFlags, {dstOps->isOpaque, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_TRUE}; + RenderOptions roptions = {JNI_FALSE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, defaultRasterFlags, JNI_FALSE, JNI_FALSE, JNI_TRUE}; return [self getEncoder:dstOps->pTexture renderOptions:&roptions]; } - (id _Nonnull)getRenderEncoder:(id _Nonnull)dest isDstOpaque:(bool)isOpaque { - RenderOptions roptions = {JNI_FALSE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, defaultRasterFlags, {isOpaque, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; + RenderOptions roptions = {JNI_FALSE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, defaultRasterFlags, JNI_FALSE, JNI_FALSE, JNI_FALSE}; return [self getEncoder:dest renderOptions:&roptions]; } @@ -329,7 +322,7 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; isSrcOpaque:(bool)isSrcOpaque isDstOpaque:(bool)isDstOpaque { - RenderOptions roptions = {JNI_TRUE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, {isSrcOpaque, JNI_TRUE }, {isDstOpaque, JNI_TRUE}, JNI_FALSE, JNI_TRUE, JNI_FALSE}; + RenderOptions roptions = {JNI_TRUE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, {isSrcOpaque, JNI_TRUE }, JNI_FALSE, JNI_TRUE, JNI_FALSE}; return [self getEncoder:dest renderOptions:&roptions]; } @@ -339,7 +332,7 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; interpolation:(int)interpolation isAA:(jboolean)isAA { - RenderOptions roptions = {JNI_TRUE, isAA, interpolation, { isSrcOpaque, JNI_TRUE }, {isDstOpaque, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; + RenderOptions roptions = {JNI_TRUE, isAA, interpolation, { isSrcOpaque, JNI_TRUE }, JNI_FALSE, JNI_FALSE, JNI_FALSE}; return [self getEncoder:dest renderOptions:&roptions]; } @@ -354,7 +347,8 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; - (id _Nonnull) getTextEncoder:(const BMTLSDOps * _Nonnull)dstOps isSrcOpaque:(bool)isSrcOpaque { - RenderOptions roptions = {JNI_TRUE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, { isSrcOpaque, JNI_TRUE }, {dstOps->isOpaque, JNI_TRUE}, JNI_TRUE, JNI_FALSE, JNI_FALSE}; + RenderOptions roptions = {JNI_TRUE, JNI_FALSE, INTERPOLATION_NEAREST_NEIGHBOR, { isSrcOpaque, JNI_TRUE }, + JNI_TRUE, JNI_FALSE, JNI_FALSE}; return [self getEncoder:dstOps->pTexture renderOptions:&roptions]; } @@ -437,11 +431,9 @@ const SurfaceRasterFlags defaultRasterFlags = { JNI_FALSE, JNI_TRUE }; _encoder = [[cbw getCommandBuffer] renderCommandEncoderWithDescriptor:rpd]; [_encoderStates reset:dest - isDstOpaque:renderOptions->dstFlags.isOpaque - isDstPremultiplied:YES - isAA:renderOptions->isAA - isText:renderOptions->isText - isLCD:renderOptions->isLCD]; + isAA:renderOptions->isAA + isText:renderOptions->isText + isLCD:renderOptions->isLCD]; } // diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m index bf55d8c8976..47571a5e7ae 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m @@ -595,8 +595,9 @@ MTLBlitLoops_Blit(JNIEnv *env, } #ifdef TRACE_BLIT - J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_FALSE, - "MTLBlitLoops_Blit [tx=%d, xf=%d, AC=%s]: bdst=%s, src=%p (%dx%d) O=%d premul=%d | (%d, %d, %d, %d)->(%1.2f, %1.2f, %1.2f, %1.2f)", + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_TRUE, + "MTLBlitLoops_Blit srctype=%d [tx=%d, xf=%d, AC=%s]: bdst=%s, src=%p (%dx%d) O=%d premul=%d | (%d, " + "%d, %d, %d)->(%1.2f, %1.2f, %1.2f, %1.2f)", srctype, texture, xform, [mtlc getCompositeDescription].cString, getSurfaceDescription(dstOps).cString, srcOps, sx2 - sx1, sy2 - sy1, diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLClip.m b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLClip.m index 35d8ba624c9..effe7aebae6 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLClip.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLClip.m @@ -58,7 +58,6 @@ static void initTemplatePipelineDescriptors() { BMTLSDOps* _dstOps; BOOL _stencilMaskGenerationInProgress; BOOL _stencilMaskGenerationStarted; - BOOL _clipReady; MTLOrigin _clipShapeOrigin; MTLSize _clipShapeSize; } @@ -73,7 +72,6 @@ static void initTemplatePipelineDescriptors() { _dstOps = NULL; _stencilMaskGenerationInProgress = NO; _stencilMaskGenerationStarted = NO; - _clipReady = NO; } return self; } @@ -189,7 +187,6 @@ static void initTemplatePipelineDescriptors() { _stencilMaskGenerationStarted = NO; _dstOps = dstOps; _clipType = SHAPE_CLIP; - _clipReady = NO; } - (void)setMaskGenerationPipelineState:(id)encoder diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m index a3b1254bf13..5686449a295 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m @@ -56,7 +56,7 @@ static MTLRenderPipelineDescriptor * templateLCDPipelineDesc = nil; static MTLRenderPipelineDescriptor * templateAAPipelineDesc = nil; static void setTxtUniforms(MTLContext *mtlc, int color, id encoder, int interpolation, bool repeat, - jfloat extraAlpha, const SurfaceRasterFlags *srcFlags, const SurfaceRasterFlags *dstFlags, int mode); + jfloat extraAlpha, const SurfaceRasterFlags *srcFlags, int mode); static void initTemplatePipelineDescriptors() { if (templateRenderPipelineDesc != nil && templateTexturePipelineDesc != nil && @@ -228,8 +228,8 @@ jint _color; rpDesc = [[templateLCDPipelineDesc copy] autorelease]; } setTxtUniforms(mtlc, _color, encoder, - renderOptions->interpolation, NO, [mtlc.composite getExtraAlpha], &renderOptions->srcFlags, - &renderOptions->dstFlags, 1); + renderOptions->interpolation, NO, [mtlc.composite getExtraAlpha], + &renderOptions->srcFlags, 1); } else if (renderOptions->isAAShader) { vertShader = @"vert_col_aa"; fragShader = @"frag_col_aa"; @@ -270,7 +270,7 @@ jint _color; setTxtUniforms(mtlc, col, encoder, renderOptions->interpolation, NO, [mtlc.composite getExtraAlpha], - &renderOptions->srcFlags, &renderOptions->dstFlags, 1); + &renderOptions->srcFlags, 1); [encoder setFragmentBytes:&xorColor length:sizeof(xorColor) atIndex:0]; [encoder setFragmentTexture:dstOps->pTexture atIndex:1]; @@ -809,9 +809,8 @@ jint _color; [encoder setFragmentTexture:_paintTexture atIndex:0]; } const SurfaceRasterFlags srcFlags = {_isOpaque, renderOptions->srcFlags.isPremultiplied}; - setTxtUniforms(mtlc, 0, encoder, - renderOptions->interpolation, YES, [mtlc.composite getExtraAlpha], - &srcFlags, &renderOptions->dstFlags, 0); + setTxtUniforms(mtlc, 0, encoder, renderOptions->interpolation, YES, [mtlc.composite getExtraAlpha], + &srcFlags, 0); id pipelineState = [pipelineStateStorage getPipelineState:rpDesc vertexShaderId:vertShader @@ -893,8 +892,8 @@ jint _color; static void setTxtUniforms(MTLContext *mtlc, int color, id encoder, int interpolation, bool repeat, - jfloat extraAlpha, const SurfaceRasterFlags *srcFlags, const SurfaceRasterFlags *dstFlags, int mode) { - struct TxtFrameUniforms uf = {RGBA_TO_V4(color), mode, srcFlags->isOpaque, dstFlags->isOpaque, extraAlpha}; + jfloat extraAlpha, const SurfaceRasterFlags *srcFlags, int mode) { + struct TxtFrameUniforms uf = {RGBA_TO_V4(color), mode, srcFlags->isOpaque, extraAlpha}; [encoder setFragmentBytes:&uf length:sizeof(uf) atIndex:FrameUniformBuffer]; [mtlc.samplerManager setSamplerWithEncoder:encoder interpolation:interpolation repeat:repeat]; } @@ -956,8 +955,7 @@ setTxtUniforms(MTLContext *mtlc, int color, id encoder } else { setTxtUniforms(mtlc, 0, encoder, renderOptions->interpolation, NO, [mtlc.composite getExtraAlpha], - &renderOptions->srcFlags, - &renderOptions->dstFlags, 0); + &renderOptions->srcFlags, 0); } id pipelineState = [pipelineStateStorage getPipelineState:rpDesc @@ -998,7 +996,7 @@ setTxtUniforms(MTLContext *mtlc, int color, id encoder const int col = 0 ^ xorColor; setTxtUniforms(mtlc, col, encoder, renderOptions->interpolation, NO, [mtlc.composite getExtraAlpha], - &renderOptions->srcFlags, &renderOptions->dstFlags, 0); + &renderOptions->srcFlags, 0); [encoder setFragmentBytes:&xorColor length:sizeof(xorColor) atIndex: 0]; BMTLSDOps *dstOps = MTLRenderQueue_GetCurrentDestination(); @@ -1006,8 +1004,7 @@ setTxtUniforms(MTLContext *mtlc, int color, id encoder setTxtUniforms(mtlc, 0, encoder, renderOptions->interpolation, NO, [mtlc.composite getExtraAlpha], - &renderOptions->srcFlags, - &renderOptions->dstFlags, 0); + &renderOptions->srcFlags, 0); id pipelineState = [pipelineStateStorage getPipelineState:rpDesc vertexShaderId:vertShader diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m index 0928f12d426..9a7862e8c26 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m @@ -84,7 +84,7 @@ static void setBlendingFactors( vertexShaderId:(NSString *)vertexShaderId fragmentShaderId:(NSString *)fragmentShaderId { - RenderOptions defaultOptions = {JNI_FALSE, JNI_FALSE, 0/*unused*/, {JNI_FALSE, JNI_TRUE}, {JNI_FALSE, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; + RenderOptions defaultOptions = {JNI_FALSE, JNI_FALSE, 0/*unused*/, {JNI_FALSE, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; return [self getPipelineState:pipelineDescriptor vertexShaderId:vertexShaderId fragmentShaderId:fragmentShaderId @@ -98,7 +98,7 @@ static void setBlendingFactors( fragmentShaderId:(NSString *)fragmentShaderId stencilNeeded:(bool)stencilNeeded { - RenderOptions defaultOptions = {JNI_FALSE, JNI_FALSE, 0/*unused*/, {JNI_FALSE, JNI_TRUE}, {JNI_FALSE, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; + RenderOptions defaultOptions = {JNI_FALSE, JNI_FALSE, 0/*unused*/, {JNI_FALSE, JNI_TRUE}, JNI_FALSE, JNI_FALSE, JNI_FALSE}; return [self getPipelineState:pipelineDescriptor vertexShaderId:vertexShaderId fragmentShaderId:fragmentShaderId @@ -107,6 +107,19 @@ static void setBlendingFactors( stencilNeeded:stencilNeeded]; } +// Pipeline state index +union StateIndex { + uint32_t value; + struct { + uint32_t srcPremultiplied : 1, + srcOpaque : 1, + stencil : 1, + aa : 1, + extAlpha : 1, + compositeRule : 27; + } bits; +}; + // Base method to obtain MTLRenderPipelineState. // NOTE: parameters compositeRule, srcFlags, dstFlags are used to set MTLRenderPipelineColorAttachmentDescriptor multipliers - (id) getPipelineState:(MTLRenderPipelineDescriptor *) pipelineDescriptor @@ -123,45 +136,31 @@ static void setBlendingFactors( // Calculate index by flags and compositeRule // TODO: reimplement, use map with convenient key (calculated by all arguments) - int subIndex = 0; + union StateIndex index; + index.value = 0; if (useXorComposite) { // compositeRule value is already XOR_COMPOSITE_RULE } else { if (useComposite) { - if (!renderOptions->srcFlags.isPremultiplied) - subIndex |= 1; - if (renderOptions->srcFlags.isOpaque) - subIndex |= 1 << 1; - if (!renderOptions->dstFlags.isPremultiplied) - subIndex |= 1 << 2; - if (renderOptions->dstFlags.isOpaque) - subIndex |= 1 << 3; + index.bits.srcPremultiplied = renderOptions->srcFlags.isPremultiplied; + index.bits.srcOpaque = renderOptions->srcFlags.isOpaque; } else compositeRule = RULE_Src; } - if (stencilNeeded) { - subIndex |= 1 << 4; - } - - if (renderOptions->isAA) { - subIndex |= 1 << 5; - } - - if ((composite != nil && FLT_LT([composite getExtraAlpha], 1.0f))) { - subIndex |= 1 << 6; - } - - int index = compositeRule*128 + subIndex; + index.bits.stencil = stencilNeeded; + index.bits.aa = renderOptions->isAA; + index.bits.extAlpha = composite != nil && FLT_LT([composite getExtraAlpha], 1.0f); + index.bits.compositeRule = compositeRule; NSPointerArray * subStates = [self getSubStates:vertexShaderId fragmentShader:fragmentShaderId]; - if (index >= subStates.count) { - subStates.count = (NSUInteger) (index + 1); + if (index.value >= subStates.count) { + subStates.count = index.value + 1; } - id result = [subStates pointerAtIndex:index]; + id result = [subStates pointerAtIndex:index.value]; if (result == nil) { @autoreleasepool { id vertexShader = [self getShader:vertexShaderId]; @@ -222,7 +221,7 @@ static void setBlendingFactors( exit(0); } - [subStates insertPointer:result atIndex:index]; + [subStates replacePointerAtIndex:index.value withPointer:result]; } } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/RenderOptions.h b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/RenderOptions.h index 46521ca5b09..f24f131631a 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/RenderOptions.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/RenderOptions.h @@ -35,7 +35,6 @@ typedef struct { jboolean isAA; int interpolation; SurfaceRasterFlags srcFlags; - SurfaceRasterFlags dstFlags; jboolean isText; jboolean isLCD; jboolean isAAShader; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/common.h b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/common.h index 556bbf5d88e..70218f7e849 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/common.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/common.h @@ -114,7 +114,6 @@ struct TxtFrameUniforms { vector_float4 color; int mode; // NOTE: consider to use bit fields int isSrcOpaque; - int isDstOpaque; float extraAlpha; }; -- GitLab From 92aa75b72185c681757e6520d6fdc1ae4161d0c5 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 8 Dec 2021 17:52:03 +0000 Subject: [PATCH 682/890] 8274903: Zero: Support AsyncGetCallTrace Reviewed-by: sspitsyn, aph --- src/hotspot/cpu/zero/frame_zero.cpp | 64 +++++++++++++++++-- .../os_cpu/linux_zero/thread_linux_zero.cpp | 41 +++++++++++- .../os_cpu/linux_zero/thread_linux_zero.hpp | 14 ++-- src/hotspot/share/prims/forte.cpp | 42 +++++++++++- 4 files changed, 143 insertions(+), 18 deletions(-) diff --git a/src/hotspot/cpu/zero/frame_zero.cpp b/src/hotspot/cpu/zero/frame_zero.cpp index 19970cfb82b..2e00d703377 100644 --- a/src/hotspot/cpu/zero/frame_zero.cpp +++ b/src/hotspot/cpu/zero/frame_zero.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + * Copyright (c) 2007, 2021, 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 @@ -116,13 +116,67 @@ void frame::patch_pc(Thread* thread, address pc) { } bool frame::safe_for_sender(JavaThread *thread) { - ShouldNotCallThis(); - return false; + address sp = (address)_sp; + + // consider stack guards when trying to determine "safe" stack pointers + // sp must be within the usable part of the stack (not in guards) + if (!thread->is_in_usable_stack(sp)) { + return false; + } + + // an fp must be within the stack and above (but not equal) sp + if (!thread->is_in_stack_range_excl((address)fp(), sp)) { + return false; + } + + // All good. + return true; } bool frame::is_interpreted_frame_valid(JavaThread *thread) const { - ShouldNotCallThis(); - return false; + assert(is_interpreted_frame(), "Not an interpreted frame"); + // These are reasonable sanity checks + if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) { + return false; + } + if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) { + return false; + } + // These are hacks to keep us out of trouble. + // The problem with these is that they mask other problems + if (fp() <= sp()) { // this attempts to deal with unsigned comparison above + return false; + } + + // do some validation of frame elements + // first the method + + Method* m = *interpreter_frame_method_addr(); + + // validate the method we'd find in this potential sender + if (!Method::is_valid_method(m)) { + return false; + } + + // validate bci/bcp + address bcp = interpreter_frame_bcp(); + if (m->validate_bci_from_bcp(bcp) < 0) { + return false; + } + + // validate ConstantPoolCache* + ConstantPoolCache* cp = *interpreter_frame_cache_addr(); + if (MetaspaceObj::is_valid(cp) == false) { + return false; + } + + // validate locals + address locals = (address) *interpreter_frame_locals_addr(); + if (!thread->is_in_stack_range_incl(locals, (address)fp())) { + return false; + } + + return true; } BasicType frame::interpreter_frame_result(oop* oop_result, diff --git a/src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp b/src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp index 816ca411430..e4313782613 100644 --- a/src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp +++ b/src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009, 2010 Red Hat, Inc. + * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2021, 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 @@ -35,3 +35,40 @@ frame JavaThread::pd_last_frame() { void JavaThread::cache_global_variables() { // nothing to do } + +bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, + void* ucontext, + bool isInJava) { + if (has_last_Java_frame()) { + *fr_addr = pd_last_frame(); + return true; + } + + if (isInJava) { + // We know we are in Java, but there is no frame? + // Try to find the top-most Java frame on Zero stack then. + intptr_t* sp = zero_stack()->sp(); + ZeroFrame* zf = top_zero_frame(); + while (zf != NULL) { + if (zf->is_interpreter_frame()) { + interpreterState istate = zf->as_interpreter_frame()->interpreter_state(); + if (istate->self_link() == istate) { + // Valid interpreter state found, this is our frame. + *fr_addr = frame(zf, sp); + return true; + } + } + sp = ((intptr_t *) zf) + 1; + zf = zf->next(); + } + } + + // No dice. + return false; +} + +bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, + void* ucontext, + bool isInJava) { + return pd_get_top_frame_for_signal_handler(fr_addr, ucontext, isInJava); +} diff --git a/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp b/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp index b180611b2f9..b915c40c049 100644 --- a/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp +++ b/src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2021, 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 @@ -96,16 +96,10 @@ public: bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, - bool isInJava) { - ShouldNotCallThis(); - return false; // silence compile warning - } + bool isInJava); bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, - bool isInJava) { - ShouldNotCallThis(); - return false; // silence compile warning - } + bool isInJava); #endif // OS_CPU_LINUX_ZERO_THREAD_LINUX_ZERO_HPP diff --git a/src/hotspot/share/prims/forte.cpp b/src/hotspot/share/prims/forte.cpp index e2310ede951..c68c371ce47 100644 --- a/src/hotspot/share/prims/forte.cpp +++ b/src/hotspot/share/prims/forte.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -314,6 +314,46 @@ static bool find_initial_Java_frame(JavaThread* thread, frame candidate = *fr; +#ifdef ZERO + // Zero has no frames with code blobs, so the generic code fails. + // Instead, try to do Zero-specific search for Java frame. + + { + RegisterMap map(thread, false, false); + + while (true) { + // Cannot walk this frame? Cannot do anything anymore. + if (!candidate.safe_for_sender(thread)) { + return false; + } + + if (candidate.is_entry_frame()) { + // jcw is NULL if the java call wrapper could not be found + JavaCallWrapper* jcw = candidate.entry_frame_call_wrapper_if_safe(thread); + // If initial frame is frame from StubGenerator and there is no + // previous anchor, there are no java frames associated with a method + if (jcw == NULL || jcw->is_first_frame()) { + return false; + } + } + + // If we find a decipherable interpreted frame, this is our initial frame. + if (candidate.is_interpreted_frame()) { + if (is_decipherable_interpreted_frame(thread, &candidate, method_p, bci_p)) { + *initial_frame_p = candidate; + return true; + } + } + + // Walk some more. + candidate = candidate.sender(&map); + } + + // No dice, report no initial frames. + return false; + } +#endif + // If the starting frame we were given has no codeBlob associated with // it see if we can find such a frame because only frames with codeBlobs // are possible Java frames. -- GitLab From ba86dd4aaf597a0f0832085b50fa00498f053a6a Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 8 Dec 2021 18:02:34 +0000 Subject: [PATCH 683/890] 8278445: ProblemList tools/jpackage/share/IconTest.java on macosx-x64 Reviewed-by: bpb --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 5a03523f327..a48fe6af429 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -833,6 +833,7 @@ jdk/jfr/api/consumer/streaming/TestLatestEvent.java 8268297 windows- # jdk_jpackage +tools/jpackage/share/IconTest.java 8278233 macosx-x64 tools/jpackage/share/MultiNameTwoPhaseTest.java 8278233 macosx-x64 ############################################################################ -- GitLab From 42d9b1baac25df649a8d575f5ffa3a0d5b8e7ed0 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Wed, 8 Dec 2021 18:50:38 +0000 Subject: [PATCH 684/890] 8277106: Cannot compile certain sources with --release Reviewed-by: darcy, mcimadamore --- make/data/symbols/java.base-C.sym.txt | 14 +- make/data/symbols/java.base-E.sym.txt | 16 +- make/data/symbols/java.base-G.sym.txt | 117 +++++- make/data/symbols/java.base-H.sym.txt | 37 +- make/data/symbols/java.xml-B.sym.txt | 4 +- make/data/symbols/java.xml-C.sym.txt | 4 +- make/data/symbols/java.xml-D.sym.txt | 4 +- make/data/symbols/java.xml-E.sym.txt | 4 +- .../symbols/jdk.incubator.foreign-F.sym.txt | 14 +- .../symbols/jdk.incubator.foreign-G.sym.txt | 4 +- .../symbols/jdk.incubator.foreign-H.sym.txt | 2 +- .../symbols/jdk.incubator.vector-G.sym.txt | 9 + .../symbols/jdk.incubator.vector-H.sym.txt | 92 +++++ make/data/symbols/jdk.javadoc-H.sym.txt | 2 +- make/data/symbols/jdk.jfr-B.sym.txt | 13 +- make/data/symbols/jdk.jfr-G.sym.txt | 7 +- .../tools/symbolgenerator/CreateSymbols.java | 272 ++++++++++++-- .../javac/platform/NonExportedSuperTypes.java | 41 +++ .../createsymbols/CreateSymbolsTest.java | 2 +- .../createsymbols/CreateSymbolsTestImpl.java | 346 +++++++++++++++++- 20 files changed, 927 insertions(+), 77 deletions(-) create mode 100644 test/langtools/tools/javac/platform/NonExportedSuperTypes.java diff --git a/make/data/symbols/java.base-C.sym.txt b/make/data/symbols/java.base-C.sym.txt index 27896d9902f..7a45fc1b49e 100644 --- a/make/data/symbols/java.base-C.sym.txt +++ b/make/data/symbols/java.base-C.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019, 2021, 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 @@ -27,7 +27,7 @@ # ########################################################## # module name java.base -header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/acl,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider target linux-amd64 flags 8000 +header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/acl,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert,jdk/internal/event[jdk.jfr] uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider target linux-amd64 flags 8000 class name java/io/FileInputStream -method name finalize descriptor ()V @@ -634,3 +634,13 @@ field name serialVersionUID descriptor J constantValue -1430015993304333921 flag class name javax/net/ssl/HttpsURLConnection method name getSSLSession descriptor ()Ljava/util/Optional; flags 1 signature ()Ljava/util/Optional; +class name jdk/internal/event/Event +header extends java/lang/Object flags 421 +method name descriptor ()V flags 4 +method name begin descriptor ()V flags 1 +method name end descriptor ()V flags 1 +method name commit descriptor ()V flags 1 +method name isEnabled descriptor ()Z flags 1 +method name shouldCommit descriptor ()Z flags 1 +method name set descriptor (ILjava/lang/Object;)V flags 1 + diff --git a/make/data/symbols/java.base-E.sym.txt b/make/data/symbols/java.base-E.sym.txt index 0aebcdd54d9..eaebf4b68f5 100644 --- a/make/data/symbols/java.base-E.sym.txt +++ b/make/data/symbols/java.base-E.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -27,7 +27,7 @@ # ########################################################## # module name java.base -header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/lang/runtime,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider target linux-amd64 flags 8000 +header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/lang/runtime,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert,jdk/internal/event[jdk.jfr] uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider target linux-amd64 flags 8000 class name java/io/PrintStream method name write descriptor ([B)V thrownTypes java/io/IOException flags 1 @@ -209,18 +209,18 @@ method name setCurrentBlocker descriptor (Ljava/lang/Object;)V flags 9 class name java/util/concurrent/locks/StampedLock header extends java/lang/Object implements java/io/Serializable flags 21 classAnnotations @Ljdk/Profile+Annotation;(value=I1) -method name tryWriteLock descriptor ()J flags 1 -method name writeLockInterruptibly descriptor ()J thrownTypes java/lang/InterruptedException flags 1 -method name tryReadLock descriptor ()J flags 1 -method name tryReadLock descriptor (JLjava/util/concurrent/TimeUnit;)J thrownTypes java/lang/InterruptedException flags 1 -method name readLockInterruptibly descriptor ()J thrownTypes java/lang/InterruptedException flags 1 -method name unlock descriptor (J)V flags 1 -method name tryWriteLock descriptor ()J -method name writeLockInterruptibly descriptor ()J -method name tryReadLock descriptor ()J -method name tryReadLock descriptor (JLjava/util/concurrent/TimeUnit;)J -method name readLockInterruptibly descriptor ()J -method name unlock descriptor (J)V +method name tryWriteLock descriptor ()J flags 1 +method name writeLockInterruptibly descriptor ()J thrownTypes java/lang/InterruptedException flags 1 +method name tryReadLock descriptor ()J flags 1 +method name tryReadLock descriptor (JLjava/util/concurrent/TimeUnit;)J thrownTypes java/lang/InterruptedException flags 1 +method name readLockInterruptibly descriptor ()J thrownTypes java/lang/InterruptedException flags 1 +method name unlock descriptor (J)V flags 1 -class name java/util/jar/Pack200 diff --git a/make/data/symbols/java.base-G.sym.txt b/make/data/symbols/java.base-G.sym.txt index 774c74459b4..8196ef6be11 100644 --- a/make/data/symbols/java.base-G.sym.txt +++ b/make/data/symbols/java.base-G.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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,6 +26,9 @@ # ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### # ########################################################## # +module name java.base +header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/lang/runtime,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert,jdk/internal/event[jdk.jfr],jdk/internal/vm/vector[jdk.incubator.vector] uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider target linux-amd64 flags 8000 + class name java/io/PrintStream header extends java/io/FilterOutputStream implements java/lang/Appendable,java/io/Closeable flags 21 innerclass innerClass java/util/Locale$Category outerClass java/util/Locale innerClassName Category flags 4019 @@ -677,8 +680,8 @@ method name toString descriptor ()Ljava/lang/String; flags 1 class name java/security/spec/PSSParameterSpec -field name TRAILER_FIELD_BC descriptor I -field name TRAILER_FIELD_BC descriptor I constantValue 1 flags 19 -method name toString descriptor ()Ljava/lang/String; +field name TRAILER_FIELD_BC descriptor I constantValue 1 flags 19 method name toString descriptor ()Ljava/lang/String; flags 1 class name java/security/spec/RSAKeyGenParameterSpec @@ -1169,3 +1172,113 @@ header extends java/lang/Object implements java/security/spec/AlgorithmParameter class name javax/crypto/spec/SecretKeySpec header extends java/lang/Object implements java/security/spec/KeySpec,javax/crypto/SecretKey flags 21 +class name jdk/internal/event/Event +header extends java/lang/Object flags 421 +-method name descriptor ()V +-method name begin descriptor ()V +-method name end descriptor ()V +-method name commit descriptor ()V +-method name isEnabled descriptor ()Z +-method name shouldCommit descriptor ()Z +-method name set descriptor (ILjava/lang/Object;)V +method name descriptor ()V flags 4 +method name begin descriptor ()V flags 1 +method name end descriptor ()V flags 1 +method name commit descriptor ()V flags 1 +method name isEnabled descriptor ()Z flags 1 +method name shouldCommit descriptor ()Z flags 1 +method name set descriptor (ILjava/lang/Object;)V flags 1 + +class name jdk/internal/vm/vector/VectorSupport +header extends java/lang/Object nestMembers jdk/internal/vm/vector/VectorSupport$VectorMask,jdk/internal/vm/vector/VectorSupport$VectorShuffle,jdk/internal/vm/vector/VectorSupport$Vector,jdk/internal/vm/vector/VectorSupport$VectorPayload,jdk/internal/vm/vector/VectorSupport$VectorSpecies flags 21 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +field name VECTOR_OP_ABS descriptor I constantValue 0 flags 19 +field name VECTOR_OP_NEG descriptor I constantValue 1 flags 19 +field name VECTOR_OP_SQRT descriptor I constantValue 2 flags 19 +field name VECTOR_OP_ADD descriptor I constantValue 4 flags 19 +field name VECTOR_OP_SUB descriptor I constantValue 5 flags 19 +field name VECTOR_OP_MUL descriptor I constantValue 6 flags 19 +field name VECTOR_OP_DIV descriptor I constantValue 7 flags 19 +field name VECTOR_OP_MIN descriptor I constantValue 8 flags 19 +field name VECTOR_OP_MAX descriptor I constantValue 9 flags 19 +field name VECTOR_OP_AND descriptor I constantValue 10 flags 19 +field name VECTOR_OP_OR descriptor I constantValue 11 flags 19 +field name VECTOR_OP_XOR descriptor I constantValue 12 flags 19 +field name VECTOR_OP_FMA descriptor I constantValue 13 flags 19 +field name VECTOR_OP_LSHIFT descriptor I constantValue 14 flags 19 +field name VECTOR_OP_RSHIFT descriptor I constantValue 15 flags 19 +field name VECTOR_OP_URSHIFT descriptor I constantValue 16 flags 19 +field name VECTOR_OP_CAST descriptor I constantValue 17 flags 19 +field name VECTOR_OP_REINTERPRET descriptor I constantValue 18 flags 19 +field name BT_eq descriptor I constantValue 0 flags 19 +field name BT_ne descriptor I constantValue 4 flags 19 +field name BT_le descriptor I constantValue 5 flags 19 +field name BT_ge descriptor I constantValue 7 flags 19 +field name BT_lt descriptor I constantValue 3 flags 19 +field name BT_gt descriptor I constantValue 1 flags 19 +field name BT_overflow descriptor I constantValue 2 flags 19 +field name BT_no_overflow descriptor I constantValue 6 flags 19 +field name T_FLOAT descriptor I constantValue 6 flags 19 +field name T_DOUBLE descriptor I constantValue 7 flags 19 +field name T_BYTE descriptor I constantValue 8 flags 19 +field name T_SHORT descriptor I constantValue 9 flags 19 +field name T_INT descriptor I constantValue 10 flags 19 +field name T_LONG descriptor I constantValue 11 flags 19 +method name descriptor ()V flags 1 +method name broadcastCoerced descriptor (Ljava/lang/Class;Ljava/lang/Class;IJLjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$BroadcastOperation;)Ljava/lang/Object; flags 9 signature ;>(Ljava/lang/Class<+TVM;>;Ljava/lang/Class;IJTS;Ljdk/internal/vm/vector/VectorSupport$BroadcastOperation;)TVM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name shuffleIota descriptor (Ljava/lang/Class;Ljava/lang/Class;Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;IIIILjdk/internal/vm/vector/VectorSupport$ShuffleIotaOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorShuffle; flags 9 signature ;>(Ljava/lang/Class<*>;Ljava/lang/Class<*>;TS;IIIILjdk/internal/vm/vector/VectorSupport$ShuffleIotaOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorShuffle; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name shuffleToVector descriptor (Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;ILjdk/internal/vm/vector/VectorSupport$ShuffleToVectorOperation;)Ljava/lang/Object; flags 9 signature ;E:Ljava/lang/Object;>(Ljava/lang/Class<*>;Ljava/lang/Class<*>;Ljava/lang/Class<*>;TSh;ILjdk/internal/vm/vector/VectorSupport$ShuffleToVectorOperation;)TVM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name indexVector descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;ILjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$IndexOperation;)Ljdk/internal/vm/vector/VectorSupport$Vector; flags 9 signature ;E:Ljava/lang/Object;S:Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;>(Ljava/lang/Class<+TV;>;Ljava/lang/Class;ITV;ITS;Ljdk/internal/vm/vector/VectorSupport$IndexOperation;)TV; +method name reductionCoerced descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljava/util/function/Function;)J flags 9 signature ;>(ILjava/lang/Class<*>;Ljava/lang/Class<*>;ITV;Ljava/util/function/Function;)J runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name extract descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;ILjdk/internal/vm/vector/VectorSupport$VecExtractOp;)J flags 9 signature ;>(Ljava/lang/Class<*>;Ljava/lang/Class<*>;ITV;ILjdk/internal/vm/vector/VectorSupport$VecExtractOp;)J runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name insert descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;IJLjdk/internal/vm/vector/VectorSupport$VecInsertOp;)Ljdk/internal/vm/vector/VectorSupport$Vector; flags 9 signature ;>(Ljava/lang/Class<+TV;>;Ljava/lang/Class<*>;ITV;IJLjdk/internal/vm/vector/VectorSupport$VecInsertOp;)TV; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name unaryOp descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object; flags 9 signature (ILjava/lang/Class<+TVM;>;Ljava/lang/Class<*>;ITVM;Ljava/util/function/Function;)TVM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name binaryOp descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object; flags 9 signature (ILjava/lang/Class<+TVM;>;Ljava/lang/Class<*>;ITVM;TVM;Ljava/util/function/BiFunction;)TVM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name ternaryOp descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljdk/internal/vm/vector/VectorSupport$TernaryOperation;)Ljava/lang/Object; flags 9 signature (ILjava/lang/Class<+TVM;>;Ljava/lang/Class<*>;ITVM;TVM;TVM;Ljdk/internal/vm/vector/VectorSupport$TernaryOperation;)TVM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name load descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;JLjava/lang/Object;ILjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$LoadOperation;)Ljava/lang/Object; flags 9 signature ;>(Ljava/lang/Class<+TVM;>;Ljava/lang/Class;ILjava/lang/Object;JTC;ITS;Ljdk/internal/vm/vector/VectorSupport$LoadOperation;)TVM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name loadWithMap descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/Object;JLjdk/internal/vm/vector/VectorSupport$Vector;Ljava/lang/Object;I[IILjdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$LoadVectorOperationWithMap;)Ljdk/internal/vm/vector/VectorSupport$Vector; flags 9 signature ;W:Ljdk/internal/vm/vector/VectorSupport$Vector;E:Ljava/lang/Object;S:Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;>(Ljava/lang/Class<*>;Ljava/lang/Class;ILjava/lang/Class<*>;Ljava/lang/Object;JTW;TC;I[IITS;Ljdk/internal/vm/vector/VectorSupport$LoadVectorOperationWithMap;)TV; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name store descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;JLjdk/internal/vm/vector/VectorSupport$Vector;Ljava/lang/Object;ILjdk/internal/vm/vector/VectorSupport$StoreVectorOperation;)V flags 9 signature ;>(Ljava/lang/Class<*>;Ljava/lang/Class<*>;ILjava/lang/Object;JTV;TC;ILjdk/internal/vm/vector/VectorSupport$StoreVectorOperation;)V runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name storeWithMap descriptor (Ljava/lang/Class;Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/Object;JLjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljava/lang/Object;I[IILjdk/internal/vm/vector/VectorSupport$StoreVectorOperationWithMap;)V flags 9 signature ;W:Ljdk/internal/vm/vector/VectorSupport$Vector;>(Ljava/lang/Class<*>;Ljava/lang/Class<*>;ILjava/lang/Class<*>;Ljava/lang/Object;JTW;TV;TC;I[IILjdk/internal/vm/vector/VectorSupport$StoreVectorOperationWithMap;)V runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name test descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Z flags 9 signature (ILjava/lang/Class<*>;Ljava/lang/Class<*>;ITVM;TVM;Ljava/util/function/BiFunction;)Z runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name compare descriptor (ILjava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorCompareOp;)Ljdk/internal/vm/vector/VectorSupport$VectorMask; flags 9 signature ;M:Ljdk/internal/vm/vector/VectorSupport$VectorMask;E:Ljava/lang/Object;>(ILjava/lang/Class<+TV;>;Ljava/lang/Class;Ljava/lang/Class<*>;ITV;TV;Ljdk/internal/vm/vector/VectorSupport$VectorCompareOp;)TM; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name rearrangeOp descriptor (Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;Ljdk/internal/vm/vector/VectorSupport$VectorRearrangeOp;)Ljdk/internal/vm/vector/VectorSupport$Vector; flags 9 signature ;Sh:Ljdk/internal/vm/vector/VectorSupport$VectorShuffle;E:Ljava/lang/Object;>(Ljava/lang/Class<+TV;>;Ljava/lang/Class;Ljava/lang/Class<*>;ITV;TSh;Ljdk/internal/vm/vector/VectorSupport$VectorRearrangeOp;)TV; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name blend descriptor (Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$VectorBlendOp;)Ljdk/internal/vm/vector/VectorSupport$Vector; flags 9 signature ;M:Ljdk/internal/vm/vector/VectorSupport$VectorMask;E:Ljava/lang/Object;>(Ljava/lang/Class<+TV;>;Ljava/lang/Class;Ljava/lang/Class<*>;ITV;TV;TM;Ljdk/internal/vm/vector/VectorSupport$VectorBlendOp;)TV; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name broadcastInt descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;ILjdk/internal/vm/vector/VectorSupport$VectorBroadcastIntOp;)Ljdk/internal/vm/vector/VectorSupport$Vector; flags 9 signature ;>(ILjava/lang/Class<+TV;>;Ljava/lang/Class<*>;ITV;ILjdk/internal/vm/vector/VectorSupport$VectorBroadcastIntOp;)TV; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name convert descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$VectorPayload;Ljdk/internal/vm/vector/VectorSupport$VectorSpecies;Ljdk/internal/vm/vector/VectorSupport$VectorConvertOp;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload; flags 9 signature ;>(ILjava/lang/Class<*>;Ljava/lang/Class<*>;ILjava/lang/Class<*>;Ljava/lang/Class<*>;ITVIN;TS;Ljdk/internal/vm/vector/VectorSupport$VectorConvertOp;)TVOUT; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name maybeRebox descriptor (Ljava/lang/Object;)Ljava/lang/Object; flags 9 signature (TV;)TV; runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; +method name getMaxLaneCount descriptor (Ljava/lang/Class;)I flags 109 signature (Ljava/lang/Class<*>;)I +method name isNonCapturingLambda descriptor (Ljava/lang/Object;)Z flags 9 + +class name jdk/internal/vm/vector/VectorSupport$Vector +header extends jdk/internal/vm/vector/VectorSupport$VectorPayload nestHost jdk/internal/vm/vector/VectorSupport flags 21 signature Ljdk/internal/vm/vector/VectorSupport$VectorPayload; +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +method name descriptor (Ljava/lang/Object;)V flags 1 + +class name jdk/internal/vm/vector/VectorSupport$VectorMask +header extends jdk/internal/vm/vector/VectorSupport$VectorPayload nestHost jdk/internal/vm/vector/VectorSupport flags 21 signature Ljdk/internal/vm/vector/VectorSupport$VectorPayload; +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +method name descriptor (Ljava/lang/Object;)V flags 1 + +class name jdk/internal/vm/vector/VectorSupport$VectorPayload +header extends java/lang/Object nestHost jdk/internal/vm/vector/VectorSupport flags 21 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +method name descriptor (Ljava/lang/Object;)V flags 1 +method name getPayload descriptor ()Ljava/lang/Object; flags 14 + +class name jdk/internal/vm/vector/VectorSupport$VectorShuffle +header extends jdk/internal/vm/vector/VectorSupport$VectorPayload nestHost jdk/internal/vm/vector/VectorSupport flags 21 signature Ljdk/internal/vm/vector/VectorSupport$VectorPayload; +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +method name descriptor (Ljava/lang/Object;)V flags 1 + +class name jdk/internal/vm/vector/VectorSupport$VectorSpecies +header extends java/lang/Object nestHost jdk/internal/vm/vector/VectorSupport flags 21 signature Ljava/lang/Object; +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +method name descriptor ()V flags 1 + diff --git a/make/data/symbols/java.base-H.sym.txt b/make/data/symbols/java.base-H.sym.txt index 585d05063b3..c6ef0d70aeb 100644 --- a/make/data/symbols/java.base-H.sym.txt +++ b/make/data/symbols/java.base-H.sym.txt @@ -27,7 +27,7 @@ # ########################################################## # module name java.base -header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/lang/runtime,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/random,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/random/RandomGenerator,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider,interface\u0020;java/util/random/RandomGenerator\u0020;impls\u0020;java/security/SecureRandom\u005C;u002C;java/util/Random\u005C;u002C;java/util/SplittableRandom target linux-amd64 flags 8000 +header exports java/io,java/lang,java/lang/annotation,java/lang/constant,java/lang/invoke,java/lang/module,java/lang/ref,java/lang/reflect,java/lang/runtime,java/math,java/net,java/net/spi,java/nio,java/nio/channels,java/nio/channels/spi,java/nio/charset,java/nio/charset/spi,java/nio/file,java/nio/file/attribute,java/nio/file/spi,java/security,java/security/cert,java/security/interfaces,java/security/spec,java/text,java/text/spi,java/time,java/time/chrono,java/time/format,java/time/temporal,java/time/zone,java/util,java/util/concurrent,java/util/concurrent/atomic,java/util/concurrent/locks,java/util/function,java/util/jar,java/util/random,java/util/regex,java/util/spi,java/util/stream,java/util/zip,javax/crypto,javax/crypto/interfaces,javax/crypto/spec,javax/net,javax/net/ssl,javax/security/auth,javax/security/auth/callback,javax/security/auth/login,javax/security/auth/spi,javax/security/auth/x500,javax/security/cert,jdk/internal/event[jdk.jfr],jdk/internal/vm/vector[jdk.incubator.vector] uses java/lang/System$LoggerFinder,java/net/ContentHandlerFactory,java/net/spi/URLStreamHandlerProvider,java/nio/channels/spi/AsynchronousChannelProvider,java/nio/channels/spi/SelectorProvider,java/nio/charset/spi/CharsetProvider,java/nio/file/spi/FileSystemProvider,java/nio/file/spi/FileTypeDetector,java/security/Provider,java/text/spi/BreakIteratorProvider,java/text/spi/CollatorProvider,java/text/spi/DateFormatProvider,java/text/spi/DateFormatSymbolsProvider,java/text/spi/DecimalFormatSymbolsProvider,java/text/spi/NumberFormatProvider,java/time/chrono/AbstractChronology,java/time/chrono/Chronology,java/time/zone/ZoneRulesProvider,java/util/random/RandomGenerator,java/util/spi/CalendarDataProvider,java/util/spi/CalendarNameProvider,java/util/spi/CurrencyNameProvider,java/util/spi/LocaleNameProvider,java/util/spi/ResourceBundleControlProvider,java/util/spi/ResourceBundleProvider,java/util/spi/TimeZoneNameProvider,java/util/spi/ToolProvider,javax/security/auth/spi/LoginModule,jdk/internal/logger/DefaultLoggerFinder,sun/text/spi/JavaTimeDateTimePatternProvider,sun/util/locale/provider/LocaleDataMetaInfo,sun/util/resources/LocaleData$CommonResourceBundleProvider,sun/util/resources/LocaleData$SupplementaryResourceBundleProvider,sun/util/spi/CalendarProvider provides interface\u0020;java/nio/file/spi/FileSystemProvider\u0020;impls\u0020;jdk/internal/jrtfs/JrtFileSystemProvider,interface\u0020;java/util/random/RandomGenerator\u0020;impls\u0020;java/security/SecureRandom\u005C;u002C;java/util/Random\u005C;u002C;java/util/SplittableRandom target linux-amd64 flags 8000 class name java/io/CharArrayReader method name read descriptor (Ljava/nio/CharBuffer;)I thrownTypes java/io/IOException flags 1 @@ -114,8 +114,8 @@ header extends java/lang/Object implements java/lang/annotation/Annotation flags class name java/lang/System -method name setSecurityManager descriptor (Ljava/lang/SecurityManager;)V -method name getSecurityManager descriptor ()Ljava/lang/SecurityManager; -method name getSecurityManager descriptor ()Ljava/lang/SecurityManager; flags 9 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="17") method name setSecurityManager descriptor (Ljava/lang/SecurityManager;)V flags 9 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="17")@Ljdk/internal/reflect/CallerSensitive; +method name getSecurityManager descriptor ()Ljava/lang/SecurityManager; flags 9 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="17") class name java/lang/Thread -method name checkAccess descriptor ()V @@ -313,8 +313,8 @@ field name SHA512_256 descriptor Ljava/security/spec/MGF1ParameterSpec; flags 19 class name java/security/spec/PSSParameterSpec -field name TRAILER_FIELD_BC descriptor I -field name TRAILER_FIELD_BC descriptor I constantValue 1 flags 19 -method name toString descriptor ()Ljava/lang/String; +field name TRAILER_FIELD_BC descriptor I constantValue 1 flags 19 method name toString descriptor ()Ljava/lang/String; flags 1 class name java/security/spec/RSAKeyGenParameterSpec @@ -470,8 +470,8 @@ method name splits descriptor ()Ljava/util/stream/Stream; flags 1 signature ()Lj method name splits descriptor (J)Ljava/util/stream/Stream; flags 1 signature (J)Ljava/util/stream/Stream; method name splits descriptor (Ljava/util/random/RandomGenerator$SplittableGenerator;)Ljava/util/stream/Stream; flags 1 signature (Ljava/util/random/RandomGenerator$SplittableGenerator;)Ljava/util/stream/Stream; method name splits descriptor (JLjava/util/random/RandomGenerator$SplittableGenerator;)Ljava/util/stream/Stream; flags 1 signature (JLjava/util/random/RandomGenerator$SplittableGenerator;)Ljava/util/stream/Stream; -method name split descriptor ()Ljava/util/random/RandomGenerator$SplittableGenerator; flags 1041 method name split descriptor (Ljava/util/random/RandomGenerator$SplittableGenerator;)Ljava/util/random/RandomGenerator$SplittableGenerator; flags 1041 +method name split descriptor ()Ljava/util/random/RandomGenerator$SplittableGenerator; flags 1041 class name java/util/TimeZone header extends java/lang/Object implements java/io/Serializable,java/lang/Cloneable flags 421 @@ -928,3 +928,32 @@ method name doAsPrivileged descriptor (Ljavax/security/auth/Subject;Ljava/securi class name javax/security/auth/SubjectDomainCombiner header extends java/lang/Object implements java/security/DomainCombiner flags 21 deprecated true runtimeAnnotations @Ljava/lang/Deprecated;(forRemoval=Ztrue,since="17") +class name jdk/internal/vm/vector/VectorSupport +field name VECTOR_OP_MASK_TRUECOUNT descriptor I constantValue 19 flags 19 +field name VECTOR_OP_MASK_FIRSTTRUE descriptor I constantValue 20 flags 19 +field name VECTOR_OP_MASK_LASTTRUE descriptor I constantValue 21 flags 19 +field name VECTOR_OP_TAN descriptor I constantValue 101 flags 19 +field name VECTOR_OP_TANH descriptor I constantValue 102 flags 19 +field name VECTOR_OP_SIN descriptor I constantValue 103 flags 19 +field name VECTOR_OP_SINH descriptor I constantValue 104 flags 19 +field name VECTOR_OP_COS descriptor I constantValue 105 flags 19 +field name VECTOR_OP_COSH descriptor I constantValue 106 flags 19 +field name VECTOR_OP_ASIN descriptor I constantValue 107 flags 19 +field name VECTOR_OP_ACOS descriptor I constantValue 108 flags 19 +field name VECTOR_OP_ATAN descriptor I constantValue 109 flags 19 +field name VECTOR_OP_ATAN2 descriptor I constantValue 110 flags 19 +field name VECTOR_OP_CBRT descriptor I constantValue 111 flags 19 +field name VECTOR_OP_LOG descriptor I constantValue 112 flags 19 +field name VECTOR_OP_LOG10 descriptor I constantValue 113 flags 19 +field name VECTOR_OP_LOG1P descriptor I constantValue 114 flags 19 +field name VECTOR_OP_POW descriptor I constantValue 115 flags 19 +field name VECTOR_OP_EXP descriptor I constantValue 116 flags 19 +field name VECTOR_OP_EXPM1 descriptor I constantValue 117 flags 19 +field name VECTOR_OP_HYPOT descriptor I constantValue 118 flags 19 +field name BT_unsigned_compare descriptor I constantValue 16 flags 19 +field name BT_ule descriptor I constantValue 21 flags 19 +field name BT_uge descriptor I constantValue 23 flags 19 +field name BT_ult descriptor I constantValue 19 flags 19 +field name BT_ugt descriptor I constantValue 17 flags 19 +method name maskReductionCoerced descriptor (ILjava/lang/Class;Ljava/lang/Class;ILjava/lang/Object;Ljdk/internal/vm/vector/VectorSupport$VectorMaskOp;)I flags 9 signature (ILjava/lang/Class<+TM;>;Ljava/lang/Class<*>;ITM;Ljdk/internal/vm/vector/VectorSupport$VectorMaskOp;)I runtimeAnnotations @Ljdk/internal/vm/annotation/IntrinsicCandidate; + diff --git a/make/data/symbols/java.xml-B.sym.txt b/make/data/symbols/java.xml-B.sym.txt index 08675c9bf03..3f256899258 100644 --- a/make/data/symbols/java.xml-B.sym.txt +++ b/make/data/symbols/java.xml-B.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, 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 @@ -136,8 +136,8 @@ header extends java/lang/Object implements javax/xml/stream/util/XMLEventConsume class name javax/xml/stream/XMLInputFactory header extends java/lang/Object flags 421 -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; +method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 class name javax/xml/stream/XMLOutputFactory header extends java/lang/Object flags 421 diff --git a/make/data/symbols/java.xml-C.sym.txt b/make/data/symbols/java.xml-C.sym.txt index 6023e7f147c..56f91aac3dc 100644 --- a/make/data/symbols/java.xml-C.sym.txt +++ b/make/data/symbols/java.xml-C.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019, 2021, 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 @@ -27,6 +27,6 @@ # ########################################################## # class name javax/xml/stream/XMLInputFactory -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; +method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 diff --git a/make/data/symbols/java.xml-D.sym.txt b/make/data/symbols/java.xml-D.sym.txt index 29a4adb0d58..a91b0cd8dd1 100644 --- a/make/data/symbols/java.xml-D.sym.txt +++ b/make/data/symbols/java.xml-D.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019, 2021, 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,6 +42,6 @@ method name newNSInstance descriptor ()Ljavax/xml/parsers/SAXParserFactory; flag method name newNSInstance descriptor (Ljava/lang/String;Ljava/lang/ClassLoader;)Ljavax/xml/parsers/SAXParserFactory; flags 9 class name javax/xml/stream/XMLInputFactory -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; +method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 diff --git a/make/data/symbols/java.xml-E.sym.txt b/make/data/symbols/java.xml-E.sym.txt index 3c5d6da6fc3..9c4ac9945e8 100644 --- a/make/data/symbols/java.xml-E.sym.txt +++ b/make/data/symbols/java.xml-E.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2019, 2021, 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 @@ -27,8 +27,8 @@ # ########################################################## # class name javax/xml/stream/XMLInputFactory -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 -method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; +method name newFactory descriptor ()Ljavax/xml/stream/XMLInputFactory; thrownTypes javax/xml/stream/FactoryConfigurationError flags 9 class name org/xml/sax/ContentHandler method name declaration descriptor (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V thrownTypes org/xml/sax/SAXException flags 1 diff --git a/make/data/symbols/jdk.incubator.foreign-F.sym.txt b/make/data/symbols/jdk.incubator.foreign-F.sym.txt index 4a37cfad9b5..efb2d71b334 100644 --- a/make/data/symbols/jdk.incubator.foreign-F.sym.txt +++ b/make/data/symbols/jdk.incubator.foreign-F.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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,9 +59,9 @@ method name asSlice descriptor (JJ)Ljdk/incubator/foreign/MemorySegment; flags 1 method name withAccessModes descriptor (I)Ljdk/incubator/foreign/MemorySegment; flags 1041 class name jdk/incubator/foreign/MemoryAddress -field name NULL descriptor Ljdk/incubator/foreign/MemoryAddress; flags 19 -method name offset descriptor ()J -method name copy descriptor (Ljdk/incubator/foreign/MemoryAddress;Ljdk/incubator/foreign/MemoryAddress;J)V +field name NULL descriptor Ljdk/incubator/foreign/MemoryAddress; flags 19 method name segmentOffset descriptor ()J flags 401 method name toRawLongValue descriptor ()J flags 401 method name rebase descriptor (Ljdk/incubator/foreign/MemorySegment;)Ljdk/incubator/foreign/MemoryAddress; flags 401 @@ -78,8 +78,8 @@ method name collectCoordinates descriptor (Ljava/lang/invoke/VarHandle;ILjava/la method name dropCoordinates descriptor (Ljava/lang/invoke/VarHandle;I[Ljava/lang/Class;)Ljava/lang/invoke/VarHandle; flags 89 signature (Ljava/lang/invoke/VarHandle;I[Ljava/lang/Class<*>;)Ljava/lang/invoke/VarHandle; class name jdk/incubator/foreign/MemoryLayout -field name LAYOUT_NAME descriptor Ljava/lang/String; constantValue layout/name flags 19 -method name offset descriptor ([Ljdk/incubator/foreign/MemoryLayout$PathElement;)J +field name LAYOUT_NAME descriptor Ljava/lang/String; constantValue layout/name flags 19 method name attribute descriptor (Ljava/lang/String;)Ljava/util/Optional; flags 401 signature (Ljava/lang/String;)Ljava/util/Optional; method name withAttribute descriptor (Ljava/lang/String;Ljava/lang/constant/Constable;)Ljdk/incubator/foreign/MemoryLayout; flags 401 method name attributes descriptor ()Ljava/util/stream/Stream; flags 401 signature ()Ljava/util/stream/Stream; @@ -88,16 +88,16 @@ method name byteOffset descriptor ([Ljdk/incubator/foreign/MemoryLayout$PathElem method name isPadding descriptor ()Z flags 401 class name jdk/incubator/foreign/MemorySegment +-method name acquire descriptor ()Ljdk/incubator/foreign/MemorySegment; +-method name asReadOnly descriptor ()Ljdk/incubator/foreign/MemorySegment; +-method name isReadOnly descriptor ()Z +-method name mapFromPath descriptor (Ljava/nio/file/Path;JLjava/nio/channels/FileChannel$MapMode;)Ljdk/incubator/foreign/MemorySegment; field name READ descriptor I constantValue 1 flags 19 field name WRITE descriptor I constantValue 2 flags 19 field name CLOSE descriptor I constantValue 4 flags 19 field name ACQUIRE descriptor I constantValue 8 flags 19 field name HANDOFF descriptor I constantValue 16 flags 19 field name ALL_ACCESS descriptor I constantValue 31 flags 19 --method name acquire descriptor ()Ljdk/incubator/foreign/MemorySegment; --method name asReadOnly descriptor ()Ljdk/incubator/foreign/MemorySegment; --method name isReadOnly descriptor ()Z --method name mapFromPath descriptor (Ljava/nio/file/Path;JLjava/nio/channels/FileChannel$MapMode;)Ljdk/incubator/foreign/MemorySegment; method name spliterator descriptor (Ljdk/incubator/foreign/MemorySegment;Ljdk/incubator/foreign/SequenceLayout;)Ljava/util/Spliterator; flags 9 signature (TS;Ljdk/incubator/foreign/SequenceLayout;)Ljava/util/Spliterator; method name withOwnerThread descriptor (Ljava/lang/Thread;)Ljdk/incubator/foreign/MemorySegment; flags 401 method name withAccessModes descriptor (I)Ljdk/incubator/foreign/MemorySegment; flags 401 diff --git a/make/data/symbols/jdk.incubator.foreign-G.sym.txt b/make/data/symbols/jdk.incubator.foreign-G.sym.txt index 5bb38702f4f..3ea0960ea1e 100644 --- a/make/data/symbols/jdk.incubator.foreign-G.sym.txt +++ b/make/data/symbols/jdk.incubator.foreign-G.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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 @@ -264,12 +264,12 @@ header extends java/lang/Object implements jdk/incubator/foreign/Addressable,jav innerclass innerClass java/nio/channels/FileChannel$MapMode outerClass java/nio/channels/FileChannel innerClassName MapMode flags 9 innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 -field name ACQUIRE descriptor I -field name SHARE descriptor I constantValue 8 flags 19 -method name baseAddress descriptor ()Ljdk/incubator/foreign/MemoryAddress; -method name spliterator descriptor (Ljdk/incubator/foreign/MemorySegment;Ljdk/incubator/foreign/SequenceLayout;)Ljava/util/Spliterator; -method name withOwnerThread descriptor (Ljava/lang/Thread;)Ljdk/incubator/foreign/MemorySegment; -method name mapFromPath descriptor (Ljava/nio/file/Path;JJLjava/nio/channels/FileChannel$MapMode;)Ljdk/incubator/foreign/MappedMemorySegment; -method name ofNativeRestricted descriptor (Ljdk/incubator/foreign/MemoryAddress;JLjava/lang/Thread;Ljava/lang/Runnable;Ljava/lang/Object;)Ljdk/incubator/foreign/MemorySegment; +field name SHARE descriptor I constantValue 8 flags 19 method name address descriptor ()Ljdk/incubator/foreign/MemoryAddress; flags 401 method name spliterator descriptor (Ljdk/incubator/foreign/SequenceLayout;)Ljava/util/Spliterator; flags 401 signature (Ljdk/incubator/foreign/SequenceLayout;)Ljava/util/Spliterator; method name asSlice descriptor (Ljdk/incubator/foreign/MemoryAddress;J)Ljdk/incubator/foreign/MemorySegment; flags 1 diff --git a/make/data/symbols/jdk.incubator.foreign-H.sym.txt b/make/data/symbols/jdk.incubator.foreign-H.sym.txt index 376ba519f57..d5349d378bf 100644 --- a/make/data/symbols/jdk.incubator.foreign-H.sym.txt +++ b/make/data/symbols/jdk.incubator.foreign-H.sym.txt @@ -43,6 +43,7 @@ innerclass innerClass jdk/incubator/foreign/CLinker$VaList$Builder outerClass jd -method name allocateMemoryRestricted descriptor (J)Ljdk/incubator/foreign/MemoryAddress; -method name freeMemoryRestricted descriptor (Ljdk/incubator/foreign/MemoryAddress;)V method name getInstance descriptor ()Ljdk/incubator/foreign/CLinker; flags 9 runtimeAnnotations @Ljdk/internal/reflect/CallerSensitive; +method name systemLookup descriptor ()Ljdk/incubator/foreign/SymbolLookup; flags 9 runtimeAnnotations @Ljdk/internal/reflect/CallerSensitive; method name downcallHandle descriptor (Ljdk/incubator/foreign/Addressable;Ljdk/incubator/foreign/SegmentAllocator;Ljava/lang/invoke/MethodType;Ljdk/incubator/foreign/FunctionDescriptor;)Ljava/lang/invoke/MethodHandle; flags 401 method name downcallHandle descriptor (Ljava/lang/invoke/MethodType;Ljdk/incubator/foreign/FunctionDescriptor;)Ljava/lang/invoke/MethodHandle; flags 401 method name upcallStub descriptor (Ljava/lang/invoke/MethodHandle;Ljdk/incubator/foreign/FunctionDescriptor;Ljdk/incubator/foreign/ResourceScope;)Ljdk/incubator/foreign/MemoryAddress; flags 401 @@ -51,7 +52,6 @@ method name toCString descriptor (Ljava/lang/String;Ljdk/incubator/foreign/Resou method name toJavaString descriptor (Ljdk/incubator/foreign/MemoryAddress;)Ljava/lang/String; flags 9 runtimeAnnotations @Ljdk/internal/reflect/CallerSensitive; method name allocateMemory descriptor (J)Ljdk/incubator/foreign/MemoryAddress; flags 9 runtimeAnnotations @Ljdk/internal/reflect/CallerSensitive; method name freeMemory descriptor (Ljdk/incubator/foreign/MemoryAddress;)V flags 9 runtimeAnnotations @Ljdk/internal/reflect/CallerSensitive; -method name systemLookup descriptor ()Ljdk/incubator/foreign/SymbolLookup; flags 9 runtimeAnnotations @Ljdk/internal/reflect/CallerSensitive; class name jdk/incubator/foreign/CLinker$VaList header extends java/lang/Object implements jdk/incubator/foreign/Addressable nestHost jdk/incubator/foreign/CLinker sealed true flags 601 diff --git a/make/data/symbols/jdk.incubator.vector-G.sym.txt b/make/data/symbols/jdk.incubator.vector-G.sym.txt index dec09658dc0..35c8da2c622 100644 --- a/make/data/symbols/jdk.incubator.vector-G.sym.txt +++ b/make/data/symbols/jdk.incubator.vector-G.sym.txt @@ -32,6 +32,8 @@ header exports jdk/incubator/vector requires name\u0020;java.base\u0020;flags\u0 class name jdk/incubator/vector/AbstractVector header extends jdk/incubator/vector/Vector flags 420 signature Ljdk/incubator/vector/Vector; innerclass innerClass jdk/incubator/vector/VectorOperators$Conversion outerClass jdk/incubator/vector/VectorOperators innerClassName Conversion flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 @@ -55,6 +57,7 @@ method name slice descriptor (I)Ljdk/incubator/vector/Vector; flags 1041 class name jdk/incubator/vector/ByteVector header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 @@ -230,6 +233,7 @@ method name slice descriptor (I)Ljdk/incubator/vector/AbstractVector; flags 1041 class name jdk/incubator/vector/DoubleVector header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 @@ -402,6 +406,7 @@ method name slice descriptor (I)Ljdk/incubator/vector/AbstractVector; flags 1041 class name jdk/incubator/vector/FloatVector header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 @@ -574,6 +579,7 @@ method name slice descriptor (I)Ljdk/incubator/vector/AbstractVector; flags 1041 class name jdk/incubator/vector/IntVector header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 @@ -750,6 +756,7 @@ method name slice descriptor (I)Ljdk/incubator/vector/AbstractVector; flags 1041 class name jdk/incubator/vector/LongVector header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 @@ -919,6 +926,7 @@ method name slice descriptor (I)Ljdk/incubator/vector/AbstractVector; flags 1041 class name jdk/incubator/vector/ShortVector header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 @@ -1184,6 +1192,7 @@ method name hashCode descriptor ()I flags 401 class name jdk/incubator/vector/VectorMask header extends jdk/internal/vm/vector/VectorSupport$VectorMask flags 421 signature Ljdk/internal/vm/vector/VectorSupport$VectorMask; innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 method name vectorSpecies descriptor ()Ljdk/incubator/vector/VectorSpecies; flags 401 signature ()Ljdk/incubator/vector/VectorSpecies; method name length descriptor ()I flags 11 runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; diff --git a/make/data/symbols/jdk.incubator.vector-H.sym.txt b/make/data/symbols/jdk.incubator.vector-H.sym.txt index a815726e54b..b83ff570747 100644 --- a/make/data/symbols/jdk.incubator.vector-H.sym.txt +++ b/make/data/symbols/jdk.incubator.vector-H.sym.txt @@ -27,6 +27,20 @@ # ########################################################## # class name jdk/incubator/vector/ByteVector +header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; +innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Ternary outerClass jdk/incubator/vector/VectorOperators innerClassName Ternary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Test outerClass jdk/incubator/vector/VectorOperators innerClassName Test flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 method name fromBooleanArray descriptor (Ljdk/incubator/vector/VectorSpecies;[ZI)Ljdk/incubator/vector/ByteVector; flags 9 signature (Ljdk/incubator/vector/VectorSpecies;[ZI)Ljdk/incubator/vector/ByteVector; runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; method name fromBooleanArray descriptor (Ljdk/incubator/vector/VectorSpecies;[ZILjdk/incubator/vector/VectorMask;)Ljdk/incubator/vector/ByteVector; flags 9 signature (Ljdk/incubator/vector/VectorSpecies;[ZILjdk/incubator/vector/VectorMask;)Ljdk/incubator/vector/ByteVector; runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; method name fromBooleanArray descriptor (Ljdk/incubator/vector/VectorSpecies;[ZI[II)Ljdk/incubator/vector/ByteVector; flags 9 signature (Ljdk/incubator/vector/VectorSpecies;[ZI[II)Ljdk/incubator/vector/ByteVector; runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; @@ -36,7 +50,85 @@ method name intoBooleanArray descriptor ([ZILjdk/incubator/vector/VectorMask;)V method name intoBooleanArray descriptor ([ZI[II)V flags 11 runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; method name intoBooleanArray descriptor ([ZI[IILjdk/incubator/vector/VectorMask;)V flags 11 signature ([ZI[IILjdk/incubator/vector/VectorMask;)V runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; +class name jdk/incubator/vector/DoubleVector +header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; +innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Ternary outerClass jdk/incubator/vector/VectorOperators innerClassName Ternary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Test outerClass jdk/incubator/vector/VectorOperators innerClassName Test flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/incubator/vector/FloatVector +header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; +innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Ternary outerClass jdk/incubator/vector/VectorOperators innerClassName Ternary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Test outerClass jdk/incubator/vector/VectorOperators innerClassName Test flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/incubator/vector/IntVector +header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; +innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Ternary outerClass jdk/incubator/vector/VectorOperators innerClassName Ternary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Test outerClass jdk/incubator/vector/VectorOperators innerClassName Test flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + +class name jdk/incubator/vector/LongVector +header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; +innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Ternary outerClass jdk/incubator/vector/VectorOperators innerClassName Ternary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Test outerClass jdk/incubator/vector/VectorOperators innerClassName Test flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 + class name jdk/incubator/vector/ShortVector +header extends jdk/incubator/vector/AbstractVector flags 421 signature Ljdk/incubator/vector/AbstractVector; +innerclass innerClass jdk/incubator/vector/VectorOperators$Operator outerClass jdk/incubator/vector/VectorOperators innerClassName Operator flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorSpecies outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorSpecies flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Unary outerClass jdk/incubator/vector/VectorOperators innerClassName Unary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Comparison outerClass jdk/incubator/vector/VectorOperators innerClassName Comparison flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Associative outerClass jdk/incubator/vector/VectorOperators innerClassName Associative flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Binary outerClass jdk/incubator/vector/VectorOperators innerClassName Binary flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$Vector outerClass jdk/internal/vm/vector/VectorSupport innerClassName Vector flags 9 +innerclass innerClass jdk/incubator/vector/VectorOperators$Ternary outerClass jdk/incubator/vector/VectorOperators innerClassName Ternary flags 609 +innerclass innerClass jdk/incubator/vector/VectorOperators$Test outerClass jdk/incubator/vector/VectorOperators innerClassName Test flags 609 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorMask outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorMask flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorShuffle outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorShuffle flags 9 +innerclass innerClass jdk/internal/vm/vector/VectorSupport$VectorPayload outerClass jdk/internal/vm/vector/VectorSupport innerClassName VectorPayload flags 9 +innerclass innerClass java/lang/invoke/MethodHandles$Lookup outerClass java/lang/invoke/MethodHandles innerClassName Lookup flags 19 method name fromCharArray descriptor (Ljdk/incubator/vector/VectorSpecies;[CI)Ljdk/incubator/vector/ShortVector; flags 9 signature (Ljdk/incubator/vector/VectorSpecies;[CI)Ljdk/incubator/vector/ShortVector; runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; method name fromCharArray descriptor (Ljdk/incubator/vector/VectorSpecies;[CILjdk/incubator/vector/VectorMask;)Ljdk/incubator/vector/ShortVector; flags 9 signature (Ljdk/incubator/vector/VectorSpecies;[CILjdk/incubator/vector/VectorMask;)Ljdk/incubator/vector/ShortVector; runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; method name fromCharArray descriptor (Ljdk/incubator/vector/VectorSpecies;[CI[II)Ljdk/incubator/vector/ShortVector; flags 9 signature (Ljdk/incubator/vector/VectorSpecies;[CI[II)Ljdk/incubator/vector/ShortVector; runtimeAnnotations @Ljdk/internal/vm/annotation/ForceInline; diff --git a/make/data/symbols/jdk.javadoc-H.sym.txt b/make/data/symbols/jdk.javadoc-H.sym.txt index b2ab2561f5c..d7d4a4c3779 100644 --- a/make/data/symbols/jdk.javadoc-H.sym.txt +++ b/make/data/symbols/jdk.javadoc-H.sym.txt @@ -29,9 +29,9 @@ class name jdk/javadoc/doclet/Reporter header extends java/lang/Object flags 601 innerclass innerClass javax/tools/Diagnostic$Kind outerClass javax/tools/Diagnostic innerClassName Kind flags 4019 +method name print descriptor (Ljavax/tools/Diagnostic$Kind;Ljavax/tools/FileObject;IIILjava/lang/String;)V flags 1 method name getStandardWriter descriptor ()Ljava/io/PrintWriter; flags 1 method name getDiagnosticWriter descriptor ()Ljava/io/PrintWriter; flags 1 -method name print descriptor (Ljavax/tools/Diagnostic$Kind;Ljavax/tools/FileObject;IIILjava/lang/String;)V flags 1 class name jdk/javadoc/doclet/StandardDoclet header extends java/lang/Object implements jdk/javadoc/doclet/Doclet flags 21 diff --git a/make/data/symbols/jdk.jfr-B.sym.txt b/make/data/symbols/jdk.jfr-B.sym.txt index a42ce39defe..be19cab9578 100644 --- a/make/data/symbols/jdk.jfr-B.sym.txt +++ b/make/data/symbols/jdk.jfr-B.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2021, 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 @@ -27,7 +27,7 @@ # ########################################################## # module name jdk.jfr -header exports jdk/jfr,jdk/jfr/consumer requires name\u0020;java.base\u0020;flags\u0020;8000 target linux-amd64 flags 8000 +header exports jdk/jfr,jdk/jfr/consumer extraModulePackages jdk/jfr/internal requires name\u0020;java.base\u0020;flags\u0020;8000 target linux-amd64 flags 8000 class name jdk/jfr/AnnotationElement header extends java/lang/Object flags 31 @@ -390,3 +390,12 @@ method name readEventTypes descriptor ()Ljava/util/List; thrownTypes java/io/IOE method name close descriptor ()V thrownTypes java/io/IOException flags 1 method name readAllEvents descriptor (Ljava/nio/file/Path;)Ljava/util/List; thrownTypes java/io/IOException flags 9 signature (Ljava/nio/file/Path;)Ljava/util/List; +class name jdk/jfr/internal/Control +header extends java/lang/Object flags 421 +method name descriptor (Ljava/security/AccessControlContext;)V flags 1 +method name descriptor (Ljava/lang/String;)V flags 1 +method name combine descriptor (Ljava/util/Set;)Ljava/lang/String; flags 401 signature (Ljava/util/Set;)Ljava/lang/String; +method name setValue descriptor (Ljava/lang/String;)V flags 401 +method name getValue descriptor ()Ljava/lang/String; flags 401 +method name clone descriptor ()Ljava/lang/Object; thrownTypes java/lang/CloneNotSupportedException flags 11 + diff --git a/make/data/symbols/jdk.jfr-G.sym.txt b/make/data/symbols/jdk.jfr-G.sym.txt index 397e082021a..ba5b7e3a743 100644 --- a/make/data/symbols/jdk.jfr-G.sym.txt +++ b/make/data/symbols/jdk.jfr-G.sym.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 2021, 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,6 +26,9 @@ # ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ### # ########################################################## # +module name jdk.jfr +header exports jdk/jfr,jdk/jfr/consumer requires name\u0020;java.base\u0020;flags\u0020;8000 target linux-amd64 flags 8000 + class name jdk/jfr/SettingControl header extends java/lang/Object flags 421 runtimeAnnotations @Ljdk/jfr/MetadataDefinition; @@ -48,3 +51,5 @@ class name jdk/jfr/consumer/RecordedObject class name jdk/jfr/consumer/RecordingStream method name onMetadata descriptor (Ljava/util/function/Consumer;)V flags 1 signature (Ljava/util/function/Consumer;)V +-class name jdk/jfr/internal/Control + diff --git a/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java b/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java index 1f439e1c29e..ea700f0b660 100644 --- a/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java +++ b/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java @@ -25,6 +25,7 @@ package build.tools.symbolgenerator; +import build.tools.symbolgenerator.CreateSymbols.ModuleHeaderDescription.ExportsDescription; import build.tools.symbolgenerator.CreateSymbols .ModuleHeaderDescription .ProvidesDescription; @@ -122,6 +123,7 @@ import com.sun.tools.classfile.Field; import com.sun.tools.classfile.InnerClasses_attribute; import com.sun.tools.classfile.InnerClasses_attribute.Info; import com.sun.tools.classfile.Method; +import com.sun.tools.classfile.ModulePackages_attribute; import com.sun.tools.classfile.MethodParameters_attribute; import com.sun.tools.classfile.ModuleMainClass_attribute; import com.sun.tools.classfile.ModuleResolution_attribute; @@ -244,7 +246,14 @@ public class CreateSymbols { md, mhd, versionsList); - mhd.exports.stream().forEach(pkg -> { + List packages = new ArrayList<>(); + mhd.exports.stream() + .map(ExportsDescription::packageName) + .forEach(packages::add); + if (mhd.extraModulePackages != null) { + packages.addAll(mhd.extraModulePackages); + } + packages.stream().forEach(pkg -> { for (char v : mhd.versions.toCharArray()) { package2Version2Module.computeIfAbsent(pkg, dummy -> new HashMap<>()).put(v, md.name); } @@ -974,13 +983,21 @@ public class CreateSymbols { return new RequiresEntry(idx, r.flags, r.version != null - ? addInt(cp, r.version) + ? addString(cp, r.version) : 0); } private static ExportsEntry createExportsEntry(List cp, - String e) { - return new ExportsEntry(addPackageName(cp, e), 0, new int[0]); + ExportsDescription export) { + int[] to; + if (export.isQualified()) { + to = export.to.stream() + .mapToInt(module -> addModuleName(cp, module)) + .toArray(); + } else { + to = new int[0]; + } + return new ExportsEntry(addPackageName(cp, export.packageName()), 0, to); } private static OpensEntry createOpensEntry(List cp, String e) { @@ -1405,7 +1422,7 @@ public class CreateSymbols { dumpDescriptions(classes, modules, platforms, Set.of(), descDest.resolve("symbols"), args); } //where: - private static final String DO_NO_MODIFY = + public static String DO_NOT_MODIFY = "#\n" + "# Copyright (c) {YEAR}, Oracle and/or its affiliates. All rights reserved.\n" + "# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n" + @@ -1477,14 +1494,19 @@ public class CreateSymbols { ExcludeIncludeList currentEIList = excludesIncludes; if (!currentVersionModules.isEmpty()) { + Set privateIncludes = + enhancedIncludesListBasedOnClassHeaders(classes, classData); Set includes = new HashSet<>(); for (ModuleDescription md : currentVersionModules.values()) { - md.header.get(0).exports.stream().map(e -> e + '/') + md.header.get(0).exports.stream() + .filter(e -> !e.isQualified()) + .map(e -> e.packageName + '/') .forEach(includes::add); } currentEIList = new ExcludeIncludeList(includes, + privateIncludes, Collections.emptySet()); } @@ -1507,7 +1529,9 @@ public class CreateSymbols { if (unsupported.header .get(0) .exports - .contains(cd.packge().replace('.', '/'))) { + .stream() + .map(ed -> ed.packageName) + .anyMatch(pack -> pack.equals(cd.packge().replace('.', '/')))) { ClassHeaderDescription ch = cd.header.get(0); if (ch.classAnnotations == null) { ch.classAnnotations = new ArrayList<>(); @@ -1529,7 +1553,7 @@ public class CreateSymbols { for (ClassDescription clazz : currentVersionClasses) { ClassHeaderDescription header = clazz.header.get(0); - if (includeEffectiveAccess(currentVersionClasses, clazz)) { + if (includeEffectiveAccess(currentVersionClasses, clazz) && currentEIList.accepts(clazz.name, false)) { modified |= include(includedClasses, currentVersionClasses, clazz.name); } @@ -1555,6 +1579,8 @@ public class CreateSymbols { } } while (modified); + Set allIncludedPackages = new HashSet<>(); + for (ClassDescription clazz : currentVersionClasses) { if (!includedClasses.contains(clazz.name)) { continue; @@ -1595,6 +1621,8 @@ public class CreateSymbols { } else { classes.add(clazz); } + + allIncludedPackages.add(clazz.packge().replace('.', '/')); } for (ModuleDescription module : currentVersionModules.values()) { @@ -1611,6 +1639,13 @@ public class CreateSymbols { } } + header.exports.removeIf(ed -> ed.isQualified() && + !allIncludedPackages.contains(ed.packageName())); + + if (header.extraModulePackages != null) { + header.extraModulePackages.retainAll(allIncludedPackages); + } + ModuleDescription existing = modules.get(module.name); if (existing != null) { @@ -1642,7 +1677,16 @@ public class CreateSymbols { md.header .stream() .filter(h -> h.versions.contains(v.version)) - .flatMap(h -> h.exports.stream()) + .flatMap(h -> { + List packages = new ArrayList<>(); + h.exports.stream() + .map(ExportsDescription::packageName) + .forEach(packages::add); + if (h.extraModulePackages != null) { + packages.addAll(h.extraModulePackages); + } + return packages.stream(); + }) .map(p -> p.replace('/', '.')) .forEach(p -> package2Modules.putIfAbsent(p, md.name)); } @@ -1718,11 +1762,11 @@ public class CreateSymbols { boolean hasChange = true; if (Files.isReadable(f)) { String oldContent = Files.readString(f, StandardCharsets.UTF_8); - int yearPos = DO_NO_MODIFY.indexOf("{YEAR}"); + int yearPos = DO_NOT_MODIFY.indexOf("{YEAR}"); String headerPattern = - Pattern.quote(DO_NO_MODIFY.substring(0, yearPos)) + + Pattern.quote(DO_NOT_MODIFY.substring(0, yearPos)) + "([0-9]+)(, [0-9]+)?" + - Pattern.quote(DO_NO_MODIFY.substring(yearPos + "{YEAR}".length())); + Pattern.quote(DO_NOT_MODIFY.substring(yearPos + "{YEAR}".length())); String pattern = headerPattern + Pattern.quote(dataString); Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(oldContent); @@ -1739,7 +1783,7 @@ public class CreateSymbols { try (Writer out = Files.newBufferedWriter(f, StandardCharsets.UTF_8)) { String currentYear = String.valueOf(year); String yearSpec = (existingYear != null && !currentYear.equals(existingYear) ? existingYear + ", " : "") + currentYear; - out.append(DO_NO_MODIFY.replace("{YEAR}", yearSpec)); + out.append(DO_NOT_MODIFY.replace("{YEAR}", yearSpec)); out.write(dataString); } } @@ -1750,7 +1794,7 @@ public class CreateSymbols { outputFiles.put(desc, files); } - symbolsOut.append(DO_NO_MODIFY.replace("{YEAR}", "2015, " + year)); + symbolsOut.append(DO_NOT_MODIFY.replace("{YEAR}", "2015, " + year)); symbolsOut.append("#command used to generate this file:\n"); symbolsOut.append("#") .append(CreateSymbols.class.getName()) @@ -1923,7 +1967,7 @@ public class CreateSymbols { return ; } - if (!excludesIncludes.accepts(cf.getName())) { + if (!excludesIncludes.accepts(cf.getName(), true)) { return ; } @@ -2019,6 +2063,45 @@ public class CreateSymbols { addModuleHeader(moduleDesc, headerDesc, version); } + private Set enhancedIncludesListBasedOnClassHeaders(ClassList classes, + Iterable classData) { + Set additionalIncludes = new HashSet<>(); + + for (byte[] classFileData : classData) { + try (InputStream in = new ByteArrayInputStream(classFileData)) { + ClassFile cf = ClassFile.read(in); + + if (cf.access_flags.is(AccessFlags.ACC_MODULE)) { + continue; + } + + Set additionalClasses = new HashSet<>(); + + if (cf.super_class != 0) { + additionalClasses.add(cf.getSuperclassName()); + } + for (int i = 0; i < cf.interfaces.length; i++) { + additionalClasses.add(cf.getInterfaceName(i)); + } + + for (String additional : additionalClasses) { + int dollar; + + additionalIncludes.add(additional); + + while ((dollar = additional.lastIndexOf('$')) != (-1)) { + additional = additional.substring(0, dollar); + additionalIncludes.add(additional); + } + } + } catch (IOException | ConstantPoolException ex) { + throw new IllegalStateException(ex); + } + } + + return additionalIncludes; + } + private void addModuleHeader(ModuleDescription moduleDesc, ModuleHeaderDescription headerDesc, String version) { @@ -2204,9 +2287,11 @@ public class CreateSymbols { header.exports = Arrays.stream(mod.exports) - .filter(ee -> ee.exports_to_count == 0) - .map(ee -> getPackageName(cf, ee.exports_index)) + .map(ee -> ExportsDescription.create(cf, ee)) .collect(Collectors.toList()); + if (header.extraModulePackages != null) { + header.exports.forEach(ed -> header.extraModulePackages.remove(ed.packageName())); + } header.requires = Arrays.stream(mod.requires) .map(r -> RequiresDescription.create(cf, r)) @@ -2242,6 +2327,20 @@ public class CreateSymbols { break; } case Attribute.ModulePackages: + assert feature instanceof ModuleHeaderDescription; + ModuleHeaderDescription header = + (ModuleHeaderDescription) feature; + ModulePackages_attribute mod = + (ModulePackages_attribute) attr; + header.extraModulePackages = new ArrayList<>(); + for (int i = 0; i < mod.packages_count; i++) { + String packageName = getPackageName(cf, mod.packages_index[i]); + if (header.exports == null || + header.exports.stream().noneMatch(ed -> ed.packageName().equals(packageName))) { + header.extraModulePackages.add(packageName); + } + } + break; case Attribute.ModuleHashes: break; case Attribute.NestHost: { @@ -2352,11 +2451,16 @@ public class CreateSymbols { } } - private static Integer getVersion(ClassFile cf, int idx) { + public static String INJECTED_VERSION = null; + + private static String getVersion(ClassFile cf, int idx) { + if (INJECTED_VERSION != null) { + return INJECTED_VERSION; + } if (idx == 0) return null; try { - return ((CONSTANT_Integer_info) cf.constant_pool.get(idx)).value; + return ((CONSTANT_Utf8_info) cf.constant_pool.get(idx)).value; } catch (InvalidIndex ex) { throw new IllegalStateException(ex); } @@ -2470,9 +2574,15 @@ public class CreateSymbols { if (clazzName == null) return false; + ClassDescription desc = classes.find(clazzName, true); + + if (desc == null) { + return false; + } + boolean modified = includedClasses.add(clazzName); - for (ClassDescription outer : classes.enclosingClasses(classes.find(clazzName, true))) { + for (ClassDescription outer : classes.enclosingClasses(desc)) { modified |= includedClasses.add(outer.name); } @@ -2514,10 +2624,17 @@ public class CreateSymbols { public static class ExcludeIncludeList { public final Set includeList; + public final Set privateIncludeList; public final Set excludeList; protected ExcludeIncludeList(Set includeList, Set excludeList) { + this(includeList, Set.of(), excludeList); + } + + protected ExcludeIncludeList(Set includeList, Set privateIncludeList, + Set excludeList) { this.includeList = includeList; + this.privateIncludeList = privateIncludeList; this.excludeList = excludeList; } @@ -2537,8 +2654,10 @@ public class CreateSymbols { return new ExcludeIncludeList(includeList, excludeList); } - public boolean accepts(String className) { - return matches(includeList, className) && !matches(excludeList, className); + public boolean accepts(String className, boolean includePrivateClasses) { + return (matches(includeList, className) || + (includePrivateClasses && matches(privateIncludeList, className))) && + !matches(excludeList, className); } private static boolean matches(Set list, String className) { @@ -2738,8 +2857,9 @@ public class CreateSymbols { static class ModuleHeaderDescription extends HeaderDescription { String name; - List exports = new ArrayList<>(); + List exports = new ArrayList<>(); List opens = new ArrayList<>(); + List extraModulePackages = new ArrayList<>(); List requires = new ArrayList<>(); List uses = new ArrayList<>(); List provides = new ArrayList<>(); @@ -2753,6 +2873,7 @@ public class CreateSymbols { hash = 83 * hash + Objects.hashCode(this.name); hash = 83 * hash + Objects.hashCode(this.exports); hash = 83 * hash + Objects.hashCode(this.opens); + hash = 83 * hash + Objects.hashCode(this.extraModulePackages); hash = 83 * hash + Objects.hashCode(this.requires); hash = 83 * hash + Objects.hashCode(this.uses); hash = 83 * hash + Objects.hashCode(this.provides); @@ -2781,6 +2902,9 @@ public class CreateSymbols { if (!listEquals(this.opens, other.opens)) { return false; } + if (!listEquals(this.extraModulePackages, other.extraModulePackages)) { + return false; + } if (!listEquals(this.requires, other.requires)) { return false; } @@ -2812,10 +2936,17 @@ public class CreateSymbols { && versions.contains(version))) return ; output.append("header"); - if (exports != null && !exports.isEmpty()) - output.append(" exports " + serializeList(exports)); + if (exports != null && !exports.isEmpty()) { + List exportsList = + exports.stream() + .map(exp -> exp.serialize()) + .collect(Collectors.toList()); + output.append(" exports " + serializeList(exportsList)); + } if (opens != null && !opens.isEmpty()) output.append(" opens " + serializeList(opens)); + if (extraModulePackages != null && !extraModulePackages.isEmpty()) + output.append(" extraModulePackages " + serializeList(extraModulePackages)); if (requires != null && !requires.isEmpty()) { List requiresList = requires.stream() @@ -2862,8 +2993,12 @@ public class CreateSymbols { if (!"header".equals(reader.lineKey)) return false; - exports = deserializeList(reader.attributes.get("exports")); + List exportsList = deserializeList(reader.attributes.get("exports"), false); + exports = exportsList.stream() + .map(ExportsDescription::deserialize) + .collect(Collectors.toList()); opens = deserializeList(reader.attributes.get("opens")); + extraModulePackages = deserializeList(reader.attributes.get("extraModulePackages")); List requiresList = deserializeList(reader.attributes.get("requires")); requires = requiresList.stream() @@ -2893,13 +3028,53 @@ public class CreateSymbols { return true; } + record ExportsDescription(String packageName, List to) { + public String serialize() { + return packageName + + (isQualified() ? "[" + quote(serializeList(to), true, true) + "]" + : ""); + } + + public static ExportsDescription deserialize(String data) { + int bracket = data.indexOf("["); + String packageName; + List to; + if (bracket != (-1)) { + packageName = data.substring(0, bracket); + to = deserializeList(unquote(data.substring(bracket + 1, data.length() - 1))); + } else { + packageName = data; + to = null; + } + + return new ExportsDescription(packageName, to); + } + + public static ExportsDescription create(ClassFile cf, + ExportsEntry ee) { + String packageName = getPackageName(cf, ee.exports_index); + List to = null; + if (ee.exports_to_count > 0) { + to = new ArrayList<>(); + for (int moduleIndex : ee.exports_to_index) { + to.add(getModuleName(cf, moduleIndex)); + } + } + return new ExportsDescription(packageName, to); + } + + public boolean isQualified() { + return to != null && !to.isEmpty(); + } + } + static class RequiresDescription { final String moduleName; final int flags; - final Integer version; + final String version; public RequiresDescription(String moduleName, int flags, - Integer version) { + String version) { this.moduleName = moduleName; this.flags = flags; this.version = version; @@ -2907,7 +3082,7 @@ public class CreateSymbols { public String serialize() { String versionKeyValue = version != null - ? " version " + quote(String.valueOf(version), true) + ? " version " + quote(version, true) : ""; return "name " + quote(moduleName, true) + " flags " + quote(Integer.toHexString(flags), true) + @@ -2917,8 +3092,8 @@ public class CreateSymbols { public static RequiresDescription deserialize(String data) { Map attributes = splitAttributes(data); - Integer ver = attributes.containsKey("version") - ? Integer.parseInt(attributes.get("version")) + String ver = attributes.containsKey("version") + ? attributes.get("version") : null; int flags = Integer.parseInt(attributes.get("flags"), 16); return new RequiresDescription(attributes.get("name"), @@ -2929,7 +3104,7 @@ public class CreateSymbols { public static RequiresDescription create(ClassFile cf, RequiresEntry req) { String mod = getModuleName(cf, req.requires_index); - Integer ver = getVersion(cf, req.requires_version_index); + String ver = getVersion(cf, req.requires_version_index); return new RequiresDescription(mod, req.requires_flags, ver); @@ -3071,10 +3246,24 @@ public class CreateSymbols { header.write(output, baselineVersion, version); } for (FieldDescription field : fields) { - field.write(output, baselineVersion, version); + if (!field.versions.contains(version)) { + field.write(output, baselineVersion, version); + } + } + for (MethodDescription method : methods) { + if (!method.versions.contains(version)) { + method.write(output, baselineVersion, version); + } + } + for (FieldDescription field : fields) { + if (field.versions.contains(version)) { + field.write(output, baselineVersion, version); + } } for (MethodDescription method : methods) { - method.write(output, baselineVersion, version); + if (method.versions.contains(version)) { + method.write(output, baselineVersion, version); + } } output.append("\n"); } @@ -3157,6 +3346,12 @@ public class CreateSymbols { return pack; } + + @Override + public String toString() { + return name; + } + } static class ClassHeaderDescription extends HeaderDescription { @@ -3265,12 +3460,12 @@ public class CreateSymbols { readRecordComponents(reader); } readInnerClasses(reader); + isSealed = reader.attributes.containsKey("permittedSubclasses"); if (isSealed) { String subclassesList = reader.attributes.get("permittedSubclasses"); permittedSubclasses = deserializeList(subclassesList); } - return true; } @@ -4120,8 +4315,11 @@ public class CreateSymbols { } w.write("module:" + module.name); w.write("\n"); - for (String pack : header.get().exports) { - w.write(pack.replace('/', '.')); + for (ExportsDescription export : header.get().exports) { + if (export.isQualified()) { + continue; + } + w.write(export.packageName.replace('/', '.')); w.write("\n"); } } diff --git a/test/langtools/tools/javac/platform/NonExportedSuperTypes.java b/test/langtools/tools/javac/platform/NonExportedSuperTypes.java new file mode 100644 index 00000000000..b3f17fd6e3c --- /dev/null +++ b/test/langtools/tools/javac/platform/NonExportedSuperTypes.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021, 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 8277106 + * @summary Verify no error is when compiling a class whose supertype is not exported. + * @modules jdk.compiler + * jdk.jfr + * @compile --release 17 NonExportedSuperTypes.java + */ + +import jdk.jfr.Event; + +public class NonExportedSuperTypes { + + public void evt(Event evt) { + evt.toString(); + } + +} diff --git a/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTest.java b/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTest.java index 2f201fd0067..c54c21bfc0d 100644 --- a/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTest.java +++ b/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTest.java @@ -23,7 +23,7 @@ /** * @test - * @bug 8072480 + * @bug 8072480 8277106 * @summary Unit test for CreateSymbols * @modules java.compiler * jdk.compiler/com.sun.tools.javac.api diff --git a/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTestImpl.java b/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTestImpl.java index 42b9649311a..307c53135a7 100644 --- a/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTestImpl.java +++ b/test/langtools/tools/javac/platform/createsymbols/CreateSymbolsTestImpl.java @@ -28,8 +28,14 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.reflect.Method; import java.util.Arrays; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.DirectoryStream; import java.nio.file.FileVisitResult; import java.nio.file.FileVisitor; import java.nio.file.Files; @@ -52,6 +58,14 @@ import build.tools.symbolgenerator.CreateSymbols.ClassDescription; import build.tools.symbolgenerator.CreateSymbols.ClassList; import build.tools.symbolgenerator.CreateSymbols.ExcludeIncludeList; import build.tools.symbolgenerator.CreateSymbols.VersionDescription; +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.Attributes; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.ClassWriter; +import com.sun.tools.classfile.ConstantPool; +import com.sun.tools.classfile.ConstantPool.CPInfo; +import com.sun.tools.classfile.ConstantPool.CONSTANT_Utf8_info; +import com.sun.tools.classfile.ModulePackages_attribute; public class CreateSymbolsTestImpl { @@ -641,6 +655,306 @@ public class CreateSymbolsTestImpl { """); } + @Test + void testNonExportedSuperclass() throws Exception { + doTestComplex("api.Api", + """ + package api; + + public class Api extends nonapi.Impl.Nested.Exp { + + public Api(); + } + """, + """ + import api.Api; + public class Test { + private void t(Api api) { + api.run(); + } + } + """, + """ + import api.Api; + public class Test { + private void t(Api api) { + fail + } + } + """, + """ + module m { + exports api; + } + """, + """ + package api; + import nonapi.Impl; + public class Api extends Impl.Nested.Exp { + } + """, + """ + package api; + public @interface Ann { + } + """, + """ + package nonapi; + import api.Ann; + public class Impl { + public static final String C = ""; + public void test() {} + @Ann + public static class Nested { + public static class Exp extends Nested implements Runnable { + public void run() {} + public OtherNested get() { return null; } + } + } + public static class OtherNested {} + } + """); + } + + void doTestComplex(String printClass, + String expected, + String depSuccess, + String depFailure, + String... code) throws Exception { + ToolBox tb = new ToolBox(); + String testClasses = System.getProperty("test.classes"); + Path output = Paths.get(testClasses, "test-data" + i++); + deleteRecursively(output); + Files.createDirectories(output); + Path ver9Jar = output.resolve("9.jar"); + compileAndPack(output, + ver9Jar, + code); + + + Path ctSym = output.resolve("ct.sym"); + + deleteRecursively(ctSym); + + CreateSymbols.ALLOW_NON_EXISTING_CLASSES = true; + CreateSymbols.EXTENSION = ".class"; + + deleteRecursively(ctSym); + + List versions = + Arrays.asList(new VersionDescription(ver9Jar.toAbsolutePath().toString(), "9", null)); + + ExcludeIncludeList acceptAll = new ExcludeIncludeList(null, null) { + @Override public boolean accepts(String className, boolean includePrivateClasses) { + return true; + } + }; + new CreateSymbols().createBaseLine(versions, acceptAll, ctSym, new String[0]); + Path symbolsDesc = ctSym.resolve("symbols"); + Path systemModules = ctSym.resolve("systemModules"); + + Files.newBufferedWriter(systemModules).close(); + + Path classesZip = output.resolve("classes.zip"); + Path classesDir = output.resolve("classes"); + + new CreateSymbols().createSymbols(null, symbolsDesc.toAbsolutePath().toString(), classesZip.toAbsolutePath().toString(), 0, "9", systemModules.toString()); + + try (JarFile jf = new JarFile(classesZip.toFile())) { + Enumeration en = jf.entries(); + + while (en.hasMoreElements()) { + JarEntry je = en.nextElement(); + if (je.isDirectory()) continue; + Path target = classesDir.resolve(je.getName()); + Files.createDirectories(target.getParent()); + Files.copy(jf.getInputStream(je), target); + } + } + + Path classes = classesDir; + Path scratch = output.resolve("scratch"); + + Files.createDirectories(scratch); + + String modulePath; + + try (Stream elements = Files.list(classes)) { + modulePath = elements.filter(el -> el.getFileName().toString().contains("9")) + .map(el -> el.resolve("m")) + .map(el -> el.toAbsolutePath().toString()) + .collect(Collectors.joining(File.pathSeparator)); + } + + { + String out = new JavacTask(tb, Task.Mode.CMDLINE) + .options("-d", scratch.toAbsolutePath().toString(), "--module-path", modulePath, + "--add-modules", "m", "-Xprint", "api.Api") + .run(Expect.SUCCESS) + .getOutput(Task.OutputKind.STDOUT) + .replaceAll("\\R", "\n"); + + if (!out.equals(expected)) { + throw new AssertionError("out=" + out + "; expected=" + expected); + } + } + + { + new JavacTask(tb) + .options("-d", scratch.toAbsolutePath().toString(), "--module-path", modulePath, + "--add-modules", "m") + .sources(depSuccess) + .run(Expect.SUCCESS) + .writeAll(); + } + + { + String expectedFailure = new JavacTask(tb) + .options("-d", scratch.toAbsolutePath().toString(), "--module-path", output.resolve("temp").toString(), + "--add-modules", "m", "-XDrawDiagnostics") + .sources(depFailure) + .run(Expect.FAIL) + .getOutput(Task.OutputKind.DIRECT) + .replaceAll("\\R", "\n"); + + String out = new JavacTask(tb) + .options("-d", scratch.toAbsolutePath().toString(), "--module-path", modulePath, + "--add-modules", "m", "-XDrawDiagnostics") + .sources(depFailure) + .run(Expect.FAIL) + .getOutput(Task.OutputKind.DIRECT) + .replaceAll("\\R", "\n"); + + if (!out.equals(expectedFailure)) { + throw new AssertionError("out=" + out + "; expected=" + expectedFailure); + } + } + } + + @Test + void testExtendsInternalData1() throws Exception { + doTestData(""" + module name m + header exports api,nonapi[java.base] requires name\\u0020;java.base\\u0020;flags\\u0020;8000\\u0020;version\\u0020;0 flags 8000 + + class name api/Ann + header extends java/lang/Object implements java/lang/annotation/Annotation flags 2601 + + class name api/Api + header extends nonapi/Impl$Nested$Exp flags 21 + innerclass innerClass nonapi/Impl$Nested outerClass nonapi/Impl innerClassName Nested flags 9 + innerclass innerClass nonapi/Impl$Nested$Exp outerClass nonapi/Impl$Nested innerClassName Exp flags 9 + method name descriptor ()V flags 1 + + class name nonapi/Impl + header extends java/lang/Object nestMembers nonapi/Impl$Nested,nonapi/Impl$Nested$Exp flags 21 + innerclass innerClass nonapi/Impl$Nested outerClass nonapi/Impl innerClassName Nested flags 9 + innerclass innerClass nonapi/Impl$Nested$Exp outerClass nonapi/Impl$Nested innerClassName Exp flags 9 + field name C descriptor Ljava/lang/String; constantValue flags 19 + method name descriptor ()V flags 1 + method name test descriptor ()V flags 1 + + class name nonapi/Impl$Nested + header extends java/lang/Object nestHost nonapi/Impl flags 21 classAnnotations @Lapi/Ann; + innerclass innerClass nonapi/Impl$Nested outerClass nonapi/Impl innerClassName Nested flags 9 + innerclass innerClass nonapi/Impl$Nested$Exp outerClass nonapi/Impl$Nested innerClassName Exp flags 9 + method name descriptor ()V flags 1 + + class name nonapi/Impl$Nested$Exp + header extends nonapi/Impl$Nested implements java/lang/Runnable nestHost nonapi/Impl flags 21 + innerclass innerClass nonapi/Impl$Nested outerClass nonapi/Impl innerClassName Nested flags 9 + innerclass innerClass nonapi/Impl$Nested$Exp outerClass nonapi/Impl$Nested innerClassName Exp flags 9 + method name descriptor ()V flags 1 + method name run descriptor ()V flags 1 + method name get descriptor ()Lnonapi/Impl$OtherNested; flags 1 + + """, + """ + module m { + exports api; + exports nonapi to java.base; + } + """, + """ + package api; + import nonapi.Impl; + public class Api extends Impl.Nested.Exp { + } + """, + """ + package api; + public @interface Ann { + } + """, + """ + package nonapi; + import api.Ann; + public class Impl { + public static final String C = ""; + public void test() {} + @Ann + public static class Nested { + public static class Exp extends Nested implements Runnable { + public void run() {} + public OtherNested get() { return null; } + } + } + public static class OtherNested {} + } + """); + } + + void doTestData(String data, + String... code) throws Exception { + String testClasses = System.getProperty("test.classes"); + Path output = Paths.get(testClasses, "test-data" + i++); + deleteRecursively(output); + Files.createDirectories(output); + Path ver9Jar = output.resolve("9.jar"); + compileAndPack(output, + ver9Jar, + code); + + Path ctSym = output.resolve("ct.sym"); + + deleteRecursively(ctSym); + + CreateSymbols.ALLOW_NON_EXISTING_CLASSES = true; + CreateSymbols.DO_NOT_MODIFY = ""; + CreateSymbols.EXTENSION = ".class"; + CreateSymbols.INJECTED_VERSION = "0"; + + deleteRecursively(ctSym); + + List versions = + Arrays.asList(new VersionDescription(ver9Jar.toAbsolutePath().toString(), "9", null)); + + ExcludeIncludeList acceptAll = new ExcludeIncludeList(null, null) { + @Override public boolean accepts(String className, boolean includePrivateClasses) { + return true; + } + }; + new CreateSymbols().createBaseLine(versions, acceptAll, ctSym, new String[0]); + + Path symFile = null; + + try (DirectoryStream ds = Files.newDirectoryStream(ctSym)) { + for (Path p : ds) { + if (p.toString().endsWith(".sym.txt")) { + if (symFile != null) { + throw new IllegalStateException("Multiple sym files!"); + } else { + symFile = p; + } + } + } + } + String acutalContent = new String(Files.readAllBytes(symFile), StandardCharsets.UTF_8); + if (!acutalContent.equals(data)) { + throw new AssertionError("out=" + acutalContent + "; expected=" + data); + } + } + void doTestIncluded(String code, String... includedClasses) throws Exception { boolean oldIncludeAll = includeAll; try { @@ -712,7 +1026,7 @@ public class CreateSymbolsTestImpl { new VersionDescription(jar8.toAbsolutePath().toString(), "8", "7")); ExcludeIncludeList acceptAll = new ExcludeIncludeList(null, null) { - @Override public boolean accepts(String className) { + @Override public boolean accepts(String className, boolean includePrivateClasses) { return true; } }; @@ -743,6 +1057,36 @@ public class CreateSymbolsTestImpl { System.err.println(Arrays.asList(code)); new JavacTask(tb).sources(code).options("-d", scratch.toAbsolutePath().toString()).run(Expect.SUCCESS); List classFiles = collectClassFile(scratch); + Path moduleInfo = scratch.resolve("module-info.class"); + if (Files.exists(moduleInfo)) { + Set packages = new HashSet<>(); + for (String cf : classFiles) { + int sep = cf.lastIndexOf(scratch.getFileSystem().getSeparator()); + if (sep != (-1)) { + packages.add(cf.substring(0, sep)); + } + } + ClassFile cf = ClassFile.read(moduleInfo); + List cp = new ArrayList<>(); + cp.add(null); + cf.constant_pool.entries().forEach(cp::add); + Map attrs = new HashMap<>(cf.attributes.map); + int[] encodedPackages = new int[packages.size()]; + int i = 0; + for (String p : packages) { + int nameIndex = cp.size(); + cp.add(new CONSTANT_Utf8_info(p)); + encodedPackages[i++] = cp.size(); + cp.add(new ConstantPool.CONSTANT_Package_info(null, nameIndex)); + } + int attrName = cp.size(); + cp.add(new CONSTANT_Utf8_info(Attribute.ModulePackages)); + attrs.put(Attribute.ModulePackages, new ModulePackages_attribute(attrName, encodedPackages)); + ClassFile newFile = new ClassFile(cf.magic, cf.minor_version, cf.major_version, new ConstantPool(cp.toArray(new CPInfo[0])), cf.access_flags, cf.this_class, cf.super_class, cf.interfaces, cf.fields, cf.methods, new Attributes(attrs)); + try (OutputStream out = Files.newOutputStream(moduleInfo)) { + new ClassWriter().write(newFile, out); + } + } try (Writer out = Files.newBufferedWriter(outputFile)) { for (String classFile : classFiles) { try (InputStream in = Files.newInputStream(scratch.resolve(classFile))) { -- GitLab From fb11d8faf21539a8dc08d371658d1835484c8344 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Wed, 8 Dec 2021 19:48:05 +0000 Subject: [PATCH 685/890] 8272945: Use snippets in java.compiler documentation Reviewed-by: erikj, alanb --- make/CompileInterimLangtools.gmk | 2 +- make/modules/java.compiler/Java.gmk | 2 + .../classes/javax/tools/JavaCompiler.java | 64 +++++++------------ .../classes/javax/tools/JavaFileManager.java | 26 +++++--- .../javax/tools/StandardJavaFileManager.java | 32 +++++----- .../classes/javax/tools/package-info.java | 14 ++-- .../snippet-files/JavaSourceFromString.java | 54 ++++++++++++++++ 7 files changed, 122 insertions(+), 72 deletions(-) create mode 100644 src/java.compiler/share/classes/javax/tools/snippet-files/JavaSourceFromString.java diff --git a/make/CompileInterimLangtools.gmk b/make/CompileInterimLangtools.gmk index a6a42f6a9cd..3fff64db1f8 100644 --- a/make/CompileInterimLangtools.gmk +++ b/make/CompileInterimLangtools.gmk @@ -71,7 +71,7 @@ define SetupInterimModule SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \ $$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \ $(TOPDIR)/src/$1/share/classes, \ - EXCLUDES := sun, \ + EXCLUDES := sun javax/tools/snippet-files, \ EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \ Standard.java, \ EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \ diff --git a/make/modules/java.compiler/Java.gmk b/make/modules/java.compiler/Java.gmk index e124e8844d3..e2d5ac264b8 100644 --- a/make/modules/java.compiler/Java.gmk +++ b/make/modules/java.compiler/Java.gmk @@ -25,3 +25,5 @@ DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:java.*,javax.*' + +EXCLUDES += javax/tools/snippet-files diff --git a/src/java.compiler/share/classes/javax/tools/JavaCompiler.java b/src/java.compiler/share/classes/javax/tools/JavaCompiler.java index f7c1c61a41b..9039490524b 100644 --- a/src/java.compiler/share/classes/javax/tools/JavaCompiler.java +++ b/src/java.compiler/share/classes/javax/tools/JavaCompiler.java @@ -26,6 +26,7 @@ package javax.tools; import java.io.Writer; +import java.net.URI; import java.nio.charset.Charset; import java.util.Locale; import java.util.concurrent.Callable; @@ -106,42 +107,45 @@ import javax.annotation.processing.Processor; * work with multiple sequential compilations making the following * example a recommended coding pattern: * - *

      - *       File[] files1 = ... ; // input for first compilation task
      - *       File[] files2 = ... ; // input for second compilation task
      + *     {@snippet id="use-sjfm" lang=java :
      + *       File[] files1 = null ; // input for first compilation task     // @replace substring=null replacement="..."
      + *       File[] files2 = null ; // input for second compilation task    // @replace substring=null replacement="..."
        *
        *       JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        *       StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
        *
      - *       {@code Iterable} compilationUnits1 =
      - *           fileManager.getJavaFileObjectsFromFiles({@linkplain java.util.Arrays#asList Arrays.asList}(files1));
      + *       Iterable compilationUnits1 =
      + *           fileManager.getJavaFileObjectsFromFiles(Arrays.asList(files1));  // @link substring=Arrays.asList target="java.util.Arrays#asList"
        *       compiler.getTask(null, fileManager, null, null, null, compilationUnits1).call();
        *
      - *       {@code Iterable} compilationUnits2 =
      + *       Iterable compilationUnits2 =
        *           fileManager.getJavaFileObjects(files2); // use alternative method
        *       // reuse the same file manager to allow caching of jar files
        *       compiler.getTask(null, fileManager, null, null, null, compilationUnits2).call();
        *
      - *       fileManager.close();
      + * fileManager.close(); + * } * * * *
      {@link DiagnosticCollector}
      *
      * Used to collect diagnostics in a list, for example: - *
      - *       {@code Iterable} compilationUnits = ...;
      + *     {@snippet id="use-diag-collector" lang=java :
      + *       Iterable compilationUnits = null;        // @replace substring=null replacement="..."
        *       JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
      - *       {@code DiagnosticCollector diagnostics = new DiagnosticCollector();}
      + *       DiagnosticCollector diagnostics = new DiagnosticCollector();
        *       StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
        *       compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits).call();
        *
      - *       for ({@code Diagnostic} diagnostic : diagnostics.getDiagnostics())
      + *       for (Diagnostic diagnostic : diagnostics.getDiagnostics()) {
        *           System.out.format("Error on line %d in %s%n",
        *                             diagnostic.getLineNumber(),
        *                             diagnostic.getSource().toUri());
      + *       }
        *
      - *       fileManager.close();
      + * fileManager.close(); + * } *
      * *
      @@ -158,9 +162,9 @@ import javax.annotation.processing.Processor; * allowing customizing behavior. For example, consider how to * log all calls to {@linkplain JavaFileManager#flush}: * - *
      - *       final  Logger logger = ...;
      - *       {@code Iterable} compilationUnits = ...;
      + *     {@snippet id="forward-fm" lang=java :
      + *       final  Logger logger = null;                                       // @replace substring=null replacement="..."
      + *       Iterable compilationUnits = null;        // @replace substring=null replacement="..."
        *       JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        *       StandardJavaFileManager stdFileManager = compiler.getStandardFileManager(null, null, null);
        *       JavaFileManager fileManager = new ForwardingJavaFileManager(stdFileManager) {
      @@ -170,7 +174,8 @@ import javax.annotation.processing.Processor;
        *               logger.exiting(StandardJavaFileManager.class.getName(), "flush");
        *           }
        *       };
      - *       compiler.getTask(null, fileManager, null, null, null, compilationUnits).call();
      + * compiler.getTask(null, fileManager, null, null, null, compilationUnits).call(); + * } * * *
      {@link SimpleJavaFileObject}
      @@ -181,32 +186,7 @@ import javax.annotation.processing.Processor; * example, here is how to define a file object which represent * source code stored in a string: * - *
      - *       /**
      - *        * A file object used to represent source coming from a string.
      - *        {@code *}/
      - *       public class JavaSourceFromString extends SimpleJavaFileObject {
      - *           /**
      - *            * The source code of this "file".
      - *            {@code *}/
      - *           final String code;
      - *
      - *           /**
      - *            * Constructs a new JavaSourceFromString.
      - *            * {@code @}param name the name of the compilation unit represented by this file object
      - *            * {@code @}param code the source code for the compilation unit represented by this file object
      - *            {@code *}/
      - *           JavaSourceFromString(String name, String code) {
      - *               super({@linkplain java.net.URI#create URI.create}("string:///" + name.replace('.','/') + Kind.SOURCE.extension),
      - *                     Kind.SOURCE);
      - *               this.code = code;
      - *           }
      - *
      - *           {@code @}Override
      - *           public CharSequence getCharContent(boolean ignoreEncodingErrors) {
      - *               return code;
      - *           }
      - *       }
      + * {@snippet id=fileObject class=JavaSourceFromString } * * * diff --git a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java index af926147845..20178303b2f 100644 --- a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java @@ -28,6 +28,7 @@ package javax.tools; import java.io.Closeable; import java.io.Flushable; import java.io.IOException; +import java.net.URI; import java.util.Iterator; import java.util.ServiceLoader; import java.util.Set; @@ -80,8 +81,10 @@ import static javax.tools.JavaFileObject.Kind; * href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986, * section 3.3. Informally, this should be true: * - * - *
        URI.{@linkplain java.net.URI#create create}(relativeName).{@linkplain java.net.URI#normalize() normalize}().{@linkplain java.net.URI#getPath getPath}().equals(relativeName)
      + * {@snippet id="valid-relative-name" lang=java : + * // @link substring="create" target="URI#create" : @link substring=normalize target="URI#normalize" : @link substring=getPath target="URI#getPath" : + * URI.create(relativeName).normalize().getPath().equals(relativeName) + * } * *

      All methods in this interface might throw a SecurityException. * @@ -403,7 +406,9 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker { * StandardLocation#SOURCE_PATH SOURCE_PATH} location, this method * might be called like so: * - *

      getFileForInput(SOURCE_PATH, "com.sun.tools.javac", "resources/compiler.properties");
      + * {@snippet id="call-getFileForInput" lang=java : + * getFileForInput(SOURCE_PATH, "com.sun.tools.javac", "resources/compiler.properties"); + * } * *

      If the call was executed on Windows, with SOURCE_PATH set to * "C:\Documents and Settings\UncleBob\src\share\classes", @@ -666,16 +671,17 @@ public interface JavaFileManager extends Closeable, Flushable, OptionChecker { *

      For a package-oriented location, a file object is contained in the location if there exist * values for packageName and relativeName such that either of the following * calls would return the {@link #isSameFile same} file object: - *

      -     *     getFileForInput(location, packageName, relativeName)
      -     *     getFileForOutput(location, packageName, relativeName, null)
      -     * 
      + * {@snippet : + * // @highlight region substring=packageName type=italic @highlight region substring=relativeName type=italic : + * getFileForInput(location, packageName, relativeName) + * getFileForOutput(location, packageName, relativeName, null) // @end @end + * } * *

      For a module-oriented location, a file object is contained in the location if there exists * a module that may be obtained by the call: - *

      -     *     getLocationForModule(location, moduleName)
      -     * 
      + * {@snippet id="call-getLocationForModule" lang=java : + * getLocationForModule(location, moduleName) // @highlight substring=moduleName type=italic + * } * such that the file object is contained in the (package-oriented) location for that module. * * @implSpec This implementation throws {@code UnsupportedOperationException}. diff --git a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java index 5b6590bf926..936cb0aeacc 100644 --- a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java @@ -75,9 +75,10 @@ import java.util.List; * {@linkplain FileObject#openReader(boolean)} * must succeed if the following would succeed (ignoring * encoding issues): - *
      - *
      new {@linkplain java.io.FileInputStream#FileInputStream(File) FileInputStream}(new {@linkplain File#File(java.net.URI) File}({@linkplain FileObject fileObject}.{@linkplain FileObject#toUri() toUri}()))
      - *
      + * {@snippet id="equiv-input" lang=java : + * // @link substring=FileInputStream target="java.io.FileInputStream#FileInputStream(File)" : @link regex="File\W" target="File#File(java.net.URI)" : @link substring=fileObject target=FileObject : @link substring=toURI target="FileObject#toUri()" : + * new FileInputStream(new File(fileObject.toURI())) + * } * *
    • * and the methods @@ -85,9 +86,10 @@ import java.util.List; * {@linkplain FileObject#openWriter()} must * succeed if the following would succeed (ignoring encoding * issues): - *
      - *
      new {@linkplain java.io.FileOutputStream#FileOutputStream(File) FileOutputStream}(new {@linkplain File#File(java.net.URI) File}({@linkplain FileObject fileObject}.{@linkplain FileObject#toUri() toUri}()))
      - *
      + * {@snippet id="equiv-output" lang=java : + * // @link substring=FileOutputStream target="java.io.FileOutputStream#FileOutputStream(File)" : @link regex="File\W" target="File#File(java.net.URI)" : @link substring=fileObject target=FileObject : @link substring=toURI target="FileObject#toUri()" : + * new FileOutputStream(new File(fileObject.toURI())) + * } *
    • * * @@ -241,9 +243,9 @@ public interface StandardJavaFileManager extends JavaFileManager { * Returns file objects representing the given files. * Convenience method equivalent to: * - *
      -     *     getJavaFileObjectsFromFiles({@linkplain java.util.Arrays#asList Arrays.asList}(files))
      -     * 
      + * {@snippet id="equiv-getJavaFileObjects" lang=java : + * getJavaFileObjectsFromFiles(Arrays.asList(files)) // @link substring="Arrays.asList" target="Arrays#asList" + * } * * @param files an array of files * @return a list of file objects @@ -259,9 +261,9 @@ public interface StandardJavaFileManager extends JavaFileManager { * Returns file objects representing the given paths. * Convenience method equivalent to: * - *
      -     *     getJavaFileObjectsFromPaths({@linkplain java.util.Arrays#asList Arrays.asList}(paths))
      -     * 
      + * {@snippet id="equiv-getJavaFileObjectsFromPaths" lang=java : + * getJavaFileObjectsFromPaths(Arrays.asList(paths)) // @link substring="Arrays.asList" target="Arrays#asList" + * } * * @implSpec * The default implementation will only throw {@code NullPointerException} @@ -296,9 +298,9 @@ public interface StandardJavaFileManager extends JavaFileManager { * Returns file objects representing the given file names. * Convenience method equivalent to: * - *
      -     *     getJavaFileObjectsFromStrings({@linkplain java.util.Arrays#asList Arrays.asList}(names))
      -     * 
      + * {@snippet id="equiv-getJavaFileObjectsFromStrings" lang=java : + * getJavaFileObjectsFromStrings(Arrays.asList(names)) // @link substring="Arrays.asList" target="Arrays#asList" + * } * * @param names a list of file names * @return a list of file objects diff --git a/src/java.compiler/share/classes/javax/tools/package-info.java b/src/java.compiler/share/classes/javax/tools/package-info.java index c5ec54e7871..963e6f2261c 100644 --- a/src/java.compiler/share/classes/javax/tools/package-info.java +++ b/src/java.compiler/share/classes/javax/tools/package-info.java @@ -52,7 +52,9 @@ * a default compiler is provided, it can be located using the * {@link javax.tools.ToolProvider}, for example: * - *

      {@code JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();} + * {@snippet id="show-getSystemJavaCompiler" lang=java : + * JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + * } * *

      It is possible to provide alternative compilers or tools * through the {@linkplain java.util.ServiceLoader service provider @@ -64,12 +66,16 @@ * META-INF/services/javax.tools.JavaCompiler}. This file would * contain the single line: * - *

      {@code com.vendor.VendorJavaCompiler} + * {@snippet id="show-service" : + * com.vendor.VendorJavaCompiler + * } * - *

      If the jar file is on the class path, VendorJavaCompiler can be + *

      If the jar file is on the class path, {@code VendorJavaCompiler} can be * located using code like this: * - *

      {@code JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next();} + * {@snippet id="show-serviceLoader" lang=java : + * JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next(); + * } * * @author Peter von der Ahé * @author Jonathan Gibbons diff --git a/src/java.compiler/share/classes/javax/tools/snippet-files/JavaSourceFromString.java b/src/java.compiler/share/classes/javax/tools/snippet-files/JavaSourceFromString.java new file mode 100644 index 00000000000..f0555a02e9e --- /dev/null +++ b/src/java.compiler/share/classes/javax/tools/snippet-files/JavaSourceFromString.java @@ -0,0 +1,54 @@ +// @replace region replacement="" +/* + * Copyright (c) 2021, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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 javax.tools.SimpleJavaFileObject; +import java.net.URI; +// @end +/** + * A file object used to represent source coming from a string. + */ +public class JavaSourceFromString extends SimpleJavaFileObject { + /** + * The source code of this "file". + */ + final String code; + + /** + * Constructs a new JavaSourceFromString. + * @param name the name of the compilation unit represented by this file object + * @param code the source code for the compilation unit represented by this file object + */ + JavaSourceFromString(String name, String code) { + super(URI.create("string:///" + name.replace('.','/') + Kind.SOURCE.extension), // @link substring="URI.create" target="URI#create(String)" + Kind.SOURCE); + this.code = code; + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return code; + } +} -- GitLab From 5a80abf706dfde9342be53e78b942ff40f9624ea Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Wed, 8 Dec 2021 19:50:14 +0000 Subject: [PATCH 686/890] 8272944: Use snippets in jdk.javadoc documentation Reviewed-by: hannesw --- .../sun/tools/javac/model/JavacElements.java | 6 + .../jdk/javadoc/doclet/package-info.java | 255 ++++++++++-------- 2 files changed, 147 insertions(+), 114 deletions(-) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java index a1ae6c543a9..ed909c8b80f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java @@ -757,6 +757,12 @@ public class JavacElements implements Elements { */ private Pair getTreeAndTopLevel(Element e) { Symbol sym = cast(Symbol.class, e); + if (sym.kind == PCK) { + TypeSymbol pkgInfo = ((PackageSymbol) sym).package_info; + if (pkgInfo != null) { + pkgInfo.complete(); + } + } Env enterEnv = getEnterEnv(sym); if (enterEnv == null) return null; diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java index 2e895024b93..3658ed74d85 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -51,9 +51,9 @@ * The invocation is defined by the interface {@link jdk.javadoc.doclet.Doclet} * -- the {@link jdk.javadoc.doclet.Doclet#run(DocletEnvironment) run} interface * method, defines the entry point. - *

      - *    public boolean run(DocletEnvironment environment)
      - * 
      + * {@snippet id="entry-point" lang=java : + * public boolean run(DocletEnvironment environment) // @highlight substring="run" + * } * The {@link jdk.javadoc.doclet.DocletEnvironment} instance holds the * environment that the doclet will be initialized with. From this environment * all other information can be extracted, in the form of @@ -185,120 +185,147 @@ * * The following is an example doclet that displays information of a class * and its members, supporting an option. - *
      - * // note imports deleted for clarity
      + *
      + * {@snippet lang=java id="Example.java" :
      + * // @replace region=imports replacement=" // Note: imports deleted for clarity"
      + * import com.sun.source.doctree.DocCommentTree;
      + * import com.sun.source.util.DocTrees;
      + * import jdk.javadoc.doclet.Doclet;
      + * import jdk.javadoc.doclet.DocletEnvironment;
      + * import jdk.javadoc.doclet.Reporter;
      + *
      + * import javax.lang.model.SourceVersion;
      + * import javax.lang.model.element.Element;
      + * import javax.lang.model.element.TypeElement;
      + * import javax.lang.model.util.ElementFilter;
      + * import javax.tools.Diagnostic.Kind;
      + * import java.io.IOException;
      + * import java.io.PrintWriter;
      + * import java.util.List;
      + * import java.util.Locale;
      + * import java.util.Set;
      + * // @end
      + *
      + *
        * public class Example implements Doclet {
      - *    Reporter reporter;
      - *    @Override
      - *    public void init(Locale locale, Reporter reporter) {
      - *        reporter.print(Kind.NOTE, "Doclet using locale: " + locale);
      - *        this.reporter = reporter;
      - *    }
      - *
      - *    public void printElement(DocTrees trees, Element e) {
      - *        DocCommentTree docCommentTree = trees.getDocCommentTree(e);
      - *        if (docCommentTree != null) {
      - *            System.out.println("Element (" + e.getKind() + ": "
      - *                    + e + ") has the following comments:");
      - *            System.out.println("Entire body: " + docCommentTree.getFullBody());
      - *            System.out.println("Block tags: " + docCommentTree.getBlockTags());
      - *        }
      - *    }
      - *
      - *    @Override
      - *    public boolean run(DocletEnvironment docEnv) {
      - *        reporter.print(Kind.NOTE, "overviewfile: " + overviewfile);
      - *        // get the DocTrees utility class to access document comments
      - *        DocTrees docTrees = docEnv.getDocTrees();
      - *
      - *        // location of an element in the same directory as overview.html
      - *        try {
      - *            Element e = ElementFilter.typesIn(docEnv.getSpecifiedElements()).iterator().next();
      - *            DocCommentTree docCommentTree
      - *                    = docTrees.getDocCommentTree(e, overviewfile);
      - *            if (docCommentTree != null) {
      - *                System.out.println("Overview html: " + docCommentTree.getFullBody());
      - *            }
      - *        } catch (IOException missing) {
      - *            reporter.print(Kind.ERROR, "No overview.html found.");
      - *        }
      - *
      - *        for (TypeElement t : ElementFilter.typesIn(docEnv.getIncludedElements())) {
      - *            System.out.println(t.getKind() + ":" + t);
      - *            for (Element e : t.getEnclosedElements()) {
      - *                printElement(docTrees, e);
      - *            }
      - *        }
      - *        return true;
      - *    }
      - *
      - *    @Override
      - *    public String getName() {
      - *        return "Example";
      - *    }
      - *
      - *    private String overviewfile;
      - *
      - *    @Override
      - *    public Set<? extends Option> getSupportedOptions() {
      - *        Option[] options = {
      - *            new Option() {
      - *                private final List<String> someOption = Arrays.asList(
      - *                        "-overviewfile",
      - *                        "--overview-file",
      - *                        "-o"
      - *                );
      - *
      - *                @Override
      - *                public int getArgumentCount() {
      - *                    return 1;
      - *                }
      - *
      - *                @Override
      - *                public String getDescription() {
      - *                    return "an option with aliases";
      - *                }
      - *
      - *                @Override
      - *                public Option.Kind getKind() {
      - *                    return Option.Kind.STANDARD;
      - *                }
      - *
      - *                @Override
      - *                public List<String> getNames() {
      - *                    return someOption;
      - *                }
      - *
      - *                @Override
      - *                public String getParameters() {
      - *                    return "file";
      - *                }
      - *
      - *                @Override
      - *                public boolean process(String opt, List<String> arguments) {
      - *                    overviewfile = arguments.get(0);
      - *                    return true;
      - *                }
      - *            }
      - *        };
      - *        return new HashSet<>(Arrays.asList(options));
      - *    }
      - *
      - *    @Override
      - *    public SourceVersion getSupportedSourceVersion() {
      - *        // support the latest release
      - *        return SourceVersion.latest();
      - *    }
      + *     private Reporter reporter;
      + *     private PrintWriter stdout;
      + *
      + *     @Override
      + *     public void init(Locale locale, Reporter reporter) {
      + *         reporter.print(Kind.NOTE, "Doclet using locale: " + locale);
      + *         this.reporter = reporter;
      + *         stdout = reporter.getStandardWriter();
      + *     }
      + *
      + *     public void printElement(DocTrees trees, Element e) {
      + *         DocCommentTree docCommentTree = trees.getDocCommentTree(e);
      + *         if (docCommentTree != null) {
      + *             stdout.println("Element (" + e.getKind() + ": "
      + *                     + e + ") has the following comments:");
      + *             stdout.println("Entire body: " + docCommentTree.getFullBody());
      + *             stdout.println("Block tags: " + docCommentTree.getBlockTags());
      + *         }
      + *     }
      + *
      + *     @Override
      + *     public boolean run(DocletEnvironment docEnv) {
      + *         reporter.print(Kind.NOTE, "overviewFile: " + overviewFile);
      + *
      + *         // get the DocTrees utility class to access document comments
      + *         DocTrees docTrees = docEnv.getDocTrees();
      + *
      + *         // location of an element in the same directory as overview.html
      + *         try {
      + *             Element e = ElementFilter.typesIn(docEnv.getSpecifiedElements()).iterator().next();
      + *             DocCommentTree docCommentTree
      + *                     = docTrees.getDocCommentTree(e, overviewFile);
      + *             if (docCommentTree != null) {
      + *                 stdout.println("Overview html: " + docCommentTree.getFullBody());
      + *             }
      + *         } catch (IOException missing) {
      + *             reporter.print(Kind.ERROR, "No overview.html found.");
      + *         }
      + *
      + *         for (TypeElement t : ElementFilter.typesIn(docEnv.getIncludedElements())) {
      + *             stdout.println(t.getKind() + ":" + t);
      + *             for (Element e : t.getEnclosedElements()) {
      + *                 printElement(docTrees, e);
      + *             }
      + *         }
      + *         return true;
      + *     }
      + *
      + *     @Override
      + *     public String getName() {
      + *         return "Example";
      + *     }
      + *
      + *     private String overviewFile;
      + *
      + *     @Override
      + *     public Set getSupportedOptions() {
      + *         Option[] options = {
      + *             new Option() {
      + *                 private final List someOption = List.of(
      + *                         "--overview-file",
      + *                         "-overviewfile",
      + *                         "-o"
      + *                 );
      + *
      + *                 @Override
      + *                 public int getArgumentCount() {
      + *                     return 1;
      + *                 }
      + *
      + *                 @Override
      + *                 public String getDescription() {
      + *                     return "an option with aliases";
      + *                 }
      + *
      + *                 @Override
      + *                 public Option.Kind getKind() {
      + *                     return Option.Kind.STANDARD;
      + *                 }
      + *
      + *                 @Override
      + *                 public List getNames() {
      + *                     return someOption;
      + *                 }
      + *
      + *                 @Override
      + *                 public String getParameters() {
      + *                     return "file";
      + *                 }
      + *
      + *                 @Override
      + *                 public boolean process(String opt, List arguments) {
      + *                     overviewFile = arguments.get(0);
      + *                     return true;
      + *                 }
      + *             }
      + *         };
      + *
      + *         return Set.of(options);
      + *     }
      + *
      + *     @Override
      + *     public SourceVersion getSupportedSourceVersion() {
      + *         // support the latest release
      + *         return SourceVersion.latest();
      + *     }
      + * }
        * }
      - * 
      + * *

      * This doclet can be invoked with a command line, such as: - *

      - *     javadoc -doclet Example \
      - *       -overviewfile overview.html \
      - *       -sourcepath source-location \
      - *       source-location/Example.java
      - * 
      + * {@snippet id="run-doclet": + * javadoc -docletpath doclet-classes \ // @highlight substring="doclet-classes " type=italic + * -doclet Example \ + * --overview-file overview.html \ + * --source-path source-location \ // @highlight region substring="source-location" type=italic + * source-location/Example.java // @end + * } * *

      Migration Guide

      * -- GitLab From 8e8fadf2d4e45f53286dd8424d95f733a12cd1a0 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Wed, 8 Dec 2021 20:37:41 +0000 Subject: [PATCH 687/890] 8278428: ObjectInputStream.readFully range check incorrect Reviewed-by: alanb --- .../classes/java/io/ObjectInputStream.java | 2 +- .../Serializable/oldTests/WritePrimitive.java | 67 ++++++++++++------- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java index 5a0978ab382..1545db08385 100644 --- a/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -1204,7 +1204,7 @@ public class ObjectInputStream * @throws IOException If other I/O error has occurred. */ public void readFully(byte[] buf, int off, int len) throws IOException { - Objects.checkFromToIndex(off, len, buf.length); + Objects.checkFromIndexSize(off, len, buf.length); bin.readFully(buf, off, len, false); } diff --git a/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java b/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java index f2bd28d75f7..2846e7c8f8d 100644 --- a/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java +++ b/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java @@ -32,28 +32,27 @@ */ import java.io.*; +import java.util.Arrays; public class WritePrimitive { public static void main (String argv[]) throws IOException { System.err.println("\nRegression test for testing of " + "serialization/deserialization of primitives \n"); + int i = 123456; + byte b = 12; + short s = 45; + char c = 'A'; + long l = 1234567890000L; + float f = 3.14159f; + double d = f * 2; + boolean z = true; + String string = "The String"; + PrimitivesTest prim = new PrimitivesTest(); + byte[] ba = {1, 2, 3, 4, 5, 6, 7}; // byte array to write - FileInputStream istream = null; - FileOutputStream ostream = null; - try { - int i = 123456; - byte b = 12; - short s = 45; - char c = 'A'; - long l = 1234567890000L; - float f = 3.14159f; - double d = f*2; - boolean z = true; - String string = "The String"; - PrimitivesTest prim = new PrimitivesTest(); - - ostream = new FileOutputStream("piotest1.tmp"); - ObjectOutputStream p = new ObjectOutputStream(ostream); + byte[] bytes; + try (ByteArrayOutputStream ostream = new ByteArrayOutputStream(); + ObjectOutputStream p = new ObjectOutputStream(ostream)) { p.writeInt(i); p.writeByte(b); @@ -63,14 +62,20 @@ public class WritePrimitive { p.writeFloat(f); p.writeDouble(d); p.writeBoolean(z); + p.write(ba); // for simple read(byte[]) + p.write(ba); // for readFully(byte[]) + p.write(ba, 0, ba.length - 2); // for readFully(byte[], 0, 7) p.writeUTF(string); p.writeObject(string); p.writeObject(prim); p.flush(); + bytes = ostream.toByteArray(); + + } - istream = new FileInputStream("piotest1.tmp"); - ObjectInputStream q = new ObjectInputStream(istream); + ByteArrayInputStream istream = new ByteArrayInputStream(bytes); + try (ObjectInputStream q = new ObjectInputStream(istream);) { int i_u = q.readInt(); byte b_u = q.readByte(); @@ -80,6 +85,12 @@ public class WritePrimitive { float f_u = q.readFloat(); double d_u = q.readDouble(); boolean z_u = q.readBoolean(); + byte[] ba_readBuf = new byte[ba.length]; + int ba_readLen = q.read(ba_readBuf); + byte[] ba_readFullyBuf = new byte[ba.length]; + int ba_readFullyLen = q.read(ba_readFullyBuf); + byte[] ba_readFullySizedBuf = new byte[ba.length]; + int ba_readFullySizedLen = q.read(ba_readFullySizedBuf, 0, ba.length - 1); String string_utf = q.readUTF(); String string_u = (String)q.readObject(); if (i != i_u) { @@ -120,6 +131,10 @@ public class WritePrimitive { z_u); throw new Error(); } + checkArray("read(byte[])", ba, ba.length, ba_readBuf, ba_readLen); + checkArray("readFully(byte[])", ba, ba.length, ba_readFullyBuf, ba_readFullyLen); + checkArray("readFully(byte[], off, len)", ba, ba.length - 2, ba_readFullySizedBuf, ba_readFullySizedLen); + if (!string.equals(string_utf)) { System.err.println("\nString: expected " + string + " actual " + string_utf); @@ -144,20 +159,26 @@ public class WritePrimitive { System.err.print("TEST FAILED: "); e.printStackTrace(); - System.err.println("\nInput remaining"); + System.err.println("\nBytes read: " + (bytes.length - istream.available()) + + ", Input remaining: " + istream.available()); int ch; try { while ((ch = istream.read()) != -1) { System.err.print("\n " + Integer.toString(ch, 16)+ " "); } System.out.println("\n "); - } catch (Exception f) { + } catch (Exception fex) { throw new Error(); } throw new Error(); - } finally { - if (istream != null) istream.close(); - if (ostream != null) ostream.close(); + } + } + + static void checkArray(String label, byte[] expected, int expectedLen, byte[] actual, int actualLen) { + int mismatch = Arrays.mismatch(expected, 0, expectedLen, actual, 0, actualLen); + if (actualLen != expectedLen || mismatch >= 0) { + System.err.println("\n" + label + ": expected " + expectedLen + " actual " + actualLen + ", mismatch: " + mismatch); + throw new Error(); } } } -- GitLab From c83b781b6002ca0f067a35e678ab5285d98d015d Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Wed, 8 Dec 2021 20:42:52 +0000 Subject: [PATCH 688/890] 8278459: ProblemList javax/swing/JTree/4908142/bug4908142.java on macosx-aarch64 Reviewed-by: lmesnik, bpb, prr --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index a48fe6af429..2bdcb6708b4 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -748,6 +748,7 @@ javax/swing/JMenu/4515762/bug4515762.java 8276074 macosx-all sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all sanity/client/SwingSet/src/ScrollPaneDemoTest.java 8225013 linux-all sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java 8265770 macosx-all +javax/swing/JTree/4908142/bug4908142.java 8278348 macosx-aarch64 ############################################################################ -- GitLab From 6e7b7f352e66c767b16e1e98a162e7fea79126c6 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 8 Dec 2021 21:15:55 +0000 Subject: [PATCH 689/890] 8278251: Enable "missing-explicit-ctor" check in the jdk.unsupported.desktop module Reviewed-by: ihse, prr --- make/modules/jdk.unsupported.desktop/Java.gmk | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 make/modules/jdk.unsupported.desktop/Java.gmk diff --git a/make/modules/jdk.unsupported.desktop/Java.gmk b/make/modules/jdk.unsupported.desktop/Java.gmk deleted file mode 100644 index f892ebeb84c..00000000000 --- a/make/modules/jdk.unsupported.desktop/Java.gmk +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (c) 2020, 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# 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. -# - -DISABLED_WARNINGS_java += missing-explicit-ctor -- GitLab From fe2ae8e38bd8660cc637f13f425ccea17a11aa4f Mon Sep 17 00:00:00 2001 From: Eamonn McManus Date: Wed, 8 Dec 2021 21:24:43 +0000 Subject: [PATCH 690/890] 8276904: Optional.toString() is unnecessarily expensive Reviewed-by: rriggs, smarks --- src/java.base/share/classes/java/util/Optional.java | 2 +- src/java.base/share/classes/java/util/OptionalDouble.java | 2 +- src/java.base/share/classes/java/util/OptionalInt.java | 2 +- src/java.base/share/classes/java/util/OptionalLong.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java.base/share/classes/java/util/Optional.java b/src/java.base/share/classes/java/util/Optional.java index 64647ee49d5..cd8b2b6048f 100644 --- a/src/java.base/share/classes/java/util/Optional.java +++ b/src/java.base/share/classes/java/util/Optional.java @@ -454,7 +454,7 @@ public final class Optional { @Override public String toString() { return value != null - ? String.format("Optional[%s]", value) + ? ("Optional[" + value + "]") : "Optional.empty"; } } diff --git a/src/java.base/share/classes/java/util/OptionalDouble.java b/src/java.base/share/classes/java/util/OptionalDouble.java index 61e54cfec29..752aaac1e54 100644 --- a/src/java.base/share/classes/java/util/OptionalDouble.java +++ b/src/java.base/share/classes/java/util/OptionalDouble.java @@ -328,7 +328,7 @@ public final class OptionalDouble { @Override public String toString() { return isPresent - ? String.format("OptionalDouble[%s]", value) + ? ("OptionalDouble[" + value + "]") : "OptionalDouble.empty"; } } diff --git a/src/java.base/share/classes/java/util/OptionalInt.java b/src/java.base/share/classes/java/util/OptionalInt.java index d693a3ddba2..c1e62090c25 100644 --- a/src/java.base/share/classes/java/util/OptionalInt.java +++ b/src/java.base/share/classes/java/util/OptionalInt.java @@ -326,7 +326,7 @@ public final class OptionalInt { @Override public String toString() { return isPresent - ? String.format("OptionalInt[%s]", value) + ? ("OptionalInt[" + value + "]") : "OptionalInt.empty"; } } diff --git a/src/java.base/share/classes/java/util/OptionalLong.java b/src/java.base/share/classes/java/util/OptionalLong.java index f92c5bdff17..2c1171f86e9 100644 --- a/src/java.base/share/classes/java/util/OptionalLong.java +++ b/src/java.base/share/classes/java/util/OptionalLong.java @@ -326,7 +326,7 @@ public final class OptionalLong { @Override public String toString() { return isPresent - ? String.format("OptionalLong[%s]", value) + ? ("OptionalLong[" + value + "]") : "OptionalLong.empty"; } } -- GitLab From b3faecf73966ce0435644a89f8f43d85720e8328 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 8 Dec 2021 21:33:33 +0000 Subject: [PATCH 691/890] 8276116: C2: optimize long range checks in int counted loops Reviewed-by: kvn --- src/hotspot/cpu/x86/x86_32.ad | 18 ++ src/hotspot/share/opto/compile.cpp | 2 +- src/hotspot/share/opto/loopTransform.cpp | 63 ++-- src/hotspot/share/opto/loopnode.cpp | 257 ++++++++++++---- src/hotspot/share/opto/loopnode.hpp | 40 ++- src/hotspot/share/opto/loopopts.cpp | 2 +- .../c2/irTests/TestLongRangeChecks.java | 42 ++- .../rangechecks/TestLongRangeCheck.java | 286 +++++++++++++++++- 8 files changed, 610 insertions(+), 100 deletions(-) diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index 611206fa9fa..896064720ff 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -13130,6 +13130,24 @@ instruct cmovLL_mem_LTGE(cmpOp cmp, flagsReg_long_LTGE flags, eRegL dst, load_lo ins_pipe( pipe_cmov_reg_long ); %} +instruct cmovLL_reg_LTGE_U(cmpOpU cmp, flagsReg_ulong_LTGE flags, eRegL dst, eRegL src) %{ + match(Set dst (CMoveL (Binary cmp flags) (Binary dst src))); + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); + ins_cost(400); + expand %{ + cmovLL_reg_LTGE(cmp, flags, dst, src); + %} +%} + +instruct cmovLL_mem_LTGE_U(cmpOpU cmp, flagsReg_ulong_LTGE flags, eRegL dst, load_long_memory src) %{ + match(Set dst (CMoveL (Binary cmp flags) (Binary dst (LoadL src)))); + predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); + ins_cost(500); + expand %{ + cmovLL_mem_LTGE(cmp, flags, dst, src); + %} +%} + // Compare 2 longs and CMOVE ints. instruct cmovII_reg_LTGE(cmpOp cmp, flagsReg_long_LTGE flags, rRegI dst, rRegI src) %{ predicate(VM_Version::supports_cmov() && ( _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::lt || _kids[0]->_kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ge )); diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index b2f5dd55788..f980fe6e06c 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -3463,7 +3463,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f } break; case Op_Loop: - assert(!n->as_Loop()->is_transformed_long_inner_loop() || _loop_opts_cnt == 0, "should have been turned into a counted loop"); + assert(!n->as_Loop()->is_loop_nest_inner_loop() || _loop_opts_cnt == 0, "should have been turned into a counted loop"); case Op_CountedLoop: case Op_LongCountedLoop: case Op_OuterStripMinedLoop: diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 0b2b58c50b8..30562826eac 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -1065,7 +1065,7 @@ void IdealLoopTree::policy_unroll_slp_analysis(CountedLoopNode *cl, PhaseIdealLo // When TRUE, the estimated node budget is also requested. // // We will actually perform iteration-splitting, a more powerful form of RCE. -bool IdealLoopTree::policy_range_check(PhaseIdealLoop* phase, bool provisional) const { +bool IdealLoopTree::policy_range_check(PhaseIdealLoop* phase, bool provisional, BasicType bt) const { if (!provisional && !RangeCheckElimination) return false; // If nodes are depleted, some transform has miscalculated its needs. @@ -1087,7 +1087,7 @@ bool IdealLoopTree::policy_range_check(PhaseIdealLoop* phase, bool provisional) BaseCountedLoopNode* cl = _head->as_BaseCountedLoop(); Node *trip_counter = cl->phi(); - BasicType bt = cl->bt(); + assert(!cl->is_LongCountedLoop() || bt == T_LONG, "only long range checks in long counted loops"); // Check loop body for tests of trip-counter plus loop-invariant vs // loop-invariant. @@ -1135,7 +1135,7 @@ bool IdealLoopTree::policy_range_check(PhaseIdealLoop* phase, bool provisional) } } - if (!phase->is_scaled_iv_plus_offset(rc_exp, trip_counter, NULL, NULL)) { + if (!phase->is_scaled_iv_plus_offset(rc_exp, trip_counter, NULL, NULL, bt)) { continue; } } @@ -1145,7 +1145,9 @@ bool IdealLoopTree::policy_range_check(PhaseIdealLoop* phase, bool provisional) if (is_loop_exit(iff)) { // Found valid reason to split iterations (if there is room). // NOTE: Usually a gross overestimate. - return provisional || phase->may_require_nodes(est_loop_clone_sz(2)); + // Long range checks cause the loop to be transformed in a loop nest which only causes a fixed number of nodes + // to be added + return provisional || bt == T_LONG || phase->may_require_nodes(est_loop_clone_sz(2)); } } // End of is IF } @@ -2508,34 +2510,52 @@ void PhaseIdealLoop::add_constraint(jlong stride_con, jlong scale_con, Node* off } } +bool PhaseIdealLoop::is_iv(Node* exp, Node* iv, BasicType bt) { + if (exp == iv) { + return true; + } + + if (bt == T_LONG && iv->bottom_type()->isa_int() && exp->Opcode() == Op_ConvI2L && exp->in(1) == iv) { + return true; + } + return false; +} + //------------------------------is_scaled_iv--------------------------------- // Return true if exp is a constant times an induction var -bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType bt) { +bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType bt, bool* converted) { exp = exp->uncast(); assert(bt == T_INT || bt == T_LONG, "unexpected int type"); - if (exp == iv) { + if (is_iv(exp, iv, bt)) { if (p_scale != NULL) { *p_scale = 1; } return true; } + if (bt == T_LONG && iv->bottom_type()->isa_int() && exp->Opcode() == Op_ConvI2L) { + exp = exp->in(1); + bt = T_INT; + if (converted != NULL) { + *converted = true; + } + } int opc = exp->Opcode(); // Can't use is_Mul() here as it's true for AndI and AndL if (opc == Op_Mul(bt)) { - if (exp->in(1)->uncast() == iv && exp->in(2)->is_Con()) { + if (is_iv(exp->in(1)->uncast(), iv, bt) && exp->in(2)->is_Con()) { if (p_scale != NULL) { *p_scale = exp->in(2)->get_integer_as_long(bt); } return true; } - if (exp->in(2)->uncast() == iv && exp->in(1)->is_Con()) { + if (is_iv(exp->in(2)->uncast(), iv, bt) && exp->in(1)->is_Con()) { if (p_scale != NULL) { *p_scale = exp->in(1)->get_integer_as_long(bt); } return true; } } else if (opc == Op_LShift(bt)) { - if (exp->in(1)->uncast() == iv && exp->in(2)->is_Con()) { + if (is_iv(exp->in(1)->uncast(), iv, bt) && exp->in(2)->is_Con()) { if (p_scale != NULL) { jint shift_amount = exp->in(2)->get_int(); if (bt == T_INT) { @@ -2552,9 +2572,9 @@ bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType //-----------------------------is_scaled_iv_plus_offset------------------------------ // Return true if exp is a simple induction variable expression: k1*iv + (invar + k2) -bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scale, Node** p_offset, BasicType bt, int depth) { +bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scale, Node** p_offset, BasicType bt, bool* converted, int depth) { assert(bt == T_INT || bt == T_LONG, "unexpected int type"); - if (is_scaled_iv(exp, iv, p_scale, bt)) { + if (is_scaled_iv(exp, iv, p_scale, bt, converted)) { if (p_offset != NULL) { Node *zero = _igvn.integercon(0, bt); set_ctrl(zero, C->root()); @@ -2565,13 +2585,13 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scal exp = exp->uncast(); int opc = exp->Opcode(); if (opc == Op_Add(bt)) { - if (is_scaled_iv(exp->in(1), iv, p_scale, bt)) { + if (is_scaled_iv(exp->in(1), iv, p_scale, bt, converted)) { if (p_offset != NULL) { *p_offset = exp->in(2); } return true; } - if (is_scaled_iv(exp->in(2), iv, p_scale, bt)) { + if (is_scaled_iv(exp->in(2), iv, p_scale, bt, converted)) { if (p_offset != NULL) { *p_offset = exp->in(1); } @@ -2581,7 +2601,7 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scal Node* offset2 = NULL; if (depth < 2 && is_scaled_iv_plus_offset(exp->in(1), iv, p_scale, - p_offset != NULL ? &offset2 : NULL, bt, depth+1)) { + p_offset != NULL ? &offset2 : NULL, bt, converted, depth+1)) { if (p_offset != NULL) { Node *ctrl_off2 = get_ctrl(offset2); Node* offset = AddNode::make(offset2, exp->in(2), bt); @@ -2592,7 +2612,7 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scal } } } else if (opc == Op_Sub(bt)) { - if (is_scaled_iv(exp->in(1), iv, p_scale, bt)) { + if (is_scaled_iv(exp->in(1), iv, p_scale, bt, converted)) { if (p_offset != NULL) { Node *zero = _igvn.integercon(0, bt); set_ctrl(zero, C->root()); @@ -2603,7 +2623,7 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scal } return true; } - if (is_scaled_iv(exp->in(2), iv, p_scale, bt)) { + if (is_scaled_iv(exp->in(2), iv, p_scale, bt, converted)) { if (p_offset != NULL) { // We can't handle a scale of min_jint (or min_jlong) here as -1 * min_jint = min_jint if (*p_scale == min_signed_integer(bt)) { @@ -3432,6 +3452,8 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n } else if (policy_unswitching(phase)) { phase->do_unswitching(this, old_new); return false; // need to recalculate idom data + } else if (_head->is_LongCountedLoop()) { + phase->create_loop_nest(this, old_new); } return true; } @@ -3475,7 +3497,8 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n // unrolling), plus any needed for RCE purposes. bool should_unroll = policy_unroll(phase); - bool should_rce = policy_range_check(phase, false); + bool should_rce = policy_range_check(phase, false, T_INT); + bool should_rce_long = policy_range_check(phase, false, T_LONG); // If not RCE'ing (iteration splitting), then we do not need a pre-loop. // We may still need to peel an initial iteration but we will not @@ -3490,6 +3513,9 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n // peeling. if (should_rce || should_unroll) { if (cl->is_normal_loop()) { // Convert to 'pre/main/post' loops + if (should_rce_long && phase->create_loop_nest(this, old_new)) { + return true; + } uint estimate = est_loop_clone_sz(3); if (!phase->may_require_nodes(estimate)) { return false; @@ -3531,6 +3557,9 @@ bool IdealLoopTree::iteration_split_impl(PhaseIdealLoop *phase, Node_List &old_n phase->do_peeling(this, old_new); } } + if (should_rce_long) { + phase->create_loop_nest(this, old_new); + } } return true; } diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index 46e675ae239..c38e4829a23 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -525,10 +525,16 @@ static bool condition_stride_ok(BoolTest::mask bt, jlong stride_con) { return true; } -Node* PhaseIdealLoop::long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head) { - Node* iv_as_long = new ConvI2LNode(inner_iv, TypeLong::INT); - register_new_node(iv_as_long, inner_head); - Node* iv_replacement = new AddLNode(outer_phi, iv_as_long); +Node* PhaseIdealLoop::loop_nest_replace_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head, + BasicType bt) { + Node* iv_as_long; + if (bt == T_LONG) { + iv_as_long = new ConvI2LNode(inner_iv, TypeLong::INT); + register_new_node(iv_as_long, inner_head); + } else { + iv_as_long = inner_iv; + } + Node* iv_replacement = AddNode::make(outer_phi, iv_as_long, bt); register_new_node(iv_replacement, inner_head); for (DUIterator_Last imin, i = iv_to_replace->last_outs(imin); i >= imin;) { Node* u = iv_to_replace->last_out(i); @@ -762,25 +768,36 @@ SafePointNode* PhaseIdealLoop::find_safepoint(Node* back_control, Node* x, Ideal // continue; // else break; // } -bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List &old_new) { +// +// The same logic is used to transform an int counted loop that contains long range checks into a loop nest of 2 int +// loops with long range checks transformed to int range checks in the inner loop. +bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) { Node* x = loop->_head; // Only for inner loops - if (loop->_child != NULL || !x->is_LongCountedLoop() || x->as_Loop()->is_transformed_long_outer_loop()) { + if (loop->_child != NULL || !x->is_BaseCountedLoop() || x->as_Loop()->is_loop_nest_outer_loop()) { return false; } - check_long_counted_loop(loop, x); + if (x->is_CountedLoop() && !x->as_CountedLoop()->is_main_loop() && !x->as_CountedLoop()->is_normal_loop()) { + return false; + } + + BaseCountedLoopNode* head = x->as_BaseCountedLoop(); + BasicType bt = x->as_BaseCountedLoop()->bt(); - LongCountedLoopNode* head = x->as_LongCountedLoop(); + check_counted_loop_shape(loop, x, bt); #ifndef PRODUCT - Atomic::inc(&_long_loop_candidates); + if (bt == T_LONG) { + Atomic::inc(&_long_loop_candidates); + } #endif jlong stride_con = head->stride_con(); assert(stride_con != 0, "missed some peephole opt"); // We can't iterate for more than max int at a time. if (stride_con != (jint)stride_con) { + assert(bt == T_LONG, "only for long loops"); return false; } // The number of iterations for the integer count loop: guarantee no @@ -788,7 +805,7 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List // loop limit check if the exit test is <= or >=. int iters_limit = max_jint - ABS(stride_con) - 1; #ifdef ASSERT - if (StressLongCountedLoop > 0) { + if (bt == T_LONG && StressLongCountedLoop > 0) { iters_limit = iters_limit / StressLongCountedLoop; } #endif @@ -814,24 +831,38 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List } // May not have gone thru igvn yet so don't use _igvn.type(phi) (PhaseIdealLoop::is_counted_loop() sets the iv phi's type) - const TypeLong* phi_t = phi->bottom_type()->is_long(); - assert(phi_t->_hi >= phi_t->_lo, "dead phi?"); - iters_limit = (int)MIN2((julong)iters_limit, (julong)(phi_t->_hi - phi_t->_lo)); + const TypeInteger* phi_t = phi->bottom_type()->is_integer(bt); + assert(phi_t->hi_as_long() >= phi_t->lo_as_long(), "dead phi?"); + iters_limit = checked_cast(MIN2((julong)iters_limit, (julong)(phi_t->hi_as_long() - phi_t->lo_as_long()))); - LongCountedLoopEndNode* exit_test = head->loopexit(); - BoolTest::mask bt = exit_test->test_trip(); - - // We need a safepoint to insert empty predicates for the inner loop. - SafePointNode* safepoint = find_safepoint(back_control, x, loop); + IfNode* exit_test = head->loopexit(); + BoolTest::mask mask = exit_test->as_BaseCountedLoopEnd()->test_trip(); + Node* cmp = exit_test->as_BaseCountedLoopEnd()->cmp_node(); assert(back_control->Opcode() == Op_IfTrue, "wrong projection for back edge"); - Node* exit_branch = exit_test->proj_out(false); - Node* entry_control = x->in(LoopNode::EntryControl); - Node* cmp = exit_test->cmp_node(); Node_List range_checks; iters_limit = extract_long_range_checks(loop, stride_con, iters_limit, phi, range_checks); + if (bt == T_INT) { + // The only purpose of creating a loop nest is to handle long range checks. If there are none, do not proceed further. + if (range_checks.size() == 0) { + return false; + } + } + + // We need a safepoint to insert empty predicates for the inner loop. + SafePointNode* safepoint; + if (bt == T_INT && head->as_CountedLoop()->is_strip_mined()) { + // Loop is strip mined: use the safepoint of the outer strip mined loop + strip_mined_nest_back_to_counted_loop(loop, head, back_control, exit_test, safepoint); + } else { + safepoint = find_safepoint(back_control, x, loop); + } + + Node* exit_branch = exit_test->proj_out(false); + Node* entry_control = head->in(LoopNode::EntryControl); + // Clone the control flow of the loop to build an outer loop Node* outer_back_branch = back_control->clone(); Node* outer_exit_test = new IfNode(exit_test->in(0), exit_test->in(1), exit_test->_prob, exit_test->_fcnt); @@ -867,19 +898,24 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List Node* inner_iters_max = NULL; if (stride_con > 0) { - inner_iters_max = MaxNode::max_diff_with_zero(limit, outer_phi, TypeLong::LONG, _igvn); + inner_iters_max = MaxNode::max_diff_with_zero(limit, outer_phi, TypeInteger::bottom(bt), _igvn); } else { - inner_iters_max = MaxNode::max_diff_with_zero(outer_phi, limit, TypeLong::LONG, _igvn); + inner_iters_max = MaxNode::max_diff_with_zero(outer_phi, limit, TypeInteger::bottom(bt), _igvn); } - Node* inner_iters_limit = _igvn.longcon(iters_limit); + Node* inner_iters_limit = _igvn.integercon(iters_limit, bt); // inner_iters_max may not fit in a signed integer (iterating from // Long.MIN_VALUE to Long.MAX_VALUE for instance). Use an unsigned // min. - Node* inner_iters_actual = MaxNode::unsigned_min(inner_iters_max, inner_iters_limit, TypeLong::make(0, iters_limit, Type::WidenMin), _igvn); + Node* inner_iters_actual = MaxNode::unsigned_min(inner_iters_max, inner_iters_limit, TypeInteger::make(0, iters_limit, Type::WidenMin, bt), _igvn); - Node* inner_iters_actual_int = new ConvL2INode(inner_iters_actual); - _igvn.register_new_node_with_optimizer(inner_iters_actual_int); + Node* inner_iters_actual_int; + if (bt == T_LONG) { + inner_iters_actual_int = new ConvL2INode(inner_iters_actual); + _igvn.register_new_node_with_optimizer(inner_iters_actual_int); + } else { + inner_iters_actual_int = inner_iters_actual; + } Node* int_zero = _igvn.intcon(0); set_ctrl(int_zero, C->root()); @@ -919,11 +955,11 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List // Replace inner loop long iv phi as inner loop int iv phi + outer // loop iv phi - Node* iv_add = long_loop_replace_long_iv(phi, inner_phi, outer_phi, head); + Node* iv_add = loop_nest_replace_iv(phi, inner_phi, outer_phi, head, bt); // Replace inner loop long iv incr with inner loop int incr + outer // loop iv phi - long_loop_replace_long_iv(incr, inner_incr, outer_phi, head); + loop_nest_replace_iv(incr, inner_incr, outer_phi, head, bt); set_subtree_ctrl(inner_iters_actual_int, body_populated); @@ -983,6 +1019,11 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List // exit_branch: break; //in(0) := outer_exit_test // } + if (bt == T_INT) { + outer_phi = new ConvI2LNode(outer_phi); + register_new_node(outer_phi, outer_head); + } + transform_long_range_checks(checked_cast(stride_con), range_checks, outer_phi, inner_iters_actual_int, inner_phi, iv_add, inner_head); // Peel one iteration of the loop and use the safepoint at the end @@ -1009,15 +1050,79 @@ bool PhaseIdealLoop::transform_long_counted_loop(IdealLoopTree* loop, Node_List } #ifndef PRODUCT - Atomic::inc(&_long_loop_nests); + if (bt == T_LONG) { + Atomic::inc(&_long_loop_nests); + } #endif - inner_head->mark_transformed_long_inner_loop(); - outer_head->mark_transformed_long_outer_loop(); + inner_head->mark_loop_nest_inner_loop(); + outer_head->mark_loop_nest_outer_loop(); return true; } +// Convert the strip mined loop nest back to a single loop with the safepoint right before the loop exit test +void PhaseIdealLoop::strip_mined_nest_back_to_counted_loop(IdealLoopTree* loop, const BaseCountedLoopNode* head, + Node* back_control, IfNode*& exit_test, + SafePointNode*& safepoint) { + CountedLoopNode* cl = head->as_CountedLoop(); + cl->verify_strip_mined(1); + safepoint = cl->outer_safepoint(); + CountedLoopEndNode* cle = cl->loopexit(); + OuterStripMinedLoopNode* outer_head = cl->outer_loop(); + OuterStripMinedLoopEndNode* outer_end = cl->outer_loop_end(); + + cl->clear_strip_mined(); + + _igvn.replace_input_of(cl, LoopNode::EntryControl, outer_head->in(LoopNode::EntryControl)); + _igvn.replace_input_of(outer_head, LoopNode::EntryControl, C->top()); + set_idom(cl, cl->in(LoopNode::EntryControl), dom_depth(cl)); + + Node* exit_bol = cle->in(1); + Node *zero = _igvn.intcon(0); + set_ctrl(zero, C->root()); + _igvn.replace_input_of(cle, 1, zero); + + _igvn.replace_input_of(outer_end, 1, exit_bol); + + assert(outer_head->in(LoopNode::LoopBackControl)->in(0) == outer_end, ""); + _igvn.replace_input_of(outer_head->in(LoopNode::LoopBackControl), 0, C->top()); + _igvn.replace_input_of(back_control, 0, outer_end); + set_idom(back_control, outer_end, dom_depth(outer_end) + 1); + + Unique_Node_List wq; + wq.push(safepoint); + + IdealLoopTree* outer_loop_ilt = get_loop(outer_head); + + for (uint i = 0; i < wq.size(); i++) { + Node* n = wq.at(i); + for (uint j = 0; j < n->req(); ++j) { + Node* in = n->in(j); + if (in == NULL || in->is_CFG()) { + continue; + } + if (get_loop(get_ctrl(in)) != outer_loop_ilt) { + continue; + } + assert(!loop->_body.contains(in), ""); + loop->_body.push(in); + wq.push(in); + } + } + + set_loop(outer_end, loop); + loop->_body.push(outer_end); + set_loop(safepoint, loop); + loop->_body.push(safepoint); + set_loop(safepoint->in(0), loop); + loop->_body.push(safepoint->in(0)); + + exit_test = outer_end; + + outer_loop_ilt->_tail = C->top(); +} + int PhaseIdealLoop::extract_long_range_checks(const IdealLoopTree* loop, jlong stride_con, int iters_limit, PhiNode* phi, Node_List& range_checks) { if (stride_con < 0) { // only for stride_con > 0 && scale > 0 for now @@ -1164,7 +1269,8 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List // could be shared and have already been taken care of continue; } - bool ok = is_scaled_iv_plus_offset(rc_cmp->in(1), iv_add, &scale, &offset, T_LONG); + bool converted = false; + bool ok = is_scaled_iv_plus_offset(rc_cmp->in(1), iv_add, &scale, &offset, T_LONG, &converted); assert(ok, "inconsistent: was tested before"); Node* range = rc_cmp->in(2); Node* c = rc->in(0); @@ -1173,7 +1279,44 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List Node* R = range; Node* K = _igvn.longcon(scale); set_ctrl(K, this->C->root()); + Node* L = offset; + + if (converted) { + // This converts: + // i*K + L (long)max_jint and < R + // and so i*(long)K + L root()); + Node* max_range = new AddLNode(max_jint_plus_one_long, L); + register_new_node(max_range, entry_control); + R = MaxNode::unsigned_min(R, max_range, TypeLong::POS, _igvn); + set_subtree_ctrl(R, true); + } + Node* C = outer_phi; Node* Z_2 = new ConvI2LNode(inner_iters_actual_int, TypeLong::LONG); register_new_node(Z_2, entry_control); @@ -1251,8 +1394,8 @@ Node* PhaseIdealLoop::clamp(Node* R, Node* L, Node* H) { return max; } -LoopNode* PhaseIdealLoop::create_inner_head(IdealLoopTree* loop, LongCountedLoopNode* head, - LongCountedLoopEndNode* exit_test) { +LoopNode* PhaseIdealLoop::create_inner_head(IdealLoopTree* loop, BaseCountedLoopNode* head, + IfNode* exit_test) { LoopNode* new_inner_head = new LoopNode(head->in(1), head->in(2)); IfNode* new_inner_exit = new IfNode(exit_test->in(0), exit_test->in(1), exit_test->_prob, exit_test->_fcnt); _igvn.register_new_node_with_optimizer(new_inner_head); @@ -1272,21 +1415,21 @@ LoopNode* PhaseIdealLoop::create_inner_head(IdealLoopTree* loop, LongCountedLoop } #ifdef ASSERT -void PhaseIdealLoop::check_long_counted_loop(IdealLoopTree* loop, Node* x) { +void PhaseIdealLoop::check_counted_loop_shape(IdealLoopTree* loop, Node* x, BasicType bt) { Node* back_control = loop_exit_control(x, loop); assert(back_control != NULL, "no back control"); - BoolTest::mask bt = BoolTest::illegal; + BoolTest::mask mask = BoolTest::illegal; float cl_prob = 0; Node* incr = NULL; Node* limit = NULL; - Node* cmp = loop_exit_test(back_control, loop, incr, limit, bt, cl_prob); - assert(cmp != NULL && cmp->Opcode() == Op_CmpL, "no exit test"); + Node* cmp = loop_exit_test(back_control, loop, incr, limit, mask, cl_prob); + assert(cmp != NULL && cmp->Opcode() == Op_Cmp(bt), "no exit test"); Node* phi_incr = NULL; incr = loop_iv_incr(incr, x, loop, phi_incr); - assert(incr != NULL && incr->Opcode() == Op_AddL, "no incr"); + assert(incr != NULL && incr->Opcode() == Op_Add(bt), "no incr"); Node* xphi = NULL; Node* stride = loop_iv_stride(incr, loop, xphi); @@ -1297,11 +1440,11 @@ void PhaseIdealLoop::check_long_counted_loop(IdealLoopTree* loop, Node* x) { assert(phi != NULL && phi->in(LoopNode::LoopBackControl) == incr, "No phi"); - jlong stride_con = stride->get_long(); + jlong stride_con = stride->get_integer_as_long(bt); - assert(condition_stride_ok(bt, stride_con), "illegal condition"); + assert(condition_stride_ok(mask, stride_con), "illegal condition"); - assert(bt != BoolTest::ne, "unexpected condition"); + assert(mask != BoolTest::ne, "unexpected condition"); assert(phi_incr == NULL, "bad loop shape"); assert(cmp->in(1) == incr, "bad exit test shape"); @@ -1630,7 +1773,7 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ if (sov < 0) { return false; // Bailout: integer overflow is certain. } - assert(!x->as_Loop()->is_transformed_long_inner_loop(), "long loop was transformed"); + assert(!x->as_Loop()->is_loop_nest_inner_loop(), "loop was transformed"); // Generate loop's limit check. // Loop limit check predicate should be near the loop. ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); @@ -1720,7 +1863,7 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ #ifdef ASSERT if (iv_bt == T_INT && - !x->as_Loop()->is_transformed_long_inner_loop() && + !x->as_Loop()->is_loop_nest_inner_loop() && StressLongCountedLoop > 0 && trunc1 == NULL && convert_to_long_loop(cmp, phi, loop)) { @@ -1925,12 +2068,12 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_ } #ifndef PRODUCT - if (x->as_Loop()->is_transformed_long_inner_loop()) { + if (x->as_Loop()->is_loop_nest_inner_loop() && iv_bt == T_LONG) { Atomic::inc(&_long_loop_counted_loops); } #endif - if (iv_bt == T_LONG && x->as_Loop()->is_transformed_long_outer_loop()) { - l->mark_transformed_long_outer_loop(); + if (iv_bt == T_LONG && x->as_Loop()->is_loop_nest_outer_loop()) { + l->mark_loop_nest_outer_loop(); } return true; @@ -2405,11 +2548,6 @@ int CountedLoopNode::stride_con() const { return cle != NULL ? cle->stride_con() : 0; } -jlong LongCountedLoopNode::stride_con() const { - LongCountedLoopEndNode* cle = loopexit_or_null(); - return cle != NULL ? cle->stride_con() : 0; -} - BaseCountedLoopNode* BaseCountedLoopNode::make(Node* entry, Node* backedge, BasicType bt) { if (bt == T_INT) { return new CountedLoopNode(entry, backedge); @@ -3542,7 +3680,7 @@ void IdealLoopTree::counted_loop( PhaseIdealLoop *phase ) { phase->is_counted_loop(_head, loop, T_LONG)) { remove_safepoints(phase, true); } else { - assert(!_head->is_Loop() || !_head->as_Loop()->is_transformed_long_inner_loop(), "transformation to counted loop should not fail"); + assert(!_head->is_Loop() || !_head->as_Loop()->is_loop_nest_inner_loop(), "transformation to counted loop should not fail"); if (_parent != NULL && !_irreducible) { // Not a counted loop. Keep one safepoint. bool keep_one_sfpt = true; @@ -4214,7 +4352,9 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) { // Because RCE opportunities can be masked by split_thru_phi, // look for RCE candidates and inhibit split_thru_phi // on just their loop-phi's for this pass of loop opts - if (SplitIfBlocks && do_split_ifs && lpt->policy_range_check(this, true)) { + if (SplitIfBlocks && do_split_ifs && + (lpt->policy_range_check(this, true, T_LONG) || + (head->is_CountedLoop() && lpt->policy_range_check(this, true, T_INT)))) { lpt->_rce_candidate = 1; // = true } } @@ -4266,13 +4406,6 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) { // Do verify graph edges in any case NOT_PRODUCT( C->verify_graph_edges(); ); - if (C->has_loops() && !C->major_progress()) { - for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) { - IdealLoopTree *lpt = iter.current(); - transform_long_counted_loop(lpt, worklist); - } - } - if (!do_split_ifs) { // We saw major progress in Split-If to get here. We forced a // pass with unrolling and not split-if, however more split-if's diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 4cca7ab45da..b156ceb95b4 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -77,8 +77,8 @@ protected: StripMined = 1<<15, SubwordLoop = 1<<16, ProfileTripFailed = 1<<17, - TransformedLongInnerLoop = 1<<18, - TransformedLongOuterLoop = 1<<19}; + LoopNestInnerLoop = 1 << 18, + LoopNestLongOuterLoop = 1 << 19}; char _unswitch_count; enum { _unswitch_max=3 }; char _postloop_flags; @@ -103,8 +103,8 @@ public: bool is_strip_mined() const { return _loop_flags & StripMined; } bool is_profile_trip_failed() const { return _loop_flags & ProfileTripFailed; } bool is_subword_loop() const { return _loop_flags & SubwordLoop; } - bool is_transformed_long_inner_loop() const { return _loop_flags & TransformedLongInnerLoop; } - bool is_transformed_long_outer_loop() const { return _loop_flags & TransformedLongOuterLoop; } + bool is_loop_nest_inner_loop() const { return _loop_flags & LoopNestInnerLoop; } + bool is_loop_nest_outer_loop() const { return _loop_flags & LoopNestLongOuterLoop; } void mark_partial_peel_failed() { _loop_flags |= PartialPeelFailed; } void mark_has_reductions() { _loop_flags |= HasReductions; } @@ -119,8 +119,8 @@ public: void clear_strip_mined() { _loop_flags &= ~StripMined; } void mark_profile_trip_failed() { _loop_flags |= ProfileTripFailed; } void mark_subword_loop() { _loop_flags |= SubwordLoop; } - void mark_transformed_long_inner_loop() { _loop_flags |= TransformedLongInnerLoop; } - void mark_transformed_long_outer_loop() { _loop_flags |= TransformedLongOuterLoop; } + void mark_loop_nest_inner_loop() { _loop_flags |= LoopNestInnerLoop; } + void mark_loop_nest_outer_loop() { _loop_flags |= LoopNestLongOuterLoop; } int unswitch_max() { return _unswitch_max; } int unswitch_count() { return _unswitch_count; } @@ -216,6 +216,8 @@ public: virtual BasicType bt() const = 0; + jlong stride_con() const; + static BaseCountedLoopNode* make(Node* entry, Node* backedge, BasicType bt); }; @@ -364,7 +366,6 @@ public: LongCountedLoopEndNode* loopexit_or_null() const { return (LongCountedLoopEndNode*) BaseCountedLoopNode::loopexit_or_null(); } LongCountedLoopEndNode* loopexit() const { return (LongCountedLoopEndNode*) BaseCountedLoopNode::loopexit(); } - jlong stride_con() const; }; @@ -512,6 +513,12 @@ inline Node* BaseCountedLoopNode::phi() const { return cle != NULL ? cle->phi() : NULL; } +inline jlong BaseCountedLoopNode::stride_con() const { + BaseCountedLoopEndNode* cle = loopexit_or_null(); + return cle != NULL ? cle->stride_con() : 0; +} + + //------------------------------LoopLimitNode----------------------------- // Counted Loop limit node which represents exact final iterator value: // trip_count = (limit - init_trip + stride - 1)/stride @@ -710,7 +717,7 @@ public: // Return TRUE or FALSE if the loop should be range-check-eliminated. // Gather a list of IF tests that are dominated by iteration splitting; // also gather the end of the first split and the start of the 2nd split. - bool policy_range_check(PhaseIdealLoop* phase, bool provisional) const; + bool policy_range_check(PhaseIdealLoop* phase, bool provisional, BasicType bt) const; // Return TRUE if "iff" is a range check. bool is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar DEBUG_ONLY(COMMA ProjNode *predicate_proj)) const; @@ -1146,8 +1153,8 @@ public: bool is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_bt); - Node* long_loop_replace_long_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head); - bool transform_long_counted_loop(IdealLoopTree* loop, Node_List &old_new); + Node* loop_nest_replace_iv(Node* iv_to_replace, Node* inner_iv, Node* outer_phi, Node* inner_head, BasicType bt); + bool create_loop_nest(IdealLoopTree* loop, Node_List &old_new); #ifdef ASSERT bool convert_to_long_loop(Node* cmp, Node* phi, IdealLoopTree* loop); #endif @@ -1248,10 +1255,12 @@ public: void mark_reductions( IdealLoopTree *loop ); // Return true if exp is a constant times an induction var - bool is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType bt); + bool is_scaled_iv(Node* exp, Node* iv, jlong* p_scale, BasicType bt, bool* converted); + + bool is_iv(Node* exp, Node* iv, BasicType bt); // Return true if exp is a scaled induction var plus (or minus) constant - bool is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scale, Node** p_offset, BasicType bt, int depth = 0); + bool is_scaled_iv_plus_offset(Node* exp, Node* iv, jlong* p_scale, Node** p_offset, BasicType bt, bool* converted = NULL, int depth = 0); bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset) { jlong long_scale; if (is_scaled_iv_plus_offset(exp, iv, &long_scale, p_offset, T_INT)) { @@ -1610,9 +1619,9 @@ public: void rpo(Node* start, Node_Stack &stk, VectorSet &visited, Node_List &rpo_list) const; - void check_long_counted_loop(IdealLoopTree* loop, Node* x) NOT_DEBUG_RETURN; + void check_counted_loop_shape(IdealLoopTree* loop, Node* x, BasicType bt) NOT_DEBUG_RETURN; - LoopNode* create_inner_head(IdealLoopTree* loop, LongCountedLoopNode* head, LongCountedLoopEndNode* exit_test); + LoopNode* create_inner_head(IdealLoopTree* loop, BaseCountedLoopNode* head, IfNode* exit_test); int extract_long_range_checks(const IdealLoopTree* loop, jlong stride_con, int iters_limit, PhiNode* phi, @@ -1635,6 +1644,9 @@ public: Node* clamp(Node* R, Node* L, Node* H); bool safe_for_if_replacement(const Node* dom) const; + + void strip_mined_nest_back_to_counted_loop(IdealLoopTree* loop, const BaseCountedLoopNode* head, Node* back_control, + IfNode*&exit_test, SafePointNode*&safepoint); }; diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index f1cb053d87e..65bb4f663a8 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -1053,7 +1053,7 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) { // Do not clone the trip counter through on a CountedLoop // (messes up the canonical shape). - if (((n_blk->is_CountedLoop() || (n_blk->is_Loop() && n_blk->as_Loop()->is_transformed_long_inner_loop())) && n->Opcode() == Op_AddI) || + if (((n_blk->is_CountedLoop() || (n_blk->is_Loop() && n_blk->as_Loop()->is_loop_nest_inner_loop())) && n->Opcode() == Op_AddI) || (n_blk->is_LongCountedLoop() && n->Opcode() == Op_AddL)) { return n; } diff --git a/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java b/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java index 298f0094201..4fd677ab4c0 100644 --- a/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java +++ b/test/hotspot/jtreg/compiler/c2/irTests/TestLongRangeChecks.java @@ -28,7 +28,7 @@ import java.util.Objects; /* * @test - * @bug 8259609 + * @bug 8259609 8276116 * @summary C2: optimize long range checks in long counted loops * @library /test/lib / * @run driver compiler.c2.irTests.TestLongRangeChecks @@ -41,8 +41,8 @@ public class TestLongRangeChecks { @Test - @IR(counts = { IRNode.LOOP, "1"}) - @IR(failOn = { IRNode.COUNTEDLOOP}) + @IR(counts = { IRNode.LOOP, "1" }) + @IR(failOn = { IRNode.COUNTEDLOOP }) public static void testStridePosScalePos(long start, long stop, long length, long offset) { final long scale = 1; final long stride = 1; @@ -60,4 +60,40 @@ public class TestLongRangeChecks { private void testStridePosScalePos_runner() { testStridePosScalePos(0, 100, 100, 0); } + + @Test + @IR(counts = { IRNode.LOOP, "1" }) + @IR(failOn = { IRNode.COUNTEDLOOP }) + public static void testStridePosScalePosInIntLoop1(int start, int stop, long length, long offset) { + final long scale = 2; + final int stride = 1; + + // Same but with int loop + for (int i = start; i < stop; i += stride) { + Objects.checkIndex(scale * i + offset, length); + } + } + + @Run(test = "testStridePosScalePosInIntLoop1") + private void testStridePosScalePosInIntLoop1_runner() { + testStridePosScalePosInIntLoop1(0, 100, 200, 0); + } + + @Test + @IR(counts = { IRNode.LOOP, "1" }) + @IR(failOn = { IRNode.COUNTEDLOOP }) + public static void testStridePosScalePosInIntLoop2(int start, int stop, long length, long offset) { + final int scale = 2; + final int stride = 1; + + // Same but with int loop + for (int i = start; i < stop; i += stride) { + Objects.checkIndex(scale * i + offset, length); + } + } + + @Run(test = "testStridePosScalePosInIntLoop2") + private void testStridePosScalePosInIntLoop2_runner() { + testStridePosScalePosInIntLoop2(0, 100, 200, 0); + } } diff --git a/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java b/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java index 63a649b886b..d56d19278cf 100644 --- a/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java +++ b/test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java @@ -23,7 +23,7 @@ /** * @test - * @bug 8259609 + * @bug 8259609 8276116 * @summary C2: optimize long range checks in long counted loops * @requires vm.compiler2.enabled * @requires vm.compMode != "Xcomp" @@ -32,7 +32,7 @@ * @build sun.hotspot.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox * - * @run main/othervm -ea -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation TestLongRangeCheck + * @run main/othervm -ea -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestLongRangeCheck * */ @@ -193,6 +193,115 @@ public class TestLongRangeCheck { m.invoke(null, 0, 100, Long.MAX_VALUE, Long.MAX_VALUE - 50, 0, 50); assertIsCompiled(m); } + + test("testStridePosScalePosInIntLoop", 0, 100, 100, 0); + + test("testStrideNegScaleNegInIntLoop", 0, 100, 100, 100); + + test("testStrideNegScalePosInIntLoop", 0, 100, 100, 0); + + test("testStridePosScaleNegInIntLoop", 0, 100, 100, 99); + + test("testStridePosScalePosNotOneInIntLoop", 0, 100, 1090, 0); + + test("testStrideNegScaleNegNotOneInIntLoop", 0, 100, 1090, 1100); + + test("testStrideNegScalePosNotOneInIntLoop", 0, 100, 1090, 0); + + test("testStridePosScaleNegNotOneInIntLoop", 0, 100, 1090, 1089); + + v = ((long)Integer.MAX_VALUE / 10000) * 9999; + + test("testStridePosNotOneScalePosInIntLoop", -v, v, v * 4, 2 * v); + + test("testStrideNegNotOneScaleNegInIntLoop", -v, v, v * 4, 2 * v); + + test("testStrideNegNotOneScalePosInIntLoop", -v, v, v * 4, 2 * v); + + test("testStridePosNotOneScaleNegInIntLoop", -v, v, v * 4, 2 * v - 1); + + // offset causes overflow + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosInIntLoop", long.class, long.class, long.class, long.class); + m.invoke(null, 0, 100, 100, 0); + compile(m); + + m.invoke(null, 0, 100, 100, 0); + assertIsCompiled(m); + try { + m.invoke(null, 0, 100, 100, Long.MAX_VALUE - 50); + throw new RuntimeException("should have thrown"); + } catch(InvocationTargetException e) { + if (!(e.getCause() instanceof IndexOutOfBoundsException)) { + throw new RuntimeException("unexpected exception"); + } + } + assertIsNotCompiled(m); + } + // no spurious deopt if the range check doesn't fail because not executed + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosConditional", long.class, long.class, long.class, long.class, long.class, long.class); + m.invoke(null, 0, 100, 100, 0, 0, 100); + compile(m); + + m.invoke(null, 0, 100, 100, -50, 50, 100); + assertIsCompiled(m); + } + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosConditional", long.class, long.class, long.class, long.class, long.class, long.class); + m.invoke(null, 0, 100, 100, 0, 0, 100); + compile(m); + + m.invoke(null, 0, 100, Long.MAX_VALUE, Long.MAX_VALUE - 50, 0, 50); + assertIsCompiled(m); + } + + test("testStridePosScalePosNotOneInIntLoop2", 0, 100, 1090, 0); + + test("testStrideNegScaleNegNotOneInIntLoop2", 0, 100, 1090, 1100); + + test("testStrideNegScalePosNotOneInIntLoop2", 0, 100, 1090, 0); + + test("testStridePosScaleNegNotOneInIntLoop2", 0, 100, 1090, 1089); + + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosInIntLoopOverflow", long.class, long.class, long.class, long.class); + long stride = 1 << 14; + long scale = 1 << 15; + long offset = stride * scale * 4; + long length = offset + stride * scale * 3 + 1; + long stop = stride * 5; + + m.invoke(null, 0, stop, length, offset); + compile(m); + + m.invoke(null, 0, stop, length, offset); + // deoptimizes even though no range check fails + } + { + Method m = newClassLoader().loadClass("TestLongRangeCheck").getDeclaredMethod("testStridePosScalePosInIntLoopOverflow", long.class, long.class, long.class, long.class); + long stride = 1 << 14; + long scale = 1 << 15; + long offset = stride * scale * 4; + long length = offset + stride * scale * 3 + 1; + long stop = stride * 5; + + m.invoke(null, 0, stop, length, offset); + compile(m); + + offset = 0; + stop = stride * 5; + + try { + m.invoke(null, 0, stop, length, offset); + throw new RuntimeException("should have thrown"); + } catch(InvocationTargetException e) { + if (!(e.getCause() instanceof IndexOutOfBoundsException)) { + throw new RuntimeException("unexpected exception"); + } + } + assertIsNotCompiled(m); + } } public static void testStridePosScalePos(long start, long stop, long length, long offset) { @@ -301,4 +410,177 @@ public class TestLongRangeCheck { } } } + + private static void checkInputs(long... inputs) { + for (int i = 0; i < inputs.length; i++) { + if ((long)((int)inputs[i]) != inputs[i]) { + throw new RuntimeException("bad arguments"); + } + } + } + + public static void testStridePosScalePosInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = 1; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScaleNegInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = -1; + final int stride = 1; + for (int i = (int)stop; i > (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScalePosInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = 1; + final int stride = 1; + for (int i = (int)(stop-1); i >= (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScaleNegInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = -1; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScalePosNotOneInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = 11; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScaleNegNotOneInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = -11; + final int stride = 1; + for (int i = (int)stop; i > (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScalePosNotOneInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = 11; + final int stride = 1; + for (int i = (int)(stop-1); i >= (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScaleNegNotOneInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = -11; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosNotOneScalePosInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = 2; + final int stride = Integer.MAX_VALUE / 10000; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegNotOneScaleNegInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = -2; + final int stride = Integer.MAX_VALUE / 10000; + for (int i = (int)stop; i > (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegNotOneScalePosInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = 2; + final int stride = Integer.MAX_VALUE / 10000; + for (int i = (int)(stop-1); i >= (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosNotOneScaleNegInIntLoop(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final long scale = -2; + final int stride = Integer.MAX_VALUE / 10000; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScalePosConditionalInIntLoop(long start, long stop, long length, long offset, long start2, long stop2) { + checkInputs(start, stop, start2, stop2); + Preconditions.checkIndex(0, length, null); + final long scale = 1; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + if (i >= (int)start2 && i < (int)stop2) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + } + + public static void testStridePosScalePosNotOneInIntLoop2(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final int scale = 11; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScaleNegNotOneInIntLoop2(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final int scale = -11; + final int stride = 1; + for (int i = (int)stop; i > (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStrideNegScalePosNotOneInIntLoop2(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final int scale = 11; + final int stride = 1; + for (int i = (int)(stop-1); i >= (int)start; i -= stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScaleNegNotOneInIntLoop2(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final int scale = -11; + final int stride = 1; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } + + public static void testStridePosScalePosInIntLoopOverflow(long start, long stop, long length, long offset) { + checkInputs(start, stop); + final int scale = 1 << 15; + final int stride = 1 << 14; + for (int i = (int)start; i < (int)stop; i += stride) { + Preconditions.checkIndex(scale * i + offset, length, null); + } + } } -- GitLab From 3893f4f70b5828ee8e673ce7b1422877efe5c292 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Wed, 8 Dec 2021 22:32:00 +0000 Subject: [PATCH 692/890] 8278330: dump stack trace if the jvmti test nsk/jvmti/GetThreadState/thrstat002 is failed with wrong thread state Reviewed-by: amenkov, lmesnik --- .../GetThreadState/thrstat002/thrstat002.cpp | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat002/thrstat002.cpp b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat002/thrstat002.cpp index 4840af81f38..2b10a77c56c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat002/thrstat002.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat002/thrstat002.cpp @@ -48,6 +48,107 @@ static jint state[] = { JVMTI_THREAD_STATE_IN_OBJECT_WAIT }; + +#if 1 // support for debug tracing + +#define LOG(...) \ + { \ + printf(__VA_ARGS__); \ + fflush(stdout); \ + } + +#define MAX_FRAME_COUNT_PRINT_STACK_TRACE 200 + +static void +check_jvmti_status(JNIEnv* jni, jvmtiError err, const char* msg) { + if (err != JVMTI_ERROR_NONE) { + LOG("check_jvmti_status: JVMTI function returned error: %s (%d)\n", TranslateError(err), err); + jni->FatalError(msg); + } +} + +static void +deallocate(jvmtiEnv *jvmti, JNIEnv* jni, void* ptr) { + jvmtiError err; + + err = jvmti->Deallocate((unsigned char*)ptr); + check_jvmti_status(jni, err, "deallocate: error in JVMTI Deallocate call"); +} + +static char* +get_method_class_name(jvmtiEnv *jvmti, JNIEnv* jni, jmethodID method) { + jclass klass = NULL; + char* cname = NULL; + char* result = NULL; + jvmtiError err; + + err = jvmti->GetMethodDeclaringClass(method, &klass); + check_jvmti_status(jni, err, "get_method_class_name: error in JVMTI GetMethodDeclaringClass"); + + err = jvmti->GetClassSignature(klass, &cname, NULL); + check_jvmti_status(jni, err, "get_method_class_name: error in JVMTI GetClassSignature"); + + size_t len = strlen(cname) - 2; // get rid of leading 'L' and trailing ';' + + err = jvmti->Allocate((jlong)(len + 1), (unsigned char**)&result); + check_jvmti_status(jni, err, "get_method_class_name: error in JVMTI Allocate"); + + strncpy(result, cname + 1, len); // skip leading 'L' + result[len] = '\0'; + deallocate(jvmti, jni, (void*)cname); + return result; +} + +static void +print_method(jvmtiEnv *jvmti, JNIEnv* jni, jmethodID method, jint depth) { + char* cname = NULL; + char* mname = NULL; + char* msign = NULL; + jvmtiError err; + + cname = get_method_class_name(jvmti, jni, method); + + err = jvmti->GetMethodName(method, &mname, &msign, NULL); + check_jvmti_status(jni, err, "print_method: error in JVMTI GetMethodName"); + + LOG("%2d: %s: %s%s\n", depth, cname, mname, msign); + fflush(0); + deallocate(jvmti, jni, (void*)cname); + deallocate(jvmti, jni, (void*)mname); + deallocate(jvmti, jni, (void*)msign); +} + +static char* +get_thread_name(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread) { + jvmtiThreadInfo thr_info; + jvmtiError err; + + memset(&thr_info, 0, sizeof(thr_info)); + err = jvmti->GetThreadInfo(thread, &thr_info); + check_jvmti_status(jni, err, "get_thread_name: error in JVMTI GetThreadInfo call"); + + return thr_info.name == NULL ? (char*)"" : thr_info.name; +} + +static void +print_stack_trace(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread) { + jvmtiFrameInfo frames[MAX_FRAME_COUNT_PRINT_STACK_TRACE]; + char* tname = get_thread_name(jvmti, jni, thread); + jint count = 0; + jvmtiError err; + + err = jvmti->GetStackTrace(thread, 0, MAX_FRAME_COUNT_PRINT_STACK_TRACE, frames, &count); + check_jvmti_status(jni, err, "print_stack_trace: error in JVMTI GetStackTrace"); + + LOG("JVMTI Stack Trace for thread %s: frame count: %d\n", tname, count); + for (int depth = 0; depth < count; depth++) { + print_method(jvmti, jni, frames[depth].method, depth); + } + deallocate(jvmti, jni, (void*)tname); + LOG("\n"); +} +#endif // support for debug tracing + void printStateFlags(jint flags) { if (flags & JVMTI_THREAD_STATE_SUSPENDED) printf(" JVMTI_THREAD_STATE_SUSPENDED"); @@ -337,6 +438,9 @@ Java_nsk_jvmti_GetThreadState_thrstat002_checkStatus(JNIEnv *env, jclass cls, TranslateState(state[statInd]), state[statInd]); printf(" actual: %s (%d)\n", TranslateState(thrState), thrState); +#ifdef DBG + print_stack_trace(jvmti, env, thr_ptr); +#endif result = STATUS_FAILED; } if (suspState != JVMTI_THREAD_STATE_SUSPENDED) { -- GitLab From 03bf55f62065f8f9c8ade1eff8ca6eaeabe51450 Mon Sep 17 00:00:00 2001 From: Vicente Romero Date: Wed, 8 Dec 2021 22:49:43 +0000 Subject: [PATCH 693/890] 8277980: ObjectMethods::bootstrap throws NPE when lookup is null Reviewed-by: jjg --- .../share/classes/java/lang/runtime/ObjectMethods.java | 6 +++--- test/jdk/java/lang/runtime/ObjectMethodsTest.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java b/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java index 5d092328f75..c2d388d01ba 100644 --- a/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java +++ b/src/java.base/share/classes/java/lang/runtime/ObjectMethods.java @@ -396,15 +396,15 @@ public class ObjectMethods { * if invoked by a condy * @throws IllegalArgumentException if the bootstrap arguments are invalid * or inconsistent - * @throws NullPointerException if any argument but {@code lookup} is {@code null}, - * in the case of the {@code getters} argument, its - * contents cannot be {@code null} either + * @throws NullPointerException if any argument is {@code null} or if any element + * in the {@code getters} array is {@code null} * @throws Throwable if any exception is thrown during call site construction */ public static Object bootstrap(MethodHandles.Lookup lookup, String methodName, TypeDescriptor type, Class recordClass, String names, MethodHandle... getters) throws Throwable { + requireNonNull(lookup); requireNonNull(methodName); requireNonNull(type); requireNonNull(recordClass); diff --git a/test/jdk/java/lang/runtime/ObjectMethodsTest.java b/test/jdk/java/lang/runtime/ObjectMethodsTest.java index dba92eb32ff..0a7741c02e1 100644 --- a/test/jdk/java/lang/runtime/ObjectMethodsTest.java +++ b/test/jdk/java/lang/runtime/ObjectMethodsTest.java @@ -166,6 +166,7 @@ public class ObjectMethodsTest { assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), npt.mt(), null, "x;y", C.ACCESSORS)); assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, npt.mn(), null, C.class, "x;y", C.ACCESSORS)); assertThrows(NPE, () -> ObjectMethods.bootstrap(LOOKUP, null, npt.mt(), C.class, "x;y", C.ACCESSORS)); + assertThrows(NPE, () -> ObjectMethods.bootstrap(null, npt.mn(), npt.mt(), C.class, "x;y", C.ACCESSORS)); } } -- GitLab From 3cec700a5caa2243772e4b01c40630cb044b76fc Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Wed, 8 Dec 2021 22:59:38 +0000 Subject: [PATCH 694/890] 8278463: [test] Serialization WritePrimitive test revised for readFully test fails Reviewed-by: darcy --- test/jdk/java/io/Serializable/oldTests/WritePrimitive.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java b/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java index 2846e7c8f8d..e6b841e7a49 100644 --- a/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java +++ b/test/jdk/java/io/Serializable/oldTests/WritePrimitive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2021, 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 @@ -22,6 +22,7 @@ */ /* @test + * @bug 8276806 8278463 * @summary it is a new version of an old test which was * /src/share/test/serialization/piotest.java * Test of serialization/deserialization of @@ -90,7 +91,7 @@ public class WritePrimitive { byte[] ba_readFullyBuf = new byte[ba.length]; int ba_readFullyLen = q.read(ba_readFullyBuf); byte[] ba_readFullySizedBuf = new byte[ba.length]; - int ba_readFullySizedLen = q.read(ba_readFullySizedBuf, 0, ba.length - 1); + int ba_readFullySizedLen = q.read(ba_readFullySizedBuf, 0, ba.length - 2); String string_utf = q.readUTF(); String string_u = (String)q.readObject(); if (i != i_u) { -- GitLab From 83e6a4c0e9e4a9474ae0c1252378b1a09d1d2df0 Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Wed, 8 Dec 2021 23:04:15 +0000 Subject: [PATCH 695/890] 8255409: Support the new C_GetInterfaceList, C_GetInterface, and C_SessionCancel APIs in PKCS#11 v3.0 Reviewed-by: ascarpino, weijun --- .../classes/sun/security/pkcs11/Config.java | 147 ++++++++------- .../sun/security/pkcs11/P11AEADCipher.java | 12 +- .../sun/security/pkcs11/P11Cipher.java | 14 +- .../sun/security/pkcs11/P11KeyWrapCipher.java | 19 +- .../classes/sun/security/pkcs11/P11Mac.java | 7 +- .../sun/security/pkcs11/P11PSSSignature.java | 17 +- .../sun/security/pkcs11/P11RSACipher.java | 19 +- .../sun/security/pkcs11/P11Signature.java | 14 +- .../classes/sun/security/pkcs11/P11Util.java | 21 +++ .../sun/security/pkcs11/SunPKCS11.java | 22 +-- .../sun/security/pkcs11/wrapper/PKCS11.java | 82 +++++++-- .../share/native/libj2pkcs11/p11_sessmgmt.c | 98 +++++++++- .../share/native/libj2pkcs11/p11_util.c | 14 ++ .../share/native/libj2pkcs11/pkcs11wrapper.h | 8 + .../unix/native/libj2pkcs11/p11_md.c | 172 ++++++++++++++---- .../unix/native/libj2pkcs11/p11_md.h | 5 +- .../windows/native/libj2pkcs11/p11_md.c | 164 +++++++++++++---- .../windows/native/libj2pkcs11/p11_md.h | 5 +- 18 files changed, 643 insertions(+), 197 deletions(-) diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java index 6939c7be6f8..676c1fe50e3 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Config.java @@ -165,7 +165,7 @@ final class Config { // name of the C function that returns the PKCS#11 functionlist // This option primarily exists for the deprecated // Secmod.Module.getProvider() method. - private String functionList = "C_GetFunctionList"; + private String functionList = null; // whether to use NSS secmod mode. Implicitly set if nssLibraryDirectory, // nssSecmodDirectory, or nssModule is specified. @@ -311,6 +311,12 @@ final class Config { } String getFunctionList() { + if (functionList == null) { + // defaults to "C_GetFunctionList" for NSS secmod + if (nssUseSecmod || nssUseSecmodTrust) { + return "C_GetFunctionList"; + } + } return functionList; } @@ -408,67 +414,73 @@ final class Config { if (token != TT_WORD) { throw excToken("Unexpected token:"); } - String word = st.sval; - if (word.equals("name")) { - name = parseStringEntry(word); - } else if (word.equals("library")) { - library = parseLibrary(word); - } else if (word.equals("description")) { - parseDescription(word); - } else if (word.equals("slot")) { - parseSlotID(word); - } else if (word.equals("slotListIndex")) { - parseSlotListIndex(word); - } else if (word.equals("enabledMechanisms")) { - parseEnabledMechanisms(word); - } else if (word.equals("disabledMechanisms")) { - parseDisabledMechanisms(word); - } else if (word.equals("attributes")) { - parseAttributes(word); - } else if (word.equals("handleStartupErrors")) { - parseHandleStartupErrors(word); - } else if (word.endsWith("insertionCheckInterval")) { - insertionCheckInterval = parseIntegerEntry(word); + switch (st.sval) { + case "name"-> + name = parseStringEntry(st.sval); + case "library"-> + library = parseLibrary(st.sval); + case "description"-> + parseDescription(st.sval); + case "slot"-> + parseSlotID(st.sval); + case "slotListIndex"-> + parseSlotListIndex(st.sval); + case "enabledMechanisms"-> + parseEnabledMechanisms(st.sval); + case "disabledMechanisms"-> + parseDisabledMechanisms(st.sval); + case "attributes"-> + parseAttributes(st.sval); + case "handleStartupErrors"-> + parseHandleStartupErrors(st.sval); + case "insertionCheckInterval"-> { + insertionCheckInterval = parseIntegerEntry(st.sval); if (insertionCheckInterval < 100) { - throw excLine(word + " must be at least 100 ms"); + throw excLine(st.sval + " must be at least 100 ms"); } - } else if (word.equals("cleaner.shortInterval")) { - resourceCleanerShortInterval = parseIntegerEntry(word); + } + case "cleaner.shortInterval"-> { + resourceCleanerShortInterval = parseIntegerEntry(st.sval); if (resourceCleanerShortInterval < 1_000) { - throw excLine(word + " must be at least 1000 ms"); + throw excLine(st.sval + " must be at least 1000 ms"); } - } else if (word.equals("cleaner.longInterval")) { - resourceCleanerLongInterval = parseIntegerEntry(word); + } + case "cleaner.longInterval"-> { + resourceCleanerLongInterval = parseIntegerEntry(st.sval); if (resourceCleanerLongInterval < 1_000) { - throw excLine(word + " must be at least 1000 ms"); + throw excLine(st.sval + " must be at least 1000 ms"); } - } else if (word.equals("destroyTokenAfterLogout")) { - destroyTokenAfterLogout = parseBooleanEntry(word); - } else if (word.equals("showInfo")) { - showInfo = parseBooleanEntry(word); - } else if (word.equals("keyStoreCompatibilityMode")) { - keyStoreCompatibilityMode = parseBooleanEntry(word); - } else if (word.equals("explicitCancel")) { - explicitCancel = parseBooleanEntry(word); - } else if (word.equals("omitInitialize")) { - omitInitialize = parseBooleanEntry(word); - } else if (word.equals("allowSingleThreadedModules")) { - allowSingleThreadedModules = parseBooleanEntry(word); - } else if (word.equals("functionList")) { - functionList = parseStringEntry(word); - } else if (word.equals("nssUseSecmod")) { - nssUseSecmod = parseBooleanEntry(word); - } else if (word.equals("nssLibraryDirectory")) { - nssLibraryDirectory = parseLibrary(word); + } + case "destroyTokenAfterLogout"-> + destroyTokenAfterLogout = parseBooleanEntry(st.sval); + case "showInfo"-> + showInfo = parseBooleanEntry(st.sval); + case "keyStoreCompatibilityMode"-> + keyStoreCompatibilityMode = parseBooleanEntry(st.sval); + case "explicitCancel"-> + explicitCancel = parseBooleanEntry(st.sval); + case "omitInitialize"-> + omitInitialize = parseBooleanEntry(st.sval); + case "allowSingleThreadedModules"-> + allowSingleThreadedModules = parseBooleanEntry(st.sval); + case "functionList"-> + functionList = parseStringEntry(st.sval); + case "nssUseSecmod"-> + nssUseSecmod = parseBooleanEntry(st.sval); + case "nssLibraryDirectory"-> { + nssLibraryDirectory = parseLibrary(st.sval); nssUseSecmod = true; - } else if (word.equals("nssSecmodDirectory")) { - nssSecmodDirectory = expand(parseStringEntry(word)); + } + case "nssSecmodDirectory"-> { + nssSecmodDirectory = expand(parseStringEntry(st.sval)); nssUseSecmod = true; - } else if (word.equals("nssModule")) { - nssModule = parseStringEntry(word); + } + case "nssModule"-> { + nssModule = parseStringEntry(st.sval); nssUseSecmod = true; - } else if (word.equals("nssDbMode")) { - String mode = parseStringEntry(word); + } + case "nssDbMode"-> { + String mode = parseStringEntry(st.sval); if (mode.equals("readWrite")) { nssDbMode = Secmod.DbMode.READ_WRITE; } else if (mode.equals("readOnly")) { @@ -479,22 +491,25 @@ final class Config { throw excToken("nssDbMode must be one of readWrite, readOnly, and noDb:"); } nssUseSecmod = true; - } else if (word.equals("nssNetscapeDbWorkaround")) { - nssNetscapeDbWorkaround = parseBooleanEntry(word); + } + case "nssNetscapeDbWorkaround"-> { + nssNetscapeDbWorkaround = parseBooleanEntry(st.sval); nssUseSecmod = true; - } else if (word.equals("nssArgs")) { - parseNSSArgs(word); - } else if (word.equals("nssUseSecmodTrust")) { - nssUseSecmodTrust = parseBooleanEntry(word); - } else if (word.equals("useEcX963Encoding")) { - useEcX963Encoding = parseBooleanEntry(word); - } else if (word.equals("nssOptimizeSpace")) { - nssOptimizeSpace = parseBooleanEntry(word); - } else { + } + case "nssArgs"-> + parseNSSArgs(st.sval); + case "nssUseSecmodTrust"-> + nssUseSecmodTrust = parseBooleanEntry(st.sval); + case "useEcX963Encoding"-> + useEcX963Encoding = parseBooleanEntry(st.sval); + case "nssOptimizeSpace"-> + nssOptimizeSpace = parseBooleanEntry(st.sval); + default-> throw new ConfigurationException - ("Unknown keyword '" + word + "', line " + st.lineno()); + ("Unknown keyword '" + st.sval + "', line " + + st.lineno()); } - parsedKeywords.add(word); + parsedKeywords.add(st.sval); } reader.close(); reader = null; diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java index 8a01705b76f..fbabbf2a36c 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11AEADCipher.java @@ -401,7 +401,13 @@ final class P11AEADCipher extends CipherSpi { } private void cancelOperation() { - // cancel operation by finishing it; avoid killSession as some + token.ensureValid(); + if (P11Util.trySessionCancel(token, session, + (encrypt ? CKF_ENCRYPT : CKF_DECRYPT))) { + return; + } + + // cancel by finishing operations; avoid killSession as some // hardware vendors may require re-login int bufLen = doFinalLength(0); byte[] buffer = new byte[bufLen]; @@ -453,7 +459,7 @@ final class P11AEADCipher extends CipherSpi { token.ensureValid(); - byte[] aad = (aadBuffer.size() > 0? aadBuffer.toByteArray() : null); + byte[] aad = (aadBuffer.size() > 0 ? aadBuffer.toByteArray() : null); long p11KeyID = p11Key.getKeyID(); try { @@ -507,7 +513,7 @@ final class P11AEADCipher extends CipherSpi { result -= tagLen; } } - return (result > 0? result : 0); + return (result > 0 ? result : 0); } // reset the states to the pre-initialized values diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java index 5934299e10c..367c9b84832 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Cipher.java @@ -445,8 +445,14 @@ final class P11Cipher extends CipherSpi { private void cancelOperation() { token.ensureValid(); - // cancel operation by finishing it; avoid killSession as some - // hardware vendors may require re-login + + if (P11Util.trySessionCancel(token, session, + (encrypt ? CKF_ENCRYPT : CKF_DECRYPT))) { + return; + } + + // cancel by finishing operations; avoid killSession as + // some hardware vendors may require re-login try { int bufLen = doFinalLength(0); byte[] buffer = new byte[bufLen]; @@ -458,7 +464,7 @@ final class P11Cipher extends CipherSpi { } catch (PKCS11Exception e) { if (e.match(CKR_OPERATION_NOT_INITIALIZED)) { // Cancel Operation may be invoked after an error on a PKCS#11 - // call. If the operation inside the token was already cancelled, + // call. If the operation inside the token is already cancelled, // do not fail here. This is part of a defensive mechanism for // PKCS#11 libraries that do not strictly follow the standard. return; @@ -488,7 +494,7 @@ final class P11Cipher extends CipherSpi { if (session == null) { session = token.getOpSession(); } - CK_MECHANISM mechParams = (blockMode == MODE_CTR? + CK_MECHANISM mechParams = (blockMode == MODE_CTR ? new CK_MECHANISM(mechanism, new CK_AES_CTR_PARAMS(iv)) : new CK_MECHANISM(mechanism, iv)); if (encrypt) { diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyWrapCipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyWrapCipher.java index 2385040d75c..caf0bd298fe 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyWrapCipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyWrapCipher.java @@ -126,7 +126,7 @@ final class P11KeyWrapCipher extends CipherSpi { String[] algoParts = algorithm.split("/"); if (algoParts[0].startsWith("AES")) { int index = algoParts[0].indexOf('_'); - fixedKeySize = (index == -1? -1 : + fixedKeySize = (index == -1 ? -1 : // should be well-formed since we specify what we support Integer.parseInt(algoParts[0].substring(index+1)) >> 3); try { @@ -180,7 +180,7 @@ final class P11KeyWrapCipher extends CipherSpi { protected AlgorithmParameters engineGetParameters() { // KW and KWP uses but not require parameters, return the default // IV when no IV is supplied by caller - byte[] iv = (this.iv == null? type.defIv : this.iv); + byte[] iv = (this.iv == null ? type.defIv : this.iv); AlgorithmParameterSpec spec = new IvParameterSpec(iv); try { @@ -213,7 +213,7 @@ final class P11KeyWrapCipher extends CipherSpi { ("Only IvParameterSpec is supported"); } - byte[] ivValue = (params == null? null : + byte[] ivValue = (params == null ? null : ((IvParameterSpec)params).getIV()); implInit(opmode, key, ivValue, sr); @@ -285,7 +285,14 @@ final class P11KeyWrapCipher extends CipherSpi { } private void cancelOperation() { - // cancel operation by finishing it; avoid killSession as some + token.ensureValid(); + + if (P11Util.trySessionCancel(token, session, + (opmode == Cipher.ENCRYPT_MODE ? CKF_ENCRYPT : CKF_DECRYPT))) { + return; + } + + // cancel by finishing operations; avoid killSession as some // hardware vendors may require re-login byte[] in = dataBuffer.toByteArray(); int inLen = in.length; @@ -379,7 +386,7 @@ final class P11KeyWrapCipher extends CipherSpi { } else { result -= BLK_SIZE; // minus the leading block including the ICV } - return (result > 0? result : 0); + return (result > 0 ? result : 0); } // reset the states to the pre-initialized values @@ -654,7 +661,7 @@ final class P11KeyWrapCipher extends CipherSpi { P11Key tbwP11Key = null; if (!(tbwKey instanceof P11Key)) { try { - tbwP11Key = (tbwKey instanceof SecretKey? + tbwP11Key = (tbwKey instanceof SecretKey ? P11SecretKeyFactory.convertKey(token, tbwKey, tbwKey.getAlgorithm()) : P11KeyFactory.convertKey(token, tbwKey, diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Mac.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Mac.java index 0e86528bb57..97082eae850 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Mac.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Mac.java @@ -147,7 +147,12 @@ final class P11Mac extends MacSpi { private void cancelOperation() { token.ensureValid(); - // cancel operation by finishing it; avoid killSession as some + + if (P11Util.trySessionCancel(token, session, CKF_SIGN)) { + return; + } + + // cancel by finishing operations; avoid killSession as some // hardware vendors may require re-login try { token.p11.C_SignFinal(session.id(), 0); diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java index 88b7b9cd5e8..512bf521be7 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11PSSSignature.java @@ -170,7 +170,7 @@ final class P11PSSSignature extends SignatureSpi { this.mechanism = new CK_MECHANISM(mechId); int idx = algorithm.indexOf("with"); // convert to stdName - this.mdAlg = (idx == -1? + this.mdAlg = (idx == -1 ? null : toStdName(algorithm.substring(0, idx))); switch ((int)mechId) { @@ -193,7 +193,7 @@ final class P11PSSSignature extends SignatureSpi { throw new NoSuchAlgorithmException("Unsupported algorithm: " + algorithm); } - this.md = (this.mdAlg == null? null : + this.md = (this.mdAlg == null ? null : MessageDigest.getInstance(this.mdAlg)); type = T_DIGEST; break; @@ -269,9 +269,16 @@ final class P11PSSSignature extends SignatureSpi { private void cancelOperation() { token.ensureValid(); + if (DEBUG) System.out.print("Cancelling operation"); - // cancel operation by finishing it; avoid killSession as some + if (P11Util.trySessionCancel(token, session, + (mode == M_SIGN ? CKF_SIGN : CKF_VERIFY))) { + if (DEBUG) System.out.println(" by C_SessionCancel"); + return; + } + + // cancel by finishing operations; avoid killSession call as some // hardware vendors may require re-login try { if (mode == M_SIGN) { @@ -280,7 +287,7 @@ final class P11PSSSignature extends SignatureSpi { token.p11.C_SignFinal(session.id(), 0); } else { byte[] digest = - (md == null? new byte[0] : md.digest()); + (md == null ? new byte[0] : md.digest()); if (DEBUG) System.out.println(" by C_Sign"); token.p11.C_Sign(session.id(), digest); } @@ -292,7 +299,7 @@ final class P11PSSSignature extends SignatureSpi { token.p11.C_VerifyFinal(session.id(), signature); } else { byte[] digest = - (md == null? new byte[0] : md.digest()); + (md == null ? new byte[0] : md.digest()); if (DEBUG) System.out.println(" by C_Verify"); token.p11.C_Verify(session.id(), digest, signature); } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java index 869b77d4a63..1506918da96 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11RSACipher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, 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 @@ -37,6 +37,7 @@ import javax.crypto.spec.*; import static sun.security.pkcs11.TemplateManager.*; import sun.security.pkcs11.wrapper.*; import static sun.security.pkcs11.wrapper.PKCS11Constants.*; +import static sun.security.pkcs11.wrapper.PKCS11Exception.RV.*; import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec; import sun.security.util.KeyUtil; @@ -266,7 +267,21 @@ final class P11RSACipher extends CipherSpi { // state variables such as "initialized" private void cancelOperation() { token.ensureValid(); - // cancel operation by finishing it; avoid killSession as some + + long flags = switch(mode) { + case MODE_ENCRYPT -> CKF_ENCRYPT; + case MODE_DECRYPT -> CKF_DECRYPT; + case MODE_SIGN -> CKF_SIGN; + case MODE_VERIFY -> CKF_VERIFY; + default -> { + throw new AssertionError("Unexpected value: " + mode); + } + }; + if (P11Util.trySessionCancel(token, session, flags)) { + return; + } + + // cancel by finishing operations; avoid killSession as some // hardware vendors may require re-login try { PKCS11 p11 = token.p11; diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java index f18fc621d2e..c27a3f4f02e 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java @@ -283,7 +283,13 @@ final class P11Signature extends SignatureSpi { private void cancelOperation() { token.ensureValid(); - // cancel operation by finishing it; avoid killSession as some + + if (P11Util.trySessionCancel(token, session, + (mode == M_SIGN ? CKF_SIGN : CKF_VERIFY))) { + return; + } + + // cancel by finishing operations; avoid killSession call as some // hardware vendors may require re-login try { if (mode == M_SIGN) { @@ -315,9 +321,9 @@ final class P11Signature extends SignatureSpi { } catch (PKCS11Exception e) { if (e.match(CKR_OPERATION_NOT_INITIALIZED)) { // Cancel Operation may be invoked after an error on a PKCS#11 - // call. If the operation inside the token was already cancelled, - // do not fail here. This is part of a defensive mechanism for - // PKCS#11 libraries that do not strictly follow the standard. + // call. If the operation was already cancelled, do not fail + // here. This is part of a defensive mechanism for PKCS#11 + // libraries that do not strictly follow the standard. return; } if (mode == M_VERIFY) { diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Util.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Util.java index 262cfc062ad..256c2f96568 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Util.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Util.java @@ -28,6 +28,9 @@ package sun.security.pkcs11; import java.math.BigInteger; import java.security.*; +import sun.security.pkcs11.wrapper.PKCS11Exception; +import static sun.security.pkcs11.wrapper.PKCS11Exception.RV.*; + /** * Collection of static utility methods. * @@ -187,4 +190,22 @@ public final class P11Util { return sb.toString(); } + // returns true if successfully cancelled + static boolean trySessionCancel(Token token, Session session, long flags) + throws ProviderException { + if (token.p11.getVersion().major == 3) { + try { + token.p11.C_SessionCancel(session.id(), flags); + return true; + } catch (PKCS11Exception e) { + // return false for CKR_OPERATION_CANCEL_FAILED, so callers + // can cancel in the pre v3.0 way, i.e. by finishing off the + // current operation + if (!e.match(CKR_OPERATION_CANCEL_FAILED)) { + throw new ProviderException("cancel failed", e); + } + } + } + return false; + } } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java index e86d54963d3..9cdbdfa9d6b 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java @@ -150,7 +150,7 @@ public final class SunPKCS11 extends AuthProvider { this.config = c; if (debug != null) { - System.out.println("SunPKCS11 loading " + config.getFileName()); + debug.println("SunPKCS11 loading " + config.getFileName()); } String library = config.getLibrary(); @@ -176,7 +176,6 @@ public final class SunPKCS11 extends AuthProvider { // switch to using the NSS trust attributes for trusted certs // (KeyStore). // - if (useSecmod) { // note: Config ensures library/slot/slotListIndex not specified // in secmod mode. @@ -328,8 +327,7 @@ public final class SunPKCS11 extends AuthProvider { initArgs.flags = CKF_OS_LOCKING_OK; PKCS11 tmpPKCS11; try { - tmpPKCS11 = PKCS11.getInstance( - library, functionList, initArgs, + tmpPKCS11 = PKCS11.getInstance(library, functionList, initArgs, config.getOmitInitialize()); } catch (PKCS11Exception e) { if (debug != null) { @@ -345,18 +343,18 @@ public final class SunPKCS11 extends AuthProvider { } else { initArgs.flags = 0; } - tmpPKCS11 = PKCS11.getInstance(library, - functionList, initArgs, config.getOmitInitialize()); + tmpPKCS11 = PKCS11.getInstance(library, functionList, initArgs, + config.getOmitInitialize()); } p11 = tmpPKCS11; - CK_INFO p11Info = p11.C_GetInfo(); - if (p11Info.cryptokiVersion.major < 2) { + if (p11.getVersion().major < 2) { throw new ProviderException("Only PKCS#11 v2.0 and later " - + "supported, library version is v" + p11Info.cryptokiVersion); + + "supported, library version is v" + p11.getVersion()); } boolean showInfo = config.getShowInfo(); if (showInfo) { + CK_INFO p11Info = p11.C_GetInfo(); System.out.println("Information for provider " + getName()); System.out.println("Library info:"); System.out.println(p11Info); @@ -1482,12 +1480,10 @@ public final class SunPKCS11 extends AuthProvider { } // get the pin if necessary - char[] pin = null; if ((token.tokenInfo.flags & CKF_PROTECTED_AUTHENTICATION_PATH) == 0) { // get password - CallbackHandler myHandler = getCallbackHandler(handler); if (myHandler == null) { throw new LoginException @@ -1503,6 +1499,7 @@ public final class SunPKCS11 extends AuthProvider { PasswordCallback pcall = new PasswordCallback(form.format(source), false); Callback[] callbacks = { pcall }; + try { myHandler.handle(callbacks); } catch (Exception e) { @@ -1522,13 +1519,12 @@ public final class SunPKCS11 extends AuthProvider { } // perform token login - Session session = null; try { session = token.getOpSession(); - // pin is NULL if using CKF_PROTECTED_AUTHENTICATION_PATH p11.C_Login(session.id(), CKU_USER, pin); + if (debug != null) { debug.println("login succeeded"); } diff --git a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java index a4c852f7abf..f87690bc24f 100644 --- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java +++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java @@ -110,7 +110,7 @@ public class PKCS11 { * e.g. pk2priv.dll. */ private final String pkcs11ModulePath; - + private final CK_VERSION version; private long pNativeData; /** @@ -141,13 +141,30 @@ public class PKCS11 { * path, if the driver is not in the system's search path. * * @param pkcs11ModulePath the PKCS#11 library path + * @param functionList the method name for retrieving the PKCS#11 + * function list; may be null if not set in config file * @preconditions (pkcs11ModulePath <> null) * @postconditions */ - PKCS11(String pkcs11ModulePath, String functionListName) + PKCS11(String pkcs11ModulePath, String functionList) throws IOException { - connect(pkcs11ModulePath, functionListName); + this.version = connect(pkcs11ModulePath, functionList); this.pkcs11ModulePath = pkcs11ModulePath; + // bug in native PKCS#11 lib; workaround it by calling C_GetInfo() + // and get cryptoki version from there + if (this.version.major != 2 && this.version.major != 3) { + try { + CK_INFO p11Info = C_GetInfo(); + this.version.major = p11Info.cryptokiVersion.major; + this.version.minor = p11Info.cryptokiVersion.minor; + } catch (PKCS11Exception e) { + // give up; just use what is returned by connect() + } + } + } + + public CK_VERSION getVersion() { + return version; } public static synchronized PKCS11 getInstance(String pkcs11ModulePath, @@ -186,11 +203,14 @@ public class PKCS11 { * native part. * * @param pkcs11ModulePath The PKCS#11 library path. + * @param functionList the method name for retrieving the PKCS#11 + * function list; may be null if not set in config file + * @return the actual PKCS11 interface version * @preconditions (pkcs11ModulePath <> null) * @postconditions */ - private native void connect(String pkcs11ModulePath, String functionListName) - throws IOException; + private native CK_VERSION connect(String pkcs11ModulePath, + String functionList) throws IOException; /** * Disconnects the PKCS#11 library from this object. After calling this @@ -463,6 +483,20 @@ public class PKCS11 { public native CK_SESSION_INFO C_GetSessionInfo(long hSession) throws PKCS11Exception; + /** + * C_SessionCancel terminates active session based operations. + * (Session management) (New in PKCS#11 v3.0) + * + * @param hSession the session's handle + * (PKCS#11 param: CK_SESSION_HANDLE hSession) + * @param flags indicates the operations to cancel. + * (PKCS#11 param: CK_FLAGS flags) + * @exception PKCS11Exception If function returns other value than CKR_OK. + * @preconditions + * @postconditions + */ + public native void C_SessionCancel(long hSession, long flags) + throws PKCS11Exception; /** * C_GetOperationState obtains the state of the cryptographic operation @@ -521,6 +555,24 @@ public class PKCS11 { public native void C_Login(long hSession, long userType, char[] pPin) throws PKCS11Exception; + ///** + // * C_LoginUser logs a user into a token. (New in PKCS#11 v3.0) + // * (Session management) + // * + // * @param hSession the session's handle + // * (PKCS#11 param: CK_SESSION_HANDLE hSession) + // * @param userType the user type + // * (PKCS#11 param: CK_USER_TYPE userType) + // * @param pPin the user's PIN and the length of the PIN + // * (PKCS#11 param: CK_CHAR_PTR pPin, CK_ULONG ulPinLen) + // * @param pUsername the user name and the length of the user name + // * (PKCS#11 param: CK_CHAR_PTR pUsername, CK_ULONG ulUsernameLen) + // * @exception PKCS11Exception If function returns other value than CKR_OK. + // * @preconditions + // * @postconditions + // */ + //public native void C_LoginUser(long hSession, long userType, char[] pPin, + // String pUsername) throws PKCS11Exception; /** * C_Logout logs a user out from a token. @@ -807,7 +859,6 @@ public class PKCS11 { public native int C_EncryptFinal(long hSession, long directOut, byte[] out, int outOfs, int outLen) throws PKCS11Exception; - /** * C_DecryptInit initializes a decryption operation. * (Encryption and decryption) @@ -902,8 +953,6 @@ public class PKCS11 { public native int C_DecryptFinal(long hSession, long directOut, byte[] out, int outOfs, int outLen) throws PKCS11Exception; - - /* ***************************************************************************** * Message digesting ******************************************************************************/ @@ -1624,9 +1673,9 @@ public class PKCS11 { // parent. Used for tokens that only support single threaded access static class SynchronizedPKCS11 extends PKCS11 { - SynchronizedPKCS11(String pkcs11ModulePath, String functionListName) + SynchronizedPKCS11(String pkcs11ModulePath, String functionList) throws IOException { - super(pkcs11ModulePath, functionListName); + super(pkcs11ModulePath, functionList); } synchronized void C_Initialize(Object pInitArgs) throws PKCS11Exception { @@ -1682,11 +1731,22 @@ static class SynchronizedPKCS11 extends PKCS11 { return super.C_GetSessionInfo(hSession); } - public synchronized void C_Login(long hSession, long userType, char[] pPin) + public synchronized void C_SessionCancel(long hSession, long flags) throws PKCS11Exception { + super.C_SessionCancel(hSession, flags); + } + + public synchronized void C_Login(long hSession, long userType, + char[] pPin) throws PKCS11Exception { super.C_Login(hSession, userType, pPin); } + //public synchronized void C_LoginUser(long hSession, long userType, + // char[] pPin, String pUsername) + // throws PKCS11Exception { + // super.C_LoginUser(hSession, userType, pPin, pUsername); + //} + public synchronized void C_Logout(long hSession) throws PKCS11Exception { super.C_Logout(hSession); } diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c index b06d397b09e..5209c5bbf78 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_sessmgmt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -272,6 +272,33 @@ JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSessionI } #endif +#ifdef P11_ENABLE_C_SESSIONCANCEL +/* + * Class: sun_security_pkcs11_wrapper_PKCS11 + * Method: C_SessionCancel + * Signature: (JJ)V + * Parametermapping: *PKCS11* + * @param jlong jSessionHandle CK_SESSION_HANDLE hSession + * @param jlong jFlags CK_FLAGS flags + */ +JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SessionCancel + (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong jFlags) +{ + CK_SESSION_HANDLE ckSessionHandle; + CK_RV rv; + + CK_FUNCTION_LIST_3_0_PTR ckpFunctions30 = getFunctionList30(env, obj); + if (ckpFunctions30 == NULL) { return; } + + ckSessionHandle = jLongToCKULong(jSessionHandle); + + rv = (*ckpFunctions30->C_SessionCancel)(ckSessionHandle, + jLongToCKULong(jFlags)); + + ckAssertReturnValueOK(env, rv); +} +#endif + #ifdef P11_ENABLE_C_GETOPERATIONSTATE /* * Class: sun_security_pkcs11_wrapper_PKCS11 @@ -351,7 +378,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SetOperationSt free(ckpState); - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + ckAssertReturnValueOK(env, rv); } #endif @@ -367,28 +394,83 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SetOperationSt * CK_ULONG ulPinLen */ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Login - (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong jUserType, jcharArray jPin) + (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong jUserType, + jcharArray jPin) { CK_SESSION_HANDLE ckSessionHandle; CK_USER_TYPE ckUserType; CK_CHAR_PTR ckpPinArray = NULL_PTR; CK_ULONG ckPinLength; CK_RV rv; + CK_FUNCTION_LIST_PTR ckpFunctions; - CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj); - if (ckpFunctions == NULL) { return; } + ckpFunctions = getFunctionList(env, obj); + + if (ckpFunctions == NULL) { + return; + } ckSessionHandle = jLongToCKULong(jSessionHandle); ckUserType = jLongToCKULong(jUserType); jCharArrayToCKCharArray(env, jPin, &ckpPinArray, &ckPinLength); if ((*env)->ExceptionCheck(env)) { return; } - rv = (*ckpFunctions->C_Login)(ckSessionHandle, ckUserType, ckpPinArray, ckPinLength); + rv = (*ckpFunctions->C_Login)(ckSessionHandle, ckUserType, ckpPinArray, + ckPinLength); + free(ckpPinArray); + + ckAssertReturnValueOK(env, rv); +} +#endif + +#ifdef P11_ENABLE_C_LOGINUSER +/* + * Class: sun_security_pkcs11_wrapper_PKCS11 + * Method: C_LoginUser + * Signature: (JJ[C;Ljava/lang/String;)V + * Parametermapping: *PKCS11* + * @param jlong jSessionHandle CK_SESSION_HANDLE hSession + * @param jlong jUserType CK_USER_TYPE userType + * @param jcharArray jPin CK_CHAR_PTR pPin + * CK_ULONG ulPinLen + * @param jstring jUsername CK_CHAR_PTR pUsername + * CK_ULONG ulUsernameLen + */ +JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1LoginUser + (JNIEnv *env, jobject obj, jlong jSessionHandle, jlong jUserType, + jcharArray jPin, jstring jUsername) +{ + CK_SESSION_HANDLE ckSessionHandle; + CK_USER_TYPE ckUserType; + CK_CHAR_PTR ckpPinArray = NULL_PTR; + CK_ULONG ckPinLength; + CK_CHAR_PTR ckpUsername = NULL_PTR; + CK_ULONG ckUsernameLength; + CK_RV rv; + CK_FUNCTION_LIST_3_0_PTR ckpFunctions30; + + ckpFunctions30 = getFunctionList30(env, obj); + + ckSessionHandle = jLongToCKULong(jSessionHandle); + ckUserType = jLongToCKULong(jUserType); + jCharArrayToCKCharArray(env, jPin, &ckpPinArray, &ckPinLength); + if ((*env)->ExceptionCheck(env)) { return; } + jStringToCKUTF8CharArray(env, jUsername, &ckpUsername, + &ckUsernameLength); + if ((*env)->ExceptionCheck(env)) { return; } + + if (ckpFunctions30 == NULL) { + return; + } + rv = (*ckpFunctions30->C_LoginUser)(ckSessionHandle, ckUserType, + ckpPinArray, ckPinLength, ckpUsername, ckUsernameLength); free(ckpPinArray); + free(ckpUsername); - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + ckAssertReturnValueOK(env, rv); } + #endif #ifdef P11_ENABLE_C_LOGOUT @@ -411,7 +493,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1Logout ckSessionHandle = jLongToCKULong(jSessionHandle); rv = (*ckpFunctions->C_Logout)(ckSessionHandle); - if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } + ckAssertReturnValueOK(env, rv); } #endif diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c index 520bd52a2cd..2920707a254 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/p11_util.c @@ -136,6 +136,20 @@ CK_FUNCTION_LIST_PTR getFunctionList(JNIEnv *env, jobject pkcs11Implementation) return ckpFunctions; } +CK_FUNCTION_LIST_3_0_PTR getFunctionList30(JNIEnv *env, jobject + pkcs11Implementation) { + ModuleData *moduleData; + CK_FUNCTION_LIST_3_0_PTR ckpFunctions30; + + moduleData = getModuleEntry(env, pkcs11Implementation); + if (moduleData == NULL) { + throwDisconnectedRuntimeException(env); + return NULL; + } + ckpFunctions30 = moduleData->ckFunctionList30Ptr; + return ckpFunctions30; +} + /* * Returns 1, if the given pkcs11Implementation is in the list. diff --git a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h index eb6d01b9e47..c2b6f3d94b5 100644 --- a/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h +++ b/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h @@ -100,9 +100,11 @@ #define P11_ENABLE_C_CLOSESESSION #undef P11_ENABLE_C_CLOSEALLSESSIONS #define P11_ENABLE_C_GETSESSIONINFO +#define P11_ENABLE_C_SESSIONCANCEL #define P11_ENABLE_C_GETOPERATIONSTATE #define P11_ENABLE_C_SETOPERATIONSTATE #define P11_ENABLE_C_LOGIN +//#define P11_ENABLE_C_LOGINUSER #define P11_ENABLE_C_LOGOUT #define P11_ENABLE_C_CREATEOBJECT #define P11_ENABLE_C_COPYOBJECT @@ -209,17 +211,21 @@ //#define TRACE0d(s) { printf(s); fflush(stdout); } //#define TRACE1d(s, p1) { printf(s, p1); fflush(stdout); } //#define TRACE2d(s, p1, p2) { printf(s, p1, p2); fflush(stdout); } +//#define TRACE3d(s, p1, p2, p3) { printf(s, p1, p2, p3); fflush(stdout); } +//#define TRACE4d(s, p1, p2, p3, p4) { printf(s, p1, p2, p3, p4); fflush(stdout); } #ifdef P11_DEBUG #define TRACE0(s) { printf(s); fflush(stdout); } #define TRACE1(s, p1) { printf(s, p1); fflush(stdout); } #define TRACE2(s, p1, p2) { printf(s, p1, p2); fflush(stdout); } #define TRACE3(s, p1, p2, p3) { printf(s, p1, p2, p3); fflush(stdout); } +#define TRACE4(s, p1, p2, p3, p4) { printf(s, p1, p2, p3, p4); fflush(stdout); } #else #define TRACE0(s) #define TRACE1(s, p1) #define TRACE2(s, p1, p2) #define TRACE3(s, p1, p2, p3) +#define TRACE4(s, p1, p2, p3, p4) #define TRACE_INTEND #define TRACE_UNINTEND #endif @@ -412,6 +418,8 @@ CK_RV callJUnlockMutex(CK_VOID_PTR pMutex); void putModuleEntry(JNIEnv *env, jobject pkcs11Implementation, ModuleData *moduleData); ModuleData * removeModuleEntry(JNIEnv *env, jobject pkcs11Implementation); CK_FUNCTION_LIST_PTR getFunctionList(JNIEnv *env, jobject pkcs11Implementation); +CK_FUNCTION_LIST_3_0_PTR getFunctionList30(JNIEnv *env, jobject + pkcs11Implementation); /* A structure to encapsulate the required data for a Notify callback */ struct NotifyEncapsulation { diff --git a/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c b/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c index 0105a9873b5..6cae296e8d4 100644 --- a/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c +++ b/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -72,26 +72,34 @@ /* * Class: sun_security_pkcs11_wrapper_PKCS11 * Method: connect - * Signature: (Ljava/lang/String;)V + * Signature: (Ljava/lang/String;)Lsun/security/pkcs11/wrapper/CK_VERSION; */ -JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect - (JNIEnv *env, jobject obj, jstring jPkcs11ModulePath, jstring jGetFunctionList) -{ +JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect + (JNIEnv *env, jobject obj, jstring jPkcs11ModulePath, + jstring jGetFunctionList) { + void *hModule; char *error; - CK_C_GetFunctionList C_GetFunctionList=NULL; + int i; + CK_ULONG ulCount = 0; + CK_C_GetInterfaceList C_GetInterfaceList = NULL; + CK_INTERFACE_PTR iList = NULL; + CK_C_GetInterface C_GetInterface = NULL; + CK_INTERFACE_PTR interface = NULL; + CK_C_GetFunctionList C_GetFunctionList = NULL; CK_RV rv; - ModuleData *moduleData; + ModuleData *moduleData = NULL; jobject globalPKCS11ImplementationReference; char *systemErrorMessage; char *exceptionMessage; - const char *getFunctionListStr; + const char *getFunctionListStr = NULL; - const char *libraryNameStr = (*env)->GetStringUTFChars(env, jPkcs11ModulePath, 0); + const char *libraryNameStr = (*env)->GetStringUTFChars(env, + jPkcs11ModulePath, 0); if (libraryNameStr == NULL) { - return; + return NULL; } - TRACE1("DEBUG: connect to PKCS#11 module: %s ... ", libraryNameStr); + TRACE1("Connect: connect to PKCS#11 module: %s ... ", libraryNameStr); /* * Load the PKCS #11 DLL @@ -108,39 +116,92 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect exceptionMessage = (char *) malloc(sizeof(char) * (strlen(systemErrorMessage) + strlen(libraryNameStr) + 1)); if (exceptionMessage == NULL) { throwOutOfMemoryError(env, 0); - (*env)->ReleaseStringUTFChars(env, jPkcs11ModulePath, libraryNameStr); - return; + goto cleanup; } strcpy(exceptionMessage, systemErrorMessage); strcat(exceptionMessage, libraryNameStr); throwIOException(env, exceptionMessage); - (*env)->ReleaseStringUTFChars(env, jPkcs11ModulePath, libraryNameStr); free(exceptionMessage); - return; + goto cleanup; } - (*env)->ReleaseStringUTFChars(env, jPkcs11ModulePath, libraryNameStr); - /* - * Get function pointer to C_GetFunctionList - */ - dlerror(); /* clear any old error message not fetched */ - // with the old JAR file jGetFunctionList is null, temporarily check for that + // clear any old error message not fetched + dlerror(); + +#ifdef DEBUG + C_GetInterfaceList = (CK_C_GetInterfaceList) dlsym(hModule, + "C_GetInterfaceList"); + if (C_GetInterfaceList != NULL) { + TRACE0("Connect: Found C_GetInterfaceList func\n"); + rv = (C_GetInterfaceList)(NULL, &ulCount); + if (rv == CKR_OK) { + TRACE1("Connect: interface list size %ld \n", ulCount); + // retrieve available interfaces and report their info + iList = (CK_INTERFACE_PTR) + malloc(ulCount*sizeof(CK_INTERFACE)); + rv = C_GetInterfaceList(iList, &ulCount); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { + TRACE0("Connect: error polling interface list\n"); + goto cleanup; + } + for (i=0; i < (int)ulCount; i++) { + TRACE4("Connect: name %s, version %d.%d, flags 0x%lX\n", + iList[i].pInterfaceName, + ((CK_VERSION *)iList[i].pFunctionList)->major, + ((CK_VERSION *)iList[i].pFunctionList)->minor, + iList[i].flags); + } + } else { + TRACE0("Connect: error polling interface list size\n"); + } + } else { + TRACE0("Connect: No C_GetInterfaceList func\n"); + } +#endif + if (jGetFunctionList != NULL) { - getFunctionListStr = (*env)->GetStringUTFChars(env, jGetFunctionList, 0); + getFunctionListStr = (*env)->GetStringUTFChars(env, + jGetFunctionList, 0); if (getFunctionListStr == NULL) { - return; + goto cleanup; } - C_GetFunctionList = (CK_C_GetFunctionList) dlsym(hModule, getFunctionListStr); - (*env)->ReleaseStringUTFChars(env, jGetFunctionList, getFunctionListStr); - } - if (C_GetFunctionList == NULL) { - throwIOException(env, "ERROR: C_GetFunctionList == NULL"); - return; - } else if ( (systemErrorMessage = dlerror()) != NULL ){ - throwIOException(env, systemErrorMessage); - return; + C_GetFunctionList = (CK_C_GetFunctionList) dlsym(hModule, + getFunctionListStr); + if ((systemErrorMessage = dlerror()) != NULL){ + throwIOException(env, systemErrorMessage); + goto cleanup; + } + if (C_GetFunctionList == NULL) { + TRACE1("Connect: No %s func\n", getFunctionListStr); + throwIOException(env, "ERROR: C_GetFunctionList == NULL"); + goto cleanup; + } + TRACE1("Connect: Found %s func\n", getFunctionListStr); + } else { + // if none specified, then we try 3.0 API first before trying 2.40 + C_GetInterface = (CK_C_GetInterface) dlsym(hModule, "C_GetInterface"); + if ((C_GetInterface != NULL) && (dlerror() == NULL)) { + TRACE0("Connect: Found C_GetInterface func\n"); + rv = (C_GetInterface)(NULL, NULL, &interface, 0L); + if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { + goto setModuleData; + } + } + C_GetFunctionList = (CK_C_GetFunctionList) dlsym(hModule, + "C_GetFunctionList"); + if ((systemErrorMessage = dlerror()) != NULL){ + throwIOException(env, systemErrorMessage); + goto cleanup; + } + if (C_GetFunctionList == NULL) { + TRACE0("Connect: No C_GetFunctionList func\n"); + throwIOException(env, "ERROR: C_GetFunctionList == NULL"); + goto cleanup; + } + TRACE0("Connect: Found C_GetFunctionList func\n"); } +setModuleData: /* * Get function pointers to all PKCS #11 functions */ @@ -148,19 +209,56 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect if (moduleData == NULL) { dlclose(hModule); throwOutOfMemoryError(env, 0); - return; + goto cleanup; } moduleData->hModule = hModule; moduleData->applicationMutexHandler = NULL; - rv = (C_GetFunctionList)(&(moduleData->ckFunctionListPtr)); + if (C_GetFunctionList != NULL) { + rv = (C_GetFunctionList)(&(moduleData->ckFunctionListPtr)); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { + goto cleanup; + } + } else if (interface != NULL) { + moduleData->ckFunctionListPtr = interface->pFunctionList; + if (((CK_VERSION *)moduleData->ckFunctionListPtr)->major == 3) { + moduleData->ckFunctionList30Ptr = interface->pFunctionList; + } + } else { + // should never happen + throwIOException(env, "ERROR: No function list ptr found"); + goto cleanup; + } + if (((CK_VERSION *)moduleData->ckFunctionListPtr)->major == 3) { + moduleData->ckFunctionList30Ptr = interface->pFunctionList; + } else { + moduleData->ckFunctionList30Ptr = NULL; + } + + TRACE2("Connect: FunctionListPtr version = %d.%d\n", + ((CK_VERSION *)moduleData->ckFunctionListPtr)->major, + ((CK_VERSION *)moduleData->ckFunctionListPtr)->minor); + globalPKCS11ImplementationReference = (*env)->NewGlobalRef(env, obj); putModuleEntry(env, globalPKCS11ImplementationReference, moduleData); - TRACE0("FINISHED\n"); - - if(ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } +cleanup: + if (jPkcs11ModulePath != NULL && libraryNameStr != NULL) { + (*env)->ReleaseStringUTFChars(env, jPkcs11ModulePath, libraryNameStr); + } + if (jGetFunctionList != NULL && getFunctionListStr != NULL) { + (*env)->ReleaseStringUTFChars(env, jGetFunctionList, + getFunctionListStr); + } + TRACE0("Connect: FINISHED\n"); + if (moduleData != NULL) { + return ckVersionPtrToJVersion(env, + (CK_VERSION *)moduleData->ckFunctionListPtr); + } else { + return NULL; + } } + /* * Class: sun_security_pkcs11_wrapper_PKCS11 * Method: disconnect diff --git a/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h b/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h index 0d8cb363374..676e3ab5d4c 100644 --- a/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h +++ b/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/p11_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. */ /* @@ -83,8 +83,9 @@ struct ModuleData { /* the module (DLL or shared library) handle */ void *hModule; - /* The pointer to the PKCS#11 functions of this module. */ + /* The pointers to the PKCS#11 functions of this module. */ CK_FUNCTION_LIST_PTR ckFunctionListPtr; + CK_FUNCTION_LIST_3_0_PTR ckFunctionList30Ptr; /* Reference to the object to use for mutex handling. NULL, if not used. */ jobject applicationMutexHandler; diff --git a/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.c b/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.c index 145ad7f5693..ea005664dff 100644 --- a/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.c +++ b/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 2002 Graz University of Technology. All rights reserved. @@ -72,16 +72,22 @@ /* * Class: sun_security_pkcs11_wrapper_PKCS11 * Method: connect - * Signature: (Ljava/lang/String;)V + * Signature: (Ljava/lang/String;)Lsun/security/pkcs11/wrapper/CK_VERSION; */ -JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect +JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect (JNIEnv *env, jobject obj, jstring jPkcs11ModulePath, - jstring jGetFunctionList) + jstring jGetFunctionList) { HINSTANCE hModule; - CK_C_GetFunctionList C_GetFunctionList; + int i = 0; + CK_ULONG ulCount = 0; + CK_C_GetInterfaceList C_GetInterfaceList = NULL; + CK_INTERFACE_PTR iList = NULL; + CK_C_GetInterface C_GetInterface = NULL; + CK_INTERFACE_PTR interface = NULL; + CK_C_GetFunctionList C_GetFunctionList = NULL; CK_RV rv = CK_ASSERT_OK; - ModuleData *moduleData; + ModuleData *moduleData = NULL; jobject globalPKCS11ImplementationReference; LPVOID lpMsgBuf = NULL; char *exceptionMessage = NULL; @@ -91,10 +97,9 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect jPkcs11ModulePath, 0); TRACE1("DEBUG: connect to PKCS#11 module: %s ... ", libraryNameStr); - - /* - * Load the PKCS #11 DLL - */ + /* + * Load the PKCS #11 DLL + */ hModule = LoadLibrary(libraryNameStr); if (hModule == NULL) { FormatMessage( @@ -120,29 +125,93 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect goto cleanup; } +#ifdef DEBUG /* - * Get function pointer to C_GetFunctionList + * Get function pointer to C_GetInterfaceList */ - getFunctionListStr = (*env)->GetStringUTFChars(env, jGetFunctionList, 0); - C_GetFunctionList = (CK_C_GetFunctionList) GetProcAddress(hModule, - getFunctionListStr); - (*env)->ReleaseStringUTFChars(env, jGetFunctionList, getFunctionListStr); - if (C_GetFunctionList == NULL) { - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - 0, /* Default language */ - (LPTSTR) &lpMsgBuf, - 0, - NULL - ); - throwIOException(env, (LPTSTR) lpMsgBuf); - goto cleanup; + C_GetInterfaceList = (CK_C_GetInterfaceList) GetProcAddress(hModule, + "C_GetInterfaceList"); + if (C_GetInterfaceList != NULL) { + TRACE0("Found C_GetInterfaceList func\n"); + rv = (C_GetInterfaceList)(NULL, &ulCount); + if (rv == CKR_OK) { + /* get copy of interfaces */ + iList = (CK_INTERFACE_PTR) + malloc(ulCount*sizeof(CK_INTERFACE)); + rv = C_GetInterfaceList(iList, &ulCount); + for (i=0; i < (int)ulCount; i++) { + printf("interface %s version %d.%d funcs %p flags 0x%lu\n", + iList[i].pInterfaceName, + ((CK_VERSION *)iList[i].pFunctionList)->major, + ((CK_VERSION *)iList[i].pFunctionList)->minor, + iList[i].pFunctionList, iList[i].flags); + } + } else { + TRACE0("Connect: error polling interface list size\n"); + } + } else { + TRACE0("Connect: No C_GetInterfaceList func\n"); + } +#endif + + if (jGetFunctionList != NULL) { + getFunctionListStr = (*env)->GetStringUTFChars(env, + jGetFunctionList, 0); + if (getFunctionListStr == NULL) { + goto cleanup; + } + C_GetFunctionList = (CK_C_GetFunctionList) GetProcAddress(hModule, + getFunctionListStr); + if (C_GetFunctionList == NULL) { + TRACE1("Connect: No %s func\n", getFunctionListStr); + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + 0, /* Default language */ + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + throwIOException(env, (LPTSTR) lpMsgBuf); + goto cleanup; + } + TRACE1("Connect: Found %s func\n", getFunctionListStr); + } else { + // if none specified, then we try 3.0 API first before trying 2.40 + C_GetInterface = (CK_C_GetInterface) GetProcAddress(hModule, + "C_GetInterface"); + if (C_GetInterface != NULL) { + TRACE0("Connect: Found C_GetInterface func\n"); + rv = (C_GetInterface)(NULL, NULL, &interface, 0); + if (ckAssertReturnValueOK(env, rv) == CK_ASSERT_OK) { + goto setModuleData; + } + } + C_GetFunctionList = (CK_C_GetFunctionList) GetProcAddress(hModule, + "C_GetFunctionList"); + if (C_GetFunctionList == NULL) { + TRACE0("Connect: No C_GetFunctionList func\n"); + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + 0, /* Default language */ + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + throwIOException(env, (LPTSTR) lpMsgBuf); + goto cleanup; + } + TRACE0("Connect: Found C_GetFunctionList func\n"); } +setModuleData: /* * Get function pointers to all PKCS #11 functions */ @@ -153,12 +222,31 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect } moduleData->hModule = hModule; moduleData->applicationMutexHandler = NULL; - rv = (C_GetFunctionList)(&(moduleData->ckFunctionListPtr)); + if (C_GetFunctionList != NULL) { + rv = (C_GetFunctionList)(&(moduleData->ckFunctionListPtr)); + if (ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { + goto cleanup; + } + } else if (interface != NULL) { + moduleData->ckFunctionListPtr = interface->pFunctionList; + } else { + // should never happen + throwIOException(env, "ERROR: No function list ptr found"); + goto cleanup; + } + if (((CK_VERSION *)moduleData->ckFunctionListPtr)->major == 3) { + moduleData->ckFunctionList30Ptr = interface->pFunctionList; + } else { + moduleData->ckFunctionList30Ptr = NULL; + } + + TRACE2("Connect: FunctionListPtr version = %d.%d\n", + ((CK_VERSION *)moduleData->ckFunctionListPtr)->major, + ((CK_VERSION *)moduleData->ckFunctionListPtr)->minor); + globalPKCS11ImplementationReference = (*env)->NewGlobalRef(env, obj); putModuleEntry(env, globalPKCS11ImplementationReference, moduleData); - TRACE0("FINISHED\n"); - cleanup: /* Free up allocated buffers we no longer need */ if (lpMsgBuf != NULL) { @@ -167,11 +255,21 @@ cleanup: if (libraryNameStr != NULL) { (*env)->ReleaseStringUTFChars(env, jPkcs11ModulePath, libraryNameStr); } + if (jGetFunctionList != NULL && getFunctionListStr != NULL) { + (*env)->ReleaseStringUTFChars(env, jGetFunctionList, + getFunctionListStr); + } if (exceptionMessage != NULL) { free(exceptionMessage); } + TRACE0("Connect: FINISHED\n"); + if (moduleData != NULL) { + return ckVersionPtrToJVersion(env, + (CK_VERSION *)moduleData->ckFunctionListPtr); + } else { + return NULL; + } - if(ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) { return; } } /* diff --git a/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.h b/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.h index 7cff0c7c249..0a069d5bc97 100644 --- a/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.h +++ b/src/jdk.crypto.cryptoki/windows/native/libj2pkcs11/p11_md.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. */ /* @@ -93,8 +93,9 @@ struct ModuleData { HINSTANCE hModule; - /* The pointer to the PKCS#11 functions of this module. */ + /* The pointers to the PKCS#11 functions of this module. */ CK_FUNCTION_LIST_PTR ckFunctionListPtr; + CK_FUNCTION_LIST_3_0_PTR ckFunctionList30Ptr; /* Reference to the object to use for mutex handling. NULL, if not used. */ jobject applicationMutexHandler; -- GitLab From 352435581e4354741684d66df8a33b1fbdb96162 Mon Sep 17 00:00:00 2001 From: Zhiqiang Zang Date: Thu, 9 Dec 2021 00:18:59 +0000 Subject: [PATCH 696/890] 8277882: New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x" Reviewed-by: dlong, iveresov --- src/hotspot/share/opto/subnode.cpp | 44 ++++-- .../c2/TestSubIdealC0Minus_YPlusC1_.java | 133 ++++++++++++++++++ .../vm/compiler/SubIdealC0Minus_YPlusC1_.java | 110 +++++++++++++++ 3 files changed, 272 insertions(+), 15 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestSubIdealC0Minus_YPlusC1_.java create mode 100644 test/micro/org/openjdk/bench/vm/compiler/SubIdealC0Minus_YPlusC1_.java diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp index 5956b1738f1..48d9473f439 100644 --- a/src/hotspot/share/opto/subnode.cpp +++ b/src/hotspot/share/opto/subnode.cpp @@ -196,16 +196,23 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){ } } - - // Convert "x - (y+c0)" into "(x-y) - c0" + // Convert "x - (y+c0)" into "(x-y) - c0" AND + // Convert "c1 - (y+c0)" into "(c1-c0) - y" // Need the same check as in above optimization but reversed. - if (op2 == Op_AddI && ok_to_convert(in2, in1)) { + if (op2 == Op_AddI + && ok_to_convert(in2, in1) + && in2->in(2)->Opcode() == Op_ConI) { + jint c0 = phase->type(in2->in(2))->isa_int()->get_con(); Node* in21 = in2->in(1); - Node* in22 = in2->in(2); - const TypeInt* tcon = phase->type(in22)->isa_int(); - if (tcon != NULL && tcon->is_con()) { - Node* sub2 = phase->transform( new SubINode(in1, in21) ); - Node* neg_c0 = phase->intcon(- tcon->get_con()); + if (in1->Opcode() == Op_ConI) { + // Match c1 + jint c1 = phase->type(in1)->isa_int()->get_con(); + Node* sub2 = phase->intcon(java_subtract(c1, c0)); + return new SubINode(sub2, in21); + } else { + // Match x + Node* sub2 = phase->transform(new SubINode(in1, in21)); + Node* neg_c0 = phase->intcon(-c0); return new AddINode(sub2, neg_c0); } } @@ -374,15 +381,22 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } - // Convert "x - (y+c0)" into "(x-y) - c0" + // Convert "x - (y+c0)" into "(x-y) - c0" AND + // Convert "c1 - (y+c0)" into "(c1-c0) - y" // Need the same check as in above optimization but reversed. - if (op2 == Op_AddL && ok_to_convert(in2, in1)) { + if (op2 == Op_AddL + && ok_to_convert(in2, in1) + && in2->in(2)->Opcode() == Op_ConL) { + jlong c0 = phase->type(in2->in(2))->isa_long()->get_con(); Node* in21 = in2->in(1); - Node* in22 = in2->in(2); - const TypeLong* tcon = phase->type(in22)->isa_long(); - if (tcon != NULL && tcon->is_con()) { - Node* sub2 = phase->transform( new SubLNode(in1, in21) ); - Node* neg_c0 = phase->longcon(- tcon->get_con()); + if (in1->Opcode() == Op_ConL) { + // Match c1 + jlong c1 = phase->type(in1)->isa_long()->get_con(); + Node* sub2 = phase->longcon(java_subtract(c1, c0)); + return new SubLNode(sub2, in21); + } else { + Node* sub2 = phase->transform(new SubLNode(in1, in21)); + Node* neg_c0 = phase->longcon(-c0); return new AddLNode(sub2, neg_c0); } } diff --git a/test/hotspot/jtreg/compiler/c2/TestSubIdealC0Minus_YPlusC1_.java b/test/hotspot/jtreg/compiler/c2/TestSubIdealC0Minus_YPlusC1_.java new file mode 100644 index 00000000000..b623e1a2393 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestSubIdealC0Minus_YPlusC1_.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021, 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 8277882 + * @summary New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x" + * @library /test/lib + * @run main/othervm -XX:-TieredCompilation -Xbatch + * -XX:CompileCommand=dontinline,compiler.c2.TestSubIdealC0Minus_YPlusC1_::test* + * -XX:CompileCommand=compileonly,compiler.c2.TestSubIdealC0Minus_YPlusC1_::test* + * compiler.c2.TestSubIdealC0Minus_YPlusC1_ + */ +package compiler.c2; + +import jdk.test.lib.Asserts; + +public class TestSubIdealC0Minus_YPlusC1_ { + + private static final int I_C0_0 = 1234; + private static final int I_C1 = 1234; + private static final int I_C0_1 = 4321; + + private static final long L_C0_0 = 123_456_789_123L; + private static final long L_C1 = 123_456_789_123L; + private static final long L_C0_1 = 654_321; + + public static int testIC0EqualsC1(int x) { + return I_C0_0 - (x + I_C1); + } + + public static long testLC0EqualsC1(long x) { + return L_C0_0 - (x + L_C1); + } + + public static int testIC0NotEqualsC1(int x) { + return I_C0_1 - (x + I_C1); + } + + public static long testLC0NotEqualsC1(long x) { + return L_C0_1 - (x + L_C1); + } + + public static int testIXPlusC1IsOverflow(int x) { + return Integer.MAX_VALUE - (x + Integer.MAX_VALUE); + } + + public static long testLXPlusC1IsOverflow(long x) { + return Long.MAX_VALUE - (x + Long.MAX_VALUE); + } + + public static int testIXPlusC1IsUnderflow(int x) { + return Integer.MIN_VALUE - (x + Integer.MIN_VALUE); + } + + public static long testLXPlusC1IsUnderflow(long x) { + return Long.MIN_VALUE - (x + Long.MIN_VALUE); + } + + public static int testIC0MinusC1IsOverflow(int x) { + return Integer.MAX_VALUE - (x + Integer.MIN_VALUE); + } + + public static long testLC0MinusC1IsOverflow(long x) { + return Long.MAX_VALUE - (x + Long.MIN_VALUE); + } + + public static int testIC0MinusC1IsUnderflow(int x) { + return Integer.MIN_VALUE - (x + Integer.MAX_VALUE); + } + + public static long testLC0MinusC1IsUnderflow(long x) { + return Long.MIN_VALUE - (x + Long.MAX_VALUE); + } + + public static int testIResultIsOverflow(int x) { + return 2147483637 - (x + 10); // Integer.MAX_VALUE == 2147483647 + } + + public static long testLResultIsOverflow(long x) { + return 9223372036854775797L - (x + 10); // Long.MAX_VALUE == 9223372036854775807 + } + + public static int testIResultIsUnderflow(int x) { + return -2147483637 - (x + 10); // Integer.MIN_VALUE == -2147483648 + } + + public static long testLResultIsUnderflow(long x) { + return -9223372036854775797L - (x + 10); // Long.MIN_VALUE == -9223372036854775808 + } + + public static void main(String... args) { + for (int i = 0; i < 50_000; i++) { + Asserts.assertTrue(testIC0EqualsC1(10) == -10); + Asserts.assertTrue(testIC0NotEqualsC1(100) == 2987); + Asserts.assertTrue(testIXPlusC1IsOverflow(10) == -10); + Asserts.assertTrue(testIXPlusC1IsUnderflow(-10) == 10); + Asserts.assertTrue(testIC0MinusC1IsOverflow(10) == -11); + Asserts.assertTrue(testIC0MinusC1IsUnderflow(10) == -9); + Asserts.assertTrue(testIResultIsOverflow(-21) == Integer.MIN_VALUE); + Asserts.assertTrue(testIResultIsUnderflow(2) == Integer.MAX_VALUE); + + Asserts.assertTrue(testLC0EqualsC1(10) == -10); + Asserts.assertTrue(testLC0NotEqualsC1(100) == -123456134902L); + Asserts.assertTrue(testLXPlusC1IsOverflow(10) == -10); + Asserts.assertTrue(testLXPlusC1IsUnderflow(-10) == 10); + Asserts.assertTrue(testLC0MinusC1IsOverflow(10) == -11); + Asserts.assertTrue(testLC0MinusC1IsUnderflow(10) == -9); + Asserts.assertTrue(testLResultIsOverflow(-21) == Long.MIN_VALUE); + Asserts.assertTrue(testLResultIsUnderflow(2) == Long.MAX_VALUE); + } + } +} diff --git a/test/micro/org/openjdk/bench/vm/compiler/SubIdealC0Minus_YPlusC1_.java b/test/micro/org/openjdk/bench/vm/compiler/SubIdealC0Minus_YPlusC1_.java new file mode 100644 index 00000000000..17728f6bc25 --- /dev/null +++ b/test/micro/org/openjdk/bench/vm/compiler/SubIdealC0Minus_YPlusC1_.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2021, 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 org.openjdk.bench.vm.compiler; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.CompilerControl; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +import java.util.concurrent.TimeUnit; + +/** + * Tests transformation that converts "c0 - (x + c1)" into "(c0 - c1) + * - x" in SubINode::Ideal and SubLNode::Ideal. + */ +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@State(Scope.Thread) +@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(value = 3 , jvmArgsAppend = {"-XX:-TieredCompilation", "-Xbatch", "-Xcomp"}) +public class SubIdealC0Minus_YPlusC1_ { + + private static final int I_C0 = 1234567; + + private static final int I_C1 = 1234567; + + private static final long L_C0 = 123_456_789_123_456L; + + private static final long L_C1 = 123_456_789_123_456L; + + private final int size = 100_000_000; + + private int[] ints_a; + + private long[] longs_a; + + @Setup + public void init() { + ints_a = new int[size]; + longs_a = new long[size]; + for (int i = 0; i < size; i++) { + ints_a[i] = i; + longs_a[i] = i * i; + } + } + + @Benchmark + public void baseline() { + for (int i = 0; i < size; i++) { + sink(ints_a[i]); + sink(longs_a[i]); + } + } + + @Benchmark + public void test() { + for (int i = 0; i < size; i++) { + sink(helper(ints_a[i])); + sink(helper(longs_a[i])); + } + } + + // Convert "c0 - (x + c1)" into "(c0 - c1) - x" for int. + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + private static int helper(int x) { + return I_C0 - (x + I_C1); + } + + // Convert "c0 - (x + c1)" into "(c0 - c1) - x" for long. + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + private static long helper(long x) { + return L_C0 - (x + L_C1); + } + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + private static void sink(int v) {} + + @CompilerControl(CompilerControl.Mode.DONT_INLINE) + private static void sink(long v) {} +} -- GitLab From 8ef1a232b100dbac72356ca4844d01964f3d5287 Mon Sep 17 00:00:00 2001 From: Alexey Semenyuk Date: Thu, 9 Dec 2021 02:31:29 +0000 Subject: [PATCH 697/890] 8278311: Debian packaging doesn't work Reviewed-by: almatvee --- .../internal/OverridableResource.java | 32 +++++++++++++++++-- .../internal/OverridableResourceTest.java | 8 ++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java index 9680691bc5d..c455ef71500 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java @@ -36,6 +36,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -279,11 +281,35 @@ final class OverridableResource { private static Stream substitute(Stream lines, Map substitutionData) { + // Order substitution data by the length of keys. + // Longer keys go first. + // This is needed to properly handle cases when one key is + // a subtring of another and try the later first. + var orderedEntries = substitutionData.entrySet().stream() + .sorted(Map.Entry.comparingByKey( + Comparator.comparingInt(String::length)).reversed()) + .toList(); return lines.map(line -> { String result = line; - for (var entry : substitutionData.entrySet()) { - result = result.replace(entry.getKey(), Optional.ofNullable( - entry.getValue()).orElse("")); + var workEntries = orderedEntries; + var it = workEntries.listIterator(); + while (it.hasNext()) { + var entry = it.next(); + String newResult = result.replace(entry.getKey(), + Optional.ofNullable(entry.getValue()).orElse("")); + if (!newResult.equals(result)) { + // Substitution occured. + // Remove the matching substitution key from the list and + // go over the list of substitution entries again. + if (workEntries == orderedEntries) { + workEntries = new ArrayList<>(orderedEntries); + it = workEntries.listIterator(it.nextIndex() - 1); + it.next(); + } + it.remove(); + it = workEntries.listIterator(); + result = newResult; + } } return result; }); diff --git a/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java index 55a3c22dc9a..7b00a60acf0 100644 --- a/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java @@ -136,16 +136,16 @@ public class OverridableResourceTest { } private void testCustomtWithSubstitution(String defaultName) throws IOException { - final List resourceData = List.of("A", "[BB]", "C", "Foo", - "GoodbyeHello"); + final List resourceData = List.of("A", "[BB]", "C", "Foo", "Foo", + "GoodbyeHello", "_B"); final Path customFile = createCustomFile("foo", resourceData); final Map substitutionData = new HashMap(Map.of("B", - "Bar", "Foo", "B")); + "Bar", "Foo", "B", "_B", "JJ")); substitutionData.put("Hello", null); final List expectedResourceData = List.of("A", "[BarBar]", "C", - "B", "Goodbye"); + "Bar", "Bar", "Goodbye", "JJ"); final List actualResourceData = convertToStringList(saveToFile( new OverridableResource(defaultName) -- GitLab From d1706828fb6a95ecad2bab4112b2e1a7d3319df8 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Thu, 9 Dec 2021 02:53:52 +0000 Subject: [PATCH 698/890] 8278466: "spurious markup" warnings in snippets when building `docs-reference` Reviewed-by: darcy --- .../share/classes/javax/tools/JavaFileManager.java | 2 +- .../share/classes/javax/tools/StandardJavaFileManager.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java index 20178303b2f..1fe510e809d 100644 --- a/src/java.compiler/share/classes/javax/tools/JavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/JavaFileManager.java @@ -82,7 +82,7 @@ import static javax.tools.JavaFileObject.Kind; * section 3.3. Informally, this should be true: * * {@snippet id="valid-relative-name" lang=java : - * // @link substring="create" target="URI#create" : @link substring=normalize target="URI#normalize" : @link substring=getPath target="URI#getPath" : + * // @link substring="create" target="URI#create" @link substring=normalize target="URI#normalize" @link substring=getPath target="URI#getPath" : * URI.create(relativeName).normalize().getPath().equals(relativeName) * } * diff --git a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java index 936cb0aeacc..be2b0cb4cd5 100644 --- a/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java +++ b/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java @@ -76,7 +76,7 @@ import java.util.List; * must succeed if the following would succeed (ignoring * encoding issues): * {@snippet id="equiv-input" lang=java : - * // @link substring=FileInputStream target="java.io.FileInputStream#FileInputStream(File)" : @link regex="File\W" target="File#File(java.net.URI)" : @link substring=fileObject target=FileObject : @link substring=toURI target="FileObject#toUri()" : + * // @link substring=FileInputStream target="java.io.FileInputStream#FileInputStream(File)" @link regex="File\b" target="File#File(java.net.URI)" @link substring=fileObject target=FileObject @link substring=toURI target="FileObject#toUri()" : * new FileInputStream(new File(fileObject.toURI())) * } * @@ -87,7 +87,7 @@ import java.util.List; * succeed if the following would succeed (ignoring encoding * issues): * {@snippet id="equiv-output" lang=java : - * // @link substring=FileOutputStream target="java.io.FileOutputStream#FileOutputStream(File)" : @link regex="File\W" target="File#File(java.net.URI)" : @link substring=fileObject target=FileObject : @link substring=toURI target="FileObject#toUri()" : + * // @link substring=FileOutputStream target="java.io.FileOutputStream#FileOutputStream(File)" @link regex="File\b" target="File#File(java.net.URI)" @link substring=fileObject target=FileObject @link substring=toURI target="FileObject#toUri()" : * new FileOutputStream(new File(fileObject.toURI())) * } * -- GitLab From 62a7f5d3236ab2248518a475b1d8b71cb4bf1313 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 9 Dec 2021 06:50:56 +0000 Subject: [PATCH 699/890] 8254318: Remove .hgtags Reviewed-by: erikj, xliu --- .hgtags | 664 -------------------------------------------------------- 1 file changed, 664 deletions(-) delete mode 100644 .hgtags diff --git a/.hgtags b/.hgtags deleted file mode 100644 index ef4ec35e2f2..00000000000 --- a/.hgtags +++ /dev/null @@ -1,664 +0,0 @@ -3cc80be736f24704e505ad8ddaa598dec3fa2ed3 jdk-9+181 -e2b70be325bd10dae4c06f74c46d70d480854916 jdk-9+179 -5b16a1c3ccffff2a82c88bb7ea894c4ff1c9ebde jdk-9+180 -43bf6f30fcba031ecf0cc7e511efe3a8179d0f77 jdk-9+176 -d9f6bc6ba599d0487dc18b2fbdb6c34eedf6f958 jdk-9+177 -bc9df7dd63ec76f50fafeb4acc44465044662f0a jdk-9+178 -994036e74ab805bcc09afa0646be17a725bec42f jdk-9+175 -94680c6d60ecd9ed3ffd1847706efde7eb947afc jdk-9+174 -6dd7fda42bab7ecf648cafb0a4e9b4ca11b3094f jdk-9+173 -dad6746278facbbea57dd462cb56fb743dc0a5f0 jdk-9+172 -643b5f18c2656fe91b69fea85b07b98d5fad394d jdk-9+171 -898cbe31fbdae2d25d141384fac746cc244a730c jdk-9+170 -c7efde2b60fc1ec04630be769d9ad60efb39c39c jdk-9+169 -8fd0a4569191f33c98ee90c2709174a342fefb0d jdk-9+167 -fcabc74bd44e56c7419d111d59b95669ecb33c55 jdk-9+168 -d3e973f1809606c67412361041ad197e50fe8cec jdk-9+166 -3965b747cfe1e6cbd66b8739da5a1ea6ec6985e9 jdk-9+165 -d16aebbb56d37f12e0c0b0a4fb427db65e1fb1a8 jdk-9+162 -18c41483a082e097ac2f5f983c1226ed94aa4215 jdk-9+163 -32db52c675e7d5bc413605d2e89b68b608b19be0 jdk-9+164 -fd1497902bbe3aa24b21f270ecdcb8de5f7aa9ac jdk-9+159 -6aa8be0c4e054fe8b3ab016ae00d16d680f92145 jdk-9+160 -f6883b1a5a6478437cd4181c4bd45328ab24feaf jdk-9+161 -fa3e76b477829afc4476f0b725cfaa440a6fd917 jdk-9+157 -b5015f742ba648184bb7fc547197bd33ebfde30d jdk-9+158 -1cc8dd79fd1cd13d36b385196271a29632c67c3b jdk7-b24 -bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25 -5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26 -67052ac87fc927d048e62ec54ff42adb230d3f7c jdk7-b27 -18dc4ba4739a537fd146f77da51db16efce28da2 jdk7-b28 -bfe4572fd301a6fcd120373cdb2eff5d2da0c72c jdk7-b29 -bee4731164a06ddece1297ae58db24aca6a1c626 jdk7-b30 -cd8b8f500face60d1566d850857a7fccadbd383a jdk7-b31 -a9f1805e3ba9ca520cad199d522c84af5433e85a jdk7-b32 -6838c1a3296aaa3572364d2ce7d70826cee96286 jdk7-b33 -90cf935adb353bb0af4b46fb0677e841fd24c000 jdk7-b34 -6d909d5803e3a22850e6c4e5a75b888742ee7e20 jdk7-b35 -d718a441936196b93d8bc9f084933af9a4c2a350 jdk7-b36 -c2036bf76829c03b99108fffab52e20910a9be4f jdk7-b37 -a2879b2837f5a4c87e9542efe69ef138194af8ff jdk7-b38 -126f365cec6c3c2c72de934fa1c64b5f082b55b5 jdk7-b39 -3c53424bbe3bb77e01b468b4b0140deec33e11fc jdk7-b40 -3cb2a607c347934f8e7e86f840a094c28b08d9ea jdk7-b41 -caf58ffa084568990cbb3441f9ae188e36b31770 jdk7-b42 -41bd0a702bc8ec6feebd725a63e7c3227f82ab11 jdk7-b43 -5843778bda89b1d5ac8e1aa05e26930ac90b3145 jdk7-b44 -54dffad0bf066791a2793305875250c395011d5f jdk7-b45 -04b2620edc72de93671646e4720c5992c74ac8b5 jdk7-b46 -0c4657194eec95c08ba478aee9cfc3c295e41657 jdk7-b47 -1bf51a4c2627c2f0e0cbcc2cf0421bdb37f1f2b2 jdk7-b48 -6b84b04a80afe23262377c60913eebfc898f14c4 jdk7-b49 -5da0e6b9f4f18ef483c977337214b12ee0e1fc8f jdk7-b50 -a25c5ec5e40e07733d1ff9898a0abe36159288ff jdk7-b51 -7a90e89e36d103038f8667f6a7daae34ecfa1ad8 jdk7-b52 -d52186ee770dac57950536cd00ccbfdef360b04c jdk7-b53 -15096652c4d48dfb9fc0b2cb135304db94c65ba0 jdk7-b54 -c8b275d62d6b0a980c510e839b70292245863e85 jdk7-b55 -a8134c4ee2cf451cf9b5e1609f39d83ecd53acc5 jdk7-b56 -b44f05654c26fcd1f995e712992f9b07ffd7c0c6 jdk7-b57 -d60a9ce3c3eabf28f5d50ae839d18be04a551bc2 jdk7-b58 -c33e7d38c9210741dbc285507403a4b20bd802a0 jdk7-b59 -5a10e4d0b14d7beac53a7b2213ae6864afe1fd3e jdk7-b60 -dbb955b1ee59b876dd1f133952b557b48b1d7732 jdk7-b61 -6107cbff3130c747d243c25a7874cd59db5744a8 jdk7-b62 -dfd8506f74c3731bb169ce93c72612d78ee0413b jdk7-b63 -d22867c5f1b295a0a2b3b4bc8999a2676f6e20c3 jdk7-b64 -7d3bf00f3cc4f8125de1842521e7567f37dc84b8 jdk7-b65 -62109d1b9e7310f29ab51ca6f1d71b899c0ce6b0 jdk7-b66 -eb24af1404aec8aa140c4cd4d13d2839b150dd41 jdk7-b67 -bca2225b66d78c4bf4d9801f54cac7715a598650 jdk7-b68 -1b662b1ed14eb4ae31d5138a36c433b13d941dc5 jdk7-b69 -207f694795c448c17753eff1a2f50363106960c2 jdk7-b70 -c5d39b6be65cba0effb5f466ea48fe43764d0e0c jdk7-b71 -df4bcd06e1d0ab306efa5a44f24a409dc0c0c742 jdk7-b72 -ce74bd35ce948d629a356e168797f44b593b1578 jdk7-b73 -4e7661eaa211e186674f6cbefec4aef1144ac2a0 jdk7-b74 -946518568340c4e511549318f19f47f06b7f5f9b jdk7-b75 -09e0b33177af2b98a03c9ca19eedf61440bd1cf6 jdk7-b76 -1d0121b741f029dc4b828e4b36ba6fda92907dd7 jdk7-b77 -4061c66ba1af1a2e27c2c839ba887407dd3ce050 jdk7-b78 -e9c98378f6b9256c0595ef2985ca5899f0c0e274 jdk7-b79 -e6abd38682d237306d6c147c17538ec9e7f8e3a7 jdk7-b80 -dcc938ac40cc45f1ef454d76020b5db5d943001c jdk7-b81 -a30062be6d9ca1d48579826f870f85974300004e jdk7-b82 -34c8199936a1682aa8587857f44cfaf37c2b6381 jdk7-b83 -b1e55627a6980b9508854ed0c0f21d4f981b4494 jdk7-b84 -b6f633a93ae0ec4555ff4bf756f5e2150c9bdede jdk7-b85 -c94d9cc81f495d97817eba9d71b84fc45f7661a5 jdk7-b86 -b7456c473862048fa70ed8092313a4ef0a55d403 jdk7-b87 -7077b95d42f6b3942a8751bba033801ff50e5889 jdk7-b88 -44158f6d3b94c0fa020e33632532473d92d1ea96 jdk7-b89 -1d1927f9ec097b62c913921e2dfa5dbaf5dc325b jdk7-b90 -308ad8f68b8dd68e22d73dd490e110059b732422 jdk7-b91 -ff9031a745d9cc52318f2148e43ca3b07ee08098 jdk7-b92 -b5dab6a313fdff4c043250e4d9c8f66fd624d27e jdk7-b93 -8bb281f0f91582104d65d032be22522bfd2d8110 jdk7-b94 -654298d26561b76dfe3cfcffbbd7078080837300 jdk7-b95 -d260f892491e040ae385a8e6df59557a7d721abf jdk7-b96 -7e406ebed9a5968b584f3c3e6b60893b5d6d9741 jdk7-b97 -db6e660120446c407e2d908d52ec046592b21726 jdk7-b98 -c4c8a5bc54f66abc68cd185d9294042121922154 jdk7-b99 -2d6ba7a221915bdf0311acc5641c7f3875cb793e jdk7-b100 -2548ac036b8fca3326d058d758e6df8355a42469 jdk7-b101 -88db80c8e49cea352c2900f689600dc410761c1f jdk7-b102 -64770970865839b0443066370e7d476ef47e90cd jdk7-b103 -10bc903a228d3a8efdf46fb8c3fcf82a59b88bc5 jdk7-b104 -1ce7938efb03224ccc8b3cdd7803eb39e889539c jdk7-b105 -6bdae472f77205046703b685eff2ac4f7a0ecf4e jdk7-b106 -439de530aac531a360beedba6e2fe51e17292cc0 jdk7-b107 -044d31b99ef5609389fc771c422e722e5e224228 jdk7-b108 -e02b4d709e177d08d56130a4bc68061e4bbacc7d jdk7-b109 -a6442d6bc38a44152e0662688213ce4d2701f42a jdk7-b110 -69f3edf083477955b5bd2f754252c7504167d8e1 jdk7-b111 -f960f117f1623629f64203e2b09a92a8f6f14ff5 jdk7-b112 -1fee41c7ed2b3388970a756a85aa693c0de8407a jdk7-b113 -750c1ccb2f2d1ddfa95ab6c7f897fdab2f87f7e9 jdk7-b114 -9cb24917216bc68997154f6e9566c3de62acb2f4 jdk7-b115 -a4e6aa1f45ad23a6f083ed98d970b5006ea4d292 jdk7-b116 -228e73f288c543a8c34e2a54227103ae5649e6af jdk7-b117 -2e876e59938a853934aa738c811b26c452bd9fe8 jdk7-b118 -4951967a61b4dbbf514828879f57bd1a0d4b420b jdk7-b119 -8c840d3ab24f8d0f422b991638acb44b6ab1d98c jdk7-b120 -0ce0a2c3a6926677dc507839a820ab6625541e5a jdk7-b121 -6f09ea1c034f087916d2a8cf0d22be768400118f jdk7-b122 -142129d8599d1f56b29387e7f9a5fad53b6d61df jdk7-b123 -aa894c225b1a517b665ac2a58295217ea2245134 jdk7-b124 -f658ec2730fa29323c36d23c27e54c7219ef5e16 jdk7-b125 -f1df068076986679ea1105532a65529d63a89060 jdk7-b126 -f83cd8bd35c678f94e526990e03dc838d0ec2717 jdk7-b127 -7da3f5f30855dec6bf3a86529e87dee883b90c72 jdk7-b128 -6823ea7eb8eb6fab405d7edb7a5c2f690887a2fa jdk7-b129 -a36beda9b9de91231d92a2c529f21cc218fcf8d5 jdk7-b130 -d8af56da89bc0fc02a6b6ad78f51157a46d665ab jdk7-b131 -d61280d36755d1941fb487f554e8b7a6d0bca6a1 jdk7-b132 -fd444c61e7ed3d92b2a730da7c737b02191b682f jdk7-b133 -def8e16dd237a47fc067d66d4c616d7baaec6001 jdk7-b134 -f75a1efb141210901aabe00a834e0fc32bb8b337 jdk7-b135 -46acf76a533954cfd594bb88fdea79938abfbe20 jdk7-b136 -d1cf7d4ee16c341f5b8c7e7f1d68a8c412b6c693 jdk7-b137 -62b8e328f8c8c66c14b0713222116f2add473f3f jdk7-b138 -955488f34ca418f6cdab843d61c20d2c615637d9 jdk7-b139 -f4298bc3f4b6baa315643be06966f09684290068 jdk7-b140 -5d86d0c7692e8f4a58d430d68c03594e2d3403b3 jdk7-b141 -92bf0655022d4187e9b49c1400f98fb3392a4630 jdk7-b142 -4a05062d8c4dfa3edec3faf1052af28baba5adff jdk7-b143 -07a8728ad49ef6dfa469c3a8bf5ab1e9c80bed5c jdk7-b144 -8294c99e685a1f6d1d37c45cd97854cf74be771e jdk7-b145 -dca1e8a87e8f756f95b99bac8fe795750d42e1b0 jdk7-b146 -a2a589fc29543ed32919c78a1810ad93a6fcf5bc jdk7-b147 -de9223c94f9c710b3eebb599cd3586f36c8b94a9 jdk8-b01 -1b9d19620eb4606a25b1e28f86d66c8bfa867e06 jdk8-b02 -6815e85bf96d6d3875954f9777660372cd70d065 jdk8-b03 -31f5c34d78081572ad9a2401c0bb0c6b9711dd65 jdk8-b04 -c4f9ea1ecb55ff44e0dd21d2888ead308c86a3aa jdk8-b05 -429da7734bf491bccde2a752fae97e9f225896dc jdk8-b06 -bc5710332b294676661103bb20d47d2ea3ba8def jdk8-b07 -24ee504f80412770c6874836cd9e55b536427b1d jdk8-b08 -fbf3cabc9e3bb1fcf710941d777cb0400505fbe6 jdk8-b09 -f651ce87127980c58e3599daba964eba2f3b4026 jdk8-b10 -cc1f5ce8e504d350e0b0c28c5f84333f8d540132 jdk8-b11 -86db042b3385c338e17f7664447fdc7d406dd19e jdk8-b12 -4cc0ef72c812943743ef4765f1100e2fbe2b1a08 jdk8-b13 -9ffaa48dbfb0f5936c2b789867d0785faec7071d jdk8-b14 -b5060eae3b32fd9f884a09774338cd8186d7fafa jdk8-b15 -736a63b854f321c7824b7e47890135f80aee05e3 jdk8-b16 -f0eccb2946986fb9626efde7d8ed9c8192623f5c jdk8-b17 -885050364691ac1ac978305c63f3368a197fb04d jdk8-b18 -0ff7113a0882ec82d642cb9f0297b4e497807ced jdk8-b19 -6561530ea757c3f3a6fb171c9cc7b3885cdeca85 jdk8-b20 -b3a426170188f52981cf4573a2f14d487fddab0d jdk8-b21 -e8f03541af27e38aafb619b96863e17f65ffe53b jdk8-b22 -498124337041ad53cbaa7eb110f3d7acd6d4eac4 jdk8-b23 -7d3720d8c595d1519c31e9ff7366203fc2c61350 jdk8-b24 -0071a6d64113a35ba345bb1580c256de5ce17d3e jdk8-b25 -6c805d8ed4e5449ea5e4d158c7bdbd7b0b70efd1 jdk8-b26 -c51754cddc037b9609e202b9ed38363d8683e7a8 jdk8-b27 -16ba58282d117247f480aae7a79b88141ade52a3 jdk8-b28 -e070119aa56ee4dc5506c19d2c4d2eecab8ad429 jdk8-b29 -23da7804aca0c9c4e6e86532a1453125a76d95ee jdk8-b30 -bac81e9f7d57b75fba5ab31b571f3fe0dc08af69 jdk8-b31 -2c5208ccb863db936eab523f49450b3fcd230348 jdk8-b32 -a6e6d42203e6d35f9e8b31eac25b0021b4dd58ad jdk8-b33 -0ae89825c75c9492e44efb3aca3d9ee3d8a209df jdk8-b34 -f151d5833912a82cd4f203944da0305c3be83ecc jdk8-b35 -98ce9816ae089c959ba1e70fba98423a31c4e9fa jdk8-b36 -b3a91113026c99b0da010d41055719ab0d8938f0 jdk8-b37 -4cc5610a6dd6227da766ebf9742eb11ff5ded6c0 jdk8-b38 -35a5397278779a2f8f3013f81586dc8f30cb149d jdk8-b39 -6e4e654931b976304bf6e7b4d0d6db8f75bac5d9 jdk8-b40 -c029c972396cea042a0dc67c0f7ccf2fe68007d4 jdk8-b41 -5c5a64ec0839df5affe9394b99ff338c363acbca jdk8-b42 -69d8a827cdf9236be9694a46d75c710d71dac7d7 jdk8-b43 -7e981cb0ad6a194f1fa859f9ad47586db461f269 jdk8-b44 -9b19b2302c28f4da6d4078f66234abecfed5688a jdk8-b45 -600c9a1feb01633cbcf2341a43d1d21e6497ecd0 jdk8-b46 -b820143a6f1ce993c6e6f31db4d64de990f42654 jdk8-b47 -086271e35b0a419b38e8bda9bebd70693811df0a jdk8-b48 -cecd7026f30cbd83b0601925a7a5e059aec98138 jdk8-b49 -38fe5ab028908cf64dd73a43336ba3211577bfc3 jdk8-b50 -382651d28f2502d371eca751962232c0e535e57a jdk8-b51 -b67041a6cb508da18d2f5c7687e6a31e08bea4fc jdk8-b52 -c7aa5cca1c01689a7b1a92411daf83684af05a33 jdk8-b53 -7c6aa31ff1b2ae48c1c686ebe1aadf0c3da5be15 jdk8-b54 -319f583f66db47395fa86127dd3ddb729eb7c64f jdk8-b55 -ffe6bce5a521be40146af2ac03c509b7bac30595 jdk8-b56 -2c21c080b11b93efb3851e39e1363e45da805943 jdk8-b57 -479d3302a26d7607ba271d66973e59ebf58825b6 jdk8-b58 -3bd874584fc01aae92fbc8827e2bd04d8b6ace04 jdk8-b59 -5e3adc681779037a2d33b7be6f75680619085492 jdk8-b60 -cdaa6122185f9bf512dcd6600f56bfccc4824e8c jdk8-b61 -8d9d430b4244b95f5cf1ebe719f834a1ac5d6cd5 jdk8-b62 -21ee1dd7b809639284900a128b9b656a592ebc7a jdk8-b63 -70fa4b11f26522e69b51fd652215f60ce350bac3 jdk8-b64 -a2cf4d4a484378caea2e827ed604b2bbae58bdba jdk8-b65 -17820b958ae84f7c1cc6719319c8e2232f7a4f1d jdk8-b66 -76cc9bd3ece407d3a15d3bea537b57927973c5e7 jdk8-b67 -cb33628d4e8f11e879c371959e5948b66a53376f jdk8-b68 -adb5171c554e14cd86f618b5584f6e3d693d5889 jdk8-b69 -0d625373c69e2ad6f546fd88ab50c6c9aad01271 jdk8-b70 -a41ada2ed4ef735449531c6ebe6cec593d890a1c jdk8-b71 -6725b3961f987cf40f446d1c11cd324a3bec545f jdk8-b72 -fe94b40ffd9390f6cffcdf51c0389b0e6dde0c13 jdk8-b73 -f627eff819628822a0777af8062244352f2a29cf jdk8-b74 -f1478a6d25fddd311a84dcbfac50824cc1858bdd jdk8-b75 -f407160c280d1c5b00d314c535441ac26f195fee jdk8-b76 -d17eb2e13e362085e866d46235314c50cc4661cc jdk8-b77 -6d3dcd34b5b962ea1ef9eed0dafdee9e812401bc jdk8-b78 -a1313a8d90d17d363a3b2a645dc4030ec204b168 jdk8-b79 -3fa21fbf9be7e6b482af43aacb6a09acfa30bdb6 jdk8-b80 -e41d716405b209d3eddef8bd4240cec2bd34dcca jdk8-b81 -5e8c55025644730385a6f8fa029ecdb2d2c98a07 jdk8-b82 -bcebd3fdefc91abb9d7fa0c5af6211b3f8720da6 jdk8-b83 -d7ad0dfaa41151bd3a9ae46725b0aec3730a9cd0 jdk8-b84 -1872c12529090e1c1dbf567f02ad7ae6231b8f0c jdk8-b85 -da9a4c9312816451884aa6db6f18be51a07bff13 jdk8-b86 -5ebf6c63714de2c9dcf831074086d31daec819df jdk8-b87 -e517701a4d0e25ae9c7945bca6e1762a8c5d8aa6 jdk8-b88 -4dec41b3c5e3bb616f0c6f15830d940905aa5d16 jdk8-b89 -f09ab0c416185e3cba371e81bcb6a16060c90f44 jdk8-b90 -80b6c3172dc2cfceb022411292d290a967f9c728 jdk8-b91 -2fd6acba737b01e705e1f7c33588c922a3787f13 jdk8-b92 -b72ae39e1329fefae50d4690db4fde43f3841a95 jdk8-b93 -0d804e3b955dce406af6a79ac1cc35c696aff7fb jdk8-b94 -49fe9c8049132647ad38837a877dd473e6c9b0e5 jdk8-b95 -ea73f01b9053e7165e7ba80f242bafecbc6af712 jdk8-b96 -0a85476a0b9cb876d5666d45097dac68bef3fce1 jdk8-b97 -711eb4aa87de68de78250e0549980936bab53d54 jdk8-b98 -2d3875b0d18b3ad1c2bebf385a697e309e4005a4 jdk8-b99 -3d34036aae4ea90b2ca59712d5a69db3221f0875 jdk8-b100 -edb01c460d4cab21ff0ff13512df7b746efaa0e7 jdk8-b101 -bbe43d712fe08e650808d774861b256ccb34e500 jdk8-b102 -30a1d677a20c6a95f98043d8f20ce570304e3818 jdk8-b103 -b5ed503c26ad38869c247c5e32debec217fd056b jdk8-b104 -589f4fdc584e373a47cde0162e9eceec9165c381 jdk8-b105 -514b0b69fb9683ef52062fd962a3e0644431f64d jdk8-b106 -892889f445755790ae90e61775bfb59ddc6182b5 jdk8-b107 -74049f7a28b48c14910106a75d9f2504169c352e jdk8-b108 -af9a674e12a16da1a4bd53e4990ddb1121a21ef1 jdk8-b109 -b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110 -b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 -ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 -4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113 -dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114 -3dd9732b17034f45d111996d1d50287b05a3998c jdk8-b115 -aaf663f591aba43ec942263b15ba62759ce26a1e jdk8-b116 -31b0e03fcad73d7886b306b4c2e57ad270780d0d jdk8-b117 -f5b521ade7a35cea18df78ee86322207729f5611 jdk8-b118 -87b743b2263cc53955266411b7797b365a0fb050 jdk8-b119 -a1ee9743f4ee165eae59389a020f2552f895dac8 jdk8-b120 -13b877757b0b1c0d5813298df85364f41d7ba6fe jdk9-b00 -f130ca87de6637acae7d99fcd7a8573eea1cbaed jdk9-b01 -b32e2219736e42baaf45daf0ad67ed34f6033799 jdk9-b02 -7f655f31f9bcee618cf832f08176ad8c1ed3fdd3 jdk9-b03 -099891b1d86f3719e116ac717ffdafc90d037fb7 jdk9-b04 -dd311791ad6895a3989020dd6c6c46db87972ab8 jdk9-b05 -85dbdc227c5e11429b4fc4a8ba763f50107edd6e jdk9-b06 -c826d05f1fb0773f6a28caa763307dd30d90d36e jdk9-b07 -b47e021195757f8f45582124ea7cad48ccf5f872 jdk9-b08 -efe7dbc6088691757404e0c8745f894e3ca9c022 jdk9-b09 -8c0bdeecd7c0f9ce3f3762a51991f755cb3a972c jdk9-b10 -0809c9a4d36e6291f1c4384604c4bbf29e975722 jdk9-b11 -0d1f816217dce5e72187f167cc1816080cbeb453 jdk9-b12 -1a30593dcb9802faec3b6edb24d86ca088594e4e jdk9-b13 -97932f6ad950ae5a73a9da5c96e6e58503ff646b jdk9-b14 -74eb0778e4f2dbff6628e718378449fba27c4265 jdk9-b15 -4a09f5d30be844ac6f714bdb0f63d8c3c08b9a98 jdk9-b16 -410bccbded9e9cce80f1e13ad221e37ae97a3986 jdk9-b17 -c5495e25c7258ab5f96a1ae14610887d76d2be63 jdk9-b18 -2dcf544eb7ed5ac6a3f7813a32e33acea7442405 jdk9-b19 -89731ae72a761afdf4262e8b9513f302f6563f89 jdk9-b20 -28dd0c7beb3cad9cf95f17b4b5ad87eb447a4084 jdk9-b21 -9678e0db8ff6ed845d4c2ee4a3baf7f386a777e5 jdk9-b22 -39cfdc2dcaf3f195c55398e4e677ab053b07e3d2 jdk9-b23 -d9ce05f36ffec3e5e8af62a92455c1c66a63c320 jdk9-b24 -13a5c76976fe48e55c9727c25fae2d2ce7c05da0 jdk9-b25 -cd6f4557e7fea5799ff3762ed7a80a743e75d5fd jdk9-b26 -d06a6d3c66c08293b2a9650f3cc01fd55c620e65 jdk9-b27 -f4269e8f454eb77763ecee228a88ae102a9aef6e jdk9-b28 -c36c0092693707a8255561433647e8c3cd724ccd jdk9-b29 -b2287cac7813c70ed7f679d9a46fe774bd4005f8 jdk9-b30 -9d0e6639a4d71b63507dd94b1a028e963b27e798 jdk9-b31 -1b1ec4291abc0ba6da7bf79b754f08dd759a4a0c jdk9-b32 -f0c5e4b732da823bdaa4184133675f384e7cd68d jdk9-b33 -9618201c5df28a460631577fad1f61e96f775c34 jdk9-b34 -a137992d750c72f6f944f341aa19b0d0d96afe0c jdk9-b35 -41df50e7303daf73c0d661ef601c4fe250915de5 jdk9-b36 -b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37 -948cceef81ba4cb34bc233e7cc5952951ff04e88 jdk9-b38 -4e7c4d692e934cb9023af8201e7c2b510e9c4ee1 jdk9-b39 -82f4cb44b2d7af2352f48568a64b7b6a5ae960cd jdk9-b40 -9fffb959eb4197ff806e4ac12244761815b4deee jdk9-b41 -3107be2ba9c6e208a0b86bc7100a141abbc5b5fb jdk9-b42 -6494b13f88a867026ee316b444d9a4fa589dd6bd jdk9-b43 -abbfccd659b91a7bb815d5e36fed635dcdd40f31 jdk9-b44 -bfc24ae2b900187585079bb11e66e459d1e525fe jdk9-b45 -722378bc599e38d9a1dd484de30f10dfd7b21438 jdk9-b46 -8327024a99559982b848e9c2191da9c0bf8838fd jdk9-b47 -b2f9702efbe95527ea3a991474fda23987ff1c5c jdk9-b48 -5b8db585a33c3cc48e70e688ceee57dd9271dc5d jdk9-b49 -1550b2f6b63d1411fa84dc7bbc6f04809aedb43f jdk9-b50 -6efe265424e3f1ea596408a1f71baf2de316c772 jdk9-b51 -d6224d6021459ac8b3832e822f5acc849fa944af jdk9-b52 -874d76e4699dfcd61ae1826c9fe0ddc1610ad598 jdk9-b53 -82cd31c5d6ca8d4c1653f4eb1c09eb2d9a3b2813 jdk9-b54 -c97e2d1bad9708d379793ba2a4c848eda14c741e jdk9-b55 -47544495db2d3d2edf0f85862d8715592fdb919f jdk9-b56 -ddb95d8f169b09544cc17e72a6baaff2400092f5 jdk9-b57 -f40752db7773ca0c737f2ad88371e35c57fdfed7 jdk9-b58 -da950f343762a856d69751570a4c07cfa68a415b jdk9-b59 -38f98cb6b33562a926ec3b79c7b34128be37647d jdk9-b60 -ac3f5a39d4ff14d70c365e12cf5ec8f2abd52a04 jdk9-b61 -e7dbbef69d12b6a74dfad331b7188e7f893e8d29 jdk9-b62 -989253a902c34dcb7564695161c9200a5fbb7412 jdk9-b63 -8ffdeabc7c2b9a8280bf46cae026ac46b4d31c26 jdk9-b64 -4915246064b2f89d5f00c96e758686b7fdad36a6 jdk9-b65 -ff3fc75f3214ad7e03595be1b0d0f38d887b6f0e jdk9-b66 -56166ce66037952fa21e9f680b31bf8eb47312c0 jdk9-b67 -5b500c93ce4822d47061cd518ff3f72d9d8cb5b5 jdk9-b68 -d69c968463f0ae5d0b45de3fc14fe65171b23948 jdk9-b69 -43d0179ee9de3bfffae3417f09e07eb6d8efc963 jdk9-b70 -f66c185284727f6e6ffd27e9c45ed2dd9da0a691 jdk9-b71 -61d2d0629b6dbf4c091dc86151ade1b3ef34fffe jdk9-b72 -9b3a9d72f07b40c648de79961679f42283af1bb5 jdk9-b73 -7c577fda1855d03c04546694d514678f596508c9 jdk9-b74 -f55df5cfe11c97e4b58998b76f5bd00a73cde12d jdk9-b75 -eeea9adfd1e3d075ef82148c00a4847a1aab4d26 jdk9-b76 -c25e882cee9622ec75c4e9d60633539a2f0a8809 jdk9-b77 -c8753d0be1778944dc512ec86a459941ea1ad2c3 jdk9-b78 -3966bd3b8167419aa05c6718a4af1cf54b1e3c58 jdk9-b79 -3c9f5bd909ae7187f24622ee4b69f8a5756a9271 jdk9-b80 -2050b3a0aadcb0e024bf798197421d58e54ec8bf jdk9-b81 -6521875cb63e1d0121b30af56ebbc36db078c4c6 jdk9-b82 -f61a63b7d1e52e307abc0bfc751203155d362ec4 jdk9-b83 -51b2db2fa04c16d767b66113dbf08c5349ce382a jdk9-b84 -8392405ab038b22e69a3728e17dbdd9e3d3a22ed jdk9-b85 -7db0663a5e968059fa7c772172187ebd60b6492d jdk9-b86 -1a52a30674cd28c24d4d388150336121f2e9ddf9 jdk9-b87 -16b4968f9bb8f34371b42c0ba483d76e91ba84d8 jdk9-b88 -4a0312f2894bcbe1fd20266c8fda8d983bd2fcf6 jdk9-b89 -d131f4b8433a79408f935eff9bf92a0664229b60 jdk9-b90 -8077fd2f055d31e50b46fcf62d9c035bc385a215 jdk9-b91 -f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92 -09206c6513b300e1ac8541f3be012e1a49312104 jdk9-b93 -25a2cab05cfbe6034b71d9e72d64c65b0572ce63 jdk9-b94 -5ac6287ec71aafe021cc839d8bc828108d23aaba jdk-9+95 -139f19d70350238e15e107945cea75082b6380b3 jdk-9+96 -4edcff1b9a8875eb6380a2165dfec599e8e3f7c0 jdk-9+97 -d00ad2d9049ac60815f70bff445e95df85648bd2 jdk-9+98 -f9bcdce2df26678c3fe468130b535c0342c69b89 jdk-9+99 -4379223f8806626852c46c52d4e7a27a584b406e jdk-9+100 -80f67512daa15cf37b4825c1c62a675d524d7c49 jdk-9+101 -2dc4c11fe48831854916d53c3913bdb7d49023ea jdk-9+102 -4a652e4ca9523422149958673033e0ac740d5e1e jdk-9+103 -086c682bd8c5f195c324f61e2c61fbcd0226d63b jdk-9+104 -db483b34fa7148d257a429acddbde9c13687dcae jdk-9+105 -6c644cca3f3fc2763e2ff7d669849a75d34543ba jdk-9+106 -1c076468bf7dad5b8f2ee5dcf66e2279caa3e208 jdk-9+107 -257b579d813201682931d6b42f0445ffe5b4210d jdk-9+108 -c870cb782aca71093d2584376f27f0cfbfec0e3a jdk-9+109 -4a95f4b1bd8bfce85dc02a593896749feab96c34 jdk-9+110 -a6614ff7bf09da74be1d0ef3d9755090d244697a jdk-9+111 -7359994942f8d8e723b584d66a3a92c2e9e95e5c jdk-9+112 -6072af7a98be3922f26bdce71b53bb3646cb2ac9 jdk-9+113 -c84d0cce090e161d736de69e941830adf8c2f87a jdk-9+114 -8d78fb40648dd221ce4ef19f9d5aa41ee1a3a884 jdk-9+115 -84aba7335005a3a47751dcf1f37935f97df9f99a jdk-9+116 -82b8d12a553f5617737c238cec060281d52e351c jdk-9+117 -7c04fcb12bd4a31570a238e663fa846dfa5ec3b8 jdk-9+118 -caf97b37ebec84288c112d21d3a60cb628cba1e8 jdk-9+119 -9330543436402b8f3bd070524846a464d8143557 jdk-9+120 -18e5cdecb37a2f03ba74f6c8f022858bcbaacf56 jdk-9+121 -7693aa00e131493ceb42b93305e2f014c9922a3b jdk-9+122 -d53037a90c441cb528dc41c30827985de0e67c62 jdk-9+123 -2a5697a98620c4f40e4a1a71478464399b8878de jdk-9+124 -3aa52182b3ad7c5b3a61cf05a59dd07e4c5884e5 jdk-9+125 -03e7b2c5ae345be3caf981d76ceb3efe5ff447f8 jdk-9+126 -8e45018bde9de4ad15b972ae62874bba52dba2d5 jdk-9+127 -5bf88dce615f6804f9e101a96ffa7c9dfb4fbbbe jdk-9+128 -e8373543a3f0f60589b7d72b1f9b172721124caf jdk-9+129 -e613affb88d178dc7c589f1679db113d589bddb4 jdk-9+130 -4d2a15091124488080d65848b704e25599b2aaeb jdk-9+131 -2e83d21d78cd9c1d52e6cd2599e9c8aa36ea1f52 jdk-9+132 -e17429a7e843c4a4ed3651458d0f950970edcbcc jdk-9+133 -a71210c0d9800eb6925b61ecd6198abd554f90ee jdk-9+134 -e384420383a5b79fa0012ebcb25d8f83cff7f777 jdk-9+135 -1b4b5d01aa11edf24b6fadbe3d2f3e411e3b02cd jdk-9+136 -9cb87c88ed851c0575b8ead753ea238ed5b544e9 jdk-9+137 -d273dfe9a126d3bffe92072547fef2cd1361b0eb jdk-9+138 -65477538bec32963dc41153d89c4417eb46c45fc jdk-9+139 -0875007901f7d364a08220b052f0c81003e9c8c5 jdk-9+140 -9aadd2163b568d76f8969ad2fb404a63733da359 jdk-9+141 -df0e03e3ca0ed1307793017dfc1a054c8726131c jdk-9+142 -d62173b931bf5b6bffc6e80a9060bb2e8b8efc75 jdk-9+143 -31f5023200d42185b70c4c00ba5672391e4642d0 jdk-9+144 -3ee4e7827413fa5c5c4fca58597b0ad89e921bfb jdk-9+145 -581331db696a62dd411926ba7fd437252252a71d jdk-9+146 -f4e854a77aa38749bd90f722b06974a56e7233d5 jdk-9+147 -5c71ea43933b6c7e8a85eb1a4eb2213011b95d82 jdk-9+148 -cf139f925da04c8bd7efd33270a0315d72b338d3 jdk-9+149 -17469f16fbb406ec9f0dd262ce776ab6efbc38f1 jdk-9+150 -37b95df0042ae0687324e1f7dc4a2519e230e704 jdk-9+151 -ab2c8b03c3284fcbdd157551a66f807e3a182d9b jdk-9+152 -d7034ff7f8e257e81c9f95c7785dd4eaaa3c2afc jdk-9+153 -8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0 -45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154 -f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155 -06bce0388880b5ff8e040e4a9d72a3ea11dac321 jdk-9+156 -74116beae88a8f17a80301aa6c83865c82f10ece jdk-10+1 -4a79ad46e578112fce68f1af9dd931025cc235cb jdk-10+2 -d1cab6c7e608479be4ebfad48a25b0ed48600f62 jdk-10+3 -02253db2ace1422f576f58502fc7831ead77424b jdk-10+4 -f113ce12fe24fbd24acf02711372d9f1e1c12426 jdk-10+5 -1407b19a2ddf6baae162f5a1a5b96af473f4d7d1 jdk-10+6 -30e75693ae99fd8e47fd2f5116527aff1b59aff9 jdk-10+7 -c42dc7b58b4d4301ea676a76326fd9bbd403d595 jdk-10+8 -aa5b01f5e5620438fd39efdb2e2f6365a2c7d898 jdk-10+9 -b0f2b8ff25a2209b2c807785d75f20e5086bbfc2 jdk-10+10 -036dbf8b381798e5d31065109714d04d97bf98a4 jdk-10+11 -e6d70017f5b9adbb2ec82d826973d0251800a3c3 jdk-10+12 -9927a9f16738e240ab7014f0118f41e314ef8f99 jdk-10+13 -9ef5029b247b4d940080417a287440bbdbab995b jdk-10+14 -878e216039322cb3f0ecbd0944642a2b4e2593f3 jdk-10+15 -4bbea012e5676e8025ade2bcfab4d6581e6e9f4b jdk-10+16 -7db699468b4f84abbcc01647e5a964409737411a jdk-10+17 -3739654290616e533fc6f51bf9ad69ed47a6abba jdk-10+18 -14df107500cc3b8ab238c3e4ad2c74e12bfe6067 jdk-10+19 -4586bc5d28d13d3147b993e6237eaf29a7073bbb jdk-10+20 -a85884d55ce32799f5c7382b7ea4839052b362a2 jdk-10+21 -e5357aa85dadacc6562175ff74714fecfb4470cf jdk-10+22 -22850b3a55240253841b9a425ad60a7fcdb22d47 jdk-10+23 -3b201865d5c1f244f555cad58da599c9261286d8 jdk-10+24 -8eb5e3ccee560c28ac9b1df2670adac2b3d36fad jdk-10+25 -1129253d3bc728a2963ba411ab9dd1adf358fb6b jdk-10+26 -b87d7b5d5dedc1185e5929470f945b7378cdb3ad jdk-10+27 -92f08900cb3c0d694e5c529a676c1c9e5909193f jdk-10+28 -a6e591e12f122768f675428e1e5a838fd0e9c7ec jdk-10+29 -8fee80b92e65149f7414250fd5e34b6f35d417b4 jdk-10+30 -e6278add9ff28fab70fe1cc4c1d65f7363dc9445 jdk-10+31 -a2008587c13fa05fa2dbfcb09fe987576fbedfd1 jdk-10+32 -bbd692ad4fa300ecca7939ffbe3b1d5e52a28cc6 jdk-10+33 -89deac44e51517841491ba86ff44aa82a5ca96b3 jdk-10+34 -d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35 -0ee20aad71c4f33c426372b4c8bcc1235ce2ec08 jdk-11+0 -959f2f7cbaa6d2ee45d50029744efb219721576c jdk-10+36 -4f830b447edf04fb4a52151a5ad44d9bb60723cd jdk-10+37 -e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38 -5b834ec962366e00d4445352a999a3ac14e26f64 jdk-10+39 -860326263d1f6a83996d7da0f4c66806ae4aa1eb jdk-10+40 -3eae36c6baa5f916a3024cf1513e22357e00185d jdk-10+41 -4b62b815b4f49970b91a952929cf50115c263cb3 jdk-10+42 -107413b070b92c88bde6230ceb4a19b579781068 jdk-10+43 -dfa46cfe56346884a61efdc30dc50f7505d66761 jdk-11+1 -03ae177c26b016353e5ea1cab6ffd051dfa086ca jdk-11+2 -663f20fc51091bd7f95d18448850ba091207b7bd jdk-10+44 -4f96cf952e71cb8a127334494faf28880c26181b jdk-10+45 -1fd4d6068f54561cfc67d54fc9ca84af7212c4f8 jdk-11+3 -e59941f7247d451fa7df9eaef3fce0f492f8420c jdk-11+4 -d5c43e9f08fb9a7c74aae0d48daf17f2ad2afaef jdk-11+5 -3acb379b86725c47e7f33358cb22efa8752ae532 jdk-11+6 -f7363de371c9a1f668bd0a01b7df3d1ddb9cc58b jdk-11+7 -755e1b55a4dff510f9639cdb5c5e82549a7e09b3 jdk-11+8 -0c3e252cea44f06aef570ef464950ab97c669970 jdk-11+9 -6fa770f9f8ab296e1ce255ec17ccf6d4e1051886 jdk-10+46 -69d7398038c54774d9395b6810e0cca335edc02c jdk-11+10 -e1e60f75cd39312a7f59d2a4f91d624e5aecc95e jdk-11+11 -3ab6ba9f94a9045a526d645af26c933235371d6f jdk-11+12 -758deedaae8406ae60147486107a54e9864aa7b0 jdk-11+13 -3595bd343b65f8c37818ebe6a4c343ddeb1a5f88 jdk-11+14 -a11c1cb542bbd1671d25b85efe7d09b983c48525 jdk-11+15 -02934b0d661b82b7fe1052a04998d2091352e08d jdk-11+16 -64e4b1686141e57a681936a8283983341484676e jdk-11+17 -e1b3def126240d5433902f3cb0e91a4c27f6db50 jdk-11+18 -36ca515343e00b021dcfc902e986d26ec994a2e5 jdk-11+19 -95aad0c785e497f1bade3955c4e4a677b629fa9d jdk-12+0 -9816d7cc655e53ba081f938b656e31971b8f097a jdk-11+20 -14708e1acdc3974f4539027cbbcfa6d69f83cf51 jdk-11+21 -00b16d0457e43d23f6ca5ade6b243edce62750a0 jdk-12+1 -9937ef7499dcd7673714517fd5e450410c14ba4e jdk-11+22 -69b438908512d3dfef5852c6a843a5778333a309 jdk-12+2 -1edcf36fe15f79d6228d1a63eb680878e2386480 jdk-11+23 -990db216e7199b2ba9989d8fa20b657e0ca7d969 jdk-12+3 -ea900a7dc7d77dee30865c60eabd87fc24b1037c jdk-11+24 -499b873761d8e8a1cc4aa649daf04cbe98cbce77 jdk-12+4 -331888ea4a788df801b1edf8836646cd25fc758b jdk-11+25 -f8696e0ab9b795030429fc3374ec03e378fd9ed7 jdk-12+5 -945ba9278a272a5477ffb1b3ea1b04174fed8036 jdk-11+26 -7939b3c4e4088bf4f70ec5bbd8030393b653372f jdk-12+6 -9d7d74c6f2cbe522e39fa22dc557fdd3f79b32ad jdk-11+27 -ef57958c7c511162da8d9a75f0b977f0f7ac464e jdk-12+7 -76072a077ee1d815152d45d1692c4b36c53c5c49 jdk-11+28 -492b366f8e5784cc4927c2c98f9b8a3f16c067eb jdk-12+8 -31b159f30fb281016c5f0c103552809aeda84063 jdk-12+9 -8f594f75e0547d4ca16649cb3501659e3155e81b jdk-12+10 -f0f5d23449d31f1b3580c8a73313918cafeaefd7 jdk-12+11 -15094d12a632f452a2064318a4e416d0c7a9ce0c jdk-12+12 -511a9946f83e3e3c7b9dbe1840367063fb39b4e1 jdk-12+13 -8897e41b327c0a5601c6ba2bba5d07f15a3ffc91 jdk-12+14 -8897e41b327c0a5601c6ba2bba5d07f15a3ffc91 jdk-12+14 -6f04692c7d5137ee34a6bd94c0c8a6c9219cb127 jdk-12+14 -f8626bcc169813a4b2a15880386b952719d1d6d1 jdk-12+15 -199658d1ef860cdc17055b4fd3e94b057f292fe9 jdk-12+16 -eefa65e142af305923d2adcd596fab9c639723a1 jdk-12+17 -e38473506688e0995e701fc7f77d5a91b438ef93 jdk-12+18 -dc1f9dec2018a37fedba47d8a2aedef99faaec64 jdk-12+19 -40098289d5804c3b5e7074bc75501a81e70d9b0d jdk-12+20 -f8fb0c86f2b3d24294d39c5685a628e1beb14ba7 jdk-12+21 -732bec44c89e8b93a38296bf690f97b7230c5b6d jdk-12+22 -eef755718cb24813031a842bbfc716a6cea18e9a jdk-12+23 -cc4098b3bc10d1c390384289025fea7b0d4b9e93 jdk-13+0 -7d4397b43fa305806160785a4c7210600d59581a jdk-12+24 -11033c4ada542f9c9a873314b6ecf60af19e8256 jdk-13+1 -7496df94b3b79f3da53925d2d137317715f11d97 jdk-12+25 -50677f43ac3df9a8684222b8893543c60f3aa0bd jdk-13+2 -de9fd809bb475401aad188eab2264226788aad81 jdk-12+26 -642346a11059b9f283110dc301a24ed43b76a94e jdk-13+3 -f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27 -a47b8125b7cc9ef59619745c163975fe935b57ed jdk-13+4 -659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28 -e3ed960609927b5fdfd0a797159835cd83a81a31 jdk-13+5 -44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29 -b5f05fe4a6f8b3996a000c20078b356d991ca8ec jdk-13+6 -6c377af36a5c4203f16aed8a5e4c2ecc08fcd8bd jdk-12+30 -021917019cda1c0c5853255322274f37693a2431 jdk-13+7 -b5f7bb57de2f797be34f6c75d45c3245ad37ab97 jdk-12+31 -a535ba736cabc6886acdff36de3a096c46e5ddc5 jdk-13+8 -4ce47bc1fb92cf94c6e3d1f49d582f02dcb851ab jdk-12+32 -c081f3ea6b9300265a4a34e38f970b1e3ddaae9f jdk-13+9 -b67884871b5fff79c5ef3eb8ac74dd48d71ea9b1 jdk-12+33 -8e069f7b4fabfe05d9f500783e6d56cb0196d25c jdk-13+10 -21ea4076a275a0f498afa517e9ee1b94a9cf0255 jdk-13+11 -1d7aec80147a6d92b101a76aef92f3ddc88bedf4 jdk-13+12 -b67884871b5fff79c5ef3eb8ac74dd48d71ea9b1 jdk-12-ga -83cace4142c8563b6a921787db02388e1bc48d01 jdk-13+13 -46cf212cdccaf4fb064d913b12004007d3322b67 jdk-13+14 -f855ec13aa2501ae184c8b3e0626a8cec9966116 jdk-13+15 -9d0ae9508d5337b0dc7cc4684be42888c4023755 jdk-13+16 -93b702d2a0cb9e32160208f6700aede1f8492773 jdk-13+17 -bebb82ef3434a25f8142edafec20165f07ac562d jdk-13+18 -a43d6467317d8f1e160f67aadec37919c9d64443 jdk-13+19 -6ccc7cd7931e34129f6b7e04988fc9a63958dde0 jdk-13+20 -f2f11d7f7f4e7128f8aba6ffa576cfa76fbf7d1a jdk-13+21 -181986c5476468bc2dd4532af49599003ee8af37 jdk-13+22 -b034d2dee5fc93d42a81b65e58ce3f91e42586ff jdk-13+23 -7e2238451585029680f126ccbb46d01f2ff5607f jdk-13+24 -22b3b7983adab54e318f75aeb94471f7a4429c1e jdk-14+0 -22b3b7983adab54e318f75aeb94471f7a4429c1e jdk-13+25 -2f4e214781a1d597ed36bf5a36f20928c6c82996 jdk-14+1 -0692b67f54621991ba7afbf23e55b788f3555e69 jdk-13+26 -43627549a488b7d0b4df8fad436e36233df89877 jdk-14+2 -b7f68ddec66f996ae3aad03291d129ca9f02482d jdk-13+27 -e64383344f144217c36196c3c8a2df8f588a2af3 jdk-14+3 -1e95931e7d8fa7e3899340a9c7cb28dbea50c10c jdk-13+28 -19d0b382f0869f72d4381b54fa129f1c74b6e766 jdk-14+4 -3081f39a3d30d63b112098386ac2bb027c2b7223 jdk-13+29 -0f1e29c77e50c7da11d83df410026392c4d1a28c jdk-14+5 -2e63fb0a885fa908a97bbb0da8d7c3de11536aca jdk-13+30 -443f7359b34d60e7821216ffc60f88b6ffe0ccdd jdk-14+6 -6a159c6c23ccd0029140ab91653442e412305ce5 jdk-13+31 -28ab01c067551ef158abaef08e154e1051ca0893 jdk-14+7 -929f37a9c35d530d4e866f6e832001aeb4cfb371 jdk-13+32 -c0023e364b6f130cb1e93747b796d8718d544db1 jdk-14+8 -9c250a7600e12bdb1e611835250af3204d4aa152 jdk-13+33 -18f189e69b29f8215a3500b875127ed4fb2d977a jdk-14+9 -ececb6dae777e622abda42c705fd984a42f46b5a jdk-14+10 -bf4c808a4488025a415f867e54c8b088417e08a0 jdk-14+11 -8570f22b9b6ac6bec673899b582150865696e425 jdk-14+12 -fbbe6672ae15deaf350a9e935290a36f57ba9c25 jdk-14+13 -cddef3bde924f3ff4f17f3d369280cf69d0450e5 jdk-14+14 -9c250a7600e12bdb1e611835250af3204d4aa152 jdk-13-ga -778fc2dcbdaa8981e07e929a2cacef979c72261e jdk-14+15 -d29f0181ba424a95d881aba5eabf2e393abcc70f jdk-14+16 -5c83830390baafb76a1fbe33443c57620bd45fb9 jdk-14+17 -e84d8379815ba0d3e50fb096d28c25894cb50b8c jdk-14+18 -9b67dd88a9313e982ec5f710a7747161bc8f0c23 jdk-14+19 -54ffb15c48399dd59922ee22bb592d815307e77c jdk-14+20 -c16ac7a2eba4e73cb4f7ee9294dd647860eebff0 jdk-14+21 -83810b7d12e7ff761ad3dd91f323a22dad96f108 jdk-14+22 -15936b142f86731afa4b1a2c0fe4a01e806c4944 jdk-14+23 -438337c846fb071900ddb6922bddf8b3e895a514 jdk-14+24 -17d242844fc9e7d18b3eac97426490a9c246119e jdk-14+25 -288777cf0702914e5266bc1e5d380eed9032ca41 jdk-14+26 -2c724dba4c3cf9516b2152e151c9aea66b21b30b jdk-15+0 -91a3f092682fc715d991a87eb6ec6f28886d2035 jdk-14+27 -63e17cf29bed191ea21020b4648c9cdf893f80f5 jdk-15+1 -2069b4bfd23b56b6fc659fba8b75aaaa23debbe0 jdk-14+28 -f33197adda9ad82fdef46ac0f7dc0126204f35b2 jdk-15+2 -563fa900fa17c290ae516c7a3a69e8c069dde304 jdk-14+29 -d05fcdf25717d85e80a3a39a6b719458b22be5fe jdk-15+3 -d54ce919da90dab361995bb4d87be9851f00537a jdk-14+30 -bb0a7975b31ded63d594ee8dbfc4d4ead587f79b jdk-15+4 -decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31 -b97c1773ccafae4a8c16cc6aedb10b2a4f9a07ed jdk-15+5 -2776da28515e087cc8849acf1e131a65ea7e77b6 jdk-14+32 -ef7d53b4fccd4a0501b17d974e84f37aa99fa813 jdk-15+6 -f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33 -e2bc57500c1b785837982f7ce8af6751387ed73b jdk-15+7 -a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34 -c7d4f2849dbfb755fc5860b362a4044ea0c9e082 jdk-15+8 -4a87bb7ebfd7f6a25ec59a5982fe3607242777f8 jdk-14+35 -62b5bfef8d618e08e6f3a56cf1fb0e67e89e9cc2 jdk-15+9 -bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14+36 -1bee69801aeea1a34261c93f35bc9de072a98704 jdk-15+10 -b2dd4028a6de4e40dda8b76109e4b5c6b294f980 jdk-15+11 -2ec0ff3042630ddbd3587e340fe0dd40391cb6c4 jdk-15+12 -1c06a8ee8acad4d93c782626a233693a73de0add jdk-15+13 -1d6ceb13e142665ea833fca01c8c8598e0ddd211 jdk-15+14 -bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14-ga -82b7c62cf4cc56828a8fb724f57087967232a2a7 jdk-15+15 -5c7ec21f5d13f6eb5cd32288c69b8be2f9cac256 jdk-15+16 -dd5198db2e5b1ebcafe065d987c03ba9fcb50fc3 jdk-15+17 -44aef192b488a48cce12422394691a6b1d16b98e jdk-15+18 -7cc27caabe6e342151e8baf549beb07a9c755ec2 jdk-15+19 -46bca5e5e6fb26efd07245d26fe96a9c3260f51e jdk-15+20 -12b55fad80f30d24b1f8fdb3b947ea6465ef9518 jdk-15+21 -7223c6d610343fd8323af9d07d501e01fa1a7696 jdk-15+22 -f143729ca00ec14a98ea5c7f73acba88da97746e jdk-15+23 -497fd9f9129c4928fd5a876dd55e0daf6298b511 jdk-15+24 -90b266a84c06f1b3dc0ed8767856793e8c1c357e jdk-15+25 -0a32396f7a690015d22ca3328ac441a358295d90 jdk-15+26 -93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-16+0 -93813843680bbe1b7efbca56c03fd137f20a2c31 jdk-15+27 -4a485c89d5a08b495961835f5308a96038678aeb jdk-16+1 -06c9f89459daba98395fad726100feb44f89ba71 jdk-15+28 -bcbe7b8a77b8971bc221c0be1bd2abb6fb68c2d0 jdk-16+2 -b58fc60580550a4a587cab729d8fd87223ad6932 jdk-15+29 -76810b3a88c8c641ae3850a8dfd7c40c984aea9d jdk-16+3 -6909e4a1f25bfe9a2727026f5845fc1fc44a36aa jdk-15+30 -e2622818f0bd30e736252eba101fe7d2c27f400b jdk-16+4 -a32f58c6b8be81877411767de7ba9c4cf087c1b5 jdk-15+31 -143e258f64af490010eb7e0bacc1cfaeceff0993 jdk-16+5 -2dad000726b8d5db9f3df647fb4949d88f269dd4 jdk-15+32 -4a8fd81d64bafa523cddb45f82805536edace106 jdk-16+6 -6b65f4e7a975628df51ef755b02642075390041d jdk-15+33 -c3a4a7ea7c304cabdacdc31741eb94c51351668d jdk-16+7 -b0817631d2f4395508cb10e81c3858a94d9ae4de jdk-15+34 -0a73d6f3aab48ff6d7e61e47f0bc2d87a054f217 jdk-16+8 -fd60c3146a024037cdd9be34c645bb793995a7cc jdk-15+35 -c075a286cc7df767cce28e8057d6ec5051786490 jdk-16+9 -b01985b4f88f554f97901e53e1ba314681dd9c19 jdk-16+10 -e3f940bd3c8fcdf4ca704c6eb1ac745d155859d5 jdk-15+36 -5c18d696c7ce724ca36df13933aa53f50e12b9e0 jdk-16+11 -fc8e62b399bd93d06e8d13dc3b384c450e853dcd jdk-16+12 -fd07cdb26fc70243ef23d688b545514f4ddf1c2b jdk-16+13 -36b29df125dc88f11657ce93b4998aa9ff5f5d41 jdk-16+14 -- GitLab From 1ea766db5519f03e36fc5b0c446cf34b172bb349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Thu, 9 Dec 2021 09:23:39 +0000 Subject: [PATCH 700/890] 8278419: JFR jcmd option contract "This value cannot be changed once JFR has been initialized" is not enforced Reviewed-by: egahlin --- src/hotspot/share/jfr/dcmd/jfrDcmds.cpp | 62 ++++++++++--------- .../jfr/jcmd/TestJcmdConfigureReadOnly.java | 49 +++++++++++++++ 2 files changed, 81 insertions(+), 30 deletions(-) create mode 100644 test/jdk/jdk/jfr/jcmd/TestJcmdConfigureReadOnly.java diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp index 9763ed62b76..319d1c1a4e8 100644 --- a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp +++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp @@ -388,12 +388,12 @@ void JfrConfigureFlightRecorderDCmd::print_help(const char* name) const { out->print_cr(" been initalized. (STRING, default determined by the value for"); out->print_cr(" memorysize)"); out->print_cr(""); - out->print_cr(" maxchunksize (Optional) Maximum size of an individual data chunk in bytes if"); + out->print_cr(" maxchunksize (Optional) Maximum size of an individual data chunk in bytes if"); out->print_cr(" one of the following suffixes is not used: 'm' or 'M' for"); out->print_cr(" megabytes OR 'g' or 'G' for gigabytes. This value cannot be"); out->print_cr(" changed once JFR has been initialized. (STRING, 12M)"); out->print_cr(""); - out->print_cr(" memorysize (Optional) Overall memory size, in bytes if one of the following"); + out->print_cr(" memorysize (Optional) Overall memory size, in bytes if one of the following"); out->print_cr(" suffixes is not used: 'm' or 'M' for megabytes OR 'g' or 'G' for"); out->print_cr(" gigabytes. This value cannot be changed once JFR has been"); out->print_cr(" initialized. (STRING, 10M)"); @@ -403,7 +403,11 @@ void JfrConfigureFlightRecorderDCmd::print_help(const char* name) const { out->print_cr(" location is the temporary directory for the operating system. On"); out->print_cr(" Linux operating systems, the temporary directory is /tmp. On"); out->print_cr(" Windows, the temporary directory is specified by the TMP"); - out->print_cr(" environment variable.)"); + out->print_cr(" environment variable)"); + out->print_cr(""); + out->print_cr(" dumppath (Optional) Path to the location where a recording file is written"); + out->print_cr(" in case the VM runs into a critical error, such as a system"); + out->print_cr(" crash. (STRING, The default location is the current directory)"); out->print_cr(""); out->print_cr(" stackdepth (Optional) Stack depth for stack traces. Setting this value"); out->print_cr(" greater than the default of 64 may cause a performance"); @@ -416,7 +420,8 @@ void JfrConfigureFlightRecorderDCmd::print_help(const char* name) const { out->print_cr(" performance and is not recommended. This value cannot be changed"); out->print_cr(" once JFR has been initialized. (STRING, 8k)"); out->print_cr(""); - out->print_cr(" samplethreads (Optional) Flag for activating thread sampling. (BOOLEAN, true)"); + out->print_cr(" samplethreads (Optional) Flag for activating thread sampling. This value cannot"); + out->print_cr(" be changed once JFR has been initialized. (BOOLEAN, true)"); out->print_cr(""); out->print_cr("Options must be specified using the or = syntax."); out->print_cr(""); @@ -467,38 +472,35 @@ void JfrConfigureFlightRecorderDCmd::execute(DCmdSource source, TRAPS) { } jobject stack_depth = NULL; - if (_stack_depth.is_set()) { - stack_depth = JfrJavaSupport::new_java_lang_Integer((jint)_stack_depth.value(), CHECK); - } - jobject global_buffer_count = NULL; - if (_global_buffer_count.is_set()) { - global_buffer_count = JfrJavaSupport::new_java_lang_Long(_global_buffer_count.value(), CHECK); - } - jobject global_buffer_size = NULL; - if (_global_buffer_size.is_set()) { - global_buffer_size = JfrJavaSupport::new_java_lang_Long(_global_buffer_size.value()._size, CHECK); - } - jobject thread_buffer_size = NULL; - if (_thread_buffer_size.is_set()) { - thread_buffer_size = JfrJavaSupport::new_java_lang_Long(_thread_buffer_size.value()._size, CHECK); - } - jobject max_chunk_size = NULL; - if (_max_chunk_size.is_set()) { - max_chunk_size = JfrJavaSupport::new_java_lang_Long(_max_chunk_size.value()._size, CHECK); - } - jobject memory_size = NULL; - if (_memory_size.is_set()) { - memory_size = JfrJavaSupport::new_java_lang_Long(_memory_size.value()._size, CHECK); - } - jobject sample_threads = NULL; - if (_sample_threads.is_set()) { - sample_threads = JfrJavaSupport::new_java_lang_Boolean(_sample_threads.value(), CHECK); + + if (!JfrRecorder::is_created()) { + if (_stack_depth.is_set()) { + stack_depth = JfrJavaSupport::new_java_lang_Integer((jint)_stack_depth.value(), CHECK); + } + if (_global_buffer_count.is_set()) { + global_buffer_count = JfrJavaSupport::new_java_lang_Long(_global_buffer_count.value(), CHECK); + } + if (_global_buffer_size.is_set()) { + global_buffer_size = JfrJavaSupport::new_java_lang_Long(_global_buffer_size.value()._size, CHECK); + } + if (_thread_buffer_size.is_set()) { + thread_buffer_size = JfrJavaSupport::new_java_lang_Long(_thread_buffer_size.value()._size, CHECK); + } + if (_max_chunk_size.is_set()) { + max_chunk_size = JfrJavaSupport::new_java_lang_Long(_max_chunk_size.value()._size, CHECK); + } + if (_memory_size.is_set()) { + memory_size = JfrJavaSupport::new_java_lang_Long(_memory_size.value()._size, CHECK); + } + if (_sample_threads.is_set()) { + sample_threads = JfrJavaSupport::new_java_lang_Boolean(_sample_threads.value(), CHECK); + } } static const char klass[] = "jdk/jfr/internal/dcmd/DCmdConfigure"; diff --git a/test/jdk/jdk/jfr/jcmd/TestJcmdConfigureReadOnly.java b/test/jdk/jdk/jfr/jcmd/TestJcmdConfigureReadOnly.java new file mode 100644 index 00000000000..6ddf3a75234 --- /dev/null +++ b/test/jdk/jdk/jfr/jcmd/TestJcmdConfigureReadOnly.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021, 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.jfr.jcmd; + +import jdk.test.lib.process.OutputAnalyzer; + +/** + * @test + * @summary The test verifies JFR.configure command can only set certain options before JFR is started. + * @key jfr + * @requires vm.hasJFR + * @library /test/lib /test/jdk + * @run main/othervm jdk.jfr.jcmd.TestJcmdConfigureReadOnly + */ +public class TestJcmdConfigureReadOnly { + public static void main(String[] args) throws Exception { + // Set an option before initializing JFR. + OutputAnalyzer output = JcmdHelper.jcmd("JFR.configure", "stackdepth=" + 128); + output.shouldContain("Stack depth: 128"); + // JFR.start will initialize JFR. + output = JcmdHelper.jcmd("JFR.start"); + JcmdAsserts.assertRecordingHasStarted(output); + // Attempt to set a new value after JFR initialization. + output = JcmdHelper.jcmd("JFR.configure", "stackdepth=" + 256); + // After initialization, the option is considered read-only. + output.shouldContain("Stack depth: 128"); + } +} -- GitLab From 84baea753a01428d9dc5befa5f23d4ac853a7bbc Mon Sep 17 00:00:00 2001 From: Julia Boes Date: Thu, 9 Dec 2021 09:29:08 +0000 Subject: [PATCH 701/890] 8278433: Use snippets in jdk.incubator.foreign documentation Reviewed-by: mcimadamore --- .../jdk/incubator/foreign/CLinker.java | 6 +- .../jdk/incubator/foreign/MemoryAddress.java | 18 +-- .../jdk/incubator/foreign/MemoryHandles.java | 36 +++--- .../jdk/incubator/foreign/MemoryLayout.java | 114 +++++++++--------- .../jdk/incubator/foreign/MemorySegment.java | 110 ++++++++--------- .../jdk/incubator/foreign/ResourceScope.java | 38 +++--- .../incubator/foreign/SegmentAllocator.java | 36 +++--- .../jdk/incubator/foreign/SequenceLayout.java | 52 ++++---- .../jdk/incubator/foreign/ValueLayout.java | 56 ++++----- .../jdk/incubator/foreign/package-info.java | 113 +++++++++-------- 10 files changed, 289 insertions(+), 290 deletions(-) diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java index f5f1a6dc313..745e27691dd 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/CLinker.java @@ -181,9 +181,9 @@ public sealed interface CLinker extends SymbolLookup permits Windowsx64Linker, S * to allocate structs returned by-value. *

      * Calling this method is equivalent to the following code: -

      {@code
      -    linker.downcallHandle(function).bindTo(symbol);
      -}
      + * {@snippet lang=java : + * linker.downcallHandle(function).bindTo(symbol); + * } * * @param symbol downcall symbol. * @param function the function descriptor. diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java index ce1a77c41b3..4856a66008d 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -46,17 +46,17 @@ import java.nio.ByteOrder; * Each dereference method takes a {@linkplain jdk.incubator.foreign.ValueLayout value layout}, which specifies the size, * alignment constraints, byte order as well as the Java type associated with the dereference operation, and an offset. * For instance, to read an int from a segment, using {@link ByteOrder#nativeOrder() default endianness}, the following code can be used: - *
      {@code
      -MemoryAddress address = ...
      -int value = address.get(ValueLayout.JAVA_INT, 0);
      - * }
      + * {@snippet lang=java : + * MemoryAddress address = ... + * int value = address.get(ValueLayout.JAVA_INT, 0); + * } * * If the value to be read is stored in memory using {@link ByteOrder#BIG_ENDIAN big-endian} encoding, the dereference operation * can be expressed as follows: - *
      {@code
      -MemoryAddress address = ...
      -int value = address.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0);
      - * }
      + * {@snippet lang=java : + * MemoryAddress address = ... + * int value = address.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0); + * } * * All the dereference methods in this class are restricted: since * a memory address does not feature temporal nor spatial bounds, the runtime has no way to check the correctness diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java index f4489ecd601..f24f5c7bc6e 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryHandles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -47,17 +47,17 @@ import java.util.Objects; * to the segment, at which dereference should occur. *

      * As an example, consider the memory layout expressed by a {@link GroupLayout} instance constructed as follows: - *

      {@code
      -GroupLayout seq = MemoryLayout.structLayout(
      -        MemoryLayout.paddingLayout(32),
      -        ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN).withName("value")
      -);
      - * }
      + * {@snippet lang=java : + * GroupLayout seq = MemoryLayout.structLayout( + * MemoryLayout.paddingLayout(32), + * ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN).withName("value") + * ); + * } * To access the member layout named {@code value}, we can construct a memory access var handle as follows: - *
      {@code
      -VarHandle handle = MemoryHandles.varHandle(ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)); //(MemorySegment, long) -> int
      -handle = MemoryHandles.insertCoordinates(handle, 1, 4); //(MemorySegment) -> int
      - * }
      + * {@snippet lang=java : + * VarHandle handle = MemoryHandles.varHandle(ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)); //(MemorySegment, long) -> int + * handle = MemoryHandles.insertCoordinates(handle, 1, 4); //(MemorySegment) -> int + * } * *

      Unless otherwise specified, passing a {@code null} argument, or an array argument containing one or more {@code null} * elements to a method in this class causes a {@link NullPointerException NullPointerException} to be thrown.

      @@ -177,13 +177,13 @@ public final class MemoryHandles { * example, it is often convenient to model an unsigned short as a * Java {@code int} to avoid dealing with negative values, which would be * the case if modeled as a Java {@code short}. This is illustrated in the following example: - *
      {@code
      -    MemorySegment segment = MemorySegment.allocateNative(2, ResourceScope.newImplicitScope());
      -    VarHandle SHORT_VH = ValueLayout.JAVA_SHORT.varHandle();
      -    VarHandle INT_VH = MemoryHandles.asUnsigned(SHORT_VH, int.class);
      -    SHORT_VH.set(segment, (short)-1);
      -    INT_VH.get(segment); // returns 65535
      -     * }
      + * {@snippet lang=java : + * MemorySegment segment = MemorySegment.allocateNative(2, ResourceScope.newImplicitScope()); + * VarHandle SHORT_VH = ValueLayout.JAVA_SHORT.varHandle(); + * VarHandle INT_VH = MemoryHandles.asUnsigned(SHORT_VH, int.class); + * SHORT_VH.set(segment, (short)-1); + * INT_VH.get(segment); // returns 65535 + * } *

      * When calling e.g. {@link VarHandle#set(Object...)} on the resulting var * handle, the incoming value (of type {@code adaptedType}) is converted by a diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java index 8319f22c2ab..fe0fb4e93f9 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -58,24 +58,24 @@ import java.util.stream.Stream; *

      * For instance, consider the following struct declaration in C: * - *

      {@code
      - typedef struct {
      -     char kind;
      -     int value;
      - } TaggedValues[5];
      - * }
      + * {@snippet lang=c : + * typedef struct { + * char kind; + * int value; + * } TaggedValues[5]; + * } * * The above declaration can be modelled using a layout object, as follows: * - *
      {@code
      -SequenceLayout taggedValues = MemoryLayout.sequenceLayout(5,
      -    MemoryLayout.structLayout(
      -        ValueLayout.JAVA_BYTE.withName("kind"),
      -        MemoryLayout.paddingLayout(24),
      -        ValueLayout.JAVA_INT.withName("value")
      -    )
      -).withName("TaggedValues");
      - * }
      + * {@snippet lang=java : + * SequenceLayout taggedValues = MemoryLayout.sequenceLayout(5, + * MemoryLayout.structLayout( + * ValueLayout.JAVA_BYTE.withName("kind"), + * MemoryLayout.paddingLayout(24), + * ValueLayout.JAVA_INT.withName("value") + * ) + * ).withName("TaggedValues"); + * } *

      * All implementations of this interface must be value-based; * programmers should treat instances that are {@linkplain #equals(Object) equal} as interchangeable and should not @@ -129,42 +129,42 @@ SequenceLayout taggedValues = MemoryLayout.sequenceLayout(5, * Such layout paths can be constructed programmatically using the methods in this class. * For instance, given the {@code taggedValues} layout instance constructed as above, we can obtain the offset, * in bits, of the member layout named value in the first sequence element, as follows: - *

      {@code
      -long valueOffset = taggedValues.bitOffset(PathElement.sequenceElement(0),
      -                                          PathElement.groupElement("value")); // yields 32
      - * }
      + * {@snippet lang=java : + * long valueOffset = taggedValues.bitOffset(PathElement.sequenceElement(0), + * PathElement.groupElement("value")); // yields 32 + * } * * Similarly, we can select the member layout named {@code value}, as follows: - *
      {@code
      -MemoryLayout value = taggedValues.select(PathElement.sequenceElement(),
      -                                         PathElement.groupElement("value"));
      - * }
      + * {@snippet lang=java : + * MemoryLayout value = taggedValues.select(PathElement.sequenceElement(), + * PathElement.groupElement("value")); + * } * * And, we can also replace the layout named {@code value} with another layout, as follows: - *
      {@code
      -MemoryLayout taggedValuesWithHole = taggedValues.map(l -> MemoryLayout.paddingLayout(32),
      -                                            PathElement.sequenceElement(), PathElement.groupElement("value"));
      - * }
      + * {@snippet lang=java : + * MemoryLayout taggedValuesWithHole = taggedValues.map(l -> MemoryLayout.paddingLayout(32), + * PathElement.sequenceElement(), PathElement.groupElement("value")); + * } * * That is, the above declaration is identical to the following, more verbose one: - *
      {@code
      -MemoryLayout taggedValuesWithHole = MemoryLayout.sequenceLayout(5,
      -    MemoryLayout.structLayout(
      -        ValueLayout.JAVA_BYTE.withName("kind"),
      -        MemoryLayout.paddingLayout(32),
      -        MemoryLayout.paddingLayout(32)
      -));
      - * }
      + * {@snippet lang=java : + * MemoryLayout taggedValuesWithHole = MemoryLayout.sequenceLayout(5, + * MemoryLayout.structLayout( + * ValueLayout.JAVA_BYTE.withName("kind"), + * MemoryLayout.paddingLayout(32), + * MemoryLayout.paddingLayout(32) + * )); + * } * * Layout paths can feature one or more free dimensions. For instance, a layout path traversing * an unspecified sequence element (that is, where one of the path component was obtained with the * {@link PathElement#sequenceElement()} method) features an additional free dimension, which will have to be bound at runtime. * This is important when obtaining memory access var handle from layouts, as in the following code: * - *
      {@code
      -VarHandle valueHandle = taggedValues.varHandle(PathElement.sequenceElement(),
      -                                               PathElement.groupElement("value"));
      - * }
      + * {@snippet lang=java : + * VarHandle valueHandle = taggedValues.varHandle(PathElement.sequenceElement(), + * PathElement.groupElement("value")); + * } * * Since the layout path constructed in the above example features exactly one free dimension (as it doesn't specify * which member layout named {@code value} should be selected from the enclosing sequence layout), @@ -177,12 +177,12 @@ VarHandle valueHandle = taggedValues.varHandle(PathElement.sequenceElement(), * offsets of elements of a sequence at different indices, by supplying these indices when invoking the method handle. * For instance: * - *
      {@code
      -MethodHandle offsetHandle = taggedValues.byteOffsetHandle(PathElement.sequenceElement(),
      -                                                          PathElement.groupElement("kind"));
      -long offset1 = (long) offsetHandle.invokeExact(1L); // 8
      -long offset2 = (long) offsetHandle.invokeExact(2L); // 16
      - * }
      + * {@snippet lang=java : + * MethodHandle offsetHandle = taggedValues.byteOffsetHandle(PathElement.sequenceElement(), + * PathElement.groupElement("kind")); + * long offset1 = (long) offsetHandle.invokeExact(1L); // 8 + * long offset2 = (long) offsetHandle.invokeExact(2L); // 16 + * } * *

      Layout attributes

      * @@ -330,7 +330,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S *

      The final offset returned by the method handle is computed as follows: * *

      {@code
      -    offset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
      +     * offset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
            * }
      * * where {@code x_1}, {@code x_2}, ... {@code x_n} are dynamic values provided as {@code long} @@ -381,8 +381,8 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S *

      The final offset returned by the method handle is computed as follows: * *

      {@code
      -    bitOffset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
      -    offset = bitOffset / 8
      +     * bitOffset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
      +     * offset = bitOffset / 8
            * }
      * * where {@code x_1}, {@code x_2}, ... {@code x_n} are dynamic values provided as {@code long} @@ -413,7 +413,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * The final memory location accessed by the returned memory access var handle can be computed as follows: * *
      {@code
      -    address = base + offset
      +     * address = base + offset
            * }
      * * where {@code base} denotes the base address expressed by the {@link MemorySegment} access coordinate @@ -421,7 +421,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * can be expressed in the following form: * *
      {@code
      -    offset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
      +     * offset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
            * }
      * * where {@code x_1}, {@code x_2}, ... {@code x_n} are dynamic values provided as {@code long} @@ -458,8 +458,8 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S *

      The offset of the returned segment is computed as follows: * *

      {@code
      -    bitOffset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
      -    offset = bitOffset / 8
      +     * bitOffset = c_1 + c_2 + ... + c_m + (x_1 * s_1) + (x_2 * s_2) + ... + (x_n * s_n)
      +     * offset = bitOffset / 8
            * }
      * * where {@code x_1}, {@code x_2}, ... {@code x_n} are dynamic values provided as {@code long} @@ -468,9 +468,9 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * the layout path. * *

      After the offset is computed, the returned segment is created as if by calling: - *

      {@code
      -    segment.asSlice(offset, layout.byteSize());
      -     * }
      + * {@snippet lang=java : + * segment.asSlice(offset, layout.byteSize()); + * } * * where {@code segment} is the segment to be sliced, and where {@code layout} is the layout selected by the given * layout path, as per {@link MemoryLayout#select(PathElement...)}. @@ -599,7 +599,7 @@ public sealed interface MemoryLayout extends Constable permits AbstractLayout, S * with this path is bound by an index {@code I}, the resulting accessed offset can be obtained with the following * formula: *
      {@code
      -E * (S + I * F)
      +         * E * (S + I * F)
                * }
      * where {@code E} is the size (in bytes) of the sequence element layout. * diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java index cd0f1181863..2a577cfc296 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemorySegment.java @@ -119,17 +119,17 @@ import java.util.stream.Stream; * Each dereference method takes a {@linkplain jdk.incubator.foreign.ValueLayout value layout}, which specifies the size, * alignment constraints, byte order as well as the Java type associated with the dereference operation, and an offset. * For instance, to read an int from a segment, using {@link ByteOrder#nativeOrder() default endianness}, the following code can be used: - *
      {@code
      -MemorySegment segment = ...
      -int value = segment.get(ValueLayout.JAVA_INT, 0);
      - * }
      + * {@snippet lang=java : + * MemorySegment segment = ... + * int value = segment.get(ValueLayout.JAVA_INT, 0); + * } * * If the value to be read is stored in memory using {@link ByteOrder#BIG_ENDIAN big-endian} encoding, the dereference operation * can be expressed as follows: - *
      {@code
      -MemorySegment segment = ...
      -int value = segment.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0);
      - * }
      + * {@snippet lang=java : + * MemorySegment segment = ... + * int value = segment.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0); + * } * * For more complex dereference operations (e.g. structured memory access), clients can obtain a memory access var handle, * that is, a var handle that accepts a segment and, optionally, one or more additional {@code long} coordinates. Memory @@ -145,13 +145,13 @@ int value = segment.get(ValueLayout.JAVA_INT.withOrder(BIG_ENDIAN), 0); * the {@link #scope()} method. As for all resources associated with a resource scope, a segment cannot be * accessed after its corresponding scope has been closed. For instance, the following code will result in an * exception: - *
      {@code
      -MemorySegment segment = null;
      -try (ResourceScope scope = ResourceScope.newConfinedScope()) {
      -    segment = MemorySegment.allocateNative(8, scope);
      -}
      -segment.get(ValueLayout.JAVA_LONG, 0); // already closed!
      - * }
      + * {@snippet lang=java : + * MemorySegment segment = null; + * try (ResourceScope scope = ResourceScope.newConfinedScope()) { + * segment = MemorySegment.allocateNative(8, scope); + * } + * segment.get(ValueLayout.JAVA_LONG, 0); // already closed! + * } * Additionally, access to a memory segment is subject to the thread-confinement checks enforced by the owning scope; that is, * if the segment is associated with a shared scope, it can be accessed by multiple threads; if it is associated with a confined * scope, it can only be accessed by the thread which owns the scope. @@ -162,10 +162,10 @@ segment.get(ValueLayout.JAVA_LONG, 0); // already closed! *

      Memory segment views

      * * Memory segments support views. For instance, it is possible to create an immutable view of a memory segment, as follows: - *
      {@code
      -MemorySegment segment = ...
      -MemorySegment roSegment = segment.asReadOnly();
      - * }
      + * {@snippet lang=java : + * MemorySegment segment = ... + * MemorySegment roSegment = segment.asReadOnly(); + * } * It is also possible to create views whose spatial bounds are stricter than the ones of the original segment * (see {@link MemorySegment#asSlice(long, long)}). *

      @@ -184,15 +184,15 @@ MemorySegment roSegment = segment.asReadOnly(); * (to do this, the segment has to be associated with a shared scope). The following code can be used to sum all int * values in a memory segment in parallel: * - *

      {@code
      -try (ResourceScope scope = ResourceScope.newSharedScope()) {
      -    SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT);
      -    MemorySegment segment = MemorySegment.allocateNative(SEQUENCE_LAYOUT, scope);
      -    int sum = segment.elements(ValueLayout.JAVA_INT).parallel()
      -                           .mapToInt(s -> s.get(ValueLayout.JAVA_INT, 0))
      -                           .sum();
      -}
      - * }
      + * {@snippet lang=java : + * try (ResourceScope scope = ResourceScope.newSharedScope()) { + * SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT); + * MemorySegment segment = MemorySegment.allocateNative(SEQUENCE_LAYOUT, scope); + * int sum = segment.elements(ValueLayout.JAVA_INT).parallel() + * .mapToInt(s -> s.get(ValueLayout.JAVA_INT, 0)) + * .sum(); + * } + * } * * @implSpec * Implementations of this interface are immutable, thread-safe and value-based. @@ -233,9 +233,9 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory /** * Returns a sequential {@code Stream} over disjoint slices (whose size matches that of the specified layout) * in this segment. Calling this method is equivalent to the following code: - *
      {@code
      -    StreamSupport.stream(segment.spliterator(elementLayout), false);
      -     * }
      + * {@snippet lang=java : + * StreamSupport.stream(segment.spliterator(elementLayout), false); + * } * * @param elementLayout the layout to be used for splitting. * @return a sequential {@code Stream} over disjoint slices in this segment. @@ -274,9 +274,9 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory * and whose new size is computed by subtracting the specified offset from this segment size. *

      * Equivalent to the following code: - *

      {@code
      -    asSlice(offset, byteSize() - offset);
      -     * }
      + * {@snippet lang=java : + * asSlice(offset, byteSize() - offset); + * } * * @see #asSlice(long, long) * @@ -343,9 +343,9 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory * a negative or positive value. For instance, if both segments are native * segments, the resulting offset can be computed as follows: * - *
      {@code
      +     * {@snippet lang=java :
            * other.baseAddress().toRawLongValue() - segment.baseAddress().toRawLongValue()
      -     * }
      + * } * * If the segments share the same base address, {@code 0} is returned. If * {@code other} is a slice of this segment, the offset is always @@ -362,13 +362,13 @@ public sealed interface MemorySegment extends Addressable permits AbstractMemory * More specifically, the given value is filled into each address of this * segment. Equivalent to (but likely more efficient than) the following code: * - *
      {@code
      -byteHandle = MemoryLayout.ofSequence(ValueLayout.JAVA_BYTE)
      -         .varHandle(byte.class, MemoryLayout.PathElement.sequenceElement());
      -for (long l = 0; l < segment.byteSize(); l++) {
      -     byteHandle.set(segment.address(), l, value);
      -}
      -     * }
      + * {@snippet lang=java : + * byteHandle = MemoryLayout.ofSequence(ValueLayout.JAVA_BYTE) + * .varHandle(byte.class, MemoryLayout.PathElement.sequenceElement()); + * for (long l = 0; l < segment.byteSize(); l++) { + * byteHandle.set(segment.address(), l, value); + * } + * } * * without any regard or guarantees on the ordering of particular memory * elements being set. @@ -389,9 +389,9 @@ for (long l = 0; l < segment.byteSize(); l++) { * at offset {@code 0} through {@code src.byteSize() - 1}. *

      * Calling this method is equivalent to the following code: - *

      {@code
      -    MemorySegment.copy(src, 0, this, 0, src.byteSize);
      -     * }
      + * {@snippet lang=java : + * MemorySegment.copy(src, 0, this, 0, src.byteSize); + * } * @param src the source segment. * @throws IndexOutOfBoundsException if {@code src.byteSize() > this.byteSize()}. * @throws IllegalStateException if either the scope associated with the source segment or the scope associated @@ -801,9 +801,9 @@ for (long l = 0; l < segment.byteSize(); l++) { * when the segment is no longer in use. Failure to do so will result in off-heap memory leaks. *

      * This is equivalent to the following code: - *

      {@code
      -    allocateNative(layout.bytesSize(), layout.bytesAlignment(), scope);
      -     * }
      + * {@snippet lang=java : + * allocateNative(layout.bytesSize(), layout.bytesAlignment(), scope); + * } *

      * The block of off-heap memory associated with the returned native memory segment is initialized to zero. * @@ -826,9 +826,9 @@ for (long l = 0; l < segment.byteSize(); l++) { * when the segment is no longer in use. Failure to do so will result in off-heap memory leaks. *

      * This is equivalent to the following code: - *

      {@code
      -    allocateNative(bytesSize, 1, scope);
      -     * }
      + * {@snippet lang=java : + * allocateNative(bytesSize, 1, scope); + * } *

      * The block of off-heap memory associated with the returned native memory segment is initialized to zero. * @@ -935,9 +935,9 @@ for (long l = 0; l < segment.byteSize(); l++) { * For example, this may occur if the same file is {@linkplain MemorySegment#mapFile mapped} to two segments. *

      * Calling this method is equivalent to the following code: - *

      {@code
      -    MemorySegment.copy(srcSegment, ValueLayout.JAVA_BYTE, srcOffset, dstSegment, ValueLayout.JAVA_BYTE, dstOffset, bytes);
      -     * }
      + * {@snippet lang=java : + * MemorySegment.copy(srcSegment, ValueLayout.JAVA_BYTE, srcOffset, dstSegment, ValueLayout.JAVA_BYTE, dstOffset, bytes); + * } * @param srcSegment the source segment. * @param srcOffset the starting offset, in bytes, of the source segment. * @param dstSegment the destination segment. diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java index f2fb32a0594..24665c7dfe9 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ResourceScope.java @@ -103,15 +103,15 @@ import java.util.Spliterator; * segment and allow multiple threads to work in parallel on disjoint segment slices. The following code can be used to sum * all int values in a memory segment in parallel: * - *
      {@code
      -try (ResourceScope scope = ResourceScope.newSharedScope()) {
      -    SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT);
      -    MemorySegment segment = MemorySegment.allocateNative(SEQUENCE_LAYOUT, scope);
      -    int sum = segment.elements(ValueLayout.JAVA_INT).parallel()
      -                        .mapToInt(s -> s.get(ValueLayout.JAVA_INT, 0))
      -                        .sum();
      -}
      - * }
      + * {@snippet lang=java : + * try (ResourceScope scope = ResourceScope.newSharedScope()) { + * SequenceLayout SEQUENCE_LAYOUT = MemoryLayout.sequenceLayout(1024, ValueLayout.JAVA_INT); + * MemorySegment segment = MemorySegment.allocateNative(SEQUENCE_LAYOUT, scope); + * int sum = segment.elements(ValueLayout.JAVA_INT).parallel() + * .mapToInt(s -> s.get(ValueLayout.JAVA_INT, 0)) + * .sum(); + * } + * } * *

      * Shared resource scopes, while powerful, must be used with caution: if one or more threads accesses @@ -131,13 +131,13 @@ try (ResourceScope scope = ResourceScope.newSharedScope()) { * This can be useful when clients need to perform a critical operation on a memory segment, during which they have * to ensure that the scope associated with that segment will not be closed; this can be done as follows: * - *

      {@code
      -MemorySegment segment = ...
      -try (ResourceScope criticalScope = ResourceScope.newConfinedScope()) {
      -    criticalScope.keepAlive(segment.scope());
      -    
      -}
      - * }
      + * {@snippet lang=java : + * MemorySegment segment = ... + * try (ResourceScope criticalScope = ResourceScope.newConfinedScope()) { + * criticalScope.keepAlive(segment.scope()); + * + * } + * } * * Note that a resource scope does not become unreachable * until all the scopes it depends on have been closed. @@ -239,9 +239,9 @@ public sealed interface ResourceScope extends AutoCloseable permits ResourceScop /** * Creates a new shared scope, managed by a private {@link Cleaner} instance. Equivalent to (but likely more efficient than) * the following code: - *
      {@code
      -    newSharedScope(Cleaner.create());
      -     * }
      + * {@snippet lang=java : + * newSharedScope(Cleaner.create()); + * } * @return a shared scope, managed by a private {@link Cleaner} instance. */ static ResourceScope newImplicitScope() { diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java index 622308da088..d2f112c5d37 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SegmentAllocator.java @@ -339,9 +339,9 @@ public interface SegmentAllocator { /** * Returns a native unbounded arena-based allocator, with predefined block size and maximum arena size, * associated with the provided scope. Equivalent to the following code: - *
      {@code
      -    SegmentAllocator.newNativeArena(Long.MAX_VALUE, predefinedBlockSize, scope);
      -     * }
      + * {@snippet lang=java : + * SegmentAllocator.newNativeArena(Long.MAX_VALUE, predefinedBlockSize, scope); + * } * * @param scope the scope associated with the segments returned by the arena-based allocator. * @return a new unbounded arena-based allocator @@ -355,9 +355,9 @@ public interface SegmentAllocator { /** * Returns a native unbounded arena-based allocator, with block size set to the specified arena size, associated with * the provided scope, with given arena size. Equivalent to the following code: - *
      {@code
      -    SegmentAllocator.newNativeArena(arenaSize, arenaSize, scope);
      -     * }
      + * {@snippet lang=java : + * SegmentAllocator.newNativeArena(arenaSize, arenaSize, scope); + * } * * @param arenaSize the size (in bytes) of the allocation arena. * @param scope the scope associated with the segments returned by the arena-based allocator. @@ -416,10 +416,10 @@ public interface SegmentAllocator { * each new allocation request will return a new slice starting at the segment offset {@code 0} (alignment * constraints are ignored by this allocator), hence the name prefix allocator. * Equivalent to (but likely more efficient than) the following code: - *
      {@code
      -    MemorySegment segment = ...
      -    SegmentAllocator prefixAllocator = (size, align) -> segment.asSlice(0, size);
      -     * }
      + * {@snippet lang=java : + * MemorySegment segment = ... + * SegmentAllocator prefixAllocator = (size, align) -> segment.asSlice(0, size); + * } *

      * This allocator can be useful to limit allocation requests in case a client * knows that they have fully processed the contents of the allocated segment before the subsequent allocation request @@ -439,10 +439,10 @@ public interface SegmentAllocator { /** * Returns a native allocator, associated with the provided scope. Equivalent to (but likely more efficient than) * the following code: - *

      {@code
      -    ResourceScope scope = ...
      -    SegmentAllocator nativeAllocator = (size, align) -> MemorySegment.allocateNative(size, align, scope);
      -     * }
      + * {@snippet lang=java : + * ResourceScope scope = ... + * SegmentAllocator nativeAllocator = (size, align) -> MemorySegment.allocateNative(size, align, scope); + * } * * @param scope the scope associated with the returned allocator. * @return a native allocator, associated with the provided scope. @@ -455,10 +455,10 @@ public interface SegmentAllocator { /** * Returns a native allocator which allocates segments in independent {@linkplain ResourceScope#newImplicitScope() implicit scopes}. * Equivalent to (but likely more efficient than) the following code: - *
      {@code
      -    ResourceScope scope = ...
      -    SegmentAllocator implicitAllocator = (size, align) -> MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope());
      -     * }
      + * {@snippet lang=java : + * ResourceScope scope = ... + * SegmentAllocator implicitAllocator = (size, align) -> MemorySegment.allocateNative(size, align, ResourceScope.newImplicitScope()); + * } * * @return a native allocator which allocates segments in independent {@linkplain ResourceScope#newImplicitScope() implicit scopes}. */ diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java index e751830313b..13ac7192728 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SequenceLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -37,18 +37,18 @@ import java.util.OptionalLong; * A finite sequence layout can be thought of as a group layout where the sequence layout's element layout is repeated a number of times * that is equal to the sequence layout's element count. In other words this layout: * - *
      {@code
      -MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN));
      - * }
      + * {@snippet lang=java : + * MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)); + * } * * is equivalent to the following layout: * - *
      {@code
      -MemoryLayout.structLayout(
      -    ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN),
      -    ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN),
      -    ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN));
      - * }
      + * {@snippet lang=java : + * MemoryLayout.structLayout( + * ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), + * ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN), + * ValueLayout.JAVA_INT.withOrder(ByteOrder.BIG_ENDIAN)); + * } * *

      * This is a value-based @@ -119,22 +119,22 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout * as the flattened projection of this sequence layout. *

      * For instance, given a sequence layout of the kind: - *

      {@code
      -    var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT));
      -     * }
      + * {@snippet lang=java : + * var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT)); + * } * calling {@code seq.reshape(2, 6)} will yield the following sequence layout: - *
      {@code
      -    var reshapeSeq = MemoryLayout.sequenceLayout(2, MemoryLayout.sequenceLayout(6, ValueLayout.JAVA_INT));
      -     * }
      + * {@snippet lang=java : + * var reshapeSeq = MemoryLayout.sequenceLayout(2, MemoryLayout.sequenceLayout(6, ValueLayout.JAVA_INT)); + * } *

      * If one of the provided element count is the special value {@code -1}, then the element * count in that position will be inferred from the remaining element counts and the * element count of the flattened projection of this layout. For instance, a layout equivalent to * the above {@code reshapeSeq} can also be computed in the following ways: - *

      {@code
      -    var reshapeSeqImplicit1 = seq.reshape(-1, 6);
      -    var reshapeSeqImplicit2 = seq.reshape(2, -1);
      -     * }
      + * {@snippet lang=java : + * var reshapeSeqImplicit1 = seq.reshape(-1, 6); + * var reshapeSeqImplicit2 = seq.reshape(2, -1); + * } * @param elementCounts an array of element counts, of which at most one can be {@code -1}. * @return a new sequence layout where element layouts in the flattened projection of this * sequence layout (see {@link #flatten()}) are re-arranged into one or more nested sequence layouts. @@ -195,13 +195,13 @@ public final class SequenceLayout extends AbstractLayout implements MemoryLayout * This transformation preserves the layout size; nested sequence layout in this sequence layout will * be dropped and their element counts will be incorporated into that of the returned sequence layout. * For instance, given a sequence layout of the kind: - *
      {@code
      -    var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT));
      -     * }
      + * {@snippet lang=java : + * var seq = MemoryLayout.sequenceLayout(4, MemoryLayout.sequenceLayout(3, ValueLayout.JAVA_INT)); + * } * calling {@code seq.flatten()} will yield the following sequence layout: - *
      {@code
      -    var flattenedSeq = MemoryLayout.sequenceLayout(12, ValueLayout.JAVA_INT);
      -     * }
      + * {@snippet lang=java : + * var flattenedSeq = MemoryLayout.sequenceLayout(12, ValueLayout.JAVA_INT); + * } * @return a new sequence layout with the same size as this layout (but, possibly, with different * element count), whose element layout is not a sequence layout. * @throws UnsupportedOperationException if this sequence layout, or one of the nested sequence layouts being diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java index 36a3c6b5b9d..c6d63c3ca1c 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/ValueLayout.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -516,9 +516,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a machine address (e.g. {@code size_t}), * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(MemoryAddress.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(MemoryAddress.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfAddress ADDRESS = new OfAddress(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -526,9 +526,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code byte}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(byte.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(byte.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfByte JAVA_BYTE = new OfByte(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -536,9 +536,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code boolean}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(boolean.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(boolean.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfBoolean JAVA_BOOLEAN = new OfBoolean(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -546,9 +546,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code char}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(char.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(char.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfChar JAVA_CHAR = new OfChar(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -556,9 +556,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code short}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(short.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(short.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfShort JAVA_SHORT = new OfShort(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -566,9 +566,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code int}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(int.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(int.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfInt JAVA_INT = new OfInt(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -576,9 +576,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code long}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(long.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(long.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfLong JAVA_LONG = new OfLong(ByteOrder.nativeOrder()) .withBitAlignment(8); @@ -587,9 +587,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code float}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(float.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(float.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfFloat JAVA_FLOAT = new OfFloat(ByteOrder.nativeOrder()).withBitAlignment(8); @@ -597,9 +597,9 @@ public sealed class ValueLayout extends AbstractLayout implements MemoryLayout { * A value layout constant whose size is the same as that of a Java {@code double}, * bit-alignment set to 8, and byte order set to {@link ByteOrder#nativeOrder()}. * Equivalent to the following code: - *
      {@code
      -    MemoryLayout.valueLayout(double.class, ByteOrder.nativeOrder()).withBitAlignment(8);
      -     * }
      + * {@snippet lang=java : + * MemoryLayout.valueLayout(double.class, ByteOrder.nativeOrder()).withBitAlignment(8); + * } */ public static final OfDouble JAVA_DOUBLE = new OfDouble(ByteOrder.nativeOrder()).withBitAlignment(8); } diff --git a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java index 82bc2f53d4b..a6d140e4266 100644 --- a/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java +++ b/src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/package-info.java @@ -43,12 +43,12 @@ * For example, to allocate an off-heap memory region big enough to hold 10 values of the primitive type {@code int}, and fill it with values * ranging from {@code 0} to {@code 9}, we can use the following code: * - *
      {@code
      -MemorySegment segment = MemorySegment.allocateNative(10 * 4, ResourceScope.newImplicitScope());
      -for (int i = 0 ; i < 10 ; i++) {
      -   segment.setAtIndex(ValueLayout.JAVA_INT, i, i);
      -}
      - * }
      + * {@snippet lang=java : + * MemorySegment segment = MemorySegment.allocateNative(10 * 4, ResourceScope.newImplicitScope()); + * for (int i = 0 ; i < 10 ; i++) { + * segment.setAtIndex(ValueLayout.JAVA_INT, i, i); + * } + * } * * This code creates a native memory segment, that is, a memory segment backed by * off-heap memory; the size of the segment is 40 bytes, enough to store 10 values of the primitive type {@code int}. @@ -69,14 +69,14 @@ for (int i = 0 ; i < 10 ; i++) { * Clients that operate under these assumptions might want to programmatically release the memory associated * with a memory segment. This can be done, using the {@link jdk.incubator.foreign.ResourceScope} abstraction, as shown below: * - *
      {@code
      -try (ResourceScope scope = ResourceScope.newConfinedScope()) {
      -    MemorySegment segment = MemorySegment.allocateNative(10 * 4, scope);
      -    for (int i = 0 ; i < 10 ; i++) {
      -        segment.setAtIndex(ValueLayout.JAVA_INT, i, i);
      -    }
      -}
      - * }
      + * {@snippet lang=java : + * try (ResourceScope scope = ResourceScope.newConfinedScope()) { + * MemorySegment segment = MemorySegment.allocateNative(10 * 4, scope); + * for (int i = 0 ; i < 10 ; i++) { + * segment.setAtIndex(ValueLayout.JAVA_INT, i, i); + * } + * } + * } * * This example is almost identical to the prior one; this time we first create a so called resource scope, * which is used to bind the life-cycle of the segment created immediately afterwards. Note the use of the @@ -107,19 +107,19 @@ try (ResourceScope scope = ResourceScope.newConfinedScope()) { * For example, to compute the length of a string using the C standard library function {@code strlen} on a Linux x64 platform, * we can use the following code: * - *
      {@code
      -      var linker = CLinker.systemCLinker();
      -      MethodHandle strlen = linker.downcallHandle(
      -        linker.lookup("strlen").get(),
      -        FunctionDescriptor.of(ValueLayout.JAVA_LONG, ValueLayout.ADDRESS)
      -      );
      -
      -      try (var scope = ResourceScope.newConfinedScope()) {
      -         var cString = MemorySegment.allocateNative(5 + 1, scope);
      -         cString.setUtf8String("Hello");
      -         long len = (long)strlen.invoke(cString); // 5
      -      }
      - * }
      + * {@snippet lang=java : + * var linker = CLinker.systemCLinker(); + * MethodHandle strlen = linker.downcallHandle( + * linker.lookup("strlen").get(), + * FunctionDescriptor.of(ValueLayout.JAVA_LONG, ValueLayout.ADDRESS) + * ); + * + * try (var scope = ResourceScope.newConfinedScope()) { + * var cString = MemorySegment.allocateNative(5 + 1, scope); + * cString.setUtf8String("Hello"); + * long len = (long)strlen.invoke(cString); // 5 + * } + * } * * Here, we obtain a {@linkplain jdk.incubator.foreign.CLinker#systemCLinker() linker instance} and we use it * to {@linkplain jdk.incubator.foreign.CLinker#lookup(java.lang.String) lookup} the {@code strlen} symbol in the @@ -148,11 +148,10 @@ try (ResourceScope scope = ResourceScope.newConfinedScope()) { * {@linkplain jdk.incubator.foreign.MemoryAddress#get(jdk.incubator.foreign.ValueLayout.OfInt, long) dereference methods} * provided: * - *
      {@code
      -...
      -MemoryAddress addr = ... //obtain address from native code
      -int x = addr.get(ValueLayout.JAVA_INT, 0);
      - * }
      + * {@snippet lang=java : + * MemoryAddress addr = ... //obtain address from native code + * int x = addr.get(ValueLayout.JAVA_INT, 0); + * } * * Alternatively, the client can * {@linkplain jdk.incubator.foreign.MemorySegment#ofAddress(jdk.incubator.foreign.MemoryAddress, long, jdk.incubator.foreign.ResourceScope) create} @@ -160,36 +159,36 @@ int x = addr.get(ValueLayout.JAVA_INT, 0); * for instance, be available in the documentation of the foreign function which produced the native address. * Here is how an unsafe segment can be created from a native address: * - *
      {@code
      -ResourceScope scope = ... // initialize a resource scope object
      -MemoryAddress addr = ... //obtain address from native code
      -MemorySegment segment = MemorySegment.ofAddress(addr, 4, scope); // segment is 4 bytes long
      -int x = segment.get(ValueLayout.JAVA_INT, 0);
      - * }
      + * {@snippet lang=java : + * ResourceScope scope = ... // initialize a resource scope object + * MemoryAddress addr = ... //obtain address from native code + * MemorySegment segment = MemorySegment.ofAddress(addr, 4, scope); // segment is 4 bytes long + * int x = segment.get(ValueLayout.JAVA_INT, 0); + * } * *

      Upcalls

      * The {@link jdk.incubator.foreign.CLinker} interface also allows to turn an existing method handle (which might point * to a Java method) into a memory address, so that Java code can effectively be passed to other foreign functions. * For instance, we can write a method that compares two integer values, as follows: * - *
      {@code
      -class IntComparator {
      -    static int intCompare(MemoryAddress addr1, MemoryAddress addr2) {
      -        return addr1.get(ValueLayout.JAVA_INT, 0) - addr2.get(ValueLayout.JAVA_INT, 0);
      -    }
      -}
      - * }
      + * {@snippet lang=java : + * class IntComparator { + * static int intCompare(MemoryAddress addr1, MemoryAddress addr2) { + * return addr1.get(ValueLayout.JAVA_INT, 0) - addr2.get(ValueLayout.JAVA_INT, 0); + * } + * } + * } * * The above method dereferences two memory addresses containing an integer value, and performs a simple comparison * by returning the difference between such values. We can then obtain a method handle which targets the above static * method, as follows: * - *
      {@code
      -FunctionDescriptor intCompareDescriptor = FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS);
      -MethodHandle intCompareHandle = MethodHandles.lookup().findStatic(IntComparator.class,
      -                                                   "intCompare",
      -                                                   CLinker.upcallType(comparFunction));
      - * }
      + * {@snippet lang=java : + * FunctionDescriptor intCompareDescriptor = FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS); + * MethodHandle intCompareHandle = MethodHandles.lookup().findStatic(IntComparator.class, + * "intCompare", + * CLinker.upcallType(comparFunction)); + * } * * As before, we need to create a {@link jdk.incubator.foreign.FunctionDescriptor} instance, this time describing the signature * of the function pointer we want to create. The descriptor can be used to @@ -199,12 +198,12 @@ MethodHandle intCompareHandle = MethodHandles.lookup().findStatic(IntComparator. * Now that we have a method handle instance, we can turn it into a fresh function pointer, * using the {@link jdk.incubator.foreign.CLinker} interface, as follows: * - *
      {@code
      -ResourceScope scope = ...
      -Addressable comparFunc = CLinker.systemCLinker().upcallStub(
      -     intCompareHandle, intCompareDescriptor, scope);
      -);
      - * }
      + * {@snippet lang=java : + * ResourceScope scope = ... + * Addressable comparFunc = CLinker.systemCLinker().upcallStub( + * intCompareHandle, intCompareDescriptor, scope); + * ); + * } * * The {@link jdk.incubator.foreign.FunctionDescriptor} instance created in the previous step is then used to * {@linkplain jdk.incubator.foreign.CLinker#upcallStub(java.lang.invoke.MethodHandle, jdk.incubator.foreign.FunctionDescriptor, jdk.incubator.foreign.ResourceScope) create} -- GitLab From 965ea8d9cd29aee41ba2b1b0b0c67bb67eca22dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Thu, 9 Dec 2021 09:29:59 +0000 Subject: [PATCH 702/890] 8274298: JFR Thread Sampler thread must not acquire malloc lock after suspending a thread because of possible deadlock Reviewed-by: egahlin --- .../periodic/sampling/jfrThreadSampler.cpp | 30 +++++++++++- .../periodic/sampling/jfrThreadSampler.hpp | 1 + .../types/traceid/jfrTraceIdKlassQueue.cpp | 8 +++ .../types/traceid/jfrTraceIdKlassQueue.hpp | 6 ++- .../types/traceid/jfrTraceIdLoadBarrier.cpp | 8 +++ .../types/traceid/jfrTraceIdLoadBarrier.hpp | 5 ++ .../jfr/recorder/stacktrace/jfrStackTrace.cpp | 16 +++++- .../share/jfr/utilities/jfrEpochQueue.hpp | 14 +++--- .../jfr/utilities/jfrEpochQueue.inline.hpp | 49 ++++++++++++------- 9 files changed, 109 insertions(+), 28 deletions(-) diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp index 35a3c8fb43b..c09c634e550 100644 --- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp +++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp @@ -27,8 +27,10 @@ #include "jfr/recorder/jfrRecorder.hpp" #include "jfr/periodic/sampling/jfrCallTrace.hpp" #include "jfr/periodic/sampling/jfrThreadSampler.hpp" +#include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.inline.hpp" #include "jfr/recorder/service/jfrOptionSet.hpp" #include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp" +#include "jfr/recorder/storage/jfrBuffer.hpp" #include "jfr/support/jfrThreadId.hpp" #include "jfr/support/jfrThreadLocal.hpp" #include "jfr/utilities/jfrTime.hpp" @@ -323,10 +325,15 @@ class JfrThreadSampler : public NonJavaThread { JavaThread* _last_thread_native; size_t _interval_java; size_t _interval_native; + const size_t _min_size; // for enqueue buffer monitoring + const size_t _renew_size; int _cur_index; const u4 _max_frames; volatile bool _disenrolled; + const JfrBuffer* get_enqueue_buffer(); + const JfrBuffer* renew_if_full(const JfrBuffer* enqueue_buffer); + JavaThread* next_thread(ThreadsList* t_list, JavaThread* first_sampled, JavaThread* current); void task_stacktrace(JfrSampleType type, JavaThread** last_thread); JfrThreadSampler(size_t interval_java, size_t interval_native, u4 max_frames); @@ -396,6 +403,8 @@ JfrThreadSampler::JfrThreadSampler(size_t interval_java, size_t interval_native, _last_thread_native(NULL), _interval_java(interval_java), _interval_native(interval_native), + _min_size(JfrOptionSet::stackdepth() * sizeof(intptr_t)), + _renew_size(_min_size * 2), _cur_index(-1), _max_frames(max_frames), _disenrolled(true) { @@ -520,6 +529,15 @@ void JfrThreadSampler::post_run() { delete this; } +const JfrBuffer* JfrThreadSampler::get_enqueue_buffer() { + const JfrBuffer* buffer = JfrTraceIdLoadBarrier::get_enqueue_buffer(this); + return buffer != nullptr ? renew_if_full(buffer) : JfrTraceIdLoadBarrier::renew_enqueue_buffer(_renew_size, this); +} + +const JfrBuffer* JfrThreadSampler::renew_if_full(const JfrBuffer* enqueue_buffer) { + assert(enqueue_buffer != nullptr, "invariant"); + return enqueue_buffer->free_size() < _min_size ? JfrTraceIdLoadBarrier::renew_enqueue_buffer(_renew_size, this) : enqueue_buffer; +} void JfrThreadSampler::task_stacktrace(JfrSampleType type, JavaThread** last_thread) { ResourceMark rm; @@ -530,7 +548,6 @@ void JfrThreadSampler::task_stacktrace(JfrSampleType type, JavaThread** last_thr const uint sample_limit = JAVA_SAMPLE == type ? MAX_NR_OF_JAVA_SAMPLES : MAX_NR_OF_NATIVE_SAMPLES; uint num_samples = 0; JavaThread* start = NULL; - { elapsedTimer sample_time; sample_time.start(); @@ -542,6 +559,15 @@ void JfrThreadSampler::task_stacktrace(JfrSampleType type, JavaThread** last_thr _cur_index = tlh.list()->find_index_of_JavaThread(*last_thread); JavaThread* current = _cur_index != -1 ? *last_thread : NULL; + // Explicitly monitor the available space of the thread-local buffer used by the load barrier + // for enqueuing klasses as part of tagging methods. We do this because if space becomes sparse, + // we cannot rely on the implicit allocation of a new buffer as part of the regular tag mechanism. + // If the free list is empty, a malloc could result, and the problem with that is that the thread + // we have suspended could be the holder of the malloc lock. Instead, the buffer is pre-emptively + // renewed before thread suspension. + const JfrBuffer* enqueue_buffer = get_enqueue_buffer(); + assert(enqueue_buffer != nullptr, "invariant"); + while (num_samples < sample_limit) { current = next_thread(tlh.list(), start, current); if (current == NULL) { @@ -553,9 +579,11 @@ void JfrThreadSampler::task_stacktrace(JfrSampleType type, JavaThread** last_thr if (current->is_Compiler_thread()) { continue; } + assert(enqueue_buffer->free_size() >= _min_size, "invariant"); if (sample_task.do_sample_thread(current, _frames, _max_frames, type)) { num_samples++; } + enqueue_buffer = renew_if_full(enqueue_buffer); } *last_thread = current; // remember the thread we last attempted to sample } diff --git a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.hpp b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.hpp index a036be65aee..709ebb42d61 100644 --- a/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.hpp +++ b/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.hpp @@ -28,6 +28,7 @@ #include "jfr/utilities/jfrAllocation.hpp" class JavaThread; +class JfrBuffer; class JfrStackFrame; class JfrThreadSampler; class Thread; diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp index 7344e2aa6b4..fab51e0b92d 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.cpp @@ -247,6 +247,14 @@ void JfrTraceIdKlassQueue::enqueue(const Klass* klass) { _queue->enqueue(klass); } +JfrBuffer* JfrTraceIdKlassQueue::get_enqueue_buffer(Thread* thread) { + return _queue->thread_local_storage(thread); +} + +JfrBuffer* JfrTraceIdKlassQueue::renew_enqueue_buffer(size_t size, Thread* thread) { + return _queue->renew(size, thread); +} + void JfrTraceIdKlassQueue::iterate(klass_callback callback, bool previous_epoch) { assert_locked_or_safepoint(ClassLoaderDataGraph_lock); KlassFunctor functor(callback); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.hpp index 1a3779c8b33..52a17ec750c 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.hpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdKlassQueue.hpp @@ -28,6 +28,7 @@ #include "jfr/utilities/jfrAllocation.hpp" #include "jfr/utilities/jfrEpochQueue.hpp" +class JfrBuffer; class Klass; class Thread; @@ -47,7 +48,7 @@ class KlassFunctor { // It details how to store and process an enqueued Klass representation. See utilities/jfrEpochQueue.hpp. // template -class JfrEpochQueueKlassPolicy { +class JfrEpochQueueKlassPolicy : public JfrCHeapObj { public: typedef Buffer* BufferPtr; typedef Klass Type; @@ -64,8 +65,11 @@ class JfrEpochQueueKlassPolicy { }; class JfrTraceIdKlassQueue : public JfrCHeapObj { + friend class JfrTraceIdLoadBarrier; private: JfrEpochQueue* _queue; + JfrBuffer* get_enqueue_buffer(Thread* thread); + JfrBuffer* renew_enqueue_buffer(size_t size, Thread* thread); public: JfrTraceIdKlassQueue(); ~JfrTraceIdKlassQueue(); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp index b861b4142a2..f5e3612f254 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.cpp @@ -68,3 +68,11 @@ void JfrTraceIdLoadBarrier::do_klasses(klass_callback callback, bool previous_ep assert_locked_or_safepoint(ClassLoaderDataGraph_lock); klass_queue().iterate(callback, previous_epoch); } + +JfrBuffer* JfrTraceIdLoadBarrier::get_enqueue_buffer(Thread* thread) { + return klass_queue().get_enqueue_buffer(thread); +} + +JfrBuffer* JfrTraceIdLoadBarrier::renew_enqueue_buffer(size_t size, Thread* thread) { + return klass_queue().renew_enqueue_buffer(size, thread); +} diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp index 18635bbd660..7113a65bd42 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.hpp @@ -29,6 +29,7 @@ #include "memory/allocation.hpp" class ClassLoaderData; +class JfrBuffer; class Klass; class Method; class ModuleEntry; @@ -69,12 +70,16 @@ class PackageEntry; class JfrTraceIdLoadBarrier : AllStatic { friend class Jfr; friend class JfrCheckpointManager; + friend class JfrStackTrace; + friend class JfrThreadSampler; private: static bool initialize(); static void clear(); static void destroy(); static void enqueue(const Klass* klass); static void load_barrier(const Klass* klass); + static JfrBuffer* get_enqueue_buffer(Thread* thread); + static JfrBuffer* renew_enqueue_buffer(size_t size, Thread* thread); public: static traceid load(const ClassLoaderData* cld); static traceid load(const Klass* klass); diff --git a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp index ab5fa276c7b..925607cd6d5 100644 --- a/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp +++ b/src/hotspot/share/jfr/recorder/stacktrace/jfrStackTrace.cpp @@ -27,6 +27,7 @@ #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp" #include "jfr/recorder/repository/jfrChunkWriter.hpp" #include "jfr/recorder/stacktrace/jfrStackTrace.hpp" +#include "jfr/recorder/storage/jfrBuffer.hpp" #include "jfr/support/jfrMethodLookup.hpp" #include "memory/allocation.inline.hpp" #include "oops/instanceKlass.inline.hpp" @@ -175,11 +176,22 @@ void vframeStreamSamples::samples_next() { } while (!fill_from_frame()); } +static const size_t min_valid_free_size_bytes = 16; + +static inline bool is_full(const JfrBuffer* enqueue_buffer) { + return enqueue_buffer->free_size() < min_valid_free_size_bytes; +} + bool JfrStackTrace::record_thread(JavaThread& thread, frame& frame) { + // Explicitly monitor the available space of the thread-local buffer used for enqueuing klasses as part of tagging methods. + // We do this because if space becomes sparse, we cannot rely on the implicit allocation of a new buffer as part of the + // regular tag mechanism. If the free list is empty, a malloc could result, and the problem with that is that the thread + // we have suspended could be the holder of the malloc lock. If there is no more available space, the attempt is aborted. + const JfrBuffer* const enqueue_buffer = JfrTraceIdLoadBarrier::get_enqueue_buffer(Thread::current()); + assert(enqueue_buffer != nullptr, "invariant"); vframeStreamSamples st(&thread, frame, false); u4 count = 0; _reached_root = true; - _hash = 1; while (!st.at_end()) { if (count >= _max_frames) { @@ -187,7 +199,7 @@ bool JfrStackTrace::record_thread(JavaThread& thread, frame& frame) { break; } const Method* method = st.method(); - if (!Method::is_valid_method(method)) { + if (!Method::is_valid_method(method) || is_full(enqueue_buffer)) { // we throw away everything we've gathered in this sample since // none of it is safe return false; diff --git a/src/hotspot/share/jfr/utilities/jfrEpochQueue.hpp b/src/hotspot/share/jfr/utilities/jfrEpochQueue.hpp index 89c314f424e..66b08ec7a66 100644 --- a/src/hotspot/share/jfr/utilities/jfrEpochQueue.hpp +++ b/src/hotspot/share/jfr/utilities/jfrEpochQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -27,6 +27,8 @@ #include "jfr/recorder/storage/jfrEpochStorage.hpp" +class Thread; + /* * An ElmentPolicy template template argument provides the implementation for how elements * associated with the queue is encoded and managed by exposing the following members: @@ -43,7 +45,7 @@ * size_t operator()(const u1* next_element, Callback& callback, bool previous_epoch = false); */ template